diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundTaggedComponentGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundTaggedComponentGraphs.lean index 7ca2f4a51de73dac0d35d43f84bb0f2bc054a298..e022e3f84e9638b86b0e55d0910efb6ec10f9ae9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundTaggedComponentGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundTaggedComponentGraphs.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAttachmentEmbeddings - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def taggedComponentGraph (P I B N : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ ZFSet.prod {P} N, ∃ i ∈ I, ∃ n ∈ N, ∃ q ∈ B, - z = ZFSet.pair x i ∧ x = ZFSet.pair P n ∧ n = ZFSet.pair i q) - (ZFSet.prod (ZFSet.prod {P} N) I) - -theorem pair_mem_taggedComponentGraph (P I B N x i : ZFSet.{u}) : - ZFSet.pair x i ∈ taggedComponentGraph P I B N ↔ - i ∈ I ∧ ∃ q ∈ B, ZFSet.pair i q ∈ N ∧ x = ZFSet.pair P (ZFSet.pair i q) := by - rw [taggedComponentGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, y, _, j, hj, n, hn, q, hq, equal, value, rfl⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, q, hq, hn, value⟩ - · rintro ⟨hi, q, hq, hn, rfl⟩ - have hx : ZFSet.pair P (ZFSet.pair i q) ∈ ZFSet.prod {P} N := ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hn⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hi⟩, _, hx, i, hi, _, hn, q, hq, rfl, rfl, rfl⟩ - -theorem taggedComponentGraph_function {P I B N : ZFSet.{u}} (subset : N ⊆ ZFSet.prod I B) : - ZFSet.IsFunc (ZFSet.prod {P} N) I (taggedComponentGraph P I B N) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨p, hp, n, hn, rfl⟩ := ZFSet.mem_prod.1 hx - obtain rfl := ZFSet.mem_singleton.1 hp - obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (subset hn) - refine ⟨i, (pair_mem_taggedComponentGraph _ _ _ _ _ _).2 ⟨hi, q, hq, hn, rfl⟩, ?_⟩ - intro j hj - obtain ⟨_, r, _, _, equal⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 hj - exact ((ZFSet.pair_inj.1 ((ZFSet.pair_inj.1 equal).2)).1).symm - -namespace BoundedFormula - -def taggedComponentFormula : BoundedFormula 6 := - exMem 1 (exMem 3 (exMem 5 (exMem 7 - (.conj (orderedPairFormula 4 3 2) - (.conj (orderedPairFormula 3 9 1) (orderedPairFormula 1 2 0)))))) - -theorem truth_taggedComponentFormula (env : Fin 6 → ZFSet.{u}) : - Truth taggedComponentFormula env ↔ - ∃ x ∈ env 1, ∃ i ∈ env 2, ∃ n ∈ env 3, ∃ q ∈ env 4, - env 0 = ZFSet.pair x i ∧ x = ZFSet.pair (env 5) n ∧ n = ZFSet.pair i q := by - simp only [taggedComponentFormula, truth_exMem, Truth, truth_orderedPairFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem taggedComponentGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P I B N : ZFSet.{u}} (hP : P ∈ M.sets) (hI : I ∈ M.sets) - (hB : B ∈ M.sets) (hN : N ∈ M.sets) : taggedComponentGraph P I B N ∈ M.sets := by - have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - have hF := M.prod_mem pairing unions powers separation hSingle hN - let params := extend (ZFSet.prod {P} N) (extend I (extend N (extend B (extend P Fin.elim0)))) - have selected := M.bounded_separation_mem separation BoundedFormula.taggedComponentFormula params - (Fin.cases hF (Fin.cases hI (Fin.cases hN (Fin.cases hB (Fin.cases hP (fun j => Fin.elim0 j)))))) - (M.prod_mem pairing unions powers separation hF hI) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.taggedComponentFormula - (extend z params)) (ZFSet.prod (ZFSet.prod {P} N) I) = taggedComponentGraph P I B N := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, taggedComponentGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_taggedComponentFormula _) - exact equal ▸ selected -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAttachmentEmbeddings + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def taggedComponentGraph (P I B N : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ ZFSet.prod {P} N, ∃ i ∈ I, ∃ n ∈ N, ∃ q ∈ B, + z = ZFSet.pair x i ∧ x = ZFSet.pair P n ∧ n = ZFSet.pair i q) + (ZFSet.prod (ZFSet.prod {P} N) I) + +theorem pair_mem_taggedComponentGraph (P I B N x i : ZFSet.{u}) : + ZFSet.pair x i ∈ taggedComponentGraph P I B N ↔ + i ∈ I ∧ ∃ q ∈ B, ZFSet.pair i q ∈ N ∧ x = ZFSet.pair P (ZFSet.pair i q) := by + rw [taggedComponentGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, y, _, j, hj, n, hn, q, hq, equal, value, rfl⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, q, hq, hn, value⟩ + · rintro ⟨hi, q, hq, hn, rfl⟩ + have hx : ZFSet.pair P (ZFSet.pair i q) ∈ ZFSet.prod {P} N := ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hn⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hi⟩, _, hx, i, hi, _, hn, q, hq, rfl, rfl, rfl⟩ + +theorem taggedComponentGraph_function {P I B N : ZFSet.{u}} (subset : N ⊆ ZFSet.prod I B) : + ZFSet.IsFunc (ZFSet.prod {P} N) I (taggedComponentGraph P I B N) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨p, hp, n, hn, rfl⟩ := ZFSet.mem_prod.1 hx + obtain rfl := ZFSet.mem_singleton.1 hp + obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (subset hn) + refine ⟨i, (pair_mem_taggedComponentGraph _ _ _ _ _ _).2 ⟨hi, q, hq, hn, rfl⟩, ?_⟩ + intro j hj + obtain ⟨_, r, _, _, equal⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 hj + exact ((ZFSet.pair_inj.1 ((ZFSet.pair_inj.1 equal).2)).1).symm + +namespace BoundedFormula + +def taggedComponentFormula : BoundedFormula 6 := + exMem 1 (exMem 3 (exMem 5 (exMem 7 + (.conj (orderedPairFormula 4 3 2) + (.conj (orderedPairFormula 3 9 1) (orderedPairFormula 1 2 0)))))) + +theorem truth_taggedComponentFormula (env : Fin 6 → ZFSet.{u}) : + Truth taggedComponentFormula env ↔ + ∃ x ∈ env 1, ∃ i ∈ env 2, ∃ n ∈ env 3, ∃ q ∈ env 4, + env 0 = ZFSet.pair x i ∧ x = ZFSet.pair (env 5) n ∧ n = ZFSet.pair i q := by + simp only [taggedComponentFormula, truth_exMem, Truth, truth_orderedPairFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem taggedComponentGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P I B N : ZFSet.{u}} (hP : P ∈ M.sets) (hI : I ∈ M.sets) + (hB : B ∈ M.sets) (hN : N ∈ M.sets) : taggedComponentGraph P I B N ∈ M.sets := by + have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + have hF := M.prod_mem pairing unions powers separation hSingle hN + let params := extend (ZFSet.prod {P} N) (extend I (extend N (extend B (extend P Fin.elim0)))) + have selected := M.bounded_separation_mem separation BoundedFormula.taggedComponentFormula params + (Fin.cases hF (Fin.cases hI (Fin.cases hN (Fin.cases hB (Fin.cases hP (fun j => Fin.elim0 j)))))) + (M.prod_mem pairing unions powers separation hF hI) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.taggedComponentFormula + (extend z params)) (ZFSet.prod (ZFSet.prod {P} N) I) = taggedComponentGraph P I B N := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, taggedComponentGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_taggedComponentFormula _) + exact equal ▸ selected +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundVaryingPreparationRelations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundVaryingPreparationRelations.lean index a5a8dc78a4ac95d9ab6266f7abe9715e8e028920..bb5ab3519a34a0d8a65944628db8f453eabcfd95 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundVaryingPreparationRelations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundVaryingPreparationRelations.lean @@ -1,448 +1,448 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNicePreparationWitnessBounds -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -def StoredPreparationCode (upperOrder cutGraph meet omega C E : ZFSet.{u}) - (fields : Fin 15 → ZFSet.{u}) (p y : ZFSet.{u}) : Prop := - ∃ row A r k enumerations q, - p = ZFSet.pair row A ∧ y = ZFSet.pair r (ZFSet.pair k enumerations) ∧ - ZFSet.pair r p ∈ upperOrder ∧ ZFSet.pair r q ∈ cutGraph ∧ - PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) - meet (fields 14) (fields 13) (fields 9) omega (M.storedPreparationRequests A fields) - C E k enumerations - -private def transitionShape {n} (p y upperOrder cutGraph : Fin n) : BoundedFormula (n + 8) := - let old := suffixIndex n 8 - let v := prefixIndex n 8 - .conj (BoundedFormula.orderedPairFormula (old p) (v 0) (v 1)) - (.conj (BoundedFormula.orderedPairFormula (old y) (v 2) (v 5)) - (.conj (BoundedFormula.orderedPairFormula (v 5) (v 3) (v 4)) - (.conj (BoundedFormula.pairMembershipFormula (v 2) (old p) (old upperOrder)) - (BoundedFormula.pairMembershipFormula (v 2) (v 6) (old cutGraph))))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -private noncomputable def transitionBody {n} - (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula (n + 8) := - let old := suffixIndex n 8 - let v := prefixIndex n 8 - .conj (transitionShape p y upperOrder cutGraph).toFormula - (.conj (SetFormula.reindex (extend (v 7) (extend (v 1) (fun j => old (fields j)))) - (M.definable_storedPreparationRequests pairing unions powers separation).formula) - (preparedCertificateFamilyFormula (old (fields 7)) (old (fields 8)) (v 6) - (old (fields 10)) (old (fields 11)) (old meet) (old (fields 14)) - (old (fields 13)) (old (fields 9)) (old omega) (v 7) (old C) (old E) (v 3) (v 4))) - -noncomputable def storedPreparationFormula {n} - (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n := - exBlock 8 (transitionBody M pairing unions powers separation p y upperOrder cutGraph meet omega C E fields) - -theorem realize_storedPreparationFormula {n} - (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) : - Realize M.sets (M.storedPreparationFormula pairing unions powers separation - p y upperOrder cutGraph meet omega C E fields) env ↔ - M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega) - (env C) (env E) (fun j => env (fields j)) (env p) (env y) := by - unfold storedPreparationFormula - rw [realize_exBlock] - have actual (w : Fin 8 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : - Realize M.sets (transitionBody M pairing unions powers separation - p y upperOrder cutGraph meet omega C E fields) (extendMany 8 w env) ↔ - (env p = ZFSet.pair (w 0) (w 1) ∧ env y = ZFSet.pair (w 2) (w 5) ∧ - w 5 = ZFSet.pair (w 3) (w 4) ∧ ZFSet.pair (w 2) (env p) ∈ env upperOrder ∧ - ZFSet.pair (w 2) (w 6) ∈ env cutGraph) ∧ - w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) ∧ - PreparedCertificateFamilyCode M (env (fields 7)) (env (fields 8)) (w 6) - (env (fields 10)) (env (fields 11)) (env meet) (env (fields 14)) - (env (fields 13)) (env (fields 9)) (env omega) (w 7) (env C) (env E) (w 3) (w 4) := by - have allGround := extendMany_members 8 w env ground members - dsimp only [transitionBody] - rw [Realize, Realize, BoundedFormula.realize_toFormula M _ _ allGround] - have request : Realize M.sets (SetFormula.reindex - (extend (prefixIndex n 8 7) (extend (prefixIndex n 8 1) - (fun j => suffixIndex n 8 (fields j)))) - (M.definable_storedPreparationRequests pairing unions powers separation).formula) - (extendMany 8 w env) ↔ - w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) := by - rw [realize_reindex, map_extend, map_extend] - simp only [extendMany_prefix, extendMany_suffix] - exact (M.definable_storedPreparationRequests pairing unions powers separation).correct - (extend (w 1) (fun j => env (fields j))) - (Fin.cases (ground 1) (fun j => members (fields j))) (w 7) (ground 7) - rw [request, M.realize_preparedCertificateFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ allGround (by simpa only [extendMany_suffix] using meetCode)] - simp only [transitionShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, - BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨w, ground, body⟩ - obtain ⟨⟨input, output, tail, below, cut⟩, requests, prepared⟩ := (actual w ground).1 body - exact ⟨w 0, w 1, w 2, w 3, w 4, w 6, input, tail ▸ output, below, cut, requests ▸ prepared⟩ - · rintro ⟨row, A, r, k, enumerations, q, input, output, below, cut, prepared⟩ - have hp := input ▸ members p - have hy := output ▸ members y - have hTail := M.pair_right hy - have hq := M.pair_right (M.transitive (members cutGraph) cut) - let J := M.storedPreparationRequests A (fun j => env (fields j)) - have hJ := M.storedPreparationRequests_mem pairing unions powers separation (M.pair_right hp) - (fun j => env (fields j)) (fun j => members (fields j)) - let w : Fin 8 → ZFSet.{u} := ![row, A, r, k, enumerations, ZFSet.pair k enumerations, q, J] - have ground : ∀ j, w j ∈ M.sets := Fin.cases (M.pair_left hp) - (Fin.cases (M.pair_right hp) (Fin.cases (M.pair_left hy) - (Fin.cases (M.pair_left hTail) (Fin.cases (M.pair_right hTail) - (Fin.cases hTail (Fin.cases hq (Fin.cases hJ (fun j => Fin.elim0 j)))))))) - exact ⟨w, ground, (actual w ground).2 ⟨⟨input, output, rfl, below, cut⟩, rfl, prepared⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def storedPreparationRelation - (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u}) : ZFSet.{u} := - let W := M.groundRelations T Q - let C := M.supportedEqualityCertificateBound nodes W - let E := M.synchronizedEnumerationBound nodes W - let cut := rowAssignmentCutGraph Q (fields 7) levels alpha - ZFSet.sep (fun z => ∃ p y, z = ZFSet.pair p y ∧ - M.StoredPreparationCode upperOrder cut meet ZFSet.omega C E fields p y) - (ZFSet.prod Q (M.preparationWitnessBound nodes T Q)) - -theorem pair_mem_storedPreparationRelation - (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u}) - (p y : ZFSet.{u}) : - ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ↔ - p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧ - M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha) - meet ZFSet.omega (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) - (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by - rw [storedPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hp, hy⟩, p', y', eq, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hp, hy, code⟩ - · rintro ⟨hp, hy, code⟩ - exact ⟨⟨hp, hy⟩, p, y, rfl, code⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -private noncomputable def preparationEntryFormula {n} - (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n := - let old := suffixIndex n 2 - let v := prefixIndex n 2 - exBlock 2 (.conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)).toFormula - (M.storedPreparationFormula pairing unions powers separation - (v 0) (v 1) (old upperOrder) (old cutGraph) (old meet) (old omega) (old C) (old E) - (fun j => old (fields j)))) - -private theorem realize_preparationEntryFormula {n} - (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) : - Realize M.sets (preparationEntryFormula M pairing unions powers separation - z upperOrder cutGraph meet omega C E fields) env ↔ - ∃ p y, env z = ZFSet.pair p y ∧ - M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega) - (env C) (env E) (fun j => env (fields j)) p y := by - unfold preparationEntryFormula - rw [realize_exBlock] - have actual (w : Fin 2 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : - Realize M.sets (.conj - (BoundedFormula.orderedPairFormula (suffixIndex n 2 z) - (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula - (M.storedPreparationFormula pairing unions powers separation - (prefixIndex n 2 0) (prefixIndex n 2 1) (suffixIndex n 2 upperOrder) - (suffixIndex n 2 cutGraph) (suffixIndex n 2 meet) (suffixIndex n 2 omega) - (suffixIndex n 2 C) (suffixIndex n 2 E) (fun j => suffixIndex n 2 (fields j)))) - (extendMany 2 w env) ↔ - env z = ZFSet.pair (w 0) (w 1) ∧ - M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega) - (env C) (env E) (fun j => env (fields j)) (w 0) (w 1) := by - have allGround := extendMany_members 2 w env ground members - rw [Realize, BoundedFormula.realize_toFormula M _ _ allGround, - BoundedFormula.truth_orderedPairFormula, - M.realize_storedPreparationFormula pairing unions powers separation - _ _ _ _ _ _ _ _ _ _ allGround (by simpa only [extendMany_suffix] using meetCode)] - simp only [extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨w, ground, body⟩ - exact ⟨w 0, w 1, (actual w ground).1 body⟩ - · rintro ⟨p, y, equal, code⟩ - have hp := M.pair_left (equal ▸ members z) - have hy := M.pair_right (equal ▸ members z) - exact ⟨![p, y], Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)), - (actual ![p, y] (Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)))).2 ⟨equal, code⟩⟩ - -include pairing unions powers separation in -theorem storedPreparationRelation_mem - {Q upperOrder nodes T levels alpha meet : ZFSet.{u}} - (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hT : T ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hMeet : meet ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (fields : Fin 15 → ZFSet.{u}) (members : ∀ j, fields j ∈ M.sets) - (meetCode : MeetOrderCode (fields 10) (fields 11) meet) : - M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ∈ M.sets := by - let W := M.groundRelations T Q - let C := M.supportedEqualityCertificateBound nodes W - let E := M.synchronizedEnumerationBound nodes W - let cut := rowAssignmentCutGraph Q (fields 7) levels alpha - have hW := M.groundRelations_mem pairing unions powers separation hT hQ - have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega - have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega - have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation hQ (members 7) hLevels hAlpha - let params : Fin 21 → ZFSet.{u} := - extend upperOrder (extend cut (extend meet (extend ZFSet.omega (extend C (extend E fields))))) - have ground : ∀ j, params j ∈ M.sets := Fin.cases hOrder (Fin.cases hCut - (Fin.cases hMeet (Fin.cases omega (Fin.cases hC (Fin.cases hE members))))) - let slots : Fin 15 → Fin 22 := fun j => j.succ.succ.succ.succ.succ.succ.succ - let formula := preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots - have bound := M.prod_mem pairing unions powers separation hQ - (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega) - have selected := M.separation_mem separation formula params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params)) - (ZFSet.prod Q (M.preparationWitnessBound nodes T Q)) = - M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, storedPreparationRelation, ZFSet.mem_sep] - apply and_congr_right - intro hz - exact realize_preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots - (extend z params) (Fin.cases (M.transitive bound hz) ground) meetCode - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -def VaryingPreparationCode (packed Q upperOrder nodes T levels omega C E z : ZFSet.{u}) : Prop := - ∃ alpha p y, ∃ fields : Fin 15 → ZFSet.{u}, - z = ZFSet.pair (ZFSet.pair alpha p) y ∧ - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ - fields 6 = T ∧ fields 10 = nodes ∧ - MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ - M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha) - (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y - -theorem varyingPreparationCode_pair_iff (packed Q upperOrder nodes T levels omega C E alpha p y : ZFSet.{u}) : - M.VaryingPreparationCode packed Q upperOrder nodes T levels omega C E - (ZFSet.pair (ZFSet.pair alpha p) y) ↔ - ∃ fields : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ - fields 6 = T ∧ fields 10 = nodes ∧ - MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ - M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha) - (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y := by - constructor - · rintro ⟨alpha', p', y', fields, equal, rest⟩ - obtain ⟨input, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 input - exact ⟨fields, rest⟩ - · rintro ⟨fields, rest⟩ - exact ⟨alpha, p, y, fields, rfl, rest⟩ - -private def varyingShape {n} (z packed nodes T : Fin n) : BoundedFormula (n + 22) := - let old := suffixIndex n 22 - let v := prefixIndex n 22 - let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ - .conj (BoundedFormula.orderedPairFormula (old z) (v 3) (v 2)) - (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 1)) - (.conj (BoundedFormula.nonemptyTupleFormula 14 (v 4) f) - (.conj (BoundedFormula.pairMembershipFormula (v 0) (v 4) (old packed)) - (.conj (.equal (f 6) (old T)) (.equal (f 10) (old nodes)))))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -private noncomputable def varyingBody {n} - (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula (n + 22) := - let old := suffixIndex n 22 - let v := prefixIndex n 22 - let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ - .conj (varyingShape z packed nodes T).toFormula - (.conj (BoundedFormula.meetOrderFormula (f 10) (f 11) (v 5)).toFormula - (.conj (rowAssignmentCutGraphFormula (v 6) (old Q) (f 7) (old levels) (v 0)) - (M.storedPreparationFormula pairing unions powers separation - (v 1) (v 2) (old upperOrder) (v 6) (v 5) (old omega) (old C) (old E) f))) - -noncomputable def varyingPreparationFormula {n} - (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula n := - exBlock 22 (varyingBody M pairing unions powers separation z packed Q upperOrder nodes T levels omega C E) - -theorem realize_varyingPreparationFormula {n} - (z packed Q upperOrder nodes T levels omega C E : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.varyingPreparationFormula pairing unions powers separation - z packed Q upperOrder nodes T levels omega C E) env ↔ - M.VaryingPreparationCode (env packed) (env Q) (env upperOrder) (env nodes) (env T) - (env levels) (env omega) (env C) (env E) (env z) := by - unfold varyingPreparationFormula - rw [realize_exBlock] - let fs := fun w : Fin 22 → ZFSet.{u} => fun j : Fin 15 => - w j.succ.succ.succ.succ.succ.succ.succ - have actual (w : Fin 22 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : - Realize M.sets (varyingBody M pairing unions powers separation - z packed Q upperOrder nodes T levels omega C E) (extendMany 22 w env) ↔ - (env z = ZFSet.pair (w 3) (w 2) ∧ w 3 = ZFSet.pair (w 0) (w 1) ∧ - w 4 = refinementFormulaDataCode (fs w) ∧ ZFSet.pair (w 0) (w 4) ∈ env packed ∧ - fs w 6 = env T ∧ fs w 10 = env nodes) ∧ - MeetOrderCode (fs w 10) (fs w 11) (w 5) ∧ - w 6 = rowAssignmentCutGraph (env Q) (fs w 7) (env levels) (w 0) ∧ - M.StoredPreparationCode (env upperOrder) (w 6) (w 5) (env omega) - (env C) (env E) (fs w) (w 1) (w 2) := by - have allGround := extendMany_members 22 w env ground members - dsimp only [varyingBody] - rw [Realize, Realize, Realize, - BoundedFormula.realize_toFormula M _ _ allGround, - BoundedFormula.realize_toFormula M _ _ allGround, - BoundedFormula.truth_meetOrderFormula, - M.realize_rowAssignmentCutGraphFormula pairing unions powers separation _ _ _ _ _ _ allGround] - simp only [varyingShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, - BoundedFormula.truth_nonemptyTupleFormula, BoundedFormula.truth_pairMembershipFormula, - extendMany_prefix, extendMany_suffix] - apply and_congr_right - intro _shape - apply and_congr_right - intro meet - apply and_congr_right - intro _cut - simpa only [extendMany_prefix, extendMany_suffix] using - (M.realize_storedPreparationFormula pairing unions powers separation - (prefixIndex n 22 1) (prefixIndex n 22 2) (suffixIndex n 22 upperOrder) - (prefixIndex n 22 6) (prefixIndex n 22 5) (suffixIndex n 22 omega) - (suffixIndex n 22 C) (suffixIndex n 22 E) - (fun j : Fin 15 => prefixIndex n 22 j.succ.succ.succ.succ.succ.succ.succ) - (extendMany 22 w env) allGround (by simpa only [extendMany_prefix] using meet)) - constructor - · rintro ⟨w, ground, body⟩ - obtain ⟨⟨outer, input, tuple, stored, terms, nodesEq⟩, meet, cut, prepared⟩ := - (actual w ground).1 body - have canonical := meet.eq_canonicalMeetGraph - refine ⟨w 0, w 1, w 2, fs w, input ▸ outer, tuple ▸ stored, terms, nodesEq, - canonical ▸ meet, ?_⟩ - rw [canonical, cut] at prepared - exact prepared - · rintro ⟨alpha, p, y, fields, outer, stored, terms, nodesEq, meet, prepared⟩ - have hInput := M.pair_left (outer ▸ members z) - have hAlpha := M.pair_left hInput - have hp := M.pair_right hInput - have hy := M.pair_right (outer ▸ members z) - have hRecord := M.pair_right (M.transitive (members packed) stored) - have hFields := M.refinementFormulaDataCode_fields_mem fields hRecord - let mu := canonicalMeetGraph (fields 10) (fields 11) - let cut := rowAssignmentCutGraph (env Q) (fields 7) (env levels) alpha - have hMu := M.canonicalMeetGraph_mem pairing unions powers separation (hFields 10) (hFields 11) - have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation - (members Q) (hFields 7) (members levels) hAlpha - let w : Fin 22 → ZFSet.{u} := extend alpha (extend p (extend y - (extend (ZFSet.pair alpha p) (extend (refinementFormulaDataCode fields) - (extend mu (extend cut fields)))))) - have ground : ∀ j, w j ∈ M.sets := Fin.cases hAlpha (Fin.cases hp (Fin.cases hy - (Fin.cases hInput (Fin.cases hRecord (Fin.cases hMu (Fin.cases hCut hFields)))))) - exact ⟨w, ground, (actual w ground).2 - ⟨⟨outer, rfl, rfl, stored, terms, nodesEq⟩, meet, rfl, prepared⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def varyingPreparationRelation - (stages packed Q upperOrder nodes T : ZFSet.{u}) : ZFSet.{u} := - let W := M.groundRelations T Q - let C := M.supportedEqualityCertificateBound nodes W - let E := M.synchronizedEnumerationBound nodes W - let levels := refinementDataHistoryLevels stages packed T - ZFSet.sep (M.VaryingPreparationCode packed Q upperOrder nodes T levels ZFSet.omega C E) - (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q)) - -theorem pair_mem_varyingPreparationRelation - (stages packed Q upperOrder nodes T alpha p y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair alpha p) y ∈ - M.varyingPreparationRelation stages packed Q upperOrder nodes T ↔ - alpha ∈ stages ∧ p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧ - ∃ fields : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ - fields 6 = T ∧ fields 10 = nodes ∧ - MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ - M.StoredPreparationCode upperOrder - (rowAssignmentCutGraph Q (fields 7) (refinementDataHistoryLevels stages packed T) alpha) - (canonicalMeetGraph (fields 10) (fields 11)) ZFSet.omega - (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) - (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by - simp only [varyingPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod, - M.varyingPreparationCode_pair_iff, and_assoc] - -include M in - theorem varyingPreparationRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {stages packed Q upperOrder nodes T : ZFSet.{u}} - (hStages : stages ∈ M.sets) (hPacked : packed ∈ M.sets) - (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets) - (hNodes : nodes ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.varyingPreparationRelation stages packed Q upperOrder nodes T ∈ M.sets := by - let W := M.groundRelations T Q - let C := M.supportedEqualityCertificateBound nodes W - let E := M.synchronizedEnumerationBound nodes W - let levels := refinementDataHistoryLevels stages packed T - have hW := M.groundRelations_mem pairing unions powers separation hT hQ - have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega - have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega - have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hPacked hT - let params : Fin 9 → ZFSet.{u} := ![packed, Q, upperOrder, nodes, T, levels, ZFSet.omega, C, E] - have ground : ∀ j, params j ∈ M.sets := Fin.cases hPacked (Fin.cases hQ - (Fin.cases hOrder (Fin.cases hNodes (Fin.cases hT (Fin.cases hLevels - (Fin.cases omega (Fin.cases hC (Fin.cases hE (fun j => Fin.elim0 j))))))))) - let formula : SetFormula 10 := - M.varyingPreparationFormula pairing unions powers separation 0 1 2 3 4 5 6 7 8 9 - have bound := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hStages hQ) - (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega) - have selected := M.separation_mem separation formula params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params)) - (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q)) = - M.varyingPreparationRelation stages packed Q upperOrder nodes T := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, varyingPreparationRelation, ZFSet.mem_sep] - apply and_congr_right - intro hz - exact M.realize_varyingPreparationFormula pairing unions powers separation - 0 1 2 3 4 5 6 7 8 9 (extend z params) (Fin.cases (M.transitive bound hz) ground) - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNicePreparationWitnessBounds +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +def StoredPreparationCode (upperOrder cutGraph meet omega C E : ZFSet.{u}) + (fields : Fin 15 → ZFSet.{u}) (p y : ZFSet.{u}) : Prop := + ∃ row A r k enumerations q, + p = ZFSet.pair row A ∧ y = ZFSet.pair r (ZFSet.pair k enumerations) ∧ + ZFSet.pair r p ∈ upperOrder ∧ ZFSet.pair r q ∈ cutGraph ∧ + PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) + meet (fields 14) (fields 13) (fields 9) omega (M.storedPreparationRequests A fields) + C E k enumerations + +private def transitionShape {n} (p y upperOrder cutGraph : Fin n) : BoundedFormula (n + 8) := + let old := suffixIndex n 8 + let v := prefixIndex n 8 + .conj (BoundedFormula.orderedPairFormula (old p) (v 0) (v 1)) + (.conj (BoundedFormula.orderedPairFormula (old y) (v 2) (v 5)) + (.conj (BoundedFormula.orderedPairFormula (v 5) (v 3) (v 4)) + (.conj (BoundedFormula.pairMembershipFormula (v 2) (old p) (old upperOrder)) + (BoundedFormula.pairMembershipFormula (v 2) (v 6) (old cutGraph))))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +private noncomputable def transitionBody {n} + (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula (n + 8) := + let old := suffixIndex n 8 + let v := prefixIndex n 8 + .conj (transitionShape p y upperOrder cutGraph).toFormula + (.conj (SetFormula.reindex (extend (v 7) (extend (v 1) (fun j => old (fields j)))) + (M.definable_storedPreparationRequests pairing unions powers separation).formula) + (preparedCertificateFamilyFormula (old (fields 7)) (old (fields 8)) (v 6) + (old (fields 10)) (old (fields 11)) (old meet) (old (fields 14)) + (old (fields 13)) (old (fields 9)) (old omega) (v 7) (old C) (old E) (v 3) (v 4))) + +noncomputable def storedPreparationFormula {n} + (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n := + exBlock 8 (transitionBody M pairing unions powers separation p y upperOrder cutGraph meet omega C E fields) + +theorem realize_storedPreparationFormula {n} + (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) : + Realize M.sets (M.storedPreparationFormula pairing unions powers separation + p y upperOrder cutGraph meet omega C E fields) env ↔ + M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega) + (env C) (env E) (fun j => env (fields j)) (env p) (env y) := by + unfold storedPreparationFormula + rw [realize_exBlock] + have actual (w : Fin 8 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : + Realize M.sets (transitionBody M pairing unions powers separation + p y upperOrder cutGraph meet omega C E fields) (extendMany 8 w env) ↔ + (env p = ZFSet.pair (w 0) (w 1) ∧ env y = ZFSet.pair (w 2) (w 5) ∧ + w 5 = ZFSet.pair (w 3) (w 4) ∧ ZFSet.pair (w 2) (env p) ∈ env upperOrder ∧ + ZFSet.pair (w 2) (w 6) ∈ env cutGraph) ∧ + w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) ∧ + PreparedCertificateFamilyCode M (env (fields 7)) (env (fields 8)) (w 6) + (env (fields 10)) (env (fields 11)) (env meet) (env (fields 14)) + (env (fields 13)) (env (fields 9)) (env omega) (w 7) (env C) (env E) (w 3) (w 4) := by + have allGround := extendMany_members 8 w env ground members + dsimp only [transitionBody] + rw [Realize, Realize, BoundedFormula.realize_toFormula M _ _ allGround] + have request : Realize M.sets (SetFormula.reindex + (extend (prefixIndex n 8 7) (extend (prefixIndex n 8 1) + (fun j => suffixIndex n 8 (fields j)))) + (M.definable_storedPreparationRequests pairing unions powers separation).formula) + (extendMany 8 w env) ↔ + w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) := by + rw [realize_reindex, map_extend, map_extend] + simp only [extendMany_prefix, extendMany_suffix] + exact (M.definable_storedPreparationRequests pairing unions powers separation).correct + (extend (w 1) (fun j => env (fields j))) + (Fin.cases (ground 1) (fun j => members (fields j))) (w 7) (ground 7) + rw [request, M.realize_preparedCertificateFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ allGround (by simpa only [extendMany_suffix] using meetCode)] + simp only [transitionShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, + BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨w, ground, body⟩ + obtain ⟨⟨input, output, tail, below, cut⟩, requests, prepared⟩ := (actual w ground).1 body + exact ⟨w 0, w 1, w 2, w 3, w 4, w 6, input, tail ▸ output, below, cut, requests ▸ prepared⟩ + · rintro ⟨row, A, r, k, enumerations, q, input, output, below, cut, prepared⟩ + have hp := input ▸ members p + have hy := output ▸ members y + have hTail := M.pair_right hy + have hq := M.pair_right (M.transitive (members cutGraph) cut) + let J := M.storedPreparationRequests A (fun j => env (fields j)) + have hJ := M.storedPreparationRequests_mem pairing unions powers separation (M.pair_right hp) + (fun j => env (fields j)) (fun j => members (fields j)) + let w : Fin 8 → ZFSet.{u} := ![row, A, r, k, enumerations, ZFSet.pair k enumerations, q, J] + have ground : ∀ j, w j ∈ M.sets := Fin.cases (M.pair_left hp) + (Fin.cases (M.pair_right hp) (Fin.cases (M.pair_left hy) + (Fin.cases (M.pair_left hTail) (Fin.cases (M.pair_right hTail) + (Fin.cases hTail (Fin.cases hq (Fin.cases hJ (fun j => Fin.elim0 j)))))))) + exact ⟨w, ground, (actual w ground).2 ⟨⟨input, output, rfl, below, cut⟩, rfl, prepared⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def storedPreparationRelation + (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u}) : ZFSet.{u} := + let W := M.groundRelations T Q + let C := M.supportedEqualityCertificateBound nodes W + let E := M.synchronizedEnumerationBound nodes W + let cut := rowAssignmentCutGraph Q (fields 7) levels alpha + ZFSet.sep (fun z => ∃ p y, z = ZFSet.pair p y ∧ + M.StoredPreparationCode upperOrder cut meet ZFSet.omega C E fields p y) + (ZFSet.prod Q (M.preparationWitnessBound nodes T Q)) + +theorem pair_mem_storedPreparationRelation + (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u}) + (p y : ZFSet.{u}) : + ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ↔ + p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧ + M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha) + meet ZFSet.omega (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) + (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by + rw [storedPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hp, hy⟩, p', y', eq, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hp, hy, code⟩ + · rintro ⟨hp, hy, code⟩ + exact ⟨⟨hp, hy⟩, p, y, rfl, code⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +private noncomputable def preparationEntryFormula {n} + (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n := + let old := suffixIndex n 2 + let v := prefixIndex n 2 + exBlock 2 (.conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)).toFormula + (M.storedPreparationFormula pairing unions powers separation + (v 0) (v 1) (old upperOrder) (old cutGraph) (old meet) (old omega) (old C) (old E) + (fun j => old (fields j)))) + +private theorem realize_preparationEntryFormula {n} + (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) : + Realize M.sets (preparationEntryFormula M pairing unions powers separation + z upperOrder cutGraph meet omega C E fields) env ↔ + ∃ p y, env z = ZFSet.pair p y ∧ + M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega) + (env C) (env E) (fun j => env (fields j)) p y := by + unfold preparationEntryFormula + rw [realize_exBlock] + have actual (w : Fin 2 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : + Realize M.sets (.conj + (BoundedFormula.orderedPairFormula (suffixIndex n 2 z) + (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula + (M.storedPreparationFormula pairing unions powers separation + (prefixIndex n 2 0) (prefixIndex n 2 1) (suffixIndex n 2 upperOrder) + (suffixIndex n 2 cutGraph) (suffixIndex n 2 meet) (suffixIndex n 2 omega) + (suffixIndex n 2 C) (suffixIndex n 2 E) (fun j => suffixIndex n 2 (fields j)))) + (extendMany 2 w env) ↔ + env z = ZFSet.pair (w 0) (w 1) ∧ + M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega) + (env C) (env E) (fun j => env (fields j)) (w 0) (w 1) := by + have allGround := extendMany_members 2 w env ground members + rw [Realize, BoundedFormula.realize_toFormula M _ _ allGround, + BoundedFormula.truth_orderedPairFormula, + M.realize_storedPreparationFormula pairing unions powers separation + _ _ _ _ _ _ _ _ _ _ allGround (by simpa only [extendMany_suffix] using meetCode)] + simp only [extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨w, ground, body⟩ + exact ⟨w 0, w 1, (actual w ground).1 body⟩ + · rintro ⟨p, y, equal, code⟩ + have hp := M.pair_left (equal ▸ members z) + have hy := M.pair_right (equal ▸ members z) + exact ⟨![p, y], Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)), + (actual ![p, y] (Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)))).2 ⟨equal, code⟩⟩ + +include pairing unions powers separation in +theorem storedPreparationRelation_mem + {Q upperOrder nodes T levels alpha meet : ZFSet.{u}} + (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hT : T ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hMeet : meet ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (fields : Fin 15 → ZFSet.{u}) (members : ∀ j, fields j ∈ M.sets) + (meetCode : MeetOrderCode (fields 10) (fields 11) meet) : + M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ∈ M.sets := by + let W := M.groundRelations T Q + let C := M.supportedEqualityCertificateBound nodes W + let E := M.synchronizedEnumerationBound nodes W + let cut := rowAssignmentCutGraph Q (fields 7) levels alpha + have hW := M.groundRelations_mem pairing unions powers separation hT hQ + have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega + have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega + have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation hQ (members 7) hLevels hAlpha + let params : Fin 21 → ZFSet.{u} := + extend upperOrder (extend cut (extend meet (extend ZFSet.omega (extend C (extend E fields))))) + have ground : ∀ j, params j ∈ M.sets := Fin.cases hOrder (Fin.cases hCut + (Fin.cases hMeet (Fin.cases omega (Fin.cases hC (Fin.cases hE members))))) + let slots : Fin 15 → Fin 22 := fun j => j.succ.succ.succ.succ.succ.succ.succ + let formula := preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots + have bound := M.prod_mem pairing unions powers separation hQ + (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega) + have selected := M.separation_mem separation formula params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params)) + (ZFSet.prod Q (M.preparationWitnessBound nodes T Q)) = + M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, storedPreparationRelation, ZFSet.mem_sep] + apply and_congr_right + intro hz + exact realize_preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots + (extend z params) (Fin.cases (M.transitive bound hz) ground) meetCode + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +def VaryingPreparationCode (packed Q upperOrder nodes T levels omega C E z : ZFSet.{u}) : Prop := + ∃ alpha p y, ∃ fields : Fin 15 → ZFSet.{u}, + z = ZFSet.pair (ZFSet.pair alpha p) y ∧ + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ + fields 6 = T ∧ fields 10 = nodes ∧ + MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ + M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha) + (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y + +theorem varyingPreparationCode_pair_iff (packed Q upperOrder nodes T levels omega C E alpha p y : ZFSet.{u}) : + M.VaryingPreparationCode packed Q upperOrder nodes T levels omega C E + (ZFSet.pair (ZFSet.pair alpha p) y) ↔ + ∃ fields : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ + fields 6 = T ∧ fields 10 = nodes ∧ + MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ + M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha) + (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y := by + constructor + · rintro ⟨alpha', p', y', fields, equal, rest⟩ + obtain ⟨input, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 input + exact ⟨fields, rest⟩ + · rintro ⟨fields, rest⟩ + exact ⟨alpha, p, y, fields, rfl, rest⟩ + +private def varyingShape {n} (z packed nodes T : Fin n) : BoundedFormula (n + 22) := + let old := suffixIndex n 22 + let v := prefixIndex n 22 + let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ + .conj (BoundedFormula.orderedPairFormula (old z) (v 3) (v 2)) + (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 1)) + (.conj (BoundedFormula.nonemptyTupleFormula 14 (v 4) f) + (.conj (BoundedFormula.pairMembershipFormula (v 0) (v 4) (old packed)) + (.conj (.equal (f 6) (old T)) (.equal (f 10) (old nodes)))))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +private noncomputable def varyingBody {n} + (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula (n + 22) := + let old := suffixIndex n 22 + let v := prefixIndex n 22 + let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ + .conj (varyingShape z packed nodes T).toFormula + (.conj (BoundedFormula.meetOrderFormula (f 10) (f 11) (v 5)).toFormula + (.conj (rowAssignmentCutGraphFormula (v 6) (old Q) (f 7) (old levels) (v 0)) + (M.storedPreparationFormula pairing unions powers separation + (v 1) (v 2) (old upperOrder) (v 6) (v 5) (old omega) (old C) (old E) f))) + +noncomputable def varyingPreparationFormula {n} + (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula n := + exBlock 22 (varyingBody M pairing unions powers separation z packed Q upperOrder nodes T levels omega C E) + +theorem realize_varyingPreparationFormula {n} + (z packed Q upperOrder nodes T levels omega C E : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.varyingPreparationFormula pairing unions powers separation + z packed Q upperOrder nodes T levels omega C E) env ↔ + M.VaryingPreparationCode (env packed) (env Q) (env upperOrder) (env nodes) (env T) + (env levels) (env omega) (env C) (env E) (env z) := by + unfold varyingPreparationFormula + rw [realize_exBlock] + let fs := fun w : Fin 22 → ZFSet.{u} => fun j : Fin 15 => + w j.succ.succ.succ.succ.succ.succ.succ + have actual (w : Fin 22 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : + Realize M.sets (varyingBody M pairing unions powers separation + z packed Q upperOrder nodes T levels omega C E) (extendMany 22 w env) ↔ + (env z = ZFSet.pair (w 3) (w 2) ∧ w 3 = ZFSet.pair (w 0) (w 1) ∧ + w 4 = refinementFormulaDataCode (fs w) ∧ ZFSet.pair (w 0) (w 4) ∈ env packed ∧ + fs w 6 = env T ∧ fs w 10 = env nodes) ∧ + MeetOrderCode (fs w 10) (fs w 11) (w 5) ∧ + w 6 = rowAssignmentCutGraph (env Q) (fs w 7) (env levels) (w 0) ∧ + M.StoredPreparationCode (env upperOrder) (w 6) (w 5) (env omega) + (env C) (env E) (fs w) (w 1) (w 2) := by + have allGround := extendMany_members 22 w env ground members + dsimp only [varyingBody] + rw [Realize, Realize, Realize, + BoundedFormula.realize_toFormula M _ _ allGround, + BoundedFormula.realize_toFormula M _ _ allGround, + BoundedFormula.truth_meetOrderFormula, + M.realize_rowAssignmentCutGraphFormula pairing unions powers separation _ _ _ _ _ _ allGround] + simp only [varyingShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, + BoundedFormula.truth_nonemptyTupleFormula, BoundedFormula.truth_pairMembershipFormula, + extendMany_prefix, extendMany_suffix] + apply and_congr_right + intro _shape + apply and_congr_right + intro meet + apply and_congr_right + intro _cut + simpa only [extendMany_prefix, extendMany_suffix] using + (M.realize_storedPreparationFormula pairing unions powers separation + (prefixIndex n 22 1) (prefixIndex n 22 2) (suffixIndex n 22 upperOrder) + (prefixIndex n 22 6) (prefixIndex n 22 5) (suffixIndex n 22 omega) + (suffixIndex n 22 C) (suffixIndex n 22 E) + (fun j : Fin 15 => prefixIndex n 22 j.succ.succ.succ.succ.succ.succ.succ) + (extendMany 22 w env) allGround (by simpa only [extendMany_prefix] using meet)) + constructor + · rintro ⟨w, ground, body⟩ + obtain ⟨⟨outer, input, tuple, stored, terms, nodesEq⟩, meet, cut, prepared⟩ := + (actual w ground).1 body + have canonical := meet.eq_canonicalMeetGraph + refine ⟨w 0, w 1, w 2, fs w, input ▸ outer, tuple ▸ stored, terms, nodesEq, + canonical ▸ meet, ?_⟩ + rw [canonical, cut] at prepared + exact prepared + · rintro ⟨alpha, p, y, fields, outer, stored, terms, nodesEq, meet, prepared⟩ + have hInput := M.pair_left (outer ▸ members z) + have hAlpha := M.pair_left hInput + have hp := M.pair_right hInput + have hy := M.pair_right (outer ▸ members z) + have hRecord := M.pair_right (M.transitive (members packed) stored) + have hFields := M.refinementFormulaDataCode_fields_mem fields hRecord + let mu := canonicalMeetGraph (fields 10) (fields 11) + let cut := rowAssignmentCutGraph (env Q) (fields 7) (env levels) alpha + have hMu := M.canonicalMeetGraph_mem pairing unions powers separation (hFields 10) (hFields 11) + have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation + (members Q) (hFields 7) (members levels) hAlpha + let w : Fin 22 → ZFSet.{u} := extend alpha (extend p (extend y + (extend (ZFSet.pair alpha p) (extend (refinementFormulaDataCode fields) + (extend mu (extend cut fields)))))) + have ground : ∀ j, w j ∈ M.sets := Fin.cases hAlpha (Fin.cases hp (Fin.cases hy + (Fin.cases hInput (Fin.cases hRecord (Fin.cases hMu (Fin.cases hCut hFields)))))) + exact ⟨w, ground, (actual w ground).2 + ⟨⟨outer, rfl, rfl, stored, terms, nodesEq⟩, meet, rfl, prepared⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def varyingPreparationRelation + (stages packed Q upperOrder nodes T : ZFSet.{u}) : ZFSet.{u} := + let W := M.groundRelations T Q + let C := M.supportedEqualityCertificateBound nodes W + let E := M.synchronizedEnumerationBound nodes W + let levels := refinementDataHistoryLevels stages packed T + ZFSet.sep (M.VaryingPreparationCode packed Q upperOrder nodes T levels ZFSet.omega C E) + (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q)) + +theorem pair_mem_varyingPreparationRelation + (stages packed Q upperOrder nodes T alpha p y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair alpha p) y ∈ + M.varyingPreparationRelation stages packed Q upperOrder nodes T ↔ + alpha ∈ stages ∧ p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧ + ∃ fields : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ + fields 6 = T ∧ fields 10 = nodes ∧ + MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ + M.StoredPreparationCode upperOrder + (rowAssignmentCutGraph Q (fields 7) (refinementDataHistoryLevels stages packed T) alpha) + (canonicalMeetGraph (fields 10) (fields 11)) ZFSet.omega + (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) + (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by + simp only [varyingPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod, + M.varyingPreparationCode_pair_iff, and_assoc] + +include M in + theorem varyingPreparationRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {stages packed Q upperOrder nodes T : ZFSet.{u}} + (hStages : stages ∈ M.sets) (hPacked : packed ∈ M.sets) + (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets) + (hNodes : nodes ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.varyingPreparationRelation stages packed Q upperOrder nodes T ∈ M.sets := by + let W := M.groundRelations T Q + let C := M.supportedEqualityCertificateBound nodes W + let E := M.synchronizedEnumerationBound nodes W + let levels := refinementDataHistoryLevels stages packed T + have hW := M.groundRelations_mem pairing unions powers separation hT hQ + have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega + have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega + have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hPacked hT + let params : Fin 9 → ZFSet.{u} := ![packed, Q, upperOrder, nodes, T, levels, ZFSet.omega, C, E] + have ground : ∀ j, params j ∈ M.sets := Fin.cases hPacked (Fin.cases hQ + (Fin.cases hOrder (Fin.cases hNodes (Fin.cases hT (Fin.cases hLevels + (Fin.cases omega (Fin.cases hC (Fin.cases hE (fun j => Fin.elim0 j))))))))) + let formula : SetFormula 10 := + M.varyingPreparationFormula pairing unions powers separation 0 1 2 3 4 5 6 7 8 9 + have bound := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hStages hQ) + (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega) + have selected := M.separation_mem separation formula params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params)) + (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q)) = + M.varyingPreparationRelation stages packed Q upperOrder nodes T := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, varyingPreparationRelation, ZFSet.mem_sep] + apply and_congr_right + intro hz + exact M.realize_varyingPreparationFormula pairing unions powers separation + 0 1 2 3 4 5 6 7 8 9 (extend z params) (Fin.cases (M.transitive bound hz) ground) + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/HistoryFieldFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/HistoryFieldFormulas.lean index 88662708ebd8331b53454f57dfc82297781b8abc..cedc5d9ad6ec26873a9a7c5c773a5a749f712908 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/HistoryFieldFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/HistoryFieldFormulas.lean @@ -1,124 +1,124 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveStateFieldEnvironments - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u -namespace SetFormula - -def stateFieldFormula {n} (code value : Fin n) (j : Fin 13) : SetFormula n := - exBlock 13 (.conj - (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 code) (prefixIndex n 13)).toFormula - (.equal (suffixIndex n 13 value) (prefixIndex n 13 j))) - -def historyFieldValueFormula {n} (index value history : Fin n) (j : Fin 13) : SetFormula n := - ex (.conj (BoundedFormula.pairMembershipFormula index.succ 0 history.succ).toFormula - (stateFieldFormula 0 value.succ j)) - -def historyFieldPairFormula {n} (index output history : Fin n) (j : Fin 13) : SetFormula n := - ex (.conj (historyFieldValueFormula index.succ 0 history.succ j) - (BoundedFormula.orderedPairFormula output.succ index.succ 0).toFormula) - -end SetFormula - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_stateFieldFormula {n} (code value : Fin n) (j : Fin 13) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (state : RecursiveStateData.{u}) (coded : env code = state.code) : - Realize M.sets (stateFieldFormula code value j) env ↔ env value = state.field j := by - rw [stateFieldFormula, realize_exBlock] - constructor - · rintro ⟨fields, fieldMembers, tuple, entry⟩ - have equal := (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code) - (prefixIndex n 13) _).1 - ((BoundedFormula.realize_toFormula M _ _ (extendMany_members 13 fields env fieldMembers members)).1 tuple) - simp only [extendMany_suffix, extendMany_prefix] at equal - have fieldsEqual : fields = state.field := - nonemptyTupleCode_injective 12 (equal.symm.trans coded) - change extendMany 13 fields env (suffixIndex n 13 value) = - extendMany 13 fields env (prefixIndex n 13 j) at entry - simpa only [extendMany_suffix, extendMany_prefix, fieldsEqual] using entry - · intro equal - have fieldMembers := M.recursiveStateData_field_mem state (coded ▸ members code) - refine ⟨state.field, fieldMembers, ?_, ?_⟩ - · apply (BoundedFormula.realize_toFormula M _ _ - (extendMany_members 13 state.field env fieldMembers members)).2 - apply (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code) - (prefixIndex n 13) _).2 - simp only [extendMany_suffix, extendMany_prefix] - exact coded - · change extendMany 13 state.field env (suffixIndex n 13 value) = - extendMany 13 state.field env (prefixIndex n 13 j) - simpa only [extendMany_suffix, extendMany_prefix] using equal - -theorem realize_historyFieldValueFormula {k} (index value history : Fin k) (j : Fin 13) - (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (states : Nat → RecursiveStateData.{u}) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) - (n : Nat) (indexEq : env index = natSetCode n) : - Realize M.sets (historyFieldValueFormula index value history j) env ↔ - env value = (states n).field j := by - rw [historyFieldValueFormula, realize_ex] - constructor - · rintro ⟨code, hcode, entry, projected⟩ - have extended : ∀ i, extend code env i ∈ M.sets := Fin.cases hcode members - have actual := (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).1 - ((BoundedFormula.realize_toFormula M _ _ extended).1 entry) - change ZFSet.pair (env index) code ∈ env history at actual - rw [indexEq] at actual - exact (M.realize_stateFieldFormula 0 value.succ j (extend code env) extended - (states n) ((entries n code).1 actual)).1 projected - · intro equal - have entry : ZFSet.pair (natSetCode n) (states n).code ∈ env history := - (entries n _).2 rfl - have hcode := M.pair_right (M.transitive (members history) entry) - have extended : ∀ i, extend (states n).code env i ∈ M.sets := Fin.cases hcode members - refine ⟨(states n).code, hcode, ?_, ?_⟩ - · apply (BoundedFormula.realize_toFormula M _ _ extended).2 - apply (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).2 - change ZFSet.pair (env index) (states n).code ∈ env history - exact indexEq.symm ▸ entry - · exact (M.realize_stateFieldFormula 0 value.succ j _ extended (states n) rfl).2 equal - -theorem realize_historyFieldPairFormula {k} (index output history : Fin k) (j : Fin 13) - (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (states : Nat → RecursiveStateData.{u}) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) - (n : Nat) (indexEq : env index = natSetCode n) : - Realize M.sets (historyFieldPairFormula index output history j) env ↔ - env output = ZFSet.pair (natSetCode n) ((states n).field j) := by - rw [historyFieldPairFormula, realize_ex] - constructor - · rintro ⟨value, hvalue, specified, pair⟩ - have extended : ∀ i, extend value env i ∈ M.sets := Fin.cases hvalue members - have valueEq := (M.realize_historyFieldValueFormula index.succ 0 history.succ j - (extend value env) extended states entries n indexEq).1 specified - have pairEq := (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).1 - ((BoundedFormula.realize_toFormula M _ _ extended).1 pair) - change env output = ZFSet.pair (env index) value at pairEq - exact pairEq.trans (congrArg₂ ZFSet.pair indexEq valueEq) - · intro equal - have codeM := M.pair_right (M.transitive (members history) ((entries n _).2 rfl)) - have valueM := M.recursiveStateData_field_mem (states n) codeM j - have extended : ∀ i, extend ((states n).field j) env i ∈ M.sets := Fin.cases valueM members - refine ⟨(states n).field j, valueM, ?_, ?_⟩ - · exact (M.realize_historyFieldValueFormula index.succ 0 history.succ j _ extended - states entries n indexEq).2 rfl - · apply (BoundedFormula.realize_toFormula M _ _ extended).2 - apply (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).2 - change env output = ZFSet.pair (env index) ((states n).field j) - exact equal.trans (congrArg (fun x => ZFSet.pair x ((states n).field j)) indexEq.symm) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveStateFieldEnvironments + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u +namespace SetFormula + +def stateFieldFormula {n} (code value : Fin n) (j : Fin 13) : SetFormula n := + exBlock 13 (.conj + (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 code) (prefixIndex n 13)).toFormula + (.equal (suffixIndex n 13 value) (prefixIndex n 13 j))) + +def historyFieldValueFormula {n} (index value history : Fin n) (j : Fin 13) : SetFormula n := + ex (.conj (BoundedFormula.pairMembershipFormula index.succ 0 history.succ).toFormula + (stateFieldFormula 0 value.succ j)) + +def historyFieldPairFormula {n} (index output history : Fin n) (j : Fin 13) : SetFormula n := + ex (.conj (historyFieldValueFormula index.succ 0 history.succ j) + (BoundedFormula.orderedPairFormula output.succ index.succ 0).toFormula) + +end SetFormula + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_stateFieldFormula {n} (code value : Fin n) (j : Fin 13) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (state : RecursiveStateData.{u}) (coded : env code = state.code) : + Realize M.sets (stateFieldFormula code value j) env ↔ env value = state.field j := by + rw [stateFieldFormula, realize_exBlock] + constructor + · rintro ⟨fields, fieldMembers, tuple, entry⟩ + have equal := (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code) + (prefixIndex n 13) _).1 + ((BoundedFormula.realize_toFormula M _ _ (extendMany_members 13 fields env fieldMembers members)).1 tuple) + simp only [extendMany_suffix, extendMany_prefix] at equal + have fieldsEqual : fields = state.field := + nonemptyTupleCode_injective 12 (equal.symm.trans coded) + change extendMany 13 fields env (suffixIndex n 13 value) = + extendMany 13 fields env (prefixIndex n 13 j) at entry + simpa only [extendMany_suffix, extendMany_prefix, fieldsEqual] using entry + · intro equal + have fieldMembers := M.recursiveStateData_field_mem state (coded ▸ members code) + refine ⟨state.field, fieldMembers, ?_, ?_⟩ + · apply (BoundedFormula.realize_toFormula M _ _ + (extendMany_members 13 state.field env fieldMembers members)).2 + apply (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code) + (prefixIndex n 13) _).2 + simp only [extendMany_suffix, extendMany_prefix] + exact coded + · change extendMany 13 state.field env (suffixIndex n 13 value) = + extendMany 13 state.field env (prefixIndex n 13 j) + simpa only [extendMany_suffix, extendMany_prefix] using equal + +theorem realize_historyFieldValueFormula {k} (index value history : Fin k) (j : Fin 13) + (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (states : Nat → RecursiveStateData.{u}) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) + (n : Nat) (indexEq : env index = natSetCode n) : + Realize M.sets (historyFieldValueFormula index value history j) env ↔ + env value = (states n).field j := by + rw [historyFieldValueFormula, realize_ex] + constructor + · rintro ⟨code, hcode, entry, projected⟩ + have extended : ∀ i, extend code env i ∈ M.sets := Fin.cases hcode members + have actual := (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).1 + ((BoundedFormula.realize_toFormula M _ _ extended).1 entry) + change ZFSet.pair (env index) code ∈ env history at actual + rw [indexEq] at actual + exact (M.realize_stateFieldFormula 0 value.succ j (extend code env) extended + (states n) ((entries n code).1 actual)).1 projected + · intro equal + have entry : ZFSet.pair (natSetCode n) (states n).code ∈ env history := + (entries n _).2 rfl + have hcode := M.pair_right (M.transitive (members history) entry) + have extended : ∀ i, extend (states n).code env i ∈ M.sets := Fin.cases hcode members + refine ⟨(states n).code, hcode, ?_, ?_⟩ + · apply (BoundedFormula.realize_toFormula M _ _ extended).2 + apply (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).2 + change ZFSet.pair (env index) (states n).code ∈ env history + exact indexEq.symm ▸ entry + · exact (M.realize_stateFieldFormula 0 value.succ j _ extended (states n) rfl).2 equal + +theorem realize_historyFieldPairFormula {k} (index output history : Fin k) (j : Fin 13) + (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (states : Nat → RecursiveStateData.{u}) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) + (n : Nat) (indexEq : env index = natSetCode n) : + Realize M.sets (historyFieldPairFormula index output history j) env ↔ + env output = ZFSet.pair (natSetCode n) ((states n).field j) := by + rw [historyFieldPairFormula, realize_ex] + constructor + · rintro ⟨value, hvalue, specified, pair⟩ + have extended : ∀ i, extend value env i ∈ M.sets := Fin.cases hvalue members + have valueEq := (M.realize_historyFieldValueFormula index.succ 0 history.succ j + (extend value env) extended states entries n indexEq).1 specified + have pairEq := (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).1 + ((BoundedFormula.realize_toFormula M _ _ extended).1 pair) + change env output = ZFSet.pair (env index) value at pairEq + exact pairEq.trans (congrArg₂ ZFSet.pair indexEq valueEq) + · intro equal + have codeM := M.pair_right (M.transitive (members history) ((entries n _).2 rfl)) + have valueM := M.recursiveStateData_field_mem (states n) codeM j + have extended : ∀ i, extend ((states n).field j) env i ∈ M.sets := Fin.cases valueM members + refine ⟨(states n).field j, valueM, ?_, ?_⟩ + · exact (M.realize_historyFieldValueFormula index.succ 0 history.succ j _ extended + states entries n indexEq).2 rfl + · apply (BoundedFormula.realize_toFormula M _ _ extended).2 + apply (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).2 + change env output = ZFSet.pair (env index) ((states n).field j) + exact equal.trans (congrArg (fun x => ZFSet.pair x ((states n).field j)) indexEq.symm) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedAttachmentCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedAttachmentCodes.lean index 274759d25029ec3f93450a10f1bf197cc9665f2b..7abdd7697836c4723619e058a19d74068380580c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedAttachmentCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedAttachmentCodes.lean @@ -1,228 +1,228 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def attachmentIdeal (Q rQ a : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun q => ZFSet.pair q a ∈ rQ) Q - -noncomputable def freshPart (Q rQ a : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun q => ZFSet.pair q a ∉ rQ) Q - -theorem mem_attachmentIdeal (Q rQ a q : ZFSet.{u}) : - q ∈ attachmentIdeal Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∈ rQ := - ZFSet.mem_sep - -theorem mem_freshPart (Q rQ a q : ZFSet.{u}) : - q ∈ freshPart Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∉ rQ := - ZFSet.mem_sep - -theorem attachmentIdeal_union_freshPart (Q rQ a : ZFSet.{u}) : - attachmentIdeal Q rQ a ∪ freshPart Q rQ a = Q := by - classical - apply ZFSet.ext - intro q - simp only [ZFSet.mem_union, mem_attachmentIdeal, mem_freshPart] - exact ⟨fun h => h.elim And.left And.left, fun h => - (Classical.em (ZFSet.pair q a ∈ rQ)).elim - (fun rel => Or.inl ⟨h, rel⟩) (fun rel => Or.inr ⟨h, rel⟩)⟩ - -theorem attachmentIdeal_not_freshPart {Q rQ a q : ZFSet.{u}} - (hq : q ∈ attachmentIdeal Q rQ a) : q ∉ freshPart Q rQ a := by - intro fresh - exact ((mem_freshPart Q rQ a q).1 fresh).2 ((mem_attachmentIdeal Q rQ a q).1 hq).2 - -noncomputable def attachmentShadowGraph (Q P μQ ell a : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧ - ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell) - (ZFSet.prod Q P) - -theorem mem_attachmentShadowGraph (Q P μQ ell a z : ZFSet.{u}) : - z ∈ attachmentShadowGraph Q P μQ ell a ↔ - ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧ - ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by - rw [attachmentShadowGraph, ZFSet.mem_sep] - exact ⟨And.right, fun h => ⟨by - obtain ⟨q, hq, p, hp, rfl, _⟩ := h - exact ZFSet.pair_mem_prod.2 ⟨hq, hp⟩, h⟩⟩ - -theorem pair_mem_attachmentShadowGraph (Q P μQ ell a q p : ZFSet.{u}) : - ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔ - q ∈ Q ∧ p ∈ P ∧ - ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by - rw [mem_attachmentShadowGraph] - constructor - · rintro ⟨q', hq, p', hp, equal, c, hc, meet, image⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hq, hp, c, hc, meet, image⟩ - · rintro ⟨hq, hp, c, hc, meet, image⟩ - exact ⟨q, hq, p, hp, rfl, c, hc, meet, image⟩ - -theorem meet_entry_in_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}} - (meet : MeetOrderCode Q rQ μQ) - (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) : - c ∈ attachmentIdeal Q rQ a := - (mem_attachmentIdeal Q rQ a c).2 - ⟨(ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2, meet.lower_right q a c entry⟩ - -theorem meet_entry_eq_of_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}} - (meet : MeetOrderCode Q rQ μQ) (hq : q ∈ attachmentIdeal Q rQ a) - (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) : c = q := by - have inIdeal := (mem_attachmentIdeal Q rQ a q).1 hq - have hc := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 - exact meet.order.antisymm c hc q inIdeal.1 (meet.lower_left q a c entry) - (meet.greatest q a c q inIdeal.1 entry (meet.order.refl q inIdeal.1) inIdeal.2) - -theorem attachmentShadowGraph_function {Q P rQ μQ ell a : ZFSet.{u}} - (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q) - (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) : - ZFSet.IsFunc Q P (attachmentShadowGraph Q P μQ ell a) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro q hq - obtain ⟨c, entry, meetUnique⟩ := meet.operation.2 (ZFSet.pair q a) - (ZFSet.pair_mem_prod.2 ⟨hq, ha⟩) - have hc := meet_entry_in_attachmentIdeal meet entry - obtain ⟨p, image, imageUnique⟩ := ellFunc.2 c hc - have hp := (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2 - refine ⟨p, (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2 - ⟨hq, hp, c, ((mem_attachmentIdeal Q rQ a c).1 hc).1, entry, image⟩, ?_⟩ - intro p' shadow - obtain ⟨_, _, c', _, entry', image'⟩ := - (pair_mem_attachmentShadowGraph Q P μQ ell a q p').1 shadow - have equal := meetUnique c' entry' - subst c' - exact imageUnique p' image' - -theorem attachmentShadowGraph_on_ideal {Q P rQ μQ ell a q p : ZFSet.{u}} - (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q) - (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) - (hq : q ∈ attachmentIdeal Q rQ a) : - ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔ ZFSet.pair q p ∈ ell := by - constructor - · intro shadow - obtain ⟨_, _, c, _, entry, image⟩ := - (pair_mem_attachmentShadowGraph Q P μQ ell a q p).1 shadow - exact meet_entry_eq_of_attachmentIdeal meet hq entry ▸ image - · intro image - have qQ := ((mem_attachmentIdeal Q rQ a q).1 hq).1 - obtain ⟨c, entry, _⟩ := meet.operation.2 (ZFSet.pair q a) - (ZFSet.pair_mem_prod.2 ⟨qQ, ha⟩) - have equal := meet_entry_eq_of_attachmentIdeal meet hq entry - subst c - exact (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2 - ⟨qQ, (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2, q, qQ, entry, image⟩ - -def familyPointBound (Qs : ZFSet.{u}) : ZFSet.{u} := ⋃₀ ⋃₀ ⋃₀ Qs - -theorem mem_familyPointBound_of_entry {Qs i Q q : ZFSet.{u}} - (entry : ZFSet.pair i Q ∈ Qs) (hq : q ∈ Q) : q ∈ familyPointBound Qs := - ZFSet.mem_sUnion.2 ⟨Q, pair_second_mem_doubleUnion entry, hq⟩ - -noncomputable def indexedAttachmentDomain (I Qs : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ q ∈ Q, - ZFSet.pair i Q ∈ Qs ∧ z = ZFSet.pair i q) - (ZFSet.prod I (familyPointBound Qs)) - -noncomputable def indexedAttachmentFresh (I Qs rs anchors : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ r ∈ ⋃₀ ⋃₀ rs, - ∃ a ∈ ⋃₀ ⋃₀ anchors, ∃ q ∈ Q, - ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧ - z = ZFSet.pair i q ∧ ZFSet.pair q a ∉ r) - (indexedAttachmentDomain I Qs) - -theorem indexedAttachmentDomain_subset (I Qs : ZFSet.{u}) : - indexedAttachmentDomain I Qs ⊆ ZFSet.prod I (familyPointBound Qs) := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem indexedAttachmentFresh_subset (I Qs rs anchors : ZFSet.{u}) : - indexedAttachmentFresh I Qs rs anchors ⊆ indexedAttachmentDomain I Qs := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_indexedAttachmentDomain (I Qs z : ZFSet.{u}) : - z ∈ indexedAttachmentDomain I Qs ↔ - ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by - constructor - · intro hz - obtain ⟨i, hi, Q, _, q, hq, entry, equal⟩ := (ZFSet.mem_sep.1 hz).2 - exact ⟨i, hi, q, equal, Q, entry, hq⟩ - · rintro ⟨i, hi, q, rfl, Q, entry, hq⟩ - exact ZFSet.mem_sep.2 - ⟨ZFSet.pair_mem_prod.2 ⟨hi, mem_familyPointBound_of_entry entry hq⟩, - i, hi, Q, pair_second_mem_doubleUnion entry, q, hq, entry, rfl⟩ - -theorem pair_mem_indexedAttachmentDomain (I Qs i q : ZFSet.{u}) : - ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔ - i ∈ I ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by - rw [mem_indexedAttachmentDomain] - constructor - · rintro ⟨j, hj, p, equal, Q, entry, hq⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, Q, entry, hq⟩ - · rintro ⟨hi, Q, entry, hq⟩ - exact ⟨i, hi, q, rfl, Q, entry, hq⟩ - -theorem mem_indexedAttachmentFresh (I Qs rs anchors z : ZFSet.{u}) : - z ∈ indexedAttachmentFresh I Qs rs anchors ↔ - ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q r a, - ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧ - q ∈ Q ∧ ZFSet.pair q a ∉ r := by - constructor - · intro hz - obtain ⟨i, hi, Q, _, r, _, a, _, q, hq, entryQ, entryR, entryA, equal, fresh⟩ := - (ZFSet.mem_sep.1 hz).2 - exact ⟨i, hi, q, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ - · rintro ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ - exact ZFSet.mem_sep.2 - ⟨(pair_mem_indexedAttachmentDomain I Qs i q).2 ⟨hi, Q, entryQ, hq⟩, - i, hi, Q, pair_second_mem_doubleUnion entryQ, r, pair_second_mem_doubleUnion entryR, - a, pair_second_mem_doubleUnion entryA, q, hq, entryQ, entryR, entryA, rfl, fresh⟩ - -theorem pair_mem_indexedAttachmentFresh (I Qs rs anchors i q : ZFSet.{u}) : - ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔ - i ∈ I ∧ ∃ Q r a, ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ - ZFSet.pair i a ∈ anchors ∧ q ∈ Q ∧ ZFSet.pair q a ∉ r := by - rw [mem_indexedAttachmentFresh] - constructor - · rintro ⟨j, hj, p, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ - · rintro ⟨hi, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ - exact ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ - -theorem pair_mem_indexedAttachmentDomain_of_entry {I Qs i q Q : ZFSet.{u}} - (family : FunctionGraphOn I Qs) (entry : ZFSet.pair i Q ∈ Qs) : - ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔ q ∈ Q := by - rw [pair_mem_indexedAttachmentDomain] - constructor - · rintro ⟨_, R, other, hq⟩ - exact family.unique other entry ▸ hq - · intro hq - exact ⟨family.pair_source entry, Q, entry, hq⟩ - -theorem pair_mem_indexedAttachmentFresh_of_entries - {I Qs rs anchors i q Q r a : ZFSet.{u}} - (spaces : FunctionGraphOn I Qs) (orders : FunctionGraphOn I rs) - (points : FunctionGraphOn I anchors) (entryQ : ZFSet.pair i Q ∈ Qs) - (entryR : ZFSet.pair i r ∈ rs) (entryA : ZFSet.pair i a ∈ anchors) : - ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔ q ∈ freshPart Q r a := by - rw [pair_mem_indexedAttachmentFresh, mem_freshPart] - constructor - · rintro ⟨_, Q', r', a', otherQ, otherR, otherA, hq, fresh⟩ - have equalQ := spaces.unique otherQ entryQ - have equalR := orders.unique otherR entryR - have equalA := points.unique otherA entryA - subst Q' - subst r' - subst a' - exact ⟨hq, fresh⟩ - · rintro ⟨hq, fresh⟩ - exact ⟨spaces.pair_source entryQ, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def attachmentIdeal (Q rQ a : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun q => ZFSet.pair q a ∈ rQ) Q + +noncomputable def freshPart (Q rQ a : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun q => ZFSet.pair q a ∉ rQ) Q + +theorem mem_attachmentIdeal (Q rQ a q : ZFSet.{u}) : + q ∈ attachmentIdeal Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∈ rQ := + ZFSet.mem_sep + +theorem mem_freshPart (Q rQ a q : ZFSet.{u}) : + q ∈ freshPart Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∉ rQ := + ZFSet.mem_sep + +theorem attachmentIdeal_union_freshPart (Q rQ a : ZFSet.{u}) : + attachmentIdeal Q rQ a ∪ freshPart Q rQ a = Q := by + classical + apply ZFSet.ext + intro q + simp only [ZFSet.mem_union, mem_attachmentIdeal, mem_freshPart] + exact ⟨fun h => h.elim And.left And.left, fun h => + (Classical.em (ZFSet.pair q a ∈ rQ)).elim + (fun rel => Or.inl ⟨h, rel⟩) (fun rel => Or.inr ⟨h, rel⟩)⟩ + +theorem attachmentIdeal_not_freshPart {Q rQ a q : ZFSet.{u}} + (hq : q ∈ attachmentIdeal Q rQ a) : q ∉ freshPart Q rQ a := by + intro fresh + exact ((mem_freshPart Q rQ a q).1 fresh).2 ((mem_attachmentIdeal Q rQ a q).1 hq).2 + +noncomputable def attachmentShadowGraph (Q P μQ ell a : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧ + ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell) + (ZFSet.prod Q P) + +theorem mem_attachmentShadowGraph (Q P μQ ell a z : ZFSet.{u}) : + z ∈ attachmentShadowGraph Q P μQ ell a ↔ + ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧ + ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by + rw [attachmentShadowGraph, ZFSet.mem_sep] + exact ⟨And.right, fun h => ⟨by + obtain ⟨q, hq, p, hp, rfl, _⟩ := h + exact ZFSet.pair_mem_prod.2 ⟨hq, hp⟩, h⟩⟩ + +theorem pair_mem_attachmentShadowGraph (Q P μQ ell a q p : ZFSet.{u}) : + ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔ + q ∈ Q ∧ p ∈ P ∧ + ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by + rw [mem_attachmentShadowGraph] + constructor + · rintro ⟨q', hq, p', hp, equal, c, hc, meet, image⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hq, hp, c, hc, meet, image⟩ + · rintro ⟨hq, hp, c, hc, meet, image⟩ + exact ⟨q, hq, p, hp, rfl, c, hc, meet, image⟩ + +theorem meet_entry_in_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}} + (meet : MeetOrderCode Q rQ μQ) + (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) : + c ∈ attachmentIdeal Q rQ a := + (mem_attachmentIdeal Q rQ a c).2 + ⟨(ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2, meet.lower_right q a c entry⟩ + +theorem meet_entry_eq_of_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}} + (meet : MeetOrderCode Q rQ μQ) (hq : q ∈ attachmentIdeal Q rQ a) + (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) : c = q := by + have inIdeal := (mem_attachmentIdeal Q rQ a q).1 hq + have hc := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 + exact meet.order.antisymm c hc q inIdeal.1 (meet.lower_left q a c entry) + (meet.greatest q a c q inIdeal.1 entry (meet.order.refl q inIdeal.1) inIdeal.2) + +theorem attachmentShadowGraph_function {Q P rQ μQ ell a : ZFSet.{u}} + (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q) + (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) : + ZFSet.IsFunc Q P (attachmentShadowGraph Q P μQ ell a) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro q hq + obtain ⟨c, entry, meetUnique⟩ := meet.operation.2 (ZFSet.pair q a) + (ZFSet.pair_mem_prod.2 ⟨hq, ha⟩) + have hc := meet_entry_in_attachmentIdeal meet entry + obtain ⟨p, image, imageUnique⟩ := ellFunc.2 c hc + have hp := (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2 + refine ⟨p, (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2 + ⟨hq, hp, c, ((mem_attachmentIdeal Q rQ a c).1 hc).1, entry, image⟩, ?_⟩ + intro p' shadow + obtain ⟨_, _, c', _, entry', image'⟩ := + (pair_mem_attachmentShadowGraph Q P μQ ell a q p').1 shadow + have equal := meetUnique c' entry' + subst c' + exact imageUnique p' image' + +theorem attachmentShadowGraph_on_ideal {Q P rQ μQ ell a q p : ZFSet.{u}} + (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q) + (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) + (hq : q ∈ attachmentIdeal Q rQ a) : + ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔ ZFSet.pair q p ∈ ell := by + constructor + · intro shadow + obtain ⟨_, _, c, _, entry, image⟩ := + (pair_mem_attachmentShadowGraph Q P μQ ell a q p).1 shadow + exact meet_entry_eq_of_attachmentIdeal meet hq entry ▸ image + · intro image + have qQ := ((mem_attachmentIdeal Q rQ a q).1 hq).1 + obtain ⟨c, entry, _⟩ := meet.operation.2 (ZFSet.pair q a) + (ZFSet.pair_mem_prod.2 ⟨qQ, ha⟩) + have equal := meet_entry_eq_of_attachmentIdeal meet hq entry + subst c + exact (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2 + ⟨qQ, (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2, q, qQ, entry, image⟩ + +def familyPointBound (Qs : ZFSet.{u}) : ZFSet.{u} := ⋃₀ ⋃₀ ⋃₀ Qs + +theorem mem_familyPointBound_of_entry {Qs i Q q : ZFSet.{u}} + (entry : ZFSet.pair i Q ∈ Qs) (hq : q ∈ Q) : q ∈ familyPointBound Qs := + ZFSet.mem_sUnion.2 ⟨Q, pair_second_mem_doubleUnion entry, hq⟩ + +noncomputable def indexedAttachmentDomain (I Qs : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ q ∈ Q, + ZFSet.pair i Q ∈ Qs ∧ z = ZFSet.pair i q) + (ZFSet.prod I (familyPointBound Qs)) + +noncomputable def indexedAttachmentFresh (I Qs rs anchors : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ r ∈ ⋃₀ ⋃₀ rs, + ∃ a ∈ ⋃₀ ⋃₀ anchors, ∃ q ∈ Q, + ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧ + z = ZFSet.pair i q ∧ ZFSet.pair q a ∉ r) + (indexedAttachmentDomain I Qs) + +theorem indexedAttachmentDomain_subset (I Qs : ZFSet.{u}) : + indexedAttachmentDomain I Qs ⊆ ZFSet.prod I (familyPointBound Qs) := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem indexedAttachmentFresh_subset (I Qs rs anchors : ZFSet.{u}) : + indexedAttachmentFresh I Qs rs anchors ⊆ indexedAttachmentDomain I Qs := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_indexedAttachmentDomain (I Qs z : ZFSet.{u}) : + z ∈ indexedAttachmentDomain I Qs ↔ + ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by + constructor + · intro hz + obtain ⟨i, hi, Q, _, q, hq, entry, equal⟩ := (ZFSet.mem_sep.1 hz).2 + exact ⟨i, hi, q, equal, Q, entry, hq⟩ + · rintro ⟨i, hi, q, rfl, Q, entry, hq⟩ + exact ZFSet.mem_sep.2 + ⟨ZFSet.pair_mem_prod.2 ⟨hi, mem_familyPointBound_of_entry entry hq⟩, + i, hi, Q, pair_second_mem_doubleUnion entry, q, hq, entry, rfl⟩ + +theorem pair_mem_indexedAttachmentDomain (I Qs i q : ZFSet.{u}) : + ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔ + i ∈ I ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by + rw [mem_indexedAttachmentDomain] + constructor + · rintro ⟨j, hj, p, equal, Q, entry, hq⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, Q, entry, hq⟩ + · rintro ⟨hi, Q, entry, hq⟩ + exact ⟨i, hi, q, rfl, Q, entry, hq⟩ + +theorem mem_indexedAttachmentFresh (I Qs rs anchors z : ZFSet.{u}) : + z ∈ indexedAttachmentFresh I Qs rs anchors ↔ + ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q r a, + ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧ + q ∈ Q ∧ ZFSet.pair q a ∉ r := by + constructor + · intro hz + obtain ⟨i, hi, Q, _, r, _, a, _, q, hq, entryQ, entryR, entryA, equal, fresh⟩ := + (ZFSet.mem_sep.1 hz).2 + exact ⟨i, hi, q, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ + · rintro ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ + exact ZFSet.mem_sep.2 + ⟨(pair_mem_indexedAttachmentDomain I Qs i q).2 ⟨hi, Q, entryQ, hq⟩, + i, hi, Q, pair_second_mem_doubleUnion entryQ, r, pair_second_mem_doubleUnion entryR, + a, pair_second_mem_doubleUnion entryA, q, hq, entryQ, entryR, entryA, rfl, fresh⟩ + +theorem pair_mem_indexedAttachmentFresh (I Qs rs anchors i q : ZFSet.{u}) : + ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔ + i ∈ I ∧ ∃ Q r a, ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ + ZFSet.pair i a ∈ anchors ∧ q ∈ Q ∧ ZFSet.pair q a ∉ r := by + rw [mem_indexedAttachmentFresh] + constructor + · rintro ⟨j, hj, p, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ + · rintro ⟨hi, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ + exact ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ + +theorem pair_mem_indexedAttachmentDomain_of_entry {I Qs i q Q : ZFSet.{u}} + (family : FunctionGraphOn I Qs) (entry : ZFSet.pair i Q ∈ Qs) : + ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔ q ∈ Q := by + rw [pair_mem_indexedAttachmentDomain] + constructor + · rintro ⟨_, R, other, hq⟩ + exact family.unique other entry ▸ hq + · intro hq + exact ⟨family.pair_source entry, Q, entry, hq⟩ + +theorem pair_mem_indexedAttachmentFresh_of_entries + {I Qs rs anchors i q Q r a : ZFSet.{u}} + (spaces : FunctionGraphOn I Qs) (orders : FunctionGraphOn I rs) + (points : FunctionGraphOn I anchors) (entryQ : ZFSet.pair i Q ∈ Qs) + (entryR : ZFSet.pair i r ∈ rs) (entryA : ZFSet.pair i a ∈ anchors) : + ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔ q ∈ freshPart Q r a := by + rw [pair_mem_indexedAttachmentFresh, mem_freshPart] + constructor + · rintro ⟨_, Q', r', a', otherQ, otherR, otherA, hq, fresh⟩ + have equalQ := spaces.unique otherQ entryQ + have equalR := orders.unique otherR entryR + have equalA := points.unique otherA entryA + subst Q' + subst r' + subst a' + exact ⟨hq, fresh⟩ + · rintro ⟨hq, fresh⟩ + exact ⟨spaces.pair_source entryQ, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedMixedOperationLiftCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedMixedOperationLiftCodes.lean index 208e511599bffa826f1e85e7b7931bab35997688..867b1906742a681628c74a083f27a4407ac23b07 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedMixedOperationLiftCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedMixedOperationLiftCodes.lean @@ -1,58 +1,58 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -noncomputable def indexedMixedBinaryLift (T UG UP G P A JG JP : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun w => ∃ g ∈ G, ∃ p ∈ P, ∃ q ∈ P, ∃ i ∈ T, - ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion A), - ∃ eG ∈ ZFSet.sUnion (ZFSet.sUnion JG), ∃ eP ∈ ZFSet.sUnion (ZFSet.sUnion JP), - ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP, - w = ZFSet.pair (ZFSet.pair g p) q ∧ - ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧ - ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧ - ZFSet.pair (ZFSet.pair u x) y ∈ a) (ZFSet.prod (ZFSet.prod G P) P) - -theorem indexedMixedBinaryLift_subset (T UG UP G P A JG JP : ZFSet.{u}) : - indexedMixedBinaryLift T UG UP G P A JG JP ⊆ ZFSet.prod (ZFSet.prod G P) P := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem triple_mem_indexedMixedBinaryLift (T UG UP G P A JG JP g p q : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g p) q ∈ indexedMixedBinaryLift T UG UP G P A JG JP ↔ - g ∈ G ∧ p ∈ P ∧ q ∈ P ∧ ∃ i ∈ T, ∃ a eG eP, - ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP, - ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧ - ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧ - ZFSet.pair (ZFSet.pair u x) y ∈ a := by - rw [indexedMixedBinaryLift, ZFSet.mem_sep] - constructor - · rintro ⟨_, g', hg, p', hp, q', hq, i, hi, a, _, eG, _, eP, _, - u, hu, x, hx, y, hy, equal, action, actors, points, actor, first, second, source⟩ - obtain ⟨gp, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 gp - exact ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy, - action, actors, points, actor, first, second, source⟩ - · rintro ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy, - action, actors, points, actor, first, second, source⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, hp⟩, hq⟩, - g, hg, p, hp, q, hq, i, hi, a, pair_second_mem_doubleUnion action, - eG, pair_second_mem_doubleUnion actors, eP, pair_second_mem_doubleUnion points, - u, hu, x, hx, y, hy, rfl, action, actors, points, actor, first, second, source⟩ - -theorem indexedMixedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (T UG UP A JG JP : ZFSet.{u}) {G P : ZFSet.{u}} - (actors : ZFSet.rank G < o) (points : ZFSet.rank P < o) : - ZFSet.rank (indexedMixedBinaryLift T UG UP G P A JG JP) < o := - (ZFSet.rank_mono (indexedMixedBinaryLift_subset T UG UP G P A JG JP)).trans_lt - (rank_product_lt limit (rank_product_lt limit actors points) points) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +noncomputable def indexedMixedBinaryLift (T UG UP G P A JG JP : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun w => ∃ g ∈ G, ∃ p ∈ P, ∃ q ∈ P, ∃ i ∈ T, + ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion A), + ∃ eG ∈ ZFSet.sUnion (ZFSet.sUnion JG), ∃ eP ∈ ZFSet.sUnion (ZFSet.sUnion JP), + ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP, + w = ZFSet.pair (ZFSet.pair g p) q ∧ + ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧ + ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧ + ZFSet.pair (ZFSet.pair u x) y ∈ a) (ZFSet.prod (ZFSet.prod G P) P) + +theorem indexedMixedBinaryLift_subset (T UG UP G P A JG JP : ZFSet.{u}) : + indexedMixedBinaryLift T UG UP G P A JG JP ⊆ ZFSet.prod (ZFSet.prod G P) P := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem triple_mem_indexedMixedBinaryLift (T UG UP G P A JG JP g p q : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g p) q ∈ indexedMixedBinaryLift T UG UP G P A JG JP ↔ + g ∈ G ∧ p ∈ P ∧ q ∈ P ∧ ∃ i ∈ T, ∃ a eG eP, + ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP, + ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧ + ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧ + ZFSet.pair (ZFSet.pair u x) y ∈ a := by + rw [indexedMixedBinaryLift, ZFSet.mem_sep] + constructor + · rintro ⟨_, g', hg, p', hp, q', hq, i, hi, a, _, eG, _, eP, _, + u, hu, x, hx, y, hy, equal, action, actors, points, actor, first, second, source⟩ + obtain ⟨gp, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 gp + exact ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy, + action, actors, points, actor, first, second, source⟩ + · rintro ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy, + action, actors, points, actor, first, second, source⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, hp⟩, hq⟩, + g, hg, p, hp, q, hq, i, hi, a, pair_second_mem_doubleUnion action, + eG, pair_second_mem_doubleUnion actors, eP, pair_second_mem_doubleUnion points, + u, hu, x, hx, y, hy, rfl, action, actors, points, actor, first, second, source⟩ + +theorem indexedMixedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (T UG UP A JG JP : ZFSet.{u}) {G P : ZFSet.{u}} + (actors : ZFSet.rank G < o) (points : ZFSet.rank P < o) : + ZFSet.rank (indexedMixedBinaryLift T UG UP G P A JG JP) < o := + (ZFSet.rank_mono (indexedMixedBinaryLift_subset T UG UP G P A JG JP)).trans_lt + (rank_product_lt limit (rank_product_lt limit actors points) points) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedOperationLiftCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedOperationLiftCodes.lean index dcdc2d14cf5d4460e0112ec11d93205894eaed76..05eca009b4bfd6f0c1969856d5c749ddf646e19a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedOperationLiftCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedOperationLiftCodes.lean @@ -1,86 +1,86 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -open scoped ZFSet -universe u - -noncomputable def indexedRelationLift (T U Q R J : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ p ∈ Q, ∃ q ∈ Q, ∃ i ∈ T, - ∃ r ∈ ⋃₀ ⋃₀ R, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U, - z = ZFSet.pair p q ∧ ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧ - ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r) - (ZFSet.prod Q Q) - -theorem indexedRelationLift_subset (T U Q R J : ZFSet.{u}) : - indexedRelationLift T U Q R J ⊆ ZFSet.prod Q Q := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem pair_mem_indexedRelationLift (T U Q R J p q : ZFSet.{u}) : - ZFSet.pair p q ∈ indexedRelationLift T U Q R J ↔ - p ∈ Q ∧ q ∈ Q ∧ ∃ i ∈ T, ∃ r e, ∃ x ∈ U, ∃ y ∈ U, - ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧ - ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r := by - rw [indexedRelationLift, ZFSet.mem_sep] - constructor - · rintro ⟨_, p', hp, q', hq, i, hi, r, _, e, _, x, hx, y, hy, equal, relation, inclusion, first, second, source⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩ - · rintro ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, p, hp, q, hq, i, hi, - r, pair_second_mem_doubleUnion relation, e, pair_second_mem_doubleUnion inclusion, - x, hx, y, hy, rfl, relation, inclusion, first, second, source⟩ - -noncomputable def indexedBinaryLift (T U Q B J : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun w => ∃ p ∈ Q, ∃ q ∈ Q, ∃ v ∈ Q, ∃ i ∈ T, - ∃ b ∈ ⋃₀ ⋃₀ B, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U, - w = ZFSet.pair (ZFSet.pair p q) v ∧ ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧ - ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧ - ZFSet.pair (ZFSet.pair x y) z ∈ b) (ZFSet.prod (ZFSet.prod Q Q) Q) - -theorem indexedBinaryLift_subset (T U Q B J : ZFSet.{u}) : - indexedBinaryLift T U Q B J ⊆ ZFSet.prod (ZFSet.prod Q Q) Q := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem triple_mem_indexedBinaryLift (T U Q B J p q v : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair p q) v ∈ indexedBinaryLift T U Q B J ↔ - p ∈ Q ∧ q ∈ Q ∧ v ∈ Q ∧ ∃ i ∈ T, ∃ b e, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U, - ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧ - ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧ - ZFSet.pair (ZFSet.pair x y) z ∈ b := by - rw [indexedBinaryLift, ZFSet.mem_sep] - constructor - · rintro ⟨_, p', hp, q', hq, v', hv, i, hi, b, _, e, _, x, hx, y, hy, z, hz, - equal, operation, inclusion, first, second, third, source⟩ - obtain ⟨pq, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pq - exact ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz, - operation, inclusion, first, second, third, source⟩ - · rintro ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz, - operation, inclusion, first, second, third, source⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, hv⟩, - p, hp, q, hq, v, hv, i, hi, b, pair_second_mem_doubleUnion operation, - e, pair_second_mem_doubleUnion inclusion, x, hx, y, hy, z, hz, - rfl, operation, inclusion, first, second, third, source⟩ - -theorem indexedRelationLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (T U R J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) : - ZFSet.rank (indexedRelationLift T U Q R J) < o := - (ZFSet.rank_mono (indexedRelationLift_subset T U Q R J)).trans_lt - (rank_product_lt limit rank rank) - -theorem indexedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (T U B J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) : - ZFSet.rank (indexedBinaryLift T U Q B J) < o := - (ZFSet.rank_mono (indexedBinaryLift_subset T U Q B J)).trans_lt - (rank_product_lt limit (rank_product_lt limit rank rank) rank) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +open scoped ZFSet +universe u + +noncomputable def indexedRelationLift (T U Q R J : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ p ∈ Q, ∃ q ∈ Q, ∃ i ∈ T, + ∃ r ∈ ⋃₀ ⋃₀ R, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U, + z = ZFSet.pair p q ∧ ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧ + ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r) + (ZFSet.prod Q Q) + +theorem indexedRelationLift_subset (T U Q R J : ZFSet.{u}) : + indexedRelationLift T U Q R J ⊆ ZFSet.prod Q Q := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem pair_mem_indexedRelationLift (T U Q R J p q : ZFSet.{u}) : + ZFSet.pair p q ∈ indexedRelationLift T U Q R J ↔ + p ∈ Q ∧ q ∈ Q ∧ ∃ i ∈ T, ∃ r e, ∃ x ∈ U, ∃ y ∈ U, + ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧ + ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r := by + rw [indexedRelationLift, ZFSet.mem_sep] + constructor + · rintro ⟨_, p', hp, q', hq, i, hi, r, _, e, _, x, hx, y, hy, equal, relation, inclusion, first, second, source⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩ + · rintro ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, p, hp, q, hq, i, hi, + r, pair_second_mem_doubleUnion relation, e, pair_second_mem_doubleUnion inclusion, + x, hx, y, hy, rfl, relation, inclusion, first, second, source⟩ + +noncomputable def indexedBinaryLift (T U Q B J : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun w => ∃ p ∈ Q, ∃ q ∈ Q, ∃ v ∈ Q, ∃ i ∈ T, + ∃ b ∈ ⋃₀ ⋃₀ B, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U, + w = ZFSet.pair (ZFSet.pair p q) v ∧ ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧ + ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧ + ZFSet.pair (ZFSet.pair x y) z ∈ b) (ZFSet.prod (ZFSet.prod Q Q) Q) + +theorem indexedBinaryLift_subset (T U Q B J : ZFSet.{u}) : + indexedBinaryLift T U Q B J ⊆ ZFSet.prod (ZFSet.prod Q Q) Q := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem triple_mem_indexedBinaryLift (T U Q B J p q v : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair p q) v ∈ indexedBinaryLift T U Q B J ↔ + p ∈ Q ∧ q ∈ Q ∧ v ∈ Q ∧ ∃ i ∈ T, ∃ b e, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U, + ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧ + ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧ + ZFSet.pair (ZFSet.pair x y) z ∈ b := by + rw [indexedBinaryLift, ZFSet.mem_sep] + constructor + · rintro ⟨_, p', hp, q', hq, v', hv, i, hi, b, _, e, _, x, hx, y, hy, z, hz, + equal, operation, inclusion, first, second, third, source⟩ + obtain ⟨pq, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pq + exact ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz, + operation, inclusion, first, second, third, source⟩ + · rintro ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz, + operation, inclusion, first, second, third, source⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, hv⟩, + p, hp, q, hq, v, hv, i, hi, b, pair_second_mem_doubleUnion operation, + e, pair_second_mem_doubleUnion inclusion, x, hx, y, hy, z, hz, + rfl, operation, inclusion, first, second, third, source⟩ + +theorem indexedRelationLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (T U R J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) : + ZFSet.rank (indexedRelationLift T U Q R J) < o := + (ZFSet.rank_mono (indexedRelationLift_subset T U Q R J)).trans_lt + (rank_product_lt limit rank rank) + +theorem indexedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (T U B J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) : + ZFSet.rank (indexedBinaryLift T U Q B J) < o := + (ZFSet.rank_mono (indexedBinaryLift_subset T U Q B J)).trans_lt + (rank_product_lt limit (rank_product_lt limit rank rank) rank) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedSubstructureCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedSubstructureCodes.lean index c0f829a304f0575ae11df8b3c8a81d67372e03f7..a79ae9c2a8bb902fc0526a594342deb02aa275e0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedSubstructureCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedSubstructureCodes.lean @@ -1,122 +1,122 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def indexedSuborderGraph (I B R domains : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ R, ∃ x ∈ B, ∃ y ∈ B, - z = ZFSet.pair i v ∧ v = ZFSet.pair x y ∧ - ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains) (ZFSet.prod I R) - -def indexedSubmeetGraph (I B μ domains : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ μ, ∃ x ∈ B, ∃ y ∈ B, ∃ w ∈ B, - z = ZFSet.pair i v ∧ v = ZFSet.pair (ZFSet.pair x y) w ∧ - ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains ∧ ZFSet.pair i w ∈ domains) - (ZFSet.prod I μ) - -theorem pair_mem_indexedSuborderGraph (I B R domains i v : ZFSet.{u}) : - ZFSet.pair i v ∈ indexedSuborderGraph I B R domains ↔ - i ∈ I ∧ v ∈ R ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i, - v = ZFSet.pair x y := by - rw [indexedSuborderGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, j, hj, w, hw, x, hx, y, hy, equal, value, first, second⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, hw, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩, - y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩, value⟩ - · rintro ⟨hi, hv, x, hx, y, hy, equal⟩ - obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx - obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy - exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy, rfl, equal, first, second⟩ - -theorem pair_mem_indexedSubmeetGraph (I B μ domains i v : ZFSet.{u}) : - ZFSet.pair i v ∈ indexedSubmeetGraph I B μ domains ↔ - i ∈ I ∧ v ∈ μ ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i, - ∃ w ∈ relationFiber B domains i, v = ZFSet.pair (ZFSet.pair x y) w := by - rw [indexedSubmeetGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, j, hj, v', hv, x, hx, y, hy, w, hw, equal, value, first, second, third⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, hv, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩, - y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩, - w, (mem_relationFiber _ _ _ _).2 ⟨hw, third⟩, value⟩ - · rintro ⟨hi, hv, x, hx, y, hy, w, hw, equal⟩ - obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx - obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy - obtain ⟨hw, third⟩ := (mem_relationFiber _ _ _ _).1 hw - exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy, - w, hw, rfl, equal, first, second, third⟩ - -theorem suborderFiber_pair_iff {I B R domains i x y : ZFSet.{u}} (hi : i ∈ I) : - ZFSet.pair x y ∈ relationFiber R (indexedSuborderGraph I B R domains) i ↔ - ZFSet.pair x y ∈ R ∧ x ∈ relationFiber B domains i ∧ y ∈ relationFiber B domains i := by - rw [mem_relationFiber, pair_mem_indexedSuborderGraph] - constructor - · rintro ⟨hxy, _, _, a, ha, b, hb, equal⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hxy, ha, hb⟩ - · rintro ⟨hxy, hx, hy⟩ - exact ⟨hxy, hi, hxy, x, hx, y, hy, rfl⟩ - -theorem submeetFiber_triple_iff {I B μ domains i x y w : ZFSet.{u}} (hi : i ∈ I) : - ZFSet.pair (ZFSet.pair x y) w ∈ relationFiber μ (indexedSubmeetGraph I B μ domains) i ↔ - ZFSet.pair (ZFSet.pair x y) w ∈ μ ∧ x ∈ relationFiber B domains i ∧ - y ∈ relationFiber B domains i ∧ w ∈ relationFiber B domains i := by - rw [mem_relationFiber, pair_mem_indexedSubmeetGraph] - constructor - · rintro ⟨hxy, _, _, a, ha, b, hb, c, hc, equal⟩ - obtain ⟨ab, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab - exact ⟨hxy, ha, hb, hc⟩ - · rintro ⟨hxy, hx, hy, hw⟩ - exact ⟨hxy, hi, hxy, x, hx, y, hy, w, hw, rfl⟩ - -namespace BoundedFormula -def indexedSuborderEntryFormula {n} (z I B R domains : Fin n) : BoundedFormula n := - exMem I (exMem R.succ (exMem B.succ.succ (exMem B.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ 3 2) - (.conj (orderedPairFormula 2 1 0) - (.conj (pairMembershipFormula 3 1 domains.succ.succ.succ.succ) - (pairMembershipFormula 3 0 domains.succ.succ.succ.succ))))))) - -def indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) : BoundedFormula n := - exMem I (exMem μ.succ (exMem B.succ.succ (exMem B.succ.succ.succ (exMem B.succ.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 3) - (.conj (orderedTripleFormula 3 2 1 0) - (.conj (pairMembershipFormula 4 2 domains.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 4 1 domains.succ.succ.succ.succ.succ) - (pairMembershipFormula 4 0 domains.succ.succ.succ.succ.succ))))))))) - -theorem truth_indexedSuborderEntryFormula {n} (z I B R domains : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (indexedSuborderEntryFormula z I B R domains) env ↔ - env z ∈ indexedSuborderGraph (env I) (env B) (env R) (env domains) := by - simp only [indexedSuborderEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, indexedSuborderGraph, ZFSet.mem_sep] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨i, hi, v, hv, _, _, _, _, equal, _⟩ := h - change env z = ZFSet.pair i v at equal - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩ - -theorem truth_indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (indexedSubmeetEntryFormula z I B μ domains) env ↔ - env z ∈ indexedSubmeetGraph (env I) (env B) (env μ) (env domains) := by - simp only [indexedSubmeetEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_orderedTripleFormula, truth_pairMembershipFormula, indexedSubmeetGraph, ZFSet.mem_sep] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨i, hi, v, hv, _, _, _, _, _, _, equal, _⟩ := h - change env z = ZFSet.pair i v at equal - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩ -end BoundedFormula - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def indexedSuborderGraph (I B R domains : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ R, ∃ x ∈ B, ∃ y ∈ B, + z = ZFSet.pair i v ∧ v = ZFSet.pair x y ∧ + ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains) (ZFSet.prod I R) + +def indexedSubmeetGraph (I B μ domains : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ μ, ∃ x ∈ B, ∃ y ∈ B, ∃ w ∈ B, + z = ZFSet.pair i v ∧ v = ZFSet.pair (ZFSet.pair x y) w ∧ + ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains ∧ ZFSet.pair i w ∈ domains) + (ZFSet.prod I μ) + +theorem pair_mem_indexedSuborderGraph (I B R domains i v : ZFSet.{u}) : + ZFSet.pair i v ∈ indexedSuborderGraph I B R domains ↔ + i ∈ I ∧ v ∈ R ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i, + v = ZFSet.pair x y := by + rw [indexedSuborderGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, j, hj, w, hw, x, hx, y, hy, equal, value, first, second⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, hw, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩, + y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩, value⟩ + · rintro ⟨hi, hv, x, hx, y, hy, equal⟩ + obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx + obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy + exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy, rfl, equal, first, second⟩ + +theorem pair_mem_indexedSubmeetGraph (I B μ domains i v : ZFSet.{u}) : + ZFSet.pair i v ∈ indexedSubmeetGraph I B μ domains ↔ + i ∈ I ∧ v ∈ μ ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i, + ∃ w ∈ relationFiber B domains i, v = ZFSet.pair (ZFSet.pair x y) w := by + rw [indexedSubmeetGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, j, hj, v', hv, x, hx, y, hy, w, hw, equal, value, first, second, third⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, hv, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩, + y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩, + w, (mem_relationFiber _ _ _ _).2 ⟨hw, third⟩, value⟩ + · rintro ⟨hi, hv, x, hx, y, hy, w, hw, equal⟩ + obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx + obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy + obtain ⟨hw, third⟩ := (mem_relationFiber _ _ _ _).1 hw + exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy, + w, hw, rfl, equal, first, second, third⟩ + +theorem suborderFiber_pair_iff {I B R domains i x y : ZFSet.{u}} (hi : i ∈ I) : + ZFSet.pair x y ∈ relationFiber R (indexedSuborderGraph I B R domains) i ↔ + ZFSet.pair x y ∈ R ∧ x ∈ relationFiber B domains i ∧ y ∈ relationFiber B domains i := by + rw [mem_relationFiber, pair_mem_indexedSuborderGraph] + constructor + · rintro ⟨hxy, _, _, a, ha, b, hb, equal⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hxy, ha, hb⟩ + · rintro ⟨hxy, hx, hy⟩ + exact ⟨hxy, hi, hxy, x, hx, y, hy, rfl⟩ + +theorem submeetFiber_triple_iff {I B μ domains i x y w : ZFSet.{u}} (hi : i ∈ I) : + ZFSet.pair (ZFSet.pair x y) w ∈ relationFiber μ (indexedSubmeetGraph I B μ domains) i ↔ + ZFSet.pair (ZFSet.pair x y) w ∈ μ ∧ x ∈ relationFiber B domains i ∧ + y ∈ relationFiber B domains i ∧ w ∈ relationFiber B domains i := by + rw [mem_relationFiber, pair_mem_indexedSubmeetGraph] + constructor + · rintro ⟨hxy, _, _, a, ha, b, hb, c, hc, equal⟩ + obtain ⟨ab, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab + exact ⟨hxy, ha, hb, hc⟩ + · rintro ⟨hxy, hx, hy, hw⟩ + exact ⟨hxy, hi, hxy, x, hx, y, hy, w, hw, rfl⟩ + +namespace BoundedFormula +def indexedSuborderEntryFormula {n} (z I B R domains : Fin n) : BoundedFormula n := + exMem I (exMem R.succ (exMem B.succ.succ (exMem B.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ 3 2) + (.conj (orderedPairFormula 2 1 0) + (.conj (pairMembershipFormula 3 1 domains.succ.succ.succ.succ) + (pairMembershipFormula 3 0 domains.succ.succ.succ.succ))))))) + +def indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) : BoundedFormula n := + exMem I (exMem μ.succ (exMem B.succ.succ (exMem B.succ.succ.succ (exMem B.succ.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 3) + (.conj (orderedTripleFormula 3 2 1 0) + (.conj (pairMembershipFormula 4 2 domains.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 4 1 domains.succ.succ.succ.succ.succ) + (pairMembershipFormula 4 0 domains.succ.succ.succ.succ.succ))))))))) + +theorem truth_indexedSuborderEntryFormula {n} (z I B R domains : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (indexedSuborderEntryFormula z I B R domains) env ↔ + env z ∈ indexedSuborderGraph (env I) (env B) (env R) (env domains) := by + simp only [indexedSuborderEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, indexedSuborderGraph, ZFSet.mem_sep] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨i, hi, v, hv, _, _, _, _, equal, _⟩ := h + change env z = ZFSet.pair i v at equal + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩ + +theorem truth_indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (indexedSubmeetEntryFormula z I B μ domains) env ↔ + env z ∈ indexedSubmeetGraph (env I) (env B) (env μ) (env domains) := by + simp only [indexedSubmeetEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_orderedTripleFormula, truth_pairMembershipFormula, indexedSubmeetGraph, ZFSet.mem_sep] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨i, hi, v, hv, _, _, _, _, _, _, equal, _⟩ := h + change env z = ZFSet.pair i v at equal + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩ +end BoundedFormula + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedValueLiftCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedValueLiftCodes.lean index fa8ab352c6384cc9166abaa4f1f006abca221fb1..ed5f53f3c6990aa66941e7ff9ace9fbd1d6184c4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedValueLiftCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedValueLiftCodes.lean @@ -1,60 +1,60 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -noncomputable def indexedValueLift (T U Q V F J : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ T, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion F), - ∃ e ∈ ZFSet.sUnion (ZFSet.sUnion J), - ∃ x ∈ U, ∃ q ∈ Q, ∃ v ∈ V, - z = ZFSet.pair q v ∧ ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧ - ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f) (ZFSet.prod Q V) - -theorem indexedValueLift_subset (T U Q V F J : ZFSet.{u}) : - indexedValueLift T U Q V F J ⊆ ZFSet.prod Q V := fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem pair_mem_indexedValueLift (T U Q V F J q v : ZFSet.{u}) : - ZFSet.pair q v ∈ indexedValueLift T U Q V F J ↔ - q ∈ Q ∧ v ∈ V ∧ ∃ i ∈ T, ∃ f e, ∃ x ∈ U, - ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧ - ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by - rw [indexedValueLift, ZFSet.mem_sep] - constructor - · rintro ⟨_, i, hi, f, _, e, _, x, hx, p, hp, w, hw, equal, value, inclusion, image, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hp, hw, i, hi, f, e, x, hx, value, inclusion, image, entry⟩ - · rintro ⟨hq, hv, i, hi, f, e, x, hx, value, inclusion, image, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hq, hv⟩, - i, hi, f, pair_second_mem_doubleUnion value, e, pair_second_mem_doubleUnion inclusion, - x, hx, q, hq, v, hv, rfl, value, inclusion, image, entry⟩ - -namespace BoundedFormula -open SetFormula - -def indexedValueLiftEntryFormula : BoundedFormula 9 := - exMem 1 (exMem 8 (exMem 10 (exMem 5 (exMem 7 (exMem 9 - (.conj (orderedPairFormula 6 1 0) - (.conj (pairMembershipFormula 5 4 11) - (.conj (pairMembershipFormula 5 3 12) - (.conj (pairMembershipFormula 2 1 3) (pairMembershipFormula 2 0 4)))))))))) - -theorem truth_indexedValueLiftEntryFormula (env : Fin 9 → ZFSet.{u}) : - Truth indexedValueLiftEntryFormula env ↔ - ∃ i ∈ env 1, ∃ f ∈ env 7, ∃ e ∈ env 8, ∃ x ∈ env 2, ∃ q ∈ env 3, ∃ v ∈ env 4, - env 0 = ZFSet.pair q v ∧ ZFSet.pair i f ∈ env 5 ∧ ZFSet.pair i e ∈ env 6 ∧ - ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by - simp only [indexedValueLiftEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +noncomputable def indexedValueLift (T U Q V F J : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ T, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion F), + ∃ e ∈ ZFSet.sUnion (ZFSet.sUnion J), + ∃ x ∈ U, ∃ q ∈ Q, ∃ v ∈ V, + z = ZFSet.pair q v ∧ ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧ + ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f) (ZFSet.prod Q V) + +theorem indexedValueLift_subset (T U Q V F J : ZFSet.{u}) : + indexedValueLift T U Q V F J ⊆ ZFSet.prod Q V := fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem pair_mem_indexedValueLift (T U Q V F J q v : ZFSet.{u}) : + ZFSet.pair q v ∈ indexedValueLift T U Q V F J ↔ + q ∈ Q ∧ v ∈ V ∧ ∃ i ∈ T, ∃ f e, ∃ x ∈ U, + ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧ + ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by + rw [indexedValueLift, ZFSet.mem_sep] + constructor + · rintro ⟨_, i, hi, f, _, e, _, x, hx, p, hp, w, hw, equal, value, inclusion, image, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hp, hw, i, hi, f, e, x, hx, value, inclusion, image, entry⟩ + · rintro ⟨hq, hv, i, hi, f, e, x, hx, value, inclusion, image, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hq, hv⟩, + i, hi, f, pair_second_mem_doubleUnion value, e, pair_second_mem_doubleUnion inclusion, + x, hx, q, hq, v, hv, rfl, value, inclusion, image, entry⟩ + +namespace BoundedFormula +open SetFormula + +def indexedValueLiftEntryFormula : BoundedFormula 9 := + exMem 1 (exMem 8 (exMem 10 (exMem 5 (exMem 7 (exMem 9 + (.conj (orderedPairFormula 6 1 0) + (.conj (pairMembershipFormula 5 4 11) + (.conj (pairMembershipFormula 5 3 12) + (.conj (pairMembershipFormula 2 1 3) (pairMembershipFormula 2 0 4)))))))))) + +theorem truth_indexedValueLiftEntryFormula (env : Fin 9 → ZFSet.{u}) : + Truth indexedValueLiftEntryFormula env ↔ + ∃ i ∈ env 1, ∃ f ∈ env 7, ∃ e ∈ env 8, ∃ x ∈ env 2, ∃ q ∈ env 3, ∃ v ∈ env 4, + env 0 = ZFSet.pair q v ∧ ZFSet.pair i f ∈ env 5 ∧ ZFSet.pair i e ∈ env 6 ∧ + ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by + simp only [indexedValueLiftEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/InitialMainAlgebraCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/InitialMainAlgebraCodes.lean index 751741a7927d8399cd4830e0b37e17eee448c88c..093f7966fe662149a3bbd538cb91c06c74b7b01c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/InitialMainAlgebraCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/InitialMainAlgebraCodes.lean @@ -1,202 +1,202 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.InitialMainAlgebra -universe u - -def carrier : ZFSet.{u} := natSetCode 2 -def actors : ZFSet.{u} := natSetCode 1 -def bottom : ZFSet.{u} := natSetCode 0 -def top : ZFSet.{u} := natSetCode 1 -def identity : ZFSet.{u} := bottom -def order : ZFSet.{u} := - {ZFSet.pair bottom bottom, ZFSet.pair bottom top, ZFSet.pair top top} -def meetGraph : ZFSet.{u} := - {ZFSet.pair (ZFSet.pair bottom bottom) bottom, - ZFSet.pair (ZFSet.pair bottom top) bottom, - ZFSet.pair (ZFSet.pair top bottom) bottom, - ZFSet.pair (ZFSet.pair top top) top} -def multiplication : ZFSet.{u} := {ZFSet.pair (ZFSet.pair identity identity) identity} -def inverse : ZFSet.{u} := {ZFSet.pair identity identity} -def action : ZFSet.{u} := - {ZFSet.pair (ZFSet.pair identity bottom) bottom, ZFSet.pair (ZFSet.pair identity top) top} - -theorem bottom_ne_top : (bottom : ZFSet.{u}) ≠ top := by - intro equal - have := natSetCode_injective equal - exact Nat.zero_ne_one this - -theorem mem_carrier (x : ZFSet.{u}) : x ∈ carrier ↔ x = bottom ∨ x = top := by - change x ∈ insert (natSetCode 1) (insert (natSetCode 0) ∅) ↔ _ - simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] - exact or_comm - -theorem mem_actors (x : ZFSet.{u}) : x ∈ actors ↔ x = identity := by - change x ∈ insert (natSetCode 0) ∅ ↔ _ - simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] - rfl - -theorem bottom_mem : (bottom : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inl rfl) -theorem top_mem : (top : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inr rfl) -theorem identity_mem : (identity : ZFSet.{u}) ∈ actors := (mem_actors _).2 rfl - -theorem pair_mem_order (x y : ZFSet.{u}) : ZFSet.pair x y ∈ order ↔ - (x = bottom ∧ y = bottom) ∨ (x = bottom ∧ y = top) ∨ (x = top ∧ y = top) := by - simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj] - -theorem pair_mem_meetGraph (x y z : ZFSet.{u}) : ZFSet.pair (ZFSet.pair x y) z ∈ meetGraph ↔ - ((x = bottom ∧ y = bottom) ∧ z = bottom) ∨ - ((x = bottom ∧ y = top) ∧ z = bottom) ∨ - ((x = top ∧ y = bottom) ∧ z = bottom) ∨ ((x = top ∧ y = top) ∧ z = top) := by - simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj] - -theorem pair_mem_multiplication (x y z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair x y) z ∈ multiplication ↔ (x = identity ∧ y = identity) ∧ z = identity := by - simp only [multiplication, ZFSet.mem_singleton, ZFSet.pair_inj] - -theorem pair_mem_inverse (x y : ZFSet.{u}) : ZFSet.pair x y ∈ inverse ↔ x = identity ∧ y = identity := by - simp only [inverse, ZFSet.mem_singleton, ZFSet.pair_inj] - -theorem pair_mem_action (g x y : ZFSet.{u}) : ZFSet.pair (ZFSet.pair g x) y ∈ action ↔ - ((g = identity ∧ x = bottom) ∧ y = bottom) ∨ ((g = identity ∧ x = top) ∧ y = top) := by - simp only [action, ZFSet.mem_pair, ZFSet.pair_inj] - -theorem least (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair bottom x ∈ order := by - rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order] - -theorem greatest (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair x top ∈ order := by - rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order] - -theorem meet_function : ZFSet.IsFunc (ZFSet.prod carrier carrier) carrier (meetGraph : ZFSet.{u}) := by - constructor - · intro z hz - simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz - rcases hz with rfl | rfl | rfl | rfl - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, bottom_mem⟩, bottom_mem⟩ - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, top_mem⟩, bottom_mem⟩ - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, bottom_mem⟩, bottom_mem⟩ - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, top_mem⟩, top_mem⟩ - · intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - rcases (mem_carrier x).1 hx with rfl | rfl <;> - rcases (mem_carrier y).1 hy with rfl | rfl <;> - simp [pair_mem_meetGraph, bottom_ne_top, Ne.symm bottom_ne_top] - -theorem meet_code : MeetOrderCode carrier order (meetGraph : ZFSet.{u}) where - order := { - relation := by - intro z hz - simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz - rcases hz with rfl | rfl | rfl <;> simp [mem_carrier] - refl := by - intro x hx - rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order] - antisymm := by - intro x hx y hy xy yx - rcases (mem_carrier x).1 hx with rfl | rfl <;> - rcases (mem_carrier y).1 hy with rfl | rfl <;> - simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] - trans := by - intro x hx y hy z hz xy yz - rcases (mem_carrier x).1 hx with rfl | rfl <;> - rcases (mem_carrier y).1 hy with rfl | rfl <;> - rcases (mem_carrier z).1 hz with rfl | rfl <;> - simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] } - operation := meet_function - lower_left := by - intro x y z entry - rcases (pair_mem_meetGraph x y z).1 entry with - ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> - simp [pair_mem_order] - lower_right := by - intro x y z entry - rcases (pair_mem_meetGraph x y z).1 entry with - ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> - simp [pair_mem_order] - greatest := by - intro x y z w hw entry wx wy - rcases (pair_mem_meetGraph x y z).1 entry with - ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> - rcases (mem_carrier w).1 hw with rfl | rfl <;> - simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] - -theorem group_code : GroupCode actors multiplication inverse (identity : ZFSet.{u}) where - mul_function := by - constructor - · intro z hz - rw [multiplication, ZFSet.mem_singleton] at hz - rw [hz] - simp [mem_actors] - · intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - obtain rfl := (mem_actors x).1 hx - obtain rfl := (mem_actors y).1 hy - simp [pair_mem_multiplication] - inv_function := by - constructor - · intro z hz - rw [inverse, ZFSet.mem_singleton] at hz - rw [hz] - simp [mem_actors] - · intro x hx - obtain rfl := (mem_actors x).1 hx - simp [pair_mem_inverse] - identity_mem := identity_mem - one_mul := by - intro x hx - obtain rfl := (mem_actors x).1 hx - simp [pair_mem_multiplication] - mul_one := by - intro x hx - obtain rfl := (mem_actors x).1 hx - simp [pair_mem_multiplication] - inv_mul := by - intro x hx y hy entry - obtain rfl := (mem_actors x).1 hx - obtain rfl := (mem_actors y).1 hy - simp [pair_mem_multiplication] - mul_assoc := by - intro x hx y hy z hz a ha b hb c hc xy yz az - obtain rfl := (mem_actors x).1 hx - obtain rfl := (mem_actors y).1 hy - obtain rfl := (mem_actors z).1 hz - obtain rfl := (mem_actors a).1 ha - obtain rfl := (mem_actors b).1 hb - obtain rfl := (mem_actors c).1 hc - simp [pair_mem_multiplication] - -theorem action_code : PosetActionCode actors carrier multiplication identity order (action : ZFSet.{u}) where - function := by - constructor - · intro z hz - simp only [action, ZFSet.mem_pair] at hz - rcases hz with rfl | rfl <;> simp [mem_actors, mem_carrier] - · intro z hz - obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hz - obtain rfl := (mem_actors g).1 hg - rcases (mem_carrier x).1 hx with rfl | rfl <;> - simp [pair_mem_action, bottom_ne_top, Ne.symm bottom_ne_top] - one := by - intro x hx - rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_action] - mul := by - intro g hg h hh k hk x hx y hy z hz gh hxY gyZ - obtain rfl := (mem_actors g).1 hg - obtain rfl := (mem_actors h).1 hh - obtain rfl := (mem_actors k).1 hk - rcases (pair_mem_action identity x y).1 hxY with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;> - simpa only using gyZ - monotone := by - intro g hg x hx y hy z hz w hw gxZ gyW xy - rcases (pair_mem_action g x z).1 gxZ with ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> - rcases (pair_mem_action identity y w).1 gyW with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;> - exact xy - -end PartitionPilot.Forcing.InitialMainAlgebra - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.InitialMainAlgebra +universe u + +def carrier : ZFSet.{u} := natSetCode 2 +def actors : ZFSet.{u} := natSetCode 1 +def bottom : ZFSet.{u} := natSetCode 0 +def top : ZFSet.{u} := natSetCode 1 +def identity : ZFSet.{u} := bottom +def order : ZFSet.{u} := + {ZFSet.pair bottom bottom, ZFSet.pair bottom top, ZFSet.pair top top} +def meetGraph : ZFSet.{u} := + {ZFSet.pair (ZFSet.pair bottom bottom) bottom, + ZFSet.pair (ZFSet.pair bottom top) bottom, + ZFSet.pair (ZFSet.pair top bottom) bottom, + ZFSet.pair (ZFSet.pair top top) top} +def multiplication : ZFSet.{u} := {ZFSet.pair (ZFSet.pair identity identity) identity} +def inverse : ZFSet.{u} := {ZFSet.pair identity identity} +def action : ZFSet.{u} := + {ZFSet.pair (ZFSet.pair identity bottom) bottom, ZFSet.pair (ZFSet.pair identity top) top} + +theorem bottom_ne_top : (bottom : ZFSet.{u}) ≠ top := by + intro equal + have := natSetCode_injective equal + exact Nat.zero_ne_one this + +theorem mem_carrier (x : ZFSet.{u}) : x ∈ carrier ↔ x = bottom ∨ x = top := by + change x ∈ insert (natSetCode 1) (insert (natSetCode 0) ∅) ↔ _ + simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] + exact or_comm + +theorem mem_actors (x : ZFSet.{u}) : x ∈ actors ↔ x = identity := by + change x ∈ insert (natSetCode 0) ∅ ↔ _ + simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] + rfl + +theorem bottom_mem : (bottom : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inl rfl) +theorem top_mem : (top : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inr rfl) +theorem identity_mem : (identity : ZFSet.{u}) ∈ actors := (mem_actors _).2 rfl + +theorem pair_mem_order (x y : ZFSet.{u}) : ZFSet.pair x y ∈ order ↔ + (x = bottom ∧ y = bottom) ∨ (x = bottom ∧ y = top) ∨ (x = top ∧ y = top) := by + simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj] + +theorem pair_mem_meetGraph (x y z : ZFSet.{u}) : ZFSet.pair (ZFSet.pair x y) z ∈ meetGraph ↔ + ((x = bottom ∧ y = bottom) ∧ z = bottom) ∨ + ((x = bottom ∧ y = top) ∧ z = bottom) ∨ + ((x = top ∧ y = bottom) ∧ z = bottom) ∨ ((x = top ∧ y = top) ∧ z = top) := by + simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj] + +theorem pair_mem_multiplication (x y z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair x y) z ∈ multiplication ↔ (x = identity ∧ y = identity) ∧ z = identity := by + simp only [multiplication, ZFSet.mem_singleton, ZFSet.pair_inj] + +theorem pair_mem_inverse (x y : ZFSet.{u}) : ZFSet.pair x y ∈ inverse ↔ x = identity ∧ y = identity := by + simp only [inverse, ZFSet.mem_singleton, ZFSet.pair_inj] + +theorem pair_mem_action (g x y : ZFSet.{u}) : ZFSet.pair (ZFSet.pair g x) y ∈ action ↔ + ((g = identity ∧ x = bottom) ∧ y = bottom) ∨ ((g = identity ∧ x = top) ∧ y = top) := by + simp only [action, ZFSet.mem_pair, ZFSet.pair_inj] + +theorem least (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair bottom x ∈ order := by + rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order] + +theorem greatest (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair x top ∈ order := by + rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order] + +theorem meet_function : ZFSet.IsFunc (ZFSet.prod carrier carrier) carrier (meetGraph : ZFSet.{u}) := by + constructor + · intro z hz + simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz + rcases hz with rfl | rfl | rfl | rfl + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, bottom_mem⟩, bottom_mem⟩ + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, top_mem⟩, bottom_mem⟩ + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, bottom_mem⟩, bottom_mem⟩ + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, top_mem⟩, top_mem⟩ + · intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + rcases (mem_carrier x).1 hx with rfl | rfl <;> + rcases (mem_carrier y).1 hy with rfl | rfl <;> + simp [pair_mem_meetGraph, bottom_ne_top, Ne.symm bottom_ne_top] + +theorem meet_code : MeetOrderCode carrier order (meetGraph : ZFSet.{u}) where + order := { + relation := by + intro z hz + simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz + rcases hz with rfl | rfl | rfl <;> simp [mem_carrier] + refl := by + intro x hx + rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order] + antisymm := by + intro x hx y hy xy yx + rcases (mem_carrier x).1 hx with rfl | rfl <;> + rcases (mem_carrier y).1 hy with rfl | rfl <;> + simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] + trans := by + intro x hx y hy z hz xy yz + rcases (mem_carrier x).1 hx with rfl | rfl <;> + rcases (mem_carrier y).1 hy with rfl | rfl <;> + rcases (mem_carrier z).1 hz with rfl | rfl <;> + simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] } + operation := meet_function + lower_left := by + intro x y z entry + rcases (pair_mem_meetGraph x y z).1 entry with + ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> + simp [pair_mem_order] + lower_right := by + intro x y z entry + rcases (pair_mem_meetGraph x y z).1 entry with + ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> + simp [pair_mem_order] + greatest := by + intro x y z w hw entry wx wy + rcases (pair_mem_meetGraph x y z).1 entry with + ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> + rcases (mem_carrier w).1 hw with rfl | rfl <;> + simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] + +theorem group_code : GroupCode actors multiplication inverse (identity : ZFSet.{u}) where + mul_function := by + constructor + · intro z hz + rw [multiplication, ZFSet.mem_singleton] at hz + rw [hz] + simp [mem_actors] + · intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + obtain rfl := (mem_actors x).1 hx + obtain rfl := (mem_actors y).1 hy + simp [pair_mem_multiplication] + inv_function := by + constructor + · intro z hz + rw [inverse, ZFSet.mem_singleton] at hz + rw [hz] + simp [mem_actors] + · intro x hx + obtain rfl := (mem_actors x).1 hx + simp [pair_mem_inverse] + identity_mem := identity_mem + one_mul := by + intro x hx + obtain rfl := (mem_actors x).1 hx + simp [pair_mem_multiplication] + mul_one := by + intro x hx + obtain rfl := (mem_actors x).1 hx + simp [pair_mem_multiplication] + inv_mul := by + intro x hx y hy entry + obtain rfl := (mem_actors x).1 hx + obtain rfl := (mem_actors y).1 hy + simp [pair_mem_multiplication] + mul_assoc := by + intro x hx y hy z hz a ha b hb c hc xy yz az + obtain rfl := (mem_actors x).1 hx + obtain rfl := (mem_actors y).1 hy + obtain rfl := (mem_actors z).1 hz + obtain rfl := (mem_actors a).1 ha + obtain rfl := (mem_actors b).1 hb + obtain rfl := (mem_actors c).1 hc + simp [pair_mem_multiplication] + +theorem action_code : PosetActionCode actors carrier multiplication identity order (action : ZFSet.{u}) where + function := by + constructor + · intro z hz + simp only [action, ZFSet.mem_pair] at hz + rcases hz with rfl | rfl <;> simp [mem_actors, mem_carrier] + · intro z hz + obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hz + obtain rfl := (mem_actors g).1 hg + rcases (mem_carrier x).1 hx with rfl | rfl <;> + simp [pair_mem_action, bottom_ne_top, Ne.symm bottom_ne_top] + one := by + intro x hx + rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_action] + mul := by + intro g hg h hh k hk x hx y hy z hz gh hxY gyZ + obtain rfl := (mem_actors g).1 hg + obtain rfl := (mem_actors h).1 hh + obtain rfl := (mem_actors k).1 hk + rcases (pair_mem_action identity x y).1 hxY with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;> + simpa only using gyZ + monotone := by + intro g hg x hx y hy z hz w hw gxZ gyW xy + rcases (pair_mem_action g x z).1 gxZ with ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;> + rcases (pair_mem_action identity y w).1 gyW with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;> + exact xy + +end PartitionPilot.Forcing.InitialMainAlgebra + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalEmbeddingFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalEmbeddingFormulas.lean index 0b1569d970f8a58fd8af6da33a22698aee8e1e51..7682e6f7b8f428d6acf9a3a74a51fa9a625b50c4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalEmbeddingFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalEmbeddingFormulas.lean @@ -1,67 +1,67 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.IntervalEmbeddingFamilyCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n) : BoundedFormula n := - let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ - let order : BoundedFormula n := - .allMem A (.allMem A.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ - (imp (pairMembershipFormula 3 1 (lift f)) - (imp (pairMembershipFormula 2 0 (lift f)) - (iffFormula (pairMembershipFormula 3 2 (lift rA)) - (pairMembershipFormula 1 0 (lift rD)))))))) - let inside : BoundedFormula n := - .allMem A (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ) - (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ) - (pairMembershipFormula 0 hi.succ.succ rD.succ.succ)))) - .conj (injectionFormula A D f) (.conj order inside) - -theorem truth_intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (intervalEmbeddingFormula A D rA rD lo hi f) env ↔ - IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) := by - simp only [intervalEmbeddingFormula, Truth, truth_injectionFormula, - truth_imp, truth_pairMembershipFormula, truth_iffFormula] - change (InjectionCode (env A) (env D) (env f) ∧ - (∀ a ∈ env A, ∀ b ∈ env A, ∀ q ∈ env D, ∀ z ∈ env D, - ZFSet.pair a q ∈ env f → ZFSet.pair b z ∈ env f → - (ZFSet.pair a b ∈ env rA ↔ ZFSet.pair q z ∈ env rD)) ∧ - (∀ a ∈ env A, ∀ q ∈ env D, ZFSet.pair a q ∈ env f → - ZFSet.pair (env lo) q ∈ env rD ∧ ZFSet.pair q (env hi) ∈ env rD)) ↔ _ - constructor - · rintro ⟨injection, order, inside⟩ - refine ⟨injection, ?_, ?_⟩ - · intro a b q z first second - have aq := ZFSet.pair_mem_prod.1 (injection.function.1 first) - have bz := ZFSet.pair_mem_prod.1 (injection.function.1 second) - exact order a aq.1 b bz.1 q aq.2 z bz.2 first second - · intro a q entry - have aq := ZFSet.pair_mem_prod.1 (injection.function.1 entry) - exact inside a aq.1 q aq.2 entry - · intro code - refine ⟨code.injection, ?_, ?_⟩ - · intro a _ b _ q _ z _ first second - exact code.order a b q z first second - · intro a _ q _ entry - exact code.inside a q entry - -theorem realize_intervalEmbeddingFormula (M : TransitiveGround.{u}) {n} - (A D rA rD lo hi f : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (intervalEmbeddingFormula A D rA rD lo hi f).toFormula env ↔ - IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) := - (realize_toFormula M _ env members).trans - (truth_intervalEmbeddingFormula A D rA rD lo hi f env) - -end PartitionPilot.Forcing.BoundedFormula - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.IntervalEmbeddingFamilyCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n) : BoundedFormula n := + let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ + let order : BoundedFormula n := + .allMem A (.allMem A.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ + (imp (pairMembershipFormula 3 1 (lift f)) + (imp (pairMembershipFormula 2 0 (lift f)) + (iffFormula (pairMembershipFormula 3 2 (lift rA)) + (pairMembershipFormula 1 0 (lift rD)))))))) + let inside : BoundedFormula n := + .allMem A (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ) + (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ) + (pairMembershipFormula 0 hi.succ.succ rD.succ.succ)))) + .conj (injectionFormula A D f) (.conj order inside) + +theorem truth_intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (intervalEmbeddingFormula A D rA rD lo hi f) env ↔ + IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) := by + simp only [intervalEmbeddingFormula, Truth, truth_injectionFormula, + truth_imp, truth_pairMembershipFormula, truth_iffFormula] + change (InjectionCode (env A) (env D) (env f) ∧ + (∀ a ∈ env A, ∀ b ∈ env A, ∀ q ∈ env D, ∀ z ∈ env D, + ZFSet.pair a q ∈ env f → ZFSet.pair b z ∈ env f → + (ZFSet.pair a b ∈ env rA ↔ ZFSet.pair q z ∈ env rD)) ∧ + (∀ a ∈ env A, ∀ q ∈ env D, ZFSet.pair a q ∈ env f → + ZFSet.pair (env lo) q ∈ env rD ∧ ZFSet.pair q (env hi) ∈ env rD)) ↔ _ + constructor + · rintro ⟨injection, order, inside⟩ + refine ⟨injection, ?_, ?_⟩ + · intro a b q z first second + have aq := ZFSet.pair_mem_prod.1 (injection.function.1 first) + have bz := ZFSet.pair_mem_prod.1 (injection.function.1 second) + exact order a aq.1 b bz.1 q aq.2 z bz.2 first second + · intro a q entry + have aq := ZFSet.pair_mem_prod.1 (injection.function.1 entry) + exact inside a aq.1 q aq.2 entry + · intro code + refine ⟨code.injection, ?_, ?_⟩ + · intro a _ b _ q _ z _ first second + exact code.order a b q z first second + · intro a _ q _ entry + exact code.inside a q entry + +theorem realize_intervalEmbeddingFormula (M : TransitiveGround.{u}) {n} + (A D rA rD lo hi f : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (intervalEmbeddingFormula A D rA rD lo hi f).toFormula env ↔ + IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) := + (realize_toFormula M _ env members).trans + (truth_intervalEmbeddingFormula A D rA rD lo hi f env) + +end PartitionPilot.Forcing.BoundedFormula + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalHeightFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalHeightFormulas.lean index 758934f2ac0546f0be1ec6c8abd36fc6bfddde1a..e1f42dcb85084675b841d5a56cdbe808cc8435df 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalHeightFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalHeightFormulas.lean @@ -1,62 +1,62 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCodedBinaryHeights - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def intervalHeightFormula {n} (L r D rD lo hi f : Fin n) : BoundedFormula n := - let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ - let strict : BoundedFormula n := - .allMem L (.allMem L.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ - (imp (.neg (.equal 3 2)) (imp (pairMembershipFormula 3 2 (lift r)) - (imp (pairMembershipFormula 3 1 (lift f)) - (imp (pairMembershipFormula 2 0 (lift f)) (pairMembershipFormula 1 0 (lift rD))))))))) - let inside : BoundedFormula n := - .allMem L (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ) - (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ) - (pairMembershipFormula 0 hi.succ.succ rD.succ.succ)))) - .conj (functionFormula L D f) (.conj strict inside) - -theorem truth_intervalHeightFormula {n} (L r D rD lo hi f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (intervalHeightFormula L r D rD lo hi f) env ↔ - IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) := by - simp only [intervalHeightFormula, Truth, truth_functionFormula, - truth_imp, truth_pairMembershipFormula] - change (ZFSet.IsFunc (env L) (env D) (env f) ∧ - (∀ x ∈ env L, ∀ y ∈ env L, ∀ a ∈ env D, ∀ b ∈ env D, - x ≠ y → ZFSet.pair x y ∈ env r → ZFSet.pair x a ∈ env f → - ZFSet.pair y b ∈ env f → ZFSet.pair a b ∈ env rD) ∧ - (∀ x ∈ env L, ∀ a ∈ env D, ZFSet.pair x a ∈ env f → - ZFSet.pair (env lo) a ∈ env rD ∧ ZFSet.pair a (env hi) ∈ env rD)) ↔ _ - constructor - · rintro ⟨function, strict, inside⟩ - refine ⟨⟨function, ?_⟩, ?_⟩ - · intro x hx y hy different lower a b first second - exact strict x hx y hy a (ZFSet.pair_mem_prod.1 (function.1 first)).2 - b (ZFSet.pair_mem_prod.1 (function.1 second)).2 different lower first second - · intro x a entry - have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) - exact inside x bounds.1 a bounds.2 entry - · intro code - refine ⟨code.function, ?_, ?_⟩ - · intro x hx y hy a _ b _ different lower first second - exact code.strict x hx y hy different lower a b first second - · intro x _ a _ entry - exact code.inside x a entry - -theorem realize_intervalHeightFormula (M : TransitiveGround.{u}) {n} - (L r D rD lo hi f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (intervalHeightFormula L r D rD lo hi f).toFormula env ↔ - IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) := - (realize_toFormula M _ env members).trans (truth_intervalHeightFormula L r D rD lo hi f env) - -end PartitionPilot.Forcing.BoundedFormula - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCodedBinaryHeights + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def intervalHeightFormula {n} (L r D rD lo hi f : Fin n) : BoundedFormula n := + let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ + let strict : BoundedFormula n := + .allMem L (.allMem L.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ + (imp (.neg (.equal 3 2)) (imp (pairMembershipFormula 3 2 (lift r)) + (imp (pairMembershipFormula 3 1 (lift f)) + (imp (pairMembershipFormula 2 0 (lift f)) (pairMembershipFormula 1 0 (lift rD))))))))) + let inside : BoundedFormula n := + .allMem L (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ) + (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ) + (pairMembershipFormula 0 hi.succ.succ rD.succ.succ)))) + .conj (functionFormula L D f) (.conj strict inside) + +theorem truth_intervalHeightFormula {n} (L r D rD lo hi f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (intervalHeightFormula L r D rD lo hi f) env ↔ + IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) := by + simp only [intervalHeightFormula, Truth, truth_functionFormula, + truth_imp, truth_pairMembershipFormula] + change (ZFSet.IsFunc (env L) (env D) (env f) ∧ + (∀ x ∈ env L, ∀ y ∈ env L, ∀ a ∈ env D, ∀ b ∈ env D, + x ≠ y → ZFSet.pair x y ∈ env r → ZFSet.pair x a ∈ env f → + ZFSet.pair y b ∈ env f → ZFSet.pair a b ∈ env rD) ∧ + (∀ x ∈ env L, ∀ a ∈ env D, ZFSet.pair x a ∈ env f → + ZFSet.pair (env lo) a ∈ env rD ∧ ZFSet.pair a (env hi) ∈ env rD)) ↔ _ + constructor + · rintro ⟨function, strict, inside⟩ + refine ⟨⟨function, ?_⟩, ?_⟩ + · intro x hx y hy different lower a b first second + exact strict x hx y hy a (ZFSet.pair_mem_prod.1 (function.1 first)).2 + b (ZFSet.pair_mem_prod.1 (function.1 second)).2 different lower first second + · intro x a entry + have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) + exact inside x bounds.1 a bounds.2 entry + · intro code + refine ⟨code.function, ?_, ?_⟩ + · intro x hx y hy a _ b _ different lower first second + exact code.strict x hx y hy different lower a b first second + · intro x _ a _ entry + exact code.inside x a entry + +theorem realize_intervalHeightFormula (M : TransitiveGround.{u}) {n} + (L r D rD lo hi f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (intervalHeightFormula L r D rD lo hi f).toFormula env ↔ + IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) := + (realize_toFormula M _ env members).trans (truth_intervalHeightFormula L r D rD lo hi f env) + +end PartitionPilot.Forcing.BoundedFormula + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalSequenceFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalSequenceFormulas.lean index addc61477e66a2bd80cea546518caab8d7369813..6d24b5150834c5d6415dc7c119a4a22eda2b3c76 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalSequenceFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalSequenceFormulas.lean @@ -1,277 +1,277 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIntervalSelection - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -structure IntervalSequenceCode (N A D rA rD e lo hi t : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc N D t - inside : ∀ i q, ZFSet.pair i q ∈ t → ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD - agree : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e → - ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → (a = b ↔ q = z) - order : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e → - ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → - (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD) - -def intervalNextCandidate (N A D rA rD e lo hi p y : ZFSet.{u}) : Prop := - y ∈ D ∧ ZFSet.pair lo y ∈ rD ∧ ZFSet.pair y hi ∈ rD ∧ - ∀ i ∈ N, ∀ a ∈ A, ∀ b ∈ A, ∀ z ∈ D, - ZFSet.pair i a ∈ e → ZFSet.pair N b ∈ e → ZFSet.pair i z ∈ p → - ((a = b ↔ z = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair z y ∈ rD) ∧ - (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y z ∈ rD)) - -theorem pair_mem_intervalSequenceInsert (N p y i q : ZFSet.{u}) : - ZFSet.pair i q ∈ insert (ZFSet.pair N y) p ↔ - (i = N ∧ q = y) ∨ ZFSet.pair i q ∈ p := by - rw [ZFSet.mem_insert_iff, ZFSet.pair_inj] - -namespace IntervalSequenceCode - -theorem empty (A D rA rD e lo hi : ZFSet.{u}) : IntervalSequenceCode ∅ A D rA rD e lo hi ∅ := by - refine ⟨⟨ZFSet.empty_subset _, fun i hi => False.elim (ZFSet.notMem_empty i hi)⟩, ?_, ?_, ?_⟩ - · intro i q h - exact False.elim (ZFSet.notMem_empty _ h) - · intro i j a b q z _ _ h _ - exact False.elim (ZFSet.notMem_empty _ h) - · intro i j a b q z _ _ h _ - exact False.elim (ZFSet.notMem_empty _ h) - -theorem restrict {N A D rA rD e lo hi t B : ZFSet.{u}} - (code : IntervalSequenceCode N A D rA rD e lo hi t) (subset : B ⊆ N) : - IntervalSequenceCode B A D rA rD e lo hi (graphRestriction B t) := by - have function : FunctionGraphOn N t := ⟨D, code.function⟩ - refine ⟨⟨?_, (function.restrict subset).to_isFunc.2⟩, ?_, ?_, ?_⟩ - · intro z hz - obtain ⟨i, hi, q, rfl, entry⟩ := mem_graphRestriction.1 hz - exact ZFSet.pair_mem_prod.2 ⟨hi, (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2⟩ - · intro i q entry - exact code.inside i q (pair_mem_graphRestriction.1 entry).1 - · intro i j a b q z ea eb qi zj - exact code.agree i j a b q z ea eb - (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1 - · intro i j a b q z ea eb qi zj - exact code.order i j a b q z ea eb - (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1 - -theorem insert {N A D rA rD e lo hi p y : ZFSet.{u}} - (code : IntervalSequenceCode N A D rA rD e lo hi p) - (enumeration : ZFSet.IsFunc ZFSet.omega A e) - (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD) - (candidate : intervalNextCandidate N A D rA rD e lo hi p y) : - IntervalSequenceCode (Insert.insert N N) A D rA rD e lo hi (Insert.insert (ZFSet.pair N y) p) := by - have function : FunctionGraphOn N p := ⟨D, code.function⟩ - have enumFunction : FunctionGraphOn ZFSet.omega e := ⟨A, enumeration⟩ - have cross (i a b q : ZFSet.{u}) (ea : ZFSet.pair i a ∈ e) (eb : ZFSet.pair N b ∈ e) - (qi : ZFSet.pair i q ∈ p) : - (a = b ↔ q = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q y ∈ rD) ∧ - (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y q ∈ rD) := - candidate.2.2.2 i (ZFSet.pair_mem_prod.1 (code.function.1 qi)).1 - a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2 - b (ZFSet.pair_mem_prod.1 (enumeration.1 eb)).2 - q (ZFSet.pair_mem_prod.1 (code.function.1 qi)).2 ea eb qi - refine ⟨⟨?_, (function.successor y).to_isFunc.2⟩, ?_, ?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_insert_iff.1 hz with rfl | hz - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, candidate.1⟩ - · obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hi, hq⟩ - · intro i q entry - rcases (pair_mem_intervalSequenceInsert N p y i q).1 entry with ⟨rfl, rfl⟩ | entry - · exact ⟨candidate.2.1, candidate.2.2.1⟩ - · exact code.inside i q entry - · intro i j a b q z ea eb qi zj - rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi - · subst i - subst q - rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj - · subst j - subst z - have equal := enumFunction.unique ea eb - exact ⟨fun _ => rfl, fun _ => equal⟩ - · have relation := (cross j b a z eb ea zj).1 - exact ⟨fun h => (relation.1 h.symm).symm, fun h => (relation.2 h.symm).symm⟩ - · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj - · subst j - subst z - exact (cross i a b q ea eb qi).1 - · exact code.agree i j a b q z ea eb qi zj - · intro i j a b q z ea eb qi zj - rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi - · subst i - subst q - rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj - · subst j - subst z - have equal := enumFunction.unique ea eb - subst b - exact iff_of_false (source.irrefl a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2) - (target.irrefl y candidate.1) - · exact (cross j b a z eb ea zj).2.2 - · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj - · subst j - subst z - exact (cross i a b q ea eb qi).2.1 - · exact code.order i j a b q z ea eb qi zj - -end IntervalSequenceCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -universe u - -def leastIntervalNextCandidate (N A D rA rD e lo hi p c y : ZFSet.{u}) : Prop := - intervalNextCandidate N A D rA rD e lo hi p y ∧ - ∃ n ∈ ZFSet.omega, ZFSet.pair y n ∈ c ∧ - ∀ z ∈ D, intervalNextCandidate N A D rA rD e lo hi p z → - ∀ m ∈ n, ZFSet.pair z m ∉ c - -theorem leastIntervalNextCandidate_unique {N A D rA rD e lo hi p c x y : ZFSet.{u}} - (injection : InjectionCode D ZFSet.omega c) - (hx : leastIntervalNextCandidate N A D rA rD e lo hi p c x) - (hy : leastIntervalNextCandidate N A D rA rD e lo hi p c y) : x = y := by - obtain ⟨xValid, n, hn, xn, leastX⟩ := hx - obtain ⟨yValid, m, hm, ym, leastY⟩ := hy - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - rcases lt_trichotomy k l with smaller | equal | larger - · exact False.elim (leastY x xValid.1 xValid (natSetCode k) - ((natSetCode_mem_iff k l).2 smaller) xn) - · subst l - exact injection.injective x y (natSetCode k) xn ym - · exact False.elim (leastX y yValid.1 yValid (natSetCode l) - ((natSetCode_mem_iff l k).2 larger) ym) - -theorem leastIntervalNextCandidate_exists_unique {N A D rA rD e lo hi p c : ZFSet.{u}} - (injection : InjectionCode D ZFSet.omega c) - (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) : - ∃! y, leastIntervalNextCandidate N A D rA rD e lo hi p c y := by - classical - let valid : Nat → Prop := fun n => ∃ y, intervalNextCandidate N A D rA rD e lo hi p y ∧ - ZFSet.pair y (natSetCode n) ∈ c - have existsValid : ∃ n, valid n := by - obtain ⟨y, hy⟩ := candidate - obtain ⟨a, entry, _⟩ := injection.function.2 y hy.1 - have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat - exact ⟨n, y, hy, entry⟩ - obtain ⟨y, hy, entry⟩ := Nat.find_spec existsValid - have selected : leastIntervalNextCandidate N A D rA rD e lo hi p c y := by - refine ⟨hy, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩ - intro z _ hz m hm smaller - obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm - have validK : valid k := ⟨z, hz, equal ▸ smaller⟩ - exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower - exact ⟨y, selected, fun z hz => leastIntervalNextCandidate_unique injection hz selected⟩ - -namespace BoundedFormula - -open SetFormula - -def iffFormula {n} (φ ψ : BoundedFormula n) : BoundedFormula n := - .conj (imp φ ψ) (imp ψ φ) - -theorem truth_iffFormula {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) : - Truth (iffFormula φ ψ) env ↔ (Truth φ env ↔ Truth ψ env) := by - simp only [iffFormula, Truth, truth_imp] - exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩ - -def intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n) : BoundedFormula n := - let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ - .conj (.mem y D) (.conj (pairMembershipFormula lo y rD) - (.conj (pairMembershipFormula y hi rD) - (.allMem N (.allMem A.succ (.allMem A.succ.succ (.allMem D.succ.succ.succ - (imp (pairMembershipFormula 3 2 (lift e)) - (imp (pairMembershipFormula (lift N) 1 (lift e)) - (imp (pairMembershipFormula 3 0 (lift p)) - (.conj (iffFormula (.equal 2 1) (.equal 0 (lift y))) - (.conj (iffFormula (pairMembershipFormula 2 1 (lift rA)) - (pairMembershipFormula 0 (lift y) (lift rD))) - (iffFormula (pairMembershipFormula 1 2 (lift rA)) - (pairMembershipFormula (lift y) 0 (lift rD)))))))))))))) - -theorem truth_intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (intervalNextCandidateFormula N A D rA rD e lo hi p y) env ↔ - intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) - (env lo) (env hi) (env p) (env y) := by - simp only [intervalNextCandidateFormula, Truth, truth_pairMembershipFormula, - truth_imp, truth_iffFormula] - rfl - -def leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n) : BoundedFormula n := - .conj (intervalNextCandidateFormula N A D rA rD e lo hi p y) - (exMem omega (.conj (pairMembershipFormula y.succ 0 c.succ) - (.allMem D.succ (imp - (intervalNextCandidateFormula N.succ.succ A.succ.succ D.succ.succ rA.succ.succ - rD.succ.succ e.succ.succ lo.succ.succ hi.succ.succ p.succ.succ 0) - (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ))))))) - -theorem truth_leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n) - (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) : - Truth (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega) env ↔ - leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) - (env lo) (env hi) (env p) (env c) (env y) := by - simp only [leastIntervalNextCandidateFormula, Truth, truth_exMem, truth_imp, - truth_pairMembershipFormula, truth_intervalNextCandidateFormula] - change (intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) - (env lo) (env hi) (env p) (env y) ∧ - ∃ k ∈ env omega, ZFSet.pair (env y) k ∈ env c ∧ - ∀ z ∈ env D, intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) - (env lo) (env hi) (env p) z → ∀ m ∈ k, ZFSet.pair z m ∉ env c) ↔ _ - rw [hOmega] - rfl - -theorem realize_leastIntervalNextCandidateFormula (M : TransitiveGround.{u}) {n} - (N A D rA rD e lo hi p c y omega : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (hOmega : env omega = ZFSet.omega) : - Realize M.sets (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega).toFormula env ↔ - leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) - (env lo) (env hi) (env p) (env c) (env y) := - (realize_toFormula M _ env members).trans - (truth_leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega env hOmega) - -end BoundedFormula - -namespace SetFormula - -def intervalSequenceStepFormula : SetFormula 12 := - (BoundedFormula.leastIntervalNextCandidateFormula 0 3 4 5 6 7 8 9 1 10 2 11).toFormula - -end SetFormula - -namespace TransitiveGround - -open SetFormula - -theorem realize_intervalSequenceStepFormula (M : TransitiveGround.{u}) - (env : Fin 12 → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (hOmega : env 11 = ZFSet.omega) : - Realize M.sets intervalSequenceStepFormula env ↔ - leastIntervalNextCandidate (env 0) (env 3) (env 4) (env 5) (env 6) (env 7) - (env 8) (env 9) (env 1) (env 10) (env 2) := - BoundedFormula.realize_leastIntervalNextCandidateFormula M 0 3 4 5 6 7 8 9 1 10 2 11 - env members hOmega - -theorem exists_unique_ground_intervalNext (M : TransitiveGround.{u}) - {N A D rA rD e lo hi p c : ZFSet.{u}} (hD : D ∈ M.sets) - (injection : InjectionCode D ZFSet.omega c) - (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) : - ∃! y, y ∈ M.sets ∧ leastIntervalNextCandidate N A D rA rD e lo hi p c y := by - obtain ⟨y, selected, unique⟩ := leastIntervalNextCandidate_exists_unique injection candidate - exact ⟨y, ⟨M.transitive hD selected.1.1, selected⟩, fun z hz => unique z hz.2⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIntervalSelection + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +structure IntervalSequenceCode (N A D rA rD e lo hi t : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc N D t + inside : ∀ i q, ZFSet.pair i q ∈ t → ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD + agree : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e → + ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → (a = b ↔ q = z) + order : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e → + ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → + (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD) + +def intervalNextCandidate (N A D rA rD e lo hi p y : ZFSet.{u}) : Prop := + y ∈ D ∧ ZFSet.pair lo y ∈ rD ∧ ZFSet.pair y hi ∈ rD ∧ + ∀ i ∈ N, ∀ a ∈ A, ∀ b ∈ A, ∀ z ∈ D, + ZFSet.pair i a ∈ e → ZFSet.pair N b ∈ e → ZFSet.pair i z ∈ p → + ((a = b ↔ z = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair z y ∈ rD) ∧ + (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y z ∈ rD)) + +theorem pair_mem_intervalSequenceInsert (N p y i q : ZFSet.{u}) : + ZFSet.pair i q ∈ insert (ZFSet.pair N y) p ↔ + (i = N ∧ q = y) ∨ ZFSet.pair i q ∈ p := by + rw [ZFSet.mem_insert_iff, ZFSet.pair_inj] + +namespace IntervalSequenceCode + +theorem empty (A D rA rD e lo hi : ZFSet.{u}) : IntervalSequenceCode ∅ A D rA rD e lo hi ∅ := by + refine ⟨⟨ZFSet.empty_subset _, fun i hi => False.elim (ZFSet.notMem_empty i hi)⟩, ?_, ?_, ?_⟩ + · intro i q h + exact False.elim (ZFSet.notMem_empty _ h) + · intro i j a b q z _ _ h _ + exact False.elim (ZFSet.notMem_empty _ h) + · intro i j a b q z _ _ h _ + exact False.elim (ZFSet.notMem_empty _ h) + +theorem restrict {N A D rA rD e lo hi t B : ZFSet.{u}} + (code : IntervalSequenceCode N A D rA rD e lo hi t) (subset : B ⊆ N) : + IntervalSequenceCode B A D rA rD e lo hi (graphRestriction B t) := by + have function : FunctionGraphOn N t := ⟨D, code.function⟩ + refine ⟨⟨?_, (function.restrict subset).to_isFunc.2⟩, ?_, ?_, ?_⟩ + · intro z hz + obtain ⟨i, hi, q, rfl, entry⟩ := mem_graphRestriction.1 hz + exact ZFSet.pair_mem_prod.2 ⟨hi, (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2⟩ + · intro i q entry + exact code.inside i q (pair_mem_graphRestriction.1 entry).1 + · intro i j a b q z ea eb qi zj + exact code.agree i j a b q z ea eb + (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1 + · intro i j a b q z ea eb qi zj + exact code.order i j a b q z ea eb + (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1 + +theorem insert {N A D rA rD e lo hi p y : ZFSet.{u}} + (code : IntervalSequenceCode N A D rA rD e lo hi p) + (enumeration : ZFSet.IsFunc ZFSet.omega A e) + (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD) + (candidate : intervalNextCandidate N A D rA rD e lo hi p y) : + IntervalSequenceCode (Insert.insert N N) A D rA rD e lo hi (Insert.insert (ZFSet.pair N y) p) := by + have function : FunctionGraphOn N p := ⟨D, code.function⟩ + have enumFunction : FunctionGraphOn ZFSet.omega e := ⟨A, enumeration⟩ + have cross (i a b q : ZFSet.{u}) (ea : ZFSet.pair i a ∈ e) (eb : ZFSet.pair N b ∈ e) + (qi : ZFSet.pair i q ∈ p) : + (a = b ↔ q = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q y ∈ rD) ∧ + (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y q ∈ rD) := + candidate.2.2.2 i (ZFSet.pair_mem_prod.1 (code.function.1 qi)).1 + a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2 + b (ZFSet.pair_mem_prod.1 (enumeration.1 eb)).2 + q (ZFSet.pair_mem_prod.1 (code.function.1 qi)).2 ea eb qi + refine ⟨⟨?_, (function.successor y).to_isFunc.2⟩, ?_, ?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_insert_iff.1 hz with rfl | hz + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, candidate.1⟩ + · obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hi, hq⟩ + · intro i q entry + rcases (pair_mem_intervalSequenceInsert N p y i q).1 entry with ⟨rfl, rfl⟩ | entry + · exact ⟨candidate.2.1, candidate.2.2.1⟩ + · exact code.inside i q entry + · intro i j a b q z ea eb qi zj + rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi + · subst i + subst q + rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj + · subst j + subst z + have equal := enumFunction.unique ea eb + exact ⟨fun _ => rfl, fun _ => equal⟩ + · have relation := (cross j b a z eb ea zj).1 + exact ⟨fun h => (relation.1 h.symm).symm, fun h => (relation.2 h.symm).symm⟩ + · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj + · subst j + subst z + exact (cross i a b q ea eb qi).1 + · exact code.agree i j a b q z ea eb qi zj + · intro i j a b q z ea eb qi zj + rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi + · subst i + subst q + rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj + · subst j + subst z + have equal := enumFunction.unique ea eb + subst b + exact iff_of_false (source.irrefl a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2) + (target.irrefl y candidate.1) + · exact (cross j b a z eb ea zj).2.2 + · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj + · subst j + subst z + exact (cross i a b q ea eb qi).2.1 + · exact code.order i j a b q z ea eb qi zj + +end IntervalSequenceCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +universe u + +def leastIntervalNextCandidate (N A D rA rD e lo hi p c y : ZFSet.{u}) : Prop := + intervalNextCandidate N A D rA rD e lo hi p y ∧ + ∃ n ∈ ZFSet.omega, ZFSet.pair y n ∈ c ∧ + ∀ z ∈ D, intervalNextCandidate N A D rA rD e lo hi p z → + ∀ m ∈ n, ZFSet.pair z m ∉ c + +theorem leastIntervalNextCandidate_unique {N A D rA rD e lo hi p c x y : ZFSet.{u}} + (injection : InjectionCode D ZFSet.omega c) + (hx : leastIntervalNextCandidate N A D rA rD e lo hi p c x) + (hy : leastIntervalNextCandidate N A D rA rD e lo hi p c y) : x = y := by + obtain ⟨xValid, n, hn, xn, leastX⟩ := hx + obtain ⟨yValid, m, hm, ym, leastY⟩ := hy + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + rcases lt_trichotomy k l with smaller | equal | larger + · exact False.elim (leastY x xValid.1 xValid (natSetCode k) + ((natSetCode_mem_iff k l).2 smaller) xn) + · subst l + exact injection.injective x y (natSetCode k) xn ym + · exact False.elim (leastX y yValid.1 yValid (natSetCode l) + ((natSetCode_mem_iff l k).2 larger) ym) + +theorem leastIntervalNextCandidate_exists_unique {N A D rA rD e lo hi p c : ZFSet.{u}} + (injection : InjectionCode D ZFSet.omega c) + (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) : + ∃! y, leastIntervalNextCandidate N A D rA rD e lo hi p c y := by + classical + let valid : Nat → Prop := fun n => ∃ y, intervalNextCandidate N A D rA rD e lo hi p y ∧ + ZFSet.pair y (natSetCode n) ∈ c + have existsValid : ∃ n, valid n := by + obtain ⟨y, hy⟩ := candidate + obtain ⟨a, entry, _⟩ := injection.function.2 y hy.1 + have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat + exact ⟨n, y, hy, entry⟩ + obtain ⟨y, hy, entry⟩ := Nat.find_spec existsValid + have selected : leastIntervalNextCandidate N A D rA rD e lo hi p c y := by + refine ⟨hy, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩ + intro z _ hz m hm smaller + obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm + have validK : valid k := ⟨z, hz, equal ▸ smaller⟩ + exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower + exact ⟨y, selected, fun z hz => leastIntervalNextCandidate_unique injection hz selected⟩ + +namespace BoundedFormula + +open SetFormula + +def iffFormula {n} (φ ψ : BoundedFormula n) : BoundedFormula n := + .conj (imp φ ψ) (imp ψ φ) + +theorem truth_iffFormula {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) : + Truth (iffFormula φ ψ) env ↔ (Truth φ env ↔ Truth ψ env) := by + simp only [iffFormula, Truth, truth_imp] + exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩ + +def intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n) : BoundedFormula n := + let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ + .conj (.mem y D) (.conj (pairMembershipFormula lo y rD) + (.conj (pairMembershipFormula y hi rD) + (.allMem N (.allMem A.succ (.allMem A.succ.succ (.allMem D.succ.succ.succ + (imp (pairMembershipFormula 3 2 (lift e)) + (imp (pairMembershipFormula (lift N) 1 (lift e)) + (imp (pairMembershipFormula 3 0 (lift p)) + (.conj (iffFormula (.equal 2 1) (.equal 0 (lift y))) + (.conj (iffFormula (pairMembershipFormula 2 1 (lift rA)) + (pairMembershipFormula 0 (lift y) (lift rD))) + (iffFormula (pairMembershipFormula 1 2 (lift rA)) + (pairMembershipFormula (lift y) 0 (lift rD)))))))))))))) + +theorem truth_intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (intervalNextCandidateFormula N A D rA rD e lo hi p y) env ↔ + intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) + (env lo) (env hi) (env p) (env y) := by + simp only [intervalNextCandidateFormula, Truth, truth_pairMembershipFormula, + truth_imp, truth_iffFormula] + rfl + +def leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n) : BoundedFormula n := + .conj (intervalNextCandidateFormula N A D rA rD e lo hi p y) + (exMem omega (.conj (pairMembershipFormula y.succ 0 c.succ) + (.allMem D.succ (imp + (intervalNextCandidateFormula N.succ.succ A.succ.succ D.succ.succ rA.succ.succ + rD.succ.succ e.succ.succ lo.succ.succ hi.succ.succ p.succ.succ 0) + (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ))))))) + +theorem truth_leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n) + (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) : + Truth (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega) env ↔ + leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) + (env lo) (env hi) (env p) (env c) (env y) := by + simp only [leastIntervalNextCandidateFormula, Truth, truth_exMem, truth_imp, + truth_pairMembershipFormula, truth_intervalNextCandidateFormula] + change (intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) + (env lo) (env hi) (env p) (env y) ∧ + ∃ k ∈ env omega, ZFSet.pair (env y) k ∈ env c ∧ + ∀ z ∈ env D, intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) + (env lo) (env hi) (env p) z → ∀ m ∈ k, ZFSet.pair z m ∉ env c) ↔ _ + rw [hOmega] + rfl + +theorem realize_leastIntervalNextCandidateFormula (M : TransitiveGround.{u}) {n} + (N A D rA rD e lo hi p c y omega : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (hOmega : env omega = ZFSet.omega) : + Realize M.sets (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega).toFormula env ↔ + leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e) + (env lo) (env hi) (env p) (env c) (env y) := + (realize_toFormula M _ env members).trans + (truth_leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega env hOmega) + +end BoundedFormula + +namespace SetFormula + +def intervalSequenceStepFormula : SetFormula 12 := + (BoundedFormula.leastIntervalNextCandidateFormula 0 3 4 5 6 7 8 9 1 10 2 11).toFormula + +end SetFormula + +namespace TransitiveGround + +open SetFormula + +theorem realize_intervalSequenceStepFormula (M : TransitiveGround.{u}) + (env : Fin 12 → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (hOmega : env 11 = ZFSet.omega) : + Realize M.sets intervalSequenceStepFormula env ↔ + leastIntervalNextCandidate (env 0) (env 3) (env 4) (env 5) (env 6) (env 7) + (env 8) (env 9) (env 1) (env 10) (env 2) := + BoundedFormula.realize_leastIntervalNextCandidateFormula M 0 3 4 5 6 7 8 9 1 10 2 11 + env members hOmega + +theorem exists_unique_ground_intervalNext (M : TransitiveGround.{u}) + {N A D rA rD e lo hi p c : ZFSet.{u}} (hD : D ∈ M.sets) + (injection : InjectionCode D ZFSet.omega c) + (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) : + ∃! y, y ∈ M.sets ∧ leastIntervalNextCandidate N A D rA rD e lo hi p c y := by + obtain ⟨y, selected, unique⟩ := leastIntervalNextCandidate_exists_unique injection candidate + exact ⟨y, ⟨M.transitive hD selected.1.1, selected⟩, fun z hz => unique z hz.2⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LeastSlotOwnerCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LeastSlotOwnerCodes.lean index 1ce08a5726aeaca63f3e90b931366d220b57d3c1..faf29ff6191d0b655f55485fcc775f8c5af70456 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LeastSlotOwnerCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LeastSlotOwnerCodes.lean @@ -1,248 +1,248 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.TileStarIncomingCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -def LeastSupportCode (V omega depths supports x v : ZFSet.{u}) : Prop := - ZFSet.pair v x ∈ supports ∧ ∃ n ∈ omega, ZFSet.pair v n ∈ depths ∧ - ∀ w ∈ V, ∀ m ∈ omega, ZFSet.pair w x ∈ supports → ZFSet.pair w m ∈ depths → m ∉ n - -noncomputable def leastSupportGraph (V Q depths supports : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ Q, ∃ v ∈ V, z = ZFSet.pair x v ∧ - LeastSupportCode V ZFSet.omega depths supports x v) (ZFSet.prod Q V) - -theorem pair_mem_leastSupportGraph (V Q depths supports x v : ZFSet.{u}) : - ZFSet.pair x v ∈ leastSupportGraph V Q depths supports ↔ - x ∈ Q ∧ v ∈ V ∧ LeastSupportCode V ZFSet.omega depths supports x v := by - rw [leastSupportGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, x', hx, v', hv, equal, body⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, hv, body⟩ - · rintro ⟨hx, hv, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hv⟩, x, hx, v, hv, rfl, body⟩ - -namespace BoundedFormula -def leastSupportFormula {k} (V omega depths supports x v : Fin k) : BoundedFormula k := - .conj (pairMembershipFormula v x supports) - (exMem omega (.conj (pairMembershipFormula v.succ 0 depths.succ) - (allMem V.succ (allMem omega.succ.succ - (.imp (pairMembershipFormula 1 x.succ.succ.succ supports.succ.succ.succ) - (.imp (pairMembershipFormula 1 0 depths.succ.succ.succ) (.neg (.mem 0 2)))))))) - -theorem truth_leastSupportFormula {k} (V omega depths supports x v : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (leastSupportFormula V omega depths supports x v) env ↔ - LeastSupportCode (env V) (env omega) (env depths) (env supports) (env x) (env v) := by - simp only [leastSupportFormula, Truth, truth_exMem, truth_imp, truth_pairMembershipFormula] - rfl - -def leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) : BoundedFormula k := - exMem Q (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (leastSupportFormula V.succ.succ omega.succ.succ depths.succ.succ supports.succ.succ 1 0))) - -theorem truth_leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (leastSupportEntryFormula z V Q omega depths supports) env ↔ - ∃ x ∈ env Q, ∃ v ∈ env V, env z = ZFSet.pair x v ∧ - LeastSupportCode (env V) (env omega) (env depths) (env supports) x v := by - simp only [leastSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_leastSupportFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -theorem leastSupportGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {V Q depths supports : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) - (hDepths : depths ∈ M.sets) (hSupports : supports ∈ M.sets) : - leastSupportGraph V Q depths supports ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - let params := extend V (extend Q (extend ZFSet.omega (extend depths (extend supports Fin.elim0)))) - have selected := M.bounded_separation_mem separation (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5) - params (Fin.cases hV (Fin.cases hQ (Fin.cases hOmega (Fin.cases hDepths - (Fin.cases hSupports (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hQ hV) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5) - (extend z params)) (ZFSet.prod Q V) = leastSupportGraph V Q depths supports := by - apply ZFSet.ext - intro z - rw [leastSupportGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_leastSupportEntryFormula _ _ _ _ _ _ _) - exact equal ▸ selected -end TransitiveGround - -variable {V X : Type u} (s : Presentation V) (q : Presentation X) (depth : V → Nat) -variable {depths supports : ZFSet.{u}} (supported : V → X → Prop) -variable (depthEntries : ∀ v n, ZFSet.pair (s.encode v) (natSetCode n) ∈ depths ↔ n = depth v) -variable (supportEntries : ∀ v x, ZFSet.pair (s.encode v) (q.encode x) ∈ supports ↔ supported v x) -include depthEntries supportEntries - -theorem leastSupportCode_iff (x : X) (v : V) : - LeastSupportCode s.carrier ZFSet.omega depths supports (q.encode x) (s.encode v) ↔ - supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by - constructor - · rintro ⟨support, n, hn, entry, least⟩ - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have equal := (depthEntries v n).1 entry - subst n - refine ⟨(supportEntries v x).1 support, ?_⟩ - intro w hw - have noLower := least (s.encode w) (s.encode_mem w) (natSetCode (depth w)) - (natSetCode_mem_omega _) ((supportEntries w x).2 hw) ((depthEntries w _).2 rfl) - exact Nat.le_of_not_lt (fun lower => noLower ((natSetCode_mem_iff _ _).2 lower)) - · rintro ⟨support, minimal⟩ - refine ⟨(supportEntries v x).2 support, natSetCode (depth v), natSetCode_mem_omega _, - (depthEntries v _).2 rfl, ?_⟩ - intro w hw m hm member entry lower - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - have equal := (depthEntries w m).1 entry - subst m - exact Nat.not_lt_of_ge (minimal w ((supportEntries w x).1 member)) ((natSetCode_mem_iff _ _).1 lower) - -theorem leastSupportGraph_entry (x : X) (v : V) : - ZFSet.pair (q.encode x) (s.encode v) ∈ leastSupportGraph s.carrier q.carrier depths supports ↔ - supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by - rw [pair_mem_leastSupportGraph, leastSupportCode_iff s q depth supported depthEntries supportEntries] - exact ⟨fun h => h.2.2, fun h => ⟨q.encode_mem x, s.encode_mem v, h⟩⟩ - -theorem leastSupportGraph_function - (unique : ∀ x, ∃! v, supported v x ∧ ∀ w, supported w x → depth v ≤ depth w) : - ZFSet.IsFunc q.carrier s.carrier (leastSupportGraph s.carrier q.carrier depths supports) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx - obtain ⟨v, good, only⟩ := unique x - refine ⟨s.encode v, (leastSupportGraph_entry s q depth supported depthEntries supportEntries x v).2 good, ?_⟩ - intro w hw - have member := (pair_mem_leastSupportGraph _ _ _ _ _ _).1 hw - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 member.2.1 - exact congrArg s.encode (only w ((leastSupportGraph_entry s q depth supported depthEntries supportEntries x w).1 hw)) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def LeastSlotCode (supports v x j : ZFSet.{u}) : Prop := - ZFSet.pair (ZFSet.pair v j) x ∈ supports ∧ - ∀ k ∈ j, ZFSet.pair (ZFSet.pair v k) x ∉ supports - -theorem LeastSlotCode.le {supports v x j k : ZFSet.{u}} - (code : LeastSlotCode supports v x j) (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3) - (supported : ZFSet.pair (ZFSet.pair v k) x ∈ supports) : j = k ∨ j ∈ k := by - obtain ⟨n, _, rfl⟩ := (mem_natSetCode j 3).1 hj - obtain ⟨m, _, rfl⟩ := (mem_natSetCode k 3).1 hk - rcases Nat.lt_trichotomy n m with less | same | greater - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - · exact False.elim (code.2 _ ((natSetCode_mem_iff _ _).2 greater) supported) - -theorem LeastSlotCode.unique {supports v x j k : ZFSet.{u}} - (first : LeastSlotCode supports v x j) (second : LeastSlotCode supports v x k) - (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3) : j = k := by - rcases first.le hj hk second.1 with same | less - · exact same - · exact False.elim (second.2 _ less first.1) - -theorem exists_leastSlotCode {supports v x : ZFSet.{u}} - (cover : ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) : - ∃ j ∈ natSetCode 3, LeastSlotCode supports v x j := by - classical - have candidates : ∃ n : Nat, n < 3 ∧ ZFSet.pair (ZFSet.pair v (natSetCode n)) x ∈ supports := by - obtain ⟨j, hj, supported⟩ := cover - obtain ⟨n, hn, rfl⟩ := (mem_natSetCode j 3).1 hj - exact ⟨n, hn, supported⟩ - refine ⟨natSetCode (Nat.find candidates), (natSetCode_mem_iff _ _).2 (Nat.find_spec candidates).1, - (Nat.find_spec candidates).2, ?_⟩ - intro k hk supported - obtain ⟨k, lower, rfl⟩ := (mem_natSetCode k (Nat.find candidates)).1 hk - exact Nat.find_min candidates lower ⟨Nat.lt_trans lower (Nat.find_spec candidates).1, supported⟩ - -noncomputable def leastSlotOwnerGraph (P B V owner supports : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ B, ∃ j ∈ natSetCode 3, ∃ v ∈ V, - z = ZFSet.pair x j ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j) - (ZFSet.prod B (natSetCode 3)) - -theorem pair_mem_leastSlotOwnerGraph (P B V owner supports x j : ZFSet.{u}) : - ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔ - x ∈ B ∧ j ∈ natSetCode 3 ∧ x ∉ P ∧ ∃ v ∈ V, - ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j := by - rw [leastSlotOwnerGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, x', hx, j', hj, v, hv, equal, fresh, owned, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, hj, fresh, v, hv, owned, code⟩ - · rintro ⟨hx, hj, fresh, v, hv, owned, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hj⟩, x, hx, j, hj, v, hv, rfl, fresh, owned, code⟩ - -theorem pair_mem_leastSlotOwnerGraph_of_owner {P B V owner supports x j v : ZFSet.{u}} - (function : ZFSet.IsFunc B V owner) (owned : ZFSet.pair x v ∈ owner) : - ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔ - j ∈ natSetCode 3 ∧ x ∉ P ∧ LeastSlotCode supports v x j := by - have shape := ZFSet.pair_mem_prod.1 (function.1 owned) - rw [pair_mem_leastSlotOwnerGraph] - constructor - · rintro ⟨_, hj, fresh, v', _, owned', code⟩ - have equal := (show FunctionGraphOn B owner from ⟨V, function⟩).unique owned' owned - exact ⟨hj, fresh, equal ▸ code⟩ - · rintro ⟨hj, fresh, code⟩ - exact ⟨shape.1, hj, fresh, v, shape.2, owned, code⟩ - -theorem leastSlotOwnerGraph_partial {P B V owner supports : ZFSet.{u}} - (function : ZFSet.IsFunc B V owner) : - PartialFunctionCode B (natSetCode 3) (leastSlotOwnerGraph P B V owner supports) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x j k first second - obtain ⟨_, hj, _, v, _, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first - have other := (pair_mem_leastSlotOwnerGraph_of_owner function owned).1 second - exact code.unique other.2.2 hj other.1 - -theorem leastSlotOwnerGraph_function {P B V owner supports : ZFSet.{u}} - (function : ZFSet.IsFunc B V owner) - (cover : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner → - ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) : - ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) (natSetCode 3) - (leastSlotOwnerGraph P B V owner supports) := by - refine ⟨?_, ?_⟩ - · intro z hz - have shape := (ZFSet.mem_sep.1 hz).1 - obtain ⟨x, hx, j, hj, rfl⟩ := ZFSet.mem_prod.1 shape - have fresh := ((pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 hz).2.2.1 - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_sep.2 ⟨hx, fresh⟩, hj⟩ - · intro x hx - obtain ⟨hx, fresh⟩ := ZFSet.mem_sep.1 hx - obtain ⟨v, owned, _⟩ := function.2 x hx - obtain ⟨j, hj, code⟩ := exists_leastSlotCode (cover x hx fresh v owned) - refine ⟨j, (pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩, ?_⟩ - intro k other - exact (leastSlotOwnerGraph_partial function).unique x k j other - ((pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩) - -theorem leastSlotOwnerGraph_monotone {P B V owner supports order x y j k : ZFSet.{u}} - (first : ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports) - (second : ZFSet.pair y k ∈ leastSlotOwnerGraph P B V owner supports) - (sameOwner : ∀ v w, ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → v = w) - (ideals : ∀ v ∈ V, ∀ t ∈ natSetCode 3, ∀ a ∈ B, ∀ b ∈ B, - ZFSet.pair a b ∈ order → ZFSet.pair (ZFSet.pair v t) b ∈ supports → - ZFSet.pair (ZFSet.pair v t) a ∈ supports) - (lower : ZFSet.pair x y ∈ order) : j = k ∨ j ∈ k := by - obtain ⟨hx, hj, _, v, hv, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first - obtain ⟨hy, hk, _, w, _, owned', code'⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 second - have equal := sameOwner v w owned owned' - subst w - exact code.le hj hk (ideals v hv k hk x hx y hy lower code'.1) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.TileStarIncomingCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +def LeastSupportCode (V omega depths supports x v : ZFSet.{u}) : Prop := + ZFSet.pair v x ∈ supports ∧ ∃ n ∈ omega, ZFSet.pair v n ∈ depths ∧ + ∀ w ∈ V, ∀ m ∈ omega, ZFSet.pair w x ∈ supports → ZFSet.pair w m ∈ depths → m ∉ n + +noncomputable def leastSupportGraph (V Q depths supports : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ Q, ∃ v ∈ V, z = ZFSet.pair x v ∧ + LeastSupportCode V ZFSet.omega depths supports x v) (ZFSet.prod Q V) + +theorem pair_mem_leastSupportGraph (V Q depths supports x v : ZFSet.{u}) : + ZFSet.pair x v ∈ leastSupportGraph V Q depths supports ↔ + x ∈ Q ∧ v ∈ V ∧ LeastSupportCode V ZFSet.omega depths supports x v := by + rw [leastSupportGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, x', hx, v', hv, equal, body⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, hv, body⟩ + · rintro ⟨hx, hv, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hv⟩, x, hx, v, hv, rfl, body⟩ + +namespace BoundedFormula +def leastSupportFormula {k} (V omega depths supports x v : Fin k) : BoundedFormula k := + .conj (pairMembershipFormula v x supports) + (exMem omega (.conj (pairMembershipFormula v.succ 0 depths.succ) + (allMem V.succ (allMem omega.succ.succ + (.imp (pairMembershipFormula 1 x.succ.succ.succ supports.succ.succ.succ) + (.imp (pairMembershipFormula 1 0 depths.succ.succ.succ) (.neg (.mem 0 2)))))))) + +theorem truth_leastSupportFormula {k} (V omega depths supports x v : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (leastSupportFormula V omega depths supports x v) env ↔ + LeastSupportCode (env V) (env omega) (env depths) (env supports) (env x) (env v) := by + simp only [leastSupportFormula, Truth, truth_exMem, truth_imp, truth_pairMembershipFormula] + rfl + +def leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) : BoundedFormula k := + exMem Q (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (leastSupportFormula V.succ.succ omega.succ.succ depths.succ.succ supports.succ.succ 1 0))) + +theorem truth_leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (leastSupportEntryFormula z V Q omega depths supports) env ↔ + ∃ x ∈ env Q, ∃ v ∈ env V, env z = ZFSet.pair x v ∧ + LeastSupportCode (env V) (env omega) (env depths) (env supports) x v := by + simp only [leastSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_leastSupportFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +theorem leastSupportGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {V Q depths supports : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) + (hDepths : depths ∈ M.sets) (hSupports : supports ∈ M.sets) : + leastSupportGraph V Q depths supports ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + let params := extend V (extend Q (extend ZFSet.omega (extend depths (extend supports Fin.elim0)))) + have selected := M.bounded_separation_mem separation (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5) + params (Fin.cases hV (Fin.cases hQ (Fin.cases hOmega (Fin.cases hDepths + (Fin.cases hSupports (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hQ hV) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5) + (extend z params)) (ZFSet.prod Q V) = leastSupportGraph V Q depths supports := by + apply ZFSet.ext + intro z + rw [leastSupportGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_leastSupportEntryFormula _ _ _ _ _ _ _) + exact equal ▸ selected +end TransitiveGround + +variable {V X : Type u} (s : Presentation V) (q : Presentation X) (depth : V → Nat) +variable {depths supports : ZFSet.{u}} (supported : V → X → Prop) +variable (depthEntries : ∀ v n, ZFSet.pair (s.encode v) (natSetCode n) ∈ depths ↔ n = depth v) +variable (supportEntries : ∀ v x, ZFSet.pair (s.encode v) (q.encode x) ∈ supports ↔ supported v x) +include depthEntries supportEntries + +theorem leastSupportCode_iff (x : X) (v : V) : + LeastSupportCode s.carrier ZFSet.omega depths supports (q.encode x) (s.encode v) ↔ + supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by + constructor + · rintro ⟨support, n, hn, entry, least⟩ + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have equal := (depthEntries v n).1 entry + subst n + refine ⟨(supportEntries v x).1 support, ?_⟩ + intro w hw + have noLower := least (s.encode w) (s.encode_mem w) (natSetCode (depth w)) + (natSetCode_mem_omega _) ((supportEntries w x).2 hw) ((depthEntries w _).2 rfl) + exact Nat.le_of_not_lt (fun lower => noLower ((natSetCode_mem_iff _ _).2 lower)) + · rintro ⟨support, minimal⟩ + refine ⟨(supportEntries v x).2 support, natSetCode (depth v), natSetCode_mem_omega _, + (depthEntries v _).2 rfl, ?_⟩ + intro w hw m hm member entry lower + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + have equal := (depthEntries w m).1 entry + subst m + exact Nat.not_lt_of_ge (minimal w ((supportEntries w x).1 member)) ((natSetCode_mem_iff _ _).1 lower) + +theorem leastSupportGraph_entry (x : X) (v : V) : + ZFSet.pair (q.encode x) (s.encode v) ∈ leastSupportGraph s.carrier q.carrier depths supports ↔ + supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by + rw [pair_mem_leastSupportGraph, leastSupportCode_iff s q depth supported depthEntries supportEntries] + exact ⟨fun h => h.2.2, fun h => ⟨q.encode_mem x, s.encode_mem v, h⟩⟩ + +theorem leastSupportGraph_function + (unique : ∀ x, ∃! v, supported v x ∧ ∀ w, supported w x → depth v ≤ depth w) : + ZFSet.IsFunc q.carrier s.carrier (leastSupportGraph s.carrier q.carrier depths supports) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx + obtain ⟨v, good, only⟩ := unique x + refine ⟨s.encode v, (leastSupportGraph_entry s q depth supported depthEntries supportEntries x v).2 good, ?_⟩ + intro w hw + have member := (pair_mem_leastSupportGraph _ _ _ _ _ _).1 hw + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 member.2.1 + exact congrArg s.encode (only w ((leastSupportGraph_entry s q depth supported depthEntries supportEntries x w).1 hw)) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def LeastSlotCode (supports v x j : ZFSet.{u}) : Prop := + ZFSet.pair (ZFSet.pair v j) x ∈ supports ∧ + ∀ k ∈ j, ZFSet.pair (ZFSet.pair v k) x ∉ supports + +theorem LeastSlotCode.le {supports v x j k : ZFSet.{u}} + (code : LeastSlotCode supports v x j) (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3) + (supported : ZFSet.pair (ZFSet.pair v k) x ∈ supports) : j = k ∨ j ∈ k := by + obtain ⟨n, _, rfl⟩ := (mem_natSetCode j 3).1 hj + obtain ⟨m, _, rfl⟩ := (mem_natSetCode k 3).1 hk + rcases Nat.lt_trichotomy n m with less | same | greater + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + · exact False.elim (code.2 _ ((natSetCode_mem_iff _ _).2 greater) supported) + +theorem LeastSlotCode.unique {supports v x j k : ZFSet.{u}} + (first : LeastSlotCode supports v x j) (second : LeastSlotCode supports v x k) + (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3) : j = k := by + rcases first.le hj hk second.1 with same | less + · exact same + · exact False.elim (second.2 _ less first.1) + +theorem exists_leastSlotCode {supports v x : ZFSet.{u}} + (cover : ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) : + ∃ j ∈ natSetCode 3, LeastSlotCode supports v x j := by + classical + have candidates : ∃ n : Nat, n < 3 ∧ ZFSet.pair (ZFSet.pair v (natSetCode n)) x ∈ supports := by + obtain ⟨j, hj, supported⟩ := cover + obtain ⟨n, hn, rfl⟩ := (mem_natSetCode j 3).1 hj + exact ⟨n, hn, supported⟩ + refine ⟨natSetCode (Nat.find candidates), (natSetCode_mem_iff _ _).2 (Nat.find_spec candidates).1, + (Nat.find_spec candidates).2, ?_⟩ + intro k hk supported + obtain ⟨k, lower, rfl⟩ := (mem_natSetCode k (Nat.find candidates)).1 hk + exact Nat.find_min candidates lower ⟨Nat.lt_trans lower (Nat.find_spec candidates).1, supported⟩ + +noncomputable def leastSlotOwnerGraph (P B V owner supports : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ B, ∃ j ∈ natSetCode 3, ∃ v ∈ V, + z = ZFSet.pair x j ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j) + (ZFSet.prod B (natSetCode 3)) + +theorem pair_mem_leastSlotOwnerGraph (P B V owner supports x j : ZFSet.{u}) : + ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔ + x ∈ B ∧ j ∈ natSetCode 3 ∧ x ∉ P ∧ ∃ v ∈ V, + ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j := by + rw [leastSlotOwnerGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, x', hx, j', hj, v, hv, equal, fresh, owned, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, hj, fresh, v, hv, owned, code⟩ + · rintro ⟨hx, hj, fresh, v, hv, owned, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hj⟩, x, hx, j, hj, v, hv, rfl, fresh, owned, code⟩ + +theorem pair_mem_leastSlotOwnerGraph_of_owner {P B V owner supports x j v : ZFSet.{u}} + (function : ZFSet.IsFunc B V owner) (owned : ZFSet.pair x v ∈ owner) : + ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔ + j ∈ natSetCode 3 ∧ x ∉ P ∧ LeastSlotCode supports v x j := by + have shape := ZFSet.pair_mem_prod.1 (function.1 owned) + rw [pair_mem_leastSlotOwnerGraph] + constructor + · rintro ⟨_, hj, fresh, v', _, owned', code⟩ + have equal := (show FunctionGraphOn B owner from ⟨V, function⟩).unique owned' owned + exact ⟨hj, fresh, equal ▸ code⟩ + · rintro ⟨hj, fresh, code⟩ + exact ⟨shape.1, hj, fresh, v, shape.2, owned, code⟩ + +theorem leastSlotOwnerGraph_partial {P B V owner supports : ZFSet.{u}} + (function : ZFSet.IsFunc B V owner) : + PartialFunctionCode B (natSetCode 3) (leastSlotOwnerGraph P B V owner supports) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x j k first second + obtain ⟨_, hj, _, v, _, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first + have other := (pair_mem_leastSlotOwnerGraph_of_owner function owned).1 second + exact code.unique other.2.2 hj other.1 + +theorem leastSlotOwnerGraph_function {P B V owner supports : ZFSet.{u}} + (function : ZFSet.IsFunc B V owner) + (cover : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner → + ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) : + ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) (natSetCode 3) + (leastSlotOwnerGraph P B V owner supports) := by + refine ⟨?_, ?_⟩ + · intro z hz + have shape := (ZFSet.mem_sep.1 hz).1 + obtain ⟨x, hx, j, hj, rfl⟩ := ZFSet.mem_prod.1 shape + have fresh := ((pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 hz).2.2.1 + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_sep.2 ⟨hx, fresh⟩, hj⟩ + · intro x hx + obtain ⟨hx, fresh⟩ := ZFSet.mem_sep.1 hx + obtain ⟨v, owned, _⟩ := function.2 x hx + obtain ⟨j, hj, code⟩ := exists_leastSlotCode (cover x hx fresh v owned) + refine ⟨j, (pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩, ?_⟩ + intro k other + exact (leastSlotOwnerGraph_partial function).unique x k j other + ((pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩) + +theorem leastSlotOwnerGraph_monotone {P B V owner supports order x y j k : ZFSet.{u}} + (first : ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports) + (second : ZFSet.pair y k ∈ leastSlotOwnerGraph P B V owner supports) + (sameOwner : ∀ v w, ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → v = w) + (ideals : ∀ v ∈ V, ∀ t ∈ natSetCode 3, ∀ a ∈ B, ∀ b ∈ B, + ZFSet.pair a b ∈ order → ZFSet.pair (ZFSet.pair v t) b ∈ supports → + ZFSet.pair (ZFSet.pair v t) a ∈ supports) + (lower : ZFSet.pair x y ∈ order) : j = k ∨ j ∈ k := by + obtain ⟨hx, hj, _, v, hv, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first + obtain ⟨hy, hk, _, w, _, owned', code'⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 second + have equal := sameOwner v w owned owned' + subst w + exact code.le hj hk (ideals v hv k hk x hx y hy lower code'.1) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LiftedCompressionFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LiftedCompressionFormulas.lean index e50e0d98ce5c2864a7a0358302864c977e3b39ca..70371946f51cac7952f6962663b9db84a4e33835 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LiftedCompressionFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LiftedCompressionFormulas.lean @@ -1,118 +1,118 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionFunctions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def rightTripleFormula {n} (z a b c : Fin n) : BoundedFormula n := - exMem z (exMem 0 (.conj (orderedPairFormula 0 b.succ.succ c.succ.succ) - (orderedPairFormula z.succ.succ a.succ.succ 0))) - -theorem truth_rightTripleFormula {n} (z a b c : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (rightTripleFormula z a b c) env ↔ - env z = ZFSet.pair (env a) (ZFSet.pair (env b) (env c)) := by - simp only [rightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] - change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (env b) (env c) ∧ - env z = ZFSet.pair (env a) t) ↔ _ - constructor - · rintro ⟨_, _, _, _, rfl, equal⟩ - exact equal - · intro equal - refine ⟨{env a, ZFSet.pair (env b) (env c)}, ?_, ZFSet.pair (env b) (env c), - ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ - rw [equal] - exact ZFSet.mem_pair.2 (Or.inr rfl) - -def taggedPairTripleFormula {n} (z l i j q : Fin n) : BoundedFormula n := - exMem z (exMem 0 (.conj (orderedTripleFormula 0 i.succ.succ j.succ.succ q.succ.succ) - (orderedPairFormula z.succ.succ l.succ.succ 0))) - -theorem truth_taggedPairTripleFormula {n} (z l i j q : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (taggedPairTripleFormula z l i j q) env ↔ - env z = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)) := by - simp only [taggedPairTripleFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_orderedPairFormula] - change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (ZFSet.pair (env i) (env j)) (env q) ∧ - env z = ZFSet.pair (env l) t) ↔ _ - constructor - · rintro ⟨_, _, _, _, rfl, equal⟩ - exact equal - · intro equal - refine ⟨{env l, ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)}, ?_, - ZFSet.pair (ZFSet.pair (env i) (env j)) (env q), - ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ - rw [equal] - exact ZFSet.mem_pair.2 (Or.inr rfl) - -def liftOldEntryFormula {n} (d maps bound i x y : Fin n) : BoundedFormula n := - .conj (.mem x d) (exMem bound (.conj (pairMembershipFormula i.succ 0 maps.succ) - (pairMembershipFormula x.succ y.succ 0))) - -theorem truth_liftOldEntryFormula {n} (d maps bound i x y : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (liftOldEntryFormula d maps bound i x y) env ↔ - env x ∈ env d ∧ ∃ S ∈ env bound, - ZFSet.pair (env i) S ∈ env maps ∧ ZFSet.pair (env x) (env y) ∈ S := by - simp only [liftOldEntryFormula, Truth, truth_exMem, truth_pairMembershipFormula] - rfl - -def liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n) : BoundedFormula n := - let up (t : Fin n) := t.succ.succ.succ.succ - exMem j (exMem b.succ (exMem d.succ.succ (exMem bound.succ.succ.succ - (.conj (rightTripleFormula (up x) (up d) 3 2) - (.conj (pairMembershipFormula 3 2 (up ns)) - (.conj (pairMembershipFormula (up i) 1 (up sources)) - (.conj (pairMembershipFormula 3 0 (up fs)) - (disj (.conj (.mem 1 0) (exMem (up g) - (.conj (pairMembershipFormula (up i).succ 0 (up reps).succ) - (tripleMembershipFormula 0 (up x).succ (up y).succ (up action).succ)))) - (.conj (.neg (.mem 1 0)) (taggedPairTripleFormula (up y) (up l) (up i) 3 2)))))))))) - -theorem truth_liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (liftFreshEntryFormula d l j b ns sources fs bound reps g action i x y) env ↔ - ∃ h ∈ env j, ∃ q ∈ env b, ∃ a ∈ env d, ∃ F ∈ env bound, - env x = ZFSet.pair (env d) (ZFSet.pair h q) ∧ ZFSet.pair h q ∈ env ns ∧ - ZFSet.pair (env i) a ∈ env sources ∧ ZFSet.pair h F ∈ env fs ∧ - ((a ∈ F ∧ ∃ actor ∈ env g, ZFSet.pair (env i) actor ∈ env reps ∧ - ZFSet.pair (ZFSet.pair actor (env x)) (env y) ∈ env action) ∨ - (a ∉ F ∧ env y = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) h) q))) := by - simp only [liftFreshEntryFormula, truth_exMem, Truth, truth_disj, - truth_rightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula, - truth_taggedPairTripleFormula] - rfl - -def liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n) : - BoundedFormula n := - let up (t : Fin n) := t.succ.succ.succ - exMem i (exMem l.succ (exMem c.succ.succ - (.conj (orderedTripleFormula (up z) 2 1 0) - (disj (liftOldEntryFormula (up d) (up maps) (up v) 2 1 0) - (liftFreshEntryFormula (up d) (up l) (up j) (up b) (up ns) - (up sources) (up fs) (up w) (up reps) (up g) (up action) 2 1 0))))) - -theorem truth_liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n) - (env : Fin n → ZFSet.{u}) (mapsBound : env v = ZFSet.sUnion (ZFSet.sUnion (env maps))) - (filterBound : env w = ZFSet.sUnion (ZFSet.sUnion (env fs))) : - Truth (liftedCompressionEntryFormula z i j d l c ns b maps sources fs reps g action v w) env ↔ - ∃ task ∈ env i, ∃ x ∈ env l, ∃ y ∈ env c, - env z = ZFSet.pair (ZFSet.pair task x) y ∧ - (liftOldEntry (env d) (env maps) task x y ∨ - liftFreshEntry (env d) (env l) (env j) (env b) (env ns) - (env sources) (env fs) (env reps) (env g) (env action) task x y) := by - simp only [liftedCompressionEntryFormula, truth_exMem, Truth, truth_disj, - truth_orderedTripleFormula, truth_liftOldEntryFormula, truth_liftFreshEntryFormula] - simp only [liftOldEntry, liftFreshEntry, extend, Fin.cases_succ, Fin.cases_zero, - mapsBound, filterBound] - rfl - -end PartitionPilot.Forcing.BoundedFormula - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionFunctions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def rightTripleFormula {n} (z a b c : Fin n) : BoundedFormula n := + exMem z (exMem 0 (.conj (orderedPairFormula 0 b.succ.succ c.succ.succ) + (orderedPairFormula z.succ.succ a.succ.succ 0))) + +theorem truth_rightTripleFormula {n} (z a b c : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (rightTripleFormula z a b c) env ↔ + env z = ZFSet.pair (env a) (ZFSet.pair (env b) (env c)) := by + simp only [rightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] + change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (env b) (env c) ∧ + env z = ZFSet.pair (env a) t) ↔ _ + constructor + · rintro ⟨_, _, _, _, rfl, equal⟩ + exact equal + · intro equal + refine ⟨{env a, ZFSet.pair (env b) (env c)}, ?_, ZFSet.pair (env b) (env c), + ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ + rw [equal] + exact ZFSet.mem_pair.2 (Or.inr rfl) + +def taggedPairTripleFormula {n} (z l i j q : Fin n) : BoundedFormula n := + exMem z (exMem 0 (.conj (orderedTripleFormula 0 i.succ.succ j.succ.succ q.succ.succ) + (orderedPairFormula z.succ.succ l.succ.succ 0))) + +theorem truth_taggedPairTripleFormula {n} (z l i j q : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (taggedPairTripleFormula z l i j q) env ↔ + env z = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)) := by + simp only [taggedPairTripleFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_orderedPairFormula] + change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (ZFSet.pair (env i) (env j)) (env q) ∧ + env z = ZFSet.pair (env l) t) ↔ _ + constructor + · rintro ⟨_, _, _, _, rfl, equal⟩ + exact equal + · intro equal + refine ⟨{env l, ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)}, ?_, + ZFSet.pair (ZFSet.pair (env i) (env j)) (env q), + ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ + rw [equal] + exact ZFSet.mem_pair.2 (Or.inr rfl) + +def liftOldEntryFormula {n} (d maps bound i x y : Fin n) : BoundedFormula n := + .conj (.mem x d) (exMem bound (.conj (pairMembershipFormula i.succ 0 maps.succ) + (pairMembershipFormula x.succ y.succ 0))) + +theorem truth_liftOldEntryFormula {n} (d maps bound i x y : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (liftOldEntryFormula d maps bound i x y) env ↔ + env x ∈ env d ∧ ∃ S ∈ env bound, + ZFSet.pair (env i) S ∈ env maps ∧ ZFSet.pair (env x) (env y) ∈ S := by + simp only [liftOldEntryFormula, Truth, truth_exMem, truth_pairMembershipFormula] + rfl + +def liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n) : BoundedFormula n := + let up (t : Fin n) := t.succ.succ.succ.succ + exMem j (exMem b.succ (exMem d.succ.succ (exMem bound.succ.succ.succ + (.conj (rightTripleFormula (up x) (up d) 3 2) + (.conj (pairMembershipFormula 3 2 (up ns)) + (.conj (pairMembershipFormula (up i) 1 (up sources)) + (.conj (pairMembershipFormula 3 0 (up fs)) + (disj (.conj (.mem 1 0) (exMem (up g) + (.conj (pairMembershipFormula (up i).succ 0 (up reps).succ) + (tripleMembershipFormula 0 (up x).succ (up y).succ (up action).succ)))) + (.conj (.neg (.mem 1 0)) (taggedPairTripleFormula (up y) (up l) (up i) 3 2)))))))))) + +theorem truth_liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (liftFreshEntryFormula d l j b ns sources fs bound reps g action i x y) env ↔ + ∃ h ∈ env j, ∃ q ∈ env b, ∃ a ∈ env d, ∃ F ∈ env bound, + env x = ZFSet.pair (env d) (ZFSet.pair h q) ∧ ZFSet.pair h q ∈ env ns ∧ + ZFSet.pair (env i) a ∈ env sources ∧ ZFSet.pair h F ∈ env fs ∧ + ((a ∈ F ∧ ∃ actor ∈ env g, ZFSet.pair (env i) actor ∈ env reps ∧ + ZFSet.pair (ZFSet.pair actor (env x)) (env y) ∈ env action) ∨ + (a ∉ F ∧ env y = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) h) q))) := by + simp only [liftFreshEntryFormula, truth_exMem, Truth, truth_disj, + truth_rightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula, + truth_taggedPairTripleFormula] + rfl + +def liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n) : + BoundedFormula n := + let up (t : Fin n) := t.succ.succ.succ + exMem i (exMem l.succ (exMem c.succ.succ + (.conj (orderedTripleFormula (up z) 2 1 0) + (disj (liftOldEntryFormula (up d) (up maps) (up v) 2 1 0) + (liftFreshEntryFormula (up d) (up l) (up j) (up b) (up ns) + (up sources) (up fs) (up w) (up reps) (up g) (up action) 2 1 0))))) + +theorem truth_liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n) + (env : Fin n → ZFSet.{u}) (mapsBound : env v = ZFSet.sUnion (ZFSet.sUnion (env maps))) + (filterBound : env w = ZFSet.sUnion (ZFSet.sUnion (env fs))) : + Truth (liftedCompressionEntryFormula z i j d l c ns b maps sources fs reps g action v w) env ↔ + ∃ task ∈ env i, ∃ x ∈ env l, ∃ y ∈ env c, + env z = ZFSet.pair (ZFSet.pair task x) y ∧ + (liftOldEntry (env d) (env maps) task x y ∨ + liftFreshEntry (env d) (env l) (env j) (env b) (env ns) + (env sources) (env fs) (env reps) (env g) (env action) task x y) := by + simp only [liftedCompressionEntryFormula, truth_exMem, Truth, truth_disj, + truth_orderedTripleFormula, truth_liftOldEntryFormula, truth_liftFreshEntryFormula] + simp only [liftOldEntry, liftFreshEntry, extend, Fin.cases_succ, Fin.cases_zero, + mapsBound, filterBound] + rfl + +end PartitionPilot.Forcing.BoundedFormula + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainInvariantCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainInvariantCodes.lean index 9b76f7cd09dfe22ba8622a16151e38249ec8e75c..50de20b6b037a85092d2dd554b607bfb97a02483 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainInvariantCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainInvariantCodes.lean @@ -1,68 +1,68 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageInvariant - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def LinkedMainInvariantCode (M : TransitiveGround.{u}) - (K Labels C D P G cutoff serial : ZFSet.{u}) : Prop := - GroundBelow M P K ∧ GroundBelow M G K ∧ GroundBelow M Labels K ∧ - ZFSet.rank P < ZFSet.rank K ∧ ZFSet.rank G < ZFSet.rank K ∧ - ZFSet.rank Labels < ZFSet.rank K ∧ cutoff ∈ K ∧ - ZFSet.rank C < ZFSet.rank K ∧ ZFSet.rank D < ZFSet.rank K ∧ - ZFSet.rank serial < ZFSet.rank K - -namespace SetFormula - -def linkedMainInvariantFormula {n} (K Labels C D P G cutoff serial : Fin n) : SetFormula n := - .conj (groundBelowFormula P K) (.conj (groundBelowFormula G K) - (.conj (groundBelowFormula Labels K) (.conj (cumulativeRankLtFormula P K) - (.conj (cumulativeRankLtFormula G K) (.conj (cumulativeRankLtFormula Labels K) - (.conj (.mem cutoff K) (.conj (cumulativeRankLtFormula C K) - (.conj (cumulativeRankLtFormula D K) (cumulativeRankLtFormula serial K))))))))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_linkedMainInvariantFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} - (K Labels C D P G cutoff serial : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedMainInvariantFormula K Labels C D P G cutoff serial) env ↔ - LinkedMainInvariantCode M (env K) (env Labels) (env C) (env D) - (env P) (env G) (env cutoff) (env serial) := by - change (Realize M.sets (groundBelowFormula P K) env ∧ - Realize M.sets (groundBelowFormula G K) env ∧ - Realize M.sets (groundBelowFormula Labels K) env ∧ - Realize M.sets (cumulativeRankLtFormula P K) env ∧ - Realize M.sets (cumulativeRankLtFormula G K) env ∧ - Realize M.sets (cumulativeRankLtFormula Labels K) env ∧ env cutoff ∈ env K ∧ - Realize M.sets (cumulativeRankLtFormula C K) env ∧ - Realize M.sets (cumulativeRankLtFormula D K) env ∧ - Realize M.sets (cumulativeRankLtFormula serial K) env) ↔ _ - rw [M.realize_groundBelowFormula P K env members, - M.realize_groundBelowFormula G K env members, - M.realize_groundBelowFormula Labels K env members, - M.realize_cumulativeRankLtFormula pairing unions powers separation collection P K env members ordinal, - M.realize_cumulativeRankLtFormula pairing unions powers separation collection G K env members ordinal, - M.realize_cumulativeRankLtFormula pairing unions powers separation collection Labels K env members ordinal, - M.realize_cumulativeRankLtFormula pairing unions powers separation collection C K env members ordinal, - M.realize_cumulativeRankLtFormula pairing unions powers separation collection D K env members ordinal, - M.realize_cumulativeRankLtFormula pairing unions powers separation collection serial K env members ordinal] - rfl - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageInvariant + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def LinkedMainInvariantCode (M : TransitiveGround.{u}) + (K Labels C D P G cutoff serial : ZFSet.{u}) : Prop := + GroundBelow M P K ∧ GroundBelow M G K ∧ GroundBelow M Labels K ∧ + ZFSet.rank P < ZFSet.rank K ∧ ZFSet.rank G < ZFSet.rank K ∧ + ZFSet.rank Labels < ZFSet.rank K ∧ cutoff ∈ K ∧ + ZFSet.rank C < ZFSet.rank K ∧ ZFSet.rank D < ZFSet.rank K ∧ + ZFSet.rank serial < ZFSet.rank K + +namespace SetFormula + +def linkedMainInvariantFormula {n} (K Labels C D P G cutoff serial : Fin n) : SetFormula n := + .conj (groundBelowFormula P K) (.conj (groundBelowFormula G K) + (.conj (groundBelowFormula Labels K) (.conj (cumulativeRankLtFormula P K) + (.conj (cumulativeRankLtFormula G K) (.conj (cumulativeRankLtFormula Labels K) + (.conj (.mem cutoff K) (.conj (cumulativeRankLtFormula C K) + (.conj (cumulativeRankLtFormula D K) (cumulativeRankLtFormula serial K))))))))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_linkedMainInvariantFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} + (K Labels C D P G cutoff serial : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedMainInvariantFormula K Labels C D P G cutoff serial) env ↔ + LinkedMainInvariantCode M (env K) (env Labels) (env C) (env D) + (env P) (env G) (env cutoff) (env serial) := by + change (Realize M.sets (groundBelowFormula P K) env ∧ + Realize M.sets (groundBelowFormula G K) env ∧ + Realize M.sets (groundBelowFormula Labels K) env ∧ + Realize M.sets (cumulativeRankLtFormula P K) env ∧ + Realize M.sets (cumulativeRankLtFormula G K) env ∧ + Realize M.sets (cumulativeRankLtFormula Labels K) env ∧ env cutoff ∈ env K ∧ + Realize M.sets (cumulativeRankLtFormula C K) env ∧ + Realize M.sets (cumulativeRankLtFormula D K) env ∧ + Realize M.sets (cumulativeRankLtFormula serial K) env) ↔ _ + rw [M.realize_groundBelowFormula P K env members, + M.realize_groundBelowFormula G K env members, + M.realize_groundBelowFormula Labels K env members, + M.realize_cumulativeRankLtFormula pairing unions powers separation collection P K env members ordinal, + M.realize_cumulativeRankLtFormula pairing unions powers separation collection G K env members ordinal, + M.realize_cumulativeRankLtFormula pairing unions powers separation collection Labels K env members ordinal, + M.realize_cumulativeRankLtFormula pairing unions powers separation collection C K env members ordinal, + M.realize_cumulativeRankLtFormula pairing unions powers separation collection D K env members ordinal, + M.realize_cumulativeRankLtFormula pairing unions powers separation collection serial K env members ordinal] + rfl + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainTransitionRawCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainTransitionRawCodes.lean index 954ecf1c43bd0f812f142b6adb3d56123ec24662..963f71ced6ee633bd80ee1c8b975d373b9550918 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainTransitionRawCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainTransitionRawCodes.lean @@ -1,177 +1,177 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageCodeLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def chronologicalMainTransitionFormula {n} - (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) - (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n := - .conj (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors) - (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth - sourceGraphs targetGraphs) - -theorem truth_chronologicalMainTransitionFormula {n} - (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) - (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) : - 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 ↔ - env z = ZFSet.pair (env points) (env actors) ∧ - 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) ∧ - ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) - (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) - (fun j => env (targetGraphs j)) := by - 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 ∧ - Truth (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth - sourceGraphs targetGraphs) env) ↔ _ - rw [truth_validMainTransitionCodeFormula] - constructor - · rintro ⟨⟨encoded, laws⟩, chronological⟩ - exact ⟨encoded, laws, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff - sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).1 chronological⟩ - · rintro ⟨encoded, laws, chronological⟩ - exact ⟨⟨encoded, laws⟩, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff - sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).2 chronological⟩ - -theorem realize_chronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n} - (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) - (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - 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 - sourceGraphs targetGraphs).toFormula env ↔ - env z = ZFSet.pair (env points) (env actors) ∧ - 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) ∧ - ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) - (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) - (fun j => env (targetGraphs j)) := - (realize_toFormula M _ env members).trans - (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) - -def coveredChronologicalMainTransitionFormula {n} - (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) - (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n := - .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) - (oldBirthFiberCoverageFormula P points targetBirth sourceCutoff) - -theorem truth_coveredChronologicalMainTransitionFormula {n} - (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) - (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) : - 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 ↔ - (env z = ZFSet.pair (env points) (env actors) ∧ - 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) ∧ - ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) - (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) - (fun j => env (targetGraphs j))) ∧ - OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) := by - simp only [coveredChronologicalMainTransitionFormula, Truth, - truth_chronologicalMainTransitionFormula, truth_oldBirthFiberCoverageFormula] - -theorem realize_coveredChronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n} - (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) - (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - 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 - sourceGraphs targetGraphs).toFormula env ↔ - (env z = ZFSet.pair (env points) (env actors) ∧ - 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) ∧ - ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) - (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) - (fun j => env (targetGraphs j))) ∧ - OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) := - (realize_toFormula M _ env members).trans - (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) - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def LinkedTransitionLawsCode (z points actors sourceBirth targetBirth : ZFSet.{u}) - (source target : Fin 24 → ZFSet.{u}) : Prop := - ZFSet.pair (source 11) sourceBirth ∈ source 17 ∧ - ZFSet.pair (target 11) targetBirth ∈ target 17 ∧ - (z = ZFSet.pair points actors ∧ - 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 ∧ - ChronologicalTransitionLaws points (source 11) (target 11) sourceBirth targetBirth - (linkedChronologyGraphs source) (linkedChronologyGraphs target)) ∧ - OldBirthFiberCoverageCode (source 0) points targetBirth (source 11) - -def LinkedMainTransitionRawCode (M : TransitiveGround.{u}) - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u}) - (source target : Fin 24 → ZFSet.{u}) : Prop := - LinkedMainStageRawCode M K Labels C D rD N sourceCode source ∧ - LinkedMainStageRawCode M K Labels C D rD N targetCode target ∧ - LinkedTransitionLawsCode z points actors sourceBirth targetBirth source target - -namespace BoundedFormula - -def linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n) - (f g : Fin 24 → Fin n) : BoundedFormula n := - .conj (pairMembershipFormula (f 11) sourceBirth (f 17)) - (.conj (pairMembershipFormula (g 11) targetBirth (g 17)) - (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) - points actors (f 11) (g 11) sourceBirth targetBirth - (linkedChronologyGraphs f) (linkedChronologyGraphs g))) - -theorem truth_linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n) - (f g : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) : - Truth (linkedTransitionLawsFormula z points actors sourceBirth targetBirth f g) env ↔ - LinkedTransitionLawsCode (env z) (env points) (env actors) (env sourceBirth) (env targetBirth) - (fun j => env (f j)) (fun j => env (g j)) := by - have map (h : Fin 24 → Fin n) : (fun j => env (linkedChronologyGraphs h j)) = - linkedChronologyGraphs (fun j => env (h j)) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j - simp only [linkedTransitionLawsFormula, Truth, truth_pairMembershipFormula, - truth_coveredChronologicalMainTransitionFormula, map, LinkedTransitionLawsCode] - -end BoundedFormula - -namespace SetFormula - -def linkedMainTransitionRawFormula {n} - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) - (source target : Fin 24 → Fin n) : SetFormula n := - .conj (linkedMainStageRawFormula K Labels C D rD N sourceCode source) - (.conj (linkedMainStageRawFormula K Labels C D rD N targetCode target) - (BoundedFormula.linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target).toFormula) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_linkedMainTransitionRawFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) - (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z - points actors sourceBirth targetBirth source target) env ↔ - LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env sourceCode) (env targetCode) (env z) (env points) (env actors) (env sourceBirth) (env targetBirth) - (fun j => env (source j)) (fun j => env (target j)) := by - have first := M.realize_linkedMainStageRawFormula pairing unions powers separation collection - K Labels C D rD N sourceCode source env members omega ordinal - have second := M.realize_linkedMainStageRawFormula pairing unions powers separation collection - K Labels C D rD N targetCode target env members omega ordinal - have laws := (BoundedFormula.realize_toFormula M _ env members).trans - (BoundedFormula.truth_linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target env) - exact and_congr first (and_congr second laws) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageCodeLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def chronologicalMainTransitionFormula {n} + (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) + (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n := + .conj (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors) + (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth + sourceGraphs targetGraphs) + +theorem truth_chronologicalMainTransitionFormula {n} + (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) + (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) : + 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 ↔ + env z = ZFSet.pair (env points) (env actors) ∧ + 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) ∧ + ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) + (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) + (fun j => env (targetGraphs j)) := by + 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 ∧ + Truth (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth + sourceGraphs targetGraphs) env) ↔ _ + rw [truth_validMainTransitionCodeFormula] + constructor + · rintro ⟨⟨encoded, laws⟩, chronological⟩ + exact ⟨encoded, laws, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff + sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).1 chronological⟩ + · rintro ⟨encoded, laws, chronological⟩ + exact ⟨⟨encoded, laws⟩, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff + sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).2 chronological⟩ + +theorem realize_chronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n} + (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) + (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + 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 + sourceGraphs targetGraphs).toFormula env ↔ + env z = ZFSet.pair (env points) (env actors) ∧ + 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) ∧ + ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) + (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) + (fun j => env (targetGraphs j)) := + (realize_toFormula M _ env members).trans + (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) + +def coveredChronologicalMainTransitionFormula {n} + (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) + (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n := + .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) + (oldBirthFiberCoverageFormula P points targetBirth sourceCutoff) + +theorem truth_coveredChronologicalMainTransitionFormula {n} + (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) + (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) : + 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 ↔ + (env z = ZFSet.pair (env points) (env actors) ∧ + 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) ∧ + ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) + (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) + (fun j => env (targetGraphs j))) ∧ + OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) := by + simp only [coveredChronologicalMainTransitionFormula, Truth, + truth_chronologicalMainTransitionFormula, truth_oldBirthFiberCoverageFormula] + +theorem realize_coveredChronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n} + (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) + (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + 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 + sourceGraphs targetGraphs).toFormula env ↔ + (env z = ZFSet.pair (env points) (env actors) ∧ + 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) ∧ + ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) + (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) + (fun j => env (targetGraphs j))) ∧ + OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) := + (realize_toFormula M _ env members).trans + (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) + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def LinkedTransitionLawsCode (z points actors sourceBirth targetBirth : ZFSet.{u}) + (source target : Fin 24 → ZFSet.{u}) : Prop := + ZFSet.pair (source 11) sourceBirth ∈ source 17 ∧ + ZFSet.pair (target 11) targetBirth ∈ target 17 ∧ + (z = ZFSet.pair points actors ∧ + 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 ∧ + ChronologicalTransitionLaws points (source 11) (target 11) sourceBirth targetBirth + (linkedChronologyGraphs source) (linkedChronologyGraphs target)) ∧ + OldBirthFiberCoverageCode (source 0) points targetBirth (source 11) + +def LinkedMainTransitionRawCode (M : TransitiveGround.{u}) + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u}) + (source target : Fin 24 → ZFSet.{u}) : Prop := + LinkedMainStageRawCode M K Labels C D rD N sourceCode source ∧ + LinkedMainStageRawCode M K Labels C D rD N targetCode target ∧ + LinkedTransitionLawsCode z points actors sourceBirth targetBirth source target + +namespace BoundedFormula + +def linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n) + (f g : Fin 24 → Fin n) : BoundedFormula n := + .conj (pairMembershipFormula (f 11) sourceBirth (f 17)) + (.conj (pairMembershipFormula (g 11) targetBirth (g 17)) + (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) + points actors (f 11) (g 11) sourceBirth targetBirth + (linkedChronologyGraphs f) (linkedChronologyGraphs g))) + +theorem truth_linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n) + (f g : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) : + Truth (linkedTransitionLawsFormula z points actors sourceBirth targetBirth f g) env ↔ + LinkedTransitionLawsCode (env z) (env points) (env actors) (env sourceBirth) (env targetBirth) + (fun j => env (f j)) (fun j => env (g j)) := by + have map (h : Fin 24 → Fin n) : (fun j => env (linkedChronologyGraphs h j)) = + linkedChronologyGraphs (fun j => env (h j)) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j + simp only [linkedTransitionLawsFormula, Truth, truth_pairMembershipFormula, + truth_coveredChronologicalMainTransitionFormula, map, LinkedTransitionLawsCode] + +end BoundedFormula + +namespace SetFormula + +def linkedMainTransitionRawFormula {n} + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) + (source target : Fin 24 → Fin n) : SetFormula n := + .conj (linkedMainStageRawFormula K Labels C D rD N sourceCode source) + (.conj (linkedMainStageRawFormula K Labels C D rD N targetCode target) + (BoundedFormula.linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target).toFormula) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_linkedMainTransitionRawFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) + (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z + points actors sourceBirth targetBirth source target) env ↔ + LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env sourceCode) (env targetCode) (env z) (env points) (env actors) (env sourceBirth) (env targetBirth) + (fun j => env (source j)) (fun j => env (target j)) := by + have first := M.realize_linkedMainStageRawFormula pairing unions powers separation collection + K Labels C D rD N sourceCode source env members omega ordinal + have second := M.realize_linkedMainStageRawFormula pairing unions powers separation collection + K Labels C D rD N targetCode target env members omega ordinal + have laws := (BoundedFormula.realize_toFormula M _ env members).trans + (BoundedFormula.truth_linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target env) + exact and_congr first (and_congr second laws) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedProfileTransitionRawCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedProfileTransitionRawCodes.lean index 304a0c998f084d29a5d71a841529d9a9987537fe..580df14c34bea6d20ea54c515422c4a783ab6c41 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedProfileTransitionRawCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedProfileTransitionRawCodes.lean @@ -1,113 +1,113 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedProfilePreservation - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def LinkedProfilePreservingTransitionRawCode (M : TransitiveGround.{u}) - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u}) - (source target : Fin 24 → ZFSet.{u}) : Prop := - LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors - sourceBirth targetBirth source target ∧ - Families = M.groundPower (source 0) ∧ - OldProfilePreservationCode (source 0) (source 1) (source 2) - (target 0) (target 1) (target 2) points Families - -namespace SetFormula -def linkedProfilePreservingTransitionRawFormula {n} - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n) - (source target : Fin 24 → Fin n) : SetFormula n := - .conj (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z points actors - sourceBirth targetBirth source target) - (.conj (relativePowerFormula (source 0) Families) - (BoundedFormula.oldProfilePreservationFormula (source 0) (source 1) (source 2) - (target 0) (target 1) (target 2) points Families).toFormula) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem realize_linkedProfilePreservingTransitionRawFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n) - (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedProfilePreservingTransitionRawFormula K Labels C D rD N sourceCode targetCode z - points actors sourceBirth targetBirth Families source target) env ↔ - LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) - (env N) (env sourceCode) (env targetCode) (env z) (env points) (env actors) - (env sourceBirth) (env targetBirth) (env Families) - (fun j => env (source j)) (fun j => env (target j)) := - (M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection - K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth source target - env members omega ordinal).and - ((M.realize_relativePowerFormula (source 0) Families env members).and - (BoundedFormula.realize_oldProfilePreservationFormula M (source 0) (source 1) (source 2) - (target 0) (target 1) (target 2) points Families env members)) - -end TransitiveGround - -namespace LinkedProfilePreservingTransitionRawCode -variable {M : TransitiveGround.{u}} -variable {K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u}} -variable {source target : Fin 24 → ZFSet.{u}} - -theorem exists_transition - (raw : LinkedProfilePreservingTransitionRawCode M K Labels C D rD N sourceCode targetCode z - points actors sourceBirth targetBirth Families source target) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (sourceGround : ∀ j, source j ∈ M.sets) (targetGround : ∀ j, target j ∈ M.sets) - (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) : - LinkedProfilePreservingTransitionCode M K Labels C D rD sourceCode targetCode z := by - rw [omega] at raw - obtain ⟨s, t, sourceEqual, targetEqual, transition, equal, covered⟩ := - raw.1.exists_transition pairing unions powers separation sourceGround targetGround - hPoints hActors hC hD hrD rfl - have sourceCode := s.rawFields_code - have targetCode := t.rawFields_code - rw [sourceEqual] at sourceCode - rw [targetEqual] at targetCode - have sourceFields := sourceCode.fields_unique raw.1.1 - have targetFields := targetCode.fields_unique raw.1.2.1 - have mapEqual : ZFSet.pair transition.map.points transition.map.actors = ZFSet.pair points actors := - equal.trans raw.1.2.2.2.2.1.1 - have pointsEqual := (ZFSet.pair_inj.1 mapEqual).1 - have preservation := raw.2.2 - rw [raw.2.1, ← sourceFields, ← targetFields] at preservation - refine ⟨s, t, sourceEqual, targetEqual, transition, equal, covered, ?_⟩ - change OldProfilePreservationCode s.main.stage.carrier s.main.stage.order s.main.stage.meetGraph - t.main.stage.carrier t.main.stage.order t.main.stage.meetGraph - transition.map.points (M.groundPower s.main.stage.carrier) - rw [pointsEqual] - exact preservation - -end LinkedProfilePreservingTransitionRawCode - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (source target : GroundLinkedMainStage M K Labels C D rD) -theorem profileTransition_rawFields - (transition : GroundChronologicalMainTransition source.main target.main) - (covered : transition.CoversOldBirths) (preserved : transition.PreservesOldProfiles) : - LinkedProfilePreservingTransitionRawCode M K Labels C D rD ZFSet.omega source.code target.code - transition.map.code transition.map.points transition.map.actors source.main.birth target.main.birth - (M.groundPower source.main.stage.carrier) source.rawFields target.rawFields := - ⟨source.transition_rawFields target transition covered, rfl, preserved⟩ - -end GroundLinkedMainStage - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedProfilePreservation + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def LinkedProfilePreservingTransitionRawCode (M : TransitiveGround.{u}) + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u}) + (source target : Fin 24 → ZFSet.{u}) : Prop := + LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors + sourceBirth targetBirth source target ∧ + Families = M.groundPower (source 0) ∧ + OldProfilePreservationCode (source 0) (source 1) (source 2) + (target 0) (target 1) (target 2) points Families + +namespace SetFormula +def linkedProfilePreservingTransitionRawFormula {n} + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n) + (source target : Fin 24 → Fin n) : SetFormula n := + .conj (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z points actors + sourceBirth targetBirth source target) + (.conj (relativePowerFormula (source 0) Families) + (BoundedFormula.oldProfilePreservationFormula (source 0) (source 1) (source 2) + (target 0) (target 1) (target 2) points Families).toFormula) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem realize_linkedProfilePreservingTransitionRawFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n) + (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedProfilePreservingTransitionRawFormula K Labels C D rD N sourceCode targetCode z + points actors sourceBirth targetBirth Families source target) env ↔ + LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) + (env N) (env sourceCode) (env targetCode) (env z) (env points) (env actors) + (env sourceBirth) (env targetBirth) (env Families) + (fun j => env (source j)) (fun j => env (target j)) := + (M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection + K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth source target + env members omega ordinal).and + ((M.realize_relativePowerFormula (source 0) Families env members).and + (BoundedFormula.realize_oldProfilePreservationFormula M (source 0) (source 1) (source 2) + (target 0) (target 1) (target 2) points Families env members)) + +end TransitiveGround + +namespace LinkedProfilePreservingTransitionRawCode +variable {M : TransitiveGround.{u}} +variable {K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u}} +variable {source target : Fin 24 → ZFSet.{u}} + +theorem exists_transition + (raw : LinkedProfilePreservingTransitionRawCode M K Labels C D rD N sourceCode targetCode z + points actors sourceBirth targetBirth Families source target) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (sourceGround : ∀ j, source j ∈ M.sets) (targetGround : ∀ j, target j ∈ M.sets) + (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) : + LinkedProfilePreservingTransitionCode M K Labels C D rD sourceCode targetCode z := by + rw [omega] at raw + obtain ⟨s, t, sourceEqual, targetEqual, transition, equal, covered⟩ := + raw.1.exists_transition pairing unions powers separation sourceGround targetGround + hPoints hActors hC hD hrD rfl + have sourceCode := s.rawFields_code + have targetCode := t.rawFields_code + rw [sourceEqual] at sourceCode + rw [targetEqual] at targetCode + have sourceFields := sourceCode.fields_unique raw.1.1 + have targetFields := targetCode.fields_unique raw.1.2.1 + have mapEqual : ZFSet.pair transition.map.points transition.map.actors = ZFSet.pair points actors := + equal.trans raw.1.2.2.2.2.1.1 + have pointsEqual := (ZFSet.pair_inj.1 mapEqual).1 + have preservation := raw.2.2 + rw [raw.2.1, ← sourceFields, ← targetFields] at preservation + refine ⟨s, t, sourceEqual, targetEqual, transition, equal, covered, ?_⟩ + change OldProfilePreservationCode s.main.stage.carrier s.main.stage.order s.main.stage.meetGraph + t.main.stage.carrier t.main.stage.order t.main.stage.meetGraph + transition.map.points (M.groundPower s.main.stage.carrier) + rw [pointsEqual] + exact preservation + +end LinkedProfilePreservingTransitionRawCode + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (source target : GroundLinkedMainStage M K Labels C D rD) +theorem profileTransition_rawFields + (transition : GroundChronologicalMainTransition source.main target.main) + (covered : transition.CoversOldBirths) (preserved : transition.PreservesOldProfiles) : + LinkedProfilePreservingTransitionRawCode M K Labels C D rD ZFSet.omega source.code target.code + transition.map.code transition.map.points transition.map.actors source.main.birth target.main.birth + (M.groundPower source.main.stage.carrier) source.rawFields target.rawFields := + ⟨source.transition_rawFields target transition covered, rfl, preserved⟩ + +end GroundLinkedMainStage + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainLimitCoverageFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainLimitCoverageFormulas.lean index b874dac8f653598c5156dc477b7b0d1fce2ae428..aa74395c437d878b3657a85d41f80239c5c96f58 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainLimitCoverageFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainLimitCoverageFormulas.lean @@ -1,559 +1,559 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ForcingHistoryOutputFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.GreedyAntichainTraces -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph - -namespace OAI - - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def orderAntichainFormula {n} (Q order A : Fin n) : BoundedFormula n := - .conj (.allMem A (.mem 0 Q.succ)) - (.allMem A (.allMem A.succ (.allMem Q.succ.succ - (imp (.conj (pairMembershipFormula 0 2 order.succ.succ.succ) - (pairMembershipFormula 0 1 order.succ.succ.succ)) (.equal 2 1))))) - -theorem truth_orderAntichainFormula {n} (Q order A : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (orderAntichainFormula Q order A) env ↔ OrderAntichainCode (env Q) (env order) (env A) := by - simp only [orderAntichainFormula, Truth, truth_imp, truth_pairMembershipFormula] - constructor - · rintro ⟨subset, law⟩ - exact ⟨subset, fun p hp q hq r hr first second => law p hp q hq r hr ⟨first, second⟩⟩ - · rintro ⟨subset, law⟩ - exact ⟨subset, fun p hp q hq r hr both => law p hp q hq r hr both.1 both.2⟩ - -def relativeMaximalAntichainFormula {n} (Q order D A : Fin n) : BoundedFormula n := - .conj (.allMem A (.mem 0 D.succ)) (.conj (orderAntichainFormula Q order A) - (.allMem D (exMem A.succ (exMem Q.succ.succ - (.conj (pairMembershipFormula 0 2 order.succ.succ.succ) - (pairMembershipFormula 0 1 order.succ.succ.succ)))))) - -theorem truth_relativeMaximalAntichainFormula {n} (Q order D A : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (relativeMaximalAntichainFormula Q order D A) env ↔ - RelativeMaximalAntichainCode (env Q) (env order) (env D) (env A) := by - simp only [relativeMaximalAntichainFormula, Truth, truth_orderAntichainFormula, - truth_exMem, truth_pairMembershipFormula] - rfl - - - - - -def exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n := - exMem f (exPairFields 0 - (reindex (Fin.cases 0 (Fin.cases 1 (fun i => i.succ.succ.succ))) body)) - -theorem truth_exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2)) - (env : Fin n → ZFSet.{u}) : - Truth (exGraphFields f body) env ↔ - ∃ x y, ZFSet.pair x y ∈ env f ∧ Truth body (extend y (extend x env)) := by - simp only [exGraphFields, truth_exMem, truth_exPairFields, truth_reindex] - have rearrange (z x y : ZFSet.{u}) : - (fun i => extend y (extend x (extend z env)) - (Fin.cases 0 (Fin.cases 1 (fun j => j.succ.succ.succ)) i)) = - extend y (extend x env) := by - funext i - refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl - simp only [rearrange] - change (∃ z ∈ env f, ∃ x y, z = ZFSet.pair x y ∧ - Truth body (extend y (extend x env))) ↔ _ - constructor - · rintro ⟨z, member, x, y, rfl, holds⟩ - exact ⟨x, y, member, holds⟩ - · rintro ⟨x, y, member, holds⟩ - exact ⟨ZFSet.pair x y, member, x, y, rfl, holds⟩ - -def exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3)) : BoundedFormula n := - exPairFields z (exPairFields 0 (exPairFields 3 - (exPairFields 0 (exPairFields 0 (exPairFields 0 - (.conj (tupleShapeFormula 6 0) - (reindex (Fin.cases 9 (Fin.cases 1 (Fin.cases 7 - (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)))) body))))))) - -theorem truth_exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3)) - (env : Fin n → ZFSet.{u}) : - Truth (exLinkedCoverageFields z body) env ↔ - ∃ P G cutoff, LinkedCoverageFieldsCode (env z) P G cutoff ∧ - Truth body (extend cutoff (extend G (extend P env))) := by - simp only [exLinkedCoverageFields, truth_exPairFields, Truth, truth_tupleShapeFormula, - truth_reindex] - have rearrange (s outer cutoff serial P tail r tail' μ tail'' G rest : ZFSet.{u}) : - (fun i => extend rest (extend G (extend tail'' (extend μ (extend tail' (extend r - (extend tail (extend P (extend serial (extend cutoff (extend outer (extend s env))))))))))) - (Fin.cases 9 (Fin.cases 1 (Fin.cases 7 - (fun j => j.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ))) i)) = - extend cutoff (extend G (extend P env)) := by - funext i - refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => ?_) k) j) i <;> rfl - simp only [rearrange] - change (∃ s outer, env z = ZFSet.pair s outer ∧ ∃ cutoff serial, - outer = ZFSet.pair cutoff serial ∧ ∃ P tail, s = ZFSet.pair P tail ∧ - ∃ r tail', tail = ZFSet.pair r tail' ∧ ∃ μ tail'', tail' = ZFSet.pair μ tail'' ∧ - ∃ G rest, tail'' = ZFSet.pair G rest ∧ - (∃ fields, rest = nonemptyTupleCode 6 fields) ∧ - Truth body (extend cutoff (extend G (extend P env)))) ↔ _ - constructor - · rintro ⟨s, outer, equal, cutoff, serial, rfl, P, tail, rfl, r, tail', rfl, - μ, tail'', rfl, G, rest, rfl, ⟨fields, rfl⟩, holds⟩ - exact ⟨P, G, cutoff, ⟨r, μ, fields 0, fields 1, fields 2, fields 3, fields 4, - fields 5, fields 6, serial, equal⟩, holds⟩ - · rintro ⟨P, G, cutoff, ⟨r, μ, m, inv, one, action, bottom, top, height, serial, equal⟩, holds⟩ - let fields : Fin 7 → ZFSet.{u} := Fin.cases m (Fin.cases inv (Fin.cases one - (Fin.cases action (Fin.cases bottom (Fin.cases top (fun _ => height)))))) - refine ⟨_, _, equal, cutoff, serial, rfl, P, _, rfl, r, _, rfl, μ, _, rfl, - G, nonemptyTupleCode 6 fields, rfl, ⟨fields, rfl⟩, holds⟩ - - - - - -def exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4)) : BoundedFormula n := - exGraphFields S (.conj (.mem 1 T.succ.succ) - (exLinkedCoverageFields 0 (reindex - (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4 - (fun i => i.succ.succ.succ.succ.succ))))) body))) - -theorem truth_exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4)) - (env : Fin n → ZFSet.{u}) : - Truth (exMainLimitStageFields T S body) env ↔ - ∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ - LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env)))) := by - simp only [exMainLimitStageFields, truth_exGraphFields, Truth, truth_exLinkedCoverageFields, - truth_reindex] - have rearrange (i z P G t : ZFSet.{u}) : - (fun j => extend t (extend G (extend P (extend z (extend i env)))) - (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4 - (fun k => k.succ.succ.succ.succ.succ)))) j)) = - extend t (extend G (extend P (extend i env))) := by - funext j - refine Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => Fin.cases ?_ - (fun m => Fin.cases ?_ (fun a => ?_) m) l) k) j <;> rfl - simp only [rearrange] - change (∃ i z, ZFSet.pair i z ∈ env S ∧ i ∈ env T ∧ ∃ P G t, - LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env))))) ↔ _ - constructor - · rintro ⟨i,z,entry,member,P,G,t,shape,holds⟩ - exact ⟨i,z,P,G,t,member,entry,shape,holds⟩ - · rintro ⟨i,z,P,G,t,member,entry,shape,holds⟩ - exact ⟨i,z,entry,member,P,G,t,shape,holds⟩ - -def exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6)) : BoundedFormula n := - exMainLimitStageFields T S (exGraphFields row.succ.succ.succ.succ - (.conj (orderedPairFormula 1 T.succ.succ.succ.succ.succ.succ 5) - (exPairFields 0 (reindex (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5 - (Fin.cases 6 (Fin.cases 7 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ))))))) body)))) - -theorem truth_exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6)) - (env : Fin n → ZFSet.{u}) : - Truth (exMainLimitConeFields T S row body) env ↔ - ∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧ - Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env)))))) := by - simp only [exMainLimitConeFields, truth_exMainLimitStageFields, truth_exGraphFields, Truth, - truth_orderedPairFormula, truth_exPairFields, truth_reindex] - have rearrange (i P G t key value points actors : ZFSet.{u}) : - (fun j => extend actors (extend points (extend value (extend key (extend t - (extend G (extend P (extend i env))))))) - (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5 (Fin.cases 6 - (Fin.cases 7 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ)))))) j)) = - extend actors (extend points (extend t (extend G (extend P (extend i env))))) := by - funext j - refine Fin.cases ?_ (fun a => Fin.cases ?_ (fun b => Fin.cases ?_ (fun c => - Fin.cases ?_ (fun d => Fin.cases ?_ (fun e => Fin.cases ?_ (fun f => ?_) e) d) c) b) a) j <;> rfl - simp only [rearrange] - change (∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ LinkedCoverageFieldsCode z P G t ∧ - ∃ key value, ZFSet.pair key value ∈ env row ∧ key = ZFSet.pair (env T) i ∧ - ∃ points actors, value = ZFSet.pair points actors ∧ - Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env))))))) ↔ _ - constructor - · rintro ⟨i,z,P,G,t,member,entry,shape,key,value,rowEntry,rfl,points,actors,rfl,holds⟩ - exact ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩ - · rintro ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩ - exact ⟨i,z,P,G,t,member,entry,shape,_,_,rowEntry,rfl,points,actors,rfl,holds⟩ - - - - - -def certificateGraphEntryAt {n} (j F B f k : Fin n) : BoundedFormula n := - exGraphFields k (.conj (.equal 1 j.succ.succ) - (exPairFields 0 (.conj (.equal 1 F.succ.succ.succ.succ) - (orderedPairFormula 0 B.succ.succ.succ.succ f.succ.succ.succ.succ)))) - -theorem truth_certificateGraphEntryAt {n} (j F B f k : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (certificateGraphEntryAt j F B f k) env ↔ - ZFSet.pair (env j) (ZFSet.pair (env F) (ZFSet.pair (env B) (env f))) ∈ env k := by - simp only [certificateGraphEntryAt, truth_exGraphFields, Truth, - truth_exPairFields, truth_orderedPairFormula] - change (∃ key certificate, ZFSet.pair key certificate ∈ env k ∧ key = env j ∧ - ∃ profile tail, certificate = ZFSet.pair profile tail ∧ profile = env F ∧ - tail = ZFSet.pair (env B) (env f)) ↔ _ - constructor - · rintro ⟨key, certificate, entry, rfl, profile, tail, rfl, rfl, rfl⟩ - exact entry - · intro entry - exact ⟨env j, _, entry, rfl, env F, _, rfl, rfl, rfl⟩ - -def enumerationGraphEntryAt {n} (j e names g : Fin n) : BoundedFormula n := - exGraphFields g (.conj (.equal 1 j.succ.succ) - (orderedPairFormula 0 e.succ.succ names.succ.succ)) - -theorem truth_enumerationGraphEntryAt {n} (j e names g : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (enumerationGraphEntryAt j e names g) env ↔ - ZFSet.pair (env j) (ZFSet.pair (env e) (env names)) ∈ env g := by - simp only [enumerationGraphEntryAt, truth_exGraphFields, Truth, truth_orderedPairFormula] - change (∃ key pair, ZFSet.pair key pair ∈ env g ∧ key = env j ∧ - pair = ZFSet.pair (env e) (env names)) ↔ _ - constructor - · rintro ⟨key, pair, entry, rfl, rfl⟩ - exact entry - · intro entry - exact ⟨env j, _, entry, rfl, rfl⟩ - - - - - -def relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n) : BoundedFormula n := - exGraphFields domains (.conj (.equal 1 j.succ.succ) - (relativeMaximalAntichainFormula Q.succ.succ order.succ.succ 0 A.succ.succ)) - -theorem truth_relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (relativeAntichainFamilyFormula j A Q order domains) env ↔ - ∃ D, ZFSet.pair (env j) D ∈ env domains ∧ - RelativeMaximalAntichainCode (env Q) (env order) D (env A) := by - simp only [relativeAntichainFamilyFormula, truth_exGraphFields, Truth, - truth_relativeMaximalAntichainFormula] - change (∃ key D, ZFSet.pair key D ∈ env domains ∧ key = env j ∧ - RelativeMaximalAntichainCode (env Q) (env order) D (env A)) ↔ _ - constructor - · rintro ⟨key, D, entry, rfl, code⟩ - exact ⟨D, entry, code⟩ - · rintro ⟨D, entry, code⟩ - exact ⟨env j, D, entry, rfl, code⟩ - - - - - -def assignmentQueryWithinFormula {n} (X T q : Fin n) : BoundedFormula n := - exPairFields q (stageOneAssignmentsSubsetFormula 0 X.succ.succ T.succ.succ) - -theorem truth_assignmentQueryWithinFormula {n} (X T q : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (assignmentQueryWithinFormula X T q) env ↔ - AssignmentQueryWithin (env X) (env T) (env q) := by - simp only [assignmentQueryWithinFormula, truth_exPairFields, - truth_stageOneAssignmentsSubsetFormula] - rfl - -def representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n) : BoundedFormula n := - .conj (.mem i I) (exMem Q - (.conj (assignmentQueryWithinFormula X.succ T.succ 0) - (exGraphFields c.succ (.conj (.equal 1 2) - (exPairFields 0 - (exMem T.succ.succ.succ.succ.succ - (exMem T.succ.succ.succ.succ.succ.succ - (exMem 2 (stageOneAssignmentFormula 0 - i.succ.succ.succ.succ.succ.succ.succ.succ 2 1))))))))) - -theorem truth_representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (representativeIndexAdditionsMemberFormula i I T Q c X) env ↔ - env i ∈ representativeIndexAdditions (env I) (env T) (env Q) (env c) (env X) := by - simp only [representativeIndexAdditionsMemberFormula, Truth, truth_exMem, - truth_assignmentQueryWithinFormula, truth_exGraphFields, truth_exPairFields, - truth_stageOneAssignmentFormula] - rw [mem_representativeIndexAdditions] - change (env i ∈ env I ∧ ∃ q ∈ env Q, AssignmentQueryWithin (env X) (env T) q ∧ - ∃ key value, ZFSet.pair key value ∈ env c ∧ key = q ∧ - ∃ row A, value = ZFSet.pair row A ∧ ∃ v ∈ env T, ∃ w ∈ env T, - ∃ z ∈ A, z = stageOneAssignment (env i) v w) ↔ _ - apply and_congr Iff.rfl - constructor - · rintro ⟨q, hq, localQuery, key, value, entry, rfl, row, A, rfl, v, hv, w, hw, z, hz, rfl⟩ - exact ⟨key, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩ - · rintro ⟨q, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩ - exact ⟨q, hq, localQuery, q, ZFSet.pair row A, entry, rfl, row, A, rfl, - v, hv, w, hw, stageOneAssignment (env i) v w, hz, rfl⟩ - - - - - -def supportedCertificateFormula {n} - (nodes N order R niceEval visibilityEval value F B f : Fin n) : BoundedFormula n := - .conj (.allMem F (.mem 0 nodes.succ)) - (.conj (.allMem B (.mem 0 F.succ)) - (.conj (.allMem F (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ))) - (.conj (functionFormula B N f) - (.conj - (.neg (exGraphFields visibilityEval - (.conj (.mem 1 nodes.succ.succ) - (.neg (.conj (imp (.mem value.succ.succ 0) (.mem 1 F.succ.succ)) - (imp (.mem 1 F.succ.succ) (.mem value.succ.succ 0))))))) - (.allMem B (.allMem N.succ - (imp (pairMembershipFormula 1 0 f.succ.succ) - (.conj (pairMembershipFormula 1 0 R.succ.succ) - (pairMembershipFormula 0 value.succ.succ niceEval.succ.succ))))))))) - -theorem truth_supportedCertificateFormula {n} - (nodes N order R niceEval visibilityEval value F B f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (supportedCertificateFormula nodes N order R niceEval visibilityEval value F B f) env ↔ - SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) - (env niceEval) (env visibilityEval) (env value) (env F) (env B) (env f) := by - classical - simp only [supportedCertificateFormula, Truth, truth_exMem, truth_pairMembershipFormula, - truth_functionFormula, truth_exGraphFields, truth_imp, not_exists, not_and, not_not, - ← iff_def] - rfl - -def supportedCertificateEntryFormula {n} - (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) : - BoundedFormula n := - exPairFields entry (exPairFields 0 (exPairFields 0 - (.conj (.mem 5 J.succ.succ.succ.succ.succ.succ) - (.conj (.mem 3 PF.succ.succ.succ.succ.succ.succ) - (.conj (.mem 1 PB.succ.succ.succ.succ.succ.succ) - (.conj (.mem 0 WF.succ.succ.succ.succ.succ.succ) - (exGraphFields inputEval.succ.succ.succ.succ.succ.succ - (.conj (.equal 1 7) - (supportedCertificateFormula - nodes.succ.succ.succ.succ.succ.succ.succ.succ - N.succ.succ.succ.succ.succ.succ.succ.succ - order.succ.succ.succ.succ.succ.succ.succ.succ - R.succ.succ.succ.succ.succ.succ.succ.succ - niceEval.succ.succ.succ.succ.succ.succ.succ.succ - visibilityEval.succ.succ.succ.succ.succ.succ.succ.succ - 0 5 3 2))))))))) - -theorem truth_supportedCertificateEntryFormula {n} - (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (supportedCertificateEntryFormula entry J PF PB WF nodes N order R - inputEval niceEval visibilityEval) env ↔ - ∃ j ∈ env J, ∃ F ∈ env PF, ∃ B ∈ env PB, ∃ f ∈ env WF, - env entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧ - ∃ value, ZFSet.pair j value ∈ env inputEval ∧ - SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) - (env niceEval) (env visibilityEval) value F B f := by - simp only [supportedCertificateEntryFormula, truth_exPairFields, Truth, - truth_exGraphFields, truth_supportedCertificateFormula] - change (∃ j tail, env entry = ZFSet.pair j tail ∧ - ∃ F rest, tail = ZFSet.pair F rest ∧ - ∃ B f, rest = ZFSet.pair B f ∧ - j ∈ env J ∧ F ∈ env PF ∧ B ∈ env PB ∧ f ∈ env WF ∧ - ∃ j' value, ZFSet.pair j' value ∈ env inputEval ∧ j' = j ∧ - SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) - (env niceEval) (env visibilityEval) value F B f) ↔ _ - constructor - · rintro ⟨j, tail, equal, F, rest, rfl, B, f, rfl, hj, hF, hB, hf, - j', value, evaluated, rfl, certificate⟩ - exact ⟨j', hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩ - · rintro ⟨j, hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩ - exact ⟨j, _, equal, F, _, rfl, B, f, rfl, hj, hF, hB, hf, - j, value, evaluated, rfl, certificate⟩ - - - - - -def exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n) - (body : BoundedFormula (n + 1)) : BoundedFormula n := - exMainLimitConeFields T S row (exGraphFields (if actor then 0 else 1) - (.conj (.mem 1 (if actor then 5 else 6)) - (reindex (Fin.cases 0 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ)) body))) - -theorem truth_exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n) - (body : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) : - Truth (exMainLimitImageFields actor T S row body) env ↔ - ∃ x, (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) x - else MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧ Truth body (extend x env) := by - simp only [exMainLimitImageFields, truth_exMainLimitConeFields, truth_exGraphFields, Truth, truth_reindex] - have rearrange (i P G t points actors y x : ZFSet.{u}) : - (fun j => extend x (extend y (extend actors (extend points (extend t - (extend G (extend P (extend i env))))))) - (Fin.cases 0 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ) j)) = extend x env := by - funext j - refine Fin.cases ?_ (fun k => ?_) j <;> rfl - simp only [rearrange] - cases actor <;> simp only [Bool.false_eq_true, ite_false, ite_true] - · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧ - ∃ y x, ZFSet.pair y x ∈ points ∧ y ∈ P ∧ Truth body (extend x env)) ↔ _ - constructor - · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ - exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ - · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ - exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ - · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧ - ∃ y x, ZFSet.pair y x ∈ actors ∧ y ∈ G ∧ Truth body (extend x env)) ↔ _ - constructor - · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ - exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ - · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ - exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ - -def mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n) : BoundedFormula n := - exMainLimitImageFields actor T S row (.equal 0 x.succ) - -theorem truth_mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n) - (env : Fin n → ZFSet.{u}) : Truth (mainLimitImageFormula actor T S row x) env ↔ - (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) (env x) - else MainLimitOldPointImageCode (env T) (env S) (env row) (env x)) := by - rw [mainLimitImageFormula, truth_exMainLimitImageFields] - change (∃ y, _ ∧ y = env x) ↔ _ - constructor - · rintro ⟨y, member, rfl⟩ - exact member - · exact fun member => ⟨env x, member, rfl⟩ - -def mainLimitOldCutoffFormula {n} (T S t : Fin n) : BoundedFormula n := - exMainLimitStageFields T S (disj (.equal t.succ.succ.succ.succ 0) - (.mem t.succ.succ.succ.succ 0)) - -theorem truth_mainLimitOldCutoffFormula {n} (T S t : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (mainLimitOldCutoffFormula T S t) env ↔ MainLimitOldCutoffCode (env T) (env S) (env t) := by - simp only [mainLimitOldCutoffFormula, truth_exMainLimitStageFields, truth_disj, Truth] - change (∃ i z P G cutoff, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ - LinkedCoverageFieldsCode z P G cutoff ∧ (env t = cutoff ∨ env t ∈ cutoff)) ↔ _ - constructor - · rintro ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩ - exact ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩ - · rintro ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩ - exact ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩ - - - - - -def mainLimitPointCoverageFormula {n} (T S row Q top : Fin n) : BoundedFormula n := - .conj (.allMem Q (imp (.neg (.equal 0 top.succ)) - (mainLimitImageFormula false T.succ S.succ row.succ 0))) - (.neg (exMainLimitImageFields false T S row - (.neg (.conj (.mem 0 Q.succ) (.neg (.equal 0 top.succ)))))) - -theorem truth_mainLimitPointCoverageFormula {n} (T S row Q top : Fin n) - (env : Fin n → ZFSet.{u}) : Truth (mainLimitPointCoverageFormula T S row Q top) env ↔ - ∀ x, (x ∈ env Q ∧ x ≠ env top) ↔ MainLimitOldPointImageCode (env T) (env S) (env row) x := by - classical - simp only [mainLimitPointCoverageFormula, Truth, truth_imp, truth_mainLimitImageFormula, - truth_exMainLimitImageFields, Bool.false_eq_true, ite_false, not_exists, not_and, not_not, Classical.not_imp] - change ((∀ x ∈ env Q, x ≠ env top → MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧ - ∀ x, MainLimitOldPointImageCode (env T) (env S) (env row) x → x ∈ env Q ∧ x ≠ env top) ↔ _ - constructor - · rintro ⟨forward, reverse⟩ x - exact ⟨fun h => forward x h.1 h.2, reverse x⟩ - · intro laws - exact ⟨fun x member different => (laws x).1 ⟨member,different⟩, fun x => (laws x).2⟩ - -def mainLimitActorCoverageFormula {n} (T S row H : Fin n) : BoundedFormula n := - .conj (.allMem H (mainLimitImageFormula true T.succ S.succ row.succ 0)) - (.neg (exMainLimitImageFields true T S row (.neg (.mem 0 H.succ)))) - -theorem truth_mainLimitActorCoverageFormula {n} (T S row H : Fin n) - (env : Fin n → ZFSet.{u}) : Truth (mainLimitActorCoverageFormula T S row H) env ↔ - ∀ g, g ∈ env H ↔ MainLimitOldActorImageCode (env T) (env S) (env row) g := by - classical - simp only [mainLimitActorCoverageFormula, Truth, truth_mainLimitImageFormula, - truth_exMainLimitImageFields, ite_true, not_exists, not_and, not_not] - change ((∀ g ∈ env H, MainLimitOldActorImageCode (env T) (env S) (env row) g) ∧ - ∀ g, MainLimitOldActorImageCode (env T) (env S) (env row) g → g ∈ env H) ↔ _ - exact ⟨fun h g => ⟨h.1 g,h.2 g⟩, fun h => ⟨fun g => (h g).1,fun g => (h g).2⟩⟩ - -def mainLimitStrictTopFormula {n} (T S row R top : Fin n) : BoundedFormula n := - .neg (exMainLimitConeFields T S row (exGraphFields 1 (.neg - (.conj (pairMembershipFormula 0 top.succ.succ.succ.succ.succ.succ.succ.succ - R.succ.succ.succ.succ.succ.succ.succ.succ) - (.neg (pairMembershipFormula top.succ.succ.succ.succ.succ.succ.succ.succ 0 - R.succ.succ.succ.succ.succ.succ.succ.succ)))))) - -theorem truth_mainLimitStrictTopFormula {n} (T S row R top : Fin n) - (env : Fin n → ZFSet.{u}) : Truth (mainLimitStrictTopFormula T S row R top) env ↔ - ∀ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors → - ∀ x y, ZFSet.pair x y ∈ points → ZFSet.pair y (env top) ∈ env R ∧ - ZFSet.pair (env top) y ∉ env R := by - classical - simp only [mainLimitStrictTopFormula, Truth, truth_exMainLimitConeFields, - truth_exGraphFields, truth_pairMembershipFormula, not_exists, not_and, not_not, Classical.not_imp] - rfl - -def mainLimitCutoffFormula {n} (T S cutoff : Fin n) : BoundedFormula n := - .conj (.allMem cutoff (mainLimitOldCutoffFormula T.succ S.succ 0)) - (.neg (exMainLimitStageFields T S (.neg - (.conj (.mem 0 cutoff.succ.succ.succ.succ) - (.allMem 0 (.mem 0 cutoff.succ.succ.succ.succ.succ)))))) - -theorem truth_mainLimitCutoffFormula {n} (T S cutoff : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (mainLimitCutoffFormula T S cutoff) env ↔ - ∀ t, t ∈ env cutoff ↔ MainLimitOldCutoffCode (env T) (env S) t := by - classical - simp only [mainLimitCutoffFormula, Truth, truth_mainLimitOldCutoffFormula, - truth_exMainLimitStageFields, not_exists, not_and, not_not, Classical.not_imp] - change ((∀ t ∈ env cutoff, MainLimitOldCutoffCode (env T) (env S) t) ∧ - ∀ i z P G t, i ∈ env T → ZFSet.pair i z ∈ env S → LinkedCoverageFieldsCode z P G t → - t ∈ env cutoff ∧ ∀ s ∈ t, s ∈ env cutoff) ↔ _ - constructor - · rintro ⟨forward,bound⟩ t - refine ⟨forward t, ?_⟩ - rintro ⟨i,member,z,entry,P,G,s,shape,equal | lower⟩ - · exact equal.symm ▸ (bound i z P G s member entry shape).1 - · exact (bound i z P G s member entry shape).2 t lower - · intro laws - refine ⟨fun t => (laws t).1, ?_⟩ - intro i z P G t member entry shape - exact ⟨(laws t).2 ⟨i,member,z,entry,P,G,t,shape,Or.inl rfl⟩, - fun s lower => (laws s).2 ⟨i,member,z,entry,P,G,t,shape,Or.inr lower⟩⟩ - -def mainLimitTopBirthFormula {n} (top cutoff birth : Fin n) : BoundedFormula n := - .conj (pairMembershipFormula top cutoff birth) - (.neg (exGraphFields birth (.conj (.equal 0 cutoff.succ.succ) - (.neg (.equal 1 top.succ.succ))))) - -theorem truth_mainLimitTopBirthFormula {n} (top cutoff birth : Fin n) - (env : Fin n → ZFSet.{u}) : Truth (mainLimitTopBirthFormula top cutoff birth) env ↔ - ∀ x, ZFSet.pair x (env cutoff) ∈ env birth ↔ x = env top := by - classical - simp only [mainLimitTopBirthFormula, Truth, truth_pairMembershipFormula, - truth_exGraphFields, not_exists, not_and, not_not] - change (ZFSet.pair (env top) (env cutoff) ∈ env birth ∧ - ∀ x t, ZFSet.pair x t ∈ env birth → t = env cutoff → x = env top) ↔ _ - constructor - · rintro ⟨entry,unique⟩ x - exact ⟨fun image => unique x (env cutoff) image rfl, fun equal => equal.symm ▸ entry⟩ - · intro laws - exact ⟨(laws (env top)).2 rfl, fun x t image equal => (laws x).1 (equal ▸ image)⟩ - -def mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n) : BoundedFormula n := - .conj (mainLimitPointCoverageFormula T S row Q top) - (.conj (mainLimitActorCoverageFormula T S row H) - (.conj (mainLimitStrictTopFormula T S row R top) - (.conj (mainLimitCutoffFormula T S cutoff) (mainLimitTopBirthFormula top cutoff birth)))) - -theorem truth_mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n) - (env : Fin n → ZFSet.{u}) : Truth (mainLimitCoverageFormula T S row Q H R top cutoff birth) env ↔ - MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R) - (env top) (env cutoff) (env birth) := by - simp only [mainLimitCoverageFormula, Truth, truth_mainLimitPointCoverageFormula, - truth_mainLimitActorCoverageFormula, truth_mainLimitStrictTopFormula, - truth_mainLimitCutoffFormula, truth_mainLimitTopBirthFormula] - exact ⟨fun h => ⟨h.1,h.2.1,h.2.2.1,h.2.2.2.1,h.2.2.2.2⟩, - fun h => ⟨h.points,h.actors,h.strict_top,h.cutoff_mem,h.top_birth⟩⟩ - -theorem realize_mainLimitCoverageFormula (M : TransitiveGround.{u}) {n} - (T S row Q H R top cutoff birth : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (mainLimitCoverageFormula T S row Q H R top cutoff birth).toFormula env ↔ - MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R) - (env top) (env cutoff) (env birth) := - (realize_toFormula M _ env members).trans (truth_mainLimitCoverageFormula T S row Q H R top cutoff birth env) - -end PartitionPilot.Forcing.BoundedFormula - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ForcingHistoryOutputFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.GreedyAntichainTraces +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph + +namespace OAI + + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def orderAntichainFormula {n} (Q order A : Fin n) : BoundedFormula n := + .conj (.allMem A (.mem 0 Q.succ)) + (.allMem A (.allMem A.succ (.allMem Q.succ.succ + (imp (.conj (pairMembershipFormula 0 2 order.succ.succ.succ) + (pairMembershipFormula 0 1 order.succ.succ.succ)) (.equal 2 1))))) + +theorem truth_orderAntichainFormula {n} (Q order A : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (orderAntichainFormula Q order A) env ↔ OrderAntichainCode (env Q) (env order) (env A) := by + simp only [orderAntichainFormula, Truth, truth_imp, truth_pairMembershipFormula] + constructor + · rintro ⟨subset, law⟩ + exact ⟨subset, fun p hp q hq r hr first second => law p hp q hq r hr ⟨first, second⟩⟩ + · rintro ⟨subset, law⟩ + exact ⟨subset, fun p hp q hq r hr both => law p hp q hq r hr both.1 both.2⟩ + +def relativeMaximalAntichainFormula {n} (Q order D A : Fin n) : BoundedFormula n := + .conj (.allMem A (.mem 0 D.succ)) (.conj (orderAntichainFormula Q order A) + (.allMem D (exMem A.succ (exMem Q.succ.succ + (.conj (pairMembershipFormula 0 2 order.succ.succ.succ) + (pairMembershipFormula 0 1 order.succ.succ.succ)))))) + +theorem truth_relativeMaximalAntichainFormula {n} (Q order D A : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (relativeMaximalAntichainFormula Q order D A) env ↔ + RelativeMaximalAntichainCode (env Q) (env order) (env D) (env A) := by + simp only [relativeMaximalAntichainFormula, Truth, truth_orderAntichainFormula, + truth_exMem, truth_pairMembershipFormula] + rfl + + + + + +def exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n := + exMem f (exPairFields 0 + (reindex (Fin.cases 0 (Fin.cases 1 (fun i => i.succ.succ.succ))) body)) + +theorem truth_exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2)) + (env : Fin n → ZFSet.{u}) : + Truth (exGraphFields f body) env ↔ + ∃ x y, ZFSet.pair x y ∈ env f ∧ Truth body (extend y (extend x env)) := by + simp only [exGraphFields, truth_exMem, truth_exPairFields, truth_reindex] + have rearrange (z x y : ZFSet.{u}) : + (fun i => extend y (extend x (extend z env)) + (Fin.cases 0 (Fin.cases 1 (fun j => j.succ.succ.succ)) i)) = + extend y (extend x env) := by + funext i + refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl + simp only [rearrange] + change (∃ z ∈ env f, ∃ x y, z = ZFSet.pair x y ∧ + Truth body (extend y (extend x env))) ↔ _ + constructor + · rintro ⟨z, member, x, y, rfl, holds⟩ + exact ⟨x, y, member, holds⟩ + · rintro ⟨x, y, member, holds⟩ + exact ⟨ZFSet.pair x y, member, x, y, rfl, holds⟩ + +def exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3)) : BoundedFormula n := + exPairFields z (exPairFields 0 (exPairFields 3 + (exPairFields 0 (exPairFields 0 (exPairFields 0 + (.conj (tupleShapeFormula 6 0) + (reindex (Fin.cases 9 (Fin.cases 1 (Fin.cases 7 + (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)))) body))))))) + +theorem truth_exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3)) + (env : Fin n → ZFSet.{u}) : + Truth (exLinkedCoverageFields z body) env ↔ + ∃ P G cutoff, LinkedCoverageFieldsCode (env z) P G cutoff ∧ + Truth body (extend cutoff (extend G (extend P env))) := by + simp only [exLinkedCoverageFields, truth_exPairFields, Truth, truth_tupleShapeFormula, + truth_reindex] + have rearrange (s outer cutoff serial P tail r tail' μ tail'' G rest : ZFSet.{u}) : + (fun i => extend rest (extend G (extend tail'' (extend μ (extend tail' (extend r + (extend tail (extend P (extend serial (extend cutoff (extend outer (extend s env))))))))))) + (Fin.cases 9 (Fin.cases 1 (Fin.cases 7 + (fun j => j.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ))) i)) = + extend cutoff (extend G (extend P env)) := by + funext i + refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => ?_) k) j) i <;> rfl + simp only [rearrange] + change (∃ s outer, env z = ZFSet.pair s outer ∧ ∃ cutoff serial, + outer = ZFSet.pair cutoff serial ∧ ∃ P tail, s = ZFSet.pair P tail ∧ + ∃ r tail', tail = ZFSet.pair r tail' ∧ ∃ μ tail'', tail' = ZFSet.pair μ tail'' ∧ + ∃ G rest, tail'' = ZFSet.pair G rest ∧ + (∃ fields, rest = nonemptyTupleCode 6 fields) ∧ + Truth body (extend cutoff (extend G (extend P env)))) ↔ _ + constructor + · rintro ⟨s, outer, equal, cutoff, serial, rfl, P, tail, rfl, r, tail', rfl, + μ, tail'', rfl, G, rest, rfl, ⟨fields, rfl⟩, holds⟩ + exact ⟨P, G, cutoff, ⟨r, μ, fields 0, fields 1, fields 2, fields 3, fields 4, + fields 5, fields 6, serial, equal⟩, holds⟩ + · rintro ⟨P, G, cutoff, ⟨r, μ, m, inv, one, action, bottom, top, height, serial, equal⟩, holds⟩ + let fields : Fin 7 → ZFSet.{u} := Fin.cases m (Fin.cases inv (Fin.cases one + (Fin.cases action (Fin.cases bottom (Fin.cases top (fun _ => height)))))) + refine ⟨_, _, equal, cutoff, serial, rfl, P, _, rfl, r, _, rfl, μ, _, rfl, + G, nonemptyTupleCode 6 fields, rfl, ⟨fields, rfl⟩, holds⟩ + + + + + +def exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4)) : BoundedFormula n := + exGraphFields S (.conj (.mem 1 T.succ.succ) + (exLinkedCoverageFields 0 (reindex + (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4 + (fun i => i.succ.succ.succ.succ.succ))))) body))) + +theorem truth_exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4)) + (env : Fin n → ZFSet.{u}) : + Truth (exMainLimitStageFields T S body) env ↔ + ∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ + LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env)))) := by + simp only [exMainLimitStageFields, truth_exGraphFields, Truth, truth_exLinkedCoverageFields, + truth_reindex] + have rearrange (i z P G t : ZFSet.{u}) : + (fun j => extend t (extend G (extend P (extend z (extend i env)))) + (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4 + (fun k => k.succ.succ.succ.succ.succ)))) j)) = + extend t (extend G (extend P (extend i env))) := by + funext j + refine Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => Fin.cases ?_ + (fun m => Fin.cases ?_ (fun a => ?_) m) l) k) j <;> rfl + simp only [rearrange] + change (∃ i z, ZFSet.pair i z ∈ env S ∧ i ∈ env T ∧ ∃ P G t, + LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env))))) ↔ _ + constructor + · rintro ⟨i,z,entry,member,P,G,t,shape,holds⟩ + exact ⟨i,z,P,G,t,member,entry,shape,holds⟩ + · rintro ⟨i,z,P,G,t,member,entry,shape,holds⟩ + exact ⟨i,z,entry,member,P,G,t,shape,holds⟩ + +def exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6)) : BoundedFormula n := + exMainLimitStageFields T S (exGraphFields row.succ.succ.succ.succ + (.conj (orderedPairFormula 1 T.succ.succ.succ.succ.succ.succ 5) + (exPairFields 0 (reindex (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5 + (Fin.cases 6 (Fin.cases 7 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ))))))) body)))) + +theorem truth_exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6)) + (env : Fin n → ZFSet.{u}) : + Truth (exMainLimitConeFields T S row body) env ↔ + ∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧ + Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env)))))) := by + simp only [exMainLimitConeFields, truth_exMainLimitStageFields, truth_exGraphFields, Truth, + truth_orderedPairFormula, truth_exPairFields, truth_reindex] + have rearrange (i P G t key value points actors : ZFSet.{u}) : + (fun j => extend actors (extend points (extend value (extend key (extend t + (extend G (extend P (extend i env))))))) + (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5 (Fin.cases 6 + (Fin.cases 7 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ)))))) j)) = + extend actors (extend points (extend t (extend G (extend P (extend i env))))) := by + funext j + refine Fin.cases ?_ (fun a => Fin.cases ?_ (fun b => Fin.cases ?_ (fun c => + Fin.cases ?_ (fun d => Fin.cases ?_ (fun e => Fin.cases ?_ (fun f => ?_) e) d) c) b) a) j <;> rfl + simp only [rearrange] + change (∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ LinkedCoverageFieldsCode z P G t ∧ + ∃ key value, ZFSet.pair key value ∈ env row ∧ key = ZFSet.pair (env T) i ∧ + ∃ points actors, value = ZFSet.pair points actors ∧ + Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env))))))) ↔ _ + constructor + · rintro ⟨i,z,P,G,t,member,entry,shape,key,value,rowEntry,rfl,points,actors,rfl,holds⟩ + exact ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩ + · rintro ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩ + exact ⟨i,z,P,G,t,member,entry,shape,_,_,rowEntry,rfl,points,actors,rfl,holds⟩ + + + + + +def certificateGraphEntryAt {n} (j F B f k : Fin n) : BoundedFormula n := + exGraphFields k (.conj (.equal 1 j.succ.succ) + (exPairFields 0 (.conj (.equal 1 F.succ.succ.succ.succ) + (orderedPairFormula 0 B.succ.succ.succ.succ f.succ.succ.succ.succ)))) + +theorem truth_certificateGraphEntryAt {n} (j F B f k : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (certificateGraphEntryAt j F B f k) env ↔ + ZFSet.pair (env j) (ZFSet.pair (env F) (ZFSet.pair (env B) (env f))) ∈ env k := by + simp only [certificateGraphEntryAt, truth_exGraphFields, Truth, + truth_exPairFields, truth_orderedPairFormula] + change (∃ key certificate, ZFSet.pair key certificate ∈ env k ∧ key = env j ∧ + ∃ profile tail, certificate = ZFSet.pair profile tail ∧ profile = env F ∧ + tail = ZFSet.pair (env B) (env f)) ↔ _ + constructor + · rintro ⟨key, certificate, entry, rfl, profile, tail, rfl, rfl, rfl⟩ + exact entry + · intro entry + exact ⟨env j, _, entry, rfl, env F, _, rfl, rfl, rfl⟩ + +def enumerationGraphEntryAt {n} (j e names g : Fin n) : BoundedFormula n := + exGraphFields g (.conj (.equal 1 j.succ.succ) + (orderedPairFormula 0 e.succ.succ names.succ.succ)) + +theorem truth_enumerationGraphEntryAt {n} (j e names g : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (enumerationGraphEntryAt j e names g) env ↔ + ZFSet.pair (env j) (ZFSet.pair (env e) (env names)) ∈ env g := by + simp only [enumerationGraphEntryAt, truth_exGraphFields, Truth, truth_orderedPairFormula] + change (∃ key pair, ZFSet.pair key pair ∈ env g ∧ key = env j ∧ + pair = ZFSet.pair (env e) (env names)) ↔ _ + constructor + · rintro ⟨key, pair, entry, rfl, rfl⟩ + exact entry + · intro entry + exact ⟨env j, _, entry, rfl, rfl⟩ + + + + + +def relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n) : BoundedFormula n := + exGraphFields domains (.conj (.equal 1 j.succ.succ) + (relativeMaximalAntichainFormula Q.succ.succ order.succ.succ 0 A.succ.succ)) + +theorem truth_relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (relativeAntichainFamilyFormula j A Q order domains) env ↔ + ∃ D, ZFSet.pair (env j) D ∈ env domains ∧ + RelativeMaximalAntichainCode (env Q) (env order) D (env A) := by + simp only [relativeAntichainFamilyFormula, truth_exGraphFields, Truth, + truth_relativeMaximalAntichainFormula] + change (∃ key D, ZFSet.pair key D ∈ env domains ∧ key = env j ∧ + RelativeMaximalAntichainCode (env Q) (env order) D (env A)) ↔ _ + constructor + · rintro ⟨key, D, entry, rfl, code⟩ + exact ⟨D, entry, code⟩ + · rintro ⟨D, entry, code⟩ + exact ⟨env j, D, entry, rfl, code⟩ + + + + + +def assignmentQueryWithinFormula {n} (X T q : Fin n) : BoundedFormula n := + exPairFields q (stageOneAssignmentsSubsetFormula 0 X.succ.succ T.succ.succ) + +theorem truth_assignmentQueryWithinFormula {n} (X T q : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (assignmentQueryWithinFormula X T q) env ↔ + AssignmentQueryWithin (env X) (env T) (env q) := by + simp only [assignmentQueryWithinFormula, truth_exPairFields, + truth_stageOneAssignmentsSubsetFormula] + rfl + +def representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n) : BoundedFormula n := + .conj (.mem i I) (exMem Q + (.conj (assignmentQueryWithinFormula X.succ T.succ 0) + (exGraphFields c.succ (.conj (.equal 1 2) + (exPairFields 0 + (exMem T.succ.succ.succ.succ.succ + (exMem T.succ.succ.succ.succ.succ.succ + (exMem 2 (stageOneAssignmentFormula 0 + i.succ.succ.succ.succ.succ.succ.succ.succ 2 1))))))))) + +theorem truth_representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (representativeIndexAdditionsMemberFormula i I T Q c X) env ↔ + env i ∈ representativeIndexAdditions (env I) (env T) (env Q) (env c) (env X) := by + simp only [representativeIndexAdditionsMemberFormula, Truth, truth_exMem, + truth_assignmentQueryWithinFormula, truth_exGraphFields, truth_exPairFields, + truth_stageOneAssignmentFormula] + rw [mem_representativeIndexAdditions] + change (env i ∈ env I ∧ ∃ q ∈ env Q, AssignmentQueryWithin (env X) (env T) q ∧ + ∃ key value, ZFSet.pair key value ∈ env c ∧ key = q ∧ + ∃ row A, value = ZFSet.pair row A ∧ ∃ v ∈ env T, ∃ w ∈ env T, + ∃ z ∈ A, z = stageOneAssignment (env i) v w) ↔ _ + apply and_congr Iff.rfl + constructor + · rintro ⟨q, hq, localQuery, key, value, entry, rfl, row, A, rfl, v, hv, w, hw, z, hz, rfl⟩ + exact ⟨key, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩ + · rintro ⟨q, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩ + exact ⟨q, hq, localQuery, q, ZFSet.pair row A, entry, rfl, row, A, rfl, + v, hv, w, hw, stageOneAssignment (env i) v w, hz, rfl⟩ + + + + + +def supportedCertificateFormula {n} + (nodes N order R niceEval visibilityEval value F B f : Fin n) : BoundedFormula n := + .conj (.allMem F (.mem 0 nodes.succ)) + (.conj (.allMem B (.mem 0 F.succ)) + (.conj (.allMem F (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ))) + (.conj (functionFormula B N f) + (.conj + (.neg (exGraphFields visibilityEval + (.conj (.mem 1 nodes.succ.succ) + (.neg (.conj (imp (.mem value.succ.succ 0) (.mem 1 F.succ.succ)) + (imp (.mem 1 F.succ.succ) (.mem value.succ.succ 0))))))) + (.allMem B (.allMem N.succ + (imp (pairMembershipFormula 1 0 f.succ.succ) + (.conj (pairMembershipFormula 1 0 R.succ.succ) + (pairMembershipFormula 0 value.succ.succ niceEval.succ.succ))))))))) + +theorem truth_supportedCertificateFormula {n} + (nodes N order R niceEval visibilityEval value F B f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (supportedCertificateFormula nodes N order R niceEval visibilityEval value F B f) env ↔ + SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) + (env niceEval) (env visibilityEval) (env value) (env F) (env B) (env f) := by + classical + simp only [supportedCertificateFormula, Truth, truth_exMem, truth_pairMembershipFormula, + truth_functionFormula, truth_exGraphFields, truth_imp, not_exists, not_and, not_not, + ← iff_def] + rfl + +def supportedCertificateEntryFormula {n} + (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) : + BoundedFormula n := + exPairFields entry (exPairFields 0 (exPairFields 0 + (.conj (.mem 5 J.succ.succ.succ.succ.succ.succ) + (.conj (.mem 3 PF.succ.succ.succ.succ.succ.succ) + (.conj (.mem 1 PB.succ.succ.succ.succ.succ.succ) + (.conj (.mem 0 WF.succ.succ.succ.succ.succ.succ) + (exGraphFields inputEval.succ.succ.succ.succ.succ.succ + (.conj (.equal 1 7) + (supportedCertificateFormula + nodes.succ.succ.succ.succ.succ.succ.succ.succ + N.succ.succ.succ.succ.succ.succ.succ.succ + order.succ.succ.succ.succ.succ.succ.succ.succ + R.succ.succ.succ.succ.succ.succ.succ.succ + niceEval.succ.succ.succ.succ.succ.succ.succ.succ + visibilityEval.succ.succ.succ.succ.succ.succ.succ.succ + 0 5 3 2))))))))) + +theorem truth_supportedCertificateEntryFormula {n} + (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (supportedCertificateEntryFormula entry J PF PB WF nodes N order R + inputEval niceEval visibilityEval) env ↔ + ∃ j ∈ env J, ∃ F ∈ env PF, ∃ B ∈ env PB, ∃ f ∈ env WF, + env entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧ + ∃ value, ZFSet.pair j value ∈ env inputEval ∧ + SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) + (env niceEval) (env visibilityEval) value F B f := by + simp only [supportedCertificateEntryFormula, truth_exPairFields, Truth, + truth_exGraphFields, truth_supportedCertificateFormula] + change (∃ j tail, env entry = ZFSet.pair j tail ∧ + ∃ F rest, tail = ZFSet.pair F rest ∧ + ∃ B f, rest = ZFSet.pair B f ∧ + j ∈ env J ∧ F ∈ env PF ∧ B ∈ env PB ∧ f ∈ env WF ∧ + ∃ j' value, ZFSet.pair j' value ∈ env inputEval ∧ j' = j ∧ + SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) + (env niceEval) (env visibilityEval) value F B f) ↔ _ + constructor + · rintro ⟨j, tail, equal, F, rest, rfl, B, f, rfl, hj, hF, hB, hf, + j', value, evaluated, rfl, certificate⟩ + exact ⟨j', hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩ + · rintro ⟨j, hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩ + exact ⟨j, _, equal, F, _, rfl, B, f, rfl, hj, hF, hB, hf, + j, value, evaluated, rfl, certificate⟩ + + + + + +def exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n) + (body : BoundedFormula (n + 1)) : BoundedFormula n := + exMainLimitConeFields T S row (exGraphFields (if actor then 0 else 1) + (.conj (.mem 1 (if actor then 5 else 6)) + (reindex (Fin.cases 0 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ)) body))) + +theorem truth_exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n) + (body : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) : + Truth (exMainLimitImageFields actor T S row body) env ↔ + ∃ x, (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) x + else MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧ Truth body (extend x env) := by + simp only [exMainLimitImageFields, truth_exMainLimitConeFields, truth_exGraphFields, Truth, truth_reindex] + have rearrange (i P G t points actors y x : ZFSet.{u}) : + (fun j => extend x (extend y (extend actors (extend points (extend t + (extend G (extend P (extend i env))))))) + (Fin.cases 0 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ) j)) = extend x env := by + funext j + refine Fin.cases ?_ (fun k => ?_) j <;> rfl + simp only [rearrange] + cases actor <;> simp only [Bool.false_eq_true, ite_false, ite_true] + · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧ + ∃ y x, ZFSet.pair y x ∈ points ∧ y ∈ P ∧ Truth body (extend x env)) ↔ _ + constructor + · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ + exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ + · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ + exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ + · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧ + ∃ y x, ZFSet.pair y x ∈ actors ∧ y ∈ G ∧ Truth body (extend x env)) ↔ _ + constructor + · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ + exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ + · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩ + exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩ + +def mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n) : BoundedFormula n := + exMainLimitImageFields actor T S row (.equal 0 x.succ) + +theorem truth_mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n) + (env : Fin n → ZFSet.{u}) : Truth (mainLimitImageFormula actor T S row x) env ↔ + (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) (env x) + else MainLimitOldPointImageCode (env T) (env S) (env row) (env x)) := by + rw [mainLimitImageFormula, truth_exMainLimitImageFields] + change (∃ y, _ ∧ y = env x) ↔ _ + constructor + · rintro ⟨y, member, rfl⟩ + exact member + · exact fun member => ⟨env x, member, rfl⟩ + +def mainLimitOldCutoffFormula {n} (T S t : Fin n) : BoundedFormula n := + exMainLimitStageFields T S (disj (.equal t.succ.succ.succ.succ 0) + (.mem t.succ.succ.succ.succ 0)) + +theorem truth_mainLimitOldCutoffFormula {n} (T S t : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (mainLimitOldCutoffFormula T S t) env ↔ MainLimitOldCutoffCode (env T) (env S) (env t) := by + simp only [mainLimitOldCutoffFormula, truth_exMainLimitStageFields, truth_disj, Truth] + change (∃ i z P G cutoff, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ + LinkedCoverageFieldsCode z P G cutoff ∧ (env t = cutoff ∨ env t ∈ cutoff)) ↔ _ + constructor + · rintro ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩ + exact ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩ + · rintro ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩ + exact ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩ + + + + + +def mainLimitPointCoverageFormula {n} (T S row Q top : Fin n) : BoundedFormula n := + .conj (.allMem Q (imp (.neg (.equal 0 top.succ)) + (mainLimitImageFormula false T.succ S.succ row.succ 0))) + (.neg (exMainLimitImageFields false T S row + (.neg (.conj (.mem 0 Q.succ) (.neg (.equal 0 top.succ)))))) + +theorem truth_mainLimitPointCoverageFormula {n} (T S row Q top : Fin n) + (env : Fin n → ZFSet.{u}) : Truth (mainLimitPointCoverageFormula T S row Q top) env ↔ + ∀ x, (x ∈ env Q ∧ x ≠ env top) ↔ MainLimitOldPointImageCode (env T) (env S) (env row) x := by + classical + simp only [mainLimitPointCoverageFormula, Truth, truth_imp, truth_mainLimitImageFormula, + truth_exMainLimitImageFields, Bool.false_eq_true, ite_false, not_exists, not_and, not_not, Classical.not_imp] + change ((∀ x ∈ env Q, x ≠ env top → MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧ + ∀ x, MainLimitOldPointImageCode (env T) (env S) (env row) x → x ∈ env Q ∧ x ≠ env top) ↔ _ + constructor + · rintro ⟨forward, reverse⟩ x + exact ⟨fun h => forward x h.1 h.2, reverse x⟩ + · intro laws + exact ⟨fun x member different => (laws x).1 ⟨member,different⟩, fun x => (laws x).2⟩ + +def mainLimitActorCoverageFormula {n} (T S row H : Fin n) : BoundedFormula n := + .conj (.allMem H (mainLimitImageFormula true T.succ S.succ row.succ 0)) + (.neg (exMainLimitImageFields true T S row (.neg (.mem 0 H.succ)))) + +theorem truth_mainLimitActorCoverageFormula {n} (T S row H : Fin n) + (env : Fin n → ZFSet.{u}) : Truth (mainLimitActorCoverageFormula T S row H) env ↔ + ∀ g, g ∈ env H ↔ MainLimitOldActorImageCode (env T) (env S) (env row) g := by + classical + simp only [mainLimitActorCoverageFormula, Truth, truth_mainLimitImageFormula, + truth_exMainLimitImageFields, ite_true, not_exists, not_and, not_not] + change ((∀ g ∈ env H, MainLimitOldActorImageCode (env T) (env S) (env row) g) ∧ + ∀ g, MainLimitOldActorImageCode (env T) (env S) (env row) g → g ∈ env H) ↔ _ + exact ⟨fun h g => ⟨h.1 g,h.2 g⟩, fun h => ⟨fun g => (h g).1,fun g => (h g).2⟩⟩ + +def mainLimitStrictTopFormula {n} (T S row R top : Fin n) : BoundedFormula n := + .neg (exMainLimitConeFields T S row (exGraphFields 1 (.neg + (.conj (pairMembershipFormula 0 top.succ.succ.succ.succ.succ.succ.succ.succ + R.succ.succ.succ.succ.succ.succ.succ.succ) + (.neg (pairMembershipFormula top.succ.succ.succ.succ.succ.succ.succ.succ 0 + R.succ.succ.succ.succ.succ.succ.succ.succ)))))) + +theorem truth_mainLimitStrictTopFormula {n} (T S row R top : Fin n) + (env : Fin n → ZFSet.{u}) : Truth (mainLimitStrictTopFormula T S row R top) env ↔ + ∀ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors → + ∀ x y, ZFSet.pair x y ∈ points → ZFSet.pair y (env top) ∈ env R ∧ + ZFSet.pair (env top) y ∉ env R := by + classical + simp only [mainLimitStrictTopFormula, Truth, truth_exMainLimitConeFields, + truth_exGraphFields, truth_pairMembershipFormula, not_exists, not_and, not_not, Classical.not_imp] + rfl + +def mainLimitCutoffFormula {n} (T S cutoff : Fin n) : BoundedFormula n := + .conj (.allMem cutoff (mainLimitOldCutoffFormula T.succ S.succ 0)) + (.neg (exMainLimitStageFields T S (.neg + (.conj (.mem 0 cutoff.succ.succ.succ.succ) + (.allMem 0 (.mem 0 cutoff.succ.succ.succ.succ.succ)))))) + +theorem truth_mainLimitCutoffFormula {n} (T S cutoff : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (mainLimitCutoffFormula T S cutoff) env ↔ + ∀ t, t ∈ env cutoff ↔ MainLimitOldCutoffCode (env T) (env S) t := by + classical + simp only [mainLimitCutoffFormula, Truth, truth_mainLimitOldCutoffFormula, + truth_exMainLimitStageFields, not_exists, not_and, not_not, Classical.not_imp] + change ((∀ t ∈ env cutoff, MainLimitOldCutoffCode (env T) (env S) t) ∧ + ∀ i z P G t, i ∈ env T → ZFSet.pair i z ∈ env S → LinkedCoverageFieldsCode z P G t → + t ∈ env cutoff ∧ ∀ s ∈ t, s ∈ env cutoff) ↔ _ + constructor + · rintro ⟨forward,bound⟩ t + refine ⟨forward t, ?_⟩ + rintro ⟨i,member,z,entry,P,G,s,shape,equal | lower⟩ + · exact equal.symm ▸ (bound i z P G s member entry shape).1 + · exact (bound i z P G s member entry shape).2 t lower + · intro laws + refine ⟨fun t => (laws t).1, ?_⟩ + intro i z P G t member entry shape + exact ⟨(laws t).2 ⟨i,member,z,entry,P,G,t,shape,Or.inl rfl⟩, + fun s lower => (laws s).2 ⟨i,member,z,entry,P,G,t,shape,Or.inr lower⟩⟩ + +def mainLimitTopBirthFormula {n} (top cutoff birth : Fin n) : BoundedFormula n := + .conj (pairMembershipFormula top cutoff birth) + (.neg (exGraphFields birth (.conj (.equal 0 cutoff.succ.succ) + (.neg (.equal 1 top.succ.succ))))) + +theorem truth_mainLimitTopBirthFormula {n} (top cutoff birth : Fin n) + (env : Fin n → ZFSet.{u}) : Truth (mainLimitTopBirthFormula top cutoff birth) env ↔ + ∀ x, ZFSet.pair x (env cutoff) ∈ env birth ↔ x = env top := by + classical + simp only [mainLimitTopBirthFormula, Truth, truth_pairMembershipFormula, + truth_exGraphFields, not_exists, not_and, not_not] + change (ZFSet.pair (env top) (env cutoff) ∈ env birth ∧ + ∀ x t, ZFSet.pair x t ∈ env birth → t = env cutoff → x = env top) ↔ _ + constructor + · rintro ⟨entry,unique⟩ x + exact ⟨fun image => unique x (env cutoff) image rfl, fun equal => equal.symm ▸ entry⟩ + · intro laws + exact ⟨(laws (env top)).2 rfl, fun x t image equal => (laws x).1 (equal ▸ image)⟩ + +def mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n) : BoundedFormula n := + .conj (mainLimitPointCoverageFormula T S row Q top) + (.conj (mainLimitActorCoverageFormula T S row H) + (.conj (mainLimitStrictTopFormula T S row R top) + (.conj (mainLimitCutoffFormula T S cutoff) (mainLimitTopBirthFormula top cutoff birth)))) + +theorem truth_mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n) + (env : Fin n → ZFSet.{u}) : Truth (mainLimitCoverageFormula T S row Q H R top cutoff birth) env ↔ + MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R) + (env top) (env cutoff) (env birth) := by + simp only [mainLimitCoverageFormula, Truth, truth_mainLimitPointCoverageFormula, + truth_mainLimitActorCoverageFormula, truth_mainLimitStrictTopFormula, + truth_mainLimitCutoffFormula, truth_mainLimitTopBirthFormula] + exact ⟨fun h => ⟨h.1,h.2.1,h.2.2.1,h.2.2.2.1,h.2.2.2.2⟩, + fun h => ⟨h.points,h.actors,h.strict_top,h.cutoff_mem,h.top_birth⟩⟩ + +theorem realize_mainLimitCoverageFormula (M : TransitiveGround.{u}) {n} + (T S row Q H R top cutoff birth : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (mainLimitCoverageFormula T S row Q H R top cutoff birth).toFormula env ↔ + MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R) + (env top) (env cutoff) (env birth) := + (realize_toFormula M _ env members).trans (truth_mainLimitCoverageFormula T S row Q H R top cutoff birth env) + +end PartitionPilot.Forcing.BoundedFormula + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixTraceStepFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixTraceStepFormulas.lean index 9d9aba75a02c47f1c02a8e47d3e2eec969660872..41078644cdf639081dd3a606f195e698b4090002 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixTraceStepFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixTraceStepFormulas.lean @@ -1,164 +1,164 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def mainPrefixAtIndexFormula {n} (T q : Fin n) : SetFormula n := - exBlock 2 (BoundedFormula.mainPrefixTupleFormula (suffixIndex n 2 q) - (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula - -def mainPrefixAtSuccessorFormula {n} (α q : Fin n) : SetFormula n := - ex (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula - (mainPrefixAtIndexFormula 0 q.succ)) - -def mainPrefixHistoryExtendsFormula {n} (p q : Fin n) : SetFormula n := - .all (.all (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula - (mainPrefixExtensionFormula 0 q.succ.succ))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixAtIndexFormula {n} (T q : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixAtIndexFormula T q) env ↔ MainPrefixAtIndex (env T) (env q) := by - rw [mainPrefixAtIndexFormula, realize_exBlock] - have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) := - BoundedFormula.realize_mainPrefixTupleFormula M (suffixIndex n 2 q) - (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1) - (extendMany 2 f env) (extendMany_members 2 f env ground members) - simp only [extendMany_prefix, extendMany_suffix] at actual - constructor - · rintro ⟨f, ground, recognized⟩ - exact ⟨f 0, f 1, (actual f ground).1 recognized⟩ - · rintro ⟨S, E, encoded⟩ - have fields := M.mainPrefixCode_fields_mem (encoded ▸ members q) - let f : Fin 2 → ZFSet.{u} := Fin.cases S (fun _ => E) - have ground : ∀ j, f j ∈ M.sets := Fin.cases fields.2.1 (fun _ => fields.2.2) - exact ⟨f, ground, (actual f ground).2 encoded⟩ - -theorem realize_mainPrefixAtSuccessorFormula {n} (α q : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixAtSuccessorFormula α q) env ↔ - MainPrefixAtIndex (insert (env α) (env α)) (env q) := by - rw [mainPrefixAtSuccessorFormula, realize_ex] - have actual T (ground : T ∈ M.sets) : - Realize M.sets (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula - (mainPrefixAtIndexFormula 0 q.succ)) (extend T env) ↔ - T = insert (env α) (env α) ∧ MainPrefixAtIndex T (env q) := by - change (_ ∧ _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members), - BoundedFormula.truth_successorFormula, - M.realize_mainPrefixAtIndexFormula _ _ _ (Fin.cases ground members)] - rfl - constructor - · rintro ⟨T, ground, recognized⟩ - obtain ⟨rfl, code⟩ := (actual T ground).1 recognized - exact code - · intro code - obtain ⟨S, E, equal⟩ := code - have ground := (M.mainPrefixCode_fields_mem (equal ▸ members q)).1 - exact ⟨_, ground, (actual _ ground).2 ⟨rfl, S, E, equal⟩⟩ - -theorem realize_mainPrefixHistoryExtendsFormula {n} (p q : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixHistoryExtendsFormula p q) env ↔ - MainPrefixHistoryExtends (env p) (env q) := by - change (∀ i ∈ M.sets, ∀ old ∈ M.sets, Realize M.sets - (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula - (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env))) ↔ _ - have actual i old (hi : i ∈ M.sets) (ho : old ∈ M.sets) : - Realize M.sets - (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula - (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env)) ↔ - (ZFSet.pair i old ∈ env p → MainPrefixExtends old (env q)) := by - rw [realize_imp, BoundedFormula.realize_toFormula M _ _ (Fin.cases ho (Fin.cases hi members)), - BoundedFormula.truth_pairMembershipFormula, - M.realize_mainPrefixExtensionFormula _ _ _ (Fin.cases ho (Fin.cases hi members))] - rfl - constructor - · intro recognized i old entry - have pairGround := M.transitive (members p) entry - exact (actual i old (M.pair_left pairGround) (M.pair_right pairGround)).1 - (recognized i (M.pair_left pairGround) old (M.pair_right pairGround)) entry - · intro history i hi old ho - exact (actual i old hi ho).2 (history i old) - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n) : SetFormula n := - disj (.conj (BoundedFormula.emptyFormula α).toFormula (.equal y seed)) - (.conj (.neg (BoundedFormula.emptyFormula α).toFormula) - (ex (.conj (mainPrefixHistoryUnionFormula p.succ 0) - (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula))) - -def mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n) : SetFormula n := - .conj (.mem y B) (.conj (mainPrefixAtSuccessorFormula α y) - (.conj (mainPrefixHistoryExtendsFormula p y) (mainPrefixTraceBranchFormula seed g α p y))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixTraceBranchFormula seed g α p y) env ↔ - ((env α = ∅ ∧ env y = env seed) ∨ (env α ≠ ∅ ∧ - ∃ input, MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g)) := by - have empty := (BoundedFormula.realize_toFormula M (BoundedFormula.emptyFormula α) env members).trans - (BoundedFormula.truth_emptyFormula α env) - rw [mainPrefixTraceBranchFormula, realize_disj] - change ((_ ∧ _) ∨ ((¬ _) ∧ _)) ↔ _ - rw [empty] - apply or_congr Iff.rfl - apply and_congr Iff.rfl - rw [realize_ex] - have actual input (ground : input ∈ M.sets) : - Realize M.sets (.conj (mainPrefixHistoryUnionFormula p.succ 0) - (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula) (extend input env) ↔ - MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g := by - change (_ ∧ _) ↔ _ - rw [M.realize_mainPrefixHistoryUnionFormula _ _ _ (Fin.cases ground members), - BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members), - BoundedFormula.truth_pairMembershipFormula] - rfl - constructor - · rintro ⟨input, ground, recognized⟩ - exact ⟨input, (actual input ground).1 recognized⟩ - · rintro ⟨input, union, entry⟩ - have ground := M.pair_left (M.transitive (members g) entry) - exact ⟨input, ground, (actual input ground).2 ⟨union, entry⟩⟩ - -theorem realize_mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixTraceStepFormula B seed g α p y) env ↔ - MainPrefixTraceStepCode (env B) (env seed) (env g) (env α) (env p) (env y) := by - unfold mainPrefixTraceStepFormula MainPrefixTraceStepCode - change (_ ∧ _ ∧ _ ∧ _) ↔ _ - rw [M.realize_mainPrefixAtSuccessorFormula _ _ _ members, - M.realize_mainPrefixHistoryExtendsFormula _ _ _ members, - M.realize_mainPrefixTraceBranchFormula _ _ _ _ _ _ members] - rfl - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def mainPrefixAtIndexFormula {n} (T q : Fin n) : SetFormula n := + exBlock 2 (BoundedFormula.mainPrefixTupleFormula (suffixIndex n 2 q) + (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula + +def mainPrefixAtSuccessorFormula {n} (α q : Fin n) : SetFormula n := + ex (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula + (mainPrefixAtIndexFormula 0 q.succ)) + +def mainPrefixHistoryExtendsFormula {n} (p q : Fin n) : SetFormula n := + .all (.all (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula + (mainPrefixExtensionFormula 0 q.succ.succ))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixAtIndexFormula {n} (T q : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixAtIndexFormula T q) env ↔ MainPrefixAtIndex (env T) (env q) := by + rw [mainPrefixAtIndexFormula, realize_exBlock] + have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) := + BoundedFormula.realize_mainPrefixTupleFormula M (suffixIndex n 2 q) + (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1) + (extendMany 2 f env) (extendMany_members 2 f env ground members) + simp only [extendMany_prefix, extendMany_suffix] at actual + constructor + · rintro ⟨f, ground, recognized⟩ + exact ⟨f 0, f 1, (actual f ground).1 recognized⟩ + · rintro ⟨S, E, encoded⟩ + have fields := M.mainPrefixCode_fields_mem (encoded ▸ members q) + let f : Fin 2 → ZFSet.{u} := Fin.cases S (fun _ => E) + have ground : ∀ j, f j ∈ M.sets := Fin.cases fields.2.1 (fun _ => fields.2.2) + exact ⟨f, ground, (actual f ground).2 encoded⟩ + +theorem realize_mainPrefixAtSuccessorFormula {n} (α q : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixAtSuccessorFormula α q) env ↔ + MainPrefixAtIndex (insert (env α) (env α)) (env q) := by + rw [mainPrefixAtSuccessorFormula, realize_ex] + have actual T (ground : T ∈ M.sets) : + Realize M.sets (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula + (mainPrefixAtIndexFormula 0 q.succ)) (extend T env) ↔ + T = insert (env α) (env α) ∧ MainPrefixAtIndex T (env q) := by + change (_ ∧ _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members), + BoundedFormula.truth_successorFormula, + M.realize_mainPrefixAtIndexFormula _ _ _ (Fin.cases ground members)] + rfl + constructor + · rintro ⟨T, ground, recognized⟩ + obtain ⟨rfl, code⟩ := (actual T ground).1 recognized + exact code + · intro code + obtain ⟨S, E, equal⟩ := code + have ground := (M.mainPrefixCode_fields_mem (equal ▸ members q)).1 + exact ⟨_, ground, (actual _ ground).2 ⟨rfl, S, E, equal⟩⟩ + +theorem realize_mainPrefixHistoryExtendsFormula {n} (p q : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixHistoryExtendsFormula p q) env ↔ + MainPrefixHistoryExtends (env p) (env q) := by + change (∀ i ∈ M.sets, ∀ old ∈ M.sets, Realize M.sets + (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula + (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env))) ↔ _ + have actual i old (hi : i ∈ M.sets) (ho : old ∈ M.sets) : + Realize M.sets + (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula + (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env)) ↔ + (ZFSet.pair i old ∈ env p → MainPrefixExtends old (env q)) := by + rw [realize_imp, BoundedFormula.realize_toFormula M _ _ (Fin.cases ho (Fin.cases hi members)), + BoundedFormula.truth_pairMembershipFormula, + M.realize_mainPrefixExtensionFormula _ _ _ (Fin.cases ho (Fin.cases hi members))] + rfl + constructor + · intro recognized i old entry + have pairGround := M.transitive (members p) entry + exact (actual i old (M.pair_left pairGround) (M.pair_right pairGround)).1 + (recognized i (M.pair_left pairGround) old (M.pair_right pairGround)) entry + · intro history i hi old ho + exact (actual i old hi ho).2 (history i old) + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n) : SetFormula n := + disj (.conj (BoundedFormula.emptyFormula α).toFormula (.equal y seed)) + (.conj (.neg (BoundedFormula.emptyFormula α).toFormula) + (ex (.conj (mainPrefixHistoryUnionFormula p.succ 0) + (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula))) + +def mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n) : SetFormula n := + .conj (.mem y B) (.conj (mainPrefixAtSuccessorFormula α y) + (.conj (mainPrefixHistoryExtendsFormula p y) (mainPrefixTraceBranchFormula seed g α p y))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixTraceBranchFormula seed g α p y) env ↔ + ((env α = ∅ ∧ env y = env seed) ∨ (env α ≠ ∅ ∧ + ∃ input, MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g)) := by + have empty := (BoundedFormula.realize_toFormula M (BoundedFormula.emptyFormula α) env members).trans + (BoundedFormula.truth_emptyFormula α env) + rw [mainPrefixTraceBranchFormula, realize_disj] + change ((_ ∧ _) ∨ ((¬ _) ∧ _)) ↔ _ + rw [empty] + apply or_congr Iff.rfl + apply and_congr Iff.rfl + rw [realize_ex] + have actual input (ground : input ∈ M.sets) : + Realize M.sets (.conj (mainPrefixHistoryUnionFormula p.succ 0) + (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula) (extend input env) ↔ + MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g := by + change (_ ∧ _) ↔ _ + rw [M.realize_mainPrefixHistoryUnionFormula _ _ _ (Fin.cases ground members), + BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members), + BoundedFormula.truth_pairMembershipFormula] + rfl + constructor + · rintro ⟨input, ground, recognized⟩ + exact ⟨input, (actual input ground).1 recognized⟩ + · rintro ⟨input, union, entry⟩ + have ground := M.pair_left (M.transitive (members g) entry) + exact ⟨input, ground, (actual input ground).2 ⟨union, entry⟩⟩ + +theorem realize_mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixTraceStepFormula B seed g α p y) env ↔ + MainPrefixTraceStepCode (env B) (env seed) (env g) (env α) (env p) (env y) := by + unfold mainPrefixTraceStepFormula MainPrefixTraceStepCode + change (_ ∧ _ ∧ _ ∧ _) ↔ _ + rw [M.realize_mainPrefixAtSuccessorFormula _ _ _ members, + M.realize_mainPrefixHistoryExtendsFormula _ _ _ members, + M.realize_mainPrefixTraceBranchFormula _ _ _ _ _ _ members] + rfl + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixValidityFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixValidityFormulas.lean index 954697df08d2c76e9edaf8fa990246d09cb19d30..f43ab8092cc76efecddc4cb1db799c9bc53e0bbd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixValidityFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixValidityFormulas.lean @@ -1,241 +1,241 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageLevels - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace BoundedFormula - -def pairedTransitionEntryFormula {n} (i j p a E : Fin n) : BoundedFormula n := - exMem E (exMem 0 (exMem 0 (.conj - (orderedPairFormula 0 p.succ.succ.succ a.succ.succ.succ) - (orderedTripleFormula 2 j.succ.succ.succ i.succ.succ.succ 0)))) - -theorem truth_pairedTransitionEntryFormula {n} (i j p a E : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (pairedTransitionEntryFormula i j p a E) env ↔ - ZFSet.pair (ZFSet.pair (env j) (env i)) (ZFSet.pair (env p) (env a)) ∈ env E := by - simp only [pairedTransitionEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_orderedTripleFormula] - change (∃ w ∈ env E, ∃ b ∈ w, ∃ c ∈ b, c = ZFSet.pair (env p) (env a) ∧ - w = ZFSet.pair (ZFSet.pair (env j) (env i)) c) ↔ _ - constructor - · rintro ⟨w, hw, b, _, c, _, rfl, rfl⟩ - exact hw - · intro entry - refine ⟨_, entry, {ZFSet.pair (env j) (env i), ZFSet.pair (env p) (env a)}, - ZFSet.mem_pair.2 (Or.inr rfl), _, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩ - -end BoundedFormula - -namespace SetFormula - -def mainPrefixIdentityFormula {n} (E : Fin n) : SetFormula n := - let v := prefixIndex n 3 - allBlock 3 (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 0) (v 1) (v 2) (suffixIndex n 3 E)) - (.conj (BoundedFormula.graphDiagonalFormula (v 1)) - (BoundedFormula.graphDiagonalFormula (v 2)))).toFormula - -def mainPrefixCompositionFormula {n} (E : Fin n) : SetFormula n := - let v := prefixIndex n 9 - let old := suffixIndex n 9 E - allBlock 9 (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 1) (v 3) (v 4) old) - (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (v 1) (v 2) (v 5) (v 6) old) - (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 2) (v 7) (v 8) old) - (.conj (BoundedFormula.graphCompositionFormula (v 3) (v 5) (v 7)) - (BoundedFormula.graphCompositionFormula (v 4) (v 6) (v 8)))))).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixIdentityFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixIdentityFormula E) env ↔ - ∀ i p a, ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ env E → - GraphDiagonalCode p ∧ GraphDiagonalCode a := by - rw [mainPrefixIdentityFormula, realize_allBlock] - have actual (fields : Fin 3 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := - BoundedFormula.realize_toFormula M - (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 3 0) (prefixIndex n 3 0) - (prefixIndex n 3 1) (prefixIndex n 3 2) (suffixIndex n 3 E)) - (.conj (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 1)) - (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 2)))) - (extendMany 3 fields env) (extendMany_members 3 fields env ground members) - simp only [BoundedFormula.truth_imp, BoundedFormula.Truth, - BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphDiagonalFormula, - extendMany_prefix, extendMany_suffix] at actual - constructor - · intro recognized i p a entry - have hg := M.transitive (members E) entry - let fields : Fin 3 → ZFSet.{u} := Fin.cases i (Fin.cases p (fun _ => a)) - have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left (M.pair_left hg)) - (Fin.cases (M.pair_left (M.pair_right hg)) (fun _ => M.pair_right (M.pair_right hg))) - exact (actual fields ground).1 (recognized fields ground) entry - · intro law fields ground - exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2)) - -theorem realize_mainPrefixCompositionFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixCompositionFormula E) env ↔ - ∀ i j k p₁ a₁ p₂ a₂ p₃ a₃, - ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ env E → - ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ env E → - ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ env E → - GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ := by - rw [mainPrefixCompositionFormula, realize_allBlock] - have actual (fields : Fin 9 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := - BoundedFormula.realize_toFormula M - (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 1) - (prefixIndex n 9 3) (prefixIndex n 9 4) (suffixIndex n 9 E)) - (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 1) (prefixIndex n 9 2) - (prefixIndex n 9 5) (prefixIndex n 9 6) (suffixIndex n 9 E)) - (BoundedFormula.imp - (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 2) - (prefixIndex n 9 7) (prefixIndex n 9 8) (suffixIndex n 9 E)) - (.conj (BoundedFormula.graphCompositionFormula (prefixIndex n 9 3) (prefixIndex n 9 5) (prefixIndex n 9 7)) - (BoundedFormula.graphCompositionFormula (prefixIndex n 9 4) (prefixIndex n 9 6) (prefixIndex n 9 8)))))) - (extendMany 9 fields env) (extendMany_members 9 fields env ground members) - simp only [BoundedFormula.truth_imp, BoundedFormula.Truth, - BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphCompositionFormula, - extendMany_prefix, extendMany_suffix] at actual - constructor - · intro recognized i j k p₁ a₁ p₂ a₂ p₃ a₃ first second third - have h₁ := M.transitive (members E) first - have h₂ := M.transitive (members E) second - have h₃ := M.transitive (members E) third - let fields : Fin 9 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases k (Fin.cases p₁ - (Fin.cases a₁ (Fin.cases p₂ (Fin.cases a₂ (Fin.cases p₃ (fun _ => a₃)))))))) - have ground : ∀ a, fields a ∈ M.sets := Fin.cases (M.pair_right (M.pair_left h₁)) - (Fin.cases (M.pair_left (M.pair_left h₁)) (Fin.cases (M.pair_left (M.pair_left h₂)) - (Fin.cases (M.pair_left (M.pair_right h₁)) (Fin.cases (M.pair_right (M.pair_right h₁)) - (Fin.cases (M.pair_left (M.pair_right h₂)) (Fin.cases (M.pair_right (M.pair_right h₂)) - (Fin.cases (M.pair_left (M.pair_right h₃)) (fun _ => M.pair_right (M.pair_right h₃))))))))) - exact (actual fields ground).1 (recognized fields ground) first second third - · intro law fields ground - exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2) (fields 3) - (fields 4) (fields 5) (fields 6) (fields 7) (fields 8)) - -end TransitiveGround - -namespace SetFormula - -def mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n) : SetFormula n := - let old := suffixIndex n 2 - let v := prefixIndex n 2 - allBlock 2 (imp (BoundedFormula.pairMembershipFormula (v 0) (v 1) (old S)).toFormula - (linkedMainStageFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) (v 1))) - -def mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n) : SetFormula n := - let old := suffixIndex n 5 - let v := prefixIndex n 5 - allBlock 5 (imp (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old S)) - (.conj (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old S)) - (BoundedFormula.tripleMembershipFormula (v 1) (v 0) (v 4) (old E)))).toFormula - (linkedMainTransitionFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (v 2) (v 3) (v 4))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem realize_mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixStagesFormula K Labels C D rD N S) env ↔ - ∀ i a, ZFSet.pair i a ∈ env S → - ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD), - linked.code = a := by - rw [mainPrefixStagesFormula, realize_allBlock] - have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : - Realize M.sets - (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1) - (suffixIndex n 2 S)).toFormula - (linkedMainStageFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels) - (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD) - (suffixIndex n 2 N) (prefixIndex n 2 1))) (extendMany 2 fields env) ↔ - ZFSet.pair (fields 0) (fields 1) ∈ env S → - ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD), - linked.code = fields 1 := by - rw [realize_imp, BoundedFormula.realize_toFormula M _ _ - (extendMany_members 2 fields env ground members), BoundedFormula.truth_pairMembershipFormula, - M.realize_linkedMainStageFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ - (extendMany_members 2 fields env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal)] - simp only [extendMany_prefix, extendMany_suffix] - rfl - constructor - · intro recognized i a entry - have hg := M.transitive (members S) entry - let fields : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => a) - have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left hg) (fun _ => M.pair_right hg) - exact (actual fields ground).1 (recognized fields ground) entry - · intro law fields ground - exact (actual fields ground).2 (law (fields 0) (fields 1)) - -theorem realize_mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixTransitionsFormula K Labels C D rD N S E) env ↔ - ∀ i j a b z, ZFSet.pair i a ∈ env S → ZFSet.pair j b ∈ env S → - ZFSet.pair (ZFSet.pair j i) z ∈ env E → - LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) a b z := by - rw [mainPrefixTransitionsFormula, realize_allBlock] - have actual (fields : Fin 5 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : - Realize M.sets - (imp (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (prefixIndex n 5 0) (prefixIndex n 5 2) (suffixIndex n 5 S)) - (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 3) (suffixIndex n 5 S)) - (BoundedFormula.tripleMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 0) (prefixIndex n 5 4) - (suffixIndex n 5 E)))).toFormula - (linkedMainTransitionFormula (suffixIndex n 5 K) (suffixIndex n 5 Labels) (suffixIndex n 5 C) - (suffixIndex n 5 D) (suffixIndex n 5 rD) (suffixIndex n 5 N) - (prefixIndex n 5 2) (prefixIndex n 5 3) (prefixIndex n 5 4))) (extendMany 5 fields env) ↔ - (ZFSet.pair (fields 0) (fields 2) ∈ env S ∧ ZFSet.pair (fields 1) (fields 3) ∈ env S ∧ - ZFSet.pair (ZFSet.pair (fields 1) (fields 0)) (fields 4) ∈ env E) → - LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) - (fields 2) (fields 3) (fields 4) := by - rw [realize_imp, BoundedFormula.realize_toFormula M _ _ - (extendMany_members 5 fields env ground members)] - simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, - BoundedFormula.truth_tripleMembershipFormula] - rw [M.realize_linkedMainTransitionFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ _ _ - (extendMany_members 5 fields env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal)] - simp only [extendMany_prefix, extendMany_suffix] - constructor - · intro recognized i j a b z first second third - have h₁ := M.transitive (members S) first - have h₂ := M.transitive (members S) second - have h₃ := M.transitive (members E) third - let fields : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases a (Fin.cases b (fun _ => z)))) - have ground : ∀ k, fields k ∈ M.sets := Fin.cases (M.pair_left h₁) - (Fin.cases (M.pair_left h₂) (Fin.cases (M.pair_right h₁) - (Fin.cases (M.pair_right h₂) (fun _ => M.pair_right h₃)))) - exact (actual fields ground).1 (recognized fields ground) ⟨first, second, third⟩ - · intro law fields ground - exact (actual fields ground).2 (fun entries => - law (fields 0) (fields 1) (fields 2) (fields 3) (fields 4) entries.1 entries.2.1 entries.2.2) - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageLevels + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace BoundedFormula + +def pairedTransitionEntryFormula {n} (i j p a E : Fin n) : BoundedFormula n := + exMem E (exMem 0 (exMem 0 (.conj + (orderedPairFormula 0 p.succ.succ.succ a.succ.succ.succ) + (orderedTripleFormula 2 j.succ.succ.succ i.succ.succ.succ 0)))) + +theorem truth_pairedTransitionEntryFormula {n} (i j p a E : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (pairedTransitionEntryFormula i j p a E) env ↔ + ZFSet.pair (ZFSet.pair (env j) (env i)) (ZFSet.pair (env p) (env a)) ∈ env E := by + simp only [pairedTransitionEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_orderedTripleFormula] + change (∃ w ∈ env E, ∃ b ∈ w, ∃ c ∈ b, c = ZFSet.pair (env p) (env a) ∧ + w = ZFSet.pair (ZFSet.pair (env j) (env i)) c) ↔ _ + constructor + · rintro ⟨w, hw, b, _, c, _, rfl, rfl⟩ + exact hw + · intro entry + refine ⟨_, entry, {ZFSet.pair (env j) (env i), ZFSet.pair (env p) (env a)}, + ZFSet.mem_pair.2 (Or.inr rfl), _, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩ + +end BoundedFormula + +namespace SetFormula + +def mainPrefixIdentityFormula {n} (E : Fin n) : SetFormula n := + let v := prefixIndex n 3 + allBlock 3 (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 0) (v 1) (v 2) (suffixIndex n 3 E)) + (.conj (BoundedFormula.graphDiagonalFormula (v 1)) + (BoundedFormula.graphDiagonalFormula (v 2)))).toFormula + +def mainPrefixCompositionFormula {n} (E : Fin n) : SetFormula n := + let v := prefixIndex n 9 + let old := suffixIndex n 9 E + allBlock 9 (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 1) (v 3) (v 4) old) + (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (v 1) (v 2) (v 5) (v 6) old) + (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 2) (v 7) (v 8) old) + (.conj (BoundedFormula.graphCompositionFormula (v 3) (v 5) (v 7)) + (BoundedFormula.graphCompositionFormula (v 4) (v 6) (v 8)))))).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixIdentityFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixIdentityFormula E) env ↔ + ∀ i p a, ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ env E → + GraphDiagonalCode p ∧ GraphDiagonalCode a := by + rw [mainPrefixIdentityFormula, realize_allBlock] + have actual (fields : Fin 3 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := + BoundedFormula.realize_toFormula M + (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 3 0) (prefixIndex n 3 0) + (prefixIndex n 3 1) (prefixIndex n 3 2) (suffixIndex n 3 E)) + (.conj (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 1)) + (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 2)))) + (extendMany 3 fields env) (extendMany_members 3 fields env ground members) + simp only [BoundedFormula.truth_imp, BoundedFormula.Truth, + BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphDiagonalFormula, + extendMany_prefix, extendMany_suffix] at actual + constructor + · intro recognized i p a entry + have hg := M.transitive (members E) entry + let fields : Fin 3 → ZFSet.{u} := Fin.cases i (Fin.cases p (fun _ => a)) + have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left (M.pair_left hg)) + (Fin.cases (M.pair_left (M.pair_right hg)) (fun _ => M.pair_right (M.pair_right hg))) + exact (actual fields ground).1 (recognized fields ground) entry + · intro law fields ground + exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2)) + +theorem realize_mainPrefixCompositionFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixCompositionFormula E) env ↔ + ∀ i j k p₁ a₁ p₂ a₂ p₃ a₃, + ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ env E → + ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ env E → + ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ env E → + GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ := by + rw [mainPrefixCompositionFormula, realize_allBlock] + have actual (fields : Fin 9 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := + BoundedFormula.realize_toFormula M + (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 1) + (prefixIndex n 9 3) (prefixIndex n 9 4) (suffixIndex n 9 E)) + (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 1) (prefixIndex n 9 2) + (prefixIndex n 9 5) (prefixIndex n 9 6) (suffixIndex n 9 E)) + (BoundedFormula.imp + (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 2) + (prefixIndex n 9 7) (prefixIndex n 9 8) (suffixIndex n 9 E)) + (.conj (BoundedFormula.graphCompositionFormula (prefixIndex n 9 3) (prefixIndex n 9 5) (prefixIndex n 9 7)) + (BoundedFormula.graphCompositionFormula (prefixIndex n 9 4) (prefixIndex n 9 6) (prefixIndex n 9 8)))))) + (extendMany 9 fields env) (extendMany_members 9 fields env ground members) + simp only [BoundedFormula.truth_imp, BoundedFormula.Truth, + BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphCompositionFormula, + extendMany_prefix, extendMany_suffix] at actual + constructor + · intro recognized i j k p₁ a₁ p₂ a₂ p₃ a₃ first second third + have h₁ := M.transitive (members E) first + have h₂ := M.transitive (members E) second + have h₃ := M.transitive (members E) third + let fields : Fin 9 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases k (Fin.cases p₁ + (Fin.cases a₁ (Fin.cases p₂ (Fin.cases a₂ (Fin.cases p₃ (fun _ => a₃)))))))) + have ground : ∀ a, fields a ∈ M.sets := Fin.cases (M.pair_right (M.pair_left h₁)) + (Fin.cases (M.pair_left (M.pair_left h₁)) (Fin.cases (M.pair_left (M.pair_left h₂)) + (Fin.cases (M.pair_left (M.pair_right h₁)) (Fin.cases (M.pair_right (M.pair_right h₁)) + (Fin.cases (M.pair_left (M.pair_right h₂)) (Fin.cases (M.pair_right (M.pair_right h₂)) + (Fin.cases (M.pair_left (M.pair_right h₃)) (fun _ => M.pair_right (M.pair_right h₃))))))))) + exact (actual fields ground).1 (recognized fields ground) first second third + · intro law fields ground + exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2) (fields 3) + (fields 4) (fields 5) (fields 6) (fields 7) (fields 8)) + +end TransitiveGround + +namespace SetFormula + +def mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n) : SetFormula n := + let old := suffixIndex n 2 + let v := prefixIndex n 2 + allBlock 2 (imp (BoundedFormula.pairMembershipFormula (v 0) (v 1) (old S)).toFormula + (linkedMainStageFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) (v 1))) + +def mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n) : SetFormula n := + let old := suffixIndex n 5 + let v := prefixIndex n 5 + allBlock 5 (imp (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old S)) + (.conj (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old S)) + (BoundedFormula.tripleMembershipFormula (v 1) (v 0) (v 4) (old E)))).toFormula + (linkedMainTransitionFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (v 2) (v 3) (v 4))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem realize_mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixStagesFormula K Labels C D rD N S) env ↔ + ∀ i a, ZFSet.pair i a ∈ env S → + ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD), + linked.code = a := by + rw [mainPrefixStagesFormula, realize_allBlock] + have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : + Realize M.sets + (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1) + (suffixIndex n 2 S)).toFormula + (linkedMainStageFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels) + (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD) + (suffixIndex n 2 N) (prefixIndex n 2 1))) (extendMany 2 fields env) ↔ + ZFSet.pair (fields 0) (fields 1) ∈ env S → + ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD), + linked.code = fields 1 := by + rw [realize_imp, BoundedFormula.realize_toFormula M _ _ + (extendMany_members 2 fields env ground members), BoundedFormula.truth_pairMembershipFormula, + M.realize_linkedMainStageFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ + (extendMany_members 2 fields env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal)] + simp only [extendMany_prefix, extendMany_suffix] + rfl + constructor + · intro recognized i a entry + have hg := M.transitive (members S) entry + let fields : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => a) + have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left hg) (fun _ => M.pair_right hg) + exact (actual fields ground).1 (recognized fields ground) entry + · intro law fields ground + exact (actual fields ground).2 (law (fields 0) (fields 1)) + +theorem realize_mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixTransitionsFormula K Labels C D rD N S E) env ↔ + ∀ i j a b z, ZFSet.pair i a ∈ env S → ZFSet.pair j b ∈ env S → + ZFSet.pair (ZFSet.pair j i) z ∈ env E → + LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) a b z := by + rw [mainPrefixTransitionsFormula, realize_allBlock] + have actual (fields : Fin 5 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : + Realize M.sets + (imp (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (prefixIndex n 5 0) (prefixIndex n 5 2) (suffixIndex n 5 S)) + (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 3) (suffixIndex n 5 S)) + (BoundedFormula.tripleMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 0) (prefixIndex n 5 4) + (suffixIndex n 5 E)))).toFormula + (linkedMainTransitionFormula (suffixIndex n 5 K) (suffixIndex n 5 Labels) (suffixIndex n 5 C) + (suffixIndex n 5 D) (suffixIndex n 5 rD) (suffixIndex n 5 N) + (prefixIndex n 5 2) (prefixIndex n 5 3) (prefixIndex n 5 4))) (extendMany 5 fields env) ↔ + (ZFSet.pair (fields 0) (fields 2) ∈ env S ∧ ZFSet.pair (fields 1) (fields 3) ∈ env S ∧ + ZFSet.pair (ZFSet.pair (fields 1) (fields 0)) (fields 4) ∈ env E) → + LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) + (fields 2) (fields 3) (fields 4) := by + rw [realize_imp, BoundedFormula.realize_toFormula M _ _ + (extendMany_members 5 fields env ground members)] + simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, + BoundedFormula.truth_tripleMembershipFormula] + rw [M.realize_linkedMainTransitionFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ _ _ + (extendMany_members 5 fields env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal)] + simp only [extendMany_prefix, extendMany_suffix] + constructor + · intro recognized i j a b z first second third + have h₁ := M.transitive (members S) first + have h₂ := M.transitive (members S) second + have h₃ := M.transitive (members E) third + let fields : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases a (Fin.cases b (fun _ => z)))) + have ground : ∀ k, fields k ∈ M.sets := Fin.cases (M.pair_left h₁) + (Fin.cases (M.pair_left h₂) (Fin.cases (M.pair_right h₁) + (Fin.cases (M.pair_right h₂) (fun _ => M.pair_right h₃)))) + exact (actual fields ground).1 (recognized fields ground) ⟨first, second, third⟩ + · intro law fields ground + exact (actual fields ground).2 (fun entries => + law (fields 0) (fields 1) (fields 2) (fields 3) (fields 4) entries.1 entries.2.1 entries.2.2) + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainTransitionValidityCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainTransitionValidityCodes.lean index 1ff386cac988c1898b4f64a29223cf867d724796..8aadcd14056782f2381595761c302851c4bb759e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainTransitionValidityCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MainTransitionValidityCodes.lean @@ -1,131 +1,131 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTransitionLaws -import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure MainTransitionLaws - (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : ZFSet.{u}) : Prop where - point_embedding : MeetEmbeddingCode P Q rP rQ μP μQ points - order_iff : ∀ x y x' y', ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points → - (ZFSet.pair x' y' ∈ rQ ↔ ZFSet.pair x y ∈ rP) - group_embedding : GroupEmbeddingCode G H mG mH oneG oneH actors - equivariant : ∀ g g' x y x' y', ZFSet.pair g g' ∈ actors → - ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points → - ZFSet.pair (ZFSet.pair g x) y ∈ AP → ZFSet.pair (ZFSet.pair g' x') y' ∈ AQ - bottom : ZFSet.pair bP bQ ∈ points - height : ∀ x y z, ZFSet.pair x y ∈ points → - (ZFSet.pair y z ∈ heightQ ↔ ZFSet.pair x z ∈ heightP) - agreement : ∀ g h g' h' v v', ZFSet.pair g g' ∈ actors → ZFSet.pair h h' ∈ actors → - ZFSet.pair v v' ∈ points → ActionAgreementBelow P rP AP g h v → - ActionAgreementBelow Q rQ AQ g' h' v' - -namespace BoundedFormula - -def transitionOrderFormula {n} (P Q rP rQ points : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ - .allMem P (.allMem P.succ (.allMem Q.succ.succ (.allMem Q.succ.succ.succ - (imp (.conj (pairMembershipFormula 3 1 (lift points)) (pairMembershipFormula 2 0 (lift points))) - (.conj (imp (pairMembershipFormula 1 0 (lift rQ)) (pairMembershipFormula 3 2 (lift rP))) - (imp (pairMembershipFormula 3 2 (lift rP)) (pairMembershipFormula 1 0 (lift rQ)))))))) - -def transitionEquivarianceFormula {n} (P Q G H AP AQ points actors : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - .allMem G (.allMem H.succ (.allMem P.succ.succ (.allMem P.succ.succ.succ - (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ - (imp (.conj (pairMembershipFormula 5 4 (lift actors)) - (.conj (pairMembershipFormula 3 1 (lift points)) - (.conj (pairMembershipFormula 2 0 (lift points)) - (tripleMembershipFormula 5 3 2 (lift AP))))) - (tripleMembershipFormula 4 1 0 (lift AQ)))))))) - -def transitionHeightFormula {n} (P Q heightP heightQ points : Fin n) : BoundedFormula n := - .allMem P (.allMem Q.succ (imp (pairMembershipFormula 1 0 points.succ.succ) - (graphFiberEqualityFormula 0 1 heightQ.succ.succ heightP.succ.succ))) - -def transitionAgreementFormula {n} (P Q rP rQ G H AP AQ points actors : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - .allMem G (.allMem G.succ (.allMem H.succ.succ (.allMem H.succ.succ.succ - (.allMem P.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ - (imp (.conj (pairMembershipFormula 5 3 (lift actors)) - (.conj (pairMembershipFormula 4 2 (lift actors)) - (.conj (pairMembershipFormula 1 0 (lift points)) - (actionAgreementBelowFormula (lift P) (lift rP) (lift AP) 5 4 1)))) - (actionAgreementBelowFormula (lift Q) (lift rQ) (lift AQ) 3 2 0))))))) - -def mainTransitionLawsFormula {n} - (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) : - BoundedFormula n := - .conj (meetEmbeddingFormula P Q rP rQ μP μQ points) - (.conj (transitionOrderFormula P Q rP rQ points) - (.conj (groupEmbeddingFormula G H mG mH oneG oneH actors) - (.conj (transitionEquivarianceFormula P Q G H AP AQ points actors) - (.conj (pairMembershipFormula bP bQ points) - (.conj (transitionHeightFormula P Q heightP heightQ points) - (transitionAgreementFormula P Q rP rQ G H AP AQ points actors)))))) - -theorem truth_mainTransitionLawsFormula {n} - (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ - heightP heightQ points actors) env ↔ - 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) := by - simp only [mainTransitionLawsFormula, transitionOrderFormula, transitionEquivarianceFormula, - transitionHeightFormula, transitionAgreementFormula, Truth, truth_meetEmbeddingFormula, - truth_groupEmbeddingFormula, truth_imp, truth_pairMembershipFormula, - truth_tripleMembershipFormula, truth_graphFiberEqualityFormula, truth_actionAgreementBelowFormula] - constructor - · rintro ⟨point, order, group, equivariant, bottom, height, agreement⟩ - have pb {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env points) : x ∈ env P ∧ y ∈ env Q := - ZFSet.pair_mem_prod.1 (point.injection.function.1 entry) - have ab {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env actors) : x ∈ env G ∧ y ∈ env H := - ZFSet.pair_mem_prod.1 (group.injection.function.1 entry) - refine ⟨point, ?_, group, ?_, bottom, ?_, ?_⟩ - · intro x y x' y' xx yy - have h := order x (pb xx).1 y (pb yy).1 x' (pb xx).2 y' (pb yy).2 ⟨xx, yy⟩ - exact ⟨h.1, h.2⟩ - · intro g g' x y x' y' gg xx yy act - exact equivariant g (ab gg).1 g' (ab gg).2 x (pb xx).1 y (pb yy).1 - x' (pb xx).2 y' (pb yy).2 ⟨gg, xx, yy, act⟩ - · intro x y z entry - exact height x (pb entry).1 y (pb entry).2 entry z - · intro g h g' h' v v' gg hh vv agree - exact agreement g (ab gg).1 h (ab hh).1 g' (ab gg).2 h' (ab hh).2 - v (pb vv).1 v' (pb vv).2 ⟨gg, hh, vv, agree⟩ - · intro code - refine ⟨code.point_embedding, ?_, code.group_embedding, ?_, code.bottom, ?_, ?_⟩ - · intro x _ y _ x' _ y' _ h - 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⟩ - · intro g _ g' _ x _ y _ x' _ y' _ h - exact code.equivariant g g' x y x' y' h.1 h.2.1 h.2.2.1 h.2.2.2 - · intro x _ y _ entry z - exact code.height x y z entry - · intro g _ h _ g' _ h' _ v _ v' _ entries - exact code.agreement g h g' h' v v' entries.1 entries.2.1 entries.2.2.1 entries.2.2.2 - -theorem realize_mainTransitionLawsFormula (M : TransitiveGround.{u}) {n} - (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ - heightP heightQ points actors).toFormula env ↔ - 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) := - (realize_toFormula M _ env members).trans - (truth_mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ - heightP heightQ points actors env) - -end BoundedFormula - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTransitionLaws +import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure MainTransitionLaws + (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : ZFSet.{u}) : Prop where + point_embedding : MeetEmbeddingCode P Q rP rQ μP μQ points + order_iff : ∀ x y x' y', ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points → + (ZFSet.pair x' y' ∈ rQ ↔ ZFSet.pair x y ∈ rP) + group_embedding : GroupEmbeddingCode G H mG mH oneG oneH actors + equivariant : ∀ g g' x y x' y', ZFSet.pair g g' ∈ actors → + ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points → + ZFSet.pair (ZFSet.pair g x) y ∈ AP → ZFSet.pair (ZFSet.pair g' x') y' ∈ AQ + bottom : ZFSet.pair bP bQ ∈ points + height : ∀ x y z, ZFSet.pair x y ∈ points → + (ZFSet.pair y z ∈ heightQ ↔ ZFSet.pair x z ∈ heightP) + agreement : ∀ g h g' h' v v', ZFSet.pair g g' ∈ actors → ZFSet.pair h h' ∈ actors → + ZFSet.pair v v' ∈ points → ActionAgreementBelow P rP AP g h v → + ActionAgreementBelow Q rQ AQ g' h' v' + +namespace BoundedFormula + +def transitionOrderFormula {n} (P Q rP rQ points : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ + .allMem P (.allMem P.succ (.allMem Q.succ.succ (.allMem Q.succ.succ.succ + (imp (.conj (pairMembershipFormula 3 1 (lift points)) (pairMembershipFormula 2 0 (lift points))) + (.conj (imp (pairMembershipFormula 1 0 (lift rQ)) (pairMembershipFormula 3 2 (lift rP))) + (imp (pairMembershipFormula 3 2 (lift rP)) (pairMembershipFormula 1 0 (lift rQ)))))))) + +def transitionEquivarianceFormula {n} (P Q G H AP AQ points actors : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + .allMem G (.allMem H.succ (.allMem P.succ.succ (.allMem P.succ.succ.succ + (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ + (imp (.conj (pairMembershipFormula 5 4 (lift actors)) + (.conj (pairMembershipFormula 3 1 (lift points)) + (.conj (pairMembershipFormula 2 0 (lift points)) + (tripleMembershipFormula 5 3 2 (lift AP))))) + (tripleMembershipFormula 4 1 0 (lift AQ)))))))) + +def transitionHeightFormula {n} (P Q heightP heightQ points : Fin n) : BoundedFormula n := + .allMem P (.allMem Q.succ (imp (pairMembershipFormula 1 0 points.succ.succ) + (graphFiberEqualityFormula 0 1 heightQ.succ.succ heightP.succ.succ))) + +def transitionAgreementFormula {n} (P Q rP rQ G H AP AQ points actors : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + .allMem G (.allMem G.succ (.allMem H.succ.succ (.allMem H.succ.succ.succ + (.allMem P.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ + (imp (.conj (pairMembershipFormula 5 3 (lift actors)) + (.conj (pairMembershipFormula 4 2 (lift actors)) + (.conj (pairMembershipFormula 1 0 (lift points)) + (actionAgreementBelowFormula (lift P) (lift rP) (lift AP) 5 4 1)))) + (actionAgreementBelowFormula (lift Q) (lift rQ) (lift AQ) 3 2 0))))))) + +def mainTransitionLawsFormula {n} + (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) : + BoundedFormula n := + .conj (meetEmbeddingFormula P Q rP rQ μP μQ points) + (.conj (transitionOrderFormula P Q rP rQ points) + (.conj (groupEmbeddingFormula G H mG mH oneG oneH actors) + (.conj (transitionEquivarianceFormula P Q G H AP AQ points actors) + (.conj (pairMembershipFormula bP bQ points) + (.conj (transitionHeightFormula P Q heightP heightQ points) + (transitionAgreementFormula P Q rP rQ G H AP AQ points actors)))))) + +theorem truth_mainTransitionLawsFormula {n} + (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ + heightP heightQ points actors) env ↔ + 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) := by + simp only [mainTransitionLawsFormula, transitionOrderFormula, transitionEquivarianceFormula, + transitionHeightFormula, transitionAgreementFormula, Truth, truth_meetEmbeddingFormula, + truth_groupEmbeddingFormula, truth_imp, truth_pairMembershipFormula, + truth_tripleMembershipFormula, truth_graphFiberEqualityFormula, truth_actionAgreementBelowFormula] + constructor + · rintro ⟨point, order, group, equivariant, bottom, height, agreement⟩ + have pb {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env points) : x ∈ env P ∧ y ∈ env Q := + ZFSet.pair_mem_prod.1 (point.injection.function.1 entry) + have ab {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env actors) : x ∈ env G ∧ y ∈ env H := + ZFSet.pair_mem_prod.1 (group.injection.function.1 entry) + refine ⟨point, ?_, group, ?_, bottom, ?_, ?_⟩ + · intro x y x' y' xx yy + have h := order x (pb xx).1 y (pb yy).1 x' (pb xx).2 y' (pb yy).2 ⟨xx, yy⟩ + exact ⟨h.1, h.2⟩ + · intro g g' x y x' y' gg xx yy act + exact equivariant g (ab gg).1 g' (ab gg).2 x (pb xx).1 y (pb yy).1 + x' (pb xx).2 y' (pb yy).2 ⟨gg, xx, yy, act⟩ + · intro x y z entry + exact height x (pb entry).1 y (pb entry).2 entry z + · intro g h g' h' v v' gg hh vv agree + exact agreement g (ab gg).1 h (ab hh).1 g' (ab gg).2 h' (ab hh).2 + v (pb vv).1 v' (pb vv).2 ⟨gg, hh, vv, agree⟩ + · intro code + refine ⟨code.point_embedding, ?_, code.group_embedding, ?_, code.bottom, ?_, ?_⟩ + · intro x _ y _ x' _ y' _ h + 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⟩ + · intro g _ g' _ x _ y _ x' _ y' _ h + exact code.equivariant g g' x y x' y' h.1 h.2.1 h.2.2.1 h.2.2.2 + · intro x _ y _ entry z + exact code.height x y z entry + · intro g _ h _ g' _ h' _ v _ v' _ entries + exact code.agreement g h g' h' v v' entries.1 entries.2.1 entries.2.2.1 entries.2.2.2 + +theorem realize_mainTransitionLawsFormula (M : TransitiveGround.{u}) {n} + (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ + heightP heightQ points actors).toFormula env ↔ + 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) := + (realize_toFormula M _ env members).trans + (truth_mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ + heightP heightQ points actors env) + +end BoundedFormula + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MapFamilyApplicationGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MapFamilyApplicationGraphs.lean index 8799bbae58d95342b1f69a225243050a9fe2bd5e..9ba1c96035a709799adfc4d02e80680501be6a28 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/MapFamilyApplicationGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/MapFamilyApplicationGraphs.lean @@ -1,373 +1,373 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -universe u - -noncomputable def indexedRelationSection (B C R i : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ q ∈ B, ∃ y ∈ C, - z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R) (ZFSet.prod B C) - -theorem indexedRelationSection_subset (B C R i : ZFSet.{u}) : - indexedRelationSection B C R i ⊆ ZFSet.prod B C := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_indexedRelationSection (B C R i z : ZFSet.{u}) : - z ∈ indexedRelationSection B C R i ↔ ∃ q ∈ B, ∃ y ∈ C, - z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by - constructor - · intro hz - exact (ZFSet.mem_sep.1 hz).2 - · rintro ⟨q, hq, y, hy, rfl, entry⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hq, hy⟩, q, hq, y, hy, rfl, entry⟩ - -theorem pair_mem_indexedRelationSection (B C R i q y : ZFSet.{u}) : - ZFSet.pair q y ∈ indexedRelationSection B C R i ↔ - q ∈ B ∧ y ∈ C ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by - rw [mem_indexedRelationSection] - constructor - · rintro ⟨q', hq, y', hy, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hq, hy, entry⟩ - · rintro ⟨hq, hy, entry⟩ - exact ⟨q, hq, y, hy, rfl, entry⟩ - - - - - - -namespace BoundedFormula - -open SetFormula - -def indexedRelationSectionEntryFormula {n} (z i b c r : Fin n) : BoundedFormula n := - exMem b (exMem c.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ))) - -theorem truth_indexedRelationSectionEntryFormula {n} (z i b c r : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (indexedRelationSectionEntryFormula z i b c r) env ↔ - env z ∈ indexedRelationSection (env b) (env c) (env r) (env i) := by - simp only [indexedRelationSectionEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_tripleMembershipFormula, mem_indexedRelationSection] - rfl - -def indexedRelationSectionFormula {n} (f i b c r : Fin n) : BoundedFormula n := - .conj (.allMem f (indexedRelationSectionEntryFormula 0 i.succ b.succ c.succ r.succ)) - (.allMem b (.allMem c.succ - (imp (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ) - (pairMembershipFormula 1 0 f.succ.succ)))) - -theorem truth_indexedRelationSectionFormula {n} (f i b c r : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (indexedRelationSectionFormula f i b c r) env ↔ - env f = indexedRelationSection (env b) (env c) (env r) (env i) := by - simp only [indexedRelationSectionFormula, Truth, truth_indexedRelationSectionEntryFormula, - truth_imp, truth_tripleMembershipFormula, truth_pairMembershipFormula] - constructor - · rintro ⟨subset, complete⟩ - apply ZFSet.ext - intro z - refine ⟨subset z, ?_⟩ - intro hz - obtain ⟨q, hq, y, hy, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz - exact complete q hq y hy entry - · intro equal - refine ⟨fun _ hz => equal ▸ hz, ?_⟩ - intro q hq y hy entry - change ZFSet.pair q y ∈ env f - rw [equal] - exact (pair_mem_indexedRelationSection _ _ _ _ q y).2 ⟨hq, hy, entry⟩ - -def indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n) : BoundedFormula n := - exMem domain (exMem bound.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (indexedRelationSectionFormula 0 1 b.succ.succ c.succ.succ r.succ.succ))) - -theorem truth_indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (indexedRelationFamilyEntryFormula z domain bound b c r) env ↔ - ∃ i ∈ env domain, ∃ f ∈ env bound, env z = ZFSet.pair i f ∧ - f = indexedRelationSection (env b) (env c) (env r) i := by - simp only [indexedRelationFamilyEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_indexedRelationSectionFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem indexedRelationSection_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {B C R i : ZFSet.{u}} (hB : B ∈ M.sets) (hC : C ∈ M.sets) - (hR : R ∈ M.sets) (hi : i ∈ M.sets) : indexedRelationSection B C R i ∈ M.sets := by - let params := extend i (extend B (extend C (extend R Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) params - (Fin.cases hi (Fin.cases hB (Fin.cases hC (Fin.cases hR (fun j => Fin.elim0 j))))) - (M.prod_mem pairing unions powers separation hB hC) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod B C) = indexedRelationSection B C R i := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_indexedRelationSectionEntryFormula] - exact ⟨And.right, fun hz => ⟨indexedRelationSection_subset B C R i hz, hz⟩⟩ - exact equal ▸ selected - -noncomputable def indexedRelationSections (I B C R : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundRelations B C, - z = ZFSet.pair i f ∧ f = indexedRelationSection B C R i) - (ZFSet.prod I (M.groundRelations B C)) - -theorem pair_mem_indexedRelationSections (I B C R i f : ZFSet.{u}) : - ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔ - i ∈ I ∧ f ∈ M.groundRelations B C ∧ f = indexedRelationSection B C R i := by - rw [indexedRelationSections, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, sectionEq⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hi, hf, sectionEq⟩ - · rintro ⟨hi, hf, sectionEq⟩ - exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, sectionEq⟩ - -theorem indexedRelationSections_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) - (hC : C ∈ M.sets) (hR : R ∈ M.sets) : M.indexedRelationSections I B C R ∈ M.sets := by - have bound := M.groundRelations_mem pairing unions powers separation hB hC - let params := extend I (extend (M.groundRelations B C) (extend B (extend C (extend R Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) params - (Fin.cases hI (Fin.cases bound (Fin.cases hB (Fin.cases hC - (Fin.cases hR (fun j => Fin.elim0 j)))))) - (M.prod_mem pairing unions powers separation hI bound) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod I (M.groundRelations B C)) = M.indexedRelationSections I B C R := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedRelationSections, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_indexedRelationFamilyEntryFormula 0 1 2 3 4 5 _) - exact equal ▸ selected - -theorem indexedRelationSections_function - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) - (hC : C ∈ M.sets) (hR : R ∈ M.sets) : - ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro i hi - have sectionBound := (M.mem_groundRelations B C (indexedRelationSection B C R i)).2 - ⟨M.indexedRelationSection_mem pairing unions powers separation hB hC hR (M.transitive hI hi), - indexedRelationSection_subset B C R i⟩ - exact ⟨indexedRelationSection B C R i, - (M.pair_mem_indexedRelationSections I B C R i _).2 ⟨hi, sectionBound, rfl⟩, - fun f hf => ((M.pair_mem_indexedRelationSections I B C R i f).1 hf).2.2⟩ - -theorem indexedRelationSections_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) - (hC : C ∈ M.sets) (hR : R ∈ M.sets) : - M.indexedRelationSections I B C R ∈ M.sets ∧ - ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) ∧ - ∀ i f, ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔ - i ∈ I ∧ f = indexedRelationSection B C R i := by - have func := M.indexedRelationSections_function pairing unions powers separation hI hB hC hR - refine ⟨M.indexedRelationSections_mem pairing unions powers separation hI hB hC hR, func, ?_⟩ - intro i f - constructor - · intro entry - have parts := (M.pair_mem_indexedRelationSections I B C R i f).1 entry - exact ⟨parts.1, parts.2.2⟩ - · rintro ⟨hi, rfl⟩ - obtain ⟨g, entry, _⟩ := func.2 i hi - have equal := ((M.pair_mem_indexedRelationSections I B C R i g).1 entry).2.2 - exact equal ▸ entry - -end TransitiveGround - -end - - - -open SetFormula -universe u - -noncomputable def indexedCarrierLabels (T U A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X, - z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A) (ZFSet.prod T U) - -theorem indexedCarrierLabels_subset (T U A : ZFSet.{u}) : - indexedCarrierLabels T U A ⊆ ZFSet.prod T U := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_indexedCarrierLabels (T U A z : ZFSet.{u}) : - z ∈ indexedCarrierLabels T U A ↔ - ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X, - x ∈ U ∧ z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A := by - constructor - · intro hz - obtain ⟨bound, i, hi, X, hX, x, hx, rfl, entry⟩ := ZFSet.mem_sep.1 hz - exact ⟨i, hi, X, hX, x, hx, (ZFSet.pair_mem_prod.1 bound).2, rfl, entry⟩ - · rintro ⟨i, hi, X, hX, x, hx, hu, rfl, entry⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hu⟩, i, hi, X, hX, x, hx, rfl, entry⟩ - -theorem pair_mem_indexedCarrierLabels (T U A i x : ZFSet.{u}) : - ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔ - i ∈ T ∧ x ∈ U ∧ ∃ X, ZFSet.pair i X ∈ A ∧ x ∈ X := by - rw [mem_indexedCarrierLabels] - constructor - · rintro ⟨j, hj, X, _, y, hy, hu, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, hu, X, entry, hy⟩ - · rintro ⟨hi, hu, X, entry, hx⟩ - exact ⟨i, hi, X, pair_second_mem_doubleUnion entry, x, hx, hu, rfl, entry⟩ - -theorem pair_mem_indexedCarrierLabels_of_entry {T U A i X x : ZFSet.{u}} - (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) : - ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔ x ∈ X := by - rw [pair_mem_indexedCarrierLabels] - constructor - · rintro ⟨_, _, Y, other, hx⟩ - exact (family.unique other entry) ▸ hx - · intro hx - exact ⟨family.pair_source entry, bound hx, X, entry, hx⟩ - -namespace BoundedFormula - -def indexedCarrierLabelFormula {n} (z T U A V : Fin n) : BoundedFormula n := - exMem T (exMem V.succ (exMem 0 - (.conj (.mem 0 U.succ.succ.succ) - (.conj (orderedPairFormula z.succ.succ.succ 2 0) - (pairMembershipFormula 2 1 A.succ.succ.succ))))) - -theorem truth_indexedCarrierLabelFormula {n} (z T U A V : Fin n) - (env : Fin n → ZFSet.{u}) (bound : env V = ZFSet.sUnion (ZFSet.sUnion (env A))) : - Truth (indexedCarrierLabelFormula z T U A V) env ↔ - env z ∈ indexedCarrierLabels (env T) (env U) (env A) := by - simp only [indexedCarrierLabelFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - change (∃ i ∈ env T, ∃ X ∈ env V, ∃ x ∈ X, - x ∈ env U ∧ env z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ env A) ↔ _ - rw [bound, mem_indexedCarrierLabels] - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem indexedCarrierLabels_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T U A : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) (hA : A ∈ M.sets) : - indexedCarrierLabels T U A ∈ M.sets := by - have hV := M.union_mem unions (M.union_mem unions hA) - let params := extend T (extend U (extend A (extend (ZFSet.sUnion (ZFSet.sUnion A)) Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) params - (Fin.cases hT (Fin.cases hU (Fin.cases hA (Fin.cases hV (fun j => Fin.elim0 j))))) - (M.prod_mem pairing unions powers separation hT hU) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod T U) = indexedCarrierLabels T U A := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_indexedCarrierLabelFormula 0 1 2 3 4 _ rfl] - exact ⟨And.right, fun hz => ⟨indexedCarrierLabels_subset T U A hz, hz⟩⟩ - exact equal ▸ selected - -end TransitiveGround - - - - - -noncomputable def mapFamilyApplicationGraph (I P Q family : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ x ∈ P, ∃ y ∈ Q, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion family), - z = ZFSet.pair (ZFSet.pair i x) y ∧ ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f) - (ZFSet.prod (ZFSet.prod I P) Q) - -theorem pair_mem_mapFamilyApplicationGraph (I P Q family i x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i x) y ∈ mapFamilyApplicationGraph I P Q family ↔ - i ∈ I ∧ x ∈ P ∧ y ∈ Q ∧ ∃ f, ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f := by - rw [mapFamilyApplicationGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, j, hj, a, ha, b, hb, f, _, equal, indexed, entry⟩ - obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - exact ⟨hj, ha, hb, f, indexed, entry⟩ - · rintro ⟨hi, hx, hy, f, indexed, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩, - i, hi, x, hx, y, hy, f, pair_second_mem_doubleUnion indexed, rfl, indexed, entry⟩ - -namespace BoundedFormula - -def mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n) : BoundedFormula n := - exMem I (exMem P.succ (exMem Q.succ.succ (exMem B.succ.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ.succ 3 2 1) - (.conj (pairMembershipFormula 3 0 family.succ.succ.succ.succ) - (pairMembershipFormula 2 1 0)))))) - -theorem truth_mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (mapFamilyApplicationEntryFormula z I P Q B family) env ↔ - ∃ i ∈ env I, ∃ x ∈ env P, ∃ y ∈ env Q, ∃ f ∈ env B, - env z = ZFSet.pair (ZFSet.pair i x) y ∧ - ZFSet.pair i f ∈ env family ∧ ZFSet.pair x y ∈ f := by - simp only [mapFamilyApplicationEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem mapFamilyApplicationGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I P Q family : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) - (hQ : Q ∈ M.sets) (hFamily : family ∈ M.sets) : - mapFamilyApplicationGraph I P Q family ∈ M.sets := by - have hB := M.union_mem unions (M.union_mem unions hFamily) - let params := extend I (extend P (extend Q (extend (ZFSet.sUnion (ZFSet.sUnion family)) (extend family Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) params - (Fin.cases hI (Fin.cases hP (Fin.cases hQ (Fin.cases hB (Fin.cases hFamily - (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hI hP) hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod (ZFSet.prod I P) Q) = mapFamilyApplicationGraph I P Q family := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, mapFamilyApplicationGraph, ZFSet.mem_sep, - BoundedFormula.truth_mapFamilyApplicationEntryFormula] - rfl - exact equal ▸ selected - -end TransitiveGround - - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +universe u + +noncomputable def indexedRelationSection (B C R i : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ q ∈ B, ∃ y ∈ C, + z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R) (ZFSet.prod B C) + +theorem indexedRelationSection_subset (B C R i : ZFSet.{u}) : + indexedRelationSection B C R i ⊆ ZFSet.prod B C := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_indexedRelationSection (B C R i z : ZFSet.{u}) : + z ∈ indexedRelationSection B C R i ↔ ∃ q ∈ B, ∃ y ∈ C, + z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by + constructor + · intro hz + exact (ZFSet.mem_sep.1 hz).2 + · rintro ⟨q, hq, y, hy, rfl, entry⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hq, hy⟩, q, hq, y, hy, rfl, entry⟩ + +theorem pair_mem_indexedRelationSection (B C R i q y : ZFSet.{u}) : + ZFSet.pair q y ∈ indexedRelationSection B C R i ↔ + q ∈ B ∧ y ∈ C ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by + rw [mem_indexedRelationSection] + constructor + · rintro ⟨q', hq, y', hy, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hq, hy, entry⟩ + · rintro ⟨hq, hy, entry⟩ + exact ⟨q, hq, y, hy, rfl, entry⟩ + + + + + + +namespace BoundedFormula + +open SetFormula + +def indexedRelationSectionEntryFormula {n} (z i b c r : Fin n) : BoundedFormula n := + exMem b (exMem c.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ))) + +theorem truth_indexedRelationSectionEntryFormula {n} (z i b c r : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (indexedRelationSectionEntryFormula z i b c r) env ↔ + env z ∈ indexedRelationSection (env b) (env c) (env r) (env i) := by + simp only [indexedRelationSectionEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_tripleMembershipFormula, mem_indexedRelationSection] + rfl + +def indexedRelationSectionFormula {n} (f i b c r : Fin n) : BoundedFormula n := + .conj (.allMem f (indexedRelationSectionEntryFormula 0 i.succ b.succ c.succ r.succ)) + (.allMem b (.allMem c.succ + (imp (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ) + (pairMembershipFormula 1 0 f.succ.succ)))) + +theorem truth_indexedRelationSectionFormula {n} (f i b c r : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (indexedRelationSectionFormula f i b c r) env ↔ + env f = indexedRelationSection (env b) (env c) (env r) (env i) := by + simp only [indexedRelationSectionFormula, Truth, truth_indexedRelationSectionEntryFormula, + truth_imp, truth_tripleMembershipFormula, truth_pairMembershipFormula] + constructor + · rintro ⟨subset, complete⟩ + apply ZFSet.ext + intro z + refine ⟨subset z, ?_⟩ + intro hz + obtain ⟨q, hq, y, hy, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz + exact complete q hq y hy entry + · intro equal + refine ⟨fun _ hz => equal ▸ hz, ?_⟩ + intro q hq y hy entry + change ZFSet.pair q y ∈ env f + rw [equal] + exact (pair_mem_indexedRelationSection _ _ _ _ q y).2 ⟨hq, hy, entry⟩ + +def indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n) : BoundedFormula n := + exMem domain (exMem bound.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (indexedRelationSectionFormula 0 1 b.succ.succ c.succ.succ r.succ.succ))) + +theorem truth_indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (indexedRelationFamilyEntryFormula z domain bound b c r) env ↔ + ∃ i ∈ env domain, ∃ f ∈ env bound, env z = ZFSet.pair i f ∧ + f = indexedRelationSection (env b) (env c) (env r) i := by + simp only [indexedRelationFamilyEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_indexedRelationSectionFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem indexedRelationSection_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {B C R i : ZFSet.{u}} (hB : B ∈ M.sets) (hC : C ∈ M.sets) + (hR : R ∈ M.sets) (hi : i ∈ M.sets) : indexedRelationSection B C R i ∈ M.sets := by + let params := extend i (extend B (extend C (extend R Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) params + (Fin.cases hi (Fin.cases hB (Fin.cases hC (Fin.cases hR (fun j => Fin.elim0 j))))) + (M.prod_mem pairing unions powers separation hB hC) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod B C) = indexedRelationSection B C R i := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_indexedRelationSectionEntryFormula] + exact ⟨And.right, fun hz => ⟨indexedRelationSection_subset B C R i hz, hz⟩⟩ + exact equal ▸ selected + +noncomputable def indexedRelationSections (I B C R : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundRelations B C, + z = ZFSet.pair i f ∧ f = indexedRelationSection B C R i) + (ZFSet.prod I (M.groundRelations B C)) + +theorem pair_mem_indexedRelationSections (I B C R i f : ZFSet.{u}) : + ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔ + i ∈ I ∧ f ∈ M.groundRelations B C ∧ f = indexedRelationSection B C R i := by + rw [indexedRelationSections, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, sectionEq⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hi, hf, sectionEq⟩ + · rintro ⟨hi, hf, sectionEq⟩ + exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, sectionEq⟩ + +theorem indexedRelationSections_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) + (hC : C ∈ M.sets) (hR : R ∈ M.sets) : M.indexedRelationSections I B C R ∈ M.sets := by + have bound := M.groundRelations_mem pairing unions powers separation hB hC + let params := extend I (extend (M.groundRelations B C) (extend B (extend C (extend R Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) params + (Fin.cases hI (Fin.cases bound (Fin.cases hB (Fin.cases hC + (Fin.cases hR (fun j => Fin.elim0 j)))))) + (M.prod_mem pairing unions powers separation hI bound) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod I (M.groundRelations B C)) = M.indexedRelationSections I B C R := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedRelationSections, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_indexedRelationFamilyEntryFormula 0 1 2 3 4 5 _) + exact equal ▸ selected + +theorem indexedRelationSections_function + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) + (hC : C ∈ M.sets) (hR : R ∈ M.sets) : + ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro i hi + have sectionBound := (M.mem_groundRelations B C (indexedRelationSection B C R i)).2 + ⟨M.indexedRelationSection_mem pairing unions powers separation hB hC hR (M.transitive hI hi), + indexedRelationSection_subset B C R i⟩ + exact ⟨indexedRelationSection B C R i, + (M.pair_mem_indexedRelationSections I B C R i _).2 ⟨hi, sectionBound, rfl⟩, + fun f hf => ((M.pair_mem_indexedRelationSections I B C R i f).1 hf).2.2⟩ + +theorem indexedRelationSections_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) + (hC : C ∈ M.sets) (hR : R ∈ M.sets) : + M.indexedRelationSections I B C R ∈ M.sets ∧ + ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) ∧ + ∀ i f, ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔ + i ∈ I ∧ f = indexedRelationSection B C R i := by + have func := M.indexedRelationSections_function pairing unions powers separation hI hB hC hR + refine ⟨M.indexedRelationSections_mem pairing unions powers separation hI hB hC hR, func, ?_⟩ + intro i f + constructor + · intro entry + have parts := (M.pair_mem_indexedRelationSections I B C R i f).1 entry + exact ⟨parts.1, parts.2.2⟩ + · rintro ⟨hi, rfl⟩ + obtain ⟨g, entry, _⟩ := func.2 i hi + have equal := ((M.pair_mem_indexedRelationSections I B C R i g).1 entry).2.2 + exact equal ▸ entry + +end TransitiveGround + +end + + + +open SetFormula +universe u + +noncomputable def indexedCarrierLabels (T U A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X, + z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A) (ZFSet.prod T U) + +theorem indexedCarrierLabels_subset (T U A : ZFSet.{u}) : + indexedCarrierLabels T U A ⊆ ZFSet.prod T U := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_indexedCarrierLabels (T U A z : ZFSet.{u}) : + z ∈ indexedCarrierLabels T U A ↔ + ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X, + x ∈ U ∧ z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A := by + constructor + · intro hz + obtain ⟨bound, i, hi, X, hX, x, hx, rfl, entry⟩ := ZFSet.mem_sep.1 hz + exact ⟨i, hi, X, hX, x, hx, (ZFSet.pair_mem_prod.1 bound).2, rfl, entry⟩ + · rintro ⟨i, hi, X, hX, x, hx, hu, rfl, entry⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hu⟩, i, hi, X, hX, x, hx, rfl, entry⟩ + +theorem pair_mem_indexedCarrierLabels (T U A i x : ZFSet.{u}) : + ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔ + i ∈ T ∧ x ∈ U ∧ ∃ X, ZFSet.pair i X ∈ A ∧ x ∈ X := by + rw [mem_indexedCarrierLabels] + constructor + · rintro ⟨j, hj, X, _, y, hy, hu, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, hu, X, entry, hy⟩ + · rintro ⟨hi, hu, X, entry, hx⟩ + exact ⟨i, hi, X, pair_second_mem_doubleUnion entry, x, hx, hu, rfl, entry⟩ + +theorem pair_mem_indexedCarrierLabels_of_entry {T U A i X x : ZFSet.{u}} + (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) : + ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔ x ∈ X := by + rw [pair_mem_indexedCarrierLabels] + constructor + · rintro ⟨_, _, Y, other, hx⟩ + exact (family.unique other entry) ▸ hx + · intro hx + exact ⟨family.pair_source entry, bound hx, X, entry, hx⟩ + +namespace BoundedFormula + +def indexedCarrierLabelFormula {n} (z T U A V : Fin n) : BoundedFormula n := + exMem T (exMem V.succ (exMem 0 + (.conj (.mem 0 U.succ.succ.succ) + (.conj (orderedPairFormula z.succ.succ.succ 2 0) + (pairMembershipFormula 2 1 A.succ.succ.succ))))) + +theorem truth_indexedCarrierLabelFormula {n} (z T U A V : Fin n) + (env : Fin n → ZFSet.{u}) (bound : env V = ZFSet.sUnion (ZFSet.sUnion (env A))) : + Truth (indexedCarrierLabelFormula z T U A V) env ↔ + env z ∈ indexedCarrierLabels (env T) (env U) (env A) := by + simp only [indexedCarrierLabelFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + change (∃ i ∈ env T, ∃ X ∈ env V, ∃ x ∈ X, + x ∈ env U ∧ env z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ env A) ↔ _ + rw [bound, mem_indexedCarrierLabels] + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem indexedCarrierLabels_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T U A : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) (hA : A ∈ M.sets) : + indexedCarrierLabels T U A ∈ M.sets := by + have hV := M.union_mem unions (M.union_mem unions hA) + let params := extend T (extend U (extend A (extend (ZFSet.sUnion (ZFSet.sUnion A)) Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) params + (Fin.cases hT (Fin.cases hU (Fin.cases hA (Fin.cases hV (fun j => Fin.elim0 j))))) + (M.prod_mem pairing unions powers separation hT hU) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod T U) = indexedCarrierLabels T U A := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_indexedCarrierLabelFormula 0 1 2 3 4 _ rfl] + exact ⟨And.right, fun hz => ⟨indexedCarrierLabels_subset T U A hz, hz⟩⟩ + exact equal ▸ selected + +end TransitiveGround + + + + + +noncomputable def mapFamilyApplicationGraph (I P Q family : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ x ∈ P, ∃ y ∈ Q, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion family), + z = ZFSet.pair (ZFSet.pair i x) y ∧ ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f) + (ZFSet.prod (ZFSet.prod I P) Q) + +theorem pair_mem_mapFamilyApplicationGraph (I P Q family i x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i x) y ∈ mapFamilyApplicationGraph I P Q family ↔ + i ∈ I ∧ x ∈ P ∧ y ∈ Q ∧ ∃ f, ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f := by + rw [mapFamilyApplicationGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, j, hj, a, ha, b, hb, f, _, equal, indexed, entry⟩ + obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + exact ⟨hj, ha, hb, f, indexed, entry⟩ + · rintro ⟨hi, hx, hy, f, indexed, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩, + i, hi, x, hx, y, hy, f, pair_second_mem_doubleUnion indexed, rfl, indexed, entry⟩ + +namespace BoundedFormula + +def mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n) : BoundedFormula n := + exMem I (exMem P.succ (exMem Q.succ.succ (exMem B.succ.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ.succ 3 2 1) + (.conj (pairMembershipFormula 3 0 family.succ.succ.succ.succ) + (pairMembershipFormula 2 1 0)))))) + +theorem truth_mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (mapFamilyApplicationEntryFormula z I P Q B family) env ↔ + ∃ i ∈ env I, ∃ x ∈ env P, ∃ y ∈ env Q, ∃ f ∈ env B, + env z = ZFSet.pair (ZFSet.pair i x) y ∧ + ZFSet.pair i f ∈ env family ∧ ZFSet.pair x y ∈ f := by + simp only [mapFamilyApplicationEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem mapFamilyApplicationGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I P Q family : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) + (hQ : Q ∈ M.sets) (hFamily : family ∈ M.sets) : + mapFamilyApplicationGraph I P Q family ∈ M.sets := by + have hB := M.union_mem unions (M.union_mem unions hFamily) + let params := extend I (extend P (extend Q (extend (ZFSet.sUnion (ZFSet.sUnion family)) (extend family Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) params + (Fin.cases hI (Fin.cases hP (Fin.cases hQ (Fin.cases hB (Fin.cases hFamily + (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hI hP) hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod (ZFSet.prod I P) Q) = mapFamilyApplicationGraph I P Q family := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, mapFamilyApplicationGraph, ZFSet.mem_sep, + BoundedFormula.truth_mapFamilyApplicationEntryFormula] + rfl + exact equal ▸ selected + +end TransitiveGround + + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NameSupportFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NameSupportFormulas.lean index 021b9a006031e20644e76f78d7a89e7e4a9fb1ff..4aadbe199cb24793fc9b4f0ff5880762e0e5caaa 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NameSupportFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NameSupportFormulas.lean @@ -1,74 +1,74 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions - -namespace OAI - - -namespace PartitionPilot.Forcing - -open SetRealization Compression.RecursiveMaps -universe u -variable {I G : Type u} [Group G] - -noncomputable def supportBasisCode (b : Presentation I) (t : Presentation G) - (K : I → Subgroup G) : ZFSet.{u} := (b.product t).subset (fun z => z.2 ∈ K z.1) - -theorem pair_mem_supportBasisCode (b : Presentation I) (t : Presentation G) - (K : I → Subgroup G) (i : I) (g : G) : - ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K ↔ g ∈ K i := - (b.product t).encode_mem_subset (fun z => z.2 ∈ K z.1) (i, g) - -theorem finalSupportFamily_basis (Label : Type 1) (H : Subgroup (MainStage.OrdinalRun.FinalActor Label)) : - (MainStage.OrdinalRun.supportFamily Label).mem H ↔ - ∃ C, (MainStage.OrdinalRun.finalAction Label).fixSubgroup C ≤ H := Iff.rfl - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.SetFormula - -def nameSupportFormula : SetFormula 6 := - allConditions 3 (imp (pairMembershipFormula 2 0 5) - (atomicApplication nameActionFormula (extend 3 (extend 6 Fin.elim0)) 0 1 1)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem realize_nameSupportFormula (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (i : I) (hi : b.encode i ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) : - Realize M.sets nameSupportFormula - (extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔ - K i ≤ a.stabilizer s τ := by - let env := extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0))))) - rw [nameSupportFormula, M.realize_allConditions t 3 _ env group rfl] - change (∀ g, Realize M.sets _ _) ↔ ∀ g, g ∈ K i → a.act s g τ = τ - apply forall_congr' - intro g - let e := extend (t.encode g) env - rw [realize_imp, M.realize_pairMembershipFormula pairing 2 0 5 e hi - (M.transitive group (t.encode_mem g)) supports] - change (ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K → Realize M.sets _ e) ↔ _ - rw [pair_mem_supportBasisCode] - apply forall_congr' - intro _ - rw [realize_atomicApplication, map_extend, map_extend, map_empty] - exact M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g τ τ hτ hτ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions + +namespace OAI + + +namespace PartitionPilot.Forcing + +open SetRealization Compression.RecursiveMaps +universe u +variable {I G : Type u} [Group G] + +noncomputable def supportBasisCode (b : Presentation I) (t : Presentation G) + (K : I → Subgroup G) : ZFSet.{u} := (b.product t).subset (fun z => z.2 ∈ K z.1) + +theorem pair_mem_supportBasisCode (b : Presentation I) (t : Presentation G) + (K : I → Subgroup G) (i : I) (g : G) : + ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K ↔ g ∈ K i := + (b.product t).encode_mem_subset (fun z => z.2 ∈ K z.1) (i, g) + +theorem finalSupportFamily_basis (Label : Type 1) (H : Subgroup (MainStage.OrdinalRun.FinalActor Label)) : + (MainStage.OrdinalRun.supportFamily Label).mem H ↔ + ∃ C, (MainStage.OrdinalRun.finalAction Label).fixSubgroup C ≤ H := Iff.rfl + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.SetFormula + +def nameSupportFormula : SetFormula 6 := + allConditions 3 (imp (pairMembershipFormula 2 0 5) + (atomicApplication nameActionFormula (extend 3 (extend 6 Fin.elim0)) 0 1 1)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem realize_nameSupportFormula (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (i : I) (hi : b.encode i ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) : + Realize M.sets nameSupportFormula + (extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔ + K i ≤ a.stabilizer s τ := by + let env := extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0))))) + rw [nameSupportFormula, M.realize_allConditions t 3 _ env group rfl] + change (∀ g, Realize M.sets _ _) ↔ ∀ g, g ∈ K i → a.act s g τ = τ + apply forall_congr' + intro g + let e := extend (t.encode g) env + rw [realize_imp, M.realize_pairMembershipFormula pairing 2 0 5 e hi + (M.transitive group (t.encode_mem g)) supports] + change (ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K → Realize M.sets _ e) ↔ _ + rw [pair_mem_supportBasisCode] + apply forall_congr' + intro _ + rw [realize_atomicApplication, map_extend, map_extend, map_empty] + exact M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g τ τ hτ hτ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NatUnionCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NatUnionCodes.lean index acdcc9b76c082567470f7f6f98d2c7e261129cf1..a43b847ea0f27af5efbe89274fa977399e2b09a3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NatUnionCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NatUnionCodes.lean @@ -1,373 +1,373 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.SetRankBounds - -namespace OAI - - -namespace PartitionPilot.SetRealization.Presentation - -universe u -variable {A B : Type u} (s : Presentation A) (t : Presentation B) (f : A → B) - -noncomputable def graph : ZFSet.{u} := - (s.product t).subset (fun a => f a.1 = a.2) - -theorem pair_mem_graph (a : A) (b : B) : - ZFSet.pair (s.encode a) (t.encode b) ∈ s.graph t f ↔ f a = b := - (s.product t).encode_mem_subset (fun a => f a.1 = a.2) (a, b) - -theorem mem_graph (x : ZFSet.{u}) : - x ∈ s.graph t f ↔ ∃ a, ZFSet.pair (s.encode a) (t.encode (f a)) = x := by - rw [graph, mem_subset] - constructor - · rintro ⟨⟨a, b⟩, h, eq⟩ - change f a = b at h - subst b - exact ⟨a, eq⟩ - · rintro ⟨a, eq⟩ - exact ⟨(a, f a), rfl, eq⟩ - -theorem graph_isFunc : ZFSet.IsFunc s.carrier t.carrier (s.graph t f) := by - refine ⟨(s.product t).subset_carrier _, ?_⟩ - intro x hx - rcases (s.mem_carrier x).1 hx with ⟨a, rfl⟩ - refine ⟨t.encode (f a), (s.pair_mem_graph t f a (f a)).2 rfl, ?_⟩ - intro y hy - rcases (s.mem_graph t f _).1 hy with ⟨b, eq⟩ - have parts := ZFSet.pair_inj.1 eq - have ba := s.injective parts.1 - simpa only [ba] using parts.2.symm - -theorem graph_mem_funs : s.graph t f ∈ ZFSet.funs s.carrier t.carrier := - ZFSet.mem_funs.2 (s.graph_isFunc t f) - -theorem graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (hs : ZFSet.rank s.carrier < o) (ht : ZFSet.rank t.carrier < o) : - ZFSet.rank (s.graph t f) < o := - (s.product t).subset_rank_lt (s.product_rank_lt limit t hs ht) _ - -end PartitionPilot.SetRealization.Presentation - - - -namespace PartitionPilot.Forcing - -open scoped ZFSet - -universe u - -def FunctionGraphOn (A f : ZFSet.{u}) : Prop := - ∃ B, ZFSet.IsFunc A B f - -def graphRestriction (A f : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ ZFSet.prod A (⋃₀ ⋃₀ f)) f - -theorem pair_first_mem_doubleUnion {x y f : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ f) : x ∈ ⋃₀ ⋃₀ f := by - exact ZFSet.mem_sUnion.2 ⟨{x}, ZFSet.mem_sUnion.2 - ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inl rfl)⟩, - ZFSet.mem_singleton.2 rfl⟩ - -theorem pair_second_mem_doubleUnion {x y f : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ f) : y ∈ ⋃₀ ⋃₀ f := by - exact ZFSet.mem_sUnion.2 ⟨{x, y}, ZFSet.mem_sUnion.2 - ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inr rfl)⟩, - ZFSet.mem_pair.2 (Or.inr rfl)⟩ - -theorem pair_mem_graphRestriction {A f x y : ZFSet.{u}} : - ZFSet.pair x y ∈ graphRestriction A f ↔ ZFSet.pair x y ∈ f ∧ x ∈ A := by - constructor - · intro h - exact ⟨(ZFSet.mem_sep.1 h).1, (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 h).2).1⟩ - · rintro ⟨entry, hx⟩ - exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 - ⟨hx, pair_second_mem_doubleUnion entry⟩⟩ - -theorem mem_graphRestriction {A f z : ZFSet.{u}} : - z ∈ graphRestriction A f ↔ ∃ x ∈ A, ∃ y, z = ZFSet.pair x y ∧ ZFSet.pair x y ∈ f := by - constructor - · intro h - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 h).2 - exact ⟨x, hx, y, rfl, (ZFSet.mem_sep.1 h).1⟩ - · rintro ⟨x, hx, y, rfl, entry⟩ - exact pair_mem_graphRestriction.2 ⟨entry, hx⟩ - -theorem graphRestriction_subset (A f : ZFSet.{u}) : graphRestriction A f ⊆ f := - fun _ h => (ZFSet.mem_sep.1 h).1 - -theorem graphRestriction_restrict {A B f : ZFSet.{u}} (subset : B ⊆ A) : - graphRestriction B (graphRestriction A f) = graphRestriction B f := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz - exact pair_mem_graphRestriction.2 ⟨(pair_mem_graphRestriction.1 entry).1, hx⟩ - · intro hz - obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz - exact pair_mem_graphRestriction.2 - ⟨pair_mem_graphRestriction.2 ⟨entry, subset hx⟩, hx⟩ - -theorem graphRestriction_eq_sep {A B C f : ZFSet.{u}} (h : ZFSet.IsFunc A B f) : - graphRestriction C f = ZFSet.sep (fun z => z ∈ ZFSet.prod C B) f := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz - exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 - ⟨hx, (ZFSet.pair_mem_prod.1 (h.1 entry)).2⟩⟩ - · intro hz - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).2 - exact pair_mem_graphRestriction.2 ⟨(ZFSet.mem_sep.1 hz).1, hx⟩ - -theorem graphRestriction_insert_of_not_mem {A f x y : ZFSet.{u}} (fresh : x ∉ A) : - graphRestriction A (insert (ZFSet.pair x y) f) = graphRestriction A f := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz - rcases ZFSet.mem_insert_iff.1 entry with eq | entry - · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha)) - · exact pair_mem_graphRestriction.2 ⟨entry, ha⟩ - · intro hz - obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz - exact pair_mem_graphRestriction.2 ⟨ZFSet.mem_insert_iff.2 (Or.inr entry), ha⟩ - -namespace FunctionGraphOn - -theorem to_isFunc {A f : ZFSet.{u}} (h : FunctionGraphOn A f) : - ZFSet.IsFunc A (⋃₀ ⋃₀ f) f := by - obtain ⟨B, shape, total⟩ := h - refine ⟨?_, total⟩ - intro z hz - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (shape hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, pair_second_mem_doubleUnion hz⟩ - -theorem shape {A f : ZFSet.{u}} (h : FunctionGraphOn A f) : - ∀ z ∈ f, ∃ x ∈ A, ∃ y, z = ZFSet.pair x y := by - intro z hz - obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz) - exact ⟨x, hx, y, eq⟩ - -theorem total {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (hx : x ∈ A) : - ∃ y, ZFSet.pair x y ∈ f := by - obtain ⟨y, entry, _⟩ := h.to_isFunc.2 x hx - exact ⟨y, entry⟩ - -theorem pair_source {A f x y : ZFSet.{u}} (h : FunctionGraphOn A f) - (entry : ZFSet.pair x y ∈ f) : x ∈ A := - (ZFSet.pair_mem_prod.1 (h.to_isFunc.1 entry)).1 - -theorem unique {A f x y z : ZFSet.{u}} (h : FunctionGraphOn A f) - (hy : ZFSet.pair x y ∈ f) (hz : ZFSet.pair x z ∈ f) : y = z := by - obtain ⟨w, _, unique⟩ := h.to_isFunc.2 x (h.pair_source hy) - exact (unique y hy).trans (unique z hz).symm - -theorem restrict {A B f : ZFSet.{u}} (h : FunctionGraphOn A f) (subset : B ⊆ A) : - FunctionGraphOn B (graphRestriction B f) := by - refine ⟨⋃₀ ⋃₀ f, ?_, ?_⟩ - · intro z hz - exact (ZFSet.mem_sep.1 hz).2 - · intro x hx - obtain ⟨y, entry⟩ := h.total (subset hx) - refine ⟨y, pair_mem_graphRestriction.2 ⟨entry, hx⟩, ?_⟩ - intro z hz - exact h.unique (pair_mem_graphRestriction.1 hz).1 entry - -theorem restriction_eq {A f : ZFSet.{u}} (h : FunctionGraphOn A f) : - graphRestriction A f = f := by - apply ZFSet.ext - intro z - constructor - · exact fun hz => graphRestriction_subset A f hz - · intro hz - exact ZFSet.mem_sep.2 ⟨hz, h.to_isFunc.1 hz⟩ - -theorem eq_of_agree {A f g : ZFSet.{u}} (hf : FunctionGraphOn A f) - (hg : FunctionGraphOn A g) - (agree : ∀ x y z, ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : f = g := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hf.to_isFunc.1 hz) - obtain ⟨w, hw⟩ := hg.total hx - exact (agree x y w hz hw).symm ▸ hw - · intro hz - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hg.to_isFunc.1 hz) - obtain ⟨w, hw⟩ := hf.total hx - exact agree x w y hw hz ▸ hw - -theorem empty : FunctionGraphOn (∅ : ZFSet.{u}) ∅ := - ⟨∅, ZFSet.empty_subset _, fun x hx => False.elim (ZFSet.notMem_empty x hx)⟩ - -theorem insert {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (fresh : x ∉ A) - (y : ZFSet.{u}) : FunctionGraphOn (Insert.insert x A) (Insert.insert (ZFSet.pair x y) f) := by - classical - refine ⟨Insert.insert y (⋃₀ ⋃₀ f), ?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_insert_iff.1 hz with rfl | hz - · exact ZFSet.pair_mem_prod.2 - ⟨ZFSet.mem_insert_iff.2 (Or.inl rfl), ZFSet.mem_insert_iff.2 (Or.inl rfl)⟩ - · obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz) - exact ZFSet.pair_mem_prod.2 - ⟨ZFSet.mem_insert_iff.2 (Or.inr ha), ZFSet.mem_insert_iff.2 (Or.inr hb)⟩ - · intro a ha - rcases ZFSet.mem_insert_iff.1 ha with rfl | ha - · refine ⟨y, ZFSet.mem_insert_iff.2 (Or.inl rfl), ?_⟩ - intro b hb - rcases ZFSet.mem_insert_iff.1 hb with eq | hb - · exact (ZFSet.pair_inj.1 eq).2 - · exact False.elim (fresh (h.pair_source hb)) - · obtain ⟨b, entry⟩ := h.total ha - refine ⟨b, ZFSet.mem_insert_iff.2 (Or.inr entry), ?_⟩ - intro c hc - rcases ZFSet.mem_insert_iff.1 hc with eq | hc - · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha)) - · exact h.unique hc entry - -theorem successor {A f : ZFSet.{u}} (h : FunctionGraphOn A f) (y : ZFSet.{u}) : - FunctionGraphOn (Insert.insert A A) (Insert.insert (ZFSet.pair A y) f) := - h.insert (ZFSet.mem_irrefl A) y - -end FunctionGraphOn - -theorem functionGraphOn_sUnion {A W : ZFSet.{u}} - (shape : ∀ f ∈ W, ∃ B, B ⊆ A ∧ FunctionGraphOn B f) - (cover : ∀ x ∈ A, ∃ f ∈ W, ∃ y, ZFSet.pair x y ∈ f) - (agree : ∀ f ∈ W, ∀ g ∈ W, ∀ x y z, - ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : - FunctionGraphOn A (⋃₀ W) := by - refine ⟨⋃₀ ⋃₀ (⋃₀ W), ?_, ?_⟩ - · intro z hz - obtain ⟨f, hf, entry⟩ := ZFSet.mem_sUnion.1 hz - obtain ⟨B, subset, func⟩ := shape f hf - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (func.to_isFunc.1 entry) - exact ZFSet.pair_mem_prod.2 ⟨subset hx, pair_second_mem_doubleUnion hz⟩ - · intro x hx - obtain ⟨f, hf, y, entry⟩ := cover x hx - refine ⟨y, ZFSet.mem_sUnion.2 ⟨f, hf, entry⟩, ?_⟩ - intro z hz - obtain ⟨g, hg, rel⟩ := ZFSet.mem_sUnion.1 hz - exact agree g hg f hf x z y rel entry - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.SetRealization.Presentation -universe u -variable {A B : Type u} (s : Presentation A) (e : B ≃ A) - -def reindex : Presentation B where - carrier := s.carrier - encode b := s.encode (e b) - injective := s.injective.comp e.injective - mem_carrier x := by - rw [s.mem_carrier] - exact ⟨fun ⟨a, eq⟩ => ⟨e.symm a, by simpa only [e.apply_symm_apply] using eq⟩, - fun ⟨b, eq⟩ => ⟨e b, eq⟩⟩ - -theorem reindex_carrier : (s.reindex e).carrier = s.carrier := rfl - -theorem reindex_encode (b : B) : (s.reindex e).encode b = s.encode (e b) := rfl - -theorem graph_reindex {C : Type u} (t : Presentation C) (f : C → B) : - t.graph (s.reindex e) f = t.graph s (fun x => e (f x)) := by - apply ZFSet.ext - intro z - rw [mem_graph, mem_graph] - rfl - -end PartitionPilot.SetRealization.Presentation - - - -namespace PartitionPilot.Forcing -universe u - -def NatUnionCode (stages : Nat → ZFSet.{u}) (union : ZFSet.{u}) : Prop := - ∀ x, x ∈ union ↔ ∃ n, x ∈ stages n - -namespace NatUnionCode - -theorem subset {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}} - (code : NatUnionCode stages union) (n : Nat) : stages n ⊆ union := - fun _ hx => (code _).2 ⟨n, hx⟩ - -theorem constant (A : ZFSet.{u}) : NatUnionCode (fun _ => A) A := by - intro x - exact ⟨fun hx => ⟨0, hx⟩, fun ⟨_, hx⟩ => hx⟩ - -theorem prod_left {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}} - (code : NatUnionCode stages union) (A : ZFSet.{u}) : - NatUnionCode (fun n => ZFSet.prod A (stages n)) (ZFSet.prod A union) := by - intro z - constructor - · rintro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - obtain ⟨n, hn⟩ := (code y).1 hy - exact ⟨n, ZFSet.pair_mem_prod.2 ⟨hx, hn⟩⟩ - · rintro ⟨n, hn⟩ - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn - exact ZFSet.pair_mem_prod.2 ⟨hx, code.subset n hy⟩ - -theorem prod {A B : Nat → ZFSet.{u}} {U V : ZFSet.{u}} - (left : NatUnionCode A U) (right : NatUnionCode B V) - (leftMono : ∀ n m, n ≤ m → A n ⊆ A m) - (rightMono : ∀ n m, n ≤ m → B n ⊆ B m) : - NatUnionCode (fun n => ZFSet.prod (A n) (B n)) (ZFSet.prod U V) := by - intro z - constructor - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - obtain ⟨n, hn⟩ := (left x).1 hx - obtain ⟨m, hm⟩ := (right y).1 hy - exact ⟨max n m, ZFSet.pair_mem_prod.2 - ⟨leftMono n _ (le_max_left n m) hn, rightMono m _ (le_max_right n m) hm⟩⟩ - · rintro ⟨n, hn⟩ - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn - exact ZFSet.pair_mem_prod.2 ⟨left.subset n hx, right.subset n hy⟩ - -theorem isFunc {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}} - (domain : NatUnionCode A U) (range : NatUnionCode B V) (graph : NatUnionCode f F) - (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n)) - (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) : ZFSet.IsFunc U V F := by - constructor - · intro z hz - obtain ⟨n, hn⟩ := (graph z).1 hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((functions n).1 hn) - exact ZFSet.pair_mem_prod.2 ⟨domain.subset n hx, range.subset n hy⟩ - · intro x hx - obtain ⟨n, hn⟩ := (domain x).1 hx - obtain ⟨y, entry, _⟩ := (functions n).2 x hn - refine ⟨y, graph.subset n entry, ?_⟩ - intro z hz - obtain ⟨m, hm⟩ := (graph _).1 hz - have first := graphMono n (max n m) (le_max_left n m) entry - have second := graphMono m (max n m) (le_max_right n m) hm - have inDomain := (ZFSet.pair_mem_prod.1 ((functions (max n m)).1 first)).1 - obtain ⟨_, _, unique⟩ := (functions (max n m)).2 x inDomain - exact (unique z second).trans (unique y first).symm - -theorem function_entry_iff {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}} - (graph : NatUnionCode f F) (function : ZFSet.IsFunc U V F) - (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n)) - (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ A n) : - ZFSet.pair x y ∈ F ↔ ZFSet.pair x y ∈ f n := by - constructor - · intro entry - obtain ⟨z, old, _⟩ := (functions n).2 x hx - have oldUnion := graph.subset n old - have inDomain := (ZFSet.pair_mem_prod.1 (function.1 oldUnion)).1 - obtain ⟨_, _, unique⟩ := function.2 x inDomain - have equal : y = z := (unique y entry).trans (unique z oldUnion).symm - exact equal.symm ▸ old - · exact fun entry => graph.subset n entry - -end NatUnionCode - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.SetRankBounds + +namespace OAI + + +namespace PartitionPilot.SetRealization.Presentation + +universe u +variable {A B : Type u} (s : Presentation A) (t : Presentation B) (f : A → B) + +noncomputable def graph : ZFSet.{u} := + (s.product t).subset (fun a => f a.1 = a.2) + +theorem pair_mem_graph (a : A) (b : B) : + ZFSet.pair (s.encode a) (t.encode b) ∈ s.graph t f ↔ f a = b := + (s.product t).encode_mem_subset (fun a => f a.1 = a.2) (a, b) + +theorem mem_graph (x : ZFSet.{u}) : + x ∈ s.graph t f ↔ ∃ a, ZFSet.pair (s.encode a) (t.encode (f a)) = x := by + rw [graph, mem_subset] + constructor + · rintro ⟨⟨a, b⟩, h, eq⟩ + change f a = b at h + subst b + exact ⟨a, eq⟩ + · rintro ⟨a, eq⟩ + exact ⟨(a, f a), rfl, eq⟩ + +theorem graph_isFunc : ZFSet.IsFunc s.carrier t.carrier (s.graph t f) := by + refine ⟨(s.product t).subset_carrier _, ?_⟩ + intro x hx + rcases (s.mem_carrier x).1 hx with ⟨a, rfl⟩ + refine ⟨t.encode (f a), (s.pair_mem_graph t f a (f a)).2 rfl, ?_⟩ + intro y hy + rcases (s.mem_graph t f _).1 hy with ⟨b, eq⟩ + have parts := ZFSet.pair_inj.1 eq + have ba := s.injective parts.1 + simpa only [ba] using parts.2.symm + +theorem graph_mem_funs : s.graph t f ∈ ZFSet.funs s.carrier t.carrier := + ZFSet.mem_funs.2 (s.graph_isFunc t f) + +theorem graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (hs : ZFSet.rank s.carrier < o) (ht : ZFSet.rank t.carrier < o) : + ZFSet.rank (s.graph t f) < o := + (s.product t).subset_rank_lt (s.product_rank_lt limit t hs ht) _ + +end PartitionPilot.SetRealization.Presentation + + + +namespace PartitionPilot.Forcing + +open scoped ZFSet + +universe u + +def FunctionGraphOn (A f : ZFSet.{u}) : Prop := + ∃ B, ZFSet.IsFunc A B f + +def graphRestriction (A f : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ ZFSet.prod A (⋃₀ ⋃₀ f)) f + +theorem pair_first_mem_doubleUnion {x y f : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ f) : x ∈ ⋃₀ ⋃₀ f := by + exact ZFSet.mem_sUnion.2 ⟨{x}, ZFSet.mem_sUnion.2 + ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inl rfl)⟩, + ZFSet.mem_singleton.2 rfl⟩ + +theorem pair_second_mem_doubleUnion {x y f : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ f) : y ∈ ⋃₀ ⋃₀ f := by + exact ZFSet.mem_sUnion.2 ⟨{x, y}, ZFSet.mem_sUnion.2 + ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inr rfl)⟩, + ZFSet.mem_pair.2 (Or.inr rfl)⟩ + +theorem pair_mem_graphRestriction {A f x y : ZFSet.{u}} : + ZFSet.pair x y ∈ graphRestriction A f ↔ ZFSet.pair x y ∈ f ∧ x ∈ A := by + constructor + · intro h + exact ⟨(ZFSet.mem_sep.1 h).1, (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 h).2).1⟩ + · rintro ⟨entry, hx⟩ + exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 + ⟨hx, pair_second_mem_doubleUnion entry⟩⟩ + +theorem mem_graphRestriction {A f z : ZFSet.{u}} : + z ∈ graphRestriction A f ↔ ∃ x ∈ A, ∃ y, z = ZFSet.pair x y ∧ ZFSet.pair x y ∈ f := by + constructor + · intro h + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 h).2 + exact ⟨x, hx, y, rfl, (ZFSet.mem_sep.1 h).1⟩ + · rintro ⟨x, hx, y, rfl, entry⟩ + exact pair_mem_graphRestriction.2 ⟨entry, hx⟩ + +theorem graphRestriction_subset (A f : ZFSet.{u}) : graphRestriction A f ⊆ f := + fun _ h => (ZFSet.mem_sep.1 h).1 + +theorem graphRestriction_restrict {A B f : ZFSet.{u}} (subset : B ⊆ A) : + graphRestriction B (graphRestriction A f) = graphRestriction B f := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz + exact pair_mem_graphRestriction.2 ⟨(pair_mem_graphRestriction.1 entry).1, hx⟩ + · intro hz + obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz + exact pair_mem_graphRestriction.2 + ⟨pair_mem_graphRestriction.2 ⟨entry, subset hx⟩, hx⟩ + +theorem graphRestriction_eq_sep {A B C f : ZFSet.{u}} (h : ZFSet.IsFunc A B f) : + graphRestriction C f = ZFSet.sep (fun z => z ∈ ZFSet.prod C B) f := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz + exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 + ⟨hx, (ZFSet.pair_mem_prod.1 (h.1 entry)).2⟩⟩ + · intro hz + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).2 + exact pair_mem_graphRestriction.2 ⟨(ZFSet.mem_sep.1 hz).1, hx⟩ + +theorem graphRestriction_insert_of_not_mem {A f x y : ZFSet.{u}} (fresh : x ∉ A) : + graphRestriction A (insert (ZFSet.pair x y) f) = graphRestriction A f := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz + rcases ZFSet.mem_insert_iff.1 entry with eq | entry + · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha)) + · exact pair_mem_graphRestriction.2 ⟨entry, ha⟩ + · intro hz + obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz + exact pair_mem_graphRestriction.2 ⟨ZFSet.mem_insert_iff.2 (Or.inr entry), ha⟩ + +namespace FunctionGraphOn + +theorem to_isFunc {A f : ZFSet.{u}} (h : FunctionGraphOn A f) : + ZFSet.IsFunc A (⋃₀ ⋃₀ f) f := by + obtain ⟨B, shape, total⟩ := h + refine ⟨?_, total⟩ + intro z hz + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (shape hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, pair_second_mem_doubleUnion hz⟩ + +theorem shape {A f : ZFSet.{u}} (h : FunctionGraphOn A f) : + ∀ z ∈ f, ∃ x ∈ A, ∃ y, z = ZFSet.pair x y := by + intro z hz + obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz) + exact ⟨x, hx, y, eq⟩ + +theorem total {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (hx : x ∈ A) : + ∃ y, ZFSet.pair x y ∈ f := by + obtain ⟨y, entry, _⟩ := h.to_isFunc.2 x hx + exact ⟨y, entry⟩ + +theorem pair_source {A f x y : ZFSet.{u}} (h : FunctionGraphOn A f) + (entry : ZFSet.pair x y ∈ f) : x ∈ A := + (ZFSet.pair_mem_prod.1 (h.to_isFunc.1 entry)).1 + +theorem unique {A f x y z : ZFSet.{u}} (h : FunctionGraphOn A f) + (hy : ZFSet.pair x y ∈ f) (hz : ZFSet.pair x z ∈ f) : y = z := by + obtain ⟨w, _, unique⟩ := h.to_isFunc.2 x (h.pair_source hy) + exact (unique y hy).trans (unique z hz).symm + +theorem restrict {A B f : ZFSet.{u}} (h : FunctionGraphOn A f) (subset : B ⊆ A) : + FunctionGraphOn B (graphRestriction B f) := by + refine ⟨⋃₀ ⋃₀ f, ?_, ?_⟩ + · intro z hz + exact (ZFSet.mem_sep.1 hz).2 + · intro x hx + obtain ⟨y, entry⟩ := h.total (subset hx) + refine ⟨y, pair_mem_graphRestriction.2 ⟨entry, hx⟩, ?_⟩ + intro z hz + exact h.unique (pair_mem_graphRestriction.1 hz).1 entry + +theorem restriction_eq {A f : ZFSet.{u}} (h : FunctionGraphOn A f) : + graphRestriction A f = f := by + apply ZFSet.ext + intro z + constructor + · exact fun hz => graphRestriction_subset A f hz + · intro hz + exact ZFSet.mem_sep.2 ⟨hz, h.to_isFunc.1 hz⟩ + +theorem eq_of_agree {A f g : ZFSet.{u}} (hf : FunctionGraphOn A f) + (hg : FunctionGraphOn A g) + (agree : ∀ x y z, ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : f = g := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hf.to_isFunc.1 hz) + obtain ⟨w, hw⟩ := hg.total hx + exact (agree x y w hz hw).symm ▸ hw + · intro hz + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hg.to_isFunc.1 hz) + obtain ⟨w, hw⟩ := hf.total hx + exact agree x w y hw hz ▸ hw + +theorem empty : FunctionGraphOn (∅ : ZFSet.{u}) ∅ := + ⟨∅, ZFSet.empty_subset _, fun x hx => False.elim (ZFSet.notMem_empty x hx)⟩ + +theorem insert {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (fresh : x ∉ A) + (y : ZFSet.{u}) : FunctionGraphOn (Insert.insert x A) (Insert.insert (ZFSet.pair x y) f) := by + classical + refine ⟨Insert.insert y (⋃₀ ⋃₀ f), ?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_insert_iff.1 hz with rfl | hz + · exact ZFSet.pair_mem_prod.2 + ⟨ZFSet.mem_insert_iff.2 (Or.inl rfl), ZFSet.mem_insert_iff.2 (Or.inl rfl)⟩ + · obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz) + exact ZFSet.pair_mem_prod.2 + ⟨ZFSet.mem_insert_iff.2 (Or.inr ha), ZFSet.mem_insert_iff.2 (Or.inr hb)⟩ + · intro a ha + rcases ZFSet.mem_insert_iff.1 ha with rfl | ha + · refine ⟨y, ZFSet.mem_insert_iff.2 (Or.inl rfl), ?_⟩ + intro b hb + rcases ZFSet.mem_insert_iff.1 hb with eq | hb + · exact (ZFSet.pair_inj.1 eq).2 + · exact False.elim (fresh (h.pair_source hb)) + · obtain ⟨b, entry⟩ := h.total ha + refine ⟨b, ZFSet.mem_insert_iff.2 (Or.inr entry), ?_⟩ + intro c hc + rcases ZFSet.mem_insert_iff.1 hc with eq | hc + · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha)) + · exact h.unique hc entry + +theorem successor {A f : ZFSet.{u}} (h : FunctionGraphOn A f) (y : ZFSet.{u}) : + FunctionGraphOn (Insert.insert A A) (Insert.insert (ZFSet.pair A y) f) := + h.insert (ZFSet.mem_irrefl A) y + +end FunctionGraphOn + +theorem functionGraphOn_sUnion {A W : ZFSet.{u}} + (shape : ∀ f ∈ W, ∃ B, B ⊆ A ∧ FunctionGraphOn B f) + (cover : ∀ x ∈ A, ∃ f ∈ W, ∃ y, ZFSet.pair x y ∈ f) + (agree : ∀ f ∈ W, ∀ g ∈ W, ∀ x y z, + ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : + FunctionGraphOn A (⋃₀ W) := by + refine ⟨⋃₀ ⋃₀ (⋃₀ W), ?_, ?_⟩ + · intro z hz + obtain ⟨f, hf, entry⟩ := ZFSet.mem_sUnion.1 hz + obtain ⟨B, subset, func⟩ := shape f hf + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (func.to_isFunc.1 entry) + exact ZFSet.pair_mem_prod.2 ⟨subset hx, pair_second_mem_doubleUnion hz⟩ + · intro x hx + obtain ⟨f, hf, y, entry⟩ := cover x hx + refine ⟨y, ZFSet.mem_sUnion.2 ⟨f, hf, entry⟩, ?_⟩ + intro z hz + obtain ⟨g, hg, rel⟩ := ZFSet.mem_sUnion.1 hz + exact agree g hg f hf x z y rel entry + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.SetRealization.Presentation +universe u +variable {A B : Type u} (s : Presentation A) (e : B ≃ A) + +def reindex : Presentation B where + carrier := s.carrier + encode b := s.encode (e b) + injective := s.injective.comp e.injective + mem_carrier x := by + rw [s.mem_carrier] + exact ⟨fun ⟨a, eq⟩ => ⟨e.symm a, by simpa only [e.apply_symm_apply] using eq⟩, + fun ⟨b, eq⟩ => ⟨e b, eq⟩⟩ + +theorem reindex_carrier : (s.reindex e).carrier = s.carrier := rfl + +theorem reindex_encode (b : B) : (s.reindex e).encode b = s.encode (e b) := rfl + +theorem graph_reindex {C : Type u} (t : Presentation C) (f : C → B) : + t.graph (s.reindex e) f = t.graph s (fun x => e (f x)) := by + apply ZFSet.ext + intro z + rw [mem_graph, mem_graph] + rfl + +end PartitionPilot.SetRealization.Presentation + + + +namespace PartitionPilot.Forcing +universe u + +def NatUnionCode (stages : Nat → ZFSet.{u}) (union : ZFSet.{u}) : Prop := + ∀ x, x ∈ union ↔ ∃ n, x ∈ stages n + +namespace NatUnionCode + +theorem subset {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}} + (code : NatUnionCode stages union) (n : Nat) : stages n ⊆ union := + fun _ hx => (code _).2 ⟨n, hx⟩ + +theorem constant (A : ZFSet.{u}) : NatUnionCode (fun _ => A) A := by + intro x + exact ⟨fun hx => ⟨0, hx⟩, fun ⟨_, hx⟩ => hx⟩ + +theorem prod_left {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}} + (code : NatUnionCode stages union) (A : ZFSet.{u}) : + NatUnionCode (fun n => ZFSet.prod A (stages n)) (ZFSet.prod A union) := by + intro z + constructor + · rintro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + obtain ⟨n, hn⟩ := (code y).1 hy + exact ⟨n, ZFSet.pair_mem_prod.2 ⟨hx, hn⟩⟩ + · rintro ⟨n, hn⟩ + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn + exact ZFSet.pair_mem_prod.2 ⟨hx, code.subset n hy⟩ + +theorem prod {A B : Nat → ZFSet.{u}} {U V : ZFSet.{u}} + (left : NatUnionCode A U) (right : NatUnionCode B V) + (leftMono : ∀ n m, n ≤ m → A n ⊆ A m) + (rightMono : ∀ n m, n ≤ m → B n ⊆ B m) : + NatUnionCode (fun n => ZFSet.prod (A n) (B n)) (ZFSet.prod U V) := by + intro z + constructor + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + obtain ⟨n, hn⟩ := (left x).1 hx + obtain ⟨m, hm⟩ := (right y).1 hy + exact ⟨max n m, ZFSet.pair_mem_prod.2 + ⟨leftMono n _ (le_max_left n m) hn, rightMono m _ (le_max_right n m) hm⟩⟩ + · rintro ⟨n, hn⟩ + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn + exact ZFSet.pair_mem_prod.2 ⟨left.subset n hx, right.subset n hy⟩ + +theorem isFunc {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}} + (domain : NatUnionCode A U) (range : NatUnionCode B V) (graph : NatUnionCode f F) + (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n)) + (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) : ZFSet.IsFunc U V F := by + constructor + · intro z hz + obtain ⟨n, hn⟩ := (graph z).1 hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((functions n).1 hn) + exact ZFSet.pair_mem_prod.2 ⟨domain.subset n hx, range.subset n hy⟩ + · intro x hx + obtain ⟨n, hn⟩ := (domain x).1 hx + obtain ⟨y, entry, _⟩ := (functions n).2 x hn + refine ⟨y, graph.subset n entry, ?_⟩ + intro z hz + obtain ⟨m, hm⟩ := (graph _).1 hz + have first := graphMono n (max n m) (le_max_left n m) entry + have second := graphMono m (max n m) (le_max_right n m) hm + have inDomain := (ZFSet.pair_mem_prod.1 ((functions (max n m)).1 first)).1 + obtain ⟨_, _, unique⟩ := (functions (max n m)).2 x inDomain + exact (unique z second).trans (unique y first).symm + +theorem function_entry_iff {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}} + (graph : NatUnionCode f F) (function : ZFSet.IsFunc U V F) + (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n)) + (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ A n) : + ZFSet.pair x y ∈ F ↔ ZFSet.pair x y ∈ f n := by + constructor + · intro entry + obtain ⟨z, old, _⟩ := (functions n).2 x hx + have oldUnion := graph.subset n old + have inDomain := (ZFSet.pair_mem_prod.1 (function.1 oldUnion)).1 + obtain ⟨_, _, unique⟩ := function.2 x inDomain + have equal : y = z := (unique y entry).trans (unique z oldUnion).symm + exact equal.symm ▸ old + · exact fun entry => graph.subset n entry + +end NatUnionCode + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalSetCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalSetCodes.lean index fecb18e4e23e34cf1a01f3a640de648aabb61d49..1094a178c51316e8d3f3b92ae06ae67bc0b5b025 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalSetCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalSetCodes.lean @@ -1,149 +1,149 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames - -namespace OAI - -section - -namespace PartitionPilot.SetRealization - -universe u - -def SetMembers (Q : ZFSet.{u}) : Type u := Shrink Q - -namespace SetMembers - -noncomputable def raw {Q : ZFSet.{u}} (x : SetMembers Q) : ZFSet.{u} := - ((equivShrink.{u} Q).symm x).val - -theorem raw_mem {Q : ZFSet.{u}} (x : SetMembers Q) : raw x ∈ Q := - ((equivShrink.{u} Q).symm x).property - -theorem raw_injective (Q : ZFSet.{u}) : Function.Injective (@raw Q) := by - intro x y eq - apply (equivShrink.{u} Q).symm.injective - exact Subtype.ext eq - -noncomputable def ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : SetMembers Q := - equivShrink.{u} Q ⟨x, hx⟩ - -theorem raw_ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : raw (ofMem x hx) = x := by - exact congrArg Subtype.val ((equivShrink.{u} Q).symm_apply_apply ⟨x, hx⟩) - -theorem ofMem_raw {Q : ZFSet.{u}} (x : SetMembers Q) : ofMem (raw x) (raw_mem x) = x := - (equivShrink.{u} Q).apply_symm_apply x - -noncomputable def presentation (Q : ZFSet.{u}) : Presentation (SetMembers Q) where - carrier := Q - encode := raw - injective := raw_injective Q - mem_carrier x := ⟨fun hx => ⟨ofMem x hx, raw_ofMem x hx⟩, - fun ⟨a, eq⟩ => eq ▸ raw_mem a⟩ - -end SetMembers - -end PartitionPilot.SetRealization - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem setMember_ground {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) (x : SetMembers Q) : - SetMembers.raw x ∈ M.sets := M.transitive hQ (SetMembers.raw_mem x) - -theorem setMembers_countable (small : M.sets.Countable) {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) : - Countable (SetMembers Q) := M.conditions_countable (SetMembers.presentation Q) small hQ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -universe u - -def natSetCode (n : Nat) : ZFSet.{u} := ZFSet.mk (PSet.ofNat n) - -theorem natSetCode_zero : natSetCode 0 = (∅ : ZFSet.{u}) := rfl - -theorem natSetCode_succ (n : Nat) : - natSetCode (n + 1) = insert (natSetCode n) (natSetCode n) := rfl - -theorem mem_omega_iff_natSetCode (x : ZFSet.{u}) : - x ∈ ZFSet.omega ↔ ∃ n, x = natSetCode n := by - induction x using Quotient.inductionOn with - | h x => - constructor - · rintro ⟨⟨n⟩, h⟩ - exact ⟨n, ZFSet.sound h⟩ - · rintro ⟨n, h⟩ - exact ⟨⟨n⟩, ZFSet.exact h⟩ - -theorem natSetCode_mem_omega (n : Nat) : natSetCode n ∈ ZFSet.omega.{u} := - (mem_omega_iff_natSetCode _).2 ⟨n, rfl⟩ - -def zeroOrSuccessor (x : ZFSet.{u}) : Prop := - x = ∅ ∨ ∃ y ∈ x, x = insert y y - -def naturalSetProperty (x : ZFSet.{u}) : Prop := - setTransitive x ∧ zeroOrSuccessor x ∧ - ∀ y ∈ x, setTransitive y ∧ zeroOrSuccessor y - -theorem naturalSetProperty_empty : naturalSetProperty (∅ : ZFSet.{u}) := by - refine ⟨?_, Or.inl rfl, ?_⟩ - · intro y hy - exact False.elim (ZFSet.notMem_empty y hy) - · intro y hy - exact False.elim (ZFSet.notMem_empty y hy) - -theorem naturalSetProperty_succ {x : ZFSet.{u}} (h : naturalSetProperty x) : - naturalSetProperty (insert x x) := by - refine ⟨?_, Or.inr ⟨x, ZFSet.mem_insert x x, rfl⟩, ?_⟩ - · intro y hy z hz - rcases ZFSet.mem_insert_iff.1 hy with rfl | hy - · exact ZFSet.mem_insert_of_mem _ hz - · exact ZFSet.mem_insert_of_mem x (h.1 y hy z hz) - · intro y hy - rcases ZFSet.mem_insert_iff.1 hy with rfl | hy - · exact ⟨h.1, h.2.1⟩ - · exact h.2.2 y hy - -theorem naturalSetProperty_member {x y : ZFSet.{u}} - (h : naturalSetProperty x) (hy : y ∈ x) : naturalSetProperty y := by - have facts := h.2.2 y hy - exact ⟨facts.1, facts.2, fun z hz => h.2.2 z (h.1 y hy z hz)⟩ - -theorem naturalSetProperty_iff (x : ZFSet.{u}) : - naturalSetProperty x ↔ ∃ n, x = natSetCode n := by - constructor - · induction x using ZFSet.inductionOn with - | h x ih => - intro hx - rcases hx.2.1 with empty | ⟨y, hy, succ⟩ - · exact ⟨0, empty⟩ - · obtain ⟨n, eq⟩ := ih y hy (naturalSetProperty_member hx hy) - exact ⟨n + 1, by rw [succ, eq]; rfl⟩ - · rintro ⟨n, rfl⟩ - induction n with - | zero => exact naturalSetProperty_empty - | succ n ih => exact naturalSetProperty_succ ih - -theorem naturalSetProperty_iff_mem_omega (x : ZFSet.{u}) : - naturalSetProperty x ↔ x ∈ ZFSet.omega := - (naturalSetProperty_iff x).trans (mem_omega_iff_natSetCode x).symm - -instance omegaMembers_countable : Countable (SetRealization.SetMembers ZFSet.omega.{u}) := by - let f (n : Nat) := SetRealization.SetMembers.ofMem (natSetCode n) (natSetCode_mem_omega n) - have onto : Function.Surjective f := by - intro x - obtain ⟨n, eq⟩ := (mem_omega_iff_natSetCode _).1 (SetRealization.SetMembers.raw_mem x) - refine ⟨n, SetRealization.SetMembers.raw_injective _ ?_⟩ - exact (SetRealization.SetMembers.raw_ofMem _ _).trans eq.symm - exact onto.countable - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames + +namespace OAI + +section + +namespace PartitionPilot.SetRealization + +universe u + +def SetMembers (Q : ZFSet.{u}) : Type u := Shrink Q + +namespace SetMembers + +noncomputable def raw {Q : ZFSet.{u}} (x : SetMembers Q) : ZFSet.{u} := + ((equivShrink.{u} Q).symm x).val + +theorem raw_mem {Q : ZFSet.{u}} (x : SetMembers Q) : raw x ∈ Q := + ((equivShrink.{u} Q).symm x).property + +theorem raw_injective (Q : ZFSet.{u}) : Function.Injective (@raw Q) := by + intro x y eq + apply (equivShrink.{u} Q).symm.injective + exact Subtype.ext eq + +noncomputable def ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : SetMembers Q := + equivShrink.{u} Q ⟨x, hx⟩ + +theorem raw_ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : raw (ofMem x hx) = x := by + exact congrArg Subtype.val ((equivShrink.{u} Q).symm_apply_apply ⟨x, hx⟩) + +theorem ofMem_raw {Q : ZFSet.{u}} (x : SetMembers Q) : ofMem (raw x) (raw_mem x) = x := + (equivShrink.{u} Q).apply_symm_apply x + +noncomputable def presentation (Q : ZFSet.{u}) : Presentation (SetMembers Q) where + carrier := Q + encode := raw + injective := raw_injective Q + mem_carrier x := ⟨fun hx => ⟨ofMem x hx, raw_ofMem x hx⟩, + fun ⟨a, eq⟩ => eq ▸ raw_mem a⟩ + +end SetMembers + +end PartitionPilot.SetRealization + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem setMember_ground {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) (x : SetMembers Q) : + SetMembers.raw x ∈ M.sets := M.transitive hQ (SetMembers.raw_mem x) + +theorem setMembers_countable (small : M.sets.Countable) {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) : + Countable (SetMembers Q) := M.conditions_countable (SetMembers.presentation Q) small hQ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +universe u + +def natSetCode (n : Nat) : ZFSet.{u} := ZFSet.mk (PSet.ofNat n) + +theorem natSetCode_zero : natSetCode 0 = (∅ : ZFSet.{u}) := rfl + +theorem natSetCode_succ (n : Nat) : + natSetCode (n + 1) = insert (natSetCode n) (natSetCode n) := rfl + +theorem mem_omega_iff_natSetCode (x : ZFSet.{u}) : + x ∈ ZFSet.omega ↔ ∃ n, x = natSetCode n := by + induction x using Quotient.inductionOn with + | h x => + constructor + · rintro ⟨⟨n⟩, h⟩ + exact ⟨n, ZFSet.sound h⟩ + · rintro ⟨n, h⟩ + exact ⟨⟨n⟩, ZFSet.exact h⟩ + +theorem natSetCode_mem_omega (n : Nat) : natSetCode n ∈ ZFSet.omega.{u} := + (mem_omega_iff_natSetCode _).2 ⟨n, rfl⟩ + +def zeroOrSuccessor (x : ZFSet.{u}) : Prop := + x = ∅ ∨ ∃ y ∈ x, x = insert y y + +def naturalSetProperty (x : ZFSet.{u}) : Prop := + setTransitive x ∧ zeroOrSuccessor x ∧ + ∀ y ∈ x, setTransitive y ∧ zeroOrSuccessor y + +theorem naturalSetProperty_empty : naturalSetProperty (∅ : ZFSet.{u}) := by + refine ⟨?_, Or.inl rfl, ?_⟩ + · intro y hy + exact False.elim (ZFSet.notMem_empty y hy) + · intro y hy + exact False.elim (ZFSet.notMem_empty y hy) + +theorem naturalSetProperty_succ {x : ZFSet.{u}} (h : naturalSetProperty x) : + naturalSetProperty (insert x x) := by + refine ⟨?_, Or.inr ⟨x, ZFSet.mem_insert x x, rfl⟩, ?_⟩ + · intro y hy z hz + rcases ZFSet.mem_insert_iff.1 hy with rfl | hy + · exact ZFSet.mem_insert_of_mem _ hz + · exact ZFSet.mem_insert_of_mem x (h.1 y hy z hz) + · intro y hy + rcases ZFSet.mem_insert_iff.1 hy with rfl | hy + · exact ⟨h.1, h.2.1⟩ + · exact h.2.2 y hy + +theorem naturalSetProperty_member {x y : ZFSet.{u}} + (h : naturalSetProperty x) (hy : y ∈ x) : naturalSetProperty y := by + have facts := h.2.2 y hy + exact ⟨facts.1, facts.2, fun z hz => h.2.2 z (h.1 y hy z hz)⟩ + +theorem naturalSetProperty_iff (x : ZFSet.{u}) : + naturalSetProperty x ↔ ∃ n, x = natSetCode n := by + constructor + · induction x using ZFSet.inductionOn with + | h x ih => + intro hx + rcases hx.2.1 with empty | ⟨y, hy, succ⟩ + · exact ⟨0, empty⟩ + · obtain ⟨n, eq⟩ := ih y hy (naturalSetProperty_member hx hy) + exact ⟨n + 1, by rw [succ, eq]; rfl⟩ + · rintro ⟨n, rfl⟩ + induction n with + | zero => exact naturalSetProperty_empty + | succ n ih => exact naturalSetProperty_succ ih + +theorem naturalSetProperty_iff_mem_omega (x : ZFSet.{u}) : + naturalSetProperty x ↔ x ∈ ZFSet.omega := + (naturalSetProperty_iff x).trans (mem_omega_iff_natSetCode x).symm + +instance omegaMembers_countable : Countable (SetRealization.SetMembers ZFSet.omega.{u}) := by + let f (n : Nat) := SetRealization.SetMembers.ofMem (natSetCode n) (natSetCode_mem_omega n) + have onto : Function.Surjective f := by + intro x + obtain ⟨n, eq⟩ := (mem_omega_iff_natSetCode _).1 (SetRealization.SetMembers.raw_mem x) + refine ⟨n, SetRealization.SetMembers.raw_injective _ ?_⟩ + exact (SetRealization.SetMembers.raw_ofMem _ _).trans eq.symm + exact onto.countable + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalStepFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalStepFormulas.lean index f5d3a10926b5635dee7f4f754d6c04bf05d55fd0..cd32b5aa5d9c8bc0e81dbc482be4309631f6f044 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalStepFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalStepFormulas.lean @@ -1,259 +1,259 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -universe u - -namespace SetFormula - -def functionGraphOnFormula {n} (a f : Fin n) : SetFormula n := - ex (BoundedFormula.functionFormula a.succ 0 f.succ).toFormula - -end SetFormula - -namespace BoundedFormula - -def graphRestrictionFormula {n} (p a b f : Fin n) : BoundedFormula n := - .conj (.allMem p (.conj (.mem 0 f.succ) (productElementFormula 0 a.succ b.succ))) - (.allMem f (imp (productElementFormula 0 a.succ b.succ) (.mem 0 p.succ))) - -theorem truth_graphRestrictionFormula {n} (p a b f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (graphRestrictionFormula p a b f) env ↔ - env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) := by - simp only [graphRestrictionFormula, Truth, truth_imp, truth_productElementFormula] - change ((∀ z ∈ env p, z ∈ env f ∧ z ∈ ZFSet.prod (env a) (env b)) ∧ - (∀ z ∈ env f, z ∈ ZFSet.prod (env a) (env b) → z ∈ env p)) ↔ _ - constructor - · rintro ⟨forward, backward⟩ - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - exact ⟨forward z, fun hz => backward z hz.1 hz.2⟩ - · intro eq - rw [eq] - exact ⟨fun z hz => ZFSet.mem_sep.1 hz, fun z hz bound => ZFSet.mem_sep.2 ⟨hz, bound⟩⟩ - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_functionGraphOnFormula - (unions : Realize M.sets SetFormula.union Fin.elim0) - {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (functionGraphOnFormula a f) env ↔ FunctionGraphOn (env a) (env f) := by - rw [functionGraphOnFormula, realize_ex] - constructor - · rintro ⟨B, hB, code⟩ - exact ⟨B, (BoundedFormula.truth_functionFormula a.succ 0 f.succ _).1 - ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hB members)).1 code)⟩ - · intro code - have range := M.union_mem unions (M.union_mem unions (members f)) - exact ⟨ZFSet.sUnion (ZFSet.sUnion (env f)), range, - (BoundedFormula.realize_toFormula M _ _ (Fin.cases range members)).2 - ((BoundedFormula.truth_functionFormula a.succ 0 f.succ _).2 code.to_isFunc)⟩ - -theorem realize_graphRestrictionFormula {n} (p a b f : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (BoundedFormula.graphRestrictionFormula p a b f).toFormula env ↔ - env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) := - (BoundedFormula.realize_toFormula M _ _ members).trans - (BoundedFormula.truth_graphRestrictionFormula p a b f env) - -end TransitiveGround - -end - - - - -open SetFormula -universe u - -def groundRecursionStep (M : TransitiveGround.{u}) {k : Nat} - (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) (a p y : ZFSet.{u}) : Prop := - p ∈ M.sets ∧ y ∈ M.sets ∧ Realize M.sets φ (extend a (extend p (extend y params))) - -namespace SetFormula - -def ordinalRecursionTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) := - ex <| .conj (BoundedFormula.functionFormula 1 0 2).toFormula <| - .all <| imp (.mem 0 2) <| .all <| imp (.mem 0 2) <| - imp (BoundedFormula.pairMembershipFormula 1 0 4).toFormula <| - ex <| .conj (BoundedFormula.graphRestrictionFormula 0 2 3 5).toFormula <| - reindex (extend 2 (extend 0 (extend 1 - (fun j => j.succ.succ.succ.succ.succ.succ)))) φ - -def ordinalSuccessorTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) := - ex (.conj (BoundedFormula.successorFormula 0 1).toFormula - (reindex (extend 0 (extend 2 (fun j => j.succ.succ.succ))) (ordinalRecursionTraceFormula φ))) - -end SetFormula - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem realize_ordinalRecursionTraceFormula - (unions : Realize M.sets SetFormula.union Fin.elim0) - {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {A f : ZFSet.{u}} - (hA : A ∈ M.sets) (hf : f ∈ M.sets) : - Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) ↔ - OrdinalRecursionTrace (groundRecursionStep M φ params) A f := by - rw [ordinalRecursionTraceFormula, realize_ex] - constructor - · rintro ⟨B, hB, function, steps⟩ - have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets := - Fin.cases hB (Fin.cases hA (Fin.cases hf members)) - have func : ZFSet.IsFunc A B f := (BoundedFormula.truth_functionFormula 1 0 2 _).1 - ((BoundedFormula.realize_toFormula M _ _ mem3).1 function) - refine ⟨⟨B, func⟩, ?_⟩ - intro a ha y ay - have haM := M.transitive hA ha - have hyB := (ZFSet.pair_mem_prod.1 (func.1 ay)).2 - have hyM := M.transitive hB hyB - have first := (realize_imp M.sets _ _ _).1 (steps a haM) ha - have second := (realize_imp M.sets _ _ _).1 (first y hyM) hyB - have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets := - Fin.cases hyM (Fin.cases haM mem3) - have pairCode := (BoundedFormula.realize_toFormula M _ _ mem5).2 - ((BoundedFormula.truth_pairMembershipFormula 1 0 4 _).2 ay) - obtain ⟨p, hp, restricted, step⟩ := (realize_ex M.sets _ _).1 - ((realize_imp M.sets _ _ _).1 second pairCode) - have eq := (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).1 restricted - have same : p = graphRestriction a f := eq.trans (graphRestriction_eq_sep func).symm - rw [realize_reindex, map_extend, map_extend, map_extend] at step - change Realize M.sets φ (extend a (extend p (extend y params))) at step - rw [same] at hp step - exact ⟨hp, hyM, step⟩ - · intro trace - let B := ZFSet.sUnion (ZFSet.sUnion f) - have hB : B ∈ M.sets := M.union_mem unions (M.union_mem unions hf) - have func : ZFSet.IsFunc A B f := trace.1.to_isFunc - have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets := - Fin.cases hB (Fin.cases hA (Fin.cases hf members)) - refine ⟨B, hB, (BoundedFormula.realize_toFormula M _ _ mem3).2 - ((BoundedFormula.truth_functionFormula 1 0 2 _).2 func), ?_⟩ - intro a haM - apply (realize_imp M.sets _ _ _).2 - intro ha y hyM - apply (realize_imp M.sets _ _ _).2 - intro _ - apply (realize_imp M.sets _ _ _).2 - intro pairCode - have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets := - Fin.cases hyM (Fin.cases haM mem3) - have ay := (BoundedFormula.truth_pairMembershipFormula 1 0 4 _).1 - ((BoundedFormula.realize_toFormula M _ _ mem5).1 pairCode) - obtain ⟨hp, _, step⟩ := trace.2 a ha y ay - apply (realize_ex M.sets _ _).2 - refine ⟨graphRestriction a f, hp, - (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).2 - (graphRestriction_eq_sep func), ?_⟩ - rw [realize_reindex, map_extend, map_extend, map_extend] - exact step - -theorem realize_ordinalSuccessorTraceFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {a f : ZFSet.{u}} - (ha : a ∈ M.sets) (hf : f ∈ M.sets) : - Realize M.sets (ordinalSuccessorTraceFormula φ) (extend a (extend f params)) ↔ - OrdinalRecursionTrace (groundRecursionStep M φ params) (insert a a) f := by - rw [ordinalSuccessorTraceFormula, realize_ex] - constructor - · rintro ⟨A, hA, successor, trace⟩ - have eq := (BoundedFormula.truth_successorFormula 0 1 _).1 - ((BoundedFormula.realize_toFormula M _ _ - (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).1 successor) - rw [realize_reindex, map_extend, map_extend] at trace - change Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) at trace - have code := (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).1 trace - exact eq ▸ code - · intro trace - have hA := M.insert_mem pairing unions ha ha - refine ⟨insert a a, hA, (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).2 - ((BoundedFormula.truth_successorFormula 0 1 _).2 rfl), ?_⟩ - rw [realize_reindex, map_extend, map_extend] - exact (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).2 trace - -end TransitiveGround - - - - - -namespace SetFormula - -def naturalStepFormula {k : Nat} (successor : SetFormula (k + 2)) : SetFormula (k + 4) := - disj (.conj (BoundedFormula.emptyFormula 0).toFormula (.equal 2 3)) - (ex (ex (.conj (BoundedFormula.successorFormula 2 1).toFormula - (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula - (reindex (extend 0 (extend 4 (fun j => j.succ.succ.succ.succ.succ.succ))) successor))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_naturalStepFormula {k : Nat} (φ : SetFormula (k + 2)) - (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) - {a p y base : ZFSet.{u}} (ha : a ∈ M.sets) (hp : p ∈ M.sets) - (hy : y ∈ M.sets) (hb : base ∈ M.sets) : - Realize M.sets (naturalStepFormula φ) (extend a (extend p (extend y (extend base params)))) ↔ - (a = ∅ ∧ y = base) ∨ ∃ m ∈ M.sets, ∃ x ∈ M.sets, - a = insert m m ∧ ZFSet.pair m x ∈ p ∧ - Realize M.sets φ (extend x (extend y params)) := by - have mem4 : ∀ i, extend a (extend p (extend y (extend base params))) i ∈ M.sets := - Fin.cases ha (Fin.cases hp (Fin.cases hy (Fin.cases hb members))) - rw [naturalStepFormula, realize_disj] - apply or_congr - · change (Realize M.sets (BoundedFormula.emptyFormula 0).toFormula _ ∧ y = base) ↔ _ - exact and_congr ((BoundedFormula.realize_toFormula M _ _ mem4).trans - (BoundedFormula.truth_emptyFormula _ _)) Iff.rfl - · rw [realize_ex] - apply exists_congr - intro m - apply and_congr_right - intro hm - rw [realize_ex] - apply exists_congr - intro x - apply and_congr_right - intro hx - have mem6 : ∀ i, extend x (extend m (extend a (extend p (extend y (extend base params))))) i ∈ M.sets := - Fin.cases hx (Fin.cases hm mem4) - change (Realize M.sets (BoundedFormula.successorFormula 2 1).toFormula _ ∧ - Realize M.sets (BoundedFormula.pairMembershipFormula 1 0 3).toFormula _ ∧ _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_successorFormula, - BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_pairMembershipFormula, - realize_reindex, map_extend, map_extend] - rfl - -end TransitiveGround - -theorem natSetCode_succ_eq_insert_iff (n : Nat) (x : ZFSet.{u}) : - natSetCode (n + 1) = insert x x ↔ x = natSetCode n := by - constructor - · intro equal - have member : x ∈ natSetCode (n + 1) := equal.symm ▸ ZFSet.mem_insert x x - obtain ⟨j, _, rfl⟩ := (mem_natSetCode x (n + 1)).1 member - have codes : natSetCode (n + 1) = natSetCode (j + 1) := equal - exact congrArg natSetCode (Nat.add_right_cancel (natSetCode_injective codes)).symm - · rintro rfl - rfl - - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +universe u + +namespace SetFormula + +def functionGraphOnFormula {n} (a f : Fin n) : SetFormula n := + ex (BoundedFormula.functionFormula a.succ 0 f.succ).toFormula + +end SetFormula + +namespace BoundedFormula + +def graphRestrictionFormula {n} (p a b f : Fin n) : BoundedFormula n := + .conj (.allMem p (.conj (.mem 0 f.succ) (productElementFormula 0 a.succ b.succ))) + (.allMem f (imp (productElementFormula 0 a.succ b.succ) (.mem 0 p.succ))) + +theorem truth_graphRestrictionFormula {n} (p a b f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (graphRestrictionFormula p a b f) env ↔ + env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) := by + simp only [graphRestrictionFormula, Truth, truth_imp, truth_productElementFormula] + change ((∀ z ∈ env p, z ∈ env f ∧ z ∈ ZFSet.prod (env a) (env b)) ∧ + (∀ z ∈ env f, z ∈ ZFSet.prod (env a) (env b) → z ∈ env p)) ↔ _ + constructor + · rintro ⟨forward, backward⟩ + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + exact ⟨forward z, fun hz => backward z hz.1 hz.2⟩ + · intro eq + rw [eq] + exact ⟨fun z hz => ZFSet.mem_sep.1 hz, fun z hz bound => ZFSet.mem_sep.2 ⟨hz, bound⟩⟩ + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_functionGraphOnFormula + (unions : Realize M.sets SetFormula.union Fin.elim0) + {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (functionGraphOnFormula a f) env ↔ FunctionGraphOn (env a) (env f) := by + rw [functionGraphOnFormula, realize_ex] + constructor + · rintro ⟨B, hB, code⟩ + exact ⟨B, (BoundedFormula.truth_functionFormula a.succ 0 f.succ _).1 + ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hB members)).1 code)⟩ + · intro code + have range := M.union_mem unions (M.union_mem unions (members f)) + exact ⟨ZFSet.sUnion (ZFSet.sUnion (env f)), range, + (BoundedFormula.realize_toFormula M _ _ (Fin.cases range members)).2 + ((BoundedFormula.truth_functionFormula a.succ 0 f.succ _).2 code.to_isFunc)⟩ + +theorem realize_graphRestrictionFormula {n} (p a b f : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (BoundedFormula.graphRestrictionFormula p a b f).toFormula env ↔ + env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) := + (BoundedFormula.realize_toFormula M _ _ members).trans + (BoundedFormula.truth_graphRestrictionFormula p a b f env) + +end TransitiveGround + +end + + + + +open SetFormula +universe u + +def groundRecursionStep (M : TransitiveGround.{u}) {k : Nat} + (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) (a p y : ZFSet.{u}) : Prop := + p ∈ M.sets ∧ y ∈ M.sets ∧ Realize M.sets φ (extend a (extend p (extend y params))) + +namespace SetFormula + +def ordinalRecursionTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) := + ex <| .conj (BoundedFormula.functionFormula 1 0 2).toFormula <| + .all <| imp (.mem 0 2) <| .all <| imp (.mem 0 2) <| + imp (BoundedFormula.pairMembershipFormula 1 0 4).toFormula <| + ex <| .conj (BoundedFormula.graphRestrictionFormula 0 2 3 5).toFormula <| + reindex (extend 2 (extend 0 (extend 1 + (fun j => j.succ.succ.succ.succ.succ.succ)))) φ + +def ordinalSuccessorTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) := + ex (.conj (BoundedFormula.successorFormula 0 1).toFormula + (reindex (extend 0 (extend 2 (fun j => j.succ.succ.succ))) (ordinalRecursionTraceFormula φ))) + +end SetFormula + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem realize_ordinalRecursionTraceFormula + (unions : Realize M.sets SetFormula.union Fin.elim0) + {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {A f : ZFSet.{u}} + (hA : A ∈ M.sets) (hf : f ∈ M.sets) : + Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) ↔ + OrdinalRecursionTrace (groundRecursionStep M φ params) A f := by + rw [ordinalRecursionTraceFormula, realize_ex] + constructor + · rintro ⟨B, hB, function, steps⟩ + have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets := + Fin.cases hB (Fin.cases hA (Fin.cases hf members)) + have func : ZFSet.IsFunc A B f := (BoundedFormula.truth_functionFormula 1 0 2 _).1 + ((BoundedFormula.realize_toFormula M _ _ mem3).1 function) + refine ⟨⟨B, func⟩, ?_⟩ + intro a ha y ay + have haM := M.transitive hA ha + have hyB := (ZFSet.pair_mem_prod.1 (func.1 ay)).2 + have hyM := M.transitive hB hyB + have first := (realize_imp M.sets _ _ _).1 (steps a haM) ha + have second := (realize_imp M.sets _ _ _).1 (first y hyM) hyB + have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets := + Fin.cases hyM (Fin.cases haM mem3) + have pairCode := (BoundedFormula.realize_toFormula M _ _ mem5).2 + ((BoundedFormula.truth_pairMembershipFormula 1 0 4 _).2 ay) + obtain ⟨p, hp, restricted, step⟩ := (realize_ex M.sets _ _).1 + ((realize_imp M.sets _ _ _).1 second pairCode) + have eq := (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).1 restricted + have same : p = graphRestriction a f := eq.trans (graphRestriction_eq_sep func).symm + rw [realize_reindex, map_extend, map_extend, map_extend] at step + change Realize M.sets φ (extend a (extend p (extend y params))) at step + rw [same] at hp step + exact ⟨hp, hyM, step⟩ + · intro trace + let B := ZFSet.sUnion (ZFSet.sUnion f) + have hB : B ∈ M.sets := M.union_mem unions (M.union_mem unions hf) + have func : ZFSet.IsFunc A B f := trace.1.to_isFunc + have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets := + Fin.cases hB (Fin.cases hA (Fin.cases hf members)) + refine ⟨B, hB, (BoundedFormula.realize_toFormula M _ _ mem3).2 + ((BoundedFormula.truth_functionFormula 1 0 2 _).2 func), ?_⟩ + intro a haM + apply (realize_imp M.sets _ _ _).2 + intro ha y hyM + apply (realize_imp M.sets _ _ _).2 + intro _ + apply (realize_imp M.sets _ _ _).2 + intro pairCode + have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets := + Fin.cases hyM (Fin.cases haM mem3) + have ay := (BoundedFormula.truth_pairMembershipFormula 1 0 4 _).1 + ((BoundedFormula.realize_toFormula M _ _ mem5).1 pairCode) + obtain ⟨hp, _, step⟩ := trace.2 a ha y ay + apply (realize_ex M.sets _ _).2 + refine ⟨graphRestriction a f, hp, + (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).2 + (graphRestriction_eq_sep func), ?_⟩ + rw [realize_reindex, map_extend, map_extend, map_extend] + exact step + +theorem realize_ordinalSuccessorTraceFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {a f : ZFSet.{u}} + (ha : a ∈ M.sets) (hf : f ∈ M.sets) : + Realize M.sets (ordinalSuccessorTraceFormula φ) (extend a (extend f params)) ↔ + OrdinalRecursionTrace (groundRecursionStep M φ params) (insert a a) f := by + rw [ordinalSuccessorTraceFormula, realize_ex] + constructor + · rintro ⟨A, hA, successor, trace⟩ + have eq := (BoundedFormula.truth_successorFormula 0 1 _).1 + ((BoundedFormula.realize_toFormula M _ _ + (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).1 successor) + rw [realize_reindex, map_extend, map_extend] at trace + change Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) at trace + have code := (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).1 trace + exact eq ▸ code + · intro trace + have hA := M.insert_mem pairing unions ha ha + refine ⟨insert a a, hA, (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).2 + ((BoundedFormula.truth_successorFormula 0 1 _).2 rfl), ?_⟩ + rw [realize_reindex, map_extend, map_extend] + exact (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).2 trace + +end TransitiveGround + + + + + +namespace SetFormula + +def naturalStepFormula {k : Nat} (successor : SetFormula (k + 2)) : SetFormula (k + 4) := + disj (.conj (BoundedFormula.emptyFormula 0).toFormula (.equal 2 3)) + (ex (ex (.conj (BoundedFormula.successorFormula 2 1).toFormula + (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula + (reindex (extend 0 (extend 4 (fun j => j.succ.succ.succ.succ.succ.succ))) successor))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_naturalStepFormula {k : Nat} (φ : SetFormula (k + 2)) + (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) + {a p y base : ZFSet.{u}} (ha : a ∈ M.sets) (hp : p ∈ M.sets) + (hy : y ∈ M.sets) (hb : base ∈ M.sets) : + Realize M.sets (naturalStepFormula φ) (extend a (extend p (extend y (extend base params)))) ↔ + (a = ∅ ∧ y = base) ∨ ∃ m ∈ M.sets, ∃ x ∈ M.sets, + a = insert m m ∧ ZFSet.pair m x ∈ p ∧ + Realize M.sets φ (extend x (extend y params)) := by + have mem4 : ∀ i, extend a (extend p (extend y (extend base params))) i ∈ M.sets := + Fin.cases ha (Fin.cases hp (Fin.cases hy (Fin.cases hb members))) + rw [naturalStepFormula, realize_disj] + apply or_congr + · change (Realize M.sets (BoundedFormula.emptyFormula 0).toFormula _ ∧ y = base) ↔ _ + exact and_congr ((BoundedFormula.realize_toFormula M _ _ mem4).trans + (BoundedFormula.truth_emptyFormula _ _)) Iff.rfl + · rw [realize_ex] + apply exists_congr + intro m + apply and_congr_right + intro hm + rw [realize_ex] + apply exists_congr + intro x + apply and_congr_right + intro hx + have mem6 : ∀ i, extend x (extend m (extend a (extend p (extend y (extend base params))))) i ∈ M.sets := + Fin.cases hx (Fin.cases hm mem4) + change (Realize M.sets (BoundedFormula.successorFormula 2 1).toFormula _ ∧ + Realize M.sets (BoundedFormula.pairMembershipFormula 1 0 3).toFormula _ ∧ _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_successorFormula, + BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_pairMembershipFormula, + realize_reindex, map_extend, map_extend] + rfl + +end TransitiveGround + +theorem natSetCode_succ_eq_insert_iff (n : Nat) (x : ZFSet.{u}) : + natSetCode (n + 1) = insert x x ↔ x = natSetCode n := by + constructor + · intro equal + have member : x ∈ natSetCode (n + 1) := equal.symm ▸ ZFSet.mem_insert x x + obtain ⟨j, _, rfl⟩ := (mem_natSetCode x (n + 1)).1 member + have codes : natSetCode (n + 1) = natSetCode (j + 1) := equal + exact congrArg natSetCode (Nat.add_right_cancel (natSetCode_injective codes)).symm + · rintro rfl + rfl + + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NonemptyTupleFields.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NonemptyTupleFields.lean index 66edb0e7b78e726abaacdeba949ff930c46f3162..b885371d2db1e9fce3dfbe6bdeb230943202fa50 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/NonemptyTupleFields.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/NonemptyTupleFields.lean @@ -1,482 +1,482 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundInjectionRestrictions - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def nonemptyTupleCode : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u} - | 0, fields => fields 0 - | k + 1, fields => ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ)) - -theorem nonemptyTupleCode_injective (k : Nat) : Function.Injective (nonemptyTupleCode.{u} k) := by - induction k with - | zero => - intro fields fields' equal - funext i - exact Fin.cases equal (fun j => Fin.elim0 j) i - | succ k ih => - intro fields fields' equal - obtain ⟨head, tail⟩ := ZFSet.pair_inj.1 equal - have same := ih tail - funext i - exact Fin.cases head (fun j => congrFun same j) i - -namespace BoundedFormula - -open SetFormula - -def nonemptyTupleFormula : (k : Nat) → {n : Nat} → - Fin n → (Fin (k + 1) → Fin n) → BoundedFormula n - | 0, _, z, fields => .equal z (fields 0) - | k + 1, _, z, fields => exMem z (exMem 0 - (.conj (orderedPairFormula z.succ.succ (fields 0).succ.succ 0) - (nonemptyTupleFormula k 0 (fun i => (fields i.succ).succ.succ)))) - -theorem truth_nonemptyTupleFormula (k : Nat) {n : Nat} (z : Fin n) - (fields : Fin (k + 1) → Fin n) (env : Fin n → ZFSet.{u}) : - Truth (nonemptyTupleFormula k z fields) env ↔ - env z = nonemptyTupleCode k (fun i => env (fields i)) := by - induction k generalizing n with - | zero => rfl - | succ k ih => - simp only [nonemptyTupleFormula, truth_exMem, Truth, truth_orderedPairFormula, ih] - change (∃ a ∈ env z, ∃ b ∈ a, env z = ZFSet.pair (env (fields 0)) b ∧ - b = nonemptyTupleCode k (fun i => env (fields i.succ))) ↔ _ - constructor - · rintro ⟨_, _, b, _, outer, tail⟩ - rw [outer, tail] - rfl - · intro equal - let tail := nonemptyTupleCode k (fun i => env (fields i.succ)) - have outer : env z = ZFSet.pair (env (fields 0)) tail := equal - refine ⟨{env (fields 0), tail}, ?_, tail, ZFSet.mem_pair.2 (Or.inr rfl), outer, rfl⟩ - rw [outer] - exact ZFSet.mem_pair.2 (Or.inr rfl) - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem nonemptyTupleCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) (ground : ∀ i, fields i ∈ M.sets) : - nonemptyTupleCode k fields ∈ M.sets := by - induction k with - | zero => exact ground 0 - | succ k ih => exact M.orderedPair_mem pairing (ground 0) (ih _ (fun i => ground i.succ)) - -theorem nonemptyTupleCode_field_mem (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) - (ground : nonemptyTupleCode k fields ∈ M.sets) : ∀ i, fields i ∈ M.sets := by - induction k with - | zero => exact Fin.cases ground (fun i => Fin.elim0 i) - | succ k ih => - have pairGround : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ)) ∈ M.sets := ground - have both : ({fields 0, nonemptyTupleCode k (fun i => fields i.succ)} : ZFSet.{u}) ∈ M.sets := - M.transitive pairGround (ZFSet.mem_pair.2 (Or.inr rfl)) - have head := M.transitive both (ZFSet.mem_pair.2 (Or.inl rfl)) - have tail := M.transitive both (ZFSet.mem_pair.2 (Or.inr rfl)) - exact Fin.cases head (ih _ tail) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def reindex : {n m : Nat} → (Fin n → Fin m) → BoundedFormula n → BoundedFormula m - | _, _, f, .equal i j => .equal (f i) (f j) - | _, _, f, .mem i j => .mem (f i) (f j) - | _, _, f, .neg φ => .neg (reindex f φ) - | _, _, f, .conj φ ψ => .conj (reindex f φ) (reindex f ψ) - | _, _, f, .allMem b φ => .allMem (f b) (reindex (liftIndex f) φ) - -theorem truth_reindex {n m} (f : Fin n → Fin m) (φ : BoundedFormula n) - (env : Fin m → ZFSet.{u}) : - Truth (reindex f φ) env ↔ Truth φ (fun i => env (f i)) := by - induction φ generalizing m with - | equal i j => rfl - | mem i j => rfl - | neg φ ih => exact not_congr (ih f env) - | conj φ ψ ihφ ihψ => exact and_congr (ihφ f env) (ihψ f env) - | allMem b φ ih => - change (∀ x ∈ env (f b), Truth (reindex (liftIndex f) φ) (extend x env)) ↔ _ - apply forall_congr' - intro x - apply forall_congr' - intro _ - rw [ih, extend_liftIndex] - -def exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n := - exMem z (exMem 0 (exMem z.succ.succ (exMem 0 - (.conj (orderedPairFormula z.succ.succ.succ.succ 2 0) - (reindex (Fin.cases 0 (Fin.cases 2 (fun i => i.succ.succ.succ.succ))) body))))) - -theorem truth_exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2)) - (env : Fin n → ZFSet.{u}) : - Truth (exPairFields z body) env ↔ - ∃ x y, env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env)) := by - simp only [exPairFields, truth_exMem, Truth, truth_orderedPairFormula, truth_reindex] - have rearrange (a x b y : ZFSet.{u}) : - (fun i => extend y (extend b (extend x (extend a env))) - (Fin.cases 0 (Fin.cases 2 (fun j => j.succ.succ.succ.succ)) i)) = - extend y (extend x env) := by - funext i - refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl - simp only [rearrange] - change (∃ a ∈ env z, ∃ x ∈ a, ∃ b ∈ env z, ∃ y ∈ b, - env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env))) ↔ _ - constructor - · rintro ⟨a, _, x, _, b, _, y, _, equal, holds⟩ - exact ⟨x, y, equal, holds⟩ - · rintro ⟨x, y, equal, holds⟩ - have both : ({x, y} : ZFSet.{u}) ∈ env z := by - rw [equal] - exact ZFSet.mem_pair.2 (Or.inr rfl) - exact ⟨{x,y}, both, x, ZFSet.mem_pair.2 (Or.inl rfl), - {x,y}, both, y, ZFSet.mem_pair.2 (Or.inr rfl), equal, holds⟩ - -def tupleShapeFormula : (k : Nat) → {n : Nat} → Fin n → BoundedFormula n - | 0, _, z => .equal z z - | k + 1, _, z => exPairFields z (tupleShapeFormula k 0) - -theorem truth_tupleShapeFormula (k : Nat) {n} (z : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (tupleShapeFormula k z) env ↔ ∃ fields, env z = nonemptyTupleCode k fields := by - induction k generalizing n with - | zero => - change env z = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0 - exact ⟨fun _ => ⟨fun _ => env z, rfl⟩, fun _ => rfl⟩ - | succ k ih => - rw [tupleShapeFormula, truth_exPairFields] - constructor - · rintro ⟨x, y, equal, shape⟩ - obtain ⟨fields, tail⟩ := (ih 0 (extend y (extend x env))).1 shape - refine ⟨Fin.cases x fields, ?_⟩ - change env z = ZFSet.pair x (nonemptyTupleCode k fields) - exact equal.trans (congrArg (ZFSet.pair x) tail) - · rintro ⟨fields, equal⟩ - exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), equal, - (ih 0 _).2 ⟨fun i => fields i.succ, rfl⟩⟩ - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def refinementIndexCode (level C E U Rf Rc : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 5 ![level, C, E, U, Rf, Rc] - -theorem refinementIndexCode_eq_iff (level C E U Rf Rc level' C' E' U' Rf' Rc' : ZFSet.{u}) : - refinementIndexCode level C E U Rf Rc = refinementIndexCode level' C' E' U' Rf' Rc' ↔ - level = level' ∧ C = C' ∧ E = E' ∧ U = U' ∧ Rf = Rf' ∧ Rc = Rc' := by - simp only [refinementIndexCode, nonemptyTupleCode, Matrix.cons_val_zero, - Matrix.cons_val_succ, ZFSet.pair_inj] - -noncomputable def refinementIndexBound (L P V W : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod L (ZFSet.prod P (ZFSet.prod P (ZFSet.prod V (ZFSet.prod W W)))) - -theorem mem_refinementIndexBound (L P V W z : ZFSet.{u}) : - z ∈ refinementIndexBound L P V W ↔ - ∃ level ∈ L, ∃ C ∈ P, ∃ E ∈ P, ∃ U ∈ V, ∃ Rf ∈ W, ∃ Rc ∈ W, - z = refinementIndexCode level C E U Rf Rc := by - simp only [refinementIndexBound, ZFSet.mem_prod] - constructor - · rintro ⟨level, hlevel, rest, ⟨C, hC, rest', ⟨E, hE, rest'', ⟨U, hU, - rest''', ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩ - exact ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩ - · rintro ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩ - exact ⟨level, hlevel, _, ⟨C, hC, _, ⟨E, hE, _, ⟨U, hU, _, - ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩ - -theorem refinementIndexCode_mem_bound (L P V W level C E U Rf Rc : ZFSet.{u}) : - refinementIndexCode level C E U Rf Rc ∈ refinementIndexBound L P V W ↔ - level ∈ L ∧ C ∈ P ∧ E ∈ P ∧ U ∈ V ∧ Rf ∈ W ∧ Rc ∈ W := by - rw [mem_refinementIndexBound] - constructor - · rintro ⟨l, hl, c, hc, e, he, a, ha, r, hr, t, ht, equal⟩ - obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 equal - exact ⟨hl, hc, he, ha, hr, ht⟩ - · rintro ⟨hl, hc, he, hu, hf, hr⟩ - exact ⟨level, hl, C, hc, E, he, U, hu, Rf, hf, Rc, hr, rfl⟩ - -namespace BoundedFormula - -def refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n) : BoundedFormula n := - nonemptyTupleFormula 5 z ![level, C, E, U, Rf, Rc] - -theorem truth_refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (refinementIndexFormula z level C E U Rf Rc) env ↔ - env z = refinementIndexCode (env level) (env C) (env E) (env U) (env Rf) (env Rc) := by - rw [refinementIndexFormula, truth_nonemptyTupleFormula] - rfl - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem refinementIndexCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {level C E U Rf Rc : ZFSet.{u}} (hl : level ∈ M.sets) (hC : C ∈ M.sets) - (hE : E ∈ M.sets) (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) : - refinementIndexCode level C E U Rf Rc ∈ M.sets := - M.nonemptyTupleCode_mem pairing 5 _ - (Fin.cases hl (Fin.cases hC (Fin.cases hE (Fin.cases hU - (Fin.cases hf (Fin.cases hc (fun j => Fin.elim0 j))))))) - -theorem refinementIndexCode_fields_mem {level C E U Rf Rc : ZFSet.{u}} - (ground : refinementIndexCode level C E U Rf Rc ∈ M.sets) : - level ∈ M.sets ∧ C ∈ M.sets ∧ E ∈ M.sets ∧ U ∈ M.sets ∧ - Rf ∈ M.sets ∧ Rc ∈ M.sets := by - have fields := M.nonemptyTupleCode_field_mem 5 ![level, C, E, U, Rf, Rc] ground - exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5⟩ - -theorem refinementIndexBound_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {L P V W : ZFSet.{u}} (hL : L ∈ M.sets) (hP : P ∈ M.sets) - (hV : V ∈ M.sets) (hW : W ∈ M.sets) : refinementIndexBound L P V W ∈ M.sets := - M.prod_mem pairing unions powers separation hL - (M.prod_mem pairing unions powers separation hP - (M.prod_mem pairing unions powers separation hP - (M.prod_mem pairing unions powers separation hV - (M.prod_mem pairing unions powers separation hW hW)))) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def refinementIndexFieldGraph (I B : ZFSet.{u}) (j : Fin 6) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ fields : Fin 6 → ZFSet.{u}, - nonemptyTupleCode 5 fields ∈ I ∧ z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j)) - (ZFSet.prod I B) - -theorem pair_mem_refinementIndexFieldGraph (I B x y : ZFSet.{u}) (j : Fin 6) : - ZFSet.pair x y ∈ refinementIndexFieldGraph I B j ↔ - x ∈ I ∧ y ∈ B ∧ ∃ fields : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 fields ∧ y = fields j := by - rw [refinementIndexFieldGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hx, hy⟩, fields, _, eq⟩ - exact ⟨hx, hy, fields, ZFSet.pair_inj.1 eq⟩ - · rintro ⟨hx, hy, fields, rfl, rfl⟩ - exact ⟨⟨hx, hy⟩, fields, hx, rfl⟩ - -theorem refinementIndexFieldGraph_entry (I B : ZFSet.{u}) (fields : Fin 6 → ZFSet.{u}) - (j : Fin 6) (y : ZFSet.{u}) : - ZFSet.pair (nonemptyTupleCode 5 fields) y ∈ refinementIndexFieldGraph I B j ↔ - nonemptyTupleCode 5 fields ∈ I ∧ y ∈ B ∧ y = fields j := by - rw [pair_mem_refinementIndexFieldGraph] - constructor - · rintro ⟨hi, hy, fields', equal, value⟩ - have same := nonemptyTupleCode_injective 5 equal - exact ⟨hi, hy, value.trans (congrFun same j).symm⟩ - · rintro ⟨hi, hy, value⟩ - exact ⟨hi, hy, fields, rfl, value⟩ - -theorem refinementIndexFieldGraph_function (I B : ZFSet.{u}) (j : Fin 6) - (fields : ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v j ∈ B) : - ZFSet.IsFunc I B (refinementIndexFieldGraph I B j) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨v, rfl, hv⟩ := fields x hx - refine ⟨v j, (refinementIndexFieldGraph_entry I B v j _).2 ⟨hx, hv, rfl⟩, ?_⟩ - intro y hy - exact ((refinementIndexFieldGraph_entry I B v j y).1 hy).2.2 - -namespace SetFormula - -def refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6) : SetFormula n := - let old := suffixIndex n 7 - let w := prefixIndex n 7 - exBlock 7 (.conj (.mem (w 0) (old I)) - (.conj (BoundedFormula.nonemptyTupleFormula 5 (w 0) (fun k => w k.succ)).toFormula - (BoundedFormula.orderedPairFormula (old z) (w 0) (w j.succ)).toFormula)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6) - (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : - Realize M.sets (refinementIndexFieldFormula z I j) env ↔ - ∃ fields : Fin 6 → ZFSet.{u}, nonemptyTupleCode 5 fields ∈ env I ∧ - env z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j) := by - rw [refinementIndexFieldFormula, realize_exBlock] - have actual (w : Fin 7 → ZFSet.{u}) (ground : ∀ k, w k ∈ M.sets) : - Realize M.sets (.conj (.mem (prefixIndex n 7 0) (suffixIndex n 7 I)) - (.conj (BoundedFormula.nonemptyTupleFormula 5 (prefixIndex n 7 0) - (fun k => prefixIndex n 7 k.succ)).toFormula - (BoundedFormula.orderedPairFormula (suffixIndex n 7 z) (prefixIndex n 7 0) - (prefixIndex n 7 j.succ)).toFormula)) (extendMany 7 w env) ↔ - w 0 ∈ env I ∧ w 0 = nonemptyTupleCode 5 (fun k => w k.succ) ∧ - env z = ZFSet.pair (w 0) (w j.succ) := by - simp only [Realize, BoundedFormula.realize_toFormula M _ _ - (extendMany_members 7 w env ground members), BoundedFormula.truth_nonemptyTupleFormula, - BoundedFormula.truth_orderedPairFormula, extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨w, ground, holds⟩ - obtain ⟨hi, eq, pair⟩ := (actual w ground).1 holds - exact ⟨fun k => w k.succ, eq ▸ hi, eq ▸ pair⟩ - · rintro ⟨fields, hi, pair⟩ - have hcode := M.transitive (members I) hi - have hf := M.nonemptyTupleCode_field_mem 5 fields hcode - let w := extend (nonemptyTupleCode 5 fields) fields - have ground : ∀ k, w k ∈ M.sets := Fin.cases hcode hf - exact ⟨w, ground, (actual w ground).2 ⟨hi, rfl, pair⟩⟩ - -theorem refinementIndexFieldGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I B : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (j : Fin 6) : - refinementIndexFieldGraph I B j ∈ M.sets := by - have hp := M.prod_mem pairing unions powers separation hI hB - let params := extend I Fin.elim0 - have ground := M.separation_mem separation (refinementIndexFieldFormula 0 1 j) - params (Fin.cases hI (fun k => Fin.elim0 k)) hp - have equal : ZFSet.sep (fun z => Realize M.sets (refinementIndexFieldFormula 0 1 j) - (extend z params)) (ZFSet.prod I B) = refinementIndexFieldGraph I B j := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, refinementIndexFieldGraph, ZFSet.mem_sep] - apply and_congr_right - intro hz - exact M.realize_refinementIndexFieldFormula 0 1 j _ - (Fin.cases (M.transitive hp hz) (Fin.cases hI (fun k => Fin.elim0 k))) - exact equal ▸ ground - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -open scoped ZFSet -universe u -variable (M : TransitiveGround.{u}) - -theorem graphRestriction_mem - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) : - graphRestriction A f ∈ M.sets := - M.injection_restriction_mem separation hA (M.union_mem unions (M.union_mem unions hf)) hf - -theorem functionGraphOn_ground_range - (unions : Realize M.sets SetFormula.union Fin.elim0) - {A f : ZFSet.{u}} (hf : f ∈ M.sets) (h : FunctionGraphOn A f) : - ∃ B ∈ M.sets, ZFSet.IsFunc A B f := - ⟨⋃₀ ⋃₀ f, M.union_mem unions (M.union_mem unions hf), h.to_isFunc⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -open scoped ZFSet -universe u - -noncomputable def tupleFieldBound : Nat → ZFSet.{u} → ZFSet.{u} - | 0, B => B - | k + 1, B => (⋃₀ ⋃₀ B) ∪ tupleFieldBound k (⋃₀ ⋃₀ B) - -theorem nonemptyTupleCode_field_mem_bound (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) - {B : ZFSet.{u}} (member : nonemptyTupleCode k fields ∈ B) : - ∀ j, fields j ∈ tupleFieldBound k B := by - induction k generalizing B with - | zero => exact Fin.cases member (fun j => Fin.elim0 j) - | succ k ih => - have pair : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun j => fields j.succ)) ∈ B := member - exact Fin.cases (ZFSet.mem_union.2 (Or.inl (pair_first_mem_doubleUnion pair))) - (fun j => ZFSet.mem_union.2 (Or.inr (ih _ (pair_second_mem_doubleUnion pair) j))) - -namespace BoundedFormula -noncomputable def tupleFieldFormula : (k : Nat) → {n : Nat} → Fin n → Fin n → Fin (k + 1) → BoundedFormula n - | 0, _, z, y, _ => .equal y z - | k + 1, _, z, y, j => exPairFields z - (Fin.cases (.conj (.equal y.succ.succ 1) (tupleShapeFormula k 0)) - (fun i => tupleFieldFormula k 0 y.succ.succ i) j) - -theorem truth_tupleFieldFormula (k : Nat) {n : Nat} (z y : Fin n) (j : Fin (k + 1)) - (env : Fin n → ZFSet.{u}) : - Truth (tupleFieldFormula k z y j) env ↔ - ∃ fields : Fin (k + 1) → ZFSet.{u}, env z = nonemptyTupleCode k fields ∧ env y = fields j := by - induction k generalizing n with - | zero => - change env y = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0 ∧ env y = fields j - constructor - · intro equal - exact ⟨fun _ => env z, rfl, equal⟩ - · rintro ⟨fields, first, second⟩ - have eq : j = 0 := Fin.cases rfl (fun i => Fin.elim0 i) j - exact (eq ▸ second).trans first.symm - | succ k ih => - rw [tupleFieldFormula, truth_exPairFields] - refine Fin.cases ?_ (fun i => ?_) j - · simp only [Fin.cases_zero, Truth, truth_tupleShapeFormula] - constructor - · rintro ⟨head, tail, pair, value, fields, tuple⟩ - let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields - refine ⟨all, ?_, ?_⟩ - · change env z = ZFSet.pair head (nonemptyTupleCode k fields) - exact pair.trans (congrArg (ZFSet.pair head) tuple) - · exact value - · rintro ⟨fields, pair, value⟩ - exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair, - value, fun i => fields i.succ, rfl⟩ - · simp only [Fin.cases_succ, ih] - constructor - · rintro ⟨head, tail, pair, fields, tuple, value⟩ - let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields - refine ⟨all, ?_, ?_⟩ - · change env z = ZFSet.pair head (nonemptyTupleCode k fields) - exact pair.trans (congrArg (ZFSet.pair head) tuple) - · exact value - · rintro ⟨fields, pair, value⟩ - exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair, - fun i => fields i.succ, rfl, value⟩ - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem tupleFieldBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (k : Nat) {B : ZFSet.{u}} (ground : B ∈ M.sets) : tupleFieldBound k B ∈ M.sets := by - induction k generalizing B with - | zero => exact ground - | succ k ih => - have hB := M.union_mem unions (M.union_mem unions ground) - exact M.binary_union_mem pairing unions hB (ih hB) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundInjectionRestrictions + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def nonemptyTupleCode : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u} + | 0, fields => fields 0 + | k + 1, fields => ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ)) + +theorem nonemptyTupleCode_injective (k : Nat) : Function.Injective (nonemptyTupleCode.{u} k) := by + induction k with + | zero => + intro fields fields' equal + funext i + exact Fin.cases equal (fun j => Fin.elim0 j) i + | succ k ih => + intro fields fields' equal + obtain ⟨head, tail⟩ := ZFSet.pair_inj.1 equal + have same := ih tail + funext i + exact Fin.cases head (fun j => congrFun same j) i + +namespace BoundedFormula + +open SetFormula + +def nonemptyTupleFormula : (k : Nat) → {n : Nat} → + Fin n → (Fin (k + 1) → Fin n) → BoundedFormula n + | 0, _, z, fields => .equal z (fields 0) + | k + 1, _, z, fields => exMem z (exMem 0 + (.conj (orderedPairFormula z.succ.succ (fields 0).succ.succ 0) + (nonemptyTupleFormula k 0 (fun i => (fields i.succ).succ.succ)))) + +theorem truth_nonemptyTupleFormula (k : Nat) {n : Nat} (z : Fin n) + (fields : Fin (k + 1) → Fin n) (env : Fin n → ZFSet.{u}) : + Truth (nonemptyTupleFormula k z fields) env ↔ + env z = nonemptyTupleCode k (fun i => env (fields i)) := by + induction k generalizing n with + | zero => rfl + | succ k ih => + simp only [nonemptyTupleFormula, truth_exMem, Truth, truth_orderedPairFormula, ih] + change (∃ a ∈ env z, ∃ b ∈ a, env z = ZFSet.pair (env (fields 0)) b ∧ + b = nonemptyTupleCode k (fun i => env (fields i.succ))) ↔ _ + constructor + · rintro ⟨_, _, b, _, outer, tail⟩ + rw [outer, tail] + rfl + · intro equal + let tail := nonemptyTupleCode k (fun i => env (fields i.succ)) + have outer : env z = ZFSet.pair (env (fields 0)) tail := equal + refine ⟨{env (fields 0), tail}, ?_, tail, ZFSet.mem_pair.2 (Or.inr rfl), outer, rfl⟩ + rw [outer] + exact ZFSet.mem_pair.2 (Or.inr rfl) + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem nonemptyTupleCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) (ground : ∀ i, fields i ∈ M.sets) : + nonemptyTupleCode k fields ∈ M.sets := by + induction k with + | zero => exact ground 0 + | succ k ih => exact M.orderedPair_mem pairing (ground 0) (ih _ (fun i => ground i.succ)) + +theorem nonemptyTupleCode_field_mem (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) + (ground : nonemptyTupleCode k fields ∈ M.sets) : ∀ i, fields i ∈ M.sets := by + induction k with + | zero => exact Fin.cases ground (fun i => Fin.elim0 i) + | succ k ih => + have pairGround : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ)) ∈ M.sets := ground + have both : ({fields 0, nonemptyTupleCode k (fun i => fields i.succ)} : ZFSet.{u}) ∈ M.sets := + M.transitive pairGround (ZFSet.mem_pair.2 (Or.inr rfl)) + have head := M.transitive both (ZFSet.mem_pair.2 (Or.inl rfl)) + have tail := M.transitive both (ZFSet.mem_pair.2 (Or.inr rfl)) + exact Fin.cases head (ih _ tail) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def reindex : {n m : Nat} → (Fin n → Fin m) → BoundedFormula n → BoundedFormula m + | _, _, f, .equal i j => .equal (f i) (f j) + | _, _, f, .mem i j => .mem (f i) (f j) + | _, _, f, .neg φ => .neg (reindex f φ) + | _, _, f, .conj φ ψ => .conj (reindex f φ) (reindex f ψ) + | _, _, f, .allMem b φ => .allMem (f b) (reindex (liftIndex f) φ) + +theorem truth_reindex {n m} (f : Fin n → Fin m) (φ : BoundedFormula n) + (env : Fin m → ZFSet.{u}) : + Truth (reindex f φ) env ↔ Truth φ (fun i => env (f i)) := by + induction φ generalizing m with + | equal i j => rfl + | mem i j => rfl + | neg φ ih => exact not_congr (ih f env) + | conj φ ψ ihφ ihψ => exact and_congr (ihφ f env) (ihψ f env) + | allMem b φ ih => + change (∀ x ∈ env (f b), Truth (reindex (liftIndex f) φ) (extend x env)) ↔ _ + apply forall_congr' + intro x + apply forall_congr' + intro _ + rw [ih, extend_liftIndex] + +def exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n := + exMem z (exMem 0 (exMem z.succ.succ (exMem 0 + (.conj (orderedPairFormula z.succ.succ.succ.succ 2 0) + (reindex (Fin.cases 0 (Fin.cases 2 (fun i => i.succ.succ.succ.succ))) body))))) + +theorem truth_exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2)) + (env : Fin n → ZFSet.{u}) : + Truth (exPairFields z body) env ↔ + ∃ x y, env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env)) := by + simp only [exPairFields, truth_exMem, Truth, truth_orderedPairFormula, truth_reindex] + have rearrange (a x b y : ZFSet.{u}) : + (fun i => extend y (extend b (extend x (extend a env))) + (Fin.cases 0 (Fin.cases 2 (fun j => j.succ.succ.succ.succ)) i)) = + extend y (extend x env) := by + funext i + refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl + simp only [rearrange] + change (∃ a ∈ env z, ∃ x ∈ a, ∃ b ∈ env z, ∃ y ∈ b, + env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env))) ↔ _ + constructor + · rintro ⟨a, _, x, _, b, _, y, _, equal, holds⟩ + exact ⟨x, y, equal, holds⟩ + · rintro ⟨x, y, equal, holds⟩ + have both : ({x, y} : ZFSet.{u}) ∈ env z := by + rw [equal] + exact ZFSet.mem_pair.2 (Or.inr rfl) + exact ⟨{x,y}, both, x, ZFSet.mem_pair.2 (Or.inl rfl), + {x,y}, both, y, ZFSet.mem_pair.2 (Or.inr rfl), equal, holds⟩ + +def tupleShapeFormula : (k : Nat) → {n : Nat} → Fin n → BoundedFormula n + | 0, _, z => .equal z z + | k + 1, _, z => exPairFields z (tupleShapeFormula k 0) + +theorem truth_tupleShapeFormula (k : Nat) {n} (z : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (tupleShapeFormula k z) env ↔ ∃ fields, env z = nonemptyTupleCode k fields := by + induction k generalizing n with + | zero => + change env z = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0 + exact ⟨fun _ => ⟨fun _ => env z, rfl⟩, fun _ => rfl⟩ + | succ k ih => + rw [tupleShapeFormula, truth_exPairFields] + constructor + · rintro ⟨x, y, equal, shape⟩ + obtain ⟨fields, tail⟩ := (ih 0 (extend y (extend x env))).1 shape + refine ⟨Fin.cases x fields, ?_⟩ + change env z = ZFSet.pair x (nonemptyTupleCode k fields) + exact equal.trans (congrArg (ZFSet.pair x) tail) + · rintro ⟨fields, equal⟩ + exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), equal, + (ih 0 _).2 ⟨fun i => fields i.succ, rfl⟩⟩ + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def refinementIndexCode (level C E U Rf Rc : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 5 ![level, C, E, U, Rf, Rc] + +theorem refinementIndexCode_eq_iff (level C E U Rf Rc level' C' E' U' Rf' Rc' : ZFSet.{u}) : + refinementIndexCode level C E U Rf Rc = refinementIndexCode level' C' E' U' Rf' Rc' ↔ + level = level' ∧ C = C' ∧ E = E' ∧ U = U' ∧ Rf = Rf' ∧ Rc = Rc' := by + simp only [refinementIndexCode, nonemptyTupleCode, Matrix.cons_val_zero, + Matrix.cons_val_succ, ZFSet.pair_inj] + +noncomputable def refinementIndexBound (L P V W : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod L (ZFSet.prod P (ZFSet.prod P (ZFSet.prod V (ZFSet.prod W W)))) + +theorem mem_refinementIndexBound (L P V W z : ZFSet.{u}) : + z ∈ refinementIndexBound L P V W ↔ + ∃ level ∈ L, ∃ C ∈ P, ∃ E ∈ P, ∃ U ∈ V, ∃ Rf ∈ W, ∃ Rc ∈ W, + z = refinementIndexCode level C E U Rf Rc := by + simp only [refinementIndexBound, ZFSet.mem_prod] + constructor + · rintro ⟨level, hlevel, rest, ⟨C, hC, rest', ⟨E, hE, rest'', ⟨U, hU, + rest''', ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩ + exact ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩ + · rintro ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩ + exact ⟨level, hlevel, _, ⟨C, hC, _, ⟨E, hE, _, ⟨U, hU, _, + ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩ + +theorem refinementIndexCode_mem_bound (L P V W level C E U Rf Rc : ZFSet.{u}) : + refinementIndexCode level C E U Rf Rc ∈ refinementIndexBound L P V W ↔ + level ∈ L ∧ C ∈ P ∧ E ∈ P ∧ U ∈ V ∧ Rf ∈ W ∧ Rc ∈ W := by + rw [mem_refinementIndexBound] + constructor + · rintro ⟨l, hl, c, hc, e, he, a, ha, r, hr, t, ht, equal⟩ + obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 equal + exact ⟨hl, hc, he, ha, hr, ht⟩ + · rintro ⟨hl, hc, he, hu, hf, hr⟩ + exact ⟨level, hl, C, hc, E, he, U, hu, Rf, hf, Rc, hr, rfl⟩ + +namespace BoundedFormula + +def refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n) : BoundedFormula n := + nonemptyTupleFormula 5 z ![level, C, E, U, Rf, Rc] + +theorem truth_refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (refinementIndexFormula z level C E U Rf Rc) env ↔ + env z = refinementIndexCode (env level) (env C) (env E) (env U) (env Rf) (env Rc) := by + rw [refinementIndexFormula, truth_nonemptyTupleFormula] + rfl + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem refinementIndexCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {level C E U Rf Rc : ZFSet.{u}} (hl : level ∈ M.sets) (hC : C ∈ M.sets) + (hE : E ∈ M.sets) (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) : + refinementIndexCode level C E U Rf Rc ∈ M.sets := + M.nonemptyTupleCode_mem pairing 5 _ + (Fin.cases hl (Fin.cases hC (Fin.cases hE (Fin.cases hU + (Fin.cases hf (Fin.cases hc (fun j => Fin.elim0 j))))))) + +theorem refinementIndexCode_fields_mem {level C E U Rf Rc : ZFSet.{u}} + (ground : refinementIndexCode level C E U Rf Rc ∈ M.sets) : + level ∈ M.sets ∧ C ∈ M.sets ∧ E ∈ M.sets ∧ U ∈ M.sets ∧ + Rf ∈ M.sets ∧ Rc ∈ M.sets := by + have fields := M.nonemptyTupleCode_field_mem 5 ![level, C, E, U, Rf, Rc] ground + exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5⟩ + +theorem refinementIndexBound_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {L P V W : ZFSet.{u}} (hL : L ∈ M.sets) (hP : P ∈ M.sets) + (hV : V ∈ M.sets) (hW : W ∈ M.sets) : refinementIndexBound L P V W ∈ M.sets := + M.prod_mem pairing unions powers separation hL + (M.prod_mem pairing unions powers separation hP + (M.prod_mem pairing unions powers separation hP + (M.prod_mem pairing unions powers separation hV + (M.prod_mem pairing unions powers separation hW hW)))) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def refinementIndexFieldGraph (I B : ZFSet.{u}) (j : Fin 6) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ fields : Fin 6 → ZFSet.{u}, + nonemptyTupleCode 5 fields ∈ I ∧ z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j)) + (ZFSet.prod I B) + +theorem pair_mem_refinementIndexFieldGraph (I B x y : ZFSet.{u}) (j : Fin 6) : + ZFSet.pair x y ∈ refinementIndexFieldGraph I B j ↔ + x ∈ I ∧ y ∈ B ∧ ∃ fields : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 fields ∧ y = fields j := by + rw [refinementIndexFieldGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hx, hy⟩, fields, _, eq⟩ + exact ⟨hx, hy, fields, ZFSet.pair_inj.1 eq⟩ + · rintro ⟨hx, hy, fields, rfl, rfl⟩ + exact ⟨⟨hx, hy⟩, fields, hx, rfl⟩ + +theorem refinementIndexFieldGraph_entry (I B : ZFSet.{u}) (fields : Fin 6 → ZFSet.{u}) + (j : Fin 6) (y : ZFSet.{u}) : + ZFSet.pair (nonemptyTupleCode 5 fields) y ∈ refinementIndexFieldGraph I B j ↔ + nonemptyTupleCode 5 fields ∈ I ∧ y ∈ B ∧ y = fields j := by + rw [pair_mem_refinementIndexFieldGraph] + constructor + · rintro ⟨hi, hy, fields', equal, value⟩ + have same := nonemptyTupleCode_injective 5 equal + exact ⟨hi, hy, value.trans (congrFun same j).symm⟩ + · rintro ⟨hi, hy, value⟩ + exact ⟨hi, hy, fields, rfl, value⟩ + +theorem refinementIndexFieldGraph_function (I B : ZFSet.{u}) (j : Fin 6) + (fields : ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v j ∈ B) : + ZFSet.IsFunc I B (refinementIndexFieldGraph I B j) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨v, rfl, hv⟩ := fields x hx + refine ⟨v j, (refinementIndexFieldGraph_entry I B v j _).2 ⟨hx, hv, rfl⟩, ?_⟩ + intro y hy + exact ((refinementIndexFieldGraph_entry I B v j y).1 hy).2.2 + +namespace SetFormula + +def refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6) : SetFormula n := + let old := suffixIndex n 7 + let w := prefixIndex n 7 + exBlock 7 (.conj (.mem (w 0) (old I)) + (.conj (BoundedFormula.nonemptyTupleFormula 5 (w 0) (fun k => w k.succ)).toFormula + (BoundedFormula.orderedPairFormula (old z) (w 0) (w j.succ)).toFormula)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6) + (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : + Realize M.sets (refinementIndexFieldFormula z I j) env ↔ + ∃ fields : Fin 6 → ZFSet.{u}, nonemptyTupleCode 5 fields ∈ env I ∧ + env z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j) := by + rw [refinementIndexFieldFormula, realize_exBlock] + have actual (w : Fin 7 → ZFSet.{u}) (ground : ∀ k, w k ∈ M.sets) : + Realize M.sets (.conj (.mem (prefixIndex n 7 0) (suffixIndex n 7 I)) + (.conj (BoundedFormula.nonemptyTupleFormula 5 (prefixIndex n 7 0) + (fun k => prefixIndex n 7 k.succ)).toFormula + (BoundedFormula.orderedPairFormula (suffixIndex n 7 z) (prefixIndex n 7 0) + (prefixIndex n 7 j.succ)).toFormula)) (extendMany 7 w env) ↔ + w 0 ∈ env I ∧ w 0 = nonemptyTupleCode 5 (fun k => w k.succ) ∧ + env z = ZFSet.pair (w 0) (w j.succ) := by + simp only [Realize, BoundedFormula.realize_toFormula M _ _ + (extendMany_members 7 w env ground members), BoundedFormula.truth_nonemptyTupleFormula, + BoundedFormula.truth_orderedPairFormula, extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨w, ground, holds⟩ + obtain ⟨hi, eq, pair⟩ := (actual w ground).1 holds + exact ⟨fun k => w k.succ, eq ▸ hi, eq ▸ pair⟩ + · rintro ⟨fields, hi, pair⟩ + have hcode := M.transitive (members I) hi + have hf := M.nonemptyTupleCode_field_mem 5 fields hcode + let w := extend (nonemptyTupleCode 5 fields) fields + have ground : ∀ k, w k ∈ M.sets := Fin.cases hcode hf + exact ⟨w, ground, (actual w ground).2 ⟨hi, rfl, pair⟩⟩ + +theorem refinementIndexFieldGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I B : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (j : Fin 6) : + refinementIndexFieldGraph I B j ∈ M.sets := by + have hp := M.prod_mem pairing unions powers separation hI hB + let params := extend I Fin.elim0 + have ground := M.separation_mem separation (refinementIndexFieldFormula 0 1 j) + params (Fin.cases hI (fun k => Fin.elim0 k)) hp + have equal : ZFSet.sep (fun z => Realize M.sets (refinementIndexFieldFormula 0 1 j) + (extend z params)) (ZFSet.prod I B) = refinementIndexFieldGraph I B j := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, refinementIndexFieldGraph, ZFSet.mem_sep] + apply and_congr_right + intro hz + exact M.realize_refinementIndexFieldFormula 0 1 j _ + (Fin.cases (M.transitive hp hz) (Fin.cases hI (fun k => Fin.elim0 k))) + exact equal ▸ ground + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +open scoped ZFSet +universe u +variable (M : TransitiveGround.{u}) + +theorem graphRestriction_mem + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) : + graphRestriction A f ∈ M.sets := + M.injection_restriction_mem separation hA (M.union_mem unions (M.union_mem unions hf)) hf + +theorem functionGraphOn_ground_range + (unions : Realize M.sets SetFormula.union Fin.elim0) + {A f : ZFSet.{u}} (hf : f ∈ M.sets) (h : FunctionGraphOn A f) : + ∃ B ∈ M.sets, ZFSet.IsFunc A B f := + ⟨⋃₀ ⋃₀ f, M.union_mem unions (M.union_mem unions hf), h.to_isFunc⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +open scoped ZFSet +universe u + +noncomputable def tupleFieldBound : Nat → ZFSet.{u} → ZFSet.{u} + | 0, B => B + | k + 1, B => (⋃₀ ⋃₀ B) ∪ tupleFieldBound k (⋃₀ ⋃₀ B) + +theorem nonemptyTupleCode_field_mem_bound (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) + {B : ZFSet.{u}} (member : nonemptyTupleCode k fields ∈ B) : + ∀ j, fields j ∈ tupleFieldBound k B := by + induction k generalizing B with + | zero => exact Fin.cases member (fun j => Fin.elim0 j) + | succ k ih => + have pair : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun j => fields j.succ)) ∈ B := member + exact Fin.cases (ZFSet.mem_union.2 (Or.inl (pair_first_mem_doubleUnion pair))) + (fun j => ZFSet.mem_union.2 (Or.inr (ih _ (pair_second_mem_doubleUnion pair) j))) + +namespace BoundedFormula +noncomputable def tupleFieldFormula : (k : Nat) → {n : Nat} → Fin n → Fin n → Fin (k + 1) → BoundedFormula n + | 0, _, z, y, _ => .equal y z + | k + 1, _, z, y, j => exPairFields z + (Fin.cases (.conj (.equal y.succ.succ 1) (tupleShapeFormula k 0)) + (fun i => tupleFieldFormula k 0 y.succ.succ i) j) + +theorem truth_tupleFieldFormula (k : Nat) {n : Nat} (z y : Fin n) (j : Fin (k + 1)) + (env : Fin n → ZFSet.{u}) : + Truth (tupleFieldFormula k z y j) env ↔ + ∃ fields : Fin (k + 1) → ZFSet.{u}, env z = nonemptyTupleCode k fields ∧ env y = fields j := by + induction k generalizing n with + | zero => + change env y = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0 ∧ env y = fields j + constructor + · intro equal + exact ⟨fun _ => env z, rfl, equal⟩ + · rintro ⟨fields, first, second⟩ + have eq : j = 0 := Fin.cases rfl (fun i => Fin.elim0 i) j + exact (eq ▸ second).trans first.symm + | succ k ih => + rw [tupleFieldFormula, truth_exPairFields] + refine Fin.cases ?_ (fun i => ?_) j + · simp only [Fin.cases_zero, Truth, truth_tupleShapeFormula] + constructor + · rintro ⟨head, tail, pair, value, fields, tuple⟩ + let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields + refine ⟨all, ?_, ?_⟩ + · change env z = ZFSet.pair head (nonemptyTupleCode k fields) + exact pair.trans (congrArg (ZFSet.pair head) tuple) + · exact value + · rintro ⟨fields, pair, value⟩ + exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair, + value, fun i => fields i.succ, rfl⟩ + · simp only [Fin.cases_succ, ih] + constructor + · rintro ⟨head, tail, pair, fields, tuple, value⟩ + let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields + refine ⟨all, ?_, ?_⟩ + · change env z = ZFSet.pair head (nonemptyTupleCode k fields) + exact pair.trans (congrArg (ZFSet.pair head) tuple) + · exact value + · rintro ⟨fields, pair, value⟩ + exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair, + fun i => fields i.succ, rfl, value⟩ + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem tupleFieldBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (k : Nat) {B : ZFSet.{u}} (ground : B ∈ M.sets) : tupleFieldBound k B ∈ M.sets := by + induction k generalizing B with + | zero => exact ground + | succ k ih => + have hB := M.union_mem unions (M.union_mem unions ground) + exact M.binary_union_mem pairing unions hB (ih hB) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/OrbitImageFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/OrbitImageFormulas.lean index d9152ba3097d394e891943852bdaaa431bcaed13..1f9bb429fa71a1a9d36b6955292c51af8c82302f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/OrbitImageFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/OrbitImageFormulas.lean @@ -1,93 +1,93 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableSelections - -namespace OAI - - -namespace PartitionPilot.Forcing.SetFormula - -def codedNameActionFormula : SetFormula 5 := - .conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 1) - (.conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 2) nameActionFormula) - -def orbitImageFormula : SetFormula 6 := - ex (exConditions 5 (.conj (.mem 1 4) (.conj (orderedPairFormula 2 0 1) - (atomicApplication codedNameActionFormula (extend 5 (extend 7 Fin.elim0)) 0 1 3)))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem realize_codedNameActionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (g : G) (x y : ZFSet.{u}) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets codedNameActionFormula (extend (t.encode g) (extend x (extend y - (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ - ∃ σ : (M.nameDomain s).names, σ.val.val = x ∧ y = (a.act s g σ.val).val := by - rw [codedNameActionFormula] - change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _ - simp only [realize_domainApplication, map_extend, map_empty] - constructor - · rintro ⟨nameX, nameY, action⟩ - have nx := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier x hx).1 nameX - have ny := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 nameY - have eq := (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps - g ⟨x, nx⟩ ⟨y, ny⟩ hx hy).1 action - exact ⟨⟨⟨x, nx⟩, hx⟩, rfl, (congrArg Subtype.val eq).symm⟩ - · rintro ⟨σ, rfl, rfl⟩ - refine ⟨(M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hx).2 σ.val.property, - (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2 - (a.act s g σ.val).property, ?_⟩ - exact (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps - g σ.val (a.act s g σ.val) hx hy).2 rfl - -noncomputable def orbitParameters (W : ZFSet.{u}) : Fin 4 → ZFSet.{u} := - extend W (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0))) - -theorem realize_orbitImageFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (W z y : ZFSet.{u}) (hz : z ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets orbitImageFormula (extend z (extend y (orbitParameters a s t W))) ↔ - ∃ g, ∃ σ : (M.nameDomain s).names, σ.val.val ∈ W ∧ - z = ZFSet.pair (t.encode g) σ.val.val ∧ y = (a.act s g σ.val).val := by - rw [orbitImageFormula, realize_ex] - constructor - · rintro ⟨x, hx, rest⟩ - obtain ⟨g, member, shape, action⟩ := (M.realize_exConditions t 5 _ - (extend x (extend z (extend y (orbitParameters a s t W)))) group rfl).1 rest - rw [realize_atomicApplication, map_extend, map_extend, map_empty] at action - obtain ⟨σ, eq, output⟩ := (M.realize_codedNameActionFormula a s t pairing unions powers separation collection - carrier group maps g x y hx hy).1 action - have raw := (M.realize_orderedPairFormula pairing 2 0 1 - (extend (t.encode g) (extend x (extend z (extend y (orbitParameters a s t W))))) hz - (M.transitive group (t.encode_mem g)) hx).1 shape - exact ⟨g, σ, eq.symm ▸ member, raw.trans (congrArg (ZFSet.pair (t.encode g)) eq.symm), output⟩ - · rintro ⟨g, σ, member, shape, output⟩ - refine ⟨σ.val.val, σ.property, ?_⟩ - apply (M.realize_exConditions t 5 _ - (extend σ.val.val (extend z (extend y (orbitParameters a s t W)))) group rfl).2 - refine ⟨g, member, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing 2 0 1 - (extend (t.encode g) (extend σ.val.val (extend z (extend y (orbitParameters a s t W))))) hz - (M.transitive group (t.encode_mem g)) σ.property).2 shape - · rw [realize_atomicApplication, map_extend, map_extend, map_empty] - exact (M.realize_codedNameActionFormula a s t pairing unions powers separation collection - carrier group maps g σ.val.val y σ.property hy).2 ⟨σ, rfl, output⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableSelections + +namespace OAI + + +namespace PartitionPilot.Forcing.SetFormula + +def codedNameActionFormula : SetFormula 5 := + .conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 1) + (.conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 2) nameActionFormula) + +def orbitImageFormula : SetFormula 6 := + ex (exConditions 5 (.conj (.mem 1 4) (.conj (orderedPairFormula 2 0 1) + (atomicApplication codedNameActionFormula (extend 5 (extend 7 Fin.elim0)) 0 1 3)))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem realize_codedNameActionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (g : G) (x y : ZFSet.{u}) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets codedNameActionFormula (extend (t.encode g) (extend x (extend y + (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ + ∃ σ : (M.nameDomain s).names, σ.val.val = x ∧ y = (a.act s g σ.val).val := by + rw [codedNameActionFormula] + change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _ + simp only [realize_domainApplication, map_extend, map_empty] + constructor + · rintro ⟨nameX, nameY, action⟩ + have nx := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier x hx).1 nameX + have ny := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 nameY + have eq := (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps + g ⟨x, nx⟩ ⟨y, ny⟩ hx hy).1 action + exact ⟨⟨⟨x, nx⟩, hx⟩, rfl, (congrArg Subtype.val eq).symm⟩ + · rintro ⟨σ, rfl, rfl⟩ + refine ⟨(M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hx).2 σ.val.property, + (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2 + (a.act s g σ.val).property, ?_⟩ + exact (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps + g σ.val (a.act s g σ.val) hx hy).2 rfl + +noncomputable def orbitParameters (W : ZFSet.{u}) : Fin 4 → ZFSet.{u} := + extend W (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0))) + +theorem realize_orbitImageFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (W z y : ZFSet.{u}) (hz : z ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets orbitImageFormula (extend z (extend y (orbitParameters a s t W))) ↔ + ∃ g, ∃ σ : (M.nameDomain s).names, σ.val.val ∈ W ∧ + z = ZFSet.pair (t.encode g) σ.val.val ∧ y = (a.act s g σ.val).val := by + rw [orbitImageFormula, realize_ex] + constructor + · rintro ⟨x, hx, rest⟩ + obtain ⟨g, member, shape, action⟩ := (M.realize_exConditions t 5 _ + (extend x (extend z (extend y (orbitParameters a s t W)))) group rfl).1 rest + rw [realize_atomicApplication, map_extend, map_extend, map_empty] at action + obtain ⟨σ, eq, output⟩ := (M.realize_codedNameActionFormula a s t pairing unions powers separation collection + carrier group maps g x y hx hy).1 action + have raw := (M.realize_orderedPairFormula pairing 2 0 1 + (extend (t.encode g) (extend x (extend z (extend y (orbitParameters a s t W))))) hz + (M.transitive group (t.encode_mem g)) hx).1 shape + exact ⟨g, σ, eq.symm ▸ member, raw.trans (congrArg (ZFSet.pair (t.encode g)) eq.symm), output⟩ + · rintro ⟨g, σ, member, shape, output⟩ + refine ⟨σ.val.val, σ.property, ?_⟩ + apply (M.realize_exConditions t 5 _ + (extend σ.val.val (extend z (extend y (orbitParameters a s t W)))) group rfl).2 + refine ⟨g, member, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing 2 0 1 + (extend (t.encode g) (extend σ.val.val (extend z (extend y (orbitParameters a s t W))))) hz + (M.transitive group (t.encode_mem g)) σ.property).2 shape + · rw [realize_atomicApplication, map_extend, map_extend, map_empty] + exact (M.realize_codedNameActionFormula a s t pairing unions powers separation collection + carrier group maps g σ.val.val y σ.property hy).2 ⟨σ, rfl, output⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PairPushFilterFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PairPushFilterFamilies.lean index 432ba289e20b5024ebc13a0188d209fe284bc158..2baceecdb60239412f21dfe63247e54071ad2804 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PairPushFilterFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PairPushFilterFamilies.lean @@ -1,148 +1,148 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterCopies - -namespace OAI - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def pushFilterCode (L rL S F : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun y => ∃ f ∈ F, ∃ z ∈ L, - ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL) L - -theorem mem_pushFilterCode (L rL S F y : ZFSet.{u}) : - y ∈ pushFilterCode L rL S F ↔ y ∈ L ∧ ∃ f ∈ F, ∃ z ∈ L, - ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL := ZFSet.mem_sep - -theorem pushFilterCode_subset (L rL S F : ZFSet.{u}) : pushFilterCode L rL S F ⊆ L := - fun _ hy => ((mem_pushFilterCode L rL S F _).1 hy).1 - -theorem MeetEmbeddingCode.order_iff {P L rP rL μP μL S x y x' y' : ZFSet.{u}} - (embedding : MeetEmbeddingCode P L rP rL μP μL S) - (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL) - (first : ZFSet.pair x x' ∈ S) (second : ZFSet.pair y y' ∈ S) : - ZFSet.pair x' y' ∈ rL ↔ ZFSet.pair x y ∈ rP := by - refine ⟨?_, fun lower => embedding.monotone x y x' y' lower first second⟩ - intro lower - have sx := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 first) - have sy := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 second) - obtain ⟨z, meetXY, _⟩ := source.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.2 ⟨sx.1, sy.1⟩) - have hz := (ZFSet.pair_mem_prod.1 (source.operation.1 meetXY)).2 - obtain ⟨z', image, _⟩ := embedding.injection.function.2 z hz - have hz' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2 - have imageMeet := embedding.map_meet x y z x' y' z' meetXY first second image - have equalImage : z' = x' := target.order.antisymm z' hz' x' sx.2 - (target.lower_left x' y' z' imageMeet) - (target.greatest x' y' z' x' sx.2 imageMeet (target.order.refl x' sx.2) lower) - have equal : z = x := embedding.injection.injective z x x' (equalImage ▸ image) first - exact equal ▸ source.lower_right x y z meetXY - -theorem meetFilter_pushFilter {P L rP rL μP μL S F : ZFSet.{u}} - (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL) - (embedding : MeetEmbeddingCode P L rP rL μP μL S) - (filter : MeetFilterCode P rP μP F) : - MeetFilterCode L rL μL (pushFilterCode L rL S F) where - subset := pushFilterCode_subset L rL S F - nonempty := by - obtain ⟨f, hf⟩ := filter.nonempty - obtain ⟨z, image, _⟩ := embedding.injection.function.2 f (filter.subset hf) - have hz := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2 - exact ⟨z, (mem_pushFilterCode L rL S F z).2 - ⟨hz, f, hf, z, hz, image, target.order.refl z hz⟩⟩ - upward := by - intro x hx y hy lower - obtain ⟨hxL, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F x).1 hx - exact (mem_pushFilterCode L rL S F y).2 - ⟨hy, f, hf, z, hz, image, target.order.trans z hz x hxL y hy below lower⟩ - closed_meet := by - intro x hx y hy z meetXY - obtain ⟨hxL, f, hf, f', hf', first, belowX⟩ := (mem_pushFilterCode L rL S F x).1 hx - obtain ⟨hyL, g, hg, g', hg', second, belowY⟩ := (mem_pushFilterCode L rL S F y).1 hy - have hz := (ZFSet.pair_mem_prod.1 (target.operation.1 meetXY)).2 - obtain ⟨h, meetFG, _⟩ := source.operation.2 (ZFSet.pair f g) - (ZFSet.pair_mem_prod.2 ⟨filter.subset hf, filter.subset hg⟩) - have hhF := filter.closed_meet f hf g hg h meetFG - obtain ⟨h', image, _⟩ := embedding.injection.function.2 h (filter.subset hhF) - have hh' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2 - have imageMeet := embedding.map_meet f g h f' g' h' meetFG first second image - have left := target.order.trans h' hh' f' hf' x hxL - (target.lower_left f' g' h' imageMeet) belowX - have right := target.order.trans h' hh' g' hg' y hyL - (target.lower_right f' g' h' imageMeet) belowY - exact (mem_pushFilterCode L rL S F z).2 - ⟨hz, h, hhF, h', hh', image, target.greatest x y z h' hh' meetXY left right⟩ - -theorem pushFilter_trace {P L rP rL μP μL S F x y : ZFSet.{u}} - (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL) - (embedding : MeetEmbeddingCode P L rP rL μP μL S) - (filter : MeetFilterCode P rP μP F) (entry : ZFSet.pair x y ∈ S) : - y ∈ pushFilterCode L rL S F ↔ x ∈ F := by - have shape := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry) - constructor - · intro positive - obtain ⟨_, f, hf, z, _, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive - exact filter.upward f hf x shape.1 ((embedding.order_iff source target image entry).1 below) - · intro positive - exact (mem_pushFilterCode L rL S F y).2 - ⟨shape.2, x, positive, y, shape.2, entry, target.order.refl y shape.2⟩ - -theorem pushFilter_lower_bound {P L rP rL μP μL S F e e' y : ZFSet.{u}} - (target : MeetOrderCode L rL μL) (embedding : MeetEmbeddingCode P L rP rL μP μL S) - (lower : ∀ f ∈ F, ZFSet.pair e f ∈ rP) (entry : ZFSet.pair e e' ∈ S) - (positive : y ∈ pushFilterCode L rL S F) : ZFSet.pair e' y ∈ rL := by - obtain ⟨hy, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive - have he' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)).2 - exact target.order.trans e' he' z hz y hy - (embedding.monotone e f e' z (lower f hf) entry image) below - -noncomputable def pairPushFilterFamily (K I J L rL Ss Fs B : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ j ∈ J, ∃ S ∈ Ss.sUnion.sUnion, - ∃ F ∈ Fs.sUnion.sUnion, ∃ V ∈ B, - z = ZFSet.pair (ZFSet.pair i j) V ∧ ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧ - V = pushFilterCode L rL S F) (ZFSet.prod K B) - -theorem pair_mem_pairPushFilterFamily (K I J L rL Ss Fs B i j V : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔ - ZFSet.pair i j ∈ K ∧ V ∈ B ∧ i ∈ I ∧ j ∈ J ∧ ∃ S F, - ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧ V = pushFilterCode L rL S F := by - rw [pairPushFilterFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hk, hV⟩, i', hi, j', hj, S, _, F, _, V', _, equal, eS, eF, value⟩ - obtain ⟨pairEq, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pairEq - exact ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩ - · rintro ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩ - exact ⟨⟨hk, hV⟩, i, hi, j, hj, S, pair_second_mem_doubleUnion eS, - F, pair_second_mem_doubleUnion eF, V, hV, rfl, eS, eF, value⟩ - -theorem pairPushFilterFamily_entry_iff {K I J L rL Ss Fs B i j S F V : ZFSet.{u}} - (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs) - (mapEntry : ZFSet.pair i S ∈ Ss) (filterEntry : ZFSet.pair j F ∈ Fs) : - ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔ - ZFSet.pair i j ∈ K ∧ V ∈ B ∧ V = pushFilterCode L rL S F := by - rw [pair_mem_pairPushFilterFamily] - constructor - · rintro ⟨hk, hV, _, _, S', F', eS, eF, value⟩ - exact ⟨hk, hV, maps.unique eS mapEntry ▸ filters.unique eF filterEntry ▸ value⟩ - · rintro ⟨hk, hV, value⟩ - exact ⟨hk, hV, maps.pair_source mapEntry, filters.pair_source filterEntry, - S, F, mapEntry, filterEntry, value⟩ - -theorem pairPushFilterFamily_function {K I J L rL Ss Fs B : ZFSet.{u}} - (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs) - (bounds : ∀ i ∈ I, ∀ j ∈ J, ∀ S F, - ZFSet.pair i S ∈ Ss → ZFSet.pair j F ∈ Fs → pushFilterCode L rL S F ∈ B) : - ZFSet.IsFunc K B (pairPushFilterFamily K I J L rL Ss Fs B) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro k hk - obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) - obtain ⟨S, eS⟩ := maps.total hi - obtain ⟨F, eF⟩ := filters.total hj - exact ⟨pushFilterCode L rL S F, - (pairPushFilterFamily_entry_iff maps filters eS eF).2 ⟨hk, bounds i hi j hj S F eS eF, rfl⟩, - fun V hV => ((pairPushFilterFamily_entry_iff maps filters eS eF).1 hV).2.2⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterCopies + +namespace OAI + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def pushFilterCode (L rL S F : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun y => ∃ f ∈ F, ∃ z ∈ L, + ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL) L + +theorem mem_pushFilterCode (L rL S F y : ZFSet.{u}) : + y ∈ pushFilterCode L rL S F ↔ y ∈ L ∧ ∃ f ∈ F, ∃ z ∈ L, + ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL := ZFSet.mem_sep + +theorem pushFilterCode_subset (L rL S F : ZFSet.{u}) : pushFilterCode L rL S F ⊆ L := + fun _ hy => ((mem_pushFilterCode L rL S F _).1 hy).1 + +theorem MeetEmbeddingCode.order_iff {P L rP rL μP μL S x y x' y' : ZFSet.{u}} + (embedding : MeetEmbeddingCode P L rP rL μP μL S) + (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL) + (first : ZFSet.pair x x' ∈ S) (second : ZFSet.pair y y' ∈ S) : + ZFSet.pair x' y' ∈ rL ↔ ZFSet.pair x y ∈ rP := by + refine ⟨?_, fun lower => embedding.monotone x y x' y' lower first second⟩ + intro lower + have sx := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 first) + have sy := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 second) + obtain ⟨z, meetXY, _⟩ := source.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.2 ⟨sx.1, sy.1⟩) + have hz := (ZFSet.pair_mem_prod.1 (source.operation.1 meetXY)).2 + obtain ⟨z', image, _⟩ := embedding.injection.function.2 z hz + have hz' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2 + have imageMeet := embedding.map_meet x y z x' y' z' meetXY first second image + have equalImage : z' = x' := target.order.antisymm z' hz' x' sx.2 + (target.lower_left x' y' z' imageMeet) + (target.greatest x' y' z' x' sx.2 imageMeet (target.order.refl x' sx.2) lower) + have equal : z = x := embedding.injection.injective z x x' (equalImage ▸ image) first + exact equal ▸ source.lower_right x y z meetXY + +theorem meetFilter_pushFilter {P L rP rL μP μL S F : ZFSet.{u}} + (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL) + (embedding : MeetEmbeddingCode P L rP rL μP μL S) + (filter : MeetFilterCode P rP μP F) : + MeetFilterCode L rL μL (pushFilterCode L rL S F) where + subset := pushFilterCode_subset L rL S F + nonempty := by + obtain ⟨f, hf⟩ := filter.nonempty + obtain ⟨z, image, _⟩ := embedding.injection.function.2 f (filter.subset hf) + have hz := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2 + exact ⟨z, (mem_pushFilterCode L rL S F z).2 + ⟨hz, f, hf, z, hz, image, target.order.refl z hz⟩⟩ + upward := by + intro x hx y hy lower + obtain ⟨hxL, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F x).1 hx + exact (mem_pushFilterCode L rL S F y).2 + ⟨hy, f, hf, z, hz, image, target.order.trans z hz x hxL y hy below lower⟩ + closed_meet := by + intro x hx y hy z meetXY + obtain ⟨hxL, f, hf, f', hf', first, belowX⟩ := (mem_pushFilterCode L rL S F x).1 hx + obtain ⟨hyL, g, hg, g', hg', second, belowY⟩ := (mem_pushFilterCode L rL S F y).1 hy + have hz := (ZFSet.pair_mem_prod.1 (target.operation.1 meetXY)).2 + obtain ⟨h, meetFG, _⟩ := source.operation.2 (ZFSet.pair f g) + (ZFSet.pair_mem_prod.2 ⟨filter.subset hf, filter.subset hg⟩) + have hhF := filter.closed_meet f hf g hg h meetFG + obtain ⟨h', image, _⟩ := embedding.injection.function.2 h (filter.subset hhF) + have hh' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2 + have imageMeet := embedding.map_meet f g h f' g' h' meetFG first second image + have left := target.order.trans h' hh' f' hf' x hxL + (target.lower_left f' g' h' imageMeet) belowX + have right := target.order.trans h' hh' g' hg' y hyL + (target.lower_right f' g' h' imageMeet) belowY + exact (mem_pushFilterCode L rL S F z).2 + ⟨hz, h, hhF, h', hh', image, target.greatest x y z h' hh' meetXY left right⟩ + +theorem pushFilter_trace {P L rP rL μP μL S F x y : ZFSet.{u}} + (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL) + (embedding : MeetEmbeddingCode P L rP rL μP μL S) + (filter : MeetFilterCode P rP μP F) (entry : ZFSet.pair x y ∈ S) : + y ∈ pushFilterCode L rL S F ↔ x ∈ F := by + have shape := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry) + constructor + · intro positive + obtain ⟨_, f, hf, z, _, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive + exact filter.upward f hf x shape.1 ((embedding.order_iff source target image entry).1 below) + · intro positive + exact (mem_pushFilterCode L rL S F y).2 + ⟨shape.2, x, positive, y, shape.2, entry, target.order.refl y shape.2⟩ + +theorem pushFilter_lower_bound {P L rP rL μP μL S F e e' y : ZFSet.{u}} + (target : MeetOrderCode L rL μL) (embedding : MeetEmbeddingCode P L rP rL μP μL S) + (lower : ∀ f ∈ F, ZFSet.pair e f ∈ rP) (entry : ZFSet.pair e e' ∈ S) + (positive : y ∈ pushFilterCode L rL S F) : ZFSet.pair e' y ∈ rL := by + obtain ⟨hy, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive + have he' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)).2 + exact target.order.trans e' he' z hz y hy + (embedding.monotone e f e' z (lower f hf) entry image) below + +noncomputable def pairPushFilterFamily (K I J L rL Ss Fs B : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ j ∈ J, ∃ S ∈ Ss.sUnion.sUnion, + ∃ F ∈ Fs.sUnion.sUnion, ∃ V ∈ B, + z = ZFSet.pair (ZFSet.pair i j) V ∧ ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧ + V = pushFilterCode L rL S F) (ZFSet.prod K B) + +theorem pair_mem_pairPushFilterFamily (K I J L rL Ss Fs B i j V : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔ + ZFSet.pair i j ∈ K ∧ V ∈ B ∧ i ∈ I ∧ j ∈ J ∧ ∃ S F, + ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧ V = pushFilterCode L rL S F := by + rw [pairPushFilterFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hk, hV⟩, i', hi, j', hj, S, _, F, _, V', _, equal, eS, eF, value⟩ + obtain ⟨pairEq, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pairEq + exact ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩ + · rintro ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩ + exact ⟨⟨hk, hV⟩, i, hi, j, hj, S, pair_second_mem_doubleUnion eS, + F, pair_second_mem_doubleUnion eF, V, hV, rfl, eS, eF, value⟩ + +theorem pairPushFilterFamily_entry_iff {K I J L rL Ss Fs B i j S F V : ZFSet.{u}} + (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs) + (mapEntry : ZFSet.pair i S ∈ Ss) (filterEntry : ZFSet.pair j F ∈ Fs) : + ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔ + ZFSet.pair i j ∈ K ∧ V ∈ B ∧ V = pushFilterCode L rL S F := by + rw [pair_mem_pairPushFilterFamily] + constructor + · rintro ⟨hk, hV, _, _, S', F', eS, eF, value⟩ + exact ⟨hk, hV, maps.unique eS mapEntry ▸ filters.unique eF filterEntry ▸ value⟩ + · rintro ⟨hk, hV, value⟩ + exact ⟨hk, hV, maps.pair_source mapEntry, filters.pair_source filterEntry, + S, F, mapEntry, filterEntry, value⟩ + +theorem pairPushFilterFamily_function {K I J L rL Ss Fs B : ZFSet.{u}} + (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs) + (bounds : ∀ i ∈ I, ∀ j ∈ J, ∀ S F, + ZFSet.pair i S ∈ Ss → ZFSet.pair j F ∈ Fs → pushFilterCode L rL S F ∈ B) : + ZFSet.IsFunc K B (pairPushFilterFamily K I J L rL Ss Fs B) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro k hk + obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) + obtain ⟨S, eS⟩ := maps.total hi + obtain ⟨F, eF⟩ := filters.total hj + exact ⟨pushFilterCode L rL S F, + (pairPushFilterFamily_entry_iff maps filters eS eF).2 ⟨hk, bounds i hi j hj S F eS eF, rfl⟩, + fun V hV => ((pairPushFilterFamily_entry_iff maps filters eS eF).1 hV).2.2⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/ParentSupportCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/ParentSupportCodes.lean index c8895634d5174b1fd13ae683b157856ca1496f05..e4ca24de2e00ffbbf20d6cadbabbaa890b45c7cd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/ParentSupportCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/ParentSupportCodes.lean @@ -1,632 +1,632 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions - -namespace OAI - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def orderedRightTripleFormula {n} (w x c q : Fin n) : BoundedFormula n := - exMem w (exMem 0 (.conj (orderedPairFormula 0 c.succ.succ q.succ.succ) - (orderedPairFormula w.succ.succ x.succ.succ 0))) - -def rightTripleMembershipFormula {n} (x c q f : Fin n) : BoundedFormula n := - exMem f (orderedRightTripleFormula 0 x.succ c.succ q.succ) - -theorem truth_orderedRightTripleFormula {n} (w x c q : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (orderedRightTripleFormula w x c q) env ↔ - env w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) := by - simp only [orderedRightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] - change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env c) (env q) ∧ - env w = ZFSet.pair (env x) b) ↔ _ - constructor - · rintro ⟨_, _, _, _, rfl, equal⟩ - exact equal - · intro equal - refine ⟨{env x, ZFSet.pair (env c) (env q)}, ?_, ZFSet.pair (env c) (env q), - ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ - rw [equal] - exact ZFSet.mem_pair.2 (Or.inr rfl) - -theorem truth_rightTripleMembershipFormula {n} (x c q f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rightTripleMembershipFormula x c q f) env ↔ - ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) ∈ env f := by - simp only [rightTripleMembershipFormula, truth_exMem, truth_orderedRightTripleFormula] - change (∃ w ∈ env f, w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q))) ↔ _ - constructor - · rintro ⟨w, hw, heq⟩ - exact heq ▸ hw - · intro hw - exact ⟨_, hw, rfl⟩ - -def relationToProductFormula {n} (a c q f : Fin n) : BoundedFormula n := - .allMem f (exMem a.succ (exMem c.succ.succ - (exMem q.succ.succ.succ (orderedRightTripleFormula 3 2 1 0)))) - -def functionToProductFormula {n} (a c q f : Fin n) : BoundedFormula n := - .conj (relationToProductFormula a c q f) - (.allMem a (exMem c.succ (exMem q.succ.succ - (.conj (rightTripleMembershipFormula 2 1 0 f.succ.succ.succ) - (.allMem c.succ.succ.succ (.allMem q.succ.succ.succ.succ - (imp (rightTripleMembershipFormula 4 1 0 f.succ.succ.succ.succ.succ) - (.conj (.equal 1 3) (.equal 0 2))))))))) - -theorem truth_relationToProductFormula {n} (a c q f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (relationToProductFormula a c q f) env ↔ - env f ⊆ ZFSet.prod (env a) (ZFSet.prod (env c) (env q)) := by - simp only [relationToProductFormula, Truth, truth_exMem, truth_orderedRightTripleFormula] - constructor - · intro h w hw - obtain ⟨x, hx, d, hd, v, hv, equal⟩ := h w hw - exact ZFSet.mem_prod.2 ⟨x, hx, ZFSet.pair d v, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, equal⟩ - · intro h w hw - obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 (h hw) - obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy - exact ⟨x, hx, d, hd, v, hv, equal⟩ - -theorem truth_functionToProductFormula {n} (a c q f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (functionToProductFormula a c q f) env ↔ - ZFSet.IsFunc (env a) (ZFSet.prod (env c) (env q)) (env f) := by - simp only [functionToProductFormula, Truth, truth_relationToProductFormula, truth_exMem, - truth_rightTripleMembershipFormula, truth_imp] - constructor - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro x hx - obtain ⟨d, _, v, _, entry, unique⟩ := total x hx - refine ⟨ZFSet.pair d v, entry, ?_⟩ - intro y hy - obtain ⟨b, hb, z, hz, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape hy)).2 - have both : b = d ∧ z = v := unique b hb z hz hy - obtain ⟨rfl, rfl⟩ := both - rfl - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro x hx - obtain ⟨y, entry, unique⟩ := total x hx - obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape entry)).2 - refine ⟨d, hd, v, hv, entry, ?_⟩ - intro b _ z _ hz - exact ZFSet.pair_injective (unique _ hz) - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing - -open scoped ZFSet - -universe u - -structure ChoiceFunctionCode (A f : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc A (⋃₀ A) f - chosen : ∀ x y, ZFSet.pair x y ∈ f → y ∈ x - -namespace BoundedFormula - -open SetFormula - -theorem truth_nonemptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (nonemptyFormula x) env ↔ (env x).Nonempty := by - simp only [nonemptyFormula, truth_exMem, Truth] - exact ⟨fun ⟨y, hy, _⟩ => ⟨y, hy⟩, fun ⟨y, hy⟩ => ⟨y, hy, True.intro⟩⟩ - -theorem truth_choiceFunctionFormula {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (choiceFunctionFormula a f) env ↔ ChoiceFunctionCode (env a) (env f) := by - simp only [choiceFunctionFormula, Truth, truth_exMem, truth_orderedPairFormula, - truth_pairMembershipFormula, truth_imp] - change ((∀ z ∈ env f, ∃ x ∈ env a, ∃ y ∈ x, z = ZFSet.pair x y) ∧ - ∀ x ∈ env a, ∃ y ∈ x, ZFSet.pair x y ∈ env f ∧ - ∀ z ∈ x, ZFSet.pair x z ∈ env f → z = y) ↔ _ - constructor - · rintro ⟨shape, total⟩ - have chosen : ∀ x y, ZFSet.pair x y ∈ env f → y ∈ x := by - intro x y rel - obtain ⟨x', _, y', hy', eq⟩ := shape _ rel - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact hy' - refine ⟨⟨?_, ?_⟩, chosen⟩ - · intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := shape z hz - exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩⟩ - · intro x hx - obtain ⟨y, _, rel, unique⟩ := total x hx - exact ⟨y, rel, fun z hz => unique z (chosen x z hz) hz⟩ - · intro h - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.function.1 hz) - exact ⟨x, hx, y, h.chosen x y (eq ▸ hz), eq⟩ - · intro x hx - obtain ⟨y, rel, unique⟩ := h.function.2 x hx - exact ⟨y, h.chosen x y rel, rel, fun z _ hz => unique z hz⟩ - -end BoundedFormula - - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem choice_witness (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) (nonempty : ∀ x ∈ A, x.Nonempty) : - ∃ f ∈ M.sets, ChoiceFunctionCode A f := by - have selected := (realize_imp M.sets _ _ _).1 (choice A hA) - have premise : Realize M.sets - (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)).toFormula (extend A Fin.elim0) := by - apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (fun i => Fin.elim0 i))).2 - intro x hx - exact (BoundedFormula.truth_nonemptyFormula 0 _).2 (nonempty x hx) - obtain ⟨f, hf, rel⟩ := (realize_ex M.sets _ _).1 (selected premise) - exact ⟨f, hf, (BoundedFormula.truth_choiceFunctionFormula 1 0 _).1 - ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hf (Fin.cases hA (fun i => Fin.elim0 i)))).1 rel)⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def relationFiber (B r x : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun y => ZFSet.pair x y ∈ r) B - -theorem mem_relationFiber (B r x y : ZFSet.{u}) : - y ∈ relationFiber B r x ↔ y ∈ B ∧ ZFSet.pair x y ∈ r := ZFSet.mem_sep - -noncomputable def choiceUniformGraph (A B r F c : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧ - relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c) (ZFSet.prod A B) - -theorem pair_mem_choiceUniformGraph (A B r F c x y : ZFSet.{u}) : - ZFSet.pair x y ∈ choiceUniformGraph A B r F c ↔ - x ∈ A ∧ y ∈ B ∧ relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c := by - rw [choiceUniformGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, a, ha, b, hb, eq, hf, rel⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨ha, hb, hf, rel⟩ - · rintro ⟨hx, hy, hf, rel⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, hf, rel⟩ - -theorem choiceUniformGraph_function {A B r F c : ZFSet.{u}} (choice : ChoiceFunctionCode F c) - (fibers : ∀ x ∈ A, relationFiber B r x ∈ F) : - ZFSet.IsFunc A B (choiceUniformGraph A B r F c) ∧ choiceUniformGraph A B r F c ⊆ r := by - refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ - · intro x hx - obtain ⟨y, rel, unique⟩ := choice.function.2 (relationFiber B r x) (fibers x hx) - have hy := (mem_relationFiber B r x y).1 (choice.chosen _ _ rel) - exact ⟨y, (pair_mem_choiceUniformGraph A B r F c x y).2 ⟨hx, hy.1, fibers x hx, rel⟩, - fun z hz => unique z ((pair_mem_choiceUniformGraph A B r F c x z).1 hz).2.2.2⟩ - · intro z hz - obtain ⟨_, x, _, y, _, eq, _, rel⟩ := ZFSet.mem_sep.1 hz - exact eq.symm ▸ ((mem_relationFiber B r x y).1 (choice.chosen _ _ rel)).2 - -namespace BoundedFormula - -open SetFormula - -def fiberFormula {n} (f x b r : Fin n) : BoundedFormula n := - .conj (.allMem f (.mem 0 b.succ)) (.allMem b - (.conj (imp (.mem 0 f.succ) (pairMembershipFormula x.succ 0 r.succ)) - (imp (pairMembershipFormula x.succ 0 r.succ) (.mem 0 f.succ)))) - -theorem truth_fiberFormula {n} (f x b r : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (fiberFormula f x b r) env ↔ env f = relationFiber (env b) (env r) (env x) := by - simp only [fiberFormula, Truth, truth_imp, truth_pairMembershipFormula] - change ((∀ y ∈ env f, y ∈ env b) ∧ ∀ y ∈ env b, - (y ∈ env f → ZFSet.pair (env x) y ∈ env r) ∧ (ZFSet.pair (env x) y ∈ env r → y ∈ env f)) ↔ _ - constructor - · rintro ⟨subset, spec⟩ - apply ZFSet.ext - intro y - rw [mem_relationFiber] - exact ⟨fun hy => ⟨subset y hy, (spec y (subset y hy)).1 hy⟩, - fun ⟨hy, rel⟩ => (spec y hy).2 rel⟩ - · intro eq - rw [eq] - exact ⟨fun _ hy => (ZFSet.mem_sep.1 hy).1, - fun y hy => ⟨fun rel => (ZFSet.mem_sep.1 rel).2, fun rel => ZFSet.mem_sep.2 ⟨hy, rel⟩⟩⟩ - -def choiceUniformEntryFormula {n} (z a b r f c : Fin n) : BoundedFormula n := - exMem a (exMem b.succ (exMem f.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 1) - (.conj (fiberFormula 0 2 b.succ.succ.succ r.succ.succ.succ) - (pairMembershipFormula 0 1 c.succ.succ.succ))))) - -theorem truth_choiceUniformEntryFormula {n} (z a b r f c : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (choiceUniformEntryFormula z a b r f c) env ↔ - ∃ x ∈ env a, ∃ y ∈ env b, env z = ZFSet.pair x y ∧ - relationFiber (env b) (env r) x ∈ env f ∧ ZFSet.pair (relationFiber (env b) (env r) x) y ∈ env c := by - simp only [choiceUniformEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_fiberFormula, truth_pairMembershipFormula] - change (∃ x ∈ env a, ∃ y ∈ env b, ∃ F ∈ env f, env z = ZFSet.pair x y ∧ - F = relationFiber (env b) (env r) x ∧ ZFSet.pair F y ∈ env c) ↔ _ - constructor - · rintro ⟨x, hx, y, hy, F, hF, eq, rfl, rel⟩ - exact ⟨x, hx, y, hy, eq, hF, rel⟩ - · rintro ⟨x, hx, y, hy, eq, hF, rel⟩ - exact ⟨x, hx, y, hy, relationFiber (env b) (env r) x, hF, eq, rfl, rel⟩ - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem relationFiber_mem (separation : SeparationSchema M.sets) {B r x : ZFSet.{u}} - (hB : B ∈ M.sets) (hr : r ∈ M.sets) (hx : x ∈ M.sets) : relationFiber B r x ∈ M.sets := by - let params := extend x (extend r Fin.elim0) - have selected := M.bounded_separation_mem separation (BoundedFormula.pairMembershipFormula 1 0 2) - params (Fin.cases hx (Fin.cases hr (fun i => Fin.elim0 i))) hB - have eq : ZFSet.sep (fun y => BoundedFormula.Truth (BoundedFormula.pairMembershipFormula 1 0 2) - (extend y params)) B = relationFiber B r x := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep, mem_relationFiber] - exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 1 0 2 _) - exact eq ▸ selected - -noncomputable def nonemptyGroundSubsets (B : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep ZFSet.Nonempty (M.groundPower B) - -theorem mem_nonemptyGroundSubsets (B F : ZFSet.{u}) : - F ∈ M.nonemptyGroundSubsets B ↔ F ∈ M.sets ∧ F ⊆ B ∧ F.Nonempty := by - rw [nonemptyGroundSubsets, ZFSet.mem_sep, M.mem_groundPower] - exact and_assoc - -theorem nonemptyGroundSubsets_mem (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) : - M.nonemptyGroundSubsets B ∈ M.sets := by - have selected := M.bounded_separation_mem separation (BoundedFormula.nonemptyFormula 0) - Fin.elim0 (fun i => Fin.elim0 i) (M.groundPower_mem powers hB) - have eq : ZFSet.sep (fun F => BoundedFormula.Truth (BoundedFormula.nonemptyFormula 0) - (extend F Fin.elim0)) (M.groundPower B) = M.nonemptyGroundSubsets B := by - apply ZFSet.ext - intro F - rw [ZFSet.mem_sep, nonemptyGroundSubsets, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_nonemptyFormula 0 _) - exact eq ▸ selected - -theorem choiceUniformGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A B r F c : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (hr : r ∈ M.sets) (hF : F ∈ M.sets) (hc : c ∈ M.sets) : choiceUniformGraph A B r F c ∈ M.sets := by - let params := extend A (extend B (extend r (extend F (extend c Fin.elim0)))) - have selected := M.bounded_separation_mem separation (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5) - params (Fin.cases hA (Fin.cases hB (Fin.cases hr (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hA hB) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5) - (extend z params)) (ZFSet.prod A B) = choiceUniformGraph A B r F c := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, choiceUniformGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_choiceUniformEntryFormula 0 1 2 3 4 5 _) - exact eq ▸ selected - -theorem uniformize_relation - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A B r : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hr : r ∈ M.sets) - (total : ∀ x ∈ A, ∃ y ∈ B, ZFSet.pair x y ∈ r) : - ∃ f ∈ M.sets, ZFSet.IsFunc A B f ∧ f ⊆ r := by - have family := M.nonemptyGroundSubsets_mem powers separation hB - obtain ⟨c, hc, code⟩ := M.choice_witness choice family - (fun F hF => ((M.mem_nonemptyGroundSubsets B F).1 hF).2.2) - have fibers (x : ZFSet.{u}) (hx : x ∈ A) : relationFiber B r x ∈ M.nonemptyGroundSubsets B := by - obtain ⟨y, hy, rel⟩ := total x hx - exact (M.mem_nonemptyGroundSubsets B _).2 - ⟨M.relationFiber_mem separation hB hr (M.transitive hA hx), fun _ hz => (ZFSet.mem_sep.1 hz).1, - y, (mem_relationFiber B r x y).2 ⟨hy, rel⟩⟩ - exact ⟨choiceUniformGraph A B r (M.nonemptyGroundSubsets B) c, - M.choiceUniformGraph_mem pairing unions powers separation hA hB hr family hc, - choiceUniformGraph_function code fibers⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace BoundedFormula -def relationFiberFamilyEntryFormula {n} (z I W B R : Fin n) : BoundedFormula n := - exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (fiberFormula 0 1 B.succ.succ R.succ.succ))) - -theorem truth_relationFiberFamilyEntryFormula {n} (z I W B R : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (relationFiberFamilyEntryFormula z I W B R) env ↔ - ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧ - f = relationFiber (env B) (env R) i := by - simp only [relationFiberFamilyEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_fiberFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def relationFiberFamily (I B R : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundPower B, - z = ZFSet.pair i f ∧ f = relationFiber B R i) (ZFSet.prod I (M.groundPower B)) - -theorem pair_mem_relationFiberFamily (I B R i f : ZFSet.{u}) : - ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔ - i ∈ I ∧ f ∈ M.groundPower B ∧ f = relationFiber B R i := by - rw [relationFiberFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨_, j, hj, g, hg, equal, value⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, hg, value⟩ - · rintro ⟨hi, hf, equal⟩ - exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, equal⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {I B R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (hR : R ∈ M.sets) - -include pairing unions powers separation hI hB hR in -theorem relationFiberFamily_mem : M.relationFiberFamily I B R ∈ M.sets := by - have hW := M.groundPower_mem powers hB - let params := extend I (extend (M.groundPower B) (extend B (extend R Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) params - (Fin.cases hI (Fin.cases hW (Fin.cases hB (Fin.cases hR (fun j => Fin.elim0 j))))) - (M.prod_mem pairing unions powers separation hI hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod I (M.groundPower B)) = M.relationFiberFamily I B R := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, relationFiberFamily, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_relationFiberFamilyEntryFormula 0 1 2 3 4 _) - exact equal ▸ selected - -include separation hI hB hR in -theorem relationFiberFamily_function : - ZFSet.IsFunc I (M.groundPower B) (M.relationFiberFamily I B R) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro i hi - have bound := (M.mem_groundPower B (relationFiber B R i)).2 - ⟨M.relationFiber_mem separation hB hR (M.transitive hI hi), - fun _ hz => (mem_relationFiber _ _ _ _).1 hz |>.1⟩ - exact ⟨relationFiber B R i, - (M.pair_mem_relationFiberFamily I B R i _).2 ⟨hi, bound, rfl⟩, - fun f entry => ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2⟩ - -include separation hI hB hR in -theorem relationFiberFamily_entries (i f : ZFSet.{u}) : - ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔ i ∈ I ∧ f = relationFiber B R i := by - constructor - · intro entry - have parts := (M.pair_mem_relationFiberFamily I B R i f).1 entry - exact ⟨parts.1, parts.2.2⟩ - · rintro ⟨hi, rfl⟩ - obtain ⟨f, entry, _⟩ := (M.relationFiberFamily_function separation hI hB hR).2 i hi - have equal := ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2 - exact equal ▸ entry - -end TransitiveGround - - - - - -def ExternalCosetSupport (E U C classifier copies zero v y : ZFSet.{u}) : Prop := - ∃ c ∈ C, ∃ w ∈ E, ∃ x ∈ U, v = ZFSet.pair zero c ∧ - ZFSet.pair w c ∈ classifier ∧ ZFSet.pair (ZFSet.pair w x) y ∈ copies - -def ExternalTileSupport (E Q Requests localPoints action first v y : ZFSet.{u}) : Prop := - ∃ w ∈ E, ∃ r ∈ Requests, ∃ x ∈ Q, v = ZFSet.pair first (ZFSet.pair w r) ∧ - ZFSet.pair r x ∈ localPoints ∧ ZFSet.pair (ZFSet.pair w x) y ∈ action - -def externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧ - (ExternalCosetSupport E U C classifier copies zero v y ∨ - ExternalTileSupport E Q Requests localPoints action first v y)) (ZFSet.prod V Q) - -theorem pair_mem_externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first v y : ZFSet.{u}) : - ZFSet.pair v y ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ↔ - v ∈ V ∧ y ∈ Q ∧ (ExternalCosetSupport E U C classifier copies zero v y ∨ - ExternalTileSupport E Q Requests localPoints action first v y) := by - rw [externalStarSupportGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, v', hv, y', hy, equal, body⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hv, hy, body⟩ - · rintro ⟨hv, hy, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩ - -namespace BoundedFormula - -def externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) : BoundedFormula n := - exMem C (exMem E.succ (exMem U.succ.succ - (.conj (orderedPairFormula v.succ.succ.succ zero.succ.succ.succ 2) - (.conj (pairMembershipFormula 1 2 classifier.succ.succ.succ) - (tripleMembershipFormula 1 0 y.succ.succ.succ copies.succ.succ.succ))))) - -theorem truth_externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (externalCosetSupportFormula E U C classifier copies zero v y) env ↔ - ExternalCosetSupport (env E) (env U) (env C) (env classifier) (env copies) (env zero) (env v) (env y) := by - simp only [externalCosetSupportFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalCosetSupport] - rfl - -def externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) : BoundedFormula n := - exMem E (exMem Requests.succ (exMem Q.succ.succ - (.conj (orderedRightTripleFormula v.succ.succ.succ first.succ.succ.succ 2 1) - (.conj (pairMembershipFormula 1 0 localPoints.succ.succ.succ) - (tripleMembershipFormula 2 0 y.succ.succ.succ action.succ.succ.succ))))) - -theorem truth_externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (externalTileSupportFormula E Q Requests localPoints action first v y) env ↔ - ExternalTileSupport (env E) (env Q) (env Requests) (env localPoints) (env action) (env first) (env v) (env y) := by - simp only [externalTileSupportFormula, truth_exMem, Truth, truth_orderedRightTripleFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalTileSupport] - rfl - -def externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n) : BoundedFormula n := - exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (.disj (externalCosetSupportFormula E.succ.succ U.succ.succ C.succ.succ - classifier.succ.succ copies.succ.succ zero.succ.succ 1 0) - (externalTileSupportFormula E.succ.succ Q.succ.succ Requests.succ.succ - localPoints.succ.succ action.succ.succ first.succ.succ 1 0)))) - -theorem truth_externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (externalStarSupportEntryFormula z V Q E U C Requests classifier copies localPoints action zero first) env ↔ - env z ∈ externalStarSupportGraph (env V) (env Q) (env E) (env U) (env C) (env Requests) - (env classifier) (env copies) (env localPoints) (env action) (env zero) (env first) := by - simp only [externalStarSupportEntryFormula, truth_exMem, Truth, truth_disj, truth_orderedPairFormula, - truth_externalCosetSupportFormula, truth_externalTileSupportFormula, externalStarSupportGraph, ZFSet.mem_sep] - refine ⟨fun body => ⟨?_, body⟩, And.right⟩ - obtain ⟨v, hv, y, hy, equal, _⟩ := body - change env z = ZFSet.pair v y at equal - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩ -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem externalStarSupportGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}} - (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) (hE : E ∈ M.sets) (hU : U ∈ M.sets) - (hC : C ∈ M.sets) (hRequests : Requests ∈ M.sets) (hClassifier : classifier ∈ M.sets) - (hCopies : copies ∈ M.sets) (hLocal : localPoints ∈ M.sets) (hAction : action ∈ M.sets) - (hZero : zero ∈ M.sets) (hFirst : first ∈ M.sets) : - externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ∈ M.sets := by - 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)))))))))))) - 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))))))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) params members - (M.prod_mem pairing unions powers separation hV hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) (extend z params)) - (ZFSet.prod V Q) = externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_externalStarSupportEntryFormula] - change (z ∈ ZFSet.prod V Q ∧ z ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first) ↔ _ - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact equal ▸ selected - -end TransitiveGround - - - - - -def parentSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧ ZFSet.pair v y ∈ supports ∧ - ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports) (ZFSet.prod V Q) - -def freshSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∉ parentSupportGraph V Q supports parents) supports - -theorem pair_mem_parentSupportGraph (V Q supports parents v y : ZFSet.{u}) : - ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔ v ∈ V ∧ y ∈ Q ∧ - ZFSet.pair v y ∈ supports ∧ ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports := by - rw [parentSupportGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, v', hv, y', hy, equal, body⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hv, hy, body⟩ - · rintro ⟨hv, hy, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩ - -theorem pair_mem_parentSupportGraph_of_parent {V Q supports parents v p y : ZFSet.{u}} - (function : ZFSet.IsFunc V V parents) (parent : ZFSet.pair v p ∈ parents) : - ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔ - y ∈ Q ∧ ZFSet.pair v y ∈ supports ∧ ZFSet.pair p y ∈ supports := by - have shape := ZFSet.pair_mem_prod.1 (function.1 parent) - rw [pair_mem_parentSupportGraph] - constructor - · rintro ⟨_, hy, supported, p', _, atParent, supportedParent⟩ - have equal := (show FunctionGraphOn V parents from ⟨V, function⟩).unique atParent parent - exact ⟨hy, supported, equal ▸ supportedParent⟩ - · rintro ⟨hy, supported, supportedParent⟩ - exact ⟨shape.1, hy, supported, p, shape.2, parent, supportedParent⟩ - -theorem pair_mem_freshSupportGraph (V Q supports parents v y : ZFSet.{u}) : - ZFSet.pair v y ∈ freshSupportGraph V Q supports parents ↔ - ZFSet.pair v y ∈ supports ∧ ZFSet.pair v y ∉ parentSupportGraph V Q supports parents := by - exact ZFSet.mem_sep - -namespace BoundedFormula -def parentSupportEntryFormula {n} (z V Q supports parents : Fin n) : BoundedFormula n := - exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (.conj (pairMembershipFormula 1 0 supports.succ.succ) - (exMem V.succ.succ (.conj (pairMembershipFormula 2 0 parents.succ.succ.succ) - (pairMembershipFormula 0 1 supports.succ.succ.succ)))))) - -theorem truth_parentSupportEntryFormula {n} (z V Q supports parents : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (parentSupportEntryFormula z V Q supports parents) env ↔ - env z ∈ parentSupportGraph (env V) (env Q) (env supports) (env parents) := by - simp only [parentSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_pairMembershipFormula, parentSupportGraph, ZFSet.mem_sep] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨v, hv, y, hy, equal, _⟩ := h - change env z = ZFSet.pair v y at equal - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩ -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {V Q supports parents : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) -variable (hSupports : supports ∈ M.sets) (hParents : parents ∈ M.sets) -include pairing unions powers separation hV hQ hSupports hParents - -theorem parentSupportGraph_mem : parentSupportGraph V Q supports parents ∈ M.sets := by - let params := extend V (extend Q (extend supports (extend parents Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) params - (Fin.cases hV (Fin.cases hQ (Fin.cases hSupports (Fin.cases hParents (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation hV hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) (extend z params)) (ZFSet.prod V Q) = - parentSupportGraph V Q supports parents := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_parentSupportEntryFormula] - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact equal ▸ selected - -theorem freshSupportGraph_mem : freshSupportGraph V Q supports parents ∈ M.sets := by - have parentGround := M.parentSupportGraph_mem pairing unions powers separation hV hQ hSupports hParents - exact M.bounded_separation_mem separation (BoundedFormula.neg (.mem 0 1)) - (extend (parentSupportGraph V Q supports parents) Fin.elim0) - (Fin.cases parentGround (fun i => Fin.elim0 i)) hSupports - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions + +namespace OAI + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def orderedRightTripleFormula {n} (w x c q : Fin n) : BoundedFormula n := + exMem w (exMem 0 (.conj (orderedPairFormula 0 c.succ.succ q.succ.succ) + (orderedPairFormula w.succ.succ x.succ.succ 0))) + +def rightTripleMembershipFormula {n} (x c q f : Fin n) : BoundedFormula n := + exMem f (orderedRightTripleFormula 0 x.succ c.succ q.succ) + +theorem truth_orderedRightTripleFormula {n} (w x c q : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (orderedRightTripleFormula w x c q) env ↔ + env w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) := by + simp only [orderedRightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] + change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env c) (env q) ∧ + env w = ZFSet.pair (env x) b) ↔ _ + constructor + · rintro ⟨_, _, _, _, rfl, equal⟩ + exact equal + · intro equal + refine ⟨{env x, ZFSet.pair (env c) (env q)}, ?_, ZFSet.pair (env c) (env q), + ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ + rw [equal] + exact ZFSet.mem_pair.2 (Or.inr rfl) + +theorem truth_rightTripleMembershipFormula {n} (x c q f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rightTripleMembershipFormula x c q f) env ↔ + ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) ∈ env f := by + simp only [rightTripleMembershipFormula, truth_exMem, truth_orderedRightTripleFormula] + change (∃ w ∈ env f, w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q))) ↔ _ + constructor + · rintro ⟨w, hw, heq⟩ + exact heq ▸ hw + · intro hw + exact ⟨_, hw, rfl⟩ + +def relationToProductFormula {n} (a c q f : Fin n) : BoundedFormula n := + .allMem f (exMem a.succ (exMem c.succ.succ + (exMem q.succ.succ.succ (orderedRightTripleFormula 3 2 1 0)))) + +def functionToProductFormula {n} (a c q f : Fin n) : BoundedFormula n := + .conj (relationToProductFormula a c q f) + (.allMem a (exMem c.succ (exMem q.succ.succ + (.conj (rightTripleMembershipFormula 2 1 0 f.succ.succ.succ) + (.allMem c.succ.succ.succ (.allMem q.succ.succ.succ.succ + (imp (rightTripleMembershipFormula 4 1 0 f.succ.succ.succ.succ.succ) + (.conj (.equal 1 3) (.equal 0 2))))))))) + +theorem truth_relationToProductFormula {n} (a c q f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (relationToProductFormula a c q f) env ↔ + env f ⊆ ZFSet.prod (env a) (ZFSet.prod (env c) (env q)) := by + simp only [relationToProductFormula, Truth, truth_exMem, truth_orderedRightTripleFormula] + constructor + · intro h w hw + obtain ⟨x, hx, d, hd, v, hv, equal⟩ := h w hw + exact ZFSet.mem_prod.2 ⟨x, hx, ZFSet.pair d v, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, equal⟩ + · intro h w hw + obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 (h hw) + obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy + exact ⟨x, hx, d, hd, v, hv, equal⟩ + +theorem truth_functionToProductFormula {n} (a c q f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (functionToProductFormula a c q f) env ↔ + ZFSet.IsFunc (env a) (ZFSet.prod (env c) (env q)) (env f) := by + simp only [functionToProductFormula, Truth, truth_relationToProductFormula, truth_exMem, + truth_rightTripleMembershipFormula, truth_imp] + constructor + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro x hx + obtain ⟨d, _, v, _, entry, unique⟩ := total x hx + refine ⟨ZFSet.pair d v, entry, ?_⟩ + intro y hy + obtain ⟨b, hb, z, hz, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape hy)).2 + have both : b = d ∧ z = v := unique b hb z hz hy + obtain ⟨rfl, rfl⟩ := both + rfl + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro x hx + obtain ⟨y, entry, unique⟩ := total x hx + obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape entry)).2 + refine ⟨d, hd, v, hv, entry, ?_⟩ + intro b _ z _ hz + exact ZFSet.pair_injective (unique _ hz) + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing + +open scoped ZFSet + +universe u + +structure ChoiceFunctionCode (A f : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc A (⋃₀ A) f + chosen : ∀ x y, ZFSet.pair x y ∈ f → y ∈ x + +namespace BoundedFormula + +open SetFormula + +theorem truth_nonemptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (nonemptyFormula x) env ↔ (env x).Nonempty := by + simp only [nonemptyFormula, truth_exMem, Truth] + exact ⟨fun ⟨y, hy, _⟩ => ⟨y, hy⟩, fun ⟨y, hy⟩ => ⟨y, hy, True.intro⟩⟩ + +theorem truth_choiceFunctionFormula {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (choiceFunctionFormula a f) env ↔ ChoiceFunctionCode (env a) (env f) := by + simp only [choiceFunctionFormula, Truth, truth_exMem, truth_orderedPairFormula, + truth_pairMembershipFormula, truth_imp] + change ((∀ z ∈ env f, ∃ x ∈ env a, ∃ y ∈ x, z = ZFSet.pair x y) ∧ + ∀ x ∈ env a, ∃ y ∈ x, ZFSet.pair x y ∈ env f ∧ + ∀ z ∈ x, ZFSet.pair x z ∈ env f → z = y) ↔ _ + constructor + · rintro ⟨shape, total⟩ + have chosen : ∀ x y, ZFSet.pair x y ∈ env f → y ∈ x := by + intro x y rel + obtain ⟨x', _, y', hy', eq⟩ := shape _ rel + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact hy' + refine ⟨⟨?_, ?_⟩, chosen⟩ + · intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := shape z hz + exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩⟩ + · intro x hx + obtain ⟨y, _, rel, unique⟩ := total x hx + exact ⟨y, rel, fun z hz => unique z (chosen x z hz) hz⟩ + · intro h + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.function.1 hz) + exact ⟨x, hx, y, h.chosen x y (eq ▸ hz), eq⟩ + · intro x hx + obtain ⟨y, rel, unique⟩ := h.function.2 x hx + exact ⟨y, h.chosen x y rel, rel, fun z _ hz => unique z hz⟩ + +end BoundedFormula + + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem choice_witness (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) (nonempty : ∀ x ∈ A, x.Nonempty) : + ∃ f ∈ M.sets, ChoiceFunctionCode A f := by + have selected := (realize_imp M.sets _ _ _).1 (choice A hA) + have premise : Realize M.sets + (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)).toFormula (extend A Fin.elim0) := by + apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (fun i => Fin.elim0 i))).2 + intro x hx + exact (BoundedFormula.truth_nonemptyFormula 0 _).2 (nonempty x hx) + obtain ⟨f, hf, rel⟩ := (realize_ex M.sets _ _).1 (selected premise) + exact ⟨f, hf, (BoundedFormula.truth_choiceFunctionFormula 1 0 _).1 + ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hf (Fin.cases hA (fun i => Fin.elim0 i)))).1 rel)⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def relationFiber (B r x : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun y => ZFSet.pair x y ∈ r) B + +theorem mem_relationFiber (B r x y : ZFSet.{u}) : + y ∈ relationFiber B r x ↔ y ∈ B ∧ ZFSet.pair x y ∈ r := ZFSet.mem_sep + +noncomputable def choiceUniformGraph (A B r F c : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧ + relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c) (ZFSet.prod A B) + +theorem pair_mem_choiceUniformGraph (A B r F c x y : ZFSet.{u}) : + ZFSet.pair x y ∈ choiceUniformGraph A B r F c ↔ + x ∈ A ∧ y ∈ B ∧ relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c := by + rw [choiceUniformGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, a, ha, b, hb, eq, hf, rel⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨ha, hb, hf, rel⟩ + · rintro ⟨hx, hy, hf, rel⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, hf, rel⟩ + +theorem choiceUniformGraph_function {A B r F c : ZFSet.{u}} (choice : ChoiceFunctionCode F c) + (fibers : ∀ x ∈ A, relationFiber B r x ∈ F) : + ZFSet.IsFunc A B (choiceUniformGraph A B r F c) ∧ choiceUniformGraph A B r F c ⊆ r := by + refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ + · intro x hx + obtain ⟨y, rel, unique⟩ := choice.function.2 (relationFiber B r x) (fibers x hx) + have hy := (mem_relationFiber B r x y).1 (choice.chosen _ _ rel) + exact ⟨y, (pair_mem_choiceUniformGraph A B r F c x y).2 ⟨hx, hy.1, fibers x hx, rel⟩, + fun z hz => unique z ((pair_mem_choiceUniformGraph A B r F c x z).1 hz).2.2.2⟩ + · intro z hz + obtain ⟨_, x, _, y, _, eq, _, rel⟩ := ZFSet.mem_sep.1 hz + exact eq.symm ▸ ((mem_relationFiber B r x y).1 (choice.chosen _ _ rel)).2 + +namespace BoundedFormula + +open SetFormula + +def fiberFormula {n} (f x b r : Fin n) : BoundedFormula n := + .conj (.allMem f (.mem 0 b.succ)) (.allMem b + (.conj (imp (.mem 0 f.succ) (pairMembershipFormula x.succ 0 r.succ)) + (imp (pairMembershipFormula x.succ 0 r.succ) (.mem 0 f.succ)))) + +theorem truth_fiberFormula {n} (f x b r : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (fiberFormula f x b r) env ↔ env f = relationFiber (env b) (env r) (env x) := by + simp only [fiberFormula, Truth, truth_imp, truth_pairMembershipFormula] + change ((∀ y ∈ env f, y ∈ env b) ∧ ∀ y ∈ env b, + (y ∈ env f → ZFSet.pair (env x) y ∈ env r) ∧ (ZFSet.pair (env x) y ∈ env r → y ∈ env f)) ↔ _ + constructor + · rintro ⟨subset, spec⟩ + apply ZFSet.ext + intro y + rw [mem_relationFiber] + exact ⟨fun hy => ⟨subset y hy, (spec y (subset y hy)).1 hy⟩, + fun ⟨hy, rel⟩ => (spec y hy).2 rel⟩ + · intro eq + rw [eq] + exact ⟨fun _ hy => (ZFSet.mem_sep.1 hy).1, + fun y hy => ⟨fun rel => (ZFSet.mem_sep.1 rel).2, fun rel => ZFSet.mem_sep.2 ⟨hy, rel⟩⟩⟩ + +def choiceUniformEntryFormula {n} (z a b r f c : Fin n) : BoundedFormula n := + exMem a (exMem b.succ (exMem f.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 1) + (.conj (fiberFormula 0 2 b.succ.succ.succ r.succ.succ.succ) + (pairMembershipFormula 0 1 c.succ.succ.succ))))) + +theorem truth_choiceUniformEntryFormula {n} (z a b r f c : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (choiceUniformEntryFormula z a b r f c) env ↔ + ∃ x ∈ env a, ∃ y ∈ env b, env z = ZFSet.pair x y ∧ + relationFiber (env b) (env r) x ∈ env f ∧ ZFSet.pair (relationFiber (env b) (env r) x) y ∈ env c := by + simp only [choiceUniformEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_fiberFormula, truth_pairMembershipFormula] + change (∃ x ∈ env a, ∃ y ∈ env b, ∃ F ∈ env f, env z = ZFSet.pair x y ∧ + F = relationFiber (env b) (env r) x ∧ ZFSet.pair F y ∈ env c) ↔ _ + constructor + · rintro ⟨x, hx, y, hy, F, hF, eq, rfl, rel⟩ + exact ⟨x, hx, y, hy, eq, hF, rel⟩ + · rintro ⟨x, hx, y, hy, eq, hF, rel⟩ + exact ⟨x, hx, y, hy, relationFiber (env b) (env r) x, hF, eq, rfl, rel⟩ + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem relationFiber_mem (separation : SeparationSchema M.sets) {B r x : ZFSet.{u}} + (hB : B ∈ M.sets) (hr : r ∈ M.sets) (hx : x ∈ M.sets) : relationFiber B r x ∈ M.sets := by + let params := extend x (extend r Fin.elim0) + have selected := M.bounded_separation_mem separation (BoundedFormula.pairMembershipFormula 1 0 2) + params (Fin.cases hx (Fin.cases hr (fun i => Fin.elim0 i))) hB + have eq : ZFSet.sep (fun y => BoundedFormula.Truth (BoundedFormula.pairMembershipFormula 1 0 2) + (extend y params)) B = relationFiber B r x := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep, mem_relationFiber] + exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 1 0 2 _) + exact eq ▸ selected + +noncomputable def nonemptyGroundSubsets (B : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep ZFSet.Nonempty (M.groundPower B) + +theorem mem_nonemptyGroundSubsets (B F : ZFSet.{u}) : + F ∈ M.nonemptyGroundSubsets B ↔ F ∈ M.sets ∧ F ⊆ B ∧ F.Nonempty := by + rw [nonemptyGroundSubsets, ZFSet.mem_sep, M.mem_groundPower] + exact and_assoc + +theorem nonemptyGroundSubsets_mem (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) : + M.nonemptyGroundSubsets B ∈ M.sets := by + have selected := M.bounded_separation_mem separation (BoundedFormula.nonemptyFormula 0) + Fin.elim0 (fun i => Fin.elim0 i) (M.groundPower_mem powers hB) + have eq : ZFSet.sep (fun F => BoundedFormula.Truth (BoundedFormula.nonemptyFormula 0) + (extend F Fin.elim0)) (M.groundPower B) = M.nonemptyGroundSubsets B := by + apply ZFSet.ext + intro F + rw [ZFSet.mem_sep, nonemptyGroundSubsets, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_nonemptyFormula 0 _) + exact eq ▸ selected + +theorem choiceUniformGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A B r F c : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (hr : r ∈ M.sets) (hF : F ∈ M.sets) (hc : c ∈ M.sets) : choiceUniformGraph A B r F c ∈ M.sets := by + let params := extend A (extend B (extend r (extend F (extend c Fin.elim0)))) + have selected := M.bounded_separation_mem separation (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5) + params (Fin.cases hA (Fin.cases hB (Fin.cases hr (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hA hB) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5) + (extend z params)) (ZFSet.prod A B) = choiceUniformGraph A B r F c := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, choiceUniformGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_choiceUniformEntryFormula 0 1 2 3 4 5 _) + exact eq ▸ selected + +theorem uniformize_relation + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A B r : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hr : r ∈ M.sets) + (total : ∀ x ∈ A, ∃ y ∈ B, ZFSet.pair x y ∈ r) : + ∃ f ∈ M.sets, ZFSet.IsFunc A B f ∧ f ⊆ r := by + have family := M.nonemptyGroundSubsets_mem powers separation hB + obtain ⟨c, hc, code⟩ := M.choice_witness choice family + (fun F hF => ((M.mem_nonemptyGroundSubsets B F).1 hF).2.2) + have fibers (x : ZFSet.{u}) (hx : x ∈ A) : relationFiber B r x ∈ M.nonemptyGroundSubsets B := by + obtain ⟨y, hy, rel⟩ := total x hx + exact (M.mem_nonemptyGroundSubsets B _).2 + ⟨M.relationFiber_mem separation hB hr (M.transitive hA hx), fun _ hz => (ZFSet.mem_sep.1 hz).1, + y, (mem_relationFiber B r x y).2 ⟨hy, rel⟩⟩ + exact ⟨choiceUniformGraph A B r (M.nonemptyGroundSubsets B) c, + M.choiceUniformGraph_mem pairing unions powers separation hA hB hr family hc, + choiceUniformGraph_function code fibers⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace BoundedFormula +def relationFiberFamilyEntryFormula {n} (z I W B R : Fin n) : BoundedFormula n := + exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (fiberFormula 0 1 B.succ.succ R.succ.succ))) + +theorem truth_relationFiberFamilyEntryFormula {n} (z I W B R : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (relationFiberFamilyEntryFormula z I W B R) env ↔ + ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧ + f = relationFiber (env B) (env R) i := by + simp only [relationFiberFamilyEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_fiberFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def relationFiberFamily (I B R : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundPower B, + z = ZFSet.pair i f ∧ f = relationFiber B R i) (ZFSet.prod I (M.groundPower B)) + +theorem pair_mem_relationFiberFamily (I B R i f : ZFSet.{u}) : + ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔ + i ∈ I ∧ f ∈ M.groundPower B ∧ f = relationFiber B R i := by + rw [relationFiberFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨_, j, hj, g, hg, equal, value⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, hg, value⟩ + · rintro ⟨hi, hf, equal⟩ + exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, equal⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {I B R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (hR : R ∈ M.sets) + +include pairing unions powers separation hI hB hR in +theorem relationFiberFamily_mem : M.relationFiberFamily I B R ∈ M.sets := by + have hW := M.groundPower_mem powers hB + let params := extend I (extend (M.groundPower B) (extend B (extend R Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) params + (Fin.cases hI (Fin.cases hW (Fin.cases hB (Fin.cases hR (fun j => Fin.elim0 j))))) + (M.prod_mem pairing unions powers separation hI hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod I (M.groundPower B)) = M.relationFiberFamily I B R := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, relationFiberFamily, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_relationFiberFamilyEntryFormula 0 1 2 3 4 _) + exact equal ▸ selected + +include separation hI hB hR in +theorem relationFiberFamily_function : + ZFSet.IsFunc I (M.groundPower B) (M.relationFiberFamily I B R) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro i hi + have bound := (M.mem_groundPower B (relationFiber B R i)).2 + ⟨M.relationFiber_mem separation hB hR (M.transitive hI hi), + fun _ hz => (mem_relationFiber _ _ _ _).1 hz |>.1⟩ + exact ⟨relationFiber B R i, + (M.pair_mem_relationFiberFamily I B R i _).2 ⟨hi, bound, rfl⟩, + fun f entry => ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2⟩ + +include separation hI hB hR in +theorem relationFiberFamily_entries (i f : ZFSet.{u}) : + ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔ i ∈ I ∧ f = relationFiber B R i := by + constructor + · intro entry + have parts := (M.pair_mem_relationFiberFamily I B R i f).1 entry + exact ⟨parts.1, parts.2.2⟩ + · rintro ⟨hi, rfl⟩ + obtain ⟨f, entry, _⟩ := (M.relationFiberFamily_function separation hI hB hR).2 i hi + have equal := ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2 + exact equal ▸ entry + +end TransitiveGround + + + + + +def ExternalCosetSupport (E U C classifier copies zero v y : ZFSet.{u}) : Prop := + ∃ c ∈ C, ∃ w ∈ E, ∃ x ∈ U, v = ZFSet.pair zero c ∧ + ZFSet.pair w c ∈ classifier ∧ ZFSet.pair (ZFSet.pair w x) y ∈ copies + +def ExternalTileSupport (E Q Requests localPoints action first v y : ZFSet.{u}) : Prop := + ∃ w ∈ E, ∃ r ∈ Requests, ∃ x ∈ Q, v = ZFSet.pair first (ZFSet.pair w r) ∧ + ZFSet.pair r x ∈ localPoints ∧ ZFSet.pair (ZFSet.pair w x) y ∈ action + +def externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧ + (ExternalCosetSupport E U C classifier copies zero v y ∨ + ExternalTileSupport E Q Requests localPoints action first v y)) (ZFSet.prod V Q) + +theorem pair_mem_externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first v y : ZFSet.{u}) : + ZFSet.pair v y ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ↔ + v ∈ V ∧ y ∈ Q ∧ (ExternalCosetSupport E U C classifier copies zero v y ∨ + ExternalTileSupport E Q Requests localPoints action first v y) := by + rw [externalStarSupportGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, v', hv, y', hy, equal, body⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hv, hy, body⟩ + · rintro ⟨hv, hy, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩ + +namespace BoundedFormula + +def externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) : BoundedFormula n := + exMem C (exMem E.succ (exMem U.succ.succ + (.conj (orderedPairFormula v.succ.succ.succ zero.succ.succ.succ 2) + (.conj (pairMembershipFormula 1 2 classifier.succ.succ.succ) + (tripleMembershipFormula 1 0 y.succ.succ.succ copies.succ.succ.succ))))) + +theorem truth_externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (externalCosetSupportFormula E U C classifier copies zero v y) env ↔ + ExternalCosetSupport (env E) (env U) (env C) (env classifier) (env copies) (env zero) (env v) (env y) := by + simp only [externalCosetSupportFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalCosetSupport] + rfl + +def externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) : BoundedFormula n := + exMem E (exMem Requests.succ (exMem Q.succ.succ + (.conj (orderedRightTripleFormula v.succ.succ.succ first.succ.succ.succ 2 1) + (.conj (pairMembershipFormula 1 0 localPoints.succ.succ.succ) + (tripleMembershipFormula 2 0 y.succ.succ.succ action.succ.succ.succ))))) + +theorem truth_externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (externalTileSupportFormula E Q Requests localPoints action first v y) env ↔ + ExternalTileSupport (env E) (env Q) (env Requests) (env localPoints) (env action) (env first) (env v) (env y) := by + simp only [externalTileSupportFormula, truth_exMem, Truth, truth_orderedRightTripleFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalTileSupport] + rfl + +def externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n) : BoundedFormula n := + exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (.disj (externalCosetSupportFormula E.succ.succ U.succ.succ C.succ.succ + classifier.succ.succ copies.succ.succ zero.succ.succ 1 0) + (externalTileSupportFormula E.succ.succ Q.succ.succ Requests.succ.succ + localPoints.succ.succ action.succ.succ first.succ.succ 1 0)))) + +theorem truth_externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (externalStarSupportEntryFormula z V Q E U C Requests classifier copies localPoints action zero first) env ↔ + env z ∈ externalStarSupportGraph (env V) (env Q) (env E) (env U) (env C) (env Requests) + (env classifier) (env copies) (env localPoints) (env action) (env zero) (env first) := by + simp only [externalStarSupportEntryFormula, truth_exMem, Truth, truth_disj, truth_orderedPairFormula, + truth_externalCosetSupportFormula, truth_externalTileSupportFormula, externalStarSupportGraph, ZFSet.mem_sep] + refine ⟨fun body => ⟨?_, body⟩, And.right⟩ + obtain ⟨v, hv, y, hy, equal, _⟩ := body + change env z = ZFSet.pair v y at equal + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩ +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem externalStarSupportGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}} + (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) (hE : E ∈ M.sets) (hU : U ∈ M.sets) + (hC : C ∈ M.sets) (hRequests : Requests ∈ M.sets) (hClassifier : classifier ∈ M.sets) + (hCopies : copies ∈ M.sets) (hLocal : localPoints ∈ M.sets) (hAction : action ∈ M.sets) + (hZero : zero ∈ M.sets) (hFirst : first ∈ M.sets) : + externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ∈ M.sets := by + 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)))))))))))) + 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))))))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) params members + (M.prod_mem pairing unions powers separation hV hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) (extend z params)) + (ZFSet.prod V Q) = externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_externalStarSupportEntryFormula] + change (z ∈ ZFSet.prod V Q ∧ z ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first) ↔ _ + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact equal ▸ selected + +end TransitiveGround + + + + + +def parentSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧ ZFSet.pair v y ∈ supports ∧ + ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports) (ZFSet.prod V Q) + +def freshSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∉ parentSupportGraph V Q supports parents) supports + +theorem pair_mem_parentSupportGraph (V Q supports parents v y : ZFSet.{u}) : + ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔ v ∈ V ∧ y ∈ Q ∧ + ZFSet.pair v y ∈ supports ∧ ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports := by + rw [parentSupportGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, v', hv, y', hy, equal, body⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hv, hy, body⟩ + · rintro ⟨hv, hy, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩ + +theorem pair_mem_parentSupportGraph_of_parent {V Q supports parents v p y : ZFSet.{u}} + (function : ZFSet.IsFunc V V parents) (parent : ZFSet.pair v p ∈ parents) : + ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔ + y ∈ Q ∧ ZFSet.pair v y ∈ supports ∧ ZFSet.pair p y ∈ supports := by + have shape := ZFSet.pair_mem_prod.1 (function.1 parent) + rw [pair_mem_parentSupportGraph] + constructor + · rintro ⟨_, hy, supported, p', _, atParent, supportedParent⟩ + have equal := (show FunctionGraphOn V parents from ⟨V, function⟩).unique atParent parent + exact ⟨hy, supported, equal ▸ supportedParent⟩ + · rintro ⟨hy, supported, supportedParent⟩ + exact ⟨shape.1, hy, supported, p, shape.2, parent, supportedParent⟩ + +theorem pair_mem_freshSupportGraph (V Q supports parents v y : ZFSet.{u}) : + ZFSet.pair v y ∈ freshSupportGraph V Q supports parents ↔ + ZFSet.pair v y ∈ supports ∧ ZFSet.pair v y ∉ parentSupportGraph V Q supports parents := by + exact ZFSet.mem_sep + +namespace BoundedFormula +def parentSupportEntryFormula {n} (z V Q supports parents : Fin n) : BoundedFormula n := + exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (.conj (pairMembershipFormula 1 0 supports.succ.succ) + (exMem V.succ.succ (.conj (pairMembershipFormula 2 0 parents.succ.succ.succ) + (pairMembershipFormula 0 1 supports.succ.succ.succ)))))) + +theorem truth_parentSupportEntryFormula {n} (z V Q supports parents : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (parentSupportEntryFormula z V Q supports parents) env ↔ + env z ∈ parentSupportGraph (env V) (env Q) (env supports) (env parents) := by + simp only [parentSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_pairMembershipFormula, parentSupportGraph, ZFSet.mem_sep] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨v, hv, y, hy, equal, _⟩ := h + change env z = ZFSet.pair v y at equal + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩ +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {V Q supports parents : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) +variable (hSupports : supports ∈ M.sets) (hParents : parents ∈ M.sets) +include pairing unions powers separation hV hQ hSupports hParents + +theorem parentSupportGraph_mem : parentSupportGraph V Q supports parents ∈ M.sets := by + let params := extend V (extend Q (extend supports (extend parents Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) params + (Fin.cases hV (Fin.cases hQ (Fin.cases hSupports (Fin.cases hParents (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation hV hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) (extend z params)) (ZFSet.prod V Q) = + parentSupportGraph V Q supports parents := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_parentSupportEntryFormula] + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact equal ▸ selected + +theorem freshSupportGraph_mem : freshSupportGraph V Q supports parents ∈ M.sets := by + have parentGround := M.parentSupportGraph_mem pairing unions powers separation hV hQ hSupports hParents + exact M.bounded_separation_mem separation (BoundedFormula.neg (.mem 0 1)) + (extend (parentSupportGraph V Q supports parents) Fin.elim0) + (Fin.cases parentGround (fun i => Fin.elim0 i)) hSupports + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PartitionPrincipleFormula.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PartitionPrincipleFormula.lean index 5dfd30bcacb8b56d1e3aeec57008adb69e7f4d6b..18e178c390cade6b9be3816b22d61ef7f234f972 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PartitionPrincipleFormula.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PartitionPrincipleFormula.lean @@ -1,50 +1,50 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSizeWitnesses - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -theorem truth_surjectionFormula {n : Nat} (a b f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (surjectionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) ∧ - ∀ y ∈ env b, ∃ x ∈ env a, ZFSet.pair x y ∈ env f := by - simp only [surjectionFormula, Truth, truth_functionFormula, truth_exMem, - truth_pairMembershipFormula] - rfl - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.SetFormula - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u - -theorem realize_partitionPrinciple (M : TransitiveGround.{u}) : - Realize M.sets partitionPrinciple Fin.elim0 ↔ - ∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets, ZFSet.IsFunc X Y f → - (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → M.groundEmbeddable Y X := by - change (∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets, - Realize M.sets (imp (BoundedFormula.surjectionFormula (n := 3) 2 1 0).toFormula - (hasInjectionFormula (n := 3) 1 2)) (extend f (extend Y (extend X Fin.elim0)))) ↔ _ - apply forall_congr' fun X => forall_congr' fun hX => - forall_congr' fun Y => forall_congr' fun hY => - forall_congr' fun f => forall_congr' fun hf => ?_ - let env := extend f (extend Y (extend X Fin.elim0)) - have members : ∀ j, env j ∈ M.sets := - Fin.cases hf (Fin.cases hY (Fin.cases hX (fun j => Fin.elim0 j))) - rw [realize_imp, M.realize_hasInjectionFormula 1 2 env members, - BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_surjectionFormula] - exact ⟨fun h function onto => h ⟨function, onto⟩, - fun h ⟨function, onto⟩ => h function onto⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSizeWitnesses + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +theorem truth_surjectionFormula {n : Nat} (a b f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (surjectionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) ∧ + ∀ y ∈ env b, ∃ x ∈ env a, ZFSet.pair x y ∈ env f := by + simp only [surjectionFormula, Truth, truth_functionFormula, truth_exMem, + truth_pairMembershipFormula] + rfl + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.SetFormula + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u + +theorem realize_partitionPrinciple (M : TransitiveGround.{u}) : + Realize M.sets partitionPrinciple Fin.elim0 ↔ + ∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets, ZFSet.IsFunc X Y f → + (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → M.groundEmbeddable Y X := by + change (∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets, + Realize M.sets (imp (BoundedFormula.surjectionFormula (n := 3) 2 1 0).toFormula + (hasInjectionFormula (n := 3) 1 2)) (extend f (extend Y (extend X Fin.elim0)))) ↔ _ + apply forall_congr' fun X => forall_congr' fun hX => + forall_congr' fun Y => forall_congr' fun hY => + forall_congr' fun f => forall_congr' fun hf => ?_ + let env := extend f (extend Y (extend X Fin.elim0)) + have members : ∀ j, env j ∈ M.sets := + Fin.cases hf (Fin.cases hY (Fin.cases hX (fun j => Fin.elim0 j))) + rw [realize_imp, M.realize_hasInjectionFormula 1 2 env members, + BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_surjectionFormula] + exact ⟨fun h function onto => h ⟨function, onto⟩, + fun h ⟨function, onto⟩ => h function onto⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreparedCertificateCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreparedCertificateCodes.lean index b7e99d03833e177bcf32c7bcbd5fc0da698b17fd..33f467a8a1446c3de6b97ab552cd36baf4d21e2c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreparedCertificateCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreparedCertificateCodes.lean @@ -1,181 +1,181 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundVisibilitySupportIncidence - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -def SynchronizedEnumerationCode (omega N B f e names : ZFSet.{u}) : Prop := - ZFSet.IsFunc B N f ∧ ZFSet.IsFunc omega B e ∧ ZFSet.IsFunc omega N names ∧ - (∀ v ∈ B, ∃ n ∈ omega, ZFSet.pair n v ∈ e) ∧ - (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ - (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) - -namespace BoundedFormula -open SetFormula - -def synchronizedEnumerationFormula {n} (omega N B f e names : Fin n) : BoundedFormula n := - .conj (functionFormula B N f) - (.conj (functionFormula omega B e) - (.conj (functionFormula omega N names) - (.conj (.allMem B (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ))) - (.conj - (.allMem omega (.allMem B.succ (.allMem N.succ.succ - (imp (pairMembershipFormula 2 1 e.succ.succ.succ) - (imp (pairMembershipFormula 2 0 names.succ.succ.succ) - (pairMembershipFormula 1 0 f.succ.succ.succ)))))) - (.allMem omega (.allMem B.succ (.allMem N.succ.succ - (imp (pairMembershipFormula 2 1 e.succ.succ.succ) - (imp (pairMembershipFormula 1 0 f.succ.succ.succ) - (pairMembershipFormula 2 0 names.succ.succ.succ)))))))))) - -theorem truth_synchronizedEnumerationFormula {n} (omega N B f e names : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (synchronizedEnumerationFormula omega N B f e names) env ↔ - SynchronizedEnumerationCode (env omega) (env N) (env B) (env f) (env e) (env names) := by - simp only [synchronizedEnumerationFormula, Truth, truth_functionFormula, - truth_exMem, truth_pairMembershipFormula, truth_imp] - change (ZFSet.IsFunc (env B) (env N) (env f) ∧ - ZFSet.IsFunc (env omega) (env B) (env e) ∧ - ZFSet.IsFunc (env omega) (env N) (env names) ∧ - (∀ v ∈ env B, ∃ n ∈ env omega, ZFSet.pair n v ∈ env e) ∧ - (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e → - ZFSet.pair n tau ∈ env names → ZFSet.pair v tau ∈ env f) ∧ - (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e → - ZFSet.pair v tau ∈ env f → ZFSet.pair n tau ∈ env names)) ↔ _ - constructor - · rintro ⟨ff, ef, nf, onto, forward, backward⟩ - refine ⟨ff, ef, nf, onto, ?_, ?_⟩ - · intro n hn v tau nv nt - exact forward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2 - tau (ZFSet.pair_mem_prod.1 (nf.1 nt)).2 nv nt - · intro n hn v tau nv vt - exact backward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2 - tau (ZFSet.pair_mem_prod.1 (ff.1 vt)).2 nv vt - · rintro ⟨ff, ef, nf, onto, forward, backward⟩ - exact ⟨ff, ef, nf, onto, fun n hn v _ tau _ => forward n hn v tau, - fun n hn v _ tau _ => backward n hn v tau⟩ - -def certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n) : - BoundedFormula n := - exPairFields entry (exPairFields 0 - (exGraphFields k.succ.succ.succ.succ (exPairFields 0 (exPairFields 0 - (.conj (.equal 5 9) - (.conj (.mem 9 J.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ) - (.conj (.mem 7 E.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ) - (.conj (.mem 6 Names.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ) - (synchronizedEnumerationFormula - omega.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ - N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 1 0 7 6))))))))) - -theorem truth_certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (certificateEnumerationEntryFormula entry J E Names omega N k) env ↔ - ∃ j ∈ env J, ∃ e ∈ env E, ∃ names ∈ env Names, - env entry = ZFSet.pair j (ZFSet.pair e names) ∧ - ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧ - SynchronizedEnumerationCode (env omega) (env N) B f e names := by - simp only [certificateEnumerationEntryFormula, truth_exPairFields, truth_exGraphFields, - Truth, truth_synchronizedEnumerationFormula] - change (∃ j pair, env entry = ZFSet.pair j pair ∧ - ∃ e names, pair = ZFSet.pair e names ∧ - ∃ j' certificate, ZFSet.pair j' certificate ∈ env k ∧ - ∃ F tail, certificate = ZFSet.pair F tail ∧ - ∃ B f, tail = ZFSet.pair B f ∧ j' = j ∧ - j ∈ env J ∧ e ∈ env E ∧ names ∈ env Names ∧ - SynchronizedEnumerationCode (env omega) (env N) B f e names) ↔ _ - constructor - · rintro ⟨j, pair, eq, e, names, rfl, j', certificate, stored, - F, tail, rfl, B, f, rfl, rfl, hj, he, hn, code⟩ - exact ⟨j', hj, e, he, names, hn, eq, F, B, f, stored, code⟩ - · rintro ⟨j, hj, e, he, names, hn, eq, F, B, f, stored, code⟩ - exact ⟨j, _, eq, e, names, rfl, j, _, stored, F, _, rfl, - B, f, rfl, rfl, hj, he, hn, code⟩ - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def PreparedCertificateCode (M : TransitiveGround.{u}) - (P order q nodes nodeOrder meet N visibility top omega z F B f e names : ZFSet.{u}) : Prop := - MeetFilterCode nodes nodeOrder meet F ∧ - CoinitialBelowCode nodeOrder F F B ∧ B.Nonempty ∧ - SynchronizedEnumerationCode omega N B f e names ∧ - (∀ v tau, ZFSet.pair v tau ∈ f → - ZFSet.pair v tau ∈ visibilitySupportIncidence nodes N visibility top) ∧ - PreparationForcingCode M P order q nodes visibility z F f - -namespace SetFormula - -def preparedCertificateFormula {n} - (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n) : SetFormula n := - .conj (BoundedFormula.meetFilterFormula nodes nodeOrder meet F).toFormula - (.conj (BoundedFormula.coinitialBelowFormula nodeOrder F F B).toFormula - (.conj (BoundedFormula.exMem B (.equal 0 0)).toFormula - (.conj (BoundedFormula.synchronizedEnumerationFormula omega N B f e names).toFormula - (.conj (allGraphFields f - (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ - visibility.succ.succ top.succ.succ).toFormula) - (preparationForcingFormula P order q nodes visibility z F f))))) - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_preparedCertificateFormula {n} - (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meetCode : MeetOrderCode (env nodes) (env nodeOrder) (env meet)) : - Realize M.sets - (preparedCertificateFormula P order q nodes nodeOrder meet N visibility top omega z F B f e names) env ↔ - PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) - (env meet) (env N) (env visibility) (env top) (env omega) (env z) - (env F) (env B) (env f) (env e) (env names) := by - have nonempty : Realize M.sets (BoundedFormula.exMem B (.equal 0 0)).toFormula env ↔ - (env B).Nonempty := by - rw [BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_exMem] - simp only [BoundedFormula.Truth, and_true] - rfl - have supported : Realize M.sets (allGraphFields f - (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ - visibility.succ.succ top.succ.succ).toFormula) env ↔ - ∀ v tau, ZFSet.pair v tau ∈ env f → - ZFSet.pair v tau ∈ visibilitySupportIncidence (env nodes) (env N) (env visibility) (env top) := by - rw [M.realize_allGraphFields _ _ env members] - constructor - · intro holds v tau entry - have pairGround := M.transitive (members f) entry - exact (BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).1 - ((BoundedFormula.realize_toFormula M _ _ - (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).1 - (holds v tau entry)) - · intro holds v tau entry - have pairGround := M.transitive (members f) entry - exact (BoundedFormula.realize_toFormula M _ _ - (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).2 - ((BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).2 (holds v tau entry)) - simp only [preparedCertificateFormula, Realize] - rw [BoundedFormula.realize_meetFilterFormula M _ _ _ _ env members meetCode, - BoundedFormula.realize_coinitialBelowFormula M _ _ _ _ env members, - nonempty, BoundedFormula.realize_toFormula M _ env members, - BoundedFormula.truth_synchronizedEnumerationFormula, supported, - M.realize_preparationForcingFormula _ _ _ _ _ _ _ _ env members] - rfl - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundVisibilitySupportIncidence + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +def SynchronizedEnumerationCode (omega N B f e names : ZFSet.{u}) : Prop := + ZFSet.IsFunc B N f ∧ ZFSet.IsFunc omega B e ∧ ZFSet.IsFunc omega N names ∧ + (∀ v ∈ B, ∃ n ∈ omega, ZFSet.pair n v ∈ e) ∧ + (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ + (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) + +namespace BoundedFormula +open SetFormula + +def synchronizedEnumerationFormula {n} (omega N B f e names : Fin n) : BoundedFormula n := + .conj (functionFormula B N f) + (.conj (functionFormula omega B e) + (.conj (functionFormula omega N names) + (.conj (.allMem B (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ))) + (.conj + (.allMem omega (.allMem B.succ (.allMem N.succ.succ + (imp (pairMembershipFormula 2 1 e.succ.succ.succ) + (imp (pairMembershipFormula 2 0 names.succ.succ.succ) + (pairMembershipFormula 1 0 f.succ.succ.succ)))))) + (.allMem omega (.allMem B.succ (.allMem N.succ.succ + (imp (pairMembershipFormula 2 1 e.succ.succ.succ) + (imp (pairMembershipFormula 1 0 f.succ.succ.succ) + (pairMembershipFormula 2 0 names.succ.succ.succ)))))))))) + +theorem truth_synchronizedEnumerationFormula {n} (omega N B f e names : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (synchronizedEnumerationFormula omega N B f e names) env ↔ + SynchronizedEnumerationCode (env omega) (env N) (env B) (env f) (env e) (env names) := by + simp only [synchronizedEnumerationFormula, Truth, truth_functionFormula, + truth_exMem, truth_pairMembershipFormula, truth_imp] + change (ZFSet.IsFunc (env B) (env N) (env f) ∧ + ZFSet.IsFunc (env omega) (env B) (env e) ∧ + ZFSet.IsFunc (env omega) (env N) (env names) ∧ + (∀ v ∈ env B, ∃ n ∈ env omega, ZFSet.pair n v ∈ env e) ∧ + (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e → + ZFSet.pair n tau ∈ env names → ZFSet.pair v tau ∈ env f) ∧ + (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e → + ZFSet.pair v tau ∈ env f → ZFSet.pair n tau ∈ env names)) ↔ _ + constructor + · rintro ⟨ff, ef, nf, onto, forward, backward⟩ + refine ⟨ff, ef, nf, onto, ?_, ?_⟩ + · intro n hn v tau nv nt + exact forward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2 + tau (ZFSet.pair_mem_prod.1 (nf.1 nt)).2 nv nt + · intro n hn v tau nv vt + exact backward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2 + tau (ZFSet.pair_mem_prod.1 (ff.1 vt)).2 nv vt + · rintro ⟨ff, ef, nf, onto, forward, backward⟩ + exact ⟨ff, ef, nf, onto, fun n hn v _ tau _ => forward n hn v tau, + fun n hn v _ tau _ => backward n hn v tau⟩ + +def certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n) : + BoundedFormula n := + exPairFields entry (exPairFields 0 + (exGraphFields k.succ.succ.succ.succ (exPairFields 0 (exPairFields 0 + (.conj (.equal 5 9) + (.conj (.mem 9 J.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ) + (.conj (.mem 7 E.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ) + (.conj (.mem 6 Names.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ) + (synchronizedEnumerationFormula + omega.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ + N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 1 0 7 6))))))))) + +theorem truth_certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (certificateEnumerationEntryFormula entry J E Names omega N k) env ↔ + ∃ j ∈ env J, ∃ e ∈ env E, ∃ names ∈ env Names, + env entry = ZFSet.pair j (ZFSet.pair e names) ∧ + ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧ + SynchronizedEnumerationCode (env omega) (env N) B f e names := by + simp only [certificateEnumerationEntryFormula, truth_exPairFields, truth_exGraphFields, + Truth, truth_synchronizedEnumerationFormula] + change (∃ j pair, env entry = ZFSet.pair j pair ∧ + ∃ e names, pair = ZFSet.pair e names ∧ + ∃ j' certificate, ZFSet.pair j' certificate ∈ env k ∧ + ∃ F tail, certificate = ZFSet.pair F tail ∧ + ∃ B f, tail = ZFSet.pair B f ∧ j' = j ∧ + j ∈ env J ∧ e ∈ env E ∧ names ∈ env Names ∧ + SynchronizedEnumerationCode (env omega) (env N) B f e names) ↔ _ + constructor + · rintro ⟨j, pair, eq, e, names, rfl, j', certificate, stored, + F, tail, rfl, B, f, rfl, rfl, hj, he, hn, code⟩ + exact ⟨j', hj, e, he, names, hn, eq, F, B, f, stored, code⟩ + · rintro ⟨j, hj, e, he, names, hn, eq, F, B, f, stored, code⟩ + exact ⟨j, _, eq, e, names, rfl, j, _, stored, F, _, rfl, + B, f, rfl, rfl, hj, he, hn, code⟩ + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def PreparedCertificateCode (M : TransitiveGround.{u}) + (P order q nodes nodeOrder meet N visibility top omega z F B f e names : ZFSet.{u}) : Prop := + MeetFilterCode nodes nodeOrder meet F ∧ + CoinitialBelowCode nodeOrder F F B ∧ B.Nonempty ∧ + SynchronizedEnumerationCode omega N B f e names ∧ + (∀ v tau, ZFSet.pair v tau ∈ f → + ZFSet.pair v tau ∈ visibilitySupportIncidence nodes N visibility top) ∧ + PreparationForcingCode M P order q nodes visibility z F f + +namespace SetFormula + +def preparedCertificateFormula {n} + (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n) : SetFormula n := + .conj (BoundedFormula.meetFilterFormula nodes nodeOrder meet F).toFormula + (.conj (BoundedFormula.coinitialBelowFormula nodeOrder F F B).toFormula + (.conj (BoundedFormula.exMem B (.equal 0 0)).toFormula + (.conj (BoundedFormula.synchronizedEnumerationFormula omega N B f e names).toFormula + (.conj (allGraphFields f + (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ + visibility.succ.succ top.succ.succ).toFormula) + (preparationForcingFormula P order q nodes visibility z F f))))) + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_preparedCertificateFormula {n} + (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meetCode : MeetOrderCode (env nodes) (env nodeOrder) (env meet)) : + Realize M.sets + (preparedCertificateFormula P order q nodes nodeOrder meet N visibility top omega z F B f e names) env ↔ + PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) + (env meet) (env N) (env visibility) (env top) (env omega) (env z) + (env F) (env B) (env f) (env e) (env names) := by + have nonempty : Realize M.sets (BoundedFormula.exMem B (.equal 0 0)).toFormula env ↔ + (env B).Nonempty := by + rw [BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_exMem] + simp only [BoundedFormula.Truth, and_true] + rfl + have supported : Realize M.sets (allGraphFields f + (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ + visibility.succ.succ top.succ.succ).toFormula) env ↔ + ∀ v tau, ZFSet.pair v tau ∈ env f → + ZFSet.pair v tau ∈ visibilitySupportIncidence (env nodes) (env N) (env visibility) (env top) := by + rw [M.realize_allGraphFields _ _ env members] + constructor + · intro holds v tau entry + have pairGround := M.transitive (members f) entry + exact (BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).1 + ((BoundedFormula.realize_toFormula M _ _ + (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).1 + (holds v tau entry)) + · intro holds v tau entry + have pairGround := M.transitive (members f) entry + exact (BoundedFormula.realize_toFormula M _ _ + (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).2 + ((BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).2 (holds v tau entry)) + simp only [preparedCertificateFormula, Realize] + rw [BoundedFormula.realize_meetFilterFormula M _ _ _ _ env members meetCode, + BoundedFormula.realize_coinitialBelowFormula M _ _ _ _ env members, + nonempty, BoundedFormula.realize_toFormula M _ env members, + BoundedFormula.truth_synchronizedEnumerationFormula, supported, + M.realize_preparationForcingFormula _ _ _ _ _ _ _ _ env members] + rfl + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedGroupCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedGroupCodes.lean index f034b9d29581735d658f313a052933f4604ef96b..43fa58c43c91b1ece1f1244ec3d60b16eb510825 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedGroupCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedGroupCodes.lean @@ -1,688 +1,688 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula -import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalRecursionTraces - -namespace OAI - - -namespace PartitionPilot.Forcing - -namespace BoundedFormula - -open SetFormula -universe u - -def Truth : {n : Nat} → BoundedFormula n → (Fin n → ZFSet.{u}) → Prop - | _, .equal i j, env => env i = env j - | _, .mem i j, env => env i ∈ env j - | _, .neg φ, env => ¬ Truth φ env - | _, .conj φ ψ, env => Truth φ env ∧ Truth ψ env - | _, .allMem b φ, env => ∀ x ∈ env b, Truth φ (extend x env) - -theorem truth_imp {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) : - Truth (imp φ ψ) env ↔ (Truth φ env → Truth ψ env) := by - classical - simp only [imp, Truth, not_and, not_not] - -theorem truth_disj {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) : - Truth (disj φ ψ) env ↔ (Truth φ env ∨ Truth ψ env) := by - classical - simp only [disj, Truth, not_and_or, not_not] - -theorem truth_exMem {n} (b : Fin n) (φ : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) : - Truth (exMem b φ) env ↔ ∃ x ∈ env b, Truth φ (extend x env) := by - classical - simp only [exMem, Truth, not_forall, not_not, exists_prop] - -theorem realize_toFormula (M : TransitiveGround.{u}) {n} (φ : BoundedFormula n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets φ.toFormula env ↔ Truth φ env := by - induction φ with - | equal i j => rfl - | mem i j => rfl - | neg φ ih => exact not_congr (ih env members) - | conj φ ψ ihφ ihψ => exact and_congr (ihφ env members) (ihψ env members) - | allMem b φ ih => - change (∀ x ∈ M.sets, Realize M.sets (SetFormula.imp (.mem 0 b.succ) φ.toFormula) (extend x env)) ↔ _ - constructor - · intro h x hx - have hxM := M.transitive (members b) hx - exact (ih (extend x env) (Fin.cases hxM members)).1 - ((realize_imp M.sets _ _ _).1 (h x hxM) hx) - · intro h x hxM - apply (realize_imp M.sets _ _ _).2 - intro hx - exact (ih (extend x env) (Fin.cases hxM members)).2 (h x hx) - -theorem absolute (M N : TransitiveGround.{u}) {n} (φ : BoundedFormula n) - (env : Fin n → ZFSet.{u}) (inM : ∀ i, env i ∈ M.sets) (inN : ∀ i, env i ∈ N.sets) : - Realize M.sets φ.toFormula env ↔ Realize N.sets φ.toFormula env := - (realize_toFormula M φ env inM).trans (realize_toFormula N φ env inN).symm - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def emptyFormula {n} (x : Fin n) : BoundedFormula n := - .allMem x (.neg (.equal 0 0)) - -def successorFormula {n} (y x : Fin n) : BoundedFormula n := - .conj (.mem x y) (.conj (.allMem x (.mem 0 y.succ)) - (.allMem y (disj (.equal 0 x.succ) (.mem 0 x.succ)))) - -def setTransitiveFormula {n} (x : Fin n) : BoundedFormula n := - .allMem x (.allMem 0 (.mem 0 x.succ.succ)) - -def zeroOrSuccessorFormula {n} (x : Fin n) : BoundedFormula n := - disj (emptyFormula x) (exMem x (successorFormula x.succ 0)) - -def naturalFormula {n} (x : Fin n) : BoundedFormula n := - .conj (setTransitiveFormula x) (.conj (zeroOrSuccessorFormula x) - (.allMem x (.conj (setTransitiveFormula 0) (zeroOrSuccessorFormula 0)))) - -theorem truth_emptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (emptyFormula x) env ↔ env x = ∅ := by - change (∀ y ∈ env x, ¬ y = y) ↔ _ - constructor - · intro h - exact (ZFSet.eq_empty _).2 (fun y hy => h y hy rfl) - · intro h y hy - exact False.elim ((ZFSet.eq_empty _).1 h y hy) - -theorem truth_successorFormula {n} (y x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (successorFormula y x) env ↔ env y = insert (env x) (env x) := by - simp only [successorFormula, Truth, truth_disj] - change (env x ∈ env y ∧ (∀ z ∈ env x, z ∈ env y) ∧ - ∀ z ∈ env y, z = env x ∨ z ∈ env x) ↔ _ - constructor - · rintro ⟨hx, lower, upper⟩ - apply ZFSet.ext - intro z - rw [ZFSet.mem_insert_iff] - exact ⟨upper z, fun h => h.elim (fun eq => eq.symm ▸ hx) (lower z)⟩ - · intro eq - rw [eq] - exact ⟨ZFSet.mem_insert _ _, fun _ hz => ZFSet.mem_insert_of_mem _ hz, - fun _ hz => ZFSet.mem_insert_iff.1 hz⟩ - -theorem truth_setTransitiveFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (setTransitiveFormula x) env ↔ setTransitive (env x) := Iff.rfl - -theorem truth_zeroOrSuccessorFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (zeroOrSuccessorFormula x) env ↔ zeroOrSuccessor (env x) := by - simp only [zeroOrSuccessorFormula, truth_disj, truth_emptyFormula, truth_exMem, - truth_successorFormula] - rfl - -theorem truth_naturalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (naturalFormula x) env ↔ env x ∈ ZFSet.omega := by - simp only [naturalFormula, Truth, truth_setTransitiveFormula, truth_zeroOrSuccessorFormula] - exact naturalSetProperty_iff_mem_omega (env x) - -theorem realize_naturalFormula (M : TransitiveGround.{u}) {n} - (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (naturalFormula x).toFormula env ↔ env x ∈ ZFSet.omega := - (realize_toFormula M _ env members).trans (truth_naturalFormula x env) - - - - - - -theorem truth_singletonFormula {n} (z x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (singletonFormula z x) env ↔ env z = {env x} := by - change (env x ∈ env z ∧ ∀ w ∈ env z, w = env x) ↔ _ - constructor - · rintro ⟨member, only⟩ - apply ZFSet.ext - intro w - rw [ZFSet.mem_singleton] - exact ⟨only w, fun eq => eq.symm ▸ member⟩ - · intro eq - rw [eq] - exact ⟨ZFSet.mem_singleton.2 rfl, fun _ h => ZFSet.mem_singleton.1 h⟩ - -theorem truth_unorderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (unorderedPairFormula z x y) env ↔ env z = {env x, env y} := by - simp only [unorderedPairFormula, Truth, truth_disj] - change (env x ∈ env z ∧ env y ∈ env z ∧ ∀ w ∈ env z, w = env x ∨ w = env y) ↔ _ - constructor - · rintro ⟨hx, hy, only⟩ - apply ZFSet.ext - intro w - rw [ZFSet.mem_pair] - refine ⟨only w, ?_⟩ - rintro (rfl | rfl) - · exact hx - · exact hy - · intro eq - rw [eq] - exact ⟨ZFSet.mem_pair.2 (Or.inl rfl), ZFSet.mem_pair.2 (Or.inr rfl), fun _ h => ZFSet.mem_pair.1 h⟩ - -theorem truth_orderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (orderedPairFormula z x y) env ↔ env z = ZFSet.pair (env x) (env y) := by - rw [orderedPairFormula, truth_exMem] - constructor - · rintro ⟨a, _, first, rest⟩ - have ha := (truth_singletonFormula 0 x.succ (extend a env)).1 first - obtain ⟨b, _, second, shape⟩ := (truth_exMem _ _ _).1 rest - have hb := (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ (extend b (extend a env))).1 second - have hz := (truth_unorderedPairFormula z.succ.succ 1 0 (extend b (extend a env))).1 shape - change a = {env x} at ha - change b = {env x, env y} at hb - change env z = {a, b} at hz - rw [hz, ha, hb] - rfl - · intro eq - have ha : ({env x} : ZFSet.{u}) ∈ env z := by - rw [eq] - exact ZFSet.mem_pair.2 (Or.inl rfl) - refine ⟨{env x}, ha, (truth_singletonFormula 0 x.succ _).2 rfl, ?_⟩ - apply (truth_exMem _ _ _).2 - have hb : ({env x, env y} : ZFSet.{u}) ∈ env z := by - rw [eq] - exact ZFSet.mem_pair.2 (Or.inr rfl) - exact ⟨{env x, env y}, hb, (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ _).2 rfl, - (truth_unorderedPairFormula z.succ.succ 1 0 _).2 eq⟩ - -theorem truth_pairMembershipFormula {n} (x y r : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (pairMembershipFormula x y r) env ↔ ZFSet.pair (env x) (env y) ∈ env r := by - rw [pairMembershipFormula, truth_exMem] - constructor - · rintro ⟨z, hz, shape⟩ - have eq := (truth_orderedPairFormula 0 x.succ y.succ (extend z env)).1 shape - exact eq ▸ hz - · intro member - exact ⟨ZFSet.pair (env x) (env y), member, (truth_orderedPairFormula 0 x.succ y.succ _).2 rfl⟩ - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing - -universe u - -namespace SetFormula - -def exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1)) : SetFormula n := - .all (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ))) - -end SetFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1)) - (env : Fin n → ZFSet.{u}) {target : ZFSet.{u}} - (hOutput : env output ∈ M.sets) (elements : ∀ z ∈ target, z ∈ M.sets) - (meaning : ∀ z ∈ M.sets, Realize M.sets entry (extend z env) ↔ z ∈ target) : - Realize M.sets (exactSetFormula output entry) env ↔ env output = target := by - change (∀ z ∈ M.sets, Realize M.sets - (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ))) (extend z env)) ↔ _ - simp only [Realize, realize_imp] - change (∀ z ∈ M.sets, (z ∈ env output → Realize M.sets entry (extend z env)) ∧ - (Realize M.sets entry (extend z env) → z ∈ env output)) ↔ _ - constructor - · intro correct - apply ZFSet.ext - intro z - constructor - · intro member - have hz := M.transitive hOutput member - exact (meaning z hz).1 ((correct z hz).1 member) - · intro member - have hz := elements z member - exact (correct z hz).2 ((meaning z hz).2 member) - · intro equal z hz - exact ⟨fun member => (meaning z hz).2 (equal ▸ member), - fun predicate => equal.symm ▸ (meaning z hz).1 predicate⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula SetRealization -universe u - -def ordinalFormula {n} (x : Fin n) : BoundedFormula n := - .conj (setTransitiveFormula x) (.allMem x (setTransitiveFormula 0)) - -theorem truth_ordinalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (ordinalFormula x) env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o := by - simp only [ordinalFormula, Truth, truth_setTransitiveFormula] - exact ordinalSetProperty_iff (env x) - -theorem realize_ordinalFormula (M : TransitiveGround.{u}) {n} - (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (ordinalFormula x).toFormula env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o := - (realize_toFormula M _ env members).trans (truth_ordinalFormula x env) - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def graphFiberInclusionFormula {n} (x y f g : Fin n) : BoundedFormula n := - .allMem f (.allMem 0 (.allMem 0 - (imp (orderedPairFormula 2 x.succ.succ.succ 0) - (pairMembershipFormula y.succ.succ.succ 0 g.succ.succ.succ)))) - -theorem truth_graphFiberInclusionFormula {n} (x y f g : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (graphFiberInclusionFormula x y f g) env ↔ - ∀ z, ZFSet.pair (env x) z ∈ env f → ZFSet.pair (env y) z ∈ env g := by - simp only [graphFiberInclusionFormula, Truth, truth_imp, - truth_orderedPairFormula, truth_pairMembershipFormula] - change (∀ p ∈ env f, ∀ a ∈ p, ∀ z ∈ a, - p = ZFSet.pair (env x) z → ZFSet.pair (env y) z ∈ env g) ↔ _ - constructor - · intro h z entry - exact h (ZFSet.pair (env x) z) entry {env x, z} - (ZFSet.mem_pair.2 (Or.inr rfl)) z (ZFSet.mem_pair.2 (Or.inr rfl)) rfl - · intro h p hp a _ z _ equal - exact h z (equal ▸ hp) - -def graphFiberEqualityFormula {n} (x y f g : Fin n) : BoundedFormula n := - .conj (graphFiberInclusionFormula x y f g) (graphFiberInclusionFormula y x g f) - -theorem truth_graphFiberEqualityFormula {n} (x y f g : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (graphFiberEqualityFormula x y f g) env ↔ - ∀ z, ZFSet.pair (env x) z ∈ env f ↔ ZFSet.pair (env y) z ∈ env g := by - simp only [graphFiberEqualityFormula, Truth, truth_graphFiberInclusionFormula] - exact ⟨fun h z => ⟨h.1 z, h.2 z⟩, fun h => ⟨fun z => (h z).1, fun z => (h z).2⟩⟩ - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing - -universe u - -structure PartialOrderCode (Q R : ZFSet.{u}) : Prop where - relation : R ⊆ ZFSet.prod Q Q - refl : ∀ x ∈ Q, ZFSet.pair x x ∈ R - antisymm : ∀ x ∈ Q, ∀ y ∈ Q, ZFSet.pair x y ∈ R → ZFSet.pair y x ∈ R → x = y - trans : ∀ x ∈ Q, ∀ y ∈ Q, ∀ z ∈ Q, - ZFSet.pair x y ∈ R → ZFSet.pair y z ∈ R → ZFSet.pair x z ∈ R - -namespace BoundedFormula - -open SetFormula - -def relationOnFormula {n} (c r : Fin n) : BoundedFormula n := - .allMem r (exMem c.succ (exMem c.succ.succ (orderedPairFormula 2 1 0))) - -def reflexiveFormula {n} (c r : Fin n) : BoundedFormula n := - .allMem c (pairMembershipFormula 0 0 r.succ) - -def antisymmetricFormula {n} (c r : Fin n) : BoundedFormula n := - .allMem c (.allMem c.succ (imp - (.conj (pairMembershipFormula 1 0 r.succ.succ) (pairMembershipFormula 0 1 r.succ.succ)) (.equal 1 0))) - -def transitiveFormula {n} (c r : Fin n) : BoundedFormula n := - .allMem c (.allMem c.succ (.allMem c.succ.succ (imp - (.conj (pairMembershipFormula 2 1 r.succ.succ.succ) (pairMembershipFormula 1 0 r.succ.succ.succ)) - (pairMembershipFormula 2 0 r.succ.succ.succ)))) - -def partialOrderFormula {n} (c r : Fin n) : BoundedFormula n := - .conj (relationOnFormula c r) (.conj (reflexiveFormula c r) - (.conj (antisymmetricFormula c r) (transitiveFormula c r))) - -def topFormula {n} (c r t : Fin n) : BoundedFormula n := - .conj (.mem t c) (.allMem c (pairMembershipFormula 0 t.succ r.succ)) - -theorem truth_relationOnFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (relationOnFormula c r) env ↔ env r ⊆ ZFSet.prod (env c) (env c) := by - simp only [relationOnFormula, Truth, truth_exMem, truth_orderedPairFormula] - exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm)) - -theorem truth_partialOrderFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (partialOrderFormula c r) env ↔ PartialOrderCode (env c) (env r) := by - simp only [partialOrderFormula, Truth, truth_relationOnFormula, reflexiveFormula, - antisymmetricFormula, transitiveFormula, truth_imp, truth_pairMembershipFormula] - constructor - · rintro ⟨shape, refl, antisymm, trans⟩ - exact ⟨shape, refl, fun x hx y hy xy yx => antisymm x hx y hy ⟨xy, yx⟩, - fun x hx y hy z hz xy yz => trans x hx y hy z hz ⟨xy, yz⟩⟩ - · intro h - exact ⟨h.relation, h.refl, fun x hx y hy ⟨xy, yx⟩ => h.antisymm x hx y hy xy yx, - fun x hx y hy z hz ⟨xy, yz⟩ => h.trans x hx y hy z hz xy yz⟩ - -theorem truth_topFormula {n} (c r t : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (topFormula c r t) env ↔ env t ∈ env c ∧ ∀ x ∈ env c, ZFSet.pair x (env t) ∈ env r := by - simp only [topFormula, Truth, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_partialOrderCode {Q R : ZFSet.{u}} (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) : - Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔ - PartialOrderCode Q R := - (BoundedFormula.realize_toFormula M _ _ (Fin.cases hQ (Fin.cases hR (fun i => Fin.elim0 i)))).trans - (BoundedFormula.truth_partialOrderFormula 0 1 _) - -theorem partialOrderCode_absolute (N : TransitiveGround.{u}) {Q R : ZFSet.{u}} - (hQM : Q ∈ M.sets) (hRM : R ∈ M.sets) (hQN : Q ∈ N.sets) (hRN : R ∈ N.sets) : - Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔ - Realize N.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) := - (M.realize_partialOrderCode hQM hRM).trans (N.realize_partialOrderCode hQN hRN).symm - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def orderedTripleFormula {n} (w x y z : Fin n) : BoundedFormula n := - exMem w (exMem 0 (.conj (orderedPairFormula 0 x.succ.succ y.succ.succ) - (orderedPairFormula w.succ.succ 0 z.succ.succ))) - -def tripleMembershipFormula {n} (x y z f : Fin n) : BoundedFormula n := - exMem f (orderedTripleFormula 0 x.succ y.succ z.succ) - -theorem truth_orderedTripleFormula {n} (w x y z : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (orderedTripleFormula w x y z) env ↔ - env w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) := by - simp only [orderedTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] - change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env x) (env y) ∧ - env w = ZFSet.pair b (env z)) ↔ _ - constructor - · rintro ⟨a, _, b, _, rfl, eq⟩ - exact eq - · intro eq - refine ⟨{ZFSet.pair (env x) (env y)}, ?_, ZFSet.pair (env x) (env y), - ZFSet.mem_singleton.2 rfl, rfl, eq⟩ - rw [eq] - exact ZFSet.mem_pair.2 (Or.inl rfl) - -theorem truth_tripleMembershipFormula {n} (x y z f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (tripleMembershipFormula x y z f) env ↔ - ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) ∈ env f := by - simp only [tripleMembershipFormula, truth_exMem, truth_orderedTripleFormula] - change (∃ w ∈ env f, w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z)) ↔ _ - exact ⟨fun ⟨_, hw, eq⟩ => eq ▸ hw, fun hw => ⟨_, hw, rfl⟩⟩ - -end PartitionPilot.Forcing.BoundedFormula - - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -theorem truth_relationBetweenFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (relationBetweenFormula a b f) env ↔ env f ⊆ ZFSet.prod (env a) (env b) := by - simp only [relationBetweenFormula, Truth, truth_exMem, truth_orderedPairFormula] - exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm)) - -theorem truth_functionFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (functionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) := by - simp only [functionFormula, Truth, truth_relationBetweenFormula, truth_exMem, - truth_pairMembershipFormula, truth_imp] - constructor - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro x hx - obtain ⟨y, _, pair, unique⟩ := total x hx - refine ⟨y, pair, ?_⟩ - intro z rel - exact unique z (ZFSet.pair_mem_prod.1 (shape rel)).2 rel - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro x hx - obtain ⟨y, rel, unique⟩ := total x hx - exact ⟨y, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun z _ hz => unique z hz⟩ - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_functionCode {A B f : ZFSet.{u}} - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hf : f ∈ M.sets) : - Realize M.sets (BoundedFormula.functionFormula 0 1 2).toFormula - (extend A (extend B (extend f Fin.elim0))) ↔ ZFSet.IsFunc A B f := - (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (Fin.cases hB (Fin.cases hf (fun i => Fin.elim0 i))))).trans - (BoundedFormula.truth_functionFormula 0 1 2 _) - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def nestedActionTripleFormula {n} (z g a b c d : Fin n) : BoundedFormula n := - let lift4 (j : Fin n) := j.succ.succ.succ.succ - let lift6 (j : Fin n) := j.succ.succ.succ.succ.succ.succ - exMem z (exMem 0 (exMem z.succ.succ (exMem 0 - (.conj (orderedPairFormula (lift4 z) 2 0) - (.conj (orderedPairFormula 0 (lift4 c) (lift4 d)) - (exMem 2 (exMem 0 (.conj (orderedPairFormula 4 (lift6 g) 0) - (orderedPairFormula 0 (lift6 a) (lift6 b)))))))))) - -theorem truth_nestedActionTripleFormula {n} (z g a b c d : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (nestedActionTripleFormula z g a b c d) env ↔ - env z = ZFSet.pair (ZFSet.pair (env g) (ZFSet.pair (env a) (env b))) - (ZFSet.pair (env c) (env d)) := by - simp only [nestedActionTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] - change (∃ s ∈ env z, ∃ x ∈ s, ∃ t ∈ env z, ∃ y ∈ t, - env z = ZFSet.pair x y ∧ y = ZFSet.pair (env c) (env d) ∧ - ∃ w ∈ x, ∃ v ∈ w, x = ZFSet.pair (env g) v ∧ v = ZFSet.pair (env a) (env b)) ↔ _ - constructor - · rintro ⟨_, _, x, _, _, _, y, _, outer, hy, _, _, v, _, hx, hv⟩ - rw [outer, hy, hx, hv] - · intro equal - let v := ZFSet.pair (env a) (env b) - let x := ZFSet.pair (env g) v - let y := ZFSet.pair (env c) (env d) - refine ⟨{x}, ?_, x, ZFSet.mem_singleton.2 rfl, {x, y}, ?_, y, - ZFSet.mem_pair.2 (Or.inr rfl), equal, rfl, {env g, v}, - ZFSet.mem_pair.2 (Or.inr rfl), v, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩ - · rw [equal] - exact ZFSet.mem_pair.2 (Or.inl rfl) - · rw [equal] - exact ZFSet.mem_pair.2 (Or.inr rfl) - - - - - - -def binaryRelationFormula {n} (g f : Fin n) : BoundedFormula n := - .allMem f (exMem g.succ (exMem g.succ.succ - (exMem g.succ.succ.succ (orderedTripleFormula 3 2 1 0)))) - -def binaryFunctionFormula {n} (g f : Fin n) : BoundedFormula n := - .conj (binaryRelationFormula g f) (.allMem g (.allMem g.succ - (exMem g.succ.succ (.conj (tripleMembershipFormula 2 1 0 f.succ.succ.succ) - (.allMem g.succ.succ.succ (imp - (tripleMembershipFormula 3 2 0 f.succ.succ.succ.succ) (.equal 0 1))))))) - -theorem truth_binaryRelationFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (binaryRelationFormula g f) env ↔ - env f ⊆ ZFSet.prod (ZFSet.prod (env g) (env g)) (env g) := by - simp only [binaryRelationFormula, Truth, truth_exMem, truth_orderedTripleFormula] - constructor - · intro h w hw - obtain ⟨x, hx, y, hy, z, hz, eq⟩ := h w hw - exact ZFSet.mem_prod.2 ⟨ZFSet.pair x y, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, z, hz, eq⟩ - · intro h w hw - obtain ⟨xy, hxy, z, hz, eq⟩ := ZFSet.mem_prod.1 (h hw) - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - exact ⟨x, hx, y, hy, z, hz, eq⟩ - -theorem truth_binaryFunctionFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (binaryFunctionFormula g f) env ↔ - ZFSet.IsFunc (ZFSet.prod (env g) (env g)) (env g) (env f) := by - simp only [binaryFunctionFormula, Truth, truth_binaryRelationFormula, truth_exMem, - truth_tripleMembershipFormula, truth_imp] - constructor - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro xy hxy - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - obtain ⟨z, _, rel, unique⟩ := total x hx y hy - refine ⟨z, rel, ?_⟩ - intro w hw - exact unique w (ZFSet.pair_mem_prod.1 (shape hw)).2 hw - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro x hx y hy - obtain ⟨z, rel, unique⟩ := total (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - exact ⟨z, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun w _ hw => unique w hw⟩ - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing - -universe u - -structure GroupCode (G m i e : ZFSet.{u}) : Prop where - mul_function : ZFSet.IsFunc (ZFSet.prod G G) G m - inv_function : ZFSet.IsFunc G G i - identity_mem : e ∈ G - one_mul : ∀ x ∈ G, ZFSet.pair (ZFSet.pair e x) x ∈ m - mul_one : ∀ x ∈ G, ZFSet.pair (ZFSet.pair x e) x ∈ m - inv_mul : ∀ x ∈ G, ∀ y ∈ G, ZFSet.pair x y ∈ i → ZFSet.pair (ZFSet.pair y x) e ∈ m - mul_assoc : ∀ x ∈ G, ∀ y ∈ G, ∀ z ∈ G, ∀ a ∈ G, ∀ b ∈ G, ∀ c ∈ G, - ZFSet.pair (ZFSet.pair x y) a ∈ m → ZFSet.pair (ZFSet.pair y z) b ∈ m → - ZFSet.pair (ZFSet.pair a z) c ∈ m → ZFSet.pair (ZFSet.pair x b) c ∈ m - -namespace BoundedFormula - -open SetFormula - -def groupIdentityFormula {n} (g m e : Fin n) : BoundedFormula n := - .allMem g (.conj (tripleMembershipFormula e.succ 0 0 m.succ) - (tripleMembershipFormula 0 e.succ 0 m.succ)) - -def groupInverseFormula {n} (g m i e : Fin n) : BoundedFormula n := - .allMem g (.allMem g.succ (imp (pairMembershipFormula 1 0 i.succ.succ) - (tripleMembershipFormula 0 1 e.succ.succ m.succ.succ))) - -def groupAssociativeFormula {n} (g m : Fin n) : BoundedFormula n := - .allMem g (.allMem g.succ (.allMem g.succ.succ (.allMem g.succ.succ.succ - (.allMem g.succ.succ.succ.succ (.allMem g.succ.succ.succ.succ.succ - (imp (.conj (tripleMembershipFormula 5 4 2 m.succ.succ.succ.succ.succ.succ) - (.conj (tripleMembershipFormula 4 3 1 m.succ.succ.succ.succ.succ.succ) - (tripleMembershipFormula 2 3 0 m.succ.succ.succ.succ.succ.succ))) - (tripleMembershipFormula 5 1 0 m.succ.succ.succ.succ.succ.succ))))))) - -def groupFormula {n} (g m i e : Fin n) : BoundedFormula n := - .conj (binaryFunctionFormula g m) (.conj (functionFormula g g i) - (.conj (.mem e g) (.conj (groupIdentityFormula g m e) - (.conj (groupInverseFormula g m i e) (groupAssociativeFormula g m))))) - -theorem truth_groupFormula {n} (g m i e : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (groupFormula g m i e) env ↔ GroupCode (env g) (env m) (env i) (env e) := by - simp only [groupFormula, Truth, truth_binaryFunctionFormula, truth_functionFormula, - groupIdentityFormula, groupInverseFormula, groupAssociativeFormula, - truth_tripleMembershipFormula, truth_pairMembershipFormula, truth_imp] - constructor - · rintro ⟨mul, inv, one, identity, inverse, assoc⟩ - exact ⟨mul, inv, one, fun x hx => (identity x hx).1, - fun x hx => (identity x hx).2, inverse, - 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⟩⟩ - · intro h - exact ⟨h.mul_function, h.inv_function, h.identity_mem, - fun x hx => ⟨h.one_mul x hx, h.mul_one x hx⟩, h.inv_mul, - 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⟩ - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_groupCode {G m i e : ZFSet.{u}} - (hG : G ∈ M.sets) (hm : m ∈ M.sets) (hi : i ∈ M.sets) (he : e ∈ M.sets) : - Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula - (extend G (extend m (extend i (extend e Fin.elim0)))) ↔ GroupCode G m i e := - (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hG (Fin.cases hm (Fin.cases hi (Fin.cases he (fun j => Fin.elim0 j)))))).trans - (BoundedFormula.truth_groupFormula 0 1 2 3 _) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.SetRealization.Presentation -open Forcing -universe u -variable {G : Type u} [Group G] (s : Presentation G) - -theorem groupCode : GroupCode s.carrier - ((s.product s).graph s (fun xy => xy.1 * xy.2)) - (s.graph s (fun x => x⁻¹)) (s.encode 1) := by - refine ⟨(s.product s).graph_isFunc s _, s.graph_isFunc s _, s.encode_mem 1, ?_, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - exact ((s.product s).pair_mem_graph s _ (1, a) a).2 (one_mul a) - · intro x hx - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - exact ((s.product s).pair_mem_graph s _ (a, 1) a).2 (mul_one a) - · intro x hx y hy entry - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy - have inverse := (s.pair_mem_graph s _ a b).1 entry - apply ((s.product s).pair_mem_graph s _ (b, a) 1).2 - rw [← inverse, inv_mul_cancel] - · intro x hx y hy z hz a ha b hb c hc xy yz az - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha - obtain ⟨b, rfl⟩ := (s.mem_carrier b).1 hb - obtain ⟨c, rfl⟩ := (s.mem_carrier c).1 hc - have first := ((s.product s).pair_mem_graph s _ (x, y) a).1 xy - have second := ((s.product s).pair_mem_graph s _ (y, z) b).1 yz - have third := ((s.product s).pair_mem_graph s _ (a, z) c).1 az - apply ((s.product s).pair_mem_graph s _ (x, b) c).2 - rw [← second, ← mul_assoc, first, third] - -end PartitionPilot.SetRealization.Presentation - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula +import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalRecursionTraces + +namespace OAI + + +namespace PartitionPilot.Forcing + +namespace BoundedFormula + +open SetFormula +universe u + +def Truth : {n : Nat} → BoundedFormula n → (Fin n → ZFSet.{u}) → Prop + | _, .equal i j, env => env i = env j + | _, .mem i j, env => env i ∈ env j + | _, .neg φ, env => ¬ Truth φ env + | _, .conj φ ψ, env => Truth φ env ∧ Truth ψ env + | _, .allMem b φ, env => ∀ x ∈ env b, Truth φ (extend x env) + +theorem truth_imp {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) : + Truth (imp φ ψ) env ↔ (Truth φ env → Truth ψ env) := by + classical + simp only [imp, Truth, not_and, not_not] + +theorem truth_disj {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) : + Truth (disj φ ψ) env ↔ (Truth φ env ∨ Truth ψ env) := by + classical + simp only [disj, Truth, not_and_or, not_not] + +theorem truth_exMem {n} (b : Fin n) (φ : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) : + Truth (exMem b φ) env ↔ ∃ x ∈ env b, Truth φ (extend x env) := by + classical + simp only [exMem, Truth, not_forall, not_not, exists_prop] + +theorem realize_toFormula (M : TransitiveGround.{u}) {n} (φ : BoundedFormula n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets φ.toFormula env ↔ Truth φ env := by + induction φ with + | equal i j => rfl + | mem i j => rfl + | neg φ ih => exact not_congr (ih env members) + | conj φ ψ ihφ ihψ => exact and_congr (ihφ env members) (ihψ env members) + | allMem b φ ih => + change (∀ x ∈ M.sets, Realize M.sets (SetFormula.imp (.mem 0 b.succ) φ.toFormula) (extend x env)) ↔ _ + constructor + · intro h x hx + have hxM := M.transitive (members b) hx + exact (ih (extend x env) (Fin.cases hxM members)).1 + ((realize_imp M.sets _ _ _).1 (h x hxM) hx) + · intro h x hxM + apply (realize_imp M.sets _ _ _).2 + intro hx + exact (ih (extend x env) (Fin.cases hxM members)).2 (h x hx) + +theorem absolute (M N : TransitiveGround.{u}) {n} (φ : BoundedFormula n) + (env : Fin n → ZFSet.{u}) (inM : ∀ i, env i ∈ M.sets) (inN : ∀ i, env i ∈ N.sets) : + Realize M.sets φ.toFormula env ↔ Realize N.sets φ.toFormula env := + (realize_toFormula M φ env inM).trans (realize_toFormula N φ env inN).symm + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def emptyFormula {n} (x : Fin n) : BoundedFormula n := + .allMem x (.neg (.equal 0 0)) + +def successorFormula {n} (y x : Fin n) : BoundedFormula n := + .conj (.mem x y) (.conj (.allMem x (.mem 0 y.succ)) + (.allMem y (disj (.equal 0 x.succ) (.mem 0 x.succ)))) + +def setTransitiveFormula {n} (x : Fin n) : BoundedFormula n := + .allMem x (.allMem 0 (.mem 0 x.succ.succ)) + +def zeroOrSuccessorFormula {n} (x : Fin n) : BoundedFormula n := + disj (emptyFormula x) (exMem x (successorFormula x.succ 0)) + +def naturalFormula {n} (x : Fin n) : BoundedFormula n := + .conj (setTransitiveFormula x) (.conj (zeroOrSuccessorFormula x) + (.allMem x (.conj (setTransitiveFormula 0) (zeroOrSuccessorFormula 0)))) + +theorem truth_emptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (emptyFormula x) env ↔ env x = ∅ := by + change (∀ y ∈ env x, ¬ y = y) ↔ _ + constructor + · intro h + exact (ZFSet.eq_empty _).2 (fun y hy => h y hy rfl) + · intro h y hy + exact False.elim ((ZFSet.eq_empty _).1 h y hy) + +theorem truth_successorFormula {n} (y x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (successorFormula y x) env ↔ env y = insert (env x) (env x) := by + simp only [successorFormula, Truth, truth_disj] + change (env x ∈ env y ∧ (∀ z ∈ env x, z ∈ env y) ∧ + ∀ z ∈ env y, z = env x ∨ z ∈ env x) ↔ _ + constructor + · rintro ⟨hx, lower, upper⟩ + apply ZFSet.ext + intro z + rw [ZFSet.mem_insert_iff] + exact ⟨upper z, fun h => h.elim (fun eq => eq.symm ▸ hx) (lower z)⟩ + · intro eq + rw [eq] + exact ⟨ZFSet.mem_insert _ _, fun _ hz => ZFSet.mem_insert_of_mem _ hz, + fun _ hz => ZFSet.mem_insert_iff.1 hz⟩ + +theorem truth_setTransitiveFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (setTransitiveFormula x) env ↔ setTransitive (env x) := Iff.rfl + +theorem truth_zeroOrSuccessorFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (zeroOrSuccessorFormula x) env ↔ zeroOrSuccessor (env x) := by + simp only [zeroOrSuccessorFormula, truth_disj, truth_emptyFormula, truth_exMem, + truth_successorFormula] + rfl + +theorem truth_naturalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (naturalFormula x) env ↔ env x ∈ ZFSet.omega := by + simp only [naturalFormula, Truth, truth_setTransitiveFormula, truth_zeroOrSuccessorFormula] + exact naturalSetProperty_iff_mem_omega (env x) + +theorem realize_naturalFormula (M : TransitiveGround.{u}) {n} + (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (naturalFormula x).toFormula env ↔ env x ∈ ZFSet.omega := + (realize_toFormula M _ env members).trans (truth_naturalFormula x env) + + + + + + +theorem truth_singletonFormula {n} (z x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (singletonFormula z x) env ↔ env z = {env x} := by + change (env x ∈ env z ∧ ∀ w ∈ env z, w = env x) ↔ _ + constructor + · rintro ⟨member, only⟩ + apply ZFSet.ext + intro w + rw [ZFSet.mem_singleton] + exact ⟨only w, fun eq => eq.symm ▸ member⟩ + · intro eq + rw [eq] + exact ⟨ZFSet.mem_singleton.2 rfl, fun _ h => ZFSet.mem_singleton.1 h⟩ + +theorem truth_unorderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (unorderedPairFormula z x y) env ↔ env z = {env x, env y} := by + simp only [unorderedPairFormula, Truth, truth_disj] + change (env x ∈ env z ∧ env y ∈ env z ∧ ∀ w ∈ env z, w = env x ∨ w = env y) ↔ _ + constructor + · rintro ⟨hx, hy, only⟩ + apply ZFSet.ext + intro w + rw [ZFSet.mem_pair] + refine ⟨only w, ?_⟩ + rintro (rfl | rfl) + · exact hx + · exact hy + · intro eq + rw [eq] + exact ⟨ZFSet.mem_pair.2 (Or.inl rfl), ZFSet.mem_pair.2 (Or.inr rfl), fun _ h => ZFSet.mem_pair.1 h⟩ + +theorem truth_orderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (orderedPairFormula z x y) env ↔ env z = ZFSet.pair (env x) (env y) := by + rw [orderedPairFormula, truth_exMem] + constructor + · rintro ⟨a, _, first, rest⟩ + have ha := (truth_singletonFormula 0 x.succ (extend a env)).1 first + obtain ⟨b, _, second, shape⟩ := (truth_exMem _ _ _).1 rest + have hb := (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ (extend b (extend a env))).1 second + have hz := (truth_unorderedPairFormula z.succ.succ 1 0 (extend b (extend a env))).1 shape + change a = {env x} at ha + change b = {env x, env y} at hb + change env z = {a, b} at hz + rw [hz, ha, hb] + rfl + · intro eq + have ha : ({env x} : ZFSet.{u}) ∈ env z := by + rw [eq] + exact ZFSet.mem_pair.2 (Or.inl rfl) + refine ⟨{env x}, ha, (truth_singletonFormula 0 x.succ _).2 rfl, ?_⟩ + apply (truth_exMem _ _ _).2 + have hb : ({env x, env y} : ZFSet.{u}) ∈ env z := by + rw [eq] + exact ZFSet.mem_pair.2 (Or.inr rfl) + exact ⟨{env x, env y}, hb, (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ _).2 rfl, + (truth_unorderedPairFormula z.succ.succ 1 0 _).2 eq⟩ + +theorem truth_pairMembershipFormula {n} (x y r : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (pairMembershipFormula x y r) env ↔ ZFSet.pair (env x) (env y) ∈ env r := by + rw [pairMembershipFormula, truth_exMem] + constructor + · rintro ⟨z, hz, shape⟩ + have eq := (truth_orderedPairFormula 0 x.succ y.succ (extend z env)).1 shape + exact eq ▸ hz + · intro member + exact ⟨ZFSet.pair (env x) (env y), member, (truth_orderedPairFormula 0 x.succ y.succ _).2 rfl⟩ + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing + +universe u + +namespace SetFormula + +def exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1)) : SetFormula n := + .all (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ))) + +end SetFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1)) + (env : Fin n → ZFSet.{u}) {target : ZFSet.{u}} + (hOutput : env output ∈ M.sets) (elements : ∀ z ∈ target, z ∈ M.sets) + (meaning : ∀ z ∈ M.sets, Realize M.sets entry (extend z env) ↔ z ∈ target) : + Realize M.sets (exactSetFormula output entry) env ↔ env output = target := by + change (∀ z ∈ M.sets, Realize M.sets + (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ))) (extend z env)) ↔ _ + simp only [Realize, realize_imp] + change (∀ z ∈ M.sets, (z ∈ env output → Realize M.sets entry (extend z env)) ∧ + (Realize M.sets entry (extend z env) → z ∈ env output)) ↔ _ + constructor + · intro correct + apply ZFSet.ext + intro z + constructor + · intro member + have hz := M.transitive hOutput member + exact (meaning z hz).1 ((correct z hz).1 member) + · intro member + have hz := elements z member + exact (correct z hz).2 ((meaning z hz).2 member) + · intro equal z hz + exact ⟨fun member => (meaning z hz).2 (equal ▸ member), + fun predicate => equal.symm ▸ (meaning z hz).1 predicate⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula SetRealization +universe u + +def ordinalFormula {n} (x : Fin n) : BoundedFormula n := + .conj (setTransitiveFormula x) (.allMem x (setTransitiveFormula 0)) + +theorem truth_ordinalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (ordinalFormula x) env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o := by + simp only [ordinalFormula, Truth, truth_setTransitiveFormula] + exact ordinalSetProperty_iff (env x) + +theorem realize_ordinalFormula (M : TransitiveGround.{u}) {n} + (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (ordinalFormula x).toFormula env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o := + (realize_toFormula M _ env members).trans (truth_ordinalFormula x env) + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def graphFiberInclusionFormula {n} (x y f g : Fin n) : BoundedFormula n := + .allMem f (.allMem 0 (.allMem 0 + (imp (orderedPairFormula 2 x.succ.succ.succ 0) + (pairMembershipFormula y.succ.succ.succ 0 g.succ.succ.succ)))) + +theorem truth_graphFiberInclusionFormula {n} (x y f g : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (graphFiberInclusionFormula x y f g) env ↔ + ∀ z, ZFSet.pair (env x) z ∈ env f → ZFSet.pair (env y) z ∈ env g := by + simp only [graphFiberInclusionFormula, Truth, truth_imp, + truth_orderedPairFormula, truth_pairMembershipFormula] + change (∀ p ∈ env f, ∀ a ∈ p, ∀ z ∈ a, + p = ZFSet.pair (env x) z → ZFSet.pair (env y) z ∈ env g) ↔ _ + constructor + · intro h z entry + exact h (ZFSet.pair (env x) z) entry {env x, z} + (ZFSet.mem_pair.2 (Or.inr rfl)) z (ZFSet.mem_pair.2 (Or.inr rfl)) rfl + · intro h p hp a _ z _ equal + exact h z (equal ▸ hp) + +def graphFiberEqualityFormula {n} (x y f g : Fin n) : BoundedFormula n := + .conj (graphFiberInclusionFormula x y f g) (graphFiberInclusionFormula y x g f) + +theorem truth_graphFiberEqualityFormula {n} (x y f g : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (graphFiberEqualityFormula x y f g) env ↔ + ∀ z, ZFSet.pair (env x) z ∈ env f ↔ ZFSet.pair (env y) z ∈ env g := by + simp only [graphFiberEqualityFormula, Truth, truth_graphFiberInclusionFormula] + exact ⟨fun h z => ⟨h.1 z, h.2 z⟩, fun h => ⟨fun z => (h z).1, fun z => (h z).2⟩⟩ + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing + +universe u + +structure PartialOrderCode (Q R : ZFSet.{u}) : Prop where + relation : R ⊆ ZFSet.prod Q Q + refl : ∀ x ∈ Q, ZFSet.pair x x ∈ R + antisymm : ∀ x ∈ Q, ∀ y ∈ Q, ZFSet.pair x y ∈ R → ZFSet.pair y x ∈ R → x = y + trans : ∀ x ∈ Q, ∀ y ∈ Q, ∀ z ∈ Q, + ZFSet.pair x y ∈ R → ZFSet.pair y z ∈ R → ZFSet.pair x z ∈ R + +namespace BoundedFormula + +open SetFormula + +def relationOnFormula {n} (c r : Fin n) : BoundedFormula n := + .allMem r (exMem c.succ (exMem c.succ.succ (orderedPairFormula 2 1 0))) + +def reflexiveFormula {n} (c r : Fin n) : BoundedFormula n := + .allMem c (pairMembershipFormula 0 0 r.succ) + +def antisymmetricFormula {n} (c r : Fin n) : BoundedFormula n := + .allMem c (.allMem c.succ (imp + (.conj (pairMembershipFormula 1 0 r.succ.succ) (pairMembershipFormula 0 1 r.succ.succ)) (.equal 1 0))) + +def transitiveFormula {n} (c r : Fin n) : BoundedFormula n := + .allMem c (.allMem c.succ (.allMem c.succ.succ (imp + (.conj (pairMembershipFormula 2 1 r.succ.succ.succ) (pairMembershipFormula 1 0 r.succ.succ.succ)) + (pairMembershipFormula 2 0 r.succ.succ.succ)))) + +def partialOrderFormula {n} (c r : Fin n) : BoundedFormula n := + .conj (relationOnFormula c r) (.conj (reflexiveFormula c r) + (.conj (antisymmetricFormula c r) (transitiveFormula c r))) + +def topFormula {n} (c r t : Fin n) : BoundedFormula n := + .conj (.mem t c) (.allMem c (pairMembershipFormula 0 t.succ r.succ)) + +theorem truth_relationOnFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (relationOnFormula c r) env ↔ env r ⊆ ZFSet.prod (env c) (env c) := by + simp only [relationOnFormula, Truth, truth_exMem, truth_orderedPairFormula] + exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm)) + +theorem truth_partialOrderFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (partialOrderFormula c r) env ↔ PartialOrderCode (env c) (env r) := by + simp only [partialOrderFormula, Truth, truth_relationOnFormula, reflexiveFormula, + antisymmetricFormula, transitiveFormula, truth_imp, truth_pairMembershipFormula] + constructor + · rintro ⟨shape, refl, antisymm, trans⟩ + exact ⟨shape, refl, fun x hx y hy xy yx => antisymm x hx y hy ⟨xy, yx⟩, + fun x hx y hy z hz xy yz => trans x hx y hy z hz ⟨xy, yz⟩⟩ + · intro h + exact ⟨h.relation, h.refl, fun x hx y hy ⟨xy, yx⟩ => h.antisymm x hx y hy xy yx, + fun x hx y hy z hz ⟨xy, yz⟩ => h.trans x hx y hy z hz xy yz⟩ + +theorem truth_topFormula {n} (c r t : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (topFormula c r t) env ↔ env t ∈ env c ∧ ∀ x ∈ env c, ZFSet.pair x (env t) ∈ env r := by + simp only [topFormula, Truth, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_partialOrderCode {Q R : ZFSet.{u}} (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) : + Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔ + PartialOrderCode Q R := + (BoundedFormula.realize_toFormula M _ _ (Fin.cases hQ (Fin.cases hR (fun i => Fin.elim0 i)))).trans + (BoundedFormula.truth_partialOrderFormula 0 1 _) + +theorem partialOrderCode_absolute (N : TransitiveGround.{u}) {Q R : ZFSet.{u}} + (hQM : Q ∈ M.sets) (hRM : R ∈ M.sets) (hQN : Q ∈ N.sets) (hRN : R ∈ N.sets) : + Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔ + Realize N.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) := + (M.realize_partialOrderCode hQM hRM).trans (N.realize_partialOrderCode hQN hRN).symm + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def orderedTripleFormula {n} (w x y z : Fin n) : BoundedFormula n := + exMem w (exMem 0 (.conj (orderedPairFormula 0 x.succ.succ y.succ.succ) + (orderedPairFormula w.succ.succ 0 z.succ.succ))) + +def tripleMembershipFormula {n} (x y z f : Fin n) : BoundedFormula n := + exMem f (orderedTripleFormula 0 x.succ y.succ z.succ) + +theorem truth_orderedTripleFormula {n} (w x y z : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (orderedTripleFormula w x y z) env ↔ + env w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) := by + simp only [orderedTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] + change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env x) (env y) ∧ + env w = ZFSet.pair b (env z)) ↔ _ + constructor + · rintro ⟨a, _, b, _, rfl, eq⟩ + exact eq + · intro eq + refine ⟨{ZFSet.pair (env x) (env y)}, ?_, ZFSet.pair (env x) (env y), + ZFSet.mem_singleton.2 rfl, rfl, eq⟩ + rw [eq] + exact ZFSet.mem_pair.2 (Or.inl rfl) + +theorem truth_tripleMembershipFormula {n} (x y z f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (tripleMembershipFormula x y z f) env ↔ + ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) ∈ env f := by + simp only [tripleMembershipFormula, truth_exMem, truth_orderedTripleFormula] + change (∃ w ∈ env f, w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z)) ↔ _ + exact ⟨fun ⟨_, hw, eq⟩ => eq ▸ hw, fun hw => ⟨_, hw, rfl⟩⟩ + +end PartitionPilot.Forcing.BoundedFormula + + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +theorem truth_relationBetweenFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (relationBetweenFormula a b f) env ↔ env f ⊆ ZFSet.prod (env a) (env b) := by + simp only [relationBetweenFormula, Truth, truth_exMem, truth_orderedPairFormula] + exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm)) + +theorem truth_functionFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (functionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) := by + simp only [functionFormula, Truth, truth_relationBetweenFormula, truth_exMem, + truth_pairMembershipFormula, truth_imp] + constructor + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro x hx + obtain ⟨y, _, pair, unique⟩ := total x hx + refine ⟨y, pair, ?_⟩ + intro z rel + exact unique z (ZFSet.pair_mem_prod.1 (shape rel)).2 rel + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro x hx + obtain ⟨y, rel, unique⟩ := total x hx + exact ⟨y, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun z _ hz => unique z hz⟩ + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_functionCode {A B f : ZFSet.{u}} + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hf : f ∈ M.sets) : + Realize M.sets (BoundedFormula.functionFormula 0 1 2).toFormula + (extend A (extend B (extend f Fin.elim0))) ↔ ZFSet.IsFunc A B f := + (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (Fin.cases hB (Fin.cases hf (fun i => Fin.elim0 i))))).trans + (BoundedFormula.truth_functionFormula 0 1 2 _) + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def nestedActionTripleFormula {n} (z g a b c d : Fin n) : BoundedFormula n := + let lift4 (j : Fin n) := j.succ.succ.succ.succ + let lift6 (j : Fin n) := j.succ.succ.succ.succ.succ.succ + exMem z (exMem 0 (exMem z.succ.succ (exMem 0 + (.conj (orderedPairFormula (lift4 z) 2 0) + (.conj (orderedPairFormula 0 (lift4 c) (lift4 d)) + (exMem 2 (exMem 0 (.conj (orderedPairFormula 4 (lift6 g) 0) + (orderedPairFormula 0 (lift6 a) (lift6 b)))))))))) + +theorem truth_nestedActionTripleFormula {n} (z g a b c d : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (nestedActionTripleFormula z g a b c d) env ↔ + env z = ZFSet.pair (ZFSet.pair (env g) (ZFSet.pair (env a) (env b))) + (ZFSet.pair (env c) (env d)) := by + simp only [nestedActionTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] + change (∃ s ∈ env z, ∃ x ∈ s, ∃ t ∈ env z, ∃ y ∈ t, + env z = ZFSet.pair x y ∧ y = ZFSet.pair (env c) (env d) ∧ + ∃ w ∈ x, ∃ v ∈ w, x = ZFSet.pair (env g) v ∧ v = ZFSet.pair (env a) (env b)) ↔ _ + constructor + · rintro ⟨_, _, x, _, _, _, y, _, outer, hy, _, _, v, _, hx, hv⟩ + rw [outer, hy, hx, hv] + · intro equal + let v := ZFSet.pair (env a) (env b) + let x := ZFSet.pair (env g) v + let y := ZFSet.pair (env c) (env d) + refine ⟨{x}, ?_, x, ZFSet.mem_singleton.2 rfl, {x, y}, ?_, y, + ZFSet.mem_pair.2 (Or.inr rfl), equal, rfl, {env g, v}, + ZFSet.mem_pair.2 (Or.inr rfl), v, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩ + · rw [equal] + exact ZFSet.mem_pair.2 (Or.inl rfl) + · rw [equal] + exact ZFSet.mem_pair.2 (Or.inr rfl) + + + + + + +def binaryRelationFormula {n} (g f : Fin n) : BoundedFormula n := + .allMem f (exMem g.succ (exMem g.succ.succ + (exMem g.succ.succ.succ (orderedTripleFormula 3 2 1 0)))) + +def binaryFunctionFormula {n} (g f : Fin n) : BoundedFormula n := + .conj (binaryRelationFormula g f) (.allMem g (.allMem g.succ + (exMem g.succ.succ (.conj (tripleMembershipFormula 2 1 0 f.succ.succ.succ) + (.allMem g.succ.succ.succ (imp + (tripleMembershipFormula 3 2 0 f.succ.succ.succ.succ) (.equal 0 1))))))) + +theorem truth_binaryRelationFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (binaryRelationFormula g f) env ↔ + env f ⊆ ZFSet.prod (ZFSet.prod (env g) (env g)) (env g) := by + simp only [binaryRelationFormula, Truth, truth_exMem, truth_orderedTripleFormula] + constructor + · intro h w hw + obtain ⟨x, hx, y, hy, z, hz, eq⟩ := h w hw + exact ZFSet.mem_prod.2 ⟨ZFSet.pair x y, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, z, hz, eq⟩ + · intro h w hw + obtain ⟨xy, hxy, z, hz, eq⟩ := ZFSet.mem_prod.1 (h hw) + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + exact ⟨x, hx, y, hy, z, hz, eq⟩ + +theorem truth_binaryFunctionFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (binaryFunctionFormula g f) env ↔ + ZFSet.IsFunc (ZFSet.prod (env g) (env g)) (env g) (env f) := by + simp only [binaryFunctionFormula, Truth, truth_binaryRelationFormula, truth_exMem, + truth_tripleMembershipFormula, truth_imp] + constructor + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro xy hxy + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + obtain ⟨z, _, rel, unique⟩ := total x hx y hy + refine ⟨z, rel, ?_⟩ + intro w hw + exact unique w (ZFSet.pair_mem_prod.1 (shape hw)).2 hw + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro x hx y hy + obtain ⟨z, rel, unique⟩ := total (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + exact ⟨z, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun w _ hw => unique w hw⟩ + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing + +universe u + +structure GroupCode (G m i e : ZFSet.{u}) : Prop where + mul_function : ZFSet.IsFunc (ZFSet.prod G G) G m + inv_function : ZFSet.IsFunc G G i + identity_mem : e ∈ G + one_mul : ∀ x ∈ G, ZFSet.pair (ZFSet.pair e x) x ∈ m + mul_one : ∀ x ∈ G, ZFSet.pair (ZFSet.pair x e) x ∈ m + inv_mul : ∀ x ∈ G, ∀ y ∈ G, ZFSet.pair x y ∈ i → ZFSet.pair (ZFSet.pair y x) e ∈ m + mul_assoc : ∀ x ∈ G, ∀ y ∈ G, ∀ z ∈ G, ∀ a ∈ G, ∀ b ∈ G, ∀ c ∈ G, + ZFSet.pair (ZFSet.pair x y) a ∈ m → ZFSet.pair (ZFSet.pair y z) b ∈ m → + ZFSet.pair (ZFSet.pair a z) c ∈ m → ZFSet.pair (ZFSet.pair x b) c ∈ m + +namespace BoundedFormula + +open SetFormula + +def groupIdentityFormula {n} (g m e : Fin n) : BoundedFormula n := + .allMem g (.conj (tripleMembershipFormula e.succ 0 0 m.succ) + (tripleMembershipFormula 0 e.succ 0 m.succ)) + +def groupInverseFormula {n} (g m i e : Fin n) : BoundedFormula n := + .allMem g (.allMem g.succ (imp (pairMembershipFormula 1 0 i.succ.succ) + (tripleMembershipFormula 0 1 e.succ.succ m.succ.succ))) + +def groupAssociativeFormula {n} (g m : Fin n) : BoundedFormula n := + .allMem g (.allMem g.succ (.allMem g.succ.succ (.allMem g.succ.succ.succ + (.allMem g.succ.succ.succ.succ (.allMem g.succ.succ.succ.succ.succ + (imp (.conj (tripleMembershipFormula 5 4 2 m.succ.succ.succ.succ.succ.succ) + (.conj (tripleMembershipFormula 4 3 1 m.succ.succ.succ.succ.succ.succ) + (tripleMembershipFormula 2 3 0 m.succ.succ.succ.succ.succ.succ))) + (tripleMembershipFormula 5 1 0 m.succ.succ.succ.succ.succ.succ))))))) + +def groupFormula {n} (g m i e : Fin n) : BoundedFormula n := + .conj (binaryFunctionFormula g m) (.conj (functionFormula g g i) + (.conj (.mem e g) (.conj (groupIdentityFormula g m e) + (.conj (groupInverseFormula g m i e) (groupAssociativeFormula g m))))) + +theorem truth_groupFormula {n} (g m i e : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (groupFormula g m i e) env ↔ GroupCode (env g) (env m) (env i) (env e) := by + simp only [groupFormula, Truth, truth_binaryFunctionFormula, truth_functionFormula, + groupIdentityFormula, groupInverseFormula, groupAssociativeFormula, + truth_tripleMembershipFormula, truth_pairMembershipFormula, truth_imp] + constructor + · rintro ⟨mul, inv, one, identity, inverse, assoc⟩ + exact ⟨mul, inv, one, fun x hx => (identity x hx).1, + fun x hx => (identity x hx).2, inverse, + 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⟩⟩ + · intro h + exact ⟨h.mul_function, h.inv_function, h.identity_mem, + fun x hx => ⟨h.one_mul x hx, h.mul_one x hx⟩, h.inv_mul, + 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⟩ + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_groupCode {G m i e : ZFSet.{u}} + (hG : G ∈ M.sets) (hm : m ∈ M.sets) (hi : i ∈ M.sets) (he : e ∈ M.sets) : + Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula + (extend G (extend m (extend i (extend e Fin.elim0)))) ↔ GroupCode G m i e := + (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hG (Fin.cases hm (Fin.cases hi (Fin.cases he (fun j => Fin.elim0 j)))))).trans + (BoundedFormula.truth_groupFormula 0 1 2 3 _) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.SetRealization.Presentation +open Forcing +universe u +variable {G : Type u} [Group G] (s : Presentation G) + +theorem groupCode : GroupCode s.carrier + ((s.product s).graph s (fun xy => xy.1 * xy.2)) + (s.graph s (fun x => x⁻¹)) (s.encode 1) := by + refine ⟨(s.product s).graph_isFunc s _, s.graph_isFunc s _, s.encode_mem 1, ?_, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + exact ((s.product s).pair_mem_graph s _ (1, a) a).2 (one_mul a) + · intro x hx + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + exact ((s.product s).pair_mem_graph s _ (a, 1) a).2 (mul_one a) + · intro x hx y hy entry + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy + have inverse := (s.pair_mem_graph s _ a b).1 entry + apply ((s.product s).pair_mem_graph s _ (b, a) 1).2 + rw [← inverse, inv_mul_cancel] + · intro x hx y hy z hz a ha b hb c hc xy yz az + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha + obtain ⟨b, rfl⟩ := (s.mem_carrier b).1 hb + obtain ⟨c, rfl⟩ := (s.mem_carrier c).1 hc + have first := ((s.product s).pair_mem_graph s _ (x, y) a).1 xy + have second := ((s.product s).pair_mem_graph s _ (y, z) b).1 yz + have third := ((s.product s).pair_mem_graph s _ (a, z) c).1 az + apply ((s.product s).pair_mem_graph s _ (x, b) c).2 + rw [← second, ← mul_assoc, first, third] + +end PartitionPilot.SetRealization.Presentation + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedRowAssignmentGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedRowAssignmentGraphs.lean index 2baa2fb38b1a21c6e6cbd2a09ff2f6c78c6444e5..24acbf24bf01e10e2760eaf00c9f905628f941d9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedRowAssignmentGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedRowAssignmentGraphs.lean @@ -1,70 +1,70 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {G R : Type u} [Group G] [PartialOrder R] -variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) -variable (Q J B : ZFSet.{u}) - -theorem presentedRowAssignmentGraph_entry (g : G) (r q : R) (A D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) (ZFSet.pair (c.encode q) D) ∈ - rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ↔ - ZFSet.pair (c.encode r) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ - a.iso g r = q ∧ D = relationImage A J (rawActionSection (t.encode g) B J) := by - rw [pair_mem_rawRowAssignmentActionGraph] - constructor - · rintro ⟨_, first, second, _, _, _, _, row, image⟩ - exact ⟨first, second, (a.triple_mem_actionGraph c t g r q).1 row, image⟩ - · rintro ⟨first, second, row, image⟩ - exact ⟨t.encode_mem g, first, second, c.encode_mem r, pair_second_mem_doubleUnion first, - c.encode_mem q, pair_second_mem_doubleUnion second, - (a.triple_mem_actionGraph c t g r q).2 row, image⟩ - -theorem presentedRowAssignmentGraph_bound : - rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ⊆ - ZFSet.prod (ZFSet.prod t.carrier Q) Q := by - intro z hz - unfold rawRowAssignmentActionGraph rowAssignmentActionGraph at hz - exact (ZFSet.mem_sep.1 hz).1 - -omit [PartialOrder R] in -theorem exists_presentedRowAssignmentCoordinates - {Q V z : ZFSet.{u}} (shape : Q ⊆ ZFSet.prod c.carrier V) (member : z ∈ Q) : - ∃ r : R, ∃ A ∈ V, z = ZFSet.pair (c.encode r) A := by - obtain ⟨r, hr, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape member) - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact ⟨r, A, hA, rfl⟩ - -theorem presentedRowAssignmentGraph_function {V : ZFSet.{u}} - (shape : Q ⊆ ZFSet.prod c.carrier V) - (preserves : ∀ g : G, ∀ r : R, ∀ A, - ZFSet.pair (c.encode r) A ∈ Q → - ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) : - ZFSet.IsFunc (ZFSet.prod t.carrier Q) Q - (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by - refine ⟨presentedRowAssignmentGraph_bound a c t Q J B, ?_⟩ - intro z hz - obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨r, A, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp - refine ⟨ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)), - (presentedRowAssignmentGraph_entry a c t Q J B g r _ A _).2 - ⟨hp, preserves g r A hp, rfl, rfl⟩, ?_⟩ - intro y edge - have hy := (ZFSet.pair_mem_prod.1 (presentedRowAssignmentGraph_bound a c t Q J B edge)).2 - obtain ⟨q, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hy - obtain ⟨_, _, row, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge - rw [row] - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {G R : Type u} [Group G] [PartialOrder R] +variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) +variable (Q J B : ZFSet.{u}) + +theorem presentedRowAssignmentGraph_entry (g : G) (r q : R) (A D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) (ZFSet.pair (c.encode q) D) ∈ + rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ↔ + ZFSet.pair (c.encode r) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ + a.iso g r = q ∧ D = relationImage A J (rawActionSection (t.encode g) B J) := by + rw [pair_mem_rawRowAssignmentActionGraph] + constructor + · rintro ⟨_, first, second, _, _, _, _, row, image⟩ + exact ⟨first, second, (a.triple_mem_actionGraph c t g r q).1 row, image⟩ + · rintro ⟨first, second, row, image⟩ + exact ⟨t.encode_mem g, first, second, c.encode_mem r, pair_second_mem_doubleUnion first, + c.encode_mem q, pair_second_mem_doubleUnion second, + (a.triple_mem_actionGraph c t g r q).2 row, image⟩ + +theorem presentedRowAssignmentGraph_bound : + rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ⊆ + ZFSet.prod (ZFSet.prod t.carrier Q) Q := by + intro z hz + unfold rawRowAssignmentActionGraph rowAssignmentActionGraph at hz + exact (ZFSet.mem_sep.1 hz).1 + +omit [PartialOrder R] in +theorem exists_presentedRowAssignmentCoordinates + {Q V z : ZFSet.{u}} (shape : Q ⊆ ZFSet.prod c.carrier V) (member : z ∈ Q) : + ∃ r : R, ∃ A ∈ V, z = ZFSet.pair (c.encode r) A := by + obtain ⟨r, hr, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape member) + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact ⟨r, A, hA, rfl⟩ + +theorem presentedRowAssignmentGraph_function {V : ZFSet.{u}} + (shape : Q ⊆ ZFSet.prod c.carrier V) + (preserves : ∀ g : G, ∀ r : R, ∀ A, + ZFSet.pair (c.encode r) A ∈ Q → + ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) : + ZFSet.IsFunc (ZFSet.prod t.carrier Q) Q + (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by + refine ⟨presentedRowAssignmentGraph_bound a c t Q J B, ?_⟩ + intro z hz + obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨r, A, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp + refine ⟨ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)), + (presentedRowAssignmentGraph_entry a c t Q J B g r _ A _).2 + ⟨hp, preserves g r A hp, rfl, rfl⟩, ?_⟩ + intro y edge + have hy := (ZFSet.pair_mem_prod.1 (presentedRowAssignmentGraph_bound a c t Q J B edge)).2 + obtain ⟨q, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hy + obtain ⟨_, _, row, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge + rw [row] + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreservedMainPrefixHistoryFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreservedMainPrefixHistoryFormulas.lean index e34ee158876d41f78097ee9e165b4a933f48f1d5..92344bde510793261a8b1a8b0e5fba86a4e6f245 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreservedMainPrefixHistoryFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PreservedMainPrefixHistoryFormulas.lean @@ -1,428 +1,428 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalStepCodes -import OAI.SetTheory.PartitionPrinciple.Transfinite.PreservedMainPrefixHistoryValues - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace BoundedFormula -open SetFormula -universe u - -def nonzeroLimitOrdinalFormula {n} (T : Fin n) : BoundedFormula n := - .conj (.neg (emptyFormula T)) (.allMem T (exMem T.succ (.mem 1 0))) - -theorem truth_nonzeroLimitOrdinalFormula {n} (T : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (nonzeroLimitOrdinalFormula T) env ↔ NonzeroLimitOrdinalCode (env T) := by - simp only [nonzeroLimitOrdinalFormula, Truth, truth_emptyFormula, truth_exMem] - rfl - -theorem realize_nonzeroLimitOrdinalFormula (M : TransitiveGround.{u}) {n} - (T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (nonzeroLimitOrdinalFormula T).toFormula env ↔ - NonzeroLimitOrdinalCode (env T) := - (realize_toFormula M _ env members).trans (truth_nonzeroLimitOrdinalFormula T env) - -end BoundedFormula - -open SetFormula -universe u - -namespace BoundedFormula -def mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n) : BoundedFormula n := - .conj (subsetFormula T T') (.conj (subsetFormula S S') (subsetFormula E E')) - -theorem truth_mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (mainPrefixFieldExtensionFormula T S E T' S' E') env ↔ - env T ⊆ env T' ∧ env S ⊆ env S' ∧ env E ⊆ env E' := by - simp only [mainPrefixFieldExtensionFormula, Truth, truth_subsetFormula] - -end BoundedFormula - -namespace SetFormula -def mainPrefixExtensionFormula {n} (old next : Fin n) : SetFormula n := - let outer := suffixIndex n 6 - let field := prefixIndex n 6 - exBlock 6 (.conj - (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula - (.conj (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula - (BoundedFormula.mainPrefixFieldExtensionFormula - (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixExtensionFormula {n} (old next : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixExtensionFormula old next) env ↔ - MainPrefixExtends (env old) (env next) := by - rw [mainPrefixExtensionFormula, realize_exBlock] - let outer := suffixIndex n 6 - let field := prefixIndex n 6 - have actual (f : Fin 6 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula - (extendMany 6 f env) ∧ - Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula - (extendMany 6 f env) ∧ - Realize M.sets (BoundedFormula.mainPrefixFieldExtensionFormula - (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula (extendMany 6 f env)) ↔ - env old = mainPrefixCode (f 0) (f 1) (f 2) ∧ - env next = mainPrefixCode (f 3) (f 4) (f 5) ∧ f 0 ⊆ f 3 ∧ f 1 ⊆ f 4 ∧ f 2 ⊆ f 5 := by - have mems := extendMany_members 6 f env ground members - rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, - BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, - BoundedFormula.realize_toFormula M _ _ mems, BoundedFormula.truth_mainPrefixFieldExtensionFormula] - simp only [outer, field, extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, clauses⟩ - have result := (actual f ground).1 clauses - exact ⟨f 0, f 1, f 2, f 3, f 4, f 5, result⟩ - · rintro ⟨T, S, E, U, F, G, first, second, indices, stages, transitions⟩ - have left := M.mainPrefixCode_fields_mem (first ▸ members old) - have right := M.mainPrefixCode_fields_mem (second ▸ members next) - let f : Fin 6 → ZFSet.{u} := Fin.cases T (Fin.cases S (Fin.cases E - (Fin.cases U (Fin.cases F (fun _ => G))))) - have ground : ∀ j, f j ∈ M.sets := Fin.cases left.1 (Fin.cases left.2.1 - (Fin.cases left.2.2 (Fin.cases right.1 (Fin.cases right.2.1 (fun _ => right.2.2))))) - exact ⟨f, ground, (actual f ground).2 ⟨first, second, indices, stages, transitions⟩⟩ - -end TransitiveGround - -namespace SetFormula - -def mainPrefixLimitStepRawFormula {n} (K Labels C D rD N old next : Fin n) - (w : Fin 32 → Fin n) : SetFormula n := - let v := mainPrefixLimitTargetFields w - .conj (BoundedFormula.successorFormula (w 7) (w 0)).toFormula - (.conj (BoundedFormula.mainPrefixTupleFormula old (w 0) (w 1) (w 2)).toFormula - (.conj (BoundedFormula.mainPrefixTupleFormula next (w 7) (w 3) (w 4)).toFormula - (.conj (mainPrefixExtensionFormula old next) - (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 5) (w 3)).toFormula - (.conj (linkedMainStageRawFormula K Labels C D rD N (w 5) v) - (.conj (BoundedFormula.pairMembershipFormula (v 11) (w 6) (v 17)).toFormula - (BoundedFormula.mainLimitCoverageFormula (w 0) (w 1) (w 4) - (v 0) (v 3) (v 1) (v 9) (v 11) (w 6)).toFormula)))))) - -def mainPrefixLimitStepFormula {n} (K Labels C D rD N old next : Fin n) : SetFormula n := - let outer := suffixIndex n 32 - exBlock 32 (mainPrefixLimitStepRawFormula (outer K) (outer Labels) (outer C) - (outer D) (outer rD) (outer N) (outer old) (outer next) (prefixIndex n 32)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixLimitStepRawFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n) - (w : Fin 32 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixLimitStepRawFormula K Labels C D rD N old next w) env ↔ - MainPrefixLimitStepRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env old) (env next) (fun j => env (w j)) := by - have linked := M.realize_linkedMainStageRawFormula pairing unions powers separation collection - K Labels C D rD N (w 5) (mainPrefixLimitTargetFields w) env members omega ordinal - have extension := M.realize_mainPrefixExtensionFormula old next env members - simp only [mainPrefixLimitStepRawFormula, Realize, BoundedFormula.realize_toFormula M _ env members, - BoundedFormula.truth_successorFormula, BoundedFormula.truth_mainPrefixTupleFormula, - extension, BoundedFormula.truth_pairMembershipFormula, linked, - BoundedFormula.truth_mainLimitCoverageFormula] - rfl - -theorem realize_mainPrefixLimitStepFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixLimitStepFormula K Labels C D rD N old next) env ↔ - MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env old) (env next) := by - rw [mainPrefixLimitStepFormula, realize_exBlock] - have actual (w : Fin 32 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) := - M.realize_mainPrefixLimitStepRawFormula pairing unions powers separation collection - (suffixIndex n 32 K) (suffixIndex n 32 Labels) (suffixIndex n 32 C) (suffixIndex n 32 D) - (suffixIndex n 32 rD) (suffixIndex n 32 N) (suffixIndex n 32 old) (suffixIndex n 32 next) - (prefixIndex n 32) (extendMany 32 w env) (extendMany_members 32 w env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal) - simp only [extendMany_prefix, extendMany_suffix] at actual - exact ⟨fun ⟨w, ground, recognized⟩ => ⟨w, ground, (actual w ground).1 recognized⟩, - fun ⟨w, ground, raw⟩ => ⟨w, ground, (actual w ground).2 raw⟩⟩ - -end TransitiveGround - -namespace BoundedFormula -def mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n) : BoundedFormula n := - .conj (successorFormula (v 8) (v 0)) - (.conj (successorFormula (v 9) (v 8)) - (.conj (mainPrefixTupleFormula old (v 8) (v 1) (v 2)) - (.conj (mainPrefixTupleFormula next (v 9) (v 3) (v 4)) - (.conj (mainPrefixFieldExtensionFormula (v 8) (v 1) (v 2) (v 9) (v 3) (v 4)) - (.conj (pairMembershipFormula (v 0) (v 5) (v 1)) - (.conj (rightTripleMembershipFormula (v 5) (v 6) (v 7) f) - (.conj (pairMembershipFormula (v 8) (v 6) (v 3)) - (tripleMembershipFormula (v 8) (v 0) (v 7) (v 4))))))))) - -theorem truth_mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (mainPrefixSelectedStepBody f old next v) env ↔ - env (v 8) = insert (env (v 0)) (env (v 0)) ∧ - env (v 9) = insert (env (v 8)) (env (v 8)) ∧ - env old = mainPrefixCode (env (v 8)) (env (v 1)) (env (v 2)) ∧ - env next = mainPrefixCode (env (v 9)) (env (v 3)) (env (v 4)) ∧ - (env (v 8) ⊆ env (v 9) ∧ env (v 1) ⊆ env (v 3) ∧ env (v 2) ⊆ env (v 4)) ∧ - ZFSet.pair (env (v 0)) (env (v 5)) ∈ env (v 1) ∧ - ZFSet.pair (env (v 5)) (ZFSet.pair (env (v 6)) (env (v 7))) ∈ env f ∧ - ZFSet.pair (env (v 8)) (env (v 6)) ∈ env (v 3) ∧ - ZFSet.pair (ZFSet.pair (env (v 8)) (env (v 0))) (env (v 7)) ∈ env (v 4) := by - simp only [mainPrefixSelectedStepBody, Truth, truth_successorFormula, - truth_mainPrefixTupleFormula, truth_mainPrefixFieldExtensionFormula, - truth_pairMembershipFormula, truth_rightTripleMembershipFormula, truth_tripleMembershipFormula] - -end BoundedFormula - -namespace SetFormula -def mainPrefixSelectedStepFormula {n} (f old next : Fin n) : SetFormula n := - exBlock 10 (BoundedFormula.mainPrefixSelectedStepBody - (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next) - (prefixIndex n 10)).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixSelectedStepFormula {n} (f old next : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixSelectedStepFormula f old next) env ↔ - MainPrefixSelectedStepCode (env f) (env old) (env next) := by - rw [mainPrefixSelectedStepFormula, realize_exBlock] - have actual (v : Fin 10 → ZFSet.{u}) (ground : ∀ j, v j ∈ M.sets) := - (BoundedFormula.realize_toFormula M _ (extendMany 10 v env) - (extendMany_members 10 v env ground members)).trans - (BoundedFormula.truth_mainPrefixSelectedStepBody - (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next) - (prefixIndex n 10) (extendMany 10 v env)) - simp only [extendMany_prefix, extendMany_suffix] at actual - constructor - · rintro ⟨v, ground, recognized⟩ - obtain ⟨first, second, oldCode, nextCode, extension, source, selected, target, crossing⟩ := - (actual v ground).1 recognized - refine ⟨v 0, v 1, v 2, v 3, v 4, v 5, v 6, v 7, ?_, ?_, ?_, source, selected, ?_, ?_⟩ - · simpa only [first] using oldCode - · simpa only [second, first] using nextCode - · rw [oldCode, nextCode] - exact mainPrefixExtends_iff.2 extension - · simpa only [first] using target - · simpa only [first] using crossing - · rintro ⟨b, S, E, S', E', a, target, z, oldCode, nextCode, - extension, source, selected, targetEntry, crossing⟩ - have left := M.mainPrefixCode_fields_mem (oldCode ▸ members old) - have right := M.mainPrefixCode_fields_mem (nextCode ▸ members next) - have sourceGround := M.transitive left.2.1 source - have selectedGround := M.transitive (members f) selected - let v : Fin 10 → ZFSet.{u} := Fin.cases b (Fin.cases S (Fin.cases E - (Fin.cases S' (Fin.cases E' (Fin.cases a (Fin.cases target (Fin.cases z - (Fin.cases (insert b b) (fun _ => insert (insert b b) (insert b b)))))))))) - have ground : ∀ j, v j ∈ M.sets := Fin.cases (M.pair_left sourceGround) - (Fin.cases left.2.1 (Fin.cases left.2.2 (Fin.cases right.2.1 (Fin.cases right.2.2 - (Fin.cases (M.pair_right sourceGround) (Fin.cases (M.pair_left (M.pair_right selectedGround)) - (Fin.cases (M.pair_right (M.pair_right selectedGround)) (Fin.cases left.1 (fun _ => right.1))))))))) - rw [oldCode, nextCode] at extension - exact ⟨v, ground, (actual v ground).2 ⟨rfl, rfl, oldCode, nextCode, - mainPrefixExtends_iff.1 extension, source, selected, targetEntry, crossing⟩⟩ - -end TransitiveGround - -namespace SetFormula -def mainPrefixConditionalStepFormula {n} (K Labels C D rD N f old next : Fin n) : SetFormula n := - let outer := suffixIndex n 3 - let field := prefixIndex n 3 - disj (mainPrefixSelectedStepFormula f old next) - (exBlock 3 (.conj - (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula - (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula - (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D) - (outer rD) (outer N) (outer old) (outer next))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixConditionalStepFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} - (K Labels C D rD N f old next : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) (omega : env N = ZFSet.omega) - (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixConditionalStepFormula K Labels C D rD N f old next) env ↔ - MainPrefixConditionalStepCode M (env K) (env Labels) (env C) (env D) (env rD) - (env N) (env f) (env old) (env next) := by - rw [mainPrefixConditionalStepFormula, realize_disj, - M.realize_mainPrefixSelectedStepFormula f old next env members, realize_exBlock] - apply or_congr Iff.rfl - let outer := suffixIndex n 3 - let field := prefixIndex n 3 - have actual (w : Fin 3 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : - Realize M.sets (.conj - (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula - (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula - (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D) - (outer rD) (outer N) (outer old) (outer next)))) (extendMany 3 w env) ↔ - env old = mainPrefixCode (w 0) (w 1) (w 2) ∧ NonzeroLimitOrdinalCode (w 0) ∧ - MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env old) (env next) := by - have mems := extendMany_members 3 w env ground members - change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _ - rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, - BoundedFormula.realize_nonzeroLimitOrdinalFormula M _ _ mems, - M.realize_mainPrefixLimitStepFormula pairing unions powers separation collection - _ _ _ _ _ _ _ _ _ mems (by simpa only [outer, extendMany_suffix] using omega) - (by simpa only [outer, extendMany_suffix] using ordinal)] - simp only [outer, field, extendMany_suffix, extendMany_prefix] - constructor - · rintro ⟨w, ground, recognized⟩ - exact ⟨w 0, w 1, w 2, (actual w ground).1 recognized⟩ - · rintro ⟨T, S, E, oldCode, nonzero, code⟩ - have fields := M.mainPrefixCode_fields_mem (oldCode ▸ members old) - let w : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) - have ground : ∀ j, w j ∈ M.sets := Fin.cases fields.1 (Fin.cases fields.2.1 (fun _ => fields.2.2)) - exact ⟨w, ground, (actual w ground).2 ⟨oldCode, nonzero, code⟩⟩ - -end TransitiveGround - -namespace SetFormula -def preservedMainPrefixHistoryValuesFormula {n} (K Labels C D rD N p : Fin n) : SetFormula n := - let old := suffixIndex n 2 - let field := prefixIndex n 2 - allBlock 2 (imp (BoundedFormula.pairMembershipFormula (field 0) (field 1) (old p)).toFormula - (preservedMainPrefixHistoryValueFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 0) (field 1))) - -def preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n) : SetFormula n := - let old := suffixIndex n 4 - let field := prefixIndex n 4 - allBlock 4 (imp (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (field 0) (field 2) (old p)) - (.conj (BoundedFormula.pairMembershipFormula (field 1) (field 3) (old p)) - (BoundedFormula.disj (.equal (field 0) (field 1)) (.mem (field 0) (field 1))))).toFormula - (mainPrefixExtensionFormula (field 2) (field 3))) - -def preservedMainPrefixHistoryFormula {n} (K Labels C D rD N A p : Fin n) : SetFormula n := - .conj (functionGraphOnFormula A p) - (.conj (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) - (preservedMainPrefixHistoryCompatibilityFormula p)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_preservedMainPrefixHistoryValuesFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N p : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ↔ - ∀ i q, ZFSet.pair i q ∈ env p → - ∃ S E, q = mainPrefixCode (insert i i) S E ∧ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (insert i i) S E ∧ - MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E := by - rw [preservedMainPrefixHistoryValuesFormula, realize_allBlock] - have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets - (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1) - (suffixIndex n 2 p)).toFormula - (preservedMainPrefixHistoryValueFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels) - (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD) (suffixIndex n 2 N) - (prefixIndex n 2 0) (prefixIndex n 2 1))) (extendMany 2 f env) ↔ - (ZFSet.pair (f 0) (f 1) ∈ env p → - ∃ S E, f 1 = mainPrefixCode (insert (f 0) (f 0)) S E ∧ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) - (insert (f 0) (f 0)) S E ∧ - MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E) := by - have mems := extendMany_members 2 f env ground members - rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems, - BoundedFormula.truth_pairMembershipFormula] - rw [M.realize_preservedMainPrefixHistoryValueFormula pairing unions powers separation collection - _ _ _ _ _ _ _ _ _ mems - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal)] - simp only [extendMany_prefix, extendMany_suffix] - constructor - · intro recognized i q entry - have ground := M.transitive (members p) entry - let f : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => q) - have grounds : ∀ j, f j ∈ M.sets := Fin.cases (M.pair_left ground) (fun _ => M.pair_right ground) - exact (actual f grounds).1 (recognized f grounds) entry - · intro law f ground - exact (actual f ground).2 (law (f 0) (f 1)) - -theorem realize_preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env ↔ - ∀ i j q r, ZFSet.pair i q ∈ env p → ZFSet.pair j r ∈ env p → - (i = j ∨ i ∈ j) → MainPrefixExtends q r := by - rw [preservedMainPrefixHistoryCompatibilityFormula, realize_allBlock] - have actual (f : Fin 4 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (imp (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (prefixIndex n 4 0) (prefixIndex n 4 2) (suffixIndex n 4 p)) - (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 4 1) (prefixIndex n 4 3) (suffixIndex n 4 p)) - (BoundedFormula.disj (.equal (prefixIndex n 4 0) (prefixIndex n 4 1)) - (.mem (prefixIndex n 4 0) (prefixIndex n 4 1))))).toFormula - (mainPrefixExtensionFormula (prefixIndex n 4 2) (prefixIndex n 4 3))) (extendMany 4 f env) ↔ - ((ZFSet.pair (f 0) (f 2) ∈ env p ∧ ZFSet.pair (f 1) (f 3) ∈ env p ∧ - (f 0 = f 1 ∨ f 0 ∈ f 1)) → MainPrefixExtends (f 2) (f 3)) := by - have mems := extendMany_members 4 f env ground members - rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems] - simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, BoundedFormula.truth_disj] - rw [M.realize_mainPrefixExtensionFormula _ _ _ mems] - simp only [extendMany_prefix, extendMany_suffix] - constructor - · intro recognized i j q r first second before - have hfirst := M.transitive (members p) first - have hsecond := M.transitive (members p) second - let f : Fin 4 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases q (fun _ => r))) - have grounds : ∀ k, f k ∈ M.sets := Fin.cases (M.pair_left hfirst) - (Fin.cases (M.pair_left hsecond) (Fin.cases (M.pair_right hfirst) (fun _ => M.pair_right hsecond))) - exact (actual f grounds).1 (recognized f grounds) ⟨first, second, before⟩ - · intro law f ground - exact (actual f ground).2 (fun entries => law (f 0) (f 1) (f 2) (f 3) entries.1 entries.2.1 entries.2.2) - -theorem realize_preservedMainPrefixHistoryFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N A p : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (preservedMainPrefixHistoryFormula K Labels C D rD N A p) env ↔ - PreservedMainPrefixHistoryCode M (env K) (env Labels) (env C) (env D) (env rD) (env A) (env p) := by - change (Realize M.sets (functionGraphOnFormula A p) env ∧ - Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ∧ - Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env) ↔ _ - rw [M.realize_functionGraphOnFormula unions A p env members, - M.realize_preservedMainPrefixHistoryValuesFormula pairing unions powers separation collection - K Labels C D rD N p env members omega ordinal, - M.realize_preservedMainPrefixHistoryCompatibilityFormula p env members] - exact ⟨fun h => ⟨h.1, h.2.1, h.2.2⟩, fun h => ⟨h.function, h.values, h.compatible⟩⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalStepCodes +import OAI.SetTheory.PartitionPrinciple.Transfinite.PreservedMainPrefixHistoryValues + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace BoundedFormula +open SetFormula +universe u + +def nonzeroLimitOrdinalFormula {n} (T : Fin n) : BoundedFormula n := + .conj (.neg (emptyFormula T)) (.allMem T (exMem T.succ (.mem 1 0))) + +theorem truth_nonzeroLimitOrdinalFormula {n} (T : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (nonzeroLimitOrdinalFormula T) env ↔ NonzeroLimitOrdinalCode (env T) := by + simp only [nonzeroLimitOrdinalFormula, Truth, truth_emptyFormula, truth_exMem] + rfl + +theorem realize_nonzeroLimitOrdinalFormula (M : TransitiveGround.{u}) {n} + (T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (nonzeroLimitOrdinalFormula T).toFormula env ↔ + NonzeroLimitOrdinalCode (env T) := + (realize_toFormula M _ env members).trans (truth_nonzeroLimitOrdinalFormula T env) + +end BoundedFormula + +open SetFormula +universe u + +namespace BoundedFormula +def mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n) : BoundedFormula n := + .conj (subsetFormula T T') (.conj (subsetFormula S S') (subsetFormula E E')) + +theorem truth_mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (mainPrefixFieldExtensionFormula T S E T' S' E') env ↔ + env T ⊆ env T' ∧ env S ⊆ env S' ∧ env E ⊆ env E' := by + simp only [mainPrefixFieldExtensionFormula, Truth, truth_subsetFormula] + +end BoundedFormula + +namespace SetFormula +def mainPrefixExtensionFormula {n} (old next : Fin n) : SetFormula n := + let outer := suffixIndex n 6 + let field := prefixIndex n 6 + exBlock 6 (.conj + (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula + (.conj (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula + (BoundedFormula.mainPrefixFieldExtensionFormula + (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixExtensionFormula {n} (old next : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixExtensionFormula old next) env ↔ + MainPrefixExtends (env old) (env next) := by + rw [mainPrefixExtensionFormula, realize_exBlock] + let outer := suffixIndex n 6 + let field := prefixIndex n 6 + have actual (f : Fin 6 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula + (extendMany 6 f env) ∧ + Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula + (extendMany 6 f env) ∧ + Realize M.sets (BoundedFormula.mainPrefixFieldExtensionFormula + (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula (extendMany 6 f env)) ↔ + env old = mainPrefixCode (f 0) (f 1) (f 2) ∧ + env next = mainPrefixCode (f 3) (f 4) (f 5) ∧ f 0 ⊆ f 3 ∧ f 1 ⊆ f 4 ∧ f 2 ⊆ f 5 := by + have mems := extendMany_members 6 f env ground members + rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, + BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, + BoundedFormula.realize_toFormula M _ _ mems, BoundedFormula.truth_mainPrefixFieldExtensionFormula] + simp only [outer, field, extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, clauses⟩ + have result := (actual f ground).1 clauses + exact ⟨f 0, f 1, f 2, f 3, f 4, f 5, result⟩ + · rintro ⟨T, S, E, U, F, G, first, second, indices, stages, transitions⟩ + have left := M.mainPrefixCode_fields_mem (first ▸ members old) + have right := M.mainPrefixCode_fields_mem (second ▸ members next) + let f : Fin 6 → ZFSet.{u} := Fin.cases T (Fin.cases S (Fin.cases E + (Fin.cases U (Fin.cases F (fun _ => G))))) + have ground : ∀ j, f j ∈ M.sets := Fin.cases left.1 (Fin.cases left.2.1 + (Fin.cases left.2.2 (Fin.cases right.1 (Fin.cases right.2.1 (fun _ => right.2.2))))) + exact ⟨f, ground, (actual f ground).2 ⟨first, second, indices, stages, transitions⟩⟩ + +end TransitiveGround + +namespace SetFormula + +def mainPrefixLimitStepRawFormula {n} (K Labels C D rD N old next : Fin n) + (w : Fin 32 → Fin n) : SetFormula n := + let v := mainPrefixLimitTargetFields w + .conj (BoundedFormula.successorFormula (w 7) (w 0)).toFormula + (.conj (BoundedFormula.mainPrefixTupleFormula old (w 0) (w 1) (w 2)).toFormula + (.conj (BoundedFormula.mainPrefixTupleFormula next (w 7) (w 3) (w 4)).toFormula + (.conj (mainPrefixExtensionFormula old next) + (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 5) (w 3)).toFormula + (.conj (linkedMainStageRawFormula K Labels C D rD N (w 5) v) + (.conj (BoundedFormula.pairMembershipFormula (v 11) (w 6) (v 17)).toFormula + (BoundedFormula.mainLimitCoverageFormula (w 0) (w 1) (w 4) + (v 0) (v 3) (v 1) (v 9) (v 11) (w 6)).toFormula)))))) + +def mainPrefixLimitStepFormula {n} (K Labels C D rD N old next : Fin n) : SetFormula n := + let outer := suffixIndex n 32 + exBlock 32 (mainPrefixLimitStepRawFormula (outer K) (outer Labels) (outer C) + (outer D) (outer rD) (outer N) (outer old) (outer next) (prefixIndex n 32)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixLimitStepRawFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n) + (w : Fin 32 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixLimitStepRawFormula K Labels C D rD N old next w) env ↔ + MainPrefixLimitStepRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env old) (env next) (fun j => env (w j)) := by + have linked := M.realize_linkedMainStageRawFormula pairing unions powers separation collection + K Labels C D rD N (w 5) (mainPrefixLimitTargetFields w) env members omega ordinal + have extension := M.realize_mainPrefixExtensionFormula old next env members + simp only [mainPrefixLimitStepRawFormula, Realize, BoundedFormula.realize_toFormula M _ env members, + BoundedFormula.truth_successorFormula, BoundedFormula.truth_mainPrefixTupleFormula, + extension, BoundedFormula.truth_pairMembershipFormula, linked, + BoundedFormula.truth_mainLimitCoverageFormula] + rfl + +theorem realize_mainPrefixLimitStepFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixLimitStepFormula K Labels C D rD N old next) env ↔ + MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env old) (env next) := by + rw [mainPrefixLimitStepFormula, realize_exBlock] + have actual (w : Fin 32 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) := + M.realize_mainPrefixLimitStepRawFormula pairing unions powers separation collection + (suffixIndex n 32 K) (suffixIndex n 32 Labels) (suffixIndex n 32 C) (suffixIndex n 32 D) + (suffixIndex n 32 rD) (suffixIndex n 32 N) (suffixIndex n 32 old) (suffixIndex n 32 next) + (prefixIndex n 32) (extendMany 32 w env) (extendMany_members 32 w env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal) + simp only [extendMany_prefix, extendMany_suffix] at actual + exact ⟨fun ⟨w, ground, recognized⟩ => ⟨w, ground, (actual w ground).1 recognized⟩, + fun ⟨w, ground, raw⟩ => ⟨w, ground, (actual w ground).2 raw⟩⟩ + +end TransitiveGround + +namespace BoundedFormula +def mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n) : BoundedFormula n := + .conj (successorFormula (v 8) (v 0)) + (.conj (successorFormula (v 9) (v 8)) + (.conj (mainPrefixTupleFormula old (v 8) (v 1) (v 2)) + (.conj (mainPrefixTupleFormula next (v 9) (v 3) (v 4)) + (.conj (mainPrefixFieldExtensionFormula (v 8) (v 1) (v 2) (v 9) (v 3) (v 4)) + (.conj (pairMembershipFormula (v 0) (v 5) (v 1)) + (.conj (rightTripleMembershipFormula (v 5) (v 6) (v 7) f) + (.conj (pairMembershipFormula (v 8) (v 6) (v 3)) + (tripleMembershipFormula (v 8) (v 0) (v 7) (v 4))))))))) + +theorem truth_mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (mainPrefixSelectedStepBody f old next v) env ↔ + env (v 8) = insert (env (v 0)) (env (v 0)) ∧ + env (v 9) = insert (env (v 8)) (env (v 8)) ∧ + env old = mainPrefixCode (env (v 8)) (env (v 1)) (env (v 2)) ∧ + env next = mainPrefixCode (env (v 9)) (env (v 3)) (env (v 4)) ∧ + (env (v 8) ⊆ env (v 9) ∧ env (v 1) ⊆ env (v 3) ∧ env (v 2) ⊆ env (v 4)) ∧ + ZFSet.pair (env (v 0)) (env (v 5)) ∈ env (v 1) ∧ + ZFSet.pair (env (v 5)) (ZFSet.pair (env (v 6)) (env (v 7))) ∈ env f ∧ + ZFSet.pair (env (v 8)) (env (v 6)) ∈ env (v 3) ∧ + ZFSet.pair (ZFSet.pair (env (v 8)) (env (v 0))) (env (v 7)) ∈ env (v 4) := by + simp only [mainPrefixSelectedStepBody, Truth, truth_successorFormula, + truth_mainPrefixTupleFormula, truth_mainPrefixFieldExtensionFormula, + truth_pairMembershipFormula, truth_rightTripleMembershipFormula, truth_tripleMembershipFormula] + +end BoundedFormula + +namespace SetFormula +def mainPrefixSelectedStepFormula {n} (f old next : Fin n) : SetFormula n := + exBlock 10 (BoundedFormula.mainPrefixSelectedStepBody + (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next) + (prefixIndex n 10)).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixSelectedStepFormula {n} (f old next : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixSelectedStepFormula f old next) env ↔ + MainPrefixSelectedStepCode (env f) (env old) (env next) := by + rw [mainPrefixSelectedStepFormula, realize_exBlock] + have actual (v : Fin 10 → ZFSet.{u}) (ground : ∀ j, v j ∈ M.sets) := + (BoundedFormula.realize_toFormula M _ (extendMany 10 v env) + (extendMany_members 10 v env ground members)).trans + (BoundedFormula.truth_mainPrefixSelectedStepBody + (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next) + (prefixIndex n 10) (extendMany 10 v env)) + simp only [extendMany_prefix, extendMany_suffix] at actual + constructor + · rintro ⟨v, ground, recognized⟩ + obtain ⟨first, second, oldCode, nextCode, extension, source, selected, target, crossing⟩ := + (actual v ground).1 recognized + refine ⟨v 0, v 1, v 2, v 3, v 4, v 5, v 6, v 7, ?_, ?_, ?_, source, selected, ?_, ?_⟩ + · simpa only [first] using oldCode + · simpa only [second, first] using nextCode + · rw [oldCode, nextCode] + exact mainPrefixExtends_iff.2 extension + · simpa only [first] using target + · simpa only [first] using crossing + · rintro ⟨b, S, E, S', E', a, target, z, oldCode, nextCode, + extension, source, selected, targetEntry, crossing⟩ + have left := M.mainPrefixCode_fields_mem (oldCode ▸ members old) + have right := M.mainPrefixCode_fields_mem (nextCode ▸ members next) + have sourceGround := M.transitive left.2.1 source + have selectedGround := M.transitive (members f) selected + let v : Fin 10 → ZFSet.{u} := Fin.cases b (Fin.cases S (Fin.cases E + (Fin.cases S' (Fin.cases E' (Fin.cases a (Fin.cases target (Fin.cases z + (Fin.cases (insert b b) (fun _ => insert (insert b b) (insert b b)))))))))) + have ground : ∀ j, v j ∈ M.sets := Fin.cases (M.pair_left sourceGround) + (Fin.cases left.2.1 (Fin.cases left.2.2 (Fin.cases right.2.1 (Fin.cases right.2.2 + (Fin.cases (M.pair_right sourceGround) (Fin.cases (M.pair_left (M.pair_right selectedGround)) + (Fin.cases (M.pair_right (M.pair_right selectedGround)) (Fin.cases left.1 (fun _ => right.1))))))))) + rw [oldCode, nextCode] at extension + exact ⟨v, ground, (actual v ground).2 ⟨rfl, rfl, oldCode, nextCode, + mainPrefixExtends_iff.1 extension, source, selected, targetEntry, crossing⟩⟩ + +end TransitiveGround + +namespace SetFormula +def mainPrefixConditionalStepFormula {n} (K Labels C D rD N f old next : Fin n) : SetFormula n := + let outer := suffixIndex n 3 + let field := prefixIndex n 3 + disj (mainPrefixSelectedStepFormula f old next) + (exBlock 3 (.conj + (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula + (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula + (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D) + (outer rD) (outer N) (outer old) (outer next))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixConditionalStepFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} + (K Labels C D rD N f old next : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) (omega : env N = ZFSet.omega) + (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixConditionalStepFormula K Labels C D rD N f old next) env ↔ + MainPrefixConditionalStepCode M (env K) (env Labels) (env C) (env D) (env rD) + (env N) (env f) (env old) (env next) := by + rw [mainPrefixConditionalStepFormula, realize_disj, + M.realize_mainPrefixSelectedStepFormula f old next env members, realize_exBlock] + apply or_congr Iff.rfl + let outer := suffixIndex n 3 + let field := prefixIndex n 3 + have actual (w : Fin 3 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : + Realize M.sets (.conj + (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula + (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula + (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D) + (outer rD) (outer N) (outer old) (outer next)))) (extendMany 3 w env) ↔ + env old = mainPrefixCode (w 0) (w 1) (w 2) ∧ NonzeroLimitOrdinalCode (w 0) ∧ + MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env old) (env next) := by + have mems := extendMany_members 3 w env ground members + change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _ + rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, + BoundedFormula.realize_nonzeroLimitOrdinalFormula M _ _ mems, + M.realize_mainPrefixLimitStepFormula pairing unions powers separation collection + _ _ _ _ _ _ _ _ _ mems (by simpa only [outer, extendMany_suffix] using omega) + (by simpa only [outer, extendMany_suffix] using ordinal)] + simp only [outer, field, extendMany_suffix, extendMany_prefix] + constructor + · rintro ⟨w, ground, recognized⟩ + exact ⟨w 0, w 1, w 2, (actual w ground).1 recognized⟩ + · rintro ⟨T, S, E, oldCode, nonzero, code⟩ + have fields := M.mainPrefixCode_fields_mem (oldCode ▸ members old) + let w : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) + have ground : ∀ j, w j ∈ M.sets := Fin.cases fields.1 (Fin.cases fields.2.1 (fun _ => fields.2.2)) + exact ⟨w, ground, (actual w ground).2 ⟨oldCode, nonzero, code⟩⟩ + +end TransitiveGround + +namespace SetFormula +def preservedMainPrefixHistoryValuesFormula {n} (K Labels C D rD N p : Fin n) : SetFormula n := + let old := suffixIndex n 2 + let field := prefixIndex n 2 + allBlock 2 (imp (BoundedFormula.pairMembershipFormula (field 0) (field 1) (old p)).toFormula + (preservedMainPrefixHistoryValueFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 0) (field 1))) + +def preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n) : SetFormula n := + let old := suffixIndex n 4 + let field := prefixIndex n 4 + allBlock 4 (imp (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (field 0) (field 2) (old p)) + (.conj (BoundedFormula.pairMembershipFormula (field 1) (field 3) (old p)) + (BoundedFormula.disj (.equal (field 0) (field 1)) (.mem (field 0) (field 1))))).toFormula + (mainPrefixExtensionFormula (field 2) (field 3))) + +def preservedMainPrefixHistoryFormula {n} (K Labels C D rD N A p : Fin n) : SetFormula n := + .conj (functionGraphOnFormula A p) + (.conj (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) + (preservedMainPrefixHistoryCompatibilityFormula p)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_preservedMainPrefixHistoryValuesFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N p : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ↔ + ∀ i q, ZFSet.pair i q ∈ env p → + ∃ S E, q = mainPrefixCode (insert i i) S E ∧ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (insert i i) S E ∧ + MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E := by + rw [preservedMainPrefixHistoryValuesFormula, realize_allBlock] + have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets + (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1) + (suffixIndex n 2 p)).toFormula + (preservedMainPrefixHistoryValueFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels) + (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD) (suffixIndex n 2 N) + (prefixIndex n 2 0) (prefixIndex n 2 1))) (extendMany 2 f env) ↔ + (ZFSet.pair (f 0) (f 1) ∈ env p → + ∃ S E, f 1 = mainPrefixCode (insert (f 0) (f 0)) S E ∧ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) + (insert (f 0) (f 0)) S E ∧ + MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E) := by + have mems := extendMany_members 2 f env ground members + rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems, + BoundedFormula.truth_pairMembershipFormula] + rw [M.realize_preservedMainPrefixHistoryValueFormula pairing unions powers separation collection + _ _ _ _ _ _ _ _ _ mems + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal)] + simp only [extendMany_prefix, extendMany_suffix] + constructor + · intro recognized i q entry + have ground := M.transitive (members p) entry + let f : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => q) + have grounds : ∀ j, f j ∈ M.sets := Fin.cases (M.pair_left ground) (fun _ => M.pair_right ground) + exact (actual f grounds).1 (recognized f grounds) entry + · intro law f ground + exact (actual f ground).2 (law (f 0) (f 1)) + +theorem realize_preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env ↔ + ∀ i j q r, ZFSet.pair i q ∈ env p → ZFSet.pair j r ∈ env p → + (i = j ∨ i ∈ j) → MainPrefixExtends q r := by + rw [preservedMainPrefixHistoryCompatibilityFormula, realize_allBlock] + have actual (f : Fin 4 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (imp (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (prefixIndex n 4 0) (prefixIndex n 4 2) (suffixIndex n 4 p)) + (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 4 1) (prefixIndex n 4 3) (suffixIndex n 4 p)) + (BoundedFormula.disj (.equal (prefixIndex n 4 0) (prefixIndex n 4 1)) + (.mem (prefixIndex n 4 0) (prefixIndex n 4 1))))).toFormula + (mainPrefixExtensionFormula (prefixIndex n 4 2) (prefixIndex n 4 3))) (extendMany 4 f env) ↔ + ((ZFSet.pair (f 0) (f 2) ∈ env p ∧ ZFSet.pair (f 1) (f 3) ∈ env p ∧ + (f 0 = f 1 ∨ f 0 ∈ f 1)) → MainPrefixExtends (f 2) (f 3)) := by + have mems := extendMany_members 4 f env ground members + rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems] + simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, BoundedFormula.truth_disj] + rw [M.realize_mainPrefixExtensionFormula _ _ _ mems] + simp only [extendMany_prefix, extendMany_suffix] + constructor + · intro recognized i j q r first second before + have hfirst := M.transitive (members p) first + have hsecond := M.transitive (members p) second + let f : Fin 4 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases q (fun _ => r))) + have grounds : ∀ k, f k ∈ M.sets := Fin.cases (M.pair_left hfirst) + (Fin.cases (M.pair_left hsecond) (Fin.cases (M.pair_right hfirst) (fun _ => M.pair_right hsecond))) + exact (actual f grounds).1 (recognized f grounds) ⟨first, second, before⟩ + · intro law f ground + exact (actual f ground).2 (fun entries => law (f 0) (f 1) (f 2) (f 3) entries.1 entries.2.1 entries.2.2) + +theorem realize_preservedMainPrefixHistoryFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N A p : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (preservedMainPrefixHistoryFormula K Labels C D rD N A p) env ↔ + PreservedMainPrefixHistoryCode M (env K) (env Labels) (env C) (env D) (env rD) (env A) (env p) := by + change (Realize M.sets (functionGraphOnFormula A p) env ∧ + Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ∧ + Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env) ↔ _ + rw [M.realize_functionGraphOnFormula unions A p env members, + M.realize_preservedMainPrefixHistoryValuesFormula pairing unions powers separation collection + K Labels C D rD N p env members omega ordinal, + M.realize_preservedMainPrefixHistoryCompatibilityFormula p env members] + exact ⟨fun h => ⟨h.1, h.2.1, h.2.2⟩, fun h => ⟨h.function, h.values, h.compatible⟩⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalSupportFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalSupportFormulas.lean index 21333699a2462b2f311f5ac05542e8da957a1ad4..7946022302f5ff043f53173e7cbeb5506d2ddb6f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalSupportFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalSupportFormulas.lean @@ -1,76 +1,76 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula SetRealization -universe u - -def principalSupportFormula {n} (g c l r a : Fin n) : BoundedFormula n := - .allMem l (imp (pairMembershipFormula 0 c.succ r.succ) - (tripleMembershipFormula g.succ 0 0 a.succ)) - -def principalSupportEntryFormula {n} (z l g r a : Fin n) : BoundedFormula n := - exMem l (exMem g.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (principalSupportFormula 0 1 l.succ.succ r.succ.succ a.succ.succ))) - -theorem truth_principalSupportFormula {n} (g c l r a : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (principalSupportFormula g c l r a) env ↔ - ∀ x ∈ env l, ZFSet.pair x (env c) ∈ env r → ZFSet.pair (ZFSet.pair (env g) x) x ∈ env a := by - simp only [principalSupportFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_tripleMembershipFormula] - rfl - -theorem truth_principalSupportEntryFormula {n} (z l g r a : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (principalSupportEntryFormula z l g r a) env ↔ - ∃ c ∈ env l, ∃ h ∈ env g, env z = ZFSet.pair c h ∧ - ∀ x ∈ env l, ZFSet.pair x c ∈ env r → ZFSet.pair (ZFSet.pair h x) x ∈ env a := by - simp only [principalSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_principalSupportFormula] - rfl - -variable {G I : Type u} [Group G] [PartialOrder I] - -theorem principalSupport_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G) - (C : I) (g : G) : - Truth (principalSupportFormula 0 1 2 3 4) - (extend (t.encode g) (extend (b.encode C) (extend b.carrier - (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ g ∈ d.principalFix C := by - rw [truth_principalSupportFormula] - constructor - · intro fixed x lower - exact (d.triple_mem_actionGraph b t g x x).1 - (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower)) - · intro fixed x hx lower - obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx - exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower)) - -theorem principalSupportEntry_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G) - (z : ZFSet.{u}) : - Truth (principalSupportEntryFormula 0 1 2 3 4) - (extend z (extend b.carrier (extend t.carrier - (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ - z ∈ supportBasisCode b t d.principalFix := by - rw [truth_principalSupportEntryFormula, supportBasisCode, Presentation.mem_subset] - constructor - · rintro ⟨c, hc, h, hh, eq, fixed⟩ - obtain ⟨C, rfl⟩ := (b.mem_carrier c).1 hc - obtain ⟨g, rfl⟩ := (t.mem_carrier h).1 hh - refine ⟨(C, g), ?_, eq.symm⟩ - intro x lower - exact (d.triple_mem_actionGraph b t g x x).1 - (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower)) - · rintro ⟨⟨C, g⟩, fixed, eq⟩ - refine ⟨b.encode C, b.encode_mem C, t.encode g, t.encode_mem g, eq.symm, ?_⟩ - intro x hx lower - obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx - exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower)) - -end PartitionPilot.Forcing.BoundedFormula - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula SetRealization +universe u + +def principalSupportFormula {n} (g c l r a : Fin n) : BoundedFormula n := + .allMem l (imp (pairMembershipFormula 0 c.succ r.succ) + (tripleMembershipFormula g.succ 0 0 a.succ)) + +def principalSupportEntryFormula {n} (z l g r a : Fin n) : BoundedFormula n := + exMem l (exMem g.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (principalSupportFormula 0 1 l.succ.succ r.succ.succ a.succ.succ))) + +theorem truth_principalSupportFormula {n} (g c l r a : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (principalSupportFormula g c l r a) env ↔ + ∀ x ∈ env l, ZFSet.pair x (env c) ∈ env r → ZFSet.pair (ZFSet.pair (env g) x) x ∈ env a := by + simp only [principalSupportFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_tripleMembershipFormula] + rfl + +theorem truth_principalSupportEntryFormula {n} (z l g r a : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (principalSupportEntryFormula z l g r a) env ↔ + ∃ c ∈ env l, ∃ h ∈ env g, env z = ZFSet.pair c h ∧ + ∀ x ∈ env l, ZFSet.pair x c ∈ env r → ZFSet.pair (ZFSet.pair h x) x ∈ env a := by + simp only [principalSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_principalSupportFormula] + rfl + +variable {G I : Type u} [Group G] [PartialOrder I] + +theorem principalSupport_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G) + (C : I) (g : G) : + Truth (principalSupportFormula 0 1 2 3 4) + (extend (t.encode g) (extend (b.encode C) (extend b.carrier + (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ g ∈ d.principalFix C := by + rw [truth_principalSupportFormula] + constructor + · intro fixed x lower + exact (d.triple_mem_actionGraph b t g x x).1 + (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower)) + · intro fixed x hx lower + obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx + exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower)) + +theorem principalSupportEntry_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G) + (z : ZFSet.{u}) : + Truth (principalSupportEntryFormula 0 1 2 3 4) + (extend z (extend b.carrier (extend t.carrier + (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ + z ∈ supportBasisCode b t d.principalFix := by + rw [truth_principalSupportEntryFormula, supportBasisCode, Presentation.mem_subset] + constructor + · rintro ⟨c, hc, h, hh, eq, fixed⟩ + obtain ⟨C, rfl⟩ := (b.mem_carrier c).1 hc + obtain ⟨g, rfl⟩ := (t.mem_carrier h).1 hh + refine ⟨(C, g), ?_, eq.symm⟩ + intro x lower + exact (d.triple_mem_actionGraph b t g x x).1 + (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower)) + · rintro ⟨⟨C, g⟩, fixed, eq⟩ + refine ⟨b.encode C, b.encode_mem C, t.encode g, t.encode_mem g, eq.symm, ?_⟩ + intro x hx lower + obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx + exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower)) + +end PartitionPilot.Forcing.BoundedFormula + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalTileRealization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalTileRealization.lean index d110eec37a26663bf4c873cd5f3e6402a44875ec..69dab1051b62926470b1bbb49428a4e50f5a6951 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalTileRealization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalTileRealization.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.CodedPrincipalTile -open Compression.RecursiveMaps -universe u -variable {P Q rP rQ μP μQ ell : ZFSet.{u}} -variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} -variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} -variable (d : CodedPrincipalTile old right g ell) - -noncomputable def decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : g.Node := - Classical.choose (d.encode_surjective x.val x.property) - -theorem encode_decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : d.encode (d.decode x) = x.val := - Classical.choose_spec (d.encode_surjective x.val x.property) - -theorem decode_encode (x : g.Node) : d.decode ⟨d.encode x, d.encode_mem x⟩ = x := - d.encode_injective (d.encode_decode _) - -noncomputable def encodingIso : Compression.MeetIso g.order d.meetOrder.toMeetOrder := - isoOfOrder (fun x => ⟨d.encode x, d.encode_mem x⟩) d.decode d.decode_encode - (fun x => Subtype.ext (d.encode_decode x)) d.le_encode - -noncomputable def decodingIso : Compression.MeetIso d.meetOrder.toMeetOrder g.order := - inverseIso d.encodingIso - -theorem encodingIso_value (x : g.Node) : - (d.encodingIso.toFun x).val = d.encode x := rfl - -theorem decodingIso_encode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : - d.encode (d.decodingIso.toFun x) = x.val := d.encode_decode x - -theorem vertex_cover (z : ZFSet.{u}) (hz : z ∈ d.carrier) : - (∃ p ∈ P, ZFSet.pair p z ∈ attachmentOldEmbeddingGraph P) ∨ - ∃ q ∈ Q, ZFSet.pair q z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - rcases g.cover x with ⟨p, rfl⟩ | ⟨q, rfl⟩ - · exact Or.inl ⟨p.val, p.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨p.property, rfl⟩⟩ - · exact Or.inr ⟨q.val, q.property, d.template_entry q⟩ - -theorem cross_meet_entry (p : {p : ZFSet.{u} // p ∈ P}) - (q : {q : ZFSet.{u} // q ∈ Q}) : - ZFSet.pair (ZFSet.pair p.val (d.encode (g.right.toFun q))) - (old.toMeetOrder.meet p (g.shadow q)).val ∈ d.meetGraph := by - have entry := d.encoded_meet_entry (g.left.toFun p) (g.right.toFun q) - rw [g.cross_meet] at entry - exact entry - -theorem old_graph_ideal {p z : ZFSet.{u}} (hp : p ∈ P) (hz : z ∈ d.carrier) - (lower : ZFSet.pair z p ∈ d.order) : - ∃ x ∈ P, ZFSet.pair x z ∈ attachmentOldEmbeddingGraph P := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - obtain ⟨q, rfl⟩ := d.old_ideal ⟨p, hp⟩ x lower - exact ⟨q.val, q.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨q.property, rfl⟩⟩ - -theorem template_graph_ideal {q y z : ZFSet.{u}} - (entry : ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val) - (hz : z ∈ d.carrier) (lower : ZFSet.pair z y ∈ d.order) : - ∃ x ∈ Q, ZFSet.pair x z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by - have hq := (ZFSet.pair_mem_prod.1 ((attachmentTemplateEmbeddingGraph_isFunc d.base_function).1 entry)).1 - have eq := (d.template_entry_iff ⟨q, hq⟩ y).1 entry - rw [eq] at lower - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - obtain ⟨p, rfl⟩ := d.template_ideal ⟨q, hq⟩ x lower - exact ⟨p.val, p.property, d.template_entry p⟩ - -end PartitionPilot.Forcing.CodedPrincipalTile - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.CodedPrincipalTile +open Compression.RecursiveMaps +universe u +variable {P Q rP rQ μP μQ ell : ZFSet.{u}} +variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} +variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} +variable (d : CodedPrincipalTile old right g ell) + +noncomputable def decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : g.Node := + Classical.choose (d.encode_surjective x.val x.property) + +theorem encode_decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : d.encode (d.decode x) = x.val := + Classical.choose_spec (d.encode_surjective x.val x.property) + +theorem decode_encode (x : g.Node) : d.decode ⟨d.encode x, d.encode_mem x⟩ = x := + d.encode_injective (d.encode_decode _) + +noncomputable def encodingIso : Compression.MeetIso g.order d.meetOrder.toMeetOrder := + isoOfOrder (fun x => ⟨d.encode x, d.encode_mem x⟩) d.decode d.decode_encode + (fun x => Subtype.ext (d.encode_decode x)) d.le_encode + +noncomputable def decodingIso : Compression.MeetIso d.meetOrder.toMeetOrder g.order := + inverseIso d.encodingIso + +theorem encodingIso_value (x : g.Node) : + (d.encodingIso.toFun x).val = d.encode x := rfl + +theorem decodingIso_encode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : + d.encode (d.decodingIso.toFun x) = x.val := d.encode_decode x + +theorem vertex_cover (z : ZFSet.{u}) (hz : z ∈ d.carrier) : + (∃ p ∈ P, ZFSet.pair p z ∈ attachmentOldEmbeddingGraph P) ∨ + ∃ q ∈ Q, ZFSet.pair q z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + rcases g.cover x with ⟨p, rfl⟩ | ⟨q, rfl⟩ + · exact Or.inl ⟨p.val, p.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨p.property, rfl⟩⟩ + · exact Or.inr ⟨q.val, q.property, d.template_entry q⟩ + +theorem cross_meet_entry (p : {p : ZFSet.{u} // p ∈ P}) + (q : {q : ZFSet.{u} // q ∈ Q}) : + ZFSet.pair (ZFSet.pair p.val (d.encode (g.right.toFun q))) + (old.toMeetOrder.meet p (g.shadow q)).val ∈ d.meetGraph := by + have entry := d.encoded_meet_entry (g.left.toFun p) (g.right.toFun q) + rw [g.cross_meet] at entry + exact entry + +theorem old_graph_ideal {p z : ZFSet.{u}} (hp : p ∈ P) (hz : z ∈ d.carrier) + (lower : ZFSet.pair z p ∈ d.order) : + ∃ x ∈ P, ZFSet.pair x z ∈ attachmentOldEmbeddingGraph P := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + obtain ⟨q, rfl⟩ := d.old_ideal ⟨p, hp⟩ x lower + exact ⟨q.val, q.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨q.property, rfl⟩⟩ + +theorem template_graph_ideal {q y z : ZFSet.{u}} + (entry : ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val) + (hz : z ∈ d.carrier) (lower : ZFSet.pair z y ∈ d.order) : + ∃ x ∈ Q, ZFSet.pair x z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by + have hq := (ZFSet.pair_mem_prod.1 ((attachmentTemplateEmbeddingGraph_isFunc d.base_function).1 entry)).1 + have eq := (d.template_entry_iff ⟨q, hq⟩ y).1 entry + rw [eq] at lower + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + obtain ⟨p, rfl⟩ := d.template_ideal ⟨q, hq⟩ x lower + exact ⟨p.val, p.property, d.template_entry p⟩ + +end PartitionPilot.Forcing.CodedPrincipalTile + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RationalCodeLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RationalCodeLaws.lean index 60b1d5d361346ec655486cc71e2ccbb0861bcb98..f40ff43fb82babded064509aa41c39e36e2118c2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RationalCodeLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RationalCodeLaws.lean @@ -1,169 +1,169 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.CodedDenseOrders - -namespace OAI - - -namespace PartitionPilot.Forcing - -open SetRealization Compression.RecursiveMaps.RationalHeights -universe u - -theorem fractionEquivalence_code : EquivalenceRelationCode fractionCarrier.{u} fractionEquivGraph := by - refine ⟨fractionEquivGraph_subset, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 hx - exact (pair_mem_fractionEquivGraph a a).2 rfl - · intro x y hxy - have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy) - obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1 - obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2 - exact (pair_mem_fractionEquivGraph b a).2 ((pair_mem_fractionEquivGraph a b).1 hxy).symm - · intro x y z hxy hyz - have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy) - have zmem := (ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hyz)).2 - obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1 - obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2 - obtain ⟨d, rfl⟩ := (mem_fractionCarrier z).1 zmem - exact (pair_mem_fractionEquivGraph a d).2 (Fraction.equiv_trans - ((pair_mem_fractionEquivGraph a b).1 hxy) ((pair_mem_fractionEquivGraph b d).1 hyz)) - -noncomputable def rationalCarrier (c : ZFSet.{u}) : ZFSet.{u} := - canonicalRepresentatives fractionCarrier fractionEquivGraph c - -theorem rationalCarrier_subset (c : ZFSet.{u}) : rationalCarrier c ⊆ fractionCarrier := - canonicalRepresentatives_subset _ _ _ - -noncomputable def rationalEncode {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : ZFSet.{u} := - Classical.choose (canonical_exists_unique fractionEquivalence_code hc - (fractionEncode_mem (Rational.representative r))) - -theorem rationalEncode_spec {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : - rationalEncode hc r ∈ rationalCarrier c ∧ - ZFSet.pair (fractionEncode (Rational.representative r)) (rationalEncode hc r) ∈ fractionEquivGraph := - (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc - (fractionEncode_mem (Rational.representative r)))).1 - -theorem rationalEncode_class {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : - ∃ a : Fraction, fractionEncode a = rationalEncode hc r ∧ Rational.mk a = r := by - have spec := rationalEncode_spec hc r - obtain ⟨a, ha⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c spec.1) - refine ⟨a, ha, ?_⟩ - rw [← ha] at spec - have eq := (Rational.mk_eq_iff _ _).2 ((pair_mem_fractionEquivGraph _ _).1 spec.2) - exact eq.symm.trans (Rational.representative_eq r) - -theorem rationalEncode_injective {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) : Function.Injective (rationalEncode hc) := by - intro r s eq - obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r - obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s - have ab := fractionEncode_injective (ha.trans (eq.trans hb.symm)) - exact ar.symm.trans ((congrArg Rational.mk ab).trans bs) - -theorem rationalEncode_of_canonical {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) (a : Fraction) - (ha : fractionEncode a ∈ rationalCarrier c) : - rationalEncode hc (Rational.mk a) = fractionEncode a := by - have unique := (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc - (fractionEncode_mem (Rational.representative (Rational.mk a))))).2 - exact (unique (fractionEncode a) ⟨ha, - (pair_mem_fractionEquivGraph _ _).2 (Rational.representative_equiv a)⟩).symm - -noncomputable def rationalPresentation {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) : Presentation (ULift.{u} Rational) where - carrier := rationalCarrier c - encode r := rationalEncode hc r.down - injective := fun _ _ eq => ULift.ext _ _ (rationalEncode_injective hc eq) - mem_carrier x := by - constructor - · intro hx - obtain ⟨a, rfl⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c hx) - exact ⟨⟨Rational.mk a⟩, rationalEncode_of_canonical hc a hx⟩ - · rintro ⟨r, rfl⟩ - exact (rationalEncode_spec hc r.down).1 - -noncomputable def rationalLtGraph (c : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ ZFSet.prod (rationalCarrier c) (rationalCarrier c)) fractionLtGraph - -theorem rationalLtGraph_subset (c : ZFSet.{u}) : - rationalLtGraph c ⊆ ZFSet.prod (rationalCarrier c) (rationalCarrier c) := - fun _ h => (ZFSet.mem_sep.1 h).2 - -theorem pair_mem_rationalLtGraph {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) (r s : Rational) : - ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ rationalLtGraph c ↔ Rational.lt r s := by - have first := (rationalEncode_spec hc r).1 - have second := (rationalEncode_spec hc s).1 - rw [rationalLtGraph, ZFSet.mem_sep] - have lookup : ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ fractionLtGraph ↔ - Rational.lt r s := by - obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r - obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s - rw [← ha, ← hb, pair_mem_fractionLtGraph, ← ar, ← bs] - exact Iff.rfl - exact ⟨fun h => lookup.1 h.1, - fun h => ⟨lookup.2 h, ZFSet.pair_mem_prod.2 ⟨first, second⟩⟩⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -open Compression.RecursiveMaps.RationalHeights -universe u - -theorem rational_denseOrderCode {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) : - DenseOrderCode (rationalCarrier c) (rationalLtGraph c) := by - refine ⟨⟨rationalLtGraph_subset c, ?_, ?_, ?_⟩, ?_⟩ - · intro x hx - obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx - exact fun h => Rational.irrefl a.down ((pair_mem_rationalLtGraph hc _ _).1 h) - · intro x y z xy yz - have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy) - have hz := (ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c yz)).2 - obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1 - obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2 - obtain ⟨d, rfl⟩ := ((rationalPresentation hc).mem_carrier z).1 hz - exact (pair_mem_rationalLtGraph hc _ _).2 (Rational.trans - ((pair_mem_rationalLtGraph hc _ _).1 xy) ((pair_mem_rationalLtGraph hc _ _).1 yz)) - · intro x hx y hy - obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 hy - rcases Rational.compare a.down b.down with less | same | more - · exact Or.inl ((pair_mem_rationalLtGraph hc _ _).2 less) - · exact Or.inr (Or.inl (congrArg (rationalEncode hc) same)) - · exact Or.inr (Or.inr ((pair_mem_rationalLtGraph hc _ _).2 more)) - · intro x y xy - have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy) - obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1 - obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2 - obtain ⟨d, ad, db⟩ := Rational.between _ _ ((pair_mem_rationalLtGraph hc _ _).1 xy) - exact ⟨rationalEncode hc d, (rationalEncode_spec hc d).1, - (pair_mem_rationalLtGraph hc _ _).2 ad, (pair_mem_rationalLtGraph hc _ _).2 db⟩ - -theorem rationalCarrier_nonempty {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) : ∃ x, x ∈ rationalCarrier c := - ⟨rationalEncode hc (Rational.mk ⟨0, 1, by decide⟩), (rationalEncode_spec hc _).1⟩ - -theorem rational_no_endpoints {c : ZFSet.{u}} - (hc : InjectionCode fractionCarrier ZFSet.omega c) : - ∀ x ∈ rationalCarrier c, - (∃ y ∈ rationalCarrier c, ZFSet.pair y x ∈ rationalLtGraph c) ∧ - (∃ y ∈ rationalCarrier c, ZFSet.pair x y ∈ rationalLtGraph c) := by - intro x hx - obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx - obtain ⟨b, ba⟩ := Rational.unbounded_below a.down - obtain ⟨d, ad⟩ := Rational.unbounded_above a.down - exact ⟨⟨rationalEncode hc b, (rationalEncode_spec hc b).1, - (pair_mem_rationalLtGraph hc _ _).2 ba⟩, - ⟨rationalEncode hc d, (rationalEncode_spec hc d).1, - (pair_mem_rationalLtGraph hc _ _).2 ad⟩⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.CodedDenseOrders + +namespace OAI + + +namespace PartitionPilot.Forcing + +open SetRealization Compression.RecursiveMaps.RationalHeights +universe u + +theorem fractionEquivalence_code : EquivalenceRelationCode fractionCarrier.{u} fractionEquivGraph := by + refine ⟨fractionEquivGraph_subset, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 hx + exact (pair_mem_fractionEquivGraph a a).2 rfl + · intro x y hxy + have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy) + obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1 + obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2 + exact (pair_mem_fractionEquivGraph b a).2 ((pair_mem_fractionEquivGraph a b).1 hxy).symm + · intro x y z hxy hyz + have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy) + have zmem := (ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hyz)).2 + obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1 + obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2 + obtain ⟨d, rfl⟩ := (mem_fractionCarrier z).1 zmem + exact (pair_mem_fractionEquivGraph a d).2 (Fraction.equiv_trans + ((pair_mem_fractionEquivGraph a b).1 hxy) ((pair_mem_fractionEquivGraph b d).1 hyz)) + +noncomputable def rationalCarrier (c : ZFSet.{u}) : ZFSet.{u} := + canonicalRepresentatives fractionCarrier fractionEquivGraph c + +theorem rationalCarrier_subset (c : ZFSet.{u}) : rationalCarrier c ⊆ fractionCarrier := + canonicalRepresentatives_subset _ _ _ + +noncomputable def rationalEncode {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : ZFSet.{u} := + Classical.choose (canonical_exists_unique fractionEquivalence_code hc + (fractionEncode_mem (Rational.representative r))) + +theorem rationalEncode_spec {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : + rationalEncode hc r ∈ rationalCarrier c ∧ + ZFSet.pair (fractionEncode (Rational.representative r)) (rationalEncode hc r) ∈ fractionEquivGraph := + (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc + (fractionEncode_mem (Rational.representative r)))).1 + +theorem rationalEncode_class {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : + ∃ a : Fraction, fractionEncode a = rationalEncode hc r ∧ Rational.mk a = r := by + have spec := rationalEncode_spec hc r + obtain ⟨a, ha⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c spec.1) + refine ⟨a, ha, ?_⟩ + rw [← ha] at spec + have eq := (Rational.mk_eq_iff _ _).2 ((pair_mem_fractionEquivGraph _ _).1 spec.2) + exact eq.symm.trans (Rational.representative_eq r) + +theorem rationalEncode_injective {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) : Function.Injective (rationalEncode hc) := by + intro r s eq + obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r + obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s + have ab := fractionEncode_injective (ha.trans (eq.trans hb.symm)) + exact ar.symm.trans ((congrArg Rational.mk ab).trans bs) + +theorem rationalEncode_of_canonical {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) (a : Fraction) + (ha : fractionEncode a ∈ rationalCarrier c) : + rationalEncode hc (Rational.mk a) = fractionEncode a := by + have unique := (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc + (fractionEncode_mem (Rational.representative (Rational.mk a))))).2 + exact (unique (fractionEncode a) ⟨ha, + (pair_mem_fractionEquivGraph _ _).2 (Rational.representative_equiv a)⟩).symm + +noncomputable def rationalPresentation {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) : Presentation (ULift.{u} Rational) where + carrier := rationalCarrier c + encode r := rationalEncode hc r.down + injective := fun _ _ eq => ULift.ext _ _ (rationalEncode_injective hc eq) + mem_carrier x := by + constructor + · intro hx + obtain ⟨a, rfl⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c hx) + exact ⟨⟨Rational.mk a⟩, rationalEncode_of_canonical hc a hx⟩ + · rintro ⟨r, rfl⟩ + exact (rationalEncode_spec hc r.down).1 + +noncomputable def rationalLtGraph (c : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ ZFSet.prod (rationalCarrier c) (rationalCarrier c)) fractionLtGraph + +theorem rationalLtGraph_subset (c : ZFSet.{u}) : + rationalLtGraph c ⊆ ZFSet.prod (rationalCarrier c) (rationalCarrier c) := + fun _ h => (ZFSet.mem_sep.1 h).2 + +theorem pair_mem_rationalLtGraph {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) (r s : Rational) : + ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ rationalLtGraph c ↔ Rational.lt r s := by + have first := (rationalEncode_spec hc r).1 + have second := (rationalEncode_spec hc s).1 + rw [rationalLtGraph, ZFSet.mem_sep] + have lookup : ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ fractionLtGraph ↔ + Rational.lt r s := by + obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r + obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s + rw [← ha, ← hb, pair_mem_fractionLtGraph, ← ar, ← bs] + exact Iff.rfl + exact ⟨fun h => lookup.1 h.1, + fun h => ⟨lookup.2 h, ZFSet.pair_mem_prod.2 ⟨first, second⟩⟩⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +open Compression.RecursiveMaps.RationalHeights +universe u + +theorem rational_denseOrderCode {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) : + DenseOrderCode (rationalCarrier c) (rationalLtGraph c) := by + refine ⟨⟨rationalLtGraph_subset c, ?_, ?_, ?_⟩, ?_⟩ + · intro x hx + obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx + exact fun h => Rational.irrefl a.down ((pair_mem_rationalLtGraph hc _ _).1 h) + · intro x y z xy yz + have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy) + have hz := (ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c yz)).2 + obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1 + obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2 + obtain ⟨d, rfl⟩ := ((rationalPresentation hc).mem_carrier z).1 hz + exact (pair_mem_rationalLtGraph hc _ _).2 (Rational.trans + ((pair_mem_rationalLtGraph hc _ _).1 xy) ((pair_mem_rationalLtGraph hc _ _).1 yz)) + · intro x hx y hy + obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 hy + rcases Rational.compare a.down b.down with less | same | more + · exact Or.inl ((pair_mem_rationalLtGraph hc _ _).2 less) + · exact Or.inr (Or.inl (congrArg (rationalEncode hc) same)) + · exact Or.inr (Or.inr ((pair_mem_rationalLtGraph hc _ _).2 more)) + · intro x y xy + have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy) + obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1 + obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2 + obtain ⟨d, ad, db⟩ := Rational.between _ _ ((pair_mem_rationalLtGraph hc _ _).1 xy) + exact ⟨rationalEncode hc d, (rationalEncode_spec hc d).1, + (pair_mem_rationalLtGraph hc _ _).2 ad, (pair_mem_rationalLtGraph hc _ _).2 db⟩ + +theorem rationalCarrier_nonempty {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) : ∃ x, x ∈ rationalCarrier c := + ⟨rationalEncode hc (Rational.mk ⟨0, 1, by decide⟩), (rationalEncode_spec hc _).1⟩ + +theorem rational_no_endpoints {c : ZFSet.{u}} + (hc : InjectionCode fractionCarrier ZFSet.omega c) : + ∀ x ∈ rationalCarrier c, + (∃ y ∈ rationalCarrier c, ZFSet.pair y x ∈ rationalLtGraph c) ∧ + (∃ y ∈ rationalCarrier c, ZFSet.pair x y ∈ rationalLtGraph c) := by + intro x hx + obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx + obtain ⟨b, ba⟩ := Rational.unbounded_below a.down + obtain ⟨d, ad⟩ := Rational.unbounded_above a.down + exact ⟨⟨rationalEncode hc b, (rationalEncode_spec hc b).1, + (pair_mem_rationalLtGraph hc _ _).2 ba⟩, + ⟨rationalEncode hc d, (rationalEncode_spec hc d).1, + (pair_mem_rationalLtGraph hc _ _).2 ad⟩⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawCheckFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawCheckFormulas.lean index 359cfa88ba05eeb0983404e2f8d5c6f8ac81a43b..b460dc257aa6e3916f11a9c5f0eaca6a92be1489 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawCheckFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawCheckFormulas.lean @@ -1,123 +1,123 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSymmetricPowerSet - -namespace OAI - - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} (s : Presentation P) - -theorem mem_check_code (one : P) (x z : ZFSet.{u}) : - z ∈ (check s one x).val ↔ ∃ y ∈ x, z = ZFSet.pair (check s one y).val (s.encode one) := by - rw [check] - change z ∈ ZFSet.range _ ↔ _ - rw [ZFSet.mem_range] - constructor - · rintro ⟨y, eq⟩ - exact ⟨y.val, y.property, eq.symm⟩ - · rintro ⟨y, hy, eq⟩ - exact ⟨⟨y, hy⟩, eq.symm⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.SetFormula - -def checkStepFormula {n : Nat} (top r x y : Fin n) : SetFormula n := - .conj - (.all (imp (.mem 0 x.succ) (ex (.conj (pairMembershipFormula 1 0 r.succ.succ) - (pairMembershipFormula 0 top.succ.succ y.succ.succ))))) - (.all (imp (.mem 0 y.succ) (ex (ex (.conj (.mem 1 x.succ.succ.succ) - (.conj (pairMembershipFormula 1 0 r.succ.succ.succ) - (orderedPairFormula 2 0 top.succ.succ.succ))))))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -def RawCheckStep (top R x y : ZFSet.{u}) : Prop := - (∀ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ ZFSet.pair w top ∈ y) ∧ - (∀ z ∈ y, ∃ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ z = ZFSet.pair w top) - -theorem rawCheckStep_mono {top R S x y : ZFSet.{u}} (sub : R ⊆ S) - (h : M.RawCheckStep top R x y) : M.RawCheckStep top S x y := by - constructor - · intro v hv - obtain ⟨w, hw, rel, entry⟩ := h.1 v hv - exact ⟨w, hw, sub rel, entry⟩ - · intro z hz - obtain ⟨v, hv, w, hw, rel, eq⟩ := h.2 z hz - exact ⟨v, hv, w, hw, sub rel, eq⟩ - -theorem realize_checkStepFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n : Nat} (top r x y : Fin n) (env : Fin n → ZFSet.{u}) - (htop : env top ∈ M.sets) (hr : env r ∈ M.sets) - (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : - Realize M.sets (checkStepFormula top r x y) env ↔ - M.RawCheckStep (env top) (env r) (env x) (env y) := by - change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ - constructor - · rintro ⟨forward, backward⟩ - constructor - · intro v hv - have step := (realize_imp M.sets _ _ _).1 (forward v (M.transitive hx hv)) hv - obtain ⟨w, hw, rel, entry⟩ := (realize_ex M.sets _ _).1 step - let e := extend w (extend v env) - exact ⟨w, hw, - (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e (M.transitive hx hv) hw hr).1 rel, - (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).1 entry⟩ - · intro z hz - have step := (realize_imp M.sets _ _ _).1 (backward z (M.transitive hy hz)) hz - obtain ⟨v, hv, step⟩ := (realize_ex M.sets _ _).1 step - obtain ⟨w, hw, member, rel, shape⟩ := (realize_ex M.sets _ _).1 step - let e := extend w (extend v (extend z env)) - exact ⟨v, member, w, hw, - (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e hv hw hr).1 rel, - (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e (M.transitive hy hz) hw htop).1 shape⟩ - · rintro ⟨forward, backward⟩ - constructor - · intro v hv - rw [realize_imp] - intro member - obtain ⟨w, hw, rel, entry⟩ := forward v member - rw [realize_ex] - let e := extend w (extend v env) - exact ⟨w, hw, - (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e hv hw hr).2 rel, - (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).2 entry⟩ - · intro z hz - rw [realize_imp] - intro member - obtain ⟨v, hv, w, hw, rel, shape⟩ := backward z member - rw [realize_ex] - refine ⟨v, M.transitive hx hv, ?_⟩ - rw [realize_ex] - let e := extend w (extend v (extend z env)) - exact ⟨w, hw, hv, - (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e (M.transitive hx hv) hw hr).2 rel, - (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e hz hw htop).2 shape⟩ - -theorem rawCheckStep_eq {P : Type u} (s : Presentation P) (one : P) {R x y : ZFSet.{u}} - (step : M.RawCheckStep (s.encode one) R x y) - (children : ∀ v ∈ x, ∀ w ∈ M.sets, ZFSet.pair v w ∈ R → w = (Name.check s one v).val) : - y = (Name.check s one x).val := by - apply ZFSet.ext - intro z - rw [Name.mem_check_code] - constructor - · intro hz - obtain ⟨v, hv, w, hw, rel, eq⟩ := step.2 z hz - exact ⟨v, hv, eq.trans (congrArg (fun q => ZFSet.pair q (s.encode one)) (children v hv w hw rel))⟩ - · rintro ⟨v, hv, rfl⟩ - obtain ⟨w, hw, rel, entry⟩ := step.1 v hv - rwa [children v hv w hw rel] at entry - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSymmetricPowerSet + +namespace OAI + + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} (s : Presentation P) + +theorem mem_check_code (one : P) (x z : ZFSet.{u}) : + z ∈ (check s one x).val ↔ ∃ y ∈ x, z = ZFSet.pair (check s one y).val (s.encode one) := by + rw [check] + change z ∈ ZFSet.range _ ↔ _ + rw [ZFSet.mem_range] + constructor + · rintro ⟨y, eq⟩ + exact ⟨y.val, y.property, eq.symm⟩ + · rintro ⟨y, hy, eq⟩ + exact ⟨⟨y, hy⟩, eq.symm⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.SetFormula + +def checkStepFormula {n : Nat} (top r x y : Fin n) : SetFormula n := + .conj + (.all (imp (.mem 0 x.succ) (ex (.conj (pairMembershipFormula 1 0 r.succ.succ) + (pairMembershipFormula 0 top.succ.succ y.succ.succ))))) + (.all (imp (.mem 0 y.succ) (ex (ex (.conj (.mem 1 x.succ.succ.succ) + (.conj (pairMembershipFormula 1 0 r.succ.succ.succ) + (orderedPairFormula 2 0 top.succ.succ.succ))))))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +def RawCheckStep (top R x y : ZFSet.{u}) : Prop := + (∀ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ ZFSet.pair w top ∈ y) ∧ + (∀ z ∈ y, ∃ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ z = ZFSet.pair w top) + +theorem rawCheckStep_mono {top R S x y : ZFSet.{u}} (sub : R ⊆ S) + (h : M.RawCheckStep top R x y) : M.RawCheckStep top S x y := by + constructor + · intro v hv + obtain ⟨w, hw, rel, entry⟩ := h.1 v hv + exact ⟨w, hw, sub rel, entry⟩ + · intro z hz + obtain ⟨v, hv, w, hw, rel, eq⟩ := h.2 z hz + exact ⟨v, hv, w, hw, sub rel, eq⟩ + +theorem realize_checkStepFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n : Nat} (top r x y : Fin n) (env : Fin n → ZFSet.{u}) + (htop : env top ∈ M.sets) (hr : env r ∈ M.sets) + (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : + Realize M.sets (checkStepFormula top r x y) env ↔ + M.RawCheckStep (env top) (env r) (env x) (env y) := by + change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ + constructor + · rintro ⟨forward, backward⟩ + constructor + · intro v hv + have step := (realize_imp M.sets _ _ _).1 (forward v (M.transitive hx hv)) hv + obtain ⟨w, hw, rel, entry⟩ := (realize_ex M.sets _ _).1 step + let e := extend w (extend v env) + exact ⟨w, hw, + (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e (M.transitive hx hv) hw hr).1 rel, + (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).1 entry⟩ + · intro z hz + have step := (realize_imp M.sets _ _ _).1 (backward z (M.transitive hy hz)) hz + obtain ⟨v, hv, step⟩ := (realize_ex M.sets _ _).1 step + obtain ⟨w, hw, member, rel, shape⟩ := (realize_ex M.sets _ _).1 step + let e := extend w (extend v (extend z env)) + exact ⟨v, member, w, hw, + (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e hv hw hr).1 rel, + (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e (M.transitive hy hz) hw htop).1 shape⟩ + · rintro ⟨forward, backward⟩ + constructor + · intro v hv + rw [realize_imp] + intro member + obtain ⟨w, hw, rel, entry⟩ := forward v member + rw [realize_ex] + let e := extend w (extend v env) + exact ⟨w, hw, + (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e hv hw hr).2 rel, + (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).2 entry⟩ + · intro z hz + rw [realize_imp] + intro member + obtain ⟨v, hv, w, hw, rel, shape⟩ := backward z member + rw [realize_ex] + refine ⟨v, M.transitive hx hv, ?_⟩ + rw [realize_ex] + let e := extend w (extend v (extend z env)) + exact ⟨w, hw, hv, + (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e (M.transitive hx hv) hw hr).2 rel, + (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e hz hw htop).2 shape⟩ + +theorem rawCheckStep_eq {P : Type u} (s : Presentation P) (one : P) {R x y : ZFSet.{u}} + (step : M.RawCheckStep (s.encode one) R x y) + (children : ∀ v ∈ x, ∀ w ∈ M.sets, ZFSet.pair v w ∈ R → w = (Name.check s one v).val) : + y = (Name.check s one x).val := by + apply ZFSet.ext + intro z + rw [Name.mem_check_code] + constructor + · intro hz + obtain ⟨v, hv, w, hw, rel, eq⟩ := step.2 z hz + exact ⟨v, hv, eq.trans (congrArg (fun q => ZFSet.pair q (s.encode one)) (children v hv w hw rel))⟩ + · rintro ⟨v, hv, rfl⟩ + obtain ⟨w, hw, rel, entry⟩ := step.1 v hv + rwa [children v hv w hw rel] at entry + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawRenameFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawRenameFormulas.lean index e89d61c697d4ccd942ad90946c232dafa73380c1..bc3b041c71057e21ffa1c2b0fe0232907db3f887 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawRenameFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RawRenameFormulas.lean @@ -1,141 +1,141 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def orientedPairFormula {n : Nat} (reverse : Bool) (x y r : Fin n) : SetFormula n := - if reverse then pairMembershipFormula y x r else pairMembershipFormula x y r - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_orientedPairFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n : Nat} (reverse : Bool) (x y r : Fin n) (env : Fin n → ZFSet.{u}) - (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) (hr : env r ∈ M.sets) : - Realize M.sets (orientedPairFormula reverse x y r) env ↔ - if reverse then ZFSet.pair (env y) (env x) ∈ env r else ZFSet.pair (env x) (env y) ∈ env r := by - cases reverse - · exact M.realize_pairMembershipFormula pairing x y r env hx hy hr - · exact M.realize_pairMembershipFormula pairing y x r env hy hx hr - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.SetFormula - -def renameMatchFormula {n : Nat} (reverse : Bool) (c f r x y : Fin n) : SetFormula n := - .all (allConditions c.succ (imp (pairMembershipFormula 1 0 x.succ.succ) - (ex (exConditions c.succ.succ.succ - (.conj (pairMembershipFormula 1 0 y.succ.succ.succ.succ) - (.conj (orientedPairFormula reverse 2 0 f.succ.succ.succ.succ) - (orientedPairFormula reverse 3 1 r.succ.succ.succ.succ))))))) - -def renameStepFormula {n : Nat} (c f r x y : Fin n) : SetFormula n := - .conj (renameMatchFormula false c f r x y) (renameMatchFormula true c f r y x) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -def RawRenameMatch (reverse : Bool) (f : P → P) (R x y : ZFSet.{u}) : Prop := - ∀ v ∈ M.sets, ∀ p, ZFSet.pair v (s.encode p) ∈ x → - ∃ w ∈ M.sets, ∃ q, ZFSet.pair w (s.encode q) ∈ y ∧ - (if reverse then f q = p else f p = q) ∧ - (if reverse then ZFSet.pair w v ∈ R else ZFSet.pair v w ∈ R) - -def RawRenameStep (f : P → P) (R x y : ZFSet.{u}) : Prop := - M.RawRenameMatch s false f R x y ∧ M.RawRenameMatch s true f R y x - -theorem rawRenameStep_mono (f : P → P) {R S x y : ZFSet.{u}} (sub : R ⊆ S) - (h : M.RawRenameStep s f R x y) : M.RawRenameStep s f S x y := by - constructor - · intro v hv p entry - obtain ⟨w, hw, q, matched, cond, rel⟩ := h.1 v hv p entry - exact ⟨w, hw, q, matched, cond, sub rel⟩ - · intro w hw q entry - obtain ⟨v, hv, p, matched, cond, rel⟩ := h.2 w hw q entry - exact ⟨v, hv, p, matched, cond, sub rel⟩ - -theorem realize_orientedMapFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - {n : Nat} (reverse : Bool) (i j k : Fin n) (env : Fin n → ZFSet.{u}) (p q : P) - (hi : env i = s.encode p) (hj : env j = s.encode q) (hk : env k = s.graph s f) : - Realize M.sets (orientedPairFormula reverse i j k) env ↔ - if reverse then f q = p else f p = q := by - rw [M.realize_orientedPairFormula pairing reverse i j k env - (hi ▸ M.transitive carrier (s.encode_mem p)) (hj ▸ M.transitive carrier (s.encode_mem q)) - (hk ▸ graph), hi, hj, hk] - cases reverse - · exact s.pair_mem_graph s f p q - · exact s.pair_mem_graph s f q p - -theorem realize_renameMatchFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - {n : Nat} (reverse : Bool) (c g r x y : Fin n) (env : Fin n → ZFSet.{u}) - (hc : env c = s.carrier) (hg : env g = s.graph s f) - (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : - Realize M.sets (renameMatchFormula reverse c g r x y) env ↔ - M.RawRenameMatch s reverse f (env r) (env x) (env y) := by - change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ - apply forall_congr' - intro v - apply forall_congr' - intro hv - rw [M.realize_allConditions s c.succ _ (extend v env) carrier hc] - apply forall_congr' - intro p - rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 x.succ.succ - (extend (s.encode p) (extend v env)) hv (M.transitive carrier (s.encode_mem p)) hx] - apply forall_congr' - intro _ - rw [realize_ex] - apply exists_congr - intro w - apply and_congr_right - intro hw - rw [M.realize_exConditions s c.succ.succ.succ _ (extend w (extend (s.encode p) (extend v env))) - carrier hc] - apply exists_congr - intro q - let e := extend (s.encode q) (extend w (extend (s.encode p) (extend v env))) - change (Realize M.sets _ e ∧ Realize M.sets _ e ∧ Realize M.sets _ e) ↔ _ - rw [M.realize_pairMembershipFormula pairing 1 0 y.succ.succ.succ.succ e hw - (M.transitive carrier (s.encode_mem q)) hy, - M.realize_orientedMapFormula s pairing carrier f graph reverse 2 0 g.succ.succ.succ.succ e p q rfl rfl hg, - M.realize_orientedPairFormula pairing reverse 3 1 r.succ.succ.succ.succ e hv hw hr] - rfl - -theorem realize_renameStepFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - {n : Nat} (c g r x y : Fin n) (env : Fin n → ZFSet.{u}) - (hc : env c = s.carrier) (hg : env g = s.graph s f) - (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : - Realize M.sets (renameStepFormula c g r x y) env ↔ - M.RawRenameStep s f (env r) (env x) (env y) := by - change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ - rw [M.realize_renameMatchFormula s pairing carrier f graph false c g r x y env hc hg hr hx hy, - M.realize_renameMatchFormula s pairing carrier f graph true c g r y x env hc hg hr hy hx] - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def orientedPairFormula {n : Nat} (reverse : Bool) (x y r : Fin n) : SetFormula n := + if reverse then pairMembershipFormula y x r else pairMembershipFormula x y r + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_orientedPairFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n : Nat} (reverse : Bool) (x y r : Fin n) (env : Fin n → ZFSet.{u}) + (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) (hr : env r ∈ M.sets) : + Realize M.sets (orientedPairFormula reverse x y r) env ↔ + if reverse then ZFSet.pair (env y) (env x) ∈ env r else ZFSet.pair (env x) (env y) ∈ env r := by + cases reverse + · exact M.realize_pairMembershipFormula pairing x y r env hx hy hr + · exact M.realize_pairMembershipFormula pairing y x r env hy hx hr + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.SetFormula + +def renameMatchFormula {n : Nat} (reverse : Bool) (c f r x y : Fin n) : SetFormula n := + .all (allConditions c.succ (imp (pairMembershipFormula 1 0 x.succ.succ) + (ex (exConditions c.succ.succ.succ + (.conj (pairMembershipFormula 1 0 y.succ.succ.succ.succ) + (.conj (orientedPairFormula reverse 2 0 f.succ.succ.succ.succ) + (orientedPairFormula reverse 3 1 r.succ.succ.succ.succ))))))) + +def renameStepFormula {n : Nat} (c f r x y : Fin n) : SetFormula n := + .conj (renameMatchFormula false c f r x y) (renameMatchFormula true c f r y x) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +def RawRenameMatch (reverse : Bool) (f : P → P) (R x y : ZFSet.{u}) : Prop := + ∀ v ∈ M.sets, ∀ p, ZFSet.pair v (s.encode p) ∈ x → + ∃ w ∈ M.sets, ∃ q, ZFSet.pair w (s.encode q) ∈ y ∧ + (if reverse then f q = p else f p = q) ∧ + (if reverse then ZFSet.pair w v ∈ R else ZFSet.pair v w ∈ R) + +def RawRenameStep (f : P → P) (R x y : ZFSet.{u}) : Prop := + M.RawRenameMatch s false f R x y ∧ M.RawRenameMatch s true f R y x + +theorem rawRenameStep_mono (f : P → P) {R S x y : ZFSet.{u}} (sub : R ⊆ S) + (h : M.RawRenameStep s f R x y) : M.RawRenameStep s f S x y := by + constructor + · intro v hv p entry + obtain ⟨w, hw, q, matched, cond, rel⟩ := h.1 v hv p entry + exact ⟨w, hw, q, matched, cond, sub rel⟩ + · intro w hw q entry + obtain ⟨v, hv, p, matched, cond, rel⟩ := h.2 w hw q entry + exact ⟨v, hv, p, matched, cond, sub rel⟩ + +theorem realize_orientedMapFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + {n : Nat} (reverse : Bool) (i j k : Fin n) (env : Fin n → ZFSet.{u}) (p q : P) + (hi : env i = s.encode p) (hj : env j = s.encode q) (hk : env k = s.graph s f) : + Realize M.sets (orientedPairFormula reverse i j k) env ↔ + if reverse then f q = p else f p = q := by + rw [M.realize_orientedPairFormula pairing reverse i j k env + (hi ▸ M.transitive carrier (s.encode_mem p)) (hj ▸ M.transitive carrier (s.encode_mem q)) + (hk ▸ graph), hi, hj, hk] + cases reverse + · exact s.pair_mem_graph s f p q + · exact s.pair_mem_graph s f q p + +theorem realize_renameMatchFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + {n : Nat} (reverse : Bool) (c g r x y : Fin n) (env : Fin n → ZFSet.{u}) + (hc : env c = s.carrier) (hg : env g = s.graph s f) + (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : + Realize M.sets (renameMatchFormula reverse c g r x y) env ↔ + M.RawRenameMatch s reverse f (env r) (env x) (env y) := by + change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ + apply forall_congr' + intro v + apply forall_congr' + intro hv + rw [M.realize_allConditions s c.succ _ (extend v env) carrier hc] + apply forall_congr' + intro p + rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 x.succ.succ + (extend (s.encode p) (extend v env)) hv (M.transitive carrier (s.encode_mem p)) hx] + apply forall_congr' + intro _ + rw [realize_ex] + apply exists_congr + intro w + apply and_congr_right + intro hw + rw [M.realize_exConditions s c.succ.succ.succ _ (extend w (extend (s.encode p) (extend v env))) + carrier hc] + apply exists_congr + intro q + let e := extend (s.encode q) (extend w (extend (s.encode p) (extend v env))) + change (Realize M.sets _ e ∧ Realize M.sets _ e ∧ Realize M.sets _ e) ↔ _ + rw [M.realize_pairMembershipFormula pairing 1 0 y.succ.succ.succ.succ e hw + (M.transitive carrier (s.encode_mem q)) hy, + M.realize_orientedMapFormula s pairing carrier f graph reverse 2 0 g.succ.succ.succ.succ e p q rfl rfl hg, + M.realize_orientedPairFormula pairing reverse 3 1 r.succ.succ.succ.succ e hv hw hr] + rfl + +theorem realize_renameStepFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + {n : Nat} (c g r x y : Fin n) (env : Fin n → ZFSet.{u}) + (hc : env c = s.carrier) (hg : env g = s.graph s f) + (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : + Realize M.sets (renameStepFormula c g r x y) env ↔ + M.RawRenameStep s f (env r) (env x) (env y) := by + change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ + rw [M.realize_renameMatchFormula s pairing carrier f graph false c g r x y env hc hg hr hx hy, + M.realize_renameMatchFormula s pairing carrier f graph true c g r y x env hc hg hr hy hx] + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursiveActionRealization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursiveActionRealization.lean index 27c36fccbf1bf70e99b7937e0880634e118d5d39..3c5c84ffa952a2acf6d78e2bc35832ee757e3815 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursiveActionRealization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursiveActionRealization.lean @@ -1,227 +1,227 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -open Compression.RecursiveMaps -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -theorem next_upper (label : h.toInputs.Labels) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - next.templates.upper (h.nextIndex label) ⟨d.coding.encode x, d.coding.encode_mem x⟩ ↔ - h.toInputs.nextBatch.upper label x := by - change d.coding.encode x ∈ next.filter (h.nextIndex label) ↔ _ - rw [h.next_filter M next, mem_pushFilterCode] - constructor - · rintro ⟨_, a, ha, z, _, entry, lower⟩ - let a' : {a : ZFSet.{u} // a ∈ D} := ⟨a, (d.fiber label.2.val).filter.subset ha⟩ - have equal := (show FunctionGraphOn D (h.maps.value label.1) from - ⟨d.batchCarrier, (h.valid _ _ (h.maps.value_entry label.1)).injection.function⟩).unique - entry (h.toInputs_previous_entry label.1 a') - exact ⟨a', ha, (d.coding.le_encode _ x).1 (equal ▸ lower)⟩ - · rintro ⟨a, ha, lower⟩ - exact ⟨d.coding.encode_mem x, a.val, ha, - d.coding.encode ((h.toInputs.previous label.1).toFun a), d.coding.encode_mem _, - h.toInputs_previous_entry label.1 a, (d.coding.le_encode _ x).2 lower⟩ - -theorem nextFresh_shadow (q : h.toInputs.nextBatch.Fresh) : - (next.templates.shadow (h.nextFresh M next q)).val = - d.coding.encode (h.toInputs.nextBatch.shadow q) := by - have oldEntry := (d.fiber q.1.2.val).shadow_entry ⟨(), q.2⟩ - obtain ⟨_, _, c, hc, meetEntry, baseEntry⟩ := - (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).1 oldEntry - apply Eq.symm - apply next.freshCode_shadow_value (h.nextFresh M next q) - apply (next.batch_shadow_entry_iff (h.nextIndex q.1) q.2.val.val _).2 - rw [h.next_space M next, h.next_meet M next, h.next_embed M next, h.next_anchor M next] - apply (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2 - refine ⟨q.2.val.property, d.coding.encode_mem _, c, hc, meetEntry, ?_⟩ - apply (pair_mem_relationCompose _ _ _ _ _ _ _).2 - refine ⟨mem_familyPointBound_of_entry (d.space_entry q.1.2.val) hc, - d.coding.encode_mem _, (d.templates.shadow ⟨q.1.2.val, q.2⟩).val, - (d.templates.shadow ⟨q.1.2.val, q.2⟩).property, baseEntry, ?_⟩ - exact h.toInputs_previous_entry q.1.1 (d.templates.shadow ⟨q.1.2.val, q.2⟩) - -noncomputable def nextNodes : - ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh → - {x : ZFSet.{u} // x ∈ d.batchCarrier} ⊕ next.templates.Fresh - | .inl x => .inl ⟨d.coding.encode x, d.coding.encode_mem x⟩ - | .inr q => .inr (h.nextFresh M next q) - -noncomputable def nextEncode - (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : - ZFSet.{u} := next.coding.encode (h.nextNodes M next x) - -theorem nextEncode_old (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - h.nextEncode M next (.inl x) = d.coding.encode x := rfl - -theorem nextEncode_fresh (q : h.toInputs.nextBatch.Fresh) : - h.nextEncode M next (.inr q) = ZFSet.pair d.batchCarrier - (ZFSet.pair (ZFSet.pair q.1.1.val q.1.2.val.val) q.2.val.val) := rfl - -theorem nextEncode_mem - (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : - h.nextEncode M next x ∈ next.batchCarrier := next.coding.encode_mem _ - -theorem nextNodes_injective : Function.Injective (h.nextNodes M next) := by - intro x y equal - cases x with - | inl x => - cases y with - | inl y => - exact congrArg Sum.inl (d.coding.encode_injective - (congrArg Subtype.val (Sum.inl.inj equal))) - | inr y => cases equal - | inr x => - cases y with - | inl y => cases equal - | inr y => exact congrArg Sum.inr (h.nextFresh_injective M next (Sum.inr.inj equal)) - -theorem nextNodes_surjective : Function.Surjective (h.nextNodes M next) := by - intro x - cases x with - | inl x => - obtain ⟨y, equal⟩ := d.coding.encode_surjective x.val x.property - exact ⟨.inl y, congrArg Sum.inl (Subtype.ext equal)⟩ - | inr q => - obtain ⟨p, equal⟩ := h.nextFresh_surjective M next q - exact ⟨.inr p, congrArg Sum.inr equal⟩ - -theorem nextEncode_injective : Function.Injective (h.nextEncode M next) := - fun _ _ equal => h.nextNodes_injective M next (next.coding.encode_injective equal) - -theorem nextEncode_surjective : ∀ z ∈ next.batchCarrier, - ∃ x, h.nextEncode M next x = z := by - intro z hz - obtain ⟨y, equal⟩ := next.coding.encode_surjective z hz - obtain ⟨x, rfl⟩ := h.nextNodes_surjective M next y - exact ⟨x, equal⟩ - -theorem next_le_encode - (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : - ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y) ∈ next.batchOrder ↔ - h.toInputs.nextBatch.extension.le x y := by - change ZFSet.pair (next.coding.encode (h.nextNodes M next x)) - (next.coding.encode (h.nextNodes M next y)) ∈ next.batchOrder ↔ _ - rw [next.coding.le_encode] - cases x with - | inl x => - cases y with - | inl y => exact d.coding.le_encode x y - | inr q => - change ZFSet.pair (d.coding.encode x) (next.templates.shadow (h.nextFresh M next q)).val ∈ - d.batchOrder ↔ d.templates.extension.le x (h.toInputs.nextBatch.shadow q) - rw [h.nextFresh_shadow M next] - exact d.coding.le_encode x _ - | inr q => - cases y with - | inl y => exact h.next_upper M next q.1 y - | inr t => - change (next.templates.Inside (h.nextFresh M next q) (h.nextFresh M next t) ∨ - next.templates.upper (h.nextIndex q.1) (next.templates.shadow (h.nextFresh M next t))) ↔ - (h.toInputs.nextBatch.Inside q t ∨ - h.toInputs.nextBatch.upper q.1 (h.toInputs.nextBatch.shadow t)) - apply or_congr (h.nextFresh_inside_iff M next q t) - have equal : next.templates.shadow (h.nextFresh M next t) = - ⟨d.coding.encode (h.toInputs.nextBatch.shadow t), d.coding.encode_mem _⟩ := - Subtype.ext (h.nextFresh_shadow M next t) - rw [equal] - exact h.next_upper M next q.1 _ - -theorem next_meet_entry - (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : - ZFSet.pair (ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y)) - (h.nextEncode M next (h.toInputs.nextBatch.extension.meet x y)) ∈ next.batchMeetGraph := by - apply next.batch_meetOrder.pair_iff.2 - refine ⟨h.nextEncode_mem M next x, h.nextEncode_mem M next y, h.nextEncode_mem M next _, - (h.next_le_encode M next _ x).2 (h.toInputs.nextBatch.extension.meet_le_left x y), - (h.next_le_encode M next _ y).2 (h.toInputs.nextBatch.extension.meet_le_right x y), ?_⟩ - intro z hz zx zy - obtain ⟨w, rfl⟩ := h.nextEncode_surjective M next z hz - exact (h.next_le_encode M next _ _).2 (h.toInputs.nextBatch.extension.le_meet - ((h.next_le_encode M next _ _).1 zx) ((h.next_le_encode M next _ _).1 zy)) - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - - - -namespace PartitionPilot.Forcing.CodedRecursiveTaskAction - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (s : CodedRecursiveTaskAction h T) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -theorem nextAction_entry (g : {g : ZFSet.{u} // g ∈ G}) - (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : - ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x)) - (h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x)) ∈ h.nextActionGraph T := by - cases x with - | inl x => - rw [(s.toTaskSymmetry g).nextIso_old, h.nextEncode_old, h.nextEncode_old] - exact (h.nextAction_old_iff (d.coding.encode_mem x)).2 (s.toTaskSymmetry_current_entry g x) - | inr q => - rw [(s.toTaskSymmetry g).nextIso_fresh, h.nextEncode_fresh, h.nextEncode_fresh] - exact h.nextAction_fresh_entry s.taskAction s.source - (s.toTaskSymmetry_perm_entry g q.1.1) (next.freshCode_mem (h.nextFresh M next q)) - -theorem nextAction_entry_iff (g : {g : ZFSet.{u} // g ∈ G}) - (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) - (y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x)) y ∈ h.nextActionGraph T ↔ - y = h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x) := by - constructor - · intro entry - exact (h.nextAction_setAction s.taskAction s.source M next).entry_unique entry - (s.nextAction_entry M next g x) - · intro equal - exact equal.symm ▸ s.nextAction_entry M next g x - -include s in -theorem nextAction_order_iff {g x y x' y' : ZFSet.{u}} - (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T) - (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T) : - ZFSet.pair x' y' ∈ next.batchOrder ↔ ZFSet.pair x y ∈ next.batchOrder := by - have sx := (h.nextAction_setAction s.taskAction s.source M next).entry_shape first - have sy := (h.nextAction_setAction s.taskAction s.source M next).entry_shape second - let actor : {g : ZFSet.{u} // g ∈ G} := ⟨g, sx.1⟩ - obtain ⟨a, rfl⟩ := h.nextEncode_surjective M next x sx.2.1 - obtain ⟨b, rfl⟩ := h.nextEncode_surjective M next y sy.2.1 - rw [(s.nextAction_entry_iff M next actor a x').1 first, - (s.nextAction_entry_iff M next actor b y').1 second, h.next_le_encode, h.next_le_encode] - exact (s.toTaskSymmetry actor).nextIso.le_iff a b - -include s in -theorem nextAction_code : - PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) where - function := (h.nextAction_setAction s.taskAction s.source M next).function - one := (h.nextAction_setAction s.taskAction s.source M next).one - mul := (h.nextAction_setAction s.taskAction s.source M next).mul - monotone := fun _ _ _ _ _ _ _ _ _ _ first second lower => - (s.nextAction_order_iff M next first second).2 lower - -include s in -theorem nextAction_map_meet {g x y z x' y' z' : ZFSet.{u}} - (meet : ZFSet.pair (ZFSet.pair x y) z ∈ next.batchMeetGraph) - (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T) - (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T) - (third : ZFSet.pair (ZFSet.pair g z) z' ∈ h.nextActionGraph T) : - ZFSet.pair (ZFSet.pair x' y') z' ∈ next.batchMeetGraph := - (s.nextAction_code M next).raw_map_meet h.group next.batch_meetOrder - ((h.nextAction_setAction s.taskAction s.source M next).entry_shape first).1 - meet first second third - -end PartitionPilot.Forcing.CodedRecursiveTaskAction - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +open Compression.RecursiveMaps +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +theorem next_upper (label : h.toInputs.Labels) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + next.templates.upper (h.nextIndex label) ⟨d.coding.encode x, d.coding.encode_mem x⟩ ↔ + h.toInputs.nextBatch.upper label x := by + change d.coding.encode x ∈ next.filter (h.nextIndex label) ↔ _ + rw [h.next_filter M next, mem_pushFilterCode] + constructor + · rintro ⟨_, a, ha, z, _, entry, lower⟩ + let a' : {a : ZFSet.{u} // a ∈ D} := ⟨a, (d.fiber label.2.val).filter.subset ha⟩ + have equal := (show FunctionGraphOn D (h.maps.value label.1) from + ⟨d.batchCarrier, (h.valid _ _ (h.maps.value_entry label.1)).injection.function⟩).unique + entry (h.toInputs_previous_entry label.1 a') + exact ⟨a', ha, (d.coding.le_encode _ x).1 (equal ▸ lower)⟩ + · rintro ⟨a, ha, lower⟩ + exact ⟨d.coding.encode_mem x, a.val, ha, + d.coding.encode ((h.toInputs.previous label.1).toFun a), d.coding.encode_mem _, + h.toInputs_previous_entry label.1 a, (d.coding.le_encode _ x).2 lower⟩ + +theorem nextFresh_shadow (q : h.toInputs.nextBatch.Fresh) : + (next.templates.shadow (h.nextFresh M next q)).val = + d.coding.encode (h.toInputs.nextBatch.shadow q) := by + have oldEntry := (d.fiber q.1.2.val).shadow_entry ⟨(), q.2⟩ + obtain ⟨_, _, c, hc, meetEntry, baseEntry⟩ := + (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).1 oldEntry + apply Eq.symm + apply next.freshCode_shadow_value (h.nextFresh M next q) + apply (next.batch_shadow_entry_iff (h.nextIndex q.1) q.2.val.val _).2 + rw [h.next_space M next, h.next_meet M next, h.next_embed M next, h.next_anchor M next] + apply (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2 + refine ⟨q.2.val.property, d.coding.encode_mem _, c, hc, meetEntry, ?_⟩ + apply (pair_mem_relationCompose _ _ _ _ _ _ _).2 + refine ⟨mem_familyPointBound_of_entry (d.space_entry q.1.2.val) hc, + d.coding.encode_mem _, (d.templates.shadow ⟨q.1.2.val, q.2⟩).val, + (d.templates.shadow ⟨q.1.2.val, q.2⟩).property, baseEntry, ?_⟩ + exact h.toInputs_previous_entry q.1.1 (d.templates.shadow ⟨q.1.2.val, q.2⟩) + +noncomputable def nextNodes : + ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh → + {x : ZFSet.{u} // x ∈ d.batchCarrier} ⊕ next.templates.Fresh + | .inl x => .inl ⟨d.coding.encode x, d.coding.encode_mem x⟩ + | .inr q => .inr (h.nextFresh M next q) + +noncomputable def nextEncode + (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : + ZFSet.{u} := next.coding.encode (h.nextNodes M next x) + +theorem nextEncode_old (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + h.nextEncode M next (.inl x) = d.coding.encode x := rfl + +theorem nextEncode_fresh (q : h.toInputs.nextBatch.Fresh) : + h.nextEncode M next (.inr q) = ZFSet.pair d.batchCarrier + (ZFSet.pair (ZFSet.pair q.1.1.val q.1.2.val.val) q.2.val.val) := rfl + +theorem nextEncode_mem + (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : + h.nextEncode M next x ∈ next.batchCarrier := next.coding.encode_mem _ + +theorem nextNodes_injective : Function.Injective (h.nextNodes M next) := by + intro x y equal + cases x with + | inl x => + cases y with + | inl y => + exact congrArg Sum.inl (d.coding.encode_injective + (congrArg Subtype.val (Sum.inl.inj equal))) + | inr y => cases equal + | inr x => + cases y with + | inl y => cases equal + | inr y => exact congrArg Sum.inr (h.nextFresh_injective M next (Sum.inr.inj equal)) + +theorem nextNodes_surjective : Function.Surjective (h.nextNodes M next) := by + intro x + cases x with + | inl x => + obtain ⟨y, equal⟩ := d.coding.encode_surjective x.val x.property + exact ⟨.inl y, congrArg Sum.inl (Subtype.ext equal)⟩ + | inr q => + obtain ⟨p, equal⟩ := h.nextFresh_surjective M next q + exact ⟨.inr p, congrArg Sum.inr equal⟩ + +theorem nextEncode_injective : Function.Injective (h.nextEncode M next) := + fun _ _ equal => h.nextNodes_injective M next (next.coding.encode_injective equal) + +theorem nextEncode_surjective : ∀ z ∈ next.batchCarrier, + ∃ x, h.nextEncode M next x = z := by + intro z hz + obtain ⟨y, equal⟩ := next.coding.encode_surjective z hz + obtain ⟨x, rfl⟩ := h.nextNodes_surjective M next y + exact ⟨x, equal⟩ + +theorem next_le_encode + (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : + ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y) ∈ next.batchOrder ↔ + h.toInputs.nextBatch.extension.le x y := by + change ZFSet.pair (next.coding.encode (h.nextNodes M next x)) + (next.coding.encode (h.nextNodes M next y)) ∈ next.batchOrder ↔ _ + rw [next.coding.le_encode] + cases x with + | inl x => + cases y with + | inl y => exact d.coding.le_encode x y + | inr q => + change ZFSet.pair (d.coding.encode x) (next.templates.shadow (h.nextFresh M next q)).val ∈ + d.batchOrder ↔ d.templates.extension.le x (h.toInputs.nextBatch.shadow q) + rw [h.nextFresh_shadow M next] + exact d.coding.le_encode x _ + | inr q => + cases y with + | inl y => exact h.next_upper M next q.1 y + | inr t => + change (next.templates.Inside (h.nextFresh M next q) (h.nextFresh M next t) ∨ + next.templates.upper (h.nextIndex q.1) (next.templates.shadow (h.nextFresh M next t))) ↔ + (h.toInputs.nextBatch.Inside q t ∨ + h.toInputs.nextBatch.upper q.1 (h.toInputs.nextBatch.shadow t)) + apply or_congr (h.nextFresh_inside_iff M next q t) + have equal : next.templates.shadow (h.nextFresh M next t) = + ⟨d.coding.encode (h.toInputs.nextBatch.shadow t), d.coding.encode_mem _⟩ := + Subtype.ext (h.nextFresh_shadow M next t) + rw [equal] + exact h.next_upper M next q.1 _ + +theorem next_meet_entry + (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : + ZFSet.pair (ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y)) + (h.nextEncode M next (h.toInputs.nextBatch.extension.meet x y)) ∈ next.batchMeetGraph := by + apply next.batch_meetOrder.pair_iff.2 + refine ⟨h.nextEncode_mem M next x, h.nextEncode_mem M next y, h.nextEncode_mem M next _, + (h.next_le_encode M next _ x).2 (h.toInputs.nextBatch.extension.meet_le_left x y), + (h.next_le_encode M next _ y).2 (h.toInputs.nextBatch.extension.meet_le_right x y), ?_⟩ + intro z hz zx zy + obtain ⟨w, rfl⟩ := h.nextEncode_surjective M next z hz + exact (h.next_le_encode M next _ _).2 (h.toInputs.nextBatch.extension.le_meet + ((h.next_le_encode M next _ _).1 zx) ((h.next_le_encode M next _ _).1 zy)) + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + + + +namespace PartitionPilot.Forcing.CodedRecursiveTaskAction + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (s : CodedRecursiveTaskAction h T) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +theorem nextAction_entry (g : {g : ZFSet.{u} // g ∈ G}) + (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) : + ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x)) + (h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x)) ∈ h.nextActionGraph T := by + cases x with + | inl x => + rw [(s.toTaskSymmetry g).nextIso_old, h.nextEncode_old, h.nextEncode_old] + exact (h.nextAction_old_iff (d.coding.encode_mem x)).2 (s.toTaskSymmetry_current_entry g x) + | inr q => + rw [(s.toTaskSymmetry g).nextIso_fresh, h.nextEncode_fresh, h.nextEncode_fresh] + exact h.nextAction_fresh_entry s.taskAction s.source + (s.toTaskSymmetry_perm_entry g q.1.1) (next.freshCode_mem (h.nextFresh M next q)) + +theorem nextAction_entry_iff (g : {g : ZFSet.{u} // g ∈ G}) + (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) + (y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x)) y ∈ h.nextActionGraph T ↔ + y = h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x) := by + constructor + · intro entry + exact (h.nextAction_setAction s.taskAction s.source M next).entry_unique entry + (s.nextAction_entry M next g x) + · intro equal + exact equal.symm ▸ s.nextAction_entry M next g x + +include s in +theorem nextAction_order_iff {g x y x' y' : ZFSet.{u}} + (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T) + (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T) : + ZFSet.pair x' y' ∈ next.batchOrder ↔ ZFSet.pair x y ∈ next.batchOrder := by + have sx := (h.nextAction_setAction s.taskAction s.source M next).entry_shape first + have sy := (h.nextAction_setAction s.taskAction s.source M next).entry_shape second + let actor : {g : ZFSet.{u} // g ∈ G} := ⟨g, sx.1⟩ + obtain ⟨a, rfl⟩ := h.nextEncode_surjective M next x sx.2.1 + obtain ⟨b, rfl⟩ := h.nextEncode_surjective M next y sy.2.1 + rw [(s.nextAction_entry_iff M next actor a x').1 first, + (s.nextAction_entry_iff M next actor b y').1 second, h.next_le_encode, h.next_le_encode] + exact (s.toTaskSymmetry actor).nextIso.le_iff a b + +include s in +theorem nextAction_code : + PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) where + function := (h.nextAction_setAction s.taskAction s.source M next).function + one := (h.nextAction_setAction s.taskAction s.source M next).one + mul := (h.nextAction_setAction s.taskAction s.source M next).mul + monotone := fun _ _ _ _ _ _ _ _ _ _ first second lower => + (s.nextAction_order_iff M next first second).2 lower + +include s in +theorem nextAction_map_meet {g x y z x' y' z' : ZFSet.{u}} + (meet : ZFSet.pair (ZFSet.pair x y) z ∈ next.batchMeetGraph) + (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T) + (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T) + (third : ZFSet.pair (ZFSet.pair g z) z' ∈ h.nextActionGraph T) : + ZFSet.pair (ZFSet.pair x' y') z' ∈ next.batchMeetGraph := + (s.nextAction_code M next).raw_map_meet h.group next.batch_meetOrder + ((h.nextAction_setAction s.taskAction s.source M next).entry_shape first).1 + meet first second third + +end PartitionPilot.Forcing.CodedRecursiveTaskAction + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursivePrimitiveFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursivePrimitiveFormulas.lean index 70d7b51c05378c72690e0e895dedef5f206f1a56..04c24aa4ea0efd4c7ad62a94028511f403243911 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursivePrimitiveFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursivePrimitiveFormulas.lean @@ -1,114 +1,114 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveLiftAgreement - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n) : SetFormula n := - exactSetFormula output (BoundedFormula.recursiveAttachmentIndexFormula 0 i.succ j.succ - p.succ bound.succ sources.succ filters.succ).toFormula - -def pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n) : SetFormula n := - exactSetFormula output (BoundedFormula.pairFieldEntryFormula left 0 k.succ i.succ j.succ - bound.succ family.succ).toFormula - -def indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n) : SetFormula n := - exactSetFormula output (BoundedFormula.indexedAttachmentFreshEntryFormula 0 i.succ qs.succ - rs.succ anchors.succ qb.succ rb.succ ab.succ).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) : - Realize M.sets (recursiveIndicesSetFormula output i j p bound sources filters) env ↔ - env output = recursiveAttachmentIndices (env i) (env j) (env p) (env bound) - (env sources) (env filters) := by - apply M.realize_exactBoundedSetFormula output _ env members - (M.recursiveAttachmentIndices_mem pairing unions powers separation (members i) (members j) - (members p) (members bound) (members sources) (members filters)) - intro z - rw [BoundedFormula.truth_recursiveAttachmentIndexFormula] - change (∃ x ∈ env i, ∃ y ∈ env j, ∃ a ∈ env p, ∃ F ∈ env bound, - z = ZFSet.pair x y ∧ ZFSet.pair x a ∈ env sources ∧ - ZFSet.pair y F ∈ env filters ∧ a ∉ F) ↔ _ - rw [recursiveAttachmentIndices, ZFSet.mem_sep] - constructor - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨x, hx, y, hy, _, _, _, _, equal, _⟩ := witness - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ - · exact And.right - -theorem realize_pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) : - Realize M.sets (pairFieldSetFormula left output i j k bound family) env ↔ - env output = pairFieldGraph left (env i) (env j) (env k) (env bound) (env family) := by - apply M.realize_exactBoundedSetFormula output _ env members - (M.pairFieldGraph_mem pairing unions powers separation left (members i) (members j) - (members k) (members bound) (members family)) - intro z - rw [BoundedFormula.truth_pairFieldEntryFormula] - change (∃ t ∈ env k, ∃ x ∈ env i, ∃ y ∈ env j, ∃ v ∈ env bound, - z = ZFSet.pair t v ∧ t = ZFSet.pair x y ∧ - ZFSet.pair (if left then x else y) v ∈ env family) ↔ _ - rw [pairFieldGraph, ZFSet.mem_sep] - constructor - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨t, ht, _, _, _, _, v, hv, equal, _⟩ := witness - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨ht, hv⟩ - · exact And.right - -theorem realize_pairSecondFieldSetFormula {n} (output i j k bound family : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) - (bound_eq : env bound = ZFSet.sUnion (ZFSet.sUnion (env family))) : - Realize M.sets (pairFieldSetFormula false output i j k bound family) env ↔ - env output = pairSecondField (env i) (env j) (env k) (env family) := by - rw [M.realize_pairFieldSetFormula pairing unions powers separation false output i j k bound family - env members, bound_eq] - rfl - -theorem realize_indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) - (qBound : env qb = ZFSet.sUnion (ZFSet.sUnion (env qs))) - (rBound : env rb = ZFSet.sUnion (ZFSet.sUnion (env rs))) - (aBound : env ab = ZFSet.sUnion (ZFSet.sUnion (env anchors))) : - Realize M.sets (indexedFreshSetFormula output i qs rs anchors qb rb ab) env ↔ - env output = indexedAttachmentFresh (env i) (env qs) (env rs) (env anchors) := by - apply M.realize_exactBoundedSetFormula output _ env members - (M.indexedAttachmentFresh_mem pairing unions powers separation (members i) (members qs) - (members rs) (members anchors)) - intro z - rw [BoundedFormula.truth_indexedAttachmentFreshEntryFormula] - change (∃ j ∈ env i, ∃ Q ∈ env qb, ∃ r ∈ env rb, ∃ a ∈ env ab, ∃ q ∈ Q, - ZFSet.pair j Q ∈ env qs ∧ ZFSet.pair j r ∈ env rs ∧ ZFSet.pair j a ∈ env anchors ∧ - z = ZFSet.pair j q ∧ ZFSet.pair q a ∉ r) ↔ _ - rw [qBound, rBound, aBound, indexedAttachmentFresh, ZFSet.mem_sep] - constructor - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨j, hj, Q, _, _, _, _, _, q, hq, entry, _, _, equal, _⟩ := witness - rw [equal] - exact (pair_mem_indexedAttachmentDomain (env i) (env qs) j q).2 ⟨hj, Q, entry, hq⟩ - · exact And.right - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveLiftAgreement + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n) : SetFormula n := + exactSetFormula output (BoundedFormula.recursiveAttachmentIndexFormula 0 i.succ j.succ + p.succ bound.succ sources.succ filters.succ).toFormula + +def pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n) : SetFormula n := + exactSetFormula output (BoundedFormula.pairFieldEntryFormula left 0 k.succ i.succ j.succ + bound.succ family.succ).toFormula + +def indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n) : SetFormula n := + exactSetFormula output (BoundedFormula.indexedAttachmentFreshEntryFormula 0 i.succ qs.succ + rs.succ anchors.succ qb.succ rb.succ ab.succ).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) : + Realize M.sets (recursiveIndicesSetFormula output i j p bound sources filters) env ↔ + env output = recursiveAttachmentIndices (env i) (env j) (env p) (env bound) + (env sources) (env filters) := by + apply M.realize_exactBoundedSetFormula output _ env members + (M.recursiveAttachmentIndices_mem pairing unions powers separation (members i) (members j) + (members p) (members bound) (members sources) (members filters)) + intro z + rw [BoundedFormula.truth_recursiveAttachmentIndexFormula] + change (∃ x ∈ env i, ∃ y ∈ env j, ∃ a ∈ env p, ∃ F ∈ env bound, + z = ZFSet.pair x y ∧ ZFSet.pair x a ∈ env sources ∧ + ZFSet.pair y F ∈ env filters ∧ a ∉ F) ↔ _ + rw [recursiveAttachmentIndices, ZFSet.mem_sep] + constructor + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨x, hx, y, hy, _, _, _, _, equal, _⟩ := witness + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ + · exact And.right + +theorem realize_pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) : + Realize M.sets (pairFieldSetFormula left output i j k bound family) env ↔ + env output = pairFieldGraph left (env i) (env j) (env k) (env bound) (env family) := by + apply M.realize_exactBoundedSetFormula output _ env members + (M.pairFieldGraph_mem pairing unions powers separation left (members i) (members j) + (members k) (members bound) (members family)) + intro z + rw [BoundedFormula.truth_pairFieldEntryFormula] + change (∃ t ∈ env k, ∃ x ∈ env i, ∃ y ∈ env j, ∃ v ∈ env bound, + z = ZFSet.pair t v ∧ t = ZFSet.pair x y ∧ + ZFSet.pair (if left then x else y) v ∈ env family) ↔ _ + rw [pairFieldGraph, ZFSet.mem_sep] + constructor + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨t, ht, _, _, _, _, v, hv, equal, _⟩ := witness + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨ht, hv⟩ + · exact And.right + +theorem realize_pairSecondFieldSetFormula {n} (output i j k bound family : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) + (bound_eq : env bound = ZFSet.sUnion (ZFSet.sUnion (env family))) : + Realize M.sets (pairFieldSetFormula false output i j k bound family) env ↔ + env output = pairSecondField (env i) (env j) (env k) (env family) := by + rw [M.realize_pairFieldSetFormula pairing unions powers separation false output i j k bound family + env members, bound_eq] + rfl + +theorem realize_indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) + (qBound : env qb = ZFSet.sUnion (ZFSet.sUnion (env qs))) + (rBound : env rb = ZFSet.sUnion (ZFSet.sUnion (env rs))) + (aBound : env ab = ZFSet.sUnion (ZFSet.sUnion (env anchors))) : + Realize M.sets (indexedFreshSetFormula output i qs rs anchors qb rb ab) env ↔ + env output = indexedAttachmentFresh (env i) (env qs) (env rs) (env anchors) := by + apply M.realize_exactBoundedSetFormula output _ env members + (M.indexedAttachmentFresh_mem pairing unions powers separation (members i) (members qs) + (members rs) (members anchors)) + intro z + rw [BoundedFormula.truth_indexedAttachmentFreshEntryFormula] + change (∃ j ∈ env i, ∃ Q ∈ env qb, ∃ r ∈ env rb, ∃ a ∈ env ab, ∃ q ∈ Q, + ZFSet.pair j Q ∈ env qs ∧ ZFSet.pair j r ∈ env rs ∧ ZFSet.pair j a ∈ env anchors ∧ + z = ZFSet.pair j q ∧ ZFSet.pair q a ∉ r) ↔ _ + rw [qBound, rBound, aBound, indexedAttachmentFresh, ZFSet.mem_sep] + constructor + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨j, hj, Q, _, _, _, _, _, q, hq, entry, _, _, equal, _⟩ := witness + rw [equal] + exact (pair_mem_indexedAttachmentDomain (env i) (env qs) j q).2 ⟨hj, Q, entry, hq⟩ + · exact And.right + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementDataHistoryEntryFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementDataHistoryEntryFormulas.lean index 2d96e18dc4a4e01fb2e1503793aa60481c7bffda..9d9bdd6376bb2cc5031b53bc199b6373f6b3559c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementDataHistoryEntryFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementDataHistoryEntryFormulas.lean @@ -1,108 +1,108 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem mem_refinementDataHistoryIndices (stages history x : ZFSet.{u}) : - x ∈ refinementDataHistoryIndices stages history ↔ - ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ x ∈ d 0 := by - rw [refinementDataHistoryIndices, mem_refinementHistoryIndices] - constructor - · rintro ⟨alpha, halpha, I, entry, member⟩ - obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField _ _ _ _ _).1 entry - exact ⟨alpha, halpha, d, stored, member⟩ - · rintro ⟨alpha, halpha, d, entry, member⟩ - exact ⟨alpha, halpha, d 0, - (pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨halpha, d, entry, rfl⟩, member⟩ - -theorem pair_mem_refinementDataHistoryLevels (stages history T assignment xi : ZFSet.{u}) : - ZFSet.pair assignment xi ∈ refinementDataHistoryLevels stages history T ↔ - ∃ i ∈ refinementDataHistoryIndices stages history, ∃ u ∈ T, ∃ w ∈ T, - assignment = stageOneAssignment i u w ∧ xi ∈ stages ∧ - ∃ fields : Fin 6 → ZFSet.{u}, i = nonemptyTupleCode 5 fields ∧ xi = fields 0 := by - change ZFSet.pair assignment xi ∈ assignmentIndexLevels - (refinementDataHistoryIndices stages history) T stages - (refinementIndexFieldGraph (refinementDataHistoryIndices stages history) stages 0) ↔ _ - rw [pair_mem_assignmentIndexLevels] - constructor - · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, entry⟩ - exact ⟨i, hi, u, hu, w, hw, equal, hxi, - ((pair_mem_refinementIndexFieldGraph _ _ _ _ _).1 entry).2.2⟩ - · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, fields⟩ - exact ⟨i, hi, u, hu, w, hw, equal, hxi, - (pair_mem_refinementIndexFieldGraph _ _ _ _ _).2 ⟨hi, hxi, fields⟩⟩ - -namespace BoundedFormula -noncomputable def refinementDataHistoryIndicesEntryFormula {n : Nat} - (stages history x : Fin n) : BoundedFormula n := - exGraphFields history (.conj (.mem 1 stages.succ.succ) - (exPairFields 0 (.conj (tupleShapeFormula 13 0) (.mem x.succ.succ.succ.succ 1)))) - -theorem truth_refinementDataHistoryIndicesEntryFormula {n : Nat} - (stages history x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (refinementDataHistoryIndicesEntryFormula stages history x) env ↔ - env x ∈ refinementDataHistoryIndices (env stages) (env history) := by - rw [mem_refinementDataHistoryIndices] - simp only [refinementDataHistoryIndicesEntryFormula, truth_exGraphFields, Truth, - truth_exPairFields, truth_tupleShapeFormula] - change (∃ alpha data, ZFSet.pair alpha data ∈ env history ∧ alpha ∈ env stages ∧ - ∃ I tail, data = ZFSet.pair I tail ∧ (∃ fields : Fin 14 → ZFSet.{u}, - tail = nonemptyTupleCode 13 fields) ∧ env x ∈ I) ↔ _ - constructor - · rintro ⟨alpha, data, entry, halpha, I, tail, pair, ⟨fields, tuple⟩, member⟩ - let d : Fin 15 → ZFSet.{u} := Fin.cases I fields - refine ⟨alpha, halpha, d, ?_, member⟩ - have equal : data = refinementFormulaDataCode d := pair.trans (congrArg (ZFSet.pair I) tuple) - exact equal ▸ entry - · rintro ⟨alpha, halpha, d, entry, member⟩ - exact ⟨alpha, refinementFormulaDataCode d, entry, halpha, d 0, - nonemptyTupleCode 13 (fun i => d i.succ), rfl, - ⟨fun i => d i.succ, rfl⟩, member⟩ - -noncomputable def refinementDataHistoryLevelsEntryFormula {n : Nat} - (stages history T z : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - exPairFields z (exPairFields 1 (exPairFields 0 - (.conj (refinementDataHistoryIndicesEntryFormula (lift stages) (lift history) 3) - (.conj (.mem 1 (lift T)) (.conj (.mem 0 (lift T)) - (.conj (.mem 4 (lift stages)) (tupleFieldFormula 5 3 4 0))))))) - -theorem truth_refinementDataHistoryLevelsEntryFormula {n : Nat} - (stages history T z : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (refinementDataHistoryLevelsEntryFormula stages history T z) env ↔ - env z ∈ refinementDataHistoryLevels (env stages) (env history) (env T) := by - simp only [refinementDataHistoryLevelsEntryFormula, truth_exPairFields, Truth, - truth_refinementDataHistoryIndicesEntryFormula, truth_tupleFieldFormula] - change (∃ assignment xi, env z = ZFSet.pair assignment xi ∧ - ∃ i tail, assignment = ZFSet.pair i tail ∧ ∃ u w, tail = ZFSet.pair u w ∧ - i ∈ refinementDataHistoryIndices (env stages) (env history) ∧ u ∈ env T ∧ w ∈ env T ∧ - xi ∈ env stages ∧ ∃ fields : Fin 6 → ZFSet.{u}, - i = nonemptyTupleCode 5 fields ∧ xi = fields 0) ↔ _ - constructor - · rintro ⟨assignment, xi, equal, i, tail, pair, u, w, tailEq, hi, hu, hw, hxi, fields⟩ - rw [equal] - apply (pair_mem_refinementDataHistoryLevels _ _ _ _ _).2 - exact ⟨i, hi, u, hu, w, hw, pair.trans (congrArg (ZFSet.pair i) tailEq), hxi, fields⟩ - · intro member - have raw := member - unfold refinementDataHistoryLevels refinementHistoryAssignmentLevels assignmentIndexLevels relationCompose at raw - have shape := (ZFSet.mem_sep.1 raw).1 - obtain ⟨assignment, _, xi, _, equal⟩ := ZFSet.mem_prod.1 shape - rw [equal] at member - obtain ⟨i, hi, u, hu, w, hw, pair, hxi, fields⟩ := - (pair_mem_refinementDataHistoryLevels _ _ _ _ _).1 member - exact ⟨assignment, xi, equal, i, ZFSet.pair u w, pair, u, w, rfl, hi, hu, hw, hxi, fields⟩ - -end BoundedFormula - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem mem_refinementDataHistoryIndices (stages history x : ZFSet.{u}) : + x ∈ refinementDataHistoryIndices stages history ↔ + ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ x ∈ d 0 := by + rw [refinementDataHistoryIndices, mem_refinementHistoryIndices] + constructor + · rintro ⟨alpha, halpha, I, entry, member⟩ + obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField _ _ _ _ _).1 entry + exact ⟨alpha, halpha, d, stored, member⟩ + · rintro ⟨alpha, halpha, d, entry, member⟩ + exact ⟨alpha, halpha, d 0, + (pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨halpha, d, entry, rfl⟩, member⟩ + +theorem pair_mem_refinementDataHistoryLevels (stages history T assignment xi : ZFSet.{u}) : + ZFSet.pair assignment xi ∈ refinementDataHistoryLevels stages history T ↔ + ∃ i ∈ refinementDataHistoryIndices stages history, ∃ u ∈ T, ∃ w ∈ T, + assignment = stageOneAssignment i u w ∧ xi ∈ stages ∧ + ∃ fields : Fin 6 → ZFSet.{u}, i = nonemptyTupleCode 5 fields ∧ xi = fields 0 := by + change ZFSet.pair assignment xi ∈ assignmentIndexLevels + (refinementDataHistoryIndices stages history) T stages + (refinementIndexFieldGraph (refinementDataHistoryIndices stages history) stages 0) ↔ _ + rw [pair_mem_assignmentIndexLevels] + constructor + · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, entry⟩ + exact ⟨i, hi, u, hu, w, hw, equal, hxi, + ((pair_mem_refinementIndexFieldGraph _ _ _ _ _).1 entry).2.2⟩ + · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, fields⟩ + exact ⟨i, hi, u, hu, w, hw, equal, hxi, + (pair_mem_refinementIndexFieldGraph _ _ _ _ _).2 ⟨hi, hxi, fields⟩⟩ + +namespace BoundedFormula +noncomputable def refinementDataHistoryIndicesEntryFormula {n : Nat} + (stages history x : Fin n) : BoundedFormula n := + exGraphFields history (.conj (.mem 1 stages.succ.succ) + (exPairFields 0 (.conj (tupleShapeFormula 13 0) (.mem x.succ.succ.succ.succ 1)))) + +theorem truth_refinementDataHistoryIndicesEntryFormula {n : Nat} + (stages history x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (refinementDataHistoryIndicesEntryFormula stages history x) env ↔ + env x ∈ refinementDataHistoryIndices (env stages) (env history) := by + rw [mem_refinementDataHistoryIndices] + simp only [refinementDataHistoryIndicesEntryFormula, truth_exGraphFields, Truth, + truth_exPairFields, truth_tupleShapeFormula] + change (∃ alpha data, ZFSet.pair alpha data ∈ env history ∧ alpha ∈ env stages ∧ + ∃ I tail, data = ZFSet.pair I tail ∧ (∃ fields : Fin 14 → ZFSet.{u}, + tail = nonemptyTupleCode 13 fields) ∧ env x ∈ I) ↔ _ + constructor + · rintro ⟨alpha, data, entry, halpha, I, tail, pair, ⟨fields, tuple⟩, member⟩ + let d : Fin 15 → ZFSet.{u} := Fin.cases I fields + refine ⟨alpha, halpha, d, ?_, member⟩ + have equal : data = refinementFormulaDataCode d := pair.trans (congrArg (ZFSet.pair I) tuple) + exact equal ▸ entry + · rintro ⟨alpha, halpha, d, entry, member⟩ + exact ⟨alpha, refinementFormulaDataCode d, entry, halpha, d 0, + nonemptyTupleCode 13 (fun i => d i.succ), rfl, + ⟨fun i => d i.succ, rfl⟩, member⟩ + +noncomputable def refinementDataHistoryLevelsEntryFormula {n : Nat} + (stages history T z : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + exPairFields z (exPairFields 1 (exPairFields 0 + (.conj (refinementDataHistoryIndicesEntryFormula (lift stages) (lift history) 3) + (.conj (.mem 1 (lift T)) (.conj (.mem 0 (lift T)) + (.conj (.mem 4 (lift stages)) (tupleFieldFormula 5 3 4 0))))))) + +theorem truth_refinementDataHistoryLevelsEntryFormula {n : Nat} + (stages history T z : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (refinementDataHistoryLevelsEntryFormula stages history T z) env ↔ + env z ∈ refinementDataHistoryLevels (env stages) (env history) (env T) := by + simp only [refinementDataHistoryLevelsEntryFormula, truth_exPairFields, Truth, + truth_refinementDataHistoryIndicesEntryFormula, truth_tupleFieldFormula] + change (∃ assignment xi, env z = ZFSet.pair assignment xi ∧ + ∃ i tail, assignment = ZFSet.pair i tail ∧ ∃ u w, tail = ZFSet.pair u w ∧ + i ∈ refinementDataHistoryIndices (env stages) (env history) ∧ u ∈ env T ∧ w ∈ env T ∧ + xi ∈ env stages ∧ ∃ fields : Fin 6 → ZFSet.{u}, + i = nonemptyTupleCode 5 fields ∧ xi = fields 0) ↔ _ + constructor + · rintro ⟨assignment, xi, equal, i, tail, pair, u, w, tailEq, hi, hu, hw, hxi, fields⟩ + rw [equal] + apply (pair_mem_refinementDataHistoryLevels _ _ _ _ _).2 + exact ⟨i, hi, u, hu, w, hw, pair.trans (congrArg (ZFSet.pair i) tailEq), hxi, fields⟩ + · intro member + have raw := member + unfold refinementDataHistoryLevels refinementHistoryAssignmentLevels assignmentIndexLevels relationCompose at raw + have shape := (ZFSet.mem_sep.1 raw).1 + obtain ⟨assignment, _, xi, _, equal⟩ := ZFSet.mem_prod.1 shape + rw [equal] at member + obtain ⟨i, hi, u, hu, w, hw, pair, hxi, fields⟩ := + (pair_mem_refinementDataHistoryLevels _ _ _ _ _).1 member + exact ⟨assignment, xi, equal, i, ZFSet.pair u w, pair, u, w, rfl, hi, hu, hw, hxi, fields⟩ + +end BoundedFormula + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementHistoryOrderOutputFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementHistoryOrderOutputFormulas.lean index bb498fa7676c1a2ba6bbcf9c43cdd12bf08a315b..8499798a2d35b413fa253959404af417772c5966 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementHistoryOrderOutputFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementHistoryOrderOutputFormulas.lean @@ -1,180 +1,180 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableRowAssignmentOrders -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundDefinableRefinementHistories - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace SetFormula - -noncomputable def refinementHistoryForcingOutputFormula {n : Nat} - (output rows T stages history N : Fin n) : SetFormula n := - let old := suffixIndex n 2 - let v := prefixIndex n 2 - exBlock 2 (.conj (refinementDataHistoryIndicesSetFormula (v 0) (old stages) (old history)) - (.conj (refinementDataHistoryLevelsSetFormula (v 1) (old stages) (old history) (old T)) - (forcingHistoryConditionsOutputFormula (old output) (old rows) (v 0) (old T) - (old stages) (old history) (v 1) (old N)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_refinementHistoryForcingOutputFormula {n : Nat} - (output rows T stages history N : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (naturals : env N = ZFSet.omega) : - Realize M.sets (refinementHistoryForcingOutputFormula output rows T stages history N) env ↔ - env output = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) := by - rw [refinementHistoryForcingOutputFormula, realize_exBlock] - have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : - Realize M.sets (.conj - (refinementDataHistoryIndicesSetFormula (prefixIndex n 2 0) - (suffixIndex n 2 stages) (suffixIndex n 2 history)) - (.conj (refinementDataHistoryLevelsSetFormula (prefixIndex n 2 1) - (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T)) - (forcingHistoryConditionsOutputFormula (suffixIndex n 2 output) (suffixIndex n 2 rows) - (prefixIndex n 2 0) (suffixIndex n 2 T) (suffixIndex n 2 stages) - (suffixIndex n 2 history) (prefixIndex n 2 1) (suffixIndex n 2 N)))) - (extendMany 2 fields env) ↔ - fields 0 = refinementDataHistoryIndices (env stages) (env history) ∧ - fields 1 = refinementDataHistoryLevels (env stages) (env history) (env T) ∧ - env output = M.forcingHistoryConditions (env rows) (fields 0) (env T) - (env stages) (env history) (fields 1) := by - have bounds := extendMany_members 2 fields env ground members - apply and_congr - · simpa only [extendMany_prefix, extendMany_suffix] using - M.realize_refinementDataHistoryIndicesSetFormula pairing unions powers separation - (prefixIndex n 2 0) (suffixIndex n 2 stages) (suffixIndex n 2 history) - (extendMany 2 fields env) bounds - apply and_congr - · simpa only [extendMany_prefix, extendMany_suffix] using - M.realize_refinementDataHistoryLevelsSetFormula pairing unions powers separation - (prefixIndex n 2 1) (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T) - (extendMany 2 fields env) bounds - · simpa only [extendMany_prefix, extendMany_suffix] using - M.realize_forcingHistoryConditionsOutputFormula pairing separation - (suffixIndex n 2 output) (suffixIndex n 2 rows) (prefixIndex n 2 0) - (suffixIndex n 2 T) (suffixIndex n 2 stages) (suffixIndex n 2 history) - (prefixIndex n 2 1) (suffixIndex n 2 N) (extendMany 2 fields env) bounds - (by simpa only [extendMany_suffix] using naturals) - constructor - · rintro ⟨fields, ground, body⟩ - obtain ⟨indices, levels, outputEq⟩ := (actual fields ground).1 body - rw [indices, levels] at outputEq - exact outputEq - · intro equal - let fields : Fin 2 → ZFSet.{u} := - ![refinementDataHistoryIndices (env stages) (env history), - refinementDataHistoryLevels (env stages) (env history) (env T)] - have ground : ∀ j, fields j ∈ M.sets := - Fin.cases (M.refinementDataHistoryIndices_mem pairing unions powers separation - (members stages) (members history)) - (Fin.cases (M.refinementDataHistoryLevels_mem pairing unions powers separation - (members stages) (members history) (members T)) (fun j => Fin.elim0 j)) - exact ⟨fields, ground, (actual fields ground).2 ⟨rfl, rfl, equal⟩⟩ - -theorem exists_unique_refinementHistoryForcingOutput - {rows T stages history : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - ∃ output ∈ M.sets, - Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5) - ![output, rows, T, stages, history, ZFSet.omega] ∧ - ∀ other ∈ M.sets, - Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5) - ![other, rows, T, stages, history, ZFSet.omega] → other = output := by - have ground := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega - have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) : - Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5) - ![output, rows, T, stages, history, ZFSet.omega] ↔ - output = M.refinementHistoryForcing rows T stages history := - M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation 0 1 2 3 4 5 _ - (Fin.cases hOutput (Fin.cases hRows (Fin.cases hT (Fin.cases hStages - (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j))))))) rfl - exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def refinementHistoryOrderOutputFormula {n : Nat} - (output rows rowOrder T stages history N : Fin n) : SetFormula n := - .ex (.conj (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ) - (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ)) - -theorem realize_refinementHistoryOrderOutputFormula {n : Nat} - (output rows rowOrder T stages history N : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) : - Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation - output rows rowOrder T stages history N) env ↔ - env output = M.refinementHistoryOrder (env rows) (env rowOrder) (env T) (env stages) (env history) := by - unfold refinementHistoryOrderOutputFormula - rw [realize_ex] - have meaning (Q : ZFSet.{u}) (hQ : Q ∈ M.sets) : - Realize M.sets (.conj - (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ) - (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ)) - (extend Q env) ↔ - Q = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) ∧ - env output = rawRowAssignmentOrder Q (env rowOrder) := - and_congr (M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation - 0 rows.succ T.succ stages.succ history.succ N.succ (extend Q env) (Fin.cases hQ members) naturals) - (M.realize_rawRowAssignmentOrderOutputFormula pairing unions powers separation - output.succ 0 rowOrder.succ (extend Q env) (Fin.cases hQ members)) - constructor - · rintro ⟨Q, hQ, recognized⟩ - obtain ⟨rfl, equal⟩ := (meaning Q hQ).1 recognized - rw [M.refinementHistoryOrder_raw] - exact equal - · intro equal - have ground := M.refinementHistoryForcing_mem pairing unions powers separation - (members rows) (members T) (members stages) (members history) (naturals ▸ members N) - refine ⟨_, ground, (meaning _ ground).2 ⟨rfl, ?_⟩⟩ - rw [M.refinementHistoryOrder_raw] at equal - exact equal - -theorem exists_unique_refinementHistoryOrderOutput - {rows rowOrder T stages history : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hOrder : rowOrder ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - ∃ output ∈ M.sets, - Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6) - ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ∧ - ∀ other ∈ M.sets, - Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6) - ![other, rows, rowOrder, T, stages, history, ZFSet.omega] → other = output := by - have ground := M.refinementHistoryOrder_mem pairing unions powers separation hRows hOrder hT hStages hHistory omega - have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) : - Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6) - ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ↔ - output = M.refinementHistoryOrder rows rowOrder T stages history := - M.realize_refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6 _ - (Fin.cases hOutput (Fin.cases hRows (Fin.cases hOrder (Fin.cases hT (Fin.cases hStages - (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j)))))))) rfl - exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableRowAssignmentOrders +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundDefinableRefinementHistories + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace SetFormula + +noncomputable def refinementHistoryForcingOutputFormula {n : Nat} + (output rows T stages history N : Fin n) : SetFormula n := + let old := suffixIndex n 2 + let v := prefixIndex n 2 + exBlock 2 (.conj (refinementDataHistoryIndicesSetFormula (v 0) (old stages) (old history)) + (.conj (refinementDataHistoryLevelsSetFormula (v 1) (old stages) (old history) (old T)) + (forcingHistoryConditionsOutputFormula (old output) (old rows) (v 0) (old T) + (old stages) (old history) (v 1) (old N)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_refinementHistoryForcingOutputFormula {n : Nat} + (output rows T stages history N : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (naturals : env N = ZFSet.omega) : + Realize M.sets (refinementHistoryForcingOutputFormula output rows T stages history N) env ↔ + env output = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) := by + rw [refinementHistoryForcingOutputFormula, realize_exBlock] + have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : + Realize M.sets (.conj + (refinementDataHistoryIndicesSetFormula (prefixIndex n 2 0) + (suffixIndex n 2 stages) (suffixIndex n 2 history)) + (.conj (refinementDataHistoryLevelsSetFormula (prefixIndex n 2 1) + (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T)) + (forcingHistoryConditionsOutputFormula (suffixIndex n 2 output) (suffixIndex n 2 rows) + (prefixIndex n 2 0) (suffixIndex n 2 T) (suffixIndex n 2 stages) + (suffixIndex n 2 history) (prefixIndex n 2 1) (suffixIndex n 2 N)))) + (extendMany 2 fields env) ↔ + fields 0 = refinementDataHistoryIndices (env stages) (env history) ∧ + fields 1 = refinementDataHistoryLevels (env stages) (env history) (env T) ∧ + env output = M.forcingHistoryConditions (env rows) (fields 0) (env T) + (env stages) (env history) (fields 1) := by + have bounds := extendMany_members 2 fields env ground members + apply and_congr + · simpa only [extendMany_prefix, extendMany_suffix] using + M.realize_refinementDataHistoryIndicesSetFormula pairing unions powers separation + (prefixIndex n 2 0) (suffixIndex n 2 stages) (suffixIndex n 2 history) + (extendMany 2 fields env) bounds + apply and_congr + · simpa only [extendMany_prefix, extendMany_suffix] using + M.realize_refinementDataHistoryLevelsSetFormula pairing unions powers separation + (prefixIndex n 2 1) (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T) + (extendMany 2 fields env) bounds + · simpa only [extendMany_prefix, extendMany_suffix] using + M.realize_forcingHistoryConditionsOutputFormula pairing separation + (suffixIndex n 2 output) (suffixIndex n 2 rows) (prefixIndex n 2 0) + (suffixIndex n 2 T) (suffixIndex n 2 stages) (suffixIndex n 2 history) + (prefixIndex n 2 1) (suffixIndex n 2 N) (extendMany 2 fields env) bounds + (by simpa only [extendMany_suffix] using naturals) + constructor + · rintro ⟨fields, ground, body⟩ + obtain ⟨indices, levels, outputEq⟩ := (actual fields ground).1 body + rw [indices, levels] at outputEq + exact outputEq + · intro equal + let fields : Fin 2 → ZFSet.{u} := + ![refinementDataHistoryIndices (env stages) (env history), + refinementDataHistoryLevels (env stages) (env history) (env T)] + have ground : ∀ j, fields j ∈ M.sets := + Fin.cases (M.refinementDataHistoryIndices_mem pairing unions powers separation + (members stages) (members history)) + (Fin.cases (M.refinementDataHistoryLevels_mem pairing unions powers separation + (members stages) (members history) (members T)) (fun j => Fin.elim0 j)) + exact ⟨fields, ground, (actual fields ground).2 ⟨rfl, rfl, equal⟩⟩ + +theorem exists_unique_refinementHistoryForcingOutput + {rows T stages history : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + ∃ output ∈ M.sets, + Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5) + ![output, rows, T, stages, history, ZFSet.omega] ∧ + ∀ other ∈ M.sets, + Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5) + ![other, rows, T, stages, history, ZFSet.omega] → other = output := by + have ground := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega + have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) : + Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5) + ![output, rows, T, stages, history, ZFSet.omega] ↔ + output = M.refinementHistoryForcing rows T stages history := + M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation 0 1 2 3 4 5 _ + (Fin.cases hOutput (Fin.cases hRows (Fin.cases hT (Fin.cases hStages + (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j))))))) rfl + exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def refinementHistoryOrderOutputFormula {n : Nat} + (output rows rowOrder T stages history N : Fin n) : SetFormula n := + .ex (.conj (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ) + (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ)) + +theorem realize_refinementHistoryOrderOutputFormula {n : Nat} + (output rows rowOrder T stages history N : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) : + Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation + output rows rowOrder T stages history N) env ↔ + env output = M.refinementHistoryOrder (env rows) (env rowOrder) (env T) (env stages) (env history) := by + unfold refinementHistoryOrderOutputFormula + rw [realize_ex] + have meaning (Q : ZFSet.{u}) (hQ : Q ∈ M.sets) : + Realize M.sets (.conj + (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ) + (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ)) + (extend Q env) ↔ + Q = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) ∧ + env output = rawRowAssignmentOrder Q (env rowOrder) := + and_congr (M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation + 0 rows.succ T.succ stages.succ history.succ N.succ (extend Q env) (Fin.cases hQ members) naturals) + (M.realize_rawRowAssignmentOrderOutputFormula pairing unions powers separation + output.succ 0 rowOrder.succ (extend Q env) (Fin.cases hQ members)) + constructor + · rintro ⟨Q, hQ, recognized⟩ + obtain ⟨rfl, equal⟩ := (meaning Q hQ).1 recognized + rw [M.refinementHistoryOrder_raw] + exact equal + · intro equal + have ground := M.refinementHistoryForcing_mem pairing unions powers separation + (members rows) (members T) (members stages) (members history) (naturals ▸ members N) + refine ⟨_, ground, (meaning _ ground).2 ⟨rfl, ?_⟩⟩ + rw [M.refinementHistoryOrder_raw] at equal + exact equal + +theorem exists_unique_refinementHistoryOrderOutput + {rows rowOrder T stages history : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hOrder : rowOrder ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + ∃ output ∈ M.sets, + Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6) + ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ∧ + ∀ other ∈ M.sets, + Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6) + ![other, rows, rowOrder, T, stages, history, ZFSet.omega] → other = output := by + have ground := M.refinementHistoryOrder_mem pairing unions powers separation hRows hOrder hT hStages hHistory omega + have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) : + Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6) + ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ↔ + output = M.refinementHistoryOrder rows rowOrder T stages history := + M.realize_refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6 _ + (Fin.cases hOutput (Fin.cases hRows (Fin.cases hOrder (Fin.cases hT (Fin.cases hStages + (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j)))))))) rfl + exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementIndexActionFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementIndexActionFormulas.lean index 98f0ca99f4f2e9179682bf15dfd3d324adb6f159..e4495a0553aad8faf310b3b1d251601166542b89 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementIndexActionFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementIndexActionFormulas.lean @@ -1,60 +1,60 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace SetFormula - -def refinementIndexActionRawFormula {n} - (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n) : SetFormula n := - .conj (BoundedFormula.nonemptyTupleFormula 5 x (fun j => w (j.castAdd 7))).toFormula - (.conj (BoundedFormula.nonemptyTupleFormula 5 y (fun j => w ((Fin.natAdd 6 j).castAdd 1))).toFormula - (.conj (.equal (w 0) (w 6)) - (.conj (pairMembershipFormula g (w 12) nodeMaps) - (.conj (pairMembershipFormula (w 1) (w 7) (w 12)) - (.conj (pairMembershipFormula (w 2) (w 8) (w 12)) - (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 3) (w 9)) - (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 4) (w 10)) - (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 5) (w 11))))))))) - -def refinementIndexActionFormula {n} (x y g P maps nodeMaps : Fin n) : SetFormula n := - let old := suffixIndex n 13 - exBlock 13 (refinementIndexActionRawFormula (old x) (old y) (old g) (old P) - (old maps) (old nodeMaps) (prefixIndex n 13)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_refinementIndexActionRawFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n} (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (refinementIndexActionRawFormula x y g P maps nodeMaps w) env ↔ - env x = nonemptyTupleCode 5 (fun j => env (w (j.castAdd 7))) ∧ - env y = nonemptyTupleCode 5 (fun j => env (w ((Fin.natAdd 6 j).castAdd 1))) ∧ - env (w 0) = env (w 6) ∧ ZFSet.pair (env g) (env (w 12)) ∈ env nodeMaps ∧ - ZFSet.pair (env (w 1)) (env (w 7)) ∈ env (w 12) ∧ - ZFSet.pair (env (w 2)) (env (w 8)) ∈ env (w 12) ∧ - Realize M.sets nameActionFormula (extend (env g) (extend (env (w 3)) - (extend (env (w 9)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧ - Realize M.sets nameActionFormula (extend (env g) (extend (env (w 4)) - (extend (env (w 10)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧ - Realize M.sets nameActionFormula (extend (env g) (extend (env (w 5)) - (extend (env (w 11)) (extend (env P) (extend (env maps) Fin.elim0))))) := by - simp only [refinementIndexActionRawFormula, Realize, - BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_nonemptyTupleFormula, - M.realize_pairMembershipFormula pairing _ _ _ env (members _) (members _) (members _), - realize_atomicApplication, map_extend, map_empty] - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace SetFormula + +def refinementIndexActionRawFormula {n} + (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n) : SetFormula n := + .conj (BoundedFormula.nonemptyTupleFormula 5 x (fun j => w (j.castAdd 7))).toFormula + (.conj (BoundedFormula.nonemptyTupleFormula 5 y (fun j => w ((Fin.natAdd 6 j).castAdd 1))).toFormula + (.conj (.equal (w 0) (w 6)) + (.conj (pairMembershipFormula g (w 12) nodeMaps) + (.conj (pairMembershipFormula (w 1) (w 7) (w 12)) + (.conj (pairMembershipFormula (w 2) (w 8) (w 12)) + (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 3) (w 9)) + (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 4) (w 10)) + (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 5) (w 11))))))))) + +def refinementIndexActionFormula {n} (x y g P maps nodeMaps : Fin n) : SetFormula n := + let old := suffixIndex n 13 + exBlock 13 (refinementIndexActionRawFormula (old x) (old y) (old g) (old P) + (old maps) (old nodeMaps) (prefixIndex n 13)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_refinementIndexActionRawFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n} (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (refinementIndexActionRawFormula x y g P maps nodeMaps w) env ↔ + env x = nonemptyTupleCode 5 (fun j => env (w (j.castAdd 7))) ∧ + env y = nonemptyTupleCode 5 (fun j => env (w ((Fin.natAdd 6 j).castAdd 1))) ∧ + env (w 0) = env (w 6) ∧ ZFSet.pair (env g) (env (w 12)) ∈ env nodeMaps ∧ + ZFSet.pair (env (w 1)) (env (w 7)) ∈ env (w 12) ∧ + ZFSet.pair (env (w 2)) (env (w 8)) ∈ env (w 12) ∧ + Realize M.sets nameActionFormula (extend (env g) (extend (env (w 3)) + (extend (env (w 9)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧ + Realize M.sets nameActionFormula (extend (env g) (extend (env (w 4)) + (extend (env (w 10)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧ + Realize M.sets nameActionFormula (extend (env g) (extend (env (w 5)) + (extend (env (w 11)) (extend (env P) (extend (env maps) Fin.elim0))))) := by + simp only [refinementIndexActionRawFormula, Realize, + BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_nonemptyTupleFormula, + M.realize_pairMembershipFormula pairing _ _ _ env (members _) (members _) (members _), + realize_atomicApplication, map_extend, map_empty] + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementValidityCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementValidityCodes.lean index 593f3c405c82ec35461142131a7d0c442d69b380..680703ed5762699f42c1b12a9739f15ed395f2cc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementValidityCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementValidityCodes.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundCountableQuotients - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -def RefinementValidityCode (T U Rf Rc : ZFSet.{u}) : Prop := - U ⊆ T ∧ EquivalenceRelationCode U Rf ∧ EquivalenceRelationCode U Rc ∧ Rf ⊆ Rc - -namespace BoundedFormula -open SetFormula - -def equivalenceRelationFormula {n} (S R : Fin n) : BoundedFormula n := - .conj (relationBetweenFormula S S R) - (.conj (.allMem S (pairMembershipFormula 0 0 R.succ)) - (.conj - (.allMem S (.allMem S.succ - (imp (pairMembershipFormula 1 0 R.succ.succ) - (pairMembershipFormula 0 1 R.succ.succ)))) - (.allMem S (.allMem S.succ (.allMem S.succ.succ - (imp (.conj (pairMembershipFormula 2 1 R.succ.succ.succ) - (pairMembershipFormula 1 0 R.succ.succ.succ)) - (pairMembershipFormula 2 0 R.succ.succ.succ))))))) - -theorem truth_equivalenceRelationFormula {n} (S R : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (equivalenceRelationFormula S R) env ↔ EquivalenceRelationCode (env S) (env R) := by - simp only [equivalenceRelationFormula, Truth, truth_relationBetweenFormula, - truth_pairMembershipFormula, truth_imp] - constructor - · rintro ⟨shape, refl, symm, trans⟩ - refine ⟨shape, refl, ?_, ?_⟩ - · intro x y xy - obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy) - exact symm x hx y hy xy - · intro x y z xy yz - obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy) - have hz := (ZFSet.pair_mem_prod.1 (shape yz)).2 - exact trans x hx y hy z hz ⟨xy, yz⟩ - · intro relation - exact ⟨relation.shape, relation.refl, - fun x _ y _ xy => relation.symm x y xy, - fun x _ y _ z _ h => relation.trans x y z h.1 h.2⟩ - -def refinementValidityFormula : BoundedFormula 4 := - .conj (subsetFormula 0 3) - (.conj (equivalenceRelationFormula 0 1) - (.conj (equivalenceRelationFormula 0 2) (subsetFormula 1 2))) - -theorem truth_refinementValidityFormula (env : Fin 4 → ZFSet.{u}) : - Truth refinementValidityFormula env ↔ - RefinementValidityCode (env 3) (env 0) (env 1) (env 2) := by - simp only [refinementValidityFormula, Truth, truth_subsetFormula, - truth_equivalenceRelationFormula, RefinementValidityCode] - -end BoundedFormula - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_refinementValidityFormula (env : Fin 4 → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets BoundedFormula.refinementValidityFormula.toFormula env ↔ - RefinementValidityCode (env 3) (env 0) (env 1) (env 2) := - (BoundedFormula.realize_toFormula M _ _ members).trans - (BoundedFormula.truth_refinementValidityFormula env) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundCountableQuotients + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +def RefinementValidityCode (T U Rf Rc : ZFSet.{u}) : Prop := + U ⊆ T ∧ EquivalenceRelationCode U Rf ∧ EquivalenceRelationCode U Rc ∧ Rf ⊆ Rc + +namespace BoundedFormula +open SetFormula + +def equivalenceRelationFormula {n} (S R : Fin n) : BoundedFormula n := + .conj (relationBetweenFormula S S R) + (.conj (.allMem S (pairMembershipFormula 0 0 R.succ)) + (.conj + (.allMem S (.allMem S.succ + (imp (pairMembershipFormula 1 0 R.succ.succ) + (pairMembershipFormula 0 1 R.succ.succ)))) + (.allMem S (.allMem S.succ (.allMem S.succ.succ + (imp (.conj (pairMembershipFormula 2 1 R.succ.succ.succ) + (pairMembershipFormula 1 0 R.succ.succ.succ)) + (pairMembershipFormula 2 0 R.succ.succ.succ))))))) + +theorem truth_equivalenceRelationFormula {n} (S R : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (equivalenceRelationFormula S R) env ↔ EquivalenceRelationCode (env S) (env R) := by + simp only [equivalenceRelationFormula, Truth, truth_relationBetweenFormula, + truth_pairMembershipFormula, truth_imp] + constructor + · rintro ⟨shape, refl, symm, trans⟩ + refine ⟨shape, refl, ?_, ?_⟩ + · intro x y xy + obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy) + exact symm x hx y hy xy + · intro x y z xy yz + obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy) + have hz := (ZFSet.pair_mem_prod.1 (shape yz)).2 + exact trans x hx y hy z hz ⟨xy, yz⟩ + · intro relation + exact ⟨relation.shape, relation.refl, + fun x _ y _ xy => relation.symm x y xy, + fun x _ y _ z _ h => relation.trans x y z h.1 h.2⟩ + +def refinementValidityFormula : BoundedFormula 4 := + .conj (subsetFormula 0 3) + (.conj (equivalenceRelationFormula 0 1) + (.conj (equivalenceRelationFormula 0 2) (subsetFormula 1 2))) + +theorem truth_refinementValidityFormula (env : Fin 4 → ZFSet.{u}) : + Truth refinementValidityFormula env ↔ + RefinementValidityCode (env 3) (env 0) (env 1) (env 2) := by + simp only [refinementValidityFormula, Truth, truth_subsetFormula, + truth_equivalenceRelationFormula, RefinementValidityCode] + +end BoundedFormula + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_refinementValidityFormula (env : Fin 4 → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets BoundedFormula.refinementValidityFormula.toFormula env ↔ + RefinementValidityCode (env 3) (env 0) (env 1) (env 2) := + (BoundedFormula.realize_toFormula M _ _ members).trans + (BoundedFormula.truth_refinementValidityFormula env) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RenamedEntryFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RenamedEntryFormulas.lean index 74df134ebe3809d16434d28c4c737eb5f2b16836..8bed58ef9f36cd0d2b5654c38bb194d88fa731dd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RenamedEntryFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RenamedEntryFormulas.lean @@ -1,137 +1,137 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def renamedChildFormula : SetFormula 4 := - ex (exConditions 3 (.conj (orderedPairFormula 2 1 0) - (.conj (domainApplication uniformNameFormula (extend 4 Fin.elim0) 3) - (binaryApplication uniformRenameFormula (extend 4 (extend 5 Fin.elim0)) 1 3)))) - -def renamedEntryFormula : SetFormula 4 := - ex (exConditions 3 (.conj (pairMembershipFormula 1 0 3) - (ex (exConditions 5 (.conj (orderedPairFormula 4 1 0) - (.conj (pairMembershipFormula 2 0 7) - (.conj (domainApplication uniformNameFormula (extend 6 Fin.elim0) 1) - (binaryApplication uniformRenameFormula (extend 6 (extend 7 Fin.elim0)) 3 1)))))))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem realize_renamedChildFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (σ : Name s) (hσ : σ.val ∈ M.sets) (p : P) (y : ZFSet.{u}) (hy : y ∈ M.sets) : - Realize M.sets renamedChildFormula - (extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f))) ↔ - y = (Name.rename s f σ).val := by - let base := extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f)) - have hp := M.transitive carrier (s.encode_mem p) - have hz := M.orderedPair_mem pairing hσ hp - rw [renamedChildFormula, realize_ex] - constructor - · rintro ⟨x, hx, rest⟩ - obtain ⟨r, shape, name, renamed⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest - let e := extend (s.encode r) (extend x base) - have raw := (M.realize_orderedPairFormula pairing 2 1 0 e hz hx - (M.transitive carrier (s.encode_mem r))).1 shape - change ZFSet.pair σ.val (s.encode p) = ZFSet.pair x (s.encode r) at raw - obtain ⟨sx, pr⟩ := ZFSet.pair_inj.1 raw - have cond := s.injective pr - subst x - subst r - rw [realize_domainApplication, map_extend, map_empty] at name - have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name - rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed - have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph - σ ⟨y, nameY⟩ hσ hy).1 renamed - exact (congrArg Subtype.val eq).symm - · intro eq - subst y - refine ⟨σ.val, hσ, ?_⟩ - apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2 - refine ⟨p, ?_, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hp).2 rfl - · rw [realize_domainApplication, map_extend, map_empty] - exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2 - (Name.rename s f σ).property - · rw [realize_binaryApplication, map_extend, map_extend, map_empty] - exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph - σ (Name.rename s f σ) hσ hy).2 rfl - -theorem realize_renamedEntryFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (τ : Name s) (hτ : τ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets renamedEntryFormula (extend z (extend τ.val (renameParameters s f))) ↔ - z ∈ (Name.rename s f τ).val := by - let base := extend z (extend τ.val (renameParameters s f)) - rw [renamedEntryFormula, realize_ex] - constructor - · rintro ⟨x, hx, rest⟩ - obtain ⟨p, old, rest⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest - have entry := (M.realize_pairMembershipFormula pairing 1 0 3 - (extend (s.encode p) (extend x base)) hx (M.transitive carrier (s.encode_mem p)) hτ).1 old - let σ : Name s := ⟨x, Name.isName_of_pair_mem τ x p entry⟩ - obtain ⟨y, hy, rest⟩ := (realize_ex M.sets _ _).1 rest - obtain ⟨q, shape, condition, name, renamed⟩ := (M.realize_exConditions s 5 _ - (extend y (extend (s.encode p) (extend x base))) carrier rfl).1 rest - let e := extend (s.encode q) (extend y (extend (s.encode p) (extend x base))) - have raw := (M.realize_orderedPairFormula pairing 4 1 0 e hz hy - (M.transitive carrier (s.encode_mem q))).1 shape - have cond := (M.realize_pairMembershipFormula pairing 2 0 7 e - (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).1 condition - have pq := (s.pair_mem_graph s f p q).1 cond - rw [realize_domainApplication, map_extend, map_empty] at name - have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name - let ν : Name s := ⟨y, nameY⟩ - rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed - have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hx hy).1 renamed - have member := (Name.entry_rename s f τ ν q).2 ⟨σ, p, entry, eq, pq⟩ - change z = ZFSet.pair y (s.encode q) at raw - rw [raw] - exact member - · intro member - obtain ⟨ν, q, rfl⟩ := Name.entries_cover (Name.rename s f τ) member - obtain ⟨σ, p, entry, image, cond⟩ := (Name.entry_rename s f τ ν q).1 member - have hσ := (M.nameDomain s).children hτ entry - have hν := M.pair_left hz - refine ⟨σ.val, hσ, ?_⟩ - apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2 - refine ⟨p, ?_, ?_⟩ - · exact (M.realize_pairMembershipFormula pairing 1 0 3 _ hσ - (M.transitive carrier (s.encode_mem p)) hτ).2 entry - · rw [realize_ex] - refine ⟨ν.val, hν, ?_⟩ - apply (M.realize_exConditions s 5 _ (extend ν.val (extend (s.encode p) (extend σ.val base))) carrier rfl).2 - let e := extend (s.encode q) (extend ν.val (extend (s.encode p) (extend σ.val base))) - refine ⟨q, ?_, ?_, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing 4 1 0 e hz hν - (M.transitive carrier (s.encode_mem q))).2 rfl - · exact (M.realize_pairMembershipFormula pairing 2 0 7 e - (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).2 - ((s.pair_mem_graph s f p q).2 cond) - · rw [realize_domainApplication, map_extend, map_empty] - exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier ν.val hν).2 ν.property - · rw [realize_binaryApplication, map_extend, map_extend, map_empty] - exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hσ hν).2 image - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def renamedChildFormula : SetFormula 4 := + ex (exConditions 3 (.conj (orderedPairFormula 2 1 0) + (.conj (domainApplication uniformNameFormula (extend 4 Fin.elim0) 3) + (binaryApplication uniformRenameFormula (extend 4 (extend 5 Fin.elim0)) 1 3)))) + +def renamedEntryFormula : SetFormula 4 := + ex (exConditions 3 (.conj (pairMembershipFormula 1 0 3) + (ex (exConditions 5 (.conj (orderedPairFormula 4 1 0) + (.conj (pairMembershipFormula 2 0 7) + (.conj (domainApplication uniformNameFormula (extend 6 Fin.elim0) 1) + (binaryApplication uniformRenameFormula (extend 6 (extend 7 Fin.elim0)) 3 1)))))))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem realize_renamedChildFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (σ : Name s) (hσ : σ.val ∈ M.sets) (p : P) (y : ZFSet.{u}) (hy : y ∈ M.sets) : + Realize M.sets renamedChildFormula + (extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f))) ↔ + y = (Name.rename s f σ).val := by + let base := extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f)) + have hp := M.transitive carrier (s.encode_mem p) + have hz := M.orderedPair_mem pairing hσ hp + rw [renamedChildFormula, realize_ex] + constructor + · rintro ⟨x, hx, rest⟩ + obtain ⟨r, shape, name, renamed⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest + let e := extend (s.encode r) (extend x base) + have raw := (M.realize_orderedPairFormula pairing 2 1 0 e hz hx + (M.transitive carrier (s.encode_mem r))).1 shape + change ZFSet.pair σ.val (s.encode p) = ZFSet.pair x (s.encode r) at raw + obtain ⟨sx, pr⟩ := ZFSet.pair_inj.1 raw + have cond := s.injective pr + subst x + subst r + rw [realize_domainApplication, map_extend, map_empty] at name + have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name + rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed + have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph + σ ⟨y, nameY⟩ hσ hy).1 renamed + exact (congrArg Subtype.val eq).symm + · intro eq + subst y + refine ⟨σ.val, hσ, ?_⟩ + apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2 + refine ⟨p, ?_, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hp).2 rfl + · rw [realize_domainApplication, map_extend, map_empty] + exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2 + (Name.rename s f σ).property + · rw [realize_binaryApplication, map_extend, map_extend, map_empty] + exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph + σ (Name.rename s f σ) hσ hy).2 rfl + +theorem realize_renamedEntryFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (τ : Name s) (hτ : τ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets renamedEntryFormula (extend z (extend τ.val (renameParameters s f))) ↔ + z ∈ (Name.rename s f τ).val := by + let base := extend z (extend τ.val (renameParameters s f)) + rw [renamedEntryFormula, realize_ex] + constructor + · rintro ⟨x, hx, rest⟩ + obtain ⟨p, old, rest⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest + have entry := (M.realize_pairMembershipFormula pairing 1 0 3 + (extend (s.encode p) (extend x base)) hx (M.transitive carrier (s.encode_mem p)) hτ).1 old + let σ : Name s := ⟨x, Name.isName_of_pair_mem τ x p entry⟩ + obtain ⟨y, hy, rest⟩ := (realize_ex M.sets _ _).1 rest + obtain ⟨q, shape, condition, name, renamed⟩ := (M.realize_exConditions s 5 _ + (extend y (extend (s.encode p) (extend x base))) carrier rfl).1 rest + let e := extend (s.encode q) (extend y (extend (s.encode p) (extend x base))) + have raw := (M.realize_orderedPairFormula pairing 4 1 0 e hz hy + (M.transitive carrier (s.encode_mem q))).1 shape + have cond := (M.realize_pairMembershipFormula pairing 2 0 7 e + (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).1 condition + have pq := (s.pair_mem_graph s f p q).1 cond + rw [realize_domainApplication, map_extend, map_empty] at name + have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name + let ν : Name s := ⟨y, nameY⟩ + rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed + have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hx hy).1 renamed + have member := (Name.entry_rename s f τ ν q).2 ⟨σ, p, entry, eq, pq⟩ + change z = ZFSet.pair y (s.encode q) at raw + rw [raw] + exact member + · intro member + obtain ⟨ν, q, rfl⟩ := Name.entries_cover (Name.rename s f τ) member + obtain ⟨σ, p, entry, image, cond⟩ := (Name.entry_rename s f τ ν q).1 member + have hσ := (M.nameDomain s).children hτ entry + have hν := M.pair_left hz + refine ⟨σ.val, hσ, ?_⟩ + apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2 + refine ⟨p, ?_, ?_⟩ + · exact (M.realize_pairMembershipFormula pairing 1 0 3 _ hσ + (M.transitive carrier (s.encode_mem p)) hτ).2 entry + · rw [realize_ex] + refine ⟨ν.val, hν, ?_⟩ + apply (M.realize_exConditions s 5 _ (extend ν.val (extend (s.encode p) (extend σ.val base))) carrier rfl).2 + let e := extend (s.encode q) (extend ν.val (extend (s.encode p) (extend σ.val base))) + refine ⟨q, ?_, ?_, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing 4 1 0 e hz hν + (M.transitive carrier (s.encode_mem q))).2 rfl + · exact (M.realize_pairMembershipFormula pairing 2 0 7 e + (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).2 + ((s.pair_mem_graph s f p q).2 cond) + · rw [realize_domainApplication, map_extend, map_empty] + exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier ν.val hν).2 ν.property + · rw [realize_binaryApplication, map_extend, map_extend, map_empty] + exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hσ hν).2 image + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RepresentativeProductAgreement.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RepresentativeProductAgreement.lean index 45d2161406d91b79ff5906f86907c4cc7bc54818..47ba31f090afb31d66ce6bd14255557d712d2403 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RepresentativeProductAgreement.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RepresentativeProductAgreement.lean @@ -1,120 +1,120 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.InitialRepresentativeAgreement - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -theorem TaskRepresentative.source_mem - {P r A R U Labels I i g a : ZFSet.{u}} - (represented : TaskRepresentative P r A R U Labels i g) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) : a ∈ P := by - obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, _⟩ := represented - have aEq : a = a' := - ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2 - exact aEq.symm ▸ ha - -theorem TaskTransportCode.representative_product_agreement - {P R U Labels A δ i j G m one r g h k I a : ZFSet.{u}} - (transport : TaskTransportCode P R U Labels A δ i j) - (action : PosetActionCode G P m one r A) - (hδ : δ ∈ G) (hg : g ∈ G) (hk : k ∈ G) - (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) - (first : TaskRepresentative P r A R U Labels i g) - (second : TaskRepresentative P r A R U Labels j h) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) : - ActionAgreementBelow P r A k h a := by - obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, - c', _, base', _, s', _, F', _, old, new, target, _, baseEq, _⟩ := transport - have aEq : a = a' := - ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (old ▸ source)).2 - have oldRestriction := (old ▸ first).restriction - have newRestriction := (new ▸ second).restriction - have composed := oldRestriction.transport action hg hδ hk product target - rw [baseEq] at newRestriction - intro x hx y _ lower - exact (composed.base_action_iff action hx (aEq ▸ lower)).symm.trans - (newRestriction.base_action_iff action hx (aEq ▸ lower)) - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem groundTaskRepresentatives_product_agreement - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one Reps δ i j g h k a : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) - (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps) - (represents : ∀ i g, ZFSet.pair i g ∈ Reps → - TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g) - (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps) - (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ActionAgreementBelow d.batchCarrier d.batchOrder - (M.groundEligibleBatchAction P G r μ A Labels) k h a := by - have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task - have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2 - have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2 - have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2 - have old := transported.2.2.2.representative_product_agreement action transported.1 hg hk - product (represents i g first) (represents j h second) source - exact M.groundEligibleBatchAction_agreement pairing unions powers separation hP hG hA - group action meet hk hh ((represents i g first).source_mem source) old - -theorem groundTaskRepresentatives_composed_entry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one Reps δ i j g h a x y z : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) - (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps) - (represents : ∀ i g, ZFSet.pair i g ∈ Reps → - TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g) - (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps) - (hx : x ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchCarrier) - (lower : ZFSet.pair x a ∈ - (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchOrder) - (firstAction : ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels) - (secondAction : ZFSet.pair (ZFSet.pair h x) z ∈ M.groundEligibleBatchAction P G r μ A Labels) : - ZFSet.pair (ZFSet.pair δ y) z ∈ M.groundEligibleBatchAction P G r μ A Labels := by - have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task - have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2 - have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2 - obtain ⟨k, product, _⟩ := group.mul_function.2 (ZFSet.pair δ g) - (ZFSet.pair_mem_prod.2 ⟨transported.1, hg⟩) - have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2 - have agree := M.groundTaskRepresentatives_product_agreement pairing unions powers separation - hP hG hA group action meet reps represents task source first second product - have full := M.groundEligibleBatchAction_code (Labels := Labels) - pairing unions powers separation hP hG hA group action meet - have hy := (ZFSet.pair_mem_prod.1 (full.function.1 firstAction)).2 - obtain ⟨w, acted, _⟩ := full.function.2 (ZFSet.pair δ y) - (ZFSet.pair_mem_prod.2 ⟨transported.1, hy⟩) - have hw := (ZFSet.pair_mem_prod.1 (full.function.1 acted)).2 - have composed := full.mul δ transported.1 g hg k hk x hx y hy w hw product firstAction acted - have equal := agree.entry_eq full hh hx lower composed secondAction - exact equal ▸ acted - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.InitialRepresentativeAgreement + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +theorem TaskRepresentative.source_mem + {P r A R U Labels I i g a : ZFSet.{u}} + (represented : TaskRepresentative P r A R U Labels i g) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) : a ∈ P := by + obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, _⟩ := represented + have aEq : a = a' := + ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2 + exact aEq.symm ▸ ha + +theorem TaskTransportCode.representative_product_agreement + {P R U Labels A δ i j G m one r g h k I a : ZFSet.{u}} + (transport : TaskTransportCode P R U Labels A δ i j) + (action : PosetActionCode G P m one r A) + (hδ : δ ∈ G) (hg : g ∈ G) (hk : k ∈ G) + (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) + (first : TaskRepresentative P r A R U Labels i g) + (second : TaskRepresentative P r A R U Labels j h) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) : + ActionAgreementBelow P r A k h a := by + obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, + c', _, base', _, s', _, F', _, old, new, target, _, baseEq, _⟩ := transport + have aEq : a = a' := + ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (old ▸ source)).2 + have oldRestriction := (old ▸ first).restriction + have newRestriction := (new ▸ second).restriction + have composed := oldRestriction.transport action hg hδ hk product target + rw [baseEq] at newRestriction + intro x hx y _ lower + exact (composed.base_action_iff action hx (aEq ▸ lower)).symm.trans + (newRestriction.base_action_iff action hx (aEq ▸ lower)) + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem groundTaskRepresentatives_product_agreement + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one Reps δ i j g h k a : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) + (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps) + (represents : ∀ i g, ZFSet.pair i g ∈ Reps → + TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g) + (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps) + (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ActionAgreementBelow d.batchCarrier d.batchOrder + (M.groundEligibleBatchAction P G r μ A Labels) k h a := by + have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task + have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2 + have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2 + have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2 + have old := transported.2.2.2.representative_product_agreement action transported.1 hg hk + product (represents i g first) (represents j h second) source + exact M.groundEligibleBatchAction_agreement pairing unions powers separation hP hG hA + group action meet hk hh ((represents i g first).source_mem source) old + +theorem groundTaskRepresentatives_composed_entry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one Reps δ i j g h a x y z : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) + (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps) + (represents : ∀ i g, ZFSet.pair i g ∈ Reps → + TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g) + (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps) + (hx : x ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchCarrier) + (lower : ZFSet.pair x a ∈ + (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchOrder) + (firstAction : ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels) + (secondAction : ZFSet.pair (ZFSet.pair h x) z ∈ M.groundEligibleBatchAction P G r μ A Labels) : + ZFSet.pair (ZFSet.pair δ y) z ∈ M.groundEligibleBatchAction P G r μ A Labels := by + have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task + have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2 + have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2 + obtain ⟨k, product, _⟩ := group.mul_function.2 (ZFSet.pair δ g) + (ZFSet.pair_mem_prod.2 ⟨transported.1, hg⟩) + have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2 + have agree := M.groundTaskRepresentatives_product_agreement pairing unions powers separation + hP hG hA group action meet reps represents task source first second product + have full := M.groundEligibleBatchAction_code (Labels := Labels) + pairing unions powers separation hP hG hA group action meet + have hy := (ZFSet.pair_mem_prod.1 (full.function.1 firstAction)).2 + obtain ⟨w, acted, _⟩ := full.function.2 (ZFSet.pair δ y) + (ZFSet.pair_mem_prod.2 ⟨transported.1, hy⟩) + have hw := (ZFSet.pair_mem_prod.1 (full.function.1 acted)).2 + have composed := full.mul δ transported.1 g hg k hk x hx y hy w hw product firstAction acted + have equal := agree.entry_eq full hh hx lower composed secondAction + exact equal ▸ acted + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RootedSupportOwnerFunction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RootedSupportOwnerFunction.lean index 891eba08662267e7b9d0c14f8efea3de804c3b18..a49c63ebe09d3d841855b8a25e345ebfaf30d7d1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RootedSupportOwnerFunction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RootedSupportOwnerFunction.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RootedSupportOrder - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -universe u -variable {V : Type u} (d : Scheme V) - -noncomputable def owner (x : d.Node) : V := - Classical.choose (d.existsUnique_leastSupport x) - -theorem owner_least (x : d.Node) : d.LeastSupport (d.owner x) x := - (Classical.choose_spec (d.existsUnique_leastSupport x)).1 - -theorem owner_eq_iff (x : d.Node) (v : V) : - d.owner x = v ↔ d.LeastSupport v x := by - constructor - · intro eq - rw [← eq] - exact d.owner_least x - · exact d.leastSupport_unique (d.owner_least x) - -theorem owner_depth_mono {x y : d.Node} (lower : d.gluedOrder.le x y) : - d.depth (d.owner x) ≤ d.depth (d.owner y) := - d.leastSupport_depth_mono (d.owner_least x) (d.owner_least y) lower - -theorem owner_eq_of_depth_eq {x y : d.Node} (lower : d.gluedOrder.le x y) - (same : d.depth (d.owner x) = d.depth (d.owner y)) : d.owner x = d.owner y := - d.leastSupport_eq_of_depth_eq (d.owner_least x) (d.owner_least y) lower same - -theorem owner_root_iff (x : d.Node) : d.owner x = d.root ↔ d.Supports d.root x := - (d.owner_eq_iff x d.root).trans (d.leastSupport_root_iff x) - -noncomputable def ownerCoordinate (x : d.Node) : d.Space (d.owner x) := - Classical.choose (d.owner_least x).1 - -theorem ownerCoordinate_entry (x : d.Node) : - (d.vertex (d.owner x)).toFun (d.ownerCoordinate x) = x := - Classical.choose_spec (d.owner_least x).1 - -theorem ownerCoordinate_unique (x : d.Node) (a : d.Space (d.owner x)) - (entry : (d.vertex (d.owner x)).toFun a = x) : a = d.ownerCoordinate x := - embedding_injective (d.vertex (d.owner x)).toMeetEmbedding - (entry.trans (d.ownerCoordinate_entry x).symm) - -theorem ownerCoordinate_fresh (x : d.Node) (nonroot : d.depth (d.owner x) ≠ 0) : - ¬ (d.order (d.owner x)).le (d.ownerCoordinate x) (d.childAnchor (d.owner x) nonroot) := by - apply (d.leastSupport_vertex_iff (d.owner x) nonroot (d.ownerCoordinate x)).mp - rw [d.ownerCoordinate_entry] - exact d.owner_least x - -end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RootedSupportOrder + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +universe u +variable {V : Type u} (d : Scheme V) + +noncomputable def owner (x : d.Node) : V := + Classical.choose (d.existsUnique_leastSupport x) + +theorem owner_least (x : d.Node) : d.LeastSupport (d.owner x) x := + (Classical.choose_spec (d.existsUnique_leastSupport x)).1 + +theorem owner_eq_iff (x : d.Node) (v : V) : + d.owner x = v ↔ d.LeastSupport v x := by + constructor + · intro eq + rw [← eq] + exact d.owner_least x + · exact d.leastSupport_unique (d.owner_least x) + +theorem owner_depth_mono {x y : d.Node} (lower : d.gluedOrder.le x y) : + d.depth (d.owner x) ≤ d.depth (d.owner y) := + d.leastSupport_depth_mono (d.owner_least x) (d.owner_least y) lower + +theorem owner_eq_of_depth_eq {x y : d.Node} (lower : d.gluedOrder.le x y) + (same : d.depth (d.owner x) = d.depth (d.owner y)) : d.owner x = d.owner y := + d.leastSupport_eq_of_depth_eq (d.owner_least x) (d.owner_least y) lower same + +theorem owner_root_iff (x : d.Node) : d.owner x = d.root ↔ d.Supports d.root x := + (d.owner_eq_iff x d.root).trans (d.leastSupport_root_iff x) + +noncomputable def ownerCoordinate (x : d.Node) : d.Space (d.owner x) := + Classical.choose (d.owner_least x).1 + +theorem ownerCoordinate_entry (x : d.Node) : + (d.vertex (d.owner x)).toFun (d.ownerCoordinate x) = x := + Classical.choose_spec (d.owner_least x).1 + +theorem ownerCoordinate_unique (x : d.Node) (a : d.Space (d.owner x)) + (entry : (d.vertex (d.owner x)).toFun a = x) : a = d.ownerCoordinate x := + embedding_injective (d.vertex (d.owner x)).toMeetEmbedding + (entry.trans (d.ownerCoordinate_entry x).symm) + +theorem ownerCoordinate_fresh (x : d.Node) (nonroot : d.depth (d.owner x) ≠ 0) : + ¬ (d.order (d.owner x)).le (d.ownerCoordinate x) (d.childAnchor (d.owner x) nonroot) := by + apply (d.leastSupport_vertex_iff (d.owner x) nonroot (d.ownerCoordinate x)).mp + rw [d.ownerCoordinate_entry] + exact d.owner_least x + +end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentCutGraphLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentCutGraphLaws.lean index 464b1c2076e59ad87a8116af8494a6510cd17d75..a4ed93a11239c42d6fd2b31ab4e1796a1716f5c7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentCutGraphLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentCutGraphLaws.lean @@ -1,87 +1,87 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentCuts - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem rowAssignmentCutGraph_function (upper lower levels alpha : ZFSet.{u}) - (flat : ∀ p ∈ upper, ∃ row A, p = ZFSet.pair row A) - (closed : ∀ row A, ZFSet.pair row A ∈ upper → - ZFSet.pair row (assignmentCut levels alpha A) ∈ lower) : - ZFSet.IsFunc upper lower (rowAssignmentCutGraph upper lower levels alpha) := by - refine ⟨fun _ h => ((mem_rowAssignmentCutGraph _ _ _ _ _).1 h).1, ?_⟩ - intro p hp - obtain ⟨row, A, rfl⟩ := flat p hp - refine ⟨ZFSet.pair row (assignmentCut levels alpha A), - (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, closed row A hp, rfl⟩, ?_⟩ - intro q entry - exact ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 entry).2.2 - -theorem rowAssignmentCutGraph_compose - (upper middle lower outerLevels beta innerLevels alpha directLevels gamma : ZFSet.{u}) - (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper → - ZFSet.pair row (assignmentCut outerLevels beta A) ∈ middle) - (coherent : ∀ row A, ZFSet.pair row A ∈ upper → - assignmentCut innerLevels alpha (assignmentCut outerLevels beta A) = - assignmentCut directLevels gamma A) : - relationCompose upper middle lower - (rowAssignmentCutGraph upper middle outerLevels beta) - (rowAssignmentCutGraph middle lower innerLevels alpha) = - rowAssignmentCutGraph upper lower directLevels gamma := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨p, hp, q, _, w, hw, rfl, first, second⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz - obtain ⟨_, row, A, equal⟩ := (mem_rowAssignmentCutGraph _ _ _ _ _).1 first - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have value := ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 second).2.2 - rw [coherent row A hp] at value - exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hw, value⟩ - · intro hz - obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz - obtain ⟨hp, hw⟩ := ZFSet.pair_mem_prod.1 bound - have hm := middle_valid row A hp - exact (mem_relationCompose _ _ _ _ _ _).2 - ⟨ZFSet.pair row A, hp, ZFSet.pair row (assignmentCut outerLevels beta A), hm, - ZFSet.pair row (assignmentCut directLevels gamma A), hw, rfl, - (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hm, rfl⟩, - (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 - ⟨hm, hw, congrArg (ZFSet.pair row) (coherent row A hp).symm⟩⟩ - -theorem rowAssignmentCutGraph_nested (upper middle lower levels alpha beta : ZFSet.{u}) - (below : alpha ⊆ beta) - (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper → - ZFSet.pair row (assignmentCut levels beta A) ∈ middle) : - relationCompose upper middle lower (rowAssignmentCutGraph upper middle levels beta) - (rowAssignmentCutGraph middle lower levels alpha) = - rowAssignmentCutGraph upper lower levels alpha := - rowAssignmentCutGraph_compose upper middle lower levels beta levels alpha levels alpha - middle_valid (fun _ _ _ => assignmentCut_nested below) - -theorem rowAssignmentCutGraph_identity (carrier levels alpha : ZFSet.{u}) - (flat : ∀ p ∈ carrier, ∃ row A, p = ZFSet.pair row A) - (fixed : ∀ row A, ZFSet.pair row A ∈ carrier → assignmentCut levels alpha A = A) : - rowAssignmentCutGraph carrier carrier levels alpha = identityFunctionGraph carrier := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz - have hp := (ZFSet.pair_mem_prod.1 bound).1 - rw [fixed row A hp] - exact (mem_identityFunctionGraph _ _).2 ⟨ZFSet.pair row A, hp, rfl⟩ - · intro hz - obtain ⟨p, hp, rfl⟩ := (mem_identityFunctionGraph _ _).1 hz - obtain ⟨row, A, rfl⟩ := flat p hp - exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 - ⟨hp, hp, congrArg (ZFSet.pair row) (fixed row A hp).symm⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentCuts + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem rowAssignmentCutGraph_function (upper lower levels alpha : ZFSet.{u}) + (flat : ∀ p ∈ upper, ∃ row A, p = ZFSet.pair row A) + (closed : ∀ row A, ZFSet.pair row A ∈ upper → + ZFSet.pair row (assignmentCut levels alpha A) ∈ lower) : + ZFSet.IsFunc upper lower (rowAssignmentCutGraph upper lower levels alpha) := by + refine ⟨fun _ h => ((mem_rowAssignmentCutGraph _ _ _ _ _).1 h).1, ?_⟩ + intro p hp + obtain ⟨row, A, rfl⟩ := flat p hp + refine ⟨ZFSet.pair row (assignmentCut levels alpha A), + (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, closed row A hp, rfl⟩, ?_⟩ + intro q entry + exact ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 entry).2.2 + +theorem rowAssignmentCutGraph_compose + (upper middle lower outerLevels beta innerLevels alpha directLevels gamma : ZFSet.{u}) + (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper → + ZFSet.pair row (assignmentCut outerLevels beta A) ∈ middle) + (coherent : ∀ row A, ZFSet.pair row A ∈ upper → + assignmentCut innerLevels alpha (assignmentCut outerLevels beta A) = + assignmentCut directLevels gamma A) : + relationCompose upper middle lower + (rowAssignmentCutGraph upper middle outerLevels beta) + (rowAssignmentCutGraph middle lower innerLevels alpha) = + rowAssignmentCutGraph upper lower directLevels gamma := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨p, hp, q, _, w, hw, rfl, first, second⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz + obtain ⟨_, row, A, equal⟩ := (mem_rowAssignmentCutGraph _ _ _ _ _).1 first + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have value := ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 second).2.2 + rw [coherent row A hp] at value + exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hw, value⟩ + · intro hz + obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz + obtain ⟨hp, hw⟩ := ZFSet.pair_mem_prod.1 bound + have hm := middle_valid row A hp + exact (mem_relationCompose _ _ _ _ _ _).2 + ⟨ZFSet.pair row A, hp, ZFSet.pair row (assignmentCut outerLevels beta A), hm, + ZFSet.pair row (assignmentCut directLevels gamma A), hw, rfl, + (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hm, rfl⟩, + (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 + ⟨hm, hw, congrArg (ZFSet.pair row) (coherent row A hp).symm⟩⟩ + +theorem rowAssignmentCutGraph_nested (upper middle lower levels alpha beta : ZFSet.{u}) + (below : alpha ⊆ beta) + (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper → + ZFSet.pair row (assignmentCut levels beta A) ∈ middle) : + relationCompose upper middle lower (rowAssignmentCutGraph upper middle levels beta) + (rowAssignmentCutGraph middle lower levels alpha) = + rowAssignmentCutGraph upper lower levels alpha := + rowAssignmentCutGraph_compose upper middle lower levels beta levels alpha levels alpha + middle_valid (fun _ _ _ => assignmentCut_nested below) + +theorem rowAssignmentCutGraph_identity (carrier levels alpha : ZFSet.{u}) + (flat : ∀ p ∈ carrier, ∃ row A, p = ZFSet.pair row A) + (fixed : ∀ row A, ZFSet.pair row A ∈ carrier → assignmentCut levels alpha A = A) : + rowAssignmentCutGraph carrier carrier levels alpha = identityFunctionGraph carrier := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz + have hp := (ZFSet.pair_mem_prod.1 bound).1 + rw [fixed row A hp] + exact (mem_identityFunctionGraph _ _).2 ⟨ZFSet.pair row A, hp, rfl⟩ + · intro hz + obtain ⟨p, hp, rfl⟩ := (mem_identityFunctionGraph _ _).1 hz + obtain ⟨row, A, rfl⟩ := flat p hp + exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 + ⟨hp, hp, congrArg (ZFSet.pair row) (fixed row A hp).symm⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentTransitionFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentTransitionFormulas.lean index 3fed048c99ce9d5e6c25f328356b3815eb89a637..8941ba29e72dc2981cd82db2bc2996eb9c2aef60 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentTransitionFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentTransitionFormulas.lean @@ -1,129 +1,129 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RowAssignmentTransitionFamilies - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -namespace BoundedFormula -private def cutGraphProductMember {n : Nat} (z upper lower : Fin n) : BoundedFormula n := - exMem upper (exMem lower.succ (orderedPairFormula z.succ.succ 1 0)) - -private theorem truth_cutGraphProductMember {n : Nat} (z upper lower : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (cutGraphProductMember z upper lower) env ↔ env z ∈ ZFSet.prod (env upper) (env lower) := by - simp only [cutGraphProductMember, truth_exMem, truth_orderedPairFormula] - constructor - · rintro ⟨x, hx, y, hy, equal⟩ - change env z = ZFSet.pair x y at equal - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ - · intro hz - obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 hz - exact ⟨x, hx, y, hy, equal⟩ -end BoundedFormula - -namespace SetFormula -def rowAssignmentCutGraphFormula {n : Nat} (output upper lower levels alpha : Fin n) : SetFormula n := - exactSetFormula output - (.conj (BoundedFormula.cutGraphProductMember 0 upper.succ lower.succ).toFormula - (rowAssignmentCutFormula 0 levels.succ alpha.succ)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_rowAssignmentCutGraphFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {n : Nat} (output upper lower levels alpha : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (rowAssignmentCutGraphFormula output upper lower levels alpha) env ↔ - env output = rowAssignmentCutGraph (env upper) (env lower) (env levels) (env alpha) := by - have ground := M.rowAssignmentCutGraph_mem pairing unions powers separation - (members upper) (members lower) (members levels) (members alpha) - apply M.realize_exactSetFormula output _ env (members output) (fun _ hz => M.transitive ground hz) - intro z hz - have allGround : ∀ j, (extend z env) j ∈ M.sets := Fin.cases hz members - change (Realize M.sets (BoundedFormula.cutGraphProductMember 0 upper.succ lower.succ).toFormula - (extend z env) ∧ Realize M.sets (rowAssignmentCutFormula 0 levels.succ alpha.succ) - (extend z env)) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ allGround, - BoundedFormula.truth_cutGraphProductMember, - M.realize_rowAssignmentCutFormula 0 levels.succ alpha.succ _ allGround] - exact (mem_rowAssignmentCutGraph _ _ _ _ z).symm - -end TransitiveGround - -namespace SetFormula -private def rowTransitionBody {n : Nat} (z stages history W : Fin n) : BoundedFormula (n + 5) := - let old := suffixIndex n 5 - let v := prefixIndex n 5 - .conj (.mem (v 0) (old stages)) - (.conj (.mem (v 1) (old stages)) - (.conj (.mem (v 4) (old W)) - (.conj (BoundedFormula.orderedTripleFormula (old z) (v 0) (v 1) (v 4)) - (.conj (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old history)) - (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old history)))))) - -def rowAssignmentTransitionFormula {n : Nat} (z stages history levels W : Fin n) : SetFormula n := - let old := suffixIndex n 5 - let v := prefixIndex n 5 - exBlock 5 (.conj (rowTransitionBody z stages history W).toFormula - (rowAssignmentCutGraphFormula (v 4) (v 2) (v 3) (old levels) (v 1))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_rowAssignmentTransitionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {n : Nat} (z stages history levels W : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (rowAssignmentTransitionFormula z stages history levels W) env ↔ - ∃ i ∈ env stages, ∃ j ∈ env stages, ∃ Qi Qj R, - R ∈ env W ∧ env z = ZFSet.pair (ZFSet.pair i j) R ∧ - ZFSet.pair i Qi ∈ env history ∧ ZFSet.pair j Qj ∈ env history ∧ - R = rowAssignmentCutGraph Qi Qj (env levels) j := by - rw [rowAssignmentTransitionFormula, realize_exBlock] - have actual (f : Fin 5 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (.conj (SetFormula.rowTransitionBody z stages history W).toFormula - (rowAssignmentCutGraphFormula (prefixIndex n 5 4) (prefixIndex n 5 2) - (prefixIndex n 5 3) (suffixIndex n 5 levels) (prefixIndex n 5 1))) - (extendMany 5 f env) ↔ - (f 0 ∈ env stages ∧ f 1 ∈ env stages ∧ f 4 ∈ env W ∧ - env z = ZFSet.pair (ZFSet.pair (f 0) (f 1)) (f 4) ∧ - ZFSet.pair (f 0) (f 2) ∈ env history ∧ ZFSet.pair (f 1) (f 3) ∈ env history) ∧ - f 4 = rowAssignmentCutGraph (f 2) (f 3) (env levels) (f 1) := by - change (Realize M.sets (SetFormula.rowTransitionBody z stages history W).toFormula _ ∧ - Realize M.sets (rowAssignmentCutGraphFormula _ _ _ _ _) _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members), - M.realize_rowAssignmentCutGraphFormula pairing unions powers separation _ _ _ _ _ _ - (extendMany_members 5 f env ground members)] - simp only [SetFormula.rowTransitionBody, BoundedFormula.Truth, - BoundedFormula.truth_orderedTripleFormula, BoundedFormula.truth_pairMembershipFormula, - extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, body⟩ - obtain ⟨⟨hi, hj, hR, equal, first, second⟩, output⟩ := (actual f ground).1 body - exact ⟨f 0, hi, f 1, hj, f 2, f 3, f 4, hR, equal, first, second, output⟩ - · rintro ⟨i, hi, j, hj, Qi, Qj, R, hR, equal, first, second, output⟩ - let f : Fin 5 → ZFSet.{u} := ![i, j, Qi, Qj, R] - have ground : ∀ k, f k ∈ M.sets := - Fin.cases (M.transitive (members stages) hi) - (Fin.cases (M.transitive (members stages) hj) - (Fin.cases (M.pair_right (M.transitive (members history) first)) - (Fin.cases (M.pair_right (M.transitive (members history) second)) - (Fin.cases (M.transitive (members W) hR) (fun k => Fin.elim0 k))))) - exact ⟨f, ground, (actual f ground).2 ⟨⟨hi, hj, hR, equal, first, second⟩, output⟩⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RowAssignmentTransitionFamilies + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +namespace BoundedFormula +private def cutGraphProductMember {n : Nat} (z upper lower : Fin n) : BoundedFormula n := + exMem upper (exMem lower.succ (orderedPairFormula z.succ.succ 1 0)) + +private theorem truth_cutGraphProductMember {n : Nat} (z upper lower : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (cutGraphProductMember z upper lower) env ↔ env z ∈ ZFSet.prod (env upper) (env lower) := by + simp only [cutGraphProductMember, truth_exMem, truth_orderedPairFormula] + constructor + · rintro ⟨x, hx, y, hy, equal⟩ + change env z = ZFSet.pair x y at equal + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ + · intro hz + obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 hz + exact ⟨x, hx, y, hy, equal⟩ +end BoundedFormula + +namespace SetFormula +def rowAssignmentCutGraphFormula {n : Nat} (output upper lower levels alpha : Fin n) : SetFormula n := + exactSetFormula output + (.conj (BoundedFormula.cutGraphProductMember 0 upper.succ lower.succ).toFormula + (rowAssignmentCutFormula 0 levels.succ alpha.succ)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_rowAssignmentCutGraphFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {n : Nat} (output upper lower levels alpha : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (rowAssignmentCutGraphFormula output upper lower levels alpha) env ↔ + env output = rowAssignmentCutGraph (env upper) (env lower) (env levels) (env alpha) := by + have ground := M.rowAssignmentCutGraph_mem pairing unions powers separation + (members upper) (members lower) (members levels) (members alpha) + apply M.realize_exactSetFormula output _ env (members output) (fun _ hz => M.transitive ground hz) + intro z hz + have allGround : ∀ j, (extend z env) j ∈ M.sets := Fin.cases hz members + change (Realize M.sets (BoundedFormula.cutGraphProductMember 0 upper.succ lower.succ).toFormula + (extend z env) ∧ Realize M.sets (rowAssignmentCutFormula 0 levels.succ alpha.succ) + (extend z env)) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ allGround, + BoundedFormula.truth_cutGraphProductMember, + M.realize_rowAssignmentCutFormula 0 levels.succ alpha.succ _ allGround] + exact (mem_rowAssignmentCutGraph _ _ _ _ z).symm + +end TransitiveGround + +namespace SetFormula +private def rowTransitionBody {n : Nat} (z stages history W : Fin n) : BoundedFormula (n + 5) := + let old := suffixIndex n 5 + let v := prefixIndex n 5 + .conj (.mem (v 0) (old stages)) + (.conj (.mem (v 1) (old stages)) + (.conj (.mem (v 4) (old W)) + (.conj (BoundedFormula.orderedTripleFormula (old z) (v 0) (v 1) (v 4)) + (.conj (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old history)) + (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old history)))))) + +def rowAssignmentTransitionFormula {n : Nat} (z stages history levels W : Fin n) : SetFormula n := + let old := suffixIndex n 5 + let v := prefixIndex n 5 + exBlock 5 (.conj (rowTransitionBody z stages history W).toFormula + (rowAssignmentCutGraphFormula (v 4) (v 2) (v 3) (old levels) (v 1))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_rowAssignmentTransitionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {n : Nat} (z stages history levels W : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (rowAssignmentTransitionFormula z stages history levels W) env ↔ + ∃ i ∈ env stages, ∃ j ∈ env stages, ∃ Qi Qj R, + R ∈ env W ∧ env z = ZFSet.pair (ZFSet.pair i j) R ∧ + ZFSet.pair i Qi ∈ env history ∧ ZFSet.pair j Qj ∈ env history ∧ + R = rowAssignmentCutGraph Qi Qj (env levels) j := by + rw [rowAssignmentTransitionFormula, realize_exBlock] + have actual (f : Fin 5 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (.conj (SetFormula.rowTransitionBody z stages history W).toFormula + (rowAssignmentCutGraphFormula (prefixIndex n 5 4) (prefixIndex n 5 2) + (prefixIndex n 5 3) (suffixIndex n 5 levels) (prefixIndex n 5 1))) + (extendMany 5 f env) ↔ + (f 0 ∈ env stages ∧ f 1 ∈ env stages ∧ f 4 ∈ env W ∧ + env z = ZFSet.pair (ZFSet.pair (f 0) (f 1)) (f 4) ∧ + ZFSet.pair (f 0) (f 2) ∈ env history ∧ ZFSet.pair (f 1) (f 3) ∈ env history) ∧ + f 4 = rowAssignmentCutGraph (f 2) (f 3) (env levels) (f 1) := by + change (Realize M.sets (SetFormula.rowTransitionBody z stages history W).toFormula _ ∧ + Realize M.sets (rowAssignmentCutGraphFormula _ _ _ _ _) _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members), + M.realize_rowAssignmentCutGraphFormula pairing unions powers separation _ _ _ _ _ _ + (extendMany_members 5 f env ground members)] + simp only [SetFormula.rowTransitionBody, BoundedFormula.Truth, + BoundedFormula.truth_orderedTripleFormula, BoundedFormula.truth_pairMembershipFormula, + extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, body⟩ + obtain ⟨⟨hi, hj, hR, equal, first, second⟩, output⟩ := (actual f ground).1 body + exact ⟨f 0, hi, f 1, hj, f 2, f 3, f 4, hR, equal, first, second, output⟩ + · rintro ⟨i, hi, j, hj, Qi, Qj, R, hR, equal, first, second, output⟩ + let f : Fin 5 → ZFSet.{u} := ![i, j, Qi, Qj, R] + have ground : ∀ k, f k ∈ M.sets := + Fin.cases (M.transitive (members stages) hi) + (Fin.cases (M.transitive (members stages) hj) + (Fin.cases (M.pair_right (M.transitive (members history) first)) + (Fin.cases (M.pair_right (M.transitive (members history) second)) + (Fin.cases (M.transitive (members W) hR) (fun k => Fin.elim0 k))))) + exact ⟨f, ground, (actual f ground).2 ⟨⟨hi, hj, hR, equal, first, second⟩, output⟩⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationEntryFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationEntryFormulas.lean index 670988ffb1ccf3f3044b5a123274fa066fdd665b..f9c25f4aea5ac707aba1b35b40765e12b824b96d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationEntryFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationEntryFormulas.lean @@ -1,93 +1,93 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.SymmetricGroundForcing - -namespace OAI - - -namespace PartitionPilot.Forcing.SetFormula - -def separationEntryFormula {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula (n + 1)) - (params : Fin k → Fin m) (names : Fin n → Fin m) (z τ : Fin m) : SetFormula m := - ex (exConditions (params A.carrier).succ (exConditions (params A.carrier).succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 1) - (.conj (pairMembershipFormula 2 0 τ.succ.succ.succ) - (.conj (pairMembershipFormula 1 0 (params A.order).succ.succ.succ) - (forcingTranslation A φ (fun j => (params j).succ.succ.succ) 1 - (extend 2 (fun i => (names i).succ.succ.succ)))))))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_separationEntryFormula (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula (n + 1)) - (params : Fin k → Fin m) (names : Fin n → Fin m) (zi ti : Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params A.carrier) = s.carrier) (ho : env (params A.order) = s.conditionOrder) - (atomic : M.EqualityMeaning s D A.equality (fun j => env (params j))) - (domain : M.DomainMeaning s D A.domain (fun j => env (params j))) - (nameEnv : Assignment D n) (hnames : ∀ i, env (names i) = (nameEnv i).val.val) - (τ : D.names) (hτ : env ti = τ.val.val) (hz : env zi ∈ M.sets) : - Realize M.sets (separationEntryFormula A φ params names zi ti) env ↔ - env zi ∈ (Name.separationName D φ nameEnv τ.val).val := by - have hτM : env ti ∈ M.sets := hτ ▸ ground τ.val τ.property - rw [separationEntryFormula, realize_ex] - constructor - · rintro ⟨x, hx, rest⟩ - obtain ⟨p, rest⟩ := (M.realize_exConditions s (params A.carrier).succ _ (extend x env) carrier hc).1 rest - obtain ⟨r, shape, old, pr, forced⟩ := (M.realize_exConditions s (params A.carrier).succ.succ _ - (extend (s.encode p) (extend x env)) carrier hc).1 rest - let e := extend (s.encode r) (extend (s.encode p) (extend x env)) - have raw := (M.realize_pairMembershipFormula pairing 2 0 ti.succ.succ.succ e hx - (M.transitive carrier (s.encode_mem r)) hτM).1 old - change ZFSet.pair x (s.encode r) ∈ env ti at raw - rw [hτ] at raw - let σ : Name s := ⟨x, Name.isName_of_pair_mem τ.val x r raw⟩ - have hσ : σ ∈ D.names := D.children τ.property raw - have eq := (M.realize_orderedPairFormula pairing zi.succ.succ.succ 2 1 e hz hx - (M.transitive carrier (s.encode_mem p))).1 shape - have forcing := (M.realize_forcingTranslation s D ground pairing carrier order A φ - (fun j => (params j).succ.succ.succ) 1 (extend 2 (fun i => (names i).succ.succ.succ)) - e hc ho atomic domain p (extend ⟨σ, hσ⟩ nameEnv) rfl - (fun i => Fin.cases rfl (fun j => hnames j) i)).1 forced - change env zi = ZFSet.pair x (s.encode p) at eq - rw [eq] - exact (Name.entry_separationName D φ nameEnv τ.val σ p).2 - ⟨r, raw, (M.realize_conditionLE s pairing carrier order 1 0 (params A.order).succ.succ.succ - e p r rfl rfl ho).1 pr, hσ, forcing⟩ - · intro member - obtain ⟨σ, p, eq⟩ := Name.entries_cover (Name.separationName D φ nameEnv τ.val) member - have entry : Name.Entry σ (Name.separationName D φ nameEnv τ.val) p := by - change ZFSet.pair σ.val (s.encode p) ∈ (Name.separationName D φ nameEnv τ.val).val - rw [← eq] - exact member - obtain ⟨r, old, pr, hσ, forced⟩ := (Name.entry_separationName D φ nameEnv τ.val σ p).1 entry - refine ⟨σ.val, ground σ hσ, ?_⟩ - apply (M.realize_exConditions s (params A.carrier).succ _ (extend σ.val env) carrier hc).2 - refine ⟨p, ?_⟩ - apply (M.realize_exConditions s (params A.carrier).succ.succ _ - (extend (s.encode p) (extend σ.val env)) carrier hc).2 - let e := extend (s.encode r) (extend (s.encode p) (extend σ.val env)) - refine ⟨r, ?_, ?_, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing zi.succ.succ.succ 2 1 e hz (ground σ hσ) - (M.transitive carrier (s.encode_mem p))).2 eq - · apply (M.realize_pairMembershipFormula pairing 2 0 ti.succ.succ.succ e (ground σ hσ) - (M.transitive carrier (s.encode_mem r)) hτM).2 - change ZFSet.pair σ.val (s.encode r) ∈ env ti - rw [hτ] - exact old - · exact (M.realize_conditionLE s pairing carrier order 1 0 (params A.order).succ.succ.succ - e p r rfl rfl ho).2 pr - · exact (M.realize_forcingTranslation s D ground pairing carrier order A φ - (fun j => (params j).succ.succ.succ) 1 (extend 2 (fun i => (names i).succ.succ.succ)) - e hc ho atomic domain p (extend ⟨σ, hσ⟩ nameEnv) rfl - (fun i => Fin.cases rfl (fun j => hnames j) i)).2 forced - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.SymmetricGroundForcing + +namespace OAI + + +namespace PartitionPilot.Forcing.SetFormula + +def separationEntryFormula {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula (n + 1)) + (params : Fin k → Fin m) (names : Fin n → Fin m) (z τ : Fin m) : SetFormula m := + ex (exConditions (params A.carrier).succ (exConditions (params A.carrier).succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 1) + (.conj (pairMembershipFormula 2 0 τ.succ.succ.succ) + (.conj (pairMembershipFormula 1 0 (params A.order).succ.succ.succ) + (forcingTranslation A φ (fun j => (params j).succ.succ.succ) 1 + (extend 2 (fun i => (names i).succ.succ.succ)))))))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_separationEntryFormula (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula (n + 1)) + (params : Fin k → Fin m) (names : Fin n → Fin m) (zi ti : Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params A.carrier) = s.carrier) (ho : env (params A.order) = s.conditionOrder) + (atomic : M.EqualityMeaning s D A.equality (fun j => env (params j))) + (domain : M.DomainMeaning s D A.domain (fun j => env (params j))) + (nameEnv : Assignment D n) (hnames : ∀ i, env (names i) = (nameEnv i).val.val) + (τ : D.names) (hτ : env ti = τ.val.val) (hz : env zi ∈ M.sets) : + Realize M.sets (separationEntryFormula A φ params names zi ti) env ↔ + env zi ∈ (Name.separationName D φ nameEnv τ.val).val := by + have hτM : env ti ∈ M.sets := hτ ▸ ground τ.val τ.property + rw [separationEntryFormula, realize_ex] + constructor + · rintro ⟨x, hx, rest⟩ + obtain ⟨p, rest⟩ := (M.realize_exConditions s (params A.carrier).succ _ (extend x env) carrier hc).1 rest + obtain ⟨r, shape, old, pr, forced⟩ := (M.realize_exConditions s (params A.carrier).succ.succ _ + (extend (s.encode p) (extend x env)) carrier hc).1 rest + let e := extend (s.encode r) (extend (s.encode p) (extend x env)) + have raw := (M.realize_pairMembershipFormula pairing 2 0 ti.succ.succ.succ e hx + (M.transitive carrier (s.encode_mem r)) hτM).1 old + change ZFSet.pair x (s.encode r) ∈ env ti at raw + rw [hτ] at raw + let σ : Name s := ⟨x, Name.isName_of_pair_mem τ.val x r raw⟩ + have hσ : σ ∈ D.names := D.children τ.property raw + have eq := (M.realize_orderedPairFormula pairing zi.succ.succ.succ 2 1 e hz hx + (M.transitive carrier (s.encode_mem p))).1 shape + have forcing := (M.realize_forcingTranslation s D ground pairing carrier order A φ + (fun j => (params j).succ.succ.succ) 1 (extend 2 (fun i => (names i).succ.succ.succ)) + e hc ho atomic domain p (extend ⟨σ, hσ⟩ nameEnv) rfl + (fun i => Fin.cases rfl (fun j => hnames j) i)).1 forced + change env zi = ZFSet.pair x (s.encode p) at eq + rw [eq] + exact (Name.entry_separationName D φ nameEnv τ.val σ p).2 + ⟨r, raw, (M.realize_conditionLE s pairing carrier order 1 0 (params A.order).succ.succ.succ + e p r rfl rfl ho).1 pr, hσ, forcing⟩ + · intro member + obtain ⟨σ, p, eq⟩ := Name.entries_cover (Name.separationName D φ nameEnv τ.val) member + have entry : Name.Entry σ (Name.separationName D φ nameEnv τ.val) p := by + change ZFSet.pair σ.val (s.encode p) ∈ (Name.separationName D φ nameEnv τ.val).val + rw [← eq] + exact member + obtain ⟨r, old, pr, hσ, forced⟩ := (Name.entry_separationName D φ nameEnv τ.val σ p).1 entry + refine ⟨σ.val, ground σ hσ, ?_⟩ + apply (M.realize_exConditions s (params A.carrier).succ _ (extend σ.val env) carrier hc).2 + refine ⟨p, ?_⟩ + apply (M.realize_exConditions s (params A.carrier).succ.succ _ + (extend (s.encode p) (extend σ.val env)) carrier hc).2 + let e := extend (s.encode r) (extend (s.encode p) (extend σ.val env)) + refine ⟨r, ?_, ?_, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing zi.succ.succ.succ 2 1 e hz (ground σ hσ) + (M.transitive carrier (s.encode_mem p))).2 eq + · apply (M.realize_pairMembershipFormula pairing 2 0 ti.succ.succ.succ e (ground σ hσ) + (M.transitive carrier (s.encode_mem r)) hτM).2 + change ZFSet.pair σ.val (s.encode r) ∈ env ti + rw [hτ] + exact old + · exact (M.realize_conditionLE s pairing carrier order 1 0 (params A.order).succ.succ.succ + e p r rfl rfl ho).2 pr + · exact (M.realize_forcingTranslation s D ground pairing carrier order A φ + (fun j => (params j).succ.succ.succ) 1 (extend 2 (fun i => (names i).succ.succ.succ)) + e hc ho atomic domain p (extend ⟨σ, hσ⟩ nameEnv) rfl + (fun i => Fin.cases rfl (fun j => hnames j) i)).2 forced + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationFulfillmentCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationFulfillmentCodes.lean index fb3486feb9c073a0e45d6080e82b9053abe514e2..364685c45a2270d2338455a3908a203aed1edcd5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationFulfillmentCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SeparationFulfillmentCodes.lean @@ -1,194 +1,194 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes - -namespace OAI - - -namespace PartitionPilot.Forcing - -namespace BoundedFormula - -open SetFormula -universe u - -def productRelationFormula {n} (a b c f : Fin n) : BoundedFormula n := - .allMem f (exMem a.succ (exMem b.succ.succ - (exMem c.succ.succ.succ (orderedTripleFormula 3 2 1 0)))) - -def productFunctionFormula {n} (a b c f : Fin n) : BoundedFormula n := - .conj (productRelationFormula a b c f) (.allMem a (.allMem b.succ - (exMem c.succ.succ (.conj (tripleMembershipFormula 2 1 0 f.succ.succ.succ) - (.allMem c.succ.succ.succ (imp - (tripleMembershipFormula 3 2 0 f.succ.succ.succ.succ) (.equal 0 1))))))) - -theorem truth_productRelationFormula {n} (a b c f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (productRelationFormula a b c f) env ↔ - env f ⊆ ZFSet.prod (ZFSet.prod (env a) (env b)) (env c) := by - simp only [productRelationFormula, Truth, truth_exMem, truth_orderedTripleFormula] - constructor - · intro h w hw - obtain ⟨x, hx, y, hy, z, hz, eq⟩ := h w hw - exact ZFSet.mem_prod.2 ⟨ZFSet.pair x y, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, z, hz, eq⟩ - · intro h w hw - obtain ⟨xy, hxy, z, hz, eq⟩ := ZFSet.mem_prod.1 (h hw) - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - exact ⟨x, hx, y, hy, z, hz, eq⟩ - -theorem truth_productFunctionFormula {n} (a b c f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (productFunctionFormula a b c f) env ↔ - ZFSet.IsFunc (ZFSet.prod (env a) (env b)) (env c) (env f) := by - simp only [productFunctionFormula, Truth, truth_productRelationFormula, truth_exMem, - truth_tripleMembershipFormula, truth_imp] - constructor - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro xy hxy - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - obtain ⟨z, _, rel, unique⟩ := total x hx y hy - exact ⟨z, rel, fun w hw => unique w (ZFSet.pair_mem_prod.1 (shape hw)).2 hw⟩ - · rintro ⟨shape, total⟩ - refine ⟨shape, ?_⟩ - intro x hx y hy - obtain ⟨z, rel, unique⟩ := total (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - exact ⟨z, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun w _ hw => unique w hw⟩ - -end BoundedFormula - - - - -universe u - -structure PosetActionCode (G P m e R A : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc (ZFSet.prod G P) P A - one : ∀ p ∈ P, ZFSet.pair (ZFSet.pair e p) p ∈ A - mul : ∀ g ∈ G, ∀ h ∈ G, ∀ k ∈ G, ∀ p ∈ P, ∀ q ∈ P, ∀ r ∈ P, - ZFSet.pair (ZFSet.pair g h) k ∈ m → ZFSet.pair (ZFSet.pair h p) q ∈ A → - ZFSet.pair (ZFSet.pair g q) r ∈ A → ZFSet.pair (ZFSet.pair k p) r ∈ A - monotone : ∀ g ∈ G, ∀ p ∈ P, ∀ q ∈ P, ∀ r ∈ P, ∀ s ∈ P, - ZFSet.pair (ZFSet.pair g p) r ∈ A → ZFSet.pair (ZFSet.pair g q) s ∈ A → - ZFSet.pair p q ∈ R → ZFSet.pair r s ∈ R - -namespace BoundedFormula - -open SetFormula - -def actionOneFormula {n} (p e a : Fin n) : BoundedFormula n := - .allMem p (tripleMembershipFormula e.succ 0 0 a.succ) - -def actionMulFormula {n} (g p m a : Fin n) : BoundedFormula n := - .allMem g (.allMem g.succ (.allMem g.succ.succ (.allMem p.succ.succ.succ - (.allMem p.succ.succ.succ.succ (.allMem p.succ.succ.succ.succ.succ - (imp (.conj (tripleMembershipFormula 5 4 3 m.succ.succ.succ.succ.succ.succ) - (.conj (tripleMembershipFormula 4 2 1 a.succ.succ.succ.succ.succ.succ) - (tripleMembershipFormula 5 1 0 a.succ.succ.succ.succ.succ.succ))) - (tripleMembershipFormula 3 2 0 a.succ.succ.succ.succ.succ.succ))))))) - -def actionMonotoneFormula {n} (g p r a : Fin n) : BoundedFormula n := - .allMem g (.allMem p.succ (.allMem p.succ.succ (.allMem p.succ.succ.succ - (.allMem p.succ.succ.succ.succ - (imp (.conj (tripleMembershipFormula 4 3 1 a.succ.succ.succ.succ.succ) - (.conj (tripleMembershipFormula 4 2 0 a.succ.succ.succ.succ.succ) - (pairMembershipFormula 3 2 r.succ.succ.succ.succ.succ))) - (pairMembershipFormula 1 0 r.succ.succ.succ.succ.succ)))))) - -def posetActionFormula {n} (g p m e r a : Fin n) : BoundedFormula n := - .conj (productFunctionFormula g p p a) (.conj (actionOneFormula p e a) - (.conj (actionMulFormula g p m a) (actionMonotoneFormula g p r a))) - -theorem truth_posetActionFormula {n} (g p m e r a : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (posetActionFormula g p m e r a) env ↔ - PosetActionCode (env g) (env p) (env m) (env e) (env r) (env a) := by - simp only [posetActionFormula, Truth, truth_productFunctionFormula, actionOneFormula, - actionMulFormula, actionMonotoneFormula, truth_tripleMembershipFormula, - truth_pairMembershipFormula, truth_imp] - constructor - · rintro ⟨function, one, mul, monotone⟩ - exact ⟨function, one, - fun g hg h hh k hk p hp q hq r hr gh hpq gr => mul g hg h hh k hk p hp q hq r hr ⟨gh, hpq, gr⟩, - fun g hg p hp q hq r hr s hs gr gs pq => monotone g hg p hp q hq r hr s hs ⟨gr, gs, pq⟩⟩ - · intro h - exact ⟨h.function, h.one, - fun g hg j hj k hk p hp q hq r hr ⟨gj, jq, gr⟩ => h.mul g hg j hj k hk p hp q hq r hr gj jq gr, - fun g hg p hp q hq r hr s hs ⟨gr, gs, pq⟩ => h.monotone g hg p hp q hq r hr s hs gr gs pq⟩ - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_posetActionCode {G P m e R A : ZFSet.{u}} - (hG : G ∈ M.sets) (hP : P ∈ M.sets) (hm : m ∈ M.sets) - (he : e ∈ M.sets) (hR : R ∈ M.sets) (hA : A ∈ M.sets) : - Realize M.sets (BoundedFormula.posetActionFormula 0 1 2 3 4 5).toFormula - (extend G (extend P (extend m (extend e (extend R (extend A Fin.elim0)))))) ↔ - PosetActionCode G P m e R A := - (BoundedFormula.realize_toFormula M _ _ (Fin.cases hG (Fin.cases hP (Fin.cases hm - (Fin.cases he (Fin.cases hR (Fin.cases hA (fun j => Fin.elim0 j)))))))).trans - (BoundedFormula.truth_posetActionFormula 0 1 2 3 4 5 _) - -end TransitiveGround - - - - - -def SeparationActorCode (P r Q R ν A e W k : ZFSet.{u}) : Prop := - ∀ w ∈ Q, ZFSet.pair W w ∈ e → - (∀ z ∈ Q, ZFSet.pair z w ∈ R → ZFSet.pair (ZFSet.pair k z) z ∈ A) ∧ - ∀ x ∈ P, ∀ y ∈ P, ∀ x' ∈ Q, ∀ y' ∈ Q, ∀ z ∈ Q, - ZFSet.pair W x ∈ r → ZFSet.pair W y ∈ r → - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → - ZFSet.pair (ZFSet.pair k x') z ∈ A → ZFSet.pair (ZFSet.pair z y') w ∈ ν - -def SeparationFulfillmentCode (P r Q R ν H A e : ZFSet.{u}) : Prop := - ∀ W ∈ P, ∃ k ∈ H, SeparationActorCode P r Q R ν A e W k - -namespace BoundedFormula - -def separationActorFormula {n} (P r Q R ν A e W k : Fin n) : BoundedFormula n := - .allMem Q (imp (pairMembershipFormula W.succ 0 e.succ) - (.conj - (.allMem Q.succ (imp (pairMembershipFormula 0 1 R.succ.succ) - (tripleMembershipFormula k.succ.succ 0 0 A.succ.succ))) - (.allMem P.succ (.allMem P.succ.succ (.allMem Q.succ.succ.succ - (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ - (imp (pairMembershipFormula W.succ.succ.succ.succ.succ.succ 4 r.succ.succ.succ.succ.succ.succ) - (imp (pairMembershipFormula W.succ.succ.succ.succ.succ.succ 3 r.succ.succ.succ.succ.succ.succ) - (imp (pairMembershipFormula 4 2 e.succ.succ.succ.succ.succ.succ) - (imp (pairMembershipFormula 3 1 e.succ.succ.succ.succ.succ.succ) - (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ.succ 2 0 A.succ.succ.succ.succ.succ.succ) - (tripleMembershipFormula 0 1 5 ν.succ.succ.succ.succ.succ.succ))))))))))))) - -theorem truth_separationActorFormula {n} (P r Q R ν A e W k : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (separationActorFormula P r Q R ν A e W k) env ↔ - SeparationActorCode (env P) (env r) (env Q) (env R) (env ν) (env A) (env e) (env W) (env k) := by - simp only [separationActorFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_tripleMembershipFormula] - rfl - -def separationFulfillmentFormula {n} (P r Q R ν H A e : Fin n) : BoundedFormula n := - .allMem P (.exMem H.succ (separationActorFormula P.succ.succ r.succ.succ Q.succ.succ - R.succ.succ ν.succ.succ A.succ.succ e.succ.succ 1 0)) - -theorem truth_separationFulfillmentFormula {n} (P r Q R ν H A e : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (separationFulfillmentFormula P r Q R ν H A e) env ↔ - SeparationFulfillmentCode (env P) (env r) (env Q) (env R) (env ν) (env H) (env A) (env e) := by - simp only [separationFulfillmentFormula, Truth, truth_exMem, truth_separationActorFormula] - rfl - -theorem realize_separationFulfillmentFormula (M : TransitiveGround.{u}) {n} - (P r Q R ν H A e : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - SetFormula.Realize M.sets (separationFulfillmentFormula P r Q R ν H A e).toFormula env ↔ - SeparationFulfillmentCode (env P) (env r) (env Q) (env R) (env ν) (env H) (env A) (env e) := - (realize_toFormula M _ env members).trans (truth_separationFulfillmentFormula P r Q R ν H A e env) - -end BoundedFormula - - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes + +namespace OAI + + +namespace PartitionPilot.Forcing + +namespace BoundedFormula + +open SetFormula +universe u + +def productRelationFormula {n} (a b c f : Fin n) : BoundedFormula n := + .allMem f (exMem a.succ (exMem b.succ.succ + (exMem c.succ.succ.succ (orderedTripleFormula 3 2 1 0)))) + +def productFunctionFormula {n} (a b c f : Fin n) : BoundedFormula n := + .conj (productRelationFormula a b c f) (.allMem a (.allMem b.succ + (exMem c.succ.succ (.conj (tripleMembershipFormula 2 1 0 f.succ.succ.succ) + (.allMem c.succ.succ.succ (imp + (tripleMembershipFormula 3 2 0 f.succ.succ.succ.succ) (.equal 0 1))))))) + +theorem truth_productRelationFormula {n} (a b c f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (productRelationFormula a b c f) env ↔ + env f ⊆ ZFSet.prod (ZFSet.prod (env a) (env b)) (env c) := by + simp only [productRelationFormula, Truth, truth_exMem, truth_orderedTripleFormula] + constructor + · intro h w hw + obtain ⟨x, hx, y, hy, z, hz, eq⟩ := h w hw + exact ZFSet.mem_prod.2 ⟨ZFSet.pair x y, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, z, hz, eq⟩ + · intro h w hw + obtain ⟨xy, hxy, z, hz, eq⟩ := ZFSet.mem_prod.1 (h hw) + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + exact ⟨x, hx, y, hy, z, hz, eq⟩ + +theorem truth_productFunctionFormula {n} (a b c f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (productFunctionFormula a b c f) env ↔ + ZFSet.IsFunc (ZFSet.prod (env a) (env b)) (env c) (env f) := by + simp only [productFunctionFormula, Truth, truth_productRelationFormula, truth_exMem, + truth_tripleMembershipFormula, truth_imp] + constructor + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro xy hxy + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + obtain ⟨z, _, rel, unique⟩ := total x hx y hy + exact ⟨z, rel, fun w hw => unique w (ZFSet.pair_mem_prod.1 (shape hw)).2 hw⟩ + · rintro ⟨shape, total⟩ + refine ⟨shape, ?_⟩ + intro x hx y hy + obtain ⟨z, rel, unique⟩ := total (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + exact ⟨z, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun w _ hw => unique w hw⟩ + +end BoundedFormula + + + + +universe u + +structure PosetActionCode (G P m e R A : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc (ZFSet.prod G P) P A + one : ∀ p ∈ P, ZFSet.pair (ZFSet.pair e p) p ∈ A + mul : ∀ g ∈ G, ∀ h ∈ G, ∀ k ∈ G, ∀ p ∈ P, ∀ q ∈ P, ∀ r ∈ P, + ZFSet.pair (ZFSet.pair g h) k ∈ m → ZFSet.pair (ZFSet.pair h p) q ∈ A → + ZFSet.pair (ZFSet.pair g q) r ∈ A → ZFSet.pair (ZFSet.pair k p) r ∈ A + monotone : ∀ g ∈ G, ∀ p ∈ P, ∀ q ∈ P, ∀ r ∈ P, ∀ s ∈ P, + ZFSet.pair (ZFSet.pair g p) r ∈ A → ZFSet.pair (ZFSet.pair g q) s ∈ A → + ZFSet.pair p q ∈ R → ZFSet.pair r s ∈ R + +namespace BoundedFormula + +open SetFormula + +def actionOneFormula {n} (p e a : Fin n) : BoundedFormula n := + .allMem p (tripleMembershipFormula e.succ 0 0 a.succ) + +def actionMulFormula {n} (g p m a : Fin n) : BoundedFormula n := + .allMem g (.allMem g.succ (.allMem g.succ.succ (.allMem p.succ.succ.succ + (.allMem p.succ.succ.succ.succ (.allMem p.succ.succ.succ.succ.succ + (imp (.conj (tripleMembershipFormula 5 4 3 m.succ.succ.succ.succ.succ.succ) + (.conj (tripleMembershipFormula 4 2 1 a.succ.succ.succ.succ.succ.succ) + (tripleMembershipFormula 5 1 0 a.succ.succ.succ.succ.succ.succ))) + (tripleMembershipFormula 3 2 0 a.succ.succ.succ.succ.succ.succ))))))) + +def actionMonotoneFormula {n} (g p r a : Fin n) : BoundedFormula n := + .allMem g (.allMem p.succ (.allMem p.succ.succ (.allMem p.succ.succ.succ + (.allMem p.succ.succ.succ.succ + (imp (.conj (tripleMembershipFormula 4 3 1 a.succ.succ.succ.succ.succ) + (.conj (tripleMembershipFormula 4 2 0 a.succ.succ.succ.succ.succ) + (pairMembershipFormula 3 2 r.succ.succ.succ.succ.succ))) + (pairMembershipFormula 1 0 r.succ.succ.succ.succ.succ)))))) + +def posetActionFormula {n} (g p m e r a : Fin n) : BoundedFormula n := + .conj (productFunctionFormula g p p a) (.conj (actionOneFormula p e a) + (.conj (actionMulFormula g p m a) (actionMonotoneFormula g p r a))) + +theorem truth_posetActionFormula {n} (g p m e r a : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (posetActionFormula g p m e r a) env ↔ + PosetActionCode (env g) (env p) (env m) (env e) (env r) (env a) := by + simp only [posetActionFormula, Truth, truth_productFunctionFormula, actionOneFormula, + actionMulFormula, actionMonotoneFormula, truth_tripleMembershipFormula, + truth_pairMembershipFormula, truth_imp] + constructor + · rintro ⟨function, one, mul, monotone⟩ + exact ⟨function, one, + fun g hg h hh k hk p hp q hq r hr gh hpq gr => mul g hg h hh k hk p hp q hq r hr ⟨gh, hpq, gr⟩, + fun g hg p hp q hq r hr s hs gr gs pq => monotone g hg p hp q hq r hr s hs ⟨gr, gs, pq⟩⟩ + · intro h + exact ⟨h.function, h.one, + fun g hg j hj k hk p hp q hq r hr ⟨gj, jq, gr⟩ => h.mul g hg j hj k hk p hp q hq r hr gj jq gr, + fun g hg p hp q hq r hr s hs ⟨gr, gs, pq⟩ => h.monotone g hg p hp q hq r hr s hs gr gs pq⟩ + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_posetActionCode {G P m e R A : ZFSet.{u}} + (hG : G ∈ M.sets) (hP : P ∈ M.sets) (hm : m ∈ M.sets) + (he : e ∈ M.sets) (hR : R ∈ M.sets) (hA : A ∈ M.sets) : + Realize M.sets (BoundedFormula.posetActionFormula 0 1 2 3 4 5).toFormula + (extend G (extend P (extend m (extend e (extend R (extend A Fin.elim0)))))) ↔ + PosetActionCode G P m e R A := + (BoundedFormula.realize_toFormula M _ _ (Fin.cases hG (Fin.cases hP (Fin.cases hm + (Fin.cases he (Fin.cases hR (Fin.cases hA (fun j => Fin.elim0 j)))))))).trans + (BoundedFormula.truth_posetActionFormula 0 1 2 3 4 5 _) + +end TransitiveGround + + + + + +def SeparationActorCode (P r Q R ν A e W k : ZFSet.{u}) : Prop := + ∀ w ∈ Q, ZFSet.pair W w ∈ e → + (∀ z ∈ Q, ZFSet.pair z w ∈ R → ZFSet.pair (ZFSet.pair k z) z ∈ A) ∧ + ∀ x ∈ P, ∀ y ∈ P, ∀ x' ∈ Q, ∀ y' ∈ Q, ∀ z ∈ Q, + ZFSet.pair W x ∈ r → ZFSet.pair W y ∈ r → + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → + ZFSet.pair (ZFSet.pair k x') z ∈ A → ZFSet.pair (ZFSet.pair z y') w ∈ ν + +def SeparationFulfillmentCode (P r Q R ν H A e : ZFSet.{u}) : Prop := + ∀ W ∈ P, ∃ k ∈ H, SeparationActorCode P r Q R ν A e W k + +namespace BoundedFormula + +def separationActorFormula {n} (P r Q R ν A e W k : Fin n) : BoundedFormula n := + .allMem Q (imp (pairMembershipFormula W.succ 0 e.succ) + (.conj + (.allMem Q.succ (imp (pairMembershipFormula 0 1 R.succ.succ) + (tripleMembershipFormula k.succ.succ 0 0 A.succ.succ))) + (.allMem P.succ (.allMem P.succ.succ (.allMem Q.succ.succ.succ + (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ + (imp (pairMembershipFormula W.succ.succ.succ.succ.succ.succ 4 r.succ.succ.succ.succ.succ.succ) + (imp (pairMembershipFormula W.succ.succ.succ.succ.succ.succ 3 r.succ.succ.succ.succ.succ.succ) + (imp (pairMembershipFormula 4 2 e.succ.succ.succ.succ.succ.succ) + (imp (pairMembershipFormula 3 1 e.succ.succ.succ.succ.succ.succ) + (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ.succ 2 0 A.succ.succ.succ.succ.succ.succ) + (tripleMembershipFormula 0 1 5 ν.succ.succ.succ.succ.succ.succ))))))))))))) + +theorem truth_separationActorFormula {n} (P r Q R ν A e W k : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (separationActorFormula P r Q R ν A e W k) env ↔ + SeparationActorCode (env P) (env r) (env Q) (env R) (env ν) (env A) (env e) (env W) (env k) := by + simp only [separationActorFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_tripleMembershipFormula] + rfl + +def separationFulfillmentFormula {n} (P r Q R ν H A e : Fin n) : BoundedFormula n := + .allMem P (.exMem H.succ (separationActorFormula P.succ.succ r.succ.succ Q.succ.succ + R.succ.succ ν.succ.succ A.succ.succ e.succ.succ 1 0)) + +theorem truth_separationFulfillmentFormula {n} (P r Q R ν H A e : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (separationFulfillmentFormula P r Q R ν H A e) env ↔ + SeparationFulfillmentCode (env P) (env r) (env Q) (env R) (env ν) (env H) (env A) (env e) := by + simp only [separationFulfillmentFormula, Truth, truth_exMem, truth_separationActorFormula] + rfl + +theorem realize_separationFulfillmentFormula (M : TransitiveGround.{u}) {n} + (P r Q R ν H A e : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + SetFormula.Realize M.sets (separationFulfillmentFormula P r Q R ν H A e).toFormula env ↔ + SeparationFulfillmentCode (env P) (env r) (env Q) (env R) (env ν) (env H) (env A) (env e) := + (realize_toFormula M _ env members).trans (truth_separationFulfillmentFormula P r Q R ν H A e env) + +end BoundedFormula + + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SerializedChronologyFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SerializedChronologyFormulas.lean index 06efc0271c458d35f14fbf340ce9f8058e3d9adc..5d23ecdd4da9772b9a3f61f2970cea07f5f70e52 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SerializedChronologyFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SerializedChronologyFormulas.lean @@ -1,186 +1,186 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundGrowthLayerRecognition -import OAI.SetTheory.PartitionPrinciple.Transfinite.SerializedChronologyCodes - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def ChronologyLayerLookup (T : ZFSet.{u}) (graphs : Fin 5 → ZFSet.{u}) - (layers s t L r μ birth z : ZFSet.{u}) : Prop := - s ∈ T ∧ t ∈ T ∧ (t = s ∨ t ∈ s) ∧ - ZFSet.pair s L ∈ graphs 0 ∧ ZFSet.pair s r ∈ graphs 1 ∧ - ZFSet.pair s μ ∈ graphs 2 ∧ ZFSet.pair s birth ∈ graphs 3 ∧ - ZFSet.pair (ZFSet.pair s t) z ∈ layers - -namespace BoundedFormula -def chronologyLayerLookupFormula {n} (T : Fin n) (graphs : Fin 5 → Fin n) - (layers s t L r μ birth z : Fin n) : BoundedFormula n := - .conj (.mem s T) (.conj (.mem t T) (.conj (disj (.equal t s) (.mem t s)) - (.conj (pairMembershipFormula s L (graphs 0)) (.conj (pairMembershipFormula s r (graphs 1)) - (.conj (pairMembershipFormula s μ (graphs 2)) (.conj (pairMembershipFormula s birth (graphs 3)) - (tripleMembershipFormula s t z layers))))))) - -theorem truth_chronologyLayerLookupFormula {n} (T : Fin n) (graphs : Fin 5 → Fin n) - (layers s t L r μ birth z : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (chronologyLayerLookupFormula T graphs layers s t L r μ birth z) env ↔ - ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) - (env s) (env t) (env L) (env r) (env μ) (env birth) (env z) := by - simp only [chronologyLayerLookupFormula, Truth, truth_disj, truth_pairMembershipFormula, - truth_tripleMembershipFormula, ChronologyLayerLookup] -end BoundedFormula - -namespace SetFormula -def chronologyLayerClause {n} (T N : Fin n) (graphs : Fin 5 → Fin n) - (layers s t L r μ birth z : Fin n) : SetFormula n := - imp (BoundedFormula.chronologyLayerLookupFormula T graphs layers s t L r μ birth z).toFormula - (growthLayerWitnessFormula z (graphs 0) (graphs 1) (graphs 2) L r μ birth t N) - -def chronologyLayerEntriesFormula {n} (T N : Fin n) (graphs : Fin 5 → Fin n) - (layers : Fin n) : SetFormula n := - let old := suffixIndex n 7 - let field := prefixIndex n 7 - allBlock 7 (chronologyLayerClause (old T) (old N) (fun j => old (graphs j)) - (old layers) (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6)) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_chronologyLayerClause - (unions : Realize M.sets SetFormula.union Fin.elim0) {n} - (T V C D rD N : Fin n) (graphs : Fin 5 → Fin n) - (layers s t L r μ birth z : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) - (core : ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j))) : - Realize M.sets (chronologyLayerClause T N graphs layers s t L r μ birth z) env ↔ - (ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) - (env s) (env t) (env L) (env r) (env μ) (env birth) (env z) → - GrowthLayerWitnessCode (env (graphs 0)) (env (graphs 1)) (env (graphs 2)) - (env L) (env r) (env μ) (env birth) (env t) (env N) (env z)) := by - rw [chronologyLayerClause, realize_imp] - have lookup := (BoundedFormula.realize_toFormula M _ env members).trans - (BoundedFormula.truth_chronologyLayerLookupFormula T graphs layers s t L r μ birth z env) - have recognized (h : ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) - (env s) (env t) (env L) (env r) (env μ) (env birth) (env z)) := - M.realize_growthLayerWitnessFormula unions z (graphs 0) (graphs 1) (graphs 2) - L r μ birth t N env members - (core.meet_of_entries h.1 h.2.2.2.1 h.2.2.2.2.1 h.2.2.2.2.2.1 h.2.2.2.2.2.2.1) - exact ⟨fun h actual => (recognized actual).1 (h (lookup.2 actual)), - fun h actual => (recognized (lookup.1 actual)).2 (h (lookup.1 actual))⟩ - -theorem realize_chronologyLayerEntriesFormula - (unions : Realize M.sets SetFormula.union Fin.elim0) {n} - (T V C D rD N : Fin n) (graphs : Fin 5 → Fin n) (layers : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (core : ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j))) : - Realize M.sets (chronologyLayerEntriesFormula T N graphs layers) env ↔ - ChronologyLayerEntries (env T) (env N) (fun j => env (graphs j)) (env layers) := by - let old := suffixIndex n 7 - let field := prefixIndex n 7 - let body := chronologyLayerClause (old T) (old N) (fun j => old (graphs j)) - (old layers) (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6) - have clause (values : Fin 7 → ZFSet.{u}) (ground : ∀ i, values i ∈ M.sets) : - Realize M.sets body (extendMany 7 values env) ↔ - (ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) - (values 0) (values 1) (values 2) (values 3) (values 4) (values 5) (values 6) → - GrowthLayerWitnessCode (env (graphs 0)) (env (graphs 1)) (env (graphs 2)) - (values 2) (values 3) (values 4) (values 5) (values 1) (env N) (values 6)) := by - have lifted : ChronologyCoreCode ((extendMany 7 values env) (old T)) - ((extendMany 7 values env) (old V)) ((extendMany 7 values env) (old C)) - ((extendMany 7 values env) (old D)) ((extendMany 7 values env) (old rD)) - (fun j => (extendMany 7 values env) (old (graphs j))) := by - simpa only [old, extendMany_suffix] using core - simpa only [body, old, field, extendMany_prefix, extendMany_suffix] using - M.realize_chronologyLayerClause unions (old T) (old V) (old C) (old D) (old rD) - (old N) (fun j => old (graphs j)) (old layers) (field 0) (field 1) (field 2) - (field 3) (field 4) (field 5) (field 6) (extendMany 7 values env) - (extendMany_members 7 values env ground members) lifted - change Realize M.sets (allBlock 7 body) env ↔ _ - rw [realize_allBlock] - constructor - · intro recognized s hs t ht earlier L r μ birth z eL er eμ eb entry - let values : Fin 7 → ZFSet.{u} := Fin.cases s (Fin.cases t (Fin.cases L - (Fin.cases r (Fin.cases μ (Fin.cases birth (fun _ => z)))))) - have ground : ∀ i, values i ∈ M.sets := - Fin.cases (M.transitive (members T) hs) (Fin.cases (M.transitive (members T) ht) - (Fin.cases (M.pair_right (M.transitive (members (graphs 0)) eL)) - (Fin.cases (M.pair_right (M.transitive (members (graphs 1)) er)) - (Fin.cases (M.pair_right (M.transitive (members (graphs 2)) eμ)) - (Fin.cases (M.pair_right (M.transitive (members (graphs 3)) eb)) - (fun _ => M.pair_right (M.transitive (members layers) entry))))))) - exact (clause values ground).1 (recognized values ground) ⟨hs, ht, earlier, eL, er, eμ, eb, entry⟩ - · intro code values ground - apply (clause values ground).2 - rintro ⟨hs, ht, earlier, eL, er, eμ, eb, entry⟩ - exact code _ hs _ ht earlier _ _ _ _ _ eL er eμ eb entry - -end TransitiveGround - -namespace SetFormula -def chronologyLayerFunctionFormula {n} (T W layers : Fin n) : SetFormula n := - ex (.conj (BoundedFormula.chronologyPairsEquationFormula 0 T.succ).toFormula - (BoundedFormula.functionFormula 0 W.succ layers.succ).toFormula) - -def serializedChronologyFormula {n} (T V C D rD N : Fin n) - (graphs : Fin 5 → Fin n) (W layers : Fin n) : SetFormula n := - .conj (BoundedFormula.ordinalFormula T).toFormula - (.conj (BoundedFormula.chronologyCoreFormula T V C D rD graphs).toFormula - (.conj (chronologyLayerFunctionFormula T W layers) - (chronologyLayerEntriesFormula T N graphs layers))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_chronologyLayerFunctionFormula {n} (T W layers : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (chronologyLayerFunctionFormula T W layers) env ↔ - ZFSet.IsFunc (chronologyPairs (env T)) (env W) (env layers) := by - rw [chronologyLayerFunctionFormula, realize_ex] - constructor - · rintro ⟨J, hJ, recognized, function⟩ - have equal := (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ - (extend J env) (Fin.cases hJ members)).1 recognized - have actual := (BoundedFormula.realize_toFormula M _ (extend J env) (Fin.cases hJ members)).1 function - have code := (BoundedFormula.truth_functionFormula 0 W.succ layers.succ (extend J env)).1 actual - exact equal ▸ code - · intro function - have hJ := M.chronologyPairs_mem pairing unions powers separation (members T) - exact ⟨chronologyPairs (env T), hJ, - (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ - (extend (chronologyPairs (env T)) env) (Fin.cases hJ members)).2 rfl, - (BoundedFormula.realize_toFormula M _ _ (Fin.cases hJ members)).2 - ((BoundedFormula.truth_functionFormula 0 W.succ layers.succ _).2 function)⟩ - -theorem realize_serializedChronologyFormula {n} (T V C D rD N : Fin n) - (graphs : Fin 5 → Fin n) (W layers : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (serializedChronologyFormula T V C D rD N graphs W layers) env ↔ - SerializedChronologyCode (env T) (env V) (env C) (env D) (env rD) (env N) - (fun j => env (graphs j)) (env W) (env layers) := by - change (Realize M.sets (BoundedFormula.ordinalFormula T).toFormula env ∧ - Realize M.sets (BoundedFormula.chronologyCoreFormula T V C D rD graphs).toFormula env ∧ - Realize M.sets (chronologyLayerFunctionFormula T W layers) env ∧ - Realize M.sets (chronologyLayerEntriesFormula T N graphs layers) env) ↔ _ - rw [BoundedFormula.realize_ordinalFormula M T env members, ← ordinalSetProperty_iff, - BoundedFormula.realize_chronologyCoreFormula M T V C D rD graphs env members, - M.realize_chronologyLayerFunctionFormula pairing unions powers separation T W layers env members] - constructor - · rintro ⟨ordinal, core, function, entries⟩ - exact ⟨ordinal, core, function, - (M.realize_chronologyLayerEntriesFormula unions T V C D rD N graphs layers env members core).1 entries⟩ - · intro code - exact ⟨code.ordinal, code.core, code.function, - (M.realize_chronologyLayerEntriesFormula unions T V C D rD N graphs layers env members code.core).2 code.entries⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundGrowthLayerRecognition +import OAI.SetTheory.PartitionPrinciple.Transfinite.SerializedChronologyCodes + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def ChronologyLayerLookup (T : ZFSet.{u}) (graphs : Fin 5 → ZFSet.{u}) + (layers s t L r μ birth z : ZFSet.{u}) : Prop := + s ∈ T ∧ t ∈ T ∧ (t = s ∨ t ∈ s) ∧ + ZFSet.pair s L ∈ graphs 0 ∧ ZFSet.pair s r ∈ graphs 1 ∧ + ZFSet.pair s μ ∈ graphs 2 ∧ ZFSet.pair s birth ∈ graphs 3 ∧ + ZFSet.pair (ZFSet.pair s t) z ∈ layers + +namespace BoundedFormula +def chronologyLayerLookupFormula {n} (T : Fin n) (graphs : Fin 5 → Fin n) + (layers s t L r μ birth z : Fin n) : BoundedFormula n := + .conj (.mem s T) (.conj (.mem t T) (.conj (disj (.equal t s) (.mem t s)) + (.conj (pairMembershipFormula s L (graphs 0)) (.conj (pairMembershipFormula s r (graphs 1)) + (.conj (pairMembershipFormula s μ (graphs 2)) (.conj (pairMembershipFormula s birth (graphs 3)) + (tripleMembershipFormula s t z layers))))))) + +theorem truth_chronologyLayerLookupFormula {n} (T : Fin n) (graphs : Fin 5 → Fin n) + (layers s t L r μ birth z : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (chronologyLayerLookupFormula T graphs layers s t L r μ birth z) env ↔ + ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) + (env s) (env t) (env L) (env r) (env μ) (env birth) (env z) := by + simp only [chronologyLayerLookupFormula, Truth, truth_disj, truth_pairMembershipFormula, + truth_tripleMembershipFormula, ChronologyLayerLookup] +end BoundedFormula + +namespace SetFormula +def chronologyLayerClause {n} (T N : Fin n) (graphs : Fin 5 → Fin n) + (layers s t L r μ birth z : Fin n) : SetFormula n := + imp (BoundedFormula.chronologyLayerLookupFormula T graphs layers s t L r μ birth z).toFormula + (growthLayerWitnessFormula z (graphs 0) (graphs 1) (graphs 2) L r μ birth t N) + +def chronologyLayerEntriesFormula {n} (T N : Fin n) (graphs : Fin 5 → Fin n) + (layers : Fin n) : SetFormula n := + let old := suffixIndex n 7 + let field := prefixIndex n 7 + allBlock 7 (chronologyLayerClause (old T) (old N) (fun j => old (graphs j)) + (old layers) (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6)) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_chronologyLayerClause + (unions : Realize M.sets SetFormula.union Fin.elim0) {n} + (T V C D rD N : Fin n) (graphs : Fin 5 → Fin n) + (layers s t L r μ birth z : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) + (core : ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j))) : + Realize M.sets (chronologyLayerClause T N graphs layers s t L r μ birth z) env ↔ + (ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) + (env s) (env t) (env L) (env r) (env μ) (env birth) (env z) → + GrowthLayerWitnessCode (env (graphs 0)) (env (graphs 1)) (env (graphs 2)) + (env L) (env r) (env μ) (env birth) (env t) (env N) (env z)) := by + rw [chronologyLayerClause, realize_imp] + have lookup := (BoundedFormula.realize_toFormula M _ env members).trans + (BoundedFormula.truth_chronologyLayerLookupFormula T graphs layers s t L r μ birth z env) + have recognized (h : ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) + (env s) (env t) (env L) (env r) (env μ) (env birth) (env z)) := + M.realize_growthLayerWitnessFormula unions z (graphs 0) (graphs 1) (graphs 2) + L r μ birth t N env members + (core.meet_of_entries h.1 h.2.2.2.1 h.2.2.2.2.1 h.2.2.2.2.2.1 h.2.2.2.2.2.2.1) + exact ⟨fun h actual => (recognized actual).1 (h (lookup.2 actual)), + fun h actual => (recognized (lookup.1 actual)).2 (h (lookup.1 actual))⟩ + +theorem realize_chronologyLayerEntriesFormula + (unions : Realize M.sets SetFormula.union Fin.elim0) {n} + (T V C D rD N : Fin n) (graphs : Fin 5 → Fin n) (layers : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (core : ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j))) : + Realize M.sets (chronologyLayerEntriesFormula T N graphs layers) env ↔ + ChronologyLayerEntries (env T) (env N) (fun j => env (graphs j)) (env layers) := by + let old := suffixIndex n 7 + let field := prefixIndex n 7 + let body := chronologyLayerClause (old T) (old N) (fun j => old (graphs j)) + (old layers) (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6) + have clause (values : Fin 7 → ZFSet.{u}) (ground : ∀ i, values i ∈ M.sets) : + Realize M.sets body (extendMany 7 values env) ↔ + (ChronologyLayerLookup (env T) (fun j => env (graphs j)) (env layers) + (values 0) (values 1) (values 2) (values 3) (values 4) (values 5) (values 6) → + GrowthLayerWitnessCode (env (graphs 0)) (env (graphs 1)) (env (graphs 2)) + (values 2) (values 3) (values 4) (values 5) (values 1) (env N) (values 6)) := by + have lifted : ChronologyCoreCode ((extendMany 7 values env) (old T)) + ((extendMany 7 values env) (old V)) ((extendMany 7 values env) (old C)) + ((extendMany 7 values env) (old D)) ((extendMany 7 values env) (old rD)) + (fun j => (extendMany 7 values env) (old (graphs j))) := by + simpa only [old, extendMany_suffix] using core + simpa only [body, old, field, extendMany_prefix, extendMany_suffix] using + M.realize_chronologyLayerClause unions (old T) (old V) (old C) (old D) (old rD) + (old N) (fun j => old (graphs j)) (old layers) (field 0) (field 1) (field 2) + (field 3) (field 4) (field 5) (field 6) (extendMany 7 values env) + (extendMany_members 7 values env ground members) lifted + change Realize M.sets (allBlock 7 body) env ↔ _ + rw [realize_allBlock] + constructor + · intro recognized s hs t ht earlier L r μ birth z eL er eμ eb entry + let values : Fin 7 → ZFSet.{u} := Fin.cases s (Fin.cases t (Fin.cases L + (Fin.cases r (Fin.cases μ (Fin.cases birth (fun _ => z)))))) + have ground : ∀ i, values i ∈ M.sets := + Fin.cases (M.transitive (members T) hs) (Fin.cases (M.transitive (members T) ht) + (Fin.cases (M.pair_right (M.transitive (members (graphs 0)) eL)) + (Fin.cases (M.pair_right (M.transitive (members (graphs 1)) er)) + (Fin.cases (M.pair_right (M.transitive (members (graphs 2)) eμ)) + (Fin.cases (M.pair_right (M.transitive (members (graphs 3)) eb)) + (fun _ => M.pair_right (M.transitive (members layers) entry))))))) + exact (clause values ground).1 (recognized values ground) ⟨hs, ht, earlier, eL, er, eμ, eb, entry⟩ + · intro code values ground + apply (clause values ground).2 + rintro ⟨hs, ht, earlier, eL, er, eμ, eb, entry⟩ + exact code _ hs _ ht earlier _ _ _ _ _ eL er eμ eb entry + +end TransitiveGround + +namespace SetFormula +def chronologyLayerFunctionFormula {n} (T W layers : Fin n) : SetFormula n := + ex (.conj (BoundedFormula.chronologyPairsEquationFormula 0 T.succ).toFormula + (BoundedFormula.functionFormula 0 W.succ layers.succ).toFormula) + +def serializedChronologyFormula {n} (T V C D rD N : Fin n) + (graphs : Fin 5 → Fin n) (W layers : Fin n) : SetFormula n := + .conj (BoundedFormula.ordinalFormula T).toFormula + (.conj (BoundedFormula.chronologyCoreFormula T V C D rD graphs).toFormula + (.conj (chronologyLayerFunctionFormula T W layers) + (chronologyLayerEntriesFormula T N graphs layers))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_chronologyLayerFunctionFormula {n} (T W layers : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (chronologyLayerFunctionFormula T W layers) env ↔ + ZFSet.IsFunc (chronologyPairs (env T)) (env W) (env layers) := by + rw [chronologyLayerFunctionFormula, realize_ex] + constructor + · rintro ⟨J, hJ, recognized, function⟩ + have equal := (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ + (extend J env) (Fin.cases hJ members)).1 recognized + have actual := (BoundedFormula.realize_toFormula M _ (extend J env) (Fin.cases hJ members)).1 function + have code := (BoundedFormula.truth_functionFormula 0 W.succ layers.succ (extend J env)).1 actual + exact equal ▸ code + · intro function + have hJ := M.chronologyPairs_mem pairing unions powers separation (members T) + exact ⟨chronologyPairs (env T), hJ, + (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ + (extend (chronologyPairs (env T)) env) (Fin.cases hJ members)).2 rfl, + (BoundedFormula.realize_toFormula M _ _ (Fin.cases hJ members)).2 + ((BoundedFormula.truth_functionFormula 0 W.succ layers.succ _).2 function)⟩ + +theorem realize_serializedChronologyFormula {n} (T V C D rD N : Fin n) + (graphs : Fin 5 → Fin n) (W layers : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (serializedChronologyFormula T V C D rD N graphs W layers) env ↔ + SerializedChronologyCode (env T) (env V) (env C) (env D) (env rD) (env N) + (fun j => env (graphs j)) (env W) (env layers) := by + change (Realize M.sets (BoundedFormula.ordinalFormula T).toFormula env ∧ + Realize M.sets (BoundedFormula.chronologyCoreFormula T V C D rD graphs).toFormula env ∧ + Realize M.sets (chronologyLayerFunctionFormula T W layers) env ∧ + Realize M.sets (chronologyLayerEntriesFormula T N graphs layers) env) ↔ _ + rw [BoundedFormula.realize_ordinalFormula M T env members, ← ordinalSetProperty_iff, + BoundedFormula.realize_chronologyCoreFormula M T V C D rD graphs env members, + M.realize_chronologyLayerFunctionFormula pairing unions powers separation T W layers env members] + constructor + · rintro ⟨ordinal, core, function, entries⟩ + exact ⟨ordinal, core, function, + (M.realize_chronologyLayerEntriesFormula unions T V C D rD N graphs layers env members core).1 entries⟩ + · intro code + exact ⟨code.ordinal, code.core, code.function, + (M.realize_chronologyLayerEntriesFormula unions T V C D rD N graphs layers env members code.core).2 code.entries⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SetPresentations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SetPresentations.lean index 0db5f4d7147b334919a04d836eba24e3a76015f0..969c18e8df8eb8304932cbb8fa2763e9905cc2c6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SetPresentations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SetPresentations.lean @@ -1,111 +1,111 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalSetCodes - -namespace OAI - -section - -namespace PartitionPilot.SetRealization - -open Cardinal -open scoped Cardinal -universe u - -structure Presentation (A : Type u) where - carrier : ZFSet.{u} - encode : A → ZFSet.{u} - injective : Function.Injective encode - mem_carrier : ∀ x, x ∈ carrier ↔ ∃ a, encode a = x - -namespace Presentation -variable {A B : Type u} - -theorem encode_mem (s : Presentation A) (a : A) : s.encode a ∈ s.carrier := - (s.mem_carrier _).2 ⟨a, rfl⟩ - -noncomputable def carrierEquiv (s : Presentation A) : A ≃ s.carrier.toSet := - Equiv.ofBijective (fun a => ⟨s.encode a, s.encode_mem a⟩) ⟨ - fun _ _ h => s.injective (congrArg Subtype.val h), - fun x => by - rcases (s.mem_carrier x.val).1 x.property with ⟨a, ha⟩ - exact ⟨a, Subtype.ext ha⟩⟩ - -noncomputable def ordinalIndex (A : Type u) : A ≃ Set.Iio (#A).ord := - (Nonempty.some (Cardinal.eq.mp (Cardinal.mk_ord_toType (#A)).symm)).trans - (Ordinal.ToType.mk (o := (#A).ord)).toEquiv.symm - -noncomputable def canonical (A : Type u) : Presentation A where - carrier := ordinalCode (#A).ord - encode a := ordinalCode (ordinalIndex A a).val - injective := by - intro a b eq - exact (ordinalIndex A).injective (Subtype.ext (ordinalCode_injective eq)) - mem_carrier x := by - rw [mem_ordinalCode] - constructor - · rintro ⟨o, h, eq⟩ - rcases (ordinalIndex A).surjective ⟨o, h⟩ with ⟨a, ha⟩ - exact ⟨a, by rw [ha]; exact eq⟩ - · rintro ⟨a, eq⟩ - exact ⟨(ordinalIndex A a).val, (ordinalIndex A a).property, eq⟩ - -theorem rank_canonical (A : Type u) : ZFSet.rank (canonical A).carrier = (#A).ord := - rank_ordinalCode _ - -theorem canonical_rank_lt (A : Type u) (κ : Cardinal.{u}) (small : #A < κ) : - ZFSet.rank (canonical A).carrier < κ.ord := by - rw [rank_canonical] - exact Cardinal.ord_lt_ord.2 small - -noncomputable def product (s : Presentation A) (t : Presentation B) : Presentation (A × B) where - carrier := ZFSet.prod s.carrier t.carrier - encode a := ZFSet.pair (s.encode a.1) (t.encode a.2) - injective := by - intro a b eq - have parts := ZFSet.pair_inj.1 eq - exact Prod.ext (s.injective parts.1) (t.injective parts.2) - mem_carrier x := by - rw [ZFSet.mem_prod] - constructor - · rintro ⟨y, hy, z, hz, eq⟩ - rcases (s.mem_carrier y).1 hy with ⟨a, ha⟩ - rcases (t.mem_carrier z).1 hz with ⟨b, hb⟩ - exact ⟨(a, b), by rw [ha, hb]; exact eq.symm⟩ - · rintro ⟨a, eq⟩ - exact ⟨s.encode a.1, s.encode_mem a.1, t.encode a.2, t.encode_mem a.2, eq.symm⟩ - -noncomputable def subset (s : Presentation A) (p : A → Prop) : ZFSet.{u} := - ZFSet.range (fun a : Subtype p => s.encode a.val) - -theorem mem_subset (s : Presentation A) (p : A → Prop) (x : ZFSet.{u}) : - x ∈ s.subset p ↔ ∃ a, p a ∧ s.encode a = x := by - rw [subset, ZFSet.mem_range] - constructor - · rintro ⟨a, eq⟩ - exact ⟨a.val, a.property, eq⟩ - · rintro ⟨a, h, eq⟩ - exact ⟨⟨a, h⟩, eq⟩ - -theorem encode_mem_subset (s : Presentation A) (p : A → Prop) (a : A) : - s.encode a ∈ s.subset p ↔ p a := by - rw [mem_subset] - constructor - · rintro ⟨b, hb, eq⟩ - exact s.injective eq ▸ hb - · intro h - exact ⟨a, h, rfl⟩ - -theorem subset_carrier (s : Presentation A) (p : A → Prop) : s.subset p ⊆ s.carrier := by - intro x hx - rcases (s.mem_subset p x).1 hx with ⟨a, _, eq⟩ - exact eq ▸ s.encode_mem a - -theorem rank_subset_le (s : Presentation A) (p : A → Prop) : - ZFSet.rank (s.subset p) ≤ ZFSet.rank s.carrier := - ZFSet.rank_mono (s.subset_carrier p) - -end Presentation -end PartitionPilot.SetRealization - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalSetCodes + +namespace OAI + +section + +namespace PartitionPilot.SetRealization + +open Cardinal +open scoped Cardinal +universe u + +structure Presentation (A : Type u) where + carrier : ZFSet.{u} + encode : A → ZFSet.{u} + injective : Function.Injective encode + mem_carrier : ∀ x, x ∈ carrier ↔ ∃ a, encode a = x + +namespace Presentation +variable {A B : Type u} + +theorem encode_mem (s : Presentation A) (a : A) : s.encode a ∈ s.carrier := + (s.mem_carrier _).2 ⟨a, rfl⟩ + +noncomputable def carrierEquiv (s : Presentation A) : A ≃ s.carrier.toSet := + Equiv.ofBijective (fun a => ⟨s.encode a, s.encode_mem a⟩) ⟨ + fun _ _ h => s.injective (congrArg Subtype.val h), + fun x => by + rcases (s.mem_carrier x.val).1 x.property with ⟨a, ha⟩ + exact ⟨a, Subtype.ext ha⟩⟩ + +noncomputable def ordinalIndex (A : Type u) : A ≃ Set.Iio (#A).ord := + (Nonempty.some (Cardinal.eq.mp (Cardinal.mk_ord_toType (#A)).symm)).trans + (Ordinal.ToType.mk (o := (#A).ord)).toEquiv.symm + +noncomputable def canonical (A : Type u) : Presentation A where + carrier := ordinalCode (#A).ord + encode a := ordinalCode (ordinalIndex A a).val + injective := by + intro a b eq + exact (ordinalIndex A).injective (Subtype.ext (ordinalCode_injective eq)) + mem_carrier x := by + rw [mem_ordinalCode] + constructor + · rintro ⟨o, h, eq⟩ + rcases (ordinalIndex A).surjective ⟨o, h⟩ with ⟨a, ha⟩ + exact ⟨a, by rw [ha]; exact eq⟩ + · rintro ⟨a, eq⟩ + exact ⟨(ordinalIndex A a).val, (ordinalIndex A a).property, eq⟩ + +theorem rank_canonical (A : Type u) : ZFSet.rank (canonical A).carrier = (#A).ord := + rank_ordinalCode _ + +theorem canonical_rank_lt (A : Type u) (κ : Cardinal.{u}) (small : #A < κ) : + ZFSet.rank (canonical A).carrier < κ.ord := by + rw [rank_canonical] + exact Cardinal.ord_lt_ord.2 small + +noncomputable def product (s : Presentation A) (t : Presentation B) : Presentation (A × B) where + carrier := ZFSet.prod s.carrier t.carrier + encode a := ZFSet.pair (s.encode a.1) (t.encode a.2) + injective := by + intro a b eq + have parts := ZFSet.pair_inj.1 eq + exact Prod.ext (s.injective parts.1) (t.injective parts.2) + mem_carrier x := by + rw [ZFSet.mem_prod] + constructor + · rintro ⟨y, hy, z, hz, eq⟩ + rcases (s.mem_carrier y).1 hy with ⟨a, ha⟩ + rcases (t.mem_carrier z).1 hz with ⟨b, hb⟩ + exact ⟨(a, b), by rw [ha, hb]; exact eq.symm⟩ + · rintro ⟨a, eq⟩ + exact ⟨s.encode a.1, s.encode_mem a.1, t.encode a.2, t.encode_mem a.2, eq.symm⟩ + +noncomputable def subset (s : Presentation A) (p : A → Prop) : ZFSet.{u} := + ZFSet.range (fun a : Subtype p => s.encode a.val) + +theorem mem_subset (s : Presentation A) (p : A → Prop) (x : ZFSet.{u}) : + x ∈ s.subset p ↔ ∃ a, p a ∧ s.encode a = x := by + rw [subset, ZFSet.mem_range] + constructor + · rintro ⟨a, eq⟩ + exact ⟨a.val, a.property, eq⟩ + · rintro ⟨a, h, eq⟩ + exact ⟨⟨a, h⟩, eq⟩ + +theorem encode_mem_subset (s : Presentation A) (p : A → Prop) (a : A) : + s.encode a ∈ s.subset p ↔ p a := by + rw [mem_subset] + constructor + · rintro ⟨b, hb, eq⟩ + exact s.injective eq ▸ hb + · intro h + exact ⟨a, h, rfl⟩ + +theorem subset_carrier (s : Presentation A) (p : A → Prop) : s.subset p ⊆ s.carrier := by + intro x hx + rcases (s.mem_subset p x).1 hx with ⟨a, _, eq⟩ + exact eq ▸ s.encode_mem a + +theorem rank_subset_le (s : Presentation A) (p : A → Prop) : + ZFSet.rank (s.subset p) ≤ ZFSet.rank s.carrier := + ZFSet.rank_mono (s.subset_carrier p) + +end Presentation +end PartitionPilot.SetRealization + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SmallFunctionActionFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SmallFunctionActionFormulas.lean index 05329f95aae3afb03b4b88c2e31cef94c7677ebd..5c32e3842ef16293f7e3c2511494c60139ea8ab5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SmallFunctionActionFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SmallFunctionActionFormulas.lean @@ -1,76 +1,76 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorFullActionGraph - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -open SetRealization SetFormula -universe u - -def RenameActionRelation (X Y A g p q : ZFSet.{u}) : Prop := - ∀ x ∈ X, ∀ x' ∈ X, ∀ y ∈ Y, - ZFSet.pair (ZFSet.pair g x) x' ∈ A → (ZFSet.pair x y ∈ p ↔ ZFSet.pair x' y ∈ q) - -theorem renameActionRelation_iff {X Y G : Type u} [Group G] [PartialOrder X] - (a : PosetAction G X) (s : Presentation X) (t : Presentation Y) (b : Presentation G) - (g : G) {p q : ZFSet.{u}} (shapeQ : q ⊆ ZFSet.prod s.carrier t.carrier) : - RenameActionRelation s.carrier t.carrier (a.actionGraph s b) (b.encode g) p q ↔ - graphRename s t (a.iso g).toEquiv p = q := by - constructor - · intro h - apply s.relation_ext t (graphRename_shape s t _ _) shapeQ - intro x y - rw [pair_mem_graphRename] - exact h _ (s.encode_mem ((a.iso g).symm x)) _ (s.encode_mem x) _ (t.encode_mem y) - ((a.triple_mem_actionGraph s b g ((a.iso g).symm x) x).2 ((a.iso g).apply_symm_apply x)) - · intro eq i hi j hj v hv rel - obtain ⟨x, rfl⟩ := (s.mem_carrier i).1 hi - obtain ⟨x', rfl⟩ := (s.mem_carrier j).1 hj - obtain ⟨y, rfl⟩ := (t.mem_carrier v).1 hv - have same := (a.triple_mem_actionGraph s b g x x').1 rel - rw [← eq, pair_mem_graphRename] - rw [← same] - change ZFSet.pair (s.encode x) (t.encode y) ∈ p ↔ - ZFSet.pair (s.encode ((a.iso g).toEquiv.symm ((a.iso g).toEquiv x))) (t.encode y) ∈ p - rw [(a.iso g).toEquiv.symm_apply_apply] - -namespace BoundedFormula - -def renameActionFormula {n} (p q g x y a : Fin n) : BoundedFormula n := - .allMem x (.allMem x.succ (.allMem y.succ.succ - (imp (tripleMembershipFormula g.succ.succ.succ 2 1 a.succ.succ.succ) - (.conj (imp (pairMembershipFormula 2 0 p.succ.succ.succ) (pairMembershipFormula 1 0 q.succ.succ.succ)) - (imp (pairMembershipFormula 1 0 q.succ.succ.succ) (pairMembershipFormula 2 0 p.succ.succ.succ)))))) - -theorem truth_renameActionFormula {n} (p q g x y a : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (renameActionFormula p q g x y a) env ↔ - RenameActionRelation (env x) (env y) (env a) (env g) (env p) (env q) := by - simp only [renameActionFormula, Truth, truth_imp, truth_tripleMembershipFormula, truth_pairMembershipFormula] - constructor - · intro h i hi j hj v hv rel - exact ⟨(h i hi j hj v hv rel).1, (h i hi j hj v hv rel).2⟩ - · intro h i hi j hj v hv rel - exact ⟨(h i hi j hj v hv rel).1, (h i hi j hj v hv rel).2⟩ - -def smallActionEntryFormula {n} (z g p x y a : Fin n) : BoundedFormula n := - exMem g (exMem p.succ (exMem p.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) - (renameActionFormula 1 0 2 x.succ.succ.succ y.succ.succ.succ a.succ.succ.succ)))) - -theorem truth_smallActionEntryFormula {n} (z g p x y a : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (smallActionEntryFormula z g p x y a) env ↔ - ∃ h ∈ env g, ∃ r ∈ env p, ∃ s ∈ env p, - env z = ZFSet.pair (ZFSet.pair h r) s ∧ - RenameActionRelation (env x) (env y) (env a) h r s := by - simp only [smallActionEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, truth_renameActionFormula] - rfl - -end BoundedFormula - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorFullActionGraph + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +open SetRealization SetFormula +universe u + +def RenameActionRelation (X Y A g p q : ZFSet.{u}) : Prop := + ∀ x ∈ X, ∀ x' ∈ X, ∀ y ∈ Y, + ZFSet.pair (ZFSet.pair g x) x' ∈ A → (ZFSet.pair x y ∈ p ↔ ZFSet.pair x' y ∈ q) + +theorem renameActionRelation_iff {X Y G : Type u} [Group G] [PartialOrder X] + (a : PosetAction G X) (s : Presentation X) (t : Presentation Y) (b : Presentation G) + (g : G) {p q : ZFSet.{u}} (shapeQ : q ⊆ ZFSet.prod s.carrier t.carrier) : + RenameActionRelation s.carrier t.carrier (a.actionGraph s b) (b.encode g) p q ↔ + graphRename s t (a.iso g).toEquiv p = q := by + constructor + · intro h + apply s.relation_ext t (graphRename_shape s t _ _) shapeQ + intro x y + rw [pair_mem_graphRename] + exact h _ (s.encode_mem ((a.iso g).symm x)) _ (s.encode_mem x) _ (t.encode_mem y) + ((a.triple_mem_actionGraph s b g ((a.iso g).symm x) x).2 ((a.iso g).apply_symm_apply x)) + · intro eq i hi j hj v hv rel + obtain ⟨x, rfl⟩ := (s.mem_carrier i).1 hi + obtain ⟨x', rfl⟩ := (s.mem_carrier j).1 hj + obtain ⟨y, rfl⟩ := (t.mem_carrier v).1 hv + have same := (a.triple_mem_actionGraph s b g x x').1 rel + rw [← eq, pair_mem_graphRename] + rw [← same] + change ZFSet.pair (s.encode x) (t.encode y) ∈ p ↔ + ZFSet.pair (s.encode ((a.iso g).toEquiv.symm ((a.iso g).toEquiv x))) (t.encode y) ∈ p + rw [(a.iso g).toEquiv.symm_apply_apply] + +namespace BoundedFormula + +def renameActionFormula {n} (p q g x y a : Fin n) : BoundedFormula n := + .allMem x (.allMem x.succ (.allMem y.succ.succ + (imp (tripleMembershipFormula g.succ.succ.succ 2 1 a.succ.succ.succ) + (.conj (imp (pairMembershipFormula 2 0 p.succ.succ.succ) (pairMembershipFormula 1 0 q.succ.succ.succ)) + (imp (pairMembershipFormula 1 0 q.succ.succ.succ) (pairMembershipFormula 2 0 p.succ.succ.succ)))))) + +theorem truth_renameActionFormula {n} (p q g x y a : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (renameActionFormula p q g x y a) env ↔ + RenameActionRelation (env x) (env y) (env a) (env g) (env p) (env q) := by + simp only [renameActionFormula, Truth, truth_imp, truth_tripleMembershipFormula, truth_pairMembershipFormula] + constructor + · intro h i hi j hj v hv rel + exact ⟨(h i hi j hj v hv rel).1, (h i hi j hj v hv rel).2⟩ + · intro h i hi j hj v hv rel + exact ⟨(h i hi j hj v hv rel).1, (h i hi j hj v hv rel).2⟩ + +def smallActionEntryFormula {n} (z g p x y a : Fin n) : BoundedFormula n := + exMem g (exMem p.succ (exMem p.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) + (renameActionFormula 1 0 2 x.succ.succ.succ y.succ.succ.succ a.succ.succ.succ)))) + +theorem truth_smallActionEntryFormula {n} (z g p x y a : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (smallActionEntryFormula z g p x y a) env ↔ + ∃ h ∈ env g, ∃ r ∈ env p, ∃ s ∈ env p, + env z = ZFSet.pair (ZFSet.pair h r) s ∧ + RenameActionRelation (env x) (env y) (env a) h r s := by + simp only [smallActionEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, truth_renameActionFormula] + rfl + +end BoundedFormula + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/StrictLexHeightFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/StrictLexHeightFormulas.lean index 8c3ea4f5f5bca7789c7bbfd70b145e16470e50a6..0993c63c0f2facd1e8bd014928dbf42d5794f499 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/StrictLexHeightFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/StrictLexHeightFormulas.lean @@ -1,90 +1,90 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def strictLexHeightFormula {n} (P C D r height rD : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - .conj (functionToProductFormula P C D height) - (.allMem P (.allMem P.succ (.allMem C.succ.succ (.allMem D.succ.succ.succ - (.allMem C.succ.succ.succ.succ (.allMem D.succ.succ.succ.succ.succ - (imp (.conj (pairMembershipFormula 5 4 (lift r)) - (.conj (.neg (.equal 5 4)) - (.conj (rightTripleMembershipFormula 5 3 2 (lift height)) - (rightTripleMembershipFormula 4 1 0 (lift height))))) - (disj (.mem 3 1) (.conj (.equal 3 1) (pairMembershipFormula 2 0 (lift rD))))))))))) - -theorem truth_strictLexHeightFormula {n} (P C D r height rD : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (strictLexHeightFormula P C D r height rD) env ↔ - StrictLexHeightCode (env P) (env C) (env D) (env r) (env height) (env rD) := by - simp only [strictLexHeightFormula, Truth, truth_functionToProductFormula, truth_imp, - truth_disj, truth_pairMembershipFormula, truth_rightTripleMembershipFormula] - constructor - · rintro ⟨function, strict⟩ - refine ⟨function, ?_⟩ - intro x hx y hy c q d v lower different first second - have firstBounds := ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 first)).2 - have secondBounds := ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 second)).2 - exact strict x hx y hy c firstBounds.1 q firstBounds.2 d secondBounds.1 v secondBounds.2 - ⟨lower, different, first, second⟩ - · intro code - refine ⟨code.function, ?_⟩ - intro x hx y hy c _ q _ d _ v _ condition - exact code.strict x hx y hy c q d v condition.1 condition.2.1 - condition.2.2.1 condition.2.2.2 - -def heightColumnsBoundFormula {n} (P C D height columns : Fin n) : BoundedFormula n := - .allMem P (.allMem C.succ (.allMem D.succ.succ - (imp (rightTripleMembershipFormula 2 1 0 height.succ.succ.succ) - (.mem 1 columns.succ.succ.succ)))) - -theorem truth_heightColumnsBoundFormula {n} (P C D height columns : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (heightColumnsBoundFormula P C D height columns) env ↔ - ∀ x ∈ env P, ∀ c ∈ env C, ∀ q ∈ env D, - ZFSet.pair x (ZFSet.pair c q) ∈ env height → c ∈ env columns := by - simp only [heightColumnsBoundFormula, Truth, truth_imp, truth_rightTripleMembershipFormula] - rfl - -theorem truth_heightColumnsBoundFormula_of_function {n} (P C D height columns : Fin n) - (env : Fin n → ZFSet.{u}) - (function : ZFSet.IsFunc (env P) (ZFSet.prod (env C) (env D)) (env height)) : - Truth (heightColumnsBoundFormula P C D height columns) env ↔ - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ env height → c ∈ env columns := by - rw [truth_heightColumnsBoundFormula] - constructor - · intro bound x c q entry - have shape := ZFSet.pair_mem_prod.1 (function.1 entry) - have coordinates := ZFSet.pair_mem_prod.1 shape.2 - exact bound x shape.1 c coordinates.1 q coordinates.2 entry - · intro bound x _ c _ q _ entry - exact bound x c q entry - -theorem realize_strictLexHeightFormula (M : TransitiveGround.{u}) {n} - (P C D r height rD : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (strictLexHeightFormula P C D r height rD).toFormula env ↔ - StrictLexHeightCode (env P) (env C) (env D) (env r) (env height) (env rD) := - (realize_toFormula M _ env members).trans (truth_strictLexHeightFormula P C D r height rD env) - -theorem realize_heightColumnsBoundFormula (M : TransitiveGround.{u}) {n} - (P C D height columns : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) - (function : ZFSet.IsFunc (env P) (ZFSet.prod (env C) (env D)) (env height)) : - Realize M.sets (heightColumnsBoundFormula P C D height columns).toFormula env ↔ - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ env height → c ∈ env columns := - (realize_toFormula M _ env members).trans - (truth_heightColumnsBoundFormula_of_function P C D height columns env function) - -end PartitionPilot.Forcing.BoundedFormula - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def strictLexHeightFormula {n} (P C D r height rD : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + .conj (functionToProductFormula P C D height) + (.allMem P (.allMem P.succ (.allMem C.succ.succ (.allMem D.succ.succ.succ + (.allMem C.succ.succ.succ.succ (.allMem D.succ.succ.succ.succ.succ + (imp (.conj (pairMembershipFormula 5 4 (lift r)) + (.conj (.neg (.equal 5 4)) + (.conj (rightTripleMembershipFormula 5 3 2 (lift height)) + (rightTripleMembershipFormula 4 1 0 (lift height))))) + (disj (.mem 3 1) (.conj (.equal 3 1) (pairMembershipFormula 2 0 (lift rD))))))))))) + +theorem truth_strictLexHeightFormula {n} (P C D r height rD : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (strictLexHeightFormula P C D r height rD) env ↔ + StrictLexHeightCode (env P) (env C) (env D) (env r) (env height) (env rD) := by + simp only [strictLexHeightFormula, Truth, truth_functionToProductFormula, truth_imp, + truth_disj, truth_pairMembershipFormula, truth_rightTripleMembershipFormula] + constructor + · rintro ⟨function, strict⟩ + refine ⟨function, ?_⟩ + intro x hx y hy c q d v lower different first second + have firstBounds := ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 first)).2 + have secondBounds := ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 second)).2 + exact strict x hx y hy c firstBounds.1 q firstBounds.2 d secondBounds.1 v secondBounds.2 + ⟨lower, different, first, second⟩ + · intro code + refine ⟨code.function, ?_⟩ + intro x hx y hy c _ q _ d _ v _ condition + exact code.strict x hx y hy c q d v condition.1 condition.2.1 + condition.2.2.1 condition.2.2.2 + +def heightColumnsBoundFormula {n} (P C D height columns : Fin n) : BoundedFormula n := + .allMem P (.allMem C.succ (.allMem D.succ.succ + (imp (rightTripleMembershipFormula 2 1 0 height.succ.succ.succ) + (.mem 1 columns.succ.succ.succ)))) + +theorem truth_heightColumnsBoundFormula {n} (P C D height columns : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (heightColumnsBoundFormula P C D height columns) env ↔ + ∀ x ∈ env P, ∀ c ∈ env C, ∀ q ∈ env D, + ZFSet.pair x (ZFSet.pair c q) ∈ env height → c ∈ env columns := by + simp only [heightColumnsBoundFormula, Truth, truth_imp, truth_rightTripleMembershipFormula] + rfl + +theorem truth_heightColumnsBoundFormula_of_function {n} (P C D height columns : Fin n) + (env : Fin n → ZFSet.{u}) + (function : ZFSet.IsFunc (env P) (ZFSet.prod (env C) (env D)) (env height)) : + Truth (heightColumnsBoundFormula P C D height columns) env ↔ + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ env height → c ∈ env columns := by + rw [truth_heightColumnsBoundFormula] + constructor + · intro bound x c q entry + have shape := ZFSet.pair_mem_prod.1 (function.1 entry) + have coordinates := ZFSet.pair_mem_prod.1 shape.2 + exact bound x shape.1 c coordinates.1 q coordinates.2 entry + · intro bound x _ c _ q _ entry + exact bound x c q entry + +theorem realize_strictLexHeightFormula (M : TransitiveGround.{u}) {n} + (P C D r height rD : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (strictLexHeightFormula P C D r height rD).toFormula env ↔ + StrictLexHeightCode (env P) (env C) (env D) (env r) (env height) (env rD) := + (realize_toFormula M _ env members).trans (truth_strictLexHeightFormula P C D r height rD env) + +theorem realize_heightColumnsBoundFormula (M : TransitiveGround.{u}) {n} + (P C D height columns : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) + (function : ZFSet.IsFunc (env P) (ZFSet.prod (env C) (env D)) (env height)) : + Realize M.sets (heightColumnsBoundFormula P C D height columns).toFormula env ↔ + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ env height → c ∈ env columns := + (realize_toFormula M _ env members).trans + (truth_heightColumnsBoundFormula_of_function P C D height columns env function) + +end PartitionPilot.Forcing.BoundedFormula + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralAssignmentActionFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralAssignmentActionFormulas.lean index 199aa42e7762ee94dd6df8022c6f19156119eedb..9f6b40dc21da359c3bcdb8d42dc2df62c06ea898 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralAssignmentActionFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralAssignmentActionFormulas.lean @@ -1,99 +1,99 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.StructuralAssignmentActionGraphs - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -private def witnessBounds : BoundedFormula 20 := - let w := prefixIndex 10 10 - let old := suffixIndex 10 10 - .conj (.mem (w 0) (old 1)) - (.conj (BoundedFormula.orderedTripleFormula (old 0) (w 0) (w 1) (w 2)) - (.conj (.mem (w 3) (old 8)) (.conj (.mem (w 9) (old 9)) - (.conj (BoundedFormula.nonemptyTupleFormula 4 (w 9) ![w 3,w 4,w 5,w 6,w 7]) - (BoundedFormula.pairMembershipFormula (w 1) (w 2) (w 8)))))) - -private def operationSlots : Fin 14 → Fin 20 := - let w := prefixIndex 10 10 - let old := suffixIndex 10 10 - extend (w 8) ![w 0,w 4,w 5,w 6,w 7,old 1,old 2,old 3,old 4,old 5,old 6,old 7,w 3] - -noncomputable def structuralAssignmentEntryFormula : SetFormula 10 := - exBlock 10 (.conj witnessBounds.toFormula - (SetFormula.reindex operationSlots - (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).formula)) - -theorem realize_structuralAssignmentEntryFormula (env : Fin 10 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.structuralAssignmentEntryFormula pairing unions powers separation collection) env ↔ - env 0 ∈ M.structuralAssignmentActionGraph (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) := by - unfold structuralAssignmentEntryFormula - rw [realize_exBlock, M.mem_structuralAssignmentActionGraph] - have meaning (f : Fin 10 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (.conj witnessBounds.toFormula - (SetFormula.reindex operationSlots - (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).formula)) - (extendMany 10 f env) ↔ - f 0 ∈ env 1 ∧ env 0 = ZFSet.pair (ZFSet.pair (f 0) (f 1)) (f 2) ∧ - f 3 ∈ env 8 ∧ f 9 ∈ env 9 ∧ - f 9 = ZFSet.pair (f 3) (forcingStageCode (f 4) (f 5) (f 6) (f 7)) ∧ - ZFSet.pair (f 1) (f 2) ∈ f 8 ∧ - f 8 = M.rawStageRefinementAssignmentActionGraph (f 0) (f 4) (f 5) (f 6) (f 7) - (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) (f 3) := by - change (Realize M.sets witnessBounds.toFormula _ ∧ _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 10 f env ground members)] - simp only [witnessBounds, BoundedFormula.Truth, BoundedFormula.truth_orderedTripleFormula, - BoundedFormula.truth_nonemptyTupleFormula, BoundedFormula.truth_pairMembershipFormula, - extendMany_prefix, extendMany_suffix] - rw [realize_reindex] - have args : (fun j => extendMany 10 f env (operationSlots j)) = - extend (f 8) ![f 0,f 4,f 5,f 6,f 7,env 1,env 2,env 3,env 4,env 5,env 6,env 7,f 3] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))))))))) j - have argGround : ∀ j, (![f 0,f 4,f 5,f 6,f 7,env 1,env 2,env 3,env 4,env 5,env 6,env 7,f 3] : Fin 13 → ZFSet.{u}) j ∈ M.sets := - (Fin.cases (ground 0) (Fin.cases (ground 4) (Fin.cases (ground 5) (Fin.cases (ground 6) (Fin.cases (ground 7) (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) (Fin.cases (ground 3) (fun j => Fin.elim0 j)))))))))))))) - rw [args, (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).correct _ argGround _ (ground 8)] - change ((_ ∧ _ ∧ _ ∧ _ ∧ _ ∧ _) ∧ _) ↔ _ - tauto - constructor - · rintro ⟨f, ground, holds⟩ - obtain ⟨hg, equal, hl, source, shape, edge, graph⟩ := (meaning f ground).1 holds - exact ⟨f 0, hg, f 1, f 2, equal, f 3, hl, f 4, f 5, f 6, f 7, shape ▸ source, graph ▸ edge⟩ - · rintro ⟨g, hg, x, y, equal, level, hl, P, order, top, action, stored, edge⟩ - let source := ZFSet.pair level (forcingStageCode P order top action) - let graph := M.rawStageRefinementAssignmentActionGraph g P order top action - (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) level - have hSource := M.transitive (members 9) stored - have fields := M.nonemptyTupleCode_field_mem 4 ![level,P,order,top,action] hSource - have hOuter : ZFSet.pair (ZFSet.pair g x) y ∈ M.sets := equal ▸ members 0 - have outer := M.nonemptyTupleCode_field_mem 1 ![ZFSet.pair g x,y] hOuter - have inner := M.nonemptyTupleCode_field_mem 1 ![g,x] (outer 0) - have hGraph : graph ∈ M.sets := - (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).closed - ![g,P,order,top,action,env 1,env 2,env 3,env 4,env 5,env 6,env 7,level] - (Fin.cases (inner 0) (Fin.cases (fields 1) (Fin.cases (fields 2) (Fin.cases (fields 3) - (Fin.cases (fields 4) (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) - (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) - (Fin.cases (members 7) (Fin.cases (fields 0) (fun j => Fin.elim0 j)))))))))))))) - let f : Fin 10 → ZFSet.{u} := ![g,x,y,level,P,order,top,action,graph,source] - have ground : ∀ j, f j ∈ M.sets := - Fin.cases (inner 0) (Fin.cases (inner 1) (Fin.cases (outer 1) (Fin.cases (fields 0) - (Fin.cases (fields 1) (Fin.cases (fields 2) (Fin.cases (fields 3) - (Fin.cases (fields 4) (Fin.cases hGraph (Fin.cases hSource (fun j => Fin.elim0 j)))))))))) - exact ⟨f, ground, (meaning f ground).2 ⟨hg, equal, hl, stored, rfl, edge, rfl⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.StructuralAssignmentActionGraphs + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +private def witnessBounds : BoundedFormula 20 := + let w := prefixIndex 10 10 + let old := suffixIndex 10 10 + .conj (.mem (w 0) (old 1)) + (.conj (BoundedFormula.orderedTripleFormula (old 0) (w 0) (w 1) (w 2)) + (.conj (.mem (w 3) (old 8)) (.conj (.mem (w 9) (old 9)) + (.conj (BoundedFormula.nonemptyTupleFormula 4 (w 9) ![w 3,w 4,w 5,w 6,w 7]) + (BoundedFormula.pairMembershipFormula (w 1) (w 2) (w 8)))))) + +private def operationSlots : Fin 14 → Fin 20 := + let w := prefixIndex 10 10 + let old := suffixIndex 10 10 + extend (w 8) ![w 0,w 4,w 5,w 6,w 7,old 1,old 2,old 3,old 4,old 5,old 6,old 7,w 3] + +noncomputable def structuralAssignmentEntryFormula : SetFormula 10 := + exBlock 10 (.conj witnessBounds.toFormula + (SetFormula.reindex operationSlots + (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).formula)) + +theorem realize_structuralAssignmentEntryFormula (env : Fin 10 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.structuralAssignmentEntryFormula pairing unions powers separation collection) env ↔ + env 0 ∈ M.structuralAssignmentActionGraph (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) := by + unfold structuralAssignmentEntryFormula + rw [realize_exBlock, M.mem_structuralAssignmentActionGraph] + have meaning (f : Fin 10 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (.conj witnessBounds.toFormula + (SetFormula.reindex operationSlots + (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).formula)) + (extendMany 10 f env) ↔ + f 0 ∈ env 1 ∧ env 0 = ZFSet.pair (ZFSet.pair (f 0) (f 1)) (f 2) ∧ + f 3 ∈ env 8 ∧ f 9 ∈ env 9 ∧ + f 9 = ZFSet.pair (f 3) (forcingStageCode (f 4) (f 5) (f 6) (f 7)) ∧ + ZFSet.pair (f 1) (f 2) ∈ f 8 ∧ + f 8 = M.rawStageRefinementAssignmentActionGraph (f 0) (f 4) (f 5) (f 6) (f 7) + (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) (f 3) := by + change (Realize M.sets witnessBounds.toFormula _ ∧ _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 10 f env ground members)] + simp only [witnessBounds, BoundedFormula.Truth, BoundedFormula.truth_orderedTripleFormula, + BoundedFormula.truth_nonemptyTupleFormula, BoundedFormula.truth_pairMembershipFormula, + extendMany_prefix, extendMany_suffix] + rw [realize_reindex] + have args : (fun j => extendMany 10 f env (operationSlots j)) = + extend (f 8) ![f 0,f 4,f 5,f 6,f 7,env 1,env 2,env 3,env 4,env 5,env 6,env 7,f 3] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))))))))) j + have argGround : ∀ j, (![f 0,f 4,f 5,f 6,f 7,env 1,env 2,env 3,env 4,env 5,env 6,env 7,f 3] : Fin 13 → ZFSet.{u}) j ∈ M.sets := + (Fin.cases (ground 0) (Fin.cases (ground 4) (Fin.cases (ground 5) (Fin.cases (ground 6) (Fin.cases (ground 7) (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) (Fin.cases (ground 3) (fun j => Fin.elim0 j)))))))))))))) + rw [args, (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).correct _ argGround _ (ground 8)] + change ((_ ∧ _ ∧ _ ∧ _ ∧ _ ∧ _) ∧ _) ↔ _ + tauto + constructor + · rintro ⟨f, ground, holds⟩ + obtain ⟨hg, equal, hl, source, shape, edge, graph⟩ := (meaning f ground).1 holds + exact ⟨f 0, hg, f 1, f 2, equal, f 3, hl, f 4, f 5, f 6, f 7, shape ▸ source, graph ▸ edge⟩ + · rintro ⟨g, hg, x, y, equal, level, hl, P, order, top, action, stored, edge⟩ + let source := ZFSet.pair level (forcingStageCode P order top action) + let graph := M.rawStageRefinementAssignmentActionGraph g P order top action + (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) level + have hSource := M.transitive (members 9) stored + have fields := M.nonemptyTupleCode_field_mem 4 ![level,P,order,top,action] hSource + have hOuter : ZFSet.pair (ZFSet.pair g x) y ∈ M.sets := equal ▸ members 0 + have outer := M.nonemptyTupleCode_field_mem 1 ![ZFSet.pair g x,y] hOuter + have inner := M.nonemptyTupleCode_field_mem 1 ![g,x] (outer 0) + have hGraph : graph ∈ M.sets := + (M.definable_rawStageRefinementAssignmentActionGraph pairing unions powers separation collection).closed + ![g,P,order,top,action,env 1,env 2,env 3,env 4,env 5,env 6,env 7,level] + (Fin.cases (inner 0) (Fin.cases (fields 1) (Fin.cases (fields 2) (Fin.cases (fields 3) + (Fin.cases (fields 4) (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) + (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) + (Fin.cases (members 7) (Fin.cases (fields 0) (fun j => Fin.elim0 j)))))))))))))) + let f : Fin 10 → ZFSet.{u} := ![g,x,y,level,P,order,top,action,graph,source] + have ground : ∀ j, f j ∈ M.sets := + Fin.cases (inner 0) (Fin.cases (inner 1) (Fin.cases (outer 1) (Fin.cases (fields 0) + (Fin.cases (fields 1) (Fin.cases (fields 2) (Fin.cases (fields 3) + (Fin.cases (fields 4) (Fin.cases hGraph (Fin.cases hSource (fun j => Fin.elim0 j)))))))))) + exact ⟨f, ground, (meaning f ground).2 ⟨hg, equal, hl, stored, rfl, edge, rfl⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralRefinementHistoryFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralRefinementHistoryFormulas.lean index 0b33659988c60d74bc842c5cb36f5a780f9387ea..2e3dab45a208ddbf53fd4b3223eaee01a2a6a1af 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralRefinementHistoryFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/StructuralRefinementHistoryFormulas.lean @@ -1,88 +1,88 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -noncomputable def definable_structuralRefinementEntry : - GroundDefinableFunction M (fun env : Fin 11 → ZFSet.{u} => - ZFSet.pair (env 0) (M.rawRefinementFormulaDataCode (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 0))) := by - let v := GroundSetTerm.var M (n := 11) - let data := GroundSetTerm.app (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection) - ![v 1, v 2, v 3, v 4, v 5, v 6, v 7, v 8, v 9, v 10, v 0] - let entry := GroundSetTerm.app (M.definable_nonemptyTuple pairing 1) ![v 0, data] - exact entry.definition - -noncomputable def structuralRefinementEntryFormula : SetFormula 9 := - let w := prefixIndex 9 5 - let old := suffixIndex 9 5 - exBlock 5 (.conj (BoundedFormula.nonemptyTupleFormula 4 (old 0) w).toFormula - (.conj (.mem (w 0) (old 2)) - (SetFormula.reindex (extend (old 1) - ![w 0, w 1, w 2, w 3, w 4, old 3, old 4, old 5, old 6, old 7, old 8]) - (M.definable_structuralRefinementEntry pairing unions powers separation collection).formula))) - -theorem realize_structuralRefinementEntryFormula (env : Fin 9 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.structuralRefinementEntryFormula pairing unions powers separation collection) env ↔ - ∃ f : Fin 5 → ZFSet.{u}, env 0 = nonemptyTupleCode 4 f ∧ f 0 ∈ env 2 ∧ - env 1 = ZFSet.pair (f 0) (M.rawRefinementFormulaDataCode (f 1) (f 2) (f 3) (f 4) - (env 3) (env 4) (env 5) (env 6) (env 7) (env 8) (f 0)) := by - unfold structuralRefinementEntryFormula - rw [realize_exBlock] - have meaning (f : Fin 5 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (.conj (BoundedFormula.nonemptyTupleFormula 4 (suffixIndex 9 5 0) - (prefixIndex 9 5)).toFormula (.conj (.mem (prefixIndex 9 5 0) (suffixIndex 9 5 2)) - (SetFormula.reindex (extend (suffixIndex 9 5 1) - ![prefixIndex 9 5 0, prefixIndex 9 5 1, prefixIndex 9 5 2, prefixIndex 9 5 3, - prefixIndex 9 5 4, suffixIndex 9 5 3, suffixIndex 9 5 4, suffixIndex 9 5 5, - suffixIndex 9 5 6, suffixIndex 9 5 7, suffixIndex 9 5 8]) - (M.definable_structuralRefinementEntry pairing unions powers separation collection).formula))) - (extendMany 5 f env) ↔ - env 0 = nonemptyTupleCode 4 f ∧ f 0 ∈ env 2 ∧ - env 1 = ZFSet.pair (f 0) (M.rawRefinementFormulaDataCode (f 1) (f 2) (f 3) (f 4) - (env 3) (env 4) (env 5) (env 6) (env 7) (env 8) (f 0)) := by - change (Realize M.sets (BoundedFormula.nonemptyTupleFormula 4 _ _).toFormula _ ∧ _ ∧ _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members), - BoundedFormula.truth_nonemptyTupleFormula] - simp only [extendMany_suffix, extendMany_prefix] - apply and_congr_right - intro _ - apply and_congr_right - intro _ - rw [realize_reindex, map_extend] - have args : (fun j : Fin 11 => extendMany 5 f env - (![prefixIndex 9 5 0, prefixIndex 9 5 1, prefixIndex 9 5 2, prefixIndex 9 5 3, - prefixIndex 9 5 4, suffixIndex 9 5 3, suffixIndex 9 5 4, suffixIndex 9 5 5, - suffixIndex 9 5 6, suffixIndex 9 5 7, suffixIndex 9 5 8] j)) = - ![f 0, f 1, f 2, f 3, f 4, env 3, env 4, env 5, env 6, env 7, env 8] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j - rw [args] - exact (M.definable_structuralRefinementEntry pairing unions powers separation collection).correct _ - (Fin.cases (ground 0) (Fin.cases (ground 1) (Fin.cases (ground 2) (Fin.cases (ground 3) - (Fin.cases (ground 4) (Fin.cases (members 3) (Fin.cases (members 4) (Fin.cases (members 5) - (Fin.cases (members 6) (Fin.cases (members 7) (Fin.cases (members 8) (fun j => Fin.elim0 j)))))))))))) - _ (members 1) - constructor - · rintro ⟨f, ground, holds⟩ - exact ⟨f, (meaning f ground).1 holds⟩ - · rintro ⟨f, shape, level, value⟩ - have ground := M.nonemptyTupleCode_field_mem 4 f (shape ▸ members 0) - exact ⟨f, ground, (meaning f ground).2 ⟨shape, level, value⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +noncomputable def definable_structuralRefinementEntry : + GroundDefinableFunction M (fun env : Fin 11 → ZFSet.{u} => + ZFSet.pair (env 0) (M.rawRefinementFormulaDataCode (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 0))) := by + let v := GroundSetTerm.var M (n := 11) + let data := GroundSetTerm.app (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection) + ![v 1, v 2, v 3, v 4, v 5, v 6, v 7, v 8, v 9, v 10, v 0] + let entry := GroundSetTerm.app (M.definable_nonemptyTuple pairing 1) ![v 0, data] + exact entry.definition + +noncomputable def structuralRefinementEntryFormula : SetFormula 9 := + let w := prefixIndex 9 5 + let old := suffixIndex 9 5 + exBlock 5 (.conj (BoundedFormula.nonemptyTupleFormula 4 (old 0) w).toFormula + (.conj (.mem (w 0) (old 2)) + (SetFormula.reindex (extend (old 1) + ![w 0, w 1, w 2, w 3, w 4, old 3, old 4, old 5, old 6, old 7, old 8]) + (M.definable_structuralRefinementEntry pairing unions powers separation collection).formula))) + +theorem realize_structuralRefinementEntryFormula (env : Fin 9 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.structuralRefinementEntryFormula pairing unions powers separation collection) env ↔ + ∃ f : Fin 5 → ZFSet.{u}, env 0 = nonemptyTupleCode 4 f ∧ f 0 ∈ env 2 ∧ + env 1 = ZFSet.pair (f 0) (M.rawRefinementFormulaDataCode (f 1) (f 2) (f 3) (f 4) + (env 3) (env 4) (env 5) (env 6) (env 7) (env 8) (f 0)) := by + unfold structuralRefinementEntryFormula + rw [realize_exBlock] + have meaning (f : Fin 5 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (.conj (BoundedFormula.nonemptyTupleFormula 4 (suffixIndex 9 5 0) + (prefixIndex 9 5)).toFormula (.conj (.mem (prefixIndex 9 5 0) (suffixIndex 9 5 2)) + (SetFormula.reindex (extend (suffixIndex 9 5 1) + ![prefixIndex 9 5 0, prefixIndex 9 5 1, prefixIndex 9 5 2, prefixIndex 9 5 3, + prefixIndex 9 5 4, suffixIndex 9 5 3, suffixIndex 9 5 4, suffixIndex 9 5 5, + suffixIndex 9 5 6, suffixIndex 9 5 7, suffixIndex 9 5 8]) + (M.definable_structuralRefinementEntry pairing unions powers separation collection).formula))) + (extendMany 5 f env) ↔ + env 0 = nonemptyTupleCode 4 f ∧ f 0 ∈ env 2 ∧ + env 1 = ZFSet.pair (f 0) (M.rawRefinementFormulaDataCode (f 1) (f 2) (f 3) (f 4) + (env 3) (env 4) (env 5) (env 6) (env 7) (env 8) (f 0)) := by + change (Realize M.sets (BoundedFormula.nonemptyTupleFormula 4 _ _).toFormula _ ∧ _ ∧ _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members), + BoundedFormula.truth_nonemptyTupleFormula] + simp only [extendMany_suffix, extendMany_prefix] + apply and_congr_right + intro _ + apply and_congr_right + intro _ + rw [realize_reindex, map_extend] + have args : (fun j : Fin 11 => extendMany 5 f env + (![prefixIndex 9 5 0, prefixIndex 9 5 1, prefixIndex 9 5 2, prefixIndex 9 5 3, + prefixIndex 9 5 4, suffixIndex 9 5 3, suffixIndex 9 5 4, suffixIndex 9 5 5, + suffixIndex 9 5 6, suffixIndex 9 5 7, suffixIndex 9 5 8] j)) = + ![f 0, f 1, f 2, f 3, f 4, env 3, env 4, env 5, env 6, env 7, env 8] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j + rw [args] + exact (M.definable_structuralRefinementEntry pairing unions powers separation collection).correct _ + (Fin.cases (ground 0) (Fin.cases (ground 1) (Fin.cases (ground 2) (Fin.cases (ground 3) + (Fin.cases (ground 4) (Fin.cases (members 3) (Fin.cases (members 4) (Fin.cases (members 5) + (Fin.cases (members 6) (Fin.cases (members 7) (Fin.cases (members 8) (fun j => Fin.elim0 j)))))))))))) + _ (members 1) + constructor + · rintro ⟨f, ground, holds⟩ + exact ⟨f, (meaning f ground).1 holds⟩ + · rintro ⟨f, shape, level, value⟩ + have ground := M.nonemptyTupleCode_field_mem 4 f (shape ▸ members 0) + exact ⟨f, ground, (meaning f ground).2 ⟨shape, level, value⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateFamilyFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateFamilyFormulas.lean index b3af04957001966b1fb52219b488b97558801ecd..7d02f7d56ecd4069101d55e805a93be1d8339e15 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateFamilyFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateFamilyFormulas.lean @@ -1,111 +1,111 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_supportedCertificateFormula {n} - (nodes N order R niceEval visibilityEval value F B f : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (BoundedFormula.supportedCertificateFormula - nodes N order R niceEval visibilityEval value F B f).toFormula env ↔ - SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) - (env niceEval) (env visibilityEval) (env value) (env F) (env B) (env f) := - (BoundedFormula.realize_toFormula M _ env members).trans - (BoundedFormula.truth_supportedCertificateFormula - nodes N order R niceEval visibilityEval value F B f env) - -theorem realize_supportedCertificateEntryFormula {n} - (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (BoundedFormula.supportedCertificateEntryFormula - entry J PF PB WF nodes N order R inputEval niceEval visibilityEval).toFormula env ↔ - ∃ j ∈ env J, ∃ F ∈ env PF, ∃ B ∈ env PB, ∃ f ∈ env WF, - env entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧ - ∃ value, ZFSet.pair j value ∈ env inputEval ∧ - SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) - (env niceEval) (env visibilityEval) value F B f := - (BoundedFormula.realize_toFormula M _ env members).trans - (BoundedFormula.truth_supportedCertificateEntryFormula - entry J PF PB WF nodes N order R inputEval niceEval visibilityEval env) - -theorem supportedCertificateRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {J PF PB WF nodes N order R inputEval niceEval visibilityEval : ZFSet.{u}} - (hJ : J ∈ M.sets) (hPF : PF ∈ M.sets) (hPB : PB ∈ M.sets) (hWF : WF ∈ M.sets) - (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) (hOrder : order ∈ M.sets) - (hR : R ∈ M.sets) (hInput : inputEval ∈ M.sets) (hNice : niceEval ∈ M.sets) - (hVisibility : visibilityEval ∈ M.sets) : - supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval ∈ M.sets := by - let params : Fin 11 → ZFSet.{u} := ![J, PF, PB, WF, nodes, N, order, R, - inputEval, niceEval, visibilityEval] - have members : ∀ i, params i ∈ M.sets := by - exact (Fin.cases hJ (Fin.cases hPF (Fin.cases hPB (Fin.cases hWF (Fin.cases hNodes (Fin.cases hN (Fin.cases hOrder (Fin.cases hR (Fin.cases hInput (Fin.cases hNice (Fin.cases hVisibility (fun i => Fin.elim0 i)))))))))))) - have bound := M.prod_mem pairing unions powers separation hJ - (M.prod_mem pairing unions powers separation hPF - (M.prod_mem pairing unions powers separation hPB hWF)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.supportedCertificateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) - params members bound - have equal : ZFSet.sep (fun entry => BoundedFormula.Truth - (BoundedFormula.supportedCertificateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) - (extend entry params)) (ZFSet.prod J (ZFSet.prod PF (ZFSet.prod PB WF))) = - supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval := by - apply ZFSet.ext - intro entry - rw [ZFSet.mem_sep, supportedCertificateRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_supportedCertificateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 _) - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def supportedCertificateFamilyFormula : SetFormula 12 := - (BoundedFormula.allMem 0 - (BoundedFormula.supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12)).toFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_supportedCertificateFamilyFormula (env : Fin 12 → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets supportedCertificateFamilyFormula env ↔ - env 0 ⊆ supportedCertificateRelation (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) := by - rw [supportedCertificateFamilyFormula, BoundedFormula.realize_toFormula M _ env members] - change (∀ entry ∈ env 0, BoundedFormula.Truth - (BoundedFormula.supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12) - (extend entry env)) ↔ _ - constructor - · intro allEntries entry member - obtain ⟨j, hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩ := - (BoundedFormula.truth_supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12 _).1 - (allEntries entry member) - change entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) at equal - rw [equal] - exact (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).2 - ⟨hj, hF, hB, hf, value, evaluated, certificate⟩ - · intro selected entry member - obtain ⟨_, witness⟩ := ZFSet.mem_sep.1 (selected member) - exact (BoundedFormula.truth_supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12 _).2 witness - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_supportedCertificateFormula {n} + (nodes N order R niceEval visibilityEval value F B f : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (BoundedFormula.supportedCertificateFormula + nodes N order R niceEval visibilityEval value F B f).toFormula env ↔ + SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) + (env niceEval) (env visibilityEval) (env value) (env F) (env B) (env f) := + (BoundedFormula.realize_toFormula M _ env members).trans + (BoundedFormula.truth_supportedCertificateFormula + nodes N order R niceEval visibilityEval value F B f env) + +theorem realize_supportedCertificateEntryFormula {n} + (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (BoundedFormula.supportedCertificateEntryFormula + entry J PF PB WF nodes N order R inputEval niceEval visibilityEval).toFormula env ↔ + ∃ j ∈ env J, ∃ F ∈ env PF, ∃ B ∈ env PB, ∃ f ∈ env WF, + env entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧ + ∃ value, ZFSet.pair j value ∈ env inputEval ∧ + SupportedEqualityCertificate (env nodes) (env N) (env order) (env R) + (env niceEval) (env visibilityEval) value F B f := + (BoundedFormula.realize_toFormula M _ env members).trans + (BoundedFormula.truth_supportedCertificateEntryFormula + entry J PF PB WF nodes N order R inputEval niceEval visibilityEval env) + +theorem supportedCertificateRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {J PF PB WF nodes N order R inputEval niceEval visibilityEval : ZFSet.{u}} + (hJ : J ∈ M.sets) (hPF : PF ∈ M.sets) (hPB : PB ∈ M.sets) (hWF : WF ∈ M.sets) + (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) (hOrder : order ∈ M.sets) + (hR : R ∈ M.sets) (hInput : inputEval ∈ M.sets) (hNice : niceEval ∈ M.sets) + (hVisibility : visibilityEval ∈ M.sets) : + supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval ∈ M.sets := by + let params : Fin 11 → ZFSet.{u} := ![J, PF, PB, WF, nodes, N, order, R, + inputEval, niceEval, visibilityEval] + have members : ∀ i, params i ∈ M.sets := by + exact (Fin.cases hJ (Fin.cases hPF (Fin.cases hPB (Fin.cases hWF (Fin.cases hNodes (Fin.cases hN (Fin.cases hOrder (Fin.cases hR (Fin.cases hInput (Fin.cases hNice (Fin.cases hVisibility (fun i => Fin.elim0 i)))))))))))) + have bound := M.prod_mem pairing unions powers separation hJ + (M.prod_mem pairing unions powers separation hPF + (M.prod_mem pairing unions powers separation hPB hWF)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.supportedCertificateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) + params members bound + have equal : ZFSet.sep (fun entry => BoundedFormula.Truth + (BoundedFormula.supportedCertificateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) + (extend entry params)) (ZFSet.prod J (ZFSet.prod PF (ZFSet.prod PB WF))) = + supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval := by + apply ZFSet.ext + intro entry + rw [ZFSet.mem_sep, supportedCertificateRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_supportedCertificateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 _) + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def supportedCertificateFamilyFormula : SetFormula 12 := + (BoundedFormula.allMem 0 + (BoundedFormula.supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12)).toFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_supportedCertificateFamilyFormula (env : Fin 12 → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets supportedCertificateFamilyFormula env ↔ + env 0 ⊆ supportedCertificateRelation (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) := by + rw [supportedCertificateFamilyFormula, BoundedFormula.realize_toFormula M _ env members] + change (∀ entry ∈ env 0, BoundedFormula.Truth + (BoundedFormula.supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12) + (extend entry env)) ↔ _ + constructor + · intro allEntries entry member + obtain ⟨j, hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩ := + (BoundedFormula.truth_supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12 _).1 + (allEntries entry member) + change entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) at equal + rw [equal] + exact (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).2 + ⟨hj, hF, hB, hf, value, evaluated, certificate⟩ + · intro selected entry member + obtain ⟨_, witness⟩ := ZFSet.mem_sep.1 (selected member) + exact (BoundedFormula.truth_supportedCertificateEntryFormula 0 2 3 4 5 6 7 8 9 10 11 12 _).2 witness + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateRelations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateRelations.lean index acb54e0f08fcfff3c4500cee4e92ece732cdae43..3dfe387d2b51c06a8035c9931a38ab46ba6ba1aa 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateRelations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/SupportedCertificateRelations.lean @@ -1,191 +1,191 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceSupportEvaluation -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -noncomputable def supportedEqualityRelation (B N R E value : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun entry => ∃ v ∈ B, ∃ tau ∈ N, entry = ZFSet.pair v tau ∧ - ZFSet.pair v tau ∈ R ∧ ZFSet.pair tau value ∈ E) (ZFSet.prod B N) - -theorem pair_mem_supportedEqualityRelation (B N R E value v tau : ZFSet.{u}) : - ZFSet.pair v tau ∈ supportedEqualityRelation B N R E value ↔ - v ∈ B ∧ tau ∈ N ∧ ZFSet.pair v tau ∈ R ∧ ZFSet.pair tau value ∈ E := by - rw [supportedEqualityRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, w, hw, sigma, hsigma, equal, support, evaluated⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hw, hsigma, support, evaluated⟩ - · rintro ⟨hv, htau, support, evaluated⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, htau⟩, v, hv, tau, htau, rfl, support, evaluated⟩ - -namespace BoundedFormula -def supportedEqualityEntryFormula {n} (entry B N R E value : Fin n) : BoundedFormula n := - exMem B (exMem N.succ (.conj (orderedPairFormula entry.succ.succ 1 0) - (.conj (pairMembershipFormula 1 0 R.succ.succ) - (pairMembershipFormula 0 value.succ.succ E.succ.succ)))) - -theorem truth_supportedEqualityEntryFormula {n} (entry B N R E value : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (supportedEqualityEntryFormula entry B N R E value) env ↔ - ∃ v ∈ env B, ∃ tau ∈ env N, env entry = ZFSet.pair v tau ∧ - ZFSet.pair v tau ∈ env R ∧ ZFSet.pair tau (env value) ∈ env E := by - simp only [supportedEqualityEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem supportedEqualityRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {B N R E value : ZFSet.{u}} (hB : B ∈ M.sets) (hN : N ∈ M.sets) - (hR : R ∈ M.sets) (hE : E ∈ M.sets) (hvalue : value ∈ M.sets) : - supportedEqualityRelation B N R E value ∈ M.sets := by - let params := extend B (extend N (extend R (extend E (extend value Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.supportedEqualityEntryFormula 0 1 2 3 4 5) params - (Fin.cases hB (Fin.cases hN (Fin.cases hR (Fin.cases hE (Fin.cases hvalue (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hB hN) - have equal : ZFSet.sep (fun entry => BoundedFormula.Truth - (BoundedFormula.supportedEqualityEntryFormula 0 1 2 3 4 5) (extend entry params)) - (ZFSet.prod B N) = supportedEqualityRelation B N R E value := by - apply ZFSet.ext - intro entry - rw [ZFSet.mem_sep, supportedEqualityRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_supportedEqualityEntryFormula 0 1 2 3 4 5 _) - exact equal ▸ selected - -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) -variable (T : ZFSet.{u}) (K : L → Subgroup G) (H : ConditionFilter P) - -theorem supportedEqualityRelation_entry (B value : ZFSet.{u}) (v : L) (tau : Name s) : - ZFSet.pair (b.encode v) tau.val ∈ supportedEqualityRelation B - (M.niceSupportNameCodes a s T K) (M.niceSupportRelation a s b T K) - (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) value ↔ - b.encode v ∈ B ∧ tau.val ∈ M.sets ∧ NiceNameCode a s T (K v) tau.val ∧ - Name.eval {p | H.mem p} tau = value := by - rw [pair_mem_supportedEqualityRelation] - constructor - · rintro ⟨hv, htau, support, evaluated⟩ - have code := (M.pair_mem_niceSupportRelation a s b T K v tau.val).1 support - exact ⟨hv, code.1, code.2, (M.niceSupportEvaluationName_entry a s T K tau htau H value).1 evaluated⟩ - · rintro ⟨hv, ground, code, evaluated⟩ - have member := (M.mem_niceSupportNameCodes a s T K tau.val).2 ⟨ground, v, code⟩ - exact ⟨hv, member, (M.pair_mem_niceSupportRelation a s b T K v tau.val).2 ⟨ground, code⟩, - (M.niceSupportEvaluationName_entry a s T K tau member H value).2 evaluated⟩ - -theorem supportedEqualityRelation_total {B value : ZFSet.{u}} - (subset : B ⊆ b.carrier) - (visible : ∀ v : L, b.encode v ∈ B → value ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v))) : - ∀ v ∈ B, ∃ tau ∈ M.niceSupportNameCodes a s T K, - ZFSet.pair v tau ∈ supportedEqualityRelation B - (M.niceSupportNameCodes a s T K) (M.niceSupportRelation a s b T K) - (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) value := by - intro raw member - obtain ⟨v, rfl⟩ := (b.mem_carrier raw).1 (subset member) - obtain ⟨tau, candidate, evaluated⟩ := - (M.mem_eval_niceVisibilityName a s T (K v) _ H.top_mem value).1 (visible v member) - have code := (M.mem_niceNameCandidates a s T (K v) tau.val).1 candidate - exact ⟨tau.val, (M.mem_niceSupportNameCodes a s T K tau.val).2 ⟨code.1, v, code.2⟩, - (M.supportedEqualityRelation_entry a s b T K H B value v tau).2 - ⟨member, code.1, code.2, evaluated⟩⟩ - -theorem supportedEqualityRelation_mem_ordinary (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {B : ZFSet.{u}} (hB : B ∈ M.sets) (z : (M.nameDomain s).names) : - supportedEqualityRelation B (M.niceSupportNameCodes a s T K) (M.niceSupportRelation a s b T K) - (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) - (Name.eval {p | H.mem p} z.val) ∈ (M.ordinaryExtension s H).sets := by - have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic - have nameGround := M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation - collection carrier group nodes supports maps hT valid - exact (M.ordinaryExtension s H).supportedEqualityRelation_mem zf.1.2.2.2.1 zf.1.2.2.2.2.1 - zf.1.2.2.2.2.2.1 zf.2.1 (includes hB) - (includes (M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation collection - carrier group nodes supports maps hT valid)) - (includes (M.niceSupportRelation_mem a s b T K t pairing unions powers separation collection - carrier group nodes supports maps hT valid)) - ⟨⟨_, nameGround⟩, rfl⟩ ⟨z, rfl⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -def SupportedEqualityCertificate - (nodes N order R niceEval visibilityEval value F B f : ZFSet.{u}) : Prop := - F ⊆ nodes ∧ B ⊆ F ∧ - (∀ v ∈ F, ∃ w ∈ B, ZFSet.pair w v ∈ order) ∧ - ZFSet.IsFunc B N f ∧ - (∀ v V, ZFSet.pair v V ∈ visibilityEval → v ∈ nodes → - (value ∈ V ↔ v ∈ F)) ∧ - ∀ v ∈ B, ∀ tau ∈ N, ZFSet.pair v tau ∈ f → - ZFSet.pair v tau ∈ R ∧ ZFSet.pair tau value ∈ niceEval - -noncomputable def supportedCertificateRelation - (J PF PB WF nodes N order R inputEval niceEval visibilityEval : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun entry => ∃ j ∈ J, ∃ F ∈ PF, ∃ B ∈ PB, ∃ f ∈ WF, - entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧ - ∃ value, ZFSet.pair j value ∈ inputEval ∧ - SupportedEqualityCertificate nodes N order R niceEval visibilityEval value F B f) - (ZFSet.prod J (ZFSet.prod PF (ZFSet.prod PB WF))) - -theorem pair_mem_supportedCertificateRelation - (J PF PB WF nodes N order R inputEval niceEval visibilityEval j F B f : ZFSet.{u}) : - ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ - supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval ↔ - j ∈ J ∧ F ∈ PF ∧ B ∈ PB ∧ f ∈ WF ∧ - ∃ value, ZFSet.pair j value ∈ inputEval ∧ - SupportedEqualityCertificate nodes N order R niceEval visibilityEval value F B f := by - rw [supportedCertificateRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, j', hj, F', hF, B', hB, f', hf, equal, value, evaluated, certificate⟩ - have outer := ZFSet.pair_inj.1 equal - have middle := ZFSet.pair_inj.1 outer.2 - have inner := ZFSet.pair_inj.1 middle.2 - cases outer.1 - cases middle.1 - cases inner.1 - cases inner.2 - exact ⟨hj, hF, hB, hf, value, evaluated, certificate⟩ - · rintro ⟨hj, hF, hB, hf, value, evaluated, certificate⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hj, ZFSet.pair_mem_prod.2 - ⟨hF, ZFSet.pair_mem_prod.2 ⟨hB, hf⟩⟩⟩, - j, hj, F, hF, B, hB, f, hf, rfl, value, evaluated, certificate⟩ - -theorem supportedCertificateRelation_subset - (J PF PB WF nodes N order R inputEval niceEval visibilityEval : ZFSet.{u}) : - supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval ⊆ - ZFSet.prod J (ZFSet.prod PF (ZFSet.prod PB WF)) := by - intro entry member - exact (ZFSet.mem_sep.1 member).1 - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceSupportEvaluation +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +noncomputable def supportedEqualityRelation (B N R E value : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun entry => ∃ v ∈ B, ∃ tau ∈ N, entry = ZFSet.pair v tau ∧ + ZFSet.pair v tau ∈ R ∧ ZFSet.pair tau value ∈ E) (ZFSet.prod B N) + +theorem pair_mem_supportedEqualityRelation (B N R E value v tau : ZFSet.{u}) : + ZFSet.pair v tau ∈ supportedEqualityRelation B N R E value ↔ + v ∈ B ∧ tau ∈ N ∧ ZFSet.pair v tau ∈ R ∧ ZFSet.pair tau value ∈ E := by + rw [supportedEqualityRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, w, hw, sigma, hsigma, equal, support, evaluated⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hw, hsigma, support, evaluated⟩ + · rintro ⟨hv, htau, support, evaluated⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, htau⟩, v, hv, tau, htau, rfl, support, evaluated⟩ + +namespace BoundedFormula +def supportedEqualityEntryFormula {n} (entry B N R E value : Fin n) : BoundedFormula n := + exMem B (exMem N.succ (.conj (orderedPairFormula entry.succ.succ 1 0) + (.conj (pairMembershipFormula 1 0 R.succ.succ) + (pairMembershipFormula 0 value.succ.succ E.succ.succ)))) + +theorem truth_supportedEqualityEntryFormula {n} (entry B N R E value : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (supportedEqualityEntryFormula entry B N R E value) env ↔ + ∃ v ∈ env B, ∃ tau ∈ env N, env entry = ZFSet.pair v tau ∧ + ZFSet.pair v tau ∈ env R ∧ ZFSet.pair tau (env value) ∈ env E := by + simp only [supportedEqualityEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem supportedEqualityRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {B N R E value : ZFSet.{u}} (hB : B ∈ M.sets) (hN : N ∈ M.sets) + (hR : R ∈ M.sets) (hE : E ∈ M.sets) (hvalue : value ∈ M.sets) : + supportedEqualityRelation B N R E value ∈ M.sets := by + let params := extend B (extend N (extend R (extend E (extend value Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.supportedEqualityEntryFormula 0 1 2 3 4 5) params + (Fin.cases hB (Fin.cases hN (Fin.cases hR (Fin.cases hE (Fin.cases hvalue (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hB hN) + have equal : ZFSet.sep (fun entry => BoundedFormula.Truth + (BoundedFormula.supportedEqualityEntryFormula 0 1 2 3 4 5) (extend entry params)) + (ZFSet.prod B N) = supportedEqualityRelation B N R E value := by + apply ZFSet.ext + intro entry + rw [ZFSet.mem_sep, supportedEqualityRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_supportedEqualityEntryFormula 0 1 2 3 4 5 _) + exact equal ▸ selected + +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) +variable (T : ZFSet.{u}) (K : L → Subgroup G) (H : ConditionFilter P) + +theorem supportedEqualityRelation_entry (B value : ZFSet.{u}) (v : L) (tau : Name s) : + ZFSet.pair (b.encode v) tau.val ∈ supportedEqualityRelation B + (M.niceSupportNameCodes a s T K) (M.niceSupportRelation a s b T K) + (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) value ↔ + b.encode v ∈ B ∧ tau.val ∈ M.sets ∧ NiceNameCode a s T (K v) tau.val ∧ + Name.eval {p | H.mem p} tau = value := by + rw [pair_mem_supportedEqualityRelation] + constructor + · rintro ⟨hv, htau, support, evaluated⟩ + have code := (M.pair_mem_niceSupportRelation a s b T K v tau.val).1 support + exact ⟨hv, code.1, code.2, (M.niceSupportEvaluationName_entry a s T K tau htau H value).1 evaluated⟩ + · rintro ⟨hv, ground, code, evaluated⟩ + have member := (M.mem_niceSupportNameCodes a s T K tau.val).2 ⟨ground, v, code⟩ + exact ⟨hv, member, (M.pair_mem_niceSupportRelation a s b T K v tau.val).2 ⟨ground, code⟩, + (M.niceSupportEvaluationName_entry a s T K tau member H value).2 evaluated⟩ + +theorem supportedEqualityRelation_total {B value : ZFSet.{u}} + (subset : B ⊆ b.carrier) + (visible : ∀ v : L, b.encode v ∈ B → value ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v))) : + ∀ v ∈ B, ∃ tau ∈ M.niceSupportNameCodes a s T K, + ZFSet.pair v tau ∈ supportedEqualityRelation B + (M.niceSupportNameCodes a s T K) (M.niceSupportRelation a s b T K) + (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) value := by + intro raw member + obtain ⟨v, rfl⟩ := (b.mem_carrier raw).1 (subset member) + obtain ⟨tau, candidate, evaluated⟩ := + (M.mem_eval_niceVisibilityName a s T (K v) _ H.top_mem value).1 (visible v member) + have code := (M.mem_niceNameCandidates a s T (K v) tau.val).1 candidate + exact ⟨tau.val, (M.mem_niceSupportNameCodes a s T K tau.val).2 ⟨code.1, v, code.2⟩, + (M.supportedEqualityRelation_entry a s b T K H B value v tau).2 + ⟨member, code.1, code.2, evaluated⟩⟩ + +theorem supportedEqualityRelation_mem_ordinary (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {B : ZFSet.{u}} (hB : B ∈ M.sets) (z : (M.nameDomain s).names) : + supportedEqualityRelation B (M.niceSupportNameCodes a s T K) (M.niceSupportRelation a s b T K) + (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) + (Name.eval {p | H.mem p} z.val) ∈ (M.ordinaryExtension s H).sets := by + have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic + have nameGround := M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation + collection carrier group nodes supports maps hT valid + exact (M.ordinaryExtension s H).supportedEqualityRelation_mem zf.1.2.2.2.1 zf.1.2.2.2.2.1 + zf.1.2.2.2.2.2.1 zf.2.1 (includes hB) + (includes (M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation collection + carrier group nodes supports maps hT valid)) + (includes (M.niceSupportRelation_mem a s b T K t pairing unions powers separation collection + carrier group nodes supports maps hT valid)) + ⟨⟨_, nameGround⟩, rfl⟩ ⟨z, rfl⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +def SupportedEqualityCertificate + (nodes N order R niceEval visibilityEval value F B f : ZFSet.{u}) : Prop := + F ⊆ nodes ∧ B ⊆ F ∧ + (∀ v ∈ F, ∃ w ∈ B, ZFSet.pair w v ∈ order) ∧ + ZFSet.IsFunc B N f ∧ + (∀ v V, ZFSet.pair v V ∈ visibilityEval → v ∈ nodes → + (value ∈ V ↔ v ∈ F)) ∧ + ∀ v ∈ B, ∀ tau ∈ N, ZFSet.pair v tau ∈ f → + ZFSet.pair v tau ∈ R ∧ ZFSet.pair tau value ∈ niceEval + +noncomputable def supportedCertificateRelation + (J PF PB WF nodes N order R inputEval niceEval visibilityEval : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun entry => ∃ j ∈ J, ∃ F ∈ PF, ∃ B ∈ PB, ∃ f ∈ WF, + entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧ + ∃ value, ZFSet.pair j value ∈ inputEval ∧ + SupportedEqualityCertificate nodes N order R niceEval visibilityEval value F B f) + (ZFSet.prod J (ZFSet.prod PF (ZFSet.prod PB WF))) + +theorem pair_mem_supportedCertificateRelation + (J PF PB WF nodes N order R inputEval niceEval visibilityEval j F B f : ZFSet.{u}) : + ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ + supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval ↔ + j ∈ J ∧ F ∈ PF ∧ B ∈ PB ∧ f ∈ WF ∧ + ∃ value, ZFSet.pair j value ∈ inputEval ∧ + SupportedEqualityCertificate nodes N order R niceEval visibilityEval value F B f := by + rw [supportedCertificateRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, j', hj, F', hF, B', hB, f', hf, equal, value, evaluated, certificate⟩ + have outer := ZFSet.pair_inj.1 equal + have middle := ZFSet.pair_inj.1 outer.2 + have inner := ZFSet.pair_inj.1 middle.2 + cases outer.1 + cases middle.1 + cases inner.1 + cases inner.2 + exact ⟨hj, hF, hB, hf, value, evaluated, certificate⟩ + · rintro ⟨hj, hF, hB, hf, value, evaluated, certificate⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hj, ZFSet.pair_mem_prod.2 + ⟨hF, ZFSet.pair_mem_prod.2 ⟨hB, hf⟩⟩⟩, + j, hj, F, hF, B, hB, f, hf, rfl, value, evaluated, certificate⟩ + +theorem supportedCertificateRelation_subset + (J PF PB WF nodes N order R inputEval niceEval visibilityEval : ZFSet.{u}) : + supportedCertificateRelation J PF PB WF nodes N order R inputEval niceEval visibilityEval ⊆ + ZFSet.prod J (ZFSet.prod PF (ZFSet.prod PB WF)) := by + intro entry member + exact (ZFSet.mem_sep.1 member).1 + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedExtensionCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedExtensionCodes.lean index 6d3e1ff837baa42fb6389fe38b28c0f92cbade7a..a0535e9cf6e10fe88b3b75b6ea24f401b73bd231 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedExtensionCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedExtensionCodes.lean @@ -1,115 +1,115 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.SetRankBounds - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -def taggedExtension (P N : ZFSet.{u}) : ZFSet.{u} := - P ∪ ZFSet.prod {P} N - -theorem pair_tag_not_mem (P q : ZFSet.{u}) : ZFSet.pair P q ∉ P := by - intro member - have first : ZFSet.rank P < ZFSet.rank ({P} : ZFSet.{u}) := - ZFSet.rank_lt_of_mem (ZFSet.mem_singleton.2 rfl) - have second : ZFSet.rank ({P} : ZFSet.{u}) < ZFSet.rank (ZFSet.pair P q) := - ZFSet.rank_lt_of_mem (ZFSet.mem_pair.2 (Or.inl rfl)) - exact (lt_irrefl (ZFSet.rank P)) - (first.trans (second.trans (ZFSet.rank_lt_of_mem member))) - -theorem mem_taggedExtension {P N z : ZFSet.{u}} : - z ∈ taggedExtension P N ↔ z ∈ P ∨ ∃ q ∈ N, z = ZFSet.pair P q := by - constructor - · intro hz - rcases ZFSet.mem_union.1 hz with hz | hz - · exact Or.inl hz - · obtain ⟨p, hp, q, hq, eq⟩ := ZFSet.mem_prod.1 hz - exact Or.inr ⟨q, hq, (ZFSet.mem_singleton.1 hp) ▸ eq⟩ - · intro hz - rcases hz with hz | ⟨q, hq, rfl⟩ - · exact ZFSet.mem_union.2 (Or.inl hz) - · exact ZFSet.mem_union.2 - (Or.inr (ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hq⟩)) - -theorem old_mem_taggedExtension {P N z : ZFSet.{u}} (hz : z ∈ P) : - z ∈ taggedExtension P N := - mem_taggedExtension.2 (Or.inl hz) - -theorem pair_mem_taggedExtension {P N q : ZFSet.{u}} : - ZFSet.pair P q ∈ taggedExtension P N ↔ q ∈ N := by - constructor - · intro h - rcases mem_taggedExtension.1 h with old | ⟨r, hr, eq⟩ - · exact False.elim (pair_tag_not_mem P q old) - · exact (ZFSet.pair_inj.1 eq).2.symm ▸ hr - · intro hq - exact mem_taggedExtension.2 (Or.inr ⟨q, hq, rfl⟩) - -theorem taggedExtension_disjoint (P N : ZFSet.{u}) : - ∀ z ∈ P, z ∉ ZFSet.prod {P} N := by - intro z hz tagged - obtain ⟨p, hp, q, _, eq⟩ := ZFSet.mem_prod.1 tagged - have same : z = ZFSet.pair P q := (ZFSet.mem_singleton.1 hp) ▸ eq - exact pair_tag_not_mem P q (same ▸ hz) - -def taggedExtensionEncode (P N : ZFSet.{u}) : - ({x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}) → ZFSet.{u} - | .inl x => x.val - | .inr q => ZFSet.pair P q.val - -theorem taggedExtensionEncode_inl (P N : ZFSet.{u}) (x : {x : ZFSet.{u} // x ∈ P}) : - taggedExtensionEncode P N (.inl x) = x.val := rfl - -theorem taggedExtensionEncode_inr (P N : ZFSet.{u}) (q : {q : ZFSet.{u} // q ∈ N}) : - taggedExtensionEncode P N (.inr q) = ZFSet.pair P q.val := rfl - -theorem taggedExtensionEncode_mem (P N : ZFSet.{u}) - (x : {x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}) : - taggedExtensionEncode P N x ∈ taggedExtension P N := by - cases x with - | inl x => exact old_mem_taggedExtension x.property - | inr q => exact pair_mem_taggedExtension.2 q.property - -theorem taggedExtensionEncode_injective (P N : ZFSet.{u}) : - Function.Injective (taggedExtensionEncode P N) := by - intro x y eq - cases x with - | inl x => - cases y with - | inl y => exact congrArg Sum.inl (Subtype.ext eq) - | inr q => - change x.val = ZFSet.pair P q.val at eq - exact False.elim (pair_tag_not_mem P q.val (eq ▸ x.property)) - | inr q => - cases y with - | inl x => - change ZFSet.pair P q.val = x.val at eq - exact False.elim (pair_tag_not_mem P q.val (eq.symm ▸ x.property)) - | inr r => exact congrArg Sum.inr (Subtype.ext (ZFSet.pair_inj.1 eq).2) - -theorem taggedExtensionEncode_surjective (P N : ZFSet.{u}) : - ∀ z ∈ taggedExtension P N, - ∃ x : {x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}, - taggedExtensionEncode P N x = z := by - intro z hz - rcases mem_taggedExtension.1 hz with old | ⟨q, hq, eq⟩ - · exact ⟨Sum.inl ⟨z, old⟩, rfl⟩ - · exact ⟨Sum.inr ⟨q, hq⟩, eq.symm⟩ - -noncomputable def taggedExtensionEquiv (P N : ZFSet.{u}) : - ({x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}) ≃ - {z : ZFSet.{u} // z ∈ taggedExtension P N} := - Equiv.ofBijective (fun x => ⟨taggedExtensionEncode P N x, taggedExtensionEncode_mem P N x⟩) - ⟨fun _ _ eq => taggedExtensionEncode_injective P N (congrArg Subtype.val eq), - fun z => by - obtain ⟨x, eq⟩ := taggedExtensionEncode_surjective P N z.val z.property - exact ⟨x, Subtype.ext eq⟩⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.SetRankBounds + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +def taggedExtension (P N : ZFSet.{u}) : ZFSet.{u} := + P ∪ ZFSet.prod {P} N + +theorem pair_tag_not_mem (P q : ZFSet.{u}) : ZFSet.pair P q ∉ P := by + intro member + have first : ZFSet.rank P < ZFSet.rank ({P} : ZFSet.{u}) := + ZFSet.rank_lt_of_mem (ZFSet.mem_singleton.2 rfl) + have second : ZFSet.rank ({P} : ZFSet.{u}) < ZFSet.rank (ZFSet.pair P q) := + ZFSet.rank_lt_of_mem (ZFSet.mem_pair.2 (Or.inl rfl)) + exact (lt_irrefl (ZFSet.rank P)) + (first.trans (second.trans (ZFSet.rank_lt_of_mem member))) + +theorem mem_taggedExtension {P N z : ZFSet.{u}} : + z ∈ taggedExtension P N ↔ z ∈ P ∨ ∃ q ∈ N, z = ZFSet.pair P q := by + constructor + · intro hz + rcases ZFSet.mem_union.1 hz with hz | hz + · exact Or.inl hz + · obtain ⟨p, hp, q, hq, eq⟩ := ZFSet.mem_prod.1 hz + exact Or.inr ⟨q, hq, (ZFSet.mem_singleton.1 hp) ▸ eq⟩ + · intro hz + rcases hz with hz | ⟨q, hq, rfl⟩ + · exact ZFSet.mem_union.2 (Or.inl hz) + · exact ZFSet.mem_union.2 + (Or.inr (ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hq⟩)) + +theorem old_mem_taggedExtension {P N z : ZFSet.{u}} (hz : z ∈ P) : + z ∈ taggedExtension P N := + mem_taggedExtension.2 (Or.inl hz) + +theorem pair_mem_taggedExtension {P N q : ZFSet.{u}} : + ZFSet.pair P q ∈ taggedExtension P N ↔ q ∈ N := by + constructor + · intro h + rcases mem_taggedExtension.1 h with old | ⟨r, hr, eq⟩ + · exact False.elim (pair_tag_not_mem P q old) + · exact (ZFSet.pair_inj.1 eq).2.symm ▸ hr + · intro hq + exact mem_taggedExtension.2 (Or.inr ⟨q, hq, rfl⟩) + +theorem taggedExtension_disjoint (P N : ZFSet.{u}) : + ∀ z ∈ P, z ∉ ZFSet.prod {P} N := by + intro z hz tagged + obtain ⟨p, hp, q, _, eq⟩ := ZFSet.mem_prod.1 tagged + have same : z = ZFSet.pair P q := (ZFSet.mem_singleton.1 hp) ▸ eq + exact pair_tag_not_mem P q (same ▸ hz) + +def taggedExtensionEncode (P N : ZFSet.{u}) : + ({x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}) → ZFSet.{u} + | .inl x => x.val + | .inr q => ZFSet.pair P q.val + +theorem taggedExtensionEncode_inl (P N : ZFSet.{u}) (x : {x : ZFSet.{u} // x ∈ P}) : + taggedExtensionEncode P N (.inl x) = x.val := rfl + +theorem taggedExtensionEncode_inr (P N : ZFSet.{u}) (q : {q : ZFSet.{u} // q ∈ N}) : + taggedExtensionEncode P N (.inr q) = ZFSet.pair P q.val := rfl + +theorem taggedExtensionEncode_mem (P N : ZFSet.{u}) + (x : {x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}) : + taggedExtensionEncode P N x ∈ taggedExtension P N := by + cases x with + | inl x => exact old_mem_taggedExtension x.property + | inr q => exact pair_mem_taggedExtension.2 q.property + +theorem taggedExtensionEncode_injective (P N : ZFSet.{u}) : + Function.Injective (taggedExtensionEncode P N) := by + intro x y eq + cases x with + | inl x => + cases y with + | inl y => exact congrArg Sum.inl (Subtype.ext eq) + | inr q => + change x.val = ZFSet.pair P q.val at eq + exact False.elim (pair_tag_not_mem P q.val (eq ▸ x.property)) + | inr q => + cases y with + | inl x => + change ZFSet.pair P q.val = x.val at eq + exact False.elim (pair_tag_not_mem P q.val (eq.symm ▸ x.property)) + | inr r => exact congrArg Sum.inr (Subtype.ext (ZFSet.pair_inj.1 eq).2) + +theorem taggedExtensionEncode_surjective (P N : ZFSet.{u}) : + ∀ z ∈ taggedExtension P N, + ∃ x : {x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}, + taggedExtensionEncode P N x = z := by + intro z hz + rcases mem_taggedExtension.1 hz with old | ⟨q, hq, eq⟩ + · exact ⟨Sum.inl ⟨z, old⟩, rfl⟩ + · exact ⟨Sum.inr ⟨q, hq⟩, eq.symm⟩ + +noncomputable def taggedExtensionEquiv (P N : ZFSet.{u}) : + ({x : ZFSet.{u} // x ∈ P} ⊕ {q : ZFSet.{u} // q ∈ N}) ≃ + {z : ZFSet.{u} // z ∈ taggedExtension P N} := + Equiv.ofBijective (fun x => ⟨taggedExtensionEncode P N x, taggedExtensionEncode_mem P N x⟩) + ⟨fun _ _ eq => taggedExtensionEncode_injective P N (congrArg Subtype.val eq), + fun z => by + obtain ⟨x, eq⟩ := taggedExtensionEncode_surjective P N z.val z.property + exact ⟨x, Subtype.ext eq⟩⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedGrowthLayerFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedGrowthLayerFormulas.lean index fc266ac221ed51bda5e7b43b19c09357987767ef..d757fbfc28bc32d67a7f0331127142ff51256f45 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedGrowthLayerFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedGrowthLayerFormulas.lean @@ -1,743 +1,743 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalGroupEmbeddings -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableLayerCodes -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLayerBirthFibers - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def oldBridgeFormula {n} (L r μ birth t x y : Fin n) : BoundedFormula n := - disj - (exMem L (exMem t.succ (.conj - (tripleMembershipFormula x.succ.succ y.succ.succ 1 μ.succ.succ) - (pairMembershipFormula 1 0 birth.succ.succ)))) - (exMem L (exMem t.succ (.conj (pairMembershipFormula 1 0 birth.succ.succ) - (disj - (.conj (pairMembershipFormula x.succ.succ 1 r.succ.succ) - (pairMembershipFormula 1 y.succ.succ r.succ.succ)) - (.conj (pairMembershipFormula y.succ.succ 1 r.succ.succ) - (pairMembershipFormula 1 x.succ.succ r.succ.succ)))))) - -theorem truth_oldBridgeFormula {n} (L r μ birth t x y : Fin n) (env : Fin n → ZFSet.{u}) - (meet : MeetOrderCode (env L) (env r) (env μ)) : - Truth (oldBridgeFormula L r μ birth t x y) env ↔ - OldBridgeCode (env L) (env r) (env μ) (env birth) (env t) (env x) (env y) := by - simp only [oldBridgeFormula, truth_disj, truth_exMem, Truth, - truth_tripleMembershipFormula, truth_pairMembershipFormula, OldBridgeCode] - constructor - · rintro (⟨z, _, a, ha, entry, born⟩ | ⟨z, hz, a, ha, born, bridge⟩) - · exact Or.inl ⟨z, a, entry, born, ha⟩ - · exact Or.inr ⟨z, hz, a, born, ha, bridge⟩ - · rintro (⟨z, a, entry, born, ha⟩ | ⟨z, hz, a, born, ha, bridge⟩) - · exact Or.inl ⟨z, (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2, a, ha, entry, born⟩ - · exact Or.inr ⟨z, hz, a, ha, born, bridge⟩ - -theorem realize_oldBridgeFormula (M : TransitiveGround.{u}) {n} - (L r μ birth t x y : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meet : MeetOrderCode (env L) (env r) (env μ)) : - Realize M.sets (oldBridgeFormula L r μ birth t x y).toFormula env ↔ - OldBridgeCode (env L) (env r) (env μ) (env birth) (env t) (env x) (env y) := - (realize_toFormula M _ env members).trans (truth_oldBridgeFormula L r μ birth t x y env meet) - - - - - -def meetEmbeddingFormula {n} (P L rP rL μP μL e : Fin n) : BoundedFormula n := - let lift4 (i : Fin n) := i.succ.succ.succ.succ - let lift6 (i : Fin n) := i.succ.succ.succ.succ.succ.succ - .conj (injectionFormula P L e) - (.conj - (.allMem P (.allMem P.succ (.allMem L.succ.succ (.allMem L.succ.succ.succ - (imp (.conj (pairMembershipFormula 3 2 (lift4 rP)) - (.conj (pairMembershipFormula 3 1 (lift4 e)) - (pairMembershipFormula 2 0 (lift4 e)))) - (pairMembershipFormula 1 0 (lift4 rL))))))) - (.allMem P (.allMem P.succ (.allMem P.succ.succ - (.allMem L.succ.succ.succ (.allMem L.succ.succ.succ.succ - (.allMem L.succ.succ.succ.succ.succ - (imp (.conj (tripleMembershipFormula 5 4 3 (lift6 μP)) - (.conj (pairMembershipFormula 5 2 (lift6 e)) - (.conj (pairMembershipFormula 4 1 (lift6 e)) - (pairMembershipFormula 3 0 (lift6 e))))) - (tripleMembershipFormula 2 1 0 (lift6 μL)))))))))) - -theorem truth_meetEmbeddingFormula {n} (P L rP rL μP μL e : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (meetEmbeddingFormula P L rP rL μP μL e) env ↔ - MeetEmbeddingCode (env P) (env L) (env rP) (env rL) (env μP) (env μL) (env e) := by - simp only [meetEmbeddingFormula, Truth, truth_injectionFormula, truth_imp, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - constructor - · rintro ⟨injection, monotone, meet⟩ - have bounds {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env e) : - x ∈ env P ∧ y ∈ env L := ZFSet.pair_mem_prod.1 (injection.function.1 entry) - refine ⟨injection, ?_, ?_⟩ - · intro x y x' y' lower first second - exact monotone x (bounds first).1 y (bounds second).1 - x' (bounds first).2 y' (bounds second).2 ⟨lower, first, second⟩ - · intro x y z x' y' z' output first second third - exact meet x (bounds first).1 y (bounds second).1 z (bounds third).1 - x' (bounds first).2 y' (bounds second).2 z' (bounds third).2 - ⟨output, first, second, third⟩ - · intro code - exact ⟨code.injection, - fun x _ y _ x' _ y' _ h => code.monotone x y x' y' h.1 h.2.1 h.2.2, - fun x _ y _ z _ x' _ y' _ z' _ h => - code.map_meet x y z x' y' z' h.1 h.2.1 h.2.2.1 h.2.2.2⟩ - -theorem realize_meetEmbeddingFormula (M : TransitiveGround.{u}) {n} - (P L rP rL μP μL e : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (meetEmbeddingFormula P L rP rL μP μL e).toFormula env ↔ - MeetEmbeddingCode (env P) (env L) (env rP) (env rL) (env μP) (env μL) (env e) := - (realize_toFormula M _ env members).trans (truth_meetEmbeddingFormula P L rP rL μP μL e env) - - - - - -def groupEmbeddingFormula {n} (G H mG mH oneG oneH e : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - .conj (injectionFormula G H e) (.conj (pairMembershipFormula oneG oneH e) - (.allMem G (.allMem G.succ (.allMem G.succ.succ - (.allMem H.succ.succ.succ (.allMem H.succ.succ.succ.succ - (.allMem H.succ.succ.succ.succ.succ - (imp (.conj (tripleMembershipFormula 5 4 3 (lift mG)) - (.conj (pairMembershipFormula 5 2 (lift e)) - (.conj (pairMembershipFormula 4 1 (lift e)) - (pairMembershipFormula 3 0 (lift e))))) - (tripleMembershipFormula 2 1 0 (lift mH)))))))))) - -theorem truth_groupEmbeddingFormula {n} (G H mG mH oneG oneH e : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (groupEmbeddingFormula G H mG mH oneG oneH e) env ↔ - GroupEmbeddingCode (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env e) := by - simp only [groupEmbeddingFormula, Truth, truth_injectionFormula, truth_imp, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - constructor - · rintro ⟨injection, one, mul⟩ - have bounds {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env e) : - x ∈ env G ∧ y ∈ env H := ZFSet.pair_mem_prod.1 (injection.function.1 entry) - refine ⟨injection, one, ?_⟩ - intro a b c a' b' c' product first second third - exact mul a (bounds first).1 b (bounds second).1 c (bounds third).1 - a' (bounds first).2 b' (bounds second).2 c' (bounds third).2 - ⟨product, first, second, third⟩ - · intro code - exact ⟨code.injection, code.one, fun a _ b _ c _ a' _ b' _ c' _ h => - code.mul a b c a' b' c' h.1 h.2.1 h.2.2.1 h.2.2.2⟩ - -theorem realize_groupEmbeddingFormula (M : TransitiveGround.{u}) {n} - (G H mG mH oneG oneH e : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (groupEmbeddingFormula G H mG mH oneG oneH e).toFormula env ↔ - GroupEmbeddingCode (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env e) := - (realize_toFormula M _ env members).trans - (truth_groupEmbeddingFormula G H mG mH oneG oneH e env) - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def CopyEmbeddingFamilyCode (Qs rs μs L r μ t I Indices Maps : ZFSet.{u}) : Prop := - ∀ i ∈ I, ∀ s ∈ t, ∀ e P R V, - ZFSet.pair i s ∈ Indices → ZFSet.pair i e ∈ Maps → - ZFSet.pair s P ∈ Qs → ZFSet.pair s R ∈ rs → ZFSet.pair s V ∈ μs → - MeetEmbeddingCode P L R r V μ e - -def CopyImageCoverCode (Qs L t I parts Indices Maps : ZFSet.{u}) : Prop := - ∀ i ∈ I, ∀ s ∈ t, ∀ e P, ∀ x ∈ L, - ZFSet.pair i s ∈ Indices → ZFSet.pair i e ∈ Maps → - ZFSet.pair s P ∈ Qs → ZFSet.pair i x ∈ parts → x ∈ relationImage P L e - -namespace BoundedFormula - -def doubleUnionMemberFormula {n} (x f : Fin n) : BoundedFormula n := - exMem f (exMem 0 (.mem x.succ.succ 0)) - -theorem truth_doubleUnionMemberFormula {n} (x f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (doubleUnionMemberFormula x f) env ↔ env x ∈ ⋃₀ ⋃₀ env f := by - simp only [doubleUnionMemberFormula, truth_exMem, Truth] - change (∃ a ∈ env f, ∃ b ∈ a, env x ∈ b) ↔ _ - constructor - · rintro ⟨a, ha, b, hb, hx⟩ - exact ZFSet.mem_sUnion.2 ⟨b, ZFSet.mem_sUnion.2 ⟨a, ha, hb⟩, hx⟩ - · intro hx - obtain ⟨b, hb, hx⟩ := ZFSet.mem_sUnion.1 hx - obtain ⟨a, ha, hb⟩ := ZFSet.mem_sUnion.1 hb - exact ⟨a, ha, b, hb, hx⟩ - -def doubleUnionEquationFormula {n} (B f : Fin n) : BoundedFormula n := - .conj (.allMem B (doubleUnionMemberFormula 0 f.succ)) - (.allMem f (.allMem 0 (.allMem 0 (.mem 0 B.succ.succ.succ)))) - -theorem truth_doubleUnionEquationFormula {n} (B f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (doubleUnionEquationFormula B f) env ↔ env B = ⋃₀ ⋃₀ env f := by - simp only [doubleUnionEquationFormula, Truth, truth_doubleUnionMemberFormula] - change ((∀ x ∈ env B, x ∈ ⋃₀ ⋃₀ env f) ∧ - ∀ a ∈ env f, ∀ b ∈ a, ∀ x ∈ b, x ∈ env B) ↔ _ - constructor - · rintro ⟨subset, cover⟩ - apply ZFSet.ext - intro x - refine ⟨subset x, ?_⟩ - intro hx - obtain ⟨b, hb, hx⟩ := ZFSet.mem_sUnion.1 hx - obtain ⟨a, ha, hb⟩ := ZFSet.mem_sUnion.1 hb - exact cover a ha b hb x hx - · intro equal - rw [equal] - exact ⟨fun _ hx => hx, fun a ha b hb x hx => - ZFSet.mem_sUnion.2 ⟨b, ZFSet.mem_sUnion.2 ⟨a, ha, hb⟩, hx⟩⟩ - -def copyEmbeddingFamilyFormula {n} - (Qs rs μs L r μ t I Indices Maps W QB RB MB : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - .allMem I (.allMem t.succ (.allMem W.succ.succ (.allMem QB.succ.succ.succ - (.allMem RB.succ.succ.succ.succ (.allMem MB.succ.succ.succ.succ.succ - (imp (.conj (pairMembershipFormula 5 4 (lift Indices)) - (.conj (pairMembershipFormula 5 3 (lift Maps)) - (.conj (pairMembershipFormula 4 2 (lift Qs)) - (.conj (pairMembershipFormula 4 1 (lift rs)) - (pairMembershipFormula 4 0 (lift μs)))))) - (meetEmbeddingFormula 2 (lift L) 1 (lift r) 0 (lift μ) 3))))))) - -theorem truth_copyEmbeddingFamilyFormula {n} - (Qs rs μs L r μ t I Indices Maps W QB RB MB : Fin n) (env : Fin n → ZFSet.{u}) - (maps : ZFSet.IsFunc (env I) (env W) (env Maps)) - (eqQ : env QB = ⋃₀ ⋃₀ env Qs) (eqR : env RB = ⋃₀ ⋃₀ env rs) - (eqM : env MB = ⋃₀ ⋃₀ env μs) : - Truth (copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB) env ↔ - CopyEmbeddingFamilyCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) - (env t) (env I) (env Indices) (env Maps) := by - simp only [copyEmbeddingFamilyFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_meetEmbeddingFormula] - constructor - · intro property i hi s hs e P R V index map qField rField mField - have hP : P ∈ env QB := eqQ.symm ▸ pair_second_mem_doubleUnion qField - have hR : R ∈ env RB := eqR.symm ▸ pair_second_mem_doubleUnion rField - have hV : V ∈ env MB := eqM.symm ▸ pair_second_mem_doubleUnion mField - exact property i hi s hs e (ZFSet.pair_mem_prod.1 (maps.1 map)).2 - P hP R hR V hV ⟨index, map, qField, rField, mField⟩ - · intro code i hi s hs e _ P _ R _ V _ condition - exact code i hi s hs e P R V condition.1 condition.2.1 condition.2.2.1 - condition.2.2.2.1 condition.2.2.2.2 - -def copyImageCoverFormula {n} (Qs L t I parts Indices Maps W QB : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ - .allMem I (.allMem t.succ (.allMem W.succ.succ (.allMem QB.succ.succ.succ - (.allMem L.succ.succ.succ.succ - (imp (.conj (pairMembershipFormula 4 3 (lift Indices)) - (.conj (pairMembershipFormula 4 2 (lift Maps)) - (.conj (pairMembershipFormula 3 1 (lift Qs)) - (pairMembershipFormula 4 0 (lift parts))))) - (imageMemberFormula 0 1 2)))))) - -theorem truth_copyImageCoverFormula {n} (Qs L t I parts Indices Maps W QB : Fin n) - (env : Fin n → ZFSet.{u}) (maps : ZFSet.IsFunc (env I) (env W) (env Maps)) - (eqQ : env QB = ⋃₀ ⋃₀ env Qs) : - Truth (copyImageCoverFormula Qs L t I parts Indices Maps W QB) env ↔ - CopyImageCoverCode (env Qs) (env L) (env t) (env I) (env parts) (env Indices) (env Maps) := by - simp only [copyImageCoverFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_imageMemberFormula] - constructor - · intro property i hi s hs e P x hx index map qField part - have hP : P ∈ env QB := eqQ.symm ▸ pair_second_mem_doubleUnion qField - exact (mem_relationImage P (env L) e x).2 ⟨hx, - property i hi s hs e (ZFSet.pair_mem_prod.1 (maps.1 map)).2 - P hP x hx ⟨index, map, qField, part⟩⟩ - · intro code i hi s hs e _ P _ x hx condition - exact ((mem_relationImage P (env L) e x).1 - (code i hi s hs e P x hx condition.1 condition.2.1 condition.2.2.1 condition.2.2.2)).2 - -end BoundedFormula - - - - - -structure CopyLayerCode - (Qs rs μs L r μ birth t I parts Indices Maps W N injection : ZFSet.{u}) : Prop where - small : InjectionCode I N injection - indices : ZFSet.IsFunc I t Indices - maps : ZFSet.IsFunc I W Maps - embedding : CopyEmbeddingFamilyCode Qs rs μs L r μ t I Indices Maps - cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → ∃ i ∈ I, ZFSet.pair i x ∈ parts - inCopy : CopyImageCoverCode Qs L t I parts Indices Maps - -namespace BoundedFormula - -def copyLayerFormula {n} - (Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB : Fin n) : BoundedFormula n := - .conj (doubleUnionEquationFormula QB Qs) - (.conj (doubleUnionEquationFormula RB rs) - (.conj (doubleUnionEquationFormula MB μs) - (.conj (injectionFormula I N injection) - (.conj (functionFormula I t Indices) - (.conj (functionFormula I W Maps) - (.conj (copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB) - (.conj (.allMem L (imp (pairMembershipFormula 0 t.succ birth.succ) - (exMem I.succ (pairMembershipFormula 0 1 parts.succ.succ)))) - (copyImageCoverFormula Qs L t I parts Indices Maps W QB)))))))) - -theorem truth_copyLayerFormula {n} - (Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB) env ↔ - env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ - CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) (env t) - (env I) (env parts) (env Indices) (env Maps) (env W) (env N) (env injection) := by - simp only [copyLayerFormula, Truth, truth_doubleUnionEquationFormula, truth_injectionFormula, - truth_functionFormula, truth_imp, truth_pairMembershipFormula, truth_exMem] - constructor - · rintro ⟨eqQ, eqR, eqM, small, indices, maps, embedding, cover, inCopy⟩ - exact ⟨eqQ, eqR, eqM, small, indices, maps, - (truth_copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB - env maps eqQ eqR eqM).1 embedding, - cover, (truth_copyImageCoverFormula Qs L t I parts Indices Maps W QB env maps eqQ).1 inCopy⟩ - · rintro ⟨eqQ, eqR, eqM, code⟩ - exact ⟨eqQ, eqR, eqM, code.small, code.indices, code.maps, - (truth_copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB - env code.maps eqQ eqR eqM).2 code.embedding, - code.cover, (truth_copyImageCoverFormula Qs L t I parts Indices Maps W QB env code.maps eqQ).2 - code.inCopy⟩ - -theorem realize_copyLayerFormula (M : TransitiveGround.{u}) {n} - (Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets - (copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB).toFormula env ↔ - env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ - CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) (env t) - (env I) (env parts) (env Indices) (env Maps) (env W) (env N) (env injection) := - (realize_toFormula M _ env members).trans - (truth_copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB env) - -end BoundedFormula - -namespace CopyLayerCode - -noncomputable def toLayer - {M : TransitiveGround.{u}} {Qs rs μs L r μ birth t I parts Indices Maps W N injection : ZFSet.{u}} - (code : CopyLayerCode Qs rs μs L r μ birth t I parts Indices Maps W N injection) - (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) - (hI : I ∈ M.sets) (hParts : parts ∈ M.sets) (hMaps : Maps ∈ M.sets) - (hInjection : injection ∈ M.sets) (omega : N = ZFSet.omega) - (history : ∀ s ∈ t, ZFSet.pair s (Space s) ∈ Qs ∧ - ZFSet.pair s (sourceOrder s) ∈ rs ∧ ZFSet.pair s (sourceMeet s) ∈ μs) : - CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := by - classical - let indexGraph : FunctionGraphOn I Indices := ⟨t, code.indices⟩ - let mapGraph : FunctionGraphOn I Maps := ⟨W, code.maps⟩ - let index (i : ZFSet.{u}) := if hi : i ∈ I then indexGraph.value ⟨i, hi⟩ else ∅ - let copy (i : ZFSet.{u}) := if hi : i ∈ I then mapGraph.value ⟨i, hi⟩ else ∅ - have indexEntry (i : ZFSet.{u}) (hi : i ∈ I) : ZFSet.pair i (index i) ∈ Indices := by - simpa only [index, dite_eq_left hi] using indexGraph.value_entry ⟨i, hi⟩ - have copyEntry (i : ZFSet.{u}) (hi : i ∈ I) : ZFSet.pair i (copy i) ∈ Maps := by - simpa only [copy, dite_eq_left hi] using mapGraph.value_entry ⟨i, hi⟩ - have earlier (i : ZFSet.{u}) (hi : i ∈ I) : index i ∈ t := - (ZFSet.pair_mem_prod.1 (code.indices.1 (indexEntry i hi))).2 - refine .copies I parts hI ⟨injection, hInjection, omega ▸ code.small⟩ hParts - index copy earlier (fun i hi => M.pair_right (M.transitive hMaps (copyEntry i hi))) - ?_ code.cover ?_ - · intro i hi - have fields := history (index i) (earlier i hi) - exact code.embedding i hi (index i) (earlier i hi) (copy i) (Space (index i)) - (sourceOrder (index i)) (sourceMeet (index i)) (indexEntry i hi) (copyEntry i hi) - fields.1 fields.2.1 fields.2.2 - · intro i hi x hx part - exact code.inCopy i hi (index i) (earlier i hi) (copy i) (Space (index i)) x hx - (indexEntry i hi) (copyEntry i hi) (history (index i) (earlier i hi)).1 part - -end CopyLayerCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -def ComponentImageCoverCode (Qs L t I Components Indices Maps : ZFSet.{u}) : Prop := - ∀ i ∈ I, ∀ s ∈ t, ∀ e P, ∀ x ∈ L, - ZFSet.pair i s ∈ Indices → ZFSet.pair i e ∈ Maps → - ZFSet.pair s P ∈ Qs → ZFSet.pair x i ∈ Components → x ∈ relationImage P L e - -def ComponentSeparationCode (L r μ birth t F I Components : ZFSet.{u}) : Prop := - ∀ x ∈ F, ∀ y ∈ F, ∀ i ∈ I, ∀ j ∈ I, - ZFSet.pair x i ∈ Components → ZFSet.pair y j ∈ Components → i ≠ j → - OldBridgeCode L r μ birth t x y - -structure SeparatedLayerCode - (Qs rs μs L r μ birth t I Indices Maps W Components F : ZFSet.{u}) : Prop where - indices : ZFSet.IsFunc I t Indices - maps : ZFSet.IsFunc I W Maps - fiber : F = layerBirthFiber L birth t - components : ZFSet.IsFunc F I Components - embedding : CopyEmbeddingFamilyCode Qs rs μs L r μ t I Indices Maps - cover : ComponentImageCoverCode Qs L t I Components Indices Maps - separated : ComponentSeparationCode L r μ birth t F I Components - -namespace SeparatedLayerCode -variable {M : TransitiveGround.{u}} -variable {Qs rs μs L r μ birth t I Indices Maps W Components F : ZFSet.{u}} -variable (code : SeparatedLayerCode Qs rs μs L r μ birth t I Indices Maps W Components F) - -noncomputable def toGrowthLayer - (hMaps : Maps ∈ M.sets) (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) - (agree : ∀ s ∈ t, ZFSet.pair s (Space s) ∈ Qs ∧ - ZFSet.pair s (sourceOrder s) ∈ rs ∧ ZFSet.pair s (sourceMeet s) ∈ μs) : - CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := by - classical - let indices : FunctionGraphOn I Indices := ⟨t, code.indices⟩ - let maps : FunctionGraphOn I Maps := ⟨W, code.maps⟩ - let components : FunctionGraphOn F Components := ⟨I, code.components⟩ - let member (i : SetMembers I) : {i : ZFSet.{u} // i ∈ I} := - ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ - let index (i : SetMembers I) := indices.value (member i) - let e (i : SetMembers I) := maps.value (member i) - have earlier (i : SetMembers I) : index i ∈ t := - (ZFSet.pair_mem_prod.1 (code.indices.1 (indices.value_entry (member i)))).2 - have embedding (i : SetMembers I) : MeetEmbeddingCode (Space (index i)) L - (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i) := - code.embedding _ (SetMembers.raw_mem i) _ (earlier i) _ _ _ _ - (indices.value_entry (member i)) (maps.value_entry (member i)) - (agree _ (earlier i)).1 (agree _ (earlier i)).2.1 (agree _ (earlier i)).2.2 - let Point := {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} - have inFiber (x : Point) : x.val ∈ F := - code.fiber.symm ▸ (mem_layerBirthFiber L birth t x.val).2 x.property - let componentValue (x : Point) := components.value ⟨x.val, inFiber x⟩ - have componentMem (x : Point) : componentValue x ∈ I := - (ZFSet.pair_mem_prod.1 (code.components.1 (components.value_entry ⟨x.val, inFiber x⟩))).2 - let component (x : Point) : SetMembers I := SetMembers.ofMem (componentValue x) (componentMem x) - have componentEntry (x : Point) : ZFSet.pair x.val (SetMembers.raw (component x)) ∈ Components := by - change ZFSet.pair x.val (SetMembers.raw (SetMembers.ofMem _ _)) ∈ Components - rw [SetMembers.raw_ofMem] - exact components.value_entry ⟨x.val, inFiber x⟩ - refine CodedGrowthLayer.separated (SetMembers I) index e earlier - (fun i => maps.value_mem M hMaps (member i)) embedding component ?_ ?_ - · intro x - exact code.cover _ (SetMembers.raw_mem (component x)) _ (earlier (component x)) _ _ _ - x.property.1 (indices.value_entry (member (component x))) - (maps.value_entry (member (component x))) (agree _ (earlier (component x))).1 - (componentEntry x) - · intro x y different - exact code.separated _ (inFiber x) _ (inFiber y) - _ (SetMembers.raw_mem (component x)) _ (SetMembers.raw_mem (component y)) - (componentEntry x) (componentEntry y) - (fun equal => different (SetMembers.raw_injective I equal)) -end SeparatedLayerCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def componentImageCoverFormula {n} (Qs L t I Components Indices Maps W QB : Fin n) : - BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ - .allMem I (.allMem t.succ (.allMem W.succ.succ (.allMem QB.succ.succ.succ - (.allMem L.succ.succ.succ.succ - (imp (.conj (pairMembershipFormula 4 3 (lift Indices)) - (.conj (pairMembershipFormula 4 2 (lift Maps)) - (.conj (pairMembershipFormula 3 1 (lift Qs)) - (pairMembershipFormula 0 4 (lift Components))))) - (imageMemberFormula 0 1 2)))))) - -theorem truth_componentImageCoverFormula {n} - (Qs L t I Components Indices Maps W QB : Fin n) (env : Fin n → ZFSet.{u}) - (maps : ZFSet.IsFunc (env I) (env W) (env Maps)) (eqQ : env QB = ⋃₀ ⋃₀ env Qs) : - Truth (componentImageCoverFormula Qs L t I Components Indices Maps W QB) env ↔ - ComponentImageCoverCode (env Qs) (env L) (env t) (env I) - (env Components) (env Indices) (env Maps) := by - simp only [componentImageCoverFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_imageMemberFormula] - constructor - · intro property i hi s hs e P x hx index map qField part - have hP : P ∈ env QB := eqQ.symm ▸ pair_second_mem_doubleUnion qField - exact (mem_relationImage P (env L) e x).2 ⟨hx, - property i hi s hs e (ZFSet.pair_mem_prod.1 (maps.1 map)).2 - P hP x hx ⟨index, map, qField, part⟩⟩ - · intro code i hi s hs e _ P _ x hx condition - exact ((mem_relationImage P (env L) e x).1 - (code i hi s hs e P x hx condition.1 condition.2.1 condition.2.2.1 condition.2.2.2)).2 - -def componentSeparationFormula {n} (L r μ birth t F I Components : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ - .allMem F (.allMem F.succ (.allMem I.succ.succ (.allMem I.succ.succ.succ - (imp (.conj (pairMembershipFormula 3 1 (lift Components)) - (.conj (pairMembershipFormula 2 0 (lift Components)) (.neg (.equal 1 0)))) - (oldBridgeFormula (lift L) (lift r) (lift μ) (lift birth) (lift t) 3 2))))) - -theorem truth_componentSeparationFormula {n} (L r μ birth t F I Components : Fin n) - (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env L) (env r) (env μ)) : - Truth (componentSeparationFormula L r μ birth t F I Components) env ↔ - ComponentSeparationCode (env L) (env r) (env μ) (env birth) - (env t) (env F) (env I) (env Components) := by - simp only [componentSeparationFormula, Truth, truth_imp, truth_pairMembershipFormula] - constructor - · intro property x hx y hy i hi j hj first second different - exact (truth_oldBridgeFormula L.succ.succ.succ.succ r.succ.succ.succ.succ - μ.succ.succ.succ.succ birth.succ.succ.succ.succ t.succ.succ.succ.succ 3 2 - (extend j (extend i (extend y (extend x env)))) meet).1 - (property x hx y hy i hi j hj ⟨first, second, different⟩) - · intro code x hx y hy i hi j hj condition - exact (truth_oldBridgeFormula L.succ.succ.succ.succ r.succ.succ.succ.succ - μ.succ.succ.succ.succ birth.succ.succ.succ.succ t.succ.succ.succ.succ 3 2 - (extend j (extend i (extend y (extend x env)))) meet).2 - (code x hx y hy i hi j hj condition.1 condition.2.1 condition.2.2) - -def separatedLayerFormula {n} - (Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB : Fin n) : - BoundedFormula n := - .conj (functionFormula I t Indices) - (.conj (functionFormula I W Maps) - (.conj (layerBirthFiberFormula F L birth t) - (.conj (functionFormula F I Components) - (.conj (copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB) - (.conj (componentImageCoverFormula Qs L t I Components Indices Maps W QB) - (componentSeparationFormula L r μ birth t F I Components)))))) - -theorem truth_separatedLayerFormula {n} - (Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB : Fin n) - (env : Fin n → ZFSet.{u}) - (meet : MeetOrderCode (env L) (env r) (env μ)) - (eqQ : env QB = ⋃₀ ⋃₀ env Qs) (eqR : env RB = ⋃₀ ⋃₀ env rs) - (eqM : env MB = ⋃₀ ⋃₀ env μs) : - Truth (separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB) env ↔ - SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) - (env birth) (env t) (env I) (env Indices) (env Maps) (env W) (env Components) (env F) := by - simp only [separatedLayerFormula, Truth, truth_functionFormula, truth_layerBirthFiberFormula] - constructor - · rintro ⟨indices, maps, fiber, components, embeddings, cover, separated⟩ - exact ⟨indices, maps, fiber, components, - (truth_copyEmbeddingFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ env maps eqQ eqR eqM).1 embeddings, - (truth_componentImageCoverFormula _ _ _ _ _ _ _ _ _ env maps eqQ).1 cover, - (truth_componentSeparationFormula _ _ _ _ _ _ _ _ env meet).1 separated⟩ - · intro code - exact ⟨code.indices, code.maps, code.fiber, code.components, - (truth_copyEmbeddingFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ env code.maps eqQ eqR eqM).2 code.embedding, - (truth_componentImageCoverFormula _ _ _ _ _ _ _ _ _ env code.maps eqQ).2 code.cover, - (truth_componentSeparationFormula _ _ _ _ _ _ _ _ env meet).2 code.separated⟩ - -theorem realize_separatedLayerFormula (M : TransitiveGround.{u}) {n} - (Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meet : MeetOrderCode (env L) (env r) (env μ)) - (eqQ : env QB = ⋃₀ ⋃₀ env Qs) (eqR : env RB = ⋃₀ ⋃₀ env rs) - (eqM : env MB = ⋃₀ ⋃₀ env μs) : - Realize M.sets - (separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB).toFormula env ↔ - SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) - (env birth) (env t) (env I) (env Indices) (env Maps) (env W) (env Components) (env F) := - (realize_toFormula M _ env members).trans - (truth_separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB - env meet eqQ eqR eqM) - -end PartitionPilot.Forcing.BoundedFormula - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def countableLayerWitness (D injection : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 2 (Fin.cases (natSetCode 0) (Fin.cases D (fun _ => injection))) - -noncomputable def copyLayerWitness (I parts Indices Maps W injection : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 6 (Fin.cases (natSetCode 1) (Fin.cases I (Fin.cases parts - (Fin.cases Indices (Fin.cases Maps (Fin.cases W (fun _ => injection))))))) - -noncomputable def separatedLayerWitness (I Indices Maps W Components F : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 6 (Fin.cases (natSetCode 2) (Fin.cases I (Fin.cases Indices - (Fin.cases Maps (Fin.cases W (Fin.cases Components (fun _ => F))))))) - -def GrowthLayerWitnessCode (Qs rs μs L r μ birth t N z : ZFSet.{u}) : Prop := - (∃ D injection, z = countableLayerWitness D injection ∧ CountableLayerCode L birth t D N injection) ∨ - (∃ I parts Indices Maps W injection, z = copyLayerWitness I parts Indices Maps W injection ∧ - CopyLayerCode Qs rs μs L r μ birth t I parts Indices Maps W N injection) ∨ - (∃ I Indices Maps W Components F, z = separatedLayerWitness I Indices Maps W Components F ∧ - SeparatedLayerCode Qs rs μs L r μ birth t I Indices Maps W Components F) - -namespace GrowthLayerWitnessCode - -noncomputable def toLayer {M : TransitiveGround.{u}} - {Qs rs μs L r μ birth t N z : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) (ground : z ∈ M.sets) - (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) (omega : N = ZFSet.omega) - (history : ∀ s ∈ t, ZFSet.pair s (Space s) ∈ Qs ∧ - ZFSet.pair s (sourceOrder s) ∈ rs ∧ ZFSet.pair s (sourceMeet s) ∈ μs) : - CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := by - apply Classical.choice - rcases code with ⟨D, injection, rfl, code⟩ | - ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | - ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ - · have fields := M.nonemptyTupleCode_field_mem 2 _ ground - exact ⟨code.toLayer Space sourceOrder sourceMeet (fields 1) (fields 2) omega⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ ground - exact ⟨code.toLayer Space sourceOrder sourceMeet (fields 1) (fields 2) (fields 4) - (fields 6) omega history⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ ground - exact ⟨code.toGrowthLayer (fields 3) Space sourceOrder sourceMeet history⟩ -end GrowthLayerWitnessCode - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem countableLayerWitness_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {D injection : ZFSet.{u}} (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) : - countableLayerWitness D injection ∈ M.sets := - M.nonemptyTupleCode_mem pairing 2 _ - (Fin.cases (M.empty_mem ⟨D, hD⟩) (Fin.cases hD (fun _ => hInjection))) - -theorem copyLayerWitness_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {I parts Indices Maps W injection : ZFSet.{u}} - (hI : I ∈ M.sets) (hParts : parts ∈ M.sets) (hIndices : Indices ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hW : W ∈ M.sets) (hInjection : injection ∈ M.sets) : - copyLayerWitness I parts Indices Maps W injection ∈ M.sets := by - have zero := M.empty_mem ⟨I, hI⟩ - have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero - exact M.nonemptyTupleCode_mem pairing 6 _ - (Fin.cases one (Fin.cases hI (Fin.cases hParts (Fin.cases hIndices - (Fin.cases hMaps (Fin.cases hW (fun _ => hInjection))))))) - -theorem separatedLayerWitness_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {I Indices Maps W Components F : ZFSet.{u}} - (hI : I ∈ M.sets) (hIndices : Indices ∈ M.sets) (hMaps : Maps ∈ M.sets) - (hW : W ∈ M.sets) (hComponents : Components ∈ M.sets) (hF : F ∈ M.sets) : - separatedLayerWitness I Indices Maps W Components F ∈ M.sets := by - have zero := M.empty_mem ⟨I, hI⟩ - have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero - have two : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions one one - exact M.nonemptyTupleCode_mem pairing 6 _ - (Fin.cases two (Fin.cases hI (Fin.cases hIndices (Fin.cases hMaps - (Fin.cases hW (Fin.cases hComponents (fun _ => hF))))))) -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def growthTagFormula : (k : Nat) → {n : Nat} → Fin n → BoundedFormula n - | 0, _, z => emptyFormula z - | k + 1, _, z => exMem z (.conj (successorFormula z.succ 0) (growthTagFormula k 0)) - -theorem truth_growthTagFormula (k : Nat) {n} (z : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (growthTagFormula k z) env ↔ env z = natSetCode k := by - induction k generalizing n with - | zero => exact truth_emptyFormula z env - | succ k ih => - simp only [growthTagFormula, truth_exMem, Truth, truth_successorFormula, ih] - change (∃ x ∈ env z, env z = insert x x ∧ x = natSetCode k) ↔ _ - constructor - · rintro ⟨x, _, equal, rfl⟩ - exact equal - · intro equal - exact ⟨natSetCode k, equal.symm ▸ (show natSetCode k ∈ natSetCode (k + 1) from by - rw [natSetCode_succ]; exact ZFSet.mem_insert _ _), equal, rfl⟩ - -def countableTaggedLayerFormula {n} (z tag D injection L birth t N : Fin n) : BoundedFormula n := - .conj (growthTagFormula 0 tag) - (.conj (nonemptyTupleFormula 2 z (Fin.cases tag (Fin.cases D (fun _ => injection)))) - (countableLayerFormula L birth t D N injection)) - -theorem truth_countableTaggedLayerFormula {n} (z tag D injection L birth t N : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (countableTaggedLayerFormula z tag D injection L birth t N) env ↔ - env tag = natSetCode 0 ∧ env z = countableLayerWitness (env D) (env injection) ∧ - CountableLayerCode (env L) (env birth) (env t) (env D) (env N) (env injection) := by - simp only [countableTaggedLayerFormula, Truth, truth_growthTagFormula, - truth_nonemptyTupleFormula, truth_countableLayerFormula] - constructor - · rintro ⟨tagged, tuple, code⟩ - refine ⟨tagged, ?_, code⟩ - simpa only [countableLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple - · rintro ⟨tagged, tuple, code⟩ - refine ⟨tagged, ?_, code⟩ - simpa only [countableLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple - -def copyTaggedLayerFormula {n} - (z tag I parts Indices Maps W injection Qs rs μs L r μ birth t N QB RB MB : Fin n) : - BoundedFormula n := - .conj (growthTagFormula 1 tag) - (.conj (nonemptyTupleFormula 6 z (Fin.cases tag (Fin.cases I (Fin.cases parts - (Fin.cases Indices (Fin.cases Maps (Fin.cases W (fun _ => injection)))))))) - (copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB)) - -theorem truth_copyTaggedLayerFormula {n} - (z tag I parts Indices Maps W injection Qs rs μs L r μ birth t N QB RB MB : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (copyTaggedLayerFormula z tag I parts Indices Maps W injection Qs rs μs L r μ birth t N QB RB MB) env ↔ - env tag = natSetCode 1 ∧ env z = copyLayerWitness (env I) (env parts) (env Indices) - (env Maps) (env W) (env injection) ∧ - env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ - CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) - (env t) (env I) (env parts) (env Indices) (env Maps) (env W) (env N) (env injection) := by - simp only [copyTaggedLayerFormula, Truth, truth_growthTagFormula, - truth_nonemptyTupleFormula, truth_copyLayerFormula] - constructor - · rintro ⟨tagged, tuple, rest⟩ - refine ⟨tagged, ?_, rest⟩ - simpa only [copyLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple - · rintro ⟨tagged, tuple, rest⟩ - refine ⟨tagged, ?_, rest⟩ - simpa only [copyLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple - -def separatedTaggedLayerFormula {n} - (z tag I Indices Maps W Components F Qs rs μs L r μ birth t QB RB MB : Fin n) : - BoundedFormula n := - .conj (growthTagFormula 2 tag) - (.conj (nonemptyTupleFormula 6 z (Fin.cases tag (Fin.cases I (Fin.cases Indices - (Fin.cases Maps (Fin.cases W (Fin.cases Components (fun _ => F)))))))) - (.conj (doubleUnionEquationFormula QB Qs) - (.conj (doubleUnionEquationFormula RB rs) - (.conj (doubleUnionEquationFormula MB μs) - (separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB))))) - -theorem truth_separatedTaggedLayerFormula {n} - (z tag I Indices Maps W Components F Qs rs μs L r μ birth t QB RB MB : Fin n) - (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env L) (env r) (env μ)) : - Truth (separatedTaggedLayerFormula z tag I Indices Maps W Components F Qs rs μs L r μ birth t QB RB MB) env ↔ - env tag = natSetCode 2 ∧ env z = separatedLayerWitness (env I) (env Indices) - (env Maps) (env W) (env Components) (env F) ∧ - env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ - SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) - (env t) (env I) (env Indices) (env Maps) (env W) (env Components) (env F) := by - simp only [separatedTaggedLayerFormula, Truth, truth_growthTagFormula, - truth_nonemptyTupleFormula, truth_doubleUnionEquationFormula] - constructor - · rintro ⟨tagged, tuple, eqQ, eqR, eqM, recognized⟩ - refine ⟨tagged, ?_, eqQ, eqR, eqM, ?_⟩ - · simpa only [separatedLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple - · exact (truth_separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB - env meet eqQ eqR eqM).1 recognized - · rintro ⟨tagged, tuple, eqQ, eqR, eqM, code⟩ - refine ⟨tagged, ?_, eqQ, eqR, eqM, ?_⟩ - · simpa only [separatedLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple - · exact (truth_separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB - env meet eqQ eqR eqM).2 code - -end PartitionPilot.Forcing.BoundedFormula - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalGroupEmbeddings +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableLayerCodes +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLayerBirthFibers + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def oldBridgeFormula {n} (L r μ birth t x y : Fin n) : BoundedFormula n := + disj + (exMem L (exMem t.succ (.conj + (tripleMembershipFormula x.succ.succ y.succ.succ 1 μ.succ.succ) + (pairMembershipFormula 1 0 birth.succ.succ)))) + (exMem L (exMem t.succ (.conj (pairMembershipFormula 1 0 birth.succ.succ) + (disj + (.conj (pairMembershipFormula x.succ.succ 1 r.succ.succ) + (pairMembershipFormula 1 y.succ.succ r.succ.succ)) + (.conj (pairMembershipFormula y.succ.succ 1 r.succ.succ) + (pairMembershipFormula 1 x.succ.succ r.succ.succ)))))) + +theorem truth_oldBridgeFormula {n} (L r μ birth t x y : Fin n) (env : Fin n → ZFSet.{u}) + (meet : MeetOrderCode (env L) (env r) (env μ)) : + Truth (oldBridgeFormula L r μ birth t x y) env ↔ + OldBridgeCode (env L) (env r) (env μ) (env birth) (env t) (env x) (env y) := by + simp only [oldBridgeFormula, truth_disj, truth_exMem, Truth, + truth_tripleMembershipFormula, truth_pairMembershipFormula, OldBridgeCode] + constructor + · rintro (⟨z, _, a, ha, entry, born⟩ | ⟨z, hz, a, ha, born, bridge⟩) + · exact Or.inl ⟨z, a, entry, born, ha⟩ + · exact Or.inr ⟨z, hz, a, born, ha, bridge⟩ + · rintro (⟨z, a, entry, born, ha⟩ | ⟨z, hz, a, born, ha, bridge⟩) + · exact Or.inl ⟨z, (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2, a, ha, entry, born⟩ + · exact Or.inr ⟨z, hz, a, ha, born, bridge⟩ + +theorem realize_oldBridgeFormula (M : TransitiveGround.{u}) {n} + (L r μ birth t x y : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meet : MeetOrderCode (env L) (env r) (env μ)) : + Realize M.sets (oldBridgeFormula L r μ birth t x y).toFormula env ↔ + OldBridgeCode (env L) (env r) (env μ) (env birth) (env t) (env x) (env y) := + (realize_toFormula M _ env members).trans (truth_oldBridgeFormula L r μ birth t x y env meet) + + + + + +def meetEmbeddingFormula {n} (P L rP rL μP μL e : Fin n) : BoundedFormula n := + let lift4 (i : Fin n) := i.succ.succ.succ.succ + let lift6 (i : Fin n) := i.succ.succ.succ.succ.succ.succ + .conj (injectionFormula P L e) + (.conj + (.allMem P (.allMem P.succ (.allMem L.succ.succ (.allMem L.succ.succ.succ + (imp (.conj (pairMembershipFormula 3 2 (lift4 rP)) + (.conj (pairMembershipFormula 3 1 (lift4 e)) + (pairMembershipFormula 2 0 (lift4 e)))) + (pairMembershipFormula 1 0 (lift4 rL))))))) + (.allMem P (.allMem P.succ (.allMem P.succ.succ + (.allMem L.succ.succ.succ (.allMem L.succ.succ.succ.succ + (.allMem L.succ.succ.succ.succ.succ + (imp (.conj (tripleMembershipFormula 5 4 3 (lift6 μP)) + (.conj (pairMembershipFormula 5 2 (lift6 e)) + (.conj (pairMembershipFormula 4 1 (lift6 e)) + (pairMembershipFormula 3 0 (lift6 e))))) + (tripleMembershipFormula 2 1 0 (lift6 μL)))))))))) + +theorem truth_meetEmbeddingFormula {n} (P L rP rL μP μL e : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (meetEmbeddingFormula P L rP rL μP μL e) env ↔ + MeetEmbeddingCode (env P) (env L) (env rP) (env rL) (env μP) (env μL) (env e) := by + simp only [meetEmbeddingFormula, Truth, truth_injectionFormula, truth_imp, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + constructor + · rintro ⟨injection, monotone, meet⟩ + have bounds {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env e) : + x ∈ env P ∧ y ∈ env L := ZFSet.pair_mem_prod.1 (injection.function.1 entry) + refine ⟨injection, ?_, ?_⟩ + · intro x y x' y' lower first second + exact monotone x (bounds first).1 y (bounds second).1 + x' (bounds first).2 y' (bounds second).2 ⟨lower, first, second⟩ + · intro x y z x' y' z' output first second third + exact meet x (bounds first).1 y (bounds second).1 z (bounds third).1 + x' (bounds first).2 y' (bounds second).2 z' (bounds third).2 + ⟨output, first, second, third⟩ + · intro code + exact ⟨code.injection, + fun x _ y _ x' _ y' _ h => code.monotone x y x' y' h.1 h.2.1 h.2.2, + fun x _ y _ z _ x' _ y' _ z' _ h => + code.map_meet x y z x' y' z' h.1 h.2.1 h.2.2.1 h.2.2.2⟩ + +theorem realize_meetEmbeddingFormula (M : TransitiveGround.{u}) {n} + (P L rP rL μP μL e : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (meetEmbeddingFormula P L rP rL μP μL e).toFormula env ↔ + MeetEmbeddingCode (env P) (env L) (env rP) (env rL) (env μP) (env μL) (env e) := + (realize_toFormula M _ env members).trans (truth_meetEmbeddingFormula P L rP rL μP μL e env) + + + + + +def groupEmbeddingFormula {n} (G H mG mH oneG oneH e : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + .conj (injectionFormula G H e) (.conj (pairMembershipFormula oneG oneH e) + (.allMem G (.allMem G.succ (.allMem G.succ.succ + (.allMem H.succ.succ.succ (.allMem H.succ.succ.succ.succ + (.allMem H.succ.succ.succ.succ.succ + (imp (.conj (tripleMembershipFormula 5 4 3 (lift mG)) + (.conj (pairMembershipFormula 5 2 (lift e)) + (.conj (pairMembershipFormula 4 1 (lift e)) + (pairMembershipFormula 3 0 (lift e))))) + (tripleMembershipFormula 2 1 0 (lift mH)))))))))) + +theorem truth_groupEmbeddingFormula {n} (G H mG mH oneG oneH e : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (groupEmbeddingFormula G H mG mH oneG oneH e) env ↔ + GroupEmbeddingCode (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env e) := by + simp only [groupEmbeddingFormula, Truth, truth_injectionFormula, truth_imp, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + constructor + · rintro ⟨injection, one, mul⟩ + have bounds {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env e) : + x ∈ env G ∧ y ∈ env H := ZFSet.pair_mem_prod.1 (injection.function.1 entry) + refine ⟨injection, one, ?_⟩ + intro a b c a' b' c' product first second third + exact mul a (bounds first).1 b (bounds second).1 c (bounds third).1 + a' (bounds first).2 b' (bounds second).2 c' (bounds third).2 + ⟨product, first, second, third⟩ + · intro code + exact ⟨code.injection, code.one, fun a _ b _ c _ a' _ b' _ c' _ h => + code.mul a b c a' b' c' h.1 h.2.1 h.2.2.1 h.2.2.2⟩ + +theorem realize_groupEmbeddingFormula (M : TransitiveGround.{u}) {n} + (G H mG mH oneG oneH e : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (groupEmbeddingFormula G H mG mH oneG oneH e).toFormula env ↔ + GroupEmbeddingCode (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env e) := + (realize_toFormula M _ env members).trans + (truth_groupEmbeddingFormula G H mG mH oneG oneH e env) + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def CopyEmbeddingFamilyCode (Qs rs μs L r μ t I Indices Maps : ZFSet.{u}) : Prop := + ∀ i ∈ I, ∀ s ∈ t, ∀ e P R V, + ZFSet.pair i s ∈ Indices → ZFSet.pair i e ∈ Maps → + ZFSet.pair s P ∈ Qs → ZFSet.pair s R ∈ rs → ZFSet.pair s V ∈ μs → + MeetEmbeddingCode P L R r V μ e + +def CopyImageCoverCode (Qs L t I parts Indices Maps : ZFSet.{u}) : Prop := + ∀ i ∈ I, ∀ s ∈ t, ∀ e P, ∀ x ∈ L, + ZFSet.pair i s ∈ Indices → ZFSet.pair i e ∈ Maps → + ZFSet.pair s P ∈ Qs → ZFSet.pair i x ∈ parts → x ∈ relationImage P L e + +namespace BoundedFormula + +def doubleUnionMemberFormula {n} (x f : Fin n) : BoundedFormula n := + exMem f (exMem 0 (.mem x.succ.succ 0)) + +theorem truth_doubleUnionMemberFormula {n} (x f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (doubleUnionMemberFormula x f) env ↔ env x ∈ ⋃₀ ⋃₀ env f := by + simp only [doubleUnionMemberFormula, truth_exMem, Truth] + change (∃ a ∈ env f, ∃ b ∈ a, env x ∈ b) ↔ _ + constructor + · rintro ⟨a, ha, b, hb, hx⟩ + exact ZFSet.mem_sUnion.2 ⟨b, ZFSet.mem_sUnion.2 ⟨a, ha, hb⟩, hx⟩ + · intro hx + obtain ⟨b, hb, hx⟩ := ZFSet.mem_sUnion.1 hx + obtain ⟨a, ha, hb⟩ := ZFSet.mem_sUnion.1 hb + exact ⟨a, ha, b, hb, hx⟩ + +def doubleUnionEquationFormula {n} (B f : Fin n) : BoundedFormula n := + .conj (.allMem B (doubleUnionMemberFormula 0 f.succ)) + (.allMem f (.allMem 0 (.allMem 0 (.mem 0 B.succ.succ.succ)))) + +theorem truth_doubleUnionEquationFormula {n} (B f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (doubleUnionEquationFormula B f) env ↔ env B = ⋃₀ ⋃₀ env f := by + simp only [doubleUnionEquationFormula, Truth, truth_doubleUnionMemberFormula] + change ((∀ x ∈ env B, x ∈ ⋃₀ ⋃₀ env f) ∧ + ∀ a ∈ env f, ∀ b ∈ a, ∀ x ∈ b, x ∈ env B) ↔ _ + constructor + · rintro ⟨subset, cover⟩ + apply ZFSet.ext + intro x + refine ⟨subset x, ?_⟩ + intro hx + obtain ⟨b, hb, hx⟩ := ZFSet.mem_sUnion.1 hx + obtain ⟨a, ha, hb⟩ := ZFSet.mem_sUnion.1 hb + exact cover a ha b hb x hx + · intro equal + rw [equal] + exact ⟨fun _ hx => hx, fun a ha b hb x hx => + ZFSet.mem_sUnion.2 ⟨b, ZFSet.mem_sUnion.2 ⟨a, ha, hb⟩, hx⟩⟩ + +def copyEmbeddingFamilyFormula {n} + (Qs rs μs L r μ t I Indices Maps W QB RB MB : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + .allMem I (.allMem t.succ (.allMem W.succ.succ (.allMem QB.succ.succ.succ + (.allMem RB.succ.succ.succ.succ (.allMem MB.succ.succ.succ.succ.succ + (imp (.conj (pairMembershipFormula 5 4 (lift Indices)) + (.conj (pairMembershipFormula 5 3 (lift Maps)) + (.conj (pairMembershipFormula 4 2 (lift Qs)) + (.conj (pairMembershipFormula 4 1 (lift rs)) + (pairMembershipFormula 4 0 (lift μs)))))) + (meetEmbeddingFormula 2 (lift L) 1 (lift r) 0 (lift μ) 3))))))) + +theorem truth_copyEmbeddingFamilyFormula {n} + (Qs rs μs L r μ t I Indices Maps W QB RB MB : Fin n) (env : Fin n → ZFSet.{u}) + (maps : ZFSet.IsFunc (env I) (env W) (env Maps)) + (eqQ : env QB = ⋃₀ ⋃₀ env Qs) (eqR : env RB = ⋃₀ ⋃₀ env rs) + (eqM : env MB = ⋃₀ ⋃₀ env μs) : + Truth (copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB) env ↔ + CopyEmbeddingFamilyCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) + (env t) (env I) (env Indices) (env Maps) := by + simp only [copyEmbeddingFamilyFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_meetEmbeddingFormula] + constructor + · intro property i hi s hs e P R V index map qField rField mField + have hP : P ∈ env QB := eqQ.symm ▸ pair_second_mem_doubleUnion qField + have hR : R ∈ env RB := eqR.symm ▸ pair_second_mem_doubleUnion rField + have hV : V ∈ env MB := eqM.symm ▸ pair_second_mem_doubleUnion mField + exact property i hi s hs e (ZFSet.pair_mem_prod.1 (maps.1 map)).2 + P hP R hR V hV ⟨index, map, qField, rField, mField⟩ + · intro code i hi s hs e _ P _ R _ V _ condition + exact code i hi s hs e P R V condition.1 condition.2.1 condition.2.2.1 + condition.2.2.2.1 condition.2.2.2.2 + +def copyImageCoverFormula {n} (Qs L t I parts Indices Maps W QB : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ + .allMem I (.allMem t.succ (.allMem W.succ.succ (.allMem QB.succ.succ.succ + (.allMem L.succ.succ.succ.succ + (imp (.conj (pairMembershipFormula 4 3 (lift Indices)) + (.conj (pairMembershipFormula 4 2 (lift Maps)) + (.conj (pairMembershipFormula 3 1 (lift Qs)) + (pairMembershipFormula 4 0 (lift parts))))) + (imageMemberFormula 0 1 2)))))) + +theorem truth_copyImageCoverFormula {n} (Qs L t I parts Indices Maps W QB : Fin n) + (env : Fin n → ZFSet.{u}) (maps : ZFSet.IsFunc (env I) (env W) (env Maps)) + (eqQ : env QB = ⋃₀ ⋃₀ env Qs) : + Truth (copyImageCoverFormula Qs L t I parts Indices Maps W QB) env ↔ + CopyImageCoverCode (env Qs) (env L) (env t) (env I) (env parts) (env Indices) (env Maps) := by + simp only [copyImageCoverFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_imageMemberFormula] + constructor + · intro property i hi s hs e P x hx index map qField part + have hP : P ∈ env QB := eqQ.symm ▸ pair_second_mem_doubleUnion qField + exact (mem_relationImage P (env L) e x).2 ⟨hx, + property i hi s hs e (ZFSet.pair_mem_prod.1 (maps.1 map)).2 + P hP x hx ⟨index, map, qField, part⟩⟩ + · intro code i hi s hs e _ P _ x hx condition + exact ((mem_relationImage P (env L) e x).1 + (code i hi s hs e P x hx condition.1 condition.2.1 condition.2.2.1 condition.2.2.2)).2 + +end BoundedFormula + + + + + +structure CopyLayerCode + (Qs rs μs L r μ birth t I parts Indices Maps W N injection : ZFSet.{u}) : Prop where + small : InjectionCode I N injection + indices : ZFSet.IsFunc I t Indices + maps : ZFSet.IsFunc I W Maps + embedding : CopyEmbeddingFamilyCode Qs rs μs L r μ t I Indices Maps + cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → ∃ i ∈ I, ZFSet.pair i x ∈ parts + inCopy : CopyImageCoverCode Qs L t I parts Indices Maps + +namespace BoundedFormula + +def copyLayerFormula {n} + (Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB : Fin n) : BoundedFormula n := + .conj (doubleUnionEquationFormula QB Qs) + (.conj (doubleUnionEquationFormula RB rs) + (.conj (doubleUnionEquationFormula MB μs) + (.conj (injectionFormula I N injection) + (.conj (functionFormula I t Indices) + (.conj (functionFormula I W Maps) + (.conj (copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB) + (.conj (.allMem L (imp (pairMembershipFormula 0 t.succ birth.succ) + (exMem I.succ (pairMembershipFormula 0 1 parts.succ.succ)))) + (copyImageCoverFormula Qs L t I parts Indices Maps W QB)))))))) + +theorem truth_copyLayerFormula {n} + (Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB) env ↔ + env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ + CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) (env t) + (env I) (env parts) (env Indices) (env Maps) (env W) (env N) (env injection) := by + simp only [copyLayerFormula, Truth, truth_doubleUnionEquationFormula, truth_injectionFormula, + truth_functionFormula, truth_imp, truth_pairMembershipFormula, truth_exMem] + constructor + · rintro ⟨eqQ, eqR, eqM, small, indices, maps, embedding, cover, inCopy⟩ + exact ⟨eqQ, eqR, eqM, small, indices, maps, + (truth_copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB + env maps eqQ eqR eqM).1 embedding, + cover, (truth_copyImageCoverFormula Qs L t I parts Indices Maps W QB env maps eqQ).1 inCopy⟩ + · rintro ⟨eqQ, eqR, eqM, code⟩ + exact ⟨eqQ, eqR, eqM, code.small, code.indices, code.maps, + (truth_copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB + env code.maps eqQ eqR eqM).2 code.embedding, + code.cover, (truth_copyImageCoverFormula Qs L t I parts Indices Maps W QB env code.maps eqQ).2 + code.inCopy⟩ + +theorem realize_copyLayerFormula (M : TransitiveGround.{u}) {n} + (Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets + (copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB).toFormula env ↔ + env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ + CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) (env t) + (env I) (env parts) (env Indices) (env Maps) (env W) (env N) (env injection) := + (realize_toFormula M _ env members).trans + (truth_copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB env) + +end BoundedFormula + +namespace CopyLayerCode + +noncomputable def toLayer + {M : TransitiveGround.{u}} {Qs rs μs L r μ birth t I parts Indices Maps W N injection : ZFSet.{u}} + (code : CopyLayerCode Qs rs μs L r μ birth t I parts Indices Maps W N injection) + (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) + (hI : I ∈ M.sets) (hParts : parts ∈ M.sets) (hMaps : Maps ∈ M.sets) + (hInjection : injection ∈ M.sets) (omega : N = ZFSet.omega) + (history : ∀ s ∈ t, ZFSet.pair s (Space s) ∈ Qs ∧ + ZFSet.pair s (sourceOrder s) ∈ rs ∧ ZFSet.pair s (sourceMeet s) ∈ μs) : + CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := by + classical + let indexGraph : FunctionGraphOn I Indices := ⟨t, code.indices⟩ + let mapGraph : FunctionGraphOn I Maps := ⟨W, code.maps⟩ + let index (i : ZFSet.{u}) := if hi : i ∈ I then indexGraph.value ⟨i, hi⟩ else ∅ + let copy (i : ZFSet.{u}) := if hi : i ∈ I then mapGraph.value ⟨i, hi⟩ else ∅ + have indexEntry (i : ZFSet.{u}) (hi : i ∈ I) : ZFSet.pair i (index i) ∈ Indices := by + simpa only [index, dite_eq_left hi] using indexGraph.value_entry ⟨i, hi⟩ + have copyEntry (i : ZFSet.{u}) (hi : i ∈ I) : ZFSet.pair i (copy i) ∈ Maps := by + simpa only [copy, dite_eq_left hi] using mapGraph.value_entry ⟨i, hi⟩ + have earlier (i : ZFSet.{u}) (hi : i ∈ I) : index i ∈ t := + (ZFSet.pair_mem_prod.1 (code.indices.1 (indexEntry i hi))).2 + refine .copies I parts hI ⟨injection, hInjection, omega ▸ code.small⟩ hParts + index copy earlier (fun i hi => M.pair_right (M.transitive hMaps (copyEntry i hi))) + ?_ code.cover ?_ + · intro i hi + have fields := history (index i) (earlier i hi) + exact code.embedding i hi (index i) (earlier i hi) (copy i) (Space (index i)) + (sourceOrder (index i)) (sourceMeet (index i)) (indexEntry i hi) (copyEntry i hi) + fields.1 fields.2.1 fields.2.2 + · intro i hi x hx part + exact code.inCopy i hi (index i) (earlier i hi) (copy i) (Space (index i)) x hx + (indexEntry i hi) (copyEntry i hi) (history (index i) (earlier i hi)).1 part + +end CopyLayerCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +def ComponentImageCoverCode (Qs L t I Components Indices Maps : ZFSet.{u}) : Prop := + ∀ i ∈ I, ∀ s ∈ t, ∀ e P, ∀ x ∈ L, + ZFSet.pair i s ∈ Indices → ZFSet.pair i e ∈ Maps → + ZFSet.pair s P ∈ Qs → ZFSet.pair x i ∈ Components → x ∈ relationImage P L e + +def ComponentSeparationCode (L r μ birth t F I Components : ZFSet.{u}) : Prop := + ∀ x ∈ F, ∀ y ∈ F, ∀ i ∈ I, ∀ j ∈ I, + ZFSet.pair x i ∈ Components → ZFSet.pair y j ∈ Components → i ≠ j → + OldBridgeCode L r μ birth t x y + +structure SeparatedLayerCode + (Qs rs μs L r μ birth t I Indices Maps W Components F : ZFSet.{u}) : Prop where + indices : ZFSet.IsFunc I t Indices + maps : ZFSet.IsFunc I W Maps + fiber : F = layerBirthFiber L birth t + components : ZFSet.IsFunc F I Components + embedding : CopyEmbeddingFamilyCode Qs rs μs L r μ t I Indices Maps + cover : ComponentImageCoverCode Qs L t I Components Indices Maps + separated : ComponentSeparationCode L r μ birth t F I Components + +namespace SeparatedLayerCode +variable {M : TransitiveGround.{u}} +variable {Qs rs μs L r μ birth t I Indices Maps W Components F : ZFSet.{u}} +variable (code : SeparatedLayerCode Qs rs μs L r μ birth t I Indices Maps W Components F) + +noncomputable def toGrowthLayer + (hMaps : Maps ∈ M.sets) (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) + (agree : ∀ s ∈ t, ZFSet.pair s (Space s) ∈ Qs ∧ + ZFSet.pair s (sourceOrder s) ∈ rs ∧ ZFSet.pair s (sourceMeet s) ∈ μs) : + CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := by + classical + let indices : FunctionGraphOn I Indices := ⟨t, code.indices⟩ + let maps : FunctionGraphOn I Maps := ⟨W, code.maps⟩ + let components : FunctionGraphOn F Components := ⟨I, code.components⟩ + let member (i : SetMembers I) : {i : ZFSet.{u} // i ∈ I} := + ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ + let index (i : SetMembers I) := indices.value (member i) + let e (i : SetMembers I) := maps.value (member i) + have earlier (i : SetMembers I) : index i ∈ t := + (ZFSet.pair_mem_prod.1 (code.indices.1 (indices.value_entry (member i)))).2 + have embedding (i : SetMembers I) : MeetEmbeddingCode (Space (index i)) L + (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i) := + code.embedding _ (SetMembers.raw_mem i) _ (earlier i) _ _ _ _ + (indices.value_entry (member i)) (maps.value_entry (member i)) + (agree _ (earlier i)).1 (agree _ (earlier i)).2.1 (agree _ (earlier i)).2.2 + let Point := {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} + have inFiber (x : Point) : x.val ∈ F := + code.fiber.symm ▸ (mem_layerBirthFiber L birth t x.val).2 x.property + let componentValue (x : Point) := components.value ⟨x.val, inFiber x⟩ + have componentMem (x : Point) : componentValue x ∈ I := + (ZFSet.pair_mem_prod.1 (code.components.1 (components.value_entry ⟨x.val, inFiber x⟩))).2 + let component (x : Point) : SetMembers I := SetMembers.ofMem (componentValue x) (componentMem x) + have componentEntry (x : Point) : ZFSet.pair x.val (SetMembers.raw (component x)) ∈ Components := by + change ZFSet.pair x.val (SetMembers.raw (SetMembers.ofMem _ _)) ∈ Components + rw [SetMembers.raw_ofMem] + exact components.value_entry ⟨x.val, inFiber x⟩ + refine CodedGrowthLayer.separated (SetMembers I) index e earlier + (fun i => maps.value_mem M hMaps (member i)) embedding component ?_ ?_ + · intro x + exact code.cover _ (SetMembers.raw_mem (component x)) _ (earlier (component x)) _ _ _ + x.property.1 (indices.value_entry (member (component x))) + (maps.value_entry (member (component x))) (agree _ (earlier (component x))).1 + (componentEntry x) + · intro x y different + exact code.separated _ (inFiber x) _ (inFiber y) + _ (SetMembers.raw_mem (component x)) _ (SetMembers.raw_mem (component y)) + (componentEntry x) (componentEntry y) + (fun equal => different (SetMembers.raw_injective I equal)) +end SeparatedLayerCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def componentImageCoverFormula {n} (Qs L t I Components Indices Maps W QB : Fin n) : + BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ + .allMem I (.allMem t.succ (.allMem W.succ.succ (.allMem QB.succ.succ.succ + (.allMem L.succ.succ.succ.succ + (imp (.conj (pairMembershipFormula 4 3 (lift Indices)) + (.conj (pairMembershipFormula 4 2 (lift Maps)) + (.conj (pairMembershipFormula 3 1 (lift Qs)) + (pairMembershipFormula 0 4 (lift Components))))) + (imageMemberFormula 0 1 2)))))) + +theorem truth_componentImageCoverFormula {n} + (Qs L t I Components Indices Maps W QB : Fin n) (env : Fin n → ZFSet.{u}) + (maps : ZFSet.IsFunc (env I) (env W) (env Maps)) (eqQ : env QB = ⋃₀ ⋃₀ env Qs) : + Truth (componentImageCoverFormula Qs L t I Components Indices Maps W QB) env ↔ + ComponentImageCoverCode (env Qs) (env L) (env t) (env I) + (env Components) (env Indices) (env Maps) := by + simp only [componentImageCoverFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_imageMemberFormula] + constructor + · intro property i hi s hs e P x hx index map qField part + have hP : P ∈ env QB := eqQ.symm ▸ pair_second_mem_doubleUnion qField + exact (mem_relationImage P (env L) e x).2 ⟨hx, + property i hi s hs e (ZFSet.pair_mem_prod.1 (maps.1 map)).2 + P hP x hx ⟨index, map, qField, part⟩⟩ + · intro code i hi s hs e _ P _ x hx condition + exact ((mem_relationImage P (env L) e x).1 + (code i hi s hs e P x hx condition.1 condition.2.1 condition.2.2.1 condition.2.2.2)).2 + +def componentSeparationFormula {n} (L r μ birth t F I Components : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ + .allMem F (.allMem F.succ (.allMem I.succ.succ (.allMem I.succ.succ.succ + (imp (.conj (pairMembershipFormula 3 1 (lift Components)) + (.conj (pairMembershipFormula 2 0 (lift Components)) (.neg (.equal 1 0)))) + (oldBridgeFormula (lift L) (lift r) (lift μ) (lift birth) (lift t) 3 2))))) + +theorem truth_componentSeparationFormula {n} (L r μ birth t F I Components : Fin n) + (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env L) (env r) (env μ)) : + Truth (componentSeparationFormula L r μ birth t F I Components) env ↔ + ComponentSeparationCode (env L) (env r) (env μ) (env birth) + (env t) (env F) (env I) (env Components) := by + simp only [componentSeparationFormula, Truth, truth_imp, truth_pairMembershipFormula] + constructor + · intro property x hx y hy i hi j hj first second different + exact (truth_oldBridgeFormula L.succ.succ.succ.succ r.succ.succ.succ.succ + μ.succ.succ.succ.succ birth.succ.succ.succ.succ t.succ.succ.succ.succ 3 2 + (extend j (extend i (extend y (extend x env)))) meet).1 + (property x hx y hy i hi j hj ⟨first, second, different⟩) + · intro code x hx y hy i hi j hj condition + exact (truth_oldBridgeFormula L.succ.succ.succ.succ r.succ.succ.succ.succ + μ.succ.succ.succ.succ birth.succ.succ.succ.succ t.succ.succ.succ.succ 3 2 + (extend j (extend i (extend y (extend x env)))) meet).2 + (code x hx y hy i hi j hj condition.1 condition.2.1 condition.2.2) + +def separatedLayerFormula {n} + (Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB : Fin n) : + BoundedFormula n := + .conj (functionFormula I t Indices) + (.conj (functionFormula I W Maps) + (.conj (layerBirthFiberFormula F L birth t) + (.conj (functionFormula F I Components) + (.conj (copyEmbeddingFamilyFormula Qs rs μs L r μ t I Indices Maps W QB RB MB) + (.conj (componentImageCoverFormula Qs L t I Components Indices Maps W QB) + (componentSeparationFormula L r μ birth t F I Components)))))) + +theorem truth_separatedLayerFormula {n} + (Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB : Fin n) + (env : Fin n → ZFSet.{u}) + (meet : MeetOrderCode (env L) (env r) (env μ)) + (eqQ : env QB = ⋃₀ ⋃₀ env Qs) (eqR : env RB = ⋃₀ ⋃₀ env rs) + (eqM : env MB = ⋃₀ ⋃₀ env μs) : + Truth (separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB) env ↔ + SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) + (env birth) (env t) (env I) (env Indices) (env Maps) (env W) (env Components) (env F) := by + simp only [separatedLayerFormula, Truth, truth_functionFormula, truth_layerBirthFiberFormula] + constructor + · rintro ⟨indices, maps, fiber, components, embeddings, cover, separated⟩ + exact ⟨indices, maps, fiber, components, + (truth_copyEmbeddingFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ env maps eqQ eqR eqM).1 embeddings, + (truth_componentImageCoverFormula _ _ _ _ _ _ _ _ _ env maps eqQ).1 cover, + (truth_componentSeparationFormula _ _ _ _ _ _ _ _ env meet).1 separated⟩ + · intro code + exact ⟨code.indices, code.maps, code.fiber, code.components, + (truth_copyEmbeddingFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ env code.maps eqQ eqR eqM).2 code.embedding, + (truth_componentImageCoverFormula _ _ _ _ _ _ _ _ _ env code.maps eqQ).2 code.cover, + (truth_componentSeparationFormula _ _ _ _ _ _ _ _ env meet).2 code.separated⟩ + +theorem realize_separatedLayerFormula (M : TransitiveGround.{u}) {n} + (Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meet : MeetOrderCode (env L) (env r) (env μ)) + (eqQ : env QB = ⋃₀ ⋃₀ env Qs) (eqR : env RB = ⋃₀ ⋃₀ env rs) + (eqM : env MB = ⋃₀ ⋃₀ env μs) : + Realize M.sets + (separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB).toFormula env ↔ + SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) + (env birth) (env t) (env I) (env Indices) (env Maps) (env W) (env Components) (env F) := + (realize_toFormula M _ env members).trans + (truth_separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB + env meet eqQ eqR eqM) + +end PartitionPilot.Forcing.BoundedFormula + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def countableLayerWitness (D injection : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 2 (Fin.cases (natSetCode 0) (Fin.cases D (fun _ => injection))) + +noncomputable def copyLayerWitness (I parts Indices Maps W injection : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 6 (Fin.cases (natSetCode 1) (Fin.cases I (Fin.cases parts + (Fin.cases Indices (Fin.cases Maps (Fin.cases W (fun _ => injection))))))) + +noncomputable def separatedLayerWitness (I Indices Maps W Components F : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 6 (Fin.cases (natSetCode 2) (Fin.cases I (Fin.cases Indices + (Fin.cases Maps (Fin.cases W (Fin.cases Components (fun _ => F))))))) + +def GrowthLayerWitnessCode (Qs rs μs L r μ birth t N z : ZFSet.{u}) : Prop := + (∃ D injection, z = countableLayerWitness D injection ∧ CountableLayerCode L birth t D N injection) ∨ + (∃ I parts Indices Maps W injection, z = copyLayerWitness I parts Indices Maps W injection ∧ + CopyLayerCode Qs rs μs L r μ birth t I parts Indices Maps W N injection) ∨ + (∃ I Indices Maps W Components F, z = separatedLayerWitness I Indices Maps W Components F ∧ + SeparatedLayerCode Qs rs μs L r μ birth t I Indices Maps W Components F) + +namespace GrowthLayerWitnessCode + +noncomputable def toLayer {M : TransitiveGround.{u}} + {Qs rs μs L r μ birth t N z : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) (ground : z ∈ M.sets) + (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) (omega : N = ZFSet.omega) + (history : ∀ s ∈ t, ZFSet.pair s (Space s) ∈ Qs ∧ + ZFSet.pair s (sourceOrder s) ∈ rs ∧ ZFSet.pair s (sourceMeet s) ∈ μs) : + CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := by + apply Classical.choice + rcases code with ⟨D, injection, rfl, code⟩ | + ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | + ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ + · have fields := M.nonemptyTupleCode_field_mem 2 _ ground + exact ⟨code.toLayer Space sourceOrder sourceMeet (fields 1) (fields 2) omega⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ ground + exact ⟨code.toLayer Space sourceOrder sourceMeet (fields 1) (fields 2) (fields 4) + (fields 6) omega history⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ ground + exact ⟨code.toGrowthLayer (fields 3) Space sourceOrder sourceMeet history⟩ +end GrowthLayerWitnessCode + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem countableLayerWitness_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {D injection : ZFSet.{u}} (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) : + countableLayerWitness D injection ∈ M.sets := + M.nonemptyTupleCode_mem pairing 2 _ + (Fin.cases (M.empty_mem ⟨D, hD⟩) (Fin.cases hD (fun _ => hInjection))) + +theorem copyLayerWitness_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {I parts Indices Maps W injection : ZFSet.{u}} + (hI : I ∈ M.sets) (hParts : parts ∈ M.sets) (hIndices : Indices ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hW : W ∈ M.sets) (hInjection : injection ∈ M.sets) : + copyLayerWitness I parts Indices Maps W injection ∈ M.sets := by + have zero := M.empty_mem ⟨I, hI⟩ + have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero + exact M.nonemptyTupleCode_mem pairing 6 _ + (Fin.cases one (Fin.cases hI (Fin.cases hParts (Fin.cases hIndices + (Fin.cases hMaps (Fin.cases hW (fun _ => hInjection))))))) + +theorem separatedLayerWitness_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {I Indices Maps W Components F : ZFSet.{u}} + (hI : I ∈ M.sets) (hIndices : Indices ∈ M.sets) (hMaps : Maps ∈ M.sets) + (hW : W ∈ M.sets) (hComponents : Components ∈ M.sets) (hF : F ∈ M.sets) : + separatedLayerWitness I Indices Maps W Components F ∈ M.sets := by + have zero := M.empty_mem ⟨I, hI⟩ + have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero + have two : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions one one + exact M.nonemptyTupleCode_mem pairing 6 _ + (Fin.cases two (Fin.cases hI (Fin.cases hIndices (Fin.cases hMaps + (Fin.cases hW (Fin.cases hComponents (fun _ => hF))))))) +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def growthTagFormula : (k : Nat) → {n : Nat} → Fin n → BoundedFormula n + | 0, _, z => emptyFormula z + | k + 1, _, z => exMem z (.conj (successorFormula z.succ 0) (growthTagFormula k 0)) + +theorem truth_growthTagFormula (k : Nat) {n} (z : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (growthTagFormula k z) env ↔ env z = natSetCode k := by + induction k generalizing n with + | zero => exact truth_emptyFormula z env + | succ k ih => + simp only [growthTagFormula, truth_exMem, Truth, truth_successorFormula, ih] + change (∃ x ∈ env z, env z = insert x x ∧ x = natSetCode k) ↔ _ + constructor + · rintro ⟨x, _, equal, rfl⟩ + exact equal + · intro equal + exact ⟨natSetCode k, equal.symm ▸ (show natSetCode k ∈ natSetCode (k + 1) from by + rw [natSetCode_succ]; exact ZFSet.mem_insert _ _), equal, rfl⟩ + +def countableTaggedLayerFormula {n} (z tag D injection L birth t N : Fin n) : BoundedFormula n := + .conj (growthTagFormula 0 tag) + (.conj (nonemptyTupleFormula 2 z (Fin.cases tag (Fin.cases D (fun _ => injection)))) + (countableLayerFormula L birth t D N injection)) + +theorem truth_countableTaggedLayerFormula {n} (z tag D injection L birth t N : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (countableTaggedLayerFormula z tag D injection L birth t N) env ↔ + env tag = natSetCode 0 ∧ env z = countableLayerWitness (env D) (env injection) ∧ + CountableLayerCode (env L) (env birth) (env t) (env D) (env N) (env injection) := by + simp only [countableTaggedLayerFormula, Truth, truth_growthTagFormula, + truth_nonemptyTupleFormula, truth_countableLayerFormula] + constructor + · rintro ⟨tagged, tuple, code⟩ + refine ⟨tagged, ?_, code⟩ + simpa only [countableLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple + · rintro ⟨tagged, tuple, code⟩ + refine ⟨tagged, ?_, code⟩ + simpa only [countableLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple + +def copyTaggedLayerFormula {n} + (z tag I parts Indices Maps W injection Qs rs μs L r μ birth t N QB RB MB : Fin n) : + BoundedFormula n := + .conj (growthTagFormula 1 tag) + (.conj (nonemptyTupleFormula 6 z (Fin.cases tag (Fin.cases I (Fin.cases parts + (Fin.cases Indices (Fin.cases Maps (Fin.cases W (fun _ => injection)))))))) + (copyLayerFormula Qs rs μs L r μ birth t I parts Indices Maps W N injection QB RB MB)) + +theorem truth_copyTaggedLayerFormula {n} + (z tag I parts Indices Maps W injection Qs rs μs L r μ birth t N QB RB MB : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (copyTaggedLayerFormula z tag I parts Indices Maps W injection Qs rs μs L r μ birth t N QB RB MB) env ↔ + env tag = natSetCode 1 ∧ env z = copyLayerWitness (env I) (env parts) (env Indices) + (env Maps) (env W) (env injection) ∧ + env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ + CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) + (env t) (env I) (env parts) (env Indices) (env Maps) (env W) (env N) (env injection) := by + simp only [copyTaggedLayerFormula, Truth, truth_growthTagFormula, + truth_nonemptyTupleFormula, truth_copyLayerFormula] + constructor + · rintro ⟨tagged, tuple, rest⟩ + refine ⟨tagged, ?_, rest⟩ + simpa only [copyLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple + · rintro ⟨tagged, tuple, rest⟩ + refine ⟨tagged, ?_, rest⟩ + simpa only [copyLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple + +def separatedTaggedLayerFormula {n} + (z tag I Indices Maps W Components F Qs rs μs L r μ birth t QB RB MB : Fin n) : + BoundedFormula n := + .conj (growthTagFormula 2 tag) + (.conj (nonemptyTupleFormula 6 z (Fin.cases tag (Fin.cases I (Fin.cases Indices + (Fin.cases Maps (Fin.cases W (Fin.cases Components (fun _ => F)))))))) + (.conj (doubleUnionEquationFormula QB Qs) + (.conj (doubleUnionEquationFormula RB rs) + (.conj (doubleUnionEquationFormula MB μs) + (separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB))))) + +theorem truth_separatedTaggedLayerFormula {n} + (z tag I Indices Maps W Components F Qs rs μs L r μ birth t QB RB MB : Fin n) + (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env L) (env r) (env μ)) : + Truth (separatedTaggedLayerFormula z tag I Indices Maps W Components F Qs rs μs L r μ birth t QB RB MB) env ↔ + env tag = natSetCode 2 ∧ env z = separatedLayerWitness (env I) (env Indices) + (env Maps) (env W) (env Components) (env F) ∧ + env QB = ⋃₀ ⋃₀ env Qs ∧ env RB = ⋃₀ ⋃₀ env rs ∧ env MB = ⋃₀ ⋃₀ env μs ∧ + SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) + (env t) (env I) (env Indices) (env Maps) (env W) (env Components) (env F) := by + simp only [separatedTaggedLayerFormula, Truth, truth_growthTagFormula, + truth_nonemptyTupleFormula, truth_doubleUnionEquationFormula] + constructor + · rintro ⟨tagged, tuple, eqQ, eqR, eqM, recognized⟩ + refine ⟨tagged, ?_, eqQ, eqR, eqM, ?_⟩ + · simpa only [separatedLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple + · exact (truth_separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB + env meet eqQ eqR eqM).1 recognized + · rintro ⟨tagged, tuple, eqQ, eqR, eqM, code⟩ + refine ⟨tagged, ?_, eqQ, eqR, eqM, ?_⟩ + · simpa only [separatedLayerWitness, nonemptyTupleCode, Fin.cases_zero, Fin.cases_succ, tagged] using tuple + · exact (truth_separatedLayerFormula Qs rs μs L r μ birth t I Indices Maps W Components F QB RB MB + env meet eqQ eqR eqM).2 code + +end PartitionPilot.Forcing.BoundedFormula + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedSumPresentations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedSumPresentations.lean index 870fd219cb64763849e194551f27db6c5f75fb97..d2ad188d0ff92645bf69b6bba94de92062152bd9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedSumPresentations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaggedSumPresentations.lean @@ -1,514 +1,514 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundSuccessorInjections - -namespace OAI - - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -theorem natSetCode_injective : Function.Injective (natSetCode : Nat → ZFSet.{u}) := by - intro m n eq - induction m generalizing n with - | zero => - cases n with - | zero => rfl - | succ n => exact False.elim (setSuccessor_ne_empty (natSetCode n) eq.symm) - | succ m ih => - cases n with - | zero => exact False.elim (setSuccessor_ne_empty (natSetCode m) eq) - | succ n => exact congrArg Nat.succ (ih (setSuccessor_injective eq)) - -theorem natSetCode_mem_iff (m n : Nat) : natSetCode m ∈ natSetCode n ↔ m < n := by - induction n with - | zero => - exact ⟨fun h => False.elim (ZFSet.notMem_empty _ h), fun h => False.elim (Nat.not_lt_zero m h)⟩ - | succ n ih => - rw [natSetCode_succ, ZFSet.mem_insert_iff, natSetCode_injective.eq_iff, ih] - omega - -theorem mem_natSetCode (x : ZFSet.{u}) (n : Nat) : - x ∈ natSetCode n ↔ ∃ m < n, x = natSetCode m := by - constructor - · intro hx - have natural := naturalSetProperty_member ((naturalSetProperty_iff (natSetCode n)).2 ⟨n, rfl⟩) hx - obtain ⟨m, eq⟩ := (naturalSetProperty_iff x).1 natural - exact ⟨m, (natSetCode_mem_iff m n).1 (eq ▸ hx), eq⟩ - · rintro ⟨m, hm, rfl⟩ - exact (natSetCode_mem_iff m n).2 hm - -def natPresentation : Presentation (ULift.{u} Nat) where - carrier := ZFSet.omega - encode n := natSetCode n.down - injective := fun _ _ eq => ULift.ext _ _ (natSetCode_injective eq) - mem_carrier x := by - rw [mem_omega_iff_natSetCode] - exact ⟨fun ⟨n, eq⟩ => ⟨⟨n⟩, eq.symm⟩, fun ⟨n, eq⟩ => ⟨n.down, eq.symm⟩⟩ - -def natInitialPresentation (n : Nat) : Presentation (ULift.{u} (Fin n)) where - carrier := natSetCode n - encode i := natSetCode i.down.val - injective := fun _ _ eq => ULift.ext _ _ (Fin.ext (natSetCode_injective eq)) - mem_carrier x := by - rw [mem_natSetCode] - exact ⟨fun ⟨m, hm, eq⟩ => ⟨⟨⟨m, hm⟩⟩, eq.symm⟩, - fun ⟨m, eq⟩ => ⟨m.down.val, m.down.isLt, eq.symm⟩⟩ - -theorem natSetCode_finite (n : Nat) : (natSetCode n : ZFSet.{u}).toSet.Finite := by - have eq : (natSetCode n : ZFSet.{u}).toSet = Set.range (fun i : Fin n => natSetCode i.val) := by - apply Set.ext - intro x - change x ∈ natSetCode n ↔ _ - rw [mem_natSetCode] - exact ⟨fun ⟨m, hm, eq⟩ => ⟨⟨m, hm⟩, eq.symm⟩, fun ⟨m, eq⟩ => ⟨m.val, m.isLt, eq.symm⟩⟩ - rw [eq] - simpa only [Set.image_univ] using Set.finite_univ.image (fun i : Fin n => (natSetCode i.val : ZFSet.{u})) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -def externalSignCode (b : Bool) : ZFSet.{u} := natSetCode (if b then 1 else 0) - -theorem externalSignCode_injective : Function.Injective (externalSignCode : Bool → ZFSet.{u}) := by - intro a b eq - cases a <;> cases b <;> simp only [externalSignCode, Bool.false_eq_true, ite_false, ite_true, - natSetCode_injective.eq_iff] at eq ⊢ - · exact False.elim (Nat.zero_ne_one eq) - · exact False.elim (Nat.zero_ne_one eq.symm) - -theorem mem_natTwo_iff_externalSignCode (x : ZFSet.{u}) : - x ∈ natSetCode 2 ↔ ∃ b : Bool, x = externalSignCode b := by - constructor - · intro hx - obtain ⟨n, hn, rfl⟩ := (mem_natSetCode x 2).1 hx - have cases : n = 0 ∨ n = 1 := by omega - rcases cases with rfl | rfl - · exact ⟨false, rfl⟩ - · exact ⟨true, rfl⟩ - · rintro ⟨b, rfl⟩ - cases b <;> exact (natSetCode_mem_iff _ 2).2 (by decide) - -def externalActorSymbol (g : ZFSet.{u}) : ZFSet.{u} := ZFSet.pair (natSetCode 0) g - -def externalLetterSymbol (s : ZFSet.{u}) (b : Bool) : ZFSet.{u} := - ZFSet.pair (natSetCode 1) (ZFSet.pair s (externalSignCode b)) - -def externalGeneratorAlphabet (G S : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod {natSetCode 0} G ∪ ZFSet.prod {natSetCode 1} (ZFSet.prod S (natSetCode 2)) - -theorem externalActorSymbol_injective : Function.Injective (externalActorSymbol : ZFSet.{u} → ZFSet.{u}) := - fun _ _ eq => (ZFSet.pair_inj.1 eq).2 - -theorem externalLetterSymbol_inj {s t : ZFSet.{u}} {b c : Bool} : - externalLetterSymbol s b = externalLetterSymbol t c ↔ s = t ∧ b = c := by - constructor - · intro eq - have parts := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 eq).2 - exact ⟨parts.1, externalSignCode_injective parts.2⟩ - · rintro ⟨rfl, rfl⟩ - rfl - -theorem externalActorSymbol_ne_letterSymbol (g s : ZFSet.{u}) (b : Bool) : - externalActorSymbol g ≠ externalLetterSymbol s b := by - intro eq - have tags : (0 : Nat) = 1 := natSetCode_injective (ZFSet.pair_inj.1 eq).1 - exact Nat.zero_ne_one tags - -theorem mem_externalGeneratorAlphabet (G S z : ZFSet.{u}) : - z ∈ externalGeneratorAlphabet G S ↔ - (∃ g ∈ G, z = externalActorSymbol g) ∨ - ∃ s ∈ S, ∃ b : Bool, z = externalLetterSymbol s b := by - rw [externalGeneratorAlphabet, ZFSet.mem_union] - constructor - · rintro (old | signed) - · obtain ⟨tag, htag, g, hg, eq⟩ := ZFSet.mem_prod.1 old - have tagEq := ZFSet.mem_singleton.1 htag - subst tag - exact Or.inl ⟨g, hg, eq⟩ - · obtain ⟨tag, htag, p, hp, eq⟩ := ZFSet.mem_prod.1 signed - have tagEq := ZFSet.mem_singleton.1 htag - subst tag - obtain ⟨s, hs, sign, hsign, rfl⟩ := ZFSet.mem_prod.1 hp - obtain ⟨b, rfl⟩ := (mem_natTwo_iff_externalSignCode sign).1 hsign - exact Or.inr ⟨s, hs, b, eq⟩ - · rintro (⟨g, hg, rfl⟩ | ⟨s, hs, b, rfl⟩) - · exact Or.inl (ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hg⟩) - · exact Or.inr (ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, - ZFSet.pair_mem_prod.2 ⟨hs, (mem_natTwo_iff_externalSignCode _).2 ⟨b, rfl⟩⟩⟩) - -theorem externalActorSymbol_mem (G S g : ZFSet.{u}) : - externalActorSymbol g ∈ externalGeneratorAlphabet G S ↔ g ∈ G := by - rw [mem_externalGeneratorAlphabet] - constructor - · rintro (⟨h, hh, eq⟩ | ⟨s, _, b, eq⟩) - · exact externalActorSymbol_injective eq ▸ hh - · exact False.elim (externalActorSymbol_ne_letterSymbol g s b eq) - · intro hg - exact Or.inl ⟨g, hg, rfl⟩ - -theorem externalLetterSymbol_mem (G S s : ZFSet.{u}) (b : Bool) : - externalLetterSymbol s b ∈ externalGeneratorAlphabet G S ↔ s ∈ S := by - rw [mem_externalGeneratorAlphabet] - constructor - · rintro (⟨g, _, eq⟩ | ⟨t, ht, c, eq⟩) - · exact False.elim (externalActorSymbol_ne_letterSymbol g s b eq.symm) - · exact (externalLetterSymbol_inj.1 eq).1 ▸ ht - · intro hs - exact Or.inr ⟨s, hs, b, rfl⟩ - -def externalAlphabetEncode {J L : Type u} (s : Presentation J) (t : Presentation L) : - J ⊕ (L × Bool) → ZFSet.{u} - | .inl g => externalActorSymbol (s.encode g) - | .inr p => externalLetterSymbol (t.encode p.1) p.2 - -theorem externalAlphabetEncode_injective {J L : Type u} (s : Presentation J) (t : Presentation L) : - Function.Injective (externalAlphabetEncode s t) := by - intro x y eq - cases x with - | inl g => - cases y with - | inl h => exact congrArg Sum.inl (s.injective (externalActorSymbol_injective eq)) - | inr p => exact False.elim (externalActorSymbol_ne_letterSymbol _ _ _ eq) - | inr p => - cases y with - | inl g => exact False.elim (externalActorSymbol_ne_letterSymbol _ _ _ eq.symm) - | inr q => - have parts := externalLetterSymbol_inj.1 eq - exact congrArg Sum.inr (Prod.ext (t.injective parts.1) parts.2) - -def externalGeneratorAlphabetPresentation {J L : Type u} (s : Presentation J) (t : Presentation L) : - Presentation (J ⊕ (L × Bool)) where - carrier := externalGeneratorAlphabet s.carrier t.carrier - encode := externalAlphabetEncode s t - injective := externalAlphabetEncode_injective s t - mem_carrier z := by - rw [mem_externalGeneratorAlphabet] - constructor - · rintro (⟨g, hg, eq⟩ | ⟨l, hl, b, eq⟩) - · obtain ⟨j, rfl⟩ := (s.mem_carrier g).1 hg - exact ⟨.inl j, eq.symm⟩ - · obtain ⟨l, rfl⟩ := (t.mem_carrier l).1 hl - exact ⟨.inr (l, b), eq.symm⟩ - · rintro ⟨x, rfl⟩ - cases x with - | inl g => exact Or.inl ⟨s.encode g, s.encode_mem g, rfl⟩ - | inr p => exact Or.inr ⟨t.encode p.1, t.encode_mem p.1, p.2, rfl⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem externalGeneratorAlphabet_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G S : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) : - externalGeneratorAlphabet G S ∈ M.sets := by - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ - have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero - have hTwo : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions hOne hOne - have hTagZero : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hZero hZero - have hTagOne : ({natSetCode 1} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hOne hOne - exact M.binary_union_mem pairing unions - (M.prod_mem pairing unions powers separation hTagZero hG) - (M.prod_mem pairing unions powers separation hTagOne - (M.prod_mem pairing unions powers separation hS hTwo)) - -end TransitiveGround - - - - - - -namespace BoundedFormula - -def finiteWordFormula {n} (omega alphabet graph : Fin n) : BoundedFormula n := - exMem omega (functionFormula 0 alphabet.succ graph.succ) - -theorem truth_finiteWordFormula {n} (omega alphabet graph : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (finiteWordFormula omega alphabet graph) env ↔ - ∃ N ∈ env omega, ZFSet.IsFunc N (env alphabet) (env graph) := by - simp only [finiteWordFormula, truth_exMem, truth_functionFormula] - rfl - -end BoundedFormula - -theorem finiteWord_domain_unique {m n : Nat} {A B f : ZFSet.{u}} - (first : ZFSet.IsFunc (natSetCode m) A f) - (second : ZFSet.IsFunc (natSetCode n) B f) : m = n := by - apply natSetCode_injective - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨y, entry, _⟩ := first.2 x hx - exact (ZFSet.pair_mem_prod.1 (second.1 entry)).1 - · intro hx - obtain ⟨y, entry, _⟩ := second.2 x hx - exact (ZFSet.pair_mem_prod.1 (first.1 entry)).1 - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -noncomputable def finiteWords (A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun f => ∃ n ∈ ZFSet.omega, ZFSet.IsFunc n A f) - (M.groundRelations ZFSet.omega A) - -theorem mem_finiteWords_iff (A f : ZFSet.{u}) : - f ∈ M.finiteWords A ↔ f ∈ M.sets ∧ ∃ n ∈ ZFSet.omega, ZFSet.IsFunc n A f := by - rw [finiteWords, ZFSet.mem_sep, M.mem_groundRelations] - constructor - · exact fun ⟨⟨ground, _⟩, code⟩ => ⟨ground, code⟩ - · rintro ⟨ground, n, hn, function⟩ - refine ⟨⟨ground, ?_⟩, n, hn, function⟩ - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - obtain ⟨j, _, rfl⟩ := (mem_natSetCode x k).1 hx - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega j, hy⟩ - -theorem mem_finiteWords (A f : ZFSet.{u}) : - f ∈ M.finiteWords A ↔ - f ∈ M.sets ∧ ∃ n : Nat, ZFSet.IsFunc (natSetCode n) A f := by - rw [M.mem_finiteWords_iff] - constructor - · rintro ⟨ground, n, hn, function⟩ - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact ⟨ground, k, function⟩ - · rintro ⟨ground, n, function⟩ - exact ⟨ground, natSetCode n, natSetCode_mem_omega n, function⟩ - -theorem finiteWords_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWords A ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - have space := M.groundRelations_mem pairing unions powers separation hOmega hA - let params := extend ZFSet.omega (extend A Fin.elim0) - have selected := M.separation_mem separation - (BoundedFormula.finiteWordFormula 1 2 0).toFormula params - (Fin.cases hOmega (Fin.cases hA (fun j => Fin.elim0 j))) space - have correct (f : ZFSet.{u}) (hf : f ∈ M.sets) : - Realize M.sets (BoundedFormula.finiteWordFormula 1 2 0).toFormula (extend f params) ↔ - ∃ n ∈ ZFSet.omega, ZFSet.IsFunc n A f := - (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hf (Fin.cases hOmega (Fin.cases hA (fun j => Fin.elim0 j))))).trans - (BoundedFormula.truth_finiteWordFormula 1 2 0 _) - have eq : ZFSet.sep (fun f => Realize M.sets - (BoundedFormula.finiteWordFormula 1 2 0).toFormula (extend f params)) - (M.groundRelations ZFSet.omega A) = M.finiteWords A := by - apply ZFSet.ext - intro f - rw [ZFSet.mem_sep, finiteWords, ZFSet.mem_sep] - exact and_congr_right (fun hf => correct f (M.transitive space hf)) - exact eq ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.Compression.RecursiveMaps.RationalHeights.Fraction - -theorem intCode_surjective : Function.Surjective intCode := by - intro n - by_cases even : n % 2 = 0 - · exact ⟨Int.ofNat (n / 2), by simp only [intCode]; omega⟩ - · exact ⟨Int.negSucc (n / 2), by simp only [intCode]; omega⟩ - -end PartitionPilot.Compression.RecursiveMaps.RationalHeights.Fraction - -namespace PartitionPilot.Forcing - -open SetRealization Compression.RecursiveMaps.RationalHeights -universe u - -noncomputable def fractionCarrier : ZFSet.{u} := - ZFSet.prod ZFSet.omega (ZFSet.sep (fun d => d ≠ natSetCode 0) ZFSet.omega) - -def fractionEncode (a : Fraction) : ZFSet.{u} := - ZFSet.pair (natSetCode (Fraction.intCode a.num)) (natSetCode a.den) - -theorem fractionEncode_mem (a : Fraction) : fractionEncode a ∈ fractionCarrier.{u} := by - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, - ZFSet.mem_sep.2 ⟨natSetCode_mem_omega _, fun h => by - have := natSetCode_injective h - have := a.positive - omega⟩⟩ - -theorem fractionEncode_injective : Function.Injective (fractionEncode : Fraction → ZFSet.{u}) := by - intro a b equal - have parts := ZFSet.pair_inj.1 equal - have hn := Fraction.intCode_injective a.num b.num (natSetCode_injective parts.1) - have hd := natSetCode_injective parts.2 - cases a - cases b - cases hn - cases hd - rfl - -theorem mem_fractionCarrier (z : ZFSet.{u}) : - z ∈ fractionCarrier ↔ ∃ a : Fraction, fractionEncode a = z := by - constructor - · intro hz - obtain ⟨n, hn, d, hd, rfl⟩ := ZFSet.mem_prod.1 hz - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨hd, nonzero⟩ := ZFSet.mem_sep.1 hd - obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode d).1 hd - obtain ⟨a, ha⟩ := Fraction.intCode_surjective k - have positive : 0 < m := by - have : m ≠ 0 := fun h => nonzero (congrArg natSetCode h) - omega - exact ⟨⟨a, m, positive⟩, by dsimp only [fractionEncode]; rw [ha]⟩ - · rintro ⟨a, rfl⟩ - exact fractionEncode_mem a - -noncomputable def fractionPresentation : Presentation (ULift.{u} Fraction) where - carrier := fractionCarrier - encode a := fractionEncode a.down - injective := fun _ _ eq => ULift.ext _ _ (fractionEncode_injective eq) - mem_carrier z := (mem_fractionCarrier z).trans - ⟨fun ⟨a, ha⟩ => ⟨⟨a⟩, ha⟩, fun ⟨a, ha⟩ => ⟨a.down, ha⟩⟩ - -noncomputable def fractionEquivGraph : ZFSet.{u} := - ZFSet.sep (fun z => ∃ a b : Fraction, - z = ZFSet.pair (fractionEncode a) (fractionEncode b) ∧ Fraction.Equiv a b) - (ZFSet.prod fractionCarrier fractionCarrier) - -noncomputable def fractionLtGraph : ZFSet.{u} := - ZFSet.sep (fun z => ∃ a b : Fraction, - z = ZFSet.pair (fractionEncode a) (fractionEncode b) ∧ Fraction.Lt a b) - (ZFSet.prod fractionCarrier fractionCarrier) - -theorem fractionEquivGraph_subset : fractionEquivGraph.{u} ⊆ ZFSet.prod fractionCarrier fractionCarrier := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem fractionLtGraph_subset : fractionLtGraph.{u} ⊆ ZFSet.prod fractionCarrier fractionCarrier := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem pair_mem_fractionEquivGraph (a b : Fraction) : - ZFSet.pair (fractionEncode a) (fractionEncode b) ∈ fractionEquivGraph.{u} ↔ Fraction.Equiv a b := by - constructor - · intro h - obtain ⟨c, d, equal, rel⟩ := (ZFSet.mem_sep.1 h).2 - have parts := ZFSet.pair_inj.1 equal - obtain rfl := fractionEncode_injective parts.1 - obtain rfl := fractionEncode_injective parts.2 - exact rel - · intro rel - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨fractionEncode_mem a, fractionEncode_mem b⟩, - a, b, rfl, rel⟩ - -theorem pair_mem_fractionLtGraph (a b : Fraction) : - ZFSet.pair (fractionEncode a) (fractionEncode b) ∈ fractionLtGraph.{u} ↔ Fraction.Lt a b := by - constructor - · intro h - obtain ⟨c, d, equal, rel⟩ := (ZFSet.mem_sep.1 h).2 - have parts := ZFSet.pair_inj.1 equal - obtain rfl := fractionEncode_injective parts.1 - obtain rfl := fractionEncode_injective parts.2 - exact rel - · intro rel - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨fractionEncode_mem a, fractionEncode_mem b⟩, - a, b, rfl, rel⟩ - -end PartitionPilot.Forcing - -end - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -def taggedSumCarrier (A B : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod {natSetCode 0} A ∪ ZFSet.prod {natSetCode 1} B - -theorem mem_taggedSumCarrier (A B z : ZFSet.{u}) : - z ∈ taggedSumCarrier A B ↔ - (∃ a ∈ A, z = ZFSet.pair (natSetCode 0) a) ∨ ∃ b ∈ B, z = ZFSet.pair (natSetCode 1) b := by - simp only [taggedSumCarrier, ZFSet.mem_union, ZFSet.mem_prod, ZFSet.mem_singleton] - constructor - · rintro (⟨_, rfl, a, ha, equal⟩ | ⟨_, rfl, b, hb, equal⟩) - · exact Or.inl ⟨a, ha, equal⟩ - · exact Or.inr ⟨b, hb, equal⟩ - · rintro (⟨a, ha, equal⟩ | ⟨b, hb, equal⟩) - · exact Or.inl ⟨_, rfl, a, ha, equal⟩ - · exact Or.inr ⟨_, rfl, b, hb, equal⟩ - -def taggedSumEncode {A B : Type u} (s : Presentation A) (t : Presentation B) : A ⊕ B → ZFSet.{u} - | .inl a => ZFSet.pair (natSetCode 0) (s.encode a) - | .inr b => ZFSet.pair (natSetCode 1) (t.encode b) - -theorem taggedSumEncode_injective {A B : Type u} (s : Presentation A) (t : Presentation B) : - Function.Injective (taggedSumEncode s t) := by - intro x y equal - cases x <;> cases y - · exact congrArg Sum.inl (s.injective (ZFSet.pair_inj.1 equal).2) - · exact False.elim (Nat.zero_ne_one (natSetCode_injective (ZFSet.pair_inj.1 equal).1)) - · exact False.elim (Nat.zero_ne_one (natSetCode_injective (ZFSet.pair_inj.1 equal).1.symm)) - · exact congrArg Sum.inr (t.injective (ZFSet.pair_inj.1 equal).2) - -def taggedSumPresentation {A B : Type u} (s : Presentation A) (t : Presentation B) : Presentation (A ⊕ B) where - carrier := taggedSumCarrier s.carrier t.carrier - encode := taggedSumEncode s t - injective := taggedSumEncode_injective s t - mem_carrier z := by - rw [mem_taggedSumCarrier] - constructor - · rintro (⟨a, ha, equal⟩ | ⟨b, hb, equal⟩) - · obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha - exact ⟨.inl a, equal.symm⟩ - · obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb - exact ⟨.inr b, equal.symm⟩ - · rintro ⟨a | b, rfl⟩ - · exact Or.inl ⟨s.encode a, s.encode_mem a, rfl⟩ - · exact Or.inr ⟨t.encode b, t.encode_mem b, rfl⟩ - -def externalSignPresentation : Presentation (ULift.{u} Bool) where - carrier := natSetCode 2 - encode b := externalSignCode b.down - injective := fun a b equal => ULift.ext _ _ (externalSignCode_injective equal) - mem_carrier z := by - rw [mem_natTwo_iff_externalSignCode] - constructor - · rintro ⟨b, equal⟩ - exact ⟨ULift.up b, equal.symm⟩ - · rintro ⟨b, equal⟩ - exact ⟨b.down, equal.symm⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem taggedSumCarrier_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : taggedSumCarrier A B ∈ M.sets := by - have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨A, hA⟩ - have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero - have tag0 : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing zero zero - have tag1 : ({natSetCode 1} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing one one - exact M.binary_union_mem pairing unions (M.prod_mem pairing unions powers separation tag0 hA) - (M.prod_mem pairing unions powers separation tag1 hB) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundSuccessorInjections + +namespace OAI + + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +theorem natSetCode_injective : Function.Injective (natSetCode : Nat → ZFSet.{u}) := by + intro m n eq + induction m generalizing n with + | zero => + cases n with + | zero => rfl + | succ n => exact False.elim (setSuccessor_ne_empty (natSetCode n) eq.symm) + | succ m ih => + cases n with + | zero => exact False.elim (setSuccessor_ne_empty (natSetCode m) eq) + | succ n => exact congrArg Nat.succ (ih (setSuccessor_injective eq)) + +theorem natSetCode_mem_iff (m n : Nat) : natSetCode m ∈ natSetCode n ↔ m < n := by + induction n with + | zero => + exact ⟨fun h => False.elim (ZFSet.notMem_empty _ h), fun h => False.elim (Nat.not_lt_zero m h)⟩ + | succ n ih => + rw [natSetCode_succ, ZFSet.mem_insert_iff, natSetCode_injective.eq_iff, ih] + omega + +theorem mem_natSetCode (x : ZFSet.{u}) (n : Nat) : + x ∈ natSetCode n ↔ ∃ m < n, x = natSetCode m := by + constructor + · intro hx + have natural := naturalSetProperty_member ((naturalSetProperty_iff (natSetCode n)).2 ⟨n, rfl⟩) hx + obtain ⟨m, eq⟩ := (naturalSetProperty_iff x).1 natural + exact ⟨m, (natSetCode_mem_iff m n).1 (eq ▸ hx), eq⟩ + · rintro ⟨m, hm, rfl⟩ + exact (natSetCode_mem_iff m n).2 hm + +def natPresentation : Presentation (ULift.{u} Nat) where + carrier := ZFSet.omega + encode n := natSetCode n.down + injective := fun _ _ eq => ULift.ext _ _ (natSetCode_injective eq) + mem_carrier x := by + rw [mem_omega_iff_natSetCode] + exact ⟨fun ⟨n, eq⟩ => ⟨⟨n⟩, eq.symm⟩, fun ⟨n, eq⟩ => ⟨n.down, eq.symm⟩⟩ + +def natInitialPresentation (n : Nat) : Presentation (ULift.{u} (Fin n)) where + carrier := natSetCode n + encode i := natSetCode i.down.val + injective := fun _ _ eq => ULift.ext _ _ (Fin.ext (natSetCode_injective eq)) + mem_carrier x := by + rw [mem_natSetCode] + exact ⟨fun ⟨m, hm, eq⟩ => ⟨⟨⟨m, hm⟩⟩, eq.symm⟩, + fun ⟨m, eq⟩ => ⟨m.down.val, m.down.isLt, eq.symm⟩⟩ + +theorem natSetCode_finite (n : Nat) : (natSetCode n : ZFSet.{u}).toSet.Finite := by + have eq : (natSetCode n : ZFSet.{u}).toSet = Set.range (fun i : Fin n => natSetCode i.val) := by + apply Set.ext + intro x + change x ∈ natSetCode n ↔ _ + rw [mem_natSetCode] + exact ⟨fun ⟨m, hm, eq⟩ => ⟨⟨m, hm⟩, eq.symm⟩, fun ⟨m, eq⟩ => ⟨m.val, m.isLt, eq.symm⟩⟩ + rw [eq] + simpa only [Set.image_univ] using Set.finite_univ.image (fun i : Fin n => (natSetCode i.val : ZFSet.{u})) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +def externalSignCode (b : Bool) : ZFSet.{u} := natSetCode (if b then 1 else 0) + +theorem externalSignCode_injective : Function.Injective (externalSignCode : Bool → ZFSet.{u}) := by + intro a b eq + cases a <;> cases b <;> simp only [externalSignCode, Bool.false_eq_true, ite_false, ite_true, + natSetCode_injective.eq_iff] at eq ⊢ + · exact False.elim (Nat.zero_ne_one eq) + · exact False.elim (Nat.zero_ne_one eq.symm) + +theorem mem_natTwo_iff_externalSignCode (x : ZFSet.{u}) : + x ∈ natSetCode 2 ↔ ∃ b : Bool, x = externalSignCode b := by + constructor + · intro hx + obtain ⟨n, hn, rfl⟩ := (mem_natSetCode x 2).1 hx + have cases : n = 0 ∨ n = 1 := by omega + rcases cases with rfl | rfl + · exact ⟨false, rfl⟩ + · exact ⟨true, rfl⟩ + · rintro ⟨b, rfl⟩ + cases b <;> exact (natSetCode_mem_iff _ 2).2 (by decide) + +def externalActorSymbol (g : ZFSet.{u}) : ZFSet.{u} := ZFSet.pair (natSetCode 0) g + +def externalLetterSymbol (s : ZFSet.{u}) (b : Bool) : ZFSet.{u} := + ZFSet.pair (natSetCode 1) (ZFSet.pair s (externalSignCode b)) + +def externalGeneratorAlphabet (G S : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod {natSetCode 0} G ∪ ZFSet.prod {natSetCode 1} (ZFSet.prod S (natSetCode 2)) + +theorem externalActorSymbol_injective : Function.Injective (externalActorSymbol : ZFSet.{u} → ZFSet.{u}) := + fun _ _ eq => (ZFSet.pair_inj.1 eq).2 + +theorem externalLetterSymbol_inj {s t : ZFSet.{u}} {b c : Bool} : + externalLetterSymbol s b = externalLetterSymbol t c ↔ s = t ∧ b = c := by + constructor + · intro eq + have parts := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 eq).2 + exact ⟨parts.1, externalSignCode_injective parts.2⟩ + · rintro ⟨rfl, rfl⟩ + rfl + +theorem externalActorSymbol_ne_letterSymbol (g s : ZFSet.{u}) (b : Bool) : + externalActorSymbol g ≠ externalLetterSymbol s b := by + intro eq + have tags : (0 : Nat) = 1 := natSetCode_injective (ZFSet.pair_inj.1 eq).1 + exact Nat.zero_ne_one tags + +theorem mem_externalGeneratorAlphabet (G S z : ZFSet.{u}) : + z ∈ externalGeneratorAlphabet G S ↔ + (∃ g ∈ G, z = externalActorSymbol g) ∨ + ∃ s ∈ S, ∃ b : Bool, z = externalLetterSymbol s b := by + rw [externalGeneratorAlphabet, ZFSet.mem_union] + constructor + · rintro (old | signed) + · obtain ⟨tag, htag, g, hg, eq⟩ := ZFSet.mem_prod.1 old + have tagEq := ZFSet.mem_singleton.1 htag + subst tag + exact Or.inl ⟨g, hg, eq⟩ + · obtain ⟨tag, htag, p, hp, eq⟩ := ZFSet.mem_prod.1 signed + have tagEq := ZFSet.mem_singleton.1 htag + subst tag + obtain ⟨s, hs, sign, hsign, rfl⟩ := ZFSet.mem_prod.1 hp + obtain ⟨b, rfl⟩ := (mem_natTwo_iff_externalSignCode sign).1 hsign + exact Or.inr ⟨s, hs, b, eq⟩ + · rintro (⟨g, hg, rfl⟩ | ⟨s, hs, b, rfl⟩) + · exact Or.inl (ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hg⟩) + · exact Or.inr (ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, + ZFSet.pair_mem_prod.2 ⟨hs, (mem_natTwo_iff_externalSignCode _).2 ⟨b, rfl⟩⟩⟩) + +theorem externalActorSymbol_mem (G S g : ZFSet.{u}) : + externalActorSymbol g ∈ externalGeneratorAlphabet G S ↔ g ∈ G := by + rw [mem_externalGeneratorAlphabet] + constructor + · rintro (⟨h, hh, eq⟩ | ⟨s, _, b, eq⟩) + · exact externalActorSymbol_injective eq ▸ hh + · exact False.elim (externalActorSymbol_ne_letterSymbol g s b eq) + · intro hg + exact Or.inl ⟨g, hg, rfl⟩ + +theorem externalLetterSymbol_mem (G S s : ZFSet.{u}) (b : Bool) : + externalLetterSymbol s b ∈ externalGeneratorAlphabet G S ↔ s ∈ S := by + rw [mem_externalGeneratorAlphabet] + constructor + · rintro (⟨g, _, eq⟩ | ⟨t, ht, c, eq⟩) + · exact False.elim (externalActorSymbol_ne_letterSymbol g s b eq.symm) + · exact (externalLetterSymbol_inj.1 eq).1 ▸ ht + · intro hs + exact Or.inr ⟨s, hs, b, rfl⟩ + +def externalAlphabetEncode {J L : Type u} (s : Presentation J) (t : Presentation L) : + J ⊕ (L × Bool) → ZFSet.{u} + | .inl g => externalActorSymbol (s.encode g) + | .inr p => externalLetterSymbol (t.encode p.1) p.2 + +theorem externalAlphabetEncode_injective {J L : Type u} (s : Presentation J) (t : Presentation L) : + Function.Injective (externalAlphabetEncode s t) := by + intro x y eq + cases x with + | inl g => + cases y with + | inl h => exact congrArg Sum.inl (s.injective (externalActorSymbol_injective eq)) + | inr p => exact False.elim (externalActorSymbol_ne_letterSymbol _ _ _ eq) + | inr p => + cases y with + | inl g => exact False.elim (externalActorSymbol_ne_letterSymbol _ _ _ eq.symm) + | inr q => + have parts := externalLetterSymbol_inj.1 eq + exact congrArg Sum.inr (Prod.ext (t.injective parts.1) parts.2) + +def externalGeneratorAlphabetPresentation {J L : Type u} (s : Presentation J) (t : Presentation L) : + Presentation (J ⊕ (L × Bool)) where + carrier := externalGeneratorAlphabet s.carrier t.carrier + encode := externalAlphabetEncode s t + injective := externalAlphabetEncode_injective s t + mem_carrier z := by + rw [mem_externalGeneratorAlphabet] + constructor + · rintro (⟨g, hg, eq⟩ | ⟨l, hl, b, eq⟩) + · obtain ⟨j, rfl⟩ := (s.mem_carrier g).1 hg + exact ⟨.inl j, eq.symm⟩ + · obtain ⟨l, rfl⟩ := (t.mem_carrier l).1 hl + exact ⟨.inr (l, b), eq.symm⟩ + · rintro ⟨x, rfl⟩ + cases x with + | inl g => exact Or.inl ⟨s.encode g, s.encode_mem g, rfl⟩ + | inr p => exact Or.inr ⟨t.encode p.1, t.encode_mem p.1, p.2, rfl⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem externalGeneratorAlphabet_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G S : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) : + externalGeneratorAlphabet G S ∈ M.sets := by + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ + have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero + have hTwo : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions hOne hOne + have hTagZero : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hZero hZero + have hTagOne : ({natSetCode 1} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hOne hOne + exact M.binary_union_mem pairing unions + (M.prod_mem pairing unions powers separation hTagZero hG) + (M.prod_mem pairing unions powers separation hTagOne + (M.prod_mem pairing unions powers separation hS hTwo)) + +end TransitiveGround + + + + + + +namespace BoundedFormula + +def finiteWordFormula {n} (omega alphabet graph : Fin n) : BoundedFormula n := + exMem omega (functionFormula 0 alphabet.succ graph.succ) + +theorem truth_finiteWordFormula {n} (omega alphabet graph : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (finiteWordFormula omega alphabet graph) env ↔ + ∃ N ∈ env omega, ZFSet.IsFunc N (env alphabet) (env graph) := by + simp only [finiteWordFormula, truth_exMem, truth_functionFormula] + rfl + +end BoundedFormula + +theorem finiteWord_domain_unique {m n : Nat} {A B f : ZFSet.{u}} + (first : ZFSet.IsFunc (natSetCode m) A f) + (second : ZFSet.IsFunc (natSetCode n) B f) : m = n := by + apply natSetCode_injective + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨y, entry, _⟩ := first.2 x hx + exact (ZFSet.pair_mem_prod.1 (second.1 entry)).1 + · intro hx + obtain ⟨y, entry, _⟩ := second.2 x hx + exact (ZFSet.pair_mem_prod.1 (first.1 entry)).1 + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +noncomputable def finiteWords (A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun f => ∃ n ∈ ZFSet.omega, ZFSet.IsFunc n A f) + (M.groundRelations ZFSet.omega A) + +theorem mem_finiteWords_iff (A f : ZFSet.{u}) : + f ∈ M.finiteWords A ↔ f ∈ M.sets ∧ ∃ n ∈ ZFSet.omega, ZFSet.IsFunc n A f := by + rw [finiteWords, ZFSet.mem_sep, M.mem_groundRelations] + constructor + · exact fun ⟨⟨ground, _⟩, code⟩ => ⟨ground, code⟩ + · rintro ⟨ground, n, hn, function⟩ + refine ⟨⟨ground, ?_⟩, n, hn, function⟩ + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + obtain ⟨j, _, rfl⟩ := (mem_natSetCode x k).1 hx + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega j, hy⟩ + +theorem mem_finiteWords (A f : ZFSet.{u}) : + f ∈ M.finiteWords A ↔ + f ∈ M.sets ∧ ∃ n : Nat, ZFSet.IsFunc (natSetCode n) A f := by + rw [M.mem_finiteWords_iff] + constructor + · rintro ⟨ground, n, hn, function⟩ + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact ⟨ground, k, function⟩ + · rintro ⟨ground, n, function⟩ + exact ⟨ground, natSetCode n, natSetCode_mem_omega n, function⟩ + +theorem finiteWords_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWords A ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + have space := M.groundRelations_mem pairing unions powers separation hOmega hA + let params := extend ZFSet.omega (extend A Fin.elim0) + have selected := M.separation_mem separation + (BoundedFormula.finiteWordFormula 1 2 0).toFormula params + (Fin.cases hOmega (Fin.cases hA (fun j => Fin.elim0 j))) space + have correct (f : ZFSet.{u}) (hf : f ∈ M.sets) : + Realize M.sets (BoundedFormula.finiteWordFormula 1 2 0).toFormula (extend f params) ↔ + ∃ n ∈ ZFSet.omega, ZFSet.IsFunc n A f := + (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hf (Fin.cases hOmega (Fin.cases hA (fun j => Fin.elim0 j))))).trans + (BoundedFormula.truth_finiteWordFormula 1 2 0 _) + have eq : ZFSet.sep (fun f => Realize M.sets + (BoundedFormula.finiteWordFormula 1 2 0).toFormula (extend f params)) + (M.groundRelations ZFSet.omega A) = M.finiteWords A := by + apply ZFSet.ext + intro f + rw [ZFSet.mem_sep, finiteWords, ZFSet.mem_sep] + exact and_congr_right (fun hf => correct f (M.transitive space hf)) + exact eq ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.Compression.RecursiveMaps.RationalHeights.Fraction + +theorem intCode_surjective : Function.Surjective intCode := by + intro n + by_cases even : n % 2 = 0 + · exact ⟨Int.ofNat (n / 2), by simp only [intCode]; omega⟩ + · exact ⟨Int.negSucc (n / 2), by simp only [intCode]; omega⟩ + +end PartitionPilot.Compression.RecursiveMaps.RationalHeights.Fraction + +namespace PartitionPilot.Forcing + +open SetRealization Compression.RecursiveMaps.RationalHeights +universe u + +noncomputable def fractionCarrier : ZFSet.{u} := + ZFSet.prod ZFSet.omega (ZFSet.sep (fun d => d ≠ natSetCode 0) ZFSet.omega) + +def fractionEncode (a : Fraction) : ZFSet.{u} := + ZFSet.pair (natSetCode (Fraction.intCode a.num)) (natSetCode a.den) + +theorem fractionEncode_mem (a : Fraction) : fractionEncode a ∈ fractionCarrier.{u} := by + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, + ZFSet.mem_sep.2 ⟨natSetCode_mem_omega _, fun h => by + have := natSetCode_injective h + have := a.positive + omega⟩⟩ + +theorem fractionEncode_injective : Function.Injective (fractionEncode : Fraction → ZFSet.{u}) := by + intro a b equal + have parts := ZFSet.pair_inj.1 equal + have hn := Fraction.intCode_injective a.num b.num (natSetCode_injective parts.1) + have hd := natSetCode_injective parts.2 + cases a + cases b + cases hn + cases hd + rfl + +theorem mem_fractionCarrier (z : ZFSet.{u}) : + z ∈ fractionCarrier ↔ ∃ a : Fraction, fractionEncode a = z := by + constructor + · intro hz + obtain ⟨n, hn, d, hd, rfl⟩ := ZFSet.mem_prod.1 hz + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨hd, nonzero⟩ := ZFSet.mem_sep.1 hd + obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode d).1 hd + obtain ⟨a, ha⟩ := Fraction.intCode_surjective k + have positive : 0 < m := by + have : m ≠ 0 := fun h => nonzero (congrArg natSetCode h) + omega + exact ⟨⟨a, m, positive⟩, by dsimp only [fractionEncode]; rw [ha]⟩ + · rintro ⟨a, rfl⟩ + exact fractionEncode_mem a + +noncomputable def fractionPresentation : Presentation (ULift.{u} Fraction) where + carrier := fractionCarrier + encode a := fractionEncode a.down + injective := fun _ _ eq => ULift.ext _ _ (fractionEncode_injective eq) + mem_carrier z := (mem_fractionCarrier z).trans + ⟨fun ⟨a, ha⟩ => ⟨⟨a⟩, ha⟩, fun ⟨a, ha⟩ => ⟨a.down, ha⟩⟩ + +noncomputable def fractionEquivGraph : ZFSet.{u} := + ZFSet.sep (fun z => ∃ a b : Fraction, + z = ZFSet.pair (fractionEncode a) (fractionEncode b) ∧ Fraction.Equiv a b) + (ZFSet.prod fractionCarrier fractionCarrier) + +noncomputable def fractionLtGraph : ZFSet.{u} := + ZFSet.sep (fun z => ∃ a b : Fraction, + z = ZFSet.pair (fractionEncode a) (fractionEncode b) ∧ Fraction.Lt a b) + (ZFSet.prod fractionCarrier fractionCarrier) + +theorem fractionEquivGraph_subset : fractionEquivGraph.{u} ⊆ ZFSet.prod fractionCarrier fractionCarrier := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem fractionLtGraph_subset : fractionLtGraph.{u} ⊆ ZFSet.prod fractionCarrier fractionCarrier := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem pair_mem_fractionEquivGraph (a b : Fraction) : + ZFSet.pair (fractionEncode a) (fractionEncode b) ∈ fractionEquivGraph.{u} ↔ Fraction.Equiv a b := by + constructor + · intro h + obtain ⟨c, d, equal, rel⟩ := (ZFSet.mem_sep.1 h).2 + have parts := ZFSet.pair_inj.1 equal + obtain rfl := fractionEncode_injective parts.1 + obtain rfl := fractionEncode_injective parts.2 + exact rel + · intro rel + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨fractionEncode_mem a, fractionEncode_mem b⟩, + a, b, rfl, rel⟩ + +theorem pair_mem_fractionLtGraph (a b : Fraction) : + ZFSet.pair (fractionEncode a) (fractionEncode b) ∈ fractionLtGraph.{u} ↔ Fraction.Lt a b := by + constructor + · intro h + obtain ⟨c, d, equal, rel⟩ := (ZFSet.mem_sep.1 h).2 + have parts := ZFSet.pair_inj.1 equal + obtain rfl := fractionEncode_injective parts.1 + obtain rfl := fractionEncode_injective parts.2 + exact rel + · intro rel + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨fractionEncode_mem a, fractionEncode_mem b⟩, + a, b, rfl, rel⟩ + +end PartitionPilot.Forcing + +end + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +def taggedSumCarrier (A B : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod {natSetCode 0} A ∪ ZFSet.prod {natSetCode 1} B + +theorem mem_taggedSumCarrier (A B z : ZFSet.{u}) : + z ∈ taggedSumCarrier A B ↔ + (∃ a ∈ A, z = ZFSet.pair (natSetCode 0) a) ∨ ∃ b ∈ B, z = ZFSet.pair (natSetCode 1) b := by + simp only [taggedSumCarrier, ZFSet.mem_union, ZFSet.mem_prod, ZFSet.mem_singleton] + constructor + · rintro (⟨_, rfl, a, ha, equal⟩ | ⟨_, rfl, b, hb, equal⟩) + · exact Or.inl ⟨a, ha, equal⟩ + · exact Or.inr ⟨b, hb, equal⟩ + · rintro (⟨a, ha, equal⟩ | ⟨b, hb, equal⟩) + · exact Or.inl ⟨_, rfl, a, ha, equal⟩ + · exact Or.inr ⟨_, rfl, b, hb, equal⟩ + +def taggedSumEncode {A B : Type u} (s : Presentation A) (t : Presentation B) : A ⊕ B → ZFSet.{u} + | .inl a => ZFSet.pair (natSetCode 0) (s.encode a) + | .inr b => ZFSet.pair (natSetCode 1) (t.encode b) + +theorem taggedSumEncode_injective {A B : Type u} (s : Presentation A) (t : Presentation B) : + Function.Injective (taggedSumEncode s t) := by + intro x y equal + cases x <;> cases y + · exact congrArg Sum.inl (s.injective (ZFSet.pair_inj.1 equal).2) + · exact False.elim (Nat.zero_ne_one (natSetCode_injective (ZFSet.pair_inj.1 equal).1)) + · exact False.elim (Nat.zero_ne_one (natSetCode_injective (ZFSet.pair_inj.1 equal).1.symm)) + · exact congrArg Sum.inr (t.injective (ZFSet.pair_inj.1 equal).2) + +def taggedSumPresentation {A B : Type u} (s : Presentation A) (t : Presentation B) : Presentation (A ⊕ B) where + carrier := taggedSumCarrier s.carrier t.carrier + encode := taggedSumEncode s t + injective := taggedSumEncode_injective s t + mem_carrier z := by + rw [mem_taggedSumCarrier] + constructor + · rintro (⟨a, ha, equal⟩ | ⟨b, hb, equal⟩) + · obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha + exact ⟨.inl a, equal.symm⟩ + · obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb + exact ⟨.inr b, equal.symm⟩ + · rintro ⟨a | b, rfl⟩ + · exact Or.inl ⟨s.encode a, s.encode_mem a, rfl⟩ + · exact Or.inr ⟨t.encode b, t.encode_mem b, rfl⟩ + +def externalSignPresentation : Presentation (ULift.{u} Bool) where + carrier := natSetCode 2 + encode b := externalSignCode b.down + injective := fun a b equal => ULift.ext _ _ (externalSignCode_injective equal) + mem_carrier z := by + rw [mem_natTwo_iff_externalSignCode] + constructor + · rintro ⟨b, equal⟩ + exact ⟨ULift.up b, equal.symm⟩ + · rintro ⟨b, equal⟩ + exact ⟨b.down, equal.symm⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem taggedSumCarrier_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : taggedSumCarrier A B ∈ M.sets := by + have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨A, hA⟩ + have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero + have tag0 : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing zero zero + have tag1 : ({natSetCode 1} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing one one + exact M.binary_union_mem pairing unions (M.prod_mem pairing unions powers separation tag0 hA) + (M.prod_mem pairing unions powers separation tag1 hB) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskCapFamilyCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskCapFamilyCodes.lean index c125a67b0da5ce348eba2d122ce4c98e1b57b178..2bcdbfc4abef32016c199b83f4d7d40458109efc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskCapFamilyCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskCapFamilyCodes.lean @@ -1,261 +1,261 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions - -namespace OAI - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def codedInsertionProfileFormula {n} (L r μ c E K F : Fin n) : BoundedFormula n := - .allMem L (imp (pairMembershipFormula E.succ 0 r.succ) - (.conj - (imp (.exMem F.succ (pairMembershipFormula 0 1 r.succ.succ)) - (pairMembershipFormula K.succ 0 r.succ)) - (imp (.neg (.exMem F.succ (pairMembershipFormula 0 1 r.succ.succ))) - (tripleMembershipFormula K.succ 0 c.succ μ.succ)))) - -theorem truth_codedInsertionProfileFormula {n} (L r μ c E K F : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (codedInsertionProfileFormula L r μ c E K F) env ↔ - CodedInsertionProfile (env L) (env r) (env μ) (env c) (env E) (env K) (env F) := by - simp only [codedInsertionProfileFormula, Truth, truth_imp, truth_exMem, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -def codedCapProfileFormula {n} (L r μ c E K F : Fin n) : BoundedFormula n := - .conj (.mem c L) (.conj (.mem E L) (.conj (.mem K L) - (.conj (subsetFormula F L) (.conj (.exMem F (.equal 0 0)) - (.conj (codedInsertionProfileFormula L r μ c E K F) - (.conj (pairMembershipFormula c K r) - (.conj (.neg (pairMembershipFormula K c r)) (.neg (pairMembershipFormula E K r))))))))) - -theorem truth_codedCapProfileFormula {n} (L r μ c E K F : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (codedCapProfileFormula L r μ c E K F) env ↔ - CodedCapProfile (env L) (env r) (env μ) (env c) (env E) (env K) (env F) := by - simp only [codedCapProfileFormula, Truth, truth_subsetFormula, truth_exMem, - truth_codedInsertionProfileFormula, truth_pairMembershipFormula, and_true] - constructor - · rintro ⟨hc, hE, hK, subset, nonempty, profile, lower, strict, separated⟩ - exact ⟨hc, hE, hK, subset, nonempty, profile, lower, strict, separated⟩ - · intro code - exact ⟨code.target_mem, code.separator_mem, code.cap_mem, code.filter_subset, - code.nonempty, code.profile, code.target_below_cap, code.cap_not_below_target, - code.separator_not_below_cap⟩ - -def imageProfilePositiveFormula {n} (F Q e R x : Fin n) : BoundedFormula n := - .exMem Q (.conj (.exMem F.succ (pairMembershipFormula 0 1 e.succ.succ)) - (pairMembershipFormula 0 x.succ R.succ)) - -theorem truth_imageProfilePositiveFormula {n} (F Q e R x : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (imageProfilePositiveFormula F Q e R x) env ↔ - ∃ f ∈ relationImage (env F) (env Q) (env e), ZFSet.pair f (env x) ∈ env R := by - simp only [imageProfilePositiveFormula, truth_exMem, Truth, truth_pairMembershipFormula] - constructor - · rintro ⟨y, hy, ⟨f, hf, entry⟩, lower⟩ - exact ⟨y, (mem_relationImage _ _ _ _).2 ⟨hy, f, hf, entry⟩, lower⟩ - · rintro ⟨y, hy, lower⟩ - obtain ⟨hy, f, hf, entry⟩ := (mem_relationImage _ _ _ _).1 hy - exact ⟨y, hy, ⟨f, hf, entry⟩, lower⟩ - -def imageInsertionProfileFormula {n} (Q R ν c E K F e : Fin n) : BoundedFormula n := - .allMem Q (imp (pairMembershipFormula E.succ 0 R.succ) - (.conj - (imp (imageProfilePositiveFormula F.succ Q.succ e.succ R.succ 0) - (pairMembershipFormula K.succ 0 R.succ)) - (imp (.neg (imageProfilePositiveFormula F.succ Q.succ e.succ R.succ 0)) - (tripleMembershipFormula K.succ 0 c.succ ν.succ)))) - -theorem truth_imageInsertionProfileFormula {n} (Q R ν c E K F e : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (imageInsertionProfileFormula Q R ν c E K F e) env ↔ - CodedInsertionProfile (env Q) (env R) (env ν) (env c) (env E) (env K) - (relationImage (env F) (env Q) (env e)) := by - simp only [imageInsertionProfileFormula, Truth, truth_imp, truth_imageProfilePositiveFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -def imageCapProfileFormula {n} (Q R ν c E K F e : Fin n) : BoundedFormula n := - .conj (.mem c Q) (.conj (.mem E Q) (.conj (.mem K Q) - (.conj (.exMem Q (.exMem F.succ (pairMembershipFormula 0 1 e.succ.succ))) - (.conj (imageInsertionProfileFormula Q R ν c E K F e) - (.conj (pairMembershipFormula c K R) - (.conj (.neg (pairMembershipFormula K c R)) (.neg (pairMembershipFormula E K R)))))))) - -theorem truth_imageCapProfileFormula {n} (Q R ν c E K F e : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (imageCapProfileFormula Q R ν c E K F e) env ↔ - CodedCapProfile (env Q) (env R) (env ν) (env c) (env E) (env K) - (relationImage (env F) (env Q) (env e)) := by - simp only [imageCapProfileFormula, Truth, truth_exMem, truth_pairMembershipFormula, - truth_imageInsertionProfileFormula] - constructor - · rintro ⟨hc, hE, hK, ⟨y, hy, f, hf, entry⟩, profile, lower, strict, separated⟩ - exact ⟨hc, hE, hK, fun _ h => ((mem_relationImage _ _ _ _).1 h).1, - ⟨y, (mem_relationImage _ _ _ _).2 ⟨hy, f, hf, entry⟩⟩, - profile, lower, strict, separated⟩ - · intro code - obtain ⟨y, hy⟩ := code.nonempty - obtain ⟨hy, f, hf, entry⟩ := (mem_relationImage _ _ _ _).1 hy - exact ⟨code.target_mem, code.separator_mem, code.cap_mem, ⟨y, hy, f, hf, entry⟩, - code.profile, code.target_below_cap, code.cap_not_below_target, - code.separator_not_below_cap⟩ - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing -universe u - -def OldProfilePreservationCode (P r μ Q R ν e Filters : ZFSet.{u}) : Prop := - ∀ F ∈ Filters, ∀ c ∈ P, ∀ E ∈ P, ∀ K ∈ P, - CodedCapProfile P r μ c E K F → - ∀ c' ∈ Q, ∀ E' ∈ Q, ∀ K' ∈ Q, - ZFSet.pair c c' ∈ e → ZFSet.pair E E' ∈ e → ZFSet.pair K K' ∈ e → - CodedCapProfile Q R ν c' E' K' (relationImage F Q e) - -namespace BoundedFormula -open SetFormula - -def oldProfilePreservationFormula {n} (P r μ Q R ν e Filters : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ.succ - .allMem Filters (.allMem P.succ (.allMem P.succ.succ (.allMem P.succ.succ.succ - (imp (codedCapProfileFormula P.succ.succ.succ.succ r.succ.succ.succ.succ - μ.succ.succ.succ.succ 2 1 0 3) - (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ - (.allMem Q.succ.succ.succ.succ.succ.succ - (imp (pairMembershipFormula 5 2 (lift e)) - (imp (pairMembershipFormula 4 1 (lift e)) - (imp (pairMembershipFormula 3 0 (lift e)) - (imageCapProfileFormula (lift Q) (lift R) (lift ν) 2 1 0 6 (lift e)))))))))))) - -theorem truth_oldProfilePreservationFormula {n} (P r μ Q R ν e Filters : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (oldProfilePreservationFormula P r μ Q R ν e Filters) env ↔ - OldProfilePreservationCode (env P) (env r) (env μ) (env Q) (env R) (env ν) - (env e) (env Filters) := by - simp only [oldProfilePreservationFormula, Truth, truth_imp, truth_codedCapProfileFormula, - truth_imageCapProfileFormula, truth_pairMembershipFormula] - rfl - -theorem realize_oldProfilePreservationFormula (M : TransitiveGround.{u}) {n} - (P r μ Q R ν e Filters : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (oldProfilePreservationFormula P r μ Q R ν e Filters).toFormula env ↔ - OldProfilePreservationCode (env P) (env r) (env μ) (env Q) (env R) (env ν) - (env e) (env Filters) := - (realize_toFormula M _ env members).trans - (truth_oldProfilePreservationFormula P r μ Q R ν e Filters env) - -end BoundedFormula - -theorem oldProfilePreservation_groundPower_iff (M : TransitiveGround.{u}) - (P r μ Q R ν e : ZFSet.{u}) : - OldProfilePreservationCode P r μ Q R ν e (M.groundPower P) ↔ - ∀ F ∈ M.sets, ∀ c E K, - CodedCapProfile P r μ c E K F → - ∀ c' E' K', ZFSet.pair c c' ∈ e → ZFSet.pair E E' ∈ e → ZFSet.pair K K' ∈ e → - c' ∈ Q → E' ∈ Q → K' ∈ Q → - CodedCapProfile Q R ν c' E' K' (relationImage F Q e) := by - constructor - · intro code F hF c E K profile c' E' K' first second third hc' hE' hK' - exact code F ((M.mem_groundPower P F).2 ⟨hF, profile.filter_subset⟩) - c profile.target_mem E profile.separator_mem K profile.cap_mem profile - c' hc' E' hE' K' hK' first second third - · intro code F hF c _ E _ K _ profile c' hc' E' hE' K' hK' first second third - exact code F ((M.mem_groundPower P F).1 hF).1 c E K profile - c' E' K' first second third hc' hE' hK' - -def TaskCapProfilesCode (I P Q R ν e Targets Separators Filters Families Caps : ZFSet.{u}) : Prop := - ∀ i ∈ I, ∀ c ∈ P, ∀ v ∈ P, ∀ F ∈ Families, - ∀ K ∈ Q, ∀ c' ∈ Q, ∀ v' ∈ Q, - ZFSet.pair i c ∈ Targets → ZFSet.pair i v ∈ Separators → ZFSet.pair i F ∈ Filters → - ZFSet.pair i K ∈ Caps → ZFSet.pair c c' ∈ e → ZFSet.pair v v' ∈ e → - CodedCapProfile Q R ν c' v' K (relationImage F Q e) - -def CommonTargetCapMeetCode (I P Q ν e Targets Caps : ZFSet.{u}) : Prop := - ∀ i ∈ I, ∀ j ∈ I, ∀ c ∈ P, ∀ K ∈ Q, ∀ L ∈ Q, ∀ c' ∈ Q, - i ≠ j → ZFSet.pair i c ∈ Targets → ZFSet.pair j c ∈ Targets → - ZFSet.pair i K ∈ Caps → ZFSet.pair j L ∈ Caps → ZFSet.pair c c' ∈ e → - ZFSet.pair (ZFSet.pair K L) c' ∈ ν - -structure TaskCapFamilyCode (I P Q R ν e Targets Separators Filters Families Caps : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc I Q Caps - profiles : TaskCapProfilesCode I P Q R ν e Targets Separators Filters Families Caps - common_target : CommonTargetCapMeetCode I P Q ν e Targets Caps - -namespace BoundedFormula - -def taskCapProfilesFormula {n} - (I P Q R ν e Targets Separators Filters Families Caps : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ.succ - .allMem I (.allMem P.succ (.allMem P.succ.succ (.allMem Families.succ.succ.succ - (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ - (.allMem Q.succ.succ.succ.succ.succ.succ - (imp (pairMembershipFormula 6 5 (lift Targets)) - (imp (pairMembershipFormula 6 4 (lift Separators)) - (imp (pairMembershipFormula 6 3 (lift Filters)) - (imp (pairMembershipFormula 6 2 (lift Caps)) - (imp (pairMembershipFormula 5 1 (lift e)) - (imp (pairMembershipFormula 4 0 (lift e)) - (imageCapProfileFormula (lift Q) (lift R) (lift ν) 1 0 2 3 (lift e)))))))))))))) - -theorem truth_taskCapProfilesFormula {n} - (I P Q R ν e Targets Separators Filters Families Caps : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (taskCapProfilesFormula I P Q R ν e Targets Separators Filters Families Caps) env ↔ - TaskCapProfilesCode (env I) (env P) (env Q) (env R) (env ν) (env e) (env Targets) - (env Separators) (env Filters) (env Families) (env Caps) := by - simp only [taskCapProfilesFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_imageCapProfileFormula] - rfl - -def commonTargetCapMeetFormula {n} (I P Q ν e Targets Caps : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ - .allMem I (.allMem I.succ (.allMem P.succ.succ (.allMem Q.succ.succ.succ - (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ - (imp (.neg (.equal 5 4)) - (imp (pairMembershipFormula 5 3 (lift Targets)) - (imp (pairMembershipFormula 4 3 (lift Targets)) - (imp (pairMembershipFormula 5 2 (lift Caps)) - (imp (pairMembershipFormula 4 1 (lift Caps)) - (imp (pairMembershipFormula 3 0 (lift e)) - (tripleMembershipFormula 2 1 0 (lift ν))))))))))))) - -theorem truth_commonTargetCapMeetFormula {n} (I P Q ν e Targets Caps : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (commonTargetCapMeetFormula I P Q ν e Targets Caps) env ↔ - CommonTargetCapMeetCode (env I) (env P) (env Q) (env ν) (env e) (env Targets) (env Caps) := by - simp only [commonTargetCapMeetFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_tripleMembershipFormula] - rfl - -def taskCapFamilyFormula {n} - (I P Q R ν e Targets Separators Filters Families Caps : Fin n) : BoundedFormula n := - .conj (functionFormula I Q Caps) - (.conj (taskCapProfilesFormula I P Q R ν e Targets Separators Filters Families Caps) - (commonTargetCapMeetFormula I P Q ν e Targets Caps)) - -theorem truth_taskCapFamilyFormula {n} - (I P Q R ν e Targets Separators Filters Families Caps : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (taskCapFamilyFormula I P Q R ν e Targets Separators Filters Families Caps) env ↔ - TaskCapFamilyCode (env I) (env P) (env Q) (env R) (env ν) (env e) (env Targets) - (env Separators) (env Filters) (env Families) (env Caps) := by - simp only [taskCapFamilyFormula, Truth, truth_functionFormula, truth_taskCapProfilesFormula, - truth_commonTargetCapMeetFormula] - exact ⟨fun ⟨f, p, c⟩ => ⟨f, p, c⟩, fun code => ⟨code.function, code.profiles, code.common_target⟩⟩ - -theorem realize_taskCapFamilyFormula (M : TransitiveGround.{u}) {n} - (I P Q R ν e Targets Separators Filters Families Caps : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - SetFormula.Realize M.sets - (taskCapFamilyFormula I P Q R ν e Targets Separators Filters Families Caps).toFormula env ↔ - TaskCapFamilyCode (env I) (env P) (env Q) (env R) (env ν) (env e) (env Targets) - (env Separators) (env Filters) (env Families) (env Caps) := - (realize_toFormula M _ env members).trans - (truth_taskCapFamilyFormula I P Q R ν e Targets Separators Filters Families Caps env) - -end BoundedFormula - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions + +namespace OAI + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def codedInsertionProfileFormula {n} (L r μ c E K F : Fin n) : BoundedFormula n := + .allMem L (imp (pairMembershipFormula E.succ 0 r.succ) + (.conj + (imp (.exMem F.succ (pairMembershipFormula 0 1 r.succ.succ)) + (pairMembershipFormula K.succ 0 r.succ)) + (imp (.neg (.exMem F.succ (pairMembershipFormula 0 1 r.succ.succ))) + (tripleMembershipFormula K.succ 0 c.succ μ.succ)))) + +theorem truth_codedInsertionProfileFormula {n} (L r μ c E K F : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (codedInsertionProfileFormula L r μ c E K F) env ↔ + CodedInsertionProfile (env L) (env r) (env μ) (env c) (env E) (env K) (env F) := by + simp only [codedInsertionProfileFormula, Truth, truth_imp, truth_exMem, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +def codedCapProfileFormula {n} (L r μ c E K F : Fin n) : BoundedFormula n := + .conj (.mem c L) (.conj (.mem E L) (.conj (.mem K L) + (.conj (subsetFormula F L) (.conj (.exMem F (.equal 0 0)) + (.conj (codedInsertionProfileFormula L r μ c E K F) + (.conj (pairMembershipFormula c K r) + (.conj (.neg (pairMembershipFormula K c r)) (.neg (pairMembershipFormula E K r))))))))) + +theorem truth_codedCapProfileFormula {n} (L r μ c E K F : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (codedCapProfileFormula L r μ c E K F) env ↔ + CodedCapProfile (env L) (env r) (env μ) (env c) (env E) (env K) (env F) := by + simp only [codedCapProfileFormula, Truth, truth_subsetFormula, truth_exMem, + truth_codedInsertionProfileFormula, truth_pairMembershipFormula, and_true] + constructor + · rintro ⟨hc, hE, hK, subset, nonempty, profile, lower, strict, separated⟩ + exact ⟨hc, hE, hK, subset, nonempty, profile, lower, strict, separated⟩ + · intro code + exact ⟨code.target_mem, code.separator_mem, code.cap_mem, code.filter_subset, + code.nonempty, code.profile, code.target_below_cap, code.cap_not_below_target, + code.separator_not_below_cap⟩ + +def imageProfilePositiveFormula {n} (F Q e R x : Fin n) : BoundedFormula n := + .exMem Q (.conj (.exMem F.succ (pairMembershipFormula 0 1 e.succ.succ)) + (pairMembershipFormula 0 x.succ R.succ)) + +theorem truth_imageProfilePositiveFormula {n} (F Q e R x : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (imageProfilePositiveFormula F Q e R x) env ↔ + ∃ f ∈ relationImage (env F) (env Q) (env e), ZFSet.pair f (env x) ∈ env R := by + simp only [imageProfilePositiveFormula, truth_exMem, Truth, truth_pairMembershipFormula] + constructor + · rintro ⟨y, hy, ⟨f, hf, entry⟩, lower⟩ + exact ⟨y, (mem_relationImage _ _ _ _).2 ⟨hy, f, hf, entry⟩, lower⟩ + · rintro ⟨y, hy, lower⟩ + obtain ⟨hy, f, hf, entry⟩ := (mem_relationImage _ _ _ _).1 hy + exact ⟨y, hy, ⟨f, hf, entry⟩, lower⟩ + +def imageInsertionProfileFormula {n} (Q R ν c E K F e : Fin n) : BoundedFormula n := + .allMem Q (imp (pairMembershipFormula E.succ 0 R.succ) + (.conj + (imp (imageProfilePositiveFormula F.succ Q.succ e.succ R.succ 0) + (pairMembershipFormula K.succ 0 R.succ)) + (imp (.neg (imageProfilePositiveFormula F.succ Q.succ e.succ R.succ 0)) + (tripleMembershipFormula K.succ 0 c.succ ν.succ)))) + +theorem truth_imageInsertionProfileFormula {n} (Q R ν c E K F e : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (imageInsertionProfileFormula Q R ν c E K F e) env ↔ + CodedInsertionProfile (env Q) (env R) (env ν) (env c) (env E) (env K) + (relationImage (env F) (env Q) (env e)) := by + simp only [imageInsertionProfileFormula, Truth, truth_imp, truth_imageProfilePositiveFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +def imageCapProfileFormula {n} (Q R ν c E K F e : Fin n) : BoundedFormula n := + .conj (.mem c Q) (.conj (.mem E Q) (.conj (.mem K Q) + (.conj (.exMem Q (.exMem F.succ (pairMembershipFormula 0 1 e.succ.succ))) + (.conj (imageInsertionProfileFormula Q R ν c E K F e) + (.conj (pairMembershipFormula c K R) + (.conj (.neg (pairMembershipFormula K c R)) (.neg (pairMembershipFormula E K R)))))))) + +theorem truth_imageCapProfileFormula {n} (Q R ν c E K F e : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (imageCapProfileFormula Q R ν c E K F e) env ↔ + CodedCapProfile (env Q) (env R) (env ν) (env c) (env E) (env K) + (relationImage (env F) (env Q) (env e)) := by + simp only [imageCapProfileFormula, Truth, truth_exMem, truth_pairMembershipFormula, + truth_imageInsertionProfileFormula] + constructor + · rintro ⟨hc, hE, hK, ⟨y, hy, f, hf, entry⟩, profile, lower, strict, separated⟩ + exact ⟨hc, hE, hK, fun _ h => ((mem_relationImage _ _ _ _).1 h).1, + ⟨y, (mem_relationImage _ _ _ _).2 ⟨hy, f, hf, entry⟩⟩, + profile, lower, strict, separated⟩ + · intro code + obtain ⟨y, hy⟩ := code.nonempty + obtain ⟨hy, f, hf, entry⟩ := (mem_relationImage _ _ _ _).1 hy + exact ⟨code.target_mem, code.separator_mem, code.cap_mem, ⟨y, hy, f, hf, entry⟩, + code.profile, code.target_below_cap, code.cap_not_below_target, + code.separator_not_below_cap⟩ + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing +universe u + +def OldProfilePreservationCode (P r μ Q R ν e Filters : ZFSet.{u}) : Prop := + ∀ F ∈ Filters, ∀ c ∈ P, ∀ E ∈ P, ∀ K ∈ P, + CodedCapProfile P r μ c E K F → + ∀ c' ∈ Q, ∀ E' ∈ Q, ∀ K' ∈ Q, + ZFSet.pair c c' ∈ e → ZFSet.pair E E' ∈ e → ZFSet.pair K K' ∈ e → + CodedCapProfile Q R ν c' E' K' (relationImage F Q e) + +namespace BoundedFormula +open SetFormula + +def oldProfilePreservationFormula {n} (P r μ Q R ν e Filters : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ.succ + .allMem Filters (.allMem P.succ (.allMem P.succ.succ (.allMem P.succ.succ.succ + (imp (codedCapProfileFormula P.succ.succ.succ.succ r.succ.succ.succ.succ + μ.succ.succ.succ.succ 2 1 0 3) + (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ + (.allMem Q.succ.succ.succ.succ.succ.succ + (imp (pairMembershipFormula 5 2 (lift e)) + (imp (pairMembershipFormula 4 1 (lift e)) + (imp (pairMembershipFormula 3 0 (lift e)) + (imageCapProfileFormula (lift Q) (lift R) (lift ν) 2 1 0 6 (lift e)))))))))))) + +theorem truth_oldProfilePreservationFormula {n} (P r μ Q R ν e Filters : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (oldProfilePreservationFormula P r μ Q R ν e Filters) env ↔ + OldProfilePreservationCode (env P) (env r) (env μ) (env Q) (env R) (env ν) + (env e) (env Filters) := by + simp only [oldProfilePreservationFormula, Truth, truth_imp, truth_codedCapProfileFormula, + truth_imageCapProfileFormula, truth_pairMembershipFormula] + rfl + +theorem realize_oldProfilePreservationFormula (M : TransitiveGround.{u}) {n} + (P r μ Q R ν e Filters : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (oldProfilePreservationFormula P r μ Q R ν e Filters).toFormula env ↔ + OldProfilePreservationCode (env P) (env r) (env μ) (env Q) (env R) (env ν) + (env e) (env Filters) := + (realize_toFormula M _ env members).trans + (truth_oldProfilePreservationFormula P r μ Q R ν e Filters env) + +end BoundedFormula + +theorem oldProfilePreservation_groundPower_iff (M : TransitiveGround.{u}) + (P r μ Q R ν e : ZFSet.{u}) : + OldProfilePreservationCode P r μ Q R ν e (M.groundPower P) ↔ + ∀ F ∈ M.sets, ∀ c E K, + CodedCapProfile P r μ c E K F → + ∀ c' E' K', ZFSet.pair c c' ∈ e → ZFSet.pair E E' ∈ e → ZFSet.pair K K' ∈ e → + c' ∈ Q → E' ∈ Q → K' ∈ Q → + CodedCapProfile Q R ν c' E' K' (relationImage F Q e) := by + constructor + · intro code F hF c E K profile c' E' K' first second third hc' hE' hK' + exact code F ((M.mem_groundPower P F).2 ⟨hF, profile.filter_subset⟩) + c profile.target_mem E profile.separator_mem K profile.cap_mem profile + c' hc' E' hE' K' hK' first second third + · intro code F hF c _ E _ K _ profile c' hc' E' hE' K' hK' first second third + exact code F ((M.mem_groundPower P F).1 hF).1 c E K profile + c' E' K' first second third hc' hE' hK' + +def TaskCapProfilesCode (I P Q R ν e Targets Separators Filters Families Caps : ZFSet.{u}) : Prop := + ∀ i ∈ I, ∀ c ∈ P, ∀ v ∈ P, ∀ F ∈ Families, + ∀ K ∈ Q, ∀ c' ∈ Q, ∀ v' ∈ Q, + ZFSet.pair i c ∈ Targets → ZFSet.pair i v ∈ Separators → ZFSet.pair i F ∈ Filters → + ZFSet.pair i K ∈ Caps → ZFSet.pair c c' ∈ e → ZFSet.pair v v' ∈ e → + CodedCapProfile Q R ν c' v' K (relationImage F Q e) + +def CommonTargetCapMeetCode (I P Q ν e Targets Caps : ZFSet.{u}) : Prop := + ∀ i ∈ I, ∀ j ∈ I, ∀ c ∈ P, ∀ K ∈ Q, ∀ L ∈ Q, ∀ c' ∈ Q, + i ≠ j → ZFSet.pair i c ∈ Targets → ZFSet.pair j c ∈ Targets → + ZFSet.pair i K ∈ Caps → ZFSet.pair j L ∈ Caps → ZFSet.pair c c' ∈ e → + ZFSet.pair (ZFSet.pair K L) c' ∈ ν + +structure TaskCapFamilyCode (I P Q R ν e Targets Separators Filters Families Caps : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc I Q Caps + profiles : TaskCapProfilesCode I P Q R ν e Targets Separators Filters Families Caps + common_target : CommonTargetCapMeetCode I P Q ν e Targets Caps + +namespace BoundedFormula + +def taskCapProfilesFormula {n} + (I P Q R ν e Targets Separators Filters Families Caps : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ.succ + .allMem I (.allMem P.succ (.allMem P.succ.succ (.allMem Families.succ.succ.succ + (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ + (.allMem Q.succ.succ.succ.succ.succ.succ + (imp (pairMembershipFormula 6 5 (lift Targets)) + (imp (pairMembershipFormula 6 4 (lift Separators)) + (imp (pairMembershipFormula 6 3 (lift Filters)) + (imp (pairMembershipFormula 6 2 (lift Caps)) + (imp (pairMembershipFormula 5 1 (lift e)) + (imp (pairMembershipFormula 4 0 (lift e)) + (imageCapProfileFormula (lift Q) (lift R) (lift ν) 1 0 2 3 (lift e)))))))))))))) + +theorem truth_taskCapProfilesFormula {n} + (I P Q R ν e Targets Separators Filters Families Caps : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (taskCapProfilesFormula I P Q R ν e Targets Separators Filters Families Caps) env ↔ + TaskCapProfilesCode (env I) (env P) (env Q) (env R) (env ν) (env e) (env Targets) + (env Separators) (env Filters) (env Families) (env Caps) := by + simp only [taskCapProfilesFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_imageCapProfileFormula] + rfl + +def commonTargetCapMeetFormula {n} (I P Q ν e Targets Caps : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ + .allMem I (.allMem I.succ (.allMem P.succ.succ (.allMem Q.succ.succ.succ + (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ + (imp (.neg (.equal 5 4)) + (imp (pairMembershipFormula 5 3 (lift Targets)) + (imp (pairMembershipFormula 4 3 (lift Targets)) + (imp (pairMembershipFormula 5 2 (lift Caps)) + (imp (pairMembershipFormula 4 1 (lift Caps)) + (imp (pairMembershipFormula 3 0 (lift e)) + (tripleMembershipFormula 2 1 0 (lift ν))))))))))))) + +theorem truth_commonTargetCapMeetFormula {n} (I P Q ν e Targets Caps : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (commonTargetCapMeetFormula I P Q ν e Targets Caps) env ↔ + CommonTargetCapMeetCode (env I) (env P) (env Q) (env ν) (env e) (env Targets) (env Caps) := by + simp only [commonTargetCapMeetFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_tripleMembershipFormula] + rfl + +def taskCapFamilyFormula {n} + (I P Q R ν e Targets Separators Filters Families Caps : Fin n) : BoundedFormula n := + .conj (functionFormula I Q Caps) + (.conj (taskCapProfilesFormula I P Q R ν e Targets Separators Filters Families Caps) + (commonTargetCapMeetFormula I P Q ν e Targets Caps)) + +theorem truth_taskCapFamilyFormula {n} + (I P Q R ν e Targets Separators Filters Families Caps : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (taskCapFamilyFormula I P Q R ν e Targets Separators Filters Families Caps) env ↔ + TaskCapFamilyCode (env I) (env P) (env Q) (env R) (env ν) (env e) (env Targets) + (env Separators) (env Filters) (env Families) (env Caps) := by + simp only [taskCapFamilyFormula, Truth, truth_functionFormula, truth_taskCapProfilesFormula, + truth_commonTargetCapMeetFormula] + exact ⟨fun ⟨f, p, c⟩ => ⟨f, p, c⟩, fun code => ⟨code.function, code.profiles, code.common_target⟩⟩ + +theorem realize_taskCapFamilyFormula (M : TransitiveGround.{u}) {n} + (I P Q R ν e Targets Separators Filters Families Caps : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + SetFormula.Realize M.sets + (taskCapFamilyFormula I P Q R ν e Targets Separators Filters Families Caps).toFormula env ↔ + TaskCapFamilyCode (env I) (env P) (env Q) (env R) (env ν) (env e) (env Targets) + (env Separators) (env Filters) (env Families) (env Caps) := + (realize_toFormula M _ env members).trans + (truth_taskCapFamilyFormula I P Q R ν e Targets Separators Filters Families Caps env) + +end BoundedFormula + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskRepresentativeCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskRepresentativeCodes.lean index 36328521762509479696ece54ddd5a298a54cf8c..88e2a944727513e303d95e1df09419c02310f4e2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskRepresentativeCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskRepresentativeCodes.lean @@ -1,343 +1,343 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.ActionPostcompositionCodes - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace BoundedFormula - -open SetFormula SetRealization -universe u - -def actionSectionEntryFormula {n} (z g a p : Fin n) : BoundedFormula n := - exMem p (exMem p.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (tripleMembershipFormula g.succ.succ 1 0 a.succ.succ))) - -def actionSectionFormula {n} (f g a p : Fin n) : BoundedFormula n := - .conj (relationBetweenFormula p p f) (.allMem p (.allMem p.succ - (.conj (imp (pairMembershipFormula 1 0 f.succ.succ) - (tripleMembershipFormula g.succ.succ 1 0 a.succ.succ)) - (imp (tripleMembershipFormula g.succ.succ 1 0 a.succ.succ) - (pairMembershipFormula 1 0 f.succ.succ))))) - -theorem truth_actionSectionEntryFormula {n} (z g a p : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (actionSectionEntryFormula z g a p) env ↔ - ∃ x ∈ env p, ∃ y ∈ env p, env z = ZFSet.pair x y ∧ - ZFSet.pair (ZFSet.pair (env g) x) y ∈ env a := by - simp only [actionSectionEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_tripleMembershipFormula] - rfl - -theorem truth_actionSectionFormula {n} (f g a p : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (actionSectionFormula f g a p) env ↔ - env f ⊆ ZFSet.prod (env p) (env p) ∧ ∀ x ∈ env p, ∀ y ∈ env p, - (ZFSet.pair x y ∈ env f ↔ ZFSet.pair (ZFSet.pair (env g) x) y ∈ env a) := by - simp only [actionSectionFormula, Truth, truth_relationBetweenFormula, truth_imp, - truth_pairMembershipFormula, truth_tripleMembershipFormula, ← iff_def] - rfl - -variable {G P : Type u} [Group G] [PartialOrder P] - -theorem actionSectionEntry_correct (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - (g : G) (z : ZFSet.{u}) : - Truth (actionSectionEntryFormula 0 1 2 3) - (extend z (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ - z ∈ s.graph s (a.iso g) := by - rw [truth_actionSectionEntryFormula] - constructor - · rintro ⟨x, hx, y, hy, eq, rel⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨q, rfl⟩ := (s.mem_carrier y).1 hy - change z = ZFSet.pair (s.encode p) (s.encode q) at eq - rw [eq, s.pair_mem_graph] - exact (a.triple_mem_actionGraph s t g p q).1 rel - · intro member - obtain ⟨p, eq⟩ := (s.mem_graph s (a.iso g) z).1 member - exact ⟨s.encode p, s.encode_mem p, s.encode (a.iso g p), s.encode_mem _, eq.symm, - (a.triple_mem_actionGraph s t g p (a.iso g p)).2 rfl⟩ - -theorem actionSection_correct (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - (g : G) (F : ZFSet.{u}) : - Truth (actionSectionFormula 0 1 2 3) - (extend F (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ - F = s.graph s (a.iso g) := by - rw [truth_actionSectionFormula] - constructor - · rintro ⟨shape, spec⟩ - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (shape hz) - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨q, rfl⟩ := (s.mem_carrier y).1 hy - rw [eq, s.pair_mem_graph] - exact (a.triple_mem_actionGraph s t g p q).1 ((spec _ hx _ hy).1 (eq ▸ hz)) - · intro hz - obtain ⟨p, eq⟩ := (s.mem_graph s (a.iso g) z).1 hz - exact eq ▸ (spec _ (s.encode_mem p) _ (s.encode_mem (a.iso g p))).2 - ((a.triple_mem_actionGraph s t g p (a.iso g p)).2 rfl) - · intro eq - subst F - refine ⟨(s.graph_isFunc s (a.iso g)).1, ?_⟩ - intro x hx y hy - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨q, rfl⟩ := (s.mem_carrier y).1 hy - exact (s.pair_mem_graph s (a.iso g) p q).trans (a.triple_mem_actionGraph s t g p q).symm - -end BoundedFormula - -namespace BoundedFormula - -open SetFormula -universe u - -def meetFilterFormula {n} (P r μ F : Fin n) : BoundedFormula n := - .conj (.allMem F (.mem 0 P.succ)) - (.conj (exMem F (.equal 0 0)) - (.conj - (.allMem F (.allMem P.succ - (imp (pairMembershipFormula 1 0 r.succ.succ) (.mem 0 F.succ.succ)))) - (.allMem F (.allMem F.succ (.allMem P.succ.succ - (imp (tripleMembershipFormula 2 1 0 μ.succ.succ.succ) - (.mem 0 F.succ.succ.succ))))))) - -theorem truth_meetFilterFormula {n} (P r μ F : Fin n) - (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env P) (env r) (env μ)) : - Truth (meetFilterFormula P r μ F) env ↔ - MeetFilterCode (env P) (env r) (env μ) (env F) := by - simp only [meetFilterFormula, Truth, truth_exMem, truth_imp, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - constructor - · rintro ⟨subset, ⟨x, hx, _⟩, upward, closed⟩ - exact ⟨subset, ⟨x, hx⟩, upward, fun x hx y hy z entry => - closed x hx y hy z (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 entry⟩ - · intro filter - obtain ⟨x, hx⟩ := filter.nonempty - exact ⟨filter.subset, ⟨x, hx, trivial⟩, filter.upward, - fun x hx y hy z _ entry => filter.closed_meet x hx y hy z entry⟩ - -theorem realize_meetFilterFormula (M : TransitiveGround.{u}) {n} - (P r μ F : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (meetFilterFormula P r μ F).toFormula env ↔ - MeetFilterCode (env P) (env r) (env μ) (env F) := - (realize_toFormula M _ env members).trans (truth_meetFilterFormula P r μ F env meet) - -def restrictedActionEntryFormula {n} (z P r A g source : Fin n) : BoundedFormula n := - exMem P (exMem P.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (.conj (pairMembershipFormula 1 source.succ.succ r.succ.succ) - (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ)))) - -theorem truth_restrictedActionEntryFormula {n} (z P r A g source : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (restrictedActionEntryFormula z P r A g source) env ↔ - ∃ x ∈ env P, ∃ y ∈ env P, env z = ZFSet.pair x y ∧ - ZFSet.pair x (env source) ∈ env r ∧ ZFSet.pair (ZFSet.pair (env g) x) y ∈ env A := by - simp only [restrictedActionEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -def restrictedActionFormula {n} (P r A g source target base : Fin n) : BoundedFormula n := - let entry := pairMembershipFormula 1 0 base.succ.succ - let restricted := .conj (pairMembershipFormula 1 source.succ.succ r.succ.succ) - (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ) - .conj (relationBetweenFormula P P base) - (.conj (tripleMembershipFormula g source target A) - (.allMem P (.allMem P.succ - (.conj (imp entry restricted) (imp restricted entry))))) - -theorem truth_restrictedActionFormula {n} (P r A g source target base : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (restrictedActionFormula P r A g source target base) env ↔ - RestrictedActionCode (env P) (env r) (env A) (env g) (env source) (env target) (env base) := by - simp only [restrictedActionFormula, Truth, truth_relationBetweenFormula, - truth_tripleMembershipFormula, truth_pairMembershipFormula, truth_imp, ← iff_def] - exact ⟨fun ⟨shape, target, entries⟩ => ⟨shape, target, entries⟩, - fun code => ⟨code.shape, code.target_entry, code.entries⟩⟩ - -theorem realize_restrictedActionFormula (M : TransitiveGround.{u}) {n} - (P r A g source target base : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (restrictedActionFormula P r A g source target base).toFormula env ↔ - RestrictedActionCode (env P) (env r) (env A) (env g) (env source) (env target) (env base) := - (realize_toFormula M _ env members).trans - (truth_restrictedActionFormula P r A g source target base env) - -end BoundedFormula - -universe u - -structure EligibleTaskCode (P G r μ A source target base separator F : ZFSet.{u}) : Prop where - source_mem : source ∈ P - target_mem : target ∈ P - separator_mem : separator ∈ P - filter : MeetFilterCode P r μ F - lower : ZFSet.pair target separator ∈ r - strict : ZFSet.pair separator target ∉ r - upper : ∀ x ∈ F, ZFSet.pair separator x ∈ r - representative : ∃ g ∈ G, RestrictedActionCode P r A g source target base - -namespace BoundedFormula - -open SetFormula - -def eligibleTaskFormula {n} (P G r μ A source target base separator F : Fin n) : BoundedFormula n := - .conj (.mem source P) (.conj (.mem target P) (.conj (.mem separator P) - (.conj (meetFilterFormula P r μ F) (.conj (pairMembershipFormula target separator r) - (.conj (.neg (pairMembershipFormula separator target r)) - (.conj (allMem F (pairMembershipFormula separator.succ 0 r.succ)) - (exMem G (restrictedActionFormula P.succ r.succ A.succ 0 - source.succ target.succ base.succ)))))))) - -theorem truth_eligibleTaskFormula {n} (P G r μ A source target base separator F : Fin n) - (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env P) (env r) (env μ)) : - Truth (eligibleTaskFormula P G r μ A source target base separator F) env ↔ - EligibleTaskCode (env P) (env G) (env r) (env μ) (env A) - (env source) (env target) (env base) (env separator) (env F) := by - simp only [eligibleTaskFormula, Truth, truth_pairMembershipFormula, truth_exMem, - truth_restrictedActionFormula, truth_meetFilterFormula P r μ F env meet] - constructor - · rintro ⟨hs, ht, he, filter, lower, strict, upper, representative⟩ - exact ⟨hs, ht, he, filter, lower, strict, upper, representative⟩ - · intro code - exact ⟨code.source_mem, code.target_mem, code.separator_mem, code.filter, - code.lower, code.strict, code.upper, code.representative⟩ - -end BoundedFormula - -noncomputable def eligibleTaskSet (P G r μ A R U Labels : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ e ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, - z = literalTaskCode a c base e F label ∧ EligibleTaskCode P G r μ A a c base e F) - (literalTaskBound P R U Labels) - -theorem eligibleTaskSet_subset (P G r μ A R U Labels : ZFSet.{u}) : - eligibleTaskSet P G r μ A R U Labels ⊆ literalTaskBound P R U Labels := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_eligibleTaskSet (P G r μ A R U Labels z : ZFSet.{u}) : - z ∈ eligibleTaskSet P G r μ A R U Labels ↔ - ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ e ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, - z = literalTaskCode a c base e F label ∧ EligibleTaskCode P G r μ A a c base e F := by - constructor - · exact fun hz => (ZFSet.mem_sep.1 hz).2 - · rintro ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ - exact ZFSet.mem_sep.2 ⟨(literalTaskCode_mem_bound P R U Labels a c base e F label).2 - ⟨ha, hc, hBase, he, hF, hLabel⟩, - a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ - -theorem literalTaskCode_mem_eligibleTaskSet (P G r μ A R U Labels a c base e F label : ZFSet.{u}) : - literalTaskCode a c base e F label ∈ eligibleTaskSet P G r μ A R U Labels ↔ - a ∈ P ∧ c ∈ P ∧ base ∈ R ∧ e ∈ P ∧ F ∈ U ∧ label ∈ Labels ∧ - EligibleTaskCode P G r μ A a c base e F := by - rw [mem_eligibleTaskSet] - constructor - · rintro ⟨a', ha, c', hc, base', hBase, e', he, F', hF, label', hLabel, equal, code⟩ - obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := literalTaskCode_inj.1 equal - exact ⟨ha, hc, hBase, he, hF, hLabel, code⟩ - · rintro ⟨ha, hc, hBase, he, hF, hLabel, code⟩ - exact ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ - -namespace BoundedFormula - -open SetFormula - -def eligibleTaskEntryFormula {n} (z P G r μ A R U Labels : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - exMem P (exMem P.succ (exMem R.succ.succ (exMem P.succ.succ.succ - (exMem U.succ.succ.succ.succ (exMem Labels.succ.succ.succ.succ.succ - (.conj (literalTaskFormula (lift z) 5 4 3 2 1 0) - (eligibleTaskFormula (lift P) (lift G) (lift r) (lift μ) (lift A) 5 4 3 2 1))))))) - -theorem truth_eligibleTaskEntryFormula {n} (z P G r μ A R U Labels : Fin n) - (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env P) (env r) (env μ)) : - Truth (eligibleTaskEntryFormula z P G r μ A R U Labels) env ↔ - env z ∈ eligibleTaskSet (env P) (env G) (env r) (env μ) (env A) (env R) (env U) (env Labels) := by - rw [mem_eligibleTaskSet] - simp only [eligibleTaskEntryFormula, truth_exMem, Truth, truth_literalTaskFormula] - refine exists_congr fun a => and_congr_right fun _ => - exists_congr fun c => and_congr_right fun _ => - exists_congr fun base => and_congr_right fun _ => - exists_congr fun e => and_congr_right fun _ => - exists_congr fun F => and_congr_right fun _ => - exists_congr fun label => and_congr_right fun _ => ?_ - exact and_congr Iff.rfl (truth_eligibleTaskFormula _ _ _ _ _ _ _ _ _ _ - (extend label (extend F (extend e (extend base (extend c (extend a env)))))) meet) - -end BoundedFormula - -def TaskRepresentative (P r A R U Labels task g : ZFSet.{u}) : Prop := - ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ e ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, - task = literalTaskCode a c base e F label ∧ RestrictedActionCode P r A g a c base - -theorem TaskRepresentative.restriction {P r A R U Labels g a c base e F label : ZFSet.{u}} - (represented : TaskRepresentative P r A R U Labels (literalTaskCode a c base e F label) g) : - RestrictedActionCode P r A g a c base := by - obtain ⟨a', _, c', _, base', _, e', _, F', _, label', _, equal, code⟩ := represented - obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := literalTaskCode_inj.1 equal - exact code - -noncomputable def taskRepresentativeRelation (I P G r A R U Labels : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ task ∈ I, ∃ g ∈ G, - z = ZFSet.pair task g ∧ TaskRepresentative P r A R U Labels task g) (ZFSet.prod I G) - -theorem pair_mem_taskRepresentativeRelation (I P G r A R U Labels task g : ZFSet.{u}) : - ZFSet.pair task g ∈ taskRepresentativeRelation I P G r A R U Labels ↔ - task ∈ I ∧ g ∈ G ∧ TaskRepresentative P r A R U Labels task g := by - constructor - · intro h - obtain ⟨_, t, ht, h, hh, equal, represents⟩ := ZFSet.mem_sep.1 h - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨ht, hh, represents⟩ - · rintro ⟨ht, hg, represents⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨ht, hg⟩, task, ht, g, hg, rfl, represents⟩ - -theorem eligibleTask_representative_total (P G r μ A R U Labels : ZFSet.{u}) : - ∀ task ∈ eligibleTaskSet P G r μ A R U Labels, ∃ g ∈ G, - ZFSet.pair task g ∈ taskRepresentativeRelation - (eligibleTaskSet P G r μ A R U Labels) P G r A R U Labels := by - intro task ht - obtain ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, equal, code⟩ := - (mem_eligibleTaskSet P G r μ A R U Labels task).1 ht - obtain ⟨g, hg, represents⟩ := code.representative - exact ⟨g, hg, (pair_mem_taskRepresentativeRelation _ _ _ _ _ _ _ _ _ _).2 - ⟨ht, hg, a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, equal, represents⟩⟩ - -namespace BoundedFormula - -open SetFormula - -def taskRepresentativeFormula {n} (task g P r A R U Labels : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - exMem P (exMem P.succ (exMem R.succ.succ (exMem P.succ.succ.succ - (exMem U.succ.succ.succ.succ (exMem Labels.succ.succ.succ.succ.succ - (.conj (literalTaskFormula (lift task) 5 4 3 2 1 0) - (restrictedActionFormula (lift P) (lift r) (lift A) (lift g) 5 4 3))))))) - -theorem truth_taskRepresentativeFormula {n} (task g P r A R U Labels : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (taskRepresentativeFormula task g P r A R U Labels) env ↔ - TaskRepresentative (env P) (env r) (env A) (env R) (env U) (env Labels) (env task) (env g) := by - simp only [taskRepresentativeFormula, truth_exMem, Truth, truth_literalTaskFormula, - truth_restrictedActionFormula, TaskRepresentative] - rfl - -def taskRepresentativeEntryFormula {n} (z I P G r A R U Labels : Fin n) : BoundedFormula n := - exMem I (exMem G.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (taskRepresentativeFormula 1 0 P.succ.succ r.succ.succ A.succ.succ - R.succ.succ U.succ.succ Labels.succ.succ))) - -theorem truth_taskRepresentativeEntryFormula {n} (z I P G r A R U Labels : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (taskRepresentativeEntryFormula z I P G r A R U Labels) env ↔ - ∃ task ∈ env I, ∃ g ∈ env G, env z = ZFSet.pair task g ∧ - TaskRepresentative (env P) (env r) (env A) (env R) (env U) (env Labels) task g := by - simp only [taskRepresentativeEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_taskRepresentativeFormula] - rfl - -end BoundedFormula - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.ActionPostcompositionCodes + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace BoundedFormula + +open SetFormula SetRealization +universe u + +def actionSectionEntryFormula {n} (z g a p : Fin n) : BoundedFormula n := + exMem p (exMem p.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (tripleMembershipFormula g.succ.succ 1 0 a.succ.succ))) + +def actionSectionFormula {n} (f g a p : Fin n) : BoundedFormula n := + .conj (relationBetweenFormula p p f) (.allMem p (.allMem p.succ + (.conj (imp (pairMembershipFormula 1 0 f.succ.succ) + (tripleMembershipFormula g.succ.succ 1 0 a.succ.succ)) + (imp (tripleMembershipFormula g.succ.succ 1 0 a.succ.succ) + (pairMembershipFormula 1 0 f.succ.succ))))) + +theorem truth_actionSectionEntryFormula {n} (z g a p : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (actionSectionEntryFormula z g a p) env ↔ + ∃ x ∈ env p, ∃ y ∈ env p, env z = ZFSet.pair x y ∧ + ZFSet.pair (ZFSet.pair (env g) x) y ∈ env a := by + simp only [actionSectionEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_tripleMembershipFormula] + rfl + +theorem truth_actionSectionFormula {n} (f g a p : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (actionSectionFormula f g a p) env ↔ + env f ⊆ ZFSet.prod (env p) (env p) ∧ ∀ x ∈ env p, ∀ y ∈ env p, + (ZFSet.pair x y ∈ env f ↔ ZFSet.pair (ZFSet.pair (env g) x) y ∈ env a) := by + simp only [actionSectionFormula, Truth, truth_relationBetweenFormula, truth_imp, + truth_pairMembershipFormula, truth_tripleMembershipFormula, ← iff_def] + rfl + +variable {G P : Type u} [Group G] [PartialOrder P] + +theorem actionSectionEntry_correct (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + (g : G) (z : ZFSet.{u}) : + Truth (actionSectionEntryFormula 0 1 2 3) + (extend z (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ + z ∈ s.graph s (a.iso g) := by + rw [truth_actionSectionEntryFormula] + constructor + · rintro ⟨x, hx, y, hy, eq, rel⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨q, rfl⟩ := (s.mem_carrier y).1 hy + change z = ZFSet.pair (s.encode p) (s.encode q) at eq + rw [eq, s.pair_mem_graph] + exact (a.triple_mem_actionGraph s t g p q).1 rel + · intro member + obtain ⟨p, eq⟩ := (s.mem_graph s (a.iso g) z).1 member + exact ⟨s.encode p, s.encode_mem p, s.encode (a.iso g p), s.encode_mem _, eq.symm, + (a.triple_mem_actionGraph s t g p (a.iso g p)).2 rfl⟩ + +theorem actionSection_correct (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + (g : G) (F : ZFSet.{u}) : + Truth (actionSectionFormula 0 1 2 3) + (extend F (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ + F = s.graph s (a.iso g) := by + rw [truth_actionSectionFormula] + constructor + · rintro ⟨shape, spec⟩ + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (shape hz) + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨q, rfl⟩ := (s.mem_carrier y).1 hy + rw [eq, s.pair_mem_graph] + exact (a.triple_mem_actionGraph s t g p q).1 ((spec _ hx _ hy).1 (eq ▸ hz)) + · intro hz + obtain ⟨p, eq⟩ := (s.mem_graph s (a.iso g) z).1 hz + exact eq ▸ (spec _ (s.encode_mem p) _ (s.encode_mem (a.iso g p))).2 + ((a.triple_mem_actionGraph s t g p (a.iso g p)).2 rfl) + · intro eq + subst F + refine ⟨(s.graph_isFunc s (a.iso g)).1, ?_⟩ + intro x hx y hy + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨q, rfl⟩ := (s.mem_carrier y).1 hy + exact (s.pair_mem_graph s (a.iso g) p q).trans (a.triple_mem_actionGraph s t g p q).symm + +end BoundedFormula + +namespace BoundedFormula + +open SetFormula +universe u + +def meetFilterFormula {n} (P r μ F : Fin n) : BoundedFormula n := + .conj (.allMem F (.mem 0 P.succ)) + (.conj (exMem F (.equal 0 0)) + (.conj + (.allMem F (.allMem P.succ + (imp (pairMembershipFormula 1 0 r.succ.succ) (.mem 0 F.succ.succ)))) + (.allMem F (.allMem F.succ (.allMem P.succ.succ + (imp (tripleMembershipFormula 2 1 0 μ.succ.succ.succ) + (.mem 0 F.succ.succ.succ))))))) + +theorem truth_meetFilterFormula {n} (P r μ F : Fin n) + (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env P) (env r) (env μ)) : + Truth (meetFilterFormula P r μ F) env ↔ + MeetFilterCode (env P) (env r) (env μ) (env F) := by + simp only [meetFilterFormula, Truth, truth_exMem, truth_imp, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + constructor + · rintro ⟨subset, ⟨x, hx, _⟩, upward, closed⟩ + exact ⟨subset, ⟨x, hx⟩, upward, fun x hx y hy z entry => + closed x hx y hy z (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 entry⟩ + · intro filter + obtain ⟨x, hx⟩ := filter.nonempty + exact ⟨filter.subset, ⟨x, hx, trivial⟩, filter.upward, + fun x hx y hy z _ entry => filter.closed_meet x hx y hy z entry⟩ + +theorem realize_meetFilterFormula (M : TransitiveGround.{u}) {n} + (P r μ F : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (meetFilterFormula P r μ F).toFormula env ↔ + MeetFilterCode (env P) (env r) (env μ) (env F) := + (realize_toFormula M _ env members).trans (truth_meetFilterFormula P r μ F env meet) + +def restrictedActionEntryFormula {n} (z P r A g source : Fin n) : BoundedFormula n := + exMem P (exMem P.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (.conj (pairMembershipFormula 1 source.succ.succ r.succ.succ) + (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ)))) + +theorem truth_restrictedActionEntryFormula {n} (z P r A g source : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (restrictedActionEntryFormula z P r A g source) env ↔ + ∃ x ∈ env P, ∃ y ∈ env P, env z = ZFSet.pair x y ∧ + ZFSet.pair x (env source) ∈ env r ∧ ZFSet.pair (ZFSet.pair (env g) x) y ∈ env A := by + simp only [restrictedActionEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +def restrictedActionFormula {n} (P r A g source target base : Fin n) : BoundedFormula n := + let entry := pairMembershipFormula 1 0 base.succ.succ + let restricted := .conj (pairMembershipFormula 1 source.succ.succ r.succ.succ) + (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ) + .conj (relationBetweenFormula P P base) + (.conj (tripleMembershipFormula g source target A) + (.allMem P (.allMem P.succ + (.conj (imp entry restricted) (imp restricted entry))))) + +theorem truth_restrictedActionFormula {n} (P r A g source target base : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (restrictedActionFormula P r A g source target base) env ↔ + RestrictedActionCode (env P) (env r) (env A) (env g) (env source) (env target) (env base) := by + simp only [restrictedActionFormula, Truth, truth_relationBetweenFormula, + truth_tripleMembershipFormula, truth_pairMembershipFormula, truth_imp, ← iff_def] + exact ⟨fun ⟨shape, target, entries⟩ => ⟨shape, target, entries⟩, + fun code => ⟨code.shape, code.target_entry, code.entries⟩⟩ + +theorem realize_restrictedActionFormula (M : TransitiveGround.{u}) {n} + (P r A g source target base : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (restrictedActionFormula P r A g source target base).toFormula env ↔ + RestrictedActionCode (env P) (env r) (env A) (env g) (env source) (env target) (env base) := + (realize_toFormula M _ env members).trans + (truth_restrictedActionFormula P r A g source target base env) + +end BoundedFormula + +universe u + +structure EligibleTaskCode (P G r μ A source target base separator F : ZFSet.{u}) : Prop where + source_mem : source ∈ P + target_mem : target ∈ P + separator_mem : separator ∈ P + filter : MeetFilterCode P r μ F + lower : ZFSet.pair target separator ∈ r + strict : ZFSet.pair separator target ∉ r + upper : ∀ x ∈ F, ZFSet.pair separator x ∈ r + representative : ∃ g ∈ G, RestrictedActionCode P r A g source target base + +namespace BoundedFormula + +open SetFormula + +def eligibleTaskFormula {n} (P G r μ A source target base separator F : Fin n) : BoundedFormula n := + .conj (.mem source P) (.conj (.mem target P) (.conj (.mem separator P) + (.conj (meetFilterFormula P r μ F) (.conj (pairMembershipFormula target separator r) + (.conj (.neg (pairMembershipFormula separator target r)) + (.conj (allMem F (pairMembershipFormula separator.succ 0 r.succ)) + (exMem G (restrictedActionFormula P.succ r.succ A.succ 0 + source.succ target.succ base.succ)))))))) + +theorem truth_eligibleTaskFormula {n} (P G r μ A source target base separator F : Fin n) + (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env P) (env r) (env μ)) : + Truth (eligibleTaskFormula P G r μ A source target base separator F) env ↔ + EligibleTaskCode (env P) (env G) (env r) (env μ) (env A) + (env source) (env target) (env base) (env separator) (env F) := by + simp only [eligibleTaskFormula, Truth, truth_pairMembershipFormula, truth_exMem, + truth_restrictedActionFormula, truth_meetFilterFormula P r μ F env meet] + constructor + · rintro ⟨hs, ht, he, filter, lower, strict, upper, representative⟩ + exact ⟨hs, ht, he, filter, lower, strict, upper, representative⟩ + · intro code + exact ⟨code.source_mem, code.target_mem, code.separator_mem, code.filter, + code.lower, code.strict, code.upper, code.representative⟩ + +end BoundedFormula + +noncomputable def eligibleTaskSet (P G r μ A R U Labels : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ e ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, + z = literalTaskCode a c base e F label ∧ EligibleTaskCode P G r μ A a c base e F) + (literalTaskBound P R U Labels) + +theorem eligibleTaskSet_subset (P G r μ A R U Labels : ZFSet.{u}) : + eligibleTaskSet P G r μ A R U Labels ⊆ literalTaskBound P R U Labels := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_eligibleTaskSet (P G r μ A R U Labels z : ZFSet.{u}) : + z ∈ eligibleTaskSet P G r μ A R U Labels ↔ + ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ e ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, + z = literalTaskCode a c base e F label ∧ EligibleTaskCode P G r μ A a c base e F := by + constructor + · exact fun hz => (ZFSet.mem_sep.1 hz).2 + · rintro ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ + exact ZFSet.mem_sep.2 ⟨(literalTaskCode_mem_bound P R U Labels a c base e F label).2 + ⟨ha, hc, hBase, he, hF, hLabel⟩, + a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ + +theorem literalTaskCode_mem_eligibleTaskSet (P G r μ A R U Labels a c base e F label : ZFSet.{u}) : + literalTaskCode a c base e F label ∈ eligibleTaskSet P G r μ A R U Labels ↔ + a ∈ P ∧ c ∈ P ∧ base ∈ R ∧ e ∈ P ∧ F ∈ U ∧ label ∈ Labels ∧ + EligibleTaskCode P G r μ A a c base e F := by + rw [mem_eligibleTaskSet] + constructor + · rintro ⟨a', ha, c', hc, base', hBase, e', he, F', hF, label', hLabel, equal, code⟩ + obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := literalTaskCode_inj.1 equal + exact ⟨ha, hc, hBase, he, hF, hLabel, code⟩ + · rintro ⟨ha, hc, hBase, he, hF, hLabel, code⟩ + exact ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ + +namespace BoundedFormula + +open SetFormula + +def eligibleTaskEntryFormula {n} (z P G r μ A R U Labels : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + exMem P (exMem P.succ (exMem R.succ.succ (exMem P.succ.succ.succ + (exMem U.succ.succ.succ.succ (exMem Labels.succ.succ.succ.succ.succ + (.conj (literalTaskFormula (lift z) 5 4 3 2 1 0) + (eligibleTaskFormula (lift P) (lift G) (lift r) (lift μ) (lift A) 5 4 3 2 1))))))) + +theorem truth_eligibleTaskEntryFormula {n} (z P G r μ A R U Labels : Fin n) + (env : Fin n → ZFSet.{u}) (meet : MeetOrderCode (env P) (env r) (env μ)) : + Truth (eligibleTaskEntryFormula z P G r μ A R U Labels) env ↔ + env z ∈ eligibleTaskSet (env P) (env G) (env r) (env μ) (env A) (env R) (env U) (env Labels) := by + rw [mem_eligibleTaskSet] + simp only [eligibleTaskEntryFormula, truth_exMem, Truth, truth_literalTaskFormula] + refine exists_congr fun a => and_congr_right fun _ => + exists_congr fun c => and_congr_right fun _ => + exists_congr fun base => and_congr_right fun _ => + exists_congr fun e => and_congr_right fun _ => + exists_congr fun F => and_congr_right fun _ => + exists_congr fun label => and_congr_right fun _ => ?_ + exact and_congr Iff.rfl (truth_eligibleTaskFormula _ _ _ _ _ _ _ _ _ _ + (extend label (extend F (extend e (extend base (extend c (extend a env)))))) meet) + +end BoundedFormula + +def TaskRepresentative (P r A R U Labels task g : ZFSet.{u}) : Prop := + ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ e ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, + task = literalTaskCode a c base e F label ∧ RestrictedActionCode P r A g a c base + +theorem TaskRepresentative.restriction {P r A R U Labels g a c base e F label : ZFSet.{u}} + (represented : TaskRepresentative P r A R U Labels (literalTaskCode a c base e F label) g) : + RestrictedActionCode P r A g a c base := by + obtain ⟨a', _, c', _, base', _, e', _, F', _, label', _, equal, code⟩ := represented + obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := literalTaskCode_inj.1 equal + exact code + +noncomputable def taskRepresentativeRelation (I P G r A R U Labels : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ task ∈ I, ∃ g ∈ G, + z = ZFSet.pair task g ∧ TaskRepresentative P r A R U Labels task g) (ZFSet.prod I G) + +theorem pair_mem_taskRepresentativeRelation (I P G r A R U Labels task g : ZFSet.{u}) : + ZFSet.pair task g ∈ taskRepresentativeRelation I P G r A R U Labels ↔ + task ∈ I ∧ g ∈ G ∧ TaskRepresentative P r A R U Labels task g := by + constructor + · intro h + obtain ⟨_, t, ht, h, hh, equal, represents⟩ := ZFSet.mem_sep.1 h + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨ht, hh, represents⟩ + · rintro ⟨ht, hg, represents⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨ht, hg⟩, task, ht, g, hg, rfl, represents⟩ + +theorem eligibleTask_representative_total (P G r μ A R U Labels : ZFSet.{u}) : + ∀ task ∈ eligibleTaskSet P G r μ A R U Labels, ∃ g ∈ G, + ZFSet.pair task g ∈ taskRepresentativeRelation + (eligibleTaskSet P G r μ A R U Labels) P G r A R U Labels := by + intro task ht + obtain ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, equal, code⟩ := + (mem_eligibleTaskSet P G r μ A R U Labels task).1 ht + obtain ⟨g, hg, represents⟩ := code.representative + exact ⟨g, hg, (pair_mem_taskRepresentativeRelation _ _ _ _ _ _ _ _ _ _).2 + ⟨ht, hg, a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, equal, represents⟩⟩ + +namespace BoundedFormula + +open SetFormula + +def taskRepresentativeFormula {n} (task g P r A R U Labels : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + exMem P (exMem P.succ (exMem R.succ.succ (exMem P.succ.succ.succ + (exMem U.succ.succ.succ.succ (exMem Labels.succ.succ.succ.succ.succ + (.conj (literalTaskFormula (lift task) 5 4 3 2 1 0) + (restrictedActionFormula (lift P) (lift r) (lift A) (lift g) 5 4 3))))))) + +theorem truth_taskRepresentativeFormula {n} (task g P r A R U Labels : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (taskRepresentativeFormula task g P r A R U Labels) env ↔ + TaskRepresentative (env P) (env r) (env A) (env R) (env U) (env Labels) (env task) (env g) := by + simp only [taskRepresentativeFormula, truth_exMem, Truth, truth_literalTaskFormula, + truth_restrictedActionFormula, TaskRepresentative] + rfl + +def taskRepresentativeEntryFormula {n} (z I P G r A R U Labels : Fin n) : BoundedFormula n := + exMem I (exMem G.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (taskRepresentativeFormula 1 0 P.succ.succ r.succ.succ A.succ.succ + R.succ.succ U.succ.succ Labels.succ.succ))) + +theorem truth_taskRepresentativeEntryFormula {n} (z I P G r A R U Labels : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (taskRepresentativeEntryFormula z I P G r A R U Labels) env ↔ + ∃ task ∈ env I, ∃ g ∈ env G, env z = ZFSet.pair task g ∧ + TaskRepresentative (env P) (env r) (env A) (env R) (env U) (env Labels) task g := by + simp only [taskRepresentativeEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_taskRepresentativeFormula] + rfl + +end BoundedFormula + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskTransportFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskTransportFormulas.lean index 7a516d1d29de6a85c6062c4475ec197d6b5b98a1..993112b27a8a702f9bc030ec02efa0f2c136d446 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskTransportFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TaskTransportFormulas.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundActionFilterImages -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundActionPostcomposition -import OAI.SetTheory.PartitionPrinciple.Forcing.TaskTransportCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def actionImageEqualityFormula {n} (P A g F output : Fin n) : BoundedFormula n := - .conj (.allMem output (.mem 0 P.succ)) - (.allMem P (.conj - (imp (.mem 0 output.succ) (actionImageFormula 0 A.succ g.succ F.succ)) - (imp (actionImageFormula 0 A.succ g.succ F.succ) (.mem 0 output.succ)))) - -theorem truth_actionImageEqualityFormula {n} (P A g F output : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (actionImageEqualityFormula P A g F output) env ↔ - env output = actionImage (env P) (env A) (env g) (env F) := by - simp only [actionImageEqualityFormula, Truth, truth_imp, truth_actionImageFormula, ← iff_def] - constructor - · rintro ⟨subset, entries⟩ - apply ZFSet.ext - intro y - rw [mem_actionImage] - exact ⟨fun hy => ⟨subset y hy, (entries y (subset y hy)).1 hy⟩, - fun hy => (entries y hy.1).2 hy.2⟩ - · intro equal - refine ⟨?_, ?_⟩ - · intro y hy - exact actionImage_subset _ _ _ _ (equal ▸ hy) - · intro y hy - change y ∈ env output ↔ ∃ x ∈ env F, ZFSet.pair (ZFSet.pair (env g) x) y ∈ env A - rw [equal, mem_actionImage] - exact ⟨And.right, fun h => ⟨hy, h⟩⟩ - -def taskTransportFormula {n} (P R U Labels A g t t' : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ - exMem P (exMem P.succ (exMem R.succ.succ (exMem P.succ.succ.succ - (exMem U.succ.succ.succ.succ (exMem Labels.succ.succ.succ.succ.succ - (exMem P.succ.succ.succ.succ.succ.succ - (exMem R.succ.succ.succ.succ.succ.succ.succ - (exMem P.succ.succ.succ.succ.succ.succ.succ.succ - (exMem U.succ.succ.succ.succ.succ.succ.succ.succ.succ - (.conj (literalTaskFormula (lift t) 9 8 7 6 5 4) - (.conj (literalTaskFormula (lift t') 9 3 2 1 0 4) - (.conj (tripleMembershipFormula (lift g) 8 3 (lift A)) - (.conj (tripleMembershipFormula (lift g) 6 1 (lift A)) - (.conj (actionPostcomposeFormula (lift P) (lift A) (lift g) 7 2) - (actionImageEqualityFormula (lift P) (lift A) (lift g) 5 0))))))))))))))) - -theorem truth_taskTransportFormula {n} (P R U Labels A g t t' : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (taskTransportFormula P R U Labels A g t t') env ↔ - TaskTransportCode (env P) (env R) (env U) (env Labels) (env A) (env g) (env t) (env t') := by - simp only [taskTransportFormula, truth_exMem, Truth, truth_literalTaskFormula, - truth_tripleMembershipFormula, truth_actionPostcomposeFormula, truth_actionImageEqualityFormula] - rfl - -def taskTransportEntryFormula {n} (z G I P R U Labels A : Fin n) : BoundedFormula n := - exMem G (exMem I.succ (exMem I.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) - (taskTransportFormula P.succ.succ.succ R.succ.succ.succ U.succ.succ.succ - Labels.succ.succ.succ A.succ.succ.succ 2 1 0)))) - -theorem truth_taskTransportEntryFormula {n} (z G I P R U Labels A : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (taskTransportEntryFormula z G I P R U Labels A) env ↔ - ∃ g ∈ env G, ∃ t ∈ env I, ∃ t' ∈ env I, - env z = ZFSet.pair (ZFSet.pair g t) t' ∧ - TaskTransportCode (env P) (env R) (env U) (env Labels) (env A) g t t' := by - simp only [taskTransportEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_taskTransportFormula] - rfl - -end PartitionPilot.Forcing.BoundedFormula - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundActionFilterImages +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundActionPostcomposition +import OAI.SetTheory.PartitionPrinciple.Forcing.TaskTransportCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def actionImageEqualityFormula {n} (P A g F output : Fin n) : BoundedFormula n := + .conj (.allMem output (.mem 0 P.succ)) + (.allMem P (.conj + (imp (.mem 0 output.succ) (actionImageFormula 0 A.succ g.succ F.succ)) + (imp (actionImageFormula 0 A.succ g.succ F.succ) (.mem 0 output.succ)))) + +theorem truth_actionImageEqualityFormula {n} (P A g F output : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (actionImageEqualityFormula P A g F output) env ↔ + env output = actionImage (env P) (env A) (env g) (env F) := by + simp only [actionImageEqualityFormula, Truth, truth_imp, truth_actionImageFormula, ← iff_def] + constructor + · rintro ⟨subset, entries⟩ + apply ZFSet.ext + intro y + rw [mem_actionImage] + exact ⟨fun hy => ⟨subset y hy, (entries y (subset y hy)).1 hy⟩, + fun hy => (entries y hy.1).2 hy.2⟩ + · intro equal + refine ⟨?_, ?_⟩ + · intro y hy + exact actionImage_subset _ _ _ _ (equal ▸ hy) + · intro y hy + change y ∈ env output ↔ ∃ x ∈ env F, ZFSet.pair (ZFSet.pair (env g) x) y ∈ env A + rw [equal, mem_actionImage] + exact ⟨And.right, fun h => ⟨hy, h⟩⟩ + +def taskTransportFormula {n} (P R U Labels A g t t' : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ + exMem P (exMem P.succ (exMem R.succ.succ (exMem P.succ.succ.succ + (exMem U.succ.succ.succ.succ (exMem Labels.succ.succ.succ.succ.succ + (exMem P.succ.succ.succ.succ.succ.succ + (exMem R.succ.succ.succ.succ.succ.succ.succ + (exMem P.succ.succ.succ.succ.succ.succ.succ.succ + (exMem U.succ.succ.succ.succ.succ.succ.succ.succ.succ + (.conj (literalTaskFormula (lift t) 9 8 7 6 5 4) + (.conj (literalTaskFormula (lift t') 9 3 2 1 0 4) + (.conj (tripleMembershipFormula (lift g) 8 3 (lift A)) + (.conj (tripleMembershipFormula (lift g) 6 1 (lift A)) + (.conj (actionPostcomposeFormula (lift P) (lift A) (lift g) 7 2) + (actionImageEqualityFormula (lift P) (lift A) (lift g) 5 0))))))))))))))) + +theorem truth_taskTransportFormula {n} (P R U Labels A g t t' : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (taskTransportFormula P R U Labels A g t t') env ↔ + TaskTransportCode (env P) (env R) (env U) (env Labels) (env A) (env g) (env t) (env t') := by + simp only [taskTransportFormula, truth_exMem, Truth, truth_literalTaskFormula, + truth_tripleMembershipFormula, truth_actionPostcomposeFormula, truth_actionImageEqualityFormula] + rfl + +def taskTransportEntryFormula {n} (z G I P R U Labels A : Fin n) : BoundedFormula n := + exMem G (exMem I.succ (exMem I.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) + (taskTransportFormula P.succ.succ.succ R.succ.succ.succ U.succ.succ.succ + Labels.succ.succ.succ A.succ.succ.succ 2 1 0)))) + +theorem truth_taskTransportEntryFormula {n} (z G I P R U Labels A : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (taskTransportEntryFormula z G I P R U Labels A) env ↔ + ∃ g ∈ env G, ∃ t ∈ env I, ∃ t' ∈ env I, + env z = ZFSet.pair (ZFSet.pair g t) t' ∧ + TaskTransportCode (env P) (env R) (env U) (env Labels) (env A) g t t' := by + simp only [taskTransportEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_taskTransportFormula] + rfl + +end PartitionPilot.Forcing.BoundedFormula + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TileStarIncidenceRealization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TileStarIncidenceRealization.lean index 6757989fed699233400a98b91a509f6898a7bdc9..d1ef7f840e4ef228980ae0d8709e588c15fb6ce0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TileStarIncidenceRealization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TileStarIncidenceRealization.lean @@ -1,211 +1,211 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTileStarIncidence - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps.CosetGeometry -universe u -variable {J S R : Type u} [Group J] -variable (e : Presentation (External J S)) (s : Presentation S) (r : Presentation R) -variable (q : Presentation (Vertex J S)) (request : S → R) -variable {C req gens mul : ZFSet.{u}} -variable (classed : ∀ w v, ZFSet.pair (e.encode w) (q.encode v) ∈ C ↔ point J S w = v) -variable (requested : ∀ a b, ZFSet.pair (s.encode a) (r.encode b) ∈ req ↔ request a = b) -variable (generated : ∀ a b, ZFSet.pair (s.encode a) (e.encode b) ∈ gens ↔ generator J S a = b) -variable (multiplied : ∀ a b c, ZFSet.pair (ZFSet.pair (e.encode a) (e.encode b)) (e.encode c) ∈ mul ↔ a * b = c) -local notation "vP" => tileStarVertexPresentation e r q -local notation "eP" => tileStarEdgePresentation e s r -local notation "dP" => tileStarDartPresentation e s r - -include classed requested generated multiplied in -theorem tileStar_source_entry (d : TileStars.Dart J S R) : - TileStarSourceEntry e.carrier r.carrier s.carrier q.carrier (tileStarEdgeCarrier e.carrier r.carrier s.carrier) - C req gens mul ((dP).encode d) ((vP).encode (TileStars.source J S R request d)) := by - rcases d with ⟨⟨w, a⟩ | ⟨w, a⟩, b⟩ <;> cases b - · exact ⟨(eP).encode (.inl (w, a)), (eP).encode_mem _, Or.inl - ⟨e.encode w, e.encode_mem w, r.encode a, r.encode_mem a, rfl, Or.inr ⟨rfl, rfl⟩⟩⟩ - · exact ⟨(eP).encode (.inl (w, a)), (eP).encode_mem _, Or.inl - ⟨e.encode w, e.encode_mem w, r.encode a, r.encode_mem a, rfl, Or.inl - ⟨rfl, q.encode (point J S w), q.encode_mem _, (classed _ _).2 rfl, rfl⟩⟩⟩ - · exact ⟨(eP).encode (.inr (w, a)), (eP).encode_mem _, Or.inr - ⟨e.encode w, e.encode_mem w, s.encode a, s.encode_mem a, rfl, Or.inr - ⟨rfl, e.encode (generator J S a), e.encode_mem _, e.encode (w * generator J S a), e.encode_mem _, - q.encode (point J S (w * generator J S a)), q.encode_mem _, (generated _ _).2 rfl, - (multiplied _ _ _).2 rfl, (classed _ _).2 rfl, rfl⟩⟩⟩ - · exact ⟨(eP).encode (.inr (w, a)), (eP).encode_mem _, Or.inr - ⟨e.encode w, e.encode_mem w, s.encode a, s.encode_mem a, rfl, Or.inl - ⟨rfl, r.encode (request a), r.encode_mem _, (requested _ _).2 rfl, rfl⟩⟩⟩ - -include classed requested generated multiplied in -theorem tileStar_source_entry_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : - TileStarSourceEntry e.carrier r.carrier s.carrier q.carrier (tileStarEdgeCarrier e.carrier r.carrier s.carrier) - C req gens mul ((dP).encode d) ((vP).encode v) ↔ TileStars.source J S R request d = v := by - constructor - · rintro ⟨edge, _, first | second⟩ - · obtain ⟨w, hw, a, ha, rfl, forward | backward⟩ := first - all_goals obtain ⟨w, rfl⟩ := (e.mem_carrier w).1 hw - all_goals obtain ⟨a, rfl⟩ := (r.mem_carrier a).1 ha - · obtain ⟨hd, c, hc, member, hv⟩ := forward - obtain ⟨c, rfl⟩ := (q.mem_carrier c).1 hc - have deq : d = (.inl (w, a), true) := (dP).injective hd - have veq : v = .inl c := (vP).injective hv - rw [deq, veq] - exact congrArg Sum.inl ((classed w c).1 member) - · obtain ⟨hd, hv⟩ := backward - have deq : d = (.inl (w, a), false) := (dP).injective hd - have veq : v = .inr (w, a) := (vP).injective hv - rw [deq, veq] - rfl - · obtain ⟨w, hw, a, ha, rfl, forward | backward⟩ := second - all_goals obtain ⟨w, rfl⟩ := (e.mem_carrier w).1 hw - all_goals obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha - · obtain ⟨hd, b, hb, member, hv⟩ := forward - obtain ⟨b, rfl⟩ := (r.mem_carrier b).1 hb - have deq : d = (.inr (w, a), true) := (dP).injective hd - have veq : v = .inr (w, b) := (vP).injective hv - rw [deq, veq] - exact congrArg (fun b => Sum.inr (w, b)) ((requested a b).1 member) - · obtain ⟨hd, k, hk, b, hb, c, hc, gen, product, member, hv⟩ := backward - obtain ⟨k, rfl⟩ := (e.mem_carrier k).1 hk - obtain ⟨b, rfl⟩ := (e.mem_carrier b).1 hb - obtain ⟨c, rfl⟩ := (q.mem_carrier c).1 hc - have deq : d = (.inr (w, a), false) := (dP).injective hd - have veq : v = .inl c := (vP).injective hv - rw [deq, veq] - change Sum.inl (point J S (w * generator J S a)) = Sum.inl c - rw [(generated a k).1 gen, (multiplied w k b).1 product, (classed b c).1 member] - · intro equal - rw [← equal] - exact tileStar_source_entry e s r q request classed requested generated multiplied d - -include classed requested generated multiplied in -theorem tileStar_source_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : - ZFSet.pair ((dP).encode d) ((vP).encode v) ∈ - tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul ↔ - TileStars.source J S R request d = v := by - rw [pair_mem_tileStarSourceGraph] - exact ⟨fun h => (tileStar_source_entry_iff e s r q request classed requested generated multiplied d v).1 h.2.2, - fun h => ⟨(dP).encode_mem d, (vP).encode_mem v, - (tileStar_source_entry_iff e s r q request classed requested generated multiplied d v).2 h⟩⟩ - -theorem tileStar_reverse_iff (d v : TileStars.Dart J S R) : - ZFSet.pair ((dP).encode d) ((dP).encode v) ∈ tileStarReverseGraph e.carrier r.carrier s.carrier ↔ - TileStars.reverse J S R d = v := by - rw [pair_mem_tileStarReverseGraph] - constructor - · rintro ⟨_, _, edge, he, ⟨hd, hv⟩ | ⟨hd, hv⟩⟩ - all_goals obtain ⟨edge, rfl⟩ := ((eP).mem_carrier edge).1 he - · have deq : d = (edge, false) := (dP).injective hd - have veq : v = (edge, true) := (dP).injective hv - rw [deq, veq]; rfl - · have deq : d = (edge, true) := (dP).injective hd - have veq : v = (edge, false) := (dP).injective hv - rw [deq, veq]; rfl - · intro equal - refine ⟨(dP).encode_mem d, (dP).encode_mem v, ?_⟩ - rw [← equal] - rcases d with ⟨edge, b⟩ - cases b - · exact ⟨(eP).encode edge, (eP).encode_mem edge, Or.inl ⟨rfl, rfl⟩⟩ - · exact ⟨(eP).encode edge, (eP).encode_mem edge, Or.inr ⟨rfl, rfl⟩⟩ - -include classed requested generated multiplied in -theorem tileStar_target_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : - ZFSet.pair ((dP).encode d) ((vP).encode v) ∈ - tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul ↔ - TileStars.target J S R request d = v := by - rw [tileStarTargetGraph, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, a, ha, hd, hv⟩ - obtain ⟨a, rfl⟩ := ((dP).mem_carrier a).1 ha - have rev := (tileStar_reverse_iff e s r d a).1 hd - have src := (tileStar_source_iff e s r q request classed requested generated multiplied a v).1 hv - change TileStars.source J S R request (TileStars.reverse J S R d) = v - rw [rev] - exact src - · intro equal - exact ⟨(dP).encode_mem d, (vP).encode_mem v, (dP).encode (TileStars.reverse J S R d), - (dP).encode_mem _, (tileStar_reverse_iff e s r _ _).2 rfl, - (tileStar_source_iff e s r q request classed requested generated multiplied _ _).2 equal⟩ - -theorem presentedGraph_eq {A B : Type u} (a : Presentation A) (b : Presentation B) - (f : A → B) {F : ZFSet.{u}} (shape : F ⊆ ZFSet.prod a.carrier b.carrier) - (entries : ∀ x y, ZFSet.pair (a.encode x) (b.encode y) ∈ F ↔ f x = y) : - F = a.graph b f := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shape hz) - obtain ⟨x, rfl⟩ := (a.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (b.mem_carrier y).1 hy - exact (a.pair_mem_graph b f x y).2 ((entries x y).1 hz) - · intro hz - obtain ⟨x, rfl⟩ := (a.mem_graph b f z).1 hz - exact (entries x (f x)).2 rfl - -include classed requested generated multiplied in -theorem tileStar_endpoint_graphs : - tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul = - (dP).graph (vP) (TileStars.source J S R request) ∧ - tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul = - (dP).graph (vP) (TileStars.target J S R request) ∧ - tileStarReverseGraph e.carrier r.carrier s.carrier = (dP).graph (dP) (TileStars.reverse J S R) := by - exact ⟨presentedGraph_eq (dP) (vP) _ (fun _ h => (ZFSet.mem_sep.1 h).1) - (tileStar_source_iff e s r q request classed requested generated multiplied), - presentedGraph_eq (dP) (vP) _ (by - intro z hz - unfold tileStarTargetGraph relationCompose at hz - exact (ZFSet.mem_sep.1 hz).1) - (tileStar_target_iff e s r q request classed requested generated multiplied), - presentedGraph_eq (dP) (dP) _ (fun _ h => (ZFSet.mem_sep.1 h).1) - (tileStar_reverse_iff e s r)⟩ - -include classed requested generated multiplied in -theorem tileStar_endpoint_functions : - ZFSet.IsFunc (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarVertexCarrier q.carrier e.carrier r.carrier) - (tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ∧ - ZFSet.IsFunc (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarVertexCarrier q.carrier e.carrier r.carrier) - (tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ∧ - ZFSet.IsFunc (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarDartCarrier e.carrier r.carrier s.carrier) - (tileStarReverseGraph e.carrier r.carrier s.carrier) := by - obtain ⟨source, target, reverse⟩ := tileStar_endpoint_graphs e s r q request classed requested generated multiplied - rw [source, target, reverse] - exact ⟨(dP).graph_isFunc (vP) _, (dP).graph_isFunc (vP) _, (dP).graph_isFunc (dP) _⟩ - -include classed requested generated multiplied in -theorem tileStar_incidence_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : - ZFSet.pair ((dP).encode d) ((vP).encode v) ∈ dartIncidenceGraph - (tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) - (tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ↔ - TileStars.source J S R request d = v ∨ TileStars.target J S R request d = v := by - rw [dartIncidenceGraph, ZFSet.mem_union, tileStar_source_iff e s r q request classed requested generated multiplied, - tileStar_target_iff e s r q request classed requested generated multiplied] - -include classed requested generated multiplied in -theorem tileStar_adjacency_iff (x y : TileStars.Vertex J S R) : - ZFSet.pair ((vP).encode x) ((vP).encode y) ∈ dartAdjacencyGraph - (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarVertexCarrier q.carrier e.carrier r.carrier) - (tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) - (tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ↔ - ∃ d : TileStars.Dart J S R, TileStars.source J S R request d = x ∧ TileStars.target J S R request d = y := by - rw [dartAdjacencyGraph, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, d, hd, hs, ht⟩ - obtain ⟨d, rfl⟩ := ((dP).mem_carrier d).1 hd - exact ⟨d, (tileStar_source_iff e s r q request classed requested generated multiplied d x).1 - ((pair_mem_relationConverse _ _ _ _ _).1 hs).2.2, - (tileStar_target_iff e s r q request classed requested generated multiplied d y).1 ht⟩ - · rintro ⟨d, hs, ht⟩ - exact ⟨(vP).encode_mem x, (vP).encode_mem y, (dP).encode d, (dP).encode_mem d, - (pair_mem_relationConverse _ _ _ _ _).2 ⟨(dP).encode_mem d, (vP).encode_mem x, - (tileStar_source_iff e s r q request classed requested generated multiplied d x).2 hs⟩, - (tileStar_target_iff e s r q request classed requested generated multiplied d y).2 ht⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTileStarIncidence + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps.CosetGeometry +universe u +variable {J S R : Type u} [Group J] +variable (e : Presentation (External J S)) (s : Presentation S) (r : Presentation R) +variable (q : Presentation (Vertex J S)) (request : S → R) +variable {C req gens mul : ZFSet.{u}} +variable (classed : ∀ w v, ZFSet.pair (e.encode w) (q.encode v) ∈ C ↔ point J S w = v) +variable (requested : ∀ a b, ZFSet.pair (s.encode a) (r.encode b) ∈ req ↔ request a = b) +variable (generated : ∀ a b, ZFSet.pair (s.encode a) (e.encode b) ∈ gens ↔ generator J S a = b) +variable (multiplied : ∀ a b c, ZFSet.pair (ZFSet.pair (e.encode a) (e.encode b)) (e.encode c) ∈ mul ↔ a * b = c) +local notation "vP" => tileStarVertexPresentation e r q +local notation "eP" => tileStarEdgePresentation e s r +local notation "dP" => tileStarDartPresentation e s r + +include classed requested generated multiplied in +theorem tileStar_source_entry (d : TileStars.Dart J S R) : + TileStarSourceEntry e.carrier r.carrier s.carrier q.carrier (tileStarEdgeCarrier e.carrier r.carrier s.carrier) + C req gens mul ((dP).encode d) ((vP).encode (TileStars.source J S R request d)) := by + rcases d with ⟨⟨w, a⟩ | ⟨w, a⟩, b⟩ <;> cases b + · exact ⟨(eP).encode (.inl (w, a)), (eP).encode_mem _, Or.inl + ⟨e.encode w, e.encode_mem w, r.encode a, r.encode_mem a, rfl, Or.inr ⟨rfl, rfl⟩⟩⟩ + · exact ⟨(eP).encode (.inl (w, a)), (eP).encode_mem _, Or.inl + ⟨e.encode w, e.encode_mem w, r.encode a, r.encode_mem a, rfl, Or.inl + ⟨rfl, q.encode (point J S w), q.encode_mem _, (classed _ _).2 rfl, rfl⟩⟩⟩ + · exact ⟨(eP).encode (.inr (w, a)), (eP).encode_mem _, Or.inr + ⟨e.encode w, e.encode_mem w, s.encode a, s.encode_mem a, rfl, Or.inr + ⟨rfl, e.encode (generator J S a), e.encode_mem _, e.encode (w * generator J S a), e.encode_mem _, + q.encode (point J S (w * generator J S a)), q.encode_mem _, (generated _ _).2 rfl, + (multiplied _ _ _).2 rfl, (classed _ _).2 rfl, rfl⟩⟩⟩ + · exact ⟨(eP).encode (.inr (w, a)), (eP).encode_mem _, Or.inr + ⟨e.encode w, e.encode_mem w, s.encode a, s.encode_mem a, rfl, Or.inl + ⟨rfl, r.encode (request a), r.encode_mem _, (requested _ _).2 rfl, rfl⟩⟩⟩ + +include classed requested generated multiplied in +theorem tileStar_source_entry_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : + TileStarSourceEntry e.carrier r.carrier s.carrier q.carrier (tileStarEdgeCarrier e.carrier r.carrier s.carrier) + C req gens mul ((dP).encode d) ((vP).encode v) ↔ TileStars.source J S R request d = v := by + constructor + · rintro ⟨edge, _, first | second⟩ + · obtain ⟨w, hw, a, ha, rfl, forward | backward⟩ := first + all_goals obtain ⟨w, rfl⟩ := (e.mem_carrier w).1 hw + all_goals obtain ⟨a, rfl⟩ := (r.mem_carrier a).1 ha + · obtain ⟨hd, c, hc, member, hv⟩ := forward + obtain ⟨c, rfl⟩ := (q.mem_carrier c).1 hc + have deq : d = (.inl (w, a), true) := (dP).injective hd + have veq : v = .inl c := (vP).injective hv + rw [deq, veq] + exact congrArg Sum.inl ((classed w c).1 member) + · obtain ⟨hd, hv⟩ := backward + have deq : d = (.inl (w, a), false) := (dP).injective hd + have veq : v = .inr (w, a) := (vP).injective hv + rw [deq, veq] + rfl + · obtain ⟨w, hw, a, ha, rfl, forward | backward⟩ := second + all_goals obtain ⟨w, rfl⟩ := (e.mem_carrier w).1 hw + all_goals obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha + · obtain ⟨hd, b, hb, member, hv⟩ := forward + obtain ⟨b, rfl⟩ := (r.mem_carrier b).1 hb + have deq : d = (.inr (w, a), true) := (dP).injective hd + have veq : v = .inr (w, b) := (vP).injective hv + rw [deq, veq] + exact congrArg (fun b => Sum.inr (w, b)) ((requested a b).1 member) + · obtain ⟨hd, k, hk, b, hb, c, hc, gen, product, member, hv⟩ := backward + obtain ⟨k, rfl⟩ := (e.mem_carrier k).1 hk + obtain ⟨b, rfl⟩ := (e.mem_carrier b).1 hb + obtain ⟨c, rfl⟩ := (q.mem_carrier c).1 hc + have deq : d = (.inr (w, a), false) := (dP).injective hd + have veq : v = .inl c := (vP).injective hv + rw [deq, veq] + change Sum.inl (point J S (w * generator J S a)) = Sum.inl c + rw [(generated a k).1 gen, (multiplied w k b).1 product, (classed b c).1 member] + · intro equal + rw [← equal] + exact tileStar_source_entry e s r q request classed requested generated multiplied d + +include classed requested generated multiplied in +theorem tileStar_source_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : + ZFSet.pair ((dP).encode d) ((vP).encode v) ∈ + tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul ↔ + TileStars.source J S R request d = v := by + rw [pair_mem_tileStarSourceGraph] + exact ⟨fun h => (tileStar_source_entry_iff e s r q request classed requested generated multiplied d v).1 h.2.2, + fun h => ⟨(dP).encode_mem d, (vP).encode_mem v, + (tileStar_source_entry_iff e s r q request classed requested generated multiplied d v).2 h⟩⟩ + +theorem tileStar_reverse_iff (d v : TileStars.Dart J S R) : + ZFSet.pair ((dP).encode d) ((dP).encode v) ∈ tileStarReverseGraph e.carrier r.carrier s.carrier ↔ + TileStars.reverse J S R d = v := by + rw [pair_mem_tileStarReverseGraph] + constructor + · rintro ⟨_, _, edge, he, ⟨hd, hv⟩ | ⟨hd, hv⟩⟩ + all_goals obtain ⟨edge, rfl⟩ := ((eP).mem_carrier edge).1 he + · have deq : d = (edge, false) := (dP).injective hd + have veq : v = (edge, true) := (dP).injective hv + rw [deq, veq]; rfl + · have deq : d = (edge, true) := (dP).injective hd + have veq : v = (edge, false) := (dP).injective hv + rw [deq, veq]; rfl + · intro equal + refine ⟨(dP).encode_mem d, (dP).encode_mem v, ?_⟩ + rw [← equal] + rcases d with ⟨edge, b⟩ + cases b + · exact ⟨(eP).encode edge, (eP).encode_mem edge, Or.inl ⟨rfl, rfl⟩⟩ + · exact ⟨(eP).encode edge, (eP).encode_mem edge, Or.inr ⟨rfl, rfl⟩⟩ + +include classed requested generated multiplied in +theorem tileStar_target_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : + ZFSet.pair ((dP).encode d) ((vP).encode v) ∈ + tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul ↔ + TileStars.target J S R request d = v := by + rw [tileStarTargetGraph, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, a, ha, hd, hv⟩ + obtain ⟨a, rfl⟩ := ((dP).mem_carrier a).1 ha + have rev := (tileStar_reverse_iff e s r d a).1 hd + have src := (tileStar_source_iff e s r q request classed requested generated multiplied a v).1 hv + change TileStars.source J S R request (TileStars.reverse J S R d) = v + rw [rev] + exact src + · intro equal + exact ⟨(dP).encode_mem d, (vP).encode_mem v, (dP).encode (TileStars.reverse J S R d), + (dP).encode_mem _, (tileStar_reverse_iff e s r _ _).2 rfl, + (tileStar_source_iff e s r q request classed requested generated multiplied _ _).2 equal⟩ + +theorem presentedGraph_eq {A B : Type u} (a : Presentation A) (b : Presentation B) + (f : A → B) {F : ZFSet.{u}} (shape : F ⊆ ZFSet.prod a.carrier b.carrier) + (entries : ∀ x y, ZFSet.pair (a.encode x) (b.encode y) ∈ F ↔ f x = y) : + F = a.graph b f := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shape hz) + obtain ⟨x, rfl⟩ := (a.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (b.mem_carrier y).1 hy + exact (a.pair_mem_graph b f x y).2 ((entries x y).1 hz) + · intro hz + obtain ⟨x, rfl⟩ := (a.mem_graph b f z).1 hz + exact (entries x (f x)).2 rfl + +include classed requested generated multiplied in +theorem tileStar_endpoint_graphs : + tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul = + (dP).graph (vP) (TileStars.source J S R request) ∧ + tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul = + (dP).graph (vP) (TileStars.target J S R request) ∧ + tileStarReverseGraph e.carrier r.carrier s.carrier = (dP).graph (dP) (TileStars.reverse J S R) := by + exact ⟨presentedGraph_eq (dP) (vP) _ (fun _ h => (ZFSet.mem_sep.1 h).1) + (tileStar_source_iff e s r q request classed requested generated multiplied), + presentedGraph_eq (dP) (vP) _ (by + intro z hz + unfold tileStarTargetGraph relationCompose at hz + exact (ZFSet.mem_sep.1 hz).1) + (tileStar_target_iff e s r q request classed requested generated multiplied), + presentedGraph_eq (dP) (dP) _ (fun _ h => (ZFSet.mem_sep.1 h).1) + (tileStar_reverse_iff e s r)⟩ + +include classed requested generated multiplied in +theorem tileStar_endpoint_functions : + ZFSet.IsFunc (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarVertexCarrier q.carrier e.carrier r.carrier) + (tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ∧ + ZFSet.IsFunc (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarVertexCarrier q.carrier e.carrier r.carrier) + (tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ∧ + ZFSet.IsFunc (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarDartCarrier e.carrier r.carrier s.carrier) + (tileStarReverseGraph e.carrier r.carrier s.carrier) := by + obtain ⟨source, target, reverse⟩ := tileStar_endpoint_graphs e s r q request classed requested generated multiplied + rw [source, target, reverse] + exact ⟨(dP).graph_isFunc (vP) _, (dP).graph_isFunc (vP) _, (dP).graph_isFunc (dP) _⟩ + +include classed requested generated multiplied in +theorem tileStar_incidence_iff (d : TileStars.Dart J S R) (v : TileStars.Vertex J S R) : + ZFSet.pair ((dP).encode d) ((vP).encode v) ∈ dartIncidenceGraph + (tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) + (tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ↔ + TileStars.source J S R request d = v ∨ TileStars.target J S R request d = v := by + rw [dartIncidenceGraph, ZFSet.mem_union, tileStar_source_iff e s r q request classed requested generated multiplied, + tileStar_target_iff e s r q request classed requested generated multiplied] + +include classed requested generated multiplied in +theorem tileStar_adjacency_iff (x y : TileStars.Vertex J S R) : + ZFSet.pair ((vP).encode x) ((vP).encode y) ∈ dartAdjacencyGraph + (tileStarDartCarrier e.carrier r.carrier s.carrier) (tileStarVertexCarrier q.carrier e.carrier r.carrier) + (tileStarSourceGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) + (tileStarTargetGraph e.carrier r.carrier s.carrier q.carrier C req gens mul) ↔ + ∃ d : TileStars.Dart J S R, TileStars.source J S R request d = x ∧ TileStars.target J S R request d = y := by + rw [dartAdjacencyGraph, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, d, hd, hs, ht⟩ + obtain ⟨d, rfl⟩ := ((dP).mem_carrier d).1 hd + exact ⟨d, (tileStar_source_iff e s r q request classed requested generated multiplied d x).1 + ((pair_mem_relationConverse _ _ _ _ _).1 hs).2.2, + (tileStar_target_iff e s r q request classed requested generated multiplied d y).1 ht⟩ + · rintro ⟨d, hs, ht⟩ + exact ⟨(vP).encode_mem x, (vP).encode_mem y, (dP).encode d, (dP).encode_mem d, + (pair_mem_relationConverse _ _ _ _ _).2 ⟨(dP).encode_mem d, (vP).encode_mem x, + (tileStar_source_iff e s r q request classed requested generated multiplied d x).2 hs⟩, + (tileStar_target_iff e s r q request classed requested generated multiplied d y).2 ht⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TupleRelationProducts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TupleRelationProducts.lean index 81fc8e900e79093dda4c5ec9c0546382d1ba2bdd..faf6e0f955eb3c7bba96c917654bc75600366935 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/TupleRelationProducts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/TupleRelationProducts.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableProducts - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def tupleRelationBound : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u} - | 0, f => ⋃₀ ⋃₀ f 0 - | k + 1, f => ZFSet.prod (⋃₀ ⋃₀ f 0) (tupleRelationBound k (fun j => f j.succ)) - -noncomputable def tupleRelationProduct : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u} - | 0, f => f 0 - | k + 1, f => relationProduct (⋃₀ ⋃₀ f 0) (tupleRelationBound k (fun j => f j.succ)) - (⋃₀ ⋃₀ f 0) (tupleRelationBound k (fun j => f j.succ)) (f 0) - (tupleRelationProduct k (fun j => f j.succ)) - -theorem mem_tupleRelationBound (k : Nat) (f x : Fin (k + 1) → ZFSet.{u}) : - nonemptyTupleCode k x ∈ tupleRelationBound k f ↔ ∀ j, x j ∈ ⋃₀ ⋃₀ f j := by - induction k with - | zero => - change x 0 ∈ ⋃₀ ⋃₀ f 0 ↔ _ - exact ⟨fun h => Fin.cases h (fun j => Fin.elim0 j), fun h => h 0⟩ - | succ k ih => - rw [tupleRelationBound, nonemptyTupleCode, ZFSet.pair_mem_prod, ih] - exact ⟨fun h => Fin.cases h.1 h.2, fun h => ⟨h 0, fun j => h j.succ⟩⟩ - -theorem pair_mem_tupleRelationProduct (k : Nat) (f x y : Fin (k + 1) → ZFSet.{u}) : - ZFSet.pair (nonemptyTupleCode k x) (nonemptyTupleCode k y) ∈ tupleRelationProduct k f ↔ - ∀ j, ZFSet.pair (x j) (y j) ∈ f j := by - induction k with - | zero => - change ZFSet.pair (x 0) (y 0) ∈ f 0 ↔ _ - exact ⟨fun h => Fin.cases h (fun j => Fin.elim0 j), fun h => h 0⟩ - | succ k ih => - rw [tupleRelationProduct, nonemptyTupleCode, nonemptyTupleCode, - pair_mem_relationProduct, ih] - constructor - · rintro ⟨_, _, _, _, first, rest⟩ - exact Fin.cases first rest - · intro entries - exact ⟨pair_first_mem_doubleUnion (entries 0), - (mem_tupleRelationBound k _ _).2 (fun j => pair_first_mem_doubleUnion (entries j.succ)), - pair_second_mem_doubleUnion (entries 0), - (mem_tupleRelationBound k _ _).2 (fun j => pair_second_mem_doubleUnion (entries j.succ)), - entries 0, fun j => entries j.succ⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem tupleRelationBound_mem (k : Nat) (f : Fin (k + 1) → ZFSet.{u}) - (ground : ∀ j, f j ∈ M.sets) : tupleRelationBound k f ∈ M.sets := by - induction k with - | zero => exact M.union_mem unions (M.union_mem unions (ground 0)) - | succ k ih => - exact M.prod_mem pairing unions powers separation - (M.union_mem unions (M.union_mem unions (ground 0))) (ih _ (fun j => ground j.succ)) - -theorem tupleRelationProduct_mem (k : Nat) (f : Fin (k + 1) → ZFSet.{u}) - (ground : ∀ j, f j ∈ M.sets) : tupleRelationProduct k f ∈ M.sets := by - induction k with - | zero => exact ground 0 - | succ k ih => - have first := M.union_mem unions (M.union_mem unions (ground 0)) - have rest := M.tupleRelationBound_mem pairing unions powers separation k _ (fun j => ground j.succ) - exact M.relationProduct_mem pairing unions powers separation first rest first rest - (ground 0) (ih _ (fun j => ground j.succ)) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableProducts + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def tupleRelationBound : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u} + | 0, f => ⋃₀ ⋃₀ f 0 + | k + 1, f => ZFSet.prod (⋃₀ ⋃₀ f 0) (tupleRelationBound k (fun j => f j.succ)) + +noncomputable def tupleRelationProduct : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u} + | 0, f => f 0 + | k + 1, f => relationProduct (⋃₀ ⋃₀ f 0) (tupleRelationBound k (fun j => f j.succ)) + (⋃₀ ⋃₀ f 0) (tupleRelationBound k (fun j => f j.succ)) (f 0) + (tupleRelationProduct k (fun j => f j.succ)) + +theorem mem_tupleRelationBound (k : Nat) (f x : Fin (k + 1) → ZFSet.{u}) : + nonemptyTupleCode k x ∈ tupleRelationBound k f ↔ ∀ j, x j ∈ ⋃₀ ⋃₀ f j := by + induction k with + | zero => + change x 0 ∈ ⋃₀ ⋃₀ f 0 ↔ _ + exact ⟨fun h => Fin.cases h (fun j => Fin.elim0 j), fun h => h 0⟩ + | succ k ih => + rw [tupleRelationBound, nonemptyTupleCode, ZFSet.pair_mem_prod, ih] + exact ⟨fun h => Fin.cases h.1 h.2, fun h => ⟨h 0, fun j => h j.succ⟩⟩ + +theorem pair_mem_tupleRelationProduct (k : Nat) (f x y : Fin (k + 1) → ZFSet.{u}) : + ZFSet.pair (nonemptyTupleCode k x) (nonemptyTupleCode k y) ∈ tupleRelationProduct k f ↔ + ∀ j, ZFSet.pair (x j) (y j) ∈ f j := by + induction k with + | zero => + change ZFSet.pair (x 0) (y 0) ∈ f 0 ↔ _ + exact ⟨fun h => Fin.cases h (fun j => Fin.elim0 j), fun h => h 0⟩ + | succ k ih => + rw [tupleRelationProduct, nonemptyTupleCode, nonemptyTupleCode, + pair_mem_relationProduct, ih] + constructor + · rintro ⟨_, _, _, _, first, rest⟩ + exact Fin.cases first rest + · intro entries + exact ⟨pair_first_mem_doubleUnion (entries 0), + (mem_tupleRelationBound k _ _).2 (fun j => pair_first_mem_doubleUnion (entries j.succ)), + pair_second_mem_doubleUnion (entries 0), + (mem_tupleRelationBound k _ _).2 (fun j => pair_second_mem_doubleUnion (entries j.succ)), + entries 0, fun j => entries j.succ⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem tupleRelationBound_mem (k : Nat) (f : Fin (k + 1) → ZFSet.{u}) + (ground : ∀ j, f j ∈ M.sets) : tupleRelationBound k f ∈ M.sets := by + induction k with + | zero => exact M.union_mem unions (M.union_mem unions (ground 0)) + | succ k ih => + exact M.prod_mem pairing unions powers separation + (M.union_mem unions (M.union_mem unions (ground 0))) (ih _ (fun j => ground j.succ)) + +theorem tupleRelationProduct_mem (k : Nat) (f : Fin (k + 1) → ZFSet.{u}) + (ground : ∀ j, f j ∈ M.sets) : tupleRelationProduct k f ∈ M.sets := by + induction k with + | zero => exact ground 0 + | succ k ih => + have first := M.union_mem unions (M.union_mem unions (ground 0)) + have rest := M.tupleRelationBound_mem pairing unions powers separation k _ (fun j => ground j.succ) + exact M.relationProduct_mem pairing unions powers separation first rest first rest + (ground 0) (ih _ (fun j => ground j.succ)) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/UnionEntryFormula.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/UnionEntryFormula.lean index 67b6b2396c8144ca131eec772d8a7736ef285701..d3fe60a329ce5ea219a1412cbb59f51cbcf09a5d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/UnionEntryFormula.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/UnionEntryFormula.lean @@ -1,455 +1,455 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.NameOrbitBounds - -namespace OAI - - -namespace PartitionPilot.Forcing.SetFormula - -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} {s : Presentation P} - -theorem realize_pairing (U : Set ZFSet.{u}) - (pairs : ∀ x ∈ U, ∀ y ∈ U, ({x, y} : ZFSet.{u}) ∈ U) : - Realize U pairing Fin.elim0 := by - simp only [pairing, realize_ex, realize_imp, realize_disj, Realize] - intro x hx y hy - refine ⟨{x, y}, pairs x hx y hy, ?_⟩ - intro z _ - exact ⟨ZFSet.mem_pair.1, ZFSet.mem_pair.2⟩ - -theorem realize_union (D : Name.NameDomain s) (H : Set P) - (unions : ∀ x ∈ D.values H, ZFSet.sUnion x ∈ D.values H) : - Realize (D.values H) union Fin.elim0 := by - simp only [union, realize_ex, realize_imp, Realize] - intro x hx - refine ⟨ZFSet.sUnion x, unions x hx, ?_⟩ - intro z _ - constructor - · intro member - obtain ⟨w, wx, zw⟩ := ZFSet.mem_sUnion.1 member - exact ⟨w, D.values_transitive H hx wx, wx, zw⟩ - · rintro ⟨w, _, wx, zw⟩ - exact ZFSet.mem_sUnion.2 ⟨w, wx, zw⟩ - -variable {G : Type v} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (D : Name.NameDomain s) (F : NormalSubgroupFamily G) - -theorem realize_symmetric_pairing [OrderTop P] - (pairs : ∀ σ ∈ D.names, ∀ τ ∈ D.names, Name.unorderedPair ⊤ σ τ ∈ D.names) - (H : ConditionFilter P) : - Realize ((a.symmetricDomain s D F).values {p | H.mem p}) pairing Fin.elim0 := - realize_pairing _ (fun _ hx _ hy => a.symmetric_values_pair s D F pairs H hx hy) - -theorem realize_symmetric_union - (unions : ∀ τ ∈ D.names, Name.unionName τ ∈ D.names) (H : ConditionFilter P) : - Realize ((a.symmetricDomain s D F).values {p | H.mem p}) union Fin.elim0 := - realize_union _ _ (fun _ hx => a.symmetric_values_union s D F unions H hx) - -theorem symmetric_separation_scheme - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s D F))) - (separated : ∀ {n} (φ : SetFormula (n + 1)) - (env : Assignment (a.symmetricDomain s D F) n) τ, - τ ∈ (a.symmetricDomain s D F).names → - Name.separationName (a.symmetricDomain s D F) φ env τ ∈ D.names) - {n : Nat} (φ : SetFormula (n + 1)) (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ (a.symmetricDomain s D F).values {p | H.mem p}) - {x : ZFSet.{u}} (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : - ∃ y ∈ (a.symmetricDomain s D F).values {p | H.mem p}, - ∀ z, z ∈ y ↔ z ∈ x ∧ - Realize ((a.symmetricDomain s D F).values {p | H.mem p}) φ (extend z params) := by - refine ⟨ZFSet.sep (fun z => Realize ((a.symmetricDomain s D F).values {p | H.mem p}) - φ (extend z params)) x, - a.symmetric_values_separation_params s D F closed H generic φ (separated φ) params members hx, - ?_⟩ - intro z - exact ZFSet.mem_sep - -end PartitionPilot.Forcing.SetFormula - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) - -theorem unorderedPair_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : ({x, y} : ZFSet.{u}) ∈ M.sets := by - simp only [SetFormula.pairing, realize_ex, realize_imp, realize_disj, Realize] at pairing - obtain ⟨z, hz, spec⟩ := pairing x hx y hy - have eq : z = ({x, y} : ZFSet.{u}) := by - apply ZFSet.ext - intro w - rw [ZFSet.mem_pair] - constructor - · intro hw - exact (spec w (M.transitive hz hw)).1 hw - · intro hw - have hwM : w ∈ M.sets := by - rcases hw with rfl | rfl - · exact hx - · exact hy - exact (spec w hwM).2 hw - exact eq ▸ hz - -theorem orderedPair_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : ZFSet.pair x y ∈ M.sets := by - have singleton : ({x} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hx hx - exact M.unorderedPair_mem pairing singleton (M.unorderedPair_mem pairing hx hy) - -variable {P : Type u} (s : Presentation P) - -theorem pairName_code (one : P) (σ τ : Name s) : - (Name.unorderedPair one σ τ).val = - ({ZFSet.pair σ.val (s.encode one), ZFSet.pair τ.val (s.encode one)} : ZFSet.{u}) := by - apply ZFSet.ext - intro z - change z ∈ ZFSet.range (fun b : Bool => ZFSet.pair (if b then σ else τ).val (s.encode one)) ↔ _ - rw [ZFSet.mem_range, ZFSet.mem_pair] - constructor - · rintro ⟨b, eq⟩ - cases b with - | false => exact Or.inr eq.symm - | true => exact Or.inl eq.symm - · rintro (eq | eq) - · exact ⟨true, eq.symm⟩ - · exact ⟨false, eq.symm⟩ - -theorem pairName_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (one : P) (hone : s.encode one ∈ M.sets) {σ τ : Name s} - (hσ : σ ∈ (M.nameDomain s).names) (hτ : τ ∈ (M.nameDomain s).names) : - Name.unorderedPair one σ τ ∈ (M.nameDomain s).names := by - change (Name.unorderedPair one σ τ).val ∈ M.sets - rw [pairName_code] - exact M.unorderedPair_mem pairing (M.orderedPair_mem pairing hσ hone) - (M.orderedPair_mem pairing hτ hone) - -theorem symmetric_pairing {G : Type v} [Group G] [PartialOrder P] [OrderTop P] - (a : PosetAction G P) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : - Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) - SetFormula.pairing Fin.elim0 := - realize_symmetric_pairing a (M.nameDomain s) F - (fun _ hσ _ hτ => M.pairName_mem s pairing ⊤ - (M.transitive carrier (s.encode_mem ⊤)) hσ hτ) H - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def unorderedPairFormula {n : Nat} (z x y : Fin n) : SetFormula n := - .all (.conj - (imp (.mem 0 z.succ) (disj (.equal 0 x.succ) (.equal 0 y.succ))) - (imp (disj (.equal 0 x.succ) (.equal 0 y.succ)) (.mem 0 z.succ))) - -def orderedPairFormula {n : Nat} (z x y : Fin n) : SetFormula n := - ex (ex (.conj (unorderedPairFormula z.succ.succ 1 0) - (.conj (unorderedPairFormula 1 x.succ.succ x.succ.succ) - (unorderedPairFormula 0 x.succ.succ y.succ.succ)))) - -def pairMembershipFormula {n : Nat} (x y z : Fin n) : SetFormula n := - ex (.conj (orderedPairFormula 0 x.succ y.succ) (.mem 0 z.succ)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_unorderedPairFormula {n : Nat} (z x y : Fin n) - (env : Fin n → ZFSet.{u}) (hz : env z ∈ M.sets) (hx : env x ∈ M.sets) - (hy : env y ∈ M.sets) : - Realize M.sets (unorderedPairFormula z x y) env ↔ env z = ({env x, env y} : ZFSet.{u}) := by - simp only [unorderedPairFormula, realize_imp, realize_disj, Realize] - constructor - · intro spec - apply ZFSet.ext - intro w - rw [ZFSet.mem_pair] - constructor - · intro hw - exact (spec w (M.transitive hz hw)).1 hw - · intro hw - have hwM : w ∈ M.sets := by - rcases hw with rfl | rfl - · exact hx - · exact hy - exact (spec w hwM).2 hw - · intro eq w _ - change (w ∈ env z → w = env x ∨ w = env y) ∧ - ((w = env x ∨ w = env y) → w ∈ env z) - rw [eq] - exact ⟨ZFSet.mem_pair.1, ZFSet.mem_pair.2⟩ - -theorem realize_orderedPairFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n : Nat} (z x y : Fin n) (env : Fin n → ZFSet.{u}) - (hz : env z ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : - Realize M.sets (orderedPairFormula z x y) env ↔ env z = ZFSet.pair (env x) (env y) := by - simp only [orderedPairFormula, realize_ex] - constructor - · rintro ⟨a, ha, b, hb, shape, left, right⟩ - have hzab := (M.realize_unorderedPairFormula z.succ.succ 1 0 _ hz ha hb).1 shape - have haeq := (M.realize_unorderedPairFormula 1 x.succ.succ x.succ.succ _ ha hx hx).1 left - have hbeq := (M.realize_unorderedPairFormula 0 x.succ.succ y.succ.succ _ hb hx hy).1 right - change env z = ({a, b} : ZFSet.{u}) at hzab - change a = ({env x, env x} : ZFSet.{u}) at haeq - change b = ({env x, env y} : ZFSet.{u}) at hbeq - rw [haeq, hbeq, ZFSet.pair_eq_singleton] at hzab - exact hzab - · intro eq - have ha := M.unorderedPair_mem pairing hx hx - have hb := M.unorderedPair_mem pairing hx hy - refine ⟨{env x, env x}, ha, {env x, env y}, hb, ?_, ?_, ?_⟩ - · apply (M.realize_unorderedPairFormula z.succ.succ 1 0 _ hz ha hb).2 - change env z = ({{env x, env x}, {env x, env y}} : ZFSet.{u}) - simpa only [ZFSet.pair, ZFSet.pair_eq_singleton] using eq - · exact (M.realize_unorderedPairFormula 1 x.succ.succ x.succ.succ _ ha hx hx).2 rfl - · exact (M.realize_unorderedPairFormula 0 x.succ.succ y.succ.succ _ hb hx hy).2 rfl - -theorem realize_pairMembershipFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n : Nat} (x y z : Fin n) (env : Fin n → ZFSet.{u}) - (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) (hz : env z ∈ M.sets) : - Realize M.sets (pairMembershipFormula x y z) env ↔ ZFSet.pair (env x) (env y) ∈ env z := by - simp only [pairMembershipFormula, realize_ex] - constructor - · rintro ⟨w, hw, shape, member⟩ - have eq := (M.realize_orderedPairFormula pairing 0 x.succ y.succ _ hw hx hy).1 shape - change w = ZFSet.pair (env x) (env y) at eq - change w ∈ env z at member - exact eq ▸ member - · intro member - have hw := M.transitive hz member - exact ⟨ZFSet.pair (env x) (env y), hw, - (M.realize_orderedPairFormula pairing 0 x.succ y.succ _ hw hx hy).2 rfl, member⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem union_mem (unions : Realize M.sets SetFormula.union Fin.elim0) - {x : ZFSet.{u}} (hx : x ∈ M.sets) : ZFSet.sUnion x ∈ M.sets := by - simp only [SetFormula.union, realize_ex, realize_imp, Realize] at unions - obtain ⟨y, hy, spec⟩ := unions x hx - have eq : y = ZFSet.sUnion x := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sUnion] - constructor - · intro hz - obtain ⟨w, _, wx, zw⟩ := (spec z (M.transitive hy hz)).1 hz - exact ⟨w, wx, zw⟩ - · rintro ⟨w, wx, zw⟩ - have hw := M.transitive hx wx - exact (spec z (M.transitive hw zw)).2 ⟨w, hw, wx, zw⟩ - exact eq ▸ hy - -theorem binary_union_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : x ∪ y ∈ M.sets := by - have h := M.union_mem unions (M.unorderedPair_mem pairing hx hy) - simpa only [ZFSet.sUnion_pair] using h - -theorem power_witness (powers : Realize M.sets powerSet Fin.elim0) - {x : ZFSet.{u}} (hx : x ∈ M.sets) : - ∃ y ∈ M.sets, ∀ z ∈ M.sets, z ∈ y ↔ z ⊆ x := by - simp only [powerSet, realize_ex, realize_imp, Realize] at powers - obtain ⟨y, hy, spec⟩ := powers x hx - refine ⟨y, hy, fun z hz => ⟨?_, ?_⟩⟩ - · intro zy w wz - exact (spec z hz).1 zy w (M.transitive hz wz) wz - · intro subset - exact (spec z hz).2 (fun w _ hw => subset hw) - -theorem separation_mem (separation : SeparationSchema M.sets) - {n : Nat} (φ : SetFormula (n + 1)) (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {x : ZFSet.{u}} (hx : x ∈ M.sets) : - ZFSet.sep (fun z => Realize M.sets φ (extend z params)) x ∈ M.sets := by - obtain ⟨y, hy, spec⟩ := separation φ params members x hx - have eq : y = ZFSet.sep (fun z => Realize M.sets φ (extend z params)) x := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · intro hz - exact (spec z (M.transitive hy hz)).1 hz - · intro hz - exact (spec z (M.transitive hx hz.1)).2 hz - exact eq ▸ hy - -theorem exists_pair_bound (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : - ∃ C ∈ M.sets, ∀ x ∈ A, ∀ y ∈ B, ZFSet.pair x y ∈ C := by - obtain ⟨U, hU, specU⟩ := M.power_witness powers (M.binary_union_mem pairing unions hA hB) - obtain ⟨C, hC, specC⟩ := M.power_witness powers hU - refine ⟨C, hC, ?_⟩ - intro x hx y hy - have hxM := M.transitive hA hx - have hyM := M.transitive hB hy - apply (specC _ (M.orderedPair_mem pairing hxM hyM)).2 - intro z hz - rcases ZFSet.mem_pair.1 hz with rfl | rfl - · have single : ({x} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hxM hxM - apply (specU _ single).2 - intro w hw - have eq := ZFSet.mem_singleton.1 hw - exact ZFSet.mem_union.2 (Or.inl (eq ▸ hx)) - · apply (specU _ (M.unorderedPair_mem pairing hxM hyM)).2 - intro w hw - rcases ZFSet.mem_pair.1 hw with rfl | rfl - · exact ZFSet.mem_union.2 (Or.inl hx) - · exact ZFSet.mem_union.2 (Or.inr hy) - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def unionEntryFormula : SetFormula 4 := - ex <| ex <| ex <| ex <| ex <| - .conj (orderedPairFormula 5 4 3) <| - .conj (.mem 3 7) <| - .conj (.mem 1 7) <| - .conj (.mem 0 7) <| - .conj (pairMembershipFormula 2 1 6) <| - .conj (pairMembershipFormula 4 0 2) <| - .conj (pairMembershipFormula 3 1 8) (pairMembershipFormula 3 0 8) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_unionEntryFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (env : Fin 4 → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets unionEntryFormula env ↔ - ∃ x ∈ M.sets, ∃ p ∈ M.sets, ∃ ν ∈ M.sets, ∃ r ∈ M.sets, ∃ q ∈ M.sets, - env 0 = ZFSet.pair x p ∧ p ∈ env 2 ∧ r ∈ env 2 ∧ q ∈ env 2 ∧ - ZFSet.pair ν r ∈ env 1 ∧ ZFSet.pair x q ∈ ν ∧ - ZFSet.pair p r ∈ env 3 ∧ ZFSet.pair p q ∈ env 3 := by - simp only [unionEntryFormula, realize_ex] - apply exists_congr - intro x - apply and_congr_right - intro hx - apply exists_congr - intro p - apply and_congr_right - intro hp - apply exists_congr - intro ν - apply and_congr_right - intro hν - apply exists_congr - intro r - apply and_congr_right - intro hr - apply exists_congr - intro q - apply and_congr_right - intro hq - let e := extend q (extend r (extend ν (extend p (extend x env)))) - change (Realize M.sets (orderedPairFormula 5 4 3) e ∧ p ∈ env 2 ∧ r ∈ env 2 ∧ q ∈ env 2 ∧ - Realize M.sets (pairMembershipFormula 2 1 6) e ∧ - Realize M.sets (pairMembershipFormula 4 0 2) e ∧ - Realize M.sets (pairMembershipFormula 3 1 8) e ∧ - Realize M.sets (pairMembershipFormula 3 0 8) e) ↔ _ - rw [M.realize_orderedPairFormula pairing 5 4 3 e (members 0) hx hp, - M.realize_pairMembershipFormula pairing 2 1 6 e hν hr (members 1), - M.realize_pairMembershipFormula pairing 4 0 2 e hx hq hν, - M.realize_pairMembershipFormula pairing 3 1 8 e hp hr (members 3), - M.realize_pairMembershipFormula pairing 3 0 8 e hp hq (members 3)] - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.Name - -open SetRealization SetFormula -universe u -variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} - -theorem mem_eval_codedPower_iff (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) - (separated : ∀ {n} (φ : SetFormula (n + 1)) (env : Assignment D n) τ, - τ ∈ D.names → separationName D φ env τ ∈ D.names) - (τ : D.names) (W : ZFSet.{u}) - (bounded : ∀ σ ∈ D.names, σ.val ∈ W ↔ σ.val ⊆ (envelope τ.val).val) - (z : ZFSet.{u}) (hz : z ∈ D.values {p | H.mem p}) : - z ∈ eval {p | H.mem p} (codedPower D W) ↔ z ⊆ eval {p | H.mem p} τ.val := by - rw [mem_eval_codedPower] - constructor - · rintro ⟨σ, hσ, hW, rfl⟩ - have sub := eval_mono {p | H.mem p} ((bounded σ hσ).1 hW) - rwa [eval_envelope] at sub - · intro sub - obtain ⟨ν, hν, value⟩ := (NameDomain.mem_values D _ z).1 hz - let env : Assignment D 1 := extend ⟨ν, hν⟩ Fin.elim0 - let σ := separationName D (.mem 0 1) env τ.val - have hσ : σ ∈ D.names := separated (.mem 0 1) env τ.val τ.property - refine ⟨σ, hσ, (bounded σ hσ).2 (selectName_subset_envelope _ _), ?_⟩ - change eval {p | H.mem p} (separationName D (.mem 0 1) env τ.val) = z - rw [eval_separationName D H generic (.mem 0 1) env τ.property] - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep] - change (x ∈ eval {p | H.mem p} τ.val ∧ x ∈ eval {p | H.mem p} ν) ↔ x ∈ z - rw [value] - exact ⟨And.right, fun hx => ⟨sub hx, hx⟩⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.SetFormula - -universe u - -theorem realize_powerSet_of_witnesses (U : Set ZFSet.{u}) - (transitive : ∀ x ∈ U, ∀ z ∈ x, z ∈ U) - (witnesses : ∀ x ∈ U, ∃ y ∈ U, ∀ z ∈ U, z ∈ y ↔ z ⊆ x) : - Realize U powerSet Fin.elim0 := by - simp only [powerSet, realize_ex, realize_imp, Realize] - intro x hx - obtain ⟨y, hy, spec⟩ := witnesses x hx - refine ⟨y, hy, ?_⟩ - intro z hz - constructor - · intro zy w _ wz - exact (spec z hz).1 zy wz - · intro sub - exact (spec z hz).2 (fun w hw => sub w (transitive z hz w hw) hw) - -end PartitionPilot.Forcing.SetFormula - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.NameOrbitBounds + +namespace OAI + + +namespace PartitionPilot.Forcing.SetFormula + +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} {s : Presentation P} + +theorem realize_pairing (U : Set ZFSet.{u}) + (pairs : ∀ x ∈ U, ∀ y ∈ U, ({x, y} : ZFSet.{u}) ∈ U) : + Realize U pairing Fin.elim0 := by + simp only [pairing, realize_ex, realize_imp, realize_disj, Realize] + intro x hx y hy + refine ⟨{x, y}, pairs x hx y hy, ?_⟩ + intro z _ + exact ⟨ZFSet.mem_pair.1, ZFSet.mem_pair.2⟩ + +theorem realize_union (D : Name.NameDomain s) (H : Set P) + (unions : ∀ x ∈ D.values H, ZFSet.sUnion x ∈ D.values H) : + Realize (D.values H) union Fin.elim0 := by + simp only [union, realize_ex, realize_imp, Realize] + intro x hx + refine ⟨ZFSet.sUnion x, unions x hx, ?_⟩ + intro z _ + constructor + · intro member + obtain ⟨w, wx, zw⟩ := ZFSet.mem_sUnion.1 member + exact ⟨w, D.values_transitive H hx wx, wx, zw⟩ + · rintro ⟨w, _, wx, zw⟩ + exact ZFSet.mem_sUnion.2 ⟨w, wx, zw⟩ + +variable {G : Type v} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (D : Name.NameDomain s) (F : NormalSubgroupFamily G) + +theorem realize_symmetric_pairing [OrderTop P] + (pairs : ∀ σ ∈ D.names, ∀ τ ∈ D.names, Name.unorderedPair ⊤ σ τ ∈ D.names) + (H : ConditionFilter P) : + Realize ((a.symmetricDomain s D F).values {p | H.mem p}) pairing Fin.elim0 := + realize_pairing _ (fun _ hx _ hy => a.symmetric_values_pair s D F pairs H hx hy) + +theorem realize_symmetric_union + (unions : ∀ τ ∈ D.names, Name.unionName τ ∈ D.names) (H : ConditionFilter P) : + Realize ((a.symmetricDomain s D F).values {p | H.mem p}) union Fin.elim0 := + realize_union _ _ (fun _ hx => a.symmetric_values_union s D F unions H hx) + +theorem symmetric_separation_scheme + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s D F))) + (separated : ∀ {n} (φ : SetFormula (n + 1)) + (env : Assignment (a.symmetricDomain s D F) n) τ, + τ ∈ (a.symmetricDomain s D F).names → + Name.separationName (a.symmetricDomain s D F) φ env τ ∈ D.names) + {n : Nat} (φ : SetFormula (n + 1)) (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ (a.symmetricDomain s D F).values {p | H.mem p}) + {x : ZFSet.{u}} (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : + ∃ y ∈ (a.symmetricDomain s D F).values {p | H.mem p}, + ∀ z, z ∈ y ↔ z ∈ x ∧ + Realize ((a.symmetricDomain s D F).values {p | H.mem p}) φ (extend z params) := by + refine ⟨ZFSet.sep (fun z => Realize ((a.symmetricDomain s D F).values {p | H.mem p}) + φ (extend z params)) x, + a.symmetric_values_separation_params s D F closed H generic φ (separated φ) params members hx, + ?_⟩ + intro z + exact ZFSet.mem_sep + +end PartitionPilot.Forcing.SetFormula + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) + +theorem unorderedPair_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : ({x, y} : ZFSet.{u}) ∈ M.sets := by + simp only [SetFormula.pairing, realize_ex, realize_imp, realize_disj, Realize] at pairing + obtain ⟨z, hz, spec⟩ := pairing x hx y hy + have eq : z = ({x, y} : ZFSet.{u}) := by + apply ZFSet.ext + intro w + rw [ZFSet.mem_pair] + constructor + · intro hw + exact (spec w (M.transitive hz hw)).1 hw + · intro hw + have hwM : w ∈ M.sets := by + rcases hw with rfl | rfl + · exact hx + · exact hy + exact (spec w hwM).2 hw + exact eq ▸ hz + +theorem orderedPair_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : ZFSet.pair x y ∈ M.sets := by + have singleton : ({x} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hx hx + exact M.unorderedPair_mem pairing singleton (M.unorderedPair_mem pairing hx hy) + +variable {P : Type u} (s : Presentation P) + +theorem pairName_code (one : P) (σ τ : Name s) : + (Name.unorderedPair one σ τ).val = + ({ZFSet.pair σ.val (s.encode one), ZFSet.pair τ.val (s.encode one)} : ZFSet.{u}) := by + apply ZFSet.ext + intro z + change z ∈ ZFSet.range (fun b : Bool => ZFSet.pair (if b then σ else τ).val (s.encode one)) ↔ _ + rw [ZFSet.mem_range, ZFSet.mem_pair] + constructor + · rintro ⟨b, eq⟩ + cases b with + | false => exact Or.inr eq.symm + | true => exact Or.inl eq.symm + · rintro (eq | eq) + · exact ⟨true, eq.symm⟩ + · exact ⟨false, eq.symm⟩ + +theorem pairName_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (one : P) (hone : s.encode one ∈ M.sets) {σ τ : Name s} + (hσ : σ ∈ (M.nameDomain s).names) (hτ : τ ∈ (M.nameDomain s).names) : + Name.unorderedPair one σ τ ∈ (M.nameDomain s).names := by + change (Name.unorderedPair one σ τ).val ∈ M.sets + rw [pairName_code] + exact M.unorderedPair_mem pairing (M.orderedPair_mem pairing hσ hone) + (M.orderedPair_mem pairing hτ hone) + +theorem symmetric_pairing {G : Type v} [Group G] [PartialOrder P] [OrderTop P] + (a : PosetAction G P) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : + Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) + SetFormula.pairing Fin.elim0 := + realize_symmetric_pairing a (M.nameDomain s) F + (fun _ hσ _ hτ => M.pairName_mem s pairing ⊤ + (M.transitive carrier (s.encode_mem ⊤)) hσ hτ) H + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def unorderedPairFormula {n : Nat} (z x y : Fin n) : SetFormula n := + .all (.conj + (imp (.mem 0 z.succ) (disj (.equal 0 x.succ) (.equal 0 y.succ))) + (imp (disj (.equal 0 x.succ) (.equal 0 y.succ)) (.mem 0 z.succ))) + +def orderedPairFormula {n : Nat} (z x y : Fin n) : SetFormula n := + ex (ex (.conj (unorderedPairFormula z.succ.succ 1 0) + (.conj (unorderedPairFormula 1 x.succ.succ x.succ.succ) + (unorderedPairFormula 0 x.succ.succ y.succ.succ)))) + +def pairMembershipFormula {n : Nat} (x y z : Fin n) : SetFormula n := + ex (.conj (orderedPairFormula 0 x.succ y.succ) (.mem 0 z.succ)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_unorderedPairFormula {n : Nat} (z x y : Fin n) + (env : Fin n → ZFSet.{u}) (hz : env z ∈ M.sets) (hx : env x ∈ M.sets) + (hy : env y ∈ M.sets) : + Realize M.sets (unorderedPairFormula z x y) env ↔ env z = ({env x, env y} : ZFSet.{u}) := by + simp only [unorderedPairFormula, realize_imp, realize_disj, Realize] + constructor + · intro spec + apply ZFSet.ext + intro w + rw [ZFSet.mem_pair] + constructor + · intro hw + exact (spec w (M.transitive hz hw)).1 hw + · intro hw + have hwM : w ∈ M.sets := by + rcases hw with rfl | rfl + · exact hx + · exact hy + exact (spec w hwM).2 hw + · intro eq w _ + change (w ∈ env z → w = env x ∨ w = env y) ∧ + ((w = env x ∨ w = env y) → w ∈ env z) + rw [eq] + exact ⟨ZFSet.mem_pair.1, ZFSet.mem_pair.2⟩ + +theorem realize_orderedPairFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n : Nat} (z x y : Fin n) (env : Fin n → ZFSet.{u}) + (hz : env z ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) : + Realize M.sets (orderedPairFormula z x y) env ↔ env z = ZFSet.pair (env x) (env y) := by + simp only [orderedPairFormula, realize_ex] + constructor + · rintro ⟨a, ha, b, hb, shape, left, right⟩ + have hzab := (M.realize_unorderedPairFormula z.succ.succ 1 0 _ hz ha hb).1 shape + have haeq := (M.realize_unorderedPairFormula 1 x.succ.succ x.succ.succ _ ha hx hx).1 left + have hbeq := (M.realize_unorderedPairFormula 0 x.succ.succ y.succ.succ _ hb hx hy).1 right + change env z = ({a, b} : ZFSet.{u}) at hzab + change a = ({env x, env x} : ZFSet.{u}) at haeq + change b = ({env x, env y} : ZFSet.{u}) at hbeq + rw [haeq, hbeq, ZFSet.pair_eq_singleton] at hzab + exact hzab + · intro eq + have ha := M.unorderedPair_mem pairing hx hx + have hb := M.unorderedPair_mem pairing hx hy + refine ⟨{env x, env x}, ha, {env x, env y}, hb, ?_, ?_, ?_⟩ + · apply (M.realize_unorderedPairFormula z.succ.succ 1 0 _ hz ha hb).2 + change env z = ({{env x, env x}, {env x, env y}} : ZFSet.{u}) + simpa only [ZFSet.pair, ZFSet.pair_eq_singleton] using eq + · exact (M.realize_unorderedPairFormula 1 x.succ.succ x.succ.succ _ ha hx hx).2 rfl + · exact (M.realize_unorderedPairFormula 0 x.succ.succ y.succ.succ _ hb hx hy).2 rfl + +theorem realize_pairMembershipFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n : Nat} (x y z : Fin n) (env : Fin n → ZFSet.{u}) + (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) (hz : env z ∈ M.sets) : + Realize M.sets (pairMembershipFormula x y z) env ↔ ZFSet.pair (env x) (env y) ∈ env z := by + simp only [pairMembershipFormula, realize_ex] + constructor + · rintro ⟨w, hw, shape, member⟩ + have eq := (M.realize_orderedPairFormula pairing 0 x.succ y.succ _ hw hx hy).1 shape + change w = ZFSet.pair (env x) (env y) at eq + change w ∈ env z at member + exact eq ▸ member + · intro member + have hw := M.transitive hz member + exact ⟨ZFSet.pair (env x) (env y), hw, + (M.realize_orderedPairFormula pairing 0 x.succ y.succ _ hw hx hy).2 rfl, member⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem union_mem (unions : Realize M.sets SetFormula.union Fin.elim0) + {x : ZFSet.{u}} (hx : x ∈ M.sets) : ZFSet.sUnion x ∈ M.sets := by + simp only [SetFormula.union, realize_ex, realize_imp, Realize] at unions + obtain ⟨y, hy, spec⟩ := unions x hx + have eq : y = ZFSet.sUnion x := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sUnion] + constructor + · intro hz + obtain ⟨w, _, wx, zw⟩ := (spec z (M.transitive hy hz)).1 hz + exact ⟨w, wx, zw⟩ + · rintro ⟨w, wx, zw⟩ + have hw := M.transitive hx wx + exact (spec z (M.transitive hw zw)).2 ⟨w, hw, wx, zw⟩ + exact eq ▸ hy + +theorem binary_union_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : x ∪ y ∈ M.sets := by + have h := M.union_mem unions (M.unorderedPair_mem pairing hx hy) + simpa only [ZFSet.sUnion_pair] using h + +theorem power_witness (powers : Realize M.sets powerSet Fin.elim0) + {x : ZFSet.{u}} (hx : x ∈ M.sets) : + ∃ y ∈ M.sets, ∀ z ∈ M.sets, z ∈ y ↔ z ⊆ x := by + simp only [powerSet, realize_ex, realize_imp, Realize] at powers + obtain ⟨y, hy, spec⟩ := powers x hx + refine ⟨y, hy, fun z hz => ⟨?_, ?_⟩⟩ + · intro zy w wz + exact (spec z hz).1 zy w (M.transitive hz wz) wz + · intro subset + exact (spec z hz).2 (fun w _ hw => subset hw) + +theorem separation_mem (separation : SeparationSchema M.sets) + {n : Nat} (φ : SetFormula (n + 1)) (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {x : ZFSet.{u}} (hx : x ∈ M.sets) : + ZFSet.sep (fun z => Realize M.sets φ (extend z params)) x ∈ M.sets := by + obtain ⟨y, hy, spec⟩ := separation φ params members x hx + have eq : y = ZFSet.sep (fun z => Realize M.sets φ (extend z params)) x := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · intro hz + exact (spec z (M.transitive hy hz)).1 hz + · intro hz + exact (spec z (M.transitive hx hz.1)).2 hz + exact eq ▸ hy + +theorem exists_pair_bound (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : + ∃ C ∈ M.sets, ∀ x ∈ A, ∀ y ∈ B, ZFSet.pair x y ∈ C := by + obtain ⟨U, hU, specU⟩ := M.power_witness powers (M.binary_union_mem pairing unions hA hB) + obtain ⟨C, hC, specC⟩ := M.power_witness powers hU + refine ⟨C, hC, ?_⟩ + intro x hx y hy + have hxM := M.transitive hA hx + have hyM := M.transitive hB hy + apply (specC _ (M.orderedPair_mem pairing hxM hyM)).2 + intro z hz + rcases ZFSet.mem_pair.1 hz with rfl | rfl + · have single : ({x} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hxM hxM + apply (specU _ single).2 + intro w hw + have eq := ZFSet.mem_singleton.1 hw + exact ZFSet.mem_union.2 (Or.inl (eq ▸ hx)) + · apply (specU _ (M.unorderedPair_mem pairing hxM hyM)).2 + intro w hw + rcases ZFSet.mem_pair.1 hw with rfl | rfl + · exact ZFSet.mem_union.2 (Or.inl hx) + · exact ZFSet.mem_union.2 (Or.inr hy) + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def unionEntryFormula : SetFormula 4 := + ex <| ex <| ex <| ex <| ex <| + .conj (orderedPairFormula 5 4 3) <| + .conj (.mem 3 7) <| + .conj (.mem 1 7) <| + .conj (.mem 0 7) <| + .conj (pairMembershipFormula 2 1 6) <| + .conj (pairMembershipFormula 4 0 2) <| + .conj (pairMembershipFormula 3 1 8) (pairMembershipFormula 3 0 8) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_unionEntryFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (env : Fin 4 → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets unionEntryFormula env ↔ + ∃ x ∈ M.sets, ∃ p ∈ M.sets, ∃ ν ∈ M.sets, ∃ r ∈ M.sets, ∃ q ∈ M.sets, + env 0 = ZFSet.pair x p ∧ p ∈ env 2 ∧ r ∈ env 2 ∧ q ∈ env 2 ∧ + ZFSet.pair ν r ∈ env 1 ∧ ZFSet.pair x q ∈ ν ∧ + ZFSet.pair p r ∈ env 3 ∧ ZFSet.pair p q ∈ env 3 := by + simp only [unionEntryFormula, realize_ex] + apply exists_congr + intro x + apply and_congr_right + intro hx + apply exists_congr + intro p + apply and_congr_right + intro hp + apply exists_congr + intro ν + apply and_congr_right + intro hν + apply exists_congr + intro r + apply and_congr_right + intro hr + apply exists_congr + intro q + apply and_congr_right + intro hq + let e := extend q (extend r (extend ν (extend p (extend x env)))) + change (Realize M.sets (orderedPairFormula 5 4 3) e ∧ p ∈ env 2 ∧ r ∈ env 2 ∧ q ∈ env 2 ∧ + Realize M.sets (pairMembershipFormula 2 1 6) e ∧ + Realize M.sets (pairMembershipFormula 4 0 2) e ∧ + Realize M.sets (pairMembershipFormula 3 1 8) e ∧ + Realize M.sets (pairMembershipFormula 3 0 8) e) ↔ _ + rw [M.realize_orderedPairFormula pairing 5 4 3 e (members 0) hx hp, + M.realize_pairMembershipFormula pairing 2 1 6 e hν hr (members 1), + M.realize_pairMembershipFormula pairing 4 0 2 e hx hq hν, + M.realize_pairMembershipFormula pairing 3 1 8 e hp hr (members 3), + M.realize_pairMembershipFormula pairing 3 0 8 e hp hq (members 3)] + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.Name + +open SetRealization SetFormula +universe u +variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} + +theorem mem_eval_codedPower_iff (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) + (separated : ∀ {n} (φ : SetFormula (n + 1)) (env : Assignment D n) τ, + τ ∈ D.names → separationName D φ env τ ∈ D.names) + (τ : D.names) (W : ZFSet.{u}) + (bounded : ∀ σ ∈ D.names, σ.val ∈ W ↔ σ.val ⊆ (envelope τ.val).val) + (z : ZFSet.{u}) (hz : z ∈ D.values {p | H.mem p}) : + z ∈ eval {p | H.mem p} (codedPower D W) ↔ z ⊆ eval {p | H.mem p} τ.val := by + rw [mem_eval_codedPower] + constructor + · rintro ⟨σ, hσ, hW, rfl⟩ + have sub := eval_mono {p | H.mem p} ((bounded σ hσ).1 hW) + rwa [eval_envelope] at sub + · intro sub + obtain ⟨ν, hν, value⟩ := (NameDomain.mem_values D _ z).1 hz + let env : Assignment D 1 := extend ⟨ν, hν⟩ Fin.elim0 + let σ := separationName D (.mem 0 1) env τ.val + have hσ : σ ∈ D.names := separated (.mem 0 1) env τ.val τ.property + refine ⟨σ, hσ, (bounded σ hσ).2 (selectName_subset_envelope _ _), ?_⟩ + change eval {p | H.mem p} (separationName D (.mem 0 1) env τ.val) = z + rw [eval_separationName D H generic (.mem 0 1) env τ.property] + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep] + change (x ∈ eval {p | H.mem p} τ.val ∧ x ∈ eval {p | H.mem p} ν) ↔ x ∈ z + rw [value] + exact ⟨And.right, fun hx => ⟨sub hx, hx⟩⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.SetFormula + +universe u + +theorem realize_powerSet_of_witnesses (U : Set ZFSet.{u}) + (transitive : ∀ x ∈ U, ∀ z ∈ x, z ∈ U) + (witnesses : ∀ x ∈ U, ∃ y ∈ U, ∀ z ∈ U, z ∈ y ↔ z ⊆ x) : + Realize U powerSet Fin.elim0 := by + simp only [powerSet, realize_ex, realize_imp, Realize] + intro x hx + obtain ⟨y, hy, spec⟩ := witnesses x hx + refine ⟨y, hy, ?_⟩ + intro z hz + constructor + · intro zy w _ wz + exact (spec z hz).1 zy wz + · intro sub + exact (spec z hz).2 (fun w hw => sub w (transitive z hz w hw) hw) + +end PartitionPilot.Forcing.SetFormula + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Definability/VisibilityProfileFormulas.lean b/lean/OAI/SetTheory/PartitionPrinciple/Definability/VisibilityProfileFormulas.lean index 9548a60680844901faff06a22a22be2757c8dbeb..9f170d1dd9465c3003d2e87446928fa813f3d242 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Definability/VisibilityProfileFormulas.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Definability/VisibilityProfileFormulas.lean @@ -1,206 +1,206 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRepresentedDomainConditions - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetRealization SetFormula -universe u - -def stageOneRawProfile (M : TransitiveGround.{u}) (P r lower nodes nodeOrder visibility E bu aw : ZFSet.{u}) : Prop := - ∀ v ∈ nodes, ZFSet.pair E v ∈ nodeOrder → - ∃ V ∈ M.sets, ZFSet.pair v V ∈ visibility ∧ - stageOneRawForces M P r lower refinementProfileFormula ![bu, aw, V] - -def stageOneRawCompatibility (M : TransitiveGround.{u}) (P r lower visibility maps C idx bu aw : ZFSet.{u}) : Prop := - ∃ V ∈ M.sets, ∃ D ∈ M.sets, ZFSet.pair C V ∈ visibility ∧ ZFSet.pair idx D ∈ maps ∧ - stageOneRawForces M P r lower refinementCompatibilityFormula ![aw, V, bu, D] - -namespace SetFormula - -def stageOneProfileAt {n : Nat} (P r lower nodes nodeOrder visibility E bu aw : Fin n) : SetFormula n := - .all (imp (.mem 0 nodes.succ) - (imp (BoundedFormula.pairMembershipFormula E.succ 0 nodeOrder.succ).toFormula - (ex (.conj (BoundedFormula.pairMembershipFormula 1 0 visibility.succ.succ).toFormula - (stageOneForcingAt refinementProfileFormula lower.succ.succ P.succ.succ r.succ.succ - (extend bu.succ.succ (extend aw.succ.succ (extend 0 Fin.elim0)))))))) - -def stageOneCompatibilityAt {n : Nat} (P r lower visibility maps C idx bu aw : Fin n) : SetFormula n := - ex (ex (.conj (BoundedFormula.pairMembershipFormula C.succ.succ 1 visibility.succ.succ).toFormula - (.conj (BoundedFormula.pairMembershipFormula idx.succ.succ 0 maps.succ.succ).toFormula - (stageOneForcingAt refinementCompatibilityFormula lower.succ.succ P.succ.succ r.succ.succ - (extend aw.succ.succ (extend 1 (extend bu.succ.succ (extend 0 Fin.elim0)))))))) - -end SetFormula - -private theorem map_three {α β : Type*} (f : α → β) (a b c : α) : - (fun j : Fin 3 => f ((extend a (extend b (extend c Fin.elim0))) j)) = ![f a, f b, f c] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j - -private theorem map_four {α β : Type*} (f : α → β) (a b c d : α) : - (fun j : Fin 4 => f ((extend a (extend b (extend c (extend d Fin.elim0)))) j)) = ![f a, f b, f c, f d] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_stageOnePairLookup {n : Nat} (x y R : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (BoundedFormula.pairMembershipFormula x y R).toFormula env ↔ - ZFSet.pair (env x) (env y) ∈ env R := - (BoundedFormula.realize_toFormula M _ env members).trans (BoundedFormula.truth_pairMembershipFormula x y R env) - -theorem realize_stageOneProfileAt {n : Nat} (P r lower nodes nodeOrder visibility E bu aw : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (stageOneProfileAt P r lower nodes nodeOrder visibility E bu aw) env ↔ - stageOneRawProfile M (env P) (env r) (env lower) (env nodes) (env nodeOrder) (env visibility) - (env E) (env bu) (env aw) := by - rw [stageOneProfileAt] - change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ - constructor - · intro h v hv below - have hvM := M.transitive (members nodes) hv - have first := (realize_imp M.sets _ _ _).1 (h v hvM) hv - have selected := (realize_imp M.sets _ _ _).1 first - ((M.realize_stageOnePairLookup E.succ 0 nodeOrder.succ _ (Fin.cases hvM members)).2 below) - obtain ⟨V, hV, entry, forced⟩ := (realize_ex M.sets _ _).1 selected - refine ⟨V, hV, (M.realize_stageOnePairLookup 1 0 visibility.succ.succ _ - (Fin.cases hV (Fin.cases hvM members))).1 entry, ?_⟩ - have value := (M.realize_stageOneForcingAt _ _ _ _ _ _).1 forced - rw [map_three] at value - exact value - · intro h v hvM - apply (realize_imp M.sets _ _ _).2 - intro hv - apply (realize_imp M.sets _ _ _).2 - intro below - have relation := (M.realize_stageOnePairLookup E.succ 0 nodeOrder.succ _ (Fin.cases hvM members)).1 below - obtain ⟨V, hV, entry, forced⟩ := h v hv relation - apply (realize_ex M.sets _ _).2 - refine ⟨V, hV, (M.realize_stageOnePairLookup 1 0 visibility.succ.succ _ - (Fin.cases hV (Fin.cases hvM members))).2 entry, ?_⟩ - apply (M.realize_stageOneForcingAt _ _ _ _ _ _).2 - rw [map_three] - exact forced - -theorem realize_stageOneCompatibilityAt {n : Nat} (P r lower visibility maps C idx bu aw : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (stageOneCompatibilityAt P r lower visibility maps C idx bu aw) env ↔ - stageOneRawCompatibility M (env P) (env r) (env lower) (env visibility) (env maps) - (env C) (env idx) (env bu) (env aw) := by - rw [stageOneCompatibilityAt, realize_ex] - constructor - · rintro ⟨V, hV, body⟩ - obtain ⟨D, hD, visible, mapped, forced⟩ := (realize_ex M.sets _ _).1 body - refine ⟨V, hV, D, hD, - (M.realize_stageOnePairLookup C.succ.succ 1 visibility.succ.succ _ (Fin.cases hD (Fin.cases hV members))).1 visible, - (M.realize_stageOnePairLookup idx.succ.succ 0 maps.succ.succ _ (Fin.cases hD (Fin.cases hV members))).1 mapped, ?_⟩ - have value := (M.realize_stageOneForcingAt _ _ _ _ _ _).1 forced - rw [map_four] at value - exact value - · rintro ⟨V, hV, D, hD, visible, mapped, forced⟩ - refine ⟨V, hV, ?_⟩ - apply (realize_ex M.sets _ _).2 - refine ⟨D, hD, - (M.realize_stageOnePairLookup C.succ.succ 1 visibility.succ.succ _ (Fin.cases hD (Fin.cases hV members))).2 visible, - (M.realize_stageOnePairLookup idx.succ.succ 0 maps.succ.succ _ (Fin.cases hD (Fin.cases hV members))).2 mapped, ?_⟩ - apply (M.realize_stageOneForcingAt _ _ _ _ _ _).2 - rw [map_four] - exact forced - -end TransitiveGround - -end - -open SetFormula -universe u - -namespace SetFormula -def supportedEqualitySequenceFormula : SetFormula 6 := - .conj (BoundedFormula.functionFormula 0 1 2).toFormula - (.all (imp (.mem 0 1) (.all (imp (.mem 0 3) - (imp (BoundedFormula.pairMembershipFormula 1 0 4).toFormula - (.conj (BoundedFormula.pairMembershipFormula 1 0 5).toFormula - (BoundedFormula.pairMembershipFormula 0 7 6).toFormula)))))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_supportedEqualitySequenceFormula (env : Fin 6 → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets supportedEqualitySequenceFormula env ↔ - ZFSet.IsFunc (env 0) (env 1) (env 2) ∧ - ∀ v ∈ env 0, ∀ tau ∈ env 1, ZFSet.pair v tau ∈ env 2 → - ZFSet.pair v tau ∈ env 3 ∧ ZFSet.pair tau (env 5) ∈ env 4 := by - have function := (BoundedFormula.realize_toFormula M - (BoundedFormula.functionFormula 0 1 2) env members).trans - (BoundedFormula.truth_functionFormula 0 1 2 env) - constructor - · intro realized - refine ⟨function.1 realized.1, ?_⟩ - intro v hv tau ht entry - have hvM := M.transitive (members 0) hv - have htM := M.transitive (members 1) ht - have atNode := (realize_imp M.sets _ _ _).1 (realized.2 v hvM) hv - have atCode := (realize_imp M.sets _ _ _).1 (atNode tau htM) ht - have result := (realize_imp M.sets _ _ _).1 atCode - ((M.realize_stageOnePairLookup 1 0 4 _ (Fin.cases htM (Fin.cases hvM members))).2 entry) - exact ⟨(M.realize_stageOnePairLookup 1 0 5 _ (Fin.cases htM (Fin.cases hvM members))).1 result.1, - (M.realize_stageOnePairLookup 0 7 6 _ (Fin.cases htM (Fin.cases hvM members))).1 result.2⟩ - · rintro ⟨isFunction, meaning⟩ - refine ⟨function.2 isFunction, ?_⟩ - intro v hvM - apply (realize_imp M.sets _ _ _).2 - intro hv tau htM - apply (realize_imp M.sets _ _ _).2 - intro ht - apply (realize_imp M.sets _ _ _).2 - intro entry - have result := meaning v hv tau ht - ((M.realize_stageOnePairLookup 1 0 4 _ (Fin.cases htM (Fin.cases hvM members))).1 entry) - exact ⟨(M.realize_stageOnePairLookup 1 0 5 _ (Fin.cases htM (Fin.cases hvM members))).2 result.1, - (M.realize_stageOnePairLookup 0 7 6 _ (Fin.cases htM (Fin.cases hvM members))).2 result.2⟩ - -end TransitiveGround - -namespace SetFormula - -def visibilityProfileFormula : SetFormula 4 := - .all (imp (.mem 0 3) (.all (imp (BoundedFormula.pairMembershipFormula 1 0 3).toFormula - (.conj (imp (.mem 2 0) (.mem 1 5)) (imp (.mem 1 5) (.mem 2 0)))))) -end SetFormula - -namespace TransitiveGround -variable (N : TransitiveGround.{u}) - -theorem realize_visibilityProfileFormula (env : Fin 4 → ZFSet.{u}) - (members : ∀ i, env i ∈ N.sets) : - Realize N.sets visibilityProfileFormula env ↔ - ∀ v ∈ env 2, ∀ V ∈ N.sets, ZFSet.pair v V ∈ env 1 → (env 0 ∈ V ↔ v ∈ env 3) := by - constructor - · intro realized v hv V hV entry - have hvN := N.transitive (members 2) hv - have atNode := (realize_imp N.sets _ _ _).1 (realized v hvN) hv - have atValue := (realize_imp N.sets _ _ _).1 (atNode V hV) - ((N.realize_stageOnePairLookup 1 0 3 _ (Fin.cases hV (Fin.cases hvN members))).2 entry) - exact ⟨(realize_imp N.sets _ _ _).1 atValue.1, - (realize_imp N.sets _ _ _).1 atValue.2⟩ - · intro meaning v hvN - apply (realize_imp N.sets _ _ _).2 - intro hv V hV - apply (realize_imp N.sets _ _ _).2 - intro entry - have exactProfile := meaning v hv V hV - ((N.realize_stageOnePairLookup 1 0 3 _ (Fin.cases hV (Fin.cases hvN members))).1 entry) - exact ⟨(realize_imp N.sets _ _ _).2 exactProfile.1, - (realize_imp N.sets _ _ _).2 exactProfile.2⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRepresentedDomainConditions + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetRealization SetFormula +universe u + +def stageOneRawProfile (M : TransitiveGround.{u}) (P r lower nodes nodeOrder visibility E bu aw : ZFSet.{u}) : Prop := + ∀ v ∈ nodes, ZFSet.pair E v ∈ nodeOrder → + ∃ V ∈ M.sets, ZFSet.pair v V ∈ visibility ∧ + stageOneRawForces M P r lower refinementProfileFormula ![bu, aw, V] + +def stageOneRawCompatibility (M : TransitiveGround.{u}) (P r lower visibility maps C idx bu aw : ZFSet.{u}) : Prop := + ∃ V ∈ M.sets, ∃ D ∈ M.sets, ZFSet.pair C V ∈ visibility ∧ ZFSet.pair idx D ∈ maps ∧ + stageOneRawForces M P r lower refinementCompatibilityFormula ![aw, V, bu, D] + +namespace SetFormula + +def stageOneProfileAt {n : Nat} (P r lower nodes nodeOrder visibility E bu aw : Fin n) : SetFormula n := + .all (imp (.mem 0 nodes.succ) + (imp (BoundedFormula.pairMembershipFormula E.succ 0 nodeOrder.succ).toFormula + (ex (.conj (BoundedFormula.pairMembershipFormula 1 0 visibility.succ.succ).toFormula + (stageOneForcingAt refinementProfileFormula lower.succ.succ P.succ.succ r.succ.succ + (extend bu.succ.succ (extend aw.succ.succ (extend 0 Fin.elim0)))))))) + +def stageOneCompatibilityAt {n : Nat} (P r lower visibility maps C idx bu aw : Fin n) : SetFormula n := + ex (ex (.conj (BoundedFormula.pairMembershipFormula C.succ.succ 1 visibility.succ.succ).toFormula + (.conj (BoundedFormula.pairMembershipFormula idx.succ.succ 0 maps.succ.succ).toFormula + (stageOneForcingAt refinementCompatibilityFormula lower.succ.succ P.succ.succ r.succ.succ + (extend aw.succ.succ (extend 1 (extend bu.succ.succ (extend 0 Fin.elim0)))))))) + +end SetFormula + +private theorem map_three {α β : Type*} (f : α → β) (a b c : α) : + (fun j : Fin 3 => f ((extend a (extend b (extend c Fin.elim0))) j)) = ![f a, f b, f c] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j + +private theorem map_four {α β : Type*} (f : α → β) (a b c d : α) : + (fun j : Fin 4 => f ((extend a (extend b (extend c (extend d Fin.elim0)))) j)) = ![f a, f b, f c, f d] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_stageOnePairLookup {n : Nat} (x y R : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (BoundedFormula.pairMembershipFormula x y R).toFormula env ↔ + ZFSet.pair (env x) (env y) ∈ env R := + (BoundedFormula.realize_toFormula M _ env members).trans (BoundedFormula.truth_pairMembershipFormula x y R env) + +theorem realize_stageOneProfileAt {n : Nat} (P r lower nodes nodeOrder visibility E bu aw : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (stageOneProfileAt P r lower nodes nodeOrder visibility E bu aw) env ↔ + stageOneRawProfile M (env P) (env r) (env lower) (env nodes) (env nodeOrder) (env visibility) + (env E) (env bu) (env aw) := by + rw [stageOneProfileAt] + change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ + constructor + · intro h v hv below + have hvM := M.transitive (members nodes) hv + have first := (realize_imp M.sets _ _ _).1 (h v hvM) hv + have selected := (realize_imp M.sets _ _ _).1 first + ((M.realize_stageOnePairLookup E.succ 0 nodeOrder.succ _ (Fin.cases hvM members)).2 below) + obtain ⟨V, hV, entry, forced⟩ := (realize_ex M.sets _ _).1 selected + refine ⟨V, hV, (M.realize_stageOnePairLookup 1 0 visibility.succ.succ _ + (Fin.cases hV (Fin.cases hvM members))).1 entry, ?_⟩ + have value := (M.realize_stageOneForcingAt _ _ _ _ _ _).1 forced + rw [map_three] at value + exact value + · intro h v hvM + apply (realize_imp M.sets _ _ _).2 + intro hv + apply (realize_imp M.sets _ _ _).2 + intro below + have relation := (M.realize_stageOnePairLookup E.succ 0 nodeOrder.succ _ (Fin.cases hvM members)).1 below + obtain ⟨V, hV, entry, forced⟩ := h v hv relation + apply (realize_ex M.sets _ _).2 + refine ⟨V, hV, (M.realize_stageOnePairLookup 1 0 visibility.succ.succ _ + (Fin.cases hV (Fin.cases hvM members))).2 entry, ?_⟩ + apply (M.realize_stageOneForcingAt _ _ _ _ _ _).2 + rw [map_three] + exact forced + +theorem realize_stageOneCompatibilityAt {n : Nat} (P r lower visibility maps C idx bu aw : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (stageOneCompatibilityAt P r lower visibility maps C idx bu aw) env ↔ + stageOneRawCompatibility M (env P) (env r) (env lower) (env visibility) (env maps) + (env C) (env idx) (env bu) (env aw) := by + rw [stageOneCompatibilityAt, realize_ex] + constructor + · rintro ⟨V, hV, body⟩ + obtain ⟨D, hD, visible, mapped, forced⟩ := (realize_ex M.sets _ _).1 body + refine ⟨V, hV, D, hD, + (M.realize_stageOnePairLookup C.succ.succ 1 visibility.succ.succ _ (Fin.cases hD (Fin.cases hV members))).1 visible, + (M.realize_stageOnePairLookup idx.succ.succ 0 maps.succ.succ _ (Fin.cases hD (Fin.cases hV members))).1 mapped, ?_⟩ + have value := (M.realize_stageOneForcingAt _ _ _ _ _ _).1 forced + rw [map_four] at value + exact value + · rintro ⟨V, hV, D, hD, visible, mapped, forced⟩ + refine ⟨V, hV, ?_⟩ + apply (realize_ex M.sets _ _).2 + refine ⟨D, hD, + (M.realize_stageOnePairLookup C.succ.succ 1 visibility.succ.succ _ (Fin.cases hD (Fin.cases hV members))).2 visible, + (M.realize_stageOnePairLookup idx.succ.succ 0 maps.succ.succ _ (Fin.cases hD (Fin.cases hV members))).2 mapped, ?_⟩ + apply (M.realize_stageOneForcingAt _ _ _ _ _ _).2 + rw [map_four] + exact forced + +end TransitiveGround + +end + +open SetFormula +universe u + +namespace SetFormula +def supportedEqualitySequenceFormula : SetFormula 6 := + .conj (BoundedFormula.functionFormula 0 1 2).toFormula + (.all (imp (.mem 0 1) (.all (imp (.mem 0 3) + (imp (BoundedFormula.pairMembershipFormula 1 0 4).toFormula + (.conj (BoundedFormula.pairMembershipFormula 1 0 5).toFormula + (BoundedFormula.pairMembershipFormula 0 7 6).toFormula)))))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_supportedEqualitySequenceFormula (env : Fin 6 → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets supportedEqualitySequenceFormula env ↔ + ZFSet.IsFunc (env 0) (env 1) (env 2) ∧ + ∀ v ∈ env 0, ∀ tau ∈ env 1, ZFSet.pair v tau ∈ env 2 → + ZFSet.pair v tau ∈ env 3 ∧ ZFSet.pair tau (env 5) ∈ env 4 := by + have function := (BoundedFormula.realize_toFormula M + (BoundedFormula.functionFormula 0 1 2) env members).trans + (BoundedFormula.truth_functionFormula 0 1 2 env) + constructor + · intro realized + refine ⟨function.1 realized.1, ?_⟩ + intro v hv tau ht entry + have hvM := M.transitive (members 0) hv + have htM := M.transitive (members 1) ht + have atNode := (realize_imp M.sets _ _ _).1 (realized.2 v hvM) hv + have atCode := (realize_imp M.sets _ _ _).1 (atNode tau htM) ht + have result := (realize_imp M.sets _ _ _).1 atCode + ((M.realize_stageOnePairLookup 1 0 4 _ (Fin.cases htM (Fin.cases hvM members))).2 entry) + exact ⟨(M.realize_stageOnePairLookup 1 0 5 _ (Fin.cases htM (Fin.cases hvM members))).1 result.1, + (M.realize_stageOnePairLookup 0 7 6 _ (Fin.cases htM (Fin.cases hvM members))).1 result.2⟩ + · rintro ⟨isFunction, meaning⟩ + refine ⟨function.2 isFunction, ?_⟩ + intro v hvM + apply (realize_imp M.sets _ _ _).2 + intro hv tau htM + apply (realize_imp M.sets _ _ _).2 + intro ht + apply (realize_imp M.sets _ _ _).2 + intro entry + have result := meaning v hv tau ht + ((M.realize_stageOnePairLookup 1 0 4 _ (Fin.cases htM (Fin.cases hvM members))).1 entry) + exact ⟨(M.realize_stageOnePairLookup 1 0 5 _ (Fin.cases htM (Fin.cases hvM members))).2 result.1, + (M.realize_stageOnePairLookup 0 7 6 _ (Fin.cases htM (Fin.cases hvM members))).2 result.2⟩ + +end TransitiveGround + +namespace SetFormula + +def visibilityProfileFormula : SetFormula 4 := + .all (imp (.mem 0 3) (.all (imp (BoundedFormula.pairMembershipFormula 1 0 3).toFormula + (.conj (imp (.mem 2 0) (.mem 1 5)) (imp (.mem 1 5) (.mem 2 0)))))) +end SetFormula + +namespace TransitiveGround +variable (N : TransitiveGround.{u}) + +theorem realize_visibilityProfileFormula (env : Fin 4 → ZFSet.{u}) + (members : ∀ i, env i ∈ N.sets) : + Realize N.sets visibilityProfileFormula env ↔ + ∀ v ∈ env 2, ∀ V ∈ N.sets, ZFSet.pair v V ∈ env 1 → (env 0 ∈ V ↔ v ∈ env 3) := by + constructor + · intro realized v hv V hV entry + have hvN := N.transitive (members 2) hv + have atNode := (realize_imp N.sets _ _ _).1 (realized v hvN) hv + have atValue := (realize_imp N.sets _ _ _).1 (atNode V hV) + ((N.realize_stageOnePairLookup 1 0 3 _ (Fin.cases hV (Fin.cases hvN members))).2 entry) + exact ⟨(realize_imp N.sets _ _ _).1 atValue.1, + (realize_imp N.sets _ _ _).1 atValue.2⟩ + · intro meaning v hvN + apply (realize_imp N.sets _ _ _).2 + intro hv V hV + apply (realize_imp N.sets _ _ _).2 + intro entry + have exactProfile := meaning v hv V hV + ((N.realize_stageOnePairLookup 1 0 3 _ (Fin.cases hV (Fin.cases hvN members))).1 entry) + exact ⟨(realize_imp N.sets _ _ _).2 exactProfile.1, + (realize_imp N.sets _ _ _).2 exactProfile.2⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActionPostcompositionCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActionPostcompositionCodes.lean index 3e2ceb8eb7ba1be163d47f633fa3379713d1c41d..0b7931e6dd8415d1e97172b1952e548d2a9670e3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActionPostcompositionCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActionPostcompositionCodes.lean @@ -1,334 +1,334 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSingleAttachment - -namespace OAI - -namespace PartitionPilot.Forcing - -universe u - -structure RestrictedActionCode (P r A g source target base : ZFSet.{u}) : Prop where - shape : base ⊆ ZFSet.prod P P - target_entry : ZFSet.pair (ZFSet.pair g source) target ∈ A - entries : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ base ↔ - ZFSet.pair x source ∈ r ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A - -noncomputable def restrictedActionGraph (P r A g source : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ P, ∃ y ∈ P, z = ZFSet.pair x y ∧ - ZFSet.pair x source ∈ r ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A) (ZFSet.prod P P) - -theorem restrictedActionGraph_subset (P r A g source : ZFSet.{u}) : - restrictedActionGraph P r A g source ⊆ ZFSet.prod P P := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem pair_mem_restrictedActionGraph (P r A g source x y : ZFSet.{u}) : - ZFSet.pair x y ∈ restrictedActionGraph P r A g source ↔ - x ∈ P ∧ y ∈ P ∧ ZFSet.pair x source ∈ r ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A := by - rw [restrictedActionGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hx, hy⟩, a, _, b, _, eq, lower, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hx, hy, lower, entry⟩ - · rintro ⟨hx, hy, lower, entry⟩ - exact ⟨⟨hx, hy⟩, x, hx, y, hy, rfl, lower, entry⟩ - -theorem restrictedActionGraph_code {P r A g source target : ZFSet.{u}} - (target_entry : ZFSet.pair (ZFSet.pair g source) target ∈ A) : - RestrictedActionCode P r A g source target (restrictedActionGraph P r A g source) where - shape := restrictedActionGraph_subset P r A g source - target_entry := target_entry - entries x hx y hy := by simp only [pair_mem_restrictedActionGraph, hx, hy, true_and] - -namespace PosetActionCode - -open SetRealization - -variable {G P m inv e r A : ZFSet.{u}} (action : PosetActionCode G P m e r A) -include action - -theorem raw_order_iff (group : GroupCode G m inv e) (order : PartialOrderCode P r) - {g x y x' y' : ZFSet.{u}} (hg : g ∈ G) - (xx' : ZFSet.pair (ZFSet.pair g x) x' ∈ A) - (yy' : ZFSet.pair (ZFSet.pair g y) y' ∈ A) : - ZFSet.pair x' y' ∈ r ↔ ZFSet.pair x y ∈ r := by - have sx := ZFSet.pair_mem_prod.1 (action.function.1 xx') - have sy := ZFSet.pair_mem_prod.1 (action.function.1 yy') - have hx := (ZFSet.pair_mem_prod.1 sx.1).2 - have hy := (ZFSet.pair_mem_prod.1 sy.1).2 - let actor : SetMembers G := SetMembers.ofMem g hg - let X : SetMembers P := SetMembers.ofMem x hx - let Y : SetMembers P := SetMembers.ofMem y hy - have eqX : action.act actor X = SetMembers.ofMem x' sx.2 := by - apply (action.act_eq_iff actor X _).2 - simpa only [actor, X, SetMembers.raw_ofMem] using xx' - have eqY : action.act actor Y = SetMembers.ofMem y' sy.2 := by - apply (action.act_eq_iff actor Y _).2 - simpa only [actor, Y, SetMembers.raw_ofMem] using yy' - have law := action.act_le_iff group order actor X Y - rw [eqX, eqY] at law - change (ZFSet.pair (SetMembers.raw (SetMembers.ofMem x' sx.2)) - (SetMembers.raw (SetMembers.ofMem y' sy.2)) ∈ r ↔ - ZFSet.pair (SetMembers.raw X) (SetMembers.raw Y) ∈ r) at law - simpa only [X, Y, SetMembers.raw_ofMem] using law - -theorem raw_preimage (group : GroupCode G m inv e) {g y : ZFSet.{u}} - (hg : g ∈ G) (hy : y ∈ P) : - ∃ x ∈ P, ZFSet.pair (ZFSet.pair g x) y ∈ A := by - let := group.toGroup - let actor : SetMembers G := SetMembers.ofMem g hg - let Y : SetMembers P := SetMembers.ofMem y hy - let X := action.act actor⁻¹ Y - refine ⟨SetMembers.raw X, SetMembers.raw_mem X, ?_⟩ - simpa only [actor, Y, SetMembers.raw_ofMem] using - (action.act_eq_iff actor X Y).1 (action.act_inv_right group actor Y) - -theorem raw_map_meet {meetGraph : ZFSet.{u}} - (group : GroupCode G m inv e) (meet : MeetOrderCode P r meetGraph) - {g x y z x' y' z' : ZFSet.{u}} (hg : g ∈ G) - (xyz : ZFSet.pair (ZFSet.pair x y) z ∈ meetGraph) - (xx' : ZFSet.pair (ZFSet.pair g x) x' ∈ A) - (yy' : ZFSet.pair (ZFSet.pair g y) y' ∈ A) - (zz' : ZFSet.pair (ZFSet.pair g z) z' ∈ A) : - ZFSet.pair (ZFSet.pair x' y') z' ∈ meetGraph := by - have hx' := (ZFSet.pair_mem_prod.1 (action.function.1 xx')).2 - have hy' := (ZFSet.pair_mem_prod.1 (action.function.1 yy')).2 - have hz' := (ZFSet.pair_mem_prod.1 (action.function.1 zz')).2 - apply meet.pair_iff.2 - refine ⟨hx', hy', hz', - (action.raw_order_iff group meet.order hg zz' xx').2 (meet.lower_left x y z xyz), - (action.raw_order_iff group meet.order hg zz' yy').2 (meet.lower_right x y z xyz), ?_⟩ - intro w hw wx' wy' - obtain ⟨v, hv, vw⟩ := action.raw_preimage group hg hw - exact (action.raw_order_iff group meet.order hg vw zz').2 - (meet.greatest x y z v hv xyz - ((action.raw_order_iff group meet.order hg vw xx').1 wx') - ((action.raw_order_iff group meet.order hg vw yy').1 wy')) - -end PosetActionCode - -namespace RestrictedActionCode - -variable {P r A g source target base : ZFSet.{u}} -variable (code : RestrictedActionCode P r A g source target base) -include code - -theorem eq_graph : base = restrictedActionGraph P r A g source := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) - exact (pair_mem_restrictedActionGraph P r A g source x y).2 - ⟨hx, hy, (code.entries x hx y hy).1 hz⟩ - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 - (restrictedActionGraph_subset P r A g source hz) - exact (code.entries x hx y hy).2 - ((pair_mem_restrictedActionGraph P r A g source x y).1 hz).2.2 - -theorem entry_action {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ base) : - ZFSet.pair (ZFSet.pair g x) y ∈ A := by - have shape := ZFSet.pair_mem_prod.1 (code.shape entry) - exact ((code.entries x shape.1 y shape.2).1 entry).2 - -theorem base_function {G m e : ZFSet.{u}} (action : PosetActionCode G P m e r A) - (hg : g ∈ G) : ZFSet.IsFunc (attachmentIdeal P r source) P base := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) - exact ZFSet.pair_mem_prod.2 - ⟨(mem_attachmentIdeal P r source x).2 ⟨hx, ((code.entries x hx y hy).1 hz).1⟩, hy⟩ - · intro x hx - have parts := (mem_attachmentIdeal P r source x).1 hx - obtain ⟨y, entry, unique⟩ := action.function.2 (ZFSet.pair g x) - (ZFSet.pair_mem_prod.2 ⟨hg, parts.1⟩) - have hy := (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2 - exact ⟨y, (code.entries x parts.1 y hy).2 ⟨parts.2, entry⟩, - fun z hz => unique z (code.entry_action hz)⟩ - -theorem source_entry (order : PartialOrderCode P r) (hsource : source ∈ P) - (htarget : target ∈ P) : ZFSet.pair source target ∈ base := - (code.entries source hsource target htarget).2 - ⟨order.refl source hsource, code.target_entry⟩ - -theorem base_order {G m inv e : ZFSet.{u}} (group : GroupCode G m inv e) - (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) (hg : g ∈ G) - {x y x' y' : ZFSet.{u}} (xx' : ZFSet.pair x x' ∈ base) - (yy' : ZFSet.pair y y' ∈ base) : - ZFSet.pair x' y' ∈ r ↔ ZFSet.pair x y ∈ r := - action.raw_order_iff group order hg (code.entry_action xx') (code.entry_action yy') - -theorem base_meet {G m inv e μ : ZFSet.{u}} (group : GroupCode G m inv e) - (action : PosetActionCode G P m e r A) (meet : MeetOrderCode P r μ) (hg : g ∈ G) - {x y z x' y' z' : ZFSet.{u}} (xyz : ZFSet.pair (ZFSet.pair x y) z ∈ μ) - (xx' : ZFSet.pair x x' ∈ base) (yy' : ZFSet.pair y y' ∈ base) - (zz' : ZFSet.pair z z' ∈ base) : ZFSet.pair (ZFSet.pair x' y') z' ∈ μ := - action.raw_map_meet group meet hg xyz (code.entry_action xx') - (code.entry_action yy') (code.entry_action zz') - -theorem image_iff {G m inv e : ZFSet.{u}} (group : GroupCode G m inv e) - (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) - (hg : g ∈ G) {y : ZFSet.{u}} : - (∃ x ∈ attachmentIdeal P r source, ZFSet.pair x y ∈ base) ↔ - y ∈ attachmentIdeal P r target := by - constructor - · rintro ⟨x, hx, entry⟩ - have hy := (ZFSet.pair_mem_prod.1 (code.shape entry)).2 - exact (mem_attachmentIdeal P r target y).2 ⟨hy, - (action.raw_order_iff group order hg (code.entry_action entry) code.target_entry).2 - ((mem_attachmentIdeal P r source x).1 hx).2⟩ - · intro hy - have parts := (mem_attachmentIdeal P r target y).1 hy - obtain ⟨x, hx, entry⟩ := action.raw_preimage group hg parts.1 - have lower := (action.raw_order_iff group order hg entry code.target_entry).1 parts.2 - exact ⟨x, (mem_attachmentIdeal P r source x).2 ⟨hx, lower⟩, - (code.entries x hx y parts.1).2 ⟨lower, entry⟩⟩ - -theorem singleAttachmentInputs {G m inv e μ F separator : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hsource : source ∈ P) - (htarget : target ∈ P) (filter : MeetFilterCode P r μ F) - (hseparator : separator ∈ P) (lower : ZFSet.pair target separator ∈ r) - (strict : ZFSet.pair separator target ∉ r) - (upper : ∀ y ∈ F, ZFSet.pair separator y ∈ r) : - SingleAttachmentInputs P P r r μ μ base F source separator := by - have function := code.base_function action hg - have targetEntry := code.source_entry meet.order hsource htarget - have value_eq (b : ZFSet.{u}) (entry : ZFSet.pair source b ∈ base) : b = target := by - obtain ⟨v, _, unique⟩ := function.2 source - ((mem_attachmentIdeal P r source source).2 ⟨hsource, meet.order.refl source hsource⟩) - exact (unique b entry).trans (unique target targetEntry).symm - exact { - oldOrder := meet - templateOrder := meet - anchor_mem := hsource - base_function := function - base_order := fun _ _ _ _ xx' yy' => code.base_order group action meet.order hg xx' yy' - base_meet := fun _ _ _ _ _ _ xyz xx' yy' zz' => code.base_meet group action meet hg xyz xx' yy' zz' - filter := filter - separator_mem := hseparator - base_le_separator := fun b entry => (value_eq b entry).symm ▸ lower - separator_not_le_base := fun b entry => (value_eq b entry).symm ▸ strict - separator_le_upper := upper } - -end RestrictedActionCode - -noncomputable def actionPostcompose (P A g base : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun v => ∃ x ∈ P, ∃ z ∈ P, v = ZFSet.pair x z ∧ - ∃ y ∈ P, ZFSet.pair x y ∈ base ∧ ZFSet.pair (ZFSet.pair g y) z ∈ A) (ZFSet.prod P P) - -theorem actionPostcompose_subset (P A g base : ZFSet.{u}) : - actionPostcompose P A g base ⊆ ZFSet.prod P P := - fun _ hv => (ZFSet.mem_sep.1 hv).1 - -theorem pair_mem_actionPostcompose (P A g base x z : ZFSet.{u}) : - ZFSet.pair x z ∈ actionPostcompose P A g base ↔ - x ∈ P ∧ z ∈ P ∧ ∃ y ∈ P, - ZFSet.pair x y ∈ base ∧ ZFSet.pair (ZFSet.pair g y) z ∈ A := by - rw [actionPostcompose, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hx, hz⟩, a, _, b, _, equal, witness⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, hz, witness⟩ - · rintro ⟨hx, hz, witness⟩ - exact ⟨⟨hx, hz⟩, x, hx, z, hz, rfl, witness⟩ - -theorem PosetActionCode.raw_mul_iff {G P m e r A g h k x z : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) - (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) (hx : x ∈ P) (hz : z ∈ P) : - ZFSet.pair (ZFSet.pair k x) z ∈ A ↔ - ∃ y ∈ P, ZFSet.pair (ZFSet.pair h x) y ∈ A ∧ ZFSet.pair (ZFSet.pair g y) z ∈ A := by - constructor - · intro entry - obtain ⟨y, first, _⟩ := action.function.2 (ZFSet.pair h x) - (ZFSet.pair_mem_prod.2 ⟨hh, hx⟩) - have hy := (ZFSet.pair_mem_prod.1 (action.function.1 first)).2 - obtain ⟨w, second, _⟩ := action.function.2 (ZFSet.pair g y) - (ZFSet.pair_mem_prod.2 ⟨hg, hy⟩) - have hw := (ZFSet.pair_mem_prod.1 (action.function.1 second)).2 - have composed := action.mul g hg h hh k hk x hx y hy w hw product first second - obtain ⟨v, _, unique⟩ := action.function.2 (ZFSet.pair k x) - (ZFSet.pair_mem_prod.2 ⟨hk, hx⟩) - have equal : w = z := (unique w composed).trans (unique z entry).symm - exact ⟨y, hy, first, equal ▸ second⟩ - · rintro ⟨y, hy, first, second⟩ - exact action.mul g hg h hh k hk x hx y hy z hz product first second - -theorem actionPostcompose_one {G P m e r A base : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (shape : base ⊆ ZFSet.prod P P) : - actionPostcompose P A e base = base := by - apply ZFSet.ext - intro v - constructor - · intro hv - obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset P A e base hv) - obtain ⟨_, _, y, hy, entry, acted⟩ := (pair_mem_actionPostcompose P A e base x z).1 hv - have identity := action.one y hy - obtain ⟨w, _, unique⟩ := action.function.2 (ZFSet.pair e y) - (ZFSet.pair_mem_prod.1 (action.function.1 identity)).1 - have equal : z = y := (unique z acted).trans (unique y identity).symm - exact equal.symm ▸ entry - · intro hv - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shape hv) - exact (pair_mem_actionPostcompose P A e base x y).2 - ⟨hx, hy, y, hy, hv, action.one y hy⟩ - -theorem actionPostcompose_mul {G P m e r A base g h k : ZFSet.{u}} - (action : PosetActionCode G P m e r A) - (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) - (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) : - actionPostcompose P A k base = actionPostcompose P A g (actionPostcompose P A h base) := by - apply ZFSet.ext - intro v - constructor - · intro hv - obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset P A k base hv) - obtain ⟨hx, hz, y, hy, entry, acted⟩ := (pair_mem_actionPostcompose P A k base x z).1 hv - obtain ⟨w, hw, first, second⟩ := (action.raw_mul_iff hg hh hk product hy hz).1 acted - exact (pair_mem_actionPostcompose P A g (actionPostcompose P A h base) x z).2 - ⟨hx, hz, w, hw, (pair_mem_actionPostcompose P A h base x w).2 - ⟨hx, hw, y, hy, entry, first⟩, second⟩ - · intro hv - obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 - (actionPostcompose_subset P A g (actionPostcompose P A h base) hv) - obtain ⟨hx, hz, w, hw, entry, acted⟩ := - (pair_mem_actionPostcompose P A g (actionPostcompose P A h base) x z).1 hv - obtain ⟨_, _, y, hy, first, second⟩ := (pair_mem_actionPostcompose P A h base x w).1 entry - exact (pair_mem_actionPostcompose P A k base x z).2 - ⟨hx, hz, y, hy, first, (action.raw_mul_iff hg hh hk product hy hz).2 - ⟨w, hw, second, acted⟩⟩ - -theorem actionPostcompose_inverse {G P m inv e r A base g h : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (shape : base ⊆ ZFSet.prod P P) (hg : g ∈ G) (hh : h ∈ G) - (inverse : ZFSet.pair g h ∈ inv) : - actionPostcompose P A h (actionPostcompose P A g base) = base := by - rw [← actionPostcompose_mul action hh hg group.identity_mem (group.inv_mul g hg h hh inverse)] - exact actionPostcompose_one action shape - -theorem RestrictedActionCode.transport {G P m e r A g δ k source target target' base : ZFSet.{u}} - (code : RestrictedActionCode P r A g source target base) - (action : PosetActionCode G P m e r A) - (hg : g ∈ G) (hδ : δ ∈ G) (hk : k ∈ G) - (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) - (targetEntry : ZFSet.pair (ZFSet.pair δ target) target' ∈ A) : - RestrictedActionCode P r A k source target' (actionPostcompose P A δ base) := by - have firstShape := ZFSet.pair_mem_prod.1 (action.function.1 code.target_entry) - have hsource := (ZFSet.pair_mem_prod.1 firstShape.1).2 - have htarget := firstShape.2 - have htarget' := (ZFSet.pair_mem_prod.1 (action.function.1 targetEntry)).2 - refine ⟨actionPostcompose_subset P A δ base, - action.mul δ hδ g hg k hk source hsource target htarget target' htarget' - product code.target_entry targetEntry, ?_⟩ - intro x hx z hz - rw [pair_mem_actionPostcompose] - constructor - · rintro ⟨_, _, y, hy, entry, acted⟩ - have old := (code.entries x hx y hy).1 entry - exact ⟨old.1, (action.raw_mul_iff hδ hg hk product hx hz).2 ⟨y, hy, old.2, acted⟩⟩ - · rintro ⟨lower, entry⟩ - obtain ⟨y, hy, first, second⟩ := (action.raw_mul_iff hδ hg hk product hx hz).1 entry - exact ⟨hx, hz, y, hy, (code.entries x hx y hy).2 ⟨lower, first⟩, second⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSingleAttachment + +namespace OAI + +namespace PartitionPilot.Forcing + +universe u + +structure RestrictedActionCode (P r A g source target base : ZFSet.{u}) : Prop where + shape : base ⊆ ZFSet.prod P P + target_entry : ZFSet.pair (ZFSet.pair g source) target ∈ A + entries : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ base ↔ + ZFSet.pair x source ∈ r ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A + +noncomputable def restrictedActionGraph (P r A g source : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ P, ∃ y ∈ P, z = ZFSet.pair x y ∧ + ZFSet.pair x source ∈ r ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A) (ZFSet.prod P P) + +theorem restrictedActionGraph_subset (P r A g source : ZFSet.{u}) : + restrictedActionGraph P r A g source ⊆ ZFSet.prod P P := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem pair_mem_restrictedActionGraph (P r A g source x y : ZFSet.{u}) : + ZFSet.pair x y ∈ restrictedActionGraph P r A g source ↔ + x ∈ P ∧ y ∈ P ∧ ZFSet.pair x source ∈ r ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A := by + rw [restrictedActionGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hx, hy⟩, a, _, b, _, eq, lower, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hx, hy, lower, entry⟩ + · rintro ⟨hx, hy, lower, entry⟩ + exact ⟨⟨hx, hy⟩, x, hx, y, hy, rfl, lower, entry⟩ + +theorem restrictedActionGraph_code {P r A g source target : ZFSet.{u}} + (target_entry : ZFSet.pair (ZFSet.pair g source) target ∈ A) : + RestrictedActionCode P r A g source target (restrictedActionGraph P r A g source) where + shape := restrictedActionGraph_subset P r A g source + target_entry := target_entry + entries x hx y hy := by simp only [pair_mem_restrictedActionGraph, hx, hy, true_and] + +namespace PosetActionCode + +open SetRealization + +variable {G P m inv e r A : ZFSet.{u}} (action : PosetActionCode G P m e r A) +include action + +theorem raw_order_iff (group : GroupCode G m inv e) (order : PartialOrderCode P r) + {g x y x' y' : ZFSet.{u}} (hg : g ∈ G) + (xx' : ZFSet.pair (ZFSet.pair g x) x' ∈ A) + (yy' : ZFSet.pair (ZFSet.pair g y) y' ∈ A) : + ZFSet.pair x' y' ∈ r ↔ ZFSet.pair x y ∈ r := by + have sx := ZFSet.pair_mem_prod.1 (action.function.1 xx') + have sy := ZFSet.pair_mem_prod.1 (action.function.1 yy') + have hx := (ZFSet.pair_mem_prod.1 sx.1).2 + have hy := (ZFSet.pair_mem_prod.1 sy.1).2 + let actor : SetMembers G := SetMembers.ofMem g hg + let X : SetMembers P := SetMembers.ofMem x hx + let Y : SetMembers P := SetMembers.ofMem y hy + have eqX : action.act actor X = SetMembers.ofMem x' sx.2 := by + apply (action.act_eq_iff actor X _).2 + simpa only [actor, X, SetMembers.raw_ofMem] using xx' + have eqY : action.act actor Y = SetMembers.ofMem y' sy.2 := by + apply (action.act_eq_iff actor Y _).2 + simpa only [actor, Y, SetMembers.raw_ofMem] using yy' + have law := action.act_le_iff group order actor X Y + rw [eqX, eqY] at law + change (ZFSet.pair (SetMembers.raw (SetMembers.ofMem x' sx.2)) + (SetMembers.raw (SetMembers.ofMem y' sy.2)) ∈ r ↔ + ZFSet.pair (SetMembers.raw X) (SetMembers.raw Y) ∈ r) at law + simpa only [X, Y, SetMembers.raw_ofMem] using law + +theorem raw_preimage (group : GroupCode G m inv e) {g y : ZFSet.{u}} + (hg : g ∈ G) (hy : y ∈ P) : + ∃ x ∈ P, ZFSet.pair (ZFSet.pair g x) y ∈ A := by + let := group.toGroup + let actor : SetMembers G := SetMembers.ofMem g hg + let Y : SetMembers P := SetMembers.ofMem y hy + let X := action.act actor⁻¹ Y + refine ⟨SetMembers.raw X, SetMembers.raw_mem X, ?_⟩ + simpa only [actor, Y, SetMembers.raw_ofMem] using + (action.act_eq_iff actor X Y).1 (action.act_inv_right group actor Y) + +theorem raw_map_meet {meetGraph : ZFSet.{u}} + (group : GroupCode G m inv e) (meet : MeetOrderCode P r meetGraph) + {g x y z x' y' z' : ZFSet.{u}} (hg : g ∈ G) + (xyz : ZFSet.pair (ZFSet.pair x y) z ∈ meetGraph) + (xx' : ZFSet.pair (ZFSet.pair g x) x' ∈ A) + (yy' : ZFSet.pair (ZFSet.pair g y) y' ∈ A) + (zz' : ZFSet.pair (ZFSet.pair g z) z' ∈ A) : + ZFSet.pair (ZFSet.pair x' y') z' ∈ meetGraph := by + have hx' := (ZFSet.pair_mem_prod.1 (action.function.1 xx')).2 + have hy' := (ZFSet.pair_mem_prod.1 (action.function.1 yy')).2 + have hz' := (ZFSet.pair_mem_prod.1 (action.function.1 zz')).2 + apply meet.pair_iff.2 + refine ⟨hx', hy', hz', + (action.raw_order_iff group meet.order hg zz' xx').2 (meet.lower_left x y z xyz), + (action.raw_order_iff group meet.order hg zz' yy').2 (meet.lower_right x y z xyz), ?_⟩ + intro w hw wx' wy' + obtain ⟨v, hv, vw⟩ := action.raw_preimage group hg hw + exact (action.raw_order_iff group meet.order hg vw zz').2 + (meet.greatest x y z v hv xyz + ((action.raw_order_iff group meet.order hg vw xx').1 wx') + ((action.raw_order_iff group meet.order hg vw yy').1 wy')) + +end PosetActionCode + +namespace RestrictedActionCode + +variable {P r A g source target base : ZFSet.{u}} +variable (code : RestrictedActionCode P r A g source target base) +include code + +theorem eq_graph : base = restrictedActionGraph P r A g source := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) + exact (pair_mem_restrictedActionGraph P r A g source x y).2 + ⟨hx, hy, (code.entries x hx y hy).1 hz⟩ + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 + (restrictedActionGraph_subset P r A g source hz) + exact (code.entries x hx y hy).2 + ((pair_mem_restrictedActionGraph P r A g source x y).1 hz).2.2 + +theorem entry_action {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ base) : + ZFSet.pair (ZFSet.pair g x) y ∈ A := by + have shape := ZFSet.pair_mem_prod.1 (code.shape entry) + exact ((code.entries x shape.1 y shape.2).1 entry).2 + +theorem base_function {G m e : ZFSet.{u}} (action : PosetActionCode G P m e r A) + (hg : g ∈ G) : ZFSet.IsFunc (attachmentIdeal P r source) P base := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) + exact ZFSet.pair_mem_prod.2 + ⟨(mem_attachmentIdeal P r source x).2 ⟨hx, ((code.entries x hx y hy).1 hz).1⟩, hy⟩ + · intro x hx + have parts := (mem_attachmentIdeal P r source x).1 hx + obtain ⟨y, entry, unique⟩ := action.function.2 (ZFSet.pair g x) + (ZFSet.pair_mem_prod.2 ⟨hg, parts.1⟩) + have hy := (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2 + exact ⟨y, (code.entries x parts.1 y hy).2 ⟨parts.2, entry⟩, + fun z hz => unique z (code.entry_action hz)⟩ + +theorem source_entry (order : PartialOrderCode P r) (hsource : source ∈ P) + (htarget : target ∈ P) : ZFSet.pair source target ∈ base := + (code.entries source hsource target htarget).2 + ⟨order.refl source hsource, code.target_entry⟩ + +theorem base_order {G m inv e : ZFSet.{u}} (group : GroupCode G m inv e) + (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) (hg : g ∈ G) + {x y x' y' : ZFSet.{u}} (xx' : ZFSet.pair x x' ∈ base) + (yy' : ZFSet.pair y y' ∈ base) : + ZFSet.pair x' y' ∈ r ↔ ZFSet.pair x y ∈ r := + action.raw_order_iff group order hg (code.entry_action xx') (code.entry_action yy') + +theorem base_meet {G m inv e μ : ZFSet.{u}} (group : GroupCode G m inv e) + (action : PosetActionCode G P m e r A) (meet : MeetOrderCode P r μ) (hg : g ∈ G) + {x y z x' y' z' : ZFSet.{u}} (xyz : ZFSet.pair (ZFSet.pair x y) z ∈ μ) + (xx' : ZFSet.pair x x' ∈ base) (yy' : ZFSet.pair y y' ∈ base) + (zz' : ZFSet.pair z z' ∈ base) : ZFSet.pair (ZFSet.pair x' y') z' ∈ μ := + action.raw_map_meet group meet hg xyz (code.entry_action xx') + (code.entry_action yy') (code.entry_action zz') + +theorem image_iff {G m inv e : ZFSet.{u}} (group : GroupCode G m inv e) + (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) + (hg : g ∈ G) {y : ZFSet.{u}} : + (∃ x ∈ attachmentIdeal P r source, ZFSet.pair x y ∈ base) ↔ + y ∈ attachmentIdeal P r target := by + constructor + · rintro ⟨x, hx, entry⟩ + have hy := (ZFSet.pair_mem_prod.1 (code.shape entry)).2 + exact (mem_attachmentIdeal P r target y).2 ⟨hy, + (action.raw_order_iff group order hg (code.entry_action entry) code.target_entry).2 + ((mem_attachmentIdeal P r source x).1 hx).2⟩ + · intro hy + have parts := (mem_attachmentIdeal P r target y).1 hy + obtain ⟨x, hx, entry⟩ := action.raw_preimage group hg parts.1 + have lower := (action.raw_order_iff group order hg entry code.target_entry).1 parts.2 + exact ⟨x, (mem_attachmentIdeal P r source x).2 ⟨hx, lower⟩, + (code.entries x hx y parts.1).2 ⟨lower, entry⟩⟩ + +theorem singleAttachmentInputs {G m inv e μ F separator : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hsource : source ∈ P) + (htarget : target ∈ P) (filter : MeetFilterCode P r μ F) + (hseparator : separator ∈ P) (lower : ZFSet.pair target separator ∈ r) + (strict : ZFSet.pair separator target ∉ r) + (upper : ∀ y ∈ F, ZFSet.pair separator y ∈ r) : + SingleAttachmentInputs P P r r μ μ base F source separator := by + have function := code.base_function action hg + have targetEntry := code.source_entry meet.order hsource htarget + have value_eq (b : ZFSet.{u}) (entry : ZFSet.pair source b ∈ base) : b = target := by + obtain ⟨v, _, unique⟩ := function.2 source + ((mem_attachmentIdeal P r source source).2 ⟨hsource, meet.order.refl source hsource⟩) + exact (unique b entry).trans (unique target targetEntry).symm + exact { + oldOrder := meet + templateOrder := meet + anchor_mem := hsource + base_function := function + base_order := fun _ _ _ _ xx' yy' => code.base_order group action meet.order hg xx' yy' + base_meet := fun _ _ _ _ _ _ xyz xx' yy' zz' => code.base_meet group action meet hg xyz xx' yy' zz' + filter := filter + separator_mem := hseparator + base_le_separator := fun b entry => (value_eq b entry).symm ▸ lower + separator_not_le_base := fun b entry => (value_eq b entry).symm ▸ strict + separator_le_upper := upper } + +end RestrictedActionCode + +noncomputable def actionPostcompose (P A g base : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun v => ∃ x ∈ P, ∃ z ∈ P, v = ZFSet.pair x z ∧ + ∃ y ∈ P, ZFSet.pair x y ∈ base ∧ ZFSet.pair (ZFSet.pair g y) z ∈ A) (ZFSet.prod P P) + +theorem actionPostcompose_subset (P A g base : ZFSet.{u}) : + actionPostcompose P A g base ⊆ ZFSet.prod P P := + fun _ hv => (ZFSet.mem_sep.1 hv).1 + +theorem pair_mem_actionPostcompose (P A g base x z : ZFSet.{u}) : + ZFSet.pair x z ∈ actionPostcompose P A g base ↔ + x ∈ P ∧ z ∈ P ∧ ∃ y ∈ P, + ZFSet.pair x y ∈ base ∧ ZFSet.pair (ZFSet.pair g y) z ∈ A := by + rw [actionPostcompose, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hx, hz⟩, a, _, b, _, equal, witness⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, hz, witness⟩ + · rintro ⟨hx, hz, witness⟩ + exact ⟨⟨hx, hz⟩, x, hx, z, hz, rfl, witness⟩ + +theorem PosetActionCode.raw_mul_iff {G P m e r A g h k x z : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) + (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) (hx : x ∈ P) (hz : z ∈ P) : + ZFSet.pair (ZFSet.pair k x) z ∈ A ↔ + ∃ y ∈ P, ZFSet.pair (ZFSet.pair h x) y ∈ A ∧ ZFSet.pair (ZFSet.pair g y) z ∈ A := by + constructor + · intro entry + obtain ⟨y, first, _⟩ := action.function.2 (ZFSet.pair h x) + (ZFSet.pair_mem_prod.2 ⟨hh, hx⟩) + have hy := (ZFSet.pair_mem_prod.1 (action.function.1 first)).2 + obtain ⟨w, second, _⟩ := action.function.2 (ZFSet.pair g y) + (ZFSet.pair_mem_prod.2 ⟨hg, hy⟩) + have hw := (ZFSet.pair_mem_prod.1 (action.function.1 second)).2 + have composed := action.mul g hg h hh k hk x hx y hy w hw product first second + obtain ⟨v, _, unique⟩ := action.function.2 (ZFSet.pair k x) + (ZFSet.pair_mem_prod.2 ⟨hk, hx⟩) + have equal : w = z := (unique w composed).trans (unique z entry).symm + exact ⟨y, hy, first, equal ▸ second⟩ + · rintro ⟨y, hy, first, second⟩ + exact action.mul g hg h hh k hk x hx y hy z hz product first second + +theorem actionPostcompose_one {G P m e r A base : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (shape : base ⊆ ZFSet.prod P P) : + actionPostcompose P A e base = base := by + apply ZFSet.ext + intro v + constructor + · intro hv + obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset P A e base hv) + obtain ⟨_, _, y, hy, entry, acted⟩ := (pair_mem_actionPostcompose P A e base x z).1 hv + have identity := action.one y hy + obtain ⟨w, _, unique⟩ := action.function.2 (ZFSet.pair e y) + (ZFSet.pair_mem_prod.1 (action.function.1 identity)).1 + have equal : z = y := (unique z acted).trans (unique y identity).symm + exact equal.symm ▸ entry + · intro hv + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shape hv) + exact (pair_mem_actionPostcompose P A e base x y).2 + ⟨hx, hy, y, hy, hv, action.one y hy⟩ + +theorem actionPostcompose_mul {G P m e r A base g h k : ZFSet.{u}} + (action : PosetActionCode G P m e r A) + (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) + (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) : + actionPostcompose P A k base = actionPostcompose P A g (actionPostcompose P A h base) := by + apply ZFSet.ext + intro v + constructor + · intro hv + obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset P A k base hv) + obtain ⟨hx, hz, y, hy, entry, acted⟩ := (pair_mem_actionPostcompose P A k base x z).1 hv + obtain ⟨w, hw, first, second⟩ := (action.raw_mul_iff hg hh hk product hy hz).1 acted + exact (pair_mem_actionPostcompose P A g (actionPostcompose P A h base) x z).2 + ⟨hx, hz, w, hw, (pair_mem_actionPostcompose P A h base x w).2 + ⟨hx, hw, y, hy, entry, first⟩, second⟩ + · intro hv + obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 + (actionPostcompose_subset P A g (actionPostcompose P A h base) hv) + obtain ⟨hx, hz, w, hw, entry, acted⟩ := + (pair_mem_actionPostcompose P A g (actionPostcompose P A h base) x z).1 hv + obtain ⟨_, _, y, hy, first, second⟩ := (pair_mem_actionPostcompose P A h base x w).1 entry + exact (pair_mem_actionPostcompose P A k base x z).2 + ⟨hx, hz, y, hy, first, (action.raw_mul_iff hg hh hk product hy hz).2 + ⟨w, hw, second, acted⟩⟩ + +theorem actionPostcompose_inverse {G P m inv e r A base g h : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (shape : base ⊆ ZFSet.prod P P) (hg : g ∈ G) (hh : h ∈ G) + (inverse : ZFSet.pair g h ∈ inv) : + actionPostcompose P A h (actionPostcompose P A g base) = base := by + rw [← actionPostcompose_mul action hh hg group.identity_mem (group.inv_mul g hg h hh inverse)] + exact actionPostcompose_one action shape + +theorem RestrictedActionCode.transport {G P m e r A g δ k source target target' base : ZFSet.{u}} + (code : RestrictedActionCode P r A g source target base) + (action : PosetActionCode G P m e r A) + (hg : g ∈ G) (hδ : δ ∈ G) (hk : k ∈ G) + (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) + (targetEntry : ZFSet.pair (ZFSet.pair δ target) target' ∈ A) : + RestrictedActionCode P r A k source target' (actionPostcompose P A δ base) := by + have firstShape := ZFSet.pair_mem_prod.1 (action.function.1 code.target_entry) + have hsource := (ZFSet.pair_mem_prod.1 firstShape.1).2 + have htarget := firstShape.2 + have htarget' := (ZFSet.pair_mem_prod.1 (action.function.1 targetEntry)).2 + refine ⟨actionPostcompose_subset P A δ base, + action.mul δ hδ g hg k hk source hsource target htarget target' htarget' + product code.target_entry targetEntry, ?_⟩ + intro x hx z hz + rw [pair_mem_actionPostcompose] + constructor + · rintro ⟨_, _, y, hy, entry, acted⟩ + have old := (code.entries x hx y hy).1 entry + exact ⟨old.1, (action.raw_mul_iff hδ hg hk product hx hz).2 ⟨y, hy, old.2, acted⟩⟩ + · rintro ⟨lower, entry⟩ + obtain ⟨y, hy, first, second⟩ := (action.raw_mul_iff hδ hg hk product hx hz).1 entry + exact ⟨hx, hz, y, hy, (code.entries x hx y hy).2 ⟨lower, first⟩, second⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActiveNameImageSymmetry.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActiveNameImageSymmetry.lean index 27dd37f5d29cd7bca4a84c41621138943db97d69..a6132a7f0408c1a9452d953c4df8576bf5ee450a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActiveNameImageSymmetry.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ActiveNameImageSymmetry.lean @@ -1,265 +1,265 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs -import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps - -namespace OAI - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -noncomputable def activeImage (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U : Name s) (image : Name s → Name s) : Name s := - assemble - (fun a : {a : T × P // ForcesMem a.2 ⟨a.1.val, valid a.1.val a.1.property⟩ U} => - image ⟨a.val.1.val, valid a.val.1.val a.val.1.property⟩) - (fun a => a.val.2) - -theorem entry_activeImage (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U : Name s) (image : Name s → Name s) (σ : Name s) (p : P) : - Entry σ (activeImage T valid U image) p ↔ - ∃ w : Name s, w.val ∈ T ∧ ForcesMem p w U ∧ image w = σ := by - rw [activeImage, entry_assemble] - constructor - · rintro ⟨a, equal, condition⟩ - refine ⟨⟨a.val.1.val, valid a.val.1.val a.val.1.property⟩, a.val.1.property, ?_, equal⟩ - exact condition ▸ a.property - · rintro ⟨w, hw, forced, equal⟩ - exact ⟨⟨(⟨w.val, hw⟩, p), forced⟩, equal, rfl⟩ - -theorem activeImage_subset (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U : Name s) (image : Name s → Name s) (F : ZFSet.{u}) - (images : ∀ w : Name s, w.val ∈ T → (image w).val ∈ F) : - (activeImage T valid U image).val ⊆ ZFSet.prod F s.carrier := by - intro z hz - obtain ⟨σ, p, rfl⟩ := entries_cover (activeImage T valid U image) hz - obtain ⟨w, hw, _, rfl⟩ := (entry_activeImage T valid U image σ p).1 hz - exact ZFSet.pair_mem_prod.2 ⟨images w hw, s.encode_mem p⟩ - -theorem activeImage_congr (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U : Name s) (image other : Name s → Name s) - (equal : ∀ w : Name s, w.val ∈ T → image w = other w) : - activeImage T valid U image = activeImage T valid U other := by - apply Name.ext - intro σ p - rw [entry_activeImage, entry_activeImage] - constructor - · rintro ⟨w, hw, forced, entry⟩ - exact ⟨w, hw, forced, (equal w hw).symm.trans entry⟩ - · rintro ⟨w, hw, forced, entry⟩ - exact ⟨w, hw, forced, (equal w hw).trans entry⟩ - -theorem mem_eval_activeImage (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U : Name s) (image : Name s → Name s) (hU : U ∈ D.names) - (terms : ∀ w : Name s, w.val ∈ T → w ∈ D.names) (x : ZFSet.{u}) : - x ∈ eval {p | H.mem p} (activeImage T valid U image) ↔ - ∃ w : Name s, w.val ∈ T ∧ eval {p | H.mem p} w ∈ eval {p | H.mem p} U ∧ - eval {p | H.mem p} (image w) = x := by - rw [mem_eval] - constructor - · rintro ⟨σ, p, entry, hp, equal⟩ - obtain ⟨w, hw, forced, rfl⟩ := (entry_activeImage T valid U image σ p).1 entry - exact ⟨w, hw, forcesMem_sound D H generic (terms w hw) hU hp forced, equal⟩ - · rintro ⟨w, hw, active, equal⟩ - obtain ⟨p, hp, forced⟩ := (eval_mem_iff_forcesMem D H generic (terms w hw) hU).1 active - exact ⟨image w, p, (entry_activeImage T valid U image (image w) p).2 - ⟨w, hw, forced, rfl⟩, hp, equal⟩ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} [PartialOrder P] {s : Presentation P} -variable {G : Type v} [Group G] (a : PosetAction G P) - -theorem act_activeImage (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - (g : G) (U : Name s) (image other : Name s → Name s) - (equivariant : ∀ w : Name s, w.val ∈ T → - a.act s g (image w) = other (a.act s g w)) : - a.act s g (activeImage T valid U image) = - activeImage T valid (a.act s g U) other := by - apply Name.ext - intro σ p - change Entry σ (rename s (a.iso g) (activeImage T valid U image)) p ↔ _ - rw [entry_rename, entry_activeImage] - constructor - · rintro ⟨ν, q, entry, equal, rfl⟩ - obtain ⟨w, hw, forced, rfl⟩ := (entry_activeImage T valid U image ν q).1 entry - exact ⟨a.act s g w, closed g w hw, a.forcesMem_act s g forced, - (equivariant w hw).symm.trans equal⟩ - · rintro ⟨w, hw, forced, equal⟩ - have oldMember := closed g⁻¹ w hw - have oldForced : ForcesMem ((a.iso g).symm p) (a.act s g⁻¹ w) U := by - apply (a.forcesMem_act_iff s g ((a.iso g).symm p) (a.act s g⁻¹ w) U).1 - simpa only [OrderIso.apply_symm_apply, a.act_inv_right] using forced - refine ⟨image (a.act s g⁻¹ w), (a.iso g).symm p, - (entry_activeImage T valid U image _ _).2 ⟨a.act s g⁻¹ w, oldMember, oldForced, rfl⟩, - ?_, (a.iso g).apply_symm_apply p⟩ - change a.act s g (image (a.act s g⁻¹ w)) = σ - rw [equivariant _ oldMember, a.act_inv_right] - exact equal - -theorem activeImage_support (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - (U : Name s) (image : Name s → Name s) (K : Subgroup G) - (activity : K ≤ a.stabilizer s U) - (equivariant : ∀ g ∈ K, ∀ w : Name s, w.val ∈ T → - a.act s g (image w) = image (a.act s g w)) : - K ≤ a.stabilizer s (activeImage T valid U image) := by - intro g hg - change a.act s g _ = _ - rw [act_activeImage a T valid closed g U image image (equivariant g hg), activity hg] - -theorem activeImage_hs (F : NormalSubgroupFamily G) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - (U : Name s) (image : Name s → Name s) (K : Subgroup G) (member : F.mem K) - (activity : K ≤ a.stabilizer s U) - (equivariant : ∀ g ∈ K, ∀ w : Name s, w.val ∈ T → - a.act s g (image w) = image (a.act s g w)) - (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F (image w)) : - HereditarilySymmetric a s F (activeImage T valid U image) := by - refine HereditarilySymmetric.mk - (F.upward member (activeImage_support a T valid closed U image K activity equivariant)) ?_ - intro σ p entry - obtain ⟨w, hw, _, rfl⟩ := (entry_activeImage T valid U image σ p).1 entry - exact children w hw - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace SetFormula - -def activeNameImageEntryFormula : SetFormula 6 := - ex (ex (ex (.conj (.mem 2 4) (.conj (.mem 0 7) - (.conj (orderedPairFormula 3 1 0) - (.conj (pairMembershipFormula 2 1 6) - (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) - ![7, 8] 0 ![2, 5]))))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection carrier order in -theorem realize_activeNameImageEntryFormula {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U : Name s) (hU : U.val ∈ M.sets) - (image : Name s → Name s) (graph : ZFSet.{u}) (hgraph : graph ∈ M.sets) - (entries : ∀ (w : Name s) z, ZFSet.pair w.val z ∈ graph ↔ - w.val ∈ T ∧ z = (image w).val) - (x : ZFSet.{u}) (hx : x ∈ M.sets) : - Realize M.sets activeNameImageEntryFormula - (extend x (extend T (extend U.val (extend graph - (extend s.carrier (extend s.conditionOrder Fin.elim0)))))) ↔ - x ∈ (Name.activeImage T valid U image).val := by - let env := extend x (extend T (extend U.val (extend graph - (extend s.carrier (extend s.conditionOrder Fin.elim0))))) - change Realize M.sets activeNameImageEntryFormula env ↔ _ - rw [activeNameImageEntryFormula, realize_ex] - constructor - · rintro ⟨w, hw, body⟩ - obtain ⟨z, hz, body⟩ := (realize_ex M.sets _ _).1 body - obtain ⟨q, hq, member, condition, code, imageEntry, forced⟩ := - (realize_ex M.sets _ _).1 body - change w ∈ T at member - change q ∈ s.carrier at condition - obtain ⟨p, rfl⟩ := (s.mem_carrier q).1 condition - let term : Name s := ⟨w, valid w member⟩ - have equal := (M.realize_orderedPairFormula pairing 3 1 0 _ hx hz hq).1 code - have graphEntry := (M.realize_pairMembershipFormula pairing 2 1 6 _ hw hz hgraph).1 imageEntry - have imageEqual := ((entries term z).1 graphEntry).2 - let names : Assignment (M.nameDomain s) 2 := extend ⟨term, hw⟩ (extend ⟨U, hU⟩ Fin.elim0) - have atom := (M.realize_ordinaryGroundForcing s pairing unions powers separation collection - carrier order 0 1 (.mem 0 1) ![7, 8] 0 ![2, 5] _ rfl rfl p names rfl - (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))).1 forced - change x = ZFSet.pair z (s.encode p) at equal - rw [equal, imageEqual] - exact (Name.entry_activeImage T valid U image (image term) p).2 - ⟨term, member, atom, rfl⟩ - · intro member - obtain ⟨z, p, rfl⟩ := Name.entries_cover (Name.activeImage T valid U image) member - obtain ⟨w, hwT, forced, rfl⟩ := (Name.entry_activeImage T valid U image z p).1 member - have hw := M.transitive hT hwT - have hp := M.transitive carrier (s.encode_mem p) - have graphEntry := (entries w (image w).val).2 ⟨hwT, rfl⟩ - have hz := M.transitive (M.union_mem unions (M.union_mem unions hgraph)) - (pair_second_mem_doubleUnion graphEntry) - refine ⟨w.val, hw, ?_⟩ - rw [realize_ex] - refine ⟨(image w).val, hz, ?_⟩ - rw [realize_ex] - refine ⟨s.encode p, hp, hwT, s.encode_mem p, ?_, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing 3 1 0 _ hx hz hp).2 rfl - · exact (M.realize_pairMembershipFormula pairing 2 1 6 _ hw hz hgraph).2 graphEntry - · let names : Assignment (M.nameDomain s) 2 := extend ⟨w, hw⟩ (extend ⟨U, hU⟩ Fin.elim0) - exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection - carrier order 0 1 (.mem 0 1) ![7, 8] 0 ![2, 5] _ rfl rfl p names rfl - (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))).2 forced - -include pairing unions powers separation collection carrier order in -theorem activeImage_eq_selection {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U : Name s) (hU : U.val ∈ M.sets) - (image : Name s → Name s) (graph : ZFSet.{u}) (hgraph : graph ∈ M.sets) - (entries : ∀ (w : Name s) z, ZFSet.pair w.val z ∈ graph ↔ - w.val ∈ T ∧ z = (image w).val) : - (Name.activeImage T valid U image).val = - ZFSet.sep (fun x => Realize M.sets activeNameImageEntryFormula - (extend x (extend T (extend U.val (extend graph - (extend s.carrier (extend s.conditionOrder Fin.elim0))))))) - (ZFSet.prod (functionGraphRange T graph) s.carrier) := by - have rangeGround := M.functionGraphRange_mem unions separation hT hgraph - have boundGround := M.prod_mem pairing unions powers separation rangeGround carrier - have bound := Name.activeImage_subset T valid U image (functionGraphRange T graph) - (fun w hw => (mem_functionGraphRange T graph _).2 - ⟨w.val, hw, (entries w (image w).val).2 ⟨hw, rfl⟩⟩) - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep] - constructor - · intro member - exact ⟨bound member, - (M.realize_activeNameImageEntryFormula s pairing unions powers separation collection - carrier order hT valid U hU image graph hgraph entries x - (M.transitive boundGround (bound member))).2 member⟩ - · rintro ⟨hx, formula⟩ - exact (M.realize_activeNameImageEntryFormula s pairing unions powers separation collection - carrier order hT valid U hU image graph hgraph entries x - (M.transitive boundGround hx)).1 formula - -include pairing unions powers separation collection carrier order in -theorem activeImage_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U : Name s) (hU : U.val ∈ M.sets) - (image : Name s → Name s) (graph : ZFSet.{u}) (hgraph : graph ∈ M.sets) - (entries : ∀ (w : Name s) z, ZFSet.pair w.val z ∈ graph ↔ - w.val ∈ T ∧ z = (image w).val) : - (Name.activeImage T valid U image).val ∈ M.sets := by - rw [M.activeImage_eq_selection s pairing unions powers separation collection carrier order - hT valid U hU image graph hgraph entries] - exact M.separation_mem separation activeNameImageEntryFormula _ - (Fin.cases hT (Fin.cases hU (Fin.cases hgraph (Fin.cases carrier - (Fin.cases order (fun j => Fin.elim0 j)))))) - (M.prod_mem pairing unions powers separation - (M.functionGraphRange_mem unions separation hT hgraph) carrier) - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs +import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps + +namespace OAI + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +noncomputable def activeImage (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U : Name s) (image : Name s → Name s) : Name s := + assemble + (fun a : {a : T × P // ForcesMem a.2 ⟨a.1.val, valid a.1.val a.1.property⟩ U} => + image ⟨a.val.1.val, valid a.val.1.val a.val.1.property⟩) + (fun a => a.val.2) + +theorem entry_activeImage (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U : Name s) (image : Name s → Name s) (σ : Name s) (p : P) : + Entry σ (activeImage T valid U image) p ↔ + ∃ w : Name s, w.val ∈ T ∧ ForcesMem p w U ∧ image w = σ := by + rw [activeImage, entry_assemble] + constructor + · rintro ⟨a, equal, condition⟩ + refine ⟨⟨a.val.1.val, valid a.val.1.val a.val.1.property⟩, a.val.1.property, ?_, equal⟩ + exact condition ▸ a.property + · rintro ⟨w, hw, forced, equal⟩ + exact ⟨⟨(⟨w.val, hw⟩, p), forced⟩, equal, rfl⟩ + +theorem activeImage_subset (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U : Name s) (image : Name s → Name s) (F : ZFSet.{u}) + (images : ∀ w : Name s, w.val ∈ T → (image w).val ∈ F) : + (activeImage T valid U image).val ⊆ ZFSet.prod F s.carrier := by + intro z hz + obtain ⟨σ, p, rfl⟩ := entries_cover (activeImage T valid U image) hz + obtain ⟨w, hw, _, rfl⟩ := (entry_activeImage T valid U image σ p).1 hz + exact ZFSet.pair_mem_prod.2 ⟨images w hw, s.encode_mem p⟩ + +theorem activeImage_congr (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U : Name s) (image other : Name s → Name s) + (equal : ∀ w : Name s, w.val ∈ T → image w = other w) : + activeImage T valid U image = activeImage T valid U other := by + apply Name.ext + intro σ p + rw [entry_activeImage, entry_activeImage] + constructor + · rintro ⟨w, hw, forced, entry⟩ + exact ⟨w, hw, forced, (equal w hw).symm.trans entry⟩ + · rintro ⟨w, hw, forced, entry⟩ + exact ⟨w, hw, forced, (equal w hw).trans entry⟩ + +theorem mem_eval_activeImage (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U : Name s) (image : Name s → Name s) (hU : U ∈ D.names) + (terms : ∀ w : Name s, w.val ∈ T → w ∈ D.names) (x : ZFSet.{u}) : + x ∈ eval {p | H.mem p} (activeImage T valid U image) ↔ + ∃ w : Name s, w.val ∈ T ∧ eval {p | H.mem p} w ∈ eval {p | H.mem p} U ∧ + eval {p | H.mem p} (image w) = x := by + rw [mem_eval] + constructor + · rintro ⟨σ, p, entry, hp, equal⟩ + obtain ⟨w, hw, forced, rfl⟩ := (entry_activeImage T valid U image σ p).1 entry + exact ⟨w, hw, forcesMem_sound D H generic (terms w hw) hU hp forced, equal⟩ + · rintro ⟨w, hw, active, equal⟩ + obtain ⟨p, hp, forced⟩ := (eval_mem_iff_forcesMem D H generic (terms w hw) hU).1 active + exact ⟨image w, p, (entry_activeImage T valid U image (image w) p).2 + ⟨w, hw, forced, rfl⟩, hp, equal⟩ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} [PartialOrder P] {s : Presentation P} +variable {G : Type v} [Group G] (a : PosetAction G P) + +theorem act_activeImage (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + (g : G) (U : Name s) (image other : Name s → Name s) + (equivariant : ∀ w : Name s, w.val ∈ T → + a.act s g (image w) = other (a.act s g w)) : + a.act s g (activeImage T valid U image) = + activeImage T valid (a.act s g U) other := by + apply Name.ext + intro σ p + change Entry σ (rename s (a.iso g) (activeImage T valid U image)) p ↔ _ + rw [entry_rename, entry_activeImage] + constructor + · rintro ⟨ν, q, entry, equal, rfl⟩ + obtain ⟨w, hw, forced, rfl⟩ := (entry_activeImage T valid U image ν q).1 entry + exact ⟨a.act s g w, closed g w hw, a.forcesMem_act s g forced, + (equivariant w hw).symm.trans equal⟩ + · rintro ⟨w, hw, forced, equal⟩ + have oldMember := closed g⁻¹ w hw + have oldForced : ForcesMem ((a.iso g).symm p) (a.act s g⁻¹ w) U := by + apply (a.forcesMem_act_iff s g ((a.iso g).symm p) (a.act s g⁻¹ w) U).1 + simpa only [OrderIso.apply_symm_apply, a.act_inv_right] using forced + refine ⟨image (a.act s g⁻¹ w), (a.iso g).symm p, + (entry_activeImage T valid U image _ _).2 ⟨a.act s g⁻¹ w, oldMember, oldForced, rfl⟩, + ?_, (a.iso g).apply_symm_apply p⟩ + change a.act s g (image (a.act s g⁻¹ w)) = σ + rw [equivariant _ oldMember, a.act_inv_right] + exact equal + +theorem activeImage_support (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + (U : Name s) (image : Name s → Name s) (K : Subgroup G) + (activity : K ≤ a.stabilizer s U) + (equivariant : ∀ g ∈ K, ∀ w : Name s, w.val ∈ T → + a.act s g (image w) = image (a.act s g w)) : + K ≤ a.stabilizer s (activeImage T valid U image) := by + intro g hg + change a.act s g _ = _ + rw [act_activeImage a T valid closed g U image image (equivariant g hg), activity hg] + +theorem activeImage_hs (F : NormalSubgroupFamily G) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + (U : Name s) (image : Name s → Name s) (K : Subgroup G) (member : F.mem K) + (activity : K ≤ a.stabilizer s U) + (equivariant : ∀ g ∈ K, ∀ w : Name s, w.val ∈ T → + a.act s g (image w) = image (a.act s g w)) + (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F (image w)) : + HereditarilySymmetric a s F (activeImage T valid U image) := by + refine HereditarilySymmetric.mk + (F.upward member (activeImage_support a T valid closed U image K activity equivariant)) ?_ + intro σ p entry + obtain ⟨w, hw, _, rfl⟩ := (entry_activeImage T valid U image σ p).1 entry + exact children w hw + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace SetFormula + +def activeNameImageEntryFormula : SetFormula 6 := + ex (ex (ex (.conj (.mem 2 4) (.conj (.mem 0 7) + (.conj (orderedPairFormula 3 1 0) + (.conj (pairMembershipFormula 2 1 6) + (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) + ![7, 8] 0 ![2, 5]))))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection carrier order in +theorem realize_activeNameImageEntryFormula {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U : Name s) (hU : U.val ∈ M.sets) + (image : Name s → Name s) (graph : ZFSet.{u}) (hgraph : graph ∈ M.sets) + (entries : ∀ (w : Name s) z, ZFSet.pair w.val z ∈ graph ↔ + w.val ∈ T ∧ z = (image w).val) + (x : ZFSet.{u}) (hx : x ∈ M.sets) : + Realize M.sets activeNameImageEntryFormula + (extend x (extend T (extend U.val (extend graph + (extend s.carrier (extend s.conditionOrder Fin.elim0)))))) ↔ + x ∈ (Name.activeImage T valid U image).val := by + let env := extend x (extend T (extend U.val (extend graph + (extend s.carrier (extend s.conditionOrder Fin.elim0))))) + change Realize M.sets activeNameImageEntryFormula env ↔ _ + rw [activeNameImageEntryFormula, realize_ex] + constructor + · rintro ⟨w, hw, body⟩ + obtain ⟨z, hz, body⟩ := (realize_ex M.sets _ _).1 body + obtain ⟨q, hq, member, condition, code, imageEntry, forced⟩ := + (realize_ex M.sets _ _).1 body + change w ∈ T at member + change q ∈ s.carrier at condition + obtain ⟨p, rfl⟩ := (s.mem_carrier q).1 condition + let term : Name s := ⟨w, valid w member⟩ + have equal := (M.realize_orderedPairFormula pairing 3 1 0 _ hx hz hq).1 code + have graphEntry := (M.realize_pairMembershipFormula pairing 2 1 6 _ hw hz hgraph).1 imageEntry + have imageEqual := ((entries term z).1 graphEntry).2 + let names : Assignment (M.nameDomain s) 2 := extend ⟨term, hw⟩ (extend ⟨U, hU⟩ Fin.elim0) + have atom := (M.realize_ordinaryGroundForcing s pairing unions powers separation collection + carrier order 0 1 (.mem 0 1) ![7, 8] 0 ![2, 5] _ rfl rfl p names rfl + (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))).1 forced + change x = ZFSet.pair z (s.encode p) at equal + rw [equal, imageEqual] + exact (Name.entry_activeImage T valid U image (image term) p).2 + ⟨term, member, atom, rfl⟩ + · intro member + obtain ⟨z, p, rfl⟩ := Name.entries_cover (Name.activeImage T valid U image) member + obtain ⟨w, hwT, forced, rfl⟩ := (Name.entry_activeImage T valid U image z p).1 member + have hw := M.transitive hT hwT + have hp := M.transitive carrier (s.encode_mem p) + have graphEntry := (entries w (image w).val).2 ⟨hwT, rfl⟩ + have hz := M.transitive (M.union_mem unions (M.union_mem unions hgraph)) + (pair_second_mem_doubleUnion graphEntry) + refine ⟨w.val, hw, ?_⟩ + rw [realize_ex] + refine ⟨(image w).val, hz, ?_⟩ + rw [realize_ex] + refine ⟨s.encode p, hp, hwT, s.encode_mem p, ?_, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing 3 1 0 _ hx hz hp).2 rfl + · exact (M.realize_pairMembershipFormula pairing 2 1 6 _ hw hz hgraph).2 graphEntry + · let names : Assignment (M.nameDomain s) 2 := extend ⟨w, hw⟩ (extend ⟨U, hU⟩ Fin.elim0) + exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection + carrier order 0 1 (.mem 0 1) ![7, 8] 0 ![2, 5] _ rfl rfl p names rfl + (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))).2 forced + +include pairing unions powers separation collection carrier order in +theorem activeImage_eq_selection {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U : Name s) (hU : U.val ∈ M.sets) + (image : Name s → Name s) (graph : ZFSet.{u}) (hgraph : graph ∈ M.sets) + (entries : ∀ (w : Name s) z, ZFSet.pair w.val z ∈ graph ↔ + w.val ∈ T ∧ z = (image w).val) : + (Name.activeImage T valid U image).val = + ZFSet.sep (fun x => Realize M.sets activeNameImageEntryFormula + (extend x (extend T (extend U.val (extend graph + (extend s.carrier (extend s.conditionOrder Fin.elim0))))))) + (ZFSet.prod (functionGraphRange T graph) s.carrier) := by + have rangeGround := M.functionGraphRange_mem unions separation hT hgraph + have boundGround := M.prod_mem pairing unions powers separation rangeGround carrier + have bound := Name.activeImage_subset T valid U image (functionGraphRange T graph) + (fun w hw => (mem_functionGraphRange T graph _).2 + ⟨w.val, hw, (entries w (image w).val).2 ⟨hw, rfl⟩⟩) + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep] + constructor + · intro member + exact ⟨bound member, + (M.realize_activeNameImageEntryFormula s pairing unions powers separation collection + carrier order hT valid U hU image graph hgraph entries x + (M.transitive boundGround (bound member))).2 member⟩ + · rintro ⟨hx, formula⟩ + exact (M.realize_activeNameImageEntryFormula s pairing unions powers separation collection + carrier order hT valid U hU image graph hgraph entries x + (M.transitive boundGround hx)).1 formula + +include pairing unions powers separation collection carrier order in +theorem activeImage_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U : Name s) (hU : U.val ∈ M.sets) + (image : Name s → Name s) (graph : ZFSet.{u}) (hgraph : graph ∈ M.sets) + (entries : ∀ (w : Name s) z, ZFSet.pair w.val z ∈ graph ↔ + w.val ∈ T ∧ z = (image w).val) : + (Name.activeImage T valid U image).val ∈ M.sets := by + rw [M.activeImage_eq_selection s pairing unions powers separation collection carrier order + hT valid U hU image graph hgraph entries] + exact M.separation_mem separation activeNameImageEntryFormula _ + (Fin.cases hT (Fin.cases hU (Fin.cases hgraph (Fin.cases carrier + (Fin.cases order (fun j => Fin.elim0 j)))))) + (M.prod_mem pairing unions powers separation + (M.functionGraphRange_mem unions separation hT hgraph) carrier) + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AllSupportFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AllSupportFamilies.lean index 900c505baf5a889522975d15626d723189bd6ec3..6388804fc69188d97879d93f69611fc0b9ab1c88 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AllSupportFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AllSupportFamilies.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps -universe u v - -def allSupportFamily (G : Type u) [Group G] : NormalSubgroupFamily G where - mem := fun _ => True - top := True.intro - upward := fun _ _ => True.intro - inf := fun _ _ => True.intro - conjugate := fun _ {_} _ => True.intro - -def allSupportBasis (G : Type u) [Group G] : ULift.{u} (Fin 1) → Subgroup G := - fun _ => ⊥ - -theorem allSupportFamily_basis (G : Type u) [Group G] (H : Subgroup G) : - (allSupportFamily G).mem H ↔ ∃ i, allSupportBasis G i ≤ H := - ⟨fun _ => ⟨⟨0⟩, bot_le⟩, fun _ => True.intro⟩ - -namespace PosetAction -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem allSupport_hs (τ : Name s) : - HereditarilySymmetric a s (allSupportFamily G) τ := by - induction τ using Name.inductionOn with - | step τ ih => exact HereditarilySymmetric.mk True.intro ih - -theorem symmetricDomain_allSupport (D : Name.NameDomain s) : - a.symmetricDomain s D (allSupportFamily G) = D := by - have names : (a.symmetricDomain s D (allSupportFamily G)).names = D.names := by - apply Set.ext - intro τ - exact ⟨fun h => h.1, fun h => ⟨h, a.allSupport_hs s τ⟩⟩ - have ext : ∀ E F : Name.NameDomain s, E.names = F.names → E = F := by - intro E F same - cases E - cases F - cases same - rfl - exact ext _ _ names - -end PosetAction - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps +universe u v + +def allSupportFamily (G : Type u) [Group G] : NormalSubgroupFamily G where + mem := fun _ => True + top := True.intro + upward := fun _ _ => True.intro + inf := fun _ _ => True.intro + conjugate := fun _ {_} _ => True.intro + +def allSupportBasis (G : Type u) [Group G] : ULift.{u} (Fin 1) → Subgroup G := + fun _ => ⊥ + +theorem allSupportFamily_basis (G : Type u) [Group G] (H : Subgroup G) : + (allSupportFamily G).mem H ↔ ∃ i, allSupportBasis G i ≤ H := + ⟨fun _ => ⟨⟨0⟩, bot_le⟩, fun _ => True.intro⟩ + +namespace PosetAction +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem allSupport_hs (τ : Name s) : + HereditarilySymmetric a s (allSupportFamily G) τ := by + induction τ using Name.inductionOn with + | step τ ih => exact HereditarilySymmetric.mk True.intro ih + +theorem symmetricDomain_allSupport (D : Name.NameDomain s) : + a.symmetricDomain s D (allSupportFamily G) = D := by + have names : (a.symmetricDomain s D (allSupportFamily G)).names = D.names := by + apply Set.ext + intro τ + exact ⟨fun h => h.1, fun h => ⟨h, a.allSupport_hs s τ⟩⟩ + have ext : ∀ E F : Name.NameDomain s, E.names = F.names → E = F := by + intro E F same + cases E + cases F + cases same + rfl + exact ext _ _ names + +end PosetAction + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AtomicTruth.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AtomicTruth.lean index 75648054ddf52ff2261af9f0c232c33beac0187e..8b422433058c28a4530e303d5ad506eeb3a889f7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AtomicTruth.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/AtomicTruth.lean @@ -1,94 +1,94 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.AtomicSoundness - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -def EqTruth (H : ConditionFilter P) (σ τ : Name s) : Prop := - eval {q | H.mem q} σ = eval {q | H.mem q} τ → ∃ p, H.mem p ∧ ForcesEq p σ τ - -def MemTruth (H : ConditionFilter P) (σ τ : Name s) : Prop := - eval {q | H.mem q} σ ∈ eval {q | H.mem q} τ → ∃ p, H.mem p ∧ ForcesMem p σ τ - -theorem memTruth_of_children (H : ConditionFilter P) (σ τ : Name s) - (children : ∀ ν r, Entry ν τ r → EqTruth H σ ν) : MemTruth H σ τ := by - intro hv - obtain ⟨ν, r, entry, hr, values⟩ := (mem_eval {q | H.mem q} τ _).1 hv - obtain ⟨p, hp, eq⟩ := children ν r entry values.symm - obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr - exact ⟨q, hq, forcesMem_of_witness ⟨ν, r, entry, qr, forcesEq_mono eq qp⟩⟩ - -theorem eqTruth_of_children (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) (σ τ : Name s) - (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) - (left : ∀ ρ r, Entry ρ σ r → MemTruth H ρ τ) - (right : ∀ ν k, Entry ν τ k → MemTruth H ν σ) : EqTruth H σ τ := by - intro values - obtain ⟨p, hp, eq | bad | bad⟩ := generic (EqDecisionWitness σ τ) - (Or.inr ⟨σ, τ, hσ, hτ, rfl⟩) (eqDecisionWitness_dense σ τ) - · exact ⟨p, hp, eq⟩ - · obtain ⟨ρ, r, entry, pr, neg⟩ := bad - have member : eval {q | H.mem q} ρ ∈ eval {q | H.mem q} τ := by - rw [← values] - exact (mem_eval {q | H.mem q} σ _).2 ⟨ρ, r, entry, H.upward hp pr, rfl⟩ - obtain ⟨q, hq, mem⟩ := left ρ r entry member - obtain ⟨t, _, tp, tq⟩ := H.directed hp hq - exact False.elim (neg t tp (forcesMem_mono mem tq)) - · obtain ⟨ν, k, entry, pk, neg⟩ := bad - have member : eval {q | H.mem q} ν ∈ eval {q | H.mem q} σ := by - rw [values] - exact (mem_eval {q | H.mem q} τ _).2 ⟨ν, k, entry, H.upward hp pk, rfl⟩ - obtain ⟨q, hq, mem⟩ := right ν k entry member - obtain ⟨t, _, tp, tq⟩ := H.directed hp hq - exact False.elim (neg t tp (forcesMem_mono mem tq)) - -theorem atomic_truth (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) : - ∀ σ ∈ D.names, ∀ τ ∈ D.names, EqTruth H σ τ ∧ MemTruth H σ τ ∧ MemTruth H τ σ := by - intro σ - induction σ using inductionOn with - | step σ outer => - intro hσ τ - induction τ using inductionOn with - | step τ inner => - intro hτ - have eq : EqTruth H σ τ := eqTruth_of_children D H generic σ τ hσ hτ - (fun ρ r entry => (outer ρ r entry (D.children hσ entry) τ hτ).2.1) - (fun ν k entry => (inner ν k entry (D.children hτ entry)).2.2) - have mem : MemTruth H σ τ := memTruth_of_children H σ τ - (fun ν k entry => (inner ν k entry (D.children hτ entry)).1) - have reverse : MemTruth H τ σ := memTruth_of_children H τ σ (by - intro ρ r entry values - obtain ⟨p, hp, eq⟩ := (outer ρ r entry (D.children hσ entry) τ hτ).1 values.symm - exact ⟨p, hp, forcesEq_symm eq⟩) - exact ⟨eq, mem, reverse⟩ - -theorem eval_eq_iff_forcesEq (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} - (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) : - eval {q | H.mem q} σ = eval {q | H.mem q} τ ↔ ∃ p, H.mem p ∧ ForcesEq p σ τ := by - constructor - · exact (atomic_truth D H generic σ hσ τ hτ).1 - · rintro ⟨p, hp, eq⟩ - exact forcesEq_sound D H generic σ hσ τ hτ p hp eq - -theorem eval_mem_iff_forcesMem (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} - (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) : - eval {q | H.mem q} σ ∈ eval {q | H.mem q} τ ↔ ∃ p, H.mem p ∧ ForcesMem p σ τ := by - constructor - · exact (atomic_truth D H generic σ hσ τ hτ).2.1 - · rintro ⟨p, hp, mem⟩ - exact forcesMem_sound D H generic hσ hτ hp mem - -end PartitionPilot.Forcing.Name - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.AtomicSoundness + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +def EqTruth (H : ConditionFilter P) (σ τ : Name s) : Prop := + eval {q | H.mem q} σ = eval {q | H.mem q} τ → ∃ p, H.mem p ∧ ForcesEq p σ τ + +def MemTruth (H : ConditionFilter P) (σ τ : Name s) : Prop := + eval {q | H.mem q} σ ∈ eval {q | H.mem q} τ → ∃ p, H.mem p ∧ ForcesMem p σ τ + +theorem memTruth_of_children (H : ConditionFilter P) (σ τ : Name s) + (children : ∀ ν r, Entry ν τ r → EqTruth H σ ν) : MemTruth H σ τ := by + intro hv + obtain ⟨ν, r, entry, hr, values⟩ := (mem_eval {q | H.mem q} τ _).1 hv + obtain ⟨p, hp, eq⟩ := children ν r entry values.symm + obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr + exact ⟨q, hq, forcesMem_of_witness ⟨ν, r, entry, qr, forcesEq_mono eq qp⟩⟩ + +theorem eqTruth_of_children (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) (σ τ : Name s) + (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) + (left : ∀ ρ r, Entry ρ σ r → MemTruth H ρ τ) + (right : ∀ ν k, Entry ν τ k → MemTruth H ν σ) : EqTruth H σ τ := by + intro values + obtain ⟨p, hp, eq | bad | bad⟩ := generic (EqDecisionWitness σ τ) + (Or.inr ⟨σ, τ, hσ, hτ, rfl⟩) (eqDecisionWitness_dense σ τ) + · exact ⟨p, hp, eq⟩ + · obtain ⟨ρ, r, entry, pr, neg⟩ := bad + have member : eval {q | H.mem q} ρ ∈ eval {q | H.mem q} τ := by + rw [← values] + exact (mem_eval {q | H.mem q} σ _).2 ⟨ρ, r, entry, H.upward hp pr, rfl⟩ + obtain ⟨q, hq, mem⟩ := left ρ r entry member + obtain ⟨t, _, tp, tq⟩ := H.directed hp hq + exact False.elim (neg t tp (forcesMem_mono mem tq)) + · obtain ⟨ν, k, entry, pk, neg⟩ := bad + have member : eval {q | H.mem q} ν ∈ eval {q | H.mem q} σ := by + rw [values] + exact (mem_eval {q | H.mem q} τ _).2 ⟨ν, k, entry, H.upward hp pk, rfl⟩ + obtain ⟨q, hq, mem⟩ := right ν k entry member + obtain ⟨t, _, tp, tq⟩ := H.directed hp hq + exact False.elim (neg t tp (forcesMem_mono mem tq)) + +theorem atomic_truth (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) : + ∀ σ ∈ D.names, ∀ τ ∈ D.names, EqTruth H σ τ ∧ MemTruth H σ τ ∧ MemTruth H τ σ := by + intro σ + induction σ using inductionOn with + | step σ outer => + intro hσ τ + induction τ using inductionOn with + | step τ inner => + intro hτ + have eq : EqTruth H σ τ := eqTruth_of_children D H generic σ τ hσ hτ + (fun ρ r entry => (outer ρ r entry (D.children hσ entry) τ hτ).2.1) + (fun ν k entry => (inner ν k entry (D.children hτ entry)).2.2) + have mem : MemTruth H σ τ := memTruth_of_children H σ τ + (fun ν k entry => (inner ν k entry (D.children hτ entry)).1) + have reverse : MemTruth H τ σ := memTruth_of_children H τ σ (by + intro ρ r entry values + obtain ⟨p, hp, eq⟩ := (outer ρ r entry (D.children hσ entry) τ hτ).1 values.symm + exact ⟨p, hp, forcesEq_symm eq⟩) + exact ⟨eq, mem, reverse⟩ + +theorem eval_eq_iff_forcesEq (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} + (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) : + eval {q | H.mem q} σ = eval {q | H.mem q} τ ↔ ∃ p, H.mem p ∧ ForcesEq p σ τ := by + constructor + · exact (atomic_truth D H generic σ hσ τ hτ).1 + · rintro ⟨p, hp, eq⟩ + exact forcesEq_sound D H generic σ hσ τ hτ p hp eq + +theorem eval_mem_iff_forcesMem (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} + (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) : + eval {q | H.mem q} σ ∈ eval {q | H.mem q} τ ↔ ∃ p, H.mem p ∧ ForcesMem p σ τ := by + constructor + · exact (atomic_truth D H generic σ hσ τ hτ).2.1 + · rintro ⟨p, hp, mem⟩ + exact forcesMem_sound D H generic hσ hτ hp mem + +end PartitionPilot.Forcing.Name + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ChronologicalTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ChronologicalTransport.lean index 129dd2aa7d09e1076af8d97097572177d6cda742..792509092ff40205baf2d54ec35f4560d5bbe365 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ChronologicalTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ChronologicalTransport.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.BinaryTiles - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.Chronological - -universe u v - -variable {A B Stage : Type u} [LinearOrder Stage] - {P : MeetOrder A} {Q : MeetOrder B} - -theorem OldBridge.map (e : MeetEmbedding P Q) (birthA : A → Stage) (birthB : B → Stage) - (preserves : ∀ x, birthB (e.toFun x) = birthA x) (s : Stage) (x y : A) - (bridge : OldBridge (P := P) birthA s x y) : - OldBridge (P := Q) birthB s (e.toFun x) (e.toFun y) := by - rcases bridge with meet | between | between - · left - rw [← e.map_meet, preserves] - exact meet - · rcases between with ⟨z, old, lower, upper⟩ - exact Or.inr (Or.inl ⟨e.toFun z, (preserves z).symm ▸ old, - (e.le_iff _ _).mpr lower, (e.le_iff _ _).mpr upper⟩) - · rcases between with ⟨z, old, lower, upper⟩ - exact Or.inr (Or.inr ⟨e.toFun z, (preserves z).symm ▸ old, - (e.le_iff _ _).mpr lower, (e.le_iff _ _).mpr upper⟩) - -noncomputable def GrowthLayer.transport {Space : Stage → Type u} - {order : ∀ s, MeetOrder (Space s)} {birthA : A → Stage} {birthB : B → Stage} {s : Stage} - (layer : GrowthLayer Space order P birthA s) (e : MeetEmbedding P Q) - (preserves : ∀ x, birthB (e.toFun x) = birthA x) - (noNew : ∀ x, birthB x = s → ∃ y, e.toFun y = x) : - GrowthLayer Space order Q birthB s := by - classical - cases layer with - | countablePoints small => - apply GrowthLayer.countablePoints - apply (small.image e.toFun).mono - intro x hx - rcases noNew x hx with ⟨y, rfl⟩ - exact ⟨y, (preserves y).symm.trans hx, rfl⟩ - | copies I small index earlier copy cover => - apply GrowthLayer.copies I small index earlier (fun i => compose (copy i) e) - intro x hx - rcases noNew x hx with ⟨y, rfl⟩ - rcases cover y ((preserves y).symm.trans hx) with ⟨i, z, eq⟩ - exact ⟨i, z, congrArg e.toFun eq⟩ - | separated I index earlier copy component cover separated => - let pre : {x // birthB x = s} → {x // birthA x = s} := fun x => - let y := Classical.choose (noNew x.val x.property) - have eq : e.toFun y = x.val := Classical.choose_spec (noNew x.val x.property) - ⟨y, by rw [← preserves, eq]; exact x.property⟩ - have pre_eq : ∀ x, e.toFun (pre x).val = x.val := - fun x => Classical.choose_spec (noNew x.val x.property) - apply GrowthLayer.separated I index earlier (fun i => compose (copy i) e) - (fun x => component (pre x)) - · intro x - rcases cover (pre x) with ⟨y, eq⟩ - exact ⟨y, (congrArg e.toFun eq).trans (pre_eq x)⟩ - · intro x y different - have bridge := OldBridge.map e birthA birthB preserves s (pre x).val (pre y).val - (separated (pre x) (pre y) different) - rw [pre_eq, pre_eq] at bridge - exact bridge - -theorem oldMeet_of_covered_stages {I : Type v} {Space : I → Type u} - (order : ∀ i, MeetOrder (Space i)) (birth : B → Stage) - (stageBirth : ∀ i, Space i → Stage) (embed : ∀ i, MeetEmbedding (order i) Q) - (preserves : ∀ i x, birth ((embed i).toFun x) = stageBirth i x) - (pairCover : ∀ x y, ∃ i a b, (embed i).toFun a = x ∧ (embed i).toFun b = y) - (oldMeet : ∀ i, OldMeet (P := order i) (stageBirth i)) : OldMeet (P := Q) birth := by - intro x y earlier notLower - rcases pairCover x y with ⟨i, a, b, rfl, rfl⟩ - rw [preserves, preserves] at earlier - have old := oldMeet i a b earlier (fun h => notLower (((embed i).le_iff _ _).mpr h)) - rw [← (embed i).map_meet, preserves, preserves] - exact old - -end PartitionPilot.Compression.RecursiveMaps.Chronological - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.BinaryTiles + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.Chronological + +universe u v + +variable {A B Stage : Type u} [LinearOrder Stage] + {P : MeetOrder A} {Q : MeetOrder B} + +theorem OldBridge.map (e : MeetEmbedding P Q) (birthA : A → Stage) (birthB : B → Stage) + (preserves : ∀ x, birthB (e.toFun x) = birthA x) (s : Stage) (x y : A) + (bridge : OldBridge (P := P) birthA s x y) : + OldBridge (P := Q) birthB s (e.toFun x) (e.toFun y) := by + rcases bridge with meet | between | between + · left + rw [← e.map_meet, preserves] + exact meet + · rcases between with ⟨z, old, lower, upper⟩ + exact Or.inr (Or.inl ⟨e.toFun z, (preserves z).symm ▸ old, + (e.le_iff _ _).mpr lower, (e.le_iff _ _).mpr upper⟩) + · rcases between with ⟨z, old, lower, upper⟩ + exact Or.inr (Or.inr ⟨e.toFun z, (preserves z).symm ▸ old, + (e.le_iff _ _).mpr lower, (e.le_iff _ _).mpr upper⟩) + +noncomputable def GrowthLayer.transport {Space : Stage → Type u} + {order : ∀ s, MeetOrder (Space s)} {birthA : A → Stage} {birthB : B → Stage} {s : Stage} + (layer : GrowthLayer Space order P birthA s) (e : MeetEmbedding P Q) + (preserves : ∀ x, birthB (e.toFun x) = birthA x) + (noNew : ∀ x, birthB x = s → ∃ y, e.toFun y = x) : + GrowthLayer Space order Q birthB s := by + classical + cases layer with + | countablePoints small => + apply GrowthLayer.countablePoints + apply (small.image e.toFun).mono + intro x hx + rcases noNew x hx with ⟨y, rfl⟩ + exact ⟨y, (preserves y).symm.trans hx, rfl⟩ + | copies I small index earlier copy cover => + apply GrowthLayer.copies I small index earlier (fun i => compose (copy i) e) + intro x hx + rcases noNew x hx with ⟨y, rfl⟩ + rcases cover y ((preserves y).symm.trans hx) with ⟨i, z, eq⟩ + exact ⟨i, z, congrArg e.toFun eq⟩ + | separated I index earlier copy component cover separated => + let pre : {x // birthB x = s} → {x // birthA x = s} := fun x => + let y := Classical.choose (noNew x.val x.property) + have eq : e.toFun y = x.val := Classical.choose_spec (noNew x.val x.property) + ⟨y, by rw [← preserves, eq]; exact x.property⟩ + have pre_eq : ∀ x, e.toFun (pre x).val = x.val := + fun x => Classical.choose_spec (noNew x.val x.property) + apply GrowthLayer.separated I index earlier (fun i => compose (copy i) e) + (fun x => component (pre x)) + · intro x + rcases cover (pre x) with ⟨y, eq⟩ + exact ⟨y, (congrArg e.toFun eq).trans (pre_eq x)⟩ + · intro x y different + have bridge := OldBridge.map e birthA birthB preserves s (pre x).val (pre y).val + (separated (pre x) (pre y) different) + rw [pre_eq, pre_eq] at bridge + exact bridge + +theorem oldMeet_of_covered_stages {I : Type v} {Space : I → Type u} + (order : ∀ i, MeetOrder (Space i)) (birth : B → Stage) + (stageBirth : ∀ i, Space i → Stage) (embed : ∀ i, MeetEmbedding (order i) Q) + (preserves : ∀ i x, birth ((embed i).toFun x) = stageBirth i x) + (pairCover : ∀ x y, ∃ i a b, (embed i).toFun a = x ∧ (embed i).toFun b = y) + (oldMeet : ∀ i, OldMeet (P := order i) (stageBirth i)) : OldMeet (P := Q) birth := by + intro x y earlier notLower + rcases pairCover x y with ⟨i, a, b, rfl, rfl⟩ + rw [preserves, preserves] at earlier + have old := oldMeet i a b earlier (fun h => notLower (((embed i).le_iff _ _).mpr h)) + rw [← (embed i).map_meet, preserves, preserves] + exact old + +end PartitionPilot.Compression.RecursiveMaps.Chronological + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedDenseOrders.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedDenseOrders.lean index d9017d976003bcc756ce938228f16299649ac112..b3e47e0a97b1aa5dcc3179a7b4ab94a923f54dec 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedDenseOrders.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedDenseOrders.lean @@ -1,72 +1,72 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundCountableQuotients - -namespace OAI - - -namespace PartitionPilot.Forcing - -open Compression.RecursiveMaps -universe u - -structure StrictLinearOrderCode (D r : ZFSet.{u}) : Prop where - shape : r ⊆ ZFSet.prod D D - irrefl : ∀ x ∈ D, ZFSet.pair x x ∉ r - trans : ∀ x y z, ZFSet.pair x y ∈ r → ZFSet.pair y z ∈ r → ZFSet.pair x z ∈ r - compare : ∀ x ∈ D, ∀ y ∈ D, ZFSet.pair x y ∈ r ∨ x = y ∨ ZFSet.pair y x ∈ r - -structure DenseOrderCode (D r : ZFSet.{u}) : Prop extends StrictLinearOrderCode D r where - between : ∀ x y, ZFSet.pair x y ∈ r → ∃ z ∈ D, ZFSet.pair x z ∈ r ∧ ZFSet.pair z y ∈ r - -def StrictLinearOrderCode.toLinearHeightOrder {D r : ZFSet.{u}} (code : StrictLinearOrderCode D r) : - LinearHeightOrder {x : ZFSet.{u} // x ∈ D} where - lt x y := ZFSet.pair x.val y.val ∈ r - irrefl x := code.irrefl x.val x.property - trans {x y z} := code.trans x.val y.val z.val - compare x y := (code.compare x.val x.property y.val y.property).imp id - (fun h => h.imp (fun equal => Subtype.ext equal) id) - -def DenseOrderCode.toDenseHeightOrder {D r : ZFSet.{u}} (code : DenseOrderCode D r) : - DenseHeightOrder {x : ZFSet.{u} // x ∈ D} where - toLinearHeightOrder := code.toStrictLinearOrderCode.toLinearHeightOrder - between x y lower := by - obtain ⟨z, hz, left, right⟩ := code.between x.val y.val lower - exact ⟨⟨z, hz⟩, left, right⟩ - -def intervalCandidate (D r lower upper lo hi x : ZFSet.{u}) : Prop := - x ∈ D ∧ ZFSet.pair lo x ∈ r ∧ ZFSet.pair x hi ∈ r ∧ - (∀ y ∈ lower, ZFSet.pair y x ∈ r) ∧ (∀ y ∈ upper, ZFSet.pair x y ∈ r) - -theorem DenseOrderCode.finite_interval_candidate {D r lower upper lo hi : ZFSet.{u}} - (code : DenseOrderCode D r) (loD : lo ∈ D) (hiD : hi ∈ D) - (lowerD : lower ⊆ D) (upperD : upper ⊆ D) - (finiteLower : lower.toSet.Finite) (finiteUpper : upper.toSet.Finite) - (gap : ZFSet.pair lo hi ∈ r) - (lowerHi : ∀ x ∈ lower, ZFSet.pair x hi ∈ r) - (loUpper : ∀ y ∈ upper, ZFSet.pair lo y ∈ r) - (separated : ∀ x ∈ lower, ∀ y ∈ upper, ZFSet.pair x y ∈ r) : - ∃ x, intervalCandidate D r lower upper lo hi x := by - classical - have lowerFinite : (Subtype.val ⁻¹' lower.toSet : Set {x : ZFSet.{u} // x ∈ D}).Finite := - Set.Finite.preimage (fun _ _ _ _ equal => Subtype.ext equal) finiteLower - have upperFinite : (Subtype.val ⁻¹' upper.toSet : Set {x : ZFSet.{u} // x ∈ D}).Finite := - Set.Finite.preimage (fun _ _ _ _ equal => Subtype.ext equal) finiteUpper - let lowers := lowerFinite.toFinset.toList - let uppers := upperFinite.toFinset.toList - have lowerSpec (x : {x : ZFSet.{u} // x ∈ D}) : x ∈ lowers ↔ x.val ∈ lower := by - simp only [lowers, Finset.mem_toList, Set.Finite.mem_toFinset, Set.mem_preimage] - rfl - have upperSpec (x : {x : ZFSet.{u} // x ∈ D}) : x ∈ uppers ↔ x.val ∈ upper := by - simp only [uppers, Finset.mem_toList, Set.Finite.mem_toFinset, Set.mem_preimage] - rfl - obtain ⟨x, left, right, aboveLower, belowUpper⟩ := code.toDenseHeightOrder.finite_gap - ⟨lo, loD⟩ ⟨hi, hiD⟩ lowers uppers gap - (fun x hx => lowerHi x.val ((lowerSpec x).1 hx)) - (fun y hy => loUpper y.val ((upperSpec y).1 hy)) - (fun x hx y hy => separated x.val ((lowerSpec x).1 hx) y.val ((upperSpec y).1 hy)) - exact ⟨x.val, x.property, left, right, - fun y hy => aboveLower ⟨y, lowerD hy⟩ ((lowerSpec _).2 hy), - fun y hy => belowUpper ⟨y, upperD hy⟩ ((upperSpec _).2 hy)⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundCountableQuotients + +namespace OAI + + +namespace PartitionPilot.Forcing + +open Compression.RecursiveMaps +universe u + +structure StrictLinearOrderCode (D r : ZFSet.{u}) : Prop where + shape : r ⊆ ZFSet.prod D D + irrefl : ∀ x ∈ D, ZFSet.pair x x ∉ r + trans : ∀ x y z, ZFSet.pair x y ∈ r → ZFSet.pair y z ∈ r → ZFSet.pair x z ∈ r + compare : ∀ x ∈ D, ∀ y ∈ D, ZFSet.pair x y ∈ r ∨ x = y ∨ ZFSet.pair y x ∈ r + +structure DenseOrderCode (D r : ZFSet.{u}) : Prop extends StrictLinearOrderCode D r where + between : ∀ x y, ZFSet.pair x y ∈ r → ∃ z ∈ D, ZFSet.pair x z ∈ r ∧ ZFSet.pair z y ∈ r + +def StrictLinearOrderCode.toLinearHeightOrder {D r : ZFSet.{u}} (code : StrictLinearOrderCode D r) : + LinearHeightOrder {x : ZFSet.{u} // x ∈ D} where + lt x y := ZFSet.pair x.val y.val ∈ r + irrefl x := code.irrefl x.val x.property + trans {x y z} := code.trans x.val y.val z.val + compare x y := (code.compare x.val x.property y.val y.property).imp id + (fun h => h.imp (fun equal => Subtype.ext equal) id) + +def DenseOrderCode.toDenseHeightOrder {D r : ZFSet.{u}} (code : DenseOrderCode D r) : + DenseHeightOrder {x : ZFSet.{u} // x ∈ D} where + toLinearHeightOrder := code.toStrictLinearOrderCode.toLinearHeightOrder + between x y lower := by + obtain ⟨z, hz, left, right⟩ := code.between x.val y.val lower + exact ⟨⟨z, hz⟩, left, right⟩ + +def intervalCandidate (D r lower upper lo hi x : ZFSet.{u}) : Prop := + x ∈ D ∧ ZFSet.pair lo x ∈ r ∧ ZFSet.pair x hi ∈ r ∧ + (∀ y ∈ lower, ZFSet.pair y x ∈ r) ∧ (∀ y ∈ upper, ZFSet.pair x y ∈ r) + +theorem DenseOrderCode.finite_interval_candidate {D r lower upper lo hi : ZFSet.{u}} + (code : DenseOrderCode D r) (loD : lo ∈ D) (hiD : hi ∈ D) + (lowerD : lower ⊆ D) (upperD : upper ⊆ D) + (finiteLower : lower.toSet.Finite) (finiteUpper : upper.toSet.Finite) + (gap : ZFSet.pair lo hi ∈ r) + (lowerHi : ∀ x ∈ lower, ZFSet.pair x hi ∈ r) + (loUpper : ∀ y ∈ upper, ZFSet.pair lo y ∈ r) + (separated : ∀ x ∈ lower, ∀ y ∈ upper, ZFSet.pair x y ∈ r) : + ∃ x, intervalCandidate D r lower upper lo hi x := by + classical + have lowerFinite : (Subtype.val ⁻¹' lower.toSet : Set {x : ZFSet.{u} // x ∈ D}).Finite := + Set.Finite.preimage (fun _ _ _ _ equal => Subtype.ext equal) finiteLower + have upperFinite : (Subtype.val ⁻¹' upper.toSet : Set {x : ZFSet.{u} // x ∈ D}).Finite := + Set.Finite.preimage (fun _ _ _ _ equal => Subtype.ext equal) finiteUpper + let lowers := lowerFinite.toFinset.toList + let uppers := upperFinite.toFinset.toList + have lowerSpec (x : {x : ZFSet.{u} // x ∈ D}) : x ∈ lowers ↔ x.val ∈ lower := by + simp only [lowers, Finset.mem_toList, Set.Finite.mem_toFinset, Set.mem_preimage] + rfl + have upperSpec (x : {x : ZFSet.{u} // x ∈ D}) : x ∈ uppers ↔ x.val ∈ upper := by + simp only [uppers, Finset.mem_toList, Set.Finite.mem_toFinset, Set.mem_preimage] + rfl + obtain ⟨x, left, right, aboveLower, belowUpper⟩ := code.toDenseHeightOrder.finite_gap + ⟨lo, loD⟩ ⟨hi, hiD⟩ lowers uppers gap + (fun x hx => lowerHi x.val ((lowerSpec x).1 hx)) + (fun y hy => loUpper y.val ((upperSpec y).1 hy)) + (fun x hx y hy => separated x.val ((lowerSpec x).1 hx) y.val ((upperSpec y).1 hy)) + exact ⟨x.val, x.property, left, right, + fun y hy => aboveLower ⟨y, lowerD hy⟩ ((lowerSpec _).2 hy), + fun y hy => belowUpper ⟨y, upperD hy⟩ ((upperSpec _).2 hy)⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedRecursiveTaskActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedRecursiveTaskActions.lean index c615f0f20d68964c1f7bf22b28a796a624abb8a2..b12f382d3715b17ec5517008eedf79577f58d463 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedRecursiveTaskActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CodedRecursiveTaskActions.lean @@ -1,449 +1,449 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveLiftAgreement - -namespace OAI - -namespace PartitionPilot.Forcing - -section - -universe u - -structure SetActionCode (G X m e A : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc (ZFSet.prod G X) X A - one : ∀ p ∈ X, ZFSet.pair (ZFSet.pair e p) p ∈ A - mul : ∀ g ∈ G, ∀ h ∈ G, ∀ k ∈ G, ∀ p ∈ X, ∀ q ∈ X, ∀ r ∈ X, - ZFSet.pair (ZFSet.pair g h) k ∈ m → ZFSet.pair (ZFSet.pair h p) q ∈ A → - ZFSet.pair (ZFSet.pair g q) r ∈ A → ZFSet.pair (ZFSet.pair k p) r ∈ A - -theorem PosetActionCode.toSetAction {G P m e r A : ZFSet.{u}} - (action : PosetActionCode G P m e r A) : SetActionCode G P m e A := - ⟨action.function, action.one, action.mul⟩ - -noncomputable def taggedActionGraph (G P N A B : ZFSet.{u}) : ZFSet.{u} := - A ∪ ZFSet.sep (fun z => ∃ g ∈ G, ∃ q ∈ N, ∃ t ∈ N, - z = ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) (ZFSet.pair P t) ∧ - ZFSet.pair (ZFSet.pair g q) t ∈ B) - (ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N)) - -theorem triple_mem_taggedActionGraph (G P N A B g x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g x) y ∈ taggedActionGraph G P N A B ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A ∨ - (g ∈ G ∧ ∃ q ∈ N, ∃ t ∈ N, x = ZFSet.pair P q ∧ y = ZFSet.pair P t ∧ - ZFSet.pair (ZFSet.pair g q) t ∈ B) := by - rw [taggedActionGraph, ZFSet.mem_union, ZFSet.mem_sep] - apply or_congr Iff.rfl - constructor - · rintro ⟨_, g', hg, q, hq, t, ht, equal, entry⟩ - obtain ⟨first, last⟩ := ZFSet.pair_inj.1 equal - obtain ⟨actor, middle⟩ := ZFSet.pair_inj.1 first - subst g' - exact ⟨hg, q, hq, t, ht, middle, last, entry⟩ - · rintro ⟨hg, q, hq, t, ht, rfl, rfl, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 - ⟨hg, pair_mem_taggedExtension.2 hq⟩, pair_mem_taggedExtension.2 ht⟩, - g, hg, q, hq, t, ht, rfl, entry⟩ - -theorem SetActionCode.entry_shape {G X m e A g x y : ZFSet.{u}} - (action : SetActionCode G X m e A) (entry : ZFSet.pair (ZFSet.pair g x) y ∈ A) : - g ∈ G ∧ x ∈ X ∧ y ∈ X := by - have shape := ZFSet.pair_mem_prod.1 (action.function.1 entry) - have domain := ZFSet.pair_mem_prod.1 shape.1 - exact ⟨domain.1, domain.2, shape.2⟩ - -theorem SetActionCode.entry_unique {G X m e A g x y z : ZFSet.{u}} - (action : SetActionCode G X m e A) - (first : ZFSet.pair (ZFSet.pair g x) y ∈ A) - (second : ZFSet.pair (ZFSet.pair g x) z ∈ A) : y = z := by - have shape := action.entry_shape first - obtain ⟨w, _, unique⟩ := action.function.2 (ZFSet.pair g x) - (ZFSet.pair_mem_prod.2 ⟨shape.1, shape.2.1⟩) - exact (unique y first).trans (unique z second).symm - -theorem taggedActionGraph_old_iff {G P N A B g x y : ZFSet.{u}} (hx : x ∈ P) : - ZFSet.pair (ZFSet.pair g x) y ∈ taggedActionGraph G P N A B ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A := by - rw [triple_mem_taggedActionGraph] - refine ⟨fun h => h.elim id ?_, Or.inl⟩ - rintro ⟨_, q, _, t, _, equal, _, _⟩ - exact False.elim (pair_tag_not_mem P q (equal ▸ hx)) - -theorem taggedActionGraph_fresh_iff {G P N m e A B g q y : ZFSet.{u}} - (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : - ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) y ∈ taggedActionGraph G P N A B ↔ - ∃ t ∈ N, y = ZFSet.pair P t ∧ ZFSet.pair (ZFSet.pair g q) t ∈ B := by - rw [triple_mem_taggedActionGraph] - constructor - · rintro (entry | ⟨_, q', _, t, ht, equal, hy, entry⟩) - · exact False.elim (pair_tag_not_mem P q (old.entry_shape entry).2.1) - · have same := (ZFSet.pair_inj.1 equal).2 - subst q' - exact ⟨t, ht, hy, entry⟩ - · rintro ⟨t, ht, hy, entry⟩ - have shape := fresh.entry_shape entry - exact Or.inr ⟨shape.1, q, shape.2.1, t, ht, rfl, hy, entry⟩ - -theorem taggedActionGraph_fresh_pair_iff {G P N m e A B g q t : ZFSet.{u}} - (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : - ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) (ZFSet.pair P t) ∈ - taggedActionGraph G P N A B ↔ ZFSet.pair (ZFSet.pair g q) t ∈ B := by - rw [taggedActionGraph_fresh_iff old fresh] - constructor - · rintro ⟨t', _, equal, entry⟩ - exact (ZFSet.pair_inj.1 equal).2.symm ▸ entry - · intro entry - exact ⟨t, (fresh.entry_shape entry).2.2, rfl, entry⟩ - -theorem taggedActionGraph_subset {G P N m e A B : ZFSet.{u}} - (old : SetActionCode G P m e A) : - taggedActionGraph G P N A B ⊆ - ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N) := by - intro z hz - rcases ZFSet.mem_union.1 hz with oldEntry | freshEntry - · obtain ⟨v, hv, y, hy, rfl⟩ := ZFSet.mem_prod.1 (old.function.1 oldEntry) - obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hv - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 - ⟨hg, old_mem_taggedExtension hx⟩, old_mem_taggedExtension hy⟩ - · exact (ZFSet.mem_sep.1 freshEntry).1 - -theorem taggedActionGraph_function {G P N m e A B : ZFSet.{u}} - (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : - ZFSet.IsFunc (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N) - (taggedActionGraph G P N A B) := by - refine ⟨taggedActionGraph_subset old, ?_⟩ - intro v hv - obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hv - rcases mem_taggedExtension.1 hx with hx | ⟨q, hq, rfl⟩ - · obtain ⟨y, entry, unique⟩ := old.function.2 (ZFSet.pair g x) (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) - exact ⟨y, taggedActionGraph_old_iff hx |>.2 entry, - fun z hz => unique z ((taggedActionGraph_old_iff hx).1 hz)⟩ - · obtain ⟨t, entry, unique⟩ := fresh.function.2 (ZFSet.pair g q) (ZFSet.pair_mem_prod.2 ⟨hg, hq⟩) - refine ⟨ZFSet.pair P t, (taggedActionGraph_fresh_pair_iff old fresh).2 entry, ?_⟩ - intro y hy - obtain ⟨t', _, equal, entry'⟩ := (taggedActionGraph_fresh_iff old fresh).1 hy - exact equal.trans (congrArg (ZFSet.pair P) (unique t' entry')) - -theorem taggedActionGraph_one {G P N m e A B : ZFSet.{u}} - (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : - ∀ x ∈ taggedExtension P N, ZFSet.pair (ZFSet.pair e x) x ∈ taggedActionGraph G P N A B := by - intro x hx - rcases mem_taggedExtension.1 hx with hx | ⟨q, hq, rfl⟩ - · exact (taggedActionGraph_old_iff hx).2 (old.one x hx) - · exact (taggedActionGraph_fresh_pair_iff old fresh).2 (fresh.one q hq) - -theorem taggedActionGraph_mul {G P N m e A B : ZFSet.{u}} - (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : - ∀ g ∈ G, ∀ h ∈ G, ∀ k ∈ G, ∀ p ∈ taggedExtension P N, - ∀ q ∈ taggedExtension P N, ∀ s ∈ taggedExtension P N, - ZFSet.pair (ZFSet.pair g h) k ∈ m → - ZFSet.pair (ZFSet.pair h p) q ∈ taggedActionGraph G P N A B → - ZFSet.pair (ZFSet.pair g q) s ∈ taggedActionGraph G P N A B → - ZFSet.pair (ZFSet.pair k p) s ∈ taggedActionGraph G P N A B := by - intro g hg h hh k hk p hp q _ s _ product first second - rcases mem_taggedExtension.1 hp with hp | ⟨x, hx, rfl⟩ - · have first' := (taggedActionGraph_old_iff hp).1 first - have hq := (old.entry_shape first').2.2 - have second' := (taggedActionGraph_old_iff hq).1 second - have hs := (old.entry_shape second').2.2 - exact (taggedActionGraph_old_iff hp).2 (old.mul g hg h hh k hk p hp q hq s hs product first' second') - · obtain ⟨y, hy, rfl, first'⟩ := (taggedActionGraph_fresh_iff old fresh).1 first - obtain ⟨z, hz, rfl, second'⟩ := (taggedActionGraph_fresh_iff old fresh).1 second - exact (taggedActionGraph_fresh_pair_iff old fresh).2 - (fresh.mul g hg h hh k hk x hx y hy z hz product first' second') - -theorem SetActionCode.tagged {G P N m e A B : ZFSet.{u}} - (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : - SetActionCode G (taggedExtension P N) m e (taggedActionGraph G P N A B) := - ⟨taggedActionGraph_function old fresh, taggedActionGraph_one old fresh, taggedActionGraph_mul old fresh⟩ - -end - -namespace SetActionCode - -open SetRealization -universe u -variable {G X m inv one A : ZFSet.{u}} -variable (action : SetActionCode G X m one A) - -noncomputable def rawAct (g : {g : ZFSet.{u} // g ∈ G}) - (x : {x : ZFSet.{u} // x ∈ X}) : {x : ZFSet.{u} // x ∈ X} := - let graph : FunctionGraphOn (ZFSet.prod G X) A := ⟨X, action.function⟩ - let input := (⟨ZFSet.pair g.val x.val, ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ : - {z : ZFSet.{u} // z ∈ ZFSet.prod G X}) - ⟨graph.value input, (ZFSet.pair_mem_prod.1 (action.function.1 (graph.value_entry input))).2⟩ - -theorem rawAct_entry (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ X}) : - ZFSet.pair (ZFSet.pair g.val x.val) (action.rawAct g x).val ∈ A := - (show FunctionGraphOn (ZFSet.prod G X) A from ⟨X, action.function⟩).value_entry - ⟨ZFSet.pair g.val x.val, ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ - -theorem rawAct_eq_iff (g : {g : ZFSet.{u} // g ∈ G}) - (x y : {x : ZFSet.{u} // x ∈ X}) : - action.rawAct g x = y ↔ ZFSet.pair (ZFSet.pair g.val x.val) y.val ∈ A := by - constructor - · intro equal - exact equal ▸ action.rawAct_entry g x - · intro entry - exact Subtype.ext (action.entry_unique (action.rawAct_entry g x) entry) - -noncomputable def inverseActor (group : GroupCode G m inv one) - (g : {g : ZFSet.{u} // g ∈ G}) : {g : ZFSet.{u} // g ∈ G} := - ⟨SetMembers.raw (group.inv (SetMembers.ofMem g.val g.property)), - SetMembers.raw_mem _⟩ - -theorem inverseActor_left (group : GroupCode G m inv one) - (g : {g : ZFSet.{u} // g ∈ G}) : - ZFSet.pair (ZFSet.pair (inverseActor group g).val g.val) one ∈ m := by - apply group.inv_mul g.val g.property _ (inverseActor group g).property - simpa only [inverseActor, SetMembers.raw_ofMem] using - group.inv_mem (SetMembers.ofMem g.val g.property) - -theorem inverseActor_right (group : GroupCode G m inv one) - (g : {g : ZFSet.{u} // g ∈ G}) : - ZFSet.pair (ZFSet.pair g.val (inverseActor group g).val) one ∈ m := by - let actor := SetMembers.ofMem g.val g.property - have equal : group.mul actor (group.inv actor) = group.one := by - let := group.toGroup - exact mul_inv_cancel actor - have entry := group.mul_mem actor (group.inv actor) - rw [equal, group.raw_one] at entry - simpa only [actor, inverseActor, SetMembers.raw_ofMem] using entry - -theorem rawAct_inverse_left (group : GroupCode G m inv one) - (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ X}) : - action.rawAct (inverseActor group g) (action.rawAct g x) = x := by - apply Subtype.ext - exact action.entry_unique - (action.mul _ (inverseActor group g).property g.val g.property one group.identity_mem - x.val x.property _ (action.rawAct g x).property _ - (action.rawAct (inverseActor group g) (action.rawAct g x)).property - (inverseActor_left group g) (action.rawAct_entry g x) - (action.rawAct_entry (inverseActor group g) (action.rawAct g x))) - (action.one x.val x.property) - -theorem rawAct_inverse_right (group : GroupCode G m inv one) - (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ X}) : - action.rawAct g (action.rawAct (inverseActor group g) x) = x := by - apply Subtype.ext - exact action.entry_unique - (action.mul g.val g.property _ (inverseActor group g).property one group.identity_mem - x.val x.property _ (action.rawAct (inverseActor group g) x).property _ - (action.rawAct g (action.rawAct (inverseActor group g) x)).property - (inverseActor_right group g) (action.rawAct_entry (inverseActor group g) x) - (action.rawAct_entry g (action.rawAct (inverseActor group g) x))) - (action.one x.val x.property) - -noncomputable def toPerm (group : GroupCode G m inv one) - (g : {g : ZFSet.{u} // g ∈ G}) : Equiv.Perm {x : ZFSet.{u} // x ∈ X} where - toFun := action.rawAct g - invFun := action.rawAct (inverseActor group g) - left_inv := action.rawAct_inverse_left group g - right_inv := action.rawAct_inverse_right group g - -end SetActionCode - -section - -universe u - -namespace BoundedFormula - -open SetFormula - -def taggedActionEntryFormula {n} (z G P N B : Fin n) : BoundedFormula n := - exMem G (exMem N.succ (exMem N.succ.succ - (.conj (nestedActionTripleFormula z.succ.succ.succ 2 P.succ.succ.succ 1 P.succ.succ.succ 0) - (tripleMembershipFormula 2 1 0 B.succ.succ.succ)))) - -theorem truth_taggedActionEntryFormula {n} (z G P N B : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (taggedActionEntryFormula z G P N B) env ↔ - ∃ g ∈ env G, ∃ q ∈ env N, ∃ t ∈ env N, - env z = ZFSet.pair (ZFSet.pair g (ZFSet.pair (env P) q)) (ZFSet.pair (env P) t) ∧ - ZFSet.pair (ZFSet.pair g q) t ∈ env B := by - simp only [taggedActionEntryFormula, truth_exMem, Truth, - truth_nestedActionTripleFormula, truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem taggedActionGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G P N A B : ZFSet.{u}} (hG : G ∈ M.sets) (hP : P ∈ M.sets) - (hN : N ∈ M.sets) (hA : A ∈ M.sets) (hB : B ∈ M.sets) : - taggedActionGraph G P N A B ∈ M.sets := by - have hL := M.taggedExtension_mem pairing unions powers separation hP hN - let params := extend G (extend P (extend N (extend B Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.taggedActionEntryFormula 0 1 2 3 4) params - (Fin.cases hG (Fin.cases hP (Fin.cases hN (Fin.cases hB (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hG hL) hL) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.taggedActionEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N)) = - ZFSet.sep (fun z => ∃ g ∈ G, ∃ q ∈ N, ∃ t ∈ N, - z = ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) (ZFSet.pair P t) ∧ - ZFSet.pair (ZFSet.pair g q) t ∈ B) - (ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N)) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_taggedActionEntryFormula 0 1 2 3 4 _) - exact M.binary_union_mem pairing unions hA (equal ▸ selected) - -end TransitiveGround - -structure CodedAttachmentCovariance (G P N A B inside shadow upper : ZFSet.{u}) : Prop where - inside : ∀ g ∈ G, ∀ q ∈ N, ∀ t ∈ N, ∀ q' ∈ N, ∀ t' ∈ N, - ZFSet.pair (ZFSet.pair g q) q' ∈ B → ZFSet.pair (ZFSet.pair g t) t' ∈ B → - ZFSet.pair q t ∈ inside → ZFSet.pair q' t' ∈ inside - shadow : ∀ g ∈ G, ∀ q ∈ N, ∀ q' ∈ N, ∀ p ∈ P, ∀ p' ∈ P, - ZFSet.pair (ZFSet.pair g q) q' ∈ B → ZFSet.pair (ZFSet.pair g p) p' ∈ A → - ZFSet.pair q p ∈ shadow → ZFSet.pair q' p' ∈ shadow - upper : ∀ g ∈ G, ∀ q ∈ N, ∀ q' ∈ N, ∀ p ∈ P, ∀ p' ∈ P, - ZFSet.pair (ZFSet.pair g q) q' ∈ B → ZFSet.pair (ZFSet.pair g p) p' ∈ A → - ZFSet.pair q p ∈ upper → ZFSet.pair q' p' ∈ upper - -theorem CodedAttachmentCovariance.monotone - {G P N m e r A B inside shadow upper : ZFSet.{u}} - (covariance : CodedAttachmentCovariance G P N A B inside shadow upper) - (old : PosetActionCode G P m e r A) (fresh : SetActionCode G N m e B) : - ∀ g ∈ G, ∀ p ∈ taggedExtension P N, ∀ q ∈ taggedExtension P N, - ∀ p' ∈ taggedExtension P N, ∀ q' ∈ taggedExtension P N, - ZFSet.pair (ZFSet.pair g p) p' ∈ taggedActionGraph G P N A B → - ZFSet.pair (ZFSet.pair g q) q' ∈ taggedActionGraph G P N A B → - ZFSet.pair p q ∈ codedAttachmentOrder P N r inside shadow upper → - ZFSet.pair p' q' ∈ codedAttachmentOrder P N r inside shadow upper := by - intro g hg p _ q _ p' hp' q' hq' first second lower - have compared := ((pair_mem_codedAttachmentOrder P N r inside shadow upper p q).1 lower).2.2 - apply (pair_mem_codedAttachmentOrder P N r inside shadow upper p' q').2 - refine ⟨hp', hq', ?_⟩ - rcases compared with oldOld | oldFresh | freshOld | freshFresh - · obtain ⟨hp, hq, below⟩ := oldOld - have actedP := (taggedActionGraph_old_iff hp).1 first - have actedQ := (taggedActionGraph_old_iff hq).1 second - have hp'P := (old.toSetAction.entry_shape actedP).2.2 - have hq'P := (old.toSetAction.entry_shape actedQ).2.2 - exact Or.inl ⟨hp'P, hq'P, old.monotone g hg p hp q hq p' hp'P q' hq'P actedP actedQ below⟩ - · obtain ⟨hp, t, ht, s, hs, rfl, shadowEntry, below⟩ := oldFresh - have actedP := (taggedActionGraph_old_iff hp).1 first - have hp'P := (old.toSetAction.entry_shape actedP).2.2 - obtain ⟨t', ht', rfl, actedT⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 second - obtain ⟨s', actedS, _⟩ := old.function.2 (ZFSet.pair g s) (ZFSet.pair_mem_prod.2 ⟨hg, hs⟩) - have hs' := (old.toSetAction.entry_shape actedS).2.2 - exact Or.inr (Or.inl ⟨hp'P, t', ht', s', hs', rfl, - covariance.shadow g hg t ht t' ht' s hs s' hs' actedT actedS shadowEntry, - old.monotone g hg p hp s hs p' hp'P s' hs' actedP actedS below⟩) - · obtain ⟨hq, t, ht, rfl, upperEntry⟩ := freshOld - obtain ⟨t', ht', rfl, actedT⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 first - have actedQ := (taggedActionGraph_old_iff hq).1 second - have hq'P := (old.toSetAction.entry_shape actedQ).2.2 - exact Or.inr (Or.inr (Or.inl ⟨hq'P, t', ht', rfl, - covariance.upper g hg t ht t' ht' q hq q' hq'P actedT actedQ upperEntry⟩)) - · obtain ⟨s, hs, t, ht, rfl, rfl, below⟩ := freshFresh - obtain ⟨s', hs', rfl, actedS⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 first - obtain ⟨t', ht', rfl, actedT⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 second - refine Or.inr (Or.inr (Or.inr ⟨s', hs', t', ht', rfl, rfl, ?_⟩)) - rcases below with internal | ⟨v, hv, shadowEntry, upperEntry⟩ - · exact Or.inl (covariance.inside g hg s hs t ht s' hs' t' ht' actedS actedT internal) - · obtain ⟨v', actedV, _⟩ := old.function.2 (ZFSet.pair g v) (ZFSet.pair_mem_prod.2 ⟨hg, hv⟩) - have hv' := (old.toSetAction.entry_shape actedV).2.2 - exact Or.inr ⟨v', hv', - covariance.shadow g hg t ht t' ht' v hv v' hv' actedT actedV shadowEntry, - covariance.upper g hg s hs s' hs' v hv v' hv' actedS actedV upperEntry⟩ - -theorem PosetActionCode.tagged_attachment - {G P N m e r A B inside shadow upper : ZFSet.{u}} - (old : PosetActionCode G P m e r A) (fresh : SetActionCode G N m e B) - (covariance : CodedAttachmentCovariance G P N A B inside shadow upper) : - PosetActionCode G (taggedExtension P N) m e - (codedAttachmentOrder P N r inside shadow upper) (taggedActionGraph G P N A B) := - ⟨(old.toSetAction.tagged fresh).function, (old.toSetAction.tagged fresh).one, - (old.toSetAction.tagged fresh).mul, covariance.monotone old fresh⟩ - -end - -open Compression.RecursiveMaps -universe u - -structure CodedRecursiveTaskAction - {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} - {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} - (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) - (T : ZFSet.{u}) : Prop where - taskAction : SetActionCode G I m one T - source : ∀ g i j a b, ZFSet.pair (ZFSet.pair g i) j ∈ T → - ZFSet.pair i a ∈ Sources → ZFSet.pair j b ∈ Sources → a = b - intertwine : ∀ g i j S S' p x y, ZFSet.pair (ZFSet.pair g i) j ∈ T → - ZFSet.pair i S ∈ Maps → ZFSet.pair j S' ∈ Maps → - ZFSet.pair p x ∈ S → ZFSet.pair p y ∈ S' → ZFSet.pair (ZFSet.pair g x) y ∈ A - -namespace CodedRecursiveTaskAction - -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (s : CodedRecursiveTaskAction h T) - -noncomputable def current (_s : CodedRecursiveTaskAction h T) (g : {g : ZFSet.{u} // g ∈ G}) : - Compression.MeetIso d.templates.extension d.templates.extension := by - let encoding := d.coding.encodingIso - let acted := h.action.toMeetIso h.group d.batch_meetOrder g - refine isoOfOrder - (fun x => encoding.inverse (acted.toFun (encoding.toFun x))) - (fun x => encoding.inverse (acted.inverse (encoding.toFun x))) ?_ ?_ ?_ - · intro x - rw [encoding.right_inverse, acted.left_inverse, encoding.left_inverse] - · intro x - rw [encoding.right_inverse, acted.right_inverse, encoding.left_inverse] - · intro x y - exact ((inverseIso encoding).le_iff _ _).trans - ((acted.le_iff _ _).trans (encoding.le_iff x y)) - -theorem current_entry (g : {g : ZFSet.{u} // g ∈ G}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - ZFSet.pair (ZFSet.pair g.val (d.coding.encode x)) - (d.coding.encode ((s.current g).toFun x)) ∈ A := by - change ZFSet.pair (ZFSet.pair g.val (d.coding.encode x)) - (d.coding.encode (d.coding.decode ((h.action.toMeetIso h.group d.batch_meetOrder g).toFun - ⟨d.coding.encode x, d.coding.encode_mem x⟩))) ∈ A - rw [d.coding.encode_decode] - exact h.action.toMeetIso_entry h.group d.batch_meetOrder g - ⟨d.coding.encode x, d.coding.encode_mem x⟩ - -noncomputable def toTaskSymmetry (g : {g : ZFSet.{u} // g ∈ G}) : TaskSymmetry h.toInputs where - perm := s.taskAction.rawAct g - inverse := (s.taskAction.toPerm h.group g).invFun - left_inverse := (s.taskAction.toPerm h.group g).left_inv - right_inverse := (s.taskAction.toPerm h.group g).right_inv - current := s.current g - source i := Subtype.ext (s.source g.val i.val _ _ _ (s.taskAction.rawAct_entry g i) - (h.source_entry i) (h.source_entry (s.taskAction.rawAct g i))).symm - intertwine i p := by - apply d.coding.encode_injective - exact h.action.toSetAction.entry_unique (s.current_entry g ((h.toInputs.previous i).toFun p)) - (s.intertwine g.val i.val _ _ _ p.val _ _ (s.taskAction.rawAct_entry g i) - (h.maps.value_entry i) (h.maps.value_entry (s.taskAction.rawAct g i)) - (h.toInputs_previous_entry i p) (h.toInputs_previous_entry (s.taskAction.rawAct g i) p)) - -theorem toTaskSymmetry_perm_entry (g : {g : ZFSet.{u} // g ∈ G}) - (i : {i : ZFSet.{u} // i ∈ I}) : - ZFSet.pair (ZFSet.pair g.val i.val) ((s.toTaskSymmetry g).perm i).val ∈ T := - s.taskAction.rawAct_entry g i - -theorem toTaskSymmetry_current_entry (g : {g : ZFSet.{u} // g ∈ G}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - ZFSet.pair (ZFSet.pair g.val (d.coding.encode x)) - (d.coding.encode ((s.toTaskSymmetry g).current.toFun x)) ∈ A := s.current_entry g x - -end CodedRecursiveTaskAction - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveLiftAgreement + +namespace OAI + +namespace PartitionPilot.Forcing + +section + +universe u + +structure SetActionCode (G X m e A : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc (ZFSet.prod G X) X A + one : ∀ p ∈ X, ZFSet.pair (ZFSet.pair e p) p ∈ A + mul : ∀ g ∈ G, ∀ h ∈ G, ∀ k ∈ G, ∀ p ∈ X, ∀ q ∈ X, ∀ r ∈ X, + ZFSet.pair (ZFSet.pair g h) k ∈ m → ZFSet.pair (ZFSet.pair h p) q ∈ A → + ZFSet.pair (ZFSet.pair g q) r ∈ A → ZFSet.pair (ZFSet.pair k p) r ∈ A + +theorem PosetActionCode.toSetAction {G P m e r A : ZFSet.{u}} + (action : PosetActionCode G P m e r A) : SetActionCode G P m e A := + ⟨action.function, action.one, action.mul⟩ + +noncomputable def taggedActionGraph (G P N A B : ZFSet.{u}) : ZFSet.{u} := + A ∪ ZFSet.sep (fun z => ∃ g ∈ G, ∃ q ∈ N, ∃ t ∈ N, + z = ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) (ZFSet.pair P t) ∧ + ZFSet.pair (ZFSet.pair g q) t ∈ B) + (ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N)) + +theorem triple_mem_taggedActionGraph (G P N A B g x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g x) y ∈ taggedActionGraph G P N A B ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A ∨ + (g ∈ G ∧ ∃ q ∈ N, ∃ t ∈ N, x = ZFSet.pair P q ∧ y = ZFSet.pair P t ∧ + ZFSet.pair (ZFSet.pair g q) t ∈ B) := by + rw [taggedActionGraph, ZFSet.mem_union, ZFSet.mem_sep] + apply or_congr Iff.rfl + constructor + · rintro ⟨_, g', hg, q, hq, t, ht, equal, entry⟩ + obtain ⟨first, last⟩ := ZFSet.pair_inj.1 equal + obtain ⟨actor, middle⟩ := ZFSet.pair_inj.1 first + subst g' + exact ⟨hg, q, hq, t, ht, middle, last, entry⟩ + · rintro ⟨hg, q, hq, t, ht, rfl, rfl, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 + ⟨hg, pair_mem_taggedExtension.2 hq⟩, pair_mem_taggedExtension.2 ht⟩, + g, hg, q, hq, t, ht, rfl, entry⟩ + +theorem SetActionCode.entry_shape {G X m e A g x y : ZFSet.{u}} + (action : SetActionCode G X m e A) (entry : ZFSet.pair (ZFSet.pair g x) y ∈ A) : + g ∈ G ∧ x ∈ X ∧ y ∈ X := by + have shape := ZFSet.pair_mem_prod.1 (action.function.1 entry) + have domain := ZFSet.pair_mem_prod.1 shape.1 + exact ⟨domain.1, domain.2, shape.2⟩ + +theorem SetActionCode.entry_unique {G X m e A g x y z : ZFSet.{u}} + (action : SetActionCode G X m e A) + (first : ZFSet.pair (ZFSet.pair g x) y ∈ A) + (second : ZFSet.pair (ZFSet.pair g x) z ∈ A) : y = z := by + have shape := action.entry_shape first + obtain ⟨w, _, unique⟩ := action.function.2 (ZFSet.pair g x) + (ZFSet.pair_mem_prod.2 ⟨shape.1, shape.2.1⟩) + exact (unique y first).trans (unique z second).symm + +theorem taggedActionGraph_old_iff {G P N A B g x y : ZFSet.{u}} (hx : x ∈ P) : + ZFSet.pair (ZFSet.pair g x) y ∈ taggedActionGraph G P N A B ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A := by + rw [triple_mem_taggedActionGraph] + refine ⟨fun h => h.elim id ?_, Or.inl⟩ + rintro ⟨_, q, _, t, _, equal, _, _⟩ + exact False.elim (pair_tag_not_mem P q (equal ▸ hx)) + +theorem taggedActionGraph_fresh_iff {G P N m e A B g q y : ZFSet.{u}} + (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : + ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) y ∈ taggedActionGraph G P N A B ↔ + ∃ t ∈ N, y = ZFSet.pair P t ∧ ZFSet.pair (ZFSet.pair g q) t ∈ B := by + rw [triple_mem_taggedActionGraph] + constructor + · rintro (entry | ⟨_, q', _, t, ht, equal, hy, entry⟩) + · exact False.elim (pair_tag_not_mem P q (old.entry_shape entry).2.1) + · have same := (ZFSet.pair_inj.1 equal).2 + subst q' + exact ⟨t, ht, hy, entry⟩ + · rintro ⟨t, ht, hy, entry⟩ + have shape := fresh.entry_shape entry + exact Or.inr ⟨shape.1, q, shape.2.1, t, ht, rfl, hy, entry⟩ + +theorem taggedActionGraph_fresh_pair_iff {G P N m e A B g q t : ZFSet.{u}} + (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : + ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) (ZFSet.pair P t) ∈ + taggedActionGraph G P N A B ↔ ZFSet.pair (ZFSet.pair g q) t ∈ B := by + rw [taggedActionGraph_fresh_iff old fresh] + constructor + · rintro ⟨t', _, equal, entry⟩ + exact (ZFSet.pair_inj.1 equal).2.symm ▸ entry + · intro entry + exact ⟨t, (fresh.entry_shape entry).2.2, rfl, entry⟩ + +theorem taggedActionGraph_subset {G P N m e A B : ZFSet.{u}} + (old : SetActionCode G P m e A) : + taggedActionGraph G P N A B ⊆ + ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N) := by + intro z hz + rcases ZFSet.mem_union.1 hz with oldEntry | freshEntry + · obtain ⟨v, hv, y, hy, rfl⟩ := ZFSet.mem_prod.1 (old.function.1 oldEntry) + obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hv + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 + ⟨hg, old_mem_taggedExtension hx⟩, old_mem_taggedExtension hy⟩ + · exact (ZFSet.mem_sep.1 freshEntry).1 + +theorem taggedActionGraph_function {G P N m e A B : ZFSet.{u}} + (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : + ZFSet.IsFunc (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N) + (taggedActionGraph G P N A B) := by + refine ⟨taggedActionGraph_subset old, ?_⟩ + intro v hv + obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hv + rcases mem_taggedExtension.1 hx with hx | ⟨q, hq, rfl⟩ + · obtain ⟨y, entry, unique⟩ := old.function.2 (ZFSet.pair g x) (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) + exact ⟨y, taggedActionGraph_old_iff hx |>.2 entry, + fun z hz => unique z ((taggedActionGraph_old_iff hx).1 hz)⟩ + · obtain ⟨t, entry, unique⟩ := fresh.function.2 (ZFSet.pair g q) (ZFSet.pair_mem_prod.2 ⟨hg, hq⟩) + refine ⟨ZFSet.pair P t, (taggedActionGraph_fresh_pair_iff old fresh).2 entry, ?_⟩ + intro y hy + obtain ⟨t', _, equal, entry'⟩ := (taggedActionGraph_fresh_iff old fresh).1 hy + exact equal.trans (congrArg (ZFSet.pair P) (unique t' entry')) + +theorem taggedActionGraph_one {G P N m e A B : ZFSet.{u}} + (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : + ∀ x ∈ taggedExtension P N, ZFSet.pair (ZFSet.pair e x) x ∈ taggedActionGraph G P N A B := by + intro x hx + rcases mem_taggedExtension.1 hx with hx | ⟨q, hq, rfl⟩ + · exact (taggedActionGraph_old_iff hx).2 (old.one x hx) + · exact (taggedActionGraph_fresh_pair_iff old fresh).2 (fresh.one q hq) + +theorem taggedActionGraph_mul {G P N m e A B : ZFSet.{u}} + (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : + ∀ g ∈ G, ∀ h ∈ G, ∀ k ∈ G, ∀ p ∈ taggedExtension P N, + ∀ q ∈ taggedExtension P N, ∀ s ∈ taggedExtension P N, + ZFSet.pair (ZFSet.pair g h) k ∈ m → + ZFSet.pair (ZFSet.pair h p) q ∈ taggedActionGraph G P N A B → + ZFSet.pair (ZFSet.pair g q) s ∈ taggedActionGraph G P N A B → + ZFSet.pair (ZFSet.pair k p) s ∈ taggedActionGraph G P N A B := by + intro g hg h hh k hk p hp q _ s _ product first second + rcases mem_taggedExtension.1 hp with hp | ⟨x, hx, rfl⟩ + · have first' := (taggedActionGraph_old_iff hp).1 first + have hq := (old.entry_shape first').2.2 + have second' := (taggedActionGraph_old_iff hq).1 second + have hs := (old.entry_shape second').2.2 + exact (taggedActionGraph_old_iff hp).2 (old.mul g hg h hh k hk p hp q hq s hs product first' second') + · obtain ⟨y, hy, rfl, first'⟩ := (taggedActionGraph_fresh_iff old fresh).1 first + obtain ⟨z, hz, rfl, second'⟩ := (taggedActionGraph_fresh_iff old fresh).1 second + exact (taggedActionGraph_fresh_pair_iff old fresh).2 + (fresh.mul g hg h hh k hk x hx y hy z hz product first' second') + +theorem SetActionCode.tagged {G P N m e A B : ZFSet.{u}} + (old : SetActionCode G P m e A) (fresh : SetActionCode G N m e B) : + SetActionCode G (taggedExtension P N) m e (taggedActionGraph G P N A B) := + ⟨taggedActionGraph_function old fresh, taggedActionGraph_one old fresh, taggedActionGraph_mul old fresh⟩ + +end + +namespace SetActionCode + +open SetRealization +universe u +variable {G X m inv one A : ZFSet.{u}} +variable (action : SetActionCode G X m one A) + +noncomputable def rawAct (g : {g : ZFSet.{u} // g ∈ G}) + (x : {x : ZFSet.{u} // x ∈ X}) : {x : ZFSet.{u} // x ∈ X} := + let graph : FunctionGraphOn (ZFSet.prod G X) A := ⟨X, action.function⟩ + let input := (⟨ZFSet.pair g.val x.val, ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ : + {z : ZFSet.{u} // z ∈ ZFSet.prod G X}) + ⟨graph.value input, (ZFSet.pair_mem_prod.1 (action.function.1 (graph.value_entry input))).2⟩ + +theorem rawAct_entry (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ X}) : + ZFSet.pair (ZFSet.pair g.val x.val) (action.rawAct g x).val ∈ A := + (show FunctionGraphOn (ZFSet.prod G X) A from ⟨X, action.function⟩).value_entry + ⟨ZFSet.pair g.val x.val, ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ + +theorem rawAct_eq_iff (g : {g : ZFSet.{u} // g ∈ G}) + (x y : {x : ZFSet.{u} // x ∈ X}) : + action.rawAct g x = y ↔ ZFSet.pair (ZFSet.pair g.val x.val) y.val ∈ A := by + constructor + · intro equal + exact equal ▸ action.rawAct_entry g x + · intro entry + exact Subtype.ext (action.entry_unique (action.rawAct_entry g x) entry) + +noncomputable def inverseActor (group : GroupCode G m inv one) + (g : {g : ZFSet.{u} // g ∈ G}) : {g : ZFSet.{u} // g ∈ G} := + ⟨SetMembers.raw (group.inv (SetMembers.ofMem g.val g.property)), + SetMembers.raw_mem _⟩ + +theorem inverseActor_left (group : GroupCode G m inv one) + (g : {g : ZFSet.{u} // g ∈ G}) : + ZFSet.pair (ZFSet.pair (inverseActor group g).val g.val) one ∈ m := by + apply group.inv_mul g.val g.property _ (inverseActor group g).property + simpa only [inverseActor, SetMembers.raw_ofMem] using + group.inv_mem (SetMembers.ofMem g.val g.property) + +theorem inverseActor_right (group : GroupCode G m inv one) + (g : {g : ZFSet.{u} // g ∈ G}) : + ZFSet.pair (ZFSet.pair g.val (inverseActor group g).val) one ∈ m := by + let actor := SetMembers.ofMem g.val g.property + have equal : group.mul actor (group.inv actor) = group.one := by + let := group.toGroup + exact mul_inv_cancel actor + have entry := group.mul_mem actor (group.inv actor) + rw [equal, group.raw_one] at entry + simpa only [actor, inverseActor, SetMembers.raw_ofMem] using entry + +theorem rawAct_inverse_left (group : GroupCode G m inv one) + (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ X}) : + action.rawAct (inverseActor group g) (action.rawAct g x) = x := by + apply Subtype.ext + exact action.entry_unique + (action.mul _ (inverseActor group g).property g.val g.property one group.identity_mem + x.val x.property _ (action.rawAct g x).property _ + (action.rawAct (inverseActor group g) (action.rawAct g x)).property + (inverseActor_left group g) (action.rawAct_entry g x) + (action.rawAct_entry (inverseActor group g) (action.rawAct g x))) + (action.one x.val x.property) + +theorem rawAct_inverse_right (group : GroupCode G m inv one) + (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ X}) : + action.rawAct g (action.rawAct (inverseActor group g) x) = x := by + apply Subtype.ext + exact action.entry_unique + (action.mul g.val g.property _ (inverseActor group g).property one group.identity_mem + x.val x.property _ (action.rawAct (inverseActor group g) x).property _ + (action.rawAct g (action.rawAct (inverseActor group g) x)).property + (inverseActor_right group g) (action.rawAct_entry (inverseActor group g) x) + (action.rawAct_entry g (action.rawAct (inverseActor group g) x))) + (action.one x.val x.property) + +noncomputable def toPerm (group : GroupCode G m inv one) + (g : {g : ZFSet.{u} // g ∈ G}) : Equiv.Perm {x : ZFSet.{u} // x ∈ X} where + toFun := action.rawAct g + invFun := action.rawAct (inverseActor group g) + left_inv := action.rawAct_inverse_left group g + right_inv := action.rawAct_inverse_right group g + +end SetActionCode + +section + +universe u + +namespace BoundedFormula + +open SetFormula + +def taggedActionEntryFormula {n} (z G P N B : Fin n) : BoundedFormula n := + exMem G (exMem N.succ (exMem N.succ.succ + (.conj (nestedActionTripleFormula z.succ.succ.succ 2 P.succ.succ.succ 1 P.succ.succ.succ 0) + (tripleMembershipFormula 2 1 0 B.succ.succ.succ)))) + +theorem truth_taggedActionEntryFormula {n} (z G P N B : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (taggedActionEntryFormula z G P N B) env ↔ + ∃ g ∈ env G, ∃ q ∈ env N, ∃ t ∈ env N, + env z = ZFSet.pair (ZFSet.pair g (ZFSet.pair (env P) q)) (ZFSet.pair (env P) t) ∧ + ZFSet.pair (ZFSet.pair g q) t ∈ env B := by + simp only [taggedActionEntryFormula, truth_exMem, Truth, + truth_nestedActionTripleFormula, truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem taggedActionGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G P N A B : ZFSet.{u}} (hG : G ∈ M.sets) (hP : P ∈ M.sets) + (hN : N ∈ M.sets) (hA : A ∈ M.sets) (hB : B ∈ M.sets) : + taggedActionGraph G P N A B ∈ M.sets := by + have hL := M.taggedExtension_mem pairing unions powers separation hP hN + let params := extend G (extend P (extend N (extend B Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.taggedActionEntryFormula 0 1 2 3 4) params + (Fin.cases hG (Fin.cases hP (Fin.cases hN (Fin.cases hB (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hG hL) hL) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.taggedActionEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N)) = + ZFSet.sep (fun z => ∃ g ∈ G, ∃ q ∈ N, ∃ t ∈ N, + z = ZFSet.pair (ZFSet.pair g (ZFSet.pair P q)) (ZFSet.pair P t) ∧ + ZFSet.pair (ZFSet.pair g q) t ∈ B) + (ZFSet.prod (ZFSet.prod G (taggedExtension P N)) (taggedExtension P N)) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_taggedActionEntryFormula 0 1 2 3 4 _) + exact M.binary_union_mem pairing unions hA (equal ▸ selected) + +end TransitiveGround + +structure CodedAttachmentCovariance (G P N A B inside shadow upper : ZFSet.{u}) : Prop where + inside : ∀ g ∈ G, ∀ q ∈ N, ∀ t ∈ N, ∀ q' ∈ N, ∀ t' ∈ N, + ZFSet.pair (ZFSet.pair g q) q' ∈ B → ZFSet.pair (ZFSet.pair g t) t' ∈ B → + ZFSet.pair q t ∈ inside → ZFSet.pair q' t' ∈ inside + shadow : ∀ g ∈ G, ∀ q ∈ N, ∀ q' ∈ N, ∀ p ∈ P, ∀ p' ∈ P, + ZFSet.pair (ZFSet.pair g q) q' ∈ B → ZFSet.pair (ZFSet.pair g p) p' ∈ A → + ZFSet.pair q p ∈ shadow → ZFSet.pair q' p' ∈ shadow + upper : ∀ g ∈ G, ∀ q ∈ N, ∀ q' ∈ N, ∀ p ∈ P, ∀ p' ∈ P, + ZFSet.pair (ZFSet.pair g q) q' ∈ B → ZFSet.pair (ZFSet.pair g p) p' ∈ A → + ZFSet.pair q p ∈ upper → ZFSet.pair q' p' ∈ upper + +theorem CodedAttachmentCovariance.monotone + {G P N m e r A B inside shadow upper : ZFSet.{u}} + (covariance : CodedAttachmentCovariance G P N A B inside shadow upper) + (old : PosetActionCode G P m e r A) (fresh : SetActionCode G N m e B) : + ∀ g ∈ G, ∀ p ∈ taggedExtension P N, ∀ q ∈ taggedExtension P N, + ∀ p' ∈ taggedExtension P N, ∀ q' ∈ taggedExtension P N, + ZFSet.pair (ZFSet.pair g p) p' ∈ taggedActionGraph G P N A B → + ZFSet.pair (ZFSet.pair g q) q' ∈ taggedActionGraph G P N A B → + ZFSet.pair p q ∈ codedAttachmentOrder P N r inside shadow upper → + ZFSet.pair p' q' ∈ codedAttachmentOrder P N r inside shadow upper := by + intro g hg p _ q _ p' hp' q' hq' first second lower + have compared := ((pair_mem_codedAttachmentOrder P N r inside shadow upper p q).1 lower).2.2 + apply (pair_mem_codedAttachmentOrder P N r inside shadow upper p' q').2 + refine ⟨hp', hq', ?_⟩ + rcases compared with oldOld | oldFresh | freshOld | freshFresh + · obtain ⟨hp, hq, below⟩ := oldOld + have actedP := (taggedActionGraph_old_iff hp).1 first + have actedQ := (taggedActionGraph_old_iff hq).1 second + have hp'P := (old.toSetAction.entry_shape actedP).2.2 + have hq'P := (old.toSetAction.entry_shape actedQ).2.2 + exact Or.inl ⟨hp'P, hq'P, old.monotone g hg p hp q hq p' hp'P q' hq'P actedP actedQ below⟩ + · obtain ⟨hp, t, ht, s, hs, rfl, shadowEntry, below⟩ := oldFresh + have actedP := (taggedActionGraph_old_iff hp).1 first + have hp'P := (old.toSetAction.entry_shape actedP).2.2 + obtain ⟨t', ht', rfl, actedT⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 second + obtain ⟨s', actedS, _⟩ := old.function.2 (ZFSet.pair g s) (ZFSet.pair_mem_prod.2 ⟨hg, hs⟩) + have hs' := (old.toSetAction.entry_shape actedS).2.2 + exact Or.inr (Or.inl ⟨hp'P, t', ht', s', hs', rfl, + covariance.shadow g hg t ht t' ht' s hs s' hs' actedT actedS shadowEntry, + old.monotone g hg p hp s hs p' hp'P s' hs' actedP actedS below⟩) + · obtain ⟨hq, t, ht, rfl, upperEntry⟩ := freshOld + obtain ⟨t', ht', rfl, actedT⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 first + have actedQ := (taggedActionGraph_old_iff hq).1 second + have hq'P := (old.toSetAction.entry_shape actedQ).2.2 + exact Or.inr (Or.inr (Or.inl ⟨hq'P, t', ht', rfl, + covariance.upper g hg t ht t' ht' q hq q' hq'P actedT actedQ upperEntry⟩)) + · obtain ⟨s, hs, t, ht, rfl, rfl, below⟩ := freshFresh + obtain ⟨s', hs', rfl, actedS⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 first + obtain ⟨t', ht', rfl, actedT⟩ := (taggedActionGraph_fresh_iff old.toSetAction fresh).1 second + refine Or.inr (Or.inr (Or.inr ⟨s', hs', t', ht', rfl, rfl, ?_⟩)) + rcases below with internal | ⟨v, hv, shadowEntry, upperEntry⟩ + · exact Or.inl (covariance.inside g hg s hs t ht s' hs' t' ht' actedS actedT internal) + · obtain ⟨v', actedV, _⟩ := old.function.2 (ZFSet.pair g v) (ZFSet.pair_mem_prod.2 ⟨hg, hv⟩) + have hv' := (old.toSetAction.entry_shape actedV).2.2 + exact Or.inr ⟨v', hv', + covariance.shadow g hg t ht t' ht' v hv v' hv' actedT actedV shadowEntry, + covariance.upper g hg s hs s' hs' v hv v' hv' actedS actedV upperEntry⟩ + +theorem PosetActionCode.tagged_attachment + {G P N m e r A B inside shadow upper : ZFSet.{u}} + (old : PosetActionCode G P m e r A) (fresh : SetActionCode G N m e B) + (covariance : CodedAttachmentCovariance G P N A B inside shadow upper) : + PosetActionCode G (taggedExtension P N) m e + (codedAttachmentOrder P N r inside shadow upper) (taggedActionGraph G P N A B) := + ⟨(old.toSetAction.tagged fresh).function, (old.toSetAction.tagged fresh).one, + (old.toSetAction.tagged fresh).mul, covariance.monotone old fresh⟩ + +end + +open Compression.RecursiveMaps +universe u + +structure CodedRecursiveTaskAction + {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} + {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} + (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) + (T : ZFSet.{u}) : Prop where + taskAction : SetActionCode G I m one T + source : ∀ g i j a b, ZFSet.pair (ZFSet.pair g i) j ∈ T → + ZFSet.pair i a ∈ Sources → ZFSet.pair j b ∈ Sources → a = b + intertwine : ∀ g i j S S' p x y, ZFSet.pair (ZFSet.pair g i) j ∈ T → + ZFSet.pair i S ∈ Maps → ZFSet.pair j S' ∈ Maps → + ZFSet.pair p x ∈ S → ZFSet.pair p y ∈ S' → ZFSet.pair (ZFSet.pair g x) y ∈ A + +namespace CodedRecursiveTaskAction + +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (s : CodedRecursiveTaskAction h T) + +noncomputable def current (_s : CodedRecursiveTaskAction h T) (g : {g : ZFSet.{u} // g ∈ G}) : + Compression.MeetIso d.templates.extension d.templates.extension := by + let encoding := d.coding.encodingIso + let acted := h.action.toMeetIso h.group d.batch_meetOrder g + refine isoOfOrder + (fun x => encoding.inverse (acted.toFun (encoding.toFun x))) + (fun x => encoding.inverse (acted.inverse (encoding.toFun x))) ?_ ?_ ?_ + · intro x + rw [encoding.right_inverse, acted.left_inverse, encoding.left_inverse] + · intro x + rw [encoding.right_inverse, acted.right_inverse, encoding.left_inverse] + · intro x y + exact ((inverseIso encoding).le_iff _ _).trans + ((acted.le_iff _ _).trans (encoding.le_iff x y)) + +theorem current_entry (g : {g : ZFSet.{u} // g ∈ G}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + ZFSet.pair (ZFSet.pair g.val (d.coding.encode x)) + (d.coding.encode ((s.current g).toFun x)) ∈ A := by + change ZFSet.pair (ZFSet.pair g.val (d.coding.encode x)) + (d.coding.encode (d.coding.decode ((h.action.toMeetIso h.group d.batch_meetOrder g).toFun + ⟨d.coding.encode x, d.coding.encode_mem x⟩))) ∈ A + rw [d.coding.encode_decode] + exact h.action.toMeetIso_entry h.group d.batch_meetOrder g + ⟨d.coding.encode x, d.coding.encode_mem x⟩ + +noncomputable def toTaskSymmetry (g : {g : ZFSet.{u} // g ∈ G}) : TaskSymmetry h.toInputs where + perm := s.taskAction.rawAct g + inverse := (s.taskAction.toPerm h.group g).invFun + left_inverse := (s.taskAction.toPerm h.group g).left_inv + right_inverse := (s.taskAction.toPerm h.group g).right_inv + current := s.current g + source i := Subtype.ext (s.source g.val i.val _ _ _ (s.taskAction.rawAct_entry g i) + (h.source_entry i) (h.source_entry (s.taskAction.rawAct g i))).symm + intertwine i p := by + apply d.coding.encode_injective + exact h.action.toSetAction.entry_unique (s.current_entry g ((h.toInputs.previous i).toFun p)) + (s.intertwine g.val i.val _ _ _ p.val _ _ (s.taskAction.rawAct_entry g i) + (h.maps.value_entry i) (h.maps.value_entry (s.taskAction.rawAct g i)) + (h.toInputs_previous_entry i p) (h.toInputs_previous_entry (s.taskAction.rawAct g i) p)) + +theorem toTaskSymmetry_perm_entry (g : {g : ZFSet.{u} // g ∈ G}) + (i : {i : ZFSet.{u} // i ∈ I}) : + ZFSet.pair (ZFSet.pair g.val i.val) ((s.toTaskSymmetry g).perm i).val ∈ T := + s.taskAction.rawAct_entry g i + +theorem toTaskSymmetry_current_entry (g : {g : ZFSet.{u} // g ∈ G}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + ZFSet.pair (ZFSet.pair g.val (d.coding.encode x)) + (d.coding.encode ((s.toTaskSymmetry g).current.toFun x)) ∈ A := s.current_entry g x + +end CodedRecursiveTaskAction + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CompleteProjectionFilterLifts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CompleteProjectionFilterLifts.lean index a798a1bae958963b9383fa2f6b2278ec309bdd31..249c0fb43c48ef279703d1f97015d00c3820be11 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CompleteProjectionFilterLifts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CompleteProjectionFilterLifts.lean @@ -1,25 +1,25 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompleteProjectionPredensity - -namespace OAI - -section - -namespace PartitionPilot.Forcing.CompleteProjection -universe u v -variable {Upper : Type u} {Lower : Type v} -variable [PartialOrder Upper] [PartialOrder Lower] -variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} -variable (projection : CompleteProjection restriction inclusion) - -theorem exists_mem_below_projected (H : ConditionFilter Upper) - (p : Upper) (hp : H.mem p) (q : Lower) - (hq : (projection.projectedFilter H).mem q) : - ∃ r : Upper, H.mem r ∧ r ≤ p ∧ restriction r ≤ q := by - obtain ⟨r, member, below, included⟩ := H.directed hp hq - exact ⟨r, member, below, (projection.le_include_iff r q).1 included⟩ - -end PartitionPilot.Forcing.CompleteProjection - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompleteProjectionPredensity + +namespace OAI + +section + +namespace PartitionPilot.Forcing.CompleteProjection +universe u v +variable {Upper : Type u} {Lower : Type v} +variable [PartialOrder Upper] [PartialOrder Lower] +variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} +variable (projection : CompleteProjection restriction inclusion) + +theorem exists_mem_below_projected (H : ConditionFilter Upper) + (p : Upper) (hp : H.mem p) (q : Lower) + (hq : (projection.projectedFilter H).mem q) : + ∃ r : Upper, H.mem r ∧ r ≤ p ∧ restriction r ≤ q := by + obtain ⟨r, member, below, included⟩ := H.directed hp hq + exact ⟨r, member, below, (projection.le_include_iff r q).1 included⟩ + +end PartitionPilot.Forcing.CompleteProjection + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ConditionQuantifiers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ConditionQuantifiers.lean index 9d61d8e3c4e86b5c7cfa8f43074f7a7e86f4830d..341223a4de0d95c6e6720f7bce396adee41a2205 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ConditionQuantifiers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ConditionQuantifiers.lean @@ -1,236 +1,236 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -open scoped ZFSet -universe u -variable {P : Type u} {s : Presentation P} - -def grandchildrenBound (τ : Name s) : ZFSet.{u} := ⋃₀ (⋃₀ (⋃₀ (⋃₀ (⋃₀ τ.val)))) - -theorem grandchild_mem_bound {σ ν τ : Name s} {r q : P} - (outer : Entry ν τ r) (inner : Entry σ ν q) : σ.val ∈ grandchildrenBound τ := by - have h₁ : ({ν.val} : ZFSet.{u}) ∈ ⋃₀ τ.val := - ZFSet.mem_sUnion.2 ⟨ZFSet.pair ν.val (s.encode r), outer, ZFSet.mem_pair.2 (Or.inl rfl)⟩ - have h₂ : ν.val ∈ ⋃₀ (⋃₀ τ.val) := - ZFSet.mem_sUnion.2 ⟨{ν.val}, h₁, ZFSet.mem_singleton.2 rfl⟩ - have h₃ : ZFSet.pair σ.val (s.encode q) ∈ ⋃₀ (⋃₀ (⋃₀ τ.val)) := - ZFSet.mem_sUnion.2 ⟨ν.val, h₂, inner⟩ - have h₄ : ({σ.val} : ZFSet.{u}) ∈ ⋃₀ (⋃₀ (⋃₀ (⋃₀ τ.val))) := - ZFSet.mem_sUnion.2 ⟨ZFSet.pair σ.val (s.encode q), h₃, ZFSet.mem_pair.2 (Or.inl rfl)⟩ - exact ZFSet.mem_sUnion.2 ⟨{σ.val}, h₄, ZFSet.mem_singleton.2 rfl⟩ - -theorem isName_of_pair_mem (τ : Name s) (x : ZFSet.{u}) (p : P) - (entry : ZFSet.pair x (s.encode p) ∈ τ.val) : IsName s x := by - have property := τ.property - cases property with - | mk _ children => exact children x p entry - -theorem unionName_subset_bound [Preorder P] (τ : Name s) (C : ZFSet.{u}) - (bound : ∀ x ∈ grandchildrenBound τ, ∀ y ∈ s.carrier, ZFSet.pair x y ∈ C) : - (unionName τ).val ⊆ C := by - intro z hz - obtain ⟨σ, p, rfl⟩ := entries_cover (unionName τ) hz - obtain ⟨ν, r, q, outer, inner, _, _⟩ := (entry_unionName τ σ p).1 hz - exact bound σ.val (grandchild_mem_bound outer inner) (s.encode p) (s.encode_mem p) - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem grandchildrenBound_mem (unions : Realize M.sets SetFormula.union Fin.elim0) - {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : Name.grandchildrenBound τ ∈ M.sets := - M.union_mem unions (M.union_mem unions (M.union_mem unions (M.union_mem unions (M.union_mem unions hτ)))) - -theorem exists_unionName_bound [Preorder P] - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (carrier : s.carrier ∈ M.sets) - {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : - ∃ C ∈ M.sets, (Name.unionName τ).val ⊆ C := by - obtain ⟨C, hC, bound⟩ := M.exists_pair_bound pairing unions powers - (M.grandchildrenBound_mem s unions hτ) carrier - exact ⟨C, hC, Name.unionName_subset_bound τ C bound⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.SetRealization.Presentation - -universe u -variable {P : Type u} [Preorder P] (s : Presentation P) - -noncomputable def conditionOrder : ZFSet.{u} := (s.product s).subset (fun z => z.1 ≤ z.2) - -theorem pair_mem_conditionOrder (p q : P) : - ZFSet.pair (s.encode p) (s.encode q) ∈ s.conditionOrder ↔ p ≤ q := - (s.product s).encode_mem_subset (fun z => z.1 ≤ z.2) (p, q) - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing.Name - -open SetRealization SetFormula -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -noncomputable def unionEntryParams (τ : Name s) : Fin 3 → ZFSet.{u} := - extend τ.val (extend s.carrier (extend s.conditionOrder Fin.elim0)) - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem unionEntryParams_mem (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : - ∀ i, Name.unionEntryParams τ i ∈ M.sets := by - intro i - refine Fin.cases hτ (fun j => ?_) i - refine Fin.cases carrier (fun k => ?_) j - exact Fin.cases order (fun l => Fin.elim0 l) k - -theorem unionEntry_iff_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) {z : ZFSet.{u}} (hz : z ∈ M.sets) : - Realize M.sets unionEntryFormula (extend z (Name.unionEntryParams τ)) ↔ - z ∈ (Name.unionName τ).val := by - have members : ∀ i, extend z (Name.unionEntryParams τ) i ∈ M.sets := - fun i => Fin.cases hz (M.unionEntryParams_mem s carrier order hτ) i - rw [M.realize_unionEntryFormula pairing _ members] - change (∃ x ∈ M.sets, ∃ p ∈ M.sets, ∃ ν ∈ M.sets, ∃ r ∈ M.sets, ∃ q ∈ M.sets, - z = ZFSet.pair x p ∧ p ∈ s.carrier ∧ r ∈ s.carrier ∧ q ∈ s.carrier ∧ - ZFSet.pair ν r ∈ τ.val ∧ ZFSet.pair x q ∈ ν ∧ - ZFSet.pair p r ∈ s.conditionOrder ∧ ZFSet.pair p q ∈ s.conditionOrder) ↔ _ - constructor - · rintro ⟨x, _, pc, _, v, _, rc, _, qc, _, eq, hp, hr, hq, outer, inner, pr, pq⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier pc).1 hp - obtain ⟨r, rfl⟩ := (s.mem_carrier rc).1 hr - obtain ⟨q, rfl⟩ := (s.mem_carrier qc).1 hq - let ν : Name s := ⟨v, Name.isName_of_pair_mem τ v r outer⟩ - let σ : Name s := ⟨x, Name.isName_of_pair_mem ν x q inner⟩ - rw [eq] - change Name.Entry σ (Name.unionName τ) p - exact (Name.entry_unionName τ σ p).2 - ⟨ν, r, q, outer, inner, (s.pair_mem_conditionOrder p r).1 pr, - (s.pair_mem_conditionOrder p q).1 pq⟩ - · intro member - obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.unionName τ) member - obtain ⟨ν, r, q, outer, inner, pr, pq⟩ := (Name.entry_unionName τ σ p).1 member - have hν := (M.nameDomain s).children hτ outer - have hσ := (M.nameDomain s).children hν inner - exact ⟨σ.val, hσ, s.encode p, M.transitive carrier (s.encode_mem p), - ν.val, hν, s.encode r, M.transitive carrier (s.encode_mem r), - s.encode q, M.transitive carrier (s.encode_mem q), rfl, - s.encode_mem p, s.encode_mem r, s.encode_mem q, outer, inner, - (s.pair_mem_conditionOrder p r).2 pr, (s.pair_mem_conditionOrder p q).2 pq⟩ - -theorem unionName_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : - Name.unionName τ ∈ (M.nameDomain s).names := by - obtain ⟨C, hC, bound⟩ := M.exists_unionName_bound s pairing unions powers carrier hτ - have selected := M.separation_mem separation unionEntryFormula (Name.unionEntryParams τ) - (M.unionEntryParams_mem s carrier order hτ) hC - have eq : ZFSet.sep (fun z => Realize M.sets unionEntryFormula - (extend z (Name.unionEntryParams τ))) C = (Name.unionName τ).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, formula⟩ - exact (M.unionEntry_iff_mem s pairing carrier order hτ (M.transitive hC hz)).1 formula - · intro hz - exact ⟨bound hz, - (M.unionEntry_iff_mem s pairing carrier order hτ (M.transitive hC (bound hz))).2 hz⟩ - change (Name.unionName τ).val ∈ M.sets - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) - -theorem symmetric_union {G : Type v} [Group G] - (a : PosetAction G P) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (H : ConditionFilter P) : - Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) - SetFormula.union Fin.elim0 := - realize_symmetric_union a (M.nameDomain s) F - (fun _ hτ => M.unionName_mem s pairing unions powers separation carrier order hτ) H - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.SetFormula - -def allConditions {n : Nat} (carrier : Fin n) (φ : SetFormula (n + 1)) : SetFormula n := - .all (imp (.mem 0 carrier.succ) φ) - -def exConditions {n : Nat} (carrier : Fin n) (φ : SetFormula (n + 1)) : SetFormula n := - ex (.conj (.mem 0 carrier.succ) φ) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem realize_allConditions {n : Nat} (c : Fin n) (φ : SetFormula (n + 1)) - (env : Fin n → ZFSet.{u}) (carrier : s.carrier ∈ M.sets) (code : env c = s.carrier) : - Realize M.sets (allConditions c φ) env ↔ - ∀ p : P, Realize M.sets φ (extend (s.encode p) env) := by - simp only [allConditions, Realize, realize_imp] - change (∀ x ∈ M.sets, x ∈ env c → Realize M.sets φ (extend x env)) ↔ _ - rw [code] - constructor - · intro h p - exact h (s.encode p) (M.transitive carrier (s.encode_mem p)) (s.encode_mem p) - · intro h x _ hx - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - exact h p - -theorem realize_exConditions {n : Nat} (c : Fin n) (φ : SetFormula (n + 1)) - (env : Fin n → ZFSet.{u}) (carrier : s.carrier ∈ M.sets) (code : env c = s.carrier) : - Realize M.sets (exConditions c φ) env ↔ - ∃ p : P, Realize M.sets φ (extend (s.encode p) env) := by - simp only [exConditions, realize_ex] - change (∃ x ∈ M.sets, x ∈ env c ∧ Realize M.sets φ (extend x env)) ↔ _ - rw [code] - constructor - · rintro ⟨x, _, hx, h⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - exact ⟨p, h⟩ - · rintro ⟨p, h⟩ - exact ⟨s.encode p, M.transitive carrier (s.encode_mem p), s.encode_mem p, h⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +open scoped ZFSet +universe u +variable {P : Type u} {s : Presentation P} + +def grandchildrenBound (τ : Name s) : ZFSet.{u} := ⋃₀ (⋃₀ (⋃₀ (⋃₀ (⋃₀ τ.val)))) + +theorem grandchild_mem_bound {σ ν τ : Name s} {r q : P} + (outer : Entry ν τ r) (inner : Entry σ ν q) : σ.val ∈ grandchildrenBound τ := by + have h₁ : ({ν.val} : ZFSet.{u}) ∈ ⋃₀ τ.val := + ZFSet.mem_sUnion.2 ⟨ZFSet.pair ν.val (s.encode r), outer, ZFSet.mem_pair.2 (Or.inl rfl)⟩ + have h₂ : ν.val ∈ ⋃₀ (⋃₀ τ.val) := + ZFSet.mem_sUnion.2 ⟨{ν.val}, h₁, ZFSet.mem_singleton.2 rfl⟩ + have h₃ : ZFSet.pair σ.val (s.encode q) ∈ ⋃₀ (⋃₀ (⋃₀ τ.val)) := + ZFSet.mem_sUnion.2 ⟨ν.val, h₂, inner⟩ + have h₄ : ({σ.val} : ZFSet.{u}) ∈ ⋃₀ (⋃₀ (⋃₀ (⋃₀ τ.val))) := + ZFSet.mem_sUnion.2 ⟨ZFSet.pair σ.val (s.encode q), h₃, ZFSet.mem_pair.2 (Or.inl rfl)⟩ + exact ZFSet.mem_sUnion.2 ⟨{σ.val}, h₄, ZFSet.mem_singleton.2 rfl⟩ + +theorem isName_of_pair_mem (τ : Name s) (x : ZFSet.{u}) (p : P) + (entry : ZFSet.pair x (s.encode p) ∈ τ.val) : IsName s x := by + have property := τ.property + cases property with + | mk _ children => exact children x p entry + +theorem unionName_subset_bound [Preorder P] (τ : Name s) (C : ZFSet.{u}) + (bound : ∀ x ∈ grandchildrenBound τ, ∀ y ∈ s.carrier, ZFSet.pair x y ∈ C) : + (unionName τ).val ⊆ C := by + intro z hz + obtain ⟨σ, p, rfl⟩ := entries_cover (unionName τ) hz + obtain ⟨ν, r, q, outer, inner, _, _⟩ := (entry_unionName τ σ p).1 hz + exact bound σ.val (grandchild_mem_bound outer inner) (s.encode p) (s.encode_mem p) + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem grandchildrenBound_mem (unions : Realize M.sets SetFormula.union Fin.elim0) + {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : Name.grandchildrenBound τ ∈ M.sets := + M.union_mem unions (M.union_mem unions (M.union_mem unions (M.union_mem unions (M.union_mem unions hτ)))) + +theorem exists_unionName_bound [Preorder P] + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (carrier : s.carrier ∈ M.sets) + {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : + ∃ C ∈ M.sets, (Name.unionName τ).val ⊆ C := by + obtain ⟨C, hC, bound⟩ := M.exists_pair_bound pairing unions powers + (M.grandchildrenBound_mem s unions hτ) carrier + exact ⟨C, hC, Name.unionName_subset_bound τ C bound⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.SetRealization.Presentation + +universe u +variable {P : Type u} [Preorder P] (s : Presentation P) + +noncomputable def conditionOrder : ZFSet.{u} := (s.product s).subset (fun z => z.1 ≤ z.2) + +theorem pair_mem_conditionOrder (p q : P) : + ZFSet.pair (s.encode p) (s.encode q) ∈ s.conditionOrder ↔ p ≤ q := + (s.product s).encode_mem_subset (fun z => z.1 ≤ z.2) (p, q) + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing.Name + +open SetRealization SetFormula +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +noncomputable def unionEntryParams (τ : Name s) : Fin 3 → ZFSet.{u} := + extend τ.val (extend s.carrier (extend s.conditionOrder Fin.elim0)) + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem unionEntryParams_mem (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : + ∀ i, Name.unionEntryParams τ i ∈ M.sets := by + intro i + refine Fin.cases hτ (fun j => ?_) i + refine Fin.cases carrier (fun k => ?_) j + exact Fin.cases order (fun l => Fin.elim0 l) k + +theorem unionEntry_iff_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) {z : ZFSet.{u}} (hz : z ∈ M.sets) : + Realize M.sets unionEntryFormula (extend z (Name.unionEntryParams τ)) ↔ + z ∈ (Name.unionName τ).val := by + have members : ∀ i, extend z (Name.unionEntryParams τ) i ∈ M.sets := + fun i => Fin.cases hz (M.unionEntryParams_mem s carrier order hτ) i + rw [M.realize_unionEntryFormula pairing _ members] + change (∃ x ∈ M.sets, ∃ p ∈ M.sets, ∃ ν ∈ M.sets, ∃ r ∈ M.sets, ∃ q ∈ M.sets, + z = ZFSet.pair x p ∧ p ∈ s.carrier ∧ r ∈ s.carrier ∧ q ∈ s.carrier ∧ + ZFSet.pair ν r ∈ τ.val ∧ ZFSet.pair x q ∈ ν ∧ + ZFSet.pair p r ∈ s.conditionOrder ∧ ZFSet.pair p q ∈ s.conditionOrder) ↔ _ + constructor + · rintro ⟨x, _, pc, _, v, _, rc, _, qc, _, eq, hp, hr, hq, outer, inner, pr, pq⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier pc).1 hp + obtain ⟨r, rfl⟩ := (s.mem_carrier rc).1 hr + obtain ⟨q, rfl⟩ := (s.mem_carrier qc).1 hq + let ν : Name s := ⟨v, Name.isName_of_pair_mem τ v r outer⟩ + let σ : Name s := ⟨x, Name.isName_of_pair_mem ν x q inner⟩ + rw [eq] + change Name.Entry σ (Name.unionName τ) p + exact (Name.entry_unionName τ σ p).2 + ⟨ν, r, q, outer, inner, (s.pair_mem_conditionOrder p r).1 pr, + (s.pair_mem_conditionOrder p q).1 pq⟩ + · intro member + obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.unionName τ) member + obtain ⟨ν, r, q, outer, inner, pr, pq⟩ := (Name.entry_unionName τ σ p).1 member + have hν := (M.nameDomain s).children hτ outer + have hσ := (M.nameDomain s).children hν inner + exact ⟨σ.val, hσ, s.encode p, M.transitive carrier (s.encode_mem p), + ν.val, hν, s.encode r, M.transitive carrier (s.encode_mem r), + s.encode q, M.transitive carrier (s.encode_mem q), rfl, + s.encode_mem p, s.encode_mem r, s.encode_mem q, outer, inner, + (s.pair_mem_conditionOrder p r).2 pr, (s.pair_mem_conditionOrder p q).2 pq⟩ + +theorem unionName_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {τ : Name s} (hτ : τ ∈ (M.nameDomain s).names) : + Name.unionName τ ∈ (M.nameDomain s).names := by + obtain ⟨C, hC, bound⟩ := M.exists_unionName_bound s pairing unions powers carrier hτ + have selected := M.separation_mem separation unionEntryFormula (Name.unionEntryParams τ) + (M.unionEntryParams_mem s carrier order hτ) hC + have eq : ZFSet.sep (fun z => Realize M.sets unionEntryFormula + (extend z (Name.unionEntryParams τ))) C = (Name.unionName τ).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, formula⟩ + exact (M.unionEntry_iff_mem s pairing carrier order hτ (M.transitive hC hz)).1 formula + · intro hz + exact ⟨bound hz, + (M.unionEntry_iff_mem s pairing carrier order hτ (M.transitive hC (bound hz))).2 hz⟩ + change (Name.unionName τ).val ∈ M.sets + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) + +theorem symmetric_union {G : Type v} [Group G] + (a : PosetAction G P) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (H : ConditionFilter P) : + Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) + SetFormula.union Fin.elim0 := + realize_symmetric_union a (M.nameDomain s) F + (fun _ hτ => M.unionName_mem s pairing unions powers separation carrier order hτ) H + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.SetFormula + +def allConditions {n : Nat} (carrier : Fin n) (φ : SetFormula (n + 1)) : SetFormula n := + .all (imp (.mem 0 carrier.succ) φ) + +def exConditions {n : Nat} (carrier : Fin n) (φ : SetFormula (n + 1)) : SetFormula n := + ex (.conj (.mem 0 carrier.succ) φ) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem realize_allConditions {n : Nat} (c : Fin n) (φ : SetFormula (n + 1)) + (env : Fin n → ZFSet.{u}) (carrier : s.carrier ∈ M.sets) (code : env c = s.carrier) : + Realize M.sets (allConditions c φ) env ↔ + ∀ p : P, Realize M.sets φ (extend (s.encode p) env) := by + simp only [allConditions, Realize, realize_imp] + change (∀ x ∈ M.sets, x ∈ env c → Realize M.sets φ (extend x env)) ↔ _ + rw [code] + constructor + · intro h p + exact h (s.encode p) (M.transitive carrier (s.encode_mem p)) (s.encode_mem p) + · intro h x _ hx + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + exact h p + +theorem realize_exConditions {n : Nat} (c : Fin n) (φ : SetFormula (n + 1)) + (env : Fin n → ZFSet.{u}) (carrier : s.carrier ∈ M.sets) (code : env c = s.carrier) : + Realize M.sets (exConditions c φ) env ↔ + ∃ p : P, Realize M.sets φ (extend (s.encode p) env) := by + simp only [exConditions, realize_ex] + change (∃ x ∈ M.sets, x ∈ env c ∧ Realize M.sets φ (extend x env)) ↔ _ + rw [code] + constructor + · rintro ⟨x, _, hx, h⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + exact ⟨p, h⟩ + · rintro ⟨p, h⟩ + exact ⟨s.encode p, M.transitive carrier (s.encode_mem p), s.encode_mem p, h⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CrossStageMembershipNameActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CrossStageMembershipNameActions.lean index 99eff9f853ef0875fbde65731209362d3d41a145..54c379cedf03bfa3b14870b164e2e0a8f4d82fcc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CrossStageMembershipNameActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/CrossStageMembershipNameActions.lean @@ -1,70 +1,70 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] -variable {G : Type v} [Group G] -variable (upper : PosetAction G P) (lower : PosetAction G Q) -variable (s : Presentation P) (t : Presentation Q) (inclusion : Q → P) -variable (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName t z) -variable (equivariant : ∀ g p, inclusion (lower.iso g p) = upper.iso g (inclusion p)) -variable (closed : ∀ g (sigma : Name t), sigma.val ∈ J → (lower.act t g sigma).val ∈ J) -include equivariant closed - -theorem crossStageMembershipName_act (g : G) (tau : Name s) : - lower.act t g (crossStageMembershipName s t inclusion J valid tau) = - crossStageMembershipName s t inclusion J valid (upper.act s g tau) := by - apply Name.ext - intro sigma p - obtain ⟨sigma, rfl⟩ := (lower.nameEquiv t g).surjective sigma - obtain ⟨p, rfl⟩ := (lower.iso g).surjective p - change Entry (lower.act t g sigma) - (lower.act t g (crossStageMembershipName s t inclusion J valid tau)) (lower.iso g p) ↔ - Entry (lower.act t g sigma) - (crossStageMembershipName s t inclusion J valid (upper.act s g tau)) (lower.iso g p) - rw [lower.entry_act, entry_crossStageMembershipName, entry_crossStageMembershipName] - have member : (lower.act t g sigma).val ∈ J ↔ sigma.val ∈ J := by - constructor - · intro h - have back := closed g⁻¹ (lower.act t g sigma) h - simpa only [lower.act_inv_left] using back - · exact closed g sigma - rw [member, equivariant, - ← lower.act_rename_of_equivariant upper t s inclusion equivariant, - upper.forcesMem_act_iff] - -theorem crossStageMembershipName_stabilizer (tau : Name s) : - upper.stabilizer s tau ≤ - lower.stabilizer t (crossStageMembershipName s t inclusion J valid tau) := by - intro g fixed - change upper.act s g tau = tau at fixed - change lower.act t g (crossStageMembershipName s t inclusion J valid tau) = _ - rw [crossStageMembershipName_act upper lower s t inclusion J valid equivariant closed, fixed] - -theorem crossStageMembershipName_nice (K : Subgroup G) (tau : Name s) - (supported : K ≤ upper.stabilizer s tau) : - NiceNameCode lower t J K (crossStageMembershipName s t inclusion J valid tau).val := by - apply (niceNameCode_iff lower t _).2 - exact ⟨crossStageMembershipCode_subset s t inclusion J tau, - supported.trans (crossStageMembershipName_stabilizer upper lower s t inclusion J valid - equivariant closed tau)⟩ - -theorem crossStageMembershipName_hs (F : NormalSubgroupFamily G) (K : Subgroup G) - (member : F.mem K) - (children : ∀ sigma : Name t, sigma.val ∈ J → HereditarilySymmetric lower t F sigma) - (tau : Name s) (supported : K ≤ upper.stabilizer s tau) : - HereditarilySymmetric lower t F (crossStageMembershipName s t inclusion J valid tau) := by - exact niceNameCode_hs lower t F member children - (crossStageMembershipName_nice upper lower s t inclusion J valid equivariant closed - K tau supported) - -end PartitionPilot.Forcing.Name - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] +variable {G : Type v} [Group G] +variable (upper : PosetAction G P) (lower : PosetAction G Q) +variable (s : Presentation P) (t : Presentation Q) (inclusion : Q → P) +variable (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName t z) +variable (equivariant : ∀ g p, inclusion (lower.iso g p) = upper.iso g (inclusion p)) +variable (closed : ∀ g (sigma : Name t), sigma.val ∈ J → (lower.act t g sigma).val ∈ J) +include equivariant closed + +theorem crossStageMembershipName_act (g : G) (tau : Name s) : + lower.act t g (crossStageMembershipName s t inclusion J valid tau) = + crossStageMembershipName s t inclusion J valid (upper.act s g tau) := by + apply Name.ext + intro sigma p + obtain ⟨sigma, rfl⟩ := (lower.nameEquiv t g).surjective sigma + obtain ⟨p, rfl⟩ := (lower.iso g).surjective p + change Entry (lower.act t g sigma) + (lower.act t g (crossStageMembershipName s t inclusion J valid tau)) (lower.iso g p) ↔ + Entry (lower.act t g sigma) + (crossStageMembershipName s t inclusion J valid (upper.act s g tau)) (lower.iso g p) + rw [lower.entry_act, entry_crossStageMembershipName, entry_crossStageMembershipName] + have member : (lower.act t g sigma).val ∈ J ↔ sigma.val ∈ J := by + constructor + · intro h + have back := closed g⁻¹ (lower.act t g sigma) h + simpa only [lower.act_inv_left] using back + · exact closed g sigma + rw [member, equivariant, + ← lower.act_rename_of_equivariant upper t s inclusion equivariant, + upper.forcesMem_act_iff] + +theorem crossStageMembershipName_stabilizer (tau : Name s) : + upper.stabilizer s tau ≤ + lower.stabilizer t (crossStageMembershipName s t inclusion J valid tau) := by + intro g fixed + change upper.act s g tau = tau at fixed + change lower.act t g (crossStageMembershipName s t inclusion J valid tau) = _ + rw [crossStageMembershipName_act upper lower s t inclusion J valid equivariant closed, fixed] + +theorem crossStageMembershipName_nice (K : Subgroup G) (tau : Name s) + (supported : K ≤ upper.stabilizer s tau) : + NiceNameCode lower t J K (crossStageMembershipName s t inclusion J valid tau).val := by + apply (niceNameCode_iff lower t _).2 + exact ⟨crossStageMembershipCode_subset s t inclusion J tau, + supported.trans (crossStageMembershipName_stabilizer upper lower s t inclusion J valid + equivariant closed tau)⟩ + +theorem crossStageMembershipName_hs (F : NormalSubgroupFamily G) (K : Subgroup G) + (member : F.mem K) + (children : ∀ sigma : Name t, sigma.val ∈ J → HereditarilySymmetric lower t F sigma) + (tau : Name s) (supported : K ≤ upper.stabilizer s tau) : + HereditarilySymmetric lower t F (crossStageMembershipName s t inclusion J valid tau) := by + exact niceNameCode_hs lower t F member children + (crossStageMembershipName_nice upper lower s t inclusion J valid equivariant closed + K tau supported) + +end PartitionPilot.Forcing.Name + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/DenseInterpolation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/DenseInterpolation.lean index 0f89272a7a62edaa21f70e5eba3a7da1375e9b4a..997bc60616884fdc711d250b5a6416d526280a80 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/DenseInterpolation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/DenseInterpolation.lean @@ -1,314 +1,314 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.HeightTower - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u v w - -structure LinearHeightOrder (A : Type u) extends HeightOrder A where - compare : ∀ x y, lt x y ∨ x = y ∨ lt y x - -structure DenseHeightOrder (A : Type u) extends LinearHeightOrder A where - between : ∀ x y, lt x y → ∃ z, lt x z ∧ lt z y - -namespace LinearHeightOrder - -variable {A : Type u} (R : LinearHeightOrder A) - -theorem asymm {x y : A} (h : R.lt x y) : ¬ R.lt y x := - fun h' => R.irrefl x (R.trans h h') - -theorem weak_refl (x : A) : R.Weak x x := Or.inl rfl - -theorem weak_trans {x y z : A} (h : R.Weak x y) (h' : R.Weak y z) : R.Weak x z := by - rcases h with rfl | h - · exact h' - · exact Or.inr (R.lt_weak h h') - -theorem list_max (a : A) (xs : List A) : - ∃ m, (m = a ∨ m ∈ xs) ∧ R.Weak a m ∧ ∀ x ∈ xs, R.Weak x m := by - induction xs with - | nil => exact ⟨a, Or.inl rfl, R.weak_refl a, by simp⟩ - | cons x xs ih => - rcases ih with ⟨m, hm, ha, hx⟩ - rcases R.compare x m with h | eq | h - · refine ⟨m, ?_, ha, ?_⟩ - · rcases hm with hm | hm - · exact Or.inl hm - · exact Or.inr (List.mem_cons_of_mem x hm) - · intro y hy - rcases List.mem_cons.mp hy with rfl | hy - · exact Or.inr h - · exact hx y hy - · refine ⟨m, ?_, ha, ?_⟩ - · exact Or.inr (List.mem_cons.mpr (Or.inl eq.symm)) - · intro y hy - rcases List.mem_cons.mp hy with rfl | hy - · exact Or.inl eq - · exact hx y hy - · refine ⟨x, Or.inr (List.mem_cons_self), R.weak_trans ha (Or.inr h), ?_⟩ - intro y hy - rcases List.mem_cons.mp hy with rfl | hy - · exact R.weak_refl _ - · exact R.weak_trans (hx y hy) (Or.inr h) - -def reverse : LinearHeightOrder A where - lt x y := R.lt y x - irrefl := R.irrefl - trans h h' := R.trans h' h - compare x y := by - rcases R.compare y x with h | eq | h - · exact Or.inl h - · exact Or.inr (Or.inl eq.symm) - · exact Or.inr (Or.inr h) - -theorem list_min (a : A) (xs : List A) : - ∃ m, (m = a ∨ m ∈ xs) ∧ R.Weak m a ∧ ∀ x ∈ xs, R.Weak m x := by - rcases R.reverse.list_max a xs with ⟨m, hm, ha, hx⟩ - refine ⟨m, hm, ?_, ?_⟩ - · rcases ha with eq | h - · exact Or.inl eq.symm - · exact Or.inr h - · intro x h - rcases hx x h with eq | h' - · exact Or.inl eq.symm - · exact Or.inr h' - -end LinearHeightOrder - -namespace DenseHeightOrder - -variable {D : Type v} (R : DenseHeightOrder D) - -theorem finite_gap (lo hi : D) (lower upper : List D) - (gap : R.lt lo hi) - (lower_hi : ∀ x ∈ lower, R.lt x hi) - (lo_upper : ∀ y ∈ upper, R.lt lo y) - (separated : ∀ x ∈ lower, ∀ y ∈ upper, R.lt x y) : - ∃ z, R.lt lo z ∧ R.lt z hi ∧ - (∀ x ∈ lower, R.lt x z) ∧ (∀ y ∈ upper, R.lt z y) := by - rcases R.toLinearHeightOrder.list_max lo lower with ⟨a, ha, hlo, hlow⟩ - rcases R.toLinearHeightOrder.list_min hi upper with ⟨b, hb, hhi, hupp⟩ - have ab : R.lt a b := by - rcases ha with rfl | ha - · rcases hb with rfl | hb - · exact gap - · exact lo_upper b hb - · rcases hb with rfl | hb - · exact lower_hi a ha - · exact separated a ha b hb - rcases R.between a b ab with ⟨z, az, zb⟩ - exact ⟨z, R.weak_lt hlo az, R.lt_weak zb hhi, - fun x hx => R.weak_lt (hlow x hx) az, - fun y hy => R.lt_weak zb (hupp y hy)⟩ - -end DenseHeightOrder - -namespace CountableInterpolation - -variable {A : Type u} {D : Type v} (S : LinearHeightOrder A) - (R : DenseHeightOrder D) (enumerate : Nat → A) (lo hi : D) - -structure Partial (n : Nat) where - value : Nat → D - lower : ∀ i, i < n → R.lt lo (value i) - upper : ∀ i, i < n → R.lt (value i) hi - strict : ∀ i j, i < n → j < n → S.lt (enumerate i) (enumerate j) → R.lt (value i) (value j) - equal : ∀ i j, i < n → j < n → enumerate i = enumerate j → value i = value j - -variable {S R enumerate lo hi} - -theorem next_exists {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : - ∃ z, R.lt lo z ∧ R.lt z hi ∧ - (∀ i, i < n → S.lt (enumerate i) (enumerate n) → R.lt (p.value i) z) ∧ - (∀ i, i < n → S.lt (enumerate n) (enumerate i) → R.lt z (p.value i)) ∧ - (∀ i, i < n → enumerate i = enumerate n → p.value i = z) := by - classical - by_cases seen : ∃ i, i < n ∧ enumerate i = enumerate n - · rcases seen with ⟨j, hj, he⟩ - refine ⟨p.value j, p.lower j hj, p.upper j hj, ?_, ?_, ?_⟩ - · intro i h h' - exact p.strict i j h hj (he ▸ h') - · intro i h h' - exact p.strict j i hj h (he ▸ h') - · intro i h h' - exact p.equal i j h hj (h'.trans he.symm) - · let lowers := ((List.range n).filter (fun i => S.lt (enumerate i) (enumerate n))).map p.value - let uppers := ((List.range n).filter (fun i => S.lt (enumerate n) (enumerate i))).map p.value - have lower_spec : ∀ x, x ∈ lowers ↔ ∃ i, i < n ∧ S.lt (enumerate i) (enumerate n) ∧ p.value i = x := by - intro x - simp only [lowers, List.mem_map, List.mem_filter, List.mem_range, decide_eq_true_eq] - constructor - · rintro ⟨i, ⟨h, h'⟩, eq⟩ - exact ⟨i, h, h', eq⟩ - · rintro ⟨i, h, h', eq⟩ - exact ⟨i, ⟨h, h'⟩, eq⟩ - have upper_spec : ∀ x, x ∈ uppers ↔ ∃ i, i < n ∧ S.lt (enumerate n) (enumerate i) ∧ p.value i = x := by - intro x - simp only [uppers, List.mem_map, List.mem_filter, List.mem_range, decide_eq_true_eq] - constructor - · rintro ⟨i, ⟨h, h'⟩, eq⟩ - exact ⟨i, h, h', eq⟩ - · rintro ⟨i, h, h', eq⟩ - exact ⟨i, ⟨h, h'⟩, eq⟩ - have lh : ∀ x ∈ lowers, R.lt x hi := by - intro x hx - rcases (lower_spec x).mp hx with ⟨i, h, _, rfl⟩ - exact p.upper i h - have lu : ∀ x ∈ uppers, R.lt lo x := by - intro x hx - rcases (upper_spec x).mp hx with ⟨i, h, _, rfl⟩ - exact p.lower i h - have sep : ∀ x ∈ lowers, ∀ y ∈ uppers, R.lt x y := by - intro x hx y hy - rcases (lower_spec x).mp hx with ⟨i, h, h', rfl⟩ - rcases (upper_spec y).mp hy with ⟨j, k, k', rfl⟩ - exact p.strict i j h k (S.trans h' k') - rcases R.finite_gap lo hi lowers uppers gap lh lu sep with ⟨z, hz, zh, hl, hu⟩ - refine ⟨z, hz, zh, ?_, ?_, ?_⟩ - · intro i h h' - exact hl _ ((lower_spec _).mpr ⟨i, h, h', rfl⟩) - · intro i h h' - exact hu _ ((upper_spec _).mpr ⟨i, h, h', rfl⟩) - · intro i h eq - exact False.elim (seen ⟨i, h, eq⟩) - -noncomputable def nextPoint {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : D := - Classical.choose (next_exists p gap) - -theorem nextPoint_spec {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : - R.lt lo (nextPoint p gap) ∧ R.lt (nextPoint p gap) hi ∧ - (∀ i, i < n → S.lt (enumerate i) (enumerate n) → R.lt (p.value i) (nextPoint p gap)) ∧ - (∀ i, i < n → S.lt (enumerate n) (enumerate i) → R.lt (nextPoint p gap) (p.value i)) ∧ - (∀ i, i < n → enumerate i = enumerate n → p.value i = nextPoint p gap) := - Classical.choose_spec (next_exists p gap) - -noncomputable def extend {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : - Partial S R enumerate lo hi (n + 1) where - value i := if i < n then p.value i else nextPoint p gap - lower i _ := by - split - · exact p.lower i ‹i < n› - · exact (nextPoint_spec p gap).1 - upper i _ := by - split - · exact p.upper i ‹i < n› - · exact (nextPoint_spec p gap).2.1 - strict i j h k lt := by - split <;> split - · exact p.strict i j ‹i < n› ‹j < n› lt - · have eq : j = n := by omega - subst j - exact (nextPoint_spec p gap).2.2.1 i ‹i < n› lt - · have eq : i = n := by omega - subst i - exact (nextPoint_spec p gap).2.2.2.1 j ‹j < n› lt - · have ei : i = n := by omega - have ej : j = n := by omega - subst i - subst j - exact False.elim (S.irrefl _ lt) - equal i j h k eq := by - split <;> split - · exact p.equal i j ‹i < n› ‹j < n› eq - · have ej : j = n := by omega - subst j - exact (nextPoint_spec p gap).2.2.2.2 i ‹i < n› eq - · have ei : i = n := by omega - subst i - exact ((nextPoint_spec p gap).2.2.2.2 j ‹j < n› eq.symm).symm - · rfl - -noncomputable def stages (gap : R.lt lo hi) : (n : Nat) → Partial S R enumerate lo hi n - | 0 => { - value := fun _ => lo - lower := fun _ h => False.elim (Nat.not_lt_zero _ h) - upper := fun _ h => False.elim (Nat.not_lt_zero _ h) - strict := fun _ _ h _ _ => False.elim (Nat.not_lt_zero _ h) - equal := fun _ _ h _ _ => False.elim (Nat.not_lt_zero _ h) } - | n + 1 => extend (stages gap n) gap - -theorem stages_step (gap : R.lt lo hi) (n i : Nat) (h : i < n) : - (stages (S := S) (enumerate := enumerate) gap (n + 1)).value i = - (stages (S := S) (enumerate := enumerate) gap n).value i := by - exact ite_eq_left h - -noncomputable def value (gap : R.lt lo hi) (i : Nat) : D := - (stages (S := S) (enumerate := enumerate) gap (i + 1)).value i - -theorem restriction (gap : R.lt lo hi) (n i : Nat) (h : i < n) : - (stages (S := S) (enumerate := enumerate) gap n).value i = - value (S := S) (enumerate := enumerate) gap i := by - induction n with - | zero => omega - | succ n ih => - by_cases eq : i = n - · subst i - rfl - · have hn : i < n := by omega - exact (stages_step (S := S) (enumerate := enumerate) gap n i hn).trans (ih hn) - -theorem value_lower (gap : R.lt lo hi) (i : Nat) : - R.lt lo (value (S := S) (enumerate := enumerate) gap i) := - (stages gap (i + 1)).lower i (Nat.lt_succ_self i) - -theorem value_upper (gap : R.lt lo hi) (i : Nat) : - R.lt (value (S := S) (enumerate := enumerate) gap i) hi := - (stages gap (i + 1)).upper i (Nat.lt_succ_self i) - -theorem value_strict (gap : R.lt lo hi) (i j : Nat) (lt : S.lt (enumerate i) (enumerate j)) : - R.lt (value (S := S) (enumerate := enumerate) gap i) - (value (S := S) (enumerate := enumerate) gap j) := by - have hi : i < i + j + 1 := by omega - have hj : j < i + j + 1 := by omega - have h := (stages gap (i + j + 1)).strict i j hi hj lt - rw [restriction gap _ i hi, restriction gap _ j hj] at h - exact h - -theorem value_equal (gap : R.lt lo hi) (i j : Nat) (eq : enumerate i = enumerate j) : - value (S := S) (enumerate := enumerate) gap i = - value (S := S) (enumerate := enumerate) gap j := by - have hi : i < i + j + 1 := by omega - have hj : j < i + j + 1 := by omega - have h := (stages (S := S) gap (i + j + 1)).equal i j hi hj eq - rw [restriction gap _ i hi, restriction gap _ j hj] at h - exact h - -end CountableInterpolation - -theorem countable_range_interpolation {X : Type u} {H : Type v} {D : Type w} - (S : LinearHeightOrder H) (R : DenseHeightOrder D) (height : X → H) - (base : X) (countable : CountableRange height) (lo hi : D) (gap : R.lt lo hi) : - ∃ assign : X → D, (∀ x, R.lt lo (assign x) ∧ R.lt (assign x) hi) ∧ - (∀ x y, S.lt (height x) (height y) → R.lt (assign x) (assign y)) ∧ - (∀ x y, height x = height y → assign x = assign y) := by - classical - rcases countable with ⟨code, code_equal⟩ - let enumerate : Nat → H := fun n => - if h : ∃ x, code x = n then height (Classical.choose h) else height base - have cover : ∀ x, enumerate (code x) = height x := by - intro x - have h : ∃ y, code y = code x := ⟨x, rfl⟩ - dsimp [enumerate] - rw [dite_eq_left h] - exact code_equal _ x (Classical.choose_spec h) - refine ⟨fun x => CountableInterpolation.value (S := S) (enumerate := enumerate) gap (code x), ?_, ?_, ?_⟩ - · intro x - exact ⟨CountableInterpolation.value_lower gap _, CountableInterpolation.value_upper gap _⟩ - · intro x y lt - apply CountableInterpolation.value_strict - rw [cover, cover] - exact lt - · intro x y eq - apply CountableInterpolation.value_equal - rw [cover, cover] - exact eq - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.HeightTower + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u v w + +structure LinearHeightOrder (A : Type u) extends HeightOrder A where + compare : ∀ x y, lt x y ∨ x = y ∨ lt y x + +structure DenseHeightOrder (A : Type u) extends LinearHeightOrder A where + between : ∀ x y, lt x y → ∃ z, lt x z ∧ lt z y + +namespace LinearHeightOrder + +variable {A : Type u} (R : LinearHeightOrder A) + +theorem asymm {x y : A} (h : R.lt x y) : ¬ R.lt y x := + fun h' => R.irrefl x (R.trans h h') + +theorem weak_refl (x : A) : R.Weak x x := Or.inl rfl + +theorem weak_trans {x y z : A} (h : R.Weak x y) (h' : R.Weak y z) : R.Weak x z := by + rcases h with rfl | h + · exact h' + · exact Or.inr (R.lt_weak h h') + +theorem list_max (a : A) (xs : List A) : + ∃ m, (m = a ∨ m ∈ xs) ∧ R.Weak a m ∧ ∀ x ∈ xs, R.Weak x m := by + induction xs with + | nil => exact ⟨a, Or.inl rfl, R.weak_refl a, by simp⟩ + | cons x xs ih => + rcases ih with ⟨m, hm, ha, hx⟩ + rcases R.compare x m with h | eq | h + · refine ⟨m, ?_, ha, ?_⟩ + · rcases hm with hm | hm + · exact Or.inl hm + · exact Or.inr (List.mem_cons_of_mem x hm) + · intro y hy + rcases List.mem_cons.mp hy with rfl | hy + · exact Or.inr h + · exact hx y hy + · refine ⟨m, ?_, ha, ?_⟩ + · exact Or.inr (List.mem_cons.mpr (Or.inl eq.symm)) + · intro y hy + rcases List.mem_cons.mp hy with rfl | hy + · exact Or.inl eq + · exact hx y hy + · refine ⟨x, Or.inr (List.mem_cons_self), R.weak_trans ha (Or.inr h), ?_⟩ + intro y hy + rcases List.mem_cons.mp hy with rfl | hy + · exact R.weak_refl _ + · exact R.weak_trans (hx y hy) (Or.inr h) + +def reverse : LinearHeightOrder A where + lt x y := R.lt y x + irrefl := R.irrefl + trans h h' := R.trans h' h + compare x y := by + rcases R.compare y x with h | eq | h + · exact Or.inl h + · exact Or.inr (Or.inl eq.symm) + · exact Or.inr (Or.inr h) + +theorem list_min (a : A) (xs : List A) : + ∃ m, (m = a ∨ m ∈ xs) ∧ R.Weak m a ∧ ∀ x ∈ xs, R.Weak m x := by + rcases R.reverse.list_max a xs with ⟨m, hm, ha, hx⟩ + refine ⟨m, hm, ?_, ?_⟩ + · rcases ha with eq | h + · exact Or.inl eq.symm + · exact Or.inr h + · intro x h + rcases hx x h with eq | h' + · exact Or.inl eq.symm + · exact Or.inr h' + +end LinearHeightOrder + +namespace DenseHeightOrder + +variable {D : Type v} (R : DenseHeightOrder D) + +theorem finite_gap (lo hi : D) (lower upper : List D) + (gap : R.lt lo hi) + (lower_hi : ∀ x ∈ lower, R.lt x hi) + (lo_upper : ∀ y ∈ upper, R.lt lo y) + (separated : ∀ x ∈ lower, ∀ y ∈ upper, R.lt x y) : + ∃ z, R.lt lo z ∧ R.lt z hi ∧ + (∀ x ∈ lower, R.lt x z) ∧ (∀ y ∈ upper, R.lt z y) := by + rcases R.toLinearHeightOrder.list_max lo lower with ⟨a, ha, hlo, hlow⟩ + rcases R.toLinearHeightOrder.list_min hi upper with ⟨b, hb, hhi, hupp⟩ + have ab : R.lt a b := by + rcases ha with rfl | ha + · rcases hb with rfl | hb + · exact gap + · exact lo_upper b hb + · rcases hb with rfl | hb + · exact lower_hi a ha + · exact separated a ha b hb + rcases R.between a b ab with ⟨z, az, zb⟩ + exact ⟨z, R.weak_lt hlo az, R.lt_weak zb hhi, + fun x hx => R.weak_lt (hlow x hx) az, + fun y hy => R.lt_weak zb (hupp y hy)⟩ + +end DenseHeightOrder + +namespace CountableInterpolation + +variable {A : Type u} {D : Type v} (S : LinearHeightOrder A) + (R : DenseHeightOrder D) (enumerate : Nat → A) (lo hi : D) + +structure Partial (n : Nat) where + value : Nat → D + lower : ∀ i, i < n → R.lt lo (value i) + upper : ∀ i, i < n → R.lt (value i) hi + strict : ∀ i j, i < n → j < n → S.lt (enumerate i) (enumerate j) → R.lt (value i) (value j) + equal : ∀ i j, i < n → j < n → enumerate i = enumerate j → value i = value j + +variable {S R enumerate lo hi} + +theorem next_exists {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : + ∃ z, R.lt lo z ∧ R.lt z hi ∧ + (∀ i, i < n → S.lt (enumerate i) (enumerate n) → R.lt (p.value i) z) ∧ + (∀ i, i < n → S.lt (enumerate n) (enumerate i) → R.lt z (p.value i)) ∧ + (∀ i, i < n → enumerate i = enumerate n → p.value i = z) := by + classical + by_cases seen : ∃ i, i < n ∧ enumerate i = enumerate n + · rcases seen with ⟨j, hj, he⟩ + refine ⟨p.value j, p.lower j hj, p.upper j hj, ?_, ?_, ?_⟩ + · intro i h h' + exact p.strict i j h hj (he ▸ h') + · intro i h h' + exact p.strict j i hj h (he ▸ h') + · intro i h h' + exact p.equal i j h hj (h'.trans he.symm) + · let lowers := ((List.range n).filter (fun i => S.lt (enumerate i) (enumerate n))).map p.value + let uppers := ((List.range n).filter (fun i => S.lt (enumerate n) (enumerate i))).map p.value + have lower_spec : ∀ x, x ∈ lowers ↔ ∃ i, i < n ∧ S.lt (enumerate i) (enumerate n) ∧ p.value i = x := by + intro x + simp only [lowers, List.mem_map, List.mem_filter, List.mem_range, decide_eq_true_eq] + constructor + · rintro ⟨i, ⟨h, h'⟩, eq⟩ + exact ⟨i, h, h', eq⟩ + · rintro ⟨i, h, h', eq⟩ + exact ⟨i, ⟨h, h'⟩, eq⟩ + have upper_spec : ∀ x, x ∈ uppers ↔ ∃ i, i < n ∧ S.lt (enumerate n) (enumerate i) ∧ p.value i = x := by + intro x + simp only [uppers, List.mem_map, List.mem_filter, List.mem_range, decide_eq_true_eq] + constructor + · rintro ⟨i, ⟨h, h'⟩, eq⟩ + exact ⟨i, h, h', eq⟩ + · rintro ⟨i, h, h', eq⟩ + exact ⟨i, ⟨h, h'⟩, eq⟩ + have lh : ∀ x ∈ lowers, R.lt x hi := by + intro x hx + rcases (lower_spec x).mp hx with ⟨i, h, _, rfl⟩ + exact p.upper i h + have lu : ∀ x ∈ uppers, R.lt lo x := by + intro x hx + rcases (upper_spec x).mp hx with ⟨i, h, _, rfl⟩ + exact p.lower i h + have sep : ∀ x ∈ lowers, ∀ y ∈ uppers, R.lt x y := by + intro x hx y hy + rcases (lower_spec x).mp hx with ⟨i, h, h', rfl⟩ + rcases (upper_spec y).mp hy with ⟨j, k, k', rfl⟩ + exact p.strict i j h k (S.trans h' k') + rcases R.finite_gap lo hi lowers uppers gap lh lu sep with ⟨z, hz, zh, hl, hu⟩ + refine ⟨z, hz, zh, ?_, ?_, ?_⟩ + · intro i h h' + exact hl _ ((lower_spec _).mpr ⟨i, h, h', rfl⟩) + · intro i h h' + exact hu _ ((upper_spec _).mpr ⟨i, h, h', rfl⟩) + · intro i h eq + exact False.elim (seen ⟨i, h, eq⟩) + +noncomputable def nextPoint {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : D := + Classical.choose (next_exists p gap) + +theorem nextPoint_spec {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : + R.lt lo (nextPoint p gap) ∧ R.lt (nextPoint p gap) hi ∧ + (∀ i, i < n → S.lt (enumerate i) (enumerate n) → R.lt (p.value i) (nextPoint p gap)) ∧ + (∀ i, i < n → S.lt (enumerate n) (enumerate i) → R.lt (nextPoint p gap) (p.value i)) ∧ + (∀ i, i < n → enumerate i = enumerate n → p.value i = nextPoint p gap) := + Classical.choose_spec (next_exists p gap) + +noncomputable def extend {n : Nat} (p : Partial S R enumerate lo hi n) (gap : R.lt lo hi) : + Partial S R enumerate lo hi (n + 1) where + value i := if i < n then p.value i else nextPoint p gap + lower i _ := by + split + · exact p.lower i ‹i < n› + · exact (nextPoint_spec p gap).1 + upper i _ := by + split + · exact p.upper i ‹i < n› + · exact (nextPoint_spec p gap).2.1 + strict i j h k lt := by + split <;> split + · exact p.strict i j ‹i < n› ‹j < n› lt + · have eq : j = n := by omega + subst j + exact (nextPoint_spec p gap).2.2.1 i ‹i < n› lt + · have eq : i = n := by omega + subst i + exact (nextPoint_spec p gap).2.2.2.1 j ‹j < n› lt + · have ei : i = n := by omega + have ej : j = n := by omega + subst i + subst j + exact False.elim (S.irrefl _ lt) + equal i j h k eq := by + split <;> split + · exact p.equal i j ‹i < n› ‹j < n› eq + · have ej : j = n := by omega + subst j + exact (nextPoint_spec p gap).2.2.2.2 i ‹i < n› eq + · have ei : i = n := by omega + subst i + exact ((nextPoint_spec p gap).2.2.2.2 j ‹j < n› eq.symm).symm + · rfl + +noncomputable def stages (gap : R.lt lo hi) : (n : Nat) → Partial S R enumerate lo hi n + | 0 => { + value := fun _ => lo + lower := fun _ h => False.elim (Nat.not_lt_zero _ h) + upper := fun _ h => False.elim (Nat.not_lt_zero _ h) + strict := fun _ _ h _ _ => False.elim (Nat.not_lt_zero _ h) + equal := fun _ _ h _ _ => False.elim (Nat.not_lt_zero _ h) } + | n + 1 => extend (stages gap n) gap + +theorem stages_step (gap : R.lt lo hi) (n i : Nat) (h : i < n) : + (stages (S := S) (enumerate := enumerate) gap (n + 1)).value i = + (stages (S := S) (enumerate := enumerate) gap n).value i := by + exact ite_eq_left h + +noncomputable def value (gap : R.lt lo hi) (i : Nat) : D := + (stages (S := S) (enumerate := enumerate) gap (i + 1)).value i + +theorem restriction (gap : R.lt lo hi) (n i : Nat) (h : i < n) : + (stages (S := S) (enumerate := enumerate) gap n).value i = + value (S := S) (enumerate := enumerate) gap i := by + induction n with + | zero => omega + | succ n ih => + by_cases eq : i = n + · subst i + rfl + · have hn : i < n := by omega + exact (stages_step (S := S) (enumerate := enumerate) gap n i hn).trans (ih hn) + +theorem value_lower (gap : R.lt lo hi) (i : Nat) : + R.lt lo (value (S := S) (enumerate := enumerate) gap i) := + (stages gap (i + 1)).lower i (Nat.lt_succ_self i) + +theorem value_upper (gap : R.lt lo hi) (i : Nat) : + R.lt (value (S := S) (enumerate := enumerate) gap i) hi := + (stages gap (i + 1)).upper i (Nat.lt_succ_self i) + +theorem value_strict (gap : R.lt lo hi) (i j : Nat) (lt : S.lt (enumerate i) (enumerate j)) : + R.lt (value (S := S) (enumerate := enumerate) gap i) + (value (S := S) (enumerate := enumerate) gap j) := by + have hi : i < i + j + 1 := by omega + have hj : j < i + j + 1 := by omega + have h := (stages gap (i + j + 1)).strict i j hi hj lt + rw [restriction gap _ i hi, restriction gap _ j hj] at h + exact h + +theorem value_equal (gap : R.lt lo hi) (i j : Nat) (eq : enumerate i = enumerate j) : + value (S := S) (enumerate := enumerate) gap i = + value (S := S) (enumerate := enumerate) gap j := by + have hi : i < i + j + 1 := by omega + have hj : j < i + j + 1 := by omega + have h := (stages (S := S) gap (i + j + 1)).equal i j hi hj eq + rw [restriction gap _ i hi, restriction gap _ j hj] at h + exact h + +end CountableInterpolation + +theorem countable_range_interpolation {X : Type u} {H : Type v} {D : Type w} + (S : LinearHeightOrder H) (R : DenseHeightOrder D) (height : X → H) + (base : X) (countable : CountableRange height) (lo hi : D) (gap : R.lt lo hi) : + ∃ assign : X → D, (∀ x, R.lt lo (assign x) ∧ R.lt (assign x) hi) ∧ + (∀ x y, S.lt (height x) (height y) → R.lt (assign x) (assign y)) ∧ + (∀ x y, height x = height y → assign x = assign y) := by + classical + rcases countable with ⟨code, code_equal⟩ + let enumerate : Nat → H := fun n => + if h : ∃ x, code x = n then height (Classical.choose h) else height base + have cover : ∀ x, enumerate (code x) = height x := by + intro x + have h : ∃ y, code y = code x := ⟨x, rfl⟩ + dsimp [enumerate] + rw [dite_eq_left h] + exact code_equal _ x (Classical.choose_spec h) + refine ⟨fun x => CountableInterpolation.value (S := S) (enumerate := enumerate) gap (code x), ?_, ?_, ?_⟩ + · intro x + exact ⟨CountableInterpolation.value_lower gap _, CountableInterpolation.value_upper gap _⟩ + · intro x y lt + apply CountableInterpolation.value_strict + rw [cover, cover] + exact lt + · intro x y eq + apply CountableInterpolation.value_equal + rw [cover, cover] + exact eq + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EligibleBatchEquivariance.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EligibleBatchEquivariance.lean index 9a5e9f6a6aa9fa7db5955dc512aa928fc2a20ce2..cd5074965eb86cd47bd733b70aec4517b45f59d7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EligibleBatchEquivariance.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EligibleBatchEquivariance.lean @@ -1,197 +1,197 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def groundEligibleBatchAction (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := - let I := M.groundEligibleTasks P G r μ A Labels - let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - taggedActionGraph G P N A (M.groundEligibleFreshAction P G r μ A Labels) - -theorem groundEligibleFreshAction_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (meet : MeetOrderCode P r μ) : M.groundEligibleFreshAction P G r μ A Labels ∈ M.sets := by - obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs (fields 0).1 - exact M.indexedTaskActionGraph_mem pairing unions powers separation hG hI hP hN - (M.groundTaskTransport_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) - -theorem groundEligibleBatchAction_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (meet : MeetOrderCode P r μ) : M.groundEligibleBatchAction P G r μ A Labels ∈ M.sets := by - obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs (fields 0).1 - exact M.taggedActionGraph_mem pairing unions powers separation hG hP hN hA - (M.groundEligibleFreshAction_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) - -theorem groundEligibleBatchCovariance - {P G r μ A Labels m e : ZFSet.{u}} (action : PosetActionCode G P m e r A) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) - CodedAttachmentCovariance G P N A (M.groundEligibleFreshAction P G r μ A Labels) - (batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r)) - (batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels)) - (batchAttachmentUpperGraph I P (constantFamilyGraph I P) (literalTaskFilterGraph I P R U Labels)) := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) - let T := M.groundTaskTransport P G r μ A Labels - refine ⟨?_, ?_, ?_⟩ - · intro g hg q _ t _ q' _ t' _ first second inside - obtain ⟨_, _, _, i, _, i', hi', x, _, rfl, rfl, firstTask⟩ := - (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first - obtain ⟨_, _, _, j, _, j', _, y, _, rfl, rfl, secondTask⟩ := - (triple_mem_indexedTaskActionGraph G I P N T g t t').1 second - have ti := ((triple_mem_taskTransportGraph G I P R U Labels A g i i').1 firstTask).2.2.2 - have tj := ((triple_mem_taskTransportGraph G I P R U Labels A g j j').1 secondTask).2.2.2 - exact ti.inside_covariant action hg tj hi' inside - · intro g _ q _ q' _ p _ p' _ first acted shadow - obtain ⟨_, _, _, i, _, i', hi', x, _, rfl, rfl, task⟩ := - (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first - have ti := ((triple_mem_taskTransportGraph G I P R U Labels A g i i').1 task).2.2.2 - exact ti.shadow_covariant action hi' shadow acted - · intro g _ q _ q' _ p _ p' _ first acted upper - obtain ⟨_, _, _, i, _, i', hi', x, _, rfl, rfl, task⟩ := - (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first - have ti := ((triple_mem_taskTransportGraph G I P R U Labels A g i i').1 task).2.2.2 - exact ti.upper_covariant action hi' upper acted - -theorem groundEligibleBatchAction_code - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - PosetActionCode G d.batchCarrier m e d.batchOrder (M.groundEligibleBatchAction P G r μ A Labels) := - action.tagged_attachment - (M.groundEligibleFreshAction_setAction pairing unions powers separation hP hG hA group action meet) - (M.groundEligibleBatchCovariance action) - -theorem groundEligibleBatchAction_old_iff - {P G r μ A Labels g x y : ZFSet.{u}} (hx : x ∈ P) : - ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A := - taggedActionGraph_old_iff hx - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround - -universe u -variable (M : TransitiveGround.{u}) - -theorem groundEligibleBatchAction_representation - {P G r μ A Labels m inv e δ i j q x y : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) - (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let representation := batchAttachmentTemplateGraph I P - (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) - ZFSet.pair (ZFSet.pair i q) x ∈ representation → - ZFSet.pair (ZFSet.pair j q) y ∈ representation → - ZFSet.pair (ZFSet.pair δ x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Qs := constantFamilyGraph I P - let rs := constantFamilyGraph I r - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let N := indexedAttachmentFresh I Qs rs As - let T := M.groundTaskTransport P G r μ A Labels - let B := M.groundEligibleFreshAction P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - dsimp only - intro first second - obtain ⟨hδ, hi, hj, transport⟩ := - (triple_mem_taskTransportGraph G I P R U Labels A δ i j).1 task - let ii : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - let jj : {i : ZFSet.{u} // i ∈ I} := ⟨j, hj⟩ - obtain ⟨domain, _, branch⟩ := - (pair_mem_batchAttachmentTemplateGraph I P Qs rs As Es i q x).1 first - obtain ⟨_, Q, fieldQ, hqQ⟩ := (pair_mem_indexedAttachmentDomain I Qs i q).1 domain - have equalQ := ((pair_mem_constantFamilyGraph I P i Q).1 fieldQ).2 - have hq : q ∈ P := equalQ ▸ hqQ - have newDomain : ZFSet.pair j q ∈ indexedAttachmentDomain I Qs := - (pair_mem_indexedAttachmentDomain I Qs j q).2 - ⟨hj, P, (pair_mem_constantFamilyGraph I P j P).2 ⟨hj, rfl⟩, hq⟩ - rcases branch with ⟨base, field, image⟩ | ⟨fresh, equal⟩ - · have image' : ZFSet.pair q x ∈ d.embed ii := - d.embeddings.unique field (d.embed_entry ii) ▸ image - have hx := (ZFSet.pair_mem_prod.1 ((d.fiber ii).base_function.1 image')).2 - obtain ⟨v, acted, _⟩ := action.function.2 (ZFSet.pair δ x) - (ZFSet.pair_mem_prod.2 ⟨hδ, hx⟩) - have hv := (action.toSetAction.entry_shape acted).2.2 - have baseEq := transport.base_eq field (d.embed_entry jj) - have newImage : ZFSet.pair q v ∈ d.embed jj := by - rw [baseEq] - exact (pair_mem_actionPostcompose P A δ base q v).2 ⟨hq, hv, x, hx, image, acted⟩ - have newEntry : ZFSet.pair (ZFSet.pair j q) v ∈ - batchAttachmentTemplateGraph I P Qs rs As Es := - (pair_mem_batchAttachmentTemplateGraph I P Qs rs As Es j q v).2 - ⟨newDomain, old_mem_taggedExtension hv, Or.inl ⟨d.embed jj, d.embed_entry jj, newImage⟩⟩ - have same : v = y := d.batch_template_unique jj newEntry second - apply (triple_mem_taggedActionGraph G P N A B δ x y).2 - exact Or.inl (same ▸ acted) - · have newFresh : ZFSet.pair j q ∈ N := (transport.fresh_iff hi hj).1 fresh - have newEntry : ZFSet.pair (ZFSet.pair j q) (ZFSet.pair P (ZFSet.pair j q)) ∈ - batchAttachmentTemplateGraph I P Qs rs As Es := - (pair_mem_batchAttachmentTemplateGraph I P Qs rs As Es j q _).2 - ⟨newDomain, pair_mem_taggedExtension.2 newFresh, Or.inr ⟨newFresh, rfl⟩⟩ - have same : ZFSet.pair P (ZFSet.pair j q) = y := d.batch_template_unique jj newEntry second - have moved : ZFSet.pair (ZFSet.pair δ (ZFSet.pair i q)) (ZFSet.pair j q) ∈ B := - (triple_mem_indexedTaskActionGraph G I P N T δ (ZFSet.pair i q) (ZFSet.pair j q)).2 - ⟨hδ, fresh, newFresh, i, hi, j, hj, q, hq, rfl, rfl, task⟩ - exact (triple_mem_taggedActionGraph G P N A B δ x y).2 - (Or.inr ⟨hδ, ZFSet.pair i q, fresh, ZFSet.pair j q, newFresh, equal, same.symm, moved⟩) - -theorem groundEligibleBatchAction_equivariant - {P G r μ A Labels m inv e δ i j q x y : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) - (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let copies := batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) - ZFSet.pair q x ∈ copies i → ZFSet.pair q y ∈ copies j → - ZFSet.pair (ZFSet.pair δ x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by - dsimp only - intro first second - exact M.groundEligibleBatchAction_representation group action meet task - ((pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).1 first) - ((pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).1 second) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def groundEligibleBatchAction (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := + let I := M.groundEligibleTasks P G r μ A Labels + let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + taggedActionGraph G P N A (M.groundEligibleFreshAction P G r μ A Labels) + +theorem groundEligibleFreshAction_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (meet : MeetOrderCode P r μ) : M.groundEligibleFreshAction P G r μ A Labels ∈ M.sets := by + obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs (fields 0).1 + exact M.indexedTaskActionGraph_mem pairing unions powers separation hG hI hP hN + (M.groundTaskTransport_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) + +theorem groundEligibleBatchAction_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (meet : MeetOrderCode P r μ) : M.groundEligibleBatchAction P G r μ A Labels ∈ M.sets := by + obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs (fields 0).1 + exact M.taggedActionGraph_mem pairing unions powers separation hG hP hN hA + (M.groundEligibleFreshAction_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) + +theorem groundEligibleBatchCovariance + {P G r μ A Labels m e : ZFSet.{u}} (action : PosetActionCode G P m e r A) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) + CodedAttachmentCovariance G P N A (M.groundEligibleFreshAction P G r μ A Labels) + (batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r)) + (batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels)) + (batchAttachmentUpperGraph I P (constantFamilyGraph I P) (literalTaskFilterGraph I P R U Labels)) := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) + let T := M.groundTaskTransport P G r μ A Labels + refine ⟨?_, ?_, ?_⟩ + · intro g hg q _ t _ q' _ t' _ first second inside + obtain ⟨_, _, _, i, _, i', hi', x, _, rfl, rfl, firstTask⟩ := + (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first + obtain ⟨_, _, _, j, _, j', _, y, _, rfl, rfl, secondTask⟩ := + (triple_mem_indexedTaskActionGraph G I P N T g t t').1 second + have ti := ((triple_mem_taskTransportGraph G I P R U Labels A g i i').1 firstTask).2.2.2 + have tj := ((triple_mem_taskTransportGraph G I P R U Labels A g j j').1 secondTask).2.2.2 + exact ti.inside_covariant action hg tj hi' inside + · intro g _ q _ q' _ p _ p' _ first acted shadow + obtain ⟨_, _, _, i, _, i', hi', x, _, rfl, rfl, task⟩ := + (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first + have ti := ((triple_mem_taskTransportGraph G I P R U Labels A g i i').1 task).2.2.2 + exact ti.shadow_covariant action hi' shadow acted + · intro g _ q _ q' _ p _ p' _ first acted upper + obtain ⟨_, _, _, i, _, i', hi', x, _, rfl, rfl, task⟩ := + (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first + have ti := ((triple_mem_taskTransportGraph G I P R U Labels A g i i').1 task).2.2.2 + exact ti.upper_covariant action hi' upper acted + +theorem groundEligibleBatchAction_code + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + PosetActionCode G d.batchCarrier m e d.batchOrder (M.groundEligibleBatchAction P G r μ A Labels) := + action.tagged_attachment + (M.groundEligibleFreshAction_setAction pairing unions powers separation hP hG hA group action meet) + (M.groundEligibleBatchCovariance action) + +theorem groundEligibleBatchAction_old_iff + {P G r μ A Labels g x y : ZFSet.{u}} (hx : x ∈ P) : + ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A := + taggedActionGraph_old_iff hx + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround + +universe u +variable (M : TransitiveGround.{u}) + +theorem groundEligibleBatchAction_representation + {P G r μ A Labels m inv e δ i j q x y : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) + (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let representation := batchAttachmentTemplateGraph I P + (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) + ZFSet.pair (ZFSet.pair i q) x ∈ representation → + ZFSet.pair (ZFSet.pair j q) y ∈ representation → + ZFSet.pair (ZFSet.pair δ x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Qs := constantFamilyGraph I P + let rs := constantFamilyGraph I r + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let N := indexedAttachmentFresh I Qs rs As + let T := M.groundTaskTransport P G r μ A Labels + let B := M.groundEligibleFreshAction P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + dsimp only + intro first second + obtain ⟨hδ, hi, hj, transport⟩ := + (triple_mem_taskTransportGraph G I P R U Labels A δ i j).1 task + let ii : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + let jj : {i : ZFSet.{u} // i ∈ I} := ⟨j, hj⟩ + obtain ⟨domain, _, branch⟩ := + (pair_mem_batchAttachmentTemplateGraph I P Qs rs As Es i q x).1 first + obtain ⟨_, Q, fieldQ, hqQ⟩ := (pair_mem_indexedAttachmentDomain I Qs i q).1 domain + have equalQ := ((pair_mem_constantFamilyGraph I P i Q).1 fieldQ).2 + have hq : q ∈ P := equalQ ▸ hqQ + have newDomain : ZFSet.pair j q ∈ indexedAttachmentDomain I Qs := + (pair_mem_indexedAttachmentDomain I Qs j q).2 + ⟨hj, P, (pair_mem_constantFamilyGraph I P j P).2 ⟨hj, rfl⟩, hq⟩ + rcases branch with ⟨base, field, image⟩ | ⟨fresh, equal⟩ + · have image' : ZFSet.pair q x ∈ d.embed ii := + d.embeddings.unique field (d.embed_entry ii) ▸ image + have hx := (ZFSet.pair_mem_prod.1 ((d.fiber ii).base_function.1 image')).2 + obtain ⟨v, acted, _⟩ := action.function.2 (ZFSet.pair δ x) + (ZFSet.pair_mem_prod.2 ⟨hδ, hx⟩) + have hv := (action.toSetAction.entry_shape acted).2.2 + have baseEq := transport.base_eq field (d.embed_entry jj) + have newImage : ZFSet.pair q v ∈ d.embed jj := by + rw [baseEq] + exact (pair_mem_actionPostcompose P A δ base q v).2 ⟨hq, hv, x, hx, image, acted⟩ + have newEntry : ZFSet.pair (ZFSet.pair j q) v ∈ + batchAttachmentTemplateGraph I P Qs rs As Es := + (pair_mem_batchAttachmentTemplateGraph I P Qs rs As Es j q v).2 + ⟨newDomain, old_mem_taggedExtension hv, Or.inl ⟨d.embed jj, d.embed_entry jj, newImage⟩⟩ + have same : v = y := d.batch_template_unique jj newEntry second + apply (triple_mem_taggedActionGraph G P N A B δ x y).2 + exact Or.inl (same ▸ acted) + · have newFresh : ZFSet.pair j q ∈ N := (transport.fresh_iff hi hj).1 fresh + have newEntry : ZFSet.pair (ZFSet.pair j q) (ZFSet.pair P (ZFSet.pair j q)) ∈ + batchAttachmentTemplateGraph I P Qs rs As Es := + (pair_mem_batchAttachmentTemplateGraph I P Qs rs As Es j q _).2 + ⟨newDomain, pair_mem_taggedExtension.2 newFresh, Or.inr ⟨newFresh, rfl⟩⟩ + have same : ZFSet.pair P (ZFSet.pair j q) = y := d.batch_template_unique jj newEntry second + have moved : ZFSet.pair (ZFSet.pair δ (ZFSet.pair i q)) (ZFSet.pair j q) ∈ B := + (triple_mem_indexedTaskActionGraph G I P N T δ (ZFSet.pair i q) (ZFSet.pair j q)).2 + ⟨hδ, fresh, newFresh, i, hi, j, hj, q, hq, rfl, rfl, task⟩ + exact (triple_mem_taggedActionGraph G P N A B δ x y).2 + (Or.inr ⟨hδ, ZFSet.pair i q, fresh, ZFSet.pair j q, newFresh, equal, same.symm, moved⟩) + +theorem groundEligibleBatchAction_equivariant + {P G r μ A Labels m inv e δ i j q x y : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) + (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let copies := batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) + ZFSet.pair q x ∈ copies i → ZFSet.pair q y ∈ copies j → + ZFSet.pair (ZFSet.pair δ x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by + dsimp only + intro first second + exact M.groundEligibleBatchAction_representation group action meet task + ((pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).1 first) + ((pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).1 second) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EvaluatedDomains.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EvaluatedDomains.lean index 2dbe4865e3fbb812ed30bf9e4e078c486836b6d7..f581e76fb136488e637e5a452430c333cb59745f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EvaluatedDomains.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/EvaluatedDomains.lean @@ -1,490 +1,490 @@ -import Mathlib.SetTheory.ZFC.Rank -import OAI.SetTheory.PartitionPrinciple.Definability.SetPresentations -import OAI.SetTheory.PartitionPrinciple.Forcing.GenericPartialFunctions - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -open SetRealization -universe u v -variable {P : Type u} - -inductive IsName (s : Presentation P) : ZFSet.{u} → Prop - | mk {x} : (∀ z ∈ x, ∃ y p, z = ZFSet.pair y (s.encode p)) → - (∀ y p, ZFSet.pair y (s.encode p) ∈ x → IsName s y) → IsName s x - -def Name (s : Presentation P) := {x : ZFSet.{u} // IsName s x} - -namespace Name -variable {s : Presentation P} - -def Entry (σ τ : Name s) (p : P) : Prop := - ZFSet.pair σ.val (s.encode p) ∈ τ.val - -theorem entries_cover (τ : Name s) {z : ZFSet.{u}} (hz : z ∈ τ.val) : - ∃ σ : Name s, ∃ p, z = ZFSet.pair σ.val (s.encode p) := by - obtain ⟨x, hx⟩ := τ - cases hx with - | mk h children => - obtain ⟨y, p, eq⟩ := h z hz - exact ⟨⟨y, children y p (eq ▸ hz)⟩, p, eq⟩ - -theorem ext {τ ν : Name s} (h : ∀ σ p, Entry σ τ p ↔ Entry σ ν p) : τ = ν := by - apply Subtype.ext - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨σ, p, rfl⟩ := entries_cover τ hz - exact (h σ p).1 hz - · intro hz - obtain ⟨σ, p, rfl⟩ := entries_cover ν hz - exact (h σ p).2 hz - -theorem entry_rank_lt {σ τ : Name s} {p : P} (h : Entry σ τ p) : - ZFSet.rank σ.val < ZFSet.rank τ.val := by - have h₁ : σ.val ∈ ({σ.val} : ZFSet) := ZFSet.mem_singleton.2 rfl - have h₂ : ({σ.val} : ZFSet) ∈ ZFSet.pair σ.val (s.encode p) := by - exact ZFSet.mem_pair.2 (Or.inl rfl) - exact (ZFSet.rank_lt_of_mem h₁).trans - ((ZFSet.rank_lt_of_mem h₂).trans (ZFSet.rank_lt_of_mem h)) - -theorem inductionOn {motive : Name s → Prop} (τ : Name s) - (step : ∀ ν, (∀ σ p, Entry σ ν p → motive σ) → motive ν) : motive τ := by - apply (InvImage.wf (fun ν : Name s => ZFSet.rank ν.val) wellFounded_lt).induction τ - intro ν ih - exact step ν (fun σ p h => ih σ (entry_rank_lt h)) - -def Entries (τ : Name s) := {a : Name s × P // Entry a.1 τ a.2} - -instance entries_small (τ : Name s) : Small.{u} (Entries τ) := by - let f : Entries τ → τ.val := - fun a => ⟨ZFSet.pair a.val.1.val (s.encode a.val.2), a.property⟩ - apply small_of_injective (f := f) - intro a b eq - have parts := ZFSet.pair_inj.1 (congrArg Subtype.val eq) - apply Subtype.ext - exact Prod.ext (Subtype.ext parts.1) (s.injective parts.2) - -noncomputable def assemble {α : Type v} [Small.{u} α] - (names : α → Name s) (conditions : α → P) : Name s := by - refine ⟨ZFSet.range (fun i => ZFSet.pair (names i).val (s.encode (conditions i))), - IsName.mk ?_ ?_⟩ - · intro z hz - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hz - exact ⟨(names i).val, conditions i, rfl⟩ - · intro y p hp - obtain ⟨i, eq⟩ := ZFSet.mem_range.1 hp - have eqy := (ZFSet.pair_inj.1 eq).1 - exact eqy ▸ (names i).property - -theorem entry_assemble {α : Type v} [Small.{u} α] - (names : α → Name s) (conditions : α → P) (σ : Name s) (p : P) : - Entry σ (assemble names conditions) p ↔ ∃ i, names i = σ ∧ conditions i = p := by - change ZFSet.pair σ.val (s.encode p) ∈ ZFSet.range _ ↔ _ - rw [ZFSet.mem_range] - constructor - · rintro ⟨i, eq⟩ - have parts := ZFSet.pair_inj.1 eq - exact ⟨i, Subtype.ext parts.1, s.injective parts.2⟩ - · rintro ⟨i, rfl, rfl⟩ - exact ⟨i, rfl⟩ - -theorem assemble_entries (τ : Name s) : - assemble (fun a : Entries τ => a.val.1) (fun a => a.val.2) = τ := by - apply ext - intro σ p - rw [entry_assemble] - constructor - · rintro ⟨a, hs, hp⟩ - simpa only [← hs, ← hp] using a.property - · intro h - exact ⟨⟨(σ, p), h⟩, rfl, rfl⟩ - -def empty (s : Presentation P) : Name s := - ⟨∅, IsName.mk (by intro z hz; exact False.elim (ZFSet.notMem_empty z hz)) - (by intro y p hp; exact False.elim (ZFSet.notMem_empty _ hp))⟩ - -theorem not_entry_empty (σ : Name s) (p : P) : ¬ Entry σ (empty s) p := - ZFSet.notMem_empty _ - -end Name -end - - - -namespace Name - -open SetRealization -universe u v -variable {P : Type u} {s : Presentation P} - -noncomputable def eval (H : Set P) (τ : Name s) : ZFSet.{u} := - ZFSet.range (fun a : {a : Entries τ // a.val.2 ∈ H} => eval H a.val.val.1) -termination_by ZFSet.rank τ.val -decreasing_by exact entry_rank_lt a.val.property - -theorem mem_eval (H : Set P) (τ : Name s) (x : ZFSet.{u}) : - x ∈ eval H τ ↔ ∃ σ p, Entry σ τ p ∧ p ∈ H ∧ eval H σ = x := by - rw [eval, ZFSet.mem_range] - constructor - · rintro ⟨a, eq⟩ - exact ⟨a.val.val.1, a.val.val.2, a.val.property, a.property, eq⟩ - · rintro ⟨σ, p, h, hp, eq⟩ - exact ⟨⟨⟨(σ, p), h⟩, hp⟩, eq⟩ - -theorem mem_eval_assemble (H : Set P) {α : Type v} [Small.{u} α] - (names : α → Name s) (conditions : α → P) (x : ZFSet.{u}) : - x ∈ eval H (assemble names conditions) ↔ - ∃ i, conditions i ∈ H ∧ eval H (names i) = x := by - rw [mem_eval] - constructor - · rintro ⟨σ, p, entry, hp, eq⟩ - obtain ⟨i, rfl, rfl⟩ := (entry_assemble names conditions σ p).1 entry - exact ⟨i, hp, eq⟩ - · rintro ⟨i, hp, eq⟩ - exact ⟨names i, conditions i, - (entry_assemble names conditions _ _).2 ⟨i, rfl, rfl⟩, hp, eq⟩ - -theorem eval_assemble (H : Set P) {α : Type v} [Small.{u} α] - (names : α → Name s) (conditions : α → P) : - eval H (assemble names conditions) = - ZFSet.range (fun i : {i // conditions i ∈ H} => eval H (names i.val)) := by - apply ZFSet.ext - intro x - rw [mem_eval_assemble, ZFSet.mem_range] - constructor - · rintro ⟨i, hp, eq⟩ - exact ⟨⟨i, hp⟩, eq⟩ - · rintro ⟨i, eq⟩ - exact ⟨i.val, i.property, eq⟩ - -theorem eval_empty (H : Set P) : eval H (empty s) = ∅ := by - apply ZFSet.ext - intro x - rw [mem_eval] - constructor - · rintro ⟨σ, p, h, _, _⟩ - exact False.elim (not_entry_empty σ p h) - · exact False.elim ∘ ZFSet.notMem_empty x - -theorem eval_empty_conditions (τ : Name s) : eval (∅ : Set P) τ = ∅ := by - apply ZFSet.ext - intro x - rw [mem_eval] - constructor - · rintro ⟨_, _, _, hp, _⟩ - exact False.elim hp - · exact False.elim ∘ ZFSet.notMem_empty x - -end Name - - - -namespace Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -noncomputable def ForcesEq (p : P) (σ τ : Name s) : Prop := - (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → - ∃ t, t ≤ q ∧ ∃ ν k, Entry ν τ k ∧ t ≤ k ∧ ForcesEq t ρ ν) ∧ - (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → - ∃ t, t ≤ q ∧ ∃ ρ r, ∃ _ : Entry ρ σ r, t ≤ r ∧ ForcesEq t ρ ν) -termination_by ZFSet.rank σ.val -decreasing_by all_goals exact entry_rank_lt ‹Entry _ σ _› - -theorem forcesEq_mono {p q : P} {σ τ : Name s} (h : ForcesEq p σ τ) (qp : q ≤ p) : - ForcesEq q σ τ := by - rw [ForcesEq] at h ⊢ - exact ⟨fun ρ r hr t tq tr => h.1 ρ r hr t (tq.trans qp) tr, - fun ν k hk t tq tk => h.2 ν k hk t (tq.trans qp) tk⟩ - -theorem forcesEq_refl (σ : Name s) (p : P) : ForcesEq p σ σ := by - induction σ using inductionOn generalizing p with - | step σ ih => - rw [ForcesEq] - constructor - · intro ρ r hr q _ qr - exact ⟨q, le_rfl, ρ, r, hr, qr, ih ρ r hr q⟩ - · intro ρ r hr q _ qr - exact ⟨q, le_rfl, ρ, r, hr, qr, ih ρ r hr q⟩ - -theorem forcesEq_symm {p : P} {σ τ : Name s} (h : ForcesEq p σ τ) : ForcesEq p τ σ := by - induction σ using inductionOn generalizing p τ with - | step σ ih => - rw [ForcesEq] at h ⊢ - constructor - · intro ν k hk q qp qk - obtain ⟨t, tq, ρ, r, hr, tr, eq⟩ := h.2 ν k hk q qp qk - exact ⟨t, tq, ρ, r, hr, tr, ih ρ r hr eq⟩ - · intro ρ r hr q qp qr - obtain ⟨t, tq, ν, k, hk, tk, eq⟩ := h.1 ρ r hr q qp qr - exact ⟨t, tq, ν, k, hk, tk, ih ρ r hr eq⟩ - -theorem forcesEq_of_dense {p : P} {σ τ : Name s} - (dense : DenseBelow p {q | ForcesEq q σ τ}) : ForcesEq p σ τ := by - rw [ForcesEq] - constructor - · intro ρ r hr q qp qr - obtain ⟨t, tq, ht⟩ := dense q qp - change ForcesEq t σ τ at ht - rw [ForcesEq] at ht - obtain ⟨v, vt, ν, k, hk, vk, eq⟩ := ht.1 ρ r hr t le_rfl (tq.trans qr) - exact ⟨v, vt.trans tq, ν, k, hk, vk, eq⟩ - · intro ν k hk q qp qk - obtain ⟨t, tq, ht⟩ := dense q qp - change ForcesEq t σ τ at ht - rw [ForcesEq] at ht - obtain ⟨v, vt, ρ, r, hr, vr, eq⟩ := ht.2 ν k hk t le_rfl (tq.trans qk) - exact ⟨v, vt.trans tq, ρ, r, hr, vr, eq⟩ - -def MemWitness (σ τ : Name s) : Set P := - {p | ∃ ν r, Entry ν τ r ∧ p ≤ r ∧ ForcesEq p σ ν} - -def ForcesMem (p : P) (σ τ : Name s) : Prop := DenseBelow p (MemWitness σ τ) - -theorem forcesMem_mono {p q : P} {σ τ : Name s} (h : ForcesMem p σ τ) (qp : q ≤ p) : - ForcesMem q σ τ := fun r rq => h r (rq.trans qp) - -theorem forcesMem_of_witness {p : P} {σ τ : Name s} (h : p ∈ MemWitness σ τ) : - ForcesMem p σ τ := by - obtain ⟨ν, r, entry, pr, eq⟩ := h - intro q qp - exact ⟨q, le_rfl, ν, r, entry, qp.trans pr, forcesEq_mono eq qp⟩ - -theorem forcesMem_entry {σ τ : Name s} {r : P} (entry : Entry σ τ r) : - ForcesMem r σ τ := forcesMem_of_witness ⟨σ, r, entry, le_rfl, forcesEq_refl σ r⟩ - -theorem forcesMem_of_dense {p : P} {σ τ : Name s} - (dense : DenseBelow p {q | ForcesMem q σ τ}) : ForcesMem p σ τ := by - intro q qp - obtain ⟨r, rq, hr⟩ := dense q qp - obtain ⟨t, tr, ht⟩ := hr r le_rfl - exact ⟨t, tr.trans rq, ht⟩ - -theorem forcesEq_left {p q r : P} {σ τ ρ : Name s} - (eq : ForcesEq p σ τ) (entry : Entry ρ σ r) (qp : q ≤ p) (qr : q ≤ r) : - ForcesMem q ρ τ := by - rw [ForcesEq] at eq - intro t tq - exact eq.1 ρ r entry t (tq.trans qp) (tq.trans qr) - -theorem forcesEq_right {p q r : P} {σ τ ρ : Name s} - (eq : ForcesEq p σ τ) (entry : Entry ρ τ r) (qp : q ≤ p) (qr : q ≤ r) : - ForcesMem q ρ σ := forcesEq_left (forcesEq_symm eq) entry qp qr - -theorem forcesEq_iff (p : P) (σ τ : Name s) : ForcesEq p σ τ ↔ - (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → ForcesMem q ρ τ) ∧ - (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → ForcesMem q ν σ) := by - constructor - · intro eq - exact ⟨fun _ _ entry _ qp qr => forcesEq_left eq entry qp qr, - fun _ _ entry _ qp qr => forcesEq_right eq entry qp qr⟩ - · rintro ⟨left, right⟩ - rw [ForcesEq] - constructor - · intro ρ r hr q qp qr - exact left ρ r hr q qp qr q le_rfl - · intro ν k hk q qp qk - obtain ⟨t, tq, ρ, r, hr, tr, eq⟩ := right ν k hk q qp qk q le_rfl - exact ⟨t, tq, ρ, r, hr, tr, forcesEq_symm eq⟩ - -end Name - - - -namespace Name - -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -noncomputable def check (s : Presentation P) (one : P) (x : ZFSet.{u}) : Name s := - assemble (fun y : x => check s one y.val) (fun _ => one) -termination_by ZFSet.rank x -decreasing_by exact ZFSet.rank_lt_of_mem y.property - -theorem entry_check (one : P) (x : ZFSet.{u}) (σ : Name s) (p : P) : - Entry σ (check s one x) p ↔ ∃ y ∈ x, check s one y = σ ∧ one = p := by - rw [check, entry_assemble] - constructor - · rintro ⟨y, eq, hp⟩ - exact ⟨y.val, y.property, eq, hp⟩ - · rintro ⟨y, hy, eq, hp⟩ - exact ⟨⟨y, hy⟩, eq, hp⟩ - -theorem eval_check (H : Set P) (one : P) (hone : one ∈ H) (x : ZFSet.{u}) : - eval H (check s one x) = x := by - induction x using ZFSet.inductionOn with - | h x ih => - rw [check] - apply ZFSet.ext - intro z - rw [mem_eval_assemble] - constructor - · rintro ⟨y, _, eq⟩ - rw [ih y.val y.property] at eq - exact eq ▸ y.property - · intro hz - exact ⟨⟨z, hz⟩, hone, ih z hz⟩ - -theorem check_injective (s : Presentation P) (one : P) : - Function.Injective (check s one) := by - intro x y eq - have h := congrArg (eval (Set.univ : Set P)) eq - simpa only [eval_check Set.univ one (Set.mem_univ one)] using h - -noncomputable def singleton (one : P) (σ : Name s) : Name s := - assemble (fun _ : Unit => σ) (fun _ => one) - -noncomputable def unorderedPair (one : P) (σ τ : Name s) : Name s := - assemble (fun b : Bool => if b then σ else τ) (fun _ => one) - -noncomputable def orderedPair (one : P) (σ τ : Name s) : Name s := - unorderedPair one (singleton one σ) (unorderedPair one σ τ) - -theorem eval_singleton (H : Set P) (one : P) (hone : one ∈ H) (σ : Name s) : - eval H (singleton one σ) = {eval H σ} := by - apply ZFSet.ext - intro x - rw [singleton, mem_eval_assemble, ZFSet.mem_singleton] - constructor - · rintro ⟨_, _, eq⟩ - exact eq.symm - · intro eq - exact ⟨(), hone, eq.symm⟩ - -theorem eval_unorderedPair (H : Set P) (one : P) (hone : one ∈ H) (σ τ : Name s) : - eval H (unorderedPair one σ τ) = {eval H σ, eval H τ} := by - apply ZFSet.ext - intro x - rw [unorderedPair, mem_eval_assemble, ZFSet.mem_pair] - constructor - · rintro ⟨b, _, eq⟩ - cases b with - | false => exact Or.inr eq.symm - | true => exact Or.inl eq.symm - · rintro (eq | eq) - · exact ⟨true, hone, eq.symm⟩ - · exact ⟨false, hone, eq.symm⟩ - -theorem eval_orderedPair (H : Set P) (one : P) (hone : one ∈ H) (σ τ : Name s) : - eval H (orderedPair one σ τ) = ZFSet.pair (eval H σ) (eval H τ) := by - rw [orderedPair, eval_unorderedPair H one hone, - eval_singleton H one hone, eval_unorderedPair H one hone] - rfl - -end Name - - - -namespace Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -structure NameDomain (s : Presentation P) where - names : Set (Name s) - children : ∀ {σ τ : Name s} {p : P}, τ ∈ names → Entry σ τ p → σ ∈ names - -def ForcesNotMem (p : P) (σ τ : Name s) : Prop := - ∀ q, q ≤ p → ¬ ForcesMem q σ τ - -theorem not_forcesMem_refine {p : P} {σ τ : Name s} (bad : ¬ ForcesMem p σ τ) : - ∃ q, q ≤ p ∧ ForcesNotMem q σ τ := by - classical - change ¬ ∀ q, q ≤ p → ∃ r, r ≤ q ∧ r ∈ MemWitness σ τ at bad - push Not at bad - obtain ⟨q, qp, hq⟩ := bad - refine ⟨q, qp, ?_⟩ - intro r rq hr - obtain ⟨t, tr, ht⟩ := hr r le_rfl - exact hq t (tr.trans rq) ht - -def EqDecisionWitness (σ τ : Name s) : Set P := - {p | ForcesEq p σ τ ∨ - (∃ ρ r, Entry ρ σ r ∧ p ≤ r ∧ ForcesNotMem p ρ τ) ∨ - ∃ ν k, Entry ν τ k ∧ p ≤ k ∧ ForcesNotMem p ν σ} - -theorem eqDecisionWitness_dense (σ τ : Name s) : Dense (EqDecisionWitness σ τ) := by - classical - intro p - by_cases eq : ForcesEq p σ τ - · exact ⟨p, le_rfl, Or.inl eq⟩ - · rw [forcesEq_iff] at eq - obtain bad | bad := not_and_or.mp eq - · push Not at bad - obtain ⟨ρ, r, entry, q, qp, qr, nmem⟩ := bad - obtain ⟨t, tq, neg⟩ := not_forcesMem_refine nmem - exact ⟨t, tq.trans qp, Or.inr (Or.inl ⟨ρ, r, entry, tq.trans qr, neg⟩)⟩ - · push Not at bad - obtain ⟨ν, k, entry, q, qp, qk, nmem⟩ := bad - obtain ⟨t, tq, neg⟩ := not_forcesMem_refine nmem - exact ⟨t, tq.trans qp, Or.inr (Or.inr ⟨ν, k, entry, tq.trans qk, neg⟩)⟩ - -def atomicFamily (D : NameDomain s) : Set (Set P) := - {E | (∃ p σ τ, σ ∈ D.names ∧ τ ∈ D.names ∧ E = Localized p (MemWitness σ τ)) ∨ - ∃ σ τ, σ ∈ D.names ∧ τ ∈ D.names ∧ E = EqDecisionWitness σ τ} - -theorem generic_mem_witness (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} - (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) {p : P} (hp : H.mem p) - (h : ForcesMem p σ τ) : H.Meets (MemWitness σ τ) := - H.meets_below generic hp (Or.inl ⟨p, σ, τ, hσ, hτ, rfl⟩) h - -end Name - - - -namespace Name.NameDomain - -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -def values (D : NameDomain s) (H : Set P) : Set ZFSet.{u} := - Set.range (fun τ : D.names => eval H τ.val) - -theorem mem_values (D : NameDomain s) (H : Set P) (x : ZFSet.{u}) : - x ∈ D.values H ↔ ∃ τ ∈ D.names, eval H τ = x := by - constructor - · rintro ⟨τ, eq⟩ - exact ⟨τ.val, τ.property, eq⟩ - · rintro ⟨τ, hτ, eq⟩ - exact ⟨⟨τ, hτ⟩, eq⟩ - -theorem values_transitive (D : NameDomain s) (H : Set P) - {x y : ZFSet.{u}} (hx : x ∈ D.values H) (hy : y ∈ x) : y ∈ D.values H := by - obtain ⟨τ, hτ, rfl⟩ := (D.mem_values H x).1 hx - obtain ⟨σ, p, entry, _, eq⟩ := (mem_eval H τ y).1 hy - exact (D.mem_values H y).2 ⟨σ, D.children hτ entry, eq⟩ - -theorem values_extensionality (D : NameDomain s) (H : Set P) - {x y : ZFSet.{u}} (hx : x ∈ D.values H) (hy : y ∈ D.values H) - (agree : ∀ z ∈ D.values H, z ∈ x ↔ z ∈ y) : x = y := by - apply ZFSet.ext - intro z - constructor - · intro hz - exact (agree z (D.values_transitive H hx hz)).1 hz - · intro hz - exact (agree z (D.values_transitive H hy hz)).2 hz - -theorem values_foundation (D : NameDomain s) (H : Set P) - {x : ZFSet.{u}} (hx : x ∈ D.values H) (nonempty : x ≠ ∅) : - ∃ y ∈ D.values H, y ∈ x ∧ x ∩ y = ∅ := by - obtain ⟨y, yx, disjoint⟩ := ZFSet.regularity x nonempty - exact ⟨y, D.values_transitive H hx yx, yx, disjoint⟩ - -end Name.NameDomain - -end PartitionPilot.Forcing - -end OAI +import Mathlib.SetTheory.ZFC.Rank +import OAI.SetTheory.PartitionPrinciple.Definability.SetPresentations +import OAI.SetTheory.PartitionPrinciple.Forcing.GenericPartialFunctions + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +open SetRealization +universe u v +variable {P : Type u} + +inductive IsName (s : Presentation P) : ZFSet.{u} → Prop + | mk {x} : (∀ z ∈ x, ∃ y p, z = ZFSet.pair y (s.encode p)) → + (∀ y p, ZFSet.pair y (s.encode p) ∈ x → IsName s y) → IsName s x + +def Name (s : Presentation P) := {x : ZFSet.{u} // IsName s x} + +namespace Name +variable {s : Presentation P} + +def Entry (σ τ : Name s) (p : P) : Prop := + ZFSet.pair σ.val (s.encode p) ∈ τ.val + +theorem entries_cover (τ : Name s) {z : ZFSet.{u}} (hz : z ∈ τ.val) : + ∃ σ : Name s, ∃ p, z = ZFSet.pair σ.val (s.encode p) := by + obtain ⟨x, hx⟩ := τ + cases hx with + | mk h children => + obtain ⟨y, p, eq⟩ := h z hz + exact ⟨⟨y, children y p (eq ▸ hz)⟩, p, eq⟩ + +theorem ext {τ ν : Name s} (h : ∀ σ p, Entry σ τ p ↔ Entry σ ν p) : τ = ν := by + apply Subtype.ext + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨σ, p, rfl⟩ := entries_cover τ hz + exact (h σ p).1 hz + · intro hz + obtain ⟨σ, p, rfl⟩ := entries_cover ν hz + exact (h σ p).2 hz + +theorem entry_rank_lt {σ τ : Name s} {p : P} (h : Entry σ τ p) : + ZFSet.rank σ.val < ZFSet.rank τ.val := by + have h₁ : σ.val ∈ ({σ.val} : ZFSet) := ZFSet.mem_singleton.2 rfl + have h₂ : ({σ.val} : ZFSet) ∈ ZFSet.pair σ.val (s.encode p) := by + exact ZFSet.mem_pair.2 (Or.inl rfl) + exact (ZFSet.rank_lt_of_mem h₁).trans + ((ZFSet.rank_lt_of_mem h₂).trans (ZFSet.rank_lt_of_mem h)) + +theorem inductionOn {motive : Name s → Prop} (τ : Name s) + (step : ∀ ν, (∀ σ p, Entry σ ν p → motive σ) → motive ν) : motive τ := by + apply (InvImage.wf (fun ν : Name s => ZFSet.rank ν.val) wellFounded_lt).induction τ + intro ν ih + exact step ν (fun σ p h => ih σ (entry_rank_lt h)) + +def Entries (τ : Name s) := {a : Name s × P // Entry a.1 τ a.2} + +instance entries_small (τ : Name s) : Small.{u} (Entries τ) := by + let f : Entries τ → τ.val := + fun a => ⟨ZFSet.pair a.val.1.val (s.encode a.val.2), a.property⟩ + apply small_of_injective (f := f) + intro a b eq + have parts := ZFSet.pair_inj.1 (congrArg Subtype.val eq) + apply Subtype.ext + exact Prod.ext (Subtype.ext parts.1) (s.injective parts.2) + +noncomputable def assemble {α : Type v} [Small.{u} α] + (names : α → Name s) (conditions : α → P) : Name s := by + refine ⟨ZFSet.range (fun i => ZFSet.pair (names i).val (s.encode (conditions i))), + IsName.mk ?_ ?_⟩ + · intro z hz + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hz + exact ⟨(names i).val, conditions i, rfl⟩ + · intro y p hp + obtain ⟨i, eq⟩ := ZFSet.mem_range.1 hp + have eqy := (ZFSet.pair_inj.1 eq).1 + exact eqy ▸ (names i).property + +theorem entry_assemble {α : Type v} [Small.{u} α] + (names : α → Name s) (conditions : α → P) (σ : Name s) (p : P) : + Entry σ (assemble names conditions) p ↔ ∃ i, names i = σ ∧ conditions i = p := by + change ZFSet.pair σ.val (s.encode p) ∈ ZFSet.range _ ↔ _ + rw [ZFSet.mem_range] + constructor + · rintro ⟨i, eq⟩ + have parts := ZFSet.pair_inj.1 eq + exact ⟨i, Subtype.ext parts.1, s.injective parts.2⟩ + · rintro ⟨i, rfl, rfl⟩ + exact ⟨i, rfl⟩ + +theorem assemble_entries (τ : Name s) : + assemble (fun a : Entries τ => a.val.1) (fun a => a.val.2) = τ := by + apply ext + intro σ p + rw [entry_assemble] + constructor + · rintro ⟨a, hs, hp⟩ + simpa only [← hs, ← hp] using a.property + · intro h + exact ⟨⟨(σ, p), h⟩, rfl, rfl⟩ + +def empty (s : Presentation P) : Name s := + ⟨∅, IsName.mk (by intro z hz; exact False.elim (ZFSet.notMem_empty z hz)) + (by intro y p hp; exact False.elim (ZFSet.notMem_empty _ hp))⟩ + +theorem not_entry_empty (σ : Name s) (p : P) : ¬ Entry σ (empty s) p := + ZFSet.notMem_empty _ + +end Name +end + + + +namespace Name + +open SetRealization +universe u v +variable {P : Type u} {s : Presentation P} + +noncomputable def eval (H : Set P) (τ : Name s) : ZFSet.{u} := + ZFSet.range (fun a : {a : Entries τ // a.val.2 ∈ H} => eval H a.val.val.1) +termination_by ZFSet.rank τ.val +decreasing_by exact entry_rank_lt a.val.property + +theorem mem_eval (H : Set P) (τ : Name s) (x : ZFSet.{u}) : + x ∈ eval H τ ↔ ∃ σ p, Entry σ τ p ∧ p ∈ H ∧ eval H σ = x := by + rw [eval, ZFSet.mem_range] + constructor + · rintro ⟨a, eq⟩ + exact ⟨a.val.val.1, a.val.val.2, a.val.property, a.property, eq⟩ + · rintro ⟨σ, p, h, hp, eq⟩ + exact ⟨⟨⟨(σ, p), h⟩, hp⟩, eq⟩ + +theorem mem_eval_assemble (H : Set P) {α : Type v} [Small.{u} α] + (names : α → Name s) (conditions : α → P) (x : ZFSet.{u}) : + x ∈ eval H (assemble names conditions) ↔ + ∃ i, conditions i ∈ H ∧ eval H (names i) = x := by + rw [mem_eval] + constructor + · rintro ⟨σ, p, entry, hp, eq⟩ + obtain ⟨i, rfl, rfl⟩ := (entry_assemble names conditions σ p).1 entry + exact ⟨i, hp, eq⟩ + · rintro ⟨i, hp, eq⟩ + exact ⟨names i, conditions i, + (entry_assemble names conditions _ _).2 ⟨i, rfl, rfl⟩, hp, eq⟩ + +theorem eval_assemble (H : Set P) {α : Type v} [Small.{u} α] + (names : α → Name s) (conditions : α → P) : + eval H (assemble names conditions) = + ZFSet.range (fun i : {i // conditions i ∈ H} => eval H (names i.val)) := by + apply ZFSet.ext + intro x + rw [mem_eval_assemble, ZFSet.mem_range] + constructor + · rintro ⟨i, hp, eq⟩ + exact ⟨⟨i, hp⟩, eq⟩ + · rintro ⟨i, eq⟩ + exact ⟨i.val, i.property, eq⟩ + +theorem eval_empty (H : Set P) : eval H (empty s) = ∅ := by + apply ZFSet.ext + intro x + rw [mem_eval] + constructor + · rintro ⟨σ, p, h, _, _⟩ + exact False.elim (not_entry_empty σ p h) + · exact False.elim ∘ ZFSet.notMem_empty x + +theorem eval_empty_conditions (τ : Name s) : eval (∅ : Set P) τ = ∅ := by + apply ZFSet.ext + intro x + rw [mem_eval] + constructor + · rintro ⟨_, _, _, hp, _⟩ + exact False.elim hp + · exact False.elim ∘ ZFSet.notMem_empty x + +end Name + + + +namespace Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +noncomputable def ForcesEq (p : P) (σ τ : Name s) : Prop := + (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → + ∃ t, t ≤ q ∧ ∃ ν k, Entry ν τ k ∧ t ≤ k ∧ ForcesEq t ρ ν) ∧ + (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → + ∃ t, t ≤ q ∧ ∃ ρ r, ∃ _ : Entry ρ σ r, t ≤ r ∧ ForcesEq t ρ ν) +termination_by ZFSet.rank σ.val +decreasing_by all_goals exact entry_rank_lt ‹Entry _ σ _› + +theorem forcesEq_mono {p q : P} {σ τ : Name s} (h : ForcesEq p σ τ) (qp : q ≤ p) : + ForcesEq q σ τ := by + rw [ForcesEq] at h ⊢ + exact ⟨fun ρ r hr t tq tr => h.1 ρ r hr t (tq.trans qp) tr, + fun ν k hk t tq tk => h.2 ν k hk t (tq.trans qp) tk⟩ + +theorem forcesEq_refl (σ : Name s) (p : P) : ForcesEq p σ σ := by + induction σ using inductionOn generalizing p with + | step σ ih => + rw [ForcesEq] + constructor + · intro ρ r hr q _ qr + exact ⟨q, le_rfl, ρ, r, hr, qr, ih ρ r hr q⟩ + · intro ρ r hr q _ qr + exact ⟨q, le_rfl, ρ, r, hr, qr, ih ρ r hr q⟩ + +theorem forcesEq_symm {p : P} {σ τ : Name s} (h : ForcesEq p σ τ) : ForcesEq p τ σ := by + induction σ using inductionOn generalizing p τ with + | step σ ih => + rw [ForcesEq] at h ⊢ + constructor + · intro ν k hk q qp qk + obtain ⟨t, tq, ρ, r, hr, tr, eq⟩ := h.2 ν k hk q qp qk + exact ⟨t, tq, ρ, r, hr, tr, ih ρ r hr eq⟩ + · intro ρ r hr q qp qr + obtain ⟨t, tq, ν, k, hk, tk, eq⟩ := h.1 ρ r hr q qp qr + exact ⟨t, tq, ν, k, hk, tk, ih ρ r hr eq⟩ + +theorem forcesEq_of_dense {p : P} {σ τ : Name s} + (dense : DenseBelow p {q | ForcesEq q σ τ}) : ForcesEq p σ τ := by + rw [ForcesEq] + constructor + · intro ρ r hr q qp qr + obtain ⟨t, tq, ht⟩ := dense q qp + change ForcesEq t σ τ at ht + rw [ForcesEq] at ht + obtain ⟨v, vt, ν, k, hk, vk, eq⟩ := ht.1 ρ r hr t le_rfl (tq.trans qr) + exact ⟨v, vt.trans tq, ν, k, hk, vk, eq⟩ + · intro ν k hk q qp qk + obtain ⟨t, tq, ht⟩ := dense q qp + change ForcesEq t σ τ at ht + rw [ForcesEq] at ht + obtain ⟨v, vt, ρ, r, hr, vr, eq⟩ := ht.2 ν k hk t le_rfl (tq.trans qk) + exact ⟨v, vt.trans tq, ρ, r, hr, vr, eq⟩ + +def MemWitness (σ τ : Name s) : Set P := + {p | ∃ ν r, Entry ν τ r ∧ p ≤ r ∧ ForcesEq p σ ν} + +def ForcesMem (p : P) (σ τ : Name s) : Prop := DenseBelow p (MemWitness σ τ) + +theorem forcesMem_mono {p q : P} {σ τ : Name s} (h : ForcesMem p σ τ) (qp : q ≤ p) : + ForcesMem q σ τ := fun r rq => h r (rq.trans qp) + +theorem forcesMem_of_witness {p : P} {σ τ : Name s} (h : p ∈ MemWitness σ τ) : + ForcesMem p σ τ := by + obtain ⟨ν, r, entry, pr, eq⟩ := h + intro q qp + exact ⟨q, le_rfl, ν, r, entry, qp.trans pr, forcesEq_mono eq qp⟩ + +theorem forcesMem_entry {σ τ : Name s} {r : P} (entry : Entry σ τ r) : + ForcesMem r σ τ := forcesMem_of_witness ⟨σ, r, entry, le_rfl, forcesEq_refl σ r⟩ + +theorem forcesMem_of_dense {p : P} {σ τ : Name s} + (dense : DenseBelow p {q | ForcesMem q σ τ}) : ForcesMem p σ τ := by + intro q qp + obtain ⟨r, rq, hr⟩ := dense q qp + obtain ⟨t, tr, ht⟩ := hr r le_rfl + exact ⟨t, tr.trans rq, ht⟩ + +theorem forcesEq_left {p q r : P} {σ τ ρ : Name s} + (eq : ForcesEq p σ τ) (entry : Entry ρ σ r) (qp : q ≤ p) (qr : q ≤ r) : + ForcesMem q ρ τ := by + rw [ForcesEq] at eq + intro t tq + exact eq.1 ρ r entry t (tq.trans qp) (tq.trans qr) + +theorem forcesEq_right {p q r : P} {σ τ ρ : Name s} + (eq : ForcesEq p σ τ) (entry : Entry ρ τ r) (qp : q ≤ p) (qr : q ≤ r) : + ForcesMem q ρ σ := forcesEq_left (forcesEq_symm eq) entry qp qr + +theorem forcesEq_iff (p : P) (σ τ : Name s) : ForcesEq p σ τ ↔ + (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → ForcesMem q ρ τ) ∧ + (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → ForcesMem q ν σ) := by + constructor + · intro eq + exact ⟨fun _ _ entry _ qp qr => forcesEq_left eq entry qp qr, + fun _ _ entry _ qp qr => forcesEq_right eq entry qp qr⟩ + · rintro ⟨left, right⟩ + rw [ForcesEq] + constructor + · intro ρ r hr q qp qr + exact left ρ r hr q qp qr q le_rfl + · intro ν k hk q qp qk + obtain ⟨t, tq, ρ, r, hr, tr, eq⟩ := right ν k hk q qp qk q le_rfl + exact ⟨t, tq, ρ, r, hr, tr, forcesEq_symm eq⟩ + +end Name + + + +namespace Name + +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +noncomputable def check (s : Presentation P) (one : P) (x : ZFSet.{u}) : Name s := + assemble (fun y : x => check s one y.val) (fun _ => one) +termination_by ZFSet.rank x +decreasing_by exact ZFSet.rank_lt_of_mem y.property + +theorem entry_check (one : P) (x : ZFSet.{u}) (σ : Name s) (p : P) : + Entry σ (check s one x) p ↔ ∃ y ∈ x, check s one y = σ ∧ one = p := by + rw [check, entry_assemble] + constructor + · rintro ⟨y, eq, hp⟩ + exact ⟨y.val, y.property, eq, hp⟩ + · rintro ⟨y, hy, eq, hp⟩ + exact ⟨⟨y, hy⟩, eq, hp⟩ + +theorem eval_check (H : Set P) (one : P) (hone : one ∈ H) (x : ZFSet.{u}) : + eval H (check s one x) = x := by + induction x using ZFSet.inductionOn with + | h x ih => + rw [check] + apply ZFSet.ext + intro z + rw [mem_eval_assemble] + constructor + · rintro ⟨y, _, eq⟩ + rw [ih y.val y.property] at eq + exact eq ▸ y.property + · intro hz + exact ⟨⟨z, hz⟩, hone, ih z hz⟩ + +theorem check_injective (s : Presentation P) (one : P) : + Function.Injective (check s one) := by + intro x y eq + have h := congrArg (eval (Set.univ : Set P)) eq + simpa only [eval_check Set.univ one (Set.mem_univ one)] using h + +noncomputable def singleton (one : P) (σ : Name s) : Name s := + assemble (fun _ : Unit => σ) (fun _ => one) + +noncomputable def unorderedPair (one : P) (σ τ : Name s) : Name s := + assemble (fun b : Bool => if b then σ else τ) (fun _ => one) + +noncomputable def orderedPair (one : P) (σ τ : Name s) : Name s := + unorderedPair one (singleton one σ) (unorderedPair one σ τ) + +theorem eval_singleton (H : Set P) (one : P) (hone : one ∈ H) (σ : Name s) : + eval H (singleton one σ) = {eval H σ} := by + apply ZFSet.ext + intro x + rw [singleton, mem_eval_assemble, ZFSet.mem_singleton] + constructor + · rintro ⟨_, _, eq⟩ + exact eq.symm + · intro eq + exact ⟨(), hone, eq.symm⟩ + +theorem eval_unorderedPair (H : Set P) (one : P) (hone : one ∈ H) (σ τ : Name s) : + eval H (unorderedPair one σ τ) = {eval H σ, eval H τ} := by + apply ZFSet.ext + intro x + rw [unorderedPair, mem_eval_assemble, ZFSet.mem_pair] + constructor + · rintro ⟨b, _, eq⟩ + cases b with + | false => exact Or.inr eq.symm + | true => exact Or.inl eq.symm + · rintro (eq | eq) + · exact ⟨true, hone, eq.symm⟩ + · exact ⟨false, hone, eq.symm⟩ + +theorem eval_orderedPair (H : Set P) (one : P) (hone : one ∈ H) (σ τ : Name s) : + eval H (orderedPair one σ τ) = ZFSet.pair (eval H σ) (eval H τ) := by + rw [orderedPair, eval_unorderedPair H one hone, + eval_singleton H one hone, eval_unorderedPair H one hone] + rfl + +end Name + + + +namespace Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +structure NameDomain (s : Presentation P) where + names : Set (Name s) + children : ∀ {σ τ : Name s} {p : P}, τ ∈ names → Entry σ τ p → σ ∈ names + +def ForcesNotMem (p : P) (σ τ : Name s) : Prop := + ∀ q, q ≤ p → ¬ ForcesMem q σ τ + +theorem not_forcesMem_refine {p : P} {σ τ : Name s} (bad : ¬ ForcesMem p σ τ) : + ∃ q, q ≤ p ∧ ForcesNotMem q σ τ := by + classical + change ¬ ∀ q, q ≤ p → ∃ r, r ≤ q ∧ r ∈ MemWitness σ τ at bad + push Not at bad + obtain ⟨q, qp, hq⟩ := bad + refine ⟨q, qp, ?_⟩ + intro r rq hr + obtain ⟨t, tr, ht⟩ := hr r le_rfl + exact hq t (tr.trans rq) ht + +def EqDecisionWitness (σ τ : Name s) : Set P := + {p | ForcesEq p σ τ ∨ + (∃ ρ r, Entry ρ σ r ∧ p ≤ r ∧ ForcesNotMem p ρ τ) ∨ + ∃ ν k, Entry ν τ k ∧ p ≤ k ∧ ForcesNotMem p ν σ} + +theorem eqDecisionWitness_dense (σ τ : Name s) : Dense (EqDecisionWitness σ τ) := by + classical + intro p + by_cases eq : ForcesEq p σ τ + · exact ⟨p, le_rfl, Or.inl eq⟩ + · rw [forcesEq_iff] at eq + obtain bad | bad := not_and_or.mp eq + · push Not at bad + obtain ⟨ρ, r, entry, q, qp, qr, nmem⟩ := bad + obtain ⟨t, tq, neg⟩ := not_forcesMem_refine nmem + exact ⟨t, tq.trans qp, Or.inr (Or.inl ⟨ρ, r, entry, tq.trans qr, neg⟩)⟩ + · push Not at bad + obtain ⟨ν, k, entry, q, qp, qk, nmem⟩ := bad + obtain ⟨t, tq, neg⟩ := not_forcesMem_refine nmem + exact ⟨t, tq.trans qp, Or.inr (Or.inr ⟨ν, k, entry, tq.trans qk, neg⟩)⟩ + +def atomicFamily (D : NameDomain s) : Set (Set P) := + {E | (∃ p σ τ, σ ∈ D.names ∧ τ ∈ D.names ∧ E = Localized p (MemWitness σ τ)) ∨ + ∃ σ τ, σ ∈ D.names ∧ τ ∈ D.names ∧ E = EqDecisionWitness σ τ} + +theorem generic_mem_witness (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} + (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) {p : P} (hp : H.mem p) + (h : ForcesMem p σ τ) : H.Meets (MemWitness σ τ) := + H.meets_below generic hp (Or.inl ⟨p, σ, τ, hσ, hτ, rfl⟩) h + +end Name + + + +namespace Name.NameDomain + +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +def values (D : NameDomain s) (H : Set P) : Set ZFSet.{u} := + Set.range (fun τ : D.names => eval H τ.val) + +theorem mem_values (D : NameDomain s) (H : Set P) (x : ZFSet.{u}) : + x ∈ D.values H ↔ ∃ τ ∈ D.names, eval H τ = x := by + constructor + · rintro ⟨τ, eq⟩ + exact ⟨τ.val, τ.property, eq⟩ + · rintro ⟨τ, hτ, eq⟩ + exact ⟨⟨τ, hτ⟩, eq⟩ + +theorem values_transitive (D : NameDomain s) (H : Set P) + {x y : ZFSet.{u}} (hx : x ∈ D.values H) (hy : y ∈ x) : y ∈ D.values H := by + obtain ⟨τ, hτ, rfl⟩ := (D.mem_values H x).1 hx + obtain ⟨σ, p, entry, _, eq⟩ := (mem_eval H τ y).1 hy + exact (D.mem_values H y).2 ⟨σ, D.children hτ entry, eq⟩ + +theorem values_extensionality (D : NameDomain s) (H : Set P) + {x y : ZFSet.{u}} (hx : x ∈ D.values H) (hy : y ∈ D.values H) + (agree : ∀ z ∈ D.values H, z ∈ x ↔ z ∈ y) : x = y := by + apply ZFSet.ext + intro z + constructor + · intro hz + exact (agree z (D.values_transitive H hx hz)).1 hz + · intro hz + exact (agree z (D.values_transitive H hy hz)).2 hz + +theorem values_foundation (D : NameDomain s) (H : Set P) + {x : ZFSet.{u}} (hx : x ∈ D.values H) (nonempty : x ≠ ∅) : + ∃ y ∈ D.values H, y ∈ x ∧ x ∩ y = ∅ := by + obtain ⟨y, yx, disjoint⟩ := ZFSet.regularity x nonempty + exact ⟨y, D.values_transitive H hx yx, yx, disjoint⟩ + +end Name.NameDomain + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalAction.lean index 9cf3c00ffcf3519975e259ff3a1323a1c477ddc7..a37114f1a792d37eafb3293eaee103d60a298b67 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalAction.lean @@ -1,81 +1,81 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalTranslation - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -open Attachment CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -theorem translate_one (z : f.Node a) : f.translate a 1 z = z := by - rcases f.copy_cover a z with ⟨w, x, rfl⟩ - rw [f.translate_copy, one_mul] - -theorem translate_mul (g h : External J f.Letters) (z : f.Node a) : - f.translate a (g * h) z = f.translate a g (f.translate a h z) := by - rcases f.copy_cover a z with ⟨w, x, rfl⟩ - rw [f.translate_copy, f.translate_copy, f.translate_copy, mul_assoc] - -theorem translate_left_inverse (g : External J f.Letters) (z : f.Node a) : - f.translate a g⁻¹ (f.translate a g z) = z := by - rw [← f.translate_mul, inv_mul_cancel, f.translate_one] - -theorem translate_right_inverse (g : External J f.Letters) (z : f.Node a) : - f.translate a g (f.translate a g⁻¹ z) = z := by - rw [← f.translate_mul, mul_inv_cancel, f.translate_one] - -theorem translate_monotone (g : External J f.Letters) (x y : f.Node a) - (h : (f.gluedOrder a).le x y) : - (f.gluedOrder a).le (f.translate a g x) (f.translate a g y) := by - rcases f.comparison_in_copy a x y h with ⟨w, b, c, rfl, rfl, hbc⟩ - rw [f.translate_copy, f.translate_copy] - exact ((f.copy a (g * w)).le_iff b c).mpr hbc - -theorem translate_le_iff (g : External J f.Letters) (x y : f.Node a) : - (f.gluedOrder a).le (f.translate a g x) (f.translate a g y) ↔ (f.gluedOrder a).le x y := by - constructor - · intro h - have back := f.translate_monotone a g⁻¹ _ _ h - rw [f.translate_left_inverse, f.translate_left_inverse] at back - exact back - · exact f.translate_monotone a g x y - -noncomputable def externalIso (g : External J f.Letters) : MeetIso (f.gluedOrder a) (f.gluedOrder a) := - isoOfOrder (f.translate a g) (f.translate a g⁻¹) - (f.translate_left_inverse a g) (f.translate_right_inverse a g) (f.translate_le_iff a g) - -noncomputable def externalAction : OrderAction (External J f.Letters) (f.gluedOrder a) where - iso := f.externalIso a - one := f.translate_one a - mul := f.translate_mul a - -theorem externalAction_copy (g w : External J f.Letters) (x : A) : - ((f.externalAction a).iso g).toFun ((f.copy a w).toFun x) = - (f.copy a (g * w)).toFun x := f.translate_copy a g w x - -theorem externalAction_meet (g : External J f.Letters) (x y : f.Node a) : - ((f.externalAction a).iso g).toFun ((f.gluedOrder a).meet x y) = - (f.gluedOrder a).meet (((f.externalAction a).iso g).toFun x) - (((f.externalAction a).iso g).toFun y) := - ((f.externalAction a).iso g).map_meet x y - -theorem extends_old_action (j : J) (x : A) : - ((f.externalAction a).iso (old J f.Letters j)).toFun ((f.copy a 1).toFun x) = - (f.copy a 1).toFun ((a.iso j).toFun x) := by - rw [f.externalAction_copy, mul_one] - simpa only [one_mul] using f.copy_coordinate a 1 j x - -theorem generator_on_root (s : f.Letters) (x : A) : - ((f.externalAction a).iso (generator J f.Letters s)).toFun ((f.copy a 1).toFun x) = - (f.copy a (generator J f.Letters s)).toFun x := by - rw [f.externalAction_copy, mul_one] - -end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalTranslation + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +open Attachment CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +theorem translate_one (z : f.Node a) : f.translate a 1 z = z := by + rcases f.copy_cover a z with ⟨w, x, rfl⟩ + rw [f.translate_copy, one_mul] + +theorem translate_mul (g h : External J f.Letters) (z : f.Node a) : + f.translate a (g * h) z = f.translate a g (f.translate a h z) := by + rcases f.copy_cover a z with ⟨w, x, rfl⟩ + rw [f.translate_copy, f.translate_copy, f.translate_copy, mul_assoc] + +theorem translate_left_inverse (g : External J f.Letters) (z : f.Node a) : + f.translate a g⁻¹ (f.translate a g z) = z := by + rw [← f.translate_mul, inv_mul_cancel, f.translate_one] + +theorem translate_right_inverse (g : External J f.Letters) (z : f.Node a) : + f.translate a g (f.translate a g⁻¹ z) = z := by + rw [← f.translate_mul, mul_inv_cancel, f.translate_one] + +theorem translate_monotone (g : External J f.Letters) (x y : f.Node a) + (h : (f.gluedOrder a).le x y) : + (f.gluedOrder a).le (f.translate a g x) (f.translate a g y) := by + rcases f.comparison_in_copy a x y h with ⟨w, b, c, rfl, rfl, hbc⟩ + rw [f.translate_copy, f.translate_copy] + exact ((f.copy a (g * w)).le_iff b c).mpr hbc + +theorem translate_le_iff (g : External J f.Letters) (x y : f.Node a) : + (f.gluedOrder a).le (f.translate a g x) (f.translate a g y) ↔ (f.gluedOrder a).le x y := by + constructor + · intro h + have back := f.translate_monotone a g⁻¹ _ _ h + rw [f.translate_left_inverse, f.translate_left_inverse] at back + exact back + · exact f.translate_monotone a g x y + +noncomputable def externalIso (g : External J f.Letters) : MeetIso (f.gluedOrder a) (f.gluedOrder a) := + isoOfOrder (f.translate a g) (f.translate a g⁻¹) + (f.translate_left_inverse a g) (f.translate_right_inverse a g) (f.translate_le_iff a g) + +noncomputable def externalAction : OrderAction (External J f.Letters) (f.gluedOrder a) where + iso := f.externalIso a + one := f.translate_one a + mul := f.translate_mul a + +theorem externalAction_copy (g w : External J f.Letters) (x : A) : + ((f.externalAction a).iso g).toFun ((f.copy a w).toFun x) = + (f.copy a (g * w)).toFun x := f.translate_copy a g w x + +theorem externalAction_meet (g : External J f.Letters) (x y : f.Node a) : + ((f.externalAction a).iso g).toFun ((f.gluedOrder a).meet x y) = + (f.gluedOrder a).meet (((f.externalAction a).iso g).toFun x) + (((f.externalAction a).iso g).toFun y) := + ((f.externalAction a).iso g).map_meet x y + +theorem extends_old_action (j : J) (x : A) : + ((f.externalAction a).iso (old J f.Letters j)).toFun ((f.copy a 1).toFun x) = + (f.copy a 1).toFun ((a.iso j).toFun x) := by + rw [f.externalAction_copy, mul_one] + simpa only [one_mul] using f.copy_coordinate a 1 j x + +theorem generator_on_root (s : f.Letters) (x : A) : + ((f.externalAction a).iso (generator J f.Letters s)).toFun ((f.copy a 1).toFun x) = + (f.copy a (generator J f.Letters s)).toFun x := by + rw [f.externalAction_copy, mul_one] + +end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalFilterBases.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalFilterBases.lean index f9a3e048c361b4afda3290cb85e7d3c3e936b70d..1a16158c9e2444f5481f6d4d2429254072a90ee5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalFilterBases.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalFilterBases.lean @@ -1,133 +1,133 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.CoinitialityPreservation - -namespace OAI - - -namespace PartitionPilot - -section - -open Compression.RecursiveMaps Compression.RecursiveMaps.Chronological -universe u - -namespace Attachment.Templates -variable {O I : Type u} {P : MeetOrder O} (b : Attachment.Templates.{u,u,u} P I) - -theorem all_filters_countable (oldSmall : AllFiltersCountable P) - (templateSmall : ∀ i, AllFiltersCountable (b.order i)) : AllFiltersCountable b.extension := by - apply all_filters_of_separated_sum b.extension b.oldEmbedding (fun _ => rfl) - b.Space b.order b.templateEmbedding Sigma.fst - (fun x => ⟨x.2.val, b.represent_new x.1 x.2.val x.2.property⟩) - _ oldSmall templateSmall - intro x y different - exact attachment_bridge b twoLayerBirth ⟨1⟩ (fun _ => Nat.zero_lt_one) x y different - -end Attachment.Templates - -namespace Compression.RecursiveMaps.TaskSystem -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -theorem stage_all_filters_countable (small : AllFiltersCountable P) (n : Nat) : - AllFiltersCountable (f.order n) := by - induction n with - | zero => exact small - | succ n ih => - apply (f.stages n).batch.all_filters_countable ih - intro i - exact all_filters_of_surjective (inverseIso (f.templateOriginal n i)).toMeetEmbedding - (fun x => ⟨(f.templateOriginal n i).toFun x, (f.templateOriginal n i).left_inverse x⟩) small - -theorem union_all_filters_countable (small : AllFiltersCountable P) : - AllFiltersCountable f.unionOrder := - all_filters_of_countable_cover f.Point f.order f.inclusionEmbedding f.union_cover - (f.stage_all_filters_countable small) - -end Compression.RecursiveMaps.TaskSystem - -end - - - -namespace Compression.RecursiveMaps - -open Chronological -universe u - -namespace PrincipalBatch.Family -variable {A I : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) - -theorem all_filters_countable (oldSmall : AllFiltersCountable P) - (tileSmall : ∀ i, AllFiltersCountable (b.order i)) : AllFiltersCountable b.extension := by - apply all_filters_of_separated_sum b.extension b.old.toMeetEmbedding (fun _ => rfl) - b.Space b.order (fun i => (b.tile i).toMeetEmbedding) Sigma.fst _ _ oldSmall tileSmall - · intro x - exact ⟨x.2.val, congrArg (b.componentMap x.1) - ((b.glue x.1).represent_new x.2.val x.2.property)⟩ - · intro x y different - apply Or.inl - rw [b.different_fresh_meet x y different] - exact Nat.zero_lt_one - -end PrincipalBatch.Family - -namespace RootedGluing.Scheme -variable {V : Type u} (d : RootedGluing.Scheme V) - -theorem stages_all_filters_countable (small : ∀ v, AllFiltersCountable (d.order v)) (n : Nat) : - AllFiltersCountable (d.stages n).order := by - induction n with - | zero => exact small d.root - | succ n ih => exact (d.stages n).batch.all_filters_countable ih (fun v => small v.val) - -theorem glued_all_filters_countable (small : ∀ v, AllFiltersCountable (d.order v)) : - AllFiltersCountable d.gluedOrder := - all_filters_of_countable_cover d.chain.Point d.chain.order - (fun n => (d.chain.inclusion n).toMeetEmbedding) d.chain.cover (d.stages_all_filters_countable small) - -end RootedGluing.Scheme - -end Compression.RecursiveMaps - - - -namespace Compression.RecursiveMaps.TileRequests - -open Chronological CosetGeometry -universe u - -namespace Tile -variable {A Child : Type u} [Countable Child] {P : MeetOrder A} (tile : Tile P Child) - -theorem all_filters_countable (small : AllFiltersCountable P) : AllFiltersCountable tile.order := - all_filters_of_countable_cover (fun _ : Option Child => A) (fun _ => P) - (fun i => (tile.vertex i).toMeetEmbedding) tile.vertex_cover (fun _ => small) - -end Tile - -namespace Family -variable {A J R : Type u} [Group J] {P : MeetOrder A} (f : Family P R) - -theorem tile_all_filters_countable (small : AllFiltersCountable P) (r : R) : - AllFiltersCountable (f.tile r).order := (f.tile r).all_filters_countable small - -theorem local_all_filters_countable (small : AllFiltersCountable P) - (v : TileStars.Vertex J f.Letters R) : AllFiltersCountable (f.localOrder v) := by - cases v with - | inl _ => exact small - | inr c => exact f.tile_all_filters_countable small c.2 - -theorem glued_all_filters_countable (a : OrderAction J P) (small : AllFiltersCountable P) : - AllFiltersCountable (f.gluedOrder a) := - (f.diagram a).scheme.glued_all_filters_countable (f.local_all_filters_countable small) - -theorem extension_all_filters_countable (a : OrderAction J P) (small : AllFiltersCountable P) : - AllFiltersCountable (f.extensionOrder a) := - FixedTop.all_filters_countable _ (f.glued_all_filters_countable a small) - -end Family - -end Compression.RecursiveMaps.TileRequests - -end PartitionPilot - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.CoinitialityPreservation + +namespace OAI + + +namespace PartitionPilot + +section + +open Compression.RecursiveMaps Compression.RecursiveMaps.Chronological +universe u + +namespace Attachment.Templates +variable {O I : Type u} {P : MeetOrder O} (b : Attachment.Templates.{u,u,u} P I) + +theorem all_filters_countable (oldSmall : AllFiltersCountable P) + (templateSmall : ∀ i, AllFiltersCountable (b.order i)) : AllFiltersCountable b.extension := by + apply all_filters_of_separated_sum b.extension b.oldEmbedding (fun _ => rfl) + b.Space b.order b.templateEmbedding Sigma.fst + (fun x => ⟨x.2.val, b.represent_new x.1 x.2.val x.2.property⟩) + _ oldSmall templateSmall + intro x y different + exact attachment_bridge b twoLayerBirth ⟨1⟩ (fun _ => Nat.zero_lt_one) x y different + +end Attachment.Templates + +namespace Compression.RecursiveMaps.TaskSystem +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +theorem stage_all_filters_countable (small : AllFiltersCountable P) (n : Nat) : + AllFiltersCountable (f.order n) := by + induction n with + | zero => exact small + | succ n ih => + apply (f.stages n).batch.all_filters_countable ih + intro i + exact all_filters_of_surjective (inverseIso (f.templateOriginal n i)).toMeetEmbedding + (fun x => ⟨(f.templateOriginal n i).toFun x, (f.templateOriginal n i).left_inverse x⟩) small + +theorem union_all_filters_countable (small : AllFiltersCountable P) : + AllFiltersCountable f.unionOrder := + all_filters_of_countable_cover f.Point f.order f.inclusionEmbedding f.union_cover + (f.stage_all_filters_countable small) + +end Compression.RecursiveMaps.TaskSystem + +end + + + +namespace Compression.RecursiveMaps + +open Chronological +universe u + +namespace PrincipalBatch.Family +variable {A I : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) + +theorem all_filters_countable (oldSmall : AllFiltersCountable P) + (tileSmall : ∀ i, AllFiltersCountable (b.order i)) : AllFiltersCountable b.extension := by + apply all_filters_of_separated_sum b.extension b.old.toMeetEmbedding (fun _ => rfl) + b.Space b.order (fun i => (b.tile i).toMeetEmbedding) Sigma.fst _ _ oldSmall tileSmall + · intro x + exact ⟨x.2.val, congrArg (b.componentMap x.1) + ((b.glue x.1).represent_new x.2.val x.2.property)⟩ + · intro x y different + apply Or.inl + rw [b.different_fresh_meet x y different] + exact Nat.zero_lt_one + +end PrincipalBatch.Family + +namespace RootedGluing.Scheme +variable {V : Type u} (d : RootedGluing.Scheme V) + +theorem stages_all_filters_countable (small : ∀ v, AllFiltersCountable (d.order v)) (n : Nat) : + AllFiltersCountable (d.stages n).order := by + induction n with + | zero => exact small d.root + | succ n ih => exact (d.stages n).batch.all_filters_countable ih (fun v => small v.val) + +theorem glued_all_filters_countable (small : ∀ v, AllFiltersCountable (d.order v)) : + AllFiltersCountable d.gluedOrder := + all_filters_of_countable_cover d.chain.Point d.chain.order + (fun n => (d.chain.inclusion n).toMeetEmbedding) d.chain.cover (d.stages_all_filters_countable small) + +end RootedGluing.Scheme + +end Compression.RecursiveMaps + + + +namespace Compression.RecursiveMaps.TileRequests + +open Chronological CosetGeometry +universe u + +namespace Tile +variable {A Child : Type u} [Countable Child] {P : MeetOrder A} (tile : Tile P Child) + +theorem all_filters_countable (small : AllFiltersCountable P) : AllFiltersCountable tile.order := + all_filters_of_countable_cover (fun _ : Option Child => A) (fun _ => P) + (fun i => (tile.vertex i).toMeetEmbedding) tile.vertex_cover (fun _ => small) + +end Tile + +namespace Family +variable {A J R : Type u} [Group J] {P : MeetOrder A} (f : Family P R) + +theorem tile_all_filters_countable (small : AllFiltersCountable P) (r : R) : + AllFiltersCountable (f.tile r).order := (f.tile r).all_filters_countable small + +theorem local_all_filters_countable (small : AllFiltersCountable P) + (v : TileStars.Vertex J f.Letters R) : AllFiltersCountable (f.localOrder v) := by + cases v with + | inl _ => exact small + | inr c => exact f.tile_all_filters_countable small c.2 + +theorem glued_all_filters_countable (a : OrderAction J P) (small : AllFiltersCountable P) : + AllFiltersCountable (f.gluedOrder a) := + (f.diagram a).scheme.glued_all_filters_countable (f.local_all_filters_countable small) + +theorem extension_all_filters_countable (a : OrderAction J P) (small : AllFiltersCountable P) : + AllFiltersCountable (f.extensionOrder a) := + FixedTop.all_filters_countable _ (f.glued_all_filters_countable a small) + +end Family + +end Compression.RecursiveMaps.TileRequests + +end PartitionPilot + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalWordInverseEvaluation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalWordInverseEvaluation.lean index f5d719bcfa1f539cfa48e6fe6a13f98801dc7bdc..dcd5193e916634fdae8baadaf0a10c8219fe1564 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalWordInverseEvaluation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ExternalWordInverseEvaluation.lean @@ -1,41 +1,41 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundExternalWordQuotient - -namespace OAI - -section - -namespace PartitionPilot.Forcing.ExternalWordRewrite -open Compression.RecursiveMaps.CosetGeometry -universe u -variable (J S : Type u) [Group J] - -theorem symbolValue_inverse (a : Alphabet J S) : - symbolValue J S (externalSymbolInverse a) = (symbolValue J S a)⁻¹ := by - cases a with - | inl g => exact map_inv (old J S) g - | inr p => - change free J S (FreeGroup.mk [(p.1, !p.2)]) = (free J S (FreeGroup.mk [p]))⁻¹ - rw [← map_inv, FreeGroup.inv_mk] - rfl - -theorem evalWord_inverse (xs : List (Alphabet J S)) : - evalWord J S ((xs.map externalSymbolInverse).reverse) = (evalWord J S xs)⁻¹ := by - induction xs with - | nil => exact (inv_one : (1 : External J S)⁻¹ = 1).symm - | cons a xs ih => - rw [List.map_cons, List.reverse_cons] - have append (v w : List (Alphabet J S)) : - evalWord J S (v ++ w) = evalWord J S v * evalWord J S w := - (evalWord J S).map_mul v w - rw [append, ih] - have singleton : evalWord J S [externalSymbolInverse a] = (symbolValue J S a)⁻¹ := by - exact symbolValue_inverse J S a - have cons : evalWord J S (a :: xs) = symbolValue J S a * evalWord J S xs := by - exact (evalWord J S).map_mul (FreeMonoid.of a) (FreeMonoid.ofList xs) - rw [singleton, cons, mul_inv_rev] - -end PartitionPilot.Forcing.ExternalWordRewrite - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundExternalWordQuotient + +namespace OAI + +section + +namespace PartitionPilot.Forcing.ExternalWordRewrite +open Compression.RecursiveMaps.CosetGeometry +universe u +variable (J S : Type u) [Group J] + +theorem symbolValue_inverse (a : Alphabet J S) : + symbolValue J S (externalSymbolInverse a) = (symbolValue J S a)⁻¹ := by + cases a with + | inl g => exact map_inv (old J S) g + | inr p => + change free J S (FreeGroup.mk [(p.1, !p.2)]) = (free J S (FreeGroup.mk [p]))⁻¹ + rw [← map_inv, FreeGroup.inv_mk] + rfl + +theorem evalWord_inverse (xs : List (Alphabet J S)) : + evalWord J S ((xs.map externalSymbolInverse).reverse) = (evalWord J S xs)⁻¹ := by + induction xs with + | nil => exact (inv_one : (1 : External J S)⁻¹ = 1).symm + | cons a xs ih => + rw [List.map_cons, List.reverse_cons] + have append (v w : List (Alphabet J S)) : + evalWord J S (v ++ w) = evalWord J S v * evalWord J S w := + (evalWord J S).map_mul v w + rw [append, ih] + have singleton : evalWord J S [externalSymbolInverse a] = (symbolValue J S a)⁻¹ := by + exact symbolValue_inverse J S a + have cons : evalWord J S (a :: xs) = symbolValue J S a * evalWord J S xs := by + exact (evalWord J S).map_mul (FreeMonoid.of a) (FreeMonoid.ofList xs) + rw [singleton, cons, mul_inv_rev] + +end PartitionPilot.Forcing.ExternalWordRewrite + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinalFilterLocalization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinalFilterLocalization.lean index d38612e775d3830ea47e9ee80066191908e004f2..d1aadfd40ee465332665ab670fcaaa00018fdd2c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinalFilterLocalization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinalFilterLocalization.lean @@ -1,63 +1,63 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainStageFilterBases - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open Chronological CountableColumns -variable (Label : Type 1) - -theorem countable_points_in_stage (B : Set (FinalPoint Label)) (small : B.Countable) : - ∃ a, ∀ x ∈ B, ∃ y, (finalInclusion Label a).toFun y = x := by - classical - let := small.to_subtype - let index (x : B) : Column := Classical.choose (final_point_cover Label x.val) - have represented (x : B) : ∃ y, (finalInclusion Label (index x)).toFun y = x.val := - Classical.choose_spec (final_point_cover Label x.val) - refine ⟨upperBound index, ?_⟩ - intro x hx - rcases represented ⟨x, hx⟩ with ⟨y, eq⟩ - have h : index ⟨x, hx⟩ < upperBound index := upperBound_above index ⟨x, hx⟩ - exact ⟨(transition Label h.le).points.toFun y, (final_points_coherent Label h.le y).trans eq⟩ - -def LocalizedFilter (F : MeetFilter (finalOrder Label)) : Prop := - ∃ a, ∀ x, F.mem x → ∃ y : (stage Label a).Point, - F.mem ((finalInclusion Label a).toFun y) ∧ - (finalOrder Label).le ((finalInclusion Label a).toFun y) x - -theorem basis_localized (F : MeetFilter (finalOrder Label)) (basis : CountableBasis F) : - LocalizedFilter Label F := by - rcases basis with ⟨B, small, positive, below⟩ - rcases countable_points_in_stage Label B small with ⟨a, covered⟩ - refine ⟨a, ?_⟩ - intro x hx - rcases below x hx with ⟨y, hy, lower⟩ - rcases covered y hy with ⟨z, eq⟩ - exact ⟨z, eq.symm ▸ positive y hy, eq.symm ▸ lower⟩ - -theorem localized_basis (F : MeetFilter (finalOrder Label)) (localized : LocalizedFilter Label F) : - CountableBasis F := by - rcases localized with ⟨a, localize⟩ - rcases countableBelow_copy (finalInclusion Label a) F - (stage_all_filters_countable Label a) with ⟨B, small, positive, below⟩ - refine ⟨B, small, positive, ?_⟩ - intro x hx - rcases localize x hx with ⟨y, hy, lower⟩ - rcases below ((finalInclusion Label a).toFun y) ⟨hy, y, rfl⟩ with ⟨z, hz, le⟩ - exact ⟨z, hz, (finalOrder Label).trans le lower⟩ - -theorem countable_basis_iff_localized (F : MeetFilter (finalOrder Label)) : - CountableBasis F ↔ LocalizedFilter Label F := - ⟨basis_localized Label F, localized_basis Label F⟩ - -theorem final_coinitiality_iff_localization : - AllFiltersCountable (finalOrder Label) ↔ ∀ F, LocalizedFilter Label F := - ⟨fun h F => basis_localized Label F (h F), fun h F => localized_basis Label F (h F)⟩ - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainStageFilterBases + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open Chronological CountableColumns +variable (Label : Type 1) + +theorem countable_points_in_stage (B : Set (FinalPoint Label)) (small : B.Countable) : + ∃ a, ∀ x ∈ B, ∃ y, (finalInclusion Label a).toFun y = x := by + classical + let := small.to_subtype + let index (x : B) : Column := Classical.choose (final_point_cover Label x.val) + have represented (x : B) : ∃ y, (finalInclusion Label (index x)).toFun y = x.val := + Classical.choose_spec (final_point_cover Label x.val) + refine ⟨upperBound index, ?_⟩ + intro x hx + rcases represented ⟨x, hx⟩ with ⟨y, eq⟩ + have h : index ⟨x, hx⟩ < upperBound index := upperBound_above index ⟨x, hx⟩ + exact ⟨(transition Label h.le).points.toFun y, (final_points_coherent Label h.le y).trans eq⟩ + +def LocalizedFilter (F : MeetFilter (finalOrder Label)) : Prop := + ∃ a, ∀ x, F.mem x → ∃ y : (stage Label a).Point, + F.mem ((finalInclusion Label a).toFun y) ∧ + (finalOrder Label).le ((finalInclusion Label a).toFun y) x + +theorem basis_localized (F : MeetFilter (finalOrder Label)) (basis : CountableBasis F) : + LocalizedFilter Label F := by + rcases basis with ⟨B, small, positive, below⟩ + rcases countable_points_in_stage Label B small with ⟨a, covered⟩ + refine ⟨a, ?_⟩ + intro x hx + rcases below x hx with ⟨y, hy, lower⟩ + rcases covered y hy with ⟨z, eq⟩ + exact ⟨z, eq.symm ▸ positive y hy, eq.symm ▸ lower⟩ + +theorem localized_basis (F : MeetFilter (finalOrder Label)) (localized : LocalizedFilter Label F) : + CountableBasis F := by + rcases localized with ⟨a, localize⟩ + rcases countableBelow_copy (finalInclusion Label a) F + (stage_all_filters_countable Label a) with ⟨B, small, positive, below⟩ + refine ⟨B, small, positive, ?_⟩ + intro x hx + rcases localize x hx with ⟨y, hy, lower⟩ + rcases below ((finalInclusion Label a).toFun y) ⟨hy, y, rfl⟩ with ⟨z, hz, le⟩ + exact ⟨z, hz, (finalOrder Label).trans le lower⟩ + +theorem countable_basis_iff_localized (F : MeetFilter (finalOrder Label)) : + CountableBasis F ↔ LocalizedFilter Label F := + ⟨basis_localized Label F, localized_basis Label F⟩ + +theorem final_coinitiality_iff_localization : + AllFiltersCountable (finalOrder Label) ↔ ∀ F, LocalizedFilter Label F := + ⟨fun h F => basis_localized Label F (h F), fun h F => localized_basis Label F (h F)⟩ + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinitePrincipalNameSupports.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinitePrincipalNameSupports.lean index 11981ad3dbabe0d6d08b4c08050ff82dc5fdd067..5328fbd285373bb481c4c8a63057d6c2f7df38dc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinitePrincipalNameSupports.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FinitePrincipalNameSupports.lean @@ -1,494 +1,494 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CrossStageMembershipFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.NameSupportFormulas - -namespace OAI - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u v -variable {P : Type u} {s : Presentation P} - -theorem isName_of_subset {T z : ZFSet.{u}} - (valid : ∀ x ∈ T, IsName s x) (subset : z ⊆ ZFSet.prod T s.carrier) : - IsName s z := by - refine IsName.mk ?_ ?_ - · intro w hw - obtain ⟨x, _, y, hy, equal⟩ := ZFSet.mem_prod.1 (subset hw) - obtain ⟨p, rfl⟩ := (s.mem_carrier y).1 hy - exact ⟨x, p, equal⟩ - · intro x p entry - exact valid x (ZFSet.pair_mem_prod.1 (subset entry)).1 - -def ofSubset {T z : ZFSet.{u}} (valid : ∀ x ∈ T, IsName s x) - (subset : z ⊆ ZFSet.prod T s.carrier) : Name s := - ⟨z, isName_of_subset valid subset⟩ - -theorem ofSubset_code {T z : ZFSet.{u}} (valid : ∀ x ∈ T, IsName s x) - (subset : z ⊆ ZFSet.prod T s.carrier) : (ofSubset valid subset).val = z := rfl - -theorem entry_ofSubset {T z : ZFSet.{u}} (valid : ∀ x ∈ T, IsName s x) - (subset : z ⊆ ZFSet.prod T s.carrier) (σ : Name s) (p : P) : - Entry σ (ofSubset valid subset) p ↔ ZFSet.pair σ.val (s.encode p) ∈ z := Iff.rfl - -theorem entry_term_of_subset {T : ZFSet.{u}} {σ τ : Name s} {p : P} - (subset : τ.val ⊆ ZFSet.prod T s.carrier) (entry : Entry σ τ p) : σ.val ∈ T := - (ZFSet.pair_mem_prod.1 (subset entry)).1 - -theorem act_subset_of_closed {G : Type v} [Group G] [PartialOrder P] - (a : PosetAction G P) {T : ZFSet.{u}} - (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - {τ : Name s} (subset : τ.val ⊆ ZFSet.prod T s.carrier) (g : G) : - (a.act s g τ).val ⊆ ZFSet.prod T s.carrier := by - intro z hz - obtain ⟨ν, p, rfl⟩ := entries_cover (a.act s g τ) hz - change Entry ν (rename s (a.iso g) τ) p at hz - obtain ⟨σ, q, entry, rfl, rfl⟩ := (entry_rename s (a.iso g) τ ν p).1 hz - exact ZFSet.pair_mem_prod.2 - ⟨closed g σ (entry_term_of_subset subset entry), s.encode_mem _⟩ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {Upper Lower : Type u} [PartialOrder Upper] -variable (s : Presentation Upper) (t : Presentation Lower) -variable (inclusion : Lower → Upper) (J : ZFSet.{u}) (tau : Name s) - -noncomputable def crossStageMembershipCode : ZFSet.{u} := - ZFSet.sep (fun z => ∃ sigma : Name t, ∃ p : Lower, - z = ZFSet.pair sigma.val (t.encode p) ∧ - ForcesMem (inclusion p) (rename s inclusion sigma) tau) - (ZFSet.prod J t.carrier) - -theorem crossStageMembershipCode_subset : - crossStageMembershipCode s t inclusion J tau ⊆ ZFSet.prod J t.carrier := - fun _ member => (ZFSet.mem_sep.1 member).1 - -theorem pair_mem_crossStageMembershipCode (sigma : Name t) (p : Lower) : - ZFSet.pair sigma.val (t.encode p) ∈ crossStageMembershipCode s t inclusion J tau ↔ - sigma.val ∈ J ∧ ForcesMem (inclusion p) (rename s inclusion sigma) tau := by - change (_ ∈ ZFSet.sep _ _) ↔ _ - rw [ZFSet.mem_sep] - constructor - · rintro ⟨bound, nu, q, equal, forced⟩ - obtain ⟨names, conditions⟩ := ZFSet.pair_inj.1 equal - have sameName : sigma = nu := Subtype.ext names - have sameCondition : p = q := t.injective conditions - exact ⟨(ZFSet.pair_mem_prod.1 bound).1, sameName.symm ▸ sameCondition.symm ▸ forced⟩ - · rintro ⟨member, forced⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨member, t.encode_mem p⟩, sigma, p, rfl, forced⟩ - -theorem crossStageMembershipCode_isName (valid : ∀ z ∈ J, IsName t z) : - IsName t (crossStageMembershipCode s t inclusion J tau) := - isName_of_subset valid (crossStageMembershipCode_subset s t inclusion J tau) - -noncomputable def crossStageMembershipName (valid : ∀ z ∈ J, IsName t z) - (tau : Name s) : Name t := - ⟨crossStageMembershipCode s t inclusion J tau, - crossStageMembershipCode_isName s t inclusion J tau valid⟩ - -theorem crossStageMembershipName_val (valid : ∀ z ∈ J, IsName t z) : - (crossStageMembershipName s t inclusion J valid tau).val = - crossStageMembershipCode s t inclusion J tau := rfl - -theorem entry_crossStageMembershipName (valid : ∀ z ∈ J, IsName t z) - (sigma : Name t) (p : Lower) : - Entry sigma (crossStageMembershipName s t inclusion J valid tau) p ↔ - sigma.val ∈ J ∧ ForcesMem (inclusion p) (rename s inclusion sigma) tau := - pair_mem_crossStageMembershipCode s t inclusion J tau sigma p - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.SetFormula -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -theorem forces_nonempty_iff_dense_activeTerms (D : Name.NameDomain s) - (U : D.names) (T : ZFSet.{u}) - (shape : U.val.val ⊆ ZFSet.prod T s.carrier) (p : P) : - Forces D (ex (.mem 0 1)) ![U] p ↔ - DenseBelow p {q | ∃ u : D.names, u.val.val ∈ T ∧ Name.ForcesMem q u.val U.val} := by - rw [forces_ex_iff] - constructor - · intro dense r below - obtain ⟨q, qr, z, member⟩ := dense r below - change Name.ForcesMem q z.val U.val at member - obtain ⟨v, vq, w, k, entry, vk, equal⟩ := member q le_rfl - refine ⟨v, vq.trans qr, ⟨w, D.children U.property entry⟩, - Name.entry_term_of_subset shape entry, ?_⟩ - exact Name.forcesMem_mono (Name.forcesMem_entry entry) vk - · intro dense r below - obtain ⟨q, qr, u, term, member⟩ := dense r below - exact ⟨q, qr, u, member⟩ - -end PartitionPilot.Forcing.SetFormula - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {Upper Lower : Type u} [PartialOrder Upper] -variable (s : Presentation Upper) (t : Presentation Lower) (inclusion : Lower → Upper) -variable (unchanged : ∀ p, s.encode (inclusion p) = t.encode p) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (upperGround : s.carrier ∈ M.sets) (upperOrderGround : s.conditionOrder ∈ M.sets) -variable (lowerGround : t.carrier ∈ M.sets) -variable {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ u ∈ J, IsName t u) -variable (tau : Name s) (hTau : tau.val ∈ M.sets) -include unchanged pairing unions powers separation collection upperGround upperOrderGround lowerGround hJ valid hTau - -theorem crossStageMembershipCode_eq_selection : - Name.crossStageMembershipCode s t inclusion J tau = - ZFSet.sep (fun z => Realize M.sets (crossStageMembershipEntryFormula 0 1 2 3 4 5) - (extend z ![J, t.carrier, s.carrier, s.conditionOrder, tau.val])) (ZFSet.prod J t.carrier) := by - have productGround := M.prod_mem pairing unions powers separation hJ lowerGround - have recognize (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets (crossStageMembershipEntryFormula 0 1 2 3 4 5) - (extend z ![J, t.carrier, s.carrier, s.conditionOrder, tau.val]) ↔ - z ∈ Name.crossStageMembershipCode s t inclusion J tau := by - rw [M.realize_crossStageMembershipEntryFormula s t inclusion unchanged - pairing unions powers separation collection upperGround upperOrderGround lowerGround hJ valid tau hTau - 0 1 2 3 4 5 _ hz rfl rfl rfl rfl rfl] - constructor - · rintro ⟨sigma, member, p, rfl, forced⟩ - exact (Name.pair_mem_crossStageMembershipCode s t inclusion J tau sigma p).2 ⟨member, forced⟩ - · intro member - obtain ⟨bound, sigma, p, rfl, forced⟩ := ZFSet.mem_sep.1 member - exact ⟨sigma, (ZFSet.pair_mem_prod.1 bound).1, p, rfl, forced⟩ - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · intro member - have bound := Name.crossStageMembershipCode_subset s t inclusion J tau member - exact ⟨bound, (recognize z (M.transitive productGround bound)).2 member⟩ - · rintro ⟨bound, formula⟩ - exact (recognize z (M.transitive productGround bound)).1 formula - -theorem crossStageMembershipCode_mem : - Name.crossStageMembershipCode s t inclusion J tau ∈ M.sets := by - rw [M.crossStageMembershipCode_eq_selection s t inclusion unchanged pairing unions powers - separation collection upperGround upperOrderGround lowerGround hJ valid tau hTau] - exact M.separation_mem separation (crossStageMembershipEntryFormula 0 1 2 3 4 5) - ![J, t.carrier, s.carrier, s.conditionOrder, tau.val] - (Fin.cases hJ (Fin.cases lowerGround (Fin.cases upperGround - (Fin.cases upperOrderGround (Fin.cases hTau (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hJ lowerGround) - -theorem crossStageMembershipName_mem : - (Name.crossStageMembershipName s t inclusion J valid tau).val ∈ M.sets := - M.crossStageMembershipCode_mem s t inclusion unchanged pairing unions powers separation collection - upperGround upperOrderGround lowerGround hJ valid tau hTau - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.PosetAction - -open Compression.RecursiveMaps Compression.RecursiveMaps.CosetGeometry.OrderAction -universe u -variable {G I : Type u} [Group G] [PartialOrder I] (a : PosetAction G I) - -theorem point_inv_left (g : G) (x : I) : a.iso g⁻¹ (a.iso g x) = x := by - rw [← a.mul, inv_mul_cancel, a.one] - -theorem point_inv_right (g : G) (x : I) : a.iso g (a.iso g⁻¹ x) = x := by - rw [← a.mul, mul_inv_cancel, a.one] - -def principalFix (C : I) : Subgroup G where - carrier := {g | ∀ x, x ≤ C → a.iso g x = x} - one_mem' := fun x _ => a.one x - mul_mem' {g h} hg hh x lower := by rw [a.mul, hh x lower, hg x lower] - inv_mem' {g} hg x lower := by - apply (a.iso g).injective - exact (a.point_inv_right g x).trans (hg x lower).symm - -theorem principalFix_antitone {C D : I} (lower : C ≤ D) : a.principalFix D ≤ a.principalFix C := - fun _ fixed x hx => fixed x (le_trans hx lower) - -theorem principalFix_conjugation (g h : G) (C : I) : - conjugateHom g h ∈ a.principalFix (a.iso g C) ↔ h ∈ a.principalFix C := by - constructor - · intro fixed x lower - apply (a.iso g).injective - have eq := fixed (a.iso g x) ((a.iso g).monotone lower) - change a.iso (g * h * g⁻¹) (a.iso g x) = a.iso g x at eq - rw [a.mul, a.mul, a.point_inv_left] at eq - exact eq - · intro fixed x lower - have old : a.iso g⁻¹ x ≤ C := by - have back := (a.iso g⁻¹).monotone lower - simpa only [a.point_inv_left] using back - change a.iso (g * h * g⁻¹) x = x - rw [a.mul, a.mul, fixed _ old, a.point_inv_right] - -def PrincipalSupported (K : Subgroup G) : Prop := ∃ C, a.principalFix C ≤ K - -theorem principalSupported_top (C : I) : a.PrincipalSupported ⊤ := ⟨C, le_top⟩ - -theorem principalSupported_upward {K H : Subgroup G} - (supported : a.PrincipalSupported K) (lower : K ≤ H) : a.PrincipalSupported H := by - obtain ⟨C, hc⟩ := supported - exact ⟨C, le_trans hc lower⟩ - -theorem principalSupported_inf (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) - {K H : Subgroup G} (left : a.PrincipalSupported K) (right : a.PrincipalSupported H) : - a.PrincipalSupported (K ⊓ H) := by - obtain ⟨C, hc⟩ := left - obtain ⟨D, hd⟩ := right - obtain ⟨E, ce, de⟩ := directed C D - exact ⟨E, le_inf (le_trans (a.principalFix_antitone ce) hc) - (le_trans (a.principalFix_antitone de) hd)⟩ - -theorem principalSupported_conjugate (g : G) {K : Subgroup G} (supported : a.PrincipalSupported K) : - a.PrincipalSupported (K.map (conjugateHom g)) := by - obtain ⟨C, hc⟩ := supported - refine ⟨a.iso g C, ?_⟩ - intro h fixed - let k := g⁻¹ * h * g - have eq : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] - have old : k ∈ a.principalFix C := (a.principalFix_conjugation g k C).1 (eq.symm ▸ fixed) - exact Subgroup.mem_map.2 ⟨k, hc old, eq⟩ - -def principalSupportFamily (C : I) (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) : - NormalSubgroupFamily G where - mem := a.PrincipalSupported - top := a.principalSupported_top C - upward := a.principalSupported_upward - inf := a.principalSupported_inf directed - conjugate := a.principalSupported_conjugate - -theorem principalSupportFamily_basis (C : I) (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) - (H : Subgroup G) : (a.principalSupportFamily C directed).mem H ↔ ∃ D, a.principalFix D ≤ H := Iff.rfl - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v - -theorem exists_commonPrincipalNameSupport {G L : Type u} [Group G] [PartialOrder L] - {P : Type v} [PartialOrder P] (a : PosetAction G P) (s : Presentation P) - (d : PosetAction G L) (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - {n : Nat} (tau : Fin n → Name s) - (symmetric : ∀ i, (d.principalSupportFamily base directed).mem (a.stabilizer s (tau i))) : - ∃ C : L, base ≤ C ∧ ∀ i, d.principalFix C ≤ a.stabilizer s (tau i) := by - have allSupported := (d.principalSupportFamily base directed).fin_iInf - (fun i => a.stabilizer s (tau i)) symmetric - obtain ⟨B, bound⟩ := (d.principalSupportFamily_basis base directed _).1 allSupported - obtain ⟨C, hBase, hB⟩ := directed base B - refine ⟨C, hBase, fun i => ?_⟩ - exact (d.principalFix_antitone hB).trans (bound.trans (iInf_le _ i)) - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps Compression.RecursiveMaps.CosetGeometry.OrderAction -universe u v -variable {P : Type u} [PartialOrder P] {G : Type v} [Group G] - -def NiceNameCode (a : PosetAction G P) (s : Presentation P) - (T : ZFSet.{u}) (K : Subgroup G) (z : ZFSet.{u}) : Prop := - ∃ τ : Name s, τ.val = z ∧ τ.val ⊆ ZFSet.prod T s.carrier ∧ K ≤ a.stabilizer s τ - -variable (a : PosetAction G P) (s : Presentation P) - -theorem niceNameCode_iff {T : ZFSet.{u}} {K : Subgroup G} (τ : Name s) : - NiceNameCode a s T K τ.val ↔ - τ.val ⊆ ZFSet.prod T s.carrier ∧ K ≤ a.stabilizer s τ := by - constructor - · rintro ⟨ν, equal, subset, fixed⟩ - have same : ν = τ := Subtype.ext equal - exact same ▸ ⟨subset, fixed⟩ - · rintro ⟨subset, fixed⟩ - exact ⟨τ, rfl, subset, fixed⟩ - -theorem niceNameCode_ofSubset_iff {T z : ZFSet.{u}} {K : Subgroup G} - (valid : ∀ x ∈ T, IsName s x) (subset : z ⊆ ZFSet.prod T s.carrier) : - NiceNameCode a s T K z ↔ - ∀ g ∈ K, a.act s g (Name.ofSubset valid subset) = Name.ofSubset valid subset := by - change NiceNameCode a s T K (Name.ofSubset valid subset).val ↔ _ - rw [niceNameCode_iff] - exact ⟨fun result => result.2, fun fixed => ⟨subset, fixed⟩⟩ - -theorem niceNameCode_isName {T z : ZFSet.{u}} {K : Subgroup G} - (code : NiceNameCode a s T K z) : IsName s z := by - obtain ⟨τ, equal, _, _⟩ := code - exact equal ▸ τ.property - -theorem niceNameCode_subset {T z : ZFSet.{u}} {K : Subgroup G} - (code : NiceNameCode a s T K z) : z ⊆ ZFSet.prod T s.carrier := by - obtain ⟨τ, equal, subset, _⟩ := code - exact equal ▸ subset - -theorem niceNameCode_hs (F : NormalSubgroupFamily G) {T : ZFSet.{u}} {K : Subgroup G} - (member : F.mem K) - (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) - {τ : Name s} (code : NiceNameCode a s T K τ.val) : HereditarilySymmetric a s F τ := by - obtain ⟨subset, fixed⟩ := (niceNameCode_iff a s τ).1 code - exact HereditarilySymmetric.mk (F.upward member fixed) - (fun σ p entry => children σ (Name.entry_term_of_subset subset entry)) - -theorem niceNameCode_conjugate {T : ZFSet.{u}} {K : Subgroup G} - (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - {τ : Name s} (code : NiceNameCode a s T K τ.val) (g : G) : - NiceNameCode a s T (K.map (conjugateHom g)) (a.act s g τ).val := by - obtain ⟨subset, fixed⟩ := (niceNameCode_iff a s τ).1 code - apply (niceNameCode_iff a s _).2 - refine ⟨Name.act_subset_of_closed a closed subset g, ?_⟩ - intro h member - obtain ⟨k, hk, rfl⟩ := Subgroup.mem_map.1 member - change a.act s (g * k * g⁻¹) (a.act s g τ) = a.act s g τ - rw [a.act_mul, a.act_mul, a.act_inv_left, fixed hk] - -theorem niceNameCode_act_iff {T : ZFSet.{u}} {K : Subgroup G} - (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - (g : G) (τ : Name s) : - NiceNameCode a s T (K.map (conjugateHom g)) (a.act s g τ).val ↔ - NiceNameCode a s T K τ.val := by - constructor - · intro code - obtain ⟨subset, fixed⟩ := (niceNameCode_iff a s _).1 code - apply (niceNameCode_iff a s τ).2 - refine ⟨?_, ?_⟩ - · have back := Name.act_subset_of_closed a closed subset g⁻¹ - simpa only [a.act_inv_left] using back - · intro k hk - have image : conjugateHom g k ∈ K.map (conjugateHom g) := - Subgroup.mem_map.2 ⟨k, hk, rfl⟩ - have equal := fixed image - change a.act s (g * k * g⁻¹) (a.act s g τ) = a.act s g τ at equal - rw [a.act_mul, a.act_mul, a.act_inv_left] at equal - exact (a.nameEquiv s g).injective equal - · intro code - exact niceNameCode_conjugate a s closed code g - -variable {L : Type v} [PartialOrder L] - -theorem principalFix_map_conjugate (d : PosetAction G L) (g : G) (v : L) : - (d.principalFix v).map (conjugateHom g) = d.principalFix (d.iso g v) := by - apply Subgroup.ext - intro h - constructor - · intro member - obtain ⟨k, hk, rfl⟩ := Subgroup.mem_map.1 member - exact (d.principalFix_conjugation g k v).2 hk - · intro fixed - let k := g⁻¹ * h * g - have equal : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] - exact Subgroup.mem_map.2 - ⟨k, (d.principalFix_conjugation g k v).1 (equal.symm ▸ fixed), equal⟩ - -theorem niceNameCode_principal_hs (d : PosetAction G L) (base v : L) - (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) {T : ZFSet.{u}} - (children : ∀ σ : Name s, σ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) σ) - {τ : Name s} (code : NiceNameCode a s T (d.principalFix v) τ.val) : - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ := - niceNameCode_hs a s (d.principalSupportFamily base directed) ⟨v, le_refl _⟩ children code - -theorem niceNameCode_principal_act_iff (d : PosetAction G L) {T : ZFSet.{u}} - (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - (g : G) (v : L) (τ : Name s) : - NiceNameCode a s T (d.principalFix (d.iso g v)) (a.act s g τ).val ↔ - NiceNameCode a s T (d.principalFix v) τ.val := by - rw [← principalFix_map_conjugate d g v] - exact niceNameCode_act_iff a s closed g τ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -noncomputable def niceNameCandidates (T : ZFSet.{u}) (K : Subgroup G) : ZFSet.{u} := - ZFSet.sep (NiceNameCode a s T K) (M.groundRelations T s.carrier) - -theorem mem_niceNameCandidates (T : ZFSet.{u}) (K : Subgroup G) (z : ZFSet.{u}) : - z ∈ M.niceNameCandidates a s T K ↔ z ∈ M.sets ∧ NiceNameCode a s T K z := by - rw [niceNameCandidates, ZFSet.mem_sep, M.mem_groundRelations] - constructor - · exact fun h => ⟨h.1.1, h.2⟩ - · rintro ⟨ground, τ, equal, subset, fixed⟩ - exact ⟨⟨ground, equal ▸ subset⟩, τ, equal, subset, fixed⟩ - -theorem name_mem_niceNameCandidates (T : ZFSet.{u}) (K : Subgroup G) (τ : Name s) : - τ.val ∈ M.niceNameCandidates a s T K ↔ - τ.val ∈ M.sets ∧ τ.val ⊆ ZFSet.prod T s.carrier ∧ K ≤ a.stabilizer s τ := by - rw [M.mem_niceNameCandidates] - constructor - · rintro ⟨ground, σ, equal, subset, fixed⟩ - have same : σ = τ := Subtype.ext equal - subst σ - exact ⟨ground, subset, fixed⟩ - · rintro ⟨ground, subset, fixed⟩ - exact ⟨ground, τ, rfl, subset, fixed⟩ - -theorem niceNameCandidates_subset (T : ZFSet.{u}) (K : Subgroup G) : - M.niceNameCandidates a s T K ⊆ M.groundRelations T s.carrier := by - intro z hz - exact (ZFSet.mem_sep.1 hz).1 - -theorem niceNameCandidates_mem {I : Type u} (t : Presentation G) (b : Presentation I) - (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (i : I) (hi : b.encode i ∈ M.sets) : - M.niceNameCandidates a s T (K i) ∈ M.sets := by - let B := M.groundRelations T s.carrier - have hB : B ∈ M.sets := M.groundRelations_mem pairing unions powers separation hT carrier - let params := extend (b.encode i) (extend s.carrier (extend t.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) - have selected := M.separation_mem separation nameSupportFormula params - (Fin.cases hi (Fin.cases carrier (Fin.cases group (Fin.cases supports - (Fin.cases maps (fun j => Fin.elim0 j)))))) hB - have equal : ZFSet.sep (fun z => Realize M.sets nameSupportFormula (extend z params)) B = - M.niceNameCandidates a s T (K i) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, niceNameCandidates, ZFSet.mem_sep] - apply and_congr_right - intro hz - have data := (M.mem_groundRelations T s.carrier z).1 hz - let τ := Name.ofSubset valid data.2 - have fixed := M.realize_nameSupportFormula a s t b K pairing unions powers separation collection - carrier group supports maps i hi τ data.1 - change Realize M.sets nameSupportFormula (extend τ.val params) ↔ NiceNameCode a s T (K i) τ.val - rw [fixed] - constructor - · intro h - exact ⟨τ, rfl, data.2, h⟩ - · rintro ⟨σ, eq, _, h⟩ - have same : σ = τ := Subtype.ext eq - exact same ▸ h - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CrossStageMembershipFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.NameSupportFormulas + +namespace OAI + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u v +variable {P : Type u} {s : Presentation P} + +theorem isName_of_subset {T z : ZFSet.{u}} + (valid : ∀ x ∈ T, IsName s x) (subset : z ⊆ ZFSet.prod T s.carrier) : + IsName s z := by + refine IsName.mk ?_ ?_ + · intro w hw + obtain ⟨x, _, y, hy, equal⟩ := ZFSet.mem_prod.1 (subset hw) + obtain ⟨p, rfl⟩ := (s.mem_carrier y).1 hy + exact ⟨x, p, equal⟩ + · intro x p entry + exact valid x (ZFSet.pair_mem_prod.1 (subset entry)).1 + +def ofSubset {T z : ZFSet.{u}} (valid : ∀ x ∈ T, IsName s x) + (subset : z ⊆ ZFSet.prod T s.carrier) : Name s := + ⟨z, isName_of_subset valid subset⟩ + +theorem ofSubset_code {T z : ZFSet.{u}} (valid : ∀ x ∈ T, IsName s x) + (subset : z ⊆ ZFSet.prod T s.carrier) : (ofSubset valid subset).val = z := rfl + +theorem entry_ofSubset {T z : ZFSet.{u}} (valid : ∀ x ∈ T, IsName s x) + (subset : z ⊆ ZFSet.prod T s.carrier) (σ : Name s) (p : P) : + Entry σ (ofSubset valid subset) p ↔ ZFSet.pair σ.val (s.encode p) ∈ z := Iff.rfl + +theorem entry_term_of_subset {T : ZFSet.{u}} {σ τ : Name s} {p : P} + (subset : τ.val ⊆ ZFSet.prod T s.carrier) (entry : Entry σ τ p) : σ.val ∈ T := + (ZFSet.pair_mem_prod.1 (subset entry)).1 + +theorem act_subset_of_closed {G : Type v} [Group G] [PartialOrder P] + (a : PosetAction G P) {T : ZFSet.{u}} + (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + {τ : Name s} (subset : τ.val ⊆ ZFSet.prod T s.carrier) (g : G) : + (a.act s g τ).val ⊆ ZFSet.prod T s.carrier := by + intro z hz + obtain ⟨ν, p, rfl⟩ := entries_cover (a.act s g τ) hz + change Entry ν (rename s (a.iso g) τ) p at hz + obtain ⟨σ, q, entry, rfl, rfl⟩ := (entry_rename s (a.iso g) τ ν p).1 hz + exact ZFSet.pair_mem_prod.2 + ⟨closed g σ (entry_term_of_subset subset entry), s.encode_mem _⟩ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {Upper Lower : Type u} [PartialOrder Upper] +variable (s : Presentation Upper) (t : Presentation Lower) +variable (inclusion : Lower → Upper) (J : ZFSet.{u}) (tau : Name s) + +noncomputable def crossStageMembershipCode : ZFSet.{u} := + ZFSet.sep (fun z => ∃ sigma : Name t, ∃ p : Lower, + z = ZFSet.pair sigma.val (t.encode p) ∧ + ForcesMem (inclusion p) (rename s inclusion sigma) tau) + (ZFSet.prod J t.carrier) + +theorem crossStageMembershipCode_subset : + crossStageMembershipCode s t inclusion J tau ⊆ ZFSet.prod J t.carrier := + fun _ member => (ZFSet.mem_sep.1 member).1 + +theorem pair_mem_crossStageMembershipCode (sigma : Name t) (p : Lower) : + ZFSet.pair sigma.val (t.encode p) ∈ crossStageMembershipCode s t inclusion J tau ↔ + sigma.val ∈ J ∧ ForcesMem (inclusion p) (rename s inclusion sigma) tau := by + change (_ ∈ ZFSet.sep _ _) ↔ _ + rw [ZFSet.mem_sep] + constructor + · rintro ⟨bound, nu, q, equal, forced⟩ + obtain ⟨names, conditions⟩ := ZFSet.pair_inj.1 equal + have sameName : sigma = nu := Subtype.ext names + have sameCondition : p = q := t.injective conditions + exact ⟨(ZFSet.pair_mem_prod.1 bound).1, sameName.symm ▸ sameCondition.symm ▸ forced⟩ + · rintro ⟨member, forced⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨member, t.encode_mem p⟩, sigma, p, rfl, forced⟩ + +theorem crossStageMembershipCode_isName (valid : ∀ z ∈ J, IsName t z) : + IsName t (crossStageMembershipCode s t inclusion J tau) := + isName_of_subset valid (crossStageMembershipCode_subset s t inclusion J tau) + +noncomputable def crossStageMembershipName (valid : ∀ z ∈ J, IsName t z) + (tau : Name s) : Name t := + ⟨crossStageMembershipCode s t inclusion J tau, + crossStageMembershipCode_isName s t inclusion J tau valid⟩ + +theorem crossStageMembershipName_val (valid : ∀ z ∈ J, IsName t z) : + (crossStageMembershipName s t inclusion J valid tau).val = + crossStageMembershipCode s t inclusion J tau := rfl + +theorem entry_crossStageMembershipName (valid : ∀ z ∈ J, IsName t z) + (sigma : Name t) (p : Lower) : + Entry sigma (crossStageMembershipName s t inclusion J valid tau) p ↔ + sigma.val ∈ J ∧ ForcesMem (inclusion p) (rename s inclusion sigma) tau := + pair_mem_crossStageMembershipCode s t inclusion J tau sigma p + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.SetFormula +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +theorem forces_nonempty_iff_dense_activeTerms (D : Name.NameDomain s) + (U : D.names) (T : ZFSet.{u}) + (shape : U.val.val ⊆ ZFSet.prod T s.carrier) (p : P) : + Forces D (ex (.mem 0 1)) ![U] p ↔ + DenseBelow p {q | ∃ u : D.names, u.val.val ∈ T ∧ Name.ForcesMem q u.val U.val} := by + rw [forces_ex_iff] + constructor + · intro dense r below + obtain ⟨q, qr, z, member⟩ := dense r below + change Name.ForcesMem q z.val U.val at member + obtain ⟨v, vq, w, k, entry, vk, equal⟩ := member q le_rfl + refine ⟨v, vq.trans qr, ⟨w, D.children U.property entry⟩, + Name.entry_term_of_subset shape entry, ?_⟩ + exact Name.forcesMem_mono (Name.forcesMem_entry entry) vk + · intro dense r below + obtain ⟨q, qr, u, term, member⟩ := dense r below + exact ⟨q, qr, u, member⟩ + +end PartitionPilot.Forcing.SetFormula + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {Upper Lower : Type u} [PartialOrder Upper] +variable (s : Presentation Upper) (t : Presentation Lower) (inclusion : Lower → Upper) +variable (unchanged : ∀ p, s.encode (inclusion p) = t.encode p) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (upperGround : s.carrier ∈ M.sets) (upperOrderGround : s.conditionOrder ∈ M.sets) +variable (lowerGround : t.carrier ∈ M.sets) +variable {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ u ∈ J, IsName t u) +variable (tau : Name s) (hTau : tau.val ∈ M.sets) +include unchanged pairing unions powers separation collection upperGround upperOrderGround lowerGround hJ valid hTau + +theorem crossStageMembershipCode_eq_selection : + Name.crossStageMembershipCode s t inclusion J tau = + ZFSet.sep (fun z => Realize M.sets (crossStageMembershipEntryFormula 0 1 2 3 4 5) + (extend z ![J, t.carrier, s.carrier, s.conditionOrder, tau.val])) (ZFSet.prod J t.carrier) := by + have productGround := M.prod_mem pairing unions powers separation hJ lowerGround + have recognize (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets (crossStageMembershipEntryFormula 0 1 2 3 4 5) + (extend z ![J, t.carrier, s.carrier, s.conditionOrder, tau.val]) ↔ + z ∈ Name.crossStageMembershipCode s t inclusion J tau := by + rw [M.realize_crossStageMembershipEntryFormula s t inclusion unchanged + pairing unions powers separation collection upperGround upperOrderGround lowerGround hJ valid tau hTau + 0 1 2 3 4 5 _ hz rfl rfl rfl rfl rfl] + constructor + · rintro ⟨sigma, member, p, rfl, forced⟩ + exact (Name.pair_mem_crossStageMembershipCode s t inclusion J tau sigma p).2 ⟨member, forced⟩ + · intro member + obtain ⟨bound, sigma, p, rfl, forced⟩ := ZFSet.mem_sep.1 member + exact ⟨sigma, (ZFSet.pair_mem_prod.1 bound).1, p, rfl, forced⟩ + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · intro member + have bound := Name.crossStageMembershipCode_subset s t inclusion J tau member + exact ⟨bound, (recognize z (M.transitive productGround bound)).2 member⟩ + · rintro ⟨bound, formula⟩ + exact (recognize z (M.transitive productGround bound)).1 formula + +theorem crossStageMembershipCode_mem : + Name.crossStageMembershipCode s t inclusion J tau ∈ M.sets := by + rw [M.crossStageMembershipCode_eq_selection s t inclusion unchanged pairing unions powers + separation collection upperGround upperOrderGround lowerGround hJ valid tau hTau] + exact M.separation_mem separation (crossStageMembershipEntryFormula 0 1 2 3 4 5) + ![J, t.carrier, s.carrier, s.conditionOrder, tau.val] + (Fin.cases hJ (Fin.cases lowerGround (Fin.cases upperGround + (Fin.cases upperOrderGround (Fin.cases hTau (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hJ lowerGround) + +theorem crossStageMembershipName_mem : + (Name.crossStageMembershipName s t inclusion J valid tau).val ∈ M.sets := + M.crossStageMembershipCode_mem s t inclusion unchanged pairing unions powers separation collection + upperGround upperOrderGround lowerGround hJ valid tau hTau + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.PosetAction + +open Compression.RecursiveMaps Compression.RecursiveMaps.CosetGeometry.OrderAction +universe u +variable {G I : Type u} [Group G] [PartialOrder I] (a : PosetAction G I) + +theorem point_inv_left (g : G) (x : I) : a.iso g⁻¹ (a.iso g x) = x := by + rw [← a.mul, inv_mul_cancel, a.one] + +theorem point_inv_right (g : G) (x : I) : a.iso g (a.iso g⁻¹ x) = x := by + rw [← a.mul, mul_inv_cancel, a.one] + +def principalFix (C : I) : Subgroup G where + carrier := {g | ∀ x, x ≤ C → a.iso g x = x} + one_mem' := fun x _ => a.one x + mul_mem' {g h} hg hh x lower := by rw [a.mul, hh x lower, hg x lower] + inv_mem' {g} hg x lower := by + apply (a.iso g).injective + exact (a.point_inv_right g x).trans (hg x lower).symm + +theorem principalFix_antitone {C D : I} (lower : C ≤ D) : a.principalFix D ≤ a.principalFix C := + fun _ fixed x hx => fixed x (le_trans hx lower) + +theorem principalFix_conjugation (g h : G) (C : I) : + conjugateHom g h ∈ a.principalFix (a.iso g C) ↔ h ∈ a.principalFix C := by + constructor + · intro fixed x lower + apply (a.iso g).injective + have eq := fixed (a.iso g x) ((a.iso g).monotone lower) + change a.iso (g * h * g⁻¹) (a.iso g x) = a.iso g x at eq + rw [a.mul, a.mul, a.point_inv_left] at eq + exact eq + · intro fixed x lower + have old : a.iso g⁻¹ x ≤ C := by + have back := (a.iso g⁻¹).monotone lower + simpa only [a.point_inv_left] using back + change a.iso (g * h * g⁻¹) x = x + rw [a.mul, a.mul, fixed _ old, a.point_inv_right] + +def PrincipalSupported (K : Subgroup G) : Prop := ∃ C, a.principalFix C ≤ K + +theorem principalSupported_top (C : I) : a.PrincipalSupported ⊤ := ⟨C, le_top⟩ + +theorem principalSupported_upward {K H : Subgroup G} + (supported : a.PrincipalSupported K) (lower : K ≤ H) : a.PrincipalSupported H := by + obtain ⟨C, hc⟩ := supported + exact ⟨C, le_trans hc lower⟩ + +theorem principalSupported_inf (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) + {K H : Subgroup G} (left : a.PrincipalSupported K) (right : a.PrincipalSupported H) : + a.PrincipalSupported (K ⊓ H) := by + obtain ⟨C, hc⟩ := left + obtain ⟨D, hd⟩ := right + obtain ⟨E, ce, de⟩ := directed C D + exact ⟨E, le_inf (le_trans (a.principalFix_antitone ce) hc) + (le_trans (a.principalFix_antitone de) hd)⟩ + +theorem principalSupported_conjugate (g : G) {K : Subgroup G} (supported : a.PrincipalSupported K) : + a.PrincipalSupported (K.map (conjugateHom g)) := by + obtain ⟨C, hc⟩ := supported + refine ⟨a.iso g C, ?_⟩ + intro h fixed + let k := g⁻¹ * h * g + have eq : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] + have old : k ∈ a.principalFix C := (a.principalFix_conjugation g k C).1 (eq.symm ▸ fixed) + exact Subgroup.mem_map.2 ⟨k, hc old, eq⟩ + +def principalSupportFamily (C : I) (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) : + NormalSubgroupFamily G where + mem := a.PrincipalSupported + top := a.principalSupported_top C + upward := a.principalSupported_upward + inf := a.principalSupported_inf directed + conjugate := a.principalSupported_conjugate + +theorem principalSupportFamily_basis (C : I) (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) + (H : Subgroup G) : (a.principalSupportFamily C directed).mem H ↔ ∃ D, a.principalFix D ≤ H := Iff.rfl + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v + +theorem exists_commonPrincipalNameSupport {G L : Type u} [Group G] [PartialOrder L] + {P : Type v} [PartialOrder P] (a : PosetAction G P) (s : Presentation P) + (d : PosetAction G L) (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + {n : Nat} (tau : Fin n → Name s) + (symmetric : ∀ i, (d.principalSupportFamily base directed).mem (a.stabilizer s (tau i))) : + ∃ C : L, base ≤ C ∧ ∀ i, d.principalFix C ≤ a.stabilizer s (tau i) := by + have allSupported := (d.principalSupportFamily base directed).fin_iInf + (fun i => a.stabilizer s (tau i)) symmetric + obtain ⟨B, bound⟩ := (d.principalSupportFamily_basis base directed _).1 allSupported + obtain ⟨C, hBase, hB⟩ := directed base B + refine ⟨C, hBase, fun i => ?_⟩ + exact (d.principalFix_antitone hB).trans (bound.trans (iInf_le _ i)) + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps Compression.RecursiveMaps.CosetGeometry.OrderAction +universe u v +variable {P : Type u} [PartialOrder P] {G : Type v} [Group G] + +def NiceNameCode (a : PosetAction G P) (s : Presentation P) + (T : ZFSet.{u}) (K : Subgroup G) (z : ZFSet.{u}) : Prop := + ∃ τ : Name s, τ.val = z ∧ τ.val ⊆ ZFSet.prod T s.carrier ∧ K ≤ a.stabilizer s τ + +variable (a : PosetAction G P) (s : Presentation P) + +theorem niceNameCode_iff {T : ZFSet.{u}} {K : Subgroup G} (τ : Name s) : + NiceNameCode a s T K τ.val ↔ + τ.val ⊆ ZFSet.prod T s.carrier ∧ K ≤ a.stabilizer s τ := by + constructor + · rintro ⟨ν, equal, subset, fixed⟩ + have same : ν = τ := Subtype.ext equal + exact same ▸ ⟨subset, fixed⟩ + · rintro ⟨subset, fixed⟩ + exact ⟨τ, rfl, subset, fixed⟩ + +theorem niceNameCode_ofSubset_iff {T z : ZFSet.{u}} {K : Subgroup G} + (valid : ∀ x ∈ T, IsName s x) (subset : z ⊆ ZFSet.prod T s.carrier) : + NiceNameCode a s T K z ↔ + ∀ g ∈ K, a.act s g (Name.ofSubset valid subset) = Name.ofSubset valid subset := by + change NiceNameCode a s T K (Name.ofSubset valid subset).val ↔ _ + rw [niceNameCode_iff] + exact ⟨fun result => result.2, fun fixed => ⟨subset, fixed⟩⟩ + +theorem niceNameCode_isName {T z : ZFSet.{u}} {K : Subgroup G} + (code : NiceNameCode a s T K z) : IsName s z := by + obtain ⟨τ, equal, _, _⟩ := code + exact equal ▸ τ.property + +theorem niceNameCode_subset {T z : ZFSet.{u}} {K : Subgroup G} + (code : NiceNameCode a s T K z) : z ⊆ ZFSet.prod T s.carrier := by + obtain ⟨τ, equal, subset, _⟩ := code + exact equal ▸ subset + +theorem niceNameCode_hs (F : NormalSubgroupFamily G) {T : ZFSet.{u}} {K : Subgroup G} + (member : F.mem K) + (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) + {τ : Name s} (code : NiceNameCode a s T K τ.val) : HereditarilySymmetric a s F τ := by + obtain ⟨subset, fixed⟩ := (niceNameCode_iff a s τ).1 code + exact HereditarilySymmetric.mk (F.upward member fixed) + (fun σ p entry => children σ (Name.entry_term_of_subset subset entry)) + +theorem niceNameCode_conjugate {T : ZFSet.{u}} {K : Subgroup G} + (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + {τ : Name s} (code : NiceNameCode a s T K τ.val) (g : G) : + NiceNameCode a s T (K.map (conjugateHom g)) (a.act s g τ).val := by + obtain ⟨subset, fixed⟩ := (niceNameCode_iff a s τ).1 code + apply (niceNameCode_iff a s _).2 + refine ⟨Name.act_subset_of_closed a closed subset g, ?_⟩ + intro h member + obtain ⟨k, hk, rfl⟩ := Subgroup.mem_map.1 member + change a.act s (g * k * g⁻¹) (a.act s g τ) = a.act s g τ + rw [a.act_mul, a.act_mul, a.act_inv_left, fixed hk] + +theorem niceNameCode_act_iff {T : ZFSet.{u}} {K : Subgroup G} + (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + (g : G) (τ : Name s) : + NiceNameCode a s T (K.map (conjugateHom g)) (a.act s g τ).val ↔ + NiceNameCode a s T K τ.val := by + constructor + · intro code + obtain ⟨subset, fixed⟩ := (niceNameCode_iff a s _).1 code + apply (niceNameCode_iff a s τ).2 + refine ⟨?_, ?_⟩ + · have back := Name.act_subset_of_closed a closed subset g⁻¹ + simpa only [a.act_inv_left] using back + · intro k hk + have image : conjugateHom g k ∈ K.map (conjugateHom g) := + Subgroup.mem_map.2 ⟨k, hk, rfl⟩ + have equal := fixed image + change a.act s (g * k * g⁻¹) (a.act s g τ) = a.act s g τ at equal + rw [a.act_mul, a.act_mul, a.act_inv_left] at equal + exact (a.nameEquiv s g).injective equal + · intro code + exact niceNameCode_conjugate a s closed code g + +variable {L : Type v} [PartialOrder L] + +theorem principalFix_map_conjugate (d : PosetAction G L) (g : G) (v : L) : + (d.principalFix v).map (conjugateHom g) = d.principalFix (d.iso g v) := by + apply Subgroup.ext + intro h + constructor + · intro member + obtain ⟨k, hk, rfl⟩ := Subgroup.mem_map.1 member + exact (d.principalFix_conjugation g k v).2 hk + · intro fixed + let k := g⁻¹ * h * g + have equal : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] + exact Subgroup.mem_map.2 + ⟨k, (d.principalFix_conjugation g k v).1 (equal.symm ▸ fixed), equal⟩ + +theorem niceNameCode_principal_hs (d : PosetAction G L) (base v : L) + (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) {T : ZFSet.{u}} + (children : ∀ σ : Name s, σ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) σ) + {τ : Name s} (code : NiceNameCode a s T (d.principalFix v) τ.val) : + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ := + niceNameCode_hs a s (d.principalSupportFamily base directed) ⟨v, le_refl _⟩ children code + +theorem niceNameCode_principal_act_iff (d : PosetAction G L) {T : ZFSet.{u}} + (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + (g : G) (v : L) (τ : Name s) : + NiceNameCode a s T (d.principalFix (d.iso g v)) (a.act s g τ).val ↔ + NiceNameCode a s T (d.principalFix v) τ.val := by + rw [← principalFix_map_conjugate d g v] + exact niceNameCode_act_iff a s closed g τ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +noncomputable def niceNameCandidates (T : ZFSet.{u}) (K : Subgroup G) : ZFSet.{u} := + ZFSet.sep (NiceNameCode a s T K) (M.groundRelations T s.carrier) + +theorem mem_niceNameCandidates (T : ZFSet.{u}) (K : Subgroup G) (z : ZFSet.{u}) : + z ∈ M.niceNameCandidates a s T K ↔ z ∈ M.sets ∧ NiceNameCode a s T K z := by + rw [niceNameCandidates, ZFSet.mem_sep, M.mem_groundRelations] + constructor + · exact fun h => ⟨h.1.1, h.2⟩ + · rintro ⟨ground, τ, equal, subset, fixed⟩ + exact ⟨⟨ground, equal ▸ subset⟩, τ, equal, subset, fixed⟩ + +theorem name_mem_niceNameCandidates (T : ZFSet.{u}) (K : Subgroup G) (τ : Name s) : + τ.val ∈ M.niceNameCandidates a s T K ↔ + τ.val ∈ M.sets ∧ τ.val ⊆ ZFSet.prod T s.carrier ∧ K ≤ a.stabilizer s τ := by + rw [M.mem_niceNameCandidates] + constructor + · rintro ⟨ground, σ, equal, subset, fixed⟩ + have same : σ = τ := Subtype.ext equal + subst σ + exact ⟨ground, subset, fixed⟩ + · rintro ⟨ground, subset, fixed⟩ + exact ⟨ground, τ, rfl, subset, fixed⟩ + +theorem niceNameCandidates_subset (T : ZFSet.{u}) (K : Subgroup G) : + M.niceNameCandidates a s T K ⊆ M.groundRelations T s.carrier := by + intro z hz + exact (ZFSet.mem_sep.1 hz).1 + +theorem niceNameCandidates_mem {I : Type u} (t : Presentation G) (b : Presentation I) + (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (i : I) (hi : b.encode i ∈ M.sets) : + M.niceNameCandidates a s T (K i) ∈ M.sets := by + let B := M.groundRelations T s.carrier + have hB : B ∈ M.sets := M.groundRelations_mem pairing unions powers separation hT carrier + let params := extend (b.encode i) (extend s.carrier (extend t.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) + have selected := M.separation_mem separation nameSupportFormula params + (Fin.cases hi (Fin.cases carrier (Fin.cases group (Fin.cases supports + (Fin.cases maps (fun j => Fin.elim0 j)))))) hB + have equal : ZFSet.sep (fun z => Realize M.sets nameSupportFormula (extend z params)) B = + M.niceNameCandidates a s T (K i) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, niceNameCandidates, ZFSet.mem_sep] + apply and_congr_right + intro hz + have data := (M.mem_groundRelations T s.carrier z).1 hz + let τ := Name.ofSubset valid data.2 + have fixed := M.realize_nameSupportFormula a s t b K pairing unions powers separation collection + carrier group supports maps i hi τ data.1 + change Realize M.sets nameSupportFormula (extend τ.val params) ↔ NiceNameCode a s T (K i) τ.val + rw [fixed] + constructor + · intro h + exact ⟨τ, rfl, data.2, h⟩ + · rintro ⟨σ, eq, _, h⟩ + have same : σ = τ := Subtype.ext eq + exact same ▸ h + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTop.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTop.lean index 8dc3e53821489ef69c54ad919cf5a03d368a1f8a..ba3b2ec5b86d7b5002a0b947b3db540c0f2aee91 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTop.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTop.lean @@ -1,155 +1,155 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalRealization - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.FixedTop - -open CosetGeometry -universe u -variable {A J : Type u} (P : MeetOrder A) - -def Le : Option A → Option A → Prop - | _, none => True - | none, some _ => False - | some x, some y => P.le x y - -def meet : Option A → Option A → Option A - | none, y => y - | x, none => x - | some x, some y => some (P.meet x y) - -def order : MeetOrder (Option A) where - le := Le P - meet := meet P - refl x := by - cases x with - | none => trivial - | some x => exact P.refl x - trans {x y z} hxy hyz := by - cases x <;> cases y <;> cases z <;> simp only [Le] at * - exact P.trans hxy hyz - antisymm {x y} hxy hyx := by - cases x <;> cases y <;> simp only [Le] at * - exact congrArg some (P.antisymm hxy hyx) - meet_le_left x y := by - cases x <;> cases y <;> simp only [meet, Le] - · exact P.refl _ - · exact P.meet_le_left _ _ - meet_le_right x y := by - cases x <;> cases y <;> simp only [meet, Le] - · exact P.refl _ - · exact P.meet_le_right _ _ - le_meet {x y z} hxy hxz := by - cases x <;> cases y <;> cases z <;> simp only [meet, Le] at * - all_goals first | exact hxy | exact hxz | exact P.le_meet hxy hxz - -def embedding : IdealEmbedding P (order P) where - toFun := some - le_iff _ _ := Iff.rfl - map_meet _ _ := rfl - ideal x z h := by - cases z with - | none => exact False.elim h - | some z => exact ⟨z, rfl⟩ - -theorem strict_top (x : A) : (order P).le ((embedding P).toFun x) none ∧ - ¬ (order P).le none ((embedding P).toFun x) := ⟨True.intro, id⟩ - -theorem greatest (x : Option A) : (order P).le x none := by - cases x <;> exact True.intro - -theorem no_new_below (x : A) (z : Option A) (h : (order P).le z ((embedding P).toFun x)) : - ∃ y, (embedding P).toFun y = z := (embedding P).ideal x z h - -variable [Group J] (a : OrderAction J P) - -def act (g : J) : Option A → Option A - | none => none - | some x => some ((a.iso g).toFun x) - -def actionIso (g : J) : MeetIso (order P) (order P) where - toFun := act P a g - le_iff x y := by - cases x <;> cases y <;> simp only [act, order, Le] - exact (a.iso g).le_iff _ _ - map_meet x y := by - cases x <;> cases y <;> simp only [act, order, meet] - exact congrArg some ((a.iso g).map_meet _ _) - inverse - | none => none - | some x => some ((a.iso g).inverse x) - left_inverse x := by - cases x with - | none => rfl - | some x => exact congrArg some ((a.iso g).left_inverse x) - right_inverse x := by - cases x with - | none => rfl - | some x => exact congrArg some ((a.iso g).right_inverse x) - -def action : OrderAction J (order P) where - iso := actionIso P a - one x := by - cases x with - | none => rfl - | some x => exact congrArg some (a.one x) - mul g h x := by - cases x with - | none => rfl - | some x => exact congrArg some (a.mul g h x) - -theorem fixes_top (g : J) : ((action P a).iso g).toFun none = none := rfl - -theorem extends_action (g : J) (x : A) : - ((action P a).iso g).toFun ((embedding P).toFun x) = - (embedding P).toFun ((a.iso g).toFun x) := rfl - -end PartitionPilot.Compression.RecursiveMaps.FixedTop - -namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -open CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -def Extension := Option (f.Node a) -noncomputable def extensionOrder : MeetOrder (f.Extension a) := FixedTop.order (f.gluedOrder a) -noncomputable def extensionAction : OrderAction (External J f.Letters) (f.extensionOrder a) := - FixedTop.action (f.gluedOrder a) (f.externalAction a) -noncomputable def extensionCopy (w : External J f.Letters) : IdealEmbedding P (f.extensionOrder a) := - (f.copy a w).comp (FixedTop.embedding (f.gluedOrder a)) - -theorem extension_greatest (x : f.Extension a) : (f.extensionOrder a).le x none := - FixedTop.greatest (f.gluedOrder a) x - -theorem extension_strict_top (w : External J f.Letters) (x : A) : - (f.extensionOrder a).le ((f.extensionCopy a w).toFun x) none ∧ - ¬ (f.extensionOrder a).le none ((f.extensionCopy a w).toFun x) := - FixedTop.strict_top (f.gluedOrder a) ((f.copy a w).toFun x) - -theorem extension_fixes_top (g : External J f.Letters) : - ((f.extensionAction a).iso g).toFun none = none := rfl - -theorem extensionAction_copy (g w : External J f.Letters) (x : A) : - ((f.extensionAction a).iso g).toFun ((f.extensionCopy a w).toFun x) = - (f.extensionCopy a (g * w)).toFun x := - congrArg some (f.externalAction_copy a g w x) - -theorem extension_extends_old (j : J) (x : A) : - ((f.extensionAction a).iso (old J f.Letters j)).toFun ((f.extensionCopy a 1).toFun x) = - (f.extensionCopy a 1).toFun ((a.iso j).toFun x) := - congrArg some (f.extends_old_action a j x) - -theorem extensionCopy_principal (w : External J f.Letters) (z : f.Extension a) : - (f.extensionOrder a).le z ((f.extensionCopy a w).toFun f.top) ↔ - ∃ x, (f.extensionCopy a w).toFun x = z := - (f.extensionCopy a w).principal f.top f.greatest z - -end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalRealization + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.FixedTop + +open CosetGeometry +universe u +variable {A J : Type u} (P : MeetOrder A) + +def Le : Option A → Option A → Prop + | _, none => True + | none, some _ => False + | some x, some y => P.le x y + +def meet : Option A → Option A → Option A + | none, y => y + | x, none => x + | some x, some y => some (P.meet x y) + +def order : MeetOrder (Option A) where + le := Le P + meet := meet P + refl x := by + cases x with + | none => trivial + | some x => exact P.refl x + trans {x y z} hxy hyz := by + cases x <;> cases y <;> cases z <;> simp only [Le] at * + exact P.trans hxy hyz + antisymm {x y} hxy hyx := by + cases x <;> cases y <;> simp only [Le] at * + exact congrArg some (P.antisymm hxy hyx) + meet_le_left x y := by + cases x <;> cases y <;> simp only [meet, Le] + · exact P.refl _ + · exact P.meet_le_left _ _ + meet_le_right x y := by + cases x <;> cases y <;> simp only [meet, Le] + · exact P.refl _ + · exact P.meet_le_right _ _ + le_meet {x y z} hxy hxz := by + cases x <;> cases y <;> cases z <;> simp only [meet, Le] at * + all_goals first | exact hxy | exact hxz | exact P.le_meet hxy hxz + +def embedding : IdealEmbedding P (order P) where + toFun := some + le_iff _ _ := Iff.rfl + map_meet _ _ := rfl + ideal x z h := by + cases z with + | none => exact False.elim h + | some z => exact ⟨z, rfl⟩ + +theorem strict_top (x : A) : (order P).le ((embedding P).toFun x) none ∧ + ¬ (order P).le none ((embedding P).toFun x) := ⟨True.intro, id⟩ + +theorem greatest (x : Option A) : (order P).le x none := by + cases x <;> exact True.intro + +theorem no_new_below (x : A) (z : Option A) (h : (order P).le z ((embedding P).toFun x)) : + ∃ y, (embedding P).toFun y = z := (embedding P).ideal x z h + +variable [Group J] (a : OrderAction J P) + +def act (g : J) : Option A → Option A + | none => none + | some x => some ((a.iso g).toFun x) + +def actionIso (g : J) : MeetIso (order P) (order P) where + toFun := act P a g + le_iff x y := by + cases x <;> cases y <;> simp only [act, order, Le] + exact (a.iso g).le_iff _ _ + map_meet x y := by + cases x <;> cases y <;> simp only [act, order, meet] + exact congrArg some ((a.iso g).map_meet _ _) + inverse + | none => none + | some x => some ((a.iso g).inverse x) + left_inverse x := by + cases x with + | none => rfl + | some x => exact congrArg some ((a.iso g).left_inverse x) + right_inverse x := by + cases x with + | none => rfl + | some x => exact congrArg some ((a.iso g).right_inverse x) + +def action : OrderAction J (order P) where + iso := actionIso P a + one x := by + cases x with + | none => rfl + | some x => exact congrArg some (a.one x) + mul g h x := by + cases x with + | none => rfl + | some x => exact congrArg some (a.mul g h x) + +theorem fixes_top (g : J) : ((action P a).iso g).toFun none = none := rfl + +theorem extends_action (g : J) (x : A) : + ((action P a).iso g).toFun ((embedding P).toFun x) = + (embedding P).toFun ((a.iso g).toFun x) := rfl + +end PartitionPilot.Compression.RecursiveMaps.FixedTop + +namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +open CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +def Extension := Option (f.Node a) +noncomputable def extensionOrder : MeetOrder (f.Extension a) := FixedTop.order (f.gluedOrder a) +noncomputable def extensionAction : OrderAction (External J f.Letters) (f.extensionOrder a) := + FixedTop.action (f.gluedOrder a) (f.externalAction a) +noncomputable def extensionCopy (w : External J f.Letters) : IdealEmbedding P (f.extensionOrder a) := + (f.copy a w).comp (FixedTop.embedding (f.gluedOrder a)) + +theorem extension_greatest (x : f.Extension a) : (f.extensionOrder a).le x none := + FixedTop.greatest (f.gluedOrder a) x + +theorem extension_strict_top (w : External J f.Letters) (x : A) : + (f.extensionOrder a).le ((f.extensionCopy a w).toFun x) none ∧ + ¬ (f.extensionOrder a).le none ((f.extensionCopy a w).toFun x) := + FixedTop.strict_top (f.gluedOrder a) ((f.copy a w).toFun x) + +theorem extension_fixes_top (g : External J f.Letters) : + ((f.extensionAction a).iso g).toFun none = none := rfl + +theorem extensionAction_copy (g w : External J f.Letters) (x : A) : + ((f.extensionAction a).iso g).toFun ((f.extensionCopy a w).toFun x) = + (f.extensionCopy a (g * w)).toFun x := + congrArg some (f.externalAction_copy a g w x) + +theorem extension_extends_old (j : J) (x : A) : + ((f.extensionAction a).iso (old J f.Letters j)).toFun ((f.extensionCopy a 1).toFun x) = + (f.extensionCopy a 1).toFun ((a.iso j).toFun x) := + congrArg some (f.extends_old_action a j x) + +theorem extensionCopy_principal (w : External J f.Letters) (z : f.Extension a) : + (f.extensionOrder a).le z ((f.extensionCopy a w).toFun f.top) ↔ + ∃ x, (f.extensionCopy a w).toFun x = z := + (f.extensionCopy a w).principal f.top f.greatest z + +end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTopProfilePreservation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTopProfilePreservation.lean index e674d1db42a2cadc0e1dd710564df7efc9273972..fb2eaab66c09d1b6949c115973f4b31a03c4acdd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTopProfilePreservation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FixedTopProfilePreservation.lean @@ -1,70 +1,70 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaskCapFamilyCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem relationImage_retarget_eq {A Q V F e : ZFSet.{u}} - (shape : e ⊆ ZFSet.prod A Q) (subset : Q ⊆ V) : - relationImage F V e = relationImage F Q e := by - apply ZFSet.ext - intro x - rw [mem_relationImage, mem_relationImage] - constructor - · rintro ⟨_, f, hf, entry⟩ - exact ⟨(ZFSet.pair_mem_prod.1 (shape entry)).2, f, hf, entry⟩ - · rintro ⟨hx, f, hf, entry⟩ - exact ⟨subset hx, f, hf, entry⟩ - -namespace CodedCapProfile -variable {P r μ c E K F : ZFSet.{u}} - -theorem fixedTop (profile : CodedCapProfile P r μ c E K F) (meet : MeetOrderCode P r μ) : - CodedCapProfile (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) c E K F := by - refine ⟨fixedTopCarrier_old profile.target_mem, fixedTopCarrier_old profile.separator_mem, - fixedTopCarrier_old profile.cap_mem, fun _ hf => fixedTopCarrier_old (profile.filter_subset hf), - profile.nonempty, ?_, fixedTopOrder_subset P r profile.target_below_cap, - fun lower => profile.cap_not_below_target ((fixedTopOrder_old_iff profile.target_mem).1 lower), - fun lower => profile.separator_not_below_cap ((fixedTopOrder_old_iff profile.cap_mem).1 lower)⟩ - intro x hx above - rcases (mem_fixedTopCarrier P x).1 hx with equal | oldx - · subst x - have positive : ∃ f ∈ F, ZFSet.pair f P ∈ fixedTopOrder P r := by - obtain ⟨f, hf⟩ := profile.nonempty - exact ⟨f, hf, fixedTopOrder_greatest (fixedTopCarrier_old (profile.filter_subset hf))⟩ - exact ⟨fun _ => fixedTopOrder_greatest (fixedTopCarrier_old profile.cap_mem), - fun negative => False.elim (negative positive)⟩ - · have old := profile.profile x oldx ((fixedTopOrder_old_iff oldx).1 above) - have positive : (∃ f ∈ F, ZFSet.pair f x ∈ fixedTopOrder P r) ↔ - ∃ f ∈ F, ZFSet.pair f x ∈ r := by - simp only [fixedTopOrder_old_iff oldx] - exact ⟨fun hp => fixedTopOrder_subset P r (old.1 (positive.1 hp)), - fun hn => fixedTopMeet_subset meet (old.2 (fun hp => hn (positive.2 hp)))⟩ - -end CodedCapProfile - -namespace OldProfilePreservationCode -variable {P r μ Q R ν e Filters : ZFSet.{u}} - -theorem fixedTop (preserved : OldProfilePreservationCode P r μ Q R ν e Filters) - (target : MeetOrderCode Q R ν) (shape : e ⊆ ZFSet.prod P Q) : - OldProfilePreservationCode P r μ (fixedTopCarrier Q) (fixedTopOrder Q R) - (fixedTopMeet Q R) e Filters := by - intro F hF c hc E hE K hK profile c' _ E' _ K' _ imageC imageE imageK - have inherited := preserved F hF c hc E hE K hK profile - c' (ZFSet.pair_mem_prod.1 (shape imageC)).2 - E' (ZFSet.pair_mem_prod.1 (shape imageE)).2 - K' (ZFSet.pair_mem_prod.1 (shape imageK)).2 imageC imageE imageK - rw [relationImage_retarget_eq shape (fixedTopCarrier_subset Q)] - exact inherited.fixedTop target - -end OldProfilePreservationCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaskCapFamilyCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem relationImage_retarget_eq {A Q V F e : ZFSet.{u}} + (shape : e ⊆ ZFSet.prod A Q) (subset : Q ⊆ V) : + relationImage F V e = relationImage F Q e := by + apply ZFSet.ext + intro x + rw [mem_relationImage, mem_relationImage] + constructor + · rintro ⟨_, f, hf, entry⟩ + exact ⟨(ZFSet.pair_mem_prod.1 (shape entry)).2, f, hf, entry⟩ + · rintro ⟨hx, f, hf, entry⟩ + exact ⟨subset hx, f, hf, entry⟩ + +namespace CodedCapProfile +variable {P r μ c E K F : ZFSet.{u}} + +theorem fixedTop (profile : CodedCapProfile P r μ c E K F) (meet : MeetOrderCode P r μ) : + CodedCapProfile (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) c E K F := by + refine ⟨fixedTopCarrier_old profile.target_mem, fixedTopCarrier_old profile.separator_mem, + fixedTopCarrier_old profile.cap_mem, fun _ hf => fixedTopCarrier_old (profile.filter_subset hf), + profile.nonempty, ?_, fixedTopOrder_subset P r profile.target_below_cap, + fun lower => profile.cap_not_below_target ((fixedTopOrder_old_iff profile.target_mem).1 lower), + fun lower => profile.separator_not_below_cap ((fixedTopOrder_old_iff profile.cap_mem).1 lower)⟩ + intro x hx above + rcases (mem_fixedTopCarrier P x).1 hx with equal | oldx + · subst x + have positive : ∃ f ∈ F, ZFSet.pair f P ∈ fixedTopOrder P r := by + obtain ⟨f, hf⟩ := profile.nonempty + exact ⟨f, hf, fixedTopOrder_greatest (fixedTopCarrier_old (profile.filter_subset hf))⟩ + exact ⟨fun _ => fixedTopOrder_greatest (fixedTopCarrier_old profile.cap_mem), + fun negative => False.elim (negative positive)⟩ + · have old := profile.profile x oldx ((fixedTopOrder_old_iff oldx).1 above) + have positive : (∃ f ∈ F, ZFSet.pair f x ∈ fixedTopOrder P r) ↔ + ∃ f ∈ F, ZFSet.pair f x ∈ r := by + simp only [fixedTopOrder_old_iff oldx] + exact ⟨fun hp => fixedTopOrder_subset P r (old.1 (positive.1 hp)), + fun hn => fixedTopMeet_subset meet (old.2 (fun hp => hn (positive.2 hp)))⟩ + +end CodedCapProfile + +namespace OldProfilePreservationCode +variable {P r μ Q R ν e Filters : ZFSet.{u}} + +theorem fixedTop (preserved : OldProfilePreservationCode P r μ Q R ν e Filters) + (target : MeetOrderCode Q R ν) (shape : e ⊆ ZFSet.prod P Q) : + OldProfilePreservationCode P r μ (fixedTopCarrier Q) (fixedTopOrder Q R) + (fixedTopMeet Q R) e Filters := by + intro F hF c hc E hE K hK profile c' _ E' _ K' _ imageC imageE imageK + have inherited := preserved F hF c hc E hE K hK profile + c' (ZFSet.pair_mem_prod.1 (shape imageC)).2 + E' (ZFSet.pair_mem_prod.1 (shape imageE)).2 + K' (ZFSet.pair_mem_prod.1 (shape imageK)).2 imageC imageE imageK + rw [relationImage_retarget_eq shape (fixedTopCarrier_subset Q)] + exact inherited.fixedTop target + +end OldProfilePreservationCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatConditionSystems.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatConditionSystems.lean index 85911b7c70e75525193016b8d849a9fde9fba2b5..c67d6088e92e0bedf813fbc84361b6736b556521 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatConditionSystems.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatConditionSystems.lean @@ -1,74 +1,74 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneOrder - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {R Q : Type u} [PartialOrder R] [PartialOrder Q] - -structure FlatConditionSystem (M : TransitiveGround.{u}) - (c : Presentation R) (s : Presentation Q) (J : ZFSet.{u}) where - row : Q → R - assignments : Q → ZFSet.{u} - encode : ∀ q, s.encode q = ZFSet.pair (c.encode (row q)) (assignments q) - le_iff : ∀ q p, q ≤ p ↔ row q ≤ row p ∧ assignments p ⊆ assignments q - assignments_mem : ∀ q, assignments q ∈ M.groundSmallSubsets J ZFSet.omega - -namespace FlatConditionSystem -variable {M : TransitiveGround.{u}} {c : Presentation R} {s : Presentation Q} {J : ZFSet.{u}} -variable (F : FlatConditionSystem M c s J) -include F - -theorem conditionOrder_eq : s.conditionOrder = - rowAssignmentOrder s.carrier c.carrier (M.groundSmallSubsets J ZFSet.omega) c.conditionOrder := by - apply ZFSet.ext - intro z - rw [Presentation.conditionOrder, Presentation.mem_subset] - constructor - · rintro ⟨⟨q, p⟩, below, rfl⟩ - change ZFSet.pair (s.encode q) (s.encode p) ∈ _ - rw [F.encode q, F.encode p] - exact (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).2 - ⟨F.encode q ▸ s.encode_mem q, F.encode p ▸ s.encode_mem p, - c.encode_mem (F.row q), F.assignments_mem q, - c.encode_mem (F.row p), F.assignments_mem p, - (c.pair_mem_conditionOrder _ _).2 ((F.le_iff q p).1 below).1, - ((F.le_iff q p).1 below).2⟩ - · intro member - obtain ⟨rawQ, hq, rawP, hp, equal⟩ := ZFSet.mem_prod.1 - ((mem_rowAssignmentOrder _ _ _ _ z).1 member).1 - obtain ⟨q, eqQ⟩ := (s.mem_carrier rawQ).1 hq - obtain ⟨p, eqP⟩ := (s.mem_carrier rawP).1 hp - have entries : ZFSet.pair (s.encode q) (s.encode p) ∈ - rowAssignmentOrder s.carrier c.carrier (M.groundSmallSubsets J ZFSet.omega) c.conditionOrder := by - rw [eqQ, eqP, ← equal] - exact member - rw [F.encode q, F.encode p] at entries - obtain ⟨_, _, _, _, _, _, rows, data⟩ := - (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).1 entries - refine ⟨(q, p), (F.le_iff q p).2 ⟨(c.pair_mem_conditionOrder _ _).1 rows, data⟩, ?_⟩ - change ZFSet.pair (s.encode q) (s.encode p) = z - rw [eqQ, eqP] - exact equal.symm - -theorem conditionOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (rows : c.carrier ∈ M.sets) (conditions : s.carrier ∈ M.sets) - (assignments : J ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (order : c.conditionOrder ∈ M.sets) : s.conditionOrder ∈ M.sets := by - rw [F.conditionOrder_eq] - exact M.rowAssignmentOrder_mem pairing unions powers separation conditions rows - (M.groundSmallSubsets_mem powers separation assignments omega) order - -end FlatConditionSystem - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneOrder + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {R Q : Type u} [PartialOrder R] [PartialOrder Q] + +structure FlatConditionSystem (M : TransitiveGround.{u}) + (c : Presentation R) (s : Presentation Q) (J : ZFSet.{u}) where + row : Q → R + assignments : Q → ZFSet.{u} + encode : ∀ q, s.encode q = ZFSet.pair (c.encode (row q)) (assignments q) + le_iff : ∀ q p, q ≤ p ↔ row q ≤ row p ∧ assignments p ⊆ assignments q + assignments_mem : ∀ q, assignments q ∈ M.groundSmallSubsets J ZFSet.omega + +namespace FlatConditionSystem +variable {M : TransitiveGround.{u}} {c : Presentation R} {s : Presentation Q} {J : ZFSet.{u}} +variable (F : FlatConditionSystem M c s J) +include F + +theorem conditionOrder_eq : s.conditionOrder = + rowAssignmentOrder s.carrier c.carrier (M.groundSmallSubsets J ZFSet.omega) c.conditionOrder := by + apply ZFSet.ext + intro z + rw [Presentation.conditionOrder, Presentation.mem_subset] + constructor + · rintro ⟨⟨q, p⟩, below, rfl⟩ + change ZFSet.pair (s.encode q) (s.encode p) ∈ _ + rw [F.encode q, F.encode p] + exact (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).2 + ⟨F.encode q ▸ s.encode_mem q, F.encode p ▸ s.encode_mem p, + c.encode_mem (F.row q), F.assignments_mem q, + c.encode_mem (F.row p), F.assignments_mem p, + (c.pair_mem_conditionOrder _ _).2 ((F.le_iff q p).1 below).1, + ((F.le_iff q p).1 below).2⟩ + · intro member + obtain ⟨rawQ, hq, rawP, hp, equal⟩ := ZFSet.mem_prod.1 + ((mem_rowAssignmentOrder _ _ _ _ z).1 member).1 + obtain ⟨q, eqQ⟩ := (s.mem_carrier rawQ).1 hq + obtain ⟨p, eqP⟩ := (s.mem_carrier rawP).1 hp + have entries : ZFSet.pair (s.encode q) (s.encode p) ∈ + rowAssignmentOrder s.carrier c.carrier (M.groundSmallSubsets J ZFSet.omega) c.conditionOrder := by + rw [eqQ, eqP, ← equal] + exact member + rw [F.encode q, F.encode p] at entries + obtain ⟨_, _, _, _, _, _, rows, data⟩ := + (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).1 entries + refine ⟨(q, p), (F.le_iff q p).2 ⟨(c.pair_mem_conditionOrder _ _).1 rows, data⟩, ?_⟩ + change ZFSet.pair (s.encode q) (s.encode p) = z + rw [eqQ, eqP] + exact equal.symm + +theorem conditionOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (rows : c.carrier ∈ M.sets) (conditions : s.carrier ∈ M.sets) + (assignments : J ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (order : c.conditionOrder ∈ M.sets) : s.conditionOrder ∈ M.sets := by + rw [F.conditionOrder_eq] + exact M.rowAssignmentOrder_mem pairing unions powers separation conditions rows + (M.groundSmallSubsets_mem powers separation assignments omega) order + +end FlatConditionSystem + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatLimitConditionCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatLimitConditionCodes.lean index d0e9db12efeac5686146ee2522ff8b75bea16036..c6a84c30c335852bf17fd2d3961954b3176ee22a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatLimitConditionCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatLimitConditionCodes.lean @@ -1,68 +1,68 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.AssignmentNestedSplices - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -def FlatHistoryCuts (stages history levels row A : ZFSet.{u}) : Prop := - ∀ beta ∈ stages, ∃ Q, ZFSet.pair beta Q ∈ history ∧ - ZFSet.pair row (assignmentCut levels beta A) ∈ Q - -def FlatLimitConditionCode (stages history levels z : ZFSet.{u}) : Prop := - ∃ row A, z = ZFSet.pair row A ∧ FlatHistoryCuts stages history levels row A - -theorem flatLimitConditionCode_pair (stages history levels row A : ZFSet.{u}) : - FlatLimitConditionCode stages history levels (ZFSet.pair row A) ↔ - FlatHistoryCuts stages history levels row A := by - constructor - · rintro ⟨row', A', equal, valid⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_injective equal - exact valid - · intro valid - exact ⟨row, A, rfl, valid⟩ - -theorem flatHistoryCuts_lookup_iff {stages history levels row A : ZFSet.{u}} - (function : FunctionGraphOn stages history) : - FlatHistoryCuts stages history levels row A ↔ - ∀ beta ∈ stages, ∀ Q, ZFSet.pair beta Q ∈ history → - ZFSet.pair row (assignmentCut levels beta A) ∈ Q := by - constructor - · intro valid beta hbeta Q entry - obtain ⟨Q', entry', member⟩ := valid beta hbeta - exact function.unique entry' entry ▸ member - · intro valid beta hbeta - obtain ⟨Q, entry⟩ := function.total hbeta - exact ⟨Q, entry, valid beta hbeta Q entry⟩ - -theorem flatHistoryCuts_restrict {stages earlier history levels row A : ZFSet.{u}} - (valid : FlatHistoryCuts stages history levels row A) (subset : earlier ⊆ stages) : - FlatHistoryCuts earlier (graphRestriction earlier history) levels row A := by - intro beta hbeta - obtain ⟨Q, entry, member⟩ := valid beta (subset hbeta) - exact ⟨Q, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, member⟩ - -theorem flatHistoryCuts_cut {stages earlier history levels alpha row A : ZFSet.{u}} - (valid : FlatHistoryCuts stages history levels row A) (subset : earlier ⊆ stages) - (nested : ∀ beta ∈ earlier, assignmentCut levels beta (assignmentCut levels alpha A) = - assignmentCut levels beta A) : - FlatHistoryCuts earlier (graphRestriction earlier history) levels row - (assignmentCut levels alpha A) := by - intro beta hbeta - obtain ⟨Q, entry, member⟩ := flatHistoryCuts_restrict valid subset beta hbeta - exact ⟨Q, entry, (nested beta hbeta).symm ▸ member⟩ - -theorem flatHistoryCuts_cut_of_subset {stages earlier history levels alpha row A : ZFSet.{u}} - (valid : FlatHistoryCuts stages history levels row A) (subset : earlier ⊆ stages) - (below : ∀ beta ∈ earlier, beta ⊆ alpha) : - FlatHistoryCuts earlier (graphRestriction earlier history) levels row - (assignmentCut levels alpha A) := - flatHistoryCuts_cut valid subset (fun beta hbeta => assignmentCut_nested (below beta hbeta)) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.AssignmentNestedSplices + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +def FlatHistoryCuts (stages history levels row A : ZFSet.{u}) : Prop := + ∀ beta ∈ stages, ∃ Q, ZFSet.pair beta Q ∈ history ∧ + ZFSet.pair row (assignmentCut levels beta A) ∈ Q + +def FlatLimitConditionCode (stages history levels z : ZFSet.{u}) : Prop := + ∃ row A, z = ZFSet.pair row A ∧ FlatHistoryCuts stages history levels row A + +theorem flatLimitConditionCode_pair (stages history levels row A : ZFSet.{u}) : + FlatLimitConditionCode stages history levels (ZFSet.pair row A) ↔ + FlatHistoryCuts stages history levels row A := by + constructor + · rintro ⟨row', A', equal, valid⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_injective equal + exact valid + · intro valid + exact ⟨row, A, rfl, valid⟩ + +theorem flatHistoryCuts_lookup_iff {stages history levels row A : ZFSet.{u}} + (function : FunctionGraphOn stages history) : + FlatHistoryCuts stages history levels row A ↔ + ∀ beta ∈ stages, ∀ Q, ZFSet.pair beta Q ∈ history → + ZFSet.pair row (assignmentCut levels beta A) ∈ Q := by + constructor + · intro valid beta hbeta Q entry + obtain ⟨Q', entry', member⟩ := valid beta hbeta + exact function.unique entry' entry ▸ member + · intro valid beta hbeta + obtain ⟨Q, entry⟩ := function.total hbeta + exact ⟨Q, entry, valid beta hbeta Q entry⟩ + +theorem flatHistoryCuts_restrict {stages earlier history levels row A : ZFSet.{u}} + (valid : FlatHistoryCuts stages history levels row A) (subset : earlier ⊆ stages) : + FlatHistoryCuts earlier (graphRestriction earlier history) levels row A := by + intro beta hbeta + obtain ⟨Q, entry, member⟩ := valid beta (subset hbeta) + exact ⟨Q, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, member⟩ + +theorem flatHistoryCuts_cut {stages earlier history levels alpha row A : ZFSet.{u}} + (valid : FlatHistoryCuts stages history levels row A) (subset : earlier ⊆ stages) + (nested : ∀ beta ∈ earlier, assignmentCut levels beta (assignmentCut levels alpha A) = + assignmentCut levels beta A) : + FlatHistoryCuts earlier (graphRestriction earlier history) levels row + (assignmentCut levels alpha A) := by + intro beta hbeta + obtain ⟨Q, entry, member⟩ := flatHistoryCuts_restrict valid subset beta hbeta + exact ⟨Q, entry, (nested beta hbeta).symm ▸ member⟩ + +theorem flatHistoryCuts_cut_of_subset {stages earlier history levels alpha row A : ZFSet.{u}} + (valid : FlatHistoryCuts stages history levels row A) (subset : earlier ⊆ stages) + (below : ∀ beta ∈ earlier, beta ⊆ alpha) : + FlatHistoryCuts earlier (graphRestriction earlier history) levels row + (assignmentCut levels alpha A) := + flatHistoryCuts_cut valid subset (fun beta hbeta => assignmentCut_nested (below beta hbeta)) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditionUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditionUnions.lean index e95d41906d6a5a6e0fbe97b9e74d041dad0d6c74..4c8894f27e20fdfc2ecb8b6f9524081e4ed5e4c0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditionUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditionUnions.lean @@ -1,94 +1,94 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeSuccessorLaws -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementFlatSuccessorUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) - -namespace FlatSuccessorCondition -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -variable (unionLaws : FlatSuccessorUnionLaws tests) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - -noncomputable def chainUnion (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : Condition := by - have old := ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1 - have memberq : F.assignments q ∈ B := - (includeLower M c s I T levels alpha tests F laws q).assignments_mem - exact { - row := F.row q - assignments := assignmentSplice levels alpha (F.assignments q) - (stageOneAssignmentUnion (fun n => (seq n).assignments)) - assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation - infinite choice hLevels hAlpha memberq small - lower := q - lower_code := by rw [assignmentCut_splice, laws.cut_old _ old]; exact F.encode q - tests := (laws.tests_splice _ _ q old).2 - (unionLaws.tests_union (fun n => (seq n).assignments) (fun n => (seq n).lower) q - (fun _ _ less => (decreasing less).2) below (fun n => (seq n).tests)) } - -local notation "bound" => chainUnion M c s I T levels alpha tests F laws unionLaws - pairing unions powers separation infinite choice hLevels hAlpha - -theorem chainUnion_row (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : - (bound seq decreasing q below small).row = F.row q := rfl - -theorem chainUnion_assignments (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : - (bound seq decreasing q below small).assignments = - assignmentSplice levels alpha (F.assignments q) - (stageOneAssignmentUnion (fun n => (seq n).assignments)) := rfl - -theorem chainUnion_lower (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : - (bound seq decreasing q below small).lower = q := rfl - -theorem chainUnion_le (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) (n : Nat) : - bound seq decreasing q below small ≤ seq n := by - have rows := ((F.le_iff q (seq n).lower).1 (below n)).1 - have rowEqual := lower_row M c s I T levels alpha tests F (seq n) - have contains : stageOneAssignmentUnion (fun n => (seq n).assignments) ⊆ - assignmentSplice levels alpha (F.assignments q) - (stageOneAssignmentUnion (fun n => (seq n).assignments)) := by - apply assignmentSplice_extends - rw [laws.cut_old _ ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1] - intro z hz - obtain ⟨member, level⟩ := (mem_assignmentCut levels alpha - (stageOneAssignmentUnion (fun n => (seq n).assignments)) z).1 hz - obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion (fun n => (seq n).assignments) z).1 member - have lowerMember : z ∈ F.assignments (seq m).lower := by - rw [lower_assignments M c s I T levels alpha tests F (seq m)] - exact (mem_assignmentCut levels alpha (seq m).assignments z).2 ⟨hm, level⟩ - exact ((F.le_iff q (seq m).lower).1 (below m)).2 lowerMember - exact ⟨rows.trans_eq rowEqual, fun _ hz => contains - (stageOneAssignmentUnion_contains (fun n => (seq n).assignments) n hz)⟩ - -end FlatSuccessorCondition -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeSuccessorLaws +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementFlatSuccessorUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) + +namespace FlatSuccessorCondition +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +variable (unionLaws : FlatSuccessorUnionLaws tests) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + +noncomputable def chainUnion (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : Condition := by + have old := ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1 + have memberq : F.assignments q ∈ B := + (includeLower M c s I T levels alpha tests F laws q).assignments_mem + exact { + row := F.row q + assignments := assignmentSplice levels alpha (F.assignments q) + (stageOneAssignmentUnion (fun n => (seq n).assignments)) + assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation + infinite choice hLevels hAlpha memberq small + lower := q + lower_code := by rw [assignmentCut_splice, laws.cut_old _ old]; exact F.encode q + tests := (laws.tests_splice _ _ q old).2 + (unionLaws.tests_union (fun n => (seq n).assignments) (fun n => (seq n).lower) q + (fun _ _ less => (decreasing less).2) below (fun n => (seq n).tests)) } + +local notation "bound" => chainUnion M c s I T levels alpha tests F laws unionLaws + pairing unions powers separation infinite choice hLevels hAlpha + +theorem chainUnion_row (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : + (bound seq decreasing q below small).row = F.row q := rfl + +theorem chainUnion_assignments (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : + (bound seq decreasing q below small).assignments = + assignmentSplice levels alpha (F.assignments q) + (stageOneAssignmentUnion (fun n => (seq n).assignments)) := rfl + +theorem chainUnion_lower (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : + (bound seq decreasing q below small).lower = q := rfl + +theorem chainUnion_le (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) (n : Nat) : + bound seq decreasing q below small ≤ seq n := by + have rows := ((F.le_iff q (seq n).lower).1 (below n)).1 + have rowEqual := lower_row M c s I T levels alpha tests F (seq n) + have contains : stageOneAssignmentUnion (fun n => (seq n).assignments) ⊆ + assignmentSplice levels alpha (F.assignments q) + (stageOneAssignmentUnion (fun n => (seq n).assignments)) := by + apply assignmentSplice_extends + rw [laws.cut_old _ ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1] + intro z hz + obtain ⟨member, level⟩ := (mem_assignmentCut levels alpha + (stageOneAssignmentUnion (fun n => (seq n).assignments)) z).1 hz + obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion (fun n => (seq n).assignments) z).1 member + have lowerMember : z ∈ F.assignments (seq m).lower := by + rw [lower_assignments M c s I T levels alpha tests F (seq m)] + exact (mem_assignmentCut levels alpha (seq m).assignments z).2 ⟨hm, level⟩ + exact ((F.le_iff q (seq m).lower).1 (below m)).2 lowerMember + exact ⟨rows.trans_eq rowEqual, fun _ hz => contains + (stageOneAssignmentUnion_contains (fun n => (seq n).assignments) n hz)⟩ + +end FlatSuccessorCondition +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditions.lean index 580a24644dcfd07d493671098d9ecdc261ba6950..7c61c7e3857045b5191c4cd4032c11978b219918 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/FlatSuccessorConditions.lean @@ -1,72 +1,72 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.StageOneDataBoundLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) - -structure FlatSuccessorCondition where - row : R - assignments : ZFSet.{u} - assignments_mem : assignments ∈ - M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega - lower : P - lower_code : s.encode lower = ZFSet.pair (c.encode row) - (assignmentCut levels alpha assignments) - tests : tests assignments lower - -namespace FlatSuccessorCondition -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests - -@[ext] theorem ext {p q : Condition} - (rows : p.row = q.row) (data : p.assignments = q.assignments) : p = q := by - cases p with - | mk rp Ap smallp lp codep testp => - cases q with - | mk rq Aq smallq lq codeq testq => - dsimp only at rows data - subst rq - subst Aq - have equal : lp = lq := s.injective (codep.trans codeq.symm) - subst lq - rfl - -noncomputable def code (p : Condition) : ZFSet.{u} := ZFSet.pair (c.encode p.row) p.assignments - -theorem code_eq_iff (p q : Condition) : - code M c s I T levels alpha tests p = - code M c s I T levels alpha tests q ↔ p.row = q.row ∧ p.assignments = q.assignments := by - rw [code, code, ZFSet.pair_inj] - exact and_congr c.injective.eq_iff Iff.rfl - -theorem code_injective : Function.Injective (code M c s I T levels alpha tests) := by - intro p q equal - obtain ⟨rows, data⟩ := (code_eq_iff M c s I T levels alpha tests p q).1 equal - exact ext M c s I T levels alpha tests rows data - -theorem code_mem_candidateBound (p : Condition) : - code M c s I T levels alpha tests p ∈ M.stageOneCandidateBound c.carrier I T := - ZFSet.pair_mem_prod.2 ⟨c.encode_mem p.row, p.assignments_mem⟩ - -instance small : Small.{u} Condition := by - let bound := M.stageOneCandidateBound c.carrier I T - let f : Condition → bound := fun p => - ⟨code M c s I T levels alpha tests p, - code_mem_candidateBound M c s I T levels alpha tests p⟩ - apply small_of_injective (f := f) - intro p q equal - exact code_injective M c s I T levels alpha tests (congrArg Subtype.val equal) - -end FlatSuccessorCondition - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.StageOneDataBoundLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) + +structure FlatSuccessorCondition where + row : R + assignments : ZFSet.{u} + assignments_mem : assignments ∈ + M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega + lower : P + lower_code : s.encode lower = ZFSet.pair (c.encode row) + (assignmentCut levels alpha assignments) + tests : tests assignments lower + +namespace FlatSuccessorCondition +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests + +@[ext] theorem ext {p q : Condition} + (rows : p.row = q.row) (data : p.assignments = q.assignments) : p = q := by + cases p with + | mk rp Ap smallp lp codep testp => + cases q with + | mk rq Aq smallq lq codeq testq => + dsimp only at rows data + subst rq + subst Aq + have equal : lp = lq := s.injective (codep.trans codeq.symm) + subst lq + rfl + +noncomputable def code (p : Condition) : ZFSet.{u} := ZFSet.pair (c.encode p.row) p.assignments + +theorem code_eq_iff (p q : Condition) : + code M c s I T levels alpha tests p = + code M c s I T levels alpha tests q ↔ p.row = q.row ∧ p.assignments = q.assignments := by + rw [code, code, ZFSet.pair_inj] + exact and_congr c.injective.eq_iff Iff.rfl + +theorem code_injective : Function.Injective (code M c s I T levels alpha tests) := by + intro p q equal + obtain ⟨rows, data⟩ := (code_eq_iff M c s I T levels alpha tests p q).1 equal + exact ext M c s I T levels alpha tests rows data + +theorem code_mem_candidateBound (p : Condition) : + code M c s I T levels alpha tests p ∈ M.stageOneCandidateBound c.carrier I T := + ZFSet.pair_mem_prod.2 ⟨c.encode_mem p.row, p.assignments_mem⟩ + +instance small : Small.{u} Condition := by + let bound := M.stageOneCandidateBound c.carrier I T + let f : Condition → bound := fun p => + ⟨code M c s I T levels alpha tests p, + code_mem_candidateBound M c s I T levels alpha tests p⟩ + apply small_of_injective (f := f) + intro p q equal + exact code_injective M c s I T levels alpha tests (congrArg Subtype.val equal) + +end FlatSuccessorCondition + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ForcingHistoryTestDecomposition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ForcingHistoryTestDecomposition.lean index 91d147af711cb588914fd2e2a6ad50842d610758..8b959b36a5ab7784ce75bc9b56032737e39274c3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ForcingHistoryTestDecomposition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ForcingHistoryTestDecomposition.lean @@ -1,220 +1,220 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RepresentativeIndexSteps -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels - -namespace OAI - -namespace PartitionPilot.Forcing -universe u - -def ForcingHistoryConditionCode (M : TransitiveGround.{u}) - (stages history levels z : ZFSet.{u}) : Prop := - ∀ alpha ∈ stages, ∃ data, ZFSet.pair alpha data ∈ history ∧ - PackedSuccessorConditionCode M levels alpha data z - -theorem forcingHistoryConditionCode_empty (M : TransitiveGround.{u}) - (history levels z : ZFSet.{u}) : ForcingHistoryConditionCode M ∅ history levels z := - fun alpha member => False.elim (ZFSet.notMem_empty alpha member) - -theorem forcingHistoryConditionCode_lookup_iff {M : TransitiveGround.{u}} - {stages history levels z : ZFSet.{u}} (function : FunctionGraphOn stages history) : - ForcingHistoryConditionCode M stages history levels z ↔ - ∀ alpha ∈ stages, ∀ data, ZFSet.pair alpha data ∈ history → - PackedSuccessorConditionCode M levels alpha data z := by - constructor - · intro valid alpha member data entry - obtain ⟨other, old, checked⟩ := valid alpha member - exact function.unique old entry ▸ checked - · intro valid alpha member - obtain ⟨data, entry⟩ := function.total member - exact ⟨data, entry, valid alpha member data entry⟩ - -theorem forcingHistoryConditionCode_restrict_iff {M : TransitiveGround.{u}} - {stages history levels z : ZFSet.{u}} : - ForcingHistoryConditionCode M stages (graphRestriction stages history) levels z ↔ - ForcingHistoryConditionCode M stages history levels z := by - constructor - · intro valid alpha member - obtain ⟨data, entry, checked⟩ := valid alpha member - exact ⟨data, (pair_mem_graphRestriction.1 entry).1, checked⟩ - · intro valid alpha member - obtain ⟨data, entry, checked⟩ := valid alpha member - exact ⟨data, pair_mem_graphRestriction.2 ⟨entry, member⟩, checked⟩ - -theorem forcingHistoryConditionCode_mono {M : TransitiveGround.{u}} - {stages earlier history levels z : ZFSet.{u}} - (valid : ForcingHistoryConditionCode M stages history levels z) (subset : earlier ⊆ stages) : - ForcingHistoryConditionCode M earlier (graphRestriction earlier history) levels z := by - apply forcingHistoryConditionCode_restrict_iff.2 - exact fun alpha member => valid alpha (subset member) - -theorem forcingHistoryConditionCode_insert_iff {M : TransitiveGround.{u}} - {stages history levels alpha data z : ZFSet.{u}} - (function : FunctionGraphOn stages history) (outside : alpha ∉ stages) : - ForcingHistoryConditionCode M (insert alpha stages) - (insert (ZFSet.pair alpha data) history) levels z ↔ - ForcingHistoryConditionCode M stages history levels z ∧ - PackedSuccessorConditionCode M levels alpha data z := by - constructor - · intro valid - constructor - · intro beta member - obtain ⟨value, entry, checked⟩ := valid beta (ZFSet.mem_insert_of_mem alpha member) - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · have same := (ZFSet.pair_inj.1 equal).1 - exact False.elim (outside (same ▸ member)) - · exact ⟨value, old, checked⟩ - · obtain ⟨value, entry, checked⟩ := valid alpha (ZFSet.mem_insert alpha stages) - have same := (function.insert outside data).unique entry (ZFSet.mem_insert _ _) - exact same ▸ checked - · rintro ⟨prior, current⟩ beta member - rcases ZFSet.mem_insert_iff.1 member with rfl | member - · exact ⟨data, ZFSet.mem_insert _ _, current⟩ - · obtain ⟨value, entry, checked⟩ := prior beta member - exact ⟨value, ZFSet.mem_insert_of_mem _ entry, checked⟩ - -theorem stageTwoConditionCode_levels_congr (M : TransitiveGround.{u}) - (d : Fin 15 → ZFSet.{u}) (first second alpha z : ZFSet.{u}) - (cuts : ∀ A, assignmentCut first alpha A = assignmentCut second alpha A) : - StageTwoConditionCode M first alpha d z ↔ StageTwoConditionCode M second alpha d z := by - constructor - · rintro ⟨row, A, equal, member, tests⟩ - rw [cuts A] at member tests - exact ⟨row, A, equal, member, tests⟩ - · rintro ⟨row, A, equal, member, tests⟩ - rw [← cuts A] at member tests - exact ⟨row, A, equal, member, tests⟩ - -theorem packedSuccessorConditionCode_levels_congr (M : TransitiveGround.{u}) - (first second alpha data z : ZFSet.{u}) - (cuts : ∀ A, assignmentCut first alpha A = assignmentCut second alpha A) : - PackedSuccessorConditionCode M first alpha data z ↔ - PackedSuccessorConditionCode M second alpha data z := by - constructor - · rintro ⟨d, equal, checked⟩ - exact ⟨d, equal, (stageTwoConditionCode_levels_congr M d first second alpha z cuts).1 checked⟩ - · rintro ⟨d, equal, checked⟩ - exact ⟨d, equal, (stageTwoConditionCode_levels_congr M d first second alpha z cuts).2 checked⟩ - -theorem forcingHistoryConditionCode_levels_congr (M : TransitiveGround.{u}) - (stages history first second z : ZFSet.{u}) - (cuts : ∀ alpha ∈ stages, ∀ A, assignmentCut first alpha A = assignmentCut second alpha A) : - ForcingHistoryConditionCode M stages history first z ↔ - ForcingHistoryConditionCode M stages history second z := by - constructor - · intro valid alpha member - obtain ⟨data, entry, checked⟩ := valid alpha member - exact ⟨data, entry, (packedSuccessorConditionCode_levels_congr M first second alpha data z - (cuts alpha member)).1 checked⟩ - · intro valid alpha member - obtain ⟨data, entry, checked⟩ := valid alpha member - exact ⟨data, entry, (packedSuccessorConditionCode_levels_congr M first second alpha data z - (cuts alpha member)).2 checked⟩ - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def ForcingHistoryLevelCoverage (stages history levels : ZFSet.{u}) : Prop := - ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - ZFSet.pair (stageOneAssignment t u w) beta ∈ levels - -theorem forcingHistoryConditionCode_cut_iff (M : TransitiveGround.{u}) - (stages history levels alpha row A : ZFSet.{u}) - (below : ∀ beta ∈ stages, beta ⊆ alpha) - (covered : ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - ∃ xi ∈ alpha, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : - ForcingHistoryConditionCode M stages history levels (ZFSet.pair row (assignmentCut levels alpha A)) ↔ - ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) := by - constructor - · intro valid beta member - obtain ⟨data, entry, d, equal, tests⟩ := valid beta member - rw [equal] at entry - refine ⟨refinementFormulaDataCode d, entry, d, rfl, ?_⟩ - exact (stageTwoConditionCode_cut_iff M d levels beta alpha row A (below beta member) - (covered beta member d entry)).1 tests - · intro valid beta member - obtain ⟨data, entry, d, equal, tests⟩ := valid beta member - rw [equal] at entry - refine ⟨refinementFormulaDataCode d, entry, d, rfl, ?_⟩ - exact (stageTwoConditionCode_cut_iff M d levels beta alpha row A (below beta member) - (covered beta member d entry)).2 tests - -theorem forcingHistoryConditionCode_ordinalCut_iff (M : TransitiveGround.{u}) - (stages history levels alpha row A : ZFSet.{u}) - (ordinal : ordinalSetProperty alpha) (subset : stages ⊆ alpha) - (coverage : ForcingHistoryLevelCoverage stages history levels) : - ForcingHistoryConditionCode M stages history levels (ZFSet.pair row (assignmentCut levels alpha A)) ↔ - ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) := by - apply forcingHistoryConditionCode_cut_iff M stages history levels alpha row A - · intro beta member xi hxi - exact ordinal.1 beta (subset member) xi hxi - · intro beta member d entry t ht u hu w hw - exact ⟨beta, subset member, coverage beta member d entry t ht u hu w hw⟩ - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -universe u - -def forcingHistoryRawTests (M : TransitiveGround.{u}) - (history levels beta row A : ZFSet.{u}) : Prop := - ∀ d : Fin 15 → ZFSet.{u}, ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels beta A)) - -theorem forcingHistoryConditionCode_pair_decomposition {M : TransitiveGround.{u}} - {stages history levels : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (decoded : ∀ beta data, ZFSet.pair beta data ∈ history → - ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) - (row A : ZFSet.{u}) : - ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) ↔ - FlatHistoryCuts stages (refinementDataHistoryField stages history 7) levels row A ∧ - ∀ beta ∈ stages, forcingHistoryRawTests M history levels beta row A := by - have carriers := refinementDataHistoryField_function function decoded 7 - constructor - · intro valid - have lookup := forcingHistoryConditionCode_lookup_iff function |>.1 valid - constructor - · intro beta hbeta - obtain ⟨data, entry⟩ := function.total hbeta - obtain ⟨d, rfl⟩ := decoded beta data entry - have checked := (packedSuccessorConditionCode_code_iff M levels beta d _).1 - (lookup beta hbeta _ entry) - exact ⟨d 7, (refinementDataHistoryField_entry function d entry 7 _).2 rfl, - ((stageTwoConditionCode_pair_iff M d levels beta row A).1 checked).1⟩ - · intro beta hbeta d entry - have checked := (packedSuccessorConditionCode_code_iff M levels beta d _).1 - (lookup beta hbeta _ entry) - exact ((stageTwoConditionCode_pair_iff M d levels beta row A).1 checked).2 - · rintro ⟨cuts, tests⟩ beta hbeta - obtain ⟨data, entry⟩ := function.total hbeta - obtain ⟨d, rfl⟩ := decoded beta data entry - refine ⟨_, entry, (packedSuccessorConditionCode_code_iff M levels beta d _).2 ?_⟩ - apply (stageTwoConditionCode_pair_iff M d levels beta row A).2 - exact ⟨(flatHistoryCuts_lookup_iff carriers).1 cuts beta hbeta (d 7) - ((refinementDataHistoryField_entry function d entry 7 _).2 rfl), tests beta hbeta d entry⟩ - -theorem forcingHistoryRawTests_cut_iff (M : TransitiveGround.{u}) - (history levels beta gamma row A : ZFSet.{u}) (below : beta ⊆ gamma) - (covered : ∀ d : Fin 15 → ZFSet.{u}, ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - ∃ xi ∈ gamma, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : - forcingHistoryRawTests M history levels beta row (assignmentCut levels gamma A) ↔ - forcingHistoryRawTests M history levels beta row A := by - unfold forcingHistoryRawTests - rw [assignmentCut_nested below] - apply forall_congr' - intro d - apply forall_congr' - intro entry - exact stageOneRawTests_cut_iff M d levels gamma A _ (covered d entry) - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RepresentativeIndexSteps +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels + +namespace OAI + +namespace PartitionPilot.Forcing +universe u + +def ForcingHistoryConditionCode (M : TransitiveGround.{u}) + (stages history levels z : ZFSet.{u}) : Prop := + ∀ alpha ∈ stages, ∃ data, ZFSet.pair alpha data ∈ history ∧ + PackedSuccessorConditionCode M levels alpha data z + +theorem forcingHistoryConditionCode_empty (M : TransitiveGround.{u}) + (history levels z : ZFSet.{u}) : ForcingHistoryConditionCode M ∅ history levels z := + fun alpha member => False.elim (ZFSet.notMem_empty alpha member) + +theorem forcingHistoryConditionCode_lookup_iff {M : TransitiveGround.{u}} + {stages history levels z : ZFSet.{u}} (function : FunctionGraphOn stages history) : + ForcingHistoryConditionCode M stages history levels z ↔ + ∀ alpha ∈ stages, ∀ data, ZFSet.pair alpha data ∈ history → + PackedSuccessorConditionCode M levels alpha data z := by + constructor + · intro valid alpha member data entry + obtain ⟨other, old, checked⟩ := valid alpha member + exact function.unique old entry ▸ checked + · intro valid alpha member + obtain ⟨data, entry⟩ := function.total member + exact ⟨data, entry, valid alpha member data entry⟩ + +theorem forcingHistoryConditionCode_restrict_iff {M : TransitiveGround.{u}} + {stages history levels z : ZFSet.{u}} : + ForcingHistoryConditionCode M stages (graphRestriction stages history) levels z ↔ + ForcingHistoryConditionCode M stages history levels z := by + constructor + · intro valid alpha member + obtain ⟨data, entry, checked⟩ := valid alpha member + exact ⟨data, (pair_mem_graphRestriction.1 entry).1, checked⟩ + · intro valid alpha member + obtain ⟨data, entry, checked⟩ := valid alpha member + exact ⟨data, pair_mem_graphRestriction.2 ⟨entry, member⟩, checked⟩ + +theorem forcingHistoryConditionCode_mono {M : TransitiveGround.{u}} + {stages earlier history levels z : ZFSet.{u}} + (valid : ForcingHistoryConditionCode M stages history levels z) (subset : earlier ⊆ stages) : + ForcingHistoryConditionCode M earlier (graphRestriction earlier history) levels z := by + apply forcingHistoryConditionCode_restrict_iff.2 + exact fun alpha member => valid alpha (subset member) + +theorem forcingHistoryConditionCode_insert_iff {M : TransitiveGround.{u}} + {stages history levels alpha data z : ZFSet.{u}} + (function : FunctionGraphOn stages history) (outside : alpha ∉ stages) : + ForcingHistoryConditionCode M (insert alpha stages) + (insert (ZFSet.pair alpha data) history) levels z ↔ + ForcingHistoryConditionCode M stages history levels z ∧ + PackedSuccessorConditionCode M levels alpha data z := by + constructor + · intro valid + constructor + · intro beta member + obtain ⟨value, entry, checked⟩ := valid beta (ZFSet.mem_insert_of_mem alpha member) + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · have same := (ZFSet.pair_inj.1 equal).1 + exact False.elim (outside (same ▸ member)) + · exact ⟨value, old, checked⟩ + · obtain ⟨value, entry, checked⟩ := valid alpha (ZFSet.mem_insert alpha stages) + have same := (function.insert outside data).unique entry (ZFSet.mem_insert _ _) + exact same ▸ checked + · rintro ⟨prior, current⟩ beta member + rcases ZFSet.mem_insert_iff.1 member with rfl | member + · exact ⟨data, ZFSet.mem_insert _ _, current⟩ + · obtain ⟨value, entry, checked⟩ := prior beta member + exact ⟨value, ZFSet.mem_insert_of_mem _ entry, checked⟩ + +theorem stageTwoConditionCode_levels_congr (M : TransitiveGround.{u}) + (d : Fin 15 → ZFSet.{u}) (first second alpha z : ZFSet.{u}) + (cuts : ∀ A, assignmentCut first alpha A = assignmentCut second alpha A) : + StageTwoConditionCode M first alpha d z ↔ StageTwoConditionCode M second alpha d z := by + constructor + · rintro ⟨row, A, equal, member, tests⟩ + rw [cuts A] at member tests + exact ⟨row, A, equal, member, tests⟩ + · rintro ⟨row, A, equal, member, tests⟩ + rw [← cuts A] at member tests + exact ⟨row, A, equal, member, tests⟩ + +theorem packedSuccessorConditionCode_levels_congr (M : TransitiveGround.{u}) + (first second alpha data z : ZFSet.{u}) + (cuts : ∀ A, assignmentCut first alpha A = assignmentCut second alpha A) : + PackedSuccessorConditionCode M first alpha data z ↔ + PackedSuccessorConditionCode M second alpha data z := by + constructor + · rintro ⟨d, equal, checked⟩ + exact ⟨d, equal, (stageTwoConditionCode_levels_congr M d first second alpha z cuts).1 checked⟩ + · rintro ⟨d, equal, checked⟩ + exact ⟨d, equal, (stageTwoConditionCode_levels_congr M d first second alpha z cuts).2 checked⟩ + +theorem forcingHistoryConditionCode_levels_congr (M : TransitiveGround.{u}) + (stages history first second z : ZFSet.{u}) + (cuts : ∀ alpha ∈ stages, ∀ A, assignmentCut first alpha A = assignmentCut second alpha A) : + ForcingHistoryConditionCode M stages history first z ↔ + ForcingHistoryConditionCode M stages history second z := by + constructor + · intro valid alpha member + obtain ⟨data, entry, checked⟩ := valid alpha member + exact ⟨data, entry, (packedSuccessorConditionCode_levels_congr M first second alpha data z + (cuts alpha member)).1 checked⟩ + · intro valid alpha member + obtain ⟨data, entry, checked⟩ := valid alpha member + exact ⟨data, entry, (packedSuccessorConditionCode_levels_congr M first second alpha data z + (cuts alpha member)).2 checked⟩ + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def ForcingHistoryLevelCoverage (stages history levels : ZFSet.{u}) : Prop := + ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + ZFSet.pair (stageOneAssignment t u w) beta ∈ levels + +theorem forcingHistoryConditionCode_cut_iff (M : TransitiveGround.{u}) + (stages history levels alpha row A : ZFSet.{u}) + (below : ∀ beta ∈ stages, beta ⊆ alpha) + (covered : ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + ∃ xi ∈ alpha, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : + ForcingHistoryConditionCode M stages history levels (ZFSet.pair row (assignmentCut levels alpha A)) ↔ + ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) := by + constructor + · intro valid beta member + obtain ⟨data, entry, d, equal, tests⟩ := valid beta member + rw [equal] at entry + refine ⟨refinementFormulaDataCode d, entry, d, rfl, ?_⟩ + exact (stageTwoConditionCode_cut_iff M d levels beta alpha row A (below beta member) + (covered beta member d entry)).1 tests + · intro valid beta member + obtain ⟨data, entry, d, equal, tests⟩ := valid beta member + rw [equal] at entry + refine ⟨refinementFormulaDataCode d, entry, d, rfl, ?_⟩ + exact (stageTwoConditionCode_cut_iff M d levels beta alpha row A (below beta member) + (covered beta member d entry)).2 tests + +theorem forcingHistoryConditionCode_ordinalCut_iff (M : TransitiveGround.{u}) + (stages history levels alpha row A : ZFSet.{u}) + (ordinal : ordinalSetProperty alpha) (subset : stages ⊆ alpha) + (coverage : ForcingHistoryLevelCoverage stages history levels) : + ForcingHistoryConditionCode M stages history levels (ZFSet.pair row (assignmentCut levels alpha A)) ↔ + ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) := by + apply forcingHistoryConditionCode_cut_iff M stages history levels alpha row A + · intro beta member xi hxi + exact ordinal.1 beta (subset member) xi hxi + · intro beta member d entry t ht u hu w hw + exact ⟨beta, subset member, coverage beta member d entry t ht u hu w hw⟩ + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +universe u + +def forcingHistoryRawTests (M : TransitiveGround.{u}) + (history levels beta row A : ZFSet.{u}) : Prop := + ∀ d : Fin 15 → ZFSet.{u}, ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels beta A)) + +theorem forcingHistoryConditionCode_pair_decomposition {M : TransitiveGround.{u}} + {stages history levels : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (decoded : ∀ beta data, ZFSet.pair beta data ∈ history → + ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) + (row A : ZFSet.{u}) : + ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) ↔ + FlatHistoryCuts stages (refinementDataHistoryField stages history 7) levels row A ∧ + ∀ beta ∈ stages, forcingHistoryRawTests M history levels beta row A := by + have carriers := refinementDataHistoryField_function function decoded 7 + constructor + · intro valid + have lookup := forcingHistoryConditionCode_lookup_iff function |>.1 valid + constructor + · intro beta hbeta + obtain ⟨data, entry⟩ := function.total hbeta + obtain ⟨d, rfl⟩ := decoded beta data entry + have checked := (packedSuccessorConditionCode_code_iff M levels beta d _).1 + (lookup beta hbeta _ entry) + exact ⟨d 7, (refinementDataHistoryField_entry function d entry 7 _).2 rfl, + ((stageTwoConditionCode_pair_iff M d levels beta row A).1 checked).1⟩ + · intro beta hbeta d entry + have checked := (packedSuccessorConditionCode_code_iff M levels beta d _).1 + (lookup beta hbeta _ entry) + exact ((stageTwoConditionCode_pair_iff M d levels beta row A).1 checked).2 + · rintro ⟨cuts, tests⟩ beta hbeta + obtain ⟨data, entry⟩ := function.total hbeta + obtain ⟨d, rfl⟩ := decoded beta data entry + refine ⟨_, entry, (packedSuccessorConditionCode_code_iff M levels beta d _).2 ?_⟩ + apply (stageTwoConditionCode_pair_iff M d levels beta row A).2 + exact ⟨(flatHistoryCuts_lookup_iff carriers).1 cuts beta hbeta (d 7) + ((refinementDataHistoryField_entry function d entry 7 _).2 rfl), tests beta hbeta d entry⟩ + +theorem forcingHistoryRawTests_cut_iff (M : TransitiveGround.{u}) + (history levels beta gamma row A : ZFSet.{u}) (below : beta ⊆ gamma) + (covered : ∀ d : Fin 15 → ZFSet.{u}, ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + ∃ xi ∈ gamma, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : + forcingHistoryRawTests M history levels beta row (assignmentCut levels gamma A) ↔ + forcingHistoryRawTests M history levels beta row A := by + unfold forcingHistoryRawTests + rw [assignmentCut_nested below] + apply forall_congr' + intro d + apply forall_congr' + intro entry + exact stageOneRawTests_cut_iff M d levels gamma A _ (covered d entry) + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GeneratedMeetFilters.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GeneratedMeetFilters.lean index 9ec13e851ee4c9f025c4b23ec8b0cd9ec6087031..2f9225d0a94afaf1efac8ac5f4e63440940cf513 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GeneratedMeetFilters.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GeneratedMeetFilters.lean @@ -1,80 +1,80 @@ -import Mathlib.Logic.Relation -import OAI.SetTheory.PartitionPrinciple.Geometry.Compression - -namespace OAI - -section - -namespace PartitionPilot -universe u -variable {α : Type u} (P : MeetOrder α) (A : α → Prop) - -theorem MeetOrder.meet_assoc (a b c : α) : - P.meet (P.meet a b) c = P.meet a (P.meet b c) := by - apply P.antisymm - · exact P.le_meet - (P.trans (P.meet_le_left _ _) (P.meet_le_left _ _)) - (P.le_meet (P.trans (P.meet_le_left _ _) (P.meet_le_right _ _)) (P.meet_le_right _ _)) - · exact P.le_meet - (P.le_meet (P.meet_le_left _ _) (P.trans (P.meet_le_right _ _) (P.meet_le_left _ _))) - (P.trans (P.meet_le_right _ _) (P.meet_le_right _ _)) - -def meetGeneratorStep (x y : α) : Prop := ∃ a, A a ∧ y = P.meet x a - -def generatedMeetPredicate (x : α) : Prop := - ∃ a, A a ∧ ∃ b, Relation.ReflTransGen (meetGeneratorStep P A) a b ∧ P.le b x - -theorem meetGeneratorPath_left {x y : α} - (path : Relation.ReflTransGen (meetGeneratorStep P A) x y) (z : α) : - Relation.ReflTransGen (meetGeneratorStep P A) (P.meet z x) (P.meet z y) := by - apply path.lift (P.meet z) - intro x y step - obtain ⟨a, ha, rfl⟩ := step - exact ⟨a, ha, (P.meet_assoc z x a).symm⟩ - -theorem generatedMeetPredicate_contains {x : α} (hx : A x) : generatedMeetPredicate P A x := - ⟨x, hx, x, .refl, P.refl x⟩ - -def generatedMeetFilter (nonempty : ∃ a, A a) : Compression.MeetFilter P where - mem := generatedMeetPredicate P A - nonempty := by - obtain ⟨a, ha⟩ := nonempty - exact ⟨a, generatedMeetPredicate_contains P A ha⟩ - upward := by - rintro x y ⟨a, ha, b, path, lower⟩ xy - exact ⟨a, ha, b, path, P.trans lower xy⟩ - closed_meet := by - rintro x y ⟨a, ha, b, first, bx⟩ ⟨c, hc, d, second, dy⟩ - refine ⟨a, ha, P.meet b d, ?_, ?_⟩ - · exact (first.tail ⟨c, hc, rfl⟩).trans (meetGeneratorPath_left P A second b) - · exact P.le_meet (P.trans (P.meet_le_left b d) bx) (P.trans (P.meet_le_right b d) dy) - -theorem generatedMeetPredicate_least (F : Compression.MeetFilter P) - (contains : ∀ a, A a → F.mem a) {x : α} (hx : generatedMeetPredicate P A x) : F.mem x := by - obtain ⟨a, ha, b, path, lower⟩ := hx - have hb : F.mem b := by - clear lower - induction path with - | refl => exact contains a ha - | tail path step ih => - obtain ⟨c, hc, rfl⟩ := step - exact F.closed_meet ih (contains c hc) - exact F.upward hb lower - -theorem generatedMeetPredicate_lower_bound (e : α) (above : ∀ a, A a → P.le e a) - {x : α} (hx : generatedMeetPredicate P A x) : P.le e x := by - obtain ⟨a, ha, b, path, lower⟩ := hx - have hb : P.le e b := by - clear lower - induction path with - | refl => exact above a ha - | tail path step ih => - obtain ⟨c, hc, rfl⟩ := step - exact P.le_meet ih (above c hc) - exact P.trans hb lower - -end PartitionPilot - -end - -end OAI +import Mathlib.Logic.Relation +import OAI.SetTheory.PartitionPrinciple.Geometry.Compression + +namespace OAI + +section + +namespace PartitionPilot +universe u +variable {α : Type u} (P : MeetOrder α) (A : α → Prop) + +theorem MeetOrder.meet_assoc (a b c : α) : + P.meet (P.meet a b) c = P.meet a (P.meet b c) := by + apply P.antisymm + · exact P.le_meet + (P.trans (P.meet_le_left _ _) (P.meet_le_left _ _)) + (P.le_meet (P.trans (P.meet_le_left _ _) (P.meet_le_right _ _)) (P.meet_le_right _ _)) + · exact P.le_meet + (P.le_meet (P.meet_le_left _ _) (P.trans (P.meet_le_right _ _) (P.meet_le_left _ _))) + (P.trans (P.meet_le_right _ _) (P.meet_le_right _ _)) + +def meetGeneratorStep (x y : α) : Prop := ∃ a, A a ∧ y = P.meet x a + +def generatedMeetPredicate (x : α) : Prop := + ∃ a, A a ∧ ∃ b, Relation.ReflTransGen (meetGeneratorStep P A) a b ∧ P.le b x + +theorem meetGeneratorPath_left {x y : α} + (path : Relation.ReflTransGen (meetGeneratorStep P A) x y) (z : α) : + Relation.ReflTransGen (meetGeneratorStep P A) (P.meet z x) (P.meet z y) := by + apply path.lift (P.meet z) + intro x y step + obtain ⟨a, ha, rfl⟩ := step + exact ⟨a, ha, (P.meet_assoc z x a).symm⟩ + +theorem generatedMeetPredicate_contains {x : α} (hx : A x) : generatedMeetPredicate P A x := + ⟨x, hx, x, .refl, P.refl x⟩ + +def generatedMeetFilter (nonempty : ∃ a, A a) : Compression.MeetFilter P where + mem := generatedMeetPredicate P A + nonempty := by + obtain ⟨a, ha⟩ := nonempty + exact ⟨a, generatedMeetPredicate_contains P A ha⟩ + upward := by + rintro x y ⟨a, ha, b, path, lower⟩ xy + exact ⟨a, ha, b, path, P.trans lower xy⟩ + closed_meet := by + rintro x y ⟨a, ha, b, first, bx⟩ ⟨c, hc, d, second, dy⟩ + refine ⟨a, ha, P.meet b d, ?_, ?_⟩ + · exact (first.tail ⟨c, hc, rfl⟩).trans (meetGeneratorPath_left P A second b) + · exact P.le_meet (P.trans (P.meet_le_left b d) bx) (P.trans (P.meet_le_right b d) dy) + +theorem generatedMeetPredicate_least (F : Compression.MeetFilter P) + (contains : ∀ a, A a → F.mem a) {x : α} (hx : generatedMeetPredicate P A x) : F.mem x := by + obtain ⟨a, ha, b, path, lower⟩ := hx + have hb : F.mem b := by + clear lower + induction path with + | refl => exact contains a ha + | tail path step ih => + obtain ⟨c, hc, rfl⟩ := step + exact F.closed_meet ih (contains c hc) + exact F.upward hb lower + +theorem generatedMeetPredicate_lower_bound (e : α) (above : ∀ a, A a → P.le e a) + {x : α} (hx : generatedMeetPredicate P A x) : P.le e x := by + obtain ⟨a, ha, b, path, lower⟩ := hx + have hb : P.le e b := by + clear lower + induction path with + | refl => exact above a ha + | tail path step ih => + obtain ⟨c, hc, rfl⟩ := step + exact P.le_meet ih (above c hc) + exact P.trans hb lower + +end PartitionPilot + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GenericPartialFunctions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GenericPartialFunctions.lean index 280b3839f8c86e80a8004671fa4915c2160d9933..5f0d40b9fc4538a495bd21e32adad3f9d9c4f04f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GenericPartialFunctions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GenericPartialFunctions.lean @@ -1,505 +1,505 @@ -import Mathlib.SetTheory.Cardinal.Arithmetic - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -universe u -variable {P : Type u} [Preorder P] - -def Dense (D : Set P) : Prop := ∀ p, ∃ q, q ≤ p ∧ q ∈ D - -def DownwardClosed (D : Set P) : Prop := ∀ ⦃p q⦄, q ≤ p → p ∈ D → q ∈ D - -def CountablyClosed (P : Type u) [Preorder P] : Prop := - ∀ chain : Nat → P, Antitone chain → ∃ lower, ∀ n, lower ≤ chain n - -structure ConditionFilter (P : Type u) [Preorder P] where - mem : P → Prop - nonempty : ∃ p, mem p - upward : ∀ ⦃p q⦄, mem p → p ≤ q → mem q - directed : ∀ ⦃p q⦄, mem p → mem q → ∃ r, mem r ∧ r ≤ p ∧ r ≤ q - -namespace ConditionFilter - -def Meets (F : ConditionFilter P) (D : Set P) : Prop := ∃ p, F.mem p ∧ p ∈ D - -def GenericFor (F : ConditionFilter P) (family : Set (Set P)) : Prop := - ∀ D ∈ family, Dense D → F.Meets D - -theorem top_mem [OrderTop P] (F : ConditionFilter P) : F.mem ⊤ := by - rcases F.nonempty with ⟨p, hp⟩ - exact F.upward hp le_top - -theorem compatible (F : ConditionFilter P) {p q : P} (hp : F.mem p) (hq : F.mem q) : - ∃ r, r ≤ p ∧ r ≤ q := by - rcases F.directed hp hq with ⟨r, _, rp, rq⟩ - exact ⟨r, rp, rq⟩ - -end ConditionFilter - -end - - - -section - -universe u v - -structure CountableCondition (I : Type u) (A : Type v) where - value : I → Option A - countable_domain : Set.Countable {i | value i ≠ none} - -namespace CountableCondition -variable {I : Type u} {A : Type v} - -theorem ext {p q : CountableCondition I A} (values : p.value = q.value) : p = q := by - cases p - cases q - cases values - rfl - -instance : PartialOrder (CountableCondition I A) where - le p q := ∀ i a, q.value i = some a → p.value i = some a - le_refl _ _ _ h := h - le_trans _ _ _ h1 h2 i a h := h1 i a (h2 i a h) - le_antisymm p q hpq hqp := by - apply ext - funext i - cases hp : p.value i with - | none => - cases hq : q.value i with - | none => rfl - | some a => - have impossible := hpq i a hq - rw [hp] at impossible - contradiction - | some a => exact (hqp i a hp).symm - -def domain (p : CountableCondition I A) : Set I := {i | p.value i ≠ none} - -def empty : CountableCondition I A where - value _ := none - countable_domain := by simp - -instance : OrderTop (CountableCondition I A) where - top := empty - le_top p i a h := by cases h - -theorem value_eq_of_le {p q : CountableCondition I A} (le : p ≤ q) (i : I) - (defined : i ∈ q.domain) : p.value i = q.value i := by - cases h : q.value i with - | none => exact False.elim (defined h) - | some a => exact le i a h - -theorem domain_mono {p q : CountableCondition I A} (le : p ≤ q) : q.domain ⊆ p.domain := by - intro i hi - change p.value i ≠ none - rw [value_eq_of_le le i hi] - exact hi - -noncomputable def assign (p : CountableCondition I A) (i : I) (a : A) : CountableCondition I A := by - classical - refine ⟨fun j => if j = i then some a else p.value j, ?_⟩ - apply (p.countable_domain.insert i).mono - intro j hj - by_cases eq : j = i - · exact Or.inl eq - · exact Or.inr (by simpa only [Set.mem_ofPred_eq, ite_eq_right eq] using hj) - -theorem assign_same (p : CountableCondition I A) (i : I) (a : A) : - (p.assign i a).value i = some a := by - classical - simp [assign] - -theorem assign_other (p : CountableCondition I A) (i j : I) (a : A) (ne : j ≠ i) : - (p.assign i a).value j = p.value j := by - classical - simp only [assign, ite_eq_right ne] - -theorem assign_le (p : CountableCondition I A) (i : I) (a : A) (fresh : p.value i = none) : - p.assign i a ≤ p := by - intro j b hb - by_cases eq : j = i - · subst j - rw [fresh] at hb - contradiction - · rw [assign_other p i j a eq] - exact hb - -def definedAt (i : I) : Set (CountableCondition I A) := {p | p.value i ≠ none} - -theorem definedAt_downwardClosed (i : I) : DownwardClosed (definedAt (A := A) i) := by - intro p q le hp - exact domain_mono le hp - -theorem definedAt_dense [Nonempty A] (i : I) : Dense (definedAt (A := A) i) := by - classical - intro p - by_cases defined : p.value i ≠ none - · exact ⟨p, le_rfl, defined⟩ - · have fresh : p.value i = none := not_ne_iff.1 defined - let a : A := Classical.choice inferInstance - refine ⟨p.assign i a, assign_le p i a fresh, ?_⟩ - change (p.assign i a).value i ≠ none - rw [assign_same] - exact Option.some_ne_none _ - -theorem compatible_values {p q : CountableCondition I A} (compatible : ∃ r, r ≤ p ∧ r ≤ q) - {i : I} {a b : A} (ha : p.value i = some a) (hb : q.value i = some b) : a = b := by - rcases compatible with ⟨r, rp, rq⟩ - exact Option.some.inj ((rp i a ha).symm.trans (rq i b hb)) - -end CountableCondition -end - - - -section - -universe u -variable {P : Type u} [Preorder P] - -theorem exists_filter_meeting_sequence (p : P) (D : Nat → Set P) - (dense : ∀ n, Dense (D n)) : - ∃ H : ConditionFilter P, H.mem p ∧ ∀ n, H.Meets (D n) := by - classical - let next (n : Nat) (q : P) : P := Classical.choose (dense n q) - have next_le (n : Nat) (q : P) : next n q ≤ q := (Classical.choose_spec (dense n q)).1 - have next_mem (n : Nat) (q : P) : next n q ∈ D n := (Classical.choose_spec (dense n q)).2 - let chain : Nat → P := Nat.rec p next - have step (n : Nat) : chain (n + 1) ≤ chain n := next_le n (chain n) - have down : Antitone chain := antitone_nat_of_succ_le step - let H : ConditionFilter P := { - mem := fun q => ∃ n, chain n ≤ q - nonempty := ⟨p, 0, le_rfl⟩ - upward := by - rintro q r ⟨n, nq⟩ qr - exact ⟨n, nq.trans qr⟩ - directed := by - rintro q r ⟨n, nq⟩ ⟨m, mr⟩ - exact ⟨chain (max n m), ⟨max n m, le_rfl⟩, - (down (le_max_left n m)).trans nq, (down (le_max_right n m)).trans mr⟩ } - exact ⟨H, ⟨0, le_rfl⟩, fun n => ⟨chain (n + 1), ⟨n + 1, le_rfl⟩, next_mem n (chain n)⟩⟩ - -theorem exists_generic_for_countable_family (p : P) (family : Set (Set P)) - (small : family.Countable) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor family := by - classical - let listed := Set.enumerateCountable small (Set.univ : Set P) - let D (n : Nat) : Set P := if Dense (listed n) then listed n else Set.univ - have dense (n : Nat) : Dense (D n) := by - dsimp [D] - split_ifs with h - · exact h - · exact fun q => ⟨q, le_rfl, Set.mem_univ q⟩ - obtain ⟨H, hp, meets⟩ := exists_filter_meeting_sequence p D dense - refine ⟨H, hp, ?_⟩ - intro E hE hDense - obtain ⟨n, hn⟩ := Set.subset_range_enumerate small (Set.univ : Set P) hE - have eq : D n = E := by - dsimp [D, listed] - simp only [hn, ite_eq_left hDense] - exact eq ▸ meets n - - - - - - -def Compatible (p q : P) : Prop := ∃ r, r ≤ p ∧ r ≤ q - -def DenseBelow (p : P) (D : Set P) : Prop := ∀ q, q ≤ p → ∃ r, r ≤ q ∧ r ∈ D - -def Localized (p : P) (D : Set P) : Set P := {q | q ∈ D ∨ ¬ Compatible q p} - -theorem localized_dense {p : P} {D : Set P} (dense : DenseBelow p D) : Dense (Localized p D) := by - classical - intro q - by_cases compat : Compatible q p - · obtain ⟨r, rq, rp⟩ := compat - obtain ⟨t, tr, ht⟩ := dense r rp - exact ⟨t, tr.trans rq, Or.inl ht⟩ - · exact ⟨q, le_rfl, Or.inr compat⟩ - -theorem ConditionFilter.meets_below (H : ConditionFilter P) {family : Set (Set P)} - (generic : H.GenericFor family) {p : P} (hp : H.mem p) {D : Set P} - (registered : Localized p D ∈ family) (dense : DenseBelow p D) : H.Meets D := by - obtain ⟨q, hq, good | bad⟩ := generic _ registered (localized_dense dense) - · exact ⟨q, hq, good⟩ - · exact False.elim (bad (H.compatible hq hp)) - -theorem denseBelow_mono {p : P} {D E : Set P} (dense : DenseBelow p D) (included : D ⊆ E) : - DenseBelow p E := by - intro q qp - obtain ⟨r, rq, hr⟩ := dense q qp - exact ⟨r, rq, included hr⟩ - - - - - - -theorem dense_countable_intersection (closed : CountablyClosed P) - (D : Nat → Set P) (dense : ∀ n, Dense (D n)) - (open_ : ∀ n, DownwardClosed (D n)) : Dense {p | ∀ n, p ∈ D n} := by - classical - intro p - let next (n : Nat) (q : P) : P := Classical.choose (dense n q) - have next_le (n : Nat) (q : P) : next n q ≤ q := (Classical.choose_spec (dense n q)).1 - have next_mem (n : Nat) (q : P) : next n q ∈ D n := (Classical.choose_spec (dense n q)).2 - let chain : Nat → P := Nat.rec p next - have step (n : Nat) : chain (n + 1) ≤ chain n := next_le n (chain n) - rcases closed chain (antitone_nat_of_succ_le step) with ⟨q, lower⟩ - refine ⟨q, lower 0, ?_⟩ - intro n - exact open_ n (lower (n + 1)) (next_mem n (chain n)) - -theorem dense_simultaneous_witnesses (closed : CountablyClosed P) - {A : Nat → Type*} (R : P → (n : Nat) → A n → Prop) - (monotone : ∀ ⦃p q⦄, q ≤ p → ∀ n a, R p n a → R q n a) - (dense : ∀ n, Dense {p | ∃ a, R p n a}) : - Dense {p | ∃ f : ∀ n, A n, ∀ n, R p n (f n)} := by - intro p - rcases dense_countable_intersection closed (fun n => {p | ∃ a, R p n a}) dense - (fun n _ _ le ⟨a, ha⟩ => ⟨a, monotone le n a ha⟩) p with ⟨q, qp, all⟩ - exact ⟨q, qp, Classical.axiomOfChoice all⟩ - -end - - - -namespace CountableCondition - -universe u v -variable {I : Type u} {A : Type v} - -def Agrees (p q : CountableCondition I A) : Prop := - ∀ i a b, p.value i = some a → q.value i = some b → a = b - -theorem agrees_symm {p q : CountableCondition I A} (h : Agrees p q) : Agrees q p := - fun i a b ha hb => (h i b a hb ha).symm - -noncomputable def merge (p q : CountableCondition I A) : CountableCondition I A where - value i := match p.value i with - | some a => some a - | none => q.value i - countable_domain := by - apply (p.countable_domain.union q.countable_domain).mono - intro i hi - cases hp : p.value i with - | none => exact Or.inr (by simpa only [Set.mem_ofPred_eq, hp] using hi) - | some a => exact Or.inl (by - change p.value i ≠ none - rw [hp] - exact Option.some_ne_none _) - -theorem merge_le_left (p q : CountableCondition I A) : merge p q ≤ p := by - intro i a ha - change (match p.value i with | some a => some a | none => q.value i) = some a - rw [ha] - -theorem merge_le_right {p q : CountableCondition I A} (agree : Agrees p q) : merge p q ≤ q := by - intro i b hb - change (match p.value i with | some a => some a | none => q.value i) = some b - cases hp : p.value i with - | none => exact hb - | some a => exact congrArg some (agree i a b hp hb) - -theorem merge_value {p q : CountableCondition I A} (agree : Agrees p q) (i : I) (a : A) : - (merge p q).value i = some a ↔ p.value i = some a ∨ q.value i = some a := by - constructor - · intro h - cases hp : p.value i with - | none => exact Or.inr (by simpa only [merge, hp] using h) - | some b => exact Or.inl (by simpa only [merge, hp] using h) - · rintro (hp | hq) - · exact merge_le_left p q i a hp - · exact merge_le_right agree i a hq - -theorem merge_agrees {p q r : CountableCondition I A} (pq : Agrees p q) - (pr : Agrees p r) (qr : Agrees q r) : Agrees (merge p q) r := by - intro i a b hab hr - obtain hp | hq := (merge_value pq i a).1 hab - · exact pr i a b hp hr - · exact qr i a b hq hr - -theorem three_agree_common {p q r : CountableCondition I A} - (pq : Agrees p q) (pr : Agrees p r) (qr : Agrees q r) : - ∃ t, t ≤ p ∧ t ≤ q ∧ t ≤ r := by - refine ⟨merge (merge p q) r, ?_, ?_, merge_le_right (merge_agrees pq pr qr)⟩ - · exact (merge_le_left _ _).trans (merge_le_left _ _) - · exact (merge_le_left _ _).trans (merge_le_right pq) - - - - - - -noncomputable def unionValue (chain : Nat → CountableCondition I A) (i : I) : Option A := by - classical - exact if h : ∃ a, ∃ n, (chain n).value i = some a then some (Classical.choose h) else none - -theorem unionValue_domain (chain : Nat → CountableCondition I A) : - {i | unionValue chain i ≠ none} ⊆ ⋃ n, (chain n).domain := by - classical - intro i hi - by_cases h : ∃ a, ∃ n, (chain n).value i = some a - · rcases h with ⟨a, n, ha⟩ - apply Set.mem_iUnion.2 ⟨n, ?_⟩ - change (chain n).value i ≠ none - rw [ha] - exact Option.some_ne_none _ - · have value : unionValue chain i = none := by simp only [unionValue, dite_eq_right h] - exact False.elim (hi value) - -theorem unionValue_extends (chain : Nat → CountableCondition I A) (decreasing : Antitone chain) - (n : Nat) (i : I) (a : A) (value : (chain n).value i = some a) : - unionValue chain i = some a := by - classical - have h : ∃ a, ∃ n, (chain n).value i = some a := ⟨a, n, value⟩ - rw [unionValue, dite_eq_left h] - rcases Classical.choose_spec h with ⟨m, hm⟩ - have compatible : ∃ r, r ≤ chain m ∧ r ≤ chain n := - ⟨chain (max m n), decreasing (le_max_left _ _), decreasing (le_max_right _ _)⟩ - exact congrArg some (compatible_values compatible hm value) - -noncomputable def chainUnion (chain : Nat → CountableCondition I A) : CountableCondition I A where - value := unionValue chain - countable_domain := (Set.countable_iUnion (fun n => (chain n).countable_domain)).mono - (unionValue_domain chain) - -theorem chainUnion_le (chain : Nat → CountableCondition I A) (decreasing : Antitone chain) - (n : Nat) : chainUnion chain ≤ chain n := - unionValue_extends chain decreasing n - -theorem countablyClosed : CountablyClosed (CountableCondition I A) := - fun chain decreasing => ⟨chainUnion chain, chainUnion_le chain decreasing⟩ - -end CountableCondition - - - -section - -universe u v - -structure DecisionSystem (P : Type u) [Preorder P] (A : Nat → Type v) where - decides : P → (n : Nat) → A n → Prop - persistent : ∀ ⦃p q⦄, q ≤ p → ∀ n a, decides p n a → decides q n a - unique : ∀ p n a b, decides p n a → decides p n b → a = b - dense : ∀ n, Dense {p | ∃ a, decides p n a} - -namespace DecisionSystem -variable {P : Type u} [Preorder P] {A : Nat → Type v} (d : DecisionSystem P A) - -def commonDecisions : Set P := {p | ∃ f : ∀ n, A n, ∀ n, d.decides p n (f n)} - -theorem commonDecisions_dense (closed : CountablyClosed P) : Dense d.commonDecisions := - dense_simultaneous_witnesses closed d.decides d.persistent d.dense - -theorem commonDecisions_downwardClosed : DownwardClosed d.commonDecisions := by - rintro p q le ⟨f, hf⟩ - exact ⟨f, fun n => d.persistent le n (f n) (hf n)⟩ - -def Realizes (F : ConditionFilter P) (f : ∀ n, A n) : Prop := - ∀ n, ∃ p, F.mem p ∧ d.decides p n (f n) - -theorem compatible_decisions (F : ConditionFilter P) {p q : P} (hp : F.mem p) (hq : F.mem q) - (n : Nat) (a b : A n) (ha : d.decides p n a) (hb : d.decides q n b) : a = b := by - rcases F.directed hp hq with ⟨r, _, rp, rq⟩ - exact d.unique r n a b (d.persistent rp n a ha) (d.persistent rq n b hb) - -theorem realizes_unique (F : ConditionFilter P) {f g : ∀ n, A n} - (hf : d.Realizes F f) (hg : d.Realizes F g) : f = g := by - funext n - rcases hf n with ⟨p, hp, ha⟩ - rcases hg n with ⟨q, hq, hb⟩ - exact d.compatible_decisions F hp hq n (f n) (g n) ha hb - -theorem common_condition_decides (F : ConditionFilter P) (meets : F.Meets d.commonDecisions) - (f : ∀ n, A n) (realizes : d.Realizes F f) : - ∃ p, F.mem p ∧ ∀ n, d.decides p n (f n) := by - rcases meets with ⟨p, hp, g, hg⟩ - have eq : g = f := d.realizes_unique F (fun n => ⟨p, hp, hg n⟩) realizes - exact ⟨p, hp, eq ▸ hg⟩ - -theorem generic_condition_decides (closed : CountablyClosed P) (F : ConditionFilter P) - (family : Set (Set P)) (generic : F.GenericFor family) (present : d.commonDecisions ∈ family) - (f : ∀ n, A n) (realizes : d.Realizes F f) : - ∃ p, F.mem p ∧ ∀ n, d.decides p n (f n) := - d.common_condition_decides F (generic _ present (d.commonDecisions_dense closed)) f realizes - -end DecisionSystem -end - - - -namespace CountableCondition - -universe u v -variable {I : Type u} {A : Type v} (F : ConditionFilter (CountableCondition I A)) - -theorem exists_value (meets : ∀ i, F.Meets (definedAt i)) (i : I) : - ∃ a, ∃ p, F.mem p ∧ p.value i = some a := by - rcases meets i with ⟨p, hp, defined⟩ - cases value : p.value i with - | none => exact False.elim (defined value) - | some a => exact ⟨a, p, hp, value⟩ - -noncomputable def readValue (meets : ∀ i, F.Meets (definedAt i)) (i : I) : A := - Classical.choose (exists_value F meets i) - -theorem readValue_realized (meets : ∀ i, F.Meets (definedAt i)) (i : I) : - ∃ p, F.mem p ∧ p.value i = some (readValue F meets i) := - Classical.choose_spec (exists_value F meets i) - -theorem readValue_of_condition (meets : ∀ i, F.Meets (definedAt i)) - {p : CountableCondition I A} (hp : F.mem p) {i : I} {a : A} (value : p.value i = some a) : - readValue F meets i = a := by - rcases readValue_realized F meets i with ⟨q, hq, read⟩ - exact compatible_values (F.compatible hq hp) read value - -theorem readValue_iff (meets : ∀ i, F.Meets (definedAt i)) (i : I) (a : A) : - readValue F meets i = a ↔ ∃ p, F.mem p ∧ p.value i = some a := by - constructor - · intro eq - exact eq ▸ readValue_realized F meets i - · rintro ⟨p, hp, value⟩ - exact readValue_of_condition F meets hp value - -omit F in -def coordinateDecisions [Nonempty A] (index : Nat → I) : - DecisionSystem (CountableCondition I A) (fun _ => A) where - decides p n a := p.value (index n) = some a - persistent := by - intro p q le n a value - exact le (index n) a value - unique _ _ _ _ h1 h2 := Option.some.inj (h1.symm.trans h2) - dense n := by - intro p - rcases definedAt_dense (A := A) (index n) p with ⟨q, qp, defined⟩ - cases value : q.value (index n) with - | none => exact False.elim (defined value) - | some a => exact ⟨q, qp, a, value⟩ - -omit F in -theorem coordinate_commonDecisions_dense [Nonempty A] (index : Nat → I) : - Dense (coordinateDecisions (A := A) index).commonDecisions := - (coordinateDecisions index).commonDecisions_dense countablyClosed - -theorem readValue_sequence_decided [Nonempty A] (meets : ∀ i, F.Meets (definedAt i)) - (index : Nat → I) (family : Set (Set (CountableCondition I A))) (generic : F.GenericFor family) - (present : (coordinateDecisions (A := A) index).commonDecisions ∈ family) : - ∃ p, F.mem p ∧ ∀ n, p.value (index n) = some (readValue F meets (index n)) := - (coordinateDecisions index).generic_condition_decides countablyClosed F family generic present - (fun n => readValue F meets (index n)) (fun n => readValue_realized F meets (index n)) - -end CountableCondition - -end PartitionPilot.Forcing - -end OAI +import Mathlib.SetTheory.Cardinal.Arithmetic + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +universe u +variable {P : Type u} [Preorder P] + +def Dense (D : Set P) : Prop := ∀ p, ∃ q, q ≤ p ∧ q ∈ D + +def DownwardClosed (D : Set P) : Prop := ∀ ⦃p q⦄, q ≤ p → p ∈ D → q ∈ D + +def CountablyClosed (P : Type u) [Preorder P] : Prop := + ∀ chain : Nat → P, Antitone chain → ∃ lower, ∀ n, lower ≤ chain n + +structure ConditionFilter (P : Type u) [Preorder P] where + mem : P → Prop + nonempty : ∃ p, mem p + upward : ∀ ⦃p q⦄, mem p → p ≤ q → mem q + directed : ∀ ⦃p q⦄, mem p → mem q → ∃ r, mem r ∧ r ≤ p ∧ r ≤ q + +namespace ConditionFilter + +def Meets (F : ConditionFilter P) (D : Set P) : Prop := ∃ p, F.mem p ∧ p ∈ D + +def GenericFor (F : ConditionFilter P) (family : Set (Set P)) : Prop := + ∀ D ∈ family, Dense D → F.Meets D + +theorem top_mem [OrderTop P] (F : ConditionFilter P) : F.mem ⊤ := by + rcases F.nonempty with ⟨p, hp⟩ + exact F.upward hp le_top + +theorem compatible (F : ConditionFilter P) {p q : P} (hp : F.mem p) (hq : F.mem q) : + ∃ r, r ≤ p ∧ r ≤ q := by + rcases F.directed hp hq with ⟨r, _, rp, rq⟩ + exact ⟨r, rp, rq⟩ + +end ConditionFilter + +end + + + +section + +universe u v + +structure CountableCondition (I : Type u) (A : Type v) where + value : I → Option A + countable_domain : Set.Countable {i | value i ≠ none} + +namespace CountableCondition +variable {I : Type u} {A : Type v} + +theorem ext {p q : CountableCondition I A} (values : p.value = q.value) : p = q := by + cases p + cases q + cases values + rfl + +instance : PartialOrder (CountableCondition I A) where + le p q := ∀ i a, q.value i = some a → p.value i = some a + le_refl _ _ _ h := h + le_trans _ _ _ h1 h2 i a h := h1 i a (h2 i a h) + le_antisymm p q hpq hqp := by + apply ext + funext i + cases hp : p.value i with + | none => + cases hq : q.value i with + | none => rfl + | some a => + have impossible := hpq i a hq + rw [hp] at impossible + contradiction + | some a => exact (hqp i a hp).symm + +def domain (p : CountableCondition I A) : Set I := {i | p.value i ≠ none} + +def empty : CountableCondition I A where + value _ := none + countable_domain := by simp + +instance : OrderTop (CountableCondition I A) where + top := empty + le_top p i a h := by cases h + +theorem value_eq_of_le {p q : CountableCondition I A} (le : p ≤ q) (i : I) + (defined : i ∈ q.domain) : p.value i = q.value i := by + cases h : q.value i with + | none => exact False.elim (defined h) + | some a => exact le i a h + +theorem domain_mono {p q : CountableCondition I A} (le : p ≤ q) : q.domain ⊆ p.domain := by + intro i hi + change p.value i ≠ none + rw [value_eq_of_le le i hi] + exact hi + +noncomputable def assign (p : CountableCondition I A) (i : I) (a : A) : CountableCondition I A := by + classical + refine ⟨fun j => if j = i then some a else p.value j, ?_⟩ + apply (p.countable_domain.insert i).mono + intro j hj + by_cases eq : j = i + · exact Or.inl eq + · exact Or.inr (by simpa only [Set.mem_ofPred_eq, ite_eq_right eq] using hj) + +theorem assign_same (p : CountableCondition I A) (i : I) (a : A) : + (p.assign i a).value i = some a := by + classical + simp [assign] + +theorem assign_other (p : CountableCondition I A) (i j : I) (a : A) (ne : j ≠ i) : + (p.assign i a).value j = p.value j := by + classical + simp only [assign, ite_eq_right ne] + +theorem assign_le (p : CountableCondition I A) (i : I) (a : A) (fresh : p.value i = none) : + p.assign i a ≤ p := by + intro j b hb + by_cases eq : j = i + · subst j + rw [fresh] at hb + contradiction + · rw [assign_other p i j a eq] + exact hb + +def definedAt (i : I) : Set (CountableCondition I A) := {p | p.value i ≠ none} + +theorem definedAt_downwardClosed (i : I) : DownwardClosed (definedAt (A := A) i) := by + intro p q le hp + exact domain_mono le hp + +theorem definedAt_dense [Nonempty A] (i : I) : Dense (definedAt (A := A) i) := by + classical + intro p + by_cases defined : p.value i ≠ none + · exact ⟨p, le_rfl, defined⟩ + · have fresh : p.value i = none := not_ne_iff.1 defined + let a : A := Classical.choice inferInstance + refine ⟨p.assign i a, assign_le p i a fresh, ?_⟩ + change (p.assign i a).value i ≠ none + rw [assign_same] + exact Option.some_ne_none _ + +theorem compatible_values {p q : CountableCondition I A} (compatible : ∃ r, r ≤ p ∧ r ≤ q) + {i : I} {a b : A} (ha : p.value i = some a) (hb : q.value i = some b) : a = b := by + rcases compatible with ⟨r, rp, rq⟩ + exact Option.some.inj ((rp i a ha).symm.trans (rq i b hb)) + +end CountableCondition +end + + + +section + +universe u +variable {P : Type u} [Preorder P] + +theorem exists_filter_meeting_sequence (p : P) (D : Nat → Set P) + (dense : ∀ n, Dense (D n)) : + ∃ H : ConditionFilter P, H.mem p ∧ ∀ n, H.Meets (D n) := by + classical + let next (n : Nat) (q : P) : P := Classical.choose (dense n q) + have next_le (n : Nat) (q : P) : next n q ≤ q := (Classical.choose_spec (dense n q)).1 + have next_mem (n : Nat) (q : P) : next n q ∈ D n := (Classical.choose_spec (dense n q)).2 + let chain : Nat → P := Nat.rec p next + have step (n : Nat) : chain (n + 1) ≤ chain n := next_le n (chain n) + have down : Antitone chain := antitone_nat_of_succ_le step + let H : ConditionFilter P := { + mem := fun q => ∃ n, chain n ≤ q + nonempty := ⟨p, 0, le_rfl⟩ + upward := by + rintro q r ⟨n, nq⟩ qr + exact ⟨n, nq.trans qr⟩ + directed := by + rintro q r ⟨n, nq⟩ ⟨m, mr⟩ + exact ⟨chain (max n m), ⟨max n m, le_rfl⟩, + (down (le_max_left n m)).trans nq, (down (le_max_right n m)).trans mr⟩ } + exact ⟨H, ⟨0, le_rfl⟩, fun n => ⟨chain (n + 1), ⟨n + 1, le_rfl⟩, next_mem n (chain n)⟩⟩ + +theorem exists_generic_for_countable_family (p : P) (family : Set (Set P)) + (small : family.Countable) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor family := by + classical + let listed := Set.enumerateCountable small (Set.univ : Set P) + let D (n : Nat) : Set P := if Dense (listed n) then listed n else Set.univ + have dense (n : Nat) : Dense (D n) := by + dsimp [D] + split_ifs with h + · exact h + · exact fun q => ⟨q, le_rfl, Set.mem_univ q⟩ + obtain ⟨H, hp, meets⟩ := exists_filter_meeting_sequence p D dense + refine ⟨H, hp, ?_⟩ + intro E hE hDense + obtain ⟨n, hn⟩ := Set.subset_range_enumerate small (Set.univ : Set P) hE + have eq : D n = E := by + dsimp [D, listed] + simp only [hn, ite_eq_left hDense] + exact eq ▸ meets n + + + + + + +def Compatible (p q : P) : Prop := ∃ r, r ≤ p ∧ r ≤ q + +def DenseBelow (p : P) (D : Set P) : Prop := ∀ q, q ≤ p → ∃ r, r ≤ q ∧ r ∈ D + +def Localized (p : P) (D : Set P) : Set P := {q | q ∈ D ∨ ¬ Compatible q p} + +theorem localized_dense {p : P} {D : Set P} (dense : DenseBelow p D) : Dense (Localized p D) := by + classical + intro q + by_cases compat : Compatible q p + · obtain ⟨r, rq, rp⟩ := compat + obtain ⟨t, tr, ht⟩ := dense r rp + exact ⟨t, tr.trans rq, Or.inl ht⟩ + · exact ⟨q, le_rfl, Or.inr compat⟩ + +theorem ConditionFilter.meets_below (H : ConditionFilter P) {family : Set (Set P)} + (generic : H.GenericFor family) {p : P} (hp : H.mem p) {D : Set P} + (registered : Localized p D ∈ family) (dense : DenseBelow p D) : H.Meets D := by + obtain ⟨q, hq, good | bad⟩ := generic _ registered (localized_dense dense) + · exact ⟨q, hq, good⟩ + · exact False.elim (bad (H.compatible hq hp)) + +theorem denseBelow_mono {p : P} {D E : Set P} (dense : DenseBelow p D) (included : D ⊆ E) : + DenseBelow p E := by + intro q qp + obtain ⟨r, rq, hr⟩ := dense q qp + exact ⟨r, rq, included hr⟩ + + + + + + +theorem dense_countable_intersection (closed : CountablyClosed P) + (D : Nat → Set P) (dense : ∀ n, Dense (D n)) + (open_ : ∀ n, DownwardClosed (D n)) : Dense {p | ∀ n, p ∈ D n} := by + classical + intro p + let next (n : Nat) (q : P) : P := Classical.choose (dense n q) + have next_le (n : Nat) (q : P) : next n q ≤ q := (Classical.choose_spec (dense n q)).1 + have next_mem (n : Nat) (q : P) : next n q ∈ D n := (Classical.choose_spec (dense n q)).2 + let chain : Nat → P := Nat.rec p next + have step (n : Nat) : chain (n + 1) ≤ chain n := next_le n (chain n) + rcases closed chain (antitone_nat_of_succ_le step) with ⟨q, lower⟩ + refine ⟨q, lower 0, ?_⟩ + intro n + exact open_ n (lower (n + 1)) (next_mem n (chain n)) + +theorem dense_simultaneous_witnesses (closed : CountablyClosed P) + {A : Nat → Type*} (R : P → (n : Nat) → A n → Prop) + (monotone : ∀ ⦃p q⦄, q ≤ p → ∀ n a, R p n a → R q n a) + (dense : ∀ n, Dense {p | ∃ a, R p n a}) : + Dense {p | ∃ f : ∀ n, A n, ∀ n, R p n (f n)} := by + intro p + rcases dense_countable_intersection closed (fun n => {p | ∃ a, R p n a}) dense + (fun n _ _ le ⟨a, ha⟩ => ⟨a, monotone le n a ha⟩) p with ⟨q, qp, all⟩ + exact ⟨q, qp, Classical.axiomOfChoice all⟩ + +end + + + +namespace CountableCondition + +universe u v +variable {I : Type u} {A : Type v} + +def Agrees (p q : CountableCondition I A) : Prop := + ∀ i a b, p.value i = some a → q.value i = some b → a = b + +theorem agrees_symm {p q : CountableCondition I A} (h : Agrees p q) : Agrees q p := + fun i a b ha hb => (h i b a hb ha).symm + +noncomputable def merge (p q : CountableCondition I A) : CountableCondition I A where + value i := match p.value i with + | some a => some a + | none => q.value i + countable_domain := by + apply (p.countable_domain.union q.countable_domain).mono + intro i hi + cases hp : p.value i with + | none => exact Or.inr (by simpa only [Set.mem_ofPred_eq, hp] using hi) + | some a => exact Or.inl (by + change p.value i ≠ none + rw [hp] + exact Option.some_ne_none _) + +theorem merge_le_left (p q : CountableCondition I A) : merge p q ≤ p := by + intro i a ha + change (match p.value i with | some a => some a | none => q.value i) = some a + rw [ha] + +theorem merge_le_right {p q : CountableCondition I A} (agree : Agrees p q) : merge p q ≤ q := by + intro i b hb + change (match p.value i with | some a => some a | none => q.value i) = some b + cases hp : p.value i with + | none => exact hb + | some a => exact congrArg some (agree i a b hp hb) + +theorem merge_value {p q : CountableCondition I A} (agree : Agrees p q) (i : I) (a : A) : + (merge p q).value i = some a ↔ p.value i = some a ∨ q.value i = some a := by + constructor + · intro h + cases hp : p.value i with + | none => exact Or.inr (by simpa only [merge, hp] using h) + | some b => exact Or.inl (by simpa only [merge, hp] using h) + · rintro (hp | hq) + · exact merge_le_left p q i a hp + · exact merge_le_right agree i a hq + +theorem merge_agrees {p q r : CountableCondition I A} (pq : Agrees p q) + (pr : Agrees p r) (qr : Agrees q r) : Agrees (merge p q) r := by + intro i a b hab hr + obtain hp | hq := (merge_value pq i a).1 hab + · exact pr i a b hp hr + · exact qr i a b hq hr + +theorem three_agree_common {p q r : CountableCondition I A} + (pq : Agrees p q) (pr : Agrees p r) (qr : Agrees q r) : + ∃ t, t ≤ p ∧ t ≤ q ∧ t ≤ r := by + refine ⟨merge (merge p q) r, ?_, ?_, merge_le_right (merge_agrees pq pr qr)⟩ + · exact (merge_le_left _ _).trans (merge_le_left _ _) + · exact (merge_le_left _ _).trans (merge_le_right pq) + + + + + + +noncomputable def unionValue (chain : Nat → CountableCondition I A) (i : I) : Option A := by + classical + exact if h : ∃ a, ∃ n, (chain n).value i = some a then some (Classical.choose h) else none + +theorem unionValue_domain (chain : Nat → CountableCondition I A) : + {i | unionValue chain i ≠ none} ⊆ ⋃ n, (chain n).domain := by + classical + intro i hi + by_cases h : ∃ a, ∃ n, (chain n).value i = some a + · rcases h with ⟨a, n, ha⟩ + apply Set.mem_iUnion.2 ⟨n, ?_⟩ + change (chain n).value i ≠ none + rw [ha] + exact Option.some_ne_none _ + · have value : unionValue chain i = none := by simp only [unionValue, dite_eq_right h] + exact False.elim (hi value) + +theorem unionValue_extends (chain : Nat → CountableCondition I A) (decreasing : Antitone chain) + (n : Nat) (i : I) (a : A) (value : (chain n).value i = some a) : + unionValue chain i = some a := by + classical + have h : ∃ a, ∃ n, (chain n).value i = some a := ⟨a, n, value⟩ + rw [unionValue, dite_eq_left h] + rcases Classical.choose_spec h with ⟨m, hm⟩ + have compatible : ∃ r, r ≤ chain m ∧ r ≤ chain n := + ⟨chain (max m n), decreasing (le_max_left _ _), decreasing (le_max_right _ _)⟩ + exact congrArg some (compatible_values compatible hm value) + +noncomputable def chainUnion (chain : Nat → CountableCondition I A) : CountableCondition I A where + value := unionValue chain + countable_domain := (Set.countable_iUnion (fun n => (chain n).countable_domain)).mono + (unionValue_domain chain) + +theorem chainUnion_le (chain : Nat → CountableCondition I A) (decreasing : Antitone chain) + (n : Nat) : chainUnion chain ≤ chain n := + unionValue_extends chain decreasing n + +theorem countablyClosed : CountablyClosed (CountableCondition I A) := + fun chain decreasing => ⟨chainUnion chain, chainUnion_le chain decreasing⟩ + +end CountableCondition + + + +section + +universe u v + +structure DecisionSystem (P : Type u) [Preorder P] (A : Nat → Type v) where + decides : P → (n : Nat) → A n → Prop + persistent : ∀ ⦃p q⦄, q ≤ p → ∀ n a, decides p n a → decides q n a + unique : ∀ p n a b, decides p n a → decides p n b → a = b + dense : ∀ n, Dense {p | ∃ a, decides p n a} + +namespace DecisionSystem +variable {P : Type u} [Preorder P] {A : Nat → Type v} (d : DecisionSystem P A) + +def commonDecisions : Set P := {p | ∃ f : ∀ n, A n, ∀ n, d.decides p n (f n)} + +theorem commonDecisions_dense (closed : CountablyClosed P) : Dense d.commonDecisions := + dense_simultaneous_witnesses closed d.decides d.persistent d.dense + +theorem commonDecisions_downwardClosed : DownwardClosed d.commonDecisions := by + rintro p q le ⟨f, hf⟩ + exact ⟨f, fun n => d.persistent le n (f n) (hf n)⟩ + +def Realizes (F : ConditionFilter P) (f : ∀ n, A n) : Prop := + ∀ n, ∃ p, F.mem p ∧ d.decides p n (f n) + +theorem compatible_decisions (F : ConditionFilter P) {p q : P} (hp : F.mem p) (hq : F.mem q) + (n : Nat) (a b : A n) (ha : d.decides p n a) (hb : d.decides q n b) : a = b := by + rcases F.directed hp hq with ⟨r, _, rp, rq⟩ + exact d.unique r n a b (d.persistent rp n a ha) (d.persistent rq n b hb) + +theorem realizes_unique (F : ConditionFilter P) {f g : ∀ n, A n} + (hf : d.Realizes F f) (hg : d.Realizes F g) : f = g := by + funext n + rcases hf n with ⟨p, hp, ha⟩ + rcases hg n with ⟨q, hq, hb⟩ + exact d.compatible_decisions F hp hq n (f n) (g n) ha hb + +theorem common_condition_decides (F : ConditionFilter P) (meets : F.Meets d.commonDecisions) + (f : ∀ n, A n) (realizes : d.Realizes F f) : + ∃ p, F.mem p ∧ ∀ n, d.decides p n (f n) := by + rcases meets with ⟨p, hp, g, hg⟩ + have eq : g = f := d.realizes_unique F (fun n => ⟨p, hp, hg n⟩) realizes + exact ⟨p, hp, eq ▸ hg⟩ + +theorem generic_condition_decides (closed : CountablyClosed P) (F : ConditionFilter P) + (family : Set (Set P)) (generic : F.GenericFor family) (present : d.commonDecisions ∈ family) + (f : ∀ n, A n) (realizes : d.Realizes F f) : + ∃ p, F.mem p ∧ ∀ n, d.decides p n (f n) := + d.common_condition_decides F (generic _ present (d.commonDecisions_dense closed)) f realizes + +end DecisionSystem +end + + + +namespace CountableCondition + +universe u v +variable {I : Type u} {A : Type v} (F : ConditionFilter (CountableCondition I A)) + +theorem exists_value (meets : ∀ i, F.Meets (definedAt i)) (i : I) : + ∃ a, ∃ p, F.mem p ∧ p.value i = some a := by + rcases meets i with ⟨p, hp, defined⟩ + cases value : p.value i with + | none => exact False.elim (defined value) + | some a => exact ⟨a, p, hp, value⟩ + +noncomputable def readValue (meets : ∀ i, F.Meets (definedAt i)) (i : I) : A := + Classical.choose (exists_value F meets i) + +theorem readValue_realized (meets : ∀ i, F.Meets (definedAt i)) (i : I) : + ∃ p, F.mem p ∧ p.value i = some (readValue F meets i) := + Classical.choose_spec (exists_value F meets i) + +theorem readValue_of_condition (meets : ∀ i, F.Meets (definedAt i)) + {p : CountableCondition I A} (hp : F.mem p) {i : I} {a : A} (value : p.value i = some a) : + readValue F meets i = a := by + rcases readValue_realized F meets i with ⟨q, hq, read⟩ + exact compatible_values (F.compatible hq hp) read value + +theorem readValue_iff (meets : ∀ i, F.Meets (definedAt i)) (i : I) (a : A) : + readValue F meets i = a ↔ ∃ p, F.mem p ∧ p.value i = some a := by + constructor + · intro eq + exact eq ▸ readValue_realized F meets i + · rintro ⟨p, hp, value⟩ + exact readValue_of_condition F meets hp value + +omit F in +def coordinateDecisions [Nonempty A] (index : Nat → I) : + DecisionSystem (CountableCondition I A) (fun _ => A) where + decides p n a := p.value (index n) = some a + persistent := by + intro p q le n a value + exact le (index n) a value + unique _ _ _ _ h1 h2 := Option.some.inj (h1.symm.trans h2) + dense n := by + intro p + rcases definedAt_dense (A := A) (index n) p with ⟨q, qp, defined⟩ + cases value : q.value (index n) with + | none => exact False.elim (defined value) + | some a => exact ⟨q, qp, a, value⟩ + +omit F in +theorem coordinate_commonDecisions_dense [Nonempty A] (index : Nat → I) : + Dense (coordinateDecisions (A := A) index).commonDecisions := + (coordinateDecisions index).commonDecisions_dense countablyClosed + +theorem readValue_sequence_decided [Nonempty A] (meets : ∀ i, F.Meets (definedAt i)) + (index : Nat → I) (family : Set (Set (CountableCondition I A))) (generic : F.GenericFor family) + (present : (coordinateDecisions (A := A) index).commonDecisions ∈ family) : + ∃ p, F.mem p ∧ ∀ n, p.value (index n) = some (readValue F meets (index n)) := + (coordinateDecisions index).generic_condition_decides countablyClosed F family generic present + (fun n => readValue F meets (index n)) (fun n => readValue_realized F meets (index n)) + +end CountableCondition + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GreedyAntichainTraces.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GreedyAntichainTraces.lean index 14b6a10e3e6125fbacc5bd923dbca796d53ae1db..ba8f444c1bac0c58b8db6d08343010b9c8dac83c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GreedyAntichainTraces.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GreedyAntichainTraces.lean @@ -1,136 +1,136 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift - -namespace OAI - -namespace PartitionPilot.Forcing -universe u - -def OrderAntichainCode (Q order D : ZFSet.{u}) : Prop := - D ⊆ Q ∧ ∀ p ∈ D, ∀ q ∈ D, ∀ r ∈ Q, - ZFSet.pair r p ∈ order → ZFSet.pair r q ∈ order → p = q - -theorem OrderAntichainCode.eq_of_common_lower {Q order D p q : ZFSet.{u}} - (antichain : OrderAntichainCode Q order D) (first : p ∈ D) (second : q ∈ D) - (common : ∃ r ∈ Q, ZFSet.pair r p ∈ order ∧ ZFSet.pair r q ∈ order) : p = q := by - obtain ⟨r, member, belowFirst, belowSecond⟩ := common - exact antichain.2 p first q second r member belowFirst belowSecond - -def RelativeMaximalAntichainCode (Q order D A : ZFSet.{u}) : Prop := - A ⊆ D ∧ OrderAntichainCode Q order A ∧ - ∀ q ∈ D, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order - -theorem RelativeMaximalAntichainCode.inclusion_maximal {Q order D A B : ZFSet.{u}} - (code : RelativeMaximalAntichainCode Q order D A) - (larger : A ⊆ B) (within : B ⊆ D) (antichain : OrderAntichainCode Q order B) : - B ⊆ A := by - intro q member - obtain ⟨p, hp, common⟩ := code.2.2 q (within member) - have equal := antichain.eq_of_common_lower member (larger hp) common - exact equal.symm ▸ hp - -noncomputable def antichainEligible (Q order D alpha prior : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun q => ¬ ∃ beta ∈ alpha, ∃ p ∈ D, - ZFSet.pair beta p ∈ prior ∧ ∃ r ∈ Q, - ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order) D - -theorem mem_antichainEligible (Q order D alpha prior q : ZFSet.{u}) : - q ∈ antichainEligible Q order D alpha prior ↔ q ∈ D ∧ - ¬ ∃ beta ∈ alpha, ∃ p ∈ D, ZFSet.pair beta p ∈ prior ∧ - ∃ r ∈ Q, ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order := - ZFSet.mem_sep - -def GreedyAntichainStep (Q order D F c alpha prior y : ZFSet.{u}) : Prop := - (∃ E ∈ F, E = antichainEligible Q order D alpha prior ∧ ZFSet.pair E y ∈ c) ∨ - (¬ (antichainEligible Q order D alpha prior).Nonempty ∧ y = D) - -theorem greedyAntichainStep_selected {Q order D F c alpha prior y : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) - (step : GreedyAntichainStep Q order D F c alpha prior y) (selected : y ∈ D) : - y ∈ antichainEligible Q order D alpha prior := by - rcases step with ⟨E, _, rfl, entry⟩ | ⟨_, equal⟩ - · exact choice.chosen _ _ entry - · exact False.elim (ZFSet.mem_irrefl D (equal ▸ selected)) - -theorem greedyAntichainStep_of_nonempty {Q order D F c alpha prior y : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) - (step : GreedyAntichainStep Q order D F c alpha prior y) - (nonempty : (antichainEligible Q order D alpha prior).Nonempty) : - y ∈ antichainEligible Q order D alpha prior := by - rcases step with ⟨E, _, rfl, entry⟩ | ⟨empty, _⟩ - · exact choice.chosen _ _ entry - · exact False.elim (empty nonempty) - -theorem greedyAntichainTrace_antichain {Q order D F c C f S : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) - (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) - (conditions : D ⊆ Q) (subset : S ⊆ C) : - OrderAntichainCode Q order (relationImage S D f) := by - refine ⟨fun p hp => conditions ((mem_relationImage S D f p).1 hp).1, ?_⟩ - intro p hp q hq r hr rp rq - obtain ⟨hpD, beta, hBeta, bp⟩ := (mem_relationImage S D f p).1 hp - obtain ⟨hqD, gamma, hGamma, gq⟩ := (mem_relationImage S D f q).1 hq - rcases ordinalSetProperty_mem_compare ordinal (subset hBeta) (subset hGamma) with - before | equal | after - · have eligible := greedyAntichainStep_selected choice - (trace.2 gamma (subset hGamma) q gq) hqD - exact False.elim ((mem_antichainEligible Q order D gamma - (graphRestriction gamma f) q).1 eligible |>.2 <| - ⟨beta, before, p, hpD, pair_mem_graphRestriction.2 ⟨bp, before⟩, r, hr, rq, rp⟩) - · subst gamma - exact trace.1.unique bp gq - · have eligible := greedyAntichainStep_selected choice - (trace.2 beta (subset hBeta) p bp) hpD - exact False.elim ((mem_antichainEligible Q order D beta - (graphRestriction beta f) p).1 eligible |>.2 <| - ⟨gamma, after, q, hqD, pair_mem_graphRestriction.2 ⟨gq, after⟩, r, hr, rp, rq⟩) - -theorem greedyAntichainTrace_injection {Q order D F c C f : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) - (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) - (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) - (available : ∀ alpha ∈ C, - (antichainEligible Q order D alpha (graphRestriction alpha f)).Nonempty) : - InjectionCode C D f := by - have fresh : ∀ alpha ∈ C, ∀ y, ZFSet.pair alpha y ∈ f → - y ∈ D ∧ ¬ ∃ beta ∈ alpha, ZFSet.pair beta y ∈ f := by - intro alpha hAlpha y entry - obtain ⟨hyD, eligible⟩ := (mem_antichainEligible Q order D alpha - (graphRestriction alpha f) y).1 - (greedyAntichainStep_of_nonempty choice (trace.2 alpha hAlpha y entry) - (available alpha hAlpha)) - refine ⟨hyD, ?_⟩ - rintro ⟨beta, hBeta, byEntry⟩ - have refl := orderCode.refl y (conditions hyD) - exact eligible ⟨beta, hBeta, y, hyD, pair_mem_graphRestriction.2 ⟨byEntry, hBeta⟩, - y, conditions hyD, refl, refl⟩ - refine ⟨⟨?_, trace.1.to_isFunc.2⟩, ?_⟩ - · intro z hz - obtain ⟨alpha, hAlpha, y, rfl⟩ := trace.1.shape z hz - exact ZFSet.pair_mem_prod.2 ⟨hAlpha, (fresh alpha hAlpha y hz).1⟩ - · intro alpha beta y first second - have hAlpha := trace.1.pair_source first - have hBeta := trace.1.pair_source second - rcases ordinalSetProperty_mem_compare ordinal hAlpha hBeta with before | equal | after - · exact False.elim ((fresh beta hBeta y second).2 ⟨alpha, before, first⟩) - · exact equal - · exact False.elim ((fresh alpha hAlpha y first).2 ⟨beta, after, second⟩) - -theorem greedyAntichainTrace_exhausts {Q order D F c C f : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) - (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) - (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) - (impossible : ¬ InjectionCode C D f) : - ∃ alpha ∈ C, - ¬ (antichainEligible Q order D alpha (graphRestriction alpha f)).Nonempty := by - classical - by_contra none - apply impossible - exact greedyAntichainTrace_injection choice ordinal trace orderCode conditions - (fun alpha hAlpha => by - by_contra empty - exact none ⟨alpha, hAlpha, empty⟩) - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift + +namespace OAI + +namespace PartitionPilot.Forcing +universe u + +def OrderAntichainCode (Q order D : ZFSet.{u}) : Prop := + D ⊆ Q ∧ ∀ p ∈ D, ∀ q ∈ D, ∀ r ∈ Q, + ZFSet.pair r p ∈ order → ZFSet.pair r q ∈ order → p = q + +theorem OrderAntichainCode.eq_of_common_lower {Q order D p q : ZFSet.{u}} + (antichain : OrderAntichainCode Q order D) (first : p ∈ D) (second : q ∈ D) + (common : ∃ r ∈ Q, ZFSet.pair r p ∈ order ∧ ZFSet.pair r q ∈ order) : p = q := by + obtain ⟨r, member, belowFirst, belowSecond⟩ := common + exact antichain.2 p first q second r member belowFirst belowSecond + +def RelativeMaximalAntichainCode (Q order D A : ZFSet.{u}) : Prop := + A ⊆ D ∧ OrderAntichainCode Q order A ∧ + ∀ q ∈ D, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order + +theorem RelativeMaximalAntichainCode.inclusion_maximal {Q order D A B : ZFSet.{u}} + (code : RelativeMaximalAntichainCode Q order D A) + (larger : A ⊆ B) (within : B ⊆ D) (antichain : OrderAntichainCode Q order B) : + B ⊆ A := by + intro q member + obtain ⟨p, hp, common⟩ := code.2.2 q (within member) + have equal := antichain.eq_of_common_lower member (larger hp) common + exact equal.symm ▸ hp + +noncomputable def antichainEligible (Q order D alpha prior : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun q => ¬ ∃ beta ∈ alpha, ∃ p ∈ D, + ZFSet.pair beta p ∈ prior ∧ ∃ r ∈ Q, + ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order) D + +theorem mem_antichainEligible (Q order D alpha prior q : ZFSet.{u}) : + q ∈ antichainEligible Q order D alpha prior ↔ q ∈ D ∧ + ¬ ∃ beta ∈ alpha, ∃ p ∈ D, ZFSet.pair beta p ∈ prior ∧ + ∃ r ∈ Q, ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order := + ZFSet.mem_sep + +def GreedyAntichainStep (Q order D F c alpha prior y : ZFSet.{u}) : Prop := + (∃ E ∈ F, E = antichainEligible Q order D alpha prior ∧ ZFSet.pair E y ∈ c) ∨ + (¬ (antichainEligible Q order D alpha prior).Nonempty ∧ y = D) + +theorem greedyAntichainStep_selected {Q order D F c alpha prior y : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) + (step : GreedyAntichainStep Q order D F c alpha prior y) (selected : y ∈ D) : + y ∈ antichainEligible Q order D alpha prior := by + rcases step with ⟨E, _, rfl, entry⟩ | ⟨_, equal⟩ + · exact choice.chosen _ _ entry + · exact False.elim (ZFSet.mem_irrefl D (equal ▸ selected)) + +theorem greedyAntichainStep_of_nonempty {Q order D F c alpha prior y : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) + (step : GreedyAntichainStep Q order D F c alpha prior y) + (nonempty : (antichainEligible Q order D alpha prior).Nonempty) : + y ∈ antichainEligible Q order D alpha prior := by + rcases step with ⟨E, _, rfl, entry⟩ | ⟨empty, _⟩ + · exact choice.chosen _ _ entry + · exact False.elim (empty nonempty) + +theorem greedyAntichainTrace_antichain {Q order D F c C f S : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) + (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) + (conditions : D ⊆ Q) (subset : S ⊆ C) : + OrderAntichainCode Q order (relationImage S D f) := by + refine ⟨fun p hp => conditions ((mem_relationImage S D f p).1 hp).1, ?_⟩ + intro p hp q hq r hr rp rq + obtain ⟨hpD, beta, hBeta, bp⟩ := (mem_relationImage S D f p).1 hp + obtain ⟨hqD, gamma, hGamma, gq⟩ := (mem_relationImage S D f q).1 hq + rcases ordinalSetProperty_mem_compare ordinal (subset hBeta) (subset hGamma) with + before | equal | after + · have eligible := greedyAntichainStep_selected choice + (trace.2 gamma (subset hGamma) q gq) hqD + exact False.elim ((mem_antichainEligible Q order D gamma + (graphRestriction gamma f) q).1 eligible |>.2 <| + ⟨beta, before, p, hpD, pair_mem_graphRestriction.2 ⟨bp, before⟩, r, hr, rq, rp⟩) + · subst gamma + exact trace.1.unique bp gq + · have eligible := greedyAntichainStep_selected choice + (trace.2 beta (subset hBeta) p bp) hpD + exact False.elim ((mem_antichainEligible Q order D beta + (graphRestriction beta f) p).1 eligible |>.2 <| + ⟨gamma, after, q, hqD, pair_mem_graphRestriction.2 ⟨gq, after⟩, r, hr, rp, rq⟩) + +theorem greedyAntichainTrace_injection {Q order D F c C f : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) + (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) + (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) + (available : ∀ alpha ∈ C, + (antichainEligible Q order D alpha (graphRestriction alpha f)).Nonempty) : + InjectionCode C D f := by + have fresh : ∀ alpha ∈ C, ∀ y, ZFSet.pair alpha y ∈ f → + y ∈ D ∧ ¬ ∃ beta ∈ alpha, ZFSet.pair beta y ∈ f := by + intro alpha hAlpha y entry + obtain ⟨hyD, eligible⟩ := (mem_antichainEligible Q order D alpha + (graphRestriction alpha f) y).1 + (greedyAntichainStep_of_nonempty choice (trace.2 alpha hAlpha y entry) + (available alpha hAlpha)) + refine ⟨hyD, ?_⟩ + rintro ⟨beta, hBeta, byEntry⟩ + have refl := orderCode.refl y (conditions hyD) + exact eligible ⟨beta, hBeta, y, hyD, pair_mem_graphRestriction.2 ⟨byEntry, hBeta⟩, + y, conditions hyD, refl, refl⟩ + refine ⟨⟨?_, trace.1.to_isFunc.2⟩, ?_⟩ + · intro z hz + obtain ⟨alpha, hAlpha, y, rfl⟩ := trace.1.shape z hz + exact ZFSet.pair_mem_prod.2 ⟨hAlpha, (fresh alpha hAlpha y hz).1⟩ + · intro alpha beta y first second + have hAlpha := trace.1.pair_source first + have hBeta := trace.1.pair_source second + rcases ordinalSetProperty_mem_compare ordinal hAlpha hBeta with before | equal | after + · exact False.elim ((fresh beta hBeta y second).2 ⟨alpha, before, first⟩) + · exact equal + · exact False.elim ((fresh alpha hAlpha y first).2 ⟨beta, after, second⟩) + +theorem greedyAntichainTrace_exhausts {Q order D F c C f : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) + (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) + (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) + (impossible : ¬ InjectionCode C D f) : + ∃ alpha ∈ C, + ¬ (antichainEligible Q order D alpha (graphRestriction alpha f)).Nonempty := by + classical + by_contra none + apply impossible + exact greedyAntichainTrace_injection choice ordinal trace orderCode conditions + (fun alpha hAlpha => by + by_contra empty + exact none ⟨alpha, hAlpha, empty⟩) + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundAbsentLiftClassTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundAbsentLiftClassTransport.lean index ee97530c6c91943e023c8db0323ac3079b06c911..ba6a73863c91d887c51732608b2cf2e72334f1c8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundAbsentLiftClassTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundAbsentLiftClassTransport.lean @@ -1,94 +1,94 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralCompression - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (a : PosetAction G P) (t : Presentation G) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (level : ZFSet.{u}) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include indices terms in -theorem refinementAbsentLift_class_transport (small : M.sets.Countable) - (C E D K : L) (U Rf Rc u : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (term : u.val.val ∈ T) (above : C ≤ D) - (support : d.principalFix D ≤ a.stabilizer s u.val) - (g : G) (fixed : g ∈ d.principalFix C) (cap : d.iso g D ≤ K) - (r q : P) (below : q ≤ a.iso g r) (active : Name.ForcesMem r u.val U.val) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - let w : (M.nameDomain s).names := ⟨a.act s g u.val, - M.act_mem s a t pairing unions powers separation collection carrier maps g u.val u.property⟩ - (∀ p, p ≤ r → ¬ Name.ForcesMem p (cls Rf u).val (vis C).val) → - w.val.val ∈ T ∧ Name.ForcesMem q w.val U.val ∧ - a.act s g (cls Rf u).val = (cls Rf w).val ∧ - d.principalFix K ≤ a.stabilizer s (cls Rf w).val ∧ - Name.ForcesMem q (cls Rf w).val (vis K).val ∧ - (∀ p, p ≤ q → ¬ Name.ForcesMem p (cls Rf w).val (vis C).val) := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - let w : (M.nameDomain s).names := ⟨a.act s g u.val, - M.act_mem s a t pairing unions powers separation collection carrier maps g u.val u.property⟩ - intro absent - obtain ⟨_, domain, fine, _, _⟩ := (indices.typed_entries C E U Rf Rc).1 member - have domainFixed : a.act s g U.val = U.val := - ((M.name_mem_niceNameCandidates a s T (d.principalFix C) U.val).1 domain).2.2 fixed - have relationSupport := - ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val).1 fine).2.2 - have relationFixed : a.act s g Rf.val = Rf.val := relationSupport fixed - have classAction : a.act s g (cls Rf u).val = (cls Rf w).val := by - change a.act s g (Name.refinementClass T valid Rf.val u.val) = - Name.refinementClass T valid Rf.val (a.act s g u.val) - rw [Name.act_refinementClass a T valid terms, relationFixed] - have classSupport : d.principalFix D ≤ a.stabilizer s (cls Rf u).val := - Name.refinementClass_support a T valid terms Rf.val u.val (d.principalFix D) - ((d.principalFix_antitone above).trans relationSupport) support - have movedSupport : d.principalFix K ≤ a.stabilizer s (cls Rf w).val := by - rw [← classAction] - exact a.compressed_name_support s d g D K (cls Rf u).val classSupport cap - have visible : Name.ForcesMem q (cls Rf w).val (vis K).val := by - change Forces (M.nameDomain s) (.mem 0 1) ![cls Rf w, vis K] q - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ q).2 - intro H hq generic - apply system.normalization_visible K (cls Rf w) movedSupport H generic - change Name.eval {p | H.mem p} (Name.refinementClass T valid Rf.val w.val) ⊆ _ - rw [M.eval_refinementClass s pairing carrier hT valid Rf.val w.val - Rf.property w.property H generic] - exact equivalenceClass_subset _ _ _ - have activeW := a.forcesMem_act s g active - rw [domainFixed] at activeW - refine ⟨terms g u.val term, Name.forcesMem_mono activeW below, - classAction, movedSupport, visible, ?_⟩ - have visibilityFixed : a.act s g (vis C).val = (vis C).val := system.visibility_support C fixed - intro p pq bad - have oldBelow : (a.iso g).symm p ≤ r := by - simpa using (a.iso g).symm.monotone (pq.trans below) - have moved : Name.ForcesMem (a.iso g ((a.iso g).symm p)) - (a.act s g (cls Rf u).val) (a.act s g (vis C).val) := by - simpa only [OrderIso.apply_symm_apply, classAction, visibilityFixed] using bad - exact absent _ oldBelow ((a.forcesMem_act_iff s g _ _ _).1 moved) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralCompression + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (a : PosetAction G P) (t : Presentation G) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (level : ZFSet.{u}) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include indices terms in +theorem refinementAbsentLift_class_transport (small : M.sets.Countable) + (C E D K : L) (U Rf Rc u : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (term : u.val.val ∈ T) (above : C ≤ D) + (support : d.principalFix D ≤ a.stabilizer s u.val) + (g : G) (fixed : g ∈ d.principalFix C) (cap : d.iso g D ≤ K) + (r q : P) (below : q ≤ a.iso g r) (active : Name.ForcesMem r u.val U.val) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + let w : (M.nameDomain s).names := ⟨a.act s g u.val, + M.act_mem s a t pairing unions powers separation collection carrier maps g u.val u.property⟩ + (∀ p, p ≤ r → ¬ Name.ForcesMem p (cls Rf u).val (vis C).val) → + w.val.val ∈ T ∧ Name.ForcesMem q w.val U.val ∧ + a.act s g (cls Rf u).val = (cls Rf w).val ∧ + d.principalFix K ≤ a.stabilizer s (cls Rf w).val ∧ + Name.ForcesMem q (cls Rf w).val (vis K).val ∧ + (∀ p, p ≤ q → ¬ Name.ForcesMem p (cls Rf w).val (vis C).val) := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + let w : (M.nameDomain s).names := ⟨a.act s g u.val, + M.act_mem s a t pairing unions powers separation collection carrier maps g u.val u.property⟩ + intro absent + obtain ⟨_, domain, fine, _, _⟩ := (indices.typed_entries C E U Rf Rc).1 member + have domainFixed : a.act s g U.val = U.val := + ((M.name_mem_niceNameCandidates a s T (d.principalFix C) U.val).1 domain).2.2 fixed + have relationSupport := + ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val).1 fine).2.2 + have relationFixed : a.act s g Rf.val = Rf.val := relationSupport fixed + have classAction : a.act s g (cls Rf u).val = (cls Rf w).val := by + change a.act s g (Name.refinementClass T valid Rf.val u.val) = + Name.refinementClass T valid Rf.val (a.act s g u.val) + rw [Name.act_refinementClass a T valid terms, relationFixed] + have classSupport : d.principalFix D ≤ a.stabilizer s (cls Rf u).val := + Name.refinementClass_support a T valid terms Rf.val u.val (d.principalFix D) + ((d.principalFix_antitone above).trans relationSupport) support + have movedSupport : d.principalFix K ≤ a.stabilizer s (cls Rf w).val := by + rw [← classAction] + exact a.compressed_name_support s d g D K (cls Rf u).val classSupport cap + have visible : Name.ForcesMem q (cls Rf w).val (vis K).val := by + change Forces (M.nameDomain s) (.mem 0 1) ![cls Rf w, vis K] q + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ q).2 + intro H hq generic + apply system.normalization_visible K (cls Rf w) movedSupport H generic + change Name.eval {p | H.mem p} (Name.refinementClass T valid Rf.val w.val) ⊆ _ + rw [M.eval_refinementClass s pairing carrier hT valid Rf.val w.val + Rf.property w.property H generic] + exact equivalenceClass_subset _ _ _ + have activeW := a.forcesMem_act s g active + rw [domainFixed] at activeW + refine ⟨terms g u.val term, Name.forcesMem_mono activeW below, + classAction, movedSupport, visible, ?_⟩ + have visibilityFixed : a.act s g (vis C).val = (vis C).val := system.visibility_support C fixed + intro p pq bad + have oldBelow : (a.iso g).symm p ≤ r := by + simpa using (a.iso g).symm.monotone (pq.trans below) + have moved : Name.ForcesMem (a.iso g ((a.iso g).symm p)) + (a.act s g (cls Rf u).val) (a.act s g (vis C).val) := by + simpa only [OrderIso.apply_symm_apply, classAction, visibilityFixed] using bad + exact absent _ oldBelow ((a.forcesMem_act_iff s g _ _ _).1 moved) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionFilterImages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionFilterImages.lean index 9cad56d7da714eca4e05785e06b713e0da0324c4..c8c1c65b8135e9c3448ccf3a2bb683c4c76f241d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionFilterImages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionFilterImages.lean @@ -1,51 +1,51 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedFilterImages - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace BoundedFormula - -def actionImageFormula {n} (y A g F : Fin n) : BoundedFormula n := - exMem F (tripleMembershipFormula g.succ 0 y.succ A.succ) - -theorem truth_actionImageFormula {n} (y A g F : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (actionImageFormula y A g F) env ↔ - ∃ x ∈ env F, ZFSet.pair (ZFSet.pair (env g) x) (env y) ∈ env A := by - simp only [actionImageFormula, truth_exMem, truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem actionImage_mem (separation : SeparationSchema M.sets) - {P A g F : ZFSet.{u}} (hP : P ∈ M.sets) (hA : A ∈ M.sets) - (hg : g ∈ M.sets) (hF : F ∈ M.sets) : actionImage P A g F ∈ M.sets := by - let params := extend A (extend g (extend F Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.actionImageFormula 0 1 2 3) params - (Fin.cases hA (Fin.cases hg (Fin.cases hF (fun i => Fin.elim0 i)))) hP - have equal : ZFSet.sep (fun y => BoundedFormula.Truth - (BoundedFormula.actionImageFormula 0 1 2 3) (extend y params)) P = - actionImage P A g F := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep, mem_actionImage, BoundedFormula.truth_actionImageFormula] - rfl - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedFilterImages + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace BoundedFormula + +def actionImageFormula {n} (y A g F : Fin n) : BoundedFormula n := + exMem F (tripleMembershipFormula g.succ 0 y.succ A.succ) + +theorem truth_actionImageFormula {n} (y A g F : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (actionImageFormula y A g F) env ↔ + ∃ x ∈ env F, ZFSet.pair (ZFSet.pair (env g) x) (env y) ∈ env A := by + simp only [actionImageFormula, truth_exMem, truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem actionImage_mem (separation : SeparationSchema M.sets) + {P A g F : ZFSet.{u}} (hP : P ∈ M.sets) (hA : A ∈ M.sets) + (hg : g ∈ M.sets) (hF : F ∈ M.sets) : actionImage P A g F ∈ M.sets := by + let params := extend A (extend g (extend F Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.actionImageFormula 0 1 2 3) params + (Fin.cases hA (Fin.cases hg (Fin.cases hF (fun i => Fin.elim0 i)))) hP + have equal : ZFSet.sep (fun y => BoundedFormula.Truth + (BoundedFormula.actionImageFormula 0 1 2 3) (extend y params)) P = + actionImage P A g F := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep, mem_actionImage, BoundedFormula.truth_actionImageFormula] + rfl + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionPostcomposition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionPostcomposition.lean index e13d68f3289d858f6a57465b130866236c496c8f..635b1145f21593542147d85b7e2aeb75b85763aa 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionPostcomposition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundActionPostcomposition.lean @@ -1,101 +1,101 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace BoundedFormula - -open SetFormula - -def actionPostcomposeEntryFormula {n} (v P A g base : Fin n) : BoundedFormula n := - exMem P (exMem P.succ (.conj (orderedPairFormula v.succ.succ 1 0) - (exMem P.succ.succ (.conj (pairMembershipFormula 2 0 base.succ.succ.succ) - (tripleMembershipFormula g.succ.succ.succ 0 1 A.succ.succ.succ))))) - -theorem truth_actionPostcomposeEntryFormula {n} (v P A g base : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (actionPostcomposeEntryFormula v P A g base) env ↔ - ∃ x ∈ env P, ∃ z ∈ env P, env v = ZFSet.pair x z ∧ - ∃ y ∈ env P, ZFSet.pair x y ∈ env base ∧ - ZFSet.pair (ZFSet.pair (env g) y) z ∈ env A := by - simp only [actionPostcomposeEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -def actionPostcomposeFormula {n} (P A g base output : Fin n) : BoundedFormula n := - let entry := pairMembershipFormula 1 0 output.succ.succ - let composed := exMem P.succ.succ - (.conj (pairMembershipFormula 2 0 base.succ.succ.succ) - (tripleMembershipFormula g.succ.succ.succ 0 1 A.succ.succ.succ)) - .conj (relationBetweenFormula P P output) (.allMem P (.allMem P.succ - (.conj (imp entry composed) (imp composed entry)))) - -theorem truth_actionPostcomposeFormula {n} (P A g base output : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (actionPostcomposeFormula P A g base output) env ↔ - env output = actionPostcompose (env P) (env A) (env g) (env base) := by - simp only [actionPostcomposeFormula, Truth, truth_relationBetweenFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula, truth_imp, truth_exMem, ← iff_def] - constructor - · rintro ⟨shape, entries⟩ - apply ZFSet.ext - intro v - constructor - · intro hv - obtain ⟨x, hx, z, hz, rfl⟩ := ZFSet.mem_prod.1 (shape hv) - exact (pair_mem_actionPostcompose _ _ _ _ x z).2 ⟨hx, hz, (entries x hx z hz).1 hv⟩ - · intro hv - obtain ⟨x, hx, z, hz, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset _ _ _ _ hv) - exact (entries x hx z hz).2 ((pair_mem_actionPostcompose _ _ _ _ x z).1 hv).2.2 - · intro equal - refine ⟨equal ▸ actionPostcompose_subset _ _ _ _, ?_⟩ - intro x hx z hz - change ZFSet.pair x z ∈ env output ↔ ∃ y ∈ env P, - ZFSet.pair x y ∈ env base ∧ ZFSet.pair (ZFSet.pair (env g) y) z ∈ env A - rw [equal, pair_mem_actionPostcompose] - exact ⟨fun h => h.2.2, fun h => ⟨hx, hz, h⟩⟩ - -theorem realize_actionPostcomposeFormula (M : TransitiveGround.{u}) {n} - (P A g base output : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (actionPostcomposeFormula P A g base output).toFormula env ↔ - env output = actionPostcompose (env P) (env A) (env g) (env base) := - (realize_toFormula M _ env members).trans (truth_actionPostcomposeFormula P A g base output env) - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem actionPostcompose_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P A g base : ZFSet.{u}} (hP : P ∈ M.sets) (hA : A ∈ M.sets) - (hg : g ∈ M.sets) (hbase : base ∈ M.sets) : actionPostcompose P A g base ∈ M.sets := by - let params := extend P (extend A (extend g (extend base Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.actionPostcomposeEntryFormula 0 1 2 3 4) params - (Fin.cases hP (Fin.cases hA (Fin.cases hg (Fin.cases hbase (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation hP hP) - have equal : ZFSet.sep (fun v => BoundedFormula.Truth - (BoundedFormula.actionPostcomposeEntryFormula 0 1 2 3 4) (extend v params)) - (ZFSet.prod P P) = actionPostcompose P A g base := by - apply ZFSet.ext - intro v - rw [ZFSet.mem_sep, actionPostcompose, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_actionPostcomposeEntryFormula 0 1 2 3 4 _) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace BoundedFormula + +open SetFormula + +def actionPostcomposeEntryFormula {n} (v P A g base : Fin n) : BoundedFormula n := + exMem P (exMem P.succ (.conj (orderedPairFormula v.succ.succ 1 0) + (exMem P.succ.succ (.conj (pairMembershipFormula 2 0 base.succ.succ.succ) + (tripleMembershipFormula g.succ.succ.succ 0 1 A.succ.succ.succ))))) + +theorem truth_actionPostcomposeEntryFormula {n} (v P A g base : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (actionPostcomposeEntryFormula v P A g base) env ↔ + ∃ x ∈ env P, ∃ z ∈ env P, env v = ZFSet.pair x z ∧ + ∃ y ∈ env P, ZFSet.pair x y ∈ env base ∧ + ZFSet.pair (ZFSet.pair (env g) y) z ∈ env A := by + simp only [actionPostcomposeEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +def actionPostcomposeFormula {n} (P A g base output : Fin n) : BoundedFormula n := + let entry := pairMembershipFormula 1 0 output.succ.succ + let composed := exMem P.succ.succ + (.conj (pairMembershipFormula 2 0 base.succ.succ.succ) + (tripleMembershipFormula g.succ.succ.succ 0 1 A.succ.succ.succ)) + .conj (relationBetweenFormula P P output) (.allMem P (.allMem P.succ + (.conj (imp entry composed) (imp composed entry)))) + +theorem truth_actionPostcomposeFormula {n} (P A g base output : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (actionPostcomposeFormula P A g base output) env ↔ + env output = actionPostcompose (env P) (env A) (env g) (env base) := by + simp only [actionPostcomposeFormula, Truth, truth_relationBetweenFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula, truth_imp, truth_exMem, ← iff_def] + constructor + · rintro ⟨shape, entries⟩ + apply ZFSet.ext + intro v + constructor + · intro hv + obtain ⟨x, hx, z, hz, rfl⟩ := ZFSet.mem_prod.1 (shape hv) + exact (pair_mem_actionPostcompose _ _ _ _ x z).2 ⟨hx, hz, (entries x hx z hz).1 hv⟩ + · intro hv + obtain ⟨x, hx, z, hz, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset _ _ _ _ hv) + exact (entries x hx z hz).2 ((pair_mem_actionPostcompose _ _ _ _ x z).1 hv).2.2 + · intro equal + refine ⟨equal ▸ actionPostcompose_subset _ _ _ _, ?_⟩ + intro x hx z hz + change ZFSet.pair x z ∈ env output ↔ ∃ y ∈ env P, + ZFSet.pair x y ∈ env base ∧ ZFSet.pair (ZFSet.pair (env g) y) z ∈ env A + rw [equal, pair_mem_actionPostcompose] + exact ⟨fun h => h.2.2, fun h => ⟨hx, hz, h⟩⟩ + +theorem realize_actionPostcomposeFormula (M : TransitiveGround.{u}) {n} + (P A g base output : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (actionPostcomposeFormula P A g base output).toFormula env ↔ + env output = actionPostcompose (env P) (env A) (env g) (env base) := + (realize_toFormula M _ env members).trans (truth_actionPostcomposeFormula P A g base output env) + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem actionPostcompose_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P A g base : ZFSet.{u}} (hP : P ∈ M.sets) (hA : A ∈ M.sets) + (hg : g ∈ M.sets) (hbase : base ∈ M.sets) : actionPostcompose P A g base ∈ M.sets := by + let params := extend P (extend A (extend g (extend base Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.actionPostcomposeEntryFormula 0 1 2 3 4) params + (Fin.cases hP (Fin.cases hA (Fin.cases hg (Fin.cases hbase (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation hP hP) + have equal : ZFSet.sep (fun v => BoundedFormula.Truth + (BoundedFormula.actionPostcomposeEntryFormula 0 1 2 3 4) (extend v params)) + (ZFSet.prod P P) = actionPostcompose P A g base := by + apply ZFSet.ext + intro v + rw [ZFSet.mem_sep, actionPostcompose, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_actionPostcomposeEntryFormula 0 1 2 3 4 _) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBatchEarlierLayerWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBatchEarlierLayerWitnesses.lean index d4712ec31b3de5537766f8cde980ebab5577684b..d93b0fbf75ca70742ec17c27ee637ecc2f6f6c6c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBatchEarlierLayerWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBatchEarlierLayerWitnesses.lean @@ -1,413 +1,413 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -theorem CountableLayerCode.of_literal_extension - {A B old born t D N injection : ZFSet.{u}} - (code : CountableLayerCode A old t D N injection) - (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : - CountableLayerCode B born t D N injection := - ⟨code.small, fun x hx entry => code.cover x (fiber x hx entry).1 (fiber x hx entry).2⟩ - -theorem CopyLayerCode.of_literal_extension - {Qs rs μs A B rA rB μA μB old born t I parts Indices Maps W N injection : ZFSet.{u}} - (code : CopyLayerCode Qs rs μs A rA μA old t I parts Indices Maps W N injection) - (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) - (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : - CopyLayerCode Qs rs μs B rB μB born t I - (ZFSet.sep (fun p => p ∈ ZFSet.prod I A) parts) Indices Maps W N injection := by - refine ⟨code.small, code.indices, code.maps, ?_, ?_, ?_⟩ - · intro i hi s hs e P R V index map qField rField mField - exact (code.embedding i hi s hs e P R V index map qField rField mField).enlarge_target - carrier order meets - · intro x hx entry - have retained := fiber x hx entry - obtain ⟨i, hi, part⟩ := code.cover x retained.1 retained.2 - exact ⟨i, hi, ZFSet.mem_sep.2 ⟨part, ZFSet.pair_mem_prod.2 ⟨hi, retained.1⟩⟩⟩ - · intro i hi s hs e P x _ index map qField part - have retained := ZFSet.mem_sep.1 part - exact relationImage_enlarge_target carrier - (code.inCopy i hi s hs e P x (ZFSet.pair_mem_prod.1 retained.2).2 index map qField retained.1) - -theorem SeparatedLayerCode.of_literal_extension - {Qs rs μs A B rA rB μA μB old born t I Indices Maps W Components F : ZFSet.{u}} - (code : SeparatedLayerCode Qs rs μs A rA μA old t I Indices Maps W Components F) - (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) (births : old ⊆ born) - (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : - SeparatedLayerCode Qs rs μs B rB μB born t I Indices Maps W Components F := by - refine ⟨code.indices, code.maps, ?_, code.components, ?_, ?_, ?_⟩ - · rw [code.fiber] - apply ZFSet.ext - intro x - rw [mem_layerBirthFiber, mem_layerBirthFiber] - exact ⟨fun h => ⟨carrier h.1, births h.2⟩, fun h => fiber x h.1 h.2⟩ - · intro i hi s hs e P R V index map qField rField mField - exact (code.embedding i hi s hs e P R V index map qField rField mField).enlarge_target - carrier order meets - · intro i hi s hs e P x _ index map qField component - have inF := (ZFSet.pair_mem_prod.1 (code.components.1 component)).1 - have hx : x ∈ A := ((mem_layerBirthFiber A old t x).1 (code.fiber ▸ inF)).1 - exact relationImage_enlarge_target carrier (code.cover i hi s hs e P x hx index map qField component) - · intro x hx y hy i hi j hj first second different - exact (code.separated x hx y hy i hi j hj first second different).of_literal_extension - carrier order meets births - -namespace GrowthLayerWitnessCode - -theorem exists_literal_extension {M : TransitiveGround.{u}} - {Qs rs μs A B rA rB μA μB old born t N z : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hz : z ∈ M.sets) - (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) (births : old ⊆ born) - (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' := by - rcases code with ⟨D, injection, rfl, code⟩ | - ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | - ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ - · exact ⟨countableLayerWitness D injection, hz, Or.inl ⟨D, injection, rfl, code.of_literal_extension fiber⟩⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ hz - let retained := ZFSet.sep (fun p => p ∈ ZFSet.prod I A) parts - have ground : retained ∈ M.sets := M.injection_restriction_mem separation (fields 1) hA (fields 2) - exact ⟨copyLayerWitness I retained Indices Maps W injection, - M.copyLayerWitness_mem pairing unions (fields 1) ground (fields 3) (fields 4) (fields 5) (fields 6), - Or.inr (Or.inl ⟨I, retained, Indices, Maps, W, injection, rfl, - code.of_literal_extension carrier order meets fiber⟩)⟩ - · exact ⟨separatedLayerWitness I Indices Maps W Components F, hz, - Or.inr (Or.inr ⟨I, Indices, Maps, W, Components, F, rfl, - code.of_literal_extension carrier order meets births fiber⟩)⟩ - -end GrowthLayerWitnessCode - -theorem GrowthLayerWitnessCode.exists_fixedTop_earlier {M : TransitiveGround.{u}} - {Qs rs μs P r μ T birth s t N z : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs P r μ birth t N z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (hP : P ∈ M.sets) (hz : z ∈ M.sets) - (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) (before : t ∈ s) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs (fixedTopCarrier P) - (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t N z' := by - apply code.exists_literal_extension pairing unions separation hP hz - (fixedTopCarrier_subset P) (fixedTopOrder_subset P r) (fixedTopMeet_subset meet) - (fixedTopBirth_subset P birth s) - intro x _ entry - have old := (fixedTopBirth_earlier_iff before).1 entry - exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ - -noncomputable def fixedTopLayerWitness (P : ZFSet.{u}) : ZFSet.{u} := - countableLayerWitness {P} {ZFSet.pair P ∅} - -theorem fixedTopLayerWitness_code {Qs rs μs P r birth s : ZFSet.{u}} - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : - GrowthLayerWitnessCode Qs rs μs (fixedTopCarrier P) (fixedTopOrder P r) - (fixedTopMeet P r) (fixedTopBirth P birth s) s ZFSet.omega (fixedTopLayerWitness P) := by - refine Or.inl ⟨{P}, {ZFSet.pair P ∅}, rfl, fixedTopBirth_singleton_injection P, ?_⟩ - intro x _ entry - exact ZFSet.mem_singleton.2 ((fixedTopBirth_new_time_iff earlier).1 entry) - -theorem TransitiveGround.fixedTopLayerWitness_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {P : ZFSet.{u}} (hP : P ∈ M.sets) : fixedTopLayerWitness P ∈ M.sets := by - have singleton (x : ZFSet.{u}) (hx : x ∈ M.sets) : ({x} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hx hx - exact M.countableLayerWitness_mem pairing (singleton P hP) - (singleton _ (M.orderedPair_mem pairing hP (M.empty_mem ⟨P, hP⟩))) - -end - -namespace GrowthLayerWitnessCode -open SetFormula -universe u - -theorem exists_literal_extension_rank_lt {M : TransitiveGround.{u}} - {Qs rs μs A B rA rB μA μB old born t N z : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hz : z ∈ M.sets) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) - (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) (births : old ⊆ born) - (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' ∧ - ZFSet.rank z' < o := by - rcases code with ⟨D, injection, rfl, code⟩ | - ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | - ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ - · exact ⟨countableLayerWitness D injection, hz, - Or.inl ⟨D, injection, rfl, code.of_literal_extension fiber⟩, rank⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ hz - have ranks := fun j => (rank_nonemptyTupleCode_field_le 6 _ j).trans_lt rank - let retained := ZFSet.sep (fun p => p ∈ ZFSet.prod I A) parts - have ground : retained ∈ M.sets := - M.injection_restriction_mem separation (fields 1) hA (fields 2) - have retainedRank : ZFSet.rank retained < o := - (ZFSet.rank_mono (show retained ⊆ parts from fun _ hp => (ZFSet.mem_sep.1 hp).1)).trans_lt (ranks 2) - exact ⟨copyLayerWitness I retained Indices Maps W injection, - M.copyLayerWitness_mem pairing unions (fields 1) ground (fields 3) (fields 4) (fields 5) (fields 6), - Or.inr (Or.inl ⟨I, retained, Indices, Maps, W, injection, rfl, - code.of_literal_extension carrier order meets fiber⟩), - copyLayerWitness_rank_lt limit (ranks 1) retainedRank (ranks 3) (ranks 4) (ranks 5) (ranks 6)⟩ - · exact ⟨separatedLayerWitness I Indices Maps W Components F, hz, - Or.inr (Or.inr ⟨I, Indices, Maps, W, Components, F, rfl, - code.of_literal_extension carrier order meets births fiber⟩), rank⟩ - -end GrowthLayerWitnessCode - -section -open SetFormula SetRealization -universe u - -theorem GrowthLayerWitnessCode.exists_fixedTop_earlier_rank_lt - {M : TransitiveGround.{u}} {Qs rs μs P r μ T birth s t N z : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs P r μ birth t N z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (hP : P ∈ M.sets) (hz : z ∈ M.sets) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) - (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) (before : t ∈ s) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs (fixedTopCarrier P) - (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t N z' ∧ - ZFSet.rank z' < o := by - apply code.exists_literal_extension_rank_lt pairing unions separation hP hz limit rank - (fixedTopCarrier_subset P) (fixedTopOrder_subset P r) (fixedTopMeet_subset meet) - (fixedTopBirth_subset P birth s) - intro x _ entry - have old := (fixedTopBirth_earlier_iff before).1 entry - exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ - -theorem fixedTopLayerWitness_rank_lt {P : ZFSet.{u}} {o : Ordinal.{u}} - (limit : Order.IsSuccLimit o) (points : ZFSet.rank P < o) : - ZFSet.rank (fixedTopLayerWitness P) < o := - countableLayerWitness_rank_lt limit (rank_singleton_lt limit points) - (rank_singleton_lt limit (rank_orderedPair_lt limit points - (by simpa only [ZFSet.rank_empty] using limit.pos))) - -end - -namespace AttachmentBatchInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) - -theorem exists_batchEarlierLayerWitness - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - {HQs Hrs Hμs T birth stamp t N z : ZFSet.{u}} (hP : P ∈ M.sets) (hz : z ∈ M.sets) - (born : ZFSet.IsFunc P T birth) (before : t ∈ stamp) - (code : GrowthLayerWitnessCode HQs Hrs Hμs P r μ birth t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - d.batchCarrier d.batchOrder d.batchMeetGraph (d.batchBirth birth stamp) t N z' := by - have meetSubset : μ ⊆ d.batchMeetGraph := by - intro z hz - obtain ⟨xy, hxy, v, hv, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.operation.1 hz) - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - exact d.old_meet_entry hz - apply code.exists_literal_extension pairing unions separation hP hz - (fun _ => old_mem_taggedExtension) ?_ meetSubset (taggedBirth_subset _ _ _ _) - · intro x _ entry - have old := (taggedBirth_earlier_iff before).1 entry - exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ - · intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.order.relation hz) - exact (d.old_order_iff hx hy).2 hz - -end AttachmentBatchInputs - -namespace GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old HQs Hrs Hμs t N z : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include pairing unions powers separation hI hSources hReps hG hT limit - -theorem exists_birthWitness_to_finite_rank_lt (n k : Nat) (before : n ≤ k) - (earlier : t ∈ compressionStamp base n) (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) - (code : GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T n).D - (state.data.iterate M I Sources Reps G T n).rD - (state.data.iterate M I Sources Reps G T n).μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T k).D - (state.data.iterate M I Sources Reps G T k).rD - (state.data.iterate M I Sources Reps G T k).μD - (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' ∧ ZFSet.rank z' < o := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - have growth := state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT before - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier - exact code.exists_literal_extension_rank_lt pairing unions separation ground hz limit rank growth.1 growth.2.1 growth.2.2.1 - (NatBirthExtensionCode.restriction_mono mono before) - (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function - (fun _ _ h => compressionStamp_subset base h) n earlier - (pair_mem_graphRestriction.1 entry).1) - -theorem exists_birthWitness_to_union_rank_lt (n : Nat) (before : t ∈ compressionStamp base n) - (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) - (code : GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T n).D - (state.data.iterate M I Sources Reps G T n).rD - (state.data.iterate M I Sources Reps G T n).μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' ∧ ZFSet.rank z' < o := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier - exact code.exists_literal_extension_rank_lt pairing unions separation ground hz limit rank - ((data.fieldUnion 0).subset n) ((data.fieldUnion 1).subset n) ((data.fieldUnion 2).subset n) - (graphRestriction_subset (state.data.iterate M I Sources Reps G T n).D births.birth) - (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function - (fun _ _ h => compressionStamp_subset base h) n before entry) - -theorem exists_priorWitness_to_finite_rank_lt (k : Nat) (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) - (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T k).D - (state.data.iterate M I Sources Reps G T k).rD - (state.data.iterate M I Sources Reps G T k).μD - (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' ∧ ZFSet.rank z' < o := by - apply state.exists_birthWitness_to_finite_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit - 0 k (Nat.zero_le k) (compressionStamp_old_mem before 0) hz rank - simpa only [RecursiveStateData.iterate_zero, births.original] using code - -theorem exists_priorWitness_to_union_rank_lt (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) - (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' ∧ ZFSet.rank z' < o := by - apply state.exists_birthWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit - 0 (compressionStamp_old_mem before 0) hz rank - simpa only [RecursiveStateData.iterate_zero, births.original] using code - -omit unions powers separation hI hSources hReps hG hT in -theorem exists_limitWitness_rank_lt : - ∃ z ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (data.fields 0) (data.fields 1) (data.fields 2) births.birth births.limit N z ∧ ZFSet.rank z < o := by - have hEmpty := M.empty_mem ⟨data.fields 0, data.ground 0⟩ - exact ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, - Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty N, fun x _ entry => (births.no_limit_birth x entry).elim⟩⟩, - countableLayerWitness_rank_lt limit (by simpa only [ZFSet.rank_empty] using limit.pos) - (by simpa only [ZFSet.rank_empty] using limit.pos)⟩ - -end GroundCompressionState - -namespace GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old HQs Hrs Hμs t N z : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem exists_birthWitness_to_finite (n k : Nat) (before : n ≤ k) - (earlier : t ∈ compressionStamp base n) (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T n).D - (state.data.iterate M I Sources Reps G T n).rD - (state.data.iterate M I Sources Reps G T n).μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T k).D - (state.data.iterate M I Sources Reps G T k).rD - (state.data.iterate M I Sources Reps G T k).μD - (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - have growth := state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT before - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier - exact code.exists_literal_extension pairing unions separation ground hz growth.1 growth.2.1 growth.2.2.1 - (NatBirthExtensionCode.restriction_mono mono before) - (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function - (fun _ _ h => compressionStamp_subset base h) n earlier - (pair_mem_graphRestriction.1 entry).1) - -theorem exists_birthWitness_to_union (n : Nat) (before : t ∈ compressionStamp base n) - (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T n).D - (state.data.iterate M I Sources Reps G T n).rD - (state.data.iterate M I Sources Reps G T n).μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier - exact code.exists_literal_extension pairing unions separation ground hz - ((data.fieldUnion 0).subset n) ((data.fieldUnion 1).subset n) ((data.fieldUnion 2).subset n) - (graphRestriction_subset (state.data.iterate M I Sources Reps G T n).D births.birth) - (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function - (fun _ _ h => compressionStamp_subset base h) n before entry) - -theorem exists_priorWitness_to_finite (k : Nat) (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T k).D - (state.data.iterate M I Sources Reps G T k).rD - (state.data.iterate M I Sources Reps G T k).μD - (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' := by - apply state.exists_birthWitness_to_finite data births pairing unions powers separation hI hSources hReps hG hT - 0 k (Nat.zero_le k) (compressionStamp_old_mem before 0) hz - simpa only [RecursiveStateData.iterate_zero, births.original] using code - -theorem exists_priorWitness_to_union (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' := by - apply state.exists_birthWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT - 0 (compressionStamp_old_mem before 0) hz - simpa only [RecursiveStateData.iterate_zero, births.original] using code - -omit unions powers separation hI hSources hReps hG hT in -theorem exists_limitWitness : - ∃ z ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (data.fields 0) (data.fields 1) (data.fields 2) births.birth births.limit N z := by - have hEmpty := M.empty_mem ⟨data.fields 0, data.ground 0⟩ - exact ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, - Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty N, fun x _ entry => (births.no_limit_birth x entry).elim⟩⟩⟩ - -end GroundCompressionState - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +theorem CountableLayerCode.of_literal_extension + {A B old born t D N injection : ZFSet.{u}} + (code : CountableLayerCode A old t D N injection) + (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : + CountableLayerCode B born t D N injection := + ⟨code.small, fun x hx entry => code.cover x (fiber x hx entry).1 (fiber x hx entry).2⟩ + +theorem CopyLayerCode.of_literal_extension + {Qs rs μs A B rA rB μA μB old born t I parts Indices Maps W N injection : ZFSet.{u}} + (code : CopyLayerCode Qs rs μs A rA μA old t I parts Indices Maps W N injection) + (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) + (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : + CopyLayerCode Qs rs μs B rB μB born t I + (ZFSet.sep (fun p => p ∈ ZFSet.prod I A) parts) Indices Maps W N injection := by + refine ⟨code.small, code.indices, code.maps, ?_, ?_, ?_⟩ + · intro i hi s hs e P R V index map qField rField mField + exact (code.embedding i hi s hs e P R V index map qField rField mField).enlarge_target + carrier order meets + · intro x hx entry + have retained := fiber x hx entry + obtain ⟨i, hi, part⟩ := code.cover x retained.1 retained.2 + exact ⟨i, hi, ZFSet.mem_sep.2 ⟨part, ZFSet.pair_mem_prod.2 ⟨hi, retained.1⟩⟩⟩ + · intro i hi s hs e P x _ index map qField part + have retained := ZFSet.mem_sep.1 part + exact relationImage_enlarge_target carrier + (code.inCopy i hi s hs e P x (ZFSet.pair_mem_prod.1 retained.2).2 index map qField retained.1) + +theorem SeparatedLayerCode.of_literal_extension + {Qs rs μs A B rA rB μA μB old born t I Indices Maps W Components F : ZFSet.{u}} + (code : SeparatedLayerCode Qs rs μs A rA μA old t I Indices Maps W Components F) + (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) (births : old ⊆ born) + (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : + SeparatedLayerCode Qs rs μs B rB μB born t I Indices Maps W Components F := by + refine ⟨code.indices, code.maps, ?_, code.components, ?_, ?_, ?_⟩ + · rw [code.fiber] + apply ZFSet.ext + intro x + rw [mem_layerBirthFiber, mem_layerBirthFiber] + exact ⟨fun h => ⟨carrier h.1, births h.2⟩, fun h => fiber x h.1 h.2⟩ + · intro i hi s hs e P R V index map qField rField mField + exact (code.embedding i hi s hs e P R V index map qField rField mField).enlarge_target + carrier order meets + · intro i hi s hs e P x _ index map qField component + have inF := (ZFSet.pair_mem_prod.1 (code.components.1 component)).1 + have hx : x ∈ A := ((mem_layerBirthFiber A old t x).1 (code.fiber ▸ inF)).1 + exact relationImage_enlarge_target carrier (code.cover i hi s hs e P x hx index map qField component) + · intro x hx y hy i hi j hj first second different + exact (code.separated x hx y hy i hi j hj first second different).of_literal_extension + carrier order meets births + +namespace GrowthLayerWitnessCode + +theorem exists_literal_extension {M : TransitiveGround.{u}} + {Qs rs μs A B rA rB μA μB old born t N z : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hz : z ∈ M.sets) + (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) (births : old ⊆ born) + (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' := by + rcases code with ⟨D, injection, rfl, code⟩ | + ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | + ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ + · exact ⟨countableLayerWitness D injection, hz, Or.inl ⟨D, injection, rfl, code.of_literal_extension fiber⟩⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ hz + let retained := ZFSet.sep (fun p => p ∈ ZFSet.prod I A) parts + have ground : retained ∈ M.sets := M.injection_restriction_mem separation (fields 1) hA (fields 2) + exact ⟨copyLayerWitness I retained Indices Maps W injection, + M.copyLayerWitness_mem pairing unions (fields 1) ground (fields 3) (fields 4) (fields 5) (fields 6), + Or.inr (Or.inl ⟨I, retained, Indices, Maps, W, injection, rfl, + code.of_literal_extension carrier order meets fiber⟩)⟩ + · exact ⟨separatedLayerWitness I Indices Maps W Components F, hz, + Or.inr (Or.inr ⟨I, Indices, Maps, W, Components, F, rfl, + code.of_literal_extension carrier order meets births fiber⟩)⟩ + +end GrowthLayerWitnessCode + +theorem GrowthLayerWitnessCode.exists_fixedTop_earlier {M : TransitiveGround.{u}} + {Qs rs μs P r μ T birth s t N z : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs P r μ birth t N z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (hP : P ∈ M.sets) (hz : z ∈ M.sets) + (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) (before : t ∈ s) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs (fixedTopCarrier P) + (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t N z' := by + apply code.exists_literal_extension pairing unions separation hP hz + (fixedTopCarrier_subset P) (fixedTopOrder_subset P r) (fixedTopMeet_subset meet) + (fixedTopBirth_subset P birth s) + intro x _ entry + have old := (fixedTopBirth_earlier_iff before).1 entry + exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ + +noncomputable def fixedTopLayerWitness (P : ZFSet.{u}) : ZFSet.{u} := + countableLayerWitness {P} {ZFSet.pair P ∅} + +theorem fixedTopLayerWitness_code {Qs rs μs P r birth s : ZFSet.{u}} + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : + GrowthLayerWitnessCode Qs rs μs (fixedTopCarrier P) (fixedTopOrder P r) + (fixedTopMeet P r) (fixedTopBirth P birth s) s ZFSet.omega (fixedTopLayerWitness P) := by + refine Or.inl ⟨{P}, {ZFSet.pair P ∅}, rfl, fixedTopBirth_singleton_injection P, ?_⟩ + intro x _ entry + exact ZFSet.mem_singleton.2 ((fixedTopBirth_new_time_iff earlier).1 entry) + +theorem TransitiveGround.fixedTopLayerWitness_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {P : ZFSet.{u}} (hP : P ∈ M.sets) : fixedTopLayerWitness P ∈ M.sets := by + have singleton (x : ZFSet.{u}) (hx : x ∈ M.sets) : ({x} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hx hx + exact M.countableLayerWitness_mem pairing (singleton P hP) + (singleton _ (M.orderedPair_mem pairing hP (M.empty_mem ⟨P, hP⟩))) + +end + +namespace GrowthLayerWitnessCode +open SetFormula +universe u + +theorem exists_literal_extension_rank_lt {M : TransitiveGround.{u}} + {Qs rs μs A B rA rB μA μB old born t N z : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hz : z ∈ M.sets) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) + (carrier : A ⊆ B) (order : rA ⊆ rB) (meets : μA ⊆ μB) (births : old ⊆ born) + (fiber : ∀ x ∈ B, ZFSet.pair x t ∈ born → x ∈ A ∧ ZFSet.pair x t ∈ old) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' ∧ + ZFSet.rank z' < o := by + rcases code with ⟨D, injection, rfl, code⟩ | + ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | + ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ + · exact ⟨countableLayerWitness D injection, hz, + Or.inl ⟨D, injection, rfl, code.of_literal_extension fiber⟩, rank⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ hz + have ranks := fun j => (rank_nonemptyTupleCode_field_le 6 _ j).trans_lt rank + let retained := ZFSet.sep (fun p => p ∈ ZFSet.prod I A) parts + have ground : retained ∈ M.sets := + M.injection_restriction_mem separation (fields 1) hA (fields 2) + have retainedRank : ZFSet.rank retained < o := + (ZFSet.rank_mono (show retained ⊆ parts from fun _ hp => (ZFSet.mem_sep.1 hp).1)).trans_lt (ranks 2) + exact ⟨copyLayerWitness I retained Indices Maps W injection, + M.copyLayerWitness_mem pairing unions (fields 1) ground (fields 3) (fields 4) (fields 5) (fields 6), + Or.inr (Or.inl ⟨I, retained, Indices, Maps, W, injection, rfl, + code.of_literal_extension carrier order meets fiber⟩), + copyLayerWitness_rank_lt limit (ranks 1) retainedRank (ranks 3) (ranks 4) (ranks 5) (ranks 6)⟩ + · exact ⟨separatedLayerWitness I Indices Maps W Components F, hz, + Or.inr (Or.inr ⟨I, Indices, Maps, W, Components, F, rfl, + code.of_literal_extension carrier order meets births fiber⟩), rank⟩ + +end GrowthLayerWitnessCode + +section +open SetFormula SetRealization +universe u + +theorem GrowthLayerWitnessCode.exists_fixedTop_earlier_rank_lt + {M : TransitiveGround.{u}} {Qs rs μs P r μ T birth s t N z : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs P r μ birth t N z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (hP : P ∈ M.sets) (hz : z ∈ M.sets) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) + (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) (before : t ∈ s) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs (fixedTopCarrier P) + (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t N z' ∧ + ZFSet.rank z' < o := by + apply code.exists_literal_extension_rank_lt pairing unions separation hP hz limit rank + (fixedTopCarrier_subset P) (fixedTopOrder_subset P r) (fixedTopMeet_subset meet) + (fixedTopBirth_subset P birth s) + intro x _ entry + have old := (fixedTopBirth_earlier_iff before).1 entry + exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ + +theorem fixedTopLayerWitness_rank_lt {P : ZFSet.{u}} {o : Ordinal.{u}} + (limit : Order.IsSuccLimit o) (points : ZFSet.rank P < o) : + ZFSet.rank (fixedTopLayerWitness P) < o := + countableLayerWitness_rank_lt limit (rank_singleton_lt limit points) + (rank_singleton_lt limit (rank_orderedPair_lt limit points + (by simpa only [ZFSet.rank_empty] using limit.pos))) + +end + +namespace AttachmentBatchInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) + +theorem exists_batchEarlierLayerWitness + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + {HQs Hrs Hμs T birth stamp t N z : ZFSet.{u}} (hP : P ∈ M.sets) (hz : z ∈ M.sets) + (born : ZFSet.IsFunc P T birth) (before : t ∈ stamp) + (code : GrowthLayerWitnessCode HQs Hrs Hμs P r μ birth t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + d.batchCarrier d.batchOrder d.batchMeetGraph (d.batchBirth birth stamp) t N z' := by + have meetSubset : μ ⊆ d.batchMeetGraph := by + intro z hz + obtain ⟨xy, hxy, v, hv, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.operation.1 hz) + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + exact d.old_meet_entry hz + apply code.exists_literal_extension pairing unions separation hP hz + (fun _ => old_mem_taggedExtension) ?_ meetSubset (taggedBirth_subset _ _ _ _) + · intro x _ entry + have old := (taggedBirth_earlier_iff before).1 entry + exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ + · intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.order.relation hz) + exact (d.old_order_iff hx hy).2 hz + +end AttachmentBatchInputs + +namespace GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old HQs Hrs Hμs t N z : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include pairing unions powers separation hI hSources hReps hG hT limit + +theorem exists_birthWitness_to_finite_rank_lt (n k : Nat) (before : n ≤ k) + (earlier : t ∈ compressionStamp base n) (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) + (code : GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T n).D + (state.data.iterate M I Sources Reps G T n).rD + (state.data.iterate M I Sources Reps G T n).μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T k).D + (state.data.iterate M I Sources Reps G T k).rD + (state.data.iterate M I Sources Reps G T k).μD + (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' ∧ ZFSet.rank z' < o := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + have growth := state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT before + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier + exact code.exists_literal_extension_rank_lt pairing unions separation ground hz limit rank growth.1 growth.2.1 growth.2.2.1 + (NatBirthExtensionCode.restriction_mono mono before) + (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function + (fun _ _ h => compressionStamp_subset base h) n earlier + (pair_mem_graphRestriction.1 entry).1) + +theorem exists_birthWitness_to_union_rank_lt (n : Nat) (before : t ∈ compressionStamp base n) + (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) + (code : GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T n).D + (state.data.iterate M I Sources Reps G T n).rD + (state.data.iterate M I Sources Reps G T n).μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' ∧ ZFSet.rank z' < o := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier + exact code.exists_literal_extension_rank_lt pairing unions separation ground hz limit rank + ((data.fieldUnion 0).subset n) ((data.fieldUnion 1).subset n) ((data.fieldUnion 2).subset n) + (graphRestriction_subset (state.data.iterate M I Sources Reps G T n).D births.birth) + (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function + (fun _ _ h => compressionStamp_subset base h) n before entry) + +theorem exists_priorWitness_to_finite_rank_lt (k : Nat) (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) + (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T k).D + (state.data.iterate M I Sources Reps G T k).rD + (state.data.iterate M I Sources Reps G T k).μD + (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' ∧ ZFSet.rank z' < o := by + apply state.exists_birthWitness_to_finite_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit + 0 k (Nat.zero_le k) (compressionStamp_old_mem before 0) hz rank + simpa only [RecursiveStateData.iterate_zero, births.original] using code + +theorem exists_priorWitness_to_union_rank_lt (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) (rank : ZFSet.rank z < o) + (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' ∧ ZFSet.rank z' < o := by + apply state.exists_birthWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit + 0 (compressionStamp_old_mem before 0) hz rank + simpa only [RecursiveStateData.iterate_zero, births.original] using code + +omit unions powers separation hI hSources hReps hG hT in +theorem exists_limitWitness_rank_lt : + ∃ z ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (data.fields 0) (data.fields 1) (data.fields 2) births.birth births.limit N z ∧ ZFSet.rank z < o := by + have hEmpty := M.empty_mem ⟨data.fields 0, data.ground 0⟩ + exact ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, + Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty N, fun x _ entry => (births.no_limit_birth x entry).elim⟩⟩, + countableLayerWitness_rank_lt limit (by simpa only [ZFSet.rank_empty] using limit.pos) + (by simpa only [ZFSet.rank_empty] using limit.pos)⟩ + +end GroundCompressionState + +namespace GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old HQs Hrs Hμs t N z : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem exists_birthWitness_to_finite (n k : Nat) (before : n ≤ k) + (earlier : t ∈ compressionStamp base n) (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T n).D + (state.data.iterate M I Sources Reps G T n).rD + (state.data.iterate M I Sources Reps G T n).μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T k).D + (state.data.iterate M I Sources Reps G T k).rD + (state.data.iterate M I Sources Reps G T k).μD + (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + have growth := state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT before + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier + exact code.exists_literal_extension pairing unions separation ground hz growth.1 growth.2.1 growth.2.2.1 + (NatBirthExtensionCode.restriction_mono mono before) + (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function + (fun _ _ h => compressionStamp_subset base h) n earlier + (pair_mem_graphRestriction.1 entry).1) + +theorem exists_birthWitness_to_union (n : Nat) (before : t ∈ compressionStamp base n) + (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T n).D + (state.data.iterate M I Sources Reps G T n).rD + (state.data.iterate M I Sources Reps G T n).μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := equal ▸ current.ground.carrier + exact code.exists_literal_extension pairing unions separation ground hz + ((data.fieldUnion 0).subset n) ((data.fieldUnion 1).subset n) ((data.fieldUnion 2).subset n) + (graphRestriction_subset (state.data.iterate M I Sources Reps G T n).D births.birth) + (fun _ _ entry => births.extension.earlier_fiber mono births.initial_function + (fun _ _ h => compressionStamp_subset base h) n before entry) + +theorem exists_priorWitness_to_finite (k : Nat) (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T k).D + (state.data.iterate M I Sources Reps G T k).rD + (state.data.iterate M I Sources Reps G T k).μD + (graphRestriction (state.data.iterate M I Sources Reps G T k).D births.birth) t N z' := by + apply state.exists_birthWitness_to_finite data births pairing unions powers separation hI hSources hReps hG hT + 0 k (Nat.zero_le k) (compressionStamp_old_mem before 0) hz + simpa only [RecursiveStateData.iterate_zero, births.original] using code + +theorem exists_priorWitness_to_union (before : t ∈ base ∨ t = base) (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode HQs Hrs Hμs state.data.D state.data.rD state.data.μD old t N z) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (data.fields 0) (data.fields 1) (data.fields 2) births.birth t N z' := by + apply state.exists_birthWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT + 0 (compressionStamp_old_mem before 0) hz + simpa only [RecursiveStateData.iterate_zero, births.original] using code + +omit unions powers separation hI hSources hReps hG hT in +theorem exists_limitWitness : + ∃ z ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (data.fields 0) (data.fields 1) (data.fields 2) births.birth births.limit N z := by + have hEmpty := M.empty_mem ⟨data.fields 0, data.ground 0⟩ + exact ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, + Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty N, fun x _ entry => (births.no_limit_birth x entry).elim⟩⟩⟩ + +end GroundCompressionState + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameCodes.lean index 6b85d12a3da5dfd1b685ec42eaceec816683365b..2365df93073889b0a2c58207852130fb63d3f103 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameCodes.lean @@ -1,302 +1,302 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBinaryRowSets - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def binaryRowEntryFormula {n} (z c q i one bit : Fin n) : SetFormula n := - ex (ex (ex (.conj (.mem 2 c.succ.succ.succ) - (.conj (.mem 1 q.succ.succ.succ) - (.conj (binaryApplication uniformCheckFormula (extend one.succ.succ.succ Fin.elim0) 2 0) - (.conj (BoundedFormula.tripleMembershipFormula i.succ.succ.succ 2 bit.succ.succ.succ 1).toFormula - (orderedPairFormula z.succ.succ.succ 0 1))))))) - -def binaryRowCodeFormula : SetFormula 6 := - let entry := reindex (extend 0 (extend 3 (extend 4 (extend 1 - (extend 5 (extend 6 Fin.elim0)))))) (binaryRowEntryFormula 0 1 2 3 4 5) - .all (.conj (imp (.mem 0 2) entry) (imp entry (.mem 0 2))) - -def binaryRowSetEntryFormula : SetFormula 6 := - ex (ex (.conj (.mem 1 3) - (.conj (binaryApplication binaryRowCodeFormula - (extend 4 (extend 5 (extend 6 (extend 7 Fin.elim0)))) 1 0) - (orderedPairFormula 2 0 6)))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_binaryRowEntryFormula (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (i : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hC : C ∈ M.sets) - (hQ : M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega ∈ M.sets) - (hi : i ∈ M.sets) (hbit : (natSetCode 1 : ZFSet.{u}) ∈ M.sets) - (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets (binaryRowEntryFormula 0 1 2 3 4 5) - (extend z (extend C (extend - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) - (extend i (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))))) ↔ - z ∈ (M.binaryRowName I C one i).val := by - let Q := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let s := SetMembers.presentation Q - have hone : s.encode one ∈ M.sets := M.transitive hQ (SetMembers.raw_mem one) - have children (c : ZFSet.{u}) (hc : c ∈ C) : (Name.check s one c).val ∈ M.sets := - M.check_mem s one pairing unions powers separation collection hone c (M.transitive hC hc) - have assignment (c p w : ZFSet.{u}) (hc : c ∈ M.sets) (hp : p ∈ M.sets) (hw : w ∈ M.sets) : - Realize M.sets (BoundedFormula.tripleMembershipFormula 6 2 8 1).toFormula - (extend w (extend p (extend c (extend z (extend C (extend Q - (extend i (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0))))))))) ↔ - ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ p := - (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hw (Fin.cases hp (Fin.cases hc (Fin.cases hz (Fin.cases hC - (Fin.cases hQ (Fin.cases hi (Fin.cases hone (Fin.cases hbit (fun j => Fin.elim0 j))))))))))).trans - (BoundedFormula.truth_tripleMembershipFormula 6 2 8 1 _) - rw [binaryRowEntryFormula, realize_ex] - constructor - · rintro ⟨c, hcM, rest⟩ - obtain ⟨p, hpM, rest⟩ := (realize_ex M.sets _ _).1 rest - obtain ⟨w, hwM, hc, hp, checked, assigned, shape⟩ := (realize_ex M.sets _ _).1 rest - rw [realize_binaryApplication, map_extend, map_empty] at checked - have eq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection - hone c w hcM hwM).1 checked - have pair := (M.realize_orderedPairFormula pairing 3 0 1 _ hz hwM hpM).1 shape - apply (M.mem_binaryRowName_code I C one i z).2 - exact ⟨c, hc, p, hp, - pair.trans (congrArg (fun v => ZFSet.pair v p) eq), (assignment c p w hcM hpM hwM).1 assigned⟩ - · intro member - obtain ⟨c, hc, p, hp, shape, assigned⟩ := (M.mem_binaryRowName_code I C one i z).1 member - have hcM := M.transitive hC hc - have hpM := M.transitive hQ hp - refine ⟨c, hcM, ?_⟩ - rw [realize_ex] - refine ⟨p, hpM, ?_⟩ - rw [realize_ex] - refine ⟨(Name.check s one c).val, children c hc, hc, hp, ?_, ?_, ?_⟩ - · rw [realize_binaryApplication, map_extend, map_empty] - exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection - hone c _ hcM (children c hc)).2 rfl - · exact (assignment c p _ hcM hpM (children c hc)).2 assigned - · exact (M.realize_orderedPairFormula pairing 3 0 1 _ hz (children c hc) hpM).2 shape - -theorem binaryRowName_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (i : ZFSet.{u}) (hi : i ∈ M.sets) : (M.binaryRowName I C one i).val ∈ M.sets := by - let Q := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let s := SetMembers.presentation Q - have hQ : Q ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) - have hone : s.encode one ∈ M.sets := M.transitive hQ (SetMembers.raw_mem one) - have hcheck := M.check_mem s one pairing unions powers separation collection hone C hC - have childBound (c : ZFSet.{u}) (hc : c ∈ C) : - (Name.check s one c).val ∈ ZFSet.sUnion (ZFSet.sUnion (Name.check s one C).val) := - Name.child_mem_doubleUnion ((Name.entry_check one C (Name.check s one c) one).2 ⟨c, hc, rfl, rfl⟩) - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers - (M.union_mem unions (M.union_mem unions hcheck)) hQ - have bound : (M.binaryRowName I C one i).val ⊆ B := by - intro z hz - obtain ⟨c, hc, p, hp, eq, _⟩ := (M.mem_binaryRowName_code I C one i z).1 hz - exact eq.symm ▸ pairBound _ (childBound c hc) p hp - let params := extend C (extend Q (extend i (extend (SetMembers.raw one) - (extend (natSetCode 1) Fin.elim0)))) - have hbit := M.natSetCode_mem separation infinite 1 - have selected := M.separation_mem separation (binaryRowEntryFormula 0 1 2 3 4 5) params - (Fin.cases hC (Fin.cases hQ (Fin.cases hi (Fin.cases hone - (Fin.cases hbit (fun j => Fin.elim0 j)))))) hB - have eq : ZFSet.sep (fun z => Realize M.sets (binaryRowEntryFormula 0 1 2 3 4 5) - (extend z params)) B = (M.binaryRowName I C one i).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection - hC hQ hi hbit z (M.transitive hB hz)).1 rel - · intro hz - exact ⟨bound hz, (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection - hC hQ hi hbit z (M.transitive hB (bound hz))).2 hz⟩ - exact eq ▸ selected - -theorem realize_binaryRowCodeFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (i w : ZFSet.{u}) (hi : i ∈ M.sets) (hw : w ∈ M.sets) : - Realize M.sets binaryRowCodeFormula (extend i (extend w (extend C (extend - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) - (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))))) ↔ - w = (M.binaryRowName I C one i).val := by - have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) - have hname := M.binaryRowName_mem pairing unions powers separation collection infinite hI hC one i hi - have hbit := M.natSetCode_mem separation infinite 1 - rw [binaryRowCodeFormula] - constructor - · intro spec - apply ZFSet.ext - intro z - constructor - · intro hz - have hzM := M.transitive hw hz - have rel := (realize_imp M.sets _ _ _).1 (spec z hzM).1 hz - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, - map_extend, map_empty] at rel - exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection - hC hQ hi hbit z hzM).1 rel - · intro hz - have hzM := M.transitive hname hz - apply (realize_imp M.sets _ _ _).1 (spec z hzM).2 - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, - map_extend, map_empty] - exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection - hC hQ hi hbit z hzM).2 hz - · intro eq z hzM - constructor - · apply (realize_imp M.sets _ _ _).2 - intro hz - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, - map_extend, map_empty] - exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection - hC hQ hi hbit z hzM).2 (eq ▸ hz) - · apply (realize_imp M.sets _ _ _).2 - intro rel - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, - map_extend, map_empty] at rel - exact eq.symm ▸ (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection - hC hQ hi hbit z hzM).1 rel - -theorem exists_binaryRowName_bound - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : - ∃ W ∈ M.sets, ∀ i ∈ I, (M.binaryRowName I C one i).val ∈ W := by - let Q := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - have hQ : Q ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) - have hone := M.transitive hQ (SetMembers.raw_mem one) - let params := extend C (extend Q (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0))) - have members : ∀ j, params j ∈ M.sets := Fin.cases hC (Fin.cases hQ - (Fin.cases hone (Fin.cases (M.natSetCode_mem separation infinite 1) (fun j => Fin.elim0 j)))) - have witnesses : ∀ i ∈ I, ∃ w ∈ M.sets, - Realize M.sets binaryRowCodeFormula (extend i (extend w params)) := by - intro i hi - have hiM := M.transitive hI hi - have hname := M.binaryRowName_mem pairing unions powers separation collection infinite hI hC one i hiM - exact ⟨(M.binaryRowName I C one i).val, hname, - (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite - hI hC one i _ hiM hname).2 rfl⟩ - obtain ⟨W, hW, covers⟩ := M.collection_witness collection binaryRowCodeFormula params members hI witnesses - refine ⟨W, hW, ?_⟩ - intro i hi - obtain ⟨w, hw, code⟩ := covers i hi - have eq := (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite - hI hC one i w (M.transitive hI hi) (M.transitive hW hw)).1 code - exact eq ▸ hw - -theorem realize_binaryRowSetEntryFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets binaryRowSetEntryFormula (extend z (extend I (extend C (extend - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) - (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))))) ↔ - z ∈ (M.binaryRowSetName I C one).val := by - have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) - have hone := M.transitive hQ (SetMembers.raw_mem one) - rw [binaryRowSetEntryFormula, realize_ex] - constructor - · rintro ⟨i, hiM, rest⟩ - obtain ⟨w, hwM, hi, code, shape⟩ := (realize_ex M.sets _ _).1 rest - rw [realize_binaryApplication, map_extend, map_extend, map_extend, map_extend, map_empty] at code - have eq := (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite - hI hC one i w hiM hwM).1 code - have pair := (M.realize_orderedPairFormula pairing 2 0 6 _ hz hwM hone).1 shape - exact (M.mem_binaryRowSetName_code I C one z).2 - ⟨i, hi, pair.trans (congrArg (fun v => ZFSet.pair v (SetMembers.raw one)) eq)⟩ - · intro member - obtain ⟨i, hi, shape⟩ := (M.mem_binaryRowSetName_code I C one z).1 member - have hiM := M.transitive hI hi - have hname := M.binaryRowName_mem pairing unions powers separation collection infinite hI hC one i hiM - refine ⟨i, hiM, ?_⟩ - rw [realize_ex] - refine ⟨(M.binaryRowName I C one i).val, hname, hi, ?_, ?_⟩ - · rw [realize_binaryApplication, map_extend, map_extend, map_extend, map_extend, map_empty] - exact (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite - hI hC one i _ hiM hname).2 rfl - · exact (M.realize_orderedPairFormula pairing 2 0 6 _ hz hname hone).2 shape - -theorem binaryRowSetName_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : - (M.binaryRowSetName I C one).val ∈ M.sets := by - have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) - have hone := M.transitive hQ (SetMembers.raw_mem one) - obtain ⟨W, hW, inW⟩ := M.exists_binaryRowName_bound pairing unions powers separation collection infinite - hI hC one - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW - (M.unorderedPair_mem pairing hone hone) - have bound : (M.binaryRowSetName I C one).val ⊆ B := by - intro z hz - obtain ⟨i, hi, eq⟩ := (M.mem_binaryRowSetName_code I C one z).1 hz - exact eq.symm ▸ pairBound _ (inW i hi) _ (ZFSet.mem_pair.2 (Or.inl rfl)) - let params := extend I (extend C (extend - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) - (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))) - have selected := M.separation_mem separation binaryRowSetEntryFormula params - (Fin.cases hI (Fin.cases hC (Fin.cases hQ (Fin.cases hone - (Fin.cases (M.natSetCode_mem separation infinite 1) (fun j => Fin.elim0 j)))))) hB - have eq : ZFSet.sep (fun z => Realize M.sets binaryRowSetEntryFormula - (extend z params)) B = (M.binaryRowSetName I C one).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (M.realize_binaryRowSetEntryFormula pairing unions powers separation collection infinite - hI hC one z (M.transitive hB hz)).1 rel - · intro hz - exact ⟨bound hz, (M.realize_binaryRowSetEntryFormula pairing unions powers separation collection infinite - hI hC one z (M.transitive hB (bound hz))).2 hz⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBinaryRowSets + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def binaryRowEntryFormula {n} (z c q i one bit : Fin n) : SetFormula n := + ex (ex (ex (.conj (.mem 2 c.succ.succ.succ) + (.conj (.mem 1 q.succ.succ.succ) + (.conj (binaryApplication uniformCheckFormula (extend one.succ.succ.succ Fin.elim0) 2 0) + (.conj (BoundedFormula.tripleMembershipFormula i.succ.succ.succ 2 bit.succ.succ.succ 1).toFormula + (orderedPairFormula z.succ.succ.succ 0 1))))))) + +def binaryRowCodeFormula : SetFormula 6 := + let entry := reindex (extend 0 (extend 3 (extend 4 (extend 1 + (extend 5 (extend 6 Fin.elim0)))))) (binaryRowEntryFormula 0 1 2 3 4 5) + .all (.conj (imp (.mem 0 2) entry) (imp entry (.mem 0 2))) + +def binaryRowSetEntryFormula : SetFormula 6 := + ex (ex (.conj (.mem 1 3) + (.conj (binaryApplication binaryRowCodeFormula + (extend 4 (extend 5 (extend 6 (extend 7 Fin.elim0)))) 1 0) + (orderedPairFormula 2 0 6)))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_binaryRowEntryFormula (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (i : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hC : C ∈ M.sets) + (hQ : M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega ∈ M.sets) + (hi : i ∈ M.sets) (hbit : (natSetCode 1 : ZFSet.{u}) ∈ M.sets) + (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets (binaryRowEntryFormula 0 1 2 3 4 5) + (extend z (extend C (extend + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) + (extend i (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))))) ↔ + z ∈ (M.binaryRowName I C one i).val := by + let Q := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let s := SetMembers.presentation Q + have hone : s.encode one ∈ M.sets := M.transitive hQ (SetMembers.raw_mem one) + have children (c : ZFSet.{u}) (hc : c ∈ C) : (Name.check s one c).val ∈ M.sets := + M.check_mem s one pairing unions powers separation collection hone c (M.transitive hC hc) + have assignment (c p w : ZFSet.{u}) (hc : c ∈ M.sets) (hp : p ∈ M.sets) (hw : w ∈ M.sets) : + Realize M.sets (BoundedFormula.tripleMembershipFormula 6 2 8 1).toFormula + (extend w (extend p (extend c (extend z (extend C (extend Q + (extend i (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0))))))))) ↔ + ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ p := + (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hw (Fin.cases hp (Fin.cases hc (Fin.cases hz (Fin.cases hC + (Fin.cases hQ (Fin.cases hi (Fin.cases hone (Fin.cases hbit (fun j => Fin.elim0 j))))))))))).trans + (BoundedFormula.truth_tripleMembershipFormula 6 2 8 1 _) + rw [binaryRowEntryFormula, realize_ex] + constructor + · rintro ⟨c, hcM, rest⟩ + obtain ⟨p, hpM, rest⟩ := (realize_ex M.sets _ _).1 rest + obtain ⟨w, hwM, hc, hp, checked, assigned, shape⟩ := (realize_ex M.sets _ _).1 rest + rw [realize_binaryApplication, map_extend, map_empty] at checked + have eq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection + hone c w hcM hwM).1 checked + have pair := (M.realize_orderedPairFormula pairing 3 0 1 _ hz hwM hpM).1 shape + apply (M.mem_binaryRowName_code I C one i z).2 + exact ⟨c, hc, p, hp, + pair.trans (congrArg (fun v => ZFSet.pair v p) eq), (assignment c p w hcM hpM hwM).1 assigned⟩ + · intro member + obtain ⟨c, hc, p, hp, shape, assigned⟩ := (M.mem_binaryRowName_code I C one i z).1 member + have hcM := M.transitive hC hc + have hpM := M.transitive hQ hp + refine ⟨c, hcM, ?_⟩ + rw [realize_ex] + refine ⟨p, hpM, ?_⟩ + rw [realize_ex] + refine ⟨(Name.check s one c).val, children c hc, hc, hp, ?_, ?_, ?_⟩ + · rw [realize_binaryApplication, map_extend, map_empty] + exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection + hone c _ hcM (children c hc)).2 rfl + · exact (assignment c p _ hcM hpM (children c hc)).2 assigned + · exact (M.realize_orderedPairFormula pairing 3 0 1 _ hz (children c hc) hpM).2 shape + +theorem binaryRowName_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (i : ZFSet.{u}) (hi : i ∈ M.sets) : (M.binaryRowName I C one i).val ∈ M.sets := by + let Q := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let s := SetMembers.presentation Q + have hQ : Q ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) + have hone : s.encode one ∈ M.sets := M.transitive hQ (SetMembers.raw_mem one) + have hcheck := M.check_mem s one pairing unions powers separation collection hone C hC + have childBound (c : ZFSet.{u}) (hc : c ∈ C) : + (Name.check s one c).val ∈ ZFSet.sUnion (ZFSet.sUnion (Name.check s one C).val) := + Name.child_mem_doubleUnion ((Name.entry_check one C (Name.check s one c) one).2 ⟨c, hc, rfl, rfl⟩) + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers + (M.union_mem unions (M.union_mem unions hcheck)) hQ + have bound : (M.binaryRowName I C one i).val ⊆ B := by + intro z hz + obtain ⟨c, hc, p, hp, eq, _⟩ := (M.mem_binaryRowName_code I C one i z).1 hz + exact eq.symm ▸ pairBound _ (childBound c hc) p hp + let params := extend C (extend Q (extend i (extend (SetMembers.raw one) + (extend (natSetCode 1) Fin.elim0)))) + have hbit := M.natSetCode_mem separation infinite 1 + have selected := M.separation_mem separation (binaryRowEntryFormula 0 1 2 3 4 5) params + (Fin.cases hC (Fin.cases hQ (Fin.cases hi (Fin.cases hone + (Fin.cases hbit (fun j => Fin.elim0 j)))))) hB + have eq : ZFSet.sep (fun z => Realize M.sets (binaryRowEntryFormula 0 1 2 3 4 5) + (extend z params)) B = (M.binaryRowName I C one i).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection + hC hQ hi hbit z (M.transitive hB hz)).1 rel + · intro hz + exact ⟨bound hz, (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection + hC hQ hi hbit z (M.transitive hB (bound hz))).2 hz⟩ + exact eq ▸ selected + +theorem realize_binaryRowCodeFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (i w : ZFSet.{u}) (hi : i ∈ M.sets) (hw : w ∈ M.sets) : + Realize M.sets binaryRowCodeFormula (extend i (extend w (extend C (extend + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) + (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))))) ↔ + w = (M.binaryRowName I C one i).val := by + have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) + have hname := M.binaryRowName_mem pairing unions powers separation collection infinite hI hC one i hi + have hbit := M.natSetCode_mem separation infinite 1 + rw [binaryRowCodeFormula] + constructor + · intro spec + apply ZFSet.ext + intro z + constructor + · intro hz + have hzM := M.transitive hw hz + have rel := (realize_imp M.sets _ _ _).1 (spec z hzM).1 hz + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, + map_extend, map_empty] at rel + exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection + hC hQ hi hbit z hzM).1 rel + · intro hz + have hzM := M.transitive hname hz + apply (realize_imp M.sets _ _ _).1 (spec z hzM).2 + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, + map_extend, map_empty] + exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection + hC hQ hi hbit z hzM).2 hz + · intro eq z hzM + constructor + · apply (realize_imp M.sets _ _ _).2 + intro hz + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, + map_extend, map_empty] + exact (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection + hC hQ hi hbit z hzM).2 (eq ▸ hz) + · apply (realize_imp M.sets _ _ _).2 + intro rel + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, + map_extend, map_empty] at rel + exact eq.symm ▸ (M.realize_binaryRowEntryFormula I C one i pairing unions powers separation collection + hC hQ hi hbit z hzM).1 rel + +theorem exists_binaryRowName_bound + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : + ∃ W ∈ M.sets, ∀ i ∈ I, (M.binaryRowName I C one i).val ∈ W := by + let Q := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + have hQ : Q ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) + have hone := M.transitive hQ (SetMembers.raw_mem one) + let params := extend C (extend Q (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0))) + have members : ∀ j, params j ∈ M.sets := Fin.cases hC (Fin.cases hQ + (Fin.cases hone (Fin.cases (M.natSetCode_mem separation infinite 1) (fun j => Fin.elim0 j)))) + have witnesses : ∀ i ∈ I, ∃ w ∈ M.sets, + Realize M.sets binaryRowCodeFormula (extend i (extend w params)) := by + intro i hi + have hiM := M.transitive hI hi + have hname := M.binaryRowName_mem pairing unions powers separation collection infinite hI hC one i hiM + exact ⟨(M.binaryRowName I C one i).val, hname, + (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite + hI hC one i _ hiM hname).2 rfl⟩ + obtain ⟨W, hW, covers⟩ := M.collection_witness collection binaryRowCodeFormula params members hI witnesses + refine ⟨W, hW, ?_⟩ + intro i hi + obtain ⟨w, hw, code⟩ := covers i hi + have eq := (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite + hI hC one i w (M.transitive hI hi) (M.transitive hW hw)).1 code + exact eq ▸ hw + +theorem realize_binaryRowSetEntryFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets binaryRowSetEntryFormula (extend z (extend I (extend C (extend + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) + (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))))) ↔ + z ∈ (M.binaryRowSetName I C one).val := by + have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) + have hone := M.transitive hQ (SetMembers.raw_mem one) + rw [binaryRowSetEntryFormula, realize_ex] + constructor + · rintro ⟨i, hiM, rest⟩ + obtain ⟨w, hwM, hi, code, shape⟩ := (realize_ex M.sets _ _).1 rest + rw [realize_binaryApplication, map_extend, map_extend, map_extend, map_extend, map_empty] at code + have eq := (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite + hI hC one i w hiM hwM).1 code + have pair := (M.realize_orderedPairFormula pairing 2 0 6 _ hz hwM hone).1 shape + exact (M.mem_binaryRowSetName_code I C one z).2 + ⟨i, hi, pair.trans (congrArg (fun v => ZFSet.pair v (SetMembers.raw one)) eq)⟩ + · intro member + obtain ⟨i, hi, shape⟩ := (M.mem_binaryRowSetName_code I C one z).1 member + have hiM := M.transitive hI hi + have hname := M.binaryRowName_mem pairing unions powers separation collection infinite hI hC one i hiM + refine ⟨i, hiM, ?_⟩ + rw [realize_ex] + refine ⟨(M.binaryRowName I C one i).val, hname, hi, ?_, ?_⟩ + · rw [realize_binaryApplication, map_extend, map_extend, map_extend, map_extend, map_empty] + exact (M.realize_binaryRowCodeFormula pairing unions powers separation collection infinite + hI hC one i _ hiM hname).2 rfl + · exact (M.realize_orderedPairFormula pairing 2 0 6 _ hz hname hone).2 shape + +theorem binaryRowSetName_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : + (M.binaryRowSetName I C one).val ∈ M.sets := by + have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) + have hone := M.transitive hQ (SetMembers.raw_mem one) + obtain ⟨W, hW, inW⟩ := M.exists_binaryRowName_bound pairing unions powers separation collection infinite + hI hC one + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW + (M.unorderedPair_mem pairing hone hone) + have bound : (M.binaryRowSetName I C one).val ⊆ B := by + intro z hz + obtain ⟨i, hi, eq⟩ := (M.mem_binaryRowSetName_code I C one z).1 hz + exact eq.symm ▸ pairBound _ (inW i hi) _ (ZFSet.mem_pair.2 (Or.inl rfl)) + let params := extend I (extend C (extend + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) + (extend (SetMembers.raw one) (extend (natSetCode 1) Fin.elim0)))) + have selected := M.separation_mem separation binaryRowSetEntryFormula params + (Fin.cases hI (Fin.cases hC (Fin.cases hQ (Fin.cases hone + (Fin.cases (M.natSetCode_mem separation infinite 1) (fun j => Fin.elim0 j)))))) hB + have eq : ZFSet.sep (fun z => Realize M.sets binaryRowSetEntryFormula + (extend z params)) B = (M.binaryRowSetName I C one).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (M.realize_binaryRowSetEntryFormula pairing unions powers separation collection infinite + hI hC one z (M.transitive hB hz)).1 rel + · intro hz + exact ⟨bound hz, (M.realize_binaryRowSetEntryFormula pairing unions powers separation collection infinite + hI hC one z (M.transitive hB (bound hz))).2 hz⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameSupportBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameSupportBounds.lean index 4aef96ed1dc57f32b144b4922a3c029f2e8a603b..a4d0b6d56d121450ae942fcdc5110756e38dc0c1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameSupportBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNameSupportBounds.lean @@ -1,86 +1,86 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryRowRecordedPreparationBounds - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] -variable (s : Presentation L) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include pairing unions powers separation collection infinite choice hL order hC directed countable_bound - -theorem binaryRowStructuralCondition_nameSupportBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), - G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → - let I := refinementDataHistoryIndices stages - (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) - let anchors := refinementIndexFieldGraph I s.carrier 2 - - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - ZFSet.pair (c.encode p) A ∈ - M.structuralForcingCarrier c.carrier G s.carrier s.conditionOrder basis lifted T2 stages history → - ∀ {G P : Type u} [Group G] [PartialOrder P] [OrderTop P] - (lower : Presentation P) (action : PosetAction G P) (nodeAction : PosetAction G L) - (base : L) (names : Fin 2 → Name lower), - (∀ i, HereditarilySymmetric action lower (nodeAction.principalSupportFamily base directed) (names i)) → - ∀ E : L, ∃ D : L, - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - E ≤ D ∧ ∀ i, nodeAction.principalFix D ≤ action.stabilizer lower (names i) := by - intro c rows S T valid lifted tuples hLifted Gcode basis T2 stages history - hG hb hT2 hs hh I anchors row A member G P instG instP instTop lower action nodeAction base names symmetric E - obtain ⟨first, firstSupport⟩ := (symmetric 0).symmetric - obtain ⟨second, secondSupport⟩ := (symmetric 1).symmetric - obtain ⟨common, firstBelow, secondBelow⟩ := directed first second - let extra : ZFSet.{u} := {s.encode E, s.encode common} - have hE := M.transitive hL (s.encode_mem E) - have hCommon := M.transitive hL (s.encode_mem common) - have extraGround : extra ∈ M.sets := M.unorderedPair_mem pairing hE hCommon - have extraSubset : extra ⊆ s.carrier := by - intro x hx - rcases ZFSet.mem_pair.1 hx with rfl | rfl - · exact s.encode_mem E - · exact s.encode_mem common - have extraSmall : M.groundEmbeddable extra ZFSet.omega := - M.unorderedPair_countable pairing unions powers separation infinite hE hCommon - obtain ⟨D, rowBound, assignmentBound, extraBound⟩ := - M.binaryRowStructuralConditionDataBound s C pairing unions powers separation collection - infinite choice hL order hC directed countable_bound hmu one valid hLifted - Gcode basis T2 stages history hG hb hT2 hs hh row A member extra extraGround extraSubset extraSmall - have commonBelow : common ≤ D := extraBound common (ZFSet.mem_pair.2 (Or.inr rfl)) - have atCommon : ∀ i : Fin 2, nodeAction.principalFix common ≤ action.stabilizer lower (names i) := - Fin.cases ((nodeAction.principalFix_antitone firstBelow).trans firstSupport) - (Fin.cases ((nodeAction.principalFix_antitone secondBelow).trans secondSupport) (fun j => Fin.elim0 j)) - exact ⟨D, rowBound, assignmentBound, extraBound E (ZFSet.mem_pair.2 (Or.inl rfl)), - fun i => (nodeAction.principalFix_antitone commonBelow).trans (atCommon i)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryRowRecordedPreparationBounds + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] +variable (s : Presentation L) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include pairing unions powers separation collection infinite choice hL order hC directed countable_bound + +theorem binaryRowStructuralCondition_nameSupportBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), + G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → + let I := refinementDataHistoryIndices stages + (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) + let anchors := refinementIndexFieldGraph I s.carrier 2 + + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + ZFSet.pair (c.encode p) A ∈ + M.structuralForcingCarrier c.carrier G s.carrier s.conditionOrder basis lifted T2 stages history → + ∀ {G P : Type u} [Group G] [PartialOrder P] [OrderTop P] + (lower : Presentation P) (action : PosetAction G P) (nodeAction : PosetAction G L) + (base : L) (names : Fin 2 → Name lower), + (∀ i, HereditarilySymmetric action lower (nodeAction.principalSupportFamily base directed) (names i)) → + ∀ E : L, ∃ D : L, + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + E ≤ D ∧ ∀ i, nodeAction.principalFix D ≤ action.stabilizer lower (names i) := by + intro c rows S T valid lifted tuples hLifted Gcode basis T2 stages history + hG hb hT2 hs hh I anchors row A member G P instG instP instTop lower action nodeAction base names symmetric E + obtain ⟨first, firstSupport⟩ := (symmetric 0).symmetric + obtain ⟨second, secondSupport⟩ := (symmetric 1).symmetric + obtain ⟨common, firstBelow, secondBelow⟩ := directed first second + let extra : ZFSet.{u} := {s.encode E, s.encode common} + have hE := M.transitive hL (s.encode_mem E) + have hCommon := M.transitive hL (s.encode_mem common) + have extraGround : extra ∈ M.sets := M.unorderedPair_mem pairing hE hCommon + have extraSubset : extra ⊆ s.carrier := by + intro x hx + rcases ZFSet.mem_pair.1 hx with rfl | rfl + · exact s.encode_mem E + · exact s.encode_mem common + have extraSmall : M.groundEmbeddable extra ZFSet.omega := + M.unorderedPair_countable pairing unions powers separation infinite hE hCommon + obtain ⟨D, rowBound, assignmentBound, extraBound⟩ := + M.binaryRowStructuralConditionDataBound s C pairing unions powers separation collection + infinite choice hL order hC directed countable_bound hmu one valid hLifted + Gcode basis T2 stages history hG hb hT2 hs hh row A member extra extraGround extraSubset extraSmall + have commonBelow : common ≤ D := extraBound common (ZFSet.mem_pair.2 (Or.inr rfl)) + have atCommon : ∀ i : Fin 2, nodeAction.principalFix common ≤ action.stabilizer lower (names i) := + Fin.cases ((nodeAction.principalFix_antitone firstBelow).trans firstSupport) + (Fin.cases ((nodeAction.principalFix_antitone secondBelow).trans secondSupport) (fun j => Fin.elim0 j)) + exact ⟨D, rowBound, assignmentBound, extraBound E (ZFSet.mem_pair.2 (Or.inl rfl)), + fun i => (nodeAction.principalFix_antitone commonBelow).trans (atCommon i)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNames.lean index cda64d3a9496c055913896de882f7c9c50a431c2..9769a1df7e8f5a153a17630ebbd90043a8d6852b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowNames.lean @@ -1,111 +1,111 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryRows - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def binaryRowName (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (i : ZFSet.{u}) : - Name (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) := - Name.assemble - (fun z : {z : SetMembers C × SetMembers - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) // - ZFSet.pair (ZFSet.pair i (SetMembers.raw z.1)) (natSetCode 1) ∈ SetMembers.raw z.2} => - Name.check (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one (SetMembers.raw z.val.1)) - (fun z => z.val.2) - -theorem entry_binaryRowName (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (i : ZFSet.{u}) - (σ : Name (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) - (p : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : - Name.Entry σ (M.binaryRowName I C one i) p ↔ ∃ c ∈ C, - Name.check (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one c = σ ∧ - ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ SetMembers.raw p := by - rw [binaryRowName, Name.entry_assemble] - constructor - · rintro ⟨z, eq, rfl⟩ - exact ⟨SetMembers.raw z.val.1, SetMembers.raw_mem z.val.1, eq, z.property⟩ - · rintro ⟨c, hc, eq, assigned⟩ - refine ⟨⟨(SetMembers.ofMem c hc, p), ?_⟩, ?_, rfl⟩ - · simpa only [SetMembers.raw_ofMem] using assigned - · simpa only [SetMembers.raw_ofMem] using eq - -theorem mem_binaryRowName_code (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (i z : ZFSet.{u}) : - z ∈ (M.binaryRowName I C one i).val ↔ ∃ c ∈ C, - ∃ p ∈ M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega, - z = ZFSet.pair (Name.check (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one c).val p ∧ - ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ p := by - constructor - · intro hz - obtain ⟨σ, p, eq⟩ := Name.entries_cover (M.binaryRowName I C one i) hz - change z = ZFSet.pair σ.val (SetMembers.raw p) at eq - have entry : Name.Entry σ (M.binaryRowName I C one i) p := by - change ZFSet.pair σ.val (SetMembers.raw p) ∈ (M.binaryRowName I C one i).val - rw [← eq] - exact hz - obtain ⟨c, hc, child, assigned⟩ := (M.entry_binaryRowName I C one i σ p).1 entry - refine ⟨c, hc, SetMembers.raw p, SetMembers.raw_mem p, ?_, assigned⟩ - rw [child] - exact eq - · rintro ⟨c, hc, p, hp, eq, assigned⟩ - have entry := (M.entry_binaryRowName I C one i _ (SetMembers.ofMem p hp)).2 - ⟨c, hc, rfl, by simpa only [SetMembers.raw_ofMem] using assigned⟩ - change ZFSet.pair (Name.check (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one c).val - (SetMembers.raw (SetMembers.ofMem p hp)) ∈ (M.binaryRowName I C one i).val at entry - rw [SetMembers.raw_ofMem] at entry - exact eq.symm ▸ entry - -theorem mem_eval_binaryRowName (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (H : Set (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) - (hone : one ∈ H) (i x : ZFSet.{u}) : - x ∈ Name.eval H (M.binaryRowName I C one i) ↔ x ∈ C ∧ - ∃ p, p ∈ H ∧ ZFSet.pair (ZFSet.pair i x) (natSetCode 1) ∈ SetMembers.raw p := by - rw [Name.mem_eval] - constructor - · rintro ⟨σ, p, entry, hp, eq⟩ - obtain ⟨c, hc, rfl, assigned⟩ := (M.entry_binaryRowName I C one i σ p).1 entry - rw [Name.eval_check H one hone] at eq - exact ⟨eq ▸ hc, p, hp, eq ▸ assigned⟩ - · rintro ⟨hx, p, hp, assigned⟩ - exact ⟨Name.check (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one x, p, - (M.entry_binaryRowName I C one i _ p).2 ⟨x, hx, rfl, assigned⟩, - hp, Name.eval_check H one hone x⟩ - -theorem eval_binaryRowName (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), - H.mem one → ∀ i : ZFSet.{u}, - Name.eval {p | H.mem p} (M.binaryRowName I C one i) = M.binaryGenericRow I C H i := by - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - intro H hone i - apply ZFSet.ext - intro x - rw [M.mem_eval_binaryRowName I C one {p | H.mem p} hone i x, - M.mem_binaryGenericRow I C H i x, - M.mem_countableGenericGraph (ZFSet.prod I C) (natSetCode 2) H] - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryRows + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def binaryRowName (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (i : ZFSet.{u}) : + Name (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) := + Name.assemble + (fun z : {z : SetMembers C × SetMembers + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) // + ZFSet.pair (ZFSet.pair i (SetMembers.raw z.1)) (natSetCode 1) ∈ SetMembers.raw z.2} => + Name.check (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one (SetMembers.raw z.val.1)) + (fun z => z.val.2) + +theorem entry_binaryRowName (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (i : ZFSet.{u}) + (σ : Name (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) + (p : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : + Name.Entry σ (M.binaryRowName I C one i) p ↔ ∃ c ∈ C, + Name.check (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one c = σ ∧ + ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ SetMembers.raw p := by + rw [binaryRowName, Name.entry_assemble] + constructor + · rintro ⟨z, eq, rfl⟩ + exact ⟨SetMembers.raw z.val.1, SetMembers.raw_mem z.val.1, eq, z.property⟩ + · rintro ⟨c, hc, eq, assigned⟩ + refine ⟨⟨(SetMembers.ofMem c hc, p), ?_⟩, ?_, rfl⟩ + · simpa only [SetMembers.raw_ofMem] using assigned + · simpa only [SetMembers.raw_ofMem] using eq + +theorem mem_binaryRowName_code (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (i z : ZFSet.{u}) : + z ∈ (M.binaryRowName I C one i).val ↔ ∃ c ∈ C, + ∃ p ∈ M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega, + z = ZFSet.pair (Name.check (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one c).val p ∧ + ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ p := by + constructor + · intro hz + obtain ⟨σ, p, eq⟩ := Name.entries_cover (M.binaryRowName I C one i) hz + change z = ZFSet.pair σ.val (SetMembers.raw p) at eq + have entry : Name.Entry σ (M.binaryRowName I C one i) p := by + change ZFSet.pair σ.val (SetMembers.raw p) ∈ (M.binaryRowName I C one i).val + rw [← eq] + exact hz + obtain ⟨c, hc, child, assigned⟩ := (M.entry_binaryRowName I C one i σ p).1 entry + refine ⟨c, hc, SetMembers.raw p, SetMembers.raw_mem p, ?_, assigned⟩ + rw [child] + exact eq + · rintro ⟨c, hc, p, hp, eq, assigned⟩ + have entry := (M.entry_binaryRowName I C one i _ (SetMembers.ofMem p hp)).2 + ⟨c, hc, rfl, by simpa only [SetMembers.raw_ofMem] using assigned⟩ + change ZFSet.pair (Name.check (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one c).val + (SetMembers.raw (SetMembers.ofMem p hp)) ∈ (M.binaryRowName I C one i).val at entry + rw [SetMembers.raw_ofMem] at entry + exact eq.symm ▸ entry + +theorem mem_eval_binaryRowName (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (H : Set (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) + (hone : one ∈ H) (i x : ZFSet.{u}) : + x ∈ Name.eval H (M.binaryRowName I C one i) ↔ x ∈ C ∧ + ∃ p, p ∈ H ∧ ZFSet.pair (ZFSet.pair i x) (natSetCode 1) ∈ SetMembers.raw p := by + rw [Name.mem_eval] + constructor + · rintro ⟨σ, p, entry, hp, eq⟩ + obtain ⟨c, hc, rfl, assigned⟩ := (M.entry_binaryRowName I C one i σ p).1 entry + rw [Name.eval_check H one hone] at eq + exact ⟨eq ▸ hc, p, hp, eq ▸ assigned⟩ + · rintro ⟨hx, p, hp, assigned⟩ + exact ⟨Name.check (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) one x, p, + (M.entry_binaryRowName I C one i _ p).2 ⟨x, hx, rfl, assigned⟩, + hp, Name.eval_check H one hone x⟩ + +theorem eval_binaryRowName (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), + H.mem one → ∀ i : ZFSet.{u}, + Name.eval {p | H.mem p} (M.binaryRowName I C one i) = M.binaryGenericRow I C H i := by + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + intro H hone i + apply ZFSet.ext + intro x + rw [M.mem_eval_binaryRowName I C one {p | H.mem p} hone i x, + M.mem_binaryGenericRow I C H i x, + M.mem_countableGenericGraph (ZFSet.prod I C) (natSetCode 2) H] + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowStructuralDataBoundActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowStructuralDataBoundActions.lean index ebac3d310f817983464965e3a66aefa8d076ef5a..959959f6e7e619c835262e899574dce8bff2a597 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowStructuralDataBoundActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundBinaryRowStructuralDataBoundActions.lean @@ -1,105 +1,105 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAssignmentLabelDomainTotality - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) -variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -include collection order nodeMaps supports - -theorem binaryRowStructuralAssignmentImage_dataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (muOrdinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) - (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) - (_stagesOrdinal : ordinalSetProperty stages) - (_trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let _carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let _forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let _forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph - let _omega := M.omega_mem separation infinite - let _topMem := c.encode_mem ⊤ - let _topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - ∀ (g : G) (D : L) (A : ZFSet.{u}), A ∈ M.sets → - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ stageOneDataBounds A I lifted S s.carrier mu - s.nonbottom.carrier s.conditionOrder anchors tuples) → - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode g) A - movedA ∈ M.sets ∧ - stageOneDataBounds movedA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∈ M.sets ∧ - ∀ z ∈ movedA, ZFSet.pair z (s.encode (a.iso g D)) ∈ - stageOneDataBounds movedA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder - forcingAction omega topMem topRows packed I anchors - have hNonbottom := M.nonbottom_carrier_mem s separation hL - have hS := M.rowPositionSequences_mem pairing unions powers separation hL order hNonbottom hmu - have hTuples := M.binaryLiftedRowTupleFamily_mem pairing unions powers separation collection - infinite hL order hNonbottom hC hmu ⊤ valid - exact M.semanticStructuralAssignmentImage_dataBound c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace S mu tuples hS hmu hTuples - (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) - (fun g f hf tau entry => ⟨M.rowPositionSequenceAction_mem a s b pairing unions powers separation - hL hG graph hmu muOrdinal g hf, - M.binaryLiftedRowTupleFamily_action a s b C pairing unions powers separation infinite - hL hC hG graph hmu muOrdinal valid g f tau entry⟩) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAssignmentLabelDomainTotality + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) +variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +include collection order nodeMaps supports + +theorem binaryRowStructuralAssignmentImage_dataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (muOrdinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) + (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) + (_stagesOrdinal : ordinalSetProperty stages) + (_trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let _carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let _forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let _forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph + let _omega := M.omega_mem separation infinite + let _topMem := c.encode_mem ⊤ + let _topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + ∀ (g : G) (D : L) (A : ZFSet.{u}), A ∈ M.sets → + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ stageOneDataBounds A I lifted S s.carrier mu + s.nonbottom.carrier s.conditionOrder anchors tuples) → + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode g) A + movedA ∈ M.sets ∧ + stageOneDataBounds movedA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∈ M.sets ∧ + ∀ z ∈ movedA, ZFSet.pair z (s.encode (a.iso g D)) ∈ + stageOneDataBounds movedA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder + forcingAction omega topMem topRows packed I anchors + have hNonbottom := M.nonbottom_carrier_mem s separation hL + have hS := M.rowPositionSequences_mem pairing unions powers separation hL order hNonbottom hmu + have hTuples := M.binaryLiftedRowTupleFamily_mem pairing unions powers separation collection + infinite hL order hNonbottom hC hmu ⊤ valid + exact M.semanticStructuralAssignmentImage_dataBound c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace S mu tuples hS hmu hTuples + (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) + (fun g f hf tau entry => ⟨M.rowPositionSequenceAction_mem a s b pairing unions powers separation + hL hG graph hmu muOrdinal g hf, + M.binaryLiftedRowTupleFamily_action a s b C pairing unions powers separation infinite + hL hC hG graph hmu muOrdinal valid g f tau entry⟩) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologicalTransitionTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologicalTransitionTransport.lean index 7a38a25994e90319d1c1881b9012915d61e28019..66680a853b9d84d988603b11f0d97c8fe04dd179 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologicalTransitionTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologicalTransitionTransport.lean @@ -1,56 +1,56 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundChronologicalMainTransition -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {source target first second : GroundChronologicalMainStage M C D rD} - -noncomputable def retargetEq - (transition : GroundChronologicalMainTransition source target) - (sourceEqual : source = first) (targetEqual : target = second) : - GroundChronologicalMainTransition first second := by - cases sourceEqual - cases targetEqual - exact transition - -theorem retargetEq_points - (transition : GroundChronologicalMainTransition source target) - (sourceEqual : source = first) (targetEqual : target = second) : - (transition.retargetEq sourceEqual targetEqual).map.points = transition.map.points := by - cases sourceEqual - cases targetEqual - rfl - -theorem retargetEq_actors - (transition : GroundChronologicalMainTransition source target) - (sourceEqual : source = first) (targetEqual : target = second) : - (transition.retargetEq sourceEqual targetEqual).map.actors = transition.map.actors := by - cases sourceEqual - cases targetEqual - rfl - -theorem retargetEq_code - (transition : GroundChronologicalMainTransition source target) - (sourceEqual : source = first) (targetEqual : target = second) : - (transition.retargetEq sourceEqual targetEqual).map.code = transition.map.code := by - cases sourceEqual - cases targetEqual - rfl - -theorem retargetEq_coversOldBirths_iff - (transition : GroundChronologicalMainTransition source target) - (sourceEqual : source = first) (targetEqual : target = second) : - (transition.retargetEq sourceEqual targetEqual).CoversOldBirths ↔ transition.CoversOldBirths := by - cases sourceEqual - cases targetEqual - rfl - -end PartitionPilot.Forcing.GroundChronologicalMainTransition - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundChronologicalMainTransition +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {source target first second : GroundChronologicalMainStage M C D rD} + +noncomputable def retargetEq + (transition : GroundChronologicalMainTransition source target) + (sourceEqual : source = first) (targetEqual : target = second) : + GroundChronologicalMainTransition first second := by + cases sourceEqual + cases targetEqual + exact transition + +theorem retargetEq_points + (transition : GroundChronologicalMainTransition source target) + (sourceEqual : source = first) (targetEqual : target = second) : + (transition.retargetEq sourceEqual targetEqual).map.points = transition.map.points := by + cases sourceEqual + cases targetEqual + rfl + +theorem retargetEq_actors + (transition : GroundChronologicalMainTransition source target) + (sourceEqual : source = first) (targetEqual : target = second) : + (transition.retargetEq sourceEqual targetEqual).map.actors = transition.map.actors := by + cases sourceEqual + cases targetEqual + rfl + +theorem retargetEq_code + (transition : GroundChronologicalMainTransition source target) + (sourceEqual : source = first) (targetEqual : target = second) : + (transition.retargetEq sourceEqual targetEqual).map.code = transition.map.code := by + cases sourceEqual + cases targetEqual + rfl + +theorem retargetEq_coversOldBirths_iff + (transition : GroundChronologicalMainTransition source target) + (sourceEqual : source = first) (targetEqual : target = second) : + (transition.retargetEq sourceEqual targetEqual).CoversOldBirths ↔ transition.CoversOldBirths := by + cases sourceEqual + cases targetEqual + rfl + +end PartitionPilot.Forcing.GroundChronologicalMainTransition + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologyWitnessSelection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologyWitnessSelection.lean index ecbb7bfab58f42b3d895d19b5b4e4e947982201e..b5112a779fc9b6846aa18b9983bc6ff7baaf6264 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologyWitnessSelection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundChronologyWitnessSelection.lean @@ -1,85 +1,85 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundOrdinalPartitionInjectionAssembly -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyLayerRelation - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundChronologyFields -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (core : ChronologyCoreCode T fields.bound C D rD fields.graph) -variable (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) -include pairing unions powers separation collection choice infinite core rawWitnesses - -theorem choose_groundLayerGraph : - ∃ W ∈ M.sets, ∃ layers ∈ M.sets, ZFSet.IsFunc (chronologyPairs T) W layers ∧ - ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, - ZFSet.pair (ZFSet.pair s t) z ∈ layers → - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by - have hN := M.omega_mem separation infinite - have hPairs := M.chronologyPairs_mem pairing unions powers separation fields.time_ground - have total : ∀ p ∈ chronologyPairs T, ∃ z ∈ M.sets, - Realize M.sets chronologyLayerRelationFormula - (extend p (extend z (fields.layerRelationParams ZFSet.omega))) := by - intro p hp - obtain ⟨s, hs, t, ht, rfl, earlier⟩ := (mem_chronologyPairs T p).1 hp - obtain ⟨z, hz, code⟩ := rawWitnesses s hs t ht earlier - exact ⟨z, hz, (fields.realize_chronologyLayerRelation pairing unions core hN hz hs ht earlier).2 code⟩ - obtain ⟨W, hW, layers, hLayers, function, recognized⟩ := - M.choose_definable_relation pairing unions powers separation collection choice - chronologyLayerRelationFormula (fields.layerRelationParams ZFSet.omega) - (fields.layerRelationParams_ground hN) hPairs total - refine ⟨W, hW, layers, hLayers, function, ?_⟩ - intro s hs t ht earlier z entry - have hz := M.pair_right (M.transitive hLayers entry) - exact (fields.realize_chronologyLayerRelation pairing unions core hN hz hs ht earlier).1 - (recognized (ZFSet.pair s t) z entry) - -theorem exists_serializedChronology (ordinal : ordinalSetProperty T) : - ∃ serial : GroundSerializedChronology M T C D rD, - serial.fields = fields ∧ serial.code ∈ M.sets := by - obtain ⟨W, hW, layers, hLayers, function, codes⟩ := - fields.choose_groundLayerGraph pairing unions powers separation collection choice infinite core rawWitnesses - let serial : GroundSerializedChronology M T C D rD := { - fields := fields - ordinal := ordinal - core := core - layerBound := W - layer_bound_ground := hW - layers := layers - layers_ground := hLayers - layer_function := function - layer_code := codes } - exact ⟨serial, rfl, serial.code_ground pairing⟩ - -omit rawWitnesses in -theorem exists_serializedChronology_iff (ordinal : ordinalSetProperty T) : - (∃ serial : GroundSerializedChronology M T C D rD, - serial.fields = fields ∧ serial.code ∈ M.sets) ↔ - ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by - constructor - · rintro ⟨serial, same, _⟩ s hs t ht earlier - have witness := serial.layer_code s hs t ht earlier _ (serial.layerWitness_entry hs ht earlier) - rw [same] at witness - exact ⟨serial.layerWitness s t, serial.layerWitness_ground s t, witness⟩ - · intro witnesses - exact fields.exists_serializedChronology pairing unions powers separation collection choice infinite core witnesses ordinal - -end PartitionPilot.Forcing.GroundChronologyFields - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundOrdinalPartitionInjectionAssembly +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyLayerRelation + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundChronologyFields +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (core : ChronologyCoreCode T fields.bound C D rD fields.graph) +variable (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) +include pairing unions powers separation collection choice infinite core rawWitnesses + +theorem choose_groundLayerGraph : + ∃ W ∈ M.sets, ∃ layers ∈ M.sets, ZFSet.IsFunc (chronologyPairs T) W layers ∧ + ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, + ZFSet.pair (ZFSet.pair s t) z ∈ layers → + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by + have hN := M.omega_mem separation infinite + have hPairs := M.chronologyPairs_mem pairing unions powers separation fields.time_ground + have total : ∀ p ∈ chronologyPairs T, ∃ z ∈ M.sets, + Realize M.sets chronologyLayerRelationFormula + (extend p (extend z (fields.layerRelationParams ZFSet.omega))) := by + intro p hp + obtain ⟨s, hs, t, ht, rfl, earlier⟩ := (mem_chronologyPairs T p).1 hp + obtain ⟨z, hz, code⟩ := rawWitnesses s hs t ht earlier + exact ⟨z, hz, (fields.realize_chronologyLayerRelation pairing unions core hN hz hs ht earlier).2 code⟩ + obtain ⟨W, hW, layers, hLayers, function, recognized⟩ := + M.choose_definable_relation pairing unions powers separation collection choice + chronologyLayerRelationFormula (fields.layerRelationParams ZFSet.omega) + (fields.layerRelationParams_ground hN) hPairs total + refine ⟨W, hW, layers, hLayers, function, ?_⟩ + intro s hs t ht earlier z entry + have hz := M.pair_right (M.transitive hLayers entry) + exact (fields.realize_chronologyLayerRelation pairing unions core hN hz hs ht earlier).1 + (recognized (ZFSet.pair s t) z entry) + +theorem exists_serializedChronology (ordinal : ordinalSetProperty T) : + ∃ serial : GroundSerializedChronology M T C D rD, + serial.fields = fields ∧ serial.code ∈ M.sets := by + obtain ⟨W, hW, layers, hLayers, function, codes⟩ := + fields.choose_groundLayerGraph pairing unions powers separation collection choice infinite core rawWitnesses + let serial : GroundSerializedChronology M T C D rD := { + fields := fields + ordinal := ordinal + core := core + layerBound := W + layer_bound_ground := hW + layers := layers + layers_ground := hLayers + layer_function := function + layer_code := codes } + exact ⟨serial, rfl, serial.code_ground pairing⟩ + +omit rawWitnesses in +theorem exists_serializedChronology_iff (ordinal : ordinalSetProperty T) : + (∃ serial : GroundSerializedChronology M T C D rD, + serial.fields = fields ∧ serial.code ∈ M.sets) ↔ + ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by + constructor + · rintro ⟨serial, same, _⟩ s hs t ht earlier + have witness := serial.layer_code s hs t ht earlier _ (serial.layerWitness_entry hs ht earlier) + rw [same] at witness + exact ⟨serial.layerWitness s t, serial.layerWitness_ground s t, witness⟩ + · intro witnesses + exact fields.exists_serializedChronology pairing unions powers separation collection choice infinite core witnesses ordinal + +end PartitionPilot.Forcing.GroundChronologyFields + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionAtomicTruth.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionAtomicTruth.lean index dea3ea0ee1d8a7a7b507ea00ccc9def4d0e1f274..f2bca4b590510fe3a96eea1fb9472e8f386c4417 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionAtomicTruth.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionAtomicTruth.lean @@ -1,176 +1,176 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundGraphValueDescendantWitnesses - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P Q : Type u} - -theorem rename_between_mem (s : Presentation P) (t : Presentation Q) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) - (f : P → Q) (hf : s.graph t f ∈ M.sets) - (τ : Name s) (hτ : τ.val ∈ M.sets) : (Name.rename t f τ).val ∈ M.sets := by - let U := s.carrier ∪ t.carrier - let D := ZFSet.sep (fun x => x ∉ s.carrier) U - let F := s.graph t f - let G := F ∪ identityFunctionGraph D - have subS : s.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inl hx) - have subT : t.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inr hx) - have hU : U ∈ M.sets := M.binary_union_mem pairing unions hs ht - have hD : D ∈ M.sets := M.bounded_separation_mem separation (.neg (.mem 0 1)) - (extend s.carrier Fin.elim0) (Fin.cases hs (fun i => Fin.elim0 i)) hU - have hG : G ∈ M.sets := M.binary_union_mem pairing unions hf - (M.identityFunctionGraph_mem pairing unions powers separation hD) - have ff := s.graph_isFunc t f - have full : ZFSet.IsFunc U U G := by - constructor - · intro z hz - rcases ZFSet.mem_union.1 hz with old | identity - · obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (ff.1 old) - exact ZFSet.mem_prod.2 ⟨x, subS hx, y, subT hy, eq⟩ - · obtain ⟨x, hx, rfl⟩ := (mem_identityFunctionGraph D z).1 identity - exact ZFSet.pair_mem_prod.2 ⟨(ZFSet.mem_sep.1 hx).1, (ZFSet.mem_sep.1 hx).1⟩ - · intro x hx - by_cases source : x ∈ s.carrier - · obtain ⟨y, entry, unique⟩ := ff.2 x source - refine ⟨y, ZFSet.mem_union.2 (Or.inl entry), ?_⟩ - intro z hz - rcases ZFSet.mem_union.1 hz with old | identity - · exact unique z old - · exact False.elim ((ZFSet.mem_sep.1 - ((pair_mem_identityFunctionGraph D x z).1 identity).2).2 source) - · refine ⟨x, ZFSet.mem_union.2 (Or.inr - ((pair_mem_identityFunctionGraph D x x).2 ⟨rfl, ZFSet.mem_sep.2 ⟨hx, source⟩⟩)), ?_⟩ - intro z hz - rcases ZFSet.mem_union.1 hz with old | identity - · exact False.elim (source (ZFSet.pair_mem_prod.1 (ff.1 old)).1) - · exact ((pair_mem_identityFunctionGraph D x z).1 identity).1.symm - let u := SetMembers.presentation U - let es := s.intoSet U subS - let et := t.intoSet U subT - let h := u.decodeFunction u G full - have commute (p : P) : h (es p) = et (f p) := by - apply (u.decodeFunction_iff u G full (es p) (et (f p))).2 - rw [s.encode_intoSet U subS, t.encode_intoSet U subT] - exact ZFSet.mem_union.2 (Or.inl ((s.pair_mem_graph t f p (f p)).2 rfl)) - have sourceCode := Name.rename_val_of_encode u es (s.encode_intoSet U subS) τ - have ground := M.rename_mem u pairing unions powers separation collection hU h - ((u.graph_decodeFunction u G full).symm ▸ hG) - (Name.rename u es τ) (sourceCode ▸ hτ) - have equation : Name.rename u h (Name.rename u es τ) = - Name.rename u et (Name.rename t f τ) := by - rw [Name.rename_comp, Name.rename_comp] - apply congrArg (fun k => Name.rename u k τ) - funext p - exact commute p - rw [equation, Name.rename_val_of_encode u et (t.encode_intoSet U subT)] at ground - exact ground - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {Lower Upper : Type u} -variable [PartialOrder Lower] [PartialOrder Upper] -variable (lower : Presentation Lower) (upper : Presentation Upper) -variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} -variable (projection : CompleteProjection restriction inclusion) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) -variable (inclusionGround : lower.graph upper inclusion ∈ M.sets) -variable (H : ConditionFilter Upper) -variable (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) -include pairing unions powers separation collection lowerGround upperGround inclusionGround ordinary - -theorem completeProjection_eval_eq_iff_forcesEq (sigma tau : Name lower) - (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) : - Name.eval {q | (projection.projectedFilter H).mem q} sigma = - Name.eval {q | (projection.projectedFilter H).mem q} tau ↔ - ∃ q, (projection.projectedFilter H).mem q ∧ Name.ForcesEq q sigma tau := by - have liftedSigma := M.rename_between_mem lower upper pairing unions powers separation collection - lowerGround upperGround inclusion inclusionGround sigma sigmaGround - have liftedTau := M.rename_between_mem lower upper pairing unions powers separation collection - lowerGround upperGround inclusion inclusionGround tau tauGround - have truth := Name.eval_eq_iff_forcesEq (M.nameDomain upper) H - (fun E member => ordinary E (Or.inl member)) liftedSigma liftedTau - simp only [Name.eval_rename] at truth - constructor - · intro equal - obtain ⟨p, member, forced⟩ := truth.1 equal - exact ⟨restriction p, (projection.projectedFilter_mem_iff H _).2 ⟨p, member, rfl⟩, - (Name.forcesEq_rename_completeProjection lower upper restriction inclusion projection p sigma tau).1 forced⟩ - · rintro ⟨q, member, forced⟩ - apply truth.2 - refine ⟨inclusion q, member, ?_⟩ - apply (Name.forcesEq_rename_completeProjection lower upper restriction inclusion projection - (inclusion q) sigma tau).2 - simpa only [projection.retract] using forced - -theorem completeProjection_eval_mem_iff_forcesMem (sigma tau : Name lower) - (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) : - Name.eval {q | (projection.projectedFilter H).mem q} sigma ∈ - Name.eval {q | (projection.projectedFilter H).mem q} tau ↔ - ∃ q, (projection.projectedFilter H).mem q ∧ Name.ForcesMem q sigma tau := by - have liftedSigma := M.rename_between_mem lower upper pairing unions powers separation collection - lowerGround upperGround inclusion inclusionGround sigma sigmaGround - have liftedTau := M.rename_between_mem lower upper pairing unions powers separation collection - lowerGround upperGround inclusion inclusionGround tau tauGround - have truth := Name.eval_mem_iff_forcesMem (M.nameDomain upper) H - (fun E member => ordinary E (Or.inl member)) liftedSigma liftedTau - simp only [Name.eval_rename] at truth - constructor - · intro member - obtain ⟨p, hp, forced⟩ := truth.1 member - exact ⟨restriction p, (projection.projectedFilter_mem_iff H _).2 ⟨p, hp, rfl⟩, - (Name.forcesMem_rename_completeProjection lower upper restriction inclusion projection p sigma tau).1 forced⟩ - · rintro ⟨q, member, forced⟩ - apply truth.2 - refine ⟨inclusion q, member, ?_⟩ - apply (Name.forcesMem_rename_completeProjection lower upper restriction inclusion projection - (inclusion q) sigma tau).2 - simpa only [projection.retract] using forced - -theorem completeProjection_forcesNotEq_sound (sigma tau : Name lower) - (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) - {q : Lower} (member : (projection.projectedFilter H).mem q) - (negative : ∀ r, r ≤ q → ¬ Name.ForcesEq r sigma tau) : - Name.eval {r | (projection.projectedFilter H).mem r} sigma ≠ - Name.eval {r | (projection.projectedFilter H).mem r} tau := by - intro equal - obtain ⟨r, hr, forced⟩ := (M.completeProjection_eval_eq_iff_forcesEq lower upper projection - pairing unions powers separation collection lowerGround upperGround inclusionGround H ordinary - sigma tau sigmaGround tauGround).1 equal - obtain ⟨p, _hp, pq, pr⟩ := (projection.projectedFilter H).directed member hr - exact negative p pq (Name.forcesEq_mono forced pr) - -theorem completeProjection_forcesNotMem_sound (sigma tau : Name lower) - (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) - {q : Lower} (member : (projection.projectedFilter H).mem q) - (negative : Name.ForcesNotMem q sigma tau) : - Name.eval {r | (projection.projectedFilter H).mem r} sigma ∉ - Name.eval {r | (projection.projectedFilter H).mem r} tau := by - intro belongs - obtain ⟨r, hr, forced⟩ := (M.completeProjection_eval_mem_iff_forcesMem lower upper projection - pairing unions powers separation collection lowerGround upperGround inclusionGround H ordinary - sigma tau sigmaGround tauGround).1 belongs - obtain ⟨p, _hp, pq, pr⟩ := (projection.projectedFilter H).directed member hr - exact negative p pq (Name.forcesMem_mono forced pr) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundGraphValueDescendantWitnesses + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P Q : Type u} + +theorem rename_between_mem (s : Presentation P) (t : Presentation Q) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) + (f : P → Q) (hf : s.graph t f ∈ M.sets) + (τ : Name s) (hτ : τ.val ∈ M.sets) : (Name.rename t f τ).val ∈ M.sets := by + let U := s.carrier ∪ t.carrier + let D := ZFSet.sep (fun x => x ∉ s.carrier) U + let F := s.graph t f + let G := F ∪ identityFunctionGraph D + have subS : s.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inl hx) + have subT : t.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inr hx) + have hU : U ∈ M.sets := M.binary_union_mem pairing unions hs ht + have hD : D ∈ M.sets := M.bounded_separation_mem separation (.neg (.mem 0 1)) + (extend s.carrier Fin.elim0) (Fin.cases hs (fun i => Fin.elim0 i)) hU + have hG : G ∈ M.sets := M.binary_union_mem pairing unions hf + (M.identityFunctionGraph_mem pairing unions powers separation hD) + have ff := s.graph_isFunc t f + have full : ZFSet.IsFunc U U G := by + constructor + · intro z hz + rcases ZFSet.mem_union.1 hz with old | identity + · obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (ff.1 old) + exact ZFSet.mem_prod.2 ⟨x, subS hx, y, subT hy, eq⟩ + · obtain ⟨x, hx, rfl⟩ := (mem_identityFunctionGraph D z).1 identity + exact ZFSet.pair_mem_prod.2 ⟨(ZFSet.mem_sep.1 hx).1, (ZFSet.mem_sep.1 hx).1⟩ + · intro x hx + by_cases source : x ∈ s.carrier + · obtain ⟨y, entry, unique⟩ := ff.2 x source + refine ⟨y, ZFSet.mem_union.2 (Or.inl entry), ?_⟩ + intro z hz + rcases ZFSet.mem_union.1 hz with old | identity + · exact unique z old + · exact False.elim ((ZFSet.mem_sep.1 + ((pair_mem_identityFunctionGraph D x z).1 identity).2).2 source) + · refine ⟨x, ZFSet.mem_union.2 (Or.inr + ((pair_mem_identityFunctionGraph D x x).2 ⟨rfl, ZFSet.mem_sep.2 ⟨hx, source⟩⟩)), ?_⟩ + intro z hz + rcases ZFSet.mem_union.1 hz with old | identity + · exact False.elim (source (ZFSet.pair_mem_prod.1 (ff.1 old)).1) + · exact ((pair_mem_identityFunctionGraph D x z).1 identity).1.symm + let u := SetMembers.presentation U + let es := s.intoSet U subS + let et := t.intoSet U subT + let h := u.decodeFunction u G full + have commute (p : P) : h (es p) = et (f p) := by + apply (u.decodeFunction_iff u G full (es p) (et (f p))).2 + rw [s.encode_intoSet U subS, t.encode_intoSet U subT] + exact ZFSet.mem_union.2 (Or.inl ((s.pair_mem_graph t f p (f p)).2 rfl)) + have sourceCode := Name.rename_val_of_encode u es (s.encode_intoSet U subS) τ + have ground := M.rename_mem u pairing unions powers separation collection hU h + ((u.graph_decodeFunction u G full).symm ▸ hG) + (Name.rename u es τ) (sourceCode ▸ hτ) + have equation : Name.rename u h (Name.rename u es τ) = + Name.rename u et (Name.rename t f τ) := by + rw [Name.rename_comp, Name.rename_comp] + apply congrArg (fun k => Name.rename u k τ) + funext p + exact commute p + rw [equation, Name.rename_val_of_encode u et (t.encode_intoSet U subT)] at ground + exact ground + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {Lower Upper : Type u} +variable [PartialOrder Lower] [PartialOrder Upper] +variable (lower : Presentation Lower) (upper : Presentation Upper) +variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} +variable (projection : CompleteProjection restriction inclusion) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) +variable (inclusionGround : lower.graph upper inclusion ∈ M.sets) +variable (H : ConditionFilter Upper) +variable (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) +include pairing unions powers separation collection lowerGround upperGround inclusionGround ordinary + +theorem completeProjection_eval_eq_iff_forcesEq (sigma tau : Name lower) + (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) : + Name.eval {q | (projection.projectedFilter H).mem q} sigma = + Name.eval {q | (projection.projectedFilter H).mem q} tau ↔ + ∃ q, (projection.projectedFilter H).mem q ∧ Name.ForcesEq q sigma tau := by + have liftedSigma := M.rename_between_mem lower upper pairing unions powers separation collection + lowerGround upperGround inclusion inclusionGround sigma sigmaGround + have liftedTau := M.rename_between_mem lower upper pairing unions powers separation collection + lowerGround upperGround inclusion inclusionGround tau tauGround + have truth := Name.eval_eq_iff_forcesEq (M.nameDomain upper) H + (fun E member => ordinary E (Or.inl member)) liftedSigma liftedTau + simp only [Name.eval_rename] at truth + constructor + · intro equal + obtain ⟨p, member, forced⟩ := truth.1 equal + exact ⟨restriction p, (projection.projectedFilter_mem_iff H _).2 ⟨p, member, rfl⟩, + (Name.forcesEq_rename_completeProjection lower upper restriction inclusion projection p sigma tau).1 forced⟩ + · rintro ⟨q, member, forced⟩ + apply truth.2 + refine ⟨inclusion q, member, ?_⟩ + apply (Name.forcesEq_rename_completeProjection lower upper restriction inclusion projection + (inclusion q) sigma tau).2 + simpa only [projection.retract] using forced + +theorem completeProjection_eval_mem_iff_forcesMem (sigma tau : Name lower) + (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) : + Name.eval {q | (projection.projectedFilter H).mem q} sigma ∈ + Name.eval {q | (projection.projectedFilter H).mem q} tau ↔ + ∃ q, (projection.projectedFilter H).mem q ∧ Name.ForcesMem q sigma tau := by + have liftedSigma := M.rename_between_mem lower upper pairing unions powers separation collection + lowerGround upperGround inclusion inclusionGround sigma sigmaGround + have liftedTau := M.rename_between_mem lower upper pairing unions powers separation collection + lowerGround upperGround inclusion inclusionGround tau tauGround + have truth := Name.eval_mem_iff_forcesMem (M.nameDomain upper) H + (fun E member => ordinary E (Or.inl member)) liftedSigma liftedTau + simp only [Name.eval_rename] at truth + constructor + · intro member + obtain ⟨p, hp, forced⟩ := truth.1 member + exact ⟨restriction p, (projection.projectedFilter_mem_iff H _).2 ⟨p, hp, rfl⟩, + (Name.forcesMem_rename_completeProjection lower upper restriction inclusion projection p sigma tau).1 forced⟩ + · rintro ⟨q, member, forced⟩ + apply truth.2 + refine ⟨inclusion q, member, ?_⟩ + apply (Name.forcesMem_rename_completeProjection lower upper restriction inclusion projection + (inclusion q) sigma tau).2 + simpa only [projection.retract] using forced + +theorem completeProjection_forcesNotEq_sound (sigma tau : Name lower) + (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) + {q : Lower} (member : (projection.projectedFilter H).mem q) + (negative : ∀ r, r ≤ q → ¬ Name.ForcesEq r sigma tau) : + Name.eval {r | (projection.projectedFilter H).mem r} sigma ≠ + Name.eval {r | (projection.projectedFilter H).mem r} tau := by + intro equal + obtain ⟨r, hr, forced⟩ := (M.completeProjection_eval_eq_iff_forcesEq lower upper projection + pairing unions powers separation collection lowerGround upperGround inclusionGround H ordinary + sigma tau sigmaGround tauGround).1 equal + obtain ⟨p, _hp, pq, pr⟩ := (projection.projectedFilter H).directed member hr + exact negative p pq (Name.forcesEq_mono forced pr) + +theorem completeProjection_forcesNotMem_sound (sigma tau : Name lower) + (sigmaGround : sigma.val ∈ M.sets) (tauGround : tau.val ∈ M.sets) + {q : Lower} (member : (projection.projectedFilter H).mem q) + (negative : Name.ForcesNotMem q sigma tau) : + Name.eval {r | (projection.projectedFilter H).mem r} sigma ∉ + Name.eval {r | (projection.projectedFilter H).mem r} tau := by + intro belongs + obtain ⟨r, hr, forced⟩ := (M.completeProjection_eval_mem_iff_forcesMem lower upper projection + pairing unions powers separation collection lowerGround upperGround inclusionGround H ordinary + sigma tau sigmaGround tauGround).1 belongs + obtain ⟨p, _hp, pq, pr⟩ := (projection.projectedFilter H).directed member hr + exact negative p pq (Name.forcesMem_mono forced pr) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionGenericity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionGenericity.lean index 6128f0330d6a7edf6eaafdaf547db68ce44915fc..d90ac9d7b6b1e1b45fe96f8946e3ca39d3af1360 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionGenericity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompleteProjectionGenericity.lean @@ -1,333 +1,333 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CountableFormulaFamilies -import OAI.SetTheory.PartitionPrinciple.Geometry.CompleteProjectionPredensity -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPresentedPreimages - -namespace OAI - - -namespace PartitionPilot.Forcing - -namespace TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -def codedFamily : Set (Set P) := (fun x : ZFSet.{u} => {p | s.encode p ∈ x}) '' M.sets - -theorem codedFamily_countable (small : M.sets.Countable) : (M.codedFamily s).Countable := - small.image _ - -theorem codedFamily_of_code {E : Set P} (code : s.subset E ∈ M.sets) : E ∈ M.codedFamily s := by - refine ⟨s.subset E, code, ?_⟩ - apply Set.ext - intro p - exact s.encode_mem_subset E p - -theorem exists_ground_generic [Preorder P] (small : M.sets.Countable) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) := - exists_generic_for_countable_family p _ (M.codedFamily_countable s small) - -theorem generic_meets_coded_dense [Preorder P] (H : ConditionFilter P) - (generic : H.GenericFor (M.codedFamily s)) {E : Set P} - (code : s.subset E ∈ M.sets) (dense : Dense E) : H.Meets E := - generic E (M.codedFamily_of_code s code) dense - -theorem symmetric_names_countable {G : Type v} [Group G] [PartialOrder P] - (a : PosetAction G P) (F : NormalSubgroupFamily G) (small : M.sets.Countable) : - (a.symmetricDomain s (M.nameDomain s) F).names.Countable := - (M.nameDomain_countable s small).mono (fun _ h => h.1) - -theorem exists_joint_generic {G : Type v} [Group G] [PartialOrder P] - (a : PosetAction G P) (F : NormalSubgroupFamily G) - (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) := by - let conditionsCountable : Countable P := M.conditions_countable s small carrier - have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) - have symmetric := formulaFamily_countable (a.symmetricDomain s (M.nameDomain s) F) - (M.symmetric_names_countable s a F small) - obtain ⟨H, hp, generic⟩ := exists_generic_for_countable_family p - (M.codedFamily s ∪ (formulaFamily (M.nameDomain s) ∪ - formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) - ((M.codedFamily_countable s small).union (ordinary.union symmetric)) - exact ⟨H, hp, (fun E hE => generic E (Or.inl hE)), - (fun E hE => generic E (Or.inr (Or.inl hE))), - fun E hE => generic E (Or.inr (Or.inr hE))⟩ - -end TransitiveGround - - - -namespace TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u v w -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] -variable (s : Presentation P) {G : Type w} [Group G] - -theorem exists_joint_projection_generic (a : PosetAction G P) (F : NormalSubgroupFamily G) - (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) - {J : Type v} [Countable J] (Q : J → Type u) [∀ j, PartialOrder (Q j)] - (t : ∀ j, Presentation (Q j)) (pi : ∀ j, P →o Q j) (inc : ∀ j, Q j ↪o P) - (projection : ∀ j, CompleteProjection (pi j) (inc j)) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ - ∀ j, ((projection j).projectedFilter H).GenericFor (M.codedFamily (t j)) ∧ - ((projection j).projectedFilter H).GenericFor (formulaFamily (M.nameDomain (t j))) := by - let conditionsCountable : Countable P := M.conditions_countable s small carrier - let projectedConditionsCountable (index : J) : Countable (Q index) := - (inc index).injective.countable - let lower (j : J) : Set (Set (Q j)) := - M.codedFamily (t j) ∪ formulaFamily (M.nameDomain (t j)) - let lifted (j : J) : Set (Set P) := - (fun E : Set (Q j) => {q : P | pi j q ∈ E}) '' lower j - have lowerCountable (j : J) : (lower j).Countable := - (M.codedFamily_countable (t j) small).union - (formulaFamily_countable (M.nameDomain (t j)) (M.nameDomain_countable (t j) small)) - have liftedCountable : (⋃ j, lifted j).Countable := - Set.countable_iUnion (fun j => (lowerCountable j).image _) - have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) - have symmetric := formulaFamily_countable (a.symmetricDomain s (M.nameDomain s) F) - (M.symmetric_names_countable s a F small) - obtain ⟨H, hp, generic⟩ := exists_generic_for_countable_family p - (M.codedFamily s ∪ (formulaFamily (M.nameDomain s) ∪ - (formulaFamily (a.symmetricDomain s (M.nameDomain s) F) ∪ ⋃ j, lifted j))) - ((M.codedFamily_countable s small).union (ordinary.union (symmetric.union liftedCountable))) - refine ⟨H, hp, (fun E hE => generic E (Or.inl hE)), - (fun E hE => generic E (Or.inr (Or.inl hE))), - (fun E hE => generic E (Or.inr (Or.inr (Or.inl hE)))), ?_⟩ - intro j - have projected : ((projection j).projectedFilter H).GenericFor (lower j) := - (projection j).projectedFilter_generic H (lower j) (by - intro E hE - exact generic E (Or.inr (Or.inr (Or.inr (Set.mem_iUnion.2 ⟨j, hE⟩))))) - exact ⟨(fun E hE => projected E (Or.inl hE)), fun E hE => projected E (Or.inr hE)⟩ - -end TransitiveGround - - - -section -open SetRealization -universe u - -namespace SetFormula -variable {P : Type u} [Preorder P] [Countable P] {s : Presentation P} - -theorem forces_iff_all_generics (D : Name.NameDomain s) (small : D.names.Countable) - {n : Nat} (phi : SetFormula n) (env : Assignment D n) (p : P) : - Forces D phi env p ↔ - ∀ H : ConditionFilter P, H.mem p → H.GenericFor (formulaFamily D) → - Realize (D.values {q | H.mem q}) phi (evalAssignment {q | H.mem q} env) := by - constructor - · intro forced H member generic - exact forces_sound D H generic phi env member forced - · intro truth - by_contra bad - obtain ⟨q, below, negative⟩ := not_forces_refine_neg D phi env bad - obtain ⟨H, member, generic⟩ := exists_generic_formulaFamily D small q - have yes := truth H (H.upward member below) generic - have no := forces_sound D H generic (.neg phi) env member negative - exact no yes - -end SetFormula - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem ordinaryForces_iff_all_generics (small : M.sets.Countable) - (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula n) - (env : Assignment (M.nameDomain s) n) (p : P) : - Forces (M.nameDomain s) phi env p ↔ - ∀ H : ConditionFilter P, H.mem p → H.GenericFor (formulaFamily (M.nameDomain s)) → - Realize ((M.nameDomain s).values {q | H.mem q}) phi - (evalAssignment {q | H.mem q} env) := by - let conditionsCountable : Countable P := M.conditions_countable s small carrier - exact forces_iff_all_generics (M.nameDomain s) (M.nameDomain_countable s small) phi env p - -end TransitiveGround -end - - - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem exists_coded_ordinary_generic (small : M.sets.Countable) - (carrier : s.carrier ∈ M.sets) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) := by - let conditionsCountable : Countable P := M.conditions_countable s small carrier - have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) - obtain ⟨H, member, generic⟩ := exists_generic_for_countable_family p - (M.codedFamily s ∪ formulaFamily (M.nameDomain s)) - ((M.codedFamily_countable s small).union ordinary) - exact ⟨H, member, (fun E hE => generic E (Or.inl hE)), - fun E hE => generic E (Or.inr hE)⟩ - -theorem ordinaryForces_iff_all_joint_generics (small : M.sets.Countable) - (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula n) - (env : Assignment (M.nameDomain s) n) (p : P) : - Forces (M.nameDomain s) phi env p ↔ - ∀ H : ConditionFilter P, H.mem p → H.GenericFor (M.codedFamily s) → - H.GenericFor (formulaFamily (M.nameDomain s)) → - Realize ((M.nameDomain s).values {q | H.mem q}) phi - (evalAssignment {q | H.mem q} env) := by - constructor - · intro forced H member _ generic - exact forces_sound (M.nameDomain s) H generic phi env member forced - · intro truth - by_contra bad - obtain ⟨q, below, negative⟩ := not_forces_refine_neg (M.nameDomain s) phi env bad - obtain ⟨H, member, coded, ordinary⟩ := M.exists_coded_ordinary_generic s small carrier q - exact (forces_sound (M.nameDomain s) H ordinary (.neg phi) env member negative) - (truth H (H.upward member below) coded ordinary) - -end TransitiveGround - - - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem ordinaryForces_congr_equalities (small : M.sets.Countable) - (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula n) - (env other : Assignment (M.nameDomain s) n) (p : P) - (equal : ∀ j, Name.ForcesEq p (env j).val (other j).val) : - Forces (M.nameDomain s) phi env p ↔ Forces (M.nameDomain s) phi other p := by - have values (H : ConditionFilter P) (hp : H.mem p) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - evalAssignment {q | H.mem q} env = evalAssignment {q | H.mem q} other := by - funext j - exact Name.forcesEq_sound (M.nameDomain s) H - (fun E hE dense => generic E (Or.inl hE) dense) - (env j).val (env j).property (other j).val (other j).property p hp (equal j) - rw [M.ordinaryForces_iff_all_generics s small carrier, - M.ordinaryForces_iff_all_generics s small carrier] - constructor - · intro forced H hp generic - rw [← values H hp generic] - exact forced H hp generic - · intro forced H hp generic - rw [values H hp generic] - exact forced H hp generic - -theorem ordinaryForces_replace_first (small : M.sets.Countable) - (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula (n + 1)) - (env : Assignment (M.nameDomain s) n) (sigma tau : (M.nameDomain s).names) (p : P) - (equal : Name.ForcesEq p sigma.val tau.val) : - Forces (M.nameDomain s) phi (extend sigma env) p ↔ - Forces (M.nameDomain s) phi (extend tau env) p := - M.ordinaryForces_congr_equalities s small carrier phi (extend sigma env) (extend tau env) p - (Fin.cases equal (fun j => Name.forcesEq_refl (env j).val p)) - -end TransitiveGround - - - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem ordinary_generic_meets_coded_dense (H : ConditionFilter P) - (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) {E : Set P} - (code : s.subset E ∈ M.sets) (dense : Dense E) : H.Meets E := by - have emptyGround : (∅ : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨s.subset E, code⟩ - let witness : Name s := ⟨ZFSet.prod {∅} (s.subset E), IsName.mk - (by - intro z hz - obtain ⟨x, hx, y, hy, shape⟩ := ZFSet.mem_prod.1 hz - obtain ⟨p, _hp, rfl⟩ := (s.mem_subset E y).1 hy - have empty : x = ∅ := ZFSet.mem_singleton.1 hx - exact ⟨∅, p, shape.trans (congrArg (fun v => ZFSet.pair v (s.encode p)) empty)⟩) - (by - intro y p member - have empty : y = ∅ := ZFSet.mem_singleton.1 (ZFSet.pair_mem_prod.1 member).1 - exact empty.symm ▸ (Name.empty s).property)⟩ - have witnessGround : witness.val ∈ M.sets := M.prod_mem pairing unions powers separation - (by simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing emptyGround emptyGround) code - have entries (sigma : Name s) (p : P) : - Name.Entry sigma witness p ↔ sigma = Name.empty s ∧ p ∈ E := by - constructor - · intro entry - have components : sigma.val ∈ {∅} ∧ s.encode p ∈ s.subset E := - ZFSet.pair_mem_prod.1 entry - exact ⟨Subtype.ext (ZFSet.mem_singleton.1 components.1), - (s.encode_mem_subset E p).1 components.2⟩ - · rintro ⟨rfl, member⟩ - exact ZFSet.pair_mem_prod.2 - ⟨ZFSet.mem_singleton.2 rfl, (s.encode_mem_subset E p).2 member⟩ - have forced (p : P) : Name.ForcesMem p (Name.empty s) witness := by - apply Name.forcesMem_of_dense - intro q _qp - obtain ⟨r, rq, member⟩ := dense q - exact ⟨r, rq, Name.forcesMem_entry ((entries (Name.empty s) r).2 ⟨rfl, member⟩)⟩ - obtain ⟨p, hp⟩ := H.nonempty - have member := Name.forcesMem_sound (M.nameDomain s) H - (fun E hE => ordinary E (Or.inl hE)) emptyGround witnessGround hp (forced p) - obtain ⟨sigma, q, entry, hq, _equal⟩ := (Name.mem_eval {r | H.mem r} witness _).1 member - exact ⟨q, hq, ((entries sigma q).1 entry).2⟩ - -theorem ordinary_generic_meets_ground_dense (H : ConditionFilter P) - (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) {D : ZFSet.{u}} - (ground : D ∈ M.sets) (subset : D ⊆ s.carrier) - (dense : Dense {p | s.encode p ∈ D}) : H.Meets {p | s.encode p ∈ D} := by - have codeEq : s.subset (fun p => s.encode p ∈ D) = D := by - apply ZFSet.ext - intro z - rw [s.mem_subset] - constructor - · rintro ⟨p, member, rfl⟩ - exact member - · intro member - obtain ⟨p, same⟩ := (s.mem_carrier z).1 (subset member) - exact ⟨p, same.symm ▸ member, same⟩ - exact M.ordinary_generic_meets_coded_dense s pairing unions powers separation H ordinary - (codeEq.symm ▸ ground) dense - -end TransitiveGround - - - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {Upper Lower : Type u} -variable [PartialOrder Upper] [PartialOrder Lower] - -theorem completeProjection_codedGeneric - (upper : Presentation Upper) (lower : Presentation Lower) - {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} - (projection : CompleteProjection restriction inclusion) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (upperCarrier : upper.carrier ∈ M.sets) (lowerCarrier : lower.carrier ∈ M.sets) - (graph : upper.graph lower restriction ∈ M.sets) - (H : ConditionFilter Upper) (generic : H.GenericFor (M.codedFamily upper)) : - (projection.projectedFilter H).GenericFor (M.codedFamily lower) := by - intro E member dense - obtain ⟨X, ground, rfl⟩ := member - have preimage := M.presentedPreimage_mem upper lower restriction - pairing unions powers separation upperCarrier lowerCarrier graph ground - exact (projection.projectedFilter_meets_iff H _).2 - (M.generic_meets_coded_dense upper H generic preimage - (projection.dense_preimage dense)) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CountableFormulaFamilies +import OAI.SetTheory.PartitionPrinciple.Geometry.CompleteProjectionPredensity +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPresentedPreimages + +namespace OAI + + +namespace PartitionPilot.Forcing + +namespace TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +def codedFamily : Set (Set P) := (fun x : ZFSet.{u} => {p | s.encode p ∈ x}) '' M.sets + +theorem codedFamily_countable (small : M.sets.Countable) : (M.codedFamily s).Countable := + small.image _ + +theorem codedFamily_of_code {E : Set P} (code : s.subset E ∈ M.sets) : E ∈ M.codedFamily s := by + refine ⟨s.subset E, code, ?_⟩ + apply Set.ext + intro p + exact s.encode_mem_subset E p + +theorem exists_ground_generic [Preorder P] (small : M.sets.Countable) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) := + exists_generic_for_countable_family p _ (M.codedFamily_countable s small) + +theorem generic_meets_coded_dense [Preorder P] (H : ConditionFilter P) + (generic : H.GenericFor (M.codedFamily s)) {E : Set P} + (code : s.subset E ∈ M.sets) (dense : Dense E) : H.Meets E := + generic E (M.codedFamily_of_code s code) dense + +theorem symmetric_names_countable {G : Type v} [Group G] [PartialOrder P] + (a : PosetAction G P) (F : NormalSubgroupFamily G) (small : M.sets.Countable) : + (a.symmetricDomain s (M.nameDomain s) F).names.Countable := + (M.nameDomain_countable s small).mono (fun _ h => h.1) + +theorem exists_joint_generic {G : Type v} [Group G] [PartialOrder P] + (a : PosetAction G P) (F : NormalSubgroupFamily G) + (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) := by + let conditionsCountable : Countable P := M.conditions_countable s small carrier + have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) + have symmetric := formulaFamily_countable (a.symmetricDomain s (M.nameDomain s) F) + (M.symmetric_names_countable s a F small) + obtain ⟨H, hp, generic⟩ := exists_generic_for_countable_family p + (M.codedFamily s ∪ (formulaFamily (M.nameDomain s) ∪ + formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) + ((M.codedFamily_countable s small).union (ordinary.union symmetric)) + exact ⟨H, hp, (fun E hE => generic E (Or.inl hE)), + (fun E hE => generic E (Or.inr (Or.inl hE))), + fun E hE => generic E (Or.inr (Or.inr hE))⟩ + +end TransitiveGround + + + +namespace TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u v w +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] +variable (s : Presentation P) {G : Type w} [Group G] + +theorem exists_joint_projection_generic (a : PosetAction G P) (F : NormalSubgroupFamily G) + (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) + {J : Type v} [Countable J] (Q : J → Type u) [∀ j, PartialOrder (Q j)] + (t : ∀ j, Presentation (Q j)) (pi : ∀ j, P →o Q j) (inc : ∀ j, Q j ↪o P) + (projection : ∀ j, CompleteProjection (pi j) (inc j)) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ + ∀ j, ((projection j).projectedFilter H).GenericFor (M.codedFamily (t j)) ∧ + ((projection j).projectedFilter H).GenericFor (formulaFamily (M.nameDomain (t j))) := by + let conditionsCountable : Countable P := M.conditions_countable s small carrier + let projectedConditionsCountable (index : J) : Countable (Q index) := + (inc index).injective.countable + let lower (j : J) : Set (Set (Q j)) := + M.codedFamily (t j) ∪ formulaFamily (M.nameDomain (t j)) + let lifted (j : J) : Set (Set P) := + (fun E : Set (Q j) => {q : P | pi j q ∈ E}) '' lower j + have lowerCountable (j : J) : (lower j).Countable := + (M.codedFamily_countable (t j) small).union + (formulaFamily_countable (M.nameDomain (t j)) (M.nameDomain_countable (t j) small)) + have liftedCountable : (⋃ j, lifted j).Countable := + Set.countable_iUnion (fun j => (lowerCountable j).image _) + have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) + have symmetric := formulaFamily_countable (a.symmetricDomain s (M.nameDomain s) F) + (M.symmetric_names_countable s a F small) + obtain ⟨H, hp, generic⟩ := exists_generic_for_countable_family p + (M.codedFamily s ∪ (formulaFamily (M.nameDomain s) ∪ + (formulaFamily (a.symmetricDomain s (M.nameDomain s) F) ∪ ⋃ j, lifted j))) + ((M.codedFamily_countable s small).union (ordinary.union (symmetric.union liftedCountable))) + refine ⟨H, hp, (fun E hE => generic E (Or.inl hE)), + (fun E hE => generic E (Or.inr (Or.inl hE))), + (fun E hE => generic E (Or.inr (Or.inr (Or.inl hE)))), ?_⟩ + intro j + have projected : ((projection j).projectedFilter H).GenericFor (lower j) := + (projection j).projectedFilter_generic H (lower j) (by + intro E hE + exact generic E (Or.inr (Or.inr (Or.inr (Set.mem_iUnion.2 ⟨j, hE⟩))))) + exact ⟨(fun E hE => projected E (Or.inl hE)), fun E hE => projected E (Or.inr hE)⟩ + +end TransitiveGround + + + +section +open SetRealization +universe u + +namespace SetFormula +variable {P : Type u} [Preorder P] [Countable P] {s : Presentation P} + +theorem forces_iff_all_generics (D : Name.NameDomain s) (small : D.names.Countable) + {n : Nat} (phi : SetFormula n) (env : Assignment D n) (p : P) : + Forces D phi env p ↔ + ∀ H : ConditionFilter P, H.mem p → H.GenericFor (formulaFamily D) → + Realize (D.values {q | H.mem q}) phi (evalAssignment {q | H.mem q} env) := by + constructor + · intro forced H member generic + exact forces_sound D H generic phi env member forced + · intro truth + by_contra bad + obtain ⟨q, below, negative⟩ := not_forces_refine_neg D phi env bad + obtain ⟨H, member, generic⟩ := exists_generic_formulaFamily D small q + have yes := truth H (H.upward member below) generic + have no := forces_sound D H generic (.neg phi) env member negative + exact no yes + +end SetFormula + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem ordinaryForces_iff_all_generics (small : M.sets.Countable) + (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula n) + (env : Assignment (M.nameDomain s) n) (p : P) : + Forces (M.nameDomain s) phi env p ↔ + ∀ H : ConditionFilter P, H.mem p → H.GenericFor (formulaFamily (M.nameDomain s)) → + Realize ((M.nameDomain s).values {q | H.mem q}) phi + (evalAssignment {q | H.mem q} env) := by + let conditionsCountable : Countable P := M.conditions_countable s small carrier + exact forces_iff_all_generics (M.nameDomain s) (M.nameDomain_countable s small) phi env p + +end TransitiveGround +end + + + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem exists_coded_ordinary_generic (small : M.sets.Countable) + (carrier : s.carrier ∈ M.sets) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) := by + let conditionsCountable : Countable P := M.conditions_countable s small carrier + have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) + obtain ⟨H, member, generic⟩ := exists_generic_for_countable_family p + (M.codedFamily s ∪ formulaFamily (M.nameDomain s)) + ((M.codedFamily_countable s small).union ordinary) + exact ⟨H, member, (fun E hE => generic E (Or.inl hE)), + fun E hE => generic E (Or.inr hE)⟩ + +theorem ordinaryForces_iff_all_joint_generics (small : M.sets.Countable) + (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula n) + (env : Assignment (M.nameDomain s) n) (p : P) : + Forces (M.nameDomain s) phi env p ↔ + ∀ H : ConditionFilter P, H.mem p → H.GenericFor (M.codedFamily s) → + H.GenericFor (formulaFamily (M.nameDomain s)) → + Realize ((M.nameDomain s).values {q | H.mem q}) phi + (evalAssignment {q | H.mem q} env) := by + constructor + · intro forced H member _ generic + exact forces_sound (M.nameDomain s) H generic phi env member forced + · intro truth + by_contra bad + obtain ⟨q, below, negative⟩ := not_forces_refine_neg (M.nameDomain s) phi env bad + obtain ⟨H, member, coded, ordinary⟩ := M.exists_coded_ordinary_generic s small carrier q + exact (forces_sound (M.nameDomain s) H ordinary (.neg phi) env member negative) + (truth H (H.upward member below) coded ordinary) + +end TransitiveGround + + + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem ordinaryForces_congr_equalities (small : M.sets.Countable) + (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula n) + (env other : Assignment (M.nameDomain s) n) (p : P) + (equal : ∀ j, Name.ForcesEq p (env j).val (other j).val) : + Forces (M.nameDomain s) phi env p ↔ Forces (M.nameDomain s) phi other p := by + have values (H : ConditionFilter P) (hp : H.mem p) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + evalAssignment {q | H.mem q} env = evalAssignment {q | H.mem q} other := by + funext j + exact Name.forcesEq_sound (M.nameDomain s) H + (fun E hE dense => generic E (Or.inl hE) dense) + (env j).val (env j).property (other j).val (other j).property p hp (equal j) + rw [M.ordinaryForces_iff_all_generics s small carrier, + M.ordinaryForces_iff_all_generics s small carrier] + constructor + · intro forced H hp generic + rw [← values H hp generic] + exact forced H hp generic + · intro forced H hp generic + rw [values H hp generic] + exact forced H hp generic + +theorem ordinaryForces_replace_first (small : M.sets.Countable) + (carrier : s.carrier ∈ M.sets) {n : Nat} (phi : SetFormula (n + 1)) + (env : Assignment (M.nameDomain s) n) (sigma tau : (M.nameDomain s).names) (p : P) + (equal : Name.ForcesEq p sigma.val tau.val) : + Forces (M.nameDomain s) phi (extend sigma env) p ↔ + Forces (M.nameDomain s) phi (extend tau env) p := + M.ordinaryForces_congr_equalities s small carrier phi (extend sigma env) (extend tau env) p + (Fin.cases equal (fun j => Name.forcesEq_refl (env j).val p)) + +end TransitiveGround + + + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem ordinary_generic_meets_coded_dense (H : ConditionFilter P) + (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) {E : Set P} + (code : s.subset E ∈ M.sets) (dense : Dense E) : H.Meets E := by + have emptyGround : (∅ : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨s.subset E, code⟩ + let witness : Name s := ⟨ZFSet.prod {∅} (s.subset E), IsName.mk + (by + intro z hz + obtain ⟨x, hx, y, hy, shape⟩ := ZFSet.mem_prod.1 hz + obtain ⟨p, _hp, rfl⟩ := (s.mem_subset E y).1 hy + have empty : x = ∅ := ZFSet.mem_singleton.1 hx + exact ⟨∅, p, shape.trans (congrArg (fun v => ZFSet.pair v (s.encode p)) empty)⟩) + (by + intro y p member + have empty : y = ∅ := ZFSet.mem_singleton.1 (ZFSet.pair_mem_prod.1 member).1 + exact empty.symm ▸ (Name.empty s).property)⟩ + have witnessGround : witness.val ∈ M.sets := M.prod_mem pairing unions powers separation + (by simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing emptyGround emptyGround) code + have entries (sigma : Name s) (p : P) : + Name.Entry sigma witness p ↔ sigma = Name.empty s ∧ p ∈ E := by + constructor + · intro entry + have components : sigma.val ∈ {∅} ∧ s.encode p ∈ s.subset E := + ZFSet.pair_mem_prod.1 entry + exact ⟨Subtype.ext (ZFSet.mem_singleton.1 components.1), + (s.encode_mem_subset E p).1 components.2⟩ + · rintro ⟨rfl, member⟩ + exact ZFSet.pair_mem_prod.2 + ⟨ZFSet.mem_singleton.2 rfl, (s.encode_mem_subset E p).2 member⟩ + have forced (p : P) : Name.ForcesMem p (Name.empty s) witness := by + apply Name.forcesMem_of_dense + intro q _qp + obtain ⟨r, rq, member⟩ := dense q + exact ⟨r, rq, Name.forcesMem_entry ((entries (Name.empty s) r).2 ⟨rfl, member⟩)⟩ + obtain ⟨p, hp⟩ := H.nonempty + have member := Name.forcesMem_sound (M.nameDomain s) H + (fun E hE => ordinary E (Or.inl hE)) emptyGround witnessGround hp (forced p) + obtain ⟨sigma, q, entry, hq, _equal⟩ := (Name.mem_eval {r | H.mem r} witness _).1 member + exact ⟨q, hq, ((entries sigma q).1 entry).2⟩ + +theorem ordinary_generic_meets_ground_dense (H : ConditionFilter P) + (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) {D : ZFSet.{u}} + (ground : D ∈ M.sets) (subset : D ⊆ s.carrier) + (dense : Dense {p | s.encode p ∈ D}) : H.Meets {p | s.encode p ∈ D} := by + have codeEq : s.subset (fun p => s.encode p ∈ D) = D := by + apply ZFSet.ext + intro z + rw [s.mem_subset] + constructor + · rintro ⟨p, member, rfl⟩ + exact member + · intro member + obtain ⟨p, same⟩ := (s.mem_carrier z).1 (subset member) + exact ⟨p, same.symm ▸ member, same⟩ + exact M.ordinary_generic_meets_coded_dense s pairing unions powers separation H ordinary + (codeEq.symm ▸ ground) dense + +end TransitiveGround + + + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {Upper Lower : Type u} +variable [PartialOrder Upper] [PartialOrder Lower] + +theorem completeProjection_codedGeneric + (upper : Presentation Upper) (lower : Presentation Lower) + {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} + (projection : CompleteProjection restriction inclusion) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (upperCarrier : upper.carrier ∈ M.sets) (lowerCarrier : lower.carrier ∈ M.sets) + (graph : upper.graph lower restriction ∈ M.sets) + (H : ConditionFilter Upper) (generic : H.GenericFor (M.codedFamily upper)) : + (projection.projectedFilter H).GenericFor (M.codedFamily lower) := by + intro E member dense + obtain ⟨X, ground, rfl⟩ := member + have preimage := M.presentedPreimage_mem upper lower restriction + pairing unions powers separation upperCarrier lowerCarrier graph ground + exact (projection.projectedFilter_meets_iff H _).2 + (M.generic_meets_coded_dense upper H generic preimage + (projection.dense_preimage dense)) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionIncomingWitnessRanks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionIncomingWitnessRanks.lean index 111c5ee669660eeece8a87c0bb2e5ce322548e37..f930b06e10ee79cf2fe15d2ebd97eb904bbbf448 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionIncomingWitnessRanks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionIncomingWitnessRanks.lean @@ -1,234 +1,234 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundConstantBatchLayers -import OAI.SetTheory.PartitionPrinciple.Transfinite.CompressionPrefixCoinitiality - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundEligibleBatchLayerWitness - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one HQs Hrs Hμs HTime T birth stamp τ N : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) - (historySpaces : FunctionGraphOn HTime HQs) - (historyOrders : FunctionGraphOn HTime Hrs) - (historyMeets : FunctionGraphOn HTime Hμs) - (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (hStamp : stamp ∈ M.sets) (before : τ ∈ stamp) - (source : ZFSet.pair τ P ∈ HQs ∧ ZFSet.pair τ r ∈ Hrs ∧ ZFSet.pair τ μ ∈ Hμs) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - d.constantBatchLayerWitness M τ ∈ M.sets ∧ - GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph - (d.batchBirth birth stamp) stamp N (d.constantBatchLayerWitness M τ) := by - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - have fields := M.groundEligibleTaskFields pairing unions powers separation hP hG hr hμ hA hLabels meet - apply d.constantBatchLayerWitness_spec pairing unions powers separation hP fields.1 fields.2.1 - fields.2.2.1 (fields.2.2.2.2 0).1 (fields.2.2.2.2 2).1 - historySpaces historyOrders historyMeets born earlier hStamp before ?_ source - intro i - exact ⟨((pair_mem_constantFamilyGraph _ _ _ _).1 (d.space_entry i)).2, - ((pair_mem_constantFamilyGraph _ _ _ _).1 (d.rel_entry i)).2, - ((pair_mem_constantFamilyGraph _ _ _ _).1 (d.meet_entry i)).2⟩ - -end TransitiveGround - -section -open SetRealization -universe u - -theorem batchFamilyPointBound_rank_le (Qs : ZFSet.{u}) : - ZFSet.rank (familyPointBound Qs) ≤ ZFSet.rank Qs := - (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include limit - -theorem batchTemplateFamilyBound_rank_lt {I P Qs : ZFSet.{u}} (rs As : ZFSet.{u}) - (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) - (spaces : ZFSet.rank Qs < o) : - ZFSet.rank (M.batchTemplateFamilyBound I P Qs rs As) < o := by - have source := (batchFamilyPointBound_rank_le Qs).trans_lt spaces - have fresh := (ZFSet.rank_mono (fun z hz => indexedAttachmentDomain_subset I Qs - (indexedAttachmentFresh_subset I Qs rs As hz))).trans_lt (rank_product_lt limit indices source) - exact M.groundRelations_rank_lt limit source (rank_taggedExtension_lt limit points fresh) - -theorem batchTemplateFamily_rank_lt {I P Qs : ZFSet.{u}} (rs As Es : ZFSet.{u}) - (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) - (spaces : ZFSet.rank Qs < o) : - ZFSet.rank (M.batchTemplateFamily I P Qs rs As Es) < o := by - have subset : M.batchTemplateFamily I P Qs rs As Es ⊆ - ZFSet.prod I (M.batchTemplateFamilyBound I P Qs rs As) := by - intro z hz - unfold batchTemplateFamily indexedRelationSections at hz - exact (ZFSet.mem_sep.1 hz).1 - exact (ZFSet.rank_mono subset).trans_lt (rank_product_lt limit indices - (M.batchTemplateFamilyBound_rank_lt limit rs As points indices spaces)) - -end TransitiveGround - -namespace AttachmentBatchInputs -variable {M : TransitiveGround.{u}} -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include limit - -theorem batchIncomingFiber_rank_lt - (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) - (spaces : ZFSet.rank Qs < o) : ZFSet.rank d.batchIncomingFiber < o := by - have fresh := (ZFSet.rank_mono (fun z hz => indexedAttachmentDomain_subset I Qs - (indexedAttachmentFresh_subset I Qs rs As hz))).trans_lt - (rank_product_lt limit indices ((batchFamilyPointBound_rank_le Qs).trans_lt spaces)) - exact rank_product_lt limit (rank_singleton_lt limit points) fresh - -theorem constantBatchLayerWitness_rank_lt (M : TransitiveGround.{u}) {τ : ZFSet.{u}} - (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) - (spaces : ZFSet.rank Qs < o) (time : ZFSet.rank τ < o) : - ZFSet.rank (d.constantBatchLayerWitness M τ) < o := by - have fiber := d.batchIncomingFiber_rank_lt limit points indices spaces - exact separatedLayerWitness_rank_lt limit indices - (rank_constantFamilyGraph_lt limit indices time) - (M.batchTemplateFamily_rank_lt limit rs As Es points indices spaces) - (M.batchTemplateFamilyBound_rank_lt limit rs As points indices spaces) - (rank_functionGraph_lt limit d.batchIncomingComponents_function fiber indices) fiber - -end AttachmentBatchInputs - -end - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem groundEligibleBatchLayerWitness_rank_lt - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (points : ZFSet.rank P < o) (labels : ZFSet.rank Labels < o) - (time : ZFSet.rank τ < o) : - ZFSet.rank ((M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).constantBatchLayerWitness M τ) < o := by - have tasks := M.groundEligibleTasks_rank_lt limit G r μ A points labels - exact (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).constantBatchLayerWitness_rank_lt - limit M points tasks (rank_constantFamilyGraph_lt limit tasks points) time - -theorem groundEligibleBatchLayerWitness_ranked - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one HQs Hrs Hμs HTime T birth stamp τ N : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) - (historySpaces : FunctionGraphOn HTime HQs) - (historyOrders : FunctionGraphOn HTime Hrs) - (historyMeets : FunctionGraphOn HTime Hμs) - (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (hStamp : stamp ∈ M.sets) (before : τ ∈ stamp) - (source : ZFSet.pair τ P ∈ HQs ∧ ZFSet.pair τ r ∈ Hrs ∧ ZFSet.pair τ μ ∈ Hμs) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (points : ZFSet.rank P < o) - (labels : ZFSet.rank Labels < o) (time : ZFSet.rank τ < o) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - d.constantBatchLayerWitness M τ ∈ M.sets ∧ - ZFSet.rank (d.constantBatchLayerWitness M τ) < o ∧ - GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph - (d.batchBirth birth stamp) stamp N (d.constantBatchLayerWitness M τ) := by - have code := M.groundEligibleBatchLayerWitness pairing unions powers separation hP hG hr hμ hA hLabels - group action meet historySpaces historyOrders historyMeets born earlier hStamp before source (N := N) - exact ⟨code.1, M.groundEligibleBatchLayerWitness_rank_lt group action meet limit points labels time, code.2⟩ - -end TransitiveGround - -namespace GroundCompressionState -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) - -theorem exists_canonicalIncomingRankedWitness - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {HQs Hrs Hμs HTime N : ZFSet.{u}} - (historySpaces : FunctionGraphOn HTime HQs) - (historyOrders : FunctionGraphOn HTime Hrs) - (historyMeets : FunctionGraphOn HTime Hμs) - (source : ZFSet.pair base P0 ∈ HQs ∧ ZFSet.pair base r0 ∈ Hrs ∧ ZFSet.pair base μ0 ∈ Hμs) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (points : ZFSet.rank state.data.D < o) (indices : ZFSet.rank state.data.J < o) - (templates : ZFSet.rank P0 < o) (tasks : ZFSet.rank I < o) - (time : ZFSet.rank base < o) (n : Nat) : - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T (n + 1)).D - (state.data.iterate M I Sources Reps G T (n + 1)).rD - (state.data.iterate M I Sources Reps G T (n + 1)).μD - (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) - (compressionStamp base n) N z := by - let current := state.iterate pairing unions powers separation hI hSources hReps hG hT n - have equal : current.data = state.data.iterate M I Sources Reps G T n := - state.iterate_data pairing unions powers separation hI hSources hReps hG hT n - have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by - simpa only [equal] using constant.iterate M I Sources Reps G T n - have finite : ZFSet.IsFunc current.data.D births.limit - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) := by - simpa only [equal] using state.canonical_birth_function data pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_function births.times n - have earlier : ∀ x t, ZFSet.pair x t ∈ - graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth → - t ∈ compressionStamp base n := fun _ _ entry => - state.canonical_birth_before_stamp pairing unions powers separation hI hSources hReps hG hT - births.extension births.initial_bound n entry - have result := current.batch.constantBatchLayerWitness_spec pairing unions powers separation - current.ground.carrier current.ground.indices current.ground.spaces current.ground.relations - current.ground.anchors current.ground.embeddings historySpaces historyOrders historyMeets finite earlier - (M.transitive births.limit_ground (births.times.stamp_mem_limit n)) (compressionStamp_base_mem base n) - (fun i => ⟨((currentConstant.space_entry_iff _ _).1 (current.batch.space_entry i)).2, - ((currentConstant.relation_entry_iff _ _).1 (current.batch.rel_entry i)).2, - ((currentConstant.meet_entry_iff _ _).1 (current.batch.meet_entry i)).2⟩) source (N := N) - have finiteRanks := constant.iterate_carrier_ranks M I Sources Reps G T limit - points indices templates tasks n - have pointRank : ZFSet.rank current.data.D < o := by simpa only [equal] using finiteRanks.1 - have indexRank : ZFSet.rank current.data.J < o := by simpa only [equal] using finiteRanks.2 - have spaceRank : ZFSet.rank current.data.Qs < o := by - rw [currentConstant.spaces] - exact rank_constantFamilyGraph_lt limit indexRank templates - have witnessRank := current.batch.constantBatchLayerWitness_rank_lt limit M - pointRank indexRank spaceRank time - refine ⟨current.batch.constantBatchLayerWitness M base, result.1, witnessRank, ?_⟩ - have code := result.2 - change GrowthLayerWitnessCode HQs Hrs Hμs current.data.currentCarrier - current.data.currentOrder current.data.currentMeet - (taggedBirth current.data.D current.data.fresh - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) - (compressionStamp base n)) (compressionStamp base n) N _ at code - rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT - births.extension births.initial_function n] - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using code - -end GroundCompressionState - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundConstantBatchLayers +import OAI.SetTheory.PartitionPrinciple.Transfinite.CompressionPrefixCoinitiality + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundEligibleBatchLayerWitness + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one HQs Hrs Hμs HTime T birth stamp τ N : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) + (historySpaces : FunctionGraphOn HTime HQs) + (historyOrders : FunctionGraphOn HTime Hrs) + (historyMeets : FunctionGraphOn HTime Hμs) + (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (hStamp : stamp ∈ M.sets) (before : τ ∈ stamp) + (source : ZFSet.pair τ P ∈ HQs ∧ ZFSet.pair τ r ∈ Hrs ∧ ZFSet.pair τ μ ∈ Hμs) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + d.constantBatchLayerWitness M τ ∈ M.sets ∧ + GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph + (d.batchBirth birth stamp) stamp N (d.constantBatchLayerWitness M τ) := by + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + have fields := M.groundEligibleTaskFields pairing unions powers separation hP hG hr hμ hA hLabels meet + apply d.constantBatchLayerWitness_spec pairing unions powers separation hP fields.1 fields.2.1 + fields.2.2.1 (fields.2.2.2.2 0).1 (fields.2.2.2.2 2).1 + historySpaces historyOrders historyMeets born earlier hStamp before ?_ source + intro i + exact ⟨((pair_mem_constantFamilyGraph _ _ _ _).1 (d.space_entry i)).2, + ((pair_mem_constantFamilyGraph _ _ _ _).1 (d.rel_entry i)).2, + ((pair_mem_constantFamilyGraph _ _ _ _).1 (d.meet_entry i)).2⟩ + +end TransitiveGround + +section +open SetRealization +universe u + +theorem batchFamilyPointBound_rank_le (Qs : ZFSet.{u}) : + ZFSet.rank (familyPointBound Qs) ≤ ZFSet.rank Qs := + (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include limit + +theorem batchTemplateFamilyBound_rank_lt {I P Qs : ZFSet.{u}} (rs As : ZFSet.{u}) + (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) + (spaces : ZFSet.rank Qs < o) : + ZFSet.rank (M.batchTemplateFamilyBound I P Qs rs As) < o := by + have source := (batchFamilyPointBound_rank_le Qs).trans_lt spaces + have fresh := (ZFSet.rank_mono (fun z hz => indexedAttachmentDomain_subset I Qs + (indexedAttachmentFresh_subset I Qs rs As hz))).trans_lt (rank_product_lt limit indices source) + exact M.groundRelations_rank_lt limit source (rank_taggedExtension_lt limit points fresh) + +theorem batchTemplateFamily_rank_lt {I P Qs : ZFSet.{u}} (rs As Es : ZFSet.{u}) + (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) + (spaces : ZFSet.rank Qs < o) : + ZFSet.rank (M.batchTemplateFamily I P Qs rs As Es) < o := by + have subset : M.batchTemplateFamily I P Qs rs As Es ⊆ + ZFSet.prod I (M.batchTemplateFamilyBound I P Qs rs As) := by + intro z hz + unfold batchTemplateFamily indexedRelationSections at hz + exact (ZFSet.mem_sep.1 hz).1 + exact (ZFSet.rank_mono subset).trans_lt (rank_product_lt limit indices + (M.batchTemplateFamilyBound_rank_lt limit rs As points indices spaces)) + +end TransitiveGround + +namespace AttachmentBatchInputs +variable {M : TransitiveGround.{u}} +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include limit + +theorem batchIncomingFiber_rank_lt + (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) + (spaces : ZFSet.rank Qs < o) : ZFSet.rank d.batchIncomingFiber < o := by + have fresh := (ZFSet.rank_mono (fun z hz => indexedAttachmentDomain_subset I Qs + (indexedAttachmentFresh_subset I Qs rs As hz))).trans_lt + (rank_product_lt limit indices ((batchFamilyPointBound_rank_le Qs).trans_lt spaces)) + exact rank_product_lt limit (rank_singleton_lt limit points) fresh + +theorem constantBatchLayerWitness_rank_lt (M : TransitiveGround.{u}) {τ : ZFSet.{u}} + (points : ZFSet.rank P < o) (indices : ZFSet.rank I < o) + (spaces : ZFSet.rank Qs < o) (time : ZFSet.rank τ < o) : + ZFSet.rank (d.constantBatchLayerWitness M τ) < o := by + have fiber := d.batchIncomingFiber_rank_lt limit points indices spaces + exact separatedLayerWitness_rank_lt limit indices + (rank_constantFamilyGraph_lt limit indices time) + (M.batchTemplateFamily_rank_lt limit rs As Es points indices spaces) + (M.batchTemplateFamilyBound_rank_lt limit rs As points indices spaces) + (rank_functionGraph_lt limit d.batchIncomingComponents_function fiber indices) fiber + +end AttachmentBatchInputs + +end + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem groundEligibleBatchLayerWitness_rank_lt + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (points : ZFSet.rank P < o) (labels : ZFSet.rank Labels < o) + (time : ZFSet.rank τ < o) : + ZFSet.rank ((M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).constantBatchLayerWitness M τ) < o := by + have tasks := M.groundEligibleTasks_rank_lt limit G r μ A points labels + exact (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).constantBatchLayerWitness_rank_lt + limit M points tasks (rank_constantFamilyGraph_lt limit tasks points) time + +theorem groundEligibleBatchLayerWitness_ranked + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one HQs Hrs Hμs HTime T birth stamp τ N : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) + (historySpaces : FunctionGraphOn HTime HQs) + (historyOrders : FunctionGraphOn HTime Hrs) + (historyMeets : FunctionGraphOn HTime Hμs) + (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (hStamp : stamp ∈ M.sets) (before : τ ∈ stamp) + (source : ZFSet.pair τ P ∈ HQs ∧ ZFSet.pair τ r ∈ Hrs ∧ ZFSet.pair τ μ ∈ Hμs) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (points : ZFSet.rank P < o) + (labels : ZFSet.rank Labels < o) (time : ZFSet.rank τ < o) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + d.constantBatchLayerWitness M τ ∈ M.sets ∧ + ZFSet.rank (d.constantBatchLayerWitness M τ) < o ∧ + GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph + (d.batchBirth birth stamp) stamp N (d.constantBatchLayerWitness M τ) := by + have code := M.groundEligibleBatchLayerWitness pairing unions powers separation hP hG hr hμ hA hLabels + group action meet historySpaces historyOrders historyMeets born earlier hStamp before source (N := N) + exact ⟨code.1, M.groundEligibleBatchLayerWitness_rank_lt group action meet limit points labels time, code.2⟩ + +end TransitiveGround + +namespace GroundCompressionState +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) + +theorem exists_canonicalIncomingRankedWitness + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {HQs Hrs Hμs HTime N : ZFSet.{u}} + (historySpaces : FunctionGraphOn HTime HQs) + (historyOrders : FunctionGraphOn HTime Hrs) + (historyMeets : FunctionGraphOn HTime Hμs) + (source : ZFSet.pair base P0 ∈ HQs ∧ ZFSet.pair base r0 ∈ Hrs ∧ ZFSet.pair base μ0 ∈ Hμs) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (points : ZFSet.rank state.data.D < o) (indices : ZFSet.rank state.data.J < o) + (templates : ZFSet.rank P0 < o) (tasks : ZFSet.rank I < o) + (time : ZFSet.rank base < o) (n : Nat) : + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T (n + 1)).D + (state.data.iterate M I Sources Reps G T (n + 1)).rD + (state.data.iterate M I Sources Reps G T (n + 1)).μD + (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) + (compressionStamp base n) N z := by + let current := state.iterate pairing unions powers separation hI hSources hReps hG hT n + have equal : current.data = state.data.iterate M I Sources Reps G T n := + state.iterate_data pairing unions powers separation hI hSources hReps hG hT n + have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by + simpa only [equal] using constant.iterate M I Sources Reps G T n + have finite : ZFSet.IsFunc current.data.D births.limit + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) := by + simpa only [equal] using state.canonical_birth_function data pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_function births.times n + have earlier : ∀ x t, ZFSet.pair x t ∈ + graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth → + t ∈ compressionStamp base n := fun _ _ entry => + state.canonical_birth_before_stamp pairing unions powers separation hI hSources hReps hG hT + births.extension births.initial_bound n entry + have result := current.batch.constantBatchLayerWitness_spec pairing unions powers separation + current.ground.carrier current.ground.indices current.ground.spaces current.ground.relations + current.ground.anchors current.ground.embeddings historySpaces historyOrders historyMeets finite earlier + (M.transitive births.limit_ground (births.times.stamp_mem_limit n)) (compressionStamp_base_mem base n) + (fun i => ⟨((currentConstant.space_entry_iff _ _).1 (current.batch.space_entry i)).2, + ((currentConstant.relation_entry_iff _ _).1 (current.batch.rel_entry i)).2, + ((currentConstant.meet_entry_iff _ _).1 (current.batch.meet_entry i)).2⟩) source (N := N) + have finiteRanks := constant.iterate_carrier_ranks M I Sources Reps G T limit + points indices templates tasks n + have pointRank : ZFSet.rank current.data.D < o := by simpa only [equal] using finiteRanks.1 + have indexRank : ZFSet.rank current.data.J < o := by simpa only [equal] using finiteRanks.2 + have spaceRank : ZFSet.rank current.data.Qs < o := by + rw [currentConstant.spaces] + exact rank_constantFamilyGraph_lt limit indexRank templates + have witnessRank := current.batch.constantBatchLayerWitness_rank_lt limit M + pointRank indexRank spaceRank time + refine ⟨current.batch.constantBatchLayerWitness M base, result.1, witnessRank, ?_⟩ + have code := result.2 + change GrowthLayerWitnessCode HQs Hrs Hμs current.data.currentCarrier + current.data.currentOrder current.data.currentMeet + (taggedBirth current.data.D current.data.fresh + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) + (compressionStamp base n)) (compressionStamp base n) N _ at code + rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT + births.extension births.initial_function n] + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using code + +end GroundCompressionState + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionSerializationTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionSerializationTransport.lean index e151862b692d247a3b97ca1869f288729178470a..fee8e11d37617fdc056aeaa1204014bc465e14a3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionSerializationTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCompressionSerializationTransport.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedCompressionChronology - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundCompressionOrigin -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters C Q qlt original Targets Separators base old T0 : ZFSet.{u}} -variable {history : GroundChronologicalHistory M T0 C Q qlt} -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) -variable (compression : GroundChronologicalCompression M initial I Sources Reps G m one T τ - P0 C Q qlt original Targets Separators Filters base old T0 history) -variable (prior : GroundSerializedChronology M T0 C Q qlt) - -include origin in -theorem exists_serializedCompression - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hBase : base ∈ T0) - (constant : RecursiveTemplateConstancy P0 r0 μ0 initial) - (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) (initialMeet : initial.μD = μ0) - (priorSpace : history.space base = P0) (priorOrder : history.order base = r0) - (priorMeet : history.meetGraph base = μ0) (priorBirth : history.birth base = old) - (agreement : ∀ j s, s ∈ T0 → prior.fields.value j s = history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M - (insert compression.born.births.limit compression.born.births.limit) C Q qlt, - serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert compression.born.births.limit compression.born.births.limit → - serial.fields.value j s = compression.history.fieldValue j s := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - let data := compression.born.profiled.heighted.completion.algebra.union - let births := compression.born.births - let heights := compression.born.profiled.heighted.heights - obtain ⟨serial, ground, values⟩ := state.exists_serializedPrefix data births heights prior - pairing unions powers separation collection infinite choice hI hSources hReps hG hT hBase - constant initialDomain initialOrder initialMeet - ((agreement 0 base hBase).trans priorSpace) ((agreement 1 base hBase).trans priorOrder) - ((agreement 2 base hBase).trans priorMeet) ((agreement 3 base hBase).trans priorBirth) - refine ⟨serial, ground, ?_⟩ - intro j s hs - rw [values j s hs] - have oldValue (a : ZFSet.{u}) (before : a ∈ base ∨ a = base) : - (state.prefixFields data births heights prior.toHistory).fieldValue j a = - compression.history.fieldValue j a := by - have ha : a ∈ T0 := before.elim (fun h => prior.ordinal.1 base hBase a h) (fun h => h.symm ▸ hBase) - have left := state.prefixFields_old data births heights prior.toHistory before - have right := compression.old_values a before - have eLeft : (state.prefixFields data births heights prior.toHistory).fieldValue j a = - prior.fields.value j a := - Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 - (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j - have eRight : compression.history.fieldValue j a = history.fieldValue j a := - Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 - (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j - exact eLeft.trans ((agreement j a ha).trans eRight.symm) - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · have left := state.prefixFields_limit data births heights prior.toHistory - have right := compression.limit_values - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - · rcases (births.times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ - · exact oldValue s (Or.inl before) - · exact oldValue s (Or.inr equal) - · have left := state.prefixFields_stamp data births heights prior.toHistory n - have right := compression.stamp_values n - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - -end PartitionPilot.Forcing.GroundCompressionOrigin - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedCompressionChronology + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundCompressionOrigin +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters C Q qlt original Targets Separators base old T0 : ZFSet.{u}} +variable {history : GroundChronologicalHistory M T0 C Q qlt} +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) +variable (compression : GroundChronologicalCompression M initial I Sources Reps G m one T τ + P0 C Q qlt original Targets Separators Filters base old T0 history) +variable (prior : GroundSerializedChronology M T0 C Q qlt) + +include origin in +theorem exists_serializedCompression + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hBase : base ∈ T0) + (constant : RecursiveTemplateConstancy P0 r0 μ0 initial) + (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) (initialMeet : initial.μD = μ0) + (priorSpace : history.space base = P0) (priorOrder : history.order base = r0) + (priorMeet : history.meetGraph base = μ0) (priorBirth : history.birth base = old) + (agreement : ∀ j s, s ∈ T0 → prior.fields.value j s = history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M + (insert compression.born.births.limit compression.born.births.limit) C Q qlt, + serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert compression.born.births.limit compression.born.births.limit → + serial.fields.value j s = compression.history.fieldValue j s := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + let data := compression.born.profiled.heighted.completion.algebra.union + let births := compression.born.births + let heights := compression.born.profiled.heighted.heights + obtain ⟨serial, ground, values⟩ := state.exists_serializedPrefix data births heights prior + pairing unions powers separation collection infinite choice hI hSources hReps hG hT hBase + constant initialDomain initialOrder initialMeet + ((agreement 0 base hBase).trans priorSpace) ((agreement 1 base hBase).trans priorOrder) + ((agreement 2 base hBase).trans priorMeet) ((agreement 3 base hBase).trans priorBirth) + refine ⟨serial, ground, ?_⟩ + intro j s hs + rw [values j s hs] + have oldValue (a : ZFSet.{u}) (before : a ∈ base ∨ a = base) : + (state.prefixFields data births heights prior.toHistory).fieldValue j a = + compression.history.fieldValue j a := by + have ha : a ∈ T0 := before.elim (fun h => prior.ordinal.1 base hBase a h) (fun h => h.symm ▸ hBase) + have left := state.prefixFields_old data births heights prior.toHistory before + have right := compression.old_values a before + have eLeft : (state.prefixFields data births heights prior.toHistory).fieldValue j a = + prior.fields.value j a := + Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 + (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j + have eRight : compression.history.fieldValue j a = history.fieldValue j a := + Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 + (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j + exact eLeft.trans ((agreement j a ha).trans eRight.symm) + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · have left := state.prefixFields_limit data births heights prior.toHistory + have right := compression.limit_values + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + · rcases (births.times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ + · exact oldValue s (Or.inl before) + · exact oldValue s (Or.inr equal) + · have left := state.prefixFields_stamp data births heights prior.toHistory n + have right := compression.stamp_values n + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + +end PartitionPilot.Forcing.GroundCompressionOrigin + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCountableFunctionForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCountableFunctionForcing.lean index 690c5defc287dbb52fbed29215835b47c707d291..b7d8c33bec91de62a920f67dcfe03f1a1939fe8e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCountableFunctionForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundCountableFunctionForcing.lean @@ -1,64 +1,64 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalNumbers - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem countablePartialFunctions_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - M.smallPartialFunctions X Y ZFSet.omega ∈ M.sets := - M.smallPartialFunctions_mem pairing unions powers separation hX hY - (M.omega_mem separation infinite) - -theorem countablePartialFunction_countable {X Y p : ZFSet.{u}} - (hp : p ∈ M.smallPartialFunctions X Y ZFSet.omega) : Countable (SetMembers p) := - M.smallPartialFunction_countable hp - -theorem countableFunctionOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - letI := M.smallFunctionOrder X Y ZFSet.omega - (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)).conditionOrder ∈ M.sets := - M.smallFunctionOrder_mem pairing unions powers separation hX hY - (M.omega_mem separation infinite) - -theorem countablePartialFunctions_restrict (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y p q : ZFSet.{u}} (hp : p ∈ M.smallPartialFunctions X Y ZFSet.omega) - (hq : q ∈ M.sets) (subset : q ⊆ p) : q ∈ M.smallPartialFunctions X Y ZFSet.omega := - M.smallPartialFunctions_restrict separation hp hq (M.omega_mem separation infinite) subset - -theorem exists_countableFunction_generic - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), H.mem p ∧ - H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) ∧ - H.GenericFor (formulaFamily (M.nameDomain - (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)))) := - M.exists_smallFunction_generic small pairing unions powers separation hX hY - (M.omega_mem separation infinite) p - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalNumbers + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem countablePartialFunctions_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + M.smallPartialFunctions X Y ZFSet.omega ∈ M.sets := + M.smallPartialFunctions_mem pairing unions powers separation hX hY + (M.omega_mem separation infinite) + +theorem countablePartialFunction_countable {X Y p : ZFSet.{u}} + (hp : p ∈ M.smallPartialFunctions X Y ZFSet.omega) : Countable (SetMembers p) := + M.smallPartialFunction_countable hp + +theorem countableFunctionOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + letI := M.smallFunctionOrder X Y ZFSet.omega + (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)).conditionOrder ∈ M.sets := + M.smallFunctionOrder_mem pairing unions powers separation hX hY + (M.omega_mem separation infinite) + +theorem countablePartialFunctions_restrict (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y p q : ZFSet.{u}} (hp : p ∈ M.smallPartialFunctions X Y ZFSet.omega) + (hq : q ∈ M.sets) (subset : q ⊆ p) : q ∈ M.smallPartialFunctions X Y ZFSet.omega := + M.smallPartialFunctions_restrict separation hp hq (M.omega_mem separation infinite) subset + +theorem exists_countableFunction_generic + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), H.mem p ∧ + H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) ∧ + H.GenericFor (formulaFamily (M.nameDomain + (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)))) := + M.exists_smallFunction_generic small pairing unions powers separation hX hY + (M.omega_mem separation infinite) p + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundDefinableRefinementNameGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundDefinableRefinementNameGraphs.lean index e03fb2c35d6a15227be174f9ca3f114b5f9ea02b..22356dba7249f1a3311e98a2f108b67ff8f50a89 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundDefinableRefinementNameGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundDefinableRefinementNameGraphs.lean @@ -1,371 +1,371 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableIndexBounds - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace Name -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} - -noncomputable def refinementOutput (kind : Fin 3) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) : Name s := - Fin.cases (refinementQuotient T valid U Rf) - (Fin.cases (refinementQuotient T valid U Rc) (fun _ => refinementNaturalMap T valid U Rf Rc)) kind - -end Name -namespace SetFormula - -def refinementOutputCodeFormula (kind : Fin 3) : SetFormula 8 := - Fin.cases (reindex ![0, 1, 2, 3, 5, 6, 7] refinementQuotientCodeFormula) - (Fin.cases (reindex ![0, 1, 2, 4, 5, 6, 7] refinementQuotientCodeFormula) - (fun _ => refinementMapCodeFormula)) kind - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def refinementNameBound (T P top : ZFSet.{u}) : ZFSet.{u} := - M.groundRelations (M.groundRelations T P ∪ - orderedPairNameFamily top (M.groundRelations T P) (M.groundRelations T P)) P - -theorem refinementNameBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T P top : ZFSet.{u}} (hT : T ∈ M.sets) (hP : P ∈ M.sets) (htop : top ∈ M.sets) : - M.refinementNameBound T P top ∈ M.sets := by - have hc := M.groundRelations_mem pairing unions powers separation hT hP - exact M.groundRelations_mem pairing unions powers separation - (M.binary_union_mem pairing unions hc (M.orderedPairNameFamily_mem pairing unions powers separation htop hc hc)) hP - -variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -include pairing unions powers separation collection carrier order - -theorem refinementOutput_mem_bound (kind : Fin 3) {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) - (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) : - (Name.refinementOutput kind T valid U Rf Rc).val ∈ M.refinementNameBound T s.carrier (s.encode ⊤) := by - let B := M.groundRelations T s.carrier - let C := B ∪ orderedPairNameFamily (s.encode ⊤) B B - have classBound (R : Name s) (hR : R.val ∈ M.sets) (w : Name s) (hw : w.val ∈ T) : - (Name.refinementClass T valid R w).val ∈ B := - (M.mem_groundRelations T s.carrier _).2 - ⟨M.refinementClass_mem s pairing unions powers separation collection carrier order hT valid R w hR - (M.transitive hT hw), Name.refinementClass_subset T valid R w⟩ - have quotient (R : Name s) (hR : R.val ∈ M.sets) : - (Name.refinementQuotient T valid U R).val ∈ M.groundRelations C s.carrier := by - apply (M.mem_groundRelations C s.carrier _).2 - exact ⟨M.refinementQuotient_mem s pairing unions powers separation collection carrier order hT valid U R hU hR, - Name.activeImage_subset T valid U _ C (fun w hw => ZFSet.mem_union.2 (Or.inl (classBound R hR w hw)))⟩ - have natural : (Name.refinementNaturalMap T valid U Rf Rc).val ∈ M.groundRelations C s.carrier := by - apply (M.mem_groundRelations C s.carrier _).2 - refine ⟨M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order hT valid U Rf Rc hU hRf hRc, - Name.activeImage_subset T valid U _ C ?_⟩ - intro w hw - exact ZFSet.mem_union.2 (Or.inr ((mem_orderedPairNameFamily _ B B _).2 - ⟨_, classBound Rf hRf w hw, _, classBound Rc hRc w hw, Name.orderedPair_code ⊤ _ _⟩)) - exact Fin.cases (quotient Rf hRf) (Fin.cases (quotient Rc hRc) - (Fin.cases natural (fun j => Fin.elim0 j))) kind - -theorem realize_refinementOutputCodeFormula (kind : Fin 3) {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) - (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) - (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets (refinementOutputCodeFormula kind) - (extend z (extend T (extend U.val (extend Rf.val (extend Rc.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))))) ↔ - z = (Name.refinementOutput kind T valid U Rf Rc).val := by - let env := extend z (extend T (extend U.val (extend Rf.val (extend Rc.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0))))))) - have firstArgs : (fun j : Fin 7 => env (![0, 1, 2, 3, 5, 6, 7] j)) = - extend z (extend T (extend U.val (extend Rf.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))) j - have secondArgs : (fun j : Fin 7 => env (![0, 1, 2, 4, 5, 6, 7] j)) = - extend z (extend T (extend U.val (extend Rc.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))) j - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j))) kind - · change Realize M.sets (reindex _ refinementQuotientCodeFormula) env ↔ _ - rw [realize_reindex, firstArgs] - exact M.realize_refinementQuotientCodeFormula s pairing unions powers separation collection carrier order hT valid U Rf hU hRf z hz - · change Realize M.sets (reindex _ refinementQuotientCodeFormula) env ↔ _ - rw [realize_reindex, secondArgs] - exact M.realize_refinementQuotientCodeFormula s pairing unions powers separation collection carrier order hT valid U Rc hU hRc z hz - · exact M.realize_refinementMapCodeFormula s pairing unions powers separation collection carrier order hT valid U Rf Rc hU hRf hRc z hz - -end TransitiveGround - - - -namespace SetFormula - -def refinementIndexNameGraphFormula (kind : Fin 3) : SetFormula 9 := - let w := prefixIndex 9 5 - let old := suffixIndex 9 5 - exBlock 5 (.conj (.mem (w 0) (old 1)) - (.conj (BoundedFormula.orderedPairFormula (old 0) (w 0) (w 1)).toFormula - (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 2) (old 2)).toFormula - (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 3) (old 3)).toFormula - (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 4) (old 4)).toFormula - (reindex ![w 1, old 5, w 2, w 3, w 4, old 6, old 7, old 8] - (refinementOutputCodeFormula kind))))))) - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def refinementIndexNameGraph (kind : Fin 3) - (I UF FF CF T P order top : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => Realize M.sets (refinementIndexNameGraphFormula kind) - (extend z ![I, UF, FF, CF, T, P, order, top])) - (ZFSet.prod I (M.refinementNameBound T P top)) - -theorem refinementIndexNameGraph_mem (kind : Fin 3) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I UF FF CF T P order top : ZFSet.{u}} - (hI : I ∈ M.sets) (hUF : UF ∈ M.sets) (hFF : FF ∈ M.sets) (hCF : CF ∈ M.sets) - (hT : T ∈ M.sets) (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) : - M.refinementIndexNameGraph kind I UF FF CF T P order top ∈ M.sets := by - exact M.separation_mem separation (refinementIndexNameGraphFormula kind) - ![I, UF, FF, CF, T, P, order, top] - (Fin.cases hI (Fin.cases hUF (Fin.cases hFF (Fin.cases hCF (Fin.cases hT - (Fin.cases hP (Fin.cases ho (Fin.cases ht (fun j => Fin.elim0 j))))))))) - (M.prod_mem pairing unions powers separation hI - (M.refinementNameBound_mem pairing unions powers separation hT hP ht)) - -theorem realize_refinementIndexNameGraphFormula (kind : Fin 3) - (env : Fin 9 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (refinementIndexNameGraphFormula kind) env ↔ - ∃ w : Fin 5 → ZFSet.{u}, (∀ j, w j ∈ M.sets) ∧ - w 0 ∈ env 1 ∧ env 0 = ZFSet.pair (w 0) (w 1) ∧ - ZFSet.pair (w 0) (w 2) ∈ env 2 ∧ ZFSet.pair (w 0) (w 3) ∈ env 3 ∧ - ZFSet.pair (w 0) (w 4) ∈ env 4 ∧ - Realize M.sets (refinementOutputCodeFormula kind) - (extend (w 1) (extend (env 5) (extend (w 2) (extend (w 3) (extend (w 4) - (extend (env 6) (extend (env 7) (extend (env 8) Fin.elim0)))))))) := by - rw [refinementIndexNameGraphFormula, realize_exBlock] - apply exists_congr - intro w - apply and_congr_right - intro ground - have args : (fun j : Fin 8 => extendMany 5 w env - (![prefixIndex 9 5 1, suffixIndex 9 5 5, prefixIndex 9 5 2, - prefixIndex 9 5 3, prefixIndex 9 5 4, suffixIndex 9 5 6, - suffixIndex 9 5 7, suffixIndex 9 5 8] j)) = - extend (w 1) (extend (env 5) (extend (w 2) (extend (w 3) (extend (w 4) - (extend (env 6) (extend (env 7) (extend (env 8) Fin.elim0))))))) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (fun k => Fin.elim0 k)))))))) j - simp only [Realize, BoundedFormula.realize_toFormula M _ _ - (extendMany_members 5 w env ground members), BoundedFormula.truth_orderedPairFormula, - BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix, - realize_reindex, args] - -variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) - -theorem refinementIndexNameGraph_entry (kind : Fin 3) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {I UF FF CF T : ZFSet.{u}} (hI : I ∈ M.sets) (hUF : UF ∈ M.sets) - (hFF : FF ∈ M.sets) (hCF : CF ∈ M.sets) (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) - (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) - {i : ZFSet.{u}} (hi : i ∈ I) - (uEntry : ∀ z, ZFSet.pair i z ∈ UF ↔ z = U.val) - (fEntry : ∀ z, ZFSet.pair i z ∈ FF ↔ z = Rf.val) - (cEntry : ∀ z, ZFSet.pair i z ∈ CF ↔ z = Rc.val) (y : ZFSet.{u}) : - ZFSet.pair i y ∈ M.refinementIndexNameGraph kind I UF FF CF T s.carrier s.conditionOrder (s.encode ⊤) ↔ - y = (Name.refinementOutput kind T valid U Rf Rc).val := by - have ht := M.transitive carrier (s.encode_mem ⊤) - have hB := M.refinementNameBound_mem pairing unions powers separation hT carrier ht - have hidx := M.transitive hI hi - let params : Fin 8 → ZFSet.{u} := ![I, UF, FF, CF, T, s.carrier, s.conditionOrder, s.encode ⊤] - have hp : ∀ j, params j ∈ M.sets := Fin.cases hI (Fin.cases hUF (Fin.cases hFF - (Fin.cases hCF (Fin.cases hT (Fin.cases carrier (Fin.cases order - (Fin.cases ht (fun j => Fin.elim0 j)))))))) - rw [refinementIndexNameGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨_, hyB⟩, recognized⟩ - have hy := M.transitive hB hyB - have hpair := M.orderedPair_mem pairing hidx hy - obtain ⟨w, ground, _, equal, hu, hf, hc, output⟩ := - (M.realize_refinementIndexNameGraphFormula kind (extend (ZFSet.pair i y) params) - (Fin.cases hpair hp)).1 recognized - have eq : ZFSet.pair i y = ZFSet.pair (w 0) (w 1) := equal - obtain ⟨idx, val⟩ := ZFSet.pair_inj.1 eq - have ue : w 2 = U.val := (uEntry _).1 (idx.symm ▸ hu) - have fe : w 3 = Rf.val := (fEntry _).1 (idx.symm ▸ hf) - have ce : w 4 = Rc.val := (cEntry _).1 (idx.symm ▸ hc) - change Realize M.sets (refinementOutputCodeFormula kind) - (extend (w 1) (extend T (extend (w 2) (extend (w 3) (extend (w 4) - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))))) at output - rw [← val, ue, fe, ce] at output - exact (M.realize_refinementOutputCodeFormula s pairing unions powers separation collection - carrier order kind hT valid U Rf Rc hU hRf hRc y hy).1 output - · intro equal - subst y - have bound := M.refinementOutput_mem_bound s pairing unions powers separation collection - carrier order kind hT valid U Rf Rc hU hRf hRc - have hy := M.transitive hB bound - refine ⟨⟨hi, bound⟩, ?_⟩ - apply (M.realize_refinementIndexNameGraphFormula kind (extend _ params) - (Fin.cases (M.orderedPair_mem pairing hidx hy) hp)).2 - refine ⟨![i, (Name.refinementOutput kind T valid U Rf Rc).val, U.val, Rf.val, Rc.val], - Fin.cases hidx (Fin.cases hy (Fin.cases hU (Fin.cases hRf (Fin.cases hRc - (fun j => Fin.elim0 j))))), hi, rfl, (uEntry _).2 rfl, (fEntry _).2 rfl, - (cEntry _).2 rfl, ?_⟩ - exact (M.realize_refinementOutputCodeFormula s pairing unions powers separation collection - carrier order kind hT valid U Rf Rc hU hRf hRc _ hy).2 rfl - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - -noncomputable def niceRefinementNameGraph (kind : Fin 3) (level T1 T2 : ZFSet.{u}) - (valid1 : ∀ z ∈ T1, IsName s z) : ZFSet.{u} := - let I := M.niceRefinementIndices a s b d level T1 T2 valid1 - let bounds := M.niceRefinementIndexBounds s b level T1 T2 - M.refinementIndexNameGraph kind I (refinementIndexFieldGraph I (bounds 3) 3) - (refinementIndexFieldGraph I (bounds 4) 4) (refinementIndexFieldGraph I (bounds 5) 5) - T1 s.carrier s.conditionOrder (s.encode ⊤) - -variable {level T1 T2 : ZFSet.{u}} {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} -variable (system : NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2) - -include system in -theorem niceRefinementIndex_field_entry (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid1) (j : Fin 6) (z : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) z ∈ - refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndexBounds s b level T1 T2 j) j ↔ - z = (![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] : Fin 6 → ZFSet.{u}) j := by - let I := M.niceRefinementIndices a s b d level T1 T2 valid1 - let fields : Fin 6 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] - let B := M.niceRefinementIndexBounds s b level T1 T2 j - change ZFSet.pair (nonemptyTupleCode 5 fields) z ∈ refinementIndexFieldGraph I B j ↔ z = fields j - constructor - · intro entry - exact ((refinementIndexFieldGraph_entry I B fields j z).1 entry).2.2 - · intro equal - obtain ⟨v, hv, _⟩ := (system.field_function j).2 _ member - have value : v = fields j := ((refinementIndexFieldGraph_entry I B fields j v).1 hv).2.2 - exact equal.symm ▸ (value ▸ hv) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (hT1 : T1 ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include system pairing unions powers separation hT1 carrier order in -theorem niceRefinementNameGraph_mem (kind : Fin 3) : - M.niceRefinementNameGraph a s b d kind level T1 T2 valid1 ∈ M.sets := - M.refinementIndexNameGraph_mem kind pairing unions powers separation system.index_ground - (system.field_ground 3) (system.field_ground 4) (system.field_ground 5) hT1 carrier order - (M.transitive carrier (s.encode_mem ⊤)) - -include system pairing unions powers separation collection hT1 carrier order in -theorem niceRefinementNameGraph_entry (kind : Fin 3) - (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid1) (y : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) y ∈ - M.niceRefinementNameGraph a s b d kind level T1 T2 valid1 ↔ - y = (Name.refinementOutput kind T1 valid1 U.val Rf.val Rc.val).val := by - exact M.refinementIndexNameGraph_entry s kind pairing unions powers separation collection carrier order - system.index_ground (system.field_ground 3) (system.field_ground 4) (system.field_ground 5) - hT1 valid1 U.val Rf.val Rc.val U.property Rf.property Rc.property member - (M.niceRefinementIndex_field_entry a s b d system C E U Rf Rc member 3) - (M.niceRefinementIndex_field_entry a s b d system C E U Rf Rc member 4) - (M.niceRefinementIndex_field_entry a s b d system C E U Rf Rc member 5) y - -include system pairing unions powers separation collection hT1 carrier order in -theorem niceRefinementNameGraph_function (kind : Fin 3) : - ZFSet.IsFunc (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.refinementNameBound T1 s.carrier (s.encode ⊤)) - (M.niceRefinementNameGraph a s b d kind level T1 T2 valid1) := by - refine ⟨?_, ?_⟩ - · intro z hz - unfold niceRefinementNameGraph refinementIndexNameGraph at hz - exact (ZFSet.mem_sep.1 hz).1 - intro i hi - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := system.decoded i hi - refine ⟨(Name.refinementOutput kind T1 valid1 U.val Rf.val Rc.val).val, ?_, ?_⟩ - · exact (M.niceRefinementNameGraph_entry a s b d system pairing unions powers separation collection - hT1 carrier order kind C E U Rf Rc hi _).2 rfl - · intro y hy - exact (M.niceRefinementNameGraph_entry a s b d system pairing unions powers separation collection - hT1 carrier order kind C E U Rf Rc hi y).1 hy - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_refinementNameBound : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => M.refinementNameBound (env 0) (env 1) (env 2)) := by - let v := GroundSetTerm.var M (n := 3) - let classes := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 0, v 1] - let pairs := GroundSetTerm.app (M.definable_orderedPairNameFamily pairing unions powers separation) - ![v 2, classes, classes] - let children := GroundSetTerm.app (M.definable_binaryUnion pairing unions) ![classes, pairs] - exact (GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![children, v 1]).definition - -noncomputable def definable_refinementIndexNameGraph (kind : Fin 3) : - GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => - M.refinementIndexNameGraph kind (env 0) (env 1) (env 2) (env 3) - (env 4) (env 5) (env 6) (env 7)) := by - let v := GroundSetTerm.var M (n := 8) - let names := GroundSetTerm.app (M.definable_refinementNameBound pairing unions powers separation) - ![v 4, v 5, v 7] - let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, names] - let term := GroundSetTerm.app (M.definable_separation separation (refinementIndexNameGraphFormula kind)) - ![bound, v 0, v 1, v 2, v 3, v 4, v 5, v 6, v 7] - refine term.definition.congr ?_ - intro env - apply congrArg (fun params : Fin 8 → ZFSet.{u} => - ZFSet.sep (fun z => Realize M.sets (refinementIndexNameGraphFormula kind) (extend z params)) - (ZFSet.prod (env 0) (M.refinementNameBound (env 4) (env 5) (env 7)))) - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))) j - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableIndexBounds + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace Name +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} + +noncomputable def refinementOutput (kind : Fin 3) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) : Name s := + Fin.cases (refinementQuotient T valid U Rf) + (Fin.cases (refinementQuotient T valid U Rc) (fun _ => refinementNaturalMap T valid U Rf Rc)) kind + +end Name +namespace SetFormula + +def refinementOutputCodeFormula (kind : Fin 3) : SetFormula 8 := + Fin.cases (reindex ![0, 1, 2, 3, 5, 6, 7] refinementQuotientCodeFormula) + (Fin.cases (reindex ![0, 1, 2, 4, 5, 6, 7] refinementQuotientCodeFormula) + (fun _ => refinementMapCodeFormula)) kind + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def refinementNameBound (T P top : ZFSet.{u}) : ZFSet.{u} := + M.groundRelations (M.groundRelations T P ∪ + orderedPairNameFamily top (M.groundRelations T P) (M.groundRelations T P)) P + +theorem refinementNameBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T P top : ZFSet.{u}} (hT : T ∈ M.sets) (hP : P ∈ M.sets) (htop : top ∈ M.sets) : + M.refinementNameBound T P top ∈ M.sets := by + have hc := M.groundRelations_mem pairing unions powers separation hT hP + exact M.groundRelations_mem pairing unions powers separation + (M.binary_union_mem pairing unions hc (M.orderedPairNameFamily_mem pairing unions powers separation htop hc hc)) hP + +variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +include pairing unions powers separation collection carrier order + +theorem refinementOutput_mem_bound (kind : Fin 3) {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) + (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) : + (Name.refinementOutput kind T valid U Rf Rc).val ∈ M.refinementNameBound T s.carrier (s.encode ⊤) := by + let B := M.groundRelations T s.carrier + let C := B ∪ orderedPairNameFamily (s.encode ⊤) B B + have classBound (R : Name s) (hR : R.val ∈ M.sets) (w : Name s) (hw : w.val ∈ T) : + (Name.refinementClass T valid R w).val ∈ B := + (M.mem_groundRelations T s.carrier _).2 + ⟨M.refinementClass_mem s pairing unions powers separation collection carrier order hT valid R w hR + (M.transitive hT hw), Name.refinementClass_subset T valid R w⟩ + have quotient (R : Name s) (hR : R.val ∈ M.sets) : + (Name.refinementQuotient T valid U R).val ∈ M.groundRelations C s.carrier := by + apply (M.mem_groundRelations C s.carrier _).2 + exact ⟨M.refinementQuotient_mem s pairing unions powers separation collection carrier order hT valid U R hU hR, + Name.activeImage_subset T valid U _ C (fun w hw => ZFSet.mem_union.2 (Or.inl (classBound R hR w hw)))⟩ + have natural : (Name.refinementNaturalMap T valid U Rf Rc).val ∈ M.groundRelations C s.carrier := by + apply (M.mem_groundRelations C s.carrier _).2 + refine ⟨M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order hT valid U Rf Rc hU hRf hRc, + Name.activeImage_subset T valid U _ C ?_⟩ + intro w hw + exact ZFSet.mem_union.2 (Or.inr ((mem_orderedPairNameFamily _ B B _).2 + ⟨_, classBound Rf hRf w hw, _, classBound Rc hRc w hw, Name.orderedPair_code ⊤ _ _⟩)) + exact Fin.cases (quotient Rf hRf) (Fin.cases (quotient Rc hRc) + (Fin.cases natural (fun j => Fin.elim0 j))) kind + +theorem realize_refinementOutputCodeFormula (kind : Fin 3) {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) + (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) + (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets (refinementOutputCodeFormula kind) + (extend z (extend T (extend U.val (extend Rf.val (extend Rc.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))))) ↔ + z = (Name.refinementOutput kind T valid U Rf Rc).val := by + let env := extend z (extend T (extend U.val (extend Rf.val (extend Rc.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0))))))) + have firstArgs : (fun j : Fin 7 => env (![0, 1, 2, 3, 5, 6, 7] j)) = + extend z (extend T (extend U.val (extend Rf.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))) j + have secondArgs : (fun j : Fin 7 => env (![0, 1, 2, 4, 5, 6, 7] j)) = + extend z (extend T (extend U.val (extend Rc.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))) j + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j))) kind + · change Realize M.sets (reindex _ refinementQuotientCodeFormula) env ↔ _ + rw [realize_reindex, firstArgs] + exact M.realize_refinementQuotientCodeFormula s pairing unions powers separation collection carrier order hT valid U Rf hU hRf z hz + · change Realize M.sets (reindex _ refinementQuotientCodeFormula) env ↔ _ + rw [realize_reindex, secondArgs] + exact M.realize_refinementQuotientCodeFormula s pairing unions powers separation collection carrier order hT valid U Rc hU hRc z hz + · exact M.realize_refinementMapCodeFormula s pairing unions powers separation collection carrier order hT valid U Rf Rc hU hRf hRc z hz + +end TransitiveGround + + + +namespace SetFormula + +def refinementIndexNameGraphFormula (kind : Fin 3) : SetFormula 9 := + let w := prefixIndex 9 5 + let old := suffixIndex 9 5 + exBlock 5 (.conj (.mem (w 0) (old 1)) + (.conj (BoundedFormula.orderedPairFormula (old 0) (w 0) (w 1)).toFormula + (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 2) (old 2)).toFormula + (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 3) (old 3)).toFormula + (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 4) (old 4)).toFormula + (reindex ![w 1, old 5, w 2, w 3, w 4, old 6, old 7, old 8] + (refinementOutputCodeFormula kind))))))) + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def refinementIndexNameGraph (kind : Fin 3) + (I UF FF CF T P order top : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => Realize M.sets (refinementIndexNameGraphFormula kind) + (extend z ![I, UF, FF, CF, T, P, order, top])) + (ZFSet.prod I (M.refinementNameBound T P top)) + +theorem refinementIndexNameGraph_mem (kind : Fin 3) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I UF FF CF T P order top : ZFSet.{u}} + (hI : I ∈ M.sets) (hUF : UF ∈ M.sets) (hFF : FF ∈ M.sets) (hCF : CF ∈ M.sets) + (hT : T ∈ M.sets) (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) : + M.refinementIndexNameGraph kind I UF FF CF T P order top ∈ M.sets := by + exact M.separation_mem separation (refinementIndexNameGraphFormula kind) + ![I, UF, FF, CF, T, P, order, top] + (Fin.cases hI (Fin.cases hUF (Fin.cases hFF (Fin.cases hCF (Fin.cases hT + (Fin.cases hP (Fin.cases ho (Fin.cases ht (fun j => Fin.elim0 j))))))))) + (M.prod_mem pairing unions powers separation hI + (M.refinementNameBound_mem pairing unions powers separation hT hP ht)) + +theorem realize_refinementIndexNameGraphFormula (kind : Fin 3) + (env : Fin 9 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (refinementIndexNameGraphFormula kind) env ↔ + ∃ w : Fin 5 → ZFSet.{u}, (∀ j, w j ∈ M.sets) ∧ + w 0 ∈ env 1 ∧ env 0 = ZFSet.pair (w 0) (w 1) ∧ + ZFSet.pair (w 0) (w 2) ∈ env 2 ∧ ZFSet.pair (w 0) (w 3) ∈ env 3 ∧ + ZFSet.pair (w 0) (w 4) ∈ env 4 ∧ + Realize M.sets (refinementOutputCodeFormula kind) + (extend (w 1) (extend (env 5) (extend (w 2) (extend (w 3) (extend (w 4) + (extend (env 6) (extend (env 7) (extend (env 8) Fin.elim0)))))))) := by + rw [refinementIndexNameGraphFormula, realize_exBlock] + apply exists_congr + intro w + apply and_congr_right + intro ground + have args : (fun j : Fin 8 => extendMany 5 w env + (![prefixIndex 9 5 1, suffixIndex 9 5 5, prefixIndex 9 5 2, + prefixIndex 9 5 3, prefixIndex 9 5 4, suffixIndex 9 5 6, + suffixIndex 9 5 7, suffixIndex 9 5 8] j)) = + extend (w 1) (extend (env 5) (extend (w 2) (extend (w 3) (extend (w 4) + (extend (env 6) (extend (env 7) (extend (env 8) Fin.elim0))))))) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (fun k => Fin.elim0 k)))))))) j + simp only [Realize, BoundedFormula.realize_toFormula M _ _ + (extendMany_members 5 w env ground members), BoundedFormula.truth_orderedPairFormula, + BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix, + realize_reindex, args] + +variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) + +theorem refinementIndexNameGraph_entry (kind : Fin 3) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {I UF FF CF T : ZFSet.{u}} (hI : I ∈ M.sets) (hUF : UF ∈ M.sets) + (hFF : FF ∈ M.sets) (hCF : CF ∈ M.sets) (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) + (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) + {i : ZFSet.{u}} (hi : i ∈ I) + (uEntry : ∀ z, ZFSet.pair i z ∈ UF ↔ z = U.val) + (fEntry : ∀ z, ZFSet.pair i z ∈ FF ↔ z = Rf.val) + (cEntry : ∀ z, ZFSet.pair i z ∈ CF ↔ z = Rc.val) (y : ZFSet.{u}) : + ZFSet.pair i y ∈ M.refinementIndexNameGraph kind I UF FF CF T s.carrier s.conditionOrder (s.encode ⊤) ↔ + y = (Name.refinementOutput kind T valid U Rf Rc).val := by + have ht := M.transitive carrier (s.encode_mem ⊤) + have hB := M.refinementNameBound_mem pairing unions powers separation hT carrier ht + have hidx := M.transitive hI hi + let params : Fin 8 → ZFSet.{u} := ![I, UF, FF, CF, T, s.carrier, s.conditionOrder, s.encode ⊤] + have hp : ∀ j, params j ∈ M.sets := Fin.cases hI (Fin.cases hUF (Fin.cases hFF + (Fin.cases hCF (Fin.cases hT (Fin.cases carrier (Fin.cases order + (Fin.cases ht (fun j => Fin.elim0 j)))))))) + rw [refinementIndexNameGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨_, hyB⟩, recognized⟩ + have hy := M.transitive hB hyB + have hpair := M.orderedPair_mem pairing hidx hy + obtain ⟨w, ground, _, equal, hu, hf, hc, output⟩ := + (M.realize_refinementIndexNameGraphFormula kind (extend (ZFSet.pair i y) params) + (Fin.cases hpair hp)).1 recognized + have eq : ZFSet.pair i y = ZFSet.pair (w 0) (w 1) := equal + obtain ⟨idx, val⟩ := ZFSet.pair_inj.1 eq + have ue : w 2 = U.val := (uEntry _).1 (idx.symm ▸ hu) + have fe : w 3 = Rf.val := (fEntry _).1 (idx.symm ▸ hf) + have ce : w 4 = Rc.val := (cEntry _).1 (idx.symm ▸ hc) + change Realize M.sets (refinementOutputCodeFormula kind) + (extend (w 1) (extend T (extend (w 2) (extend (w 3) (extend (w 4) + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))))) at output + rw [← val, ue, fe, ce] at output + exact (M.realize_refinementOutputCodeFormula s pairing unions powers separation collection + carrier order kind hT valid U Rf Rc hU hRf hRc y hy).1 output + · intro equal + subst y + have bound := M.refinementOutput_mem_bound s pairing unions powers separation collection + carrier order kind hT valid U Rf Rc hU hRf hRc + have hy := M.transitive hB bound + refine ⟨⟨hi, bound⟩, ?_⟩ + apply (M.realize_refinementIndexNameGraphFormula kind (extend _ params) + (Fin.cases (M.orderedPair_mem pairing hidx hy) hp)).2 + refine ⟨![i, (Name.refinementOutput kind T valid U Rf Rc).val, U.val, Rf.val, Rc.val], + Fin.cases hidx (Fin.cases hy (Fin.cases hU (Fin.cases hRf (Fin.cases hRc + (fun j => Fin.elim0 j))))), hi, rfl, (uEntry _).2 rfl, (fEntry _).2 rfl, + (cEntry _).2 rfl, ?_⟩ + exact (M.realize_refinementOutputCodeFormula s pairing unions powers separation collection + carrier order kind hT valid U Rf Rc hU hRf hRc _ hy).2 rfl + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + +noncomputable def niceRefinementNameGraph (kind : Fin 3) (level T1 T2 : ZFSet.{u}) + (valid1 : ∀ z ∈ T1, IsName s z) : ZFSet.{u} := + let I := M.niceRefinementIndices a s b d level T1 T2 valid1 + let bounds := M.niceRefinementIndexBounds s b level T1 T2 + M.refinementIndexNameGraph kind I (refinementIndexFieldGraph I (bounds 3) 3) + (refinementIndexFieldGraph I (bounds 4) 4) (refinementIndexFieldGraph I (bounds 5) 5) + T1 s.carrier s.conditionOrder (s.encode ⊤) + +variable {level T1 T2 : ZFSet.{u}} {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} +variable (system : NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2) + +include system in +theorem niceRefinementIndex_field_entry (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid1) (j : Fin 6) (z : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) z ∈ + refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndexBounds s b level T1 T2 j) j ↔ + z = (![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] : Fin 6 → ZFSet.{u}) j := by + let I := M.niceRefinementIndices a s b d level T1 T2 valid1 + let fields : Fin 6 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] + let B := M.niceRefinementIndexBounds s b level T1 T2 j + change ZFSet.pair (nonemptyTupleCode 5 fields) z ∈ refinementIndexFieldGraph I B j ↔ z = fields j + constructor + · intro entry + exact ((refinementIndexFieldGraph_entry I B fields j z).1 entry).2.2 + · intro equal + obtain ⟨v, hv, _⟩ := (system.field_function j).2 _ member + have value : v = fields j := ((refinementIndexFieldGraph_entry I B fields j v).1 hv).2.2 + exact equal.symm ▸ (value ▸ hv) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (hT1 : T1 ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include system pairing unions powers separation hT1 carrier order in +theorem niceRefinementNameGraph_mem (kind : Fin 3) : + M.niceRefinementNameGraph a s b d kind level T1 T2 valid1 ∈ M.sets := + M.refinementIndexNameGraph_mem kind pairing unions powers separation system.index_ground + (system.field_ground 3) (system.field_ground 4) (system.field_ground 5) hT1 carrier order + (M.transitive carrier (s.encode_mem ⊤)) + +include system pairing unions powers separation collection hT1 carrier order in +theorem niceRefinementNameGraph_entry (kind : Fin 3) + (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid1) (y : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) y ∈ + M.niceRefinementNameGraph a s b d kind level T1 T2 valid1 ↔ + y = (Name.refinementOutput kind T1 valid1 U.val Rf.val Rc.val).val := by + exact M.refinementIndexNameGraph_entry s kind pairing unions powers separation collection carrier order + system.index_ground (system.field_ground 3) (system.field_ground 4) (system.field_ground 5) + hT1 valid1 U.val Rf.val Rc.val U.property Rf.property Rc.property member + (M.niceRefinementIndex_field_entry a s b d system C E U Rf Rc member 3) + (M.niceRefinementIndex_field_entry a s b d system C E U Rf Rc member 4) + (M.niceRefinementIndex_field_entry a s b d system C E U Rf Rc member 5) y + +include system pairing unions powers separation collection hT1 carrier order in +theorem niceRefinementNameGraph_function (kind : Fin 3) : + ZFSet.IsFunc (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.refinementNameBound T1 s.carrier (s.encode ⊤)) + (M.niceRefinementNameGraph a s b d kind level T1 T2 valid1) := by + refine ⟨?_, ?_⟩ + · intro z hz + unfold niceRefinementNameGraph refinementIndexNameGraph at hz + exact (ZFSet.mem_sep.1 hz).1 + intro i hi + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := system.decoded i hi + refine ⟨(Name.refinementOutput kind T1 valid1 U.val Rf.val Rc.val).val, ?_, ?_⟩ + · exact (M.niceRefinementNameGraph_entry a s b d system pairing unions powers separation collection + hT1 carrier order kind C E U Rf Rc hi _).2 rfl + · intro y hy + exact (M.niceRefinementNameGraph_entry a s b d system pairing unions powers separation collection + hT1 carrier order kind C E U Rf Rc hi y).1 hy + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_refinementNameBound : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => M.refinementNameBound (env 0) (env 1) (env 2)) := by + let v := GroundSetTerm.var M (n := 3) + let classes := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 0, v 1] + let pairs := GroundSetTerm.app (M.definable_orderedPairNameFamily pairing unions powers separation) + ![v 2, classes, classes] + let children := GroundSetTerm.app (M.definable_binaryUnion pairing unions) ![classes, pairs] + exact (GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![children, v 1]).definition + +noncomputable def definable_refinementIndexNameGraph (kind : Fin 3) : + GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => + M.refinementIndexNameGraph kind (env 0) (env 1) (env 2) (env 3) + (env 4) (env 5) (env 6) (env 7)) := by + let v := GroundSetTerm.var M (n := 8) + let names := GroundSetTerm.app (M.definable_refinementNameBound pairing unions powers separation) + ![v 4, v 5, v 7] + let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, names] + let term := GroundSetTerm.app (M.definable_separation separation (refinementIndexNameGraphFormula kind)) + ![bound, v 0, v 1, v 2, v 3, v 4, v 5, v 6, v 7] + refine term.definition.congr ?_ + intro env + apply congrArg (fun params : Fin 8 → ZFSet.{u} => + ZFSet.sep (fun z => Realize M.sets (refinementIndexNameGraphFormula kind) (extend z params)) + (ZFSet.prod (env 0) (M.refinementNameBound (env 4) (env 5) (env 7)))) + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))) j + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleActionStep.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleActionStep.lean index f2eeeee61575d00d79a27da6b4d669da89895ad9..126bb822926dde339b75bd4241d147d19760684a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleActionStep.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleActionStep.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.EligibleBatchAgreement - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundEligibleBatchAction_order_iff - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e g x y x' y' : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hg : g ∈ G) - (first : ZFSet.pair (ZFSet.pair g x) x' ∈ M.groundEligibleBatchAction P G r μ A Labels) - (second : ZFSet.pair (ZFSet.pair g y) y' ∈ M.groundEligibleBatchAction P G r μ A Labels) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair x' y' ∈ d.batchOrder ↔ ZFSet.pair x y ∈ d.batchOrder := - (M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet).raw_order_iff - group (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batch_meetOrder.order hg first second - -theorem groundEligibleBatchAction_map_meet - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e g x y z x' y' z' : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hg : g ∈ G) - (first : ZFSet.pair (ZFSet.pair g x) x' ∈ M.groundEligibleBatchAction P G r μ A Labels) - (second : ZFSet.pair (ZFSet.pair g y) y' ∈ M.groundEligibleBatchAction P G r μ A Labels) - (third : ZFSet.pair (ZFSet.pair g z) z' ∈ M.groundEligibleBatchAction P G r μ A Labels) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair (ZFSet.pair x y) z ∈ d.batchMeetGraph → - ZFSet.pair (ZFSet.pair x' y') z' ∈ d.batchMeetGraph := - fun oldMeet => (M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet).raw_map_meet - group (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batch_meetOrder hg oldMeet first second third - -theorem groundEligibleTaskActionStep - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ B ∈ M.sets ∧ - MeetOrderCode d.batchCarrier d.batchOrder d.batchMeetGraph ∧ - PosetActionCode G d.batchCarrier m e d.batchOrder B ∧ - (∀ g h v, g ∈ G → h ∈ G → v ∈ P → ActionAgreementBelow P r A g h v → - ActionAgreementBelow d.batchCarrier d.batchOrder B g h v) ∧ - (∀ g x y, x ∈ P → - (ZFSet.pair (ZFSet.pair g x) y ∈ B ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A)) := by - have batch := M.groundEligibleTaskAttachment pairing unions powers separation hP hG hr hμ hA hLabels - group action meet - exact ⟨batch.1, batch.2.1, batch.2.2.1, - M.groundEligibleBatchAction_mem pairing unions powers separation hP hG hr hμ hA hLabels meet, - (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batch_meetOrder, - M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet, - fun _ _ _ hg hh hv agree => M.groundEligibleBatchAction_agreement - pairing unions powers separation hP hG hA group action meet hg hh hv agree, - fun _ _ _ hx => M.groundEligibleBatchAction_old_iff hx⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.EligibleBatchAgreement + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundEligibleBatchAction_order_iff + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e g x y x' y' : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hg : g ∈ G) + (first : ZFSet.pair (ZFSet.pair g x) x' ∈ M.groundEligibleBatchAction P G r μ A Labels) + (second : ZFSet.pair (ZFSet.pair g y) y' ∈ M.groundEligibleBatchAction P G r μ A Labels) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair x' y' ∈ d.batchOrder ↔ ZFSet.pair x y ∈ d.batchOrder := + (M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet).raw_order_iff + group (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batch_meetOrder.order hg first second + +theorem groundEligibleBatchAction_map_meet + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e g x y z x' y' z' : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hg : g ∈ G) + (first : ZFSet.pair (ZFSet.pair g x) x' ∈ M.groundEligibleBatchAction P G r μ A Labels) + (second : ZFSet.pair (ZFSet.pair g y) y' ∈ M.groundEligibleBatchAction P G r μ A Labels) + (third : ZFSet.pair (ZFSet.pair g z) z' ∈ M.groundEligibleBatchAction P G r μ A Labels) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair (ZFSet.pair x y) z ∈ d.batchMeetGraph → + ZFSet.pair (ZFSet.pair x' y') z' ∈ d.batchMeetGraph := + fun oldMeet => (M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet).raw_map_meet + group (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batch_meetOrder hg oldMeet first second third + +theorem groundEligibleTaskActionStep + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ B ∈ M.sets ∧ + MeetOrderCode d.batchCarrier d.batchOrder d.batchMeetGraph ∧ + PosetActionCode G d.batchCarrier m e d.batchOrder B ∧ + (∀ g h v, g ∈ G → h ∈ G → v ∈ P → ActionAgreementBelow P r A g h v → + ActionAgreementBelow d.batchCarrier d.batchOrder B g h v) ∧ + (∀ g x y, x ∈ P → + (ZFSet.pair (ZFSet.pair g x) y ∈ B ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A)) := by + have batch := M.groundEligibleTaskAttachment pairing unions powers separation hP hG hr hμ hA hLabels + group action meet + exact ⟨batch.1, batch.2.1, batch.2.2.1, + M.groundEligibleBatchAction_mem pairing unions powers separation hP hG hr hμ hA hLabels meet, + (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batch_meetOrder, + M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet, + fun _ _ _ hg hh hv agree => M.groundEligibleBatchAction_agreement + pairing unions powers separation hP hG hA group action meet hg hh hv agree, + fun _ _ _ hx => M.groundEligibleBatchAction_old_iff hx⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleBatchActionRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleBatchActionRecognition.lean index 10628c759bcb1b09ecc80121a9611627cbee6bf5..b68262fac5e72b5dfbd500338fbd2e12c9eb92e5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleBatchActionRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundEligibleBatchActionRecognition.lean @@ -1,167 +1,167 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRecursiveActionFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskRepresentativeRecognition - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -noncomputable def definable_indexedTaskAction : GroundDefinableFunction M - (fun env : Fin 5 → ZFSet.{u} => indexedTaskActionGraph (env 0) (env 1) (env 2) (env 3) (env 4)) where - formula := indexedTaskActionGraphFormula 0 1 2 3 4 5 - closed := fun _ members => M.indexedTaskActionGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) - correct := fun env members z hz => M.realize_indexedTaskActionGraphFormula pairing - 0 1 2 3 4 5 (extend z env) (Fin.cases hz members) - -noncomputable def definable_taggedAction : GroundDefinableFunction M - (fun env : Fin 5 → ZFSet.{u} => taggedActionGraph (env 0) (env 1) (env 2) (env 3) (env 4)) where - formula := taggedActionGraphFormula 0 1 2 3 4 5 - closed := fun _ members => M.taggedActionGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) - correct := fun env members z hz => M.realize_taggedActionGraphFormula pairing - 0 1 2 3 4 5 (extend z env) (Fin.cases hz members) - -noncomputable def definable_constantBatchAction : GroundDefinableFunction M - (fun env : Fin 7 → ZFSet.{u} => - let N := indexedAttachmentFresh (env 1) (constantFamilyGraph (env 1) (env 2)) - (constantFamilyGraph (env 1) (env 3)) (env 5) - taggedActionGraph (env 0) (env 2) N (env 4) - (indexedTaskActionGraph (env 0) (env 1) (env 2) N (env 6))) := by - let v : Fin 7 → GroundSetTerm M 7 := GroundSetTerm.var M - let pointFamily := GroundSetTerm.app (M.definable_constantFamily pairing unions powers separation) - (Fin.cases (v 1) (Fin.cases (v 2) Fin.elim0)) - let orderFamily := GroundSetTerm.app (M.definable_constantFamily pairing unions powers separation) - (Fin.cases (v 1) (Fin.cases (v 3) Fin.elim0)) - let fresh := GroundSetTerm.app (M.definable_indexedFresh pairing unions powers separation) - (Fin.cases (v 1) (Fin.cases pointFamily (Fin.cases orderFamily (Fin.cases (v 5) Fin.elim0)))) - let action := GroundSetTerm.app (M.definable_indexedTaskAction pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 2) (Fin.cases fresh (Fin.cases (v 6) Fin.elim0))))) - let tagged := GroundSetTerm.app (M.definable_taggedAction pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (v 2) (Fin.cases fresh (Fin.cases (v 4) (Fin.cases action Fin.elim0))))) - exact tagged.definition.congr (fun _ => rfl) - -noncomputable def constantBatchActionFormula {n} (output G I P r A Sources T : Fin n) : SetFormula n := - SetFormula.reindex - (Fin.cases output (Fin.cases G (Fin.cases I (Fin.cases P - (Fin.cases r (Fin.cases A (Fin.cases Sources (fun _ => T)))))))) - (M.definable_constantBatchAction pairing unions powers separation).formula - -theorem realize_constantBatchActionFormula {n} (output G I P r A Sources T : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.constantBatchActionFormula pairing unions powers separation output G I P r A Sources T) env ↔ - env output = - let N := indexedAttachmentFresh (env I) (constantFamilyGraph (env I) (env P)) - (constantFamilyGraph (env I) (env r)) (env Sources) - taggedActionGraph (env G) (env P) N (env A) - (indexedTaskActionGraph (env G) (env I) (env P) N (env T)) := by - unfold constantBatchActionFormula - rw [realize_reindex] - let args : Fin 7 → ZFSet.{u} := Fin.cases (env G) (Fin.cases (env I) (Fin.cases (env P) - (Fin.cases (env r) (Fin.cases (env A) (Fin.cases (env Sources) (fun _ => env T)))))) - have ground : ∀ j, args j ∈ M.sets := Fin.cases (members G) (Fin.cases (members I) - (Fin.cases (members P) (Fin.cases (members r) (Fin.cases (members A) - (Fin.cases (members Sources) (fun _ => members T)))))) - have equal : (fun j => env (Fin.cases output (Fin.cases G (Fin.cases I (Fin.cases P - (Fin.cases r (Fin.cases A (Fin.cases Sources (fun _ => T))))))) j)) = extend (env output) args := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl))))))) j - rw [equal] - exact (M.definable_constantBatchAction pairing unions powers separation).correct args ground - (env output) (members output) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -noncomputable def groundEligibleBatchActionFormula {n} (output P G r μ A Labels : Fin n) : SetFormula n := - let old (i : Fin n) := i.succ.succ.succ - ex (ex (ex - (.conj (groundEligibleTasksFormula 2 (old P) (old G) (old r) (old μ) (old A) (old Labels)) - (.conj (groundLiteralTaskFieldFormula 0 1 2 (old P) (old r) (old μ) (old Labels)) - (.conj (groundTaskTransportFormula 0 (old P) (old G) (old r) (old μ) (old A) (old Labels)) - (M.constantBatchActionFormula pairing unions powers separation - (old output) (old G) 2 (old P) (old r) (old A) 1 0)))))) - -theorem realize_groundEligibleBatchActionFormula {n} (output P G r μ A Labels : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (M.groundEligibleBatchActionFormula pairing unions powers separation - output P G r μ A Labels) env ↔ - env output = M.groundEligibleBatchAction (env P) (env G) (env r) (env μ) (env A) (env Labels) := by - simp only [groundEligibleBatchActionFormula, realize_ex, Realize] - constructor - · rintro ⟨tasks, hTasks, sources, hSources, transport, hTransport, taskCode, sourceCode, transportCode, actionCode⟩ - have bounds : ∀ j, (extend transport (extend sources (extend tasks env))) j ∈ M.sets := - Fin.cases hTransport (Fin.cases hSources (Fin.cases hTasks members)) - have eqTasks := (M.realize_groundEligibleTasksFormula pairing unions powers separation - 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ - A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 taskCode - have eqSources := (M.realize_groundLiteralTaskFieldFormula pairing unions powers separation - 0 1 2 P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 sourceCode - have eqTransport := (M.realize_groundTaskTransportFormula pairing unions powers separation - 0 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ - A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 transportCode - have outputEq := (M.realize_constantBatchActionFormula pairing unions powers separation - output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ r.succ.succ.succ - A.succ.succ.succ 1 0 _ bounds).1 actionCode - change tasks = M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) at eqTasks - change sources = literalTaskFieldGraph tasks (env P) (M.groundRelations (env P) (env P)) - (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) 0 at eqSources - change transport = M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels) at eqTransport - change env output = taggedActionGraph (env G) (env P) - (indexedAttachmentFresh tasks (constantFamilyGraph tasks (env P)) (constantFamilyGraph tasks (env r)) sources) - (env A) (indexedTaskActionGraph (env G) tasks (env P) - (indexedAttachmentFresh tasks (constantFamilyGraph tasks (env P)) (constantFamilyGraph tasks (env r)) sources) - transport) at outputEq - rw [eqSources, eqTasks, eqTransport] at outputEq - exact outputEq - · intro equal - let tasks := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) - let sources := literalTaskSourceGraph tasks (env P) (M.groundRelations (env P) (env P)) - (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) - let transport := M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels) - obtain ⟨hTasks, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - (members P) (members G) (members r) (members μ) (members A) (members Labels) meet - have hSources : sources ∈ M.sets := (fields 0).1 - have hTransport : transport ∈ M.sets := M.groundTaskTransport_mem pairing unions powers separation - (members P) (members G) (members r) (members μ) (members A) (members Labels) meet - have bounds : ∀ j, (extend transport (extend sources (extend tasks env))) j ∈ M.sets := - Fin.cases hTransport (Fin.cases hSources (Fin.cases hTasks members)) - exact ⟨tasks, hTasks, sources, hSources, transport, hTransport, - (M.realize_groundEligibleTasksFormula pairing unions powers separation - 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ - A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, - (M.realize_groundLiteralTaskFieldFormula pairing unions powers separation - 0 1 2 P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, - (M.realize_groundTaskTransportFormula pairing unions powers separation - 0 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ - A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, - (M.realize_constantBatchActionFormula pairing unions powers separation - output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ r.succ.succ.succ - A.succ.succ.succ 1 0 _ bounds).2 equal⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRecursiveActionFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskRepresentativeRecognition + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +noncomputable def definable_indexedTaskAction : GroundDefinableFunction M + (fun env : Fin 5 → ZFSet.{u} => indexedTaskActionGraph (env 0) (env 1) (env 2) (env 3) (env 4)) where + formula := indexedTaskActionGraphFormula 0 1 2 3 4 5 + closed := fun _ members => M.indexedTaskActionGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) + correct := fun env members z hz => M.realize_indexedTaskActionGraphFormula pairing + 0 1 2 3 4 5 (extend z env) (Fin.cases hz members) + +noncomputable def definable_taggedAction : GroundDefinableFunction M + (fun env : Fin 5 → ZFSet.{u} => taggedActionGraph (env 0) (env 1) (env 2) (env 3) (env 4)) where + formula := taggedActionGraphFormula 0 1 2 3 4 5 + closed := fun _ members => M.taggedActionGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) + correct := fun env members z hz => M.realize_taggedActionGraphFormula pairing + 0 1 2 3 4 5 (extend z env) (Fin.cases hz members) + +noncomputable def definable_constantBatchAction : GroundDefinableFunction M + (fun env : Fin 7 → ZFSet.{u} => + let N := indexedAttachmentFresh (env 1) (constantFamilyGraph (env 1) (env 2)) + (constantFamilyGraph (env 1) (env 3)) (env 5) + taggedActionGraph (env 0) (env 2) N (env 4) + (indexedTaskActionGraph (env 0) (env 1) (env 2) N (env 6))) := by + let v : Fin 7 → GroundSetTerm M 7 := GroundSetTerm.var M + let pointFamily := GroundSetTerm.app (M.definable_constantFamily pairing unions powers separation) + (Fin.cases (v 1) (Fin.cases (v 2) Fin.elim0)) + let orderFamily := GroundSetTerm.app (M.definable_constantFamily pairing unions powers separation) + (Fin.cases (v 1) (Fin.cases (v 3) Fin.elim0)) + let fresh := GroundSetTerm.app (M.definable_indexedFresh pairing unions powers separation) + (Fin.cases (v 1) (Fin.cases pointFamily (Fin.cases orderFamily (Fin.cases (v 5) Fin.elim0)))) + let action := GroundSetTerm.app (M.definable_indexedTaskAction pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 2) (Fin.cases fresh (Fin.cases (v 6) Fin.elim0))))) + let tagged := GroundSetTerm.app (M.definable_taggedAction pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (v 2) (Fin.cases fresh (Fin.cases (v 4) (Fin.cases action Fin.elim0))))) + exact tagged.definition.congr (fun _ => rfl) + +noncomputable def constantBatchActionFormula {n} (output G I P r A Sources T : Fin n) : SetFormula n := + SetFormula.reindex + (Fin.cases output (Fin.cases G (Fin.cases I (Fin.cases P + (Fin.cases r (Fin.cases A (Fin.cases Sources (fun _ => T)))))))) + (M.definable_constantBatchAction pairing unions powers separation).formula + +theorem realize_constantBatchActionFormula {n} (output G I P r A Sources T : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.constantBatchActionFormula pairing unions powers separation output G I P r A Sources T) env ↔ + env output = + let N := indexedAttachmentFresh (env I) (constantFamilyGraph (env I) (env P)) + (constantFamilyGraph (env I) (env r)) (env Sources) + taggedActionGraph (env G) (env P) N (env A) + (indexedTaskActionGraph (env G) (env I) (env P) N (env T)) := by + unfold constantBatchActionFormula + rw [realize_reindex] + let args : Fin 7 → ZFSet.{u} := Fin.cases (env G) (Fin.cases (env I) (Fin.cases (env P) + (Fin.cases (env r) (Fin.cases (env A) (Fin.cases (env Sources) (fun _ => env T)))))) + have ground : ∀ j, args j ∈ M.sets := Fin.cases (members G) (Fin.cases (members I) + (Fin.cases (members P) (Fin.cases (members r) (Fin.cases (members A) + (Fin.cases (members Sources) (fun _ => members T)))))) + have equal : (fun j => env (Fin.cases output (Fin.cases G (Fin.cases I (Fin.cases P + (Fin.cases r (Fin.cases A (Fin.cases Sources (fun _ => T))))))) j)) = extend (env output) args := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl))))))) j + rw [equal] + exact (M.definable_constantBatchAction pairing unions powers separation).correct args ground + (env output) (members output) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +noncomputable def groundEligibleBatchActionFormula {n} (output P G r μ A Labels : Fin n) : SetFormula n := + let old (i : Fin n) := i.succ.succ.succ + ex (ex (ex + (.conj (groundEligibleTasksFormula 2 (old P) (old G) (old r) (old μ) (old A) (old Labels)) + (.conj (groundLiteralTaskFieldFormula 0 1 2 (old P) (old r) (old μ) (old Labels)) + (.conj (groundTaskTransportFormula 0 (old P) (old G) (old r) (old μ) (old A) (old Labels)) + (M.constantBatchActionFormula pairing unions powers separation + (old output) (old G) 2 (old P) (old r) (old A) 1 0)))))) + +theorem realize_groundEligibleBatchActionFormula {n} (output P G r μ A Labels : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (M.groundEligibleBatchActionFormula pairing unions powers separation + output P G r μ A Labels) env ↔ + env output = M.groundEligibleBatchAction (env P) (env G) (env r) (env μ) (env A) (env Labels) := by + simp only [groundEligibleBatchActionFormula, realize_ex, Realize] + constructor + · rintro ⟨tasks, hTasks, sources, hSources, transport, hTransport, taskCode, sourceCode, transportCode, actionCode⟩ + have bounds : ∀ j, (extend transport (extend sources (extend tasks env))) j ∈ M.sets := + Fin.cases hTransport (Fin.cases hSources (Fin.cases hTasks members)) + have eqTasks := (M.realize_groundEligibleTasksFormula pairing unions powers separation + 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ + A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 taskCode + have eqSources := (M.realize_groundLiteralTaskFieldFormula pairing unions powers separation + 0 1 2 P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 sourceCode + have eqTransport := (M.realize_groundTaskTransportFormula pairing unions powers separation + 0 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ + A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 transportCode + have outputEq := (M.realize_constantBatchActionFormula pairing unions powers separation + output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ r.succ.succ.succ + A.succ.succ.succ 1 0 _ bounds).1 actionCode + change tasks = M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) at eqTasks + change sources = literalTaskFieldGraph tasks (env P) (M.groundRelations (env P) (env P)) + (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) 0 at eqSources + change transport = M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels) at eqTransport + change env output = taggedActionGraph (env G) (env P) + (indexedAttachmentFresh tasks (constantFamilyGraph tasks (env P)) (constantFamilyGraph tasks (env r)) sources) + (env A) (indexedTaskActionGraph (env G) tasks (env P) + (indexedAttachmentFresh tasks (constantFamilyGraph tasks (env P)) (constantFamilyGraph tasks (env r)) sources) + transport) at outputEq + rw [eqSources, eqTasks, eqTransport] at outputEq + exact outputEq + · intro equal + let tasks := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) + let sources := literalTaskSourceGraph tasks (env P) (M.groundRelations (env P) (env P)) + (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) + let transport := M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels) + obtain ⟨hTasks, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + (members P) (members G) (members r) (members μ) (members A) (members Labels) meet + have hSources : sources ∈ M.sets := (fields 0).1 + have hTransport : transport ∈ M.sets := M.groundTaskTransport_mem pairing unions powers separation + (members P) (members G) (members r) (members μ) (members A) (members Labels) meet + have bounds : ∀ j, (extend transport (extend sources (extend tasks env))) j ∈ M.sets := + Fin.cases hTransport (Fin.cases hSources (Fin.cases hTasks members)) + exact ⟨tasks, hTasks, sources, hSources, transport, hTransport, + (M.realize_groundEligibleTasksFormula pairing unions powers separation + 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ + A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, + (M.realize_groundLiteralTaskFieldFormula pairing unions powers separation + 0 1 2 P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, + (M.realize_groundTaskTransportFormula pairing unions powers separation + 0 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ + A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, + (M.realize_constantBatchActionFormula pairing unions powers separation + output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ r.succ.succ.succ + A.succ.succ.succ 1 0 _ bounds).2 equal⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalLayerWitnessRanks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalLayerWitnessRanks.lean index 14a94829eefff62c77742392b8d940cf29d3bc14..95f6a1912d3ec4aac9e763b05f1e2decda96c107 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalLayerWitnessRanks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalLayerWitnessRanks.lean @@ -1,192 +1,192 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalStarCarrierRanks -import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalBirthLayerSeparation - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -include births data group oldAction pairing unions powers separation infinite hG hP0 - -variable {HQs Hrs Hμs HTime : ZFSet.{u}} -variable (historySpaces : FunctionGraphOn HTime HQs) -variable (historyOrders : FunctionGraphOn HTime Hrs) -variable (historyMeets : FunctionGraphOn HTime Hμs) -variable (source : ZFSet.pair oldTimes (completion.algebra.union.fields 0) ∈ HQs ∧ - ZFSet.pair oldTimes (completion.algebra.union.fields 1) ∈ Hrs ∧ - ZFSet.pair oldTimes (completion.algebra.union.fields 2) ∈ Hμs) - -include historySpaces historyOrders historyMeets source - -theorem layerSeparatedCode (k : Nat) : - SeparatedLayerCode HQs Hrs Hμs B (completion.externalPointOrder P0 r0 μ0 A0) - (completion.externalPointMeet P0 r0 μ0 A0) births.birth (compressionStamp oldTimes k) - (births.layerOwners k) (births.layerIndices k) (births.layerMaps k) - (M.groundRelations U B) (births.layerComponents k) (births.layerFiber k) := by - refine ⟨births.layerIndices_function k, - (births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).1, - rfl, births.layerComponents_function data group oldAction pairing unions powers separation infinite hG hP0 k, - ?_, ?_, ?_⟩ - · intro i _ t _ e Q R V indexEntry mapEntry spaceEntry orderEntry meetEntry - obtain rfl := ((pair_mem_constantFamilyGraph _ _ _ _).1 indexEntry).2 - have qeq := historySpaces.unique spaceEntry source.1 - have req := historyOrders.unique orderEntry source.2.1 - have veq := historyMeets.unique meetEntry source.2.2 - subst Q R V - exact births.layerMaps_embedding data group oldAction pairing unions powers separation infinite hG hP0 k mapEntry - · intro i _ t _ e Q x _ indexEntry mapEntry spaceEntry componentEntry - obtain rfl := ((pair_mem_constantFamilyGraph _ _ _ _).1 indexEntry).2 - have qeq := historySpaces.unique spaceEntry source.1 - subst Q - have owned := (pair_mem_graphRestriction.1 componentEntry).1 - have hx := (pair_mem_graphRestriction.1 componentEntry).2 - obtain ⟨_, _, _, _, covered⟩ := births.layerMaps_copy data group oldAction pairing unions powers separation infinite hG hP0 k hx owned mapEntry - exact covered - · intro x hx y hy i _ j _ first second different - exact Or.inl (births.layerComponents_earlier_meet data group oldAction pairing unions powers separation infinite hG hP0 k hx hy first second different) - -theorem cutoffLayerSeparatedCode (k n : Nat) (before : k ≤ n) : - SeparatedLayerCode HQs Hrs Hμs (births.cutoff n) (births.cutoffOrder n) - (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) - (births.layerOwners k) (births.layerIndices k) (births.layerMaps k) - (M.groundRelations U B) (births.layerComponents k) (births.layerFiber k) := by - have full := births.layerSeparatedCode data group oldAction pairing unions powers separation infinite hG hP0 - historySpaces historyOrders historyMeets source k - refine ⟨full.indices, full.maps, births.layerFiber_cutoff k n before, full.components, ?_, ?_, ?_⟩ - · intro i _ t _ e Q R V indexEntry mapEntry spaceEntry orderEntry meetEntry - obtain rfl := ((pair_mem_constantFamilyGraph _ _ _ _).1 indexEntry).2 - have qeq := historySpaces.unique spaceEntry source.1 - have req := historyOrders.unique orderEntry source.2.1 - have veq := historyMeets.unique meetEntry source.2.2 - subst Q R V - exact births.layerMaps_cutoff_embedding data group oldAction pairing unions powers separation infinite hG hP0 k n before mapEntry - · intro i hi t ht e Q x hx indexEntry mapEntry spaceEntry componentEntry - obtain ⟨_, u, hu, copied⟩ := (mem_relationImage _ _ _ _).1 - (full.cover i hi t ht e Q x (births.cutoff_subset n hx) indexEntry mapEntry spaceEntry componentEntry) - exact (mem_relationImage _ _ _ _).2 ⟨hx, u, hu, copied⟩ - · intro x hx y hy i _ j _ first second different - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - obtain ⟨z, a, meetEntry, born, earlier⟩ := births.layerComponents_earlier_meet data group oldAction pairing unions powers separation infinite hG hP0 k hx hy first second different - have hxCut := ((mem_layerBirthFiber _ _ _ _).1 (births.layerFiber_cutoff k n before ▸ hx)).1 - have hyCut := ((mem_layerBirthFiber _ _ _ _).1 (births.layerFiber_cutoff k n before ▸ hy)).1 - have hz := (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2 - have hzCut := births.cutoff_lower data group oldAction pairing unions powers separation infinite hG hP0 n z hz x hxCut - (geometry.meet.lower_left x y z meetEntry) - exact Or.inl ⟨z, a, pair_mem_graphRestriction.2 ⟨meetEntry, ZFSet.pair_mem_prod.2 ⟨hxCut, hyCut⟩⟩, - pair_mem_graphRestriction.2 ⟨born, hzCut⟩, earlier⟩ - -theorem layerWitness_spec (k : Nat) {N : ZFSet.{u}} : - births.layerWitness k ∈ M.sets ∧ - GrowthLayerWitnessCode HQs Hrs Hμs B (completion.externalPointOrder P0 r0 μ0 A0) - (completion.externalPointMeet P0 r0 μ0 A0) births.birth (compressionStamp oldTimes k) N - (births.layerWitness k) := - ⟨births.layerWitness_ground data group oldAction pairing unions powers separation infinite hG hP0 k, - Or.inr (Or.inr ⟨_, _, _, _, _, _, rfl, - births.layerSeparatedCode data group oldAction pairing unions powers separation infinite hG hP0 - historySpaces historyOrders historyMeets source k⟩)⟩ - -theorem cutoffLayerWitness_spec (k n : Nat) (before : k ≤ n) {N : ZFSet.{u}} : - births.layerWitness k ∈ M.sets ∧ - GrowthLayerWitnessCode HQs Hrs Hμs (births.cutoff n) (births.cutoffOrder n) - (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) N - (births.layerWitness k) := - ⟨births.layerWitness_ground data group oldAction pairing unions powers separation infinite hG hP0 k, - Or.inr (Or.inr ⟨_, _, _, _, _, _, rfl, - births.cutoffLayerSeparatedCode data group oldAction pairing unions powers separation infinite hG hP0 - historySpaces historyOrders historyMeets source k n before⟩)⟩ - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -variable (omega : ZFSet.rank ZFSet.omega < o) (indices : ZFSet.rank I < o) -variable (points : ZFSet.rank P0 < o) (actors : ZFSet.rank G < o) -variable (completed : ZFSet.rank (completion.algebra.union.fields 0) < o) -variable (time : ZFSet.rank oldTimes < o) -include data group action pairing unions powers separation infinite hG hP0 - limit omega indices points actors completed time - -theorem layerWitness_rank_lt (k : Nat) : ZFSet.rank (births.layerWitness k) < o := by - have carrier := completion.externalPointCarrier_rank_lt_of_inputs limit r0 μ0 A0 - omega indices points actors completed - have vertices := M.externalStarVertices_rank_lt_of_inputs limit r0 μ0 A0 m one - omega indices points actors - have fiber := (ZFSet.rank_mono (fun x hx => (births.mem_layerFiber k x).1 hx |>.1)).trans_lt carrier - have owners := (ZFSet.rank_mono (fun v hv => (births.layerOwners_cases (k := k) hv).1)).trans_lt vertices - have bound := M.groundRelations_rank_lt limit completed carrier - exact separatedLayerWitness_rank_lt limit owners - (rank_constantFamilyGraph_lt limit owners time) - (rank_functionGraph_lt limit - (births.layerMaps_spec data group action pairing unions powers separation infinite hG hP0 k).1 - owners bound) bound - (rank_functionGraph_lt limit - (births.layerComponents_function data group action pairing unions powers separation infinite hG hP0 k) - fiber owners) fiber - -variable {HQs Hrs Hμs HTime : ZFSet.{u}} -variable (historySpaces : FunctionGraphOn HTime HQs) -variable (historyOrders : FunctionGraphOn HTime Hrs) -variable (historyMeets : FunctionGraphOn HTime Hμs) -variable (source : ZFSet.pair oldTimes (completion.algebra.union.fields 0) ∈ HQs ∧ - ZFSet.pair oldTimes (completion.algebra.union.fields 1) ∈ Hrs ∧ - ZFSet.pair oldTimes (completion.algebra.union.fields 2) ∈ Hμs) -include historySpaces historyOrders historyMeets source - -theorem ranked_layerWitness_spec (k : Nat) {N : ZFSet.{u}} : - births.layerWitness k ∈ M.sets ∧ ZFSet.rank (births.layerWitness k) < o ∧ - GrowthLayerWitnessCode HQs Hrs Hμs (completion.externalPointCarrier P0 r0 μ0 A0) - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) - births.birth (compressionStamp oldTimes k) N (births.layerWitness k) := by - have code := births.layerWitness_spec data group action pairing unions powers separation infinite hG hP0 - historySpaces historyOrders historyMeets source k (N := N) - exact ⟨code.1, births.layerWitness_rank_lt data group action pairing unions powers separation infinite - hG hP0 limit omega indices points actors completed time k, code.2⟩ - -theorem ranked_cutoffLayerWitness_spec (k n : Nat) (before : k ≤ n) {N : ZFSet.{u}} : - births.layerWitness k ∈ M.sets ∧ ZFSet.rank (births.layerWitness k) < o ∧ - GrowthLayerWitnessCode HQs Hrs Hμs (births.cutoff n) (births.cutoffOrder n) - (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) N - (births.layerWitness k) := by - have code := births.cutoffLayerWitness_spec data group action pairing unions powers separation infinite hG hP0 - historySpaces historyOrders historyMeets source k n before (N := N) - exact ⟨code.1, births.layerWitness_rank_lt data group action pairing unions powers separation infinite - hG hP0 limit omega indices points actors completed time k, code.2⟩ - -end PartitionPilot.Forcing.GroundExternalBirthData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalStarCarrierRanks +import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalBirthLayerSeparation + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +include births data group oldAction pairing unions powers separation infinite hG hP0 + +variable {HQs Hrs Hμs HTime : ZFSet.{u}} +variable (historySpaces : FunctionGraphOn HTime HQs) +variable (historyOrders : FunctionGraphOn HTime Hrs) +variable (historyMeets : FunctionGraphOn HTime Hμs) +variable (source : ZFSet.pair oldTimes (completion.algebra.union.fields 0) ∈ HQs ∧ + ZFSet.pair oldTimes (completion.algebra.union.fields 1) ∈ Hrs ∧ + ZFSet.pair oldTimes (completion.algebra.union.fields 2) ∈ Hμs) + +include historySpaces historyOrders historyMeets source + +theorem layerSeparatedCode (k : Nat) : + SeparatedLayerCode HQs Hrs Hμs B (completion.externalPointOrder P0 r0 μ0 A0) + (completion.externalPointMeet P0 r0 μ0 A0) births.birth (compressionStamp oldTimes k) + (births.layerOwners k) (births.layerIndices k) (births.layerMaps k) + (M.groundRelations U B) (births.layerComponents k) (births.layerFiber k) := by + refine ⟨births.layerIndices_function k, + (births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).1, + rfl, births.layerComponents_function data group oldAction pairing unions powers separation infinite hG hP0 k, + ?_, ?_, ?_⟩ + · intro i _ t _ e Q R V indexEntry mapEntry spaceEntry orderEntry meetEntry + obtain rfl := ((pair_mem_constantFamilyGraph _ _ _ _).1 indexEntry).2 + have qeq := historySpaces.unique spaceEntry source.1 + have req := historyOrders.unique orderEntry source.2.1 + have veq := historyMeets.unique meetEntry source.2.2 + subst Q R V + exact births.layerMaps_embedding data group oldAction pairing unions powers separation infinite hG hP0 k mapEntry + · intro i _ t _ e Q x _ indexEntry mapEntry spaceEntry componentEntry + obtain rfl := ((pair_mem_constantFamilyGraph _ _ _ _).1 indexEntry).2 + have qeq := historySpaces.unique spaceEntry source.1 + subst Q + have owned := (pair_mem_graphRestriction.1 componentEntry).1 + have hx := (pair_mem_graphRestriction.1 componentEntry).2 + obtain ⟨_, _, _, _, covered⟩ := births.layerMaps_copy data group oldAction pairing unions powers separation infinite hG hP0 k hx owned mapEntry + exact covered + · intro x hx y hy i _ j _ first second different + exact Or.inl (births.layerComponents_earlier_meet data group oldAction pairing unions powers separation infinite hG hP0 k hx hy first second different) + +theorem cutoffLayerSeparatedCode (k n : Nat) (before : k ≤ n) : + SeparatedLayerCode HQs Hrs Hμs (births.cutoff n) (births.cutoffOrder n) + (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) + (births.layerOwners k) (births.layerIndices k) (births.layerMaps k) + (M.groundRelations U B) (births.layerComponents k) (births.layerFiber k) := by + have full := births.layerSeparatedCode data group oldAction pairing unions powers separation infinite hG hP0 + historySpaces historyOrders historyMeets source k + refine ⟨full.indices, full.maps, births.layerFiber_cutoff k n before, full.components, ?_, ?_, ?_⟩ + · intro i _ t _ e Q R V indexEntry mapEntry spaceEntry orderEntry meetEntry + obtain rfl := ((pair_mem_constantFamilyGraph _ _ _ _).1 indexEntry).2 + have qeq := historySpaces.unique spaceEntry source.1 + have req := historyOrders.unique orderEntry source.2.1 + have veq := historyMeets.unique meetEntry source.2.2 + subst Q R V + exact births.layerMaps_cutoff_embedding data group oldAction pairing unions powers separation infinite hG hP0 k n before mapEntry + · intro i hi t ht e Q x hx indexEntry mapEntry spaceEntry componentEntry + obtain ⟨_, u, hu, copied⟩ := (mem_relationImage _ _ _ _).1 + (full.cover i hi t ht e Q x (births.cutoff_subset n hx) indexEntry mapEntry spaceEntry componentEntry) + exact (mem_relationImage _ _ _ _).2 ⟨hx, u, hu, copied⟩ + · intro x hx y hy i _ j _ first second different + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + obtain ⟨z, a, meetEntry, born, earlier⟩ := births.layerComponents_earlier_meet data group oldAction pairing unions powers separation infinite hG hP0 k hx hy first second different + have hxCut := ((mem_layerBirthFiber _ _ _ _).1 (births.layerFiber_cutoff k n before ▸ hx)).1 + have hyCut := ((mem_layerBirthFiber _ _ _ _).1 (births.layerFiber_cutoff k n before ▸ hy)).1 + have hz := (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2 + have hzCut := births.cutoff_lower data group oldAction pairing unions powers separation infinite hG hP0 n z hz x hxCut + (geometry.meet.lower_left x y z meetEntry) + exact Or.inl ⟨z, a, pair_mem_graphRestriction.2 ⟨meetEntry, ZFSet.pair_mem_prod.2 ⟨hxCut, hyCut⟩⟩, + pair_mem_graphRestriction.2 ⟨born, hzCut⟩, earlier⟩ + +theorem layerWitness_spec (k : Nat) {N : ZFSet.{u}} : + births.layerWitness k ∈ M.sets ∧ + GrowthLayerWitnessCode HQs Hrs Hμs B (completion.externalPointOrder P0 r0 μ0 A0) + (completion.externalPointMeet P0 r0 μ0 A0) births.birth (compressionStamp oldTimes k) N + (births.layerWitness k) := + ⟨births.layerWitness_ground data group oldAction pairing unions powers separation infinite hG hP0 k, + Or.inr (Or.inr ⟨_, _, _, _, _, _, rfl, + births.layerSeparatedCode data group oldAction pairing unions powers separation infinite hG hP0 + historySpaces historyOrders historyMeets source k⟩)⟩ + +theorem cutoffLayerWitness_spec (k n : Nat) (before : k ≤ n) {N : ZFSet.{u}} : + births.layerWitness k ∈ M.sets ∧ + GrowthLayerWitnessCode HQs Hrs Hμs (births.cutoff n) (births.cutoffOrder n) + (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) N + (births.layerWitness k) := + ⟨births.layerWitness_ground data group oldAction pairing unions powers separation infinite hG hP0 k, + Or.inr (Or.inr ⟨_, _, _, _, _, _, rfl, + births.cutoffLayerSeparatedCode data group oldAction pairing unions powers separation infinite hG hP0 + historySpaces historyOrders historyMeets source k n before⟩)⟩ + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +variable (omega : ZFSet.rank ZFSet.omega < o) (indices : ZFSet.rank I < o) +variable (points : ZFSet.rank P0 < o) (actors : ZFSet.rank G < o) +variable (completed : ZFSet.rank (completion.algebra.union.fields 0) < o) +variable (time : ZFSet.rank oldTimes < o) +include data group action pairing unions powers separation infinite hG hP0 + limit omega indices points actors completed time + +theorem layerWitness_rank_lt (k : Nat) : ZFSet.rank (births.layerWitness k) < o := by + have carrier := completion.externalPointCarrier_rank_lt_of_inputs limit r0 μ0 A0 + omega indices points actors completed + have vertices := M.externalStarVertices_rank_lt_of_inputs limit r0 μ0 A0 m one + omega indices points actors + have fiber := (ZFSet.rank_mono (fun x hx => (births.mem_layerFiber k x).1 hx |>.1)).trans_lt carrier + have owners := (ZFSet.rank_mono (fun v hv => (births.layerOwners_cases (k := k) hv).1)).trans_lt vertices + have bound := M.groundRelations_rank_lt limit completed carrier + exact separatedLayerWitness_rank_lt limit owners + (rank_constantFamilyGraph_lt limit owners time) + (rank_functionGraph_lt limit + (births.layerMaps_spec data group action pairing unions powers separation infinite hG hP0 k).1 + owners bound) bound + (rank_functionGraph_lt limit + (births.layerComponents_function data group action pairing unions powers separation infinite hG hP0 k) + fiber owners) fiber + +variable {HQs Hrs Hμs HTime : ZFSet.{u}} +variable (historySpaces : FunctionGraphOn HTime HQs) +variable (historyOrders : FunctionGraphOn HTime Hrs) +variable (historyMeets : FunctionGraphOn HTime Hμs) +variable (source : ZFSet.pair oldTimes (completion.algebra.union.fields 0) ∈ HQs ∧ + ZFSet.pair oldTimes (completion.algebra.union.fields 1) ∈ Hrs ∧ + ZFSet.pair oldTimes (completion.algebra.union.fields 2) ∈ Hμs) +include historySpaces historyOrders historyMeets source + +theorem ranked_layerWitness_spec (k : Nat) {N : ZFSet.{u}} : + births.layerWitness k ∈ M.sets ∧ ZFSet.rank (births.layerWitness k) < o ∧ + GrowthLayerWitnessCode HQs Hrs Hμs (completion.externalPointCarrier P0 r0 μ0 A0) + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) + births.birth (compressionStamp oldTimes k) N (births.layerWitness k) := by + have code := births.layerWitness_spec data group action pairing unions powers separation infinite hG hP0 + historySpaces historyOrders historyMeets source k (N := N) + exact ⟨code.1, births.layerWitness_rank_lt data group action pairing unions powers separation infinite + hG hP0 limit omega indices points actors completed time k, code.2⟩ + +theorem ranked_cutoffLayerWitness_spec (k n : Nat) (before : k ≤ n) {N : ZFSet.{u}} : + births.layerWitness k ∈ M.sets ∧ ZFSet.rank (births.layerWitness k) < o ∧ + GrowthLayerWitnessCode HQs Hrs Hμs (births.cutoff n) (births.cutoffOrder n) + (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) N + (births.layerWitness k) := by + have code := births.cutoffLayerWitness_spec data group action pairing unions powers separation infinite hG hP0 + historySpaces historyOrders historyMeets source k n before (N := N) + exact ⟨code.1, births.layerWitness_rank_lt data group action pairing unions powers separation infinite + hG hP0 limit omega indices points actors completed time k, code.2⟩ + +end PartitionPilot.Forcing.GroundExternalBirthData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalOldAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalOldAction.lean index b828b713bf1d20cf09a85f3dad619a1e4ac0b20d..3121cf4f1916e10d46bcd3c9ea48cb7843eb04f0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalOldAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalOldAction.lean @@ -1,161 +1,161 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "U" => completion.algebra.union.fields 0 -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "qPoint" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) - -theorem externalCopyGraph_eq_graph : - letI := group.toGroup - let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet - ∀ w, completion.externalCopyGraph P0 r0 μ0 A0 ((sGroup).encode w) = - (SetMembers.presentation U).graph (qPoint) ((family).copy a w).toFun := by - let := group.toGroup - dsimp only - intro w - have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG - have graph := flatCopyEmbeddingGraph_eq_graph (family) - (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) - (sGroup) (SetMembers.presentation U) (qPoint) classed w - rw [data.externalPointPresentation_carrier] at graph - exact graph - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalCopy_ideal {w : ZFSet.{u}} (hw : w ∈ M.externalGroupCarrier G letters m one) : - IdealEmbeddingCode U (completion.externalPointCarrier P0 r0 μ0 A0) - (completion.algebra.union.fields 1) (completion.externalPointOrder P0 r0 μ0 A0) - (completion.algebra.union.fields 2) (completion.externalPointMeet P0 r0 μ0 A0) - (completion.externalCopyGraph P0 r0 μ0 A0 w) := by - let := group.toGroup - let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet - let s := sGroup - let q := qPoint - have sCarrier := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 (sCarrier.symm ▸ hw) - have entries := data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG - have code := (SetMembers.presentation U).idealEmbeddingCode q ((family).copy a w) - (fun _ _ => Iff.rfl) entries.1 - (fun x y z => (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff x y z).symm) entries.2.1 - rw [← data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG w] at code - dsimp only [q] at code - rw [data.externalPointPresentation_carrier] at code - exact code - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalIdentityCopy_ideal : - IdealEmbeddingCode U (completion.externalPointCarrier P0 r0 μ0 A0) - (completion.algebra.union.fields 1) (completion.externalPointOrder P0 r0 μ0 A0) - (completion.algebra.union.fields 2) (completion.externalPointMeet P0 r0 μ0 A0) - (completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one)) := - data.externalCopy_ideal group oldAction pairing unions powers separation infinite hG - data.group.group_code.identity_mem - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "U" => completion.algebra.union.fields 0 -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "qPoint" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "copyGraph" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalIdentityCopy_equivariant {g g' x y x' y' : ZFSet.{u}} - (actor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) - (first : ZFSet.pair x x' ∈ copyGraph) (second : ZFSet.pair y y' ∈ copyGraph) - (acted : ZFSet.pair (ZFSet.pair g x) y ∈ completion.algebra.union.fields 12) : - ZFSet.pair (ZFSet.pair g' x') y' ∈ completion.externalPointAction P0 r0 μ0 A0 := by - let := group.toGroup - let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet - rw [completion.externalFamilyGroupPresentation_old group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground] at actor - obtain ⟨g, equal⟩ := ((SetMembers.presentation G).mem_graph (sGroup) _ _).1 actor - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - rw [identity, data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG 1] at first second - obtain ⟨x, equal⟩ := ((SetMembers.presentation U).mem_graph (qPoint) _ _).1 first - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨y, equal⟩ := ((SetMembers.presentation U).mem_graph (qPoint) _ _).1 second - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have actionEq := (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet g x y).2 acted - have entries := data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG - apply (entries.2.2.1 _ _ _).2 - change (((family).externalAction a).iso (old (SetMembers G) (family).Letters g)).toFun - (((family).copy a 1).toFun x) = ((family).copy a 1).toFun y - rw [(family).extends_old_action, actionEq] - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalIdentityCopy_agreement (hP : P0 ∈ M.sets) - {g h g' h' v v' : ZFSet.{u}} - (firstActor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) - (secondActor : ZFSet.pair h h' ∈ M.externalOldInclusion G letters m one) - (image : ZFSet.pair v v' ∈ copyGraph) - (agree : ActionAgreementBelow U (completion.algebra.union.fields 1) - (completion.algebra.union.fields 12) g h v) : - ActionAgreementBelow (completion.externalPointCarrier P0 r0 μ0 A0) - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointAction P0 r0 μ0 A0) g' h' v' := by - have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - have firstShape := ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 firstActor) - have secondShape := ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 secondActor) - exact ideal.actionAgreementBelow completion.algebra.union.action geometry.action - firstShape.1 firstShape.2 secondShape.2 image agree - (fun _ _ _ _ _ _ first second acted => data.externalIdentityCopy_equivariant group oldAction - pairing unions powers separation infinite hG firstActor first second acted) - (fun _ _ _ _ _ _ first second acted => data.externalIdentityCopy_equivariant group oldAction - pairing unions powers separation infinite hG secondActor first second acted) - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalOriginal_agreement (hP : P0 ∈ M.sets) - {g h g' h' v v' : ZFSet.{u}} - (firstActor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) - (secondActor : ZFSet.pair h h' ∈ M.externalOldInclusion G letters m one) - (hv : v ∈ P0) (image : ZFSet.pair v v' ∈ copyGraph) - (agree : ActionAgreementBelow P0 r0 A0 g h v) : - ActionAgreementBelow (completion.externalPointCarrier P0 r0 μ0 A0) - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointAction P0 r0 μ0 A0) g' h' v' := by - have hg := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 firstActor)).1 - have hh := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 secondActor)).1 - exact data.externalIdentityCopy_agreement group oldAction pairing unions powers separation infinite hG hP - firstActor secondActor image (data.original.agreement g hg h hh v hv agree) - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "U" => completion.algebra.union.fields 0 +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "qPoint" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) + +theorem externalCopyGraph_eq_graph : + letI := group.toGroup + let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet + ∀ w, completion.externalCopyGraph P0 r0 μ0 A0 ((sGroup).encode w) = + (SetMembers.presentation U).graph (qPoint) ((family).copy a w).toFun := by + let := group.toGroup + dsimp only + intro w + have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG + have graph := flatCopyEmbeddingGraph_eq_graph (family) + (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) + (sGroup) (SetMembers.presentation U) (qPoint) classed w + rw [data.externalPointPresentation_carrier] at graph + exact graph + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalCopy_ideal {w : ZFSet.{u}} (hw : w ∈ M.externalGroupCarrier G letters m one) : + IdealEmbeddingCode U (completion.externalPointCarrier P0 r0 μ0 A0) + (completion.algebra.union.fields 1) (completion.externalPointOrder P0 r0 μ0 A0) + (completion.algebra.union.fields 2) (completion.externalPointMeet P0 r0 μ0 A0) + (completion.externalCopyGraph P0 r0 μ0 A0 w) := by + let := group.toGroup + let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet + let s := sGroup + let q := qPoint + have sCarrier := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 (sCarrier.symm ▸ hw) + have entries := data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG + have code := (SetMembers.presentation U).idealEmbeddingCode q ((family).copy a w) + (fun _ _ => Iff.rfl) entries.1 + (fun x y z => (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff x y z).symm) entries.2.1 + rw [← data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG w] at code + dsimp only [q] at code + rw [data.externalPointPresentation_carrier] at code + exact code + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalIdentityCopy_ideal : + IdealEmbeddingCode U (completion.externalPointCarrier P0 r0 μ0 A0) + (completion.algebra.union.fields 1) (completion.externalPointOrder P0 r0 μ0 A0) + (completion.algebra.union.fields 2) (completion.externalPointMeet P0 r0 μ0 A0) + (completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one)) := + data.externalCopy_ideal group oldAction pairing unions powers separation infinite hG + data.group.group_code.identity_mem + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "U" => completion.algebra.union.fields 0 +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "qPoint" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "copyGraph" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalIdentityCopy_equivariant {g g' x y x' y' : ZFSet.{u}} + (actor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) + (first : ZFSet.pair x x' ∈ copyGraph) (second : ZFSet.pair y y' ∈ copyGraph) + (acted : ZFSet.pair (ZFSet.pair g x) y ∈ completion.algebra.union.fields 12) : + ZFSet.pair (ZFSet.pair g' x') y' ∈ completion.externalPointAction P0 r0 μ0 A0 := by + let := group.toGroup + let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet + rw [completion.externalFamilyGroupPresentation_old group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground] at actor + obtain ⟨g, equal⟩ := ((SetMembers.presentation G).mem_graph (sGroup) _ _).1 actor + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + rw [identity, data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG 1] at first second + obtain ⟨x, equal⟩ := ((SetMembers.presentation U).mem_graph (qPoint) _ _).1 first + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨y, equal⟩ := ((SetMembers.presentation U).mem_graph (qPoint) _ _).1 second + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have actionEq := (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet g x y).2 acted + have entries := data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG + apply (entries.2.2.1 _ _ _).2 + change (((family).externalAction a).iso (old (SetMembers G) (family).Letters g)).toFun + (((family).copy a 1).toFun x) = ((family).copy a 1).toFun y + rw [(family).extends_old_action, actionEq] + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalIdentityCopy_agreement (hP : P0 ∈ M.sets) + {g h g' h' v v' : ZFSet.{u}} + (firstActor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) + (secondActor : ZFSet.pair h h' ∈ M.externalOldInclusion G letters m one) + (image : ZFSet.pair v v' ∈ copyGraph) + (agree : ActionAgreementBelow U (completion.algebra.union.fields 1) + (completion.algebra.union.fields 12) g h v) : + ActionAgreementBelow (completion.externalPointCarrier P0 r0 μ0 A0) + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointAction P0 r0 μ0 A0) g' h' v' := by + have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + have firstShape := ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 firstActor) + have secondShape := ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 secondActor) + exact ideal.actionAgreementBelow completion.algebra.union.action geometry.action + firstShape.1 firstShape.2 secondShape.2 image agree + (fun _ _ _ _ _ _ first second acted => data.externalIdentityCopy_equivariant group oldAction + pairing unions powers separation infinite hG firstActor first second acted) + (fun _ _ _ _ _ _ first second acted => data.externalIdentityCopy_equivariant group oldAction + pairing unions powers separation infinite hG secondActor first second acted) + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalOriginal_agreement (hP : P0 ∈ M.sets) + {g h g' h' v v' : ZFSet.{u}} + (firstActor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) + (secondActor : ZFSet.pair h h' ∈ M.externalOldInclusion G letters m one) + (hv : v ∈ P0) (image : ZFSet.pair v v' ∈ copyGraph) + (agree : ActionAgreementBelow P0 r0 A0 g h v) : + ActionAgreementBelow (completion.externalPointCarrier P0 r0 μ0 A0) + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointAction P0 r0 μ0 A0) g' h' v' := by + have hg := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 firstActor)).1 + have hh := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 secondActor)).1 + exact data.externalIdentityCopy_agreement group oldAction pairing unions powers separation infinite hG hP + firstActor secondActor image (data.original.agreement g hg h hh v hv agree) + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalStarSupports.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalStarSupports.lean index 4605957ae0c81779f9c0a037600dc2b973ea57c7..b005b29a2ff7eebf4a6fbce1cdf31723110e4c06 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalStarSupports.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundExternalStarSupports.lean @@ -1,81 +1,81 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (P r μ A : ZFSet.{u}) -local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) -local notation "requests" => externalRequestCarrier I P (externalRectangles P G r μ A) -local notation "Q" => completion.externalPointCarrier P r μ A -local notation "vertices" => M.externalStarVertices G letters requests m one - -noncomputable def externalStarSupports : ZFSet.{u} := - externalStarSupportGraph vertices Q (M.externalGroupCarrier G letters m one) - (completion.algebra.union.fields 0) (M.externalCosetCarrier G letters m one) requests - (M.externalCosetClassifier G letters m one) (completion.externalPointClassifier P r μ A) - (completion.localTilePoints P r μ A) (completion.externalPointAction P r μ A) - (natSetCode 0) (natSetCode 1) - -noncomputable def externalStarSupport (v : ZFSet.{u}) : ZFSet.{u} := - relationFiber Q (completion.externalStarSupports P r μ A) v - -noncomputable def externalStarSupportFamily : ZFSet.{u} := - M.relationFiberFamily vertices Q (completion.externalStarSupports P r μ A) - -theorem externalStarSupport_subset (v : ZFSet.{u}) : completion.externalStarSupport P r μ A v ⊆ Q := - fun _ hz => ((mem_relationFiber _ _ _ _).1 hz).1 - -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "vertices" => M.externalStarVertices G letters requests m one -include data group oldAction pairing unions powers separation infinite hG hP0 - -theorem externalStarSupports_ground : completion.externalStarSupports P0 r0 μ0 A0 ∈ M.sets := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have cosets := data.externalCosets_ground pairing unions powers separation hG - exact M.externalStarSupportGraph_mem pairing unions powers separation - (data.externalStarCarriers_ground pairing unions powers separation hG).1 geometry.carrier_ground - data.group.carrier_mem (completion.algebra.union.ground 0) cosets.2.1 data.words.requests_ground - cosets.2.2 geometry.classifier_ground - (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).2.2.2.2 - geometry.action_ground (M.natSetCode_mem separation infinite 0) (M.natSetCode_mem separation infinite 1) - -theorem externalStarSupportFamily_spec : - completion.externalStarSupportFamily P0 r0 μ0 A0 ∈ M.sets ∧ - ZFSet.IsFunc vertices (M.groundPower Q) (completion.externalStarSupportFamily P0 r0 μ0 A0) ∧ - ∀ v f, ZFSet.pair v f ∈ completion.externalStarSupportFamily P0 r0 μ0 A0 ↔ - v ∈ vertices ∧ f = completion.externalStarSupport P0 r0 μ0 A0 v := by - have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 - have hs := data.externalStarSupports_ground group oldAction pairing unions powers separation infinite hG hP0 - exact ⟨M.relationFiberFamily_mem pairing unions powers separation hv hq hs, - M.relationFiberFamily_function separation hv hq hs, - M.relationFiberFamily_entries separation hv hq hs⟩ - -end GroundExternalGeometryInputs -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (P r μ A : ZFSet.{u}) +local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) +local notation "requests" => externalRequestCarrier I P (externalRectangles P G r μ A) +local notation "Q" => completion.externalPointCarrier P r μ A +local notation "vertices" => M.externalStarVertices G letters requests m one + +noncomputable def externalStarSupports : ZFSet.{u} := + externalStarSupportGraph vertices Q (M.externalGroupCarrier G letters m one) + (completion.algebra.union.fields 0) (M.externalCosetCarrier G letters m one) requests + (M.externalCosetClassifier G letters m one) (completion.externalPointClassifier P r μ A) + (completion.localTilePoints P r μ A) (completion.externalPointAction P r μ A) + (natSetCode 0) (natSetCode 1) + +noncomputable def externalStarSupport (v : ZFSet.{u}) : ZFSet.{u} := + relationFiber Q (completion.externalStarSupports P r μ A) v + +noncomputable def externalStarSupportFamily : ZFSet.{u} := + M.relationFiberFamily vertices Q (completion.externalStarSupports P r μ A) + +theorem externalStarSupport_subset (v : ZFSet.{u}) : completion.externalStarSupport P r μ A v ⊆ Q := + fun _ hz => ((mem_relationFiber _ _ _ _).1 hz).1 + +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "vertices" => M.externalStarVertices G letters requests m one +include data group oldAction pairing unions powers separation infinite hG hP0 + +theorem externalStarSupports_ground : completion.externalStarSupports P0 r0 μ0 A0 ∈ M.sets := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have cosets := data.externalCosets_ground pairing unions powers separation hG + exact M.externalStarSupportGraph_mem pairing unions powers separation + (data.externalStarCarriers_ground pairing unions powers separation hG).1 geometry.carrier_ground + data.group.carrier_mem (completion.algebra.union.ground 0) cosets.2.1 data.words.requests_ground + cosets.2.2 geometry.classifier_ground + (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).2.2.2.2 + geometry.action_ground (M.natSetCode_mem separation infinite 0) (M.natSetCode_mem separation infinite 1) + +theorem externalStarSupportFamily_spec : + completion.externalStarSupportFamily P0 r0 μ0 A0 ∈ M.sets ∧ + ZFSet.IsFunc vertices (M.groundPower Q) (completion.externalStarSupportFamily P0 r0 μ0 A0) ∧ + ∀ v f, ZFSet.pair v f ∈ completion.externalStarSupportFamily P0 r0 μ0 A0 ↔ + v ∈ vertices ∧ f = completion.externalStarSupport P0 r0 μ0 A0 v := by + have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 + have hs := data.externalStarSupports_ground group oldAction pairing unions powers separation infinite hG hP0 + exact ⟨M.relationFiberFamily_mem pairing unions powers separation hv hq hs, + M.relationFiberFamily_function separation hv hq hs, + M.relationFiberFamily_entries separation hv hq hs⟩ + +end GroundExternalGeometryInputs +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFairPreparationConditionSequences.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFairPreparationConditionSequences.lean index 2d5e12a521ee68479359a9d028bf49923b81d035..73ace7130f6a5a0b423462a611741977997ff2b5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFairPreparationConditionSequences.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFairPreparationConditionSequences.lean @@ -1,159 +1,159 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFairPreparationMonotonicity - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def fairPreparationConditionGraph - (Q stages U E0 orbit : ZFSet.{u}) : ZFSet.{u} := - let tail := ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U)) - let middle := ZFSet.prod Q tail - let bound := ZFSet.prod ZFSet.omega middle - relationCompose ZFSet.omega middle Q - (relationCompose ZFSet.omega bound middle orbit (productSecond ZFSet.omega middle)) - (productFirst Q tail) - -theorem fairPreparationConditionGraph_function - {Q stages U E0 enumSelector orbit : ZFSet.{u}} - (function : ZFSet.IsFunc ZFSet.omega - (M.fairPreparationStates Q stages U E0 enumSelector) orbit) : - ZFSet.IsFunc ZFSet.omega Q (M.fairPreparationConditionGraph Q stages U E0 orbit) := by - let tail := ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U)) - let middle := ZFSet.prod Q tail - have widened : ZFSet.IsFunc ZFSet.omega (ZFSet.prod ZFSet.omega middle) orbit := by - refine ⟨?_, function.2⟩ - intro z member - obtain ⟨i, hi, state, hs, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - exact ZFSet.pair_mem_prod.2 ⟨hi, ((M.mem_fairPreparationStates _ _ _ _ _ _).1 hs).1⟩ - exact relationCompose_function_of_subset - (relationCompose_function_of_subset widened - (productSecond_function ZFSet.omega middle) (fun _ h => h)) - (productFirst_function Q tail) (fun _ h => h) - -theorem pair_mem_fairPreparationConditionGraph - {Q stages U E0 enumSelector orbit : ZFSet.{u}} - (function : ZFSet.IsFunc ZFSet.omega - (M.fairPreparationStates Q stages U E0 enumSelector) orbit) - (i p : ZFSet.{u}) : - ZFSet.pair i p ∈ M.fairPreparationConditionGraph Q stages U E0 orbit ↔ - ∃ clock births event, - ZFSet.pair i (ZFSet.pair clock (ZFSet.pair p (ZFSet.pair births event))) ∈ orbit := by - dsimp only [fairPreparationConditionGraph] - rw [pair_mem_relationCompose] - constructor - · rintro ⟨_, _, middle, _, first, second⟩ - obtain ⟨_, _, state, _, edge, projected⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first - obtain ⟨p', hp', tail, ht, eq⟩ := (mem_productFirst _ _ _).1 second - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - obtain ⟨clock, hc, rest, hr, eq⟩ := (mem_productSecond _ _ _).1 projected - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - obtain ⟨births, hb, event, he, rfl⟩ := ZFSet.mem_prod.1 ht - exact ⟨clock, births, event, edge⟩ - · rintro ⟨clock, births, event, edge⟩ - have bounds := ZFSet.pair_mem_prod.1 (function.1 edge) - have stateBound := ((M.mem_fairPreparationStates _ _ _ _ _ _).1 bounds.2).1 - have split := ZFSet.pair_mem_prod.1 stateBound - have rest := ZFSet.pair_mem_prod.1 split.2 - refine ⟨bounds.1, rest.1, _, split.2, ?_, ?_⟩ - · exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨bounds.1, split.2, _, stateBound, edge, - (mem_productSecond _ _ _).2 ⟨clock, split.1, _, split.2, rfl⟩⟩ - · exact (mem_productFirst _ _ _).2 ⟨p, rest.1, _, rest.2, rfl⟩ - -theorem fairPreparationConditionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Q stages U E0 orbit : ZFSet.{u}} - (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) - (hE0 : E0 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (whole : orbit ∈ M.sets) : - M.fairPreparationConditionGraph Q stages U E0 orbit ∈ M.sets := by - have hTail := M.prod_mem pairing unions powers separation - (M.groundRelations_mem pairing unions powers separation omega hE0) - (M.insert_mem pairing unions (M.empty_mem ⟨Q, hQ⟩) - (M.prod_mem pairing unions powers separation hStages hU)) - have hMiddle := M.prod_mem pairing unions powers separation hQ hTail - exact M.relationCompose_mem pairing unions powers separation omega hMiddle hQ - (M.relationCompose_mem pairing unions powers separation omega - (M.prod_mem pairing unions powers separation omega hMiddle) hMiddle whole - (M.productSecond_mem pairing unions powers separation omega hMiddle)) - (M.productFirst_mem pairing unions powers separation hQ hTail) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem fairPreparationOrbit_conditionSequence - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {stages U E0 enumSelector prepSelector grid packed nodes T orbit : ZFSet.{u}} - (hQ : s.carrier ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) - (hE0 : E0 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (whole : orbit ∈ M.sets) - (function : ZFSet.IsFunc ZFSet.omega - (M.fairPreparationStates s.carrier stages U E0 enumSelector) orbit) - (selected : prepSelector ⊆ - M.varyingPreparationRelation stages packed s.carrier s.conditionOrder nodes T) - (p : P) (e : ZFSet.{u}) - (initial : ∀ state, ZFSet.pair ∅ state ∈ orbit ↔ - state = ZFSet.pair ∅ (ZFSet.pair (s.encode p) (ZFSet.pair {ZFSet.pair ∅ e} ∅))) - (steps : ∀ n ∈ ZFSet.omega, ∀ state next, - ZFSet.pair n state ∈ orbit → ZFSet.pair (insert n n) next ∈ orbit → - FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector grid state next) : - ∃ seq : Nat → P, seq 0 = p ∧ - natPresentation.graph s (fun n => seq n.down) ∈ M.sets ∧ Antitone seq ∧ - ∃ clocks births events : Nat → ZFSet.{u}, - clocks 0 = ∅ ∧ births 0 = {ZFSet.pair ∅ e} ∧ events 0 = ∅ ∧ - (∀ k, ZFSet.pair (natSetCode k) - (ZFSet.pair (clocks k) (ZFSet.pair (s.encode (seq k)) - (ZFSet.pair (births k) (events k)))) ∈ orbit) ∧ - ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector grid - (ZFSet.pair (clocks k) (ZFSet.pair (s.encode (seq k)) (ZFSet.pair (births k) (events k)))) - (ZFSet.pair (clocks (k + 1)) - (ZFSet.pair (s.encode (seq (k + 1))) (ZFSet.pair (births (k + 1)) (events (k + 1))))) := by - let graph := M.fairPreparationConditionGraph s.carrier stages U E0 orbit - have graphGround : graph ∈ M.sets := - M.fairPreparationConditionGraph_mem pairing unions powers separation hQ hStages hU hE0 omega whole - have graphFunction : ZFSet.IsFunc ZFSet.omega s.carrier graph := - M.fairPreparationConditionGraph_function function - let seq : Nat → P := fun n => natPresentation.decodeFunction s graph graphFunction ⟨n⟩ - have represented (k : Nat) : ∃ clock births event, - ZFSet.pair (natSetCode k) - (ZFSet.pair clock (ZFSet.pair (s.encode (seq k)) (ZFSet.pair births event))) ∈ orbit := - (M.pair_mem_fairPreparationConditionGraph function _ _).1 - (natPresentation.decodeFunction_mem s graph graphFunction ⟨k⟩) - choose clocks births events entries using represented - have atZero := (initial _).1 (entries 0) - have zeroClock := (ZFSet.pair_inj.1 atZero).1 - have zeroCondition := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 atZero).2).1 - have zeroTail := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 atZero).2).2 - have rawSteps (k : Nat) := steps (natSetCode k) (natSetCode_mem_omega k) - _ _ (entries k) (entries (k + 1)) - have decreasing : Antitone seq := by - apply antitone_nat_of_succ_le - intro k - apply (s.pair_mem_conditionOrder _ _).1 - exact M.fairPreparationStep_strengthens ZFSet.omega E0 stages U enumSelector prepSelector - grid packed s.carrier s.conditionOrder nodes T selected - (clocks k) (s.encode (seq k)) (births k) (events k) - (clocks (k + 1)) (s.encode (seq (k + 1))) (births (k + 1)) (events (k + 1)) - ((s.pair_mem_conditionOrder _ _).2 le_rfl) (rawSteps k) - exact ⟨seq, s.injective zeroCondition, - M.decoded_function_graph_mem natPresentation s graphGround graphFunction, decreasing, - clocks, births, events, zeroClock, zeroTail.1, zeroTail.2, entries, rawSteps⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFairPreparationMonotonicity + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def fairPreparationConditionGraph + (Q stages U E0 orbit : ZFSet.{u}) : ZFSet.{u} := + let tail := ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U)) + let middle := ZFSet.prod Q tail + let bound := ZFSet.prod ZFSet.omega middle + relationCompose ZFSet.omega middle Q + (relationCompose ZFSet.omega bound middle orbit (productSecond ZFSet.omega middle)) + (productFirst Q tail) + +theorem fairPreparationConditionGraph_function + {Q stages U E0 enumSelector orbit : ZFSet.{u}} + (function : ZFSet.IsFunc ZFSet.omega + (M.fairPreparationStates Q stages U E0 enumSelector) orbit) : + ZFSet.IsFunc ZFSet.omega Q (M.fairPreparationConditionGraph Q stages U E0 orbit) := by + let tail := ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U)) + let middle := ZFSet.prod Q tail + have widened : ZFSet.IsFunc ZFSet.omega (ZFSet.prod ZFSet.omega middle) orbit := by + refine ⟨?_, function.2⟩ + intro z member + obtain ⟨i, hi, state, hs, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + exact ZFSet.pair_mem_prod.2 ⟨hi, ((M.mem_fairPreparationStates _ _ _ _ _ _).1 hs).1⟩ + exact relationCompose_function_of_subset + (relationCompose_function_of_subset widened + (productSecond_function ZFSet.omega middle) (fun _ h => h)) + (productFirst_function Q tail) (fun _ h => h) + +theorem pair_mem_fairPreparationConditionGraph + {Q stages U E0 enumSelector orbit : ZFSet.{u}} + (function : ZFSet.IsFunc ZFSet.omega + (M.fairPreparationStates Q stages U E0 enumSelector) orbit) + (i p : ZFSet.{u}) : + ZFSet.pair i p ∈ M.fairPreparationConditionGraph Q stages U E0 orbit ↔ + ∃ clock births event, + ZFSet.pair i (ZFSet.pair clock (ZFSet.pair p (ZFSet.pair births event))) ∈ orbit := by + dsimp only [fairPreparationConditionGraph] + rw [pair_mem_relationCompose] + constructor + · rintro ⟨_, _, middle, _, first, second⟩ + obtain ⟨_, _, state, _, edge, projected⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first + obtain ⟨p', hp', tail, ht, eq⟩ := (mem_productFirst _ _ _).1 second + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + obtain ⟨clock, hc, rest, hr, eq⟩ := (mem_productSecond _ _ _).1 projected + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + obtain ⟨births, hb, event, he, rfl⟩ := ZFSet.mem_prod.1 ht + exact ⟨clock, births, event, edge⟩ + · rintro ⟨clock, births, event, edge⟩ + have bounds := ZFSet.pair_mem_prod.1 (function.1 edge) + have stateBound := ((M.mem_fairPreparationStates _ _ _ _ _ _).1 bounds.2).1 + have split := ZFSet.pair_mem_prod.1 stateBound + have rest := ZFSet.pair_mem_prod.1 split.2 + refine ⟨bounds.1, rest.1, _, split.2, ?_, ?_⟩ + · exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨bounds.1, split.2, _, stateBound, edge, + (mem_productSecond _ _ _).2 ⟨clock, split.1, _, split.2, rfl⟩⟩ + · exact (mem_productFirst _ _ _).2 ⟨p, rest.1, _, rest.2, rfl⟩ + +theorem fairPreparationConditionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Q stages U E0 orbit : ZFSet.{u}} + (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) + (hE0 : E0 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (whole : orbit ∈ M.sets) : + M.fairPreparationConditionGraph Q stages U E0 orbit ∈ M.sets := by + have hTail := M.prod_mem pairing unions powers separation + (M.groundRelations_mem pairing unions powers separation omega hE0) + (M.insert_mem pairing unions (M.empty_mem ⟨Q, hQ⟩) + (M.prod_mem pairing unions powers separation hStages hU)) + have hMiddle := M.prod_mem pairing unions powers separation hQ hTail + exact M.relationCompose_mem pairing unions powers separation omega hMiddle hQ + (M.relationCompose_mem pairing unions powers separation omega + (M.prod_mem pairing unions powers separation omega hMiddle) hMiddle whole + (M.productSecond_mem pairing unions powers separation omega hMiddle)) + (M.productFirst_mem pairing unions powers separation hQ hTail) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem fairPreparationOrbit_conditionSequence + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {stages U E0 enumSelector prepSelector grid packed nodes T orbit : ZFSet.{u}} + (hQ : s.carrier ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) + (hE0 : E0 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (whole : orbit ∈ M.sets) + (function : ZFSet.IsFunc ZFSet.omega + (M.fairPreparationStates s.carrier stages U E0 enumSelector) orbit) + (selected : prepSelector ⊆ + M.varyingPreparationRelation stages packed s.carrier s.conditionOrder nodes T) + (p : P) (e : ZFSet.{u}) + (initial : ∀ state, ZFSet.pair ∅ state ∈ orbit ↔ + state = ZFSet.pair ∅ (ZFSet.pair (s.encode p) (ZFSet.pair {ZFSet.pair ∅ e} ∅))) + (steps : ∀ n ∈ ZFSet.omega, ∀ state next, + ZFSet.pair n state ∈ orbit → ZFSet.pair (insert n n) next ∈ orbit → + FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector grid state next) : + ∃ seq : Nat → P, seq 0 = p ∧ + natPresentation.graph s (fun n => seq n.down) ∈ M.sets ∧ Antitone seq ∧ + ∃ clocks births events : Nat → ZFSet.{u}, + clocks 0 = ∅ ∧ births 0 = {ZFSet.pair ∅ e} ∧ events 0 = ∅ ∧ + (∀ k, ZFSet.pair (natSetCode k) + (ZFSet.pair (clocks k) (ZFSet.pair (s.encode (seq k)) + (ZFSet.pair (births k) (events k)))) ∈ orbit) ∧ + ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector grid + (ZFSet.pair (clocks k) (ZFSet.pair (s.encode (seq k)) (ZFSet.pair (births k) (events k)))) + (ZFSet.pair (clocks (k + 1)) + (ZFSet.pair (s.encode (seq (k + 1))) (ZFSet.pair (births (k + 1)) (events (k + 1))))) := by + let graph := M.fairPreparationConditionGraph s.carrier stages U E0 orbit + have graphGround : graph ∈ M.sets := + M.fairPreparationConditionGraph_mem pairing unions powers separation hQ hStages hU hE0 omega whole + have graphFunction : ZFSet.IsFunc ZFSet.omega s.carrier graph := + M.fairPreparationConditionGraph_function function + let seq : Nat → P := fun n => natPresentation.decodeFunction s graph graphFunction ⟨n⟩ + have represented (k : Nat) : ∃ clock births event, + ZFSet.pair (natSetCode k) + (ZFSet.pair clock (ZFSet.pair (s.encode (seq k)) (ZFSet.pair births event))) ∈ orbit := + (M.pair_mem_fairPreparationConditionGraph function _ _).1 + (natPresentation.decodeFunction_mem s graph graphFunction ⟨k⟩) + choose clocks births events entries using represented + have atZero := (initial _).1 (entries 0) + have zeroClock := (ZFSet.pair_inj.1 atZero).1 + have zeroCondition := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 atZero).2).1 + have zeroTail := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 atZero).2).2 + have rawSteps (k : Nat) := steps (natSetCode k) (natSetCode_mem_omega k) + _ _ (entries k) (entries (k + 1)) + have decreasing : Antitone seq := by + apply antitone_nat_of_succ_le + intro k + apply (s.pair_mem_conditionOrder _ _).1 + exact M.fairPreparationStep_strengthens ZFSet.omega E0 stages U enumSelector prepSelector + grid packed s.carrier s.conditionOrder nodes T selected + (clocks k) (s.encode (seq k)) (births k) (events k) + (clocks (k + 1)) (s.encode (seq (k + 1))) (births (k + 1)) (events (k + 1)) + ((s.pair_mem_conditionOrder _ _).2 le_rfl) (rawSteps k) + exact ⟨seq, s.injective zeroCondition, + M.decoded_function_graph_mem natPresentation s graphGround graphFunction, decreasing, + clocks, births, events, zeroClock, zeroTail.1, zeroTail.2, entries, rawSteps⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterCopies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterCopies.lean index 3ae57208fc2319516342cc4058eb2afc0908bd39..baa045e72bdeae9d8f1c488bbb2f3da2d67c66bb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterCopies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterCopies.lean @@ -1,81 +1,81 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -structure MeetEmbeddingCode (A L rA rL μA μL e : ZFSet.{u}) : Prop where - injection : InjectionCode A L e - monotone : ∀ x y x' y', ZFSet.pair x y ∈ rA → - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ rL - map_meet : ∀ x y z x' y' z', ZFSet.pair (ZFSet.pair x y) z ∈ μA → - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair z z' ∈ e → - ZFSet.pair (ZFSet.pair x' y') z' ∈ μL - -theorem meetFilter_copyPullback {A L rA rL μA μL e F : ZFSet.{u}} - (source : MeetOrderCode A rA μA) (target : MeetFilterCode L rL μL F) - (embedding : MeetEmbeddingCode A L rA rL μA μL e) - (nonempty : (copyPullback A L e F).Nonempty) : - MeetFilterCode A rA μA (copyPullback A L e F) where - subset := fun x hx => ((mem_copyPullback A L e F x).1 hx).1 - nonempty := nonempty - upward := by - intro x hx y hy lower - obtain ⟨_, x', hxF, _, xx'⟩ := (mem_copyPullback A L e F x).1 hx - obtain ⟨y', yy', _⟩ := embedding.injection.function.2 y hy - have hyL := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 yy')).2 - have hyF := target.upward x' hxF y' hyL (embedding.monotone x y x' y' lower xx' yy') - exact (mem_copyPullback A L e F y).2 ⟨hy, y', hyF, hyL, yy'⟩ - closed_meet := by - intro x hx y hy z meetXY - obtain ⟨_, x', hxF, _, xx'⟩ := (mem_copyPullback A L e F x).1 hx - obtain ⟨_, y', hyF, _, yy'⟩ := (mem_copyPullback A L e F y).1 hy - have hzA := (ZFSet.pair_mem_prod.1 (source.operation.1 meetXY)).2 - obtain ⟨z', zz', _⟩ := embedding.injection.function.2 z hzA - have hzL := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 zz')).2 - have hzF := target.closed_meet x' hxF y' hyF z' - (embedding.map_meet x y z x' y' z' meetXY xx' yy' zz') - exact (mem_copyPullback A L e F z).2 ⟨hzA, z', hzF, hzL, zz'⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem internalCountableBelow_copy_of_all_filters - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A L rA rL μA μL e F : ZFSet.{u}} - (hA : A ∈ M.sets) (hL : L ∈ M.sets) (he : e ∈ M.sets) (hF : F ∈ M.sets) - (source : MeetOrderCode A rA μA) (target : MeetFilterCode L rL μL F) - (embedding : MeetEmbeddingCode A L rA rL μA μL e) - (earlier : ∀ P ∈ M.sets, MeetFilterCode A rA μA P → M.InternalCountableBelow rA P P) : - M.InternalCountableBelow rL F (F ∩ relationImage A L e) := by - classical - by_cases nonempty : (copyPullback A L e F).Nonempty - · have pullbackMember := M.copyPullback_mem pairing unions powers separation hA hL he hF - have pullbackFilter := meetFilter_copyPullback source target embedding nonempty - exact M.internalCountableBelow_copy_pullback pairing unions powers separation infinite hL he - embedding.injection embedding.monotone - (earlier (copyPullback A L e F) pullbackMember pullbackFilter) - · refine ⟨∅, M.empty_mem ⟨F, hF⟩, M.empty_groundEmbeddable ZFSet.omega ⟨F, hF⟩, - ZFSet.empty_subset F, ?_⟩ - intro x hx - obtain ⟨hxF, image⟩ := ZFSet.mem_inter.1 hx - obtain ⟨hxL, y, hyA, yx⟩ := (mem_relationImage A L e x).1 image - exact False.elim (nonempty ⟨y, - (mem_copyPullback A L e F y).2 ⟨hyA, x, hxF, hxL, yx⟩⟩) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +structure MeetEmbeddingCode (A L rA rL μA μL e : ZFSet.{u}) : Prop where + injection : InjectionCode A L e + monotone : ∀ x y x' y', ZFSet.pair x y ∈ rA → + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ rL + map_meet : ∀ x y z x' y' z', ZFSet.pair (ZFSet.pair x y) z ∈ μA → + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair z z' ∈ e → + ZFSet.pair (ZFSet.pair x' y') z' ∈ μL + +theorem meetFilter_copyPullback {A L rA rL μA μL e F : ZFSet.{u}} + (source : MeetOrderCode A rA μA) (target : MeetFilterCode L rL μL F) + (embedding : MeetEmbeddingCode A L rA rL μA μL e) + (nonempty : (copyPullback A L e F).Nonempty) : + MeetFilterCode A rA μA (copyPullback A L e F) where + subset := fun x hx => ((mem_copyPullback A L e F x).1 hx).1 + nonempty := nonempty + upward := by + intro x hx y hy lower + obtain ⟨_, x', hxF, _, xx'⟩ := (mem_copyPullback A L e F x).1 hx + obtain ⟨y', yy', _⟩ := embedding.injection.function.2 y hy + have hyL := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 yy')).2 + have hyF := target.upward x' hxF y' hyL (embedding.monotone x y x' y' lower xx' yy') + exact (mem_copyPullback A L e F y).2 ⟨hy, y', hyF, hyL, yy'⟩ + closed_meet := by + intro x hx y hy z meetXY + obtain ⟨_, x', hxF, _, xx'⟩ := (mem_copyPullback A L e F x).1 hx + obtain ⟨_, y', hyF, _, yy'⟩ := (mem_copyPullback A L e F y).1 hy + have hzA := (ZFSet.pair_mem_prod.1 (source.operation.1 meetXY)).2 + obtain ⟨z', zz', _⟩ := embedding.injection.function.2 z hzA + have hzL := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 zz')).2 + have hzF := target.closed_meet x' hxF y' hyF z' + (embedding.map_meet x y z x' y' z' meetXY xx' yy' zz') + exact (mem_copyPullback A L e F z).2 ⟨hzA, z', hzF, hzL, zz'⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem internalCountableBelow_copy_of_all_filters + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A L rA rL μA μL e F : ZFSet.{u}} + (hA : A ∈ M.sets) (hL : L ∈ M.sets) (he : e ∈ M.sets) (hF : F ∈ M.sets) + (source : MeetOrderCode A rA μA) (target : MeetFilterCode L rL μL F) + (embedding : MeetEmbeddingCode A L rA rL μA μL e) + (earlier : ∀ P ∈ M.sets, MeetFilterCode A rA μA P → M.InternalCountableBelow rA P P) : + M.InternalCountableBelow rL F (F ∩ relationImage A L e) := by + classical + by_cases nonempty : (copyPullback A L e F).Nonempty + · have pullbackMember := M.copyPullback_mem pairing unions powers separation hA hL he hF + have pullbackFilter := meetFilter_copyPullback source target embedding nonempty + exact M.internalCountableBelow_copy_pullback pairing unions powers separation infinite hL he + embedding.injection embedding.monotone + (earlier (copyPullback A L e F) pullbackMember pullbackFilter) + · refine ⟨∅, M.empty_mem ⟨F, hF⟩, M.empty_groundEmbeddable ZFSet.omega ⟨F, hF⟩, + ZFSet.empty_subset F, ?_⟩ + intro x hx + obtain ⟨hxF, image⟩ := ZFSet.mem_inter.1 hx + obtain ⟨hxL, y, hyA, yx⟩ := (mem_relationImage A L e x).1 image + exact False.elim (nonempty ⟨y, + (mem_copyPullback A L e F y).2 ⟨hyA, x, hxF, hxL, yx⟩⟩) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterPullbackRecovery.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterPullbackRecovery.lean index 8acb955405b668ed36fb939a9b119bc5cf57d38d..fa0d14f2a11267e476f692c4511c9dac62017c31 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterPullbackRecovery.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFilterPullbackRecovery.lean @@ -1,34 +1,34 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PairPushFilterFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem pushFilter_copyPullback_eq_of_coinitial {A L rL μL e F : ZFSet.{u}} - (function : ZFSet.IsFunc A L e) (filter : MeetFilterCode L rL μL F) - (coinitial : ∀ x ∈ F, ∃ b ∈ F, ∃ a ∈ A, - ZFSet.pair a b ∈ e ∧ ZFSet.pair b x ∈ rL) : - pushFilterCode L rL e (copyPullback A L e F) = F := by - apply ZFSet.ext - intro x - rw [mem_pushFilterCode] - constructor - · rintro ⟨hx, a, ha, b, _, image, lower⟩ - obtain ⟨haA, c, hc, _, original⟩ := (mem_copyPullback A L e F a).1 ha - obtain ⟨_, _, unique⟩ := function.2 a haA - have equal : b = c := (unique b image).trans (unique c original).symm - exact filter.upward b (equal.symm ▸ hc) x hx lower - · intro hx - obtain ⟨b, hb, a, ha, image, lower⟩ := coinitial x hx - exact ⟨filter.subset hx, a, - (mem_copyPullback A L e F a).2 ⟨ha, b, hb, filter.subset hb, image⟩, - b, filter.subset hb, image, lower⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PairPushFilterFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem pushFilter_copyPullback_eq_of_coinitial {A L rL μL e F : ZFSet.{u}} + (function : ZFSet.IsFunc A L e) (filter : MeetFilterCode L rL μL F) + (coinitial : ∀ x ∈ F, ∃ b ∈ F, ∃ a ∈ A, + ZFSet.pair a b ∈ e ∧ ZFSet.pair b x ∈ rL) : + pushFilterCode L rL e (copyPullback A L e F) = F := by + apply ZFSet.ext + intro x + rw [mem_pushFilterCode] + constructor + · rintro ⟨hx, a, ha, b, _, image, lower⟩ + obtain ⟨haA, c, hc, _, original⟩ := (mem_copyPullback A L e F a).1 ha + obtain ⟨_, _, unique⟩ := function.2 a haA + have equal : b = c := (unique b image).trans (unique c original).symm + exact filter.upward b (equal.symm ▸ hc) x hx lower + · intro hx + obtain ⟨b, hb, a, ha, image, lower⟩ := coinitial x hx + exact ⟨filter.subset hx, a, + (mem_copyPullback A L e F a).2 ⟨ha, b, hb, filter.subset hb, image⟩, + b, filter.subset hb, image, lower⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedIndexAssignmentSlices.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedIndexAssignmentSlices.lean index 090662cebe603993178e621b7b2301cfd8d054f2..05e8dbaadf64d5628ed7913f8c4337ee7e07a03a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedIndexAssignmentSlices.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedIndexAssignmentSlices.lean @@ -1,125 +1,125 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RepresentativeIndexSteps - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -noncomputable def fixedIndexAssignmentPairs (idx T A : ZFSet.{u}) : ZFSet.{u} := - relationImage (assignmentOnIndices {idx} T A) (ZFSet.prod T T) - (productSecond {idx} (ZFSet.prod T T)) - -theorem mem_fixedIndexAssignmentPairs (idx T A v w : ZFSet.{u}) : - ZFSet.pair v w ∈ fixedIndexAssignmentPairs idx T A ↔ - v ∈ T ∧ w ∈ T ∧ stageOneAssignment idx v w ∈ A := by - rw [fixedIndexAssignmentPairs, mem_relationImage] - constructor - · rintro ⟨bound, x, hx, edge⟩ - obtain ⟨i, hi, pair, _, equal⟩ := (mem_productSecond _ _ _).1 edge - have ei : i = idx := ZFSet.mem_singleton.1 hi - obtain ⟨ex, ep⟩ := ZFSet.pair_inj.1 equal - subst i - subst pair - exact ⟨(ZFSet.pair_mem_prod.1 bound).1, (ZFSet.pair_mem_prod.1 bound).2, - ex ▸ (mem_assignmentOnIndices _ _ _ _).1 hx |>.1⟩ - · rintro ⟨hv, hw, old⟩ - have bounds := ZFSet.pair_mem_prod.2 ⟨hv, hw⟩ - exact ⟨bounds, stageOneAssignment idx v w, - (assignmentOnIndices_entry _ _ _ _ _ _).2 ⟨old, ZFSet.mem_singleton.2 rfl, hv, hw⟩, - (mem_productSecond _ _ _).2 ⟨idx, ZFSet.mem_singleton.2 rfl, _, bounds, rfl⟩⟩ - -noncomputable def fixedIndexAssignmentClassGraph (idx T A B graph : ZFSet.{u}) : ZFSet.{u} := - relationCompose (fixedIndexAssignmentPairs idx T A) (stageOneAssignments {idx} T) B - (relationConverse (stageOneAssignments {idx} T) (ZFSet.prod T T) - (productSecond {idx} (ZFSet.prod T T))) graph - -theorem fixedIndexAssignmentClassGraph_entry (idx T A B graph v w y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair v w) y ∈ fixedIndexAssignmentClassGraph idx T A B graph ↔ - v ∈ T ∧ w ∈ T ∧ stageOneAssignment idx v w ∈ A ∧ y ∈ B ∧ - ZFSet.pair (stageOneAssignment idx v w) y ∈ graph := by - rw [fixedIndexAssignmentClassGraph, pair_mem_relationCompose, mem_fixedIndexAssignmentPairs] - constructor - · rintro ⟨⟨hv, hw, old⟩, hy, x, _, inverse, edge⟩ - have projection := ((pair_mem_relationConverse _ _ _ x (ZFSet.pair v w)).1 inverse).2.2 - obtain ⟨i, hi, pair, _, equal⟩ := (mem_productSecond _ _ _).1 projection - have ei : i = idx := ZFSet.mem_singleton.1 hi - obtain ⟨ex, ep⟩ := ZFSet.pair_inj.1 equal - subst i - subst pair - subst x - exact ⟨hv, hw, old, hy, edge⟩ - · rintro ⟨hv, hw, old, hy, edge⟩ - have bound := ZFSet.pair_mem_prod.2 ⟨hv, hw⟩ - have triple := (stageOneAssignment_mem_assignments {idx} T idx v w).2 - ⟨ZFSet.mem_singleton.2 rfl, hv, hw⟩ - exact ⟨⟨hv, hw, old⟩, hy, _, triple, - (pair_mem_relationConverse _ _ _ _ _).2 ⟨triple, bound, - (mem_productSecond _ _ _).2 ⟨idx, ZFSet.mem_singleton.2 rfl, _, bound, rfl⟩⟩, edge⟩ - -theorem fixedIndexAssignmentClassGraph_function {idx T A B graph D : ZFSet.{u}} - (function : ZFSet.IsFunc D B graph) - (covered : ∀ v ∈ T, ∀ w ∈ T, stageOneAssignment idx v w ∈ A → - stageOneAssignment idx v w ∈ D) : - ZFSet.IsFunc (fixedIndexAssignmentPairs idx T A) B - (fixedIndexAssignmentClassGraph idx T A B graph) := by - refine ⟨?_, ?_⟩ - · intro z hz - unfold fixedIndexAssignmentClassGraph relationCompose at hz - exact (ZFSet.mem_sep.1 hz).1 - · intro pair member - have pairBound := (mem_relationImage _ _ _ pair).1 member |>.1 - obtain ⟨v, hv, w, hw, rfl⟩ := ZFSet.mem_prod.1 pairBound - have old := (mem_fixedIndexAssignmentPairs idx T A v w).1 member |>.2.2 - obtain ⟨y, edge, unique⟩ := function.2 _ (covered v hv w hw old) - have hy := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 - exact ⟨y, (fixedIndexAssignmentClassGraph_entry _ _ _ _ _ _ _ _).2 ⟨hv, hw, old, hy, edge⟩, - fun z hz => unique z ((fixedIndexAssignmentClassGraph_entry _ _ _ _ _ _ _ _).1 hz).2.2.2.2⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem fixedIndexAssignmentPairs_mem_small - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {idx T A N : ZFSet.{u}} (hIdx : idx ∈ M.sets) (hT : T ∈ M.sets) - (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : - fixedIndexAssignmentPairs idx T A ∈ M.sets ∧ - M.groundEmbeddable (fixedIndexAssignmentPairs idx T A) N := by - have singleton : ({idx} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hIdx hIdx - have slice := M.assignmentOnIndices_mem pairing unions powers separation singleton hT hA - have sliceSmall := M.assignmentOnIndices_small pairing unions powers separation singleton hT hA hN small - have bound := M.prod_mem pairing unions powers separation hT hT - have graph := M.productSecond_mem pairing unions powers separation singleton bound - exact ⟨M.relationImage_mem separation slice bound graph, - M.groundEmbeddable_function_image pairing unions powers separation choice slice bound hN - graph (productSecond_function {idx} (ZFSet.prod T T)) sliceSmall⟩ - -theorem fixedIndexAssignmentClassGraph_mem - {idx T A B graph : ZFSet.{u}} (hIdx : idx ∈ M.sets) (hT : T ∈ M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hGraph : graph ∈ M.sets) : - fixedIndexAssignmentClassGraph idx T A B graph ∈ M.sets := by - have singleton : ({idx} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hIdx hIdx - have pairs := M.prod_mem pairing unions powers separation hT hT - have slice := M.assignmentOnIndices_mem pairing unions powers separation singleton hT hA - have projection := M.productSecond_mem pairing unions powers separation singleton pairs - have domain := M.relationImage_mem separation slice pairs projection - have triples := M.stageOneAssignments_mem pairing unions powers separation singleton hT - exact M.relationCompose_mem pairing unions powers separation domain triples hB - (M.relationConverse_mem pairing unions powers separation triples pairs projection) hGraph - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RepresentativeIndexSteps + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +noncomputable def fixedIndexAssignmentPairs (idx T A : ZFSet.{u}) : ZFSet.{u} := + relationImage (assignmentOnIndices {idx} T A) (ZFSet.prod T T) + (productSecond {idx} (ZFSet.prod T T)) + +theorem mem_fixedIndexAssignmentPairs (idx T A v w : ZFSet.{u}) : + ZFSet.pair v w ∈ fixedIndexAssignmentPairs idx T A ↔ + v ∈ T ∧ w ∈ T ∧ stageOneAssignment idx v w ∈ A := by + rw [fixedIndexAssignmentPairs, mem_relationImage] + constructor + · rintro ⟨bound, x, hx, edge⟩ + obtain ⟨i, hi, pair, _, equal⟩ := (mem_productSecond _ _ _).1 edge + have ei : i = idx := ZFSet.mem_singleton.1 hi + obtain ⟨ex, ep⟩ := ZFSet.pair_inj.1 equal + subst i + subst pair + exact ⟨(ZFSet.pair_mem_prod.1 bound).1, (ZFSet.pair_mem_prod.1 bound).2, + ex ▸ (mem_assignmentOnIndices _ _ _ _).1 hx |>.1⟩ + · rintro ⟨hv, hw, old⟩ + have bounds := ZFSet.pair_mem_prod.2 ⟨hv, hw⟩ + exact ⟨bounds, stageOneAssignment idx v w, + (assignmentOnIndices_entry _ _ _ _ _ _).2 ⟨old, ZFSet.mem_singleton.2 rfl, hv, hw⟩, + (mem_productSecond _ _ _).2 ⟨idx, ZFSet.mem_singleton.2 rfl, _, bounds, rfl⟩⟩ + +noncomputable def fixedIndexAssignmentClassGraph (idx T A B graph : ZFSet.{u}) : ZFSet.{u} := + relationCompose (fixedIndexAssignmentPairs idx T A) (stageOneAssignments {idx} T) B + (relationConverse (stageOneAssignments {idx} T) (ZFSet.prod T T) + (productSecond {idx} (ZFSet.prod T T))) graph + +theorem fixedIndexAssignmentClassGraph_entry (idx T A B graph v w y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair v w) y ∈ fixedIndexAssignmentClassGraph idx T A B graph ↔ + v ∈ T ∧ w ∈ T ∧ stageOneAssignment idx v w ∈ A ∧ y ∈ B ∧ + ZFSet.pair (stageOneAssignment idx v w) y ∈ graph := by + rw [fixedIndexAssignmentClassGraph, pair_mem_relationCompose, mem_fixedIndexAssignmentPairs] + constructor + · rintro ⟨⟨hv, hw, old⟩, hy, x, _, inverse, edge⟩ + have projection := ((pair_mem_relationConverse _ _ _ x (ZFSet.pair v w)).1 inverse).2.2 + obtain ⟨i, hi, pair, _, equal⟩ := (mem_productSecond _ _ _).1 projection + have ei : i = idx := ZFSet.mem_singleton.1 hi + obtain ⟨ex, ep⟩ := ZFSet.pair_inj.1 equal + subst i + subst pair + subst x + exact ⟨hv, hw, old, hy, edge⟩ + · rintro ⟨hv, hw, old, hy, edge⟩ + have bound := ZFSet.pair_mem_prod.2 ⟨hv, hw⟩ + have triple := (stageOneAssignment_mem_assignments {idx} T idx v w).2 + ⟨ZFSet.mem_singleton.2 rfl, hv, hw⟩ + exact ⟨⟨hv, hw, old⟩, hy, _, triple, + (pair_mem_relationConverse _ _ _ _ _).2 ⟨triple, bound, + (mem_productSecond _ _ _).2 ⟨idx, ZFSet.mem_singleton.2 rfl, _, bound, rfl⟩⟩, edge⟩ + +theorem fixedIndexAssignmentClassGraph_function {idx T A B graph D : ZFSet.{u}} + (function : ZFSet.IsFunc D B graph) + (covered : ∀ v ∈ T, ∀ w ∈ T, stageOneAssignment idx v w ∈ A → + stageOneAssignment idx v w ∈ D) : + ZFSet.IsFunc (fixedIndexAssignmentPairs idx T A) B + (fixedIndexAssignmentClassGraph idx T A B graph) := by + refine ⟨?_, ?_⟩ + · intro z hz + unfold fixedIndexAssignmentClassGraph relationCompose at hz + exact (ZFSet.mem_sep.1 hz).1 + · intro pair member + have pairBound := (mem_relationImage _ _ _ pair).1 member |>.1 + obtain ⟨v, hv, w, hw, rfl⟩ := ZFSet.mem_prod.1 pairBound + have old := (mem_fixedIndexAssignmentPairs idx T A v w).1 member |>.2.2 + obtain ⟨y, edge, unique⟩ := function.2 _ (covered v hv w hw old) + have hy := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 + exact ⟨y, (fixedIndexAssignmentClassGraph_entry _ _ _ _ _ _ _ _).2 ⟨hv, hw, old, hy, edge⟩, + fun z hz => unique z ((fixedIndexAssignmentClassGraph_entry _ _ _ _ _ _ _ _).1 hz).2.2.2.2⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem fixedIndexAssignmentPairs_mem_small + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {idx T A N : ZFSet.{u}} (hIdx : idx ∈ M.sets) (hT : T ∈ M.sets) + (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : + fixedIndexAssignmentPairs idx T A ∈ M.sets ∧ + M.groundEmbeddable (fixedIndexAssignmentPairs idx T A) N := by + have singleton : ({idx} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hIdx hIdx + have slice := M.assignmentOnIndices_mem pairing unions powers separation singleton hT hA + have sliceSmall := M.assignmentOnIndices_small pairing unions powers separation singleton hT hA hN small + have bound := M.prod_mem pairing unions powers separation hT hT + have graph := M.productSecond_mem pairing unions powers separation singleton bound + exact ⟨M.relationImage_mem separation slice bound graph, + M.groundEmbeddable_function_image pairing unions powers separation choice slice bound hN + graph (productSecond_function {idx} (ZFSet.prod T T)) sliceSmall⟩ + +theorem fixedIndexAssignmentClassGraph_mem + {idx T A B graph : ZFSet.{u}} (hIdx : idx ∈ M.sets) (hT : T ∈ M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hGraph : graph ∈ M.sets) : + fixedIndexAssignmentClassGraph idx T A B graph ∈ M.sets := by + have singleton : ({idx} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hIdx hIdx + have pairs := M.prod_mem pairing unions powers separation hT hT + have slice := M.assignmentOnIndices_mem pairing unions powers separation singleton hT hA + have projection := M.productSecond_mem pairing unions powers separation singleton pairs + have domain := M.relationImage_mem separation slice pairs projection + have triples := M.stageOneAssignments_mem pairing unions powers separation singleton hT + exact M.relationCompose_mem pairing unions powers separation domain triples hB + (M.relationConverse_mem pairing unions powers separation triples pairs projection) hGraph + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedPoints.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedPoints.lean index bff56500623338ee4f2e8250d61e595236963154..933e78a4fa2bd2214011aaecad53266f10aca63b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedPoints.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedPoints.lean @@ -1,97 +1,97 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -universe u - -def postfixedFormula {k : Nat} (φ : SetFormula (k + 2)) : SetFormula (k + 1) := - .all (imp (.mem 0 1) φ) - -def definableOperator {k : Nat} (U : Set ZFSet.{u}) (φ : SetFormula (k + 2)) - (params : Fin k → ZFSet.{u}) (B S : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun x => Realize U φ (extend x (extend S params))) B - -theorem definableOperator_subset {k : Nat} (U : Set ZFSet.{u}) (φ : SetFormula (k + 2)) - (params : Fin k → ZFSet.{u}) (B S : ZFSet.{u}) : definableOperator U φ params B S ⊆ B := - fun _ hx => (ZFSet.mem_sep.1 hx).1 - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_postfixedFormula {k : Nat} (φ : SetFormula (k + 2)) - (params : Fin k → ZFSet.{u}) {B S : ZFSet.{u}} - (hS : S ∈ M.sets) (bound : S ⊆ B) : - Realize M.sets (postfixedFormula φ) (extend S params) ↔ - S ⊆ definableOperator M.sets φ params B S := by - simp only [postfixedFormula, Realize, realize_imp] - constructor - · intro h x hx - exact ZFSet.mem_sep.2 ⟨bound hx, h x (M.transitive hS hx) hx⟩ - · intro h x _ hx - exact (ZFSet.mem_sep.1 (h hx)).2 - -theorem definableOperator_mem (separation : SeparationSchema M.sets) - {k : Nat} (φ : SetFormula (k + 2)) (params : Fin k → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {B S : ZFSet.{u}} - (hB : B ∈ M.sets) (hS : S ∈ M.sets) : definableOperator M.sets φ params B S ∈ M.sets := - M.separation_mem separation φ (extend S params) (fun i => Fin.cases hS members i) hB - -theorem exists_greatest_definable_fixedPoint - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {k : Nat} (φ : SetFormula (k + 2)) (params : Fin k → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) - (mono : ∀ S ∈ M.sets, ∀ T ∈ M.sets, S ⊆ B → T ⊆ B → S ⊆ T → - definableOperator M.sets φ params B S ⊆ definableOperator M.sets φ params B T) : - ∃ R ∈ M.sets, R ⊆ B ∧ definableOperator M.sets φ params B R = R ∧ - ∀ S ∈ M.sets, S ⊆ B → S ⊆ definableOperator M.sets φ params B S → S ⊆ R := by - let F := definableOperator M.sets φ params B - obtain ⟨W, hW, subsets⟩ := M.power_witness powers hB - let C := ZFSet.sep (fun S => Realize M.sets (postfixedFormula φ) (extend S params)) W - have hC : C ∈ M.sets := M.separation_mem separation (postfixedFormula φ) params members hW - let R := ZFSet.sUnion C - have hR : R ∈ M.sets := M.union_mem unions hC - have memC : ∀ S, S ∈ C ↔ S ∈ M.sets ∧ S ⊆ B ∧ S ⊆ F S := by - intro S - constructor - · intro h - obtain ⟨hSW, post⟩ := ZFSet.mem_sep.1 h - have hSM := M.transitive hW hSW - have hSB := (subsets S hSM).1 hSW - exact ⟨hSM, hSB, (M.realize_postfixedFormula φ params hSM hSB).1 post⟩ - · rintro ⟨hSM, hSB, post⟩ - exact ZFSet.mem_sep.2 ⟨(subsets S hSM).2 hSB, - (M.realize_postfixedFormula φ params hSM hSB).2 post⟩ - have hRB : R ⊆ B := by - intro x hx - obtain ⟨S, hS, hxS⟩ := ZFSet.mem_sUnion.1 hx - exact ((memC S).1 hS).2.1 hxS - have greatest : ∀ S ∈ M.sets, S ⊆ B → S ⊆ F S → S ⊆ R := by - intro S hS hSB post x hx - exact ZFSet.mem_sUnion.2 ⟨S, (memC S).2 ⟨hS, hSB, post⟩, hx⟩ - have postR : R ⊆ F R := by - intro x hx - obtain ⟨S, hSC, hxS⟩ := ZFSet.mem_sUnion.1 hx - obtain ⟨hS, hSB, post⟩ := (memC S).1 hSC - exact mono S hS R hR hSB hRB (greatest S hS hSB post) (post hxS) - have hFR : F R ∈ M.sets := M.definableOperator_mem separation φ params members hB hR - have hFRB : F R ⊆ B := definableOperator_subset M.sets φ params B R - have postFR : F R ⊆ F (F R) := mono R hR (F R) hFR hRB hFRB postR - have fixed : F R = R := ZFSet.ext fun _ => - ⟨fun hx => greatest (F R) hFR hFRB postFR hx, fun hx => postR hx⟩ - exact ⟨R, hR, hRB, fixed, greatest⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +universe u + +def postfixedFormula {k : Nat} (φ : SetFormula (k + 2)) : SetFormula (k + 1) := + .all (imp (.mem 0 1) φ) + +def definableOperator {k : Nat} (U : Set ZFSet.{u}) (φ : SetFormula (k + 2)) + (params : Fin k → ZFSet.{u}) (B S : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun x => Realize U φ (extend x (extend S params))) B + +theorem definableOperator_subset {k : Nat} (U : Set ZFSet.{u}) (φ : SetFormula (k + 2)) + (params : Fin k → ZFSet.{u}) (B S : ZFSet.{u}) : definableOperator U φ params B S ⊆ B := + fun _ hx => (ZFSet.mem_sep.1 hx).1 + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_postfixedFormula {k : Nat} (φ : SetFormula (k + 2)) + (params : Fin k → ZFSet.{u}) {B S : ZFSet.{u}} + (hS : S ∈ M.sets) (bound : S ⊆ B) : + Realize M.sets (postfixedFormula φ) (extend S params) ↔ + S ⊆ definableOperator M.sets φ params B S := by + simp only [postfixedFormula, Realize, realize_imp] + constructor + · intro h x hx + exact ZFSet.mem_sep.2 ⟨bound hx, h x (M.transitive hS hx) hx⟩ + · intro h x _ hx + exact (ZFSet.mem_sep.1 (h hx)).2 + +theorem definableOperator_mem (separation : SeparationSchema M.sets) + {k : Nat} (φ : SetFormula (k + 2)) (params : Fin k → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {B S : ZFSet.{u}} + (hB : B ∈ M.sets) (hS : S ∈ M.sets) : definableOperator M.sets φ params B S ∈ M.sets := + M.separation_mem separation φ (extend S params) (fun i => Fin.cases hS members i) hB + +theorem exists_greatest_definable_fixedPoint + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {k : Nat} (φ : SetFormula (k + 2)) (params : Fin k → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) + (mono : ∀ S ∈ M.sets, ∀ T ∈ M.sets, S ⊆ B → T ⊆ B → S ⊆ T → + definableOperator M.sets φ params B S ⊆ definableOperator M.sets φ params B T) : + ∃ R ∈ M.sets, R ⊆ B ∧ definableOperator M.sets φ params B R = R ∧ + ∀ S ∈ M.sets, S ⊆ B → S ⊆ definableOperator M.sets φ params B S → S ⊆ R := by + let F := definableOperator M.sets φ params B + obtain ⟨W, hW, subsets⟩ := M.power_witness powers hB + let C := ZFSet.sep (fun S => Realize M.sets (postfixedFormula φ) (extend S params)) W + have hC : C ∈ M.sets := M.separation_mem separation (postfixedFormula φ) params members hW + let R := ZFSet.sUnion C + have hR : R ∈ M.sets := M.union_mem unions hC + have memC : ∀ S, S ∈ C ↔ S ∈ M.sets ∧ S ⊆ B ∧ S ⊆ F S := by + intro S + constructor + · intro h + obtain ⟨hSW, post⟩ := ZFSet.mem_sep.1 h + have hSM := M.transitive hW hSW + have hSB := (subsets S hSM).1 hSW + exact ⟨hSM, hSB, (M.realize_postfixedFormula φ params hSM hSB).1 post⟩ + · rintro ⟨hSM, hSB, post⟩ + exact ZFSet.mem_sep.2 ⟨(subsets S hSM).2 hSB, + (M.realize_postfixedFormula φ params hSM hSB).2 post⟩ + have hRB : R ⊆ B := by + intro x hx + obtain ⟨S, hS, hxS⟩ := ZFSet.mem_sUnion.1 hx + exact ((memC S).1 hS).2.1 hxS + have greatest : ∀ S ∈ M.sets, S ⊆ B → S ⊆ F S → S ⊆ R := by + intro S hS hSB post x hx + exact ZFSet.mem_sUnion.2 ⟨S, (memC S).2 ⟨hS, hSB, post⟩, hx⟩ + have postR : R ⊆ F R := by + intro x hx + obtain ⟨S, hSC, hxS⟩ := ZFSet.mem_sUnion.1 hx + obtain ⟨hS, hSB, post⟩ := (memC S).1 hSC + exact mono S hS R hR hSB hRB (greatest S hS hSB post) (post hxS) + have hFR : F R ∈ M.sets := M.definableOperator_mem separation φ params members hB hR + have hFRB : F R ⊆ B := definableOperator_subset M.sets φ params B R + have postFR : F R ⊆ F (F R) := mono R hR (F R) hFR hRB hFRB postR + have fixed : F R = R := ZFSet.ext fun _ => + ⟨fun hx => greatest (F R) hFR hFRB postFR hx, fun hx => postR hx⟩ + exact ⟨R, hR, hRB, fixed, greatest⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopStep.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopStep.lean index 39be1317038abd63e408d9d96f577cf347a6da6a..daff966f41e9c6c33179ff60b8ab0497040b6915 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopStep.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopStep.lean @@ -1,416 +1,416 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionHeightSteps -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFixedTopOrders -import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBatchBirths - -namespace OAI - -namespace PartitionPilot.Forcing - -section - -universe u - -noncomputable def fixedTopAction (G P A : ZFSet.{u}) : ZFSet.{u} := - A ∪ ZFSet.sep (fun z => ∃ g ∈ G, z = ZFSet.pair (ZFSet.pair g P) P) - (ZFSet.prod (ZFSet.prod G {P}) {P}) - -theorem pair_mem_fixedTopAction (G P A g p q : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g p) q ∈ fixedTopAction G P A ↔ - ZFSet.pair (ZFSet.pair g p) q ∈ A ∨ (g ∈ G ∧ p = P ∧ q = P) := by - constructor - · intro member - rcases ZFSet.mem_union.1 member with old | fresh - · exact Or.inl old - · obtain ⟨h, hh, equal⟩ := (ZFSet.mem_sep.1 fresh).2 - obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - exact Or.inr ⟨hh, rfl, rfl⟩ - · rintro (old | ⟨hg, rfl, rfl⟩) - · exact ZFSet.mem_union.2 (Or.inl old) - · exact ZFSet.mem_union.2 (Or.inr (ZFSet.mem_sep.2 - ⟨ZFSet.pair_mem_prod.2 - ⟨ZFSet.pair_mem_prod.2 ⟨hg, ZFSet.mem_singleton.2 rfl⟩, ZFSet.mem_singleton.2 rfl⟩, - g, hg, rfl⟩)) - -theorem fixedTopAction_old_iff {G P A g p q : ZFSet.{u}} (hp : p ∈ P) : - ZFSet.pair (ZFSet.pair g p) q ∈ fixedTopAction G P A ↔ - ZFSet.pair (ZFSet.pair g p) q ∈ A := by - rw [pair_mem_fixedTopAction] - exact ⟨fun h => h.elim id (fun h => False.elim (ZFSet.mem_irrefl P (h.2.1 ▸ hp))), Or.inl⟩ - -theorem fixedTopAction_at_top {G P A g q : ZFSet.{u}} - (function : ZFSet.IsFunc (ZFSet.prod G P) P A) : - ZFSet.pair (ZFSet.pair g P) q ∈ fixedTopAction G P A ↔ g ∈ G ∧ q = P := by - rw [pair_mem_fixedTopAction] - constructor - · rintro (old | ⟨hg, _, equal⟩) - · exact False.elim (ZFSet.mem_irrefl P - (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 old)).1).2) - · exact ⟨hg, equal⟩ - · rintro ⟨hg, equal⟩ - exact Or.inr ⟨hg, rfl, equal⟩ - -theorem fixedTopAction_fixes_top {G P A g : ZFSet.{u}} (hg : g ∈ G) : - ZFSet.pair (ZFSet.pair g P) P ∈ fixedTopAction G P A := - (pair_mem_fixedTopAction G P A g P P).2 (Or.inr ⟨hg, rfl, rfl⟩) - -theorem fixedTopAction_function {G P A : ZFSet.{u}} - (function : ZFSet.IsFunc (ZFSet.prod G P) P A) : - ZFSet.IsFunc (ZFSet.prod G (fixedTopCarrier P)) (fixedTopCarrier P) (fixedTopAction G P A) := by - refine ⟨?_, ?_⟩ - · intro z member - rcases ZFSet.mem_union.1 member with old | fresh - · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 old) - obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hx - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 - ⟨hg, (mem_fixedTopCarrier P p).2 (Or.inr hp)⟩, - (mem_fixedTopCarrier P y).2 (Or.inr hy)⟩ - · obtain ⟨g, hg, rfl⟩ := (ZFSet.mem_sep.1 fresh).2 - have top : P ∈ fixedTopCarrier P := (mem_fixedTopCarrier P P).2 (Or.inl rfl) - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, top⟩, top⟩ - · intro x hx - obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hx - rcases (mem_fixedTopCarrier P p).1 hp with rfl | old - · exact ⟨_, fixedTopAction_fixes_top hg, - fun q entry => ((fixedTopAction_at_top function).1 entry).2⟩ - · obtain ⟨q, entry, unique⟩ := function.2 (ZFSet.pair g p) (ZFSet.pair_mem_prod.2 ⟨hg, old⟩) - exact ⟨q, (fixedTopAction_old_iff old).2 entry, - fun y hy => unique y ((fixedTopAction_old_iff old).1 hy)⟩ - -theorem PosetActionCode.fixedTop {G P m e r A : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) (one_mem : e ∈ G) : - PosetActionCode G (fixedTopCarrier P) m e (fixedTopOrder P r) (fixedTopAction G P A) := by - refine ⟨fixedTopAction_function action.function, ?_, ?_, ?_⟩ - · intro p hp - rcases (mem_fixedTopCarrier P p).1 hp with rfl | old - · exact fixedTopAction_fixes_top one_mem - · exact (fixedTopAction_old_iff old).2 (action.one p old) - · intro g hg h hh k hk p hp q _ s _ product first second - rcases (mem_fixedTopCarrier P p).1 hp with rfl | old - · have eqQ := ((fixedTopAction_at_top action.function).1 first).2 - subst q - have eqS := ((fixedTopAction_at_top action.function).1 second).2 - subst s - exact fixedTopAction_fixes_top hk - · have firstOld := (fixedTopAction_old_iff old).1 first - have qOld := (ZFSet.pair_mem_prod.1 (action.function.1 firstOld)).2 - have secondOld := (fixedTopAction_old_iff qOld).1 second - have sOld := (ZFSet.pair_mem_prod.1 (action.function.1 secondOld)).2 - exact (fixedTopAction_old_iff old).2 - (action.mul g hg h hh k hk p old q qOld s sOld product firstOld secondOld) - · intro g hg p _ q hq s hs v _ first second below - rcases (mem_fixedTopCarrier P q).1 hq with rfl | qOld - · have equal := ((fixedTopAction_at_top action.function).1 second).2 - subst v - exact fixedTopOrder_greatest hs - · have belowOld := (fixedTopOrder_old_iff qOld).1 below - have pOld := (ZFSet.pair_mem_prod.1 (order.relation belowOld)).1 - have firstOld := (fixedTopAction_old_iff pOld).1 first - have secondOld := (fixedTopAction_old_iff qOld).1 second - have sOld := (ZFSet.pair_mem_prod.1 (action.function.1 firstOld)).2 - have vOld := (ZFSet.pair_mem_prod.1 (action.function.1 secondOld)).2 - exact ZFSet.mem_union.2 (Or.inl - (action.monotone g hg p pOld q qOld s sOld v vOld firstOld secondOld belowOld)) - -namespace BoundedFormula - -open SetFormula - -def fixedTopActionEntryFormula {n} (z G P : Fin n) : BoundedFormula n := - exMem G (orderedTripleFormula z.succ 0 P.succ P.succ) - -theorem truth_fixedTopActionEntryFormula {n} (z G P : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (fixedTopActionEntryFormula z G P) env ↔ - ∃ g ∈ env G, env z = ZFSet.pair (ZFSet.pair g (env P)) (env P) := by - simp only [fixedTopActionEntryFormula, truth_exMem, truth_orderedTripleFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem fixedTopAction_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G P A : ZFSet.{u}} (hG : G ∈ M.sets) (hP : P ∈ M.sets) (hA : A ∈ M.sets) : - fixedTopAction G P A ∈ M.sets := by - have singleton : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - let params := extend G (extend P Fin.elim0) - have selected := M.bounded_separation_mem separation - (BoundedFormula.fixedTopActionEntryFormula 0 1 2) params - (Fin.cases hG (Fin.cases hP (fun i => Fin.elim0 i))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hG singleton) singleton) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.fixedTopActionEntryFormula 0 1 2) (extend z params)) - (ZFSet.prod (ZFSet.prod G {P}) {P}) = - ZFSet.sep (fun z => ∃ g ∈ G, z = ZFSet.pair (ZFSet.pair g P) P) - (ZFSet.prod (ZFSet.prod G {P}) {P}) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_fixedTopActionEntryFormula 0 1 2 _) - exact M.binary_union_mem pairing unions hA (equal ▸ selected) - -end TransitiveGround - -end - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_fixedTopExtension - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P r μ G m e A D rD old : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (hD : D ∈ M.sets) (hOld : old ∈ M.sets) - (meet : MeetOrderCode P r μ) (action : PosetActionCode G P m e r A) - (one_mem : e ∈ G) (nonempty : D.Nonempty) - (height : StrictLexHeightCode P - (M.groundOmegaOne pairing unions powers separation collection infinite) D r old rD) - (small : M.groundEmbeddable (relationImage P (ZFSet.prod - (M.groundOmegaOne pairing unions powers separation collection infinite) D) old) ZFSet.omega) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ b ∈ C, ∃ q ∈ D, - fixedTopCarrier P ∈ M.sets ∧ fixedTopOrder P r ∈ M.sets ∧ fixedTopMeet P r ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets ∧ fixedTopAction G P A ∈ M.sets ∧ - fixedTopHeightGraph P old b q ∈ M.sets ∧ - MeetOrderCode (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) ∧ - MeetEmbeddingCode P (fixedTopCarrier P) r (fixedTopOrder P r) μ (fixedTopMeet P r) - (attachmentOldEmbeddingGraph P) ∧ - PosetActionCode G (fixedTopCarrier P) m e (fixedTopOrder P r) (fixedTopAction G P A) ∧ - StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) - (fixedTopHeightGraph P old b q) rD ∧ - (∀ x ∈ fixedTopCarrier P, ZFSet.pair x P ∈ fixedTopOrder P r) ∧ - (∀ x ∈ P, ZFSet.pair P x ∉ fixedTopOrder P r) ∧ - (∀ x y, y ∈ P → (ZFSet.pair x y ∈ fixedTopOrder P r ↔ ZFSet.pair x y ∈ r)) ∧ - (∀ x y, y ∈ P → ZFSet.pair x y ∈ fixedTopOrder P r → x ∈ P) ∧ - (∀ g ∈ G, ZFSet.pair (ZFSet.pair g P) P ∈ fixedTopAction G P A) ∧ - (∀ g x y, x ∈ P → (ZFSet.pair (ZFSet.pair g x) y ∈ fixedTopAction G P A ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A)) ∧ - (∀ x ∈ P, ∀ y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ ZFSet.pair x y ∈ old) ∧ - (∀ c ∈ heightColumns P C D old, c ∈ b) ∧ b ∉ heightColumns P C D old ∧ - relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) = - insert (ZFSet.pair b q) (relationImage P (ZFSet.prod C D) old) ∧ - relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) ∈ M.sets ∧ - M.groundEmbeddable - (relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q)) ZFSet.omega ∧ - (∀ x y, ZFSet.pair x y ∈ old → - ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) ∧ - (∀ x y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q → - y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) := by - obtain ⟨b, hb, q, hq, newHeight, hNewHeight, equal, above, fresh, strict, - oldEntries, _, rangeEq, hRange, smallRange, oldBound, bound⟩ := - M.exists_fixedTopHeight pairing unions powers separation collection infinite choice - hP hD hOld meet.order nonempty height small - subst newHeight - obtain ⟨hL, hR, hMeet, hEmbedding⟩ := M.fixedTop_ground_codes pairing unions powers separation hP hr - exact ⟨b, hb, q, hq, hL, hR, hMeet, hEmbedding, - M.fixedTopAction_mem pairing unions powers separation hG hP hA, hNewHeight, - fixedTopMeet_code meet, fixedTopOldEmbedding_code meet, action.fixedTop meet.order one_mem, - strict, fun _ hx => fixedTopOrder_greatest hx, - fun _ hx => (fixedTopOrder_strict_top meet.order hx).2, - fun _ _ hy => fixedTopOrder_old_iff hy, - fun _ _ hy entry => fixedTopOrder_no_new_below meet.order hy entry, - fun _ hg => fixedTopAction_fixes_top hg, fun _ _ _ hx => fixedTopAction_old_iff hx, - oldEntries, above, fresh, rangeEq, hRange, smallRange, oldBound, bound⟩ - -theorem exists_fixedTopStep - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {P r μ G m e A D rD old T birth s : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (hD : D ∈ M.sets) (hOld : old ∈ M.sets) (hT : T ∈ M.sets) (hBirth : birth ∈ M.sets) - (meet : MeetOrderCode P r μ) (action : PosetActionCode G P m e r A) - (one_mem : e ∈ G) (nonempty : D.Nonempty) - (height : StrictLexHeightCode P - (M.groundOmegaOne pairing unions powers separation collection infinite) D r old rD) - (small : M.groundEmbeddable (relationImage P (ZFSet.prod - (M.groundOmegaOne pairing unions powers separation collection infinite) D) old) ZFSet.omega) - (born : ZFSet.IsFunc P T birth) (hs : s ∈ T) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) - (oldMeet : OldMeetCode r μ birth) - (layers : ∀ t ∈ s, CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ b ∈ C, ∃ q ∈ D, - fixedTopCarrier P ∈ M.sets ∧ fixedTopOrder P r ∈ M.sets ∧ fixedTopMeet P r ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets ∧ fixedTopAction G P A ∈ M.sets ∧ - fixedTopBirth P birth s ∈ M.sets ∧ fixedTopHeightGraph P old b q ∈ M.sets ∧ - MeetOrderCode (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) ∧ - MeetEmbeddingCode P (fixedTopCarrier P) r (fixedTopOrder P r) μ (fixedTopMeet P r) - (attachmentOldEmbeddingGraph P) ∧ - PosetActionCode G (fixedTopCarrier P) m e (fixedTopOrder P r) (fixedTopAction G P A) ∧ - ZFSet.IsFunc (fixedTopCarrier P) T (fixedTopBirth P birth s) ∧ - (∀ x t, ZFSet.pair x t ∈ fixedTopBirth P birth s → t = s ∨ t ∈ s) ∧ - OldMeetCode (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) ∧ - (∀ t, t = s ∨ t ∈ s → Nonempty (CodedGrowthLayer M Space sourceOrder sourceMeet - (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t)) ∧ - StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) - (fixedTopHeightGraph P old b q) rD ∧ - (∀ x ∈ P, ∀ y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ ZFSet.pair x y ∈ old) ∧ - (∀ x ∈ P, ∀ t, ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ ZFSet.pair x t ∈ birth) ∧ - (∀ x ∈ fixedTopCarrier P, ZFSet.pair x P ∈ fixedTopOrder P r) ∧ - (∀ x ∈ P, ZFSet.pair P x ∉ fixedTopOrder P r) ∧ - (∀ g ∈ G, ZFSet.pair (ZFSet.pair g P) P ∈ fixedTopAction G P A) ∧ - relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) ∈ M.sets ∧ - M.groundEmbeddable - (relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q)) ZFSet.omega ∧ - (∀ x y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q → - y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) := by - obtain ⟨b, hb, q, hq, hL, hR, hMeet, hEmbedding, hAction, hHeight, - newMeet, embedding, newAction, newHeight, greatest, strictTop, _, _, fixes, - _, oldHeights, _, _, _, hRange, smallRange, _, bound⟩ := - M.exists_fixedTopExtension pairing unions powers separation collection infinite choice - hP hr hG hA hD hOld meet action one_mem nonempty height small - exact ⟨b, hb, q, hq, hL, hR, hMeet, hEmbedding, hAction, - M.fixedTopBirth_mem pairing unions hP hBirth (M.transitive hT hs), hHeight, - newMeet, embedding, newAction, fixedTopBirth_function born hs, - fixedTopBirth_bound earlier, fixedTopBirth_oldMeet meet born earlier oldMeet, - fun t ht => ⟨M.fixedTopBirth_layers pairing separation hP meet born earlier layers t ht⟩, - newHeight, oldHeights, fun _ hx _ => fixedTopBirth_old_iff hx, - greatest, strictTop, fixes, hRange, smallRange, bound⟩ - -end TransitiveGround - -section -universe u - -namespace IdealEmbeddingCode -variable {P Q rP rQ μP μQ e : ZFSet.{u}} -variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) -include code - -theorem preserves_bottom (target : MeetOrderCode Q rQ μQ) {b b' : ZFSet.{u}} - (least : ∀ x ∈ P, ZFSet.pair b x ∈ rP) (image : ZFSet.pair b b' ∈ e) : - ∀ y ∈ Q, ZFSet.pair b' y ∈ rQ := by - intro y hy - have hb' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 image)).2 - obtain ⟨z, meet, _⟩ := target.operation.2 (ZFSet.pair b' y) (ZFSet.pair_mem_prod.2 ⟨hb', hy⟩) - have hz := (ZFSet.pair_mem_prod.1 (target.operation.1 meet)).2 - obtain ⟨x, hx, _, xx'⟩ := code.ideal b b' z image hz (target.lower_left b' y z meet) - exact target.order.trans b' hb' z hz y hy - (code.monotone b x b' z (least x hx) image xx') (target.lower_right b' y z meet) - -theorem fixedTop (target : MeetOrderCode Q rQ μQ) : - IdealEmbeddingCode P (fixedTopCarrier Q) rP (fixedTopOrder Q rQ) μP (fixedTopMeet Q rQ) e := by - refine ⟨⟨⟨⟨?_, code.injection.function.2⟩, code.injection.injective⟩, ?_, ?_⟩, ?_, ?_⟩ - · intro z entry - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.injection.function.1 entry) - exact ZFSet.pair_mem_prod.2 ⟨hx, fixedTopCarrier_old hy⟩ - · intro x y x' y' lower first second - exact fixedTopOrder_subset Q rQ (code.monotone x y x' y' lower first second) - · intro x y z x' y' z' meet first second third - exact fixedTopMeet_subset target (code.map_meet x y z x' y' z' meet first second third) - · intro x y x' y' first second lower - have hy' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 second)).2 - exact code.reflect x y x' y' first second ((fixedTopOrder_old_iff hy').1 lower) - · intro v v' z image _ lower - have hv' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 image)).2 - exact code.ideal v v' z image (fixedTopOrder_no_new_below target.order hv' lower) - ((fixedTopOrder_old_iff hv').1 lower) - -end IdealEmbeddingCode - -namespace ActionAgreementBelow -variable {G P m one r A g h v : ZFSet.{u}} -variable (agree : ActionAgreementBelow P r A g h v) -include agree - -theorem fixedTop (order : PartialOrderCode P r) (action : PosetActionCode G P m one r A) - (hv : v ∈ P) : - ActionAgreementBelow (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopAction G P A) g h v := by - intro x _ y _ lower - have hx := fixedTopOrder_no_new_below order hv lower - rw [fixedTopAction_old_iff hx, fixedTopAction_old_iff hx] - by_cases hy : y ∈ P - · exact agree x hx y hy ((fixedTopOrder_old_iff hv).1 lower) - · exact ⟨fun entry => False.elim (hy (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2), - fun entry => False.elim (hy (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2)⟩ - -end ActionAgreementBelow - -end - -open SetRealization -universe u - -namespace ActionAgreementBelow -variable {Q H R ν B g h v : ZFSet.{u}} - -theorem fixedTop_rectangleAgreement (meet : MeetOrderCode Q R ν) (function : ZFSet.IsFunc (ZFSet.prod H Q) Q B) (hv : v ∈ Q) - (agreement : ActionAgreementBelow Q R B g h v) : - ActionAgreementBelow (fixedTopCarrier Q) (fixedTopOrder Q R) (fixedTopAction H Q B) g h v := by - intro x _ y _ lower - have hx := fixedTopOrder_no_new_below meet.order hv lower - rw [fixedTopAction_old_iff hx, fixedTopAction_old_iff hx] - by_cases hy : y ∈ Q - · exact agreement x hx y hy ((fixedTopOrder_old_iff hv).1 lower) - · exact ⟨fun entry => (hy (ZFSet.pair_mem_prod.1 (function.1 entry)).2).elim, - fun entry => (hy (ZFSet.pair_mem_prod.1 (function.1 entry)).2).elim⟩ - -end ActionAgreementBelow - -namespace RectangleActorPairCode -variable {P μ A Q H R ν B e a c b d g h k l : ZFSet.{u}} - -theorem fixedTop (code : RectangleActorPairCode P μ A Q H R ν B e a c b d g h k l) - (meet : MeetOrderCode Q R ν) (function : ZFSet.IsFunc (ZFSet.prod H Q) Q B) - (images : ∀ x y, ZFSet.pair x y ∈ e → y ∈ Q) : - RectangleActorPairCode P μ A (fixedTopCarrier Q) H (fixedTopOrder Q R) - (fixedTopMeet Q R) (fixedTopAction H Q B) e a c b d g h k l := by - have root {g k} (old : RectangleRootMeetCode P μ A Q ν B e c d g k) : - RectangleRootMeetCode P μ A (fixedTopCarrier Q) (fixedTopMeet Q R) - (fixedTopAction H Q B) e c d g k := by - intro x hx v hv w hw d' _ x' _ w' _ y _ acted met ed ex ew entry - have hd' := images _ _ ed - have hx' := images _ _ ex - have hw' := images _ _ ew - have entry := (fixedTopAction_old_iff hd').1 entry - have hy := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - exact (fixedTopMeet_old_iff meet hy hx').2 - (old x hx v hv w hw d' hd' x' hx' w' hw' y hy acted met ed ex ew entry) - refine ⟨⟨?_, ?_⟩, root code.2.1, root code.2.2.1, ?_⟩ - · intro c' _ g' hg' h' hh' ec ag ah - have hc' := images _ _ ec - have agrees := code.1.1 c' hc' g' hg' h' hh' ec ag ah - exact ⟨ActionAgreementBelow.fixedTop_rectangleAgreement meet function hc' agrees.1, - ActionAgreementBelow.fixedTop_rectangleAgreement meet function hc' agrees.2⟩ - · intro b' _ eb - have hb' := images _ _ eb - exact ActionAgreementBelow.fixedTop_rectangleAgreement meet function hb' (code.1.2 b' hb' eb) - · intro b' _ d' _ y _ v _ z _ eb ed act1 act2 actB - have hb' := images _ _ eb - have hd' := images _ _ ed - have act1 := (fixedTopAction_old_iff hd').1 act1 - have act2 := (fixedTopAction_old_iff hd').1 act2 - have actB := (fixedTopAction_old_iff hb').1 actB - have hy := (ZFSet.pair_mem_prod.1 (function.1 act1)).2 - have hv := (ZFSet.pair_mem_prod.1 (function.1 act2)).2 - have hz := (ZFSet.pair_mem_prod.1 (function.1 actB)).2 - have cross := code.2.2.2 b' hb' d' hd' y hy v hv z hz eb ed act1 act2 actB - exact ⟨(fixedTopMeet_old_iff meet hy hv).2 cross.1, - (fixedTopAction_old_iff hb').2 cross.2⟩ - -end RectangleActorPairCode - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionHeightSteps +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFixedTopOrders +import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBatchBirths + +namespace OAI + +namespace PartitionPilot.Forcing + +section + +universe u + +noncomputable def fixedTopAction (G P A : ZFSet.{u}) : ZFSet.{u} := + A ∪ ZFSet.sep (fun z => ∃ g ∈ G, z = ZFSet.pair (ZFSet.pair g P) P) + (ZFSet.prod (ZFSet.prod G {P}) {P}) + +theorem pair_mem_fixedTopAction (G P A g p q : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g p) q ∈ fixedTopAction G P A ↔ + ZFSet.pair (ZFSet.pair g p) q ∈ A ∨ (g ∈ G ∧ p = P ∧ q = P) := by + constructor + · intro member + rcases ZFSet.mem_union.1 member with old | fresh + · exact Or.inl old + · obtain ⟨h, hh, equal⟩ := (ZFSet.mem_sep.1 fresh).2 + obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + exact Or.inr ⟨hh, rfl, rfl⟩ + · rintro (old | ⟨hg, rfl, rfl⟩) + · exact ZFSet.mem_union.2 (Or.inl old) + · exact ZFSet.mem_union.2 (Or.inr (ZFSet.mem_sep.2 + ⟨ZFSet.pair_mem_prod.2 + ⟨ZFSet.pair_mem_prod.2 ⟨hg, ZFSet.mem_singleton.2 rfl⟩, ZFSet.mem_singleton.2 rfl⟩, + g, hg, rfl⟩)) + +theorem fixedTopAction_old_iff {G P A g p q : ZFSet.{u}} (hp : p ∈ P) : + ZFSet.pair (ZFSet.pair g p) q ∈ fixedTopAction G P A ↔ + ZFSet.pair (ZFSet.pair g p) q ∈ A := by + rw [pair_mem_fixedTopAction] + exact ⟨fun h => h.elim id (fun h => False.elim (ZFSet.mem_irrefl P (h.2.1 ▸ hp))), Or.inl⟩ + +theorem fixedTopAction_at_top {G P A g q : ZFSet.{u}} + (function : ZFSet.IsFunc (ZFSet.prod G P) P A) : + ZFSet.pair (ZFSet.pair g P) q ∈ fixedTopAction G P A ↔ g ∈ G ∧ q = P := by + rw [pair_mem_fixedTopAction] + constructor + · rintro (old | ⟨hg, _, equal⟩) + · exact False.elim (ZFSet.mem_irrefl P + (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 old)).1).2) + · exact ⟨hg, equal⟩ + · rintro ⟨hg, equal⟩ + exact Or.inr ⟨hg, rfl, equal⟩ + +theorem fixedTopAction_fixes_top {G P A g : ZFSet.{u}} (hg : g ∈ G) : + ZFSet.pair (ZFSet.pair g P) P ∈ fixedTopAction G P A := + (pair_mem_fixedTopAction G P A g P P).2 (Or.inr ⟨hg, rfl, rfl⟩) + +theorem fixedTopAction_function {G P A : ZFSet.{u}} + (function : ZFSet.IsFunc (ZFSet.prod G P) P A) : + ZFSet.IsFunc (ZFSet.prod G (fixedTopCarrier P)) (fixedTopCarrier P) (fixedTopAction G P A) := by + refine ⟨?_, ?_⟩ + · intro z member + rcases ZFSet.mem_union.1 member with old | fresh + · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 old) + obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hx + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 + ⟨hg, (mem_fixedTopCarrier P p).2 (Or.inr hp)⟩, + (mem_fixedTopCarrier P y).2 (Or.inr hy)⟩ + · obtain ⟨g, hg, rfl⟩ := (ZFSet.mem_sep.1 fresh).2 + have top : P ∈ fixedTopCarrier P := (mem_fixedTopCarrier P P).2 (Or.inl rfl) + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, top⟩, top⟩ + · intro x hx + obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hx + rcases (mem_fixedTopCarrier P p).1 hp with rfl | old + · exact ⟨_, fixedTopAction_fixes_top hg, + fun q entry => ((fixedTopAction_at_top function).1 entry).2⟩ + · obtain ⟨q, entry, unique⟩ := function.2 (ZFSet.pair g p) (ZFSet.pair_mem_prod.2 ⟨hg, old⟩) + exact ⟨q, (fixedTopAction_old_iff old).2 entry, + fun y hy => unique y ((fixedTopAction_old_iff old).1 hy)⟩ + +theorem PosetActionCode.fixedTop {G P m e r A : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) (one_mem : e ∈ G) : + PosetActionCode G (fixedTopCarrier P) m e (fixedTopOrder P r) (fixedTopAction G P A) := by + refine ⟨fixedTopAction_function action.function, ?_, ?_, ?_⟩ + · intro p hp + rcases (mem_fixedTopCarrier P p).1 hp with rfl | old + · exact fixedTopAction_fixes_top one_mem + · exact (fixedTopAction_old_iff old).2 (action.one p old) + · intro g hg h hh k hk p hp q _ s _ product first second + rcases (mem_fixedTopCarrier P p).1 hp with rfl | old + · have eqQ := ((fixedTopAction_at_top action.function).1 first).2 + subst q + have eqS := ((fixedTopAction_at_top action.function).1 second).2 + subst s + exact fixedTopAction_fixes_top hk + · have firstOld := (fixedTopAction_old_iff old).1 first + have qOld := (ZFSet.pair_mem_prod.1 (action.function.1 firstOld)).2 + have secondOld := (fixedTopAction_old_iff qOld).1 second + have sOld := (ZFSet.pair_mem_prod.1 (action.function.1 secondOld)).2 + exact (fixedTopAction_old_iff old).2 + (action.mul g hg h hh k hk p old q qOld s sOld product firstOld secondOld) + · intro g hg p _ q hq s hs v _ first second below + rcases (mem_fixedTopCarrier P q).1 hq with rfl | qOld + · have equal := ((fixedTopAction_at_top action.function).1 second).2 + subst v + exact fixedTopOrder_greatest hs + · have belowOld := (fixedTopOrder_old_iff qOld).1 below + have pOld := (ZFSet.pair_mem_prod.1 (order.relation belowOld)).1 + have firstOld := (fixedTopAction_old_iff pOld).1 first + have secondOld := (fixedTopAction_old_iff qOld).1 second + have sOld := (ZFSet.pair_mem_prod.1 (action.function.1 firstOld)).2 + have vOld := (ZFSet.pair_mem_prod.1 (action.function.1 secondOld)).2 + exact ZFSet.mem_union.2 (Or.inl + (action.monotone g hg p pOld q qOld s sOld v vOld firstOld secondOld belowOld)) + +namespace BoundedFormula + +open SetFormula + +def fixedTopActionEntryFormula {n} (z G P : Fin n) : BoundedFormula n := + exMem G (orderedTripleFormula z.succ 0 P.succ P.succ) + +theorem truth_fixedTopActionEntryFormula {n} (z G P : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (fixedTopActionEntryFormula z G P) env ↔ + ∃ g ∈ env G, env z = ZFSet.pair (ZFSet.pair g (env P)) (env P) := by + simp only [fixedTopActionEntryFormula, truth_exMem, truth_orderedTripleFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem fixedTopAction_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G P A : ZFSet.{u}} (hG : G ∈ M.sets) (hP : P ∈ M.sets) (hA : A ∈ M.sets) : + fixedTopAction G P A ∈ M.sets := by + have singleton : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + let params := extend G (extend P Fin.elim0) + have selected := M.bounded_separation_mem separation + (BoundedFormula.fixedTopActionEntryFormula 0 1 2) params + (Fin.cases hG (Fin.cases hP (fun i => Fin.elim0 i))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hG singleton) singleton) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.fixedTopActionEntryFormula 0 1 2) (extend z params)) + (ZFSet.prod (ZFSet.prod G {P}) {P}) = + ZFSet.sep (fun z => ∃ g ∈ G, z = ZFSet.pair (ZFSet.pair g P) P) + (ZFSet.prod (ZFSet.prod G {P}) {P}) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_fixedTopActionEntryFormula 0 1 2 _) + exact M.binary_union_mem pairing unions hA (equal ▸ selected) + +end TransitiveGround + +end + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_fixedTopExtension + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P r μ G m e A D rD old : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (hD : D ∈ M.sets) (hOld : old ∈ M.sets) + (meet : MeetOrderCode P r μ) (action : PosetActionCode G P m e r A) + (one_mem : e ∈ G) (nonempty : D.Nonempty) + (height : StrictLexHeightCode P + (M.groundOmegaOne pairing unions powers separation collection infinite) D r old rD) + (small : M.groundEmbeddable (relationImage P (ZFSet.prod + (M.groundOmegaOne pairing unions powers separation collection infinite) D) old) ZFSet.omega) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ b ∈ C, ∃ q ∈ D, + fixedTopCarrier P ∈ M.sets ∧ fixedTopOrder P r ∈ M.sets ∧ fixedTopMeet P r ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets ∧ fixedTopAction G P A ∈ M.sets ∧ + fixedTopHeightGraph P old b q ∈ M.sets ∧ + MeetOrderCode (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) ∧ + MeetEmbeddingCode P (fixedTopCarrier P) r (fixedTopOrder P r) μ (fixedTopMeet P r) + (attachmentOldEmbeddingGraph P) ∧ + PosetActionCode G (fixedTopCarrier P) m e (fixedTopOrder P r) (fixedTopAction G P A) ∧ + StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) + (fixedTopHeightGraph P old b q) rD ∧ + (∀ x ∈ fixedTopCarrier P, ZFSet.pair x P ∈ fixedTopOrder P r) ∧ + (∀ x ∈ P, ZFSet.pair P x ∉ fixedTopOrder P r) ∧ + (∀ x y, y ∈ P → (ZFSet.pair x y ∈ fixedTopOrder P r ↔ ZFSet.pair x y ∈ r)) ∧ + (∀ x y, y ∈ P → ZFSet.pair x y ∈ fixedTopOrder P r → x ∈ P) ∧ + (∀ g ∈ G, ZFSet.pair (ZFSet.pair g P) P ∈ fixedTopAction G P A) ∧ + (∀ g x y, x ∈ P → (ZFSet.pair (ZFSet.pair g x) y ∈ fixedTopAction G P A ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A)) ∧ + (∀ x ∈ P, ∀ y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ ZFSet.pair x y ∈ old) ∧ + (∀ c ∈ heightColumns P C D old, c ∈ b) ∧ b ∉ heightColumns P C D old ∧ + relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) = + insert (ZFSet.pair b q) (relationImage P (ZFSet.prod C D) old) ∧ + relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) ∈ M.sets ∧ + M.groundEmbeddable + (relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q)) ZFSet.omega ∧ + (∀ x y, ZFSet.pair x y ∈ old → + ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) ∧ + (∀ x y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q → + y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) := by + obtain ⟨b, hb, q, hq, newHeight, hNewHeight, equal, above, fresh, strict, + oldEntries, _, rangeEq, hRange, smallRange, oldBound, bound⟩ := + M.exists_fixedTopHeight pairing unions powers separation collection infinite choice + hP hD hOld meet.order nonempty height small + subst newHeight + obtain ⟨hL, hR, hMeet, hEmbedding⟩ := M.fixedTop_ground_codes pairing unions powers separation hP hr + exact ⟨b, hb, q, hq, hL, hR, hMeet, hEmbedding, + M.fixedTopAction_mem pairing unions powers separation hG hP hA, hNewHeight, + fixedTopMeet_code meet, fixedTopOldEmbedding_code meet, action.fixedTop meet.order one_mem, + strict, fun _ hx => fixedTopOrder_greatest hx, + fun _ hx => (fixedTopOrder_strict_top meet.order hx).2, + fun _ _ hy => fixedTopOrder_old_iff hy, + fun _ _ hy entry => fixedTopOrder_no_new_below meet.order hy entry, + fun _ hg => fixedTopAction_fixes_top hg, fun _ _ _ hx => fixedTopAction_old_iff hx, + oldEntries, above, fresh, rangeEq, hRange, smallRange, oldBound, bound⟩ + +theorem exists_fixedTopStep + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {P r μ G m e A D rD old T birth s : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (hD : D ∈ M.sets) (hOld : old ∈ M.sets) (hT : T ∈ M.sets) (hBirth : birth ∈ M.sets) + (meet : MeetOrderCode P r μ) (action : PosetActionCode G P m e r A) + (one_mem : e ∈ G) (nonempty : D.Nonempty) + (height : StrictLexHeightCode P + (M.groundOmegaOne pairing unions powers separation collection infinite) D r old rD) + (small : M.groundEmbeddable (relationImage P (ZFSet.prod + (M.groundOmegaOne pairing unions powers separation collection infinite) D) old) ZFSet.omega) + (born : ZFSet.IsFunc P T birth) (hs : s ∈ T) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) + (oldMeet : OldMeetCode r μ birth) + (layers : ∀ t ∈ s, CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ b ∈ C, ∃ q ∈ D, + fixedTopCarrier P ∈ M.sets ∧ fixedTopOrder P r ∈ M.sets ∧ fixedTopMeet P r ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets ∧ fixedTopAction G P A ∈ M.sets ∧ + fixedTopBirth P birth s ∈ M.sets ∧ fixedTopHeightGraph P old b q ∈ M.sets ∧ + MeetOrderCode (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) ∧ + MeetEmbeddingCode P (fixedTopCarrier P) r (fixedTopOrder P r) μ (fixedTopMeet P r) + (attachmentOldEmbeddingGraph P) ∧ + PosetActionCode G (fixedTopCarrier P) m e (fixedTopOrder P r) (fixedTopAction G P A) ∧ + ZFSet.IsFunc (fixedTopCarrier P) T (fixedTopBirth P birth s) ∧ + (∀ x t, ZFSet.pair x t ∈ fixedTopBirth P birth s → t = s ∨ t ∈ s) ∧ + OldMeetCode (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) ∧ + (∀ t, t = s ∨ t ∈ s → Nonempty (CodedGrowthLayer M Space sourceOrder sourceMeet + (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t)) ∧ + StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) + (fixedTopHeightGraph P old b q) rD ∧ + (∀ x ∈ P, ∀ y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ ZFSet.pair x y ∈ old) ∧ + (∀ x ∈ P, ∀ t, ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ ZFSet.pair x t ∈ birth) ∧ + (∀ x ∈ fixedTopCarrier P, ZFSet.pair x P ∈ fixedTopOrder P r) ∧ + (∀ x ∈ P, ZFSet.pair P x ∉ fixedTopOrder P r) ∧ + (∀ g ∈ G, ZFSet.pair (ZFSet.pair g P) P ∈ fixedTopAction G P A) ∧ + relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) ∈ M.sets ∧ + M.groundEmbeddable + (relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q)) ZFSet.omega ∧ + (∀ x y, ZFSet.pair x y ∈ fixedTopHeightGraph P old b q → + y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) := by + obtain ⟨b, hb, q, hq, hL, hR, hMeet, hEmbedding, hAction, hHeight, + newMeet, embedding, newAction, newHeight, greatest, strictTop, _, _, fixes, + _, oldHeights, _, _, _, hRange, smallRange, _, bound⟩ := + M.exists_fixedTopExtension pairing unions powers separation collection infinite choice + hP hr hG hA hD hOld meet action one_mem nonempty height small + exact ⟨b, hb, q, hq, hL, hR, hMeet, hEmbedding, hAction, + M.fixedTopBirth_mem pairing unions hP hBirth (M.transitive hT hs), hHeight, + newMeet, embedding, newAction, fixedTopBirth_function born hs, + fixedTopBirth_bound earlier, fixedTopBirth_oldMeet meet born earlier oldMeet, + fun t ht => ⟨M.fixedTopBirth_layers pairing separation hP meet born earlier layers t ht⟩, + newHeight, oldHeights, fun _ hx _ => fixedTopBirth_old_iff hx, + greatest, strictTop, fixes, hRange, smallRange, bound⟩ + +end TransitiveGround + +section +universe u + +namespace IdealEmbeddingCode +variable {P Q rP rQ μP μQ e : ZFSet.{u}} +variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) +include code + +theorem preserves_bottom (target : MeetOrderCode Q rQ μQ) {b b' : ZFSet.{u}} + (least : ∀ x ∈ P, ZFSet.pair b x ∈ rP) (image : ZFSet.pair b b' ∈ e) : + ∀ y ∈ Q, ZFSet.pair b' y ∈ rQ := by + intro y hy + have hb' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 image)).2 + obtain ⟨z, meet, _⟩ := target.operation.2 (ZFSet.pair b' y) (ZFSet.pair_mem_prod.2 ⟨hb', hy⟩) + have hz := (ZFSet.pair_mem_prod.1 (target.operation.1 meet)).2 + obtain ⟨x, hx, _, xx'⟩ := code.ideal b b' z image hz (target.lower_left b' y z meet) + exact target.order.trans b' hb' z hz y hy + (code.monotone b x b' z (least x hx) image xx') (target.lower_right b' y z meet) + +theorem fixedTop (target : MeetOrderCode Q rQ μQ) : + IdealEmbeddingCode P (fixedTopCarrier Q) rP (fixedTopOrder Q rQ) μP (fixedTopMeet Q rQ) e := by + refine ⟨⟨⟨⟨?_, code.injection.function.2⟩, code.injection.injective⟩, ?_, ?_⟩, ?_, ?_⟩ + · intro z entry + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.injection.function.1 entry) + exact ZFSet.pair_mem_prod.2 ⟨hx, fixedTopCarrier_old hy⟩ + · intro x y x' y' lower first second + exact fixedTopOrder_subset Q rQ (code.monotone x y x' y' lower first second) + · intro x y z x' y' z' meet first second third + exact fixedTopMeet_subset target (code.map_meet x y z x' y' z' meet first second third) + · intro x y x' y' first second lower + have hy' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 second)).2 + exact code.reflect x y x' y' first second ((fixedTopOrder_old_iff hy').1 lower) + · intro v v' z image _ lower + have hv' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 image)).2 + exact code.ideal v v' z image (fixedTopOrder_no_new_below target.order hv' lower) + ((fixedTopOrder_old_iff hv').1 lower) + +end IdealEmbeddingCode + +namespace ActionAgreementBelow +variable {G P m one r A g h v : ZFSet.{u}} +variable (agree : ActionAgreementBelow P r A g h v) +include agree + +theorem fixedTop (order : PartialOrderCode P r) (action : PosetActionCode G P m one r A) + (hv : v ∈ P) : + ActionAgreementBelow (fixedTopCarrier P) (fixedTopOrder P r) (fixedTopAction G P A) g h v := by + intro x _ y _ lower + have hx := fixedTopOrder_no_new_below order hv lower + rw [fixedTopAction_old_iff hx, fixedTopAction_old_iff hx] + by_cases hy : y ∈ P + · exact agree x hx y hy ((fixedTopOrder_old_iff hv).1 lower) + · exact ⟨fun entry => False.elim (hy (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2), + fun entry => False.elim (hy (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2)⟩ + +end ActionAgreementBelow + +end + +open SetRealization +universe u + +namespace ActionAgreementBelow +variable {Q H R ν B g h v : ZFSet.{u}} + +theorem fixedTop_rectangleAgreement (meet : MeetOrderCode Q R ν) (function : ZFSet.IsFunc (ZFSet.prod H Q) Q B) (hv : v ∈ Q) + (agreement : ActionAgreementBelow Q R B g h v) : + ActionAgreementBelow (fixedTopCarrier Q) (fixedTopOrder Q R) (fixedTopAction H Q B) g h v := by + intro x _ y _ lower + have hx := fixedTopOrder_no_new_below meet.order hv lower + rw [fixedTopAction_old_iff hx, fixedTopAction_old_iff hx] + by_cases hy : y ∈ Q + · exact agreement x hx y hy ((fixedTopOrder_old_iff hv).1 lower) + · exact ⟨fun entry => (hy (ZFSet.pair_mem_prod.1 (function.1 entry)).2).elim, + fun entry => (hy (ZFSet.pair_mem_prod.1 (function.1 entry)).2).elim⟩ + +end ActionAgreementBelow + +namespace RectangleActorPairCode +variable {P μ A Q H R ν B e a c b d g h k l : ZFSet.{u}} + +theorem fixedTop (code : RectangleActorPairCode P μ A Q H R ν B e a c b d g h k l) + (meet : MeetOrderCode Q R ν) (function : ZFSet.IsFunc (ZFSet.prod H Q) Q B) + (images : ∀ x y, ZFSet.pair x y ∈ e → y ∈ Q) : + RectangleActorPairCode P μ A (fixedTopCarrier Q) H (fixedTopOrder Q R) + (fixedTopMeet Q R) (fixedTopAction H Q B) e a c b d g h k l := by + have root {g k} (old : RectangleRootMeetCode P μ A Q ν B e c d g k) : + RectangleRootMeetCode P μ A (fixedTopCarrier Q) (fixedTopMeet Q R) + (fixedTopAction H Q B) e c d g k := by + intro x hx v hv w hw d' _ x' _ w' _ y _ acted met ed ex ew entry + have hd' := images _ _ ed + have hx' := images _ _ ex + have hw' := images _ _ ew + have entry := (fixedTopAction_old_iff hd').1 entry + have hy := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + exact (fixedTopMeet_old_iff meet hy hx').2 + (old x hx v hv w hw d' hd' x' hx' w' hw' y hy acted met ed ex ew entry) + refine ⟨⟨?_, ?_⟩, root code.2.1, root code.2.2.1, ?_⟩ + · intro c' _ g' hg' h' hh' ec ag ah + have hc' := images _ _ ec + have agrees := code.1.1 c' hc' g' hg' h' hh' ec ag ah + exact ⟨ActionAgreementBelow.fixedTop_rectangleAgreement meet function hc' agrees.1, + ActionAgreementBelow.fixedTop_rectangleAgreement meet function hc' agrees.2⟩ + · intro b' _ eb + have hb' := images _ _ eb + exact ActionAgreementBelow.fixedTop_rectangleAgreement meet function hb' (code.1.2 b' hb' eb) + · intro b' _ d' _ y _ v _ z _ eb ed act1 act2 actB + have hb' := images _ _ eb + have hd' := images _ _ ed + have act1 := (fixedTopAction_old_iff hd').1 act1 + have act2 := (fixedTopAction_old_iff hd').1 act2 + have actB := (fixedTopAction_old_iff hb').1 actB + have hy := (ZFSet.pair_mem_prod.1 (function.1 act1)).2 + have hv := (ZFSet.pair_mem_prod.1 (function.1 act2)).2 + have hz := (ZFSet.pair_mem_prod.1 (function.1 actB)).2 + have cross := code.2.2.2 b' hb' d' hd' y hy v hv z hz eb ed act1 act2 actB + exact ⟨(fixedTopMeet_old_iff meet hy hv).2 cross.1, + (fixedTopAction_old_iff hb').2 cross.2⟩ + +end RectangleActorPairCode + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopTerminal.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopTerminal.lean index 72968a766804966abfa998428e50ca4bba16b1a3..634d8cd8c362d8af25ffae2976a9773a8efc6988 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopTerminal.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFixedTopTerminal.lean @@ -1,137 +1,137 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace GroundChronologicalHistory -variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} -variable (history : GroundChronologicalHistory M (insert s s) C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (ordinal : ordinalSetProperty s) (hs : s ∈ M.sets) -variable (earlier : ∀ x t, ZFSet.pair x t ∈ history.birth s → t ∈ s) -variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) -variable (heightCode : StrictLexHeightCode (fixedTopCarrier (history.space s)) C D - (fixedTopOrder (history.space s) (history.order s)) newHeight rD) - -local notation "time" => s -local notation "times" => (insert s s) -local notation "P" => history.space s -local notation "r" => history.order s -local notation "μ" => history.meetGraph s -local notation "born" => history.birth s -local notation "space'" => appendHistoryValue time history.space (fixedTopCarrier P) -local notation "order'" => appendHistoryValue time history.order (fixedTopOrder P r) -local notation "meet'" => appendHistoryValue time history.meetGraph (fixedTopMeet P r) -local notation "birth'" => appendHistoryValue time history.birth (fixedTopBirth P born s) -local notation "height'" => appendHistoryValue time history.height newHeight - -noncomputable def replaceTerminalFixedTop : GroundChronologicalHistory M times C D rD := by - classical - have terminal : s ∈ times := ZFSet.mem_insert_iff.2 (Or.inl rfl) - have hP := history.space_mem s terminal - have hr := history.order_mem s terminal - have meet := history.meet_order s terminal - have function := history.birth_function s terminal - have inside : ∀ t ∈ times, ∀ z ∈ t, z ∈ s := by - intro t ht z hz - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · exact hz - · exact ordinal.1 t ht z hz - have sourceSpace : ∀ t ∈ times, ∀ z ∈ t, history.space z = space' z := - fun t ht z hz => (appendHistoryValue_old (inside t ht z hz) _ _).symm - have sourceOrder : ∀ t ∈ times, ∀ z ∈ t, history.order z = order' z := - fun t ht z hz => (appendHistoryValue_old (inside t ht z hz) _ _).symm - have sourceMeet : ∀ t ∈ times, ∀ z ∈ t, history.meetGraph z = meet' z := - fun t ht z hz => (appendHistoryValue_old (inside t ht z hz) _ _).symm - refine { - space := space', order := order', meetGraph := meet', birth := birth', height := height' - space_mem := ?_, order_mem := ?_, meet_mem := ?_, birth_mem := ?_, height_mem := ?_ - meet_order := ?_, birth_function := ?_, birth_bound := ?_, old_meet := ?_ - strict_height := ?_, layer := ?_ } - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using M.fixedTopCarrier_mem pairing unions hP - · simpa only [appendHistoryValue_old ht] using history.space_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using M.fixedTopOrder_mem pairing unions powers separation hP hr - · simpa only [appendHistoryValue_old ht] using history.order_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using M.fixedTopMeet_mem pairing unions powers separation hP hr - · simpa only [appendHistoryValue_old ht] using history.meet_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using - M.fixedTopBirth_mem pairing unions hP (history.birth_mem _ terminal) hs - · simpa only [appendHistoryValue_old ht] using history.birth_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using hHeight - · simpa only [appendHistoryValue_old ht] using history.height_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using fixedTopMeet_code meet - · simpa only [appendHistoryValue_old ht] using history.meet_order t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using fixedTopBirth_function function terminal - · simpa only [appendHistoryValue_old ht] using - history.birth_function t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simp only [appendHistoryValue_at] - exact fun x _ a entry => fixedTopBirth_bound earlier x a entry - · simpa only [appendHistoryValue_old ht] using - history.birth_bound t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using - fixedTopBirth_oldMeet meet function earlier (history.old_meet _ terminal) - · simpa only [appendHistoryValue_old ht] using history.old_meet t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using heightCode - · simpa only [appendHistoryValue_old ht] using history.strict_height t (ZFSet.mem_insert_iff.2 (Or.inr ht)) - · intro cutoff hc t ht bound - by_cases equal : cutoff = s - · subst cutoff - simp only [appendHistoryValue_at] - have layer := M.fixedTopBirth_layers pairing separation hP meet function earlier - (fun a ha => history.layer s terminal a (ZFSet.mem_insert_iff.2 (Or.inr ha)) (Or.inr ha)) - t bound - exact layer.congr_sources_below (sourceSpace t ht) (sourceOrder t ht) (sourceMeet t ht) - · have hc := (ZFSet.mem_insert_iff.1 hc).resolve_left equal - simpa only [appendHistoryValue_old hc] using - (history.layer cutoff (ZFSet.mem_insert_iff.2 (Or.inr hc)) t ht bound).congr_sources_below - (sourceSpace t ht) (sourceOrder t ht) (sourceMeet t ht) - -local notation "extended" => history.replaceTerminalFixedTop pairing unions powers separation ordinal hs earlier newHeight hHeight heightCode - -theorem replaceTerminalFixedTop_old {t : ZFSet.{u}} (ht : t ∈ time) : - (extended).space t = history.space t ∧ (extended).order t = history.order t ∧ - (extended).meetGraph t = history.meetGraph t ∧ (extended).birth t = history.birth t ∧ - (extended).height t = history.height t := by - exact ⟨appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, - appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _⟩ - -theorem replaceTerminalFixedTop_terminal : - (extended).space time = fixedTopCarrier P ∧ (extended).order time = fixedTopOrder P r ∧ - (extended).meetGraph time = fixedTopMeet P r ∧ (extended).birth time = fixedTopBirth P born s ∧ - (extended).height time = newHeight := by - exact ⟨appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, - appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _⟩ - -end GroundChronologicalHistory -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace GroundChronologicalHistory +variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} +variable (history : GroundChronologicalHistory M (insert s s) C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (ordinal : ordinalSetProperty s) (hs : s ∈ M.sets) +variable (earlier : ∀ x t, ZFSet.pair x t ∈ history.birth s → t ∈ s) +variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) +variable (heightCode : StrictLexHeightCode (fixedTopCarrier (history.space s)) C D + (fixedTopOrder (history.space s) (history.order s)) newHeight rD) + +local notation "time" => s +local notation "times" => (insert s s) +local notation "P" => history.space s +local notation "r" => history.order s +local notation "μ" => history.meetGraph s +local notation "born" => history.birth s +local notation "space'" => appendHistoryValue time history.space (fixedTopCarrier P) +local notation "order'" => appendHistoryValue time history.order (fixedTopOrder P r) +local notation "meet'" => appendHistoryValue time history.meetGraph (fixedTopMeet P r) +local notation "birth'" => appendHistoryValue time history.birth (fixedTopBirth P born s) +local notation "height'" => appendHistoryValue time history.height newHeight + +noncomputable def replaceTerminalFixedTop : GroundChronologicalHistory M times C D rD := by + classical + have terminal : s ∈ times := ZFSet.mem_insert_iff.2 (Or.inl rfl) + have hP := history.space_mem s terminal + have hr := history.order_mem s terminal + have meet := history.meet_order s terminal + have function := history.birth_function s terminal + have inside : ∀ t ∈ times, ∀ z ∈ t, z ∈ s := by + intro t ht z hz + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · exact hz + · exact ordinal.1 t ht z hz + have sourceSpace : ∀ t ∈ times, ∀ z ∈ t, history.space z = space' z := + fun t ht z hz => (appendHistoryValue_old (inside t ht z hz) _ _).symm + have sourceOrder : ∀ t ∈ times, ∀ z ∈ t, history.order z = order' z := + fun t ht z hz => (appendHistoryValue_old (inside t ht z hz) _ _).symm + have sourceMeet : ∀ t ∈ times, ∀ z ∈ t, history.meetGraph z = meet' z := + fun t ht z hz => (appendHistoryValue_old (inside t ht z hz) _ _).symm + refine { + space := space', order := order', meetGraph := meet', birth := birth', height := height' + space_mem := ?_, order_mem := ?_, meet_mem := ?_, birth_mem := ?_, height_mem := ?_ + meet_order := ?_, birth_function := ?_, birth_bound := ?_, old_meet := ?_ + strict_height := ?_, layer := ?_ } + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using M.fixedTopCarrier_mem pairing unions hP + · simpa only [appendHistoryValue_old ht] using history.space_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using M.fixedTopOrder_mem pairing unions powers separation hP hr + · simpa only [appendHistoryValue_old ht] using history.order_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using M.fixedTopMeet_mem pairing unions powers separation hP hr + · simpa only [appendHistoryValue_old ht] using history.meet_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using + M.fixedTopBirth_mem pairing unions hP (history.birth_mem _ terminal) hs + · simpa only [appendHistoryValue_old ht] using history.birth_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using hHeight + · simpa only [appendHistoryValue_old ht] using history.height_mem t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using fixedTopMeet_code meet + · simpa only [appendHistoryValue_old ht] using history.meet_order t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using fixedTopBirth_function function terminal + · simpa only [appendHistoryValue_old ht] using + history.birth_function t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simp only [appendHistoryValue_at] + exact fun x _ a entry => fixedTopBirth_bound earlier x a entry + · simpa only [appendHistoryValue_old ht] using + history.birth_bound t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using + fixedTopBirth_oldMeet meet function earlier (history.old_meet _ terminal) + · simpa only [appendHistoryValue_old ht] using history.old_meet t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using heightCode + · simpa only [appendHistoryValue_old ht] using history.strict_height t (ZFSet.mem_insert_iff.2 (Or.inr ht)) + · intro cutoff hc t ht bound + by_cases equal : cutoff = s + · subst cutoff + simp only [appendHistoryValue_at] + have layer := M.fixedTopBirth_layers pairing separation hP meet function earlier + (fun a ha => history.layer s terminal a (ZFSet.mem_insert_iff.2 (Or.inr ha)) (Or.inr ha)) + t bound + exact layer.congr_sources_below (sourceSpace t ht) (sourceOrder t ht) (sourceMeet t ht) + · have hc := (ZFSet.mem_insert_iff.1 hc).resolve_left equal + simpa only [appendHistoryValue_old hc] using + (history.layer cutoff (ZFSet.mem_insert_iff.2 (Or.inr hc)) t ht bound).congr_sources_below + (sourceSpace t ht) (sourceOrder t ht) (sourceMeet t ht) + +local notation "extended" => history.replaceTerminalFixedTop pairing unions powers separation ordinal hs earlier newHeight hHeight heightCode + +theorem replaceTerminalFixedTop_old {t : ZFSet.{u}} (ht : t ∈ time) : + (extended).space t = history.space t ∧ (extended).order t = history.order t ∧ + (extended).meetGraph t = history.meetGraph t ∧ (extended).birth t = history.birth t ∧ + (extended).height t = history.height t := by + exact ⟨appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, + appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _⟩ + +theorem replaceTerminalFixedTop_terminal : + (extended).space time = fixedTopCarrier P ∧ (extended).order time = fixedTopOrder P r ∧ + (extended).meetGraph time = fixedTopMeet P r ∧ (extended).birth time = fixedTopBirth P born s ∧ + (extended).height time = newHeight := by + exact ⟨appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, + appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _⟩ + +end GroundChronologicalHistory +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatLimitConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatLimitConditions.lean index 0b0219d31d0eee90c8d01e7f261c654dbdb00783..f1b7ce2a65ddecaff4f9d5cf7a697a6680105cc5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatLimitConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatLimitConditions.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FlatLimitConditionFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def flatLimitConditions (rows I T stages history levels : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (FlatLimitConditionCode stages history levels) (M.stageOneCandidateBound rows I T) - -theorem mem_flatLimitConditions (rows I T stages history levels z : ZFSet.{u}) : - z ∈ M.flatLimitConditions rows I T stages history levels ↔ - z ∈ M.stageOneCandidateBound rows I T ∧ FlatLimitConditionCode stages history levels z := - ZFSet.mem_sep - -theorem pair_mem_flatLimitConditions (rows I T stages history levels row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels ↔ - row ∈ rows ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I T ∧ - M.groundEmbeddable A ZFSet.omega ∧ FlatHistoryCuts stages history levels row A := by - rw [M.mem_flatLimitConditions, M.pair_mem_stageOneCandidateBound, flatLimitConditionCode_pair] - constructor - · rintro ⟨⟨hr, hA, subset, small⟩, valid⟩ - exact ⟨hr, hA, subset, small, valid⟩ - · rintro ⟨hr, hA, subset, small, valid⟩ - exact ⟨⟨hr, hA, subset, small⟩, valid⟩ - -theorem flatLimitConditions_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {rows I T stages history levels : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hLevels : levels ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.flatLimitConditions rows I T stages history levels ∈ M.sets := by - have bound := M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega - let params : Fin 3 → ZFSet.{u} := ![stages, history, levels] - have ground : ∀ j, params j ∈ M.sets := - Fin.cases hStages (Fin.cases hHistory (Fin.cases hLevels (fun j => Fin.elim0 j))) - let phi : SetFormula 4 := flatLimitConditionFormula 1 2 3 0 - have selected := M.separation_mem separation phi params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets phi (extend z params)) - (M.stageOneCandidateBound rows I T) = M.flatLimitConditions rows I T stages history levels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_flatLimitConditions] - apply and_congr_right - intro member - exact M.realize_flatLimitConditionFormula 1 2 3 0 (extend z params) - (Fin.cases (M.transitive bound member) ground) - exact equal ▸ selected - -theorem flatLimitConditions_empty {rows I T stages history levels row : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hrow : row ∈ rows) - (lower : ∀ beta ∈ stages, ∃ Q, ZFSet.pair beta Q ∈ history ∧ ZFSet.pair row ∅ ∈ Q) : - ZFSet.pair row ∅ ∈ M.flatLimitConditions rows I T stages history levels := by - apply (M.mem_flatLimitConditions rows I T stages history levels _).2 - refine ⟨M.stageOneCandidateBound_empty hRows hrow, row, ∅, rfl, ?_⟩ - intro beta hbeta - obtain ⟨Q, entry, member⟩ := lower beta hbeta - have empty : assignmentCut levels beta ∅ = ∅ := by - apply ZFSet.ext - intro z - simp only [mem_assignmentCut, ZFSet.notMem_empty, false_and] - exact ⟨Q, entry, empty.symm ▸ member⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FlatLimitConditionFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def flatLimitConditions (rows I T stages history levels : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (FlatLimitConditionCode stages history levels) (M.stageOneCandidateBound rows I T) + +theorem mem_flatLimitConditions (rows I T stages history levels z : ZFSet.{u}) : + z ∈ M.flatLimitConditions rows I T stages history levels ↔ + z ∈ M.stageOneCandidateBound rows I T ∧ FlatLimitConditionCode stages history levels z := + ZFSet.mem_sep + +theorem pair_mem_flatLimitConditions (rows I T stages history levels row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels ↔ + row ∈ rows ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I T ∧ + M.groundEmbeddable A ZFSet.omega ∧ FlatHistoryCuts stages history levels row A := by + rw [M.mem_flatLimitConditions, M.pair_mem_stageOneCandidateBound, flatLimitConditionCode_pair] + constructor + · rintro ⟨⟨hr, hA, subset, small⟩, valid⟩ + exact ⟨hr, hA, subset, small, valid⟩ + · rintro ⟨hr, hA, subset, small, valid⟩ + exact ⟨⟨hr, hA, subset, small⟩, valid⟩ + +theorem flatLimitConditions_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {rows I T stages history levels : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hLevels : levels ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.flatLimitConditions rows I T stages history levels ∈ M.sets := by + have bound := M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega + let params : Fin 3 → ZFSet.{u} := ![stages, history, levels] + have ground : ∀ j, params j ∈ M.sets := + Fin.cases hStages (Fin.cases hHistory (Fin.cases hLevels (fun j => Fin.elim0 j))) + let phi : SetFormula 4 := flatLimitConditionFormula 1 2 3 0 + have selected := M.separation_mem separation phi params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets phi (extend z params)) + (M.stageOneCandidateBound rows I T) = M.flatLimitConditions rows I T stages history levels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_flatLimitConditions] + apply and_congr_right + intro member + exact M.realize_flatLimitConditionFormula 1 2 3 0 (extend z params) + (Fin.cases (M.transitive bound member) ground) + exact equal ▸ selected + +theorem flatLimitConditions_empty {rows I T stages history levels row : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hrow : row ∈ rows) + (lower : ∀ beta ∈ stages, ∃ Q, ZFSet.pair beta Q ∈ history ∧ ZFSet.pair row ∅ ∈ Q) : + ZFSet.pair row ∅ ∈ M.flatLimitConditions rows I T stages history levels := by + apply (M.mem_flatLimitConditions rows I T stages history levels _).2 + refine ⟨M.stageOneCandidateBound_empty hRows hrow, row, ∅, rfl, ?_⟩ + intro beta hbeta + obtain ⟨Q, entry, member⟩ := lower beta hbeta + have empty : assignmentCut levels beta ∅ = ∅ := by + apply ZFSet.ext + intro z + simp only [mem_assignmentCut, ZFSet.notMem_empty, false_and] + exact ⟨Q, entry, empty.symm ▸ member⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorFullActionGraph.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorFullActionGraph.lean index f5a03d3e747576c3823ef7774fdb36bddfe058f0..f17b1c662a2bb8355582d6236e190e14a254ab1f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorFullActionGraph.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorFullActionGraph.lean @@ -1,428 +1,428 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowAssignmentActions -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatSuccessorAssignmentGraphs - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem realize_actionSectionEntry (g : G) (z : ZFSet.{u}) - (hg : t.encode g ∈ M.sets) (hz : z ∈ M.sets) - (graph : a.actionGraph s t ∈ M.sets) (carrier : s.carrier ∈ M.sets) : - Realize M.sets (BoundedFormula.actionSectionEntryFormula 0 1 2 3).toFormula - (extend z (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ - z ∈ s.graph s (a.iso g) := - (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hz (Fin.cases hg (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j)))))).trans - (BoundedFormula.actionSectionEntry_correct a s t g z) - -theorem realize_actionSection (g : G) (F : ZFSet.{u}) - (hg : t.encode g ∈ M.sets) (hF : F ∈ M.sets) - (graph : a.actionGraph s t ∈ M.sets) (carrier : s.carrier ∈ M.sets) : - Realize M.sets (BoundedFormula.actionSectionFormula 0 1 2 3).toFormula - (extend F (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ - F = s.graph s (a.iso g) := - (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hF (Fin.cases hg (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j)))))).trans - (BoundedFormula.actionSection_correct a s t g F) - -theorem actionGraph_section_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (graph : a.actionGraph s t ∈ M.sets) - (g : G) (hg : t.encode g ∈ M.sets) : s.graph s (a.iso g) ∈ M.sets := by - obtain ⟨B, hB, bounds⟩ := M.exists_pair_bound pairing unions powers carrier carrier - let params := extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)) - have selected := M.separation_mem separation (BoundedFormula.actionSectionEntryFormula 0 1 2 3).toFormula - params (Fin.cases hg (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j)))) hB - have eq : ZFSet.sep (fun z => Realize M.sets - (BoundedFormula.actionSectionEntryFormula 0 1 2 3).toFormula (extend z params)) B = - s.graph s (a.iso g) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (M.realize_actionSectionEntry a s t g z hg (M.transitive hB hz) graph carrier).1 rel - · intro hz - have hzB : z ∈ B := by - obtain ⟨p, eq⟩ := (s.mem_graph s (a.iso g) z).1 hz - exact eq ▸ bounds _ (s.encode_mem p) _ (s.encode_mem (a.iso g p)) - exact ⟨hzB, (M.realize_actionSectionEntry a s t g z hg (M.transitive hB hzB) graph carrier).2 hz⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {X Y G : Type u} [Group G] [PartialOrder X] -variable (a : PosetAction G X) (s : Presentation X) (t : Presentation Y) (b : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {N : ZFSet.{u}} (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) -variable (hG : b.carrier ∈ M.sets) (hN : N ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) - -noncomputable def smallFunctionAction : - letI := M.smallFunctionOrder s.carrier t.carrier N - PosetAction G (SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) := by - letI := M.smallFunctionOrder s.carrier t.carrier N - have maps (g : G) : s.graph s (a.iso g).toEquiv ∈ M.sets := - M.actionGraph_section_mem a s b pairing unions powers separation hX graph g - (M.transitive hG (b.encode_mem g)) - let iso (g : G) := M.renameSmallOrderIso s t pairing unions powers separation hX hY hN - (a.iso g).toEquiv (maps g) - have raw (g : G) (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : - SetMembers.raw (iso g p) = graphRename s t (a.iso g).toEquiv (SetMembers.raw p) := - M.raw_renameSmallOrderIso s t pairing unions powers separation hX hY hN (a.iso g).toEquiv (maps g) p - exact { - iso := iso - one := by - intro p - apply SetMembers.raw_injective - rw [raw] - have eq : (a.iso 1).toEquiv = Equiv.refl X := by - apply Equiv.ext - exact a.one - rw [eq] - exact graphRename_refl s t (M.smallFunction_raw_properties s.carrier t.carrier N p).2.1.shape - mul := by - intro g h p - apply SetMembers.raw_injective - rw [raw, raw, raw] - have eq : (a.iso (g * h)).toEquiv = (a.iso h).toEquiv.trans (a.iso g).toEquiv := by - apply Equiv.ext - exact a.mul g h - rw [eq] - exact (graphRename_comp s t (a.iso h).toEquiv (a.iso g).toEquiv (SetMembers.raw p)).symm } - -theorem raw_smallFunctionAction (g : G) (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : - letI := M.smallFunctionOrder s.carrier t.carrier N - SetMembers.raw ((M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).iso g p) = - graphRename s t (a.iso g).toEquiv (SetMembers.raw p) := SetMembers.raw_ofMem _ _ - -theorem smallFunctionAction_entry (g : G) (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) - (x : X) (y : Y) : - letI := M.smallFunctionOrder s.carrier t.carrier N - ZFSet.pair (s.encode (a.iso g x)) (t.encode y) ∈ - SetMembers.raw ((M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).iso g p) ↔ - ZFSet.pair (s.encode x) (t.encode y) ∈ SetMembers.raw p := by - let := M.smallFunctionOrder s.carrier t.carrier N - rw [raw_smallFunctionAction, pair_mem_graphRename] - change ZFSet.pair (s.encode ((a.iso g).toEquiv.symm ((a.iso g).toEquiv x))) (t.encode y) ∈ _ ↔ _ - rw [(a.iso g).toEquiv.symm_apply_apply] - -end PartitionPilot.Forcing.TransitiveGround - -section - -namespace PartitionPilot.Forcing.SetFormula - -def actionMapPairFormula : SetFormula 4 := - ex (.conj (BoundedFormula.orderedPairFormula 2 1 0).toFormula - (BoundedFormula.actionSectionFormula 0 1 3 4).toFormula) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem realize_actionMapPairFormula (g : G) (z : ZFSet.{u}) - (hg : t.encode g ∈ M.sets) (hz : z ∈ M.sets) - (graph : a.actionGraph s t ∈ M.sets) (carrier : s.carrier ∈ M.sets) - (section_mem : s.graph s (a.iso g) ∈ M.sets) : - Realize M.sets actionMapPairFormula - (extend (t.encode g) (extend z (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ - z = ZFSet.pair (t.encode g) (s.graph s (a.iso g)) := by - rw [actionMapPairFormula, realize_ex] - constructor - · rintro ⟨F, hF, pair, rel⟩ - have members : ∀ j, (extend F (extend (t.encode g) (extend z - (extend (a.actionGraph s t) (extend s.carrier Fin.elim0))))) j ∈ M.sets := - Fin.cases hF (Fin.cases hg (Fin.cases hz (Fin.cases graph - (Fin.cases carrier (fun j => Fin.elim0 j))))) - have shape := (BoundedFormula.truth_orderedPairFormula 2 1 0 _).1 - ((BoundedFormula.realize_toFormula M _ _ members).1 pair) - have raw := (BoundedFormula.realize_toFormula M _ _ members).1 rel - change BoundedFormula.Truth (BoundedFormula.actionSectionFormula 0 1 2 3) - (extend F (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) at raw - have eq := (BoundedFormula.actionSection_correct a s t g F).1 raw - change z = ZFSet.pair (t.encode g) F at shape - exact eq ▸ shape - · intro eq - refine ⟨s.graph s (a.iso g), section_mem, ?_, ?_⟩ - · apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases section_mem (Fin.cases hg - (Fin.cases hz (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j))))))).2 - exact (BoundedFormula.truth_orderedPairFormula 2 1 0 _).2 eq - · apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases section_mem (Fin.cases hg - (Fin.cases hz (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j))))))).2 - change BoundedFormula.Truth (BoundedFormula.actionSectionFormula 0 1 2 3) - (extend (s.graph s (a.iso g)) (extend (t.encode g) - (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) - exact (BoundedFormula.actionSection_correct a s t g _).2 rfl - -theorem conditionMapFamily_mem_of_actionGraph - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (graph : a.actionGraph s t ∈ M.sets) : a.conditionMapFamily s t ∈ M.sets := by - have hg (g : G) := M.transitive group (t.encode_mem g) - have sections (g : G) := M.actionGraph_section_mem a s t pairing unions powers separation carrier graph g (hg g) - let params := extend (a.actionGraph s t) (extend s.carrier Fin.elim0) - apply M.definable_image_mem separation collection actionMapPairFormula params - (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j))) group - · intro z hz - obtain ⟨g, eq⟩ := ZFSet.mem_range.1 hz - exact eq ▸ M.orderedPair_mem pairing (hg g) (sections g) - · intro z hz - change z ∈ ZFSet.range (fun g : G => ZFSet.pair (t.encode g) (s.graph s (a.iso g))) ↔ _ - rw [ZFSet.mem_range] - constructor - · rintro ⟨g, eq⟩ - exact ⟨t.encode g, t.encode_mem g, - (M.realize_actionMapPairFormula a s t g z (hg g) hz graph carrier (sections g)).2 eq.symm⟩ - · rintro ⟨x, hx, rel⟩ - obtain ⟨g, rfl⟩ := (t.mem_carrier x).1 hx - exact ⟨g, ((M.realize_actionMapPairFormula a s t g z (hg g) hz graph carrier (sections g)).1 rel).symm⟩ - · intro x hx y hy z hz rely relz - obtain ⟨g, rfl⟩ := (t.mem_carrier x).1 hx - exact ((M.realize_actionMapPairFormula a s t g y (hg g) hy graph carrier (sections g)).1 rely).trans - ((M.realize_actionMapPairFormula a s t g z (hg g) hz graph carrier (sections g)).1 relz).symm - -end PartitionPilot.Forcing.TransitiveGround - -end - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageOneActionParameters (M : TransitiveGround.{u}) (a : PosetAction G P) - (s : Presentation P) (t : Presentation G) (b : Presentation L) (d : PosetAction G L) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Prop where - condition_maps : a.conditionMapFamily s t ∈ M.sets - node_maps : d.conditionMapFamily b t ∈ M.sets - terms_closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T - pairs_closed : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2 - family_ground : (Name.familySet ⊤ T valid).val ∈ M.sets - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {L G : Type u} [PartialOrder L] [OrderBot L] [Group G] - -noncomputable def rowPositionSequenceAction (a : PosetAction G L) (s : Presentation L) - (g : G) (mu f : ZFSet.{u}) : ZFSet.{u} := - relationCompose mu s.nonbottom.carrier s.nonbottom.carrier f - (s.nonbottom.graph s.nonbottom (a.nonbottom.iso g)) - -theorem pair_mem_rowPositionSequenceAction (a : PosetAction G L) (s : Presentation L) - (g : G) (mu f i : ZFSet.{u}) (x : {x : L // x ≠ ⊥}) : - ZFSet.pair i (s.encode (a.iso g x.val)) ∈ rowPositionSequenceAction a s g mu f ↔ - i ∈ mu ∧ ZFSet.pair i (s.encode x.val) ∈ f := by - rw [rowPositionSequenceAction, pair_mem_relationCompose] - constructor - · rintro ⟨hi, _, y, hy, entry, moved⟩ - obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy - have equal := (s.nonbottom.pair_mem_graph s.nonbottom (a.nonbottom.iso g) - y (a.nonbottom.iso g x)).1 moved - have same := (a.nonbottom.iso g).injective equal - exact ⟨hi, same ▸ entry⟩ - · rintro ⟨hi, entry⟩ - exact ⟨hi, s.nonbottom.encode_mem (a.nonbottom.iso g x), s.encode x.val, - s.nonbottom.encode_mem x, entry, - (s.nonbottom.pair_mem_graph s.nonbottom (a.nonbottom.iso g) x _).2 rfl⟩ - -theorem rowPositionSequenceAction_function (a : PosetAction G L) (s : Presentation L) - (g : G) {mu delta f : ZFSet.{u}} (subset : delta ⊆ mu) - (function : ZFSet.IsFunc delta s.nonbottom.carrier f) : - ZFSet.IsFunc delta s.nonbottom.carrier (rowPositionSequenceAction a s g mu f) := by - constructor - · intro z hz - obtain ⟨i, _, y, _, x, hx, rfl, entry, _⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨(ZFSet.pair_mem_prod.1 (function.1 entry)).1, hx⟩ - · intro i hi - obtain ⟨x, entry, unique⟩ := function.2 i hi - obtain ⟨x, rfl⟩ := (s.nonbottom.mem_carrier x).1 - (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - refine ⟨s.encode (a.iso g x.val), - (pair_mem_rowPositionSequenceAction a s g mu f i x).2 ⟨subset hi, entry⟩, ?_⟩ - intro y hy - have hyI := ((pair_mem_relationCompose _ _ _ _ _ i y).1 hy).2.1 - obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hyI - let old := (a.nonbottom.iso g).symm y - have target : a.nonbottom.iso g old = y := (a.nonbottom.iso g).apply_symm_apply y - have original : ZFSet.pair i (s.encode old.val) ∈ f := by - apply ((pair_mem_rowPositionSequenceAction a s g mu f i old).1 ?_).2 - simpa only [← PosetAction.nonbottom_iso_val, target, Presentation.nonbottom_encode] using hy - have same : old = x := s.nonbottom.injective (unique _ original) - exact congrArg s.nonbottom.encode ((congrArg (a.nonbottom.iso g) same).symm.trans target).symm - -theorem rowPositionSequenceAction_code (a : PosetAction G L) (s : Presentation L) - (g : G) {mu f : ZFSet.{u}} (ordinal : ordinalSetProperty mu) - (code : RowPositionSequenceCode s.carrier s.conditionOrder s.nonbottom.carrier mu f) : - RowPositionSequenceCode s.carrier s.conditionOrder s.nonbottom.carrier mu - (rowPositionSequenceAction a s g mu f) := by - obtain ⟨delta, length, function, d, hd, bounds⟩ := code - have subset := (rowPositionSequence_length ordinal length).2 - obtain ⟨D, rfl⟩ := (s.mem_carrier d).1 hd - have movedFunction := rowPositionSequenceAction_function a s g subset function - refine ⟨delta, length, movedFunction, s.encode (a.iso g D), s.encode_mem _, ?_⟩ - intro i x entry - obtain ⟨_, _, y, hy, original, moved⟩ := (pair_mem_relationCompose _ _ _ _ _ i x).1 entry - obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy - obtain ⟨v, hv⟩ := (s.nonbottom.mem_graph s.nonbottom (a.nonbottom.iso g) _).1 moved - obtain ⟨same, value⟩ := ZFSet.pair_inj.1 hv - have equal : v = y := s.nonbottom.injective same - have lower := (s.pair_mem_conditionOrder y.val D).1 (bounds i _ original) - have result := (s.pair_mem_conditionOrder (a.iso g y.val) (a.iso g D)).2 ((a.iso g).monotone lower) - rw [equal] at value - exact value ▸ result - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem rowPositionSequenceAction_mem (a : PosetAction G L) (s : Presentation L) (b : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hL : s.carrier ∈ M.sets) (hG : b.carrier ∈ M.sets) - (graph : a.actionGraph s b ∈ M.sets) {mu f : ZFSet.{u}} - (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) (g : G) - (member : f ∈ M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu) : - rowPositionSequenceAction a s g mu f ∈ - M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu := by - obtain ⟨hf, code⟩ := (M.mem_rowPositionSequences ordinal).1 member - have hI := M.nonbottom_carrier_mem s separation hL - have ha := M.nonbottom_actionGraph_mem a s b separation hL hG graph - have actionSection := M.actionGraph_section_mem a.nonbottom s.nonbottom b pairing unions powers - separation hI ha g (M.transitive hG (b.encode_mem g)) - exact (M.mem_rowPositionSequences ordinal).2 - ⟨M.relationCompose_mem pairing unions powers separation hmu hI hI hf actionSection, - rowPositionSequenceAction_code a s g ordinal code⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) - -theorem decoded_conditionMapFamily_mem {G P m i e R A : ZFSet.{u}} - (group : GroupCode G m i e) (order : PartialOrderCode P R) - (action : PosetActionCode G P m e R A) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : - letI := group.toGroup - letI := order.toPartialOrder - (action.toPosetAction group order).conditionMapFamily - (SetMembers.presentation P) (SetMembers.presentation G) ∈ M.sets := by - let := group.toGroup - let := order.toPartialOrder - apply M.conditionMapFamily_mem_of_actionGraph (action.toPosetAction group order) - (SetMembers.presentation P) (SetMembers.presentation G) pairing unions powers separation collection hP hG - rw [action.actionGraph_eq group order] - exact hA - -variable {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem exists_ZF_interpretation_from_actionGraph (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (graph : a.actionGraph s t ∈ M.sets) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ - M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ - ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) := - M.exists_ZF_interpretation a s t b F K basis small pairing unions powers separation collection infinite - carrier order group indices supports - (M.conditionMapFamily_mem_of_actionGraph a s t pairing unions powers separation collection carrier group graph) p - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P : Type u} -variable [Group G] [PartialOrder R] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -variable (rowAction : PosetAction G R) (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) -local notation "Q" => M.flatSuccessorCarrier c s I T levels alpha tests -local notation "J" => stageOneAssignments I T -local notation "B" => M.groundSmallSubsets J ZFSet.omega -local notation "assignmentFamily" => familyCodeGraph t.encode assignmentGraph - -noncomputable def flatSuccessorFullActionGraph : ZFSet.{u} := - rowAssignmentActionGraph t.carrier Q c.carrier B J - (rowAction.conditionMapFamily c t) assignmentFamily - -theorem flatSuccessorFullActionGraph_entry (g : G) (p q : R) (A D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode p) A)) (ZFSet.pair (c.encode q) D) ∈ - M.flatSuccessorFullActionGraph c s I T levels alpha tests rowAction t assignmentGraph ↔ - ZFSet.pair (c.encode p) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ rowAction.iso g p = q ∧ - D = relationImage A J (assignmentGraph g) := by - rw [flatSuccessorFullActionGraph, pair_mem_rowAssignmentActionGraph] - constructor - · rintro ⟨_,source,target,_,_,_,_,rf,af,indexed,row,indexedA,image⟩ - have rowEq := (rowAction.pair_mem_conditionMapFamily c t g rf).1 indexed - have assignmentEq := (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g af).1 indexedA - rw [assignmentEq] at image - exact ⟨source,target,(c.pair_mem_graph c (rowAction.iso g) p q).1 (rowEq ▸ row),image⟩ - · rintro ⟨source,target,moved,image⟩ - have sourceBound := ZFSet.pair_mem_prod.1 - (M.flatSuccessorCarrier_subset c s I T levels alpha tests source) - have targetBound := ZFSet.pair_mem_prod.1 - (M.flatSuccessorCarrier_subset c s I T levels alpha tests target) - exact ⟨t.encode_mem g,source,target,sourceBound.1,sourceBound.2,targetBound.1,targetBound.2, - _,_,(rowAction.pair_mem_conditionMapFamily c t g _).2 rfl, - (c.pair_mem_graph c (rowAction.iso g) p q).2 moved, - (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g _).2 rfl,image⟩ - -theorem flatSuccessorFullActionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (rows : c.carrier ∈ M.sets) (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) - (assignments : stageOneAssignments I T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (group : t.carrier ∈ M.sets) (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) - (assignmentMaps : familyCodeGraph t.encode assignmentGraph ∈ M.sets) : - M.flatSuccessorFullActionGraph c s I T levels alpha tests rowAction t assignmentGraph ∈ M.sets := - M.rowAssignmentActionGraph_mem pairing unions powers separation group conditions rows - (M.groundSmallSubsets_mem powers separation assignments omega) assignments rowMaps assignmentMaps - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowAssignmentActions +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatSuccessorAssignmentGraphs + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem realize_actionSectionEntry (g : G) (z : ZFSet.{u}) + (hg : t.encode g ∈ M.sets) (hz : z ∈ M.sets) + (graph : a.actionGraph s t ∈ M.sets) (carrier : s.carrier ∈ M.sets) : + Realize M.sets (BoundedFormula.actionSectionEntryFormula 0 1 2 3).toFormula + (extend z (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ + z ∈ s.graph s (a.iso g) := + (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hz (Fin.cases hg (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j)))))).trans + (BoundedFormula.actionSectionEntry_correct a s t g z) + +theorem realize_actionSection (g : G) (F : ZFSet.{u}) + (hg : t.encode g ∈ M.sets) (hF : F ∈ M.sets) + (graph : a.actionGraph s t ∈ M.sets) (carrier : s.carrier ∈ M.sets) : + Realize M.sets (BoundedFormula.actionSectionFormula 0 1 2 3).toFormula + (extend F (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ + F = s.graph s (a.iso g) := + (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hF (Fin.cases hg (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j)))))).trans + (BoundedFormula.actionSection_correct a s t g F) + +theorem actionGraph_section_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (graph : a.actionGraph s t ∈ M.sets) + (g : G) (hg : t.encode g ∈ M.sets) : s.graph s (a.iso g) ∈ M.sets := by + obtain ⟨B, hB, bounds⟩ := M.exists_pair_bound pairing unions powers carrier carrier + let params := extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)) + have selected := M.separation_mem separation (BoundedFormula.actionSectionEntryFormula 0 1 2 3).toFormula + params (Fin.cases hg (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j)))) hB + have eq : ZFSet.sep (fun z => Realize M.sets + (BoundedFormula.actionSectionEntryFormula 0 1 2 3).toFormula (extend z params)) B = + s.graph s (a.iso g) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (M.realize_actionSectionEntry a s t g z hg (M.transitive hB hz) graph carrier).1 rel + · intro hz + have hzB : z ∈ B := by + obtain ⟨p, eq⟩ := (s.mem_graph s (a.iso g) z).1 hz + exact eq ▸ bounds _ (s.encode_mem p) _ (s.encode_mem (a.iso g p)) + exact ⟨hzB, (M.realize_actionSectionEntry a s t g z hg (M.transitive hB hzB) graph carrier).2 hz⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {X Y G : Type u} [Group G] [PartialOrder X] +variable (a : PosetAction G X) (s : Presentation X) (t : Presentation Y) (b : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {N : ZFSet.{u}} (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) +variable (hG : b.carrier ∈ M.sets) (hN : N ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) + +noncomputable def smallFunctionAction : + letI := M.smallFunctionOrder s.carrier t.carrier N + PosetAction G (SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) := by + letI := M.smallFunctionOrder s.carrier t.carrier N + have maps (g : G) : s.graph s (a.iso g).toEquiv ∈ M.sets := + M.actionGraph_section_mem a s b pairing unions powers separation hX graph g + (M.transitive hG (b.encode_mem g)) + let iso (g : G) := M.renameSmallOrderIso s t pairing unions powers separation hX hY hN + (a.iso g).toEquiv (maps g) + have raw (g : G) (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : + SetMembers.raw (iso g p) = graphRename s t (a.iso g).toEquiv (SetMembers.raw p) := + M.raw_renameSmallOrderIso s t pairing unions powers separation hX hY hN (a.iso g).toEquiv (maps g) p + exact { + iso := iso + one := by + intro p + apply SetMembers.raw_injective + rw [raw] + have eq : (a.iso 1).toEquiv = Equiv.refl X := by + apply Equiv.ext + exact a.one + rw [eq] + exact graphRename_refl s t (M.smallFunction_raw_properties s.carrier t.carrier N p).2.1.shape + mul := by + intro g h p + apply SetMembers.raw_injective + rw [raw, raw, raw] + have eq : (a.iso (g * h)).toEquiv = (a.iso h).toEquiv.trans (a.iso g).toEquiv := by + apply Equiv.ext + exact a.mul g h + rw [eq] + exact (graphRename_comp s t (a.iso h).toEquiv (a.iso g).toEquiv (SetMembers.raw p)).symm } + +theorem raw_smallFunctionAction (g : G) (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : + letI := M.smallFunctionOrder s.carrier t.carrier N + SetMembers.raw ((M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).iso g p) = + graphRename s t (a.iso g).toEquiv (SetMembers.raw p) := SetMembers.raw_ofMem _ _ + +theorem smallFunctionAction_entry (g : G) (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) + (x : X) (y : Y) : + letI := M.smallFunctionOrder s.carrier t.carrier N + ZFSet.pair (s.encode (a.iso g x)) (t.encode y) ∈ + SetMembers.raw ((M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).iso g p) ↔ + ZFSet.pair (s.encode x) (t.encode y) ∈ SetMembers.raw p := by + let := M.smallFunctionOrder s.carrier t.carrier N + rw [raw_smallFunctionAction, pair_mem_graphRename] + change ZFSet.pair (s.encode ((a.iso g).toEquiv.symm ((a.iso g).toEquiv x))) (t.encode y) ∈ _ ↔ _ + rw [(a.iso g).toEquiv.symm_apply_apply] + +end PartitionPilot.Forcing.TransitiveGround + +section + +namespace PartitionPilot.Forcing.SetFormula + +def actionMapPairFormula : SetFormula 4 := + ex (.conj (BoundedFormula.orderedPairFormula 2 1 0).toFormula + (BoundedFormula.actionSectionFormula 0 1 3 4).toFormula) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem realize_actionMapPairFormula (g : G) (z : ZFSet.{u}) + (hg : t.encode g ∈ M.sets) (hz : z ∈ M.sets) + (graph : a.actionGraph s t ∈ M.sets) (carrier : s.carrier ∈ M.sets) + (section_mem : s.graph s (a.iso g) ∈ M.sets) : + Realize M.sets actionMapPairFormula + (extend (t.encode g) (extend z (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) ↔ + z = ZFSet.pair (t.encode g) (s.graph s (a.iso g)) := by + rw [actionMapPairFormula, realize_ex] + constructor + · rintro ⟨F, hF, pair, rel⟩ + have members : ∀ j, (extend F (extend (t.encode g) (extend z + (extend (a.actionGraph s t) (extend s.carrier Fin.elim0))))) j ∈ M.sets := + Fin.cases hF (Fin.cases hg (Fin.cases hz (Fin.cases graph + (Fin.cases carrier (fun j => Fin.elim0 j))))) + have shape := (BoundedFormula.truth_orderedPairFormula 2 1 0 _).1 + ((BoundedFormula.realize_toFormula M _ _ members).1 pair) + have raw := (BoundedFormula.realize_toFormula M _ _ members).1 rel + change BoundedFormula.Truth (BoundedFormula.actionSectionFormula 0 1 2 3) + (extend F (extend (t.encode g) (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) at raw + have eq := (BoundedFormula.actionSection_correct a s t g F).1 raw + change z = ZFSet.pair (t.encode g) F at shape + exact eq ▸ shape + · intro eq + refine ⟨s.graph s (a.iso g), section_mem, ?_, ?_⟩ + · apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases section_mem (Fin.cases hg + (Fin.cases hz (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j))))))).2 + exact (BoundedFormula.truth_orderedPairFormula 2 1 0 _).2 eq + · apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases section_mem (Fin.cases hg + (Fin.cases hz (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j))))))).2 + change BoundedFormula.Truth (BoundedFormula.actionSectionFormula 0 1 2 3) + (extend (s.graph s (a.iso g)) (extend (t.encode g) + (extend (a.actionGraph s t) (extend s.carrier Fin.elim0)))) + exact (BoundedFormula.actionSection_correct a s t g _).2 rfl + +theorem conditionMapFamily_mem_of_actionGraph + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (graph : a.actionGraph s t ∈ M.sets) : a.conditionMapFamily s t ∈ M.sets := by + have hg (g : G) := M.transitive group (t.encode_mem g) + have sections (g : G) := M.actionGraph_section_mem a s t pairing unions powers separation carrier graph g (hg g) + let params := extend (a.actionGraph s t) (extend s.carrier Fin.elim0) + apply M.definable_image_mem separation collection actionMapPairFormula params + (Fin.cases graph (Fin.cases carrier (fun j => Fin.elim0 j))) group + · intro z hz + obtain ⟨g, eq⟩ := ZFSet.mem_range.1 hz + exact eq ▸ M.orderedPair_mem pairing (hg g) (sections g) + · intro z hz + change z ∈ ZFSet.range (fun g : G => ZFSet.pair (t.encode g) (s.graph s (a.iso g))) ↔ _ + rw [ZFSet.mem_range] + constructor + · rintro ⟨g, eq⟩ + exact ⟨t.encode g, t.encode_mem g, + (M.realize_actionMapPairFormula a s t g z (hg g) hz graph carrier (sections g)).2 eq.symm⟩ + · rintro ⟨x, hx, rel⟩ + obtain ⟨g, rfl⟩ := (t.mem_carrier x).1 hx + exact ⟨g, ((M.realize_actionMapPairFormula a s t g z (hg g) hz graph carrier (sections g)).1 rel).symm⟩ + · intro x hx y hy z hz rely relz + obtain ⟨g, rfl⟩ := (t.mem_carrier x).1 hx + exact ((M.realize_actionMapPairFormula a s t g y (hg g) hy graph carrier (sections g)).1 rely).trans + ((M.realize_actionMapPairFormula a s t g z (hg g) hz graph carrier (sections g)).1 relz).symm + +end PartitionPilot.Forcing.TransitiveGround + +end + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageOneActionParameters (M : TransitiveGround.{u}) (a : PosetAction G P) + (s : Presentation P) (t : Presentation G) (b : Presentation L) (d : PosetAction G L) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Prop where + condition_maps : a.conditionMapFamily s t ∈ M.sets + node_maps : d.conditionMapFamily b t ∈ M.sets + terms_closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T + pairs_closed : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2 + family_ground : (Name.familySet ⊤ T valid).val ∈ M.sets + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {L G : Type u} [PartialOrder L] [OrderBot L] [Group G] + +noncomputable def rowPositionSequenceAction (a : PosetAction G L) (s : Presentation L) + (g : G) (mu f : ZFSet.{u}) : ZFSet.{u} := + relationCompose mu s.nonbottom.carrier s.nonbottom.carrier f + (s.nonbottom.graph s.nonbottom (a.nonbottom.iso g)) + +theorem pair_mem_rowPositionSequenceAction (a : PosetAction G L) (s : Presentation L) + (g : G) (mu f i : ZFSet.{u}) (x : {x : L // x ≠ ⊥}) : + ZFSet.pair i (s.encode (a.iso g x.val)) ∈ rowPositionSequenceAction a s g mu f ↔ + i ∈ mu ∧ ZFSet.pair i (s.encode x.val) ∈ f := by + rw [rowPositionSequenceAction, pair_mem_relationCompose] + constructor + · rintro ⟨hi, _, y, hy, entry, moved⟩ + obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy + have equal := (s.nonbottom.pair_mem_graph s.nonbottom (a.nonbottom.iso g) + y (a.nonbottom.iso g x)).1 moved + have same := (a.nonbottom.iso g).injective equal + exact ⟨hi, same ▸ entry⟩ + · rintro ⟨hi, entry⟩ + exact ⟨hi, s.nonbottom.encode_mem (a.nonbottom.iso g x), s.encode x.val, + s.nonbottom.encode_mem x, entry, + (s.nonbottom.pair_mem_graph s.nonbottom (a.nonbottom.iso g) x _).2 rfl⟩ + +theorem rowPositionSequenceAction_function (a : PosetAction G L) (s : Presentation L) + (g : G) {mu delta f : ZFSet.{u}} (subset : delta ⊆ mu) + (function : ZFSet.IsFunc delta s.nonbottom.carrier f) : + ZFSet.IsFunc delta s.nonbottom.carrier (rowPositionSequenceAction a s g mu f) := by + constructor + · intro z hz + obtain ⟨i, _, y, _, x, hx, rfl, entry, _⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨(ZFSet.pair_mem_prod.1 (function.1 entry)).1, hx⟩ + · intro i hi + obtain ⟨x, entry, unique⟩ := function.2 i hi + obtain ⟨x, rfl⟩ := (s.nonbottom.mem_carrier x).1 + (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + refine ⟨s.encode (a.iso g x.val), + (pair_mem_rowPositionSequenceAction a s g mu f i x).2 ⟨subset hi, entry⟩, ?_⟩ + intro y hy + have hyI := ((pair_mem_relationCompose _ _ _ _ _ i y).1 hy).2.1 + obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hyI + let old := (a.nonbottom.iso g).symm y + have target : a.nonbottom.iso g old = y := (a.nonbottom.iso g).apply_symm_apply y + have original : ZFSet.pair i (s.encode old.val) ∈ f := by + apply ((pair_mem_rowPositionSequenceAction a s g mu f i old).1 ?_).2 + simpa only [← PosetAction.nonbottom_iso_val, target, Presentation.nonbottom_encode] using hy + have same : old = x := s.nonbottom.injective (unique _ original) + exact congrArg s.nonbottom.encode ((congrArg (a.nonbottom.iso g) same).symm.trans target).symm + +theorem rowPositionSequenceAction_code (a : PosetAction G L) (s : Presentation L) + (g : G) {mu f : ZFSet.{u}} (ordinal : ordinalSetProperty mu) + (code : RowPositionSequenceCode s.carrier s.conditionOrder s.nonbottom.carrier mu f) : + RowPositionSequenceCode s.carrier s.conditionOrder s.nonbottom.carrier mu + (rowPositionSequenceAction a s g mu f) := by + obtain ⟨delta, length, function, d, hd, bounds⟩ := code + have subset := (rowPositionSequence_length ordinal length).2 + obtain ⟨D, rfl⟩ := (s.mem_carrier d).1 hd + have movedFunction := rowPositionSequenceAction_function a s g subset function + refine ⟨delta, length, movedFunction, s.encode (a.iso g D), s.encode_mem _, ?_⟩ + intro i x entry + obtain ⟨_, _, y, hy, original, moved⟩ := (pair_mem_relationCompose _ _ _ _ _ i x).1 entry + obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy + obtain ⟨v, hv⟩ := (s.nonbottom.mem_graph s.nonbottom (a.nonbottom.iso g) _).1 moved + obtain ⟨same, value⟩ := ZFSet.pair_inj.1 hv + have equal : v = y := s.nonbottom.injective same + have lower := (s.pair_mem_conditionOrder y.val D).1 (bounds i _ original) + have result := (s.pair_mem_conditionOrder (a.iso g y.val) (a.iso g D)).2 ((a.iso g).monotone lower) + rw [equal] at value + exact value ▸ result + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem rowPositionSequenceAction_mem (a : PosetAction G L) (s : Presentation L) (b : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hL : s.carrier ∈ M.sets) (hG : b.carrier ∈ M.sets) + (graph : a.actionGraph s b ∈ M.sets) {mu f : ZFSet.{u}} + (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) (g : G) + (member : f ∈ M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu) : + rowPositionSequenceAction a s g mu f ∈ + M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu := by + obtain ⟨hf, code⟩ := (M.mem_rowPositionSequences ordinal).1 member + have hI := M.nonbottom_carrier_mem s separation hL + have ha := M.nonbottom_actionGraph_mem a s b separation hL hG graph + have actionSection := M.actionGraph_section_mem a.nonbottom s.nonbottom b pairing unions powers + separation hI ha g (M.transitive hG (b.encode_mem g)) + exact (M.mem_rowPositionSequences ordinal).2 + ⟨M.relationCompose_mem pairing unions powers separation hmu hI hI hf actionSection, + rowPositionSequenceAction_code a s g ordinal code⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) + +theorem decoded_conditionMapFamily_mem {G P m i e R A : ZFSet.{u}} + (group : GroupCode G m i e) (order : PartialOrderCode P R) + (action : PosetActionCode G P m e R A) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : + letI := group.toGroup + letI := order.toPartialOrder + (action.toPosetAction group order).conditionMapFamily + (SetMembers.presentation P) (SetMembers.presentation G) ∈ M.sets := by + let := group.toGroup + let := order.toPartialOrder + apply M.conditionMapFamily_mem_of_actionGraph (action.toPosetAction group order) + (SetMembers.presentation P) (SetMembers.presentation G) pairing unions powers separation collection hP hG + rw [action.actionGraph_eq group order] + exact hA + +variable {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem exists_ZF_interpretation_from_actionGraph (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (graph : a.actionGraph s t ∈ M.sets) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ + M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ + ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) := + M.exists_ZF_interpretation a s t b F K basis small pairing unions powers separation collection infinite + carrier order group indices supports + (M.conditionMapFamily_mem_of_actionGraph a s t pairing unions powers separation collection carrier group graph) p + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P : Type u} +variable [Group G] [PartialOrder R] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +variable (rowAction : PosetAction G R) (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) +local notation "Q" => M.flatSuccessorCarrier c s I T levels alpha tests +local notation "J" => stageOneAssignments I T +local notation "B" => M.groundSmallSubsets J ZFSet.omega +local notation "assignmentFamily" => familyCodeGraph t.encode assignmentGraph + +noncomputable def flatSuccessorFullActionGraph : ZFSet.{u} := + rowAssignmentActionGraph t.carrier Q c.carrier B J + (rowAction.conditionMapFamily c t) assignmentFamily + +theorem flatSuccessorFullActionGraph_entry (g : G) (p q : R) (A D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode p) A)) (ZFSet.pair (c.encode q) D) ∈ + M.flatSuccessorFullActionGraph c s I T levels alpha tests rowAction t assignmentGraph ↔ + ZFSet.pair (c.encode p) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ rowAction.iso g p = q ∧ + D = relationImage A J (assignmentGraph g) := by + rw [flatSuccessorFullActionGraph, pair_mem_rowAssignmentActionGraph] + constructor + · rintro ⟨_,source,target,_,_,_,_,rf,af,indexed,row,indexedA,image⟩ + have rowEq := (rowAction.pair_mem_conditionMapFamily c t g rf).1 indexed + have assignmentEq := (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g af).1 indexedA + rw [assignmentEq] at image + exact ⟨source,target,(c.pair_mem_graph c (rowAction.iso g) p q).1 (rowEq ▸ row),image⟩ + · rintro ⟨source,target,moved,image⟩ + have sourceBound := ZFSet.pair_mem_prod.1 + (M.flatSuccessorCarrier_subset c s I T levels alpha tests source) + have targetBound := ZFSet.pair_mem_prod.1 + (M.flatSuccessorCarrier_subset c s I T levels alpha tests target) + exact ⟨t.encode_mem g,source,target,sourceBound.1,sourceBound.2,targetBound.1,targetBound.2, + _,_,(rowAction.pair_mem_conditionMapFamily c t g _).2 rfl, + (c.pair_mem_graph c (rowAction.iso g) p q).2 moved, + (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g _).2 rfl,image⟩ + +theorem flatSuccessorFullActionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (rows : c.carrier ∈ M.sets) (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) + (assignments : stageOneAssignments I T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (group : t.carrier ∈ M.sets) (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) + (assignmentMaps : familyCodeGraph t.encode assignmentGraph ∈ M.sets) : + M.flatSuccessorFullActionGraph c s I T levels alpha tests rowAction t assignmentGraph ∈ M.sets := + M.rowAssignmentActionGraph_mem pairing unions powers separation group conditions rows + (M.groundSmallSubsets_mem powers separation assignments omega) assignments rowMaps assignmentMaps + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorNameGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorNameGraphs.lean index e8dfb4e773dfc351b5a69173dd21bb675140e430..c440ad93e2f892af1475cc56937e15da2bcded71 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorNameGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundFlatSuccessorNameGraphs.lean @@ -1,128 +1,128 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeSuccessorLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws - -noncomputable def flatSuccessorNameLift (tau : Name s) : Name (pres) := by - let := smallOrder - exact Name.rename (pres) inc tau - -local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws - -theorem flatSuccessorNameLift_val (tau : Name s) : (liftName tau).val = tau.val := by - let := smallOrder - exact Name.rename_val_of_encode (pres) inc - (M.flatSuccessorSmallInclusion_encode c s I T levels alpha tests F laws) tau - -theorem flatSuccessorNameLift_mem (tau : Name s) (ground : tau.val ∈ M.sets) : - (liftName tau).val ∈ M.sets := by - rw [M.flatSuccessorNameLift_val] - exact ground - -theorem flatSuccessorNameLift_eval : - letI := smallOrder - ∀ (H : Set (Shrink Condition)) (tau : Name s), - Name.eval H (liftName tau) = Name.eval {p | inc p ∈ H} tau := by - let := smallOrder - intro H tau - exact Name.eval_rename (pres) inc H tau - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws -local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) - -theorem flatSuccessorSmallInclusion_graph : - letI := smallOrder - s.graph (pres) inc = identityFunctionGraph s.carrier := by - let := smallOrder - apply ZFSet.ext - intro z - rw [Presentation.mem_graph, mem_identityFunctionGraph] - constructor - · rintro ⟨p, rfl⟩ - rw [M.flatSuccessorSmallInclusion_encode] - exact ⟨s.encode p, s.encode_mem p, rfl⟩ - · rintro ⟨x, hx, rfl⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - exact ⟨p, congrArg (ZFSet.pair (s.encode p)) - (M.flatSuccessorSmallInclusion_encode c s I T levels alpha tests F laws p)⟩ - -include pairing unions powers separation carrier in -theorem flatSuccessorSmallInclusion_graph_mem : - letI := smallOrder - s.graph (pres) inc ∈ M.sets := by - let := smallOrder - rw [M.flatSuccessorSmallInclusion_graph] - exact M.identityFunctionGraph_mem pairing unions powers separation carrier - -theorem flatSuccessorNameLiftGraph_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : - letI := smallOrder - Name.renameFamilyGraph (pres) inc X oldValid = identityFunctionGraph X := by - let := smallOrder - apply ZFSet.ext - intro z - rw [Name.mem_renameFamilyGraph, mem_identityFunctionGraph] - constructor - · rintro ⟨tau, member, equal⟩ - have sameCode := M.flatSuccessorNameLift_val c s I T levels alpha tests F laws tau - exact ⟨tau.val, member, equal.trans (congrArg (ZFSet.pair tau.val) sameCode)⟩ - · rintro ⟨x, member, rfl⟩ - let tau : Name s := ⟨x, oldValid x member⟩ - refine ⟨tau, member, ?_⟩ - exact (congrArg (ZFSet.pair x) (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws tau)).symm - -include pairing unions powers separation in -theorem flatSuccessorNameLiftGraph_mem (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) - (ground : X ∈ M.sets) : - letI := smallOrder - Name.renameFamilyGraph (pres) inc X oldValid ∈ M.sets := by - let := smallOrder - rw [M.flatSuccessorNameLiftGraph_eq] - exact M.identityFunctionGraph_mem pairing unions powers separation ground - -noncomputable def flatSuccessorGroundNameLift (tau : (M.nameDomain s).names) : (M.nameDomain (pres)).names := - ⟨liftName tau.val, M.flatSuccessorNameLift_mem c s I T levels alpha tests F laws tau.val tau.property⟩ - -theorem flatSuccessorGroundNameLift_val (tau : (M.nameDomain s).names) : - (M.flatSuccessorGroundNameLift c s I T levels alpha tests F laws tau).val.val = tau.val.val := - M.flatSuccessorNameLift_val c s I T levels alpha tests F laws tau.val - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeSuccessorLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws + +noncomputable def flatSuccessorNameLift (tau : Name s) : Name (pres) := by + let := smallOrder + exact Name.rename (pres) inc tau + +local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws + +theorem flatSuccessorNameLift_val (tau : Name s) : (liftName tau).val = tau.val := by + let := smallOrder + exact Name.rename_val_of_encode (pres) inc + (M.flatSuccessorSmallInclusion_encode c s I T levels alpha tests F laws) tau + +theorem flatSuccessorNameLift_mem (tau : Name s) (ground : tau.val ∈ M.sets) : + (liftName tau).val ∈ M.sets := by + rw [M.flatSuccessorNameLift_val] + exact ground + +theorem flatSuccessorNameLift_eval : + letI := smallOrder + ∀ (H : Set (Shrink Condition)) (tau : Name s), + Name.eval H (liftName tau) = Name.eval {p | inc p ∈ H} tau := by + let := smallOrder + intro H tau + exact Name.eval_rename (pres) inc H tau + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws +local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) + +theorem flatSuccessorSmallInclusion_graph : + letI := smallOrder + s.graph (pres) inc = identityFunctionGraph s.carrier := by + let := smallOrder + apply ZFSet.ext + intro z + rw [Presentation.mem_graph, mem_identityFunctionGraph] + constructor + · rintro ⟨p, rfl⟩ + rw [M.flatSuccessorSmallInclusion_encode] + exact ⟨s.encode p, s.encode_mem p, rfl⟩ + · rintro ⟨x, hx, rfl⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + exact ⟨p, congrArg (ZFSet.pair (s.encode p)) + (M.flatSuccessorSmallInclusion_encode c s I T levels alpha tests F laws p)⟩ + +include pairing unions powers separation carrier in +theorem flatSuccessorSmallInclusion_graph_mem : + letI := smallOrder + s.graph (pres) inc ∈ M.sets := by + let := smallOrder + rw [M.flatSuccessorSmallInclusion_graph] + exact M.identityFunctionGraph_mem pairing unions powers separation carrier + +theorem flatSuccessorNameLiftGraph_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : + letI := smallOrder + Name.renameFamilyGraph (pres) inc X oldValid = identityFunctionGraph X := by + let := smallOrder + apply ZFSet.ext + intro z + rw [Name.mem_renameFamilyGraph, mem_identityFunctionGraph] + constructor + · rintro ⟨tau, member, equal⟩ + have sameCode := M.flatSuccessorNameLift_val c s I T levels alpha tests F laws tau + exact ⟨tau.val, member, equal.trans (congrArg (ZFSet.pair tau.val) sameCode)⟩ + · rintro ⟨x, member, rfl⟩ + let tau : Name s := ⟨x, oldValid x member⟩ + refine ⟨tau, member, ?_⟩ + exact (congrArg (ZFSet.pair x) (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws tau)).symm + +include pairing unions powers separation in +theorem flatSuccessorNameLiftGraph_mem (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) + (ground : X ∈ M.sets) : + letI := smallOrder + Name.renameFamilyGraph (pres) inc X oldValid ∈ M.sets := by + let := smallOrder + rw [M.flatSuccessorNameLiftGraph_eq] + exact M.identityFunctionGraph_mem pairing unions powers separation ground + +noncomputable def flatSuccessorGroundNameLift (tau : (M.nameDomain s).names) : (M.nameDomain (pres)).names := + ⟨liftName tau.val, M.flatSuccessorNameLift_mem c s I T levels alpha tests F laws tau.val tau.property⟩ + +theorem flatSuccessorGroundNameLift_val (tau : (M.nameDomain s).names) : + (M.flatSuccessorGroundNameLift c s I T levels alpha tests F laws tau).val.val = tau.val.val := + M.flatSuccessorNameLift_val c s I T levels alpha tests F laws tau.val + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryLimitConnection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryLimitConnection.lean index f20b3aaaa844ee5e61d42c123c5bd7acc3b48586..c57b11a595cde8fe66fd4f89bf276b0a6ea10bd2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryLimitConnection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryLimitConnection.lean @@ -1,100 +1,100 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatLimitAdequacy -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {stages history T : ZFSet.{u}} -variable (function : FunctionGraphOn stages history) -variable (decoded : ∀ beta data, ZFSet.pair beta data ∈ history → - ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) -variable (literal : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) beta) -variable (commonT : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → d 6 = T) -include function decoded literal commonT - -theorem forcingHistoryRawTests_successor_cut (beta row A : ZFSet.{u}) : - forcingHistoryRawTests M history - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) - beta row (assignmentCut - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) - (insert beta beta) A) ↔ - forcingHistoryRawTests M history - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) - beta row A := by - apply forcingHistoryRawTests_cut_iff M _ _ _ _ _ _ (fun _ member => ZFSet.mem_insert_of_mem beta member) - intro d entry t ht u hu w hw - refine ⟨beta, ZFSet.mem_insert beta beta, ?_⟩ - have indexFunction := refinementDataHistoryField_function function decoded 0 - have indexLiteral := refinementDataHistoryField_index_levels (stages := stages) literal - apply (refinementHistoryAssignmentLevels_entry indexFunction indexLiteral T t u w beta).2 - rw [commonT beta d entry] at hu hw - exact ⟨d 0, (refinementDataHistoryField_entry function d entry 0 _).2 rfl, ht, hu, hw⟩ - -namespace TransitiveGround -variable {rows : ZFSet.{u}} -variable (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) -variable (recursion : FlatOrdinalCarrierRecursion stages (refinementDataHistoryField stages history 7) - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) - (fun beta row A => ZFSet.pair row A ∈ - M.stageOneCandidateBound rows - (refinementHistoryIndices beta (refinementDataHistoryField stages history 0)) T) - (forcingHistoryRawTests M history - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T))) -include successors recursion - -theorem forcingHistoryConditions_eq_flatLimit : - M.forcingHistoryConditions rows - (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T - stages history - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) = - M.flatLimitConditions rows - (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T - stages (refinementDataHistoryField stages history 7) - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) := by - apply ZFSet.ext - intro z - rw [M.mem_forcingHistoryConditions, M.mem_flatLimitConditions] - apply and_congr_right - intro candidate - obtain ⟨row, _, A, _, _, _, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 candidate - rw [flatLimitConditionCode_pair, forcingHistoryConditionCode_pair_decomposition function decoded] - exact ⟨And.left, fun cuts => ⟨cuts, recursion.tests_of_cuts - (fun beta _ row A => forcingHistoryRawTests_successor_cut M function decoded literal commonT beta row A) - successors row A cuts⟩⟩ - -theorem forcingHistoryConditions_iff_all_tests - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (ordinal : ordinalSetProperty stages) - (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.forcingHistoryConditions rows - (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T - stages history - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) ↔ - ZFSet.pair row A ∈ M.stageOneCandidateBound rows - (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T ∧ - ∀ beta ∈ stages, forcingHistoryRawTests M history - (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) - beta row A := by - rw [M.forcingHistoryConditions_eq_flatLimit function decoded literal commonT successors recursion] - exact M.flatLimitConditions_iff_all_tests pairing unions powers separation hStages - (M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0) - hT omega ordinal successors (refinementDataHistoryField_function function decoded 0) - (refinementDataHistoryField_index_levels literal) _ recursion - (fun beta _ row A => forcingHistoryRawTests_successor_cut M function decoded literal commonT beta row A) - row A - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatLimitAdequacy +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {stages history T : ZFSet.{u}} +variable (function : FunctionGraphOn stages history) +variable (decoded : ∀ beta data, ZFSet.pair beta data ∈ history → + ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) +variable (literal : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) beta) +variable (commonT : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → d 6 = T) +include function decoded literal commonT + +theorem forcingHistoryRawTests_successor_cut (beta row A : ZFSet.{u}) : + forcingHistoryRawTests M history + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) + beta row (assignmentCut + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) + (insert beta beta) A) ↔ + forcingHistoryRawTests M history + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) + beta row A := by + apply forcingHistoryRawTests_cut_iff M _ _ _ _ _ _ (fun _ member => ZFSet.mem_insert_of_mem beta member) + intro d entry t ht u hu w hw + refine ⟨beta, ZFSet.mem_insert beta beta, ?_⟩ + have indexFunction := refinementDataHistoryField_function function decoded 0 + have indexLiteral := refinementDataHistoryField_index_levels (stages := stages) literal + apply (refinementHistoryAssignmentLevels_entry indexFunction indexLiteral T t u w beta).2 + rw [commonT beta d entry] at hu hw + exact ⟨d 0, (refinementDataHistoryField_entry function d entry 0 _).2 rfl, ht, hu, hw⟩ + +namespace TransitiveGround +variable {rows : ZFSet.{u}} +variable (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) +variable (recursion : FlatOrdinalCarrierRecursion stages (refinementDataHistoryField stages history 7) + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) + (fun beta row A => ZFSet.pair row A ∈ + M.stageOneCandidateBound rows + (refinementHistoryIndices beta (refinementDataHistoryField stages history 0)) T) + (forcingHistoryRawTests M history + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T))) +include successors recursion + +theorem forcingHistoryConditions_eq_flatLimit : + M.forcingHistoryConditions rows + (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T + stages history + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) = + M.flatLimitConditions rows + (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T + stages (refinementDataHistoryField stages history 7) + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) := by + apply ZFSet.ext + intro z + rw [M.mem_forcingHistoryConditions, M.mem_flatLimitConditions] + apply and_congr_right + intro candidate + obtain ⟨row, _, A, _, _, _, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 candidate + rw [flatLimitConditionCode_pair, forcingHistoryConditionCode_pair_decomposition function decoded] + exact ⟨And.left, fun cuts => ⟨cuts, recursion.tests_of_cuts + (fun beta _ row A => forcingHistoryRawTests_successor_cut M function decoded literal commonT beta row A) + successors row A cuts⟩⟩ + +theorem forcingHistoryConditions_iff_all_tests + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (ordinal : ordinalSetProperty stages) + (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.forcingHistoryConditions rows + (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T + stages history + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) ↔ + ZFSet.pair row A ∈ M.stageOneCandidateBound rows + (refinementHistoryIndices stages (refinementDataHistoryField stages history 0)) T ∧ + ∀ beta ∈ stages, forcingHistoryRawTests M history + (refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T) + beta row A := by + rw [M.forcingHistoryConditions_eq_flatLimit function decoded literal commonT successors recursion] + exact M.flatLimitConditions_iff_all_tests pairing unions powers separation hStages + (M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0) + hT omega ordinal successors (refinementDataHistoryField_function function decoded 0) + (refinementDataHistoryField_index_levels literal) _ recursion + (fun beta _ row A => forcingHistoryRawTests_successor_cut M function decoded literal commonT beta row A) + row A + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryOrders.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryOrders.lean index 2717d1839fd4290b1a1c0e2da5b5bf4b25fdaf01..8d9227a388679f6055187aba9e2f9a464e33c42e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryOrders.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistoryOrders.lean @@ -1,62 +1,62 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RowAssignmentOrderLaws -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementBirthEnumerationFairness - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def refinementHistoryOrder (rows rowOrder T stages history : ZFSet.{u}) : ZFSet.{u} := - rowAssignmentOrder (M.refinementHistoryForcing rows T stages history) rows - (M.groundSmallSubsets (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega) - rowOrder - -theorem refinementHistoryForcing_shape (rows T stages history : ZFSet.{u}) : - M.refinementHistoryForcing rows T stages history ⊆ - ZFSet.prod rows (M.groundSmallSubsets - (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega) := - fun z member => (M.mem_refinementHistoryForcing rows T stages history z).1 member |>.1 - -theorem refinementHistoryOrder_partialOrder {rows rowOrder : ZFSet.{u}} - (order : PartialOrderCode rows rowOrder) (T stages history : ZFSet.{u}) : - PartialOrderCode (M.refinementHistoryForcing rows T stages history) - (M.refinementHistoryOrder rows rowOrder T stages history) := - rowAssignmentOrder_partialOrder (M.refinementHistoryForcing_shape rows T stages history) order - -theorem pair_mem_refinementHistoryOrder (rows rowOrder T stages history q A p D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ M.refinementHistoryOrder rows rowOrder T stages history ↔ - ZFSet.pair q A ∈ M.refinementHistoryForcing rows T stages history ∧ - ZFSet.pair p D ∈ M.refinementHistoryForcing rows T stages history ∧ - ZFSet.pair q p ∈ rowOrder ∧ D ⊆ A := by - rw [refinementHistoryOrder, pair_mem_rowAssignmentOrder] - constructor - · rintro ⟨hq, hp, _, _, _, _, below, data⟩ - exact ⟨hq, hp, below, data⟩ - · rintro ⟨hq, hp, below, data⟩ - have qShape := ZFSet.pair_mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history hq) - have pShape := ZFSet.pair_mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history hp) - exact ⟨hq, hp, qShape.1, qShape.2, pShape.1, pShape.2, below, data⟩ - -theorem refinementHistoryOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {rows rowOrder T stages history : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hOrder : rowOrder ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.refinementHistoryOrder rows rowOrder T stages history ∈ M.sets := - M.rowAssignmentOrder_mem pairing unions powers separation - (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega) - hRows (M.groundSmallSubsets_mem powers separation - (M.stageOneAssignments_mem pairing unions powers separation - (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) hT) omega) hOrder - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RowAssignmentOrderLaws +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementBirthEnumerationFairness + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def refinementHistoryOrder (rows rowOrder T stages history : ZFSet.{u}) : ZFSet.{u} := + rowAssignmentOrder (M.refinementHistoryForcing rows T stages history) rows + (M.groundSmallSubsets (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega) + rowOrder + +theorem refinementHistoryForcing_shape (rows T stages history : ZFSet.{u}) : + M.refinementHistoryForcing rows T stages history ⊆ + ZFSet.prod rows (M.groundSmallSubsets + (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega) := + fun z member => (M.mem_refinementHistoryForcing rows T stages history z).1 member |>.1 + +theorem refinementHistoryOrder_partialOrder {rows rowOrder : ZFSet.{u}} + (order : PartialOrderCode rows rowOrder) (T stages history : ZFSet.{u}) : + PartialOrderCode (M.refinementHistoryForcing rows T stages history) + (M.refinementHistoryOrder rows rowOrder T stages history) := + rowAssignmentOrder_partialOrder (M.refinementHistoryForcing_shape rows T stages history) order + +theorem pair_mem_refinementHistoryOrder (rows rowOrder T stages history q A p D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ M.refinementHistoryOrder rows rowOrder T stages history ↔ + ZFSet.pair q A ∈ M.refinementHistoryForcing rows T stages history ∧ + ZFSet.pair p D ∈ M.refinementHistoryForcing rows T stages history ∧ + ZFSet.pair q p ∈ rowOrder ∧ D ⊆ A := by + rw [refinementHistoryOrder, pair_mem_rowAssignmentOrder] + constructor + · rintro ⟨hq, hp, _, _, _, _, below, data⟩ + exact ⟨hq, hp, below, data⟩ + · rintro ⟨hq, hp, below, data⟩ + have qShape := ZFSet.pair_mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history hq) + have pShape := ZFSet.pair_mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history hp) + exact ⟨hq, hp, qShape.1, qShape.2, pShape.1, pShape.2, below, data⟩ + +theorem refinementHistoryOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {rows rowOrder T stages history : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hOrder : rowOrder ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.refinementHistoryOrder rows rowOrder T stages history ∈ M.sets := + M.rowAssignmentOrder_mem pairing unions powers separation + (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega) + hRows (M.groundSmallSubsets_mem powers separation + (M.stageOneAssignments_mem pairing unions powers separation + (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) hT) omega) hOrder + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistorySuccessors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistorySuccessors.lean index 52207a802141fec111805459774a27b1adddb31e..1651ffc362f4f84f3b4a1a35137a7c977b4ec331 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistorySuccessors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundForcingHistorySuccessors.lean @@ -1,355 +1,355 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ForcingHistoryConditionFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.FiniteFlatHistoryCoherence - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def stageTwoConditions (rawRowCarrier I levels alpha : ZFSet.{u}) - (d : Fin 15 → ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (StageTwoConditionCode M levels alpha d) - (M.stageOneCandidateBound rawRowCarrier I (d 6)) - -theorem mem_stageTwoConditions (rawRowCarrier I levels alpha : ZFSet.{u}) - (d : Fin 15 → ZFSet.{u}) (z : ZFSet.{u}) : - z ∈ M.stageTwoConditions rawRowCarrier I levels alpha d ↔ - z ∈ M.stageOneCandidateBound rawRowCarrier I (d 6) ∧ - StageTwoConditionCode M levels alpha d z := ZFSet.mem_sep - -theorem pair_mem_stageTwoConditions (rawRowCarrier I levels alpha : ZFSet.{u}) - (d : Fin 15 → ZFSet.{u}) (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.stageTwoConditions rawRowCarrier I levels alpha d ↔ - row ∈ rawRowCarrier ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I (d 6) ∧ - M.groundEmbeddable A ZFSet.omega ∧ - ZFSet.pair row (assignmentCut levels alpha A) ∈ d 7 ∧ - stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels alpha A)) := by - rw [M.mem_stageTwoConditions, M.pair_mem_stageOneCandidateBound] - constructor - · rintro ⟨⟨hr, hA, subset, small⟩, row', A', equal, lower, tests⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_injective equal - exact ⟨hr, hA, subset, small, lower, tests⟩ - · rintro ⟨hr, hA, subset, small, lower, tests⟩ - exact ⟨⟨hr, hA, subset, small⟩, row, A, rfl, lower, tests⟩ - -theorem stageTwoConditions_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {rawRowCarrier I levels alpha : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) - (hRow : rawRowCarrier ∈ M.sets) (hI : I ∈ M.sets) - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (members : ∀ j, d j ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.stageTwoConditions rawRowCarrier I levels alpha d ∈ M.sets := by - have bound := M.stageOneCandidateBound_mem pairing unions powers separation - hRow hI (members 6) omega - let params : Fin 17 → ZFSet.{u} := extend levels (extend alpha d) - have ground : ∀ j, params j ∈ M.sets := Fin.cases hLevels (Fin.cases hAlpha members) - let phi : SetFormula 18 := stageTwoConditionFormula (fun j => j.succ.succ.succ) 1 2 0 - have selected := M.separation_mem separation phi params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets phi (extend z params)) - (M.stageOneCandidateBound rawRowCarrier I (d 6)) = - M.stageTwoConditions rawRowCarrier I levels alpha d := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_stageTwoConditions] - apply and_congr_right - intro hz - exact M.realize_stageTwoConditionFormula pairing separation - (fun j => j.succ.succ.succ) 1 2 0 (extend z params) - (Fin.cases (M.transitive bound hz) ground) - exact equal ▸ selected - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (rawRowCarrier I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid -local notation "levels" => stageTwoAssignmentLevels I0 I1 T -local notation "data" => M.refinementLevelFormulaData a s b d (natSetCode 1) T T2 valid - -noncomputable def stageTwoForcing : ZFSet.{u} := - M.stageTwoConditions rawRowCarrier (I0 ∪ I1) levels (natSetCode 1) data - -theorem stageTwoForcing_raw_entry (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid ↔ - row ∈ rawRowCarrier ∧ - A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ - ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∈ s.carrier ∧ - stageOneRawTests M data A (ZFSet.pair row (assignmentCut levels (natSetCode 1) A)) := by - rw [stageTwoForcing, M.pair_mem_stageTwoConditions, M.mem_groundSmallSubsets] - exact ⟨fun h => ⟨h.1, ⟨h.2.1, h.2.2.1, h.2.2.2.1⟩, h.2.2.2.2⟩, - fun h => ⟨h.1, h.2.1.1, h.2.1.2.1, h.2.1.2.2, h.2.2⟩⟩ - -theorem stageTwoForcing_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hRow : rawRowCarrier ∈ M.sets) (hI0 : I0 ∈ M.sets) - (hT : T ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (valid2 : ∀ z ∈ T2, IsName s z) - (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (system : NiceNameSystem M a s b d base directed T valid) - (omega : ZFSet.omega ∈ M.sets) : - M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid ∈ M.sets := by - have hI1 := indices.index_ground - have hLevels := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT - have hOne : natSetCode 1 ∈ M.sets := M.transitive omega (natSetCode_mem_omega 1) - exact M.stageTwoConditions_mem pairing unions powers separation data hRow - (M.binary_union_mem pairing unions hI0 hI1) hLevels hOne - (M.refinementLevelFormulaData_members a s b d (natSetCode 1) T T2 valid - pairing unions powers separation hT carrier order nodes nodeOrder valid2 indices base directed system) omega - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (rawRowCarrier I0 I1 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -local notation "data" => M.refinementLevelFormulaData a s b d (natSetCode 2) T T2 valid - -noncomputable def stageThreeForcing : ZFSet.{u} := - M.stageTwoConditions rawRowCarrier ((I0 ∪ I1) ∪ I2) levels (natSetCode 2) data - -theorem stageThreeForcing_raw_entry (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid ↔ - row ∈ rawRowCarrier ∧ - A ∈ M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ - ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∈ s.carrier ∧ - stageOneRawTests M data A (ZFSet.pair row (assignmentCut levels (natSetCode 2) A)) := by - rw [stageThreeForcing, M.pair_mem_stageTwoConditions, M.mem_groundSmallSubsets] - exact ⟨fun h => ⟨h.1, ⟨h.2.1, h.2.2.1, h.2.2.2.1⟩, h.2.2.2.2⟩, - fun h => ⟨h.1, h.2.1.1, h.2.1.2.1, h.2.1.2.2, h.2.2⟩⟩ - -theorem stageThreeForcing_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hRow : rawRowCarrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (hT : T ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (valid2 : ∀ z ∈ T2, IsName s z) - (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (system : NiceNameSystem M a s b d base directed T valid) - (omega : ZFSet.omega ∈ M.sets) : - M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid ∈ M.sets := by - have hI2 := indices.index_ground - have hLevels := M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 hI2 hT - have hTwo : natSetCode 2 ∈ M.sets := M.transitive omega (natSetCode_mem_omega 2) - exact M.stageTwoConditions_mem pairing unions powers separation data hRow - (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) hLevels hTwo - (M.refinementLevelFormulaData_members a s b d (natSetCode 2) T T2 valid - pairing unions powers separation hT carrier order nodes nodeOrder valid2 indices base directed system) omega - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -theorem stageTwoForcing_empty (rawRowCarrier I0 : ZFSet.{u}) - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (hRow : rawRowCarrier ∈ M.sets) {row : ZFSet.{u}} (rowMem : row ∈ rawRowCarrier) - (lower : ZFSet.pair row ∅ ∈ s.carrier) : - ZFSet.pair row ∅ ∈ M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid := by - apply (M.stageTwoForcing_raw_entry rawRowCarrier I0 a s b d T T2 valid row ∅).2 - have small : (∅ : ZFSet.{u}) ∈ M.groundSmallSubsets - (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) - ZFSet.omega := - (M.mem_groundSmallSubsets _ _ ∅).2 - ⟨M.empty_mem ⟨rawRowCarrier, hRow⟩, ZFSet.empty_subset _, - M.empty_groundEmbeddable ZFSet.omega ⟨rawRowCarrier, hRow⟩⟩ - have cut : ∀ levels alpha : ZFSet.{u}, assignmentCut levels alpha ∅ = ∅ := by - intro levels alpha - apply ZFSet.ext - intro z - rw [mem_assignmentCut] - exact ⟨fun h => h.1, fun h => False.elim (ZFSet.notMem_empty z h)⟩ - refine ⟨rowMem, small, ?_, ?_⟩ - · rw [cut] - exact lower - · constructor - · intro t ht u hu w hw entry - exact False.elim (ZFSet.notMem_empty _ entry) - · intro t ht u hu u' hu' w hw w' hw' entry - exact False.elim (ZFSet.notMem_empty _ entry) - -theorem stageThreeForcing_empty (rawRowCarrier I0 I1 : ZFSet.{u}) - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (hRow : rawRowCarrier ∈ M.sets) {row : ZFSet.{u}} (rowMem : row ∈ rawRowCarrier) - (lower : ZFSet.pair row ∅ ∈ s.carrier) : - ZFSet.pair row ∅ ∈ M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid := by - apply (M.stageThreeForcing_raw_entry rawRowCarrier I0 I1 a s b d T T2 valid row ∅).2 - have small : (∅ : ZFSet.{u}) ∈ M.groundSmallSubsets - (stageOneAssignments ((I0 ∪ I1) ∪ M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) T) - ZFSet.omega := - (M.mem_groundSmallSubsets _ _ ∅).2 - ⟨M.empty_mem ⟨rawRowCarrier, hRow⟩, ZFSet.empty_subset _, - M.empty_groundEmbeddable ZFSet.omega ⟨rawRowCarrier, hRow⟩⟩ - have cut : ∀ levels alpha : ZFSet.{u}, assignmentCut levels alpha ∅ = ∅ := by - intro levels alpha - apply ZFSet.ext - intro z - rw [mem_assignmentCut] - exact ⟨fun h => h.1, fun h => False.elim (ZFSet.notMem_empty z h)⟩ - refine ⟨rowMem, small, ?_, ?_⟩ - · rw [cut] - exact lower - · constructor - · intro t ht u hu w hw entry - exact False.elim (ZFSet.notMem_empty _ entry) - · intro t ht u hu u' hu' w hw w' hw' entry - exact False.elim (ZFSet.notMem_empty _ entry) - -end - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def forcingHistoryConditions (rows I T stages history levels : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (ForcingHistoryConditionCode M stages history levels) (M.stageOneCandidateBound rows I T) - -theorem mem_forcingHistoryConditions (rows I T stages history levels z : ZFSet.{u}) : - z ∈ M.forcingHistoryConditions rows I T stages history levels ↔ - z ∈ M.stageOneCandidateBound rows I T ∧ ForcingHistoryConditionCode M stages history levels z := - ZFSet.mem_sep - -theorem pair_mem_forcingHistoryConditions (rows I T stages history levels row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.forcingHistoryConditions rows I T stages history levels ↔ - row ∈ rows ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I T ∧ - M.groundEmbeddable A ZFSet.omega ∧ - ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) := by - rw [M.mem_forcingHistoryConditions, M.pair_mem_stageOneCandidateBound] - exact ⟨fun h => ⟨h.1.1, h.1.2.1, h.1.2.2.1, h.1.2.2.2, h.2⟩, - fun h => ⟨⟨h.1, h.2.1, h.2.2.1, h.2.2.2.1⟩, h.2.2.2.2⟩⟩ - -theorem forcingHistoryConditions_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {rows I T stages history levels : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hLevels : levels ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.forcingHistoryConditions rows I T stages history levels ∈ M.sets := by - have bound := M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega - let params : Fin 3 → ZFSet.{u} := ![stages, history, levels] - have ground : ∀ j, params j ∈ M.sets := - Fin.cases hStages (Fin.cases hHistory (Fin.cases hLevels (fun j => Fin.elim0 j))) - have selected := M.separation_mem separation (forcingHistoryConditionFormula 1 2 3 0) params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets (forcingHistoryConditionFormula 1 2 3 0) - (extend z params)) (M.stageOneCandidateBound rows I T) = - M.forcingHistoryConditions rows I T stages history levels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_forcingHistoryConditions] - apply and_congr_right - intro member - exact M.realize_forcingHistoryConditionFormula pairing separation 1 2 3 0 (extend z params) - (Fin.cases (M.transitive bound member) ground) - exact equal ▸ selected - -theorem forcingHistoryConditions_empty (rows I T history levels : ZFSet.{u}) : - M.forcingHistoryConditions rows I T ∅ history levels = M.stageOneCandidateBound rows I T := by - apply ZFSet.ext - intro z - rw [M.mem_forcingHistoryConditions] - exact ⟨And.left, fun member => ⟨member, forcingHistoryConditionCode_empty M history levels z⟩⟩ - -theorem forcingHistoryConditions_initial {rows : ZFSet.{u}} (hRows : rows ∈ M.sets) - (T history levels : ZFSet.{u}) : - M.forcingHistoryConditions rows ∅ T ∅ history levels = ZFSet.prod rows {∅} := by - rw [M.forcingHistoryConditions_empty] - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨row, hrow, A, _, subset, _, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 member - have empty : A = ∅ := by - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨t, ht, _, _, _, _, _⟩ := (mem_stageOneAssignments ∅ T x).1 (subset hx) - exact False.elim (ZFSet.notMem_empty t ht) - · intro hx - exact False.elim (ZFSet.notMem_empty x hx) - exact ZFSet.pair_mem_prod.2 ⟨hrow, ZFSet.mem_singleton.2 empty⟩ - · intro member - obtain ⟨row, hrow, A, hA, rfl⟩ := ZFSet.mem_prod.1 member - obtain rfl := ZFSet.mem_singleton.1 hA - exact M.stageOneCandidateBound_empty hRows hrow - -theorem forcingHistoryConditions_restrict {rows I T stages earlier history levels z : ZFSet.{u}} - (member : z ∈ M.forcingHistoryConditions rows I T stages history levels) (subset : earlier ⊆ stages) : - z ∈ M.forcingHistoryConditions rows I T earlier (graphRestriction earlier history) levels := by - obtain ⟨candidate, valid⟩ := (M.mem_forcingHistoryConditions _ _ _ _ _ _ _).1 member - exact (M.mem_forcingHistoryConditions _ _ _ _ _ _ _).2 - ⟨candidate, forcingHistoryConditionCode_mono valid subset⟩ - -theorem forcingHistoryConditions_successor_eq - (rows oldI I alpha history levels : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) - (function : FunctionGraphOn alpha history) (ordinal : ordinalSetProperty alpha) - (coverage : ForcingHistoryLevelCoverage alpha history levels) - (lower : d 7 = M.forcingHistoryConditions rows oldI (d 6) alpha history levels) : - M.forcingHistoryConditions rows I (d 6) (insert alpha alpha) - (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) levels = - M.stageTwoConditions rows I levels alpha d := by - apply ZFSet.ext - intro z - rw [M.mem_forcingHistoryConditions, M.mem_stageTwoConditions, - forcingHistoryConditionCode_insert_iff function (ZFSet.mem_irrefl alpha), - packedSuccessorConditionCode_code_iff] - constructor - · rintro ⟨candidate, _, current⟩ - exact ⟨candidate, current⟩ - · rintro ⟨candidate, current⟩ - obtain ⟨row, A, equal, member, tests⟩ := current - rw [lower] at member - have priorCut := ((M.mem_forcingHistoryConditions rows oldI (d 6) alpha history levels _).1 member).2 - have prior := (forcingHistoryConditionCode_ordinalCut_iff M alpha history levels alpha row A - ordinal (fun _ hx => hx) coverage).1 priorCut - exact ⟨candidate, equal.symm ▸ prior, row, A, equal, lower.symm ▸ member, tests⟩ - -theorem forcingHistoryConditions_successor_pair_iff - (rows oldI I alpha history levels : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) - (function : FunctionGraphOn alpha history) (ordinal : ordinalSetProperty alpha) - (coverage : ForcingHistoryLevelCoverage alpha history levels) - (lower : d 7 = M.forcingHistoryConditions rows oldI (d 6) alpha history levels) - (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.forcingHistoryConditions rows I (d 6) (insert alpha alpha) - (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) levels ↔ - row ∈ rows ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I (d 6) ∧ - M.groundEmbeddable A ZFSet.omega ∧ - ZFSet.pair row (assignmentCut levels alpha A) ∈ d 7 ∧ - stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels alpha A)) := by - rw [M.forcingHistoryConditions_successor_eq rows oldI I alpha history levels d function ordinal coverage lower] - exact M.pair_mem_stageTwoConditions rows I levels alpha d row A - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ForcingHistoryConditionFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.FiniteFlatHistoryCoherence + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def stageTwoConditions (rawRowCarrier I levels alpha : ZFSet.{u}) + (d : Fin 15 → ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (StageTwoConditionCode M levels alpha d) + (M.stageOneCandidateBound rawRowCarrier I (d 6)) + +theorem mem_stageTwoConditions (rawRowCarrier I levels alpha : ZFSet.{u}) + (d : Fin 15 → ZFSet.{u}) (z : ZFSet.{u}) : + z ∈ M.stageTwoConditions rawRowCarrier I levels alpha d ↔ + z ∈ M.stageOneCandidateBound rawRowCarrier I (d 6) ∧ + StageTwoConditionCode M levels alpha d z := ZFSet.mem_sep + +theorem pair_mem_stageTwoConditions (rawRowCarrier I levels alpha : ZFSet.{u}) + (d : Fin 15 → ZFSet.{u}) (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.stageTwoConditions rawRowCarrier I levels alpha d ↔ + row ∈ rawRowCarrier ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I (d 6) ∧ + M.groundEmbeddable A ZFSet.omega ∧ + ZFSet.pair row (assignmentCut levels alpha A) ∈ d 7 ∧ + stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels alpha A)) := by + rw [M.mem_stageTwoConditions, M.pair_mem_stageOneCandidateBound] + constructor + · rintro ⟨⟨hr, hA, subset, small⟩, row', A', equal, lower, tests⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_injective equal + exact ⟨hr, hA, subset, small, lower, tests⟩ + · rintro ⟨hr, hA, subset, small, lower, tests⟩ + exact ⟨⟨hr, hA, subset, small⟩, row, A, rfl, lower, tests⟩ + +theorem stageTwoConditions_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {rawRowCarrier I levels alpha : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) + (hRow : rawRowCarrier ∈ M.sets) (hI : I ∈ M.sets) + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (members : ∀ j, d j ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.stageTwoConditions rawRowCarrier I levels alpha d ∈ M.sets := by + have bound := M.stageOneCandidateBound_mem pairing unions powers separation + hRow hI (members 6) omega + let params : Fin 17 → ZFSet.{u} := extend levels (extend alpha d) + have ground : ∀ j, params j ∈ M.sets := Fin.cases hLevels (Fin.cases hAlpha members) + let phi : SetFormula 18 := stageTwoConditionFormula (fun j => j.succ.succ.succ) 1 2 0 + have selected := M.separation_mem separation phi params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets phi (extend z params)) + (M.stageOneCandidateBound rawRowCarrier I (d 6)) = + M.stageTwoConditions rawRowCarrier I levels alpha d := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_stageTwoConditions] + apply and_congr_right + intro hz + exact M.realize_stageTwoConditionFormula pairing separation + (fun j => j.succ.succ.succ) 1 2 0 (extend z params) + (Fin.cases (M.transitive bound hz) ground) + exact equal ▸ selected + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (rawRowCarrier I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid +local notation "levels" => stageTwoAssignmentLevels I0 I1 T +local notation "data" => M.refinementLevelFormulaData a s b d (natSetCode 1) T T2 valid + +noncomputable def stageTwoForcing : ZFSet.{u} := + M.stageTwoConditions rawRowCarrier (I0 ∪ I1) levels (natSetCode 1) data + +theorem stageTwoForcing_raw_entry (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid ↔ + row ∈ rawRowCarrier ∧ + A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ + ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∈ s.carrier ∧ + stageOneRawTests M data A (ZFSet.pair row (assignmentCut levels (natSetCode 1) A)) := by + rw [stageTwoForcing, M.pair_mem_stageTwoConditions, M.mem_groundSmallSubsets] + exact ⟨fun h => ⟨h.1, ⟨h.2.1, h.2.2.1, h.2.2.2.1⟩, h.2.2.2.2⟩, + fun h => ⟨h.1, h.2.1.1, h.2.1.2.1, h.2.1.2.2, h.2.2⟩⟩ + +theorem stageTwoForcing_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hRow : rawRowCarrier ∈ M.sets) (hI0 : I0 ∈ M.sets) + (hT : T ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (valid2 : ∀ z ∈ T2, IsName s z) + (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (system : NiceNameSystem M a s b d base directed T valid) + (omega : ZFSet.omega ∈ M.sets) : + M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid ∈ M.sets := by + have hI1 := indices.index_ground + have hLevels := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT + have hOne : natSetCode 1 ∈ M.sets := M.transitive omega (natSetCode_mem_omega 1) + exact M.stageTwoConditions_mem pairing unions powers separation data hRow + (M.binary_union_mem pairing unions hI0 hI1) hLevels hOne + (M.refinementLevelFormulaData_members a s b d (natSetCode 1) T T2 valid + pairing unions powers separation hT carrier order nodes nodeOrder valid2 indices base directed system) omega + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (rawRowCarrier I0 I1 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +local notation "data" => M.refinementLevelFormulaData a s b d (natSetCode 2) T T2 valid + +noncomputable def stageThreeForcing : ZFSet.{u} := + M.stageTwoConditions rawRowCarrier ((I0 ∪ I1) ∪ I2) levels (natSetCode 2) data + +theorem stageThreeForcing_raw_entry (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid ↔ + row ∈ rawRowCarrier ∧ + A ∈ M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ + ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∈ s.carrier ∧ + stageOneRawTests M data A (ZFSet.pair row (assignmentCut levels (natSetCode 2) A)) := by + rw [stageThreeForcing, M.pair_mem_stageTwoConditions, M.mem_groundSmallSubsets] + exact ⟨fun h => ⟨h.1, ⟨h.2.1, h.2.2.1, h.2.2.2.1⟩, h.2.2.2.2⟩, + fun h => ⟨h.1, h.2.1.1, h.2.1.2.1, h.2.1.2.2, h.2.2⟩⟩ + +theorem stageThreeForcing_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hRow : rawRowCarrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (hT : T ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (valid2 : ∀ z ∈ T2, IsName s z) + (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (system : NiceNameSystem M a s b d base directed T valid) + (omega : ZFSet.omega ∈ M.sets) : + M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid ∈ M.sets := by + have hI2 := indices.index_ground + have hLevels := M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 hI2 hT + have hTwo : natSetCode 2 ∈ M.sets := M.transitive omega (natSetCode_mem_omega 2) + exact M.stageTwoConditions_mem pairing unions powers separation data hRow + (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) hLevels hTwo + (M.refinementLevelFormulaData_members a s b d (natSetCode 2) T T2 valid + pairing unions powers separation hT carrier order nodes nodeOrder valid2 indices base directed system) omega + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +theorem stageTwoForcing_empty (rawRowCarrier I0 : ZFSet.{u}) + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (hRow : rawRowCarrier ∈ M.sets) {row : ZFSet.{u}} (rowMem : row ∈ rawRowCarrier) + (lower : ZFSet.pair row ∅ ∈ s.carrier) : + ZFSet.pair row ∅ ∈ M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid := by + apply (M.stageTwoForcing_raw_entry rawRowCarrier I0 a s b d T T2 valid row ∅).2 + have small : (∅ : ZFSet.{u}) ∈ M.groundSmallSubsets + (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) + ZFSet.omega := + (M.mem_groundSmallSubsets _ _ ∅).2 + ⟨M.empty_mem ⟨rawRowCarrier, hRow⟩, ZFSet.empty_subset _, + M.empty_groundEmbeddable ZFSet.omega ⟨rawRowCarrier, hRow⟩⟩ + have cut : ∀ levels alpha : ZFSet.{u}, assignmentCut levels alpha ∅ = ∅ := by + intro levels alpha + apply ZFSet.ext + intro z + rw [mem_assignmentCut] + exact ⟨fun h => h.1, fun h => False.elim (ZFSet.notMem_empty z h)⟩ + refine ⟨rowMem, small, ?_, ?_⟩ + · rw [cut] + exact lower + · constructor + · intro t ht u hu w hw entry + exact False.elim (ZFSet.notMem_empty _ entry) + · intro t ht u hu u' hu' w hw w' hw' entry + exact False.elim (ZFSet.notMem_empty _ entry) + +theorem stageThreeForcing_empty (rawRowCarrier I0 I1 : ZFSet.{u}) + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (hRow : rawRowCarrier ∈ M.sets) {row : ZFSet.{u}} (rowMem : row ∈ rawRowCarrier) + (lower : ZFSet.pair row ∅ ∈ s.carrier) : + ZFSet.pair row ∅ ∈ M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid := by + apply (M.stageThreeForcing_raw_entry rawRowCarrier I0 I1 a s b d T T2 valid row ∅).2 + have small : (∅ : ZFSet.{u}) ∈ M.groundSmallSubsets + (stageOneAssignments ((I0 ∪ I1) ∪ M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) T) + ZFSet.omega := + (M.mem_groundSmallSubsets _ _ ∅).2 + ⟨M.empty_mem ⟨rawRowCarrier, hRow⟩, ZFSet.empty_subset _, + M.empty_groundEmbeddable ZFSet.omega ⟨rawRowCarrier, hRow⟩⟩ + have cut : ∀ levels alpha : ZFSet.{u}, assignmentCut levels alpha ∅ = ∅ := by + intro levels alpha + apply ZFSet.ext + intro z + rw [mem_assignmentCut] + exact ⟨fun h => h.1, fun h => False.elim (ZFSet.notMem_empty z h)⟩ + refine ⟨rowMem, small, ?_, ?_⟩ + · rw [cut] + exact lower + · constructor + · intro t ht u hu w hw entry + exact False.elim (ZFSet.notMem_empty _ entry) + · intro t ht u hu u' hu' w hw w' hw' entry + exact False.elim (ZFSet.notMem_empty _ entry) + +end + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def forcingHistoryConditions (rows I T stages history levels : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (ForcingHistoryConditionCode M stages history levels) (M.stageOneCandidateBound rows I T) + +theorem mem_forcingHistoryConditions (rows I T stages history levels z : ZFSet.{u}) : + z ∈ M.forcingHistoryConditions rows I T stages history levels ↔ + z ∈ M.stageOneCandidateBound rows I T ∧ ForcingHistoryConditionCode M stages history levels z := + ZFSet.mem_sep + +theorem pair_mem_forcingHistoryConditions (rows I T stages history levels row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.forcingHistoryConditions rows I T stages history levels ↔ + row ∈ rows ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I T ∧ + M.groundEmbeddable A ZFSet.omega ∧ + ForcingHistoryConditionCode M stages history levels (ZFSet.pair row A) := by + rw [M.mem_forcingHistoryConditions, M.pair_mem_stageOneCandidateBound] + exact ⟨fun h => ⟨h.1.1, h.1.2.1, h.1.2.2.1, h.1.2.2.2, h.2⟩, + fun h => ⟨⟨h.1, h.2.1, h.2.2.1, h.2.2.2.1⟩, h.2.2.2.2⟩⟩ + +theorem forcingHistoryConditions_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {rows I T stages history levels : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hLevels : levels ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.forcingHistoryConditions rows I T stages history levels ∈ M.sets := by + have bound := M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega + let params : Fin 3 → ZFSet.{u} := ![stages, history, levels] + have ground : ∀ j, params j ∈ M.sets := + Fin.cases hStages (Fin.cases hHistory (Fin.cases hLevels (fun j => Fin.elim0 j))) + have selected := M.separation_mem separation (forcingHistoryConditionFormula 1 2 3 0) params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets (forcingHistoryConditionFormula 1 2 3 0) + (extend z params)) (M.stageOneCandidateBound rows I T) = + M.forcingHistoryConditions rows I T stages history levels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_forcingHistoryConditions] + apply and_congr_right + intro member + exact M.realize_forcingHistoryConditionFormula pairing separation 1 2 3 0 (extend z params) + (Fin.cases (M.transitive bound member) ground) + exact equal ▸ selected + +theorem forcingHistoryConditions_empty (rows I T history levels : ZFSet.{u}) : + M.forcingHistoryConditions rows I T ∅ history levels = M.stageOneCandidateBound rows I T := by + apply ZFSet.ext + intro z + rw [M.mem_forcingHistoryConditions] + exact ⟨And.left, fun member => ⟨member, forcingHistoryConditionCode_empty M history levels z⟩⟩ + +theorem forcingHistoryConditions_initial {rows : ZFSet.{u}} (hRows : rows ∈ M.sets) + (T history levels : ZFSet.{u}) : + M.forcingHistoryConditions rows ∅ T ∅ history levels = ZFSet.prod rows {∅} := by + rw [M.forcingHistoryConditions_empty] + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨row, hrow, A, _, subset, _, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 member + have empty : A = ∅ := by + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨t, ht, _, _, _, _, _⟩ := (mem_stageOneAssignments ∅ T x).1 (subset hx) + exact False.elim (ZFSet.notMem_empty t ht) + · intro hx + exact False.elim (ZFSet.notMem_empty x hx) + exact ZFSet.pair_mem_prod.2 ⟨hrow, ZFSet.mem_singleton.2 empty⟩ + · intro member + obtain ⟨row, hrow, A, hA, rfl⟩ := ZFSet.mem_prod.1 member + obtain rfl := ZFSet.mem_singleton.1 hA + exact M.stageOneCandidateBound_empty hRows hrow + +theorem forcingHistoryConditions_restrict {rows I T stages earlier history levels z : ZFSet.{u}} + (member : z ∈ M.forcingHistoryConditions rows I T stages history levels) (subset : earlier ⊆ stages) : + z ∈ M.forcingHistoryConditions rows I T earlier (graphRestriction earlier history) levels := by + obtain ⟨candidate, valid⟩ := (M.mem_forcingHistoryConditions _ _ _ _ _ _ _).1 member + exact (M.mem_forcingHistoryConditions _ _ _ _ _ _ _).2 + ⟨candidate, forcingHistoryConditionCode_mono valid subset⟩ + +theorem forcingHistoryConditions_successor_eq + (rows oldI I alpha history levels : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) + (function : FunctionGraphOn alpha history) (ordinal : ordinalSetProperty alpha) + (coverage : ForcingHistoryLevelCoverage alpha history levels) + (lower : d 7 = M.forcingHistoryConditions rows oldI (d 6) alpha history levels) : + M.forcingHistoryConditions rows I (d 6) (insert alpha alpha) + (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) levels = + M.stageTwoConditions rows I levels alpha d := by + apply ZFSet.ext + intro z + rw [M.mem_forcingHistoryConditions, M.mem_stageTwoConditions, + forcingHistoryConditionCode_insert_iff function (ZFSet.mem_irrefl alpha), + packedSuccessorConditionCode_code_iff] + constructor + · rintro ⟨candidate, _, current⟩ + exact ⟨candidate, current⟩ + · rintro ⟨candidate, current⟩ + obtain ⟨row, A, equal, member, tests⟩ := current + rw [lower] at member + have priorCut := ((M.mem_forcingHistoryConditions rows oldI (d 6) alpha history levels _).1 member).2 + have prior := (forcingHistoryConditionCode_ordinalCut_iff M alpha history levels alpha row A + ordinal (fun _ hx => hx) coverage).1 priorCut + exact ⟨candidate, equal.symm ▸ prior, row, A, equal, lower.symm ▸ member, tests⟩ + +theorem forcingHistoryConditions_successor_pair_iff + (rows oldI I alpha history levels : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) + (function : FunctionGraphOn alpha history) (ordinal : ordinalSetProperty alpha) + (coverage : ForcingHistoryLevelCoverage alpha history levels) + (lower : d 7 = M.forcingHistoryConditions rows oldI (d 6) alpha history levels) + (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.forcingHistoryConditions rows I (d 6) (insert alpha alpha) + (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) levels ↔ + row ∈ rows ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I (d 6) ∧ + M.groundEmbeddable A ZFSet.omega ∧ + ZFSet.pair row (assignmentCut levels alpha A) ∈ d 7 ∧ + stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels alpha A)) := by + rw [M.forcingHistoryConditions_successor_eq rows oldI I alpha history levels d function ordinal coverage lower] + exact M.pair_mem_stageTwoConditions rows I levels alpha d row A + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundGraphValueDescendantWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundGraphValueDescendantWitnesses.lean index 965c9e0b10620a2ea4b513161df980ff897e73a2..c2826a8d18506b877debf0588c897f09314eeccf 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundGraphValueDescendantWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundGraphValueDescendantWitnesses.lean @@ -1,519 +1,519 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GraphValueMembershipFormula -import OAI.SetTheory.PartitionPrinciple.Definability.RenamedEntryFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.SeparationEntryFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem rename_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) : - ∀ τ : Name s, τ.val ∈ M.sets → (Name.rename s f τ).val ∈ M.sets := by - intro τ - induction τ using Name.inductionOn with - | step τ ih => - intro hτ - have members : ∀ i, renameParameters s f i ∈ M.sets := - Fin.cases carrier (Fin.cases graph (fun i => Fin.elim0 i)) - have witnesses : ∀ z ∈ τ.val, ∃ y ∈ M.sets, - Realize M.sets renamedChildFormula (extend z (extend y (renameParameters s f))) := by - intro z hz - obtain ⟨σ, p, rfl⟩ := Name.entries_cover τ hz - have hσ := (M.nameDomain s).children hτ hz - have imageM := ih σ p hz hσ - exact ⟨(Name.rename s f σ).val, imageM, - (M.realize_renamedChildFormula s pairing unions powers separation collection carrier f graph - σ hσ p _ imageM).2 rfl⟩ - obtain ⟨W, hW, images⟩ := M.collection_witness collection renamedChildFormula - (renameParameters s f) members hτ witnesses - have children : ∀ σ p, Name.Entry σ τ p → (Name.rename s f σ).val ∈ W := by - intro σ p entry - obtain ⟨y, hyW, rel⟩ := images _ entry - have eq := (M.realize_renamedChildFormula s pairing unions powers separation collection carrier f graph - σ ((M.nameDomain s).children hτ entry) p y (M.transitive hW hyW)).1 rel - exact eq ▸ hyW - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW carrier - have bound : (Name.rename s f τ).val ⊆ B := by - intro z hz - obtain ⟨ν, q, rfl⟩ := Name.entries_cover (Name.rename s f τ) hz - obtain ⟨σ, p, entry, image, _⟩ := (Name.entry_rename s f τ ν q).1 hz - exact pairBound ν.val (image ▸ children σ p entry) (s.encode q) (s.encode_mem q) - have selected := M.separation_mem separation renamedEntryFormula (extend τ.val (renameParameters s f)) - (Fin.cases hτ members) hB - have eq : ZFSet.sep (fun z => Realize M.sets renamedEntryFormula - (extend z (extend τ.val (renameParameters s f)))) B = (Name.rename s f τ).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hzB, rel⟩ - exact (M.realize_renamedEntryFormula s pairing unions powers separation collection carrier f graph - τ hτ z (M.transitive hB hzB)).1 rel - · intro hz - exact ⟨bound hz, (M.realize_renamedEntryFormula s pairing unions powers separation collection carrier f graph - τ hτ z (M.transitive hB (bound hz))).2 hz⟩ - exact eq ▸ selected - -variable {G : Type u} [Group G] [PartialOrder P] - -theorem act_mem (a : PosetAction G P) (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (g : G) (τ : Name s) (hτ : τ.val ∈ M.sets) : (a.act s g τ).val ∈ M.sets := - M.rename_mem s pairing unions powers separation collection carrier (a.iso g) - (M.conditionMap_graph_mem a s t maps g) τ hτ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry.OrderAction -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} -variable (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - -include pairing unions powers separation collection carrier maps closed - -theorem niceNameCandidates_act_iff (K : Subgroup G) (g : G) (τ : Name s) : - (a.act s g τ).val ∈ M.niceNameCandidates a s T (K.map (conjugateHom g)) ↔ - τ.val ∈ M.niceNameCandidates a s T K := by - rw [M.mem_niceNameCandidates, M.mem_niceNameCandidates, - niceNameCode_act_iff a s closed g τ] - constructor - · rintro ⟨ground, code⟩ - have back := M.act_mem s a t pairing unions powers separation collection - carrier maps g⁻¹ (a.act s g τ) ground - exact ⟨by simpa only [a.act_inv_left] using back, code⟩ - · rintro ⟨ground, code⟩ - exact ⟨M.act_mem s a t pairing unions powers separation collection - carrier maps g τ ground, code⟩ - -theorem niceNameCandidates_principal_act_iff (d : PosetAction G L) - (g : G) (v : L) (τ : Name s) : - (a.act s g τ).val ∈ M.niceNameCandidates a s T (d.principalFix (d.iso g v)) ↔ - τ.val ∈ M.niceNameCandidates a s T (d.principalFix v) := by - rw [← principalFix_map_conjugate d g v] - exact M.niceNameCandidates_act_iff a s t pairing unions powers separation collection - carrier maps closed (d.principalFix v) g τ - -noncomputable def niceNameCandidateEquiv (d : PosetAction G L) (g : G) (v : L) : - {τ : Name s // τ.val ∈ M.niceNameCandidates a s T (d.principalFix v)} ≃ - {τ : Name s // τ.val ∈ M.niceNameCandidates a s T (d.principalFix (d.iso g v))} where - toFun τ := ⟨a.act s g τ.val, - (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation collection - carrier maps closed d g v τ.val).2 τ.property⟩ - invFun ν := ⟨a.act s g⁻¹ ν.val, - (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation collection - carrier maps closed d g v (a.act s g⁻¹ ν.val)).1 (by - simpa only [a.act_inv_right] using ν.property)⟩ - left_inv τ := Subtype.ext (a.act_inv_left s g τ.val) - right_inv ν := Subtype.ext (a.act_inv_right s g ν.val) - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -theorem child_mem_doubleUnion {σ τ : Name s} {p : P} (entry : Entry σ τ p) : - σ.val ∈ ZFSet.sUnion (ZFSet.sUnion τ.val) := by - have single : ({σ.val} : ZFSet.{u}) ∈ ZFSet.sUnion τ.val := - ZFSet.mem_sUnion.2 ⟨ZFSet.pair σ.val (s.encode p), entry, ZFSet.mem_pair.2 (Or.inl rfl)⟩ - exact ZFSet.mem_sUnion.2 ⟨{σ.val}, single, ZFSet.mem_singleton.2 rfl⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem separationName_mem (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula (n + 1)) - (params : Fin k → Fin m) (names : Fin n → Fin m) (context : Fin m → ZFSet.{u}) - (members : ∀ i, context i ∈ M.sets) - (hc : context (params A.carrier) = s.carrier) (ho : context (params A.order) = s.conditionOrder) - (atomic : M.EqualityMeaning s D A.equality (fun j => context (params j))) - (domain : M.DomainMeaning s D A.domain (fun j => context (params j))) - (nameEnv : Assignment D n) (hnames : ∀ i, context (names i) = (nameEnv i).val.val) (τ : D.names) : - (Name.separationName D φ nameEnv τ.val).val ∈ M.sets := by - have hτ := ground τ.val τ.property - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers - (M.union_mem unions (M.union_mem unions hτ)) carrier - have bound : (Name.separationName D φ nameEnv τ.val).val ⊆ B := by - intro z hz - obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.separationName D φ nameEnv τ.val) hz - obtain ⟨r, old, _, _⟩ := (Name.entry_separationName D φ nameEnv τ.val σ p).1 hz - exact pairBound σ.val (Name.child_mem_doubleUnion old) (s.encode p) (s.encode_mem p) - let selected := separationEntryFormula A φ (fun j => (params j).succ.succ) - (fun i => (names i).succ.succ) 0 1 - let fullContext := extend τ.val.val context - have correct : ∀ z ∈ M.sets, Realize M.sets selected (extend z fullContext) ↔ - z ∈ (Name.separationName D φ nameEnv τ.val).val := by - intro z hz - exact M.realize_separationEntryFormula s D ground pairing carrier order A φ - (fun j => (params j).succ.succ) (fun i => (names i).succ.succ) 0 1 (extend z fullContext) - hc ho atomic domain nameEnv hnames τ rfl hz - have selectedM := M.separation_mem separation selected fullContext (Fin.cases hτ members) hB - have eq : ZFSet.sep (fun z => Realize M.sets selected (extend z fullContext)) B = - (Name.separationName D φ nameEnv τ.val).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (correct z (M.transitive hB hz)).1 rel - · intro hz - exact ⟨bound hz, (correct z (M.transitive hB (bound hz))).2 hz⟩ - exact eq ▸ selectedM - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -noncomputable def immediateChildCodes (τ : Name s) : ZFSet.{u} := - relationImage s.carrier (ZFSet.sUnion (ZFSet.sUnion τ.val)) - (relationConverse (ZFSet.sUnion (ZFSet.sUnion τ.val)) s.carrier τ.val) - -theorem mem_immediateChildCodes (τ : Name s) (y : ZFSet.{u}) : - y ∈ immediateChildCodes τ ↔ ∃ σ : Name s, ∃ p, Entry σ τ p ∧ y = σ.val := by - rw [immediateChildCodes, mem_relationImage] - constructor - · rintro ⟨_, q, _, entry⟩ - have raw := ((pair_mem_relationConverse _ _ _ y q).1 entry).2.2 - obtain ⟨σ, p, shape⟩ := entries_cover τ raw - refine ⟨σ, p, ?_, (ZFSet.pair_inj.1 shape).1⟩ - change ZFSet.pair σ.val (s.encode p) ∈ τ.val - rw [← shape] - exact raw - · rintro ⟨σ, p, entry, rfl⟩ - have bound := child_mem_doubleUnion entry - exact ⟨bound, s.encode p, s.encode_mem p, - (pair_mem_relationConverse _ _ _ _ _).2 ⟨bound, s.encode_mem p, entry⟩⟩ - -theorem immediateChildCodes_valid (τ : Name s) : - ∀ y ∈ immediateChildCodes τ, IsName s y := by - intro y member - obtain ⟨σ, _, _, rfl⟩ := (mem_immediateChildCodes τ y).1 member - exact σ.property - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem immediateChildCodes_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (τ : Name s) (ground : τ.val ∈ M.sets) : - Name.immediateChildCodes τ ∈ M.sets := by - have bound := M.union_mem unions (M.union_mem unions ground) - exact M.relationImage_mem separation carrier bound - (M.relationConverse_mem pairing unions powers separation bound carrier ground) - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem symmetricSeparationName_mem (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {n : Nat} (φ : SetFormula (n + 1)) - (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) - (τ : (a.symmetricDomain s (M.nameDomain s) F).names) : - (Name.separationName (a.symmetricDomain s (M.nameDomain s) F) φ nameEnv τ.val).val ∈ M.sets := by - let D := a.symmetricDomain s (M.nameDomain s) F - let context := extend s.carrier (extend s.conditionOrder (extend t.carrier (extend b.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) (fun i => (nameEnv i).val.val)))))) - let params : Fin 6 → Fin (n + 6) := extend 0 (extend 1 (extend 2 (extend 3 (extend 4 (extend 5 Fin.elim0))))) - have members : ∀ i, context i ∈ M.sets := - Fin.cases carrier (Fin.cases order (Fin.cases group (Fin.cases indices (Fin.cases supports - (Fin.cases maps (fun i => (nameEnv i).property.1)))))) - apply M.separationName_mem s D (fun _ h => h.1) pairing unions powers separation carrier order - symmetricGroundPrimitives φ params (fun i => i.succ.succ.succ.succ.succ.succ) context members rfl rfl - · exact M.equalityMeaning_lifted s D (fun _ h => h.1) pairing unions powers separation collection - carrier order 0 1 _ rfl rfl - · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps 0 2 3 4 5 _ rfl rfl rfl rfl rfl - · exact fun _ => rfl - -theorem symmetric_separation (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : - SeparationSchema ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := by - intro n φ params members x hx - obtain ⟨y, hy, spec⟩ := symmetric_separation_scheme a (M.nameDomain s) F - (fun g τ hτ => M.act_mem s a t pairing unions powers separation collection carrier maps g τ hτ) - H generic (fun ψ env τ hτ => M.symmetricSeparationName_mem a s t b F K basis - pairing unions powers separation collection carrier order group indices supports maps ψ env ⟨τ, hτ⟩) - φ params members hx - exact ⟨y, hy, fun z _ => spec z⟩ - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} (s : Presentation P) - -noncomputable def childFamilyCodes (W : ZFSet.{u}) : ZFSet.{u} := - relationImage s.carrier (ZFSet.sUnion (ZFSet.sUnion (ZFSet.sUnion W))) - (relationConverse (ZFSet.sUnion (ZFSet.sUnion (ZFSet.sUnion W))) s.carrier - (ZFSet.sUnion W)) - -theorem mem_childFamilyCodes (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) - (y : ZFSet.{u}) : - y ∈ childFamilyCodes s W ↔ - ∃ tau : Name s, tau.val ∈ W ∧ ∃ sigma : Name s, ∃ p, - Entry sigma tau p ∧ y = sigma.val := by - rw [childFamilyCodes, mem_relationImage] - constructor - · rintro ⟨_, q, _, coded⟩ - have raw := ((pair_mem_relationConverse _ _ _ y q).1 coded).2.2 - obtain ⟨x, hx, entry⟩ := ZFSet.mem_sUnion.1 raw - let tau : Name s := ⟨x, valid x hx⟩ - obtain ⟨sigma, p, shape⟩ := entries_cover tau entry - refine ⟨tau, hx, sigma, p, ?_, (ZFSet.pair_inj.1 shape).1⟩ - change ZFSet.pair sigma.val (s.encode p) ∈ x - rw [← shape] - exact entry - · rintro ⟨tau, htau, sigma, p, entry, rfl⟩ - have raw : ZFSet.pair sigma.val (s.encode p) ∈ ZFSet.sUnion W := - ZFSet.mem_sUnion.2 ⟨tau.val, htau, entry⟩ - have bound := pair_first_mem_doubleUnion raw - exact ⟨bound, s.encode p, s.encode_mem p, - (pair_mem_relationConverse _ _ _ _ _).2 ⟨bound, s.encode_mem p, raw⟩⟩ - -theorem childFamilyCodes_valid (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) : - ∀ z ∈ childFamilyCodes s W, IsName s z := by - intro z member - obtain ⟨tau, _, sigma, _, _, rfl⟩ := (mem_childFamilyCodes s W valid z).1 member - exact sigma.property - -theorem childFamilyCodes_hs {G : Type v} [Group G] [PartialOrder P] - (a : PosetAction G P) (F : NormalSubgroupFamily G) - (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) - (symmetric : ∀ tau : Name s, tau.val ∈ W → HereditarilySymmetric a s F tau) - (sigma : Name s) (member : sigma.val ∈ childFamilyCodes s W) : - HereditarilySymmetric a s F sigma := by - obtain ⟨tau, htau, child, p, entry, equal⟩ := - (mem_childFamilyCodes s W valid sigma.val).1 member - have same : sigma = child := Subtype.ext equal - exact same.symm ▸ (symmetric tau htau).member entry - -theorem eval_member_childFamilyCodes (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) - (H : Set P) (tau : Name s) (htau : tau.val ∈ W) (x : ZFSet.{u}) - (member : x ∈ eval H tau) : - ∃ sigma : Name s, sigma.val ∈ childFamilyCodes s W ∧ eval H sigma = x := by - obtain ⟨sigma, p, entry, _hp, equal⟩ := (mem_eval H tau x).1 member - exact ⟨sigma, (mem_childFamilyCodes s W valid sigma.val).2 ⟨tau, htau, sigma, p, entry, rfl⟩, equal⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem childFamilyCodes_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (W : ZFSet.{u}) (ground : W ∈ M.sets) : - Name.childFamilyCodes s W ∈ M.sets := by - have entries := M.union_mem unions ground - have bound := M.union_mem unions (M.union_mem unions entries) - exact M.relationImage_mem separation carrier bound - (M.relationConverse_mem pairing unions powers separation bound carrier entries) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} (s : Presentation P) - -noncomputable def descendantFamilyCodes (tau : Name s) : Nat → ZFSet.{u} - | 0 => {tau.val} - | n + 1 => childFamilyCodes s (descendantFamilyCodes tau n) - -theorem descendantFamilyCodes_valid (tau : Name s) (n : Nat) : - ∀ z ∈ descendantFamilyCodes s tau n, IsName s z := by - induction n with - | zero => - intro z member - have same : z = tau.val := ZFSet.mem_singleton.1 member - exact same.symm ▸ tau.property - | succ n ih => exact childFamilyCodes_valid s _ ih - -theorem descendantFamilyCodes_hs {G : Type v} [Group G] [PartialOrder P] - (a : PosetAction G P) (F : NormalSubgroupFamily G) - (tau : Name s) (symmetric : HereditarilySymmetric a s F tau) (n : Nat) : - ∀ sigma : Name s, sigma.val ∈ descendantFamilyCodes s tau n → - HereditarilySymmetric a s F sigma := by - induction n with - | zero => - intro sigma member - have same : sigma = tau := Subtype.ext (ZFSet.mem_singleton.1 member) - exact same.symm ▸ symmetric - | succ n ih => - exact childFamilyCodes_hs s a F _ (descendantFamilyCodes_valid s tau n) ih - -theorem value_member_fourthDescendant (H : Set P) (tau : Name s) - (beta A x : ZFSet.{u}) (edge : ZFSet.pair beta A ∈ eval H tau) (member : x ∈ A) : - ∃ sigma : Name s, sigma.val ∈ descendantFamilyCodes s tau 4 ∧ eval H sigma = x := by - have zero : tau.val ∈ descendantFamilyCodes s tau 0 := ZFSet.mem_singleton.2 rfl - obtain ⟨pairName, first, pairValue⟩ := eval_member_childFamilyCodes s - (descendantFamilyCodes s tau 0) (descendantFamilyCodes_valid s tau 0) H tau zero _ edge - have pairMember : ({beta, A} : ZFSet.{u}) ∈ eval H pairName := by - rw [pairValue] - exact ZFSet.mem_pair.2 (Or.inr rfl) - obtain ⟨unorderedName, second, unorderedValue⟩ := eval_member_childFamilyCodes s - (descendantFamilyCodes s tau 1) (descendantFamilyCodes_valid s tau 1) H pairName first _ pairMember - have valueMember : A ∈ eval H unorderedName := by - rw [unorderedValue] - exact ZFSet.mem_pair.2 (Or.inr rfl) - obtain ⟨valueName, third, valueValue⟩ := eval_member_childFamilyCodes s - (descendantFamilyCodes s tau 2) (descendantFamilyCodes_valid s tau 2) H unorderedName second _ valueMember - have elementMember : x ∈ eval H valueName := valueValue.symm ▸ member - exact eval_member_childFamilyCodes s (descendantFamilyCodes s tau 3) - (descendantFamilyCodes_valid s tau 3) H valueName third x elementMember - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem descendantFamilyCodes_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (tau : Name s) (ground : tau.val ∈ M.sets) (n : Nat) : - Name.descendantFamilyCodes s tau n ∈ M.sets := by - induction n with - | zero => - simpa only [Name.descendantFamilyCodes, ZFSet.pair_eq_singleton] using - M.unorderedPair_mem pairing ground ground - | succ n ih => exact M.childFamilyCodes_mem s pairing unions powers separation carrier _ ih - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem graphValue_fourthDescendant_dense - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) - (z beta : (M.nameDomain s).names) (base : P) - (forced : Forces (M.nameDomain s) - (ex (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula) - (extend z (extend beta Fin.elim0)) base) : - DenseBelow base {q | ∃ tau : (M.nameDomain s).names, - tau.val.val ∈ Name.descendantFamilyCodes s z.val 4 ∧ - Forces (M.nameDomain s) (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula - (extend tau (extend z (extend beta Fin.elim0))) q} := by - have descendants := M.descendantFamilyCodes_mem s pairing unions powers separation carrier - z.val z.property 4 - intro p below - obtain ⟨H, hp, _coded, ordinary⟩ := M.exists_coded_ordinary_generic s small carrier p - obtain ⟨tau, q, hq, _qbase, witness⟩ := ex_witness_in_filter (M.nameDomain s) H ordinary - (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula - (extend z (extend beta Fin.elim0)) (H.upward hp below) forced - have truth := (realize_graphValueMember_values (M.nameDomain s) {r | H.mem r} 0 1 2 - (extend tau (extend z (extend beta Fin.elim0)))).1 - (forces_sound (M.nameDomain s) H ordinary _ _ hq witness) - obtain ⟨A, edge, member⟩ := truth - obtain ⟨sigma, child, same⟩ := Name.value_member_fourthDescendant s {r | H.mem r} - z.val (Name.eval {r | H.mem r} beta.val) A (Name.eval {r | H.mem r} tau.val) edge member - let candidate : (M.nameDomain s).names := ⟨sigma, M.transitive descendants child⟩ - have actual : Realize ((M.nameDomain s).values {r | H.mem r}) - (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula - (evalAssignment {r | H.mem r} (extend candidate (extend z (extend beta Fin.elim0)))) := by - apply (realize_graphValueMember_values (M.nameDomain s) {r | H.mem r} 0 1 2 _).2 - exact ⟨A, edge, same.symm ▸ member⟩ - obtain ⟨r, hr, recorded⟩ := (forcing_truth (M.nameDomain s) H ordinary - (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula - (extend candidate (extend z (extend beta Fin.elim0)))).1 actual - obtain ⟨common, _member, toP, toR⟩ := H.directed hp hr - exact ⟨common, toP, candidate, child, forces_mono (M.nameDomain s) _ _ recorded toR⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GraphValueMembershipFormula +import OAI.SetTheory.PartitionPrinciple.Definability.RenamedEntryFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.SeparationEntryFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem rename_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) : + ∀ τ : Name s, τ.val ∈ M.sets → (Name.rename s f τ).val ∈ M.sets := by + intro τ + induction τ using Name.inductionOn with + | step τ ih => + intro hτ + have members : ∀ i, renameParameters s f i ∈ M.sets := + Fin.cases carrier (Fin.cases graph (fun i => Fin.elim0 i)) + have witnesses : ∀ z ∈ τ.val, ∃ y ∈ M.sets, + Realize M.sets renamedChildFormula (extend z (extend y (renameParameters s f))) := by + intro z hz + obtain ⟨σ, p, rfl⟩ := Name.entries_cover τ hz + have hσ := (M.nameDomain s).children hτ hz + have imageM := ih σ p hz hσ + exact ⟨(Name.rename s f σ).val, imageM, + (M.realize_renamedChildFormula s pairing unions powers separation collection carrier f graph + σ hσ p _ imageM).2 rfl⟩ + obtain ⟨W, hW, images⟩ := M.collection_witness collection renamedChildFormula + (renameParameters s f) members hτ witnesses + have children : ∀ σ p, Name.Entry σ τ p → (Name.rename s f σ).val ∈ W := by + intro σ p entry + obtain ⟨y, hyW, rel⟩ := images _ entry + have eq := (M.realize_renamedChildFormula s pairing unions powers separation collection carrier f graph + σ ((M.nameDomain s).children hτ entry) p y (M.transitive hW hyW)).1 rel + exact eq ▸ hyW + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW carrier + have bound : (Name.rename s f τ).val ⊆ B := by + intro z hz + obtain ⟨ν, q, rfl⟩ := Name.entries_cover (Name.rename s f τ) hz + obtain ⟨σ, p, entry, image, _⟩ := (Name.entry_rename s f τ ν q).1 hz + exact pairBound ν.val (image ▸ children σ p entry) (s.encode q) (s.encode_mem q) + have selected := M.separation_mem separation renamedEntryFormula (extend τ.val (renameParameters s f)) + (Fin.cases hτ members) hB + have eq : ZFSet.sep (fun z => Realize M.sets renamedEntryFormula + (extend z (extend τ.val (renameParameters s f)))) B = (Name.rename s f τ).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hzB, rel⟩ + exact (M.realize_renamedEntryFormula s pairing unions powers separation collection carrier f graph + τ hτ z (M.transitive hB hzB)).1 rel + · intro hz + exact ⟨bound hz, (M.realize_renamedEntryFormula s pairing unions powers separation collection carrier f graph + τ hτ z (M.transitive hB (bound hz))).2 hz⟩ + exact eq ▸ selected + +variable {G : Type u} [Group G] [PartialOrder P] + +theorem act_mem (a : PosetAction G P) (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (g : G) (τ : Name s) (hτ : τ.val ∈ M.sets) : (a.act s g τ).val ∈ M.sets := + M.rename_mem s pairing unions powers separation collection carrier (a.iso g) + (M.conditionMap_graph_mem a s t maps g) τ hτ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry.OrderAction +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} +variable (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + +include pairing unions powers separation collection carrier maps closed + +theorem niceNameCandidates_act_iff (K : Subgroup G) (g : G) (τ : Name s) : + (a.act s g τ).val ∈ M.niceNameCandidates a s T (K.map (conjugateHom g)) ↔ + τ.val ∈ M.niceNameCandidates a s T K := by + rw [M.mem_niceNameCandidates, M.mem_niceNameCandidates, + niceNameCode_act_iff a s closed g τ] + constructor + · rintro ⟨ground, code⟩ + have back := M.act_mem s a t pairing unions powers separation collection + carrier maps g⁻¹ (a.act s g τ) ground + exact ⟨by simpa only [a.act_inv_left] using back, code⟩ + · rintro ⟨ground, code⟩ + exact ⟨M.act_mem s a t pairing unions powers separation collection + carrier maps g τ ground, code⟩ + +theorem niceNameCandidates_principal_act_iff (d : PosetAction G L) + (g : G) (v : L) (τ : Name s) : + (a.act s g τ).val ∈ M.niceNameCandidates a s T (d.principalFix (d.iso g v)) ↔ + τ.val ∈ M.niceNameCandidates a s T (d.principalFix v) := by + rw [← principalFix_map_conjugate d g v] + exact M.niceNameCandidates_act_iff a s t pairing unions powers separation collection + carrier maps closed (d.principalFix v) g τ + +noncomputable def niceNameCandidateEquiv (d : PosetAction G L) (g : G) (v : L) : + {τ : Name s // τ.val ∈ M.niceNameCandidates a s T (d.principalFix v)} ≃ + {τ : Name s // τ.val ∈ M.niceNameCandidates a s T (d.principalFix (d.iso g v))} where + toFun τ := ⟨a.act s g τ.val, + (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation collection + carrier maps closed d g v τ.val).2 τ.property⟩ + invFun ν := ⟨a.act s g⁻¹ ν.val, + (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation collection + carrier maps closed d g v (a.act s g⁻¹ ν.val)).1 (by + simpa only [a.act_inv_right] using ν.property)⟩ + left_inv τ := Subtype.ext (a.act_inv_left s g τ.val) + right_inv ν := Subtype.ext (a.act_inv_right s g ν.val) + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +theorem child_mem_doubleUnion {σ τ : Name s} {p : P} (entry : Entry σ τ p) : + σ.val ∈ ZFSet.sUnion (ZFSet.sUnion τ.val) := by + have single : ({σ.val} : ZFSet.{u}) ∈ ZFSet.sUnion τ.val := + ZFSet.mem_sUnion.2 ⟨ZFSet.pair σ.val (s.encode p), entry, ZFSet.mem_pair.2 (Or.inl rfl)⟩ + exact ZFSet.mem_sUnion.2 ⟨{σ.val}, single, ZFSet.mem_singleton.2 rfl⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem separationName_mem (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula (n + 1)) + (params : Fin k → Fin m) (names : Fin n → Fin m) (context : Fin m → ZFSet.{u}) + (members : ∀ i, context i ∈ M.sets) + (hc : context (params A.carrier) = s.carrier) (ho : context (params A.order) = s.conditionOrder) + (atomic : M.EqualityMeaning s D A.equality (fun j => context (params j))) + (domain : M.DomainMeaning s D A.domain (fun j => context (params j))) + (nameEnv : Assignment D n) (hnames : ∀ i, context (names i) = (nameEnv i).val.val) (τ : D.names) : + (Name.separationName D φ nameEnv τ.val).val ∈ M.sets := by + have hτ := ground τ.val τ.property + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers + (M.union_mem unions (M.union_mem unions hτ)) carrier + have bound : (Name.separationName D φ nameEnv τ.val).val ⊆ B := by + intro z hz + obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.separationName D φ nameEnv τ.val) hz + obtain ⟨r, old, _, _⟩ := (Name.entry_separationName D φ nameEnv τ.val σ p).1 hz + exact pairBound σ.val (Name.child_mem_doubleUnion old) (s.encode p) (s.encode_mem p) + let selected := separationEntryFormula A φ (fun j => (params j).succ.succ) + (fun i => (names i).succ.succ) 0 1 + let fullContext := extend τ.val.val context + have correct : ∀ z ∈ M.sets, Realize M.sets selected (extend z fullContext) ↔ + z ∈ (Name.separationName D φ nameEnv τ.val).val := by + intro z hz + exact M.realize_separationEntryFormula s D ground pairing carrier order A φ + (fun j => (params j).succ.succ) (fun i => (names i).succ.succ) 0 1 (extend z fullContext) + hc ho atomic domain nameEnv hnames τ rfl hz + have selectedM := M.separation_mem separation selected fullContext (Fin.cases hτ members) hB + have eq : ZFSet.sep (fun z => Realize M.sets selected (extend z fullContext)) B = + (Name.separationName D φ nameEnv τ.val).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (correct z (M.transitive hB hz)).1 rel + · intro hz + exact ⟨bound hz, (correct z (M.transitive hB (bound hz))).2 hz⟩ + exact eq ▸ selectedM + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +noncomputable def immediateChildCodes (τ : Name s) : ZFSet.{u} := + relationImage s.carrier (ZFSet.sUnion (ZFSet.sUnion τ.val)) + (relationConverse (ZFSet.sUnion (ZFSet.sUnion τ.val)) s.carrier τ.val) + +theorem mem_immediateChildCodes (τ : Name s) (y : ZFSet.{u}) : + y ∈ immediateChildCodes τ ↔ ∃ σ : Name s, ∃ p, Entry σ τ p ∧ y = σ.val := by + rw [immediateChildCodes, mem_relationImage] + constructor + · rintro ⟨_, q, _, entry⟩ + have raw := ((pair_mem_relationConverse _ _ _ y q).1 entry).2.2 + obtain ⟨σ, p, shape⟩ := entries_cover τ raw + refine ⟨σ, p, ?_, (ZFSet.pair_inj.1 shape).1⟩ + change ZFSet.pair σ.val (s.encode p) ∈ τ.val + rw [← shape] + exact raw + · rintro ⟨σ, p, entry, rfl⟩ + have bound := child_mem_doubleUnion entry + exact ⟨bound, s.encode p, s.encode_mem p, + (pair_mem_relationConverse _ _ _ _ _).2 ⟨bound, s.encode_mem p, entry⟩⟩ + +theorem immediateChildCodes_valid (τ : Name s) : + ∀ y ∈ immediateChildCodes τ, IsName s y := by + intro y member + obtain ⟨σ, _, _, rfl⟩ := (mem_immediateChildCodes τ y).1 member + exact σ.property + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem immediateChildCodes_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (τ : Name s) (ground : τ.val ∈ M.sets) : + Name.immediateChildCodes τ ∈ M.sets := by + have bound := M.union_mem unions (M.union_mem unions ground) + exact M.relationImage_mem separation carrier bound + (M.relationConverse_mem pairing unions powers separation bound carrier ground) + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem symmetricSeparationName_mem (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {n : Nat} (φ : SetFormula (n + 1)) + (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) + (τ : (a.symmetricDomain s (M.nameDomain s) F).names) : + (Name.separationName (a.symmetricDomain s (M.nameDomain s) F) φ nameEnv τ.val).val ∈ M.sets := by + let D := a.symmetricDomain s (M.nameDomain s) F + let context := extend s.carrier (extend s.conditionOrder (extend t.carrier (extend b.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) (fun i => (nameEnv i).val.val)))))) + let params : Fin 6 → Fin (n + 6) := extend 0 (extend 1 (extend 2 (extend 3 (extend 4 (extend 5 Fin.elim0))))) + have members : ∀ i, context i ∈ M.sets := + Fin.cases carrier (Fin.cases order (Fin.cases group (Fin.cases indices (Fin.cases supports + (Fin.cases maps (fun i => (nameEnv i).property.1)))))) + apply M.separationName_mem s D (fun _ h => h.1) pairing unions powers separation carrier order + symmetricGroundPrimitives φ params (fun i => i.succ.succ.succ.succ.succ.succ) context members rfl rfl + · exact M.equalityMeaning_lifted s D (fun _ h => h.1) pairing unions powers separation collection + carrier order 0 1 _ rfl rfl + · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps 0 2 3 4 5 _ rfl rfl rfl rfl rfl + · exact fun _ => rfl + +theorem symmetric_separation (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : + SeparationSchema ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := by + intro n φ params members x hx + obtain ⟨y, hy, spec⟩ := symmetric_separation_scheme a (M.nameDomain s) F + (fun g τ hτ => M.act_mem s a t pairing unions powers separation collection carrier maps g τ hτ) + H generic (fun ψ env τ hτ => M.symmetricSeparationName_mem a s t b F K basis + pairing unions powers separation collection carrier order group indices supports maps ψ env ⟨τ, hτ⟩) + φ params members hx + exact ⟨y, hy, fun z _ => spec z⟩ + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} (s : Presentation P) + +noncomputable def childFamilyCodes (W : ZFSet.{u}) : ZFSet.{u} := + relationImage s.carrier (ZFSet.sUnion (ZFSet.sUnion (ZFSet.sUnion W))) + (relationConverse (ZFSet.sUnion (ZFSet.sUnion (ZFSet.sUnion W))) s.carrier + (ZFSet.sUnion W)) + +theorem mem_childFamilyCodes (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) + (y : ZFSet.{u}) : + y ∈ childFamilyCodes s W ↔ + ∃ tau : Name s, tau.val ∈ W ∧ ∃ sigma : Name s, ∃ p, + Entry sigma tau p ∧ y = sigma.val := by + rw [childFamilyCodes, mem_relationImage] + constructor + · rintro ⟨_, q, _, coded⟩ + have raw := ((pair_mem_relationConverse _ _ _ y q).1 coded).2.2 + obtain ⟨x, hx, entry⟩ := ZFSet.mem_sUnion.1 raw + let tau : Name s := ⟨x, valid x hx⟩ + obtain ⟨sigma, p, shape⟩ := entries_cover tau entry + refine ⟨tau, hx, sigma, p, ?_, (ZFSet.pair_inj.1 shape).1⟩ + change ZFSet.pair sigma.val (s.encode p) ∈ x + rw [← shape] + exact entry + · rintro ⟨tau, htau, sigma, p, entry, rfl⟩ + have raw : ZFSet.pair sigma.val (s.encode p) ∈ ZFSet.sUnion W := + ZFSet.mem_sUnion.2 ⟨tau.val, htau, entry⟩ + have bound := pair_first_mem_doubleUnion raw + exact ⟨bound, s.encode p, s.encode_mem p, + (pair_mem_relationConverse _ _ _ _ _).2 ⟨bound, s.encode_mem p, raw⟩⟩ + +theorem childFamilyCodes_valid (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) : + ∀ z ∈ childFamilyCodes s W, IsName s z := by + intro z member + obtain ⟨tau, _, sigma, _, _, rfl⟩ := (mem_childFamilyCodes s W valid z).1 member + exact sigma.property + +theorem childFamilyCodes_hs {G : Type v} [Group G] [PartialOrder P] + (a : PosetAction G P) (F : NormalSubgroupFamily G) + (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) + (symmetric : ∀ tau : Name s, tau.val ∈ W → HereditarilySymmetric a s F tau) + (sigma : Name s) (member : sigma.val ∈ childFamilyCodes s W) : + HereditarilySymmetric a s F sigma := by + obtain ⟨tau, htau, child, p, entry, equal⟩ := + (mem_childFamilyCodes s W valid sigma.val).1 member + have same : sigma = child := Subtype.ext equal + exact same.symm ▸ (symmetric tau htau).member entry + +theorem eval_member_childFamilyCodes (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) + (H : Set P) (tau : Name s) (htau : tau.val ∈ W) (x : ZFSet.{u}) + (member : x ∈ eval H tau) : + ∃ sigma : Name s, sigma.val ∈ childFamilyCodes s W ∧ eval H sigma = x := by + obtain ⟨sigma, p, entry, _hp, equal⟩ := (mem_eval H tau x).1 member + exact ⟨sigma, (mem_childFamilyCodes s W valid sigma.val).2 ⟨tau, htau, sigma, p, entry, rfl⟩, equal⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem childFamilyCodes_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (W : ZFSet.{u}) (ground : W ∈ M.sets) : + Name.childFamilyCodes s W ∈ M.sets := by + have entries := M.union_mem unions ground + have bound := M.union_mem unions (M.union_mem unions entries) + exact M.relationImage_mem separation carrier bound + (M.relationConverse_mem pairing unions powers separation bound carrier entries) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} (s : Presentation P) + +noncomputable def descendantFamilyCodes (tau : Name s) : Nat → ZFSet.{u} + | 0 => {tau.val} + | n + 1 => childFamilyCodes s (descendantFamilyCodes tau n) + +theorem descendantFamilyCodes_valid (tau : Name s) (n : Nat) : + ∀ z ∈ descendantFamilyCodes s tau n, IsName s z := by + induction n with + | zero => + intro z member + have same : z = tau.val := ZFSet.mem_singleton.1 member + exact same.symm ▸ tau.property + | succ n ih => exact childFamilyCodes_valid s _ ih + +theorem descendantFamilyCodes_hs {G : Type v} [Group G] [PartialOrder P] + (a : PosetAction G P) (F : NormalSubgroupFamily G) + (tau : Name s) (symmetric : HereditarilySymmetric a s F tau) (n : Nat) : + ∀ sigma : Name s, sigma.val ∈ descendantFamilyCodes s tau n → + HereditarilySymmetric a s F sigma := by + induction n with + | zero => + intro sigma member + have same : sigma = tau := Subtype.ext (ZFSet.mem_singleton.1 member) + exact same.symm ▸ symmetric + | succ n ih => + exact childFamilyCodes_hs s a F _ (descendantFamilyCodes_valid s tau n) ih + +theorem value_member_fourthDescendant (H : Set P) (tau : Name s) + (beta A x : ZFSet.{u}) (edge : ZFSet.pair beta A ∈ eval H tau) (member : x ∈ A) : + ∃ sigma : Name s, sigma.val ∈ descendantFamilyCodes s tau 4 ∧ eval H sigma = x := by + have zero : tau.val ∈ descendantFamilyCodes s tau 0 := ZFSet.mem_singleton.2 rfl + obtain ⟨pairName, first, pairValue⟩ := eval_member_childFamilyCodes s + (descendantFamilyCodes s tau 0) (descendantFamilyCodes_valid s tau 0) H tau zero _ edge + have pairMember : ({beta, A} : ZFSet.{u}) ∈ eval H pairName := by + rw [pairValue] + exact ZFSet.mem_pair.2 (Or.inr rfl) + obtain ⟨unorderedName, second, unorderedValue⟩ := eval_member_childFamilyCodes s + (descendantFamilyCodes s tau 1) (descendantFamilyCodes_valid s tau 1) H pairName first _ pairMember + have valueMember : A ∈ eval H unorderedName := by + rw [unorderedValue] + exact ZFSet.mem_pair.2 (Or.inr rfl) + obtain ⟨valueName, third, valueValue⟩ := eval_member_childFamilyCodes s + (descendantFamilyCodes s tau 2) (descendantFamilyCodes_valid s tau 2) H unorderedName second _ valueMember + have elementMember : x ∈ eval H valueName := valueValue.symm ▸ member + exact eval_member_childFamilyCodes s (descendantFamilyCodes s tau 3) + (descendantFamilyCodes_valid s tau 3) H valueName third x elementMember + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem descendantFamilyCodes_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (tau : Name s) (ground : tau.val ∈ M.sets) (n : Nat) : + Name.descendantFamilyCodes s tau n ∈ M.sets := by + induction n with + | zero => + simpa only [Name.descendantFamilyCodes, ZFSet.pair_eq_singleton] using + M.unorderedPair_mem pairing ground ground + | succ n ih => exact M.childFamilyCodes_mem s pairing unions powers separation carrier _ ih + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem graphValue_fourthDescendant_dense + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) + (z beta : (M.nameDomain s).names) (base : P) + (forced : Forces (M.nameDomain s) + (ex (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula) + (extend z (extend beta Fin.elim0)) base) : + DenseBelow base {q | ∃ tau : (M.nameDomain s).names, + tau.val.val ∈ Name.descendantFamilyCodes s z.val 4 ∧ + Forces (M.nameDomain s) (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula + (extend tau (extend z (extend beta Fin.elim0))) q} := by + have descendants := M.descendantFamilyCodes_mem s pairing unions powers separation carrier + z.val z.property 4 + intro p below + obtain ⟨H, hp, _coded, ordinary⟩ := M.exists_coded_ordinary_generic s small carrier p + obtain ⟨tau, q, hq, _qbase, witness⟩ := ex_witness_in_filter (M.nameDomain s) H ordinary + (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula + (extend z (extend beta Fin.elim0)) (H.upward hp below) forced + have truth := (realize_graphValueMember_values (M.nameDomain s) {r | H.mem r} 0 1 2 + (extend tau (extend z (extend beta Fin.elim0)))).1 + (forces_sound (M.nameDomain s) H ordinary _ _ hq witness) + obtain ⟨A, edge, member⟩ := truth + obtain ⟨sigma, child, same⟩ := Name.value_member_fourthDescendant s {r | H.mem r} + z.val (Name.eval {r | H.mem r} beta.val) A (Name.eval {r | H.mem r} tau.val) edge member + let candidate : (M.nameDomain s).names := ⟨sigma, M.transitive descendants child⟩ + have actual : Realize ((M.nameDomain s).values {r | H.mem r}) + (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula + (evalAssignment {r | H.mem r} (extend candidate (extend z (extend beta Fin.elim0)))) := by + apply (realize_graphValueMember_values (M.nameDomain s) {r | H.mem r} 0 1 2 _).2 + exact ⟨A, edge, same.symm ▸ member⟩ + obtain ⟨r, hr, recorded⟩ := (forcing_truth (M.nameDomain s) H ordinary + (BoundedFormula.graphValueMemberFormula 0 1 2).toFormula + (extend candidate (extend z (extend beta Fin.elim0)))).1 actual + obtain ⟨common, _member, toP, toR⟩ := H.directed hp hr + exact ⟨common, toP, candidate, child, forces_mono (M.nameDomain s) _ _ recorded toR⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIdealProjections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIdealProjections.lean index 21f57e440cabe14ec5ff4e0e3ee9d8bea98926df..c940150493289c5bd78c71dc9ed56afd0e021523 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIdealProjections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIdealProjections.lean @@ -1,100 +1,100 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization Compression Compression.RecursiveMaps SetFormula -universe u - -noncomputable def idealProjectionGraph (P L ν e cap : ZFSet.{u}) : ZFSet.{u} := - relationCompose L L P (indexedRelationSection L L ν cap) (relationConverse P L e) - -namespace TransitiveGround - -theorem idealProjectionGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P L ν e cap : ZFSet.{u}} (hP : P ∈ M.sets) (hL : L ∈ M.sets) - (hν : ν ∈ M.sets) (he : e ∈ M.sets) (hcap : cap ∈ M.sets) : - idealProjectionGraph P L ν e cap ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hL hL hP - (M.indexedRelationSection_mem pairing unions powers separation hL hL hν hcap) - (M.relationConverse_mem pairing unions powers separation hP hL he) - -end TransitiveGround - -variable {A B : Type u} (s : Presentation A) (t : Presentation B) -variable {P : MeetOrder A} {Q : MeetOrder B} (embedding : IdealEmbedding P Q) (top : A) -variable {ν : ZFSet.{u}} -variable (function : ZFSet.IsFunc (ZFSet.prod t.carrier t.carrier) t.carrier ν) -variable (entries : ∀ x y, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) - (t.encode (Q.meet x y)) ∈ ν) -include function entries - -theorem idealProjectionGraph_pair_iff (x : B) (a : A) : - ZFSet.pair (t.encode x) (s.encode a) ∈ idealProjectionGraph s.carrier t.carrier ν - (s.graph t embedding.toFun) (t.encode (embedding.toFun top)) ↔ - embedding.projection top x = a := by - constructor - · intro entry - obtain ⟨_, _, z, hz, meet, inverse⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - have image := ((pair_mem_relationConverse _ _ _ _ _).1 inverse).2.2 - obtain ⟨z', rfl⟩ := (t.mem_carrier z).1 hz - have imageEq := (s.pair_mem_graph t embedding.toFun a z').1 image - have rawMeet := ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 meet).2.2 - obtain ⟨v, _, unique⟩ := function.2 - (ZFSet.pair (t.encode (embedding.toFun top)) (t.encode x)) - (ZFSet.pair_mem_prod.2 ⟨t.encode_mem _, t.encode_mem _⟩) - have eq := t.injective ((unique _ rawMeet).trans (unique _ (entries _ _)).symm) - apply embedding_injective embedding.toMeetEmbedding - rw [embedding.projection_spec, imageEq, eq, meet_comm] - · intro equal - subst a - apply (pair_mem_relationCompose _ _ _ _ _ _ _).2 - refine ⟨t.encode_mem x, s.encode_mem _, t.encode (embedding.toFun (embedding.projection top x)), - t.encode_mem _, ?_, ?_⟩ - · apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 - refine ⟨t.encode_mem _, t.encode_mem _, ?_⟩ - rw [embedding.projection_spec, meet_comm Q x] - exact entries _ _ - · exact (pair_mem_relationConverse _ _ _ _ _).2 - ⟨s.encode_mem _, t.encode_mem _, (s.pair_mem_graph t embedding.toFun _ _).2 rfl⟩ - -theorem idealProjectionGraph_eq : - idealProjectionGraph s.carrier t.carrier ν (s.graph t embedding.toFun) - (t.encode (embedding.toFun top)) = t.graph s (embedding.projection top) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, _, _, a, ha, rfl, _, _⟩ := (mem_relationCompose _ _ _ _ _ _).1 hz - obtain ⟨x, rfl⟩ := (t.mem_carrier x).1 hx - obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha - exact (t.pair_mem_graph s _ _ _).2 ((idealProjectionGraph_pair_iff s t embedding top function entries x a).1 hz) - · intro hz - obtain ⟨x, rfl⟩ := (t.mem_graph s (embedding.projection top) z).1 hz - exact (idealProjectionGraph_pair_iff s t embedding top function entries _ _).2 rfl - -namespace TransitiveGround - -theorem idealProjection_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hP : s.carrier ∈ M.sets) (hL : t.carrier ∈ M.sets) (hν : ν ∈ M.sets) - (he : s.graph t embedding.toFun ∈ M.sets) : - t.graph s (embedding.projection top) ∈ M.sets := by - rw [← idealProjectionGraph_eq s t embedding top function entries] - exact M.idealProjectionGraph_mem pairing unions powers separation hP hL hν he - (M.transitive hL (t.encode_mem _)) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization Compression Compression.RecursiveMaps SetFormula +universe u + +noncomputable def idealProjectionGraph (P L ν e cap : ZFSet.{u}) : ZFSet.{u} := + relationCompose L L P (indexedRelationSection L L ν cap) (relationConverse P L e) + +namespace TransitiveGround + +theorem idealProjectionGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P L ν e cap : ZFSet.{u}} (hP : P ∈ M.sets) (hL : L ∈ M.sets) + (hν : ν ∈ M.sets) (he : e ∈ M.sets) (hcap : cap ∈ M.sets) : + idealProjectionGraph P L ν e cap ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hL hL hP + (M.indexedRelationSection_mem pairing unions powers separation hL hL hν hcap) + (M.relationConverse_mem pairing unions powers separation hP hL he) + +end TransitiveGround + +variable {A B : Type u} (s : Presentation A) (t : Presentation B) +variable {P : MeetOrder A} {Q : MeetOrder B} (embedding : IdealEmbedding P Q) (top : A) +variable {ν : ZFSet.{u}} +variable (function : ZFSet.IsFunc (ZFSet.prod t.carrier t.carrier) t.carrier ν) +variable (entries : ∀ x y, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) + (t.encode (Q.meet x y)) ∈ ν) +include function entries + +theorem idealProjectionGraph_pair_iff (x : B) (a : A) : + ZFSet.pair (t.encode x) (s.encode a) ∈ idealProjectionGraph s.carrier t.carrier ν + (s.graph t embedding.toFun) (t.encode (embedding.toFun top)) ↔ + embedding.projection top x = a := by + constructor + · intro entry + obtain ⟨_, _, z, hz, meet, inverse⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + have image := ((pair_mem_relationConverse _ _ _ _ _).1 inverse).2.2 + obtain ⟨z', rfl⟩ := (t.mem_carrier z).1 hz + have imageEq := (s.pair_mem_graph t embedding.toFun a z').1 image + have rawMeet := ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 meet).2.2 + obtain ⟨v, _, unique⟩ := function.2 + (ZFSet.pair (t.encode (embedding.toFun top)) (t.encode x)) + (ZFSet.pair_mem_prod.2 ⟨t.encode_mem _, t.encode_mem _⟩) + have eq := t.injective ((unique _ rawMeet).trans (unique _ (entries _ _)).symm) + apply embedding_injective embedding.toMeetEmbedding + rw [embedding.projection_spec, imageEq, eq, meet_comm] + · intro equal + subst a + apply (pair_mem_relationCompose _ _ _ _ _ _ _).2 + refine ⟨t.encode_mem x, s.encode_mem _, t.encode (embedding.toFun (embedding.projection top x)), + t.encode_mem _, ?_, ?_⟩ + · apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 + refine ⟨t.encode_mem _, t.encode_mem _, ?_⟩ + rw [embedding.projection_spec, meet_comm Q x] + exact entries _ _ + · exact (pair_mem_relationConverse _ _ _ _ _).2 + ⟨s.encode_mem _, t.encode_mem _, (s.pair_mem_graph t embedding.toFun _ _).2 rfl⟩ + +theorem idealProjectionGraph_eq : + idealProjectionGraph s.carrier t.carrier ν (s.graph t embedding.toFun) + (t.encode (embedding.toFun top)) = t.graph s (embedding.projection top) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, _, _, a, ha, rfl, _, _⟩ := (mem_relationCompose _ _ _ _ _ _).1 hz + obtain ⟨x, rfl⟩ := (t.mem_carrier x).1 hx + obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha + exact (t.pair_mem_graph s _ _ _).2 ((idealProjectionGraph_pair_iff s t embedding top function entries x a).1 hz) + · intro hz + obtain ⟨x, rfl⟩ := (t.mem_graph s (embedding.projection top) z).1 hz + exact (idealProjectionGraph_pair_iff s t embedding top function entries _ _).2 rfl + +namespace TransitiveGround + +theorem idealProjection_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hP : s.carrier ∈ M.sets) (hL : t.carrier ∈ M.sets) (hν : ν ∈ M.sets) + (he : s.graph t embedding.toFun ∈ M.sets) : + t.graph s (embedding.projection top) ∈ M.sets := by + rw [← idealProjectionGraph_eq s t embedding top function entries] + exact M.idealProjectionGraph_mem pairing unions powers separation hP hL hν he + (M.transitive hL (t.encode_mem _)) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInaccessibleConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInaccessibleConditions.lean index 42aa1cd7785ca5cfc35cade2ced892682400b7c5..bb54025473fabed715f4b9b09005bf8408399093 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInaccessibleConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInaccessibleConditions.lean @@ -1,102 +1,102 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def GroundInaccessibleConditions (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := - ordinalSetProperty K ∧ ZFSet.omega ∈ K ∧ GroundRegular M K ∧ GroundStrongLimit M K - -namespace SetFormula - -def groundInaccessibleConditionsFormula {n} (k omega : Fin n) : SetFormula n := - .conj (BoundedFormula.ordinalFormula k).toFormula - (.conj (.mem omega k) (.conj (groundRegularFormula k) (groundStrongLimitFormula k))) - -def existsGroundInaccessibleConditionsFormula {n} (omega : Fin n) : SetFormula n := - ex (groundInaccessibleConditionsFormula 0 omega.succ) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_groundInaccessibleConditionsFormula - (powers : Realize M.sets powerSet Fin.elim0) - {n} (k omega : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (actualOmega : env omega = ZFSet.omega) : - Realize M.sets (groundInaccessibleConditionsFormula k omega) env ↔ - GroundInaccessibleConditions M (env k) := by - change (Realize M.sets (BoundedFormula.ordinalFormula k).toFormula env ∧ - env omega ∈ env k ∧ Realize M.sets (groundRegularFormula k) env ∧ - Realize M.sets (groundStrongLimitFormula k) env) ↔ - (ordinalSetProperty (env k) ∧ ZFSet.omega ∈ env k ∧ GroundRegular M (env k) ∧ GroundStrongLimit M (env k)) - rw [actualOmega] - exact and_congr ((BoundedFormula.realize_ordinalFormula M k env members).trans - (ordinalSetProperty_iff (env k)).symm) - (and_congr Iff.rfl (and_congr (M.realize_groundRegularFormula k env members) - (M.realize_groundStrongLimitFormula powers k env members))) - -theorem realize_existsGroundInaccessibleConditionsFormula - (powers : Realize M.sets powerSet Fin.elim0) - {n} (omega : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (actualOmega : env omega = ZFSet.omega) : - Realize M.sets (existsGroundInaccessibleConditionsFormula omega) env ↔ - ∃ K ∈ M.sets, GroundInaccessibleConditions M K := by - rw [existsGroundInaccessibleConditionsFormula, realize_ex] - exact exists_congr (fun K => and_congr_right (fun hK => - M.realize_groundInaccessibleConditionsFormula powers 0 omega.succ - (extend K env) (Fin.cases hK members) actualOmega)) - -end TransitiveGround - -namespace GroundRegular -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} - -theorem no_surjection (regular : GroundRegular M K) {α f : ZFSet.{u}} - (hα : α ∈ K) (hf : f ∈ M.sets) (function : ZFSet.IsFunc α K f) - (onto : ∀ y ∈ K, ∃ x ∈ α, ZFSet.pair x y ∈ f) : False := by - obtain ⟨δ, hδ, bounded⟩ := regular α hα f hf function - obtain ⟨x, _, entry⟩ := onto δ hδ - exact ZFSet.mem_irrefl δ (bounded x δ entry) - -theorem not_embeddable_to_member (regular : GroundRegular M K) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hK : K ∈ M.sets) {α : ZFSet.{u}} (hα : α ∈ K) : ¬ M.groundEmbeddable K α := by - intro small - obtain ⟨f, hf, function, onto⟩ := M.groundEmbeddable_enumeration pairing unions powers separation - hK (M.transitive hK hα) ⟨α, hα⟩ small - exact regular.no_surjection hα hf function onto - -end GroundRegular - -namespace GroundInaccessibleConditions -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hK : K ∈ M.sets) -include conditions pairing unions powers separation hK - -theorem internal_cardinal : - ordinalSetProperty K ∧ ∀ α ∈ K, ¬ M.groundEmbeddable K α := - ⟨conditions.1, fun _ hα => conditions.2.2.1.not_embeddable_to_member - pairing unions powers separation hK hα⟩ - -theorem not_countable : ¬ M.groundEmbeddable K ZFSet.omega := - conditions.2.2.1.not_embeddable_to_member pairing unions powers separation hK conditions.2.1 - -end GroundInaccessibleConditions - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def GroundInaccessibleConditions (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := + ordinalSetProperty K ∧ ZFSet.omega ∈ K ∧ GroundRegular M K ∧ GroundStrongLimit M K + +namespace SetFormula + +def groundInaccessibleConditionsFormula {n} (k omega : Fin n) : SetFormula n := + .conj (BoundedFormula.ordinalFormula k).toFormula + (.conj (.mem omega k) (.conj (groundRegularFormula k) (groundStrongLimitFormula k))) + +def existsGroundInaccessibleConditionsFormula {n} (omega : Fin n) : SetFormula n := + ex (groundInaccessibleConditionsFormula 0 omega.succ) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_groundInaccessibleConditionsFormula + (powers : Realize M.sets powerSet Fin.elim0) + {n} (k omega : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (actualOmega : env omega = ZFSet.omega) : + Realize M.sets (groundInaccessibleConditionsFormula k omega) env ↔ + GroundInaccessibleConditions M (env k) := by + change (Realize M.sets (BoundedFormula.ordinalFormula k).toFormula env ∧ + env omega ∈ env k ∧ Realize M.sets (groundRegularFormula k) env ∧ + Realize M.sets (groundStrongLimitFormula k) env) ↔ + (ordinalSetProperty (env k) ∧ ZFSet.omega ∈ env k ∧ GroundRegular M (env k) ∧ GroundStrongLimit M (env k)) + rw [actualOmega] + exact and_congr ((BoundedFormula.realize_ordinalFormula M k env members).trans + (ordinalSetProperty_iff (env k)).symm) + (and_congr Iff.rfl (and_congr (M.realize_groundRegularFormula k env members) + (M.realize_groundStrongLimitFormula powers k env members))) + +theorem realize_existsGroundInaccessibleConditionsFormula + (powers : Realize M.sets powerSet Fin.elim0) + {n} (omega : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (actualOmega : env omega = ZFSet.omega) : + Realize M.sets (existsGroundInaccessibleConditionsFormula omega) env ↔ + ∃ K ∈ M.sets, GroundInaccessibleConditions M K := by + rw [existsGroundInaccessibleConditionsFormula, realize_ex] + exact exists_congr (fun K => and_congr_right (fun hK => + M.realize_groundInaccessibleConditionsFormula powers 0 omega.succ + (extend K env) (Fin.cases hK members) actualOmega)) + +end TransitiveGround + +namespace GroundRegular +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} + +theorem no_surjection (regular : GroundRegular M K) {α f : ZFSet.{u}} + (hα : α ∈ K) (hf : f ∈ M.sets) (function : ZFSet.IsFunc α K f) + (onto : ∀ y ∈ K, ∃ x ∈ α, ZFSet.pair x y ∈ f) : False := by + obtain ⟨δ, hδ, bounded⟩ := regular α hα f hf function + obtain ⟨x, _, entry⟩ := onto δ hδ + exact ZFSet.mem_irrefl δ (bounded x δ entry) + +theorem not_embeddable_to_member (regular : GroundRegular M K) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hK : K ∈ M.sets) {α : ZFSet.{u}} (hα : α ∈ K) : ¬ M.groundEmbeddable K α := by + intro small + obtain ⟨f, hf, function, onto⟩ := M.groundEmbeddable_enumeration pairing unions powers separation + hK (M.transitive hK hα) ⟨α, hα⟩ small + exact regular.no_surjection hα hf function onto + +end GroundRegular + +namespace GroundInaccessibleConditions +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hK : K ∈ M.sets) +include conditions pairing unions powers separation hK + +theorem internal_cardinal : + ordinalSetProperty K ∧ ∀ α ∈ K, ¬ M.groundEmbeddable K α := + ⟨conditions.1, fun _ hα => conditions.2.2.1.not_embeddable_to_member + pairing unions powers separation hK hα⟩ + +theorem not_countable : ¬ M.groundEmbeddable K ZFSet.omega := + conditions.2.2.1.not_embeddable_to_member pairing unions powers separation hK conditions.2.1 + +end GroundInaccessibleConditions + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIndexedGraphNameFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIndexedGraphNameFamilies.lean index f73ce86e24e1785e25d9a3bced4c5ecd72385c1b..7f87e32da3aab2a2d5b726328d0cc94fac1c5430 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIndexedGraphNameFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundIndexedGraphNameFamilies.lean @@ -1,309 +1,309 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -noncomputable def indexedGraphNameCode (one I f : ZFSet.{u}) : ZFSet.{u} := - ZFSet.range (fun a : {a : ↥I × ↥(⋃₀ ⋃₀ f) // ZFSet.pair a.1.val a.2.val ∈ f} => - ZFSet.pair (orderedPairNameCode one (checkNameCode one a.val.1.val) a.val.2.val) one) - -theorem mem_indexedGraphNameCode (one I f z : ZFSet.{u}) : - z ∈ indexedGraphNameCode one I f ↔ ∃ i ∈ I, ∃ v, - ZFSet.pair i v ∈ f ∧ z = ZFSet.pair (orderedPairNameCode one (checkNameCode one i) v) one := by - rw [indexedGraphNameCode, ZFSet.mem_range] - constructor - · rintro ⟨a, equal⟩ - exact ⟨a.val.1.val, a.val.1.property, a.val.2.val, a.property, equal.symm⟩ - · rintro ⟨i, hi, v, entry, equal⟩ - exact ⟨⟨(⟨i, hi⟩, ⟨v, pair_second_mem_doubleUnion entry⟩), entry⟩, equal.symm⟩ - -theorem indexedGraphNameCode_eq {P : Type u} (s : Presentation P) (one : P) - {I f : ZFSet.{u}} (function : FunctionGraphOn I f) - (names : ∀ i, IsName s (function.value i)) : - indexedGraphNameCode (s.encode one) I f = (Name.indexedGraphName one function names).val := by - apply ZFSet.ext - intro z - rw [mem_indexedGraphNameCode, Name.mem_indexedGraphName_code] - constructor - · rintro ⟨i, hi, v, entry, equal⟩ - let j : I.toSet := ⟨i, hi⟩ - have value := function.value_eq_of_entry j entry - refine ⟨j, ?_⟩ - rw [Name.check_code_eq, value] - exact equal - · rintro ⟨i, equal⟩ - refine ⟨i.val, i.property, function.value i, function.value_entry i, ?_⟩ - rwa [Name.check_code_eq] at equal - -namespace SetFormula - -def indexedGraphNamePairFormula : SetFormula 4 := - ex (ex (ex (ex (.conj (.mem 3 6) - (.conj (orderedPairFormula 4 3 2) - (.conj (checkNameCodeFormula 1 3 7) - (.conj (orderedPairNameCodeFormula 0 1 2 7) - (orderedPairFormula 5 0 7)))))))) - -def indexedGraphNameCodeFormula : SetFormula 4 := - exactSetFormula 0 (reindex (extend 0 (extend 4 (extend 3 (extend 2 Fin.elim0)))) - (relationImageFormula indexedGraphNamePairFormula)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem realize_indexedGraphNamePairFormula {one I r z : ZFSet.{u}} - (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hr : r ∈ M.sets) (hz : z ∈ M.sets) : - Realize M.sets indexedGraphNamePairFormula (extend r (extend z (extend I (extend one Fin.elim0)))) ↔ - ∃ i ∈ I, ∃ v, r = ZFSet.pair i v ∧ - z = ZFSet.pair (orderedPairNameCode one (checkNameCode one i) v) one := by - rw [indexedGraphNamePairFormula, realize_ex] - constructor - · rintro ⟨i, hiM, rest⟩ - obtain ⟨v, hv, rest⟩ := (realize_ex M.sets _ _).1 rest - obtain ⟨k, hk, rest⟩ := (realize_ex M.sets _ _).1 rest - obtain ⟨w, hw, hi, input, checked, named, output⟩ := (realize_ex M.sets _ _).1 rest - have members : ∀ j, (extend w (extend k (extend v (extend i - (extend r (extend z (extend I (extend one Fin.elim0)))))))) j ∈ M.sets := - Fin.cases hw (Fin.cases hk (Fin.cases hv (Fin.cases hiM (Fin.cases hr - (Fin.cases hz (Fin.cases hI (Fin.cases hone (fun j => Fin.elim0 j)))))))) - have key := (M.realize_checkNameCodeFormula pairing unions powers separation collection 1 3 7 _ members).1 checked - have name := (M.realize_orderedPairNameCodeFormula pairing 0 1 2 7 _ members).1 named - have inp := (M.realize_orderedPairFormula pairing 4 3 2 _ hr hiM hv).1 input - have out := (M.realize_orderedPairFormula pairing 5 0 7 _ hz hw hone).1 output - refine ⟨i, hi, v, inp, ?_⟩ - exact out.trans (congrArg (fun a => ZFSet.pair a one) - (name.trans (congrArg (fun a => orderedPairNameCode one a v) key))) - · rintro ⟨i, hi, v, input, output⟩ - have hiM := M.transitive hI hi - have hv := M.pair_right (input ▸ hr) - have hk := M.checkNameCode_mem pairing unions powers separation collection hone hiM - have hw := M.orderedPairNameCode_mem pairing hone hk hv - refine ⟨i, hiM, ?_⟩ - rw [realize_ex] - refine ⟨v, hv, ?_⟩ - rw [realize_ex] - refine ⟨checkNameCode one i, hk, ?_⟩ - rw [realize_ex] - have members : ∀ j, (extend (orderedPairNameCode one (checkNameCode one i) v) - (extend (checkNameCode one i) (extend v (extend i - (extend r (extend z (extend I (extend one Fin.elim0)))))))) j ∈ M.sets := - Fin.cases hw (Fin.cases hk (Fin.cases hv (Fin.cases hiM (Fin.cases hr - (Fin.cases hz (Fin.cases hI (Fin.cases hone (fun j => Fin.elim0 j)))))))) - exact ⟨_, hw, hi, (M.realize_orderedPairFormula pairing 4 3 2 _ hr hiM hv).2 input, - (M.realize_checkNameCodeFormula pairing unions powers separation collection 1 3 7 _ members).2 rfl, - (M.realize_orderedPairNameCodeFormula pairing 0 1 2 7 _ members).2 rfl, - (M.realize_orderedPairFormula pairing 5 0 7 _ hz hw hone).2 output⟩ - -theorem indexedGraphNameCode_mem {one I f : ZFSet.{u}} - (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hf : f ∈ M.sets) : - indexedGraphNameCode one I f ∈ M.sets := by - let params := extend I (extend one Fin.elim0) - apply M.definable_image_mem separation collection indexedGraphNamePairFormula params - (Fin.cases hI (Fin.cases hone (fun j => Fin.elim0 j))) hf - · intro z hz - obtain ⟨i, hi, v, entry, rfl⟩ := (mem_indexedGraphNameCode one I f z).1 hz - exact M.orderedPair_mem pairing (M.orderedPairNameCode_mem pairing hone - (M.checkNameCode_mem pairing unions powers separation collection hone (M.transitive hI hi)) - (M.pair_right (M.transitive hf entry))) hone - · intro z hz - rw [mem_indexedGraphNameCode] - constructor - · rintro ⟨i, hi, v, entry, equal⟩ - exact ⟨ZFSet.pair i v, entry, - (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection - hone hI (M.transitive hf entry) hz).2 ⟨i, hi, v, rfl, equal⟩⟩ - · rintro ⟨r, hr, formula⟩ - obtain ⟨i, hi, v, shape, equal⟩ := - (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection - hone hI (M.transitive hf hr) hz).1 formula - exact ⟨i, hi, v, shape ▸ hr, equal⟩ - · intro r hr y hy z hz first second - obtain ⟨i, _, v, input, output⟩ := - (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection - hone hI (M.transitive hf hr) hy).1 first - obtain ⟨j, _, w, input', output'⟩ := - (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection - hone hI (M.transitive hf hr) hz).1 second - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 (input.symm.trans input') - exact output.trans output'.symm - -theorem realize_indexedGraphNameCodeFormula {one I f z : ZFSet.{u}} - (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hf : f ∈ M.sets) (hz : z ∈ M.sets) : - Realize M.sets indexedGraphNameCodeFormula (extend z (extend one (extend I (extend f Fin.elim0)))) ↔ - z = indexedGraphNameCode one I f := by - apply M.realize_exactSetFormula 0 _ _ hz - (fun _ member => M.transitive (M.indexedGraphNameCode_mem pairing unions powers separation collection hone hI hf) member) - intro w hw - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_empty] - change Realize M.sets (relationImageFormula indexedGraphNamePairFormula) - (extend w (extend f (extend I (extend one Fin.elim0)))) ↔ w ∈ indexedGraphNameCode one I f - rw [M.realize_relationImageFormula indexedGraphNamePairFormula (extend I (extend one Fin.elim0)) f w hf, - mem_indexedGraphNameCode] - constructor - · rintro ⟨r, hr, formula⟩ - obtain ⟨i, hi, v, shape, equal⟩ := - (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection - hone hI (M.transitive hf hr) hw).1 formula - exact ⟨i, hi, v, shape ▸ hr, equal⟩ - · rintro ⟨i, hi, v, entry, equal⟩ - exact ⟨ZFSet.pair i v, entry, - (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection - hone hI (M.transitive hf entry) hw).2 ⟨i, hi, v, rfl, equal⟩⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem indexedGraphNameCode_enlarge {one I J f : ZFSet.{u}} - (function : FunctionGraphOn I f) (subset : I ⊆ J) : - indexedGraphNameCode one J f = indexedGraphNameCode one I f := by - apply ZFSet.ext - intro z - rw [mem_indexedGraphNameCode, mem_indexedGraphNameCode] - constructor - · rintro ⟨i, _, v, entry, equal⟩ - exact ⟨i, function.pair_source entry, v, entry, equal⟩ - · rintro ⟨i, hi, v, entry, equal⟩ - exact ⟨i, subset hi, v, entry, equal⟩ - -noncomputable def indexedGraphNameFamily (one I F : ZFSet.{u}) : ZFSet.{u} := - familyCodeGraph (fun f : F => f.val) (fun f => indexedGraphNameCode one I f.val) - -theorem mem_indexedGraphNameFamily (one I F z : ZFSet.{u}) : - z ∈ indexedGraphNameFamily one I F ↔ - ∃ f ∈ F, z = ZFSet.pair f (indexedGraphNameCode one I f) := by - rw [indexedGraphNameFamily, mem_familyCodeGraph] - constructor - · rintro ⟨f, equal⟩ - exact ⟨f.val, f.property, equal.symm⟩ - · rintro ⟨f, hf, equal⟩ - exact ⟨⟨f, hf⟩, equal.symm⟩ - -theorem pair_mem_indexedGraphNameFamily (one I F f z : ZFSet.{u}) : - ZFSet.pair f z ∈ indexedGraphNameFamily one I F ↔ - f ∈ F ∧ z = indexedGraphNameCode one I f := by - rw [mem_indexedGraphNameFamily] - constructor - · rintro ⟨g, hg, equal⟩ - obtain ⟨rfl, equal⟩ := ZFSet.pair_inj.1 equal - exact ⟨hg, equal⟩ - · rintro ⟨hf, rfl⟩ - exact ⟨f, hf, rfl⟩ - -theorem indexedGraphNameFamily_function (one I F : ZFSet.{u}) : - FunctionGraphOn F (indexedGraphNameFamily one I F) := by - have eq : ZFSet.range (fun f : F => f.val) = F := by - apply ZFSet.ext - intro f - rw [ZFSet.mem_range] - constructor - · rintro ⟨g, equal⟩ - exact equal ▸ g.property - · intro hf - exact ⟨⟨f, hf⟩, rfl⟩ - simpa only [indexedGraphNameFamily, eq] using familyCodeGraph_function (fun f : F => f.val) - (fun f => indexedGraphNameCode one I f.val) Subtype.val_injective - -namespace SetFormula - -def indexedGraphNameFamilyPairFormula : SetFormula 4 := - .ex (.conj - (reindex (extend 0 (extend 3 (extend 4 (extend 1 Fin.elim0)))) indexedGraphNameCodeFormula) - (orderedPairFormula 2 1 0)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -noncomputable def definable_indexedGraphNameCode : GroundDefinableFunction M - (fun env : Fin 3 → ZFSet.{u} => indexedGraphNameCode (env 0) (env 1) (env 2)) where - formula := indexedGraphNameCodeFormula - closed := fun _ members => M.indexedGraphNameCode_mem pairing unions powers separation collection - (members 0) (members 1) (members 2) - correct := by - intro env members z hz - have equal : env = extend (env 0) (extend (env 1) (extend (env 2) Fin.elim0)) := by - funext j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - exact Fin.cases rfl (fun i => Fin.elim0 i) j - have result := M.realize_indexedGraphNameCodeFormula pairing unions powers separation collection - (members 0) (members 1) (members 2) hz - rw [← equal] at result - exact result - -theorem realize_indexedGraphNameFamilyPairFormula {one I f z : ZFSet.{u}} - (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hf : f ∈ M.sets) (hz : z ∈ M.sets) : - Realize M.sets indexedGraphNameFamilyPairFormula - (extend f (extend z (extend one (extend I Fin.elim0)))) ↔ - z = ZFSet.pair f (indexedGraphNameCode one I f) := by - rw [indexedGraphNameFamilyPairFormula, realize_ex] - constructor - · rintro ⟨v, hv, code, pair⟩ - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_empty] at code - have value := (M.realize_indexedGraphNameCodeFormula pairing unions powers separation collection - hone hI hf hv).1 code - have equal := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hf hv).1 pair - exact value ▸ equal - · intro equal - have hv := M.indexedGraphNameCode_mem pairing unions powers separation collection hone hI hf - refine ⟨indexedGraphNameCode one I f, hv, ?_, - (M.realize_orderedPairFormula pairing 2 1 0 _ hz hf hv).2 equal⟩ - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_empty] - exact (M.realize_indexedGraphNameCodeFormula pairing unions powers separation collection - hone hI hf hv).2 rfl - -theorem indexedGraphNameFamily_mem {one I F : ZFSet.{u}} - (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hF : F ∈ M.sets) : - indexedGraphNameFamily one I F ∈ M.sets := by - apply M.definable_image_mem separation collection indexedGraphNameFamilyPairFormula - (extend one (extend I Fin.elim0)) - (Fin.cases hone (Fin.cases hI (fun j => Fin.elim0 j))) hF - · intro z hz - obtain ⟨f, hf, rfl⟩ := (mem_indexedGraphNameFamily one I F z).1 hz - exact M.orderedPair_mem pairing (M.transitive hF hf) - (M.indexedGraphNameCode_mem pairing unions powers separation collection hone hI (M.transitive hF hf)) - · intro z hz - rw [mem_indexedGraphNameFamily] - exact exists_congr (fun f => and_congr_right (fun hf => - (M.realize_indexedGraphNameFamilyPairFormula pairing unions powers separation collection - hone hI (M.transitive hF hf) hz).symm)) - · intro f hf y hy z hz first second - exact ((M.realize_indexedGraphNameFamilyPairFormula pairing unions powers separation collection - hone hI (M.transitive hF hf) hy).1 first).trans - ((M.realize_indexedGraphNameFamilyPairFormula pairing unions powers separation collection - hone hI (M.transitive hF hf) hz).1 second).symm - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +noncomputable def indexedGraphNameCode (one I f : ZFSet.{u}) : ZFSet.{u} := + ZFSet.range (fun a : {a : ↥I × ↥(⋃₀ ⋃₀ f) // ZFSet.pair a.1.val a.2.val ∈ f} => + ZFSet.pair (orderedPairNameCode one (checkNameCode one a.val.1.val) a.val.2.val) one) + +theorem mem_indexedGraphNameCode (one I f z : ZFSet.{u}) : + z ∈ indexedGraphNameCode one I f ↔ ∃ i ∈ I, ∃ v, + ZFSet.pair i v ∈ f ∧ z = ZFSet.pair (orderedPairNameCode one (checkNameCode one i) v) one := by + rw [indexedGraphNameCode, ZFSet.mem_range] + constructor + · rintro ⟨a, equal⟩ + exact ⟨a.val.1.val, a.val.1.property, a.val.2.val, a.property, equal.symm⟩ + · rintro ⟨i, hi, v, entry, equal⟩ + exact ⟨⟨(⟨i, hi⟩, ⟨v, pair_second_mem_doubleUnion entry⟩), entry⟩, equal.symm⟩ + +theorem indexedGraphNameCode_eq {P : Type u} (s : Presentation P) (one : P) + {I f : ZFSet.{u}} (function : FunctionGraphOn I f) + (names : ∀ i, IsName s (function.value i)) : + indexedGraphNameCode (s.encode one) I f = (Name.indexedGraphName one function names).val := by + apply ZFSet.ext + intro z + rw [mem_indexedGraphNameCode, Name.mem_indexedGraphName_code] + constructor + · rintro ⟨i, hi, v, entry, equal⟩ + let j : I.toSet := ⟨i, hi⟩ + have value := function.value_eq_of_entry j entry + refine ⟨j, ?_⟩ + rw [Name.check_code_eq, value] + exact equal + · rintro ⟨i, equal⟩ + refine ⟨i.val, i.property, function.value i, function.value_entry i, ?_⟩ + rwa [Name.check_code_eq] at equal + +namespace SetFormula + +def indexedGraphNamePairFormula : SetFormula 4 := + ex (ex (ex (ex (.conj (.mem 3 6) + (.conj (orderedPairFormula 4 3 2) + (.conj (checkNameCodeFormula 1 3 7) + (.conj (orderedPairNameCodeFormula 0 1 2 7) + (orderedPairFormula 5 0 7)))))))) + +def indexedGraphNameCodeFormula : SetFormula 4 := + exactSetFormula 0 (reindex (extend 0 (extend 4 (extend 3 (extend 2 Fin.elim0)))) + (relationImageFormula indexedGraphNamePairFormula)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem realize_indexedGraphNamePairFormula {one I r z : ZFSet.{u}} + (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hr : r ∈ M.sets) (hz : z ∈ M.sets) : + Realize M.sets indexedGraphNamePairFormula (extend r (extend z (extend I (extend one Fin.elim0)))) ↔ + ∃ i ∈ I, ∃ v, r = ZFSet.pair i v ∧ + z = ZFSet.pair (orderedPairNameCode one (checkNameCode one i) v) one := by + rw [indexedGraphNamePairFormula, realize_ex] + constructor + · rintro ⟨i, hiM, rest⟩ + obtain ⟨v, hv, rest⟩ := (realize_ex M.sets _ _).1 rest + obtain ⟨k, hk, rest⟩ := (realize_ex M.sets _ _).1 rest + obtain ⟨w, hw, hi, input, checked, named, output⟩ := (realize_ex M.sets _ _).1 rest + have members : ∀ j, (extend w (extend k (extend v (extend i + (extend r (extend z (extend I (extend one Fin.elim0)))))))) j ∈ M.sets := + Fin.cases hw (Fin.cases hk (Fin.cases hv (Fin.cases hiM (Fin.cases hr + (Fin.cases hz (Fin.cases hI (Fin.cases hone (fun j => Fin.elim0 j)))))))) + have key := (M.realize_checkNameCodeFormula pairing unions powers separation collection 1 3 7 _ members).1 checked + have name := (M.realize_orderedPairNameCodeFormula pairing 0 1 2 7 _ members).1 named + have inp := (M.realize_orderedPairFormula pairing 4 3 2 _ hr hiM hv).1 input + have out := (M.realize_orderedPairFormula pairing 5 0 7 _ hz hw hone).1 output + refine ⟨i, hi, v, inp, ?_⟩ + exact out.trans (congrArg (fun a => ZFSet.pair a one) + (name.trans (congrArg (fun a => orderedPairNameCode one a v) key))) + · rintro ⟨i, hi, v, input, output⟩ + have hiM := M.transitive hI hi + have hv := M.pair_right (input ▸ hr) + have hk := M.checkNameCode_mem pairing unions powers separation collection hone hiM + have hw := M.orderedPairNameCode_mem pairing hone hk hv + refine ⟨i, hiM, ?_⟩ + rw [realize_ex] + refine ⟨v, hv, ?_⟩ + rw [realize_ex] + refine ⟨checkNameCode one i, hk, ?_⟩ + rw [realize_ex] + have members : ∀ j, (extend (orderedPairNameCode one (checkNameCode one i) v) + (extend (checkNameCode one i) (extend v (extend i + (extend r (extend z (extend I (extend one Fin.elim0)))))))) j ∈ M.sets := + Fin.cases hw (Fin.cases hk (Fin.cases hv (Fin.cases hiM (Fin.cases hr + (Fin.cases hz (Fin.cases hI (Fin.cases hone (fun j => Fin.elim0 j)))))))) + exact ⟨_, hw, hi, (M.realize_orderedPairFormula pairing 4 3 2 _ hr hiM hv).2 input, + (M.realize_checkNameCodeFormula pairing unions powers separation collection 1 3 7 _ members).2 rfl, + (M.realize_orderedPairNameCodeFormula pairing 0 1 2 7 _ members).2 rfl, + (M.realize_orderedPairFormula pairing 5 0 7 _ hz hw hone).2 output⟩ + +theorem indexedGraphNameCode_mem {one I f : ZFSet.{u}} + (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hf : f ∈ M.sets) : + indexedGraphNameCode one I f ∈ M.sets := by + let params := extend I (extend one Fin.elim0) + apply M.definable_image_mem separation collection indexedGraphNamePairFormula params + (Fin.cases hI (Fin.cases hone (fun j => Fin.elim0 j))) hf + · intro z hz + obtain ⟨i, hi, v, entry, rfl⟩ := (mem_indexedGraphNameCode one I f z).1 hz + exact M.orderedPair_mem pairing (M.orderedPairNameCode_mem pairing hone + (M.checkNameCode_mem pairing unions powers separation collection hone (M.transitive hI hi)) + (M.pair_right (M.transitive hf entry))) hone + · intro z hz + rw [mem_indexedGraphNameCode] + constructor + · rintro ⟨i, hi, v, entry, equal⟩ + exact ⟨ZFSet.pair i v, entry, + (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection + hone hI (M.transitive hf entry) hz).2 ⟨i, hi, v, rfl, equal⟩⟩ + · rintro ⟨r, hr, formula⟩ + obtain ⟨i, hi, v, shape, equal⟩ := + (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection + hone hI (M.transitive hf hr) hz).1 formula + exact ⟨i, hi, v, shape ▸ hr, equal⟩ + · intro r hr y hy z hz first second + obtain ⟨i, _, v, input, output⟩ := + (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection + hone hI (M.transitive hf hr) hy).1 first + obtain ⟨j, _, w, input', output'⟩ := + (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection + hone hI (M.transitive hf hr) hz).1 second + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 (input.symm.trans input') + exact output.trans output'.symm + +theorem realize_indexedGraphNameCodeFormula {one I f z : ZFSet.{u}} + (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hf : f ∈ M.sets) (hz : z ∈ M.sets) : + Realize M.sets indexedGraphNameCodeFormula (extend z (extend one (extend I (extend f Fin.elim0)))) ↔ + z = indexedGraphNameCode one I f := by + apply M.realize_exactSetFormula 0 _ _ hz + (fun _ member => M.transitive (M.indexedGraphNameCode_mem pairing unions powers separation collection hone hI hf) member) + intro w hw + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_empty] + change Realize M.sets (relationImageFormula indexedGraphNamePairFormula) + (extend w (extend f (extend I (extend one Fin.elim0)))) ↔ w ∈ indexedGraphNameCode one I f + rw [M.realize_relationImageFormula indexedGraphNamePairFormula (extend I (extend one Fin.elim0)) f w hf, + mem_indexedGraphNameCode] + constructor + · rintro ⟨r, hr, formula⟩ + obtain ⟨i, hi, v, shape, equal⟩ := + (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection + hone hI (M.transitive hf hr) hw).1 formula + exact ⟨i, hi, v, shape ▸ hr, equal⟩ + · rintro ⟨i, hi, v, entry, equal⟩ + exact ⟨ZFSet.pair i v, entry, + (M.realize_indexedGraphNamePairFormula pairing unions powers separation collection + hone hI (M.transitive hf entry) hw).2 ⟨i, hi, v, rfl, equal⟩⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem indexedGraphNameCode_enlarge {one I J f : ZFSet.{u}} + (function : FunctionGraphOn I f) (subset : I ⊆ J) : + indexedGraphNameCode one J f = indexedGraphNameCode one I f := by + apply ZFSet.ext + intro z + rw [mem_indexedGraphNameCode, mem_indexedGraphNameCode] + constructor + · rintro ⟨i, _, v, entry, equal⟩ + exact ⟨i, function.pair_source entry, v, entry, equal⟩ + · rintro ⟨i, hi, v, entry, equal⟩ + exact ⟨i, subset hi, v, entry, equal⟩ + +noncomputable def indexedGraphNameFamily (one I F : ZFSet.{u}) : ZFSet.{u} := + familyCodeGraph (fun f : F => f.val) (fun f => indexedGraphNameCode one I f.val) + +theorem mem_indexedGraphNameFamily (one I F z : ZFSet.{u}) : + z ∈ indexedGraphNameFamily one I F ↔ + ∃ f ∈ F, z = ZFSet.pair f (indexedGraphNameCode one I f) := by + rw [indexedGraphNameFamily, mem_familyCodeGraph] + constructor + · rintro ⟨f, equal⟩ + exact ⟨f.val, f.property, equal.symm⟩ + · rintro ⟨f, hf, equal⟩ + exact ⟨⟨f, hf⟩, equal.symm⟩ + +theorem pair_mem_indexedGraphNameFamily (one I F f z : ZFSet.{u}) : + ZFSet.pair f z ∈ indexedGraphNameFamily one I F ↔ + f ∈ F ∧ z = indexedGraphNameCode one I f := by + rw [mem_indexedGraphNameFamily] + constructor + · rintro ⟨g, hg, equal⟩ + obtain ⟨rfl, equal⟩ := ZFSet.pair_inj.1 equal + exact ⟨hg, equal⟩ + · rintro ⟨hf, rfl⟩ + exact ⟨f, hf, rfl⟩ + +theorem indexedGraphNameFamily_function (one I F : ZFSet.{u}) : + FunctionGraphOn F (indexedGraphNameFamily one I F) := by + have eq : ZFSet.range (fun f : F => f.val) = F := by + apply ZFSet.ext + intro f + rw [ZFSet.mem_range] + constructor + · rintro ⟨g, equal⟩ + exact equal ▸ g.property + · intro hf + exact ⟨⟨f, hf⟩, rfl⟩ + simpa only [indexedGraphNameFamily, eq] using familyCodeGraph_function (fun f : F => f.val) + (fun f => indexedGraphNameCode one I f.val) Subtype.val_injective + +namespace SetFormula + +def indexedGraphNameFamilyPairFormula : SetFormula 4 := + .ex (.conj + (reindex (extend 0 (extend 3 (extend 4 (extend 1 Fin.elim0)))) indexedGraphNameCodeFormula) + (orderedPairFormula 2 1 0)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +noncomputable def definable_indexedGraphNameCode : GroundDefinableFunction M + (fun env : Fin 3 → ZFSet.{u} => indexedGraphNameCode (env 0) (env 1) (env 2)) where + formula := indexedGraphNameCodeFormula + closed := fun _ members => M.indexedGraphNameCode_mem pairing unions powers separation collection + (members 0) (members 1) (members 2) + correct := by + intro env members z hz + have equal : env = extend (env 0) (extend (env 1) (extend (env 2) Fin.elim0)) := by + funext j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + exact Fin.cases rfl (fun i => Fin.elim0 i) j + have result := M.realize_indexedGraphNameCodeFormula pairing unions powers separation collection + (members 0) (members 1) (members 2) hz + rw [← equal] at result + exact result + +theorem realize_indexedGraphNameFamilyPairFormula {one I f z : ZFSet.{u}} + (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hf : f ∈ M.sets) (hz : z ∈ M.sets) : + Realize M.sets indexedGraphNameFamilyPairFormula + (extend f (extend z (extend one (extend I Fin.elim0)))) ↔ + z = ZFSet.pair f (indexedGraphNameCode one I f) := by + rw [indexedGraphNameFamilyPairFormula, realize_ex] + constructor + · rintro ⟨v, hv, code, pair⟩ + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_empty] at code + have value := (M.realize_indexedGraphNameCodeFormula pairing unions powers separation collection + hone hI hf hv).1 code + have equal := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hf hv).1 pair + exact value ▸ equal + · intro equal + have hv := M.indexedGraphNameCode_mem pairing unions powers separation collection hone hI hf + refine ⟨indexedGraphNameCode one I f, hv, ?_, + (M.realize_orderedPairFormula pairing 2 1 0 _ hz hf hv).2 equal⟩ + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_empty] + exact (M.realize_indexedGraphNameCodeFormula pairing unions powers separation collection + hone hI hf hv).2 rfl + +theorem indexedGraphNameFamily_mem {one I F : ZFSet.{u}} + (hone : one ∈ M.sets) (hI : I ∈ M.sets) (hF : F ∈ M.sets) : + indexedGraphNameFamily one I F ∈ M.sets := by + apply M.definable_image_mem separation collection indexedGraphNameFamilyPairFormula + (extend one (extend I Fin.elim0)) + (Fin.cases hone (Fin.cases hI (fun j => Fin.elim0 j))) hF + · intro z hz + obtain ⟨f, hf, rfl⟩ := (mem_indexedGraphNameFamily one I F z).1 hz + exact M.orderedPair_mem pairing (M.transitive hF hf) + (M.indexedGraphNameCode_mem pairing unions powers separation collection hone hI (M.transitive hF hf)) + · intro z hz + rw [mem_indexedGraphNameFamily] + exact exists_congr (fun f => and_congr_right (fun hf => + (M.realize_indexedGraphNameFamilyPairFormula pairing unions powers separation collection + hone hI (M.transitive hF hf) hz).symm)) + · intro f hf y hy z hz first second + exact ((M.realize_indexedGraphNameFamilyPairFormula pairing unions powers separation collection + hone hI (M.transitive hF hf) hy).1 first).trans + ((M.realize_indexedGraphNameFamilyPairFormula pairing unions powers separation collection + hone hI (M.transitive hF hf) hz).1 second).symm + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInvariantNamePowers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInvariantNamePowers.lean index 4be7038cdd12707691c0d4ed8d0193d15ff23784..8c30d2013b47bd06034f2970c7083006cd92c220 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInvariantNamePowers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundInvariantNamePowers.lean @@ -1,107 +1,107 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowInitialCompression - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem orderedPairNameFamily_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {one X Y K : ZFSet.{u}} - (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hK : K ∈ M.sets) - (standard : GroundStandardInaccessible M K) - (smallX : GroundBelow M X K) (smallY : GroundBelow M Y K) : - GroundBelow M (orderedPairNameFamily one X Y) K := by - obtain ⟨ordinal, omega, regular, strong⟩ := standard.to_conditions pairing unions powers separation hK - have hSingleton : ({one} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hone hone - have singletonSmall := GroundBelow.singleton pairing unions powers separation infinite hK omega hone - have hUnion := M.binary_union_mem pairing unions hX hY - have unionSmall := GroundBelow.binary_union pairing unions powers separation infinite choice - hX hY hK omega ordinal regular strong smallX smallY - have hFirst := M.prod_mem pairing unions powers separation hUnion hSingleton - have firstSmall := GroundBelow.product pairing unions powers separation hUnion hSingleton hK - ordinal strong unionSmall singletonSmall - have hPower := M.groundPower_mem powers hFirst - have powerSmall := strong.power_closed pairing unions powers separation hFirst hK firstSmall - have hSecond := M.prod_mem pairing unions powers separation hPower hSingleton - have secondSmall := GroundBelow.product pairing unions powers separation hPower hSingleton hK - ordinal strong powerSmall singletonSmall - have boundSmall := strong.power_closed pairing unions powers separation hSecond hK secondSmall - exact boundSmall.restrict separation - (M.orderedPairNameFamily_mem pairing unions powers separation hone hX hY) hK - (M.orderedPairNameFamily_subset_bound pairing hone hX hY) - -theorem iteratedPairNameFamily_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {one T K : ZFSet.{u}} - (hone : one ∈ M.sets) (hT : T ∈ M.sets) (hK : K ∈ M.sets) - (standard : GroundStandardInaccessible M K) (small : GroundBelow M T K) (n : Nat) : - GroundBelow M (iteratedPairNameFamily one T n) K := by - induction n with - | zero => exact small - | succ n ih => - exact M.orderedPairNameFamily_below pairing unions powers separation infinite choice hone - (M.iteratedPairNameFamily_mem pairing unions powers separation hone hT n) hT hK standard ih small - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable {G : Type v} [Group G] (a : PosetAction G P) (s : Presentation P) -variable (F : NormalSubgroupFamily G) - -theorem invariantNamePowers - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {T K : ZFSet.{u}} (hone : s.encode ⊤ ∈ M.sets) - (hT : T ∈ M.sets) (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (small : GroundBelow M T K) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : - ∀ n : Nat, let terms := iteratedPairNameFamily (s.encode ⊤) T n - terms ∈ M.sets ∧ GroundBelow M terms K ∧ - (∀ z ∈ terms, IsName s z) ∧ - (∀ σ : Name s, σ.val ∈ terms → HereditarilySymmetric a s F σ) ∧ - ∃ τ : Name s, τ.val ∈ M.sets ∧ τ.val = ZFSet.prod terms {s.encode ⊤} ∧ - HereditarilySymmetric a s F τ ∧ (∀ g, a.act s g τ = τ) ∧ - ∀ H : Set P, ⊤ ∈ H → ∀ x, - x ∈ Name.eval H τ ↔ ∃ σ : Name s, σ.val ∈ terms ∧ Name.eval H σ = x := by - intro n - let terms := iteratedPairNameFamily (s.encode ⊤) T n - have hTerms := M.iteratedPairNameFamily_mem pairing unions powers separation hone hT n - have typed := iteratedPairNameFamily_valid (s := s) ⊤ valid n - refine ⟨hTerms, M.iteratedPairNameFamily_below pairing unions powers separation infinite choice - hone hT hK standard small n, typed, iteratedPairNameFamily_hs a F valid children n, - Name.familySet ⊤ terms typed, - M.familySet_mem s ⊤ pairing unions powers separation hTerms hone typed, - Name.familySet_code ⊤ terms typed, - iteratedPairNameFamilySet_hs a F valid closed children n, - iteratedPairNameFamilySet_invariant a valid closed n, ?_⟩ - intro H top x - exact Name.mem_eval_familySet H ⊤ top terms typed x - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowInitialCompression + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem orderedPairNameFamily_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {one X Y K : ZFSet.{u}} + (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hK : K ∈ M.sets) + (standard : GroundStandardInaccessible M K) + (smallX : GroundBelow M X K) (smallY : GroundBelow M Y K) : + GroundBelow M (orderedPairNameFamily one X Y) K := by + obtain ⟨ordinal, omega, regular, strong⟩ := standard.to_conditions pairing unions powers separation hK + have hSingleton : ({one} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hone hone + have singletonSmall := GroundBelow.singleton pairing unions powers separation infinite hK omega hone + have hUnion := M.binary_union_mem pairing unions hX hY + have unionSmall := GroundBelow.binary_union pairing unions powers separation infinite choice + hX hY hK omega ordinal regular strong smallX smallY + have hFirst := M.prod_mem pairing unions powers separation hUnion hSingleton + have firstSmall := GroundBelow.product pairing unions powers separation hUnion hSingleton hK + ordinal strong unionSmall singletonSmall + have hPower := M.groundPower_mem powers hFirst + have powerSmall := strong.power_closed pairing unions powers separation hFirst hK firstSmall + have hSecond := M.prod_mem pairing unions powers separation hPower hSingleton + have secondSmall := GroundBelow.product pairing unions powers separation hPower hSingleton hK + ordinal strong powerSmall singletonSmall + have boundSmall := strong.power_closed pairing unions powers separation hSecond hK secondSmall + exact boundSmall.restrict separation + (M.orderedPairNameFamily_mem pairing unions powers separation hone hX hY) hK + (M.orderedPairNameFamily_subset_bound pairing hone hX hY) + +theorem iteratedPairNameFamily_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {one T K : ZFSet.{u}} + (hone : one ∈ M.sets) (hT : T ∈ M.sets) (hK : K ∈ M.sets) + (standard : GroundStandardInaccessible M K) (small : GroundBelow M T K) (n : Nat) : + GroundBelow M (iteratedPairNameFamily one T n) K := by + induction n with + | zero => exact small + | succ n ih => + exact M.orderedPairNameFamily_below pairing unions powers separation infinite choice hone + (M.iteratedPairNameFamily_mem pairing unions powers separation hone hT n) hT hK standard ih small + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable {G : Type v} [Group G] (a : PosetAction G P) (s : Presentation P) +variable (F : NormalSubgroupFamily G) + +theorem invariantNamePowers + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {T K : ZFSet.{u}} (hone : s.encode ⊤ ∈ M.sets) + (hT : T ∈ M.sets) (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (small : GroundBelow M T K) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : + ∀ n : Nat, let terms := iteratedPairNameFamily (s.encode ⊤) T n + terms ∈ M.sets ∧ GroundBelow M terms K ∧ + (∀ z ∈ terms, IsName s z) ∧ + (∀ σ : Name s, σ.val ∈ terms → HereditarilySymmetric a s F σ) ∧ + ∃ τ : Name s, τ.val ∈ M.sets ∧ τ.val = ZFSet.prod terms {s.encode ⊤} ∧ + HereditarilySymmetric a s F τ ∧ (∀ g, a.act s g τ = τ) ∧ + ∀ H : Set P, ⊤ ∈ H → ∀ x, + x ∈ Name.eval H τ ↔ ∃ σ : Name s, σ.val ∈ terms ∧ Name.eval H σ = x := by + intro n + let terms := iteratedPairNameFamily (s.encode ⊤) T n + have hTerms := M.iteratedPairNameFamily_mem pairing unions powers separation hone hT n + have typed := iteratedPairNameFamily_valid (s := s) ⊤ valid n + refine ⟨hTerms, M.iteratedPairNameFamily_below pairing unions powers separation infinite choice + hone hT hK standard small n, typed, iteratedPairNameFamily_hs a F valid children n, + Name.familySet ⊤ terms typed, + M.familySet_mem s ⊤ pairing unions powers separation hTerms hone typed, + Name.familySet_code ⊤ terms typed, + iteratedPairNameFamilySet_hs a F valid closed children n, + iteratedPairNameFamilySet_invariant a valid closed n, ?_⟩ + intro H top x + exact Name.mem_eval_familySet H ⊤ top terms typed x + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundLayerWitnessPushforward.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundLayerWitnessPushforward.lean index 135413bed38771fab929bfbd69ed4b79b71a2d09..56bb9f91c135429596e35bb527aa0c3623bbd704 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundLayerWitnessPushforward.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundLayerWitnessPushforward.lean @@ -1,58 +1,58 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRawLayerPushforward - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GrowthLayerWitnessCode -open SetFormula -universe u - -theorem ground_pushforward - {M : TransitiveGround.{u}} {Qs rs μs A B rA rB μA μB old born t N z e : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) - (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) - (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) - (preserves : ∀ x y a, ZFSet.pair x y ∈ e → - (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) - (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' := by - rcases code with ⟨D, injection, rfl, code⟩ | - ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | - ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ - · have fields := M.nonemptyTupleCode_field_mem 2 _ hz - obtain ⟨D', hD', injection', hInjection', copied⟩ := code.ground_pushforward - pairing unions powers separation hA hB hN he (fields 1) (fields 2) - embedding.injection preserves noNew - exact ⟨countableLayerWitness D' injection', M.countableLayerWitness_mem pairing hD' hInjection', - Or.inl ⟨D', injection', rfl, copied⟩⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ hz - obtain ⟨hMaps', hW', hParts', copied⟩ := code.ground_pushforward - pairing unions powers separation hA hB he hQs (fields 1) (fields 2) (fields 4) - embedding preserves noNew - exact ⟨copyLayerWitness I (relationCompose I A B parts e) Indices - (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) - (M.groundRelations (familyPointBound Qs) B) injection, - M.copyLayerWitness_mem pairing unions (fields 1) hParts' (fields 3) hMaps' hW' (fields 6), - Or.inr (Or.inl ⟨I, _, Indices, _, _, injection, rfl, copied⟩)⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ hz - obtain ⟨hMaps', hW', hComponents', hF', copied⟩ := code.ground_pushforward - pairing unions powers separation hA hB he hQs (fields 1) (fields 3) (fields 5) (fields 6) - source embedding preserves noNew - exact ⟨separatedLayerWitness I Indices - (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) - (M.groundRelations (familyPointBound Qs) B) - (pushedHeightGraph F B I (layerFiberEmbedding F B e) Components) - (relationImage F B (layerFiberEmbedding F B e)), - M.separatedLayerWitness_mem pairing unions (fields 1) (fields 2) hMaps' hW' hComponents' hF', - Or.inr (Or.inr ⟨I, Indices, _, _, _, _, rfl, copied⟩)⟩ - -end PartitionPilot.Forcing.GrowthLayerWitnessCode - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRawLayerPushforward + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GrowthLayerWitnessCode +open SetFormula +universe u + +theorem ground_pushforward + {M : TransitiveGround.{u}} {Qs rs μs A B rA rB μA μB old born t N z e : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) + (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) + (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) + (preserves : ∀ x y a, ZFSet.pair x y ∈ e → + (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) + (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' := by + rcases code with ⟨D, injection, rfl, code⟩ | + ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | + ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ + · have fields := M.nonemptyTupleCode_field_mem 2 _ hz + obtain ⟨D', hD', injection', hInjection', copied⟩ := code.ground_pushforward + pairing unions powers separation hA hB hN he (fields 1) (fields 2) + embedding.injection preserves noNew + exact ⟨countableLayerWitness D' injection', M.countableLayerWitness_mem pairing hD' hInjection', + Or.inl ⟨D', injection', rfl, copied⟩⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ hz + obtain ⟨hMaps', hW', hParts', copied⟩ := code.ground_pushforward + pairing unions powers separation hA hB he hQs (fields 1) (fields 2) (fields 4) + embedding preserves noNew + exact ⟨copyLayerWitness I (relationCompose I A B parts e) Indices + (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) + (M.groundRelations (familyPointBound Qs) B) injection, + M.copyLayerWitness_mem pairing unions (fields 1) hParts' (fields 3) hMaps' hW' (fields 6), + Or.inr (Or.inl ⟨I, _, Indices, _, _, injection, rfl, copied⟩)⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ hz + obtain ⟨hMaps', hW', hComponents', hF', copied⟩ := code.ground_pushforward + pairing unions powers separation hA hB he hQs (fields 1) (fields 3) (fields 5) (fields 6) + source embedding preserves noNew + exact ⟨separatedLayerWitness I Indices + (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) + (M.groundRelations (familyPointBound Qs) B) + (pushedHeightGraph F B I (layerFiberEmbedding F B e) Components) + (relationImage F B (layerFiberEmbedding F B e)), + M.separatedLayerWitness_mem pairing unions (fields 1) (fields 2) hMaps' hW' hComponents' hF', + Or.inr (Or.inr ⟨I, Indices, _, _, _, _, rfl, copied⟩)⟩ + +end PartitionPilot.Forcing.GrowthLayerWitnessCode + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainConditionalTotality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainConditionalTotality.lean index 81893f368b1688a522f4e6ad5984cd1a891c1579..8b8ff45d5b173fb9cd6a474738447818abbbe3a4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainConditionalTotality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainConditionalTotality.lean @@ -1,162 +1,162 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -def mainPrefixConditionalParams (K Labels C D rD N f : ZFSet.{u}) : Fin 7 → ZFSet.{u} := - extend K (extend Labels (extend C (extend D (extend rD (extend N (extend f Fin.elim0)))))) - -noncomputable def mainPrefixConditionalRelation (S K Labels C D rD N f : ZFSet.{u}) : ZFSet.{u} := - M.definableRelation (mainPrefixConditionalStepFormula 2 3 4 5 6 7 8 (0 : Fin 9) 1) - (mainPrefixConditionalParams K Labels C D rD N f) S S - -theorem mainPrefixConditionalRelation_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {S K Labels C D rD N f : ZFSet.{u}} (hS : S ∈ M.sets) - (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) : - M.mainPrefixConditionalRelation S K Labels C D rD N f ∈ M.sets := - M.definableRelation_mem pairing unions powers separation _ _ - (Fin.cases hK (Fin.cases hLabels (Fin.cases hC (Fin.cases hD (Fin.cases hrD - (Fin.cases hN (Fin.cases hf (fun j => Fin.elim0 j)))))))) hS hS - -theorem mainPrefixConditionalRelation_entry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {S K Labels C D rD N f : ZFSet.{u}} (hS : S ∈ M.sets) - (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) - (omega : N = ZFSet.omega) (ordinal : ordinalSetProperty K) (old next : ZFSet.{u}) : - ZFSet.pair old next ∈ M.mainPrefixConditionalRelation S K Labels C D rD N f ↔ - old ∈ S ∧ next ∈ S ∧ MainPrefixConditionalStepCode M K Labels C D rD N f old next := by - rw [mainPrefixConditionalRelation, M.pair_mem_definableRelation] - apply and_congr_right - intro oldMember - apply and_congr_right - intro nextMember - exact M.realize_mainPrefixConditionalStepFormula pairing unions powers separation collection - 2 3 4 5 6 7 8 0 1 - (extend old (extend next (mainPrefixConditionalParams K Labels C D rD N f))) - (Fin.cases (M.transitive hS oldMember) (Fin.cases (M.transitive hS nextMember) - (Fin.cases hK (Fin.cases hLabels (Fin.cases hC (Fin.cases hD (Fin.cases hrD - (Fin.cases hN (Fin.cases hf (fun j => Fin.elim0 j)))))))))) omega ordinal - -theorem choose_mainPrefixConditionalSteps - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - {S K Labels C D rD N f : ZFSet.{u}} (hS : S ∈ M.sets) - (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) - (omega : N = ZFSet.omega) (ordinal : ordinalSetProperty K) - (total : ∀ old ∈ S, ∃ next ∈ S, MainPrefixConditionalStepCode M K Labels C D rD N f old next) : - ∃ g ∈ M.sets, ZFSet.IsFunc S S g ∧ - g ⊆ M.mainPrefixConditionalRelation S K Labels C D rD N f ∧ - ∀ old next, ZFSet.pair old next ∈ g → - next ∈ S ∧ MainPrefixConditionalStepCode M K Labels C D rD N f old next := by - have entries := M.mainPrefixConditionalRelation_entry pairing unions powers separation collection - hS hK hLabels hC hD hrD hN hf omega ordinal - obtain ⟨g, ground, function, included⟩ := M.uniformize_relation pairing unions powers separation choice - hS hS (M.mainPrefixConditionalRelation_ground pairing unions powers separation - hS hK hLabels hC hD hrD hN hf) (by - intro old oldMember - obtain ⟨next, nextMember, code⟩ := total old oldMember - exact ⟨next, nextMember, (entries old next).2 ⟨oldMember, nextMember, code⟩⟩) - exact ⟨g, ground, function, included, fun old next entry => - ((entries old next).1 (included entry)).2⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundMainCandidateLevel -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) - -theorem conditionalSteps_total - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Labels C D rD f : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (hLabels : Labels ∈ M.sets) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (function : ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K Labels C D rD) - (ZFSet.prod level.carrier level.carrier) f) - (selected : f ⊆ M.taskBearingSuccessorRelation - (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) - (old : ZFSet.{u}) - (member : old ∈ level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) : - ∃ next ∈ level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD, - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next := by - obtain ⟨T, _, indexMember, nonempty, inhabited, ordinal, run, indices, equal, preserved, rank⟩ := - level.exists_prefix_of_mem_recursionPrefixes pairing unions powers separation member - let := ordinalMainIndexPreorder ordinal - have actualIndex : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite := - indices.symm ▸ indexMember - rcases ordinal_successor_or_nonzeroLimit ordinal nonempty with successor | limit - · obtain ⟨b, _, successor⟩ := successor - obtain ⟨next, _, nextMember, code⟩ := run.exists_selectedStepCode collection infinite hK standard hLabels - preserved rank actualIndex (indices.trans successor) level function selected - exact ⟨next, nextMember, Or.inl (equal ▸ code)⟩ - · obtain ⟨i₀⟩ := inhabited - obtain ⟨next, _, nextMember, code⟩ := run.exists_limitStepCode preserved i₀ collection infinite choice - columns_eq actualIndex rank hK standard level - refine ⟨next, nextMember, Or.inr ⟨T, run.stageGraph, run.transitionGraph, ?_, limit, equal ▸ code⟩⟩ - exact equal.symm.trans (congrArg - (fun U => mainPrefixCode U run.stageGraph run.transitionGraph) indices) - -theorem exists_groundConditionalPrefixFunction - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Labels C D rD f : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (hLabels : Labels ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (hf : f ∈ M.sets) - (function : ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K Labels C D rD) - (ZFSet.prod level.carrier level.carrier) f) - (selected : f ⊆ M.taskBearingSuccessorRelation - (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) : - let S := level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD - ∃ g ∈ M.sets, ZFSet.IsFunc S S g ∧ - g ⊆ M.mainPrefixConditionalRelation S K Labels C D rD ZFSet.omega f ∧ - ∀ old next, ZFSet.pair old next ∈ g → - next ∈ S ∧ MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next := by - have hOmega := M.transitive hK - (standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK) - have hC : C ∈ M.sets := columns_eq.symm ▸ hOmega - have hS := level.recursionPrefixes_ground pairing unions powers separation collection infinite - hK standard.1.1 hOmega hLabels hC hD hrD - exact M.choose_mainPrefixConditionalSteps pairing unions powers separation collection choice - hS hK hLabels hC hD hrD (M.omega_mem separation infinite) hf rfl standard.1.1 - (level.conditionalSteps_total pairing unions powers separation collection infinite choice - hK standard hLabels columns_eq function selected) - -end PartitionPilot.Forcing.GroundMainCandidateLevel - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +def mainPrefixConditionalParams (K Labels C D rD N f : ZFSet.{u}) : Fin 7 → ZFSet.{u} := + extend K (extend Labels (extend C (extend D (extend rD (extend N (extend f Fin.elim0)))))) + +noncomputable def mainPrefixConditionalRelation (S K Labels C D rD N f : ZFSet.{u}) : ZFSet.{u} := + M.definableRelation (mainPrefixConditionalStepFormula 2 3 4 5 6 7 8 (0 : Fin 9) 1) + (mainPrefixConditionalParams K Labels C D rD N f) S S + +theorem mainPrefixConditionalRelation_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {S K Labels C D rD N f : ZFSet.{u}} (hS : S ∈ M.sets) + (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) : + M.mainPrefixConditionalRelation S K Labels C D rD N f ∈ M.sets := + M.definableRelation_mem pairing unions powers separation _ _ + (Fin.cases hK (Fin.cases hLabels (Fin.cases hC (Fin.cases hD (Fin.cases hrD + (Fin.cases hN (Fin.cases hf (fun j => Fin.elim0 j)))))))) hS hS + +theorem mainPrefixConditionalRelation_entry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {S K Labels C D rD N f : ZFSet.{u}} (hS : S ∈ M.sets) + (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) + (omega : N = ZFSet.omega) (ordinal : ordinalSetProperty K) (old next : ZFSet.{u}) : + ZFSet.pair old next ∈ M.mainPrefixConditionalRelation S K Labels C D rD N f ↔ + old ∈ S ∧ next ∈ S ∧ MainPrefixConditionalStepCode M K Labels C D rD N f old next := by + rw [mainPrefixConditionalRelation, M.pair_mem_definableRelation] + apply and_congr_right + intro oldMember + apply and_congr_right + intro nextMember + exact M.realize_mainPrefixConditionalStepFormula pairing unions powers separation collection + 2 3 4 5 6 7 8 0 1 + (extend old (extend next (mainPrefixConditionalParams K Labels C D rD N f))) + (Fin.cases (M.transitive hS oldMember) (Fin.cases (M.transitive hS nextMember) + (Fin.cases hK (Fin.cases hLabels (Fin.cases hC (Fin.cases hD (Fin.cases hrD + (Fin.cases hN (Fin.cases hf (fun j => Fin.elim0 j)))))))))) omega ordinal + +theorem choose_mainPrefixConditionalSteps + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + {S K Labels C D rD N f : ZFSet.{u}} (hS : S ∈ M.sets) + (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) + (omega : N = ZFSet.omega) (ordinal : ordinalSetProperty K) + (total : ∀ old ∈ S, ∃ next ∈ S, MainPrefixConditionalStepCode M K Labels C D rD N f old next) : + ∃ g ∈ M.sets, ZFSet.IsFunc S S g ∧ + g ⊆ M.mainPrefixConditionalRelation S K Labels C D rD N f ∧ + ∀ old next, ZFSet.pair old next ∈ g → + next ∈ S ∧ MainPrefixConditionalStepCode M K Labels C D rD N f old next := by + have entries := M.mainPrefixConditionalRelation_entry pairing unions powers separation collection + hS hK hLabels hC hD hrD hN hf omega ordinal + obtain ⟨g, ground, function, included⟩ := M.uniformize_relation pairing unions powers separation choice + hS hS (M.mainPrefixConditionalRelation_ground pairing unions powers separation + hS hK hLabels hC hD hrD hN hf) (by + intro old oldMember + obtain ⟨next, nextMember, code⟩ := total old oldMember + exact ⟨next, nextMember, (entries old next).2 ⟨oldMember, nextMember, code⟩⟩) + exact ⟨g, ground, function, included, fun old next entry => + ((entries old next).1 (included entry)).2⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundMainCandidateLevel +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) + +theorem conditionalSteps_total + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Labels C D rD f : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (hLabels : Labels ∈ M.sets) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (function : ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K Labels C D rD) + (ZFSet.prod level.carrier level.carrier) f) + (selected : f ⊆ M.taskBearingSuccessorRelation + (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) + (old : ZFSet.{u}) + (member : old ∈ level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) : + ∃ next ∈ level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD, + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next := by + obtain ⟨T, _, indexMember, nonempty, inhabited, ordinal, run, indices, equal, preserved, rank⟩ := + level.exists_prefix_of_mem_recursionPrefixes pairing unions powers separation member + let := ordinalMainIndexPreorder ordinal + have actualIndex : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite := + indices.symm ▸ indexMember + rcases ordinal_successor_or_nonzeroLimit ordinal nonempty with successor | limit + · obtain ⟨b, _, successor⟩ := successor + obtain ⟨next, _, nextMember, code⟩ := run.exists_selectedStepCode collection infinite hK standard hLabels + preserved rank actualIndex (indices.trans successor) level function selected + exact ⟨next, nextMember, Or.inl (equal ▸ code)⟩ + · obtain ⟨i₀⟩ := inhabited + obtain ⟨next, _, nextMember, code⟩ := run.exists_limitStepCode preserved i₀ collection infinite choice + columns_eq actualIndex rank hK standard level + refine ⟨next, nextMember, Or.inr ⟨T, run.stageGraph, run.transitionGraph, ?_, limit, equal ▸ code⟩⟩ + exact equal.symm.trans (congrArg + (fun U => mainPrefixCode U run.stageGraph run.transitionGraph) indices) + +theorem exists_groundConditionalPrefixFunction + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Labels C D rD f : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (hLabels : Labels ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (hf : f ∈ M.sets) + (function : ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K Labels C D rD) + (ZFSet.prod level.carrier level.carrier) f) + (selected : f ⊆ M.taskBearingSuccessorRelation + (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) : + let S := level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD + ∃ g ∈ M.sets, ZFSet.IsFunc S S g ∧ + g ⊆ M.mainPrefixConditionalRelation S K Labels C D rD ZFSet.omega f ∧ + ∀ old next, ZFSet.pair old next ∈ g → + next ∈ S ∧ MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next := by + have hOmega := M.transitive hK + (standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK) + have hC : C ∈ M.sets := columns_eq.symm ▸ hOmega + have hS := level.recursionPrefixes_ground pairing unions powers separation collection infinite + hK standard.1.1 hOmega hLabels hC hD hrD + exact M.choose_mainPrefixConditionalSteps pairing unions powers separation collection choice + hS hK hLabels hC hD hrD (M.omega_mem separation infinite) hf rfl standard.1.1 + (level.conditionalSteps_total pairing unions powers separation collection infinite choice + hK standard hLabels columns_eq function selected) + +end PartitionPilot.Forcing.GroundMainCandidateLevel + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalCompressedNameForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalCompressedNameForcing.lean index 850c188f8fdfbbd6e5e271dcacae5ed9fe88b116..79776aa23e9babb9971214e4cb98f94701d48c80 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalCompressedNameForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalCompressedNameForcing.lean @@ -1,212 +1,212 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralCompression - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_compressed_name_forcing - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - ∀ {n : Nat} (phi : SetFormula (n + 1)) (tau : (M.nameDomain upper).names) - (tail : Fin n → (M.nameDomain upper).names) (V E : SetMembers geometry.carrier) - (p : SetMembers upperQ), V < E → - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) tau.val → - (∀ j, a.principalFix V ≤ upperAct.stabilizer upper (tail j).val) → - Forces (M.nameDomain upper) phi (extend tau tail) p → - ∃ g : SetMembers geometry.actors, g ∈ a.principalFix V ∧ - ∃ sigma : (M.nameDomain upper).names, - sigma.val = upperAct.act upper g tau.val ∧ - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) sigma.val ∧ - a.principalFix E ≤ upperAct.stabilizer upper sigma.val ∧ - ∃ r q : SetMembers upperQ, - r ≤ p ∧ StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw r) ∧ - q ≤ r ∧ q ≤ upperAct.iso g r ∧ q ≤ p ∧ q ≤ upperAct.iso g p ∧ - Forces (M.nameDomain upper) phi (extend sigma tail) q := by - intro geometry - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - intro s b a directed hL hG hC order graph nodeMaps supports - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - coordinates two carrier forcingOrder forcingAction omega topMem topRows packed upperQ - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - intro upperAct upper n phi tau tail V E p strict hsTau fixedTail forced - have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers - separation carrier hLifted hs hPacked omega - have hAssignments := (M.definable_structuralAssignments pairing unions powers separation collection).closed - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hAssignmentAction := M.structuralAssignmentActionGraph_mem pairing unions powers separation - collection hG hL order graph supports hLifted hSquared hs hh - have hGraph : upperAct.actionGraph upper b ∈ M.sets := by - erw [M.semanticStructuralAction_graph] - exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection hG hQ - carrier (M.union_mem unions (M.union_mem unions hQ)) hAssignments forcingAction hAssignmentAction - have maps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b pairing unions powers separation - collection hQ hG hGraph - have closed : ∀ g nu, nu ∈ (M.nameDomain upper).names → - upperAct.act upper g nu ∈ (M.nameDomain upper).names := - M.act_mem upper upperAct b pairing unions powers separation collection hQ maps - obtain ⟨B, supportTau⟩ := hsTau.symmetric - obtain ⟨rawR, memberR, belowRaw, support, _hSupport, _subsetSupport, _smallSupport, prepared⟩ := - fulfilled.structural_support_prepared_strengthening collection infinite choice small smallD - irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace (SetMembers.raw p) (SetMembers.raw_mem p) - let r : SetMembers upperQ := SetMembers.ofMem rawR memberR - have rRaw : SetMembers.raw r = rawR := SetMembers.raw_ofMem _ _ - have below : r ≤ p := by - change ZFSet.pair (SetMembers.raw r) (SetMembers.raw p) ∈ _ - rw [rRaw] - exact belowRaw - have preparedR : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier - (SetMembers.raw r) := by - rw [rRaw] - exact prepared.forget - let sourceRow := M.refinementHistoryRowFunction c lifted stages packed r - obtain ⟨A, rCode⟩ := M.refinementHistoryRowFunction_coordinates c lifted stages packed r - obtain ⟨dBound, vd, bd, usedD, dataD⟩ := fulfilled.toFinalFulfillment.structural_bounds_with - collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - r sourceRow A V B rCode - have condition : ZFSet.pair (c.encode sourceRow) A ∈ upperQ := rCode ▸ SetMembers.raw_mem r - have preparedCode : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier - (ZFSet.pair (c.encode sourceRow) A) := rCode ▸ preparedR - obtain ⟨g, cap, fixed, _strictCap, capE, movedD, commonRow, _rowCode, memberQ, toR, toMovedR⟩ := - fulfilled.structural_compression collection infinite choice labels small columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace sourceRow A condition preparedCode V E dBound - strict vd usedD dataD - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode g) A - let rawQ := ZFSet.pair (c.encode commonRow) (A ∪ movedA) - let q : SetMembers upperQ := SetMembers.ofMem rawQ memberQ - have qRaw : SetMembers.raw q = rawQ := SetMembers.raw_ofMem _ _ - have qr : q ≤ r := by - change ZFSet.pair (SetMembers.raw q) (SetMembers.raw r) ∈ _ - rw [qRaw, rCode] - exact toR - have movedCode : SetMembers.raw (upperAct.iso g r) = - ZFSet.pair (c.encode (act.iso g sourceRow)) movedA := - M.semanticStructuralAction_coordinates c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace g r sourceRow A rCode - have qgr : q ≤ upperAct.iso g r := by - change ZFSet.pair (SetMembers.raw q) (SetMembers.raw (upperAct.iso g r)) ∈ _ - rw [qRaw, movedCode] - exact toMovedR - let sigma : (M.nameDomain upper).names := ⟨upperAct.act upper g tau.val, closed g tau.val tau.property⟩ - have supported : a.principalFix E ≤ upperAct.stabilizer upper sigma.val := - upperAct.compressed_name_support upper a g dBound E tau.val - ((a.principalFix_antitone bd).trans supportTau) (movedD.trans capE) - have forcedR := forces_mono (M.nameDomain upper) phi (extend tau tail) forced below - have translated := (upperAct.formula_forces_act_iff upper (M.nameDomain upper) closed g - phi (extend tau tail) r).2 forcedR - have envEq : upperAct.actAssignment upper (M.nameDomain upper) closed g (extend tau tail) = - extend sigma tail := by - funext j - refine Fin.cases ?_ (fun i => ?_) j - · rfl - · apply Subtype.ext - exact fixedTail i fixed - rw [envEq] at translated - exact ⟨g, fixed, sigma, rfl, hsTau.translated g, supported, - r, q, below, preparedR, qr, qgr, qr.trans below, - qgr.trans ((upperAct.iso g).monotone below), - forces_mono (M.nameDomain upper) phi (extend sigma tail) translated qgr⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralCompression + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_compressed_name_forcing + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + ∀ {n : Nat} (phi : SetFormula (n + 1)) (tau : (M.nameDomain upper).names) + (tail : Fin n → (M.nameDomain upper).names) (V E : SetMembers geometry.carrier) + (p : SetMembers upperQ), V < E → + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) tau.val → + (∀ j, a.principalFix V ≤ upperAct.stabilizer upper (tail j).val) → + Forces (M.nameDomain upper) phi (extend tau tail) p → + ∃ g : SetMembers geometry.actors, g ∈ a.principalFix V ∧ + ∃ sigma : (M.nameDomain upper).names, + sigma.val = upperAct.act upper g tau.val ∧ + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) sigma.val ∧ + a.principalFix E ≤ upperAct.stabilizer upper sigma.val ∧ + ∃ r q : SetMembers upperQ, + r ≤ p ∧ StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw r) ∧ + q ≤ r ∧ q ≤ upperAct.iso g r ∧ q ≤ p ∧ q ≤ upperAct.iso g p ∧ + Forces (M.nameDomain upper) phi (extend sigma tail) q := by + intro geometry + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + intro s b a directed hL hG hC order graph nodeMaps supports + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + coordinates two carrier forcingOrder forcingAction omega topMem topRows packed upperQ + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + intro upperAct upper n phi tau tail V E p strict hsTau fixedTail forced + have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers + separation carrier hLifted hs hPacked omega + have hAssignments := (M.definable_structuralAssignments pairing unions powers separation collection).closed + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hAssignmentAction := M.structuralAssignmentActionGraph_mem pairing unions powers separation + collection hG hL order graph supports hLifted hSquared hs hh + have hGraph : upperAct.actionGraph upper b ∈ M.sets := by + erw [M.semanticStructuralAction_graph] + exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection hG hQ + carrier (M.union_mem unions (M.union_mem unions hQ)) hAssignments forcingAction hAssignmentAction + have maps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b pairing unions powers separation + collection hQ hG hGraph + have closed : ∀ g nu, nu ∈ (M.nameDomain upper).names → + upperAct.act upper g nu ∈ (M.nameDomain upper).names := + M.act_mem upper upperAct b pairing unions powers separation collection hQ maps + obtain ⟨B, supportTau⟩ := hsTau.symmetric + obtain ⟨rawR, memberR, belowRaw, support, _hSupport, _subsetSupport, _smallSupport, prepared⟩ := + fulfilled.structural_support_prepared_strengthening collection infinite choice small smallD + irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace (SetMembers.raw p) (SetMembers.raw_mem p) + let r : SetMembers upperQ := SetMembers.ofMem rawR memberR + have rRaw : SetMembers.raw r = rawR := SetMembers.raw_ofMem _ _ + have below : r ≤ p := by + change ZFSet.pair (SetMembers.raw r) (SetMembers.raw p) ∈ _ + rw [rRaw] + exact belowRaw + have preparedR : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier + (SetMembers.raw r) := by + rw [rRaw] + exact prepared.forget + let sourceRow := M.refinementHistoryRowFunction c lifted stages packed r + obtain ⟨A, rCode⟩ := M.refinementHistoryRowFunction_coordinates c lifted stages packed r + obtain ⟨dBound, vd, bd, usedD, dataD⟩ := fulfilled.toFinalFulfillment.structural_bounds_with + collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + r sourceRow A V B rCode + have condition : ZFSet.pair (c.encode sourceRow) A ∈ upperQ := rCode ▸ SetMembers.raw_mem r + have preparedCode : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier + (ZFSet.pair (c.encode sourceRow) A) := rCode ▸ preparedR + obtain ⟨g, cap, fixed, _strictCap, capE, movedD, commonRow, _rowCode, memberQ, toR, toMovedR⟩ := + fulfilled.structural_compression collection infinite choice labels small columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace sourceRow A condition preparedCode V E dBound + strict vd usedD dataD + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode g) A + let rawQ := ZFSet.pair (c.encode commonRow) (A ∪ movedA) + let q : SetMembers upperQ := SetMembers.ofMem rawQ memberQ + have qRaw : SetMembers.raw q = rawQ := SetMembers.raw_ofMem _ _ + have qr : q ≤ r := by + change ZFSet.pair (SetMembers.raw q) (SetMembers.raw r) ∈ _ + rw [qRaw, rCode] + exact toR + have movedCode : SetMembers.raw (upperAct.iso g r) = + ZFSet.pair (c.encode (act.iso g sourceRow)) movedA := + M.semanticStructuralAction_coordinates c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace g r sourceRow A rCode + have qgr : q ≤ upperAct.iso g r := by + change ZFSet.pair (SetMembers.raw q) (SetMembers.raw (upperAct.iso g r)) ∈ _ + rw [qRaw, movedCode] + exact toMovedR + let sigma : (M.nameDomain upper).names := ⟨upperAct.act upper g tau.val, closed g tau.val tau.property⟩ + have supported : a.principalFix E ≤ upperAct.stabilizer upper sigma.val := + upperAct.compressed_name_support upper a g dBound E tau.val + ((a.principalFix_antitone bd).trans supportTau) (movedD.trans capE) + have forcedR := forces_mono (M.nameDomain upper) phi (extend tau tail) forced below + have translated := (upperAct.formula_forces_act_iff upper (M.nameDomain upper) closed g + phi (extend tau tail) r).2 forcedR + have envEq : upperAct.actAssignment upper (M.nameDomain upper) closed g (extend tau tail) = + extend sigma tail := by + funext j + refine Fin.cases ?_ (fun i => ?_) j + · rfl + · apply Subtype.ext + exact fixedTail i fixed + rw [envEq] at translated + exact ⟨g, fixed, sigma, rfl, hsTau.translated g, supported, + r, q, below, preparedR, qr, qgr, qr.trans below, + qgr.trans ((upperAct.iso g).monotone below), + forces_mono (M.nameDomain upper) phi (extend sigma tail) translated qgr⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRectangleActionData.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRectangleActionData.lean index e91aced56e0087011f9f6948f0d06bed5d82730f..7cb4fa19f2ebf1ca80ccd271986e14160674e3d4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRectangleActionData.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRectangleActionData.lean @@ -1,120 +1,120 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFulfillmentConstruction - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) -include fulfilled - -theorem decoded_rectangle_action_data : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - let a := geometry.decodedAction - ∀ (V W d X : SetMembers geometry.carrier) (g₁ g₂ : SetMembers geometry.actors), - ExternalRectangleCode geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action (SetMembers.raw V) (SetMembers.raw W) - (SetMembers.raw d) (SetMembers.raw g₁) (SetMembers.raw g₂) → - a.iso g₁ d ≤ X → a.iso g₂ d ≤ X → - ∃ h₁ h₂ : SetMembers geometry.actors, - RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph geometry.action - (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) - (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) - (SetMembers.raw h₁) (SetMembers.raw h₂) ∧ - g₁⁻¹ * h₁ ∈ a.principalFix V ∧ - g₂⁻¹ * h₂ ∈ a.principalFix V ∧ - h₁⁻¹ * h₂ ∈ a.principalFix W ∧ - geometry.meet.smallMeet (a.iso h₁ d) X = a.iso h₁ V ∧ - geometry.meet.smallMeet (a.iso h₂ d) X = a.iso h₂ V ∧ - geometry.meet.smallMeet (a.iso h₁ d) (a.iso h₂ d) = a.iso h₁ W := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let a := geometry.decodedAction - dsimp only - intro V W d X g₁ g₂ request bound₁ bound₂ - have upper (g : SetMembers geometry.actors) (bound : a.iso g d ≤ X) : - ∀ y ∈ geometry.carrier, - ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw d)) y ∈ geometry.action → - ZFSet.pair y (SetMembers.raw X) ∈ geometry.order := by - intro y hy entry - have acted := (geometry.action_code.act_eq_iff g d (SetMembers.ofMem y hy)).2 - (by simpa only [SetMembers.raw_ofMem] using entry) - change ZFSet.pair (SetMembers.raw (geometry.action_code.act g d)) (SetMembers.raw X) - ∈ geometry.order at bound - simpa only [acted, SetMembers.raw_ofMem] using bound - obtain ⟨k, hk, l, hl, rectangle⟩ := fulfilled.rectangles - _ _ _ _ _ _ request (SetMembers.raw_mem X) (upper g₁ bound₁) (upper g₂ bound₂) - let h₁ := SetMembers.ofMem k hk - let h₂ := SetMembers.ofMem l hl - have code : RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph - geometry.action (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) - (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) - (SetMembers.raw h₁) (SetMembers.raw h₂) := by - simpa only [h₁, h₂, SetMembers.raw_ofMem] using rectangle - have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) - (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action - (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : - ∀ i, i ≤ v → a.iso g i = a.iso h i := by - intro i lower - apply SetMembers.raw_injective - exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) - lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) - have agree₁ := agree h₁ g₁ V code.first_agreement - have agree₂ := agree h₂ g₂ V code.second_agreement - have agreeW := agree h₁ h₂ W code.common_agreement - obtain ⟨v, hv, w, hw, y, hy, z, hz, t, ht, - gv, hwv, ky, lz, kt, _, meet₁, meet₂, meetW⟩ := code.values - have value (g : SetMembers geometry.actors) (x : SetMembers geometry.carrier) - (y : ZFSet.{u}) (hy : y ∈ geometry.carrier) - (entry : ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) y ∈ geometry.action) : - SetMembers.raw (a.iso g x) = y := by - have acted := (geometry.action_code.act_eq_iff g x (SetMembers.ofMem y hy)).2 - (by simpa only [SetMembers.raw_ofMem] using entry) - exact (congrArg SetMembers.raw acted).trans (SetMembers.raw_ofMem y hy) - have eqv := value g₁ V v hv gv - have eqw := value g₂ V w hw hwv - have eqy := value h₁ d y hy ky - have eqz := value h₂ d z hz lz - have eqt := value h₁ W t ht kt - have relative (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) - (agreement : ∀ i, i ≤ v → a.iso h i = a.iso g i) : - g⁻¹ * h ∈ a.principalFix v := by - intro i lower - rw [a.mul, agreement i lower, a.point_inv_left] - refine ⟨h₁, h₂, code, relative g₁ h₁ V agree₁, relative g₂ h₂ V agree₂, - relative h₁ h₂ W (fun i lower => (agreeW i lower).symm), ?_, ?_, ?_⟩ - · rw [agree₁ V le_rfl] - apply (geometry.meet.smallMeet_eq_iff _ _ _).2 - change ZFSet.pair (ZFSet.pair (SetMembers.raw (a.iso h₁ d)) (SetMembers.raw X)) - (SetMembers.raw (a.iso g₁ V)) ∈ geometry.meetGraph - rw [eqy, eqv] - exact meet₁ - · rw [agree₂ V le_rfl] - apply (geometry.meet.smallMeet_eq_iff _ _ _).2 - change ZFSet.pair (ZFSet.pair (SetMembers.raw (a.iso h₂ d)) (SetMembers.raw X)) - (SetMembers.raw (a.iso g₂ V)) ∈ geometry.meetGraph - rw [eqz, eqw] - exact meet₂ - · apply (geometry.meet.smallMeet_eq_iff _ _ _).2 - change ZFSet.pair (ZFSet.pair (SetMembers.raw (a.iso h₁ d)) - (SetMembers.raw (a.iso h₂ d))) (SetMembers.raw (a.iso h₁ W)) ∈ geometry.meetGraph - rw [eqy, eqz, eqt] - exact meetW - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFulfillmentConstruction + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) +include fulfilled + +theorem decoded_rectangle_action_data : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + let a := geometry.decodedAction + ∀ (V W d X : SetMembers geometry.carrier) (g₁ g₂ : SetMembers geometry.actors), + ExternalRectangleCode geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action (SetMembers.raw V) (SetMembers.raw W) + (SetMembers.raw d) (SetMembers.raw g₁) (SetMembers.raw g₂) → + a.iso g₁ d ≤ X → a.iso g₂ d ≤ X → + ∃ h₁ h₂ : SetMembers geometry.actors, + RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph geometry.action + (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) + (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) + (SetMembers.raw h₁) (SetMembers.raw h₂) ∧ + g₁⁻¹ * h₁ ∈ a.principalFix V ∧ + g₂⁻¹ * h₂ ∈ a.principalFix V ∧ + h₁⁻¹ * h₂ ∈ a.principalFix W ∧ + geometry.meet.smallMeet (a.iso h₁ d) X = a.iso h₁ V ∧ + geometry.meet.smallMeet (a.iso h₂ d) X = a.iso h₂ V ∧ + geometry.meet.smallMeet (a.iso h₁ d) (a.iso h₂ d) = a.iso h₁ W := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let a := geometry.decodedAction + dsimp only + intro V W d X g₁ g₂ request bound₁ bound₂ + have upper (g : SetMembers geometry.actors) (bound : a.iso g d ≤ X) : + ∀ y ∈ geometry.carrier, + ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw d)) y ∈ geometry.action → + ZFSet.pair y (SetMembers.raw X) ∈ geometry.order := by + intro y hy entry + have acted := (geometry.action_code.act_eq_iff g d (SetMembers.ofMem y hy)).2 + (by simpa only [SetMembers.raw_ofMem] using entry) + change ZFSet.pair (SetMembers.raw (geometry.action_code.act g d)) (SetMembers.raw X) + ∈ geometry.order at bound + simpa only [acted, SetMembers.raw_ofMem] using bound + obtain ⟨k, hk, l, hl, rectangle⟩ := fulfilled.rectangles + _ _ _ _ _ _ request (SetMembers.raw_mem X) (upper g₁ bound₁) (upper g₂ bound₂) + let h₁ := SetMembers.ofMem k hk + let h₂ := SetMembers.ofMem l hl + have code : RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph + geometry.action (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) + (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) + (SetMembers.raw h₁) (SetMembers.raw h₂) := by + simpa only [h₁, h₂, SetMembers.raw_ofMem] using rectangle + have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) + (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action + (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : + ∀ i, i ≤ v → a.iso g i = a.iso h i := by + intro i lower + apply SetMembers.raw_injective + exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) + lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) + have agree₁ := agree h₁ g₁ V code.first_agreement + have agree₂ := agree h₂ g₂ V code.second_agreement + have agreeW := agree h₁ h₂ W code.common_agreement + obtain ⟨v, hv, w, hw, y, hy, z, hz, t, ht, + gv, hwv, ky, lz, kt, _, meet₁, meet₂, meetW⟩ := code.values + have value (g : SetMembers geometry.actors) (x : SetMembers geometry.carrier) + (y : ZFSet.{u}) (hy : y ∈ geometry.carrier) + (entry : ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) y ∈ geometry.action) : + SetMembers.raw (a.iso g x) = y := by + have acted := (geometry.action_code.act_eq_iff g x (SetMembers.ofMem y hy)).2 + (by simpa only [SetMembers.raw_ofMem] using entry) + exact (congrArg SetMembers.raw acted).trans (SetMembers.raw_ofMem y hy) + have eqv := value g₁ V v hv gv + have eqw := value g₂ V w hw hwv + have eqy := value h₁ d y hy ky + have eqz := value h₂ d z hz lz + have eqt := value h₁ W t ht kt + have relative (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) + (agreement : ∀ i, i ≤ v → a.iso h i = a.iso g i) : + g⁻¹ * h ∈ a.principalFix v := by + intro i lower + rw [a.mul, agreement i lower, a.point_inv_left] + refine ⟨h₁, h₂, code, relative g₁ h₁ V agree₁, relative g₂ h₂ V agree₂, + relative h₁ h₂ W (fun i lower => (agreeW i lower).symm), ?_, ?_, ?_⟩ + · rw [agree₁ V le_rfl] + apply (geometry.meet.smallMeet_eq_iff _ _ _).2 + change ZFSet.pair (ZFSet.pair (SetMembers.raw (a.iso h₁ d)) (SetMembers.raw X)) + (SetMembers.raw (a.iso g₁ V)) ∈ geometry.meetGraph + rw [eqy, eqv] + exact meet₁ + · rw [agree₂ V le_rfl] + apply (geometry.meet.smallMeet_eq_iff _ _ _).2 + change ZFSet.pair (ZFSet.pair (SetMembers.raw (a.iso h₂ d)) (SetMembers.raw X)) + (SetMembers.raw (a.iso g₂ V)) ∈ geometry.meetGraph + rw [eqz, eqw] + exact meet₂ + · apply (geometry.meet.smallMeet_eq_iff _ _ _).2 + change ZFSet.pair (ZFSet.pair (SetMembers.raw (a.iso h₁ d)) + (SetMembers.raw (a.iso h₂ d))) (SetMembers.raw (a.iso h₁ W)) ∈ geometry.meetGraph + rw [eqy, eqz, eqt] + exact meetW + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowNiceNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowNiceNames.lean index cb786bd1aefde478973b74dd4e41f3a25dd5b85d..ced7d85badcff5ff129b7724baddfcd01775ac6a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowNiceNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowNiceNames.lean @@ -1,105 +1,105 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZF - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowNiceNameSystem - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - ∀ n : Nat, let terms := iteratedPairNameFamily (c.encode ⊤) T n - terms ∈ M.sets ∧ GroundBelow M terms K ∧ ∃ valid : ∀ z ∈ terms, IsName c z, - NiceNameSystem M act c s a ⊥ directed terms valid ∧ - let lifted := Name.renamedFamily c.pairEmpty id terms valid - let graph := Name.renameFamilyGraph c.pairEmpty id terms valid - lifted ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode terms lifted graph ∧ - ∃ liftedValid : ∀ z ∈ lifted, IsName c.pairEmpty z, - NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted liftedValid ∧ - ∀ (H : Set (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega))) (x : ZFSet.{u}), - (∃ τ : Name c.pairEmpty, τ.val ∈ lifted ∧ Name.eval H τ = x) ↔ - ∃ τ : Name c, τ.val ∈ terms ∧ Name.eval H τ = x := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground order action - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, _, _, _, _, _, _, _, stageTerms⟩ := - fulfilled.exists_rowTermSystem collection infinite choice hK standard indices - have baseValid := (stageTerms 0).2.2.1 - have baseClosed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ?_⟩ - intro n - obtain ⟨ground, below, valid, children, _⟩ := stageTerms n - refine ⟨ground, below, valid, ?_⟩ - exact M.pairEmpty_niceNameSystem act c b s a ⊥ directed pairing unions powers separation collection - carrier forcingOrder geometry.actors_ground geometry.carrier_ground supports forcingAction - _ ground valid (iteratedPairNameFamily_closed act baseValid baseClosed n) children - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZF + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowNiceNameSystem + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + ∀ n : Nat, let terms := iteratedPairNameFamily (c.encode ⊤) T n + terms ∈ M.sets ∧ GroundBelow M terms K ∧ ∃ valid : ∀ z ∈ terms, IsName c z, + NiceNameSystem M act c s a ⊥ directed terms valid ∧ + let lifted := Name.renamedFamily c.pairEmpty id terms valid + let graph := Name.renameFamilyGraph c.pairEmpty id terms valid + lifted ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode terms lifted graph ∧ + ∃ liftedValid : ∀ z ∈ lifted, IsName c.pairEmpty z, + NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted liftedValid ∧ + ∀ (H : Set (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega))) (x : ZFSet.{u}), + (∃ τ : Name c.pairEmpty, τ.val ∈ lifted ∧ Name.eval H τ = x) ↔ + ∃ τ : Name c, τ.val ∈ terms ∧ Name.eval H τ = x := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground order action + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, _, _, _, _, _, _, _, stageTerms⟩ := + fulfilled.exists_rowTermSystem collection infinite choice hK standard indices + have baseValid := (stageTerms 0).2.2.1 + have baseClosed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ?_⟩ + intro n + obtain ⟨ground, below, valid, children, _⟩ := stageTerms n + refine ⟨ground, below, valid, ?_⟩ + exact M.pairEmpty_niceNameSystem act c b s a ⊥ directed pairing unions powers separation collection + carrier forcingOrder geometry.actors_ground geometry.carrier_ground supports forcingAction + _ ground valid (iteratedPairNameFamily_closed act baseValid baseClosed n) children + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowSupport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowSupport.lean index d078bba42f5597e0b2a17d6ce1aedd159e7217ce..5dba1a8cbe80afe0634e9e6f1b694245da156d34 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowSupport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalRowSupport.lean @@ -1,391 +1,391 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalOrdinaryInsertion -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZFC - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -section -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) -include fulfilled - -theorem ordinary_ZF_insertion_of_choice - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (choiceN : Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {c e d F : ZFSet.{u}} - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.ordinaryExtension s H).sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : - F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - caps ∈ (M.ordinaryExtension s H).sets ∧ actors ∈ (M.ordinaryExtension s H).sets ∧ - FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c e d F caps actors := by - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order - infinite H genericFormula - exact fulfilled.ordinary_extension_insertion s collection infinite choice carrier order small closed - H genericCoded genericFormula zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 - zf.2.1 zf.1.2.2.2.2.2.2 choiceN smallD irreflexive hc he hd hF filter lower strict bound above - -theorem ordinary_ZF_countable_localization - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - {X : ZFSet.{u}} (hX : X ∈ (M.ordinaryExtension s H).sets) - (subset : X ⊆ (run.finalGeometry i₀).carrier) - (countable : (M.ordinaryExtension s H).groundEmbeddable X ZFSet.omega) : - X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ - ∃ b ∈ (run.finalGeometry i₀).carrier, - ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order - infinite H genericFormula - exact fulfilled.ordinary_extension_countable_localization s collection infinite choice carrier order - small closed H genericCoded genericFormula zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 - zf.2.1 zf.1.2.2.2.2.2.2 hX subset countable - -end - -section -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) -include fulfilled - -theorem ordinary_insertion - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {c e d F : ZFSet.{u}} - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.ordinaryExtension s H).sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : - F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - caps ∈ (M.ordinaryExtension s H).sets ∧ actors ∈ (M.ordinaryExtension s H).sets ∧ - FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c e d F caps actors := by - have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite - choice carrier order H genericFormula - exact fulfilled.ordinary_ZF_insertion_of_choice s collection infinite choice carrier order small - closed H genericCoded genericFormula choiceN smallD irreflexive hc he hd hF filter lower strict bound above - -end - -section -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) -include fulfilled - -theorem ordinary_submodel_insertion - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (N : TransitiveGround.{u}) (includes : M.sets ⊆ N.sets) - (included : N.sets ⊆ (M.ordinaryExtension s H).sets) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {c e d F : ZFSet.{u}} - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ N.sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : - F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - caps ∈ N.sets ∧ actors ∈ N.sets ∧ - FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c e d F caps actors := by - obtain ⟨ground, caps, hCaps, actors, hActors, _, _, family⟩ := - fulfilled.ordinary_insertion s collection infinite choice carrier order small closed - H genericCoded genericFormula smallD irreflexive hc he hd (included hF) - filter lower strict bound above - exact ⟨ground, caps, hCaps, actors, hActors, includes hCaps, includes hActors, family⟩ - -theorem ordinary_submodel_countable_localization - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (N : TransitiveGround.{u}) (included : N.sets ⊆ (M.ordinaryExtension s H).sets) - {X : ZFSet.{u}} (hX : X ∈ N.sets) - (subset : X ⊆ (run.finalGeometry i₀).carrier) - (countable : N.groundEmbeddable X ZFSet.omega) : - X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ - ∃ b ∈ (run.finalGeometry i₀).carrier, - ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by - obtain ⟨f, hf, injection⟩ := countable - exact fulfilled.ordinary_ZF_countable_localization s collection infinite choice carrier order - small closed H genericCoded genericFormula (included hX) subset ⟨f, included hf, injection⟩ - -end - -section -open SetFormula SetRealization Compression.RecursiveMaps -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) -variable {G : Type u} [Group G] (a : PosetAction G Q) (supports : NormalSubgroupFamily G) -include fulfilled - -theorem symmetric_insertion - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {c e d F : ZFSet.{u}} - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.symmetricExtension s a supports H).sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : - F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - caps ∈ (M.symmetricExtension s a supports H).sets ∧ actors ∈ (M.symmetricExtension s a supports H).sets ∧ - FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c e d F caps actors := by - exact fulfilled.ordinary_submodel_insertion s collection infinite choice carrier order small closed - H genericCoded genericFormula (M.symmetricExtension s a supports H) - (M.ground_subset_symmetricExtension s a supports pairing unions powers separation collection carrier H) - (M.symmetricExtension_subset_ordinaryExtension s a supports H) - smallD irreflexive hc he hd hF filter lower strict bound above - -theorem symmetric_countable_localization - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - {X : ZFSet.{u}} (hX : X ∈ (M.symmetricExtension s a supports H).sets) - (subset : X ⊆ (run.finalGeometry i₀).carrier) - (countable : (M.symmetricExtension s a supports H).groundEmbeddable X ZFSet.omega) : - X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ - ∃ b ∈ (run.finalGeometry i₀).carrier, - ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by - exact fulfilled.ordinary_submodel_countable_localization s collection infinite choice carrier order - small closed H genericCoded genericFormula (M.symmetricExtension s a supports H) - (M.symmetricExtension_subset_ordinaryExtension s a supports H) hX subset countable - -end - -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem row_symmetric_insertion - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let conditions := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), - H.GenericFor (M.codedFamily conditions) → - H.GenericFor (formulaFamily (M.nameDomain conditions)) → - ∀ c ∈ geometry.carrier, ∀ e ∈ geometry.carrier, ∀ d ∈ geometry.carrier, - ∀ F ∈ (M.symmetricExtension conditions act supports H).sets, - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F → - ZFSet.pair c e ∈ geometry.order → ZFSet.pair e c ∉ geometry.order → - ZFSet.pair c d ∈ geometry.order → (∀ x ∈ F, ZFSet.pair e x ∈ geometry.order) → - F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - caps ∈ (M.symmetricExtension conditions act supports H).sets ∧ actors ∈ (M.symmetricExtension conditions act supports H).sets ∧ - FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors - geometry.order geometry.meetGraph geometry.action c e d F caps actors := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let conditions := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - have hX := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have hY := M.natSetCode_mem separation infinite 2 - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) - (natSetCode 2) ZFSet.omega ⟨_, hX⟩ - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY - have closed := M.countable_function_internally_closed pairing unions powers separation - infinite groundChoice hX hY - dsimp only - intro H coded ordinary c hc e he d hd F hF filter lower strict bound above - exact fulfilled.symmetric_insertion conditions act supports collection infinite groundChoice - carrier order small closed H coded ordinary smallD irreflexive hc he hd hF filter lower strict bound above - -theorem row_symmetric_countable_localization - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let conditions := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), - H.GenericFor (M.codedFamily conditions) → - H.GenericFor (formulaFamily (M.nameDomain conditions)) → - ∀ X ∈ (M.symmetricExtension conditions act supports H).sets, X ⊆ geometry.carrier → - (M.symmetricExtension conditions act supports H).groundEmbeddable X ZFSet.omega → - X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ - ∃ b ∈ geometry.carrier, ∀ x ∈ X, ZFSet.pair x b ∈ geometry.order := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let conditions := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - have hX := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have hY := M.natSetCode_mem separation infinite 2 - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) - (natSetCode 2) ZFSet.omega ⟨_, hX⟩ - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY - have closed := M.countable_function_internally_closed pairing unions powers separation - infinite groundChoice hX hY - dsimp only - intro H coded ordinary X hX subset countable - exact fulfilled.symmetric_countable_localization conditions act supports collection infinite groundChoice - carrier order small closed H coded ordinary hX subset countable - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalOrdinaryInsertion +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZFC + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +section +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) +include fulfilled + +theorem ordinary_ZF_insertion_of_choice + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (choiceN : Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {c e d F : ZFSet.{u}} + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.ordinaryExtension s H).sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : + F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + caps ∈ (M.ordinaryExtension s H).sets ∧ actors ∈ (M.ordinaryExtension s H).sets ∧ + FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c e d F caps actors := by + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order + infinite H genericFormula + exact fulfilled.ordinary_extension_insertion s collection infinite choice carrier order small closed + H genericCoded genericFormula zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 + zf.2.1 zf.1.2.2.2.2.2.2 choiceN smallD irreflexive hc he hd hF filter lower strict bound above + +theorem ordinary_ZF_countable_localization + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + {X : ZFSet.{u}} (hX : X ∈ (M.ordinaryExtension s H).sets) + (subset : X ⊆ (run.finalGeometry i₀).carrier) + (countable : (M.ordinaryExtension s H).groundEmbeddable X ZFSet.omega) : + X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ + ∃ b ∈ (run.finalGeometry i₀).carrier, + ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order + infinite H genericFormula + exact fulfilled.ordinary_extension_countable_localization s collection infinite choice carrier order + small closed H genericCoded genericFormula zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 + zf.2.1 zf.1.2.2.2.2.2.2 hX subset countable + +end + +section +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) +include fulfilled + +theorem ordinary_insertion + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {c e d F : ZFSet.{u}} + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.ordinaryExtension s H).sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : + F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + caps ∈ (M.ordinaryExtension s H).sets ∧ actors ∈ (M.ordinaryExtension s H).sets ∧ + FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c e d F caps actors := by + have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite + choice carrier order H genericFormula + exact fulfilled.ordinary_ZF_insertion_of_choice s collection infinite choice carrier order small + closed H genericCoded genericFormula choiceN smallD irreflexive hc he hd hF filter lower strict bound above + +end + +section +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) +include fulfilled + +theorem ordinary_submodel_insertion + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (N : TransitiveGround.{u}) (includes : M.sets ⊆ N.sets) + (included : N.sets ⊆ (M.ordinaryExtension s H).sets) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {c e d F : ZFSet.{u}} + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ N.sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : + F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + caps ∈ N.sets ∧ actors ∈ N.sets ∧ + FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c e d F caps actors := by + obtain ⟨ground, caps, hCaps, actors, hActors, _, _, family⟩ := + fulfilled.ordinary_insertion s collection infinite choice carrier order small closed + H genericCoded genericFormula smallD irreflexive hc he hd (included hF) + filter lower strict bound above + exact ⟨ground, caps, hCaps, actors, hActors, includes hCaps, includes hActors, family⟩ + +theorem ordinary_submodel_countable_localization + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (N : TransitiveGround.{u}) (included : N.sets ⊆ (M.ordinaryExtension s H).sets) + {X : ZFSet.{u}} (hX : X ∈ N.sets) + (subset : X ⊆ (run.finalGeometry i₀).carrier) + (countable : N.groundEmbeddable X ZFSet.omega) : + X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ + ∃ b ∈ (run.finalGeometry i₀).carrier, + ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by + obtain ⟨f, hf, injection⟩ := countable + exact fulfilled.ordinary_ZF_countable_localization s collection infinite choice carrier order + small closed H genericCoded genericFormula (included hX) subset ⟨f, included hf, injection⟩ + +end + +section +open SetFormula SetRealization Compression.RecursiveMaps +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) +variable {G : Type u} [Group G] (a : PosetAction G Q) (supports : NormalSubgroupFamily G) +include fulfilled + +theorem symmetric_insertion + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {c e d F : ZFSet.{u}} + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.symmetricExtension s a supports H).sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : + F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + caps ∈ (M.symmetricExtension s a supports H).sets ∧ actors ∈ (M.symmetricExtension s a supports H).sets ∧ + FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c e d F caps actors := by + exact fulfilled.ordinary_submodel_insertion s collection infinite choice carrier order small closed + H genericCoded genericFormula (M.symmetricExtension s a supports H) + (M.ground_subset_symmetricExtension s a supports pairing unions powers separation collection carrier H) + (M.symmetricExtension_subset_ordinaryExtension s a supports H) + smallD irreflexive hc he hd hF filter lower strict bound above + +theorem symmetric_countable_localization + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + {X : ZFSet.{u}} (hX : X ∈ (M.symmetricExtension s a supports H).sets) + (subset : X ⊆ (run.finalGeometry i₀).carrier) + (countable : (M.symmetricExtension s a supports H).groundEmbeddable X ZFSet.omega) : + X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ + ∃ b ∈ (run.finalGeometry i₀).carrier, + ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by + exact fulfilled.ordinary_submodel_countable_localization s collection infinite choice carrier order + small closed H genericCoded genericFormula (M.symmetricExtension s a supports H) + (M.symmetricExtension_subset_ordinaryExtension s a supports H) hX subset countable + +end + +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem row_symmetric_insertion + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let conditions := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), + H.GenericFor (M.codedFamily conditions) → + H.GenericFor (formulaFamily (M.nameDomain conditions)) → + ∀ c ∈ geometry.carrier, ∀ e ∈ geometry.carrier, ∀ d ∈ geometry.carrier, + ∀ F ∈ (M.symmetricExtension conditions act supports H).sets, + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F → + ZFSet.pair c e ∈ geometry.order → ZFSet.pair e c ∉ geometry.order → + ZFSet.pair c d ∈ geometry.order → (∀ x ∈ F, ZFSet.pair e x ∈ geometry.order) → + F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + caps ∈ (M.symmetricExtension conditions act supports H).sets ∧ actors ∈ (M.symmetricExtension conditions act supports H).sets ∧ + FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors + geometry.order geometry.meetGraph geometry.action c e d F caps actors := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let conditions := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + have hX := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have hY := M.natSetCode_mem separation infinite 2 + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) + (natSetCode 2) ZFSet.omega ⟨_, hX⟩ + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY + have closed := M.countable_function_internally_closed pairing unions powers separation + infinite groundChoice hX hY + dsimp only + intro H coded ordinary c hc e he d hd F hF filter lower strict bound above + exact fulfilled.symmetric_insertion conditions act supports collection infinite groundChoice + carrier order small closed H coded ordinary smallD irreflexive hc he hd hF filter lower strict bound above + +theorem row_symmetric_countable_localization + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let conditions := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), + H.GenericFor (M.codedFamily conditions) → + H.GenericFor (formulaFamily (M.nameDomain conditions)) → + ∀ X ∈ (M.symmetricExtension conditions act supports H).sets, X ⊆ geometry.carrier → + (M.symmetricExtension conditions act supports H).groundEmbeddable X ZFSet.omega → + X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ + ∃ b ∈ geometry.carrier, ∀ x ∈ X, ZFSet.pair x b ∈ geometry.order := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let conditions := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + have hX := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have hY := M.natSetCode_mem separation infinite 2 + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) + (natSetCode 2) ZFSet.omega ⟨_, hX⟩ + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY + have closed := M.countable_function_internally_closed pairing unions powers separation + infinite groundChoice hX hY + dsimp only + intro H coded ordinary X hX subset countable + exact fulfilled.symmetric_countable_localization conditions act supports collection infinite groundChoice + carrier order small closed H coded ordinary hX subset countable + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSameFilterPreparationBatch.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSameFilterPreparationBatch.lean index 1d32bcdea05062ab9b6bc2ace1f965e4b04d5dc2..b3e16102beea84f0e760553623e5ff8cdaddf968 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSameFilterPreparationBatch.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSameFilterPreparationBatch.lean @@ -1,268 +1,268 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralFilterLifts -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPrefixPreparationBatches - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {R : Type u} [PartialOrder R] (c : Presentation R) - -theorem exists_sameFilterPreparationBatch - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history) - (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice rowClosed - let lowerGround := inputs.1 - let maps := inputs.2.2.1 - let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code - let projection := M.semanticStructuralTrace_completeProjection c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset - infinite choice - ∀ (Hupper : ConditionFilter (SetMembers upperQ)) (pUpper : SetMembers upperQ) - (_hpUpper : Hupper.mem pUpper) (row A : ZFSet.{u}) - (_code : SetMembers.raw pUpper = ZFSet.pair row A), - let selected := assignmentOnIndices indices T A - let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected - let bound := M.groundRelations T lower.carrier - let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) - let H := projection.projectedFilter Hupper - ∀ (_genericCoded : H.GenericFor (M.codedFamily lower)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain lower))) - (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val), - ∃ (validJ : ∀ z ∈ J, IsName lower z) (hJ : J ∈ M.sets), - M.groundEmbeddable J ZFSet.omega ∧ - (∀ z : Name lower, z.val ∈ J → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) z ∧ - Name.eval {q | H.mem q} z ⊆ Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) ∧ - ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), - ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix)) k ∧ - k ⊆ M.supportedCertificateFamilyRelation lowerAct lower b T d.principalFix - geometry.order J validJ H ∧ - ∃ q, H.mem q ∧ q ≤ restriction pUpper ∧ - Forces (M.nameDomain lower) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers - separation collection lowerGround geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid (M.omega_mem separation infinite) geometry.order J k - geometry.order_ground hJ hk validJ) q ∧ - ∃ (r : SetMembers upperQ) (newRow newA : ZFSet.{u}), - Hupper.mem r ∧ r ≤ pUpper ∧ restriction r ≤ q ∧ - SetMembers.raw r = ZFSet.pair newRow newA ∧ - ZFSet.pair newRow row ∈ c.conditionOrder ∧ A ⊆ newA ∧ - SetMembers.raw (restriction r) = ZFSet.pair newRow - (assignmentCut (refinementDataHistoryLevels stages packed T) alpha newA) ∧ - H.mem (restriction r) ∧ - Forces (M.nameDomain lower) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers - separation collection lowerGround geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid (M.omega_mem separation infinite) geometry.order J k - geometry.order_ground hJ hk validJ) (restriction r) ∧ - ∃ enumerations ∈ M.sets, - ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix)) enumerations ∧ - enumerations ⊆ M.certificateEnumerationRelation J b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix) k ∧ - (∀ j F B f e names, - ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → - SynchronizedEnumerationCode ZFSet.omega - (M.niceSupportNameCodes lowerAct lower T d.principalFix) B f e names) ∧ - ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F = M.visibleSupportProfile lowerAct lower b d T H (Name.eval {p | H.mem p} z.val) ∧ - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - B.Nonempty ∧ M.DecidesVisibilityProfile lowerAct lower b d.principalFix T F z.val (restriction r) ∧ - (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq (restriction r) z.val tau) ∧ - ∃ e ∈ M.sets, ∃ names ∈ M.sets, - ZFSet.IsFunc ZFSet.omega B e ∧ - ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes lowerAct lower T d.principalFix) names ∧ - (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history alpha hs hh ordinal trace member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - let := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - let := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice rowClosed - let lowerGround := inputs.1 - let maps := inputs.2.2.1 - let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code - let projection := M.semanticStructuralTrace_completeProjection c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset - infinite choice - intro Hupper pUpper hpUpper row A code - let H := projection.projectedFilter Hupper - intro genericCoded genericFormula descent - let selected := assignmentOnIndices indices T A - let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected - let bound := M.groundRelations T lower.carrier - let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) - have condition : ZFSet.pair row A ∈ upperQ := code ▸ SetMembers.raw_mem pUpper - have hp : H.mem (restriction pUpper) := - (projection.projectedFilter_mem_iff Hupper (restriction pUpper)).2 ⟨pUpper, hpUpper, rfl⟩ - obtain ⟨validJ, hJ, smallJ, facts, k, hk, function, selectedCertificates, - q, hq, qp, forced, enumerations, hEnumerations, enumerationFunction, - enumerationRelation, synchronized, entries⟩ := - fulfilled.exists_prefixPreparationBatch c collection infinite choice small smallD irreflexive rowClosed - a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history alpha hs hh ordinal trace member row A condition - H genericCoded genericFormula descent (restriction pUpper) hp - obtain ⟨r, newRow, newA, hr, rp, rq, rCode, rowBelow, retained, cut⟩ := - M.semanticStructuralTrace_sameFilter_lift c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset - infinite choice Hupper pUpper hpUpper q hq row A code - have projectedMember : H.mem (restriction r) := - (projection.projectedFilter_mem_iff Hupper (restriction r)).2 ⟨r, hr, rfl⟩ - have strengthened := forces_mono (M.nameDomain lower) supportedCertificateFamilyFormula _ forced rq - refine ⟨validJ, hJ, smallJ, facts, k, hk, function, selectedCertificates, - q, hq, qp, forced, r, newRow, newA, hr, rp, rq, rCode, rowBelow, retained, cut, - projectedMember, strengthened, enumerations, hEnumerations, enumerationFunction, - enumerationRelation, synchronized, ?_⟩ - intro z F B f stored - obtain ⟨profile, filter, nonempty, decisions, equalities, perBasis⟩ := entries z F B f stored - refine ⟨profile, filter, nonempty, ?_, ?_, perBasis⟩ - · intro v - exact ⟨fun hv => Name.forcesMem_mono ((decisions v).1 hv) rq, - fun hv stronger below => (decisions v).2 hv stronger (le_trans below rq)⟩ - · intro v hv tau ht edge - exact Name.forcesEq_mono (equalities v hv tau ht edge) rq - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralFilterLifts +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPrefixPreparationBatches + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {R : Type u} [PartialOrder R] (c : Presentation R) + +theorem exists_sameFilterPreparationBatch + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history) + (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice rowClosed + let lowerGround := inputs.1 + let maps := inputs.2.2.1 + let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code + let projection := M.semanticStructuralTrace_completeProjection c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset + infinite choice + ∀ (Hupper : ConditionFilter (SetMembers upperQ)) (pUpper : SetMembers upperQ) + (_hpUpper : Hupper.mem pUpper) (row A : ZFSet.{u}) + (_code : SetMembers.raw pUpper = ZFSet.pair row A), + let selected := assignmentOnIndices indices T A + let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected + let bound := M.groundRelations T lower.carrier + let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) + let H := projection.projectedFilter Hupper + ∀ (_genericCoded : H.GenericFor (M.codedFamily lower)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain lower))) + (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val), + ∃ (validJ : ∀ z ∈ J, IsName lower z) (hJ : J ∈ M.sets), + M.groundEmbeddable J ZFSet.omega ∧ + (∀ z : Name lower, z.val ∈ J → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) z ∧ + Name.eval {q | H.mem q} z ⊆ Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) ∧ + ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), + ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix)) k ∧ + k ⊆ M.supportedCertificateFamilyRelation lowerAct lower b T d.principalFix + geometry.order J validJ H ∧ + ∃ q, H.mem q ∧ q ≤ restriction pUpper ∧ + Forces (M.nameDomain lower) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers + separation collection lowerGround geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid (M.omega_mem separation infinite) geometry.order J k + geometry.order_ground hJ hk validJ) q ∧ + ∃ (r : SetMembers upperQ) (newRow newA : ZFSet.{u}), + Hupper.mem r ∧ r ≤ pUpper ∧ restriction r ≤ q ∧ + SetMembers.raw r = ZFSet.pair newRow newA ∧ + ZFSet.pair newRow row ∈ c.conditionOrder ∧ A ⊆ newA ∧ + SetMembers.raw (restriction r) = ZFSet.pair newRow + (assignmentCut (refinementDataHistoryLevels stages packed T) alpha newA) ∧ + H.mem (restriction r) ∧ + Forces (M.nameDomain lower) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers + separation collection lowerGround geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid (M.omega_mem separation infinite) geometry.order J k + geometry.order_ground hJ hk validJ) (restriction r) ∧ + ∃ enumerations ∈ M.sets, + ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix)) enumerations ∧ + enumerations ⊆ M.certificateEnumerationRelation J b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix) k ∧ + (∀ j F B f e names, + ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → + SynchronizedEnumerationCode ZFSet.omega + (M.niceSupportNameCodes lowerAct lower T d.principalFix) B f e names) ∧ + ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F = M.visibleSupportProfile lowerAct lower b d T H (Name.eval {p | H.mem p} z.val) ∧ + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + B.Nonempty ∧ M.DecidesVisibilityProfile lowerAct lower b d.principalFix T F z.val (restriction r) ∧ + (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq (restriction r) z.val tau) ∧ + ∃ e ∈ M.sets, ∃ names ∈ M.sets, + ZFSet.IsFunc ZFSet.omega B e ∧ + ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes lowerAct lower T d.principalFix) names ∧ + (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history alpha hs hh ordinal trace member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + let := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + let := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice rowClosed + let lowerGround := inputs.1 + let maps := inputs.2.2.1 + let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code + let projection := M.semanticStructuralTrace_completeProjection c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset + infinite choice + intro Hupper pUpper hpUpper row A code + let H := projection.projectedFilter Hupper + intro genericCoded genericFormula descent + let selected := assignmentOnIndices indices T A + let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected + let bound := M.groundRelations T lower.carrier + let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) + have condition : ZFSet.pair row A ∈ upperQ := code ▸ SetMembers.raw_mem pUpper + have hp : H.mem (restriction pUpper) := + (projection.projectedFilter_mem_iff Hupper (restriction pUpper)).2 ⟨pUpper, hpUpper, rfl⟩ + obtain ⟨validJ, hJ, smallJ, facts, k, hk, function, selectedCertificates, + q, hq, qp, forced, enumerations, hEnumerations, enumerationFunction, + enumerationRelation, synchronized, entries⟩ := + fulfilled.exists_prefixPreparationBatch c collection infinite choice small smallD irreflexive rowClosed + a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history alpha hs hh ordinal trace member row A condition + H genericCoded genericFormula descent (restriction pUpper) hp + obtain ⟨r, newRow, newA, hr, rp, rq, rCode, rowBelow, retained, cut⟩ := + M.semanticStructuralTrace_sameFilter_lift c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset + infinite choice Hupper pUpper hpUpper q hq row A code + have projectedMember : H.mem (restriction r) := + (projection.projectedFilter_mem_iff Hupper (restriction r)).2 ⟨r, hr, rfl⟩ + have strengthened := forces_mono (M.nameDomain lower) supportedCertificateFamilyFormula _ forced rq + refine ⟨validJ, hJ, smallJ, facts, k, hk, function, selectedCertificates, + q, hq, qp, forced, r, newRow, newA, hr, rp, rq, rCode, rowBelow, retained, cut, + projectedMember, strengthened, enumerations, hEnumerations, enumerationFunction, + enumerationRelation, synchronized, ?_⟩ + intro z F B f stored + obtain ⟨profile, filter, nonempty, decisions, equalities, perBasis⟩ := entries z F B f stored + refine ⟨profile, filter, nonempty, ?_, ?_, perBasis⟩ + · intro v + exact ⟨fun hv => Name.forcesMem_mono ((decisions v).1 hv) rq, + fun hv stronger below => (decisions v).2 hv stronger (le_trans below rq)⟩ + · intro v hv tau ht edge + exact Name.forcesEq_mono (equalities v hv tau ht edge) rq + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneForcing.lean index b044ff78cd6191757f09c46ad9fbb6351376d6f3..0af3be16f200309e3213458df9aa226f0778b2fc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneForcing.lean @@ -1,107 +1,107 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLifting -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRefinementSystem - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageOneForcing - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1 ∧ - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2 ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, objects, finitePowers⟩ := - fulfilled.exists_rowRefinementSystem collection infinite choice hK standard indices - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, ?_, objects, finitePowers⟩ - exact M.stageOneForcing_mem act c s a _ _ valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first - order (M.omega_mem separation infinite) - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLifting +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRefinementSystem + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageOneForcing + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1 ∧ + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2 ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, objects, finitePowers⟩ := + fulfilled.exists_rowRefinementSystem collection infinite choice hK standard indices + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, ?_, objects, finitePowers⟩ + exact M.stageOneForcing_mem act c s a _ _ valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first + order (M.omega_mem separation infinite) + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneGroundAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneGroundAction.lean index b90608845ba73d0559385896969dd64ba35fc6a0..3b525a14372ec1f7104bfa31e0f419e7ccdbd5e8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneGroundAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageOneGroundAction.lean @@ -1,392 +1,392 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLiftFamilies -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageOneClosure - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageOneActionInputs - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1 ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageOneClosure collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - obtain ⟨squaredGround, graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - obtain ⟨forcingGround, orderGround, closed, objects, finitePowers⟩ := data - have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - have conditionMaps := M.pairEmpty_conditionMapFamily_mem pairing unions powers separation c act b collection - carrier geometry.actors_ground forcingAction - have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation collection - geometry.carrier_ground geometry.actors_ground action - have termClosed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 - have liftedClosed := Name.renamedFamily_closed act c.pairEmpty _ valid termClosed - have squaredClosed := orderedPairNameFamily_closed act valid1 valid1 liftedClosed liftedClosed - have familyGround := M.familySet_mem c.pairEmpty ⊤ pairing unions powers separation liftedGround - (M.transitive (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) - (c.pairEmpty.encode_mem ⊤)) valid1 - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, ⟨conditionMaps, nodeMaps, liftedClosed, squaredClosed, familyGround⟩, - forcingGround, orderGround, closed, objects, finitePowers⟩ - -theorem exists_rowStageOneAction - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageOneActionInputs collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - obtain ⟨squaredGround, graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - obtain ⟨inputs, forcingGround, orderGround, closed, objects, finitePowers⟩ := data - have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - have originalMaps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation - collection carrier geometry.actors_ground forcingAction - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - exact ⟨M.stageOneSmallAction act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround indexSystem ⊥ directed first collection b inputs - squaredGround (M.omega_mem separation infinite), rfl, - M.stageOneSmallAction_laws act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first - collection b inputs squaredGround (M.omega_mem separation infinite), closed⟩ - -theorem exists_rowStageOneGroundAction - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageOneAction collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, closed⟩ := actionData - refine ⟨nextAction, equal, laws, ?_, ?_, closed⟩ - · rw [equal] - exact M.stageOneSmallActionGraph_mem act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection - b inputs squaredGround (M.omega_mem separation infinite) order geometry.actors_ground originalMaps - · rw [equal] - exact M.stageOneSmallActionMapFamily_mem act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection - b inputs squaredGround (M.omega_mem separation infinite) order geometry.actors_ground originalMaps - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLiftFamilies +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageOneClosure + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageOneActionInputs + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1 ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageOneClosure collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + obtain ⟨squaredGround, graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + obtain ⟨forcingGround, orderGround, closed, objects, finitePowers⟩ := data + have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + have conditionMaps := M.pairEmpty_conditionMapFamily_mem pairing unions powers separation c act b collection + carrier geometry.actors_ground forcingAction + have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation collection + geometry.carrier_ground geometry.actors_ground action + have termClosed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 + have liftedClosed := Name.renamedFamily_closed act c.pairEmpty _ valid termClosed + have squaredClosed := orderedPairNameFamily_closed act valid1 valid1 liftedClosed liftedClosed + have familyGround := M.familySet_mem c.pairEmpty ⊤ pairing unions powers separation liftedGround + (M.transitive (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) + (c.pairEmpty.encode_mem ⊤)) valid1 + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, ⟨conditionMaps, nodeMaps, liftedClosed, squaredClosed, familyGround⟩, + forcingGround, orderGround, closed, objects, finitePowers⟩ + +theorem exists_rowStageOneAction + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageOneActionInputs collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + obtain ⟨squaredGround, graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + obtain ⟨inputs, forcingGround, orderGround, closed, objects, finitePowers⟩ := data + have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + have originalMaps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation + collection carrier geometry.actors_ground forcingAction + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + exact ⟨M.stageOneSmallAction act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround indexSystem ⊥ directed first collection b inputs + squaredGround (M.omega_mem separation infinite), rfl, + M.stageOneSmallAction_laws act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first + collection b inputs squaredGround (M.omega_mem separation infinite), closed⟩ + +theorem exists_rowStageOneGroundAction + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageOneAction collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, closed⟩ := actionData + refine ⟨nextAction, equal, laws, ?_, ?_, closed⟩ + · rw [equal] + exact M.stageOneSmallActionGraph_mem act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection + b inputs squaredGround (M.omega_mem separation infinite) order geometry.actors_ground originalMaps + · rw [equal] + exact M.stageOneSmallActionMapFamily_mem act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection + b inputs squaredGround (M.omega_mem separation infinite) order geometry.actors_ground originalMaps + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeAction.lean index c84f70cf42f2aac9c11a92acccb61c36ebdb864c..5d52d6e6b840582dfb8a71b846b136a76da54aaa 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeAction.lean @@ -1,370 +1,370 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageThreeActionInputs -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageThreeClosure - -namespace OAI - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageThreeActionData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - closure_data : StageThreeClosureData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - actions : - let actionData := closure_data.projection_data.carrier_data.name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, - let tests := M.refinementLevelTests pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 - action nodes d base directed next2.first (natSetCode 2) T2 - let Condition3 := FlatSuccessorCondition M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 action nodes d base directed next2.first - actionData.closure_data.projection_data.first_level next.indices.levelCode next2.indices.levelCode - let inclusion := M.flatSuccessorSmallInclusion c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - let restriction := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 - let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 - let graph3 := M.stageThreeAssignmentActionGraph a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 - ∃ inputs3 : FlatSuccessorActionInputs M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3, - let action3 := M.flatSuccessorSmallAction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3 - (∀ g A, image3 g A = relationImage A (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (graph3 g)) ∧ - familyCodeGraph actors.encode graph3 ∈ M.sets ∧ - action3.actionGraph pres3 actors ∈ M.sets ∧ action3.conditionMapFamily pres3 actors ∈ M.sets ∧ - (∀ g (q : Shrink Condition3), - ((equivShrink Condition3).symm (action3.iso g q)).row = a.iso g ((equivShrink Condition3).symm q).row ∧ - ((equivShrink Condition3).symm (action3.iso g q)).assignments = image3 g ((equivShrink Condition3).symm q).assignments ∧ - ((equivShrink Condition3).symm (action3.iso g q)).lower = action.iso g ((equivShrink Condition3).symm q).lower) ∧ - (∀ g (q : Shrink Condition3), pres3.encode (action3.iso g q) = - ZFSet.pair (c.encode (a.iso g ((equivShrink Condition3).symm q).row)) - (image3 g ((equivShrink Condition3).symm q).assignments)) ∧ - (∀ g q, restriction (action3.iso g q) = action.iso g (restriction q)) ∧ - (∀ g p, action3.iso g (inclusion p) = inclusion (action.iso g p)) - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (M : TransitiveGround.{u}) -theorem stageThreeActionData - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (prior : StageThreeClosureData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used) - (params0 : StageOneActionParameters M a c.pairEmpty actors nodes d T T2 valid) - (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (hT2 : T2 ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (group : actors.carrier ∈ M.sets) (rowMaps : a.conditionMapFamily c actors ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) : - StageThreeActionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used := by - let actionData := prior.projection_data.carrier_data.name_lifting.support_data.action_data - let data := actionData.closure_data.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - let first := actionData.closure_data.projection_data.first_level - let second := next.indices.levelCode - let stageTwoOrder := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first - obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _⟩ := prior.closed - let stageTwoTop := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder - data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first - have carrier0 := M.pairEmpty_carrier_mem pairing unions powers separation c rows - have order0 := M.pairEmpty_order_mem pairing unions powers separation c rows rowOrder - have omega := M.omega_mem separation infinite - let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 - let graph3 := M.stageThreeAssignmentActionGraph a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 - have inputs3 := M.stageThreeActionInputs a c.pairEmpty c e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 actors - pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground data.lower_order_ground - hCarrier hOrder params0 next.inputs next2.inputs data.terms_ground hT2 hI0 next.indices.index_ground - next2.indices.index_ground first second next2.indices.levelCode omega base directed next2.first F2 - (by - intro g q - change ((equivShrink _).symm (action.iso g q)).row = a.iso g ((equivShrink _).symm q).row - rw [M.stageTwoSmallAction_decode] - rfl) - (by - intro g q - change ((equivShrink _).symm (action.iso g q)).assignments = image g ((equivShrink _).symm q).assignments - rw [M.stageTwoSmallAction_decode] - rfl) - have imageEq : ∀ g A, image3 g A = relationImage A - (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (graph3 g) := - M.stageThreeAssignmentImage_eq_relationImage a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 actors - pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground data.lower_order_ground - hCarrier hOrder params0 next.inputs next2.inputs first second - have familyGround : familyCodeGraph actors.encode graph3 ∈ M.sets := - M.stageThreeAssignmentActionFamily_mem_of_inputs a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 actors - pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground data.lower_order_ground - hCarrier hOrder params0 next.inputs next2.inputs group hNodes data.terms_ground hT2 - hI0 next.indices.index_ground next2.indices.index_ground omega - have conditions := M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 next.indices.index_ground) - next2.indices.index_ground) data.terms_ground - let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection - hCarrier hOrder data.terms_ground next2.valid1 action nodes d base directed next2.first - first second next2.indices.levelCode - let successorOrder := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, inputs3, imageEq, familyGround, - ?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact M.flatSuccessorSmallActionGraph_mem c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3 actors graph3 imageEq pairing unions powers separation - rows conditions assignments omega group rowMaps familyGround - · exact M.flatSuccessorSmallActionMapFamily_mem c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3 actors graph3 imageEq pairing unions powers separation - rows conditions assignments omega group rowMaps familyGround collection - · intro g q - rw [M.flatSuccessorSmallAction_decode] - exact ⟨rfl, rfl, rfl⟩ - · exact M.flatSuccessorSmallAction_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3 - · exact M.flatSuccessorSmallRestriction_equivariant c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3 F2 - · exact M.flatSuccessorSmallInclusion_equivariant c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3 F2 laws - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageThreeAction - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageThreeActionData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageThreeClosure collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let stageOneOrder := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let stageOneTop := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid - exact M.stageThreeActionData act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - priorAction inputs carrier forcingOrder squaredGround indexSystem.index_ground order geometry.actors_ground originalMaps infinite - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageThreeActionInputs +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageThreeClosure + +namespace OAI + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageThreeActionData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + closure_data : StageThreeClosureData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + actions : + let actionData := closure_data.projection_data.carrier_data.name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, + let tests := M.refinementLevelTests pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 + action nodes d base directed next2.first (natSetCode 2) T2 + let Condition3 := FlatSuccessorCondition M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 action nodes d base directed next2.first + actionData.closure_data.projection_data.first_level next.indices.levelCode next2.indices.levelCode + let inclusion := M.flatSuccessorSmallInclusion c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + let restriction := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 + let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 + let graph3 := M.stageThreeAssignmentActionGraph a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 + ∃ inputs3 : FlatSuccessorActionInputs M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3, + let action3 := M.flatSuccessorSmallAction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3 + (∀ g A, image3 g A = relationImage A (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (graph3 g)) ∧ + familyCodeGraph actors.encode graph3 ∈ M.sets ∧ + action3.actionGraph pres3 actors ∈ M.sets ∧ action3.conditionMapFamily pres3 actors ∈ M.sets ∧ + (∀ g (q : Shrink Condition3), + ((equivShrink Condition3).symm (action3.iso g q)).row = a.iso g ((equivShrink Condition3).symm q).row ∧ + ((equivShrink Condition3).symm (action3.iso g q)).assignments = image3 g ((equivShrink Condition3).symm q).assignments ∧ + ((equivShrink Condition3).symm (action3.iso g q)).lower = action.iso g ((equivShrink Condition3).symm q).lower) ∧ + (∀ g (q : Shrink Condition3), pres3.encode (action3.iso g q) = + ZFSet.pair (c.encode (a.iso g ((equivShrink Condition3).symm q).row)) + (image3 g ((equivShrink Condition3).symm q).assignments)) ∧ + (∀ g q, restriction (action3.iso g q) = action.iso g (restriction q)) ∧ + (∀ g p, action3.iso g (inclusion p) = inclusion (action.iso g p)) + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (M : TransitiveGround.{u}) +theorem stageThreeActionData + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (prior : StageThreeClosureData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used) + (params0 : StageOneActionParameters M a c.pairEmpty actors nodes d T T2 valid) + (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (hT2 : T2 ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (group : actors.carrier ∈ M.sets) (rowMaps : a.conditionMapFamily c actors ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) : + StageThreeActionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used := by + let actionData := prior.projection_data.carrier_data.name_lifting.support_data.action_data + let data := actionData.closure_data.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + let first := actionData.closure_data.projection_data.first_level + let second := next.indices.levelCode + let stageTwoOrder := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first + obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _⟩ := prior.closed + let stageTwoTop := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder + data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first + have carrier0 := M.pairEmpty_carrier_mem pairing unions powers separation c rows + have order0 := M.pairEmpty_order_mem pairing unions powers separation c rows rowOrder + have omega := M.omega_mem separation infinite + let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 + let graph3 := M.stageThreeAssignmentActionGraph a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 + have inputs3 := M.stageThreeActionInputs a c.pairEmpty c e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 actors + pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground data.lower_order_ground + hCarrier hOrder params0 next.inputs next2.inputs data.terms_ground hT2 hI0 next.indices.index_ground + next2.indices.index_ground first second next2.indices.levelCode omega base directed next2.first F2 + (by + intro g q + change ((equivShrink _).symm (action.iso g q)).row = a.iso g ((equivShrink _).symm q).row + rw [M.stageTwoSmallAction_decode] + rfl) + (by + intro g q + change ((equivShrink _).symm (action.iso g q)).assignments = image g ((equivShrink _).symm q).assignments + rw [M.stageTwoSmallAction_decode] + rfl) + have imageEq : ∀ g A, image3 g A = relationImage A + (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (graph3 g) := + M.stageThreeAssignmentImage_eq_relationImage a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 actors + pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground data.lower_order_ground + hCarrier hOrder params0 next.inputs next2.inputs first second + have familyGround : familyCodeGraph actors.encode graph3 ∈ M.sets := + M.stageThreeAssignmentActionFamily_mem_of_inputs a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 actors + pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground data.lower_order_ground + hCarrier hOrder params0 next.inputs next2.inputs group hNodes data.terms_ground hT2 + hI0 next.indices.index_ground next2.indices.index_ground omega + have conditions := M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 next.indices.index_ground) + next2.indices.index_ground) data.terms_ground + let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection + hCarrier hOrder data.terms_ground next2.valid1 action nodes d base directed next2.first + first second next2.indices.levelCode + let successorOrder := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, inputs3, imageEq, familyGround, + ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact M.flatSuccessorSmallActionGraph_mem c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3 actors graph3 imageEq pairing unions powers separation + rows conditions assignments omega group rowMaps familyGround + · exact M.flatSuccessorSmallActionMapFamily_mem c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3 actors graph3 imageEq pairing unions powers separation + rows conditions assignments omega group rowMaps familyGround collection + · intro g q + rw [M.flatSuccessorSmallAction_decode] + exact ⟨rfl, rfl, rfl⟩ + · exact M.flatSuccessorSmallAction_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3 + · exact M.flatSuccessorSmallRestriction_equivariant c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3 F2 + · exact M.flatSuccessorSmallInclusion_equivariant c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3 F2 laws + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageThreeAction + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageThreeActionData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageThreeClosure collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let stageOneOrder := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let stageOneTop := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid + exact M.stageThreeActionData act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + priorAction inputs carrier forcingOrder squaredGround indexSystem.index_ground order geometry.actors_ground originalMaps infinite + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeNameLifting.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeNameLifting.lean index 424c3cead39ec62cdf1f1e267ae622113117a303..61617f5f6d79eb296119e54f7cddbccb2a3cc9f0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeNameLifting.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageThreeNameLifting.lean @@ -1,595 +1,595 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatSuccessorAtomicTransfer -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatSuccessorProjectedFilters -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageThreeSupport - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws -local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws -variable {G : Type v} [Group G] -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) -local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs - -theorem flatSuccessorNameLift_hs (supports : NormalSubgroupFamily G) (τ : Name s) - (hs : HereditarilySymmetric lowerAction s supports τ) : - letI := smallOrder - HereditarilySymmetric (smallAct) (pres) supports (liftName τ) := by - let := smallOrder - exact hs.rename (smallAct) (pres) inc - (fun g p => (M.flatSuccessorSmallInclusion_equivariant c s I T levels alpha tests - rowAction lowerAction image inputs F laws g p).symm) - -include F laws in -theorem flatSuccessorNameFamily_valid (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : - ∀ z ∈ X, IsName (pres) z := by - intro z hz - have lifted := (liftName ⟨z, oldValid z hz⟩).property - rw [M.flatSuccessorNameLift_val c s I T levels alpha tests F laws ⟨z, oldValid z hz⟩] at lifted - exact lifted - -theorem flatSuccessorNameFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : - Name.renamedFamily (pres) inc X oldValid = X := by - apply ZFSet.ext - intro z - rw [Name.mem_renamedFamily] - constructor - · rintro ⟨τ, hτ, equal⟩ - have codes := M.flatSuccessorNameLift_val c s I T levels alpha tests F laws τ - exact (equal.trans codes).symm ▸ hτ - · intro hz - exact ⟨⟨z, oldValid z hz⟩, hz, - (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws ⟨z, oldValid z hz⟩).symm⟩ - -include F laws in -theorem flatSuccessorNameFamily_transport (supports : NormalSubgroupFamily G) (X : ZFSet.{u}) - (oldValid : ∀ z ∈ X, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ X → (lowerAction.act s g τ).val ∈ X) - (children : ∀ τ : Name s, τ.val ∈ X → HereditarilySymmetric lowerAction s supports τ) : - letI := smallOrder - (∀ z ∈ X, IsName (pres) z) ∧ - (∀ g (τ : Name (pres)), τ.val ∈ X → ((smallAct).act (pres) g τ).val ∈ X) ∧ - (∀ τ : Name (pres), τ.val ∈ X → HereditarilySymmetric (smallAct) (pres) supports τ) := by - let := smallOrder - refine ⟨M.flatSuccessorNameFamily_valid c s I T levels alpha tests F laws X oldValid, ?_, ?_⟩ - · intro g τ hτ - let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ - have same : liftName σ = τ := Subtype.ext - (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws σ) - rw [← same, M.flatSuccessorNameLift_act c s I T levels alpha tests F laws - rowAction lowerAction image inputs, M.flatSuccessorNameLift_val] - exact closed g σ hτ - · intro τ hτ - let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ - have same : liftName σ = τ := Subtype.ext - (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws σ) - rw [← same] - exact M.flatSuccessorNameLift_hs c s I T levels alpha tests F laws - rowAction lowerAction image inputs supports σ (children σ hτ) - -variable [OrderTop P] -local notation "smallTop" => M.flatSuccessorSmallTop c s I T levels alpha tests F laws - -theorem flatSuccessor_orderedPairNameFamily (X Y : ZFSet.{u}) : - letI := smallOrder - letI := smallTop - orderedPairNameFamily ((pres).encode ⊤) X Y = orderedPairNameFamily (s.encode ⊤) X Y := by - let := smallOrder - let := smallTop - rw [M.flatSuccessorPresentation_top] - -theorem flatSuccessor_iteratedPairNameFamily (X : ZFSet.{u}) (n : Nat) : - letI := smallOrder - letI := smallTop - iteratedPairNameFamily ((pres).encode ⊤) X n = iteratedPairNameFamily (s.encode ⊤) X n := by - let := smallOrder - let := smallTop - rw [M.flatSuccessorPresentation_top] - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable {G : Type v} {R P : Type u} [Group G] -variable [PartialOrder R] [PartialOrder P] - -structure FlatSuccessorNameLiftingData (M : TransitiveGround.{u}) - (c : Presentation R) (s : Presentation P) - (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) - {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) - (laws : FlatSuccessorLaws Jold I T levels alpha tests) - (rowAction : PosetAction G R) (lowerAction : PosetAction G P) - (image : G → ZFSet.{u} → ZFSet.{u}) - (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) : Prop where - codes : ∀ tau : Name s, - (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau).val = tau.val - inclusion_graph : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - s.graph (M.flatSuccessorPresentation c s I T levels alpha tests) - (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) = identityFunctionGraph s.carrier - inclusion_ground : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - s.graph (M.flatSuccessorPresentation c s I T levels alpha tests) - (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) ∈ M.sets - family_graph : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (X : ZFSet.{u}) (valid : ∀ z ∈ X, IsName s z), - Name.renameFamilyGraph (M.flatSuccessorPresentation c s I T levels alpha tests) - (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) X valid = identityFunctionGraph X - family_ground : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (X : ZFSet.{u}) (valid : ∀ z ∈ X, IsName s z), X ∈ M.sets → - Name.renameFamilyGraph (M.flatSuccessorPresentation c s I T levels alpha tests) - (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) X valid ∈ M.sets - projection : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - CompleteProjection (M.flatSuccessorSmallRestriction c s I T levels alpha tests F) - (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) - eval : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (H : Set (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))) (tau : Name s), - Name.eval H (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = - Name.eval {p | M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws p ∈ H} tau - projected_membership : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (H : ConditionFilter (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))) (p : P), - (projection.projectedFilter H).mem p ↔ ∃ q, H.mem q ∧ - M.flatSuccessorSmallRestriction c s I T levels alpha tests F q = p - projected_eval : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (H : ConditionFilter (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))) (tau : Name s), - Name.eval H.mem (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = - Name.eval (projection.projectedFilter H).mem tau - projected_generic : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (H : ConditionFilter (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))), - H.GenericFor (M.codedFamily (M.flatSuccessorPresentation c s I T levels alpha tests)) → - (projection.projectedFilter H).GenericFor (M.codedFamily s) - forcesEq : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (q : Shrink (FlatSuccessorCondition M c s I T levels alpha tests)) (sigma tau : Name s), - Name.ForcesEq q (M.flatSuccessorNameLift c s I T levels alpha tests F laws sigma) - (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) ↔ - Name.ForcesEq (M.flatSuccessorSmallRestriction c s I T levels alpha tests F q) sigma tau - forcesMem : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (q : Shrink (FlatSuccessorCondition M c s I T levels alpha tests)) (sigma tau : Name s), - Name.ForcesMem q (M.flatSuccessorNameLift c s I T levels alpha tests F laws sigma) - (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) ↔ - Name.ForcesMem (M.flatSuccessorSmallRestriction c s I T levels alpha tests F q) sigma tau - act : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (g : G) (tau : Name s), - (M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs).act - (M.flatSuccessorPresentation c s I T levels alpha tests) g - (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = - M.flatSuccessorNameLift c s I T levels alpha tests F laws (lowerAction.act s g tau) - stabilizer : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ tau : Name s, - (M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs).stabilizer - (M.flatSuccessorPresentation c s I T levels alpha tests) - (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = lowerAction.stabilizer s tau - hereditary : - letI := M.flatSuccessorSmallOrder c s I T levels alpha tests - ∀ (supports : NormalSubgroupFamily G) (tau : Name s), - HereditarilySymmetric lowerAction s supports tau → - HereditarilySymmetric - (M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs) - (M.flatSuccessorPresentation c s I T levels alpha tests) supports - (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u v -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws -local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws -variable {G : Type v} [Group G] -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) -local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs - -theorem flatSuccessorNameLiftingData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (lower : s.carrier ∈ M.sets) - (upper : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) : - FlatSuccessorNameLiftingData M c s I T levels alpha tests F laws - rowAction lowerAction image inputs := by - let := smallOrder - exact { - codes := M.flatSuccessorNameLift_val c s I T levels alpha tests F laws - inclusion_graph := M.flatSuccessorSmallInclusion_graph c s I T levels alpha tests F laws - inclusion_ground := M.flatSuccessorSmallInclusion_graph_mem c s I T levels alpha tests F laws - pairing unions powers separation lower - family_graph := M.flatSuccessorNameLiftGraph_eq c s I T levels alpha tests F laws - family_ground := M.flatSuccessorNameLiftGraph_mem c s I T levels alpha tests F laws - pairing unions powers separation - projection := M.flatSuccessorSmallCompleteProjection c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - eval := M.flatSuccessorNameLift_eval c s I T levels alpha tests F laws - projected_membership := M.flatSuccessorProjectedFilter_mem_iff c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - projected_eval := M.flatSuccessorProjectedFilter_eval c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - projected_generic := M.flatSuccessorProjectedFilter_codedGeneric c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha lower upper - forcesEq := M.flatSuccessorNameLift_forcesEq c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - forcesMem := M.flatSuccessorNameLift_forcesMem c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - act := M.flatSuccessorNameLift_act c s I T levels alpha tests F laws rowAction lowerAction image inputs - stabilizer := M.flatSuccessorNameLift_stabilizer c s I T levels alpha tests F laws rowAction lowerAction image inputs - hereditary := M.flatSuccessorNameLift_hs c s I T levels alpha tests F laws rowAction lowerAction image inputs } - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageThreeNameLiftingData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - support_data : StageThreeSupportData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - lifting : - let actionData := support_data.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, - let tests := M.refinementLevelTests pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 - action nodes d base directed next2.first (natSetCode 2) T2 - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 action nodes d base directed next2.first - actionData.closure_data.projection_data.first_level next.indices.levelCode next2.indices.levelCode - letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - letI := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let inclusion := M.flatSuccessorSmallInclusion c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 - ∃ inputs3 : FlatSuccessorActionInputs M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3, - let action3 := M.flatSuccessorSmallAction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3 - TransitiveGround.FlatSuccessorNameLiftingData M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - F2 laws a action image3 inputs3 ∧ - Name.renamedFamily pres3 inclusion T next2.valid1 = T ∧ - Name.renamedFamily pres3 inclusion T2 next2.valid2 = T2 ∧ - ((∀ z ∈ T, IsName pres3 z) ∧ - (∀ g (τ : Name pres3), τ.val ∈ T → (action3.act pres3 g τ).val ∈ T) ∧ - (∀ τ : Name pres3, τ.val ∈ T → - HereditarilySymmetric action3 pres3 (d.principalSupportFamily base directed) τ)) ∧ - ((∀ z ∈ T2, IsName pres3 z) ∧ - (∀ g (τ : Name pres3), τ.val ∈ T2 → (action3.act pres3 g τ).val ∈ T2) ∧ - (∀ τ : Name pres3, τ.val ∈ T2 → - HereditarilySymmetric action3 pres3 (d.principalSupportFamily base directed) τ)) ∧ - T2 = orderedPairNameFamily (pres3.encode ⊤) T T ∧ - ∀ n : Nat, iteratedPairNameFamily (pres3.encode ⊤) T n = - iteratedPairNameFamily (pres.encode ⊤) T n - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (M : TransitiveGround.{u}) -theorem stageThreeNameLiftingData - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (prior : StageThreeSupportData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used) - (rows : c.carrier ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - StageThreeNameLiftingData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used := by - let actionData := prior.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data - let data := actionData.closure_data.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - let first := actionData.closure_data.projection_data.first_level - let second := next.indices.levelCode - let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first - obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, inputs3, _⟩ := prior.support - let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder - data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first - let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection - hCarrier hOrder data.terms_ground next2.valid1 action nodes d base directed next2.first - first second next2.indices.levelCode - let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 - let := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - have hLevels := M.stageThreeAssignmentLevels_mem pairing unions powers separation - hI0 next.indices.index_ground next2.indices.index_ground data.terms_ground - have hAlpha := M.natSetCode_mem separation infinite 2 - have conditions := M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder - (M.omega_mem separation infinite) - refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, inputs3, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact M.flatSuccessorNameLiftingData c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - F2 laws a action image3 inputs3 pairing unions powers separation infinite choice - hLevels hAlpha hCarrier conditions - · exact M.flatSuccessorNameFamily_eq c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - F2 laws T next2.valid1 - · exact M.flatSuccessorNameFamily_eq c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - F2 laws T2 next2.valid2 - · exact M.flatSuccessorNameFamily_transport c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - F2 laws a action image3 inputs3 (d.principalSupportFamily base directed) T - next2.valid1 next2.inputs.terms_closed next2.terms_hs - · exact M.flatSuccessorNameFamily_transport c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - F2 laws a action image3 inputs3 (d.principalSupportFamily base directed) T2 - next2.valid2 next2.inputs.pairs_closed next2.pairs_hs - · rw [M.flatSuccessor_orderedPairNameFamily c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws] - rw [M.stageTwo_orderedPairNameFamily c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first F first second] - exact data.index_data.square - · exact M.flatSuccessor_iteratedPairNameFamily c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - F2 laws T - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageThreeNameLifting - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageThreeNameLiftingData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageThreeSupport collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - exact M.stageThreeNameLiftingData act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - priorAction carrier indexSystem.index_ground order infinite choice - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatSuccessorAtomicTransfer +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFlatSuccessorProjectedFilters +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageThreeSupport + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws +local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws +variable {G : Type v} [Group G] +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) +local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs + +theorem flatSuccessorNameLift_hs (supports : NormalSubgroupFamily G) (τ : Name s) + (hs : HereditarilySymmetric lowerAction s supports τ) : + letI := smallOrder + HereditarilySymmetric (smallAct) (pres) supports (liftName τ) := by + let := smallOrder + exact hs.rename (smallAct) (pres) inc + (fun g p => (M.flatSuccessorSmallInclusion_equivariant c s I T levels alpha tests + rowAction lowerAction image inputs F laws g p).symm) + +include F laws in +theorem flatSuccessorNameFamily_valid (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : + ∀ z ∈ X, IsName (pres) z := by + intro z hz + have lifted := (liftName ⟨z, oldValid z hz⟩).property + rw [M.flatSuccessorNameLift_val c s I T levels alpha tests F laws ⟨z, oldValid z hz⟩] at lifted + exact lifted + +theorem flatSuccessorNameFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : + Name.renamedFamily (pres) inc X oldValid = X := by + apply ZFSet.ext + intro z + rw [Name.mem_renamedFamily] + constructor + · rintro ⟨τ, hτ, equal⟩ + have codes := M.flatSuccessorNameLift_val c s I T levels alpha tests F laws τ + exact (equal.trans codes).symm ▸ hτ + · intro hz + exact ⟨⟨z, oldValid z hz⟩, hz, + (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws ⟨z, oldValid z hz⟩).symm⟩ + +include F laws in +theorem flatSuccessorNameFamily_transport (supports : NormalSubgroupFamily G) (X : ZFSet.{u}) + (oldValid : ∀ z ∈ X, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ X → (lowerAction.act s g τ).val ∈ X) + (children : ∀ τ : Name s, τ.val ∈ X → HereditarilySymmetric lowerAction s supports τ) : + letI := smallOrder + (∀ z ∈ X, IsName (pres) z) ∧ + (∀ g (τ : Name (pres)), τ.val ∈ X → ((smallAct).act (pres) g τ).val ∈ X) ∧ + (∀ τ : Name (pres), τ.val ∈ X → HereditarilySymmetric (smallAct) (pres) supports τ) := by + let := smallOrder + refine ⟨M.flatSuccessorNameFamily_valid c s I T levels alpha tests F laws X oldValid, ?_, ?_⟩ + · intro g τ hτ + let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ + have same : liftName σ = τ := Subtype.ext + (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws σ) + rw [← same, M.flatSuccessorNameLift_act c s I T levels alpha tests F laws + rowAction lowerAction image inputs, M.flatSuccessorNameLift_val] + exact closed g σ hτ + · intro τ hτ + let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ + have same : liftName σ = τ := Subtype.ext + (M.flatSuccessorNameLift_val c s I T levels alpha tests F laws σ) + rw [← same] + exact M.flatSuccessorNameLift_hs c s I T levels alpha tests F laws + rowAction lowerAction image inputs supports σ (children σ hτ) + +variable [OrderTop P] +local notation "smallTop" => M.flatSuccessorSmallTop c s I T levels alpha tests F laws + +theorem flatSuccessor_orderedPairNameFamily (X Y : ZFSet.{u}) : + letI := smallOrder + letI := smallTop + orderedPairNameFamily ((pres).encode ⊤) X Y = orderedPairNameFamily (s.encode ⊤) X Y := by + let := smallOrder + let := smallTop + rw [M.flatSuccessorPresentation_top] + +theorem flatSuccessor_iteratedPairNameFamily (X : ZFSet.{u}) (n : Nat) : + letI := smallOrder + letI := smallTop + iteratedPairNameFamily ((pres).encode ⊤) X n = iteratedPairNameFamily (s.encode ⊤) X n := by + let := smallOrder + let := smallTop + rw [M.flatSuccessorPresentation_top] + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable {G : Type v} {R P : Type u} [Group G] +variable [PartialOrder R] [PartialOrder P] + +structure FlatSuccessorNameLiftingData (M : TransitiveGround.{u}) + (c : Presentation R) (s : Presentation P) + (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) + {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) + (laws : FlatSuccessorLaws Jold I T levels alpha tests) + (rowAction : PosetAction G R) (lowerAction : PosetAction G P) + (image : G → ZFSet.{u} → ZFSet.{u}) + (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) : Prop where + codes : ∀ tau : Name s, + (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau).val = tau.val + inclusion_graph : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + s.graph (M.flatSuccessorPresentation c s I T levels alpha tests) + (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) = identityFunctionGraph s.carrier + inclusion_ground : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + s.graph (M.flatSuccessorPresentation c s I T levels alpha tests) + (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) ∈ M.sets + family_graph : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (X : ZFSet.{u}) (valid : ∀ z ∈ X, IsName s z), + Name.renameFamilyGraph (M.flatSuccessorPresentation c s I T levels alpha tests) + (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) X valid = identityFunctionGraph X + family_ground : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (X : ZFSet.{u}) (valid : ∀ z ∈ X, IsName s z), X ∈ M.sets → + Name.renameFamilyGraph (M.flatSuccessorPresentation c s I T levels alpha tests) + (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) X valid ∈ M.sets + projection : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + CompleteProjection (M.flatSuccessorSmallRestriction c s I T levels alpha tests F) + (M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws) + eval : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (H : Set (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))) (tau : Name s), + Name.eval H (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = + Name.eval {p | M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws p ∈ H} tau + projected_membership : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (H : ConditionFilter (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))) (p : P), + (projection.projectedFilter H).mem p ↔ ∃ q, H.mem q ∧ + M.flatSuccessorSmallRestriction c s I T levels alpha tests F q = p + projected_eval : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (H : ConditionFilter (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))) (tau : Name s), + Name.eval H.mem (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = + Name.eval (projection.projectedFilter H).mem tau + projected_generic : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (H : ConditionFilter (Shrink (FlatSuccessorCondition M c s I T levels alpha tests))), + H.GenericFor (M.codedFamily (M.flatSuccessorPresentation c s I T levels alpha tests)) → + (projection.projectedFilter H).GenericFor (M.codedFamily s) + forcesEq : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (q : Shrink (FlatSuccessorCondition M c s I T levels alpha tests)) (sigma tau : Name s), + Name.ForcesEq q (M.flatSuccessorNameLift c s I T levels alpha tests F laws sigma) + (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) ↔ + Name.ForcesEq (M.flatSuccessorSmallRestriction c s I T levels alpha tests F q) sigma tau + forcesMem : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (q : Shrink (FlatSuccessorCondition M c s I T levels alpha tests)) (sigma tau : Name s), + Name.ForcesMem q (M.flatSuccessorNameLift c s I T levels alpha tests F laws sigma) + (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) ↔ + Name.ForcesMem (M.flatSuccessorSmallRestriction c s I T levels alpha tests F q) sigma tau + act : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (g : G) (tau : Name s), + (M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs).act + (M.flatSuccessorPresentation c s I T levels alpha tests) g + (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = + M.flatSuccessorNameLift c s I T levels alpha tests F laws (lowerAction.act s g tau) + stabilizer : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ tau : Name s, + (M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs).stabilizer + (M.flatSuccessorPresentation c s I T levels alpha tests) + (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) = lowerAction.stabilizer s tau + hereditary : + letI := M.flatSuccessorSmallOrder c s I T levels alpha tests + ∀ (supports : NormalSubgroupFamily G) (tau : Name s), + HereditarilySymmetric lowerAction s supports tau → + HereditarilySymmetric + (M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs) + (M.flatSuccessorPresentation c s I T levels alpha tests) supports + (M.flatSuccessorNameLift c s I T levels alpha tests F laws tau) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u v +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws +local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws +variable {G : Type v} [Group G] +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) +local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs + +theorem flatSuccessorNameLiftingData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (lower : s.carrier ∈ M.sets) + (upper : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) : + FlatSuccessorNameLiftingData M c s I T levels alpha tests F laws + rowAction lowerAction image inputs := by + let := smallOrder + exact { + codes := M.flatSuccessorNameLift_val c s I T levels alpha tests F laws + inclusion_graph := M.flatSuccessorSmallInclusion_graph c s I T levels alpha tests F laws + inclusion_ground := M.flatSuccessorSmallInclusion_graph_mem c s I T levels alpha tests F laws + pairing unions powers separation lower + family_graph := M.flatSuccessorNameLiftGraph_eq c s I T levels alpha tests F laws + family_ground := M.flatSuccessorNameLiftGraph_mem c s I T levels alpha tests F laws + pairing unions powers separation + projection := M.flatSuccessorSmallCompleteProjection c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + eval := M.flatSuccessorNameLift_eval c s I T levels alpha tests F laws + projected_membership := M.flatSuccessorProjectedFilter_mem_iff c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + projected_eval := M.flatSuccessorProjectedFilter_eval c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + projected_generic := M.flatSuccessorProjectedFilter_codedGeneric c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha lower upper + forcesEq := M.flatSuccessorNameLift_forcesEq c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + forcesMem := M.flatSuccessorNameLift_forcesMem c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + act := M.flatSuccessorNameLift_act c s I T levels alpha tests F laws rowAction lowerAction image inputs + stabilizer := M.flatSuccessorNameLift_stabilizer c s I T levels alpha tests F laws rowAction lowerAction image inputs + hereditary := M.flatSuccessorNameLift_hs c s I T levels alpha tests F laws rowAction lowerAction image inputs } + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageThreeNameLiftingData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + support_data : StageThreeSupportData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + lifting : + let actionData := support_data.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, + let tests := M.refinementLevelTests pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 + action nodes d base directed next2.first (natSetCode 2) T2 + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 action nodes d base directed next2.first + actionData.closure_data.projection_data.first_level next.indices.levelCode next2.indices.levelCode + letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + letI := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let inclusion := M.flatSuccessorSmallInclusion c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 + ∃ inputs3 : FlatSuccessorActionInputs M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3, + let action3 := M.flatSuccessorSmallAction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3 + TransitiveGround.FlatSuccessorNameLiftingData M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + F2 laws a action image3 inputs3 ∧ + Name.renamedFamily pres3 inclusion T next2.valid1 = T ∧ + Name.renamedFamily pres3 inclusion T2 next2.valid2 = T2 ∧ + ((∀ z ∈ T, IsName pres3 z) ∧ + (∀ g (τ : Name pres3), τ.val ∈ T → (action3.act pres3 g τ).val ∈ T) ∧ + (∀ τ : Name pres3, τ.val ∈ T → + HereditarilySymmetric action3 pres3 (d.principalSupportFamily base directed) τ)) ∧ + ((∀ z ∈ T2, IsName pres3 z) ∧ + (∀ g (τ : Name pres3), τ.val ∈ T2 → (action3.act pres3 g τ).val ∈ T2) ∧ + (∀ τ : Name pres3, τ.val ∈ T2 → + HereditarilySymmetric action3 pres3 (d.principalSupportFamily base directed) τ)) ∧ + T2 = orderedPairNameFamily (pres3.encode ⊤) T T ∧ + ∀ n : Nat, iteratedPairNameFamily (pres3.encode ⊤) T n = + iteratedPairNameFamily (pres.encode ⊤) T n + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (M : TransitiveGround.{u}) +theorem stageThreeNameLiftingData + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (prior : StageThreeSupportData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used) + (rows : c.carrier ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + StageThreeNameLiftingData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used := by + let actionData := prior.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data + let data := actionData.closure_data.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + let first := actionData.closure_data.projection_data.first_level + let second := next.indices.levelCode + let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first + obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, inputs3, _⟩ := prior.support + let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder + data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first + let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection + hCarrier hOrder data.terms_ground next2.valid1 action nodes d base directed next2.first + first second next2.indices.levelCode + let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 + let := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + have hLevels := M.stageThreeAssignmentLevels_mem pairing unions powers separation + hI0 next.indices.index_ground next2.indices.index_ground data.terms_ground + have hAlpha := M.natSetCode_mem separation infinite 2 + have conditions := M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder + (M.omega_mem separation infinite) + refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, inputs3, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact M.flatSuccessorNameLiftingData c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + F2 laws a action image3 inputs3 pairing unions powers separation infinite choice + hLevels hAlpha hCarrier conditions + · exact M.flatSuccessorNameFamily_eq c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + F2 laws T next2.valid1 + · exact M.flatSuccessorNameFamily_eq c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + F2 laws T2 next2.valid2 + · exact M.flatSuccessorNameFamily_transport c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + F2 laws a action image3 inputs3 (d.principalSupportFamily base directed) T + next2.valid1 next2.inputs.terms_closed next2.terms_hs + · exact M.flatSuccessorNameFamily_transport c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + F2 laws a action image3 inputs3 (d.principalSupportFamily base directed) T2 + next2.valid2 next2.inputs.pairs_closed next2.pairs_hs + · rw [M.flatSuccessor_orderedPairNameFamily c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws] + rw [M.stageTwo_orderedPairNameFamily c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first F first second] + exact data.index_data.square + · exact M.flatSuccessor_iteratedPairNameFamily c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + F2 laws T + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageThreeNameLifting + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageThreeNameLiftingData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageThreeSupport collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + exact M.stageThreeNameLiftingData act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + priorAction carrier indexSystem.index_ground order infinite choice + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoAction.lean index 4b7be1e3c7fbaf9ed45dd08bca2ad60d7068bcb7..dd985be475fa6fce83c8104eba53bfca8775c469 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoAction.lean @@ -1,183 +1,183 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageTwoClosure - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageTwoAction - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageTwoActionData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageTwoClosure collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, closureData⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - refine M.stageTwoActionData act c nextAction nextPres b s a ⊥ directed lifted squared valid1 - pairing unions powers separation collection closureData valid2 inputs carrier forcingOrder - squaredGround indexSystem.index_ground order geometry.actors_ground originalMaps infinite choice ?_ ?_ ?_ - · intro F g q - exact M.stageOneFlatAction_row act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection - F nextAction laws g q - · intro F g q - exact M.stageOneFlatAction_assignments act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection - F nextAction laws g q - · intro g - have agree := M.stageOneTermActionGraph_eq act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection - b inputs squaredGround (M.omega_mem separation infinite) lifted valid1 - closureData.projection_data.carrier_data.index_data.next.valid1 g - simpa only [equal] using agree - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageTwoClosure + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageTwoAction + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageTwoActionData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageTwoClosure collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, closureData⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + refine M.stageTwoActionData act c nextAction nextPres b s a ⊥ directed lifted squared valid1 + pairing unions powers separation collection closureData valid2 inputs carrier forcingOrder + squaredGround indexSystem.index_ground order geometry.actors_ground originalMaps infinite choice ?_ ?_ ?_ + · intro F g q + exact M.stageOneFlatAction_row act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection + F nextAction laws g q + · intro F g q + exact M.stageOneFlatAction_assignments act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection + F nextAction laws g q + · intro g + have agree := M.stageOneTermActionGraph_eq act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection + b inputs squaredGround (M.omega_mem separation infinite) lifted valid1 + closureData.projection_data.carrier_data.index_data.next.valid1 g + simpa only [equal] using agree + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoConditions.lean index c939a88d8c8edc628ee15acf2a56faa9d6354be2..5dc8362a893c2711ef52db1d4689d7d89c215c3d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoConditions.lean @@ -1,180 +1,180 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageTwoIndices - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageTwoConditions - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageTwoCarrierData M c.carrier (c.encode ⊤) act c.pairEmpty nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageTwoIndices collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, indexData⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - have nextCarrier : nextPres.carrier ∈ M.sets := forcingGround - have nextOrder : nextPres.conditionOrder ∈ M.sets := by - rw [M.stageOneConditionOrder_graph act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground - liftedGround indexSystem ⊥ directed first collection] - exact orderGround - have lowerTop : ZFSet.pair (c.encode ⊤) ∅ ∈ nextPres.carrier := by - have entry := nextPres.encode_mem ⊤ - rw [indexData.top_code] at entry - exact entry - exact M.stageTwoCarrierData c.carrier (c.encode ⊤) act c.pairEmpty nextAction nextPres b s a - ⊥ directed lifted squared valid1 pairing unions powers separation collection indexData - carrier indexSystem.index_ground liftedGround nextCarrier nextOrder geometry.carrier_ground - order (M.omega_mem separation infinite) (c.encode_mem ⊤) lowerTop - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageTwoIndices + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageTwoConditions + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageTwoCarrierData M c.carrier (c.encode ⊤) act c.pairEmpty nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageTwoIndices collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, indexData⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + have nextCarrier : nextPres.carrier ∈ M.sets := forcingGround + have nextOrder : nextPres.conditionOrder ∈ M.sets := by + rw [M.stageOneConditionOrder_graph act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground + liftedGround indexSystem ⊥ directed first collection] + exact orderGround + have lowerTop : ZFSet.pair (c.encode ⊤) ∅ ∈ nextPres.carrier := by + have entry := nextPres.encode_mem ⊤ + rw [indexData.top_code] at entry + exact entry + exact M.stageTwoCarrierData c.carrier (c.encode ⊤) act c.pairEmpty nextAction nextPres b s a + ⊥ directed lifted squared valid1 pairing unions powers separation collection indexData + carrier indexSystem.index_ground liftedGround nextCarrier nextOrder geometry.carrier_ground + order (M.omega_mem separation infinite) (c.encode_mem ⊤) lowerTop + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoNameLifting.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoNameLifting.lean index 053be66d2b2ad1c96b981e9defd684f1f40832a2..be563e5c9619063ca2a359c19ddd42afac37d41d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoNameLifting.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStageTwoNameLifting.lean @@ -1,341 +1,341 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageTwoSupport -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoAtomicLifting -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoProjectedFilters -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoRefinementObjects - -namespace OAI - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageTwoNameLiftingData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - support_data : StageTwoSupportData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - lifting : - let actionData := support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - let restriction := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F - let inclusion := M.stageTwoSmallInclusion c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - let liftName := M.stageTwoNameLift c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first F - actionData.closure_data.projection_data.first_level next.indices.levelCode - ∃ projection : CompleteProjection restriction inclusion, - (∀ τ : Name s, (liftName τ).val = τ.val) ∧ - (∀ τ : Name s, τ.val ∈ M.sets → (liftName τ).val ∈ M.sets) ∧ - s.graph pres inclusion = identityFunctionGraph s.carrier ∧ - s.graph pres inclusion ∈ M.sets ∧ - (∀ Y (oldValid : ∀ z ∈ Y, IsName s z), - Name.renameFamilyGraph pres inclusion Y oldValid = identityFunctionGraph Y ∧ - (Y ∈ M.sets → Name.renameFamilyGraph pres inclusion Y oldValid ∈ M.sets)) ∧ - (∀ (H : Set (Shrink Condition)) (τ : Name s), - Name.eval H (liftName τ) = Name.eval {p | inclusion p ∈ H} τ) ∧ - (∀ (H : ConditionFilter (Shrink Condition)) (τ : Name s), - Name.eval H.mem (liftName τ) = Name.eval (projection.projectedFilter H).mem τ) ∧ - (∀ H : ConditionFilter (Shrink Condition), H.GenericFor (M.codedFamily pres) → - (projection.projectedFilter H).GenericFor (M.codedFamily s)) ∧ - (∀ (q : Shrink Condition) (σ τ : Name s), - Name.ForcesEq q (liftName σ) (liftName τ) ↔ Name.ForcesEq (restriction q) σ τ) ∧ - (∀ (q : Shrink Condition) (σ τ : Name s), - Name.ForcesMem q (liftName σ) (liftName τ) ↔ Name.ForcesMem (restriction q) σ τ) ∧ - (∀ g (τ : Name s), action.act pres g (liftName τ) = liftName (e.act s g τ)) ∧ - (∀ τ : Name s, action.stabilizer pres (liftName τ) = e.stabilizer s τ) ∧ - (∀ (supports : Compression.RecursiveMaps.NormalSubgroupFamily G) (τ : Name s), - HereditarilySymmetric e s supports τ → HereditarilySymmetric action pres supports (liftName τ)) ∧ - Name.renamedFamily pres inclusion T next.valid1 = T ∧ - Name.renamedFamily pres inclusion T2 next.valid2 = T2 ∧ - ((∀ z ∈ T, IsName pres z) ∧ - (∀ g (τ : Name pres), τ.val ∈ T → (action.act pres g τ).val ∈ T) ∧ - (∀ τ : Name pres, τ.val ∈ T → - HereditarilySymmetric action pres (d.principalSupportFamily base directed) τ)) ∧ - ((∀ z ∈ T2, IsName pres z) ∧ - (∀ g (τ : Name pres), τ.val ∈ T2 → (action.act pres g τ).val ∈ T2) ∧ - (∀ τ : Name pres, τ.val ∈ T2 → - HereditarilySymmetric action pres (d.principalSupportFamily base directed) τ)) ∧ - T2 = orderedPairNameFamily (pres.encode ⊤) T T ∧ - ∀ n : Nat, iteratedPairNameFamily (pres.encode ⊤) T n = - iteratedPairNameFamily (s.encode ⊤) T n - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (M : TransitiveGround.{u}) -theorem stageTwoNameLiftingData - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (prior : StageTwoSupportData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used) - (rows : c.carrier ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - StageTwoNameLiftingData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used := by - let actionData := prior.action_data - let data := actionData.closure_data.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - let first := actionData.closure_data.projection_data.first_level - let second := next.indices.levelCode - let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first - obtain ⟨F, hNodes, inputs, _⟩ := actionData.actions - refine ⟨prior, F, ?_⟩ - let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first F first second - refine ⟨hNodes, inputs, ?_⟩ - have projection := M.stageTwoSmallCompleteProjection c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first F first second infinite choice hI0 next.indices.index_ground - refine ⟨projection, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact M.stageTwoNameLift_val c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second - · exact M.stageTwoNameLift_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second - · exact M.stageTwoSmallInclusion_graph c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second - · exact M.stageTwoSmallInclusion_graph_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second - · intro Y oldValid - exact ⟨M.stageTwoNameLiftGraph_eq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second Y oldValid, - M.stageTwoNameLiftGraph_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second Y oldValid⟩ - · exact M.stageTwoNameLift_eval c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second - · exact M.stageTwoProjectedFilter_eval c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground - · exact M.stageTwoProjectedFilter_codedGeneric c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground rows nodeOrder (M.omega_mem separation infinite) - · exact M.stageTwoNameLift_forcesEq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground - · exact M.stageTwoNameLift_forcesMem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground - · exact M.stageTwoNameLift_act c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground - · exact M.stageTwoNameLift_stabilizer c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground - · exact M.stageTwoNameLift_hs c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground - · exact M.stageTwoNameFamily_eq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T next.valid1 - · exact M.stageTwoNameFamily_eq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T2 next.valid2 - · exact M.stageTwoNameFamily_transport c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground (d.principalSupportFamily base directed) T next.valid1 next.inputs.terms_closed next.terms_hs - · exact M.stageTwoNameFamily_transport c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground (d.principalSupportFamily base directed) T2 next.valid2 next.inputs.pairs_closed next.pairs_hs - · rw [M.stageTwo_orderedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second] - exact data.index_data.square - · exact M.stageTwo_iteratedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageTwoNameLifting - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageTwoNameLiftingData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageTwoSupport collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid - exact M.stageTwoNameLiftingData act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - priorAction carrier indexSystem.index_ground order infinite choice - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageTwoSupport +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoAtomicLifting +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoProjectedFilters +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoRefinementObjects + +namespace OAI + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageTwoNameLiftingData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + support_data : StageTwoSupportData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + lifting : + let actionData := support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + let restriction := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F + let inclusion := M.stageTwoSmallInclusion c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + let liftName := M.stageTwoNameLift c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first F + actionData.closure_data.projection_data.first_level next.indices.levelCode + ∃ projection : CompleteProjection restriction inclusion, + (∀ τ : Name s, (liftName τ).val = τ.val) ∧ + (∀ τ : Name s, τ.val ∈ M.sets → (liftName τ).val ∈ M.sets) ∧ + s.graph pres inclusion = identityFunctionGraph s.carrier ∧ + s.graph pres inclusion ∈ M.sets ∧ + (∀ Y (oldValid : ∀ z ∈ Y, IsName s z), + Name.renameFamilyGraph pres inclusion Y oldValid = identityFunctionGraph Y ∧ + (Y ∈ M.sets → Name.renameFamilyGraph pres inclusion Y oldValid ∈ M.sets)) ∧ + (∀ (H : Set (Shrink Condition)) (τ : Name s), + Name.eval H (liftName τ) = Name.eval {p | inclusion p ∈ H} τ) ∧ + (∀ (H : ConditionFilter (Shrink Condition)) (τ : Name s), + Name.eval H.mem (liftName τ) = Name.eval (projection.projectedFilter H).mem τ) ∧ + (∀ H : ConditionFilter (Shrink Condition), H.GenericFor (M.codedFamily pres) → + (projection.projectedFilter H).GenericFor (M.codedFamily s)) ∧ + (∀ (q : Shrink Condition) (σ τ : Name s), + Name.ForcesEq q (liftName σ) (liftName τ) ↔ Name.ForcesEq (restriction q) σ τ) ∧ + (∀ (q : Shrink Condition) (σ τ : Name s), + Name.ForcesMem q (liftName σ) (liftName τ) ↔ Name.ForcesMem (restriction q) σ τ) ∧ + (∀ g (τ : Name s), action.act pres g (liftName τ) = liftName (e.act s g τ)) ∧ + (∀ τ : Name s, action.stabilizer pres (liftName τ) = e.stabilizer s τ) ∧ + (∀ (supports : Compression.RecursiveMaps.NormalSubgroupFamily G) (τ : Name s), + HereditarilySymmetric e s supports τ → HereditarilySymmetric action pres supports (liftName τ)) ∧ + Name.renamedFamily pres inclusion T next.valid1 = T ∧ + Name.renamedFamily pres inclusion T2 next.valid2 = T2 ∧ + ((∀ z ∈ T, IsName pres z) ∧ + (∀ g (τ : Name pres), τ.val ∈ T → (action.act pres g τ).val ∈ T) ∧ + (∀ τ : Name pres, τ.val ∈ T → + HereditarilySymmetric action pres (d.principalSupportFamily base directed) τ)) ∧ + ((∀ z ∈ T2, IsName pres z) ∧ + (∀ g (τ : Name pres), τ.val ∈ T2 → (action.act pres g τ).val ∈ T2) ∧ + (∀ τ : Name pres, τ.val ∈ T2 → + HereditarilySymmetric action pres (d.principalSupportFamily base directed) τ)) ∧ + T2 = orderedPairNameFamily (pres.encode ⊤) T T ∧ + ∀ n : Nat, iteratedPairNameFamily (pres.encode ⊤) T n = + iteratedPairNameFamily (s.encode ⊤) T n + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (M : TransitiveGround.{u}) +theorem stageTwoNameLiftingData + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (prior : StageTwoSupportData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used) + (rows : c.carrier ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + StageTwoNameLiftingData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used := by + let actionData := prior.action_data + let data := actionData.closure_data.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + let first := actionData.closure_data.projection_data.first_level + let second := next.indices.levelCode + let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first + obtain ⟨F, hNodes, inputs, _⟩ := actionData.actions + refine ⟨prior, F, ?_⟩ + let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first F first second + refine ⟨hNodes, inputs, ?_⟩ + have projection := M.stageTwoSmallCompleteProjection c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first F first second infinite choice hI0 next.indices.index_ground + refine ⟨projection, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact M.stageTwoNameLift_val c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second + · exact M.stageTwoNameLift_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second + · exact M.stageTwoSmallInclusion_graph c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second + · exact M.stageTwoSmallInclusion_graph_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second + · intro Y oldValid + exact ⟨M.stageTwoNameLiftGraph_eq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second Y oldValid, + M.stageTwoNameLiftGraph_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second Y oldValid⟩ + · exact M.stageTwoNameLift_eval c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second + · exact M.stageTwoProjectedFilter_eval c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground + · exact M.stageTwoProjectedFilter_codedGeneric c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground rows nodeOrder (M.omega_mem separation infinite) + · exact M.stageTwoNameLift_forcesEq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground + · exact M.stageTwoNameLift_forcesMem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second infinite choice hI0 next.indices.index_ground + · exact M.stageTwoNameLift_act c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground + · exact M.stageTwoNameLift_stabilizer c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground + · exact M.stageTwoNameLift_hs c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground + · exact M.stageTwoNameFamily_eq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T next.valid1 + · exact M.stageTwoNameFamily_eq c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T2 next.valid2 + · exact M.stageTwoNameFamily_transport c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground (d.principalSupportFamily base directed) T next.valid1 next.inputs.terms_closed next.terms_hs + · exact M.stageTwoNameFamily_transport c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs infinite choice hI0 next.indices.index_ground (d.principalSupportFamily base directed) T2 next.valid2 next.inputs.pairs_closed next.pairs_hs + · rw [M.stageTwo_orderedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second] + exact data.index_data.square + · exact M.stageTwo_iteratedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageTwoNameLifting + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageTwoNameLiftingData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageTwoSupport collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid + exact M.stageTwoNameLiftingData act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + priorAction carrier indexSystem.index_ground order infinite choice + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralCommonSupportInduction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralCommonSupportInduction.lean index f72b6301c4011b452b24210a9cbfb55d45dfd678..e56164fda3818f1b094d52cb558f8e04fddacc00 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralCommonSupportInduction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralCommonSupportInduction.lean @@ -1,1332 +1,1332 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticRepresentedDomainEasyCases -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStoredPreparedDensity -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralSeparationRefinements - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula - -private def separationWitnessBody : BoundedFormula 12 := - .conj (.mem 1 6) (.conj (tripleMembershipFormula 1 3 0 10) - (.conj (pairMembershipFormula 2 0 11) - (.conj (pairMembershipFormula 1 4 7) (pairMembershipFormula 1 5 7)))) - -def separationWitnessFormula : BoundedFormula 10 := - exMem 7 (exMem 7 separationWitnessBody) - -def localizedWitnessFormula : BoundedFormula 5 := - .disj (.mem 0 1) (.neg (exMem 2 - (.conj (pairMembershipFormula 0 1 4) (pairMembershipFormula 0 5 4)))) - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem separationWitness_mem (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) - (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) - (Sep : G → G → Prop) - (hSep : (t.product t).subset (fun gh => Sep gh.1 gh.2) ∈ M.sets) - (p : P) (g₁ g₂ : G) : s.subset (a.SeparationWitness K Sep p g₁ g₂) ∈ M.sets := by - let params := extend (s.encode p) (extend (t.encode g₁) (extend (t.encode g₂) - (extend (t.subset (fun g => g ∈ K)) (extend ((t.product t).subset (fun gh => Sep gh.1 gh.2)) - (extend s.carrier (extend t.carrier (extend (a.actionGraph s t) - (extend s.conditionOrder Fin.elim0)))))))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases (M.transitive carrier (s.encode_mem p)) - (Fin.cases (M.transitive group (t.encode_mem g₁)) - (Fin.cases (M.transitive group (t.encode_mem g₂)) - (Fin.cases hK (Fin.cases hSep (Fin.cases carrier - (Fin.cases group (Fin.cases action (Fin.cases order (fun i => Fin.elim0 i))))))))) - have selected := M.bounded_separation_mem separation BoundedFormula.separationWitnessFormula params members carrier - have correct (q : P) : BoundedFormula.Truth BoundedFormula.separationWitnessFormula - (extend (s.encode q) params) ↔ q ∈ a.SeparationWitness K Sep p g₁ g₂ := by - simp only [BoundedFormula.separationWitnessFormula, BoundedFormula.separationWitnessBody, - BoundedFormula.truth_exMem, BoundedFormula.Truth, - BoundedFormula.truth_tripleMembershipFormula, BoundedFormula.truth_pairMembershipFormula] - change (∃ h ∈ t.carrier, ∃ p' ∈ s.carrier, - h ∈ t.subset (fun g => g ∈ K) ∧ ZFSet.pair (ZFSet.pair h (s.encode p)) p' ∈ a.actionGraph s t ∧ - ZFSet.pair (s.encode q) p' ∈ s.conditionOrder ∧ - ZFSet.pair h (t.encode g₁) ∈ (t.product t).subset (fun gh => Sep gh.1 gh.2) ∧ - ZFSet.pair h (t.encode g₂) ∈ (t.product t).subset (fun gh => Sep gh.1 gh.2)) ↔ _ - have sep (g h : G) : ZFSet.pair (t.encode g) (t.encode h) ∈ - (t.product t).subset (fun gh => Sep gh.1 gh.2) ↔ Sep g h := - (t.product t).encode_mem_subset _ (g,h) - constructor - · rintro ⟨h,hh,p',hp',fixed,acted,lower,first,second⟩ - obtain ⟨h,rfl⟩ := (t.mem_carrier h).1 hh - obtain ⟨p',rfl⟩ := (s.mem_carrier p').1 hp' - rw [a.triple_mem_actionGraph] at acted - exact ⟨h,(t.encode_mem_subset _ h).1 fixed, - acted ▸ (s.pair_mem_conditionOrder _ _).1 lower,(sep h g₁).1 first,(sep h g₂).1 second⟩ - · rintro ⟨h,fixed,lower,first,second⟩ - exact ⟨t.encode h,t.encode_mem h,s.encode (a.iso h p),s.encode_mem _, - (t.encode_mem_subset _ h).2 fixed,(a.triple_mem_actionGraph s t h p _).2 rfl, - (s.pair_mem_conditionOrder _ _).2 lower,(sep h g₁).2 first,(sep h g₂).2 second⟩ - have eq : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.separationWitnessFormula - (extend z params)) s.carrier = s.subset (a.SeparationWitness K Sep p g₁ g₂) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz,rel⟩ - obtain ⟨q,rfl⟩ := (s.mem_carrier z).1 hz - exact (s.encode_mem_subset _ q).2 ((correct q).1 rel) - · intro hz - obtain ⟨q,hq,rfl⟩ := (s.mem_subset _ z).1 hz - exact ⟨s.encode_mem q,(correct q).2 hq⟩ - exact eq ▸ selected - -omit a t in -theorem localized_mem (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {E : Set P} (hE : s.subset E ∈ M.sets) (r : P) : s.subset (Localized r E) ∈ M.sets := by - let params := extend (s.subset E) (extend s.carrier (extend s.conditionOrder (extend (s.encode r) Fin.elim0))) - have members : ∀ i, params i ∈ M.sets := Fin.cases hE (Fin.cases carrier - (Fin.cases order (Fin.cases (M.transitive carrier (s.encode_mem r)) (fun i => Fin.elim0 i)))) - have selected := M.bounded_separation_mem separation BoundedFormula.localizedWitnessFormula params members carrier - have correct (q : P) : BoundedFormula.Truth BoundedFormula.localizedWitnessFormula - (extend (s.encode q) params) ↔ q ∈ Localized r E := by - simp only [BoundedFormula.localizedWitnessFormula, BoundedFormula.truth_disj, BoundedFormula.Truth, - BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] - change (s.encode q ∈ s.subset E ∨ ¬ ∃ z ∈ s.carrier, - ZFSet.pair z (s.encode q) ∈ s.conditionOrder ∧ - ZFSet.pair z (s.encode r) ∈ s.conditionOrder) ↔ _ - erw [s.encode_mem_subset] - have compat : (∃ z ∈ s.carrier, ZFSet.pair z (s.encode q) ∈ s.conditionOrder ∧ - ZFSet.pair z (s.encode r) ∈ s.conditionOrder) ↔ Compatible q r := by - constructor - · rintro ⟨z,hz,hq,hr⟩ - obtain ⟨z,rfl⟩ := (s.mem_carrier z).1 hz - exact ⟨z,(s.pair_mem_conditionOrder _ _).1 hq,(s.pair_mem_conditionOrder _ _).1 hr⟩ - · rintro ⟨z,hq,hr⟩ - exact ⟨s.encode z,s.encode_mem z,(s.pair_mem_conditionOrder _ _).2 hq, - (s.pair_mem_conditionOrder _ _).2 hr⟩ - rw [compat] - rfl - have eq : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.localizedWitnessFormula - (extend z params)) s.carrier = s.subset (Localized r E) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz,rel⟩ - obtain ⟨q,rfl⟩ := (s.mem_carrier z).1 hz - exact (s.encode_mem_subset _ q).2 ((correct q).1 rel) - · intro hz - obtain ⟨q,hq,rfl⟩ := (s.mem_subset _ z).1 hz - exact ⟨s.encode_mem q,(correct q).2 hq⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -include pairing unions powers separation carrier order - -theorem ordinary_generic_meets_coded_denseBelow (H : ConditionFilter P) - (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) - {base : P} (member : H.mem base) {E : Set P} - (ground : s.subset E ∈ M.sets) (dense : DenseBelow base E) : H.Meets E := by - have localized := M.localized_mem s separation carrier order ground base - obtain ⟨q, hq, good | bad⟩ := M.ordinary_generic_meets_coded_dense s pairing unions powers - separation H ordinary localized (localized_dense dense) - · exact ⟨q, hq, good⟩ - · exact False.elim (bad (H.compatible hq member)) - -theorem ordinary_generic_candidate_witness (collection : CollectionSchema M.sets) - {n : Nat} (phi : SetFormula (n + 1)) (env : Assignment (M.nameDomain s) n) - (W : ZFSet.{u}) (ground : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) - (H : ConditionFilter P) (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) - {base : P} (member : H.mem base) - (dense : DenseBelow base {q | ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ - Forces (M.nameDomain s) phi (extend tau env) q}) : - ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ - ∃ q, H.mem q ∧ Forces (M.nameDomain s) phi (extend tau env) q := by - have code := M.candidateForcingSet_mem s pairing unions powers separation collection carrier order - phi env W ground valid - obtain ⟨q, hq, tau, candidate, forced⟩ := - M.ordinary_generic_meets_coded_denseBelow s pairing unions powers separation carrier order - H ordinary member code dense - exact ⟨tau, candidate, q, hq, forced⟩ - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -private def rectangleOrderFormula : BoundedFormula 15 := - .conj (BoundedFormula.tripleMembershipFormula 3 5 1 13) - (.conj (BoundedFormula.tripleMembershipFormula 2 5 0 13) - (.conj (BoundedFormula.pairMembershipFormula 4 1 11) - (BoundedFormula.pairMembershipFormula 4 0 11))) - -private def rectangleBodyFormula : SetFormula 15 := - .conj rectangleOrderFormula.toFormula - (.conj (atomicApplication codedNameActionFormula (extend 10 (extend 14 Fin.elim0)) 3 6 8) - (.conj (atomicApplication codedNameActionFormula (extend 10 (extend 14 Fin.elim0)) 2 6 9) - (ex (.conj - (atomicApplication codedNameActionFormula (extend 11 (extend 15 Fin.elim0)) 4 8 0) - (atomicApplication codedNameActionFormula (extend 11 (extend 15 Fin.elim0)) 3 8 0))))) - -def rectangleWitnessFormula : SetFormula 11 := - exConditions 8 (exConditions 9 (exConditions 8 (exConditions 9 rectangleBodyFormula))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -include pairing unions powers separation collection carrier order group action maps - -omit order action in -private theorem coded_action (g : G) (x : Name s) (hx : x.val ∈ M.sets) - (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets codedNameActionFormula (extend (t.encode g) (extend x.val (extend z - (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ - z = (a.act s g x).val := by - rw [M.realize_codedNameActionFormula a s t pairing unions powers separation collection - carrier group maps g x.val z hx hz] - constructor - · rintro ⟨y, eq, out⟩ - have same : y.val = x := Subtype.ext eq - simpa only [same] using out - · intro eq - exact ⟨⟨x, hx⟩, rfl, eq⟩ - -private noncomputable def rectangleParameters (p : P) (x y : Name s) (g₁ g₂ : G) : Fin 10 → ZFSet.{u} := - extend (s.encode p) (extend x.val (extend y.val (extend (a.act s g₁ x).val - (extend (a.act s g₂ x).val (extend s.carrier (extend s.conditionOrder - (extend t.carrier (extend (a.actionGraph s t) (extend (a.conditionMapFamily s t) Fin.elim0))))))))) - -theorem realize_rectangleWitnessFormula (p : P) (x y : Name s) - (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) (g₁ g₂ : G) (q : P) : - Realize M.sets rectangleWitnessFormula - (extend (s.encode q) (rectangleParameters a s t p x y g₁ g₂)) ↔ - q ∈ a.RectangleWitness s p x y g₁ g₂ := by - have cp (r : P) := M.transitive carrier (s.encode_mem r) - have cg (g : G) := M.transitive group (t.encode_mem g) - have ax (g : G) := M.act_mem s a t pairing unions powers separation collection carrier maps g x hx - rw [rectangleWitnessFormula, M.realize_exConditions t 8 _ _ group rfl] - apply exists_congr - intro h₁ - rw [M.realize_exConditions t 9 _ _ group rfl] - apply exists_congr - intro h₂ - rw [M.realize_exConditions s 8 _ _ carrier rfl] - change (∃ p₁, Realize M.sets _ _) ↔ _ - have body (p₁ p₂ : P) : - Realize M.sets rectangleBodyFormula (extend (s.encode p₂) (extend (s.encode p₁) - (extend (t.encode h₂) (extend (t.encode h₁) - (extend (s.encode q) (rectangleParameters a s t p x y g₁ g₂)))))) ↔ - a.iso h₁ p = p₁ ∧ a.iso h₂ p = p₂ ∧ q ≤ p₁ ∧ q ≤ p₂ ∧ - a.act s h₁ x = a.act s g₁ x ∧ a.act s h₂ x = a.act s g₂ x ∧ - a.act s h₁ y = a.act s h₂ y := by - let env := extend (s.encode p₂) (extend (s.encode p₁) (extend (t.encode h₂) - (extend (t.encode h₁) (extend (s.encode q) (rectangleParameters a s t p x y g₁ g₂))))) - have members : ∀ i, env i ∈ M.sets := (Fin.cases (cp p₂) (Fin.cases (cp p₁) (Fin.cases (cg h₂) (Fin.cases (cg h₁) (Fin.cases (cp q) (Fin.cases (M.transitive carrier (s.encode_mem p)) (Fin.cases (hx) (Fin.cases (hy) (Fin.cases (ax g₁) (Fin.cases (ax g₂) (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (group) (Fin.cases (action) (Fin.cases (maps) (fun i => Fin.elim0 i)))))))))))))))) - rw [rectangleBodyFormula] - change (Realize M.sets rectangleOrderFormula.toFormula env ∧ _ ∧ _ ∧ _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ members] - simp only [rectangleOrderFormula, BoundedFormula.Truth, - BoundedFormula.truth_tripleMembershipFormula, BoundedFormula.truth_pairMembershipFormula] - change ((ZFSet.pair (ZFSet.pair (t.encode h₁) (s.encode p)) (s.encode p₁) ∈ a.actionGraph s t ∧ - ZFSet.pair (ZFSet.pair (t.encode h₂) (s.encode p)) (s.encode p₂) ∈ a.actionGraph s t ∧ - ZFSet.pair (s.encode q) (s.encode p₁) ∈ s.conditionOrder ∧ - ZFSet.pair (s.encode q) (s.encode p₂) ∈ s.conditionOrder) ∧ _ ∧ _ ∧ _) ↔ _ - rw [a.triple_mem_actionGraph, a.triple_mem_actionGraph, - s.pair_mem_conditionOrder, s.pair_mem_conditionOrder] - simp only [realize_ex] - change ((_ ∧ _ ∧ _ ∧ _) ∧ _ ∧ _ ∧ - (∃ z ∈ M.sets, Realize M.sets _ _ ∧ Realize M.sets _ _)) ↔ _ - simp only [realize_atomicApplication, map_extend, map_empty] - change ((a.iso h₁ p = p₁ ∧ a.iso h₂ p = p₂ ∧ q ≤ p₁ ∧ q ≤ p₂) ∧ - Realize M.sets codedNameActionFormula (extend (t.encode h₁) (extend x.val (extend (a.act s g₁ x).val (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ - Realize M.sets codedNameActionFormula (extend (t.encode h₂) (extend x.val (extend (a.act s g₂ x).val (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ - (∃ z ∈ M.sets, Realize M.sets codedNameActionFormula (extend (t.encode h₁) (extend y.val (extend z (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ - Realize M.sets codedNameActionFormula (extend (t.encode h₂) (extend y.val (extend z (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))))) ↔ _ - rw [M.coded_action a s t pairing unions powers separation collection carrier group maps h₁ x hx _ (ax g₁), - M.coded_action a s t pairing unions powers separation collection carrier group maps h₂ x hx _ (ax g₂)] - have common : (∃ z ∈ M.sets, - Realize M.sets codedNameActionFormula (extend (t.encode h₁) (extend y.val (extend z - (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ - Realize M.sets codedNameActionFormula (extend (t.encode h₂) (extend y.val (extend z - (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔ - a.act s h₁ y = a.act s h₂ y := by - constructor - · rintro ⟨z, hz, first, second⟩ - rw [M.coded_action a s t pairing unions powers separation collection carrier group maps h₁ y hy z hz] at first - rw [M.coded_action a s t pairing unions powers separation collection carrier group maps h₂ y hy z hz] at second - exact Subtype.ext (first.symm.trans second) - · intro eq - have hz := M.act_mem s a t pairing unions powers separation collection carrier maps h₁ y hy - refine ⟨(a.act s h₁ y).val, hz, ?_, ?_⟩ - · exact (M.coded_action a s t pairing unions powers separation collection carrier group maps h₁ y hy _ hz).2 rfl - · exact (M.coded_action a s t pairing unions powers separation collection carrier group maps h₂ y hy _ hz).2 (congrArg Subtype.val eq) - rw [common] - constructor - · rintro ⟨⟨e₁,e₂,b₁,b₂⟩,x₁,x₂,yy⟩ - exact ⟨e₁,e₂,b₁,b₂,Subtype.ext x₁.symm,Subtype.ext x₂.symm,yy⟩ - · rintro ⟨e₁,e₂,b₁,b₂,x₁,x₂,yy⟩ - exact ⟨⟨e₁,e₂,b₁,b₂⟩,congrArg Subtype.val x₁.symm,congrArg Subtype.val x₂.symm,yy⟩ - constructor - · rintro ⟨p₁, rest⟩ - obtain ⟨p₂, rest⟩ := (M.realize_exConditions s 9 _ _ carrier rfl).1 rest - obtain ⟨rfl,rfl,b₁,b₂,x₁,x₂,yy⟩ := (body p₁ p₂).1 rest - exact ⟨b₁,b₂,x₁,x₂,yy⟩ - · rintro ⟨b₁,b₂,x₁,x₂,yy⟩ - refine ⟨a.iso h₁ p, (M.realize_exConditions s 9 _ _ carrier rfl).2 ⟨a.iso h₂ p, ?_⟩⟩ - exact (body _ _).2 ⟨rfl,rfl,b₁,b₂,x₁,x₂,yy⟩ - -theorem rectangleWitness_mem (p : P) (x y : Name s) - (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) (g₁ g₂ : G) : - s.subset (a.RectangleWitness s p x y g₁ g₂) ∈ M.sets := by - let params := rectangleParameters a s t p x y g₁ g₂ - have ax (g : G) := M.act_mem s a t pairing unions powers separation collection carrier maps g x hx - have members : ∀ i, params i ∈ M.sets := (Fin.cases (M.transitive carrier (s.encode_mem p)) (Fin.cases (hx) (Fin.cases (hy) (Fin.cases (ax g₁) (Fin.cases (ax g₂) (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (group) (Fin.cases (action) (Fin.cases (maps) (fun i => Fin.elim0 i))))))))))) - have selected := M.separation_mem separation rectangleWitnessFormula params members carrier - have eq : ZFSet.sep (fun z => Realize M.sets rectangleWitnessFormula (extend z params)) s.carrier = - s.subset (a.RectangleWitness s p x y g₁ g₂) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz,rel⟩ - obtain ⟨q,rfl⟩ := (s.mem_carrier z).1 hz - exact (s.encode_mem_subset _ q).2 ((M.realize_rectangleWitnessFormula a s t pairing unions powers separation collection carrier order group action maps p x y hx hy g₁ g₂ q).1 rel) - · intro hz - obtain ⟨q,hq,rfl⟩ := (s.mem_subset _ z).1 hz - exact ⟨s.encode_mem q,(M.realize_rectangleWitnessFormula a s t pairing unions powers separation collection carrier order group action maps p x y hx hy g₁ g₂ q).2 hq⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem copyWitnessFamily_coded - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) - (Sep : G → G → Prop) - (hSep : (t.product t).subset (fun gh => Sep gh.1 gh.2) ∈ M.sets) - (p : P) (x y : Name s) (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) : - a.copyWitnessFamily s K Sep p x y ⊆ M.codedFamily s := by - intro E member - rcases member with ⟨r,g₁,g₂,rfl⟩ | ⟨r,g₁,g₂,rfl⟩ - · exact M.codedFamily_of_code s (M.localized_mem s separation carrier order - (M.rectangleWitness_mem a s t pairing unions powers separation collection - carrier order group action maps p x y hx hy g₁ g₂) r) - · exact M.codedFamily_of_code s (M.localized_mem s separation carrier order - (M.separationWitness_mem a s t separation carrier order group action K hK Sep hSep p g₁ g₂) r) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundMainFinalGeometry -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -theorem internalRow_copyWitnessFamily_coded - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) - (x y : Name c) (_hx : x.val ∈ M.sets) (_hy : y.val ∈ M.sets) - (W d : SetMembers geometry.carrier), - act.copyWitnessFamily c (a.principalFix W) - (fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = W) p x y ⊆ M.codedFamily c := by - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - dsimp only - intro p x y hx hy W d - have coordinateGround := M.rowCoordinate_carrier_mem s columns pairing unions powers separation - geometry.carrier_ground hColumns - have bits := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround bits - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround bits - have actionGraph := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - have maps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation collection - carrier geometry.actors_ground actionGraph - have support := M.supportBasis_fiber_mem b s a.principalFix pairing separation - geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) W - exact M.copyWitnessFamily_coded act c b pairing unions powers separation collection carrier order - geometry.actors_ground actionGraph maps (a.principalFix W) support _ - (geometry.separatedActorPairs_mem pairing unions powers separation d W) p x y hx hy - -theorem internalRow_copyWitness_generic - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) - (x y : Name c) (_hx : x.val ∈ M.sets) (_hy : y.val ∈ M.sets) - (W d : SetMembers geometry.carrier), - ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega))), - H.GenericFor (M.codedFamily c) → H.GenericFor - (act.copyWitnessFamily c (a.principalFix W) - (fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = W) p x y) := by - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - dsimp only - intro p x y hx hy W d H generic E member dense - exact generic E (geometry.internalRow_copyWitnessFamily_coded pairing unions powers separation - collection infinite columns hColumns p x y hx hy W d member) dense - -end PartitionPilot.Forcing.GroundMainFinalGeometry - -end - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem forcesEq_mix_of_copy_refinements - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (small : M.sets.Countable) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) - (Sep : G → G → Prop) - (hSep : (t.product t).subset (fun gh => Sep gh.1 gh.2) ∈ M.sets) - (p : P) (x y : Name s) (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) - (equal : Name.ForcesEq p x y) - (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, - r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → - DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) - (separating : ∀ g₁ ∈ K, ∀ g₂ ∈ K, ∀ r, - r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → - DenseBelow r (a.SeparationWitness K Sep p g₁ g₂)) : - Name.ForcesEq p x (a.mix s K p x) := by - have groundMix := M.mix_mem a s t pairing unions powers separation collection - carrier order group maps K hK p x hx - have witnesses := M.copyWitnessFamily_coded a s t pairing unions powers separation - collection carrier order group action maps K hK Sep hSep p x y hx hy - let env : Assignment (M.nameDomain s) 2 := - extend ⟨x, hx⟩ (extend ⟨a.mix s K p x, groundMix⟩ Fin.elim0) - change Forces (M.nameDomain s) (.equal 0 1) env p - apply (M.ordinaryForces_iff_all_joint_generics s small carrier (.equal 0 1) env p).2 - intro H active coded ordinary - change Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} (a.mix s K p x) - have copies : H.GenericFor (a.copyWitnessFamily s K Sep p x y) := - fun E hE => coded E (witnesses hE) - have atomic : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := - fun E hE => ordinary E (Or.inl hE) - have translated : ∀ g, H.mem (a.iso g p) → - Name.eval {q | H.mem q} (a.act s g x) = - Name.eval {q | H.mem q} (a.act s g y) := by - intro g member - exact Name.forcesEq_sound (M.nameDomain s) H atomic _ - (M.act_mem s a t pairing unions powers separation collection carrier maps g x hx) _ - (M.act_mem s a t pairing unions powers separation collection carrier maps g y hy) - _ member (a.forcesEq_act s g equal) - exact (a.mix_capture_from_refinements s K Sep p x y H copies active translated - rectangles separating).symm - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem structural_mixture_forcing - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - ∀ (p : SetMembers upperQ) (sourceRow : SetMembers c.carrier) (A : ZFSet.{u}) - (V W : SetMembers geometry.carrier) (x y : Name upper), - SetMembers.raw p = ZFSet.pair (c.encode sourceRow) A → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → - x.val ∈ M.sets → y.val ∈ M.sets → - a.principalFix V ≤ upperAct.stabilizer upper x → - a.principalFix W ≤ upperAct.stabilizer upper y → - Name.ForcesEq p x y → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - Name.ForcesEq p x - (upperAct.mix upper (a.principalFix (geometry.meet.smallMeet V W)) p x) := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - intro p sourceRow A V W x y pCode prepared hx hy sx sy equal descent - obtain ⟨dBound, vd, wd, usedD, dataD⟩ := fulfilled.structural_bounds_with - collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - p sourceRow A V W pCode - have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers - separation carrier hLifted hs hPacked omega - have hOrder : upper.conditionOrder ∈ M.sets := by - rw [M.refinementHistoryDecodedOrder_eq] - exact M.refinementHistoryOrder_mem pairing unions powers separation carrier forcingOrder - hLifted hs hPacked omega - have hAssignments := (M.definable_structuralAssignments pairing unions powers separation collection).closed - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hAssignmentAction := M.structuralAssignmentActionGraph_mem pairing unions powers separation - collection hG hL order graph supports hLifted hSquared hs hh - have hGraph : upperAct.actionGraph upper b ∈ M.sets := by - erw [M.semanticStructuralAction_graph] - exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection hG hQ - carrier (M.union_mem unions (M.union_mem unions hQ)) hAssignments forcingAction hAssignmentAction - have maps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b pairing unions powers separation - collection hQ hG hGraph - let B := geometry.meet.smallMeet V W - have hK := M.supportBasis_fiber_mem b s a.principalFix pairing separation hG hL supports B - have hSep := geometry.separatedActorPairs_mem pairing unions powers separation dBound B - apply M.forcesEq_mix_of_copy_refinements upperAct upper b pairing unions powers separation - collection small hQ hOrder hG hGraph maps (a.principalFix B) hK - (fun g h => geometry.meet.smallMeet (a.iso g dBound) (a.iso h dBound) = B) - hSep p x y hx hy equal - · intro g1 fixed1 g2 fixed2 separated r ref1 ref2 - exact fulfilled.structural_rectangle_refinement - collection infinite choice small columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - p sourceRow A dBound V W x y pCode prepared usedD dataD vd wd sx sy descent - g1 g2 fixed1 fixed2 separated r ref1 ref2 - · intro g1 fixed1 g2 fixed2 r ref1 _ref2 - exact fulfilled.structural_separation_refinement - collection infinite choice small columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - p sourceRow A B dBound pCode prepared usedD dataD - (le_trans (geometry.meet.toSmallMeetOrder.meet_le_left V W) vd) descent - g1 g2 fixed1 fixed2 r ref1 - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_dense_mixture_equalities - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - ∀ (p0 : SetMembers upperQ) (V W : SetMembers geometry.carrier) (x y : Name upper), - x.val ∈ M.sets → y.val ∈ M.sets → - a.principalFix V ≤ upperAct.stabilizer upper x → - a.principalFix W ≤ upperAct.stabilizer upper y → - Name.ForcesEq p0 x y → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - DenseBelow p0 {p | Name.ForcesEq p x - (upperAct.mix upper (a.principalFix (geometry.meet.smallMeet V W)) p x)} := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - intro p0 V W x y groundX groundY supportX supportY equal descent q below0 - have rowClosed := M.countable_function_internally_closed pairing unions powers separation - infinite choice coordinates two - obtain ⟨rawP, memberP, pq, prepared⟩ := fulfilled.exists_groundStoredPreparedStrengthening c - collection infinite choice small smallD irreflexive rowClosed act lifted squared (c.encode ⊤) - carrier forcingOrder forcingAction hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history hs hh stagesOrdinal trace descent (SetMembers.raw q) (SetMembers.raw_mem q) - let p : SetMembers upperQ := SetMembers.ofMem rawP memberP - have pRaw : SetMembers.raw p = rawP := SetMembers.raw_ofMem _ _ - have below : p ≤ q := by - change ZFSet.pair (SetMembers.raw p) (SetMembers.raw q) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed - rw [pRaw] - exact pq - have preparedP : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier - (SetMembers.raw p) := by - rw [pRaw] - exact prepared - obtain ⟨sourceRow, A, _, pCode⟩ := exists_presentedRowAssignmentCoordinates c - (M.refinementHistoryForcing_shape c.carrier lifted stages packed) (SetMembers.raw_mem p) - refine ⟨p, below, ?_⟩ - exact fulfilled.toFinalFulfillment.structural_mixture_forcing - collection infinite choice small columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - p sourceRow A V W x y pCode preparedP groundX groundY supportX supportY - (Name.forcesEq_mono equal (le_trans below below0)) descent - - - - - - -theorem structural_common_support - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - ∀ (H : ConditionFilter (SetMembers upperQ)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain upper))) - (V W : SetMembers geometry.carrier) (x y : Name upper), - x.val ∈ M.sets → y.val ∈ M.sets → - a.principalFix V ≤ upperAct.stabilizer upper x → - a.principalFix W ≤ upperAct.stabilizer upper y → - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) x → - Name.eval {p | H.mem p} x = Name.eval {p | H.mem p} y → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - ∃ z : Name upper, z.val ∈ M.sets ∧ - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) z ∧ - a.principalFix (geometry.meet.smallMeet V W) ≤ upperAct.stabilizer upper z ∧ - Name.nameRank z ≤ Name.nameRank x ∧ - Name.eval {p | H.mem p} z = Name.eval {p | H.mem p} x := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - intro H genericFormula V W x y groundX groundY supportX supportY symmetric values descent - have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let historyTop := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - recursive.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - have upperCarrier : upper.carrier ∈ M.sets := - M.refinementHistoryForcing_mem pairing unions powers separation carrier hLifted hs hPacked omega - have upperOrder : upper.conditionOrder ∈ M.sets := by - rw [M.refinementHistoryDecodedOrder_eq] - exact M.refinementHistoryOrder_mem pairing unions powers separation carrier forcingOrder - hLifted hs hPacked omega - have upperGraph : upperAct.actionGraph upper b ∈ M.sets := by - erw [M.semanticStructuralAction_graph] - exact M.structuralForcingActionGraph_mem pairing unions powers separation collection - carrier forcingAction hG hL order graph supports hLifted hSquared hs hh omega - have upperMaps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b - pairing unions powers separation collection upperCarrier hG upperGraph - have atoms : H.GenericFor (Name.atomicFamily (M.nameDomain upper)) := - fun E member => genericFormula E (Or.inl member) - obtain ⟨p0, active, equal⟩ := - (Name.eval_eq_iff_forcesEq (M.nameDomain upper) H atoms groundX groundY).1 values - have dense := fulfilled.structural_dense_mixture_equalities collection infinite choice small - smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 - closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - p0 V W x y groundX groundY supportX supportY equal descent - obtain ⟨z, _candidate, groundZ, hsZ, supportZ, rankZ, valueZ⟩ := - M.exists_mixtureCandidate_of_dense upperAct upper b s a.principalFix - pairing unions powers separation collection upperCarrier upperOrder hG hL supports upperMaps - (a.principalSupportFamily ⊥ directed) (geometry.meet.smallMeet V W) - ⟨geometry.meet.smallMeet V W, le_rfl⟩ x groundX symmetric p0 dense H genericFormula active - exact ⟨z, groundZ, hsZ, supportZ, rankZ, valueZ⟩ - - - - - - -theorem structural_common_support_all_stages - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - ∀ (H : ConditionFilter (SetMembers upperQ)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain upper))) - (V W : SetMembers geometry.carrier) (x y : Name upper), - x.val ∈ M.sets → y.val ∈ M.sets → - a.principalFix V ≤ upperAct.stabilizer upper x → - a.principalFix W ≤ upperAct.stabilizer upper y → - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) x → - Name.eval {p | H.mem p} x = Name.eval {p | H.mem p} y → - ∃ z : Name upper, z.val ∈ M.sets ∧ - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) z ∧ - a.principalFix (geometry.meet.smallMeet V W) ≤ upperAct.stabilizer upper z ∧ - Name.nameRank z ≤ Name.nameRank x ∧ - Name.eval {p | H.mem p} z = Name.eval {p | H.mem p} x := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages - induction stages using ZFSet.inductionOn with - | h stages ih => - intro history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - intro H genericFormula V W x y groundX groundY supportX supportY symmetric values - apply fulfilled.structural_common_support collection infinite choice small smallD irreflexive - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace - H genericFormula V W x y groundX groundY supportX supportY symmetric values - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let Property : ∀ (Q : ZFSet.{u}) (orderQ : PartialOrder (SetMembers Q)), - @PosetAction (SetMembers geometry.actors) _ (SetMembers Q) orderQ → Prop := - fun Q orderQ actionQ => - letI := orderQ - let presentation := SetMembers.presentation Q - ∀ (filter : ConditionFilter (SetMembers Q)), - filter.GenericFor (formulaFamily (M.nameDomain presentation)) → - ∀ (v w : SetMembers geometry.carrier) (first second : Name presentation), - first.val ∈ M.sets → second.val ∈ M.sets → - a.principalFix v ≤ actionQ.stabilizer presentation first → - a.principalFix w ≤ actionQ.stabilizer presentation second → - HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) first → - Name.eval {q | filter.mem q} first = Name.eval {q | filter.mem q} second → - ∃ z : Name presentation, z.val ∈ M.sets ∧ - HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) z ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ actionQ.stabilizer presentation z ∧ - Name.nameRank z ≤ Name.nameRank first ∧ - Name.eval {q | filter.mem q} z = Name.eval {q | filter.mem q} first - have earlier := ih alpha member (graphRestriction alpha history) hAlpha - (M.graphRestriction_mem unions separation hAlpha hh) cutOrdinal - (trace.restrict cutOrdinal subset) - have transferred := (M.semanticStructuralPrefixAction_restricted_property c act b s a ⊥ - directed lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared - omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hh trace hAlpha cutOrdinal subset Property).1 earlier - dsimp only - intro lowerH _coded ordinary v w first second firstSupport secondSupport firstHS _secondHS equal - obtain ⟨z, groundZ, symmetricZ, supportZ, _rankZ, valueZ⟩ := transferred lowerH ordinary - v w first.val second.val first.property second.property firstSupport secondSupport firstHS equal - exact ⟨⟨z, groundZ⟩, symmetricZ, supportZ, valueZ⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticRepresentedDomainEasyCases +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStoredPreparedDensity +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralSeparationRefinements + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula + +private def separationWitnessBody : BoundedFormula 12 := + .conj (.mem 1 6) (.conj (tripleMembershipFormula 1 3 0 10) + (.conj (pairMembershipFormula 2 0 11) + (.conj (pairMembershipFormula 1 4 7) (pairMembershipFormula 1 5 7)))) + +def separationWitnessFormula : BoundedFormula 10 := + exMem 7 (exMem 7 separationWitnessBody) + +def localizedWitnessFormula : BoundedFormula 5 := + .disj (.mem 0 1) (.neg (exMem 2 + (.conj (pairMembershipFormula 0 1 4) (pairMembershipFormula 0 5 4)))) + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem separationWitness_mem (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) + (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) + (Sep : G → G → Prop) + (hSep : (t.product t).subset (fun gh => Sep gh.1 gh.2) ∈ M.sets) + (p : P) (g₁ g₂ : G) : s.subset (a.SeparationWitness K Sep p g₁ g₂) ∈ M.sets := by + let params := extend (s.encode p) (extend (t.encode g₁) (extend (t.encode g₂) + (extend (t.subset (fun g => g ∈ K)) (extend ((t.product t).subset (fun gh => Sep gh.1 gh.2)) + (extend s.carrier (extend t.carrier (extend (a.actionGraph s t) + (extend s.conditionOrder Fin.elim0)))))))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases (M.transitive carrier (s.encode_mem p)) + (Fin.cases (M.transitive group (t.encode_mem g₁)) + (Fin.cases (M.transitive group (t.encode_mem g₂)) + (Fin.cases hK (Fin.cases hSep (Fin.cases carrier + (Fin.cases group (Fin.cases action (Fin.cases order (fun i => Fin.elim0 i))))))))) + have selected := M.bounded_separation_mem separation BoundedFormula.separationWitnessFormula params members carrier + have correct (q : P) : BoundedFormula.Truth BoundedFormula.separationWitnessFormula + (extend (s.encode q) params) ↔ q ∈ a.SeparationWitness K Sep p g₁ g₂ := by + simp only [BoundedFormula.separationWitnessFormula, BoundedFormula.separationWitnessBody, + BoundedFormula.truth_exMem, BoundedFormula.Truth, + BoundedFormula.truth_tripleMembershipFormula, BoundedFormula.truth_pairMembershipFormula] + change (∃ h ∈ t.carrier, ∃ p' ∈ s.carrier, + h ∈ t.subset (fun g => g ∈ K) ∧ ZFSet.pair (ZFSet.pair h (s.encode p)) p' ∈ a.actionGraph s t ∧ + ZFSet.pair (s.encode q) p' ∈ s.conditionOrder ∧ + ZFSet.pair h (t.encode g₁) ∈ (t.product t).subset (fun gh => Sep gh.1 gh.2) ∧ + ZFSet.pair h (t.encode g₂) ∈ (t.product t).subset (fun gh => Sep gh.1 gh.2)) ↔ _ + have sep (g h : G) : ZFSet.pair (t.encode g) (t.encode h) ∈ + (t.product t).subset (fun gh => Sep gh.1 gh.2) ↔ Sep g h := + (t.product t).encode_mem_subset _ (g,h) + constructor + · rintro ⟨h,hh,p',hp',fixed,acted,lower,first,second⟩ + obtain ⟨h,rfl⟩ := (t.mem_carrier h).1 hh + obtain ⟨p',rfl⟩ := (s.mem_carrier p').1 hp' + rw [a.triple_mem_actionGraph] at acted + exact ⟨h,(t.encode_mem_subset _ h).1 fixed, + acted ▸ (s.pair_mem_conditionOrder _ _).1 lower,(sep h g₁).1 first,(sep h g₂).1 second⟩ + · rintro ⟨h,fixed,lower,first,second⟩ + exact ⟨t.encode h,t.encode_mem h,s.encode (a.iso h p),s.encode_mem _, + (t.encode_mem_subset _ h).2 fixed,(a.triple_mem_actionGraph s t h p _).2 rfl, + (s.pair_mem_conditionOrder _ _).2 lower,(sep h g₁).2 first,(sep h g₂).2 second⟩ + have eq : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.separationWitnessFormula + (extend z params)) s.carrier = s.subset (a.SeparationWitness K Sep p g₁ g₂) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz,rel⟩ + obtain ⟨q,rfl⟩ := (s.mem_carrier z).1 hz + exact (s.encode_mem_subset _ q).2 ((correct q).1 rel) + · intro hz + obtain ⟨q,hq,rfl⟩ := (s.mem_subset _ z).1 hz + exact ⟨s.encode_mem q,(correct q).2 hq⟩ + exact eq ▸ selected + +omit a t in +theorem localized_mem (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {E : Set P} (hE : s.subset E ∈ M.sets) (r : P) : s.subset (Localized r E) ∈ M.sets := by + let params := extend (s.subset E) (extend s.carrier (extend s.conditionOrder (extend (s.encode r) Fin.elim0))) + have members : ∀ i, params i ∈ M.sets := Fin.cases hE (Fin.cases carrier + (Fin.cases order (Fin.cases (M.transitive carrier (s.encode_mem r)) (fun i => Fin.elim0 i)))) + have selected := M.bounded_separation_mem separation BoundedFormula.localizedWitnessFormula params members carrier + have correct (q : P) : BoundedFormula.Truth BoundedFormula.localizedWitnessFormula + (extend (s.encode q) params) ↔ q ∈ Localized r E := by + simp only [BoundedFormula.localizedWitnessFormula, BoundedFormula.truth_disj, BoundedFormula.Truth, + BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] + change (s.encode q ∈ s.subset E ∨ ¬ ∃ z ∈ s.carrier, + ZFSet.pair z (s.encode q) ∈ s.conditionOrder ∧ + ZFSet.pair z (s.encode r) ∈ s.conditionOrder) ↔ _ + erw [s.encode_mem_subset] + have compat : (∃ z ∈ s.carrier, ZFSet.pair z (s.encode q) ∈ s.conditionOrder ∧ + ZFSet.pair z (s.encode r) ∈ s.conditionOrder) ↔ Compatible q r := by + constructor + · rintro ⟨z,hz,hq,hr⟩ + obtain ⟨z,rfl⟩ := (s.mem_carrier z).1 hz + exact ⟨z,(s.pair_mem_conditionOrder _ _).1 hq,(s.pair_mem_conditionOrder _ _).1 hr⟩ + · rintro ⟨z,hq,hr⟩ + exact ⟨s.encode z,s.encode_mem z,(s.pair_mem_conditionOrder _ _).2 hq, + (s.pair_mem_conditionOrder _ _).2 hr⟩ + rw [compat] + rfl + have eq : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.localizedWitnessFormula + (extend z params)) s.carrier = s.subset (Localized r E) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz,rel⟩ + obtain ⟨q,rfl⟩ := (s.mem_carrier z).1 hz + exact (s.encode_mem_subset _ q).2 ((correct q).1 rel) + · intro hz + obtain ⟨q,hq,rfl⟩ := (s.mem_subset _ z).1 hz + exact ⟨s.encode_mem q,(correct q).2 hq⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +include pairing unions powers separation carrier order + +theorem ordinary_generic_meets_coded_denseBelow (H : ConditionFilter P) + (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) + {base : P} (member : H.mem base) {E : Set P} + (ground : s.subset E ∈ M.sets) (dense : DenseBelow base E) : H.Meets E := by + have localized := M.localized_mem s separation carrier order ground base + obtain ⟨q, hq, good | bad⟩ := M.ordinary_generic_meets_coded_dense s pairing unions powers + separation H ordinary localized (localized_dense dense) + · exact ⟨q, hq, good⟩ + · exact False.elim (bad (H.compatible hq member)) + +theorem ordinary_generic_candidate_witness (collection : CollectionSchema M.sets) + {n : Nat} (phi : SetFormula (n + 1)) (env : Assignment (M.nameDomain s) n) + (W : ZFSet.{u}) (ground : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) + (H : ConditionFilter P) (ordinary : H.GenericFor (formulaFamily (M.nameDomain s))) + {base : P} (member : H.mem base) + (dense : DenseBelow base {q | ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ + Forces (M.nameDomain s) phi (extend tau env) q}) : + ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ + ∃ q, H.mem q ∧ Forces (M.nameDomain s) phi (extend tau env) q := by + have code := M.candidateForcingSet_mem s pairing unions powers separation collection carrier order + phi env W ground valid + obtain ⟨q, hq, tau, candidate, forced⟩ := + M.ordinary_generic_meets_coded_denseBelow s pairing unions powers separation carrier order + H ordinary member code dense + exact ⟨tau, candidate, q, hq, forced⟩ + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +private def rectangleOrderFormula : BoundedFormula 15 := + .conj (BoundedFormula.tripleMembershipFormula 3 5 1 13) + (.conj (BoundedFormula.tripleMembershipFormula 2 5 0 13) + (.conj (BoundedFormula.pairMembershipFormula 4 1 11) + (BoundedFormula.pairMembershipFormula 4 0 11))) + +private def rectangleBodyFormula : SetFormula 15 := + .conj rectangleOrderFormula.toFormula + (.conj (atomicApplication codedNameActionFormula (extend 10 (extend 14 Fin.elim0)) 3 6 8) + (.conj (atomicApplication codedNameActionFormula (extend 10 (extend 14 Fin.elim0)) 2 6 9) + (ex (.conj + (atomicApplication codedNameActionFormula (extend 11 (extend 15 Fin.elim0)) 4 8 0) + (atomicApplication codedNameActionFormula (extend 11 (extend 15 Fin.elim0)) 3 8 0))))) + +def rectangleWitnessFormula : SetFormula 11 := + exConditions 8 (exConditions 9 (exConditions 8 (exConditions 9 rectangleBodyFormula))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +include pairing unions powers separation collection carrier order group action maps + +omit order action in +private theorem coded_action (g : G) (x : Name s) (hx : x.val ∈ M.sets) + (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets codedNameActionFormula (extend (t.encode g) (extend x.val (extend z + (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ + z = (a.act s g x).val := by + rw [M.realize_codedNameActionFormula a s t pairing unions powers separation collection + carrier group maps g x.val z hx hz] + constructor + · rintro ⟨y, eq, out⟩ + have same : y.val = x := Subtype.ext eq + simpa only [same] using out + · intro eq + exact ⟨⟨x, hx⟩, rfl, eq⟩ + +private noncomputable def rectangleParameters (p : P) (x y : Name s) (g₁ g₂ : G) : Fin 10 → ZFSet.{u} := + extend (s.encode p) (extend x.val (extend y.val (extend (a.act s g₁ x).val + (extend (a.act s g₂ x).val (extend s.carrier (extend s.conditionOrder + (extend t.carrier (extend (a.actionGraph s t) (extend (a.conditionMapFamily s t) Fin.elim0))))))))) + +theorem realize_rectangleWitnessFormula (p : P) (x y : Name s) + (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) (g₁ g₂ : G) (q : P) : + Realize M.sets rectangleWitnessFormula + (extend (s.encode q) (rectangleParameters a s t p x y g₁ g₂)) ↔ + q ∈ a.RectangleWitness s p x y g₁ g₂ := by + have cp (r : P) := M.transitive carrier (s.encode_mem r) + have cg (g : G) := M.transitive group (t.encode_mem g) + have ax (g : G) := M.act_mem s a t pairing unions powers separation collection carrier maps g x hx + rw [rectangleWitnessFormula, M.realize_exConditions t 8 _ _ group rfl] + apply exists_congr + intro h₁ + rw [M.realize_exConditions t 9 _ _ group rfl] + apply exists_congr + intro h₂ + rw [M.realize_exConditions s 8 _ _ carrier rfl] + change (∃ p₁, Realize M.sets _ _) ↔ _ + have body (p₁ p₂ : P) : + Realize M.sets rectangleBodyFormula (extend (s.encode p₂) (extend (s.encode p₁) + (extend (t.encode h₂) (extend (t.encode h₁) + (extend (s.encode q) (rectangleParameters a s t p x y g₁ g₂)))))) ↔ + a.iso h₁ p = p₁ ∧ a.iso h₂ p = p₂ ∧ q ≤ p₁ ∧ q ≤ p₂ ∧ + a.act s h₁ x = a.act s g₁ x ∧ a.act s h₂ x = a.act s g₂ x ∧ + a.act s h₁ y = a.act s h₂ y := by + let env := extend (s.encode p₂) (extend (s.encode p₁) (extend (t.encode h₂) + (extend (t.encode h₁) (extend (s.encode q) (rectangleParameters a s t p x y g₁ g₂))))) + have members : ∀ i, env i ∈ M.sets := (Fin.cases (cp p₂) (Fin.cases (cp p₁) (Fin.cases (cg h₂) (Fin.cases (cg h₁) (Fin.cases (cp q) (Fin.cases (M.transitive carrier (s.encode_mem p)) (Fin.cases (hx) (Fin.cases (hy) (Fin.cases (ax g₁) (Fin.cases (ax g₂) (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (group) (Fin.cases (action) (Fin.cases (maps) (fun i => Fin.elim0 i)))))))))))))))) + rw [rectangleBodyFormula] + change (Realize M.sets rectangleOrderFormula.toFormula env ∧ _ ∧ _ ∧ _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ members] + simp only [rectangleOrderFormula, BoundedFormula.Truth, + BoundedFormula.truth_tripleMembershipFormula, BoundedFormula.truth_pairMembershipFormula] + change ((ZFSet.pair (ZFSet.pair (t.encode h₁) (s.encode p)) (s.encode p₁) ∈ a.actionGraph s t ∧ + ZFSet.pair (ZFSet.pair (t.encode h₂) (s.encode p)) (s.encode p₂) ∈ a.actionGraph s t ∧ + ZFSet.pair (s.encode q) (s.encode p₁) ∈ s.conditionOrder ∧ + ZFSet.pair (s.encode q) (s.encode p₂) ∈ s.conditionOrder) ∧ _ ∧ _ ∧ _) ↔ _ + rw [a.triple_mem_actionGraph, a.triple_mem_actionGraph, + s.pair_mem_conditionOrder, s.pair_mem_conditionOrder] + simp only [realize_ex] + change ((_ ∧ _ ∧ _ ∧ _) ∧ _ ∧ _ ∧ + (∃ z ∈ M.sets, Realize M.sets _ _ ∧ Realize M.sets _ _)) ↔ _ + simp only [realize_atomicApplication, map_extend, map_empty] + change ((a.iso h₁ p = p₁ ∧ a.iso h₂ p = p₂ ∧ q ≤ p₁ ∧ q ≤ p₂) ∧ + Realize M.sets codedNameActionFormula (extend (t.encode h₁) (extend x.val (extend (a.act s g₁ x).val (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ + Realize M.sets codedNameActionFormula (extend (t.encode h₂) (extend x.val (extend (a.act s g₂ x).val (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ + (∃ z ∈ M.sets, Realize M.sets codedNameActionFormula (extend (t.encode h₁) (extend y.val (extend z (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ + Realize M.sets codedNameActionFormula (extend (t.encode h₂) (extend y.val (extend z (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))))) ↔ _ + rw [M.coded_action a s t pairing unions powers separation collection carrier group maps h₁ x hx _ (ax g₁), + M.coded_action a s t pairing unions powers separation collection carrier group maps h₂ x hx _ (ax g₂)] + have common : (∃ z ∈ M.sets, + Realize M.sets codedNameActionFormula (extend (t.encode h₁) (extend y.val (extend z + (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ∧ + Realize M.sets codedNameActionFormula (extend (t.encode h₂) (extend y.val (extend z + (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔ + a.act s h₁ y = a.act s h₂ y := by + constructor + · rintro ⟨z, hz, first, second⟩ + rw [M.coded_action a s t pairing unions powers separation collection carrier group maps h₁ y hy z hz] at first + rw [M.coded_action a s t pairing unions powers separation collection carrier group maps h₂ y hy z hz] at second + exact Subtype.ext (first.symm.trans second) + · intro eq + have hz := M.act_mem s a t pairing unions powers separation collection carrier maps h₁ y hy + refine ⟨(a.act s h₁ y).val, hz, ?_, ?_⟩ + · exact (M.coded_action a s t pairing unions powers separation collection carrier group maps h₁ y hy _ hz).2 rfl + · exact (M.coded_action a s t pairing unions powers separation collection carrier group maps h₂ y hy _ hz).2 (congrArg Subtype.val eq) + rw [common] + constructor + · rintro ⟨⟨e₁,e₂,b₁,b₂⟩,x₁,x₂,yy⟩ + exact ⟨e₁,e₂,b₁,b₂,Subtype.ext x₁.symm,Subtype.ext x₂.symm,yy⟩ + · rintro ⟨e₁,e₂,b₁,b₂,x₁,x₂,yy⟩ + exact ⟨⟨e₁,e₂,b₁,b₂⟩,congrArg Subtype.val x₁.symm,congrArg Subtype.val x₂.symm,yy⟩ + constructor + · rintro ⟨p₁, rest⟩ + obtain ⟨p₂, rest⟩ := (M.realize_exConditions s 9 _ _ carrier rfl).1 rest + obtain ⟨rfl,rfl,b₁,b₂,x₁,x₂,yy⟩ := (body p₁ p₂).1 rest + exact ⟨b₁,b₂,x₁,x₂,yy⟩ + · rintro ⟨b₁,b₂,x₁,x₂,yy⟩ + refine ⟨a.iso h₁ p, (M.realize_exConditions s 9 _ _ carrier rfl).2 ⟨a.iso h₂ p, ?_⟩⟩ + exact (body _ _).2 ⟨rfl,rfl,b₁,b₂,x₁,x₂,yy⟩ + +theorem rectangleWitness_mem (p : P) (x y : Name s) + (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) (g₁ g₂ : G) : + s.subset (a.RectangleWitness s p x y g₁ g₂) ∈ M.sets := by + let params := rectangleParameters a s t p x y g₁ g₂ + have ax (g : G) := M.act_mem s a t pairing unions powers separation collection carrier maps g x hx + have members : ∀ i, params i ∈ M.sets := (Fin.cases (M.transitive carrier (s.encode_mem p)) (Fin.cases (hx) (Fin.cases (hy) (Fin.cases (ax g₁) (Fin.cases (ax g₂) (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (group) (Fin.cases (action) (Fin.cases (maps) (fun i => Fin.elim0 i))))))))))) + have selected := M.separation_mem separation rectangleWitnessFormula params members carrier + have eq : ZFSet.sep (fun z => Realize M.sets rectangleWitnessFormula (extend z params)) s.carrier = + s.subset (a.RectangleWitness s p x y g₁ g₂) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz,rel⟩ + obtain ⟨q,rfl⟩ := (s.mem_carrier z).1 hz + exact (s.encode_mem_subset _ q).2 ((M.realize_rectangleWitnessFormula a s t pairing unions powers separation collection carrier order group action maps p x y hx hy g₁ g₂ q).1 rel) + · intro hz + obtain ⟨q,hq,rfl⟩ := (s.mem_subset _ z).1 hz + exact ⟨s.encode_mem q,(M.realize_rectangleWitnessFormula a s t pairing unions powers separation collection carrier order group action maps p x y hx hy g₁ g₂ q).2 hq⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem copyWitnessFamily_coded + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) + (Sep : G → G → Prop) + (hSep : (t.product t).subset (fun gh => Sep gh.1 gh.2) ∈ M.sets) + (p : P) (x y : Name s) (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) : + a.copyWitnessFamily s K Sep p x y ⊆ M.codedFamily s := by + intro E member + rcases member with ⟨r,g₁,g₂,rfl⟩ | ⟨r,g₁,g₂,rfl⟩ + · exact M.codedFamily_of_code s (M.localized_mem s separation carrier order + (M.rectangleWitness_mem a s t pairing unions powers separation collection + carrier order group action maps p x y hx hy g₁ g₂) r) + · exact M.codedFamily_of_code s (M.localized_mem s separation carrier order + (M.separationWitness_mem a s t separation carrier order group action K hK Sep hSep p g₁ g₂) r) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundMainFinalGeometry +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +theorem internalRow_copyWitnessFamily_coded + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) + (x y : Name c) (_hx : x.val ∈ M.sets) (_hy : y.val ∈ M.sets) + (W d : SetMembers geometry.carrier), + act.copyWitnessFamily c (a.principalFix W) + (fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = W) p x y ⊆ M.codedFamily c := by + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + dsimp only + intro p x y hx hy W d + have coordinateGround := M.rowCoordinate_carrier_mem s columns pairing unions powers separation + geometry.carrier_ground hColumns + have bits := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround bits + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround bits + have actionGraph := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + have maps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation collection + carrier geometry.actors_ground actionGraph + have support := M.supportBasis_fiber_mem b s a.principalFix pairing separation + geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) W + exact M.copyWitnessFamily_coded act c b pairing unions powers separation collection carrier order + geometry.actors_ground actionGraph maps (a.principalFix W) support _ + (geometry.separatedActorPairs_mem pairing unions powers separation d W) p x y hx hy + +theorem internalRow_copyWitness_generic + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) + (x y : Name c) (_hx : x.val ∈ M.sets) (_hy : y.val ∈ M.sets) + (W d : SetMembers geometry.carrier), + ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega))), + H.GenericFor (M.codedFamily c) → H.GenericFor + (act.copyWitnessFamily c (a.principalFix W) + (fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = W) p x y) := by + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + dsimp only + intro p x y hx hy W d H generic E member dense + exact generic E (geometry.internalRow_copyWitnessFamily_coded pairing unions powers separation + collection infinite columns hColumns p x y hx hy W d member) dense + +end PartitionPilot.Forcing.GroundMainFinalGeometry + +end + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem forcesEq_mix_of_copy_refinements + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (small : M.sets.Countable) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (action : a.actionGraph s t ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) + (Sep : G → G → Prop) + (hSep : (t.product t).subset (fun gh => Sep gh.1 gh.2) ∈ M.sets) + (p : P) (x y : Name s) (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) + (equal : Name.ForcesEq p x y) + (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, + r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → + DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) + (separating : ∀ g₁ ∈ K, ∀ g₂ ∈ K, ∀ r, + r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → + DenseBelow r (a.SeparationWitness K Sep p g₁ g₂)) : + Name.ForcesEq p x (a.mix s K p x) := by + have groundMix := M.mix_mem a s t pairing unions powers separation collection + carrier order group maps K hK p x hx + have witnesses := M.copyWitnessFamily_coded a s t pairing unions powers separation + collection carrier order group action maps K hK Sep hSep p x y hx hy + let env : Assignment (M.nameDomain s) 2 := + extend ⟨x, hx⟩ (extend ⟨a.mix s K p x, groundMix⟩ Fin.elim0) + change Forces (M.nameDomain s) (.equal 0 1) env p + apply (M.ordinaryForces_iff_all_joint_generics s small carrier (.equal 0 1) env p).2 + intro H active coded ordinary + change Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} (a.mix s K p x) + have copies : H.GenericFor (a.copyWitnessFamily s K Sep p x y) := + fun E hE => coded E (witnesses hE) + have atomic : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := + fun E hE => ordinary E (Or.inl hE) + have translated : ∀ g, H.mem (a.iso g p) → + Name.eval {q | H.mem q} (a.act s g x) = + Name.eval {q | H.mem q} (a.act s g y) := by + intro g member + exact Name.forcesEq_sound (M.nameDomain s) H atomic _ + (M.act_mem s a t pairing unions powers separation collection carrier maps g x hx) _ + (M.act_mem s a t pairing unions powers separation collection carrier maps g y hy) + _ member (a.forcesEq_act s g equal) + exact (a.mix_capture_from_refinements s K Sep p x y H copies active translated + rectangles separating).symm + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem structural_mixture_forcing + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + ∀ (p : SetMembers upperQ) (sourceRow : SetMembers c.carrier) (A : ZFSet.{u}) + (V W : SetMembers geometry.carrier) (x y : Name upper), + SetMembers.raw p = ZFSet.pair (c.encode sourceRow) A → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → + x.val ∈ M.sets → y.val ∈ M.sets → + a.principalFix V ≤ upperAct.stabilizer upper x → + a.principalFix W ≤ upperAct.stabilizer upper y → + Name.ForcesEq p x y → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + Name.ForcesEq p x + (upperAct.mix upper (a.principalFix (geometry.meet.smallMeet V W)) p x) := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + intro p sourceRow A V W x y pCode prepared hx hy sx sy equal descent + obtain ⟨dBound, vd, wd, usedD, dataD⟩ := fulfilled.structural_bounds_with + collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + p sourceRow A V W pCode + have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers + separation carrier hLifted hs hPacked omega + have hOrder : upper.conditionOrder ∈ M.sets := by + rw [M.refinementHistoryDecodedOrder_eq] + exact M.refinementHistoryOrder_mem pairing unions powers separation carrier forcingOrder + hLifted hs hPacked omega + have hAssignments := (M.definable_structuralAssignments pairing unions powers separation collection).closed + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hAssignmentAction := M.structuralAssignmentActionGraph_mem pairing unions powers separation + collection hG hL order graph supports hLifted hSquared hs hh + have hGraph : upperAct.actionGraph upper b ∈ M.sets := by + erw [M.semanticStructuralAction_graph] + exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection hG hQ + carrier (M.union_mem unions (M.union_mem unions hQ)) hAssignments forcingAction hAssignmentAction + have maps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b pairing unions powers separation + collection hQ hG hGraph + let B := geometry.meet.smallMeet V W + have hK := M.supportBasis_fiber_mem b s a.principalFix pairing separation hG hL supports B + have hSep := geometry.separatedActorPairs_mem pairing unions powers separation dBound B + apply M.forcesEq_mix_of_copy_refinements upperAct upper b pairing unions powers separation + collection small hQ hOrder hG hGraph maps (a.principalFix B) hK + (fun g h => geometry.meet.smallMeet (a.iso g dBound) (a.iso h dBound) = B) + hSep p x y hx hy equal + · intro g1 fixed1 g2 fixed2 separated r ref1 ref2 + exact fulfilled.structural_rectangle_refinement + collection infinite choice small columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + p sourceRow A dBound V W x y pCode prepared usedD dataD vd wd sx sy descent + g1 g2 fixed1 fixed2 separated r ref1 ref2 + · intro g1 fixed1 g2 fixed2 r ref1 _ref2 + exact fulfilled.structural_separation_refinement + collection infinite choice small columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + p sourceRow A B dBound pCode prepared usedD dataD + (le_trans (geometry.meet.toSmallMeetOrder.meet_le_left V W) vd) descent + g1 g2 fixed1 fixed2 r ref1 + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_dense_mixture_equalities + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + ∀ (p0 : SetMembers upperQ) (V W : SetMembers geometry.carrier) (x y : Name upper), + x.val ∈ M.sets → y.val ∈ M.sets → + a.principalFix V ≤ upperAct.stabilizer upper x → + a.principalFix W ≤ upperAct.stabilizer upper y → + Name.ForcesEq p0 x y → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + DenseBelow p0 {p | Name.ForcesEq p x + (upperAct.mix upper (a.principalFix (geometry.meet.smallMeet V W)) p x)} := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + intro p0 V W x y groundX groundY supportX supportY equal descent q below0 + have rowClosed := M.countable_function_internally_closed pairing unions powers separation + infinite choice coordinates two + obtain ⟨rawP, memberP, pq, prepared⟩ := fulfilled.exists_groundStoredPreparedStrengthening c + collection infinite choice small smallD irreflexive rowClosed act lifted squared (c.encode ⊤) + carrier forcingOrder forcingAction hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history hs hh stagesOrdinal trace descent (SetMembers.raw q) (SetMembers.raw_mem q) + let p : SetMembers upperQ := SetMembers.ofMem rawP memberP + have pRaw : SetMembers.raw p = rawP := SetMembers.raw_ofMem _ _ + have below : p ≤ q := by + change ZFSet.pair (SetMembers.raw p) (SetMembers.raw q) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed + rw [pRaw] + exact pq + have preparedP : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier + (SetMembers.raw p) := by + rw [pRaw] + exact prepared + obtain ⟨sourceRow, A, _, pCode⟩ := exists_presentedRowAssignmentCoordinates c + (M.refinementHistoryForcing_shape c.carrier lifted stages packed) (SetMembers.raw_mem p) + refine ⟨p, below, ?_⟩ + exact fulfilled.toFinalFulfillment.structural_mixture_forcing + collection infinite choice small columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + p sourceRow A V W x y pCode preparedP groundX groundY supportX supportY + (Name.forcesEq_mono equal (le_trans below below0)) descent + + + + + + +theorem structural_common_support + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + ∀ (H : ConditionFilter (SetMembers upperQ)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain upper))) + (V W : SetMembers geometry.carrier) (x y : Name upper), + x.val ∈ M.sets → y.val ∈ M.sets → + a.principalFix V ≤ upperAct.stabilizer upper x → + a.principalFix W ≤ upperAct.stabilizer upper y → + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) x → + Name.eval {p | H.mem p} x = Name.eval {p | H.mem p} y → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + ∃ z : Name upper, z.val ∈ M.sets ∧ + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) z ∧ + a.principalFix (geometry.meet.smallMeet V W) ≤ upperAct.stabilizer upper z ∧ + Name.nameRank z ≤ Name.nameRank x ∧ + Name.eval {p | H.mem p} z = Name.eval {p | H.mem p} x := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + intro H genericFormula V W x y groundX groundY supportX supportY symmetric values descent + have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let historyTop := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + recursive.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + have upperCarrier : upper.carrier ∈ M.sets := + M.refinementHistoryForcing_mem pairing unions powers separation carrier hLifted hs hPacked omega + have upperOrder : upper.conditionOrder ∈ M.sets := by + rw [M.refinementHistoryDecodedOrder_eq] + exact M.refinementHistoryOrder_mem pairing unions powers separation carrier forcingOrder + hLifted hs hPacked omega + have upperGraph : upperAct.actionGraph upper b ∈ M.sets := by + erw [M.semanticStructuralAction_graph] + exact M.structuralForcingActionGraph_mem pairing unions powers separation collection + carrier forcingAction hG hL order graph supports hLifted hSquared hs hh omega + have upperMaps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b + pairing unions powers separation collection upperCarrier hG upperGraph + have atoms : H.GenericFor (Name.atomicFamily (M.nameDomain upper)) := + fun E member => genericFormula E (Or.inl member) + obtain ⟨p0, active, equal⟩ := + (Name.eval_eq_iff_forcesEq (M.nameDomain upper) H atoms groundX groundY).1 values + have dense := fulfilled.structural_dense_mixture_equalities collection infinite choice small + smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 + closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + p0 V W x y groundX groundY supportX supportY equal descent + obtain ⟨z, _candidate, groundZ, hsZ, supportZ, rankZ, valueZ⟩ := + M.exists_mixtureCandidate_of_dense upperAct upper b s a.principalFix + pairing unions powers separation collection upperCarrier upperOrder hG hL supports upperMaps + (a.principalSupportFamily ⊥ directed) (geometry.meet.smallMeet V W) + ⟨geometry.meet.smallMeet V W, le_rfl⟩ x groundX symmetric p0 dense H genericFormula active + exact ⟨z, groundZ, hsZ, supportZ, rankZ, valueZ⟩ + + + + + + +theorem structural_common_support_all_stages + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + ∀ (H : ConditionFilter (SetMembers upperQ)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain upper))) + (V W : SetMembers geometry.carrier) (x y : Name upper), + x.val ∈ M.sets → y.val ∈ M.sets → + a.principalFix V ≤ upperAct.stabilizer upper x → + a.principalFix W ≤ upperAct.stabilizer upper y → + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) x → + Name.eval {p | H.mem p} x = Name.eval {p | H.mem p} y → + ∃ z : Name upper, z.val ∈ M.sets ∧ + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) z ∧ + a.principalFix (geometry.meet.smallMeet V W) ≤ upperAct.stabilizer upper z ∧ + Name.nameRank z ≤ Name.nameRank x ∧ + Name.eval {p | H.mem p} z = Name.eval {p | H.mem p} x := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages + induction stages using ZFSet.inductionOn with + | h stages ih => + intro history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + intro H genericFormula V W x y groundX groundY supportX supportY symmetric values + apply fulfilled.structural_common_support collection infinite choice small smallD irreflexive + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace + H genericFormula V W x y groundX groundY supportX supportY symmetric values + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let Property : ∀ (Q : ZFSet.{u}) (orderQ : PartialOrder (SetMembers Q)), + @PosetAction (SetMembers geometry.actors) _ (SetMembers Q) orderQ → Prop := + fun Q orderQ actionQ => + letI := orderQ + let presentation := SetMembers.presentation Q + ∀ (filter : ConditionFilter (SetMembers Q)), + filter.GenericFor (formulaFamily (M.nameDomain presentation)) → + ∀ (v w : SetMembers geometry.carrier) (first second : Name presentation), + first.val ∈ M.sets → second.val ∈ M.sets → + a.principalFix v ≤ actionQ.stabilizer presentation first → + a.principalFix w ≤ actionQ.stabilizer presentation second → + HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) first → + Name.eval {q | filter.mem q} first = Name.eval {q | filter.mem q} second → + ∃ z : Name presentation, z.val ∈ M.sets ∧ + HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) z ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ actionQ.stabilizer presentation z ∧ + Name.nameRank z ≤ Name.nameRank first ∧ + Name.eval {q | filter.mem q} z = Name.eval {q | filter.mem q} first + have earlier := ih alpha member (graphRestriction alpha history) hAlpha + (M.graphRestriction_mem unions separation hAlpha hh) cutOrdinal + (trace.restrict cutOrdinal subset) + have transferred := (M.semanticStructuralPrefixAction_restricted_property c act b s a ⊥ + directed lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared + omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hh trace hAlpha cutOrdinal subset Property).1 earlier + dsimp only + intro lowerH _coded ordinary v w first second firstSupport secondSupport firstHS _secondHS equal + obtain ⟨z, groundZ, symmetricZ, supportZ, _rankZ, valueZ⟩ := transferred lowerH ordinary + v w first.val second.val first.property second.property firstSupport secondSupport firstHS equal + exact ⟨⟨z, groundZ⟩, symmetricZ, supportZ, valueZ⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralDecidingAntichains.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralDecidingAntichains.lean index a7a42c2ed50390e927ac270a4d5cfb0c0eecec53..cc3fc8229dcdc1294f33b42b6a36eff18ba55927 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralDecidingAntichains.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralDecidingAntichains.lean @@ -1,477 +1,477 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralFinalRefinements -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStructuralSizeFamilies - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -open scoped ZFSet -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowSemanticStructuralAntichainHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralSizeFamilyHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have antichains := M.semanticStructuralTrace_antichains_below c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory conditions trace infinite choice rowSize liftedSize - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, antichains, final.2.2.2.2⟩ - - - - - - -theorem exists_rowSemanticStructuralDecidingAntichainHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed - ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → - ∀ tau : (M.nameDomain upperPres).names, - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode Q finalOrder - (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ - let U := ⋃₀ relationImage J (M.groundPower Q) f - (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ - ∃ beta ∈ K, - (∀ row B, ZFSet.pair row B ∈ U → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ - ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ - ∀ sigma A, ZFSet.pair sigma A ∈ f → - let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) - let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta - (graphRestriction beta packed) - A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, - ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralAntichainHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have deciding := M.semanticStructuralTrace_membershipAntichains_prefix c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory conditions trace infinite choice rowSize liftedSize - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, deciding, final.2.2.2.2.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralFinalRefinements +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStructuralSizeFamilies + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +open scoped ZFSet +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowSemanticStructuralAntichainHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralSizeFamilyHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have antichains := M.semanticStructuralTrace_antichains_below c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory conditions trace infinite choice rowSize liftedSize + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, antichains, final.2.2.2.2⟩ + + + + + + +theorem exists_rowSemanticStructuralDecidingAntichainHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed + ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → + ∀ tau : (M.nameDomain upperPres).names, + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode Q finalOrder + (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ + let U := ⋃₀ relationImage J (M.groundPower Q) f + (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ + ∃ beta ∈ K, + (∀ row B, ZFSet.pair row B ∈ U → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ + ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ + ∀ sigma A, ZFSet.pair sigma A ∈ f → + let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) + let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta + (graphRestriction beta packed) + A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, + ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralAntichainHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have deciding := M.semanticStructuralTrace_membershipAntichains_prefix c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory conditions trace infinite choice rowSize liftedSize + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, deciding, final.2.2.2.2.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralPositionSupport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralPositionSupport.lean index 574a6afd8da24850fb014ae92e72ed90e473310d..179ddf5328fef76670d13d530baa304e888de07e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralPositionSupport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralPositionSupport.lean @@ -1,315 +1,315 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryRowRecordedPreparationBounds - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) -variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include order choice countable_bound - -theorem binaryRowStructuralPositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (muOrdinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let J := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph J s.carrier 2 - let Q := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let actual := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace - ∀ (q : SetMembers Q) (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - SetMembers.raw q = ZFSet.pair (c.encode p) A → - ∀ extra ∈ M.sets, extra ⊆ s.carrier → M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, - ZFSet.IsFunc A s.carrier f ∧ - f ⊆ stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ - W = (relationImage A s.carrier f ∪ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ - W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ - (∀ x : L, s.encode x ∈ W → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ x : L, s.encode x ∈ extra → x ≤ D) ∧ - (∀ g ∈ a.principalFix D, actual.iso g q = q) := by - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder - forcingAction omega topMem topRows packed J anchors Q - let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - intro actual q p A code extra hExtra extraSubset extraSmall - have member := code ▸ SetMembers.raw_mem q - have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages packed _).1 member |>.1 - have small := (ZFSet.pair_mem_prod.1 candidate).2 - obtain ⟨D, f, hf, W, hW, function, selected, equal, subset, smallW, bounded, - dataBound, rowBound, extraBound⟩ := - M.binaryRowStructuralDataSelection s C pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu ⊤ valid hLifted b.carrier - (supportBasisCode s b a.principalFix) squared stages history hG supports hSquared hs hh - p A small extra hExtra extraSubset extraSmall - refine ⟨D, f, hf, W, hW, function, selected, equal, subset, smallW, bounded, - dataBound, rowBound, extraBound, ?_⟩ - intro g actor - apply M.semanticStructuralCondition_fixed_of_dataBound c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace S mu s.nonbottom.carrier tuples D - (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) - (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation - infinite hL hC hG graph hmu muOrdinal valid f u D entry bound.2) - g actor q p A code - · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite - hL hC hG graph g p D (fun i used => rowBound i.val used) actor - · exact dataBound - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowSemanticStructuralPositionSupportHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∀ (stages : ZFSet.{u}) (hStages : stages ∈ M.sets) (ordinal : ordinalSetProperty stages), - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted stages - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared stages P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let Q := M.refinementHistoryForcing c.carrier lifted stages packed - let J := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph J s.carrier 2 - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let actual := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrderGround forcingActionGround - geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround - supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hStages hHistory ordinal trace - P = Q ∧ - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}) - (member : ZFSet.pair (c.encode p) A ∈ Q), - let q : SetMembers Q := SetMembers.ofMem (ZFSet.pair (c.encode p) A) member - ∀ extra ∈ M.sets, extra ⊆ s.carrier → M.groundEmbeddable extra ZFSet.omega → - ∃ E : SetMembers geometry.carrier, ∃ f ∈ M.sets, ∃ W ∈ M.sets, - ZFSet.IsFunc A s.carrier f ∧ - f ⊆ stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ - W = (relationImage A s.carrier f ∪ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ - W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ - (∀ x : SetMembers geometry.carrier, s.encode x ∈ W → x ≤ E) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode E) ∈ - stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : SetMembers geometry.carrier, - s.encode x ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → x ≤ E) ∧ - (∀ x : SetMembers geometry.carrier, s.encode x ∈ extra → x ≤ E) ∧ - (∀ g ∈ a.principalFix E, actual.iso g q = q) := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground order action - have countableBound := geometry.decoded_countable_bound - (fun W hW subset small => (fulfilled.countable_localization W hW subset small).2) - have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground action - have original := fulfilled.exists_rowSemanticStructuralFinalHistory collection infinite choice hK standard indices - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := original - obtain ⟨hLifted, hSquared, hGraph, injection, valid1, valid2, - closed1, closed2, children1, children2, histories⟩ := data - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, ?_⟩ - intro stages hStages ordinal - obtain ⟨history, hHistory, trace, hPacked, historyRun, witnesses, - P, stageOrder, top, stageAction, code, fields, witness⟩ := histories stages hStages ordinal - refine ⟨history, hHistory, trace, hPacked, historyRun, witnesses, - P, stageOrder, top, stageAction, code, fields, witness, ?_⟩ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have canonical := M.structuralForcingStage_eq c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history - have equalFields := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 (code.symm.trans canonical) - refine ⟨equalFields.1, ?_⟩ - intro p A member extra hExtra extraSubset extraSmall - exact M.binaryRowStructuralPositionSupport a s b columns pairing unions powers separation collection infinite choice - geometry.carrier_ground order hColumns geometry.actors_ground action nodeMaps supports directed countableBound - hmu cardinal.1 valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hStages hHistory ordinal trace (SetMembers.ofMem (ZFSet.pair (c.encode p) A) member) p A (SetMembers.raw_ofMem _ _) - extra hExtra extraSubset extraSmall - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryRowRecordedPreparationBounds + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) +variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include order choice countable_bound + +theorem binaryRowStructuralPositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (muOrdinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let J := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph J s.carrier 2 + let Q := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let actual := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace + ∀ (q : SetMembers Q) (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + SetMembers.raw q = ZFSet.pair (c.encode p) A → + ∀ extra ∈ M.sets, extra ⊆ s.carrier → M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, + ZFSet.IsFunc A s.carrier f ∧ + f ⊆ stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ + W = (relationImage A s.carrier f ∪ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ + W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ + (∀ x : L, s.encode x ∈ W → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ x : L, s.encode x ∈ extra → x ≤ D) ∧ + (∀ g ∈ a.principalFix D, actual.iso g q = q) := by + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder + forcingAction omega topMem topRows packed J anchors Q + let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + intro actual q p A code extra hExtra extraSubset extraSmall + have member := code ▸ SetMembers.raw_mem q + have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages packed _).1 member |>.1 + have small := (ZFSet.pair_mem_prod.1 candidate).2 + obtain ⟨D, f, hf, W, hW, function, selected, equal, subset, smallW, bounded, + dataBound, rowBound, extraBound⟩ := + M.binaryRowStructuralDataSelection s C pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu ⊤ valid hLifted b.carrier + (supportBasisCode s b a.principalFix) squared stages history hG supports hSquared hs hh + p A small extra hExtra extraSubset extraSmall + refine ⟨D, f, hf, W, hW, function, selected, equal, subset, smallW, bounded, + dataBound, rowBound, extraBound, ?_⟩ + intro g actor + apply M.semanticStructuralCondition_fixed_of_dataBound c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace S mu s.nonbottom.carrier tuples D + (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) + (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation + infinite hL hC hG graph hmu muOrdinal valid f u D entry bound.2) + g actor q p A code + · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite + hL hC hG graph g p D (fun i used => rowBound i.val used) actor + · exact dataBound + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowSemanticStructuralPositionSupportHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∀ (stages : ZFSet.{u}) (hStages : stages ∈ M.sets) (ordinal : ordinalSetProperty stages), + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted stages + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared stages P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let Q := M.refinementHistoryForcing c.carrier lifted stages packed + let J := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph J s.carrier 2 + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let actual := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrderGround forcingActionGround + geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround + supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hStages hHistory ordinal trace + P = Q ∧ + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}) + (member : ZFSet.pair (c.encode p) A ∈ Q), + let q : SetMembers Q := SetMembers.ofMem (ZFSet.pair (c.encode p) A) member + ∀ extra ∈ M.sets, extra ⊆ s.carrier → M.groundEmbeddable extra ZFSet.omega → + ∃ E : SetMembers geometry.carrier, ∃ f ∈ M.sets, ∃ W ∈ M.sets, + ZFSet.IsFunc A s.carrier f ∧ + f ⊆ stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ + W = (relationImage A s.carrier f ∪ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ + W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ + (∀ x : SetMembers geometry.carrier, s.encode x ∈ W → x ≤ E) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode E) ∈ + stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : SetMembers geometry.carrier, + s.encode x ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → x ≤ E) ∧ + (∀ x : SetMembers geometry.carrier, s.encode x ∈ extra → x ≤ E) ∧ + (∀ g ∈ a.principalFix E, actual.iso g q = q) := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground order action + have countableBound := geometry.decoded_countable_bound + (fun W hW subset small => (fulfilled.countable_localization W hW subset small).2) + have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground action + have original := fulfilled.exists_rowSemanticStructuralFinalHistory collection infinite choice hK standard indices + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := original + obtain ⟨hLifted, hSquared, hGraph, injection, valid1, valid2, + closed1, closed2, children1, children2, histories⟩ := data + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, ?_⟩ + intro stages hStages ordinal + obtain ⟨history, hHistory, trace, hPacked, historyRun, witnesses, + P, stageOrder, top, stageAction, code, fields, witness⟩ := histories stages hStages ordinal + refine ⟨history, hHistory, trace, hPacked, historyRun, witnesses, + P, stageOrder, top, stageAction, code, fields, witness, ?_⟩ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have canonical := M.structuralForcingStage_eq c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history + have equalFields := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 (code.symm.trans canonical) + refine ⟨equalFields.1, ?_⟩ + intro p A member extra hExtra extraSubset extraSmall + exact M.binaryRowStructuralPositionSupport a s b columns pairing unions powers separation collection infinite choice + geometry.carrier_ground order hColumns geometry.actors_ground action nodeMaps supports directed countableBound + hmu cardinal.1 valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hStages hHistory ordinal trace (SetMembers.ofMem (ZFSet.pair (c.encode p) A) member) p A (SetMembers.raw_ofMem _ _) + extra hExtra extraSubset extraSmall + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralRefinementNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralRefinementNames.lean index 21a8d0e6bc4932e4c63043837922f0d163635f94..e4eacedf82a6b3673b86d861d0ff530a9793df6f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralRefinementNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralRefinementNames.lean @@ -1,945 +1,945 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralDecidingAntichains - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowSemanticStructuralEarlierPowerNameHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed - ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → - ∀ tau : (M.nameDomain upperPres).names, - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode Q finalOrder - (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ - let U := ⋃₀ relationImage J (M.groundPower Q) f - (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ - ∃ beta ∈ K, - (∀ row B, ZFSet.pair row B ∈ U → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ - ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ - ∀ sigma A, ZFSet.pair sigma A ∈ f → - let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) - let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta - (graphRestriction beta packed) - A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, - ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ - (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} tau.val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} tau.val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralDecidingAntichainHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have earlier := M.semanticStructuralTrace_earlierPowerName c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory standard trace infinite choice rowSize liftedSize - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, earlier, final.2.2.2.2.2.2⟩ - - - - - - -theorem exists_rowSemanticStructuralCommonNameHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed - ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → - ∀ tau : (M.nameDomain upperPres).names, - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode Q finalOrder - (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ - let U := ⋃₀ relationImage J (M.groundPower Q) f - (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ - ∃ beta ∈ K, - (∀ row B, ZFSet.pair row B ∈ U → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ - ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ - ∀ sigma A, ZFSet.pair sigma A ∈ f → - let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) - let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta - (graphRestriction beta packed) - A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, - ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ - (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} tau.val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} tau.val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ - (∀ count (degrees : Fin count → Nat) - (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - ∀ i, - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} (tau i).val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} (tau i).val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralEarlierPowerNameHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have common := M.semanticStructuralTrace_commonEarlierPowerNames c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory standard trace infinite choice rowSize liftedSize - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, common, final.2.2.2.2.2.2.2⟩ - - - - - - -theorem exists_rowSemanticStructuralRefinementNameHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed - ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → - ∀ tau : (M.nameDomain upperPres).names, - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode Q finalOrder - (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ - let U := ⋃₀ relationImage J (M.groundPower Q) f - (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ - ∃ beta ∈ K, - (∀ row B, ZFSet.pair row B ∈ U → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ - ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ - ∀ sigma A, ZFSet.pair sigma A ∈ f → - let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) - let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta - (graphRestriction beta packed) - A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, - ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ - (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} tau.val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} tau.val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ - (∀ count (degrees : Fin count → Nat) - (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - ∀ i, - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} (tau i).val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} (tau i).val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralCommonNameHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have refinements := M.semanticStructuralTrace_finalRefinementNames c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory standard trace infinite choice rowSize liftedSize small - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, refinements, final.2.2.2.2.2.2.2.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralDecidingAntichains + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowSemanticStructuralEarlierPowerNameHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed + ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → + ∀ tau : (M.nameDomain upperPres).names, + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode Q finalOrder + (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ + let U := ⋃₀ relationImage J (M.groundPower Q) f + (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ + ∃ beta ∈ K, + (∀ row B, ZFSet.pair row B ∈ U → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ + ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ + ∀ sigma A, ZFSet.pair sigma A ∈ f → + let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) + let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta + (graphRestriction beta packed) + A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, + ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ + (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} tau.val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} tau.val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralDecidingAntichainHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have earlier := M.semanticStructuralTrace_earlierPowerName c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory standard trace infinite choice rowSize liftedSize + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, earlier, final.2.2.2.2.2.2⟩ + + + + + + +theorem exists_rowSemanticStructuralCommonNameHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed + ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → + ∀ tau : (M.nameDomain upperPres).names, + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode Q finalOrder + (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ + let U := ⋃₀ relationImage J (M.groundPower Q) f + (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ + ∃ beta ∈ K, + (∀ row B, ZFSet.pair row B ∈ U → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ + ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ + ∀ sigma A, ZFSet.pair sigma A ∈ f → + let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) + let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta + (graphRestriction beta packed) + A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, + ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ + (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} tau.val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} tau.val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ + (∀ count (degrees : Fin count → Nat) + (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + ∀ i, + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} (tau i).val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} (tau i).val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralEarlierPowerNameHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have common := M.semanticStructuralTrace_commonEarlierPowerNames c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory standard trace infinite choice rowSize liftedSize + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, common, final.2.2.2.2.2.2.2⟩ + + + + + + +theorem exists_rowSemanticStructuralRefinementNameHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed + ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → + ∀ tau : (M.nameDomain upperPres).names, + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode Q finalOrder + (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ + let U := ⋃₀ relationImage J (M.groundPower Q) f + (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ + ∃ beta ∈ K, + (∀ row B, ZFSet.pair row B ∈ U → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ + ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ + ∀ sigma A, ZFSet.pair sigma A ∈ f → + let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) + let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta + (graphRestriction beta packed) + A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, + ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ + (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} tau.val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} tau.val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ + (∀ count (degrees : Fin count → Nat) + (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + ∀ i, + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} (tau i).val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} (tau i).val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralCommonNameHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have refinements := M.semanticStructuralTrace_finalRefinementNames c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory standard trace infinite choice rowSize liftedSize small + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, refinements, final.2.2.2.2.2.2.2.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralSupportPreparation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralSupportPreparation.lean index 7985ce445f51483e658ef73bb7a4deaec107301b..e438940d87c80519e79cfe53d19b43e0da59faa7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralSupportPreparation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalStructuralSupportPreparation.lean @@ -1,331 +1,331 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticFairPreparationSupportedLimits -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFixedFairPreparationLimitCertificates -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStructuralPrefixDescent - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v - -def GroundSupportPreparedStrengtheningResult (M : TransitiveGround.{u}) - {R : Type u} [PartialOrder R] (c : Presentation R) - (T stages packed nodes p : ZFSet.{u}) : Prop := - let Q := M.refinementHistoryForcing c.carrier T stages packed - ∃ q ∈ Q, - ZFSet.pair q p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed ∧ - ∃ S ∈ M.sets, S ⊆ nodes ∧ M.groundEmbeddable S ZFSet.omega ∧ - StoredSupportPreparedConditionCode M c.carrier T stages packed nodes q S - -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {R : Type u} [PartialOrder R] (c : Presentation R) - -theorem exists_groundSupportPreparedStrengthening - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history), - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) → - H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val - ), - ∀ p ∈ upperQ, GroundSupportPreparedStrengtheningResult M c T stages packed b.carrier p := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history hs hh ordinal trace - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T - intro descent p hp - refine Exists.elim - (fulfilled.exists_groundFairPreparationOrbit c collection infinite choice small smallD irreflexive rowClosed - a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history hs hh ordinal trace descent p hp) - (fun enumSelector enumRest => ?_) - have hEnum := enumRest.1 - have enumFunction := enumRest.2.1 - have enumSelected := enumRest.2.2.1 - refine Exists.elim enumRest.2.2.2 (fun E0 rangeRest => ?_) - have hE0 := rangeRest.1 - have rangeFunction := rangeRest.2.1 - refine Exists.elim rangeRest.2.2 (fun prepSelector prepRest => ?_) - have hPrep := prepRest.1 - have prepFunction := prepRest.2.1 - have prepSelected := prepRest.2.2.1 - refine Exists.elim prepRest.2.2.2 (fun e eRest => ?_) - have he := eRest.1 - have chosen := eRest.2.1 - refine Exists.elim eRest.2.2 (fun orbit orbitRest => ?_) - have hOrbit := orbitRest.1 - have orbitFunction := orbitRest.2.1 - have initial := orbitRest.2.2.1 - have steps := orbitRest.2.2.2 - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let pTyped : SetMembers upperQ := SetMembers.ofMem p hp - have typedChosen : ZFSet.pair (SetMembers.raw pTyped) e ∈ enumSelector := by - simpa only [pTyped, SetMembers.raw_ofMem] using chosen - have typedInitial : ∀ state, ZFSet.pair ∅ state ∈ orbit ↔ - state = ZFSet.pair ∅ (ZFSet.pair (SetMembers.raw pTyped) (ZFSet.pair {ZFSet.pair ∅ e} ∅)) := by - simpa only [pTyped, SetMembers.raw_ofMem] using initial - obtain ⟨seq, start, seqGround, decreasing, clocks, births, events, - clockZero, birthZero, eventZero, entries, eventGround, eventFunction, - supportGround, supportSubset, supportSmall, rawSteps, limit, below, dataEqual, - unionGround, exactEntries, visits⟩ := - M.semanticStructuralFairPreparation_supported_lower_bound c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hs hh ordinal trace infinite choice rowClosed pTyped E0 enumSelector prepSelector orbit e - hE0 hOrbit rangeFunction enumSelected prepSelected typedChosen orbitFunction typedInitial steps - have initialRaw : SetMembers.raw (seq 0) = p := - (congrArg SetMembers.raw start).trans (SetMembers.raw_ofMem p hp) - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - let U := M.preparationWitnessBound b.carrier T upperQ - let E := insert ∅ (ZFSet.prod stages U) - let supportSet := M.preparationUsedSupportUnion b.carrier E (familyCodeGraph natSetCode events) - have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrder - (Fin.cases supports (Fin.cases hT (Fin.cases hT2 (Fin.cases hs - (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hUpper := M.refinementHistoryForcing_mem pairing unions powers separation carrier hT hs hPacked omega - have hU := M.preparationWitnessBound_mem pairing unions powers separation - geometry.carrier_ground hT hUpper omega - have hE := M.insert_mem pairing unions (M.empty_mem ⟨upperQ, hUpper⟩) - (M.prod_mem pairing unions powers separation hs hU) - have environments : ∀ alpha (fields : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → - StoredPreparationEnvironment M fields := by - intro alpha fields stored - have member := historyRun.carriers.data.function.pair_source stored - exact M.semanticStructuralPrefix_preparationEnvironment c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hs hh ordinal trace member fields stored - refine ⟨SetMembers.raw limit, SetMembers.raw_mem limit, initialRaw ▸ below 0, - supportSet, supportGround, supportSubset, supportSmall, ?_⟩ - exact M.fixedFairPreparationLimit_supportPrepared c pairing unions powers separation collection - historyRun environments geometry.carrier_ground hE prepSelected seq events eventFunction - limit below visits - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -open scoped ZFSet -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_support_prepared_strengthening - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) - (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) - (_stagesOrdinal : ordinalSetProperty stages) - (_trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - ∀ p ∈ upperQ, - GroundSupportPreparedStrengtheningResult M c lifted stages packed s.carrier p := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro p member - have descent := fulfilled.structural_prefix_descent - collection infinite choice small smallD irreflexive columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - have rowClosed := M.countable_function_internally_closed pairing unions powers separation - infinite choice coordinates two - exact fulfilled.exists_groundSupportPreparedStrengthening c - collection infinite choice small smallD irreflexive rowClosed act lifted squared (c.encode ⊤) - carrier forcingOrder forcingAction hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history hs hh stagesOrdinal trace descent p member - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticFairPreparationSupportedLimits +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFixedFairPreparationLimitCertificates +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStructuralPrefixDescent + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v + +def GroundSupportPreparedStrengtheningResult (M : TransitiveGround.{u}) + {R : Type u} [PartialOrder R] (c : Presentation R) + (T stages packed nodes p : ZFSet.{u}) : Prop := + let Q := M.refinementHistoryForcing c.carrier T stages packed + ∃ q ∈ Q, + ZFSet.pair q p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed ∧ + ∃ S ∈ M.sets, S ⊆ nodes ∧ M.groundEmbeddable S ZFSet.omega ∧ + StoredSupportPreparedConditionCode M c.carrier T stages packed nodes q S + +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {R : Type u} [PartialOrder R] (c : Presentation R) + +theorem exists_groundSupportPreparedStrengthening + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history), + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) → + H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val + ), + ∀ p ∈ upperQ, GroundSupportPreparedStrengtheningResult M c T stages packed b.carrier p := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history hs hh ordinal trace + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T + intro descent p hp + refine Exists.elim + (fulfilled.exists_groundFairPreparationOrbit c collection infinite choice small smallD irreflexive rowClosed + a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history hs hh ordinal trace descent p hp) + (fun enumSelector enumRest => ?_) + have hEnum := enumRest.1 + have enumFunction := enumRest.2.1 + have enumSelected := enumRest.2.2.1 + refine Exists.elim enumRest.2.2.2 (fun E0 rangeRest => ?_) + have hE0 := rangeRest.1 + have rangeFunction := rangeRest.2.1 + refine Exists.elim rangeRest.2.2 (fun prepSelector prepRest => ?_) + have hPrep := prepRest.1 + have prepFunction := prepRest.2.1 + have prepSelected := prepRest.2.2.1 + refine Exists.elim prepRest.2.2.2 (fun e eRest => ?_) + have he := eRest.1 + have chosen := eRest.2.1 + refine Exists.elim eRest.2.2 (fun orbit orbitRest => ?_) + have hOrbit := orbitRest.1 + have orbitFunction := orbitRest.2.1 + have initial := orbitRest.2.2.1 + have steps := orbitRest.2.2.2 + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let pTyped : SetMembers upperQ := SetMembers.ofMem p hp + have typedChosen : ZFSet.pair (SetMembers.raw pTyped) e ∈ enumSelector := by + simpa only [pTyped, SetMembers.raw_ofMem] using chosen + have typedInitial : ∀ state, ZFSet.pair ∅ state ∈ orbit ↔ + state = ZFSet.pair ∅ (ZFSet.pair (SetMembers.raw pTyped) (ZFSet.pair {ZFSet.pair ∅ e} ∅)) := by + simpa only [pTyped, SetMembers.raw_ofMem] using initial + obtain ⟨seq, start, seqGround, decreasing, clocks, births, events, + clockZero, birthZero, eventZero, entries, eventGround, eventFunction, + supportGround, supportSubset, supportSmall, rawSteps, limit, below, dataEqual, + unionGround, exactEntries, visits⟩ := + M.semanticStructuralFairPreparation_supported_lower_bound c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hs hh ordinal trace infinite choice rowClosed pTyped E0 enumSelector prepSelector orbit e + hE0 hOrbit rangeFunction enumSelected prepSelected typedChosen orbitFunction typedInitial steps + have initialRaw : SetMembers.raw (seq 0) = p := + (congrArg SetMembers.raw start).trans (SetMembers.raw_ofMem p hp) + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + let U := M.preparationWitnessBound b.carrier T upperQ + let E := insert ∅ (ZFSet.prod stages U) + let supportSet := M.preparationUsedSupportUnion b.carrier E (familyCodeGraph natSetCode events) + have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrder + (Fin.cases supports (Fin.cases hT (Fin.cases hT2 (Fin.cases hs + (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hUpper := M.refinementHistoryForcing_mem pairing unions powers separation carrier hT hs hPacked omega + have hU := M.preparationWitnessBound_mem pairing unions powers separation + geometry.carrier_ground hT hUpper omega + have hE := M.insert_mem pairing unions (M.empty_mem ⟨upperQ, hUpper⟩) + (M.prod_mem pairing unions powers separation hs hU) + have environments : ∀ alpha (fields : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → + StoredPreparationEnvironment M fields := by + intro alpha fields stored + have member := historyRun.carriers.data.function.pair_source stored + exact M.semanticStructuralPrefix_preparationEnvironment c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hs hh ordinal trace member fields stored + refine ⟨SetMembers.raw limit, SetMembers.raw_mem limit, initialRaw ▸ below 0, + supportSet, supportGround, supportSubset, supportSmall, ?_⟩ + exact M.fixedFairPreparationLimit_supportPrepared c pairing unions powers separation collection + historyRun environments geometry.carrier_ground hE prepSelected seq events eventFunction + limit below visits + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +open scoped ZFSet +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_support_prepared_strengthening + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) + (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) + (_stagesOrdinal : ordinalSetProperty stages) + (_trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + ∀ p ∈ upperQ, + GroundSupportPreparedStrengtheningResult M c lifted stages packed s.carrier p := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro p member + have descent := fulfilled.structural_prefix_descent + collection infinite choice small smallD irreflexive columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + have rowClosed := M.countable_function_internally_closed pairing unions powers separation + infinite choice coordinates two + exact fulfilled.exists_groundSupportPreparedStrengthening c + collection infinite choice small smallD irreflexive rowClosed act lifted squared (c.encode ⊤) + carrier forcingOrder forcingAction hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history hs hh stagesOrdinal trace descent p member + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportConstruction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportConstruction.lean index fc8f0e7de2922739363c341e347de15e5960a5c3..b11809bb798afdfff37f0c2835e41468fd815e8e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportConstruction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportConstruction.lean @@ -1,156 +1,156 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFulfillmentConstruction - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] - -structure FinalSupportFulfillment - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (level : GroundMainCandidateLevel M K) (i₀ : I) extends run.FinalFulfillment level i₀ where - insertion : ∀ c ∈ (run.finalGeometry i₀).carrier, ∀ e ∈ (run.finalGeometry i₀).carrier, - ∀ d ∈ (run.finalGeometry i₀).carrier, ∀ F ∈ M.sets, - MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F → - ZFSet.pair c e ∈ (run.finalGeometry i₀).order → - ZFSet.pair e c ∉ (run.finalGeometry i₀).order → - ZFSet.pair c d ∈ (run.finalGeometry i₀).order → - (∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) → - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c e d F caps actors - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -include fulfilled - -theorem tested_filter_generators - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {F e : ZFSet.{u}} (hF : F ∈ M.sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) - (he : e ∈ (run.finalGeometry i₀).carrier) : - let geometry := run.finalGeometry i₀ - let tested := testedMeetFilter F geometry.order e - tested ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph tested ∧ - (∀ x ∈ tested, ZFSet.pair e x ∈ geometry.order) ∧ - ∃ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega ∧ B.Nonempty ∧ B ⊆ tested ∧ - (∀ x ∈ tested, ∃ b ∈ B, ZFSet.pair b x ∈ geometry.order) ∧ - M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph B = tested := by - let geometry := run.finalGeometry i₀ - let tested := testedMeetFilter F geometry.order e - have ground : tested ∈ M.sets := M.testedMeetFilter_mem pairing separation hF - geometry.order_ground (M.transitive geometry.carrier_ground he) - have testedFilter : MeetFilterCode geometry.carrier geometry.order geometry.meetGraph tested := - testedMeetFilter_filter geometry.meet filter he fulfilled.directed - obtain ⟨B, hB, f, hf, injective, contained, coinitial⟩ := - fulfilled.chronology.exists_extension_basis i₀ (N := M) (fun _ hx => hx) - pairing unions powers separation infinite choice smallD irreflexive ground testedFilter - have nonempty : B.Nonempty := by - obtain ⟨x, hx⟩ := testedFilter.nonempty - obtain ⟨b, hb, _⟩ := coinitial x hx - exact ⟨b, hb⟩ - have inNodes : B ⊆ geometry.carrier := fun _ hb => testedFilter.subset (contained hb) - have generatedFilter := M.generatedMeetFilter_filter pairing unions separation infinite - geometry.carrier_ground geometry.meet inNodes nonempty - have generators := M.generatedMeetFilter_contains pairing unions separation infinite - geometry.carrier_ground geometry.meet inNodes - refine ⟨ground, testedFilter, fun x hx => (mem_testedMeetFilter F geometry.order e x).1 hx |>.2, - B, hB, ⟨f, hf, injective⟩, nonempty, contained, coinitial, ?_⟩ - apply ZFSet.ext - intro x - constructor - · intro hx - exact M.generatedMeetFilter_least pairing unions separation infinite geometry.carrier_ground - geometry.meet inNodes testedFilter contained hx - · intro hx - obtain ⟨b, hb, bx⟩ := coinitial x hx - exact generatedFilter.upward b (generators hb) x (testedFilter.subset hx) bx - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundMainFinalSupport - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ data : GroundMainOrdinalConstructionData M K C pairing unions powers separation, - ∃ ordinalC : ordinalSetProperty C, - letI := ordinalMainIndexPreorder ordinalC - ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) - (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), - run.indices = C ∧ run.PreservesOldProfiles ∧ - MainPrefixHistoryUnionCode data.history run.code ∧ - MainPrefixHistoryExtends data.history run.code ∧ - (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ - GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ - ∃ i₀ : SetMembers C, run.key i₀ = ∅ ∧ - ∃ fulfilled : run.FinalSupportFulfillment data.level i₀, - let geometry := run.finalGeometry i₀ - let inclusions := run.finalInclusions i₀ - geometry.code ∈ M.sets ∧ ZFSet.rank geometry.code < ZFSet.rank K ∧ - GroundBelow M geometry.carrier K ∧ GroundBelow M geometry.actors K ∧ - inclusions.pointFamily ∈ M.sets ∧ inclusions.actorFamily ∈ M.sets ∧ - ZFSet.rank inclusions.pointFamily < ZFSet.rank K ∧ - ZFSet.rank inclusions.actorFamily < ZFSet.rank K ∧ - fulfilled.chronology.serial.code ∈ M.sets ∧ - ∀ N : TransitiveGround.{u}, M.sets ⊆ N.sets → - Realize N.sets SetFormula.pairing Fin.elim0 → - Realize N.sets SetFormula.union Fin.elim0 → - Realize N.sets powerSet Fin.elim0 → SeparationSchema N.sets → - Realize N.sets infinity Fin.elim0 → Realize N.sets SetFormula.choice Fin.elim0 → - ∀ F ∈ N.sets, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F → - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ geometry.order := by - dsimp only - obtain ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, - i₀, zero, fulfilled, codeGround, codeRank, pointSmall, actorSmall, pointMaps, - actorMaps, pointRank, actorRank, chronologyGround, basis⟩ := - M.exists_groundMainFinalFulfillment pairing unions powers separation collection infinite choice hK standard - let := ordinalMainIndexPreorder ordinalC - let support : run.FinalSupportFulfillment data.level i₀ := { - toFinalFulfillment := fulfilled - insertion := fun c hc e he d hd F hF filter lower strict bound above => - fulfilled.chronology.final_insertion_of_trace i₀ collection infinite choice data.trace - (fun old next entry => (data.steps_entries old next entry).2) - (fun source target z entry => (data.successors_entries source target z entry).2.2) - indices extension profiles - (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - ⟨data.seed.coordinateInjection, data.seed.injection_ground, data.seed.injection_code⟩ - data.seed.dense.irrefl hc he hd hF filter lower strict bound above } - exact ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, - i₀, zero, support, codeGround, codeRank, pointSmall, actorSmall, pointMaps, - actorMaps, pointRank, actorRank, chronologyGround, basis⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFulfillmentConstruction + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] + +structure FinalSupportFulfillment + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (level : GroundMainCandidateLevel M K) (i₀ : I) extends run.FinalFulfillment level i₀ where + insertion : ∀ c ∈ (run.finalGeometry i₀).carrier, ∀ e ∈ (run.finalGeometry i₀).carrier, + ∀ d ∈ (run.finalGeometry i₀).carrier, ∀ F ∈ M.sets, + MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F → + ZFSet.pair c e ∈ (run.finalGeometry i₀).order → + ZFSet.pair e c ∉ (run.finalGeometry i₀).order → + ZFSet.pair c d ∈ (run.finalGeometry i₀).order → + (∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) → + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c e d F caps actors + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +include fulfilled + +theorem tested_filter_generators + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {F e : ZFSet.{u}} (hF : F ∈ M.sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) + (he : e ∈ (run.finalGeometry i₀).carrier) : + let geometry := run.finalGeometry i₀ + let tested := testedMeetFilter F geometry.order e + tested ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph tested ∧ + (∀ x ∈ tested, ZFSet.pair e x ∈ geometry.order) ∧ + ∃ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega ∧ B.Nonempty ∧ B ⊆ tested ∧ + (∀ x ∈ tested, ∃ b ∈ B, ZFSet.pair b x ∈ geometry.order) ∧ + M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph B = tested := by + let geometry := run.finalGeometry i₀ + let tested := testedMeetFilter F geometry.order e + have ground : tested ∈ M.sets := M.testedMeetFilter_mem pairing separation hF + geometry.order_ground (M.transitive geometry.carrier_ground he) + have testedFilter : MeetFilterCode geometry.carrier geometry.order geometry.meetGraph tested := + testedMeetFilter_filter geometry.meet filter he fulfilled.directed + obtain ⟨B, hB, f, hf, injective, contained, coinitial⟩ := + fulfilled.chronology.exists_extension_basis i₀ (N := M) (fun _ hx => hx) + pairing unions powers separation infinite choice smallD irreflexive ground testedFilter + have nonempty : B.Nonempty := by + obtain ⟨x, hx⟩ := testedFilter.nonempty + obtain ⟨b, hb, _⟩ := coinitial x hx + exact ⟨b, hb⟩ + have inNodes : B ⊆ geometry.carrier := fun _ hb => testedFilter.subset (contained hb) + have generatedFilter := M.generatedMeetFilter_filter pairing unions separation infinite + geometry.carrier_ground geometry.meet inNodes nonempty + have generators := M.generatedMeetFilter_contains pairing unions separation infinite + geometry.carrier_ground geometry.meet inNodes + refine ⟨ground, testedFilter, fun x hx => (mem_testedMeetFilter F geometry.order e x).1 hx |>.2, + B, hB, ⟨f, hf, injective⟩, nonempty, contained, coinitial, ?_⟩ + apply ZFSet.ext + intro x + constructor + · intro hx + exact M.generatedMeetFilter_least pairing unions separation infinite geometry.carrier_ground + geometry.meet inNodes testedFilter contained hx + · intro hx + obtain ⟨b, hb, bx⟩ := coinitial x hx + exact generatedFilter.upward b (generators hb) x (testedFilter.subset hx) bx + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundMainFinalSupport + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ data : GroundMainOrdinalConstructionData M K C pairing unions powers separation, + ∃ ordinalC : ordinalSetProperty C, + letI := ordinalMainIndexPreorder ordinalC + ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) + (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), + run.indices = C ∧ run.PreservesOldProfiles ∧ + MainPrefixHistoryUnionCode data.history run.code ∧ + MainPrefixHistoryExtends data.history run.code ∧ + (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ + GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ + ∃ i₀ : SetMembers C, run.key i₀ = ∅ ∧ + ∃ fulfilled : run.FinalSupportFulfillment data.level i₀, + let geometry := run.finalGeometry i₀ + let inclusions := run.finalInclusions i₀ + geometry.code ∈ M.sets ∧ ZFSet.rank geometry.code < ZFSet.rank K ∧ + GroundBelow M geometry.carrier K ∧ GroundBelow M geometry.actors K ∧ + inclusions.pointFamily ∈ M.sets ∧ inclusions.actorFamily ∈ M.sets ∧ + ZFSet.rank inclusions.pointFamily < ZFSet.rank K ∧ + ZFSet.rank inclusions.actorFamily < ZFSet.rank K ∧ + fulfilled.chronology.serial.code ∈ M.sets ∧ + ∀ N : TransitiveGround.{u}, M.sets ⊆ N.sets → + Realize N.sets SetFormula.pairing Fin.elim0 → + Realize N.sets SetFormula.union Fin.elim0 → + Realize N.sets powerSet Fin.elim0 → SeparationSchema N.sets → + Realize N.sets infinity Fin.elim0 → Realize N.sets SetFormula.choice Fin.elim0 → + ∀ F ∈ N.sets, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F → + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ geometry.order := by + dsimp only + obtain ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, + i₀, zero, fulfilled, codeGround, codeRank, pointSmall, actorSmall, pointMaps, + actorMaps, pointRank, actorRank, chronologyGround, basis⟩ := + M.exists_groundMainFinalFulfillment pairing unions powers separation collection infinite choice hK standard + let := ordinalMainIndexPreorder ordinalC + let support : run.FinalSupportFulfillment data.level i₀ := { + toFinalFulfillment := fulfilled + insertion := fun c hc e he d hd F hF filter lower strict bound above => + fulfilled.chronology.final_insertion_of_trace i₀ collection infinite choice data.trace + (fun old next entry => (data.steps_entries old next entry).2) + (fun source target z entry => (data.successors_entries source target z entry).2.2) + indices extension profiles + (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + ⟨data.seed.coordinateInjection, data.seed.injection_ground, data.seed.injection_code⟩ + data.seed.dense.irrefl hc he hd hF filter lower strict bound above } + exact ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, + i₀, zero, support, codeGround, codeRank, pointSmall, actorSmall, pointMaps, + actorMaps, pointRank, actorRank, chronologyGround, basis⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportedCertificateFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportedCertificateFamilies.lean index 40d4dd2bfb29340920d18263658b4087efdec47c..17abdaff7a42799fd0161e27ab915549d1d40999 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportedCertificateFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSupportedCertificateFamilies.lean @@ -1,520 +1,520 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.SupportedCertificateFamilyFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalDecidedVisibility - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def supportedEqualityCertificateBound (nodes N : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod (M.groundPower nodes) - (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes N)) - -theorem mem_supportedEqualityCertificateBound (nodes N F B f : ZFSet.{u}) : - ZFSet.pair F (ZFSet.pair B f) ∈ M.supportedEqualityCertificateBound nodes N ↔ - (F ∈ M.sets ∧ F ⊆ nodes) ∧ - (B ∈ M.sets ∧ B ⊆ nodes ∧ M.groundEmbeddable B ZFSet.omega) ∧ - (f ∈ M.sets ∧ f ⊆ ZFSet.prod nodes N) := by - rw [supportedEqualityCertificateBound, ZFSet.pair_mem_prod, ZFSet.pair_mem_prod, - M.mem_groundPower, M.mem_groundSmallSubsets, M.mem_groundRelations] - -theorem supportedEqualityCertificateBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {nodes N : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.supportedEqualityCertificateBound nodes N ∈ M.sets := - M.prod_mem pairing unions powers separation (M.groundPower_mem powers hNodes) - (M.prod_mem pairing unions powers separation - (M.groundSmallSubsets_mem powers separation hNodes omega) - (M.groundRelations_mem pairing unions powers separation hNodes hN)) - -theorem supportedEqualityCertificate_mem {nodes N F B f : ZFSet.{u}} - (hF : F ∈ M.sets) (profile : F ⊆ nodes) (hB : B ∈ M.sets) - (basis : B ⊆ F) (small : M.groundEmbeddable B ZFSet.omega) - (hf : f ∈ M.sets) (function : ZFSet.IsFunc B N f) : - ZFSet.pair F (ZFSet.pair B f) ∈ M.supportedEqualityCertificateBound nodes N := by - refine (M.mem_supportedEqualityCertificateBound nodes N F B f).2 - ⟨⟨hF, profile⟩, ⟨hB, fun _ member => profile (basis member), small⟩, hf, ?_⟩ - intro entry member - obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - exact ZFSet.pair_mem_prod.2 ⟨profile (basis hv), htau⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation I) (K : I → Subgroup G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -noncomputable def supportedEqualitySequenceEnv (B f : ZFSet.{u}) - (hB : B ∈ M.sets) (hf : f ∈ M.sets) (z : (M.nameDomain s).names) : - Assignment (M.nameDomain s) 6 := - let check (x : ZFSet.{u}) (hx : x ∈ M.sets) : (M.nameDomain s).names := - ⟨Name.check s ⊤ x, M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) x hx⟩ - ![check B hB, - check (M.niceSupportNameCodes a s T K) - (M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation collection - carrier group nodes supports maps hT valid), - check f hf, - check (M.niceSupportRelation a s b T K) - (M.niceSupportRelation_mem a s b T K t pairing unions powers separation collection - carrier group nodes supports maps hT valid), - ⟨M.niceSupportEvaluationName a s T K, - M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation collection - carrier group nodes supports maps hT valid⟩, - z] - -theorem realize_supportedEqualitySequenceEnv (B f : ZFSet.{u}) - (hB : B ∈ M.sets) (hf : f ∈ M.sets) (z : (M.nameDomain s).names) - (H : ConditionFilter P) : - Realize ((M.nameDomain s).values {p | H.mem p}) supportedEqualitySequenceFormula - (evalAssignment {p | H.mem p} - (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid B f hB hf z)) ↔ - ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f ∧ - ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → - ZFSet.pair v tau.val ∈ f → - ZFSet.pair v tau.val ∈ M.niceSupportRelation a s b T K ∧ - Name.eval {p | H.mem p} tau = Name.eval {p | H.mem p} z.val := by - let env := M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid B f hB hf z - let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, - (M.nameDomain s).values_transitive _⟩ - have fields : evalAssignment {p | H.mem p} env = - ![B, M.niceSupportNameCodes a s T K, f, M.niceSupportRelation a s b T K, - Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K), - Name.eval {p | H.mem p} z.val] := by - funext i - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ - (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))))) i - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - have meaning := N.realize_supportedEqualitySequenceFormula - (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩) - rw [fields] at meaning - change Realize N.sets supportedEqualitySequenceFormula (evalAssignment {p | H.mem p} env) ↔ _ - rw [fields, meaning] - constructor - · rintro ⟨function, allEntries⟩ - refine ⟨function, ?_⟩ - intro v hv tau ht entry - have result := allEntries v hv tau.val ht entry - exact ⟨result.1, (M.niceSupportEvaluationName_entry a s T K tau ht H _).1 result.2⟩ - · rintro ⟨function, allEntries⟩ - refine ⟨function, ?_⟩ - intro v hv code hc entry - let tau : Name s := ⟨code, M.niceSupportNameCodes_valid a s T K code hc⟩ - have result := allEntries v hv tau hc entry - exact ⟨result.1, (M.niceSupportEvaluationName_entry a s T K tau hc H _).2 result.2⟩ - -theorem forces_supportedEqualitySequence_entry (small : M.sets.Countable) - (B f : ZFSet.{u}) (hB : B ∈ M.sets) (hf : f ∈ M.sets) - (z : (M.nameDomain s).names) (p : P) - (forced : Forces (M.nameDomain s) supportedEqualitySequenceFormula - (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid B f hB hf z) p) - (v : ZFSet.{u}) (hv : v ∈ B) (tau : Name s) - (ht : tau.val ∈ M.niceSupportNameCodes a s T K) (entry : ZFSet.pair v tau.val ∈ f) : - Name.ForcesEq p z.val tau := by - let named : (M.nameDomain s).names := - ⟨tau, ((M.mem_niceSupportNameCodes a s T K tau.val).1 ht).1⟩ - change Forces (M.nameDomain s) (.equal 0 1 : SetFormula 2) ![z, named] p - apply (M.ordinaryForces_iff_all_generics s small carrier (.equal 0 1) ![z, named] p).2 - intro H hp generic - have truth := forces_sound (M.nameDomain s) H generic supportedEqualitySequenceFormula - (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid B f hB hf z) hp forced - have result := (M.realize_supportedEqualitySequenceEnv a s t b K pairing unions powers separation - collection carrier group nodes supports maps hT valid B f hB hf z H).1 truth - exact (result.2 v hv tau ht entry).2.symm - -theorem exists_forced_supportedEqualitySequence (small : M.sets.Countable) - (B f : ZFSet.{u}) (hB : B ∈ M.sets) (hf : f ∈ M.sets) - (z : (M.nameDomain s).names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (function : ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f) - (meaning : ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → - ZFSet.pair v tau.val ∈ f → - ZFSet.pair v tau.val ∈ M.niceSupportRelation a s b T K ∧ - Name.eval {p | H.mem p} tau = Name.eval {p | H.mem p} z.val) - (p : P) (hp : H.mem p) : - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain s) supportedEqualitySequenceFormula - (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid B f hB hf z) q ∧ - ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → - ZFSet.pair v tau.val ∈ f → - ZFSet.pair v tau.val ∈ M.niceSupportRelation a s b T K ∧ Name.ForcesEq q z.val tau := by - let env := M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid B f hB hf z - have truth := (M.realize_supportedEqualitySequenceEnv a s t b K pairing unions powers separation - collection carrier group nodes supports maps hT valid B f hB hf z H).2 ⟨function, meaning⟩ - obtain ⟨r, hr, forced⟩ := (forcing_truth (M.nameDomain s) H generic - supportedEqualitySequenceFormula env).1 truth - obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr - have forcedQ := forces_mono (M.nameDomain s) supportedEqualitySequenceFormula env forced qr - refine ⟨q, hq, qp, forcedQ, ?_⟩ - intro v hv tau ht entry - exact ⟨(meaning v hv tau ht entry).1, - M.forces_supportedEqualitySequence_entry a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid small B f hB hf z q forcedQ v hv tau ht entry⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) -variable (T : ZFSet.{u}) (K : L → Subgroup G) - -noncomputable def supportedCertificateFamilyRelation - (nodeOrder J : ZFSet.{u}) (validJ : ∀ z ∈ J, IsName s z) - (H : ConditionFilter P) : ZFSet.{u} := - supportedCertificateRelation J (M.groundPower b.carrier) - (M.groundSmallSubsets b.carrier ZFSet.omega) - (M.groundRelations b.carrier (M.niceSupportNameCodes a s T K)) b.carrier - (M.niceSupportNameCodes a s T K) nodeOrder (M.niceSupportRelation a s b T K) - (Name.eval {p | H.mem p} (Name.inputEvaluationName s J validJ)) - (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) - (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K)) - -theorem supportedCertificateFamilyRelation_mem_ordinary (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - {nodeOrder J : ZFSet.{u}} (hNodeOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) - (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H ∈ - (M.ordinaryExtension s H).sets := by - have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation - collection carrier H - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection - carrier order infinite H generic - have hN := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation - collection carrier group nodes supports maps hT valid - have hInput := M.inputEvaluationName_mem s pairing unions powers separation collection carrier hJ validJ - have hNice := M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation - collection carrier group nodes supports maps hT valid - have hVisibility := M.niceVisibilityEvaluationName_mem a s b t K pairing unions powers separation - collection carrier group nodes supports maps hT valid - exact (M.ordinaryExtension s H).supportedCertificateRelation_mem - zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 zf.2.1 - (includes hJ) (includes (M.groundPower_mem powers nodes)) - (includes (M.groundSmallSubsets_mem powers separation nodes (M.omega_mem separation infinite))) - (includes (M.groundRelations_mem pairing unions powers separation nodes hN)) - (includes nodes) (includes hN) (includes hNodeOrder) - (includes (M.niceSupportRelation_mem a s b T K t pairing unions powers separation - collection carrier group nodes supports maps hT valid)) - ⟨⟨_, hInput⟩, rfl⟩ ⟨⟨_, hNice⟩, rfl⟩ ⟨⟨_, hVisibility⟩, rfl⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) -variable (T : ZFSet.{u}) (K : L → Subgroup G) - -theorem supportedCertificateFamily_groundData (nodeOrder J : ZFSet.{u}) - (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) - (j F B f : ZFSet.{u}) - (member : ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ - M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) : - j ∈ J ∧ F ∈ M.sets ∧ B ∈ M.sets ∧ f ∈ M.sets ∧ - M.groundEmbeddable B ZFSet.omega ∧ F ⊆ b.carrier ∧ B ⊆ F ∧ - (∀ v ∈ F, ∃ w ∈ B, ZFSet.pair w v ∈ nodeOrder) ∧ - ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f ∧ - ∀ v ∈ B, ∀ tau ∈ M.niceSupportNameCodes a s T K, - ZFSet.pair v tau ∈ f → ZFSet.pair v tau ∈ M.niceSupportRelation a s b T K := by - obtain ⟨hj, hF, hB, hf, value, _, certificate⟩ := - (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 member - have small := (M.mem_groundSmallSubsets b.carrier ZFSet.omega B).1 hB - exact ⟨hj, ((M.mem_groundPower b.carrier F).1 hF).1, small.1, - ((M.mem_groundRelations b.carrier (M.niceSupportNameCodes a s T K) f).1 hf).1, - small.2.2, certificate.1, certificate.2.1, certificate.2.2.1, - certificate.2.2.2.1, fun v hv tau ht edge => (certificate.2.2.2.2.2 v hv tau ht edge).1⟩ - -end TransitiveGround - -namespace GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) - -theorem exists_supportedEqualityBasis - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) Q) - (maps : a.conditionMapFamily s t ∈ M.sets) - (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (_children : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) - (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - (z : (M.nameDomain s).names) - (_hs : HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z.val) - (_subset : Name.eval {p | H.mem p} z.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (p : Q) (_hp : H.mem p), - let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) - ∃ ground : F ∈ M.sets, - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - ∃ (B : ZFSet.{u}) (hB : B ∈ M.sets), - M.groundEmbeddable B ZFSet.omega ∧ B ⊆ F ∧ - (∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ geometry.order) ∧ - ∃ (f : ZFSet.{u}) (hf : f ∈ M.sets), - ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f ∧ - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain s) visibilityProfileFormula - (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection - carrier geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid F ground z) q ∧ - M.DecidesVisibilityProfile a s b d.principalFix T F z.val q ∧ - Forces (M.nameDomain s) supportedEqualitySequenceFormula - (M.supportedEqualitySequenceEnv a s t b d.principalFix - pairing unions powers separation collection carrier geometry.actors_ground - geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid B f hB hf z) q ∧ - ∀ (v : SetMembers geometry.carrier), b.encode v ∈ B → - ∀ τ : Name s, ZFSet.pair (b.encode v) τ.val ∈ f → - τ.val ∈ M.sets ∧ τ.val ⊆ ZFSet.prod T s.carrier ∧ - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ ∧ - d.principalFix v ≤ a.stabilizer s τ ∧ Name.ForcesEq q z.val τ := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a maps T hT valid terms children H genericCoded genericFormula descent z hs subset p hp - let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) - have supports := geometry.decoded_supportBasis_ground pairing unions powers separation - obtain ⟨ground, filter, B, hB, smallB, contained, coinitial, q₀, hq₀, q₀p, profile, _⟩ := - fulfilled.exists_decided_visibilityProfile s collection infinite choice carrier order small - closed smallD irreflexive a maps T hT valid terms children H genericCoded genericFormula - descent z hs subset p hp - have inNodes : B ⊆ b.carrier := fun _ member => filter.subset (contained member) - have visible : ∀ v : SetMembers geometry.carrier, b.encode v ∈ B → - Name.eval {p | H.mem p} z.val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by - intro v hv - exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).1 (contained hv) - obtain ⟨f, hf, function, selected⟩ := M.exists_ground_supportedEqualityChoice a s t b T - d.principalFix pairing unions powers separation collection infinite choice carrier order - geometry.actors_ground geometry.carrier_ground supports maps hT valid small closed H - genericCoded genericFormula hB smallB inNodes z visible - have meaning : ∀ raw ∈ B, ∀ τ : Name s, - τ.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair raw τ.val ∈ f → - ZFSet.pair raw τ.val ∈ M.niceSupportRelation a s b T d.principalFix ∧ - Name.eval {p | H.mem p} τ = Name.eval {p | H.mem p} z.val := by - intro raw _ τ ht entry - have facts := (pair_mem_supportedEqualityRelation B _ _ _ _ raw τ.val).1 (selected entry) - exact ⟨facts.2.2.1, - (M.niceSupportEvaluationName_entry a s T d.principalFix τ ht H _).1 facts.2.2.2⟩ - obtain ⟨q, hq, qq₀, forced, entries⟩ := M.exists_forced_supportedEqualitySequence a s t b - d.principalFix pairing unions powers separation collection carrier geometry.actors_ground - geometry.carrier_ground supports maps hT valid small B f hB hf z H genericFormula - function meaning q₀ hq₀ - have profileQ := forces_mono (M.nameDomain s) visibilityProfileFormula _ profile qq₀ - have decisions := (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers - separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps - hT valid small F ground z q).1 profileQ - refine ⟨ground, filter, B, hB, smallB, contained, coinitial, f, hf, function, - q, hq, le_trans qq₀ q₀p, profileQ, decisions, forced, ?_⟩ - intro v hv τ entry - have member := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - have certificate := entries (b.encode v) hv τ member entry - have code := (M.pair_mem_niceSupportRelation a s b T d.principalFix v τ.val).1 certificate.1 - have nice := (niceNameCode_iff a s τ).1 code.2 - exact ⟨code.1, nice.1, niceNameCode_principal_hs a s d ⊥ v directed children code.2, - nice.2, certificate.2⟩ - -theorem exists_supportedCertificateFamily - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) Q) - (_maps : a.conditionMapFamily s t ∈ M.sets) - (T : ZFSet.{u}) (_hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (_children : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) - (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - (J : ZFSet.{u}) (_hJ : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) - (_smallJ : M.groundEmbeddable J ZFSet.omega) - (_hs : ∀ z : Name s, z.val ∈ J → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z) - (_subset : ∀ z : Name s, z.val ∈ J → Name.eval {p | H.mem p} z ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)), - ∃ k ∈ M.sets, - ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes a s T d.principalFix)) k ∧ - k ⊆ M.supportedCertificateFamilyRelation a s b T d.principalFix - geometry.order J validJ H := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a maps T hT valid terms children H genericCoded genericFormula descent - J hJ validJ smallJ hs subsets - let codes := M.niceSupportNameCodes a s T d.principalFix - let bound := M.supportedEqualityCertificateBound b.carrier codes - let relation := M.supportedCertificateFamilyRelation a s b T d.principalFix - geometry.order J validJ H - have supports := geometry.decoded_supportBasis_ground pairing unions powers separation - have codesGround := M.niceSupportNameCodes_mem a s b T d.principalFix t pairing unions powers - separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid - have boundGround := M.supportedEqualityCertificateBound_mem pairing unions powers separation - geometry.carrier_ground codesGround (M.omega_mem separation infinite) - have relationGround := M.supportedCertificateFamilyRelation_mem_ordinary a s b T d.principalFix - t pairing unions powers separation collection infinite carrier order geometry.actors_ground - geometry.carrier_ground supports maps hT valid geometry.order_ground hJ validJ H genericFormula - have total : ∀ raw ∈ J, ∃ certificate ∈ bound, ZFSet.pair raw certificate ∈ relation := by - intro raw member - let z : (M.nameDomain s).names := ⟨⟨raw, validJ raw member⟩, M.transitive hJ member⟩ - let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) - obtain ⟨hF, filter, B, hB, smallB, contained, coinitial, f, hf, function, - q, hq, _, _, _, forced, _⟩ := - fulfilled.exists_supportedEqualityBasis s collection infinite choice carrier order small - closed smallD irreflexive a maps T hT valid terms children H genericCoded genericFormula - descent z (hs z.val member) (subsets z.val member) ⊤ H.top_mem - have certificateBound := M.supportedEqualityCertificate_mem hF filter.subset hB contained - smallB hf function - refine ⟨ZFSet.pair F (ZFSet.pair B f), certificateBound, ?_⟩ - change ZFSet.pair raw (ZFSet.pair F (ZFSet.pair B f)) ∈ supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ - apply (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).2 - have boundFields := (M.mem_supportedEqualityCertificateBound b.carrier codes F B f).1 certificateBound - refine ⟨member, (M.mem_groundPower _ _).2 boundFields.1, - (M.mem_groundSmallSubsets _ _ _).2 boundFields.2.1, - (M.mem_groundRelations _ _ _).2 boundFields.2.2, - Name.eval {p | H.mem p} z.val, - (Name.inputEvaluationName_entry s J validJ z.val H _).2 ⟨member, rfl⟩, - filter.subset, contained, coinitial, function, ?_, ?_⟩ - · intro rawNode V entry inNodes - obtain ⟨v, rfl⟩ := (b.mem_carrier rawNode).1 inNodes - have equal := (M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v V).1 entry - rw [← equal] - exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).symm - · have truth := forces_sound (M.nameDomain s) H genericFormula supportedEqualitySequenceFormula - (M.supportedEqualitySequenceEnv a s t b d.principalFix pairing unions powers separation - collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid - B f hB hf z) hq forced - have meaning := (M.realize_supportedEqualitySequenceEnv a s t b d.principalFix pairing unions - powers separation collection carrier geometry.actors_ground geometry.carrier_ground supports - maps hT valid B f hB hf z H).1 truth - intro v hv rawName inCodes entry - let tau : Name s := ⟨rawName, M.niceSupportNameCodes_valid a s T d.principalFix rawName inCodes⟩ - have result := meaning.2 v hv tau inCodes entry - exact ⟨result.1, (M.niceSupportEvaluationName_entry a s T d.principalFix tau inCodes H _).2 result.2⟩ - let extension := M.ordinaryExtension s H - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order - infinite H genericFormula - have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite - choice carrier order H genericFormula - have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H - obtain ⟨k, hk, function, selected⟩ := extension.uniformize_relation zf.1.2.2.2.1 zf.1.2.2.2.2.1 - zf.1.2.2.2.2.2.1 zf.2.1 choiceN (includes hJ) (includes boundGround) relationGround total - have ground := M.ordinaryExtension_countableDomainFunction_mem s pairing unions powers separation - collection infinite choice carrier order small hJ boundGround smallJ closed H genericCoded - genericFormula hk function - exact ⟨k, ground, function, selected⟩ - -end GroundMainPrefix.FinalSupportFulfillment - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.SupportedCertificateFamilyFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalDecidedVisibility + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def supportedEqualityCertificateBound (nodes N : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod (M.groundPower nodes) + (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes N)) + +theorem mem_supportedEqualityCertificateBound (nodes N F B f : ZFSet.{u}) : + ZFSet.pair F (ZFSet.pair B f) ∈ M.supportedEqualityCertificateBound nodes N ↔ + (F ∈ M.sets ∧ F ⊆ nodes) ∧ + (B ∈ M.sets ∧ B ⊆ nodes ∧ M.groundEmbeddable B ZFSet.omega) ∧ + (f ∈ M.sets ∧ f ⊆ ZFSet.prod nodes N) := by + rw [supportedEqualityCertificateBound, ZFSet.pair_mem_prod, ZFSet.pair_mem_prod, + M.mem_groundPower, M.mem_groundSmallSubsets, M.mem_groundRelations] + +theorem supportedEqualityCertificateBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {nodes N : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.supportedEqualityCertificateBound nodes N ∈ M.sets := + M.prod_mem pairing unions powers separation (M.groundPower_mem powers hNodes) + (M.prod_mem pairing unions powers separation + (M.groundSmallSubsets_mem powers separation hNodes omega) + (M.groundRelations_mem pairing unions powers separation hNodes hN)) + +theorem supportedEqualityCertificate_mem {nodes N F B f : ZFSet.{u}} + (hF : F ∈ M.sets) (profile : F ⊆ nodes) (hB : B ∈ M.sets) + (basis : B ⊆ F) (small : M.groundEmbeddable B ZFSet.omega) + (hf : f ∈ M.sets) (function : ZFSet.IsFunc B N f) : + ZFSet.pair F (ZFSet.pair B f) ∈ M.supportedEqualityCertificateBound nodes N := by + refine (M.mem_supportedEqualityCertificateBound nodes N F B f).2 + ⟨⟨hF, profile⟩, ⟨hB, fun _ member => profile (basis member), small⟩, hf, ?_⟩ + intro entry member + obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + exact ZFSet.pair_mem_prod.2 ⟨profile (basis hv), htau⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation I) (K : I → Subgroup G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +noncomputable def supportedEqualitySequenceEnv (B f : ZFSet.{u}) + (hB : B ∈ M.sets) (hf : f ∈ M.sets) (z : (M.nameDomain s).names) : + Assignment (M.nameDomain s) 6 := + let check (x : ZFSet.{u}) (hx : x ∈ M.sets) : (M.nameDomain s).names := + ⟨Name.check s ⊤ x, M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) x hx⟩ + ![check B hB, + check (M.niceSupportNameCodes a s T K) + (M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation collection + carrier group nodes supports maps hT valid), + check f hf, + check (M.niceSupportRelation a s b T K) + (M.niceSupportRelation_mem a s b T K t pairing unions powers separation collection + carrier group nodes supports maps hT valid), + ⟨M.niceSupportEvaluationName a s T K, + M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation collection + carrier group nodes supports maps hT valid⟩, + z] + +theorem realize_supportedEqualitySequenceEnv (B f : ZFSet.{u}) + (hB : B ∈ M.sets) (hf : f ∈ M.sets) (z : (M.nameDomain s).names) + (H : ConditionFilter P) : + Realize ((M.nameDomain s).values {p | H.mem p}) supportedEqualitySequenceFormula + (evalAssignment {p | H.mem p} + (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid B f hB hf z)) ↔ + ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f ∧ + ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → + ZFSet.pair v tau.val ∈ f → + ZFSet.pair v tau.val ∈ M.niceSupportRelation a s b T K ∧ + Name.eval {p | H.mem p} tau = Name.eval {p | H.mem p} z.val := by + let env := M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid B f hB hf z + let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, + (M.nameDomain s).values_transitive _⟩ + have fields : evalAssignment {p | H.mem p} env = + ![B, M.niceSupportNameCodes a s T K, f, M.niceSupportRelation a s b T K, + Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K), + Name.eval {p | H.mem p} z.val] := by + funext i + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ + (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))))) i + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + have meaning := N.realize_supportedEqualitySequenceFormula + (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩) + rw [fields] at meaning + change Realize N.sets supportedEqualitySequenceFormula (evalAssignment {p | H.mem p} env) ↔ _ + rw [fields, meaning] + constructor + · rintro ⟨function, allEntries⟩ + refine ⟨function, ?_⟩ + intro v hv tau ht entry + have result := allEntries v hv tau.val ht entry + exact ⟨result.1, (M.niceSupportEvaluationName_entry a s T K tau ht H _).1 result.2⟩ + · rintro ⟨function, allEntries⟩ + refine ⟨function, ?_⟩ + intro v hv code hc entry + let tau : Name s := ⟨code, M.niceSupportNameCodes_valid a s T K code hc⟩ + have result := allEntries v hv tau hc entry + exact ⟨result.1, (M.niceSupportEvaluationName_entry a s T K tau hc H _).2 result.2⟩ + +theorem forces_supportedEqualitySequence_entry (small : M.sets.Countable) + (B f : ZFSet.{u}) (hB : B ∈ M.sets) (hf : f ∈ M.sets) + (z : (M.nameDomain s).names) (p : P) + (forced : Forces (M.nameDomain s) supportedEqualitySequenceFormula + (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid B f hB hf z) p) + (v : ZFSet.{u}) (hv : v ∈ B) (tau : Name s) + (ht : tau.val ∈ M.niceSupportNameCodes a s T K) (entry : ZFSet.pair v tau.val ∈ f) : + Name.ForcesEq p z.val tau := by + let named : (M.nameDomain s).names := + ⟨tau, ((M.mem_niceSupportNameCodes a s T K tau.val).1 ht).1⟩ + change Forces (M.nameDomain s) (.equal 0 1 : SetFormula 2) ![z, named] p + apply (M.ordinaryForces_iff_all_generics s small carrier (.equal 0 1) ![z, named] p).2 + intro H hp generic + have truth := forces_sound (M.nameDomain s) H generic supportedEqualitySequenceFormula + (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid B f hB hf z) hp forced + have result := (M.realize_supportedEqualitySequenceEnv a s t b K pairing unions powers separation + collection carrier group nodes supports maps hT valid B f hB hf z H).1 truth + exact (result.2 v hv tau ht entry).2.symm + +theorem exists_forced_supportedEqualitySequence (small : M.sets.Countable) + (B f : ZFSet.{u}) (hB : B ∈ M.sets) (hf : f ∈ M.sets) + (z : (M.nameDomain s).names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (function : ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f) + (meaning : ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → + ZFSet.pair v tau.val ∈ f → + ZFSet.pair v tau.val ∈ M.niceSupportRelation a s b T K ∧ + Name.eval {p | H.mem p} tau = Name.eval {p | H.mem p} z.val) + (p : P) (hp : H.mem p) : + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain s) supportedEqualitySequenceFormula + (M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid B f hB hf z) q ∧ + ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → + ZFSet.pair v tau.val ∈ f → + ZFSet.pair v tau.val ∈ M.niceSupportRelation a s b T K ∧ Name.ForcesEq q z.val tau := by + let env := M.supportedEqualitySequenceEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid B f hB hf z + have truth := (M.realize_supportedEqualitySequenceEnv a s t b K pairing unions powers separation + collection carrier group nodes supports maps hT valid B f hB hf z H).2 ⟨function, meaning⟩ + obtain ⟨r, hr, forced⟩ := (forcing_truth (M.nameDomain s) H generic + supportedEqualitySequenceFormula env).1 truth + obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr + have forcedQ := forces_mono (M.nameDomain s) supportedEqualitySequenceFormula env forced qr + refine ⟨q, hq, qp, forcedQ, ?_⟩ + intro v hv tau ht entry + exact ⟨(meaning v hv tau ht entry).1, + M.forces_supportedEqualitySequence_entry a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid small B f hB hf z q forcedQ v hv tau ht entry⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) +variable (T : ZFSet.{u}) (K : L → Subgroup G) + +noncomputable def supportedCertificateFamilyRelation + (nodeOrder J : ZFSet.{u}) (validJ : ∀ z ∈ J, IsName s z) + (H : ConditionFilter P) : ZFSet.{u} := + supportedCertificateRelation J (M.groundPower b.carrier) + (M.groundSmallSubsets b.carrier ZFSet.omega) + (M.groundRelations b.carrier (M.niceSupportNameCodes a s T K)) b.carrier + (M.niceSupportNameCodes a s T K) nodeOrder (M.niceSupportRelation a s b T K) + (Name.eval {p | H.mem p} (Name.inputEvaluationName s J validJ)) + (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) + (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K)) + +theorem supportedCertificateFamilyRelation_mem_ordinary (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + {nodeOrder J : ZFSet.{u}} (hNodeOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) + (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H ∈ + (M.ordinaryExtension s H).sets := by + have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation + collection carrier H + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection + carrier order infinite H generic + have hN := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation + collection carrier group nodes supports maps hT valid + have hInput := M.inputEvaluationName_mem s pairing unions powers separation collection carrier hJ validJ + have hNice := M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation + collection carrier group nodes supports maps hT valid + have hVisibility := M.niceVisibilityEvaluationName_mem a s b t K pairing unions powers separation + collection carrier group nodes supports maps hT valid + exact (M.ordinaryExtension s H).supportedCertificateRelation_mem + zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 zf.2.1 + (includes hJ) (includes (M.groundPower_mem powers nodes)) + (includes (M.groundSmallSubsets_mem powers separation nodes (M.omega_mem separation infinite))) + (includes (M.groundRelations_mem pairing unions powers separation nodes hN)) + (includes nodes) (includes hN) (includes hNodeOrder) + (includes (M.niceSupportRelation_mem a s b T K t pairing unions powers separation + collection carrier group nodes supports maps hT valid)) + ⟨⟨_, hInput⟩, rfl⟩ ⟨⟨_, hNice⟩, rfl⟩ ⟨⟨_, hVisibility⟩, rfl⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) +variable (T : ZFSet.{u}) (K : L → Subgroup G) + +theorem supportedCertificateFamily_groundData (nodeOrder J : ZFSet.{u}) + (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) + (j F B f : ZFSet.{u}) + (member : ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ + M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) : + j ∈ J ∧ F ∈ M.sets ∧ B ∈ M.sets ∧ f ∈ M.sets ∧ + M.groundEmbeddable B ZFSet.omega ∧ F ⊆ b.carrier ∧ B ⊆ F ∧ + (∀ v ∈ F, ∃ w ∈ B, ZFSet.pair w v ∈ nodeOrder) ∧ + ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f ∧ + ∀ v ∈ B, ∀ tau ∈ M.niceSupportNameCodes a s T K, + ZFSet.pair v tau ∈ f → ZFSet.pair v tau ∈ M.niceSupportRelation a s b T K := by + obtain ⟨hj, hF, hB, hf, value, _, certificate⟩ := + (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 member + have small := (M.mem_groundSmallSubsets b.carrier ZFSet.omega B).1 hB + exact ⟨hj, ((M.mem_groundPower b.carrier F).1 hF).1, small.1, + ((M.mem_groundRelations b.carrier (M.niceSupportNameCodes a s T K) f).1 hf).1, + small.2.2, certificate.1, certificate.2.1, certificate.2.2.1, + certificate.2.2.2.1, fun v hv tau ht edge => (certificate.2.2.2.2.2 v hv tau ht edge).1⟩ + +end TransitiveGround + +namespace GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) + +theorem exists_supportedEqualityBasis + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) Q) + (maps : a.conditionMapFamily s t ∈ M.sets) + (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (_children : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) + (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + (z : (M.nameDomain s).names) + (_hs : HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z.val) + (_subset : Name.eval {p | H.mem p} z.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (p : Q) (_hp : H.mem p), + let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) + ∃ ground : F ∈ M.sets, + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + ∃ (B : ZFSet.{u}) (hB : B ∈ M.sets), + M.groundEmbeddable B ZFSet.omega ∧ B ⊆ F ∧ + (∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ geometry.order) ∧ + ∃ (f : ZFSet.{u}) (hf : f ∈ M.sets), + ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f ∧ + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain s) visibilityProfileFormula + (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection + carrier geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid F ground z) q ∧ + M.DecidesVisibilityProfile a s b d.principalFix T F z.val q ∧ + Forces (M.nameDomain s) supportedEqualitySequenceFormula + (M.supportedEqualitySequenceEnv a s t b d.principalFix + pairing unions powers separation collection carrier geometry.actors_ground + geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid B f hB hf z) q ∧ + ∀ (v : SetMembers geometry.carrier), b.encode v ∈ B → + ∀ τ : Name s, ZFSet.pair (b.encode v) τ.val ∈ f → + τ.val ∈ M.sets ∧ τ.val ⊆ ZFSet.prod T s.carrier ∧ + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ ∧ + d.principalFix v ≤ a.stabilizer s τ ∧ Name.ForcesEq q z.val τ := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a maps T hT valid terms children H genericCoded genericFormula descent z hs subset p hp + let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) + have supports := geometry.decoded_supportBasis_ground pairing unions powers separation + obtain ⟨ground, filter, B, hB, smallB, contained, coinitial, q₀, hq₀, q₀p, profile, _⟩ := + fulfilled.exists_decided_visibilityProfile s collection infinite choice carrier order small + closed smallD irreflexive a maps T hT valid terms children H genericCoded genericFormula + descent z hs subset p hp + have inNodes : B ⊆ b.carrier := fun _ member => filter.subset (contained member) + have visible : ∀ v : SetMembers geometry.carrier, b.encode v ∈ B → + Name.eval {p | H.mem p} z.val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by + intro v hv + exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).1 (contained hv) + obtain ⟨f, hf, function, selected⟩ := M.exists_ground_supportedEqualityChoice a s t b T + d.principalFix pairing unions powers separation collection infinite choice carrier order + geometry.actors_ground geometry.carrier_ground supports maps hT valid small closed H + genericCoded genericFormula hB smallB inNodes z visible + have meaning : ∀ raw ∈ B, ∀ τ : Name s, + τ.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair raw τ.val ∈ f → + ZFSet.pair raw τ.val ∈ M.niceSupportRelation a s b T d.principalFix ∧ + Name.eval {p | H.mem p} τ = Name.eval {p | H.mem p} z.val := by + intro raw _ τ ht entry + have facts := (pair_mem_supportedEqualityRelation B _ _ _ _ raw τ.val).1 (selected entry) + exact ⟨facts.2.2.1, + (M.niceSupportEvaluationName_entry a s T d.principalFix τ ht H _).1 facts.2.2.2⟩ + obtain ⟨q, hq, qq₀, forced, entries⟩ := M.exists_forced_supportedEqualitySequence a s t b + d.principalFix pairing unions powers separation collection carrier geometry.actors_ground + geometry.carrier_ground supports maps hT valid small B f hB hf z H genericFormula + function meaning q₀ hq₀ + have profileQ := forces_mono (M.nameDomain s) visibilityProfileFormula _ profile qq₀ + have decisions := (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers + separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps + hT valid small F ground z q).1 profileQ + refine ⟨ground, filter, B, hB, smallB, contained, coinitial, f, hf, function, + q, hq, le_trans qq₀ q₀p, profileQ, decisions, forced, ?_⟩ + intro v hv τ entry + have member := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + have certificate := entries (b.encode v) hv τ member entry + have code := (M.pair_mem_niceSupportRelation a s b T d.principalFix v τ.val).1 certificate.1 + have nice := (niceNameCode_iff a s τ).1 code.2 + exact ⟨code.1, nice.1, niceNameCode_principal_hs a s d ⊥ v directed children code.2, + nice.2, certificate.2⟩ + +theorem exists_supportedCertificateFamily + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) Q) + (_maps : a.conditionMapFamily s t ∈ M.sets) + (T : ZFSet.{u}) (_hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (_children : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) + (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + (J : ZFSet.{u}) (_hJ : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) + (_smallJ : M.groundEmbeddable J ZFSet.omega) + (_hs : ∀ z : Name s, z.val ∈ J → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z) + (_subset : ∀ z : Name s, z.val ∈ J → Name.eval {p | H.mem p} z ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)), + ∃ k ∈ M.sets, + ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes a s T d.principalFix)) k ∧ + k ⊆ M.supportedCertificateFamilyRelation a s b T d.principalFix + geometry.order J validJ H := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a maps T hT valid terms children H genericCoded genericFormula descent + J hJ validJ smallJ hs subsets + let codes := M.niceSupportNameCodes a s T d.principalFix + let bound := M.supportedEqualityCertificateBound b.carrier codes + let relation := M.supportedCertificateFamilyRelation a s b T d.principalFix + geometry.order J validJ H + have supports := geometry.decoded_supportBasis_ground pairing unions powers separation + have codesGround := M.niceSupportNameCodes_mem a s b T d.principalFix t pairing unions powers + separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid + have boundGround := M.supportedEqualityCertificateBound_mem pairing unions powers separation + geometry.carrier_ground codesGround (M.omega_mem separation infinite) + have relationGround := M.supportedCertificateFamilyRelation_mem_ordinary a s b T d.principalFix + t pairing unions powers separation collection infinite carrier order geometry.actors_ground + geometry.carrier_ground supports maps hT valid geometry.order_ground hJ validJ H genericFormula + have total : ∀ raw ∈ J, ∃ certificate ∈ bound, ZFSet.pair raw certificate ∈ relation := by + intro raw member + let z : (M.nameDomain s).names := ⟨⟨raw, validJ raw member⟩, M.transitive hJ member⟩ + let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) + obtain ⟨hF, filter, B, hB, smallB, contained, coinitial, f, hf, function, + q, hq, _, _, _, forced, _⟩ := + fulfilled.exists_supportedEqualityBasis s collection infinite choice carrier order small + closed smallD irreflexive a maps T hT valid terms children H genericCoded genericFormula + descent z (hs z.val member) (subsets z.val member) ⊤ H.top_mem + have certificateBound := M.supportedEqualityCertificate_mem hF filter.subset hB contained + smallB hf function + refine ⟨ZFSet.pair F (ZFSet.pair B f), certificateBound, ?_⟩ + change ZFSet.pair raw (ZFSet.pair F (ZFSet.pair B f)) ∈ supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ + apply (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).2 + have boundFields := (M.mem_supportedEqualityCertificateBound b.carrier codes F B f).1 certificateBound + refine ⟨member, (M.mem_groundPower _ _).2 boundFields.1, + (M.mem_groundSmallSubsets _ _ _).2 boundFields.2.1, + (M.mem_groundRelations _ _ _).2 boundFields.2.2, + Name.eval {p | H.mem p} z.val, + (Name.inputEvaluationName_entry s J validJ z.val H _).2 ⟨member, rfl⟩, + filter.subset, contained, coinitial, function, ?_, ?_⟩ + · intro rawNode V entry inNodes + obtain ⟨v, rfl⟩ := (b.mem_carrier rawNode).1 inNodes + have equal := (M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v V).1 entry + rw [← equal] + exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).symm + · have truth := forces_sound (M.nameDomain s) H genericFormula supportedEqualitySequenceFormula + (M.supportedEqualitySequenceEnv a s t b d.principalFix pairing unions powers separation + collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid + B f hB hf z) hq forced + have meaning := (M.realize_supportedEqualitySequenceEnv a s t b d.principalFix pairing unions + powers separation collection carrier geometry.actors_ground geometry.carrier_ground supports + maps hT valid B f hB hf z H).1 truth + intro v hv rawName inCodes entry + let tau : Name s := ⟨rawName, M.niceSupportNameCodes_valid a s T d.principalFix rawName inCodes⟩ + have result := meaning.2 v hv tau inCodes entry + exact ⟨result.1, (M.niceSupportEvaluationName_entry a s T d.principalFix tau inCodes H _).2 result.2⟩ + let extension := M.ordinaryExtension s H + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order + infinite H genericFormula + have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite + choice carrier order H genericFormula + have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H + obtain ⟨k, hk, function, selected⟩ := extension.uniformize_relation zf.1.2.2.2.1 zf.1.2.2.2.2.1 + zf.1.2.2.2.2.2.1 zf.2.1 choiceN (includes hJ) (includes boundGround) relationGround total + have ground := M.ordinaryExtension_countableDomainFunction_mem s pairing unions powers separation + collection infinite choice carrier order small hJ boundGround smallJ closed H genericCoded + genericFormula hk function + exact ⟨k, ground, function, selected⟩ + +end GroundMainPrefix.FinalSupportFulfillment + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSymmetricRefinementOutputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSymmetricRefinementOutputs.lean index 4905189f78958763940d4d2510f1ae9f89df5d63..a4880061104994bfb8c92f8a9c1a06758c1138ec 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSymmetricRefinementOutputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainFinalSymmetricRefinementOutputs.lean @@ -1,628 +1,628 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralRefinementOutputs - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowSemanticSymmetricRefinementOutputHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed - ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → - ∀ tau : (M.nameDomain upperPres).names, - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode Q finalOrder - (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ - let U := ⋃₀ relationImage J (M.groundPower Q) f - (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ - ∃ beta ∈ K, - (∀ row B, ZFSet.pair row B ∈ U → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ - ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ - ∀ sigma A, ZFSet.pair sigma A ∈ f → - let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) - let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta - (graphRestriction beta packed) - A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, - ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ - (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} tau.val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} tau.val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ - (∀ count (degrees : Fin count → Nat) - (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - ∀ i, - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} (tau i).val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} (tau i).val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) - (a.principalSupportFamily ⊥ directed) (tau i).val) → - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ - (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ - ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ - refinementDataHistoryField K packed 0 ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - refinementDataHistoryIndices K packed ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) - (a.principalSupportFamily ⊥ directed) (tau i).val) → - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ - (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ - ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ - refinementDataHistoryField K packed 0 ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - refinementDataHistoryIndices K packed ∧ - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ - (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val - (normalized 2).val).val ∈ M.sets ∧ - ∃ outputGraphs : Fin 3 → ZFSet, - (∀ kind, outputGraphs kind ∈ M.sets) ∧ - ZFSet.pair beta (outputGraphs 2) ∈ refinementDataHistoryField K packed 12 ∧ - (∀ kind y, ZFSet.pair - (refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val) y ∈ - outputGraphs kind ↔ - y = (Name.refinementOutput kind lifted validT - (normalized 0).val (normalized 1).val (normalized 2).val).val) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - (∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - RefinementObjectValues {p | (projection.projectedFilter H).mem p} lifted validT - (normalized 0).val (normalized 1).val (normalized 2).val ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 2).val) ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val (normalized 2).val) = - refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val)) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) - (a.principalSupportFamily ⊥ directed) (tau i).val) → - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ - (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ - ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ - refinementDataHistoryField K packed 0 ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - refinementDataHistoryIndices K packed ∧ - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ - (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val - (normalized 2).val).val ∈ M.sets ∧ - ∃ outputGraphs : Fin 3 → ZFSet, - (∀ kind, outputGraphs kind ∈ M.sets) ∧ - ZFSet.pair beta (outputGraphs 2) ∈ refinementDataHistoryField K packed 12 ∧ - (∀ kind y, ZFSet.pair - (refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val) y ∈ - outputGraphs kind ↔ - y = (Name.refinementOutput kind lifted validT - (normalized 0).val (normalized 1).val (normalized 2).val).val) ∧ - let outputs := fun kind => Name.refinementOutput kind lifted validT - (normalized 0).val (normalized 1).val (normalized 2).val - let liftedOutputs := fun kind => Name.rename upper inc (outputs kind) - (∀ kind : Fin 3, - a.principalFix C ≤ lowerAct.stabilizer lower (outputs kind) ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) (outputs kind) ∧ - (liftedOutputs kind).val = (outputs kind).val ∧ - (liftedOutputs kind).val ∈ M.sets ∧ - a.principalFix C ≤ (upperAction).stabilizer upper (liftedOutputs kind) ∧ - HereditarilySymmetric upperAction upper (a.principalSupportFamily ⊥ directed) (liftedOutputs kind)) ∧ - (∀ (H : ConditionFilter (SetMembers Q)) (kind : Fin 3), - Name.eval {p | H.mem p} (liftedOutputs kind) = - Name.eval {p | (projection.projectedFilter H).mem p} (outputs kind) ∧ - Name.eval {p | (projection.projectedFilter H).mem p} (outputs kind) ∈ - (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - (∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - RefinementObjectValues {p | (projection.projectedFilter H).mem p} lifted validT - (normalized 0).val (normalized 1).val (normalized 2).val ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 2).val) ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val (normalized 2).val) = - refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val) ∧ - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) ∈ - (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets ∧ - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 2).val) ∈ - (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets ∧ - refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val) ∈ - (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralRefinementOutputHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have indexed := M.semanticStructuralTrace_symmetricRefinementOutputs c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory standard trace infinite choice rowSize liftedSize small rfl fulfilled.decoded_strict_growth - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.2.2.1, indexed, final.2.2.2.2.2.2.2.2.2.2.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralRefinementOutputs + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowSemanticSymmetricRefinementOutputHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed + ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → + ∀ tau : (M.nameDomain upperPres).names, + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode Q finalOrder + (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ + let U := ⋃₀ relationImage J (M.groundPower Q) f + (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ + ∃ beta ∈ K, + (∀ row B, ZFSet.pair row B ∈ U → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ + ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ + ∀ sigma A, ZFSet.pair sigma A ∈ f → + let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) + let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta + (graphRestriction beta packed) + A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, + ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ + (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} tau.val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} tau.val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ + (∀ count (degrees : Fin count → Nat) + (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + ∀ i, + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} (tau i).val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} (tau i).val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) + (a.principalSupportFamily ⊥ directed) (tau i).val) → + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ + (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ + ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ + refinementDataHistoryField K packed 0 ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + refinementDataHistoryIndices K packed ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) + (a.principalSupportFamily ⊥ directed) (tau i).val) → + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ + (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ + ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ + refinementDataHistoryField K packed 0 ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + refinementDataHistoryIndices K packed ∧ + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ + (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val + (normalized 2).val).val ∈ M.sets ∧ + ∃ outputGraphs : Fin 3 → ZFSet, + (∀ kind, outputGraphs kind ∈ M.sets) ∧ + ZFSet.pair beta (outputGraphs 2) ∈ refinementDataHistoryField K packed 12 ∧ + (∀ kind y, ZFSet.pair + (refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val) y ∈ + outputGraphs kind ↔ + y = (Name.refinementOutput kind lifted validT + (normalized 0).val (normalized 1).val (normalized 2).val).val) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + (∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + RefinementObjectValues {p | (projection.projectedFilter H).mem p} lifted validT + (normalized 0).val (normalized 1).val (normalized 2).val ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 2).val) ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val (normalized 2).val) = + refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val)) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) + (a.principalSupportFamily ⊥ directed) (tau i).val) → + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ + (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ + ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ + refinementDataHistoryField K packed 0 ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + refinementDataHistoryIndices K packed ∧ + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ + (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val + (normalized 2).val).val ∈ M.sets ∧ + ∃ outputGraphs : Fin 3 → ZFSet, + (∀ kind, outputGraphs kind ∈ M.sets) ∧ + ZFSet.pair beta (outputGraphs 2) ∈ refinementDataHistoryField K packed 12 ∧ + (∀ kind y, ZFSet.pair + (refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val) y ∈ + outputGraphs kind ↔ + y = (Name.refinementOutput kind lifted validT + (normalized 0).val (normalized 1).val (normalized 2).val).val) ∧ + let outputs := fun kind => Name.refinementOutput kind lifted validT + (normalized 0).val (normalized 1).val (normalized 2).val + let liftedOutputs := fun kind => Name.rename upper inc (outputs kind) + (∀ kind : Fin 3, + a.principalFix C ≤ lowerAct.stabilizer lower (outputs kind) ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) (outputs kind) ∧ + (liftedOutputs kind).val = (outputs kind).val ∧ + (liftedOutputs kind).val ∈ M.sets ∧ + a.principalFix C ≤ (upperAction).stabilizer upper (liftedOutputs kind) ∧ + HereditarilySymmetric upperAction upper (a.principalSupportFamily ⊥ directed) (liftedOutputs kind)) ∧ + (∀ (H : ConditionFilter (SetMembers Q)) (kind : Fin 3), + Name.eval {p | H.mem p} (liftedOutputs kind) = + Name.eval {p | (projection.projectedFilter H).mem p} (outputs kind) ∧ + Name.eval {p | (projection.projectedFilter H).mem p} (outputs kind) ∈ + (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + (∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + RefinementObjectValues {p | (projection.projectedFilter H).mem p} lifted validT + (normalized 0).val (normalized 1).val (normalized 2).val ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 2).val) ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val (normalized 2).val) = + refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val) ∧ + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) ∈ + (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets ∧ + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 2).val) ∈ + (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets ∧ + refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val) ∈ + (M.symmetricExtension upper upperAction (a.principalSupportFamily ⊥ directed) H).sets) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralRefinementOutputHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have indexed := M.semanticStructuralTrace_symmetricRefinementOutputs c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory standard trace infinite choice rowSize liftedSize small rfl fulfilled.decoded_strict_growth + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.2.2.1, indexed, final.2.2.2.2.2.2.2.2.2.2.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixInsertionFamilyTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixInsertionFamilyTransport.lean index 9aa1109c4a2e1f8abd3c23aba3ef62f94d55c370..213efb20b1e152856d815ee8d7817f28c2fe16ad 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixInsertionFamilyTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixInsertionFamilyTransport.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitGroupLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def finalInsertionCaps (j : I) (caps : ZFSet.{u}) : ZFSet.{u} := - relationCompose Labels (run.diagram.stage j).stage.carrier run.limitPoints caps (run.limitPointMap j) - -noncomputable def finalInsertionActors (j : I) (actors : ZFSet.{u}) : ZFSet.{u} := - relationCompose Labels (run.diagram.stage j).stage.actors run.limitActors actors (run.limitActorMap j) - -theorem finalInsertionCaps_ground (j : I) {caps : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hCaps : caps ∈ M.sets) : - run.finalInsertionCaps j caps ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hLabels - (run.diagram.stage j).stage.carrier_ground run.limitPoints_ground hCaps (run.limitPointMap_ground j) - -theorem finalInsertionActors_ground (j : I) {actors : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hActors : actors ∈ M.sets) : - run.finalInsertionActors j actors ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hLabels - (run.diagram.stage j).stage.actors_ground run.limitActors_ground hActors (run.limitActorMap_ground j) - -theorem finalInsertionCaps_injection (j : I) {caps : ZFSet.{u}} - (injection : InjectionCode Labels (run.diagram.stage j).stage.carrier caps) : - InjectionCode Labels run.limitPoints (run.finalInsertionCaps j caps) := - injection.compose (run.limitPointMap_injection j) - -theorem finalInsertionActors_injection (j : I) {actors : ZFSet.{u}} - (injection : InjectionCode Labels (run.diagram.stage j).stage.actors actors) : - InjectionCode Labels run.limitActors (run.finalInsertionActors j actors) := - injection.compose (run.limitActorMap_injection j) - -theorem finalInsertionCaps_entry (j : I) {caps label cap' : ZFSet.{u}} - (injection : InjectionCode Labels (run.diagram.stage j).stage.carrier caps) : - ZFSet.pair label cap' ∈ run.finalInsertionCaps j caps ↔ - ∃ cap, ZFSet.pair label cap ∈ caps ∧ ZFSet.pair cap cap' ∈ run.limitPointMap j := by - constructor - · intro entry - obtain ⟨_, _, cap, _, old, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - exact ⟨cap, old, image⟩ - · rintro ⟨cap, old, image⟩ - have oldBounds := ZFSet.pair_mem_prod.1 (injection.function.1 old) - have imageBounds := ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 image) - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨oldBounds.1, imageBounds.2, cap, oldBounds.2, old, image⟩ - -theorem finalInsertionActors_entry (j : I) {actors label actor' : ZFSet.{u}} - (injection : InjectionCode Labels (run.diagram.stage j).stage.actors actors) : - ZFSet.pair label actor' ∈ run.finalInsertionActors j actors ↔ - ∃ actor, ZFSet.pair label actor ∈ actors ∧ ZFSet.pair actor actor' ∈ run.limitActorMap j := by - constructor - · intro entry - obtain ⟨_, _, actor, _, old, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - exact ⟨actor, old, image⟩ - · rintro ⟨actor, old, image⟩ - have oldBounds := ZFSet.pair_mem_prod.1 (injection.function.1 old) - have imageBounds := ZFSet.pair_mem_prod.1 ((run.limitActorMap_injection j).function.1 image) - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨oldBounds.1, imageBounds.2, actor, oldBounds.2, old, image⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitGroupLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def finalInsertionCaps (j : I) (caps : ZFSet.{u}) : ZFSet.{u} := + relationCompose Labels (run.diagram.stage j).stage.carrier run.limitPoints caps (run.limitPointMap j) + +noncomputable def finalInsertionActors (j : I) (actors : ZFSet.{u}) : ZFSet.{u} := + relationCompose Labels (run.diagram.stage j).stage.actors run.limitActors actors (run.limitActorMap j) + +theorem finalInsertionCaps_ground (j : I) {caps : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hCaps : caps ∈ M.sets) : + run.finalInsertionCaps j caps ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hLabels + (run.diagram.stage j).stage.carrier_ground run.limitPoints_ground hCaps (run.limitPointMap_ground j) + +theorem finalInsertionActors_ground (j : I) {actors : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hActors : actors ∈ M.sets) : + run.finalInsertionActors j actors ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hLabels + (run.diagram.stage j).stage.actors_ground run.limitActors_ground hActors (run.limitActorMap_ground j) + +theorem finalInsertionCaps_injection (j : I) {caps : ZFSet.{u}} + (injection : InjectionCode Labels (run.diagram.stage j).stage.carrier caps) : + InjectionCode Labels run.limitPoints (run.finalInsertionCaps j caps) := + injection.compose (run.limitPointMap_injection j) + +theorem finalInsertionActors_injection (j : I) {actors : ZFSet.{u}} + (injection : InjectionCode Labels (run.diagram.stage j).stage.actors actors) : + InjectionCode Labels run.limitActors (run.finalInsertionActors j actors) := + injection.compose (run.limitActorMap_injection j) + +theorem finalInsertionCaps_entry (j : I) {caps label cap' : ZFSet.{u}} + (injection : InjectionCode Labels (run.diagram.stage j).stage.carrier caps) : + ZFSet.pair label cap' ∈ run.finalInsertionCaps j caps ↔ + ∃ cap, ZFSet.pair label cap ∈ caps ∧ ZFSet.pair cap cap' ∈ run.limitPointMap j := by + constructor + · intro entry + obtain ⟨_, _, cap, _, old, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + exact ⟨cap, old, image⟩ + · rintro ⟨cap, old, image⟩ + have oldBounds := ZFSet.pair_mem_prod.1 (injection.function.1 old) + have imageBounds := ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 image) + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨oldBounds.1, imageBounds.2, cap, oldBounds.2, old, image⟩ + +theorem finalInsertionActors_entry (j : I) {actors label actor' : ZFSet.{u}} + (injection : InjectionCode Labels (run.diagram.stage j).stage.actors actors) : + ZFSet.pair label actor' ∈ run.finalInsertionActors j actors ↔ + ∃ actor, ZFSet.pair label actor ∈ actors ∧ ZFSet.pair actor actor' ∈ run.limitActorMap j := by + constructor + · intro entry + obtain ⟨_, _, actor, _, old, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + exact ⟨actor, old, image⟩ + · rintro ⟨actor, old, image⟩ + have oldBounds := ZFSet.pair_mem_prod.1 (injection.function.1 old) + have imageBounds := ZFSet.pair_mem_prod.1 ((run.limitActorMap_injection j).function.1 image) + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨oldBounds.1, imageBounds.2, actor, oldBounds.2, old, image⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitActionLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitActionLaws.lean index a5c425b45fb691f98e9c3d87a0a543f3abac7e46..6ba076ec7eaeea5d4932fec2f2e30c79b0c73864 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitActionLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitActionLaws.lean @@ -1,262 +1,262 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedMixedOperationLifts -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitBottom - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -def LimitAct (g p q : ZFSet.{u}) : Prop := - ∃ i a x y, a ∈ (run.diagram.stage i).stage.actors ∧ - x ∈ (run.diagram.stage i).stage.carrier ∧ y ∈ (run.diagram.stage i).stage.carrier ∧ - g = run.actorPresentation.limitPoint i a ∧ p = run.pointPresentation.limitPoint i x ∧ - q = run.pointPresentation.limitPoint i y ∧ ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action - -theorem limitAct_bounds {g p q : ZFSet.{u}} (act : run.LimitAct g p q) : - g ∈ run.limitActors ∧ p ∈ run.limitPoints ∧ q ∈ run.limitPoints := by - obtain ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl, _⟩ := act - exact ⟨run.actorPresentation.limitPoint_mem ha, - run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy⟩ - -theorem limitAct_total {g p : ZFSet.{u}} (hg : g ∈ run.limitActors) (hp : p ∈ run.limitPoints) : - ∃ q ∈ run.limitPoints, run.LimitAct g p q := by - obtain ⟨i, a, x, ha, hx, rfl, rfl⟩ := run.actorPresentation.mixed_pair_coverage run.pointPresentation hg hp - obtain ⟨y, entry, _⟩ := (run.diagram.stage i).stage.action_code.function.2 - (ZFSet.pair a x) (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) - have hy := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 entry)).2 - exact ⟨run.pointPresentation.limitPoint i y, run.pointPresentation.limitPoint_mem hy, - i, a, x, y, ha, hx, hy, rfl, rfl, rfl, entry⟩ - -theorem limitAct_unique {g p q r : ZFSet.{u}} - (first : run.LimitAct g p q) (second : run.LimitAct g p r) : q = r := by - obtain ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl, act⟩ := first - obtain ⟨j, b, u, v, hb, hu, hv, equalActor, equalPoint, rfl, act'⟩ := second - obtain ⟨k, ik, jk⟩ := run.common_upper i j - obtain ⟨a', aa⟩ := run.actorSystem.map_entry_total ik ha - obtain ⟨b', bb⟩ := run.actorSystem.map_entry_total jk hb - obtain ⟨x', xx⟩ := run.pointSystem.map_entry_total ik hx - obtain ⟨u', uu⟩ := run.pointSystem.map_entry_total jk hu - obtain ⟨y', yy⟩ := run.pointSystem.map_entry_total ik hy - obtain ⟨v', vv⟩ := run.pointSystem.map_entry_total jk hv - have actorEqual := (run.actorSystem.related_iff_common_images ik jk aa bb).1 - ((run.actorPresentation.limitPoint_eq_iff_related ha hb).1 equalActor) - have pointEqual := (run.pointSystem.related_iff_common_images ik jk xx uu).1 - ((run.pointPresentation.limitPoint_eq_iff_related hx hu).1 equalPoint) - subst b' - subst u' - have left := (run.diagram.transition ik).map.equivariant a a' x y x' y' aa xx yy act - have right := (run.diagram.transition jk).map.equivariant b a' u v x' v' bb uu vv act' - have function : FunctionGraphOn - (ZFSet.prod (run.diagram.stage k).stage.actors (run.diagram.stage k).stage.carrier) - (run.diagram.stage k).stage.action := ⟨_, (run.diagram.stage k).stage.action_code.function⟩ - have equal := function.unique left right - exact (run.pointPresentation.limitPoint_transition ik yy).trans - ((congrArg (run.pointPresentation.limitPoint k) equal).trans - (run.pointPresentation.limitPoint_transition jk vv).symm) - -theorem limitAct_at (i : I) {a x y : ZFSet.{u}} - (ha : a ∈ (run.diagram.stage i).stage.actors) - (hx : x ∈ (run.diagram.stage i).stage.carrier) - (hy : y ∈ (run.diagram.stage i).stage.carrier) : - run.LimitAct (run.actorPresentation.limitPoint i a) - (run.pointPresentation.limitPoint i x) (run.pointPresentation.limitPoint i y) ↔ - ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action := by - constructor - · intro act - obtain ⟨z, entry, _⟩ := (run.diagram.stage i).stage.action_code.function.2 - (ZFSet.pair a x) (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) - have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 entry)).2 - have equal := (run.pointPresentation.limitPoint_same_iff hy hz).1 - (run.limitAct_unique act ⟨i, a, x, z, ha, hx, hz, rfl, rfl, rfl, entry⟩) - subst z - exact entry - · intro entry - exact ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl, entry⟩ - -theorem limitAct_monotone {g p q r s : ZFSet.{u}} - (first : run.LimitAct g p r) (second : run.LimitAct g q s) (lower : run.LimitLE p q) : - run.LimitLE r s := by - obtain ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl⟩ := - run.actorPresentation.mixed_triple_coverage run.pointPresentation run.pointPresentation - (run.limitAct_bounds first).1 (run.limitAct_bounds first).2.1 (run.limitAct_bounds second).2.1 - obtain ⟨z, left, _⟩ := (run.diagram.stage i).stage.action_code.function.2 - (ZFSet.pair a x) (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) - obtain ⟨w, right, _⟩ := (run.diagram.stage i).stage.action_code.function.2 - (ZFSet.pair a y) (ZFSet.pair_mem_prod.2 ⟨ha, hy⟩) - have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 left)).2 - have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 right)).2 - have er := run.limitAct_unique first ((run.limitAct_at i ha hx hz).2 left) - have es := run.limitAct_unique second ((run.limitAct_at i ha hy hw).2 right) - rw [er, es] - exact (run.limitLE_at i hz hw).2 ((run.diagram.stage i).stage.action_code.monotone - a ha x hx y hy z hz w hw left right ((run.limitLE_at i hx hy).1 lower)) - -noncomputable def limitAction : ZFSet.{u} := - indexedMixedBinaryLift run.indices run.actorUnion run.carrierUnion run.limitActors run.limitPoints - (run.stageFieldFamily 7) run.limitActorInclusions run.limitPointInclusions - -theorem limitAction_ground : run.limitAction ∈ M.sets := - M.indexedMixedBinaryLift_mem pairing unions powers separation run.indices_ground - run.actorUnion_ground run.carrierUnion_ground run.limitActors_ground run.limitPoints_ground - (run.stageFieldFamily_ground 7) run.limitActorInclusions_ground run.limitPointInclusions_ground - -theorem limitAction_entry (g p q : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction ↔ run.LimitAct g p q := by - rw [limitAction, triple_mem_indexedMixedBinaryLift] - constructor - · rintro ⟨_, _, _, k, hk, a, eG, eP, u, _, x, _, y, _, - action, actors, points, actor, first, second, source⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk - have ea : a = (run.diagram.stage i).stage.action := (run.stageFieldFamily_entry 7 i a).1 action - have eg := (run.limitActorInclusions_entry i eG).1 actors - have ep := (run.limitPointInclusions_entry i eP).1 points - subst a - subst eG - subst eP - obtain ⟨hu, equalG⟩ := (run.actorPresentation.inclusion_entry i u g).1 actor - obtain ⟨hx, equalP⟩ := (run.pointPresentation.inclusion_entry i x p).1 first - obtain ⟨hy, equalQ⟩ := (run.pointPresentation.inclusion_entry i y q).1 second - exact ⟨i, u, x, y, hu, hx, hy, equalG, equalP, equalQ, source⟩ - · rintro ⟨i, u, x, y, hu, hx, hy, rfl, rfl, rfl, source⟩ - exact ⟨run.actorPresentation.limitPoint_mem hu, run.pointPresentation.limitPoint_mem hx, - run.pointPresentation.limitPoint_mem hy, run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, - (run.diagram.stage i).stage.action, run.limitActorMap i, run.limitPointMap i, - u, run.actorPresentation.carrier_bound i hu, x, run.pointPresentation.carrier_bound i hx, - y, run.pointPresentation.carrier_bound i hy, - (run.stageFieldFamily_entry 7 i _).2 rfl, (run.limitActorInclusions_entry i _).2 rfl, - (run.limitPointInclusions_entry i _).2 rfl, - (run.actorPresentation.inclusion_entry i u _).2 ⟨hu, rfl⟩, - (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, - (run.pointPresentation.inclusion_entry i y _).2 ⟨hy, rfl⟩, source⟩ - -theorem limitAction_function : - ZFSet.IsFunc (ZFSet.prod run.limitActors run.limitPoints) run.limitPoints run.limitAction := by - refine ⟨indexedMixedBinaryLift_subset _ _ _ _ _ _ _ _, ?_⟩ - intro w hw - obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hw - obtain ⟨q, _, action⟩ := run.limitAct_total hg hp - refine ⟨q, (run.limitAction_entry g p q).2 action, ?_⟩ - intro q' entry - exact run.limitAct_unique ((run.limitAction_entry g p q').1 entry) action - -theorem limitAction_at (i : I) {a x y : ZFSet.{u}} - (ha : a ∈ (run.diagram.stage i).stage.actors) - (hx : x ∈ (run.diagram.stage i).stage.carrier) - (hy : y ∈ (run.diagram.stage i).stage.carrier) : - ZFSet.pair (ZFSet.pair (run.actorPresentation.limitPoint i a) - (run.pointPresentation.limitPoint i x)) (run.pointPresentation.limitPoint i y) ∈ run.limitAction ↔ - ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action := - (run.limitAction_entry _ _ _).trans (run.limitAct_at i ha hx hy) - -theorem limitMaps_action_iff (i : I) (a g x y p q : ZFSet.{u}) - (actor : ZFSet.pair a g ∈ run.limitActorMap i) - (first : ZFSet.pair x p ∈ run.limitPointMap i) - (second : ZFSet.pair y q ∈ run.limitPointMap i) : - ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction ↔ - ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action := by - obtain ⟨ha, rfl⟩ := (run.actorPresentation.inclusion_entry i a g).1 actor - obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x p).1 first - obtain ⟨hy, rfl⟩ := (run.pointPresentation.inclusion_entry i y q).1 second - exact run.limitAction_at i ha hx hy - -theorem limitMaps_equivariant (i : I) (a g x y p q : ZFSet.{u}) - (actor : ZFSet.pair a g ∈ run.limitActorMap i) - (first : ZFSet.pair x p ∈ run.limitPointMap i) - (second : ZFSet.pair y q ∈ run.limitPointMap i) - (action : ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action) : - ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction := - (run.limitMaps_action_iff i a g x y p q actor first second).2 action - -theorem limitAction_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitAction < o := - indexedMixedBinaryLift_rank_lt limit _ _ _ _ _ _ - (run.limitActors_rank_lt limit rank) (run.limitPoints_rank_lt limit rank) - -theorem limitMaps_agreement (i : I) (g h g' h' v v' : ZFSet.{u}) - (first : ZFSet.pair g g' ∈ run.limitActorMap i) - (second : ZFSet.pair h h' ∈ run.limitActorMap i) - (point : ZFSet.pair v v' ∈ run.limitPointMap i) - (agree : ActionAgreementBelow (run.diagram.stage i).stage.carrier - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.action g h v) : - ActionAgreementBelow run.limitPoints run.limitOrder run.limitAction g' h' v' := by - obtain ⟨hg, rfl⟩ := (run.actorPresentation.inclusion_entry i g g').1 first - obtain ⟨hh, rfl⟩ := (run.actorPresentation.inclusion_entry i h h').1 second - obtain ⟨hv, rfl⟩ := (run.pointPresentation.inclusion_entry i v v').1 point - intro x hx y hy lower - obtain ⟨j, a, b, ha, hb, rfl, rfl⟩ := run.pointPresentation.pair_coverage hx hy - obtain ⟨k, ik, jk⟩ := run.common_upper i j - obtain ⟨G, gG⟩ := run.actorSystem.map_entry_total ik hg - obtain ⟨H, hH⟩ := run.actorSystem.map_entry_total ik hh - obtain ⟨V, vV⟩ := run.pointSystem.map_entry_total ik hv - obtain ⟨A, aA⟩ := run.pointSystem.map_entry_total jk ha - obtain ⟨B, bB⟩ := run.pointSystem.map_entry_total jk hb - have hG := (run.actorSystem.map_entry_bounds ik gG).2 - have Hmem := (run.actorSystem.map_entry_bounds ik hH).2 - have hV := (run.pointSystem.map_entry_bounds ik vV).2 - have hA := (run.pointSystem.map_entry_bounds jk aA).2 - have hB := (run.pointSystem.map_entry_bounds jk bB).2 - have equalA := run.pointPresentation.limitPoint_transition jk aA - have equalV := run.pointPresentation.limitPoint_transition ik vV - rw [equalA, equalV] at lower - have sourceLower := (run.limitLE_at k hA hV).1 ((run.limitOrder_entry _ _).1 lower) - have later := (run.diagram.transition ik).map.agreement g h G H v V gG hH vV agree - rw [run.actorPresentation.limitPoint_transition ik gG, - run.actorPresentation.limitPoint_transition ik hH, - equalA, run.pointPresentation.limitPoint_transition jk bB] - exact (run.limitAction_at k hG hA hB).trans - ((later A hA B hB sourceLower).trans (run.limitAction_at k Hmem hA hB).symm) - -theorem limitAct_mul {g h k p q r : ZFSet.{u}} - (product : run.LimitMul g h k) (first : run.LimitAct h p q) (second : run.LimitAct g q r) : - run.LimitAct k p r := by - obtain ⟨i, a, b, x, ha, hb, hx, rfl, rfl, rfl⟩ := - run.actorPresentation.mixed_triple_coverage run.actorPresentation run.pointPresentation - (run.limitMul_bounds product).1 (run.limitMul_bounds product).2.1 (run.limitAct_bounds first).2.1 - obtain ⟨c, mul, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 - (ZFSet.pair a b) (ZFSet.pair_mem_prod.2 ⟨ha, hb⟩) - have hc := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 mul)).2 - obtain ⟨y, left, _⟩ := (run.diagram.stage i).stage.action_code.function.2 - (ZFSet.pair b x) (ZFSet.pair_mem_prod.2 ⟨hb, hx⟩) - have hy := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 left)).2 - obtain ⟨z, right, _⟩ := (run.diagram.stage i).stage.action_code.function.2 - (ZFSet.pair a y) (ZFSet.pair_mem_prod.2 ⟨ha, hy⟩) - have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 right)).2 - have ek := run.limitMul_unique product ((run.limitMul_at i ha hb hc).2 mul) - have eq := run.limitAct_unique first ((run.limitAct_at i hb hx hy).2 left) - rw [eq] at second - have er := run.limitAct_unique second ((run.limitAct_at i ha hy hz).2 right) - rw [ek, er] - exact (run.limitAct_at i hc hx hz).2 - ((run.diagram.stage i).stage.action_code.mul a ha b hb c hc x hx y hy z hz mul left right) - -theorem limitAction_one (i₀ : I) (p : ZFSet.{u}) (hp : p ∈ run.limitPoints) : - ZFSet.pair (ZFSet.pair (run.limitIdentity i₀) p) p ∈ run.limitAction := by - obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage hp - rw [run.limitIdentity_eq i₀ i] - exact (run.limitAction_at i (run.diagram.stage i).stage.group_code.identity_mem hx hx).2 - ((run.diagram.stage i).stage.action_code.one x hx) - -theorem limitAction_code (i₀ : I) : - PosetActionCode run.limitActors run.limitPoints run.limitMultiplication - (run.limitIdentity i₀) run.limitOrder run.limitAction where - function := run.limitAction_function - one := run.limitAction_one i₀ - mul g _ h _ k _ p _ q _ r _ product first second := - (run.limitAction_entry k p r).2 (run.limitAct_mul - ((run.limitMultiplication_entry g h k).1 product) - ((run.limitAction_entry h p q).1 first) ((run.limitAction_entry g q r).1 second)) - monotone g _ p _ q _ r _ s _ first second lower := - (run.limitOrder_entry r s).2 (run.limitAct_monotone - ((run.limitAction_entry g p r).1 first) ((run.limitAction_entry g q s).1 second) - ((run.limitOrder_entry p q).1 lower)) - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedMixedOperationLifts +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitBottom + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +def LimitAct (g p q : ZFSet.{u}) : Prop := + ∃ i a x y, a ∈ (run.diagram.stage i).stage.actors ∧ + x ∈ (run.diagram.stage i).stage.carrier ∧ y ∈ (run.diagram.stage i).stage.carrier ∧ + g = run.actorPresentation.limitPoint i a ∧ p = run.pointPresentation.limitPoint i x ∧ + q = run.pointPresentation.limitPoint i y ∧ ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action + +theorem limitAct_bounds {g p q : ZFSet.{u}} (act : run.LimitAct g p q) : + g ∈ run.limitActors ∧ p ∈ run.limitPoints ∧ q ∈ run.limitPoints := by + obtain ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl, _⟩ := act + exact ⟨run.actorPresentation.limitPoint_mem ha, + run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy⟩ + +theorem limitAct_total {g p : ZFSet.{u}} (hg : g ∈ run.limitActors) (hp : p ∈ run.limitPoints) : + ∃ q ∈ run.limitPoints, run.LimitAct g p q := by + obtain ⟨i, a, x, ha, hx, rfl, rfl⟩ := run.actorPresentation.mixed_pair_coverage run.pointPresentation hg hp + obtain ⟨y, entry, _⟩ := (run.diagram.stage i).stage.action_code.function.2 + (ZFSet.pair a x) (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) + have hy := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 entry)).2 + exact ⟨run.pointPresentation.limitPoint i y, run.pointPresentation.limitPoint_mem hy, + i, a, x, y, ha, hx, hy, rfl, rfl, rfl, entry⟩ + +theorem limitAct_unique {g p q r : ZFSet.{u}} + (first : run.LimitAct g p q) (second : run.LimitAct g p r) : q = r := by + obtain ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl, act⟩ := first + obtain ⟨j, b, u, v, hb, hu, hv, equalActor, equalPoint, rfl, act'⟩ := second + obtain ⟨k, ik, jk⟩ := run.common_upper i j + obtain ⟨a', aa⟩ := run.actorSystem.map_entry_total ik ha + obtain ⟨b', bb⟩ := run.actorSystem.map_entry_total jk hb + obtain ⟨x', xx⟩ := run.pointSystem.map_entry_total ik hx + obtain ⟨u', uu⟩ := run.pointSystem.map_entry_total jk hu + obtain ⟨y', yy⟩ := run.pointSystem.map_entry_total ik hy + obtain ⟨v', vv⟩ := run.pointSystem.map_entry_total jk hv + have actorEqual := (run.actorSystem.related_iff_common_images ik jk aa bb).1 + ((run.actorPresentation.limitPoint_eq_iff_related ha hb).1 equalActor) + have pointEqual := (run.pointSystem.related_iff_common_images ik jk xx uu).1 + ((run.pointPresentation.limitPoint_eq_iff_related hx hu).1 equalPoint) + subst b' + subst u' + have left := (run.diagram.transition ik).map.equivariant a a' x y x' y' aa xx yy act + have right := (run.diagram.transition jk).map.equivariant b a' u v x' v' bb uu vv act' + have function : FunctionGraphOn + (ZFSet.prod (run.diagram.stage k).stage.actors (run.diagram.stage k).stage.carrier) + (run.diagram.stage k).stage.action := ⟨_, (run.diagram.stage k).stage.action_code.function⟩ + have equal := function.unique left right + exact (run.pointPresentation.limitPoint_transition ik yy).trans + ((congrArg (run.pointPresentation.limitPoint k) equal).trans + (run.pointPresentation.limitPoint_transition jk vv).symm) + +theorem limitAct_at (i : I) {a x y : ZFSet.{u}} + (ha : a ∈ (run.diagram.stage i).stage.actors) + (hx : x ∈ (run.diagram.stage i).stage.carrier) + (hy : y ∈ (run.diagram.stage i).stage.carrier) : + run.LimitAct (run.actorPresentation.limitPoint i a) + (run.pointPresentation.limitPoint i x) (run.pointPresentation.limitPoint i y) ↔ + ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action := by + constructor + · intro act + obtain ⟨z, entry, _⟩ := (run.diagram.stage i).stage.action_code.function.2 + (ZFSet.pair a x) (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) + have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 entry)).2 + have equal := (run.pointPresentation.limitPoint_same_iff hy hz).1 + (run.limitAct_unique act ⟨i, a, x, z, ha, hx, hz, rfl, rfl, rfl, entry⟩) + subst z + exact entry + · intro entry + exact ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl, entry⟩ + +theorem limitAct_monotone {g p q r s : ZFSet.{u}} + (first : run.LimitAct g p r) (second : run.LimitAct g q s) (lower : run.LimitLE p q) : + run.LimitLE r s := by + obtain ⟨i, a, x, y, ha, hx, hy, rfl, rfl, rfl⟩ := + run.actorPresentation.mixed_triple_coverage run.pointPresentation run.pointPresentation + (run.limitAct_bounds first).1 (run.limitAct_bounds first).2.1 (run.limitAct_bounds second).2.1 + obtain ⟨z, left, _⟩ := (run.diagram.stage i).stage.action_code.function.2 + (ZFSet.pair a x) (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) + obtain ⟨w, right, _⟩ := (run.diagram.stage i).stage.action_code.function.2 + (ZFSet.pair a y) (ZFSet.pair_mem_prod.2 ⟨ha, hy⟩) + have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 left)).2 + have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 right)).2 + have er := run.limitAct_unique first ((run.limitAct_at i ha hx hz).2 left) + have es := run.limitAct_unique second ((run.limitAct_at i ha hy hw).2 right) + rw [er, es] + exact (run.limitLE_at i hz hw).2 ((run.diagram.stage i).stage.action_code.monotone + a ha x hx y hy z hz w hw left right ((run.limitLE_at i hx hy).1 lower)) + +noncomputable def limitAction : ZFSet.{u} := + indexedMixedBinaryLift run.indices run.actorUnion run.carrierUnion run.limitActors run.limitPoints + (run.stageFieldFamily 7) run.limitActorInclusions run.limitPointInclusions + +theorem limitAction_ground : run.limitAction ∈ M.sets := + M.indexedMixedBinaryLift_mem pairing unions powers separation run.indices_ground + run.actorUnion_ground run.carrierUnion_ground run.limitActors_ground run.limitPoints_ground + (run.stageFieldFamily_ground 7) run.limitActorInclusions_ground run.limitPointInclusions_ground + +theorem limitAction_entry (g p q : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction ↔ run.LimitAct g p q := by + rw [limitAction, triple_mem_indexedMixedBinaryLift] + constructor + · rintro ⟨_, _, _, k, hk, a, eG, eP, u, _, x, _, y, _, + action, actors, points, actor, first, second, source⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk + have ea : a = (run.diagram.stage i).stage.action := (run.stageFieldFamily_entry 7 i a).1 action + have eg := (run.limitActorInclusions_entry i eG).1 actors + have ep := (run.limitPointInclusions_entry i eP).1 points + subst a + subst eG + subst eP + obtain ⟨hu, equalG⟩ := (run.actorPresentation.inclusion_entry i u g).1 actor + obtain ⟨hx, equalP⟩ := (run.pointPresentation.inclusion_entry i x p).1 first + obtain ⟨hy, equalQ⟩ := (run.pointPresentation.inclusion_entry i y q).1 second + exact ⟨i, u, x, y, hu, hx, hy, equalG, equalP, equalQ, source⟩ + · rintro ⟨i, u, x, y, hu, hx, hy, rfl, rfl, rfl, source⟩ + exact ⟨run.actorPresentation.limitPoint_mem hu, run.pointPresentation.limitPoint_mem hx, + run.pointPresentation.limitPoint_mem hy, run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, + (run.diagram.stage i).stage.action, run.limitActorMap i, run.limitPointMap i, + u, run.actorPresentation.carrier_bound i hu, x, run.pointPresentation.carrier_bound i hx, + y, run.pointPresentation.carrier_bound i hy, + (run.stageFieldFamily_entry 7 i _).2 rfl, (run.limitActorInclusions_entry i _).2 rfl, + (run.limitPointInclusions_entry i _).2 rfl, + (run.actorPresentation.inclusion_entry i u _).2 ⟨hu, rfl⟩, + (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, + (run.pointPresentation.inclusion_entry i y _).2 ⟨hy, rfl⟩, source⟩ + +theorem limitAction_function : + ZFSet.IsFunc (ZFSet.prod run.limitActors run.limitPoints) run.limitPoints run.limitAction := by + refine ⟨indexedMixedBinaryLift_subset _ _ _ _ _ _ _ _, ?_⟩ + intro w hw + obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hw + obtain ⟨q, _, action⟩ := run.limitAct_total hg hp + refine ⟨q, (run.limitAction_entry g p q).2 action, ?_⟩ + intro q' entry + exact run.limitAct_unique ((run.limitAction_entry g p q').1 entry) action + +theorem limitAction_at (i : I) {a x y : ZFSet.{u}} + (ha : a ∈ (run.diagram.stage i).stage.actors) + (hx : x ∈ (run.diagram.stage i).stage.carrier) + (hy : y ∈ (run.diagram.stage i).stage.carrier) : + ZFSet.pair (ZFSet.pair (run.actorPresentation.limitPoint i a) + (run.pointPresentation.limitPoint i x)) (run.pointPresentation.limitPoint i y) ∈ run.limitAction ↔ + ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action := + (run.limitAction_entry _ _ _).trans (run.limitAct_at i ha hx hy) + +theorem limitMaps_action_iff (i : I) (a g x y p q : ZFSet.{u}) + (actor : ZFSet.pair a g ∈ run.limitActorMap i) + (first : ZFSet.pair x p ∈ run.limitPointMap i) + (second : ZFSet.pair y q ∈ run.limitPointMap i) : + ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction ↔ + ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action := by + obtain ⟨ha, rfl⟩ := (run.actorPresentation.inclusion_entry i a g).1 actor + obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x p).1 first + obtain ⟨hy, rfl⟩ := (run.pointPresentation.inclusion_entry i y q).1 second + exact run.limitAction_at i ha hx hy + +theorem limitMaps_equivariant (i : I) (a g x y p q : ZFSet.{u}) + (actor : ZFSet.pair a g ∈ run.limitActorMap i) + (first : ZFSet.pair x p ∈ run.limitPointMap i) + (second : ZFSet.pair y q ∈ run.limitPointMap i) + (action : ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action) : + ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction := + (run.limitMaps_action_iff i a g x y p q actor first second).2 action + +theorem limitAction_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitAction < o := + indexedMixedBinaryLift_rank_lt limit _ _ _ _ _ _ + (run.limitActors_rank_lt limit rank) (run.limitPoints_rank_lt limit rank) + +theorem limitMaps_agreement (i : I) (g h g' h' v v' : ZFSet.{u}) + (first : ZFSet.pair g g' ∈ run.limitActorMap i) + (second : ZFSet.pair h h' ∈ run.limitActorMap i) + (point : ZFSet.pair v v' ∈ run.limitPointMap i) + (agree : ActionAgreementBelow (run.diagram.stage i).stage.carrier + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.action g h v) : + ActionAgreementBelow run.limitPoints run.limitOrder run.limitAction g' h' v' := by + obtain ⟨hg, rfl⟩ := (run.actorPresentation.inclusion_entry i g g').1 first + obtain ⟨hh, rfl⟩ := (run.actorPresentation.inclusion_entry i h h').1 second + obtain ⟨hv, rfl⟩ := (run.pointPresentation.inclusion_entry i v v').1 point + intro x hx y hy lower + obtain ⟨j, a, b, ha, hb, rfl, rfl⟩ := run.pointPresentation.pair_coverage hx hy + obtain ⟨k, ik, jk⟩ := run.common_upper i j + obtain ⟨G, gG⟩ := run.actorSystem.map_entry_total ik hg + obtain ⟨H, hH⟩ := run.actorSystem.map_entry_total ik hh + obtain ⟨V, vV⟩ := run.pointSystem.map_entry_total ik hv + obtain ⟨A, aA⟩ := run.pointSystem.map_entry_total jk ha + obtain ⟨B, bB⟩ := run.pointSystem.map_entry_total jk hb + have hG := (run.actorSystem.map_entry_bounds ik gG).2 + have Hmem := (run.actorSystem.map_entry_bounds ik hH).2 + have hV := (run.pointSystem.map_entry_bounds ik vV).2 + have hA := (run.pointSystem.map_entry_bounds jk aA).2 + have hB := (run.pointSystem.map_entry_bounds jk bB).2 + have equalA := run.pointPresentation.limitPoint_transition jk aA + have equalV := run.pointPresentation.limitPoint_transition ik vV + rw [equalA, equalV] at lower + have sourceLower := (run.limitLE_at k hA hV).1 ((run.limitOrder_entry _ _).1 lower) + have later := (run.diagram.transition ik).map.agreement g h G H v V gG hH vV agree + rw [run.actorPresentation.limitPoint_transition ik gG, + run.actorPresentation.limitPoint_transition ik hH, + equalA, run.pointPresentation.limitPoint_transition jk bB] + exact (run.limitAction_at k hG hA hB).trans + ((later A hA B hB sourceLower).trans (run.limitAction_at k Hmem hA hB).symm) + +theorem limitAct_mul {g h k p q r : ZFSet.{u}} + (product : run.LimitMul g h k) (first : run.LimitAct h p q) (second : run.LimitAct g q r) : + run.LimitAct k p r := by + obtain ⟨i, a, b, x, ha, hb, hx, rfl, rfl, rfl⟩ := + run.actorPresentation.mixed_triple_coverage run.actorPresentation run.pointPresentation + (run.limitMul_bounds product).1 (run.limitMul_bounds product).2.1 (run.limitAct_bounds first).2.1 + obtain ⟨c, mul, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 + (ZFSet.pair a b) (ZFSet.pair_mem_prod.2 ⟨ha, hb⟩) + have hc := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 mul)).2 + obtain ⟨y, left, _⟩ := (run.diagram.stage i).stage.action_code.function.2 + (ZFSet.pair b x) (ZFSet.pair_mem_prod.2 ⟨hb, hx⟩) + have hy := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 left)).2 + obtain ⟨z, right, _⟩ := (run.diagram.stage i).stage.action_code.function.2 + (ZFSet.pair a y) (ZFSet.pair_mem_prod.2 ⟨ha, hy⟩) + have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.action_code.function.1 right)).2 + have ek := run.limitMul_unique product ((run.limitMul_at i ha hb hc).2 mul) + have eq := run.limitAct_unique first ((run.limitAct_at i hb hx hy).2 left) + rw [eq] at second + have er := run.limitAct_unique second ((run.limitAct_at i ha hy hz).2 right) + rw [ek, er] + exact (run.limitAct_at i hc hx hz).2 + ((run.diagram.stage i).stage.action_code.mul a ha b hb c hc x hx y hy z hz mul left right) + +theorem limitAction_one (i₀ : I) (p : ZFSet.{u}) (hp : p ∈ run.limitPoints) : + ZFSet.pair (ZFSet.pair (run.limitIdentity i₀) p) p ∈ run.limitAction := by + obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage hp + rw [run.limitIdentity_eq i₀ i] + exact (run.limitAction_at i (run.diagram.stage i).stage.group_code.identity_mem hx hx).2 + ((run.diagram.stage i).stage.action_code.one x hx) + +theorem limitAction_code (i₀ : I) : + PosetActionCode run.limitActors run.limitPoints run.limitMultiplication + (run.limitIdentity i₀) run.limitOrder run.limitAction where + function := run.limitAction_function + one := run.limitAction_one i₀ + mul g _ h _ k _ p _ q _ r _ product first second := + (run.limitAction_entry k p r).2 (run.limitAct_mul + ((run.limitMultiplication_entry g h k).1 product) + ((run.limitAction_entry h p q).1 first) ((run.limitAction_entry g q r).1 second)) + monotone g _ p _ q _ r _ s _ first second lower := + (run.limitOrder_entry r s).2 (run.limitAct_monotone + ((run.limitAction_entry g p r).1 first) ((run.limitAction_entry g q s).1 second) + ((run.limitOrder_entry p q).1 lower)) + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitLayerWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitLayerWitnesses.lean index cde0510204a4bcc25dbbf2aee38f9609284371d1..914c1a7728a3eefda47bfae940fc3c9572b9f3a7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitLayerWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixLimitLayerWitnesses.lean @@ -1,249 +1,249 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLayerSourceCongruence -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitChronologyCore - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem familyPointBound_rank_le (Qs : ZFSet.{u}) : - ZFSet.rank (familyPointBound Qs) ≤ ZFSet.rank Qs := - (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) - -namespace CountableLayerCode - -theorem ground_pushforward_rank_lt - {M : TransitiveGround.{u}} {A B old born t D N injection e : ZFSet.{u}} - (code : CountableLayerCode A old t D N injection) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) (he : e ∈ M.sets) - (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) - (embedding : InjectionCode A B e) - (preserves : ∀ x y a, ZFSet.pair x y ∈ e → - (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) - (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : - ∃ D' ∈ M.sets, ∃ injection' ∈ M.sets, CountableLayerCode B born t D' N injection' ∧ - ZFSet.rank D' < o ∧ ZFSet.rank injection' < o := by - obtain ⟨E, hE, f, hf, copied⟩ := code.ground_pushforward pairing unions powers separation - hA hB hN he hD hInjection embedding preserves noNew - let D' := ZFSet.sep (fun x => x ∈ B) E - let f' := ZFSet.sep (fun z => z ∈ ZFSet.prod D' N) f - have hD' : D' ∈ M.sets := M.bounded_separation_mem separation (.mem 0 1) - (extend B Fin.elim0) (Fin.cases hB (fun i => Fin.elim0 i)) hE - have hf' : f' ∈ M.sets := M.injection_restriction_mem separation hD' hN hf - have injected : InjectionCode D' N f' := - copied.small.restrict (fun _ hx => (ZFSet.mem_sep.1 hx).1) - have rankD : ZFSet.rank D' < o := - (ZFSet.rank_mono (show D' ⊆ B from fun _ hx => (ZFSet.mem_sep.1 hx).2)).trans_lt target - refine ⟨D', hD', f', hf', ⟨injected, ?_⟩, rankD, - rank_functionGraph_lt limit injected.function rankD numbers⟩ - intro x hx entry - exact ZFSet.mem_sep.2 ⟨copied.cover x hx entry, hx⟩ -end CountableLayerCode - -namespace GrowthLayerWitnessCode - -theorem ground_pushforward_rank_lt - {M : TransitiveGround.{u}} {Qs rs μs A B rA rB μA μB old born t N z e : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) - (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) - (sourceGraphs : ZFSet.rank Qs < o) (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) - (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) - (preserves : ∀ x y a, ZFSet.pair x y ∈ e → - (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) - (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' ∧ - ZFSet.rank z' < o := by - have rankU := (familyPointBound_rank_le Qs).trans_lt sourceGraphs - have rankW := M.groundRelations_rank_lt limit rankU target - rcases code with ⟨D, injection, rfl, code⟩ | - ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | - ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ - · have fields := M.nonemptyTupleCode_field_mem 2 _ hz - obtain ⟨D', hD', injection', hInjection', copied, rankD, rankInjection⟩ := - code.ground_pushforward_rank_lt pairing unions powers separation hA hB hN he - (fields 1) (fields 2) limit target numbers embedding.injection preserves noNew - exact ⟨countableLayerWitness D' injection', M.countableLayerWitness_mem pairing hD' hInjection', - Or.inl ⟨D', injection', rfl, copied⟩, - countableLayerWitness_rank_lt limit rankD rankInjection⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ hz - have ranks := fun j => (rank_nonemptyTupleCode_field_le 6 _ j).trans_lt rank - obtain ⟨hMaps', hW', hParts', copied⟩ := code.ground_pushforward - pairing unions powers separation hA hB he hQs (fields 1) (fields 2) (fields 4) - embedding preserves noNew - have rankMaps := rank_functionGraph_lt limit copied.maps (ranks 1) rankW - have rankParts : ZFSet.rank (relationCompose I A B parts e) < o := - (ZFSet.rank_mono (show relationCompose I A B parts e ⊆ ZFSet.prod I B from - fun _ hx => (ZFSet.mem_sep.1 hx).1)).trans_lt (rank_product_lt limit (ranks 1) target) - exact ⟨copyLayerWitness I (relationCompose I A B parts e) Indices - (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) - (M.groundRelations (familyPointBound Qs) B) injection, - M.copyLayerWitness_mem pairing unions (fields 1) hParts' (fields 3) hMaps' hW' (fields 6), - Or.inr (Or.inl ⟨I, _, Indices, _, _, injection, rfl, copied⟩), - copyLayerWitness_rank_lt limit (ranks 1) rankParts (ranks 3) rankMaps rankW (ranks 6)⟩ - · have fields := M.nonemptyTupleCode_field_mem 6 _ hz - have ranks := fun j => (rank_nonemptyTupleCode_field_le 6 _ j).trans_lt rank - obtain ⟨hMaps', hW', hComponents', hF', copied⟩ := code.ground_pushforward - pairing unions powers separation hA hB he hQs (fields 1) (fields 3) (fields 5) (fields 6) - source embedding preserves noNew - have rankMaps := rank_functionGraph_lt limit copied.maps (ranks 1) rankW - have rankF : ZFSet.rank (relationImage F B (layerFiberEmbedding F B e)) < o := - (ZFSet.rank_mono (show relationImage F B (layerFiberEmbedding F B e) ⊆ B from - fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1)).trans_lt target - have rankComponents := rank_functionGraph_lt limit copied.components rankF (ranks 1) - exact ⟨separatedLayerWitness I Indices - (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) - (M.groundRelations (familyPointBound Qs) B) - (pushedHeightGraph F B I (layerFiberEmbedding F B e) Components) - (relationImage F B (layerFiberEmbedding F B e)), - M.separatedLayerWitness_mem pairing unions (fields 1) (fields 2) hMaps' hW' hComponents' hF', - Or.inr (Or.inr ⟨I, Indices, _, _, _, _, rfl, copied⟩), - separatedLayerWitness_rank_lt limit (ranks 1) (ranks 2) rankMaps rankW rankComponents rankF⟩ - -end GrowthLayerWitnessCode - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 -include births data group action pairing unions powers separation infinite hG hP0 - -theorem ranked_rawPriorWitness {Qs rs μs t N z : ZFSet.{u}} - (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) oldBirth t N z) - (oldTime : t ∈ oldTimes ∨ t = oldTimes) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank z < o) (sourceGraphs : ZFSet.rank Qs < o) - (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) : - ∃ z' ∈ M.sets, ZFSet.rank z' < o ∧ GrowthLayerWitnessCode Qs rs μs B - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) - births.birth t N z' := by - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG - obtain ⟨z', hz', code', rank'⟩ := code.ground_pushforward_rank_lt pairing unions powers separation - (completion.algebra.union.ground 0) geometry.carrier_ground - (geometry.copies_ground _ data.group.group_code.identity_mem) hQs hN hz - limit rank sourceGraphs target numbers completion.algebra.union.meet embedding.toMeetEmbeddingCode - (fun x y a copied => births.preserves_seed x y a copied) - (fun _ _ entry => births.priorFiber_image oldTime entry) - exact ⟨z', hz', rank', code'⟩ - -theorem ranked_rawCutoffPriorWitness {Qs rs μs t N z : ZFSet.{u}} - (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) oldBirth t N z) - (oldTime : t ∈ oldTimes ∨ t = oldTimes) (n : Nat) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) - (sourceGraphs : ZFSet.rank Qs < o) (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) : - ∃ z' ∈ M.sets, ZFSet.rank z' < o ∧ GrowthLayerWitnessCode Qs rs μs (births.cutoff n) - (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t N z' := by - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG - have contained : ∀ x y, ZFSet.pair x y ∈ E → y ∈ births.cutoff n := by - intro x y copied - have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) - exact births.cutoff_old n ((mem_relationImage U B E y).2 ⟨bounds.2, x, bounds.1, copied⟩) - have restricted := embedding.toMeetEmbeddingCode.restrictTarget (Q := births.cutoff n) contained - have family := births.cutoffFamily_spec data group action pairing unions powers separation infinite hG hP0 - have hCut := M.pair_right (M.transitive family.1 ((family.2.2 n _).2 rfl)) - have preserves : ∀ x y a, ZFSet.pair x y ∈ E → - (ZFSet.pair y a ∈ births.cutoffBirth n ↔ ZFSet.pair x a ∈ oldBirth) := by - intro x y a copied - change ZFSet.pair y a ∈ graphRestriction (births.cutoff n) births.birth ↔ _ - rw [pair_mem_graphRestriction] - exact (and_iff_left (contained x y copied)).trans (births.preserves_seed x y a copied) - obtain ⟨z', hz', code', rank'⟩ := code.ground_pushforward_rank_lt pairing unions powers separation - (completion.algebra.union.ground 0) hCut - (geometry.copies_ground _ data.group.group_code.identity_mem) hQs hN hz - limit rank sourceGraphs ((ZFSet.rank_mono (births.cutoff_subset n)).trans_lt target) numbers - completion.algebra.union.meet restricted preserves - (fun _ _ entry => births.priorFiber_image oldTime (pair_mem_graphRestriction.1 entry).1) - exact ⟨z', hz', rank', code'⟩ - -end PartitionPilot.Forcing.GroundExternalBirthData - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitTerminal_raw_witness_rank_lt (i : I) {t Qs rs μs : ZFSet.{u}} - (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) - (spaces : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph 0 ↔ - ZFSet.pair s y ∈ Qs) - (orders : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph 1 ↔ - ZFSet.pair s y ∈ rs) - (meets : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph 2 ↔ - ZFSet.pair s y ∈ μs) - (hOmega : ZFSet.omega ∈ M.sets) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) (numbers : ZFSet.rank ZFSet.omega < o) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode Qs rs μs run.limitPoints run.limitOrder - run.limitMeetGraph run.limitBirth t ZFSet.omega z ∧ ZFSet.rank z < o := by - have prior : t = (run.linked i).main.cutoff ∨ t ∈ (run.linked i).main.cutoff := by - simpa only [run.linked_main] using before - have hs := ZFSet.mem_insert (run.linked i).main.cutoff (run.linked i).main.cutoff - have ht := ZFSet.mem_insert_iff.2 prior - have raw := (run.linked i).serial.layer_code _ hs _ ht prior _ - ((run.linked i).serial.layerWitness_entry hs ht prior) - have terminal := (run.linked i).terminal_values - have code : GrowthLayerWitnessCode - ((run.linked i).serial.fields.graph 0) ((run.linked i).serial.fields.graph 1) - ((run.linked i).serial.fields.graph 2) - (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order - (run.diagram.stage i).stage.meetGraph (run.diagram.stage i).birth t ZFSet.omega - ((run.linked i).serial.layerWitness (run.linked i).main.cutoff t) := by - rw [terminal.1, terminal.2.1, terminal.2.2.1, terminal.2.2.2.1] at raw - simpa only [run.linked_main] using raw - have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by - simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_succ] using - (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code - (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) - (0 : Fin 1).succ.succ) - have serialRank : ZFSet.rank (run.linked i).serial.code < o := - serialBound.trans_lt ((run.linkedCode_rank_lt_code i).trans rank) - have witnessRank := ((run.linked i).serial.layerWitness_rank_lt_code hs ht prior).trans serialRank - have sourceRank := ((run.linked i).serial.fieldGraph_rank_le_code 0).trans_lt serialRank - obtain ⟨z, hz, copied, ranked⟩ := code.ground_pushforward_rank_lt - pairing unions powers separation (run.diagram.stage i).stage.carrier_ground - run.limitPoints_ground (run.limitPointMap_ground i) - ((run.linked i).serial.fields.graph_ground 0) hOmega - ((run.linked i).serial.layerWitness_ground _ _) limit witnessRank sourceRank - (run.limitPoints_rank_lt limit rank) numbers (run.diagram.stage i).stage.meet - (run.limitPointMap_meetEmbedding i) (run.limitPointMap_birth_iff i) (by - intro q _ birth - obtain ⟨x, hx, _, image⟩ := (run.limitBirth_old_fiber i q t before).1 birth - exact ⟨x, hx, image⟩) - exact ⟨z, hz, copied.congr_source_entries spaces orders meets, ranked⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLayerSourceCongruence +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitChronologyCore + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem familyPointBound_rank_le (Qs : ZFSet.{u}) : + ZFSet.rank (familyPointBound Qs) ≤ ZFSet.rank Qs := + (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) + +namespace CountableLayerCode + +theorem ground_pushforward_rank_lt + {M : TransitiveGround.{u}} {A B old born t D N injection e : ZFSet.{u}} + (code : CountableLayerCode A old t D N injection) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) (he : e ∈ M.sets) + (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) + (embedding : InjectionCode A B e) + (preserves : ∀ x y a, ZFSet.pair x y ∈ e → + (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) + (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : + ∃ D' ∈ M.sets, ∃ injection' ∈ M.sets, CountableLayerCode B born t D' N injection' ∧ + ZFSet.rank D' < o ∧ ZFSet.rank injection' < o := by + obtain ⟨E, hE, f, hf, copied⟩ := code.ground_pushforward pairing unions powers separation + hA hB hN he hD hInjection embedding preserves noNew + let D' := ZFSet.sep (fun x => x ∈ B) E + let f' := ZFSet.sep (fun z => z ∈ ZFSet.prod D' N) f + have hD' : D' ∈ M.sets := M.bounded_separation_mem separation (.mem 0 1) + (extend B Fin.elim0) (Fin.cases hB (fun i => Fin.elim0 i)) hE + have hf' : f' ∈ M.sets := M.injection_restriction_mem separation hD' hN hf + have injected : InjectionCode D' N f' := + copied.small.restrict (fun _ hx => (ZFSet.mem_sep.1 hx).1) + have rankD : ZFSet.rank D' < o := + (ZFSet.rank_mono (show D' ⊆ B from fun _ hx => (ZFSet.mem_sep.1 hx).2)).trans_lt target + refine ⟨D', hD', f', hf', ⟨injected, ?_⟩, rankD, + rank_functionGraph_lt limit injected.function rankD numbers⟩ + intro x hx entry + exact ZFSet.mem_sep.2 ⟨copied.cover x hx entry, hx⟩ +end CountableLayerCode + +namespace GrowthLayerWitnessCode + +theorem ground_pushforward_rank_lt + {M : TransitiveGround.{u}} {Qs rs μs A B rA rB μA μB old born t N z e : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs A rA μA old t N z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) + (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) + (sourceGraphs : ZFSet.rank Qs < o) (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) + (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) + (preserves : ∀ x y a, ZFSet.pair x y ∈ e → + (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) + (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B rB μB born t N z' ∧ + ZFSet.rank z' < o := by + have rankU := (familyPointBound_rank_le Qs).trans_lt sourceGraphs + have rankW := M.groundRelations_rank_lt limit rankU target + rcases code with ⟨D, injection, rfl, code⟩ | + ⟨I, parts, Indices, Maps, W, injection, rfl, code⟩ | + ⟨I, Indices, Maps, W, Components, F, rfl, code⟩ + · have fields := M.nonemptyTupleCode_field_mem 2 _ hz + obtain ⟨D', hD', injection', hInjection', copied, rankD, rankInjection⟩ := + code.ground_pushforward_rank_lt pairing unions powers separation hA hB hN he + (fields 1) (fields 2) limit target numbers embedding.injection preserves noNew + exact ⟨countableLayerWitness D' injection', M.countableLayerWitness_mem pairing hD' hInjection', + Or.inl ⟨D', injection', rfl, copied⟩, + countableLayerWitness_rank_lt limit rankD rankInjection⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ hz + have ranks := fun j => (rank_nonemptyTupleCode_field_le 6 _ j).trans_lt rank + obtain ⟨hMaps', hW', hParts', copied⟩ := code.ground_pushforward + pairing unions powers separation hA hB he hQs (fields 1) (fields 2) (fields 4) + embedding preserves noNew + have rankMaps := rank_functionGraph_lt limit copied.maps (ranks 1) rankW + have rankParts : ZFSet.rank (relationCompose I A B parts e) < o := + (ZFSet.rank_mono (show relationCompose I A B parts e ⊆ ZFSet.prod I B from + fun _ hx => (ZFSet.mem_sep.1 hx).1)).trans_lt (rank_product_lt limit (ranks 1) target) + exact ⟨copyLayerWitness I (relationCompose I A B parts e) Indices + (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) + (M.groundRelations (familyPointBound Qs) B) injection, + M.copyLayerWitness_mem pairing unions (fields 1) hParts' (fields 3) hMaps' hW' (fields 6), + Or.inr (Or.inl ⟨I, _, Indices, _, _, injection, rfl, copied⟩), + copyLayerWitness_rank_lt limit (ranks 1) rankParts (ranks 3) rankMaps rankW (ranks 6)⟩ + · have fields := M.nonemptyTupleCode_field_mem 6 _ hz + have ranks := fun j => (rank_nonemptyTupleCode_field_le 6 _ j).trans_lt rank + obtain ⟨hMaps', hW', hComponents', hF', copied⟩ := code.ground_pushforward + pairing unions powers separation hA hB he hQs (fields 1) (fields 3) (fields 5) (fields 6) + source embedding preserves noNew + have rankMaps := rank_functionGraph_lt limit copied.maps (ranks 1) rankW + have rankF : ZFSet.rank (relationImage F B (layerFiberEmbedding F B e)) < o := + (ZFSet.rank_mono (show relationImage F B (layerFiberEmbedding F B e) ⊆ B from + fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1)).trans_lt target + have rankComponents := rank_functionGraph_lt limit copied.components rankF (ranks 1) + exact ⟨separatedLayerWitness I Indices + (M.mapFamilyPushforward I (familyPointBound Qs) A B Maps e) + (M.groundRelations (familyPointBound Qs) B) + (pushedHeightGraph F B I (layerFiberEmbedding F B e) Components) + (relationImage F B (layerFiberEmbedding F B e)), + M.separatedLayerWitness_mem pairing unions (fields 1) (fields 2) hMaps' hW' hComponents' hF', + Or.inr (Or.inr ⟨I, Indices, _, _, _, _, rfl, copied⟩), + separatedLayerWitness_rank_lt limit (ranks 1) (ranks 2) rankMaps rankW rankComponents rankF⟩ + +end GrowthLayerWitnessCode + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 +include births data group action pairing unions powers separation infinite hG hP0 + +theorem ranked_rawPriorWitness {Qs rs μs t N z : ZFSet.{u}} + (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) oldBirth t N z) + (oldTime : t ∈ oldTimes ∨ t = oldTimes) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank z < o) (sourceGraphs : ZFSet.rank Qs < o) + (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) : + ∃ z' ∈ M.sets, ZFSet.rank z' < o ∧ GrowthLayerWitnessCode Qs rs μs B + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) + births.birth t N z' := by + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG + obtain ⟨z', hz', code', rank'⟩ := code.ground_pushforward_rank_lt pairing unions powers separation + (completion.algebra.union.ground 0) geometry.carrier_ground + (geometry.copies_ground _ data.group.group_code.identity_mem) hQs hN hz + limit rank sourceGraphs target numbers completion.algebra.union.meet embedding.toMeetEmbeddingCode + (fun x y a copied => births.preserves_seed x y a copied) + (fun _ _ entry => births.priorFiber_image oldTime entry) + exact ⟨z', hz', rank', code'⟩ + +theorem ranked_rawCutoffPriorWitness {Qs rs μs t N z : ZFSet.{u}} + (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) oldBirth t N z) + (oldTime : t ∈ oldTimes ∨ t = oldTimes) (n : Nat) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank z < o) + (sourceGraphs : ZFSet.rank Qs < o) (target : ZFSet.rank B < o) (numbers : ZFSet.rank N < o) : + ∃ z' ∈ M.sets, ZFSet.rank z' < o ∧ GrowthLayerWitnessCode Qs rs μs (births.cutoff n) + (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t N z' := by + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG + have contained : ∀ x y, ZFSet.pair x y ∈ E → y ∈ births.cutoff n := by + intro x y copied + have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) + exact births.cutoff_old n ((mem_relationImage U B E y).2 ⟨bounds.2, x, bounds.1, copied⟩) + have restricted := embedding.toMeetEmbeddingCode.restrictTarget (Q := births.cutoff n) contained + have family := births.cutoffFamily_spec data group action pairing unions powers separation infinite hG hP0 + have hCut := M.pair_right (M.transitive family.1 ((family.2.2 n _).2 rfl)) + have preserves : ∀ x y a, ZFSet.pair x y ∈ E → + (ZFSet.pair y a ∈ births.cutoffBirth n ↔ ZFSet.pair x a ∈ oldBirth) := by + intro x y a copied + change ZFSet.pair y a ∈ graphRestriction (births.cutoff n) births.birth ↔ _ + rw [pair_mem_graphRestriction] + exact (and_iff_left (contained x y copied)).trans (births.preserves_seed x y a copied) + obtain ⟨z', hz', code', rank'⟩ := code.ground_pushforward_rank_lt pairing unions powers separation + (completion.algebra.union.ground 0) hCut + (geometry.copies_ground _ data.group.group_code.identity_mem) hQs hN hz + limit rank sourceGraphs ((ZFSet.rank_mono (births.cutoff_subset n)).trans_lt target) numbers + completion.algebra.union.meet restricted preserves + (fun _ _ entry => births.priorFiber_image oldTime (pair_mem_graphRestriction.1 entry).1) + exact ⟨z', hz', rank', code'⟩ + +end PartitionPilot.Forcing.GroundExternalBirthData + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitTerminal_raw_witness_rank_lt (i : I) {t Qs rs μs : ZFSet.{u}} + (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) + (spaces : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph 0 ↔ + ZFSet.pair s y ∈ Qs) + (orders : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph 1 ↔ + ZFSet.pair s y ∈ rs) + (meets : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph 2 ↔ + ZFSet.pair s y ∈ μs) + (hOmega : ZFSet.omega ∈ M.sets) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) (numbers : ZFSet.rank ZFSet.omega < o) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode Qs rs μs run.limitPoints run.limitOrder + run.limitMeetGraph run.limitBirth t ZFSet.omega z ∧ ZFSet.rank z < o := by + have prior : t = (run.linked i).main.cutoff ∨ t ∈ (run.linked i).main.cutoff := by + simpa only [run.linked_main] using before + have hs := ZFSet.mem_insert (run.linked i).main.cutoff (run.linked i).main.cutoff + have ht := ZFSet.mem_insert_iff.2 prior + have raw := (run.linked i).serial.layer_code _ hs _ ht prior _ + ((run.linked i).serial.layerWitness_entry hs ht prior) + have terminal := (run.linked i).terminal_values + have code : GrowthLayerWitnessCode + ((run.linked i).serial.fields.graph 0) ((run.linked i).serial.fields.graph 1) + ((run.linked i).serial.fields.graph 2) + (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order + (run.diagram.stage i).stage.meetGraph (run.diagram.stage i).birth t ZFSet.omega + ((run.linked i).serial.layerWitness (run.linked i).main.cutoff t) := by + rw [terminal.1, terminal.2.1, terminal.2.2.1, terminal.2.2.2.1] at raw + simpa only [run.linked_main] using raw + have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by + simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_succ] using + (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code + (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) + (0 : Fin 1).succ.succ) + have serialRank : ZFSet.rank (run.linked i).serial.code < o := + serialBound.trans_lt ((run.linkedCode_rank_lt_code i).trans rank) + have witnessRank := ((run.linked i).serial.layerWitness_rank_lt_code hs ht prior).trans serialRank + have sourceRank := ((run.linked i).serial.fieldGraph_rank_le_code 0).trans_lt serialRank + obtain ⟨z, hz, copied, ranked⟩ := code.ground_pushforward_rank_lt + pairing unions powers separation (run.diagram.stage i).stage.carrier_ground + run.limitPoints_ground (run.limitPointMap_ground i) + ((run.linked i).serial.fields.graph_ground 0) hOmega + ((run.linked i).serial.layerWitness_ground _ _) limit witnessRank sourceRank + (run.limitPoints_rank_lt limit rank) numbers (run.diagram.stage i).stage.meet + (run.limitPointMap_meetEmbedding i) (run.limitPointMap_birth_iff i) (by + intro q _ birth + obtain ⟨x, hx, _, image⟩ := (run.limitBirth_old_fiber i q t before).1 birth + exact ⟨x, hx, image⟩) + exact ⟨z, hz, copied.congr_source_entries spaces orders meets, ranked⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixPriorLayerWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixPriorLayerWitnesses.lean index 0580b671833e0a1a2bb9159e46f403260fa6a4a0..e217f36eabf88abf1054eedb62b8d80004fb5b1e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixPriorLayerWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixPriorLayerWitnesses.lean @@ -1,61 +1,61 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLayerSourceCongruence -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFieldFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem prior_raw_witness_rank_lt (i : I) {s t Qs rs μs : ZFSet.{u}} - (cutoff : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) - (before : t = s ∨ t ∈ s) - (spaces : ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ (run.linked i).serial.fields.graph 0 ↔ - ZFSet.pair a y ∈ Qs) - (orders : ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ (run.linked i).serial.fields.graph 1 ↔ - ZFSet.pair a y ∈ rs) - (meets : ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ (run.linked i).serial.fields.graph 2 ↔ - ZFSet.pair a y ∈ μs) - {o : Ordinal.{u}} (rank : ZFSet.rank run.code < o) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode Qs rs μs - ((run.diagram.stage i).history.space s) ((run.diagram.stage i).history.order s) - ((run.diagram.stage i).history.meetGraph s) ((run.diagram.stage i).history.birth s) - t ZFSet.omega z ∧ ZFSet.rank z < o := by - have hs : s ∈ insert (run.linked i).main.cutoff (run.linked i).main.cutoff := by - simpa only [run.linked_main, ZFSet.mem_insert_iff] using cutoff - have ht : t ∈ insert (run.linked i).main.cutoff (run.linked i).main.cutoff := by - rcases before with rfl | earlier - · exact hs - · exact (run.linked i).serial.ordinal.1 s hs t earlier - have raw := (run.linked i).serial.layer_code s hs t ht before _ - ((run.linked i).serial.layerWitness_entry hs ht before) - have values (j : Fin 5) : (run.linked i).serial.fields.value j s = - (run.diagram.stage i).history.fieldValue j s := by - exact ((run.linked i).agreement j s hs).trans - (congrArg (fun stage : GroundChronologicalMainStage M C D rD => - stage.history.fieldValue j s) (run.linked_main i)) - rw [values 0, values 1, values 2, values 3] at raw - have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by - simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_succ] using - (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code - (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) - (0 : Fin 1).succ.succ) - have serialRank : ZFSet.rank (run.linked i).serial.code < o := - serialBound.trans_lt ((run.linkedCode_rank_lt_code i).trans rank) - exact ⟨(run.linked i).serial.layerWitness s t, (run.linked i).serial.layerWitness_ground s t, - raw.congr_source_entries spaces orders meets, - ((run.linked i).serial.layerWitness_rank_lt_code hs ht before).trans serialRank⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLayerSourceCongruence +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFieldFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem prior_raw_witness_rank_lt (i : I) {s t Qs rs μs : ZFSet.{u}} + (cutoff : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) + (before : t = s ∨ t ∈ s) + (spaces : ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ (run.linked i).serial.fields.graph 0 ↔ + ZFSet.pair a y ∈ Qs) + (orders : ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ (run.linked i).serial.fields.graph 1 ↔ + ZFSet.pair a y ∈ rs) + (meets : ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ (run.linked i).serial.fields.graph 2 ↔ + ZFSet.pair a y ∈ μs) + {o : Ordinal.{u}} (rank : ZFSet.rank run.code < o) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode Qs rs μs + ((run.diagram.stage i).history.space s) ((run.diagram.stage i).history.order s) + ((run.diagram.stage i).history.meetGraph s) ((run.diagram.stage i).history.birth s) + t ZFSet.omega z ∧ ZFSet.rank z < o := by + have hs : s ∈ insert (run.linked i).main.cutoff (run.linked i).main.cutoff := by + simpa only [run.linked_main, ZFSet.mem_insert_iff] using cutoff + have ht : t ∈ insert (run.linked i).main.cutoff (run.linked i).main.cutoff := by + rcases before with rfl | earlier + · exact hs + · exact (run.linked i).serial.ordinal.1 s hs t earlier + have raw := (run.linked i).serial.layer_code s hs t ht before _ + ((run.linked i).serial.layerWitness_entry hs ht before) + have values (j : Fin 5) : (run.linked i).serial.fields.value j s = + (run.diagram.stage i).history.fieldValue j s := by + exact ((run.linked i).agreement j s hs).trans + (congrArg (fun stage : GroundChronologicalMainStage M C D rD => + stage.history.fieldValue j s) (run.linked_main i)) + rw [values 0, values 1, values 2, values 3] at raw + have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by + simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_succ] using + (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code + (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) + (0 : Fin 1).succ.succ) + have serialRank : ZFSet.rank (run.linked i).serial.code < o := + serialBound.trans_lt ((run.linkedCode_rank_lt_code i).trans rank) + exact ⟨(run.linked i).serial.layerWitness s t, (run.linked i).serial.layerWitness_ground s t, + raw.congr_source_entries spaces orders meets, + ((run.linked i).serial.layerWitness_rank_lt_code hs ht before).trans serialRank⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixRectangleBoundTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixRectangleBoundTransport.lean index 17017dec3fa6c16832595f219bc0eed084e0ca5a..6d44d0182d0d2291eea1fe7c09c412d61050ad9c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixRectangleBoundTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMainPrefixRectangleBoundTransport.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixRectangleLocalization - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitRectangleAtBound (i : I) {c b d g h X k l : ZFSet.{u}} - (hc : c ∈ (run.diagram.stage i).stage.carrier) - (hb : b ∈ (run.diagram.stage i).stage.carrier) - (hd : d ∈ (run.diagram.stage i).stage.carrier) - (hX : X ∈ (run.diagram.stage i).stage.carrier) - (hg : g ∈ (run.diagram.stage i).stage.actors) - (hh : h ∈ (run.diagram.stage i).stage.actors) - (hk : k ∈ (run.diagram.stage i).stage.actors) - (hl : l ∈ (run.diagram.stage i).stage.actors) - (code : RectangleAtBoundCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order - (run.diagram.stage i).stage.meetGraph (run.diagram.stage i).stage.action c b d g h X k l) : - RectangleAtBoundCode run.limitPoints run.limitOrder run.limitMeetGraph run.limitAction - (run.pointPresentation.limitPoint i c) (run.pointPresentation.limitPoint i b) - (run.pointPresentation.limitPoint i d) (run.actorPresentation.limitPoint i g) - (run.actorPresentation.limitPoint i h) (run.pointPresentation.limitPoint i X) - (run.actorPresentation.limitPoint i k) (run.actorPresentation.limitPoint i l) := by - have imageC := (run.pointPresentation.inclusion_entry i c _).2 ⟨hc, rfl⟩ - have imageB := (run.pointPresentation.inclusion_entry i b _).2 ⟨hb, rfl⟩ - have imageG := (run.actorPresentation.inclusion_entry i g _).2 ⟨hg, rfl⟩ - have imageH := (run.actorPresentation.inclusion_entry i h _).2 ⟨hh, rfl⟩ - have imageK := (run.actorPresentation.inclusion_entry i k _).2 ⟨hk, rfl⟩ - have imageL := (run.actorPresentation.inclusion_entry i l _).2 ⟨hl, rfl⟩ - refine ⟨run.limitMaps_agreement i _ _ _ _ _ _ imageK imageG imageC code.first_agreement, - run.limitMaps_agreement i _ _ _ _ _ _ imageL imageH imageC code.second_agreement, - run.limitMaps_agreement i _ _ _ _ _ _ imageK imageL imageB code.common_agreement, ?_⟩ - obtain ⟨v, hv, w, hw, y, hy, z, hz, t, ht, gv, hwAct, ky, lz, kt, lt, rootK, rootL, cross⟩ := code.values - exact ⟨run.pointPresentation.limitPoint i v, run.pointPresentation.limitPoint_mem hv, - run.pointPresentation.limitPoint i w, run.pointPresentation.limitPoint_mem hw, - run.pointPresentation.limitPoint i y, run.pointPresentation.limitPoint_mem hy, - run.pointPresentation.limitPoint i z, run.pointPresentation.limitPoint_mem hz, - run.pointPresentation.limitPoint i t, run.pointPresentation.limitPoint_mem ht, - (run.limitAction_at i hg hc hv).2 gv, (run.limitAction_at i hh hc hw).2 hwAct, - (run.limitAction_at i hk hd hy).2 ky, (run.limitAction_at i hl hd hz).2 lz, - (run.limitAction_at i hk hb ht).2 kt, (run.limitAction_at i hl hb ht).2 lt, - (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hy hX hv).2 rootK), - (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hz hX hw).2 rootL), - (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hy hz ht).2 cross)⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixRectangleLocalization + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitRectangleAtBound (i : I) {c b d g h X k l : ZFSet.{u}} + (hc : c ∈ (run.diagram.stage i).stage.carrier) + (hb : b ∈ (run.diagram.stage i).stage.carrier) + (hd : d ∈ (run.diagram.stage i).stage.carrier) + (hX : X ∈ (run.diagram.stage i).stage.carrier) + (hg : g ∈ (run.diagram.stage i).stage.actors) + (hh : h ∈ (run.diagram.stage i).stage.actors) + (hk : k ∈ (run.diagram.stage i).stage.actors) + (hl : l ∈ (run.diagram.stage i).stage.actors) + (code : RectangleAtBoundCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order + (run.diagram.stage i).stage.meetGraph (run.diagram.stage i).stage.action c b d g h X k l) : + RectangleAtBoundCode run.limitPoints run.limitOrder run.limitMeetGraph run.limitAction + (run.pointPresentation.limitPoint i c) (run.pointPresentation.limitPoint i b) + (run.pointPresentation.limitPoint i d) (run.actorPresentation.limitPoint i g) + (run.actorPresentation.limitPoint i h) (run.pointPresentation.limitPoint i X) + (run.actorPresentation.limitPoint i k) (run.actorPresentation.limitPoint i l) := by + have imageC := (run.pointPresentation.inclusion_entry i c _).2 ⟨hc, rfl⟩ + have imageB := (run.pointPresentation.inclusion_entry i b _).2 ⟨hb, rfl⟩ + have imageG := (run.actorPresentation.inclusion_entry i g _).2 ⟨hg, rfl⟩ + have imageH := (run.actorPresentation.inclusion_entry i h _).2 ⟨hh, rfl⟩ + have imageK := (run.actorPresentation.inclusion_entry i k _).2 ⟨hk, rfl⟩ + have imageL := (run.actorPresentation.inclusion_entry i l _).2 ⟨hl, rfl⟩ + refine ⟨run.limitMaps_agreement i _ _ _ _ _ _ imageK imageG imageC code.first_agreement, + run.limitMaps_agreement i _ _ _ _ _ _ imageL imageH imageC code.second_agreement, + run.limitMaps_agreement i _ _ _ _ _ _ imageK imageL imageB code.common_agreement, ?_⟩ + obtain ⟨v, hv, w, hw, y, hy, z, hz, t, ht, gv, hwAct, ky, lz, kt, lt, rootK, rootL, cross⟩ := code.values + exact ⟨run.pointPresentation.limitPoint i v, run.pointPresentation.limitPoint_mem hv, + run.pointPresentation.limitPoint i w, run.pointPresentation.limitPoint_mem hw, + run.pointPresentation.limitPoint i y, run.pointPresentation.limitPoint_mem hy, + run.pointPresentation.limitPoint i z, run.pointPresentation.limitPoint_mem hz, + run.pointPresentation.limitPoint i t, run.pointPresentation.limitPoint_mem ht, + (run.limitAction_at i hg hc hv).2 gv, (run.limitAction_at i hh hc hw).2 hwAct, + (run.limitAction_at i hk hd hy).2 ky, (run.limitAction_at i hl hd hz).2 lz, + (run.limitAction_at i hk hb ht).2 kt, (run.limitAction_at i hl hb ht).2 lt, + (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hy hX hv).2 rootK), + (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hz hX hw).2 rootL), + (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hy hz ht).2 cross)⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMixtureNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMixtureNames.lean index 23a42d55a323f4ebf1767f02fe76f16468a86375..0e90f6e14469c6829749841487df2ef210ebe2f3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMixtureNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundMixtureNames.lean @@ -1,415 +1,415 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHartogs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundUnionInterpretation - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.SetFormula - -universe u - -theorem realize_infinity_of_witness (U : Set ZFSet.{u}) - (transitive : ∀ x ∈ U, ∀ z ∈ x, z ∈ U) - (I : ZFSet.{u}) (hI : I ∈ U) (empty : (∅ : ZFSet.{u}) ∈ I) - (successor : ∀ x ∈ I, insert x x ∈ I) : Realize U infinity Fin.elim0 := by - simp only [infinity, emptySetFormula, successorFormula, realize_ex, realize_imp, realize_disj, Realize] - refine ⟨I, hI, ⟨∅, transitive I hI ∅ empty, empty, fun z _ => ZFSet.notMem_empty z⟩, ?_⟩ - intro x _ hx - refine ⟨insert x x, transitive I hI _ (successor x hx), successor x hx, ?_⟩ - intro z _ - exact ⟨ZFSet.mem_insert_iff.1, ZFSet.mem_insert_iff.2⟩ - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) - -theorem infinity_witness (infinite : Realize M.sets infinity Fin.elim0) : - ∃ I ∈ M.sets, (∅ : ZFSet.{u}) ∈ I ∧ ∀ x ∈ I, insert x x ∈ I := by - simp only [infinity, emptySetFormula, successorFormula, realize_ex, realize_imp, realize_disj, Realize] at infinite - obtain ⟨I, hI, ⟨e, he, eI, empty⟩, successors⟩ := infinite - have eqEmpty : e = ∅ := by - apply ZFSet.ext - intro z - exact ⟨fun hz => False.elim (empty z (M.transitive he hz) hz), - fun hz => False.elim (ZFSet.notMem_empty z hz)⟩ - refine ⟨I, hI, eqEmpty ▸ eI, ?_⟩ - intro x hx - have hxM := M.transitive hI hx - obtain ⟨y, hy, yI, spec⟩ := successors x hxM hx - have eq : y = insert x x := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_insert_iff] - constructor - · intro hz - exact (spec z (M.transitive hy hz)).1 hz - · intro hz - have hzM : z ∈ M.sets := by - rcases hz with rfl | hz - · exact hxM - · exact M.transitive hxM hz - exact (spec z hzM).2 hz - exact eq ▸ yI - -theorem symmetric_infinity {P G : Type u} [Group G] [PartialOrder P] [OrderTop P] - (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : - Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) infinity Fin.elim0 := by - obtain ⟨I, hI, empty, successor⟩ := M.infinity_witness infinite - let D := a.symmetricDomain s (M.nameDomain s) F - exact realize_infinity_of_witness (D.values {p | H.mem p}) - (fun _ hx _ hz => D.values_transitive _ hx hz) I - (M.ground_subset_symmetric_values s a F pairing unions powers separation collection carrier H hI) - empty successor - -end PartitionPilot.Forcing.TransitiveGround - -end - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem symmetric_ZF (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : - ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := by - let D := a.symmetricDomain s (M.nameDomain s) F - have nonempty := a.symmetricDomain_nonempty s (M.nameDomain s) F - (M.nameDomain_nonempty s ⟨s.carrier, carrier⟩) - refine ⟨⟨realize_extensionality D _, realize_foundation D _, realize_emptySet D nonempty _, - M.symmetric_pairing s a F pairing carrier H, - M.symmetric_union s a F pairing unions powers separation carrier order H, - M.symmetric_powerSet a s t b F K basis pairing unions powers separation collection carrier order - group indices supports maps H generic, - M.symmetric_infinity s a F pairing unions powers separation collection infinite carrier H⟩, ?_, ?_⟩ - · exact M.symmetric_separation a s t b F K basis pairing unions powers separation collection carrier order - group indices supports maps H generic - · exact M.symmetric_replacement a s t b F K basis pairing unions powers separation collection carrier order - group indices supports maps H generic - -theorem exists_ZF_interpretation (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ - M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ - ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) := by - obtain ⟨H, hp, ground, ordinary, symmetric⟩ := M.exists_joint_generic s a F small carrier p - exact ⟨H, hp, ground, ordinary, symmetric, - M.ground_subset_symmetric_values s a F pairing unions powers separation collection carrier H, - M.symmetric_ZF a s t b F K basis pairing unions powers separation collection infinite carrier order - group indices supports maps H symmetric⟩ - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -noncomputable def restrictBelow (p : P) (τ : Name s) : Name s := selectName (fun _ q => q ≤ p) τ - -theorem entry_restrictBelow (p : P) (τ σ : Name s) (q : P) : - Entry σ (restrictBelow p τ) q ↔ ∃ r, Entry σ τ r ∧ q ≤ r ∧ q ≤ p := - entry_selectName _ τ σ q - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.SetFormula - -def restrictionEntryFormula : SetFormula 5 := - ex (exConditions 4 (exConditions 5 (.conj (orderedPairFormula 3 2 1) - (.conj (pairMembershipFormula 2 0 4) - (.conj (pairMembershipFormula 1 0 7) (pairMembershipFormula 1 5 7)))))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_restrictionEntryFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets restrictionEntryFormula (extend z (extend τ.val (extend (s.encode p) - (extend s.carrier (extend s.conditionOrder Fin.elim0))))) ↔ - z ∈ (Name.restrictBelow p τ).val := by - let base := extend z (extend τ.val (extend (s.encode p) (extend s.carrier (extend s.conditionOrder Fin.elim0)))) - have hp := M.transitive carrier (s.encode_mem p) - rw [restrictionEntryFormula, realize_ex] - constructor - · rintro ⟨x, hx, rest⟩ - obtain ⟨q, rest⟩ := (M.realize_exConditions s 4 _ (extend x base) carrier rfl).1 rest - obtain ⟨r, shape, old, qr, qp⟩ := (M.realize_exConditions s 5 _ - (extend (s.encode q) (extend x base)) carrier rfl).1 rest - let e := extend (s.encode r) (extend (s.encode q) (extend x base)) - have hq := M.transitive carrier (s.encode_mem q) - have hr := M.transitive carrier (s.encode_mem r) - have raw := (M.realize_pairMembershipFormula pairing 2 0 4 e hx hr hτ).1 old - let σ : Name s := ⟨x, Name.isName_of_pair_mem τ x r raw⟩ - have eq := (M.realize_orderedPairFormula pairing 3 2 1 e hz hx hq).1 shape - change z = ZFSet.pair x (s.encode q) at eq - rw [eq] - exact (Name.entry_restrictBelow p τ σ q).2 ⟨r, raw, - (M.realize_conditionLE s pairing carrier order 1 0 7 e q r rfl rfl rfl).1 qr, - (M.realize_conditionLE s pairing carrier order 1 5 7 e q p rfl rfl rfl).1 qp⟩ - · intro member - obtain ⟨σ, q, eq⟩ := Name.entries_cover (Name.restrictBelow p τ) member - have entry : Name.Entry σ (Name.restrictBelow p τ) q := by - change ZFSet.pair σ.val (s.encode q) ∈ (Name.restrictBelow p τ).val - rwa [← eq] - obtain ⟨r, old, qr, qp⟩ := (Name.entry_restrictBelow p τ σ q).1 entry - have hσ := (M.nameDomain s).children hτ old - refine ⟨σ.val, hσ, ?_⟩ - apply (M.realize_exConditions s 4 _ (extend σ.val base) carrier rfl).2 - refine ⟨q, ?_⟩ - apply (M.realize_exConditions s 5 _ (extend (s.encode q) (extend σ.val base)) carrier rfl).2 - let e := extend (s.encode r) (extend (s.encode q) (extend σ.val base)) - refine ⟨r, ?_, ?_, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing 3 2 1 e hz hσ (M.transitive carrier (s.encode_mem q))).2 eq - · exact (M.realize_pairMembershipFormula pairing 2 0 4 e hσ (M.transitive carrier (s.encode_mem r)) hτ).2 old - · exact (M.realize_conditionLE s pairing carrier order 1 0 7 e q r rfl rfl rfl).2 qr - · exact (M.realize_conditionLE s pairing carrier order 1 5 7 e q p rfl rfl rfl).2 qp - -theorem restrictBelow_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) : (Name.restrictBelow p τ).val ∈ M.sets := by - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers - (M.union_mem unions (M.union_mem unions hτ)) carrier - have bound : (Name.restrictBelow p τ).val ⊆ B := by - intro z hz - obtain ⟨σ, q, rfl⟩ := Name.entries_cover (Name.restrictBelow p τ) hz - obtain ⟨r, old, _, _⟩ := (Name.entry_restrictBelow p τ σ q).1 hz - exact pairBound σ.val (Name.child_mem_doubleUnion old) (s.encode q) (s.encode_mem q) - let context := extend τ.val (extend (s.encode p) (extend s.carrier (extend s.conditionOrder Fin.elim0))) - have selected := M.separation_mem separation restrictionEntryFormula context - (Fin.cases hτ (Fin.cases (M.transitive carrier (s.encode_mem p)) - (Fin.cases carrier (Fin.cases order (fun i => Fin.elim0 i))))) hB - have eq : ZFSet.sep (fun z => Realize M.sets restrictionEntryFormula (extend z context)) B = - (Name.restrictBelow p τ).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (M.realize_restrictionEntryFormula s pairing carrier order p τ hτ z (M.transitive hB hz)).1 rel - · intro hz - exact ⟨bound hz, (M.realize_restrictionEntryFormula s pairing carrier order p τ hτ z - (M.transitive hB (bound hz))).2 hz⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization -universe u -variable {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -noncomputable def subgroupOrbitCodes (K : Subgroup G) (τ : Name s) : ZFSet.{u} := - ZFSet.range (fun g : K => (a.act s g.val τ).val) - -theorem mem_subgroupOrbitCodes (K : Subgroup G) (τ : Name s) (y : ZFSet.{u}) : - y ∈ a.subgroupOrbitCodes s K τ ↔ ∃ g ∈ K, y = (a.act s g τ).val := by - rw [subgroupOrbitCodes, ZFSet.mem_range] - constructor - · rintro ⟨g, eq⟩ - exact ⟨g.val, g.property, eq.symm⟩ - · rintro ⟨g, hg, eq⟩ - exact ⟨⟨g, hg⟩, eq.symm⟩ - -theorem entry_act_restrictBelow (g : G) (p : P) (τ σ : Name s) (q : P) : - Name.Entry σ (a.act s g (Name.restrictBelow p τ)) q ↔ - ∃ ν r, Name.Entry ν τ r ∧ a.act s g ν = σ ∧ q ≤ a.iso g p ∧ q ≤ a.iso g r := by - change Name.Entry σ (Name.rename s (a.iso g) (Name.restrictBelow p τ)) q ↔ _ - rw [Name.entry_rename] - constructor - · rintro ⟨ν, c, entry, eq, cq⟩ - obtain ⟨r, old, cr, cp⟩ := (Name.entry_restrictBelow p τ ν c).1 entry - refine ⟨ν, r, old, eq, ?_, ?_⟩ - · rw [← cq] - exact (a.iso g).monotone cp - · rw [← cq] - exact (a.iso g).monotone cr - · rintro ⟨ν, r, old, eq, qp, qr⟩ - refine ⟨ν, (a.iso g).symm q, (Name.entry_restrictBelow p τ ν _).2 ⟨r, old, ?_, ?_⟩, - eq, (a.iso g).apply_symm_apply q⟩ - · exact (a.iso g).le_iff_le.1 (by simpa only [OrderIso.apply_symm_apply] using qr) - · exact (a.iso g).le_iff_le.1 (by simpa only [OrderIso.apply_symm_apply] using qp) - -theorem mix_code_union (K : Subgroup G) (p : P) (τ : Name s) : - (a.mix s K p τ).val = ⋃₀ (a.subgroupOrbitCodes s K (Name.restrictBelow p τ)) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sUnion] - constructor - · intro hz - obtain ⟨σ, q, eq⟩ := Name.entries_cover (a.mix s K p τ) hz - have entry : Name.Entry σ (a.mix s K p τ) q := by - change ZFSet.pair σ.val (s.encode q) ∈ (a.mix s K p τ).val - rwa [← eq] - obtain ⟨g, hg, ν, r, old, moved, qp, qr⟩ := (a.entry_mix s K p τ σ q).1 entry - refine ⟨(a.act s g (Name.restrictBelow p τ)).val, - (a.mem_subgroupOrbitCodes s K _ _).2 ⟨g, hg, rfl⟩, ?_⟩ - rw [eq] - exact (a.entry_act_restrictBelow s g p τ σ q).2 ⟨ν, r, old, moved, qp, qr⟩ - · rintro ⟨w, hw, hz⟩ - obtain ⟨g, hg, rfl⟩ := (a.mem_subgroupOrbitCodes s K _ w).1 hw - obtain ⟨σ, q, eq⟩ := Name.entries_cover (a.act s g (Name.restrictBelow p τ)) hz - have entry : Name.Entry σ (a.act s g (Name.restrictBelow p τ)) q := by - change ZFSet.pair σ.val (s.encode q) ∈ (a.act s g (Name.restrictBelow p τ)).val - rwa [← eq] - obtain ⟨ν, r, old, moved, qp, qr⟩ := (a.entry_act_restrictBelow s g p τ σ q).1 entry - rw [eq] - exact (a.entry_mix s K p τ σ q).2 ⟨g, hg, ν, r, old, moved, qp, qr⟩ - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.SetFormula - -def subgroupOrbitFormula : SetFormula 6 := - exConditions 4 (.conj (.mem 0 3) - (atomicApplication codedNameActionFormula (extend 4 (extend 6 Fin.elim0)) 0 2 1)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem realize_subgroupOrbitFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (K : Subgroup G) (τ : Name s) (hτ : τ.val ∈ M.sets) (y : ZFSet.{u}) (hy : y ∈ M.sets) : - Realize M.sets subgroupOrbitFormula (extend y (extend τ.val (extend (t.subset (fun g => g ∈ K)) - (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔ - y ∈ a.subgroupOrbitCodes s K τ := by - rw [subgroupOrbitFormula, M.realize_exConditions t 4 _ _ group rfl, a.mem_subgroupOrbitCodes] - apply exists_congr - intro g - change (t.encode g ∈ t.subset (fun g => g ∈ K) ∧ Realize M.sets _ _) ↔ _ - rw [t.encode_mem_subset] - apply and_congr_right - intro _ - rw [realize_atomicApplication, map_extend, map_extend, map_empty] - change Realize M.sets codedNameActionFormula (extend (t.encode g) (extend τ.val (extend y - (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ _ - rw [M.realize_codedNameActionFormula a s t pairing unions powers separation collection carrier group maps g τ.val y hτ hy] - constructor - · rintro ⟨σ, eq, output⟩ - have names : σ.val = τ := Subtype.ext eq - rwa [names] at output - · intro eq - exact ⟨⟨τ, hτ⟩, rfl, eq⟩ - -theorem subgroupOrbitCodes_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) - (τ : Name s) (hτ : τ.val ∈ M.sets) : a.subgroupOrbitCodes s K τ ∈ M.sets := by - let W := ({τ.val, τ.val} : ZFSet.{u}) - have hW : W ∈ M.sets := M.unorderedPair_mem pairing hτ hτ - let B := a.orbitCodes s (M.nameDomain s) W - have hB := M.orbitCodes_mem a s t pairing unions powers separation collection carrier group maps W hW - have bound : a.subgroupOrbitCodes s K τ ⊆ B := by - intro y hy - obtain ⟨g, _, eq⟩ := (a.mem_subgroupOrbitCodes s K τ y).1 hy - exact (a.mem_orbitCodes s (M.nameDomain s) W y).2 - ⟨g, τ, hτ, ZFSet.mem_pair.2 (Or.inl rfl), eq⟩ - let context := extend τ.val (extend (t.subset (fun g => g ∈ K)) - (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))) - have selected := M.separation_mem separation subgroupOrbitFormula context - (Fin.cases hτ (Fin.cases hK (Fin.cases carrier (Fin.cases group (Fin.cases maps (fun i => Fin.elim0 i)))))) hB - have eq : ZFSet.sep (fun y => Realize M.sets subgroupOrbitFormula (extend y context)) B = - a.subgroupOrbitCodes s K τ := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hy, rel⟩ - exact (M.realize_subgroupOrbitFormula a s t pairing unions powers separation collection carrier group maps K τ hτ y - (M.transitive hB hy)).1 rel - · intro hy - exact ⟨bound hy, (M.realize_subgroupOrbitFormula a s t pairing unions powers separation collection carrier group maps K τ hτ y - (M.transitive hB (bound hy))).2 hy⟩ - exact eq ▸ selected - -theorem mix_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) - (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) : (a.mix s K p τ).val ∈ M.sets := by - rw [a.mix_code_union] - exact M.union_mem unions (M.subgroupOrbitCodes_mem a s t pairing unions powers separation collection carrier group maps K hK - (Name.restrictBelow p τ) (M.restrictBelow_mem s pairing unions powers separation carrier order p τ hτ)) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHartogs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundUnionInterpretation + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.SetFormula + +universe u + +theorem realize_infinity_of_witness (U : Set ZFSet.{u}) + (transitive : ∀ x ∈ U, ∀ z ∈ x, z ∈ U) + (I : ZFSet.{u}) (hI : I ∈ U) (empty : (∅ : ZFSet.{u}) ∈ I) + (successor : ∀ x ∈ I, insert x x ∈ I) : Realize U infinity Fin.elim0 := by + simp only [infinity, emptySetFormula, successorFormula, realize_ex, realize_imp, realize_disj, Realize] + refine ⟨I, hI, ⟨∅, transitive I hI ∅ empty, empty, fun z _ => ZFSet.notMem_empty z⟩, ?_⟩ + intro x _ hx + refine ⟨insert x x, transitive I hI _ (successor x hx), successor x hx, ?_⟩ + intro z _ + exact ⟨ZFSet.mem_insert_iff.1, ZFSet.mem_insert_iff.2⟩ + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) + +theorem infinity_witness (infinite : Realize M.sets infinity Fin.elim0) : + ∃ I ∈ M.sets, (∅ : ZFSet.{u}) ∈ I ∧ ∀ x ∈ I, insert x x ∈ I := by + simp only [infinity, emptySetFormula, successorFormula, realize_ex, realize_imp, realize_disj, Realize] at infinite + obtain ⟨I, hI, ⟨e, he, eI, empty⟩, successors⟩ := infinite + have eqEmpty : e = ∅ := by + apply ZFSet.ext + intro z + exact ⟨fun hz => False.elim (empty z (M.transitive he hz) hz), + fun hz => False.elim (ZFSet.notMem_empty z hz)⟩ + refine ⟨I, hI, eqEmpty ▸ eI, ?_⟩ + intro x hx + have hxM := M.transitive hI hx + obtain ⟨y, hy, yI, spec⟩ := successors x hxM hx + have eq : y = insert x x := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_insert_iff] + constructor + · intro hz + exact (spec z (M.transitive hy hz)).1 hz + · intro hz + have hzM : z ∈ M.sets := by + rcases hz with rfl | hz + · exact hxM + · exact M.transitive hxM hz + exact (spec z hzM).2 hz + exact eq ▸ yI + +theorem symmetric_infinity {P G : Type u} [Group G] [PartialOrder P] [OrderTop P] + (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : + Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) infinity Fin.elim0 := by + obtain ⟨I, hI, empty, successor⟩ := M.infinity_witness infinite + let D := a.symmetricDomain s (M.nameDomain s) F + exact realize_infinity_of_witness (D.values {p | H.mem p}) + (fun _ hx _ hz => D.values_transitive _ hx hz) I + (M.ground_subset_symmetric_values s a F pairing unions powers separation collection carrier H hI) + empty successor + +end PartitionPilot.Forcing.TransitiveGround + +end + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem symmetric_ZF (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : + ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := by + let D := a.symmetricDomain s (M.nameDomain s) F + have nonempty := a.symmetricDomain_nonempty s (M.nameDomain s) F + (M.nameDomain_nonempty s ⟨s.carrier, carrier⟩) + refine ⟨⟨realize_extensionality D _, realize_foundation D _, realize_emptySet D nonempty _, + M.symmetric_pairing s a F pairing carrier H, + M.symmetric_union s a F pairing unions powers separation carrier order H, + M.symmetric_powerSet a s t b F K basis pairing unions powers separation collection carrier order + group indices supports maps H generic, + M.symmetric_infinity s a F pairing unions powers separation collection infinite carrier H⟩, ?_, ?_⟩ + · exact M.symmetric_separation a s t b F K basis pairing unions powers separation collection carrier order + group indices supports maps H generic + · exact M.symmetric_replacement a s t b F K basis pairing unions powers separation collection carrier order + group indices supports maps H generic + +theorem exists_ZF_interpretation (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ + M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ + ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) := by + obtain ⟨H, hp, ground, ordinary, symmetric⟩ := M.exists_joint_generic s a F small carrier p + exact ⟨H, hp, ground, ordinary, symmetric, + M.ground_subset_symmetric_values s a F pairing unions powers separation collection carrier H, + M.symmetric_ZF a s t b F K basis pairing unions powers separation collection infinite carrier order + group indices supports maps H symmetric⟩ + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +noncomputable def restrictBelow (p : P) (τ : Name s) : Name s := selectName (fun _ q => q ≤ p) τ + +theorem entry_restrictBelow (p : P) (τ σ : Name s) (q : P) : + Entry σ (restrictBelow p τ) q ↔ ∃ r, Entry σ τ r ∧ q ≤ r ∧ q ≤ p := + entry_selectName _ τ σ q + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.SetFormula + +def restrictionEntryFormula : SetFormula 5 := + ex (exConditions 4 (exConditions 5 (.conj (orderedPairFormula 3 2 1) + (.conj (pairMembershipFormula 2 0 4) + (.conj (pairMembershipFormula 1 0 7) (pairMembershipFormula 1 5 7)))))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_restrictionEntryFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets restrictionEntryFormula (extend z (extend τ.val (extend (s.encode p) + (extend s.carrier (extend s.conditionOrder Fin.elim0))))) ↔ + z ∈ (Name.restrictBelow p τ).val := by + let base := extend z (extend τ.val (extend (s.encode p) (extend s.carrier (extend s.conditionOrder Fin.elim0)))) + have hp := M.transitive carrier (s.encode_mem p) + rw [restrictionEntryFormula, realize_ex] + constructor + · rintro ⟨x, hx, rest⟩ + obtain ⟨q, rest⟩ := (M.realize_exConditions s 4 _ (extend x base) carrier rfl).1 rest + obtain ⟨r, shape, old, qr, qp⟩ := (M.realize_exConditions s 5 _ + (extend (s.encode q) (extend x base)) carrier rfl).1 rest + let e := extend (s.encode r) (extend (s.encode q) (extend x base)) + have hq := M.transitive carrier (s.encode_mem q) + have hr := M.transitive carrier (s.encode_mem r) + have raw := (M.realize_pairMembershipFormula pairing 2 0 4 e hx hr hτ).1 old + let σ : Name s := ⟨x, Name.isName_of_pair_mem τ x r raw⟩ + have eq := (M.realize_orderedPairFormula pairing 3 2 1 e hz hx hq).1 shape + change z = ZFSet.pair x (s.encode q) at eq + rw [eq] + exact (Name.entry_restrictBelow p τ σ q).2 ⟨r, raw, + (M.realize_conditionLE s pairing carrier order 1 0 7 e q r rfl rfl rfl).1 qr, + (M.realize_conditionLE s pairing carrier order 1 5 7 e q p rfl rfl rfl).1 qp⟩ + · intro member + obtain ⟨σ, q, eq⟩ := Name.entries_cover (Name.restrictBelow p τ) member + have entry : Name.Entry σ (Name.restrictBelow p τ) q := by + change ZFSet.pair σ.val (s.encode q) ∈ (Name.restrictBelow p τ).val + rwa [← eq] + obtain ⟨r, old, qr, qp⟩ := (Name.entry_restrictBelow p τ σ q).1 entry + have hσ := (M.nameDomain s).children hτ old + refine ⟨σ.val, hσ, ?_⟩ + apply (M.realize_exConditions s 4 _ (extend σ.val base) carrier rfl).2 + refine ⟨q, ?_⟩ + apply (M.realize_exConditions s 5 _ (extend (s.encode q) (extend σ.val base)) carrier rfl).2 + let e := extend (s.encode r) (extend (s.encode q) (extend σ.val base)) + refine ⟨r, ?_, ?_, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing 3 2 1 e hz hσ (M.transitive carrier (s.encode_mem q))).2 eq + · exact (M.realize_pairMembershipFormula pairing 2 0 4 e hσ (M.transitive carrier (s.encode_mem r)) hτ).2 old + · exact (M.realize_conditionLE s pairing carrier order 1 0 7 e q r rfl rfl rfl).2 qr + · exact (M.realize_conditionLE s pairing carrier order 1 5 7 e q p rfl rfl rfl).2 qp + +theorem restrictBelow_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) : (Name.restrictBelow p τ).val ∈ M.sets := by + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers + (M.union_mem unions (M.union_mem unions hτ)) carrier + have bound : (Name.restrictBelow p τ).val ⊆ B := by + intro z hz + obtain ⟨σ, q, rfl⟩ := Name.entries_cover (Name.restrictBelow p τ) hz + obtain ⟨r, old, _, _⟩ := (Name.entry_restrictBelow p τ σ q).1 hz + exact pairBound σ.val (Name.child_mem_doubleUnion old) (s.encode q) (s.encode_mem q) + let context := extend τ.val (extend (s.encode p) (extend s.carrier (extend s.conditionOrder Fin.elim0))) + have selected := M.separation_mem separation restrictionEntryFormula context + (Fin.cases hτ (Fin.cases (M.transitive carrier (s.encode_mem p)) + (Fin.cases carrier (Fin.cases order (fun i => Fin.elim0 i))))) hB + have eq : ZFSet.sep (fun z => Realize M.sets restrictionEntryFormula (extend z context)) B = + (Name.restrictBelow p τ).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (M.realize_restrictionEntryFormula s pairing carrier order p τ hτ z (M.transitive hB hz)).1 rel + · intro hz + exact ⟨bound hz, (M.realize_restrictionEntryFormula s pairing carrier order p τ hτ z + (M.transitive hB (bound hz))).2 hz⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization +universe u +variable {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +noncomputable def subgroupOrbitCodes (K : Subgroup G) (τ : Name s) : ZFSet.{u} := + ZFSet.range (fun g : K => (a.act s g.val τ).val) + +theorem mem_subgroupOrbitCodes (K : Subgroup G) (τ : Name s) (y : ZFSet.{u}) : + y ∈ a.subgroupOrbitCodes s K τ ↔ ∃ g ∈ K, y = (a.act s g τ).val := by + rw [subgroupOrbitCodes, ZFSet.mem_range] + constructor + · rintro ⟨g, eq⟩ + exact ⟨g.val, g.property, eq.symm⟩ + · rintro ⟨g, hg, eq⟩ + exact ⟨⟨g, hg⟩, eq.symm⟩ + +theorem entry_act_restrictBelow (g : G) (p : P) (τ σ : Name s) (q : P) : + Name.Entry σ (a.act s g (Name.restrictBelow p τ)) q ↔ + ∃ ν r, Name.Entry ν τ r ∧ a.act s g ν = σ ∧ q ≤ a.iso g p ∧ q ≤ a.iso g r := by + change Name.Entry σ (Name.rename s (a.iso g) (Name.restrictBelow p τ)) q ↔ _ + rw [Name.entry_rename] + constructor + · rintro ⟨ν, c, entry, eq, cq⟩ + obtain ⟨r, old, cr, cp⟩ := (Name.entry_restrictBelow p τ ν c).1 entry + refine ⟨ν, r, old, eq, ?_, ?_⟩ + · rw [← cq] + exact (a.iso g).monotone cp + · rw [← cq] + exact (a.iso g).monotone cr + · rintro ⟨ν, r, old, eq, qp, qr⟩ + refine ⟨ν, (a.iso g).symm q, (Name.entry_restrictBelow p τ ν _).2 ⟨r, old, ?_, ?_⟩, + eq, (a.iso g).apply_symm_apply q⟩ + · exact (a.iso g).le_iff_le.1 (by simpa only [OrderIso.apply_symm_apply] using qr) + · exact (a.iso g).le_iff_le.1 (by simpa only [OrderIso.apply_symm_apply] using qp) + +theorem mix_code_union (K : Subgroup G) (p : P) (τ : Name s) : + (a.mix s K p τ).val = ⋃₀ (a.subgroupOrbitCodes s K (Name.restrictBelow p τ)) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sUnion] + constructor + · intro hz + obtain ⟨σ, q, eq⟩ := Name.entries_cover (a.mix s K p τ) hz + have entry : Name.Entry σ (a.mix s K p τ) q := by + change ZFSet.pair σ.val (s.encode q) ∈ (a.mix s K p τ).val + rwa [← eq] + obtain ⟨g, hg, ν, r, old, moved, qp, qr⟩ := (a.entry_mix s K p τ σ q).1 entry + refine ⟨(a.act s g (Name.restrictBelow p τ)).val, + (a.mem_subgroupOrbitCodes s K _ _).2 ⟨g, hg, rfl⟩, ?_⟩ + rw [eq] + exact (a.entry_act_restrictBelow s g p τ σ q).2 ⟨ν, r, old, moved, qp, qr⟩ + · rintro ⟨w, hw, hz⟩ + obtain ⟨g, hg, rfl⟩ := (a.mem_subgroupOrbitCodes s K _ w).1 hw + obtain ⟨σ, q, eq⟩ := Name.entries_cover (a.act s g (Name.restrictBelow p τ)) hz + have entry : Name.Entry σ (a.act s g (Name.restrictBelow p τ)) q := by + change ZFSet.pair σ.val (s.encode q) ∈ (a.act s g (Name.restrictBelow p τ)).val + rwa [← eq] + obtain ⟨ν, r, old, moved, qp, qr⟩ := (a.entry_act_restrictBelow s g p τ σ q).1 entry + rw [eq] + exact (a.entry_mix s K p τ σ q).2 ⟨g, hg, ν, r, old, moved, qp, qr⟩ + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.SetFormula + +def subgroupOrbitFormula : SetFormula 6 := + exConditions 4 (.conj (.mem 0 3) + (atomicApplication codedNameActionFormula (extend 4 (extend 6 Fin.elim0)) 0 2 1)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem realize_subgroupOrbitFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (K : Subgroup G) (τ : Name s) (hτ : τ.val ∈ M.sets) (y : ZFSet.{u}) (hy : y ∈ M.sets) : + Realize M.sets subgroupOrbitFormula (extend y (extend τ.val (extend (t.subset (fun g => g ∈ K)) + (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔ + y ∈ a.subgroupOrbitCodes s K τ := by + rw [subgroupOrbitFormula, M.realize_exConditions t 4 _ _ group rfl, a.mem_subgroupOrbitCodes] + apply exists_congr + intro g + change (t.encode g ∈ t.subset (fun g => g ∈ K) ∧ Realize M.sets _ _) ↔ _ + rw [t.encode_mem_subset] + apply and_congr_right + intro _ + rw [realize_atomicApplication, map_extend, map_extend, map_empty] + change Realize M.sets codedNameActionFormula (extend (t.encode g) (extend τ.val (extend y + (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ _ + rw [M.realize_codedNameActionFormula a s t pairing unions powers separation collection carrier group maps g τ.val y hτ hy] + constructor + · rintro ⟨σ, eq, output⟩ + have names : σ.val = τ := Subtype.ext eq + rwa [names] at output + · intro eq + exact ⟨⟨τ, hτ⟩, rfl, eq⟩ + +theorem subgroupOrbitCodes_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) + (τ : Name s) (hτ : τ.val ∈ M.sets) : a.subgroupOrbitCodes s K τ ∈ M.sets := by + let W := ({τ.val, τ.val} : ZFSet.{u}) + have hW : W ∈ M.sets := M.unorderedPair_mem pairing hτ hτ + let B := a.orbitCodes s (M.nameDomain s) W + have hB := M.orbitCodes_mem a s t pairing unions powers separation collection carrier group maps W hW + have bound : a.subgroupOrbitCodes s K τ ⊆ B := by + intro y hy + obtain ⟨g, _, eq⟩ := (a.mem_subgroupOrbitCodes s K τ y).1 hy + exact (a.mem_orbitCodes s (M.nameDomain s) W y).2 + ⟨g, τ, hτ, ZFSet.mem_pair.2 (Or.inl rfl), eq⟩ + let context := extend τ.val (extend (t.subset (fun g => g ∈ K)) + (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))) + have selected := M.separation_mem separation subgroupOrbitFormula context + (Fin.cases hτ (Fin.cases hK (Fin.cases carrier (Fin.cases group (Fin.cases maps (fun i => Fin.elim0 i)))))) hB + have eq : ZFSet.sep (fun y => Realize M.sets subgroupOrbitFormula (extend y context)) B = + a.subgroupOrbitCodes s K τ := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hy, rel⟩ + exact (M.realize_subgroupOrbitFormula a s t pairing unions powers separation collection carrier group maps K τ hτ y + (M.transitive hB hy)).1 rel + · intro hy + exact ⟨bound hy, (M.realize_subgroupOrbitFormula a s t pairing unions powers separation collection carrier group maps K τ hτ y + (M.transitive hB (bound hy))).2 hy⟩ + exact eq ▸ selected + +theorem mix_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) + (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) : (a.mix s K p τ).val ∈ M.sets := by + rw [a.mix_code_union] + exact M.union_mem unions (M.subgroupOrbitCodes_mem a s t pairing unions powers separation collection carrier group maps K hK + (Name.restrictBelow p τ) (M.restrictBelow_mem s pairing unions powers separation carrier order p τ hτ)) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceForcingWitness.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceForcingWitness.lean index f65c2756aa692a7191967fd94c2ea674918082cd..e8742a9c4c55492792f40543e8052684d9cca13f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceForcingWitness.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceForcingWitness.lean @@ -1,339 +1,339 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula SetRealization -universe u - -namespace Name -variable {P : Type u} [Preorder P] (s : Presentation P) - -noncomputable def sequenceDecision (one : P) (τ : Name s) - (p : P) (n a : ZFSet.{u}) : Prop := - ForcesMem p (check s one (ZFSet.pair n a)) τ - -theorem sequenceDecision_mono (one : P) (τ : Name s) {p q : P} - (before : q ≤ p) {n a : ZFSet.{u}} (decision : sequenceDecision s one τ p n a) : - sequenceDecision s one τ q n a := forcesMem_mono decision before - -end Name - -namespace SetFormula - -def nameSequenceDecisionFormula : SetFormula 7 := - ex (ex (.conj (orderedPairFormula 1 3 4) - (.conj (binaryApplication uniformCheckFormula (extend 8 Fin.elim0) 1 0) - (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) - (extend 6 (extend 7 Fin.elim0)) 2 (extend 0 (extend 5 Fin.elim0)))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_nameSequenceDecisionFormula (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (τ : (M.nameDomain s).names) (p : P) (n a : ZFSet.{u}) - (hn : n ∈ M.sets) (ha : a ∈ M.sets) : - Realize M.sets nameSequenceDecisionFormula - (extend (s.encode p) (extend n (extend a (extend τ.val.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0))))))) ↔ - Name.sequenceDecision s one τ.val p n a := by - have hone := M.transitive carrier (s.encode_mem one) - have hp := M.transitive carrier (s.encode_mem p) - have hpair := M.orderedPair_mem pairing hn ha - have hcheck := M.check_mem s one pairing unions powers separation collection hone _ hpair - let checked : (M.nameDomain s).names := ⟨Name.check s one (ZFSet.pair n a), hcheck⟩ - let env := extend (s.encode p) (extend n (extend a (extend τ.val.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0)))))) - have forcing : - Realize M.sets - (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) - (extend 6 (extend 7 Fin.elim0)) 2 (extend 0 (extend 5 Fin.elim0))) - (extend checked.val.val (extend (ZFSet.pair n a) env)) ↔ - Name.sequenceDecision s one τ.val p n a := - M.realize_ordinaryGroundForcing s pairing unions powers separation collection carrier order - 0 1 (.mem 0 1) (extend 6 (extend 7 Fin.elim0)) 2 (extend 0 (extend 5 Fin.elim0)) - _ rfl rfl p (extend checked (extend τ Fin.elim0)) rfl - (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))) - rw [nameSequenceDecisionFormula, realize_ex] - constructor - · rintro ⟨v, hv, rest⟩ - obtain ⟨w, hw, pair, check, forced⟩ := (realize_ex M.sets _ _).1 rest - have pairEq : v = ZFSet.pair n a := (M.realize_orderedPairFormula pairing 1 3 4 - (extend w (extend v env)) hv hn ha).1 pair - rw [realize_binaryApplication, map_extend, map_empty] at check - have checkEq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection - hone v w hv hw).1 check - subst v - subst w - exact forcing.1 forced - · intro decision - refine ⟨ZFSet.pair n a, hpair, ?_⟩ - rw [realize_ex] - refine ⟨checked.val.val, hcheck, ?_, ?_, forcing.2 decision⟩ - · exact (M.realize_orderedPairFormula pairing 1 3 4 - (extend checked.val.val (extend (ZFSet.pair n a) env)) hpair hn ha).2 rfl - · rw [realize_binaryApplication, map_extend, map_empty] - exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection - hone _ _ hpair hcheck).2 rfl - -end TransitiveGround - -namespace Name -variable {P : Type u} [Preorder P] (s : Presentation P) - -noncomputable def sequenceDecisionRelation (one : P) (τ : Name s) (N U : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ p : P, ∃ n ∈ N, ∃ a ∈ U, - z = ZFSet.pair (ZFSet.pair (s.encode p) n) a ∧ sequenceDecision s one τ p n a) - (ZFSet.prod (ZFSet.prod s.carrier N) U) - -theorem mem_sequenceDecisionRelation (one : P) (τ : Name s) (N U z : ZFSet.{u}) : - z ∈ sequenceDecisionRelation s one τ N U ↔ - ∃ p : P, ∃ n ∈ N, ∃ a ∈ U, - z = ZFSet.pair (ZFSet.pair (s.encode p) n) a ∧ sequenceDecision s one τ p n a := by - rw [sequenceDecisionRelation, ZFSet.mem_sep] - refine ⟨fun h => h.2, ?_⟩ - rintro ⟨p, n, hn, a, ha, rfl, decision⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨s.encode_mem p, hn⟩, ha⟩, - p, n, hn, a, ha, rfl, decision⟩ - -theorem sequenceDecisionRelation_entry (one : P) (τ : Name s) (N U : ZFSet.{u}) - (p : P) (n a : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ sequenceDecisionRelation s one τ N U ↔ - n ∈ N ∧ a ∈ U ∧ sequenceDecision s one τ p n a := by - rw [mem_sequenceDecisionRelation] - constructor - · rintro ⟨q, m, hm, b, hb, equal, decision⟩ - obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨condition, rfl⟩ := ZFSet.pair_inj.1 inner - have same := s.injective condition - subst q - exact ⟨hm, hb, decision⟩ - · rintro ⟨hn, ha, decision⟩ - exact ⟨p, n, hn, a, ha, rfl, decision⟩ - -end Name - -namespace SetFormula - -def nameSequenceDecisionEntryFormula : SetFormula 7 := - ex (ex (ex (.conj (.mem 2 7) (.conj (.mem 1 4) (.conj (.mem 0 5) - (.conj (BoundedFormula.orderedTripleFormula 3 2 1 0).toFormula - (reindex (extend 2 (extend 1 (extend 0 (extend 6 - (extend 7 (extend 8 (extend 9 Fin.elim0))))))) nameSequenceDecisionFormula))))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_nameSequenceDecisionEntryFormula (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (τ : (M.nameDomain s).names) {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) - (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets nameSequenceDecisionEntryFormula - (extend z (extend N (extend U (extend τ.val.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0))))))) ↔ - z ∈ Name.sequenceDecisionRelation s one τ.val N U := by - let env := extend z (extend N (extend U (extend τ.val.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0)))))) - have members : ∀ j, env j ∈ M.sets := Fin.cases hz (Fin.cases hN (Fin.cases hU - (Fin.cases τ.property (Fin.cases carrier (Fin.cases order - (Fin.cases (M.transitive carrier (s.encode_mem one)) (fun i => Fin.elim0 i))))))) - have shape (p n a : ZFSet.{u}) (hp : p ∈ M.sets) (hn : n ∈ M.sets) (ha : a ∈ M.sets) : - Realize M.sets (BoundedFormula.orderedTripleFormula 3 2 1 0).toFormula - (extend a (extend n (extend p env))) ↔ z = ZFSet.pair (ZFSet.pair p n) a := - (BoundedFormula.realize_toFormula M _ _ (Fin.cases ha (Fin.cases hn (Fin.cases hp members)))).trans - (BoundedFormula.truth_orderedTripleFormula 3 2 1 0 _) - rw [nameSequenceDecisionEntryFormula, realize_ex, Name.mem_sequenceDecisionRelation] - constructor - · rintro ⟨v, hv, rest⟩ - obtain ⟨n, hnM, rest⟩ := (realize_ex M.sets _ _).1 rest - obtain ⟨a, haM, hvP, hn, ha, pair, decision⟩ := (realize_ex M.sets _ _).1 rest - obtain ⟨p, rfl⟩ := (s.mem_carrier v).1 hvP - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, - map_extend, map_extend, map_empty] at decision - exact ⟨p, n, hn, a, ha, (shape _ _ _ hv hnM haM).1 pair, - (M.realize_nameSequenceDecisionFormula s one pairing unions powers separation collection - carrier order τ p n a hnM haM).1 decision⟩ - · rintro ⟨p, n, hn, a, ha, pair, decision⟩ - have hp := M.transitive carrier (s.encode_mem p) - have hnM := M.transitive hN hn - have haM := M.transitive hU ha - refine ⟨s.encode p, hp, ?_⟩ - rw [realize_ex] - refine ⟨n, hnM, ?_⟩ - rw [realize_ex] - refine ⟨a, haM, s.encode_mem p, hn, ha, (shape _ _ _ hp hnM haM).2 pair, ?_⟩ - rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, - map_extend, map_extend, map_empty] - exact (M.realize_nameSequenceDecisionFormula s one pairing unions powers separation collection - carrier order τ p n a hnM haM).2 decision - -theorem sequenceDecisionRelation_mem (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (τ : (M.nameDomain s).names) {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) : - Name.sequenceDecisionRelation s one τ.val N U ∈ M.sets := by - let params := extend N (extend U (extend τ.val.val (extend s.carrier - (extend s.conditionOrder (extend (s.encode one) Fin.elim0))))) - have bound := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation carrier hN) hU - have selected := M.separation_mem separation nameSequenceDecisionEntryFormula params - (Fin.cases hN (Fin.cases hU (Fin.cases τ.property (Fin.cases carrier - (Fin.cases order (Fin.cases (M.transitive carrier (s.encode_mem one)) - (fun i => Fin.elim0 i))))))) bound - have equal : ZFSet.sep (fun z => Realize M.sets nameSequenceDecisionEntryFormula (extend z params)) - (ZFSet.prod (ZFSet.prod s.carrier N) U) = Name.sequenceDecisionRelation s one τ.val N U := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, code⟩ - exact (M.realize_nameSequenceDecisionEntryFormula s one pairing unions powers separation - collection carrier order τ hN hU z (M.transitive bound hz)).1 code - · intro hz - have bounded := (ZFSet.mem_sep.1 hz).1 - exact ⟨bounded, (M.realize_nameSequenceDecisionEntryFormula s one pairing unions powers separation - collection carrier order τ hN hU z (M.transitive bound bounded)).2 hz⟩ - exact equal ▸ selected - -end TransitiveGround -end - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) - -noncomputable def sequenceFunctionNameEnv {N U : ZFSet.{u}} - (hN : N ∈ M.sets) (hU : U ∈ M.sets) (τ : (M.nameDomain s).names) : - Assignment (M.nameDomain s) 3 := - extend ⟨Name.check s ⊤ N, M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) N hN⟩ - (extend ⟨Name.check s ⊤ U, M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) U hU⟩ (extend τ Fin.elim0)) - -theorem sequenceFunction_eval {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) - (τ : (M.nameDomain s).names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) {p₀ : P} (hp₀ : H.mem p₀) - (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula - (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p₀) : - ZFSet.IsFunc N U (Name.eval {q | H.mem q} τ.val) := by - let env := M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - have truth := forces_sound (M.nameDomain s) H generic _ env hp₀ forced - have function := (BoundedFormula.truth_functionFormula 0 1 2 - (evalAssignment {q | H.mem q} env)).1 - ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨env j, rfl⟩)).1 truth) - change ZFSet.IsFunc (Name.eval {q | H.mem q} (Name.check s ⊤ N)) - (Name.eval {q | H.mem q} (Name.check s ⊤ U)) (Name.eval {q | H.mem q} τ.val) at function - simpa only [Name.eval_check (s := s) {q | H.mem q} ⊤ H.top_mem] using function - -include pairing unions powers separation collection carrier in -theorem sequenceDecision_reading (τ : (M.nameDomain s).names) (n a : ZFSet.{u}) - (hn : n ∈ M.sets) (ha : a ∈ M.sets) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - ZFSet.pair n a ∈ Name.eval {q | H.mem q} τ.val ↔ - ∃ p, H.mem p ∧ Name.sequenceDecision s ⊤ τ.val p n a := by - have hcheck := M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) _ (M.orderedPair_mem pairing hn ha) - have exactReading := Name.eval_mem_iff_forcesMem (M.nameDomain s) H - (fun E member => generic E (Or.inl member)) hcheck τ.property - simpa only [Name.eval_check (s := s) {q | H.mem q} ⊤ H.top_mem, Name.sequenceDecision] using exactReading - -theorem sequenceDecision_unique_below (small : M.sets.Countable) - {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) (τ : (M.nameDomain s).names) - {p₀ : P} - (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula - (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p₀) - {p : P} (before : p ≤ p₀) {n a b : ZFSet.{u}} (hn : n ∈ N) (ha : a ∈ U) (hb : b ∈ U) - (first : Name.sequenceDecision s ⊤ τ.val p n a) - (second : Name.sequenceDecision s ⊤ τ.val p n b) : a = b := by - let : Countable P := M.conditions_countable s small carrier - obtain ⟨H, hp, generic⟩ := exists_generic_formulaFamily (M.nameDomain s) - (M.nameDomain_countable s small) p - have function := M.sequenceFunction_eval s pairing unions powers separation collection carrier - hN hU τ H generic (H.upward hp before) forced - have firstEntry := (M.sequenceDecision_reading s pairing unions powers separation collection carrier - τ n a (M.transitive hN hn) (M.transitive hU ha) H generic).2 ⟨p, hp, first⟩ - have secondEntry := (M.sequenceDecision_reading s pairing unions powers separation collection carrier - τ n b (M.transitive hN hn) (M.transitive hU hb) H generic).2 ⟨p, hp, second⟩ - obtain ⟨v, _, unique⟩ := function.2 n hn - exact (unique a firstEntry).trans (unique b secondEntry).symm - -theorem sequenceDecision_dense_below (small : M.sets.Countable) - {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) (τ : (M.nameDomain s).names) - {p₀ : P} - (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula - (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p₀) - {n : ZFSet.{u}} (hn : n ∈ N) : - DenseBelow p₀ {q | ∃ a ∈ U, Name.sequenceDecision s ⊤ τ.val q n a} := by - intro q before - let : Countable P := M.conditions_countable s small carrier - obtain ⟨H, hq, generic⟩ := exists_generic_formulaFamily (M.nameDomain s) - (M.nameDomain_countable s small) q - have function := M.sequenceFunction_eval s pairing unions powers separation collection carrier - hN hU τ H generic (H.upward hq before) forced - obtain ⟨a, entry, _⟩ := function.2 n hn - have ha : a ∈ U := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨r, hr, decision⟩ := (M.sequenceDecision_reading s pairing unions powers separation collection - carrier τ n a (M.transitive hN hn) (M.transitive hU ha) H generic).1 entry - obtain ⟨t, _, tq, tr⟩ := H.directed hq hr - exact ⟨t, tq, a, ha, Name.sequenceDecision_mono s ⊤ τ.val tr decision⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] -variable (s : Presentation P) - -theorem exists_sequenceFunction_forcing - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) - {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) - (τ : (M.nameDomain s).names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (function : ZFSet.IsFunc N U (Name.eval {q | H.mem q} τ.val)) : - ∃ p, H.mem p ∧ Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula - (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p := by - let env := M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - apply (forcing_truth (M.nameDomain s) H generic _ env).1 - apply (BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨env j, rfl⟩)).2 - apply (BoundedFormula.truth_functionFormula 0 1 2 (evalAssignment {q | H.mem q} env)).2 - change ZFSet.IsFunc (Name.eval {q | H.mem q} (Name.check s ⊤ N)) - (Name.eval {q | H.mem q} (Name.check s ⊤ U)) (Name.eval {q | H.mem q} τ.val) - simpa only [Name.eval_check (s := s) {q | H.mem q} ⊤ H.top_mem] using function - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula SetRealization +universe u + +namespace Name +variable {P : Type u} [Preorder P] (s : Presentation P) + +noncomputable def sequenceDecision (one : P) (τ : Name s) + (p : P) (n a : ZFSet.{u}) : Prop := + ForcesMem p (check s one (ZFSet.pair n a)) τ + +theorem sequenceDecision_mono (one : P) (τ : Name s) {p q : P} + (before : q ≤ p) {n a : ZFSet.{u}} (decision : sequenceDecision s one τ p n a) : + sequenceDecision s one τ q n a := forcesMem_mono decision before + +end Name + +namespace SetFormula + +def nameSequenceDecisionFormula : SetFormula 7 := + ex (ex (.conj (orderedPairFormula 1 3 4) + (.conj (binaryApplication uniformCheckFormula (extend 8 Fin.elim0) 1 0) + (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) + (extend 6 (extend 7 Fin.elim0)) 2 (extend 0 (extend 5 Fin.elim0)))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_nameSequenceDecisionFormula (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (τ : (M.nameDomain s).names) (p : P) (n a : ZFSet.{u}) + (hn : n ∈ M.sets) (ha : a ∈ M.sets) : + Realize M.sets nameSequenceDecisionFormula + (extend (s.encode p) (extend n (extend a (extend τ.val.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0))))))) ↔ + Name.sequenceDecision s one τ.val p n a := by + have hone := M.transitive carrier (s.encode_mem one) + have hp := M.transitive carrier (s.encode_mem p) + have hpair := M.orderedPair_mem pairing hn ha + have hcheck := M.check_mem s one pairing unions powers separation collection hone _ hpair + let checked : (M.nameDomain s).names := ⟨Name.check s one (ZFSet.pair n a), hcheck⟩ + let env := extend (s.encode p) (extend n (extend a (extend τ.val.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0)))))) + have forcing : + Realize M.sets + (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) + (extend 6 (extend 7 Fin.elim0)) 2 (extend 0 (extend 5 Fin.elim0))) + (extend checked.val.val (extend (ZFSet.pair n a) env)) ↔ + Name.sequenceDecision s one τ.val p n a := + M.realize_ordinaryGroundForcing s pairing unions powers separation collection carrier order + 0 1 (.mem 0 1) (extend 6 (extend 7 Fin.elim0)) 2 (extend 0 (extend 5 Fin.elim0)) + _ rfl rfl p (extend checked (extend τ Fin.elim0)) rfl + (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))) + rw [nameSequenceDecisionFormula, realize_ex] + constructor + · rintro ⟨v, hv, rest⟩ + obtain ⟨w, hw, pair, check, forced⟩ := (realize_ex M.sets _ _).1 rest + have pairEq : v = ZFSet.pair n a := (M.realize_orderedPairFormula pairing 1 3 4 + (extend w (extend v env)) hv hn ha).1 pair + rw [realize_binaryApplication, map_extend, map_empty] at check + have checkEq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection + hone v w hv hw).1 check + subst v + subst w + exact forcing.1 forced + · intro decision + refine ⟨ZFSet.pair n a, hpair, ?_⟩ + rw [realize_ex] + refine ⟨checked.val.val, hcheck, ?_, ?_, forcing.2 decision⟩ + · exact (M.realize_orderedPairFormula pairing 1 3 4 + (extend checked.val.val (extend (ZFSet.pair n a) env)) hpair hn ha).2 rfl + · rw [realize_binaryApplication, map_extend, map_empty] + exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection + hone _ _ hpair hcheck).2 rfl + +end TransitiveGround + +namespace Name +variable {P : Type u} [Preorder P] (s : Presentation P) + +noncomputable def sequenceDecisionRelation (one : P) (τ : Name s) (N U : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ p : P, ∃ n ∈ N, ∃ a ∈ U, + z = ZFSet.pair (ZFSet.pair (s.encode p) n) a ∧ sequenceDecision s one τ p n a) + (ZFSet.prod (ZFSet.prod s.carrier N) U) + +theorem mem_sequenceDecisionRelation (one : P) (τ : Name s) (N U z : ZFSet.{u}) : + z ∈ sequenceDecisionRelation s one τ N U ↔ + ∃ p : P, ∃ n ∈ N, ∃ a ∈ U, + z = ZFSet.pair (ZFSet.pair (s.encode p) n) a ∧ sequenceDecision s one τ p n a := by + rw [sequenceDecisionRelation, ZFSet.mem_sep] + refine ⟨fun h => h.2, ?_⟩ + rintro ⟨p, n, hn, a, ha, rfl, decision⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨s.encode_mem p, hn⟩, ha⟩, + p, n, hn, a, ha, rfl, decision⟩ + +theorem sequenceDecisionRelation_entry (one : P) (τ : Name s) (N U : ZFSet.{u}) + (p : P) (n a : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ sequenceDecisionRelation s one τ N U ↔ + n ∈ N ∧ a ∈ U ∧ sequenceDecision s one τ p n a := by + rw [mem_sequenceDecisionRelation] + constructor + · rintro ⟨q, m, hm, b, hb, equal, decision⟩ + obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨condition, rfl⟩ := ZFSet.pair_inj.1 inner + have same := s.injective condition + subst q + exact ⟨hm, hb, decision⟩ + · rintro ⟨hn, ha, decision⟩ + exact ⟨p, n, hn, a, ha, rfl, decision⟩ + +end Name + +namespace SetFormula + +def nameSequenceDecisionEntryFormula : SetFormula 7 := + ex (ex (ex (.conj (.mem 2 7) (.conj (.mem 1 4) (.conj (.mem 0 5) + (.conj (BoundedFormula.orderedTripleFormula 3 2 1 0).toFormula + (reindex (extend 2 (extend 1 (extend 0 (extend 6 + (extend 7 (extend 8 (extend 9 Fin.elim0))))))) nameSequenceDecisionFormula))))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_nameSequenceDecisionEntryFormula (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (τ : (M.nameDomain s).names) {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) + (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets nameSequenceDecisionEntryFormula + (extend z (extend N (extend U (extend τ.val.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0))))))) ↔ + z ∈ Name.sequenceDecisionRelation s one τ.val N U := by + let env := extend z (extend N (extend U (extend τ.val.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode one) Fin.elim0)))))) + have members : ∀ j, env j ∈ M.sets := Fin.cases hz (Fin.cases hN (Fin.cases hU + (Fin.cases τ.property (Fin.cases carrier (Fin.cases order + (Fin.cases (M.transitive carrier (s.encode_mem one)) (fun i => Fin.elim0 i))))))) + have shape (p n a : ZFSet.{u}) (hp : p ∈ M.sets) (hn : n ∈ M.sets) (ha : a ∈ M.sets) : + Realize M.sets (BoundedFormula.orderedTripleFormula 3 2 1 0).toFormula + (extend a (extend n (extend p env))) ↔ z = ZFSet.pair (ZFSet.pair p n) a := + (BoundedFormula.realize_toFormula M _ _ (Fin.cases ha (Fin.cases hn (Fin.cases hp members)))).trans + (BoundedFormula.truth_orderedTripleFormula 3 2 1 0 _) + rw [nameSequenceDecisionEntryFormula, realize_ex, Name.mem_sequenceDecisionRelation] + constructor + · rintro ⟨v, hv, rest⟩ + obtain ⟨n, hnM, rest⟩ := (realize_ex M.sets _ _).1 rest + obtain ⟨a, haM, hvP, hn, ha, pair, decision⟩ := (realize_ex M.sets _ _).1 rest + obtain ⟨p, rfl⟩ := (s.mem_carrier v).1 hvP + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, + map_extend, map_extend, map_empty] at decision + exact ⟨p, n, hn, a, ha, (shape _ _ _ hv hnM haM).1 pair, + (M.realize_nameSequenceDecisionFormula s one pairing unions powers separation collection + carrier order τ p n a hnM haM).1 decision⟩ + · rintro ⟨p, n, hn, a, ha, pair, decision⟩ + have hp := M.transitive carrier (s.encode_mem p) + have hnM := M.transitive hN hn + have haM := M.transitive hU ha + refine ⟨s.encode p, hp, ?_⟩ + rw [realize_ex] + refine ⟨n, hnM, ?_⟩ + rw [realize_ex] + refine ⟨a, haM, s.encode_mem p, hn, ha, (shape _ _ _ hp hnM haM).2 pair, ?_⟩ + rw [realize_reindex, map_extend, map_extend, map_extend, map_extend, map_extend, + map_extend, map_extend, map_empty] + exact (M.realize_nameSequenceDecisionFormula s one pairing unions powers separation collection + carrier order τ p n a hnM haM).2 decision + +theorem sequenceDecisionRelation_mem (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (τ : (M.nameDomain s).names) {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) : + Name.sequenceDecisionRelation s one τ.val N U ∈ M.sets := by + let params := extend N (extend U (extend τ.val.val (extend s.carrier + (extend s.conditionOrder (extend (s.encode one) Fin.elim0))))) + have bound := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation carrier hN) hU + have selected := M.separation_mem separation nameSequenceDecisionEntryFormula params + (Fin.cases hN (Fin.cases hU (Fin.cases τ.property (Fin.cases carrier + (Fin.cases order (Fin.cases (M.transitive carrier (s.encode_mem one)) + (fun i => Fin.elim0 i))))))) bound + have equal : ZFSet.sep (fun z => Realize M.sets nameSequenceDecisionEntryFormula (extend z params)) + (ZFSet.prod (ZFSet.prod s.carrier N) U) = Name.sequenceDecisionRelation s one τ.val N U := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, code⟩ + exact (M.realize_nameSequenceDecisionEntryFormula s one pairing unions powers separation + collection carrier order τ hN hU z (M.transitive bound hz)).1 code + · intro hz + have bounded := (ZFSet.mem_sep.1 hz).1 + exact ⟨bounded, (M.realize_nameSequenceDecisionEntryFormula s one pairing unions powers separation + collection carrier order τ hN hU z (M.transitive bound bounded)).2 hz⟩ + exact equal ▸ selected + +end TransitiveGround +end + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) + +noncomputable def sequenceFunctionNameEnv {N U : ZFSet.{u}} + (hN : N ∈ M.sets) (hU : U ∈ M.sets) (τ : (M.nameDomain s).names) : + Assignment (M.nameDomain s) 3 := + extend ⟨Name.check s ⊤ N, M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) N hN⟩ + (extend ⟨Name.check s ⊤ U, M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) U hU⟩ (extend τ Fin.elim0)) + +theorem sequenceFunction_eval {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) + (τ : (M.nameDomain s).names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) {p₀ : P} (hp₀ : H.mem p₀) + (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula + (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p₀) : + ZFSet.IsFunc N U (Name.eval {q | H.mem q} τ.val) := by + let env := M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + have truth := forces_sound (M.nameDomain s) H generic _ env hp₀ forced + have function := (BoundedFormula.truth_functionFormula 0 1 2 + (evalAssignment {q | H.mem q} env)).1 + ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨env j, rfl⟩)).1 truth) + change ZFSet.IsFunc (Name.eval {q | H.mem q} (Name.check s ⊤ N)) + (Name.eval {q | H.mem q} (Name.check s ⊤ U)) (Name.eval {q | H.mem q} τ.val) at function + simpa only [Name.eval_check (s := s) {q | H.mem q} ⊤ H.top_mem] using function + +include pairing unions powers separation collection carrier in +theorem sequenceDecision_reading (τ : (M.nameDomain s).names) (n a : ZFSet.{u}) + (hn : n ∈ M.sets) (ha : a ∈ M.sets) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + ZFSet.pair n a ∈ Name.eval {q | H.mem q} τ.val ↔ + ∃ p, H.mem p ∧ Name.sequenceDecision s ⊤ τ.val p n a := by + have hcheck := M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) _ (M.orderedPair_mem pairing hn ha) + have exactReading := Name.eval_mem_iff_forcesMem (M.nameDomain s) H + (fun E member => generic E (Or.inl member)) hcheck τ.property + simpa only [Name.eval_check (s := s) {q | H.mem q} ⊤ H.top_mem, Name.sequenceDecision] using exactReading + +theorem sequenceDecision_unique_below (small : M.sets.Countable) + {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) (τ : (M.nameDomain s).names) + {p₀ : P} + (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula + (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p₀) + {p : P} (before : p ≤ p₀) {n a b : ZFSet.{u}} (hn : n ∈ N) (ha : a ∈ U) (hb : b ∈ U) + (first : Name.sequenceDecision s ⊤ τ.val p n a) + (second : Name.sequenceDecision s ⊤ τ.val p n b) : a = b := by + let : Countable P := M.conditions_countable s small carrier + obtain ⟨H, hp, generic⟩ := exists_generic_formulaFamily (M.nameDomain s) + (M.nameDomain_countable s small) p + have function := M.sequenceFunction_eval s pairing unions powers separation collection carrier + hN hU τ H generic (H.upward hp before) forced + have firstEntry := (M.sequenceDecision_reading s pairing unions powers separation collection carrier + τ n a (M.transitive hN hn) (M.transitive hU ha) H generic).2 ⟨p, hp, first⟩ + have secondEntry := (M.sequenceDecision_reading s pairing unions powers separation collection carrier + τ n b (M.transitive hN hn) (M.transitive hU hb) H generic).2 ⟨p, hp, second⟩ + obtain ⟨v, _, unique⟩ := function.2 n hn + exact (unique a firstEntry).trans (unique b secondEntry).symm + +theorem sequenceDecision_dense_below (small : M.sets.Countable) + {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) (τ : (M.nameDomain s).names) + {p₀ : P} + (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula + (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p₀) + {n : ZFSet.{u}} (hn : n ∈ N) : + DenseBelow p₀ {q | ∃ a ∈ U, Name.sequenceDecision s ⊤ τ.val q n a} := by + intro q before + let : Countable P := M.conditions_countable s small carrier + obtain ⟨H, hq, generic⟩ := exists_generic_formulaFamily (M.nameDomain s) + (M.nameDomain_countable s small) q + have function := M.sequenceFunction_eval s pairing unions powers separation collection carrier + hN hU τ H generic (H.upward hq before) forced + obtain ⟨a, entry, _⟩ := function.2 n hn + have ha : a ∈ U := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨r, hr, decision⟩ := (M.sequenceDecision_reading s pairing unions powers separation collection + carrier τ n a (M.transitive hN hn) (M.transitive hU ha) H generic).1 entry + obtain ⟨t, _, tq, tr⟩ := H.directed hq hr + exact ⟨t, tq, a, ha, Name.sequenceDecision_mono s ⊤ τ.val tr decision⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] +variable (s : Presentation P) + +theorem exists_sequenceFunction_forcing + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) + {N U : ZFSet.{u}} (hN : N ∈ M.sets) (hU : U ∈ M.sets) + (τ : (M.nameDomain s).names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (function : ZFSet.IsFunc N U (Name.eval {q | H.mem q} τ.val)) : + ∃ p, H.mem p ∧ Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula + (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ) p := by + let env := M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier hN hU τ + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + apply (forcing_truth (M.nameDomain s) H generic _ env).1 + apply (BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨env j, rfl⟩)).2 + apply (BoundedFormula.truth_functionFormula 0 1 2 (evalAssignment {q | H.mem q} env)).2 + change ZFSet.IsFunc (Name.eval {q | H.mem q} (Name.check s ⊤ N)) + (Name.eval {q | H.mem q} (Name.check s ⊤ U)) (Name.eval {q | H.mem q} τ.val) + simpa only [Name.eval_check (s := s) {q | H.mem q} ⊤ H.top_mem] using function + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceValues.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceValues.lean index fae5a7b5747d3778f5158e0f412baef8aa83dcaa..c971f8d858477ee134cef636686db1ac40b378b1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceValues.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNameSequenceValues.lean @@ -1,730 +1,730 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNameSequenceForcingWitness -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerialOrbits - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def decisionStepGraph (P r U D : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ p ∈ P, - ∃ m ∈ ZFSet.omega, ∃ q ∈ P, ∃ a ∈ U, - z = ZFSet.pair (ZFSet.pair n p) (ZFSet.pair m q) ∧ - m = insert n n ∧ ZFSet.pair q p ∈ r ∧ ZFSet.pair (ZFSet.pair q n) a ∈ D) - (ZFSet.prod (ZFSet.prod ZFSet.omega P) (ZFSet.prod ZFSet.omega P)) - -theorem decisionStepGraph_subset (P r U D : ZFSet.{u}) : - decisionStepGraph P r U D ⊆ - ZFSet.prod (ZFSet.prod ZFSet.omega P) (ZFSet.prod ZFSet.omega P) := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem pair_mem_decisionStepGraph (P r U D n p m q : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair n p) (ZFSet.pair m q) ∈ decisionStepGraph P r U D ↔ - n ∈ ZFSet.omega ∧ p ∈ P ∧ m ∈ ZFSet.omega ∧ q ∈ P ∧ - m = insert n n ∧ ZFSet.pair q p ∈ r ∧ - ∃ a ∈ U, ZFSet.pair (ZFSet.pair q n) a ∈ D := by - rw [decisionStepGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, n', hn, p', hp, m', hm, q', hq, a, ha, equal, clock, stronger, decision⟩ - obtain ⟨first, second⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second - exact ⟨hn, hp, hm, hq, clock, stronger, a, ha, decision⟩ - · rintro ⟨hn, hp, hm, hq, clock, stronger, a, ha, decision⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hn, hp⟩, - ZFSet.pair_mem_prod.2 ⟨hm, hq⟩⟩, n, hn, p, hp, m, hm, q, hq, - a, ha, rfl, clock, stronger, decision⟩ - -namespace BoundedFormula -open SetFormula - -def decisionStepEntryFormula : BoundedFormula 6 := - exMem 1 (exMem 3 (exMem 3 (exMem 5 (exMem 8 - (.conj (pairOfPairsFormula 5 4 3 2 1) - (.conj (successorFormula 2 4) - (.conj (pairMembershipFormula 1 3 8) (tripleMembershipFormula 1 4 0 10)))))))) - -theorem truth_decisionStepEntryFormula (env : Fin 6 → ZFSet.{u}) : - Truth decisionStepEntryFormula env ↔ - ∃ n ∈ env 1, ∃ p ∈ env 2, ∃ m ∈ env 1, ∃ q ∈ env 2, ∃ a ∈ env 4, - env 0 = ZFSet.pair (ZFSet.pair n p) (ZFSet.pair m q) ∧ - m = insert n n ∧ ZFSet.pair q p ∈ env 3 ∧ - ZFSet.pair (ZFSet.pair q n) a ∈ env 5 := by - simp only [decisionStepEntryFormula, truth_exMem, Truth, truth_pairOfPairsFormula, - truth_successorFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem decisionStepGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {P r U D : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) - (hU : U ∈ M.sets) (hD : D ∈ M.sets) : decisionStepGraph P r U D ∈ M.sets := by - have hw := M.omega_mem separation infinite - have hW := M.prod_mem pairing unions powers separation hw hP - let params := extend ZFSet.omega (extend P (extend r (extend U (extend D Fin.elim0)))) - have members : ∀ j, params j ∈ M.sets := - Fin.cases hw (Fin.cases hP (Fin.cases hr (Fin.cases hU (Fin.cases hD (fun j => Fin.elim0 j))))) - have selected := M.bounded_separation_mem separation BoundedFormula.decisionStepEntryFormula - params members (M.prod_mem pairing unions powers separation hW hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.decisionStepEntryFormula - (extend z params)) (ZFSet.prod (ZFSet.prod ZFSet.omega P) (ZFSet.prod ZFSet.omega P)) = - decisionStepGraph P r U D := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, decisionStepGraph, ZFSet.mem_sep, - BoundedFormula.truth_decisionStepEntryFormula] - rfl - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem exists_groundDecisionChain - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (order : s.conditionOrder ∈ M.sets) {S U D : ZFSet.{u}} - (hS : S ∈ M.sets) (hU : U ∈ M.sets) (hD : D ∈ M.sets) (subset : S ⊆ s.carrier) - (p : P) (hp : s.encode p ∈ S) - (dense : ∀ n : Nat, ∀ p : P, s.encode p ∈ S → - ∃ q, q ≤ p ∧ s.encode q ∈ S ∧ - ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) (natSetCode n)) a ∈ D) : - ∃ seq : Nat → P, seq 0 = p ∧ - natPresentation.graph s (fun n => seq n.down) ∈ M.sets ∧ Antitone seq ∧ - (∀ n, s.encode (seq n) ∈ S) ∧ - ∀ n, ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode (seq (n + 1))) (natSetCode n)) a ∈ D := by - have hw := M.omega_mem separation infinite - let W := ZFSet.prod ZFSet.omega S - let R := decisionStepGraph S s.conditionOrder U D - have hW : W ∈ M.sets := M.prod_mem pairing unions powers separation hw hS - have hR : R ∈ M.sets := M.decisionStepGraph_mem pairing unions powers separation infinite hS order hU hD - have serial : ∀ x ∈ W, ∃ y ∈ W, ZFSet.pair x y ∈ R := by - intro x hx - obtain ⟨n, hn, raw, hraw, rfl⟩ := ZFSet.mem_prod.1 hx - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨q, rfl⟩ := (s.mem_carrier raw).1 (subset hraw) - obtain ⟨r, stronger, hr, a, ha, decision⟩ := dense k q hraw - exact ⟨ZFSet.pair (natSetCode (k + 1)) (s.encode r), - ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, hr⟩, - (pair_mem_decisionStepGraph _ _ _ _ _ _ _ _).2 - ⟨natSetCode_mem_omega _, hraw, natSetCode_mem_omega _, hr, rfl, - (s.pair_mem_conditionOrder r q).2 stronger, a, ha, decision⟩⟩ - obtain ⟨history, hHistory, function, zero, next⟩ := - M.exists_groundSerialOrbit pairing unions powers separation infinite choice hW hR - (ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega 0, hp⟩) serial - let t := natPresentation.product (SetMembers.presentation S) - let state : Nat → ULift.{u} Nat × SetMembers S := - fun n => natPresentation.decodeFunction t history function ⟨n⟩ - have entry (n : Nat) : ZFSet.pair (natSetCode n) - (ZFSet.pair (natSetCode (state n).1.down) (SetMembers.raw (state n).2)) ∈ history := - natPresentation.decodeFunction_mem t history function ⟨n⟩ - have initial : natSetCode (state 0).1.down = natSetCode 0 ∧ - SetMembers.raw (state 0).2 = s.encode p := - ZFSet.pair_inj.1 ((zero _).1 (entry 0)) - have steps (n : Nat) := (pair_mem_decisionStepGraph S s.conditionOrder U D - (natSetCode (state n).1.down) (SetMembers.raw (state n).2) - (natSetCode (state (n + 1)).1.down) (SetMembers.raw (state (n + 1)).2)).1 - (next (natSetCode n) (natSetCode_mem_omega n) _ _ (entry n) (entry (n + 1))) - have clock (n : Nat) : (state n).1.down = n := by - induction n with - | zero => exact natSetCode_injective initial.1 - | succ n ih => - have h : natSetCode (state (n + 1)).1.down = natSetCode ((state n).1.down + 1) := - (steps n).2.2.2.2.1 - exact (natSetCode_injective h).trans (congrArg (fun k => k + 1) ih) - let graph := relationCompose ZFSet.omega W S history (productSecond ZFSet.omega S) - have graphGround : graph ∈ M.sets := M.relationCompose_mem pairing unions powers separation - hw hW hS hHistory (M.productSecond_mem pairing unions powers separation hw hS) - have smallFunction : ZFSet.IsFunc ZFSet.omega S graph := - relationCompose_function_of_subset function (productSecond_function ZFSet.omega S) (fun _ h => h) - have graphFunction : ZFSet.IsFunc ZFSet.omega s.carrier graph := by - refine ⟨?_, smallFunction.2⟩ - intro z hz - obtain ⟨n, hn, q, hq, rfl⟩ := ZFSet.mem_prod.1 (smallFunction.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hn, subset hq⟩ - let seq : Nat → P := fun n => natPresentation.decodeFunction s graph graphFunction ⟨n⟩ - have projected (n : Nat) : ZFSet.pair (natSetCode n) (SetMembers.raw (state n).2) ∈ graph := - (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨natSetCode_mem_omega n, SetMembers.raw_mem _, _, - ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, SetMembers.raw_mem _⟩, entry n, - (mem_productSecond _ _ _).2 ⟨_, natSetCode_mem_omega _, _, SetMembers.raw_mem _, rfl⟩⟩ - have value (n : Nat) : s.encode (seq n) = SetMembers.raw (state n).2 := by - obtain ⟨_, _, unique⟩ := graphFunction.2 (natSetCode n) (natSetCode_mem_omega n) - exact (unique _ (natPresentation.decodeFunction_mem s graph graphFunction ⟨n⟩)).trans - (unique _ (projected n)).symm - refine ⟨seq, s.injective ((value 0).trans initial.2), - M.decoded_function_graph_mem natPresentation s graphGround graphFunction, ?_, ?_, ?_⟩ - · apply antitone_nat_of_succ_le - intro n - apply (s.pair_mem_conditionOrder _ _).1 - rw [value, value] - exact (steps n).2.2.2.2.2.1 - · intro n - rw [value] - exact SetMembers.raw_mem _ - · intro n - obtain ⟨a, ha, decision⟩ := (steps n).2.2.2.2.2.2 - refine ⟨a, ha, ?_⟩ - rw [value] - rw [clock] at decision - exact decision - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def decisionValues (U D p : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ a ∈ U, - z = ZFSet.pair n a ∧ ZFSet.pair (ZFSet.pair p n) a ∈ D) - (ZFSet.prod ZFSet.omega U) - -noncomputable def commonDecisionConditions (P U D : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun p => ∀ n ∈ ZFSet.omega, ∃ a ∈ U, - ZFSet.pair (ZFSet.pair p n) a ∈ D) P - -noncomputable def decisionDenseCode (P r U D base : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun p => (ZFSet.pair p base ∈ r ∧ p ∈ commonDecisionConditions P U D) ∨ - ¬ ∃ q ∈ P, ZFSet.pair q p ∈ r ∧ ZFSet.pair q base ∈ r) P - -theorem pair_mem_decisionValues (U D p n a : ZFSet.{u}) : - ZFSet.pair n a ∈ decisionValues U D p ↔ - n ∈ ZFSet.omega ∧ a ∈ U ∧ ZFSet.pair (ZFSet.pair p n) a ∈ D := by - rw [decisionValues, ZFSet.mem_sep] - constructor - · rintro ⟨_, m, hm, b, hb, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hm, hb, entry⟩ - · rintro ⟨hn, ha, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hn, ha⟩, n, hn, a, ha, rfl, entry⟩ - -theorem mem_commonDecisionConditions (P U D p : ZFSet.{u}) : - p ∈ commonDecisionConditions P U D ↔ - p ∈ P ∧ ∀ n ∈ ZFSet.omega, ∃ a ∈ U, ZFSet.pair (ZFSet.pair p n) a ∈ D := - ZFSet.mem_sep - -theorem mem_decisionDenseCode (P r U D base p : ZFSet.{u}) : - p ∈ decisionDenseCode P r U D base ↔ - p ∈ P ∧ ((ZFSet.pair p base ∈ r ∧ p ∈ commonDecisionConditions P U D) ∨ - ¬ ∃ q ∈ P, ZFSet.pair q p ∈ r ∧ ZFSet.pair q base ∈ r) := - ZFSet.mem_sep - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem decisionValues_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {U D p : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) (hp : p ∈ M.sets) : - decisionValues U D p ∈ M.sets := by - let formula : BoundedFormula 5 := BoundedFormula.exMem 1 (BoundedFormula.exMem 3 - (.conj (BoundedFormula.orderedPairFormula 2 1 0) - (BoundedFormula.tripleMembershipFormula 6 1 0 5))) - let params := extend ZFSet.omega (extend U (extend D (extend p Fin.elim0))) - have hw := M.omega_mem separation infinite - have members : ∀ j, params j ∈ M.sets := - Fin.cases hw (Fin.cases hU (Fin.cases hD (Fin.cases hp (fun j => Fin.elim0 j)))) - have ground := M.bounded_separation_mem separation formula params members - (M.prod_mem pairing unions powers separation hw hU) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) - (ZFSet.prod ZFSet.omega U) = decisionValues U D p := by - apply ZFSet.ext - intro z - simp only [ZFSet.mem_sep, decisionValues, formula, BoundedFormula.truth_exMem, - BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, - BoundedFormula.truth_tripleMembershipFormula] - rfl - exact equal ▸ ground - -theorem commonDecisionConditions_mem - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {P U D : ZFSet.{u}} (hP : P ∈ M.sets) (hU : U ∈ M.sets) (hD : D ∈ M.sets) : - commonDecisionConditions P U D ∈ M.sets := by - let formula : BoundedFormula 4 := .allMem 1 (BoundedFormula.exMem 3 - (BoundedFormula.tripleMembershipFormula 2 1 0 5)) - let params := extend ZFSet.omega (extend U (extend D Fin.elim0)) - have members : ∀ j, params j ∈ M.sets := - Fin.cases (M.omega_mem separation infinite) (Fin.cases hU (Fin.cases hD (fun j => Fin.elim0 j))) - have ground := M.bounded_separation_mem separation formula params members hP - have equal : ZFSet.sep (fun p => BoundedFormula.Truth formula (extend p params)) P = - commonDecisionConditions P U D := by - apply ZFSet.ext - intro p - simp only [ZFSet.mem_sep, commonDecisionConditions, formula, BoundedFormula.Truth, - BoundedFormula.truth_exMem, BoundedFormula.truth_tripleMembershipFormula] - rfl - exact equal ▸ ground - -theorem decisionDenseCode_mem - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {P r U D base : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) - (hU : U ∈ M.sets) (hD : D ∈ M.sets) (hbase : base ∈ M.sets) : - decisionDenseCode P r U D base ∈ M.sets := by - let formula : BoundedFormula 5 := BoundedFormula.disj - (.conj (BoundedFormula.pairMembershipFormula 0 3 2) (.mem 0 4)) - (.neg (BoundedFormula.exMem 1 (.conj (BoundedFormula.pairMembershipFormula 0 1 3) - (BoundedFormula.pairMembershipFormula 0 4 3)))) - let common := commonDecisionConditions P U D - let params := extend P (extend r (extend base (extend common Fin.elim0))) - have members : ∀ j, params j ∈ M.sets := - Fin.cases hP (Fin.cases hr (Fin.cases hbase - (Fin.cases (M.commonDecisionConditions_mem separation infinite hP hU hD) (fun j => Fin.elim0 j)))) - have ground := M.bounded_separation_mem separation formula params members hP - have equal : ZFSet.sep (fun p => BoundedFormula.Truth formula (extend p params)) P = - decisionDenseCode P r U D base := by - apply ZFSet.ext - intro p - simp only [ZFSet.mem_sep, decisionDenseCode, formula, BoundedFormula.truth_disj, - BoundedFormula.Truth, BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] - rfl - exact equal ▸ ground - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem internally_commonDecisions_denseBelow - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {U D : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) - (closed : InternallyCountablyClosed M s) (base : P) - (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) - (dense : ∀ n ∈ ZFSet.omega, DenseBelow base - {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) : - DenseBelow base {q | q ≤ base ∧ ∀ n ∈ ZFSet.omega, - ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D} := by - intro p below - let S := attachmentIdeal s.carrier s.conditionOrder (s.encode base) - have hS : S ∈ M.sets := M.attachmentIdeal_mem separation carrier order - (M.transitive carrier (s.encode_mem base)) - have subset : S ⊆ s.carrier := fun _ h => (ZFSet.mem_sep.1 h).1 - have cone (q : P) : s.encode q ∈ S ↔ q ≤ base := by - rw [mem_attachmentIdeal, s.pair_mem_conditionOrder] - exact ⟨And.right, fun h => ⟨s.encode_mem q, h⟩⟩ - obtain ⟨seq, initial, graph, decreasing, _, decisions⟩ := - M.exists_groundDecisionChain s pairing unions powers separation infinite choice order - hS hU hD subset p ((cone p).2 below) (fun n q hq => by - obtain ⟨r, stronger, a, ha, decided⟩ := dense (natSetCode n) (natSetCode_mem_omega n) - q ((cone q).1 hq) - exact ⟨r, stronger, (cone r).2 (stronger.trans ((cone q).1 hq)), a, ha, decided⟩) - obtain ⟨q, lower⟩ := closed seq graph decreasing - have stronger : q ≤ p := initial ▸ lower 0 - refine ⟨q, stronger, stronger.trans below, ?_⟩ - intro n hn - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨a, ha, decided⟩ := decisions k - exact ⟨a, ha, persistent _ q (lower (k + 1)) _ (natSetCode_mem_omega k) a ha decided⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -private noncomputable def enumeratedFamilyDecisions (Q J B g f : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ p ∈ Q, ∃ n ∈ ZFSet.omega, ∃ j ∈ J, ∃ E ∈ B, - z = ZFSet.pair (ZFSet.pair p n) j ∧ ZFSet.pair n j ∈ g ∧ - ZFSet.pair j E ∈ f ∧ p ∈ E) (ZFSet.prod (ZFSet.prod Q ZFSet.omega) J) - -private theorem enumeratedFamilyDecisions_entry (Q J B g f p n j : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair p n) j ∈ enumeratedFamilyDecisions Q J B g f ↔ - p ∈ Q ∧ n ∈ ZFSet.omega ∧ j ∈ J ∧ ZFSet.pair n j ∈ g ∧ - ∃ E ∈ B, ZFSet.pair j E ∈ f ∧ p ∈ E := by - rw [enumeratedFamilyDecisions, ZFSet.mem_sep] - constructor - · rintro ⟨_, p', hp, n', hn, j', hj, E, hE, eq, ng, ef, member⟩ - obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 eq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - exact ⟨hp, hn, hj, ng, E, hE, ef, member⟩ - · rintro ⟨hp, hn, hj, ng, E, hE, ef, member⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hp, hn⟩, hj⟩, - p, hp, n, hn, j, hj, E, hE, rfl, ng, ef, member⟩ - -private def enumeratedFamilyDecisionFormula : BoundedFormula 7 := - .exMem 1 (.exMem 3 (.exMem 5 (.exMem 7 - (.conj (BoundedFormula.orderedTripleFormula 4 3 2 1) - (.conj (BoundedFormula.pairMembershipFormula 2 1 9) - (.conj (BoundedFormula.pairMembershipFormula 1 0 10) (.mem 3 0))))))) - -private theorem enumeratedFamilyDecisionFormula_truth (env : Fin 7 → ZFSet.{u}) : - BoundedFormula.Truth enumeratedFamilyDecisionFormula env ↔ - ∃ p ∈ env 1, ∃ n ∈ env 2, ∃ j ∈ env 3, ∃ E ∈ env 4, - env 0 = ZFSet.pair (ZFSet.pair p n) j ∧ ZFSet.pair n j ∈ env 5 ∧ - ZFSet.pair j E ∈ env 6 ∧ p ∈ E := by - simp only [enumeratedFamilyDecisionFormula, BoundedFormula.truth_exMem, - BoundedFormula.Truth, BoundedFormula.truth_orderedTripleFormula, - BoundedFormula.truth_pairMembershipFormula] - rfl - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem internally_countableDenseFamily_denseBelow - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {J f : ZFSet.{u}} (hJ : J ∈ M.sets) (hf : f ∈ M.sets) - (small : M.groundEmbeddable J ZFSet.omega) - (function : ZFSet.IsFunc J (M.groundPower s.carrier) f) - (closed : InternallyCountablyClosed M s) (base : P) - (persistent : ∀ j E, ZFSet.pair j E ∈ f → ∀ p q : P, - q ≤ p → s.encode p ∈ E → s.encode q ∈ E) - (dense : ∀ j E, ZFSet.pair j E ∈ f → DenseBelow base {q | s.encode q ∈ E}) : - DenseBelow base {q | q ≤ base ∧ ∀ j E, ZFSet.pair j E ∈ f → s.encode q ∈ E} := by - classical - by_cases nonempty : J.Nonempty - · obtain ⟨g, hg, enumeration, onto⟩ := M.groundCountable_enumeration - pairing unions powers separation infinite hJ nonempty small - let B := M.groundPower s.carrier - let D := enumeratedFamilyDecisions s.carrier J B g f - have hN := M.omega_mem separation infinite - have hB : B ∈ M.sets := M.groundPower_mem powers carrier - let params := ![s.carrier, ZFSet.omega, J, B, g, f] - have members : ∀ i, params i ∈ M.sets := Fin.cases carrier (Fin.cases hN - (Fin.cases hJ (Fin.cases hB (Fin.cases hg (Fin.cases hf (fun i => Fin.elim0 i)))))) - have selected := M.bounded_separation_mem separation enumeratedFamilyDecisionFormula - params members (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation carrier hN) hJ) - have hD : D ∈ M.sets := by - have equal : ZFSet.sep (fun z => BoundedFormula.Truth enumeratedFamilyDecisionFormula - (extend z params)) (ZFSet.prod (ZFSet.prod s.carrier ZFSet.omega) J) = D := by - apply ZFSet.ext - intro z - change _ ↔ z ∈ enumeratedFamilyDecisions s.carrier J B g f - rw [ZFSet.mem_sep, enumeratedFamilyDecisions, ZFSet.mem_sep, - enumeratedFamilyDecisionFormula_truth] - rfl - exact equal ▸ selected - have persistD : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ j ∈ J, - ZFSet.pair (ZFSet.pair (s.encode p) n) j ∈ D → - ZFSet.pair (ZFSet.pair (s.encode q) n) j ∈ D := by - intro p q qp n hn j hj entry - obtain ⟨_, _, _, ng, E, hE, ef, member⟩ := - (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode p) n j).1 entry - exact (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode q) n j).2 - ⟨s.encode_mem q, hn, hj, ng, E, hE, ef, persistent j E ef p q qp member⟩ - have denseD : ∀ n ∈ ZFSet.omega, DenseBelow base - {q | ∃ j ∈ J, ZFSet.pair (ZFSet.pair (s.encode q) n) j ∈ D} := by - intro n hn p pb - obtain ⟨j, ng, _⟩ := enumeration.2 n hn - have hj := (ZFSet.pair_mem_prod.1 (enumeration.1 ng)).2 - obtain ⟨E, ef, _⟩ := function.2 j hj - have hE := (ZFSet.pair_mem_prod.1 (function.1 ef)).2 - obtain ⟨q, qp, member⟩ := dense j E ef p pb - exact ⟨q, qp, j, hj, - (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode q) n j).2 - ⟨s.encode_mem q, hn, hj, ng, E, hE, ef, member⟩⟩ - have common := M.internally_commonDecisions_denseBelow s pairing unions powers separation - infinite choice carrier order hJ hD closed base persistD denseD - intro p pb - obtain ⟨q, qp, qb, decisions⟩ := common p pb - refine ⟨q, qp, qb, ?_⟩ - intro j E ef - have hj := (ZFSet.pair_mem_prod.1 (function.1 ef)).1 - obtain ⟨n, hn, ng⟩ := onto j hj - obtain ⟨j', _, entry⟩ := decisions n hn - obtain ⟨_, _, _, ng', E', _, ef', member⟩ := - (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode q) n j').1 entry - obtain ⟨_, _, uniqueJ⟩ := enumeration.2 n hn - have sameJ : j' = j := (uniqueJ _ ng').trans (uniqueJ _ ng).symm - subst j' - obtain ⟨_, _, uniqueE⟩ := function.2 j hj - have sameE : E' = E := (uniqueE _ ef').trans (uniqueE _ ef).symm - exact sameE ▸ member - · intro p pb - refine ⟨p, le_rfl, pb, ?_⟩ - intro j E ef - exact False.elim (nonempty ⟨j, (ZFSet.pair_mem_prod.1 (function.1 ef)).1⟩) - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u -variable {P : Type u} [Preorder P] (s : Presentation P) - -theorem decisionDenseCode_eq (U D : ZFSet.{u}) (base : P) : - s.subset (Localized base {q | q ≤ base ∧ ∀ n ∈ ZFSet.omega, - ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) = - decisionDenseCode s.carrier s.conditionOrder U D (s.encode base) := by - have compatible (p : P) : - (∃ q ∈ s.carrier, ZFSet.pair q (s.encode p) ∈ s.conditionOrder ∧ - ZFSet.pair q (s.encode base) ∈ s.conditionOrder) ↔ Compatible p base := by - constructor - · rintro ⟨q, hq, below, belowBase⟩ - obtain ⟨q, rfl⟩ := (s.mem_carrier q).1 hq - exact ⟨q, (s.pair_mem_conditionOrder _ _).1 below, - (s.pair_mem_conditionOrder _ _).1 belowBase⟩ - · rintro ⟨q, below, belowBase⟩ - exact ⟨s.encode q, s.encode_mem q, (s.pair_mem_conditionOrder _ _).2 below, - (s.pair_mem_conditionOrder _ _).2 belowBase⟩ - have each (p : P) : - s.encode p ∈ decisionDenseCode s.carrier s.conditionOrder U D (s.encode base) ↔ - p ∈ Localized base {q | q ≤ base ∧ ∀ n ∈ ZFSet.omega, - ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D} := by - simp only [mem_decisionDenseCode, mem_commonDecisionConditions, - s.pair_mem_conditionOrder, s.encode_mem, true_and, compatible, Localized, Set.mem_ofPred_eq] - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨p, hp, rfl⟩ := (s.mem_subset _ z).1 hz - exact (each p).2 hp - · intro hz - have bound := (mem_decisionDenseCode _ _ _ _ _ z).1 hz - obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 bound.1 - exact (s.encode_mem_subset _ p).2 ((each p).1 hz) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem generic_common_decisions - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {U D : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) - (closed : InternallyCountablyClosed M s) (base : P) - (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) - (dense : ∀ n ∈ ZFSet.omega, DenseBelow base - {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) - (H : ConditionFilter P) (generic : H.GenericFor (M.codedFamily s)) (hbase : H.mem base) : - ∃ q, H.mem q ∧ q ≤ base ∧ ∀ n ∈ ZFSet.omega, - ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D := by - have density := M.internally_commonDecisions_denseBelow s pairing unions powers separation infinite choice - carrier order hU hD closed base persistent dense - have code := M.decisionDenseCode_mem separation infinite carrier order hU hD - (M.transitive carrier (s.encode_mem base)) - rw [← decisionDenseCode_eq s U D base] at code - exact H.meets_below generic hbase (M.codedFamily_of_code s code) density - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem decisionValues_function {U D p : ZFSet.{u}} - (total : ∀ n ∈ ZFSet.omega, ∃ a ∈ U, ZFSet.pair (ZFSet.pair p n) a ∈ D) - (unique : ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, - ZFSet.pair (ZFSet.pair p n) a ∈ D → ZFSet.pair (ZFSet.pair p n) b ∈ D → a = b) : - ZFSet.IsFunc ZFSet.omega U (decisionValues U D p) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro n hn - obtain ⟨a, ha, decision⟩ := total n hn - refine ⟨a, (pair_mem_decisionValues _ _ _ _ _).2 ⟨hn, ha, decision⟩, ?_⟩ - intro b hb - have actual := (pair_mem_decisionValues _ _ _ _ _).1 hb - exact unique n hn b actual.2.1 a ha actual.2.2 decision - -variable {P : Type u} [Preorder P] (s : Presentation P) - -theorem decisionValues_eq_reading {U D f : ZFSet.{u}} (base : P) - (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) - (unique : ∀ p : P, p ≤ base → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D → a = b) - (H : ConditionFilter P) {q : P} (hq : H.mem q) (below : q ≤ base) - (total : ∀ n ∈ ZFSet.omega, ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) - (function : ZFSet.IsFunc ZFSet.omega U f) - (realizes : ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ZFSet.pair n a ∈ f → - ∃ p, H.mem p ∧ ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D) : - decisionValues U D (s.encode q) = f := by - have agree (p : P) (hp : H.mem p) (n : ZFSet.{u}) (hn : n ∈ ZFSet.omega) - (a b : ZFSet.{u}) (ha : a ∈ U) (hb : b ∈ U) - (first : ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) - (second : ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D) : a = b := by - obtain ⟨r, _, rq, rp⟩ := H.directed hq hp - exact unique r (rq.trans below) n hn a ha b hb - (persistent q r rq n hn a ha first) (persistent p r rp n hn b hb second) - have same (n : ZFSet.{u}) (hn : n ∈ ZFSet.omega) (a : ZFSet.{u}) (ha : a ∈ U) : - ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D ↔ ZFSet.pair n a ∈ f := by - constructor - · intro decision - obtain ⟨b, entry, _⟩ := function.2 n hn - have hb := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨p, hp, read⟩ := realizes n hn b hb entry - exact (agree p hp n hn a b ha hb decision read).symm ▸ entry - · intro entry - obtain ⟨b, hb, decision⟩ := total n hn - obtain ⟨p, hp, read⟩ := realizes n hn a ha entry - exact agree p hp n hn b a hb ha decision read ▸ decision - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨n, hn, a, ha, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - exact (same n hn a ha).1 ((pair_mem_decisionValues _ _ _ _ _).1 hz).2.2 - · intro hz - obtain ⟨n, hn, a, ha, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact (pair_mem_decisionValues _ _ _ _ _).2 ⟨hn, ha, (same n hn a ha).2 hz⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem generic_decision_reading_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {U D : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) - (closed : InternallyCountablyClosed M s) (base : P) - (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) - (unique : ∀ p : P, p ≤ base → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D → a = b) - (dense : ∀ n ∈ ZFSet.omega, DenseBelow base - {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) - (H : ConditionFilter P) (generic : H.GenericFor (M.codedFamily s)) (hbase : H.mem base) - {f : ZFSet.{u}} (function : ZFSet.IsFunc ZFSet.omega U f) - (realizes : ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ZFSet.pair n a ∈ f → - ∃ p, H.mem p ∧ ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D) : - f ∈ M.sets ∧ ∃ q, H.mem q ∧ q ≤ base ∧ decisionValues U D (s.encode q) = f := by - obtain ⟨q, hq, below, total⟩ := M.generic_common_decisions s pairing unions powers separation - infinite choice carrier order hU hD closed base persistent dense H generic hbase - have equal := decisionValues_eq_reading s base persistent unique H hq below total function realizes - exact ⟨equal ▸ M.decisionValues_mem pairing unions powers separation infinite hU hD - (M.transitive carrier (s.encode_mem q)), q, hq, below, equal⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection infinite choice carrier order in -theorem sequence_value_ground (small : M.sets.Countable) - {U : ZFSet.{u}} (hU : U ∈ M.sets) (closed : InternallyCountablyClosed M s) - (τ : (M.nameDomain s).names) (H : ConditionFilter P) - (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - {base : P} (hbase : H.mem base) - (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula - (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier - (M.omega_mem separation infinite) hU τ) base) : - Name.eval {q | H.mem q} τ.val ∈ M.sets ∧ - ∃ q, H.mem q ∧ q ≤ base ∧ decisionValues U - (Name.sequenceDecisionRelation s ⊤ τ.val ZFSet.omega U) (s.encode q) = - Name.eval {q | H.mem q} τ.val := by - have hN := M.omega_mem separation infinite - have hD := M.sequenceDecisionRelation_mem s ⊤ pairing unions powers separation collection - carrier order τ hN hU - have function := M.sequenceFunction_eval s pairing unions powers separation collection carrier - hN hU τ H genericFormula hbase forced - refine M.generic_decision_reading_ground s pairing unions powers separation infinite choice - carrier order hU hD closed base ?_ ?_ ?_ H genericCoded hbase function ?_ - · intro p q before n hn a ha entry - have decision := (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n a).1 entry - exact (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U q n a).2 - ⟨hn, ha, Name.sequenceDecision_mono s ⊤ τ.val before decision.2.2⟩ - · intro p before n hn a ha b hb first second - exact M.sequenceDecision_unique_below s pairing unions powers separation collection carrier - small hN hU τ forced before hn ha hb - ((Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n a).1 first).2.2 - ((Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n b).1 second).2.2 - · intro n hn q before - obtain ⟨r, rq, a, ha, decision⟩ := M.sequenceDecision_dense_below s pairing unions powers - separation collection carrier small hN hU τ forced hn q before - exact ⟨r, rq, a, ha, - (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U r n a).2 ⟨hn, ha, decision⟩⟩ - · intro n hn a ha entry - obtain ⟨p, hp, decision⟩ := (M.sequenceDecision_reading s pairing unions powers separation - collection carrier τ n a (M.transitive hN hn) (M.transitive hU ha) H genericFormula).1 entry - exact ⟨p, hp, - (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n a).2 ⟨hn, ha, decision⟩⟩ - -include pairing unions powers separation collection infinite choice carrier order in -theorem sequence_value_ground_of_function (small : M.sets.Countable) - {U : ZFSet.{u}} (hU : U ∈ M.sets) (closed : InternallyCountablyClosed M s) - (τ : (M.nameDomain s).names) (H : ConditionFilter P) - (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (function : ZFSet.IsFunc ZFSet.omega U (Name.eval {q | H.mem q} τ.val)) : - Name.eval {q | H.mem q} τ.val ∈ M.sets ∧ - ∃ q, H.mem q ∧ decisionValues U - (Name.sequenceDecisionRelation s ⊤ τ.val ZFSet.omega U) (s.encode q) = - Name.eval {q | H.mem q} τ.val := by - obtain ⟨base, hbase, forced⟩ := M.exists_sequenceFunction_forcing s pairing unions powers - separation collection carrier (M.omega_mem separation infinite) hU τ H genericFormula function - obtain ⟨ground, q, hq, _, equal⟩ := M.sequence_value_ground s pairing unions powers separation - collection infinite choice carrier order small hU closed τ H genericCoded genericFormula hbase forced - exact ⟨ground, q, hq, equal⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNameSequenceForcingWitness +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerialOrbits + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def decisionStepGraph (P r U D : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ p ∈ P, + ∃ m ∈ ZFSet.omega, ∃ q ∈ P, ∃ a ∈ U, + z = ZFSet.pair (ZFSet.pair n p) (ZFSet.pair m q) ∧ + m = insert n n ∧ ZFSet.pair q p ∈ r ∧ ZFSet.pair (ZFSet.pair q n) a ∈ D) + (ZFSet.prod (ZFSet.prod ZFSet.omega P) (ZFSet.prod ZFSet.omega P)) + +theorem decisionStepGraph_subset (P r U D : ZFSet.{u}) : + decisionStepGraph P r U D ⊆ + ZFSet.prod (ZFSet.prod ZFSet.omega P) (ZFSet.prod ZFSet.omega P) := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem pair_mem_decisionStepGraph (P r U D n p m q : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair n p) (ZFSet.pair m q) ∈ decisionStepGraph P r U D ↔ + n ∈ ZFSet.omega ∧ p ∈ P ∧ m ∈ ZFSet.omega ∧ q ∈ P ∧ + m = insert n n ∧ ZFSet.pair q p ∈ r ∧ + ∃ a ∈ U, ZFSet.pair (ZFSet.pair q n) a ∈ D := by + rw [decisionStepGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, n', hn, p', hp, m', hm, q', hq, a, ha, equal, clock, stronger, decision⟩ + obtain ⟨first, second⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second + exact ⟨hn, hp, hm, hq, clock, stronger, a, ha, decision⟩ + · rintro ⟨hn, hp, hm, hq, clock, stronger, a, ha, decision⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hn, hp⟩, + ZFSet.pair_mem_prod.2 ⟨hm, hq⟩⟩, n, hn, p, hp, m, hm, q, hq, + a, ha, rfl, clock, stronger, decision⟩ + +namespace BoundedFormula +open SetFormula + +def decisionStepEntryFormula : BoundedFormula 6 := + exMem 1 (exMem 3 (exMem 3 (exMem 5 (exMem 8 + (.conj (pairOfPairsFormula 5 4 3 2 1) + (.conj (successorFormula 2 4) + (.conj (pairMembershipFormula 1 3 8) (tripleMembershipFormula 1 4 0 10)))))))) + +theorem truth_decisionStepEntryFormula (env : Fin 6 → ZFSet.{u}) : + Truth decisionStepEntryFormula env ↔ + ∃ n ∈ env 1, ∃ p ∈ env 2, ∃ m ∈ env 1, ∃ q ∈ env 2, ∃ a ∈ env 4, + env 0 = ZFSet.pair (ZFSet.pair n p) (ZFSet.pair m q) ∧ + m = insert n n ∧ ZFSet.pair q p ∈ env 3 ∧ + ZFSet.pair (ZFSet.pair q n) a ∈ env 5 := by + simp only [decisionStepEntryFormula, truth_exMem, Truth, truth_pairOfPairsFormula, + truth_successorFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem decisionStepGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {P r U D : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) + (hU : U ∈ M.sets) (hD : D ∈ M.sets) : decisionStepGraph P r U D ∈ M.sets := by + have hw := M.omega_mem separation infinite + have hW := M.prod_mem pairing unions powers separation hw hP + let params := extend ZFSet.omega (extend P (extend r (extend U (extend D Fin.elim0)))) + have members : ∀ j, params j ∈ M.sets := + Fin.cases hw (Fin.cases hP (Fin.cases hr (Fin.cases hU (Fin.cases hD (fun j => Fin.elim0 j))))) + have selected := M.bounded_separation_mem separation BoundedFormula.decisionStepEntryFormula + params members (M.prod_mem pairing unions powers separation hW hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.decisionStepEntryFormula + (extend z params)) (ZFSet.prod (ZFSet.prod ZFSet.omega P) (ZFSet.prod ZFSet.omega P)) = + decisionStepGraph P r U D := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, decisionStepGraph, ZFSet.mem_sep, + BoundedFormula.truth_decisionStepEntryFormula] + rfl + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem exists_groundDecisionChain + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (order : s.conditionOrder ∈ M.sets) {S U D : ZFSet.{u}} + (hS : S ∈ M.sets) (hU : U ∈ M.sets) (hD : D ∈ M.sets) (subset : S ⊆ s.carrier) + (p : P) (hp : s.encode p ∈ S) + (dense : ∀ n : Nat, ∀ p : P, s.encode p ∈ S → + ∃ q, q ≤ p ∧ s.encode q ∈ S ∧ + ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) (natSetCode n)) a ∈ D) : + ∃ seq : Nat → P, seq 0 = p ∧ + natPresentation.graph s (fun n => seq n.down) ∈ M.sets ∧ Antitone seq ∧ + (∀ n, s.encode (seq n) ∈ S) ∧ + ∀ n, ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode (seq (n + 1))) (natSetCode n)) a ∈ D := by + have hw := M.omega_mem separation infinite + let W := ZFSet.prod ZFSet.omega S + let R := decisionStepGraph S s.conditionOrder U D + have hW : W ∈ M.sets := M.prod_mem pairing unions powers separation hw hS + have hR : R ∈ M.sets := M.decisionStepGraph_mem pairing unions powers separation infinite hS order hU hD + have serial : ∀ x ∈ W, ∃ y ∈ W, ZFSet.pair x y ∈ R := by + intro x hx + obtain ⟨n, hn, raw, hraw, rfl⟩ := ZFSet.mem_prod.1 hx + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨q, rfl⟩ := (s.mem_carrier raw).1 (subset hraw) + obtain ⟨r, stronger, hr, a, ha, decision⟩ := dense k q hraw + exact ⟨ZFSet.pair (natSetCode (k + 1)) (s.encode r), + ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, hr⟩, + (pair_mem_decisionStepGraph _ _ _ _ _ _ _ _).2 + ⟨natSetCode_mem_omega _, hraw, natSetCode_mem_omega _, hr, rfl, + (s.pair_mem_conditionOrder r q).2 stronger, a, ha, decision⟩⟩ + obtain ⟨history, hHistory, function, zero, next⟩ := + M.exists_groundSerialOrbit pairing unions powers separation infinite choice hW hR + (ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega 0, hp⟩) serial + let t := natPresentation.product (SetMembers.presentation S) + let state : Nat → ULift.{u} Nat × SetMembers S := + fun n => natPresentation.decodeFunction t history function ⟨n⟩ + have entry (n : Nat) : ZFSet.pair (natSetCode n) + (ZFSet.pair (natSetCode (state n).1.down) (SetMembers.raw (state n).2)) ∈ history := + natPresentation.decodeFunction_mem t history function ⟨n⟩ + have initial : natSetCode (state 0).1.down = natSetCode 0 ∧ + SetMembers.raw (state 0).2 = s.encode p := + ZFSet.pair_inj.1 ((zero _).1 (entry 0)) + have steps (n : Nat) := (pair_mem_decisionStepGraph S s.conditionOrder U D + (natSetCode (state n).1.down) (SetMembers.raw (state n).2) + (natSetCode (state (n + 1)).1.down) (SetMembers.raw (state (n + 1)).2)).1 + (next (natSetCode n) (natSetCode_mem_omega n) _ _ (entry n) (entry (n + 1))) + have clock (n : Nat) : (state n).1.down = n := by + induction n with + | zero => exact natSetCode_injective initial.1 + | succ n ih => + have h : natSetCode (state (n + 1)).1.down = natSetCode ((state n).1.down + 1) := + (steps n).2.2.2.2.1 + exact (natSetCode_injective h).trans (congrArg (fun k => k + 1) ih) + let graph := relationCompose ZFSet.omega W S history (productSecond ZFSet.omega S) + have graphGround : graph ∈ M.sets := M.relationCompose_mem pairing unions powers separation + hw hW hS hHistory (M.productSecond_mem pairing unions powers separation hw hS) + have smallFunction : ZFSet.IsFunc ZFSet.omega S graph := + relationCompose_function_of_subset function (productSecond_function ZFSet.omega S) (fun _ h => h) + have graphFunction : ZFSet.IsFunc ZFSet.omega s.carrier graph := by + refine ⟨?_, smallFunction.2⟩ + intro z hz + obtain ⟨n, hn, q, hq, rfl⟩ := ZFSet.mem_prod.1 (smallFunction.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hn, subset hq⟩ + let seq : Nat → P := fun n => natPresentation.decodeFunction s graph graphFunction ⟨n⟩ + have projected (n : Nat) : ZFSet.pair (natSetCode n) (SetMembers.raw (state n).2) ∈ graph := + (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨natSetCode_mem_omega n, SetMembers.raw_mem _, _, + ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, SetMembers.raw_mem _⟩, entry n, + (mem_productSecond _ _ _).2 ⟨_, natSetCode_mem_omega _, _, SetMembers.raw_mem _, rfl⟩⟩ + have value (n : Nat) : s.encode (seq n) = SetMembers.raw (state n).2 := by + obtain ⟨_, _, unique⟩ := graphFunction.2 (natSetCode n) (natSetCode_mem_omega n) + exact (unique _ (natPresentation.decodeFunction_mem s graph graphFunction ⟨n⟩)).trans + (unique _ (projected n)).symm + refine ⟨seq, s.injective ((value 0).trans initial.2), + M.decoded_function_graph_mem natPresentation s graphGround graphFunction, ?_, ?_, ?_⟩ + · apply antitone_nat_of_succ_le + intro n + apply (s.pair_mem_conditionOrder _ _).1 + rw [value, value] + exact (steps n).2.2.2.2.2.1 + · intro n + rw [value] + exact SetMembers.raw_mem _ + · intro n + obtain ⟨a, ha, decision⟩ := (steps n).2.2.2.2.2.2 + refine ⟨a, ha, ?_⟩ + rw [value] + rw [clock] at decision + exact decision + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def decisionValues (U D p : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ a ∈ U, + z = ZFSet.pair n a ∧ ZFSet.pair (ZFSet.pair p n) a ∈ D) + (ZFSet.prod ZFSet.omega U) + +noncomputable def commonDecisionConditions (P U D : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun p => ∀ n ∈ ZFSet.omega, ∃ a ∈ U, + ZFSet.pair (ZFSet.pair p n) a ∈ D) P + +noncomputable def decisionDenseCode (P r U D base : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun p => (ZFSet.pair p base ∈ r ∧ p ∈ commonDecisionConditions P U D) ∨ + ¬ ∃ q ∈ P, ZFSet.pair q p ∈ r ∧ ZFSet.pair q base ∈ r) P + +theorem pair_mem_decisionValues (U D p n a : ZFSet.{u}) : + ZFSet.pair n a ∈ decisionValues U D p ↔ + n ∈ ZFSet.omega ∧ a ∈ U ∧ ZFSet.pair (ZFSet.pair p n) a ∈ D := by + rw [decisionValues, ZFSet.mem_sep] + constructor + · rintro ⟨_, m, hm, b, hb, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hm, hb, entry⟩ + · rintro ⟨hn, ha, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hn, ha⟩, n, hn, a, ha, rfl, entry⟩ + +theorem mem_commonDecisionConditions (P U D p : ZFSet.{u}) : + p ∈ commonDecisionConditions P U D ↔ + p ∈ P ∧ ∀ n ∈ ZFSet.omega, ∃ a ∈ U, ZFSet.pair (ZFSet.pair p n) a ∈ D := + ZFSet.mem_sep + +theorem mem_decisionDenseCode (P r U D base p : ZFSet.{u}) : + p ∈ decisionDenseCode P r U D base ↔ + p ∈ P ∧ ((ZFSet.pair p base ∈ r ∧ p ∈ commonDecisionConditions P U D) ∨ + ¬ ∃ q ∈ P, ZFSet.pair q p ∈ r ∧ ZFSet.pair q base ∈ r) := + ZFSet.mem_sep + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem decisionValues_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {U D p : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) (hp : p ∈ M.sets) : + decisionValues U D p ∈ M.sets := by + let formula : BoundedFormula 5 := BoundedFormula.exMem 1 (BoundedFormula.exMem 3 + (.conj (BoundedFormula.orderedPairFormula 2 1 0) + (BoundedFormula.tripleMembershipFormula 6 1 0 5))) + let params := extend ZFSet.omega (extend U (extend D (extend p Fin.elim0))) + have hw := M.omega_mem separation infinite + have members : ∀ j, params j ∈ M.sets := + Fin.cases hw (Fin.cases hU (Fin.cases hD (Fin.cases hp (fun j => Fin.elim0 j)))) + have ground := M.bounded_separation_mem separation formula params members + (M.prod_mem pairing unions powers separation hw hU) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) + (ZFSet.prod ZFSet.omega U) = decisionValues U D p := by + apply ZFSet.ext + intro z + simp only [ZFSet.mem_sep, decisionValues, formula, BoundedFormula.truth_exMem, + BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, + BoundedFormula.truth_tripleMembershipFormula] + rfl + exact equal ▸ ground + +theorem commonDecisionConditions_mem + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {P U D : ZFSet.{u}} (hP : P ∈ M.sets) (hU : U ∈ M.sets) (hD : D ∈ M.sets) : + commonDecisionConditions P U D ∈ M.sets := by + let formula : BoundedFormula 4 := .allMem 1 (BoundedFormula.exMem 3 + (BoundedFormula.tripleMembershipFormula 2 1 0 5)) + let params := extend ZFSet.omega (extend U (extend D Fin.elim0)) + have members : ∀ j, params j ∈ M.sets := + Fin.cases (M.omega_mem separation infinite) (Fin.cases hU (Fin.cases hD (fun j => Fin.elim0 j))) + have ground := M.bounded_separation_mem separation formula params members hP + have equal : ZFSet.sep (fun p => BoundedFormula.Truth formula (extend p params)) P = + commonDecisionConditions P U D := by + apply ZFSet.ext + intro p + simp only [ZFSet.mem_sep, commonDecisionConditions, formula, BoundedFormula.Truth, + BoundedFormula.truth_exMem, BoundedFormula.truth_tripleMembershipFormula] + rfl + exact equal ▸ ground + +theorem decisionDenseCode_mem + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {P r U D base : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) + (hU : U ∈ M.sets) (hD : D ∈ M.sets) (hbase : base ∈ M.sets) : + decisionDenseCode P r U D base ∈ M.sets := by + let formula : BoundedFormula 5 := BoundedFormula.disj + (.conj (BoundedFormula.pairMembershipFormula 0 3 2) (.mem 0 4)) + (.neg (BoundedFormula.exMem 1 (.conj (BoundedFormula.pairMembershipFormula 0 1 3) + (BoundedFormula.pairMembershipFormula 0 4 3)))) + let common := commonDecisionConditions P U D + let params := extend P (extend r (extend base (extend common Fin.elim0))) + have members : ∀ j, params j ∈ M.sets := + Fin.cases hP (Fin.cases hr (Fin.cases hbase + (Fin.cases (M.commonDecisionConditions_mem separation infinite hP hU hD) (fun j => Fin.elim0 j)))) + have ground := M.bounded_separation_mem separation formula params members hP + have equal : ZFSet.sep (fun p => BoundedFormula.Truth formula (extend p params)) P = + decisionDenseCode P r U D base := by + apply ZFSet.ext + intro p + simp only [ZFSet.mem_sep, decisionDenseCode, formula, BoundedFormula.truth_disj, + BoundedFormula.Truth, BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] + rfl + exact equal ▸ ground + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem internally_commonDecisions_denseBelow + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {U D : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) + (closed : InternallyCountablyClosed M s) (base : P) + (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) + (dense : ∀ n ∈ ZFSet.omega, DenseBelow base + {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) : + DenseBelow base {q | q ≤ base ∧ ∀ n ∈ ZFSet.omega, + ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D} := by + intro p below + let S := attachmentIdeal s.carrier s.conditionOrder (s.encode base) + have hS : S ∈ M.sets := M.attachmentIdeal_mem separation carrier order + (M.transitive carrier (s.encode_mem base)) + have subset : S ⊆ s.carrier := fun _ h => (ZFSet.mem_sep.1 h).1 + have cone (q : P) : s.encode q ∈ S ↔ q ≤ base := by + rw [mem_attachmentIdeal, s.pair_mem_conditionOrder] + exact ⟨And.right, fun h => ⟨s.encode_mem q, h⟩⟩ + obtain ⟨seq, initial, graph, decreasing, _, decisions⟩ := + M.exists_groundDecisionChain s pairing unions powers separation infinite choice order + hS hU hD subset p ((cone p).2 below) (fun n q hq => by + obtain ⟨r, stronger, a, ha, decided⟩ := dense (natSetCode n) (natSetCode_mem_omega n) + q ((cone q).1 hq) + exact ⟨r, stronger, (cone r).2 (stronger.trans ((cone q).1 hq)), a, ha, decided⟩) + obtain ⟨q, lower⟩ := closed seq graph decreasing + have stronger : q ≤ p := initial ▸ lower 0 + refine ⟨q, stronger, stronger.trans below, ?_⟩ + intro n hn + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨a, ha, decided⟩ := decisions k + exact ⟨a, ha, persistent _ q (lower (k + 1)) _ (natSetCode_mem_omega k) a ha decided⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +private noncomputable def enumeratedFamilyDecisions (Q J B g f : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ p ∈ Q, ∃ n ∈ ZFSet.omega, ∃ j ∈ J, ∃ E ∈ B, + z = ZFSet.pair (ZFSet.pair p n) j ∧ ZFSet.pair n j ∈ g ∧ + ZFSet.pair j E ∈ f ∧ p ∈ E) (ZFSet.prod (ZFSet.prod Q ZFSet.omega) J) + +private theorem enumeratedFamilyDecisions_entry (Q J B g f p n j : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair p n) j ∈ enumeratedFamilyDecisions Q J B g f ↔ + p ∈ Q ∧ n ∈ ZFSet.omega ∧ j ∈ J ∧ ZFSet.pair n j ∈ g ∧ + ∃ E ∈ B, ZFSet.pair j E ∈ f ∧ p ∈ E := by + rw [enumeratedFamilyDecisions, ZFSet.mem_sep] + constructor + · rintro ⟨_, p', hp, n', hn, j', hj, E, hE, eq, ng, ef, member⟩ + obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 eq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + exact ⟨hp, hn, hj, ng, E, hE, ef, member⟩ + · rintro ⟨hp, hn, hj, ng, E, hE, ef, member⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hp, hn⟩, hj⟩, + p, hp, n, hn, j, hj, E, hE, rfl, ng, ef, member⟩ + +private def enumeratedFamilyDecisionFormula : BoundedFormula 7 := + .exMem 1 (.exMem 3 (.exMem 5 (.exMem 7 + (.conj (BoundedFormula.orderedTripleFormula 4 3 2 1) + (.conj (BoundedFormula.pairMembershipFormula 2 1 9) + (.conj (BoundedFormula.pairMembershipFormula 1 0 10) (.mem 3 0))))))) + +private theorem enumeratedFamilyDecisionFormula_truth (env : Fin 7 → ZFSet.{u}) : + BoundedFormula.Truth enumeratedFamilyDecisionFormula env ↔ + ∃ p ∈ env 1, ∃ n ∈ env 2, ∃ j ∈ env 3, ∃ E ∈ env 4, + env 0 = ZFSet.pair (ZFSet.pair p n) j ∧ ZFSet.pair n j ∈ env 5 ∧ + ZFSet.pair j E ∈ env 6 ∧ p ∈ E := by + simp only [enumeratedFamilyDecisionFormula, BoundedFormula.truth_exMem, + BoundedFormula.Truth, BoundedFormula.truth_orderedTripleFormula, + BoundedFormula.truth_pairMembershipFormula] + rfl + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem internally_countableDenseFamily_denseBelow + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {J f : ZFSet.{u}} (hJ : J ∈ M.sets) (hf : f ∈ M.sets) + (small : M.groundEmbeddable J ZFSet.omega) + (function : ZFSet.IsFunc J (M.groundPower s.carrier) f) + (closed : InternallyCountablyClosed M s) (base : P) + (persistent : ∀ j E, ZFSet.pair j E ∈ f → ∀ p q : P, + q ≤ p → s.encode p ∈ E → s.encode q ∈ E) + (dense : ∀ j E, ZFSet.pair j E ∈ f → DenseBelow base {q | s.encode q ∈ E}) : + DenseBelow base {q | q ≤ base ∧ ∀ j E, ZFSet.pair j E ∈ f → s.encode q ∈ E} := by + classical + by_cases nonempty : J.Nonempty + · obtain ⟨g, hg, enumeration, onto⟩ := M.groundCountable_enumeration + pairing unions powers separation infinite hJ nonempty small + let B := M.groundPower s.carrier + let D := enumeratedFamilyDecisions s.carrier J B g f + have hN := M.omega_mem separation infinite + have hB : B ∈ M.sets := M.groundPower_mem powers carrier + let params := ![s.carrier, ZFSet.omega, J, B, g, f] + have members : ∀ i, params i ∈ M.sets := Fin.cases carrier (Fin.cases hN + (Fin.cases hJ (Fin.cases hB (Fin.cases hg (Fin.cases hf (fun i => Fin.elim0 i)))))) + have selected := M.bounded_separation_mem separation enumeratedFamilyDecisionFormula + params members (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation carrier hN) hJ) + have hD : D ∈ M.sets := by + have equal : ZFSet.sep (fun z => BoundedFormula.Truth enumeratedFamilyDecisionFormula + (extend z params)) (ZFSet.prod (ZFSet.prod s.carrier ZFSet.omega) J) = D := by + apply ZFSet.ext + intro z + change _ ↔ z ∈ enumeratedFamilyDecisions s.carrier J B g f + rw [ZFSet.mem_sep, enumeratedFamilyDecisions, ZFSet.mem_sep, + enumeratedFamilyDecisionFormula_truth] + rfl + exact equal ▸ selected + have persistD : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ j ∈ J, + ZFSet.pair (ZFSet.pair (s.encode p) n) j ∈ D → + ZFSet.pair (ZFSet.pair (s.encode q) n) j ∈ D := by + intro p q qp n hn j hj entry + obtain ⟨_, _, _, ng, E, hE, ef, member⟩ := + (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode p) n j).1 entry + exact (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode q) n j).2 + ⟨s.encode_mem q, hn, hj, ng, E, hE, ef, persistent j E ef p q qp member⟩ + have denseD : ∀ n ∈ ZFSet.omega, DenseBelow base + {q | ∃ j ∈ J, ZFSet.pair (ZFSet.pair (s.encode q) n) j ∈ D} := by + intro n hn p pb + obtain ⟨j, ng, _⟩ := enumeration.2 n hn + have hj := (ZFSet.pair_mem_prod.1 (enumeration.1 ng)).2 + obtain ⟨E, ef, _⟩ := function.2 j hj + have hE := (ZFSet.pair_mem_prod.1 (function.1 ef)).2 + obtain ⟨q, qp, member⟩ := dense j E ef p pb + exact ⟨q, qp, j, hj, + (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode q) n j).2 + ⟨s.encode_mem q, hn, hj, ng, E, hE, ef, member⟩⟩ + have common := M.internally_commonDecisions_denseBelow s pairing unions powers separation + infinite choice carrier order hJ hD closed base persistD denseD + intro p pb + obtain ⟨q, qp, qb, decisions⟩ := common p pb + refine ⟨q, qp, qb, ?_⟩ + intro j E ef + have hj := (ZFSet.pair_mem_prod.1 (function.1 ef)).1 + obtain ⟨n, hn, ng⟩ := onto j hj + obtain ⟨j', _, entry⟩ := decisions n hn + obtain ⟨_, _, _, ng', E', _, ef', member⟩ := + (enumeratedFamilyDecisions_entry s.carrier J B g f (s.encode q) n j').1 entry + obtain ⟨_, _, uniqueJ⟩ := enumeration.2 n hn + have sameJ : j' = j := (uniqueJ _ ng').trans (uniqueJ _ ng).symm + subst j' + obtain ⟨_, _, uniqueE⟩ := function.2 j hj + have sameE : E' = E := (uniqueE _ ef').trans (uniqueE _ ef).symm + exact sameE ▸ member + · intro p pb + refine ⟨p, le_rfl, pb, ?_⟩ + intro j E ef + exact False.elim (nonempty ⟨j, (ZFSet.pair_mem_prod.1 (function.1 ef)).1⟩) + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u +variable {P : Type u} [Preorder P] (s : Presentation P) + +theorem decisionDenseCode_eq (U D : ZFSet.{u}) (base : P) : + s.subset (Localized base {q | q ≤ base ∧ ∀ n ∈ ZFSet.omega, + ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) = + decisionDenseCode s.carrier s.conditionOrder U D (s.encode base) := by + have compatible (p : P) : + (∃ q ∈ s.carrier, ZFSet.pair q (s.encode p) ∈ s.conditionOrder ∧ + ZFSet.pair q (s.encode base) ∈ s.conditionOrder) ↔ Compatible p base := by + constructor + · rintro ⟨q, hq, below, belowBase⟩ + obtain ⟨q, rfl⟩ := (s.mem_carrier q).1 hq + exact ⟨q, (s.pair_mem_conditionOrder _ _).1 below, + (s.pair_mem_conditionOrder _ _).1 belowBase⟩ + · rintro ⟨q, below, belowBase⟩ + exact ⟨s.encode q, s.encode_mem q, (s.pair_mem_conditionOrder _ _).2 below, + (s.pair_mem_conditionOrder _ _).2 belowBase⟩ + have each (p : P) : + s.encode p ∈ decisionDenseCode s.carrier s.conditionOrder U D (s.encode base) ↔ + p ∈ Localized base {q | q ≤ base ∧ ∀ n ∈ ZFSet.omega, + ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D} := by + simp only [mem_decisionDenseCode, mem_commonDecisionConditions, + s.pair_mem_conditionOrder, s.encode_mem, true_and, compatible, Localized, Set.mem_ofPred_eq] + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨p, hp, rfl⟩ := (s.mem_subset _ z).1 hz + exact (each p).2 hp + · intro hz + have bound := (mem_decisionDenseCode _ _ _ _ _ z).1 hz + obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 bound.1 + exact (s.encode_mem_subset _ p).2 ((each p).1 hz) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem generic_common_decisions + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {U D : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) + (closed : InternallyCountablyClosed M s) (base : P) + (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) + (dense : ∀ n ∈ ZFSet.omega, DenseBelow base + {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) + (H : ConditionFilter P) (generic : H.GenericFor (M.codedFamily s)) (hbase : H.mem base) : + ∃ q, H.mem q ∧ q ≤ base ∧ ∀ n ∈ ZFSet.omega, + ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D := by + have density := M.internally_commonDecisions_denseBelow s pairing unions powers separation infinite choice + carrier order hU hD closed base persistent dense + have code := M.decisionDenseCode_mem separation infinite carrier order hU hD + (M.transitive carrier (s.encode_mem base)) + rw [← decisionDenseCode_eq s U D base] at code + exact H.meets_below generic hbase (M.codedFamily_of_code s code) density + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem decisionValues_function {U D p : ZFSet.{u}} + (total : ∀ n ∈ ZFSet.omega, ∃ a ∈ U, ZFSet.pair (ZFSet.pair p n) a ∈ D) + (unique : ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, + ZFSet.pair (ZFSet.pair p n) a ∈ D → ZFSet.pair (ZFSet.pair p n) b ∈ D → a = b) : + ZFSet.IsFunc ZFSet.omega U (decisionValues U D p) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro n hn + obtain ⟨a, ha, decision⟩ := total n hn + refine ⟨a, (pair_mem_decisionValues _ _ _ _ _).2 ⟨hn, ha, decision⟩, ?_⟩ + intro b hb + have actual := (pair_mem_decisionValues _ _ _ _ _).1 hb + exact unique n hn b actual.2.1 a ha actual.2.2 decision + +variable {P : Type u} [Preorder P] (s : Presentation P) + +theorem decisionValues_eq_reading {U D f : ZFSet.{u}} (base : P) + (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) + (unique : ∀ p : P, p ≤ base → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D → a = b) + (H : ConditionFilter P) {q : P} (hq : H.mem q) (below : q ≤ base) + (total : ∀ n ∈ ZFSet.omega, ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) + (function : ZFSet.IsFunc ZFSet.omega U f) + (realizes : ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ZFSet.pair n a ∈ f → + ∃ p, H.mem p ∧ ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D) : + decisionValues U D (s.encode q) = f := by + have agree (p : P) (hp : H.mem p) (n : ZFSet.{u}) (hn : n ∈ ZFSet.omega) + (a b : ZFSet.{u}) (ha : a ∈ U) (hb : b ∈ U) + (first : ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) + (second : ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D) : a = b := by + obtain ⟨r, _, rq, rp⟩ := H.directed hq hp + exact unique r (rq.trans below) n hn a ha b hb + (persistent q r rq n hn a ha first) (persistent p r rp n hn b hb second) + have same (n : ZFSet.{u}) (hn : n ∈ ZFSet.omega) (a : ZFSet.{u}) (ha : a ∈ U) : + ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D ↔ ZFSet.pair n a ∈ f := by + constructor + · intro decision + obtain ⟨b, entry, _⟩ := function.2 n hn + have hb := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨p, hp, read⟩ := realizes n hn b hb entry + exact (agree p hp n hn a b ha hb decision read).symm ▸ entry + · intro entry + obtain ⟨b, hb, decision⟩ := total n hn + obtain ⟨p, hp, read⟩ := realizes n hn a ha entry + exact agree p hp n hn b a hb ha decision read ▸ decision + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨n, hn, a, ha, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + exact (same n hn a ha).1 ((pair_mem_decisionValues _ _ _ _ _).1 hz).2.2 + · intro hz + obtain ⟨n, hn, a, ha, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact (pair_mem_decisionValues _ _ _ _ _).2 ⟨hn, ha, (same n hn a ha).2 hz⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem generic_decision_reading_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {U D : ZFSet.{u}} (hU : U ∈ M.sets) (hD : D ∈ M.sets) + (closed : InternallyCountablyClosed M s) (base : P) + (persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D) + (unique : ∀ p : P, p ≤ base → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D → a = b) + (dense : ∀ n ∈ ZFSet.omega, DenseBelow base + {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D}) + (H : ConditionFilter P) (generic : H.GenericFor (M.codedFamily s)) (hbase : H.mem base) + {f : ZFSet.{u}} (function : ZFSet.IsFunc ZFSet.omega U f) + (realizes : ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ZFSet.pair n a ∈ f → + ∃ p, H.mem p ∧ ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D) : + f ∈ M.sets ∧ ∃ q, H.mem q ∧ q ≤ base ∧ decisionValues U D (s.encode q) = f := by + obtain ⟨q, hq, below, total⟩ := M.generic_common_decisions s pairing unions powers separation + infinite choice carrier order hU hD closed base persistent dense H generic hbase + have equal := decisionValues_eq_reading s base persistent unique H hq below total function realizes + exact ⟨equal ▸ M.decisionValues_mem pairing unions powers separation infinite hU hD + (M.transitive carrier (s.encode_mem q)), q, hq, below, equal⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection infinite choice carrier order in +theorem sequence_value_ground (small : M.sets.Countable) + {U : ZFSet.{u}} (hU : U ∈ M.sets) (closed : InternallyCountablyClosed M s) + (τ : (M.nameDomain s).names) (H : ConditionFilter P) + (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + {base : P} (hbase : H.mem base) + (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula + (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier + (M.omega_mem separation infinite) hU τ) base) : + Name.eval {q | H.mem q} τ.val ∈ M.sets ∧ + ∃ q, H.mem q ∧ q ≤ base ∧ decisionValues U + (Name.sequenceDecisionRelation s ⊤ τ.val ZFSet.omega U) (s.encode q) = + Name.eval {q | H.mem q} τ.val := by + have hN := M.omega_mem separation infinite + have hD := M.sequenceDecisionRelation_mem s ⊤ pairing unions powers separation collection + carrier order τ hN hU + have function := M.sequenceFunction_eval s pairing unions powers separation collection carrier + hN hU τ H genericFormula hbase forced + refine M.generic_decision_reading_ground s pairing unions powers separation infinite choice + carrier order hU hD closed base ?_ ?_ ?_ H genericCoded hbase function ?_ + · intro p q before n hn a ha entry + have decision := (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n a).1 entry + exact (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U q n a).2 + ⟨hn, ha, Name.sequenceDecision_mono s ⊤ τ.val before decision.2.2⟩ + · intro p before n hn a ha b hb first second + exact M.sequenceDecision_unique_below s pairing unions powers separation collection carrier + small hN hU τ forced before hn ha hb + ((Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n a).1 first).2.2 + ((Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n b).1 second).2.2 + · intro n hn q before + obtain ⟨r, rq, a, ha, decision⟩ := M.sequenceDecision_dense_below s pairing unions powers + separation collection carrier small hN hU τ forced hn q before + exact ⟨r, rq, a, ha, + (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U r n a).2 ⟨hn, ha, decision⟩⟩ + · intro n hn a ha entry + obtain ⟨p, hp, decision⟩ := (M.sequenceDecision_reading s pairing unions powers separation + collection carrier τ n a (M.transitive hN hn) (M.transitive hU ha) H genericFormula).1 entry + exact ⟨p, hp, + (Name.sequenceDecisionRelation_entry s ⊤ τ.val ZFSet.omega U p n a).2 ⟨hn, ha, decision⟩⟩ + +include pairing unions powers separation collection infinite choice carrier order in +theorem sequence_value_ground_of_function (small : M.sets.Countable) + {U : ZFSet.{u}} (hU : U ∈ M.sets) (closed : InternallyCountablyClosed M s) + (τ : (M.nameDomain s).names) (H : ConditionFilter P) + (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (function : ZFSet.IsFunc ZFSet.omega U (Name.eval {q | H.mem q} τ.val)) : + Name.eval {q | H.mem q} τ.val ∈ M.sets ∧ + ∃ q, H.mem q ∧ decisionValues U + (Name.sequenceDecisionRelation s ⊤ τ.val ZFSet.omega U) (s.encode q) = + Name.eval {q | H.mem q} τ.val := by + obtain ⟨base, hbase, forced⟩ := M.exists_sequenceFunction_forcing s pairing unions powers + separation collection carrier (M.omega_mem separation infinite) hU τ H genericFormula function + obtain ⟨ground, q, hq, _, equal⟩ := M.sequence_value_ground s pairing unions powers separation + collection infinite choice carrier order small hU closed τ H genericCoded genericFormula hbase forced + exact ⟨ground, q, hq, equal⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameGraphs.lean index 7aa86e4e3fff89a2d2df6e16389d83c17401602b..1755ce7058df42e730a2bca31d02250729696f34 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameGraphs.lean @@ -1,118 +1,118 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -noncomputable def niceNameCandidateGraph (T : ZFSet.{u}) (K : I → Subgroup G) : ZFSet.{u} := - familyCodeGraph b.encode (fun i => M.niceNameCandidates a s T (K i)) - -theorem mem_niceNameCandidateGraph (T : ZFSet.{u}) (K : I → Subgroup G) (z : ZFSet.{u}) : - z ∈ M.niceNameCandidateGraph a s b T K ↔ - ∃ i, z = ZFSet.pair (b.encode i) (M.niceNameCandidates a s T (K i)) := by - rw [niceNameCandidateGraph, mem_familyCodeGraph] - exact exists_congr (fun _ => eq_comm) - -theorem pair_mem_niceNameCandidateGraph (T : ZFSet.{u}) (K : I → Subgroup G) (i : I) (z : ZFSet.{u}) : - ZFSet.pair (b.encode i) z ∈ M.niceNameCandidateGraph a s b T K ↔ - z = M.niceNameCandidates a s T (K i) := - pair_mem_familyCodeGraph _ _ b.injective i z - -theorem niceNameCandidateGraph_function (T : ZFSet.{u}) (K : I → Subgroup G) : - FunctionGraphOn b.carrier (M.niceNameCandidateGraph a s b T K) := by - have equal : ZFSet.range b.encode = b.carrier := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_range] - exact (b.mem_carrier z).symm - simpa only [niceNameCandidateGraph, equal] using familyCodeGraph_function b.encode - (fun i => M.niceNameCandidates a s T (K i)) b.injective - -theorem niceNameCandidates_eq_selection (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} (valid : ∀ z ∈ T, IsName s z) - (i : I) (hi : b.encode i ∈ M.sets) : - M.niceNameCandidates a s T (K i) = - ZFSet.sep (fun z => Realize M.sets nameSupportFormula - (extend z (extend (b.encode i) (extend s.carrier (extend t.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0))))))) - (M.groundRelations T s.carrier) := by - apply ZFSet.ext - intro z - rw [niceNameCandidates, ZFSet.mem_sep, ZFSet.mem_sep] - apply and_congr_right - intro hz - have data := (M.mem_groundRelations T s.carrier z).1 hz - let τ := Name.ofSubset valid data.2 - have fixed := M.realize_nameSupportFormula a s t b K pairing unions powers separation collection - carrier group supports maps i hi τ data.1 - change NiceNameCode a s T (K i) τ.val ↔ Realize M.sets nameSupportFormula _ - refine Iff.trans ?_ fixed.symm - constructor - · rintro ⟨σ, eq, _, h⟩ - have same : σ = τ := Subtype.ext eq - exact same ▸ h - · intro h - exact ⟨τ, rfl, data.2, h⟩ - -theorem niceNameCandidateGraph_mem (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (indices : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) : - M.niceNameCandidateGraph a s b T K ∈ M.sets := by - let B := M.groundRelations T s.carrier - have hB := M.groundRelations_mem pairing unions powers separation hT carrier - let slots : Fin 6 → Fin 6 := ![1, 0, 2, 3, 4, 5] - let defined := (M.definable_separation separation nameSupportFormula).reindex slots - let params := extend B (extend s.carrier (extend t.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) - have ground := defined.graph_mem pairing separation collection params - (Fin.cases hB (Fin.cases carrier (Fin.cases group (Fin.cases supports - (Fin.cases maps (fun j => Fin.elim0 j)))))) indices - have value (i : I) : - ZFSet.sep (fun z => Realize M.sets nameSupportFormula - (extend z (fun j => (extend (b.encode i) params) (slots j.succ)))) - ((extend (b.encode i) params) (slots 0)) = M.niceNameCandidates a s T (K i) := by - have args : (fun j : Fin 5 => (extend (b.encode i) params) (slots j.succ)) = - extend (b.encode i) (extend s.carrier (extend t.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun k => Fin.elim0 k))))) j - rw [args] - exact (M.niceNameCandidates_eq_selection a s t b K pairing unions powers separation collection - carrier group supports maps valid i (M.transitive indices (b.encode_mem i))).symm - have equal : defined.graph params b.carrier = M.niceNameCandidateGraph a s b T K := by - apply ZFSet.ext - intro z - rw [defined.mem_graph, M.mem_niceNameCandidateGraph] - constructor - · rintro ⟨x, hx, eq⟩ - obtain ⟨i, rfl⟩ := (b.mem_carrier x).1 hx - exact ⟨i, eq.trans (congrArg (ZFSet.pair (b.encode i)) (value i))⟩ - · rintro ⟨i, eq⟩ - exact ⟨b.encode i, b.encode_mem i, eq.trans (congrArg (ZFSet.pair (b.encode i)) (value i).symm)⟩ - exact equal ▸ ground - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +noncomputable def niceNameCandidateGraph (T : ZFSet.{u}) (K : I → Subgroup G) : ZFSet.{u} := + familyCodeGraph b.encode (fun i => M.niceNameCandidates a s T (K i)) + +theorem mem_niceNameCandidateGraph (T : ZFSet.{u}) (K : I → Subgroup G) (z : ZFSet.{u}) : + z ∈ M.niceNameCandidateGraph a s b T K ↔ + ∃ i, z = ZFSet.pair (b.encode i) (M.niceNameCandidates a s T (K i)) := by + rw [niceNameCandidateGraph, mem_familyCodeGraph] + exact exists_congr (fun _ => eq_comm) + +theorem pair_mem_niceNameCandidateGraph (T : ZFSet.{u}) (K : I → Subgroup G) (i : I) (z : ZFSet.{u}) : + ZFSet.pair (b.encode i) z ∈ M.niceNameCandidateGraph a s b T K ↔ + z = M.niceNameCandidates a s T (K i) := + pair_mem_familyCodeGraph _ _ b.injective i z + +theorem niceNameCandidateGraph_function (T : ZFSet.{u}) (K : I → Subgroup G) : + FunctionGraphOn b.carrier (M.niceNameCandidateGraph a s b T K) := by + have equal : ZFSet.range b.encode = b.carrier := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_range] + exact (b.mem_carrier z).symm + simpa only [niceNameCandidateGraph, equal] using familyCodeGraph_function b.encode + (fun i => M.niceNameCandidates a s T (K i)) b.injective + +theorem niceNameCandidates_eq_selection (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} (valid : ∀ z ∈ T, IsName s z) + (i : I) (hi : b.encode i ∈ M.sets) : + M.niceNameCandidates a s T (K i) = + ZFSet.sep (fun z => Realize M.sets nameSupportFormula + (extend z (extend (b.encode i) (extend s.carrier (extend t.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0))))))) + (M.groundRelations T s.carrier) := by + apply ZFSet.ext + intro z + rw [niceNameCandidates, ZFSet.mem_sep, ZFSet.mem_sep] + apply and_congr_right + intro hz + have data := (M.mem_groundRelations T s.carrier z).1 hz + let τ := Name.ofSubset valid data.2 + have fixed := M.realize_nameSupportFormula a s t b K pairing unions powers separation collection + carrier group supports maps i hi τ data.1 + change NiceNameCode a s T (K i) τ.val ↔ Realize M.sets nameSupportFormula _ + refine Iff.trans ?_ fixed.symm + constructor + · rintro ⟨σ, eq, _, h⟩ + have same : σ = τ := Subtype.ext eq + exact same ▸ h + · intro h + exact ⟨τ, rfl, data.2, h⟩ + +theorem niceNameCandidateGraph_mem (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (indices : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) : + M.niceNameCandidateGraph a s b T K ∈ M.sets := by + let B := M.groundRelations T s.carrier + have hB := M.groundRelations_mem pairing unions powers separation hT carrier + let slots : Fin 6 → Fin 6 := ![1, 0, 2, 3, 4, 5] + let defined := (M.definable_separation separation nameSupportFormula).reindex slots + let params := extend B (extend s.carrier (extend t.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) + have ground := defined.graph_mem pairing separation collection params + (Fin.cases hB (Fin.cases carrier (Fin.cases group (Fin.cases supports + (Fin.cases maps (fun j => Fin.elim0 j)))))) indices + have value (i : I) : + ZFSet.sep (fun z => Realize M.sets nameSupportFormula + (extend z (fun j => (extend (b.encode i) params) (slots j.succ)))) + ((extend (b.encode i) params) (slots 0)) = M.niceNameCandidates a s T (K i) := by + have args : (fun j : Fin 5 => (extend (b.encode i) params) (slots j.succ)) = + extend (b.encode i) (extend s.carrier (extend t.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun k => Fin.elim0 k))))) j + rw [args] + exact (M.niceNameCandidates_eq_selection a s t b K pairing unions powers separation collection + carrier group supports maps valid i (M.transitive indices (b.encode_mem i))).symm + have equal : defined.graph params b.carrier = M.niceNameCandidateGraph a s b T K := by + apply ZFSet.ext + intro z + rw [defined.mem_graph, M.mem_niceNameCandidateGraph] + constructor + · rintro ⟨x, hx, eq⟩ + obtain ⟨i, rfl⟩ := (b.mem_carrier x).1 hx + exact ⟨i, eq.trans (congrArg (ZFSet.pair (b.encode i)) (value i))⟩ + · rintro ⟨i, eq⟩ + exact ⟨b.encode i, b.encode_mem i, eq.trans (congrArg (ZFSet.pair (b.encode i)) (value i).symm)⟩ + exact equal ▸ ground + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameNormalization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameNormalization.lean index 73c0c0eee044e4e65a83f1f8493a5572e47cb6f7..1da8329daecaa79a5cf4afbc3916a93e619dddfb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameNormalization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceNameNormalization.lean @@ -1,464 +1,464 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPredenseMeet - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps SetFormula -universe u v -namespace Name -variable {P : Type u} {s : Presentation P} - -noncomputable def familySet (one : P) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) : Name s := - assemble (fun z : T => ⟨z.val, valid z.val z.property⟩) (fun _ => one) - -theorem entry_familySet (one : P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (σ : Name s) (p : P) : Entry σ (familySet one T valid) p ↔ σ.val ∈ T ∧ p = one := by - refine (entry_assemble (fun member : T => ⟨member.val, valid member.val member.property⟩) - (fun _ => one) σ p).trans ?_ - constructor - · rintro ⟨z, eq, hp⟩ - exact ⟨congrArg Subtype.val eq ▸ z.property, hp.symm⟩ - · rintro ⟨hσ, rfl⟩ - exact ⟨⟨σ.val, hσ⟩, Subtype.ext rfl, rfl⟩ - -theorem familySet_code (one : P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : - (familySet one T valid).val = ZFSet.prod T {s.encode one} := by - apply ZFSet.ext - intro z - change z ∈ ZFSet.range _ ↔ _ - rw [ZFSet.mem_range, ZFSet.mem_prod] - constructor - · rintro ⟨x, rfl⟩ - exact ⟨x.val, x.property, s.encode one, ZFSet.mem_singleton.2 rfl, rfl⟩ - · rintro ⟨x, hx, y, hy, eq⟩ - have same := ZFSet.mem_singleton.1 hy - subst y - exact ⟨⟨x, hx⟩, eq.symm⟩ - -theorem mem_eval_familySet (H : Set P) (one : P) (hone : one ∈ H) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (x : ZFSet.{u}) : - x ∈ eval H (familySet one T valid) ↔ ∃ τ : Name s, τ.val ∈ T ∧ eval H τ = x := by - rw [mem_eval] - simp only [entry_familySet] - constructor - · rintro ⟨τ, p, ⟨hτ, rfl⟩, _, eq⟩ - exact ⟨τ, hτ, eq⟩ - · rintro ⟨τ, hτ, eq⟩ - exact ⟨τ, one, ⟨hτ, rfl⟩, hone, eq⟩ - -theorem act_familySet {G : Type v} [Group G] [PartialOrder P] [OrderTop P] - (a : PosetAction G P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) (g : G) : - a.act s g (familySet ⊤ T valid) = familySet ⊤ T valid := by - apply Name.ext - intro σ p - change Entry σ (rename s (a.iso g) (familySet ⊤ T valid)) p ↔ _ - rw [entry_rename, entry_familySet] - constructor - · rintro ⟨τ, q, entry, eq, hp⟩ - obtain ⟨hτ, rfl⟩ := (entry_familySet ⊤ T valid τ q).1 entry - have target := closed g τ hτ - change a.act s g τ = σ at eq - exact ⟨eq ▸ target, hp.symm.trans (a.iso g).map_top⟩ - · rintro ⟨hσ, rfl⟩ - exact ⟨a.act s g⁻¹ σ, ⊤, - (entry_familySet ⊤ T valid _ ⊤).2 ⟨closed g⁻¹ σ hσ, rfl⟩, - a.act_inv_right s g σ, (a.iso g).map_top⟩ - -theorem familySet_hs {G : Type v} [Group G] [PartialOrder P] [OrderTop P] - (a : PosetAction G P) (F : NormalSubgroupFamily G) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (familySet ⊤ T valid) := by - refine HereditarilySymmetric.mk (F.upward F.top ?_) ?_ - · intro g _ - exact act_familySet a T valid closed g - · intro τ p entry - exact children τ ((entry_familySet ⊤ T valid τ p).1 entry).1 - -end Name - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem familySet_mem {P : Type u} (s : Presentation P) (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (hone : s.encode one ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) : (Name.familySet one T valid).val ∈ M.sets := by - rw [Name.familySet_code] - apply M.prod_mem pairing unions powers separation hT - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hone hone - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {Upper Lower : Type u} - -theorem rename_familySet_of_encode (s : Presentation Upper) (t : Presentation Lower) - (inclusion : Lower → Upper) (codes : ∀ p, s.encode (inclusion p) = t.encode p) - (upperOne : Upper) (lowerOne : Lower) (sameTop : s.encode upperOne = t.encode lowerOne) - (T : ZFSet.{u}) (validUpper : ∀ z ∈ T, IsName s z) - (validLower : ∀ z ∈ T, IsName t z) : - rename s inclusion (familySet lowerOne T validLower) = familySet upperOne T validUpper := by - apply Subtype.ext - rw [rename_val_of_encode s inclusion codes, familySet_code, familySet_code, sameTop] - -theorem eval_familySet_crossStage (s : Presentation Upper) (t : Presentation Lower) - (inclusion : Lower → Upper) (codes : ∀ p, s.encode (inclusion p) = t.encode p) - (upperOne : Upper) (lowerOne : Lower) (sameTop : s.encode upperOne = t.encode lowerOne) - (T : ZFSet.{u}) (validUpper : ∀ z ∈ T, IsName s z) - (validLower : ∀ z ∈ T, IsName t z) (H : Set Upper) : - eval H (familySet upperOne T validUpper) = - eval {p | inclusion p ∈ H} (familySet lowerOne T validLower) := by - rw [← rename_familySet_of_encode s t inclusion codes upperOne lowerOne sameTop T validUpper validLower] - exact eval_rename s inclusion H _ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {Upper Lower : Type u} [PartialOrder Upper] -variable (s : Presentation Upper) (t : Presentation Lower) -variable (inclusion : Lower → Upper) (J : ZFSet.{u}) -variable (valid : ∀ z ∈ J, IsName t z) (D : NameDomain s) (tau : Name s) -variable (H : ConditionFilter Upper) (generic : H.GenericFor (atomicFamily D)) -variable (target : tau ∈ D.names) -variable (terms : ∀ sigma : Name t, sigma.val ∈ J → rename s inclusion sigma ∈ D.names) -variable (one : Lower) (hone : H.mem (inclusion one)) -variable (decisions : ∀ sigma : Name t, sigma.val ∈ J → ∃ p : Lower, - H.mem (inclusion p) ∧ - (ForcesMem (inclusion p) (rename s inclusion sigma) tau ∨ - ∀ q, q ≤ inclusion p → ¬ ForcesMem q (rename s inclusion sigma) tau)) - -include generic target terms hone decisions - -theorem eval_crossStageMembershipName_of_decisions : - eval {p | H.mem (inclusion p)} (crossStageMembershipName s t inclusion J valid tau) = - eval {p | H.mem p} tau ∩ - eval {p | H.mem (inclusion p)} (familySet one J valid) := by - apply ZFSet.ext - intro x - constructor - · intro member - obtain ⟨sigma, p, entry, hp, value⟩ := (mem_eval _ _ x).1 member - obtain ⟨inJ, forced⟩ := (entry_crossStageMembershipName s t inclusion J tau valid sigma p).1 entry - have sound := forcesMem_sound D H generic (terms sigma inJ) target hp forced - rw [eval_rename] at sound - change eval {p | H.mem (inclusion p)} sigma ∈ eval {p | H.mem p} tau at sound - refine ZFSet.mem_inter.2 ⟨value ▸ sound, ?_⟩ - exact (mem_eval_familySet _ one hone J valid x).2 ⟨sigma, inJ, value⟩ - · intro member - obtain ⟨inTau, inFamily⟩ := ZFSet.mem_inter.1 member - obtain ⟨sigma, inJ, value⟩ := (mem_eval_familySet _ one hone J valid x).1 inFamily - have upperMember : eval {p | H.mem p} (rename s inclusion sigma) ∈ - eval {p | H.mem p} tau := by - rw [eval_rename] - change eval {p | H.mem (inclusion p)} sigma ∈ eval {p | H.mem p} tau - exact value.symm ▸ inTau - obtain ⟨p, hp, positive | negative⟩ := decisions sigma inJ - · exact (mem_eval _ _ x).2 ⟨sigma, p, - (entry_crossStageMembershipName s t inclusion J tau valid sigma p).2 ⟨inJ, positive⟩, - hp, value⟩ - · obtain ⟨q, hq, forced⟩ := - (eval_mem_iff_forcesMem D H generic (terms sigma inJ) target).1 upperMember - obtain ⟨r, _, rp, rq⟩ := H.directed hp hq - exact False.elim (negative r rp (forcesMem_mono forced rq)) - -theorem eval_crossStageMembershipName_of_subset - (subset : eval {p | H.mem p} tau ⊆ - eval {p | H.mem (inclusion p)} (familySet one J valid)) : - eval {p | H.mem (inclusion p)} (crossStageMembershipName s t inclusion J valid tau) = - eval {p | H.mem p} tau := by - rw [eval_crossStageMembershipName_of_decisions s t inclusion J valid D tau H generic - target terms one hone decisions] - apply ZFSet.ext - intro x - exact ⟨fun member => (ZFSet.mem_inter.1 member).1, - fun member => ZFSet.mem_inter.2 ⟨member, subset member⟩⟩ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} - -theorem eval_subset_familySet_of_code_subset (H : ConditionFilter P) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (tau : Name s) - (shape : tau.val ⊆ ZFSet.prod T s.carrier) : - eval {p | H.mem p} tau ⊆ eval {p | H.mem p} (familySet ⊤ T valid) := by - intro x member - obtain ⟨sigma, p, entry, _, value⟩ := (mem_eval {p | H.mem p} tau x).1 member - have term : sigma.val ∈ T := (ZFSet.pair_mem_prod.1 (shape entry)).1 - exact (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).2 - ⟨sigma, term, value⟩ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.Name -open SetRealization SetFormula -universe u v -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} - -noncomputable def niceNormalize (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (τ : D.names) : Name s := - separationName D (.mem 0 1) (extend τ Fin.elim0) (familySet ⊤ T valid) - -theorem entry_niceNormalize (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (τ : D.names) (σ : Name s) (p : P) : - Entry σ (niceNormalize D T valid τ) p ↔ - σ.val ∈ T ∧ ∃ h : σ ∈ D.names, - Forces D (.mem 0 1) (extend ⟨σ, h⟩ (extend τ Fin.elim0)) p := by - rw [niceNormalize, entry_separationName] - constructor - · rintro ⟨r, entry, _, forced⟩ - exact ⟨((entry_familySet ⊤ T valid σ r).1 entry).1, forced⟩ - · rintro ⟨member, forced⟩ - exact ⟨⊤, (entry_familySet ⊤ T valid σ ⊤).2 ⟨member, rfl⟩, le_top, forced⟩ - -theorem niceNormalize_subset (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (τ : D.names) : - (niceNormalize D T valid τ).val ⊆ ZFSet.prod T s.carrier := by - intro z member - obtain ⟨σ, p, rfl⟩ := entries_cover (niceNormalize D T valid τ) member - exact ZFSet.pair_mem_prod.2 - ⟨((entry_niceNormalize D T valid τ σ p).1 member).1, s.encode_mem p⟩ - -theorem eval_niceNormalize (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (τ : D.names) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) : - eval {p | H.mem p} (niceNormalize D T valid τ) = - eval {p | H.mem p} τ.val ∩ eval {p | H.mem p} (familySet ⊤ T valid) := by - rw [niceNormalize, eval_separationName D H generic (.mem 0 1) (extend τ Fin.elim0) family] - apply ZFSet.ext - intro x - simp only [ZFSet.mem_sep, ZFSet.mem_inter] - change (_ ∧ x ∈ eval {p | H.mem p} τ.val) ↔ _ - exact and_comm - -theorem eval_niceNormalize_of_subset (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (τ : D.names) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) - (subset : eval {p | H.mem p} τ.val ⊆ - eval {p | H.mem p} (familySet ⊤ T valid)) : - eval {p | H.mem p} (niceNormalize D T valid τ) = eval {p | H.mem p} τ.val := by - rw [eval_niceNormalize D T valid τ family H generic] - apply ZFSet.ext - intro x - exact ⟨fun h => (ZFSet.mem_inter.1 h).1, - fun h => ZFSet.mem_inter.2 ⟨h, subset h⟩⟩ - -variable {G : Type v} [Group G] (a : PosetAction G P) - -theorem niceNormalize_niceNameCode (D : NameDomain s) - (closed : ∀ g σ, σ ∈ D.names → a.act s g σ ∈ D.names) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - (τ : D.names) (K : Subgroup G) (fixed : K ≤ a.stabilizer s τ.val) : - NiceNameCode a s T K (niceNormalize D T valid τ).val := by - apply (niceNameCode_iff a s _).2 - refine ⟨niceNormalize_subset D T valid τ, ?_⟩ - intro g hg - change a.act s g (niceNormalize D T valid τ) = niceNormalize D T valid τ - unfold niceNormalize - rw [a.act_separationName s D closed, act_familySet a T valid terms] - have env : a.actAssignment s D closed g (extend τ Fin.elim0) = extend τ Fin.elim0 := by - funext i - refine Fin.cases ?_ (fun j => Fin.elim0 j) i - apply Subtype.ext - exact fixed hg - rw [env] - -theorem niceNormalize_hs (D : NameDomain s) - (closed : ∀ g σ, σ ∈ D.names → a.act s g σ ∈ D.names) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - (τ : D.names) (K : Subgroup G) (fixed : K ≤ a.stabilizer s τ.val) - (F : Compression.RecursiveMaps.NormalSubgroupFamily G) (member : F.mem K) - (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : - HereditarilySymmetric a s F (niceNormalize D T valid τ) := - niceNameCode_hs a s F member children - (niceNormalize_niceNameCode a D closed T valid terms τ K fixed) - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {Upper Lower : Type u} -variable [PartialOrder Upper] [PartialOrder Lower] [OrderTop Lower] -variable (s : Presentation Upper) (t : Presentation Lower) -variable (restriction : Upper →o Lower) (inclusion : Lower ↪o Upper) -variable (projection : CompleteProjection restriction inclusion) -variable (codes : ∀ p, s.encode (inclusion p) = t.encode p) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (upperCarrier : s.carrier ∈ M.sets) (upperOrder : s.conditionOrder ∈ M.sets) -variable (lowerCarrier : t.carrier ∈ M.sets) (lowerOrder : t.conditionOrder ∈ M.sets) -variable {J f : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName t z) -variable (tau : (M.nameDomain s).names) -variable (function : ZFSet.IsFunc J (M.groundPower s.carrier) f) -variable (selected : ∀ sigma A, ZFSet.pair sigma A ∈ f → - A ⊆ M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma tau.val.val ∧ - A ⊆ t.carrier ∧ ∀ q ∈ t.carrier, ∃ p ∈ A, ∃ r ∈ t.carrier, - ZFSet.pair r q ∈ t.conditionOrder ∧ ZFSet.pair r p ∈ t.conditionOrder) -variable (H : ConditionFilter Upper) -variable (upperGeneric : H.GenericFor (formulaFamily (M.nameDomain s))) -variable (lowerGeneric : (projection.projectedFilter H).GenericFor (M.codedFamily t)) -include codes pairing unions powers separation collection upperCarrier upperOrder lowerCarrier lowerOrder - hJ function selected upperGeneric lowerGeneric - -theorem crossStageMembershipName_eval_of_family : - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.crossStageMembershipName s t inclusion J valid tau.val) = - Name.eval {p | H.mem p} tau.val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) := by - have terms (sigma : Name t) (member : sigma.val ∈ J) : - Name.rename s inclusion sigma ∈ (M.nameDomain s).names := by - change (Name.rename s inclusion sigma).val ∈ M.sets - rw [Name.rename_val_of_encode s inclusion codes] - exact M.transitive hJ member - have decisions (sigma : Name t) (member : sigma.val ∈ J) : ∃ p : Lower, - H.mem (inclusion p) ∧ - (Name.ForcesMem (inclusion p) (Name.rename s inclusion sigma) tau.val ∨ - ∀ q, q ≤ inclusion p → ¬ Name.ForcesMem q (Name.rename s inclusion sigma) tau.val) := by - obtain ⟨A, entry, _⟩ := function.2 sigma.val member - have groundA := ((M.mem_groundPower s.carrier A).1 - (ZFSet.pair_mem_prod.1 (function.1 entry)).2).1 - obtain ⟨domain, bound, predense⟩ := selected sigma.val A entry - obtain ⟨p, hp, inA⟩ := M.generic_meets_ground_predense t separation lowerCarrier lowerOrder - (projection.projectedFilter H) lowerGeneric groundA bound predense - let upperSigma : (M.nameDomain s).names := ⟨Name.rename s inclusion sigma, terms sigma member⟩ - have decisionEntry : s.encode (inclusion p) ∈ - M.ordinaryMembershipDecisions s.carrier s.conditionOrder upperSigma.val.val tau.val.val := by - change s.encode (inclusion p) ∈ M.ordinaryMembershipDecisions s.carrier s.conditionOrder - (Name.rename s inclusion sigma).val tau.val.val - rw [codes p, Name.rename_val_of_encode s inclusion codes] - exact domain inA - exact ⟨p, hp, (M.ordinaryMembershipDecisions_entry s pairing unions powers separation collection - upperCarrier upperOrder upperSigma tau (inclusion p)).1 decisionEntry⟩ - have topMember : H.mem (inclusion ⊤) := by - obtain ⟨p, hp⟩ := (projection.projectedFilter H).nonempty - exact (projection.projectedFilter H).upward hp le_top - have atomicGeneric : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := - fun E member dense => upperGeneric E (Or.inl member) dense - exact Name.eval_crossStageMembershipName_of_decisions s t inclusion J valid (M.nameDomain s) - tau.val H atomicGeneric tau.property terms ⊤ topMember decisions - -theorem crossStageMembershipName_eval_of_family_subset - (subset : Name.eval {p | H.mem p} tau.val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid)) : - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.crossStageMembershipName s t inclusion J valid tau.val) = - Name.eval {p | H.mem p} tau.val := by - rw [M.crossStageMembershipName_eval_of_family s t restriction inclusion projection codes - pairing unions powers separation collection upperCarrier upperOrder lowerCarrier lowerOrder - hJ valid tau function selected H upperGeneric lowerGeneric] - apply ZFSet.ext - intro x - exact ⟨fun member => (ZFSet.mem_inter.1 member).1, - fun member => ZFSet.mem_inter.2 ⟨member, subset member⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -omit [OrderTop P] in -include pairing unions powers separation collection carrier order in -theorem ordinarySeparationName_mem {n : Nat} (φ : SetFormula (n + 1)) - (nameEnv : Assignment (M.nameDomain s) n) (τ : (M.nameDomain s).names) : - (Name.separationName (M.nameDomain s) φ nameEnv τ.val).val ∈ M.sets := by - let context := extend s.carrier (extend s.conditionOrder (fun i => (nameEnv i).val.val)) - let params : Fin 2 → Fin (n + 2) := extend 0 (extend 1 Fin.elim0) - have members : ∀ i, context i ∈ M.sets := - Fin.cases carrier (Fin.cases order (fun i => (nameEnv i).property)) - apply M.separationName_mem s (M.nameDomain s) (fun _ h => h) - pairing unions powers separation carrier order (ordinaryGroundPrimitives 0 1) - φ params (fun i => i.succ.succ) context members rfl rfl - · exact M.equalityMeaning_lifted s (M.nameDomain s) (fun _ h => h) - pairing unions powers separation collection carrier order 0 1 _ rfl rfl - · exact M.domainMeaning_liftedNames s pairing unions powers separation collection carrier 0 _ rfl - · exact fun _ => rfl - -include pairing unions powers separation collection carrier order in -theorem niceNormalize_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (τ : (M.nameDomain s).names) : - (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ M.sets := by - have family := M.familySet_mem s ⊤ pairing unions powers separation hT - (M.transitive carrier (s.encode_mem ⊤)) valid - exact M.ordinarySeparationName_mem s pairing unions powers separation collection carrier order - (.mem 0 1) (extend τ Fin.elim0) ⟨Name.familySet ⊤ T valid, family⟩ - -theorem entry_niceNormalize {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (τ : (M.nameDomain s).names) (σ : Name s) (p : P) : - Name.Entry σ (Name.niceNormalize (M.nameDomain s) T valid τ) p ↔ - σ.val ∈ T ∧ Name.ForcesMem p σ τ.val := by - rw [Name.entry_niceNormalize] - constructor - · rintro ⟨member, _, forced⟩ - exact ⟨member, forced⟩ - · rintro ⟨member, forced⟩ - exact ⟨member, M.transitive hT member, forced⟩ - -include pairing unions powers separation collection carrier order in -theorem niceNormalize_spec {G : Type u} [Group G] - (a : PosetAction G P) (t : Presentation G) - (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - (τ : (M.nameDomain s).names) (K : Subgroup G) (fixed : K ≤ a.stabilizer s τ.val) - (F : NormalSubgroupFamily G) (member : F.mem K) - (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : - (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ M.sets ∧ - NiceNameCode a s T K (Name.niceNormalize (M.nameDomain s) T valid τ).val ∧ - HereditarilySymmetric a s F (Name.niceNormalize (M.nameDomain s) T valid τ) ∧ - ∀ (H : ConditionFilter P), H.GenericFor (formulaFamily (M.nameDomain s)) → - Name.eval {p | H.mem p} (Name.niceNormalize (M.nameDomain s) T valid τ) = - Name.eval {p | H.mem p} τ.val ∩ Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := by - have closed : ∀ g σ, σ ∈ (M.nameDomain s).names → a.act s g σ ∈ (M.nameDomain s).names := - fun g σ hσ => M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ - have code := Name.niceNormalize_niceNameCode a (M.nameDomain s) closed T valid terms τ K fixed - refine ⟨M.niceNormalize_mem s pairing unions powers separation collection carrier order hT valid τ, - code, niceNameCode_hs a s F member children code, ?_⟩ - intro H generic - exact Name.eval_niceNormalize (M.nameDomain s) T valid τ - (M.familySet_mem s ⊤ pairing unions powers separation hT - (M.transitive carrier (s.encode_mem ⊤)) valid) H generic - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPredenseMeet + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps SetFormula +universe u v +namespace Name +variable {P : Type u} {s : Presentation P} + +noncomputable def familySet (one : P) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) : Name s := + assemble (fun z : T => ⟨z.val, valid z.val z.property⟩) (fun _ => one) + +theorem entry_familySet (one : P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (σ : Name s) (p : P) : Entry σ (familySet one T valid) p ↔ σ.val ∈ T ∧ p = one := by + refine (entry_assemble (fun member : T => ⟨member.val, valid member.val member.property⟩) + (fun _ => one) σ p).trans ?_ + constructor + · rintro ⟨z, eq, hp⟩ + exact ⟨congrArg Subtype.val eq ▸ z.property, hp.symm⟩ + · rintro ⟨hσ, rfl⟩ + exact ⟨⟨σ.val, hσ⟩, Subtype.ext rfl, rfl⟩ + +theorem familySet_code (one : P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : + (familySet one T valid).val = ZFSet.prod T {s.encode one} := by + apply ZFSet.ext + intro z + change z ∈ ZFSet.range _ ↔ _ + rw [ZFSet.mem_range, ZFSet.mem_prod] + constructor + · rintro ⟨x, rfl⟩ + exact ⟨x.val, x.property, s.encode one, ZFSet.mem_singleton.2 rfl, rfl⟩ + · rintro ⟨x, hx, y, hy, eq⟩ + have same := ZFSet.mem_singleton.1 hy + subst y + exact ⟨⟨x, hx⟩, eq.symm⟩ + +theorem mem_eval_familySet (H : Set P) (one : P) (hone : one ∈ H) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (x : ZFSet.{u}) : + x ∈ eval H (familySet one T valid) ↔ ∃ τ : Name s, τ.val ∈ T ∧ eval H τ = x := by + rw [mem_eval] + simp only [entry_familySet] + constructor + · rintro ⟨τ, p, ⟨hτ, rfl⟩, _, eq⟩ + exact ⟨τ, hτ, eq⟩ + · rintro ⟨τ, hτ, eq⟩ + exact ⟨τ, one, ⟨hτ, rfl⟩, hone, eq⟩ + +theorem act_familySet {G : Type v} [Group G] [PartialOrder P] [OrderTop P] + (a : PosetAction G P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) (g : G) : + a.act s g (familySet ⊤ T valid) = familySet ⊤ T valid := by + apply Name.ext + intro σ p + change Entry σ (rename s (a.iso g) (familySet ⊤ T valid)) p ↔ _ + rw [entry_rename, entry_familySet] + constructor + · rintro ⟨τ, q, entry, eq, hp⟩ + obtain ⟨hτ, rfl⟩ := (entry_familySet ⊤ T valid τ q).1 entry + have target := closed g τ hτ + change a.act s g τ = σ at eq + exact ⟨eq ▸ target, hp.symm.trans (a.iso g).map_top⟩ + · rintro ⟨hσ, rfl⟩ + exact ⟨a.act s g⁻¹ σ, ⊤, + (entry_familySet ⊤ T valid _ ⊤).2 ⟨closed g⁻¹ σ hσ, rfl⟩, + a.act_inv_right s g σ, (a.iso g).map_top⟩ + +theorem familySet_hs {G : Type v} [Group G] [PartialOrder P] [OrderTop P] + (a : PosetAction G P) (F : NormalSubgroupFamily G) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (familySet ⊤ T valid) := by + refine HereditarilySymmetric.mk (F.upward F.top ?_) ?_ + · intro g _ + exact act_familySet a T valid closed g + · intro τ p entry + exact children τ ((entry_familySet ⊤ T valid τ p).1 entry).1 + +end Name + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem familySet_mem {P : Type u} (s : Presentation P) (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (hone : s.encode one ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) : (Name.familySet one T valid).val ∈ M.sets := by + rw [Name.familySet_code] + apply M.prod_mem pairing unions powers separation hT + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hone hone + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {Upper Lower : Type u} + +theorem rename_familySet_of_encode (s : Presentation Upper) (t : Presentation Lower) + (inclusion : Lower → Upper) (codes : ∀ p, s.encode (inclusion p) = t.encode p) + (upperOne : Upper) (lowerOne : Lower) (sameTop : s.encode upperOne = t.encode lowerOne) + (T : ZFSet.{u}) (validUpper : ∀ z ∈ T, IsName s z) + (validLower : ∀ z ∈ T, IsName t z) : + rename s inclusion (familySet lowerOne T validLower) = familySet upperOne T validUpper := by + apply Subtype.ext + rw [rename_val_of_encode s inclusion codes, familySet_code, familySet_code, sameTop] + +theorem eval_familySet_crossStage (s : Presentation Upper) (t : Presentation Lower) + (inclusion : Lower → Upper) (codes : ∀ p, s.encode (inclusion p) = t.encode p) + (upperOne : Upper) (lowerOne : Lower) (sameTop : s.encode upperOne = t.encode lowerOne) + (T : ZFSet.{u}) (validUpper : ∀ z ∈ T, IsName s z) + (validLower : ∀ z ∈ T, IsName t z) (H : Set Upper) : + eval H (familySet upperOne T validUpper) = + eval {p | inclusion p ∈ H} (familySet lowerOne T validLower) := by + rw [← rename_familySet_of_encode s t inclusion codes upperOne lowerOne sameTop T validUpper validLower] + exact eval_rename s inclusion H _ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {Upper Lower : Type u} [PartialOrder Upper] +variable (s : Presentation Upper) (t : Presentation Lower) +variable (inclusion : Lower → Upper) (J : ZFSet.{u}) +variable (valid : ∀ z ∈ J, IsName t z) (D : NameDomain s) (tau : Name s) +variable (H : ConditionFilter Upper) (generic : H.GenericFor (atomicFamily D)) +variable (target : tau ∈ D.names) +variable (terms : ∀ sigma : Name t, sigma.val ∈ J → rename s inclusion sigma ∈ D.names) +variable (one : Lower) (hone : H.mem (inclusion one)) +variable (decisions : ∀ sigma : Name t, sigma.val ∈ J → ∃ p : Lower, + H.mem (inclusion p) ∧ + (ForcesMem (inclusion p) (rename s inclusion sigma) tau ∨ + ∀ q, q ≤ inclusion p → ¬ ForcesMem q (rename s inclusion sigma) tau)) + +include generic target terms hone decisions + +theorem eval_crossStageMembershipName_of_decisions : + eval {p | H.mem (inclusion p)} (crossStageMembershipName s t inclusion J valid tau) = + eval {p | H.mem p} tau ∩ + eval {p | H.mem (inclusion p)} (familySet one J valid) := by + apply ZFSet.ext + intro x + constructor + · intro member + obtain ⟨sigma, p, entry, hp, value⟩ := (mem_eval _ _ x).1 member + obtain ⟨inJ, forced⟩ := (entry_crossStageMembershipName s t inclusion J tau valid sigma p).1 entry + have sound := forcesMem_sound D H generic (terms sigma inJ) target hp forced + rw [eval_rename] at sound + change eval {p | H.mem (inclusion p)} sigma ∈ eval {p | H.mem p} tau at sound + refine ZFSet.mem_inter.2 ⟨value ▸ sound, ?_⟩ + exact (mem_eval_familySet _ one hone J valid x).2 ⟨sigma, inJ, value⟩ + · intro member + obtain ⟨inTau, inFamily⟩ := ZFSet.mem_inter.1 member + obtain ⟨sigma, inJ, value⟩ := (mem_eval_familySet _ one hone J valid x).1 inFamily + have upperMember : eval {p | H.mem p} (rename s inclusion sigma) ∈ + eval {p | H.mem p} tau := by + rw [eval_rename] + change eval {p | H.mem (inclusion p)} sigma ∈ eval {p | H.mem p} tau + exact value.symm ▸ inTau + obtain ⟨p, hp, positive | negative⟩ := decisions sigma inJ + · exact (mem_eval _ _ x).2 ⟨sigma, p, + (entry_crossStageMembershipName s t inclusion J tau valid sigma p).2 ⟨inJ, positive⟩, + hp, value⟩ + · obtain ⟨q, hq, forced⟩ := + (eval_mem_iff_forcesMem D H generic (terms sigma inJ) target).1 upperMember + obtain ⟨r, _, rp, rq⟩ := H.directed hp hq + exact False.elim (negative r rp (forcesMem_mono forced rq)) + +theorem eval_crossStageMembershipName_of_subset + (subset : eval {p | H.mem p} tau ⊆ + eval {p | H.mem (inclusion p)} (familySet one J valid)) : + eval {p | H.mem (inclusion p)} (crossStageMembershipName s t inclusion J valid tau) = + eval {p | H.mem p} tau := by + rw [eval_crossStageMembershipName_of_decisions s t inclusion J valid D tau H generic + target terms one hone decisions] + apply ZFSet.ext + intro x + exact ⟨fun member => (ZFSet.mem_inter.1 member).1, + fun member => ZFSet.mem_inter.2 ⟨member, subset member⟩⟩ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} + +theorem eval_subset_familySet_of_code_subset (H : ConditionFilter P) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (tau : Name s) + (shape : tau.val ⊆ ZFSet.prod T s.carrier) : + eval {p | H.mem p} tau ⊆ eval {p | H.mem p} (familySet ⊤ T valid) := by + intro x member + obtain ⟨sigma, p, entry, _, value⟩ := (mem_eval {p | H.mem p} tau x).1 member + have term : sigma.val ∈ T := (ZFSet.pair_mem_prod.1 (shape entry)).1 + exact (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).2 + ⟨sigma, term, value⟩ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.Name +open SetRealization SetFormula +universe u v +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} + +noncomputable def niceNormalize (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (τ : D.names) : Name s := + separationName D (.mem 0 1) (extend τ Fin.elim0) (familySet ⊤ T valid) + +theorem entry_niceNormalize (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (τ : D.names) (σ : Name s) (p : P) : + Entry σ (niceNormalize D T valid τ) p ↔ + σ.val ∈ T ∧ ∃ h : σ ∈ D.names, + Forces D (.mem 0 1) (extend ⟨σ, h⟩ (extend τ Fin.elim0)) p := by + rw [niceNormalize, entry_separationName] + constructor + · rintro ⟨r, entry, _, forced⟩ + exact ⟨((entry_familySet ⊤ T valid σ r).1 entry).1, forced⟩ + · rintro ⟨member, forced⟩ + exact ⟨⊤, (entry_familySet ⊤ T valid σ ⊤).2 ⟨member, rfl⟩, le_top, forced⟩ + +theorem niceNormalize_subset (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (τ : D.names) : + (niceNormalize D T valid τ).val ⊆ ZFSet.prod T s.carrier := by + intro z member + obtain ⟨σ, p, rfl⟩ := entries_cover (niceNormalize D T valid τ) member + exact ZFSet.pair_mem_prod.2 + ⟨((entry_niceNormalize D T valid τ σ p).1 member).1, s.encode_mem p⟩ + +theorem eval_niceNormalize (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (τ : D.names) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) : + eval {p | H.mem p} (niceNormalize D T valid τ) = + eval {p | H.mem p} τ.val ∩ eval {p | H.mem p} (familySet ⊤ T valid) := by + rw [niceNormalize, eval_separationName D H generic (.mem 0 1) (extend τ Fin.elim0) family] + apply ZFSet.ext + intro x + simp only [ZFSet.mem_sep, ZFSet.mem_inter] + change (_ ∧ x ∈ eval {p | H.mem p} τ.val) ↔ _ + exact and_comm + +theorem eval_niceNormalize_of_subset (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (τ : D.names) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) + (subset : eval {p | H.mem p} τ.val ⊆ + eval {p | H.mem p} (familySet ⊤ T valid)) : + eval {p | H.mem p} (niceNormalize D T valid τ) = eval {p | H.mem p} τ.val := by + rw [eval_niceNormalize D T valid τ family H generic] + apply ZFSet.ext + intro x + exact ⟨fun h => (ZFSet.mem_inter.1 h).1, + fun h => ZFSet.mem_inter.2 ⟨h, subset h⟩⟩ + +variable {G : Type v} [Group G] (a : PosetAction G P) + +theorem niceNormalize_niceNameCode (D : NameDomain s) + (closed : ∀ g σ, σ ∈ D.names → a.act s g σ ∈ D.names) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + (τ : D.names) (K : Subgroup G) (fixed : K ≤ a.stabilizer s τ.val) : + NiceNameCode a s T K (niceNormalize D T valid τ).val := by + apply (niceNameCode_iff a s _).2 + refine ⟨niceNormalize_subset D T valid τ, ?_⟩ + intro g hg + change a.act s g (niceNormalize D T valid τ) = niceNormalize D T valid τ + unfold niceNormalize + rw [a.act_separationName s D closed, act_familySet a T valid terms] + have env : a.actAssignment s D closed g (extend τ Fin.elim0) = extend τ Fin.elim0 := by + funext i + refine Fin.cases ?_ (fun j => Fin.elim0 j) i + apply Subtype.ext + exact fixed hg + rw [env] + +theorem niceNormalize_hs (D : NameDomain s) + (closed : ∀ g σ, σ ∈ D.names → a.act s g σ ∈ D.names) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + (τ : D.names) (K : Subgroup G) (fixed : K ≤ a.stabilizer s τ.val) + (F : Compression.RecursiveMaps.NormalSubgroupFamily G) (member : F.mem K) + (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : + HereditarilySymmetric a s F (niceNormalize D T valid τ) := + niceNameCode_hs a s F member children + (niceNormalize_niceNameCode a D closed T valid terms τ K fixed) + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {Upper Lower : Type u} +variable [PartialOrder Upper] [PartialOrder Lower] [OrderTop Lower] +variable (s : Presentation Upper) (t : Presentation Lower) +variable (restriction : Upper →o Lower) (inclusion : Lower ↪o Upper) +variable (projection : CompleteProjection restriction inclusion) +variable (codes : ∀ p, s.encode (inclusion p) = t.encode p) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (upperCarrier : s.carrier ∈ M.sets) (upperOrder : s.conditionOrder ∈ M.sets) +variable (lowerCarrier : t.carrier ∈ M.sets) (lowerOrder : t.conditionOrder ∈ M.sets) +variable {J f : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName t z) +variable (tau : (M.nameDomain s).names) +variable (function : ZFSet.IsFunc J (M.groundPower s.carrier) f) +variable (selected : ∀ sigma A, ZFSet.pair sigma A ∈ f → + A ⊆ M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma tau.val.val ∧ + A ⊆ t.carrier ∧ ∀ q ∈ t.carrier, ∃ p ∈ A, ∃ r ∈ t.carrier, + ZFSet.pair r q ∈ t.conditionOrder ∧ ZFSet.pair r p ∈ t.conditionOrder) +variable (H : ConditionFilter Upper) +variable (upperGeneric : H.GenericFor (formulaFamily (M.nameDomain s))) +variable (lowerGeneric : (projection.projectedFilter H).GenericFor (M.codedFamily t)) +include codes pairing unions powers separation collection upperCarrier upperOrder lowerCarrier lowerOrder + hJ function selected upperGeneric lowerGeneric + +theorem crossStageMembershipName_eval_of_family : + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.crossStageMembershipName s t inclusion J valid tau.val) = + Name.eval {p | H.mem p} tau.val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) := by + have terms (sigma : Name t) (member : sigma.val ∈ J) : + Name.rename s inclusion sigma ∈ (M.nameDomain s).names := by + change (Name.rename s inclusion sigma).val ∈ M.sets + rw [Name.rename_val_of_encode s inclusion codes] + exact M.transitive hJ member + have decisions (sigma : Name t) (member : sigma.val ∈ J) : ∃ p : Lower, + H.mem (inclusion p) ∧ + (Name.ForcesMem (inclusion p) (Name.rename s inclusion sigma) tau.val ∨ + ∀ q, q ≤ inclusion p → ¬ Name.ForcesMem q (Name.rename s inclusion sigma) tau.val) := by + obtain ⟨A, entry, _⟩ := function.2 sigma.val member + have groundA := ((M.mem_groundPower s.carrier A).1 + (ZFSet.pair_mem_prod.1 (function.1 entry)).2).1 + obtain ⟨domain, bound, predense⟩ := selected sigma.val A entry + obtain ⟨p, hp, inA⟩ := M.generic_meets_ground_predense t separation lowerCarrier lowerOrder + (projection.projectedFilter H) lowerGeneric groundA bound predense + let upperSigma : (M.nameDomain s).names := ⟨Name.rename s inclusion sigma, terms sigma member⟩ + have decisionEntry : s.encode (inclusion p) ∈ + M.ordinaryMembershipDecisions s.carrier s.conditionOrder upperSigma.val.val tau.val.val := by + change s.encode (inclusion p) ∈ M.ordinaryMembershipDecisions s.carrier s.conditionOrder + (Name.rename s inclusion sigma).val tau.val.val + rw [codes p, Name.rename_val_of_encode s inclusion codes] + exact domain inA + exact ⟨p, hp, (M.ordinaryMembershipDecisions_entry s pairing unions powers separation collection + upperCarrier upperOrder upperSigma tau (inclusion p)).1 decisionEntry⟩ + have topMember : H.mem (inclusion ⊤) := by + obtain ⟨p, hp⟩ := (projection.projectedFilter H).nonempty + exact (projection.projectedFilter H).upward hp le_top + have atomicGeneric : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := + fun E member dense => upperGeneric E (Or.inl member) dense + exact Name.eval_crossStageMembershipName_of_decisions s t inclusion J valid (M.nameDomain s) + tau.val H atomicGeneric tau.property terms ⊤ topMember decisions + +theorem crossStageMembershipName_eval_of_family_subset + (subset : Name.eval {p | H.mem p} tau.val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid)) : + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.crossStageMembershipName s t inclusion J valid tau.val) = + Name.eval {p | H.mem p} tau.val := by + rw [M.crossStageMembershipName_eval_of_family s t restriction inclusion projection codes + pairing unions powers separation collection upperCarrier upperOrder lowerCarrier lowerOrder + hJ valid tau function selected H upperGeneric lowerGeneric] + apply ZFSet.ext + intro x + exact ⟨fun member => (ZFSet.mem_inter.1 member).1, + fun member => ZFSet.mem_inter.2 ⟨member, subset member⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +omit [OrderTop P] in +include pairing unions powers separation collection carrier order in +theorem ordinarySeparationName_mem {n : Nat} (φ : SetFormula (n + 1)) + (nameEnv : Assignment (M.nameDomain s) n) (τ : (M.nameDomain s).names) : + (Name.separationName (M.nameDomain s) φ nameEnv τ.val).val ∈ M.sets := by + let context := extend s.carrier (extend s.conditionOrder (fun i => (nameEnv i).val.val)) + let params : Fin 2 → Fin (n + 2) := extend 0 (extend 1 Fin.elim0) + have members : ∀ i, context i ∈ M.sets := + Fin.cases carrier (Fin.cases order (fun i => (nameEnv i).property)) + apply M.separationName_mem s (M.nameDomain s) (fun _ h => h) + pairing unions powers separation carrier order (ordinaryGroundPrimitives 0 1) + φ params (fun i => i.succ.succ) context members rfl rfl + · exact M.equalityMeaning_lifted s (M.nameDomain s) (fun _ h => h) + pairing unions powers separation collection carrier order 0 1 _ rfl rfl + · exact M.domainMeaning_liftedNames s pairing unions powers separation collection carrier 0 _ rfl + · exact fun _ => rfl + +include pairing unions powers separation collection carrier order in +theorem niceNormalize_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (τ : (M.nameDomain s).names) : + (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ M.sets := by + have family := M.familySet_mem s ⊤ pairing unions powers separation hT + (M.transitive carrier (s.encode_mem ⊤)) valid + exact M.ordinarySeparationName_mem s pairing unions powers separation collection carrier order + (.mem 0 1) (extend τ Fin.elim0) ⟨Name.familySet ⊤ T valid, family⟩ + +theorem entry_niceNormalize {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (τ : (M.nameDomain s).names) (σ : Name s) (p : P) : + Name.Entry σ (Name.niceNormalize (M.nameDomain s) T valid τ) p ↔ + σ.val ∈ T ∧ Name.ForcesMem p σ τ.val := by + rw [Name.entry_niceNormalize] + constructor + · rintro ⟨member, _, forced⟩ + exact ⟨member, forced⟩ + · rintro ⟨member, forced⟩ + exact ⟨member, M.transitive hT member, forced⟩ + +include pairing unions powers separation collection carrier order in +theorem niceNormalize_spec {G : Type u} [Group G] + (a : PosetAction G P) (t : Presentation G) + (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + (τ : (M.nameDomain s).names) (K : Subgroup G) (fixed : K ≤ a.stabilizer s τ.val) + (F : NormalSubgroupFamily G) (member : F.mem K) + (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : + (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ M.sets ∧ + NiceNameCode a s T K (Name.niceNormalize (M.nameDomain s) T valid τ).val ∧ + HereditarilySymmetric a s F (Name.niceNormalize (M.nameDomain s) T valid τ) ∧ + ∀ (H : ConditionFilter P), H.GenericFor (formulaFamily (M.nameDomain s)) → + Name.eval {p | H.mem p} (Name.niceNormalize (M.nameDomain s) T valid τ) = + Name.eval {p | H.mem p} τ.val ∩ Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := by + have closed : ∀ g σ, σ ∈ (M.nameDomain s).names → a.act s g σ ∈ (M.nameDomain s).names := + fun g σ hσ => M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ + have code := Name.niceNormalize_niceNameCode a (M.nameDomain s) closed T valid terms τ K fixed + refine ⟨M.niceNormalize_mem s pairing unions powers separation collection carrier order hT valid τ, + code, niceNameCode_hs a s F member children code, ?_⟩ + intro H generic + exact Name.eval_niceNormalize (M.nameDomain s) T valid τ + (M.familySet_mem s ⊤ pairing unions powers separation hT + (M.transitive carrier (s.encode_mem ⊤)) valid) H generic + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNicePreparationWitnessBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNicePreparationWitnessBounds.lean index 99356d36767e7b4a7a0bc368c408ffa6080ab174..70f95efb5a710acbf9440844211e1cb1ac113b52 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNicePreparationWitnessBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNicePreparationWitnessBounds.lean @@ -1,113 +1,113 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundRelations_mono {A B C D : ZFSet.{u}} (left : A ⊆ C) (right : B ⊆ D) : - M.groundRelations A B ⊆ M.groundRelations C D := by - intro f member - obtain ⟨ground, shape⟩ := (M.mem_groundRelations A B f).1 member - refine (M.mem_groundRelations C D f).2 ⟨ground, ?_⟩ - intro z hz - obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (shape hz) - exact ZFSet.pair_mem_prod.2 ⟨left ha, right hb⟩ - -theorem supportedEqualityCertificateBound_mono {nodes N W : ZFSet.{u}} (inside : N ⊆ W) : - M.supportedEqualityCertificateBound nodes N ⊆ M.supportedEqualityCertificateBound nodes W := by - intro z hz - obtain ⟨F, hF, tail, htail, rfl⟩ := ZFSet.mem_prod.1 hz - obtain ⟨B, hB, f, hf, rfl⟩ := ZFSet.mem_prod.1 htail - exact ZFSet.pair_mem_prod.2 ⟨hF, ZFSet.pair_mem_prod.2 - ⟨hB, M.groundRelations_mono (fun _ h => h) inside hf⟩⟩ - -theorem synchronizedEnumerationBound_mono {nodes N W : ZFSet.{u}} (inside : N ⊆ W) : - M.synchronizedEnumerationBound nodes N ⊆ M.synchronizedEnumerationBound nodes W := by - intro z hz - obtain ⟨e, he, names, hn, rfl⟩ := ZFSet.mem_prod.1 hz - exact ZFSet.pair_mem_prod.2 ⟨he, M.groundRelations_mono (fun _ h => h) inside hn⟩ - -noncomputable def preparationWitnessBound (nodes T Q : ZFSet.{u}) : ZFSet.{u} := - let W := M.groundRelations T Q - ZFSet.prod Q (ZFSet.prod - (M.groundRelations W (M.supportedEqualityCertificateBound nodes W)) - (M.groundRelations W (M.synchronizedEnumerationBound nodes W))) - -theorem mem_preparationWitnessBound (nodes T Q r k enumerations : ZFSet.{u}) : - ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q ↔ - r ∈ Q ∧ k ∈ M.groundRelations (M.groundRelations T Q) - (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) ∧ - enumerations ∈ M.groundRelations (M.groundRelations T Q) - (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) := by - simp only [preparationWitnessBound, ZFSet.pair_mem_prod] - -theorem preparationWitnessBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {nodes T Q : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hT : T ∈ M.sets) - (hQ : Q ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.preparationWitnessBound nodes T Q ∈ M.sets := by - have hW := M.groundRelations_mem pairing unions powers separation hT hQ - exact M.prod_mem pairing unions powers separation hQ - (M.prod_mem pairing unions powers separation - (M.groundRelations_mem pairing unions powers separation hW - (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega)) - (M.groundRelations_mem pairing unions powers separation hW - (M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega))) - -theorem preparationWitness_mem_of_local {nodes T Q J N r k enumerations : ZFSet.{u}} - (requestBound : J ⊆ M.groundRelations T Q) (nameBound : N ⊆ M.groundRelations T Q) - (hr : r ∈ Q) (hk : k ∈ M.sets) (he : enumerations ∈ M.sets) - (certificates : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) - (enumerated : ZFSet.IsFunc J (M.synchronizedEnumerationBound nodes N) enumerations) : - ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q := by - have localK := (M.mem_groundRelations J (M.supportedEqualityCertificateBound nodes N) k).2 - ⟨hk, certificates.1⟩ - have localE := (M.mem_groundRelations J (M.synchronizedEnumerationBound nodes N) enumerations).2 - ⟨he, enumerated.1⟩ - exact (M.mem_preparationWitnessBound nodes T Q r k enumerations).2 - ⟨hr, M.groundRelations_mono requestBound (M.supportedEqualityCertificateBound_mono nameBound) localK, - M.groundRelations_mono requestBound (M.synchronizedEnumerationBound_mono nameBound) localE⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (T : ZFSet.{u}) (K : I → Subgroup G) - -theorem niceSupportNameCodes_subset_groundRelations {Q : ZFSet.{u}} (carrier : s.carrier ⊆ Q) : - M.niceSupportNameCodes a s T K ⊆ M.groundRelations T Q := by - intro z member - obtain ⟨ground, i, code⟩ := (M.mem_niceSupportNameCodes a s T K z).1 member - have localBound := (M.mem_groundRelations T s.carrier z).2 ⟨ground, niceNameCode_subset a s code⟩ - exact M.groundRelations_mono (fun _ h => h) carrier localBound - -theorem nicePreparationWitness_mem {nodes Q J r k enumerations : ZFSet.{u}} - (carrier : s.carrier ⊆ Q) (requests : J ⊆ M.groundRelations T s.carrier) - (hr : r ∈ Q) (hk : k ∈ M.sets) (he : enumerations ∈ M.sets) - (certificates : ZFSet.IsFunc J - (M.supportedEqualityCertificateBound nodes (M.niceSupportNameCodes a s T K)) k) - (enumerated : ZFSet.IsFunc J - (M.synchronizedEnumerationBound nodes (M.niceSupportNameCodes a s T K)) enumerations) : - ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q := - M.preparationWitness_mem_of_local - (fun _ h => M.groundRelations_mono (fun _ h => h) carrier (requests h)) - (M.niceSupportNameCodes_subset_groundRelations a s T K carrier) - hr hk he certificates enumerated - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundRelations_mono {A B C D : ZFSet.{u}} (left : A ⊆ C) (right : B ⊆ D) : + M.groundRelations A B ⊆ M.groundRelations C D := by + intro f member + obtain ⟨ground, shape⟩ := (M.mem_groundRelations A B f).1 member + refine (M.mem_groundRelations C D f).2 ⟨ground, ?_⟩ + intro z hz + obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (shape hz) + exact ZFSet.pair_mem_prod.2 ⟨left ha, right hb⟩ + +theorem supportedEqualityCertificateBound_mono {nodes N W : ZFSet.{u}} (inside : N ⊆ W) : + M.supportedEqualityCertificateBound nodes N ⊆ M.supportedEqualityCertificateBound nodes W := by + intro z hz + obtain ⟨F, hF, tail, htail, rfl⟩ := ZFSet.mem_prod.1 hz + obtain ⟨B, hB, f, hf, rfl⟩ := ZFSet.mem_prod.1 htail + exact ZFSet.pair_mem_prod.2 ⟨hF, ZFSet.pair_mem_prod.2 + ⟨hB, M.groundRelations_mono (fun _ h => h) inside hf⟩⟩ + +theorem synchronizedEnumerationBound_mono {nodes N W : ZFSet.{u}} (inside : N ⊆ W) : + M.synchronizedEnumerationBound nodes N ⊆ M.synchronizedEnumerationBound nodes W := by + intro z hz + obtain ⟨e, he, names, hn, rfl⟩ := ZFSet.mem_prod.1 hz + exact ZFSet.pair_mem_prod.2 ⟨he, M.groundRelations_mono (fun _ h => h) inside hn⟩ + +noncomputable def preparationWitnessBound (nodes T Q : ZFSet.{u}) : ZFSet.{u} := + let W := M.groundRelations T Q + ZFSet.prod Q (ZFSet.prod + (M.groundRelations W (M.supportedEqualityCertificateBound nodes W)) + (M.groundRelations W (M.synchronizedEnumerationBound nodes W))) + +theorem mem_preparationWitnessBound (nodes T Q r k enumerations : ZFSet.{u}) : + ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q ↔ + r ∈ Q ∧ k ∈ M.groundRelations (M.groundRelations T Q) + (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) ∧ + enumerations ∈ M.groundRelations (M.groundRelations T Q) + (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) := by + simp only [preparationWitnessBound, ZFSet.pair_mem_prod] + +theorem preparationWitnessBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {nodes T Q : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hT : T ∈ M.sets) + (hQ : Q ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.preparationWitnessBound nodes T Q ∈ M.sets := by + have hW := M.groundRelations_mem pairing unions powers separation hT hQ + exact M.prod_mem pairing unions powers separation hQ + (M.prod_mem pairing unions powers separation + (M.groundRelations_mem pairing unions powers separation hW + (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega)) + (M.groundRelations_mem pairing unions powers separation hW + (M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega))) + +theorem preparationWitness_mem_of_local {nodes T Q J N r k enumerations : ZFSet.{u}} + (requestBound : J ⊆ M.groundRelations T Q) (nameBound : N ⊆ M.groundRelations T Q) + (hr : r ∈ Q) (hk : k ∈ M.sets) (he : enumerations ∈ M.sets) + (certificates : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) + (enumerated : ZFSet.IsFunc J (M.synchronizedEnumerationBound nodes N) enumerations) : + ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q := by + have localK := (M.mem_groundRelations J (M.supportedEqualityCertificateBound nodes N) k).2 + ⟨hk, certificates.1⟩ + have localE := (M.mem_groundRelations J (M.synchronizedEnumerationBound nodes N) enumerations).2 + ⟨he, enumerated.1⟩ + exact (M.mem_preparationWitnessBound nodes T Q r k enumerations).2 + ⟨hr, M.groundRelations_mono requestBound (M.supportedEqualityCertificateBound_mono nameBound) localK, + M.groundRelations_mono requestBound (M.synchronizedEnumerationBound_mono nameBound) localE⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (T : ZFSet.{u}) (K : I → Subgroup G) + +theorem niceSupportNameCodes_subset_groundRelations {Q : ZFSet.{u}} (carrier : s.carrier ⊆ Q) : + M.niceSupportNameCodes a s T K ⊆ M.groundRelations T Q := by + intro z member + obtain ⟨ground, i, code⟩ := (M.mem_niceSupportNameCodes a s T K z).1 member + have localBound := (M.mem_groundRelations T s.carrier z).2 ⟨ground, niceNameCode_subset a s code⟩ + exact M.groundRelations_mono (fun _ h => h) carrier localBound + +theorem nicePreparationWitness_mem {nodes Q J r k enumerations : ZFSet.{u}} + (carrier : s.carrier ⊆ Q) (requests : J ⊆ M.groundRelations T s.carrier) + (hr : r ∈ Q) (hk : k ∈ M.sets) (he : enumerations ∈ M.sets) + (certificates : ZFSet.IsFunc J + (M.supportedEqualityCertificateBound nodes (M.niceSupportNameCodes a s T K)) k) + (enumerated : ZFSet.IsFunc J + (M.synchronizedEnumerationBound nodes (M.niceSupportNameCodes a s T K)) enumerations) : + ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q := + M.preparationWitness_mem_of_local + (fun _ h => M.groundRelations_mono (fun _ h => h) carrier (requests h)) + (M.niceSupportNameCodes_subset_groundRelations a s T K carrier) + hr hk he certificates enumerated + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementClassSupports.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementClassSupports.lean index 549adba3726b0adfce35a057a994813f20c4e903..9f26b5ba6ec6998f3562b74a3e22cc546873a1b5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementClassSupports.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementClassSupports.lean @@ -1,49 +1,49 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (valid2 : ∀ z ∈ T2, IsName s z) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include indices in -theorem niceRefinementClasses_supported_by_block - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) - (children : ∀ tau : Name s, tau.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) - (C E D : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (anchor : E ≤ D) (representatives : Fin 2 → Name s) - (positions : ∀ i, d.principalFix D ≤ a.stabilizer s (representatives i)) : - ∀ i, d.principalFix D ≤ a.stabilizer s - (Name.refinementClass T valid (![Rc.val, Rf.val] i) (representatives i)) ∧ - HereditarilySymmetric a s (d.principalSupportFamily base directed) - (Name.refinementClass T valid (![Rc.val, Rf.val] i) (representatives i)) := by - obtain ⟨lower, _, fine, coarse, _⟩ := (indices.typed_entries C E U Rf Rc).1 member - have atC := d.principalFix_antitone (le_trans (le_of_lt lower) anchor) - have fineSupport := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val).1 fine).2.2 - have coarseSupport := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val).1 coarse).2.2 - have relation : ∀ i : Fin 2, d.principalFix D ≤ a.stabilizer s (![Rc.val, Rf.val] i) := - Fin.cases (atC.trans coarseSupport) - (Fin.cases (atC.trans fineSupport) (fun j => Fin.elim0 j)) - intro i - exact ⟨Name.refinementClass_support a T valid closed _ _ (d.principalFix D) - (relation i) (positions i), - Name.refinementClass_hs a (d.principalSupportFamily base directed) T valid closed children - _ _ (d.principalFix D) ⟨D, le_rfl⟩ (relation i) (positions i)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (valid2 : ∀ z ∈ T2, IsName s z) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include indices in +theorem niceRefinementClasses_supported_by_block + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) + (children : ∀ tau : Name s, tau.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) + (C E D : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (anchor : E ≤ D) (representatives : Fin 2 → Name s) + (positions : ∀ i, d.principalFix D ≤ a.stabilizer s (representatives i)) : + ∀ i, d.principalFix D ≤ a.stabilizer s + (Name.refinementClass T valid (![Rc.val, Rf.val] i) (representatives i)) ∧ + HereditarilySymmetric a s (d.principalSupportFamily base directed) + (Name.refinementClass T valid (![Rc.val, Rf.val] i) (representatives i)) := by + obtain ⟨lower, _, fine, coarse, _⟩ := (indices.typed_entries C E U Rf Rc).1 member + have atC := d.principalFix_antitone (le_trans (le_of_lt lower) anchor) + have fineSupport := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val).1 fine).2.2 + have coarseSupport := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val).1 coarse).2.2 + have relation : ∀ i : Fin 2, d.principalFix D ≤ a.stabilizer s (![Rc.val, Rf.val] i) := + Fin.cases (atC.trans coarseSupport) + (Fin.cases (atC.trans fineSupport) (fun j => Fin.elim0 j)) + intro i + exact ⟨Name.refinementClass_support a T valid closed _ _ (d.principalFix D) + (relation i) (positions i), + Name.refinementClass_hs a (d.principalSupportFamily base directed) T valid closed children + _ _ (d.principalFix D) ⟨D, le_rfl⟩ (relation i) (positions i)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementIndexActionLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementIndexActionLaws.lean index 2860273407f00e96cc921b94cf34da52ba9963b0..8490e83a8f15e5a42a0c3c2517b3c3b19a521f01 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementIndexActionLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceRefinementIndexActionLaws.lean @@ -1,495 +1,495 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TupleRelationProducts -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) - -include pairing unions powers separation collection carrier order maps in -theorem niceRefinementIndex_act_iff (level T1 T2 : ZFSet.{u}) - (valid : ∀ z ∈ T1, IsName s z) - (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) - (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) - (familyGround : (Name.familySet ⊤ T1 valid).val ∈ M.sets) - (g : G) (C E : L) (U Rf Rc : (M.nameDomain s).names) : - refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid ↔ - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid := by - let groundClosed := fun g (w : Name s) (hw : w ∈ (M.nameDomain s).names) => - M.act_mem s a t pairing unions powers separation collection carrier maps g w hw - let moved := a.domainEquiv s (M.nameDomain s) groundClosed g - let whole : (M.nameDomain s).names := ⟨Name.familySet ⊤ T1 valid, familyGround⟩ - let env := extend U (extend Rf (extend Rc (extend whole Fin.elim0))) - have sameWhole : moved whole = whole := - Subtype.ext (Name.act_familySet a T1 valid closed1 g) - have envEq : a.actAssignment s (M.nameDomain s) groundClosed g env = - extend (moved U) (extend (moved Rf) (extend (moved Rc) (extend whole Fin.elim0))) := by - funext j - refine Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases ?_ - (fun k => Fin.elim0 k)))) j - exact sameWhole - have force := a.formula_forces_act_iff s (M.nameDomain s) groundClosed g - BoundedFormula.refinementValidityFormula.toFormula env ⊤ - rw [(a.iso g).map_top, envEq] at force - change refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (moved U).val.val (moved Rf).val.val (moved Rc).val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid ↔ _ - rw [M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order level T1 T2 valid familyGround (d.iso g C) (d.iso g E) - (moved U) (moved Rf) (moved Rc), - M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order level T1 T2 valid familyGround C E U Rf Rc] - exact and_congr (d.iso g).lt_iff_lt - (and_congr (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation - collection carrier maps closed1 d g C U.val) - (and_congr (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation - collection carrier maps closed2 d g C Rf.val) - (and_congr (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation - collection carrier maps closed2 d g C Rc.val) force))) - -omit [OrderTop P] in -theorem niceRefinementIndex_fixed (level T1 T2 : ZFSet.{u}) (C E : L) - (U Rf Rc : Name s) (lower : C ≤ E) - (domain : U.val ∈ M.niceNameCandidates a s T1 (d.principalFix C)) - (fine : Rf.val ∈ M.niceNameCandidates a s T2 (d.principalFix C)) - (coarse : Rc.val ∈ M.niceNameCandidates a s T2 (d.principalFix C)) - (g : G) (fixed : g ∈ d.principalFix E) : - refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val = - refinementIndexCode level (b.encode C) (b.encode E) U.val Rf.val Rc.val := by - have atC : g ∈ d.principalFix C := d.principalFix_antitone lower fixed - have getSupport {X : ZFSet.{u}} (w : Name s) - (member : w.val ∈ M.niceNameCandidates a s X (d.principalFix C)) : - a.act s g w = w := by - have code := ((M.mem_niceNameCandidates a s X (d.principalFix C) w.val).1 member).2 - obtain ⟨σ, equal, _, support⟩ := code - have same : σ = w := Subtype.ext equal - subst σ - exact support atC - rw [fixed C lower, fixed E le_rfl, getSupport U domain, getSupport Rf fine, getSupport Rc coarse] - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} -variable [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - -noncomputable def stageOneNameAction (g : G) : (M.nameDomain s).names ≃ (M.nameDomain s).names := - a.domainEquiv s (M.nameDomain s) - (fun g w hw => M.act_mem s a t pairing unions powers separation collection carrier maps g w hw) g - -theorem stageOneNameAction_val (g : G) (w : (M.nameDomain s).names) : - (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g w).val = - a.act s g w.val := rfl - -theorem stageOneNameAction_one (w : (M.nameDomain s).names) : - M.stageOneNameAction a s t pairing unions powers separation collection carrier maps 1 w = w := - Subtype.ext (a.act_one s w.val) - -theorem stageOneNameAction_mul (g h : G) (w : (M.nameDomain s).names) : - M.stageOneNameAction a s t pairing unions powers separation collection carrier maps (g * h) w = - M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g - (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps h w) := - Subtype.ext (a.act_mul s g h w.val) - -theorem stageOneNameAction_forces_iff (g : G) {n : Nat} (φ : SetFormula n) - (env : Assignment (M.nameDomain s) n) (p : P) : - Forces (M.nameDomain s) φ - (fun j => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g (env j)) - (a.iso g p) ↔ Forces (M.nameDomain s) φ env p := - a.formula_forces_act_iff s (M.nameDomain s) - (fun g w hw => M.act_mem s a t pairing unions powers separation collection carrier maps g w hw) - g φ env p - -variable [OrderTop P] (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - -include closed in -theorem stageOneNameAction_class (g : G) (R w : (M.nameDomain s).names) : - M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g - (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w) = - M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g R) - (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g w) := - Subtype.ext (Name.act_refinementClass a T valid closed g R.val w.val) - -include closed in -theorem stageOneNameAction_map (g : G) (U Rf Rc : (M.nameDomain s).names) : - M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g - (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc) = - M.stageOneMapName s pairing unions powers separation collection carrier order hT valid - (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g U) - (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g Rf) - (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g Rc) := - Subtype.ext (Name.act_refinementNaturalMap a T valid closed g U.val Rf.val Rc.val) - -variable {L : Type u} [PartialOrder L] -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -theorem stageOneNameAction_visibility (system : NiceNameSystem M a s b d base directed T valid) - (g : G) (v : L) : - M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g - (M.stageOneVisibilityName s valid a b d base directed system v) = - M.stageOneVisibilityName s valid a b d base directed system (d.iso g v) := - Subtype.ext (system.visibility_action g v) - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps -local notation "cls" => M.stageOneClassName s pairing unions powers separation collection carrier order hT valid -local notation "vis" => M.stageOneVisibilityName s valid a b d base directed system -local notation "mapName" => M.stageOneMapName s pairing unions powers separation collection carrier order hT valid - -omit [OrderTop P] in -theorem stageOneActivity_act_iff (g : G) (U u w : (M.nameDomain s).names) (p : P) : - Forces (M.nameDomain s) refinementActivityFormula ![move g u, move g w, move g U] (a.iso g p) ↔ - Forces (M.nameDomain s) refinementActivityFormula ![u, w, U] p := by - have envEq : (fun j => move g (![u, w, U] j)) = - ![move g u, move g w, move g U] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j - have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection - carrier maps g refinementActivityFormula ![u, w, U] p - rw [envEq] at law - exact law - -include closed in -theorem stageOneProfile_act_iff (g : G) (Rc Rf u w : (M.nameDomain s).names) (v : L) (p : P) : - Forces (M.nameDomain s) refinementProfileFormula ![cls (move g Rc) (move g u), cls (move g Rf) (move g w), vis (d.iso g v)] (a.iso g p) ↔ - Forces (M.nameDomain s) refinementProfileFormula ![cls Rc u, cls Rf w, vis v] p := by - have envEq : (fun j => move g (![cls Rc u, cls Rf w, vis v] j)) = - ![cls (move g Rc) (move g u), cls (move g Rf) (move g w), vis (d.iso g v)] := by - funext j - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun k => Fin.elim0 k))) j - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - · exact M.stageOneNameAction_visibility a s t pairing unions powers separation collection carrier maps valid b d base directed system g _ - have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection - carrier maps g refinementProfileFormula ![cls Rc u, cls Rf w, vis v] p - rw [envEq] at law - exact law - -include closed in -theorem stageOneCompatibility_act_iff (g : G) (U Rf Rc u w : (M.nameDomain s).names) (C : L) (p : P) : - Forces (M.nameDomain s) refinementCompatibilityFormula ![cls (move g Rf) (move g w), vis (d.iso g C), cls (move g Rc) (move g u), mapName (move g U) (move g Rf) (move g Rc)] (a.iso g p) ↔ - Forces (M.nameDomain s) refinementCompatibilityFormula ![cls Rf w, vis C, cls Rc u, mapName U Rf Rc] p := by - have envEq : (fun j => move g (![cls Rf w, vis C, cls Rc u, mapName U Rf Rc] j)) = - ![cls (move g Rf) (move g w), vis (d.iso g C), cls (move g Rc) (move g u), mapName (move g U) (move g Rf) (move g Rc)] := by - funext j - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun k => Fin.elim0 k)))) j - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - · exact M.stageOneNameAction_visibility a s t pairing unions powers separation collection carrier maps valid b d base directed system g _ - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - · exact M.stageOneNameAction_map a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ _ - have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection - carrier maps g refinementCompatibilityFormula ![cls Rf w, vis C, cls Rc u, mapName U Rf Rc] p - rw [envEq] at law - exact law - -include closed in -theorem stageOneCollisionTest_act_iff (g : G) (Rf Rc u u' w w' : (M.nameDomain s).names) (p : P) : - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (move g Rf) (move g Rc) (move g u) (move g u') (move g w) (move g w') (a.iso g p) ↔ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid Rf Rc u u' w w' p := by - change Forces (M.nameDomain s) refinementCollisionFormula ![cls (move g Rc) (move g u), cls (move g Rc) (move g u'), cls (move g Rf) (move g w), cls (move g Rf) (move g w')] (a.iso g p) ↔ - Forces (M.nameDomain s) refinementCollisionFormula ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] p - have envEq : (fun j => move g (![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] j)) = - ![cls (move g Rc) (move g u), cls (move g Rc) (move g u'), cls (move g Rf) (move g w), cls (move g Rf) (move g w')] := by - funext j - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun k => Fin.elim0 k)))) j - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ - have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection - carrier maps g refinementCollisionFormula ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] p - rw [envEq] at law - exact law - -include closed in -theorem stageOneSingleTests_act_iff (g : G) (C E : L) - (U Rf Rc u w : (M.nameDomain s).names) (p : P) : - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (d.iso g C) (d.iso g E) - (move g U) (move g Rf) (move g Rc) (move g u) (move g w) (a.iso g p) ↔ - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p := by - have activity := M.stageOneActivity_act_iff a s t pairing unions powers separation collection - carrier maps g U u w p - have compatible := M.stageOneCompatibility_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed b d base directed system g U Rf Rc u w C p - have profile := fun v => M.stageOneProfile_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed b d base directed system g Rc Rf u w v p - constructor - · intro tests - refine ⟨activity.mp tests.1, ?_, compatible.mp tests.2.2⟩ - intro v above - exact (profile v).mp (tests.2.1 (d.iso g v) ((d.iso g).monotone above)) - · intro tests - refine ⟨activity.mpr tests.1, ?_, compatible.mpr tests.2.2⟩ - intro v above - obtain ⟨v, rfl⟩ := (d.iso g).surjective v - exact (profile v).mpr (tests.2.1 v ((d.iso g).le_iff_le.mp above)) - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T1 T2 : ZFSet.{u}) -variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) - -noncomputable def niceRefinementIndexCoordinateGraphs (g : G) : Fin 6 → ZFSet.{u} := - ![identityFunctionGraph {level}, b.graph b (d.iso g), b.graph b (d.iso g), - Name.renameFamilyGraph s (a.iso g) (M.groundRelations T1 s.carrier) - (fun z hz => Name.isName_of_subset valid1 ((M.mem_groundRelations T1 s.carrier z).1 hz).2), - Name.renameFamilyGraph s (a.iso g) (M.groundRelations T2 s.carrier) - (fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2), - Name.renameFamilyGraph s (a.iso g) (M.groundRelations T2 s.carrier) - (fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2)] - -noncomputable def niceRefinementIndexActionGraph (g : G) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ tupleRelationProduct 5 - (M.niceRefinementIndexCoordinateGraphs a s b d level T1 T2 valid1 valid2 g)) - (ZFSet.prod (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndices a s b d level T1 T2 valid1)) - -theorem pair_mem_niceRefinementIndexActionGraph (g : G) (x y : Fin 6 → ZFSet.{u}) : - ZFSet.pair (nonemptyTupleCode 5 x) (nonemptyTupleCode 5 y) ∈ - M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g ↔ - nonemptyTupleCode 5 x ∈ M.niceRefinementIndices a s b d level T1 T2 valid1 ∧ - nonemptyTupleCode 5 y ∈ M.niceRefinementIndices a s b d level T1 T2 valid1 ∧ - ∀ j, ZFSet.pair (x j) (y j) ∈ - M.niceRefinementIndexCoordinateGraphs a s b d level T1 T2 valid1 valid2 g j := by - rw [niceRefinementIndexActionGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod, - pair_mem_tupleRelationProduct] - exact and_assoc - -theorem niceRefinementIndexActionGraph_mem (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) - (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) - (g : G) : M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g ∈ M.sets := by - have identity := M.identityFunctionGraph_mem pairing unions powers separation - (show ({level} : ZFSet.{u}) ∈ M.sets from by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hl hl) - have nodes := M.conditionMap_graph_mem d b t nodeMaps g - have condition := M.conditionMap_graph_mem a s t maps g - have first := M.renameFamilyGraph_mem s s pairing unions powers separation collection - carrier carrier (a.iso g) condition (M.groundRelations T1 s.carrier) - (M.groundRelations_mem pairing unions powers separation hT1 carrier) - (fun z hz => Name.isName_of_subset valid1 ((M.mem_groundRelations T1 s.carrier z).1 hz).2) - have second := M.renameFamilyGraph_mem s s pairing unions powers separation collection - carrier carrier (a.iso g) condition (M.groundRelations T2 s.carrier) - (M.groundRelations_mem pairing unions powers separation hT2 carrier) - (fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2) - have coordinates : ∀ j, M.niceRefinementIndexCoordinateGraphs a s b d level T1 T2 valid1 valid2 g j ∈ M.sets := - Fin.cases identity (Fin.cases nodes (Fin.cases nodes (Fin.cases first - (Fin.cases second (Fin.cases second (fun j => Fin.elim0 j)))))) - have whole := M.tupleRelationProduct_mem pairing unions powers separation 5 _ coordinates - exact M.separation_mem separation (.mem 0 1) (extend _ Fin.elim0) - (Fin.cases whole (fun j => Fin.elim0 j)) - (M.prod_mem pairing unions powers separation indexGround indexGround) - -theorem niceRefinementIndexActionGraph_entry (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) - (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) - (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) - (g : G) (C E : L) (U Rf Rc : (M.nameDomain s).names) - (source : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid1) (y : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) y ∈ - M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g ↔ - y = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by - have input := ((M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order level T1 T2 valid1 familyGround C E U Rf Rc).1 source) - have hU := M.niceNameCandidates_subset a s T1 _ input.2.1 - have hf := M.niceNameCandidates_subset a s T2 _ input.2.2.1 - have hc := M.niceNameCandidates_subset a s T2 _ input.2.2.2.1 - have domainValid : ∀ z ∈ M.groundRelations T1 s.carrier, IsName s z := - fun z hz => Name.isName_of_subset valid1 ((M.mem_groundRelations T1 s.carrier z).1 hz).2 - have relationValid : ∀ z ∈ M.groundRelations T2 s.carrier, IsName s z := - fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2 - constructor - · intro entry - have target := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 entry).1).2 - obtain ⟨C', E', U', Rf', Rc', rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 target - have coordinates := ((M.pair_mem_niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g - ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] - ![level, b.encode C', b.encode E', U'.val.val, Rf'.val.val, Rc'.val.val]).1 entry).2.2 - have nodeC := (b.pair_mem_graph b (d.iso g) C C').1 (coordinates 1) - have nodeE := (b.pair_mem_graph b (d.iso g) E E').1 (coordinates 2) - have domain := ((Name.pair_mem_renameFamilyGraph s (a.iso g) _ domainValid U.val U'.val.val).1 - (coordinates 3)).2 - have fine := ((Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rf.val Rf'.val.val).1 - (coordinates 4)).2 - have coarse := ((Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rc.val Rc'.val.val).1 - (coordinates 5)).2 - rw [← nodeC, ← nodeE, domain, fine, coarse] - rfl - · rintro rfl - apply (M.pair_mem_niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g - ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] - ![level, b.encode (d.iso g C), b.encode (d.iso g E), (a.act s g U.val).val, - (a.act s g Rf.val).val, (a.act s g Rc.val).val]).2 - refine ⟨source, (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps level T1 T2 valid1 closed1 closed2 familyGround g C E U Rf Rc).2 source, ?_⟩ - refine Fin.cases ((pair_mem_identityFunctionGraph {level} level level).2 - ⟨rfl, ZFSet.mem_singleton.2 rfl⟩) (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ - (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)))))) - · exact (b.pair_mem_graph b (d.iso g) C _).2 rfl - · exact (b.pair_mem_graph b (d.iso g) E _).2 rfl - · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) _ domainValid U.val _).2 ⟨hU, rfl⟩ - · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rf.val _).2 ⟨hf, rfl⟩ - · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rc.val _).2 ⟨hc, rfl⟩ - -theorem niceRefinementIndexActionGraph_function (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) - (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) - (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) (g : G) : - ZFSet.IsFunc (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hx - have meaning := M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround - g C E U Rf Rc hx - exact ⟨_, (meaning _).2 rfl, fun y hy => (meaning y).1 hy⟩ - -end - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T1 T2 : ZFSet.{u}) -variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) -local notation "I" => M.niceRefinementIndices a s b d level T1 T2 valid1 -local notation "graph" => M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 -include pairing unions powers separation collection carrier order maps closed1 closed2 familyGround - -private theorem inverse_edge (g : G) {x y : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ graph g) : ZFSet.pair y x ∈ graph g⁻¹ := by - have shape := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 entry).1 - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 shape.1 - have equal := (M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround - g C E U Rf Rc shape.1 y).1 entry - subst y - let move (w : (M.nameDomain s).names) : (M.nameDomain s).names := - ⟨a.act s g w.val, M.act_mem s a t pairing unions powers separation collection carrier maps g w.val w.property⟩ - apply (M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround - g⁻¹ (d.iso g C) (d.iso g E) (move U) (move Rf) (move Rc) shape.2 _).2 - change refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val = - refinementIndexCode level (b.encode (d.iso g⁻¹ (d.iso g C))) (b.encode (d.iso g⁻¹ (d.iso g E))) - (a.act s g⁻¹ (a.act s g U.val)).val (a.act s g⁻¹ (a.act s g Rf.val)).val - (a.act s g⁻¹ (a.act s g Rc.val)).val - rw [a.act_inv_left, a.act_inv_left, a.act_inv_left, ← d.mul, ← d.mul, inv_mul_cancel, - d.one, d.one] - -theorem niceRefinementIndexActionGraph_inverse_iff (g : G) (x y : ZFSet.{u}) : - ZFSet.pair x y ∈ graph g ↔ ZFSet.pair y x ∈ graph g⁻¹ := by - constructor - · exact M.inverse_edge a s b d level T1 T2 valid1 valid2 t pairing unions powers separation - collection carrier order maps closed1 closed2 familyGround g - · intro entry - simpa only [inv_inv] using M.inverse_edge a s b d level T1 T2 valid1 valid2 t pairing unions powers separation - collection carrier order maps closed1 closed2 familyGround g⁻¹ entry - -theorem niceRefinementIndexActionGraph_injection (g : G) : InjectionCode I I (graph g) := by - refine ⟨M.niceRefinementIndexActionGraph_function a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g, ?_⟩ - intro x y z first second - have back := M.niceRefinementIndexActionGraph_function a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g⁻¹ - have zx := (M.niceRefinementIndexActionGraph_inverse_iff a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g x z).1 first - have zy := (M.niceRefinementIndexActionGraph_inverse_iff a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g y z).1 second - obtain ⟨v, _, unique⟩ := back.2 z (ZFSet.pair_mem_prod.1 (back.1 zx)).1 - exact (unique x zx).trans (unique y zy).symm - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TupleRelationProducts +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) + +include pairing unions powers separation collection carrier order maps in +theorem niceRefinementIndex_act_iff (level T1 T2 : ZFSet.{u}) + (valid : ∀ z ∈ T1, IsName s z) + (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) + (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) + (familyGround : (Name.familySet ⊤ T1 valid).val ∈ M.sets) + (g : G) (C E : L) (U Rf Rc : (M.nameDomain s).names) : + refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid ↔ + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid := by + let groundClosed := fun g (w : Name s) (hw : w ∈ (M.nameDomain s).names) => + M.act_mem s a t pairing unions powers separation collection carrier maps g w hw + let moved := a.domainEquiv s (M.nameDomain s) groundClosed g + let whole : (M.nameDomain s).names := ⟨Name.familySet ⊤ T1 valid, familyGround⟩ + let env := extend U (extend Rf (extend Rc (extend whole Fin.elim0))) + have sameWhole : moved whole = whole := + Subtype.ext (Name.act_familySet a T1 valid closed1 g) + have envEq : a.actAssignment s (M.nameDomain s) groundClosed g env = + extend (moved U) (extend (moved Rf) (extend (moved Rc) (extend whole Fin.elim0))) := by + funext j + refine Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases ?_ + (fun k => Fin.elim0 k)))) j + exact sameWhole + have force := a.formula_forces_act_iff s (M.nameDomain s) groundClosed g + BoundedFormula.refinementValidityFormula.toFormula env ⊤ + rw [(a.iso g).map_top, envEq] at force + change refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (moved U).val.val (moved Rf).val.val (moved Rc).val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid ↔ _ + rw [M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order level T1 T2 valid familyGround (d.iso g C) (d.iso g E) + (moved U) (moved Rf) (moved Rc), + M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order level T1 T2 valid familyGround C E U Rf Rc] + exact and_congr (d.iso g).lt_iff_lt + (and_congr (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation + collection carrier maps closed1 d g C U.val) + (and_congr (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation + collection carrier maps closed2 d g C Rf.val) + (and_congr (M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation + collection carrier maps closed2 d g C Rc.val) force))) + +omit [OrderTop P] in +theorem niceRefinementIndex_fixed (level T1 T2 : ZFSet.{u}) (C E : L) + (U Rf Rc : Name s) (lower : C ≤ E) + (domain : U.val ∈ M.niceNameCandidates a s T1 (d.principalFix C)) + (fine : Rf.val ∈ M.niceNameCandidates a s T2 (d.principalFix C)) + (coarse : Rc.val ∈ M.niceNameCandidates a s T2 (d.principalFix C)) + (g : G) (fixed : g ∈ d.principalFix E) : + refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val = + refinementIndexCode level (b.encode C) (b.encode E) U.val Rf.val Rc.val := by + have atC : g ∈ d.principalFix C := d.principalFix_antitone lower fixed + have getSupport {X : ZFSet.{u}} (w : Name s) + (member : w.val ∈ M.niceNameCandidates a s X (d.principalFix C)) : + a.act s g w = w := by + have code := ((M.mem_niceNameCandidates a s X (d.principalFix C) w.val).1 member).2 + obtain ⟨σ, equal, _, support⟩ := code + have same : σ = w := Subtype.ext equal + subst σ + exact support atC + rw [fixed C lower, fixed E le_rfl, getSupport U domain, getSupport Rf fine, getSupport Rc coarse] + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} +variable [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + +noncomputable def stageOneNameAction (g : G) : (M.nameDomain s).names ≃ (M.nameDomain s).names := + a.domainEquiv s (M.nameDomain s) + (fun g w hw => M.act_mem s a t pairing unions powers separation collection carrier maps g w hw) g + +theorem stageOneNameAction_val (g : G) (w : (M.nameDomain s).names) : + (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g w).val = + a.act s g w.val := rfl + +theorem stageOneNameAction_one (w : (M.nameDomain s).names) : + M.stageOneNameAction a s t pairing unions powers separation collection carrier maps 1 w = w := + Subtype.ext (a.act_one s w.val) + +theorem stageOneNameAction_mul (g h : G) (w : (M.nameDomain s).names) : + M.stageOneNameAction a s t pairing unions powers separation collection carrier maps (g * h) w = + M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g + (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps h w) := + Subtype.ext (a.act_mul s g h w.val) + +theorem stageOneNameAction_forces_iff (g : G) {n : Nat} (φ : SetFormula n) + (env : Assignment (M.nameDomain s) n) (p : P) : + Forces (M.nameDomain s) φ + (fun j => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g (env j)) + (a.iso g p) ↔ Forces (M.nameDomain s) φ env p := + a.formula_forces_act_iff s (M.nameDomain s) + (fun g w hw => M.act_mem s a t pairing unions powers separation collection carrier maps g w hw) + g φ env p + +variable [OrderTop P] (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + +include closed in +theorem stageOneNameAction_class (g : G) (R w : (M.nameDomain s).names) : + M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g + (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w) = + M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g R) + (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g w) := + Subtype.ext (Name.act_refinementClass a T valid closed g R.val w.val) + +include closed in +theorem stageOneNameAction_map (g : G) (U Rf Rc : (M.nameDomain s).names) : + M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g + (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc) = + M.stageOneMapName s pairing unions powers separation collection carrier order hT valid + (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g U) + (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g Rf) + (M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g Rc) := + Subtype.ext (Name.act_refinementNaturalMap a T valid closed g U.val Rf.val Rc.val) + +variable {L : Type u} [PartialOrder L] +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +theorem stageOneNameAction_visibility (system : NiceNameSystem M a s b d base directed T valid) + (g : G) (v : L) : + M.stageOneNameAction a s t pairing unions powers separation collection carrier maps g + (M.stageOneVisibilityName s valid a b d base directed system v) = + M.stageOneVisibilityName s valid a b d base directed system (d.iso g v) := + Subtype.ext (system.visibility_action g v) + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps +local notation "cls" => M.stageOneClassName s pairing unions powers separation collection carrier order hT valid +local notation "vis" => M.stageOneVisibilityName s valid a b d base directed system +local notation "mapName" => M.stageOneMapName s pairing unions powers separation collection carrier order hT valid + +omit [OrderTop P] in +theorem stageOneActivity_act_iff (g : G) (U u w : (M.nameDomain s).names) (p : P) : + Forces (M.nameDomain s) refinementActivityFormula ![move g u, move g w, move g U] (a.iso g p) ↔ + Forces (M.nameDomain s) refinementActivityFormula ![u, w, U] p := by + have envEq : (fun j => move g (![u, w, U] j)) = + ![move g u, move g w, move g U] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j + have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection + carrier maps g refinementActivityFormula ![u, w, U] p + rw [envEq] at law + exact law + +include closed in +theorem stageOneProfile_act_iff (g : G) (Rc Rf u w : (M.nameDomain s).names) (v : L) (p : P) : + Forces (M.nameDomain s) refinementProfileFormula ![cls (move g Rc) (move g u), cls (move g Rf) (move g w), vis (d.iso g v)] (a.iso g p) ↔ + Forces (M.nameDomain s) refinementProfileFormula ![cls Rc u, cls Rf w, vis v] p := by + have envEq : (fun j => move g (![cls Rc u, cls Rf w, vis v] j)) = + ![cls (move g Rc) (move g u), cls (move g Rf) (move g w), vis (d.iso g v)] := by + funext j + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun k => Fin.elim0 k))) j + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + · exact M.stageOneNameAction_visibility a s t pairing unions powers separation collection carrier maps valid b d base directed system g _ + have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection + carrier maps g refinementProfileFormula ![cls Rc u, cls Rf w, vis v] p + rw [envEq] at law + exact law + +include closed in +theorem stageOneCompatibility_act_iff (g : G) (U Rf Rc u w : (M.nameDomain s).names) (C : L) (p : P) : + Forces (M.nameDomain s) refinementCompatibilityFormula ![cls (move g Rf) (move g w), vis (d.iso g C), cls (move g Rc) (move g u), mapName (move g U) (move g Rf) (move g Rc)] (a.iso g p) ↔ + Forces (M.nameDomain s) refinementCompatibilityFormula ![cls Rf w, vis C, cls Rc u, mapName U Rf Rc] p := by + have envEq : (fun j => move g (![cls Rf w, vis C, cls Rc u, mapName U Rf Rc] j)) = + ![cls (move g Rf) (move g w), vis (d.iso g C), cls (move g Rc) (move g u), mapName (move g U) (move g Rf) (move g Rc)] := by + funext j + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun k => Fin.elim0 k)))) j + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + · exact M.stageOneNameAction_visibility a s t pairing unions powers separation collection carrier maps valid b d base directed system g _ + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + · exact M.stageOneNameAction_map a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ _ + have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection + carrier maps g refinementCompatibilityFormula ![cls Rf w, vis C, cls Rc u, mapName U Rf Rc] p + rw [envEq] at law + exact law + +include closed in +theorem stageOneCollisionTest_act_iff (g : G) (Rf Rc u u' w w' : (M.nameDomain s).names) (p : P) : + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (move g Rf) (move g Rc) (move g u) (move g u') (move g w) (move g w') (a.iso g p) ↔ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid Rf Rc u u' w w' p := by + change Forces (M.nameDomain s) refinementCollisionFormula ![cls (move g Rc) (move g u), cls (move g Rc) (move g u'), cls (move g Rf) (move g w), cls (move g Rf) (move g w')] (a.iso g p) ↔ + Forces (M.nameDomain s) refinementCollisionFormula ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] p + have envEq : (fun j => move g (![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] j)) = + ![cls (move g Rc) (move g u), cls (move g Rc) (move g u'), cls (move g Rf) (move g w), cls (move g Rf) (move g w')] := by + funext j + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun k => Fin.elim0 k)))) j + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + · exact M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps order hT valid closed g _ _ + have law := M.stageOneNameAction_forces_iff a s t pairing unions powers separation collection + carrier maps g refinementCollisionFormula ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] p + rw [envEq] at law + exact law + +include closed in +theorem stageOneSingleTests_act_iff (g : G) (C E : L) + (U Rf Rc u w : (M.nameDomain s).names) (p : P) : + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (d.iso g C) (d.iso g E) + (move g U) (move g Rf) (move g Rc) (move g u) (move g w) (a.iso g p) ↔ + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p := by + have activity := M.stageOneActivity_act_iff a s t pairing unions powers separation collection + carrier maps g U u w p + have compatible := M.stageOneCompatibility_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed b d base directed system g U Rf Rc u w C p + have profile := fun v => M.stageOneProfile_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed b d base directed system g Rc Rf u w v p + constructor + · intro tests + refine ⟨activity.mp tests.1, ?_, compatible.mp tests.2.2⟩ + intro v above + exact (profile v).mp (tests.2.1 (d.iso g v) ((d.iso g).monotone above)) + · intro tests + refine ⟨activity.mpr tests.1, ?_, compatible.mpr tests.2.2⟩ + intro v above + obtain ⟨v, rfl⟩ := (d.iso g).surjective v + exact (profile v).mpr (tests.2.1 v ((d.iso g).le_iff_le.mp above)) + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T1 T2 : ZFSet.{u}) +variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) + +noncomputable def niceRefinementIndexCoordinateGraphs (g : G) : Fin 6 → ZFSet.{u} := + ![identityFunctionGraph {level}, b.graph b (d.iso g), b.graph b (d.iso g), + Name.renameFamilyGraph s (a.iso g) (M.groundRelations T1 s.carrier) + (fun z hz => Name.isName_of_subset valid1 ((M.mem_groundRelations T1 s.carrier z).1 hz).2), + Name.renameFamilyGraph s (a.iso g) (M.groundRelations T2 s.carrier) + (fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2), + Name.renameFamilyGraph s (a.iso g) (M.groundRelations T2 s.carrier) + (fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2)] + +noncomputable def niceRefinementIndexActionGraph (g : G) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ tupleRelationProduct 5 + (M.niceRefinementIndexCoordinateGraphs a s b d level T1 T2 valid1 valid2 g)) + (ZFSet.prod (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndices a s b d level T1 T2 valid1)) + +theorem pair_mem_niceRefinementIndexActionGraph (g : G) (x y : Fin 6 → ZFSet.{u}) : + ZFSet.pair (nonemptyTupleCode 5 x) (nonemptyTupleCode 5 y) ∈ + M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g ↔ + nonemptyTupleCode 5 x ∈ M.niceRefinementIndices a s b d level T1 T2 valid1 ∧ + nonemptyTupleCode 5 y ∈ M.niceRefinementIndices a s b d level T1 T2 valid1 ∧ + ∀ j, ZFSet.pair (x j) (y j) ∈ + M.niceRefinementIndexCoordinateGraphs a s b d level T1 T2 valid1 valid2 g j := by + rw [niceRefinementIndexActionGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod, + pair_mem_tupleRelationProduct] + exact and_assoc + +theorem niceRefinementIndexActionGraph_mem (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) + (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) + (g : G) : M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g ∈ M.sets := by + have identity := M.identityFunctionGraph_mem pairing unions powers separation + (show ({level} : ZFSet.{u}) ∈ M.sets from by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hl hl) + have nodes := M.conditionMap_graph_mem d b t nodeMaps g + have condition := M.conditionMap_graph_mem a s t maps g + have first := M.renameFamilyGraph_mem s s pairing unions powers separation collection + carrier carrier (a.iso g) condition (M.groundRelations T1 s.carrier) + (M.groundRelations_mem pairing unions powers separation hT1 carrier) + (fun z hz => Name.isName_of_subset valid1 ((M.mem_groundRelations T1 s.carrier z).1 hz).2) + have second := M.renameFamilyGraph_mem s s pairing unions powers separation collection + carrier carrier (a.iso g) condition (M.groundRelations T2 s.carrier) + (M.groundRelations_mem pairing unions powers separation hT2 carrier) + (fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2) + have coordinates : ∀ j, M.niceRefinementIndexCoordinateGraphs a s b d level T1 T2 valid1 valid2 g j ∈ M.sets := + Fin.cases identity (Fin.cases nodes (Fin.cases nodes (Fin.cases first + (Fin.cases second (Fin.cases second (fun j => Fin.elim0 j)))))) + have whole := M.tupleRelationProduct_mem pairing unions powers separation 5 _ coordinates + exact M.separation_mem separation (.mem 0 1) (extend _ Fin.elim0) + (Fin.cases whole (fun j => Fin.elim0 j)) + (M.prod_mem pairing unions powers separation indexGround indexGround) + +theorem niceRefinementIndexActionGraph_entry (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) + (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) + (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) + (g : G) (C E : L) (U Rf Rc : (M.nameDomain s).names) + (source : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid1) (y : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) y ∈ + M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g ↔ + y = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by + have input := ((M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order level T1 T2 valid1 familyGround C E U Rf Rc).1 source) + have hU := M.niceNameCandidates_subset a s T1 _ input.2.1 + have hf := M.niceNameCandidates_subset a s T2 _ input.2.2.1 + have hc := M.niceNameCandidates_subset a s T2 _ input.2.2.2.1 + have domainValid : ∀ z ∈ M.groundRelations T1 s.carrier, IsName s z := + fun z hz => Name.isName_of_subset valid1 ((M.mem_groundRelations T1 s.carrier z).1 hz).2 + have relationValid : ∀ z ∈ M.groundRelations T2 s.carrier, IsName s z := + fun z hz => Name.isName_of_subset valid2 ((M.mem_groundRelations T2 s.carrier z).1 hz).2 + constructor + · intro entry + have target := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 entry).1).2 + obtain ⟨C', E', U', Rf', Rc', rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 target + have coordinates := ((M.pair_mem_niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g + ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] + ![level, b.encode C', b.encode E', U'.val.val, Rf'.val.val, Rc'.val.val]).1 entry).2.2 + have nodeC := (b.pair_mem_graph b (d.iso g) C C').1 (coordinates 1) + have nodeE := (b.pair_mem_graph b (d.iso g) E E').1 (coordinates 2) + have domain := ((Name.pair_mem_renameFamilyGraph s (a.iso g) _ domainValid U.val U'.val.val).1 + (coordinates 3)).2 + have fine := ((Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rf.val Rf'.val.val).1 + (coordinates 4)).2 + have coarse := ((Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rc.val Rc'.val.val).1 + (coordinates 5)).2 + rw [← nodeC, ← nodeE, domain, fine, coarse] + rfl + · rintro rfl + apply (M.pair_mem_niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g + ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] + ![level, b.encode (d.iso g C), b.encode (d.iso g E), (a.act s g U.val).val, + (a.act s g Rf.val).val, (a.act s g Rc.val).val]).2 + refine ⟨source, (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps level T1 T2 valid1 closed1 closed2 familyGround g C E U Rf Rc).2 source, ?_⟩ + refine Fin.cases ((pair_mem_identityFunctionGraph {level} level level).2 + ⟨rfl, ZFSet.mem_singleton.2 rfl⟩) (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ + (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)))))) + · exact (b.pair_mem_graph b (d.iso g) C _).2 rfl + · exact (b.pair_mem_graph b (d.iso g) E _).2 rfl + · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) _ domainValid U.val _).2 ⟨hU, rfl⟩ + · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rf.val _).2 ⟨hf, rfl⟩ + · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) _ relationValid Rc.val _).2 ⟨hc, rfl⟩ + +theorem niceRefinementIndexActionGraph_function (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) + (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) + (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) (g : G) : + ZFSet.IsFunc (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hx + have meaning := M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround + g C E U Rf Rc hx + exact ⟨_, (meaning _).2 rfl, fun y hy => (meaning y).1 hy⟩ + +end + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T1 T2 : ZFSet.{u}) +variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) +local notation "I" => M.niceRefinementIndices a s b d level T1 T2 valid1 +local notation "graph" => M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 +include pairing unions powers separation collection carrier order maps closed1 closed2 familyGround + +private theorem inverse_edge (g : G) {x y : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ graph g) : ZFSet.pair y x ∈ graph g⁻¹ := by + have shape := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 entry).1 + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 shape.1 + have equal := (M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround + g C E U Rf Rc shape.1 y).1 entry + subst y + let move (w : (M.nameDomain s).names) : (M.nameDomain s).names := + ⟨a.act s g w.val, M.act_mem s a t pairing unions powers separation collection carrier maps g w.val w.property⟩ + apply (M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround + g⁻¹ (d.iso g C) (d.iso g E) (move U) (move Rf) (move Rc) shape.2 _).2 + change refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val = + refinementIndexCode level (b.encode (d.iso g⁻¹ (d.iso g C))) (b.encode (d.iso g⁻¹ (d.iso g E))) + (a.act s g⁻¹ (a.act s g U.val)).val (a.act s g⁻¹ (a.act s g Rf.val)).val + (a.act s g⁻¹ (a.act s g Rc.val)).val + rw [a.act_inv_left, a.act_inv_left, a.act_inv_left, ← d.mul, ← d.mul, inv_mul_cancel, + d.one, d.one] + +theorem niceRefinementIndexActionGraph_inverse_iff (g : G) (x y : ZFSet.{u}) : + ZFSet.pair x y ∈ graph g ↔ ZFSet.pair y x ∈ graph g⁻¹ := by + constructor + · exact M.inverse_edge a s b d level T1 T2 valid1 valid2 t pairing unions powers separation + collection carrier order maps closed1 closed2 familyGround g + · intro entry + simpa only [inv_inv] using M.inverse_edge a s b d level T1 T2 valid1 valid2 t pairing unions powers separation + collection carrier order maps closed1 closed2 familyGround g⁻¹ entry + +theorem niceRefinementIndexActionGraph_injection (g : G) : InjectionCode I I (graph g) := by + refine ⟨M.niceRefinementIndexActionGraph_function a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g, ?_⟩ + intro x y z first second + have back := M.niceRefinementIndexActionGraph_function a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g⁻¹ + have zx := (M.niceRefinementIndexActionGraph_inverse_iff a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g x z).1 first + have zy := (M.niceRefinementIndexActionGraph_inverse_iff a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g y z).1 second + obtain ⟨v, _, unique⟩ := back.2 z (ZFSet.pair_mem_prod.1 (back.1 zx)).1 + exact (unique x zx).trans (unique y zy).symm + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceSupportEvaluation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceSupportEvaluation.lean index 9e8797075e5db5c815b0abfdfbc432858124698f..4e5ec2d3ccb12a9df9222adeb4be65e3d30ae1ca 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceSupportEvaluation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundNiceSupportEvaluation.lean @@ -1,67 +1,67 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPrincipalNiceSupportCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) -variable (T : ZFSet.{u}) (K : I → Subgroup G) - -private theorem codeFunction (N : ZFSet.{u}) : FunctionGraphOn N (identityFunctionGraph N) := - ⟨N, (identityFunctionGraph_injection N).function⟩ - -private theorem codeValue (N : ZFSet.{u}) (i : N.toSet) : - (codeFunction N).value i = i.val := - (codeFunction N).value_eq_of_entry i - ((pair_mem_identityFunctionGraph N i.val i.val).2 ⟨rfl, i.property⟩) - -private theorem codeIsName (i : (M.niceSupportNameCodes a s T K).toSet) : - IsName s ((codeFunction (M.niceSupportNameCodes a s T K)).value i) := by - rw [codeValue] - exact M.niceSupportNameCodes_valid a s T K i.val i.property - -variable [OrderTop P] - -noncomputable def niceSupportEvaluationName : Name s := - Name.indexedGraphName ⊤ (codeFunction (M.niceSupportNameCodes a s T K)) - (codeIsName M a s T K) - -theorem niceSupportEvaluationName_entry (tau : Name s) - (member : tau.val ∈ M.niceSupportNameCodes a s T K) - (H : ConditionFilter P) (x : ZFSet.{u}) : - ZFSet.pair tau.val x ∈ Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K) ↔ - Name.eval {p | H.mem p} tau = x := by - let i : (M.niceSupportNameCodes a s T K).toSet := ⟨tau.val, member⟩ - have same : (⟨(codeFunction (M.niceSupportNameCodes a s T K)).value i, - codeIsName M a s T K i⟩ : Name s) = tau := Subtype.ext (codeValue _ i) - exact (Name.pair_mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem - (codeFunction (M.niceSupportNameCodes a s T K)) (codeIsName M a s T K) i x).trans - (by rw [same]) - -theorem niceSupportEvaluationName_mem (t : Presentation G) (b : Presentation I) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) : - (M.niceSupportEvaluationName a s T K).val ∈ M.sets := by - have hN := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation - collection carrier group nodes supports maps hT valid - exact M.indexedGraphName_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) hN - (M.identityFunctionGraph_mem pairing unions powers separation hN) - (codeFunction (M.niceSupportNameCodes a s T K)) (codeIsName M a s T K) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPrincipalNiceSupportCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) +variable (T : ZFSet.{u}) (K : I → Subgroup G) + +private theorem codeFunction (N : ZFSet.{u}) : FunctionGraphOn N (identityFunctionGraph N) := + ⟨N, (identityFunctionGraph_injection N).function⟩ + +private theorem codeValue (N : ZFSet.{u}) (i : N.toSet) : + (codeFunction N).value i = i.val := + (codeFunction N).value_eq_of_entry i + ((pair_mem_identityFunctionGraph N i.val i.val).2 ⟨rfl, i.property⟩) + +private theorem codeIsName (i : (M.niceSupportNameCodes a s T K).toSet) : + IsName s ((codeFunction (M.niceSupportNameCodes a s T K)).value i) := by + rw [codeValue] + exact M.niceSupportNameCodes_valid a s T K i.val i.property + +variable [OrderTop P] + +noncomputable def niceSupportEvaluationName : Name s := + Name.indexedGraphName ⊤ (codeFunction (M.niceSupportNameCodes a s T K)) + (codeIsName M a s T K) + +theorem niceSupportEvaluationName_entry (tau : Name s) + (member : tau.val ∈ M.niceSupportNameCodes a s T K) + (H : ConditionFilter P) (x : ZFSet.{u}) : + ZFSet.pair tau.val x ∈ Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K) ↔ + Name.eval {p | H.mem p} tau = x := by + let i : (M.niceSupportNameCodes a s T K).toSet := ⟨tau.val, member⟩ + have same : (⟨(codeFunction (M.niceSupportNameCodes a s T K)).value i, + codeIsName M a s T K i⟩ : Name s) = tau := Subtype.ext (codeValue _ i) + exact (Name.pair_mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem + (codeFunction (M.niceSupportNameCodes a s T K)) (codeIsName M a s T K) i x).trans + (by rw [same]) + +theorem niceSupportEvaluationName_mem (t : Presentation G) (b : Presentation I) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) : + (M.niceSupportEvaluationName a s T K).val ∈ M.sets := by + have hN := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation + collection carrier group nodes supports maps hT valid + exact M.indexedGraphName_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) hN + (M.identityFunctionGraph_mem pairing unions powers separation hN) + (codeFunction (M.niceSupportNameCodes a s T K)) (codeIsName M a s T K) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryEqualityDecisionFusion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryEqualityDecisionFusion.lean index ff6739bec7102115323449b04f85f05e8bd5bc01..8c216f5429d00ad3d366c38dc36c9ae7e57ff651 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryEqualityDecisionFusion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryEqualityDecisionFusion.lean @@ -1,138 +1,138 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def definable_ordinaryEqualityDecisions (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => - M.ordinaryEqualityDecisions (env 1) (env 2) (env 0) (env 3)) := by - let defined := (M.definable_separation separation - (ordinaryEqualityDecisionFormula 1 2 0 3 4)).reindex (![1, 1, 2, 0, 3] : Fin 5 → Fin 4) - refine defined.congr ?_ - intro env - apply congrArg (fun params : Fin 4 → ZFSet.{u} => - ZFSet.sep (fun z => Realize M.sets (ordinaryEqualityDecisionFormula 1 2 0 3 4) - (extend z params)) (env 1)) - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)))) j - -theorem ordinaryEqualityDecisions_mem (separation : SeparationSchema M.sets) - {Q order sigma tau : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) - (hSigma : sigma ∈ M.sets) (hTau : tau ∈ M.sets) : - M.ordinaryEqualityDecisions Q order sigma tau ∈ M.sets := - (M.definable_ordinaryEqualityDecisions separation).closed ![sigma, Q, order, tau] - (Fin.cases hSigma (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i))))) - -noncomputable def ordinaryEqualityDecisionFamily (T Q order tau : ZFSet.{u}) : ZFSet.{u} := - familyCodeGraph (fun sigma : T => sigma.val) - (fun sigma => M.ordinaryEqualityDecisions Q order sigma.val tau) - -theorem pair_mem_ordinaryEqualityDecisionFamily (T Q order tau sigma D : ZFSet.{u}) : - ZFSet.pair sigma D ∈ M.ordinaryEqualityDecisionFamily T Q order tau ↔ - sigma ∈ T ∧ D = M.ordinaryEqualityDecisions Q order sigma tau := by - rw [ordinaryEqualityDecisionFamily, mem_familyCodeGraph] - constructor - · rintro ⟨x, equal⟩ - obtain ⟨hx, hd⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx ▸ x.property, hd.symm.trans (congrArg (fun y => M.ordinaryEqualityDecisions Q order y tau) hx)⟩ - · rintro ⟨member, rfl⟩ - exact ⟨⟨sigma, member⟩, rfl⟩ - -theorem ordinaryEqualityDecisionFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) - (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : - M.ordinaryEqualityDecisionFamily T Q order tau ∈ M.sets := - (M.definable_ordinaryEqualityDecisions separation).graph_mem pairing separation collection - ![Q, order, tau] (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i)))) hT - -theorem ordinaryEqualityDecisionFamily_function - (separation : SeparationSchema M.sets) - {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) - (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : - ZFSet.IsFunc T (M.groundPower Q) (M.ordinaryEqualityDecisionFamily T Q order tau) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨sigma, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨sigma.property, (M.mem_groundPower Q _).2 - ⟨M.ordinaryEqualityDecisions_mem separation hQ hOrder (M.transitive hT sigma.property) hTau, - M.ordinaryEqualityDecisions_subset Q order sigma.val tau⟩⟩ - · intro sigma hSigma - exact ⟨M.ordinaryEqualityDecisions Q order sigma tau, - (M.pair_mem_ordinaryEqualityDecisionFamily T Q order tau sigma _).2 ⟨hSigma, rfl⟩, - fun D entry => (M.pair_mem_ordinaryEqualityDecisionFamily T Q order tau sigma D).1 entry |>.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem ordinaryEqualityDecisions_simultaneous_dense - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (small : M.groundEmbeddable T ZFSet.omega) - (valid : ∀ sigma ∈ T, IsName s sigma) - (closed : InternallyCountablyClosed M s) (tau : (M.nameDomain s).names) (base : P) : - DenseBelow base {q | q ≤ base ∧ ∀ sigma : (M.nameDomain s).names, - sigma.val.val ∈ T → Name.ForcesEq q sigma.val tau.val ∨ - ∀ r, r ≤ q → ¬ Name.ForcesEq r sigma.val tau.val} := by - let f := M.ordinaryEqualityDecisionFamily T s.carrier s.conditionOrder tau.val.val - have hf : f ∈ M.sets := M.ordinaryEqualityDecisionFamily_mem - pairing separation collection hT carrier order tau.property - have function : ZFSet.IsFunc T (M.groundPower s.carrier) f := - M.ordinaryEqualityDecisionFamily_function separation hT carrier order tau.property - have persistent : ∀ z E, ZFSet.pair z E ∈ f → ∀ p q : P, - q ≤ p → s.encode p ∈ E → s.encode q ∈ E := by - intro z E ef p q qp member - obtain ⟨hz, rfl⟩ := (M.pair_mem_ordinaryEqualityDecisionFamily - T s.carrier s.conditionOrder tau.val.val z E).1 ef - let sigma : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ - have first := (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection - carrier order sigma tau p).1 member - apply (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection - carrier order sigma tau q).2 - rcases first with equal | negative - · exact Or.inl (Name.forcesEq_mono equal qp) - · exact Or.inr (fun r rq => negative r (rq.trans qp)) - have dense : ∀ z E, ZFSet.pair z E ∈ f → DenseBelow base {q | s.encode q ∈ E} := by - intro z E ef p _ - obtain ⟨hz, rfl⟩ := (M.pair_mem_ordinaryEqualityDecisionFamily - T s.carrier s.conditionOrder tau.val.val z E).1 ef - let sigma : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ - obtain ⟨raw, member, before⟩ := M.ordinaryEqualityDecisions_dense s pairing unions powers - separation collection carrier order sigma tau (s.encode p) (s.encode_mem p) - obtain ⟨q, rfl⟩ := (s.mem_carrier raw).1 - (M.ordinaryEqualityDecisions_subset s.carrier s.conditionOrder z tau.val.val member) - exact ⟨q, (s.pair_mem_conditionOrder q p).1 before, member⟩ - have common := M.internally_countableDenseFamily_denseBelow s pairing unions powers separation - infinite choice carrier order hT hf small function closed base persistent dense - intro p pb - obtain ⟨q, qp, qb, all⟩ := common p pb - refine ⟨q, qp, qb, ?_⟩ - intro sigma member - exact (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection - carrier order sigma tau q).1 (all sigma.val.val _ - ((M.pair_mem_ordinaryEqualityDecisionFamily T s.carrier s.conditionOrder tau.val.val - sigma.val.val _).2 ⟨member, rfl⟩)) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def definable_ordinaryEqualityDecisions (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => + M.ordinaryEqualityDecisions (env 1) (env 2) (env 0) (env 3)) := by + let defined := (M.definable_separation separation + (ordinaryEqualityDecisionFormula 1 2 0 3 4)).reindex (![1, 1, 2, 0, 3] : Fin 5 → Fin 4) + refine defined.congr ?_ + intro env + apply congrArg (fun params : Fin 4 → ZFSet.{u} => + ZFSet.sep (fun z => Realize M.sets (ordinaryEqualityDecisionFormula 1 2 0 3 4) + (extend z params)) (env 1)) + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)))) j + +theorem ordinaryEqualityDecisions_mem (separation : SeparationSchema M.sets) + {Q order sigma tau : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) + (hSigma : sigma ∈ M.sets) (hTau : tau ∈ M.sets) : + M.ordinaryEqualityDecisions Q order sigma tau ∈ M.sets := + (M.definable_ordinaryEqualityDecisions separation).closed ![sigma, Q, order, tau] + (Fin.cases hSigma (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i))))) + +noncomputable def ordinaryEqualityDecisionFamily (T Q order tau : ZFSet.{u}) : ZFSet.{u} := + familyCodeGraph (fun sigma : T => sigma.val) + (fun sigma => M.ordinaryEqualityDecisions Q order sigma.val tau) + +theorem pair_mem_ordinaryEqualityDecisionFamily (T Q order tau sigma D : ZFSet.{u}) : + ZFSet.pair sigma D ∈ M.ordinaryEqualityDecisionFamily T Q order tau ↔ + sigma ∈ T ∧ D = M.ordinaryEqualityDecisions Q order sigma tau := by + rw [ordinaryEqualityDecisionFamily, mem_familyCodeGraph] + constructor + · rintro ⟨x, equal⟩ + obtain ⟨hx, hd⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx ▸ x.property, hd.symm.trans (congrArg (fun y => M.ordinaryEqualityDecisions Q order y tau) hx)⟩ + · rintro ⟨member, rfl⟩ + exact ⟨⟨sigma, member⟩, rfl⟩ + +theorem ordinaryEqualityDecisionFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) + (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : + M.ordinaryEqualityDecisionFamily T Q order tau ∈ M.sets := + (M.definable_ordinaryEqualityDecisions separation).graph_mem pairing separation collection + ![Q, order, tau] (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i)))) hT + +theorem ordinaryEqualityDecisionFamily_function + (separation : SeparationSchema M.sets) + {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) + (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : + ZFSet.IsFunc T (M.groundPower Q) (M.ordinaryEqualityDecisionFamily T Q order tau) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨sigma, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨sigma.property, (M.mem_groundPower Q _).2 + ⟨M.ordinaryEqualityDecisions_mem separation hQ hOrder (M.transitive hT sigma.property) hTau, + M.ordinaryEqualityDecisions_subset Q order sigma.val tau⟩⟩ + · intro sigma hSigma + exact ⟨M.ordinaryEqualityDecisions Q order sigma tau, + (M.pair_mem_ordinaryEqualityDecisionFamily T Q order tau sigma _).2 ⟨hSigma, rfl⟩, + fun D entry => (M.pair_mem_ordinaryEqualityDecisionFamily T Q order tau sigma D).1 entry |>.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem ordinaryEqualityDecisions_simultaneous_dense + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (small : M.groundEmbeddable T ZFSet.omega) + (valid : ∀ sigma ∈ T, IsName s sigma) + (closed : InternallyCountablyClosed M s) (tau : (M.nameDomain s).names) (base : P) : + DenseBelow base {q | q ≤ base ∧ ∀ sigma : (M.nameDomain s).names, + sigma.val.val ∈ T → Name.ForcesEq q sigma.val tau.val ∨ + ∀ r, r ≤ q → ¬ Name.ForcesEq r sigma.val tau.val} := by + let f := M.ordinaryEqualityDecisionFamily T s.carrier s.conditionOrder tau.val.val + have hf : f ∈ M.sets := M.ordinaryEqualityDecisionFamily_mem + pairing separation collection hT carrier order tau.property + have function : ZFSet.IsFunc T (M.groundPower s.carrier) f := + M.ordinaryEqualityDecisionFamily_function separation hT carrier order tau.property + have persistent : ∀ z E, ZFSet.pair z E ∈ f → ∀ p q : P, + q ≤ p → s.encode p ∈ E → s.encode q ∈ E := by + intro z E ef p q qp member + obtain ⟨hz, rfl⟩ := (M.pair_mem_ordinaryEqualityDecisionFamily + T s.carrier s.conditionOrder tau.val.val z E).1 ef + let sigma : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ + have first := (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection + carrier order sigma tau p).1 member + apply (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection + carrier order sigma tau q).2 + rcases first with equal | negative + · exact Or.inl (Name.forcesEq_mono equal qp) + · exact Or.inr (fun r rq => negative r (rq.trans qp)) + have dense : ∀ z E, ZFSet.pair z E ∈ f → DenseBelow base {q | s.encode q ∈ E} := by + intro z E ef p _ + obtain ⟨hz, rfl⟩ := (M.pair_mem_ordinaryEqualityDecisionFamily + T s.carrier s.conditionOrder tau.val.val z E).1 ef + let sigma : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ + obtain ⟨raw, member, before⟩ := M.ordinaryEqualityDecisions_dense s pairing unions powers + separation collection carrier order sigma tau (s.encode p) (s.encode_mem p) + obtain ⟨q, rfl⟩ := (s.mem_carrier raw).1 + (M.ordinaryEqualityDecisions_subset s.carrier s.conditionOrder z tau.val.val member) + exact ⟨q, (s.pair_mem_conditionOrder q p).1 before, member⟩ + have common := M.internally_countableDenseFamily_denseBelow s pairing unions powers separation + infinite choice carrier order hT hf small function closed base persistent dense + intro p pb + obtain ⟨q, qp, qb, all⟩ := common p pb + refine ⟨q, qp, qb, ?_⟩ + intro sigma member + exact (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection + carrier order sigma tau q).1 (all sigma.val.val _ + ((M.pair_mem_ordinaryEqualityDecisionFamily T s.carrier s.conditionOrder tau.val.val + sigma.val.val _).2 ⟨member, rfl⟩)) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryMembershipAntichainFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryMembershipAntichainFamilies.lean index 83dd078526e5a5743d70ea2a1051359ce42ffb61..a176c49725e5832587d103bb63873fe4de571e85 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryMembershipAntichainFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOrdinaryMembershipAntichainFamilies.lean @@ -1,385 +1,385 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GreedyAntichainStepFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem antichainEligible_mem (separation : SeparationSchema M.sets) - {Q order D alpha prior : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) - (hD : D ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hPrior : prior ∈ M.sets) : - antichainEligible Q order D alpha prior ∈ M.sets := by - let formula : BoundedFormula 6 := .neg (BoundedFormula.antichainBlockedFormula 0 1 2 3 4 5) - let params := extend Q (extend order (extend D (extend alpha (extend prior Fin.elim0)))) - have ground := M.bounded_separation_mem separation formula params - (Fin.cases hQ (Fin.cases hOrder (Fin.cases hD - (Fin.cases hAlpha (Fin.cases hPrior (fun i => Fin.elim0 i)))))) hD - have equal : ZFSet.sep (fun q => BoundedFormula.Truth formula (extend q params)) D = - antichainEligible Q order D alpha prior := by - apply ZFSet.ext - intro q - simp only [ZFSet.mem_sep, antichainEligible, formula, BoundedFormula.Truth, - BoundedFormula.truth_antichainBlockedFormula] - rfl - exact equal ▸ ground - -theorem greedyAntichainStep_exists_unique (separation : SeparationSchema M.sets) - {Q order D c alpha prior : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) - (hD : D ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hPrior : prior ∈ M.sets) - (code : ChoiceFunctionCode (M.nonemptyGroundSubsets D) c) : - ∃ y ∈ M.sets, GreedyAntichainStep Q order D (M.nonemptyGroundSubsets D) c alpha prior y ∧ - ∀ z, GreedyAntichainStep Q order D (M.nonemptyGroundSubsets D) c alpha prior z → z = y := by - classical - let E := antichainEligible Q order D alpha prior - have hE := M.antichainEligible_mem separation hQ hOrder hD hAlpha hPrior - have subset : E ⊆ D := fun _ hq => (mem_antichainEligible _ _ _ _ _ _).1 hq |>.1 - by_cases nonempty : E.Nonempty - · have member := (M.mem_nonemptyGroundSubsets D E).2 ⟨hE, subset, nonempty⟩ - obtain ⟨y, entry, unique⟩ := code.function.2 E member - have hy := code.chosen E y entry - refine ⟨y, M.transitive hD (subset hy), Or.inl ⟨E, member, rfl, entry⟩, ?_⟩ - intro z step - rcases step with ⟨S, _, rfl, selected⟩ | ⟨empty, _⟩ - · exact unique z selected - · exact False.elim (empty nonempty) - · refine ⟨D, hD, Or.inr ⟨nonempty, rfl⟩, ?_⟩ - intro z step - rcases step with ⟨S, member, rfl, _⟩ | ⟨_, equal⟩ - · exact False.elim (nonempty ((M.mem_nonemptyGroundSubsets D _).1 member).2.2) - · exact equal - -theorem exists_greedyAntichainTrace - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {Q order D c C : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) - (hD : D ∈ M.sets) (hc : c ∈ M.sets) (hC : C ∈ M.sets) - (ordinal : ordinalSetProperty C) - (code : ChoiceFunctionCode (M.nonemptyGroundSubsets D) c) : - ∃ history ∈ M.sets, OrdinalRecursionTrace - (GreedyAntichainStep Q order D (M.nonemptyGroundSubsets D) c) C history := by - let F := M.nonemptyGroundSubsets D - have hF : F ∈ M.sets := M.nonemptyGroundSubsets_mem powers separation hD - let params := extend Q (extend order (extend D (extend F (extend c Fin.elim0)))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hQ (Fin.cases hOrder (Fin.cases hD - (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))))) - let formula : BoundedFormula 8 := BoundedFormula.greedyAntichainStepFormula 3 4 5 6 7 0 1 2 - have recognize (alpha prior y : ZFSet.{u}) (hAlpha : alpha ∈ M.sets) - (hPrior : prior ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets formula.toFormula (extend alpha (extend prior (extend y params))) ↔ - GreedyAntichainStep Q order D F c alpha prior y := - (BoundedFormula.realize_toFormula M formula _ - (Fin.cases hAlpha (Fin.cases hPrior (Fin.cases hy members)))).trans - (BoundedFormula.truth_greedyAntichainStepFormula 3 4 5 6 7 0 1 2 _) - have closure : GroundOrdinalStepClosure M C formula.toFormula params := by - intro alpha member prior hPrior _ - have hAlpha := M.transitive hC member - obtain ⟨y, hy, step, unique⟩ := - M.greedyAntichainStep_exists_unique separation hQ hOrder hD hAlpha hPrior code - exact ⟨y, hy, (recognize alpha prior y hAlpha hPrior hy).2 step, - fun z hz relation => unique z ((recognize alpha prior z hAlpha hPrior hz).1 relation)⟩ - obtain ⟨history, hHistory, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection - hC ordinal formula.toFormula params members closure - refine ⟨history, hHistory, trace.1, ?_⟩ - intro alpha member y entry - have step := trace.2 alpha member y entry - exact (recognize alpha _ y (M.transitive hC member) step.1 step.2.1).1 step.2.2 - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem greedyAntichainTrace_relativeMaximal {Q order D F c C f alpha : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) - (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) - (conditions : D ⊆ Q) (hAlpha : alpha ∈ C) - (exhausted : ¬ (antichainEligible Q order D alpha (graphRestriction alpha f)).Nonempty) : - RelativeMaximalAntichainCode Q order D (relationImage alpha D f) := by - classical - refine ⟨fun p hp => ((mem_relationImage alpha D f p).1 hp).1, - greedyAntichainTrace_antichain choice ordinal trace conditions - (fun beta hBeta => ordinal.1 alpha hAlpha beta hBeta), ?_⟩ - intro q hq - by_contra missing - apply exhausted - refine ⟨q, (mem_antichainEligible Q order D alpha (graphRestriction alpha f) q).2 - ⟨hq, ?_⟩⟩ - rintro ⟨beta, hBeta, p, hp, entry, r, hr, rq, rp⟩ - exact missing ⟨p, (mem_relationImage alpha D f p).2 - ⟨hp, beta, hBeta, (pair_mem_graphRestriction.1 entry).1⟩, r, hr, rq, rp⟩ - -theorem RelativeMaximalAntichainCode.predense {Q order D A : ZFSet.{u}} - (code : RelativeMaximalAntichainCode Q order D A) - (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) - (dense : ∀ q ∈ Q, ∃ d ∈ D, ZFSet.pair d q ∈ order) : - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order := by - intro q hq - obtain ⟨d, hd, dq⟩ := dense q hq - obtain ⟨p, hp, r, hr, rd, rp⟩ := code.2.2 d hd - exact ⟨p, hp, r, hr, orderCode.trans r hr d (conditions hd) q hq rd dq, rp⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundRelativeMaximalAntichain - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Q order D : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) (hD : D ∈ M.sets) - (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) : - ∃ A ∈ M.sets, RelativeMaximalAntichainCode Q order D A := by - let F := M.nonemptyGroundSubsets D - have hF := M.nonemptyGroundSubsets_mem powers separation hD - obtain ⟨c, hc, chooser⟩ := M.choice_witness choice hF - (fun E hE => ((M.mem_nonemptyGroundSubsets D E).1 hE).2.2) - obtain ⟨C, hC, ordinal, _, impossible⟩ := M.exists_groundHartogs - pairing unions powers separation collection hD - obtain ⟨f, hf, trace⟩ := M.exists_greedyAntichainTrace - pairing unions powers separation collection hQ hOrder hD hc hC ordinal chooser - obtain ⟨alpha, hAlpha, exhausted⟩ := greedyAntichainTrace_exhausts chooser ordinal trace - orderCode conditions (fun injection => impossible ⟨f, hf, injection⟩) - exact ⟨relationImage alpha D f, - M.relationImage_mem separation (M.transitive hC hAlpha) hD hf, - greedyAntichainTrace_relativeMaximal chooser ordinal trace conditions hAlpha exhausted⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def definable_ordinaryMembershipDecisions (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => - M.ordinaryMembershipDecisions (env 1) (env 2) (env 0) (env 3)) := by - let defined := (M.definable_separation separation - (ordinaryMembershipDecisionFormula 1 2 0 3 4)).reindex (![1, 1, 2, 0, 3] : Fin 5 → Fin 4) - refine defined.congr ?_ - intro env - apply congrArg (fun params : Fin 4 → ZFSet.{u} => - ZFSet.sep (fun z => Realize M.sets (ordinaryMembershipDecisionFormula 1 2 0 3 4) - (extend z params)) (env 1)) - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)))) j - -theorem ordinaryMembershipDecisions_mem (separation : SeparationSchema M.sets) - {Q order sigma tau : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) - (hSigma : sigma ∈ M.sets) (hTau : tau ∈ M.sets) : - M.ordinaryMembershipDecisions Q order sigma tau ∈ M.sets := - (M.definable_ordinaryMembershipDecisions separation).closed ![sigma, Q, order, tau] - (Fin.cases hSigma (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i))))) - -noncomputable def ordinaryMembershipDecisionFamily (T Q order tau : ZFSet.{u}) : ZFSet.{u} := - familyCodeGraph (fun sigma : T => sigma.val) - (fun sigma => M.ordinaryMembershipDecisions Q order sigma.val tau) - -theorem pair_mem_ordinaryMembershipDecisionFamily (T Q order tau sigma D : ZFSet.{u}) : - ZFSet.pair sigma D ∈ M.ordinaryMembershipDecisionFamily T Q order tau ↔ - sigma ∈ T ∧ D = M.ordinaryMembershipDecisions Q order sigma tau := by - rw [ordinaryMembershipDecisionFamily, mem_familyCodeGraph] - constructor - · rintro ⟨x, equal⟩ - obtain ⟨hx, hd⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx ▸ x.property, hd.symm.trans (congrArg (fun y => M.ordinaryMembershipDecisions Q order y tau) hx)⟩ - · rintro ⟨member, rfl⟩ - exact ⟨⟨sigma, member⟩, rfl⟩ - -theorem ordinaryMembershipDecisionFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) - (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : - M.ordinaryMembershipDecisionFamily T Q order tau ∈ M.sets := - (M.definable_ordinaryMembershipDecisions separation).graph_mem pairing separation collection - ![Q, order, tau] (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i)))) hT - -theorem ordinaryMembershipDecisionFamily_function - (separation : SeparationSchema M.sets) - {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) - (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : - ZFSet.IsFunc T (M.groundPower Q) (M.ordinaryMembershipDecisionFamily T Q order tau) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨sigma, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨sigma.property, (M.mem_groundPower Q _).2 - ⟨M.ordinaryMembershipDecisions_mem separation hQ hOrder (M.transitive hT sigma.property) hTau, - M.ordinaryMembershipDecisions_subset Q order sigma.val tau⟩⟩ - · intro sigma hSigma - exact ⟨M.ordinaryMembershipDecisions Q order sigma tau, - (M.pair_mem_ordinaryMembershipDecisionFamily T Q order tau sigma _).2 ⟨hSigma, rfl⟩, - fun D entry => (M.pair_mem_ordinaryMembershipDecisionFamily T Q order tau sigma D).1 entry |>.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem ordinaryMembershipDecisionFamily_dense - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ sigma ∈ T, IsName s sigma) - (tau : (M.nameDomain s).names) : - ∀ sigma D, ZFSet.pair sigma D ∈ - M.ordinaryMembershipDecisionFamily T s.carrier s.conditionOrder tau.val.val → - ∀ p ∈ s.carrier, ∃ q ∈ D, ZFSet.pair q p ∈ s.conditionOrder := by - intro sigma D entry - obtain ⟨member, rfl⟩ := (M.pair_mem_ordinaryMembershipDecisionFamily - T s.carrier s.conditionOrder tau.val.val sigma D).1 entry - let name : (M.nameDomain s).names := ⟨⟨sigma, valid sigma member⟩, M.transitive hT member⟩ - exact M.ordinaryMembershipDecisions_dense s pairing unions powers separation collection carrier order name tau - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_relativeMaximalAntichainFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Q order J domains : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) - (hJ : J ∈ M.sets) (hDomains : domains ∈ M.sets) - (orderCode : PartialOrderCode Q order) - (domainsCode : ZFSet.IsFunc J (M.groundPower Q) domains) : - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - ∀ j D A, ZFSet.pair j D ∈ domains → ZFSet.pair j A ∈ f → - RelativeMaximalAntichainCode Q order D A := by - let B := M.groundPower Q - let formula : SetFormula 5 := (BoundedFormula.relativeAntichainFamilyFormula 0 1 2 3 4).toFormula - let params := extend Q (extend order (extend domains Fin.elim0)) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hQ (Fin.cases hOrder (Fin.cases hDomains (fun i => Fin.elim0 i))) - have recognize (j A : ZFSet.{u}) (hj : j ∈ M.sets) (hA : A ∈ M.sets) : - Realize M.sets formula (extend j (extend A params)) ↔ - ∃ D, ZFSet.pair j D ∈ domains ∧ RelativeMaximalAntichainCode Q order D A := - (BoundedFormula.realize_toFormula M _ _ (Fin.cases hj (Fin.cases hA members))).trans - (BoundedFormula.truth_relativeAntichainFamilyFormula 0 1 2 3 4 _) - have hB : B ∈ M.sets := M.groundPower_mem powers hQ - let relation := M.definableRelation formula params J B - have ground : relation ∈ M.sets := M.definableRelation_mem - pairing unions powers separation formula params members hJ hB - have total : ∀ j ∈ J, ∃ A ∈ B, ZFSet.pair j A ∈ relation := by - intro j hj - obtain ⟨D, entry, _⟩ := domainsCode.2 j hj - have domain := (M.mem_groundPower Q D).1 (ZFSet.pair_mem_prod.1 (domainsCode.1 entry)).2 - obtain ⟨A, hA, code⟩ := M.exists_groundRelativeMaximalAntichain - pairing unions powers separation collection choice hQ hOrder domain.1 orderCode domain.2 - have inB : A ∈ B := (M.mem_groundPower Q A).2 ⟨hA, code.2.1.1⟩ - exact ⟨A, inB, (M.pair_mem_definableRelation formula params J B j A).2 - ⟨hj, inB, (recognize j A (M.transitive hJ hj) hA).2 ⟨D, entry, code⟩⟩⟩ - obtain ⟨f, hf, function, selected⟩ := M.uniformize_relation - pairing unions powers separation choice hJ hB ground total - refine ⟨f, hf, function, ?_⟩ - intro j D A domainEntry chosen - obtain ⟨hj, hA, holds⟩ := (M.pair_mem_definableRelation formula params J B j A).1 (selected chosen) - obtain ⟨D', entry, code⟩ := (recognize j A (M.transitive hJ hj) - ((M.mem_groundPower Q A).1 hA).1).1 holds - obtain ⟨value, _, unique⟩ := domainsCode.2 j hj - have equal : D' = D := (unique D' entry).trans (unique D domainEntry).symm - exact equal ▸ code - -theorem exists_smallRelativeAntichainFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Q order J domains K : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) - (hJ : J ∈ M.sets) (hDomains : domains ∈ M.sets) (hK : K ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) (orderCode : PartialOrderCode Q order) - (domainsCode : ZFSet.IsFunc J (M.groundPower Q) domains) - (smallJ : GroundBelow M J K) - (chain : ∀ A ∈ M.sets, OrderAntichainCode Q order A → GroundBelow M A K) : - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ j D A, ZFSet.pair j D ∈ domains → ZFSet.pair j A ∈ f → - RelativeMaximalAntichainCode Q order D A) ∧ - let U := ⋃₀ relationImage J (M.groundPower Q) f - U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q := by - obtain ⟨f, hf, function, selected⟩ := M.exists_relativeMaximalAntichainFamily - pairing unions powers separation collection choice hQ hOrder hJ hDomains orderCode domainsCode - have hPower := M.groundPower_mem powers hQ - have small : ∀ j A, ZFSet.pair j A ∈ f → GroundBelow M A K := by - intro j A entry - have pair := ZFSet.pair_mem_prod.1 (function.1 entry) - obtain ⟨D, domainEntry, _⟩ := domainsCode.2 j pair.1 - exact chain A ((M.mem_groundPower Q A).1 pair.2).1 - (selected j D A domainEntry entry).2.1 - refine ⟨f, hf, function, selected, - M.union_mem unions (M.relationImage_mem separation hJ hPower hf), - GroundBelow.indexed_sUnion pairing unions powers separation choice hJ hPower hf hK - conditions.1 conditions.2.2.1 conditions.2.2.2 smallJ function small, ?_⟩ - intro q member - obtain ⟨A, inRange, inA⟩ := ZFSet.mem_sUnion.1 member - have inPower := ((mem_relationImage J (M.groundPower Q) f A).1 inRange).1 - exact ((M.mem_groundPower Q A).1 inPower).2 inA - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) - -theorem exists_ordinaryMembershipAntichainFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {T K : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ sigma ∈ T, IsName s sigma) - (tau : (M.nameDomain s).names) (hK : K ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) (smallT : GroundBelow M T K) - (chain : ∀ A ∈ M.sets, OrderAntichainCode s.carrier s.conditionOrder A → GroundBelow M A K) : - ∃ f ∈ M.sets, ZFSet.IsFunc T (M.groundPower s.carrier) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode s.carrier s.conditionOrder - (M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma tau.val.val) A ∧ - ∀ q ∈ s.carrier, ∃ p ∈ A, ∃ r ∈ s.carrier, - ZFSet.pair r q ∈ s.conditionOrder ∧ ZFSet.pair r p ∈ s.conditionOrder) ∧ - let U := ⋃₀ relationImage T (M.groundPower s.carrier) f - U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ s.carrier := by - let domains := M.ordinaryMembershipDecisionFamily T s.carrier s.conditionOrder tau.val.val - have hDomains : domains ∈ M.sets := M.ordinaryMembershipDecisionFamily_mem - pairing separation collection hT carrier order tau.property - have domainsCode : ZFSet.IsFunc T (M.groundPower s.carrier) domains := - M.ordinaryMembershipDecisionFamily_function separation hT carrier order tau.property - obtain ⟨f, hf, function, selected, whole⟩ := M.exists_smallRelativeAntichainFamily - pairing unions powers separation collection choice carrier order hT hDomains hK conditions - s.conditionOrder_code domainsCode smallT chain - refine ⟨f, hf, function, ?_, whole⟩ - intro sigma A entry - have hSigma := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 - have domainEntry : ZFSet.pair sigma - (M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma tau.val.val) ∈ domains := - (M.pair_mem_ordinaryMembershipDecisionFamily T s.carrier s.conditionOrder tau.val.val sigma _).2 - ⟨hSigma, rfl⟩ - have code := selected sigma _ A domainEntry entry - exact ⟨code, code.predense s.conditionOrder_code - (M.ordinaryMembershipDecisions_subset s.carrier s.conditionOrder sigma tau.val.val) - (M.ordinaryMembershipDecisionFamily_dense s pairing unions powers separation collection carrier order - hT valid tau sigma _ domainEntry)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GreedyAntichainStepFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem antichainEligible_mem (separation : SeparationSchema M.sets) + {Q order D alpha prior : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) + (hD : D ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hPrior : prior ∈ M.sets) : + antichainEligible Q order D alpha prior ∈ M.sets := by + let formula : BoundedFormula 6 := .neg (BoundedFormula.antichainBlockedFormula 0 1 2 3 4 5) + let params := extend Q (extend order (extend D (extend alpha (extend prior Fin.elim0)))) + have ground := M.bounded_separation_mem separation formula params + (Fin.cases hQ (Fin.cases hOrder (Fin.cases hD + (Fin.cases hAlpha (Fin.cases hPrior (fun i => Fin.elim0 i)))))) hD + have equal : ZFSet.sep (fun q => BoundedFormula.Truth formula (extend q params)) D = + antichainEligible Q order D alpha prior := by + apply ZFSet.ext + intro q + simp only [ZFSet.mem_sep, antichainEligible, formula, BoundedFormula.Truth, + BoundedFormula.truth_antichainBlockedFormula] + rfl + exact equal ▸ ground + +theorem greedyAntichainStep_exists_unique (separation : SeparationSchema M.sets) + {Q order D c alpha prior : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) + (hD : D ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hPrior : prior ∈ M.sets) + (code : ChoiceFunctionCode (M.nonemptyGroundSubsets D) c) : + ∃ y ∈ M.sets, GreedyAntichainStep Q order D (M.nonemptyGroundSubsets D) c alpha prior y ∧ + ∀ z, GreedyAntichainStep Q order D (M.nonemptyGroundSubsets D) c alpha prior z → z = y := by + classical + let E := antichainEligible Q order D alpha prior + have hE := M.antichainEligible_mem separation hQ hOrder hD hAlpha hPrior + have subset : E ⊆ D := fun _ hq => (mem_antichainEligible _ _ _ _ _ _).1 hq |>.1 + by_cases nonempty : E.Nonempty + · have member := (M.mem_nonemptyGroundSubsets D E).2 ⟨hE, subset, nonempty⟩ + obtain ⟨y, entry, unique⟩ := code.function.2 E member + have hy := code.chosen E y entry + refine ⟨y, M.transitive hD (subset hy), Or.inl ⟨E, member, rfl, entry⟩, ?_⟩ + intro z step + rcases step with ⟨S, _, rfl, selected⟩ | ⟨empty, _⟩ + · exact unique z selected + · exact False.elim (empty nonempty) + · refine ⟨D, hD, Or.inr ⟨nonempty, rfl⟩, ?_⟩ + intro z step + rcases step with ⟨S, member, rfl, _⟩ | ⟨_, equal⟩ + · exact False.elim (nonempty ((M.mem_nonemptyGroundSubsets D _).1 member).2.2) + · exact equal + +theorem exists_greedyAntichainTrace + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {Q order D c C : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) + (hD : D ∈ M.sets) (hc : c ∈ M.sets) (hC : C ∈ M.sets) + (ordinal : ordinalSetProperty C) + (code : ChoiceFunctionCode (M.nonemptyGroundSubsets D) c) : + ∃ history ∈ M.sets, OrdinalRecursionTrace + (GreedyAntichainStep Q order D (M.nonemptyGroundSubsets D) c) C history := by + let F := M.nonemptyGroundSubsets D + have hF : F ∈ M.sets := M.nonemptyGroundSubsets_mem powers separation hD + let params := extend Q (extend order (extend D (extend F (extend c Fin.elim0)))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hQ (Fin.cases hOrder (Fin.cases hD + (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))))) + let formula : BoundedFormula 8 := BoundedFormula.greedyAntichainStepFormula 3 4 5 6 7 0 1 2 + have recognize (alpha prior y : ZFSet.{u}) (hAlpha : alpha ∈ M.sets) + (hPrior : prior ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets formula.toFormula (extend alpha (extend prior (extend y params))) ↔ + GreedyAntichainStep Q order D F c alpha prior y := + (BoundedFormula.realize_toFormula M formula _ + (Fin.cases hAlpha (Fin.cases hPrior (Fin.cases hy members)))).trans + (BoundedFormula.truth_greedyAntichainStepFormula 3 4 5 6 7 0 1 2 _) + have closure : GroundOrdinalStepClosure M C formula.toFormula params := by + intro alpha member prior hPrior _ + have hAlpha := M.transitive hC member + obtain ⟨y, hy, step, unique⟩ := + M.greedyAntichainStep_exists_unique separation hQ hOrder hD hAlpha hPrior code + exact ⟨y, hy, (recognize alpha prior y hAlpha hPrior hy).2 step, + fun z hz relation => unique z ((recognize alpha prior z hAlpha hPrior hz).1 relation)⟩ + obtain ⟨history, hHistory, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection + hC ordinal formula.toFormula params members closure + refine ⟨history, hHistory, trace.1, ?_⟩ + intro alpha member y entry + have step := trace.2 alpha member y entry + exact (recognize alpha _ y (M.transitive hC member) step.1 step.2.1).1 step.2.2 + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem greedyAntichainTrace_relativeMaximal {Q order D F c C f alpha : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty C) + (trace : OrdinalRecursionTrace (GreedyAntichainStep Q order D F c) C f) + (conditions : D ⊆ Q) (hAlpha : alpha ∈ C) + (exhausted : ¬ (antichainEligible Q order D alpha (graphRestriction alpha f)).Nonempty) : + RelativeMaximalAntichainCode Q order D (relationImage alpha D f) := by + classical + refine ⟨fun p hp => ((mem_relationImage alpha D f p).1 hp).1, + greedyAntichainTrace_antichain choice ordinal trace conditions + (fun beta hBeta => ordinal.1 alpha hAlpha beta hBeta), ?_⟩ + intro q hq + by_contra missing + apply exhausted + refine ⟨q, (mem_antichainEligible Q order D alpha (graphRestriction alpha f) q).2 + ⟨hq, ?_⟩⟩ + rintro ⟨beta, hBeta, p, hp, entry, r, hr, rq, rp⟩ + exact missing ⟨p, (mem_relationImage alpha D f p).2 + ⟨hp, beta, hBeta, (pair_mem_graphRestriction.1 entry).1⟩, r, hr, rq, rp⟩ + +theorem RelativeMaximalAntichainCode.predense {Q order D A : ZFSet.{u}} + (code : RelativeMaximalAntichainCode Q order D A) + (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) + (dense : ∀ q ∈ Q, ∃ d ∈ D, ZFSet.pair d q ∈ order) : + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ order ∧ ZFSet.pair r p ∈ order := by + intro q hq + obtain ⟨d, hd, dq⟩ := dense q hq + obtain ⟨p, hp, r, hr, rd, rp⟩ := code.2.2 d hd + exact ⟨p, hp, r, hr, orderCode.trans r hr d (conditions hd) q hq rd dq, rp⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundRelativeMaximalAntichain + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Q order D : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) (hD : D ∈ M.sets) + (orderCode : PartialOrderCode Q order) (conditions : D ⊆ Q) : + ∃ A ∈ M.sets, RelativeMaximalAntichainCode Q order D A := by + let F := M.nonemptyGroundSubsets D + have hF := M.nonemptyGroundSubsets_mem powers separation hD + obtain ⟨c, hc, chooser⟩ := M.choice_witness choice hF + (fun E hE => ((M.mem_nonemptyGroundSubsets D E).1 hE).2.2) + obtain ⟨C, hC, ordinal, _, impossible⟩ := M.exists_groundHartogs + pairing unions powers separation collection hD + obtain ⟨f, hf, trace⟩ := M.exists_greedyAntichainTrace + pairing unions powers separation collection hQ hOrder hD hc hC ordinal chooser + obtain ⟨alpha, hAlpha, exhausted⟩ := greedyAntichainTrace_exhausts chooser ordinal trace + orderCode conditions (fun injection => impossible ⟨f, hf, injection⟩) + exact ⟨relationImage alpha D f, + M.relationImage_mem separation (M.transitive hC hAlpha) hD hf, + greedyAntichainTrace_relativeMaximal chooser ordinal trace conditions hAlpha exhausted⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def definable_ordinaryMembershipDecisions (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => + M.ordinaryMembershipDecisions (env 1) (env 2) (env 0) (env 3)) := by + let defined := (M.definable_separation separation + (ordinaryMembershipDecisionFormula 1 2 0 3 4)).reindex (![1, 1, 2, 0, 3] : Fin 5 → Fin 4) + refine defined.congr ?_ + intro env + apply congrArg (fun params : Fin 4 → ZFSet.{u} => + ZFSet.sep (fun z => Realize M.sets (ordinaryMembershipDecisionFormula 1 2 0 3 4) + (extend z params)) (env 1)) + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)))) j + +theorem ordinaryMembershipDecisions_mem (separation : SeparationSchema M.sets) + {Q order sigma tau : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) + (hSigma : sigma ∈ M.sets) (hTau : tau ∈ M.sets) : + M.ordinaryMembershipDecisions Q order sigma tau ∈ M.sets := + (M.definable_ordinaryMembershipDecisions separation).closed ![sigma, Q, order, tau] + (Fin.cases hSigma (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i))))) + +noncomputable def ordinaryMembershipDecisionFamily (T Q order tau : ZFSet.{u}) : ZFSet.{u} := + familyCodeGraph (fun sigma : T => sigma.val) + (fun sigma => M.ordinaryMembershipDecisions Q order sigma.val tau) + +theorem pair_mem_ordinaryMembershipDecisionFamily (T Q order tau sigma D : ZFSet.{u}) : + ZFSet.pair sigma D ∈ M.ordinaryMembershipDecisionFamily T Q order tau ↔ + sigma ∈ T ∧ D = M.ordinaryMembershipDecisions Q order sigma tau := by + rw [ordinaryMembershipDecisionFamily, mem_familyCodeGraph] + constructor + · rintro ⟨x, equal⟩ + obtain ⟨hx, hd⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx ▸ x.property, hd.symm.trans (congrArg (fun y => M.ordinaryMembershipDecisions Q order y tau) hx)⟩ + · rintro ⟨member, rfl⟩ + exact ⟨⟨sigma, member⟩, rfl⟩ + +theorem ordinaryMembershipDecisionFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) + (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : + M.ordinaryMembershipDecisionFamily T Q order tau ∈ M.sets := + (M.definable_ordinaryMembershipDecisions separation).graph_mem pairing separation collection + ![Q, order, tau] (Fin.cases hQ (Fin.cases hOrder (Fin.cases hTau (fun i => Fin.elim0 i)))) hT + +theorem ordinaryMembershipDecisionFamily_function + (separation : SeparationSchema M.sets) + {T Q order tau : ZFSet.{u}} (hT : T ∈ M.sets) (hQ : Q ∈ M.sets) + (hOrder : order ∈ M.sets) (hTau : tau ∈ M.sets) : + ZFSet.IsFunc T (M.groundPower Q) (M.ordinaryMembershipDecisionFamily T Q order tau) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨sigma, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨sigma.property, (M.mem_groundPower Q _).2 + ⟨M.ordinaryMembershipDecisions_mem separation hQ hOrder (M.transitive hT sigma.property) hTau, + M.ordinaryMembershipDecisions_subset Q order sigma.val tau⟩⟩ + · intro sigma hSigma + exact ⟨M.ordinaryMembershipDecisions Q order sigma tau, + (M.pair_mem_ordinaryMembershipDecisionFamily T Q order tau sigma _).2 ⟨hSigma, rfl⟩, + fun D entry => (M.pair_mem_ordinaryMembershipDecisionFamily T Q order tau sigma D).1 entry |>.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem ordinaryMembershipDecisionFamily_dense + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ sigma ∈ T, IsName s sigma) + (tau : (M.nameDomain s).names) : + ∀ sigma D, ZFSet.pair sigma D ∈ + M.ordinaryMembershipDecisionFamily T s.carrier s.conditionOrder tau.val.val → + ∀ p ∈ s.carrier, ∃ q ∈ D, ZFSet.pair q p ∈ s.conditionOrder := by + intro sigma D entry + obtain ⟨member, rfl⟩ := (M.pair_mem_ordinaryMembershipDecisionFamily + T s.carrier s.conditionOrder tau.val.val sigma D).1 entry + let name : (M.nameDomain s).names := ⟨⟨sigma, valid sigma member⟩, M.transitive hT member⟩ + exact M.ordinaryMembershipDecisions_dense s pairing unions powers separation collection carrier order name tau + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_relativeMaximalAntichainFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Q order J domains : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) + (hJ : J ∈ M.sets) (hDomains : domains ∈ M.sets) + (orderCode : PartialOrderCode Q order) + (domainsCode : ZFSet.IsFunc J (M.groundPower Q) domains) : + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + ∀ j D A, ZFSet.pair j D ∈ domains → ZFSet.pair j A ∈ f → + RelativeMaximalAntichainCode Q order D A := by + let B := M.groundPower Q + let formula : SetFormula 5 := (BoundedFormula.relativeAntichainFamilyFormula 0 1 2 3 4).toFormula + let params := extend Q (extend order (extend domains Fin.elim0)) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hQ (Fin.cases hOrder (Fin.cases hDomains (fun i => Fin.elim0 i))) + have recognize (j A : ZFSet.{u}) (hj : j ∈ M.sets) (hA : A ∈ M.sets) : + Realize M.sets formula (extend j (extend A params)) ↔ + ∃ D, ZFSet.pair j D ∈ domains ∧ RelativeMaximalAntichainCode Q order D A := + (BoundedFormula.realize_toFormula M _ _ (Fin.cases hj (Fin.cases hA members))).trans + (BoundedFormula.truth_relativeAntichainFamilyFormula 0 1 2 3 4 _) + have hB : B ∈ M.sets := M.groundPower_mem powers hQ + let relation := M.definableRelation formula params J B + have ground : relation ∈ M.sets := M.definableRelation_mem + pairing unions powers separation formula params members hJ hB + have total : ∀ j ∈ J, ∃ A ∈ B, ZFSet.pair j A ∈ relation := by + intro j hj + obtain ⟨D, entry, _⟩ := domainsCode.2 j hj + have domain := (M.mem_groundPower Q D).1 (ZFSet.pair_mem_prod.1 (domainsCode.1 entry)).2 + obtain ⟨A, hA, code⟩ := M.exists_groundRelativeMaximalAntichain + pairing unions powers separation collection choice hQ hOrder domain.1 orderCode domain.2 + have inB : A ∈ B := (M.mem_groundPower Q A).2 ⟨hA, code.2.1.1⟩ + exact ⟨A, inB, (M.pair_mem_definableRelation formula params J B j A).2 + ⟨hj, inB, (recognize j A (M.transitive hJ hj) hA).2 ⟨D, entry, code⟩⟩⟩ + obtain ⟨f, hf, function, selected⟩ := M.uniformize_relation + pairing unions powers separation choice hJ hB ground total + refine ⟨f, hf, function, ?_⟩ + intro j D A domainEntry chosen + obtain ⟨hj, hA, holds⟩ := (M.pair_mem_definableRelation formula params J B j A).1 (selected chosen) + obtain ⟨D', entry, code⟩ := (recognize j A (M.transitive hJ hj) + ((M.mem_groundPower Q A).1 hA).1).1 holds + obtain ⟨value, _, unique⟩ := domainsCode.2 j hj + have equal : D' = D := (unique D' entry).trans (unique D domainEntry).symm + exact equal ▸ code + +theorem exists_smallRelativeAntichainFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Q order J domains K : ZFSet.{u}} (hQ : Q ∈ M.sets) (hOrder : order ∈ M.sets) + (hJ : J ∈ M.sets) (hDomains : domains ∈ M.sets) (hK : K ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) (orderCode : PartialOrderCode Q order) + (domainsCode : ZFSet.IsFunc J (M.groundPower Q) domains) + (smallJ : GroundBelow M J K) + (chain : ∀ A ∈ M.sets, OrderAntichainCode Q order A → GroundBelow M A K) : + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ j D A, ZFSet.pair j D ∈ domains → ZFSet.pair j A ∈ f → + RelativeMaximalAntichainCode Q order D A) ∧ + let U := ⋃₀ relationImage J (M.groundPower Q) f + U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q := by + obtain ⟨f, hf, function, selected⟩ := M.exists_relativeMaximalAntichainFamily + pairing unions powers separation collection choice hQ hOrder hJ hDomains orderCode domainsCode + have hPower := M.groundPower_mem powers hQ + have small : ∀ j A, ZFSet.pair j A ∈ f → GroundBelow M A K := by + intro j A entry + have pair := ZFSet.pair_mem_prod.1 (function.1 entry) + obtain ⟨D, domainEntry, _⟩ := domainsCode.2 j pair.1 + exact chain A ((M.mem_groundPower Q A).1 pair.2).1 + (selected j D A domainEntry entry).2.1 + refine ⟨f, hf, function, selected, + M.union_mem unions (M.relationImage_mem separation hJ hPower hf), + GroundBelow.indexed_sUnion pairing unions powers separation choice hJ hPower hf hK + conditions.1 conditions.2.2.1 conditions.2.2.2 smallJ function small, ?_⟩ + intro q member + obtain ⟨A, inRange, inA⟩ := ZFSet.mem_sUnion.1 member + have inPower := ((mem_relationImage J (M.groundPower Q) f A).1 inRange).1 + exact ((M.mem_groundPower Q A).1 inPower).2 inA + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) + +theorem exists_ordinaryMembershipAntichainFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {T K : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ sigma ∈ T, IsName s sigma) + (tau : (M.nameDomain s).names) (hK : K ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) (smallT : GroundBelow M T K) + (chain : ∀ A ∈ M.sets, OrderAntichainCode s.carrier s.conditionOrder A → GroundBelow M A K) : + ∃ f ∈ M.sets, ZFSet.IsFunc T (M.groundPower s.carrier) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode s.carrier s.conditionOrder + (M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma tau.val.val) A ∧ + ∀ q ∈ s.carrier, ∃ p ∈ A, ∃ r ∈ s.carrier, + ZFSet.pair r q ∈ s.conditionOrder ∧ ZFSet.pair r p ∈ s.conditionOrder) ∧ + let U := ⋃₀ relationImage T (M.groundPower s.carrier) f + U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ s.carrier := by + let domains := M.ordinaryMembershipDecisionFamily T s.carrier s.conditionOrder tau.val.val + have hDomains : domains ∈ M.sets := M.ordinaryMembershipDecisionFamily_mem + pairing separation collection hT carrier order tau.property + have domainsCode : ZFSet.IsFunc T (M.groundPower s.carrier) domains := + M.ordinaryMembershipDecisionFamily_function separation hT carrier order tau.property + obtain ⟨f, hf, function, selected, whole⟩ := M.exists_smallRelativeAntichainFamily + pairing unions powers separation collection choice carrier order hT hDomains hK conditions + s.conditionOrder_code domainsCode smallT chain + refine ⟨f, hf, function, ?_, whole⟩ + intro sigma A entry + have hSigma := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 + have domainEntry : ZFSet.pair sigma + (M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma tau.val.val) ∈ domains := + (M.pair_mem_ordinaryMembershipDecisionFamily T s.carrier s.conditionOrder tau.val.val sigma _).2 + ⟨hSigma, rfl⟩ + have code := selected sigma _ A domainEntry entry + exact ⟨code, code.predense s.conditionOrder_code + (M.ordinaryMembershipDecisions_subset s.carrier s.conditionOrder sigma tau.val.val) + (M.ordinaryMembershipDecisionFamily_dense s pairing unions powers separation collection carrier order + hT valid tau sigma _ domainEntry)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOutsideRowNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOutsideRowNames.lean index 3503874df426c63cdcdd40bd562f01b331cf6925..27be9842eeb77895548604f107739dd4ea93320e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOutsideRowNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundOutsideRowNames.lean @@ -1,880 +1,880 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBinaryRowSets -import OAI.SetTheory.PartitionPrinciple.Definability.SmallFunctionActionFormulas - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {X Y G : Type u} [Group G] [PartialOrder X] -variable (a : PosetAction G X) (s : Presentation X) (t : Presentation Y) (b : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {N : ZFSet.{u}} (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) -variable (hG : b.carrier ∈ M.sets) (hN : N ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) - -theorem smallFunctionActionGraph_mem : - letI := M.smallFunctionOrder s.carrier t.carrier N - (M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).actionGraph - (SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N)) b ∈ M.sets := by - let := M.smallFunctionOrder s.carrier t.carrier N - let act := M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph - let c := SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N) - have carrier := M.smallPartialFunctions_mem pairing unions powers separation hX hY hN - have bound := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hG carrier) carrier - let params := extend b.carrier (extend c.carrier (extend s.carrier (extend t.carrier - (extend (a.actionGraph s b) Fin.elim0)))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hG (Fin.cases carrier (Fin.cases hX (Fin.cases hY (Fin.cases graph (fun i => Fin.elim0 i))))) - have correct (z : ZFSet.{u}) : - BoundedFormula.Truth (BoundedFormula.smallActionEntryFormula 0 1 2 3 4 5) (extend z params) ↔ - z ∈ act.actionGraph c b := by - rw [BoundedFormula.truth_smallActionEntryFormula] - change (∃ g ∈ b.carrier, ∃ p ∈ c.carrier, ∃ q ∈ c.carrier, - z = ZFSet.pair (ZFSet.pair g p) q ∧ - RenameActionRelation s.carrier t.carrier (a.actionGraph s b) g p q) ↔ _ - constructor - · rintro ⟨g, hg, p, hp, q, hq, eq, relation⟩ - obtain ⟨g', rfl⟩ := (b.mem_carrier g).1 hg - obtain ⟨p', rfl⟩ := (c.mem_carrier p).1 hp - obtain ⟨q', rfl⟩ := (c.mem_carrier q).1 hq - rw [eq] - apply (act.triple_mem_actionGraph c b g' p' q').2 - apply SetMembers.raw_injective - rw [M.raw_smallFunctionAction] - exact (renameActionRelation_iff a s t b g' - (M.smallFunction_raw_properties s.carrier t.carrier N q').2.1.shape).1 relation - · intro hz - obtain ⟨⟨g, p⟩, eq⟩ := ((b.product c).mem_graph c (fun x => act.iso x.1 x.2) z).1 hz - refine ⟨b.encode g, b.encode_mem g, c.encode p, c.encode_mem p, - c.encode (act.iso g p), c.encode_mem (act.iso g p), eq.symm, ?_⟩ - apply (renameActionRelation_iff a s t b g - (M.smallFunction_raw_properties s.carrier t.carrier N (act.iso g p)).2.1.shape).2 - exact (M.raw_smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph g p).symm - have selected := M.bounded_separation_mem separation (BoundedFormula.smallActionEntryFormula 0 1 2 3 4 5) - params members bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.smallActionEntryFormula 0 1 2 3 4 5) - (extend z params)) (ZFSet.prod (ZFSet.prod b.carrier c.carrier) c.carrier) = act.actionGraph c b := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - exact ⟨fun h => (correct z).1 h.2, - fun hz => ⟨((b.product c).graph_isFunc c (fun x => act.iso x.1 x.2)).1 hz, (correct z).2 hz⟩⟩ - exact eq ▸ selected - -theorem smallFunction_conditionMapFamily_mem (collection : CollectionSchema M.sets) : - letI := M.smallFunctionOrder s.carrier t.carrier N - (M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).conditionMapFamily - (SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N)) b ∈ M.sets := by - let := M.smallFunctionOrder s.carrier t.carrier N - exact M.conditionMapFamily_mem_of_actionGraph - (M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph) - (SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N)) b - pairing unions powers separation collection - (M.smallPartialFunctions_mem pairing unions powers separation hX hY hN) hG - (M.smallFunctionActionGraph_mem a s t b pairing unions powers separation hX hY hG hN graph) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def rowUsedRows (I C Y p : ZFSet.{u}) : ZFSet.{u} := - relationImage (rowCoordinateDomain I C Y p) I (productFirst I C) - -theorem mem_rowUsedRows (I C Y p i : ZFSet.{u}) : - i ∈ rowUsedRows I C Y p ↔ - i ∈ I ∧ ∃ c ∈ C, ∃ y ∈ Y, ZFSet.pair (ZFSet.pair i c) y ∈ p := by - rw [rowUsedRows, mem_relationImage] - constructor - · rintro ⟨hi, x, hx, rel⟩ - obtain ⟨j, _, c, hc, eq⟩ := (mem_productFirst I C _).1 rel - have entries := ZFSet.pair_inj.1 eq - obtain ⟨_, y, hy, entry⟩ := (mem_rowCoordinateDomain I C Y p x).1 hx - rw [entries.1, ← entries.2] at entry - exact ⟨hi, c, hc, y, hy, entry⟩ - · rintro ⟨hi, c, hc, y, hy, entry⟩ - exact ⟨hi, ZFSet.pair i c, - (mem_rowCoordinateDomain I C Y p _).2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hc⟩, y, hy, entry⟩, - (mem_productFirst I C _).2 ⟨i, hi, c, hc, rfl⟩⟩ - -theorem rowUsedRows_subset (I C Y p : ZFSet.{u}) : rowUsedRows I C Y p ⊆ I := - fun i hi => ((mem_rowUsedRows I C Y p i).1 hi).1 - -theorem row_mem_rowUsedRows {I C Y p i c y : ZFSet.{u}} - (code : PartialFunctionCode (ZFSet.prod I C) Y p) - (entry : ZFSet.pair (ZFSet.pair i c) y ∈ p) : i ∈ rowUsedRows I C Y p := by - have bound := ZFSet.pair_mem_prod.1 (code.shape entry) - have coordinates := ZFSet.pair_mem_prod.1 bound.1 - exact (mem_rowUsedRows I C Y p i).2 ⟨coordinates.1, c, coordinates.2, y, bound.2, entry⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem rowUsedRows_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.sets) : rowUsedRows I C Y p ∈ M.sets := - M.relationImage_mem separation - (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hI - (M.productFirst_mem pairing unions powers separation hI hC) - -theorem rowUsedRows_groundEmbeddable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) - (small : M.groundEmbeddable p N) : M.groundEmbeddable (rowUsedRows I C Y p) N := - M.groundEmbeddable_function_image pairing unions powers separation choice - (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hI hN - (M.productFirst_mem pairing unions powers separation hI hC) (productFirst_function I C) - (M.rowCoordinateDomain_groundEmbeddable pairing unions powers separation choice hI hC hY hp hN small) - -theorem countablePartialFunctions_rowSupport - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) - (hp : p ∈ M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) : - rowUsedRows I C Y p ∈ M.sets ∧ M.groundEmbeddable (rowUsedRows I C Y p) ZFSet.omega := by - obtain ⟨ground, _, small⟩ := (M.mem_smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega p).1 hp - exact ⟨M.rowUsedRows_mem pairing unions powers separation hI hC hY ground, - M.rowUsedRows_groundEmbeddable pairing unions powers separation choice - hI hC hY ground (M.omega_mem separation infinite) small⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -@[instance_reducible] -def columnOrder (C : ZFSet.{u}) : PartialOrder (SetMembers C) where - le := Eq - le_refl _ := rfl - le_trans _ _ _ := Eq.trans - le_antisymm _ _ h _ := h - -noncomputable def rowCoordinatePresentation {L : Type u} [Bot L] - (s : Presentation L) (C : ZFSet.{u}) : - Presentation ({i : L // i ≠ ⊥} × SetMembers C) := - s.nonbottom.product (SetMembers.presentation C) - -namespace PosetAction - -variable {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] - -noncomputable def rowCoordinates (a : PosetAction G L) (C : ZFSet.{u}) : - letI := columnOrder C - PosetAction G ({i : L // i ≠ ⊥} × SetMembers C) := by - letI := columnOrder C - exact a.nonbottom.productColumns (SetMembers C) - -theorem rowCoordinates_apply (a : PosetAction G L) (C : ZFSet.{u}) : - letI := columnOrder C - ∀ (g : G) (i : {i : L // i ≠ ⊥}) (c : SetMembers C), - (a.rowCoordinates C).iso g (i, c) = (a.nonbottom.iso g i, c) := by - let := columnOrder C - intro g i c - rfl - -end PosetAction - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem rowCoordinate_carrier_mem {L : Type u} [Bot L] - (s : Presentation L) (C : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) : - (rowCoordinatePresentation s C).carrier ∈ M.sets := - M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - -theorem rowCoordinate_graph_mem {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] - (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) - (graph : a.actionGraph s b ∈ M.sets) : - letI := columnOrder C - (a.rowCoordinates C).actionGraph (rowCoordinatePresentation s C) b ∈ M.sets := by - let := columnOrder C - exact M.productColumns_actionGraph_mem a.nonbottom s.nonbottom (SetMembers.presentation C) b - pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC hG - (M.nonbottom_actionGraph_mem a s b separation hL hG graph) - -variable {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -noncomputable def internalRowAction : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - PosetAction G (SetMembers - (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by - letI := columnOrder C - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - exact M.smallFunctionAction (a.rowCoordinates C) (rowCoordinatePresentation s C) - (natInitialPresentation 2) b pairing unions powers separation - (M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC) - (M.natSetCode_mem separation infinite 2) hG (M.omega_mem separation infinite) - (M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph) - -theorem internalRowAction_entry : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ (g : G) (p : SetMembers - (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) - (i : {i : L // i ≠ ⊥}) (c : SetMembers C) (k : Fin 2), - ZFSet.pair (ZFSet.pair (s.encode (a.iso g i.val)) (SetMembers.raw c)) (natSetCode k.val) ∈ - SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite - hL hC hG graph).iso g p) ↔ - ZFSet.pair (ZFSet.pair (s.encode i.val) (SetMembers.raw c)) (natSetCode k.val) ∈ - SetMembers.raw p := by - let := columnOrder C - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro g p i c k - exact M.smallFunctionAction_entry (a.rowCoordinates C) (rowCoordinatePresentation s C) - (natInitialPresentation 2) b pairing unions powers separation - (M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC) - (M.natSetCode_mem separation infinite 2) hG (M.omega_mem separation infinite) - (M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph) - g p (i, c) (ULift.up k) - -theorem internalRowActionGraph_mem : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - (M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph).actionGraph - (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) b ∈ - M.sets := by - let := columnOrder C - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - exact M.smallFunctionActionGraph_mem (a.rowCoordinates C) (rowCoordinatePresentation s C) - (natInitialPresentation 2) b pairing unions powers separation - (M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC) - (M.natSetCode_mem separation infinite 2) hG (M.omega_mem separation infinite) - (M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem internalRowCondition_entry_shape {L : Type u} [Bot L] - (s : Presentation L) (C : ZFSet.{u}) - (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) - (z : ZFSet.{u}) (hz : z ∈ SetMembers.raw p) : - ∃ i : {i : L // i ≠ ⊥}, ∃ c ∈ C, ∃ y ∈ natSetCode 2, - z = ZFSet.pair (ZFSet.pair (s.encode i.val) c) y := by - have shape := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega p).2.1.shape hz - obtain ⟨ic, hic, y, hy, eq⟩ := ZFSet.mem_prod.1 shape - obtain ⟨r, hr, c, hc, rfl⟩ := ZFSet.mem_prod.1 hic - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier r).1 hr - exact ⟨i, c, hc, y, hy, eq⟩ - -variable {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem internalRowAction_raw_entry : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ (g : G) (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) - (i : {i : L // i ≠ ⊥}) (c y : ZFSet.{u}), c ∈ C → y ∈ natSetCode 2 → - (ZFSet.pair (ZFSet.pair (s.encode (a.iso g i.val)) c) y ∈ - SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite - hL hC hG graph).iso g p) ↔ - ZFSet.pair (ZFSet.pair (s.encode i.val) c) y ∈ SetMembers.raw p) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro g p i c y hc hy - obtain ⟨k, eq⟩ := ((natInitialPresentation 2).mem_carrier y).1 hy - change natSetCode k.down.val = y at eq - have entry := M.internalRowAction_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p i (SetMembers.ofMem c hc) k.down - simpa only [SetMembers.raw_ofMem, eq] using entry - -theorem internalRowAction_usedRows : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ (g : G) (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) - (i : {i : L // i ≠ ⊥}), - s.encode (a.iso g i.val) ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) - (SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite - hL hC hG graph).iso g p)) ↔ - s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro g p i - rw [mem_rowUsedRows, mem_rowUsedRows] - constructor - · rintro ⟨_, c, hc, y, hy, entry⟩ - exact ⟨s.nonbottom.encode_mem i, c, hc, y, hy, - (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p i c y hc hy).1 entry⟩ - · rintro ⟨_, c, hc, y, hy, entry⟩ - exact ⟨s.nonbottom.encode_mem (a.nonbottom.iso g i), c, hc, y, hy, - (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p i c y hc hy).2 entry⟩ - -theorem internalRowAction_eq_of_fixes_usedRows : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ (g : G) (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - (∀ i : {i : L // i ≠ ⊥}, - s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → - a.iso g i.val = i.val) → - (M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph).iso g p = p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro g p fixed - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - change act.iso g p = p - apply SetMembers.raw_injective - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨i, c, hc, y, hy, eq⟩ := M.internalRowCondition_entry_shape s C (act.iso g p) z hz - let j := (a.nonbottom.iso g).symm i - have image : a.iso g j.val = i.val := - congrArg Subtype.val ((a.nonbottom.iso g).apply_symm_apply i) - have moved : ZFSet.pair (ZFSet.pair (s.encode (a.iso g j.val)) c) y ∈ - SetMembers.raw (act.iso g p) := by - rw [image, ← eq] - exact hz - have old := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p j c y hc hy).1 moved - have used := row_mem_rowUsedRows (M.smallFunction_raw_properties - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega p).2.1 old - have rowEq : j.val = i.val := (fixed j used).symm.trans image - rw [rowEq] at old - exact eq.symm ▸ old - · intro hz - obtain ⟨i, c, hc, y, hy, eq⟩ := M.internalRowCondition_entry_shape s C p z hz - have old : ZFSet.pair (ZFSet.pair (s.encode i.val) c) y ∈ SetMembers.raw p := by - rw [← eq] - exact hz - have used := row_mem_rowUsedRows (M.smallFunction_raw_properties - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega p).2.1 old - have moved := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p i c y hc hy).2 old - rw [fixed i used] at moved - exact eq.symm ▸ moved - -theorem internalRowAction_eq_of_principalFix : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ (g : G) (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (D : L), - (∀ i : {i : L // i ≠ ⊥}, - s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → - g ∈ a.principalFix D → - (M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph).iso g p = p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro g p D bound fixed - exact M.internalRowAction_eq_of_fixes_usedRows a s b C pairing unions powers separation infinite - hL hC hG graph g p (fun i used => fixed i.val (bound i used)) - -theorem internalRowAction_usedRows_bounded : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ (g : G) (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (D : L), - (∀ i : {i : L // i ≠ ⊥}, - s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → - ∀ i : {i : L // i ≠ ⊥}, - s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) - (SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite - hL hC hG graph).iso g p)) → i.val ≤ a.iso g D := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro g p D bound i used - let j := (a.nonbottom.iso g).symm i - have image : a.iso g j.val = i.val := - congrArg Subtype.val ((a.nonbottom.iso g).apply_symm_apply i) - have old := (M.internalRowAction_usedRows a s b C pairing unions powers separation infinite - hL hC hG graph g p j).1 (by rw [image]; exact used) - have mapped := (a.iso g).monotone (bound j old) - rw [image] at mapped - exact mapped - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] - -noncomputable def internalRowName (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) (i : {i : L // i ≠ ⊥}) : - Name (SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - exact M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val) - -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem internalRowName_action (g : G) (i : {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - act.act c g (M.internalRowName s C hL i) = - M.internalRowName s C hL (a.nonbottom.iso g i) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - change act.act c g (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val)) = - M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode (a.iso g i.val)) - apply Name.ext - intro σ q - change Name.Entry σ (Name.rename c (act.iso g) - (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val))) q ↔ _ - rw [Name.entry_rename, M.entry_binaryRowName] - constructor - · rintro ⟨ν, p, entry, eq, rfl⟩ - obtain ⟨x, hx, rfl, hp⟩ := (M.entry_binaryRowName s.nonbottom.carrier C ⊤ - (s.encode i.val) ν p).1 entry - refine ⟨x, hx, (act.act_check c g x).symm.trans eq, ?_⟩ - have moved := M.internalRowAction_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p i (SetMembers.ofMem x hx) (1 : Fin 2) - simp only [SetMembers.raw_ofMem] at moved - exact moved.2 hp - · rintro ⟨x, hx, rfl, hq⟩ - let p := (act.iso g).symm q - have pq : act.iso g p = q := (act.iso g).apply_symm_apply q - have moved := M.internalRowAction_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p i (SetMembers.ofMem x hx) (1 : Fin 2) - simp only [SetMembers.raw_ofMem] at moved - have hp : ZFSet.pair (ZFSet.pair (s.encode i.val) x) (natSetCode 1) ∈ - SetMembers.raw p := by - apply moved.1 - change ZFSet.pair (ZFSet.pair (s.encode (a.iso g i.val)) x) (natSetCode 1) ∈ - SetMembers.raw (act.iso g p) - rw [pq] - exact hq - exact ⟨Name.check c ⊤ x, p, - (M.entry_binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val) _ p).2 - ⟨x, hx, rfl, hp⟩, act.act_check c g x, pq⟩ - -theorem internalRowName_supported (i : {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - a.principalFix i.val ≤ act.stabilizer c (M.internalRowName s C hL i) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act c g fixed - change act.act c g (M.internalRowName s C hL i) = M.internalRowName s C hL i - rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph] - apply congrArg (M.internalRowName s C hL) - exact Subtype.ext (fixed i.val le_rfl) - -theorem internalRowName_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - (i : {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) (M.internalRowName s C hL i) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - refine HereditarilySymmetric.mk ⟨i.val, - M.internalRowName_supported a s b C pairing unions powers separation infinite hL hC hG graph i⟩ ?_ - intro σ p entry - obtain ⟨x, _, rfl, _⟩ := (M.entry_binaryRowName s.nonbottom.carrier C ⊤ - (s.encode i.val) σ p).1 entry - exact HereditarilySymmetric.check act c (a.principalSupportFamily ⊥ directed) x - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] - -noncomputable def internalRowSetName (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) : - Name (SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - exact M.binaryRowSetName s.nonbottom.carrier C ⊤ - -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem internalRowSetName_action (g : G) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - act.act c g (M.internalRowSetName s C hL) = M.internalRowSetName s C hL := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - change act.act c g (M.binaryRowSetName s.nonbottom.carrier C ⊤) = - M.binaryRowSetName s.nonbottom.carrier C ⊤ - apply Name.ext - intro σ q - change Name.Entry σ (Name.rename c (act.iso g) - (M.binaryRowSetName s.nonbottom.carrier C ⊤)) q ↔ _ - rw [Name.entry_rename, M.entry_binaryRowSetName] - constructor - · rintro ⟨ν, p, entry, eq, rfl⟩ - obtain ⟨x, hx, rfl, rfl⟩ := (M.entry_binaryRowSetName s.nonbottom.carrier C ⊤ ν p).1 entry - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx - refine ⟨s.nonbottom.encode (a.nonbottom.iso g i), s.nonbottom.encode_mem _, ?_, - (act.iso g).map_top.symm⟩ - have moved := M.internalRowName_action a s b C pairing unions powers separation infinite - hL hC hG graph g i - exact moved.symm.trans eq - · rintro ⟨x, hx, rfl, rfl⟩ - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx - let j := (a.nonbottom.iso g).symm i - refine ⟨M.internalRowName s C hL j, ⊤, - (M.entry_binaryRowSetName s.nonbottom.carrier C ⊤ _ ⊤).2 - ⟨s.nonbottom.encode j, s.nonbottom.encode_mem j, rfl, rfl⟩, ?_, - (act.iso g).map_top⟩ - change act.act c g (M.internalRowName s C hL j) = M.internalRowName s C hL i - rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph] - exact congrArg (M.internalRowName s C hL) ((a.nonbottom.iso g).apply_symm_apply i) - -theorem internalRowSetName_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) (M.internalRowSetName s C hL) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - refine HereditarilySymmetric.mk ⟨⊥, ?_⟩ ?_ - · intro g _ - exact M.internalRowSetName_action a s b C pairing unions powers separation infinite hL hC hG graph g - · intro σ p entry - obtain ⟨x, hx, rfl, _⟩ := (M.entry_binaryRowSetName s.nonbottom.carrier C ⊤ σ p).1 entry - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx - exact M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -noncomputable def outsideRowIndices {L : Type u} [PartialOrder L] [OrderBot L] - (s : Presentation L) (B : L) : ZFSet.{u} := - ZFSet.sep (fun x => ZFSet.pair x (s.encode B) ∉ s.conditionOrder) s.nonbottom.carrier - -theorem outsideRowIndices_subset {L : Type u} [PartialOrder L] [OrderBot L] - (s : Presentation L) (B : L) : outsideRowIndices s B ⊆ s.nonbottom.carrier := - fun _ hx => (ZFSet.mem_sep.1 hx).1 - -theorem encode_mem_outsideRowIndices {L : Type u} [PartialOrder L] [OrderBot L] - (s : Presentation L) (B : L) (i : {i : L // i ≠ ⊥}) : - s.encode i.val ∈ outsideRowIndices s B ↔ ¬ i.val ≤ B := by - rw [outsideRowIndices, ZFSet.mem_sep, s.pair_mem_conditionOrder] - exact ⟨And.right, fun hi => ⟨s.nonbottom.encode_mem i, hi⟩⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -noncomputable def binaryRowSubsetName (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (J : ZFSet.{u}) : - Name (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) := - Name.assemble (fun i : SetMembers J => M.binaryRowName I C one (SetMembers.raw i)) (fun _ => one) - -theorem entry_binaryRowSubsetName (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (J : ZFSet.{u}) - (σ : Name (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) - (p : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : - Name.Entry σ (M.binaryRowSubsetName I C one J) p ↔ - ∃ i ∈ J, M.binaryRowName I C one i = σ ∧ one = p := by - rw [binaryRowSubsetName, Name.entry_assemble] - constructor - · rintro ⟨i, eq, condition⟩ - exact ⟨SetMembers.raw i, SetMembers.raw_mem i, eq, condition⟩ - · rintro ⟨i, hi, eq, condition⟩ - exact ⟨SetMembers.ofMem i hi, by simpa only [SetMembers.raw_ofMem] using eq, condition⟩ - -theorem mem_binaryRowSubsetName_code (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (J z : ZFSet.{u}) : - z ∈ (M.binaryRowSubsetName I C one J).val ↔ ∃ i ∈ J, - z = ZFSet.pair (M.binaryRowName I C one i).val (SetMembers.raw one) := by - change z ∈ ZFSet.range _ ↔ _ - rw [ZFSet.mem_range] - constructor - · rintro ⟨i, eq⟩ - exact ⟨SetMembers.raw i, SetMembers.raw_mem i, eq.symm⟩ - · rintro ⟨i, hi, eq⟩ - refine ⟨SetMembers.ofMem i hi, ?_⟩ - simpa only [SetMembers.presentation, SetMembers.raw_ofMem] using eq.symm - -theorem eval_binaryRowSubsetName (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (J : ZFSet.{u}) : - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), H.mem one → - Name.eval {p | H.mem p} (M.binaryRowSubsetName I C one J) = - ZFSet.range (fun i : SetMembers J => M.binaryGenericRow I C H (SetMembers.raw i)) := by - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - intro H hone - apply ZFSet.ext - intro x - rw [binaryRowSubsetName, Name.mem_eval_assemble, ZFSet.mem_range] - constructor - · rintro ⟨i, _, eq⟩ - rw [M.eval_binaryRowName I C one H hone] at eq - exact ⟨i, eq⟩ - · rintro ⟨i, eq⟩ - exact ⟨i, hone, (M.eval_binaryRowName I C one H hone (SetMembers.raw i)).trans eq⟩ - -theorem eval_binaryRowSubsetName_subset (I C : ZFSet.{u}) - (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) - (J : ZFSet.{u}) (subset : J ⊆ I) - (H : Set (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) : - Name.eval H (M.binaryRowSubsetName I C one J) ⊆ Name.eval H (M.binaryRowSetName I C one) := by - intro x hx - obtain ⟨σ, p, entry, hp, eq⟩ := (Name.mem_eval H _ x).1 hx - obtain ⟨i, hi, child, condition⟩ := (M.entry_binaryRowSubsetName I C one J σ p).1 entry - exact (Name.mem_eval H _ x).2 ⟨σ, p, - (M.entry_binaryRowSetName I C one σ p).2 ⟨i, subset hi, child, condition⟩, hp, eq⟩ - -variable {L G : Type u} [Group G] [PartialOrder L] [OrderBot L] - -noncomputable def internalOutsideRowsName (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) (B : L) : - Name (SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - exact M.binaryRowSubsetName s.nonbottom.carrier C ⊤ (outsideRowIndices s B) - -theorem entry_internalOutsideRowsName (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) (B : L) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - ∀ (σ : Name (SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) - (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - Name.Entry σ (M.internalOutsideRowsName s C hL B) p ↔ - ∃ i : {i : L // i ≠ ⊥}, ¬ i.val ≤ B ∧ M.internalRowName s C hL i = σ ∧ ⊤ = p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro σ p - rw [internalOutsideRowsName, M.entry_binaryRowSubsetName] - constructor - · rintro ⟨x, hx, child, condition⟩ - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 (outsideRowIndices_subset s B hx) - exact ⟨i, (encode_mem_outsideRowIndices s B i).1 hx, child, condition⟩ - · rintro ⟨i, hi, child, condition⟩ - exact ⟨s.encode i.val, (encode_mem_outsideRowIndices s B i).2 hi, child, condition⟩ - -theorem mem_eval_internalOutsideRowsName (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) (B : L) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) (x : ZFSet.{u}), - x ∈ Name.eval {p | H.mem p} (M.internalOutsideRowsName s C hL B) ↔ - ∃ i : {i : L // i ≠ ⊥}, ¬ i.val ≤ B ∧ - M.binaryGenericRow s.nonbottom.carrier C H (s.encode i.val) = x := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro H x - rw [Name.mem_eval] - constructor - · rintro ⟨σ, p, entry, _, eq⟩ - obtain ⟨i, hi, rfl, _⟩ := (M.entry_internalOutsideRowsName s C hL B σ p).1 entry - change Name.eval {p | H.mem p} (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val)) = x at eq - rw [M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem] at eq - exact ⟨i, hi, eq⟩ - · rintro ⟨i, hi, eq⟩ - exact ⟨M.internalRowName s C hL i, ⊤, - (M.entry_internalOutsideRowsName s C hL B _ ⊤).2 ⟨i, hi, rfl, rfl⟩, H.top_mem, - (M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem (s.encode i.val)).trans eq⟩ - -theorem eval_internalOutsideRowsName_subset (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) (B : L) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - Name.eval {p | H.mem p} (M.internalOutsideRowsName s C hL B) ⊆ - Name.eval {p | H.mem p} (M.internalRowSetName s C hL) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro H - exact M.eval_binaryRowSubsetName_subset s.nonbottom.carrier C ⊤ (outsideRowIndices s B) - (outsideRowIndices_subset s B) {p | H.mem p} - -theorem eval_internalOutsideRowsName_nonempty (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) (B : L) (outside : ∃ i : L, ¬ i ≤ B) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - (Name.eval {p | H.mem p} (M.internalOutsideRowsName s C hL B)).Nonempty := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro H - obtain ⟨i, hi⟩ := outside - have nonbottom : i ≠ ⊥ := by - intro eq - exact hi (eq ▸ bot_le) - exact ⟨M.binaryGenericRow s.nonbottom.carrier C H (s.encode i), - (M.mem_eval_internalOutsideRowsName s C hL B H _).2 ⟨⟨i, nonbottom⟩, hi, rfl⟩⟩ - -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem internalOutsideRowsName_action (B : L) (g : G) (fixed : g ∈ a.principalFix B) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - act.act c g (M.internalOutsideRowsName s C hL B) = M.internalOutsideRowsName s C hL B := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - have preserves (i : {i : L // i ≠ ⊥}) : - ¬ (a.nonbottom.iso g i).val ≤ B ↔ ¬ i.val ≤ B := by - apply not_congr - change a.iso g i.val ≤ B ↔ i.val ≤ B - calc - a.iso g i.val ≤ B ↔ a.iso g i.val ≤ a.iso g B := by rw [fixed B le_rfl] - _ ↔ i.val ≤ B := (a.iso g).map_rel_iff - apply Name.ext - intro σ q - change Name.Entry σ (Name.rename c (act.iso g) (M.internalOutsideRowsName s C hL B)) q ↔ _ - rw [Name.entry_rename, M.entry_internalOutsideRowsName] - constructor - · rintro ⟨ν, p, entry, eq, rfl⟩ - obtain ⟨i, hi, rfl, rfl⟩ := (M.entry_internalOutsideRowsName s C hL B ν p).1 entry - refine ⟨a.nonbottom.iso g i, (preserves i).2 hi, ?_, (act.iso g).map_top.symm⟩ - have moved := M.internalRowName_action a s b C pairing unions powers separation infinite - hL hC hG graph g i - exact moved.symm.trans eq - · rintro ⟨i, hi, rfl, rfl⟩ - let j := (a.nonbottom.iso g).symm i - have image : a.nonbottom.iso g j = i := (a.nonbottom.iso g).apply_symm_apply i - have outside : ¬ j.val ≤ B := (preserves j).1 (by rw [image]; exact hi) - refine ⟨M.internalRowName s C hL j, ⊤, - (M.entry_internalOutsideRowsName s C hL B _ ⊤).2 ⟨j, outside, rfl, rfl⟩, ?_, - (act.iso g).map_top⟩ - change act.act c g (M.internalRowName s C hL j) = M.internalRowName s C hL i - rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph] - exact congrArg (M.internalRowName s C hL) image - -theorem internalOutsideRowsName_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) (B : L) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) (M.internalOutsideRowsName s C hL B) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - refine HereditarilySymmetric.mk ⟨B, ?_⟩ ?_ - · intro g fixed - exact M.internalOutsideRowsName_action a s b C pairing unions powers separation infinite - hL hC hG graph B g fixed - · intro σ p entry - obtain ⟨i, _, rfl, _⟩ := (M.entry_internalOutsideRowsName s C hL B σ p).1 entry - exact M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBinaryRowSets +import OAI.SetTheory.PartitionPrinciple.Definability.SmallFunctionActionFormulas + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {X Y G : Type u} [Group G] [PartialOrder X] +variable (a : PosetAction G X) (s : Presentation X) (t : Presentation Y) (b : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {N : ZFSet.{u}} (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) +variable (hG : b.carrier ∈ M.sets) (hN : N ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) + +theorem smallFunctionActionGraph_mem : + letI := M.smallFunctionOrder s.carrier t.carrier N + (M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).actionGraph + (SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N)) b ∈ M.sets := by + let := M.smallFunctionOrder s.carrier t.carrier N + let act := M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph + let c := SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N) + have carrier := M.smallPartialFunctions_mem pairing unions powers separation hX hY hN + have bound := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hG carrier) carrier + let params := extend b.carrier (extend c.carrier (extend s.carrier (extend t.carrier + (extend (a.actionGraph s b) Fin.elim0)))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hG (Fin.cases carrier (Fin.cases hX (Fin.cases hY (Fin.cases graph (fun i => Fin.elim0 i))))) + have correct (z : ZFSet.{u}) : + BoundedFormula.Truth (BoundedFormula.smallActionEntryFormula 0 1 2 3 4 5) (extend z params) ↔ + z ∈ act.actionGraph c b := by + rw [BoundedFormula.truth_smallActionEntryFormula] + change (∃ g ∈ b.carrier, ∃ p ∈ c.carrier, ∃ q ∈ c.carrier, + z = ZFSet.pair (ZFSet.pair g p) q ∧ + RenameActionRelation s.carrier t.carrier (a.actionGraph s b) g p q) ↔ _ + constructor + · rintro ⟨g, hg, p, hp, q, hq, eq, relation⟩ + obtain ⟨g', rfl⟩ := (b.mem_carrier g).1 hg + obtain ⟨p', rfl⟩ := (c.mem_carrier p).1 hp + obtain ⟨q', rfl⟩ := (c.mem_carrier q).1 hq + rw [eq] + apply (act.triple_mem_actionGraph c b g' p' q').2 + apply SetMembers.raw_injective + rw [M.raw_smallFunctionAction] + exact (renameActionRelation_iff a s t b g' + (M.smallFunction_raw_properties s.carrier t.carrier N q').2.1.shape).1 relation + · intro hz + obtain ⟨⟨g, p⟩, eq⟩ := ((b.product c).mem_graph c (fun x => act.iso x.1 x.2) z).1 hz + refine ⟨b.encode g, b.encode_mem g, c.encode p, c.encode_mem p, + c.encode (act.iso g p), c.encode_mem (act.iso g p), eq.symm, ?_⟩ + apply (renameActionRelation_iff a s t b g + (M.smallFunction_raw_properties s.carrier t.carrier N (act.iso g p)).2.1.shape).2 + exact (M.raw_smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph g p).symm + have selected := M.bounded_separation_mem separation (BoundedFormula.smallActionEntryFormula 0 1 2 3 4 5) + params members bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.smallActionEntryFormula 0 1 2 3 4 5) + (extend z params)) (ZFSet.prod (ZFSet.prod b.carrier c.carrier) c.carrier) = act.actionGraph c b := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + exact ⟨fun h => (correct z).1 h.2, + fun hz => ⟨((b.product c).graph_isFunc c (fun x => act.iso x.1 x.2)).1 hz, (correct z).2 hz⟩⟩ + exact eq ▸ selected + +theorem smallFunction_conditionMapFamily_mem (collection : CollectionSchema M.sets) : + letI := M.smallFunctionOrder s.carrier t.carrier N + (M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph).conditionMapFamily + (SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N)) b ∈ M.sets := by + let := M.smallFunctionOrder s.carrier t.carrier N + exact M.conditionMapFamily_mem_of_actionGraph + (M.smallFunctionAction a s t b pairing unions powers separation hX hY hG hN graph) + (SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier N)) b + pairing unions powers separation collection + (M.smallPartialFunctions_mem pairing unions powers separation hX hY hN) hG + (M.smallFunctionActionGraph_mem a s t b pairing unions powers separation hX hY hG hN graph) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def rowUsedRows (I C Y p : ZFSet.{u}) : ZFSet.{u} := + relationImage (rowCoordinateDomain I C Y p) I (productFirst I C) + +theorem mem_rowUsedRows (I C Y p i : ZFSet.{u}) : + i ∈ rowUsedRows I C Y p ↔ + i ∈ I ∧ ∃ c ∈ C, ∃ y ∈ Y, ZFSet.pair (ZFSet.pair i c) y ∈ p := by + rw [rowUsedRows, mem_relationImage] + constructor + · rintro ⟨hi, x, hx, rel⟩ + obtain ⟨j, _, c, hc, eq⟩ := (mem_productFirst I C _).1 rel + have entries := ZFSet.pair_inj.1 eq + obtain ⟨_, y, hy, entry⟩ := (mem_rowCoordinateDomain I C Y p x).1 hx + rw [entries.1, ← entries.2] at entry + exact ⟨hi, c, hc, y, hy, entry⟩ + · rintro ⟨hi, c, hc, y, hy, entry⟩ + exact ⟨hi, ZFSet.pair i c, + (mem_rowCoordinateDomain I C Y p _).2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hc⟩, y, hy, entry⟩, + (mem_productFirst I C _).2 ⟨i, hi, c, hc, rfl⟩⟩ + +theorem rowUsedRows_subset (I C Y p : ZFSet.{u}) : rowUsedRows I C Y p ⊆ I := + fun i hi => ((mem_rowUsedRows I C Y p i).1 hi).1 + +theorem row_mem_rowUsedRows {I C Y p i c y : ZFSet.{u}} + (code : PartialFunctionCode (ZFSet.prod I C) Y p) + (entry : ZFSet.pair (ZFSet.pair i c) y ∈ p) : i ∈ rowUsedRows I C Y p := by + have bound := ZFSet.pair_mem_prod.1 (code.shape entry) + have coordinates := ZFSet.pair_mem_prod.1 bound.1 + exact (mem_rowUsedRows I C Y p i).2 ⟨coordinates.1, c, coordinates.2, y, bound.2, entry⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem rowUsedRows_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.sets) : rowUsedRows I C Y p ∈ M.sets := + M.relationImage_mem separation + (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hI + (M.productFirst_mem pairing unions powers separation hI hC) + +theorem rowUsedRows_groundEmbeddable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) + (small : M.groundEmbeddable p N) : M.groundEmbeddable (rowUsedRows I C Y p) N := + M.groundEmbeddable_function_image pairing unions powers separation choice + (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hI hN + (M.productFirst_mem pairing unions powers separation hI hC) (productFirst_function I C) + (M.rowCoordinateDomain_groundEmbeddable pairing unions powers separation choice hI hC hY hp hN small) + +theorem countablePartialFunctions_rowSupport + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) + (hp : p ∈ M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) : + rowUsedRows I C Y p ∈ M.sets ∧ M.groundEmbeddable (rowUsedRows I C Y p) ZFSet.omega := by + obtain ⟨ground, _, small⟩ := (M.mem_smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega p).1 hp + exact ⟨M.rowUsedRows_mem pairing unions powers separation hI hC hY ground, + M.rowUsedRows_groundEmbeddable pairing unions powers separation choice + hI hC hY ground (M.omega_mem separation infinite) small⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +@[instance_reducible] +def columnOrder (C : ZFSet.{u}) : PartialOrder (SetMembers C) where + le := Eq + le_refl _ := rfl + le_trans _ _ _ := Eq.trans + le_antisymm _ _ h _ := h + +noncomputable def rowCoordinatePresentation {L : Type u} [Bot L] + (s : Presentation L) (C : ZFSet.{u}) : + Presentation ({i : L // i ≠ ⊥} × SetMembers C) := + s.nonbottom.product (SetMembers.presentation C) + +namespace PosetAction + +variable {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] + +noncomputable def rowCoordinates (a : PosetAction G L) (C : ZFSet.{u}) : + letI := columnOrder C + PosetAction G ({i : L // i ≠ ⊥} × SetMembers C) := by + letI := columnOrder C + exact a.nonbottom.productColumns (SetMembers C) + +theorem rowCoordinates_apply (a : PosetAction G L) (C : ZFSet.{u}) : + letI := columnOrder C + ∀ (g : G) (i : {i : L // i ≠ ⊥}) (c : SetMembers C), + (a.rowCoordinates C).iso g (i, c) = (a.nonbottom.iso g i, c) := by + let := columnOrder C + intro g i c + rfl + +end PosetAction + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem rowCoordinate_carrier_mem {L : Type u} [Bot L] + (s : Presentation L) (C : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) : + (rowCoordinatePresentation s C).carrier ∈ M.sets := + M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + +theorem rowCoordinate_graph_mem {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] + (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) + (graph : a.actionGraph s b ∈ M.sets) : + letI := columnOrder C + (a.rowCoordinates C).actionGraph (rowCoordinatePresentation s C) b ∈ M.sets := by + let := columnOrder C + exact M.productColumns_actionGraph_mem a.nonbottom s.nonbottom (SetMembers.presentation C) b + pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC hG + (M.nonbottom_actionGraph_mem a s b separation hL hG graph) + +variable {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +noncomputable def internalRowAction : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + PosetAction G (SetMembers + (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by + letI := columnOrder C + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + exact M.smallFunctionAction (a.rowCoordinates C) (rowCoordinatePresentation s C) + (natInitialPresentation 2) b pairing unions powers separation + (M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC) + (M.natSetCode_mem separation infinite 2) hG (M.omega_mem separation infinite) + (M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph) + +theorem internalRowAction_entry : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ (g : G) (p : SetMembers + (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) + (i : {i : L // i ≠ ⊥}) (c : SetMembers C) (k : Fin 2), + ZFSet.pair (ZFSet.pair (s.encode (a.iso g i.val)) (SetMembers.raw c)) (natSetCode k.val) ∈ + SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite + hL hC hG graph).iso g p) ↔ + ZFSet.pair (ZFSet.pair (s.encode i.val) (SetMembers.raw c)) (natSetCode k.val) ∈ + SetMembers.raw p := by + let := columnOrder C + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro g p i c k + exact M.smallFunctionAction_entry (a.rowCoordinates C) (rowCoordinatePresentation s C) + (natInitialPresentation 2) b pairing unions powers separation + (M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC) + (M.natSetCode_mem separation infinite 2) hG (M.omega_mem separation infinite) + (M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph) + g p (i, c) (ULift.up k) + +theorem internalRowActionGraph_mem : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + (M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph).actionGraph + (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) b ∈ + M.sets := by + let := columnOrder C + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + exact M.smallFunctionActionGraph_mem (a.rowCoordinates C) (rowCoordinatePresentation s C) + (natInitialPresentation 2) b pairing unions powers separation + (M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC) + (M.natSetCode_mem separation infinite 2) hG (M.omega_mem separation infinite) + (M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem internalRowCondition_entry_shape {L : Type u} [Bot L] + (s : Presentation L) (C : ZFSet.{u}) + (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) + (z : ZFSet.{u}) (hz : z ∈ SetMembers.raw p) : + ∃ i : {i : L // i ≠ ⊥}, ∃ c ∈ C, ∃ y ∈ natSetCode 2, + z = ZFSet.pair (ZFSet.pair (s.encode i.val) c) y := by + have shape := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega p).2.1.shape hz + obtain ⟨ic, hic, y, hy, eq⟩ := ZFSet.mem_prod.1 shape + obtain ⟨r, hr, c, hc, rfl⟩ := ZFSet.mem_prod.1 hic + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier r).1 hr + exact ⟨i, c, hc, y, hy, eq⟩ + +variable {G L : Type u} [Group G] [PartialOrder L] [OrderBot L] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem internalRowAction_raw_entry : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ (g : G) (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) + (i : {i : L // i ≠ ⊥}) (c y : ZFSet.{u}), c ∈ C → y ∈ natSetCode 2 → + (ZFSet.pair (ZFSet.pair (s.encode (a.iso g i.val)) c) y ∈ + SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite + hL hC hG graph).iso g p) ↔ + ZFSet.pair (ZFSet.pair (s.encode i.val) c) y ∈ SetMembers.raw p) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro g p i c y hc hy + obtain ⟨k, eq⟩ := ((natInitialPresentation 2).mem_carrier y).1 hy + change natSetCode k.down.val = y at eq + have entry := M.internalRowAction_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p i (SetMembers.ofMem c hc) k.down + simpa only [SetMembers.raw_ofMem, eq] using entry + +theorem internalRowAction_usedRows : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ (g : G) (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) + (i : {i : L // i ≠ ⊥}), + s.encode (a.iso g i.val) ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) + (SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite + hL hC hG graph).iso g p)) ↔ + s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro g p i + rw [mem_rowUsedRows, mem_rowUsedRows] + constructor + · rintro ⟨_, c, hc, y, hy, entry⟩ + exact ⟨s.nonbottom.encode_mem i, c, hc, y, hy, + (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p i c y hc hy).1 entry⟩ + · rintro ⟨_, c, hc, y, hy, entry⟩ + exact ⟨s.nonbottom.encode_mem (a.nonbottom.iso g i), c, hc, y, hy, + (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p i c y hc hy).2 entry⟩ + +theorem internalRowAction_eq_of_fixes_usedRows : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ (g : G) (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + (∀ i : {i : L // i ≠ ⊥}, + s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → + a.iso g i.val = i.val) → + (M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph).iso g p = p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro g p fixed + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + change act.iso g p = p + apply SetMembers.raw_injective + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨i, c, hc, y, hy, eq⟩ := M.internalRowCondition_entry_shape s C (act.iso g p) z hz + let j := (a.nonbottom.iso g).symm i + have image : a.iso g j.val = i.val := + congrArg Subtype.val ((a.nonbottom.iso g).apply_symm_apply i) + have moved : ZFSet.pair (ZFSet.pair (s.encode (a.iso g j.val)) c) y ∈ + SetMembers.raw (act.iso g p) := by + rw [image, ← eq] + exact hz + have old := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p j c y hc hy).1 moved + have used := row_mem_rowUsedRows (M.smallFunction_raw_properties + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega p).2.1 old + have rowEq : j.val = i.val := (fixed j used).symm.trans image + rw [rowEq] at old + exact eq.symm ▸ old + · intro hz + obtain ⟨i, c, hc, y, hy, eq⟩ := M.internalRowCondition_entry_shape s C p z hz + have old : ZFSet.pair (ZFSet.pair (s.encode i.val) c) y ∈ SetMembers.raw p := by + rw [← eq] + exact hz + have used := row_mem_rowUsedRows (M.smallFunction_raw_properties + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega p).2.1 old + have moved := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p i c y hc hy).2 old + rw [fixed i used] at moved + exact eq.symm ▸ moved + +theorem internalRowAction_eq_of_principalFix : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ (g : G) (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (D : L), + (∀ i : {i : L // i ≠ ⊥}, + s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → + g ∈ a.principalFix D → + (M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph).iso g p = p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro g p D bound fixed + exact M.internalRowAction_eq_of_fixes_usedRows a s b C pairing unions powers separation infinite + hL hC hG graph g p (fun i used => fixed i.val (bound i used)) + +theorem internalRowAction_usedRows_bounded : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ (g : G) (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (D : L), + (∀ i : {i : L // i ≠ ⊥}, + s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → + ∀ i : {i : L // i ≠ ⊥}, + s.encode i.val ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) + (SetMembers.raw ((M.internalRowAction a s b C pairing unions powers separation infinite + hL hC hG graph).iso g p)) → i.val ≤ a.iso g D := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro g p D bound i used + let j := (a.nonbottom.iso g).symm i + have image : a.iso g j.val = i.val := + congrArg Subtype.val ((a.nonbottom.iso g).apply_symm_apply i) + have old := (M.internalRowAction_usedRows a s b C pairing unions powers separation infinite + hL hC hG graph g p j).1 (by rw [image]; exact used) + have mapped := (a.iso g).monotone (bound j old) + rw [image] at mapped + exact mapped + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] + +noncomputable def internalRowName (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) (i : {i : L // i ≠ ⊥}) : + Name (SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + exact M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val) + +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem internalRowName_action (g : G) (i : {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + act.act c g (M.internalRowName s C hL i) = + M.internalRowName s C hL (a.nonbottom.iso g i) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + change act.act c g (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val)) = + M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode (a.iso g i.val)) + apply Name.ext + intro σ q + change Name.Entry σ (Name.rename c (act.iso g) + (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val))) q ↔ _ + rw [Name.entry_rename, M.entry_binaryRowName] + constructor + · rintro ⟨ν, p, entry, eq, rfl⟩ + obtain ⟨x, hx, rfl, hp⟩ := (M.entry_binaryRowName s.nonbottom.carrier C ⊤ + (s.encode i.val) ν p).1 entry + refine ⟨x, hx, (act.act_check c g x).symm.trans eq, ?_⟩ + have moved := M.internalRowAction_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p i (SetMembers.ofMem x hx) (1 : Fin 2) + simp only [SetMembers.raw_ofMem] at moved + exact moved.2 hp + · rintro ⟨x, hx, rfl, hq⟩ + let p := (act.iso g).symm q + have pq : act.iso g p = q := (act.iso g).apply_symm_apply q + have moved := M.internalRowAction_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p i (SetMembers.ofMem x hx) (1 : Fin 2) + simp only [SetMembers.raw_ofMem] at moved + have hp : ZFSet.pair (ZFSet.pair (s.encode i.val) x) (natSetCode 1) ∈ + SetMembers.raw p := by + apply moved.1 + change ZFSet.pair (ZFSet.pair (s.encode (a.iso g i.val)) x) (natSetCode 1) ∈ + SetMembers.raw (act.iso g p) + rw [pq] + exact hq + exact ⟨Name.check c ⊤ x, p, + (M.entry_binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val) _ p).2 + ⟨x, hx, rfl, hp⟩, act.act_check c g x, pq⟩ + +theorem internalRowName_supported (i : {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + a.principalFix i.val ≤ act.stabilizer c (M.internalRowName s C hL i) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act c g fixed + change act.act c g (M.internalRowName s C hL i) = M.internalRowName s C hL i + rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph] + apply congrArg (M.internalRowName s C hL) + exact Subtype.ext (fixed i.val le_rfl) + +theorem internalRowName_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + (i : {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) (M.internalRowName s C hL i) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + refine HereditarilySymmetric.mk ⟨i.val, + M.internalRowName_supported a s b C pairing unions powers separation infinite hL hC hG graph i⟩ ?_ + intro σ p entry + obtain ⟨x, _, rfl, _⟩ := (M.entry_binaryRowName s.nonbottom.carrier C ⊤ + (s.encode i.val) σ p).1 entry + exact HereditarilySymmetric.check act c (a.principalSupportFamily ⊥ directed) x + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] + +noncomputable def internalRowSetName (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) : + Name (SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + exact M.binaryRowSetName s.nonbottom.carrier C ⊤ + +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem internalRowSetName_action (g : G) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + act.act c g (M.internalRowSetName s C hL) = M.internalRowSetName s C hL := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + change act.act c g (M.binaryRowSetName s.nonbottom.carrier C ⊤) = + M.binaryRowSetName s.nonbottom.carrier C ⊤ + apply Name.ext + intro σ q + change Name.Entry σ (Name.rename c (act.iso g) + (M.binaryRowSetName s.nonbottom.carrier C ⊤)) q ↔ _ + rw [Name.entry_rename, M.entry_binaryRowSetName] + constructor + · rintro ⟨ν, p, entry, eq, rfl⟩ + obtain ⟨x, hx, rfl, rfl⟩ := (M.entry_binaryRowSetName s.nonbottom.carrier C ⊤ ν p).1 entry + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx + refine ⟨s.nonbottom.encode (a.nonbottom.iso g i), s.nonbottom.encode_mem _, ?_, + (act.iso g).map_top.symm⟩ + have moved := M.internalRowName_action a s b C pairing unions powers separation infinite + hL hC hG graph g i + exact moved.symm.trans eq + · rintro ⟨x, hx, rfl, rfl⟩ + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx + let j := (a.nonbottom.iso g).symm i + refine ⟨M.internalRowName s C hL j, ⊤, + (M.entry_binaryRowSetName s.nonbottom.carrier C ⊤ _ ⊤).2 + ⟨s.nonbottom.encode j, s.nonbottom.encode_mem j, rfl, rfl⟩, ?_, + (act.iso g).map_top⟩ + change act.act c g (M.internalRowName s C hL j) = M.internalRowName s C hL i + rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph] + exact congrArg (M.internalRowName s C hL) ((a.nonbottom.iso g).apply_symm_apply i) + +theorem internalRowSetName_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) (M.internalRowSetName s C hL) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + refine HereditarilySymmetric.mk ⟨⊥, ?_⟩ ?_ + · intro g _ + exact M.internalRowSetName_action a s b C pairing unions powers separation infinite hL hC hG graph g + · intro σ p entry + obtain ⟨x, hx, rfl, _⟩ := (M.entry_binaryRowSetName s.nonbottom.carrier C ⊤ σ p).1 entry + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx + exact M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +noncomputable def outsideRowIndices {L : Type u} [PartialOrder L] [OrderBot L] + (s : Presentation L) (B : L) : ZFSet.{u} := + ZFSet.sep (fun x => ZFSet.pair x (s.encode B) ∉ s.conditionOrder) s.nonbottom.carrier + +theorem outsideRowIndices_subset {L : Type u} [PartialOrder L] [OrderBot L] + (s : Presentation L) (B : L) : outsideRowIndices s B ⊆ s.nonbottom.carrier := + fun _ hx => (ZFSet.mem_sep.1 hx).1 + +theorem encode_mem_outsideRowIndices {L : Type u} [PartialOrder L] [OrderBot L] + (s : Presentation L) (B : L) (i : {i : L // i ≠ ⊥}) : + s.encode i.val ∈ outsideRowIndices s B ↔ ¬ i.val ≤ B := by + rw [outsideRowIndices, ZFSet.mem_sep, s.pair_mem_conditionOrder] + exact ⟨And.right, fun hi => ⟨s.nonbottom.encode_mem i, hi⟩⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +noncomputable def binaryRowSubsetName (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (J : ZFSet.{u}) : + Name (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) := + Name.assemble (fun i : SetMembers J => M.binaryRowName I C one (SetMembers.raw i)) (fun _ => one) + +theorem entry_binaryRowSubsetName (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (J : ZFSet.{u}) + (σ : Name (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) + (p : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) : + Name.Entry σ (M.binaryRowSubsetName I C one J) p ↔ + ∃ i ∈ J, M.binaryRowName I C one i = σ ∧ one = p := by + rw [binaryRowSubsetName, Name.entry_assemble] + constructor + · rintro ⟨i, eq, condition⟩ + exact ⟨SetMembers.raw i, SetMembers.raw_mem i, eq, condition⟩ + · rintro ⟨i, hi, eq, condition⟩ + exact ⟨SetMembers.ofMem i hi, by simpa only [SetMembers.raw_ofMem] using eq, condition⟩ + +theorem mem_binaryRowSubsetName_code (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (J z : ZFSet.{u}) : + z ∈ (M.binaryRowSubsetName I C one J).val ↔ ∃ i ∈ J, + z = ZFSet.pair (M.binaryRowName I C one i).val (SetMembers.raw one) := by + change z ∈ ZFSet.range _ ↔ _ + rw [ZFSet.mem_range] + constructor + · rintro ⟨i, eq⟩ + exact ⟨SetMembers.raw i, SetMembers.raw_mem i, eq.symm⟩ + · rintro ⟨i, hi, eq⟩ + refine ⟨SetMembers.ofMem i hi, ?_⟩ + simpa only [SetMembers.presentation, SetMembers.raw_ofMem] using eq.symm + +theorem eval_binaryRowSubsetName (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (J : ZFSet.{u}) : + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), H.mem one → + Name.eval {p | H.mem p} (M.binaryRowSubsetName I C one J) = + ZFSet.range (fun i : SetMembers J => M.binaryGenericRow I C H (SetMembers.raw i)) := by + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + intro H hone + apply ZFSet.ext + intro x + rw [binaryRowSubsetName, Name.mem_eval_assemble, ZFSet.mem_range] + constructor + · rintro ⟨i, _, eq⟩ + rw [M.eval_binaryRowName I C one H hone] at eq + exact ⟨i, eq⟩ + · rintro ⟨i, eq⟩ + exact ⟨i, hone, (M.eval_binaryRowName I C one H hone (SetMembers.raw i)).trans eq⟩ + +theorem eval_binaryRowSubsetName_subset (I C : ZFSet.{u}) + (one : SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) + (J : ZFSet.{u}) (subset : J ⊆ I) + (H : Set (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) : + Name.eval H (M.binaryRowSubsetName I C one J) ⊆ Name.eval H (M.binaryRowSetName I C one) := by + intro x hx + obtain ⟨σ, p, entry, hp, eq⟩ := (Name.mem_eval H _ x).1 hx + obtain ⟨i, hi, child, condition⟩ := (M.entry_binaryRowSubsetName I C one J σ p).1 entry + exact (Name.mem_eval H _ x).2 ⟨σ, p, + (M.entry_binaryRowSetName I C one σ p).2 ⟨i, subset hi, child, condition⟩, hp, eq⟩ + +variable {L G : Type u} [Group G] [PartialOrder L] [OrderBot L] + +noncomputable def internalOutsideRowsName (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) (B : L) : + Name (SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) := by + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + exact M.binaryRowSubsetName s.nonbottom.carrier C ⊤ (outsideRowIndices s B) + +theorem entry_internalOutsideRowsName (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) (B : L) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + ∀ (σ : Name (SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) + (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + Name.Entry σ (M.internalOutsideRowsName s C hL B) p ↔ + ∃ i : {i : L // i ≠ ⊥}, ¬ i.val ≤ B ∧ M.internalRowName s C hL i = σ ∧ ⊤ = p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro σ p + rw [internalOutsideRowsName, M.entry_binaryRowSubsetName] + constructor + · rintro ⟨x, hx, child, condition⟩ + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier x).1 (outsideRowIndices_subset s B hx) + exact ⟨i, (encode_mem_outsideRowIndices s B i).1 hx, child, condition⟩ + · rintro ⟨i, hi, child, condition⟩ + exact ⟨s.encode i.val, (encode_mem_outsideRowIndices s B i).2 hi, child, condition⟩ + +theorem mem_eval_internalOutsideRowsName (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) (B : L) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) (x : ZFSet.{u}), + x ∈ Name.eval {p | H.mem p} (M.internalOutsideRowsName s C hL B) ↔ + ∃ i : {i : L // i ≠ ⊥}, ¬ i.val ≤ B ∧ + M.binaryGenericRow s.nonbottom.carrier C H (s.encode i.val) = x := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro H x + rw [Name.mem_eval] + constructor + · rintro ⟨σ, p, entry, _, eq⟩ + obtain ⟨i, hi, rfl, _⟩ := (M.entry_internalOutsideRowsName s C hL B σ p).1 entry + change Name.eval {p | H.mem p} (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode i.val)) = x at eq + rw [M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem] at eq + exact ⟨i, hi, eq⟩ + · rintro ⟨i, hi, eq⟩ + exact ⟨M.internalRowName s C hL i, ⊤, + (M.entry_internalOutsideRowsName s C hL B _ ⊤).2 ⟨i, hi, rfl, rfl⟩, H.top_mem, + (M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem (s.encode i.val)).trans eq⟩ + +theorem eval_internalOutsideRowsName_subset (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) (B : L) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + Name.eval {p | H.mem p} (M.internalOutsideRowsName s C hL B) ⊆ + Name.eval {p | H.mem p} (M.internalRowSetName s C hL) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro H + exact M.eval_binaryRowSubsetName_subset s.nonbottom.carrier C ⊤ (outsideRowIndices s B) + (outsideRowIndices_subset s B) {p | H.mem p} + +theorem eval_internalOutsideRowsName_nonempty (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) (B : L) (outside : ∃ i : L, ¬ i ≤ B) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + (Name.eval {p | H.mem p} (M.internalOutsideRowsName s C hL B)).Nonempty := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro H + obtain ⟨i, hi⟩ := outside + have nonbottom : i ≠ ⊥ := by + intro eq + exact hi (eq ▸ bot_le) + exact ⟨M.binaryGenericRow s.nonbottom.carrier C H (s.encode i), + (M.mem_eval_internalOutsideRowsName s C hL B H _).2 ⟨⟨i, nonbottom⟩, hi, rfl⟩⟩ + +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem internalOutsideRowsName_action (B : L) (g : G) (fixed : g ∈ a.principalFix B) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + act.act c g (M.internalOutsideRowsName s C hL B) = M.internalOutsideRowsName s C hL B := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + have preserves (i : {i : L // i ≠ ⊥}) : + ¬ (a.nonbottom.iso g i).val ≤ B ↔ ¬ i.val ≤ B := by + apply not_congr + change a.iso g i.val ≤ B ↔ i.val ≤ B + calc + a.iso g i.val ≤ B ↔ a.iso g i.val ≤ a.iso g B := by rw [fixed B le_rfl] + _ ↔ i.val ≤ B := (a.iso g).map_rel_iff + apply Name.ext + intro σ q + change Name.Entry σ (Name.rename c (act.iso g) (M.internalOutsideRowsName s C hL B)) q ↔ _ + rw [Name.entry_rename, M.entry_internalOutsideRowsName] + constructor + · rintro ⟨ν, p, entry, eq, rfl⟩ + obtain ⟨i, hi, rfl, rfl⟩ := (M.entry_internalOutsideRowsName s C hL B ν p).1 entry + refine ⟨a.nonbottom.iso g i, (preserves i).2 hi, ?_, (act.iso g).map_top.symm⟩ + have moved := M.internalRowName_action a s b C pairing unions powers separation infinite + hL hC hG graph g i + exact moved.symm.trans eq + · rintro ⟨i, hi, rfl, rfl⟩ + let j := (a.nonbottom.iso g).symm i + have image : a.nonbottom.iso g j = i := (a.nonbottom.iso g).apply_symm_apply i + have outside : ¬ j.val ≤ B := (preserves j).1 (by rw [image]; exact hi) + refine ⟨M.internalRowName s C hL j, ⊤, + (M.entry_internalOutsideRowsName s C hL B _ ⊤).2 ⟨j, outside, rfl, rfl⟩, ?_, + (act.iso g).map_top⟩ + change act.act c g (M.internalRowName s C hL j) = M.internalRowName s C hL i + rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph] + exact congrArg (M.internalRowName s C hL) image + +theorem internalOutsideRowsName_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) (B : L) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) (M.internalOutsideRowsName s C hL B) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + refine HereditarilySymmetric.mk ⟨B, ?_⟩ ?_ + · intro g fixed + exact M.internalOutsideRowsName_action a s b C pairing unions powers separation infinite + hL hC hG graph B g fixed + · intro σ p entry + obtain ⟨i, _, rfl, _⟩ := (M.entry_internalOutsideRowsName s C hL B σ p).1 entry + exact M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPairNameFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPairNameFamilies.lean index fe0d84be9137ac36b48ccecd148ed38fe35952fc..a3968ec53fde2b0376499016ab31ac87f62208b5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPairNameFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPairNameFamilies.lean @@ -1,115 +1,115 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula - -def orderedPairNameFamilyMemberFormula {n} (z one X Y : Fin n) : SetFormula n := - ex (.conj (.mem 0 X.succ) (ex (.conj (.mem 0 Y.succ.succ) - (orderedPairNameCodeFormula z.succ.succ 1 0 one.succ.succ)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def pairNameFamilyBound (one X Y : ZFSet.{u}) : ZFSet.{u} := - M.groundPower (ZFSet.prod (M.groundPower (ZFSet.prod (X ∪ Y) {one})) {one}) - -theorem pairNameFamilyBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {one X Y : ZFSet.{u}} (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - M.pairNameFamilyBound one X Y ∈ M.sets := by - have hs : ({one} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hone hone - exact M.groundPower_mem powers - (M.prod_mem pairing unions powers separation - (M.groundPower_mem powers (M.prod_mem pairing unions powers separation - (M.binary_union_mem pairing unions hX hY) hs)) hs) - -theorem orderedPairNameFamily_subset_bound - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {one X Y : ZFSet.{u}} (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - orderedPairNameFamily one X Y ⊆ M.pairNameFamilyBound one X Y := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := (mem_orderedPairNameFamily one X Y z).1 hz - have hxM := M.transitive hX hx - have hyM := M.transitive hY hy - have hxB : x ∈ X ∪ Y := ZFSet.mem_union.2 (Or.inl hx) - have hyB : y ∈ X ∪ Y := ZFSet.mem_union.2 (Or.inr hy) - have first : pairNameCode one x x ∈ M.groundPower (ZFSet.prod (X ∪ Y) {one}) := - (M.mem_groundPower _ _).2 ⟨M.pairNameCode_mem pairing hone hxM hxM, - pairNameCode_subset hxB hxB⟩ - have second : pairNameCode one x y ∈ M.groundPower (ZFSet.prod (X ∪ Y) {one}) := - (M.mem_groundPower _ _).2 ⟨M.pairNameCode_mem pairing hone hxM hyM, - pairNameCode_subset hxB hyB⟩ - exact (M.mem_groundPower _ _).2 - ⟨M.orderedPairNameCode_mem pairing hone hxM hyM, pairNameCode_subset first second⟩ - -theorem realize_orderedPairNameFamilyMemberFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n} (z one X Y : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (orderedPairNameFamilyMemberFormula z one X Y) env ↔ - env z ∈ orderedPairNameFamily (env one) (env X) (env Y) := by - rw [orderedPairNameFamilyMemberFormula, realize_ex, mem_orderedPairNameFamily] - constructor - · rintro ⟨x, hxM, hx, rest⟩ - obtain ⟨y, hyM, hy, named⟩ := (realize_ex M.sets _ _).1 rest - exact ⟨x, hx, y, hy, (M.realize_orderedPairNameCodeFormula pairing - z.succ.succ 1 0 one.succ.succ _ (Fin.cases hyM (Fin.cases hxM members))).1 named⟩ - · rintro ⟨x, hx, y, hy, equal⟩ - have hxM := M.transitive (members X) hx - have hyM := M.transitive (members Y) hy - refine ⟨x, hxM, hx, ?_⟩ - rw [realize_ex] - exact ⟨y, hyM, hy, (M.realize_orderedPairNameCodeFormula pairing - z.succ.succ 1 0 one.succ.succ _ (Fin.cases hyM (Fin.cases hxM members))).2 equal⟩ - -theorem orderedPairNameFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {one X Y : ZFSet.{u}} (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - orderedPairNameFamily one X Y ∈ M.sets := by - let params := extend one (extend X (extend Y Fin.elim0)) - have members : ∀ j, params j ∈ M.sets := - Fin.cases hone (Fin.cases hX (Fin.cases hY (fun i => Fin.elim0 i))) - have hBound := M.pairNameFamilyBound_mem pairing unions powers separation hone hX hY - have subset := M.orderedPairNameFamily_subset_bound pairing hone hX hY - have selected := M.separation_mem separation (orderedPairNameFamilyMemberFormula 0 1 2 3) - params members hBound - have equal : ZFSet.sep (fun z => Realize M.sets (orderedPairNameFamilyMemberFormula 0 1 2 3) - (extend z params)) (M.pairNameFamilyBound one X Y) = orderedPairNameFamily one X Y := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, formula⟩ - exact (M.realize_orderedPairNameFamilyMemberFormula pairing 0 1 2 3 _ - (Fin.cases (M.transitive hBound hz) members)).1 formula - · intro hz - exact ⟨subset hz, (M.realize_orderedPairNameFamilyMemberFormula pairing 0 1 2 3 _ - (Fin.cases (M.transitive hBound (subset hz)) members)).2 hz⟩ - exact equal ▸ selected - -theorem iteratedPairNameFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {one T : ZFSet.{u}} (hone : one ∈ M.sets) (hT : T ∈ M.sets) (n : Nat) : - iteratedPairNameFamily one T n ∈ M.sets := by - induction n with - | zero => exact hT - | succ n ih => exact M.orderedPairNameFamily_mem pairing unions powers separation hone ih hT - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula + +def orderedPairNameFamilyMemberFormula {n} (z one X Y : Fin n) : SetFormula n := + ex (.conj (.mem 0 X.succ) (ex (.conj (.mem 0 Y.succ.succ) + (orderedPairNameCodeFormula z.succ.succ 1 0 one.succ.succ)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def pairNameFamilyBound (one X Y : ZFSet.{u}) : ZFSet.{u} := + M.groundPower (ZFSet.prod (M.groundPower (ZFSet.prod (X ∪ Y) {one})) {one}) + +theorem pairNameFamilyBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {one X Y : ZFSet.{u}} (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + M.pairNameFamilyBound one X Y ∈ M.sets := by + have hs : ({one} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hone hone + exact M.groundPower_mem powers + (M.prod_mem pairing unions powers separation + (M.groundPower_mem powers (M.prod_mem pairing unions powers separation + (M.binary_union_mem pairing unions hX hY) hs)) hs) + +theorem orderedPairNameFamily_subset_bound + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {one X Y : ZFSet.{u}} (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + orderedPairNameFamily one X Y ⊆ M.pairNameFamilyBound one X Y := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := (mem_orderedPairNameFamily one X Y z).1 hz + have hxM := M.transitive hX hx + have hyM := M.transitive hY hy + have hxB : x ∈ X ∪ Y := ZFSet.mem_union.2 (Or.inl hx) + have hyB : y ∈ X ∪ Y := ZFSet.mem_union.2 (Or.inr hy) + have first : pairNameCode one x x ∈ M.groundPower (ZFSet.prod (X ∪ Y) {one}) := + (M.mem_groundPower _ _).2 ⟨M.pairNameCode_mem pairing hone hxM hxM, + pairNameCode_subset hxB hxB⟩ + have second : pairNameCode one x y ∈ M.groundPower (ZFSet.prod (X ∪ Y) {one}) := + (M.mem_groundPower _ _).2 ⟨M.pairNameCode_mem pairing hone hxM hyM, + pairNameCode_subset hxB hyB⟩ + exact (M.mem_groundPower _ _).2 + ⟨M.orderedPairNameCode_mem pairing hone hxM hyM, pairNameCode_subset first second⟩ + +theorem realize_orderedPairNameFamilyMemberFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n} (z one X Y : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (orderedPairNameFamilyMemberFormula z one X Y) env ↔ + env z ∈ orderedPairNameFamily (env one) (env X) (env Y) := by + rw [orderedPairNameFamilyMemberFormula, realize_ex, mem_orderedPairNameFamily] + constructor + · rintro ⟨x, hxM, hx, rest⟩ + obtain ⟨y, hyM, hy, named⟩ := (realize_ex M.sets _ _).1 rest + exact ⟨x, hx, y, hy, (M.realize_orderedPairNameCodeFormula pairing + z.succ.succ 1 0 one.succ.succ _ (Fin.cases hyM (Fin.cases hxM members))).1 named⟩ + · rintro ⟨x, hx, y, hy, equal⟩ + have hxM := M.transitive (members X) hx + have hyM := M.transitive (members Y) hy + refine ⟨x, hxM, hx, ?_⟩ + rw [realize_ex] + exact ⟨y, hyM, hy, (M.realize_orderedPairNameCodeFormula pairing + z.succ.succ 1 0 one.succ.succ _ (Fin.cases hyM (Fin.cases hxM members))).2 equal⟩ + +theorem orderedPairNameFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {one X Y : ZFSet.{u}} (hone : one ∈ M.sets) (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + orderedPairNameFamily one X Y ∈ M.sets := by + let params := extend one (extend X (extend Y Fin.elim0)) + have members : ∀ j, params j ∈ M.sets := + Fin.cases hone (Fin.cases hX (Fin.cases hY (fun i => Fin.elim0 i))) + have hBound := M.pairNameFamilyBound_mem pairing unions powers separation hone hX hY + have subset := M.orderedPairNameFamily_subset_bound pairing hone hX hY + have selected := M.separation_mem separation (orderedPairNameFamilyMemberFormula 0 1 2 3) + params members hBound + have equal : ZFSet.sep (fun z => Realize M.sets (orderedPairNameFamilyMemberFormula 0 1 2 3) + (extend z params)) (M.pairNameFamilyBound one X Y) = orderedPairNameFamily one X Y := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, formula⟩ + exact (M.realize_orderedPairNameFamilyMemberFormula pairing 0 1 2 3 _ + (Fin.cases (M.transitive hBound hz) members)).1 formula + · intro hz + exact ⟨subset hz, (M.realize_orderedPairNameFamilyMemberFormula pairing 0 1 2 3 _ + (Fin.cases (M.transitive hBound (subset hz)) members)).2 hz⟩ + exact equal ▸ selected + +theorem iteratedPairNameFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {one T : ZFSet.{u}} (hone : one ∈ M.sets) (hT : T ∈ M.sets) (n : Nat) : + iteratedPairNameFamily one T n ∈ M.sets := by + induction n with + | zero => exact hT + | succ n ih => exact M.orderedPairNameFamily_mem pairing unions powers separation hone ih hT + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparationForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparationForcing.lean index 49e473ce5897aca9de0f3a844b22658c55591783..a55c2d531f9063389e0b2a126d22da6be24f1ef1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparationForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparationForcing.lean @@ -1,264 +1,264 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.VisibilityProfileFormulas - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) - -private theorem visibilityValues_isName (T : ZFSet.{u}) (K : I → Subgroup G) - (i : b.carrier.toSet) : - IsName s ((M.niceVisibilityGraph_function a s b T K).value i) := by - obtain ⟨v, equal⟩ := (b.mem_carrier i.val).1 i.property - have entry : ZFSet.pair i.val (M.niceVisibilityName a s T (K v)).val ∈ - M.niceVisibilityGraph a s b T K := by - rw [← equal] - exact (M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl - rw [(M.niceVisibilityGraph_function a s b T K).value_eq_of_entry i entry] - exact (M.niceVisibilityName a s T (K v)).property - -noncomputable def niceVisibilityEvaluationName (T : ZFSet.{u}) (K : I → Subgroup G) : Name s := - Name.indexedGraphName ⊤ (M.niceVisibilityGraph_function a s b T K) - (visibilityValues_isName M a s b T K) - -theorem niceVisibilityEvaluationName_entry (T : ZFSet.{u}) (K : I → Subgroup G) - (H : ConditionFilter P) (v : I) (V : ZFSet.{u}) : - ZFSet.pair (b.encode v) V ∈ Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K) ↔ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v)) = V := by - let i : b.carrier.toSet := ⟨b.encode v, b.encode_mem v⟩ - have equal := (M.niceVisibilityGraph_function a s b T K).value_eq_of_entry i - ((M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl) - have names : (⟨(M.niceVisibilityGraph_function a s b T K).value i, - visibilityValues_isName M a s b T K i⟩ : Name s) = M.niceVisibilityName a s T (K v) := - Subtype.ext equal - exact (Name.pair_mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem - (M.niceVisibilityGraph_function a s b T K) (visibilityValues_isName M a s b T K) i V).trans - (by rw [names]) - -theorem niceVisibilityEvaluationName_mem (t : Presentation G) (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) : - (M.niceVisibilityEvaluationName a s b T K).val ∈ M.sets := by - exact M.indexedGraphName_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) nodes - (M.niceVisibilityGraph_mem a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid) - (M.niceVisibilityGraph_function a s b T K) (visibilityValues_isName M a s b T K) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) -variable (K : I → Subgroup G) - -def DecidesVisibilityProfile (T F : ZFSet.{u}) (z : Name s) (p : P) : Prop := - ∀ v : I, - (b.encode v ∈ F → Name.ForcesMem p z (M.niceVisibilityName a s T (K v))) ∧ - (b.encode v ∉ F → ∀ q : P, q ≤ p → ¬ Name.ForcesMem q z (M.niceVisibilityName a s T (K v))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -noncomputable def visibilityProfileEnv (F : ZFSet.{u}) (hF : F ∈ M.sets) - (z : (M.nameDomain s).names) : Assignment (M.nameDomain s) 4 := - ![z, ⟨M.niceVisibilityEvaluationName a s b T K, - M.niceVisibilityEvaluationName_mem a s b t K pairing unions powers separation collection - carrier group nodes supports maps hT valid⟩, - ⟨Name.check s ⊤ b.carrier, M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) b.carrier nodes⟩, - ⟨Name.check s ⊤ F, M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) F hF⟩] - -theorem realize_visibilityProfileEnv (F : ZFSet.{u}) (hF : F ∈ M.sets) - (z : (M.nameDomain s).names) (H : ConditionFilter P) : - Realize ((M.nameDomain s).values {p | H.mem p}) visibilityProfileFormula - (evalAssignment {p | H.mem p} - (M.visibilityProfileEnv a s t b K pairing unions powers separation collection carrier group nodes supports maps hT valid F hF z)) ↔ - ∀ v : I, Name.eval {p | H.mem p} z.val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v)) ↔ b.encode v ∈ F := by - let env := M.visibilityProfileEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid F hF z - let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, - (M.nameDomain s).values_transitive _⟩ - have fields : evalAssignment {p | H.mem p} env = - ![Name.eval {p | H.mem p} z.val, - Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K), b.carrier, F] := by - funext i - refine Fin.cases rfl (Fin.cases rfl (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)))) i - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - have meaning := N.realize_visibilityProfileFormula (evalAssignment {p | H.mem p} env) - (fun i => ⟨env i, rfl⟩) - rw [fields] at meaning - change Realize N.sets visibilityProfileFormula (evalAssignment {p | H.mem p} env) ↔ _ - rw [fields, meaning] - constructor - · intro allNodes v - have visibilityGround := M.niceVisibilityName_mem a s t b K pairing unions powers separation collection - carrier group supports maps hT valid v (M.transitive nodes (b.encode_mem v)) - exact allNodes (b.encode v) (b.encode_mem v) _ ⟨⟨_, visibilityGround⟩, rfl⟩ - ((M.niceVisibilityEvaluationName_entry a s b T K H v _).2 rfl) - · intro typed code hcode V hV entry - obtain ⟨v, rfl⟩ := (b.mem_carrier code).1 hcode - have equal := (M.niceVisibilityEvaluationName_entry a s b T K H v V).1 entry - exact equal ▸ typed v - -theorem forces_visibilityProfile_iff (small : M.sets.Countable) - (F : ZFSet.{u}) (hF : F ∈ M.sets) (z : (M.nameDomain s).names) (p : P) : - Forces (M.nameDomain s) visibilityProfileFormula - (M.visibilityProfileEnv a s t b K pairing unions powers separation collection carrier group nodes supports maps hT valid F hF z) p ↔ - M.DecidesVisibilityProfile a s b K T F z.val p := by - let env := M.visibilityProfileEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid F hF z - let vis (v : I) : (M.nameDomain s).names := ⟨M.niceVisibilityName a s T (K v), - M.niceVisibilityName_mem a s t b K pairing unions powers separation collection - carrier group supports maps hT valid v (M.transitive nodes (b.encode_mem v))⟩ - have global := M.ordinaryForces_iff_all_generics s small carrier visibilityProfileFormula env p - constructor - · intro forced v - have profile (H : ConditionFilter P) (hp : H.mem p) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) := - (M.realize_visibilityProfileEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid F hF z H).1 (global.1 forced H hp generic) v - constructor - · intro yes - apply (M.ordinaryForces_iff_all_generics s small carrier (.mem 0 1) ![z, vis v] p).2 - intro H hp generic - exact (profile H hp generic).2 yes - · intro no - change Forces (M.nameDomain s) (.neg (.mem 0 1)) ![z, vis v] p - apply (M.ordinaryForces_iff_all_generics s small carrier (.neg (.mem 0 1)) ![z, vis v] p).2 - intro H hp generic member - exact no ((profile H hp generic).1 member) - · intro decisions - apply global.2 - intro H hp generic - apply (M.realize_visibilityProfileEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid F hF z H).2 - intro v - by_cases member : b.encode v ∈ F - · have atom : Forces (M.nameDomain s) (.mem 0 1 : SetFormula 2) ![z, vis v] p := by - exact (decisions v).1 member - have positive := forces_sound (M.nameDomain s) H generic (.mem 0 1 : SetFormula 2) ![z, vis v] hp atom - exact ⟨fun _ => member, fun _ => positive⟩ - · have atom : Forces (M.nameDomain s) (.neg (.mem 0 1) : SetFormula 2) ![z, vis v] p := by - exact (decisions v).2 member - have negative := forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1) : SetFormula 2) ![z, vis v] hp atom - exact ⟨fun yes => False.elim (negative yes), fun yes => False.elim (member yes)⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) -variable (K : I → Subgroup G) - -omit [OrderTop P] in -private theorem rawForces_pair_iff - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (phi : SetFormula 2) (p : P) (z tau : (M.nameDomain s).names) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi ![z.val.val, tau.val.val] ↔ - Forces (M.nameDomain s) phi ![z, tau] p := by - have fields : (fun j : Fin 2 => (![z, tau] j).val.val) = ![z.val.val, tau.val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)) j - have translated := M.stageOneRawForces_iff s pairing unions powers separation collection - carrier order phi p ![z, tau] - rw [fields] at translated - exact translated - -theorem preparationForcingCode_iff - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (T N : ZFSet.{u}) (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) - (namesGround : N ∈ M.sets) (valid : ∀ tau ∈ N, IsName s tau) - (z : (M.nameDomain s).names) (F f : ZFSet.{u}) - (range : f ⊆ ZFSet.prod b.carrier N) (p : P) : - PreparationForcingCode M s.carrier s.conditionOrder (s.encode p) b.carrier - (M.niceVisibilityGraph a s b T K) z.val.val F f ↔ - M.DecidesVisibilityProfile a s b K T F z.val p ∧ - ∀ v (tau : Name s), tau.val ∈ N → ZFSet.pair v tau.val ∈ f → - Name.ForcesEq p z.val tau := by - let vis (v : I) : (M.nameDomain s).names := - ⟨M.niceVisibilityName a s T (K v), - M.pair_right (M.transitive graphGround - ((M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl))⟩ - have memForces (v : I) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode p) - (.mem 0 1 : SetFormula 2) ![z.val.val, (vis v).val.val] ↔ - Name.ForcesMem p z.val (vis v).val := - rawForces_pair_iff M s pairing unions powers separation collection carrier order - (.mem 0 1 : SetFormula 2) p z (vis v) - have negForces (v : I) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode p) - (.neg (.mem 0 1) : SetFormula 2) ![z.val.val, (vis v).val.val] ↔ - ∀ q : P, q ≤ p → ¬ Name.ForcesMem q z.val (vis v).val := - rawForces_pair_iff M s pairing unions powers separation collection carrier order - (.neg (.mem 0 1) : SetFormula 2) p z (vis v) - have eqForces (tau : (M.nameDomain s).names) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode p) - (.equal 0 1 : SetFormula 2) ![z.val.val, tau.val.val] ↔ - Name.ForcesEq p z.val tau.val := - rawForces_pair_iff M s pairing unions powers separation collection carrier order - (.equal 0 1 : SetFormula 2) p z tau - constructor - · rintro ⟨profile, equalities⟩ - constructor - · intro v - have decisions := profile (b.encode v) (vis v).val.val - ((M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl) (b.encode_mem v) - exact ⟨fun yes => (memForces v).1 (decisions.1 yes), - fun no => (negForces v).1 (decisions.2 no)⟩ - · intro v tau htau entry - exact (eqForces ⟨tau, M.transitive namesGround htau⟩).1 (equalities v tau.val entry) - · rintro ⟨profile, equalities⟩ - constructor - · intro v V entry hv - obtain ⟨i, rfl⟩ := (b.mem_carrier v).1 hv - have eq := (M.pair_mem_niceVisibilityGraph a s b T K i V).1 entry - subst V - exact ⟨fun yes => (memForces i).2 ((profile i).1 yes), - fun no => (negForces i).2 ((profile i).2 no)⟩ - · intro v tau entry - have htau := (ZFSet.pair_mem_prod.1 (range entry)).2 - let name : (M.nameDomain s).names := ⟨⟨tau, valid tau htau⟩, M.transitive namesGround htau⟩ - exact (eqForces name).2 (equalities v name.val htau entry) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.VisibilityProfileFormulas + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) + +private theorem visibilityValues_isName (T : ZFSet.{u}) (K : I → Subgroup G) + (i : b.carrier.toSet) : + IsName s ((M.niceVisibilityGraph_function a s b T K).value i) := by + obtain ⟨v, equal⟩ := (b.mem_carrier i.val).1 i.property + have entry : ZFSet.pair i.val (M.niceVisibilityName a s T (K v)).val ∈ + M.niceVisibilityGraph a s b T K := by + rw [← equal] + exact (M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl + rw [(M.niceVisibilityGraph_function a s b T K).value_eq_of_entry i entry] + exact (M.niceVisibilityName a s T (K v)).property + +noncomputable def niceVisibilityEvaluationName (T : ZFSet.{u}) (K : I → Subgroup G) : Name s := + Name.indexedGraphName ⊤ (M.niceVisibilityGraph_function a s b T K) + (visibilityValues_isName M a s b T K) + +theorem niceVisibilityEvaluationName_entry (T : ZFSet.{u}) (K : I → Subgroup G) + (H : ConditionFilter P) (v : I) (V : ZFSet.{u}) : + ZFSet.pair (b.encode v) V ∈ Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K) ↔ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v)) = V := by + let i : b.carrier.toSet := ⟨b.encode v, b.encode_mem v⟩ + have equal := (M.niceVisibilityGraph_function a s b T K).value_eq_of_entry i + ((M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl) + have names : (⟨(M.niceVisibilityGraph_function a s b T K).value i, + visibilityValues_isName M a s b T K i⟩ : Name s) = M.niceVisibilityName a s T (K v) := + Subtype.ext equal + exact (Name.pair_mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem + (M.niceVisibilityGraph_function a s b T K) (visibilityValues_isName M a s b T K) i V).trans + (by rw [names]) + +theorem niceVisibilityEvaluationName_mem (t : Presentation G) (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) : + (M.niceVisibilityEvaluationName a s b T K).val ∈ M.sets := by + exact M.indexedGraphName_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) nodes + (M.niceVisibilityGraph_mem a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid) + (M.niceVisibilityGraph_function a s b T K) (visibilityValues_isName M a s b T K) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) +variable (K : I → Subgroup G) + +def DecidesVisibilityProfile (T F : ZFSet.{u}) (z : Name s) (p : P) : Prop := + ∀ v : I, + (b.encode v ∈ F → Name.ForcesMem p z (M.niceVisibilityName a s T (K v))) ∧ + (b.encode v ∉ F → ∀ q : P, q ≤ p → ¬ Name.ForcesMem q z (M.niceVisibilityName a s T (K v))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +noncomputable def visibilityProfileEnv (F : ZFSet.{u}) (hF : F ∈ M.sets) + (z : (M.nameDomain s).names) : Assignment (M.nameDomain s) 4 := + ![z, ⟨M.niceVisibilityEvaluationName a s b T K, + M.niceVisibilityEvaluationName_mem a s b t K pairing unions powers separation collection + carrier group nodes supports maps hT valid⟩, + ⟨Name.check s ⊤ b.carrier, M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) b.carrier nodes⟩, + ⟨Name.check s ⊤ F, M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) F hF⟩] + +theorem realize_visibilityProfileEnv (F : ZFSet.{u}) (hF : F ∈ M.sets) + (z : (M.nameDomain s).names) (H : ConditionFilter P) : + Realize ((M.nameDomain s).values {p | H.mem p}) visibilityProfileFormula + (evalAssignment {p | H.mem p} + (M.visibilityProfileEnv a s t b K pairing unions powers separation collection carrier group nodes supports maps hT valid F hF z)) ↔ + ∀ v : I, Name.eval {p | H.mem p} z.val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v)) ↔ b.encode v ∈ F := by + let env := M.visibilityProfileEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid F hF z + let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, + (M.nameDomain s).values_transitive _⟩ + have fields : evalAssignment {p | H.mem p} env = + ![Name.eval {p | H.mem p} z.val, + Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K), b.carrier, F] := by + funext i + refine Fin.cases rfl (Fin.cases rfl (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)))) i + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + have meaning := N.realize_visibilityProfileFormula (evalAssignment {p | H.mem p} env) + (fun i => ⟨env i, rfl⟩) + rw [fields] at meaning + change Realize N.sets visibilityProfileFormula (evalAssignment {p | H.mem p} env) ↔ _ + rw [fields, meaning] + constructor + · intro allNodes v + have visibilityGround := M.niceVisibilityName_mem a s t b K pairing unions powers separation collection + carrier group supports maps hT valid v (M.transitive nodes (b.encode_mem v)) + exact allNodes (b.encode v) (b.encode_mem v) _ ⟨⟨_, visibilityGround⟩, rfl⟩ + ((M.niceVisibilityEvaluationName_entry a s b T K H v _).2 rfl) + · intro typed code hcode V hV entry + obtain ⟨v, rfl⟩ := (b.mem_carrier code).1 hcode + have equal := (M.niceVisibilityEvaluationName_entry a s b T K H v V).1 entry + exact equal ▸ typed v + +theorem forces_visibilityProfile_iff (small : M.sets.Countable) + (F : ZFSet.{u}) (hF : F ∈ M.sets) (z : (M.nameDomain s).names) (p : P) : + Forces (M.nameDomain s) visibilityProfileFormula + (M.visibilityProfileEnv a s t b K pairing unions powers separation collection carrier group nodes supports maps hT valid F hF z) p ↔ + M.DecidesVisibilityProfile a s b K T F z.val p := by + let env := M.visibilityProfileEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid F hF z + let vis (v : I) : (M.nameDomain s).names := ⟨M.niceVisibilityName a s T (K v), + M.niceVisibilityName_mem a s t b K pairing unions powers separation collection + carrier group supports maps hT valid v (M.transitive nodes (b.encode_mem v))⟩ + have global := M.ordinaryForces_iff_all_generics s small carrier visibilityProfileFormula env p + constructor + · intro forced v + have profile (H : ConditionFilter P) (hp : H.mem p) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) := + (M.realize_visibilityProfileEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid F hF z H).1 (global.1 forced H hp generic) v + constructor + · intro yes + apply (M.ordinaryForces_iff_all_generics s small carrier (.mem 0 1) ![z, vis v] p).2 + intro H hp generic + exact (profile H hp generic).2 yes + · intro no + change Forces (M.nameDomain s) (.neg (.mem 0 1)) ![z, vis v] p + apply (M.ordinaryForces_iff_all_generics s small carrier (.neg (.mem 0 1)) ![z, vis v] p).2 + intro H hp generic member + exact no ((profile H hp generic).1 member) + · intro decisions + apply global.2 + intro H hp generic + apply (M.realize_visibilityProfileEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid F hF z H).2 + intro v + by_cases member : b.encode v ∈ F + · have atom : Forces (M.nameDomain s) (.mem 0 1 : SetFormula 2) ![z, vis v] p := by + exact (decisions v).1 member + have positive := forces_sound (M.nameDomain s) H generic (.mem 0 1 : SetFormula 2) ![z, vis v] hp atom + exact ⟨fun _ => member, fun _ => positive⟩ + · have atom : Forces (M.nameDomain s) (.neg (.mem 0 1) : SetFormula 2) ![z, vis v] p := by + exact (decisions v).2 member + have negative := forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1) : SetFormula 2) ![z, vis v] hp atom + exact ⟨fun yes => False.elim (negative yes), fun yes => False.elim (member yes)⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) +variable (K : I → Subgroup G) + +omit [OrderTop P] in +private theorem rawForces_pair_iff + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (phi : SetFormula 2) (p : P) (z tau : (M.nameDomain s).names) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi ![z.val.val, tau.val.val] ↔ + Forces (M.nameDomain s) phi ![z, tau] p := by + have fields : (fun j : Fin 2 => (![z, tau] j).val.val) = ![z.val.val, tau.val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)) j + have translated := M.stageOneRawForces_iff s pairing unions powers separation collection + carrier order phi p ![z, tau] + rw [fields] at translated + exact translated + +theorem preparationForcingCode_iff + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (T N : ZFSet.{u}) (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) + (namesGround : N ∈ M.sets) (valid : ∀ tau ∈ N, IsName s tau) + (z : (M.nameDomain s).names) (F f : ZFSet.{u}) + (range : f ⊆ ZFSet.prod b.carrier N) (p : P) : + PreparationForcingCode M s.carrier s.conditionOrder (s.encode p) b.carrier + (M.niceVisibilityGraph a s b T K) z.val.val F f ↔ + M.DecidesVisibilityProfile a s b K T F z.val p ∧ + ∀ v (tau : Name s), tau.val ∈ N → ZFSet.pair v tau.val ∈ f → + Name.ForcesEq p z.val tau := by + let vis (v : I) : (M.nameDomain s).names := + ⟨M.niceVisibilityName a s T (K v), + M.pair_right (M.transitive graphGround + ((M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl))⟩ + have memForces (v : I) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode p) + (.mem 0 1 : SetFormula 2) ![z.val.val, (vis v).val.val] ↔ + Name.ForcesMem p z.val (vis v).val := + rawForces_pair_iff M s pairing unions powers separation collection carrier order + (.mem 0 1 : SetFormula 2) p z (vis v) + have negForces (v : I) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode p) + (.neg (.mem 0 1) : SetFormula 2) ![z.val.val, (vis v).val.val] ↔ + ∀ q : P, q ≤ p → ¬ Name.ForcesMem q z.val (vis v).val := + rawForces_pair_iff M s pairing unions powers separation collection carrier order + (.neg (.mem 0 1) : SetFormula 2) p z (vis v) + have eqForces (tau : (M.nameDomain s).names) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode p) + (.equal 0 1 : SetFormula 2) ![z.val.val, tau.val.val] ↔ + Name.ForcesEq p z.val tau.val := + rawForces_pair_iff M s pairing unions powers separation collection carrier order + (.equal 0 1 : SetFormula 2) p z tau + constructor + · rintro ⟨profile, equalities⟩ + constructor + · intro v + have decisions := profile (b.encode v) (vis v).val.val + ((M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl) (b.encode_mem v) + exact ⟨fun yes => (memForces v).1 (decisions.1 yes), + fun no => (negForces v).1 (decisions.2 no)⟩ + · intro v tau htau entry + exact (eqForces ⟨tau, M.transitive namesGround htau⟩).1 (equalities v tau.val entry) + · rintro ⟨profile, equalities⟩ + constructor + · intro v V entry hv + obtain ⟨i, rfl⟩ := (b.mem_carrier v).1 hv + have eq := (M.pair_mem_niceVisibilityGraph a s b T K i V).1 entry + subst V + exact ⟨fun yes => (memForces i).2 ((profile i).1 yes), + fun no => (negForces i).2 ((profile i).2 no)⟩ + · intro v tau entry + have htau := (ZFSet.pair_mem_prod.1 (range entry)).2 + let name : (M.nameDomain s).names := ⟨⟨tau, valid tau htau⟩, M.transitive namesGround htau⟩ + exact (eqForces name).2 (equalities v name.val htau entry) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedCertificateActionPackages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedCertificateActionPackages.lean index a325ebad8c366fca56060fafd31a03eede697f74..528078386c547de8f464f5ee6ff5199f09acb9e5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedCertificateActionPackages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedCertificateActionPackages.lean @@ -1,593 +1,593 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundActedRepresentativeGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.PreparedCertificateCodes - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -theorem visibilityProfileImage_entry {L G : Type u} [Group G] [PartialOrder L] - (b : Presentation L) (d : PosetAction G L) (F : ZFSet.{u}) (g : G) (v : L) : - b.encode (d.iso g v) ∈ relationImage F b.carrier (b.graph b (d.iso g)) ↔ - b.encode v ∈ F := by - constructor - · intro member - obtain ⟨_, x, hx, edge⟩ := (mem_relationImage F b.carrier (b.graph b (d.iso g)) _).1 member - obtain ⟨w, equal⟩ := (b.mem_graph b (d.iso g) _).1 edge - have parts := ZFSet.pair_inj.1 equal - have same : w = v := (d.iso g).injective (b.injective parts.2) - subst w - rw [parts.1] - exact hx - · intro member - exact (mem_relationImage F b.carrier (b.graph b (d.iso g)) _).2 - ⟨b.encode_mem _, b.encode v, member, (b.pair_mem_graph b (d.iso g) v _).2 rfl⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - -include pairing unions powers separation collection carrier maps closed in -theorem decidesVisibilityProfile_act (F : ZFSet.{u}) (z : Name s) (p : P) (g : G) - (decisions : M.DecidesVisibilityProfile a s b d.principalFix T F z p) : - M.DecidesVisibilityProfile a s b d.principalFix T - (relationImage F b.carrier (b.graph b (d.iso g))) (a.act s g z) (a.iso g p) := by - intro w - obtain ⟨v, rfl⟩ := (d.iso g).surjective w - have profile := visibilityProfileImage_entry b d F g v - have visibility := M.act_niceVisibilityName a s t d pairing unions powers separation collection - carrier maps closed g v - constructor - · intro yes - have moved := a.forcesMem_act s g ((decisions v).1 (profile.1 yes)) - rw [visibility] at moved - exact moved - · intro no q qp bad - have oldq : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp - have moved : Name.ForcesMem (a.iso g ((a.iso g).symm q)) (a.act s g z) - (a.act s g (M.niceVisibilityName a s T (d.principalFix v))) := by - simpa only [OrderIso.apply_symm_apply, visibility] using bad - exact (decisions v).2 (fun yes => no (profile.2 yes)) _ oldq - ((a.forcesMem_act_iff s g _ _ _).1 moved) - -include closed in -theorem forces_visibilityProfile_act - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) (small : M.sets.Countable) - (F : ZFSet.{u}) (hF : F ∈ M.sets) (z : (M.nameDomain s).names) (p : P) (g : G) - (forced : Forces (M.nameDomain s) visibilityProfileFormula - (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid F hF z) p) : - let image := relationImage F b.carrier (b.graph b (d.iso g)) - let imageGround := M.relationImage_mem separation hF nodes - (M.conditionMap_graph_mem d b t nodeMaps g) - let moved : (M.nameDomain s).names := ⟨a.act s g z.val, - M.act_mem s a t pairing unions powers separation collection carrier maps g z.val z.property⟩ - Forces (M.nameDomain s) visibilityProfileFormula - (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid image imageGround moved) (a.iso g p) := by - dsimp only - apply (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid small _ _ _ _).2 - apply M.decidesVisibilityProfile_act a s t b d pairing unions powers separation collection carrier maps closed F z.val p g - exact (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid small F hF z p).1 forced - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {L G : Type u} [Group G] [PartialOrder L] -variable (b : Presentation L) (d : PosetAction G L) (g : G) - -theorem nodeBasisImage_nonempty {B : ZFSet.{u}} - (subset : B ⊆ b.carrier) (nonempty : B.Nonempty) : - (relationImage B b.carrier (b.graph b (d.iso g))).Nonempty := by - obtain ⟨x, hx⟩ := nonempty - obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (subset hx) - exact ⟨b.encode (d.iso g v), (visibilityProfileImage_entry b d B g v).2 hx⟩ - -theorem nodeBasisImage_coinitial {F target B : ZFSet.{u}} - (subset : F ⊆ b.carrier) (basis : CoinitialBelowCode b.conditionOrder F target B) : - CoinitialBelowCode b.conditionOrder - (relationImage F b.carrier (b.graph b (d.iso g))) - (relationImage target b.carrier (b.graph b (d.iso g))) - (relationImage B b.carrier (b.graph b (d.iso g))) := by - refine ⟨?_, ?_⟩ - · intro x hx - obtain ⟨bound, v, hv, edge⟩ := (mem_relationImage B b.carrier (b.graph b (d.iso g)) x).1 hx - exact (mem_relationImage F b.carrier (b.graph b (d.iso g)) x).2 - ⟨bound, v, basis.1 hv, edge⟩ - · intro x hx - obtain ⟨_, old, member, edge⟩ := - (mem_relationImage target b.carrier (b.graph b (d.iso g)) x).1 hx - obtain ⟨v, equal⟩ := (b.mem_graph b (d.iso g) _).1 edge - obtain ⟨oldEq, imageEq⟩ := ZFSet.pair_inj.1 equal - subst old - subst x - obtain ⟨y, hy, below⟩ := basis.2 (b.encode v) member - obtain ⟨w, rfl⟩ := (b.mem_carrier y).1 (subset (basis.1 hy)) - exact ⟨b.encode (d.iso g w), (visibilityProfileImage_entry b d B g w).2 hy, - (b.pair_mem_conditionOrder _ _).2 - ((d.iso g).monotone ((b.pair_mem_conditionOrder w v).1 below))⟩ - -theorem nodeBasisImage_filter {F meetGraph : ZFSet.{u}} - (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) - (filter : MeetFilterCode b.carrier b.conditionOrder meetGraph F) : - MeetFilterCode b.carrier b.conditionOrder meetGraph - (relationImage F b.carrier (b.graph b (d.iso g))) := by - refine ⟨fun x hx => ((mem_relationImage F b.carrier (b.graph b (d.iso g)) x).1 hx).1, - nodeBasisImage_nonempty b d g filter.subset filter.nonempty, ?_, ?_⟩ - · intro x hx y hy lower - obtain ⟨v', rfl⟩ := (b.mem_carrier x).1 - ((mem_relationImage F b.carrier (b.graph b (d.iso g)) x).1 hx).1 - obtain ⟨v, rfl⟩ := (d.iso g).surjective v' - obtain ⟨w', rfl⟩ := (b.mem_carrier y).1 hy - obtain ⟨w, rfl⟩ := (d.iso g).surjective w' - apply (visibilityProfileImage_entry b d F g w).2 - exact filter.upward _ ((visibilityProfileImage_entry b d F g v).1 hx) _ (b.encode_mem w) - ((b.pair_mem_conditionOrder v w).2 - ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 lower))) - · intro x hx y hy z entry - have data := meet.pair_iff.1 entry - obtain ⟨v', rfl⟩ := (b.mem_carrier x).1 data.1 - obtain ⟨v, rfl⟩ := (d.iso g).surjective v' - obtain ⟨w', rfl⟩ := (b.mem_carrier y).1 data.2.1 - obtain ⟨w, rfl⟩ := (d.iso g).surjective w' - obtain ⟨k', rfl⟩ := (b.mem_carrier z).1 data.2.2.1 - obtain ⟨k, rfl⟩ := (d.iso g).surjective k' - apply (visibilityProfileImage_entry b d F g k).2 - apply filter.closed_meet _ ((visibilityProfileImage_entry b d F g v).1 hx) - _ ((visibilityProfileImage_entry b d F g w).1 hy) _ - apply meet.pair_iff.2 - refine ⟨b.encode_mem v, b.encode_mem w, b.encode_mem k, ?_, ?_, ?_⟩ - · exact (b.pair_mem_conditionOrder k v).2 - ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 data.2.2.2.1)) - · exact (b.pair_mem_conditionOrder k w).2 - ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 data.2.2.2.2.1)) - · intro t ht tv tw - obtain ⟨r, rfl⟩ := (b.mem_carrier t).1 ht - have movedBelow := data.2.2.2.2.2 (b.encode (d.iso g r)) (b.encode_mem _) - ((b.pair_mem_conditionOrder _ _).2 ((d.iso g).monotone ((b.pair_mem_conditionOrder _ _).1 tv))) - ((b.pair_mem_conditionOrder _ _).2 ((d.iso g).monotone ((b.pair_mem_conditionOrder _ _).1 tw))) - exact (b.pair_mem_conditionOrder r k).2 - ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 movedBelow)) - -namespace TransitiveGround -open SetFormula - -theorem nodeBasisTransport_ground_small (M : TransitiveGround.{u}) (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (nodes : b.carrier ∈ M.sets) (maps : d.conditionMapFamily b t ∈ M.sets) - {F B size : ZFSet.{u}} (hF : F ∈ M.sets) (hB : B ∈ M.sets) (hSize : size ∈ M.sets) - (subset : B ⊆ b.carrier) (small : M.groundEmbeddable B size) : - relationImage F b.carrier (b.graph b (d.iso g)) ∈ M.sets ∧ - relationImage B b.carrier (b.graph b (d.iso g)) ∈ M.sets ∧ - M.groundEmbeddable (relationImage B b.carrier (b.graph b (d.iso g))) size := by - have mapGround := M.conditionMap_graph_mem d b t maps g - exact ⟨M.relationImage_mem separation hF nodes mapGround, - M.relationImage_mem separation hB nodes mapGround, - M.groundEmbeddable_image pairing unions powers separation hB nodes hSize mapGround - (b.graph_injection b (d.iso g) (d.iso g).injective) subset small⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -namespace SynchronizedEnumerationCode - -theorem graph_transport {omega nodes movedNodes N movedN B f e names nodeMap nameMap : ZFSet.{u}} - (code : SynchronizedEnumerationCode omega N B f e names) - (basis : B ⊆ nodes) (nodeInjection : InjectionCode nodes movedNodes nodeMap) - (nameFunction : ZFSet.IsFunc N movedN nameMap) : - SynchronizedEnumerationCode omega movedN (relationImage B movedNodes nodeMap) - (relationCompose movedNodes B movedN (relationConverse B movedNodes nodeMap) - (relationCompose B N movedN f nameMap)) - (relationCompose omega B movedNodes e nodeMap) - (relationCompose omega N movedN names nameMap) := by - let movedB := relationImage B movedNodes nodeMap - let inverse := relationConverse B movedNodes nodeMap - let mapped := relationCompose B N movedN f nameMap - let movedF := relationCompose movedNodes B movedN inverse mapped - let movedE := relationCompose omega B movedNodes e nodeMap - let movedNames := relationCompose omega N movedN names nameMap - have mappedFunction : ZFSet.IsFunc B movedN mapped := - relationCompose_function_of_subset code.1 nameFunction (fun _ h => h) - have enumFunction : ZFSet.IsFunc omega movedNodes movedE := - relationCompose_function_of_subset code.2.1 nodeInjection.function basis - have namesFunction : ZFSet.IsFunc omega movedN movedNames := - relationCompose_function_of_subset code.2.2.1 nameFunction (fun _ h => h) - have inverseUnique : ∀ x v w, ZFSet.pair x v ∈ inverse → - ZFSet.pair x w ∈ inverse → v = w := by - intro x v w first second - exact nodeInjection.injective v w x - ((pair_mem_relationConverse B movedNodes nodeMap v x).1 first).2.2 - ((pair_mem_relationConverse B movedNodes nodeMap w x).1 second).2.2 - have movedFunction : ZFSet.IsFunc movedB movedN movedF := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, v, hv, tau, ht, rfl, xv, vt⟩ := - (mem_relationCompose movedNodes B movedN inverse mapped z).1 hz - exact ZFSet.pair_mem_prod.2 - ⟨(mem_relationImage B movedNodes nodeMap x).2 - ⟨hx, v, hv, ((pair_mem_relationConverse B movedNodes nodeMap v x).1 xv).2.2⟩, ht⟩ - · intro x hx - obtain ⟨hxNodes, v, hv, vx⟩ := (mem_relationImage B movedNodes nodeMap x).1 hx - have xv : ZFSet.pair x v ∈ inverse := - (pair_mem_relationConverse B movedNodes nodeMap v x).2 ⟨hv, hxNodes, vx⟩ - obtain ⟨tau, vt, unique⟩ := mappedFunction.2 v hv - have ht := (ZFSet.pair_mem_prod.1 (mappedFunction.1 vt)).2 - refine ⟨tau, (pair_mem_relationCompose movedNodes B movedN inverse mapped x tau).2 - ⟨hxNodes, ht, v, hv, xv, vt⟩, ?_⟩ - intro other entry - obtain ⟨_, _, w, _, xw, wt⟩ := - (pair_mem_relationCompose movedNodes B movedN inverse mapped x other).1 entry - exact unique other (inverseUnique x w v xw xv ▸ wt) - refine ⟨movedFunction, ⟨?_, enumFunction.2⟩, namesFunction, ?_, ?_, ?_⟩ - · intro z hz - obtain ⟨n, hn, v, hv, x, hx, rfl, nv, vx⟩ := - (mem_relationCompose omega B movedNodes e nodeMap z).1 hz - exact ZFSet.pair_mem_prod.2 - ⟨hn, (mem_relationImage B movedNodes nodeMap x).2 ⟨hx, v, hv, vx⟩⟩ - · intro x hx - obtain ⟨hxNodes, v, hv, vx⟩ := (mem_relationImage B movedNodes nodeMap x).1 hx - obtain ⟨n, hn, nv⟩ := code.2.2.2.1 v hv - exact ⟨n, hn, (pair_mem_relationCompose omega B movedNodes e nodeMap n x).2 - ⟨hn, hxNodes, v, hv, nv, vx⟩⟩ - · intro n hn x tau nx nt - obtain ⟨_, hx, v, hv, nv, vx⟩ := - (pair_mem_relationCompose omega B movedNodes e nodeMap n x).1 nx - obtain ⟨_, ht, old, hold, no, ot⟩ := - (pair_mem_relationCompose omega N movedN names nameMap n tau).1 nt - have vo := code.2.2.2.2.1 n hn v old nv no - exact (pair_mem_relationCompose movedNodes B movedN inverse mapped x tau).2 - ⟨hx, ht, v, hv, (pair_mem_relationConverse B movedNodes nodeMap v x).2 ⟨hv, hx, vx⟩, - (pair_mem_relationCompose B N movedN f nameMap v tau).2 ⟨hv, ht, old, hold, vo, ot⟩⟩ - · intro n hn x tau nx xt - obtain ⟨_, hx, v, hv, nv, vx⟩ := - (pair_mem_relationCompose omega B movedNodes e nodeMap n x).1 nx - obtain ⟨_, ht, w, _, xw, wt⟩ := - (pair_mem_relationCompose movedNodes B movedN inverse mapped x tau).1 xt - have xv : ZFSet.pair x v ∈ inverse := - (pair_mem_relationConverse B movedNodes nodeMap v x).2 ⟨hv, hx, vx⟩ - have vt := inverseUnique x w v xw xv ▸ wt - obtain ⟨_, _, old, hold, vo, ot⟩ := - (pair_mem_relationCompose B N movedN f nameMap v tau).1 vt - exact (pair_mem_relationCompose omega N movedN names nameMap n tau).2 - ⟨hn, ht, old, hold, code.2.2.2.2.2 n hn v old nv vo, ot⟩ - -end SynchronizedEnumerationCode - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem synchronizedEnumerationTransport_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {omega movedNodes N movedN B f e names nodeMap nameMap : ZFSet.{u}} - (hOmega : omega ∈ M.sets) (hNodes : movedNodes ∈ M.sets) - (hN : N ∈ M.sets) (hMovedN : movedN ∈ M.sets) (hB : B ∈ M.sets) - (hf : f ∈ M.sets) (he : e ∈ M.sets) (hNames : names ∈ M.sets) - (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) : - relationImage B movedNodes nodeMap ∈ M.sets ∧ - relationCompose movedNodes B movedN (relationConverse B movedNodes nodeMap) - (relationCompose B N movedN f nameMap) ∈ M.sets ∧ - relationCompose omega B movedNodes e nodeMap ∈ M.sets ∧ - relationCompose omega N movedN names nameMap ∈ M.sets := by - exact ⟨M.relationImage_mem separation hB hNodes hNodeMap, - M.relationCompose_mem pairing unions powers separation hNodes hB hMovedN - (M.relationConverse_mem pairing unions powers separation hB hNodes hNodeMap) - (M.relationCompose_mem pairing unions powers separation hB hN hMovedN hf hNameMap), - M.relationCompose_mem pairing unions powers separation hOmega hB hNodes he hNodeMap, - M.relationCompose_mem pairing unions powers separation hOmega hN hMovedN hNames hNameMap⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {L G : Type u} [Group G] [PartialOrder L] -variable (b : Presentation L) (d : PosetAction G L) (g : G) - -theorem nodeEnumerationImage_entry {omega B e : ZFSet.{u}} - (function : ZFSet.IsFunc omega B e) (n : ZFSet.{u}) (v : L) : - ZFSet.pair n (b.encode (d.iso g v)) ∈ - relationCompose omega B b.carrier e (b.graph b (d.iso g)) ↔ - ZFSet.pair n (b.encode v) ∈ e := by - constructor - · intro member - obtain ⟨_, _, old, _, edge, moved⟩ := - (pair_mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) n _).1 member - obtain ⟨w, equal⟩ := (b.mem_graph b (d.iso g) _).1 moved - obtain ⟨oldEq, movedEq⟩ := ZFSet.pair_inj.1 equal - have same : w = v := (d.iso g).injective (b.injective movedEq) - subst w - exact oldEq ▸ edge - · intro edge - have bounds := ZFSet.pair_mem_prod.1 (function.1 edge) - exact (pair_mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) n _).2 - ⟨bounds.1, b.encode_mem _, b.encode v, bounds.2, edge, - (b.pair_mem_graph b (d.iso g) v _).2 rfl⟩ - -theorem nodeEnumerationImage_function {omega B e : ZFSet.{u}} - (function : ZFSet.IsFunc omega B e) (subset : B ⊆ b.carrier) : - ZFSet.IsFunc omega (relationImage B b.carrier (b.graph b (d.iso g))) - (relationCompose omega B b.carrier e (b.graph b (d.iso g))) := by - have composed := relationCompose_function_of_subset function (b.graph_isFunc b (d.iso g)) subset - refine ⟨?_, composed.2⟩ - intro z member - obtain ⟨n, hn, v, hv, w, hw, rfl, nv, vw⟩ := - (mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) z).1 member - exact ZFSet.pair_mem_prod.2 - ⟨hn, (mem_relationImage B b.carrier (b.graph b (d.iso g)) w).2 ⟨hw, v, hv, vw⟩⟩ - -theorem nodeEnumerationImage_onto {omega B e : ZFSet.{u}} - (onto : ∀ v ∈ B, ∃ n ∈ omega, ZFSet.pair n v ∈ e) : - ∀ w ∈ relationImage B b.carrier (b.graph b (d.iso g)), ∃ n ∈ omega, - ZFSet.pair n w ∈ relationCompose omega B b.carrier e (b.graph b (d.iso g)) := by - intro w hw - obtain ⟨bound, v, hv, vw⟩ := (mem_relationImage B b.carrier (b.graph b (d.iso g)) w).1 hw - obtain ⟨n, hn, nv⟩ := onto v hv - exact ⟨n, hn, (pair_mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) n w).2 - ⟨hn, bound, v, hv, nv, vw⟩⟩ - -namespace TransitiveGround -open SetFormula - -theorem nodeEnumerationImage_ground (M : TransitiveGround.{u}) (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (nodes : b.carrier ∈ M.sets) (maps : d.conditionMapFamily b t ∈ M.sets) - {omega B e : ZFSet.{u}} (hOmega : omega ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) : - relationCompose omega B b.carrier e (b.graph b (d.iso g)) ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hOmega hB nodes he - (M.conditionMap_graph_mem d b t maps g) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] - -theorem visibilitySupportIncidence_act_iff - (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - (b : Presentation L) (d : PosetAction G L) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} - (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) - (g : G) (v : L) (tau : Name s) : - ZFSet.pair (b.encode (d.iso g v)) (a.act s g tau).val ∈ - visibilitySupportIncidence b.carrier (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ↔ - ZFSet.pair (b.encode v) tau.val ∈ - visibilitySupportIncidence b.carrier (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) := by - rw [M.visibilitySupportIncidence_candidates, M.visibilitySupportIncidence_candidates] - have moved := M.niceNameCandidates_principal_act_iff a s t pairing unions powers - separation collection carrier maps closed d g v tau - rw [M.mem_niceNameCandidates, M.mem_niceNameCandidates] at moved - exact moved - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -include pairing unions powers separation collection carrier order group nodes supports maps hT valid closed - -theorem preparedCertificateCode_act - (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) - (z : (M.nameDomain s).names) (F B f e names : ZFSet.{u}) (p : P) (g : G) - (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) - b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) - ZFSet.omega z.val.val F B f e names) : - let N := M.groundRelations T s.carrier - let validN := fun x (hx : x ∈ N) => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 - let nodeMap := b.graph b (d.iso g) - PreparedCertificateCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) - b.carrier b.conditionOrder meetGraph N - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) - ZFSet.omega (a.act s g z.val).val - (relationImage F b.carrier nodeMap) (relationImage B b.carrier nodeMap) - (Name.actedRepresentativeGraph a s b d N validN g B f) - (relationCompose ZFSet.omega B b.carrier e nodeMap) - (Name.actedEnumerationGraph a s N validN g ZFSet.omega names) := by - let N := M.groundRelations T s.carrier - let validN := fun x (hx : x ∈ N) => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 - have hN := M.groundRelations_mem pairing unions powers separation hT carrier - have nameClosed (tau : Name s) (member : tau.val ∈ N) : (a.act s g tau).val ∈ N := by - obtain ⟨ground, shape⟩ := (M.mem_groundRelations T s.carrier tau.val).1 member - exact (M.mem_groundRelations T s.carrier _).2 - ⟨M.act_mem s a t pairing unions powers separation collection carrier maps g tau ground, - Name.act_subset_of_closed a closed shape g⟩ - have graphGround := M.niceVisibilityGraph_mem a s t b d.principalFix pairing unions powers - separation collection carrier group nodes supports maps hT valid - obtain ⟨filter, basis, nonempty, enumerated, supported, forced⟩ := code - have basisNodes : B ⊆ b.carrier := fun v hv => filter.subset (basis.1 hv) - have originalRange : f ⊆ ZFSet.prod b.carrier N := by - intro entry member - obtain ⟨v, hv, tau, ht, rfl⟩ := ZFSet.mem_prod.1 (enumerated.1.1 member) - exact ZFSet.pair_mem_prod.2 ⟨basisNodes hv, ht⟩ - have original := (M.preparationForcingCode_iff a s b d.principalFix pairing unions powers - separation collection carrier order T N graphGround hN validN z F f originalRange p).1 forced - have movedEnumeration := enumerated.graph_transport basisNodes - (b.graph_injection b (d.iso g) (d.iso g).injective) - (Name.renameFamilyGraph_act_function a s N validN g nameClosed) - have movedFilter := nodeBasisImage_filter b d g meet filter - have movedBasis := nodeBasisImage_coinitial b d g filter.subset basis - let movedF := Name.actedRepresentativeGraph a s b d N validN g B f - have movedFunction : ZFSet.IsFunc (relationImage B b.carrier (b.graph b (d.iso g))) N movedF := - movedEnumeration.1 - have movedRange : movedF ⊆ ZFSet.prod b.carrier N := by - intro entry member - obtain ⟨v, hv, tau, ht, rfl⟩ := ZFSet.mem_prod.1 (movedFunction.1 member) - exact ZFSet.pair_mem_prod.2 ⟨movedFilter.subset (movedBasis.1 hv), ht⟩ - have movedEdges (v tau : ZFSet.{u}) (entry : ZFSet.pair v tau ∈ movedF) : - ∃ w : L, ∃ sigma : Name s, - ZFSet.pair (b.encode w) sigma.val ∈ f ∧ - v = b.encode (d.iso g w) ∧ tau = (a.act s g sigma).val := by - obtain ⟨w', rfl⟩ := (b.mem_carrier v).1 (ZFSet.pair_mem_prod.1 (movedRange entry)).1 - obtain ⟨w, rfl⟩ := (d.iso g).surjective w' - obtain ⟨sigma, old, equal⟩ := - (Name.pair_mem_actedRepresentativeGraph a s b d N validN g basisNodes - enumerated.1 nameClosed w tau).1 entry - exact ⟨w, sigma, old, rfl, equal⟩ - dsimp only - refine ⟨movedFilter, movedBasis, nodeBasisImage_nonempty b d g basisNodes nonempty, - movedEnumeration, ?_, ?_⟩ - · intro v tau entry - obtain ⟨w, sigma, old, rfl, rfl⟩ := movedEdges v tau entry - exact (M.visibilitySupportIncidence_act_iff a s t b d pairing unions powers separation - collection carrier maps closed g w sigma).2 (supported _ _ old) - · let moved : (M.nameDomain s).names := ⟨a.act s g z.val, - M.act_mem s a t pairing unions powers separation collection carrier maps g z.val z.property⟩ - apply (M.preparationForcingCode_iff a s b d.principalFix pairing unions powers - separation collection carrier order T N graphGround hN validN moved - (relationImage F b.carrier (b.graph b (d.iso g))) movedF movedRange (a.iso g p)).2 - refine ⟨M.decidesVisibilityProfile_act a s t b d pairing unions powers separation collection - carrier maps closed F z.val p g original.1, ?_⟩ - intro v tau _ entry - obtain ⟨w, sigma, old, _equalNode, equalName⟩ := movedEdges v tau.val entry - have sigmaInN := (ZFSet.pair_mem_prod.1 (enumerated.1.1 old)).2 - have equal : tau = a.act s g sigma := Subtype.ext equalName - rw [equal] - exact a.forcesEq_act s g (original.2 (b.encode w) sigma sigmaInN old) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -include pairing unions powers separation collection carrier order group nodes supports maps hT valid closed - -theorem preparedCertificateCode_act_ground_hs - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (base : L) (directed : ∀ v w : L, ∃ x, v ≤ x ∧ w ≤ x) - (children : ∀ tau : Name s, tau.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) - (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) - (z : (M.nameDomain s).names) (F B f e names : ZFSet.{u}) - (hF : F ∈ M.sets) (hB : B ∈ M.sets) (hf : f ∈ M.sets) - (he : e ∈ M.sets) (hNames : names ∈ M.sets) (p : P) (g : G) - (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) - b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) - ZFSet.omega z.val.val F B f e names) : - let N := M.groundRelations T s.carrier - let validN := fun x (hx : x ∈ N) => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 - let nodeMap := b.graph b (d.iso g) - let movedF := relationImage F b.carrier nodeMap - let movedB := relationImage B b.carrier nodeMap - let movedFunction := Name.actedRepresentativeGraph a s b d N validN g B f - let movedE := relationCompose ZFSet.omega B b.carrier e nodeMap - let movedNames := Name.actedEnumerationGraph a s N validN g ZFSet.omega names - movedF ∈ M.sets ∧ movedB ∈ M.sets ∧ movedFunction ∈ M.sets ∧ - movedE ∈ M.sets ∧ movedNames ∈ M.sets ∧ - PreparedCertificateCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) - b.carrier b.conditionOrder meetGraph N - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) - ZFSet.omega (a.act s g z.val).val movedF movedB movedFunction movedE movedNames ∧ - ∀ (v : L) (tau : Name s), ZFSet.pair (b.encode v) tau.val ∈ movedFunction → - tau.val ∈ M.sets ∧ NiceNameCode a s T (d.principalFix v) tau.val ∧ - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau := by - let N := M.groundRelations T s.carrier - let validN := fun x (hx : x ∈ N) => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 - have hN := M.groundRelations_mem pairing unions powers separation hT carrier - have hNodeMap := M.conditionMap_graph_mem d b t nodeMaps g - have moved := M.preparedCertificateCode_act a s t b d pairing unions powers separation collection - carrier order group nodes supports maps hT valid closed meetGraph meet z F B f e names p g code - refine ⟨M.relationImage_mem separation hF nodes hNodeMap, - M.relationImage_mem separation hB nodes hNodeMap, - M.actedRepresentativeGraph_mem a s b d t N validN pairing unions powers separation collection - carrier nodes maps nodeMaps hN g hB hf, - M.relationCompose_mem pairing unions powers separation omega hB nodes he hNodeMap, - M.actedEnumerationGraph_mem a s t N validN pairing unions powers separation collection - carrier maps hN g omega hNames, moved, ?_⟩ - intro v tau entry - have candidate := (M.visibilitySupportIncidence_candidates a s b T d.principalFix v tau.val).1 - (moved.2.2.2.2.1 _ _ entry) - exact ⟨candidate.1, candidate.2, - niceNameCode_hs a s (d.principalSupportFamily base directed) ⟨v, le_rfl⟩ children candidate.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundActedRepresentativeGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.PreparedCertificateCodes + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +theorem visibilityProfileImage_entry {L G : Type u} [Group G] [PartialOrder L] + (b : Presentation L) (d : PosetAction G L) (F : ZFSet.{u}) (g : G) (v : L) : + b.encode (d.iso g v) ∈ relationImage F b.carrier (b.graph b (d.iso g)) ↔ + b.encode v ∈ F := by + constructor + · intro member + obtain ⟨_, x, hx, edge⟩ := (mem_relationImage F b.carrier (b.graph b (d.iso g)) _).1 member + obtain ⟨w, equal⟩ := (b.mem_graph b (d.iso g) _).1 edge + have parts := ZFSet.pair_inj.1 equal + have same : w = v := (d.iso g).injective (b.injective parts.2) + subst w + rw [parts.1] + exact hx + · intro member + exact (mem_relationImage F b.carrier (b.graph b (d.iso g)) _).2 + ⟨b.encode_mem _, b.encode v, member, (b.pair_mem_graph b (d.iso g) v _).2 rfl⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + +include pairing unions powers separation collection carrier maps closed in +theorem decidesVisibilityProfile_act (F : ZFSet.{u}) (z : Name s) (p : P) (g : G) + (decisions : M.DecidesVisibilityProfile a s b d.principalFix T F z p) : + M.DecidesVisibilityProfile a s b d.principalFix T + (relationImage F b.carrier (b.graph b (d.iso g))) (a.act s g z) (a.iso g p) := by + intro w + obtain ⟨v, rfl⟩ := (d.iso g).surjective w + have profile := visibilityProfileImage_entry b d F g v + have visibility := M.act_niceVisibilityName a s t d pairing unions powers separation collection + carrier maps closed g v + constructor + · intro yes + have moved := a.forcesMem_act s g ((decisions v).1 (profile.1 yes)) + rw [visibility] at moved + exact moved + · intro no q qp bad + have oldq : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp + have moved : Name.ForcesMem (a.iso g ((a.iso g).symm q)) (a.act s g z) + (a.act s g (M.niceVisibilityName a s T (d.principalFix v))) := by + simpa only [OrderIso.apply_symm_apply, visibility] using bad + exact (decisions v).2 (fun yes => no (profile.2 yes)) _ oldq + ((a.forcesMem_act_iff s g _ _ _).1 moved) + +include closed in +theorem forces_visibilityProfile_act + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) (small : M.sets.Countable) + (F : ZFSet.{u}) (hF : F ∈ M.sets) (z : (M.nameDomain s).names) (p : P) (g : G) + (forced : Forces (M.nameDomain s) visibilityProfileFormula + (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid F hF z) p) : + let image := relationImage F b.carrier (b.graph b (d.iso g)) + let imageGround := M.relationImage_mem separation hF nodes + (M.conditionMap_graph_mem d b t nodeMaps g) + let moved : (M.nameDomain s).names := ⟨a.act s g z.val, + M.act_mem s a t pairing unions powers separation collection carrier maps g z.val z.property⟩ + Forces (M.nameDomain s) visibilityProfileFormula + (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid image imageGround moved) (a.iso g p) := by + dsimp only + apply (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid small _ _ _ _).2 + apply M.decidesVisibilityProfile_act a s t b d pairing unions powers separation collection carrier maps closed F z.val p g + exact (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid small F hF z p).1 forced + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {L G : Type u} [Group G] [PartialOrder L] +variable (b : Presentation L) (d : PosetAction G L) (g : G) + +theorem nodeBasisImage_nonempty {B : ZFSet.{u}} + (subset : B ⊆ b.carrier) (nonempty : B.Nonempty) : + (relationImage B b.carrier (b.graph b (d.iso g))).Nonempty := by + obtain ⟨x, hx⟩ := nonempty + obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (subset hx) + exact ⟨b.encode (d.iso g v), (visibilityProfileImage_entry b d B g v).2 hx⟩ + +theorem nodeBasisImage_coinitial {F target B : ZFSet.{u}} + (subset : F ⊆ b.carrier) (basis : CoinitialBelowCode b.conditionOrder F target B) : + CoinitialBelowCode b.conditionOrder + (relationImage F b.carrier (b.graph b (d.iso g))) + (relationImage target b.carrier (b.graph b (d.iso g))) + (relationImage B b.carrier (b.graph b (d.iso g))) := by + refine ⟨?_, ?_⟩ + · intro x hx + obtain ⟨bound, v, hv, edge⟩ := (mem_relationImage B b.carrier (b.graph b (d.iso g)) x).1 hx + exact (mem_relationImage F b.carrier (b.graph b (d.iso g)) x).2 + ⟨bound, v, basis.1 hv, edge⟩ + · intro x hx + obtain ⟨_, old, member, edge⟩ := + (mem_relationImage target b.carrier (b.graph b (d.iso g)) x).1 hx + obtain ⟨v, equal⟩ := (b.mem_graph b (d.iso g) _).1 edge + obtain ⟨oldEq, imageEq⟩ := ZFSet.pair_inj.1 equal + subst old + subst x + obtain ⟨y, hy, below⟩ := basis.2 (b.encode v) member + obtain ⟨w, rfl⟩ := (b.mem_carrier y).1 (subset (basis.1 hy)) + exact ⟨b.encode (d.iso g w), (visibilityProfileImage_entry b d B g w).2 hy, + (b.pair_mem_conditionOrder _ _).2 + ((d.iso g).monotone ((b.pair_mem_conditionOrder w v).1 below))⟩ + +theorem nodeBasisImage_filter {F meetGraph : ZFSet.{u}} + (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) + (filter : MeetFilterCode b.carrier b.conditionOrder meetGraph F) : + MeetFilterCode b.carrier b.conditionOrder meetGraph + (relationImage F b.carrier (b.graph b (d.iso g))) := by + refine ⟨fun x hx => ((mem_relationImage F b.carrier (b.graph b (d.iso g)) x).1 hx).1, + nodeBasisImage_nonempty b d g filter.subset filter.nonempty, ?_, ?_⟩ + · intro x hx y hy lower + obtain ⟨v', rfl⟩ := (b.mem_carrier x).1 + ((mem_relationImage F b.carrier (b.graph b (d.iso g)) x).1 hx).1 + obtain ⟨v, rfl⟩ := (d.iso g).surjective v' + obtain ⟨w', rfl⟩ := (b.mem_carrier y).1 hy + obtain ⟨w, rfl⟩ := (d.iso g).surjective w' + apply (visibilityProfileImage_entry b d F g w).2 + exact filter.upward _ ((visibilityProfileImage_entry b d F g v).1 hx) _ (b.encode_mem w) + ((b.pair_mem_conditionOrder v w).2 + ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 lower))) + · intro x hx y hy z entry + have data := meet.pair_iff.1 entry + obtain ⟨v', rfl⟩ := (b.mem_carrier x).1 data.1 + obtain ⟨v, rfl⟩ := (d.iso g).surjective v' + obtain ⟨w', rfl⟩ := (b.mem_carrier y).1 data.2.1 + obtain ⟨w, rfl⟩ := (d.iso g).surjective w' + obtain ⟨k', rfl⟩ := (b.mem_carrier z).1 data.2.2.1 + obtain ⟨k, rfl⟩ := (d.iso g).surjective k' + apply (visibilityProfileImage_entry b d F g k).2 + apply filter.closed_meet _ ((visibilityProfileImage_entry b d F g v).1 hx) + _ ((visibilityProfileImage_entry b d F g w).1 hy) _ + apply meet.pair_iff.2 + refine ⟨b.encode_mem v, b.encode_mem w, b.encode_mem k, ?_, ?_, ?_⟩ + · exact (b.pair_mem_conditionOrder k v).2 + ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 data.2.2.2.1)) + · exact (b.pair_mem_conditionOrder k w).2 + ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 data.2.2.2.2.1)) + · intro t ht tv tw + obtain ⟨r, rfl⟩ := (b.mem_carrier t).1 ht + have movedBelow := data.2.2.2.2.2 (b.encode (d.iso g r)) (b.encode_mem _) + ((b.pair_mem_conditionOrder _ _).2 ((d.iso g).monotone ((b.pair_mem_conditionOrder _ _).1 tv))) + ((b.pair_mem_conditionOrder _ _).2 ((d.iso g).monotone ((b.pair_mem_conditionOrder _ _).1 tw))) + exact (b.pair_mem_conditionOrder r k).2 + ((d.iso g).le_iff_le.1 ((b.pair_mem_conditionOrder _ _).1 movedBelow)) + +namespace TransitiveGround +open SetFormula + +theorem nodeBasisTransport_ground_small (M : TransitiveGround.{u}) (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (nodes : b.carrier ∈ M.sets) (maps : d.conditionMapFamily b t ∈ M.sets) + {F B size : ZFSet.{u}} (hF : F ∈ M.sets) (hB : B ∈ M.sets) (hSize : size ∈ M.sets) + (subset : B ⊆ b.carrier) (small : M.groundEmbeddable B size) : + relationImage F b.carrier (b.graph b (d.iso g)) ∈ M.sets ∧ + relationImage B b.carrier (b.graph b (d.iso g)) ∈ M.sets ∧ + M.groundEmbeddable (relationImage B b.carrier (b.graph b (d.iso g))) size := by + have mapGround := M.conditionMap_graph_mem d b t maps g + exact ⟨M.relationImage_mem separation hF nodes mapGround, + M.relationImage_mem separation hB nodes mapGround, + M.groundEmbeddable_image pairing unions powers separation hB nodes hSize mapGround + (b.graph_injection b (d.iso g) (d.iso g).injective) subset small⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +namespace SynchronizedEnumerationCode + +theorem graph_transport {omega nodes movedNodes N movedN B f e names nodeMap nameMap : ZFSet.{u}} + (code : SynchronizedEnumerationCode omega N B f e names) + (basis : B ⊆ nodes) (nodeInjection : InjectionCode nodes movedNodes nodeMap) + (nameFunction : ZFSet.IsFunc N movedN nameMap) : + SynchronizedEnumerationCode omega movedN (relationImage B movedNodes nodeMap) + (relationCompose movedNodes B movedN (relationConverse B movedNodes nodeMap) + (relationCompose B N movedN f nameMap)) + (relationCompose omega B movedNodes e nodeMap) + (relationCompose omega N movedN names nameMap) := by + let movedB := relationImage B movedNodes nodeMap + let inverse := relationConverse B movedNodes nodeMap + let mapped := relationCompose B N movedN f nameMap + let movedF := relationCompose movedNodes B movedN inverse mapped + let movedE := relationCompose omega B movedNodes e nodeMap + let movedNames := relationCompose omega N movedN names nameMap + have mappedFunction : ZFSet.IsFunc B movedN mapped := + relationCompose_function_of_subset code.1 nameFunction (fun _ h => h) + have enumFunction : ZFSet.IsFunc omega movedNodes movedE := + relationCompose_function_of_subset code.2.1 nodeInjection.function basis + have namesFunction : ZFSet.IsFunc omega movedN movedNames := + relationCompose_function_of_subset code.2.2.1 nameFunction (fun _ h => h) + have inverseUnique : ∀ x v w, ZFSet.pair x v ∈ inverse → + ZFSet.pair x w ∈ inverse → v = w := by + intro x v w first second + exact nodeInjection.injective v w x + ((pair_mem_relationConverse B movedNodes nodeMap v x).1 first).2.2 + ((pair_mem_relationConverse B movedNodes nodeMap w x).1 second).2.2 + have movedFunction : ZFSet.IsFunc movedB movedN movedF := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, v, hv, tau, ht, rfl, xv, vt⟩ := + (mem_relationCompose movedNodes B movedN inverse mapped z).1 hz + exact ZFSet.pair_mem_prod.2 + ⟨(mem_relationImage B movedNodes nodeMap x).2 + ⟨hx, v, hv, ((pair_mem_relationConverse B movedNodes nodeMap v x).1 xv).2.2⟩, ht⟩ + · intro x hx + obtain ⟨hxNodes, v, hv, vx⟩ := (mem_relationImage B movedNodes nodeMap x).1 hx + have xv : ZFSet.pair x v ∈ inverse := + (pair_mem_relationConverse B movedNodes nodeMap v x).2 ⟨hv, hxNodes, vx⟩ + obtain ⟨tau, vt, unique⟩ := mappedFunction.2 v hv + have ht := (ZFSet.pair_mem_prod.1 (mappedFunction.1 vt)).2 + refine ⟨tau, (pair_mem_relationCompose movedNodes B movedN inverse mapped x tau).2 + ⟨hxNodes, ht, v, hv, xv, vt⟩, ?_⟩ + intro other entry + obtain ⟨_, _, w, _, xw, wt⟩ := + (pair_mem_relationCompose movedNodes B movedN inverse mapped x other).1 entry + exact unique other (inverseUnique x w v xw xv ▸ wt) + refine ⟨movedFunction, ⟨?_, enumFunction.2⟩, namesFunction, ?_, ?_, ?_⟩ + · intro z hz + obtain ⟨n, hn, v, hv, x, hx, rfl, nv, vx⟩ := + (mem_relationCompose omega B movedNodes e nodeMap z).1 hz + exact ZFSet.pair_mem_prod.2 + ⟨hn, (mem_relationImage B movedNodes nodeMap x).2 ⟨hx, v, hv, vx⟩⟩ + · intro x hx + obtain ⟨hxNodes, v, hv, vx⟩ := (mem_relationImage B movedNodes nodeMap x).1 hx + obtain ⟨n, hn, nv⟩ := code.2.2.2.1 v hv + exact ⟨n, hn, (pair_mem_relationCompose omega B movedNodes e nodeMap n x).2 + ⟨hn, hxNodes, v, hv, nv, vx⟩⟩ + · intro n hn x tau nx nt + obtain ⟨_, hx, v, hv, nv, vx⟩ := + (pair_mem_relationCompose omega B movedNodes e nodeMap n x).1 nx + obtain ⟨_, ht, old, hold, no, ot⟩ := + (pair_mem_relationCompose omega N movedN names nameMap n tau).1 nt + have vo := code.2.2.2.2.1 n hn v old nv no + exact (pair_mem_relationCompose movedNodes B movedN inverse mapped x tau).2 + ⟨hx, ht, v, hv, (pair_mem_relationConverse B movedNodes nodeMap v x).2 ⟨hv, hx, vx⟩, + (pair_mem_relationCompose B N movedN f nameMap v tau).2 ⟨hv, ht, old, hold, vo, ot⟩⟩ + · intro n hn x tau nx xt + obtain ⟨_, hx, v, hv, nv, vx⟩ := + (pair_mem_relationCompose omega B movedNodes e nodeMap n x).1 nx + obtain ⟨_, ht, w, _, xw, wt⟩ := + (pair_mem_relationCompose movedNodes B movedN inverse mapped x tau).1 xt + have xv : ZFSet.pair x v ∈ inverse := + (pair_mem_relationConverse B movedNodes nodeMap v x).2 ⟨hv, hx, vx⟩ + have vt := inverseUnique x w v xw xv ▸ wt + obtain ⟨_, _, old, hold, vo, ot⟩ := + (pair_mem_relationCompose B N movedN f nameMap v tau).1 vt + exact (pair_mem_relationCompose omega N movedN names nameMap n tau).2 + ⟨hn, ht, old, hold, code.2.2.2.2.2 n hn v old nv vo, ot⟩ + +end SynchronizedEnumerationCode + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem synchronizedEnumerationTransport_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {omega movedNodes N movedN B f e names nodeMap nameMap : ZFSet.{u}} + (hOmega : omega ∈ M.sets) (hNodes : movedNodes ∈ M.sets) + (hN : N ∈ M.sets) (hMovedN : movedN ∈ M.sets) (hB : B ∈ M.sets) + (hf : f ∈ M.sets) (he : e ∈ M.sets) (hNames : names ∈ M.sets) + (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) : + relationImage B movedNodes nodeMap ∈ M.sets ∧ + relationCompose movedNodes B movedN (relationConverse B movedNodes nodeMap) + (relationCompose B N movedN f nameMap) ∈ M.sets ∧ + relationCompose omega B movedNodes e nodeMap ∈ M.sets ∧ + relationCompose omega N movedN names nameMap ∈ M.sets := by + exact ⟨M.relationImage_mem separation hB hNodes hNodeMap, + M.relationCompose_mem pairing unions powers separation hNodes hB hMovedN + (M.relationConverse_mem pairing unions powers separation hB hNodes hNodeMap) + (M.relationCompose_mem pairing unions powers separation hB hN hMovedN hf hNameMap), + M.relationCompose_mem pairing unions powers separation hOmega hB hNodes he hNodeMap, + M.relationCompose_mem pairing unions powers separation hOmega hN hMovedN hNames hNameMap⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {L G : Type u} [Group G] [PartialOrder L] +variable (b : Presentation L) (d : PosetAction G L) (g : G) + +theorem nodeEnumerationImage_entry {omega B e : ZFSet.{u}} + (function : ZFSet.IsFunc omega B e) (n : ZFSet.{u}) (v : L) : + ZFSet.pair n (b.encode (d.iso g v)) ∈ + relationCompose omega B b.carrier e (b.graph b (d.iso g)) ↔ + ZFSet.pair n (b.encode v) ∈ e := by + constructor + · intro member + obtain ⟨_, _, old, _, edge, moved⟩ := + (pair_mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) n _).1 member + obtain ⟨w, equal⟩ := (b.mem_graph b (d.iso g) _).1 moved + obtain ⟨oldEq, movedEq⟩ := ZFSet.pair_inj.1 equal + have same : w = v := (d.iso g).injective (b.injective movedEq) + subst w + exact oldEq ▸ edge + · intro edge + have bounds := ZFSet.pair_mem_prod.1 (function.1 edge) + exact (pair_mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) n _).2 + ⟨bounds.1, b.encode_mem _, b.encode v, bounds.2, edge, + (b.pair_mem_graph b (d.iso g) v _).2 rfl⟩ + +theorem nodeEnumerationImage_function {omega B e : ZFSet.{u}} + (function : ZFSet.IsFunc omega B e) (subset : B ⊆ b.carrier) : + ZFSet.IsFunc omega (relationImage B b.carrier (b.graph b (d.iso g))) + (relationCompose omega B b.carrier e (b.graph b (d.iso g))) := by + have composed := relationCompose_function_of_subset function (b.graph_isFunc b (d.iso g)) subset + refine ⟨?_, composed.2⟩ + intro z member + obtain ⟨n, hn, v, hv, w, hw, rfl, nv, vw⟩ := + (mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) z).1 member + exact ZFSet.pair_mem_prod.2 + ⟨hn, (mem_relationImage B b.carrier (b.graph b (d.iso g)) w).2 ⟨hw, v, hv, vw⟩⟩ + +theorem nodeEnumerationImage_onto {omega B e : ZFSet.{u}} + (onto : ∀ v ∈ B, ∃ n ∈ omega, ZFSet.pair n v ∈ e) : + ∀ w ∈ relationImage B b.carrier (b.graph b (d.iso g)), ∃ n ∈ omega, + ZFSet.pair n w ∈ relationCompose omega B b.carrier e (b.graph b (d.iso g)) := by + intro w hw + obtain ⟨bound, v, hv, vw⟩ := (mem_relationImage B b.carrier (b.graph b (d.iso g)) w).1 hw + obtain ⟨n, hn, nv⟩ := onto v hv + exact ⟨n, hn, (pair_mem_relationCompose omega B b.carrier e (b.graph b (d.iso g)) n w).2 + ⟨hn, bound, v, hv, nv, vw⟩⟩ + +namespace TransitiveGround +open SetFormula + +theorem nodeEnumerationImage_ground (M : TransitiveGround.{u}) (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (nodes : b.carrier ∈ M.sets) (maps : d.conditionMapFamily b t ∈ M.sets) + {omega B e : ZFSet.{u}} (hOmega : omega ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) : + relationCompose omega B b.carrier e (b.graph b (d.iso g)) ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hOmega hB nodes he + (M.conditionMap_graph_mem d b t maps g) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] + +theorem visibilitySupportIncidence_act_iff + (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + (b : Presentation L) (d : PosetAction G L) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} + (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) + (g : G) (v : L) (tau : Name s) : + ZFSet.pair (b.encode (d.iso g v)) (a.act s g tau).val ∈ + visibilitySupportIncidence b.carrier (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ↔ + ZFSet.pair (b.encode v) tau.val ∈ + visibilitySupportIncidence b.carrier (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) := by + rw [M.visibilitySupportIncidence_candidates, M.visibilitySupportIncidence_candidates] + have moved := M.niceNameCandidates_principal_act_iff a s t pairing unions powers + separation collection carrier maps closed d g v tau + rw [M.mem_niceNameCandidates, M.mem_niceNameCandidates] at moved + exact moved + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +include pairing unions powers separation collection carrier order group nodes supports maps hT valid closed + +theorem preparedCertificateCode_act + (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) + (z : (M.nameDomain s).names) (F B f e names : ZFSet.{u}) (p : P) (g : G) + (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) + b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) + ZFSet.omega z.val.val F B f e names) : + let N := M.groundRelations T s.carrier + let validN := fun x (hx : x ∈ N) => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 + let nodeMap := b.graph b (d.iso g) + PreparedCertificateCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) + b.carrier b.conditionOrder meetGraph N + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) + ZFSet.omega (a.act s g z.val).val + (relationImage F b.carrier nodeMap) (relationImage B b.carrier nodeMap) + (Name.actedRepresentativeGraph a s b d N validN g B f) + (relationCompose ZFSet.omega B b.carrier e nodeMap) + (Name.actedEnumerationGraph a s N validN g ZFSet.omega names) := by + let N := M.groundRelations T s.carrier + let validN := fun x (hx : x ∈ N) => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 + have hN := M.groundRelations_mem pairing unions powers separation hT carrier + have nameClosed (tau : Name s) (member : tau.val ∈ N) : (a.act s g tau).val ∈ N := by + obtain ⟨ground, shape⟩ := (M.mem_groundRelations T s.carrier tau.val).1 member + exact (M.mem_groundRelations T s.carrier _).2 + ⟨M.act_mem s a t pairing unions powers separation collection carrier maps g tau ground, + Name.act_subset_of_closed a closed shape g⟩ + have graphGround := M.niceVisibilityGraph_mem a s t b d.principalFix pairing unions powers + separation collection carrier group nodes supports maps hT valid + obtain ⟨filter, basis, nonempty, enumerated, supported, forced⟩ := code + have basisNodes : B ⊆ b.carrier := fun v hv => filter.subset (basis.1 hv) + have originalRange : f ⊆ ZFSet.prod b.carrier N := by + intro entry member + obtain ⟨v, hv, tau, ht, rfl⟩ := ZFSet.mem_prod.1 (enumerated.1.1 member) + exact ZFSet.pair_mem_prod.2 ⟨basisNodes hv, ht⟩ + have original := (M.preparationForcingCode_iff a s b d.principalFix pairing unions powers + separation collection carrier order T N graphGround hN validN z F f originalRange p).1 forced + have movedEnumeration := enumerated.graph_transport basisNodes + (b.graph_injection b (d.iso g) (d.iso g).injective) + (Name.renameFamilyGraph_act_function a s N validN g nameClosed) + have movedFilter := nodeBasisImage_filter b d g meet filter + have movedBasis := nodeBasisImage_coinitial b d g filter.subset basis + let movedF := Name.actedRepresentativeGraph a s b d N validN g B f + have movedFunction : ZFSet.IsFunc (relationImage B b.carrier (b.graph b (d.iso g))) N movedF := + movedEnumeration.1 + have movedRange : movedF ⊆ ZFSet.prod b.carrier N := by + intro entry member + obtain ⟨v, hv, tau, ht, rfl⟩ := ZFSet.mem_prod.1 (movedFunction.1 member) + exact ZFSet.pair_mem_prod.2 ⟨movedFilter.subset (movedBasis.1 hv), ht⟩ + have movedEdges (v tau : ZFSet.{u}) (entry : ZFSet.pair v tau ∈ movedF) : + ∃ w : L, ∃ sigma : Name s, + ZFSet.pair (b.encode w) sigma.val ∈ f ∧ + v = b.encode (d.iso g w) ∧ tau = (a.act s g sigma).val := by + obtain ⟨w', rfl⟩ := (b.mem_carrier v).1 (ZFSet.pair_mem_prod.1 (movedRange entry)).1 + obtain ⟨w, rfl⟩ := (d.iso g).surjective w' + obtain ⟨sigma, old, equal⟩ := + (Name.pair_mem_actedRepresentativeGraph a s b d N validN g basisNodes + enumerated.1 nameClosed w tau).1 entry + exact ⟨w, sigma, old, rfl, equal⟩ + dsimp only + refine ⟨movedFilter, movedBasis, nodeBasisImage_nonempty b d g basisNodes nonempty, + movedEnumeration, ?_, ?_⟩ + · intro v tau entry + obtain ⟨w, sigma, old, rfl, rfl⟩ := movedEdges v tau entry + exact (M.visibilitySupportIncidence_act_iff a s t b d pairing unions powers separation + collection carrier maps closed g w sigma).2 (supported _ _ old) + · let moved : (M.nameDomain s).names := ⟨a.act s g z.val, + M.act_mem s a t pairing unions powers separation collection carrier maps g z.val z.property⟩ + apply (M.preparationForcingCode_iff a s b d.principalFix pairing unions powers + separation collection carrier order T N graphGround hN validN moved + (relationImage F b.carrier (b.graph b (d.iso g))) movedF movedRange (a.iso g p)).2 + refine ⟨M.decidesVisibilityProfile_act a s t b d pairing unions powers separation collection + carrier maps closed F z.val p g original.1, ?_⟩ + intro v tau _ entry + obtain ⟨w, sigma, old, _equalNode, equalName⟩ := movedEdges v tau.val entry + have sigmaInN := (ZFSet.pair_mem_prod.1 (enumerated.1.1 old)).2 + have equal : tau = a.act s g sigma := Subtype.ext equalName + rw [equal] + exact a.forcesEq_act s g (original.2 (b.encode w) sigma sigmaInN old) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +include pairing unions powers separation collection carrier order group nodes supports maps hT valid closed + +theorem preparedCertificateCode_act_ground_hs + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (base : L) (directed : ∀ v w : L, ∃ x, v ≤ x ∧ w ≤ x) + (children : ∀ tau : Name s, tau.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) + (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) + (z : (M.nameDomain s).names) (F B f e names : ZFSet.{u}) + (hF : F ∈ M.sets) (hB : B ∈ M.sets) (hf : f ∈ M.sets) + (he : e ∈ M.sets) (hNames : names ∈ M.sets) (p : P) (g : G) + (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) + b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) + ZFSet.omega z.val.val F B f e names) : + let N := M.groundRelations T s.carrier + let validN := fun x (hx : x ∈ N) => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 + let nodeMap := b.graph b (d.iso g) + let movedF := relationImage F b.carrier nodeMap + let movedB := relationImage B b.carrier nodeMap + let movedFunction := Name.actedRepresentativeGraph a s b d N validN g B f + let movedE := relationCompose ZFSet.omega B b.carrier e nodeMap + let movedNames := Name.actedEnumerationGraph a s N validN g ZFSet.omega names + movedF ∈ M.sets ∧ movedB ∈ M.sets ∧ movedFunction ∈ M.sets ∧ + movedE ∈ M.sets ∧ movedNames ∈ M.sets ∧ + PreparedCertificateCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) + b.carrier b.conditionOrder meetGraph N + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) + ZFSet.omega (a.act s g z.val).val movedF movedB movedFunction movedE movedNames ∧ + ∀ (v : L) (tau : Name s), ZFSet.pair (b.encode v) tau.val ∈ movedFunction → + tau.val ∈ M.sets ∧ NiceNameCode a s T (d.principalFix v) tau.val ∧ + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau := by + let N := M.groundRelations T s.carrier + let validN := fun x (hx : x ∈ N) => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier x).1 hx).2 + have hN := M.groundRelations_mem pairing unions powers separation hT carrier + have hNodeMap := M.conditionMap_graph_mem d b t nodeMaps g + have moved := M.preparedCertificateCode_act a s t b d pairing unions powers separation collection + carrier order group nodes supports maps hT valid closed meetGraph meet z F B f e names p g code + refine ⟨M.relationImage_mem separation hF nodes hNodeMap, + M.relationImage_mem separation hB nodes hNodeMap, + M.actedRepresentativeGraph_mem a s b d t N validN pairing unions powers separation collection + carrier nodes maps nodeMaps hN g hB hf, + M.relationCompose_mem pairing unions powers separation omega hB nodes he hNodeMap, + M.actedEnumerationGraph_mem a s t N validN pairing unions powers separation collection + carrier maps hN g omega hNames, moved, ?_⟩ + intro v tau entry + have candidate := (M.visibilitySupportIncidence_candidates a s b T d.principalFix v tau.val).1 + (moved.2.2.2.2.1 _ _ entry) + exact ⟨candidate.1, candidate.2, + niceNameCode_hs a s (d.principalSupportFamily base directed) ⟨v, le_rfl⟩ children candidate.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedWitnessSelections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedWitnessSelections.lean index 5412b5598c47f207ade37029589fa05895f0b69a..cc44342c00c31c08e8b91f72127ed9cd4161d280 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedWitnessSelections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPreparedWitnessSelections.lean @@ -1,202 +1,202 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStoredPreparedFamilyActions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRetainedPreparationSelections -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundStoredPreparationFamilyPersistence -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundStoredVisitCertificates - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -def StoredPreparedConditionCode (M : TransitiveGround.{u}) - (rows T stages history nodes p : ZFSet.{u}) : Prop := - let Q := M.refinementHistoryForcing rows T stages history - ∀ row A, p = ZFSet.pair row A → ∀ x ∈ A, - ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ - fields 6 = T ∧ fields 10 = nodes ∧ - MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ - StoredPreparationEnvironment M fields ∧ - ∃ sourceRow sourceA, sourceA ∈ M.sets ∧ ZFSet.pair sourceRow sourceA ∈ Q ∧ - sourceA ⊆ A ∧ x ∈ assignmentOnIndices (fields 0) T sourceA ∧ - ∃ k ∈ M.sets, ∃ enumerations ∈ M.sets, ∃ q ∈ fields 7, - ZFSet.pair p q ∈ rowAssignmentCutGraph Q (fields 7) - (refinementDataHistoryLevels stages history T) alpha ∧ - PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) - (canonicalMeetGraph (fields 10) (fields 11)) (fields 14) (fields 13) (fields 9) - ZFSet.omega (M.storedPreparationRequests sourceA fields) - (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) - (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations - - - - - -def StoredSupportPreparedConditionCode (M : TransitiveGround.{u}) - (rows T stages history nodes p S : ZFSet.{u}) : Prop := - let Q := M.refinementHistoryForcing rows T stages history - ∀ row A, p = ZFSet.pair row A → ∀ x ∈ A, - ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ - fields 6 = T ∧ fields 10 = nodes ∧ - MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ - StoredPreparationEnvironment M fields ∧ - ∃ sourceRow sourceA, sourceA ∈ M.sets ∧ ZFSet.pair sourceRow sourceA ∈ Q ∧ - sourceA ⊆ A ∧ x ∈ assignmentOnIndices (fields 0) T sourceA ∧ - ∃ k ∈ M.sets, ∃ enumerations ∈ M.sets, ∃ q ∈ fields 7, - ZFSet.pair p q ∈ rowAssignmentCutGraph Q (fields 7) - (refinementDataHistoryLevels stages history T) alpha ∧ - PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) - (canonicalMeetGraph (fields 10) (fields 11)) (fields 14) (fields 13) (fields 9) - ZFSet.omega (M.storedPreparationRequests sourceA fields) - (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) - (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations ∧ - certificateUsedSupports nodes k ⊆ S - -theorem StoredSupportPreparedConditionCode.forget - {M : TransitiveGround.{u}} {rows T stages history nodes p S : ZFSet.{u}} - (prepared : StoredSupportPreparedConditionCode M rows T stages history nodes p S) : - StoredPreparedConditionCode M rows T stages history nodes p := by - intro row A equal x member - obtain ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meet, environment, - sourceRow, sourceA, hSourceA, source, subset, selected, - k, hk, enumerations, he, q, hq, cut, family, _supportBound⟩ := prepared row A equal x member - exact ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meet, environment, - sourceRow, sourceA, hSourceA, source, subset, selected, - k, hk, enumerations, he, q, hq, cut, family⟩ - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def preparedWitnessSelections (rows T stages packed nodes p A : ZFSet.{u}) : ZFSet.{u} := - let Q := M.refinementHistoryForcing rows T stages packed - M.retainedPreparationSelections A (ZFSet.prod stages (M.preparationWitnessBound nodes T Q)) - (M.varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T) p - (refinementDataHistoryLevels stages packed T) - -theorem exists_storedPreparedWitnessSelection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows T stages packed nodes row A : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) (hStages : stages ∈ M.sets) - (hPacked : packed ∈ M.sets) (hNodes : nodes ∈ M.sets) - (data : RefinementDataHistory stages packed T) - (condition : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages packed) - (prepared : StoredPreparedConditionCode M rows T stages packed nodes (ZFSet.pair row A)) - (nameBounds : ∀ alpha (fields : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → - fields 14 ⊆ M.groundRelations T (M.refinementHistoryForcing rows T stages packed)) : - let Q := M.refinementHistoryForcing rows T stages packed - let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) - ∃ selections ∈ M.sets, ZFSet.IsFunc A L selections ∧ - selections ⊆ M.preparedWitnessSelections rows T stages packed nodes (ZFSet.pair row A) A ∧ - relationImage A L selections ∈ M.sets ∧ - M.groundEmbeddable (relationImage A L selections) ZFSet.omega := by - let Q := M.refinementHistoryForcing rows T stages packed - let W := M.groundRelations T Q - let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) - let R := M.varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T - let levels := refinementDataHistoryLevels stages packed T - have omega := M.omega_mem separation infinite - have hQ := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hPacked omega - have hp := M.transitive hQ condition - have hA := M.pair_right hp - have candidate := ((M.mem_refinementHistoryForcing rows T stages packed _).1 condition).1 - have smallA := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate).2.2.2 - have hL := M.prod_mem pairing unions powers separation hStages - (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega) - have hR := M.varyingPreparationRelation_mem pairing unions powers separation hStages hPacked hQ - (M.prod_mem pairing unions powers separation hQ hQ) hNodes hT omega - have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hPacked hT - apply M.exists_retainedPreparationSelection pairing unions powers separation infinite choice - hA hL hR hp hLevels smallA - intro x hx - obtain ⟨alpha, ha, fields, stored, terms, nodeCarrier, meet, _environment, - sourceRow, sourceA, _hSourceA, sourceCondition, sourceSubset, selected, - k, hk, enumerations, he, q, _hq, cut, family⟩ := prepared row A rfl x hx - have requestBound : M.storedPreparationRequests sourceA fields ⊆ W := by - intro z hz - apply nameBounds alpha fields stored - rcases ZFSet.mem_union.1 hz with left | right - · exact (mem_relationImage _ _ _ _).1 left |>.1 - · exact (mem_relationImage _ _ _ _).1 right |>.1 - have witness (r : ZFSet.{u}) (hr : r ∈ Q) : - ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q := - M.preparationWitness_mem_of_local requestBound (fun _ h => h) hr hk he family.1 family.2.1 - have visit : ZFSet.pair (ZFSet.pair alpha (ZFSet.pair sourceRow sourceA)) - (ZFSet.pair (ZFSet.pair row A) (ZFSet.pair k enumerations)) ∈ R := by - apply (M.pair_mem_varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T - alpha (ZFSet.pair sourceRow sourceA) (ZFSet.pair (ZFSet.pair row A) (ZFSet.pair k enumerations))).2 - exact ⟨ha, sourceCondition, witness _ condition, fields, stored, terms, nodeCarrier, meet, - sourceRow, sourceA, ZFSet.pair row A, k, enumerations, q, rfl, rfl, - ZFSet.pair_mem_prod.2 ⟨condition, sourceCondition⟩, cut, family⟩ - have inSource := (mem_assignmentOnIndices (fields 0) T sourceA x).1 selected - have level : ZFSet.pair x alpha ∈ levels := by - obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 inSource.2 - exact data.coverage alpha ha fields stored idx hi u (terms.symm ▸ hu) w (terms.symm ▸ hw) - let y := ZFSet.pair alpha (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations)) - have hy : y ∈ L := ZFSet.pair_mem_prod.2 ⟨ha, witness _ sourceCondition⟩ - refine ⟨y, hy, (M.pair_mem_retainedPreparationSelections A L R (ZFSet.pair row A) levels x y).2 ?_⟩ - exact ⟨hx, hy, alpha, sourceRow, sourceA, ZFSet.pair k enumerations, rfl, - visit, sourceSubset, inSource.1, level⟩ - -theorem preparedWitnessSelection_entry - {rows T stages packed nodes p A x alpha sourceRow sourceA k enumerations : ZFSet.{u}} - (data : RefinementDataHistory stages packed T) - (entry : ZFSet.pair x (ZFSet.pair alpha - (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ - M.preparedWitnessSelections rows T stages packed nodes p A) : - let Q := M.refinementHistoryForcing rows T stages packed - alpha ∈ stages ∧ ZFSet.pair sourceRow sourceA ∈ Q ∧ sourceA ⊆ A ∧ - k ∈ M.sets ∧ enumerations ∈ M.sets ∧ - ∃ fields : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ - fields 6 = T ∧ fields 10 = nodes ∧ - MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ - x ∈ assignmentOnIndices (fields 0) T sourceA ∧ - ∃ q ∈ fields 7, - ZFSet.pair p q ∈ rowAssignmentCutGraph Q (fields 7) - (refinementDataHistoryLevels stages packed T) alpha ∧ - PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) - (canonicalMeetGraph (fields 10) (fields 11)) (fields 14) (fields 13) (fields 9) - ZFSet.omega (M.storedPreparationRequests sourceA fields) - (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) - (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations := by - let Q := M.refinementHistoryForcing rows T stages packed - obtain ⟨_, _, alpha', row', sourceA', tail, equal, visit, sourceSubset, inSource, level⟩ := - (M.pair_mem_retainedPreparationSelections _ _ _ _ _ _ _).1 entry - obtain ⟨rfl, outputEq⟩ := ZFSet.pair_inj.1 equal - obtain ⟨sourceEq, rfl⟩ := ZFSet.pair_inj.1 outputEq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 sourceEq - obtain ⟨ha, sourceCondition, bounded, fields, stored, terms, nodeCarrier, meet, _raw⟩ := - (M.pair_mem_varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T - alpha (ZFSet.pair sourceRow sourceA) (ZFSet.pair p (ZFSet.pair k enumerations))).1 visit - obtain ⟨k', enums', q, value, hk, he, _hp, hq, _below, cut, family⟩ := - M.varyingPreparation_visit_certificates stages packed Q (ZFSet.prod Q Q) nodes T alpha - sourceRow sourceA p (ZFSet.pair k enumerations) _ _ fields data.function.to_isFunc ha - stored terms nodeCarrier meet visit - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 value - refine ⟨ha, sourceCondition, sourceSubset, hk, he, fields, stored, terms, nodeCarrier, - meet, ?_, q, hq, cut, family⟩ - apply (mem_assignmentOnIndices (fields 0) T sourceA x).2 - refine ⟨inSource, ?_⟩ - obtain ⟨I, indexEntry, shape⟩ := (pair_mem_refinementHistoryAssignmentLevels - data.index_function data.index_literal T x alpha).1 level - have actual := (refinementDataHistoryField_entry data.function fields stored 0 (fields 0)).2 rfl - have same : I = fields 0 := data.index_function.unique indexEntry actual - exact same ▸ shape - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStoredPreparedFamilyActions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRetainedPreparationSelections +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundStoredPreparationFamilyPersistence +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundStoredVisitCertificates + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +def StoredPreparedConditionCode (M : TransitiveGround.{u}) + (rows T stages history nodes p : ZFSet.{u}) : Prop := + let Q := M.refinementHistoryForcing rows T stages history + ∀ row A, p = ZFSet.pair row A → ∀ x ∈ A, + ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ + fields 6 = T ∧ fields 10 = nodes ∧ + MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ + StoredPreparationEnvironment M fields ∧ + ∃ sourceRow sourceA, sourceA ∈ M.sets ∧ ZFSet.pair sourceRow sourceA ∈ Q ∧ + sourceA ⊆ A ∧ x ∈ assignmentOnIndices (fields 0) T sourceA ∧ + ∃ k ∈ M.sets, ∃ enumerations ∈ M.sets, ∃ q ∈ fields 7, + ZFSet.pair p q ∈ rowAssignmentCutGraph Q (fields 7) + (refinementDataHistoryLevels stages history T) alpha ∧ + PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) + (canonicalMeetGraph (fields 10) (fields 11)) (fields 14) (fields 13) (fields 9) + ZFSet.omega (M.storedPreparationRequests sourceA fields) + (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) + (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations + + + + + +def StoredSupportPreparedConditionCode (M : TransitiveGround.{u}) + (rows T stages history nodes p S : ZFSet.{u}) : Prop := + let Q := M.refinementHistoryForcing rows T stages history + ∀ row A, p = ZFSet.pair row A → ∀ x ∈ A, + ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ + fields 6 = T ∧ fields 10 = nodes ∧ + MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ + StoredPreparationEnvironment M fields ∧ + ∃ sourceRow sourceA, sourceA ∈ M.sets ∧ ZFSet.pair sourceRow sourceA ∈ Q ∧ + sourceA ⊆ A ∧ x ∈ assignmentOnIndices (fields 0) T sourceA ∧ + ∃ k ∈ M.sets, ∃ enumerations ∈ M.sets, ∃ q ∈ fields 7, + ZFSet.pair p q ∈ rowAssignmentCutGraph Q (fields 7) + (refinementDataHistoryLevels stages history T) alpha ∧ + PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) + (canonicalMeetGraph (fields 10) (fields 11)) (fields 14) (fields 13) (fields 9) + ZFSet.omega (M.storedPreparationRequests sourceA fields) + (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) + (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations ∧ + certificateUsedSupports nodes k ⊆ S + +theorem StoredSupportPreparedConditionCode.forget + {M : TransitiveGround.{u}} {rows T stages history nodes p S : ZFSet.{u}} + (prepared : StoredSupportPreparedConditionCode M rows T stages history nodes p S) : + StoredPreparedConditionCode M rows T stages history nodes p := by + intro row A equal x member + obtain ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meet, environment, + sourceRow, sourceA, hSourceA, source, subset, selected, + k, hk, enumerations, he, q, hq, cut, family, _supportBound⟩ := prepared row A equal x member + exact ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meet, environment, + sourceRow, sourceA, hSourceA, source, subset, selected, + k, hk, enumerations, he, q, hq, cut, family⟩ + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def preparedWitnessSelections (rows T stages packed nodes p A : ZFSet.{u}) : ZFSet.{u} := + let Q := M.refinementHistoryForcing rows T stages packed + M.retainedPreparationSelections A (ZFSet.prod stages (M.preparationWitnessBound nodes T Q)) + (M.varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T) p + (refinementDataHistoryLevels stages packed T) + +theorem exists_storedPreparedWitnessSelection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows T stages packed nodes row A : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) (hStages : stages ∈ M.sets) + (hPacked : packed ∈ M.sets) (hNodes : nodes ∈ M.sets) + (data : RefinementDataHistory stages packed T) + (condition : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages packed) + (prepared : StoredPreparedConditionCode M rows T stages packed nodes (ZFSet.pair row A)) + (nameBounds : ∀ alpha (fields : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → + fields 14 ⊆ M.groundRelations T (M.refinementHistoryForcing rows T stages packed)) : + let Q := M.refinementHistoryForcing rows T stages packed + let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) + ∃ selections ∈ M.sets, ZFSet.IsFunc A L selections ∧ + selections ⊆ M.preparedWitnessSelections rows T stages packed nodes (ZFSet.pair row A) A ∧ + relationImage A L selections ∈ M.sets ∧ + M.groundEmbeddable (relationImage A L selections) ZFSet.omega := by + let Q := M.refinementHistoryForcing rows T stages packed + let W := M.groundRelations T Q + let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) + let R := M.varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T + let levels := refinementDataHistoryLevels stages packed T + have omega := M.omega_mem separation infinite + have hQ := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hPacked omega + have hp := M.transitive hQ condition + have hA := M.pair_right hp + have candidate := ((M.mem_refinementHistoryForcing rows T stages packed _).1 condition).1 + have smallA := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate).2.2.2 + have hL := M.prod_mem pairing unions powers separation hStages + (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega) + have hR := M.varyingPreparationRelation_mem pairing unions powers separation hStages hPacked hQ + (M.prod_mem pairing unions powers separation hQ hQ) hNodes hT omega + have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hPacked hT + apply M.exists_retainedPreparationSelection pairing unions powers separation infinite choice + hA hL hR hp hLevels smallA + intro x hx + obtain ⟨alpha, ha, fields, stored, terms, nodeCarrier, meet, _environment, + sourceRow, sourceA, _hSourceA, sourceCondition, sourceSubset, selected, + k, hk, enumerations, he, q, _hq, cut, family⟩ := prepared row A rfl x hx + have requestBound : M.storedPreparationRequests sourceA fields ⊆ W := by + intro z hz + apply nameBounds alpha fields stored + rcases ZFSet.mem_union.1 hz with left | right + · exact (mem_relationImage _ _ _ _).1 left |>.1 + · exact (mem_relationImage _ _ _ _).1 right |>.1 + have witness (r : ZFSet.{u}) (hr : r ∈ Q) : + ZFSet.pair r (ZFSet.pair k enumerations) ∈ M.preparationWitnessBound nodes T Q := + M.preparationWitness_mem_of_local requestBound (fun _ h => h) hr hk he family.1 family.2.1 + have visit : ZFSet.pair (ZFSet.pair alpha (ZFSet.pair sourceRow sourceA)) + (ZFSet.pair (ZFSet.pair row A) (ZFSet.pair k enumerations)) ∈ R := by + apply (M.pair_mem_varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T + alpha (ZFSet.pair sourceRow sourceA) (ZFSet.pair (ZFSet.pair row A) (ZFSet.pair k enumerations))).2 + exact ⟨ha, sourceCondition, witness _ condition, fields, stored, terms, nodeCarrier, meet, + sourceRow, sourceA, ZFSet.pair row A, k, enumerations, q, rfl, rfl, + ZFSet.pair_mem_prod.2 ⟨condition, sourceCondition⟩, cut, family⟩ + have inSource := (mem_assignmentOnIndices (fields 0) T sourceA x).1 selected + have level : ZFSet.pair x alpha ∈ levels := by + obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 inSource.2 + exact data.coverage alpha ha fields stored idx hi u (terms.symm ▸ hu) w (terms.symm ▸ hw) + let y := ZFSet.pair alpha (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations)) + have hy : y ∈ L := ZFSet.pair_mem_prod.2 ⟨ha, witness _ sourceCondition⟩ + refine ⟨y, hy, (M.pair_mem_retainedPreparationSelections A L R (ZFSet.pair row A) levels x y).2 ?_⟩ + exact ⟨hx, hy, alpha, sourceRow, sourceA, ZFSet.pair k enumerations, rfl, + visit, sourceSubset, inSource.1, level⟩ + +theorem preparedWitnessSelection_entry + {rows T stages packed nodes p A x alpha sourceRow sourceA k enumerations : ZFSet.{u}} + (data : RefinementDataHistory stages packed T) + (entry : ZFSet.pair x (ZFSet.pair alpha + (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ + M.preparedWitnessSelections rows T stages packed nodes p A) : + let Q := M.refinementHistoryForcing rows T stages packed + alpha ∈ stages ∧ ZFSet.pair sourceRow sourceA ∈ Q ∧ sourceA ⊆ A ∧ + k ∈ M.sets ∧ enumerations ∈ M.sets ∧ + ∃ fields : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ + fields 6 = T ∧ fields 10 = nodes ∧ + MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧ + x ∈ assignmentOnIndices (fields 0) T sourceA ∧ + ∃ q ∈ fields 7, + ZFSet.pair p q ∈ rowAssignmentCutGraph Q (fields 7) + (refinementDataHistoryLevels stages packed T) alpha ∧ + PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) + (canonicalMeetGraph (fields 10) (fields 11)) (fields 14) (fields 13) (fields 9) + ZFSet.omega (M.storedPreparationRequests sourceA fields) + (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) + (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations := by + let Q := M.refinementHistoryForcing rows T stages packed + obtain ⟨_, _, alpha', row', sourceA', tail, equal, visit, sourceSubset, inSource, level⟩ := + (M.pair_mem_retainedPreparationSelections _ _ _ _ _ _ _).1 entry + obtain ⟨rfl, outputEq⟩ := ZFSet.pair_inj.1 equal + obtain ⟨sourceEq, rfl⟩ := ZFSet.pair_inj.1 outputEq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 sourceEq + obtain ⟨ha, sourceCondition, bounded, fields, stored, terms, nodeCarrier, meet, _raw⟩ := + (M.pair_mem_varyingPreparationRelation stages packed Q (ZFSet.prod Q Q) nodes T + alpha (ZFSet.pair sourceRow sourceA) (ZFSet.pair p (ZFSet.pair k enumerations))).1 visit + obtain ⟨k', enums', q, value, hk, he, _hp, hq, _below, cut, family⟩ := + M.varyingPreparation_visit_certificates stages packed Q (ZFSet.prod Q Q) nodes T alpha + sourceRow sourceA p (ZFSet.pair k enumerations) _ _ fields data.function.to_isFunc ha + stored terms nodeCarrier meet visit + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 value + refine ⟨ha, sourceCondition, sourceSubset, hk, he, fields, stored, terms, nodeCarrier, + meet, ?_, q, hq, cut, family⟩ + apply (mem_assignmentOnIndices (fields 0) T sourceA x).2 + refine ⟨inSource, ?_⟩ + obtain ⟨I, indexEntry, shape⟩ := (pair_mem_refinementHistoryAssignmentLevels + data.index_function data.index_literal T x alpha).1 level + have actual := (refinementDataHistoryField_entry data.function fields stored 0 (fields 0)).2 rfl + have same : I = fields 0 := data.index_function.unique indexEntry actual + exact same ▸ shape + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPrincipalSupportZF.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPrincipalSupportZF.lean index d5f74d24277c96339effde06284a7ebb219dc45b..47557891383bf1222dba37fb8a497029ab7c9e46 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPrincipalSupportZF.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPrincipalSupportZF.lean @@ -1,199 +1,199 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PrincipalSupportFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorFullActionGraph -import OAI.SetTheory.PartitionPrinciple.Geometry.RowAtomicDescent - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G : Type u} [Group G] -variable (t : Presentation G) (b : Presentation I) (K : I → Subgroup G) - -theorem supportBasis_fiber_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (separation : SeparationSchema M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (i : I) : - t.subset (fun g => g ∈ K i) ∈ M.sets := by - have hi := M.transitive indices (b.encode_mem i) - let params := extend (b.encode i) (extend (supportBasisCode b t K) Fin.elim0) - have selected := M.separation_mem separation (pairMembershipFormula 1 0 2) params - (Fin.cases hi (Fin.cases supports (fun j => Fin.elim0 j))) group - have eq : ZFSet.sep (fun y => Realize M.sets (pairMembershipFormula 1 0 2) (extend y params)) t.carrier = - t.subset (fun g => g ∈ K i) := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hy, rel⟩ - obtain ⟨g, rfl⟩ := (t.mem_carrier y).1 hy - apply (t.encode_mem_subset (fun g => g ∈ K i) g).2 - exact (pair_mem_supportBasisCode b t K i g).1 - ((M.realize_pairMembershipFormula pairing 1 0 2 (extend (t.encode g) params) - hi (M.transitive group hy) supports).1 rel) - · intro hy - obtain ⟨g, hg, rfl⟩ := (t.mem_subset (fun g => g ∈ K i) y).1 hy - exact ⟨t.encode_mem g, (M.realize_pairMembershipFormula pairing 1 0 2 - (extend (t.encode g) params) hi (M.transitive group (t.encode_mem g)) supports).2 - ((pair_mem_supportBasisCode b t K i g).2 hg)⟩ - exact eq ▸ selected - -variable {P : Type u} [PartialOrder P] (a : PosetAction G P) (s : Presentation P) - -theorem basis_mix_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (i : I) (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) : (a.mix s (K i) p τ).val ∈ M.sets := - M.mix_mem a s t pairing unions powers separation collection carrier order group maps (K i) - (M.supportBasis_fiber_mem t b K pairing separation group indices supports i) p τ hτ - -theorem basis_symmetric_mix (F : NormalSubgroupFamily G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (i : I) (p : P) (τ : Name s) (hτ : τ ∈ (a.symmetricDomain s (M.nameDomain s) F).names) : - a.mix s (K i) p τ ∈ (a.symmetricDomain s (M.nameDomain s) F).names := - ⟨M.basis_mix_mem t b K a s pairing unions powers separation collection carrier order group indices supports maps i p τ hτ.1, - a.mix_hs s F (K i) ((basis (K i)).2 ⟨i, le_rfl⟩) p hτ.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G I : Type u} [Group G] [PartialOrder I] -variable (d : PosetAction G I) (b : Presentation I) (t : Presentation G) - -theorem realize_principalSupportEntry (z : ZFSet.{u}) (hz : z ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (order : b.conditionOrder ∈ M.sets) (graph : d.actionGraph b t ∈ M.sets) : - Realize M.sets (BoundedFormula.principalSupportEntryFormula 0 1 2 3 4).toFormula - (extend z (extend b.carrier (extend t.carrier - (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ - z ∈ supportBasisCode b t d.principalFix := - (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz (Fin.cases nodes (Fin.cases group - (Fin.cases order (Fin.cases graph (fun j => Fin.elim0 j))))))).trans - (BoundedFormula.principalSupportEntry_correct d b t z) - -theorem principalSupportBasis_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (nodes : b.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (order : b.conditionOrder ∈ M.sets) (graph : d.actionGraph b t ∈ M.sets) : - supportBasisCode b t d.principalFix ∈ M.sets := by - obtain ⟨B, hB, bounds⟩ := M.exists_pair_bound pairing unions powers nodes group - let params := extend b.carrier (extend t.carrier - (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))) - have selected := M.separation_mem separation (BoundedFormula.principalSupportEntryFormula 0 1 2 3 4).toFormula - params (Fin.cases nodes (Fin.cases group (Fin.cases order (Fin.cases graph (fun j => Fin.elim0 j))))) hB - have eq : ZFSet.sep (fun z => Realize M.sets - (BoundedFormula.principalSupportEntryFormula 0 1 2 3 4).toFormula (extend z params)) B = - supportBasisCode b t d.principalFix := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (M.realize_principalSupportEntry d b t z (M.transitive hB hz) nodes group order graph).1 rel - · intro hz - have hzB : z ∈ B := by - obtain ⟨⟨C, g⟩, _, eq⟩ := ((b.product t).mem_subset (fun z => z.2 ∈ d.principalFix z.1) z).1 hz - exact eq ▸ bounds _ (b.encode_mem C) _ (t.encode_mem g) - exact ⟨hzB, (M.realize_principalSupportEntry d b t z (M.transitive hB hzB) nodes group order graph).2 hz⟩ - exact eq ▸ selected - -theorem principalFix_code_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (nodes : b.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (order : b.conditionOrder ∈ M.sets) (graph : d.actionGraph b t ∈ M.sets) (C : I) : - t.subset (fun g => g ∈ d.principalFix C) ∈ M.sets := - M.supportBasis_fiber_mem t b d.principalFix pairing separation group nodes - (M.principalSupportBasis_mem d b t pairing unions powers separation nodes group order graph) C - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.Rows - -open SetRealization SetFormula Compression.RecursiveMaps -open Compression.RecursiveMaps.CountableColumns Compression.RecursiveMaps.MainStage.OrdinalRun - -theorem ground_row_common_support (M : TransitiveGround.{1}) - (t : Presentation (FinalActor Column)) (b : Presentation (FinalPoint Column)) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : namePresentation.carrier ∈ M.sets) (order : namePresentation.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t (fun W => (finalAction Column).fixSubgroup W) ∈ M.sets) - (maps : posetAction.conditionMapFamily namePresentation t ∈ M.sets) - (H : ConditionFilter RowForcing) (generic : H.GenericFor (rowAtomicFamily (M.nameDomain namePresentation))) - (C B : FinalPoint Column) (x y : Name namePresentation) - (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) - (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) - (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) - (hs : HereditarilySymmetric posetAction namePresentation (supportFamily Column) x) - (values : Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} y) : - ∃ z : Name namePresentation, z.val ∈ M.sets ∧ - HereditarilySymmetric posetAction namePresentation (supportFamily Column) z ∧ - (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) ≤ posetAction.stabilizer namePresentation z ∧ - Name.nameRank z ≤ Name.nameRank x ∧ Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by - exact row_common_support_of_eval_eq (M.nameDomain namePresentation) - (fun g τ hτ => M.act_mem namePresentation posetAction t pairing unions powers separation collection carrier maps g τ hτ) - (fun W p τ hτ => M.basis_mix_mem t b (fun W => (finalAction Column).fixSubgroup W) - posetAction namePresentation pairing unions powers separation collection carrier order group indices supports maps W p τ hτ) - H generic C B x y hx hy sx sy hs values - -end PartitionPilot.Forcing.Rows - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder I] [PartialOrder P] [OrderTop P] -variable (d : PosetAction G I) (a : PosetAction G P) -variable (b : Presentation I) (s : Presentation P) (t : Presentation G) - -theorem exists_ZF_from_principalSupports (C : I) - (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (support_order : b.conditionOrder ∈ M.sets) (support_action : d.actionGraph b t ∈ M.sets) - (forcing_action : a.actionGraph s t ∈ M.sets) (p : P) : - let F := d.principalSupportFamily C directed - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ - M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ - ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) := - M.exists_ZF_interpretation_from_actionGraph a s t b (d.principalSupportFamily C directed) d.principalFix - (d.principalSupportFamily_basis C directed) small pairing unions powers separation collection infinite - carrier order group nodes - (M.principalSupportBasis_mem d b t pairing unions powers separation nodes group support_order support_action) - forcing_action p - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PrincipalSupportFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorFullActionGraph +import OAI.SetTheory.PartitionPrinciple.Geometry.RowAtomicDescent + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G : Type u} [Group G] +variable (t : Presentation G) (b : Presentation I) (K : I → Subgroup G) + +theorem supportBasis_fiber_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (separation : SeparationSchema M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (i : I) : + t.subset (fun g => g ∈ K i) ∈ M.sets := by + have hi := M.transitive indices (b.encode_mem i) + let params := extend (b.encode i) (extend (supportBasisCode b t K) Fin.elim0) + have selected := M.separation_mem separation (pairMembershipFormula 1 0 2) params + (Fin.cases hi (Fin.cases supports (fun j => Fin.elim0 j))) group + have eq : ZFSet.sep (fun y => Realize M.sets (pairMembershipFormula 1 0 2) (extend y params)) t.carrier = + t.subset (fun g => g ∈ K i) := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hy, rel⟩ + obtain ⟨g, rfl⟩ := (t.mem_carrier y).1 hy + apply (t.encode_mem_subset (fun g => g ∈ K i) g).2 + exact (pair_mem_supportBasisCode b t K i g).1 + ((M.realize_pairMembershipFormula pairing 1 0 2 (extend (t.encode g) params) + hi (M.transitive group hy) supports).1 rel) + · intro hy + obtain ⟨g, hg, rfl⟩ := (t.mem_subset (fun g => g ∈ K i) y).1 hy + exact ⟨t.encode_mem g, (M.realize_pairMembershipFormula pairing 1 0 2 + (extend (t.encode g) params) hi (M.transitive group (t.encode_mem g)) supports).2 + ((pair_mem_supportBasisCode b t K i g).2 hg)⟩ + exact eq ▸ selected + +variable {P : Type u} [PartialOrder P] (a : PosetAction G P) (s : Presentation P) + +theorem basis_mix_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (i : I) (p : P) (τ : Name s) (hτ : τ.val ∈ M.sets) : (a.mix s (K i) p τ).val ∈ M.sets := + M.mix_mem a s t pairing unions powers separation collection carrier order group maps (K i) + (M.supportBasis_fiber_mem t b K pairing separation group indices supports i) p τ hτ + +theorem basis_symmetric_mix (F : NormalSubgroupFamily G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (i : I) (p : P) (τ : Name s) (hτ : τ ∈ (a.symmetricDomain s (M.nameDomain s) F).names) : + a.mix s (K i) p τ ∈ (a.symmetricDomain s (M.nameDomain s) F).names := + ⟨M.basis_mix_mem t b K a s pairing unions powers separation collection carrier order group indices supports maps i p τ hτ.1, + a.mix_hs s F (K i) ((basis (K i)).2 ⟨i, le_rfl⟩) p hτ.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G I : Type u} [Group G] [PartialOrder I] +variable (d : PosetAction G I) (b : Presentation I) (t : Presentation G) + +theorem realize_principalSupportEntry (z : ZFSet.{u}) (hz : z ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (order : b.conditionOrder ∈ M.sets) (graph : d.actionGraph b t ∈ M.sets) : + Realize M.sets (BoundedFormula.principalSupportEntryFormula 0 1 2 3 4).toFormula + (extend z (extend b.carrier (extend t.carrier + (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ + z ∈ supportBasisCode b t d.principalFix := + (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz (Fin.cases nodes (Fin.cases group + (Fin.cases order (Fin.cases graph (fun j => Fin.elim0 j))))))).trans + (BoundedFormula.principalSupportEntry_correct d b t z) + +theorem principalSupportBasis_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (nodes : b.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (order : b.conditionOrder ∈ M.sets) (graph : d.actionGraph b t ∈ M.sets) : + supportBasisCode b t d.principalFix ∈ M.sets := by + obtain ⟨B, hB, bounds⟩ := M.exists_pair_bound pairing unions powers nodes group + let params := extend b.carrier (extend t.carrier + (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))) + have selected := M.separation_mem separation (BoundedFormula.principalSupportEntryFormula 0 1 2 3 4).toFormula + params (Fin.cases nodes (Fin.cases group (Fin.cases order (Fin.cases graph (fun j => Fin.elim0 j))))) hB + have eq : ZFSet.sep (fun z => Realize M.sets + (BoundedFormula.principalSupportEntryFormula 0 1 2 3 4).toFormula (extend z params)) B = + supportBasisCode b t d.principalFix := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (M.realize_principalSupportEntry d b t z (M.transitive hB hz) nodes group order graph).1 rel + · intro hz + have hzB : z ∈ B := by + obtain ⟨⟨C, g⟩, _, eq⟩ := ((b.product t).mem_subset (fun z => z.2 ∈ d.principalFix z.1) z).1 hz + exact eq ▸ bounds _ (b.encode_mem C) _ (t.encode_mem g) + exact ⟨hzB, (M.realize_principalSupportEntry d b t z (M.transitive hB hzB) nodes group order graph).2 hz⟩ + exact eq ▸ selected + +theorem principalFix_code_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (nodes : b.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (order : b.conditionOrder ∈ M.sets) (graph : d.actionGraph b t ∈ M.sets) (C : I) : + t.subset (fun g => g ∈ d.principalFix C) ∈ M.sets := + M.supportBasis_fiber_mem t b d.principalFix pairing separation group nodes + (M.principalSupportBasis_mem d b t pairing unions powers separation nodes group order graph) C + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.Rows + +open SetRealization SetFormula Compression.RecursiveMaps +open Compression.RecursiveMaps.CountableColumns Compression.RecursiveMaps.MainStage.OrdinalRun + +theorem ground_row_common_support (M : TransitiveGround.{1}) + (t : Presentation (FinalActor Column)) (b : Presentation (FinalPoint Column)) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : namePresentation.carrier ∈ M.sets) (order : namePresentation.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t (fun W => (finalAction Column).fixSubgroup W) ∈ M.sets) + (maps : posetAction.conditionMapFamily namePresentation t ∈ M.sets) + (H : ConditionFilter RowForcing) (generic : H.GenericFor (rowAtomicFamily (M.nameDomain namePresentation))) + (C B : FinalPoint Column) (x y : Name namePresentation) + (hx : x.val ∈ M.sets) (hy : y.val ∈ M.sets) + (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) + (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) + (hs : HereditarilySymmetric posetAction namePresentation (supportFamily Column) x) + (values : Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} y) : + ∃ z : Name namePresentation, z.val ∈ M.sets ∧ + HereditarilySymmetric posetAction namePresentation (supportFamily Column) z ∧ + (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) ≤ posetAction.stabilizer namePresentation z ∧ + Name.nameRank z ≤ Name.nameRank x ∧ Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by + exact row_common_support_of_eval_eq (M.nameDomain namePresentation) + (fun g τ hτ => M.act_mem namePresentation posetAction t pairing unions powers separation collection carrier maps g τ hτ) + (fun W p τ hτ => M.basis_mix_mem t b (fun W => (finalAction Column).fixSubgroup W) + posetAction namePresentation pairing unions powers separation collection carrier order group indices supports maps W p τ hτ) + H generic C B x y hx hy sx sy hs values + +end PartitionPilot.Forcing.Rows + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder I] [PartialOrder P] [OrderTop P] +variable (d : PosetAction G I) (a : PosetAction G P) +variable (b : Presentation I) (s : Presentation P) (t : Presentation G) + +theorem exists_ZF_from_principalSupports (C : I) + (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (support_order : b.conditionOrder ∈ M.sets) (support_action : d.actionGraph b t ∈ M.sets) + (forcing_action : a.actionGraph s t ∈ M.sets) (p : P) : + let F := d.principalSupportFamily C directed + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ + M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ + ZFRealization ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) := + M.exists_ZF_interpretation_from_actionGraph a s t b (d.principalSupportFamily C directed) d.principalFix + (d.principalSupportFamily_basis C directed) small pairing unions powers separation collection infinite + carrier order group nodes + (M.principalSupportBasis_mem d b t pairing unions powers separation nodes group support_order support_action) + forcing_action p + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductActions.lean index 4299d6df8e3e212efc1bb82708015cae1d657f1f..88f1d4bd85bf4f36838f01dc5c8779983a0203c0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductActions.lean @@ -1,801 +1,801 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedInjectiveCones -import OAI.SetTheory.PartitionPrinciple.Definability.RawRenameFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.SeparationFulfillmentCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.DecodedGroundGroups - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def renameStateFormula : SetFormula 4 := - ex (ex (.conj (orderedPairFormula 2 1 0) (renameStepFormula 4 5 3 1 0))) - -def renameCertificateFormula : SetFormula 3 := postfixedFormula renameStateFormula - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -noncomputable def renameParameters (f : P → P) : Fin 2 → ZFSet.{u} := - extend s.carrier (extend (s.graph s f) Fin.elim0) - -theorem realize_renameState - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (z R : ZFSet.{u}) (hz : z ∈ M.sets) (hr : R ∈ M.sets) : - Realize M.sets renameStateFormula (extend z (extend R (renameParameters s f))) ↔ - ∃ x ∈ M.sets, ∃ y ∈ M.sets, z = ZFSet.pair x y ∧ M.RawRenameStep s f R x y := by - rw [renameStateFormula, realize_ex] - apply exists_congr - intro x - apply and_congr_right - intro hx - rw [realize_ex] - apply exists_congr - intro y - apply and_congr_right - intro hy - let e := extend y (extend x (extend z (extend R (renameParameters s f)))) - change (Realize M.sets _ e ∧ Realize M.sets _ e) ↔ _ - rw [M.realize_orderedPairFormula pairing 2 1 0 e hz hx hy, - M.realize_renameStepFormula s pairing carrier f graph 4 5 3 1 0 e rfl rfl hr hx hy] - rfl - -theorem rawRenameStep_names (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (f : P → P) (R : ZFSet.{u}) (σ τ : D.names) : - M.RawRenameStep s f R σ.val.val τ.val.val ↔ - Name.RenameStep f (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) σ.val τ.val := by - constructor - · rintro ⟨left, right⟩ - constructor - · intro ν p entry - obtain ⟨w, _, q, matched, cond, rel⟩ := left ν.val (ground ν (D.children σ.property entry)) p entry - change f p = q at cond - subst q - let ρ : Name s := ⟨w, Name.isName_of_pair_mem τ.val w (f p) matched⟩ - exact ⟨ρ, matched, rel⟩ - · intro ρ q entry - obtain ⟨v, _, p, matched, cond, rel⟩ := right ρ.val (ground ρ (D.children τ.property entry)) q entry - let ν : Name s := ⟨v, Name.isName_of_pair_mem σ.val v p matched⟩ - exact ⟨ν, p, matched, cond, rel⟩ - · rintro ⟨left, right⟩ - constructor - · intro v _ p entry - let ν : Name s := ⟨v, Name.isName_of_pair_mem σ.val v p entry⟩ - obtain ⟨ρ, matched, rel⟩ := left ν p entry - exact ⟨ρ.val, ground ρ (D.children τ.property matched), f p, matched, rfl, rel⟩ - · intro w _ q entry - let ρ : Name s := ⟨w, Name.isName_of_pair_mem τ.val w q entry⟩ - obtain ⟨ν, p, matched, cond, rel⟩ := right ρ q entry - exact ⟨ν.val, ground ν (D.children σ.property matched), p, matched, cond, rel⟩ - -theorem realize_renameState_names (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (R : ZFSet.{u}) (hr : R ∈ M.sets) (σ τ : D.names) : - Realize M.sets renameStateFormula - (extend (ZFSet.pair σ.val.val τ.val.val) (extend R (renameParameters s f))) ↔ - Name.RenameStep f (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) σ.val τ.val := by - have hz := M.orderedPair_mem pairing (ground σ.val σ.property) (ground τ.val τ.property) - rw [M.realize_renameState s pairing carrier f graph _ R hz hr] - constructor - · rintro ⟨x, _, y, _, shape, step⟩ - obtain ⟨sx, ty⟩ := ZFSet.pair_inj.1 shape - subst x - subst y - exact (M.rawRenameStep_names s D ground f R σ τ).1 step - · intro step - exact ⟨σ.val.val, ground σ.val σ.property, τ.val.val, ground τ.val τ.property, rfl, - (M.rawRenameStep_names s D ground f R σ τ).2 step⟩ - -theorem renameCertificate_sound (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - {R : ZFSet.{u}} (hr : R ∈ M.sets) - (certificate : Realize M.sets renameCertificateFormula (extend R (renameParameters s f))) - (σ τ : D.names) : ZFSet.pair σ.val.val τ.val.val ∈ R → Name.rename s f σ.val = τ.val := by - apply Name.rename_postfixed_sound D f (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) _ - σ.val σ.property τ.val τ.property - intro ν hν ρ hρ rel - exact (M.realize_renameState_names s D ground pairing carrier f graph R hr ⟨ν, hν⟩ ⟨ρ, hρ⟩).1 - ((realize_imp M.sets _ _ _).1 (certificate _ (M.transitive hr rel)) rel) - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem exists_renameState_fixedPoint - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (B : ZFSet.{u}) (hB : B ∈ M.sets) : - ∃ R ∈ M.sets, R ⊆ B ∧ definableOperator M.sets renameStateFormula (renameParameters s f) B R = R := by - have members : ∀ i, renameParameters s f i ∈ M.sets := - Fin.cases carrier (Fin.cases graph (fun i => Fin.elim0 i)) - have mono : ∀ R ∈ M.sets, ∀ S ∈ M.sets, R ⊆ B → S ⊆ B → R ⊆ S → - definableOperator M.sets renameStateFormula (renameParameters s f) B R ⊆ - definableOperator M.sets renameStateFormula (renameParameters s f) B S := by - intro R hr S hs _ _ sub z hz - obtain ⟨hzB, step⟩ := ZFSet.mem_sep.1 hz - have hzM := M.transitive hB hzB - obtain ⟨x, hx, y, hy, shape, raw⟩ := (M.realize_renameState s pairing carrier f graph z R hzM hr).1 step - exact ZFSet.mem_sep.2 ⟨hzB, (M.realize_renameState s pairing carrier f graph z S hzM hs).2 - ⟨x, hx, y, hy, shape, M.rawRenameStep_mono s f sub raw⟩⟩ - obtain ⟨R, hr, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation - renameStateFormula (renameParameters s f) members hB mono - exact ⟨R, hr, bound, fixed⟩ - -theorem exists_groundRename_certificate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) (eq : Name.rename s f σ = τ) : - ∃ R ∈ M.sets, Realize M.sets renameCertificateFormula (extend R (renameParameters s f)) ∧ - ZFSet.pair σ.val τ.val ∈ R := by - obtain ⟨T, hT, σT, τT, trans⟩ := M.exists_pair_transitiveCover pairing unions separation collection hσ hτ - let D := namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy) - have ground : ∀ ν ∈ D.names, ν.val ∈ M.sets := fun _ h => M.transitive hT h - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT - obtain ⟨R, hr, bound, fixed⟩ := M.exists_renameState_fixedPoint s pairing unions powers separation - carrier f graph B hB - have certificate : Realize M.sets renameCertificateFormula (extend R (renameParameters s f)) := by - apply (M.realize_postfixedFormula renameStateFormula (renameParameters s f) hr bound).2 - rw [fixed] - have pre : ∀ ν ∈ D.names, ∀ ρ ∈ D.names, - Name.RenameStep f (fun χ ψ => ZFSet.pair χ.val ψ.val ∈ R) ν ρ → ZFSet.pair ν.val ρ.val ∈ R := by - intro ν hν ρ hρ step - have member : ZFSet.pair ν.val ρ.val ∈ - definableOperator M.sets renameStateFormula (renameParameters s f) B R := - ZFSet.mem_sep.2 ⟨pairBound ν.val hν ρ.val hρ, - (M.realize_renameState_names s D ground pairing carrier f graph R hr ⟨ν, hν⟩ ⟨ρ, hρ⟩).2 step⟩ - rwa [fixed] at member - exact ⟨R, hr, certificate, Name.rename_prefixed_complete D f - (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) pre σ σT τ τT eq⟩ - -theorem rename_eq_iff_exists_certificate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : - Name.rename s f σ = τ ↔ - ∃ R ∈ M.sets, Realize M.sets renameCertificateFormula (extend R (renameParameters s f)) ∧ - ZFSet.pair σ.val τ.val ∈ R := by - constructor - · exact M.exists_groundRename_certificate s pairing unions powers separation collection carrier f graph σ τ hσ hτ - · rintro ⟨R, hr, certificate, member⟩ - exact M.renameCertificate_sound s (M.nameDomain s) (fun _ h => h) pairing carrier f graph hr - certificate ⟨σ, hσ⟩ ⟨τ, hτ⟩ member - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -universe u - -def binaryApplication {k n : Nat} (φ : SetFormula (k + 2)) (params : Fin k → Fin n) - (x y : Fin n) : SetFormula n := reindex (extend x (extend y params)) φ - -theorem realize_binaryApplication (U : Set ZFSet.{u}) {k n : Nat} (φ : SetFormula (k + 2)) - (params : Fin k → Fin n) (x y : Fin n) (env : Fin n → ZFSet.{u}) : - Realize U (binaryApplication φ params x y) env ↔ - Realize U φ (extend (env x) (extend (env y) (fun i => env (params i)))) := by - rw [binaryApplication, realize_reindex, map_extend, map_extend] - -def uniformRenameFormula : SetFormula 4 := - ex (.conj (atomicApplication renameCertificateFormula Fin.elim0 0 3 4) - (pairMembershipFormula 1 2 0)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem realize_uniformRenameFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) - (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : - Realize M.sets uniformRenameFormula (extend σ.val (extend τ.val (renameParameters s f))) ↔ - Name.rename s f σ = τ := by - rw [M.rename_eq_iff_exists_certificate s pairing unions powers separation collection carrier f graph σ τ hσ hτ, - uniformRenameFormula, realize_ex] - apply exists_congr - intro R - apply and_congr_right - intro hr - let env := extend R (extend σ.val (extend τ.val (renameParameters s f))) - change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ - rw [realize_atomicApplication, map_empty, - M.realize_pairMembershipFormula pairing 1 2 0 env hσ hτ hr] - rfl - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization -universe u -variable {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -noncomputable def conditionMapFamily : ZFSet.{u} := - ZFSet.range (fun g : G => ZFSet.pair (t.encode g) (s.graph s (a.iso g))) - -theorem pair_mem_conditionMapFamily (g : G) (F : ZFSet.{u}) : - ZFSet.pair (t.encode g) F ∈ a.conditionMapFamily s t ↔ F = s.graph s (a.iso g) := by - rw [conditionMapFamily, ZFSet.mem_range] - constructor - · rintro ⟨h, eq⟩ - obtain ⟨hg, value⟩ := ZFSet.pair_inj.1 eq - have hgeq := t.injective hg - subst h - exact value.symm - · intro eq - exact ⟨g, congrArg (ZFSet.pair (t.encode g)) eq.symm⟩ - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] - -theorem conditionMap_graph_mem (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - (maps : a.conditionMapFamily s t ∈ M.sets) (g : G) : s.graph s (a.iso g) ∈ M.sets := - M.pair_right (M.transitive maps ((a.pair_mem_conditionMapFamily s t g _).2 rfl)) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization -universe u -variable {G P : Type u} [Group G] [PartialOrder P] - -noncomputable def actionGraph (a : PosetAction G P) (s : Presentation P) (t : Presentation G) : ZFSet.{u} := - (t.product s).graph s (fun x => a.iso x.1 x.2) - -theorem triple_mem_actionGraph (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - (g : G) (p q : P) : - ZFSet.pair (ZFSet.pair (t.encode g) (s.encode p)) (s.encode q) ∈ a.actionGraph s t ↔ a.iso g p = q := - (t.product s).pair_mem_graph s (fun x => a.iso x.1 x.2) (g, p) q - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.PosetActionCode - -open SetRealization -universe u -variable {G P m i e R A : ZFSet.{u}} (h : PosetActionCode G P m e R A) - -noncomputable def act (g : SetMembers G) (p : SetMembers P) : SetMembers P := - ((SetMembers.presentation G).product (SetMembers.presentation P)).decodeFunction - (SetMembers.presentation P) A h.function (g, p) - -theorem act_mem (g : SetMembers G) (p : SetMembers P) : - ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw p)) (SetMembers.raw (h.act g p)) ∈ A := - ((SetMembers.presentation G).product (SetMembers.presentation P)).decodeFunction_mem - (SetMembers.presentation P) A h.function (g, p) - -theorem act_eq_iff (g : SetMembers G) (p q : SetMembers P) : h.act g p = q ↔ - ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw p)) (SetMembers.raw q) ∈ A := - ((SetMembers.presentation G).product (SetMembers.presentation P)).decodeFunction_iff - (SetMembers.presentation P) A h.function (g, p) q - -theorem act_one (group : GroupCode G m i e) (p : SetMembers P) : - letI _decodedGroup := group.toGroup - h.act 1 p = p := by - let decodedGroup := group.toGroup - apply (h.act_eq_iff _ _ _).2 - change ZFSet.pair (ZFSet.pair (SetMembers.raw group.one) (SetMembers.raw p)) (SetMembers.raw p) ∈ A - rw [group.raw_one] - exact h.one _ (SetMembers.raw_mem p) - -theorem act_mul (group : GroupCode G m i e) (g j : SetMembers G) (p : SetMembers P) : - letI _decodedGroup := group.toGroup - h.act (g * j) p = h.act g (h.act j p) := by - let decodedGroup := group.toGroup - apply (h.act_eq_iff _ _ _).2 - exact h.mul _ (SetMembers.raw_mem g) _ (SetMembers.raw_mem j) _ (SetMembers.raw_mem (g * j)) - _ (SetMembers.raw_mem p) _ (SetMembers.raw_mem (h.act j p)) _ (SetMembers.raw_mem (h.act g (h.act j p))) - (group.mul_mem g j) (h.act_mem j p) (h.act_mem g (h.act j p)) - -theorem act_inv_left (group : GroupCode G m i e) (g : SetMembers G) (p : SetMembers P) : - letI _decodedGroup := group.toGroup - h.act g⁻¹ (h.act g p) = p := by - let decodedGroup := group.toGroup - rw [← h.act_mul group, inv_mul_cancel, h.act_one group] - -theorem act_inv_right (group : GroupCode G m i e) (g : SetMembers G) (p : SetMembers P) : - letI _decodedGroup := group.toGroup - h.act g (h.act g⁻¹ p) = p := by - let decodedGroup := group.toGroup - rw [← h.act_mul group, mul_inv_cancel, h.act_one group] - -theorem act_monotone (order : PartialOrderCode P R) (g : SetMembers G) : - letI _decodedOrder := order.toPartialOrder - Monotone (h.act g) := by - let decodedOrder := order.toPartialOrder - intro p q pq - exact h.monotone _ (SetMembers.raw_mem g) _ (SetMembers.raw_mem p) _ (SetMembers.raw_mem q) - _ (SetMembers.raw_mem (h.act g p)) _ (SetMembers.raw_mem (h.act g q)) - (h.act_mem g p) (h.act_mem g q) pq - -theorem act_le_iff (group : GroupCode G m i e) (order : PartialOrderCode P R) - (g : SetMembers G) (p q : SetMembers P) : - letI _decodedGroup := group.toGroup - letI _decodedOrder := order.toPartialOrder - h.act g p ≤ h.act g q ↔ p ≤ q := by - let decodedGroup := group.toGroup - let decodedOrder := order.toPartialOrder - constructor - · intro le - have back := h.act_monotone order g⁻¹ le - simpa only [h.act_inv_left group] using back - · exact fun le => h.act_monotone order g le - -noncomputable def toPosetAction (group : GroupCode G m i e) (order : PartialOrderCode P R) : - letI _decodedGroup := group.toGroup - letI _decodedOrder := order.toPartialOrder - PosetAction (SetMembers G) (SetMembers P) := by - letI decodedGroup := group.toGroup - letI decodedOrder := order.toPartialOrder - exact { - iso := fun g => { - toFun := h.act g - invFun := h.act g⁻¹ - left_inv := h.act_inv_left group g - right_inv := h.act_inv_right group g - map_rel_iff' := h.act_le_iff group order g _ _ } - one := h.act_one group - mul := h.act_mul group } - -theorem actionGraph_eq (group : GroupCode G m i e) (order : PartialOrderCode P R) : - letI _decodedGroup := group.toGroup - letI _decodedOrder := order.toPartialOrder - (h.toPosetAction group order).actionGraph (SetMembers.presentation P) (SetMembers.presentation G) = A := by - let decodedGroup := group.toGroup - let decodedOrder := order.toPartialOrder - exact ((SetMembers.presentation G).product (SetMembers.presentation P)).graph_decodeFunction - (SetMembers.presentation P) A h.function - -end PartitionPilot.Forcing.PosetActionCode - -end - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -def identityPosetAction (G P : Type u) [Group G] [PartialOrder P] : PosetAction G P where - iso _ := OrderIso.refl P - one _ := rfl - mul _ _ _ := rfl - -def trivialGroupPresentation : Presentation (Equiv.Perm (ULift.{u} Unit)) where - carrier := {∅} - encode _ := ∅ - injective := fun _ _ _ => Subsingleton.elim _ _ - mem_carrier x := by - rw [ZFSet.mem_singleton] - exact ⟨fun h => ⟨1, h.symm⟩, fun ⟨_, h⟩ => h.symm⟩ - -theorem identityPosetAction_graph_eq {G P : Type u} [Group G] [PartialOrder P] - (s : Presentation P) (g : G) : - s.graph s ((identityPosetAction G P).iso g) = identityFunctionGraph s.carrier := by - apply ZFSet.ext - intro z - rw [s.mem_graph, mem_identityFunctionGraph] - constructor - · rintro ⟨p, eq⟩ - exact ⟨s.encode p, s.encode_mem p, eq.symm⟩ - · rintro ⟨x, hx, rfl⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - exact ⟨p, rfl⟩ - -theorem identityPosetAction_conditionMapFamily {P : Type u} [PartialOrder P] - (s : Presentation P) : - (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P).conditionMapFamily - s trivialGroupPresentation = {ZFSet.pair ∅ (identityFunctionGraph s.carrier)} := by - apply ZFSet.ext - intro z - rw [PosetAction.conditionMapFamily, ZFSet.mem_range, ZFSet.mem_singleton] - constructor - · rintro ⟨g, eq⟩ - change ZFSet.pair ∅ (s.graph s ((identityPosetAction _ P).iso g)) = z at eq - rw [identityPosetAction_graph_eq] at eq - exact eq.symm - · intro eq - refine ⟨1, ?_⟩ - change ZFSet.pair ∅ (s.graph s ((identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P).iso 1)) = z - rw [identityPosetAction_graph_eq] - exact eq.symm - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem trivialGroupPresentation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (nonempty : M.sets.Nonempty) : - trivialGroupPresentation.carrier ∈ M.sets := by - change ({∅} : ZFSet.{u}) ∈ M.sets - simpa only [ZFSet.pair_eq_singleton] using - M.unorderedPair_mem pairing (M.empty_mem nonempty) (M.empty_mem nonempty) - -theorem identityPosetAction_conditionMapFamily_mem {P : Type u} [PartialOrder P] - (s : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) : - (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P).conditionMapFamily - s trivialGroupPresentation ∈ M.sets := by - rw [identityPosetAction_conditionMapFamily] - have entry := M.orderedPair_mem pairing (M.empty_mem ⟨s.carrier, carrier⟩) - (M.identityFunctionGraph_mem pairing unions powers separation carrier) - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing entry entry - -end TransitiveGround - -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def nameActionFormula : SetFormula 5 := - ex (.conj (pairMembershipFormula 1 0 5) - (binaryApplication uniformRenameFormula (extend 4 (extend 0 Fin.elim0)) 2 3)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem realize_nameActionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (g : G) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : - Realize M.sets nameActionFormula - (extend (t.encode g) (extend σ.val (extend τ.val - (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ - a.act s g σ = τ := by - rw [nameActionFormula, realize_ex] - have hg := M.transitive group (t.encode_mem g) - have graph := M.conditionMap_graph_mem a s t maps g - let base := extend (t.encode g) (extend σ.val (extend τ.val - (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))) - constructor - · rintro ⟨F, hF, lookup, renamed⟩ - have raw := (M.realize_pairMembershipFormula pairing 1 0 5 (extend F base) hg hF maps).1 lookup - have eq := (a.pair_mem_conditionMapFamily s t g F).1 raw - subst F - rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed - exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier - (a.iso g) graph σ τ hσ hτ).1 renamed - · intro eq - refine ⟨s.graph s (a.iso g), graph, ?_, ?_⟩ - · exact (M.realize_pairMembershipFormula pairing 1 0 5 (extend (s.graph s (a.iso g)) base) - hg graph maps).2 ((a.pair_mem_conditionMapFamily s t g _).2 rfl) - · rw [realize_binaryApplication, map_extend, map_extend, map_empty] - exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier - (a.iso g) graph σ τ hσ hτ).2 eq - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.SetRealization.Presentation - -universe u -variable {I : Type u} [Bot I] - -noncomputable def nonbottom (s : Presentation I) : Presentation {x : I // x ≠ ⊥} where - carrier := ZFSet.sep (fun z => z ≠ s.encode ⊥) s.carrier - encode x := s.encode x.val - injective := fun _ _ eq => Subtype.ext (s.injective eq) - mem_carrier z := by - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, ne⟩ - obtain ⟨x, rfl⟩ := (s.mem_carrier z).1 hz - exact ⟨⟨x, fun eq => ne (congrArg s.encode eq)⟩, rfl⟩ - · rintro ⟨x, rfl⟩ - exact ⟨s.encode_mem x.val, fun eq => x.property (s.injective eq)⟩ - -theorem nonbottom_encode (s : Presentation I) (x : {x : I // x ≠ ⊥}) : - s.nonbottom.encode x = s.encode x.val := rfl - -theorem mem_nonbottom_carrier (s : Presentation I) (z : ZFSet.{u}) : - z ∈ s.nonbottom.carrier ↔ z ∈ s.carrier ∧ z ≠ s.encode ⊥ := by - change z ∈ ZFSet.sep (fun w => w ≠ s.encode ⊥) s.carrier ↔ _ - exact ZFSet.mem_sep - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing.PosetAction - -universe u v -variable {G : Type v} [Group G] {I : Type u} [PartialOrder I] [OrderBot I] - -def nonbottomIso (a : PosetAction G I) (g : G) : - {x : I // x ≠ ⊥} ≃o {x : I // x ≠ ⊥} where - toFun x := ⟨a.iso g x.val, fun eq => - x.property ((a.iso g).injective (eq.trans (a.iso g).map_bot.symm))⟩ - invFun x := ⟨(a.iso g).symm x.val, fun eq => - x.property ((a.iso g).symm.injective (eq.trans (a.iso g).symm.map_bot.symm))⟩ - left_inv x := Subtype.ext ((a.iso g).symm_apply_apply x.val) - right_inv x := Subtype.ext ((a.iso g).apply_symm_apply x.val) - map_rel_iff' := (a.iso g).map_rel_iff - -def nonbottom (a : PosetAction G I) : PosetAction G {x : I // x ≠ ⊥} where - iso := a.nonbottomIso - one x := Subtype.ext (a.one x.val) - mul g h x := Subtype.ext (a.mul g h x.val) - -theorem nonbottom_iso_val (a : PosetAction G I) (g : G) (x : {x : I // x ≠ ⊥}) : - (a.nonbottom.iso g x).val = a.iso g x.val := rfl - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def actionRestrictionEntryFormula {n} (z g p : Fin n) : BoundedFormula n := - exMem g (exMem p.succ (exMem p.succ.succ - (orderedTripleFormula z.succ.succ.succ 2 1 0))) - -theorem truth_actionRestrictionEntryFormula {n} (z g p : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (actionRestrictionEntryFormula z g p) env ↔ - ∃ h ∈ env g, ∃ x ∈ env p, ∃ y ∈ env p, - env z = ZFSet.pair (ZFSet.pair h x) y := by - simp only [actionRestrictionEntryFormula, truth_exMem, truth_orderedTripleFormula] - rfl - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization SetFormula -universe u -variable {G I : Type u} [Group G] [PartialOrder I] [OrderBot I] - -theorem nonbottom_actionGraph_eq_sep (a : PosetAction G I) (s : Presentation I) - (t : Presentation G) : - a.nonbottom.actionGraph s.nonbottom t = ZFSet.sep - (fun z => BoundedFormula.Truth (BoundedFormula.actionRestrictionEntryFormula 0 1 2) - (extend z (extend t.carrier (extend s.nonbottom.carrier Fin.elim0)))) - (a.actionGraph s t) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨⟨g, x⟩, rfl⟩ := ((t.product s.nonbottom).mem_graph s.nonbottom - (fun gx => a.nonbottom.iso gx.1 gx.2) z).1 hz - apply ZFSet.mem_sep.2 - refine ⟨(a.triple_mem_actionGraph s t g x.val (a.iso g x.val)).2 rfl, ?_⟩ - exact (BoundedFormula.truth_actionRestrictionEntryFormula 0 1 2 _).2 - ⟨t.encode g, t.encode_mem g, s.nonbottom.encode x, s.nonbottom.encode_mem x, - s.nonbottom.encode (a.nonbottom.iso g x), s.nonbottom.encode_mem _, rfl⟩ - · intro hz - obtain ⟨original, shape⟩ := ZFSet.mem_sep.1 hz - obtain ⟨g, hg, x, hx, y, hy, eq⟩ := - (BoundedFormula.truth_actionRestrictionEntryFormula 0 1 2 _).1 shape - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨x, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy - change z = ZFSet.pair (ZFSet.pair (t.encode g) (s.nonbottom.encode x)) - (s.nonbottom.encode y) at eq - rw [eq] - apply (a.nonbottom.triple_mem_actionGraph s.nonbottom t g x y).2 - apply Subtype.ext - exact (a.triple_mem_actionGraph s t g x.val y.val).1 (eq ▸ original) - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem nonbottom_carrier_mem {I : Type u} [Bot I] (s : Presentation I) - (separation : SeparationSchema M.sets) (carrier : s.carrier ∈ M.sets) : - s.nonbottom.carrier ∈ M.sets := by - have bottom := M.transitive carrier (s.encode_mem ⊥) - exact M.bounded_separation_mem separation (.neg (.equal 0 1)) - (extend (s.encode ⊥) Fin.elim0) (Fin.cases bottom (fun j => Fin.elim0 j)) carrier - -theorem nonbottom_actionGraph_mem {G I : Type u} [Group G] [PartialOrder I] [OrderBot I] - (a : PosetAction G I) (s : Presentation I) (t : Presentation G) - (separation : SeparationSchema M.sets) (carrier : s.carrier ∈ M.sets) - (group : t.carrier ∈ M.sets) (graph : a.actionGraph s t ∈ M.sets) : - a.nonbottom.actionGraph s.nonbottom t ∈ M.sets := by - rw [a.nonbottom_actionGraph_eq_sep s t] - exact M.bounded_separation_mem separation (BoundedFormula.actionRestrictionEntryFormula 0 1 2) - (extend t.carrier (extend s.nonbottom.carrier Fin.elim0)) - (Fin.cases group (Fin.cases (M.nonbottom_carrier_mem s separation carrier) - (fun j => Fin.elim0 j))) graph - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization -universe u -variable {G I : Type u} [Group G] [PartialOrder I] - -noncomputable def productColumns (a : PosetAction G I) (C : Type u) [PartialOrder C] : - PosetAction G (I × C) where - iso g := { - toFun := fun x => (a.iso g x.1, x.2) - invFun := fun x => ((a.iso g).symm x.1, x.2) - left_inv := fun x => Prod.ext ((a.iso g).symm_apply_apply x.1) rfl - right_inv := fun x => Prod.ext ((a.iso g).apply_symm_apply x.1) rfl - map_rel_iff' := by - intro x y - exact and_congr (a.iso g).map_rel_iff Iff.rfl } - one x := Prod.ext (a.one x.1) rfl - mul g h x := Prod.ext (a.mul g h x.1) rfl - -theorem productColumns_apply (a : PosetAction G I) (C : Type u) [PartialOrder C] - (g : G) (i : I) (c : C) : (a.productColumns C).iso g (i, c) = (a.iso g i, c) := rfl - -theorem mem_productColumns_actionGraph {C : Type u} [PartialOrder C] - (a : PosetAction G I) (s : Presentation I) (c : Presentation C) (t : Presentation G) - (z : ZFSet.{u}) : - z ∈ (a.productColumns C).actionGraph (s.product c) t ↔ ∃ g i k, - z = ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (s.encode i) (c.encode k))) - (ZFSet.pair (s.encode (a.iso g i)) (c.encode k)) := by - rw [actionGraph, Presentation.mem_graph] - constructor - · rintro ⟨⟨g, i, k⟩, eq⟩ - exact ⟨g, i, k, eq.symm⟩ - · rintro ⟨g, i, k, eq⟩ - exact ⟨(g, i, k), eq.symm⟩ - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula SetRealization -universe u - -def productColumnsEntryFormula {n} (z g i c q a : Fin n) : BoundedFormula n := - exMem g (exMem i.succ (exMem i.succ.succ (exMem c.succ.succ.succ - (exMem q.succ.succ.succ.succ (exMem q.succ.succ.succ.succ.succ - (.conj (orderedPairFormula 1 4 2) - (.conj (orderedPairFormula 0 3 2) - (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ.succ 5 1 0) - (tripleMembershipFormula 5 4 3 a.succ.succ.succ.succ.succ.succ))))))))) - -theorem truth_productColumnsEntryFormula {n} (z g i c q a : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (productColumnsEntryFormula z g i c q a) env ↔ - ∃ h ∈ env g, ∃ x ∈ env i, ∃ y ∈ env i, ∃ k ∈ env c, - ∃ v ∈ env q, ∃ w ∈ env q, - v = ZFSet.pair x k ∧ w = ZFSet.pair y k ∧ - env z = ZFSet.pair (ZFSet.pair h v) w ∧ - ZFSet.pair (ZFSet.pair h x) y ∈ env a := by - simp only [productColumnsEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_orderedTripleFormula, truth_tripleMembershipFormula] - rfl - -theorem productColumnsEntry_correct {G I C : Type u} [Group G] [PartialOrder I] [PartialOrder C] - (a : PosetAction G I) (s : Presentation I) (c : Presentation C) (t : Presentation G) - (z : ZFSet.{u}) : - Truth (productColumnsEntryFormula 0 1 2 3 4 5) - (extend z (extend t.carrier (extend s.carrier (extend c.carrier - (extend (s.product c).carrier (extend (a.actionGraph s t) Fin.elim0)))))) ↔ - z ∈ (a.productColumns C).actionGraph (s.product c) t := by - rw [truth_productColumnsEntryFormula] - constructor - · rintro ⟨g, hg, i, hi, j, hj, k, hk, x, _, y, _, xeq, yeq, eq, rel⟩ - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨i, rfl⟩ := (s.mem_carrier i).1 hi - obtain ⟨j, rfl⟩ := (s.mem_carrier j).1 hj - obtain ⟨k, rfl⟩ := (c.mem_carrier k).1 hk - subst x - subst y - change z = ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (s.encode i) (c.encode k))) - (ZFSet.pair (s.encode j) (c.encode k)) at eq - rw [eq] - exact ((a.productColumns C).triple_mem_actionGraph (s.product c) t g (i, k) (j, k)).2 - (Prod.ext ((a.triple_mem_actionGraph s t g i j).1 rel) rfl) - · intro member - obtain ⟨g, i, k, eq⟩ := (a.mem_productColumns_actionGraph s c t z).1 member - exact ⟨t.encode g, t.encode_mem g, s.encode i, s.encode_mem i, - s.encode (a.iso g i), s.encode_mem _, c.encode k, c.encode_mem k, - (s.product c).encode (i, k), (s.product c).encode_mem _, - (s.product c).encode (a.iso g i, k), (s.product c).encode_mem _, rfl, rfl, eq, - (a.triple_mem_actionGraph s t g i (a.iso g i)).2 rfl⟩ - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G I C : Type u} [Group G] [PartialOrder I] [PartialOrder C] - -theorem productColumns_actionGraph_mem - (a : PosetAction G I) (s : Presentation I) (c : Presentation C) (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (rows : s.carrier ∈ M.sets) (columns : c.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (graph : a.actionGraph s t ∈ M.sets) : - (a.productColumns C).actionGraph (s.product c) t ∈ M.sets := by - have coordinates : (s.product c).carrier ∈ M.sets := - M.prod_mem pairing unions powers separation rows columns - have bound := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation group coordinates) coordinates - let params := extend t.carrier (extend s.carrier (extend c.carrier - (extend (s.product c).carrier (extend (a.actionGraph s t) Fin.elim0)))) - have members : ∀ k, params k ∈ M.sets := - Fin.cases group (Fin.cases rows (Fin.cases columns (Fin.cases coordinates - (Fin.cases graph (fun k => Fin.elim0 k))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.productColumnsEntryFormula 0 1 2 3 4 5) params members bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.productColumnsEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod (ZFSet.prod t.carrier (s.product c).carrier) (s.product c).carrier) = - (a.productColumns C).actionGraph (s.product c) t := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.productColumnsEntry_correct] - exact ⟨And.right, fun hz => ⟨((t.product (s.product c)).graph_isFunc (s.product c) - (fun x => (a.productColumns C).iso x.1 x.2)).1 hz, hz⟩⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedInjectiveCones +import OAI.SetTheory.PartitionPrinciple.Definability.RawRenameFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.SeparationFulfillmentCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.DecodedGroundGroups + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def renameStateFormula : SetFormula 4 := + ex (ex (.conj (orderedPairFormula 2 1 0) (renameStepFormula 4 5 3 1 0))) + +def renameCertificateFormula : SetFormula 3 := postfixedFormula renameStateFormula + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +noncomputable def renameParameters (f : P → P) : Fin 2 → ZFSet.{u} := + extend s.carrier (extend (s.graph s f) Fin.elim0) + +theorem realize_renameState + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (z R : ZFSet.{u}) (hz : z ∈ M.sets) (hr : R ∈ M.sets) : + Realize M.sets renameStateFormula (extend z (extend R (renameParameters s f))) ↔ + ∃ x ∈ M.sets, ∃ y ∈ M.sets, z = ZFSet.pair x y ∧ M.RawRenameStep s f R x y := by + rw [renameStateFormula, realize_ex] + apply exists_congr + intro x + apply and_congr_right + intro hx + rw [realize_ex] + apply exists_congr + intro y + apply and_congr_right + intro hy + let e := extend y (extend x (extend z (extend R (renameParameters s f)))) + change (Realize M.sets _ e ∧ Realize M.sets _ e) ↔ _ + rw [M.realize_orderedPairFormula pairing 2 1 0 e hz hx hy, + M.realize_renameStepFormula s pairing carrier f graph 4 5 3 1 0 e rfl rfl hr hx hy] + rfl + +theorem rawRenameStep_names (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (f : P → P) (R : ZFSet.{u}) (σ τ : D.names) : + M.RawRenameStep s f R σ.val.val τ.val.val ↔ + Name.RenameStep f (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) σ.val τ.val := by + constructor + · rintro ⟨left, right⟩ + constructor + · intro ν p entry + obtain ⟨w, _, q, matched, cond, rel⟩ := left ν.val (ground ν (D.children σ.property entry)) p entry + change f p = q at cond + subst q + let ρ : Name s := ⟨w, Name.isName_of_pair_mem τ.val w (f p) matched⟩ + exact ⟨ρ, matched, rel⟩ + · intro ρ q entry + obtain ⟨v, _, p, matched, cond, rel⟩ := right ρ.val (ground ρ (D.children τ.property entry)) q entry + let ν : Name s := ⟨v, Name.isName_of_pair_mem σ.val v p matched⟩ + exact ⟨ν, p, matched, cond, rel⟩ + · rintro ⟨left, right⟩ + constructor + · intro v _ p entry + let ν : Name s := ⟨v, Name.isName_of_pair_mem σ.val v p entry⟩ + obtain ⟨ρ, matched, rel⟩ := left ν p entry + exact ⟨ρ.val, ground ρ (D.children τ.property matched), f p, matched, rfl, rel⟩ + · intro w _ q entry + let ρ : Name s := ⟨w, Name.isName_of_pair_mem τ.val w q entry⟩ + obtain ⟨ν, p, matched, cond, rel⟩ := right ρ q entry + exact ⟨ν.val, ground ν (D.children σ.property matched), p, matched, cond, rel⟩ + +theorem realize_renameState_names (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (R : ZFSet.{u}) (hr : R ∈ M.sets) (σ τ : D.names) : + Realize M.sets renameStateFormula + (extend (ZFSet.pair σ.val.val τ.val.val) (extend R (renameParameters s f))) ↔ + Name.RenameStep f (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) σ.val τ.val := by + have hz := M.orderedPair_mem pairing (ground σ.val σ.property) (ground τ.val τ.property) + rw [M.realize_renameState s pairing carrier f graph _ R hz hr] + constructor + · rintro ⟨x, _, y, _, shape, step⟩ + obtain ⟨sx, ty⟩ := ZFSet.pair_inj.1 shape + subst x + subst y + exact (M.rawRenameStep_names s D ground f R σ τ).1 step + · intro step + exact ⟨σ.val.val, ground σ.val σ.property, τ.val.val, ground τ.val τ.property, rfl, + (M.rawRenameStep_names s D ground f R σ τ).2 step⟩ + +theorem renameCertificate_sound (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + {R : ZFSet.{u}} (hr : R ∈ M.sets) + (certificate : Realize M.sets renameCertificateFormula (extend R (renameParameters s f))) + (σ τ : D.names) : ZFSet.pair σ.val.val τ.val.val ∈ R → Name.rename s f σ.val = τ.val := by + apply Name.rename_postfixed_sound D f (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) _ + σ.val σ.property τ.val τ.property + intro ν hν ρ hρ rel + exact (M.realize_renameState_names s D ground pairing carrier f graph R hr ⟨ν, hν⟩ ⟨ρ, hρ⟩).1 + ((realize_imp M.sets _ _ _).1 (certificate _ (M.transitive hr rel)) rel) + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem exists_renameState_fixedPoint + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (B : ZFSet.{u}) (hB : B ∈ M.sets) : + ∃ R ∈ M.sets, R ⊆ B ∧ definableOperator M.sets renameStateFormula (renameParameters s f) B R = R := by + have members : ∀ i, renameParameters s f i ∈ M.sets := + Fin.cases carrier (Fin.cases graph (fun i => Fin.elim0 i)) + have mono : ∀ R ∈ M.sets, ∀ S ∈ M.sets, R ⊆ B → S ⊆ B → R ⊆ S → + definableOperator M.sets renameStateFormula (renameParameters s f) B R ⊆ + definableOperator M.sets renameStateFormula (renameParameters s f) B S := by + intro R hr S hs _ _ sub z hz + obtain ⟨hzB, step⟩ := ZFSet.mem_sep.1 hz + have hzM := M.transitive hB hzB + obtain ⟨x, hx, y, hy, shape, raw⟩ := (M.realize_renameState s pairing carrier f graph z R hzM hr).1 step + exact ZFSet.mem_sep.2 ⟨hzB, (M.realize_renameState s pairing carrier f graph z S hzM hs).2 + ⟨x, hx, y, hy, shape, M.rawRenameStep_mono s f sub raw⟩⟩ + obtain ⟨R, hr, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation + renameStateFormula (renameParameters s f) members hB mono + exact ⟨R, hr, bound, fixed⟩ + +theorem exists_groundRename_certificate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) (eq : Name.rename s f σ = τ) : + ∃ R ∈ M.sets, Realize M.sets renameCertificateFormula (extend R (renameParameters s f)) ∧ + ZFSet.pair σ.val τ.val ∈ R := by + obtain ⟨T, hT, σT, τT, trans⟩ := M.exists_pair_transitiveCover pairing unions separation collection hσ hτ + let D := namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy) + have ground : ∀ ν ∈ D.names, ν.val ∈ M.sets := fun _ h => M.transitive hT h + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT + obtain ⟨R, hr, bound, fixed⟩ := M.exists_renameState_fixedPoint s pairing unions powers separation + carrier f graph B hB + have certificate : Realize M.sets renameCertificateFormula (extend R (renameParameters s f)) := by + apply (M.realize_postfixedFormula renameStateFormula (renameParameters s f) hr bound).2 + rw [fixed] + have pre : ∀ ν ∈ D.names, ∀ ρ ∈ D.names, + Name.RenameStep f (fun χ ψ => ZFSet.pair χ.val ψ.val ∈ R) ν ρ → ZFSet.pair ν.val ρ.val ∈ R := by + intro ν hν ρ hρ step + have member : ZFSet.pair ν.val ρ.val ∈ + definableOperator M.sets renameStateFormula (renameParameters s f) B R := + ZFSet.mem_sep.2 ⟨pairBound ν.val hν ρ.val hρ, + (M.realize_renameState_names s D ground pairing carrier f graph R hr ⟨ν, hν⟩ ⟨ρ, hρ⟩).2 step⟩ + rwa [fixed] at member + exact ⟨R, hr, certificate, Name.rename_prefixed_complete D f + (fun ν ρ => ZFSet.pair ν.val ρ.val ∈ R) pre σ σT τ τT eq⟩ + +theorem rename_eq_iff_exists_certificate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : + Name.rename s f σ = τ ↔ + ∃ R ∈ M.sets, Realize M.sets renameCertificateFormula (extend R (renameParameters s f)) ∧ + ZFSet.pair σ.val τ.val ∈ R := by + constructor + · exact M.exists_groundRename_certificate s pairing unions powers separation collection carrier f graph σ τ hσ hτ + · rintro ⟨R, hr, certificate, member⟩ + exact M.renameCertificate_sound s (M.nameDomain s) (fun _ h => h) pairing carrier f graph hr + certificate ⟨σ, hσ⟩ ⟨τ, hτ⟩ member + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +universe u + +def binaryApplication {k n : Nat} (φ : SetFormula (k + 2)) (params : Fin k → Fin n) + (x y : Fin n) : SetFormula n := reindex (extend x (extend y params)) φ + +theorem realize_binaryApplication (U : Set ZFSet.{u}) {k n : Nat} (φ : SetFormula (k + 2)) + (params : Fin k → Fin n) (x y : Fin n) (env : Fin n → ZFSet.{u}) : + Realize U (binaryApplication φ params x y) env ↔ + Realize U φ (extend (env x) (extend (env y) (fun i => env (params i)))) := by + rw [binaryApplication, realize_reindex, map_extend, map_extend] + +def uniformRenameFormula : SetFormula 4 := + ex (.conj (atomicApplication renameCertificateFormula Fin.elim0 0 3 4) + (pairMembershipFormula 1 2 0)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem realize_uniformRenameFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets) + (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : + Realize M.sets uniformRenameFormula (extend σ.val (extend τ.val (renameParameters s f))) ↔ + Name.rename s f σ = τ := by + rw [M.rename_eq_iff_exists_certificate s pairing unions powers separation collection carrier f graph σ τ hσ hτ, + uniformRenameFormula, realize_ex] + apply exists_congr + intro R + apply and_congr_right + intro hr + let env := extend R (extend σ.val (extend τ.val (renameParameters s f))) + change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ + rw [realize_atomicApplication, map_empty, + M.realize_pairMembershipFormula pairing 1 2 0 env hσ hτ hr] + rfl + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization +universe u +variable {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +noncomputable def conditionMapFamily : ZFSet.{u} := + ZFSet.range (fun g : G => ZFSet.pair (t.encode g) (s.graph s (a.iso g))) + +theorem pair_mem_conditionMapFamily (g : G) (F : ZFSet.{u}) : + ZFSet.pair (t.encode g) F ∈ a.conditionMapFamily s t ↔ F = s.graph s (a.iso g) := by + rw [conditionMapFamily, ZFSet.mem_range] + constructor + · rintro ⟨h, eq⟩ + obtain ⟨hg, value⟩ := ZFSet.pair_inj.1 eq + have hgeq := t.injective hg + subst h + exact value.symm + · intro eq + exact ⟨g, congrArg (ZFSet.pair (t.encode g)) eq.symm⟩ + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] + +theorem conditionMap_graph_mem (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + (maps : a.conditionMapFamily s t ∈ M.sets) (g : G) : s.graph s (a.iso g) ∈ M.sets := + M.pair_right (M.transitive maps ((a.pair_mem_conditionMapFamily s t g _).2 rfl)) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization +universe u +variable {G P : Type u} [Group G] [PartialOrder P] + +noncomputable def actionGraph (a : PosetAction G P) (s : Presentation P) (t : Presentation G) : ZFSet.{u} := + (t.product s).graph s (fun x => a.iso x.1 x.2) + +theorem triple_mem_actionGraph (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + (g : G) (p q : P) : + ZFSet.pair (ZFSet.pair (t.encode g) (s.encode p)) (s.encode q) ∈ a.actionGraph s t ↔ a.iso g p = q := + (t.product s).pair_mem_graph s (fun x => a.iso x.1 x.2) (g, p) q + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.PosetActionCode + +open SetRealization +universe u +variable {G P m i e R A : ZFSet.{u}} (h : PosetActionCode G P m e R A) + +noncomputable def act (g : SetMembers G) (p : SetMembers P) : SetMembers P := + ((SetMembers.presentation G).product (SetMembers.presentation P)).decodeFunction + (SetMembers.presentation P) A h.function (g, p) + +theorem act_mem (g : SetMembers G) (p : SetMembers P) : + ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw p)) (SetMembers.raw (h.act g p)) ∈ A := + ((SetMembers.presentation G).product (SetMembers.presentation P)).decodeFunction_mem + (SetMembers.presentation P) A h.function (g, p) + +theorem act_eq_iff (g : SetMembers G) (p q : SetMembers P) : h.act g p = q ↔ + ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw p)) (SetMembers.raw q) ∈ A := + ((SetMembers.presentation G).product (SetMembers.presentation P)).decodeFunction_iff + (SetMembers.presentation P) A h.function (g, p) q + +theorem act_one (group : GroupCode G m i e) (p : SetMembers P) : + letI _decodedGroup := group.toGroup + h.act 1 p = p := by + let decodedGroup := group.toGroup + apply (h.act_eq_iff _ _ _).2 + change ZFSet.pair (ZFSet.pair (SetMembers.raw group.one) (SetMembers.raw p)) (SetMembers.raw p) ∈ A + rw [group.raw_one] + exact h.one _ (SetMembers.raw_mem p) + +theorem act_mul (group : GroupCode G m i e) (g j : SetMembers G) (p : SetMembers P) : + letI _decodedGroup := group.toGroup + h.act (g * j) p = h.act g (h.act j p) := by + let decodedGroup := group.toGroup + apply (h.act_eq_iff _ _ _).2 + exact h.mul _ (SetMembers.raw_mem g) _ (SetMembers.raw_mem j) _ (SetMembers.raw_mem (g * j)) + _ (SetMembers.raw_mem p) _ (SetMembers.raw_mem (h.act j p)) _ (SetMembers.raw_mem (h.act g (h.act j p))) + (group.mul_mem g j) (h.act_mem j p) (h.act_mem g (h.act j p)) + +theorem act_inv_left (group : GroupCode G m i e) (g : SetMembers G) (p : SetMembers P) : + letI _decodedGroup := group.toGroup + h.act g⁻¹ (h.act g p) = p := by + let decodedGroup := group.toGroup + rw [← h.act_mul group, inv_mul_cancel, h.act_one group] + +theorem act_inv_right (group : GroupCode G m i e) (g : SetMembers G) (p : SetMembers P) : + letI _decodedGroup := group.toGroup + h.act g (h.act g⁻¹ p) = p := by + let decodedGroup := group.toGroup + rw [← h.act_mul group, mul_inv_cancel, h.act_one group] + +theorem act_monotone (order : PartialOrderCode P R) (g : SetMembers G) : + letI _decodedOrder := order.toPartialOrder + Monotone (h.act g) := by + let decodedOrder := order.toPartialOrder + intro p q pq + exact h.monotone _ (SetMembers.raw_mem g) _ (SetMembers.raw_mem p) _ (SetMembers.raw_mem q) + _ (SetMembers.raw_mem (h.act g p)) _ (SetMembers.raw_mem (h.act g q)) + (h.act_mem g p) (h.act_mem g q) pq + +theorem act_le_iff (group : GroupCode G m i e) (order : PartialOrderCode P R) + (g : SetMembers G) (p q : SetMembers P) : + letI _decodedGroup := group.toGroup + letI _decodedOrder := order.toPartialOrder + h.act g p ≤ h.act g q ↔ p ≤ q := by + let decodedGroup := group.toGroup + let decodedOrder := order.toPartialOrder + constructor + · intro le + have back := h.act_monotone order g⁻¹ le + simpa only [h.act_inv_left group] using back + · exact fun le => h.act_monotone order g le + +noncomputable def toPosetAction (group : GroupCode G m i e) (order : PartialOrderCode P R) : + letI _decodedGroup := group.toGroup + letI _decodedOrder := order.toPartialOrder + PosetAction (SetMembers G) (SetMembers P) := by + letI decodedGroup := group.toGroup + letI decodedOrder := order.toPartialOrder + exact { + iso := fun g => { + toFun := h.act g + invFun := h.act g⁻¹ + left_inv := h.act_inv_left group g + right_inv := h.act_inv_right group g + map_rel_iff' := h.act_le_iff group order g _ _ } + one := h.act_one group + mul := h.act_mul group } + +theorem actionGraph_eq (group : GroupCode G m i e) (order : PartialOrderCode P R) : + letI _decodedGroup := group.toGroup + letI _decodedOrder := order.toPartialOrder + (h.toPosetAction group order).actionGraph (SetMembers.presentation P) (SetMembers.presentation G) = A := by + let decodedGroup := group.toGroup + let decodedOrder := order.toPartialOrder + exact ((SetMembers.presentation G).product (SetMembers.presentation P)).graph_decodeFunction + (SetMembers.presentation P) A h.function + +end PartitionPilot.Forcing.PosetActionCode + +end + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +def identityPosetAction (G P : Type u) [Group G] [PartialOrder P] : PosetAction G P where + iso _ := OrderIso.refl P + one _ := rfl + mul _ _ _ := rfl + +def trivialGroupPresentation : Presentation (Equiv.Perm (ULift.{u} Unit)) where + carrier := {∅} + encode _ := ∅ + injective := fun _ _ _ => Subsingleton.elim _ _ + mem_carrier x := by + rw [ZFSet.mem_singleton] + exact ⟨fun h => ⟨1, h.symm⟩, fun ⟨_, h⟩ => h.symm⟩ + +theorem identityPosetAction_graph_eq {G P : Type u} [Group G] [PartialOrder P] + (s : Presentation P) (g : G) : + s.graph s ((identityPosetAction G P).iso g) = identityFunctionGraph s.carrier := by + apply ZFSet.ext + intro z + rw [s.mem_graph, mem_identityFunctionGraph] + constructor + · rintro ⟨p, eq⟩ + exact ⟨s.encode p, s.encode_mem p, eq.symm⟩ + · rintro ⟨x, hx, rfl⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + exact ⟨p, rfl⟩ + +theorem identityPosetAction_conditionMapFamily {P : Type u} [PartialOrder P] + (s : Presentation P) : + (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P).conditionMapFamily + s trivialGroupPresentation = {ZFSet.pair ∅ (identityFunctionGraph s.carrier)} := by + apply ZFSet.ext + intro z + rw [PosetAction.conditionMapFamily, ZFSet.mem_range, ZFSet.mem_singleton] + constructor + · rintro ⟨g, eq⟩ + change ZFSet.pair ∅ (s.graph s ((identityPosetAction _ P).iso g)) = z at eq + rw [identityPosetAction_graph_eq] at eq + exact eq.symm + · intro eq + refine ⟨1, ?_⟩ + change ZFSet.pair ∅ (s.graph s ((identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P).iso 1)) = z + rw [identityPosetAction_graph_eq] + exact eq.symm + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem trivialGroupPresentation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (nonempty : M.sets.Nonempty) : + trivialGroupPresentation.carrier ∈ M.sets := by + change ({∅} : ZFSet.{u}) ∈ M.sets + simpa only [ZFSet.pair_eq_singleton] using + M.unorderedPair_mem pairing (M.empty_mem nonempty) (M.empty_mem nonempty) + +theorem identityPosetAction_conditionMapFamily_mem {P : Type u} [PartialOrder P] + (s : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) : + (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P).conditionMapFamily + s trivialGroupPresentation ∈ M.sets := by + rw [identityPosetAction_conditionMapFamily] + have entry := M.orderedPair_mem pairing (M.empty_mem ⟨s.carrier, carrier⟩) + (M.identityFunctionGraph_mem pairing unions powers separation carrier) + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing entry entry + +end TransitiveGround + +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def nameActionFormula : SetFormula 5 := + ex (.conj (pairMembershipFormula 1 0 5) + (binaryApplication uniformRenameFormula (extend 4 (extend 0 Fin.elim0)) 2 3)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem realize_nameActionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (g : G) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : + Realize M.sets nameActionFormula + (extend (t.encode g) (extend σ.val (extend τ.val + (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔ + a.act s g σ = τ := by + rw [nameActionFormula, realize_ex] + have hg := M.transitive group (t.encode_mem g) + have graph := M.conditionMap_graph_mem a s t maps g + let base := extend (t.encode g) (extend σ.val (extend τ.val + (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))) + constructor + · rintro ⟨F, hF, lookup, renamed⟩ + have raw := (M.realize_pairMembershipFormula pairing 1 0 5 (extend F base) hg hF maps).1 lookup + have eq := (a.pair_mem_conditionMapFamily s t g F).1 raw + subst F + rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed + exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier + (a.iso g) graph σ τ hσ hτ).1 renamed + · intro eq + refine ⟨s.graph s (a.iso g), graph, ?_, ?_⟩ + · exact (M.realize_pairMembershipFormula pairing 1 0 5 (extend (s.graph s (a.iso g)) base) + hg graph maps).2 ((a.pair_mem_conditionMapFamily s t g _).2 rfl) + · rw [realize_binaryApplication, map_extend, map_extend, map_empty] + exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier + (a.iso g) graph σ τ hσ hτ).2 eq + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.SetRealization.Presentation + +universe u +variable {I : Type u} [Bot I] + +noncomputable def nonbottom (s : Presentation I) : Presentation {x : I // x ≠ ⊥} where + carrier := ZFSet.sep (fun z => z ≠ s.encode ⊥) s.carrier + encode x := s.encode x.val + injective := fun _ _ eq => Subtype.ext (s.injective eq) + mem_carrier z := by + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, ne⟩ + obtain ⟨x, rfl⟩ := (s.mem_carrier z).1 hz + exact ⟨⟨x, fun eq => ne (congrArg s.encode eq)⟩, rfl⟩ + · rintro ⟨x, rfl⟩ + exact ⟨s.encode_mem x.val, fun eq => x.property (s.injective eq)⟩ + +theorem nonbottom_encode (s : Presentation I) (x : {x : I // x ≠ ⊥}) : + s.nonbottom.encode x = s.encode x.val := rfl + +theorem mem_nonbottom_carrier (s : Presentation I) (z : ZFSet.{u}) : + z ∈ s.nonbottom.carrier ↔ z ∈ s.carrier ∧ z ≠ s.encode ⊥ := by + change z ∈ ZFSet.sep (fun w => w ≠ s.encode ⊥) s.carrier ↔ _ + exact ZFSet.mem_sep + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing.PosetAction + +universe u v +variable {G : Type v} [Group G] {I : Type u} [PartialOrder I] [OrderBot I] + +def nonbottomIso (a : PosetAction G I) (g : G) : + {x : I // x ≠ ⊥} ≃o {x : I // x ≠ ⊥} where + toFun x := ⟨a.iso g x.val, fun eq => + x.property ((a.iso g).injective (eq.trans (a.iso g).map_bot.symm))⟩ + invFun x := ⟨(a.iso g).symm x.val, fun eq => + x.property ((a.iso g).symm.injective (eq.trans (a.iso g).symm.map_bot.symm))⟩ + left_inv x := Subtype.ext ((a.iso g).symm_apply_apply x.val) + right_inv x := Subtype.ext ((a.iso g).apply_symm_apply x.val) + map_rel_iff' := (a.iso g).map_rel_iff + +def nonbottom (a : PosetAction G I) : PosetAction G {x : I // x ≠ ⊥} where + iso := a.nonbottomIso + one x := Subtype.ext (a.one x.val) + mul g h x := Subtype.ext (a.mul g h x.val) + +theorem nonbottom_iso_val (a : PosetAction G I) (g : G) (x : {x : I // x ≠ ⊥}) : + (a.nonbottom.iso g x).val = a.iso g x.val := rfl + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def actionRestrictionEntryFormula {n} (z g p : Fin n) : BoundedFormula n := + exMem g (exMem p.succ (exMem p.succ.succ + (orderedTripleFormula z.succ.succ.succ 2 1 0))) + +theorem truth_actionRestrictionEntryFormula {n} (z g p : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (actionRestrictionEntryFormula z g p) env ↔ + ∃ h ∈ env g, ∃ x ∈ env p, ∃ y ∈ env p, + env z = ZFSet.pair (ZFSet.pair h x) y := by + simp only [actionRestrictionEntryFormula, truth_exMem, truth_orderedTripleFormula] + rfl + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization SetFormula +universe u +variable {G I : Type u} [Group G] [PartialOrder I] [OrderBot I] + +theorem nonbottom_actionGraph_eq_sep (a : PosetAction G I) (s : Presentation I) + (t : Presentation G) : + a.nonbottom.actionGraph s.nonbottom t = ZFSet.sep + (fun z => BoundedFormula.Truth (BoundedFormula.actionRestrictionEntryFormula 0 1 2) + (extend z (extend t.carrier (extend s.nonbottom.carrier Fin.elim0)))) + (a.actionGraph s t) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨⟨g, x⟩, rfl⟩ := ((t.product s.nonbottom).mem_graph s.nonbottom + (fun gx => a.nonbottom.iso gx.1 gx.2) z).1 hz + apply ZFSet.mem_sep.2 + refine ⟨(a.triple_mem_actionGraph s t g x.val (a.iso g x.val)).2 rfl, ?_⟩ + exact (BoundedFormula.truth_actionRestrictionEntryFormula 0 1 2 _).2 + ⟨t.encode g, t.encode_mem g, s.nonbottom.encode x, s.nonbottom.encode_mem x, + s.nonbottom.encode (a.nonbottom.iso g x), s.nonbottom.encode_mem _, rfl⟩ + · intro hz + obtain ⟨original, shape⟩ := ZFSet.mem_sep.1 hz + obtain ⟨g, hg, x, hx, y, hy, eq⟩ := + (BoundedFormula.truth_actionRestrictionEntryFormula 0 1 2 _).1 shape + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨x, rfl⟩ := (s.nonbottom.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy + change z = ZFSet.pair (ZFSet.pair (t.encode g) (s.nonbottom.encode x)) + (s.nonbottom.encode y) at eq + rw [eq] + apply (a.nonbottom.triple_mem_actionGraph s.nonbottom t g x y).2 + apply Subtype.ext + exact (a.triple_mem_actionGraph s t g x.val y.val).1 (eq ▸ original) + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem nonbottom_carrier_mem {I : Type u} [Bot I] (s : Presentation I) + (separation : SeparationSchema M.sets) (carrier : s.carrier ∈ M.sets) : + s.nonbottom.carrier ∈ M.sets := by + have bottom := M.transitive carrier (s.encode_mem ⊥) + exact M.bounded_separation_mem separation (.neg (.equal 0 1)) + (extend (s.encode ⊥) Fin.elim0) (Fin.cases bottom (fun j => Fin.elim0 j)) carrier + +theorem nonbottom_actionGraph_mem {G I : Type u} [Group G] [PartialOrder I] [OrderBot I] + (a : PosetAction G I) (s : Presentation I) (t : Presentation G) + (separation : SeparationSchema M.sets) (carrier : s.carrier ∈ M.sets) + (group : t.carrier ∈ M.sets) (graph : a.actionGraph s t ∈ M.sets) : + a.nonbottom.actionGraph s.nonbottom t ∈ M.sets := by + rw [a.nonbottom_actionGraph_eq_sep s t] + exact M.bounded_separation_mem separation (BoundedFormula.actionRestrictionEntryFormula 0 1 2) + (extend t.carrier (extend s.nonbottom.carrier Fin.elim0)) + (Fin.cases group (Fin.cases (M.nonbottom_carrier_mem s separation carrier) + (fun j => Fin.elim0 j))) graph + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization +universe u +variable {G I : Type u} [Group G] [PartialOrder I] + +noncomputable def productColumns (a : PosetAction G I) (C : Type u) [PartialOrder C] : + PosetAction G (I × C) where + iso g := { + toFun := fun x => (a.iso g x.1, x.2) + invFun := fun x => ((a.iso g).symm x.1, x.2) + left_inv := fun x => Prod.ext ((a.iso g).symm_apply_apply x.1) rfl + right_inv := fun x => Prod.ext ((a.iso g).apply_symm_apply x.1) rfl + map_rel_iff' := by + intro x y + exact and_congr (a.iso g).map_rel_iff Iff.rfl } + one x := Prod.ext (a.one x.1) rfl + mul g h x := Prod.ext (a.mul g h x.1) rfl + +theorem productColumns_apply (a : PosetAction G I) (C : Type u) [PartialOrder C] + (g : G) (i : I) (c : C) : (a.productColumns C).iso g (i, c) = (a.iso g i, c) := rfl + +theorem mem_productColumns_actionGraph {C : Type u} [PartialOrder C] + (a : PosetAction G I) (s : Presentation I) (c : Presentation C) (t : Presentation G) + (z : ZFSet.{u}) : + z ∈ (a.productColumns C).actionGraph (s.product c) t ↔ ∃ g i k, + z = ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (s.encode i) (c.encode k))) + (ZFSet.pair (s.encode (a.iso g i)) (c.encode k)) := by + rw [actionGraph, Presentation.mem_graph] + constructor + · rintro ⟨⟨g, i, k⟩, eq⟩ + exact ⟨g, i, k, eq.symm⟩ + · rintro ⟨g, i, k, eq⟩ + exact ⟨(g, i, k), eq.symm⟩ + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula SetRealization +universe u + +def productColumnsEntryFormula {n} (z g i c q a : Fin n) : BoundedFormula n := + exMem g (exMem i.succ (exMem i.succ.succ (exMem c.succ.succ.succ + (exMem q.succ.succ.succ.succ (exMem q.succ.succ.succ.succ.succ + (.conj (orderedPairFormula 1 4 2) + (.conj (orderedPairFormula 0 3 2) + (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ.succ 5 1 0) + (tripleMembershipFormula 5 4 3 a.succ.succ.succ.succ.succ.succ))))))))) + +theorem truth_productColumnsEntryFormula {n} (z g i c q a : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (productColumnsEntryFormula z g i c q a) env ↔ + ∃ h ∈ env g, ∃ x ∈ env i, ∃ y ∈ env i, ∃ k ∈ env c, + ∃ v ∈ env q, ∃ w ∈ env q, + v = ZFSet.pair x k ∧ w = ZFSet.pair y k ∧ + env z = ZFSet.pair (ZFSet.pair h v) w ∧ + ZFSet.pair (ZFSet.pair h x) y ∈ env a := by + simp only [productColumnsEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_orderedTripleFormula, truth_tripleMembershipFormula] + rfl + +theorem productColumnsEntry_correct {G I C : Type u} [Group G] [PartialOrder I] [PartialOrder C] + (a : PosetAction G I) (s : Presentation I) (c : Presentation C) (t : Presentation G) + (z : ZFSet.{u}) : + Truth (productColumnsEntryFormula 0 1 2 3 4 5) + (extend z (extend t.carrier (extend s.carrier (extend c.carrier + (extend (s.product c).carrier (extend (a.actionGraph s t) Fin.elim0)))))) ↔ + z ∈ (a.productColumns C).actionGraph (s.product c) t := by + rw [truth_productColumnsEntryFormula] + constructor + · rintro ⟨g, hg, i, hi, j, hj, k, hk, x, _, y, _, xeq, yeq, eq, rel⟩ + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨i, rfl⟩ := (s.mem_carrier i).1 hi + obtain ⟨j, rfl⟩ := (s.mem_carrier j).1 hj + obtain ⟨k, rfl⟩ := (c.mem_carrier k).1 hk + subst x + subst y + change z = ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (s.encode i) (c.encode k))) + (ZFSet.pair (s.encode j) (c.encode k)) at eq + rw [eq] + exact ((a.productColumns C).triple_mem_actionGraph (s.product c) t g (i, k) (j, k)).2 + (Prod.ext ((a.triple_mem_actionGraph s t g i j).1 rel) rfl) + · intro member + obtain ⟨g, i, k, eq⟩ := (a.mem_productColumns_actionGraph s c t z).1 member + exact ⟨t.encode g, t.encode_mem g, s.encode i, s.encode_mem i, + s.encode (a.iso g i), s.encode_mem _, c.encode k, c.encode_mem k, + (s.product c).encode (i, k), (s.product c).encode_mem _, + (s.product c).encode (a.iso g i, k), (s.product c).encode_mem _, rfl, rfl, eq, + (a.triple_mem_actionGraph s t g i (a.iso g i)).2 rfl⟩ + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G I C : Type u} [Group G] [PartialOrder I] [PartialOrder C] + +theorem productColumns_actionGraph_mem + (a : PosetAction G I) (s : Presentation I) (c : Presentation C) (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (rows : s.carrier ∈ M.sets) (columns : c.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (graph : a.actionGraph s t ∈ M.sets) : + (a.productColumns C).actionGraph (s.product c) t ∈ M.sets := by + have coordinates : (s.product c).carrier ∈ M.sets := + M.prod_mem pairing unions powers separation rows columns + have bound := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation group coordinates) coordinates + let params := extend t.carrier (extend s.carrier (extend c.carrier + (extend (s.product c).carrier (extend (a.actionGraph s t) Fin.elim0)))) + have members : ∀ k, params k ∈ M.sets := + Fin.cases group (Fin.cases rows (Fin.cases columns (Fin.cases coordinates + (Fin.cases graph (fun k => Fin.elim0 k))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.productColumnsEntryFormula 0 1 2 3 4 5) params members bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.productColumnsEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod (ZFSet.prod t.carrier (s.product c).carrier) (s.product c).carrier) = + (a.productColumns C).actionGraph (s.product c) t := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.productColumnsEntry_correct] + exact ⟨And.right, fun hz => ⟨((t.product (s.product c)).graph_isFunc (s.product c) + (fun x => (a.productColumns C).iso x.1 x.2)).1 hz, hz⟩⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductSizeWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductSizeWitnesses.lean index c456bcbe7bd8f23c04aa97462e5eed31bb52f8ca..f72f580685d7fc9dddc46fa8e5314f24bd599a69 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductSizeWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProductSizeWitnesses.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStandardInaccessible - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundEmbeddable_product_targets - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A B C D : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (first : M.groundEmbeddable A C) (second : M.groundEmbeddable B D) : - M.groundEmbeddable (ZFSet.prod A B) (ZFSet.prod C D) := by - obtain ⟨f, hf, first⟩ := first - obtain ⟨g, hg, second⟩ := second - exact ⟨relationProduct A B C D f g, - M.relationProduct_mem pairing unions powers separation hA hB hC hD hf hg, - relationProduct_injection first second⟩ - -theorem square_subset_groundPower_twice - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) : - ZFSet.prod A A ⊆ M.groundPower (M.groundPower A) := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - have hxM := M.transitive hA hx - have hyM := M.transitive hA hy - apply (M.mem_groundPower _ _).2 - refine ⟨M.orderedPair_mem pairing hxM hyM, ?_⟩ - intro t ht - rcases ZFSet.mem_pair.1 ht with rfl | rfl - · apply (M.mem_groundPower _ _).2 - refine ⟨?_, ?_⟩ - · simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hxM hxM - · intro w hw - exact (ZFSet.mem_singleton.1 hw) ▸ hx - · apply (M.mem_groundPower _ _).2 - refine ⟨M.unorderedPair_mem pairing hxM hyM, ?_⟩ - intro w hw - rcases ZFSet.mem_pair.1 hw with rfl | rfl - · exact hx - · exact hy - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStandardInaccessible + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundEmbeddable_product_targets + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A B C D : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (first : M.groundEmbeddable A C) (second : M.groundEmbeddable B D) : + M.groundEmbeddable (ZFSet.prod A B) (ZFSet.prod C D) := by + obtain ⟨f, hf, first⟩ := first + obtain ⟨g, hg, second⟩ := second + exact ⟨relationProduct A B C D f g, + M.relationProduct_mem pairing unions powers separation hA hB hC hD hf hg, + relationProduct_injection first second⟩ + +theorem square_subset_groundPower_twice + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) : + ZFSet.prod A A ⊆ M.groundPower (M.groundPower A) := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + have hxM := M.transitive hA hx + have hyM := M.transitive hA hy + apply (M.mem_groundPower _ _).2 + refine ⟨M.orderedPair_mem pairing hxM hyM, ?_⟩ + intro t ht + rcases ZFSet.mem_pair.1 ht with rfl | rfl + · apply (M.mem_groundPower _ _).2 + refine ⟨?_, ?_⟩ + · simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hxM hxM + · intro w hw + exact (ZFSet.mem_singleton.1 hw) ▸ hx + · apply (M.mem_groundPower _ _).2 + refine ⟨M.unorderedPair_mem pairing hxM hyM, ?_⟩ + intro w hw + rcases ZFSet.mem_pair.1 hw with rfl | rfl + · exact hx + · exact hy + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProjectedRowChooserWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProjectedRowChooserWitnesses.lean index 23d9c769db4fe07903a7e40c16f951076579ec61..df055a5a57c6816fc26c5d6b744301d2d5fb3c60 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProjectedRowChooserWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundProjectedRowChooserWitnesses.lean @@ -1,374 +1,374 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundInternalRowSetZF -import OAI.SetTheory.PartitionPrinciple.Definability.GroundOutsideRowCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundProjectedRowUniqueFibers -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalEnumerationFamilies - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] -variable (s : Presentation P) {G : Type v} [Group G] -variable (a : PosetAction G P) (F : NormalSubgroupFamily G) - -def symmetricExtension (H : ConditionFilter P) : TransitiveGround.{u} := - ⟨(a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}, - (a.symmetricDomain s (M.nameDomain s) F).values_transitive {q | H.mem q}⟩ - -theorem mem_symmetricExtension (H : ConditionFilter P) (x : ZFSet.{u}) : - x ∈ (M.symmetricExtension s a F H).sets ↔ - ∃ τ ∈ (M.nameDomain s).names, HereditarilySymmetric a s F τ ∧ - Name.eval {q | H.mem q} τ = x := - a.mem_symmetric_values s (M.nameDomain s) F {q | H.mem q} x - -theorem symmetricExtension_subset_ordinaryExtension (H : ConditionFilter P) : - (M.symmetricExtension s a F H).sets ⊆ (M.ordinaryExtension s H).sets := by - intro x hx - obtain ⟨τ, ground, _, equal⟩ := (M.mem_symmetricExtension s a F H x).1 hx - exact (M.mem_ordinaryExtension s H x).2 ⟨τ, ground, equal⟩ - -theorem ground_subset_symmetricExtension [OrderTop P] - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : - M.sets ⊆ (M.symmetricExtension s a F H).sets := by - intro x hx - exact (M.mem_symmetricExtension s a F H x).2 ⟨Name.check s ⊤ x, - M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) x hx, - HereditarilySymmetric.check a s F x, Name.eval_check {q | H.mem q} ⊤ H.top_mem x⟩ - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u -variable {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -noncomputable def supportedFamilyCodes (K : Subgroup G) (W : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ tau : Name s, tau.val = z ∧ K ≤ a.stabilizer s tau) W - -theorem mem_supportedFamilyCodes (K : Subgroup G) (W : ZFSet.{u}) (tau : Name s) : - tau.val ∈ supportedFamilyCodes a s K W ↔ tau.val ∈ W ∧ K ≤ a.stabilizer s tau := by - rw [supportedFamilyCodes, ZFSet.mem_sep] - constructor - · rintro ⟨member, sigma, equal, fixed⟩ - have same : sigma = tau := Subtype.ext equal - exact ⟨member, same ▸ fixed⟩ - · rintro ⟨member, fixed⟩ - exact ⟨member, tau, rfl, fixed⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem supportedFamilyCodes_mem (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (i : I) (hi : b.encode i ∈ M.sets) - (W : ZFSet.{u}) (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) : - Name.supportedFamilyCodes a s (K i) W ∈ M.sets := by - let params := extend (b.encode i) (extend s.carrier (extend t.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) - have members : ∀ j, params j ∈ M.sets := - Fin.cases hi (Fin.cases carrier (Fin.cases group (Fin.cases supports - (Fin.cases maps (fun j => Fin.elim0 j))))) - have selected := M.separation_mem separation nameSupportFormula params members hW - have equal : ZFSet.sep (fun z => Realize M.sets nameSupportFormula (extend z params)) W = - Name.supportedFamilyCodes a s (K i) W := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, Name.supportedFamilyCodes, ZFSet.mem_sep] - apply and_congr_right - intro member - let tau : Name s := ⟨z, valid z member⟩ - have meaning : Realize M.sets nameSupportFormula (extend z params) ↔ - K i ≤ a.stabilizer s tau := - M.realize_nameSupportFormula a s t b K pairing unions powers separation collection - carrier group supports maps i hi tau (M.transitive hW member) - rw [meaning] - constructor - · intro fixed - exact ⟨tau, rfl, fixed⟩ - · rintro ⟨sigma, sigmaCode, fixed⟩ - have same : sigma = tau := Subtype.ext sigmaCode - exact same ▸ fixed - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable {G : Type v} [Group G] - -theorem supportedNameSequence_function_mem - (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) - {I f : ZFSet.{u}} (hI : I ∈ M.sets) (hf : f ∈ M.sets) - (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) - (K : Subgroup G) (support : F.mem K) - (fixed : ∀ g ∈ K, ∀ i, a.act s g ⟨function.value i, names i⟩ = ⟨function.value i, names i⟩) - (children : ∀ i, HereditarilySymmetric a s F ⟨function.value i, names i⟩) - (H : ConditionFilter P) : - let sequence := Name.indexedGraphName ⊤ function names - sequence.val ∈ M.sets ∧ K ≤ a.stabilizer s sequence ∧ - HereditarilySymmetric a s F sequence ∧ - ZFSet.IsFunc I (ZFSet.range (fun i : I => Name.eval {p | H.mem p} ⟨function.value i, names i⟩)) - (Name.eval {p | H.mem p} sequence) ∧ - Name.eval {p | H.mem p} sequence ∈ (M.symmetricExtension s a F H).sets := by - let sequence := Name.indexedGraphName ⊤ function names - have ground := M.indexedGraphName_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) hI hf function names - have supported : K ≤ a.stabilizer s sequence := - Name.indexedTuple_supported a I (fun i => ⟨function.value i, names i⟩) K fixed - have symmetric : HereditarilySymmetric a s F sequence := - Name.indexedTuple_hs a F I (fun i => ⟨function.value i, names i⟩) K support fixed children - exact ⟨ground, supported, symmetric, - Name.eval_indexedGraphName_function {p | H.mem p} ⊤ H.top_mem function names, - (M.mem_symmetricExtension s a F H _).2 ⟨sequence, ground, symmetric, rfl⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] - -theorem exists_groundOrdinalFixedNameSequence - (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) - {W f : ZFSet.{u}} (hW : W ∈ M.sets) (hf : f ∈ M.sets) - (function : FunctionGraphOn W f) (names : ∀ i, IsName s (function.value i)) - (fixed : ∀ g i, a.act s g ⟨function.value i, names i⟩ = ⟨function.value i, names i⟩) - (children : ∀ i, HereditarilySymmetric a s F ⟨function.value i, names i⟩) : - ∃ I ∈ M.sets, ordinalSetProperty I ∧ - ∃ q ∈ M.sets, ∃ qFunction : FunctionGraphOn I q, - ∃ qNames : ∀ j, IsName s (qFunction.value j), - (∀ g j, a.act s g ⟨qFunction.value j, qNames j⟩ = ⟨qFunction.value j, qNames j⟩) ∧ - (∀ j, HereditarilySymmetric a s F ⟨qFunction.value j, qNames j⟩) ∧ - (∀ i : W.toSet, ∃ j : I.toSet, - (⟨qFunction.value j, qNames j⟩ : Name s) = ⟨function.value i, names i⟩) ∧ - (∀ j : I.toSet, ∃ i : W.toSet, - (⟨qFunction.value j, qNames j⟩ : Name s) = ⟨function.value i, names i⟩) ∧ - ∀ H : ConditionFilter P, - let sequence := Name.indexedGraphName ⊤ qFunction qNames - sequence.val ∈ M.sets ∧ HereditarilySymmetric a s F sequence ∧ - ZFSet.IsFunc I (ZFSet.range (fun j : I => Name.eval {p | H.mem p} - ⟨qFunction.value j, qNames j⟩)) (Name.eval {p | H.mem p} sequence) ∧ - Name.eval {p | H.mem p} sequence ∈ (M.symmetricExtension s a F H).sets := by - obtain ⟨I, hI, enumeration, hEnumeration, ordinal, injection, onto⟩ := - M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice hW - let V := functionGraphRange W f - have hV : V ∈ M.sets := M.functionGraphRange_mem unions separation hW hf - let q := relationCompose I W V enumeration f - have hq : q ∈ M.sets := M.relationCompose_mem pairing unions powers separation - hI hW hV hEnumeration hf - have qFunction : FunctionGraphOn I q := ⟨V, relationCompose_function_of_subset - injection.1 (functionGraphRange_function function) (fun _ h => h)⟩ - have each (j : I.toSet) : ∃ i : W.toSet, qFunction.value j = function.value i := by - obtain ⟨_, _, x, hx, _, edge⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 (qFunction.value_entry j) - exact ⟨⟨x, hx⟩, (function.value_eq_of_entry ⟨x, hx⟩ edge).symm⟩ - let source (j : I.toSet) := Classical.choose (each j) - have value (j : I.toSet) := Classical.choose_spec (each j) - have qNames (j : I.toSet) : IsName s (qFunction.value j) := (value j).symm ▸ names (source j) - have actual (j : I.toSet) : (⟨qFunction.value j, qNames j⟩ : Name s) = - ⟨function.value (source j), names (source j)⟩ := Subtype.ext (value j) - have qFixed (g : G) (j : I.toSet) : a.act s g ⟨qFunction.value j, qNames j⟩ = ⟨qFunction.value j, qNames j⟩ := by - rw [actual j] - exact fixed g (source j) - have qChildren (j : I.toSet) : HereditarilySymmetric a s F ⟨qFunction.value j, qNames j⟩ := by - rw [actual j] - exact children (source j) - refine ⟨I, hI, ordinal, q, hq, qFunction, qNames, qFixed, qChildren, ?_, - (fun j => ⟨source j, actual j⟩), ?_⟩ - · intro i - obtain ⟨j, hj, enumerated⟩ := onto i.val i.property - have edge : ZFSet.pair j (function.value i) ∈ q := (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨hj, (mem_functionGraphRange W f _).2 ⟨i.val, i.property, function.value_entry i⟩, - i.val, i.property, enumerated, function.value_entry i⟩ - exact ⟨⟨j, hj⟩, Subtype.ext (qFunction.value_eq_of_entry ⟨j, hj⟩ edge)⟩ - · intro H sequence - have package := M.supportedNameSequence_function_mem s a F pairing unions powers separation - collection carrier hI hq qFunction qNames ⊤ F.top (fun g _ j => qFixed g j) qChildren H - exact ⟨package.1, package.2.2.1, package.2.2.2.1, package.2.2.2.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {L G Upper : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] [PartialOrder Upper] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (upper : Presentation Upper) (e : PosetAction G Upper) -variable (upperCarrier : upper.carrier ∈ M.sets) - -include directed collection upperCarrier - -theorem liftedInternalRowSet_mem : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let R := M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let lower := SetMembers.presentation R - ∀ (inclusion : SetMembers R → Upper), lower.graph upper inclusion ∈ M.sets → - (∀ g p, inclusion (act.iso g p) = e.iso g (inclusion p)) → - ∀ H : ConditionFilter Upper, - Name.eval {p | H.mem p} (Name.rename upper inclusion (M.internalRowSetName s C hL)) ∈ - (M.symmetricExtension upper e (a.principalSupportFamily ⊥ directed) H).sets := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - dsimp only - intro inclusion inclusionGround equivariant H - apply (M.mem_symmetricExtension upper e (a.principalSupportFamily ⊥ directed) H _).2 - have lowerGround := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC) - (M.natSetCode_mem separation infinite 2) - refine ⟨_, M.rename_between_mem _ upper pairing unions powers separation collection - lowerGround upperCarrier inclusion inclusionGround _ - (M.internalRowSetName_mem s C pairing unions powers separation collection infinite hL hC), ?_, rfl⟩ - exact (M.internalRowSetName_hs a s b C pairing unions powers separation infinite hL hC hG - graph directed).rename e upper inclusion equivariant - -theorem liftedInternalRows_chooser_witness - (order : s.conditionOrder ∈ M.sets) (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let R := M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let lower := SetMembers.presentation R - ∀ (restriction : Upper →o SetMembers R) (inclusion : SetMembers R ↪o Upper) - (_projection : CompleteProjection restriction inclusion), - lower.graph upper inclusion ∈ M.sets → - (∀ g p, inclusion (act.iso g p) = e.iso g (inclusion p)) → - ∀ (H : ConditionFilter Upper), H.GenericFor (formulaFamily (M.nameDomain upper)) → - let N := M.symmetricExtension upper e (a.principalSupportFamily ⊥ directed) H - let rows := Name.eval {p | H.mem p} (Name.rename upper inclusion (M.internalRowSetName s C hL)) - ∀ f ∈ N.sets, - (∀ S ∈ N.sets, S ⊆ rows → S.Nonempty → - ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x) → - ∃ (B : L) (i : {i : L // i ≠ ⊥}) - (sn xn fn : (M.nameDomain upper).names), - ¬ i.val ≤ B ∧ - sn.val = Name.rename upper inclusion (M.internalOutsideRowsName s C hL B) ∧ - xn.val = Name.rename upper inclusion (M.internalRowName s C hL i) ∧ - a.principalFix B ≤ e.stabilizer upper sn.val ∧ - a.principalFix B ≤ e.stabilizer upper fn.val ∧ - ∃ p : Upper, H.mem p ∧ - Forces (M.nameDomain upper) (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula - (extend sn (extend xn (extend fn Fin.elim0))) p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let R := M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let lower := SetMembers.presentation R - dsimp only - intro restriction inclusion projection inclusionGround equivariant H ordinary f hf selection - let F := a.principalSupportFamily (⊥ : L) directed - let N := M.symmetricExtension upper e F H - let K := projection.projectedFilter H - have lowerGround : lower.carrier ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers - separation infinite (M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation hL) hC) (M.natSetCode_mem separation infinite 2) - have renameGround (tau : Name lower) (ground : tau.val ∈ M.sets) : - (Name.rename upper inclusion tau).val ∈ M.sets := - M.rename_between_mem lower upper pairing unions powers separation collection lowerGround - upperCarrier inclusion inclusionGround tau ground - have evalLift (tau : Name lower) : - Name.eval {p | H.mem p} (Name.rename upper inclusion tau) = Name.eval {p | K.mem p} tau := - Name.eval_rename upper inclusion {p | H.mem p} tau - obtain ⟨fname, groundF, hsF, rfl⟩ := (M.mem_symmetricExtension upper e F H f).1 hf - obtain ⟨B, fixedF⟩ := hsF.symmetric - let Sname := Name.rename upper inclusion (M.internalOutsideRowsName s C hL B) - have groundS : Sname.val ∈ M.sets := renameGround _ - (M.internalOutsideRowsName_mem s C pairing unions powers separation collection infinite hL hC order B) - have hsS : HereditarilySymmetric e upper F Sname := - (M.internalOutsideRowsName_hs a s b C pairing unions powers separation infinite hL hC hG graph - directed B).rename e upper inclusion equivariant - have hS : Name.eval {p | H.mem p} Sname ∈ N.sets := - (M.mem_symmetricExtension upper e F H _).2 ⟨Sname, groundS, hsS, rfl⟩ - have subset : Name.eval {p | H.mem p} Sname ⊆ - Name.eval {p | H.mem p} (Name.rename upper inclusion (M.internalRowSetName s C hL)) := by - change Name.eval {p | H.mem p} (Name.rename upper inclusion _) ⊆ _ - rw [evalLift, evalLift] - exact M.eval_internalOutsideRowsName_subset s C hL B K - have nonempty : (Name.eval {p | H.mem p} Sname).Nonempty := by - change (Name.eval {p | H.mem p} (Name.rename upper inclusion _)).Nonempty - rw [evalLift] - exact M.eval_internalOutsideRowsName_nonempty s C hL B (unbounded B) K - obtain ⟨x, hx, chosen, unique⟩ := selection _ hS subset nonempty - have hxK : x ∈ Name.eval {p | K.mem p} (M.internalOutsideRowsName s C hL B) := by - rw [← evalLift] - exact hx - obtain ⟨i, outside, rowValue⟩ := (M.mem_eval_internalOutsideRowsName s C hL B K x).1 hxK - let rowName := Name.rename upper inclusion (M.internalRowName s C hL i) - have groundRow : rowName.val ∈ M.sets := renameGround _ - (M.internalRowName_mem s C pairing unions powers separation collection infinite hL hC i) - let sn : (M.nameDomain upper).names := ⟨Sname, groundS⟩ - let xn : (M.nameDomain upper).names := ⟨rowName, groundRow⟩ - let fn : (M.nameDomain upper).names := ⟨fname, groundF⟩ - let env := extend sn (extend xn (extend fn Fin.elim0)) - have rowEq : Name.eval {p | H.mem p} rowName = x := - (evalLift _).trans ((M.eval_internalRowName s C hL i K).trans rowValue) - have truth : Realize ((M.nameDomain upper).values {p | H.mem p}) - (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula (evalAssignment {p | H.mem p} env) := by - apply (realize_uniqueFiber_values (M.nameDomain upper) {p | H.mem p} 0 1 2 env).2 - change Name.eval {p | H.mem p} rowName ∈ Name.eval {p | H.mem p} Sname ∧ - ZFSet.pair (Name.eval {p | H.mem p} Sname) (Name.eval {p | H.mem p} rowName) ∈ - Name.eval {p | H.mem p} fname ∧ - ∀ z ∈ Name.eval {p | H.mem p} Sname, - ZFSet.pair (Name.eval {p | H.mem p} Sname) z ∈ Name.eval {p | H.mem p} fname → - z = Name.eval {p | H.mem p} rowName - rw [rowEq] - exact ⟨hx, chosen, unique⟩ - obtain ⟨p, hp, forced⟩ := (forcing_truth (M.nameDomain upper) H ordinary - (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula env).1 truth - refine ⟨B, i, sn, xn, fn, outside, rfl, rfl, ?_, fixedF, p, hp, forced⟩ - intro g fixed - change e.act upper g (Name.rename upper inclusion _) = Name.rename upper inclusion _ - rw [act.act_rename_of_equivariant e lower upper inclusion equivariant] - exact congrArg (Name.rename upper inclusion) - (M.internalOutsideRowsName_action a s b C pairing unions powers separation infinite hL hC hG - graph B g fixed) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundInternalRowSetZF +import OAI.SetTheory.PartitionPrinciple.Definability.GroundOutsideRowCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundProjectedRowUniqueFibers +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalEnumerationFamilies + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] +variable (s : Presentation P) {G : Type v} [Group G] +variable (a : PosetAction G P) (F : NormalSubgroupFamily G) + +def symmetricExtension (H : ConditionFilter P) : TransitiveGround.{u} := + ⟨(a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}, + (a.symmetricDomain s (M.nameDomain s) F).values_transitive {q | H.mem q}⟩ + +theorem mem_symmetricExtension (H : ConditionFilter P) (x : ZFSet.{u}) : + x ∈ (M.symmetricExtension s a F H).sets ↔ + ∃ τ ∈ (M.nameDomain s).names, HereditarilySymmetric a s F τ ∧ + Name.eval {q | H.mem q} τ = x := + a.mem_symmetric_values s (M.nameDomain s) F {q | H.mem q} x + +theorem symmetricExtension_subset_ordinaryExtension (H : ConditionFilter P) : + (M.symmetricExtension s a F H).sets ⊆ (M.ordinaryExtension s H).sets := by + intro x hx + obtain ⟨τ, ground, _, equal⟩ := (M.mem_symmetricExtension s a F H x).1 hx + exact (M.mem_ordinaryExtension s H x).2 ⟨τ, ground, equal⟩ + +theorem ground_subset_symmetricExtension [OrderTop P] + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : + M.sets ⊆ (M.symmetricExtension s a F H).sets := by + intro x hx + exact (M.mem_symmetricExtension s a F H x).2 ⟨Name.check s ⊤ x, + M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) x hx, + HereditarilySymmetric.check a s F x, Name.eval_check {q | H.mem q} ⊤ H.top_mem x⟩ + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u +variable {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +noncomputable def supportedFamilyCodes (K : Subgroup G) (W : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ tau : Name s, tau.val = z ∧ K ≤ a.stabilizer s tau) W + +theorem mem_supportedFamilyCodes (K : Subgroup G) (W : ZFSet.{u}) (tau : Name s) : + tau.val ∈ supportedFamilyCodes a s K W ↔ tau.val ∈ W ∧ K ≤ a.stabilizer s tau := by + rw [supportedFamilyCodes, ZFSet.mem_sep] + constructor + · rintro ⟨member, sigma, equal, fixed⟩ + have same : sigma = tau := Subtype.ext equal + exact ⟨member, same ▸ fixed⟩ + · rintro ⟨member, fixed⟩ + exact ⟨member, tau, rfl, fixed⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem supportedFamilyCodes_mem (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (i : I) (hi : b.encode i ∈ M.sets) + (W : ZFSet.{u}) (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) : + Name.supportedFamilyCodes a s (K i) W ∈ M.sets := by + let params := extend (b.encode i) (extend s.carrier (extend t.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) + have members : ∀ j, params j ∈ M.sets := + Fin.cases hi (Fin.cases carrier (Fin.cases group (Fin.cases supports + (Fin.cases maps (fun j => Fin.elim0 j))))) + have selected := M.separation_mem separation nameSupportFormula params members hW + have equal : ZFSet.sep (fun z => Realize M.sets nameSupportFormula (extend z params)) W = + Name.supportedFamilyCodes a s (K i) W := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, Name.supportedFamilyCodes, ZFSet.mem_sep] + apply and_congr_right + intro member + let tau : Name s := ⟨z, valid z member⟩ + have meaning : Realize M.sets nameSupportFormula (extend z params) ↔ + K i ≤ a.stabilizer s tau := + M.realize_nameSupportFormula a s t b K pairing unions powers separation collection + carrier group supports maps i hi tau (M.transitive hW member) + rw [meaning] + constructor + · intro fixed + exact ⟨tau, rfl, fixed⟩ + · rintro ⟨sigma, sigmaCode, fixed⟩ + have same : sigma = tau := Subtype.ext sigmaCode + exact same ▸ fixed + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable {G : Type v} [Group G] + +theorem supportedNameSequence_function_mem + (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) + {I f : ZFSet.{u}} (hI : I ∈ M.sets) (hf : f ∈ M.sets) + (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) + (K : Subgroup G) (support : F.mem K) + (fixed : ∀ g ∈ K, ∀ i, a.act s g ⟨function.value i, names i⟩ = ⟨function.value i, names i⟩) + (children : ∀ i, HereditarilySymmetric a s F ⟨function.value i, names i⟩) + (H : ConditionFilter P) : + let sequence := Name.indexedGraphName ⊤ function names + sequence.val ∈ M.sets ∧ K ≤ a.stabilizer s sequence ∧ + HereditarilySymmetric a s F sequence ∧ + ZFSet.IsFunc I (ZFSet.range (fun i : I => Name.eval {p | H.mem p} ⟨function.value i, names i⟩)) + (Name.eval {p | H.mem p} sequence) ∧ + Name.eval {p | H.mem p} sequence ∈ (M.symmetricExtension s a F H).sets := by + let sequence := Name.indexedGraphName ⊤ function names + have ground := M.indexedGraphName_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) hI hf function names + have supported : K ≤ a.stabilizer s sequence := + Name.indexedTuple_supported a I (fun i => ⟨function.value i, names i⟩) K fixed + have symmetric : HereditarilySymmetric a s F sequence := + Name.indexedTuple_hs a F I (fun i => ⟨function.value i, names i⟩) K support fixed children + exact ⟨ground, supported, symmetric, + Name.eval_indexedGraphName_function {p | H.mem p} ⊤ H.top_mem function names, + (M.mem_symmetricExtension s a F H _).2 ⟨sequence, ground, symmetric, rfl⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] + +theorem exists_groundOrdinalFixedNameSequence + (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) + {W f : ZFSet.{u}} (hW : W ∈ M.sets) (hf : f ∈ M.sets) + (function : FunctionGraphOn W f) (names : ∀ i, IsName s (function.value i)) + (fixed : ∀ g i, a.act s g ⟨function.value i, names i⟩ = ⟨function.value i, names i⟩) + (children : ∀ i, HereditarilySymmetric a s F ⟨function.value i, names i⟩) : + ∃ I ∈ M.sets, ordinalSetProperty I ∧ + ∃ q ∈ M.sets, ∃ qFunction : FunctionGraphOn I q, + ∃ qNames : ∀ j, IsName s (qFunction.value j), + (∀ g j, a.act s g ⟨qFunction.value j, qNames j⟩ = ⟨qFunction.value j, qNames j⟩) ∧ + (∀ j, HereditarilySymmetric a s F ⟨qFunction.value j, qNames j⟩) ∧ + (∀ i : W.toSet, ∃ j : I.toSet, + (⟨qFunction.value j, qNames j⟩ : Name s) = ⟨function.value i, names i⟩) ∧ + (∀ j : I.toSet, ∃ i : W.toSet, + (⟨qFunction.value j, qNames j⟩ : Name s) = ⟨function.value i, names i⟩) ∧ + ∀ H : ConditionFilter P, + let sequence := Name.indexedGraphName ⊤ qFunction qNames + sequence.val ∈ M.sets ∧ HereditarilySymmetric a s F sequence ∧ + ZFSet.IsFunc I (ZFSet.range (fun j : I => Name.eval {p | H.mem p} + ⟨qFunction.value j, qNames j⟩)) (Name.eval {p | H.mem p} sequence) ∧ + Name.eval {p | H.mem p} sequence ∈ (M.symmetricExtension s a F H).sets := by + obtain ⟨I, hI, enumeration, hEnumeration, ordinal, injection, onto⟩ := + M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice hW + let V := functionGraphRange W f + have hV : V ∈ M.sets := M.functionGraphRange_mem unions separation hW hf + let q := relationCompose I W V enumeration f + have hq : q ∈ M.sets := M.relationCompose_mem pairing unions powers separation + hI hW hV hEnumeration hf + have qFunction : FunctionGraphOn I q := ⟨V, relationCompose_function_of_subset + injection.1 (functionGraphRange_function function) (fun _ h => h)⟩ + have each (j : I.toSet) : ∃ i : W.toSet, qFunction.value j = function.value i := by + obtain ⟨_, _, x, hx, _, edge⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 (qFunction.value_entry j) + exact ⟨⟨x, hx⟩, (function.value_eq_of_entry ⟨x, hx⟩ edge).symm⟩ + let source (j : I.toSet) := Classical.choose (each j) + have value (j : I.toSet) := Classical.choose_spec (each j) + have qNames (j : I.toSet) : IsName s (qFunction.value j) := (value j).symm ▸ names (source j) + have actual (j : I.toSet) : (⟨qFunction.value j, qNames j⟩ : Name s) = + ⟨function.value (source j), names (source j)⟩ := Subtype.ext (value j) + have qFixed (g : G) (j : I.toSet) : a.act s g ⟨qFunction.value j, qNames j⟩ = ⟨qFunction.value j, qNames j⟩ := by + rw [actual j] + exact fixed g (source j) + have qChildren (j : I.toSet) : HereditarilySymmetric a s F ⟨qFunction.value j, qNames j⟩ := by + rw [actual j] + exact children (source j) + refine ⟨I, hI, ordinal, q, hq, qFunction, qNames, qFixed, qChildren, ?_, + (fun j => ⟨source j, actual j⟩), ?_⟩ + · intro i + obtain ⟨j, hj, enumerated⟩ := onto i.val i.property + have edge : ZFSet.pair j (function.value i) ∈ q := (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨hj, (mem_functionGraphRange W f _).2 ⟨i.val, i.property, function.value_entry i⟩, + i.val, i.property, enumerated, function.value_entry i⟩ + exact ⟨⟨j, hj⟩, Subtype.ext (qFunction.value_eq_of_entry ⟨j, hj⟩ edge)⟩ + · intro H sequence + have package := M.supportedNameSequence_function_mem s a F pairing unions powers separation + collection carrier hI hq qFunction qNames ⊤ F.top (fun g _ j => qFixed g j) qChildren H + exact ⟨package.1, package.2.2.1, package.2.2.2.1, package.2.2.2.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {L G Upper : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] [PartialOrder Upper] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (upper : Presentation Upper) (e : PosetAction G Upper) +variable (upperCarrier : upper.carrier ∈ M.sets) + +include directed collection upperCarrier + +theorem liftedInternalRowSet_mem : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let R := M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let lower := SetMembers.presentation R + ∀ (inclusion : SetMembers R → Upper), lower.graph upper inclusion ∈ M.sets → + (∀ g p, inclusion (act.iso g p) = e.iso g (inclusion p)) → + ∀ H : ConditionFilter Upper, + Name.eval {p | H.mem p} (Name.rename upper inclusion (M.internalRowSetName s C hL)) ∈ + (M.symmetricExtension upper e (a.principalSupportFamily ⊥ directed) H).sets := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + dsimp only + intro inclusion inclusionGround equivariant H + apply (M.mem_symmetricExtension upper e (a.principalSupportFamily ⊥ directed) H _).2 + have lowerGround := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC) + (M.natSetCode_mem separation infinite 2) + refine ⟨_, M.rename_between_mem _ upper pairing unions powers separation collection + lowerGround upperCarrier inclusion inclusionGround _ + (M.internalRowSetName_mem s C pairing unions powers separation collection infinite hL hC), ?_, rfl⟩ + exact (M.internalRowSetName_hs a s b C pairing unions powers separation infinite hL hC hG + graph directed).rename e upper inclusion equivariant + +theorem liftedInternalRows_chooser_witness + (order : s.conditionOrder ∈ M.sets) (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let R := M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let lower := SetMembers.presentation R + ∀ (restriction : Upper →o SetMembers R) (inclusion : SetMembers R ↪o Upper) + (_projection : CompleteProjection restriction inclusion), + lower.graph upper inclusion ∈ M.sets → + (∀ g p, inclusion (act.iso g p) = e.iso g (inclusion p)) → + ∀ (H : ConditionFilter Upper), H.GenericFor (formulaFamily (M.nameDomain upper)) → + let N := M.symmetricExtension upper e (a.principalSupportFamily ⊥ directed) H + let rows := Name.eval {p | H.mem p} (Name.rename upper inclusion (M.internalRowSetName s C hL)) + ∀ f ∈ N.sets, + (∀ S ∈ N.sets, S ⊆ rows → S.Nonempty → + ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x) → + ∃ (B : L) (i : {i : L // i ≠ ⊥}) + (sn xn fn : (M.nameDomain upper).names), + ¬ i.val ≤ B ∧ + sn.val = Name.rename upper inclusion (M.internalOutsideRowsName s C hL B) ∧ + xn.val = Name.rename upper inclusion (M.internalRowName s C hL i) ∧ + a.principalFix B ≤ e.stabilizer upper sn.val ∧ + a.principalFix B ≤ e.stabilizer upper fn.val ∧ + ∃ p : Upper, H.mem p ∧ + Forces (M.nameDomain upper) (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula + (extend sn (extend xn (extend fn Fin.elim0))) p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let R := M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let lower := SetMembers.presentation R + dsimp only + intro restriction inclusion projection inclusionGround equivariant H ordinary f hf selection + let F := a.principalSupportFamily (⊥ : L) directed + let N := M.symmetricExtension upper e F H + let K := projection.projectedFilter H + have lowerGround : lower.carrier ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers + separation infinite (M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation hL) hC) (M.natSetCode_mem separation infinite 2) + have renameGround (tau : Name lower) (ground : tau.val ∈ M.sets) : + (Name.rename upper inclusion tau).val ∈ M.sets := + M.rename_between_mem lower upper pairing unions powers separation collection lowerGround + upperCarrier inclusion inclusionGround tau ground + have evalLift (tau : Name lower) : + Name.eval {p | H.mem p} (Name.rename upper inclusion tau) = Name.eval {p | K.mem p} tau := + Name.eval_rename upper inclusion {p | H.mem p} tau + obtain ⟨fname, groundF, hsF, rfl⟩ := (M.mem_symmetricExtension upper e F H f).1 hf + obtain ⟨B, fixedF⟩ := hsF.symmetric + let Sname := Name.rename upper inclusion (M.internalOutsideRowsName s C hL B) + have groundS : Sname.val ∈ M.sets := renameGround _ + (M.internalOutsideRowsName_mem s C pairing unions powers separation collection infinite hL hC order B) + have hsS : HereditarilySymmetric e upper F Sname := + (M.internalOutsideRowsName_hs a s b C pairing unions powers separation infinite hL hC hG graph + directed B).rename e upper inclusion equivariant + have hS : Name.eval {p | H.mem p} Sname ∈ N.sets := + (M.mem_symmetricExtension upper e F H _).2 ⟨Sname, groundS, hsS, rfl⟩ + have subset : Name.eval {p | H.mem p} Sname ⊆ + Name.eval {p | H.mem p} (Name.rename upper inclusion (M.internalRowSetName s C hL)) := by + change Name.eval {p | H.mem p} (Name.rename upper inclusion _) ⊆ _ + rw [evalLift, evalLift] + exact M.eval_internalOutsideRowsName_subset s C hL B K + have nonempty : (Name.eval {p | H.mem p} Sname).Nonempty := by + change (Name.eval {p | H.mem p} (Name.rename upper inclusion _)).Nonempty + rw [evalLift] + exact M.eval_internalOutsideRowsName_nonempty s C hL B (unbounded B) K + obtain ⟨x, hx, chosen, unique⟩ := selection _ hS subset nonempty + have hxK : x ∈ Name.eval {p | K.mem p} (M.internalOutsideRowsName s C hL B) := by + rw [← evalLift] + exact hx + obtain ⟨i, outside, rowValue⟩ := (M.mem_eval_internalOutsideRowsName s C hL B K x).1 hxK + let rowName := Name.rename upper inclusion (M.internalRowName s C hL i) + have groundRow : rowName.val ∈ M.sets := renameGround _ + (M.internalRowName_mem s C pairing unions powers separation collection infinite hL hC i) + let sn : (M.nameDomain upper).names := ⟨Sname, groundS⟩ + let xn : (M.nameDomain upper).names := ⟨rowName, groundRow⟩ + let fn : (M.nameDomain upper).names := ⟨fname, groundF⟩ + let env := extend sn (extend xn (extend fn Fin.elim0)) + have rowEq : Name.eval {p | H.mem p} rowName = x := + (evalLift _).trans ((M.eval_internalRowName s C hL i K).trans rowValue) + have truth : Realize ((M.nameDomain upper).values {p | H.mem p}) + (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula (evalAssignment {p | H.mem p} env) := by + apply (realize_uniqueFiber_values (M.nameDomain upper) {p | H.mem p} 0 1 2 env).2 + change Name.eval {p | H.mem p} rowName ∈ Name.eval {p | H.mem p} Sname ∧ + ZFSet.pair (Name.eval {p | H.mem p} Sname) (Name.eval {p | H.mem p} rowName) ∈ + Name.eval {p | H.mem p} fname ∧ + ∀ z ∈ Name.eval {p | H.mem p} Sname, + ZFSet.pair (Name.eval {p | H.mem p} Sname) z ∈ Name.eval {p | H.mem p} fname → + z = Name.eval {p | H.mem p} rowName + rw [rowEq] + exact ⟨hx, chosen, unique⟩ + obtain ⟨p, hp, forced⟩ := (forcing_truth (M.nameDomain upper) H ordinary + (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula env).1 truth + refine ⟨B, i, sn, xn, fn, outside, rfl, rfl, ?_, fixedF, p, hp, forced⟩ + intro g fixed + change e.act upper g (Name.rename upper inclusion _) = Name.rename upper inclusion _ + rw [act.act_rename_of_equivariant e lower upper inclusion equivariant] + exact congrArg (Name.rename upper inclusion) + (M.internalOutsideRowsName_action a s b C pairing unions powers separation infinite hL hC hG + graph B g fixed) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPushFilters.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPushFilters.lean index 01ef0c18128b28c66ca7b2d4adee1dd32c725dec..45df276a90c09187a7db5bd22ab3256c1d9667bf 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPushFilters.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundPushFilters.lean @@ -1,73 +1,73 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PairPushFilterFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace BoundedFormula - -def pushFilterMemberFormula {n} (y L r S F : Fin n) : BoundedFormula n := - .conj (.mem y L) (exMem F (exMem L.succ - (.conj (pairMembershipFormula 1 0 S.succ.succ) - (pairMembershipFormula 0 y.succ.succ r.succ.succ)))) - -theorem truth_pushFilterMemberFormula {n} (y L r S F : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (pushFilterMemberFormula y L r S F) env ↔ - env y ∈ pushFilterCode (env L) (env r) (env S) (env F) := by - simp only [pushFilterMemberFormula, Truth, truth_exMem, - truth_pairMembershipFormula, mem_pushFilterCode] - rfl - -def pushFilterFormula {n} (V L r S F : Fin n) : BoundedFormula n := - .conj (.allMem V (pushFilterMemberFormula 0 L.succ r.succ S.succ F.succ)) - (.allMem L (imp (pushFilterMemberFormula 0 L.succ r.succ S.succ F.succ) (.mem 0 V.succ))) - -theorem truth_pushFilterFormula {n} (V L r S F : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (pushFilterFormula V L r S F) env ↔ - env V = pushFilterCode (env L) (env r) (env S) (env F) := by - simp only [pushFilterFormula, Truth, truth_imp, truth_pushFilterMemberFormula] - constructor - · rintro ⟨sound, complete⟩ - apply ZFSet.ext - intro y - exact ⟨sound y, fun hy => complete y (pushFilterCode_subset _ _ _ _ hy) hy⟩ - · intro equal - refine ⟨fun y hy => equal ▸ hy, ?_⟩ - intro y _ hy - change y ∈ env V - exact equal.symm ▸ hy - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem pushFilterCode_mem (separation : SeparationSchema M.sets) - {L r S F : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) - (hS : S ∈ M.sets) (hF : F ∈ M.sets) : pushFilterCode L r S F ∈ M.sets := by - let params := extend L (extend r (extend S (extend F Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.pushFilterMemberFormula 0 1 2 3 4) params - (Fin.cases hL (Fin.cases hr (Fin.cases hS (Fin.cases hF (fun i => Fin.elim0 i))))) hL - have equal : ZFSet.sep (fun y => BoundedFormula.Truth - (BoundedFormula.pushFilterMemberFormula 0 1 2 3 4) (extend y params)) L = - pushFilterCode L r S F := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep, BoundedFormula.truth_pushFilterMemberFormula] - exact ⟨And.right, fun hy => ⟨pushFilterCode_subset L r S F hy, hy⟩⟩ - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PairPushFilterFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace BoundedFormula + +def pushFilterMemberFormula {n} (y L r S F : Fin n) : BoundedFormula n := + .conj (.mem y L) (exMem F (exMem L.succ + (.conj (pairMembershipFormula 1 0 S.succ.succ) + (pairMembershipFormula 0 y.succ.succ r.succ.succ)))) + +theorem truth_pushFilterMemberFormula {n} (y L r S F : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (pushFilterMemberFormula y L r S F) env ↔ + env y ∈ pushFilterCode (env L) (env r) (env S) (env F) := by + simp only [pushFilterMemberFormula, Truth, truth_exMem, + truth_pairMembershipFormula, mem_pushFilterCode] + rfl + +def pushFilterFormula {n} (V L r S F : Fin n) : BoundedFormula n := + .conj (.allMem V (pushFilterMemberFormula 0 L.succ r.succ S.succ F.succ)) + (.allMem L (imp (pushFilterMemberFormula 0 L.succ r.succ S.succ F.succ) (.mem 0 V.succ))) + +theorem truth_pushFilterFormula {n} (V L r S F : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (pushFilterFormula V L r S F) env ↔ + env V = pushFilterCode (env L) (env r) (env S) (env F) := by + simp only [pushFilterFormula, Truth, truth_imp, truth_pushFilterMemberFormula] + constructor + · rintro ⟨sound, complete⟩ + apply ZFSet.ext + intro y + exact ⟨sound y, fun hy => complete y (pushFilterCode_subset _ _ _ _ hy) hy⟩ + · intro equal + refine ⟨fun y hy => equal ▸ hy, ?_⟩ + intro y _ hy + change y ∈ env V + exact equal.symm ▸ hy + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem pushFilterCode_mem (separation : SeparationSchema M.sets) + {L r S F : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) + (hS : S ∈ M.sets) (hF : F ∈ M.sets) : pushFilterCode L r S F ∈ M.sets := by + let params := extend L (extend r (extend S (extend F Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.pushFilterMemberFormula 0 1 2 3 4) params + (Fin.cases hL (Fin.cases hr (Fin.cases hS (Fin.cases hF (fun i => Fin.elim0 i))))) hL + have equal : ZFSet.sep (fun y => BoundedFormula.Truth + (BoundedFormula.pushFilterMemberFormula 0 1 2 3 4) (extend y params)) L = + pushFilterCode L r S F := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep, BoundedFormula.truth_pushFilterMemberFormula] + exact ⟨And.right, fun hy => ⟨pushFilterCode_subset L r S F hy, hy⟩⟩ + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedCompressionFieldsTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedCompressionFieldsTransport.lean index c5eba6c00eaf7943ecc41433ce79dd1bb8275448..8c19171bdbdbebd90ad8f0a8e05c977f0cdd7f2c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedCompressionFieldsTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedCompressionFieldsTransport.lean @@ -1,555 +1,555 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBatchEarlierLayerWitnesses -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompressionIncomingWitnessRanks -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLayerSourceCongruence -import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems - -namespace OAI - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) - -theorem exists_canonicalIncomingWitness - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {HQs Hrs Hμs HTime N : ZFSet.{u}} - (historySpaces : FunctionGraphOn HTime HQs) - (historyOrders : FunctionGraphOn HTime Hrs) - (historyMeets : FunctionGraphOn HTime Hμs) - (source : ZFSet.pair base P0 ∈ HQs ∧ ZFSet.pair base r0 ∈ Hrs ∧ ZFSet.pair base μ0 ∈ Hμs) - (n : Nat) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs - (state.data.iterate M I Sources Reps G T (n + 1)).D - (state.data.iterate M I Sources Reps G T (n + 1)).rD - (state.data.iterate M I Sources Reps G T (n + 1)).μD - (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) - (compressionStamp base n) N z := by - let current := state.iterate pairing unions powers separation hI hSources hReps hG hT n - have equal : current.data = state.data.iterate M I Sources Reps G T n := - state.iterate_data pairing unions powers separation hI hSources hReps hG hT n - have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by - simpa only [equal] using constant.iterate M I Sources Reps G T n - have finite : ZFSet.IsFunc current.data.D births.limit - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) := by - simpa only [equal] using state.canonical_birth_function data pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_function births.times n - have earlier : ∀ x t, ZFSet.pair x t ∈ - graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth → - t ∈ compressionStamp base n := fun _ _ entry => - state.canonical_birth_before_stamp pairing unions powers separation hI hSources hReps hG hT - births.extension births.initial_bound n entry - have result := current.batch.constantBatchLayerWitness_spec pairing unions powers separation - current.ground.carrier current.ground.indices current.ground.spaces current.ground.relations - current.ground.anchors current.ground.embeddings historySpaces historyOrders historyMeets finite earlier - (M.transitive births.limit_ground (births.times.stamp_mem_limit n)) (compressionStamp_base_mem base n) - (fun i => ⟨((currentConstant.space_entry_iff _ _).1 (current.batch.space_entry i)).2, - ((currentConstant.relation_entry_iff _ _).1 (current.batch.rel_entry i)).2, - ((currentConstant.meet_entry_iff _ _).1 (current.batch.meet_entry i)).2⟩) source (N := N) - refine ⟨current.batch.constantBatchLayerWitness M base, result.1, ?_⟩ - have code := result.2 - change GrowthLayerWitnessCode HQs Hrs Hμs current.data.currentCarrier - current.data.currentOrder current.data.currentMeet - (taggedBirth current.data.D current.data.fresh - (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) - (compressionStamp base n)) (compressionStamp base n) N _ at code - rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT - births.extension births.initial_function n] - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using code - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundSerializedChronology M T0 C Q qlt) -variable (fields : GroundChronologyFields M (insert births.limit births.limit)) -variable (hBase : base ∈ T0) -variable (values : ∀ j s, s ∈ insert births.limit births.limit → - fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) -include values - -theorem prefixOldField_value (j : Fin 5) {s : ZFSet.{u}} (oldTime : s ∈ base ∨ s = base) : - fields.value j s = prior.fields.value j s := by - have hs : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ - ((births.times.mem_limit_iff s).2 (oldTime.elim Or.inl (fun h => Or.inr (Or.inl h)))) - have oldFields := state.prefixFields_old data births heights prior.toHistory oldTime - exact (values j s hs).trans (Fin.cases oldFields.1 (Fin.cases oldFields.2.1 - (Fin.cases oldFields.2.2.1 (Fin.cases oldFields.2.2.2.1 (Fin.cases oldFields.2.2.2.2 (fun i => Fin.elim0 i))))) j) - -include hBase in -theorem prefixOldField_entries (j : Fin 5) {s : ZFSet.{u}} (oldTime : s ∈ base ∨ s = base) - (y : ZFSet.{u}) : - ZFSet.pair s y ∈ prior.fields.graph j ↔ ZFSet.pair s y ∈ fields.graph j := by - have oldIndex : s ∈ T0 := oldTime.elim (fun h => prior.ordinal.1 base hBase s h) (fun h => h.symm ▸ hBase) - have newIndex : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ - ((births.times.mem_limit_iff s).2 (oldTime.elim Or.inl (fun h => Or.inr (Or.inl h)))) - have equal := state.prefixOldField_value data births heights prior fields values j oldTime - constructor - · intro entry - have output := (prior.fields.value_eq_of_entry j entry).symm.trans equal.symm - exact output.symm ▸ fields.value_entry j newIndex - · intro entry - have output := (fields.value_eq_of_entry j entry).symm.trans equal - exact output.symm ▸ prior.fields.value_entry j oldIndex - -include hBase in -theorem exists_prefixOldWitness {cutoff t : ZFSet.{u}} - (oldCutoff : cutoff ∈ base ∨ cutoff = base) (bound : t = cutoff ∨ t ∈ cutoff) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) - (fields.value 3 cutoff) t ZFSet.omega z := by - have hc : cutoff ∈ T0 := oldCutoff.elim - (fun member => prior.ordinal.1 base hBase cutoff member) (fun equal => equal.symm ▸ hBase) - have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) - (fun before => prior.ordinal.1 cutoff hc t before) - have oldTime : t ∈ base ∨ t = base := by - rcases bound with equal | before - · exact equal.symm ▸ oldCutoff - · apply Or.inl - rcases oldCutoff with member | equal - · exact prior.ordinal.2 base hBase cutoff member t before - · exact equal ▸ before - have oldSource {s : ZFSet.{u}} (before : s ∈ t) : s ∈ base ∨ s = base := by - apply Or.inl - rcases oldTime with member | equal - · exact prior.ordinal.2 base hBase t member s before - · exact equal ▸ before - have code := (prior.layer_code cutoff hc t ht bound _ (prior.layerWitness_entry hc ht bound)).congr_source_entries - (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 0 (oldSource hs) y) - (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 1 (oldSource hs) y) - (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 2 (oldSource hs) y) - refine ⟨prior.layerWitness cutoff t, prior.layerWitness_ground cutoff t, ?_⟩ - rw [state.prefixOldField_value data births heights prior fields values 0 oldCutoff, - state.prefixOldField_value data births heights prior fields values 1 oldCutoff, - state.prefixOldField_value data births heights prior fields values 2 oldCutoff, - state.prefixOldField_value data births heights prior fields values 3 oldCutoff] - exact code - -end PartitionPilot.Forcing.GroundCompressionState - - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundSerializedChronology M T0 C Q qlt) -variable (fields : GroundChronologyFields M (insert births.limit births.limit)) - -theorem prefix_rawWitnesses - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (hBase : base ∈ T0) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) - (initialMeet : state.data.μD = μ0) - (priorSpace : prior.fields.value 0 base = P0) (priorOrder : prior.fields.value 1 base = r0) - (priorMeet : prior.fields.value 2 base = μ0) (priorBirth : prior.fields.value 3 base = old) - (values : ∀ j s, s ∈ insert births.limit births.limit → - fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) : - ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, - t = cutoff ∨ t ∈ cutoff → ∃ z ∈ M.sets, - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) - (fields.value 3 cutoff) t ZFSet.omega z := by - have baseIn : base ∈ insert births.limit births.limit := - ZFSet.mem_insert_of_mem _ births.times.base_mem_limit - have atBase := fun j => state.prefixOldField_value data births heights prior fields values j - (Or.inr rfl : base ∈ base ∨ base = base) - have source : ZFSet.pair base P0 ∈ fields.graph 0 ∧ ZFSet.pair base r0 ∈ fields.graph 1 ∧ - ZFSet.pair base μ0 ∈ fields.graph 2 := by - have first := fields.value_entry 0 baseIn - have second := fields.value_entry 1 baseIn - have third := fields.value_entry 2 baseIn - rw [atBase 0, priorSpace] at first - rw [atBase 1, priorOrder] at second - rw [atBase 2, priorMeet] at third - exact ⟨first, second, third⟩ - have oldWitness (t : ZFSet.{u}) (before : t ∈ base ∨ t = base) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - state.data.D state.data.rD state.data.μD old t ZFSet.omega z := by - obtain ⟨z, hz, code⟩ := state.exists_prefixOldWitness data births heights prior fields hBase values - (Or.inr rfl : base ∈ base ∨ base = base) before.symm - rw [atBase 0, atBase 1, atBase 2, atBase 3, priorSpace, priorOrder, priorMeet, priorBirth] at code - exact ⟨z, hz, initialDomain.symm ▸ initialOrder.symm ▸ initialMeet.symm ▸ code⟩ - have incoming (n : Nat) := state.exists_canonicalIncomingWitness data births - pairing unions powers separation hI hSources hReps hG hT constant - (fields.graphFunction 0) (fields.graphFunction 1) (fields.graphFunction 2) source n (N := ZFSet.omega) - have atStamp (n : Nat) : - fields.value 0 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ - fields.value 1 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ - fields.value 2 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ - fields.value 3 (compressionStamp base n) = graphRestriction - (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth := by - have hs := ZFSet.mem_insert_of_mem births.limit (births.times.stamp_mem_limit n) - have exactFields := state.prefixFields_stamp data births heights prior.toHistory n - exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, - (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ - have atLimit : fields.value 0 births.limit = data.fields 0 ∧ - fields.value 1 births.limit = data.fields 1 ∧ fields.value 2 births.limit = data.fields 2 ∧ - fields.value 3 births.limit = births.birth := by - have hs := ZFSet.mem_insert births.limit births.limit - have exactFields := state.prefixFields_limit data births heights prior.toHistory - exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, - (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ - have finite (n : Nat) (t : ZFSet.{u}) (bound : t = compressionStamp base n ∨ t ∈ compressionStamp base n) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 (compressionStamp base n)) (fields.value 1 (compressionStamp base n)) - (fields.value 2 (compressionStamp base n)) (fields.value 3 (compressionStamp base n)) t ZFSet.omega z := by - rw [(atStamp n).1, (atStamp n).2.1, (atStamp n).2.2.1, (atStamp n).2.2.2] - have cases : (t ∈ base ∨ t = base) ∨ ∃ j, j ≤ n ∧ t = compressionStamp base j := by - rcases bound with equal | before - · exact Or.inr ⟨n, Nat.le_refl n, equal⟩ - · rcases (mem_compressionStamp_iff base t n).1 before with old | same | ⟨j, earlier, equal⟩ - · exact Or.inl (Or.inl old) - · exact Or.inl (Or.inr same) - · exact Or.inr ⟨j, Nat.le_of_lt earlier, equal⟩ - rcases cases with before | ⟨j, before, rfl⟩ - · obtain ⟨z, hz, code⟩ := oldWitness t before - exact state.exists_priorWitness_to_finite data births pairing unions powers separation hI hSources hReps hG hT - (n + 1) before hz code - · obtain ⟨z, hz, code⟩ := incoming j - exact state.exists_birthWitness_to_finite data births pairing unions powers separation hI hSources hReps hG hT - (j + 1) (n + 1) (Nat.add_le_add_right before 1) - ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz code - have terminal (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 births.limit) (fields.value 1 births.limit) - (fields.value 2 births.limit) (fields.value 3 births.limit) t ZFSet.omega z := by - rw [atLimit.1, atLimit.2.1, atLimit.2.2.1, atLimit.2.2.2] - rcases bound with rfl | before - · exact state.exists_limitWitness data births pairing - · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨j, rfl⟩ - · obtain ⟨z, hz, code⟩ := oldWitness t (Or.inl old) - exact state.exists_priorWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT - (Or.inl old) hz code - · obtain ⟨z, hz, code⟩ := oldWitness t (Or.inr same) - exact state.exists_priorWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT - (Or.inr same) hz code - · obtain ⟨z, hz, code⟩ := incoming j - exact state.exists_birthWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT - (j + 1) ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz code - intro cutoff hc t _ bound - rcases ZFSet.mem_insert_iff.1 hc with rfl | before - · exact terminal t bound - · rcases (births.times.mem_limit_iff cutoff).1 before with oldTime | same | ⟨n, rfl⟩ - · exact state.exists_prefixOldWitness data births heights prior fields hBase values (Or.inl oldTime) bound - · exact state.exists_prefixOldWitness data births heights prior fields hBase values (Or.inr same) bound - · exact finite n t bound - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundSerializedChronology M T0 C Q qlt) -variable (fields : GroundChronologyFields M (insert births.limit births.limit)) -variable (hBase : base ∈ T0) -variable (values : ∀ j s, s ∈ insert births.limit births.limit → - fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) -include hBase values in -theorem exists_prefixOldRankedWitness {o : Ordinal.{u}} (priorRank : ZFSet.rank prior.code < o) {cutoff t : ZFSet.{u}} - (oldCutoff : cutoff ∈ base ∨ cutoff = base) (bound : t = cutoff ∨ t ∈ cutoff) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) - (fields.value 3 cutoff) t ZFSet.omega z ∧ ZFSet.rank z < o := by - have hc : cutoff ∈ T0 := oldCutoff.elim - (fun member => prior.ordinal.1 base hBase cutoff member) (fun equal => equal.symm ▸ hBase) - have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) - (fun before => prior.ordinal.1 cutoff hc t before) - have oldTime : t ∈ base ∨ t = base := by - rcases bound with equal | before - · exact equal.symm ▸ oldCutoff - · apply Or.inl - rcases oldCutoff with member | equal - · exact prior.ordinal.2 base hBase cutoff member t before - · exact equal ▸ before - have oldSource {s : ZFSet.{u}} (before : s ∈ t) : s ∈ base ∨ s = base := by - apply Or.inl - rcases oldTime with member | equal - · exact prior.ordinal.2 base hBase t member s before - · exact equal ▸ before - have code := (prior.layer_code cutoff hc t ht bound _ (prior.layerWitness_entry hc ht bound)).congr_source_entries - (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 0 (oldSource hs) y) - (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 1 (oldSource hs) y) - (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 2 (oldSource hs) y) - refine ⟨prior.layerWitness cutoff t, prior.layerWitness_ground cutoff t, ?_, - (prior.layerWitness_rank_lt_code hc ht bound).trans priorRank⟩ - rw [state.prefixOldField_value data births heights prior fields values 0 oldCutoff, - state.prefixOldField_value data births heights prior fields values 1 oldCutoff, - state.prefixOldField_value data births heights prior fields values 2 oldCutoff, - state.prefixOldField_value data births heights prior fields values 3 oldCutoff] - exact code - -end PartitionPilot.Forcing.GroundCompressionState - - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundSerializedChronology M T0 C Q qlt) -variable (fields : GroundChronologyFields M (insert births.limit births.limit)) - -theorem prefix_rankedRawWitnesses - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (hBase : base ∈ T0) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (priorRank : ZFSet.rank prior.code < o) - (indices : ZFSet.rank state.data.J < o) (tasks : ZFSet.rank I < o) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) - (initialMeet : state.data.μD = μ0) - (priorSpace : prior.fields.value 0 base = P0) (priorOrder : prior.fields.value 1 base = r0) - (priorMeet : prior.fields.value 2 base = μ0) (priorBirth : prior.fields.value 3 base = old) - (values : ∀ j s, s ∈ insert births.limit births.limit → - fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) : - ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, - t = cutoff ∨ t ∈ cutoff → ∃ z ∈ M.sets, - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) - (fields.value 3 cutoff) t ZFSet.omega z ∧ ZFSet.rank z < o := by - have templates : ZFSet.rank P0 < o := by - rw [← priorSpace] - exact (prior.fieldValue_rank_lt_code 0 hBase).trans priorRank - have points : ZFSet.rank state.data.D < o := initialDomain.symm ▸ templates - have time : ZFSet.rank base < o := - ((ZFSet.rank_lt_of_mem hBase).trans_le prior.time_rank_le_code).trans priorRank - have baseIn : base ∈ insert births.limit births.limit := - ZFSet.mem_insert_of_mem _ births.times.base_mem_limit - have atBase := fun j => state.prefixOldField_value data births heights prior fields values j - (Or.inr rfl : base ∈ base ∨ base = base) - have source : ZFSet.pair base P0 ∈ fields.graph 0 ∧ ZFSet.pair base r0 ∈ fields.graph 1 ∧ - ZFSet.pair base μ0 ∈ fields.graph 2 := by - have first := fields.value_entry 0 baseIn - have second := fields.value_entry 1 baseIn - have third := fields.value_entry 2 baseIn - rw [atBase 0, priorSpace] at first - rw [atBase 1, priorOrder] at second - rw [atBase 2, priorMeet] at third - exact ⟨first, second, third⟩ - have oldWitness (t : ZFSet.{u}) (before : t ∈ base ∨ t = base) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - state.data.D state.data.rD state.data.μD old t ZFSet.omega z ∧ ZFSet.rank z < o := by - obtain ⟨z, hz, code, rank⟩ := state.exists_prefixOldRankedWitness data births heights prior fields hBase values priorRank - (Or.inr rfl : base ∈ base ∨ base = base) before.symm - rw [atBase 0, atBase 1, atBase 2, atBase 3, priorSpace, priorOrder, priorMeet, priorBirth] at code - exact ⟨z, hz, initialDomain.symm ▸ initialOrder.symm ▸ initialMeet.symm ▸ code, rank⟩ - have incoming (n : Nat) := state.exists_canonicalIncomingRankedWitness data births - pairing unions powers separation hI hSources hReps hG hT constant - (fields.graphFunction 0) (fields.graphFunction 1) (fields.graphFunction 2) source limit points indices templates tasks time n (N := ZFSet.omega) - have atStamp (n : Nat) : - fields.value 0 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ - fields.value 1 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ - fields.value 2 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ - fields.value 3 (compressionStamp base n) = graphRestriction - (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth := by - have hs := ZFSet.mem_insert_of_mem births.limit (births.times.stamp_mem_limit n) - have exactFields := state.prefixFields_stamp data births heights prior.toHistory n - exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, - (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ - have atLimit : fields.value 0 births.limit = data.fields 0 ∧ - fields.value 1 births.limit = data.fields 1 ∧ fields.value 2 births.limit = data.fields 2 ∧ - fields.value 3 births.limit = births.birth := by - have hs := ZFSet.mem_insert births.limit births.limit - have exactFields := state.prefixFields_limit data births heights prior.toHistory - exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, - (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ - have finite (n : Nat) (t : ZFSet.{u}) (bound : t = compressionStamp base n ∨ t ∈ compressionStamp base n) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 (compressionStamp base n)) (fields.value 1 (compressionStamp base n)) - (fields.value 2 (compressionStamp base n)) (fields.value 3 (compressionStamp base n)) t ZFSet.omega z ∧ ZFSet.rank z < o := by - rw [(atStamp n).1, (atStamp n).2.1, (atStamp n).2.2.1, (atStamp n).2.2.2] - have cases : (t ∈ base ∨ t = base) ∨ ∃ j, j ≤ n ∧ t = compressionStamp base j := by - rcases bound with equal | before - · exact Or.inr ⟨n, Nat.le_refl n, equal⟩ - · rcases (mem_compressionStamp_iff base t n).1 before with old | same | ⟨j, earlier, equal⟩ - · exact Or.inl (Or.inl old) - · exact Or.inl (Or.inr same) - · exact Or.inr ⟨j, Nat.le_of_lt earlier, equal⟩ - rcases cases with before | ⟨j, before, rfl⟩ - · obtain ⟨z, hz, code, rank⟩ := oldWitness t before - exact state.exists_priorWitness_to_finite_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit - (n + 1) before hz rank code - · obtain ⟨z, hz, rank, code⟩ := incoming j - exact state.exists_birthWitness_to_finite_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit - (j + 1) (n + 1) (Nat.add_le_add_right before 1) - ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz rank code - have terminal (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 births.limit) (fields.value 1 births.limit) - (fields.value 2 births.limit) (fields.value 3 births.limit) t ZFSet.omega z ∧ ZFSet.rank z < o := by - rw [atLimit.1, atLimit.2.1, atLimit.2.2.1, atLimit.2.2.2] - rcases bound with rfl | before - · exact state.exists_limitWitness_rank_lt data births pairing limit - · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨j, rfl⟩ - · obtain ⟨z, hz, code, rank⟩ := oldWitness t (Or.inl old) - exact state.exists_priorWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit - (Or.inl old) hz rank code - · obtain ⟨z, hz, code, rank⟩ := oldWitness t (Or.inr same) - exact state.exists_priorWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit - (Or.inr same) hz rank code - · obtain ⟨z, hz, rank, code⟩ := incoming j - exact state.exists_birthWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit - (j + 1) ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz rank code - intro cutoff hc t _ bound - rcases ZFSet.mem_insert_iff.1 hc with rfl | before - · exact terminal t bound - · rcases (births.times.mem_limit_iff cutoff).1 before with oldTime | same | ⟨n, rfl⟩ - · exact state.exists_prefixOldRankedWitness data births heights prior fields hBase values priorRank (Or.inl oldTime) bound - · exact state.exists_prefixOldRankedWitness data births heights prior fields hBase values priorRank (Or.inr same) bound - · exact finite n t bound - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionOrigin -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters C Q qlt original Targets Separators base old T0 : ZFSet.{u}} -variable {history : GroundChronologicalHistory M T0 C Q qlt} -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) -variable (compression : GroundChronologicalCompression M initial I Sources Reps G m one T τ - P0 C Q qlt original Targets Separators Filters base old T0 history) -variable (prior : GroundSerializedChronology M T0 C Q qlt) - -include origin in -theorem exists_rankedRawCompressionFields - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hBase : base ∈ T0) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (priorRank : ZFSet.rank prior.code < o) - (indices : ZFSet.rank initial.J < o) (tasks : ZFSet.rank I < o) - (constant : RecursiveTemplateConstancy P0 r0 μ0 initial) - (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) (initialMeet : initial.μD = μ0) - (priorSpace : history.space base = P0) (priorOrder : history.order base = r0) - (priorMeet : history.meetGraph base = μ0) (priorBirth : history.birth base = old) - (agreement : ∀ j s, s ∈ T0 → prior.fields.value j s = history.fieldValue j s) : - ∃ fields : GroundChronologyFields M - (insert compression.born.births.limit compression.born.births.limit), - fields.code ∈ M.sets ∧ - ChronologyCoreCode (insert compression.born.births.limit compression.born.births.limit) - fields.bound C Q qlt fields.graph ∧ - (∀ j s, s ∈ insert compression.born.births.limit compression.born.births.limit → - fields.value j s = compression.history.fieldValue j s) ∧ - (∀ s ∈ insert compression.born.births.limit compression.born.births.limit, - ∀ t ∈ insert compression.born.births.limit compression.born.births.limit, - t = s ∨ t ∈ s → ∃ z ∈ M.sets, ZFSet.rank z < o ∧ - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - let data := compression.born.profiled.heighted.completion.algebra.union - let births := compression.born.births - let heights := compression.born.profiled.heighted.heights - obtain ⟨fields, ground, core, values⟩ := state.exists_groundPrefixFields data births heights - prior.fields prior.toHistory pairing unions powers separation collection infinite - hI hSources hReps hG hT prior.ordinal hBase - (fun j _ _ => Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j) - have ranked := state.prefix_rankedRawWitnesses data births heights prior fields - pairing unions powers separation hI hSources hReps hG hT hBase limit priorRank indices tasks - constant initialDomain initialOrder initialMeet - ((agreement 0 base hBase).trans priorSpace) ((agreement 1 base hBase).trans priorOrder) - ((agreement 2 base hBase).trans priorMeet) ((agreement 3 base hBase).trans priorBirth) values - refine ⟨fields, ground, core, ?_, ?_⟩ - · intro j s hs - rw [values j s hs] - have oldValue (a : ZFSet.{u}) (before : a ∈ base ∨ a = base) : - (state.prefixFields data births heights prior.toHistory).fieldValue j a = - compression.history.fieldValue j a := by - have ha : a ∈ T0 := before.elim (fun h => prior.ordinal.1 base hBase a h) (fun h => h.symm ▸ hBase) - have left := state.prefixFields_old data births heights prior.toHistory before - have right := compression.old_values a before - have eLeft : (state.prefixFields data births heights prior.toHistory).fieldValue j a = - prior.fields.value j a := - Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 - (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j - have eRight : compression.history.fieldValue j a = history.fieldValue j a := - Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 - (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j - exact eLeft.trans ((agreement j a ha).trans eRight.symm) - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · have left := state.prefixFields_limit data births heights prior.toHistory - have right := compression.limit_values - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - · rcases (births.times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ - · exact oldValue s (Or.inl before) - · exact oldValue s (Or.inr equal) - · have left := state.prefixFields_stamp data births heights prior.toHistory n - have right := compression.stamp_values n - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - - · intro s hs t ht earlier - obtain ⟨z, hz, code, rank⟩ := ranked s hs t ht earlier - exact ⟨z, hz, rank, code⟩ - -end PartitionPilot.Forcing.GroundCompressionOrigin - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBatchEarlierLayerWitnesses +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompressionIncomingWitnessRanks +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLayerSourceCongruence +import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems + +namespace OAI + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) + +theorem exists_canonicalIncomingWitness + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {HQs Hrs Hμs HTime N : ZFSet.{u}} + (historySpaces : FunctionGraphOn HTime HQs) + (historyOrders : FunctionGraphOn HTime Hrs) + (historyMeets : FunctionGraphOn HTime Hμs) + (source : ZFSet.pair base P0 ∈ HQs ∧ ZFSet.pair base r0 ∈ Hrs ∧ ZFSet.pair base μ0 ∈ Hμs) + (n : Nat) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode HQs Hrs Hμs + (state.data.iterate M I Sources Reps G T (n + 1)).D + (state.data.iterate M I Sources Reps G T (n + 1)).rD + (state.data.iterate M I Sources Reps G T (n + 1)).μD + (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) + (compressionStamp base n) N z := by + let current := state.iterate pairing unions powers separation hI hSources hReps hG hT n + have equal : current.data = state.data.iterate M I Sources Reps G T n := + state.iterate_data pairing unions powers separation hI hSources hReps hG hT n + have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by + simpa only [equal] using constant.iterate M I Sources Reps G T n + have finite : ZFSet.IsFunc current.data.D births.limit + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) := by + simpa only [equal] using state.canonical_birth_function data pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_function births.times n + have earlier : ∀ x t, ZFSet.pair x t ∈ + graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth → + t ∈ compressionStamp base n := fun _ _ entry => + state.canonical_birth_before_stamp pairing unions powers separation hI hSources hReps hG hT + births.extension births.initial_bound n entry + have result := current.batch.constantBatchLayerWitness_spec pairing unions powers separation + current.ground.carrier current.ground.indices current.ground.spaces current.ground.relations + current.ground.anchors current.ground.embeddings historySpaces historyOrders historyMeets finite earlier + (M.transitive births.limit_ground (births.times.stamp_mem_limit n)) (compressionStamp_base_mem base n) + (fun i => ⟨((currentConstant.space_entry_iff _ _).1 (current.batch.space_entry i)).2, + ((currentConstant.relation_entry_iff _ _).1 (current.batch.rel_entry i)).2, + ((currentConstant.meet_entry_iff _ _).1 (current.batch.meet_entry i)).2⟩) source (N := N) + refine ⟨current.batch.constantBatchLayerWitness M base, result.1, ?_⟩ + have code := result.2 + change GrowthLayerWitnessCode HQs Hrs Hμs current.data.currentCarrier + current.data.currentOrder current.data.currentMeet + (taggedBirth current.data.D current.data.fresh + (graphRestriction (state.data.iterate M I Sources Reps G T n).D births.birth) + (compressionStamp base n)) (compressionStamp base n) N _ at code + rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT + births.extension births.initial_function n] + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using code + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundSerializedChronology M T0 C Q qlt) +variable (fields : GroundChronologyFields M (insert births.limit births.limit)) +variable (hBase : base ∈ T0) +variable (values : ∀ j s, s ∈ insert births.limit births.limit → + fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) +include values + +theorem prefixOldField_value (j : Fin 5) {s : ZFSet.{u}} (oldTime : s ∈ base ∨ s = base) : + fields.value j s = prior.fields.value j s := by + have hs : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ + ((births.times.mem_limit_iff s).2 (oldTime.elim Or.inl (fun h => Or.inr (Or.inl h)))) + have oldFields := state.prefixFields_old data births heights prior.toHistory oldTime + exact (values j s hs).trans (Fin.cases oldFields.1 (Fin.cases oldFields.2.1 + (Fin.cases oldFields.2.2.1 (Fin.cases oldFields.2.2.2.1 (Fin.cases oldFields.2.2.2.2 (fun i => Fin.elim0 i))))) j) + +include hBase in +theorem prefixOldField_entries (j : Fin 5) {s : ZFSet.{u}} (oldTime : s ∈ base ∨ s = base) + (y : ZFSet.{u}) : + ZFSet.pair s y ∈ prior.fields.graph j ↔ ZFSet.pair s y ∈ fields.graph j := by + have oldIndex : s ∈ T0 := oldTime.elim (fun h => prior.ordinal.1 base hBase s h) (fun h => h.symm ▸ hBase) + have newIndex : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ + ((births.times.mem_limit_iff s).2 (oldTime.elim Or.inl (fun h => Or.inr (Or.inl h)))) + have equal := state.prefixOldField_value data births heights prior fields values j oldTime + constructor + · intro entry + have output := (prior.fields.value_eq_of_entry j entry).symm.trans equal.symm + exact output.symm ▸ fields.value_entry j newIndex + · intro entry + have output := (fields.value_eq_of_entry j entry).symm.trans equal + exact output.symm ▸ prior.fields.value_entry j oldIndex + +include hBase in +theorem exists_prefixOldWitness {cutoff t : ZFSet.{u}} + (oldCutoff : cutoff ∈ base ∨ cutoff = base) (bound : t = cutoff ∨ t ∈ cutoff) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) + (fields.value 3 cutoff) t ZFSet.omega z := by + have hc : cutoff ∈ T0 := oldCutoff.elim + (fun member => prior.ordinal.1 base hBase cutoff member) (fun equal => equal.symm ▸ hBase) + have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) + (fun before => prior.ordinal.1 cutoff hc t before) + have oldTime : t ∈ base ∨ t = base := by + rcases bound with equal | before + · exact equal.symm ▸ oldCutoff + · apply Or.inl + rcases oldCutoff with member | equal + · exact prior.ordinal.2 base hBase cutoff member t before + · exact equal ▸ before + have oldSource {s : ZFSet.{u}} (before : s ∈ t) : s ∈ base ∨ s = base := by + apply Or.inl + rcases oldTime with member | equal + · exact prior.ordinal.2 base hBase t member s before + · exact equal ▸ before + have code := (prior.layer_code cutoff hc t ht bound _ (prior.layerWitness_entry hc ht bound)).congr_source_entries + (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 0 (oldSource hs) y) + (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 1 (oldSource hs) y) + (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 2 (oldSource hs) y) + refine ⟨prior.layerWitness cutoff t, prior.layerWitness_ground cutoff t, ?_⟩ + rw [state.prefixOldField_value data births heights prior fields values 0 oldCutoff, + state.prefixOldField_value data births heights prior fields values 1 oldCutoff, + state.prefixOldField_value data births heights prior fields values 2 oldCutoff, + state.prefixOldField_value data births heights prior fields values 3 oldCutoff] + exact code + +end PartitionPilot.Forcing.GroundCompressionState + + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundSerializedChronology M T0 C Q qlt) +variable (fields : GroundChronologyFields M (insert births.limit births.limit)) + +theorem prefix_rawWitnesses + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (hBase : base ∈ T0) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) + (initialMeet : state.data.μD = μ0) + (priorSpace : prior.fields.value 0 base = P0) (priorOrder : prior.fields.value 1 base = r0) + (priorMeet : prior.fields.value 2 base = μ0) (priorBirth : prior.fields.value 3 base = old) + (values : ∀ j s, s ∈ insert births.limit births.limit → + fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) : + ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, + t = cutoff ∨ t ∈ cutoff → ∃ z ∈ M.sets, + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) + (fields.value 3 cutoff) t ZFSet.omega z := by + have baseIn : base ∈ insert births.limit births.limit := + ZFSet.mem_insert_of_mem _ births.times.base_mem_limit + have atBase := fun j => state.prefixOldField_value data births heights prior fields values j + (Or.inr rfl : base ∈ base ∨ base = base) + have source : ZFSet.pair base P0 ∈ fields.graph 0 ∧ ZFSet.pair base r0 ∈ fields.graph 1 ∧ + ZFSet.pair base μ0 ∈ fields.graph 2 := by + have first := fields.value_entry 0 baseIn + have second := fields.value_entry 1 baseIn + have third := fields.value_entry 2 baseIn + rw [atBase 0, priorSpace] at first + rw [atBase 1, priorOrder] at second + rw [atBase 2, priorMeet] at third + exact ⟨first, second, third⟩ + have oldWitness (t : ZFSet.{u}) (before : t ∈ base ∨ t = base) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + state.data.D state.data.rD state.data.μD old t ZFSet.omega z := by + obtain ⟨z, hz, code⟩ := state.exists_prefixOldWitness data births heights prior fields hBase values + (Or.inr rfl : base ∈ base ∨ base = base) before.symm + rw [atBase 0, atBase 1, atBase 2, atBase 3, priorSpace, priorOrder, priorMeet, priorBirth] at code + exact ⟨z, hz, initialDomain.symm ▸ initialOrder.symm ▸ initialMeet.symm ▸ code⟩ + have incoming (n : Nat) := state.exists_canonicalIncomingWitness data births + pairing unions powers separation hI hSources hReps hG hT constant + (fields.graphFunction 0) (fields.graphFunction 1) (fields.graphFunction 2) source n (N := ZFSet.omega) + have atStamp (n : Nat) : + fields.value 0 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ + fields.value 1 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ + fields.value 2 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ + fields.value 3 (compressionStamp base n) = graphRestriction + (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth := by + have hs := ZFSet.mem_insert_of_mem births.limit (births.times.stamp_mem_limit n) + have exactFields := state.prefixFields_stamp data births heights prior.toHistory n + exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, + (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ + have atLimit : fields.value 0 births.limit = data.fields 0 ∧ + fields.value 1 births.limit = data.fields 1 ∧ fields.value 2 births.limit = data.fields 2 ∧ + fields.value 3 births.limit = births.birth := by + have hs := ZFSet.mem_insert births.limit births.limit + have exactFields := state.prefixFields_limit data births heights prior.toHistory + exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, + (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ + have finite (n : Nat) (t : ZFSet.{u}) (bound : t = compressionStamp base n ∨ t ∈ compressionStamp base n) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 (compressionStamp base n)) (fields.value 1 (compressionStamp base n)) + (fields.value 2 (compressionStamp base n)) (fields.value 3 (compressionStamp base n)) t ZFSet.omega z := by + rw [(atStamp n).1, (atStamp n).2.1, (atStamp n).2.2.1, (atStamp n).2.2.2] + have cases : (t ∈ base ∨ t = base) ∨ ∃ j, j ≤ n ∧ t = compressionStamp base j := by + rcases bound with equal | before + · exact Or.inr ⟨n, Nat.le_refl n, equal⟩ + · rcases (mem_compressionStamp_iff base t n).1 before with old | same | ⟨j, earlier, equal⟩ + · exact Or.inl (Or.inl old) + · exact Or.inl (Or.inr same) + · exact Or.inr ⟨j, Nat.le_of_lt earlier, equal⟩ + rcases cases with before | ⟨j, before, rfl⟩ + · obtain ⟨z, hz, code⟩ := oldWitness t before + exact state.exists_priorWitness_to_finite data births pairing unions powers separation hI hSources hReps hG hT + (n + 1) before hz code + · obtain ⟨z, hz, code⟩ := incoming j + exact state.exists_birthWitness_to_finite data births pairing unions powers separation hI hSources hReps hG hT + (j + 1) (n + 1) (Nat.add_le_add_right before 1) + ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz code + have terminal (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 births.limit) (fields.value 1 births.limit) + (fields.value 2 births.limit) (fields.value 3 births.limit) t ZFSet.omega z := by + rw [atLimit.1, atLimit.2.1, atLimit.2.2.1, atLimit.2.2.2] + rcases bound with rfl | before + · exact state.exists_limitWitness data births pairing + · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨j, rfl⟩ + · obtain ⟨z, hz, code⟩ := oldWitness t (Or.inl old) + exact state.exists_priorWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT + (Or.inl old) hz code + · obtain ⟨z, hz, code⟩ := oldWitness t (Or.inr same) + exact state.exists_priorWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT + (Or.inr same) hz code + · obtain ⟨z, hz, code⟩ := incoming j + exact state.exists_birthWitness_to_union data births pairing unions powers separation hI hSources hReps hG hT + (j + 1) ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz code + intro cutoff hc t _ bound + rcases ZFSet.mem_insert_iff.1 hc with rfl | before + · exact terminal t bound + · rcases (births.times.mem_limit_iff cutoff).1 before with oldTime | same | ⟨n, rfl⟩ + · exact state.exists_prefixOldWitness data births heights prior fields hBase values (Or.inl oldTime) bound + · exact state.exists_prefixOldWitness data births heights prior fields hBase values (Or.inr same) bound + · exact finite n t bound + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundSerializedChronology M T0 C Q qlt) +variable (fields : GroundChronologyFields M (insert births.limit births.limit)) +variable (hBase : base ∈ T0) +variable (values : ∀ j s, s ∈ insert births.limit births.limit → + fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) +include hBase values in +theorem exists_prefixOldRankedWitness {o : Ordinal.{u}} (priorRank : ZFSet.rank prior.code < o) {cutoff t : ZFSet.{u}} + (oldCutoff : cutoff ∈ base ∨ cutoff = base) (bound : t = cutoff ∨ t ∈ cutoff) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) + (fields.value 3 cutoff) t ZFSet.omega z ∧ ZFSet.rank z < o := by + have hc : cutoff ∈ T0 := oldCutoff.elim + (fun member => prior.ordinal.1 base hBase cutoff member) (fun equal => equal.symm ▸ hBase) + have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) + (fun before => prior.ordinal.1 cutoff hc t before) + have oldTime : t ∈ base ∨ t = base := by + rcases bound with equal | before + · exact equal.symm ▸ oldCutoff + · apply Or.inl + rcases oldCutoff with member | equal + · exact prior.ordinal.2 base hBase cutoff member t before + · exact equal ▸ before + have oldSource {s : ZFSet.{u}} (before : s ∈ t) : s ∈ base ∨ s = base := by + apply Or.inl + rcases oldTime with member | equal + · exact prior.ordinal.2 base hBase t member s before + · exact equal ▸ before + have code := (prior.layer_code cutoff hc t ht bound _ (prior.layerWitness_entry hc ht bound)).congr_source_entries + (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 0 (oldSource hs) y) + (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 1 (oldSource hs) y) + (fun s hs y => state.prefixOldField_entries data births heights prior fields hBase values 2 (oldSource hs) y) + refine ⟨prior.layerWitness cutoff t, prior.layerWitness_ground cutoff t, ?_, + (prior.layerWitness_rank_lt_code hc ht bound).trans priorRank⟩ + rw [state.prefixOldField_value data births heights prior fields values 0 oldCutoff, + state.prefixOldField_value data births heights prior fields values 1 oldCutoff, + state.prefixOldField_value data births heights prior fields values 2 oldCutoff, + state.prefixOldField_value data births heights prior fields values 3 oldCutoff] + exact code + +end PartitionPilot.Forcing.GroundCompressionState + + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundSerializedChronology M T0 C Q qlt) +variable (fields : GroundChronologyFields M (insert births.limit births.limit)) + +theorem prefix_rankedRawWitnesses + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (hBase : base ∈ T0) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (priorRank : ZFSet.rank prior.code < o) + (indices : ZFSet.rank state.data.J < o) (tasks : ZFSet.rank I < o) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) + (initialMeet : state.data.μD = μ0) + (priorSpace : prior.fields.value 0 base = P0) (priorOrder : prior.fields.value 1 base = r0) + (priorMeet : prior.fields.value 2 base = μ0) (priorBirth : prior.fields.value 3 base = old) + (values : ∀ j s, s ∈ insert births.limit births.limit → + fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) : + ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, + t = cutoff ∨ t ∈ cutoff → ∃ z ∈ M.sets, + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) + (fields.value 3 cutoff) t ZFSet.omega z ∧ ZFSet.rank z < o := by + have templates : ZFSet.rank P0 < o := by + rw [← priorSpace] + exact (prior.fieldValue_rank_lt_code 0 hBase).trans priorRank + have points : ZFSet.rank state.data.D < o := initialDomain.symm ▸ templates + have time : ZFSet.rank base < o := + ((ZFSet.rank_lt_of_mem hBase).trans_le prior.time_rank_le_code).trans priorRank + have baseIn : base ∈ insert births.limit births.limit := + ZFSet.mem_insert_of_mem _ births.times.base_mem_limit + have atBase := fun j => state.prefixOldField_value data births heights prior fields values j + (Or.inr rfl : base ∈ base ∨ base = base) + have source : ZFSet.pair base P0 ∈ fields.graph 0 ∧ ZFSet.pair base r0 ∈ fields.graph 1 ∧ + ZFSet.pair base μ0 ∈ fields.graph 2 := by + have first := fields.value_entry 0 baseIn + have second := fields.value_entry 1 baseIn + have third := fields.value_entry 2 baseIn + rw [atBase 0, priorSpace] at first + rw [atBase 1, priorOrder] at second + rw [atBase 2, priorMeet] at third + exact ⟨first, second, third⟩ + have oldWitness (t : ZFSet.{u}) (before : t ∈ base ∨ t = base) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + state.data.D state.data.rD state.data.μD old t ZFSet.omega z ∧ ZFSet.rank z < o := by + obtain ⟨z, hz, code, rank⟩ := state.exists_prefixOldRankedWitness data births heights prior fields hBase values priorRank + (Or.inr rfl : base ∈ base ∨ base = base) before.symm + rw [atBase 0, atBase 1, atBase 2, atBase 3, priorSpace, priorOrder, priorMeet, priorBirth] at code + exact ⟨z, hz, initialDomain.symm ▸ initialOrder.symm ▸ initialMeet.symm ▸ code, rank⟩ + have incoming (n : Nat) := state.exists_canonicalIncomingRankedWitness data births + pairing unions powers separation hI hSources hReps hG hT constant + (fields.graphFunction 0) (fields.graphFunction 1) (fields.graphFunction 2) source limit points indices templates tasks time n (N := ZFSet.omega) + have atStamp (n : Nat) : + fields.value 0 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ + fields.value 1 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ + fields.value 2 (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ + fields.value 3 (compressionStamp base n) = graphRestriction + (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth := by + have hs := ZFSet.mem_insert_of_mem births.limit (births.times.stamp_mem_limit n) + have exactFields := state.prefixFields_stamp data births heights prior.toHistory n + exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, + (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ + have atLimit : fields.value 0 births.limit = data.fields 0 ∧ + fields.value 1 births.limit = data.fields 1 ∧ fields.value 2 births.limit = data.fields 2 ∧ + fields.value 3 births.limit = births.birth := by + have hs := ZFSet.mem_insert births.limit births.limit + have exactFields := state.prefixFields_limit data births heights prior.toHistory + exact ⟨(values 0 _ hs).trans exactFields.1, (values 1 _ hs).trans exactFields.2.1, + (values 2 _ hs).trans exactFields.2.2.1, (values 3 _ hs).trans exactFields.2.2.2.1⟩ + have finite (n : Nat) (t : ZFSet.{u}) (bound : t = compressionStamp base n ∨ t ∈ compressionStamp base n) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 (compressionStamp base n)) (fields.value 1 (compressionStamp base n)) + (fields.value 2 (compressionStamp base n)) (fields.value 3 (compressionStamp base n)) t ZFSet.omega z ∧ ZFSet.rank z < o := by + rw [(atStamp n).1, (atStamp n).2.1, (atStamp n).2.2.1, (atStamp n).2.2.2] + have cases : (t ∈ base ∨ t = base) ∨ ∃ j, j ≤ n ∧ t = compressionStamp base j := by + rcases bound with equal | before + · exact Or.inr ⟨n, Nat.le_refl n, equal⟩ + · rcases (mem_compressionStamp_iff base t n).1 before with old | same | ⟨j, earlier, equal⟩ + · exact Or.inl (Or.inl old) + · exact Or.inl (Or.inr same) + · exact Or.inr ⟨j, Nat.le_of_lt earlier, equal⟩ + rcases cases with before | ⟨j, before, rfl⟩ + · obtain ⟨z, hz, code, rank⟩ := oldWitness t before + exact state.exists_priorWitness_to_finite_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit + (n + 1) before hz rank code + · obtain ⟨z, hz, rank, code⟩ := incoming j + exact state.exists_birthWitness_to_finite_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit + (j + 1) (n + 1) (Nat.add_le_add_right before 1) + ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz rank code + have terminal (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 births.limit) (fields.value 1 births.limit) + (fields.value 2 births.limit) (fields.value 3 births.limit) t ZFSet.omega z ∧ ZFSet.rank z < o := by + rw [atLimit.1, atLimit.2.1, atLimit.2.2.1, atLimit.2.2.2] + rcases bound with rfl | before + · exact state.exists_limitWitness_rank_lt data births pairing limit + · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨j, rfl⟩ + · obtain ⟨z, hz, code, rank⟩ := oldWitness t (Or.inl old) + exact state.exists_priorWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit + (Or.inl old) hz rank code + · obtain ⟨z, hz, code, rank⟩ := oldWitness t (Or.inr same) + exact state.exists_priorWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit + (Or.inr same) hz rank code + · obtain ⟨z, hz, rank, code⟩ := incoming j + exact state.exists_birthWitness_to_union_rank_lt data births pairing unions powers separation hI hSources hReps hG hT limit + (j + 1) ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) hz rank code + intro cutoff hc t _ bound + rcases ZFSet.mem_insert_iff.1 hc with rfl | before + · exact terminal t bound + · rcases (births.times.mem_limit_iff cutoff).1 before with oldTime | same | ⟨n, rfl⟩ + · exact state.exists_prefixOldRankedWitness data births heights prior fields hBase values priorRank (Or.inl oldTime) bound + · exact state.exists_prefixOldRankedWitness data births heights prior fields hBase values priorRank (Or.inr same) bound + · exact finite n t bound + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionOrigin +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters C Q qlt original Targets Separators base old T0 : ZFSet.{u}} +variable {history : GroundChronologicalHistory M T0 C Q qlt} +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) +variable (compression : GroundChronologicalCompression M initial I Sources Reps G m one T τ + P0 C Q qlt original Targets Separators Filters base old T0 history) +variable (prior : GroundSerializedChronology M T0 C Q qlt) + +include origin in +theorem exists_rankedRawCompressionFields + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hBase : base ∈ T0) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (priorRank : ZFSet.rank prior.code < o) + (indices : ZFSet.rank initial.J < o) (tasks : ZFSet.rank I < o) + (constant : RecursiveTemplateConstancy P0 r0 μ0 initial) + (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) (initialMeet : initial.μD = μ0) + (priorSpace : history.space base = P0) (priorOrder : history.order base = r0) + (priorMeet : history.meetGraph base = μ0) (priorBirth : history.birth base = old) + (agreement : ∀ j s, s ∈ T0 → prior.fields.value j s = history.fieldValue j s) : + ∃ fields : GroundChronologyFields M + (insert compression.born.births.limit compression.born.births.limit), + fields.code ∈ M.sets ∧ + ChronologyCoreCode (insert compression.born.births.limit compression.born.births.limit) + fields.bound C Q qlt fields.graph ∧ + (∀ j s, s ∈ insert compression.born.births.limit compression.born.births.limit → + fields.value j s = compression.history.fieldValue j s) ∧ + (∀ s ∈ insert compression.born.births.limit compression.born.births.limit, + ∀ t ∈ insert compression.born.births.limit compression.born.births.limit, + t = s ∨ t ∈ s → ∃ z ∈ M.sets, ZFSet.rank z < o ∧ + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + let data := compression.born.profiled.heighted.completion.algebra.union + let births := compression.born.births + let heights := compression.born.profiled.heighted.heights + obtain ⟨fields, ground, core, values⟩ := state.exists_groundPrefixFields data births heights + prior.fields prior.toHistory pairing unions powers separation collection infinite + hI hSources hReps hG hT prior.ordinal hBase + (fun j _ _ => Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j) + have ranked := state.prefix_rankedRawWitnesses data births heights prior fields + pairing unions powers separation hI hSources hReps hG hT hBase limit priorRank indices tasks + constant initialDomain initialOrder initialMeet + ((agreement 0 base hBase).trans priorSpace) ((agreement 1 base hBase).trans priorOrder) + ((agreement 2 base hBase).trans priorMeet) ((agreement 3 base hBase).trans priorBirth) values + refine ⟨fields, ground, core, ?_, ?_⟩ + · intro j s hs + rw [values j s hs] + have oldValue (a : ZFSet.{u}) (before : a ∈ base ∨ a = base) : + (state.prefixFields data births heights prior.toHistory).fieldValue j a = + compression.history.fieldValue j a := by + have ha : a ∈ T0 := before.elim (fun h => prior.ordinal.1 base hBase a h) (fun h => h.symm ▸ hBase) + have left := state.prefixFields_old data births heights prior.toHistory before + have right := compression.old_values a before + have eLeft : (state.prefixFields data births heights prior.toHistory).fieldValue j a = + prior.fields.value j a := + Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 + (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j + have eRight : compression.history.fieldValue j a = history.fieldValue j a := + Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 + (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j + exact eLeft.trans ((agreement j a ha).trans eRight.symm) + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · have left := state.prefixFields_limit data births heights prior.toHistory + have right := compression.limit_values + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + · rcases (births.times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ + · exact oldValue s (Or.inl before) + · exact oldValue s (Or.inr equal) + · have left := state.prefixFields_stamp data births heights prior.toHistory n + have right := compression.stamp_values n + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + + · intro s hs t ht earlier + obtain ⟨z, hz, code, rank⟩ := ranked s hs t ht earlier + exact ⟨z, hz, rank, code⟩ + +end PartitionPilot.Forcing.GroundCompressionOrigin + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedFixedTopSerialization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedFixedTopSerialization.lean index 117d125eb799e14d71b56598bb693d043926fb74..16588c20979cbd1d8cc6ac0932206cb1bc7b77bb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedFixedTopSerialization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRankedFixedTopSerialization.lean @@ -1,178 +1,178 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRankedSerializedChronology - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem terminalChronologyGraph_rank_lt {s f v : ZFSet.{u}} {o : Ordinal.{u}} - (limit : Order.IsSuccLimit o) (time : ZFSet.rank s < o) (graph : ZFSet.rank f < o) - (value : ZFSet.rank v < o) : ZFSet.rank (terminalChronologyGraph s f v) < o := by - rw [terminalChronologyGraph, ZFSet.rank_insert] - exact max_lt (limit.succ_lt (rank_orderedPair_lt limit time value)) - ((ZFSet.rank_mono (graphRestriction_subset s f)).trans_lt graph) - -namespace GroundSerializedChronology -variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M (insert s s) C D rD) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank serial.code < o) -variable {newHeight : ZFSet.{u}} (height : ZFSet.rank newHeight < o) -include limit rank height - -theorem fixedTopValues_rank_lt : ∀ j, ZFSet.rank (serial.fixedTopValues newHeight j) < o := by - have value := fun j => (serial.fieldValue_rank_lt_code j (ZFSet.mem_insert s s)).trans rank - have time := (ZFSet.rank_lt_of_mem (ZFSet.mem_insert s s)).trans_le serial.time_rank_le_code - have points : ZFSet.rank (fixedTopCarrier (serial.fields.value 0 s)) < o := by - rw [fixedTopCarrier, ZFSet.rank_insert] - exact max_lt (limit.succ_lt (value 0)) (value 0) - have meet := fixedTopMeet_code (serial.fields.decoded_point serial.core (ZFSet.mem_insert s s)).meet - have pp := rank_product_lt limit points points - have order := (ZFSet.rank_mono meet.order.relation).trans_lt pp - have operation := rank_functionGraph_lt limit meet.operation pp points - have birth : ZFSet.rank (fixedTopBirth (serial.fields.value 0 s) (serial.fields.value 3 s) s) < o := by - rw [fixedTopBirth, ZFSet.rank_insert] - exact max_lt (limit.succ_lt (rank_orderedPair_lt limit (value 0) (time.trans rank))) (value 3) - exact Fin.cases points (Fin.cases order (Fin.cases operation (Fin.cases birth (fun _ => height)))) - -theorem fixedTopFields_graph_rank_lt - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hHeight : newHeight ∈ M.sets) (j : Fin 5) : - ZFSet.rank ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph j) < o := - terminalChronologyGraph_rank_lt limit - (((ZFSet.rank_lt_of_mem (ZFSet.mem_insert s s)).trans_le serial.time_rank_le_code).trans rank) - ((serial.fieldGraph_rank_le_code j).trans_lt rank) - (serial.fixedTopValues_rank_lt limit rank height j) - -end GroundSerializedChronology - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundSerializedChronology -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M (insert s s) C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) -variable (ordinal : ordinalSetProperty s) -variable (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank serial.code < o) -include pairing unions powers separation hHeight ordinal earlier limit rank - -theorem fixedTopFields_rankedRawWitnesses : - let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight - ∀ cutoff ∈ insert s s, ∀ t ∈ insert s s, t = cutoff ∨ t ∈ cutoff → - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) - (fields.value 3 cutoff) t ZFSet.omega z := by - dsimp only - let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight - have inside {t a : ZFSet.{u}} (ht : t ∈ insert s s) (ha : a ∈ t) : a ∈ s := by - rcases ZFSet.mem_insert_iff.1 ht with equal | ht - · exact equal ▸ ha - · exact ordinal.1 t ht a ha - have transportSources {t A r μ birth z : ZFSet.{u}} (ht : t ∈ insert s s) - (code : GrowthLayerWitnessCode (serial.fields.graph 0) (serial.fields.graph 1) (serial.fields.graph 2) - A r μ birth t ZFSet.omega z) : - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - A r μ birth t ZFSet.omega z := by - exact code.congr_source_entries - (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 0 - (y := y) (inside ht ha)).symm) - (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 1 - (y := y) (inside ht ha)).symm) - (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 2 - (y := y) (inside ht ha)).symm) - intro cutoff hc t ht before - change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) (fields.value 3 cutoff) t ZFSet.omega z - by_cases terminal : cutoff = s - · subst cutoff - change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 s) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 s) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 s) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 s) t ZFSet.omega z - rw [fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at] - by_cases top : t = s - · subst t - exact ⟨fixedTopLayerWitness (serial.fields.value 0 s), - M.fixedTopLayerWitness_mem pairing (serial.fields.value_ground 0 s), - fixedTopLayerWitness_rank_lt limit ((serial.fieldValue_rank_lt_code 0 (ZFSet.mem_insert s s)).trans rank), - fixedTopLayerWitness_code earlier⟩ - · have strict : t ∈ s := before.resolve_left top - have prior := serial.layer_code s (ZFSet.mem_insert s s) t ht (Or.inr strict) - _ (serial.layerWitness_entry (ZFSet.mem_insert s s) ht (Or.inr strict)) - have point := serial.fields.decoded_point serial.core (ZFSet.mem_insert s s) - obtain ⟨z, hz, code, rankZ⟩ := prior.exists_fixedTop_earlier_rank_lt pairing unions separation - (serial.fields.value_ground 0 s) (serial.layerWitness_ground s t) limit - ((serial.layerWitness_rank_lt_code (ZFSet.mem_insert s s) ht (Or.inr strict)).trans rank) - point.meet point.birth_function strict - exact ⟨z, hz, rankZ, transportSources ht code⟩ - · have old : cutoff ∈ s := (ZFSet.mem_insert_iff.1 hc).resolve_left terminal - have code := transportSources ht (serial.layer_code cutoff hc t ht before - _ (serial.layerWitness_entry hc ht before)) - refine ⟨serial.layerWitness cutoff t, serial.layerWitness_ground cutoff t, - (serial.layerWitness_rank_lt_code hc ht before).trans rank, ?_⟩ - change GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 cutoff) t ZFSet.omega _ - rw [fixedTopFields_value_old _ _ _ _ _ _ _ 0 old, - fixedTopFields_value_old _ _ _ _ _ _ _ 1 old, - fixedTopFields_value_old _ _ _ _ _ _ _ 2 old, - fixedTopFields_value_old _ _ _ _ _ _ _ 3 old] - exact code - -end PartitionPilot.Forcing.GroundSerializedChronology - -namespace PartitionPilot.Forcing.GroundSerializedChronology -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {s C D rD K : ZFSet.{u}} -variable (serial : GroundSerializedChronology M (insert s s) C D rD) - -theorem exists_rankedFixedTopSerialization - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (time : insert s s ∈ K) (level : GroundMainCandidateLevel M K) - (rank : ZFSet.rank serial.code < ZFSet.rank K) - (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) - (heightRank : ZFSet.rank newHeight < ZFSet.rank K) - (ordinal : ordinalSetProperty s) - (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) - (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D - (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : - ∃ extended : GroundSerializedChronology M (insert s s) C D rD, - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validChronologies C D rD ∧ - extended.fields.graph = (serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph ∧ - ∀ j t, t ∈ insert s s → extended.fields.value j t = - appendHistoryValue s (serial.fields.value j) (serial.fixedTopValues newHeight j) t := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - obtain ⟨extended, ground, rankExtended, member, graphs, values, _⟩ := - (serial.fixedTopFields pairing unions powers separation newHeight hHeight).exists_rankedSerialization - pairing unions powers separation collection infinite choice hK conditions time level - (ordinalSetProperty_succ ordinal) - (serial.fixedTopFields_core pairing unions powers separation newHeight hHeight earlier heightCode) - (serial.fixedTopFields_graph_rank_lt limit rank heightRank pairing unions powers separation hHeight) - (serial.fixedTopFields_rankedRawWitnesses pairing unions powers separation - newHeight hHeight ordinal earlier limit rank) - refine ⟨extended, ground, rankExtended, member, graphs, ?_⟩ - intro j t ht - rw [values j t] - exact serial.fixedTopFields_value pairing unions powers separation newHeight hHeight j ht - -end PartitionPilot.Forcing.GroundSerializedChronology - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRankedSerializedChronology + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem terminalChronologyGraph_rank_lt {s f v : ZFSet.{u}} {o : Ordinal.{u}} + (limit : Order.IsSuccLimit o) (time : ZFSet.rank s < o) (graph : ZFSet.rank f < o) + (value : ZFSet.rank v < o) : ZFSet.rank (terminalChronologyGraph s f v) < o := by + rw [terminalChronologyGraph, ZFSet.rank_insert] + exact max_lt (limit.succ_lt (rank_orderedPair_lt limit time value)) + ((ZFSet.rank_mono (graphRestriction_subset s f)).trans_lt graph) + +namespace GroundSerializedChronology +variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M (insert s s) C D rD) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank serial.code < o) +variable {newHeight : ZFSet.{u}} (height : ZFSet.rank newHeight < o) +include limit rank height + +theorem fixedTopValues_rank_lt : ∀ j, ZFSet.rank (serial.fixedTopValues newHeight j) < o := by + have value := fun j => (serial.fieldValue_rank_lt_code j (ZFSet.mem_insert s s)).trans rank + have time := (ZFSet.rank_lt_of_mem (ZFSet.mem_insert s s)).trans_le serial.time_rank_le_code + have points : ZFSet.rank (fixedTopCarrier (serial.fields.value 0 s)) < o := by + rw [fixedTopCarrier, ZFSet.rank_insert] + exact max_lt (limit.succ_lt (value 0)) (value 0) + have meet := fixedTopMeet_code (serial.fields.decoded_point serial.core (ZFSet.mem_insert s s)).meet + have pp := rank_product_lt limit points points + have order := (ZFSet.rank_mono meet.order.relation).trans_lt pp + have operation := rank_functionGraph_lt limit meet.operation pp points + have birth : ZFSet.rank (fixedTopBirth (serial.fields.value 0 s) (serial.fields.value 3 s) s) < o := by + rw [fixedTopBirth, ZFSet.rank_insert] + exact max_lt (limit.succ_lt (rank_orderedPair_lt limit (value 0) (time.trans rank))) (value 3) + exact Fin.cases points (Fin.cases order (Fin.cases operation (Fin.cases birth (fun _ => height)))) + +theorem fixedTopFields_graph_rank_lt + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hHeight : newHeight ∈ M.sets) (j : Fin 5) : + ZFSet.rank ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph j) < o := + terminalChronologyGraph_rank_lt limit + (((ZFSet.rank_lt_of_mem (ZFSet.mem_insert s s)).trans_le serial.time_rank_le_code).trans rank) + ((serial.fieldGraph_rank_le_code j).trans_lt rank) + (serial.fixedTopValues_rank_lt limit rank height j) + +end GroundSerializedChronology + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundSerializedChronology +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M (insert s s) C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) +variable (ordinal : ordinalSetProperty s) +variable (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank serial.code < o) +include pairing unions powers separation hHeight ordinal earlier limit rank + +theorem fixedTopFields_rankedRawWitnesses : + let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight + ∀ cutoff ∈ insert s s, ∀ t ∈ insert s s, t = cutoff ∨ t ∈ cutoff → + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) + (fields.value 3 cutoff) t ZFSet.omega z := by + dsimp only + let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight + have inside {t a : ZFSet.{u}} (ht : t ∈ insert s s) (ha : a ∈ t) : a ∈ s := by + rcases ZFSet.mem_insert_iff.1 ht with equal | ht + · exact equal ▸ ha + · exact ordinal.1 t ht a ha + have transportSources {t A r μ birth z : ZFSet.{u}} (ht : t ∈ insert s s) + (code : GrowthLayerWitnessCode (serial.fields.graph 0) (serial.fields.graph 1) (serial.fields.graph 2) + A r μ birth t ZFSet.omega z) : + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + A r μ birth t ZFSet.omega z := by + exact code.congr_source_entries + (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 0 + (y := y) (inside ht ha)).symm) + (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 1 + (y := y) (inside ht ha)).symm) + (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 2 + (y := y) (inside ht ha)).symm) + intro cutoff hc t ht before + change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) (fields.value 3 cutoff) t ZFSet.omega z + by_cases terminal : cutoff = s + · subst cutoff + change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 s) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 s) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 s) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 s) t ZFSet.omega z + rw [fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at] + by_cases top : t = s + · subst t + exact ⟨fixedTopLayerWitness (serial.fields.value 0 s), + M.fixedTopLayerWitness_mem pairing (serial.fields.value_ground 0 s), + fixedTopLayerWitness_rank_lt limit ((serial.fieldValue_rank_lt_code 0 (ZFSet.mem_insert s s)).trans rank), + fixedTopLayerWitness_code earlier⟩ + · have strict : t ∈ s := before.resolve_left top + have prior := serial.layer_code s (ZFSet.mem_insert s s) t ht (Or.inr strict) + _ (serial.layerWitness_entry (ZFSet.mem_insert s s) ht (Or.inr strict)) + have point := serial.fields.decoded_point serial.core (ZFSet.mem_insert s s) + obtain ⟨z, hz, code, rankZ⟩ := prior.exists_fixedTop_earlier_rank_lt pairing unions separation + (serial.fields.value_ground 0 s) (serial.layerWitness_ground s t) limit + ((serial.layerWitness_rank_lt_code (ZFSet.mem_insert s s) ht (Or.inr strict)).trans rank) + point.meet point.birth_function strict + exact ⟨z, hz, rankZ, transportSources ht code⟩ + · have old : cutoff ∈ s := (ZFSet.mem_insert_iff.1 hc).resolve_left terminal + have code := transportSources ht (serial.layer_code cutoff hc t ht before + _ (serial.layerWitness_entry hc ht before)) + refine ⟨serial.layerWitness cutoff t, serial.layerWitness_ground cutoff t, + (serial.layerWitness_rank_lt_code hc ht before).trans rank, ?_⟩ + change GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 cutoff) t ZFSet.omega _ + rw [fixedTopFields_value_old _ _ _ _ _ _ _ 0 old, + fixedTopFields_value_old _ _ _ _ _ _ _ 1 old, + fixedTopFields_value_old _ _ _ _ _ _ _ 2 old, + fixedTopFields_value_old _ _ _ _ _ _ _ 3 old] + exact code + +end PartitionPilot.Forcing.GroundSerializedChronology + +namespace PartitionPilot.Forcing.GroundSerializedChronology +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {s C D rD K : ZFSet.{u}} +variable (serial : GroundSerializedChronology M (insert s s) C D rD) + +theorem exists_rankedFixedTopSerialization + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (time : insert s s ∈ K) (level : GroundMainCandidateLevel M K) + (rank : ZFSet.rank serial.code < ZFSet.rank K) + (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) + (heightRank : ZFSet.rank newHeight < ZFSet.rank K) + (ordinal : ordinalSetProperty s) + (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) + (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D + (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : + ∃ extended : GroundSerializedChronology M (insert s s) C D rD, + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validChronologies C D rD ∧ + extended.fields.graph = (serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph ∧ + ∀ j t, t ∈ insert s s → extended.fields.value j t = + appendHistoryValue s (serial.fields.value j) (serial.fixedTopValues newHeight j) t := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + obtain ⟨extended, ground, rankExtended, member, graphs, values, _⟩ := + (serial.fixedTopFields pairing unions powers separation newHeight hHeight).exists_rankedSerialization + pairing unions powers separation collection infinite choice hK conditions time level + (ordinalSetProperty_succ ordinal) + (serial.fixedTopFields_core pairing unions powers separation newHeight hHeight earlier heightCode) + (serial.fixedTopFields_graph_rank_lt limit rank heightRank pairing unions powers separation hHeight) + (serial.fixedTopFields_rankedRawWitnesses pairing unions powers separation + newHeight hHeight ordinal earlier limit rank) + refine ⟨extended, ground, rankExtended, member, graphs, ?_⟩ + intro j t ht + rw [values j t] + exact serial.fixedTopFields_value pairing unions powers separation newHeight hHeight j ht + +end PartitionPilot.Forcing.GroundSerializedChronology + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawNiceNameGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawNiceNameGraphs.lean index fd50cf78aa2e823631f48edb79110562b8c77684..0364bedab9b7b206685f32681c6a206d614fdd5e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawNiceNameGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawNiceNameGraphs.lean @@ -1,120 +1,120 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def rawNiceNameCandidates (i T P G basis maps : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => Realize M.sets nameSupportFormula - (extend z (extend i (extend P (extend G (extend basis (extend maps Fin.elim0))))))) - (M.groundRelations T P) - -noncomputable def rawNiceNameCandidateGraph (nodes T P G basis maps : ZFSet.{u}) : ZFSet.{u} := - familyCodeGraph (fun i : nodes => i.val) - (fun i => M.rawNiceNameCandidates i.val T P G basis maps) - -noncomputable def rawNiceVisibilityGraph (nodes T P G basis maps top : ZFSet.{u}) : ZFSet.{u} := - familyCodeGraph (fun i : nodes => i.val) - (fun i => ZFSet.prod (M.rawNiceNameCandidates i.val T P G basis maps) {top}) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_rawNiceNameCandidates : - GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => - M.rawNiceNameCandidates (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by - let v := GroundSetTerm.var M (n := 6) - let bound := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 1, v 2] - let term := GroundSetTerm.app (M.definable_separation separation nameSupportFormula) - ![bound, v 0, v 2, v 3, v 4, v 5] - refine term.definition.congr ?_ - intro env - apply congrArg (fun params : Fin 5 → ZFSet.{u} => - ZFSet.sep (fun z => Realize M.sets nameSupportFormula (extend z params)) - (M.groundRelations (env 1) (env 2))) - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun k => Fin.elim0 k))))) j - -variable (collection : CollectionSchema M.sets) - -noncomputable def definable_rawNiceNameCandidateGraph : - GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => - M.rawNiceNameCandidateGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := - (M.definable_rawNiceNameCandidates pairing unions powers separation).definable_graph - pairing separation collection - -noncomputable def definable_rawNiceVisibilityGraph : - GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => - M.rawNiceVisibilityGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) := by - let v := GroundSetTerm.var M (n := 7) - let chosen := GroundSetTerm.app (M.definable_rawNiceNameCandidates pairing unions powers separation) - ![v 0, v 1, v 2, v 3, v 4, v 5] - let name := GroundSetTerm.app (M.definable_familySetCode pairing unions powers separation) ![chosen, v 6] - exact name.definition.definable_graph pairing separation collection - -variable {I H Q : Type u} [Group H] [PartialOrder Q] -variable (a : PosetAction H Q) (s : Presentation Q) (t : Presentation H) (b : Presentation I) -variable (K : I → Subgroup H) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (valid : ∀ z ∈ T, IsName s z) -include pairing unions powers separation collection carrier group supports maps valid - -theorem rawNiceNameCandidates_eq (i : I) (hi : b.encode i ∈ M.sets) : - M.rawNiceNameCandidates (b.encode i) T s.carrier t.carrier (supportBasisCode b t K) - (a.conditionMapFamily s t) = M.niceNameCandidates a s T (K i) := - (M.niceNameCandidates_eq_selection a s t b K pairing unions powers separation collection - carrier group supports maps valid i hi).symm - -theorem rawNiceNameCandidateGraph_eq (nodes : b.carrier ∈ M.sets) : - M.rawNiceNameCandidateGraph b.carrier T s.carrier t.carrier (supportBasisCode b t K) - (a.conditionMapFamily s t) = M.niceNameCandidateGraph a s b T K := by - apply ZFSet.ext - intro z - rw [rawNiceNameCandidateGraph, mem_familyCodeGraph, M.mem_niceNameCandidateGraph] - constructor - · rintro ⟨i, equal⟩ - obtain ⟨j, eq⟩ := (b.mem_carrier i.val).1 i.property - refine ⟨j, ?_⟩ - rw [← eq, M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K - carrier group supports maps valid j (M.transitive nodes (b.encode_mem j))] at equal - exact equal.symm - · rintro ⟨i, equal⟩ - refine ⟨⟨b.encode i, b.encode_mem i⟩, ?_⟩ - change ZFSet.pair (b.encode i) (M.rawNiceNameCandidates _ _ _ _ _ _) = z - rw [M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K - carrier group supports maps valid i (M.transitive nodes (b.encode_mem i))] - exact equal.symm - -theorem rawNiceVisibilityGraph_eq [OrderTop Q] (nodes : b.carrier ∈ M.sets) : - M.rawNiceVisibilityGraph b.carrier T s.carrier t.carrier (supportBasisCode b t K) - (a.conditionMapFamily s t) (s.encode ⊤) = M.niceVisibilityGraph a s b T K := by - apply ZFSet.ext - intro z - rw [rawNiceVisibilityGraph, mem_familyCodeGraph, M.mem_niceVisibilityGraph] - constructor - · rintro ⟨i, equal⟩ - obtain ⟨j, eq⟩ := (b.mem_carrier i.val).1 i.property - refine ⟨j, ?_⟩ - rw [← eq, M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K - carrier group supports maps valid j (M.transitive nodes (b.encode_mem j))] at equal - rw [M.niceVisibilityName_code] - exact equal.symm - · rintro ⟨i, equal⟩ - refine ⟨⟨b.encode i, b.encode_mem i⟩, ?_⟩ - change ZFSet.pair (b.encode i) (ZFSet.prod (M.rawNiceNameCandidates _ _ _ _ _ _) _) = z - rw [M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K - carrier group supports maps valid i (M.transitive nodes (b.encode_mem i))] - rw [M.niceVisibilityName_code] at equal - exact equal.symm - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def rawNiceNameCandidates (i T P G basis maps : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => Realize M.sets nameSupportFormula + (extend z (extend i (extend P (extend G (extend basis (extend maps Fin.elim0))))))) + (M.groundRelations T P) + +noncomputable def rawNiceNameCandidateGraph (nodes T P G basis maps : ZFSet.{u}) : ZFSet.{u} := + familyCodeGraph (fun i : nodes => i.val) + (fun i => M.rawNiceNameCandidates i.val T P G basis maps) + +noncomputable def rawNiceVisibilityGraph (nodes T P G basis maps top : ZFSet.{u}) : ZFSet.{u} := + familyCodeGraph (fun i : nodes => i.val) + (fun i => ZFSet.prod (M.rawNiceNameCandidates i.val T P G basis maps) {top}) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_rawNiceNameCandidates : + GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => + M.rawNiceNameCandidates (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by + let v := GroundSetTerm.var M (n := 6) + let bound := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 1, v 2] + let term := GroundSetTerm.app (M.definable_separation separation nameSupportFormula) + ![bound, v 0, v 2, v 3, v 4, v 5] + refine term.definition.congr ?_ + intro env + apply congrArg (fun params : Fin 5 → ZFSet.{u} => + ZFSet.sep (fun z => Realize M.sets nameSupportFormula (extend z params)) + (M.groundRelations (env 1) (env 2))) + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun k => Fin.elim0 k))))) j + +variable (collection : CollectionSchema M.sets) + +noncomputable def definable_rawNiceNameCandidateGraph : + GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => + M.rawNiceNameCandidateGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := + (M.definable_rawNiceNameCandidates pairing unions powers separation).definable_graph + pairing separation collection + +noncomputable def definable_rawNiceVisibilityGraph : + GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => + M.rawNiceVisibilityGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) := by + let v := GroundSetTerm.var M (n := 7) + let chosen := GroundSetTerm.app (M.definable_rawNiceNameCandidates pairing unions powers separation) + ![v 0, v 1, v 2, v 3, v 4, v 5] + let name := GroundSetTerm.app (M.definable_familySetCode pairing unions powers separation) ![chosen, v 6] + exact name.definition.definable_graph pairing separation collection + +variable {I H Q : Type u} [Group H] [PartialOrder Q] +variable (a : PosetAction H Q) (s : Presentation Q) (t : Presentation H) (b : Presentation I) +variable (K : I → Subgroup H) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (valid : ∀ z ∈ T, IsName s z) +include pairing unions powers separation collection carrier group supports maps valid + +theorem rawNiceNameCandidates_eq (i : I) (hi : b.encode i ∈ M.sets) : + M.rawNiceNameCandidates (b.encode i) T s.carrier t.carrier (supportBasisCode b t K) + (a.conditionMapFamily s t) = M.niceNameCandidates a s T (K i) := + (M.niceNameCandidates_eq_selection a s t b K pairing unions powers separation collection + carrier group supports maps valid i hi).symm + +theorem rawNiceNameCandidateGraph_eq (nodes : b.carrier ∈ M.sets) : + M.rawNiceNameCandidateGraph b.carrier T s.carrier t.carrier (supportBasisCode b t K) + (a.conditionMapFamily s t) = M.niceNameCandidateGraph a s b T K := by + apply ZFSet.ext + intro z + rw [rawNiceNameCandidateGraph, mem_familyCodeGraph, M.mem_niceNameCandidateGraph] + constructor + · rintro ⟨i, equal⟩ + obtain ⟨j, eq⟩ := (b.mem_carrier i.val).1 i.property + refine ⟨j, ?_⟩ + rw [← eq, M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K + carrier group supports maps valid j (M.transitive nodes (b.encode_mem j))] at equal + exact equal.symm + · rintro ⟨i, equal⟩ + refine ⟨⟨b.encode i, b.encode_mem i⟩, ?_⟩ + change ZFSet.pair (b.encode i) (M.rawNiceNameCandidates _ _ _ _ _ _) = z + rw [M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K + carrier group supports maps valid i (M.transitive nodes (b.encode_mem i))] + exact equal.symm + +theorem rawNiceVisibilityGraph_eq [OrderTop Q] (nodes : b.carrier ∈ M.sets) : + M.rawNiceVisibilityGraph b.carrier T s.carrier t.carrier (supportBasisCode b t K) + (a.conditionMapFamily s t) (s.encode ⊤) = M.niceVisibilityGraph a s b T K := by + apply ZFSet.ext + intro z + rw [rawNiceVisibilityGraph, mem_familyCodeGraph, M.mem_niceVisibilityGraph] + constructor + · rintro ⟨i, equal⟩ + obtain ⟨j, eq⟩ := (b.mem_carrier i.val).1 i.property + refine ⟨j, ?_⟩ + rw [← eq, M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K + carrier group supports maps valid j (M.transitive nodes (b.encode_mem j))] at equal + rw [M.niceVisibilityName_code] + exact equal.symm + · rintro ⟨i, equal⟩ + refine ⟨⟨b.encode i, b.encode_mem i⟩, ?_⟩ + change ZFSet.pair (b.encode i) (ZFSet.prod (M.rawNiceNameCandidates _ _ _ _ _ _) _) = z + rw [M.rawNiceNameCandidates_eq pairing unions powers separation collection a s t b K + carrier group supports maps valid i (M.transitive nodes (b.encode_mem i))] + rw [M.niceVisibilityName_code] at equal + exact equal.symm + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawPreparedFamilyConditionPersistence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawPreparedFamilyConditionPersistence.lean index cef6094278cf82ec24bec37b269f37a3018cf4fa..407520cefc42d7d27e89c6ba52de1841faf97a8c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawPreparedFamilyConditionPersistence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawPreparedFamilyConditionPersistence.lean @@ -1,115 +1,115 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -include pairing unions powers separation collection carrier order - -theorem preparedCertificateCode_condition_mono - (nodes nodeOrder meet N visibility top omega : ZFSet.{u}) - (graphGround : visibility ∈ M.sets) - (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → IsName s V) - (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) - (z : (M.nameDomain s).names) (F B f e names : ZFSet.{u}) - {p q : P} (qp : q ≤ p) - (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) - nodes nodeOrder meet N visibility top omega z.val.val F B f e names) : - PreparedCertificateCode M s.carrier s.conditionOrder (s.encode q) - nodes nodeOrder meet N visibility top omega z.val.val F B f e names := by - obtain ⟨filter, coinitial, nonempty, enumerated, supported, forced⟩ := code - refine ⟨filter, coinitial, nonempty, enumerated, supported, ?_⟩ - apply M.preparationForcingCode_condition_mono s pairing unions powers separation collection - carrier order nodes N visibility graphGround graphNames namesGround validN z F f _ qp forced - intro entry member - obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (enumerated.1.1 member) - have incidence := (pair_mem_visibilitySupportIncidence nodes N visibility top v tau).1 - (supported v tau member) - exact ZFSet.pair_mem_prod.2 ⟨incidence.1, htau⟩ - -theorem preparedCertificateFamilyCode_condition_mono - (nodes nodeOrder meet N visibility top omega J C E k enumerations : ZFSet.{u}) - (graphGround : visibility ∈ M.sets) - (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → IsName s V) - (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) - (requestsGround : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) - {p q : P} (qp : q ≤ p) - (code : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) - nodes nodeOrder meet N visibility top omega J C E k enumerations) : - PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode q) - nodes nodeOrder meet N visibility top omega J C E k enumerations := by - refine ⟨code.1, code.2.1, ?_⟩ - intro z F B f e names stored enumerated - have member := (ZFSet.pair_mem_prod.1 (code.1.1 stored)).1 - let name : (M.nameDomain s).names := - ⟨⟨z, validJ z member⟩, M.transitive requestsGround member⟩ - exact M.preparedCertificateCode_condition_mono s pairing unions powers separation collection - carrier order nodes nodeOrder meet N visibility top omega graphGround graphNames - namesGround validN name F B f e names qp (code.2.2 z F B f e names stored enumerated) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem preparedCertificateFamilyCode_raw_condition_mono - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (P order nodes nodeOrder meet N visibility top omega J C E k enumerations : ZFSet.{u}) - (orderCode : PartialOrderCode P order) - (carrierGround : P ∈ M.sets) (orderGround : order ∈ M.sets) - (graphGround : visibility ∈ M.sets) - (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → - IsName (SetMembers.presentation P) V) - (namesGround : N ∈ M.sets) - (validN : ∀ tau ∈ N, IsName (SetMembers.presentation P) tau) - (requestsGround : J ∈ M.sets) - (validJ : ∀ z ∈ J, IsName (SetMembers.presentation P) z) - (p q : ZFSet.{u}) (hp : p ∈ P) (hq : q ∈ P) (qp : ZFSet.pair q p ∈ order) - (code : PreparedCertificateFamilyCode M P order p - nodes nodeOrder meet N visibility top omega J C E k enumerations) : - PreparedCertificateFamilyCode M P order q - nodes nodeOrder meet N visibility top omega J C E k enumerations := by - let := orderCode.toPartialOrder - let s := SetMembers.presentation P - have groundOrder : s.conditionOrder ∈ M.sets := M.decoded_order_mem orderCode orderGround - have orderEq : s.conditionOrder = order := orderCode.conditionOrder_eq - have pCode : s.encode (SetMembers.ofMem p hp) = p := SetMembers.raw_ofMem p hp - have qCode : s.encode (SetMembers.ofMem q hq) = q := SetMembers.raw_ofMem q hq - have typedBelow : SetMembers.ofMem q hq ≤ SetMembers.ofMem p hp := by - change ZFSet.pair (SetMembers.raw (SetMembers.ofMem q hq)) - (SetMembers.raw (SetMembers.ofMem p hp)) ∈ order - simpa only [SetMembers.raw_ofMem] using qp - have initial : PreparedCertificateFamilyCode M s.carrier s.conditionOrder - (s.encode (SetMembers.ofMem p hp)) nodes nodeOrder meet N visibility top omega - J C E k enumerations := by - exact (congrArg₂ (fun r c => PreparedCertificateFamilyCode M P r c - nodes nodeOrder meet N visibility top omega J C E k enumerations) orderEq pCode).mpr code - have moved := M.preparedCertificateFamilyCode_condition_mono s pairing unions powers - separation collection carrierGround groundOrder nodes nodeOrder meet N visibility top omega - J C E k enumerations graphGround graphNames namesGround validN requestsGround validJ - typedBelow initial - exact (congrArg₂ (fun r c => PreparedCertificateFamilyCode M P r c - nodes nodeOrder meet N visibility top omega J C E k enumerations) orderEq qCode).mp moved - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +include pairing unions powers separation collection carrier order + +theorem preparedCertificateCode_condition_mono + (nodes nodeOrder meet N visibility top omega : ZFSet.{u}) + (graphGround : visibility ∈ M.sets) + (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → IsName s V) + (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) + (z : (M.nameDomain s).names) (F B f e names : ZFSet.{u}) + {p q : P} (qp : q ≤ p) + (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) + nodes nodeOrder meet N visibility top omega z.val.val F B f e names) : + PreparedCertificateCode M s.carrier s.conditionOrder (s.encode q) + nodes nodeOrder meet N visibility top omega z.val.val F B f e names := by + obtain ⟨filter, coinitial, nonempty, enumerated, supported, forced⟩ := code + refine ⟨filter, coinitial, nonempty, enumerated, supported, ?_⟩ + apply M.preparationForcingCode_condition_mono s pairing unions powers separation collection + carrier order nodes N visibility graphGround graphNames namesGround validN z F f _ qp forced + intro entry member + obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (enumerated.1.1 member) + have incidence := (pair_mem_visibilitySupportIncidence nodes N visibility top v tau).1 + (supported v tau member) + exact ZFSet.pair_mem_prod.2 ⟨incidence.1, htau⟩ + +theorem preparedCertificateFamilyCode_condition_mono + (nodes nodeOrder meet N visibility top omega J C E k enumerations : ZFSet.{u}) + (graphGround : visibility ∈ M.sets) + (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → IsName s V) + (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) + (requestsGround : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) + {p q : P} (qp : q ≤ p) + (code : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) + nodes nodeOrder meet N visibility top omega J C E k enumerations) : + PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode q) + nodes nodeOrder meet N visibility top omega J C E k enumerations := by + refine ⟨code.1, code.2.1, ?_⟩ + intro z F B f e names stored enumerated + have member := (ZFSet.pair_mem_prod.1 (code.1.1 stored)).1 + let name : (M.nameDomain s).names := + ⟨⟨z, validJ z member⟩, M.transitive requestsGround member⟩ + exact M.preparedCertificateCode_condition_mono s pairing unions powers separation collection + carrier order nodes nodeOrder meet N visibility top omega graphGround graphNames + namesGround validN name F B f e names qp (code.2.2 z F B f e names stored enumerated) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem preparedCertificateFamilyCode_raw_condition_mono + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (P order nodes nodeOrder meet N visibility top omega J C E k enumerations : ZFSet.{u}) + (orderCode : PartialOrderCode P order) + (carrierGround : P ∈ M.sets) (orderGround : order ∈ M.sets) + (graphGround : visibility ∈ M.sets) + (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → + IsName (SetMembers.presentation P) V) + (namesGround : N ∈ M.sets) + (validN : ∀ tau ∈ N, IsName (SetMembers.presentation P) tau) + (requestsGround : J ∈ M.sets) + (validJ : ∀ z ∈ J, IsName (SetMembers.presentation P) z) + (p q : ZFSet.{u}) (hp : p ∈ P) (hq : q ∈ P) (qp : ZFSet.pair q p ∈ order) + (code : PreparedCertificateFamilyCode M P order p + nodes nodeOrder meet N visibility top omega J C E k enumerations) : + PreparedCertificateFamilyCode M P order q + nodes nodeOrder meet N visibility top omega J C E k enumerations := by + let := orderCode.toPartialOrder + let s := SetMembers.presentation P + have groundOrder : s.conditionOrder ∈ M.sets := M.decoded_order_mem orderCode orderGround + have orderEq : s.conditionOrder = order := orderCode.conditionOrder_eq + have pCode : s.encode (SetMembers.ofMem p hp) = p := SetMembers.raw_ofMem p hp + have qCode : s.encode (SetMembers.ofMem q hq) = q := SetMembers.raw_ofMem q hq + have typedBelow : SetMembers.ofMem q hq ≤ SetMembers.ofMem p hp := by + change ZFSet.pair (SetMembers.raw (SetMembers.ofMem q hq)) + (SetMembers.raw (SetMembers.ofMem p hp)) ∈ order + simpa only [SetMembers.raw_ofMem] using qp + have initial : PreparedCertificateFamilyCode M s.carrier s.conditionOrder + (s.encode (SetMembers.ofMem p hp)) nodes nodeOrder meet N visibility top omega + J C E k enumerations := by + exact (congrArg₂ (fun r c => PreparedCertificateFamilyCode M P r c + nodes nodeOrder meet N visibility top omega J C E k enumerations) orderEq pCode).mpr code + have moved := M.preparedCertificateFamilyCode_condition_mono s pairing unions powers + separation collection carrierGround groundOrder nodes nodeOrder meet N visibility top omega + J C E k enumerations graphGround graphNames namesGround validN requestsGround validJ + typedBelow initial + exact (congrArg₂ (fun r c => PreparedCertificateFamilyCode M P r c + nodes nodeOrder meet N visibility top omega J C E k enumerations) orderEq qCode).mp moved + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRefinementStageWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRefinementStageWitnesses.lean index 4859a73c809267c82b704a4853fd580d079538a7..22cc260deadcebb3677383a9bdbe934cf9e0a7b5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRefinementStageWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRefinementStageWitnesses.lean @@ -1,674 +1,674 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawStageRefinementTestActions - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def forcingStageCode (P order top action : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 3 ![P, order, top, action] - -theorem forcingStageCode_eq_iff (P order top action P' order' top' action' : ZFSet.{u}) : - forcingStageCode P order top action = forcingStageCode P' order' top' action' ↔ - P = P' ∧ order = order' ∧ top = top' ∧ action = action' := by - simp only [forcingStageCode, nonemptyTupleCode, ZFSet.pair_inj] - rfl - -def ForcingStageValidityCode (G mul identity stage : ZFSet.{u}) : Prop := - ∃ P order top action, stage = forcingStageCode P order top action ∧ - PartialOrderCode P order ∧ top ∈ P ∧ - (∀ p ∈ P, ZFSet.pair p top ∈ order) ∧ PosetActionCode G P mul identity order action - -theorem forcingStageValidityCode_iff (G mul identity P order top action : ZFSet.{u}) : - ForcingStageValidityCode G mul identity (forcingStageCode P order top action) ↔ - PartialOrderCode P order ∧ top ∈ P ∧ - (∀ p ∈ P, ZFSet.pair p top ∈ order) ∧ PosetActionCode G P mul identity order action := by - constructor - · rintro ⟨P', r', t', A', equal, laws⟩ - obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal - exact laws - · intro laws - exact ⟨P, order, top, action, rfl, laws⟩ - -namespace BoundedFormula -open SetFormula - -def forcingStageFormula {n : Nat} (stage G mul identity : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - exPairFields stage (exPairFields 0 (exPairFields 0 - (.conj (partialOrderFormula 5 3) - (.conj (topFormula 5 3 1) (posetActionFormula (lift G) 5 (lift mul) (lift identity) 3 0))))) - -theorem truth_forcingStageFormula {n : Nat} (stage G mul identity : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (forcingStageFormula stage G mul identity) env ↔ - ForcingStageValidityCode (env G) (env mul) (env identity) (env stage) := by - simp only [forcingStageFormula, truth_exPairFields, Truth, truth_partialOrderFormula, - truth_topFormula, truth_posetActionFormula] - change (∃ P tail, env stage = ZFSet.pair P tail ∧ - ∃ order tail', tail = ZFSet.pair order tail' ∧ - ∃ top action, tail' = ZFSet.pair top action ∧ - PartialOrderCode P order ∧ (top ∈ P ∧ ∀ p ∈ P, ZFSet.pair p top ∈ order) ∧ - PosetActionCode (env G) P (env mul) (env identity) order action) ↔ _ - constructor - · rintro ⟨P, tail, equal, order, tail', eqtail, top, action, eqtail', orderLaw, ⟨member, greatest⟩, act⟩ - refine ⟨P, order, top, action, ?_, orderLaw, member, greatest, act⟩ - rw [eqtail, eqtail'] at equal - exact equal - · rintro ⟨P, order, top, action, equal, orderLaw, member, greatest, act⟩ - exact ⟨P, ZFSet.pair order (ZFSet.pair top action), equal, - order, ZFSet.pair top action, rfl, top, action, rfl, orderLaw, ⟨member, greatest⟩, act⟩ - -end BoundedFormula - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem forcingStageCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {P order top action : ZFSet.{u}} - (hP : P ∈ M.sets) (hOrder : order ∈ M.sets) (hTop : top ∈ M.sets) (hAction : action ∈ M.sets) : - forcingStageCode P order top action ∈ M.sets := - M.nonemptyTupleCode_mem pairing 3 _ - (Fin.cases hP (Fin.cases hOrder (Fin.cases hTop (Fin.cases hAction (fun j => Fin.elim0 j))))) - -theorem forcingStageCode_fields {P order top action : ZFSet.{u}} - (ground : forcingStageCode P order top action ∈ M.sets) : - P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets := by - have fields := M.nonemptyTupleCode_field_mem 3 ![P, order, top, action] ground - exact ⟨fields 0, fields 1, fields 2, fields 3⟩ - -theorem realize_forcingStageFormula {n : Nat} (stage G mul identity : Fin n) - (env : Fin n → ZFSet.{u}) (ground : ∀ j, env j ∈ M.sets) : - Realize M.sets (BoundedFormula.forcingStageFormula stage G mul identity).toFormula env ↔ - ForcingStageValidityCode (env G) (env mul) (env identity) (env stage) := - (BoundedFormula.realize_toFormula M _ _ ground).trans - (BoundedFormula.truth_forcingStageFormula stage G mul identity env) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -structure ForcingStageCore (G mul identity : ZFSet.{u}) where - carrier : ZFSet.{u} - order : ZFSet.{u} - top : ZFSet.{u} - actionGraph : ZFSet.{u} - order_code : PartialOrderCode carrier order - top_mem : top ∈ carrier - greatest : ∀ p ∈ carrier, ZFSet.pair p top ∈ order - action_code : PosetActionCode G carrier mul identity order actionGraph - -namespace ForcingStageCore -variable {G mul identity : ZFSet.{u}} (core : ForcingStageCore G mul identity) - -noncomputable def code : ZFSet.{u} := - forcingStageCode core.carrier core.order core.top core.actionGraph - -theorem validity : ForcingStageValidityCode G mul identity core.code := - (forcingStageValidityCode_iff _ _ _ _ _ _ _).2 - ⟨core.order_code, core.top_mem, core.greatest, core.action_code⟩ - -noncomputable def presentation : Presentation (SetMembers core.carrier) := - SetMembers.presentation core.carrier - -@[instance_reducible] noncomputable def partialOrder : PartialOrder (SetMembers core.carrier) := - core.order_code.toPartialOrder - -@[instance_reducible] noncomputable def orderTop : - letI := core.partialOrder - OrderTop (SetMembers core.carrier) := - core.order_code.toOrderTop core.top core.top_mem core.greatest - -noncomputable def action {inverse : ZFSet.{u}} (group : GroupCode G mul inverse identity) : - letI := group.toGroup - letI := core.partialOrder - PosetAction (SetMembers G) (SetMembers core.carrier) := - core.action_code.toPosetAction group core.order_code - -theorem decoded_code {inverse : ZFSet.{u}} (group : GroupCode G mul inverse identity) : - letI := group.toGroup - letI := core.partialOrder - letI := core.orderTop - forcingStageCode core.presentation.carrier core.presentation.conditionOrder - (core.presentation.encode ⊤) - ((core.action group).actionGraph core.presentation (SetMembers.presentation G)) = core.code := by - let := group.toGroup - let := core.partialOrder - let := core.orderTop - change forcingStageCode core.carrier - ((SetMembers.presentation core.carrier).conditionOrder) - (SetMembers.raw (SetMembers.ofMem core.top core.top_mem)) - ((core.action_code.toPosetAction group core.order_code).actionGraph - (SetMembers.presentation core.carrier) (SetMembers.presentation G)) = core.code - rw [core.order_code.conditionOrder_eq, SetMembers.raw_ofMem, - core.action_code.actionGraph_eq group core.order_code] - rfl - -end ForcingStageCore - -theorem exists_forcingStageCore {G mul identity stage : ZFSet.{u}} - (valid : ForcingStageValidityCode G mul identity stage) : - ∃ core : ForcingStageCore G mul identity, core.code = stage := by - obtain ⟨P, order, top, action, equal, orderLaw, member, greatest, act⟩ := valid - exact ⟨⟨P, order, top, action, orderLaw, member, greatest, act⟩, equal.symm⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem forcingStageCore_conditionMapFamily_mem {G mul identity inverse : ZFSet.{u}} - (core : ForcingStageCore G mul identity) (group : GroupCode G mul inverse identity) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hG : G ∈ M.sets) (ground : core.code ∈ M.sets) : - letI := group.toGroup - letI := core.partialOrder - (core.action group).conditionMapFamily core.presentation (SetMembers.presentation G) ∈ M.sets := by - let := group.toGroup - let := core.partialOrder - obtain ⟨hP, _, _, hA⟩ := M.forcingStageCode_fields ground - apply M.conditionMapFamily_mem_of_actionGraph (core.action group) core.presentation - (SetMembers.presentation G) pairing unions powers separation collection hP hG - change (core.action_code.toPosetAction group core.order_code).actionGraph - (SetMembers.presentation core.carrier) (SetMembers.presentation G) ∈ M.sets - rw [core.action_code.actionGraph_eq group core.order_code] - exact hA - -end TransitiveGround - -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.SetRealization.Presentation -open Forcing -universe u -variable {P : Type u} [PartialOrder P] (s : Presentation P) - -theorem conditionOrder_code : PartialOrderCode s.carrier s.conditionOrder := by - refine ⟨(s.product s).subset_carrier _, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - exact (s.pair_mem_conditionOrder x x).2 le_rfl - · intro x hx y hy xy yx - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - exact congrArg s.encode (le_antisymm ((s.pair_mem_conditionOrder x y).1 xy) - ((s.pair_mem_conditionOrder y x).1 yx)) - · intro x hx y hy z hz xy yz - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - exact (s.pair_mem_conditionOrder x z).2 (le_trans - ((s.pair_mem_conditionOrder x y).1 xy) ((s.pair_mem_conditionOrder y z).1 yz)) - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing.PosetAction -open SetRealization -universe u -variable {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem actionGraph_code : PosetActionCode t.carrier s.carrier - ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) - s.conditionOrder (a.actionGraph s t) := by - refine ⟨(t.product s).graph_isFunc s _, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - exact (a.triple_mem_actionGraph s t 1 x x).2 (a.one x) - · intro g hg h hh k hk x hx y hy z hz gh xy yz - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨h, rfl⟩ := (t.mem_carrier h).1 hh - obtain ⟨k, rfl⟩ := (t.mem_carrier k).1 hk - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - have product := ((t.product t).pair_mem_graph t _ (g, h) k).1 gh - have first := (a.triple_mem_actionGraph s t h x y).1 xy - have second := (a.triple_mem_actionGraph s t g y z).1 yz - apply (a.triple_mem_actionGraph s t k x z).2 - rw [← product, a.mul, first, second] - · intro g hg x hx y hy z hz w hw xz yw xy - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - have first := (a.triple_mem_actionGraph s t g x z).1 xz - have second := (a.triple_mem_actionGraph s t g y w).1 yw - apply (s.pair_mem_conditionOrder z w).2 - rw [← first, ← second] - exact (a.iso g).monotone ((s.pair_mem_conditionOrder x y).1 xy) - -noncomputable def forcingStageCore [OrderTop P] : - ForcingStageCore t.carrier ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) where - carrier := s.carrier - order := s.conditionOrder - top := s.encode ⊤ - actionGraph := a.actionGraph s t - order_code := s.conditionOrder_code - top_mem := s.encode_mem ⊤ - greatest := by - intro p hp - obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 hp - exact (s.pair_mem_conditionOrder p ⊤).2 le_top - action_code := a.actionGraph_code s t - -theorem forcingStageCore_code [OrderTop P] : - (a.forcingStageCore s t).code = forcingStageCode s.carrier s.conditionOrder - (s.encode ⊤) (a.actionGraph s t) := rfl - -end PartitionPilot.Forcing.PosetAction - -end - - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {G L : Type u} [Group G] [PartialOrder L] - -def RawRefinementStageWitness (M : TransitiveGround.{u}) - (t : Presentation G) (b : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 level P order top action : ZFSet.{u}) : Prop := - ∃ (orderLaw : PartialOrderCode P order) (topMem : top ∈ P) - (greatest : ∀ p ∈ P, ZFSet.pair p top ∈ order), - letI := orderLaw.toPartialOrder - letI := orderLaw.toOrderTop top topMem greatest - ∃ e : PosetAction G (SetMembers P), - e.actionGraph (SetMembers.presentation P) t = action ∧ - RefinementStageSystem M e (SetMembers.presentation P) t b d base directed level T T2 - -namespace RawRefinementStageWitness -variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} -variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} -variable {T T2 level P order top action : ZFSet.{u}} -variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) -include witness - -theorem action_code : PosetActionCode t.carrier P - ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) order action := by - obtain ⟨orderLaw, topMem, greatest, e, graph, _system⟩ := witness - let := orderLaw.toPartialOrder - let := orderLaw.toOrderTop top topMem greatest - have code := e.actionGraph_code (SetMembers.presentation P) t - rw [orderLaw.conditionOrder_eq, graph] at code - exact code - -theorem action_function : ZFSet.IsFunc (ZFSet.prod t.carrier P) P action := - witness.action_code.function - -end RawRefinementStageWitness - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def ForcingStageRefinementDataCode (M : TransitiveGround.{u}) - (G mul identity nodes nodeOrder basis T T2 level stage output : ZFSet.{u}) : Prop := - ForcingStageValidityCode G mul identity stage ∧ - ∃ P order top action, stage = forcingStageCode P order top action ∧ - output = M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -noncomputable def forcingStageRefinementDataFormula : SetFormula 11 := - let w := prefixIndex 11 4 - let old := suffixIndex 11 4 - .conj (BoundedFormula.forcingStageFormula 1 2 3 4).toFormula - (exBlock 4 (.conj (BoundedFormula.nonemptyTupleFormula 3 (old 1) w).toFormula - (SetFormula.reindex (extend (old 0) - ![w 0, w 1, w 2, w 3, old 2, old 5, old 6, old 7, old 8, old 9, old 10]) - (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).formula))) - -theorem realize_forcingStageRefinementDataFormula (env : Fin 11 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.forcingStageRefinementDataFormula pairing unions powers separation collection) env ↔ - ForcingStageRefinementDataCode M (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) - (env 8) (env 9) (env 10) (env 1) (env 0) := by - change (Realize M.sets (BoundedFormula.forcingStageFormula 1 2 3 4).toFormula env ∧ _) ↔ _ - rw [M.realize_forcingStageFormula 1 2 3 4 env members] - apply and_congr_right - intro _ - rw [realize_exBlock] - have meaning (fields : Fin 4 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : - Realize M.sets (.conj (BoundedFormula.nonemptyTupleFormula 3 (suffixIndex 11 4 1) - (prefixIndex 11 4)).toFormula - (SetFormula.reindex (extend (suffixIndex 11 4 0) - ![prefixIndex 11 4 0, prefixIndex 11 4 1, prefixIndex 11 4 2, prefixIndex 11 4 3, - suffixIndex 11 4 2, suffixIndex 11 4 5, suffixIndex 11 4 6, suffixIndex 11 4 7, - suffixIndex 11 4 8, suffixIndex 11 4 9, suffixIndex 11 4 10]) - (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).formula)) - (extendMany 4 fields env) ↔ - env 1 = nonemptyTupleCode 3 fields ∧ - env 0 = M.rawRefinementFormulaDataCode (fields 0) (fields 1) (fields 2) (fields 3) - (env 2) (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) := by - change (Realize M.sets (BoundedFormula.nonemptyTupleFormula 3 _ _).toFormula _ ∧ _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 4 fields env ground members), - BoundedFormula.truth_nonemptyTupleFormula] - simp only [extendMany_suffix, extendMany_prefix] - apply and_congr_right - intro _ - rw [realize_reindex, map_extend] - have args : (fun j : Fin 11 => extendMany 4 fields env - (![prefixIndex 11 4 0, prefixIndex 11 4 1, prefixIndex 11 4 2, prefixIndex 11 4 3, - suffixIndex 11 4 2, suffixIndex 11 4 5, suffixIndex 11 4 6, suffixIndex 11 4 7, - suffixIndex 11 4 8, suffixIndex 11 4 9, suffixIndex 11 4 10] j)) = - ![fields 0, fields 1, fields 2, fields 3, env 2, env 5, env 6, env 7, env 8, env 9, env 10] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j - rw [args] - have argMembers : ∀ j, (![fields 0, fields 1, fields 2, fields 3, env 2, env 5, env 6, - env 7, env 8, env 9, env 10] : Fin 11 → ZFSet.{u}) j ∈ M.sets := - (Fin.cases (ground 0) (Fin.cases (ground 1) (Fin.cases (ground 2) (Fin.cases (ground 3) (Fin.cases (members 2) (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) (Fin.cases (members 8) (Fin.cases (members 9) (Fin.cases (members 10) (fun j => Fin.elim0 j)))))))))))) - exact (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).correct _ - argMembers _ (members 0) - constructor - · rintro ⟨fields, ground, recognized⟩ - obtain ⟨shape, output⟩ := (meaning fields ground).1 recognized - have eta : fields = ![fields 0, fields 1, fields 2, fields 3] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j - exact ⟨fields 0, fields 1, fields 2, fields 3, eta ▸ shape, output⟩ - · rintro ⟨P, order, top, action, shape, output⟩ - have fields := M.forcingStageCode_fields (shape ▸ members 1) - have ground : ∀ j, (![P, order, top, action] : Fin 4 → ZFSet.{u}) j ∈ M.sets := - Fin.cases fields.1 (Fin.cases fields.2.1 - (Fin.cases fields.2.2.1 (Fin.cases fields.2.2.2 (fun j => Fin.elim0 j)))) - exact ⟨![P, order, top, action], ground, (meaning _ ground).2 ⟨shape, output⟩⟩ - -end TransitiveGround - - - - - -theorem ForcingStageRefinementDataCode.unique {M : TransitiveGround.{u}} - {G mul identity nodes nodeOrder basis T T2 level stage x y : ZFSet.{u}} - (first : ForcingStageRefinementDataCode M G mul identity nodes nodeOrder basis T T2 level stage x) - (second : ForcingStageRefinementDataCode M G mul identity nodes nodeOrder basis T T2 level stage y) : x = y := by - obtain ⟨_, P, order, top, action, stageEq, output⟩ := first - obtain ⟨_, P', order', top', action', stageEq', output'⟩ := second - obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 (stageEq.symm.trans stageEq') - exact output.trans output'.symm - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem exists_forcingStageRefinementData (params : Fin 9 → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) {stage : ZFSet.{u}} (hStage : stage ∈ M.sets) - (valid : ForcingStageValidityCode (params 0) (params 1) (params 2) stage) : - ∃ output ∈ M.sets, ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) - (params 3) (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by - have shape := valid - obtain ⟨P, order, top, action, equal, _⟩ := shape - have fields := M.forcingStageCode_fields (equal ▸ hStage) - let args : Fin 11 → ZFSet.{u} := ![P, order, top, action, params 0, params 3, params 4, - params 5, params 6, params 7, params 8] - have ground : ∀ j, args j ∈ M.sets := - Fin.cases fields.1 (Fin.cases fields.2.1 (Fin.cases fields.2.2.1 (Fin.cases fields.2.2.2 - (Fin.cases (members 0) (Fin.cases (members 3) (Fin.cases (members 4) - (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) - (Fin.cases (members 8) (fun j => Fin.elim0 j))))))))))) - exact ⟨_, (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).closed args ground, - valid, P, order, top, action, equal, rfl⟩ - -theorem exists_forcingStageRefinementGraph (params : Fin 9 → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) {stages : ZFSet.{u}} (hStages : stages ∈ M.sets) - (valid : ∀ stage ∈ stages, ForcingStageValidityCode (params 0) (params 1) (params 2) stage) : - ∃ graph ∈ M.sets, FunctionGraphOn stages graph ∧ ∀ stage output, - ZFSet.pair stage output ∈ graph ↔ stage ∈ stages ∧ - ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) (params 3) - (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by - let formula := SetFormula.reindex (extend 1 (extend 0 (fun j : Fin 9 => j.succ.succ))) - (M.forcingStageRefinementDataFormula pairing unions powers separation collection) - have meaning (stage output : ZFSet.{u}) (hs : stage ∈ M.sets) (ho : output ∈ M.sets) : - Realize M.sets formula (extend stage (extend output params)) ↔ - ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) (params 3) - (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by - rw [realize_reindex, map_extend, map_extend] - exact M.realize_forcingStageRefinementDataFormula pairing unions powers separation collection _ - (Fin.cases ho (Fin.cases hs members)) - obtain ⟨B, hB, bounded⟩ := M.collection_witness collection formula params members hStages (by - intro stage member - obtain ⟨output, ground, relation⟩ := M.exists_forcingStageRefinementData pairing unions powers separation collection - params members (M.transitive hStages member) (valid stage member) - exact ⟨output, ground, (meaning stage output (M.transitive hStages member) ground).2 relation⟩) - let graph := M.definableRelation formula params stages B - have exactEntry (stage output : ZFSet.{u}) : - ZFSet.pair stage output ∈ graph ↔ stage ∈ stages ∧ - ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) (params 3) - (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by - rw [M.pair_mem_definableRelation] - constructor - · rintro ⟨hs, ho, relation⟩ - exact ⟨hs, (meaning stage output (M.transitive hStages hs) (M.transitive hB ho)).1 relation⟩ - · rintro ⟨hs, relation⟩ - obtain ⟨y, hy, chosen⟩ := bounded stage hs - have eq : output = y := relation.unique - ((meaning stage y (M.transitive hStages hs) (M.transitive hB hy)).1 chosen) - exact eq.symm ▸ ⟨hs, hy, chosen⟩ - refine ⟨graph, M.definableRelation_mem pairing unions powers separation formula params members hStages hB, - ⟨B, ?_, ?_⟩, exactEntry⟩ - · exact fun _ member => (ZFSet.mem_sep.1 member).1 - · intro stage member - obtain ⟨output, ho, relation⟩ := bounded stage member - refine ⟨output, (M.pair_mem_definableRelation formula params stages B stage output).2 ⟨member, ho, relation⟩, ?_⟩ - intro y hy - exact ((exactEntry stage y).1 hy).2.unique - ((meaning stage output (M.transitive hStages member) (M.transitive hB ho)).1 relation) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.RawRefinementStageWitness -open SetRealization SetFormula -universe u -variable {G L : Type u} [Group G] [PartialOrder L] -variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} -variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} -variable {T T2 level P order top action : ZFSet.{u}} -variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : P ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (groundOrder : order ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hT : T ∈ M.sets) -local notation "data" => M.rawRefinementFormulaData P order top action - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level -include witness pairing unions powers separation collection carrier group nodes groundOrder supports hT - -theorem rawTests_order_mono (A p q : ZFSet.{u}) - (tests : stageOneRawTests M data A p) (below : ZFSet.pair q p ∈ data 8) : - stageOneRawTests M data A q := by - obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness - let := orderLaw.toPartialOrder - let := orderLaw.toOrderTop top topMem greatest - have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by - rw [orderLaw.conditionOrder_eq] - exact groundOrder - have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem - have dataEq : data = M.refinementLevelFormulaData e (SetMembers.presentation P) b d - level T T2 system.valid1 := by - have equal := M.rawRefinementFormulaData_eq e (SetMembers.presentation P) t b d - pairing unions powers separation collection carrier group nodes supports - system.inputs.condition_maps level T T2 system.valid1 system.valid2 - have carrierEq : (SetMembers.presentation P).carrier = P := rfl - simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using equal - have typedBelow : ZFSet.pair q p ∈ (SetMembers.presentation P).conditionOrder := by - rw [orderLaw.conditionOrder_eq] - exact below - rw [dataEq] at tests ⊢ - exact M.refinementLevelRawTests_order_mono e (SetMembers.presentation P) b d level - pairing unions powers separation collection carrier nextOrder nodes hT - system.valid1 system.indices base directed system.first A tests typedBelow - -end PartitionPilot.Forcing.RawRefinementStageWitness - - - -namespace PartitionPilot.Forcing.RawRefinementStageWitness -open SetRealization SetFormula -universe u -variable {G L : Type u} [Group G] [PartialOrder L] -variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} -variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} -variable {T T2 level P order top action : ZFSet.{u}} -variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : P ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (groundOrder : order ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hT : T ∈ M.sets) -local notation "data" => M.rawRefinementFormulaData P order top action - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level -include witness pairing unions powers separation collection carrier group nodes groundOrder supports hT - -theorem rawTests_union (family rows : Nat → ZFSet.{u}) (q : ZFSet.{u}) - (increasing : ∀ n m, n ≤ m → family n ⊆ family m) - (below : ∀ n, ZFSet.pair q (rows n) ∈ data 8) - (tests : ∀ n, stageOneRawTests M data (family n) (rows n)) : - stageOneRawTests M data (stageOneAssignmentUnion family) q := by - obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness - let := orderLaw.toPartialOrder - let := orderLaw.toOrderTop top topMem greatest - have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by - rw [orderLaw.conditionOrder_eq] - exact groundOrder - have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem - have dataEq : data = M.refinementLevelFormulaData e (SetMembers.presentation P) b d - level T T2 system.valid1 := by - have equal := M.rawRefinementFormulaData_eq e (SetMembers.presentation P) t b d - pairing unions powers separation collection carrier group nodes supports - system.inputs.condition_maps level T T2 system.valid1 system.valid2 - have carrierEq : (SetMembers.presentation P).carrier = P := rfl - simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using equal - have bounds (n : Nat) : q ∈ P ∧ rows n ∈ P := ZFSet.pair_mem_prod.1 (orderLaw.relation (below n)) - let lower : SetMembers P := SetMembers.ofMem q (bounds 0).1 - let sequence : Nat → SetMembers P := fun n => SetMembers.ofMem (rows n) (bounds n).2 - have lowerCode : (SetMembers.presentation P).encode lower = q := SetMembers.raw_ofMem _ _ - have sequenceCode (n : Nat) : (SetMembers.presentation P).encode (sequence n) = rows n := SetMembers.raw_ofMem _ _ - have meaning := M.refinementLevelRawTests_iff e (SetMembers.presentation P) b d level - pairing unions powers separation collection carrier nextOrder nodes hT system.valid1 - system.indices base directed system.first - rw [dataEq] at tests ⊢ - rw [← lowerCode] - apply (meaning _ lower).2 - apply M.refinementLevelTests_union (SetMembers.presentation P) pairing unions powers separation - collection carrier nextOrder hT system.valid1 e b d base directed system.first - level T2 family sequence lower increasing - · intro n - change ZFSet.pair ((SetMembers.presentation P).encode lower) - ((SetMembers.presentation P).encode (sequence n)) ∈ order - rw [lowerCode, sequenceCode] - exact below n - · intro n - apply (meaning (family n) (sequence n)).1 - rw [sequenceCode] - exact tests n - -end PartitionPilot.Forcing.RawRefinementStageWitness - - - -namespace PartitionPilot.Forcing.RawRefinementStageWitness -open SetRealization SetFormula -universe u -variable {G L : Type u} [Group G] [PartialOrder L] -variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} -variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} -variable {T T2 level P order top action : ZFSet.{u}} -variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : P ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (groundOrder : order ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -local notation "data" => M.rawRefinementFormulaData P order top action - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level -local notation "branch" => fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) - P order top action t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level -include witness pairing unions powers separation collection carrier group nodes groundOrder supports hLevel hT - -theorem relationLaws : RelationActionLaws G (stageOneAssignments (data 0) T) branch := by - obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness - let := orderLaw.toPartialOrder - let := orderLaw.toOrderTop top topMem greatest - have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by - rw [orderLaw.conditionOrder_eq] - exact groundOrder - have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem - have laws := M.rawStageRefinement_relationLaws e (SetMembers.presentation P) t b d - pairing unions powers separation collection carrier group nodes nextOrder supports - level T T2 system.valid1 system.valid2 system.inputs hLevel hT system.indices.index_ground - have carrierEq : (SetMembers.presentation P).carrier = P := rfl - simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using laws - -theorem assignment_function (g : G) : - ZFSet.IsFunc (stageOneAssignments (data 0) T) (stageOneAssignments (data 0) T) (branch g) := - (witness.relationLaws pairing unions powers separation collection carrier group nodes - groundOrder supports hLevel hT).function g - -theorem rawTests_actionGraph_iff (g : G) (A p q : ZFSet.{u}) - (edge : ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ action) : - stageOneRawTests M data (relationImage A (stageOneAssignments (data 0) T) (branch g)) q ↔ - stageOneRawTests M data A p := by - obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness - let := orderLaw.toPartialOrder - let := orderLaw.toOrderTop top topMem greatest - have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by - rw [orderLaw.conditionOrder_eq] - exact groundOrder - have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem - have typedEdge : ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ e.actionGraph (SetMembers.presentation P) t := - graph.symm ▸ edge - have tests := M.rawStageRefinementTests_actionGraph_iff e (SetMembers.presentation P) t b d - pairing unions powers separation collection carrier group nodes nextOrder supports - level T T2 system.valid1 system.valid2 system.inputs hLevel hT system.indices.index_ground - system.indices base directed system.first g A p q typedEdge - have carrierEq : (SetMembers.presentation P).carrier = P := rfl - simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using tests - -end PartitionPilot.Forcing.RawRefinementStageWitness - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawStageRefinementTestActions + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def forcingStageCode (P order top action : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 3 ![P, order, top, action] + +theorem forcingStageCode_eq_iff (P order top action P' order' top' action' : ZFSet.{u}) : + forcingStageCode P order top action = forcingStageCode P' order' top' action' ↔ + P = P' ∧ order = order' ∧ top = top' ∧ action = action' := by + simp only [forcingStageCode, nonemptyTupleCode, ZFSet.pair_inj] + rfl + +def ForcingStageValidityCode (G mul identity stage : ZFSet.{u}) : Prop := + ∃ P order top action, stage = forcingStageCode P order top action ∧ + PartialOrderCode P order ∧ top ∈ P ∧ + (∀ p ∈ P, ZFSet.pair p top ∈ order) ∧ PosetActionCode G P mul identity order action + +theorem forcingStageValidityCode_iff (G mul identity P order top action : ZFSet.{u}) : + ForcingStageValidityCode G mul identity (forcingStageCode P order top action) ↔ + PartialOrderCode P order ∧ top ∈ P ∧ + (∀ p ∈ P, ZFSet.pair p top ∈ order) ∧ PosetActionCode G P mul identity order action := by + constructor + · rintro ⟨P', r', t', A', equal, laws⟩ + obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal + exact laws + · intro laws + exact ⟨P, order, top, action, rfl, laws⟩ + +namespace BoundedFormula +open SetFormula + +def forcingStageFormula {n : Nat} (stage G mul identity : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + exPairFields stage (exPairFields 0 (exPairFields 0 + (.conj (partialOrderFormula 5 3) + (.conj (topFormula 5 3 1) (posetActionFormula (lift G) 5 (lift mul) (lift identity) 3 0))))) + +theorem truth_forcingStageFormula {n : Nat} (stage G mul identity : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (forcingStageFormula stage G mul identity) env ↔ + ForcingStageValidityCode (env G) (env mul) (env identity) (env stage) := by + simp only [forcingStageFormula, truth_exPairFields, Truth, truth_partialOrderFormula, + truth_topFormula, truth_posetActionFormula] + change (∃ P tail, env stage = ZFSet.pair P tail ∧ + ∃ order tail', tail = ZFSet.pair order tail' ∧ + ∃ top action, tail' = ZFSet.pair top action ∧ + PartialOrderCode P order ∧ (top ∈ P ∧ ∀ p ∈ P, ZFSet.pair p top ∈ order) ∧ + PosetActionCode (env G) P (env mul) (env identity) order action) ↔ _ + constructor + · rintro ⟨P, tail, equal, order, tail', eqtail, top, action, eqtail', orderLaw, ⟨member, greatest⟩, act⟩ + refine ⟨P, order, top, action, ?_, orderLaw, member, greatest, act⟩ + rw [eqtail, eqtail'] at equal + exact equal + · rintro ⟨P, order, top, action, equal, orderLaw, member, greatest, act⟩ + exact ⟨P, ZFSet.pair order (ZFSet.pair top action), equal, + order, ZFSet.pair top action, rfl, top, action, rfl, orderLaw, ⟨member, greatest⟩, act⟩ + +end BoundedFormula + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem forcingStageCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {P order top action : ZFSet.{u}} + (hP : P ∈ M.sets) (hOrder : order ∈ M.sets) (hTop : top ∈ M.sets) (hAction : action ∈ M.sets) : + forcingStageCode P order top action ∈ M.sets := + M.nonemptyTupleCode_mem pairing 3 _ + (Fin.cases hP (Fin.cases hOrder (Fin.cases hTop (Fin.cases hAction (fun j => Fin.elim0 j))))) + +theorem forcingStageCode_fields {P order top action : ZFSet.{u}} + (ground : forcingStageCode P order top action ∈ M.sets) : + P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets := by + have fields := M.nonemptyTupleCode_field_mem 3 ![P, order, top, action] ground + exact ⟨fields 0, fields 1, fields 2, fields 3⟩ + +theorem realize_forcingStageFormula {n : Nat} (stage G mul identity : Fin n) + (env : Fin n → ZFSet.{u}) (ground : ∀ j, env j ∈ M.sets) : + Realize M.sets (BoundedFormula.forcingStageFormula stage G mul identity).toFormula env ↔ + ForcingStageValidityCode (env G) (env mul) (env identity) (env stage) := + (BoundedFormula.realize_toFormula M _ _ ground).trans + (BoundedFormula.truth_forcingStageFormula stage G mul identity env) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +structure ForcingStageCore (G mul identity : ZFSet.{u}) where + carrier : ZFSet.{u} + order : ZFSet.{u} + top : ZFSet.{u} + actionGraph : ZFSet.{u} + order_code : PartialOrderCode carrier order + top_mem : top ∈ carrier + greatest : ∀ p ∈ carrier, ZFSet.pair p top ∈ order + action_code : PosetActionCode G carrier mul identity order actionGraph + +namespace ForcingStageCore +variable {G mul identity : ZFSet.{u}} (core : ForcingStageCore G mul identity) + +noncomputable def code : ZFSet.{u} := + forcingStageCode core.carrier core.order core.top core.actionGraph + +theorem validity : ForcingStageValidityCode G mul identity core.code := + (forcingStageValidityCode_iff _ _ _ _ _ _ _).2 + ⟨core.order_code, core.top_mem, core.greatest, core.action_code⟩ + +noncomputable def presentation : Presentation (SetMembers core.carrier) := + SetMembers.presentation core.carrier + +@[instance_reducible] noncomputable def partialOrder : PartialOrder (SetMembers core.carrier) := + core.order_code.toPartialOrder + +@[instance_reducible] noncomputable def orderTop : + letI := core.partialOrder + OrderTop (SetMembers core.carrier) := + core.order_code.toOrderTop core.top core.top_mem core.greatest + +noncomputable def action {inverse : ZFSet.{u}} (group : GroupCode G mul inverse identity) : + letI := group.toGroup + letI := core.partialOrder + PosetAction (SetMembers G) (SetMembers core.carrier) := + core.action_code.toPosetAction group core.order_code + +theorem decoded_code {inverse : ZFSet.{u}} (group : GroupCode G mul inverse identity) : + letI := group.toGroup + letI := core.partialOrder + letI := core.orderTop + forcingStageCode core.presentation.carrier core.presentation.conditionOrder + (core.presentation.encode ⊤) + ((core.action group).actionGraph core.presentation (SetMembers.presentation G)) = core.code := by + let := group.toGroup + let := core.partialOrder + let := core.orderTop + change forcingStageCode core.carrier + ((SetMembers.presentation core.carrier).conditionOrder) + (SetMembers.raw (SetMembers.ofMem core.top core.top_mem)) + ((core.action_code.toPosetAction group core.order_code).actionGraph + (SetMembers.presentation core.carrier) (SetMembers.presentation G)) = core.code + rw [core.order_code.conditionOrder_eq, SetMembers.raw_ofMem, + core.action_code.actionGraph_eq group core.order_code] + rfl + +end ForcingStageCore + +theorem exists_forcingStageCore {G mul identity stage : ZFSet.{u}} + (valid : ForcingStageValidityCode G mul identity stage) : + ∃ core : ForcingStageCore G mul identity, core.code = stage := by + obtain ⟨P, order, top, action, equal, orderLaw, member, greatest, act⟩ := valid + exact ⟨⟨P, order, top, action, orderLaw, member, greatest, act⟩, equal.symm⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem forcingStageCore_conditionMapFamily_mem {G mul identity inverse : ZFSet.{u}} + (core : ForcingStageCore G mul identity) (group : GroupCode G mul inverse identity) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hG : G ∈ M.sets) (ground : core.code ∈ M.sets) : + letI := group.toGroup + letI := core.partialOrder + (core.action group).conditionMapFamily core.presentation (SetMembers.presentation G) ∈ M.sets := by + let := group.toGroup + let := core.partialOrder + obtain ⟨hP, _, _, hA⟩ := M.forcingStageCode_fields ground + apply M.conditionMapFamily_mem_of_actionGraph (core.action group) core.presentation + (SetMembers.presentation G) pairing unions powers separation collection hP hG + change (core.action_code.toPosetAction group core.order_code).actionGraph + (SetMembers.presentation core.carrier) (SetMembers.presentation G) ∈ M.sets + rw [core.action_code.actionGraph_eq group core.order_code] + exact hA + +end TransitiveGround + +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.SetRealization.Presentation +open Forcing +universe u +variable {P : Type u} [PartialOrder P] (s : Presentation P) + +theorem conditionOrder_code : PartialOrderCode s.carrier s.conditionOrder := by + refine ⟨(s.product s).subset_carrier _, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + exact (s.pair_mem_conditionOrder x x).2 le_rfl + · intro x hx y hy xy yx + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + exact congrArg s.encode (le_antisymm ((s.pair_mem_conditionOrder x y).1 xy) + ((s.pair_mem_conditionOrder y x).1 yx)) + · intro x hx y hy z hz xy yz + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + exact (s.pair_mem_conditionOrder x z).2 (le_trans + ((s.pair_mem_conditionOrder x y).1 xy) ((s.pair_mem_conditionOrder y z).1 yz)) + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing.PosetAction +open SetRealization +universe u +variable {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem actionGraph_code : PosetActionCode t.carrier s.carrier + ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) + s.conditionOrder (a.actionGraph s t) := by + refine ⟨(t.product s).graph_isFunc s _, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + exact (a.triple_mem_actionGraph s t 1 x x).2 (a.one x) + · intro g hg h hh k hk x hx y hy z hz gh xy yz + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨h, rfl⟩ := (t.mem_carrier h).1 hh + obtain ⟨k, rfl⟩ := (t.mem_carrier k).1 hk + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + have product := ((t.product t).pair_mem_graph t _ (g, h) k).1 gh + have first := (a.triple_mem_actionGraph s t h x y).1 xy + have second := (a.triple_mem_actionGraph s t g y z).1 yz + apply (a.triple_mem_actionGraph s t k x z).2 + rw [← product, a.mul, first, second] + · intro g hg x hx y hy z hz w hw xz yw xy + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + have first := (a.triple_mem_actionGraph s t g x z).1 xz + have second := (a.triple_mem_actionGraph s t g y w).1 yw + apply (s.pair_mem_conditionOrder z w).2 + rw [← first, ← second] + exact (a.iso g).monotone ((s.pair_mem_conditionOrder x y).1 xy) + +noncomputable def forcingStageCore [OrderTop P] : + ForcingStageCore t.carrier ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) where + carrier := s.carrier + order := s.conditionOrder + top := s.encode ⊤ + actionGraph := a.actionGraph s t + order_code := s.conditionOrder_code + top_mem := s.encode_mem ⊤ + greatest := by + intro p hp + obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 hp + exact (s.pair_mem_conditionOrder p ⊤).2 le_top + action_code := a.actionGraph_code s t + +theorem forcingStageCore_code [OrderTop P] : + (a.forcingStageCore s t).code = forcingStageCode s.carrier s.conditionOrder + (s.encode ⊤) (a.actionGraph s t) := rfl + +end PartitionPilot.Forcing.PosetAction + +end + + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {G L : Type u} [Group G] [PartialOrder L] + +def RawRefinementStageWitness (M : TransitiveGround.{u}) + (t : Presentation G) (b : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 level P order top action : ZFSet.{u}) : Prop := + ∃ (orderLaw : PartialOrderCode P order) (topMem : top ∈ P) + (greatest : ∀ p ∈ P, ZFSet.pair p top ∈ order), + letI := orderLaw.toPartialOrder + letI := orderLaw.toOrderTop top topMem greatest + ∃ e : PosetAction G (SetMembers P), + e.actionGraph (SetMembers.presentation P) t = action ∧ + RefinementStageSystem M e (SetMembers.presentation P) t b d base directed level T T2 + +namespace RawRefinementStageWitness +variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} +variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} +variable {T T2 level P order top action : ZFSet.{u}} +variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) +include witness + +theorem action_code : PosetActionCode t.carrier P + ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) order action := by + obtain ⟨orderLaw, topMem, greatest, e, graph, _system⟩ := witness + let := orderLaw.toPartialOrder + let := orderLaw.toOrderTop top topMem greatest + have code := e.actionGraph_code (SetMembers.presentation P) t + rw [orderLaw.conditionOrder_eq, graph] at code + exact code + +theorem action_function : ZFSet.IsFunc (ZFSet.prod t.carrier P) P action := + witness.action_code.function + +end RawRefinementStageWitness + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def ForcingStageRefinementDataCode (M : TransitiveGround.{u}) + (G mul identity nodes nodeOrder basis T T2 level stage output : ZFSet.{u}) : Prop := + ForcingStageValidityCode G mul identity stage ∧ + ∃ P order top action, stage = forcingStageCode P order top action ∧ + output = M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +noncomputable def forcingStageRefinementDataFormula : SetFormula 11 := + let w := prefixIndex 11 4 + let old := suffixIndex 11 4 + .conj (BoundedFormula.forcingStageFormula 1 2 3 4).toFormula + (exBlock 4 (.conj (BoundedFormula.nonemptyTupleFormula 3 (old 1) w).toFormula + (SetFormula.reindex (extend (old 0) + ![w 0, w 1, w 2, w 3, old 2, old 5, old 6, old 7, old 8, old 9, old 10]) + (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).formula))) + +theorem realize_forcingStageRefinementDataFormula (env : Fin 11 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.forcingStageRefinementDataFormula pairing unions powers separation collection) env ↔ + ForcingStageRefinementDataCode M (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) + (env 8) (env 9) (env 10) (env 1) (env 0) := by + change (Realize M.sets (BoundedFormula.forcingStageFormula 1 2 3 4).toFormula env ∧ _) ↔ _ + rw [M.realize_forcingStageFormula 1 2 3 4 env members] + apply and_congr_right + intro _ + rw [realize_exBlock] + have meaning (fields : Fin 4 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : + Realize M.sets (.conj (BoundedFormula.nonemptyTupleFormula 3 (suffixIndex 11 4 1) + (prefixIndex 11 4)).toFormula + (SetFormula.reindex (extend (suffixIndex 11 4 0) + ![prefixIndex 11 4 0, prefixIndex 11 4 1, prefixIndex 11 4 2, prefixIndex 11 4 3, + suffixIndex 11 4 2, suffixIndex 11 4 5, suffixIndex 11 4 6, suffixIndex 11 4 7, + suffixIndex 11 4 8, suffixIndex 11 4 9, suffixIndex 11 4 10]) + (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).formula)) + (extendMany 4 fields env) ↔ + env 1 = nonemptyTupleCode 3 fields ∧ + env 0 = M.rawRefinementFormulaDataCode (fields 0) (fields 1) (fields 2) (fields 3) + (env 2) (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) := by + change (Realize M.sets (BoundedFormula.nonemptyTupleFormula 3 _ _).toFormula _ ∧ _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 4 fields env ground members), + BoundedFormula.truth_nonemptyTupleFormula] + simp only [extendMany_suffix, extendMany_prefix] + apply and_congr_right + intro _ + rw [realize_reindex, map_extend] + have args : (fun j : Fin 11 => extendMany 4 fields env + (![prefixIndex 11 4 0, prefixIndex 11 4 1, prefixIndex 11 4 2, prefixIndex 11 4 3, + suffixIndex 11 4 2, suffixIndex 11 4 5, suffixIndex 11 4 6, suffixIndex 11 4 7, + suffixIndex 11 4 8, suffixIndex 11 4 9, suffixIndex 11 4 10] j)) = + ![fields 0, fields 1, fields 2, fields 3, env 2, env 5, env 6, env 7, env 8, env 9, env 10] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j + rw [args] + have argMembers : ∀ j, (![fields 0, fields 1, fields 2, fields 3, env 2, env 5, env 6, + env 7, env 8, env 9, env 10] : Fin 11 → ZFSet.{u}) j ∈ M.sets := + (Fin.cases (ground 0) (Fin.cases (ground 1) (Fin.cases (ground 2) (Fin.cases (ground 3) (Fin.cases (members 2) (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) (Fin.cases (members 8) (Fin.cases (members 9) (Fin.cases (members 10) (fun j => Fin.elim0 j)))))))))))) + exact (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).correct _ + argMembers _ (members 0) + constructor + · rintro ⟨fields, ground, recognized⟩ + obtain ⟨shape, output⟩ := (meaning fields ground).1 recognized + have eta : fields = ![fields 0, fields 1, fields 2, fields 3] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j + exact ⟨fields 0, fields 1, fields 2, fields 3, eta ▸ shape, output⟩ + · rintro ⟨P, order, top, action, shape, output⟩ + have fields := M.forcingStageCode_fields (shape ▸ members 1) + have ground : ∀ j, (![P, order, top, action] : Fin 4 → ZFSet.{u}) j ∈ M.sets := + Fin.cases fields.1 (Fin.cases fields.2.1 + (Fin.cases fields.2.2.1 (Fin.cases fields.2.2.2 (fun j => Fin.elim0 j)))) + exact ⟨![P, order, top, action], ground, (meaning _ ground).2 ⟨shape, output⟩⟩ + +end TransitiveGround + + + + + +theorem ForcingStageRefinementDataCode.unique {M : TransitiveGround.{u}} + {G mul identity nodes nodeOrder basis T T2 level stage x y : ZFSet.{u}} + (first : ForcingStageRefinementDataCode M G mul identity nodes nodeOrder basis T T2 level stage x) + (second : ForcingStageRefinementDataCode M G mul identity nodes nodeOrder basis T T2 level stage y) : x = y := by + obtain ⟨_, P, order, top, action, stageEq, output⟩ := first + obtain ⟨_, P', order', top', action', stageEq', output'⟩ := second + obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 (stageEq.symm.trans stageEq') + exact output.trans output'.symm + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem exists_forcingStageRefinementData (params : Fin 9 → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) {stage : ZFSet.{u}} (hStage : stage ∈ M.sets) + (valid : ForcingStageValidityCode (params 0) (params 1) (params 2) stage) : + ∃ output ∈ M.sets, ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) + (params 3) (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by + have shape := valid + obtain ⟨P, order, top, action, equal, _⟩ := shape + have fields := M.forcingStageCode_fields (equal ▸ hStage) + let args : Fin 11 → ZFSet.{u} := ![P, order, top, action, params 0, params 3, params 4, + params 5, params 6, params 7, params 8] + have ground : ∀ j, args j ∈ M.sets := + Fin.cases fields.1 (Fin.cases fields.2.1 (Fin.cases fields.2.2.1 (Fin.cases fields.2.2.2 + (Fin.cases (members 0) (Fin.cases (members 3) (Fin.cases (members 4) + (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) + (Fin.cases (members 8) (fun j => Fin.elim0 j))))))))))) + exact ⟨_, (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).closed args ground, + valid, P, order, top, action, equal, rfl⟩ + +theorem exists_forcingStageRefinementGraph (params : Fin 9 → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) {stages : ZFSet.{u}} (hStages : stages ∈ M.sets) + (valid : ∀ stage ∈ stages, ForcingStageValidityCode (params 0) (params 1) (params 2) stage) : + ∃ graph ∈ M.sets, FunctionGraphOn stages graph ∧ ∀ stage output, + ZFSet.pair stage output ∈ graph ↔ stage ∈ stages ∧ + ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) (params 3) + (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by + let formula := SetFormula.reindex (extend 1 (extend 0 (fun j : Fin 9 => j.succ.succ))) + (M.forcingStageRefinementDataFormula pairing unions powers separation collection) + have meaning (stage output : ZFSet.{u}) (hs : stage ∈ M.sets) (ho : output ∈ M.sets) : + Realize M.sets formula (extend stage (extend output params)) ↔ + ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) (params 3) + (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by + rw [realize_reindex, map_extend, map_extend] + exact M.realize_forcingStageRefinementDataFormula pairing unions powers separation collection _ + (Fin.cases ho (Fin.cases hs members)) + obtain ⟨B, hB, bounded⟩ := M.collection_witness collection formula params members hStages (by + intro stage member + obtain ⟨output, ground, relation⟩ := M.exists_forcingStageRefinementData pairing unions powers separation collection + params members (M.transitive hStages member) (valid stage member) + exact ⟨output, ground, (meaning stage output (M.transitive hStages member) ground).2 relation⟩) + let graph := M.definableRelation formula params stages B + have exactEntry (stage output : ZFSet.{u}) : + ZFSet.pair stage output ∈ graph ↔ stage ∈ stages ∧ + ForcingStageRefinementDataCode M (params 0) (params 1) (params 2) (params 3) + (params 4) (params 5) (params 6) (params 7) (params 8) stage output := by + rw [M.pair_mem_definableRelation] + constructor + · rintro ⟨hs, ho, relation⟩ + exact ⟨hs, (meaning stage output (M.transitive hStages hs) (M.transitive hB ho)).1 relation⟩ + · rintro ⟨hs, relation⟩ + obtain ⟨y, hy, chosen⟩ := bounded stage hs + have eq : output = y := relation.unique + ((meaning stage y (M.transitive hStages hs) (M.transitive hB hy)).1 chosen) + exact eq.symm ▸ ⟨hs, hy, chosen⟩ + refine ⟨graph, M.definableRelation_mem pairing unions powers separation formula params members hStages hB, + ⟨B, ?_, ?_⟩, exactEntry⟩ + · exact fun _ member => (ZFSet.mem_sep.1 member).1 + · intro stage member + obtain ⟨output, ho, relation⟩ := bounded stage member + refine ⟨output, (M.pair_mem_definableRelation formula params stages B stage output).2 ⟨member, ho, relation⟩, ?_⟩ + intro y hy + exact ((exactEntry stage y).1 hy).2.unique + ((meaning stage output (M.transitive hStages member) (M.transitive hB ho)).1 relation) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.RawRefinementStageWitness +open SetRealization SetFormula +universe u +variable {G L : Type u} [Group G] [PartialOrder L] +variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} +variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} +variable {T T2 level P order top action : ZFSet.{u}} +variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : P ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (groundOrder : order ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hT : T ∈ M.sets) +local notation "data" => M.rawRefinementFormulaData P order top action + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level +include witness pairing unions powers separation collection carrier group nodes groundOrder supports hT + +theorem rawTests_order_mono (A p q : ZFSet.{u}) + (tests : stageOneRawTests M data A p) (below : ZFSet.pair q p ∈ data 8) : + stageOneRawTests M data A q := by + obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness + let := orderLaw.toPartialOrder + let := orderLaw.toOrderTop top topMem greatest + have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by + rw [orderLaw.conditionOrder_eq] + exact groundOrder + have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem + have dataEq : data = M.refinementLevelFormulaData e (SetMembers.presentation P) b d + level T T2 system.valid1 := by + have equal := M.rawRefinementFormulaData_eq e (SetMembers.presentation P) t b d + pairing unions powers separation collection carrier group nodes supports + system.inputs.condition_maps level T T2 system.valid1 system.valid2 + have carrierEq : (SetMembers.presentation P).carrier = P := rfl + simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using equal + have typedBelow : ZFSet.pair q p ∈ (SetMembers.presentation P).conditionOrder := by + rw [orderLaw.conditionOrder_eq] + exact below + rw [dataEq] at tests ⊢ + exact M.refinementLevelRawTests_order_mono e (SetMembers.presentation P) b d level + pairing unions powers separation collection carrier nextOrder nodes hT + system.valid1 system.indices base directed system.first A tests typedBelow + +end PartitionPilot.Forcing.RawRefinementStageWitness + + + +namespace PartitionPilot.Forcing.RawRefinementStageWitness +open SetRealization SetFormula +universe u +variable {G L : Type u} [Group G] [PartialOrder L] +variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} +variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} +variable {T T2 level P order top action : ZFSet.{u}} +variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : P ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (groundOrder : order ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hT : T ∈ M.sets) +local notation "data" => M.rawRefinementFormulaData P order top action + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level +include witness pairing unions powers separation collection carrier group nodes groundOrder supports hT + +theorem rawTests_union (family rows : Nat → ZFSet.{u}) (q : ZFSet.{u}) + (increasing : ∀ n m, n ≤ m → family n ⊆ family m) + (below : ∀ n, ZFSet.pair q (rows n) ∈ data 8) + (tests : ∀ n, stageOneRawTests M data (family n) (rows n)) : + stageOneRawTests M data (stageOneAssignmentUnion family) q := by + obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness + let := orderLaw.toPartialOrder + let := orderLaw.toOrderTop top topMem greatest + have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by + rw [orderLaw.conditionOrder_eq] + exact groundOrder + have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem + have dataEq : data = M.refinementLevelFormulaData e (SetMembers.presentation P) b d + level T T2 system.valid1 := by + have equal := M.rawRefinementFormulaData_eq e (SetMembers.presentation P) t b d + pairing unions powers separation collection carrier group nodes supports + system.inputs.condition_maps level T T2 system.valid1 system.valid2 + have carrierEq : (SetMembers.presentation P).carrier = P := rfl + simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using equal + have bounds (n : Nat) : q ∈ P ∧ rows n ∈ P := ZFSet.pair_mem_prod.1 (orderLaw.relation (below n)) + let lower : SetMembers P := SetMembers.ofMem q (bounds 0).1 + let sequence : Nat → SetMembers P := fun n => SetMembers.ofMem (rows n) (bounds n).2 + have lowerCode : (SetMembers.presentation P).encode lower = q := SetMembers.raw_ofMem _ _ + have sequenceCode (n : Nat) : (SetMembers.presentation P).encode (sequence n) = rows n := SetMembers.raw_ofMem _ _ + have meaning := M.refinementLevelRawTests_iff e (SetMembers.presentation P) b d level + pairing unions powers separation collection carrier nextOrder nodes hT system.valid1 + system.indices base directed system.first + rw [dataEq] at tests ⊢ + rw [← lowerCode] + apply (meaning _ lower).2 + apply M.refinementLevelTests_union (SetMembers.presentation P) pairing unions powers separation + collection carrier nextOrder hT system.valid1 e b d base directed system.first + level T2 family sequence lower increasing + · intro n + change ZFSet.pair ((SetMembers.presentation P).encode lower) + ((SetMembers.presentation P).encode (sequence n)) ∈ order + rw [lowerCode, sequenceCode] + exact below n + · intro n + apply (meaning (family n) (sequence n)).1 + rw [sequenceCode] + exact tests n + +end PartitionPilot.Forcing.RawRefinementStageWitness + + + +namespace PartitionPilot.Forcing.RawRefinementStageWitness +open SetRealization SetFormula +universe u +variable {G L : Type u} [Group G] [PartialOrder L] +variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} +variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} +variable {T T2 level P order top action : ZFSet.{u}} +variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : P ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (groundOrder : order ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +local notation "data" => M.rawRefinementFormulaData P order top action + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level +local notation "branch" => fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) + P order top action t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level +include witness pairing unions powers separation collection carrier group nodes groundOrder supports hLevel hT + +theorem relationLaws : RelationActionLaws G (stageOneAssignments (data 0) T) branch := by + obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness + let := orderLaw.toPartialOrder + let := orderLaw.toOrderTop top topMem greatest + have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by + rw [orderLaw.conditionOrder_eq] + exact groundOrder + have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem + have laws := M.rawStageRefinement_relationLaws e (SetMembers.presentation P) t b d + pairing unions powers separation collection carrier group nodes nextOrder supports + level T T2 system.valid1 system.valid2 system.inputs hLevel hT system.indices.index_ground + have carrierEq : (SetMembers.presentation P).carrier = P := rfl + simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using laws + +theorem assignment_function (g : G) : + ZFSet.IsFunc (stageOneAssignments (data 0) T) (stageOneAssignments (data 0) T) (branch g) := + (witness.relationLaws pairing unions powers separation collection carrier group nodes + groundOrder supports hLevel hT).function g + +theorem rawTests_actionGraph_iff (g : G) (A p q : ZFSet.{u}) + (edge : ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ action) : + stageOneRawTests M data (relationImage A (stageOneAssignments (data 0) T) (branch g)) q ↔ + stageOneRawTests M data A p := by + obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness + let := orderLaw.toPartialOrder + let := orderLaw.toOrderTop top topMem greatest + have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by + rw [orderLaw.conditionOrder_eq] + exact groundOrder + have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem + have typedEdge : ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ e.actionGraph (SetMembers.presentation P) t := + graph.symm ▸ edge + have tests := M.rawStageRefinementTests_actionGraph_iff e (SetMembers.presentation P) t b d + pairing unions powers separation collection carrier group nodes nextOrder supports + level T T2 system.valid1 system.valid2 system.inputs hLevel hT system.indices.index_ground + system.indices base directed system.first g A p q typedEdge + have carrierEq : (SetMembers.presentation P).carrier = P := rfl + simpa only [carrierEq, orderLaw.conditionOrder_eq, topEq, graph] using tests + +end PartitionPilot.Forcing.RawRefinementStageWitness + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRowAssignmentActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRowAssignmentActions.lean index 477aa94a7c9ac0e8375a4f6958d55cd9ba251696..fe5922f23c059a0554116d48034cc809aef23d11 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRowAssignmentActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawRowAssignmentActions.lean @@ -1,254 +1,254 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_rowAssignmentActionGraph : - GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => - rowAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) := by - let v := GroundSetTerm.var M (n := 7) - let product (x y : GroundSetTerm M 7) := - GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x, y] - let rowRange := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 5] - let assignmentRange := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 6] - let bound := product (product (v 0) (v 1)) (v 1) - let formula : SetFormula 10 := (BoundedFormula.rowAssignmentActionEntryFormula 0 1 2 3 4 5 6 7 8 9).toFormula - let term := GroundSetTerm.app (M.definable_separation separation formula) - ![bound, v 0, v 1, v 2, v 3, v 4, rowRange, assignmentRange, v 5, v 6] - refine { formula := term.definition.formula - closed := fun env members => M.rowAssignmentActionGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) - correct := ?_ } - intro env members z hz - rw [term.definition.correct env members z hz] - have args : (fun j : Fin 9 => - (![bound, v 0, v 1, v 2, v 3, v 4, rowRange, assignmentRange, v 5, v 6] j.succ).eval env) = - ![env 0, env 1, env 2, env 3, env 4, ⋃₀ ⋃₀ env 5, ⋃₀ ⋃₀ env 6, env 5, env 6] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))) j - have equal : term.eval env = rowAssignmentActionGraph - (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) := by - change ZFSet.sep (fun w => Realize M.sets formula (extend w _)) (bound.eval env) = _ - rw [args] - apply ZFSet.ext - intro w - rw [ZFSet.mem_sep, rowAssignmentActionGraph, ZFSet.mem_sep] - apply and_congr_right - intro hw - rw [BoundedFormula.realize_toFormula M _ _ - (Fin.cases (M.transitive (bound.ground env members) hw) - (Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) - (Fin.cases (members 3) (Fin.cases (members 4) - (Fin.cases (M.union_mem unions (M.union_mem unions (members 5))) - (Fin.cases (M.union_mem unions (M.union_mem unions (members 6))) - (Fin.cases (members 5) (Fin.cases (members 6) (fun k => Fin.elim0 k))))))))))), - BoundedFormula.truth_rowAssignmentActionEntryFormula] - rfl - rw [equal] - -noncomputable def rowAssignmentActionOutputFormula {n : Nat} - (output G Q C B J rowMaps assignmentMaps : Fin n) : SetFormula n := - SetFormula.reindex (extend output ![G, Q, C, B, J, rowMaps, assignmentMaps]) - (M.definable_rowAssignmentActionGraph pairing unions powers separation).formula - -theorem realize_rowAssignmentActionOutputFormula {n : Nat} - (output G Q C B J rowMaps assignmentMaps : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.rowAssignmentActionOutputFormula pairing unions powers separation - output G Q C B J rowMaps assignmentMaps) env ↔ - env output = rowAssignmentActionGraph (env G) (env Q) (env C) (env B) (env J) - (env rowMaps) (env assignmentMaps) := by - unfold rowAssignmentActionOutputFormula - rw [realize_reindex, map_extend] - exact (M.definable_rowAssignmentActionGraph pairing unions powers separation).correct - (fun j => env (![G, Q, C, B, J, rowMaps, assignmentMaps] j)) - (fun j => members _) (env output) (members output) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -noncomputable def rawActionSection (g A P : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.actionSectionEntryFormula 0 1 2 3) - (extend z (extend g (extend A (extend P Fin.elim0))))) (ZFSet.prod P P) - -theorem mem_rawActionSection (g A P z : ZFSet.{u}) : - z ∈ rawActionSection g A P ↔ - BoundedFormula.Truth (BoundedFormula.actionSectionEntryFormula 0 1 2 3) - (extend z (extend g (extend A (extend P Fin.elim0)))) := by - rw [rawActionSection, ZFSet.mem_sep] - constructor - · exact And.right - · intro meaning - obtain ⟨x, hx, y, hy, equal, _⟩ := - (BoundedFormula.truth_actionSectionEntryFormula 0 1 2 3 _).1 meaning - exact ⟨ZFSet.mem_prod.2 ⟨x, hx, y, hy, equal⟩, meaning⟩ - -noncomputable def rawActionMapFamily (G A P : ZFSet.{u}) : ZFSet.{u} := - letI := ZFSet.small_coe G - familyCodeGraph (fun g : G.toSet => g.val) (fun g => rawActionSection g.val A P) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_rawActionSection : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => rawActionSection (env 0) (env 1) (env 2)) where - formula := exactSetFormula 0 (BoundedFormula.actionSectionEntryFormula 0 2 3 4).toFormula - closed := by - intro env members - exact M.bounded_separation_mem separation (BoundedFormula.actionSectionEntryFormula 0 1 2 3) - (extend (env 0) (extend (env 1) (extend (env 2) Fin.elim0))) - (Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) (fun j => Fin.elim0 j)))) - (M.prod_mem pairing unions powers separation (members 2) (members 2)) - correct := by - intro env members z hz - apply M.realize_exactSetFormula 0 _ (extend z env) hz - · intro w hw - exact M.transitive (M.prod_mem pairing unions powers separation (members 2) (members 2)) - (ZFSet.mem_sep.1 hw).1 - · intro w hw - rw [mem_rawActionSection, - BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz members))] - rw [BoundedFormula.truth_actionSectionEntryFormula, - BoundedFormula.truth_actionSectionEntryFormula] - rfl - -noncomputable def definable_rawActionMapFamily (collection : CollectionSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => rawActionMapFamily (env 0) (env 1) (env 2)) := - (M.definable_rawActionSection pairing unions powers separation).definable_graph pairing separation collection - -end TransitiveGround - -variable {H Q : Type u} [Group H] [PartialOrder Q] -variable (a : PosetAction H Q) (s : Presentation Q) (t : Presentation H) - -theorem rawActionSection_eq (g : H) : - rawActionSection (t.encode g) (a.actionGraph s t) s.carrier = s.graph s (a.iso g) := by - apply ZFSet.ext - intro z - rw [mem_rawActionSection] - exact BoundedFormula.actionSectionEntry_correct a s t g z - -theorem rawActionMapFamily_eq : - rawActionMapFamily t.carrier (a.actionGraph s t) s.carrier = a.conditionMapFamily s t := by - let := ZFSet.small_coe t.carrier - apply ZFSet.ext - intro z - rw [rawActionMapFamily, mem_familyCodeGraph, PosetAction.conditionMapFamily, ZFSet.mem_range] - constructor - · rintro ⟨g, equal⟩ - obtain ⟨h, eq⟩ := (t.mem_carrier g.val).1 g.property - refine ⟨h, ?_⟩ - rw [← eq, rawActionSection_eq] at equal - exact equal - · rintro ⟨g, equal⟩ - refine ⟨⟨t.encode g, t.encode_mem g⟩, ?_⟩ - change ZFSet.pair (t.encode g) (rawActionSection _ _ _) = z - rw [rawActionSection_eq] - exact equal - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem pair_mem_rawActionMapFamily (G action P g f : ZFSet.{u}) : - ZFSet.pair g f ∈ rawActionMapFamily G action P ↔ - g ∈ G ∧ f = rawActionSection g action P := by - let := ZFSet.small_coe G - rw [rawActionMapFamily, mem_familyCodeGraph] - constructor - · rintro ⟨i, equal⟩ - obtain ⟨keys, values⟩ := ZFSet.pair_inj.1 equal - exact ⟨keys ▸ i.property, by rw [← keys]; exact values.symm⟩ - · rintro ⟨member, rfl⟩ - exact ⟨⟨g, member⟩, rfl⟩ - -theorem pair_mem_rawActionSection (g action P x y : ZFSet.{u}) : - ZFSet.pair x y ∈ rawActionSection g action P ↔ - x ∈ P ∧ y ∈ P ∧ ZFSet.pair (ZFSet.pair g x) y ∈ action := by - rw [mem_rawActionSection, BoundedFormula.truth_actionSectionEntryFormula] - constructor - · rintro ⟨a, ha, b, hb, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨ha, hb, entry⟩ - · rintro ⟨hx, hy, entry⟩ - exact ⟨x, hx, y, hy, rfl, entry⟩ - -noncomputable def rawRowAssignmentActionGraph - (G Q C B J rowAction assignmentAction : ZFSet.{u}) : ZFSet.{u} := - rowAssignmentActionGraph G Q C B J (rawActionMapFamily G rowAction C) - (rawActionMapFamily G assignmentAction J) - -theorem pair_mem_rawRowAssignmentActionGraph - (G Q C B J rowAction assignmentAction g p A q D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g (ZFSet.pair p A)) (ZFSet.pair q D) ∈ - rawRowAssignmentActionGraph G Q C B J rowAction assignmentAction ↔ - g ∈ G ∧ ZFSet.pair p A ∈ Q ∧ ZFSet.pair q D ∈ Q ∧ - p ∈ C ∧ A ∈ B ∧ q ∈ C ∧ D ∈ B ∧ - ZFSet.pair (ZFSet.pair g p) q ∈ rowAction ∧ - D = relationImage A J (rawActionSection g assignmentAction J) := by - rw [rawRowAssignmentActionGraph, pair_mem_rowAssignmentActionGraph] - constructor - · rintro ⟨hg, hpA, hqD, hp, hA, hq, hD, rf, af, indexed, row, indexedA, image⟩ - have rowEq := (pair_mem_rawActionMapFamily G rowAction C g rf).1 indexed |>.2 - have assignmentEq := (pair_mem_rawActionMapFamily G assignmentAction J g af).1 indexedA |>.2 - rw [rowEq] at row - rw [assignmentEq] at image - exact ⟨hg, hpA, hqD, hp, hA, hq, hD, - ((pair_mem_rawActionSection g rowAction C p q).1 row).2.2, image⟩ - · rintro ⟨hg, hpA, hqD, hp, hA, hq, hD, row, image⟩ - exact ⟨hg, hpA, hqD, hp, hA, hq, hD, rawActionSection g rowAction C, - rawActionSection g assignmentAction J, - (pair_mem_rawActionMapFamily G rowAction C g _).2 ⟨hg, rfl⟩, - (pair_mem_rawActionSection g rowAction C p q).2 ⟨hp, hq, row⟩, - (pair_mem_rawActionMapFamily G assignmentAction J g _).2 ⟨hg, rfl⟩, image⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -noncomputable def definable_rawRowAssignmentActionGraph : - GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => - rawRowAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) := by - let v := GroundSetTerm.var M (n := 7) - let maps := M.definable_rawActionMapFamily pairing unions powers separation collection - let rowMaps := GroundSetTerm.app maps ![v 0, v 5, v 2] - let assignmentMaps := GroundSetTerm.app maps ![v 0, v 6, v 4] - exact (GroundSetTerm.app (M.definable_rowAssignmentActionGraph pairing unions powers separation) - ![v 0, v 1, v 2, v 3, v 4, rowMaps, assignmentMaps]).definition - -include pairing unions powers separation collection in -theorem rawRowAssignmentActionGraph_mem {G Q C B J rowAction assignmentAction : ZFSet.{u}} - (hG : G ∈ M.sets) (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) - (hJ : J ∈ M.sets) (hRow : rowAction ∈ M.sets) (hAssignment : assignmentAction ∈ M.sets) : - rawRowAssignmentActionGraph G Q C B J rowAction assignmentAction ∈ M.sets := - (M.definable_rawRowAssignmentActionGraph pairing unions powers separation collection).closed - ![G, Q, C, B, J, rowAction, assignmentAction] - (Fin.cases hG (Fin.cases hQ (Fin.cases hC (Fin.cases hB - (Fin.cases hJ (Fin.cases hRow (Fin.cases hAssignment (fun j => Fin.elim0 j)))))))) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_rowAssignmentActionGraph : + GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => + rowAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) := by + let v := GroundSetTerm.var M (n := 7) + let product (x y : GroundSetTerm M 7) := + GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x, y] + let rowRange := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 5] + let assignmentRange := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 6] + let bound := product (product (v 0) (v 1)) (v 1) + let formula : SetFormula 10 := (BoundedFormula.rowAssignmentActionEntryFormula 0 1 2 3 4 5 6 7 8 9).toFormula + let term := GroundSetTerm.app (M.definable_separation separation formula) + ![bound, v 0, v 1, v 2, v 3, v 4, rowRange, assignmentRange, v 5, v 6] + refine { formula := term.definition.formula + closed := fun env members => M.rowAssignmentActionGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) + correct := ?_ } + intro env members z hz + rw [term.definition.correct env members z hz] + have args : (fun j : Fin 9 => + (![bound, v 0, v 1, v 2, v 3, v 4, rowRange, assignmentRange, v 5, v 6] j.succ).eval env) = + ![env 0, env 1, env 2, env 3, env 4, ⋃₀ ⋃₀ env 5, ⋃₀ ⋃₀ env 6, env 5, env 6] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))) j + have equal : term.eval env = rowAssignmentActionGraph + (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) := by + change ZFSet.sep (fun w => Realize M.sets formula (extend w _)) (bound.eval env) = _ + rw [args] + apply ZFSet.ext + intro w + rw [ZFSet.mem_sep, rowAssignmentActionGraph, ZFSet.mem_sep] + apply and_congr_right + intro hw + rw [BoundedFormula.realize_toFormula M _ _ + (Fin.cases (M.transitive (bound.ground env members) hw) + (Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) + (Fin.cases (members 3) (Fin.cases (members 4) + (Fin.cases (M.union_mem unions (M.union_mem unions (members 5))) + (Fin.cases (M.union_mem unions (M.union_mem unions (members 6))) + (Fin.cases (members 5) (Fin.cases (members 6) (fun k => Fin.elim0 k))))))))))), + BoundedFormula.truth_rowAssignmentActionEntryFormula] + rfl + rw [equal] + +noncomputable def rowAssignmentActionOutputFormula {n : Nat} + (output G Q C B J rowMaps assignmentMaps : Fin n) : SetFormula n := + SetFormula.reindex (extend output ![G, Q, C, B, J, rowMaps, assignmentMaps]) + (M.definable_rowAssignmentActionGraph pairing unions powers separation).formula + +theorem realize_rowAssignmentActionOutputFormula {n : Nat} + (output G Q C B J rowMaps assignmentMaps : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.rowAssignmentActionOutputFormula pairing unions powers separation + output G Q C B J rowMaps assignmentMaps) env ↔ + env output = rowAssignmentActionGraph (env G) (env Q) (env C) (env B) (env J) + (env rowMaps) (env assignmentMaps) := by + unfold rowAssignmentActionOutputFormula + rw [realize_reindex, map_extend] + exact (M.definable_rowAssignmentActionGraph pairing unions powers separation).correct + (fun j => env (![G, Q, C, B, J, rowMaps, assignmentMaps] j)) + (fun j => members _) (env output) (members output) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +noncomputable def rawActionSection (g A P : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.actionSectionEntryFormula 0 1 2 3) + (extend z (extend g (extend A (extend P Fin.elim0))))) (ZFSet.prod P P) + +theorem mem_rawActionSection (g A P z : ZFSet.{u}) : + z ∈ rawActionSection g A P ↔ + BoundedFormula.Truth (BoundedFormula.actionSectionEntryFormula 0 1 2 3) + (extend z (extend g (extend A (extend P Fin.elim0)))) := by + rw [rawActionSection, ZFSet.mem_sep] + constructor + · exact And.right + · intro meaning + obtain ⟨x, hx, y, hy, equal, _⟩ := + (BoundedFormula.truth_actionSectionEntryFormula 0 1 2 3 _).1 meaning + exact ⟨ZFSet.mem_prod.2 ⟨x, hx, y, hy, equal⟩, meaning⟩ + +noncomputable def rawActionMapFamily (G A P : ZFSet.{u}) : ZFSet.{u} := + letI := ZFSet.small_coe G + familyCodeGraph (fun g : G.toSet => g.val) (fun g => rawActionSection g.val A P) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_rawActionSection : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => rawActionSection (env 0) (env 1) (env 2)) where + formula := exactSetFormula 0 (BoundedFormula.actionSectionEntryFormula 0 2 3 4).toFormula + closed := by + intro env members + exact M.bounded_separation_mem separation (BoundedFormula.actionSectionEntryFormula 0 1 2 3) + (extend (env 0) (extend (env 1) (extend (env 2) Fin.elim0))) + (Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) (fun j => Fin.elim0 j)))) + (M.prod_mem pairing unions powers separation (members 2) (members 2)) + correct := by + intro env members z hz + apply M.realize_exactSetFormula 0 _ (extend z env) hz + · intro w hw + exact M.transitive (M.prod_mem pairing unions powers separation (members 2) (members 2)) + (ZFSet.mem_sep.1 hw).1 + · intro w hw + rw [mem_rawActionSection, + BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz members))] + rw [BoundedFormula.truth_actionSectionEntryFormula, + BoundedFormula.truth_actionSectionEntryFormula] + rfl + +noncomputable def definable_rawActionMapFamily (collection : CollectionSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => rawActionMapFamily (env 0) (env 1) (env 2)) := + (M.definable_rawActionSection pairing unions powers separation).definable_graph pairing separation collection + +end TransitiveGround + +variable {H Q : Type u} [Group H] [PartialOrder Q] +variable (a : PosetAction H Q) (s : Presentation Q) (t : Presentation H) + +theorem rawActionSection_eq (g : H) : + rawActionSection (t.encode g) (a.actionGraph s t) s.carrier = s.graph s (a.iso g) := by + apply ZFSet.ext + intro z + rw [mem_rawActionSection] + exact BoundedFormula.actionSectionEntry_correct a s t g z + +theorem rawActionMapFamily_eq : + rawActionMapFamily t.carrier (a.actionGraph s t) s.carrier = a.conditionMapFamily s t := by + let := ZFSet.small_coe t.carrier + apply ZFSet.ext + intro z + rw [rawActionMapFamily, mem_familyCodeGraph, PosetAction.conditionMapFamily, ZFSet.mem_range] + constructor + · rintro ⟨g, equal⟩ + obtain ⟨h, eq⟩ := (t.mem_carrier g.val).1 g.property + refine ⟨h, ?_⟩ + rw [← eq, rawActionSection_eq] at equal + exact equal + · rintro ⟨g, equal⟩ + refine ⟨⟨t.encode g, t.encode_mem g⟩, ?_⟩ + change ZFSet.pair (t.encode g) (rawActionSection _ _ _) = z + rw [rawActionSection_eq] + exact equal + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem pair_mem_rawActionMapFamily (G action P g f : ZFSet.{u}) : + ZFSet.pair g f ∈ rawActionMapFamily G action P ↔ + g ∈ G ∧ f = rawActionSection g action P := by + let := ZFSet.small_coe G + rw [rawActionMapFamily, mem_familyCodeGraph] + constructor + · rintro ⟨i, equal⟩ + obtain ⟨keys, values⟩ := ZFSet.pair_inj.1 equal + exact ⟨keys ▸ i.property, by rw [← keys]; exact values.symm⟩ + · rintro ⟨member, rfl⟩ + exact ⟨⟨g, member⟩, rfl⟩ + +theorem pair_mem_rawActionSection (g action P x y : ZFSet.{u}) : + ZFSet.pair x y ∈ rawActionSection g action P ↔ + x ∈ P ∧ y ∈ P ∧ ZFSet.pair (ZFSet.pair g x) y ∈ action := by + rw [mem_rawActionSection, BoundedFormula.truth_actionSectionEntryFormula] + constructor + · rintro ⟨a, ha, b, hb, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨ha, hb, entry⟩ + · rintro ⟨hx, hy, entry⟩ + exact ⟨x, hx, y, hy, rfl, entry⟩ + +noncomputable def rawRowAssignmentActionGraph + (G Q C B J rowAction assignmentAction : ZFSet.{u}) : ZFSet.{u} := + rowAssignmentActionGraph G Q C B J (rawActionMapFamily G rowAction C) + (rawActionMapFamily G assignmentAction J) + +theorem pair_mem_rawRowAssignmentActionGraph + (G Q C B J rowAction assignmentAction g p A q D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g (ZFSet.pair p A)) (ZFSet.pair q D) ∈ + rawRowAssignmentActionGraph G Q C B J rowAction assignmentAction ↔ + g ∈ G ∧ ZFSet.pair p A ∈ Q ∧ ZFSet.pair q D ∈ Q ∧ + p ∈ C ∧ A ∈ B ∧ q ∈ C ∧ D ∈ B ∧ + ZFSet.pair (ZFSet.pair g p) q ∈ rowAction ∧ + D = relationImage A J (rawActionSection g assignmentAction J) := by + rw [rawRowAssignmentActionGraph, pair_mem_rowAssignmentActionGraph] + constructor + · rintro ⟨hg, hpA, hqD, hp, hA, hq, hD, rf, af, indexed, row, indexedA, image⟩ + have rowEq := (pair_mem_rawActionMapFamily G rowAction C g rf).1 indexed |>.2 + have assignmentEq := (pair_mem_rawActionMapFamily G assignmentAction J g af).1 indexedA |>.2 + rw [rowEq] at row + rw [assignmentEq] at image + exact ⟨hg, hpA, hqD, hp, hA, hq, hD, + ((pair_mem_rawActionSection g rowAction C p q).1 row).2.2, image⟩ + · rintro ⟨hg, hpA, hqD, hp, hA, hq, hD, row, image⟩ + exact ⟨hg, hpA, hqD, hp, hA, hq, hD, rawActionSection g rowAction C, + rawActionSection g assignmentAction J, + (pair_mem_rawActionMapFamily G rowAction C g _).2 ⟨hg, rfl⟩, + (pair_mem_rawActionSection g rowAction C p q).2 ⟨hp, hq, row⟩, + (pair_mem_rawActionMapFamily G assignmentAction J g _).2 ⟨hg, rfl⟩, image⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +noncomputable def definable_rawRowAssignmentActionGraph : + GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => + rawRowAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) := by + let v := GroundSetTerm.var M (n := 7) + let maps := M.definable_rawActionMapFamily pairing unions powers separation collection + let rowMaps := GroundSetTerm.app maps ![v 0, v 5, v 2] + let assignmentMaps := GroundSetTerm.app maps ![v 0, v 6, v 4] + exact (GroundSetTerm.app (M.definable_rowAssignmentActionGraph pairing unions powers separation) + ![v 0, v 1, v 2, v 3, v 4, rowMaps, assignmentMaps]).definition + +include pairing unions powers separation collection in +theorem rawRowAssignmentActionGraph_mem {G Q C B J rowAction assignmentAction : ZFSet.{u}} + (hG : G ∈ M.sets) (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) + (hJ : J ∈ M.sets) (hRow : rowAction ∈ M.sets) (hAssignment : assignmentAction ∈ M.sets) : + rawRowAssignmentActionGraph G Q C B J rowAction assignmentAction ∈ M.sets := + (M.definable_rawRowAssignmentActionGraph pairing unions powers separation collection).closed + ![G, Q, C, B, J, rowAction, assignmentAction] + (Fin.cases hG (Fin.cases hQ (Fin.cases hC (Fin.cases hB + (Fin.cases hJ (Fin.cases hRow (Fin.cases hAssignment (fun j => Fin.elim0 j)))))))) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawStageRefinementTestActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawStageRefinementTestActions.lean index 4315d15fa78300724fe710af9c2bcdcaf7459fed..235178fd83ad4e4f04a156776564c7e89bf4d228 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawStageRefinementTestActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRawStageRefinementTestActions.lean @@ -1,394 +1,394 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageThreeDataBoundFixation - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def rawRefinementIndexActionGraph (g I P maps nodeMaps : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => Realize M.sets refinementIndexActionEntryFormula ![z,g,I,P,maps,nodeMaps]) - (ZFSet.prod I I) - -noncomputable def rawTermActionGraph (g T P maps : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => Realize M.sets termActionEntryFormula ![z,g,T,P,maps]) (ZFSet.prod T T) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_rawRefinementIndexActionGraph : - GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => - M.rawRefinementIndexActionGraph (env 0) (env 1) (env 2) (env 3) (env 4)) := by - let v := GroundSetTerm.var M (n := 5) - let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 1,v 1] - let term := GroundSetTerm.app (M.definable_separation separation refinementIndexActionEntryFormula) - ![bound,v 0,v 1,v 2,v 3,v 4] - apply term.definition.congr - intro env - change ZFSet.sep (fun z => Realize M.sets refinementIndexActionEntryFormula (extend z _)) _ = _ - have args : (fun j : Fin 5 => (![bound,v 0,v 1,v 2,v 3,v 4] j.succ).eval env) = ![env 0,env 1,env 2,env 3,env 4] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))) j - rw [args] - rfl - -noncomputable def definable_rawTermActionGraph : - GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => - M.rawTermActionGraph (env 0) (env 1) (env 2) (env 3)) := by - let v := GroundSetTerm.var M (n := 4) - let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 1,v 1] - let term := GroundSetTerm.app (M.definable_separation separation termActionEntryFormula) - ![bound,v 0,v 1,v 2,v 3] - apply term.definition.congr - intro env - change ZFSet.sep (fun z => Realize M.sets termActionEntryFormula (extend z _)) _ = _ - have args : (fun j : Fin 4 => (![bound,v 0,v 1,v 2,v 3] j.succ).eval env) = ![env 0,env 1,env 2,env 3] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j - rw [args] - rfl - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (level T1 T2 : ZFSet.{u}) (hl : level ∈ M.sets) -variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) -include pairing unions powers separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround - -theorem rawRefinementIndexActionGraph_eq (g : G) : - M.rawRefinementIndexActionGraph (t.encode g) - (M.niceRefinementIndices a s b d level T1 T2 valid1) s.carrier - (a.conditionMapFamily s t) (d.conditionMapFamily b t) = - M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by - have bound := M.prod_mem pairing unions powers separation indexGround indexGround - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨hz, entry⟩ := ZFSet.mem_sep.1 hz - exact (M.realize_refinementIndexActionEntryFormula a s t b d pairing unions powers separation - collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 - closed1 closed2 familyGround indexGround g z (M.transitive bound hz)).1 entry - · intro hz - have bounded := (ZFSet.mem_sep.1 hz).1 - exact ZFSet.mem_sep.2 ⟨bounded, - (M.realize_refinementIndexActionEntryFormula a s t b d pairing unions powers separation - collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 - closed1 closed2 familyGround indexGround g z (M.transitive bound bounded)).2 hz⟩ - -omit [OrderTop P] nodes order nodeMaps hl closed2 familyGround indexGround in -include pairing unions powers separation collection carrier group maps closed1 in -theorem rawTermActionGraph_eq (hT1 : T1 ∈ M.sets) (g : G) : - M.rawTermActionGraph (t.encode g) T1 s.carrier (a.conditionMapFamily s t) = - Name.renameFamilyGraph s (a.iso g) T1 valid1 := by - have bound := M.prod_mem pairing unions powers separation hT1 hT1 - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨hz, entry⟩ := ZFSet.mem_sep.1 hz - exact (M.realize_termActionEntryFormula a s t T1 valid1 pairing unions powers separation - collection carrier group maps hT1 closed1 g z (M.transitive bound hz)).1 entry - · intro hz - have bounded : z ∈ ZFSet.prod T1 T1 := by - obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T1 valid1 z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hw, closed1 g w hw⟩ - exact ZFSet.mem_sep.2 ⟨bounded, - (M.realize_termActionEntryFormula a s t T1 valid1 pairing unions powers separation - collection carrier group maps hT1 closed1 g z (M.transitive bound bounded)).2 hz⟩ - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def rawRefinementAssignmentActionGraph (g I T P maps nodeMaps : ZFSet.{u}) : ZFSet.{u} := - relationProduct I (ZFSet.prod T T) I (ZFSet.prod T T) - (M.rawRefinementIndexActionGraph g I P maps nodeMaps) - (relationProduct T T T T (M.rawTermActionGraph g T P maps) (M.rawTermActionGraph g T P maps)) - -theorem pair_mem_rawRefinementAssignmentActionGraph (g I T P maps nodeMaps i u w i' u' w' : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment i u w) (stageOneAssignment i' u' w') ∈ - M.rawRefinementAssignmentActionGraph g I T P maps nodeMaps ↔ - i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ i' ∈ I ∧ u' ∈ T ∧ w' ∈ T ∧ - ZFSet.pair i i' ∈ M.rawRefinementIndexActionGraph g I P maps nodeMaps ∧ - ZFSet.pair u u' ∈ M.rawTermActionGraph g T P maps ∧ - ZFSet.pair w w' ∈ M.rawTermActionGraph g T P maps := by - simp only [rawRefinementAssignmentActionGraph, stageOneAssignment, - pair_mem_relationProduct, ZFSet.pair_mem_prod] - tauto - -noncomputable def definable_rawRefinementAssignmentActionGraph - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => - M.rawRefinementAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by - let v := GroundSetTerm.var M (n := 6) - let index := GroundSetTerm.app (M.definable_rawRefinementIndexActionGraph pairing unions powers separation) - ![v 0,v 1,v 3,v 4,v 5] - let term := GroundSetTerm.app (M.definable_rawTermActionGraph pairing unions powers separation) - ![v 0,v 2,v 3,v 4] - let terms := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 2,v 2] - let termPair := GroundSetTerm.app (M.definable_relationProduct pairing unions powers separation) - ![v 2,v 2,v 2,v 2,term,term] - exact (GroundSetTerm.app (M.definable_relationProduct pairing unions powers separation) - ![v 1,terms,v 1,terms,index,termPair]).definition - -noncomputable def rawStageRefinementAssignmentActionGraph - (g P order top actionGraph G nodes nodeOrder nodeAction basis T T2 level : ZFSet.{u}) : ZFSet.{u} := - M.rawRefinementAssignmentActionGraph g - (M.rawRefinementFormulaData P order top actionGraph G nodes nodeOrder basis T T2 level 0) - T P (rawActionMapFamily G actionGraph P) (rawActionMapFamily G nodeAction nodes) - -noncomputable def definable_rawStageRefinementAssignmentActionGraph - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 13 → ZFSet.{u} => - M.rawStageRefinementAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) (env 12)) := by - let v := GroundSetTerm.var M (n := 13) - let maps := GroundSetTerm.app (M.definable_rawActionMapFamily pairing unions powers separation collection) - ![v 5,v 4,v 1] - let nodeMaps := GroundSetTerm.app (M.definable_rawActionMapFamily pairing unions powers separation collection) - ![v 5,v 8,v 6] - let first := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) - ![v 6,v 10,v 1,v 5,v 9,maps] - let second := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) - ![v 6,v 11,v 1,v 5,v 9,maps] - let family := GroundSetTerm.app (M.definable_familySetCode pairing unions powers separation) ![v 10,v 3] - let indices := GroundSetTerm.app (M.definable_refinementIndices pairing unions powers separation) - ![v 12,v 6,v 7,first,second,v 10,v 11,family,v 1,v 2,v 3] - exact (GroundSetTerm.app (M.definable_rawRefinementAssignmentActionGraph pairing unions powers separation) - ![v 0,indices,v 10,v 1,maps,nodeMaps]).definition - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (level T T2 : ZFSet.{u}) (hl : level ∈ M.sets) (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d level T T2 valid ∈ M.sets) -include pairing unions powers separation collection carrier group nodes order maps nodeMaps supports hl hT closed closed2 familyGround indexGround - -theorem rawStageRefinementAssignmentActionGraph_eq (g : G) : - M.rawStageRefinementAssignmentActionGraph (t.encode g) s.carrier s.conditionOrder - (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level = - M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g := by - unfold rawStageRefinementAssignmentActionGraph - rw [M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports maps level T T2 valid valid2, rawActionMapFamily_eq, rawActionMapFamily_eq] - change M.rawRefinementAssignmentActionGraph (t.encode g) - (M.niceRefinementIndices a s b d level T T2 valid) T s.carrier - (a.conditionMapFamily s t) (d.conditionMapFamily b t) = _ - unfold rawRefinementAssignmentActionGraph refinementAssignmentActionGraph - rw [M.rawRefinementIndexActionGraph_eq a s t b d pairing unions powers separation collection - carrier group nodes order maps nodeMaps level T T2 hl valid valid2 closed closed2 familyGround indexGround g, - M.rawTermActionGraph_eq (a := a) (s := s) (t := t) (pairing := pairing) (unions := unions) - (powers := powers) (separation := separation) (collection := collection) (carrier := carrier) - (group := group) (maps := maps) (T1 := T) (valid1 := valid) (closed1 := closed) hT g] - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (level T T2 : ZFSet.{u}) -variable (system : RefinementStageSystem M a s t b d base directed level T T2) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -include system pairing unions powers separation collection carrier order group nodes supports hLevel hT - -theorem rawStageRefinementAssignment_fixed_of_dataBound - (I S mu X tuples A : ZFSet.{u}) (D : L) - (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) - (g : G) (actor : g ∈ d.principalFix D) (z : ZFSet.{u}) - (member : z ∈ stageOneAssignments - (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t) t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 level 0) T) - (bound : ZFSet.pair z (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X - b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) : - ZFSet.pair z z ∈ M.rawStageRefinementAssignmentActionGraph (t.encode g) - s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier - b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level := by - rw [M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation collection - carrier group nodes order system.inputs.condition_maps system.inputs.node_maps supports level T T2 - hLevel hT system.valid1 system.valid2 system.inputs.terms_closed system.inputs.pairs_closed - system.inputs.family_ground system.indices.index_ground] - rw [M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2] at member - obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments _ _ z).1 member - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T T2 system.valid1 system.valid2 hi - let u : Name s := ⟨rawU, system.valid1 rawU hu⟩ - let w : Name s := ⟨rawW, system.valid1 rawW hw⟩ - exact M.refinementAssignment_fixed_of_dataBound a s b d I level T T2 system.valid1 system.valid2 t - pairing unions powers separation collection carrier order system.inputs.condition_maps - system.inputs.terms_closed system.inputs.pairs_closed system.inputs.family_ground - S mu X tuples A D support g actor C E U Rf Rc u w hi hu hw bound - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (order : s.conditionOrder ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (params : StageOneActionParameters M a s t b d T T2 valid) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d level T T2 valid ∈ M.sets) -local notation "data" => M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t) t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level -local notation "branch" => fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) - s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level -include pairing unions powers separation collection carrier group nodes order supports valid2 params hLevel hT indexGround - -theorem rawStageRefinement_relationLaws : - RelationActionLaws G (stageOneAssignments (data 0) T) branch := by - have graphs : branch = M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 := - funext (fun g => M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation - collection carrier group nodes order params.condition_maps params.node_maps supports level T T2 hLevel hT - valid valid2 params.terms_closed params.pairs_closed params.family_ground indexGround g) - rw [graphs, M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports params.condition_maps level T T2 valid valid2] - exact M.refinementAssignment_relationLaws a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order params - -theorem rawStageRefinement_image_eq (g : G) (A : ZFSet.{u}) : - relationImage A (stageOneAssignments (data 0) T) (branch g) = - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by - dsimp only - rw [M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports params.condition_maps level T T2 valid valid2, - M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation - collection carrier group nodes order params.condition_maps params.node_maps supports level T T2 hLevel hT - valid valid2 params.terms_closed params.pairs_closed params.family_ground indexGround g] - rfl - -end - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (order : s.conditionOrder ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (params : StageOneActionParameters M a s t b d T T2 valid) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d level T T2 valid ∈ M.sets) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "data" => M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t) t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level -local notation "branch" => fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) - s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level -include pairing unions powers separation collection carrier group nodes order supports params hLevel hT indexGround indices system - -theorem rawStageRefinementTests_image_iff (g : G) (A : ZFSet.{u}) (p : P) : - stageOneRawTests M data (relationImage A (stageOneAssignments (data 0) T) (branch g)) (s.encode (a.iso g p)) ↔ - stageOneRawTests M data A (s.encode p) := by - rw [M.rawStageRefinement_image_eq a s t b d pairing unions powers separation collection - carrier group nodes order supports level T T2 valid valid2 params hLevel hT indexGround, - M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports params.condition_maps level T T2 valid valid2] - rw [M.refinementLevelRawTests_iff a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system, - M.refinementLevelRawTests_iff a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system] - exact M.refinementLevelTests_image_iff a s b d level T T2 valid valid2 t pairing unions powers separation - collection carrier order params.condition_maps hT params.terms_closed params.pairs_closed params.family_ground - base directed system g A p - -theorem rawStageRefinementTests_actionGraph_iff (g : G) (A p q : ZFSet.{u}) - (edge : ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ a.actionGraph s t) : - stageOneRawTests M data (relationImage A (stageOneAssignments (data 0) T) (branch g)) q ↔ - stageOneRawTests M data A p := by - obtain ⟨⟨g', p'⟩, equal⟩ := ((t.product s).mem_graph s (fun x => a.iso x.1 x.2) _).1 edge - obtain ⟨inputs, output⟩ := ZFSet.pair_inj.1 equal.symm - obtain ⟨actors, source⟩ := ZFSet.pair_inj.1 inputs - have actor : g = g' := t.injective actors - have target : q = s.encode (a.iso g p') := by - simpa only [← actor] using output - rw [source, target] - exact M.rawStageRefinementTests_image_iff a s t b d pairing unions powers separation collection - carrier group nodes order supports level T T2 valid valid2 params hLevel hT indexGround - indices base directed system g A p' - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageThreeDataBoundFixation + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def rawRefinementIndexActionGraph (g I P maps nodeMaps : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => Realize M.sets refinementIndexActionEntryFormula ![z,g,I,P,maps,nodeMaps]) + (ZFSet.prod I I) + +noncomputable def rawTermActionGraph (g T P maps : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => Realize M.sets termActionEntryFormula ![z,g,T,P,maps]) (ZFSet.prod T T) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_rawRefinementIndexActionGraph : + GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => + M.rawRefinementIndexActionGraph (env 0) (env 1) (env 2) (env 3) (env 4)) := by + let v := GroundSetTerm.var M (n := 5) + let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 1,v 1] + let term := GroundSetTerm.app (M.definable_separation separation refinementIndexActionEntryFormula) + ![bound,v 0,v 1,v 2,v 3,v 4] + apply term.definition.congr + intro env + change ZFSet.sep (fun z => Realize M.sets refinementIndexActionEntryFormula (extend z _)) _ = _ + have args : (fun j : Fin 5 => (![bound,v 0,v 1,v 2,v 3,v 4] j.succ).eval env) = ![env 0,env 1,env 2,env 3,env 4] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))) j + rw [args] + rfl + +noncomputable def definable_rawTermActionGraph : + GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => + M.rawTermActionGraph (env 0) (env 1) (env 2) (env 3)) := by + let v := GroundSetTerm.var M (n := 4) + let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 1,v 1] + let term := GroundSetTerm.app (M.definable_separation separation termActionEntryFormula) + ![bound,v 0,v 1,v 2,v 3] + apply term.definition.congr + intro env + change ZFSet.sep (fun z => Realize M.sets termActionEntryFormula (extend z _)) _ = _ + have args : (fun j : Fin 4 => (![bound,v 0,v 1,v 2,v 3] j.succ).eval env) = ![env 0,env 1,env 2,env 3] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j + rw [args] + rfl + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (level T1 T2 : ZFSet.{u}) (hl : level ∈ M.sets) +variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) +include pairing unions powers separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround + +theorem rawRefinementIndexActionGraph_eq (g : G) : + M.rawRefinementIndexActionGraph (t.encode g) + (M.niceRefinementIndices a s b d level T1 T2 valid1) s.carrier + (a.conditionMapFamily s t) (d.conditionMapFamily b t) = + M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by + have bound := M.prod_mem pairing unions powers separation indexGround indexGround + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨hz, entry⟩ := ZFSet.mem_sep.1 hz + exact (M.realize_refinementIndexActionEntryFormula a s t b d pairing unions powers separation + collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 + closed1 closed2 familyGround indexGround g z (M.transitive bound hz)).1 entry + · intro hz + have bounded := (ZFSet.mem_sep.1 hz).1 + exact ZFSet.mem_sep.2 ⟨bounded, + (M.realize_refinementIndexActionEntryFormula a s t b d pairing unions powers separation + collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 + closed1 closed2 familyGround indexGround g z (M.transitive bound bounded)).2 hz⟩ + +omit [OrderTop P] nodes order nodeMaps hl closed2 familyGround indexGround in +include pairing unions powers separation collection carrier group maps closed1 in +theorem rawTermActionGraph_eq (hT1 : T1 ∈ M.sets) (g : G) : + M.rawTermActionGraph (t.encode g) T1 s.carrier (a.conditionMapFamily s t) = + Name.renameFamilyGraph s (a.iso g) T1 valid1 := by + have bound := M.prod_mem pairing unions powers separation hT1 hT1 + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨hz, entry⟩ := ZFSet.mem_sep.1 hz + exact (M.realize_termActionEntryFormula a s t T1 valid1 pairing unions powers separation + collection carrier group maps hT1 closed1 g z (M.transitive bound hz)).1 entry + · intro hz + have bounded : z ∈ ZFSet.prod T1 T1 := by + obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T1 valid1 z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hw, closed1 g w hw⟩ + exact ZFSet.mem_sep.2 ⟨bounded, + (M.realize_termActionEntryFormula a s t T1 valid1 pairing unions powers separation + collection carrier group maps hT1 closed1 g z (M.transitive bound bounded)).2 hz⟩ + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def rawRefinementAssignmentActionGraph (g I T P maps nodeMaps : ZFSet.{u}) : ZFSet.{u} := + relationProduct I (ZFSet.prod T T) I (ZFSet.prod T T) + (M.rawRefinementIndexActionGraph g I P maps nodeMaps) + (relationProduct T T T T (M.rawTermActionGraph g T P maps) (M.rawTermActionGraph g T P maps)) + +theorem pair_mem_rawRefinementAssignmentActionGraph (g I T P maps nodeMaps i u w i' u' w' : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment i u w) (stageOneAssignment i' u' w') ∈ + M.rawRefinementAssignmentActionGraph g I T P maps nodeMaps ↔ + i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ i' ∈ I ∧ u' ∈ T ∧ w' ∈ T ∧ + ZFSet.pair i i' ∈ M.rawRefinementIndexActionGraph g I P maps nodeMaps ∧ + ZFSet.pair u u' ∈ M.rawTermActionGraph g T P maps ∧ + ZFSet.pair w w' ∈ M.rawTermActionGraph g T P maps := by + simp only [rawRefinementAssignmentActionGraph, stageOneAssignment, + pair_mem_relationProduct, ZFSet.pair_mem_prod] + tauto + +noncomputable def definable_rawRefinementAssignmentActionGraph + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => + M.rawRefinementAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by + let v := GroundSetTerm.var M (n := 6) + let index := GroundSetTerm.app (M.definable_rawRefinementIndexActionGraph pairing unions powers separation) + ![v 0,v 1,v 3,v 4,v 5] + let term := GroundSetTerm.app (M.definable_rawTermActionGraph pairing unions powers separation) + ![v 0,v 2,v 3,v 4] + let terms := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 2,v 2] + let termPair := GroundSetTerm.app (M.definable_relationProduct pairing unions powers separation) + ![v 2,v 2,v 2,v 2,term,term] + exact (GroundSetTerm.app (M.definable_relationProduct pairing unions powers separation) + ![v 1,terms,v 1,terms,index,termPair]).definition + +noncomputable def rawStageRefinementAssignmentActionGraph + (g P order top actionGraph G nodes nodeOrder nodeAction basis T T2 level : ZFSet.{u}) : ZFSet.{u} := + M.rawRefinementAssignmentActionGraph g + (M.rawRefinementFormulaData P order top actionGraph G nodes nodeOrder basis T T2 level 0) + T P (rawActionMapFamily G actionGraph P) (rawActionMapFamily G nodeAction nodes) + +noncomputable def definable_rawStageRefinementAssignmentActionGraph + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 13 → ZFSet.{u} => + M.rawStageRefinementAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) (env 12)) := by + let v := GroundSetTerm.var M (n := 13) + let maps := GroundSetTerm.app (M.definable_rawActionMapFamily pairing unions powers separation collection) + ![v 5,v 4,v 1] + let nodeMaps := GroundSetTerm.app (M.definable_rawActionMapFamily pairing unions powers separation collection) + ![v 5,v 8,v 6] + let first := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) + ![v 6,v 10,v 1,v 5,v 9,maps] + let second := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) + ![v 6,v 11,v 1,v 5,v 9,maps] + let family := GroundSetTerm.app (M.definable_familySetCode pairing unions powers separation) ![v 10,v 3] + let indices := GroundSetTerm.app (M.definable_refinementIndices pairing unions powers separation) + ![v 12,v 6,v 7,first,second,v 10,v 11,family,v 1,v 2,v 3] + exact (GroundSetTerm.app (M.definable_rawRefinementAssignmentActionGraph pairing unions powers separation) + ![v 0,indices,v 10,v 1,maps,nodeMaps]).definition + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (level T T2 : ZFSet.{u}) (hl : level ∈ M.sets) (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d level T T2 valid ∈ M.sets) +include pairing unions powers separation collection carrier group nodes order maps nodeMaps supports hl hT closed closed2 familyGround indexGround + +theorem rawStageRefinementAssignmentActionGraph_eq (g : G) : + M.rawStageRefinementAssignmentActionGraph (t.encode g) s.carrier s.conditionOrder + (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level = + M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g := by + unfold rawStageRefinementAssignmentActionGraph + rw [M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports maps level T T2 valid valid2, rawActionMapFamily_eq, rawActionMapFamily_eq] + change M.rawRefinementAssignmentActionGraph (t.encode g) + (M.niceRefinementIndices a s b d level T T2 valid) T s.carrier + (a.conditionMapFamily s t) (d.conditionMapFamily b t) = _ + unfold rawRefinementAssignmentActionGraph refinementAssignmentActionGraph + rw [M.rawRefinementIndexActionGraph_eq a s t b d pairing unions powers separation collection + carrier group nodes order maps nodeMaps level T T2 hl valid valid2 closed closed2 familyGround indexGround g, + M.rawTermActionGraph_eq (a := a) (s := s) (t := t) (pairing := pairing) (unions := unions) + (powers := powers) (separation := separation) (collection := collection) (carrier := carrier) + (group := group) (maps := maps) (T1 := T) (valid1 := valid) (closed1 := closed) hT g] + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (level T T2 : ZFSet.{u}) +variable (system : RefinementStageSystem M a s t b d base directed level T T2) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +include system pairing unions powers separation collection carrier order group nodes supports hLevel hT + +theorem rawStageRefinementAssignment_fixed_of_dataBound + (I S mu X tuples A : ZFSet.{u}) (D : L) + (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) + (g : G) (actor : g ∈ d.principalFix D) (z : ZFSet.{u}) + (member : z ∈ stageOneAssignments + (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t) t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 level 0) T) + (bound : ZFSet.pair z (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X + b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) : + ZFSet.pair z z ∈ M.rawStageRefinementAssignmentActionGraph (t.encode g) + s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier + b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level := by + rw [M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation collection + carrier group nodes order system.inputs.condition_maps system.inputs.node_maps supports level T T2 + hLevel hT system.valid1 system.valid2 system.inputs.terms_closed system.inputs.pairs_closed + system.inputs.family_ground system.indices.index_ground] + rw [M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2] at member + obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments _ _ z).1 member + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T T2 system.valid1 system.valid2 hi + let u : Name s := ⟨rawU, system.valid1 rawU hu⟩ + let w : Name s := ⟨rawW, system.valid1 rawW hw⟩ + exact M.refinementAssignment_fixed_of_dataBound a s b d I level T T2 system.valid1 system.valid2 t + pairing unions powers separation collection carrier order system.inputs.condition_maps + system.inputs.terms_closed system.inputs.pairs_closed system.inputs.family_ground + S mu X tuples A D support g actor C E U Rf Rc u w hi hu hw bound + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (order : s.conditionOrder ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (params : StageOneActionParameters M a s t b d T T2 valid) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d level T T2 valid ∈ M.sets) +local notation "data" => M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t) t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level +local notation "branch" => fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) + s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level +include pairing unions powers separation collection carrier group nodes order supports valid2 params hLevel hT indexGround + +theorem rawStageRefinement_relationLaws : + RelationActionLaws G (stageOneAssignments (data 0) T) branch := by + have graphs : branch = M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 := + funext (fun g => M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation + collection carrier group nodes order params.condition_maps params.node_maps supports level T T2 hLevel hT + valid valid2 params.terms_closed params.pairs_closed params.family_ground indexGround g) + rw [graphs, M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports params.condition_maps level T T2 valid valid2] + exact M.refinementAssignment_relationLaws a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order params + +theorem rawStageRefinement_image_eq (g : G) (A : ZFSet.{u}) : + relationImage A (stageOneAssignments (data 0) T) (branch g) = + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by + dsimp only + rw [M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports params.condition_maps level T T2 valid valid2, + M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation + collection carrier group nodes order params.condition_maps params.node_maps supports level T T2 hLevel hT + valid valid2 params.terms_closed params.pairs_closed params.family_ground indexGround g] + rfl + +end + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (order : s.conditionOrder ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (params : StageOneActionParameters M a s t b d T T2 valid) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d level T T2 valid ∈ M.sets) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "data" => M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t) t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level +local notation "branch" => fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) + s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level +include pairing unions powers separation collection carrier group nodes order supports params hLevel hT indexGround indices system + +theorem rawStageRefinementTests_image_iff (g : G) (A : ZFSet.{u}) (p : P) : + stageOneRawTests M data (relationImage A (stageOneAssignments (data 0) T) (branch g)) (s.encode (a.iso g p)) ↔ + stageOneRawTests M data A (s.encode p) := by + rw [M.rawStageRefinement_image_eq a s t b d pairing unions powers separation collection + carrier group nodes order supports level T T2 valid valid2 params hLevel hT indexGround, + M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports params.condition_maps level T T2 valid valid2] + rw [M.refinementLevelRawTests_iff a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system, + M.refinementLevelRawTests_iff a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system] + exact M.refinementLevelTests_image_iff a s b d level T T2 valid valid2 t pairing unions powers separation + collection carrier order params.condition_maps hT params.terms_closed params.pairs_closed params.family_ground + base directed system g A p + +theorem rawStageRefinementTests_actionGraph_iff (g : G) (A p q : ZFSet.{u}) + (edge : ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ a.actionGraph s t) : + stageOneRawTests M data (relationImage A (stageOneAssignments (data 0) T) (branch g)) q ↔ + stageOneRawTests M data A p := by + obtain ⟨⟨g', p'⟩, equal⟩ := ((t.product s).mem_graph s (fun x => a.iso x.1 x.2) _).1 edge + obtain ⟨inputs, output⟩ := ZFSet.pair_inj.1 equal.symm + obtain ⟨actors, source⟩ := ZFSet.pair_inj.1 inputs + have actor : g = g' := t.injective actors + have target : q = s.encode (a.iso g p') := by + simpa only [← actor] using output + rw [source, target] + exact M.rawStageRefinementTests_image_iff a s t b d pairing unions powers separation collection + carrier group nodes order supports level T T2 valid valid2 params hLevel hT indexGround + indices base directed system g A p' + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecordedPreparationSupportInclusions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecordedPreparationSupportInclusions.lean index 99e10967b096f70ffe0e302a275ac9dd9d2f00de..a169f82ca008cb6de54913c39e3af444098f03e9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecordedPreparationSupportInclusions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecordedPreparationSupportInclusions.lean @@ -1,121 +1,121 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPreparationEventSupportGraphs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateBasisUnions - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def preparationUsedSupportUnion (nodes E events : ZFSet.{u}) : ZFSet.{u} := - (relationImage ZFSet.omega (M.groundPower nodes) - (M.preparationUsedSupportSequence nodes E events)).sUnion - -theorem preparationUsedSupportUnion_ground_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {nodes E events : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) - (whole : events ∈ M.sets) (function : ZFSet.IsFunc ZFSet.omega E events) - (certificates : ∀ i event, ZFSet.pair i event ∈ events → event = ∅ ∨ - ∃ alpha r k enumerations J N, - event = ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) ∧ - J ∈ M.sets ∧ N ∈ M.sets ∧ k ∈ M.sets ∧ - ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k ∧ - M.groundEmbeddable J ZFSet.omega) : - M.preparationUsedSupportUnion nodes E events ∈ M.sets ∧ - M.groundEmbeddable (M.preparationUsedSupportUnion nodes E events) ZFSet.omega := by - have omega := M.omega_mem separation infinite - let g := M.preparationUsedSupportSequence nodes E events - have grounded := M.preparationUsedSupportSequence_ground_function pairing unions powers separation - hNodes hE omega whole function - have valueSmall {i support : ZFSet.{u}} (edge : ZFSet.pair i support ∈ g) : - M.groundEmbeddable support ZFSet.omega := by - obtain ⟨event, eventEdge, rfl⟩ := - (M.pair_mem_preparationUsedSupportSequence separation hNodes hE function i support).1 edge - rcases certificates i event eventEdge with idle | active - · rw [idle, preparationEventUsedSupports_idle] - exact M.empty_groundEmbeddable ZFSet.omega ⟨nodes, hNodes⟩ - · obtain ⟨alpha, r, k, enumerations, J, N, rfl, hJ, hN, hk, selected, smallJ⟩ := active - rw [preparationEventUsedSupports_active] - exact (M.certificateUsedSupports_ground_countable pairing unions powers separation infinite choice - hJ hNodes hN hk selected smallJ).2 - let bases := M.groundSmallSubsets nodes ZFSet.omega - have narrowed : ZFSet.IsFunc ZFSet.omega bases g := by - refine ⟨?_, grounded.2.2⟩ - intro z hz - obtain ⟨i, hi, support, hs, rfl⟩ := ZFSet.mem_prod.1 (grounded.2.1 hz) - have fields := (M.mem_groundPower nodes support).1 hs - exact ZFSet.pair_mem_prod.2 ⟨hi, (M.mem_groundSmallSubsets nodes ZFSet.omega support).2 - ⟨fields.1, fields.2, valueSmall hz⟩⟩ - have equal : relationImage ZFSet.omega (M.groundPower nodes) g = - relationImage ZFSet.omega bases g := by - apply ZFSet.ext - intro support - rw [mem_relationImage, mem_relationImage] - constructor - · rintro ⟨_, i, hi, edge⟩ - exact ⟨(ZFSet.pair_mem_prod.1 (narrowed.1 edge)).2, i, hi, edge⟩ - · rintro ⟨_, i, hi, edge⟩ - exact ⟨(ZFSet.pair_mem_prod.1 (grounded.2.1 edge)).2, i, hi, edge⟩ - change (relationImage ZFSet.omega (M.groundPower nodes) g).sUnion ∈ M.sets ∧ - M.groundEmbeddable (relationImage ZFSet.omega (M.groundPower nodes) g).sUnion ZFSet.omega - rw [equal] - exact M.countable_union_of_sequence_graph pairing unions powers separation infinite choice - (M.groundSmallSubsets_mem powers separation hNodes omega) hNodes grounded.1 narrowed - (fun B hB => ((M.mem_groundSmallSubsets nodes ZFSet.omega B).1 hB).2.1) - (fun B hB => ((M.mem_groundSmallSubsets nodes ZFSet.omega B).1 hB).2.2) - -theorem mem_preparationUsedSupportUnion - (separation : SeparationSchema M.sets) {nodes E events : ZFSet.{u}} - (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) - (function : ZFSet.IsFunc ZFSet.omega E events) (v : ZFSet.{u}) : - v ∈ M.preparationUsedSupportUnion nodes E events ↔ - v ∈ nodes ∧ ∃ i ∈ ZFSet.omega, ∃ alpha r k enumerations z F B f, - ZFSet.pair i (ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations))) ∈ events ∧ - ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B := by - rw [preparationUsedSupportUnion, ZFSet.mem_sUnion] - constructor - · rintro ⟨support, hs, member⟩ - obtain ⟨_, i, hi, edge⟩ := (mem_relationImage _ _ _ _).1 hs - obtain ⟨event, eventEdge, rfl⟩ := - (M.pair_mem_preparationUsedSupportSequence separation hNodes hE function i support).1 edge - obtain ⟨hv, alpha, r, k, enumerations, rfl, z, F, B, f, certificate, inside⟩ := ZFSet.mem_sep.1 member - exact ⟨hv, i, hi, alpha, r, k, enumerations, z, F, B, f, eventEdge, certificate, inside⟩ - · rintro ⟨hv, i, hi, alpha, r, k, enumerations, z, F, B, f, eventEdge, certificate, inside⟩ - let event := ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) - let support := preparationEventUsedSupports nodes event - have edge := (M.pair_mem_preparationUsedSupportSequence separation hNodes hE function i support).2 - ⟨event, eventEdge, rfl⟩ - have hs := (pair_mem_relationCompose _ _ _ _ _ _ _).1 edge |>.2.1 - exact ⟨support, (mem_relationImage _ _ _ _).2 ⟨hs, i, hi, edge⟩, - ZFSet.mem_sep.2 ⟨hv, alpha, r, k, enumerations, rfl, z, F, B, f, certificate, inside⟩⟩ - -theorem preparationUsedSupportUnion_subset - (separation : SeparationSchema M.sets) {nodes E events : ZFSet.{u}} - (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) - (function : ZFSet.IsFunc ZFSet.omega E events) : - M.preparationUsedSupportUnion nodes E events ⊆ nodes := by - intro v member - exact ((M.mem_preparationUsedSupportUnion separation hNodes hE function v).1 member).1 - -theorem recordedCertificateUsedSupports_subset - (separation : SeparationSchema M.sets) {nodes E events : ZFSet.{u}} - (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) - (function : ZFSet.IsFunc ZFSet.omega E events) - {i alpha r k enumerations : ZFSet.{u}} - (edge : ZFSet.pair i (ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations))) ∈ events) : - certificateUsedSupports nodes k ⊆ M.preparationUsedSupportUnion nodes E events := by - intro v member - obtain ⟨hv, z, F, B, f, certificate, inside⟩ := - (mem_certificateUsedSupports nodes k v).1 member - exact (M.mem_preparationUsedSupportUnion separation hNodes hE function v).2 - ⟨hv, i, (ZFSet.pair_mem_prod.1 (function.1 edge)).1, - alpha, r, k, enumerations, z, F, B, f, edge, certificate, inside⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPreparationEventSupportGraphs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateBasisUnions + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def preparationUsedSupportUnion (nodes E events : ZFSet.{u}) : ZFSet.{u} := + (relationImage ZFSet.omega (M.groundPower nodes) + (M.preparationUsedSupportSequence nodes E events)).sUnion + +theorem preparationUsedSupportUnion_ground_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {nodes E events : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) + (whole : events ∈ M.sets) (function : ZFSet.IsFunc ZFSet.omega E events) + (certificates : ∀ i event, ZFSet.pair i event ∈ events → event = ∅ ∨ + ∃ alpha r k enumerations J N, + event = ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) ∧ + J ∈ M.sets ∧ N ∈ M.sets ∧ k ∈ M.sets ∧ + ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k ∧ + M.groundEmbeddable J ZFSet.omega) : + M.preparationUsedSupportUnion nodes E events ∈ M.sets ∧ + M.groundEmbeddable (M.preparationUsedSupportUnion nodes E events) ZFSet.omega := by + have omega := M.omega_mem separation infinite + let g := M.preparationUsedSupportSequence nodes E events + have grounded := M.preparationUsedSupportSequence_ground_function pairing unions powers separation + hNodes hE omega whole function + have valueSmall {i support : ZFSet.{u}} (edge : ZFSet.pair i support ∈ g) : + M.groundEmbeddable support ZFSet.omega := by + obtain ⟨event, eventEdge, rfl⟩ := + (M.pair_mem_preparationUsedSupportSequence separation hNodes hE function i support).1 edge + rcases certificates i event eventEdge with idle | active + · rw [idle, preparationEventUsedSupports_idle] + exact M.empty_groundEmbeddable ZFSet.omega ⟨nodes, hNodes⟩ + · obtain ⟨alpha, r, k, enumerations, J, N, rfl, hJ, hN, hk, selected, smallJ⟩ := active + rw [preparationEventUsedSupports_active] + exact (M.certificateUsedSupports_ground_countable pairing unions powers separation infinite choice + hJ hNodes hN hk selected smallJ).2 + let bases := M.groundSmallSubsets nodes ZFSet.omega + have narrowed : ZFSet.IsFunc ZFSet.omega bases g := by + refine ⟨?_, grounded.2.2⟩ + intro z hz + obtain ⟨i, hi, support, hs, rfl⟩ := ZFSet.mem_prod.1 (grounded.2.1 hz) + have fields := (M.mem_groundPower nodes support).1 hs + exact ZFSet.pair_mem_prod.2 ⟨hi, (M.mem_groundSmallSubsets nodes ZFSet.omega support).2 + ⟨fields.1, fields.2, valueSmall hz⟩⟩ + have equal : relationImage ZFSet.omega (M.groundPower nodes) g = + relationImage ZFSet.omega bases g := by + apply ZFSet.ext + intro support + rw [mem_relationImage, mem_relationImage] + constructor + · rintro ⟨_, i, hi, edge⟩ + exact ⟨(ZFSet.pair_mem_prod.1 (narrowed.1 edge)).2, i, hi, edge⟩ + · rintro ⟨_, i, hi, edge⟩ + exact ⟨(ZFSet.pair_mem_prod.1 (grounded.2.1 edge)).2, i, hi, edge⟩ + change (relationImage ZFSet.omega (M.groundPower nodes) g).sUnion ∈ M.sets ∧ + M.groundEmbeddable (relationImage ZFSet.omega (M.groundPower nodes) g).sUnion ZFSet.omega + rw [equal] + exact M.countable_union_of_sequence_graph pairing unions powers separation infinite choice + (M.groundSmallSubsets_mem powers separation hNodes omega) hNodes grounded.1 narrowed + (fun B hB => ((M.mem_groundSmallSubsets nodes ZFSet.omega B).1 hB).2.1) + (fun B hB => ((M.mem_groundSmallSubsets nodes ZFSet.omega B).1 hB).2.2) + +theorem mem_preparationUsedSupportUnion + (separation : SeparationSchema M.sets) {nodes E events : ZFSet.{u}} + (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) + (function : ZFSet.IsFunc ZFSet.omega E events) (v : ZFSet.{u}) : + v ∈ M.preparationUsedSupportUnion nodes E events ↔ + v ∈ nodes ∧ ∃ i ∈ ZFSet.omega, ∃ alpha r k enumerations z F B f, + ZFSet.pair i (ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations))) ∈ events ∧ + ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B := by + rw [preparationUsedSupportUnion, ZFSet.mem_sUnion] + constructor + · rintro ⟨support, hs, member⟩ + obtain ⟨_, i, hi, edge⟩ := (mem_relationImage _ _ _ _).1 hs + obtain ⟨event, eventEdge, rfl⟩ := + (M.pair_mem_preparationUsedSupportSequence separation hNodes hE function i support).1 edge + obtain ⟨hv, alpha, r, k, enumerations, rfl, z, F, B, f, certificate, inside⟩ := ZFSet.mem_sep.1 member + exact ⟨hv, i, hi, alpha, r, k, enumerations, z, F, B, f, eventEdge, certificate, inside⟩ + · rintro ⟨hv, i, hi, alpha, r, k, enumerations, z, F, B, f, eventEdge, certificate, inside⟩ + let event := ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) + let support := preparationEventUsedSupports nodes event + have edge := (M.pair_mem_preparationUsedSupportSequence separation hNodes hE function i support).2 + ⟨event, eventEdge, rfl⟩ + have hs := (pair_mem_relationCompose _ _ _ _ _ _ _).1 edge |>.2.1 + exact ⟨support, (mem_relationImage _ _ _ _).2 ⟨hs, i, hi, edge⟩, + ZFSet.mem_sep.2 ⟨hv, alpha, r, k, enumerations, rfl, z, F, B, f, certificate, inside⟩⟩ + +theorem preparationUsedSupportUnion_subset + (separation : SeparationSchema M.sets) {nodes E events : ZFSet.{u}} + (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) + (function : ZFSet.IsFunc ZFSet.omega E events) : + M.preparationUsedSupportUnion nodes E events ⊆ nodes := by + intro v member + exact ((M.mem_preparationUsedSupportUnion separation hNodes hE function v).1 member).1 + +theorem recordedCertificateUsedSupports_subset + (separation : SeparationSchema M.sets) {nodes E events : ZFSet.{u}} + (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) + (function : ZFSet.IsFunc ZFSet.omega E events) + {i alpha r k enumerations : ZFSet.{u}} + (edge : ZFSet.pair i (ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations))) ∈ events) : + certificateUsedSupports nodes k ⊆ M.preparationUsedSupportUnion nodes E events := by + intro v member + obtain ⟨hv, z, F, B, f, certificate, inside⟩ := + (mem_certificateUsedSupports nodes k v).1 member + exact (M.mem_preparationUsedSupportUnion separation hNodes hE function v).2 + ⟨hv, i, (ZFSet.pair_mem_prod.1 (function.1 edge)).1, + alpha, r, k, enumerations, z, F, B, f, edge, certificate, inside⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveActions.lean index c5624fec3d865fa8bdfef3c9bc91937ae4004c87..d787264f7ae57f6c00e8db42d3ed97404f91ee84 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveActions.lean @@ -1,766 +1,766 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaskTransportFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.CodedRecursiveTaskActions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHeightPushforward - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem taskTransportGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G I P R U Labels A : ZFSet.{u}} (hG : G ∈ M.sets) (hI : I ∈ M.sets) - (hP : P ∈ M.sets) (hR : R ∈ M.sets) (hU : U ∈ M.sets) - (hLabels : Labels ∈ M.sets) (hA : A ∈ M.sets) : - taskTransportGraph G I P R U Labels A ∈ M.sets := by - let params := extend G (extend I (extend P (extend R (extend U (extend Labels (extend A Fin.elim0)))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.taskTransportEntryFormula 0 1 2 3 4 5 6 7) params - (Fin.cases hG (Fin.cases hI (Fin.cases hP (Fin.cases hR (Fin.cases hU - (Fin.cases hLabels (Fin.cases hA (fun i => Fin.elim0 i)))))))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hG hI) hI) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.taskTransportEntryFormula 0 1 2 3 4 5 6 7) (extend z params)) - (ZFSet.prod (ZFSet.prod G I) I) = taskTransportGraph G I P R U Labels A := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, taskTransportGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_taskTransportEntryFormula 0 1 2 3 4 5 6 7 _) - exact equal ▸ selected - -noncomputable def groundTaskTransport (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := - taskTransportGraph G (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A - -theorem literalTask_transport_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e a c base s F label δ c' s' : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hδ : δ ∈ G) - (ht : literalTaskCode a c base s F label ∈ M.groundEligibleTasks P G r μ A Labels) - (target : ZFSet.pair (ZFSet.pair δ c) c' ∈ A) - (separator : ZFSet.pair (ZFSet.pair δ s) s' ∈ A) : - literalTaskCode a c' (actionPostcompose P A δ base) s' (actionImage P A δ F) label ∈ - M.groundEligibleTasks P G r μ A Labels := by - have old := (M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels a c base s F label).1 ht - exact (M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels a c' - (actionPostcompose P A δ base) s' (actionImage P A δ F) label).2 - ⟨old.1, M.actionPostcompose_mem pairing unions powers separation hP hA (M.transitive hG hδ) old.2.1, - M.actionImage_mem separation hP hA (M.transitive hG hδ) old.2.2.1, - old.2.2.2.transport group action meet hδ target separator⟩ - -theorem groundTaskTransport_total - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) : - ∀ δ ∈ G, ∀ t ∈ M.groundEligibleTasks P G r μ A Labels, - ∃ t' ∈ M.groundEligibleTasks P G r μ A Labels, - TaskTransportCode P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A δ t t' := by - intro δ hδ t ht - obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, equal, _⟩ := - (mem_eligibleTaskSet P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels t).1 ht - subst t - obtain ⟨c', target, _⟩ := action.function.2 (ZFSet.pair δ c) (ZFSet.pair_mem_prod.2 ⟨hδ, hc⟩) - obtain ⟨s', separator, _⟩ := action.function.2 (ZFSet.pair δ s) (ZFSet.pair_mem_prod.2 ⟨hδ, hs⟩) - have newTask := M.literalTask_transport_mem pairing unions powers separation hP hG hA - group action meet hδ ht target separator - have fields := (literalTaskCode_mem_eligibleTaskSet P G r μ A - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels a c' - (actionPostcompose P A δ base) s' (actionImage P A δ F) label).1 newTask - exact ⟨_, newTask, a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, - c', fields.2.1, actionPostcompose P A δ base, fields.2.2.1, - s', fields.2.2.2.1, actionImage P A δ F, fields.2.2.2.2.1, - rfl, rfl, target, separator, rfl, rfl⟩ - -theorem groundTaskTransport_function - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) : - ZFSet.IsFunc (ZFSet.prod G (M.groundEligibleTasks P G r μ A Labels)) - (M.groundEligibleTasks P G r μ A Labels) (M.groundTaskTransport P G r μ A Labels) := - taskTransportGraph_function action - (M.groundTaskTransport_total pairing unions powers separation hP hG hA group action meet) - -theorem groundTaskTransport_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (meet : MeetOrderCode P r μ) : - M.groundTaskTransport P G r μ A Labels ∈ M.sets := - M.taskTransportGraph_mem pairing unions powers separation hG - (M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) - hP (M.groundRelations_mem pairing unions powers separation hP hP) - (M.groundMeetFilters_mem powers separation hP hr hμ meet) hLabels hA - -theorem groundTaskTransport_one {P G r μ A Labels m e : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (he : e ∈ G) : - ∀ t ∈ M.groundEligibleTasks P G r μ A Labels, - ZFSet.pair (ZFSet.pair e t) t ∈ M.groundTaskTransport P G r μ A Labels := - taskTransportGraph_one action he - (fun base hbase => ((M.mem_groundRelations P P base).1 hbase).2) - (fun F hF => ((M.mem_groundMeetFilters P r μ F).1 hF).2.subset) - (eligibleTaskSet_subset P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - -theorem groundTaskTransport_mul {P G r μ A Labels m e g h k t t' t'' : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) - (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) - (first : ZFSet.pair (ZFSet.pair h t) t' ∈ M.groundTaskTransport P G r μ A Labels) - (second : ZFSet.pair (ZFSet.pair g t') t'' ∈ M.groundTaskTransport P G r μ A Labels) : - ZFSet.pair (ZFSet.pair k t) t'' ∈ M.groundTaskTransport P G r μ A Labels := - taskTransportGraph_mul action - (fun F hF => ((M.mem_groundMeetFilters P r μ F).1 hF).2.subset) hg hh hk product first second - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def indexedTaskActionGraph (G I P N T : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ g ∈ G, ∃ i ∈ I, ∃ j ∈ I, ∃ q ∈ P, - z = ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q) ∧ - ZFSet.pair (ZFSet.pair g i) j ∈ T) - (ZFSet.prod (ZFSet.prod G N) N) - -theorem indexedTaskActionGraph_subset (G I P N T : ZFSet.{u}) : - indexedTaskActionGraph G I P N T ⊆ ZFSet.prod (ZFSet.prod G N) N := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_indexedTaskActionGraph (G I P N T z : ZFSet.{u}) : - z ∈ indexedTaskActionGraph G I P N T ↔ - ∃ g ∈ G, ∃ i ∈ I, ∃ j ∈ I, ∃ q ∈ P, - ZFSet.pair i q ∈ N ∧ ZFSet.pair j q ∈ N ∧ - z = ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q) ∧ - ZFSet.pair (ZFSet.pair g i) j ∈ T := by - constructor - · intro hz - obtain ⟨bound, g, hg, i, hi, j, hj, q, hq, rfl, entry⟩ := ZFSet.mem_sep.1 hz - have outer := ZFSet.pair_mem_prod.1 bound - exact ⟨g, hg, i, hi, j, hj, q, hq, (ZFSet.pair_mem_prod.1 outer.1).2, - outer.2, rfl, entry⟩ - · rintro ⟨g, hg, i, hi, j, hj, q, hq, source, target, rfl, entry⟩ - exact ZFSet.mem_sep.2 - ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, source⟩, target⟩, - g, hg, i, hi, j, hj, q, hq, rfl, entry⟩ - -theorem triple_mem_indexedTaskActionGraph (G I P N T g x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g x) y ∈ indexedTaskActionGraph G I P N T ↔ - g ∈ G ∧ x ∈ N ∧ y ∈ N ∧ ∃ i ∈ I, ∃ j ∈ I, ∃ q ∈ P, - x = ZFSet.pair i q ∧ y = ZFSet.pair j q ∧ ZFSet.pair (ZFSet.pair g i) j ∈ T := by - rw [mem_indexedTaskActionGraph] - constructor - · rintro ⟨a, ha, i, hi, j, hj, q, hq, source, target, equal, entry⟩ - obtain ⟨first, last⟩ := ZFSet.pair_inj.1 equal - obtain ⟨actor, middle⟩ := ZFSet.pair_inj.1 first - subst a x y - exact ⟨ha, source, target, i, hi, j, hj, q, hq, rfl, rfl, entry⟩ - · rintro ⟨hg, source, target, i, hi, j, hj, q, hq, rfl, rfl, entry⟩ - exact ⟨g, hg, i, hi, j, hj, q, hq, source, target, rfl, entry⟩ - -theorem indexedTaskActionGraph_entry_iff (G I P N T g i j q q' : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q') ∈ - indexedTaskActionGraph G I P N T ↔ - g ∈ G ∧ i ∈ I ∧ j ∈ I ∧ q ∈ P ∧ q' = q ∧ - ZFSet.pair i q ∈ N ∧ ZFSet.pair j q ∈ N ∧ ZFSet.pair (ZFSet.pair g i) j ∈ T := by - rw [triple_mem_indexedTaskActionGraph] - constructor - · rintro ⟨hg, source, target, a, ha, b, hb, t, ht, first, second, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second - exact ⟨hg, ha, hb, ht, rfl, source, target, entry⟩ - · rintro ⟨hg, hi, hj, hq, rfl, source, target, entry⟩ - exact ⟨hg, source, target, i, hi, j, hj, _, hq, rfl, rfl, entry⟩ - -theorem indexedTaskActionGraph_function {G I P N T : ZFSet.{u}} - (task : ZFSet.IsFunc (ZFSet.prod G I) I T) (shape : N ⊆ ZFSet.prod I P) - (closed : ∀ g ∈ G, ∀ i ∈ I, ∀ j ∈ I, ∀ q ∈ P, - ZFSet.pair i q ∈ N → ZFSet.pair (ZFSet.pair g i) j ∈ T → ZFSet.pair j q ∈ N) : - ZFSet.IsFunc (ZFSet.prod G N) N (indexedTaskActionGraph G I P N T) := by - refine ⟨indexedTaskActionGraph_subset G I P N T, ?_⟩ - intro v hv - obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hv - obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (shape hx) - obtain ⟨j, entry, unique⟩ := task.2 (ZFSet.pair g i) (ZFSet.pair_mem_prod.2 ⟨hg, hi⟩) - have hj := (ZFSet.pair_mem_prod.1 (task.1 entry)).2 - refine ⟨ZFSet.pair j q, (indexedTaskActionGraph_entry_iff G I P N T g i j q q).2 - ⟨hg, hi, hj, hq, rfl, hx, closed g hg i hi j hj q hq hx entry, entry⟩, ?_⟩ - intro y hy - obtain ⟨_, _, _, a, _, b, _, t, _, first, second, other⟩ := - (triple_mem_indexedTaskActionGraph G I P N T g (ZFSet.pair i q) y).1 hy - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first - exact second.trans (congrArg (fun k => ZFSet.pair k q) (unique b other)) - -theorem indexedTaskActionGraph_setAction {G I P N T m e : ZFSet.{u}} - (task : SetActionCode G I m e T) (shape : N ⊆ ZFSet.prod I P) - (closed : ∀ g ∈ G, ∀ i ∈ I, ∀ j ∈ I, ∀ q ∈ P, - ZFSet.pair i q ∈ N → ZFSet.pair (ZFSet.pair g i) j ∈ T → ZFSet.pair j q ∈ N) : - SetActionCode G N m e (indexedTaskActionGraph G I P N T) := by - refine ⟨indexedTaskActionGraph_function task.function shape closed, ?_, ?_⟩ - · intro x hx - obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (shape hx) - have identity := task.one i hi - have he := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (task.function.1 identity)).1).1 - exact (indexedTaskActionGraph_entry_iff G I P N T e i i q q).2 - ⟨he, hi, hi, hq, rfl, hx, hx, identity⟩ - · intro g hg h hh k hk x hx y hy z hz product first second - obtain ⟨_, _, _, i, hi, j, hj, q, hq, xEq, yEq, firstTask⟩ := - (triple_mem_indexedTaskActionGraph G I P N T h x y).1 first - obtain ⟨_, _, _, j', hj', l, hl, q', hq', yEq', zEq, secondTask⟩ := - (triple_mem_indexedTaskActionGraph G I P N T g y z).1 second - have equal := ZFSet.pair_inj.1 (yEq.symm.trans yEq') - obtain ⟨rfl, rfl⟩ := equal - exact (triple_mem_indexedTaskActionGraph G I P N T k x z).2 - ⟨hk, hx, hz, i, hi, l, hl, _, hq, xEq, zEq, - task.mul g hg h hh k hk i hi _ hj l hl product firstTask secondTask⟩ - -theorem constantTemplateFresh_subset (I P r anchors : ZFSet.{u}) : - indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) anchors ⊆ - ZFSet.prod I P := by - intro z hz - obtain ⟨i, hi, q, rfl, Q, r', a, space, _, _, hq, _⟩ := - (mem_indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) anchors z).1 hz - have equal := ((pair_mem_constantFamilyGraph I P i Q).1 space).2 - exact ZFSet.pair_mem_prod.2 ⟨hi, equal ▸ hq⟩ - -namespace TransitiveGround - -open SetFormula - -noncomputable def groundEligibleFreshAction (M : TransitiveGround.{u}) - (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) - indexedTaskActionGraph G I P N (M.groundTaskTransport P G r μ A Labels) - -theorem groundTaskTransport_setAction (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) : - SetActionCode G (M.groundEligibleTasks P G r μ A Labels) m e - (M.groundTaskTransport P G r μ A Labels) := by - refine ⟨M.groundTaskTransport_function pairing unions powers separation hP hG hA group action meet, - M.groundTaskTransport_one action group.identity_mem, ?_⟩ - intro g hg h hh k hk _ _ _ _ _ _ product first second - exact M.groundTaskTransport_mul action hg hh hk product first second - -theorem groundEligibleFreshAction_setAction (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) - SetActionCode G N m e (M.groundEligibleFreshAction P G r μ A Labels) := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - apply indexedTaskActionGraph_setAction - (M.groundTaskTransport_setAction pairing unions powers separation hP hG hA group action meet) - (constantTemplateFresh_subset I P r (literalTaskSourceGraph I P R U Labels)) - intro g _ i hi j hj q _ fresh entry - have transported := ((triple_mem_taskTransportGraph G I P R U Labels A g i j).1 entry).2.2.2 - exact (transported.fresh_iff hi hj).1 fresh - -end TransitiveGround - - - - - - -def ActionAgreementBelow (P r A g h v : ZFSet.{u}) : Prop := - ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x v ∈ r → - (ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair h x) y ∈ A) - -namespace ActionAgreementBelow - -variable {P r A g h v : ZFSet.{u}} -variable (agree : ActionAgreementBelow P r A g h v) -include agree - -theorem symm : ActionAgreementBelow P r A h g v := - fun x hx y hy lower => (agree x hx y hy lower).symm - -theorem entry_eq {G m e x y z : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (hh : h ∈ G) (hx : x ∈ P) - (lower : ZFSet.pair x v ∈ r) - (first : ZFSet.pair (ZFSet.pair g x) y ∈ A) - (second : ZFSet.pair (ZFSet.pair h x) z ∈ A) : y = z := by - have hy := (ZFSet.pair_mem_prod.1 (action.function.1 first)).2 - have shared := (agree x hx y hy lower).1 first - obtain ⟨w, _, unique⟩ := action.function.2 (ZFSet.pair h x) (ZFSet.pair_mem_prod.2 ⟨hh, hx⟩) - exact (unique y shared).trans (unique z second).symm - -theorem image_subset {G m inv e μ F : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) - (filter : MeetFilterCode P r μ F) (positive : v ∈ F) : - actionImage P A g F ⊆ actionImage P A h F := by - intro y hy - obtain ⟨hyP, x, hx, image⟩ := (mem_actionImage P A g F y).1 hy - obtain ⟨w, entry, _⟩ := meet.operation.2 (ZFSet.pair x v) - (ZFSet.pair_mem_prod.2 ⟨filter.subset hx, filter.subset positive⟩) - have hwF := filter.closed_meet x hx v positive w entry - have hwP := filter.subset hwF - obtain ⟨z, shared, _⟩ := action.function.2 (ZFSet.pair g w) (ZFSet.pair_mem_prod.2 ⟨hg, hwP⟩) - have hzP := (ZFSet.pair_mem_prod.1 (action.function.1 shared)).2 - have shared' := (agree w hwP z hzP (meet.lower_right x v w entry)).1 shared - have hzF : z ∈ actionImage P A h F := (mem_actionImage P A h F z).2 ⟨hzP, w, hwF, shared'⟩ - have lower := action.monotone g hg w hwP x (filter.subset hx) z hzP y hyP - shared image (meet.lower_left x v w entry) - exact (actionImage_filter group action meet hh filter).upward z hzF y hyP lower - -theorem actionImage_eq {G m inv e μ F : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) - (filter : MeetFilterCode P r μ F) (positive : v ∈ F) : - actionImage P A g F = actionImage P A h F := by - apply ZFSet.ext - intro y - exact ⟨fun hy => agree.image_subset group action meet hg hh filter positive hy, - fun hy => agree.symm.image_subset group action meet hh hg filter positive hy⟩ - -theorem postcompose_eq {base : ZFSet.{u}} - (bound : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ base → ZFSet.pair y v ∈ r) : - actionPostcompose P A g base = actionPostcompose P A h base := by - have inclusion {b c : ZFSet.{u}} (same : ActionAgreementBelow P r A b c v) : - actionPostcompose P A b base ⊆ actionPostcompose P A c base := by - intro z hz - obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset P A b base hz) - obtain ⟨hx, hy, w, hw, entry, acted⟩ := (pair_mem_actionPostcompose P A b base x y).1 hz - exact (pair_mem_actionPostcompose P A c base x y).2 - ⟨hx, hy, w, hw, entry, (same w hw y hy (bound x hx w hw entry)).1 acted⟩ - apply ZFSet.ext - intro z - exact ⟨fun hz => inclusion agree hz, fun hz => inclusion agree.symm hz⟩ - -end ActionAgreementBelow - -theorem EligibleTaskCode.base_below_positive - {P G r μ A source target base separator F m e v x y : ZFSet.{u}} - (code : EligibleTaskCode P G r μ A source target base separator F) - (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) - (positive : v ∈ F) (entry : ZFSet.pair x y ∈ base) : ZFSet.pair y v ∈ r := by - obtain ⟨k, hk, represented⟩ := code.representative - have shape := ZFSet.pair_mem_prod.1 (represented.shape entry) - have lower := (represented.entries x shape.1 y shape.2).1 entry - have yt := action.monotone k hk x shape.1 source code.source_mem y shape.2 target code.target_mem - lower.2 represented.target_entry lower.1 - exact order.trans y shape.2 separator code.separator_mem v (code.filter.subset positive) - (order.trans y shape.2 target code.target_mem separator code.separator_mem yt code.lower) - (code.upper v positive) - -theorem TaskTransportCode.literal_outputs - {P R U Labels A g a c base s F label t' : ZFSet.{u}} - (transport : TaskTransportCode P R U Labels A g (literalTaskCode a c base s F label) t') : - ∃ c' ∈ P, ∃ base' ∈ R, ∃ s' ∈ P, ∃ F' ∈ U, - t' = literalTaskCode a c' base' s' F' label ∧ - ZFSet.pair (ZFSet.pair g c) c' ∈ A ∧ ZFSet.pair (ZFSet.pair g s) s' ∈ A ∧ - base' = actionPostcompose P A g base ∧ F' = actionImage P A g F := by - obtain ⟨a₀, _, c₀, _, b₀, _, s₀, _, F₀, _, l₀, _, - c', hc', b', hb', s', hs', F', hF', old, new, target, separator, baseEq, filterEq⟩ := transport - obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := literalTaskCode_inj.1 old - exact ⟨c', hc', b', hb', s', hs', F', hF', new, target, separator, baseEq, filterEq⟩ - -theorem TaskTransportCode.positive_agreement - {P G r μ A R U Labels m inv e g h v a c base s F label t' t'' : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) - (code : EligibleTaskCode P G r μ A a c base s F) - (agree : ActionAgreementBelow P r A g h v) (positive : v ∈ F) - (first : TaskTransportCode P R U Labels A g (literalTaskCode a c base s F label) t') - (second : TaskTransportCode P R U Labels A h (literalTaskCode a c base s F label) t'') : t' = t'' := by - obtain ⟨c', _, base', _, s', _, F', _, new, target, separator, baseEq, filterEq⟩ := first.literal_outputs - obtain ⟨c'', _, base'', _, s'', _, F'', _, new', target', separator', baseEq', filterEq'⟩ := second.literal_outputs - have sv := code.upper v positive - have cv := meet.order.trans c code.target_mem s code.separator_mem v (code.filter.subset positive) code.lower sv - have sameC := agree.entry_eq action hh code.target_mem cv target target' - have sameS := agree.entry_eq action hh code.separator_mem sv separator separator' - have sameBase : base' = base'' := baseEq.trans ((agree.postcompose_eq - (fun _ _ _ _ entry => code.base_below_positive action meet.order positive entry)).trans baseEq'.symm) - have sameFilter : F' = F'' := filterEq.trans - ((agree.actionImage_eq group action meet hg hh code.filter positive).trans filterEq'.symm) - rw [new, new', sameC, sameS, sameBase, sameFilter] - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem groundTaskTransport_positive_agreement - {P G r μ A Labels m inv e g h v a c base s F label t' t'' : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (agree : ActionAgreementBelow P r A g h v) (positive : v ∈ F) - (first : ZFSet.pair (ZFSet.pair g (literalTaskCode a c base s F label)) t' ∈ - M.groundTaskTransport P G r μ A Labels) - (second : ZFSet.pair (ZFSet.pair h (literalTaskCode a c base s F label)) t'' ∈ - M.groundTaskTransport P G r μ A Labels) : t' = t'' := by - have parts := (triple_mem_taskTransportGraph G (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A g _ t').1 first - have parts' := (triple_mem_taskTransportGraph G (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A h _ t'').1 second - have code := ((M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels a c base s F label).1 parts.2.1).2.2.2 - exact TaskTransportCode.positive_agreement group action meet parts.1 parts'.1 code agree positive - parts.2.2.2 parts'.2.2.2 - -end TransitiveGround - - - - - - -namespace BoundedFormula - -open SetFormula - -def indexedTaskActionEntryFormula {n} (z G I P T : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ.succ.succ - exMem G (exMem I.succ (exMem I.succ.succ (exMem P.succ.succ.succ - (.conj (nestedActionTripleFormula (lift z) 3 2 0 1 0) - (tripleMembershipFormula 3 2 1 (lift T)))))) - -theorem truth_indexedTaskActionEntryFormula {n} (z G I P T : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (indexedTaskActionEntryFormula z G I P T) env ↔ - ∃ g ∈ env G, ∃ i ∈ env I, ∃ j ∈ env I, ∃ q ∈ env P, - env z = ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q) ∧ - ZFSet.pair (ZFSet.pair g i) j ∈ env T := by - simp only [indexedTaskActionEntryFormula, truth_exMem, Truth, - truth_nestedActionTripleFormula, truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem indexedTaskActionGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G I P N T : ZFSet.{u}} (hG : G ∈ M.sets) (hI : I ∈ M.sets) - (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hT : T ∈ M.sets) : - indexedTaskActionGraph G I P N T ∈ M.sets := by - let params := extend G (extend I (extend P (extend T Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedTaskActionEntryFormula 0 1 2 3 4) params - (Fin.cases hG (Fin.cases hI (Fin.cases hP (Fin.cases hT (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hG hN) hN) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedTaskActionEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod (ZFSet.prod G N) N) = indexedTaskActionGraph G I P N T := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedTaskActionGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_indexedTaskActionEntryFormula 0 1 2 3 4 _) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) - -noncomputable abbrev nextFreshSet := - indexedAttachmentFresh h.nextIndices (pairSecondField I J h.nextIndices Qs) - (pairSecondField I J h.nextIndices rs) (pairSecondField I J h.nextIndices As) - -noncomputable def nextIndexAction (T : ZFSet.{u}) := - indexedTaskActionGraph G I J h.nextIndices T - -noncomputable def nextFreshAction (T : ZFSet.{u}) := - indexedTaskActionGraph G h.nextIndices (familyPointBound Qs) h.nextFreshSet (h.nextIndexAction T) - -noncomputable def nextActionGraph (T : ZFSet.{u}) := - taggedActionGraph G d.batchCarrier h.nextFreshSet A (h.nextFreshAction T) - -theorem nextFreshSet_shape : h.nextFreshSet ⊆ ZFSet.prod h.nextIndices (familyPointBound Qs) := by - intro z fresh - obtain ⟨i, _, j, _, q, rfl, index, oldFresh⟩ := recursiveFresh_shape - (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs) fresh - have bounds := ZFSet.pair_mem_prod.1 (indexedAttachmentDomain_subset J Qs - (indexedAttachmentFresh_subset J Qs rs As oldFresh)) - exact ZFSet.pair_mem_prod.2 ⟨index, bounds.2⟩ - -variable {T : ZFSet.{u}} (task : SetActionCode G I m one T) -variable (sourceInvariant : ∀ g i j a b, ZFSet.pair (ZFSet.pair g i) j ∈ T → - ZFSet.pair i a ∈ Sources → ZFSet.pair j b ∈ Sources → a = b) - -include task sourceInvariant in -theorem nextIndices_closed {g i i' j : ZFSet.{u}} - (entry : ZFSet.pair (ZFSet.pair g i) i' ∈ T) - (index : ZFSet.pair i j ∈ h.nextIndices) : ZFSet.pair i' j ∈ h.nextIndices := by - have bounds := task.entry_shape entry - have hj := (ZFSet.pair_mem_prod.1 - (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs index)).2 - let a := h.source ⟨i, bounds.2.1⟩ - let b := h.source ⟨i', bounds.2.2⟩ - let f := d.filter ⟨j, hj⟩ - have equal : a.val = b.val := sourceInvariant g i i' a.val b.val entry - (h.source_entry ⟨i, bounds.2.1⟩) (h.source_entry ⟨i', bounds.2.2⟩) - have negative : a.val ∉ f := (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc - (h.source_entry ⟨i, bounds.2.1⟩) (d.filter_entry ⟨j, hj⟩)).1 index - exact (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc - (h.source_entry ⟨i', bounds.2.2⟩) (d.filter_entry ⟨j, hj⟩)).2 (equal ▸ negative) - -include task sourceInvariant in -theorem nextIndexAction_setAction : SetActionCode G h.nextIndices m one (h.nextIndexAction T) := - indexedTaskActionGraph_setAction task - (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs) - (fun _ _ _ _ _ _ _ _ index entry => h.nextIndices_closed task sourceInvariant entry index) - -include task sourceInvariant in -theorem nextFreshAction_setAction : SetActionCode G h.nextFreshSet m one (h.nextFreshAction T) := by - apply indexedTaskActionGraph_setAction (h.nextIndexAction_setAction task sourceInvariant) h.nextFreshSet_shape - intro g _ k _ k' hk' q _ fresh entry - obtain ⟨_, _, _, i, hi, i', hi', j, hj, rfl, rfl, _⟩ := - (triple_mem_indexedTaskActionGraph G I J h.nextIndices T g k k').1 entry - exact (recursiveFresh_iff hi' hj).2 ⟨hk', ((recursiveFresh_iff hi hj).1 fresh).2⟩ - -include task sourceInvariant in -theorem nextAction_setAction (M : TransitiveGround.{u}) (next : h.NextInputs M) : - SetActionCode G next.batchCarrier m one (h.nextActionGraph T) := - h.action.toSetAction.tagged (h.nextFreshAction_setAction task sourceInvariant) - -theorem nextAction_old_iff {g x y : ZFSet.{u}} (hx : x ∈ d.batchCarrier) : - ZFSet.pair (ZFSet.pair g x) y ∈ h.nextActionGraph T ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A := taggedActionGraph_old_iff hx - -include task sourceInvariant in -theorem nextAction_fresh_pair_iff {g q t : ZFSet.{u}} : - ZFSet.pair (ZFSet.pair g (ZFSet.pair d.batchCarrier q)) (ZFSet.pair d.batchCarrier t) ∈ - h.nextActionGraph T ↔ ZFSet.pair (ZFSet.pair g q) t ∈ h.nextFreshAction T := - taggedActionGraph_fresh_pair_iff h.action.toSetAction (h.nextFreshAction_setAction task sourceInvariant) - -include task in -theorem nextFreshAction_pair_iff {g i i' j q : ZFSet.{u}} - (source : ZFSet.pair (ZFSet.pair i j) q ∈ h.nextFreshSet) - (target : ZFSet.pair (ZFSet.pair i' j) q ∈ h.nextFreshSet) : - ZFSet.pair (ZFSet.pair g (ZFSet.pair (ZFSet.pair i j) q)) - (ZFSet.pair (ZFSet.pair i' j) q) ∈ h.nextFreshAction T ↔ - ZFSet.pair (ZFSet.pair g i) i' ∈ T := by - have sb := ZFSet.pair_mem_prod.1 (h.nextFreshSet_shape source) - have tb := ZFSet.pair_mem_prod.1 (h.nextFreshSet_shape target) - have si := ZFSet.pair_mem_prod.1 - (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs sb.1) - have ti := ZFSet.pair_mem_prod.1 - (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs tb.1) - rw [nextFreshAction, indexedTaskActionGraph_entry_iff, nextIndexAction, - indexedTaskActionGraph_entry_iff] - constructor - · exact fun entry => entry.2.2.2.2.2.2.2.2.2.2.2.2.2.2 - · intro entry - have hg := (task.entry_shape entry).1 - exact ⟨hg, sb.1, tb.1, sb.2, rfl, source, target, - hg, si.1, ti.1, si.2, rfl, sb.1, tb.1, entry⟩ - -include task sourceInvariant in -theorem nextFreshSet_closed {g i i' j q : ZFSet.{u}} - (entry : ZFSet.pair (ZFSet.pair g i) i' ∈ T) - (source : ZFSet.pair (ZFSet.pair i j) q ∈ h.nextFreshSet) : - ZFSet.pair (ZFSet.pair i' j) q ∈ h.nextFreshSet := by - have bounds := task.entry_shape entry - have index := (ZFSet.pair_mem_prod.1 (h.nextFreshSet_shape source)).1 - have hj := (ZFSet.pair_mem_prod.1 - (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs index)).2 - exact (recursiveFresh_iff bounds.2.2 hj).2 - ⟨h.nextIndices_closed task sourceInvariant entry index, - ((recursiveFresh_iff bounds.2.1 hj).1 source).2⟩ - -include task sourceInvariant in -theorem nextAction_fresh_entry {g i i' j q : ZFSet.{u}} - (entry : ZFSet.pair (ZFSet.pair g i) i' ∈ T) - (source : ZFSet.pair (ZFSet.pair i j) q ∈ h.nextFreshSet) : - ZFSet.pair (ZFSet.pair g (ZFSet.pair d.batchCarrier (ZFSet.pair (ZFSet.pair i j) q))) - (ZFSet.pair d.batchCarrier (ZFSet.pair (ZFSet.pair i' j) q)) ∈ h.nextActionGraph T := - (h.nextAction_fresh_pair_iff task sourceInvariant).2 - ((h.nextFreshAction_pair_iff task source - (h.nextFreshSet_closed task sourceInvariant entry source)).2 entry) - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - - - -namespace PartitionPilot.Forcing.PosetActionCode -universe u -variable {G P m one r A g v : ZFSet.{u}} - -theorem agreement_identity_iff_fixes (action : PosetActionCode G P m one r A) : - ActionAgreementBelow P r A g one v ↔ - ∀ x ∈ P, ZFSet.pair x v ∈ r → ZFSet.pair (ZFSet.pair g x) x ∈ A := by - constructor - · intro agree x hx lower - exact (agree x hx x hx lower).2 (action.one x hx) - · intro fixes x hx y _ lower - have fixed := fixes x hx lower - have identity := action.one x hx - have function : FunctionGraphOn (ZFSet.prod G P) A := ⟨P, action.function⟩ - exact ⟨fun entry => (function.unique entry fixed).symm ▸ identity, - fun entry => (function.unique entry identity).symm ▸ fixed⟩ - -end PartitionPilot.Forcing.PosetActionCode - - - -namespace PartitionPilot.Forcing.IdealEmbeddingCode -universe u -variable {P Q rP rQ μP μQ e G H mG mH oneG oneH A B : ZFSet.{u}} -variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) -variable (source : PosetActionCode G P mG oneG rP A) -variable (target : PosetActionCode H Q mH oneH rQ B) -include code source target - -theorem actionAgreementBelow {g h g' h' v v' : ZFSet.{u}} - (hg : g ∈ G) (hg' : g' ∈ H) (hh' : h' ∈ H) - (image : ZFSet.pair v v' ∈ e) - (agree : ActionAgreementBelow P rP A g h v) - (firstEquivariant : ∀ x ∈ P, ∀ y ∈ P, ∀ x' y', - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → - ZFSet.pair (ZFSet.pair g x) y ∈ A → ZFSet.pair (ZFSet.pair g' x') y' ∈ B) - (secondEquivariant : ∀ x ∈ P, ∀ y ∈ P, ∀ x' y', - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → - ZFSet.pair (ZFSet.pair h x) y ∈ A → ZFSet.pair (ZFSet.pair h' x') y' ∈ B) : - ActionAgreementBelow Q rQ B g' h' v' := by - intro x' hx' z _ lower - obtain ⟨x, hx, oldLower, xx'⟩ := code.ideal v v' x' image hx' lower - obtain ⟨y, gy, _⟩ := source.function.2 (ZFSet.pair g x) (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) - have hy := (ZFSet.pair_mem_prod.1 (source.function.1 gy)).2 - have hyAct := (agree x hx y hy oldLower).1 gy - obtain ⟨y', yy', _⟩ := code.injection.function.2 y hy - have first := firstEquivariant x hx y hy x' y' xx' yy' gy - have second := secondEquivariant x hx y hy x' y' xx' yy' hyAct - obtain ⟨a, _, uniqueFirst⟩ := target.function.2 (ZFSet.pair g' x') (ZFSet.pair_mem_prod.2 ⟨hg', hx'⟩) - obtain ⟨b, _, uniqueSecond⟩ := target.function.2 (ZFSet.pair h' x') (ZFSet.pair_mem_prod.2 ⟨hh', hx'⟩) - constructor - · intro entry - have equal : z = y' := (uniqueFirst z entry).trans (uniqueFirst y' first).symm - exact equal.symm ▸ second - · intro entry - have equal : z = y' := (uniqueSecond z entry).trans (uniqueSecond y' second).symm - exact equal.symm ▸ first - -end PartitionPilot.Forcing.IdealEmbeddingCode - - - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -open SetFormula -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) - -theorem nextIndices_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) : h.nextIndices ∈ M.sets := - M.recursiveAttachmentIndices_mem pairing unions powers separation hI hJ hD - (M.union_mem unions (M.union_mem unions hFs)) hSources hFs - -theorem nextFreshSet_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) : h.nextFreshSet ∈ M.sets := by - have hK := h.nextIndices_mem M pairing unions powers separation hI hJ hD hFs hSources - have field : ∀ F ∈ M.sets, pairSecondField I J h.nextIndices F ∈ M.sets := by - intro F hF - exact M.pairFieldGraph_mem pairing unions powers separation false hI hJ hK - (M.union_mem unions (M.union_mem unions hF)) hF - exact M.indexedAttachmentFresh_mem pairing unions powers separation hK - (field Qs hQs) (field rs hrs) (field As hAs) - -theorem nextIndexAction_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : h.nextIndexAction T ∈ M.sets := - M.indexedTaskActionGraph_mem pairing unions powers separation hG hI hJ - (h.nextIndices_mem M pairing unions powers separation hI hJ hD hFs hSources) hT - -theorem nextFreshAction_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : h.nextFreshAction T ∈ M.sets := - M.indexedTaskActionGraph_mem pairing unions powers separation hG - (h.nextIndices_mem M pairing unions powers separation hI hJ hD hFs hSources) - (M.familyPointBound_mem unions hQs) - (h.nextFreshSet_mem M pairing unions powers separation hI hJ hD hQs hrs hAs hFs hSources) - (h.nextIndexAction_mem M pairing unions powers separation hI hJ hD hFs hSources hG hT) - -theorem nextActionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hL : d.batchCarrier ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) - (hG : G ∈ M.sets) (hA : A ∈ M.sets) (hT : T ∈ M.sets) : - h.nextActionGraph T ∈ M.sets := - M.taggedActionGraph_mem pairing unions powers separation hG hL - (h.nextFreshSet_mem M pairing unions powers separation hI hJ hD hQs hrs hAs hFs hSources) hA - (h.nextFreshAction_mem M pairing unions powers separation hI hJ hD hQs hrs hAs hFs hSources hG hT) - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaskTransportFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.CodedRecursiveTaskActions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHeightPushforward + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem taskTransportGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G I P R U Labels A : ZFSet.{u}} (hG : G ∈ M.sets) (hI : I ∈ M.sets) + (hP : P ∈ M.sets) (hR : R ∈ M.sets) (hU : U ∈ M.sets) + (hLabels : Labels ∈ M.sets) (hA : A ∈ M.sets) : + taskTransportGraph G I P R U Labels A ∈ M.sets := by + let params := extend G (extend I (extend P (extend R (extend U (extend Labels (extend A Fin.elim0)))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.taskTransportEntryFormula 0 1 2 3 4 5 6 7) params + (Fin.cases hG (Fin.cases hI (Fin.cases hP (Fin.cases hR (Fin.cases hU + (Fin.cases hLabels (Fin.cases hA (fun i => Fin.elim0 i)))))))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hG hI) hI) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.taskTransportEntryFormula 0 1 2 3 4 5 6 7) (extend z params)) + (ZFSet.prod (ZFSet.prod G I) I) = taskTransportGraph G I P R U Labels A := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, taskTransportGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_taskTransportEntryFormula 0 1 2 3 4 5 6 7 _) + exact equal ▸ selected + +noncomputable def groundTaskTransport (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := + taskTransportGraph G (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A + +theorem literalTask_transport_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e a c base s F label δ c' s' : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hδ : δ ∈ G) + (ht : literalTaskCode a c base s F label ∈ M.groundEligibleTasks P G r μ A Labels) + (target : ZFSet.pair (ZFSet.pair δ c) c' ∈ A) + (separator : ZFSet.pair (ZFSet.pair δ s) s' ∈ A) : + literalTaskCode a c' (actionPostcompose P A δ base) s' (actionImage P A δ F) label ∈ + M.groundEligibleTasks P G r μ A Labels := by + have old := (M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels a c base s F label).1 ht + exact (M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels a c' + (actionPostcompose P A δ base) s' (actionImage P A δ F) label).2 + ⟨old.1, M.actionPostcompose_mem pairing unions powers separation hP hA (M.transitive hG hδ) old.2.1, + M.actionImage_mem separation hP hA (M.transitive hG hδ) old.2.2.1, + old.2.2.2.transport group action meet hδ target separator⟩ + +theorem groundTaskTransport_total + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) : + ∀ δ ∈ G, ∀ t ∈ M.groundEligibleTasks P G r μ A Labels, + ∃ t' ∈ M.groundEligibleTasks P G r μ A Labels, + TaskTransportCode P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A δ t t' := by + intro δ hδ t ht + obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, equal, _⟩ := + (mem_eligibleTaskSet P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels t).1 ht + subst t + obtain ⟨c', target, _⟩ := action.function.2 (ZFSet.pair δ c) (ZFSet.pair_mem_prod.2 ⟨hδ, hc⟩) + obtain ⟨s', separator, _⟩ := action.function.2 (ZFSet.pair δ s) (ZFSet.pair_mem_prod.2 ⟨hδ, hs⟩) + have newTask := M.literalTask_transport_mem pairing unions powers separation hP hG hA + group action meet hδ ht target separator + have fields := (literalTaskCode_mem_eligibleTaskSet P G r μ A + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels a c' + (actionPostcompose P A δ base) s' (actionImage P A δ F) label).1 newTask + exact ⟨_, newTask, a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, + c', fields.2.1, actionPostcompose P A δ base, fields.2.2.1, + s', fields.2.2.2.1, actionImage P A δ F, fields.2.2.2.2.1, + rfl, rfl, target, separator, rfl, rfl⟩ + +theorem groundTaskTransport_function + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) : + ZFSet.IsFunc (ZFSet.prod G (M.groundEligibleTasks P G r μ A Labels)) + (M.groundEligibleTasks P G r μ A Labels) (M.groundTaskTransport P G r μ A Labels) := + taskTransportGraph_function action + (M.groundTaskTransport_total pairing unions powers separation hP hG hA group action meet) + +theorem groundTaskTransport_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (meet : MeetOrderCode P r μ) : + M.groundTaskTransport P G r μ A Labels ∈ M.sets := + M.taskTransportGraph_mem pairing unions powers separation hG + (M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) + hP (M.groundRelations_mem pairing unions powers separation hP hP) + (M.groundMeetFilters_mem powers separation hP hr hμ meet) hLabels hA + +theorem groundTaskTransport_one {P G r μ A Labels m e : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (he : e ∈ G) : + ∀ t ∈ M.groundEligibleTasks P G r μ A Labels, + ZFSet.pair (ZFSet.pair e t) t ∈ M.groundTaskTransport P G r μ A Labels := + taskTransportGraph_one action he + (fun base hbase => ((M.mem_groundRelations P P base).1 hbase).2) + (fun F hF => ((M.mem_groundMeetFilters P r μ F).1 hF).2.subset) + (eligibleTaskSet_subset P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + +theorem groundTaskTransport_mul {P G r μ A Labels m e g h k t t' t'' : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) + (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) + (first : ZFSet.pair (ZFSet.pair h t) t' ∈ M.groundTaskTransport P G r μ A Labels) + (second : ZFSet.pair (ZFSet.pair g t') t'' ∈ M.groundTaskTransport P G r μ A Labels) : + ZFSet.pair (ZFSet.pair k t) t'' ∈ M.groundTaskTransport P G r μ A Labels := + taskTransportGraph_mul action + (fun F hF => ((M.mem_groundMeetFilters P r μ F).1 hF).2.subset) hg hh hk product first second + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def indexedTaskActionGraph (G I P N T : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ g ∈ G, ∃ i ∈ I, ∃ j ∈ I, ∃ q ∈ P, + z = ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q) ∧ + ZFSet.pair (ZFSet.pair g i) j ∈ T) + (ZFSet.prod (ZFSet.prod G N) N) + +theorem indexedTaskActionGraph_subset (G I P N T : ZFSet.{u}) : + indexedTaskActionGraph G I P N T ⊆ ZFSet.prod (ZFSet.prod G N) N := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_indexedTaskActionGraph (G I P N T z : ZFSet.{u}) : + z ∈ indexedTaskActionGraph G I P N T ↔ + ∃ g ∈ G, ∃ i ∈ I, ∃ j ∈ I, ∃ q ∈ P, + ZFSet.pair i q ∈ N ∧ ZFSet.pair j q ∈ N ∧ + z = ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q) ∧ + ZFSet.pair (ZFSet.pair g i) j ∈ T := by + constructor + · intro hz + obtain ⟨bound, g, hg, i, hi, j, hj, q, hq, rfl, entry⟩ := ZFSet.mem_sep.1 hz + have outer := ZFSet.pair_mem_prod.1 bound + exact ⟨g, hg, i, hi, j, hj, q, hq, (ZFSet.pair_mem_prod.1 outer.1).2, + outer.2, rfl, entry⟩ + · rintro ⟨g, hg, i, hi, j, hj, q, hq, source, target, rfl, entry⟩ + exact ZFSet.mem_sep.2 + ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, source⟩, target⟩, + g, hg, i, hi, j, hj, q, hq, rfl, entry⟩ + +theorem triple_mem_indexedTaskActionGraph (G I P N T g x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g x) y ∈ indexedTaskActionGraph G I P N T ↔ + g ∈ G ∧ x ∈ N ∧ y ∈ N ∧ ∃ i ∈ I, ∃ j ∈ I, ∃ q ∈ P, + x = ZFSet.pair i q ∧ y = ZFSet.pair j q ∧ ZFSet.pair (ZFSet.pair g i) j ∈ T := by + rw [mem_indexedTaskActionGraph] + constructor + · rintro ⟨a, ha, i, hi, j, hj, q, hq, source, target, equal, entry⟩ + obtain ⟨first, last⟩ := ZFSet.pair_inj.1 equal + obtain ⟨actor, middle⟩ := ZFSet.pair_inj.1 first + subst a x y + exact ⟨ha, source, target, i, hi, j, hj, q, hq, rfl, rfl, entry⟩ + · rintro ⟨hg, source, target, i, hi, j, hj, q, hq, rfl, rfl, entry⟩ + exact ⟨g, hg, i, hi, j, hj, q, hq, source, target, rfl, entry⟩ + +theorem indexedTaskActionGraph_entry_iff (G I P N T g i j q q' : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q') ∈ + indexedTaskActionGraph G I P N T ↔ + g ∈ G ∧ i ∈ I ∧ j ∈ I ∧ q ∈ P ∧ q' = q ∧ + ZFSet.pair i q ∈ N ∧ ZFSet.pair j q ∈ N ∧ ZFSet.pair (ZFSet.pair g i) j ∈ T := by + rw [triple_mem_indexedTaskActionGraph] + constructor + · rintro ⟨hg, source, target, a, ha, b, hb, t, ht, first, second, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second + exact ⟨hg, ha, hb, ht, rfl, source, target, entry⟩ + · rintro ⟨hg, hi, hj, hq, rfl, source, target, entry⟩ + exact ⟨hg, source, target, i, hi, j, hj, _, hq, rfl, rfl, entry⟩ + +theorem indexedTaskActionGraph_function {G I P N T : ZFSet.{u}} + (task : ZFSet.IsFunc (ZFSet.prod G I) I T) (shape : N ⊆ ZFSet.prod I P) + (closed : ∀ g ∈ G, ∀ i ∈ I, ∀ j ∈ I, ∀ q ∈ P, + ZFSet.pair i q ∈ N → ZFSet.pair (ZFSet.pair g i) j ∈ T → ZFSet.pair j q ∈ N) : + ZFSet.IsFunc (ZFSet.prod G N) N (indexedTaskActionGraph G I P N T) := by + refine ⟨indexedTaskActionGraph_subset G I P N T, ?_⟩ + intro v hv + obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hv + obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (shape hx) + obtain ⟨j, entry, unique⟩ := task.2 (ZFSet.pair g i) (ZFSet.pair_mem_prod.2 ⟨hg, hi⟩) + have hj := (ZFSet.pair_mem_prod.1 (task.1 entry)).2 + refine ⟨ZFSet.pair j q, (indexedTaskActionGraph_entry_iff G I P N T g i j q q).2 + ⟨hg, hi, hj, hq, rfl, hx, closed g hg i hi j hj q hq hx entry, entry⟩, ?_⟩ + intro y hy + obtain ⟨_, _, _, a, _, b, _, t, _, first, second, other⟩ := + (triple_mem_indexedTaskActionGraph G I P N T g (ZFSet.pair i q) y).1 hy + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first + exact second.trans (congrArg (fun k => ZFSet.pair k q) (unique b other)) + +theorem indexedTaskActionGraph_setAction {G I P N T m e : ZFSet.{u}} + (task : SetActionCode G I m e T) (shape : N ⊆ ZFSet.prod I P) + (closed : ∀ g ∈ G, ∀ i ∈ I, ∀ j ∈ I, ∀ q ∈ P, + ZFSet.pair i q ∈ N → ZFSet.pair (ZFSet.pair g i) j ∈ T → ZFSet.pair j q ∈ N) : + SetActionCode G N m e (indexedTaskActionGraph G I P N T) := by + refine ⟨indexedTaskActionGraph_function task.function shape closed, ?_, ?_⟩ + · intro x hx + obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (shape hx) + have identity := task.one i hi + have he := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (task.function.1 identity)).1).1 + exact (indexedTaskActionGraph_entry_iff G I P N T e i i q q).2 + ⟨he, hi, hi, hq, rfl, hx, hx, identity⟩ + · intro g hg h hh k hk x hx y hy z hz product first second + obtain ⟨_, _, _, i, hi, j, hj, q, hq, xEq, yEq, firstTask⟩ := + (triple_mem_indexedTaskActionGraph G I P N T h x y).1 first + obtain ⟨_, _, _, j', hj', l, hl, q', hq', yEq', zEq, secondTask⟩ := + (triple_mem_indexedTaskActionGraph G I P N T g y z).1 second + have equal := ZFSet.pair_inj.1 (yEq.symm.trans yEq') + obtain ⟨rfl, rfl⟩ := equal + exact (triple_mem_indexedTaskActionGraph G I P N T k x z).2 + ⟨hk, hx, hz, i, hi, l, hl, _, hq, xEq, zEq, + task.mul g hg h hh k hk i hi _ hj l hl product firstTask secondTask⟩ + +theorem constantTemplateFresh_subset (I P r anchors : ZFSet.{u}) : + indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) anchors ⊆ + ZFSet.prod I P := by + intro z hz + obtain ⟨i, hi, q, rfl, Q, r', a, space, _, _, hq, _⟩ := + (mem_indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) anchors z).1 hz + have equal := ((pair_mem_constantFamilyGraph I P i Q).1 space).2 + exact ZFSet.pair_mem_prod.2 ⟨hi, equal ▸ hq⟩ + +namespace TransitiveGround + +open SetFormula + +noncomputable def groundEligibleFreshAction (M : TransitiveGround.{u}) + (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) + indexedTaskActionGraph G I P N (M.groundTaskTransport P G r μ A Labels) + +theorem groundTaskTransport_setAction (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) : + SetActionCode G (M.groundEligibleTasks P G r μ A Labels) m e + (M.groundTaskTransport P G r μ A Labels) := by + refine ⟨M.groundTaskTransport_function pairing unions powers separation hP hG hA group action meet, + M.groundTaskTransport_one action group.identity_mem, ?_⟩ + intro g hg h hh k hk _ _ _ _ _ _ product first second + exact M.groundTaskTransport_mul action hg hh hk product first second + +theorem groundEligibleFreshAction_setAction (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) + SetActionCode G N m e (M.groundEligibleFreshAction P G r μ A Labels) := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + apply indexedTaskActionGraph_setAction + (M.groundTaskTransport_setAction pairing unions powers separation hP hG hA group action meet) + (constantTemplateFresh_subset I P r (literalTaskSourceGraph I P R U Labels)) + intro g _ i hi j hj q _ fresh entry + have transported := ((triple_mem_taskTransportGraph G I P R U Labels A g i j).1 entry).2.2.2 + exact (transported.fresh_iff hi hj).1 fresh + +end TransitiveGround + + + + + + +def ActionAgreementBelow (P r A g h v : ZFSet.{u}) : Prop := + ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x v ∈ r → + (ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair h x) y ∈ A) + +namespace ActionAgreementBelow + +variable {P r A g h v : ZFSet.{u}} +variable (agree : ActionAgreementBelow P r A g h v) +include agree + +theorem symm : ActionAgreementBelow P r A h g v := + fun x hx y hy lower => (agree x hx y hy lower).symm + +theorem entry_eq {G m e x y z : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (hh : h ∈ G) (hx : x ∈ P) + (lower : ZFSet.pair x v ∈ r) + (first : ZFSet.pair (ZFSet.pair g x) y ∈ A) + (second : ZFSet.pair (ZFSet.pair h x) z ∈ A) : y = z := by + have hy := (ZFSet.pair_mem_prod.1 (action.function.1 first)).2 + have shared := (agree x hx y hy lower).1 first + obtain ⟨w, _, unique⟩ := action.function.2 (ZFSet.pair h x) (ZFSet.pair_mem_prod.2 ⟨hh, hx⟩) + exact (unique y shared).trans (unique z second).symm + +theorem image_subset {G m inv e μ F : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) + (filter : MeetFilterCode P r μ F) (positive : v ∈ F) : + actionImage P A g F ⊆ actionImage P A h F := by + intro y hy + obtain ⟨hyP, x, hx, image⟩ := (mem_actionImage P A g F y).1 hy + obtain ⟨w, entry, _⟩ := meet.operation.2 (ZFSet.pair x v) + (ZFSet.pair_mem_prod.2 ⟨filter.subset hx, filter.subset positive⟩) + have hwF := filter.closed_meet x hx v positive w entry + have hwP := filter.subset hwF + obtain ⟨z, shared, _⟩ := action.function.2 (ZFSet.pair g w) (ZFSet.pair_mem_prod.2 ⟨hg, hwP⟩) + have hzP := (ZFSet.pair_mem_prod.1 (action.function.1 shared)).2 + have shared' := (agree w hwP z hzP (meet.lower_right x v w entry)).1 shared + have hzF : z ∈ actionImage P A h F := (mem_actionImage P A h F z).2 ⟨hzP, w, hwF, shared'⟩ + have lower := action.monotone g hg w hwP x (filter.subset hx) z hzP y hyP + shared image (meet.lower_left x v w entry) + exact (actionImage_filter group action meet hh filter).upward z hzF y hyP lower + +theorem actionImage_eq {G m inv e μ F : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) + (filter : MeetFilterCode P r μ F) (positive : v ∈ F) : + actionImage P A g F = actionImage P A h F := by + apply ZFSet.ext + intro y + exact ⟨fun hy => agree.image_subset group action meet hg hh filter positive hy, + fun hy => agree.symm.image_subset group action meet hh hg filter positive hy⟩ + +theorem postcompose_eq {base : ZFSet.{u}} + (bound : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ base → ZFSet.pair y v ∈ r) : + actionPostcompose P A g base = actionPostcompose P A h base := by + have inclusion {b c : ZFSet.{u}} (same : ActionAgreementBelow P r A b c v) : + actionPostcompose P A b base ⊆ actionPostcompose P A c base := by + intro z hz + obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (actionPostcompose_subset P A b base hz) + obtain ⟨hx, hy, w, hw, entry, acted⟩ := (pair_mem_actionPostcompose P A b base x y).1 hz + exact (pair_mem_actionPostcompose P A c base x y).2 + ⟨hx, hy, w, hw, entry, (same w hw y hy (bound x hx w hw entry)).1 acted⟩ + apply ZFSet.ext + intro z + exact ⟨fun hz => inclusion agree hz, fun hz => inclusion agree.symm hz⟩ + +end ActionAgreementBelow + +theorem EligibleTaskCode.base_below_positive + {P G r μ A source target base separator F m e v x y : ZFSet.{u}} + (code : EligibleTaskCode P G r μ A source target base separator F) + (action : PosetActionCode G P m e r A) (order : PartialOrderCode P r) + (positive : v ∈ F) (entry : ZFSet.pair x y ∈ base) : ZFSet.pair y v ∈ r := by + obtain ⟨k, hk, represented⟩ := code.representative + have shape := ZFSet.pair_mem_prod.1 (represented.shape entry) + have lower := (represented.entries x shape.1 y shape.2).1 entry + have yt := action.monotone k hk x shape.1 source code.source_mem y shape.2 target code.target_mem + lower.2 represented.target_entry lower.1 + exact order.trans y shape.2 separator code.separator_mem v (code.filter.subset positive) + (order.trans y shape.2 target code.target_mem separator code.separator_mem yt code.lower) + (code.upper v positive) + +theorem TaskTransportCode.literal_outputs + {P R U Labels A g a c base s F label t' : ZFSet.{u}} + (transport : TaskTransportCode P R U Labels A g (literalTaskCode a c base s F label) t') : + ∃ c' ∈ P, ∃ base' ∈ R, ∃ s' ∈ P, ∃ F' ∈ U, + t' = literalTaskCode a c' base' s' F' label ∧ + ZFSet.pair (ZFSet.pair g c) c' ∈ A ∧ ZFSet.pair (ZFSet.pair g s) s' ∈ A ∧ + base' = actionPostcompose P A g base ∧ F' = actionImage P A g F := by + obtain ⟨a₀, _, c₀, _, b₀, _, s₀, _, F₀, _, l₀, _, + c', hc', b', hb', s', hs', F', hF', old, new, target, separator, baseEq, filterEq⟩ := transport + obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := literalTaskCode_inj.1 old + exact ⟨c', hc', b', hb', s', hs', F', hF', new, target, separator, baseEq, filterEq⟩ + +theorem TaskTransportCode.positive_agreement + {P G r μ A R U Labels m inv e g h v a c base s F label t' t'' : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) + (code : EligibleTaskCode P G r μ A a c base s F) + (agree : ActionAgreementBelow P r A g h v) (positive : v ∈ F) + (first : TaskTransportCode P R U Labels A g (literalTaskCode a c base s F label) t') + (second : TaskTransportCode P R U Labels A h (literalTaskCode a c base s F label) t'') : t' = t'' := by + obtain ⟨c', _, base', _, s', _, F', _, new, target, separator, baseEq, filterEq⟩ := first.literal_outputs + obtain ⟨c'', _, base'', _, s'', _, F'', _, new', target', separator', baseEq', filterEq'⟩ := second.literal_outputs + have sv := code.upper v positive + have cv := meet.order.trans c code.target_mem s code.separator_mem v (code.filter.subset positive) code.lower sv + have sameC := agree.entry_eq action hh code.target_mem cv target target' + have sameS := agree.entry_eq action hh code.separator_mem sv separator separator' + have sameBase : base' = base'' := baseEq.trans ((agree.postcompose_eq + (fun _ _ _ _ entry => code.base_below_positive action meet.order positive entry)).trans baseEq'.symm) + have sameFilter : F' = F'' := filterEq.trans + ((agree.actionImage_eq group action meet hg hh code.filter positive).trans filterEq'.symm) + rw [new, new', sameC, sameS, sameBase, sameFilter] + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem groundTaskTransport_positive_agreement + {P G r μ A Labels m inv e g h v a c base s F label t' t'' : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (agree : ActionAgreementBelow P r A g h v) (positive : v ∈ F) + (first : ZFSet.pair (ZFSet.pair g (literalTaskCode a c base s F label)) t' ∈ + M.groundTaskTransport P G r μ A Labels) + (second : ZFSet.pair (ZFSet.pair h (literalTaskCode a c base s F label)) t'' ∈ + M.groundTaskTransport P G r μ A Labels) : t' = t'' := by + have parts := (triple_mem_taskTransportGraph G (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A g _ t').1 first + have parts' := (triple_mem_taskTransportGraph G (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels A h _ t'').1 second + have code := ((M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels a c base s F label).1 parts.2.1).2.2.2 + exact TaskTransportCode.positive_agreement group action meet parts.1 parts'.1 code agree positive + parts.2.2.2 parts'.2.2.2 + +end TransitiveGround + + + + + + +namespace BoundedFormula + +open SetFormula + +def indexedTaskActionEntryFormula {n} (z G I P T : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ.succ.succ + exMem G (exMem I.succ (exMem I.succ.succ (exMem P.succ.succ.succ + (.conj (nestedActionTripleFormula (lift z) 3 2 0 1 0) + (tripleMembershipFormula 3 2 1 (lift T)))))) + +theorem truth_indexedTaskActionEntryFormula {n} (z G I P T : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (indexedTaskActionEntryFormula z G I P T) env ↔ + ∃ g ∈ env G, ∃ i ∈ env I, ∃ j ∈ env I, ∃ q ∈ env P, + env z = ZFSet.pair (ZFSet.pair g (ZFSet.pair i q)) (ZFSet.pair j q) ∧ + ZFSet.pair (ZFSet.pair g i) j ∈ env T := by + simp only [indexedTaskActionEntryFormula, truth_exMem, Truth, + truth_nestedActionTripleFormula, truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem indexedTaskActionGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G I P N T : ZFSet.{u}} (hG : G ∈ M.sets) (hI : I ∈ M.sets) + (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hT : T ∈ M.sets) : + indexedTaskActionGraph G I P N T ∈ M.sets := by + let params := extend G (extend I (extend P (extend T Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedTaskActionEntryFormula 0 1 2 3 4) params + (Fin.cases hG (Fin.cases hI (Fin.cases hP (Fin.cases hT (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hG hN) hN) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedTaskActionEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod (ZFSet.prod G N) N) = indexedTaskActionGraph G I P N T := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedTaskActionGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_indexedTaskActionEntryFormula 0 1 2 3 4 _) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) + +noncomputable abbrev nextFreshSet := + indexedAttachmentFresh h.nextIndices (pairSecondField I J h.nextIndices Qs) + (pairSecondField I J h.nextIndices rs) (pairSecondField I J h.nextIndices As) + +noncomputable def nextIndexAction (T : ZFSet.{u}) := + indexedTaskActionGraph G I J h.nextIndices T + +noncomputable def nextFreshAction (T : ZFSet.{u}) := + indexedTaskActionGraph G h.nextIndices (familyPointBound Qs) h.nextFreshSet (h.nextIndexAction T) + +noncomputable def nextActionGraph (T : ZFSet.{u}) := + taggedActionGraph G d.batchCarrier h.nextFreshSet A (h.nextFreshAction T) + +theorem nextFreshSet_shape : h.nextFreshSet ⊆ ZFSet.prod h.nextIndices (familyPointBound Qs) := by + intro z fresh + obtain ⟨i, _, j, _, q, rfl, index, oldFresh⟩ := recursiveFresh_shape + (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs) fresh + have bounds := ZFSet.pair_mem_prod.1 (indexedAttachmentDomain_subset J Qs + (indexedAttachmentFresh_subset J Qs rs As oldFresh)) + exact ZFSet.pair_mem_prod.2 ⟨index, bounds.2⟩ + +variable {T : ZFSet.{u}} (task : SetActionCode G I m one T) +variable (sourceInvariant : ∀ g i j a b, ZFSet.pair (ZFSet.pair g i) j ∈ T → + ZFSet.pair i a ∈ Sources → ZFSet.pair j b ∈ Sources → a = b) + +include task sourceInvariant in +theorem nextIndices_closed {g i i' j : ZFSet.{u}} + (entry : ZFSet.pair (ZFSet.pair g i) i' ∈ T) + (index : ZFSet.pair i j ∈ h.nextIndices) : ZFSet.pair i' j ∈ h.nextIndices := by + have bounds := task.entry_shape entry + have hj := (ZFSet.pair_mem_prod.1 + (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs index)).2 + let a := h.source ⟨i, bounds.2.1⟩ + let b := h.source ⟨i', bounds.2.2⟩ + let f := d.filter ⟨j, hj⟩ + have equal : a.val = b.val := sourceInvariant g i i' a.val b.val entry + (h.source_entry ⟨i, bounds.2.1⟩) (h.source_entry ⟨i', bounds.2.2⟩) + have negative : a.val ∉ f := (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc + (h.source_entry ⟨i, bounds.2.1⟩) (d.filter_entry ⟨j, hj⟩)).1 index + exact (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc + (h.source_entry ⟨i', bounds.2.2⟩) (d.filter_entry ⟨j, hj⟩)).2 (equal ▸ negative) + +include task sourceInvariant in +theorem nextIndexAction_setAction : SetActionCode G h.nextIndices m one (h.nextIndexAction T) := + indexedTaskActionGraph_setAction task + (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs) + (fun _ _ _ _ _ _ _ _ index entry => h.nextIndices_closed task sourceInvariant entry index) + +include task sourceInvariant in +theorem nextFreshAction_setAction : SetActionCode G h.nextFreshSet m one (h.nextFreshAction T) := by + apply indexedTaskActionGraph_setAction (h.nextIndexAction_setAction task sourceInvariant) h.nextFreshSet_shape + intro g _ k _ k' hk' q _ fresh entry + obtain ⟨_, _, _, i, hi, i', hi', j, hj, rfl, rfl, _⟩ := + (triple_mem_indexedTaskActionGraph G I J h.nextIndices T g k k').1 entry + exact (recursiveFresh_iff hi' hj).2 ⟨hk', ((recursiveFresh_iff hi hj).1 fresh).2⟩ + +include task sourceInvariant in +theorem nextAction_setAction (M : TransitiveGround.{u}) (next : h.NextInputs M) : + SetActionCode G next.batchCarrier m one (h.nextActionGraph T) := + h.action.toSetAction.tagged (h.nextFreshAction_setAction task sourceInvariant) + +theorem nextAction_old_iff {g x y : ZFSet.{u}} (hx : x ∈ d.batchCarrier) : + ZFSet.pair (ZFSet.pair g x) y ∈ h.nextActionGraph T ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A := taggedActionGraph_old_iff hx + +include task sourceInvariant in +theorem nextAction_fresh_pair_iff {g q t : ZFSet.{u}} : + ZFSet.pair (ZFSet.pair g (ZFSet.pair d.batchCarrier q)) (ZFSet.pair d.batchCarrier t) ∈ + h.nextActionGraph T ↔ ZFSet.pair (ZFSet.pair g q) t ∈ h.nextFreshAction T := + taggedActionGraph_fresh_pair_iff h.action.toSetAction (h.nextFreshAction_setAction task sourceInvariant) + +include task in +theorem nextFreshAction_pair_iff {g i i' j q : ZFSet.{u}} + (source : ZFSet.pair (ZFSet.pair i j) q ∈ h.nextFreshSet) + (target : ZFSet.pair (ZFSet.pair i' j) q ∈ h.nextFreshSet) : + ZFSet.pair (ZFSet.pair g (ZFSet.pair (ZFSet.pair i j) q)) + (ZFSet.pair (ZFSet.pair i' j) q) ∈ h.nextFreshAction T ↔ + ZFSet.pair (ZFSet.pair g i) i' ∈ T := by + have sb := ZFSet.pair_mem_prod.1 (h.nextFreshSet_shape source) + have tb := ZFSet.pair_mem_prod.1 (h.nextFreshSet_shape target) + have si := ZFSet.pair_mem_prod.1 + (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs sb.1) + have ti := ZFSet.pair_mem_prod.1 + (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs tb.1) + rw [nextFreshAction, indexedTaskActionGraph_entry_iff, nextIndexAction, + indexedTaskActionGraph_entry_iff] + constructor + · exact fun entry => entry.2.2.2.2.2.2.2.2.2.2.2.2.2.2 + · intro entry + have hg := (task.entry_shape entry).1 + exact ⟨hg, sb.1, tb.1, sb.2, rfl, source, target, + hg, si.1, ti.1, si.2, rfl, sb.1, tb.1, entry⟩ + +include task sourceInvariant in +theorem nextFreshSet_closed {g i i' j q : ZFSet.{u}} + (entry : ZFSet.pair (ZFSet.pair g i) i' ∈ T) + (source : ZFSet.pair (ZFSet.pair i j) q ∈ h.nextFreshSet) : + ZFSet.pair (ZFSet.pair i' j) q ∈ h.nextFreshSet := by + have bounds := task.entry_shape entry + have index := (ZFSet.pair_mem_prod.1 (h.nextFreshSet_shape source)).1 + have hj := (ZFSet.pair_mem_prod.1 + (recursiveAttachmentIndices_subset I J D (⋃₀ ⋃₀ Fs) Sources Fs index)).2 + exact (recursiveFresh_iff bounds.2.2 hj).2 + ⟨h.nextIndices_closed task sourceInvariant entry index, + ((recursiveFresh_iff bounds.2.1 hj).1 source).2⟩ + +include task sourceInvariant in +theorem nextAction_fresh_entry {g i i' j q : ZFSet.{u}} + (entry : ZFSet.pair (ZFSet.pair g i) i' ∈ T) + (source : ZFSet.pair (ZFSet.pair i j) q ∈ h.nextFreshSet) : + ZFSet.pair (ZFSet.pair g (ZFSet.pair d.batchCarrier (ZFSet.pair (ZFSet.pair i j) q))) + (ZFSet.pair d.batchCarrier (ZFSet.pair (ZFSet.pair i' j) q)) ∈ h.nextActionGraph T := + (h.nextAction_fresh_pair_iff task sourceInvariant).2 + ((h.nextFreshAction_pair_iff task source + (h.nextFreshSet_closed task sourceInvariant entry source)).2 entry) + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + + + +namespace PartitionPilot.Forcing.PosetActionCode +universe u +variable {G P m one r A g v : ZFSet.{u}} + +theorem agreement_identity_iff_fixes (action : PosetActionCode G P m one r A) : + ActionAgreementBelow P r A g one v ↔ + ∀ x ∈ P, ZFSet.pair x v ∈ r → ZFSet.pair (ZFSet.pair g x) x ∈ A := by + constructor + · intro agree x hx lower + exact (agree x hx x hx lower).2 (action.one x hx) + · intro fixes x hx y _ lower + have fixed := fixes x hx lower + have identity := action.one x hx + have function : FunctionGraphOn (ZFSet.prod G P) A := ⟨P, action.function⟩ + exact ⟨fun entry => (function.unique entry fixed).symm ▸ identity, + fun entry => (function.unique entry identity).symm ▸ fixed⟩ + +end PartitionPilot.Forcing.PosetActionCode + + + +namespace PartitionPilot.Forcing.IdealEmbeddingCode +universe u +variable {P Q rP rQ μP μQ e G H mG mH oneG oneH A B : ZFSet.{u}} +variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) +variable (source : PosetActionCode G P mG oneG rP A) +variable (target : PosetActionCode H Q mH oneH rQ B) +include code source target + +theorem actionAgreementBelow {g h g' h' v v' : ZFSet.{u}} + (hg : g ∈ G) (hg' : g' ∈ H) (hh' : h' ∈ H) + (image : ZFSet.pair v v' ∈ e) + (agree : ActionAgreementBelow P rP A g h v) + (firstEquivariant : ∀ x ∈ P, ∀ y ∈ P, ∀ x' y', + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → + ZFSet.pair (ZFSet.pair g x) y ∈ A → ZFSet.pair (ZFSet.pair g' x') y' ∈ B) + (secondEquivariant : ∀ x ∈ P, ∀ y ∈ P, ∀ x' y', + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → + ZFSet.pair (ZFSet.pair h x) y ∈ A → ZFSet.pair (ZFSet.pair h' x') y' ∈ B) : + ActionAgreementBelow Q rQ B g' h' v' := by + intro x' hx' z _ lower + obtain ⟨x, hx, oldLower, xx'⟩ := code.ideal v v' x' image hx' lower + obtain ⟨y, gy, _⟩ := source.function.2 (ZFSet.pair g x) (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) + have hy := (ZFSet.pair_mem_prod.1 (source.function.1 gy)).2 + have hyAct := (agree x hx y hy oldLower).1 gy + obtain ⟨y', yy', _⟩ := code.injection.function.2 y hy + have first := firstEquivariant x hx y hy x' y' xx' yy' gy + have second := secondEquivariant x hx y hy x' y' xx' yy' hyAct + obtain ⟨a, _, uniqueFirst⟩ := target.function.2 (ZFSet.pair g' x') (ZFSet.pair_mem_prod.2 ⟨hg', hx'⟩) + obtain ⟨b, _, uniqueSecond⟩ := target.function.2 (ZFSet.pair h' x') (ZFSet.pair_mem_prod.2 ⟨hh', hx'⟩) + constructor + · intro entry + have equal : z = y' := (uniqueFirst z entry).trans (uniqueFirst y' first).symm + exact equal.symm ▸ second + · intro entry + have equal : z = y' := (uniqueSecond z entry).trans (uniqueSecond y' second).symm + exact equal.symm ▸ first + +end PartitionPilot.Forcing.IdealEmbeddingCode + + + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +open SetFormula +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) + +theorem nextIndices_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) : h.nextIndices ∈ M.sets := + M.recursiveAttachmentIndices_mem pairing unions powers separation hI hJ hD + (M.union_mem unions (M.union_mem unions hFs)) hSources hFs + +theorem nextFreshSet_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) : h.nextFreshSet ∈ M.sets := by + have hK := h.nextIndices_mem M pairing unions powers separation hI hJ hD hFs hSources + have field : ∀ F ∈ M.sets, pairSecondField I J h.nextIndices F ∈ M.sets := by + intro F hF + exact M.pairFieldGraph_mem pairing unions powers separation false hI hJ hK + (M.union_mem unions (M.union_mem unions hF)) hF + exact M.indexedAttachmentFresh_mem pairing unions powers separation hK + (field Qs hQs) (field rs hrs) (field As hAs) + +theorem nextIndexAction_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : h.nextIndexAction T ∈ M.sets := + M.indexedTaskActionGraph_mem pairing unions powers separation hG hI hJ + (h.nextIndices_mem M pairing unions powers separation hI hJ hD hFs hSources) hT + +theorem nextFreshAction_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : h.nextFreshAction T ∈ M.sets := + M.indexedTaskActionGraph_mem pairing unions powers separation hG + (h.nextIndices_mem M pairing unions powers separation hI hJ hD hFs hSources) + (M.familyPointBound_mem unions hQs) + (h.nextFreshSet_mem M pairing unions powers separation hI hJ hD hQs hrs hAs hFs hSources) + (h.nextIndexAction_mem M pairing unions powers separation hI hJ hD hFs hSources hG hT) + +theorem nextActionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hL : d.batchCarrier ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hFs : Fs ∈ M.sets) (hSources : Sources ∈ M.sets) + (hG : G ∈ M.sets) (hA : A ∈ M.sets) (hT : T ∈ M.sets) : + h.nextActionGraph T ∈ M.sets := + M.taggedActionGraph_mem pairing unions powers separation hG hL + (h.nextFreshSet_mem M pairing unions powers separation hI hJ hD hQs hrs hAs hFs hSources) hA + (h.nextFreshAction_mem M pairing unions powers separation hI hJ hD hQs hrs hAs hFs hSources hG hT) + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveRowNameActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveRowNameActions.lean index d1fa09bbc3a90b96a3553ea993c8de3acd829918..768883a62be00458f5e23b7f058fc00c66147dc4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveRowNameActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRecursiveRowNameActions.lean @@ -1,184 +1,184 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions - -namespace OAI - -namespace PartitionPilot.Forcing -universe u - -theorem stageOneRawTests_empty (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) - (lower : ZFSet.{u}) : stageOneRawTests M d ∅ lower := - ⟨fun _ _ _ _ _ _ member => False.elim (ZFSet.notMem_empty _ member), - fun _ _ _ _ _ _ _ _ _ _ member _ => False.elim (ZFSet.notMem_empty _ member)⟩ - -theorem assignmentCut_empty_data (levels alpha : ZFSet.{u}) : assignmentCut levels alpha ∅ = ∅ := - assignmentCut_eq_of_lower (fun z member => False.elim (ZFSet.notMem_empty z member)) - -namespace RecursiveRefinementDataHistory -variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} - -theorem empty_assignments (run : RecursiveRefinementDataHistory M rows T stages history) - (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) - {row : ZFSet.{u}} (hrow : row ∈ rows) : - ZFSet.pair row ∅ ∈ M.refinementHistoryForcing rows T stages history := by - induction stages using ZFSet.inductionOn generalizing history with - | h stages ih => - apply (M.mem_refinementHistoryForcing rows T stages history _).2 - refine ⟨M.stageOneCandidateBound_empty hRows hrow, ?_⟩ - intro beta hbeta - obtain ⟨code, entry⟩ := run.data.function.total hbeta - obtain ⟨d, rfl⟩ := run.data.decoded beta code entry - refine ⟨refinementFormulaDataCode d, entry, ?_⟩ - rw [packedSuccessorConditionCode_code_iff, stageTwoConditionCode_pair_iff, assignmentCut_empty_data] - have earlierOrdinal := ordinalSetProperty_member ordinal hbeta - have earlier := ih beta hbeta (run.restrict earlierOrdinal (ordinal.1 beta hbeta)) earlierOrdinal - exact ⟨(run.carrier beta d entry).symm ▸ earlier, stageOneRawTests_empty M d _⟩ - -end RecursiveRefinementDataHistory - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) -variable {T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) -variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) -local notation "Q" => M.refinementHistoryForcing c.carrier T stages history -local notation "pres" => SetMembers.presentation Q - -noncomputable def refinementHistoryRowInclusion (p : R) : SetMembers Q := - SetMembers.ofMem (ZFSet.pair (c.encode p) ∅) - (run.empty_assignments ordinal carrier (c.encode_mem p)) - -local notation "incl" => M.refinementHistoryRowInclusion c run ordinal carrier - -theorem refinementHistoryRowInclusion_encode (p : R) : - (pres).encode (incl p) = c.pairEmpty.encode p := - SetMembers.raw_ofMem _ _ - -noncomputable def refinementHistoryRowNameLift (tau : Name c.pairEmpty) : Name (pres) := - Name.rename (pres) incl tau - -local notation "liftName" => M.refinementHistoryRowNameLift c run ordinal carrier -include run ordinal carrier - -theorem refinementHistoryRowNameLift_val (tau : Name c.pairEmpty) : - (liftName tau).val = tau.val := - Name.rename_val_of_encode (pres) incl - (M.refinementHistoryRowInclusion_encode c run ordinal carrier) tau - -theorem refinementHistoryRowNameFamily_valid (X : ZFSet.{u}) - (valid : ∀ z ∈ X, IsName c.pairEmpty z) : - ∀ z ∈ X, IsName (pres) z := by - intro z hz - have lifted := (liftName ⟨z, valid z hz⟩).property - exact (congrArg (IsName (pres)) - (M.refinementHistoryRowNameLift_val c run ordinal carrier ⟨z, valid z hz⟩)).mp lifted - -theorem refinementHistoryRowNameFamily_eq (X : ZFSet.{u}) - (valid : ∀ z ∈ X, IsName c.pairEmpty z) : - Name.renamedFamily (pres) incl X valid = X := by - apply ZFSet.ext - intro z - rw [Name.mem_renamedFamily] - constructor - · rintro ⟨tau, member, equal⟩ - have codes := M.refinementHistoryRowNameLift_val c run ordinal carrier tau - exact (equal.trans codes).symm ▸ member - · intro member - exact ⟨⟨z, valid z member⟩, member, - (M.refinementHistoryRowNameLift_val c run ordinal carrier ⟨z, valid z member⟩).symm⟩ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) -variable {T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) -variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) -local notation "Q" => M.refinementHistoryForcing c.carrier T stages history -local notation "pres" => SetMembers.presentation Q -local notation "incl" => M.refinementHistoryRowInclusion c run ordinal carrier -local notation "liftName" => M.refinementHistoryRowNameLift c run ordinal carrier -variable {G : Type v} [Group G] [PartialOrder R] -variable [PartialOrder (SetMembers (M.refinementHistoryForcing c.carrier T stages history))] -variable (a : PosetAction G R) -variable (e : PosetAction G (SetMembers (M.refinementHistoryForcing c.carrier T stages history))) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (coordinates : ∀ (g : G) - (q : SetMembers (M.refinementHistoryForcing c.carrier T stages history)) (row : R) (A : ZFSet.{u}), - SetMembers.raw q = ZFSet.pair (c.encode row) A → - SetMembers.raw (e.iso g q) = ZFSet.pair (c.encode (a.iso g row)) (image g A)) -variable (emptyImage : ∀ g, image g ∅ = ∅) -include run ordinal carrier coordinates emptyImage - -theorem refinementHistoryRowInclusion_equivariant (g : G) (p : R) : - e.iso g (incl p) = incl (a.iso g p) := by - apply SetMembers.raw_injective Q - have encoded := M.refinementHistoryRowInclusion_encode c run ordinal carrier p - change SetMembers.raw (incl p) = ZFSet.pair (c.encode p) ∅ at encoded - rw [coordinates g (incl p) p ∅ encoded, emptyImage] - exact (M.refinementHistoryRowInclusion_encode c run ordinal carrier (a.iso g p)).symm - -theorem refinementHistoryRowNameLift_act (g : G) (tau : Name c.pairEmpty) : - e.act (pres) g (liftName tau) = liftName (a.act c.pairEmpty g tau) := - a.act_rename_of_equivariant e c.pairEmpty (pres) incl - (fun g p => (M.refinementHistoryRowInclusion_equivariant c run ordinal carrier - a e image coordinates emptyImage g p).symm) g tau - -theorem refinementHistoryRowNameLift_stabilizer (tau : Name c.pairEmpty) : - e.stabilizer (pres) (liftName tau) = a.stabilizer c.pairEmpty tau := by - apply Subgroup.ext - intro g - change e.act (pres) g (liftName tau) = liftName tau ↔ a.act c.pairEmpty g tau = tau - rw [M.refinementHistoryRowNameLift_act c run ordinal carrier a e image coordinates emptyImage] - constructor - · intro equal - apply Subtype.ext - have codes := congrArg Subtype.val equal - simpa only [M.refinementHistoryRowNameLift_val c run ordinal carrier] using codes - · intro equal - exact congrArg liftName equal - -theorem refinementHistoryRowNameLift_supported (K : Subgroup G) (tau : Name c.pairEmpty) - (supported : K ≤ a.stabilizer c.pairEmpty tau) : - K ≤ e.stabilizer (pres) (liftName tau) := by - rw [M.refinementHistoryRowNameLift_stabilizer c run ordinal carrier a e image coordinates emptyImage] - exact supported - -theorem refinementHistoryRowNameLift_hs (F : NormalSubgroupFamily G) (tau : Name c.pairEmpty) - (hs : HereditarilySymmetric a c.pairEmpty F tau) : - HereditarilySymmetric e (pres) F (liftName tau) := - hs.rename e (pres) incl - (fun g p => (M.refinementHistoryRowInclusion_equivariant c run ordinal carrier - a e image coordinates emptyImage g p).symm) - -theorem refinementHistoryRowNameFamily_transport (F : NormalSubgroupFamily G) (X : ZFSet.{u}) - (valid : ∀ z ∈ X, IsName c.pairEmpty z) - (closed : ∀ g (tau : Name c.pairEmpty), tau.val ∈ X → (a.act c.pairEmpty g tau).val ∈ X) - (symmetric : ∀ tau : Name c.pairEmpty, tau.val ∈ X → HereditarilySymmetric a c.pairEmpty F tau) : - (∀ z ∈ X, IsName (pres) z) ∧ - (∀ g (tau : Name (pres)), tau.val ∈ X → (e.act (pres) g tau).val ∈ X) ∧ - (∀ tau : Name (pres), tau.val ∈ X → HereditarilySymmetric e (pres) F tau) := by - refine ⟨M.refinementHistoryRowNameFamily_valid c run ordinal carrier X valid, ?_, ?_⟩ - · intro g tau member - let sigma : Name c.pairEmpty := ⟨tau.val, valid tau.val member⟩ - have same : liftName sigma = tau := Subtype.ext - (M.refinementHistoryRowNameLift_val c run ordinal carrier sigma) - rw [← same, M.refinementHistoryRowNameLift_act c run ordinal carrier a e image coordinates emptyImage, - M.refinementHistoryRowNameLift_val c run ordinal carrier] - exact closed g sigma member - · intro tau member - let sigma : Name c.pairEmpty := ⟨tau.val, valid tau.val member⟩ - have same : liftName sigma = tau := Subtype.ext - (M.refinementHistoryRowNameLift_val c run ordinal carrier sigma) - rw [← same] - exact M.refinementHistoryRowNameLift_hs c run ordinal carrier a e image coordinates emptyImage - F sigma (symmetric sigma member) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions + +namespace OAI + +namespace PartitionPilot.Forcing +universe u + +theorem stageOneRawTests_empty (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) + (lower : ZFSet.{u}) : stageOneRawTests M d ∅ lower := + ⟨fun _ _ _ _ _ _ member => False.elim (ZFSet.notMem_empty _ member), + fun _ _ _ _ _ _ _ _ _ _ member _ => False.elim (ZFSet.notMem_empty _ member)⟩ + +theorem assignmentCut_empty_data (levels alpha : ZFSet.{u}) : assignmentCut levels alpha ∅ = ∅ := + assignmentCut_eq_of_lower (fun z member => False.elim (ZFSet.notMem_empty z member)) + +namespace RecursiveRefinementDataHistory +variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} + +theorem empty_assignments (run : RecursiveRefinementDataHistory M rows T stages history) + (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) + {row : ZFSet.{u}} (hrow : row ∈ rows) : + ZFSet.pair row ∅ ∈ M.refinementHistoryForcing rows T stages history := by + induction stages using ZFSet.inductionOn generalizing history with + | h stages ih => + apply (M.mem_refinementHistoryForcing rows T stages history _).2 + refine ⟨M.stageOneCandidateBound_empty hRows hrow, ?_⟩ + intro beta hbeta + obtain ⟨code, entry⟩ := run.data.function.total hbeta + obtain ⟨d, rfl⟩ := run.data.decoded beta code entry + refine ⟨refinementFormulaDataCode d, entry, ?_⟩ + rw [packedSuccessorConditionCode_code_iff, stageTwoConditionCode_pair_iff, assignmentCut_empty_data] + have earlierOrdinal := ordinalSetProperty_member ordinal hbeta + have earlier := ih beta hbeta (run.restrict earlierOrdinal (ordinal.1 beta hbeta)) earlierOrdinal + exact ⟨(run.carrier beta d entry).symm ▸ earlier, stageOneRawTests_empty M d _⟩ + +end RecursiveRefinementDataHistory + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) +variable {T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) +variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) +local notation "Q" => M.refinementHistoryForcing c.carrier T stages history +local notation "pres" => SetMembers.presentation Q + +noncomputable def refinementHistoryRowInclusion (p : R) : SetMembers Q := + SetMembers.ofMem (ZFSet.pair (c.encode p) ∅) + (run.empty_assignments ordinal carrier (c.encode_mem p)) + +local notation "incl" => M.refinementHistoryRowInclusion c run ordinal carrier + +theorem refinementHistoryRowInclusion_encode (p : R) : + (pres).encode (incl p) = c.pairEmpty.encode p := + SetMembers.raw_ofMem _ _ + +noncomputable def refinementHistoryRowNameLift (tau : Name c.pairEmpty) : Name (pres) := + Name.rename (pres) incl tau + +local notation "liftName" => M.refinementHistoryRowNameLift c run ordinal carrier +include run ordinal carrier + +theorem refinementHistoryRowNameLift_val (tau : Name c.pairEmpty) : + (liftName tau).val = tau.val := + Name.rename_val_of_encode (pres) incl + (M.refinementHistoryRowInclusion_encode c run ordinal carrier) tau + +theorem refinementHistoryRowNameFamily_valid (X : ZFSet.{u}) + (valid : ∀ z ∈ X, IsName c.pairEmpty z) : + ∀ z ∈ X, IsName (pres) z := by + intro z hz + have lifted := (liftName ⟨z, valid z hz⟩).property + exact (congrArg (IsName (pres)) + (M.refinementHistoryRowNameLift_val c run ordinal carrier ⟨z, valid z hz⟩)).mp lifted + +theorem refinementHistoryRowNameFamily_eq (X : ZFSet.{u}) + (valid : ∀ z ∈ X, IsName c.pairEmpty z) : + Name.renamedFamily (pres) incl X valid = X := by + apply ZFSet.ext + intro z + rw [Name.mem_renamedFamily] + constructor + · rintro ⟨tau, member, equal⟩ + have codes := M.refinementHistoryRowNameLift_val c run ordinal carrier tau + exact (equal.trans codes).symm ▸ member + · intro member + exact ⟨⟨z, valid z member⟩, member, + (M.refinementHistoryRowNameLift_val c run ordinal carrier ⟨z, valid z member⟩).symm⟩ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) +variable {T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) +variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) +local notation "Q" => M.refinementHistoryForcing c.carrier T stages history +local notation "pres" => SetMembers.presentation Q +local notation "incl" => M.refinementHistoryRowInclusion c run ordinal carrier +local notation "liftName" => M.refinementHistoryRowNameLift c run ordinal carrier +variable {G : Type v} [Group G] [PartialOrder R] +variable [PartialOrder (SetMembers (M.refinementHistoryForcing c.carrier T stages history))] +variable (a : PosetAction G R) +variable (e : PosetAction G (SetMembers (M.refinementHistoryForcing c.carrier T stages history))) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (coordinates : ∀ (g : G) + (q : SetMembers (M.refinementHistoryForcing c.carrier T stages history)) (row : R) (A : ZFSet.{u}), + SetMembers.raw q = ZFSet.pair (c.encode row) A → + SetMembers.raw (e.iso g q) = ZFSet.pair (c.encode (a.iso g row)) (image g A)) +variable (emptyImage : ∀ g, image g ∅ = ∅) +include run ordinal carrier coordinates emptyImage + +theorem refinementHistoryRowInclusion_equivariant (g : G) (p : R) : + e.iso g (incl p) = incl (a.iso g p) := by + apply SetMembers.raw_injective Q + have encoded := M.refinementHistoryRowInclusion_encode c run ordinal carrier p + change SetMembers.raw (incl p) = ZFSet.pair (c.encode p) ∅ at encoded + rw [coordinates g (incl p) p ∅ encoded, emptyImage] + exact (M.refinementHistoryRowInclusion_encode c run ordinal carrier (a.iso g p)).symm + +theorem refinementHistoryRowNameLift_act (g : G) (tau : Name c.pairEmpty) : + e.act (pres) g (liftName tau) = liftName (a.act c.pairEmpty g tau) := + a.act_rename_of_equivariant e c.pairEmpty (pres) incl + (fun g p => (M.refinementHistoryRowInclusion_equivariant c run ordinal carrier + a e image coordinates emptyImage g p).symm) g tau + +theorem refinementHistoryRowNameLift_stabilizer (tau : Name c.pairEmpty) : + e.stabilizer (pres) (liftName tau) = a.stabilizer c.pairEmpty tau := by + apply Subgroup.ext + intro g + change e.act (pres) g (liftName tau) = liftName tau ↔ a.act c.pairEmpty g tau = tau + rw [M.refinementHistoryRowNameLift_act c run ordinal carrier a e image coordinates emptyImage] + constructor + · intro equal + apply Subtype.ext + have codes := congrArg Subtype.val equal + simpa only [M.refinementHistoryRowNameLift_val c run ordinal carrier] using codes + · intro equal + exact congrArg liftName equal + +theorem refinementHistoryRowNameLift_supported (K : Subgroup G) (tau : Name c.pairEmpty) + (supported : K ≤ a.stabilizer c.pairEmpty tau) : + K ≤ e.stabilizer (pres) (liftName tau) := by + rw [M.refinementHistoryRowNameLift_stabilizer c run ordinal carrier a e image coordinates emptyImage] + exact supported + +theorem refinementHistoryRowNameLift_hs (F : NormalSubgroupFamily G) (tau : Name c.pairEmpty) + (hs : HereditarilySymmetric a c.pairEmpty F tau) : + HereditarilySymmetric e (pres) F (liftName tau) := + hs.rename e (pres) incl + (fun g p => (M.refinementHistoryRowInclusion_equivariant c run ordinal carrier + a e image coordinates emptyImage g p).symm) + +theorem refinementHistoryRowNameFamily_transport (F : NormalSubgroupFamily G) (X : ZFSet.{u}) + (valid : ∀ z ∈ X, IsName c.pairEmpty z) + (closed : ∀ g (tau : Name c.pairEmpty), tau.val ∈ X → (a.act c.pairEmpty g tau).val ∈ X) + (symmetric : ∀ tau : Name c.pairEmpty, tau.val ∈ X → HereditarilySymmetric a c.pairEmpty F tau) : + (∀ z ∈ X, IsName (pres) z) ∧ + (∀ g (tau : Name (pres)), tau.val ∈ X → (e.act (pres) g tau).val ∈ X) ∧ + (∀ tau : Name (pres), tau.val ∈ X → HereditarilySymmetric e (pres) F tau) := by + refine ⟨M.refinementHistoryRowNameFamily_valid c run ordinal carrier X valid, ?_, ?_⟩ + · intro g tau member + let sigma : Name c.pairEmpty := ⟨tau.val, valid tau.val member⟩ + have same : liftName sigma = tau := Subtype.ext + (M.refinementHistoryRowNameLift_val c run ordinal carrier sigma) + rw [← same, M.refinementHistoryRowNameLift_act c run ordinal carrier a e image coordinates emptyImage, + M.refinementHistoryRowNameLift_val c run ordinal carrier] + exact closed g sigma member + · intro tau member + let sigma : Name c.pairEmpty := ⟨tau.val, valid tau.val member⟩ + have same : liftName sigma = tau := Subtype.ext + (M.refinementHistoryRowNameLift_val c run ordinal carrier sigma) + rw [← same] + exact M.refinementHistoryRowNameLift_hs c run ordinal carrier a e image coordinates emptyImage + F sigma (symmetric sigma member) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentActionFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentActionFamilies.lean index 27049c6d4c8cad645b57c71d18962e8758b761c8..e39bc2465ce4ba5222af15c68c4db8f34fd35528 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentActionFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentActionFamilies.lean @@ -1,757 +1,757 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRelationProductFamilies -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementIndexActionFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceRefinementIndexActionLaws - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) - -theorem realize_refinementIndexActionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (level : ZFSet.{u}) (hl : level ∈ M.sets) (g : G) (C E C' E' : L) - (U Rf Rc U' Rf' Rc' : (M.nameDomain s).names) : - Realize M.sets (refinementIndexActionFormula 0 1 2 3 4 5) - ![refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val, - refinementIndexCode level (b.encode C') (b.encode E') U'.val.val Rf'.val.val Rc'.val.val, - t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ - d.iso g C = C' ∧ d.iso g E = E' ∧ a.act s g U.val = U'.val ∧ - a.act s g Rf.val = Rf'.val ∧ a.act s g Rc.val = Rc'.val := by - let oldFields : Fin 6 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] - let newFields : Fin 6 → ZFSet.{u} := ![level, b.encode C', b.encode E', U'.val.val, Rf'.val.val, Rc'.val.val] - have groundNodes (c : L) := M.transitive nodes (b.encode_mem c) - have oldGround : ∀ j, oldFields j ∈ M.sets := - Fin.cases hl (Fin.cases (groundNodes C) (Fin.cases (groundNodes E) - (Fin.cases U.property (Fin.cases Rf.property (Fin.cases Rc.property (fun j => Fin.elim0 j)))))) - have newGround : ∀ j, newFields j ∈ M.sets := - Fin.cases hl (Fin.cases (groundNodes C') (Fin.cases (groundNodes E') - (Fin.cases U'.property (Fin.cases Rf'.property (Fin.cases Rc'.property (fun j => Fin.elim0 j)))))) - let env : Fin 6 → ZFSet.{u} := ![nonemptyTupleCode 5 oldFields, nonemptyTupleCode 5 newFields, - t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] - have envGround : ∀ j, env j ∈ M.sets := - Fin.cases (M.nonemptyTupleCode_mem pairing 5 oldFields oldGround) - (Fin.cases (M.nonemptyTupleCode_mem pairing 5 newFields newGround) - (Fin.cases (M.transitive group (t.encode_mem g)) (Fin.cases carrier - (Fin.cases maps (Fin.cases nodeMaps (fun j => Fin.elim0 j)))))) - change Realize M.sets (refinementIndexActionFormula 0 1 2 3 4 5) env ↔ _ - rw [refinementIndexActionFormula, realize_exBlock] - have raw (w : Fin 13 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) := - M.realize_refinementIndexActionRawFormula pairing - (suffixIndex 6 13 0) (suffixIndex 6 13 1) (suffixIndex 6 13 2) - (suffixIndex 6 13 3) (suffixIndex 6 13 4) (suffixIndex 6 13 5) - (prefixIndex 6 13) (extendMany 13 w env) (extendMany_members 13 w env ground envGround) - simp only [extendMany_prefix, extendMany_suffix] at raw - constructor - · rintro ⟨w, ground, formula⟩ - obtain ⟨oldEq, newEq, _, nodeEntry, ce, ee, ue, fe, re⟩ := (raw w ground).1 formula - have oldAt (j : Fin 6) : w (j.castAdd 7) = oldFields j := - (congrFun (nonemptyTupleCode_injective 5 oldEq) j).symm - have newAt (j : Fin 6) : w ((Fin.natAdd 6 j).castAdd 1) = newFields j := - (congrFun (nonemptyTupleCode_injective 5 newEq) j).symm - have graphEq := (d.pair_mem_conditionMapFamily b t g (w 12)).1 nodeEntry - have cEq : w 1 = b.encode C := oldAt 1 - have eEq : w 2 = b.encode E := oldAt 2 - have uEq : w 3 = U.val.val := oldAt 3 - have fEq : w 4 = Rf.val.val := oldAt 4 - have rEq : w 5 = Rc.val.val := oldAt 5 - have cEq' : w 7 = b.encode C' := newAt 1 - have eEq' : w 8 = b.encode E' := newAt 2 - have uEq' : w 9 = U'.val.val := newAt 3 - have fEq' : w 10 = Rf'.val.val := newAt 4 - have rEq' : w 11 = Rc'.val.val := newAt 5 - rw [cEq, cEq', graphEq] at ce - rw [eEq, eEq', graphEq] at ee - rw [uEq, uEq'] at ue - rw [fEq, fEq'] at fe - rw [rEq, rEq'] at re - exact ⟨(b.pair_mem_graph b (d.iso g) C C').1 ce, - (b.pair_mem_graph b (d.iso g) E E').1 ee, - (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g U.val U'.val U.property U'.property).1 ue, - (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g Rf.val Rf'.val Rf.property Rf'.property).1 fe, - (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g Rc.val Rc'.val Rc.property Rc'.property).1 re⟩ - · rintro ⟨ce, ee, ue, fe, re⟩ - let w : Fin 13 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val, - level, b.encode C', b.encode E', U'.val.val, Rf'.val.val, Rc'.val.val, b.graph b (d.iso g)] - have ground : ∀ j, w j ∈ M.sets := - Fin.cases hl (Fin.cases (groundNodes C) (Fin.cases (groundNodes E) - (Fin.cases U.property (Fin.cases Rf.property (Fin.cases Rc.property - (Fin.cases hl (Fin.cases (groundNodes C') (Fin.cases (groundNodes E') - (Fin.cases U'.property (Fin.cases Rf'.property (Fin.cases Rc'.property - (Fin.cases (M.conditionMap_graph_mem d b t nodeMaps g) (fun j => Fin.elim0 j))))))))))))) - refine ⟨w, ground, (raw w ground).2 ⟨?_, ?_, rfl, - (d.pair_mem_conditionMapFamily b t g _).2 rfl, - (b.pair_mem_graph b (d.iso g) C C').2 ce, - (b.pair_mem_graph b (d.iso g) E E').2 ee, ?_, ?_, ?_⟩⟩ - · apply congrArg (nonemptyTupleCode 5) - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j - · apply congrArg (nonemptyTupleCode 5) - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j - · exact (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g U.val U'.val U.property U'.property).2 ue - · exact (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g Rf.val Rf'.val Rf.property Rf'.property).2 fe - · exact (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g Rc.val Rc'.val Rc.property Rc'.property).2 re - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace SetFormula - -def refinementIndexActionEntryFormula : SetFormula 6 := - .ex (.ex (.conj (.mem 1 4) (.conj (.mem 0 4) - (.conj (orderedPairFormula 2 1 0) - (reindex ![1, 0, 3, 5, 6, 7] (refinementIndexActionFormula 0 1 2 3 4 5)))))) - -def refinementIndexActionSetFormula : SetFormula 6 := - exactSetFormula 0 (reindex (extend 0 (fun j : Fin 5 => j.succ.succ)) refinementIndexActionEntryFormula) - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (level T1 T2 : ZFSet.{u}) (hl : level ∈ M.sets) -variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) -include pairing unions powers separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround - -theorem realize_refinementIndexActionEntryFormula (g : G) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets refinementIndexActionEntryFormula - ![z, t.encode g, M.niceRefinementIndices a s b d level T1 T2 valid1, - s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ - z ∈ M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by - let I := M.niceRefinementIndices a s b d level T1 T2 valid1 - have action (x y : ZFSet.{u}) (hx : x ∈ I) (hy : y ∈ I) : - Realize M.sets (refinementIndexActionFormula 0 1 2 3 4 5) - ![x, y, t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ - ZFSet.pair x y ∈ M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hx - obtain ⟨C', E', U', Rf', Rc', rfl⟩ := M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hy - rw [M.realize_refinementIndexActionFormula a s t b d pairing unions powers separation collection - carrier group nodes maps nodeMaps level hl g C E C' E' U Rf Rc U' Rf' Rc', - M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround - g C E U Rf Rc hx, refinementIndexCode_eq_iff] - constructor - · rintro ⟨ce, ee, ue, fe, re⟩ - exact ⟨rfl, congrArg b.encode ce.symm, congrArg b.encode ee.symm, - congrArg Subtype.val ue.symm, congrArg Subtype.val fe.symm, congrArg Subtype.val re.symm⟩ - · rintro ⟨_, ce, ee, ue, fe, re⟩ - exact ⟨b.injective ce.symm, b.injective ee.symm, - Subtype.ext ue.symm, Subtype.ext fe.symm, Subtype.ext re.symm⟩ - let env : Fin 6 → ZFSet.{u} := ![z, t.encode g, I, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] - have args (x y : ZFSet.{u}) : - (fun j : Fin 6 => (extend y (extend x env)) (![1, 0, 3, 5, 6, 7] j)) = - ![x, y, t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j - change Realize M.sets refinementIndexActionEntryFormula env ↔ _ - simp only [refinementIndexActionEntryFormula, realize_ex] - constructor - · rintro ⟨x, hxm, y, hym, hx, hy, paired, acted⟩ - have eq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hxm hym).1 paired - change z = ZFSet.pair x y at eq - rw [realize_reindex, args] at acted - exact eq.symm ▸ (action x y hx hy).1 acted - · intro entry - obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 - have hxm := M.transitive indexGround hx - have hym := M.transitive indexGround hy - refine ⟨x, hxm, y, hym, hx, hy, - (M.realize_orderedPairFormula pairing 2 1 0 _ hz hxm hym).2 eq, ?_⟩ - rw [realize_reindex, args] - exact (action x y hx hy).2 (eq ▸ entry) - -theorem realize_refinementIndexActionSetFormula - (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) - (g : G) (F : ZFSet.{u}) (hF : F ∈ M.sets) : - Realize M.sets refinementIndexActionSetFormula - ![F, t.encode g, M.niceRefinementIndices a s b d level T1 T2 valid1, - s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ - F = M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by - have graphGround := M.niceRefinementIndexActionGraph_mem a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier maps nodeMaps hl hT1 hT2 indexGround g - apply M.realize_exactSetFormula 0 _ _ hF (fun _ h => M.transitive graphGround h) - intro z hz - rw [realize_reindex, map_extend] - exact M.realize_refinementIndexActionEntryFormula a s t b d pairing unions powers separation collection - carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 closed1 closed2 familyGround indexGround g z hz - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid -local notation "J" => stageOneAssignments I T -local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d ∅ T T2 valid valid2 -local notation "termGraph" => Name.renameFamilyGraph s (a.iso ·) T valid - -noncomputable def stageOneAssignmentActionGraph (g : G) : ZFSet.{u} := - relationProduct I (ZFSet.prod T T) I (ZFSet.prod T T) (indexGraph g) - (relationProduct T T T T (Name.renameFamilyGraph s (a.iso g) T valid) - (Name.renameFamilyGraph s (a.iso g) T valid)) - -theorem pair_mem_stageOneAssignmentActionGraph (g : G) (i u w i' u' w' : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment i u w) (stageOneAssignment i' u' w') ∈ - M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g ↔ - i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ i' ∈ I ∧ u' ∈ T ∧ w' ∈ T ∧ - ZFSet.pair i i' ∈ indexGraph g ∧ - ZFSet.pair u u' ∈ Name.renameFamilyGraph s (a.iso g) T valid ∧ - ZFSet.pair w w' ∈ Name.renameFamilyGraph s (a.iso g) T valid := by - simp only [stageOneAssignmentActionGraph, stageOneAssignment, - pair_mem_relationProduct, ZFSet.pair_mem_prod] - tauto - -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - -omit [OrderTop P] in -include closed in -theorem stageOneTermAction_function (g : G) : - ZFSet.IsFunc T T (Name.renameFamilyGraph s (a.iso g) T valid) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T valid z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hw, closed g w hw⟩ - · intro x hx - let w : Name s := ⟨x, valid x hx⟩ - refine ⟨(a.act s g w).val, - (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w _).2 ⟨hx, rfl⟩, ?_⟩ - intro y hy - exact ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w y).1 hy).2 - -omit [OrderTop P] in -include closed in -theorem stageOneTermAction_injection (g : G) : - InjectionCode T T (Name.renameFamilyGraph s (a.iso g) T valid) := by - refine ⟨stageOneTermAction_function a s T valid closed g, ?_⟩ - intro x y z hx hy - have func := stageOneTermAction_function a s T valid closed g - let wx : Name s := ⟨x, valid x (ZFSet.pair_mem_prod.1 (func.1 hx)).1⟩ - let wy : Name s := ⟨y, valid y (ZFSet.pair_mem_prod.1 (func.1 hy)).1⟩ - have ex := ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid wx z).1 hx).2 - have ey := ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid wy z).1 hy).2 - have equal : a.act s g wx = a.act s g wy := Subtype.ext (ex.symm.trans ey) - exact congrArg Subtype.val ((a.nameEquiv s g).injective equal) - -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) - -include closed closed2 familyGround pairing unions powers separation collection carrier order maps in -theorem stageOneAssignmentActionGraph_function (g : G) : - ZFSet.IsFunc J J (M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g) := - relationProduct_function - (M.niceRefinementIndexActionGraph_function a s b d ∅ T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g) - (relationProduct_function (stageOneTermAction_function a s T valid closed g) - (stageOneTermAction_function a s T valid closed g)) - -include pairing unions powers separation collection carrier maps in -theorem stageOneAssignmentActionGraph_mem - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) (g : G) : - M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g ∈ M.sets := by - have hi := M.niceRefinementIndexActionGraph_mem a s b d ∅ T T2 valid valid2 t - pairing unions powers separation collection carrier maps nodeMaps (M.empty_mem ⟨T, hT⟩) hT hT2 hI g - have ht := M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier - (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid - have htt := M.prod_mem pairing unions powers separation hT hT - exact M.relationProduct_mem pairing unions powers separation hI htt hI htt hi - (M.relationProduct_mem pairing unions powers separation hT hT hT hT ht ht) - -include closed closed2 familyGround pairing unions powers separation collection carrier order maps in -theorem stageOneAssignmentActionGraph_entry (g : G) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) (y : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) y ∈ - M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g ↔ - y = stageOneAssignment (refinementIndexCode ∅ (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) - (a.act s g u).val (a.act s g w).val := by - have idx := M.niceRefinementIndexActionGraph_entry a s b d ∅ T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g C E U Rf Rc index - constructor - · intro entry - have func := M.stageOneAssignmentActionGraph_function a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround g - obtain ⟨i', _, u', _, w', _, rfl⟩ := (mem_stageOneAssignments I T y).1 - (ZFSet.pair_mem_prod.1 (func.1 entry)).2 - obtain ⟨_, _, _, _, _, _, ei, eu, ew⟩ := - (M.pair_mem_stageOneAssignmentActionGraph a s b d T T2 valid valid2 g _ _ _ _ _ _).1 entry - rw [(idx i').1 ei, ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u u').1 eu).2, - ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w w').1 ew).2] - rfl - · rintro rfl - apply (M.pair_mem_stageOneAssignmentActionGraph a s b d T T2 valid valid2 g _ _ _ _ _ _).2 - refine ⟨index, hu, hw, ?_, closed g u hu, closed g w hw, (idx _).2 rfl, ?_, ?_⟩ - · exact (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps ∅ T T2 valid closed closed2 familyGround g C E U Rf Rc).2 index - · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u _).2 ⟨hu, rfl⟩ - · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w _).2 ⟨hw, rfl⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace SetFormula - -def refinementIndexActionFamilyEntryFormula : SetFormula 6 := - .ex (.ex (.conj (.mem 1 3) (.conj (orderedPairFormula 2 1 0) - (reindex ![0, 1, 4, 5, 6, 7] refinementIndexActionSetFormula)))) - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (level T1 T2 : ZFSet.{u}) -variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) - -noncomputable def niceRefinementIndexActionFamily : ZFSet.{u} := - familyCodeGraph t.encode (M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2) - -noncomputable def niceRefinementIndexFullActionGraph : ZFSet.{u} := - mapFamilyApplicationGraph t.carrier - (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2) - -theorem pair_mem_niceRefinementIndexActionFamily (g : G) (F : ZFSet.{u}) : - ZFSet.pair (t.encode g) F ∈ M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 ↔ - F = M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := - pair_mem_familyCodeGraph _ _ t.injective g F - -theorem niceRefinementIndexActionFamily_function : - FunctionGraphOn t.carrier (M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2) := by - have equal : ZFSet.range t.encode = t.carrier := by - apply ZFSet.ext - intro x - exact ZFSet.mem_range.trans (t.mem_carrier x).symm - simpa only [niceRefinementIndexActionFamily, equal] using familyCodeGraph_function t.encode - (M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2) t.injective - -theorem pair_mem_niceRefinementIndexFullActionGraph (g : G) (x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (t.encode g) x) y ∈ - M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 ↔ - ZFSet.pair x y ∈ M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by - rw [niceRefinementIndexFullActionGraph, pair_mem_mapFamilyApplicationGraph] - constructor - · rintro ⟨_, _, _, F, indexed, entry⟩ - exact (M.pair_mem_niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 g F).1 indexed ▸ entry - · intro entry - have bounds := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 entry).1 - exact ⟨t.encode_mem g, bounds.1, bounds.2, _, - (M.pair_mem_niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 g _).2 rfl, entry⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (hl : level ∈ M.sets) -variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) -include pairing unions powers separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround - -theorem niceRefinementIndexActionFamily_mem (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) : - M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 ∈ M.sets := by - let I := M.niceRefinementIndices a s b d level T1 T2 valid1 - let values := M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 - have graphGround (g : G) := M.niceRefinementIndexActionGraph_mem a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier maps nodeMaps hl hT1 hT2 indexGround g - have graphBound (g : G) : values g ∈ M.groundRelations I I := - (M.mem_groundRelations I I _).2 ⟨graphGround g, fun _ h => (ZFSet.mem_sep.1 h).1⟩ - let params : Fin 5 → ZFSet.{u} := ![t.carrier, I, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] - have paramsGround : ∀ j, params j ∈ M.sets := Fin.cases group (Fin.cases indexGround - (Fin.cases carrier (Fin.cases maps (Fin.cases nodeMaps (fun j => Fin.elim0 j))))) - have args (z raw F : ZFSet.{u}) : - (fun j : Fin 6 => (extend F (extend raw (extend z params))) (![0, 1, 4, 5, 6, 7] j)) = - ![F, raw, I, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j - have meaning (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets refinementIndexActionFamilyEntryFormula (extend z params) ↔ - z ∈ M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 := by - simp only [refinementIndexActionFamilyEntryFormula, realize_ex] - constructor - · rintro ⟨raw, hr, F, hF, actor, paired, coded⟩ - obtain ⟨g, rfl⟩ := (t.mem_carrier raw).1 actor - have pairEq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hr hF).1 paired - change z = ZFSet.pair (t.encode g) F at pairEq - rw [realize_reindex, args] at coded - have equal := (M.realize_refinementIndexActionSetFormula a s t b d pairing unions powers separation - collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 closed1 closed2 - familyGround indexGround hT1 hT2 g F hF).1 coded - exact (mem_familyCodeGraph _ _ z).2 ⟨g, by simpa only [equal] using pairEq.symm⟩ - · intro member - obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 member - have hg := M.transitive group (t.encode_mem g) - refine ⟨t.encode g, hg, values g, graphGround g, t.encode_mem g, - (M.realize_orderedPairFormula pairing 2 1 0 _ hz hg (graphGround g)).2 rfl, ?_⟩ - rw [realize_reindex, args] - exact (M.realize_refinementIndexActionSetFormula a s t b d pairing unions powers separation - collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 closed1 closed2 - familyGround indexGround hT1 hT2 g (values g) (graphGround g)).2 rfl - let B := ZFSet.prod t.carrier (M.groundRelations I I) - have hB := M.prod_mem pairing unions powers separation group - (M.groundRelations_mem pairing unions powers separation indexGround indexGround) - have subset : M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 ⊆ B := by - intro z hz - obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨t.encode_mem g, graphBound g⟩ - have equal : ZFSet.sep (fun z => Realize M.sets refinementIndexActionFamilyEntryFormula - (extend z params)) B = M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - exact ⟨fun h => (meaning z (M.transitive hB h.1)).1 h.2, - fun h => ⟨subset h, (meaning z (M.transitive hB (subset h))).2 h⟩⟩ - exact equal ▸ M.separation_mem separation refinementIndexActionFamilyEntryFormula params paramsGround hB - -theorem niceRefinementIndexFullActionGraph_mem (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) : - M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 ∈ M.sets := - M.mapFamilyApplicationGraph_mem pairing unions powers separation group indexGround indexGround - (M.niceRefinementIndexActionFamily_mem a s t b d level T1 T2 valid1 valid2 pairing unions powers - separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround hT1 hT2) - -omit group nodes nodeMaps hl indexGround in -theorem niceRefinementIndexFullActionGraph_function : - ZFSet.IsFunc (ZFSet.prod t.carrier (M.niceRefinementIndices a s b d level T1 T2 valid1)) - (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2) := by - refine ⟨?_, ?_⟩ - · intro z h - unfold niceRefinementIndexFullActionGraph mapFamilyApplicationGraph at h - exact (ZFSet.mem_sep.1 h).1 - intro raw member - obtain ⟨actor, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 member - obtain ⟨g, rfl⟩ := (t.mem_carrier actor).1 ha - have fiber := M.niceRefinementIndexActionGraph_function a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g - obtain ⟨y, entry, unique⟩ := fiber.2 x hx - have meaning := M.pair_mem_niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 g x - exact ⟨y, (meaning y).2 entry, fun z hz => unique z ((meaning z).1 hz)⟩ - -omit group nodes nodeMaps hl indexGround in -theorem niceRefinementIndexFullActionGraph_entry (g : G) (C E : L) - (U Rf Rc : (M.nameDomain s).names) - (source : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid1) (y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (t.encode g) - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val)) y ∈ - M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 ↔ - y = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := - (M.pair_mem_niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 g _ y).trans - (M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t - pairing unions powers separation collection carrier order maps closed1 closed2 familyGround - g C E U Rf Rc source y) - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "J" => stageOneAssignments I T -local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d level T T2 valid valid2 -local notation "termGraph" => Name.renameFamilyGraph s (a.iso ·) T valid - -noncomputable def refinementAssignmentActionGraph (g : G) : ZFSet.{u} := - relationProduct I (ZFSet.prod T T) I (ZFSet.prod T T) (indexGraph g) - (relationProduct T T T T (Name.renameFamilyGraph s (a.iso g) T valid) - (Name.renameFamilyGraph s (a.iso g) T valid)) - -theorem pair_mem_refinementAssignmentActionGraph (g : G) (i u w i' u' w' : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment i u w) (stageOneAssignment i' u' w') ∈ - M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g ↔ - i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ i' ∈ I ∧ u' ∈ T ∧ w' ∈ T ∧ - ZFSet.pair i i' ∈ indexGraph g ∧ - ZFSet.pair u u' ∈ Name.renameFamilyGraph s (a.iso g) T valid ∧ - ZFSet.pair w w' ∈ Name.renameFamilyGraph s (a.iso g) T valid := by - simp only [refinementAssignmentActionGraph, stageOneAssignment, - pair_mem_relationProduct, ZFSet.pair_mem_prod] - tauto - -theorem refinementAssignmentActionGraph_zero (g : G) : - M.refinementAssignmentActionGraph a s b d ∅ T T2 valid valid2 g = - M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g := rfl - -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) - -include closed closed2 familyGround pairing unions powers separation collection carrier order maps in -theorem refinementAssignmentActionGraph_function (g : G) : - ZFSet.IsFunc J J (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g) := - relationProduct_function - (M.niceRefinementIndexActionGraph_function a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g) - (relationProduct_function (stageOneTermAction_function a s T valid closed g) - (stageOneTermAction_function a s T valid closed g)) - -include pairing unions powers separation collection carrier maps in -theorem refinementAssignmentActionGraph_mem - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) (g : G) : - M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g ∈ M.sets := by - have hi := M.niceRefinementIndexActionGraph_mem a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier maps nodeMaps hLevel hT hT2 hI g - have ht := M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier - (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid - have htt := M.prod_mem pairing unions powers separation hT hT - exact M.relationProduct_mem pairing unions powers separation hI htt hI htt hi - (M.relationProduct_mem pairing unions powers separation hT hT hT hT ht ht) - -include closed closed2 familyGround pairing unions powers separation collection carrier order maps in -theorem refinementAssignmentActionGraph_entry (g : G) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) (y : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) y ∈ - M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g ↔ - y = stageOneAssignment (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) - (a.act s g u).val (a.act s g w).val := by - have idx := M.niceRefinementIndexActionGraph_entry a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g C E U Rf Rc index - constructor - · intro entry - have func := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround g - obtain ⟨i', _, u', _, w', _, rfl⟩ := (mem_stageOneAssignments I T y).1 - (ZFSet.pair_mem_prod.1 (func.1 entry)).2 - obtain ⟨_, _, _, _, _, _, ei, eu, ew⟩ := - (M.pair_mem_refinementAssignmentActionGraph a s b d level T T2 valid valid2 g _ _ _ _ _ _).1 entry - rw [(idx i').1 ei, ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u u').1 eu).2, - ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w w').1 ew).2] - rfl - · rintro rfl - apply (M.pair_mem_refinementAssignmentActionGraph a s b d level T T2 valid valid2 g _ _ _ _ _ _).2 - refine ⟨index, hu, hw, ?_, closed g u hu, closed g w hw, (idx _).2 rfl, ?_, ?_⟩ - · exact (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps level T T2 valid closed closed2 familyGround g C E U Rf Rc).2 index - · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u _).2 ⟨hu, rfl⟩ - · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w _).2 ⟨hw, rfl⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid -local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d ∅ T T2 valid valid2 -local notation "termGraph" => fun g => Name.renameFamilyGraph s (a.iso g) T valid - -noncomputable def stageOneAssignmentActionFamily : ZFSet.{u} := - familyCodeGraph t.encode (M.stageOneAssignmentActionGraph a s b d T T2 valid valid2) - -theorem pair_mem_stageOneAssignmentActionFamily (g : G) (F : ZFSet.{u}) : - ZFSet.pair (t.encode g) F ∈ M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 ↔ - F = M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g := - pair_mem_familyCodeGraph _ _ t.injective g F - -theorem stageOneAssignmentActionFamily_function : - FunctionGraphOn t.carrier (M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2) := by - have equal : ZFSet.range t.encode = t.carrier := by - apply ZFSet.ext - intro x - exact ZFSet.mem_range.trans (t.mem_carrier x).symm - simpa only [stageOneAssignmentActionFamily, equal] using familyCodeGraph_function t.encode - (M.stageOneAssignmentActionGraph a s b d T T2 valid valid2) t.injective - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem stageOneAssignmentActionFamily_mem - (group : t.carrier ∈ M.sets) (hT : T ∈ M.sets) (indexGround : I ∈ M.sets) - (indexFamily : M.niceRefinementIndexActionFamily a s t b d ∅ T T2 valid valid2 ∈ M.sets) - (termFamily : a.termActionFamily s t T valid ∈ M.sets) : - M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 ∈ M.sets := by - have pairs := M.familyCodeGraph_relationProducts_mem t T T T T (termGraph) (termGraph) - pairing unions powers separation group hT hT hT hT termFamily termFamily - have hTT := M.prod_mem pairing unions powers separation hT hT - exact M.familyCodeGraph_relationProducts_mem t I (ZFSet.prod T T) I (ZFSet.prod T T) - (indexGraph) (fun g => relationProduct T T T T ((termGraph) g) ((termGraph) g)) - pairing unions powers separation group indexGround hTT indexGround hTT indexFamily pairs - -theorem stageOneAssignmentActionFamily_mem_of_inputs - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (order : s.conditionOrder ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (indexGround : I ∈ M.sets) - (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) - (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) : - M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 ∈ M.sets := by - have indices := M.niceRefinementIndexActionFamily_mem a s t b d ∅ T T2 valid valid2 - pairing unions powers separation collection carrier group nodes order maps nodeMaps - (M.empty_mem ⟨T,hT⟩) closed closed2 familyGround indexGround hT hT2 - have terms := M.termActionFamily_mem a s t T valid pairing unions powers separation - collection carrier group maps hT closed - exact M.stageOneAssignmentActionFamily_mem a s t b d T T2 valid valid2 - pairing unions powers separation group hT indexGround indices terms - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d level T T2 valid valid2 -local notation "termGraph" => fun g => Name.renameFamilyGraph s (a.iso g) T valid - -noncomputable def refinementAssignmentActionFamily : ZFSet.{u} := - familyCodeGraph t.encode (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2) - -theorem pair_mem_refinementAssignmentActionFamily (g : G) (F : ZFSet.{u}) : - ZFSet.pair (t.encode g) F ∈ M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2 ↔ - F = M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g := - pair_mem_familyCodeGraph _ _ t.injective g F - -theorem refinementAssignmentActionFamily_function : - FunctionGraphOn t.carrier (M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2) := by - have equal : ZFSet.range t.encode = t.carrier := by - apply ZFSet.ext - intro x - exact ZFSet.mem_range.trans (t.mem_carrier x).symm - simpa only [refinementAssignmentActionFamily, equal] using familyCodeGraph_function t.encode - (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2) t.injective - -theorem refinementAssignmentActionFamily_zero : - M.refinementAssignmentActionFamily a s t b d ∅ T T2 valid valid2 = - M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 := rfl - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem refinementAssignmentActionFamily_mem - (group : t.carrier ∈ M.sets) (hT : T ∈ M.sets) (indexGround : I ∈ M.sets) - (indexFamily : M.niceRefinementIndexActionFamily a s t b d level T T2 valid valid2 ∈ M.sets) - (termFamily : a.termActionFamily s t T valid ∈ M.sets) : - M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2 ∈ M.sets := by - have pairs := M.familyCodeGraph_relationProducts_mem t T T T T (termGraph) (termGraph) - pairing unions powers separation group hT hT hT hT termFamily termFamily - have hTT := M.prod_mem pairing unions powers separation hT hT - exact M.familyCodeGraph_relationProducts_mem t I (ZFSet.prod T T) I (ZFSet.prod T T) - (indexGraph) (fun g => relationProduct T T T T ((termGraph) g) ((termGraph) g)) - pairing unions powers separation group indexGround hTT indexGround hTT indexFamily pairs - -theorem refinementAssignmentActionFamily_mem_of_inputs - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (order : s.conditionOrder ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (indexGround : I ∈ M.sets) - (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) - (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) - (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) : - M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2 ∈ M.sets := by - have indices := M.niceRefinementIndexActionFamily_mem a s t b d level T T2 valid valid2 - pairing unions powers separation collection carrier group nodes order maps nodeMaps - hLevel closed closed2 familyGround indexGround hT hT2 - have terms := M.termActionFamily_mem a s t T valid pairing unions powers separation - collection carrier group maps hT closed - exact M.refinementAssignmentActionFamily_mem a s t b d level T T2 valid valid2 - pairing unions powers separation group hT indexGround indices terms - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRelationProductFamilies +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementIndexActionFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceRefinementIndexActionLaws + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) + +theorem realize_refinementIndexActionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (level : ZFSet.{u}) (hl : level ∈ M.sets) (g : G) (C E C' E' : L) + (U Rf Rc U' Rf' Rc' : (M.nameDomain s).names) : + Realize M.sets (refinementIndexActionFormula 0 1 2 3 4 5) + ![refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val, + refinementIndexCode level (b.encode C') (b.encode E') U'.val.val Rf'.val.val Rc'.val.val, + t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ + d.iso g C = C' ∧ d.iso g E = E' ∧ a.act s g U.val = U'.val ∧ + a.act s g Rf.val = Rf'.val ∧ a.act s g Rc.val = Rc'.val := by + let oldFields : Fin 6 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] + let newFields : Fin 6 → ZFSet.{u} := ![level, b.encode C', b.encode E', U'.val.val, Rf'.val.val, Rc'.val.val] + have groundNodes (c : L) := M.transitive nodes (b.encode_mem c) + have oldGround : ∀ j, oldFields j ∈ M.sets := + Fin.cases hl (Fin.cases (groundNodes C) (Fin.cases (groundNodes E) + (Fin.cases U.property (Fin.cases Rf.property (Fin.cases Rc.property (fun j => Fin.elim0 j)))))) + have newGround : ∀ j, newFields j ∈ M.sets := + Fin.cases hl (Fin.cases (groundNodes C') (Fin.cases (groundNodes E') + (Fin.cases U'.property (Fin.cases Rf'.property (Fin.cases Rc'.property (fun j => Fin.elim0 j)))))) + let env : Fin 6 → ZFSet.{u} := ![nonemptyTupleCode 5 oldFields, nonemptyTupleCode 5 newFields, + t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] + have envGround : ∀ j, env j ∈ M.sets := + Fin.cases (M.nonemptyTupleCode_mem pairing 5 oldFields oldGround) + (Fin.cases (M.nonemptyTupleCode_mem pairing 5 newFields newGround) + (Fin.cases (M.transitive group (t.encode_mem g)) (Fin.cases carrier + (Fin.cases maps (Fin.cases nodeMaps (fun j => Fin.elim0 j)))))) + change Realize M.sets (refinementIndexActionFormula 0 1 2 3 4 5) env ↔ _ + rw [refinementIndexActionFormula, realize_exBlock] + have raw (w : Fin 13 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) := + M.realize_refinementIndexActionRawFormula pairing + (suffixIndex 6 13 0) (suffixIndex 6 13 1) (suffixIndex 6 13 2) + (suffixIndex 6 13 3) (suffixIndex 6 13 4) (suffixIndex 6 13 5) + (prefixIndex 6 13) (extendMany 13 w env) (extendMany_members 13 w env ground envGround) + simp only [extendMany_prefix, extendMany_suffix] at raw + constructor + · rintro ⟨w, ground, formula⟩ + obtain ⟨oldEq, newEq, _, nodeEntry, ce, ee, ue, fe, re⟩ := (raw w ground).1 formula + have oldAt (j : Fin 6) : w (j.castAdd 7) = oldFields j := + (congrFun (nonemptyTupleCode_injective 5 oldEq) j).symm + have newAt (j : Fin 6) : w ((Fin.natAdd 6 j).castAdd 1) = newFields j := + (congrFun (nonemptyTupleCode_injective 5 newEq) j).symm + have graphEq := (d.pair_mem_conditionMapFamily b t g (w 12)).1 nodeEntry + have cEq : w 1 = b.encode C := oldAt 1 + have eEq : w 2 = b.encode E := oldAt 2 + have uEq : w 3 = U.val.val := oldAt 3 + have fEq : w 4 = Rf.val.val := oldAt 4 + have rEq : w 5 = Rc.val.val := oldAt 5 + have cEq' : w 7 = b.encode C' := newAt 1 + have eEq' : w 8 = b.encode E' := newAt 2 + have uEq' : w 9 = U'.val.val := newAt 3 + have fEq' : w 10 = Rf'.val.val := newAt 4 + have rEq' : w 11 = Rc'.val.val := newAt 5 + rw [cEq, cEq', graphEq] at ce + rw [eEq, eEq', graphEq] at ee + rw [uEq, uEq'] at ue + rw [fEq, fEq'] at fe + rw [rEq, rEq'] at re + exact ⟨(b.pair_mem_graph b (d.iso g) C C').1 ce, + (b.pair_mem_graph b (d.iso g) E E').1 ee, + (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g U.val U'.val U.property U'.property).1 ue, + (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g Rf.val Rf'.val Rf.property Rf'.property).1 fe, + (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g Rc.val Rc'.val Rc.property Rc'.property).1 re⟩ + · rintro ⟨ce, ee, ue, fe, re⟩ + let w : Fin 13 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val, + level, b.encode C', b.encode E', U'.val.val, Rf'.val.val, Rc'.val.val, b.graph b (d.iso g)] + have ground : ∀ j, w j ∈ M.sets := + Fin.cases hl (Fin.cases (groundNodes C) (Fin.cases (groundNodes E) + (Fin.cases U.property (Fin.cases Rf.property (Fin.cases Rc.property + (Fin.cases hl (Fin.cases (groundNodes C') (Fin.cases (groundNodes E') + (Fin.cases U'.property (Fin.cases Rf'.property (Fin.cases Rc'.property + (Fin.cases (M.conditionMap_graph_mem d b t nodeMaps g) (fun j => Fin.elim0 j))))))))))))) + refine ⟨w, ground, (raw w ground).2 ⟨?_, ?_, rfl, + (d.pair_mem_conditionMapFamily b t g _).2 rfl, + (b.pair_mem_graph b (d.iso g) C C').2 ce, + (b.pair_mem_graph b (d.iso g) E E').2 ee, ?_, ?_, ?_⟩⟩ + · apply congrArg (nonemptyTupleCode 5) + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j + · apply congrArg (nonemptyTupleCode 5) + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j + · exact (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g U.val U'.val U.property U'.property).2 ue + · exact (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g Rf.val Rf'.val Rf.property Rf'.property).2 fe + · exact (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g Rc.val Rc'.val Rc.property Rc'.property).2 re + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace SetFormula + +def refinementIndexActionEntryFormula : SetFormula 6 := + .ex (.ex (.conj (.mem 1 4) (.conj (.mem 0 4) + (.conj (orderedPairFormula 2 1 0) + (reindex ![1, 0, 3, 5, 6, 7] (refinementIndexActionFormula 0 1 2 3 4 5)))))) + +def refinementIndexActionSetFormula : SetFormula 6 := + exactSetFormula 0 (reindex (extend 0 (fun j : Fin 5 => j.succ.succ)) refinementIndexActionEntryFormula) + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (level T1 T2 : ZFSet.{u}) (hl : level ∈ M.sets) +variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) +include pairing unions powers separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround + +theorem realize_refinementIndexActionEntryFormula (g : G) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets refinementIndexActionEntryFormula + ![z, t.encode g, M.niceRefinementIndices a s b d level T1 T2 valid1, + s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ + z ∈ M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by + let I := M.niceRefinementIndices a s b d level T1 T2 valid1 + have action (x y : ZFSet.{u}) (hx : x ∈ I) (hy : y ∈ I) : + Realize M.sets (refinementIndexActionFormula 0 1 2 3 4 5) + ![x, y, t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ + ZFSet.pair x y ∈ M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hx + obtain ⟨C', E', U', Rf', Rc', rfl⟩ := M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hy + rw [M.realize_refinementIndexActionFormula a s t b d pairing unions powers separation collection + carrier group nodes maps nodeMaps level hl g C E C' E' U Rf Rc U' Rf' Rc', + M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround + g C E U Rf Rc hx, refinementIndexCode_eq_iff] + constructor + · rintro ⟨ce, ee, ue, fe, re⟩ + exact ⟨rfl, congrArg b.encode ce.symm, congrArg b.encode ee.symm, + congrArg Subtype.val ue.symm, congrArg Subtype.val fe.symm, congrArg Subtype.val re.symm⟩ + · rintro ⟨_, ce, ee, ue, fe, re⟩ + exact ⟨b.injective ce.symm, b.injective ee.symm, + Subtype.ext ue.symm, Subtype.ext fe.symm, Subtype.ext re.symm⟩ + let env : Fin 6 → ZFSet.{u} := ![z, t.encode g, I, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] + have args (x y : ZFSet.{u}) : + (fun j : Fin 6 => (extend y (extend x env)) (![1, 0, 3, 5, 6, 7] j)) = + ![x, y, t.encode g, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j + change Realize M.sets refinementIndexActionEntryFormula env ↔ _ + simp only [refinementIndexActionEntryFormula, realize_ex] + constructor + · rintro ⟨x, hxm, y, hym, hx, hy, paired, acted⟩ + have eq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hxm hym).1 paired + change z = ZFSet.pair x y at eq + rw [realize_reindex, args] at acted + exact eq.symm ▸ (action x y hx hy).1 acted + · intro entry + obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 + have hxm := M.transitive indexGround hx + have hym := M.transitive indexGround hy + refine ⟨x, hxm, y, hym, hx, hy, + (M.realize_orderedPairFormula pairing 2 1 0 _ hz hxm hym).2 eq, ?_⟩ + rw [realize_reindex, args] + exact (action x y hx hy).2 (eq ▸ entry) + +theorem realize_refinementIndexActionSetFormula + (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) + (g : G) (F : ZFSet.{u}) (hF : F ∈ M.sets) : + Realize M.sets refinementIndexActionSetFormula + ![F, t.encode g, M.niceRefinementIndices a s b d level T1 T2 valid1, + s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] ↔ + F = M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by + have graphGround := M.niceRefinementIndexActionGraph_mem a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier maps nodeMaps hl hT1 hT2 indexGround g + apply M.realize_exactSetFormula 0 _ _ hF (fun _ h => M.transitive graphGround h) + intro z hz + rw [realize_reindex, map_extend] + exact M.realize_refinementIndexActionEntryFormula a s t b d pairing unions powers separation collection + carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 closed1 closed2 familyGround indexGround g z hz + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid +local notation "J" => stageOneAssignments I T +local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d ∅ T T2 valid valid2 +local notation "termGraph" => Name.renameFamilyGraph s (a.iso ·) T valid + +noncomputable def stageOneAssignmentActionGraph (g : G) : ZFSet.{u} := + relationProduct I (ZFSet.prod T T) I (ZFSet.prod T T) (indexGraph g) + (relationProduct T T T T (Name.renameFamilyGraph s (a.iso g) T valid) + (Name.renameFamilyGraph s (a.iso g) T valid)) + +theorem pair_mem_stageOneAssignmentActionGraph (g : G) (i u w i' u' w' : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment i u w) (stageOneAssignment i' u' w') ∈ + M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g ↔ + i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ i' ∈ I ∧ u' ∈ T ∧ w' ∈ T ∧ + ZFSet.pair i i' ∈ indexGraph g ∧ + ZFSet.pair u u' ∈ Name.renameFamilyGraph s (a.iso g) T valid ∧ + ZFSet.pair w w' ∈ Name.renameFamilyGraph s (a.iso g) T valid := by + simp only [stageOneAssignmentActionGraph, stageOneAssignment, + pair_mem_relationProduct, ZFSet.pair_mem_prod] + tauto + +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + +omit [OrderTop P] in +include closed in +theorem stageOneTermAction_function (g : G) : + ZFSet.IsFunc T T (Name.renameFamilyGraph s (a.iso g) T valid) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T valid z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hw, closed g w hw⟩ + · intro x hx + let w : Name s := ⟨x, valid x hx⟩ + refine ⟨(a.act s g w).val, + (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w _).2 ⟨hx, rfl⟩, ?_⟩ + intro y hy + exact ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w y).1 hy).2 + +omit [OrderTop P] in +include closed in +theorem stageOneTermAction_injection (g : G) : + InjectionCode T T (Name.renameFamilyGraph s (a.iso g) T valid) := by + refine ⟨stageOneTermAction_function a s T valid closed g, ?_⟩ + intro x y z hx hy + have func := stageOneTermAction_function a s T valid closed g + let wx : Name s := ⟨x, valid x (ZFSet.pair_mem_prod.1 (func.1 hx)).1⟩ + let wy : Name s := ⟨y, valid y (ZFSet.pair_mem_prod.1 (func.1 hy)).1⟩ + have ex := ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid wx z).1 hx).2 + have ey := ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid wy z).1 hy).2 + have equal : a.act s g wx = a.act s g wy := Subtype.ext (ex.symm.trans ey) + exact congrArg Subtype.val ((a.nameEquiv s g).injective equal) + +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) + +include closed closed2 familyGround pairing unions powers separation collection carrier order maps in +theorem stageOneAssignmentActionGraph_function (g : G) : + ZFSet.IsFunc J J (M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g) := + relationProduct_function + (M.niceRefinementIndexActionGraph_function a s b d ∅ T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g) + (relationProduct_function (stageOneTermAction_function a s T valid closed g) + (stageOneTermAction_function a s T valid closed g)) + +include pairing unions powers separation collection carrier maps in +theorem stageOneAssignmentActionGraph_mem + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) (g : G) : + M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g ∈ M.sets := by + have hi := M.niceRefinementIndexActionGraph_mem a s b d ∅ T T2 valid valid2 t + pairing unions powers separation collection carrier maps nodeMaps (M.empty_mem ⟨T, hT⟩) hT hT2 hI g + have ht := M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier + (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid + have htt := M.prod_mem pairing unions powers separation hT hT + exact M.relationProduct_mem pairing unions powers separation hI htt hI htt hi + (M.relationProduct_mem pairing unions powers separation hT hT hT hT ht ht) + +include closed closed2 familyGround pairing unions powers separation collection carrier order maps in +theorem stageOneAssignmentActionGraph_entry (g : G) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) (y : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) y ∈ + M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g ↔ + y = stageOneAssignment (refinementIndexCode ∅ (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) + (a.act s g u).val (a.act s g w).val := by + have idx := M.niceRefinementIndexActionGraph_entry a s b d ∅ T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g C E U Rf Rc index + constructor + · intro entry + have func := M.stageOneAssignmentActionGraph_function a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround g + obtain ⟨i', _, u', _, w', _, rfl⟩ := (mem_stageOneAssignments I T y).1 + (ZFSet.pair_mem_prod.1 (func.1 entry)).2 + obtain ⟨_, _, _, _, _, _, ei, eu, ew⟩ := + (M.pair_mem_stageOneAssignmentActionGraph a s b d T T2 valid valid2 g _ _ _ _ _ _).1 entry + rw [(idx i').1 ei, ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u u').1 eu).2, + ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w w').1 ew).2] + rfl + · rintro rfl + apply (M.pair_mem_stageOneAssignmentActionGraph a s b d T T2 valid valid2 g _ _ _ _ _ _).2 + refine ⟨index, hu, hw, ?_, closed g u hu, closed g w hw, (idx _).2 rfl, ?_, ?_⟩ + · exact (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps ∅ T T2 valid closed closed2 familyGround g C E U Rf Rc).2 index + · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u _).2 ⟨hu, rfl⟩ + · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w _).2 ⟨hw, rfl⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace SetFormula + +def refinementIndexActionFamilyEntryFormula : SetFormula 6 := + .ex (.ex (.conj (.mem 1 3) (.conj (orderedPairFormula 2 1 0) + (reindex ![0, 1, 4, 5, 6, 7] refinementIndexActionSetFormula)))) + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (level T1 T2 : ZFSet.{u}) +variable (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) + +noncomputable def niceRefinementIndexActionFamily : ZFSet.{u} := + familyCodeGraph t.encode (M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2) + +noncomputable def niceRefinementIndexFullActionGraph : ZFSet.{u} := + mapFamilyApplicationGraph t.carrier + (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2) + +theorem pair_mem_niceRefinementIndexActionFamily (g : G) (F : ZFSet.{u}) : + ZFSet.pair (t.encode g) F ∈ M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 ↔ + F = M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := + pair_mem_familyCodeGraph _ _ t.injective g F + +theorem niceRefinementIndexActionFamily_function : + FunctionGraphOn t.carrier (M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2) := by + have equal : ZFSet.range t.encode = t.carrier := by + apply ZFSet.ext + intro x + exact ZFSet.mem_range.trans (t.mem_carrier x).symm + simpa only [niceRefinementIndexActionFamily, equal] using familyCodeGraph_function t.encode + (M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2) t.injective + +theorem pair_mem_niceRefinementIndexFullActionGraph (g : G) (x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (t.encode g) x) y ∈ + M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 ↔ + ZFSet.pair x y ∈ M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 g := by + rw [niceRefinementIndexFullActionGraph, pair_mem_mapFamilyApplicationGraph] + constructor + · rintro ⟨_, _, _, F, indexed, entry⟩ + exact (M.pair_mem_niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 g F).1 indexed ▸ entry + · intro entry + have bounds := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 entry).1 + exact ⟨t.encode_mem g, bounds.1, bounds.2, _, + (M.pair_mem_niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 g _).2 rfl, entry⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (hl : level ∈ M.sets) +variable (closed1 : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T1 valid1).val ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets) +include pairing unions powers separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround + +theorem niceRefinementIndexActionFamily_mem (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) : + M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 ∈ M.sets := by + let I := M.niceRefinementIndices a s b d level T1 T2 valid1 + let values := M.niceRefinementIndexActionGraph a s b d level T1 T2 valid1 valid2 + have graphGround (g : G) := M.niceRefinementIndexActionGraph_mem a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier maps nodeMaps hl hT1 hT2 indexGround g + have graphBound (g : G) : values g ∈ M.groundRelations I I := + (M.mem_groundRelations I I _).2 ⟨graphGround g, fun _ h => (ZFSet.mem_sep.1 h).1⟩ + let params : Fin 5 → ZFSet.{u} := ![t.carrier, I, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] + have paramsGround : ∀ j, params j ∈ M.sets := Fin.cases group (Fin.cases indexGround + (Fin.cases carrier (Fin.cases maps (Fin.cases nodeMaps (fun j => Fin.elim0 j))))) + have args (z raw F : ZFSet.{u}) : + (fun j : Fin 6 => (extend F (extend raw (extend z params))) (![0, 1, 4, 5, 6, 7] j)) = + ![F, raw, I, s.carrier, a.conditionMapFamily s t, d.conditionMapFamily b t] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j + have meaning (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets refinementIndexActionFamilyEntryFormula (extend z params) ↔ + z ∈ M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 := by + simp only [refinementIndexActionFamilyEntryFormula, realize_ex] + constructor + · rintro ⟨raw, hr, F, hF, actor, paired, coded⟩ + obtain ⟨g, rfl⟩ := (t.mem_carrier raw).1 actor + have pairEq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hr hF).1 paired + change z = ZFSet.pair (t.encode g) F at pairEq + rw [realize_reindex, args] at coded + have equal := (M.realize_refinementIndexActionSetFormula a s t b d pairing unions powers separation + collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 closed1 closed2 + familyGround indexGround hT1 hT2 g F hF).1 coded + exact (mem_familyCodeGraph _ _ z).2 ⟨g, by simpa only [equal] using pairEq.symm⟩ + · intro member + obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 member + have hg := M.transitive group (t.encode_mem g) + refine ⟨t.encode g, hg, values g, graphGround g, t.encode_mem g, + (M.realize_orderedPairFormula pairing 2 1 0 _ hz hg (graphGround g)).2 rfl, ?_⟩ + rw [realize_reindex, args] + exact (M.realize_refinementIndexActionSetFormula a s t b d pairing unions powers separation + collection carrier group nodes order maps nodeMaps level T1 T2 hl valid1 valid2 closed1 closed2 + familyGround indexGround hT1 hT2 g (values g) (graphGround g)).2 rfl + let B := ZFSet.prod t.carrier (M.groundRelations I I) + have hB := M.prod_mem pairing unions powers separation group + (M.groundRelations_mem pairing unions powers separation indexGround indexGround) + have subset : M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 ⊆ B := by + intro z hz + obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨t.encode_mem g, graphBound g⟩ + have equal : ZFSet.sep (fun z => Realize M.sets refinementIndexActionFamilyEntryFormula + (extend z params)) B = M.niceRefinementIndexActionFamily a s t b d level T1 T2 valid1 valid2 := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + exact ⟨fun h => (meaning z (M.transitive hB h.1)).1 h.2, + fun h => ⟨subset h, (meaning z (M.transitive hB (subset h))).2 h⟩⟩ + exact equal ▸ M.separation_mem separation refinementIndexActionFamilyEntryFormula params paramsGround hB + +theorem niceRefinementIndexFullActionGraph_mem (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) : + M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 ∈ M.sets := + M.mapFamilyApplicationGraph_mem pairing unions powers separation group indexGround indexGround + (M.niceRefinementIndexActionFamily_mem a s t b d level T1 T2 valid1 valid2 pairing unions powers + separation collection carrier group nodes order maps nodeMaps hl closed1 closed2 familyGround indexGround hT1 hT2) + +omit group nodes nodeMaps hl indexGround in +theorem niceRefinementIndexFullActionGraph_function : + ZFSet.IsFunc (ZFSet.prod t.carrier (M.niceRefinementIndices a s b d level T1 T2 valid1)) + (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2) := by + refine ⟨?_, ?_⟩ + · intro z h + unfold niceRefinementIndexFullActionGraph mapFamilyApplicationGraph at h + exact (ZFSet.mem_sep.1 h).1 + intro raw member + obtain ⟨actor, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 member + obtain ⟨g, rfl⟩ := (t.mem_carrier actor).1 ha + have fiber := M.niceRefinementIndexActionGraph_function a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround g + obtain ⟨y, entry, unique⟩ := fiber.2 x hx + have meaning := M.pair_mem_niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 g x + exact ⟨y, (meaning y).2 entry, fun z hz => unique z ((meaning z).1 hz)⟩ + +omit group nodes nodeMaps hl indexGround in +theorem niceRefinementIndexFullActionGraph_entry (g : G) (C E : L) + (U Rf Rc : (M.nameDomain s).names) + (source : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid1) (y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (t.encode g) + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val)) y ∈ + M.niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 ↔ + y = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := + (M.pair_mem_niceRefinementIndexFullActionGraph a s t b d level T1 T2 valid1 valid2 g _ y).trans + (M.niceRefinementIndexActionGraph_entry a s b d level T1 T2 valid1 valid2 t + pairing unions powers separation collection carrier order maps closed1 closed2 familyGround + g C E U Rf Rc source y) + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "J" => stageOneAssignments I T +local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d level T T2 valid valid2 +local notation "termGraph" => Name.renameFamilyGraph s (a.iso ·) T valid + +noncomputable def refinementAssignmentActionGraph (g : G) : ZFSet.{u} := + relationProduct I (ZFSet.prod T T) I (ZFSet.prod T T) (indexGraph g) + (relationProduct T T T T (Name.renameFamilyGraph s (a.iso g) T valid) + (Name.renameFamilyGraph s (a.iso g) T valid)) + +theorem pair_mem_refinementAssignmentActionGraph (g : G) (i u w i' u' w' : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment i u w) (stageOneAssignment i' u' w') ∈ + M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g ↔ + i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ i' ∈ I ∧ u' ∈ T ∧ w' ∈ T ∧ + ZFSet.pair i i' ∈ indexGraph g ∧ + ZFSet.pair u u' ∈ Name.renameFamilyGraph s (a.iso g) T valid ∧ + ZFSet.pair w w' ∈ Name.renameFamilyGraph s (a.iso g) T valid := by + simp only [refinementAssignmentActionGraph, stageOneAssignment, + pair_mem_relationProduct, ZFSet.pair_mem_prod] + tauto + +theorem refinementAssignmentActionGraph_zero (g : G) : + M.refinementAssignmentActionGraph a s b d ∅ T T2 valid valid2 g = + M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g := rfl + +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) + +include closed closed2 familyGround pairing unions powers separation collection carrier order maps in +theorem refinementAssignmentActionGraph_function (g : G) : + ZFSet.IsFunc J J (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g) := + relationProduct_function + (M.niceRefinementIndexActionGraph_function a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g) + (relationProduct_function (stageOneTermAction_function a s T valid closed g) + (stageOneTermAction_function a s T valid closed g)) + +include pairing unions powers separation collection carrier maps in +theorem refinementAssignmentActionGraph_mem + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) (g : G) : + M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g ∈ M.sets := by + have hi := M.niceRefinementIndexActionGraph_mem a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier maps nodeMaps hLevel hT hT2 hI g + have ht := M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier + (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid + have htt := M.prod_mem pairing unions powers separation hT hT + exact M.relationProduct_mem pairing unions powers separation hI htt hI htt hi + (M.relationProduct_mem pairing unions powers separation hT hT hT hT ht ht) + +include closed closed2 familyGround pairing unions powers separation collection carrier order maps in +theorem refinementAssignmentActionGraph_entry (g : G) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) (y : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) y ∈ + M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g ↔ + y = stageOneAssignment (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) + (a.act s g u).val (a.act s g w).val := by + have idx := M.niceRefinementIndexActionGraph_entry a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g C E U Rf Rc index + constructor + · intro entry + have func := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround g + obtain ⟨i', _, u', _, w', _, rfl⟩ := (mem_stageOneAssignments I T y).1 + (ZFSet.pair_mem_prod.1 (func.1 entry)).2 + obtain ⟨_, _, _, _, _, _, ei, eu, ew⟩ := + (M.pair_mem_refinementAssignmentActionGraph a s b d level T T2 valid valid2 g _ _ _ _ _ _).1 entry + rw [(idx i').1 ei, ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u u').1 eu).2, + ((Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w w').1 ew).2] + rfl + · rintro rfl + apply (M.pair_mem_refinementAssignmentActionGraph a s b d level T T2 valid valid2 g _ _ _ _ _ _).2 + refine ⟨index, hu, hw, ?_, closed g u hu, closed g w hw, (idx _).2 rfl, ?_, ?_⟩ + · exact (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps level T T2 valid closed closed2 familyGround g C E U Rf Rc).2 index + · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u _).2 ⟨hu, rfl⟩ + · exact (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w _).2 ⟨hw, rfl⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid +local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d ∅ T T2 valid valid2 +local notation "termGraph" => fun g => Name.renameFamilyGraph s (a.iso g) T valid + +noncomputable def stageOneAssignmentActionFamily : ZFSet.{u} := + familyCodeGraph t.encode (M.stageOneAssignmentActionGraph a s b d T T2 valid valid2) + +theorem pair_mem_stageOneAssignmentActionFamily (g : G) (F : ZFSet.{u}) : + ZFSet.pair (t.encode g) F ∈ M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 ↔ + F = M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 g := + pair_mem_familyCodeGraph _ _ t.injective g F + +theorem stageOneAssignmentActionFamily_function : + FunctionGraphOn t.carrier (M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2) := by + have equal : ZFSet.range t.encode = t.carrier := by + apply ZFSet.ext + intro x + exact ZFSet.mem_range.trans (t.mem_carrier x).symm + simpa only [stageOneAssignmentActionFamily, equal] using familyCodeGraph_function t.encode + (M.stageOneAssignmentActionGraph a s b d T T2 valid valid2) t.injective + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem stageOneAssignmentActionFamily_mem + (group : t.carrier ∈ M.sets) (hT : T ∈ M.sets) (indexGround : I ∈ M.sets) + (indexFamily : M.niceRefinementIndexActionFamily a s t b d ∅ T T2 valid valid2 ∈ M.sets) + (termFamily : a.termActionFamily s t T valid ∈ M.sets) : + M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 ∈ M.sets := by + have pairs := M.familyCodeGraph_relationProducts_mem t T T T T (termGraph) (termGraph) + pairing unions powers separation group hT hT hT hT termFamily termFamily + have hTT := M.prod_mem pairing unions powers separation hT hT + exact M.familyCodeGraph_relationProducts_mem t I (ZFSet.prod T T) I (ZFSet.prod T T) + (indexGraph) (fun g => relationProduct T T T T ((termGraph) g) ((termGraph) g)) + pairing unions powers separation group indexGround hTT indexGround hTT indexFamily pairs + +theorem stageOneAssignmentActionFamily_mem_of_inputs + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (order : s.conditionOrder ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (indexGround : I ∈ M.sets) + (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) + (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) : + M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 ∈ M.sets := by + have indices := M.niceRefinementIndexActionFamily_mem a s t b d ∅ T T2 valid valid2 + pairing unions powers separation collection carrier group nodes order maps nodeMaps + (M.empty_mem ⟨T,hT⟩) closed closed2 familyGround indexGround hT hT2 + have terms := M.termActionFamily_mem a s t T valid pairing unions powers separation + collection carrier group maps hT closed + exact M.stageOneAssignmentActionFamily_mem a s t b d T T2 valid valid2 + pairing unions powers separation group hT indexGround indices terms + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "indexGraph" => M.niceRefinementIndexActionGraph a s b d level T T2 valid valid2 +local notation "termGraph" => fun g => Name.renameFamilyGraph s (a.iso g) T valid + +noncomputable def refinementAssignmentActionFamily : ZFSet.{u} := + familyCodeGraph t.encode (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2) + +theorem pair_mem_refinementAssignmentActionFamily (g : G) (F : ZFSet.{u}) : + ZFSet.pair (t.encode g) F ∈ M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2 ↔ + F = M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g := + pair_mem_familyCodeGraph _ _ t.injective g F + +theorem refinementAssignmentActionFamily_function : + FunctionGraphOn t.carrier (M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2) := by + have equal : ZFSet.range t.encode = t.carrier := by + apply ZFSet.ext + intro x + exact ZFSet.mem_range.trans (t.mem_carrier x).symm + simpa only [refinementAssignmentActionFamily, equal] using familyCodeGraph_function t.encode + (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2) t.injective + +theorem refinementAssignmentActionFamily_zero : + M.refinementAssignmentActionFamily a s t b d ∅ T T2 valid valid2 = + M.stageOneAssignmentActionFamily a s t b d T T2 valid valid2 := rfl + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem refinementAssignmentActionFamily_mem + (group : t.carrier ∈ M.sets) (hT : T ∈ M.sets) (indexGround : I ∈ M.sets) + (indexFamily : M.niceRefinementIndexActionFamily a s t b d level T T2 valid valid2 ∈ M.sets) + (termFamily : a.termActionFamily s t T valid ∈ M.sets) : + M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2 ∈ M.sets := by + have pairs := M.familyCodeGraph_relationProducts_mem t T T T T (termGraph) (termGraph) + pairing unions powers separation group hT hT hT hT termFamily termFamily + have hTT := M.prod_mem pairing unions powers separation hT hT + exact M.familyCodeGraph_relationProducts_mem t I (ZFSet.prod T T) I (ZFSet.prod T T) + (indexGraph) (fun g => relationProduct T T T T ((termGraph) g) ((termGraph) g)) + pairing unions powers separation group indexGround hTT indexGround hTT indexFamily pairs + +theorem refinementAssignmentActionFamily_mem_of_inputs + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (order : s.conditionOrder ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (indexGround : I ∈ M.sets) + (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) + (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) + (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) : + M.refinementAssignmentActionFamily a s t b d level T T2 valid valid2 ∈ M.sets := by + have indices := M.niceRefinementIndexActionFamily_mem a s t b d level T T2 valid valid2 + pairing unions powers separation collection carrier group nodes order maps nodeMaps + hLevel closed closed2 familyGround indexGround hT hT2 + have terms := M.termActionFamily_mem a s t T valid pairing unions powers separation + collection carrier group maps hT closed + exact M.refinementAssignmentActionFamily_mem a s t b d level T T2 valid valid2 + pairing unions powers separation group hT indexGround indices terms + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentLabelNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentLabelNames.lean index 1ecddde026d8b58f8ff585aab0c2294c9ca267ce..f4a70a111db2cac95926923499467e683b6f282f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentLabelNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementAssignmentLabelNames.lean @@ -1,39 +1,39 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementLiftedClassGraphs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementAssignmentLabelEntries - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P Q : Type u} [PartialOrder P] [OrderTop P] -variable (lower : Presentation P) (upper : Presentation Q) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem refinementAssignmentLabel_mem - (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) - (lowerOrder : lower.conditionOrder ∈ M.sets) - (incl : P → Q) (inclGround : lower.graph upper incl ∈ M.sets) (one : Q) - (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName lower z) - (idx : ZFSet.{u}) (hIdx : idx ∈ M.sets) - (Rf Rc : Name lower) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) : - (Name.refinementAssignmentLabel upper incl one T valid idx Rf Rc).val ∈ M.sets := by - obtain ⟨Gc, hGc, coarse⟩ := M.exists_refinementLiftedClassGraph lower upper - pairing unions powers separation collection lowerGround upperGround lowerOrder - incl inclGround T hT valid Rc hRc - obtain ⟨Gf, hGf, fine⟩ := M.exists_refinementLiftedClassGraph lower upper - pairing unions powers separation collection lowerGround upperGround lowerOrder - incl inclGround T hT valid Rf hRf - exact M.refinementAssignmentLabel_mem_of_graphs upper incl one pairing unions powers separation - upperGround (M.transitive upperGround (upper.encode_mem one)) hT valid idx hIdx Rf Rc - Gc Gf hGc hGf coarse fine - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementLiftedClassGraphs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementAssignmentLabelEntries + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P Q : Type u} [PartialOrder P] [OrderTop P] +variable (lower : Presentation P) (upper : Presentation Q) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem refinementAssignmentLabel_mem + (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) + (lowerOrder : lower.conditionOrder ∈ M.sets) + (incl : P → Q) (inclGround : lower.graph upper incl ∈ M.sets) (one : Q) + (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName lower z) + (idx : ZFSet.{u}) (hIdx : idx ∈ M.sets) + (Rf Rc : Name lower) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) : + (Name.refinementAssignmentLabel upper incl one T valid idx Rf Rc).val ∈ M.sets := by + obtain ⟨Gc, hGc, coarse⟩ := M.exists_refinementLiftedClassGraph lower upper + pairing unions powers separation collection lowerGround upperGround lowerOrder + incl inclGround T hT valid Rc hRc + obtain ⟨Gf, hGf, fine⟩ := M.exists_refinementLiftedClassGraph lower upper + pairing unions powers separation collection lowerGround upperGround lowerOrder + incl inclGround T hT valid Rf hRf + exact M.refinementAssignmentLabel_mem_of_graphs upper incl one pairing unions powers separation + upperGround (M.transitive upperGround (upper.encode_mem one)) hT valid idx hIdx Rf Rc + Gc Gf hGc hGf coarse fine + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementCollisionSymmetry.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementCollisionSymmetry.lean index e5fdcd32ded3f9761aab7515d850fdb2b49c7f79..a9e73bfa5259bfcb654db8e0163a08e439b5e29f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementCollisionSymmetry.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementCollisionSymmetry.lean @@ -1,60 +1,60 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedPositionCollisions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -theorem stageOneCollisionTest_symm (Rf Rc u u' w w' : (M.nameDomain s).names) (p : P) - (collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' p) : - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u' u w' w p := by - constructor - · intro q hq facts - exact collision.1 q hq ⟨Name.forcesEq_symm facts.1, - fun r hr equal => facts.2 r hr (Name.forcesEq_symm equal)⟩ - · intro q hq facts - exact collision.2 q hq ⟨Name.forcesEq_symm facts.1, - fun r hr equal => facts.2 r hr (Name.forcesEq_symm equal)⟩ - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (level T2 : ZFSet.{u}) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include indices in -theorem refinementLevelRawCollision_both_orders (C E : L) (U Rf Rc u u' w w' : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) (p : P) - (collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' p) : - stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val u'.val.val w.val.val w'.val.val (s.encode p) ∧ - stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u'.val.val u.val.val w'.val.val w.val.val (s.encode p) := by - refine ⟨(M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices C E U Rf Rc u u' w w' member p).2 collision, ?_⟩ - exact (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices C E U Rf Rc u' u w' w member p).2 - (M.stageOneCollisionTest_symm s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' p collision) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedPositionCollisions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +theorem stageOneCollisionTest_symm (Rf Rc u u' w w' : (M.nameDomain s).names) (p : P) + (collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' p) : + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u' u w' w p := by + constructor + · intro q hq facts + exact collision.1 q hq ⟨Name.forcesEq_symm facts.1, + fun r hr equal => facts.2 r hr (Name.forcesEq_symm equal)⟩ + · intro q hq facts + exact collision.2 q hq ⟨Name.forcesEq_symm facts.1, + fun r hr equal => facts.2 r hr (Name.forcesEq_symm equal)⟩ + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (level T2 : ZFSet.{u}) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include indices in +theorem refinementLevelRawCollision_both_orders (C E : L) (U Rf Rc u u' w w' : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) (p : P) + (collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' p) : + stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val u'.val.val w.val.val w'.val.val (s.encode p) ∧ + stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u'.val.val u.val.val w'.val.val w.val.val (s.encode p) := by + refine ⟨(M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices C E U Rf Rc u u' w w' member p).2 collision, ?_⟩ + exact (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices C E U Rf Rc u' u w' w member p).2 + (M.stageOneCollisionTest_symm s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' p collision) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementDiagonalConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementDiagonalConditions.lean index 1e44b129ddfe58fe3dd0c0f621163eeb10131b1a..b83a71e663c1fdde9f52f96bc39150532e83ac8a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementDiagonalConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementDiagonalConditions.lean @@ -1,60 +1,60 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementVisibleLiftInsertions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (small : M.sets.Countable) -variable (C E : L) (U R : (M.nameDomain s).names) -variable (member : (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) ∈ M.niceRefinementIndices a s b d level T T2 valid) -include pairing unions powers separation collection carrier order nodes hT indices system small member - -theorem stageTwoConditions_insert_diagonal - (infinite : Realize M.sets infinity Fin.elim0) - {rows I levels stages row A : ZFSet.{u}} (hI : I ∈ M.sets) - (function : ZFSet.IsFunc (stageOneAssignments I T) stages levels) - (u : (M.nameDomain s).names) (term : u.val.val ∈ T) - (atLevel : ZFSet.pair (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) level ∈ levels) - (old : ZFSet.pair row A ∈ M.stageTwoConditions rows I levels level (M.refinementLevelFormulaData a s b d level T T2 valid)) - (p : P) (encoded : s.encode p = ZFSet.pair row (assignmentCut levels level A)) - (diagonal : ∀ v ∈ T, ∀ z ∈ T, stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) v z ∈ A → v = z) - (active : Name.ForcesMem p u.val U.val) : - ZFSet.pair row (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) ∈ - M.stageTwoConditions rows I levels level (M.refinementLevelFormulaData a s b d level T T2 valid) ∧ - assignmentCut levels level (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) = - assignmentCut levels level A := by - have oldTests := ((M.pair_mem_stageTwoConditions rows I levels level (M.refinementLevelFormulaData a s b d level T T2 valid) row A).1 old).2.2.2.2.2 - rw [← encoded] at oldTests - have inserted := M.refinementLevelRawTests_insert_diagonal a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system small C E U R member p oldTests diagonal u term active - have obligations := (stageOneRawTests_insert_iff M (M.refinementLevelFormulaData a s b d level T T2 valid) (t := (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val)) (u := u.val.val) (w := u.val.val) - member term term).1 inserted - rw [encoded] at obligations - have ground := M.transitive (M.stageOneAssignments_mem pairing unions powers separation hI hT) - (ZFSet.pair_mem_prod.1 (function.1 atLevel)).1 - exact M.stageTwoConditions_insert pairing unions powers separation infinite (M.refinementLevelFormulaData a s b d level T T2 valid) function atLevel ground old - obligations.2.1 obligations.2.2.1 obligations.2.2.2.1 obligations.2.2.2.2 - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementVisibleLiftInsertions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (small : M.sets.Countable) +variable (C E : L) (U R : (M.nameDomain s).names) +variable (member : (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) ∈ M.niceRefinementIndices a s b d level T T2 valid) +include pairing unions powers separation collection carrier order nodes hT indices system small member + +theorem stageTwoConditions_insert_diagonal + (infinite : Realize M.sets infinity Fin.elim0) + {rows I levels stages row A : ZFSet.{u}} (hI : I ∈ M.sets) + (function : ZFSet.IsFunc (stageOneAssignments I T) stages levels) + (u : (M.nameDomain s).names) (term : u.val.val ∈ T) + (atLevel : ZFSet.pair (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) level ∈ levels) + (old : ZFSet.pair row A ∈ M.stageTwoConditions rows I levels level (M.refinementLevelFormulaData a s b d level T T2 valid)) + (p : P) (encoded : s.encode p = ZFSet.pair row (assignmentCut levels level A)) + (diagonal : ∀ v ∈ T, ∀ z ∈ T, stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) v z ∈ A → v = z) + (active : Name.ForcesMem p u.val U.val) : + ZFSet.pair row (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) ∈ + M.stageTwoConditions rows I levels level (M.refinementLevelFormulaData a s b d level T T2 valid) ∧ + assignmentCut levels level (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) = + assignmentCut levels level A := by + have oldTests := ((M.pair_mem_stageTwoConditions rows I levels level (M.refinementLevelFormulaData a s b d level T T2 valid) row A).1 old).2.2.2.2.2 + rw [← encoded] at oldTests + have inserted := M.refinementLevelRawTests_insert_diagonal a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system small C E U R member p oldTests diagonal u term active + have obligations := (stageOneRawTests_insert_iff M (M.refinementLevelFormulaData a s b d level T T2 valid) (t := (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val)) (u := u.val.val) (w := u.val.val) + member term term).1 inserted + rw [encoded] at obligations + have ground := M.transitive (M.stageOneAssignments_mem pairing unions powers separation hI hT) + (ZFSet.pair_mem_prod.1 (function.1 atLevel)).1 + exact M.stageTwoConditions_insert pairing unions powers separation infinite (M.refinementLevelFormulaData a s b d level T T2 valid) function atLevel ground old + obligations.2.1 obligations.2.2.1 obligations.2.2.2.1 obligations.2.2.2.2 + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementValidityForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementValidityForcing.lean index f8d9b1c3ca4ee73d24cd83517cb145a2c581c03a..ad97b27f372abfe5f42ad37f048f02fb55eda054 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementValidityForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRefinementValidityForcing.lean @@ -1,62 +1,62 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace SetFormula - -def refinementValidityForcingFormula {n : Nat} - (U Rf Rc T carrier order condition : Fin n) : SetFormula n := - forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) - BoundedFormula.refinementValidityFormula.toFormula - (extend carrier (extend order Fin.elim0)) condition - (extend U (extend Rf (extend Rc (extend T Fin.elim0)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_refinementValidityForcing - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {n : Nat} (ui fi ci ti pi oi qi : Fin n) (env : Fin n → ZFSet.{u}) - (nameEnv : Assignment (M.nameDomain s) 4) (p : P) - (hU : env ui = (nameEnv 0).val.val) (hRf : env fi = (nameEnv 1).val.val) - (hRc : env ci = (nameEnv 2).val.val) (hT : env ti = (nameEnv 3).val.val) - (hP : env pi = s.carrier) (hO : env oi = s.conditionOrder) (hQ : env qi = s.encode p) : - Realize M.sets (refinementValidityForcingFormula ui fi ci ti pi oi qi) env ↔ - Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula nameEnv p := by - exact M.realize_ordinaryGroundForcing s pairing unions powers separation collection carrier order - (0 : Fin 2) 1 BoundedFormula.refinementValidityFormula.toFormula - (extend pi (extend oi Fin.elim0)) qi - (extend ui (extend fi (extend ci (extend ti Fin.elim0)))) env hP hO p nameEnv hQ - (Fin.cases hU (Fin.cases hRf (Fin.cases hRc (Fin.cases hT (fun i => Fin.elim0 i))))) - -theorem refinementValidity_eval (env : Assignment (M.nameDomain s) 4) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (forced : Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula env p) : - RefinementValidityCode - (Name.eval {q | H.mem q} (env 3).val) (Name.eval {q | H.mem q} (env 0).val) - (Name.eval {q | H.mem q} (env 1).val) (Name.eval {q | H.mem q} (env 2).val) := by - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - have truth := forces_sound (M.nameDomain s) H generic _ env hp forced - exact (evaluated.realize_refinementValidityFormula - (evalAssignment {q | H.mem q} env) (fun j => ⟨env j, rfl⟩)).1 truth - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace SetFormula + +def refinementValidityForcingFormula {n : Nat} + (U Rf Rc T carrier order condition : Fin n) : SetFormula n := + forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) + BoundedFormula.refinementValidityFormula.toFormula + (extend carrier (extend order Fin.elim0)) condition + (extend U (extend Rf (extend Rc (extend T Fin.elim0)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_refinementValidityForcing + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {n : Nat} (ui fi ci ti pi oi qi : Fin n) (env : Fin n → ZFSet.{u}) + (nameEnv : Assignment (M.nameDomain s) 4) (p : P) + (hU : env ui = (nameEnv 0).val.val) (hRf : env fi = (nameEnv 1).val.val) + (hRc : env ci = (nameEnv 2).val.val) (hT : env ti = (nameEnv 3).val.val) + (hP : env pi = s.carrier) (hO : env oi = s.conditionOrder) (hQ : env qi = s.encode p) : + Realize M.sets (refinementValidityForcingFormula ui fi ci ti pi oi qi) env ↔ + Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula nameEnv p := by + exact M.realize_ordinaryGroundForcing s pairing unions powers separation collection carrier order + (0 : Fin 2) 1 BoundedFormula.refinementValidityFormula.toFormula + (extend pi (extend oi Fin.elim0)) qi + (extend ui (extend fi (extend ci (extend ti Fin.elim0)))) env hP hO p nameEnv hQ + (Fin.cases hU (Fin.cases hRf (Fin.cases hRc (Fin.cases hT (fun i => Fin.elim0 i))))) + +theorem refinementValidity_eval (env : Assignment (M.nameDomain s) 4) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (forced : Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula env p) : + RefinementValidityCode + (Name.eval {q | H.mem q} (env 3).val) (Name.eval {q | H.mem q} (env 0).val) + (Name.eval {q | H.mem q} (env 1).val) (Name.eval {q | H.mem q} (env 2).val) := by + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + have truth := forces_sound (M.nameDomain s) H generic _ env hp forced + exact (evaluated.realize_refinementValidityFormula + (evalAssignment {q | H.mem q} env) (fun j => ⟨env j, rfl⟩)).1 truth + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRenamedNameFamilyBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRenamedNameFamilyBounds.lean index 9f9f2090903bc33737c2ea5f3b0dea72bbde0ddf..c92726c5663ddf1809efb17dc26ec919c70df7be 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRenamedNameFamilyBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRenamedNameFamilyBounds.lean @@ -1,435 +1,435 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleProvenance -import OAI.SetTheory.PartitionPrinciple.Definability.GroundNiceVisibilityGraphs -import OAI.SetTheory.PartitionPrinciple.Models.GroundRefinementQuotientNames - -namespace OAI - -namespace PartitionPilot.Forcing -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure NiceNameSystem (M : TransitiveGround.{u}) (a : PosetAction G P) - (s : Presentation P) (b : Presentation L) (d : PosetAction G L) (base : L) - (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Prop where - candidate_graph_ground : M.niceNameCandidateGraph a s b T d.principalFix ∈ M.sets - candidate_graph_function : FunctionGraphOn b.carrier - (M.niceNameCandidateGraph a s b T d.principalFix) - candidate_entries : ∀ v z, ZFSet.pair (b.encode v) z ∈ - M.niceNameCandidateGraph a s b T d.principalFix ↔ - z = M.niceNameCandidates a s T (d.principalFix v) - visibility_graph_ground : M.niceVisibilityGraph a s b T d.principalFix ∈ M.sets - visibility_graph_function : FunctionGraphOn b.carrier - (M.niceVisibilityGraph a s b T d.principalFix) - visibility_entries : ∀ v z, ZFSet.pair (b.encode v) z ∈ - M.niceVisibilityGraph a s b T d.principalFix ↔ - z = (M.niceVisibilityName a s T (d.principalFix v)).val - candidate_hs : ∀ v (τ : Name s), τ.val ∈ M.niceNameCandidates a s T (d.principalFix v) → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ - visibility_ground : ∀ v, (M.niceVisibilityName a s T (d.principalFix v)).val ∈ M.sets - visibility_support : ∀ v, d.principalFix v ≤ - a.stabilizer s (M.niceVisibilityName a s T (d.principalFix v)) - visibility_hs : ∀ v, HereditarilySymmetric a s (d.principalSupportFamily base directed) - (M.niceVisibilityName a s T (d.principalFix v)) - visibility_action : ∀ g v, a.act s g (M.niceVisibilityName a s T (d.principalFix v)) = - M.niceVisibilityName a s T (d.principalFix (d.iso g v)) - normalization_candidate : ∀ v (τ : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s τ.val → - (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ - M.niceNameCandidates a s T (d.principalFix v) - normalization_visible : ∀ v (τ : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s τ.val → - ∀ (H : ConditionFilter P), H.GenericFor (formulaFamily (M.nameDomain s)) → - Name.eval {p | H.mem p} τ.val ⊆ Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) → - Name.eval {p | H.mem p} τ.val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - -include pairing unions powers separation collection carrier order maps hT valid terms in -theorem niceNormalize_mem_niceNameCandidates (K : Subgroup G) - (τ : (M.nameDomain s).names) (fixed : K ≤ a.stabilizer s τ.val) : - (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ M.niceNameCandidates a s T K := by - apply (M.mem_niceNameCandidates a s T K _).2 - refine ⟨M.niceNormalize_mem s pairing unions powers separation collection carrier order hT valid τ, ?_⟩ - exact Name.niceNormalize_niceNameCode a (M.nameDomain s) - (fun g σ hσ => M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ) - T valid terms τ K fixed - -include pairing unions powers separation collection carrier order maps hT valid terms in -theorem niceNormalize_mem_eval_niceVisibilityName (K : Subgroup G) - (τ : (M.nameDomain s).names) (fixed : K ≤ a.stabilizer s τ.val) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (subset : Name.eval {p | H.mem p} τ.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) : - Name.eval {p | H.mem p} τ.val ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T K) := by - apply (M.mem_eval_niceVisibilityName a s T K {p | H.mem p} H.top_mem _).2 - refine ⟨Name.niceNormalize (M.nameDomain s) T valid τ, - M.niceNormalize_mem_niceNameCandidates a s t pairing unions powers separation collection - carrier order maps hT valid terms K τ fixed, ?_⟩ - exact Name.eval_niceNormalize_of_subset (M.nameDomain s) T valid τ - (M.familySet_mem s ⊤ pairing unions powers separation hT - (M.transitive carrier (s.encode_mem ⊤)) valid) H generic subset - -include pairing unions powers separation collection carrier order maps hT valid terms in -theorem niceNameSystem (b : Presentation L) (d : PosetAction G L) (base : L) - (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (children : ∀ σ : Name s, σ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) σ) : - NiceNameSystem M a s b d base directed T valid where - candidate_graph_ground := M.niceNameCandidateGraph_mem a s t b d.principalFix - pairing unions powers separation collection carrier group indices supports maps hT valid - candidate_graph_function := M.niceNameCandidateGraph_function a s b T d.principalFix - candidate_entries := M.pair_mem_niceNameCandidateGraph a s b T d.principalFix - visibility_graph_ground := M.niceVisibilityGraph_mem a s t b d.principalFix - pairing unions powers separation collection carrier group indices supports maps hT valid - visibility_graph_function := M.niceVisibilityGraph_function a s b T d.principalFix - visibility_entries := M.pair_mem_niceVisibilityGraph a s b T d.principalFix - candidate_hs := fun v τ member => niceNameCode_principal_hs a s d base v directed children - ((M.mem_niceNameCandidates a s T (d.principalFix v) τ.val).1 member).2 - visibility_ground := fun v => M.niceVisibilityName_mem a s t b d.principalFix - pairing unions powers separation collection carrier group supports maps hT valid v - (M.transitive indices (b.encode_mem v)) - visibility_support := fun v => M.niceVisibilityName_support a s T (d.principalFix v) - visibility_hs := fun v => M.niceVisibilityName_principal_hs a s d base v directed T children - visibility_action := M.act_niceVisibilityName a s t d pairing unions powers separation - collection carrier maps terms - normalization_candidate := fun v τ fixed => - M.niceNormalize_mem_niceNameCandidates a s t pairing unions powers separation collection - carrier order maps hT valid terms (d.principalFix v) τ fixed - normalization_visible := fun v τ fixed H generic subset => - M.niceNormalize_mem_eval_niceVisibilityName a s t pairing unions powers separation collection - carrier order maps hT valid terms (d.principalFix v) τ fixed H generic subset - -end TransitiveGround -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -noncomputable def stageOneClassName (R w : (M.nameDomain s).names) : (M.nameDomain s).names := - ⟨Name.refinementClass T valid R.val w.val, - M.refinementClass_mem s pairing unions powers separation collection carrier order hT valid - R.val w.val R.property w.property⟩ - -noncomputable def stageOneMapName (U Rf Rc : (M.nameDomain s).names) : (M.nameDomain s).names := - ⟨Name.refinementNaturalMap T valid U.val Rf.val Rc.val, - M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order hT valid - U.val Rf.val Rc.val U.property Rf.property Rc.property⟩ - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -noncomputable def stageOneVisibilityName - (system : NiceNameSystem M a s b d base directed T valid) (v : L) : - (M.nameDomain s).names := - ⟨M.niceVisibilityName a s T (d.principalFix v), system.visibility_ground v⟩ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) -variable (d : PosetAction G L) (base : L) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T : ZFSet.{u}) (H : ConditionFilter P) - -noncomputable def visibleSupportProfile (z : ZFSet.{u}) : ZFSet.{u} := - b.subset (fun v => z ∈ Name.eval {p | H.mem p} - (M.niceVisibilityName a s T (d.principalFix v))) - -theorem encode_mem_visibleSupportProfile (z : ZFSet.{u}) (v : L) : - b.encode v ∈ M.visibleSupportProfile a s b d T H z ↔ - z ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := - b.encode_mem_subset _ v - -theorem visibleSupportProfile_upward (z : ZFSet.{u}) {v w : L} (lower : v ≤ w) - (member : b.encode v ∈ M.visibleSupportProfile a s b d T H z) : - b.encode w ∈ M.visibleSupportProfile a s b d T H z := by - have seen := (M.encode_mem_visibleSupportProfile a s b d T H z v).1 member - obtain ⟨τ, candidate, equal⟩ := - (M.mem_eval_niceVisibilityName a s T (d.principalFix v) _ H.top_mem z).1 seen - have data := (M.name_mem_niceNameCandidates a s T (d.principalFix v) τ).1 candidate - apply (M.encode_mem_visibleSupportProfile a s b d T H z w).2 - apply (M.mem_eval_niceVisibilityName a s T (d.principalFix w) _ H.top_mem z).2 - exact ⟨τ, (M.name_mem_niceNameCandidates a s T (d.principalFix w) τ).2 - ⟨data.1, data.2.1, le_trans (d.principalFix_antitone lower) data.2.2⟩, equal⟩ - -variable (valid : ∀ z ∈ T, IsName s z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (generic : H.GenericFor (formulaFamily (M.nameDomain s))) -variable (z : (M.nameDomain s).names) -variable (hs : HereditarilySymmetric a s (d.principalSupportFamily base directed) z.val) -variable (subset : Name.eval {p | H.mem p} z.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - -include system generic hs subset in -theorem visibleSupportProfile_nonempty : - (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)).Nonempty := by - obtain ⟨v, support⟩ := hs.symmetric - exact ⟨b.encode v, (M.encode_mem_visibleSupportProfile a s b d T H _ v).2 - (system.normalization_visible v z support H generic subset)⟩ - -variable (meet : L → L → L) -variable (descent : ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - -include system generic subset descent in -theorem visibleSupportProfile_meet (v w : L) - (left : b.encode v ∈ M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) - (right : b.encode w ∈ M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) : - b.encode (meet v w) ∈ M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) := by - obtain ⟨x, hx, ex⟩ := (M.mem_eval_niceVisibilityName a s T (d.principalFix v) _ H.top_mem _).1 - ((M.encode_mem_visibleSupportProfile a s b d T H _ v).1 left) - obtain ⟨y, hy, ey⟩ := (M.mem_eval_niceVisibilityName a s T (d.principalFix w) _ H.top_mem _).1 - ((M.encode_mem_visibleSupportProfile a s b d T H _ w).1 right) - have dx := (M.name_mem_niceNameCandidates a s T (d.principalFix v) x).1 hx - have dy := (M.name_mem_niceNameCandidates a s T (d.principalFix w) y).1 hy - obtain ⟨τ, _, fixed, equal⟩ := descent v w ⟨x, dx.1⟩ ⟨y, dy.1⟩ dx.2.2 dy.2.2 - (system.candidate_hs v x hx) (system.candidate_hs w y hy) (ex.trans ey.symm) - have target : Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} z.val := equal.trans ex - have bounded : Name.eval {p | H.mem p} τ.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := target.symm ▸ subset - apply (M.encode_mem_visibleSupportProfile a s b d T H _ (meet v w)).2 - exact target ▸ system.normalization_visible (meet v w) τ fixed H generic bounded - -include system generic hs subset descent in -theorem visibleSupportProfile_filter : - MeetFilterCode b.carrier b.conditionOrder ((b.product b).graph b (fun vw => meet vw.1 vw.2)) - (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) := by - refine ⟨b.subset_carrier _, M.visibleSupportProfile_nonempty a s b d base directed T H - valid system generic z hs subset, ?_, ?_⟩ - · intro x hx y hy lower - obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ hx) - obtain ⟨w, rfl⟩ := (b.mem_carrier y).1 hy - exact M.visibleSupportProfile_upward a s b d T H _ ((b.pair_mem_conditionOrder v w).1 lower) hx - · intro x hx y hy out entry - obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ hx) - obtain ⟨w, rfl⟩ := (b.mem_carrier y).1 (b.subset_carrier _ hy) - have outCarrier := (ZFSet.pair_mem_prod.1 - (((b.product b).graph_isFunc b (fun vw => meet vw.1 vw.2)).1 entry)).2 - obtain ⟨k, rfl⟩ := (b.mem_carrier out).1 outCarrier - have equal := ((b.product b).pair_mem_graph b (fun vw => meet vw.1 vw.2) (v, w) k).1 entry - exact equal ▸ M.visibleSupportProfile_meet a s b d base directed T H valid system generic z - subset meet descent v w hx hy - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem pairEmpty_name_mem (hs : s.carrier ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) : - (Name.presentationEquiv s s.pairEmpty τ).val ∈ M.sets := - M.rename_between_mem s s.pairEmpty pairing unions powers separation collection hs - (M.pairEmpty_carrier_mem pairing unions powers separation s hs) id - (M.pairEmpty_forwardGraph_mem pairing unions powers separation s hs) τ hτ - -theorem pairEmpty_name_inverse_mem (hs : s.carrier ∈ M.sets) - (τ : Name s.pairEmpty) (hτ : τ.val ∈ M.sets) : - ((Name.presentationEquiv s s.pairEmpty).symm τ).val ∈ M.sets := - M.rename_between_mem s.pairEmpty s pairing unions powers separation collection - (M.pairEmpty_carrier_mem pairing unions powers separation s hs) hs id - (M.pairEmpty_inverseGraph_mem pairing unions powers separation s hs) τ hτ - -theorem pairEmpty_name_ground_iff (hs : s.carrier ∈ M.sets) (τ : Name s) : - (Name.presentationEquiv s s.pairEmpty τ).val ∈ M.sets ↔ τ.val ∈ M.sets := by - constructor - · intro h - have back := M.pairEmpty_name_inverse_mem s pairing unions powers separation collection hs _ h - simpa only [Equiv.symm_apply_apply] using back - · exact M.pairEmpty_name_mem s pairing unions powers separation collection hs τ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] -variable {G : Type v} [Group G] (a : PosetAction G P) (s : Presentation P) -variable (F : NormalSubgroupFamily G) - -theorem pairEmpty_nameFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hs : s.carrier ∈ M.sets) (T : ZFSet.{u}) (hT : T ∈ M.sets) - (valid : ∀ x ∈ T, IsName s x) - (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : - let lifted := Name.renamedFamily s.pairEmpty id T valid - let graph := Name.renameFamilyGraph s.pairEmpty id T valid - lifted ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - (∀ x ∈ lifted, IsName s.pairEmpty x) ∧ - (∀ σ : Name s.pairEmpty, σ.val ∈ lifted → HereditarilySymmetric a s.pairEmpty F σ) ∧ - (∀ g (σ : Name s.pairEmpty), σ.val ∈ lifted → (a.act s.pairEmpty g σ).val ∈ lifted) ∧ - ∀ (H : Set P) (x : ZFSet.{u}), - (∃ τ : Name s.pairEmpty, τ.val ∈ lifted ∧ Name.eval H τ = x) ↔ - ∃ σ : Name s, σ.val ∈ T ∧ Name.eval H σ = x := by - have target := M.pairEmpty_carrier_mem pairing unions powers separation s hs - have map := M.pairEmpty_forwardGraph_mem pairing unions powers separation s hs - exact ⟨M.renamedFamily_mem s s.pairEmpty pairing unions powers separation collection hs target id map T hT valid, - M.renameFamilyGraph_mem s s.pairEmpty pairing unions powers separation collection hs target id map T hT valid, - Name.presentationFamily_injection s.pairEmpty T valid, - Name.renamedFamily_valid s.pairEmpty id T valid, - Name.renamedFamily_hs a s.pairEmpty F T valid children, - Name.renamedFamily_closed a s.pairEmpty T valid closed, - Name.eval_renamedFamily s.pairEmpty T valid⟩ - -end PartitionPilot.Forcing.TransitiveGround - -section - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -theorem renamedFamily_inverse (t : Presentation P) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) : - renamedFamily s id (renamedFamily t id T valid) (renamedFamily_valid t id T valid) = T := by - apply ZFSet.ext - intro z - rw [mem_renamedFamily] - constructor - · rintro ⟨τ, hτ, equal⟩ - obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ - have same : τ = rename t id σ := Subtype.ext codes - rw [same, rename_comp, Function.id_comp, rename_id] at equal - exact equal.symm ▸ hσ - · intro hz - let σ : Name s := ⟨z, valid z hz⟩ - refine ⟨rename t id σ, (mem_renamedFamily t id T valid _).2 ⟨σ, hz, rfl⟩, ?_⟩ - rw [rename_comp, Function.id_comp, rename_id] - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} - -theorem renamedFamily_below (s t : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) - (forward : s.graph t id ∈ M.sets) (backward : t.graph s id ∈ M.sets) - {T K : ZFSet.{u}} (hT : T ∈ M.sets) (hK : K ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (small : GroundBelow M T K) : - GroundBelow M (Name.renamedFamily t id T valid) K := by - have hLifted := M.renamedFamily_mem s t pairing unions powers separation collection hs ht id forward T hT valid - have validLifted := Name.renamedFamily_valid t id T valid - have hInverse := M.renameFamilyGraph_mem t s pairing unions powers separation collection ht hs id backward - (Name.renamedFamily t id T valid) hLifted validLifted - have inverse := Name.presentationFamily_injection s (Name.renamedFamily t id T valid) validLifted - rw [Name.renamedFamily_inverse] at inverse - exact small.of_embeddable pairing unions powers separation hLifted hT hK ⟨_, hInverse, inverse⟩ - -theorem pairEmpty_renamedFamily_below (s : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (hs : s.carrier ∈ M.sets) {T K : ZFSet.{u}} (hT : T ∈ M.sets) (hK : K ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (small : GroundBelow M T K) : - GroundBelow M (Name.renamedFamily s.pairEmpty id T valid) K := - M.renamedFamily_below s s.pairEmpty pairing unions powers separation collection hs - (M.pairEmpty_carrier_mem pairing unions powers separation s hs) - (M.pairEmpty_forwardGraph_mem pairing unions powers separation s hs) - (M.pairEmpty_inverseGraph_mem pairing unions powers separation s hs) hT hK valid small - -end PartitionPilot.Forcing.TransitiveGround - -end - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -theorem pairEmpty_niceNameSystem (a : PosetAction G P) (s : Presentation P) - (t : Presentation G) (b : Presentation L) (d : PosetAction G L) (base : L) - (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (action : a.actionGraph s t ∈ M.sets) - (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) - (children : ∀ σ : Name s, σ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) σ) : - let lifted := Name.renamedFamily s.pairEmpty id T valid - let graph := Name.renameFamilyGraph s.pairEmpty id T valid - NiceNameSystem M a s b d base directed T valid ∧ - lifted ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ liftedValid : ∀ z ∈ lifted, IsName s.pairEmpty z, - NiceNameSystem M a s.pairEmpty b d base directed lifted liftedValid ∧ - ∀ (H : Set P) (x : ZFSet.{u}), - (∃ τ : Name s.pairEmpty, τ.val ∈ lifted ∧ Name.eval H τ = x) ↔ - ∃ σ : Name s, σ.val ∈ T ∧ Name.eval H σ = x := by - obtain ⟨liftedGround, graphGround, injection, liftedValid, liftedHS, liftedClosed, values⟩ := - M.pairEmpty_nameFamily a s (d.principalSupportFamily base directed) - pairing unions powers separation collection carrier T hT valid closed children - have rawMaps := M.conditionMapFamily_mem_of_actionGraph a s t - pairing unions powers separation collection carrier group action - have pairedCarrier := M.pairEmpty_carrier_mem pairing unions powers separation s carrier - have pairedOrder := M.pairEmpty_order_mem pairing unions powers separation s carrier order - have pairedMaps := M.pairEmpty_conditionMapFamily_mem pairing unions powers separation s a t - collection carrier group action - refine ⟨M.niceNameSystem a s t pairing unions powers separation collection carrier order - rawMaps hT valid closed b d base directed group indices supports children, - liftedGround, graphGround, injection, liftedValid, ?_, values⟩ - exact M.niceNameSystem a s.pairEmpty t pairing unions powers separation collection - pairedCarrier pairedOrder pairedMaps liftedGround liftedValid liftedClosed - b d base directed group indices supports liftedHS - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleProvenance +import OAI.SetTheory.PartitionPrinciple.Definability.GroundNiceVisibilityGraphs +import OAI.SetTheory.PartitionPrinciple.Models.GroundRefinementQuotientNames + +namespace OAI + +namespace PartitionPilot.Forcing +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure NiceNameSystem (M : TransitiveGround.{u}) (a : PosetAction G P) + (s : Presentation P) (b : Presentation L) (d : PosetAction G L) (base : L) + (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Prop where + candidate_graph_ground : M.niceNameCandidateGraph a s b T d.principalFix ∈ M.sets + candidate_graph_function : FunctionGraphOn b.carrier + (M.niceNameCandidateGraph a s b T d.principalFix) + candidate_entries : ∀ v z, ZFSet.pair (b.encode v) z ∈ + M.niceNameCandidateGraph a s b T d.principalFix ↔ + z = M.niceNameCandidates a s T (d.principalFix v) + visibility_graph_ground : M.niceVisibilityGraph a s b T d.principalFix ∈ M.sets + visibility_graph_function : FunctionGraphOn b.carrier + (M.niceVisibilityGraph a s b T d.principalFix) + visibility_entries : ∀ v z, ZFSet.pair (b.encode v) z ∈ + M.niceVisibilityGraph a s b T d.principalFix ↔ + z = (M.niceVisibilityName a s T (d.principalFix v)).val + candidate_hs : ∀ v (τ : Name s), τ.val ∈ M.niceNameCandidates a s T (d.principalFix v) → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ + visibility_ground : ∀ v, (M.niceVisibilityName a s T (d.principalFix v)).val ∈ M.sets + visibility_support : ∀ v, d.principalFix v ≤ + a.stabilizer s (M.niceVisibilityName a s T (d.principalFix v)) + visibility_hs : ∀ v, HereditarilySymmetric a s (d.principalSupportFamily base directed) + (M.niceVisibilityName a s T (d.principalFix v)) + visibility_action : ∀ g v, a.act s g (M.niceVisibilityName a s T (d.principalFix v)) = + M.niceVisibilityName a s T (d.principalFix (d.iso g v)) + normalization_candidate : ∀ v (τ : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s τ.val → + (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ + M.niceNameCandidates a s T (d.principalFix v) + normalization_visible : ∀ v (τ : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s τ.val → + ∀ (H : ConditionFilter P), H.GenericFor (formulaFamily (M.nameDomain s)) → + Name.eval {p | H.mem p} τ.val ⊆ Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) → + Name.eval {p | H.mem p} τ.val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (terms : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + +include pairing unions powers separation collection carrier order maps hT valid terms in +theorem niceNormalize_mem_niceNameCandidates (K : Subgroup G) + (τ : (M.nameDomain s).names) (fixed : K ≤ a.stabilizer s τ.val) : + (Name.niceNormalize (M.nameDomain s) T valid τ).val ∈ M.niceNameCandidates a s T K := by + apply (M.mem_niceNameCandidates a s T K _).2 + refine ⟨M.niceNormalize_mem s pairing unions powers separation collection carrier order hT valid τ, ?_⟩ + exact Name.niceNormalize_niceNameCode a (M.nameDomain s) + (fun g σ hσ => M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ) + T valid terms τ K fixed + +include pairing unions powers separation collection carrier order maps hT valid terms in +theorem niceNormalize_mem_eval_niceVisibilityName (K : Subgroup G) + (τ : (M.nameDomain s).names) (fixed : K ≤ a.stabilizer s τ.val) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (subset : Name.eval {p | H.mem p} τ.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) : + Name.eval {p | H.mem p} τ.val ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T K) := by + apply (M.mem_eval_niceVisibilityName a s T K {p | H.mem p} H.top_mem _).2 + refine ⟨Name.niceNormalize (M.nameDomain s) T valid τ, + M.niceNormalize_mem_niceNameCandidates a s t pairing unions powers separation collection + carrier order maps hT valid terms K τ fixed, ?_⟩ + exact Name.eval_niceNormalize_of_subset (M.nameDomain s) T valid τ + (M.familySet_mem s ⊤ pairing unions powers separation hT + (M.transitive carrier (s.encode_mem ⊤)) valid) H generic subset + +include pairing unions powers separation collection carrier order maps hT valid terms in +theorem niceNameSystem (b : Presentation L) (d : PosetAction G L) (base : L) + (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (children : ∀ σ : Name s, σ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) σ) : + NiceNameSystem M a s b d base directed T valid where + candidate_graph_ground := M.niceNameCandidateGraph_mem a s t b d.principalFix + pairing unions powers separation collection carrier group indices supports maps hT valid + candidate_graph_function := M.niceNameCandidateGraph_function a s b T d.principalFix + candidate_entries := M.pair_mem_niceNameCandidateGraph a s b T d.principalFix + visibility_graph_ground := M.niceVisibilityGraph_mem a s t b d.principalFix + pairing unions powers separation collection carrier group indices supports maps hT valid + visibility_graph_function := M.niceVisibilityGraph_function a s b T d.principalFix + visibility_entries := M.pair_mem_niceVisibilityGraph a s b T d.principalFix + candidate_hs := fun v τ member => niceNameCode_principal_hs a s d base v directed children + ((M.mem_niceNameCandidates a s T (d.principalFix v) τ.val).1 member).2 + visibility_ground := fun v => M.niceVisibilityName_mem a s t b d.principalFix + pairing unions powers separation collection carrier group supports maps hT valid v + (M.transitive indices (b.encode_mem v)) + visibility_support := fun v => M.niceVisibilityName_support a s T (d.principalFix v) + visibility_hs := fun v => M.niceVisibilityName_principal_hs a s d base v directed T children + visibility_action := M.act_niceVisibilityName a s t d pairing unions powers separation + collection carrier maps terms + normalization_candidate := fun v τ fixed => + M.niceNormalize_mem_niceNameCandidates a s t pairing unions powers separation collection + carrier order maps hT valid terms (d.principalFix v) τ fixed + normalization_visible := fun v τ fixed H generic subset => + M.niceNormalize_mem_eval_niceVisibilityName a s t pairing unions powers separation collection + carrier order maps hT valid terms (d.principalFix v) τ fixed H generic subset + +end TransitiveGround +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +noncomputable def stageOneClassName (R w : (M.nameDomain s).names) : (M.nameDomain s).names := + ⟨Name.refinementClass T valid R.val w.val, + M.refinementClass_mem s pairing unions powers separation collection carrier order hT valid + R.val w.val R.property w.property⟩ + +noncomputable def stageOneMapName (U Rf Rc : (M.nameDomain s).names) : (M.nameDomain s).names := + ⟨Name.refinementNaturalMap T valid U.val Rf.val Rc.val, + M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order hT valid + U.val Rf.val Rc.val U.property Rf.property Rc.property⟩ + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +noncomputable def stageOneVisibilityName + (system : NiceNameSystem M a s b d base directed T valid) (v : L) : + (M.nameDomain s).names := + ⟨M.niceVisibilityName a s T (d.principalFix v), system.visibility_ground v⟩ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) +variable (d : PosetAction G L) (base : L) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T : ZFSet.{u}) (H : ConditionFilter P) + +noncomputable def visibleSupportProfile (z : ZFSet.{u}) : ZFSet.{u} := + b.subset (fun v => z ∈ Name.eval {p | H.mem p} + (M.niceVisibilityName a s T (d.principalFix v))) + +theorem encode_mem_visibleSupportProfile (z : ZFSet.{u}) (v : L) : + b.encode v ∈ M.visibleSupportProfile a s b d T H z ↔ + z ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := + b.encode_mem_subset _ v + +theorem visibleSupportProfile_upward (z : ZFSet.{u}) {v w : L} (lower : v ≤ w) + (member : b.encode v ∈ M.visibleSupportProfile a s b d T H z) : + b.encode w ∈ M.visibleSupportProfile a s b d T H z := by + have seen := (M.encode_mem_visibleSupportProfile a s b d T H z v).1 member + obtain ⟨τ, candidate, equal⟩ := + (M.mem_eval_niceVisibilityName a s T (d.principalFix v) _ H.top_mem z).1 seen + have data := (M.name_mem_niceNameCandidates a s T (d.principalFix v) τ).1 candidate + apply (M.encode_mem_visibleSupportProfile a s b d T H z w).2 + apply (M.mem_eval_niceVisibilityName a s T (d.principalFix w) _ H.top_mem z).2 + exact ⟨τ, (M.name_mem_niceNameCandidates a s T (d.principalFix w) τ).2 + ⟨data.1, data.2.1, le_trans (d.principalFix_antitone lower) data.2.2⟩, equal⟩ + +variable (valid : ∀ z ∈ T, IsName s z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (generic : H.GenericFor (formulaFamily (M.nameDomain s))) +variable (z : (M.nameDomain s).names) +variable (hs : HereditarilySymmetric a s (d.principalSupportFamily base directed) z.val) +variable (subset : Name.eval {p | H.mem p} z.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + +include system generic hs subset in +theorem visibleSupportProfile_nonempty : + (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)).Nonempty := by + obtain ⟨v, support⟩ := hs.symmetric + exact ⟨b.encode v, (M.encode_mem_visibleSupportProfile a s b d T H _ v).2 + (system.normalization_visible v z support H generic subset)⟩ + +variable (meet : L → L → L) +variable (descent : ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + +include system generic subset descent in +theorem visibleSupportProfile_meet (v w : L) + (left : b.encode v ∈ M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) + (right : b.encode w ∈ M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) : + b.encode (meet v w) ∈ M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) := by + obtain ⟨x, hx, ex⟩ := (M.mem_eval_niceVisibilityName a s T (d.principalFix v) _ H.top_mem _).1 + ((M.encode_mem_visibleSupportProfile a s b d T H _ v).1 left) + obtain ⟨y, hy, ey⟩ := (M.mem_eval_niceVisibilityName a s T (d.principalFix w) _ H.top_mem _).1 + ((M.encode_mem_visibleSupportProfile a s b d T H _ w).1 right) + have dx := (M.name_mem_niceNameCandidates a s T (d.principalFix v) x).1 hx + have dy := (M.name_mem_niceNameCandidates a s T (d.principalFix w) y).1 hy + obtain ⟨τ, _, fixed, equal⟩ := descent v w ⟨x, dx.1⟩ ⟨y, dy.1⟩ dx.2.2 dy.2.2 + (system.candidate_hs v x hx) (system.candidate_hs w y hy) (ex.trans ey.symm) + have target : Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} z.val := equal.trans ex + have bounded : Name.eval {p | H.mem p} τ.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := target.symm ▸ subset + apply (M.encode_mem_visibleSupportProfile a s b d T H _ (meet v w)).2 + exact target ▸ system.normalization_visible (meet v w) τ fixed H generic bounded + +include system generic hs subset descent in +theorem visibleSupportProfile_filter : + MeetFilterCode b.carrier b.conditionOrder ((b.product b).graph b (fun vw => meet vw.1 vw.2)) + (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) := by + refine ⟨b.subset_carrier _, M.visibleSupportProfile_nonempty a s b d base directed T H + valid system generic z hs subset, ?_, ?_⟩ + · intro x hx y hy lower + obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ hx) + obtain ⟨w, rfl⟩ := (b.mem_carrier y).1 hy + exact M.visibleSupportProfile_upward a s b d T H _ ((b.pair_mem_conditionOrder v w).1 lower) hx + · intro x hx y hy out entry + obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ hx) + obtain ⟨w, rfl⟩ := (b.mem_carrier y).1 (b.subset_carrier _ hy) + have outCarrier := (ZFSet.pair_mem_prod.1 + (((b.product b).graph_isFunc b (fun vw => meet vw.1 vw.2)).1 entry)).2 + obtain ⟨k, rfl⟩ := (b.mem_carrier out).1 outCarrier + have equal := ((b.product b).pair_mem_graph b (fun vw => meet vw.1 vw.2) (v, w) k).1 entry + exact equal ▸ M.visibleSupportProfile_meet a s b d base directed T H valid system generic z + subset meet descent v w hx hy + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem pairEmpty_name_mem (hs : s.carrier ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) : + (Name.presentationEquiv s s.pairEmpty τ).val ∈ M.sets := + M.rename_between_mem s s.pairEmpty pairing unions powers separation collection hs + (M.pairEmpty_carrier_mem pairing unions powers separation s hs) id + (M.pairEmpty_forwardGraph_mem pairing unions powers separation s hs) τ hτ + +theorem pairEmpty_name_inverse_mem (hs : s.carrier ∈ M.sets) + (τ : Name s.pairEmpty) (hτ : τ.val ∈ M.sets) : + ((Name.presentationEquiv s s.pairEmpty).symm τ).val ∈ M.sets := + M.rename_between_mem s.pairEmpty s pairing unions powers separation collection + (M.pairEmpty_carrier_mem pairing unions powers separation s hs) hs id + (M.pairEmpty_inverseGraph_mem pairing unions powers separation s hs) τ hτ + +theorem pairEmpty_name_ground_iff (hs : s.carrier ∈ M.sets) (τ : Name s) : + (Name.presentationEquiv s s.pairEmpty τ).val ∈ M.sets ↔ τ.val ∈ M.sets := by + constructor + · intro h + have back := M.pairEmpty_name_inverse_mem s pairing unions powers separation collection hs _ h + simpa only [Equiv.symm_apply_apply] using back + · exact M.pairEmpty_name_mem s pairing unions powers separation collection hs τ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] +variable {G : Type v} [Group G] (a : PosetAction G P) (s : Presentation P) +variable (F : NormalSubgroupFamily G) + +theorem pairEmpty_nameFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hs : s.carrier ∈ M.sets) (T : ZFSet.{u}) (hT : T ∈ M.sets) + (valid : ∀ x ∈ T, IsName s x) + (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : + let lifted := Name.renamedFamily s.pairEmpty id T valid + let graph := Name.renameFamilyGraph s.pairEmpty id T valid + lifted ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + (∀ x ∈ lifted, IsName s.pairEmpty x) ∧ + (∀ σ : Name s.pairEmpty, σ.val ∈ lifted → HereditarilySymmetric a s.pairEmpty F σ) ∧ + (∀ g (σ : Name s.pairEmpty), σ.val ∈ lifted → (a.act s.pairEmpty g σ).val ∈ lifted) ∧ + ∀ (H : Set P) (x : ZFSet.{u}), + (∃ τ : Name s.pairEmpty, τ.val ∈ lifted ∧ Name.eval H τ = x) ↔ + ∃ σ : Name s, σ.val ∈ T ∧ Name.eval H σ = x := by + have target := M.pairEmpty_carrier_mem pairing unions powers separation s hs + have map := M.pairEmpty_forwardGraph_mem pairing unions powers separation s hs + exact ⟨M.renamedFamily_mem s s.pairEmpty pairing unions powers separation collection hs target id map T hT valid, + M.renameFamilyGraph_mem s s.pairEmpty pairing unions powers separation collection hs target id map T hT valid, + Name.presentationFamily_injection s.pairEmpty T valid, + Name.renamedFamily_valid s.pairEmpty id T valid, + Name.renamedFamily_hs a s.pairEmpty F T valid children, + Name.renamedFamily_closed a s.pairEmpty T valid closed, + Name.eval_renamedFamily s.pairEmpty T valid⟩ + +end PartitionPilot.Forcing.TransitiveGround + +section + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +theorem renamedFamily_inverse (t : Presentation P) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) : + renamedFamily s id (renamedFamily t id T valid) (renamedFamily_valid t id T valid) = T := by + apply ZFSet.ext + intro z + rw [mem_renamedFamily] + constructor + · rintro ⟨τ, hτ, equal⟩ + obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ + have same : τ = rename t id σ := Subtype.ext codes + rw [same, rename_comp, Function.id_comp, rename_id] at equal + exact equal.symm ▸ hσ + · intro hz + let σ : Name s := ⟨z, valid z hz⟩ + refine ⟨rename t id σ, (mem_renamedFamily t id T valid _).2 ⟨σ, hz, rfl⟩, ?_⟩ + rw [rename_comp, Function.id_comp, rename_id] + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} + +theorem renamedFamily_below (s t : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) + (forward : s.graph t id ∈ M.sets) (backward : t.graph s id ∈ M.sets) + {T K : ZFSet.{u}} (hT : T ∈ M.sets) (hK : K ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (small : GroundBelow M T K) : + GroundBelow M (Name.renamedFamily t id T valid) K := by + have hLifted := M.renamedFamily_mem s t pairing unions powers separation collection hs ht id forward T hT valid + have validLifted := Name.renamedFamily_valid t id T valid + have hInverse := M.renameFamilyGraph_mem t s pairing unions powers separation collection ht hs id backward + (Name.renamedFamily t id T valid) hLifted validLifted + have inverse := Name.presentationFamily_injection s (Name.renamedFamily t id T valid) validLifted + rw [Name.renamedFamily_inverse] at inverse + exact small.of_embeddable pairing unions powers separation hLifted hT hK ⟨_, hInverse, inverse⟩ + +theorem pairEmpty_renamedFamily_below (s : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (hs : s.carrier ∈ M.sets) {T K : ZFSet.{u}} (hT : T ∈ M.sets) (hK : K ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (small : GroundBelow M T K) : + GroundBelow M (Name.renamedFamily s.pairEmpty id T valid) K := + M.renamedFamily_below s s.pairEmpty pairing unions powers separation collection hs + (M.pairEmpty_carrier_mem pairing unions powers separation s hs) + (M.pairEmpty_forwardGraph_mem pairing unions powers separation s hs) + (M.pairEmpty_inverseGraph_mem pairing unions powers separation s hs) hT hK valid small + +end PartitionPilot.Forcing.TransitiveGround + +end + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +theorem pairEmpty_niceNameSystem (a : PosetAction G P) (s : Presentation P) + (t : Presentation G) (b : Presentation L) (d : PosetAction G L) (base : L) + (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (action : a.actionGraph s t ∈ M.sets) + (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) + (children : ∀ σ : Name s, σ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) σ) : + let lifted := Name.renamedFamily s.pairEmpty id T valid + let graph := Name.renameFamilyGraph s.pairEmpty id T valid + NiceNameSystem M a s b d base directed T valid ∧ + lifted ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ liftedValid : ∀ z ∈ lifted, IsName s.pairEmpty z, + NiceNameSystem M a s.pairEmpty b d base directed lifted liftedValid ∧ + ∀ (H : Set P) (x : ZFSet.{u}), + (∃ τ : Name s.pairEmpty, τ.val ∈ lifted ∧ Name.eval H τ = x) ↔ + ∃ σ : Name s, σ.val ∈ T ∧ Name.eval H σ = x := by + obtain ⟨liftedGround, graphGround, injection, liftedValid, liftedHS, liftedClosed, values⟩ := + M.pairEmpty_nameFamily a s (d.principalSupportFamily base directed) + pairing unions powers separation collection carrier T hT valid closed children + have rawMaps := M.conditionMapFamily_mem_of_actionGraph a s t + pairing unions powers separation collection carrier group action + have pairedCarrier := M.pairEmpty_carrier_mem pairing unions powers separation s carrier + have pairedOrder := M.pairEmpty_order_mem pairing unions powers separation s carrier order + have pairedMaps := M.pairEmpty_conditionMapFamily_mem pairing unions powers separation s a t + collection carrier group action + refine ⟨M.niceNameSystem a s t pairing unions powers separation collection carrier order + rawMaps hT valid closed b d base directed group indices supports children, + liftedGround, graphGround, injection, liftedValid, ?_, values⟩ + exact M.niceNameSystem a s.pairEmpty t pairing unions powers separation collection + pairedCarrier pairedOrder pairedMaps liftedGround liftedValid liftedClosed + b d base directed group indices supports liftedHS + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentativeAntichainBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentativeAntichainBounds.lean index ad449978d3dd13edc8e8625fe6b17b7d72eeb3f3..2444360f16b749ceaa61f5ad5687bbdab233aff6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentativeAntichainBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentativeAntichainBounds.lean @@ -1,66 +1,66 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable {rows I T Q order D X : ZFSet.{u}} - -theorem representative_antichain_subset_candidate - (shape : Q ⊆ M.stageOneCandidateBound rows I T) - (antichain : OrderAntichainCode Q order D) - (compatible : ∀ row A C, ZFSet.pair row A ∈ Q → ZFSet.pair row C ∈ Q → - AssignmentIndexAgreement A C → - ∃ z ∈ Q, ZFSet.pair z (ZFSet.pair row A) ∈ order ∧ - ZFSet.pair z (ZFSet.pair row C) ∈ order) - (representatives : ∀ row A, ZFSet.pair row A ∈ D → - ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ - assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = - assignmentOnIndices X T A) : - D ⊆ M.stageOneCandidateBound rows X T := by - intro q member - obtain ⟨row, hRow, A, hA, subsetA, smallA, rfl⟩ := - (M.mem_stageOneCandidateBound rows I T q).1 (shape (antichain.1 member)) - obtain ⟨C, inD, contained, exactLists⟩ := representatives row A member - have dataC := (M.pair_mem_stageOneCandidateBound rows I T row C).1 (shape (antichain.1 inD)) - have agreement := assignment_representative_agreement subsetA dataC.2.2.1 contained exactLists - have equal := antichain.eq_of_common_lower inD member - (compatible row C A (antichain.1 inD) (antichain.1 member) agreement) - have same : C = A := (ZFSet.pair_inj.1 equal).2 - have subsetC := (assignment_subset_iff_indices_subset dataC.2.2.1).2 contained - exact (M.pair_mem_stageOneCandidateBound rows X T row A).2 - ⟨hRow, hA, same ▸ subsetC, smallA⟩ - -theorem representative_antichain_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {K : ZFSet.{u}} (hRows : rows ∈ M.sets) (hX : X ∈ M.sets) - (hT : T ∈ M.sets) (hK : K ∈ M.sets) (hD : D ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (ordinal : ordinalSetProperty K) - (strong : GroundStrongLimit M K) - (smallRows : GroundBelow M rows K) (smallX : GroundBelow M X K) - (smallT : GroundBelow M T K) - (shape : Q ⊆ M.stageOneCandidateBound rows I T) - (antichain : OrderAntichainCode Q order D) - (compatible : ∀ row A C, ZFSet.pair row A ∈ Q → ZFSet.pair row C ∈ Q → - AssignmentIndexAgreement A C → - ∃ z ∈ Q, ZFSet.pair z (ZFSet.pair row A) ∈ order ∧ - ZFSet.pair z (ZFSet.pair row C) ∈ order) - (representatives : ∀ row A, ZFSet.pair row A ∈ D → - ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ - assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = - assignmentOnIndices X T A) : GroundBelow M D K := - (GroundBelow.stageOneCandidateBound pairing unions powers separation hRows hX hT hK omega - ordinal strong smallRows smallX smallT).restrict separation hD hK - (M.representative_antichain_subset_candidate shape antichain compatible representatives) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable {rows I T Q order D X : ZFSet.{u}} + +theorem representative_antichain_subset_candidate + (shape : Q ⊆ M.stageOneCandidateBound rows I T) + (antichain : OrderAntichainCode Q order D) + (compatible : ∀ row A C, ZFSet.pair row A ∈ Q → ZFSet.pair row C ∈ Q → + AssignmentIndexAgreement A C → + ∃ z ∈ Q, ZFSet.pair z (ZFSet.pair row A) ∈ order ∧ + ZFSet.pair z (ZFSet.pair row C) ∈ order) + (representatives : ∀ row A, ZFSet.pair row A ∈ D → + ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ + assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = + assignmentOnIndices X T A) : + D ⊆ M.stageOneCandidateBound rows X T := by + intro q member + obtain ⟨row, hRow, A, hA, subsetA, smallA, rfl⟩ := + (M.mem_stageOneCandidateBound rows I T q).1 (shape (antichain.1 member)) + obtain ⟨C, inD, contained, exactLists⟩ := representatives row A member + have dataC := (M.pair_mem_stageOneCandidateBound rows I T row C).1 (shape (antichain.1 inD)) + have agreement := assignment_representative_agreement subsetA dataC.2.2.1 contained exactLists + have equal := antichain.eq_of_common_lower inD member + (compatible row C A (antichain.1 inD) (antichain.1 member) agreement) + have same : C = A := (ZFSet.pair_inj.1 equal).2 + have subsetC := (assignment_subset_iff_indices_subset dataC.2.2.1).2 contained + exact (M.pair_mem_stageOneCandidateBound rows X T row A).2 + ⟨hRow, hA, same ▸ subsetC, smallA⟩ + +theorem representative_antichain_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {K : ZFSet.{u}} (hRows : rows ∈ M.sets) (hX : X ∈ M.sets) + (hT : T ∈ M.sets) (hK : K ∈ M.sets) (hD : D ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (ordinal : ordinalSetProperty K) + (strong : GroundStrongLimit M K) + (smallRows : GroundBelow M rows K) (smallX : GroundBelow M X K) + (smallT : GroundBelow M T K) + (shape : Q ⊆ M.stageOneCandidateBound rows I T) + (antichain : OrderAntichainCode Q order D) + (compatible : ∀ row A C, ZFSet.pair row A ∈ Q → ZFSet.pair row C ∈ Q → + AssignmentIndexAgreement A C → + ∃ z ∈ Q, ZFSet.pair z (ZFSet.pair row A) ∈ order ∧ + ZFSet.pair z (ZFSet.pair row C) ∈ order) + (representatives : ∀ row A, ZFSet.pair row A ∈ D → + ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ + assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = + assignmentOnIndices X T A) : GroundBelow M D K := + (GroundBelow.stageOneCandidateBound pairing unions powers separation hRows hX hT hK omega + ordinal strong smallRows smallX smallT).restrict separation hD hK + (M.representative_antichain_subset_candidate shape antichain compatible representatives) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentedDomainConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentedDomainConditions.lean index 5d9044365d7878856ef14bb7810f25736e86ee10..b82f7c1463c1320480f719b13ef6b6192aa96d5c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentedDomainConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRepresentedDomainConditions.lean @@ -1,493 +1,493 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundAssignmentClassGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.GroundQuantifiedGraphFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentCuts -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace SetFormula - -def stageOneForcingFormula {n : Nat} (phi : SetFormula n) : SetFormula (n + 3) := - forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) phi - (extend 1 (extend 2 Fin.elim0)) 0 (fun j => j.succ.succ.succ) - -def stageOneForcingAt {n m : Nat} (phi : SetFormula m) (p P r : Fin n) - (names : Fin m → Fin n) : SetFormula n := - reindex (extend p (extend P (extend r names))) (stageOneForcingFormula phi) - -def stageOneClassAt {n : Nat} (c T R w P r top : Fin n) : SetFormula n := - reindex (extend c (extend T (extend R (extend w - (extend P (extend r (extend top Fin.elim0))))))) refinementClassCodeFormula - -end SetFormula - -def stageOneRawForces (M : TransitiveGround.{u}) (P r p : ZFSet.{u}) - {n : Nat} (phi : SetFormula n) (names : Fin n → ZFSet.{u}) : Prop := - Realize M.sets (stageOneForcingFormula phi) (extend p (extend P (extend r names))) - -def stageOneRawClass (M : TransitiveGround.{u}) (T P r top R w c : ZFSet.{u}) : Prop := - Realize M.sets refinementClassCodeFormula - (extend c (extend T (extend R (extend w (extend P (extend r (extend top Fin.elim0))))))) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_stageOneForcingAt {n m : Nat} (phi : SetFormula m) (p P r : Fin n) - (names : Fin m → Fin n) (env : Fin n → ZFSet.{u}) : - Realize M.sets (stageOneForcingAt phi p P r names) env ↔ - stageOneRawForces M (env P) (env r) (env p) phi (fun j => env (names j)) := by - rw [stageOneForcingAt, realize_reindex, map_extend, map_extend, map_extend] - rfl - -theorem realize_stageOneClassAt {n : Nat} (c T R w P r top : Fin n) - (env : Fin n → ZFSet.{u}) : - Realize M.sets (stageOneClassAt c T R w P r top) env ↔ - stageOneRawClass M (env T) (env P) (env r) (env top) (env R) (env w) (env c) := by - rw [stageOneClassAt, stageOneRawClass, realize_reindex] - simp only [map_extend] - have empty : (fun j : Fin 0 => env (Fin.elim0 j)) = Fin.elim0 := funext (fun j => Fin.elim0 j) - rw [empty] - -theorem stageOneRawForces_iff {P : Type u} [Preorder P] (s : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {n : Nat} (phi : SetFormula n) (p : P) (names : Assignment (M.nameDomain s) n) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi - (fun j => (names j).val.val) ↔ Forces (M.nameDomain s) phi names p := by - exact M.realize_ordinaryGroundForcing s pairing unions powers separation collection carrier order - (0 : Fin 2) 1 phi (extend 1 (extend 2 Fin.elim0)) 0 (fun j => j.succ.succ.succ) - _ rfl rfl p names rfl (fun _ => rfl) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def PreparationForcingCode (M : TransitiveGround.{u}) - (P order q nodes visibility z F f : ZFSet.{u}) : Prop := - (∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → - (v ∈ F → stageOneRawForces M P order q (.mem 0 1 : SetFormula 2) ![z, V]) ∧ - (v ∉ F → stageOneRawForces M P order q (.neg (.mem 0 1) : SetFormula 2) ![z, V])) ∧ - ∀ v tau, ZFSet.pair v tau ∈ f → - stageOneRawForces M P order q (.equal 0 1 : SetFormula 2) ![z, tau] - -namespace SetFormula - -def preparationForcingFormula {n} (P order q nodes visibility z F f : Fin n) : SetFormula n := - .conj - (allGraphFields visibility - (imp (.mem 1 nodes.succ.succ) - (.conj - (imp (.mem 1 F.succ.succ) - (stageOneForcingAt (.mem 0 1 : SetFormula 2) q.succ.succ P.succ.succ - order.succ.succ ![z.succ.succ, 0])) - (imp (.neg (.mem 1 F.succ.succ)) - (stageOneForcingAt (.neg (.mem 0 1) : SetFormula 2) q.succ.succ P.succ.succ - order.succ.succ ![z.succ.succ, 0]))))) - (allGraphFields f - (stageOneForcingAt (.equal 0 1 : SetFormula 2) q.succ.succ P.succ.succ - order.succ.succ ![z.succ.succ, 0])) - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_preparationForcingFormula {n} (P order q nodes visibility z F f : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (preparationForcingFormula P order q nodes visibility z F f) env ↔ - PreparationForcingCode M (env P) (env order) (env q) (env nodes) - (env visibility) (env z) (env F) (env f) := by - rw [preparationForcingFormula, Realize, M.realize_allGraphFields _ _ env members, - M.realize_allGraphFields _ _ env members] - simp only [realize_imp, Realize, M.realize_stageOneForcingAt] - have names (x y : ZFSet.{u}) : - (fun j : Fin 2 => extend y (extend x env) (![z.succ.succ, 0] j)) = ![env z, y] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)) j - simp only [names] - rfl - -end TransitiveGround - -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection carrier order - -theorem stageOneRawForces_condition_mono {n : Nat} (phi : SetFormula n) - (names : Assignment (M.nameDomain s) n) {p q : P} (qp : q ≤ p) - (forced : stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi - (fun j => (names j).val.val)) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode q) phi - (fun j => (names j).val.val) := by - apply (M.stageOneRawForces_iff s pairing unions powers separation collection - carrier order phi q names).2 - exact forces_mono (M.nameDomain s) phi names - ((M.stageOneRawForces_iff s pairing unions powers separation collection - carrier order phi p names).1 forced) qp - -private theorem rawForces_pair_condition_mono - (phi : SetFormula 2) (z tau : (M.nameDomain s).names) {p q : P} (qp : q ≤ p) - (forced : stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi - ![z.val.val, tau.val.val]) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode q) phi - ![z.val.val, tau.val.val] := by - have fields : (fun j : Fin 2 => (![z, tau] j).val.val) = - ![z.val.val, tau.val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)) j - have moved := M.stageOneRawForces_condition_mono s pairing unions powers separation - collection carrier order phi ![z, tau] qp - rw [fields] at moved - exact moved forced - -theorem preparationForcingCode_condition_mono - (nodes N visibility : ZFSet.{u}) - (graphGround : visibility ∈ M.sets) - (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → IsName s V) - (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) - (z : (M.nameDomain s).names) (F f : ZFSet.{u}) - (range : f ⊆ ZFSet.prod nodes N) {p q : P} (qp : q ≤ p) - (code : PreparationForcingCode M s.carrier s.conditionOrder (s.encode p) - nodes visibility z.val.val F f) : - PreparationForcingCode M s.carrier s.conditionOrder (s.encode q) - nodes visibility z.val.val F f := by - constructor - · intro v V entry member - let name : (M.nameDomain s).names := - ⟨⟨V, graphNames v V entry member⟩, M.pair_right (M.transitive graphGround entry)⟩ - have decisions := code.1 v V entry member - exact ⟨fun yes => rawForces_pair_condition_mono M s pairing unions powers separation - collection carrier order (.mem 0 1) z name qp (decisions.1 yes), - fun no => rawForces_pair_condition_mono M s pairing unions powers separation - collection carrier order (.neg (.mem 0 1)) z name qp (decisions.2 no)⟩ - · intro v tau entry - have htau := (ZFSet.pair_mem_prod.1 (range entry)).2 - let name : (M.nameDomain s).names := - ⟨⟨tau, validN tau htau⟩, M.transitive namesGround htau⟩ - exact rawForces_pair_condition_mono M s pairing unions powers separation collection - carrier order (.equal 0 1) z name qp (code.2 v tau entry) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] - -theorem preparationForcingCode_nice_condition_mono - (a : PosetAction G P) (s : Presentation P) (b : Presentation I) - (T : ZFSet.{u}) (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (N : ZFSet.{u}) (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) - (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) - (z : (M.nameDomain s).names) (F f : ZFSet.{u}) - (range : f ⊆ ZFSet.prod b.carrier N) {p q : P} (qp : q ≤ p) - (code : PreparationForcingCode M s.carrier s.conditionOrder (s.encode p) - b.carrier (M.niceVisibilityGraph a s b T K) z.val.val F f) : - PreparationForcingCode M s.carrier s.conditionOrder (s.encode q) - b.carrier (M.niceVisibilityGraph a s b T K) z.val.val F f := by - apply M.preparationForcingCode_condition_mono s pairing unions powers separation collection - carrier order b.carrier N (M.niceVisibilityGraph a s b T K) graphGround - _ namesGround validN z F f range qp code - intro v V entry member - obtain ⟨i, rfl⟩ := (b.mem_carrier v).1 member - rw [(M.pair_mem_niceVisibilityGraph a s b T K i V).1 entry] - exact (M.niceVisibilityName a s T (K i)).property - -end PartitionPilot.Forcing.TransitiveGround - -end - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -private def representedReuseFormula {n : Nat} - (A q P order T idx cu classes : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let v := prefixIndex n 3 - exBlock 3 (.conj (.mem (v 0) (old T)) - (.conj (.mem (v 1) (old T)) - (.conj (tripleMembershipFormula (old idx) (v 0) (v 1) (old A)) - (.conj (pairMembershipFormula (v 0) (v 2) (old classes)) - (stageOneForcingAt (.equal 0 1 : SetFormula 2) (old q) (old P) - (old order) ![old cu, v 2]))))) - -private theorem realize_representedReuseFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n : Nat} (A q P order T idx cu classes : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (representedReuseFormula A q P order T idx cu classes) env ↔ - ∃ v ∈ env T, ∃ w ∈ env T, ∃ z, - stageOneAssignment (env idx) v w ∈ env A ∧ - ZFSet.pair v z ∈ env classes ∧ - stageOneRawForces M (env P) (env order) (env q) - (.equal 0 1 : SetFormula 2) ![env cu, z] := by - rw [representedReuseFormula, realize_exBlock] - have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (.conj (.mem (prefixIndex n 3 0) (suffixIndex n 3 T)) - (.conj (.mem (prefixIndex n 3 1) (suffixIndex n 3 T)) - (.conj (tripleMembershipFormula (suffixIndex n 3 idx) (prefixIndex n 3 0) - (prefixIndex n 3 1) (suffixIndex n 3 A)) - (.conj (pairMembershipFormula (prefixIndex n 3 0) (prefixIndex n 3 2) - (suffixIndex n 3 classes)) - (stageOneForcingAt (.equal 0 1 : SetFormula 2) (suffixIndex n 3 q) - (suffixIndex n 3 P) (suffixIndex n 3 order) - ![suffixIndex n 3 cu, prefixIndex n 3 2]))))) (extendMany 3 f env) ↔ - f 0 ∈ env T ∧ f 1 ∈ env T ∧ - stageOneAssignment (env idx) (f 0) (f 1) ∈ env A ∧ - ZFSet.pair (f 0) (f 2) ∈ env classes ∧ - stageOneRawForces M (env P) (env order) (env q) - (.equal 0 1 : SetFormula 2) ![env cu, f 2] := by - have allGround := extendMany_members 3 f env ground members - simp only [Realize] - rw [M.realize_tripleMembershipFormula pairing _ _ _ _ _ - (allGround _) (allGround _) (allGround _) (allGround _), - M.realize_pairMembershipFormula pairing _ _ _ _ (allGround _) (allGround _) (allGround _), - M.realize_stageOneForcingAt] - have values (x y : Fin (n + 3)) : - (fun j : Fin 2 => extendMany 3 f env (![x, y] j)) = - ![extendMany 3 f env x, extendMany 3 f env y] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)) j - rw [values] - simp only [extendMany_prefix, extendMany_suffix, stageOneAssignment] - constructor - · rintro ⟨f, ground, body⟩ - obtain ⟨hv, hw, literal, entry, forced⟩ := (actual f ground).1 body - exact ⟨f 0, hv, f 1, hw, f 2, literal, entry, forced⟩ - · rintro ⟨v, hv, w, hw, z, literal, entry, forced⟩ - have ground : ∀ j, (![v, w, z] : Fin 3 → ZFSet.{u}) j ∈ M.sets := - Fin.cases (M.transitive (members T) hv) (Fin.cases (M.transitive (members T) hw) - (Fin.cases (M.pair_right (M.transitive (members classes) entry)) (fun j => Fin.elim0 j))) - exact ⟨![v, w, z], ground, (actual ![v, w, z] ground).2 ⟨hv, hw, literal, entry, forced⟩⟩ - -private def representedEntryFormula {n : Nat} - (p P order cut T idx u U cu classes : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let v := prefixIndex n 3 - exBlock 3 (.conj (BoundedFormula.orderedPairFormula (old p) (v 0) (v 1)).toFormula - (.conj (pairMembershipFormula (old p) (v 2) (old cut)) - (disj (stageOneForcingAt (.neg (.mem 0 1) : SetFormula 2) (v 2) (old P) - (old order) ![old u, old U]) - (.conj (stageOneForcingAt (.mem 0 1 : SetFormula 2) (v 2) (old P) - (old order) ![old u, old U]) - (representedReuseFormula (v 1) (v 2) (old P) (old order) (old T) - (old idx) (old cu) (old classes)))))) - -private theorem realize_representedEntryFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n : Nat} (p P order cut T idx u U cu classes : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (representedEntryFormula p P order cut T idx u U cu classes) env ↔ - ∃ row A q, env p = ZFSet.pair row A ∧ ZFSet.pair (env p) q ∈ env cut ∧ - (stageOneRawForces M (env P) (env order) q - (.neg (.mem 0 1) : SetFormula 2) ![env u, env U] ∨ - (stageOneRawForces M (env P) (env order) q (.mem 0 1 : SetFormula 2) ![env u, env U] ∧ - ∃ v ∈ env T, ∃ w ∈ env T, ∃ z, - stageOneAssignment (env idx) v w ∈ A ∧ ZFSet.pair v z ∈ env classes ∧ - stageOneRawForces M (env P) (env order) q - (.equal 0 1 : SetFormula 2) ![env cu, z])) := by - rw [representedEntryFormula, realize_exBlock] - have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (.conj (BoundedFormula.orderedPairFormula (suffixIndex n 3 p) - (prefixIndex n 3 0) (prefixIndex n 3 1)).toFormula - (.conj (pairMembershipFormula (suffixIndex n 3 p) (prefixIndex n 3 2) (suffixIndex n 3 cut)) - (disj (stageOneForcingAt (.neg (.mem 0 1) : SetFormula 2) (prefixIndex n 3 2) - (suffixIndex n 3 P) (suffixIndex n 3 order) ![suffixIndex n 3 u, suffixIndex n 3 U]) - (.conj (stageOneForcingAt (.mem 0 1 : SetFormula 2) (prefixIndex n 3 2) - (suffixIndex n 3 P) (suffixIndex n 3 order) ![suffixIndex n 3 u, suffixIndex n 3 U]) - (representedReuseFormula (prefixIndex n 3 1) (prefixIndex n 3 2) - (suffixIndex n 3 P) (suffixIndex n 3 order) (suffixIndex n 3 T) - (suffixIndex n 3 idx) (suffixIndex n 3 cu) (suffixIndex n 3 classes)))))) - (extendMany 3 f env) ↔ - env p = ZFSet.pair (f 0) (f 1) ∧ ZFSet.pair (env p) (f 2) ∈ env cut ∧ - (stageOneRawForces M (env P) (env order) (f 2) - (.neg (.mem 0 1) : SetFormula 2) ![env u, env U] ∨ - (stageOneRawForces M (env P) (env order) (f 2) (.mem 0 1 : SetFormula 2) ![env u, env U] ∧ - ∃ v ∈ env T, ∃ w ∈ env T, ∃ z, - stageOneAssignment (env idx) v w ∈ f 1 ∧ ZFSet.pair v z ∈ env classes ∧ - stageOneRawForces M (env P) (env order) (f 2) - (.equal 0 1 : SetFormula 2) ![env cu, z])) := by - have allGround := extendMany_members 3 f env ground members - rw [Realize, BoundedFormula.realize_toFormula M _ _ allGround, - BoundedFormula.truth_orderedPairFormula, Realize, - M.realize_pairMembershipFormula pairing _ _ _ _ (allGround _) (allGround _) (allGround _), - realize_disj, M.realize_stageOneForcingAt, Realize, M.realize_stageOneForcingAt, - realize_representedReuseFormula M pairing _ _ _ _ _ _ _ _ _ allGround] - have values (x y : Fin (n + 3)) : - (fun j : Fin 2 => extendMany 3 f env (![x, y] j)) = - ![extendMany 3 f env x, extendMany 3 f env y] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)) j - rw [values] - simp only [extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, body⟩ - exact ⟨f 0, f 1, f 2, (actual f ground).1 body⟩ - · rintro ⟨row, A, q, shape, cutEntry, code⟩ - have ground : ∀ j, (![row, A, q] : Fin 3 → ZFSet.{u}) j ∈ M.sets := - Fin.cases (M.pair_left (shape ▸ members p)) (Fin.cases (M.pair_right (shape ▸ members p)) - (Fin.cases (M.pair_right (M.transitive (members cut) cutEntry)) (fun j => Fin.elim0 j))) - exact ⟨![row, A, q], ground, (actual ![row, A, q] ground).2 ⟨shape, cutEntry, code⟩⟩ - -variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) - -noncomputable def representedDomainConditions (upper levels alpha T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (U Rc u : (M.nameDomain s).names) : ZFSet.{u} := - let cut := rowAssignmentCutGraph upper s.carrier levels alpha - let classes := Name.refinementClassGraph T valid Rc.val T valid - let cu := (Name.refinementClass T valid Rc.val u.val).val - let params : Fin 9 → ZFSet.{u} := ![s.carrier, s.conditionOrder, cut, T, idx, u.val.val, U.val.val, cu, classes] - ZFSet.sep (fun p => Realize M.sets (representedEntryFormula 0 1 2 3 4 5 6 7 8 9) - (extend p params)) upper - -theorem representedDomainConditions_subset (upper levels alpha T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (U Rc u : (M.nameDomain s).names) : - M.representedDomainConditions s upper levels alpha T valid idx U Rc u ⊆ upper := -by - intro z member - rw [representedDomainConditions, ZFSet.mem_sep] at member - exact member.1 - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection carrier order in -private theorem representedParams_ground {upper levels alpha T : ZFSet.{u}} - (hUpper : upper ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) {idx : ZFSet.{u}} (hIdx : idx ∈ M.sets) - (U Rc u : (M.nameDomain s).names) : - ∀ j, (![s.carrier, s.conditionOrder, rowAssignmentCutGraph upper s.carrier levels alpha, - T, idx, u.val.val, U.val.val, (Name.refinementClass T valid Rc.val u.val).val, - Name.refinementClassGraph T valid Rc.val T valid] : Fin 9 → ZFSet.{u}) j ∈ M.sets := - Fin.cases carrier (Fin.cases order - (Fin.cases (M.rowAssignmentCutGraph_mem pairing unions powers separation hUpper carrier hLevels hAlpha) - (Fin.cases hT (Fin.cases hIdx (Fin.cases u.property (Fin.cases U.property - (Fin.cases (M.refinementClass_mem s pairing unions powers separation collection carrier order - hT valid Rc.val u.val Rc.property u.property) - (Fin.cases (M.refinementClassGraph_mem s pairing unions powers separation collection carrier order - hT hT valid valid Rc.val Rc.property) (fun j => Fin.elim0 j))))))))) - -include pairing unions powers separation collection carrier order in -theorem representedDomainConditions_mem {upper levels alpha T : ZFSet.{u}} - (hUpper : upper ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) {idx : ZFSet.{u}} (hIdx : idx ∈ M.sets) - (U Rc u : (M.nameDomain s).names) : - M.representedDomainConditions s upper levels alpha T valid idx U Rc u ∈ M.sets := - M.separation_mem separation (representedEntryFormula 0 1 2 3 4 5 6 7 8 9) _ - (representedParams_ground M s pairing unions powers separation collection carrier order - hUpper hLevels hAlpha hT valid hIdx U Rc u) hUpper - -include pairing unions powers separation collection carrier order in -theorem pair_mem_representedDomainConditions {upper levels alpha T : ZFSet.{u}} - (hUpper : upper ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) {idx : ZFSet.{u}} (hIdx : idx ∈ M.sets) - (U Rc u : (M.nameDomain s).names) (row A : ZFSet.{u}) (q : P) - (cut : s.encode q = ZFSet.pair row (assignmentCut levels alpha A)) : - ZFSet.pair row A ∈ M.representedDomainConditions s upper levels alpha T valid idx U Rc u ↔ - ZFSet.pair row A ∈ upper ∧ - ((∀ r : P, r ≤ q → ¬ Name.ForcesMem r u.val U.val) ∨ - (Name.ForcesMem q u.val U.val ∧ ∃ v w : Name s, - v.val ∈ T ∧ w.val ∈ T ∧ stageOneAssignment idx v.val w.val ∈ A ∧ - Name.ForcesEq q (Name.refinementClass T valid Rc.val u.val) - (Name.refinementClass T valid Rc.val v))) := by - let params : Fin 9 → ZFSet.{u} := ![s.carrier, s.conditionOrder, - rowAssignmentCutGraph upper s.carrier levels alpha, T, idx, u.val.val, U.val.val, - (Name.refinementClass T valid Rc.val u.val).val, Name.refinementClassGraph T valid Rc.val T valid] - have paramsGround := representedParams_ground M s pairing unions powers separation collection carrier order - hUpper hLevels hAlpha hT valid hIdx U Rc u - have raw (phi : SetFormula 2) (x y : (M.nameDomain s).names) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode q) phi ![x.val.val, y.val.val] ↔ - Forces (M.nameDomain s) phi ![x, y] q := by - have fields : (fun j : Fin 2 => (![x, y] j).val.val) = ![x.val.val, y.val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)) j - have result := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order phi q ![x, y] - rw [fields] at result - exact result - let className (v : (M.nameDomain s).names) : (M.nameDomain s).names := - ⟨Name.refinementClass T valid Rc.val v.val, - M.refinementClass_mem s pairing unions powers separation collection carrier order hT valid - Rc.val v.val Rc.property v.property⟩ - rw [representedDomainConditions, ZFSet.mem_sep] - change (ZFSet.pair row A ∈ upper ∧ Realize M.sets (representedEntryFormula 0 1 2 3 4 5 6 7 8 9) - (extend (ZFSet.pair row A) params)) ↔ _ - apply and_congr_right - intro member - rw [realize_representedEntryFormula M pairing _ _ _ _ _ _ _ _ _ _ _ - (Fin.cases (M.transitive hUpper member) paramsGround)] - change (∃ row' A' q', ZFSet.pair row A = ZFSet.pair row' A' ∧ - ZFSet.pair (ZFSet.pair row A) q' ∈ rowAssignmentCutGraph upper s.carrier levels alpha ∧ - (stageOneRawForces M s.carrier s.conditionOrder q' (.neg (.mem 0 1) : SetFormula 2) ![u.val.val, U.val.val] ∨ - (stageOneRawForces M s.carrier s.conditionOrder q' (.mem 0 1 : SetFormula 2) ![u.val.val, U.val.val] ∧ - ∃ v ∈ T, ∃ w ∈ T, ∃ z, stageOneAssignment idx v w ∈ A' ∧ - ZFSet.pair v z ∈ Name.refinementClassGraph T valid Rc.val T valid ∧ - stageOneRawForces M s.carrier s.conditionOrder q' (.equal 0 1 : SetFormula 2) - ![(className u).val.val, z]))) ↔ _ - constructor - · rintro ⟨row', A', q', same, entry, branch⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 same - have equal := ((pair_mem_rowAssignmentCutGraph upper s.carrier levels alpha row A q').1 entry).2.2 - have eq : q' = s.encode q := equal.trans cut.symm - rw [eq] at branch - rcases branch with inactive | ⟨active, v, hv, w, hw, z, literal, classEntry, equal⟩ - · exact Or.inl ((raw (.neg (.mem 0 1)) u U).1 inactive) - · let vName : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ - have classEqual := (Name.pair_mem_refinementClassGraph T valid Rc.val T valid vName.val z).1 classEntry |>.2 - rw [classEqual] at equal - exact Or.inr ⟨(raw (.mem 0 1) u U).1 active, vName.val, ⟨w, valid w hw⟩, - hv, hw, literal, (raw (.equal 0 1) (className u) (className vName)).1 equal⟩ - · intro branch - refine ⟨row, A, s.encode q, rfl, - (pair_mem_rowAssignmentCutGraph upper s.carrier levels alpha row A (s.encode q)).2 - ⟨member, s.encode_mem q, cut⟩, ?_⟩ - rcases branch with inactive | ⟨active, v, w, hv, hw, literal, equal⟩ - · exact Or.inl ((raw (.neg (.mem 0 1)) u U).2 inactive) - · let vName : (M.nameDomain s).names := ⟨v, M.transitive hT hv⟩ - exact Or.inr ⟨(raw (.mem 0 1) u U).2 active, v.val, hv, w.val, hw, - (className vName).val.val, literal, - (Name.pair_mem_refinementClassGraph T valid Rc.val T valid v _).2 ⟨hv, rfl⟩, - (raw (.equal 0 1) (className u) (className vName)).2 equal⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundAssignmentClassGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.GroundQuantifiedGraphFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentCuts +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace SetFormula + +def stageOneForcingFormula {n : Nat} (phi : SetFormula n) : SetFormula (n + 3) := + forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) phi + (extend 1 (extend 2 Fin.elim0)) 0 (fun j => j.succ.succ.succ) + +def stageOneForcingAt {n m : Nat} (phi : SetFormula m) (p P r : Fin n) + (names : Fin m → Fin n) : SetFormula n := + reindex (extend p (extend P (extend r names))) (stageOneForcingFormula phi) + +def stageOneClassAt {n : Nat} (c T R w P r top : Fin n) : SetFormula n := + reindex (extend c (extend T (extend R (extend w + (extend P (extend r (extend top Fin.elim0))))))) refinementClassCodeFormula + +end SetFormula + +def stageOneRawForces (M : TransitiveGround.{u}) (P r p : ZFSet.{u}) + {n : Nat} (phi : SetFormula n) (names : Fin n → ZFSet.{u}) : Prop := + Realize M.sets (stageOneForcingFormula phi) (extend p (extend P (extend r names))) + +def stageOneRawClass (M : TransitiveGround.{u}) (T P r top R w c : ZFSet.{u}) : Prop := + Realize M.sets refinementClassCodeFormula + (extend c (extend T (extend R (extend w (extend P (extend r (extend top Fin.elim0))))))) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_stageOneForcingAt {n m : Nat} (phi : SetFormula m) (p P r : Fin n) + (names : Fin m → Fin n) (env : Fin n → ZFSet.{u}) : + Realize M.sets (stageOneForcingAt phi p P r names) env ↔ + stageOneRawForces M (env P) (env r) (env p) phi (fun j => env (names j)) := by + rw [stageOneForcingAt, realize_reindex, map_extend, map_extend, map_extend] + rfl + +theorem realize_stageOneClassAt {n : Nat} (c T R w P r top : Fin n) + (env : Fin n → ZFSet.{u}) : + Realize M.sets (stageOneClassAt c T R w P r top) env ↔ + stageOneRawClass M (env T) (env P) (env r) (env top) (env R) (env w) (env c) := by + rw [stageOneClassAt, stageOneRawClass, realize_reindex] + simp only [map_extend] + have empty : (fun j : Fin 0 => env (Fin.elim0 j)) = Fin.elim0 := funext (fun j => Fin.elim0 j) + rw [empty] + +theorem stageOneRawForces_iff {P : Type u} [Preorder P] (s : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {n : Nat} (phi : SetFormula n) (p : P) (names : Assignment (M.nameDomain s) n) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi + (fun j => (names j).val.val) ↔ Forces (M.nameDomain s) phi names p := by + exact M.realize_ordinaryGroundForcing s pairing unions powers separation collection carrier order + (0 : Fin 2) 1 phi (extend 1 (extend 2 Fin.elim0)) 0 (fun j => j.succ.succ.succ) + _ rfl rfl p names rfl (fun _ => rfl) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def PreparationForcingCode (M : TransitiveGround.{u}) + (P order q nodes visibility z F f : ZFSet.{u}) : Prop := + (∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → + (v ∈ F → stageOneRawForces M P order q (.mem 0 1 : SetFormula 2) ![z, V]) ∧ + (v ∉ F → stageOneRawForces M P order q (.neg (.mem 0 1) : SetFormula 2) ![z, V])) ∧ + ∀ v tau, ZFSet.pair v tau ∈ f → + stageOneRawForces M P order q (.equal 0 1 : SetFormula 2) ![z, tau] + +namespace SetFormula + +def preparationForcingFormula {n} (P order q nodes visibility z F f : Fin n) : SetFormula n := + .conj + (allGraphFields visibility + (imp (.mem 1 nodes.succ.succ) + (.conj + (imp (.mem 1 F.succ.succ) + (stageOneForcingAt (.mem 0 1 : SetFormula 2) q.succ.succ P.succ.succ + order.succ.succ ![z.succ.succ, 0])) + (imp (.neg (.mem 1 F.succ.succ)) + (stageOneForcingAt (.neg (.mem 0 1) : SetFormula 2) q.succ.succ P.succ.succ + order.succ.succ ![z.succ.succ, 0]))))) + (allGraphFields f + (stageOneForcingAt (.equal 0 1 : SetFormula 2) q.succ.succ P.succ.succ + order.succ.succ ![z.succ.succ, 0])) + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_preparationForcingFormula {n} (P order q nodes visibility z F f : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (preparationForcingFormula P order q nodes visibility z F f) env ↔ + PreparationForcingCode M (env P) (env order) (env q) (env nodes) + (env visibility) (env z) (env F) (env f) := by + rw [preparationForcingFormula, Realize, M.realize_allGraphFields _ _ env members, + M.realize_allGraphFields _ _ env members] + simp only [realize_imp, Realize, M.realize_stageOneForcingAt] + have names (x y : ZFSet.{u}) : + (fun j : Fin 2 => extend y (extend x env) (![z.succ.succ, 0] j)) = ![env z, y] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)) j + simp only [names] + rfl + +end TransitiveGround + +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection carrier order + +theorem stageOneRawForces_condition_mono {n : Nat} (phi : SetFormula n) + (names : Assignment (M.nameDomain s) n) {p q : P} (qp : q ≤ p) + (forced : stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi + (fun j => (names j).val.val)) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode q) phi + (fun j => (names j).val.val) := by + apply (M.stageOneRawForces_iff s pairing unions powers separation collection + carrier order phi q names).2 + exact forces_mono (M.nameDomain s) phi names + ((M.stageOneRawForces_iff s pairing unions powers separation collection + carrier order phi p names).1 forced) qp + +private theorem rawForces_pair_condition_mono + (phi : SetFormula 2) (z tau : (M.nameDomain s).names) {p q : P} (qp : q ≤ p) + (forced : stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi + ![z.val.val, tau.val.val]) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode q) phi + ![z.val.val, tau.val.val] := by + have fields : (fun j : Fin 2 => (![z, tau] j).val.val) = + ![z.val.val, tau.val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i)) j + have moved := M.stageOneRawForces_condition_mono s pairing unions powers separation + collection carrier order phi ![z, tau] qp + rw [fields] at moved + exact moved forced + +theorem preparationForcingCode_condition_mono + (nodes N visibility : ZFSet.{u}) + (graphGround : visibility ∈ M.sets) + (graphNames : ∀ v V, ZFSet.pair v V ∈ visibility → v ∈ nodes → IsName s V) + (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) + (z : (M.nameDomain s).names) (F f : ZFSet.{u}) + (range : f ⊆ ZFSet.prod nodes N) {p q : P} (qp : q ≤ p) + (code : PreparationForcingCode M s.carrier s.conditionOrder (s.encode p) + nodes visibility z.val.val F f) : + PreparationForcingCode M s.carrier s.conditionOrder (s.encode q) + nodes visibility z.val.val F f := by + constructor + · intro v V entry member + let name : (M.nameDomain s).names := + ⟨⟨V, graphNames v V entry member⟩, M.pair_right (M.transitive graphGround entry)⟩ + have decisions := code.1 v V entry member + exact ⟨fun yes => rawForces_pair_condition_mono M s pairing unions powers separation + collection carrier order (.mem 0 1) z name qp (decisions.1 yes), + fun no => rawForces_pair_condition_mono M s pairing unions powers separation + collection carrier order (.neg (.mem 0 1)) z name qp (decisions.2 no)⟩ + · intro v tau entry + have htau := (ZFSet.pair_mem_prod.1 (range entry)).2 + let name : (M.nameDomain s).names := + ⟨⟨tau, validN tau htau⟩, M.transitive namesGround htau⟩ + exact rawForces_pair_condition_mono M s pairing unions powers separation collection + carrier order (.equal 0 1) z name qp (code.2 v tau entry) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] + +theorem preparationForcingCode_nice_condition_mono + (a : PosetAction G P) (s : Presentation P) (b : Presentation I) + (T : ZFSet.{u}) (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (N : ZFSet.{u}) (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) + (namesGround : N ∈ M.sets) (validN : ∀ tau ∈ N, IsName s tau) + (z : (M.nameDomain s).names) (F f : ZFSet.{u}) + (range : f ⊆ ZFSet.prod b.carrier N) {p q : P} (qp : q ≤ p) + (code : PreparationForcingCode M s.carrier s.conditionOrder (s.encode p) + b.carrier (M.niceVisibilityGraph a s b T K) z.val.val F f) : + PreparationForcingCode M s.carrier s.conditionOrder (s.encode q) + b.carrier (M.niceVisibilityGraph a s b T K) z.val.val F f := by + apply M.preparationForcingCode_condition_mono s pairing unions powers separation collection + carrier order b.carrier N (M.niceVisibilityGraph a s b T K) graphGround + _ namesGround validN z F f range qp code + intro v V entry member + obtain ⟨i, rfl⟩ := (b.mem_carrier v).1 member + rw [(M.pair_mem_niceVisibilityGraph a s b T K i V).1 entry] + exact (M.niceVisibilityName a s T (K i)).property + +end PartitionPilot.Forcing.TransitiveGround + +end + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +private def representedReuseFormula {n : Nat} + (A q P order T idx cu classes : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let v := prefixIndex n 3 + exBlock 3 (.conj (.mem (v 0) (old T)) + (.conj (.mem (v 1) (old T)) + (.conj (tripleMembershipFormula (old idx) (v 0) (v 1) (old A)) + (.conj (pairMembershipFormula (v 0) (v 2) (old classes)) + (stageOneForcingAt (.equal 0 1 : SetFormula 2) (old q) (old P) + (old order) ![old cu, v 2]))))) + +private theorem realize_representedReuseFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n : Nat} (A q P order T idx cu classes : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (representedReuseFormula A q P order T idx cu classes) env ↔ + ∃ v ∈ env T, ∃ w ∈ env T, ∃ z, + stageOneAssignment (env idx) v w ∈ env A ∧ + ZFSet.pair v z ∈ env classes ∧ + stageOneRawForces M (env P) (env order) (env q) + (.equal 0 1 : SetFormula 2) ![env cu, z] := by + rw [representedReuseFormula, realize_exBlock] + have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (.conj (.mem (prefixIndex n 3 0) (suffixIndex n 3 T)) + (.conj (.mem (prefixIndex n 3 1) (suffixIndex n 3 T)) + (.conj (tripleMembershipFormula (suffixIndex n 3 idx) (prefixIndex n 3 0) + (prefixIndex n 3 1) (suffixIndex n 3 A)) + (.conj (pairMembershipFormula (prefixIndex n 3 0) (prefixIndex n 3 2) + (suffixIndex n 3 classes)) + (stageOneForcingAt (.equal 0 1 : SetFormula 2) (suffixIndex n 3 q) + (suffixIndex n 3 P) (suffixIndex n 3 order) + ![suffixIndex n 3 cu, prefixIndex n 3 2]))))) (extendMany 3 f env) ↔ + f 0 ∈ env T ∧ f 1 ∈ env T ∧ + stageOneAssignment (env idx) (f 0) (f 1) ∈ env A ∧ + ZFSet.pair (f 0) (f 2) ∈ env classes ∧ + stageOneRawForces M (env P) (env order) (env q) + (.equal 0 1 : SetFormula 2) ![env cu, f 2] := by + have allGround := extendMany_members 3 f env ground members + simp only [Realize] + rw [M.realize_tripleMembershipFormula pairing _ _ _ _ _ + (allGround _) (allGround _) (allGround _) (allGround _), + M.realize_pairMembershipFormula pairing _ _ _ _ (allGround _) (allGround _) (allGround _), + M.realize_stageOneForcingAt] + have values (x y : Fin (n + 3)) : + (fun j : Fin 2 => extendMany 3 f env (![x, y] j)) = + ![extendMany 3 f env x, extendMany 3 f env y] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)) j + rw [values] + simp only [extendMany_prefix, extendMany_suffix, stageOneAssignment] + constructor + · rintro ⟨f, ground, body⟩ + obtain ⟨hv, hw, literal, entry, forced⟩ := (actual f ground).1 body + exact ⟨f 0, hv, f 1, hw, f 2, literal, entry, forced⟩ + · rintro ⟨v, hv, w, hw, z, literal, entry, forced⟩ + have ground : ∀ j, (![v, w, z] : Fin 3 → ZFSet.{u}) j ∈ M.sets := + Fin.cases (M.transitive (members T) hv) (Fin.cases (M.transitive (members T) hw) + (Fin.cases (M.pair_right (M.transitive (members classes) entry)) (fun j => Fin.elim0 j))) + exact ⟨![v, w, z], ground, (actual ![v, w, z] ground).2 ⟨hv, hw, literal, entry, forced⟩⟩ + +private def representedEntryFormula {n : Nat} + (p P order cut T idx u U cu classes : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let v := prefixIndex n 3 + exBlock 3 (.conj (BoundedFormula.orderedPairFormula (old p) (v 0) (v 1)).toFormula + (.conj (pairMembershipFormula (old p) (v 2) (old cut)) + (disj (stageOneForcingAt (.neg (.mem 0 1) : SetFormula 2) (v 2) (old P) + (old order) ![old u, old U]) + (.conj (stageOneForcingAt (.mem 0 1 : SetFormula 2) (v 2) (old P) + (old order) ![old u, old U]) + (representedReuseFormula (v 1) (v 2) (old P) (old order) (old T) + (old idx) (old cu) (old classes)))))) + +private theorem realize_representedEntryFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n : Nat} (p P order cut T idx u U cu classes : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (representedEntryFormula p P order cut T idx u U cu classes) env ↔ + ∃ row A q, env p = ZFSet.pair row A ∧ ZFSet.pair (env p) q ∈ env cut ∧ + (stageOneRawForces M (env P) (env order) q + (.neg (.mem 0 1) : SetFormula 2) ![env u, env U] ∨ + (stageOneRawForces M (env P) (env order) q (.mem 0 1 : SetFormula 2) ![env u, env U] ∧ + ∃ v ∈ env T, ∃ w ∈ env T, ∃ z, + stageOneAssignment (env idx) v w ∈ A ∧ ZFSet.pair v z ∈ env classes ∧ + stageOneRawForces M (env P) (env order) q + (.equal 0 1 : SetFormula 2) ![env cu, z])) := by + rw [representedEntryFormula, realize_exBlock] + have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (.conj (BoundedFormula.orderedPairFormula (suffixIndex n 3 p) + (prefixIndex n 3 0) (prefixIndex n 3 1)).toFormula + (.conj (pairMembershipFormula (suffixIndex n 3 p) (prefixIndex n 3 2) (suffixIndex n 3 cut)) + (disj (stageOneForcingAt (.neg (.mem 0 1) : SetFormula 2) (prefixIndex n 3 2) + (suffixIndex n 3 P) (suffixIndex n 3 order) ![suffixIndex n 3 u, suffixIndex n 3 U]) + (.conj (stageOneForcingAt (.mem 0 1 : SetFormula 2) (prefixIndex n 3 2) + (suffixIndex n 3 P) (suffixIndex n 3 order) ![suffixIndex n 3 u, suffixIndex n 3 U]) + (representedReuseFormula (prefixIndex n 3 1) (prefixIndex n 3 2) + (suffixIndex n 3 P) (suffixIndex n 3 order) (suffixIndex n 3 T) + (suffixIndex n 3 idx) (suffixIndex n 3 cu) (suffixIndex n 3 classes)))))) + (extendMany 3 f env) ↔ + env p = ZFSet.pair (f 0) (f 1) ∧ ZFSet.pair (env p) (f 2) ∈ env cut ∧ + (stageOneRawForces M (env P) (env order) (f 2) + (.neg (.mem 0 1) : SetFormula 2) ![env u, env U] ∨ + (stageOneRawForces M (env P) (env order) (f 2) (.mem 0 1 : SetFormula 2) ![env u, env U] ∧ + ∃ v ∈ env T, ∃ w ∈ env T, ∃ z, + stageOneAssignment (env idx) v w ∈ f 1 ∧ ZFSet.pair v z ∈ env classes ∧ + stageOneRawForces M (env P) (env order) (f 2) + (.equal 0 1 : SetFormula 2) ![env cu, z])) := by + have allGround := extendMany_members 3 f env ground members + rw [Realize, BoundedFormula.realize_toFormula M _ _ allGround, + BoundedFormula.truth_orderedPairFormula, Realize, + M.realize_pairMembershipFormula pairing _ _ _ _ (allGround _) (allGround _) (allGround _), + realize_disj, M.realize_stageOneForcingAt, Realize, M.realize_stageOneForcingAt, + realize_representedReuseFormula M pairing _ _ _ _ _ _ _ _ _ allGround] + have values (x y : Fin (n + 3)) : + (fun j : Fin 2 => extendMany 3 f env (![x, y] j)) = + ![extendMany 3 f env x, extendMany 3 f env y] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)) j + rw [values] + simp only [extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, body⟩ + exact ⟨f 0, f 1, f 2, (actual f ground).1 body⟩ + · rintro ⟨row, A, q, shape, cutEntry, code⟩ + have ground : ∀ j, (![row, A, q] : Fin 3 → ZFSet.{u}) j ∈ M.sets := + Fin.cases (M.pair_left (shape ▸ members p)) (Fin.cases (M.pair_right (shape ▸ members p)) + (Fin.cases (M.pair_right (M.transitive (members cut) cutEntry)) (fun j => Fin.elim0 j))) + exact ⟨![row, A, q], ground, (actual ![row, A, q] ground).2 ⟨shape, cutEntry, code⟩⟩ + +variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) + +noncomputable def representedDomainConditions (upper levels alpha T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (U Rc u : (M.nameDomain s).names) : ZFSet.{u} := + let cut := rowAssignmentCutGraph upper s.carrier levels alpha + let classes := Name.refinementClassGraph T valid Rc.val T valid + let cu := (Name.refinementClass T valid Rc.val u.val).val + let params : Fin 9 → ZFSet.{u} := ![s.carrier, s.conditionOrder, cut, T, idx, u.val.val, U.val.val, cu, classes] + ZFSet.sep (fun p => Realize M.sets (representedEntryFormula 0 1 2 3 4 5 6 7 8 9) + (extend p params)) upper + +theorem representedDomainConditions_subset (upper levels alpha T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (U Rc u : (M.nameDomain s).names) : + M.representedDomainConditions s upper levels alpha T valid idx U Rc u ⊆ upper := +by + intro z member + rw [representedDomainConditions, ZFSet.mem_sep] at member + exact member.1 + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection carrier order in +private theorem representedParams_ground {upper levels alpha T : ZFSet.{u}} + (hUpper : upper ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) {idx : ZFSet.{u}} (hIdx : idx ∈ M.sets) + (U Rc u : (M.nameDomain s).names) : + ∀ j, (![s.carrier, s.conditionOrder, rowAssignmentCutGraph upper s.carrier levels alpha, + T, idx, u.val.val, U.val.val, (Name.refinementClass T valid Rc.val u.val).val, + Name.refinementClassGraph T valid Rc.val T valid] : Fin 9 → ZFSet.{u}) j ∈ M.sets := + Fin.cases carrier (Fin.cases order + (Fin.cases (M.rowAssignmentCutGraph_mem pairing unions powers separation hUpper carrier hLevels hAlpha) + (Fin.cases hT (Fin.cases hIdx (Fin.cases u.property (Fin.cases U.property + (Fin.cases (M.refinementClass_mem s pairing unions powers separation collection carrier order + hT valid Rc.val u.val Rc.property u.property) + (Fin.cases (M.refinementClassGraph_mem s pairing unions powers separation collection carrier order + hT hT valid valid Rc.val Rc.property) (fun j => Fin.elim0 j))))))))) + +include pairing unions powers separation collection carrier order in +theorem representedDomainConditions_mem {upper levels alpha T : ZFSet.{u}} + (hUpper : upper ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) {idx : ZFSet.{u}} (hIdx : idx ∈ M.sets) + (U Rc u : (M.nameDomain s).names) : + M.representedDomainConditions s upper levels alpha T valid idx U Rc u ∈ M.sets := + M.separation_mem separation (representedEntryFormula 0 1 2 3 4 5 6 7 8 9) _ + (representedParams_ground M s pairing unions powers separation collection carrier order + hUpper hLevels hAlpha hT valid hIdx U Rc u) hUpper + +include pairing unions powers separation collection carrier order in +theorem pair_mem_representedDomainConditions {upper levels alpha T : ZFSet.{u}} + (hUpper : upper ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) {idx : ZFSet.{u}} (hIdx : idx ∈ M.sets) + (U Rc u : (M.nameDomain s).names) (row A : ZFSet.{u}) (q : P) + (cut : s.encode q = ZFSet.pair row (assignmentCut levels alpha A)) : + ZFSet.pair row A ∈ M.representedDomainConditions s upper levels alpha T valid idx U Rc u ↔ + ZFSet.pair row A ∈ upper ∧ + ((∀ r : P, r ≤ q → ¬ Name.ForcesMem r u.val U.val) ∨ + (Name.ForcesMem q u.val U.val ∧ ∃ v w : Name s, + v.val ∈ T ∧ w.val ∈ T ∧ stageOneAssignment idx v.val w.val ∈ A ∧ + Name.ForcesEq q (Name.refinementClass T valid Rc.val u.val) + (Name.refinementClass T valid Rc.val v))) := by + let params : Fin 9 → ZFSet.{u} := ![s.carrier, s.conditionOrder, + rowAssignmentCutGraph upper s.carrier levels alpha, T, idx, u.val.val, U.val.val, + (Name.refinementClass T valid Rc.val u.val).val, Name.refinementClassGraph T valid Rc.val T valid] + have paramsGround := representedParams_ground M s pairing unions powers separation collection carrier order + hUpper hLevels hAlpha hT valid hIdx U Rc u + have raw (phi : SetFormula 2) (x y : (M.nameDomain s).names) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode q) phi ![x.val.val, y.val.val] ↔ + Forces (M.nameDomain s) phi ![x, y] q := by + have fields : (fun j : Fin 2 => (![x, y] j).val.val) = ![x.val.val, y.val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)) j + have result := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order phi q ![x, y] + rw [fields] at result + exact result + let className (v : (M.nameDomain s).names) : (M.nameDomain s).names := + ⟨Name.refinementClass T valid Rc.val v.val, + M.refinementClass_mem s pairing unions powers separation collection carrier order hT valid + Rc.val v.val Rc.property v.property⟩ + rw [representedDomainConditions, ZFSet.mem_sep] + change (ZFSet.pair row A ∈ upper ∧ Realize M.sets (representedEntryFormula 0 1 2 3 4 5 6 7 8 9) + (extend (ZFSet.pair row A) params)) ↔ _ + apply and_congr_right + intro member + rw [realize_representedEntryFormula M pairing _ _ _ _ _ _ _ _ _ _ _ + (Fin.cases (M.transitive hUpper member) paramsGround)] + change (∃ row' A' q', ZFSet.pair row A = ZFSet.pair row' A' ∧ + ZFSet.pair (ZFSet.pair row A) q' ∈ rowAssignmentCutGraph upper s.carrier levels alpha ∧ + (stageOneRawForces M s.carrier s.conditionOrder q' (.neg (.mem 0 1) : SetFormula 2) ![u.val.val, U.val.val] ∨ + (stageOneRawForces M s.carrier s.conditionOrder q' (.mem 0 1 : SetFormula 2) ![u.val.val, U.val.val] ∧ + ∃ v ∈ T, ∃ w ∈ T, ∃ z, stageOneAssignment idx v w ∈ A' ∧ + ZFSet.pair v z ∈ Name.refinementClassGraph T valid Rc.val T valid ∧ + stageOneRawForces M s.carrier s.conditionOrder q' (.equal 0 1 : SetFormula 2) + ![(className u).val.val, z]))) ↔ _ + constructor + · rintro ⟨row', A', q', same, entry, branch⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 same + have equal := ((pair_mem_rowAssignmentCutGraph upper s.carrier levels alpha row A q').1 entry).2.2 + have eq : q' = s.encode q := equal.trans cut.symm + rw [eq] at branch + rcases branch with inactive | ⟨active, v, hv, w, hw, z, literal, classEntry, equal⟩ + · exact Or.inl ((raw (.neg (.mem 0 1)) u U).1 inactive) + · let vName : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ + have classEqual := (Name.pair_mem_refinementClassGraph T valid Rc.val T valid vName.val z).1 classEntry |>.2 + rw [classEqual] at equal + exact Or.inr ⟨(raw (.mem 0 1) u U).1 active, vName.val, ⟨w, valid w hw⟩, + hv, hw, literal, (raw (.equal 0 1) (className u) (className vName)).1 equal⟩ + · intro branch + refine ⟨row, A, s.encode q, rfl, + (pair_mem_rowAssignmentCutGraph upper s.carrier levels alpha row A (s.encode q)).2 + ⟨member, s.encode_mem q, cut⟩, ?_⟩ + rcases branch with inactive | ⟨active, v, w, hv, hw, literal, equal⟩ + · exact Or.inl ((raw (.neg (.mem 0 1)) u U).2 inactive) + · let vName : (M.nameDomain s).names := ⟨v, M.transitive hT hv⟩ + exact Or.inr ⟨(raw (.mem 0 1) u U).2 active, v.val, hv, w.val, hw, + (className vName).val.val, literal, + (Name.pair_mem_refinementClassGraph T valid Rc.val T valid v _).2 ⟨hv, rfl⟩, + (raw (.equal 0 1) (className u) (className vName)).2 equal⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRestrictedActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRestrictedActions.lean index dce7c7e9928f3c6e66e87c6c97af57e6231f4783..1a8df9dba5643b1bf5baf8eee5ae5c376175848d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRestrictedActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRestrictedActions.lean @@ -1,49 +1,49 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem restrictedActionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r A g source : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) - (hA : A ∈ M.sets) (hg : g ∈ M.sets) (hsource : source ∈ M.sets) : - restrictedActionGraph P r A g source ∈ M.sets := by - let params := extend P (extend r (extend A (extend g (extend source Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.restrictedActionEntryFormula 0 1 2 3 4 5) params - (Fin.cases hP (Fin.cases hr (Fin.cases hA (Fin.cases hg - (Fin.cases hsource (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hP hP) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.restrictedActionEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod P P) = restrictedActionGraph P r A g source := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, restrictedActionGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_restrictedActionEntryFormula 0 1 2 3 4 5 _) - exact equal ▸ selected - -theorem restrictedAction_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r A g source target base : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) - (hA : A ∈ M.sets) (hg : g ∈ M.sets) (hsource : source ∈ M.sets) - (code : RestrictedActionCode P r A g source target base) : base ∈ M.sets := by - rw [code.eq_graph] - exact M.restrictedActionGraph_mem pairing unions powers separation hP hr hA hg hsource - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem restrictedActionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r A g source : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) + (hA : A ∈ M.sets) (hg : g ∈ M.sets) (hsource : source ∈ M.sets) : + restrictedActionGraph P r A g source ∈ M.sets := by + let params := extend P (extend r (extend A (extend g (extend source Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.restrictedActionEntryFormula 0 1 2 3 4 5) params + (Fin.cases hP (Fin.cases hr (Fin.cases hA (Fin.cases hg + (Fin.cases hsource (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hP hP) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.restrictedActionEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod P P) = restrictedActionGraph P r A g source := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, restrictedActionGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_restrictedActionEntryFormula 0 1 2 3 4 5 _) + exact equal ▸ selected + +theorem restrictedAction_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r A g source target base : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) + (hA : A ∈ M.sets) (hg : g ∈ M.sets) (hsource : source ∈ M.sets) + (code : RestrictedActionCode P r A g source target base) : base ∈ M.sets := by + rw [code.eq_graph] + exact M.restrictedActionGraph_mem pairing unions powers separation hP hr hA hg hsource + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowAssignmentActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowAssignmentActions.lean index ade611a7ebd673e38edbd34a4173afa59a7fdd9c..3d5fd0a9bf7f2446861ec703ad10d9278ab38c71 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowAssignmentActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowAssignmentActions.lean @@ -1,121 +1,121 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BoundedRelationImageEquality -import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def rowAssignmentActionGraph (G Q C B J rowMaps assignmentMaps : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ g ∈ G, ∃ x ∈ Q, ∃ y ∈ Q, ∃ p ∈ C, ∃ A ∈ B, ∃ q ∈ C, ∃ D ∈ B, - ∃ rf ∈ ⋃₀ ⋃₀ rowMaps, ∃ af ∈ ⋃₀ ⋃₀ assignmentMaps, - z = ZFSet.pair (ZFSet.pair g x) y ∧ x = ZFSet.pair p A ∧ y = ZFSet.pair q D ∧ - ZFSet.pair g rf ∈ rowMaps ∧ ZFSet.pair p q ∈ rf ∧ - ZFSet.pair g af ∈ assignmentMaps ∧ D = relationImage A J af) - (ZFSet.prod (ZFSet.prod G Q) Q) - -theorem mem_rowAssignmentActionGraph (G Q C B J rowMaps assignmentMaps z : ZFSet.{u}) : - z ∈ rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps ↔ - ∃ g ∈ G, ∃ x ∈ Q, ∃ y ∈ Q, ∃ p ∈ C, ∃ A ∈ B, ∃ q ∈ C, ∃ D ∈ B, - ∃ rf ∈ ⋃₀ ⋃₀ rowMaps, ∃ af ∈ ⋃₀ ⋃₀ assignmentMaps, - z = ZFSet.pair (ZFSet.pair g x) y ∧ x = ZFSet.pair p A ∧ y = ZFSet.pair q D ∧ - ZFSet.pair g rf ∈ rowMaps ∧ ZFSet.pair p q ∈ rf ∧ - ZFSet.pair g af ∈ assignmentMaps ∧ D = relationImage A J af := by - rw [rowAssignmentActionGraph, ZFSet.mem_sep] - constructor - · exact And.right - · intro h - obtain ⟨g,hg,x,hx,y,hy,p,hp,A,hA,q,hq,D,hD,rf,hrf,af,haf,equal,rest⟩ := h - exact ⟨equal.symm ▸ ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg,hx⟩,hy⟩, - g,hg,x,hx,y,hy,p,hp,A,hA,q,hq,D,hD,rf,hrf,af,haf,equal,rest⟩ - -theorem pair_mem_rowAssignmentActionGraph (G Q C B J rowMaps assignmentMaps g p A q D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g (ZFSet.pair p A)) (ZFSet.pair q D) ∈ - rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps ↔ - g ∈ G ∧ ZFSet.pair p A ∈ Q ∧ ZFSet.pair q D ∈ Q ∧ p ∈ C ∧ A ∈ B ∧ q ∈ C ∧ D ∈ B ∧ - ∃ rf af, ZFSet.pair g rf ∈ rowMaps ∧ ZFSet.pair p q ∈ rf ∧ - ZFSet.pair g af ∈ assignmentMaps ∧ D = relationImage A J af := by - rw [mem_rowAssignmentActionGraph] - constructor - · rintro ⟨g',hg,x,hx,y,hy,p',hp,A',hA,q',hq,D',hD,rf,_,af,_,equal,xEq,yEq,rest⟩ - obtain ⟨outerSource,target⟩ := ZFSet.pair_injective equal - obtain ⟨rfl,innerSource⟩ := ZFSet.pair_injective outerSource - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective (innerSource.trans xEq) - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective (target.trans yEq) - exact ⟨hg,innerSource.symm ▸ hx,target.symm ▸ hy,hp,hA,hq,hD,rf,af,rest⟩ - · rintro ⟨hg,hx,hy,hp,hA,hq,hD,rf,af,indexed,row,indexedA,image⟩ - exact ⟨g,hg,_,hx,_,hy,p,hp,A,hA,q,hq,D,hD,rf,pair_second_mem_doubleUnion indexed, - af,pair_second_mem_doubleUnion indexedA,rfl,rfl,rfl,indexed,row,indexedA,image⟩ - -namespace BoundedFormula - -def rowAssignmentActionEntryFormula {n} (z G Q C B J rowRange assignmentRange rowMaps assignmentMaps : Fin n) : - BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ.succ.succ.succ - exMem G (exMem Q.succ (exMem Q.succ.succ (exMem C.succ.succ.succ - (exMem B.succ.succ.succ.succ (exMem C.succ.succ.succ.succ.succ - (exMem B.succ.succ.succ.succ.succ.succ (exMem rowRange.succ.succ.succ.succ.succ.succ.succ - (exMem assignmentRange.succ.succ.succ.succ.succ.succ.succ.succ - (.conj (orderedTripleFormula (lift z) 8 7 6) - (.conj (orderedPairFormula 7 5 4) (.conj (orderedPairFormula 6 3 2) - (.conj (pairMembershipFormula 8 1 (lift rowMaps)) - (.conj (pairMembershipFormula 5 3 1) - (.conj (pairMembershipFormula 8 0 (lift assignmentMaps)) - (relationImageEqualityFormula 2 4 (lift J) 0))))))))))))))) - -theorem truth_rowAssignmentActionEntryFormula {n} - (z G Q C B J rowRange assignmentRange rowMaps assignmentMaps : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rowAssignmentActionEntryFormula z G Q C B J rowRange assignmentRange rowMaps assignmentMaps) env ↔ - ∃ g ∈ env G, ∃ x ∈ env Q, ∃ y ∈ env Q, ∃ p ∈ env C, ∃ A ∈ env B, ∃ q ∈ env C, ∃ D ∈ env B, - ∃ rf ∈ env rowRange, ∃ af ∈ env assignmentRange, - env z = ZFSet.pair (ZFSet.pair g x) y ∧ x = ZFSet.pair p A ∧ y = ZFSet.pair q D ∧ - ZFSet.pair g rf ∈ env rowMaps ∧ ZFSet.pair p q ∈ rf ∧ - ZFSet.pair g af ∈ env assignmentMaps ∧ D = relationImage A (env J) af := by - simp only [rowAssignmentActionEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_orderedPairFormula, truth_pairMembershipFormula, truth_relationImageEqualityFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem rowAssignmentActionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G Q C B J rowMaps assignmentMaps : ZFSet.{u}} - (hG : G ∈ M.sets) (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) (hJ : J ∈ M.sets) - (hRows : rowMaps ∈ M.sets) (hAssignments : assignmentMaps ∈ M.sets) : - rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps ∈ M.sets := by - have hRowRange := M.union_mem unions (M.union_mem unions hRows) - have hAssignmentRange := M.union_mem unions (M.union_mem unions hAssignments) - let params : Fin 9 → ZFSet.{u} := - ![G,Q,C,B,J,⋃₀ ⋃₀ rowMaps,⋃₀ ⋃₀ assignmentMaps,rowMaps,assignmentMaps] - have members : ∀ j, params j ∈ M.sets := Fin.cases hG (Fin.cases hQ (Fin.cases hC - (Fin.cases hB (Fin.cases hJ (Fin.cases hRowRange (Fin.cases hAssignmentRange - (Fin.cases hRows (Fin.cases hAssignments (fun j => Fin.elim0 j))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.rowAssignmentActionEntryFormula 0 1 2 3 4 5 6 7 8 9) params members - (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hG hQ) hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.rowAssignmentActionEntryFormula 0 1 2 3 4 5 6 7 8 9) (extend z params)) - (ZFSet.prod (ZFSet.prod G Q) Q) = rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, rowAssignmentActionGraph, ZFSet.mem_sep, - BoundedFormula.truth_rowAssignmentActionEntryFormula] - rfl - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BoundedRelationImageEquality +import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def rowAssignmentActionGraph (G Q C B J rowMaps assignmentMaps : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ g ∈ G, ∃ x ∈ Q, ∃ y ∈ Q, ∃ p ∈ C, ∃ A ∈ B, ∃ q ∈ C, ∃ D ∈ B, + ∃ rf ∈ ⋃₀ ⋃₀ rowMaps, ∃ af ∈ ⋃₀ ⋃₀ assignmentMaps, + z = ZFSet.pair (ZFSet.pair g x) y ∧ x = ZFSet.pair p A ∧ y = ZFSet.pair q D ∧ + ZFSet.pair g rf ∈ rowMaps ∧ ZFSet.pair p q ∈ rf ∧ + ZFSet.pair g af ∈ assignmentMaps ∧ D = relationImage A J af) + (ZFSet.prod (ZFSet.prod G Q) Q) + +theorem mem_rowAssignmentActionGraph (G Q C B J rowMaps assignmentMaps z : ZFSet.{u}) : + z ∈ rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps ↔ + ∃ g ∈ G, ∃ x ∈ Q, ∃ y ∈ Q, ∃ p ∈ C, ∃ A ∈ B, ∃ q ∈ C, ∃ D ∈ B, + ∃ rf ∈ ⋃₀ ⋃₀ rowMaps, ∃ af ∈ ⋃₀ ⋃₀ assignmentMaps, + z = ZFSet.pair (ZFSet.pair g x) y ∧ x = ZFSet.pair p A ∧ y = ZFSet.pair q D ∧ + ZFSet.pair g rf ∈ rowMaps ∧ ZFSet.pair p q ∈ rf ∧ + ZFSet.pair g af ∈ assignmentMaps ∧ D = relationImage A J af := by + rw [rowAssignmentActionGraph, ZFSet.mem_sep] + constructor + · exact And.right + · intro h + obtain ⟨g,hg,x,hx,y,hy,p,hp,A,hA,q,hq,D,hD,rf,hrf,af,haf,equal,rest⟩ := h + exact ⟨equal.symm ▸ ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg,hx⟩,hy⟩, + g,hg,x,hx,y,hy,p,hp,A,hA,q,hq,D,hD,rf,hrf,af,haf,equal,rest⟩ + +theorem pair_mem_rowAssignmentActionGraph (G Q C B J rowMaps assignmentMaps g p A q D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g (ZFSet.pair p A)) (ZFSet.pair q D) ∈ + rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps ↔ + g ∈ G ∧ ZFSet.pair p A ∈ Q ∧ ZFSet.pair q D ∈ Q ∧ p ∈ C ∧ A ∈ B ∧ q ∈ C ∧ D ∈ B ∧ + ∃ rf af, ZFSet.pair g rf ∈ rowMaps ∧ ZFSet.pair p q ∈ rf ∧ + ZFSet.pair g af ∈ assignmentMaps ∧ D = relationImage A J af := by + rw [mem_rowAssignmentActionGraph] + constructor + · rintro ⟨g',hg,x,hx,y,hy,p',hp,A',hA,q',hq,D',hD,rf,_,af,_,equal,xEq,yEq,rest⟩ + obtain ⟨outerSource,target⟩ := ZFSet.pair_injective equal + obtain ⟨rfl,innerSource⟩ := ZFSet.pair_injective outerSource + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective (innerSource.trans xEq) + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective (target.trans yEq) + exact ⟨hg,innerSource.symm ▸ hx,target.symm ▸ hy,hp,hA,hq,hD,rf,af,rest⟩ + · rintro ⟨hg,hx,hy,hp,hA,hq,hD,rf,af,indexed,row,indexedA,image⟩ + exact ⟨g,hg,_,hx,_,hy,p,hp,A,hA,q,hq,D,hD,rf,pair_second_mem_doubleUnion indexed, + af,pair_second_mem_doubleUnion indexedA,rfl,rfl,rfl,indexed,row,indexedA,image⟩ + +namespace BoundedFormula + +def rowAssignmentActionEntryFormula {n} (z G Q C B J rowRange assignmentRange rowMaps assignmentMaps : Fin n) : + BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ.succ.succ.succ + exMem G (exMem Q.succ (exMem Q.succ.succ (exMem C.succ.succ.succ + (exMem B.succ.succ.succ.succ (exMem C.succ.succ.succ.succ.succ + (exMem B.succ.succ.succ.succ.succ.succ (exMem rowRange.succ.succ.succ.succ.succ.succ.succ + (exMem assignmentRange.succ.succ.succ.succ.succ.succ.succ.succ + (.conj (orderedTripleFormula (lift z) 8 7 6) + (.conj (orderedPairFormula 7 5 4) (.conj (orderedPairFormula 6 3 2) + (.conj (pairMembershipFormula 8 1 (lift rowMaps)) + (.conj (pairMembershipFormula 5 3 1) + (.conj (pairMembershipFormula 8 0 (lift assignmentMaps)) + (relationImageEqualityFormula 2 4 (lift J) 0))))))))))))))) + +theorem truth_rowAssignmentActionEntryFormula {n} + (z G Q C B J rowRange assignmentRange rowMaps assignmentMaps : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rowAssignmentActionEntryFormula z G Q C B J rowRange assignmentRange rowMaps assignmentMaps) env ↔ + ∃ g ∈ env G, ∃ x ∈ env Q, ∃ y ∈ env Q, ∃ p ∈ env C, ∃ A ∈ env B, ∃ q ∈ env C, ∃ D ∈ env B, + ∃ rf ∈ env rowRange, ∃ af ∈ env assignmentRange, + env z = ZFSet.pair (ZFSet.pair g x) y ∧ x = ZFSet.pair p A ∧ y = ZFSet.pair q D ∧ + ZFSet.pair g rf ∈ env rowMaps ∧ ZFSet.pair p q ∈ rf ∧ + ZFSet.pair g af ∈ env assignmentMaps ∧ D = relationImage A (env J) af := by + simp only [rowAssignmentActionEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_orderedPairFormula, truth_pairMembershipFormula, truth_relationImageEqualityFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem rowAssignmentActionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G Q C B J rowMaps assignmentMaps : ZFSet.{u}} + (hG : G ∈ M.sets) (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) (hJ : J ∈ M.sets) + (hRows : rowMaps ∈ M.sets) (hAssignments : assignmentMaps ∈ M.sets) : + rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps ∈ M.sets := by + have hRowRange := M.union_mem unions (M.union_mem unions hRows) + have hAssignmentRange := M.union_mem unions (M.union_mem unions hAssignments) + let params : Fin 9 → ZFSet.{u} := + ![G,Q,C,B,J,⋃₀ ⋃₀ rowMaps,⋃₀ ⋃₀ assignmentMaps,rowMaps,assignmentMaps] + have members : ∀ j, params j ∈ M.sets := Fin.cases hG (Fin.cases hQ (Fin.cases hC + (Fin.cases hB (Fin.cases hJ (Fin.cases hRowRange (Fin.cases hAssignmentRange + (Fin.cases hRows (Fin.cases hAssignments (fun j => Fin.elim0 j))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.rowAssignmentActionEntryFormula 0 1 2 3 4 5 6 7 8 9) params members + (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hG hQ) hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.rowAssignmentActionEntryFormula 0 1 2 3 4 5 6 7 8 9) (extend z params)) + (ZFSet.prod (ZFSet.prod G Q) Q) = rowAssignmentActionGraph G Q C B J rowMaps assignmentMaps := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, rowAssignmentActionGraph, ZFSet.mem_sep, + BoundedFormula.truth_rowAssignmentActionEntryFormula] + rfl + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowGenerics.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowGenerics.lean index 5ddeafa7bab93fbd4650627669b355f269116dca..548998a50db38e39c3d66ecf93b1ea96cc2792dc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowGenerics.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowGenerics.lean @@ -1,294 +1,294 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowDistinguishing - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def coordinateAssignedFormula {n} (p x y : Fin n) : BoundedFormula n := - exMem y (pairMembershipFormula x.succ 0 p.succ) - -theorem truth_coordinateAssignedFormula {n} (p x y : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (coordinateAssignedFormula p x y) env ↔ - ∃ b ∈ env y, ZFSet.pair (env x) b ∈ env p := by - simp only [coordinateAssignedFormula, truth_exMem, truth_pairMembershipFormula] - rfl - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem coordinateAssigned_code_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y x : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hx : x ∈ X) : - (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)).subset - (M.coordinateAssigned X Y x) ∈ M.sets := by - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - let params := extend x (extend Y Fin.elim0) - have members : ∀ i, params i ∈ M.sets := - Fin.cases (M.transitive hX hx) (Fin.cases hY (fun i => Fin.elim0 i)) - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY - have selected := M.separation_mem separation - (BoundedFormula.coordinateAssignedFormula 0 1 2).toFormula params members carrier - have eq : ZFSet.sep (fun z => Realize M.sets - (BoundedFormula.coordinateAssignedFormula 0 1 2).toFormula (extend z params)) - (M.smallPartialFunctions X Y ZFSet.omega) = s.subset (M.coordinateAssigned X Y x) := by - apply ZFSet.ext - intro z - erw [ZFSet.mem_sep, s.mem_subset] - constructor - · rintro ⟨hz, rel⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz - exact ⟨p, (BoundedFormula.truth_coordinateAssignedFormula 0 1 2 _).1 - ((BoundedFormula.realize_toFormula M _ _ - (Fin.cases (M.transitive carrier hz) members)).1 rel), rfl⟩ - · rintro ⟨p, assigned, rfl⟩ - exact ⟨s.encode_mem p, (BoundedFormula.realize_toFormula M _ _ - (Fin.cases (M.transitive carrier (s.encode_mem p)) members)).2 - ((BoundedFormula.truth_coordinateAssignedFormula 0 1 2 _).2 assigned)⟩ - exact eq ▸ selected - -theorem generic_meets_coordinate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y x : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) - (values : Y.Nonempty) (hx : x ∈ X) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), - H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) → - H.Meets (M.coordinateAssigned X Y x) := by - let := M.smallFunctionOrder X Y ZFSet.omega - intro H generic - exact M.generic_meets_coded_dense _ H generic - (M.coordinateAssigned_code_mem pairing unions powers separation infinite hX hY hx) - (M.coordinateAssigned_dense pairing unions powers separation infinite hX hY values hx) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def countableGenericGraph (X Y : ZFSet.{u}) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) → ZFSet.{u} := by - letI := M.smallFunctionOrder X Y ZFSet.omega - exact fun H => ZFSet.sep (fun z => ∃ p, H.mem p ∧ z ∈ SetMembers.raw p) (ZFSet.prod X Y) - -theorem mem_countableGenericGraph (X Y : ZFSet.{u}) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega))) (z : ZFSet.{u}), - z ∈ M.countableGenericGraph X Y H ↔ ∃ p, H.mem p ∧ z ∈ SetMembers.raw p := by - let := M.smallFunctionOrder X Y ZFSet.omega - intro H z - rw [countableGenericGraph, ZFSet.mem_sep] - constructor - · exact And.right - · rintro ⟨p, hp, hz⟩ - exact ⟨(M.smallFunction_raw_properties X Y ZFSet.omega p).2.1.shape hz, p, hp, hz⟩ - -theorem countableGenericGraph_extends (X Y : ZFSet.{u}) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega))) p, - H.mem p → SetMembers.raw p ⊆ M.countableGenericGraph X Y H := by - let := M.smallFunctionOrder X Y ZFSet.omega - intro H p hp z hz - exact (M.mem_countableGenericGraph X Y H z).2 ⟨p, hp, hz⟩ - -theorem countableGenericGraph_partial (X Y : ZFSet.{u}) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), - PartialFunctionCode X Y (M.countableGenericGraph X Y H) := by - let := M.smallFunctionOrder X Y ZFSet.omega - intro H - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x y z hy hz - obtain ⟨p, hp, py⟩ := (M.mem_countableGenericGraph X Y H _).1 hy - obtain ⟨q, hq, qz⟩ := (M.mem_countableGenericGraph X Y H _).1 hz - obtain ⟨r, _, rp, rq⟩ := H.directed hp hq - have code := (M.smallFunction_raw_properties X Y ZFSet.omega r).2.1 - exact code.unique x y z - ((M.smallFunction_le_iff X Y ZFSet.omega r p).1 rp py) - ((M.smallFunction_le_iff X Y ZFSet.omega r q).1 rq qz) - -theorem countableGenericGraph_isFunc - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (values : Y.Nonempty) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), - H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) → - ZFSet.IsFunc X Y (M.countableGenericGraph X Y H) := by - let := M.smallFunctionOrder X Y ZFSet.omega - intro H generic - have code := M.countableGenericGraph_partial X Y H - refine ⟨code.shape, ?_⟩ - intro x hx - obtain ⟨p, hp, y, _, rel⟩ := - M.generic_meets_coordinate pairing unions powers separation infinite hX hY values hx H generic - have entry := M.countableGenericGraph_extends X Y H p hp rel - exact ⟨y, entry, fun z hz => code.unique x z y hz entry⟩ - -theorem exists_total_countableFunction_generic - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (values : Y.Nonempty) - (p : SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), H.mem p ∧ - H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) ∧ - H.GenericFor (formulaFamily (M.nameDomain - (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)))) ∧ - ZFSet.IsFunc X Y (M.countableGenericGraph X Y H) := by - let := M.smallFunctionOrder X Y ZFSet.omega - obtain ⟨H, hp, ground, ordinary⟩ := - M.exists_countableFunction_generic small pairing unions powers separation infinite hX hY p - exact ⟨H, hp, ground, ordinary, - M.countableGenericGraph_isFunc pairing unions powers separation infinite hX hY values H ground⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def rowDistinguishingFormula {n} (p i j c y : Fin n) : BoundedFormula n := - exMem c (exMem y.succ (exMem y.succ.succ - (.conj (.neg (.equal 1 0)) - (.conj (tripleMembershipFormula i.succ.succ.succ 2 1 p.succ.succ.succ) - (tripleMembershipFormula j.succ.succ.succ 2 0 p.succ.succ.succ))))) - -theorem truth_rowDistinguishingFormula {n} (p i j c y : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rowDistinguishingFormula p i j c y) env ↔ - ∃ k ∈ env c, ∃ a ∈ env y, ∃ b ∈ env y, a ≠ b ∧ - ZFSet.pair (ZFSet.pair (env i) k) a ∈ env p ∧ - ZFSet.pair (ZFSet.pair (env j) k) b ∈ env p := by - simp only [rowDistinguishingFormula, truth_exMem, Truth, truth_tripleMembershipFormula] - rfl - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem rowDistinguishing_code_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) - (hi : i ∈ I) (hj : j ∈ I) : - (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)).subset - (M.rowDistinguishing I C Y i j) ∈ M.sets := by - let s := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) - let params := extend i (extend j (extend C (extend Y Fin.elim0))) - have members : ∀ k, params k ∈ M.sets := - Fin.cases (M.transitive hI hi) (Fin.cases (M.transitive hI hj) - (Fin.cases hC (Fin.cases hY (fun k => Fin.elim0 k)))) - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) hY - have selected := M.bounded_separation_mem separation - (BoundedFormula.rowDistinguishingFormula 0 1 2 3 4) params members carrier - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.rowDistinguishingFormula 0 1 2 3 4) (extend z params)) - (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) = - s.subset (M.rowDistinguishing I C Y i j) := by - apply ZFSet.ext - intro z - erw [ZFSet.mem_sep, s.mem_subset] - constructor - · rintro ⟨hz, rel⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz - exact ⟨p, (BoundedFormula.truth_rowDistinguishingFormula 0 1 2 3 4 _).1 rel, rfl⟩ - · rintro ⟨p, distinguishing, rfl⟩ - exact ⟨s.encode_mem p, - (BoundedFormula.truth_rowDistinguishingFormula 0 1 2 3 4 _).2 distinguishing⟩ - exact eq ▸ selected - -theorem generic_meets_rowDistinguishing - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) - (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) - (values : ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : - letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)), - H.GenericFor (M.codedFamily - (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega))) → - H.Meets (M.rowDistinguishing I C Y i j) := by - let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - intro H generic - exact M.generic_meets_coded_dense _ H generic - (M.rowDistinguishing_code_mem pairing unions powers separation infinite hI hC hY hi hj) - (M.rowDistinguishing_dense pairing unions powers separation infinite choice - hI hC hY hi hj distinct values uncountable) - -theorem countableGenericGraph_rows_separated - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) - (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) - (values : ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : - letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)), - H.GenericFor (M.codedFamily - (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega))) → - ∃ c ∈ C, ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b ∧ - ZFSet.pair (ZFSet.pair i c) a ∈ M.countableGenericGraph (ZFSet.prod I C) Y H ∧ - ZFSet.pair (ZFSet.pair j c) b ∈ M.countableGenericGraph (ZFSet.prod I C) Y H ∧ - ZFSet.pair (ZFSet.pair j c) a ∉ M.countableGenericGraph (ZFSet.prod I C) Y H := by - let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - intro H generic - obtain ⟨p, hp, c, hc, a, ha, b, hb, ne, first, second⟩ := - M.generic_meets_rowDistinguishing pairing unions powers separation infinite choice - hI hC hY hi hj distinct values uncountable H generic - have includes := M.countableGenericGraph_extends (ZFSet.prod I C) Y H p hp - have firstEntry := includes first - have secondEntry := includes second - refine ⟨c, hc, a, ha, b, hb, ne, firstEntry, secondEntry, ?_⟩ - intro sameValue - exact ne ((M.countableGenericGraph_partial (ZFSet.prod I C) Y H).unique - (ZFSet.pair j c) a b sameValue secondEntry) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowDistinguishing + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def coordinateAssignedFormula {n} (p x y : Fin n) : BoundedFormula n := + exMem y (pairMembershipFormula x.succ 0 p.succ) + +theorem truth_coordinateAssignedFormula {n} (p x y : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (coordinateAssignedFormula p x y) env ↔ + ∃ b ∈ env y, ZFSet.pair (env x) b ∈ env p := by + simp only [coordinateAssignedFormula, truth_exMem, truth_pairMembershipFormula] + rfl + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem coordinateAssigned_code_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y x : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hx : x ∈ X) : + (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)).subset + (M.coordinateAssigned X Y x) ∈ M.sets := by + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + let params := extend x (extend Y Fin.elim0) + have members : ∀ i, params i ∈ M.sets := + Fin.cases (M.transitive hX hx) (Fin.cases hY (fun i => Fin.elim0 i)) + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY + have selected := M.separation_mem separation + (BoundedFormula.coordinateAssignedFormula 0 1 2).toFormula params members carrier + have eq : ZFSet.sep (fun z => Realize M.sets + (BoundedFormula.coordinateAssignedFormula 0 1 2).toFormula (extend z params)) + (M.smallPartialFunctions X Y ZFSet.omega) = s.subset (M.coordinateAssigned X Y x) := by + apply ZFSet.ext + intro z + erw [ZFSet.mem_sep, s.mem_subset] + constructor + · rintro ⟨hz, rel⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz + exact ⟨p, (BoundedFormula.truth_coordinateAssignedFormula 0 1 2 _).1 + ((BoundedFormula.realize_toFormula M _ _ + (Fin.cases (M.transitive carrier hz) members)).1 rel), rfl⟩ + · rintro ⟨p, assigned, rfl⟩ + exact ⟨s.encode_mem p, (BoundedFormula.realize_toFormula M _ _ + (Fin.cases (M.transitive carrier (s.encode_mem p)) members)).2 + ((BoundedFormula.truth_coordinateAssignedFormula 0 1 2 _).2 assigned)⟩ + exact eq ▸ selected + +theorem generic_meets_coordinate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y x : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) + (values : Y.Nonempty) (hx : x ∈ X) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), + H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) → + H.Meets (M.coordinateAssigned X Y x) := by + let := M.smallFunctionOrder X Y ZFSet.omega + intro H generic + exact M.generic_meets_coded_dense _ H generic + (M.coordinateAssigned_code_mem pairing unions powers separation infinite hX hY hx) + (M.coordinateAssigned_dense pairing unions powers separation infinite hX hY values hx) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def countableGenericGraph (X Y : ZFSet.{u}) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) → ZFSet.{u} := by + letI := M.smallFunctionOrder X Y ZFSet.omega + exact fun H => ZFSet.sep (fun z => ∃ p, H.mem p ∧ z ∈ SetMembers.raw p) (ZFSet.prod X Y) + +theorem mem_countableGenericGraph (X Y : ZFSet.{u}) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega))) (z : ZFSet.{u}), + z ∈ M.countableGenericGraph X Y H ↔ ∃ p, H.mem p ∧ z ∈ SetMembers.raw p := by + let := M.smallFunctionOrder X Y ZFSet.omega + intro H z + rw [countableGenericGraph, ZFSet.mem_sep] + constructor + · exact And.right + · rintro ⟨p, hp, hz⟩ + exact ⟨(M.smallFunction_raw_properties X Y ZFSet.omega p).2.1.shape hz, p, hp, hz⟩ + +theorem countableGenericGraph_extends (X Y : ZFSet.{u}) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega))) p, + H.mem p → SetMembers.raw p ⊆ M.countableGenericGraph X Y H := by + let := M.smallFunctionOrder X Y ZFSet.omega + intro H p hp z hz + exact (M.mem_countableGenericGraph X Y H z).2 ⟨p, hp, hz⟩ + +theorem countableGenericGraph_partial (X Y : ZFSet.{u}) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), + PartialFunctionCode X Y (M.countableGenericGraph X Y H) := by + let := M.smallFunctionOrder X Y ZFSet.omega + intro H + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x y z hy hz + obtain ⟨p, hp, py⟩ := (M.mem_countableGenericGraph X Y H _).1 hy + obtain ⟨q, hq, qz⟩ := (M.mem_countableGenericGraph X Y H _).1 hz + obtain ⟨r, _, rp, rq⟩ := H.directed hp hq + have code := (M.smallFunction_raw_properties X Y ZFSet.omega r).2.1 + exact code.unique x y z + ((M.smallFunction_le_iff X Y ZFSet.omega r p).1 rp py) + ((M.smallFunction_le_iff X Y ZFSet.omega r q).1 rq qz) + +theorem countableGenericGraph_isFunc + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (values : Y.Nonempty) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), + H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) → + ZFSet.IsFunc X Y (M.countableGenericGraph X Y H) := by + let := M.smallFunctionOrder X Y ZFSet.omega + intro H generic + have code := M.countableGenericGraph_partial X Y H + refine ⟨code.shape, ?_⟩ + intro x hx + obtain ⟨p, hp, y, _, rel⟩ := + M.generic_meets_coordinate pairing unions powers separation infinite hX hY values hx H generic + have entry := M.countableGenericGraph_extends X Y H p hp rel + exact ⟨y, entry, fun z hz => code.unique x z y hz entry⟩ + +theorem exists_total_countableFunction_generic + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (values : Y.Nonempty) + (p : SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), H.mem p ∧ + H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega))) ∧ + H.GenericFor (formulaFamily (M.nameDomain + (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)))) ∧ + ZFSet.IsFunc X Y (M.countableGenericGraph X Y H) := by + let := M.smallFunctionOrder X Y ZFSet.omega + obtain ⟨H, hp, ground, ordinary⟩ := + M.exists_countableFunction_generic small pairing unions powers separation infinite hX hY p + exact ⟨H, hp, ground, ordinary, + M.countableGenericGraph_isFunc pairing unions powers separation infinite hX hY values H ground⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def rowDistinguishingFormula {n} (p i j c y : Fin n) : BoundedFormula n := + exMem c (exMem y.succ (exMem y.succ.succ + (.conj (.neg (.equal 1 0)) + (.conj (tripleMembershipFormula i.succ.succ.succ 2 1 p.succ.succ.succ) + (tripleMembershipFormula j.succ.succ.succ 2 0 p.succ.succ.succ))))) + +theorem truth_rowDistinguishingFormula {n} (p i j c y : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rowDistinguishingFormula p i j c y) env ↔ + ∃ k ∈ env c, ∃ a ∈ env y, ∃ b ∈ env y, a ≠ b ∧ + ZFSet.pair (ZFSet.pair (env i) k) a ∈ env p ∧ + ZFSet.pair (ZFSet.pair (env j) k) b ∈ env p := by + simp only [rowDistinguishingFormula, truth_exMem, Truth, truth_tripleMembershipFormula] + rfl + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem rowDistinguishing_code_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) + (hi : i ∈ I) (hj : j ∈ I) : + (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)).subset + (M.rowDistinguishing I C Y i j) ∈ M.sets := by + let s := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) + let params := extend i (extend j (extend C (extend Y Fin.elim0))) + have members : ∀ k, params k ∈ M.sets := + Fin.cases (M.transitive hI hi) (Fin.cases (M.transitive hI hj) + (Fin.cases hC (Fin.cases hY (fun k => Fin.elim0 k)))) + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) hY + have selected := M.bounded_separation_mem separation + (BoundedFormula.rowDistinguishingFormula 0 1 2 3 4) params members carrier + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.rowDistinguishingFormula 0 1 2 3 4) (extend z params)) + (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) = + s.subset (M.rowDistinguishing I C Y i j) := by + apply ZFSet.ext + intro z + erw [ZFSet.mem_sep, s.mem_subset] + constructor + · rintro ⟨hz, rel⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz + exact ⟨p, (BoundedFormula.truth_rowDistinguishingFormula 0 1 2 3 4 _).1 rel, rfl⟩ + · rintro ⟨p, distinguishing, rfl⟩ + exact ⟨s.encode_mem p, + (BoundedFormula.truth_rowDistinguishingFormula 0 1 2 3 4 _).2 distinguishing⟩ + exact eq ▸ selected + +theorem generic_meets_rowDistinguishing + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) + (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) + (values : ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : + letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)), + H.GenericFor (M.codedFamily + (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega))) → + H.Meets (M.rowDistinguishing I C Y i j) := by + let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + intro H generic + exact M.generic_meets_coded_dense _ H generic + (M.rowDistinguishing_code_mem pairing unions powers separation infinite hI hC hY hi hj) + (M.rowDistinguishing_dense pairing unions powers separation infinite choice + hI hC hY hi hj distinct values uncountable) + +theorem countableGenericGraph_rows_separated + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) + (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) + (values : ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : + letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)), + H.GenericFor (M.codedFamily + (SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega))) → + ∃ c ∈ C, ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b ∧ + ZFSet.pair (ZFSet.pair i c) a ∈ M.countableGenericGraph (ZFSet.prod I C) Y H ∧ + ZFSet.pair (ZFSet.pair j c) b ∈ M.countableGenericGraph (ZFSet.prod I C) Y H ∧ + ZFSet.pair (ZFSet.pair j c) a ∉ M.countableGenericGraph (ZFSet.prod I C) Y H := by + let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + intro H generic + obtain ⟨p, hp, c, hc, a, ha, b, hb, ne, first, second⟩ := + M.generic_meets_rowDistinguishing pairing unions powers separation infinite choice + hI hC hY hi hj distinct values uncountable H generic + have includes := M.countableGenericGraph_extends (ZFSet.prod I C) Y H p hp + have firstEntry := includes first + have secondEntry := includes second + refine ⟨c, hc, a, ha, b, hb, ne, firstEntry, secondEntry, ?_⟩ + intro sameValue + exact ne ((M.countableGenericGraph_partial (ZFSet.prod I C) Y H).unique + (ZFSet.pair j c) a b sameValue secondEntry) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTermSetNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTermSetNames.lean index 1d0da84a78365f58e24cc4269c3f75a1d6227ce8..bba2b32716092d42293b946c11ae64979bea5488 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTermSetNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTermSetNames.lean @@ -1,338 +1,338 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleProvenance - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] - -theorem rowPositionSequence_decode (s : Presentation L) - (hL : s.carrier ∈ M.sets) {mu f : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) - (member : f ∈ M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu) : - f ∈ M.sets ∧ ∃ δ ∈ M.sets, ordinalSetProperty δ ∧ δ ⊆ mu ∧ - ∃ function : FunctionGraphOn δ f, ∃ positions : δ.toSet → {i : L // i ≠ ⊥}, - ∃ D : L, (∀ i, function.value i = s.encode (positions i).val) ∧ - ∀ i, (positions i).val ≤ D := by - obtain ⟨hf, δ, hδ, ordδ, subδ, fn, d, hd, _, bounds⟩ := - M.rowPositionSequence_data hL hmu ordinal member - let function : FunctionGraphOn δ f := ⟨s.nonbottom.carrier, fn⟩ - have range (i : δ.toSet) : function.value i ∈ s.nonbottom.carrier := - (ZFSet.pair_mem_prod.1 (fn.1 (function.value_entry i))).2 - have each (i : δ.toSet) : ∃ x : {i : L // i ≠ ⊥}, s.encode x.val = function.value i := - (s.nonbottom.mem_carrier (function.value i)).1 (range i) - let positions (i : δ.toSet) : {i : L // i ≠ ⊥} := Classical.choose (each i) - have values (i : δ.toSet) : function.value i = s.encode (positions i).val := - (Classical.choose_spec (each i)).symm - obtain ⟨D, rfl⟩ := (s.mem_carrier d).1 hd - refine ⟨hf, δ, hδ, ordδ, subδ, function, positions, D, values, ?_⟩ - intro i - have bound := bounds i.val (function.value i) (function.value_entry i) - rw [values i] at bound - exact (s.pair_mem_conditionOrder (positions i).val D).1 bound - -variable [Group G] (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem binaryRowTupleTerms_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - ∀ z ∈ rowTupleTerms (SetMembers.raw (⊤ : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S, - ∃ τ : Name c, τ.val = z ∧ HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) τ := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - dsimp only - intro z hz - obtain ⟨f, hf, rfl⟩ := (mem_rowTupleTerms _ _ _ _ _ _ z).1 hz - obtain ⟨_, δ, _, _, subset, function, positions, D, values, bounded⟩ := - M.rowPositionSequence_decode s hL hmu ordinal hf - refine ⟨M.internalRowTupleName s C hL δ positions, ?_, ?_⟩ - · exact (M.internalRowTupleCode_eq s C hL function subset positions values).symm - · exact M.internalRowTupleName_hs a s b C pairing unions powers separation infinite - hL hC hG graph directed δ positions D bounded - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem binaryRowTupleTerms_action {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (SetMembers.raw (⊤ : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S - ∀ (g : G) (τ : Name c), τ.val ∈ T → (act.act c g τ).val ∈ T := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - dsimp only - intro g τ member - obtain ⟨f, hf, equal⟩ := (mem_rowTupleTerms _ _ _ _ _ _ τ.val).1 member - obtain ⟨_, δ, _, _, subset, function, positions, _, values, _⟩ := - M.rowPositionSequence_decode s hL hmu ordinal hf - have original : ZFSet.IsFunc δ s.nonbottom.carrier f := by - refine ⟨?_, function.to_isFunc.2⟩ - intro z hz - obtain ⟨i, hi, y, rfl⟩ := function.shape z hz - have value := (function.value_eq_of_entry ⟨i, hi⟩ hz).symm.trans (values ⟨i, hi⟩) - exact ZFSet.pair_mem_prod.2 ⟨hi, value.symm ▸ s.nonbottom.encode_mem (positions ⟨i, hi⟩)⟩ - let moved := rowPositionSequenceAction a s g mu f - have hmoved := M.rowPositionSequenceAction_mem a s b pairing unions powers separation - hL hG graph hmu ordinal g hf - let movedFunction : FunctionGraphOn δ moved := - ⟨s.nonbottom.carrier, rowPositionSequenceAction_function a s g subset original⟩ - have movedValues (i : δ.toSet) : - movedFunction.value i = s.encode (a.nonbottom.iso g (positions i)).val := by - apply movedFunction.value_eq_of_entry - apply (pair_mem_rowPositionSequenceAction a s g mu f i.val (positions i)).2 - refine ⟨subset i.property, ?_⟩ - rw [← values i] - exact function.value_entry i - have actual : τ = M.internalRowTupleName s C hL δ positions := - Subtype.ext (equal.trans (M.internalRowTupleCode_eq s C hL function subset positions values)) - rw [actual, M.internalRowTupleName_action a s b C pairing unions powers separation infinite - hL hC hG graph] - apply (mem_rowTupleTerms _ _ _ _ _ _ _).2 - exact ⟨moved, hmoved, - (M.internalRowTupleCode_eq s C hL movedFunction subset - (fun i => a.nonbottom.iso g (positions i)) movedValues).symm⟩ - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include collection order -theorem binaryRowTermSetName_exists (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ ∃ τ : Name c, τ.val ∈ M.sets ∧ τ.val = ZFSet.prod T {c.encode ⊤} ∧ - HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) τ ∧ - (∀ g : G, act.act c g τ = τ) ∧ - ∀ (H : Set (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))), ⊤ ∈ H → - ∀ x, x ∈ Name.eval H τ ↔ ∃ σ : Name c, σ.val ∈ T ∧ Name.eval H σ = x := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - have hI := M.nonbottom_carrier_mem s separation hL - have hS : S ∈ M.sets := M.rowPositionSequences_mem pairing unions powers separation hL order hI hmu - have hfamily := M.binaryRowTupleFamily_mem pairing unions powers separation collection infinite hL order hI hC hmu ⊤ - have hT : T ∈ M.sets := M.rowTupleTerms_mem unions separation hS hfamily - have each := M.binaryRowTupleTerms_hs a s b C pairing unions powers separation infinite - hL hC hG graph directed hmu ordinal - have valid (z : ZFSet.{u}) (hz : z ∈ T) : IsName c z := by - obtain ⟨σ, eq, _⟩ := each z hz - exact eq ▸ σ.property - have children (σ : Name c) (hσ : σ.val ∈ T) : - HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) σ := by - obtain ⟨ν, eq, hs⟩ := each σ.val hσ - have same : ν = σ := Subtype.ext eq - exact same ▸ hs - have closed := M.binaryRowTupleTerms_action a s b C pairing unions powers separation infinite - hL hC hG graph hmu ordinal - have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) - refine ⟨hT, Name.familySet ⊤ T valid, - M.familySet_mem c ⊤ pairing unions powers separation hT (M.transitive hQ (c.encode_mem ⊤)) valid, - Name.familySet_code ⊤ T valid, - Name.familySet_hs act (a.principalSupportFamily ⊥ directed) T valid closed children, - Name.act_familySet act T valid closed, ?_⟩ - intro H hone x - exact Name.mem_eval_familySet H ⊤ hone T valid x - -end - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem binaryRowLiftedTermFamilies_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - (∀ τ : Name c.pairEmpty, τ.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) τ) ∧ - (∀ τ : Name c.pairEmpty, - τ.val ∈ orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) τ) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted - have original : ∀ σ : Name c, σ.val ∈ T → - HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) σ := by - intro σ member - obtain ⟨τ, equal, hs⟩ := M.binaryRowTupleTerms_hs a s b C pairing unions powers separation - infinite hL hC hG graph directed hmu ordinal σ.val member - have same : τ = σ := Subtype.ext equal - exact same ▸ hs - have liftedHS := Name.renamedFamily_hs act c.pairEmpty - (a.principalSupportFamily ⊥ directed) T valid original - have liftedValid := Name.renamedFamily_valid c.pairEmpty id T valid - exact ⟨liftedHS, orderedPairNameFamily_hs act (a.principalSupportFamily ⊥ directed) - liftedValid liftedValid liftedHS liftedHS⟩ - -theorem binaryRowTupleCode_action {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - ∀ (g : G) (f : ZFSet.{u}) (τ : Name c), f ∈ S → - τ.val = rowTupleCode (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows f → - rowPositionSequenceAction a s g mu f ∈ S ∧ - (act.act c g τ).val = rowTupleCode (c.encode ⊤) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows (rowPositionSequenceAction a s g mu f) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - dsimp only - intro g f τ hf equal - obtain ⟨_, δ, _, _, subset, function, positions, _, values, _⟩ := - M.rowPositionSequence_decode s hL hmu ordinal hf - have original : ZFSet.IsFunc δ s.nonbottom.carrier f := by - refine ⟨?_, function.to_isFunc.2⟩ - intro z hz - obtain ⟨i, hi, y, rfl⟩ := function.shape z hz - have value := (function.value_eq_of_entry ⟨i, hi⟩ hz).symm.trans (values ⟨i, hi⟩) - exact ZFSet.pair_mem_prod.2 ⟨hi, value.symm ▸ s.nonbottom.encode_mem (positions ⟨i, hi⟩)⟩ - let moved := rowPositionSequenceAction a s g mu f - have hmoved := M.rowPositionSequenceAction_mem a s b pairing unions powers separation - hL hG graph hmu ordinal g hf - let movedFunction : FunctionGraphOn δ moved := - ⟨s.nonbottom.carrier, rowPositionSequenceAction_function a s g subset original⟩ - have movedValues (i : δ.toSet) : - movedFunction.value i = s.encode (a.nonbottom.iso g (positions i)).val := by - apply movedFunction.value_eq_of_entry - apply (pair_mem_rowPositionSequenceAction a s g mu f i.val (positions i)).2 - refine ⟨subset i.property, ?_⟩ - rw [← values i] - exact function.value_entry i - have actual : τ = M.internalRowTupleName s C hL δ positions := - Subtype.ext (equal.trans (M.internalRowTupleCode_eq s C hL function subset positions values)) - refine ⟨hmoved, ?_⟩ - rw [actual, M.internalRowTupleName_action a s b C pairing unions powers separation infinite - hL hC hG graph] - exact (M.internalRowTupleCode_eq s C hL movedFunction subset - (fun i => a.nonbottom.iso g (positions i)) movedValues).symm - -theorem binaryLiftedRowTupleFamily_action {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ (valid : ∀ z ∈ T, IsName c z) (g : G) (f : ZFSet.{u}) (τ : Name c.pairEmpty), - ZFSet.pair f τ.val ∈ liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid → - ZFSet.pair (rowPositionSequenceAction a s g mu f) (act.act c.pairEmpty g τ).val ∈ - liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid g f τ entry - obtain ⟨hf, σ, source, lifted⟩ := (pair_mem_liftedRowTupleFamily c (c.encode ⊤) mu - s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid f τ.val).1 entry - have moved := M.binaryRowTupleCode_action a s b C pairing unions powers separation infinite - hL hC hG graph hmu ordinal g f σ hf source - have same : τ = Name.presentationEquiv c c.pairEmpty σ := Subtype.ext lifted - apply (pair_mem_liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid _ _).2 - refine ⟨moved.1, act.act c g σ, moved.2, ?_⟩ - rw [same, act.act_presentationEquiv] - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleProvenance + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] + +theorem rowPositionSequence_decode (s : Presentation L) + (hL : s.carrier ∈ M.sets) {mu f : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) + (member : f ∈ M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu) : + f ∈ M.sets ∧ ∃ δ ∈ M.sets, ordinalSetProperty δ ∧ δ ⊆ mu ∧ + ∃ function : FunctionGraphOn δ f, ∃ positions : δ.toSet → {i : L // i ≠ ⊥}, + ∃ D : L, (∀ i, function.value i = s.encode (positions i).val) ∧ + ∀ i, (positions i).val ≤ D := by + obtain ⟨hf, δ, hδ, ordδ, subδ, fn, d, hd, _, bounds⟩ := + M.rowPositionSequence_data hL hmu ordinal member + let function : FunctionGraphOn δ f := ⟨s.nonbottom.carrier, fn⟩ + have range (i : δ.toSet) : function.value i ∈ s.nonbottom.carrier := + (ZFSet.pair_mem_prod.1 (fn.1 (function.value_entry i))).2 + have each (i : δ.toSet) : ∃ x : {i : L // i ≠ ⊥}, s.encode x.val = function.value i := + (s.nonbottom.mem_carrier (function.value i)).1 (range i) + let positions (i : δ.toSet) : {i : L // i ≠ ⊥} := Classical.choose (each i) + have values (i : δ.toSet) : function.value i = s.encode (positions i).val := + (Classical.choose_spec (each i)).symm + obtain ⟨D, rfl⟩ := (s.mem_carrier d).1 hd + refine ⟨hf, δ, hδ, ordδ, subδ, function, positions, D, values, ?_⟩ + intro i + have bound := bounds i.val (function.value i) (function.value_entry i) + rw [values i] at bound + exact (s.pair_mem_conditionOrder (positions i).val D).1 bound + +variable [Group G] (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem binaryRowTupleTerms_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + ∀ z ∈ rowTupleTerms (SetMembers.raw (⊤ : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S, + ∃ τ : Name c, τ.val = z ∧ HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) τ := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + dsimp only + intro z hz + obtain ⟨f, hf, rfl⟩ := (mem_rowTupleTerms _ _ _ _ _ _ z).1 hz + obtain ⟨_, δ, _, _, subset, function, positions, D, values, bounded⟩ := + M.rowPositionSequence_decode s hL hmu ordinal hf + refine ⟨M.internalRowTupleName s C hL δ positions, ?_, ?_⟩ + · exact (M.internalRowTupleCode_eq s C hL function subset positions values).symm + · exact M.internalRowTupleName_hs a s b C pairing unions powers separation infinite + hL hC hG graph directed δ positions D bounded + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem binaryRowTupleTerms_action {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (SetMembers.raw (⊤ : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S + ∀ (g : G) (τ : Name c), τ.val ∈ T → (act.act c g τ).val ∈ T := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + dsimp only + intro g τ member + obtain ⟨f, hf, equal⟩ := (mem_rowTupleTerms _ _ _ _ _ _ τ.val).1 member + obtain ⟨_, δ, _, _, subset, function, positions, _, values, _⟩ := + M.rowPositionSequence_decode s hL hmu ordinal hf + have original : ZFSet.IsFunc δ s.nonbottom.carrier f := by + refine ⟨?_, function.to_isFunc.2⟩ + intro z hz + obtain ⟨i, hi, y, rfl⟩ := function.shape z hz + have value := (function.value_eq_of_entry ⟨i, hi⟩ hz).symm.trans (values ⟨i, hi⟩) + exact ZFSet.pair_mem_prod.2 ⟨hi, value.symm ▸ s.nonbottom.encode_mem (positions ⟨i, hi⟩)⟩ + let moved := rowPositionSequenceAction a s g mu f + have hmoved := M.rowPositionSequenceAction_mem a s b pairing unions powers separation + hL hG graph hmu ordinal g hf + let movedFunction : FunctionGraphOn δ moved := + ⟨s.nonbottom.carrier, rowPositionSequenceAction_function a s g subset original⟩ + have movedValues (i : δ.toSet) : + movedFunction.value i = s.encode (a.nonbottom.iso g (positions i)).val := by + apply movedFunction.value_eq_of_entry + apply (pair_mem_rowPositionSequenceAction a s g mu f i.val (positions i)).2 + refine ⟨subset i.property, ?_⟩ + rw [← values i] + exact function.value_entry i + have actual : τ = M.internalRowTupleName s C hL δ positions := + Subtype.ext (equal.trans (M.internalRowTupleCode_eq s C hL function subset positions values)) + rw [actual, M.internalRowTupleName_action a s b C pairing unions powers separation infinite + hL hC hG graph] + apply (mem_rowTupleTerms _ _ _ _ _ _ _).2 + exact ⟨moved, hmoved, + (M.internalRowTupleCode_eq s C hL movedFunction subset + (fun i => a.nonbottom.iso g (positions i)) movedValues).symm⟩ + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include collection order +theorem binaryRowTermSetName_exists (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ ∃ τ : Name c, τ.val ∈ M.sets ∧ τ.val = ZFSet.prod T {c.encode ⊤} ∧ + HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) τ ∧ + (∀ g : G, act.act c g τ = τ) ∧ + ∀ (H : Set (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))), ⊤ ∈ H → + ∀ x, x ∈ Name.eval H τ ↔ ∃ σ : Name c, σ.val ∈ T ∧ Name.eval H σ = x := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + have hI := M.nonbottom_carrier_mem s separation hL + have hS : S ∈ M.sets := M.rowPositionSequences_mem pairing unions powers separation hL order hI hmu + have hfamily := M.binaryRowTupleFamily_mem pairing unions powers separation collection infinite hL order hI hC hmu ⊤ + have hT : T ∈ M.sets := M.rowTupleTerms_mem unions separation hS hfamily + have each := M.binaryRowTupleTerms_hs a s b C pairing unions powers separation infinite + hL hC hG graph directed hmu ordinal + have valid (z : ZFSet.{u}) (hz : z ∈ T) : IsName c z := by + obtain ⟨σ, eq, _⟩ := each z hz + exact eq ▸ σ.property + have children (σ : Name c) (hσ : σ.val ∈ T) : + HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) σ := by + obtain ⟨ν, eq, hs⟩ := each σ.val hσ + have same : ν = σ := Subtype.ext eq + exact same ▸ hs + have closed := M.binaryRowTupleTerms_action a s b C pairing unions powers separation infinite + hL hC hG graph hmu ordinal + have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) (M.natSetCode_mem separation infinite 2) + refine ⟨hT, Name.familySet ⊤ T valid, + M.familySet_mem c ⊤ pairing unions powers separation hT (M.transitive hQ (c.encode_mem ⊤)) valid, + Name.familySet_code ⊤ T valid, + Name.familySet_hs act (a.principalSupportFamily ⊥ directed) T valid closed children, + Name.act_familySet act T valid closed, ?_⟩ + intro H hone x + exact Name.mem_eval_familySet H ⊤ hone T valid x + +end + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem binaryRowLiftedTermFamilies_hs (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + (∀ τ : Name c.pairEmpty, τ.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) τ) ∧ + (∀ τ : Name c.pairEmpty, + τ.val ∈ orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) τ) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted + have original : ∀ σ : Name c, σ.val ∈ T → + HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) σ := by + intro σ member + obtain ⟨τ, equal, hs⟩ := M.binaryRowTupleTerms_hs a s b C pairing unions powers separation + infinite hL hC hG graph directed hmu ordinal σ.val member + have same : τ = σ := Subtype.ext equal + exact same ▸ hs + have liftedHS := Name.renamedFamily_hs act c.pairEmpty + (a.principalSupportFamily ⊥ directed) T valid original + have liftedValid := Name.renamedFamily_valid c.pairEmpty id T valid + exact ⟨liftedHS, orderedPairNameFamily_hs act (a.principalSupportFamily ⊥ directed) + liftedValid liftedValid liftedHS liftedHS⟩ + +theorem binaryRowTupleCode_action {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + ∀ (g : G) (f : ZFSet.{u}) (τ : Name c), f ∈ S → + τ.val = rowTupleCode (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows f → + rowPositionSequenceAction a s g mu f ∈ S ∧ + (act.act c g τ).val = rowTupleCode (c.encode ⊤) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows (rowPositionSequenceAction a s g mu f) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + dsimp only + intro g f τ hf equal + obtain ⟨_, δ, _, _, subset, function, positions, _, values, _⟩ := + M.rowPositionSequence_decode s hL hmu ordinal hf + have original : ZFSet.IsFunc δ s.nonbottom.carrier f := by + refine ⟨?_, function.to_isFunc.2⟩ + intro z hz + obtain ⟨i, hi, y, rfl⟩ := function.shape z hz + have value := (function.value_eq_of_entry ⟨i, hi⟩ hz).symm.trans (values ⟨i, hi⟩) + exact ZFSet.pair_mem_prod.2 ⟨hi, value.symm ▸ s.nonbottom.encode_mem (positions ⟨i, hi⟩)⟩ + let moved := rowPositionSequenceAction a s g mu f + have hmoved := M.rowPositionSequenceAction_mem a s b pairing unions powers separation + hL hG graph hmu ordinal g hf + let movedFunction : FunctionGraphOn δ moved := + ⟨s.nonbottom.carrier, rowPositionSequenceAction_function a s g subset original⟩ + have movedValues (i : δ.toSet) : + movedFunction.value i = s.encode (a.nonbottom.iso g (positions i)).val := by + apply movedFunction.value_eq_of_entry + apply (pair_mem_rowPositionSequenceAction a s g mu f i.val (positions i)).2 + refine ⟨subset i.property, ?_⟩ + rw [← values i] + exact function.value_entry i + have actual : τ = M.internalRowTupleName s C hL δ positions := + Subtype.ext (equal.trans (M.internalRowTupleCode_eq s C hL function subset positions values)) + refine ⟨hmoved, ?_⟩ + rw [actual, M.internalRowTupleName_action a s b C pairing unions powers separation infinite + hL hC hG graph] + exact (M.internalRowTupleCode_eq s C hL movedFunction subset + (fun i => a.nonbottom.iso g (positions i)) movedValues).symm + +theorem binaryLiftedRowTupleFamily_action {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ (valid : ∀ z ∈ T, IsName c z) (g : G) (f : ZFSet.{u}) (τ : Name c.pairEmpty), + ZFSet.pair f τ.val ∈ liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid → + ZFSet.pair (rowPositionSequenceAction a s g mu f) (act.act c.pairEmpty g τ).val ∈ + liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid g f τ entry + obtain ⟨hf, σ, source, lifted⟩ := (pair_mem_liftedRowTupleFamily c (c.encode ⊤) mu + s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid f τ.val).1 entry + have moved := M.binaryRowTupleCode_action a s b C pairing unions powers separation infinite + hL hC hG graph hmu ordinal g f σ hf source + have same : τ = Name.presentationEquiv c c.pairEmpty σ := Subtype.ext lifted + apply (pair_mem_liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid _ _).2 + refine ⟨moved.1, act.act c g σ, moved.2, ?_⟩ + rw [same, act.act_presentationEquiv] + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTupleEvaluation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTupleEvaluation.lean index 5b7cbe29ccbbe58948559b7456dda711caba00e3..39c7eac2c41f163ffc708066f61936f513b57cfa 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTupleEvaluation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundRowTupleEvaluation.lean @@ -1,93 +1,93 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSelectedSupportTupleFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] -variable (s : Presentation L) (C : ZFSet.{u}) (hL : s.carrier ∈ M.sets) - -theorem internalRowTupleName_eval_function (δ : ZFSet.{u}) - (positions : δ.toSet → {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - ZFSet.IsFunc δ (ZFSet.range (fun i : δ => M.binaryGenericRow s.nonbottom.carrier C H - (s.encode (positions i).val))) - (Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ positions)) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro H - have eq (i : δ.toSet) : Name.eval {p | H.mem p} (M.internalRowName s C hL (positions i)) = - M.binaryGenericRow s.nonbottom.carrier C H (s.encode (positions i).val) := - M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem _ - have result := Name.eval_indexedTuple_function {p | H.mem p} ⊤ H.top_mem δ - (fun i => M.internalRowName s C hL (positions i)) - simpa only [eq, internalRowTupleName] using result - -theorem internalRowTupleName_eval_domain_eq {δ ε : ZFSet.{u}} - (positions : δ.toSet → {i : L // i ≠ ⊥}) (other : ε.toSet → {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ positions) = - Name.eval {p | H.mem p} (M.internalRowTupleName s C hL ε other) → δ = ε := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro H eq - exact Name.eval_indexedTuple_domain_eq {p | H.mem p} ⊤ H.top_mem - (fun i => M.internalRowName s C hL (positions i)) - (fun i => M.internalRowName s C hL (other i)) eq - -theorem internalRowTupleName_eval_eq_iff - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) (hC : C ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) - (δ : ZFSet.{u}) (positions other : δ.toSet → {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) → - (Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ positions) = - Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ other) ↔ positions = other) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro H generic - constructor - · intro eq - have values := (Name.eval_indexedTuple_eq_iff {p | H.mem p} ⊤ H.top_mem δ - (fun i => M.internalRowName s C hL (positions i)) - (fun i => M.internalRowName s C hL (other i))).1 eq - funext i - apply Subtype.ext - apply s.injective - by_contra distinct - have separated := M.binaryGenericRow_ne pairing unions powers separation infinite choice - (M.nonbottom_carrier_mem s separation hL) hC - (s.nonbottom.encode_mem (positions i)) (s.nonbottom.encode_mem (other i)) - distinct uncountable H generic - apply separated - have ev := values i - change Name.eval {p | H.mem p} (M.binaryRowName s.nonbottom.carrier C ⊤ - (s.encode (positions i).val)) = Name.eval {p | H.mem p} - (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode (other i).val)) at ev - simpa only [M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem, - Presentation.nonbottom_encode] using ev - · rintro rfl - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSelectedSupportTupleFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] +variable (s : Presentation L) (C : ZFSet.{u}) (hL : s.carrier ∈ M.sets) + +theorem internalRowTupleName_eval_function (δ : ZFSet.{u}) + (positions : δ.toSet → {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + ZFSet.IsFunc δ (ZFSet.range (fun i : δ => M.binaryGenericRow s.nonbottom.carrier C H + (s.encode (positions i).val))) + (Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ positions)) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro H + have eq (i : δ.toSet) : Name.eval {p | H.mem p} (M.internalRowName s C hL (positions i)) = + M.binaryGenericRow s.nonbottom.carrier C H (s.encode (positions i).val) := + M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem _ + have result := Name.eval_indexedTuple_function {p | H.mem p} ⊤ H.top_mem δ + (fun i => M.internalRowName s C hL (positions i)) + simpa only [eq, internalRowTupleName] using result + +theorem internalRowTupleName_eval_domain_eq {δ ε : ZFSet.{u}} + (positions : δ.toSet → {i : L // i ≠ ⊥}) (other : ε.toSet → {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ positions) = + Name.eval {p | H.mem p} (M.internalRowTupleName s C hL ε other) → δ = ε := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro H eq + exact Name.eval_indexedTuple_domain_eq {p | H.mem p} ⊤ H.top_mem + (fun i => M.internalRowName s C hL (positions i)) + (fun i => M.internalRowName s C hL (other i)) eq + +theorem internalRowTupleName_eval_eq_iff + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) (hC : C ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) + (δ : ZFSet.{u}) (positions other : δ.toSet → {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) → + (Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ positions) = + Name.eval {p | H.mem p} (M.internalRowTupleName s C hL δ other) ↔ positions = other) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro H generic + constructor + · intro eq + have values := (Name.eval_indexedTuple_eq_iff {p | H.mem p} ⊤ H.top_mem δ + (fun i => M.internalRowName s C hL (positions i)) + (fun i => M.internalRowName s C hL (other i))).1 eq + funext i + apply Subtype.ext + apply s.injective + by_contra distinct + have separated := M.binaryGenericRow_ne pairing unions powers separation infinite choice + (M.nonbottom_carrier_mem s separation hL) hC + (s.nonbottom.encode_mem (positions i)) (s.nonbottom.encode_mem (other i)) + distinct uncountable H generic + apply separated + have ev := values i + change Name.eval {p | H.mem p} (M.binaryRowName s.nonbottom.carrier C ⊤ + (s.encode (positions i).val)) = Name.eval {p | H.mem p} + (M.binaryRowName s.nonbottom.carrier C ⊤ (s.encode (other i).val)) at ev + simpa only [M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem, + Presentation.nonbottom_encode] using ev + · rintro rfl + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSelectedOrbitNameFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSelectedOrbitNameFamilies.lean index a1635e9893ec342da29b8b89fd164d9083df8067..6242ca6b183bdfb238878ba37765608aeb74f08a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSelectedOrbitNameFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSelectedOrbitNameFamilies.lean @@ -1,201 +1,201 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableIndexBounds - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -private noncomputable def orbitTopPairsDefinition - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => ZFSet.prod (env 0) {env 1}) := by - let v := GroundSetTerm.var M (n := 2) - let singleton := GroundSetTerm.app (M.definable_singleton pairing) ![v 1] - exact (GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, singleton]).definition - -theorem exists_groundOrbitNameCodeFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (one J : ZFSet.{u}) (hOne : one ∈ M.sets) (hJ : J ∈ M.sets) : - ∃ family ∈ M.sets, FunctionGraphOn J family ∧ - ∀ sigma z, ZFSet.pair sigma z ∈ family ↔ - sigma ∈ J ∧ z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {sigma}) {one} := by - let singleton := (M.definable_singleton pairing).graph Fin.elim0 J - have singletonFunction : FunctionGraphOn J singleton := - (M.definable_singleton pairing).graph_function Fin.elim0 J - have singletonGround : singleton ∈ M.sets := - (M.definable_singleton pairing).graph_mem pairing separation collection Fin.elim0 (fun j => Fin.elim0 j) hJ - let S := functionGraphRange J singleton - have hS : S ∈ M.sets := M.functionGraphRange_mem unions separation hJ singletonGround - let orbits := M.orbitCodeFamily a s S - have orbitFunction : FunctionGraphOn S orbits := M.orbitCodeFamily_function a s S - have orbitGround : orbits ∈ M.sets := - M.orbitCodeFamily_mem a s t pairing unions powers separation collection carrier group maps hS - let O := functionGraphRange S orbits - have hO : O ∈ M.sets := M.functionGraphRange_mem unions separation hS orbitGround - let topPairs := (orbitTopPairsDefinition M pairing unions powers separation).graph (extend one Fin.elim0) O - have topFunction : FunctionGraphOn O topPairs := - (orbitTopPairsDefinition M pairing unions powers separation).graph_function _ O - have topGround : topPairs ∈ M.sets := - (orbitTopPairsDefinition M pairing unions powers separation).graph_mem pairing separation collection - (extend one Fin.elim0) (Fin.cases hOne (fun j => Fin.elim0 j)) hO - let V := functionGraphRange O topPairs - have hV : V ∈ M.sets := M.functionGraphRange_mem unions separation hO topGround - let first := relationCompose J S O singleton orbits - have firstFunction : ZFSet.IsFunc J O first := relationCompose_function_of_subset - (functionGraphRange_function singletonFunction) (functionGraphRange_function orbitFunction) (fun _ h => h) - have firstGround : first ∈ M.sets := M.relationCompose_mem pairing unions powers separation - hJ hS hO singletonGround orbitGround - let family := relationCompose J O V first topPairs - have function : FunctionGraphOn J family := ⟨V, relationCompose_function_of_subset - firstFunction (functionGraphRange_function topFunction) (fun _ h => h)⟩ - have ground : family ∈ M.sets := M.relationCompose_mem pairing unions powers separation - hJ hO hV firstGround topGround - have values (sigma z : ZFSet.{u}) (entry : ZFSet.pair sigma z ∈ family) : - sigma ∈ J ∧ z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {sigma}) {one} := by - obtain ⟨inJ, _, orbit, _, firstEntry, topEntry⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - obtain ⟨_, _, input, _, singletonEntry, orbitEntry⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 firstEntry - have inputValue := ((M.definable_singleton pairing).pair_mem_graph Fin.elim0 J sigma input).1 singletonEntry |>.2 - have topValue := ((orbitTopPairsDefinition M pairing unions powers separation).pair_mem_graph - (extend one Fin.elim0) O orbit z).1 topEntry |>.2 - obtain ⟨W, _, pairEqual⟩ := (M.mem_orbitCodeFamily a s S (ZFSet.pair input orbit)).1 orbitEntry - obtain ⟨rfl, orbitValue⟩ := ZFSet.pair_inj.1 pairEqual - change input = {sigma} at inputValue - change z = ZFSet.prod orbit {one} at topValue - exact ⟨inJ, topValue.trans (congrArg (fun X => ZFSet.prod X {one}) - (orbitValue.trans (congrArg (a.orbitCodes s (M.nameDomain s)) inputValue)))⟩ - refine ⟨family, ground, function, ?_⟩ - intro sigma z - refine ⟨values sigma z, ?_⟩ - rintro ⟨inJ, equal⟩ - obtain ⟨w, entry⟩ := function.total inJ - exact ((values sigma w entry).2.trans equal.symm) ▸ entry - -end TransitiveGround -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -private noncomputable def selectedImageDefinition (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => relationImage (env 0) (env 1) (env 2)) where - formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula - closed := fun _ members => M.relationImage_mem separation (members 0) (members 1) (members 2) - correct := by - intro env members z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_relationImageEqualityFormula] - rfl - -private noncomputable def jointCodeDefinition - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => orderedPairNameCode (env 0) (env 1) (env 2)) where - formula := orderedPairNameCodeFormula 0 2 3 1 - closed := fun _ members => M.orderedPairNameCode_mem pairing (members 0) (members 1) (members 2) - correct := fun _ members _ hz => M.realize_orderedPairNameCodeFormula pairing 0 2 3 1 _ (Fin.cases hz members) - -private noncomputable def selectedJointDefinition - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => - orderedPairNameCode (env 1) (⋃₀ relationImage {env 0} (env 2) (env 3)) (env 0)) := by - let v := GroundSetTerm.var M (n := 4) - let input := GroundSetTerm.app (M.definable_singleton pairing) ![v 0] - let image := GroundSetTerm.app (selectedImageDefinition M separation) ![input, v 2, v 3] - let selected := GroundSetTerm.app (M.definable_sUnion unions) ![image] - exact (GroundSetTerm.app (jointCodeDefinition M pairing) ![v 1, selected, v 0]).definition - -private theorem selectedImage_value {W T choice tau tuple : ZFSet.{u}} - (function : ZFSet.IsFunc W T choice) (entry : ZFSet.pair tau tuple ∈ choice) : - ⋃₀ relationImage {tau} T choice = tuple := by - have single : relationImage {tau} T choice = {tuple} := by - apply ZFSet.ext - intro z - rw [mem_relationImage, ZFSet.mem_singleton] - constructor - · rintro ⟨_, x, hx, edge⟩ - have same := ZFSet.mem_singleton.1 hx - subst x - exact (show FunctionGraphOn W choice from ⟨T, function⟩).unique edge entry - · rintro rfl - exact ⟨(ZFSet.pair_mem_prod.1 (function.1 entry)).2, - tau, ZFSet.mem_singleton.2 rfl, entry⟩ - rw [single] - apply ZFSet.ext - intro z - rw [ZFSet.mem_sUnion] - constructor - · rintro ⟨X, hX, member⟩ - exact (ZFSet.mem_singleton.1 hX) ▸ member - · intro member - exact ⟨tuple, ZFSet.mem_singleton.2 rfl, member⟩ - -theorem exists_groundSelectedOrbitNameFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (one W T choice : ZFSet.{u}) (hOne : one ∈ M.sets) (hW : W ∈ M.sets) - (hT : T ∈ M.sets) (hChoice : choice ∈ M.sets) (function : ZFSet.IsFunc W T choice) : - ∃ family ∈ M.sets, FunctionGraphOn W family ∧ - ∀ tau tuple, ZFSet.pair tau tuple ∈ choice → ∀ z, - ZFSet.pair tau z ∈ family ↔ - z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {orderedPairNameCode one tuple tau}) {one} := by - let params := extend one (extend T (extend choice Fin.elim0)) - let joints := (selectedJointDefinition M pairing unions separation).graph params W - have jointGround : joints ∈ M.sets := - (selectedJointDefinition M pairing unions separation).graph_mem pairing separation collection params - (Fin.cases hOne (Fin.cases hT (Fin.cases hChoice (fun j => Fin.elim0 j)))) hW - have jointFunction : FunctionGraphOn W joints := - (selectedJointDefinition M pairing unions separation).graph_function params W - let J := functionGraphRange W joints - have hJ : J ∈ M.sets := M.functionGraphRange_mem unions separation hW jointGround - obtain ⟨orbits, hOrbits, orbitFunction, orbitValues⟩ := M.exists_groundOrbitNameCodeFamily - a s t pairing unions powers separation collection carrier group maps one J hOne hJ - let O := functionGraphRange J orbits - have hO : O ∈ M.sets := M.functionGraphRange_mem unions separation hJ hOrbits - let family := relationCompose W J O joints orbits - have familyGround : family ∈ M.sets := M.relationCompose_mem pairing unions powers separation - hW hJ hO jointGround hOrbits - have familyFunction : FunctionGraphOn W family := ⟨O, relationCompose_function_of_subset - (functionGraphRange_function jointFunction) (functionGraphRange_function orbitFunction) (fun _ h => h)⟩ - have values (tau tuple : ZFSet.{u}) (selected : ZFSet.pair tau tuple ∈ choice) - (z : ZFSet.{u}) (entry : ZFSet.pair tau z ∈ family) : - z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {orderedPairNameCode one tuple tau}) {one} := by - obtain ⟨_, _, joint, _, jointEntry, orbitEntry⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - have jointValue := ((selectedJointDefinition M pairing unions separation).pair_mem_graph params W tau joint).1 jointEntry |>.2 - change joint = orderedPairNameCode one (⋃₀ relationImage {tau} T choice) tau at jointValue - rw [selectedImage_value function selected] at jointValue - exact ((orbitValues joint z).1 orbitEntry).2.trans - (congrArg (fun x => ZFSet.prod (a.orbitCodes s (M.nameDomain s) {x}) {one}) jointValue) - refine ⟨family, familyGround, familyFunction, ?_⟩ - intro tau tuple selected z - refine ⟨values tau tuple selected z, ?_⟩ - intro equal - obtain ⟨w, entry⟩ := familyFunction.total (ZFSet.pair_mem_prod.1 (function.1 selected)).1 - exact ((values tau tuple selected w entry).trans equal.symm) ▸ entry - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableIndexBounds + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +private noncomputable def orbitTopPairsDefinition + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => ZFSet.prod (env 0) {env 1}) := by + let v := GroundSetTerm.var M (n := 2) + let singleton := GroundSetTerm.app (M.definable_singleton pairing) ![v 1] + exact (GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, singleton]).definition + +theorem exists_groundOrbitNameCodeFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (one J : ZFSet.{u}) (hOne : one ∈ M.sets) (hJ : J ∈ M.sets) : + ∃ family ∈ M.sets, FunctionGraphOn J family ∧ + ∀ sigma z, ZFSet.pair sigma z ∈ family ↔ + sigma ∈ J ∧ z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {sigma}) {one} := by + let singleton := (M.definable_singleton pairing).graph Fin.elim0 J + have singletonFunction : FunctionGraphOn J singleton := + (M.definable_singleton pairing).graph_function Fin.elim0 J + have singletonGround : singleton ∈ M.sets := + (M.definable_singleton pairing).graph_mem pairing separation collection Fin.elim0 (fun j => Fin.elim0 j) hJ + let S := functionGraphRange J singleton + have hS : S ∈ M.sets := M.functionGraphRange_mem unions separation hJ singletonGround + let orbits := M.orbitCodeFamily a s S + have orbitFunction : FunctionGraphOn S orbits := M.orbitCodeFamily_function a s S + have orbitGround : orbits ∈ M.sets := + M.orbitCodeFamily_mem a s t pairing unions powers separation collection carrier group maps hS + let O := functionGraphRange S orbits + have hO : O ∈ M.sets := M.functionGraphRange_mem unions separation hS orbitGround + let topPairs := (orbitTopPairsDefinition M pairing unions powers separation).graph (extend one Fin.elim0) O + have topFunction : FunctionGraphOn O topPairs := + (orbitTopPairsDefinition M pairing unions powers separation).graph_function _ O + have topGround : topPairs ∈ M.sets := + (orbitTopPairsDefinition M pairing unions powers separation).graph_mem pairing separation collection + (extend one Fin.elim0) (Fin.cases hOne (fun j => Fin.elim0 j)) hO + let V := functionGraphRange O topPairs + have hV : V ∈ M.sets := M.functionGraphRange_mem unions separation hO topGround + let first := relationCompose J S O singleton orbits + have firstFunction : ZFSet.IsFunc J O first := relationCompose_function_of_subset + (functionGraphRange_function singletonFunction) (functionGraphRange_function orbitFunction) (fun _ h => h) + have firstGround : first ∈ M.sets := M.relationCompose_mem pairing unions powers separation + hJ hS hO singletonGround orbitGround + let family := relationCompose J O V first topPairs + have function : FunctionGraphOn J family := ⟨V, relationCompose_function_of_subset + firstFunction (functionGraphRange_function topFunction) (fun _ h => h)⟩ + have ground : family ∈ M.sets := M.relationCompose_mem pairing unions powers separation + hJ hO hV firstGround topGround + have values (sigma z : ZFSet.{u}) (entry : ZFSet.pair sigma z ∈ family) : + sigma ∈ J ∧ z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {sigma}) {one} := by + obtain ⟨inJ, _, orbit, _, firstEntry, topEntry⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + obtain ⟨_, _, input, _, singletonEntry, orbitEntry⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 firstEntry + have inputValue := ((M.definable_singleton pairing).pair_mem_graph Fin.elim0 J sigma input).1 singletonEntry |>.2 + have topValue := ((orbitTopPairsDefinition M pairing unions powers separation).pair_mem_graph + (extend one Fin.elim0) O orbit z).1 topEntry |>.2 + obtain ⟨W, _, pairEqual⟩ := (M.mem_orbitCodeFamily a s S (ZFSet.pair input orbit)).1 orbitEntry + obtain ⟨rfl, orbitValue⟩ := ZFSet.pair_inj.1 pairEqual + change input = {sigma} at inputValue + change z = ZFSet.prod orbit {one} at topValue + exact ⟨inJ, topValue.trans (congrArg (fun X => ZFSet.prod X {one}) + (orbitValue.trans (congrArg (a.orbitCodes s (M.nameDomain s)) inputValue)))⟩ + refine ⟨family, ground, function, ?_⟩ + intro sigma z + refine ⟨values sigma z, ?_⟩ + rintro ⟨inJ, equal⟩ + obtain ⟨w, entry⟩ := function.total inJ + exact ((values sigma w entry).2.trans equal.symm) ▸ entry + +end TransitiveGround +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +private noncomputable def selectedImageDefinition (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => relationImage (env 0) (env 1) (env 2)) where + formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula + closed := fun _ members => M.relationImage_mem separation (members 0) (members 1) (members 2) + correct := by + intro env members z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_relationImageEqualityFormula] + rfl + +private noncomputable def jointCodeDefinition + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => orderedPairNameCode (env 0) (env 1) (env 2)) where + formula := orderedPairNameCodeFormula 0 2 3 1 + closed := fun _ members => M.orderedPairNameCode_mem pairing (members 0) (members 1) (members 2) + correct := fun _ members _ hz => M.realize_orderedPairNameCodeFormula pairing 0 2 3 1 _ (Fin.cases hz members) + +private noncomputable def selectedJointDefinition + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => + orderedPairNameCode (env 1) (⋃₀ relationImage {env 0} (env 2) (env 3)) (env 0)) := by + let v := GroundSetTerm.var M (n := 4) + let input := GroundSetTerm.app (M.definable_singleton pairing) ![v 0] + let image := GroundSetTerm.app (selectedImageDefinition M separation) ![input, v 2, v 3] + let selected := GroundSetTerm.app (M.definable_sUnion unions) ![image] + exact (GroundSetTerm.app (jointCodeDefinition M pairing) ![v 1, selected, v 0]).definition + +private theorem selectedImage_value {W T choice tau tuple : ZFSet.{u}} + (function : ZFSet.IsFunc W T choice) (entry : ZFSet.pair tau tuple ∈ choice) : + ⋃₀ relationImage {tau} T choice = tuple := by + have single : relationImage {tau} T choice = {tuple} := by + apply ZFSet.ext + intro z + rw [mem_relationImage, ZFSet.mem_singleton] + constructor + · rintro ⟨_, x, hx, edge⟩ + have same := ZFSet.mem_singleton.1 hx + subst x + exact (show FunctionGraphOn W choice from ⟨T, function⟩).unique edge entry + · rintro rfl + exact ⟨(ZFSet.pair_mem_prod.1 (function.1 entry)).2, + tau, ZFSet.mem_singleton.2 rfl, entry⟩ + rw [single] + apply ZFSet.ext + intro z + rw [ZFSet.mem_sUnion] + constructor + · rintro ⟨X, hX, member⟩ + exact (ZFSet.mem_singleton.1 hX) ▸ member + · intro member + exact ⟨tuple, ZFSet.mem_singleton.2 rfl, member⟩ + +theorem exists_groundSelectedOrbitNameFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (one W T choice : ZFSet.{u}) (hOne : one ∈ M.sets) (hW : W ∈ M.sets) + (hT : T ∈ M.sets) (hChoice : choice ∈ M.sets) (function : ZFSet.IsFunc W T choice) : + ∃ family ∈ M.sets, FunctionGraphOn W family ∧ + ∀ tau tuple, ZFSet.pair tau tuple ∈ choice → ∀ z, + ZFSet.pair tau z ∈ family ↔ + z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {orderedPairNameCode one tuple tau}) {one} := by + let params := extend one (extend T (extend choice Fin.elim0)) + let joints := (selectedJointDefinition M pairing unions separation).graph params W + have jointGround : joints ∈ M.sets := + (selectedJointDefinition M pairing unions separation).graph_mem pairing separation collection params + (Fin.cases hOne (Fin.cases hT (Fin.cases hChoice (fun j => Fin.elim0 j)))) hW + have jointFunction : FunctionGraphOn W joints := + (selectedJointDefinition M pairing unions separation).graph_function params W + let J := functionGraphRange W joints + have hJ : J ∈ M.sets := M.functionGraphRange_mem unions separation hW jointGround + obtain ⟨orbits, hOrbits, orbitFunction, orbitValues⟩ := M.exists_groundOrbitNameCodeFamily + a s t pairing unions powers separation collection carrier group maps one J hOne hJ + let O := functionGraphRange J orbits + have hO : O ∈ M.sets := M.functionGraphRange_mem unions separation hJ hOrbits + let family := relationCompose W J O joints orbits + have familyGround : family ∈ M.sets := M.relationCompose_mem pairing unions powers separation + hW hJ hO jointGround hOrbits + have familyFunction : FunctionGraphOn W family := ⟨O, relationCompose_function_of_subset + (functionGraphRange_function jointFunction) (functionGraphRange_function orbitFunction) (fun _ h => h)⟩ + have values (tau tuple : ZFSet.{u}) (selected : ZFSet.pair tau tuple ∈ choice) + (z : ZFSet.{u}) (entry : ZFSet.pair tau z ∈ family) : + z = ZFSet.prod (a.orbitCodes s (M.nameDomain s) {orderedPairNameCode one tuple tau}) {one} := by + obtain ⟨_, _, joint, _, jointEntry, orbitEntry⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + have jointValue := ((selectedJointDefinition M pairing unions separation).pair_mem_graph params W tau joint).1 jointEntry |>.2 + change joint = orderedPairNameCode one (⋃₀ relationImage {tau} T choice) tau at jointValue + rw [selectedImage_value function selected] at jointValue + exact ((orbitValues joint z).1 orbitEntry).2.trans + (congrArg (fun x => ZFSet.prod (a.orbitCodes s (M.nameDomain s) {x}) {one}) jointValue) + refine ⟨family, familyGround, familyFunction, ?_⟩ + intro tau tuple selected z + refine ⟨values tau tuple selected z, ?_⟩ + intro equal + obtain ⟨w, entry⟩ := familyFunction.total (ZFSet.pair_mem_prod.1 (function.1 selected)).1 + exact ((values tau tuple selected w entry).trans equal.symm) ▸ entry + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSeparatedRowConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSeparatedRowConditions.lean index 9d726561e9c71de359ac8a62bcadb1545f85bc44..cf035c3dcf33fe4e8e8e8a701606aaa6bf32a677 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSeparatedRowConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSeparatedRowConditions.lean @@ -1,95 +1,95 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundOutsideRowNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.PosetAction - -universe u -variable {G L : Type u} [Group G] [PartialOrder L] - -theorem moved_ne_of_separated (a : PosetAction G L) (g : G) (B D i : L) - (overlap : ∀ x, x ≤ D → x ≤ a.iso g D → x ≤ B) - (inside : i ≤ D) (outside : ¬ i ≤ B) : a.iso g i ≠ i := by - intro fixed - have moved := (a.iso g).monotone inside - rw [fixed] at moved - exact outside (overlap i inside moved) - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem internalRowAction_agree_of_separated - (g : G) (B D : L) - (fixed : g ∈ a.principalFix B) - (overlap : ∀ x, x ≤ D → x ≤ a.iso g D → x ≤ B) - (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)) - (bound : ∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - ∀ x y z, ZFSet.pair x y ∈ SetMembers.raw p → - ZFSet.pair x z ∈ SetMembers.raw (act.iso g p) → y = z := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act x y z left right - have code := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega p).2.1 - have transported := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega (act.iso g p)).2.1 - have coords := (ZFSet.pair_mem_prod.1 (code.shape left)).1 - have hz := (ZFSet.pair_mem_prod.1 (transported.shape right)).2 - obtain ⟨j, hj, c, hc, rfl⟩ := ZFSet.mem_prod.1 coords - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier j).1 hj - have inside := bound i (row_mem_rowUsedRows code left) - have movedInside := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation - infinite hL hC hG graph g p D bound i (row_mem_rowUsedRows transported right) - have pointFixed := fixed i.val (overlap i.val inside movedInside) - have sameEntry : ZFSet.pair (ZFSet.pair (s.encode i.val) c) z ∈ SetMembers.raw p := by - apply (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p i c z hc hz).1 - rw [pointFixed] - exact right - exact code.unique _ y z left sameEntry - -theorem internalRowAction_common_extension_of_separated - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (g : G) (B D : L) - (fixed : g ∈ a.principalFix B) - (overlap : ∀ x, x ≤ D → x ≤ a.iso g D → x ≤ B) - (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)) - (bound : ∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - ∃ r : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega), - SetMembers.raw r = SetMembers.raw p ∪ SetMembers.raw (act.iso g p) ∧ - r ≤ p ∧ r ≤ act.iso g p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act - exact M.countableFunction_common_extension pairing unions powers separation infinite choice - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) p (act.iso g p) - (M.internalRowAction_agree_of_separated a s b C pairing unions powers separation infinite - hL hC hG graph g B D fixed overlap p bound) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundOutsideRowNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.PosetAction + +universe u +variable {G L : Type u} [Group G] [PartialOrder L] + +theorem moved_ne_of_separated (a : PosetAction G L) (g : G) (B D i : L) + (overlap : ∀ x, x ≤ D → x ≤ a.iso g D → x ≤ B) + (inside : i ≤ D) (outside : ¬ i ≤ B) : a.iso g i ≠ i := by + intro fixed + have moved := (a.iso g).monotone inside + rw [fixed] at moved + exact outside (overlap i inside moved) + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem internalRowAction_agree_of_separated + (g : G) (B D : L) + (fixed : g ∈ a.principalFix B) + (overlap : ∀ x, x ≤ D → x ≤ a.iso g D → x ≤ B) + (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)) + (bound : ∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + ∀ x y z, ZFSet.pair x y ∈ SetMembers.raw p → + ZFSet.pair x z ∈ SetMembers.raw (act.iso g p) → y = z := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act x y z left right + have code := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega p).2.1 + have transported := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega (act.iso g p)).2.1 + have coords := (ZFSet.pair_mem_prod.1 (code.shape left)).1 + have hz := (ZFSet.pair_mem_prod.1 (transported.shape right)).2 + obtain ⟨j, hj, c, hc, rfl⟩ := ZFSet.mem_prod.1 coords + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier j).1 hj + have inside := bound i (row_mem_rowUsedRows code left) + have movedInside := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation + infinite hL hC hG graph g p D bound i (row_mem_rowUsedRows transported right) + have pointFixed := fixed i.val (overlap i.val inside movedInside) + have sameEntry : ZFSet.pair (ZFSet.pair (s.encode i.val) c) z ∈ SetMembers.raw p := by + apply (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p i c z hc hz).1 + rw [pointFixed] + exact right + exact code.unique _ y z left sameEntry + +theorem internalRowAction_common_extension_of_separated + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (g : G) (B D : L) + (fixed : g ∈ a.principalFix B) + (overlap : ∀ x, x ≤ D → x ≤ a.iso g D → x ≤ B) + (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)) + (bound : ∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + ∃ r : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega), + SetMembers.raw r = SetMembers.raw p ∪ SetMembers.raw (act.iso g p) ∧ + r ≤ p ∧ r ≤ act.iso g p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act + exact M.countableFunction_common_extension pairing unions powers separation infinite choice + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) p (act.iso g p) + (M.internalRowAction_agree_of_separated a s b C pairing unions powers separation infinite + hL hC hG graph g B D fixed overlap p bound) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSharedConditionalNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSharedConditionalNames.lean index 25e7983a66b7c0fae92a53d6045fa7fbc41b861a..9c99d827343c7ae96a35d4eb2ff46a092e538352 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSharedConditionalNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSharedConditionalNames.lean @@ -1,294 +1,294 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization -import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementValidityReindex - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetRealization SetFormula -universe u - -namespace SetFormula - -def sharedConditionFormula {n : Nat} (phi : SetFormula n) (i : Fin n) : - SetFormula (n + 1) := - .conj (reindex Fin.succ phi) (.mem 0 i.succ) - -theorem realize_sharedConditionFormula (U : Set ZFSet.{u}) {n : Nat} - (phi : SetFormula n) (i : Fin n) (env : Fin n → ZFSet.{u}) (x : ZFSet.{u}) : - Realize U (sharedConditionFormula phi i) (extend x env) ↔ - Realize U phi env ∧ x ∈ env i := by - change (Realize U (reindex Fin.succ phi) (extend x env) ∧ x ∈ env i) ↔ _ - rw [realize_reindex] - rfl - -end SetFormula - -namespace Name -variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} - -noncomputable def sharedConditionName (D : NameDomain s) {n : Nat} - (phi : SetFormula n) (env : Assignment D n) (i : Fin n) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Name s := - separationName D (sharedConditionFormula phi i) env (familySet ⊤ T valid) - -theorem entry_sharedConditionName (D : NameDomain s) {n : Nat} - (phi : SetFormula n) (env : Assignment D n) (i : Fin n) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (sigma : Name s) (p : P) : - Entry sigma (sharedConditionName D phi env i T valid) p ↔ - sigma.val ∈ T ∧ ∃ h : sigma ∈ D.names, - Forces D (sharedConditionFormula phi i) (extend ⟨sigma, h⟩ env) p := by - rw [sharedConditionName, entry_separationName] - constructor - · rintro ⟨r, entry, _, forced⟩ - exact ⟨((entry_familySet ⊤ T valid sigma r).1 entry).1, forced⟩ - · rintro ⟨member, forced⟩ - exact ⟨⊤, (entry_familySet ⊤ T valid sigma ⊤).2 ⟨member, rfl⟩, le_top, forced⟩ - -theorem sharedConditionName_subset (D : NameDomain s) {n : Nat} - (phi : SetFormula n) (env : Assignment D n) (i : Fin n) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : - (sharedConditionName D phi env i T valid).val ⊆ ZFSet.prod T s.carrier := by - intro z member - obtain ⟨sigma, p, rfl⟩ := entries_cover (sharedConditionName D phi env i T valid) member - exact ZFSet.pair_mem_prod.2 - ⟨((entry_sharedConditionName D phi env i T valid sigma p).1 member).1, s.encode_mem p⟩ - -end Name -end - -namespace Name -open SetRealization SetFormula -universe u -variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} - -theorem eval_sharedConditionName (D : NameDomain s) {n : Nat} - (phi : SetFormula n) (env : Assignment D n) (i : Fin n) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) : - eval {p | H.mem p} (sharedConditionName D phi env i T valid) = - ZFSet.sep (fun x => Realize (D.values {p | H.mem p}) phi - (evalAssignment {p | H.mem p} env) ∧ x ∈ eval {p | H.mem p} (env i).val) - (eval {p | H.mem p} (familySet ⊤ T valid)) := by - rw [sharedConditionName, eval_separationName D H generic - (sharedConditionFormula phi i) env family] - apply ZFSet.ext - intro x - simp only [ZFSet.mem_sep, realize_sharedConditionFormula] - rfl - -theorem eval_sharedConditionName_of_true (D : NameDomain s) {n : Nat} - (phi : SetFormula n) (env : Assignment D n) (i : Fin n) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) - (truth : Realize (D.values {p | H.mem p}) phi - (evalAssignment {p | H.mem p} env)) : - eval {p | H.mem p} (sharedConditionName D phi env i T valid) = - eval {p | H.mem p} (env i).val ∩ eval {p | H.mem p} (familySet ⊤ T valid) := by - rw [eval_sharedConditionName D phi env i T valid family H generic] - apply ZFSet.ext - intro x - simp only [ZFSet.mem_sep, ZFSet.mem_inter, truth, true_and] - exact and_comm - -theorem eval_sharedConditionName_of_subset (D : NameDomain s) {n : Nat} - (phi : SetFormula n) (env : Assignment D n) (i : Fin n) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) - (truth : Realize (D.values {p | H.mem p}) phi - (evalAssignment {p | H.mem p} env)) - (subset : eval {p | H.mem p} (env i).val ⊆ - eval {p | H.mem p} (familySet ⊤ T valid)) : - eval {p | H.mem p} (sharedConditionName D phi env i T valid) = - eval {p | H.mem p} (env i).val := by - rw [eval_sharedConditionName_of_true D phi env i T valid family H generic truth] - apply ZFSet.ext - intro x - exact ⟨fun member => (ZFSet.mem_inter.1 member).1, - fun member => ZFSet.mem_inter.2 ⟨member, subset member⟩⟩ - -theorem eval_sharedConditionName_of_false (D : NameDomain s) {n : Nat} - (phi : SetFormula n) (env : Assignment D n) (i : Fin n) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) - (falsehood : ¬ Realize (D.values {p | H.mem p}) phi - (evalAssignment {p | H.mem p} env)) : - eval {p | H.mem p} (sharedConditionName D phi env i T valid) = ∅ := by - rw [eval_sharedConditionName D phi env i T valid family H generic] - apply ZFSet.ext - intro x - simp [falsehood] - -end Name - -namespace Name -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} -variable {G : Type v} [Group G] (a : PosetAction G P) -variable (D : NameDomain s) -variable (closed : ∀ g sigma, sigma ∈ D.names → a.act s g sigma ∈ D.names) -variable {n : Nat} (phi : SetFormula n) (env : Assignment D n) (i : Fin n) -variable (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) -variable (terms : ∀ g (sigma : Name s), sigma.val ∈ J → (a.act s g sigma).val ∈ J) -include closed terms - -theorem sharedConditionName_act (g : G) : - a.act s g (sharedConditionName D phi env i J valid) = - sharedConditionName D phi (a.actAssignment s D closed g env) i J valid := by - unfold sharedConditionName - rw [a.act_separationName s D closed, act_familySet a J valid terms] - -theorem sharedConditionName_nice (K : Subgroup G) - (fixed : ∀ j, K ≤ a.stabilizer s (env j).val) : - NiceNameCode a s J K (sharedConditionName D phi env i J valid).val := by - apply (niceNameCode_iff a s _).2 - refine ⟨sharedConditionName_subset D phi env i J valid, ?_⟩ - intro g hg - change a.act s g (sharedConditionName D phi env i J valid) = _ - rw [sharedConditionName_act a D closed phi env i J valid terms] - have equal : a.actAssignment s D closed g env = env := by - funext j - apply Subtype.ext - exact fixed j hg - rw [equal] - -theorem sharedConditionName_hs (K : Subgroup G) - (fixed : ∀ j, K ≤ a.stabilizer s (env j).val) - (F : NormalSubgroupFamily G) (member : F.mem K) - (children : ∀ sigma : Name s, sigma.val ∈ J → HereditarilySymmetric a s F sigma) : - HereditarilySymmetric a s F (sharedConditionName D phi env i J valid) := - niceNameCode_hs a s F member children - (sharedConditionName_nice a D closed phi env i J valid terms K fixed) - -end Name - -namespace TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -include pairing unions powers separation collection carrier order - -theorem sharedConditionName_mem {n : Nat} (phi : SetFormula n) - (env : Assignment (M.nameDomain s) n) (i : Fin n) - {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName s z) : - (Name.sharedConditionName (M.nameDomain s) phi env i J valid).val ∈ M.sets := by - have family := M.familySet_mem s ⊤ pairing unions powers separation hJ - (M.transitive carrier (s.encode_mem ⊤)) valid - exact M.ordinarySeparationName_mem s pairing unions powers separation collection carrier order - (sharedConditionFormula phi i) env ⟨Name.familySet ⊤ J valid, family⟩ - -theorem sharedConditionName_spec {G : Type u} [Group G] - (a : PosetAction G P) (t : Presentation G) - (maps : a.conditionMapFamily s t ∈ M.sets) - {n : Nat} (phi : SetFormula n) (env : Assignment (M.nameDomain s) n) (i : Fin n) - {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName s z) - (terms : ∀ g (sigma : Name s), sigma.val ∈ J → (a.act s g sigma).val ∈ J) - (K : Subgroup G) (fixed : ∀ j, K ≤ a.stabilizer s (env j).val) - (F : NormalSubgroupFamily G) (member : F.mem K) - (children : ∀ sigma : Name s, sigma.val ∈ J → HereditarilySymmetric a s F sigma) : - (Name.sharedConditionName (M.nameDomain s) phi env i J valid).val ∈ M.sets ∧ - NiceNameCode a s J K (Name.sharedConditionName (M.nameDomain s) phi env i J valid).val ∧ - HereditarilySymmetric a s F (Name.sharedConditionName (M.nameDomain s) phi env i J valid) := by - have closed : ∀ g sigma, sigma ∈ (M.nameDomain s).names → - a.act s g sigma ∈ (M.nameDomain s).names := - fun g sigma h => M.act_mem s a t pairing unions powers separation collection carrier maps g sigma h - exact ⟨M.sharedConditionName_mem s pairing unions powers separation collection carrier order phi env i hJ valid, - Name.sharedConditionName_nice a (M.nameDomain s) closed phi env i J valid terms K fixed, - Name.sharedConditionName_hs a (M.nameDomain s) closed phi env i J valid terms K fixed F member children⟩ - -end TransitiveGround - -namespace Name -open SetRealization SetFormula -universe u -variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} - -noncomputable def refinementConditionNames (D : NameDomain s) - (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) - (valid : ∀ i, ∀ z ∈ T i, IsName s z) : Fin 3 → Name s := - fun i => sharedConditionName D BoundedFormula.refinementValidityFormula.toFormula - env i.castSucc (T i) (valid i) - -theorem eval_refinementConditionNames_coherent (D : NameDomain s) - (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) - (valid : ∀ i, ∀ z ∈ T i, IsName s z) - (family : ∀ i, familySet ⊤ (T i) (valid i) ∈ D.names) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) - (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (T i) s.carrier) : - (Realize (D.values {p | H.mem p}) BoundedFormula.refinementValidityFormula.toFormula - (evalAssignment {p | H.mem p} env) ∧ - ∀ i : Fin 3, eval {p | H.mem p} (refinementConditionNames D env T valid i) = - eval {p | H.mem p} (env i.castSucc).val) ∨ - (¬ Realize (D.values {p | H.mem p}) BoundedFormula.refinementValidityFormula.toFormula - (evalAssignment {p | H.mem p} env) ∧ - ∀ i : Fin 3, eval {p | H.mem p} (refinementConditionNames D env T valid i) = ∅) := by - classical - by_cases truth : Realize (D.values {p | H.mem p}) - BoundedFormula.refinementValidityFormula.toFormula (evalAssignment {p | H.mem p} env) - · refine Or.inl ⟨truth, ?_⟩ - intro i - exact eval_sharedConditionName_of_subset D BoundedFormula.refinementValidityFormula.toFormula - env i.castSucc (T i) (valid i) (family i) H generic truth - (eval_subset_familySet_of_code_subset H (T i) (valid i) (env i.castSucc).val (shape i)) - · refine Or.inr ⟨truth, ?_⟩ - intro i - exact eval_sharedConditionName_of_false D BoundedFormula.refinementValidityFormula.toFormula - env i.castSucc (T i) (valid i) (family i) H generic truth - -theorem eval_refinementConditionNames_valid (D : NameDomain s) - (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) - (valid : ∀ i, ∀ z ∈ T i, IsName s z) - (family : ∀ i, familySet ⊤ (T i) (valid i) ∈ D.names) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) - (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (T i) s.carrier) : - RefinementValidityCode (eval {p | H.mem p} (env 3).val) - (eval {p | H.mem p} (refinementConditionNames D env T valid 0)) - (eval {p | H.mem p} (refinementConditionNames D env T valid 1)) - (eval {p | H.mem p} (refinementConditionNames D env T valid 2)) := by - let evaluated : TransitiveGround.{u} := - ⟨D.values {p | H.mem p}, D.values_transitive {p | H.mem p}⟩ - rcases eval_refinementConditionNames_coherent D env T valid family H generic shape with - ⟨truth, equal⟩ | ⟨_, equal⟩ - · rw [equal 0, equal 1, equal 2] - exact (evaluated.realize_refinementValidityFormula - (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩)).1 truth - · rw [equal 0, equal 1, equal 2] - exact refinementValidity_empty _ - -theorem eval_refinementConditionNames_of_valid (D : NameDomain s) - (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) - (valid : ∀ i, ∀ z ∈ T i, IsName s z) - (family : ∀ i, familySet ⊤ (T i) (valid i) ∈ D.names) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) - (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (T i) s.carrier) - (oldValid : RefinementValidityCode (eval {p | H.mem p} (env 3).val) - (eval {p | H.mem p} (env 0).val) (eval {p | H.mem p} (env 1).val) - (eval {p | H.mem p} (env 2).val)) : - ∀ i : Fin 3, eval {p | H.mem p} (refinementConditionNames D env T valid i) = - eval {p | H.mem p} (env i.castSucc).val := by - let evaluated : TransitiveGround.{u} := - ⟨D.values {p | H.mem p}, D.values_transitive {p | H.mem p}⟩ - have truth := (evaluated.realize_refinementValidityFormula - (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩)).2 oldValid - intro i - exact eval_sharedConditionName_of_subset D BoundedFormula.refinementValidityFormula.toFormula - env i.castSucc (T i) (valid i) (family i) H generic truth - (eval_subset_familySet_of_code_subset H (T i) (valid i) (env i.castSucc).val (shape i)) - -end Name - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization +import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementValidityReindex + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetRealization SetFormula +universe u + +namespace SetFormula + +def sharedConditionFormula {n : Nat} (phi : SetFormula n) (i : Fin n) : + SetFormula (n + 1) := + .conj (reindex Fin.succ phi) (.mem 0 i.succ) + +theorem realize_sharedConditionFormula (U : Set ZFSet.{u}) {n : Nat} + (phi : SetFormula n) (i : Fin n) (env : Fin n → ZFSet.{u}) (x : ZFSet.{u}) : + Realize U (sharedConditionFormula phi i) (extend x env) ↔ + Realize U phi env ∧ x ∈ env i := by + change (Realize U (reindex Fin.succ phi) (extend x env) ∧ x ∈ env i) ↔ _ + rw [realize_reindex] + rfl + +end SetFormula + +namespace Name +variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} + +noncomputable def sharedConditionName (D : NameDomain s) {n : Nat} + (phi : SetFormula n) (env : Assignment D n) (i : Fin n) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Name s := + separationName D (sharedConditionFormula phi i) env (familySet ⊤ T valid) + +theorem entry_sharedConditionName (D : NameDomain s) {n : Nat} + (phi : SetFormula n) (env : Assignment D n) (i : Fin n) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (sigma : Name s) (p : P) : + Entry sigma (sharedConditionName D phi env i T valid) p ↔ + sigma.val ∈ T ∧ ∃ h : sigma ∈ D.names, + Forces D (sharedConditionFormula phi i) (extend ⟨sigma, h⟩ env) p := by + rw [sharedConditionName, entry_separationName] + constructor + · rintro ⟨r, entry, _, forced⟩ + exact ⟨((entry_familySet ⊤ T valid sigma r).1 entry).1, forced⟩ + · rintro ⟨member, forced⟩ + exact ⟨⊤, (entry_familySet ⊤ T valid sigma ⊤).2 ⟨member, rfl⟩, le_top, forced⟩ + +theorem sharedConditionName_subset (D : NameDomain s) {n : Nat} + (phi : SetFormula n) (env : Assignment D n) (i : Fin n) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : + (sharedConditionName D phi env i T valid).val ⊆ ZFSet.prod T s.carrier := by + intro z member + obtain ⟨sigma, p, rfl⟩ := entries_cover (sharedConditionName D phi env i T valid) member + exact ZFSet.pair_mem_prod.2 + ⟨((entry_sharedConditionName D phi env i T valid sigma p).1 member).1, s.encode_mem p⟩ + +end Name +end + +namespace Name +open SetRealization SetFormula +universe u +variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} + +theorem eval_sharedConditionName (D : NameDomain s) {n : Nat} + (phi : SetFormula n) (env : Assignment D n) (i : Fin n) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) : + eval {p | H.mem p} (sharedConditionName D phi env i T valid) = + ZFSet.sep (fun x => Realize (D.values {p | H.mem p}) phi + (evalAssignment {p | H.mem p} env) ∧ x ∈ eval {p | H.mem p} (env i).val) + (eval {p | H.mem p} (familySet ⊤ T valid)) := by + rw [sharedConditionName, eval_separationName D H generic + (sharedConditionFormula phi i) env family] + apply ZFSet.ext + intro x + simp only [ZFSet.mem_sep, realize_sharedConditionFormula] + rfl + +theorem eval_sharedConditionName_of_true (D : NameDomain s) {n : Nat} + (phi : SetFormula n) (env : Assignment D n) (i : Fin n) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) + (truth : Realize (D.values {p | H.mem p}) phi + (evalAssignment {p | H.mem p} env)) : + eval {p | H.mem p} (sharedConditionName D phi env i T valid) = + eval {p | H.mem p} (env i).val ∩ eval {p | H.mem p} (familySet ⊤ T valid) := by + rw [eval_sharedConditionName D phi env i T valid family H generic] + apply ZFSet.ext + intro x + simp only [ZFSet.mem_sep, ZFSet.mem_inter, truth, true_and] + exact and_comm + +theorem eval_sharedConditionName_of_subset (D : NameDomain s) {n : Nat} + (phi : SetFormula n) (env : Assignment D n) (i : Fin n) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) + (truth : Realize (D.values {p | H.mem p}) phi + (evalAssignment {p | H.mem p} env)) + (subset : eval {p | H.mem p} (env i).val ⊆ + eval {p | H.mem p} (familySet ⊤ T valid)) : + eval {p | H.mem p} (sharedConditionName D phi env i T valid) = + eval {p | H.mem p} (env i).val := by + rw [eval_sharedConditionName_of_true D phi env i T valid family H generic truth] + apply ZFSet.ext + intro x + exact ⟨fun member => (ZFSet.mem_inter.1 member).1, + fun member => ZFSet.mem_inter.2 ⟨member, subset member⟩⟩ + +theorem eval_sharedConditionName_of_false (D : NameDomain s) {n : Nat} + (phi : SetFormula n) (env : Assignment D n) (i : Fin n) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) + (falsehood : ¬ Realize (D.values {p | H.mem p}) phi + (evalAssignment {p | H.mem p} env)) : + eval {p | H.mem p} (sharedConditionName D phi env i T valid) = ∅ := by + rw [eval_sharedConditionName D phi env i T valid family H generic] + apply ZFSet.ext + intro x + simp [falsehood] + +end Name + +namespace Name +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} +variable {G : Type v} [Group G] (a : PosetAction G P) +variable (D : NameDomain s) +variable (closed : ∀ g sigma, sigma ∈ D.names → a.act s g sigma ∈ D.names) +variable {n : Nat} (phi : SetFormula n) (env : Assignment D n) (i : Fin n) +variable (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) +variable (terms : ∀ g (sigma : Name s), sigma.val ∈ J → (a.act s g sigma).val ∈ J) +include closed terms + +theorem sharedConditionName_act (g : G) : + a.act s g (sharedConditionName D phi env i J valid) = + sharedConditionName D phi (a.actAssignment s D closed g env) i J valid := by + unfold sharedConditionName + rw [a.act_separationName s D closed, act_familySet a J valid terms] + +theorem sharedConditionName_nice (K : Subgroup G) + (fixed : ∀ j, K ≤ a.stabilizer s (env j).val) : + NiceNameCode a s J K (sharedConditionName D phi env i J valid).val := by + apply (niceNameCode_iff a s _).2 + refine ⟨sharedConditionName_subset D phi env i J valid, ?_⟩ + intro g hg + change a.act s g (sharedConditionName D phi env i J valid) = _ + rw [sharedConditionName_act a D closed phi env i J valid terms] + have equal : a.actAssignment s D closed g env = env := by + funext j + apply Subtype.ext + exact fixed j hg + rw [equal] + +theorem sharedConditionName_hs (K : Subgroup G) + (fixed : ∀ j, K ≤ a.stabilizer s (env j).val) + (F : NormalSubgroupFamily G) (member : F.mem K) + (children : ∀ sigma : Name s, sigma.val ∈ J → HereditarilySymmetric a s F sigma) : + HereditarilySymmetric a s F (sharedConditionName D phi env i J valid) := + niceNameCode_hs a s F member children + (sharedConditionName_nice a D closed phi env i J valid terms K fixed) + +end Name + +namespace TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +include pairing unions powers separation collection carrier order + +theorem sharedConditionName_mem {n : Nat} (phi : SetFormula n) + (env : Assignment (M.nameDomain s) n) (i : Fin n) + {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName s z) : + (Name.sharedConditionName (M.nameDomain s) phi env i J valid).val ∈ M.sets := by + have family := M.familySet_mem s ⊤ pairing unions powers separation hJ + (M.transitive carrier (s.encode_mem ⊤)) valid + exact M.ordinarySeparationName_mem s pairing unions powers separation collection carrier order + (sharedConditionFormula phi i) env ⟨Name.familySet ⊤ J valid, family⟩ + +theorem sharedConditionName_spec {G : Type u} [Group G] + (a : PosetAction G P) (t : Presentation G) + (maps : a.conditionMapFamily s t ∈ M.sets) + {n : Nat} (phi : SetFormula n) (env : Assignment (M.nameDomain s) n) (i : Fin n) + {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName s z) + (terms : ∀ g (sigma : Name s), sigma.val ∈ J → (a.act s g sigma).val ∈ J) + (K : Subgroup G) (fixed : ∀ j, K ≤ a.stabilizer s (env j).val) + (F : NormalSubgroupFamily G) (member : F.mem K) + (children : ∀ sigma : Name s, sigma.val ∈ J → HereditarilySymmetric a s F sigma) : + (Name.sharedConditionName (M.nameDomain s) phi env i J valid).val ∈ M.sets ∧ + NiceNameCode a s J K (Name.sharedConditionName (M.nameDomain s) phi env i J valid).val ∧ + HereditarilySymmetric a s F (Name.sharedConditionName (M.nameDomain s) phi env i J valid) := by + have closed : ∀ g sigma, sigma ∈ (M.nameDomain s).names → + a.act s g sigma ∈ (M.nameDomain s).names := + fun g sigma h => M.act_mem s a t pairing unions powers separation collection carrier maps g sigma h + exact ⟨M.sharedConditionName_mem s pairing unions powers separation collection carrier order phi env i hJ valid, + Name.sharedConditionName_nice a (M.nameDomain s) closed phi env i J valid terms K fixed, + Name.sharedConditionName_hs a (M.nameDomain s) closed phi env i J valid terms K fixed F member children⟩ + +end TransitiveGround + +namespace Name +open SetRealization SetFormula +universe u +variable {P : Type u} [Preorder P] [OrderTop P] {s : Presentation P} + +noncomputable def refinementConditionNames (D : NameDomain s) + (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) + (valid : ∀ i, ∀ z ∈ T i, IsName s z) : Fin 3 → Name s := + fun i => sharedConditionName D BoundedFormula.refinementValidityFormula.toFormula + env i.castSucc (T i) (valid i) + +theorem eval_refinementConditionNames_coherent (D : NameDomain s) + (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) + (valid : ∀ i, ∀ z ∈ T i, IsName s z) + (family : ∀ i, familySet ⊤ (T i) (valid i) ∈ D.names) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) + (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (T i) s.carrier) : + (Realize (D.values {p | H.mem p}) BoundedFormula.refinementValidityFormula.toFormula + (evalAssignment {p | H.mem p} env) ∧ + ∀ i : Fin 3, eval {p | H.mem p} (refinementConditionNames D env T valid i) = + eval {p | H.mem p} (env i.castSucc).val) ∨ + (¬ Realize (D.values {p | H.mem p}) BoundedFormula.refinementValidityFormula.toFormula + (evalAssignment {p | H.mem p} env) ∧ + ∀ i : Fin 3, eval {p | H.mem p} (refinementConditionNames D env T valid i) = ∅) := by + classical + by_cases truth : Realize (D.values {p | H.mem p}) + BoundedFormula.refinementValidityFormula.toFormula (evalAssignment {p | H.mem p} env) + · refine Or.inl ⟨truth, ?_⟩ + intro i + exact eval_sharedConditionName_of_subset D BoundedFormula.refinementValidityFormula.toFormula + env i.castSucc (T i) (valid i) (family i) H generic truth + (eval_subset_familySet_of_code_subset H (T i) (valid i) (env i.castSucc).val (shape i)) + · refine Or.inr ⟨truth, ?_⟩ + intro i + exact eval_sharedConditionName_of_false D BoundedFormula.refinementValidityFormula.toFormula + env i.castSucc (T i) (valid i) (family i) H generic truth + +theorem eval_refinementConditionNames_valid (D : NameDomain s) + (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) + (valid : ∀ i, ∀ z ∈ T i, IsName s z) + (family : ∀ i, familySet ⊤ (T i) (valid i) ∈ D.names) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) + (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (T i) s.carrier) : + RefinementValidityCode (eval {p | H.mem p} (env 3).val) + (eval {p | H.mem p} (refinementConditionNames D env T valid 0)) + (eval {p | H.mem p} (refinementConditionNames D env T valid 1)) + (eval {p | H.mem p} (refinementConditionNames D env T valid 2)) := by + let evaluated : TransitiveGround.{u} := + ⟨D.values {p | H.mem p}, D.values_transitive {p | H.mem p}⟩ + rcases eval_refinementConditionNames_coherent D env T valid family H generic shape with + ⟨truth, equal⟩ | ⟨_, equal⟩ + · rw [equal 0, equal 1, equal 2] + exact (evaluated.realize_refinementValidityFormula + (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩)).1 truth + · rw [equal 0, equal 1, equal 2] + exact refinementValidity_empty _ + +theorem eval_refinementConditionNames_of_valid (D : NameDomain s) + (env : Assignment D 4) (T : Fin 3 → ZFSet.{u}) + (valid : ∀ i, ∀ z ∈ T i, IsName s z) + (family : ∀ i, familySet ⊤ (T i) (valid i) ∈ D.names) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) + (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (T i) s.carrier) + (oldValid : RefinementValidityCode (eval {p | H.mem p} (env 3).val) + (eval {p | H.mem p} (env 0).val) (eval {p | H.mem p} (env 1).val) + (eval {p | H.mem p} (env 2).val)) : + ∀ i : Fin 3, eval {p | H.mem p} (refinementConditionNames D env T valid i) = + eval {p | H.mem p} (env i.castSucc).val := by + let evaluated : TransitiveGround.{u} := + ⟨D.values {p | H.mem p}, D.values_transitive {p | H.mem p}⟩ + have truth := (evaluated.realize_refinementValidityFormula + (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩)).2 oldValid + intro i + exact eval_sharedConditionName_of_subset D BoundedFormula.refinementValidityFormula.toFormula + env i.castSucc (T i) (valid i) (family i) H generic truth + (eval_subset_familySet_of_code_subset H (T i) (valid i) (env i.castSucc).val (shape i)) + +end Name + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSizeWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSizeWitnesses.lean index 4b66a7c9a906cc7cc9fbff111ca382be1a3139fa..9d0ae3b6720e532c8da977f32615137a5ccc1f7d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSizeWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSizeWitnesses.lean @@ -1,93 +1,93 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.DecodedFunctionGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPartialFunctionSpaces - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace InjectionCode - -theorem empty (N : ZFSet.{u}) : InjectionCode ∅ N ∅ := by - refine ⟨⟨ZFSet.empty_subset _, ?_⟩, ?_⟩ - · intro x hx - exact False.elim (ZFSet.notMem_empty x hx) - · intro x _ z hx _ - exact False.elim (ZFSet.notMem_empty (ZFSet.pair x z) hx) - -theorem decoded_injective {D N f : ZFSet.{u}} (h : InjectionCode D N f) : - Function.Injective ((SetRealization.SetMembers.presentation D).decodeFunction - (SetRealization.SetMembers.presentation N) f h.function) := by - intro x y eq - apply SetRealization.SetMembers.raw_injective D - have hx := (SetRealization.SetMembers.presentation D).decodeFunction_mem - (SetRealization.SetMembers.presentation N) f h.function x - have hy := (SetRealization.SetMembers.presentation D).decodeFunction_mem - (SetRealization.SetMembers.presentation N) f h.function y - rw [eq] at hx - exact h.injective _ _ _ hx hy - -theorem countable_domain {D N f : ZFSet.{u}} (h : InjectionCode D N f) - [Countable (SetRealization.SetMembers N)] : Countable (SetRealization.SetMembers D) := - h.decoded_injective.countable - -end InjectionCode - -namespace BoundedFormula - -open SetFormula - -theorem truth_injectionFormula {n} (d c f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (injectionFormula d c f) env ↔ InjectionCode (env d) (env c) (env f) := by - simp only [injectionFormula, Truth, truth_functionFormula, truth_imp, truth_pairMembershipFormula] - constructor - · rintro ⟨function, injective⟩ - refine ⟨function, ?_⟩ - intro x y z hx hy - have xz := ZFSet.pair_mem_prod.1 (function.1 hx) - have yz := ZFSet.pair_mem_prod.1 (function.1 hy) - exact injective x xz.1 y yz.1 z xz.2 ⟨hx, hy⟩ - · intro h - exact ⟨h.function, fun x _ y _ z _ ⟨hx, hy⟩ => h.injective x y z hx hy⟩ - -end BoundedFormula - -namespace SetFormula - -end SetFormula - -namespace TransitiveGround - -open SetRealization SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_hasInjectionFormula {n} (d c : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (hasInjectionFormula d c) env ↔ M.groundEmbeddable (env d) (env c) := by - rw [hasInjectionFormula, realize_ex] - constructor - · rintro ⟨f, hf, rel⟩ - exact ⟨f, hf, (BoundedFormula.truth_injectionFormula d.succ c.succ 0 _).1 - ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hf members)).1 rel)⟩ - · rintro ⟨f, hf, code⟩ - exact ⟨f, hf, (BoundedFormula.realize_toFormula M _ _ (Fin.cases hf members)).2 - ((BoundedFormula.truth_injectionFormula d.succ c.succ 0 _).2 code)⟩ - -theorem empty_groundEmbeddable (N : ZFSet.{u}) (nonempty : M.sets.Nonempty) : - M.groundEmbeddable ∅ N := ⟨∅, M.empty_mem nonempty, InjectionCode.empty N⟩ - -theorem groundEmbeddable_countable {D N : ZFSet.{u}} (h : M.groundEmbeddable D N) - [Countable (SetMembers N)] : Countable (SetMembers D) := by - obtain ⟨f, _, code⟩ := h - exact code.countable_domain - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.DecodedFunctionGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPartialFunctionSpaces + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace InjectionCode + +theorem empty (N : ZFSet.{u}) : InjectionCode ∅ N ∅ := by + refine ⟨⟨ZFSet.empty_subset _, ?_⟩, ?_⟩ + · intro x hx + exact False.elim (ZFSet.notMem_empty x hx) + · intro x _ z hx _ + exact False.elim (ZFSet.notMem_empty (ZFSet.pair x z) hx) + +theorem decoded_injective {D N f : ZFSet.{u}} (h : InjectionCode D N f) : + Function.Injective ((SetRealization.SetMembers.presentation D).decodeFunction + (SetRealization.SetMembers.presentation N) f h.function) := by + intro x y eq + apply SetRealization.SetMembers.raw_injective D + have hx := (SetRealization.SetMembers.presentation D).decodeFunction_mem + (SetRealization.SetMembers.presentation N) f h.function x + have hy := (SetRealization.SetMembers.presentation D).decodeFunction_mem + (SetRealization.SetMembers.presentation N) f h.function y + rw [eq] at hx + exact h.injective _ _ _ hx hy + +theorem countable_domain {D N f : ZFSet.{u}} (h : InjectionCode D N f) + [Countable (SetRealization.SetMembers N)] : Countable (SetRealization.SetMembers D) := + h.decoded_injective.countable + +end InjectionCode + +namespace BoundedFormula + +open SetFormula + +theorem truth_injectionFormula {n} (d c f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (injectionFormula d c f) env ↔ InjectionCode (env d) (env c) (env f) := by + simp only [injectionFormula, Truth, truth_functionFormula, truth_imp, truth_pairMembershipFormula] + constructor + · rintro ⟨function, injective⟩ + refine ⟨function, ?_⟩ + intro x y z hx hy + have xz := ZFSet.pair_mem_prod.1 (function.1 hx) + have yz := ZFSet.pair_mem_prod.1 (function.1 hy) + exact injective x xz.1 y yz.1 z xz.2 ⟨hx, hy⟩ + · intro h + exact ⟨h.function, fun x _ y _ z _ ⟨hx, hy⟩ => h.injective x y z hx hy⟩ + +end BoundedFormula + +namespace SetFormula + +end SetFormula + +namespace TransitiveGround + +open SetRealization SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_hasInjectionFormula {n} (d c : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (hasInjectionFormula d c) env ↔ M.groundEmbeddable (env d) (env c) := by + rw [hasInjectionFormula, realize_ex] + constructor + · rintro ⟨f, hf, rel⟩ + exact ⟨f, hf, (BoundedFormula.truth_injectionFormula d.succ c.succ 0 _).1 + ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hf members)).1 rel)⟩ + · rintro ⟨f, hf, code⟩ + exact ⟨f, hf, (BoundedFormula.realize_toFormula M _ _ (Fin.cases hf members)).2 + ((BoundedFormula.truth_injectionFormula d.succ c.succ 0 _).2 code)⟩ + +theorem empty_groundEmbeddable (N : ZFSet.{u}) (nonempty : M.sets.Nonempty) : + M.groundEmbeddable ∅ N := ⟨∅, M.empty_mem nonempty, InjectionCode.empty N⟩ + +theorem groundEmbeddable_countable {D N : ZFSet.{u}} (h : M.groundEmbeddable D N) + [Countable (SetMembers N)] : Countable (SetMembers D) := by + obtain ⟨f, _, code⟩ := h + exact code.countable_domain + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSmallFunctionPermutations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSmallFunctionPermutations.lean index 417dbcf30b3988de249069892cadddca7b4ea2d8..f9ff6c88f2975f0a37efbbb08ed5ac8ea4d0a63a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSmallFunctionPermutations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSmallFunctionPermutations.lean @@ -1,410 +1,410 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundContainmentOrders - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -@[instance_reducible] -noncomputable def smallFunctionOrder (X Y N : ZFSet.{u}) : - PartialOrder (SetMembers (M.smallPartialFunctions X Y N)) := - (reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)).toPartialOrder - -@[instance_reducible] -noncomputable def smallFunctionTop (X Y N : ZFSet.{u}) (nonempty : M.sets.Nonempty) : - letI _smallOrder := M.smallFunctionOrder X Y N - OrderTop (SetMembers (M.smallPartialFunctions X Y N)) := - (reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)).toOrderTop ∅ - (M.empty_mem_smallPartialFunctions X Y N nonempty) - (reverseInclusion_empty_top (M.empty_mem_smallPartialFunctions X Y N nonempty)) - -theorem smallFunction_le_iff (X Y N : ZFSet.{u}) - (p q : SetMembers (M.smallPartialFunctions X Y N)) : - letI _smallOrder := M.smallFunctionOrder X Y N - p ≤ q ↔ SetMembers.raw q ⊆ SetMembers.raw p := by - let smallOrder := M.smallFunctionOrder X Y N - change ZFSet.pair (SetMembers.raw p) (SetMembers.raw q) ∈ - reverseInclusionCode (M.smallPartialFunctions X Y N) ↔ _ - rw [pair_mem_reverseInclusionCode] - exact ⟨fun h => h.2.2, fun h => ⟨SetMembers.raw_mem p, SetMembers.raw_mem q, h⟩⟩ - -theorem smallFunction_raw_properties (X Y N : ZFSet.{u}) - (p : SetMembers (M.smallPartialFunctions X Y N)) : - SetMembers.raw p ∈ M.sets ∧ PartialFunctionCode X Y (SetMembers.raw p) ∧ - M.groundEmbeddable (SetMembers.raw p) N := - (M.mem_smallPartialFunctions X Y N _).1 (SetMembers.raw_mem p) - -theorem smallFunctionOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {X Y N : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hN : N ∈ M.sets) : - letI _smallOrder := M.smallFunctionOrder X Y N - (SetMembers.presentation (M.smallPartialFunctions X Y N)).conditionOrder ∈ M.sets := by - let smallOrder := M.smallFunctionOrder X Y N - rw [(reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)).conditionOrder_eq] - exact M.reverseInclusionCode_mem pairing unions powers separation - (M.smallPartialFunctions_mem pairing unions powers separation hX hY hN) - -theorem exists_smallFunction_generic - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {X Y N : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hN : N ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions X Y N)) : - letI _smallOrder := M.smallFunctionOrder X Y N - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y N)), H.mem p ∧ - H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y N))) ∧ - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation (M.smallPartialFunctions X Y N)))) := by - let smallOrder := M.smallFunctionOrder X Y N - have carrier := M.smallPartialFunctions_mem pairing unions powers separation hX hY hN - have order := M.reverseInclusionCode_mem pairing unions powers separation carrier - have laws := (M.realize_partialOrderCode carrier order).2 (reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)) - exact M.exists_decoded_generic small carrier order laws p - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.SetRealization.Presentation - -open Forcing -universe u -variable {A B : Type u} (s : Presentation A) (t : Presentation B) - -theorem relation_ext {p q : ZFSet.{u}} (hp : p ⊆ ZFSet.prod s.carrier t.carrier) - (hq : q ⊆ ZFSet.prod s.carrier t.carrier) - (entries : ∀ a b, ZFSet.pair (s.encode a) (t.encode b) ∈ p ↔ - ZFSet.pair (s.encode a) (t.encode b) ∈ q) : p = q := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (hp hz) - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy - exact (entries a b).1 hz - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (hq hz) - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy - exact (entries a b).2 hz - -theorem graph_injection (f : A → B) (injective : Function.Injective f) : - InjectionCode s.carrier t.carrier (s.graph t f) := by - have function := s.graph_isFunc t f - refine ⟨function, ?_⟩ - intro x y z hx hy - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (function.1 hx)).1 - obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 (ZFSet.pair_mem_prod.1 (function.1 hy)).1 - obtain ⟨c, rfl⟩ := (t.mem_carrier z).1 (ZFSet.pair_mem_prod.1 (function.1 hx)).2 - exact congrArg s.encode (injective - (((s.pair_mem_graph t f a c).1 hx).trans ((s.pair_mem_graph t f b c).1 hy).symm)) - -theorem converse_graph (e : A ≃ B) : - relationConverse s.carrier t.carrier (s.graph t e) = t.graph s e.symm := by - apply t.relation_ext s (fun _ hz => (ZFSet.mem_sep.1 hz).1) (t.graph_isFunc s e.symm).1 - intro b a - change ZFSet.pair (t.encode b) (s.encode a) ∈ relationConverse s.carrier t.carrier (s.graph t e) ↔ _ - rw [pair_mem_relationConverse, s.pair_mem_graph, t.pair_mem_graph] - exact ⟨fun h => (congrArg e.symm h.2.2).symm.trans (e.symm_apply_apply a), - fun eq => ⟨s.encode_mem a, t.encode_mem b, by rw [← eq, e.apply_symm_apply]⟩⟩ - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing - -open SetRealization -universe u -variable {X Y : Type u} (s : Presentation X) (t : Presentation Y) - -noncomputable def graphRename (e : X ≃ X) (p : ZFSet.{u}) : ZFSet.{u} := - (s.product t).subset (fun xy => ZFSet.pair (s.encode (e.symm xy.1)) (t.encode xy.2) ∈ p) - -theorem pair_mem_graphRename (e : X ≃ X) (p : ZFSet.{u}) (x : X) (y : Y) : - ZFSet.pair (s.encode x) (t.encode y) ∈ graphRename s t e p ↔ - ZFSet.pair (s.encode (e.symm x)) (t.encode y) ∈ p := - (s.product t).encode_mem_subset _ (x, y) - -theorem graphRename_shape (e : X ≃ X) (p : ZFSet.{u}) : - graphRename s t e p ⊆ ZFSet.prod s.carrier t.carrier := (s.product t).subset_carrier _ - -theorem graphRename_partial (e : X ≃ X) {p : ZFSet.{u}} (h : PartialFunctionCode s.carrier t.carrier p) : - PartialFunctionCode s.carrier t.carrier (graphRename s t e p) := by - refine ⟨graphRename_shape s t e p, ?_⟩ - intro x y z hy hz - have xy := ZFSet.pair_mem_prod.1 (graphRename_shape s t e p hy) - have xz := ZFSet.pair_mem_prod.1 (graphRename_shape s t e p hz) - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 xy.1 - obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 xy.2 - obtain ⟨c, rfl⟩ := (t.mem_carrier z).1 xz.2 - exact h.unique _ _ _ ((pair_mem_graphRename s t e p a b).1 hy) - ((pair_mem_graphRename s t e p a c).1 hz) - -theorem graphRename_refl {p : ZFSet.{u}} (shape : p ⊆ ZFSet.prod s.carrier t.carrier) : - graphRename s t (Equiv.refl X) p = p := by - apply s.relation_ext t (graphRename_shape s t _ p) shape - intro x y - exact pair_mem_graphRename s t _ p x y - -theorem graphRename_comp (e f : X ≃ X) (p : ZFSet.{u}) : - graphRename s t f (graphRename s t e p) = graphRename s t (e.trans f) p := by - apply s.relation_ext t (graphRename_shape s t _ _) (graphRename_shape s t _ _) - intro x y - rw [pair_mem_graphRename, pair_mem_graphRename, pair_mem_graphRename] - rfl - -theorem graphRename_inverse (e : X ≃ X) {p : ZFSet.{u}} - (shape : p ⊆ ZFSet.prod s.carrier t.carrier) : - graphRename s t e.symm (graphRename s t e p) = p := by - apply s.relation_ext t (graphRename_shape s t _ _) shape - intro x y - rw [pair_mem_graphRename, pair_mem_graphRename] - change ZFSet.pair (s.encode (e.symm (e x))) (t.encode y) ∈ p ↔ _ - rw [e.symm_apply_apply] - -theorem graphRename_mono (e : X ≃ X) {p q : ZFSet.{u}} (subset : p ⊆ q) : - graphRename s t e p ⊆ graphRename s t e q := by - intro z hz - obtain ⟨⟨x, y⟩, rel, rfl⟩ := ((s.product t).mem_subset _ z).1 hz - exact (pair_mem_graphRename s t e q x y).2 (subset rel) - -noncomputable def entryPermutationGraph (e : X ≃ X) : ZFSet.{u} := - (s.product t).graph (s.product t) (fun xy => (e xy.1, xy.2)) - -theorem entryPermutation_injection (e : X ≃ X) : - InjectionCode (ZFSet.prod s.carrier t.carrier) (ZFSet.prod s.carrier t.carrier) - (entryPermutationGraph s t e) := by - apply (s.product t).graph_injection (s.product t) - intro a b eq - apply Prod.ext - · exact e.injective (congrArg (fun z : X × Y => z.1) eq) - · have same := congrArg (fun z : X × Y => z.2) eq - exact same - -theorem graphRename_eq_image (e : X ≃ X) (p : ZFSet.{u}) : - graphRename s t e p = relationImage p (ZFSet.prod s.carrier t.carrier) (entryPermutationGraph s t e) := by - apply s.relation_ext t (graphRename_shape s t _ _) (fun _ hz => (ZFSet.mem_sep.1 hz).1) - intro x y - rw [pair_mem_graphRename, ZFSet.mem_sep] - constructor - · intro rel - refine ⟨ZFSet.pair_mem_prod.2 ⟨s.encode_mem x, t.encode_mem y⟩, - ZFSet.pair (s.encode (e.symm x)) (t.encode y), rel, ?_⟩ - apply ((s.product t).pair_mem_graph (s.product t) _ (e.symm x, y) (x, y)).2 - exact Prod.ext (e.apply_symm_apply x) rfl - · rintro ⟨_, z, hz, rel⟩ - have hzC := (ZFSet.pair_mem_prod.1 ((entryPermutation_injection s t e).function.1 rel)).1 - obtain ⟨⟨a, b⟩, rfl⟩ := ((s.product t).mem_carrier z).1 hzC - have eq := ((s.product t).pair_mem_graph (s.product t) _ (a, b) (x, y)).1 rel - have ax : a = e.symm x := (e.symm_apply_apply a).symm.trans (congrArg e.symm (congrArg Prod.fst eq)) - have by' : b = y := congrArg Prod.snd eq - change ZFSet.pair (s.encode a) (t.encode b) ∈ p at hz - simpa only [ax, by'] using hz - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula SetRealization -universe u - -def entryTransportFormula {n} (a b r x y : Fin n) : BoundedFormula n := - exMem x (exMem x.succ (exMem y.succ.succ - (.conj (orderedPairFormula a.succ.succ.succ 2 0) - (.conj (orderedPairFormula b.succ.succ.succ 1 0) - (pairMembershipFormula 2 1 r.succ.succ.succ))))) - -def entryPermutationFormula {n} (z r x y c : Fin n) : BoundedFormula n := - exMem c (exMem c.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (entryTransportFormula 1 0 r.succ.succ x.succ.succ y.succ.succ))) - -theorem truth_entryTransportFormula {n} (a b r x y : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (entryTransportFormula a b r x y) env ↔ - ∃ i ∈ env x, ∃ j ∈ env x, ∃ v ∈ env y, - env a = ZFSet.pair i v ∧ env b = ZFSet.pair j v ∧ ZFSet.pair i j ∈ env r := by - simp only [entryTransportFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl - -theorem truth_entryPermutationFormula {n} (z r x y c : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (entryPermutationFormula z r x y c) env ↔ - ∃ a ∈ env c, ∃ b ∈ env c, env z = ZFSet.pair a b ∧ - ∃ i ∈ env x, ∃ j ∈ env x, ∃ v ∈ env y, - a = ZFSet.pair i v ∧ b = ZFSet.pair j v ∧ ZFSet.pair i j ∈ env r := by - simp only [entryPermutationFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_entryTransportFormula] - rfl - -theorem entryPermutation_correct {X Y : Type u} (s : Presentation X) (t : Presentation Y) - (e : X ≃ X) (z : ZFSet.{u}) : - Truth (entryPermutationFormula 0 1 2 3 4) - (extend z (extend (s.graph s e) (extend s.carrier (extend t.carrier - (extend (ZFSet.prod s.carrier t.carrier) Fin.elim0))))) ↔ z ∈ entryPermutationGraph s t e := by - rw [truth_entryPermutationFormula] - change (∃ a ∈ ZFSet.prod s.carrier t.carrier, ∃ b ∈ ZFSet.prod s.carrier t.carrier, - z = ZFSet.pair a b ∧ ∃ i ∈ s.carrier, ∃ j ∈ s.carrier, ∃ v ∈ t.carrier, - a = ZFSet.pair i v ∧ b = ZFSet.pair j v ∧ ZFSet.pair i j ∈ s.graph s e) ↔ _ - constructor - · rintro ⟨a, _, b, _, rfl, i, hi, j, hj, v, hv, rfl, rfl, rel⟩ - obtain ⟨x, rfl⟩ := (s.mem_carrier i).1 hi - obtain ⟨x', rfl⟩ := (s.mem_carrier j).1 hj - obtain ⟨y, rfl⟩ := (t.mem_carrier v).1 hv - exact ((s.product t).pair_mem_graph (s.product t) _ (x, y) (x', y)).2 - (Prod.ext ((s.pair_mem_graph s e x x').1 rel) rfl) - · intro hz - obtain ⟨⟨x, y⟩, eq⟩ := ((s.product t).mem_graph (s.product t) _ z).1 hz - exact ⟨ZFSet.pair (s.encode x) (t.encode y), (s.product t).encode_mem (x, y), - ZFSet.pair (s.encode (e x)) (t.encode y), (s.product t).encode_mem (e x, y), eq.symm, - s.encode x, s.encode_mem x, s.encode (e x), s.encode_mem (e x), t.encode y, t.encode_mem y, - rfl, rfl, (s.pair_mem_graph s e x (e x)).2 rfl⟩ - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {X Y : Type u} (s : Presentation X) (t : Presentation Y) - -theorem inverse_function_graph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (e : X ≃ Y) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) - (graph : s.graph t e ∈ M.sets) : t.graph s e.symm ∈ M.sets := by - rw [← s.converse_graph t e] - exact M.relationConverse_mem pairing unions powers separation hX hY graph - -theorem entryPermutationGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (e : X ≃ X) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) - (graph : s.graph s e ∈ M.sets) : entryPermutationGraph s t e ∈ M.sets := by - have product := M.prod_mem pairing unions powers separation hX hY - have bound := M.prod_mem pairing unions powers separation product product - let params := extend (s.graph s e) (extend s.carrier (extend t.carrier - (extend (ZFSet.prod s.carrier t.carrier) Fin.elim0))) - have selected := M.bounded_separation_mem separation (BoundedFormula.entryPermutationFormula 0 1 2 3 4) - params (Fin.cases graph (Fin.cases hX (Fin.cases hY (Fin.cases product (fun i => Fin.elim0 i))))) bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.entryPermutationFormula 0 1 2 3 4) - (extend z params)) (ZFSet.prod (ZFSet.prod s.carrier t.carrier) (ZFSet.prod s.carrier t.carrier)) = - entryPermutationGraph s t e := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - exact ⟨fun h => (BoundedFormula.entryPermutation_correct s t e z).1 h.2, - fun hz => ⟨(entryPermutation_injection s t e).function.1 hz, - (BoundedFormula.entryPermutation_correct s t e z).2 hz⟩⟩ - exact eq ▸ selected - -theorem graphRename_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (e : X ≃ X) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) - (graph : s.graph s e ∈ M.sets) {p : ZFSet.{u}} (hp : p ∈ M.sets) : graphRename s t e p ∈ M.sets := by - rw [graphRename_eq_image] - exact M.relationImage_mem separation hp (M.prod_mem pairing unions powers separation hX hY) - (M.entryPermutationGraph_mem s t pairing unions powers separation e hX hY graph) - -theorem smallPartialFunctions_rename - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (e : X ≃ X) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) - (graph : s.graph s e ∈ M.sets) {N p : ZFSet.{u}} (hN : N ∈ M.sets) - (hp : p ∈ M.smallPartialFunctions s.carrier t.carrier N) : - graphRename s t e p ∈ M.smallPartialFunctions s.carrier t.carrier N := by - obtain ⟨hpM, code, small⟩ := (M.mem_smallPartialFunctions s.carrier t.carrier N p).1 hp - refine (M.mem_smallPartialFunctions s.carrier t.carrier N _).2 - ⟨M.graphRename_mem s t pairing unions powers separation e hX hY graph hpM, - graphRename_partial s t e code, ?_⟩ - rw [graphRename_eq_image] - exact M.groundEmbeddable_image pairing unions powers separation hpM - (M.prod_mem pairing unions powers separation hX hY) hN - (M.entryPermutationGraph_mem s t pairing unions powers separation e hX hY graph) - (entryPermutation_injection s t e) code.shape small - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {X Y : Type u} (s : Presentation X) (t : Presentation Y) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {N : ZFSet.{u}} (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) (hN : N ∈ M.sets) - -noncomputable def renameSmallCondition (e : X ≃ X) (graph : s.graph s e ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : - SetMembers (M.smallPartialFunctions s.carrier t.carrier N) := - SetMembers.ofMem (graphRename s t e (SetMembers.raw p)) - (M.smallPartialFunctions_rename s t pairing unions powers separation e hX hY graph hN (SetMembers.raw_mem p)) - -theorem raw_renameSmallCondition (e : X ≃ X) (graph : s.graph s e ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : - SetMembers.raw (M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph p) = - graphRename s t e (SetMembers.raw p) := SetMembers.raw_ofMem _ _ - -theorem renameSmallCondition_inverse (e : X ≃ X) - (graph : s.graph s e ∈ M.sets) (inverse : s.graph s e.symm ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : - M.renameSmallCondition s t pairing unions powers separation hX hY hN e.symm inverse - (M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph p) = p := by - apply SetMembers.raw_injective - rw [raw_renameSmallCondition, raw_renameSmallCondition] - exact graphRename_inverse s t e - (M.smallFunction_raw_properties s.carrier t.carrier N p).2.1.shape - -theorem renameSmallCondition_le_iff (e : X ≃ X) (graph : s.graph s e ∈ M.sets) - (p q : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : - letI _smallOrder := M.smallFunctionOrder s.carrier t.carrier N - M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph p ≤ - M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph q ↔ p ≤ q := by - let smallOrder := M.smallFunctionOrder s.carrier t.carrier N - rw [M.smallFunction_le_iff, M.smallFunction_le_iff, raw_renameSmallCondition, raw_renameSmallCondition] - constructor - · intro subset - have back := graphRename_mono s t e.symm subset - rw [graphRename_inverse s t e (M.smallFunction_raw_properties s.carrier t.carrier N q).2.1.shape, - graphRename_inverse s t e (M.smallFunction_raw_properties s.carrier t.carrier N p).2.1.shape] at back - exact back - · exact graphRename_mono s t e - -noncomputable def renameSmallOrderIso (e : X ≃ X) (graph : s.graph s e ∈ M.sets) : - letI _smallOrder := M.smallFunctionOrder s.carrier t.carrier N - SetMembers (M.smallPartialFunctions s.carrier t.carrier N) ≃o - SetMembers (M.smallPartialFunctions s.carrier t.carrier N) := by - letI smallOrder := M.smallFunctionOrder s.carrier t.carrier N - have inverse := M.inverse_function_graph_mem s s pairing unions powers separation e hX hX graph - exact { - toFun := M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph - invFun := M.renameSmallCondition s t pairing unions powers separation hX hY hN e.symm inverse - left_inv := M.renameSmallCondition_inverse s t pairing unions powers separation hX hY hN e graph inverse - right_inv := M.renameSmallCondition_inverse s t pairing unions powers separation hX hY hN e.symm inverse graph - map_rel_iff' := fun {p q} => M.renameSmallCondition_le_iff s t pairing unions powers separation hX hY hN e graph p q } - -theorem raw_renameSmallOrderIso (e : X ≃ X) (graph : s.graph s e ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : - letI _smallOrder := M.smallFunctionOrder s.carrier t.carrier N - SetMembers.raw (M.renameSmallOrderIso s t pairing unions powers separation hX hY hN e graph p) = - graphRename s t e (SetMembers.raw p) := SetMembers.raw_ofMem _ _ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundContainmentOrders + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +@[instance_reducible] +noncomputable def smallFunctionOrder (X Y N : ZFSet.{u}) : + PartialOrder (SetMembers (M.smallPartialFunctions X Y N)) := + (reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)).toPartialOrder + +@[instance_reducible] +noncomputable def smallFunctionTop (X Y N : ZFSet.{u}) (nonempty : M.sets.Nonempty) : + letI _smallOrder := M.smallFunctionOrder X Y N + OrderTop (SetMembers (M.smallPartialFunctions X Y N)) := + (reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)).toOrderTop ∅ + (M.empty_mem_smallPartialFunctions X Y N nonempty) + (reverseInclusion_empty_top (M.empty_mem_smallPartialFunctions X Y N nonempty)) + +theorem smallFunction_le_iff (X Y N : ZFSet.{u}) + (p q : SetMembers (M.smallPartialFunctions X Y N)) : + letI _smallOrder := M.smallFunctionOrder X Y N + p ≤ q ↔ SetMembers.raw q ⊆ SetMembers.raw p := by + let smallOrder := M.smallFunctionOrder X Y N + change ZFSet.pair (SetMembers.raw p) (SetMembers.raw q) ∈ + reverseInclusionCode (M.smallPartialFunctions X Y N) ↔ _ + rw [pair_mem_reverseInclusionCode] + exact ⟨fun h => h.2.2, fun h => ⟨SetMembers.raw_mem p, SetMembers.raw_mem q, h⟩⟩ + +theorem smallFunction_raw_properties (X Y N : ZFSet.{u}) + (p : SetMembers (M.smallPartialFunctions X Y N)) : + SetMembers.raw p ∈ M.sets ∧ PartialFunctionCode X Y (SetMembers.raw p) ∧ + M.groundEmbeddable (SetMembers.raw p) N := + (M.mem_smallPartialFunctions X Y N _).1 (SetMembers.raw_mem p) + +theorem smallFunctionOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {X Y N : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hN : N ∈ M.sets) : + letI _smallOrder := M.smallFunctionOrder X Y N + (SetMembers.presentation (M.smallPartialFunctions X Y N)).conditionOrder ∈ M.sets := by + let smallOrder := M.smallFunctionOrder X Y N + rw [(reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)).conditionOrder_eq] + exact M.reverseInclusionCode_mem pairing unions powers separation + (M.smallPartialFunctions_mem pairing unions powers separation hX hY hN) + +theorem exists_smallFunction_generic + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {X Y N : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hN : N ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions X Y N)) : + letI _smallOrder := M.smallFunctionOrder X Y N + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y N)), H.mem p ∧ + H.GenericFor (M.codedFamily (SetMembers.presentation (M.smallPartialFunctions X Y N))) ∧ + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation (M.smallPartialFunctions X Y N)))) := by + let smallOrder := M.smallFunctionOrder X Y N + have carrier := M.smallPartialFunctions_mem pairing unions powers separation hX hY hN + have order := M.reverseInclusionCode_mem pairing unions powers separation carrier + have laws := (M.realize_partialOrderCode carrier order).2 (reverseInclusion_partialOrder (M.smallPartialFunctions X Y N)) + exact M.exists_decoded_generic small carrier order laws p + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.SetRealization.Presentation + +open Forcing +universe u +variable {A B : Type u} (s : Presentation A) (t : Presentation B) + +theorem relation_ext {p q : ZFSet.{u}} (hp : p ⊆ ZFSet.prod s.carrier t.carrier) + (hq : q ⊆ ZFSet.prod s.carrier t.carrier) + (entries : ∀ a b, ZFSet.pair (s.encode a) (t.encode b) ∈ p ↔ + ZFSet.pair (s.encode a) (t.encode b) ∈ q) : p = q := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (hp hz) + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy + exact (entries a b).1 hz + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (hq hz) + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy + exact (entries a b).2 hz + +theorem graph_injection (f : A → B) (injective : Function.Injective f) : + InjectionCode s.carrier t.carrier (s.graph t f) := by + have function := s.graph_isFunc t f + refine ⟨function, ?_⟩ + intro x y z hx hy + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (function.1 hx)).1 + obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 (ZFSet.pair_mem_prod.1 (function.1 hy)).1 + obtain ⟨c, rfl⟩ := (t.mem_carrier z).1 (ZFSet.pair_mem_prod.1 (function.1 hx)).2 + exact congrArg s.encode (injective + (((s.pair_mem_graph t f a c).1 hx).trans ((s.pair_mem_graph t f b c).1 hy).symm)) + +theorem converse_graph (e : A ≃ B) : + relationConverse s.carrier t.carrier (s.graph t e) = t.graph s e.symm := by + apply t.relation_ext s (fun _ hz => (ZFSet.mem_sep.1 hz).1) (t.graph_isFunc s e.symm).1 + intro b a + change ZFSet.pair (t.encode b) (s.encode a) ∈ relationConverse s.carrier t.carrier (s.graph t e) ↔ _ + rw [pair_mem_relationConverse, s.pair_mem_graph, t.pair_mem_graph] + exact ⟨fun h => (congrArg e.symm h.2.2).symm.trans (e.symm_apply_apply a), + fun eq => ⟨s.encode_mem a, t.encode_mem b, by rw [← eq, e.apply_symm_apply]⟩⟩ + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing + +open SetRealization +universe u +variable {X Y : Type u} (s : Presentation X) (t : Presentation Y) + +noncomputable def graphRename (e : X ≃ X) (p : ZFSet.{u}) : ZFSet.{u} := + (s.product t).subset (fun xy => ZFSet.pair (s.encode (e.symm xy.1)) (t.encode xy.2) ∈ p) + +theorem pair_mem_graphRename (e : X ≃ X) (p : ZFSet.{u}) (x : X) (y : Y) : + ZFSet.pair (s.encode x) (t.encode y) ∈ graphRename s t e p ↔ + ZFSet.pair (s.encode (e.symm x)) (t.encode y) ∈ p := + (s.product t).encode_mem_subset _ (x, y) + +theorem graphRename_shape (e : X ≃ X) (p : ZFSet.{u}) : + graphRename s t e p ⊆ ZFSet.prod s.carrier t.carrier := (s.product t).subset_carrier _ + +theorem graphRename_partial (e : X ≃ X) {p : ZFSet.{u}} (h : PartialFunctionCode s.carrier t.carrier p) : + PartialFunctionCode s.carrier t.carrier (graphRename s t e p) := by + refine ⟨graphRename_shape s t e p, ?_⟩ + intro x y z hy hz + have xy := ZFSet.pair_mem_prod.1 (graphRename_shape s t e p hy) + have xz := ZFSet.pair_mem_prod.1 (graphRename_shape s t e p hz) + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 xy.1 + obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 xy.2 + obtain ⟨c, rfl⟩ := (t.mem_carrier z).1 xz.2 + exact h.unique _ _ _ ((pair_mem_graphRename s t e p a b).1 hy) + ((pair_mem_graphRename s t e p a c).1 hz) + +theorem graphRename_refl {p : ZFSet.{u}} (shape : p ⊆ ZFSet.prod s.carrier t.carrier) : + graphRename s t (Equiv.refl X) p = p := by + apply s.relation_ext t (graphRename_shape s t _ p) shape + intro x y + exact pair_mem_graphRename s t _ p x y + +theorem graphRename_comp (e f : X ≃ X) (p : ZFSet.{u}) : + graphRename s t f (graphRename s t e p) = graphRename s t (e.trans f) p := by + apply s.relation_ext t (graphRename_shape s t _ _) (graphRename_shape s t _ _) + intro x y + rw [pair_mem_graphRename, pair_mem_graphRename, pair_mem_graphRename] + rfl + +theorem graphRename_inverse (e : X ≃ X) {p : ZFSet.{u}} + (shape : p ⊆ ZFSet.prod s.carrier t.carrier) : + graphRename s t e.symm (graphRename s t e p) = p := by + apply s.relation_ext t (graphRename_shape s t _ _) shape + intro x y + rw [pair_mem_graphRename, pair_mem_graphRename] + change ZFSet.pair (s.encode (e.symm (e x))) (t.encode y) ∈ p ↔ _ + rw [e.symm_apply_apply] + +theorem graphRename_mono (e : X ≃ X) {p q : ZFSet.{u}} (subset : p ⊆ q) : + graphRename s t e p ⊆ graphRename s t e q := by + intro z hz + obtain ⟨⟨x, y⟩, rel, rfl⟩ := ((s.product t).mem_subset _ z).1 hz + exact (pair_mem_graphRename s t e q x y).2 (subset rel) + +noncomputable def entryPermutationGraph (e : X ≃ X) : ZFSet.{u} := + (s.product t).graph (s.product t) (fun xy => (e xy.1, xy.2)) + +theorem entryPermutation_injection (e : X ≃ X) : + InjectionCode (ZFSet.prod s.carrier t.carrier) (ZFSet.prod s.carrier t.carrier) + (entryPermutationGraph s t e) := by + apply (s.product t).graph_injection (s.product t) + intro a b eq + apply Prod.ext + · exact e.injective (congrArg (fun z : X × Y => z.1) eq) + · have same := congrArg (fun z : X × Y => z.2) eq + exact same + +theorem graphRename_eq_image (e : X ≃ X) (p : ZFSet.{u}) : + graphRename s t e p = relationImage p (ZFSet.prod s.carrier t.carrier) (entryPermutationGraph s t e) := by + apply s.relation_ext t (graphRename_shape s t _ _) (fun _ hz => (ZFSet.mem_sep.1 hz).1) + intro x y + rw [pair_mem_graphRename, ZFSet.mem_sep] + constructor + · intro rel + refine ⟨ZFSet.pair_mem_prod.2 ⟨s.encode_mem x, t.encode_mem y⟩, + ZFSet.pair (s.encode (e.symm x)) (t.encode y), rel, ?_⟩ + apply ((s.product t).pair_mem_graph (s.product t) _ (e.symm x, y) (x, y)).2 + exact Prod.ext (e.apply_symm_apply x) rfl + · rintro ⟨_, z, hz, rel⟩ + have hzC := (ZFSet.pair_mem_prod.1 ((entryPermutation_injection s t e).function.1 rel)).1 + obtain ⟨⟨a, b⟩, rfl⟩ := ((s.product t).mem_carrier z).1 hzC + have eq := ((s.product t).pair_mem_graph (s.product t) _ (a, b) (x, y)).1 rel + have ax : a = e.symm x := (e.symm_apply_apply a).symm.trans (congrArg e.symm (congrArg Prod.fst eq)) + have by' : b = y := congrArg Prod.snd eq + change ZFSet.pair (s.encode a) (t.encode b) ∈ p at hz + simpa only [ax, by'] using hz + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula SetRealization +universe u + +def entryTransportFormula {n} (a b r x y : Fin n) : BoundedFormula n := + exMem x (exMem x.succ (exMem y.succ.succ + (.conj (orderedPairFormula a.succ.succ.succ 2 0) + (.conj (orderedPairFormula b.succ.succ.succ 1 0) + (pairMembershipFormula 2 1 r.succ.succ.succ))))) + +def entryPermutationFormula {n} (z r x y c : Fin n) : BoundedFormula n := + exMem c (exMem c.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (entryTransportFormula 1 0 r.succ.succ x.succ.succ y.succ.succ))) + +theorem truth_entryTransportFormula {n} (a b r x y : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (entryTransportFormula a b r x y) env ↔ + ∃ i ∈ env x, ∃ j ∈ env x, ∃ v ∈ env y, + env a = ZFSet.pair i v ∧ env b = ZFSet.pair j v ∧ ZFSet.pair i j ∈ env r := by + simp only [entryTransportFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl + +theorem truth_entryPermutationFormula {n} (z r x y c : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (entryPermutationFormula z r x y c) env ↔ + ∃ a ∈ env c, ∃ b ∈ env c, env z = ZFSet.pair a b ∧ + ∃ i ∈ env x, ∃ j ∈ env x, ∃ v ∈ env y, + a = ZFSet.pair i v ∧ b = ZFSet.pair j v ∧ ZFSet.pair i j ∈ env r := by + simp only [entryPermutationFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_entryTransportFormula] + rfl + +theorem entryPermutation_correct {X Y : Type u} (s : Presentation X) (t : Presentation Y) + (e : X ≃ X) (z : ZFSet.{u}) : + Truth (entryPermutationFormula 0 1 2 3 4) + (extend z (extend (s.graph s e) (extend s.carrier (extend t.carrier + (extend (ZFSet.prod s.carrier t.carrier) Fin.elim0))))) ↔ z ∈ entryPermutationGraph s t e := by + rw [truth_entryPermutationFormula] + change (∃ a ∈ ZFSet.prod s.carrier t.carrier, ∃ b ∈ ZFSet.prod s.carrier t.carrier, + z = ZFSet.pair a b ∧ ∃ i ∈ s.carrier, ∃ j ∈ s.carrier, ∃ v ∈ t.carrier, + a = ZFSet.pair i v ∧ b = ZFSet.pair j v ∧ ZFSet.pair i j ∈ s.graph s e) ↔ _ + constructor + · rintro ⟨a, _, b, _, rfl, i, hi, j, hj, v, hv, rfl, rfl, rel⟩ + obtain ⟨x, rfl⟩ := (s.mem_carrier i).1 hi + obtain ⟨x', rfl⟩ := (s.mem_carrier j).1 hj + obtain ⟨y, rfl⟩ := (t.mem_carrier v).1 hv + exact ((s.product t).pair_mem_graph (s.product t) _ (x, y) (x', y)).2 + (Prod.ext ((s.pair_mem_graph s e x x').1 rel) rfl) + · intro hz + obtain ⟨⟨x, y⟩, eq⟩ := ((s.product t).mem_graph (s.product t) _ z).1 hz + exact ⟨ZFSet.pair (s.encode x) (t.encode y), (s.product t).encode_mem (x, y), + ZFSet.pair (s.encode (e x)) (t.encode y), (s.product t).encode_mem (e x, y), eq.symm, + s.encode x, s.encode_mem x, s.encode (e x), s.encode_mem (e x), t.encode y, t.encode_mem y, + rfl, rfl, (s.pair_mem_graph s e x (e x)).2 rfl⟩ + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {X Y : Type u} (s : Presentation X) (t : Presentation Y) + +theorem inverse_function_graph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (e : X ≃ Y) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) + (graph : s.graph t e ∈ M.sets) : t.graph s e.symm ∈ M.sets := by + rw [← s.converse_graph t e] + exact M.relationConverse_mem pairing unions powers separation hX hY graph + +theorem entryPermutationGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (e : X ≃ X) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) + (graph : s.graph s e ∈ M.sets) : entryPermutationGraph s t e ∈ M.sets := by + have product := M.prod_mem pairing unions powers separation hX hY + have bound := M.prod_mem pairing unions powers separation product product + let params := extend (s.graph s e) (extend s.carrier (extend t.carrier + (extend (ZFSet.prod s.carrier t.carrier) Fin.elim0))) + have selected := M.bounded_separation_mem separation (BoundedFormula.entryPermutationFormula 0 1 2 3 4) + params (Fin.cases graph (Fin.cases hX (Fin.cases hY (Fin.cases product (fun i => Fin.elim0 i))))) bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.entryPermutationFormula 0 1 2 3 4) + (extend z params)) (ZFSet.prod (ZFSet.prod s.carrier t.carrier) (ZFSet.prod s.carrier t.carrier)) = + entryPermutationGraph s t e := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + exact ⟨fun h => (BoundedFormula.entryPermutation_correct s t e z).1 h.2, + fun hz => ⟨(entryPermutation_injection s t e).function.1 hz, + (BoundedFormula.entryPermutation_correct s t e z).2 hz⟩⟩ + exact eq ▸ selected + +theorem graphRename_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (e : X ≃ X) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) + (graph : s.graph s e ∈ M.sets) {p : ZFSet.{u}} (hp : p ∈ M.sets) : graphRename s t e p ∈ M.sets := by + rw [graphRename_eq_image] + exact M.relationImage_mem separation hp (M.prod_mem pairing unions powers separation hX hY) + (M.entryPermutationGraph_mem s t pairing unions powers separation e hX hY graph) + +theorem smallPartialFunctions_rename + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (e : X ≃ X) (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) + (graph : s.graph s e ∈ M.sets) {N p : ZFSet.{u}} (hN : N ∈ M.sets) + (hp : p ∈ M.smallPartialFunctions s.carrier t.carrier N) : + graphRename s t e p ∈ M.smallPartialFunctions s.carrier t.carrier N := by + obtain ⟨hpM, code, small⟩ := (M.mem_smallPartialFunctions s.carrier t.carrier N p).1 hp + refine (M.mem_smallPartialFunctions s.carrier t.carrier N _).2 + ⟨M.graphRename_mem s t pairing unions powers separation e hX hY graph hpM, + graphRename_partial s t e code, ?_⟩ + rw [graphRename_eq_image] + exact M.groundEmbeddable_image pairing unions powers separation hpM + (M.prod_mem pairing unions powers separation hX hY) hN + (M.entryPermutationGraph_mem s t pairing unions powers separation e hX hY graph) + (entryPermutation_injection s t e) code.shape small + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {X Y : Type u} (s : Presentation X) (t : Presentation Y) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {N : ZFSet.{u}} (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) (hN : N ∈ M.sets) + +noncomputable def renameSmallCondition (e : X ≃ X) (graph : s.graph s e ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : + SetMembers (M.smallPartialFunctions s.carrier t.carrier N) := + SetMembers.ofMem (graphRename s t e (SetMembers.raw p)) + (M.smallPartialFunctions_rename s t pairing unions powers separation e hX hY graph hN (SetMembers.raw_mem p)) + +theorem raw_renameSmallCondition (e : X ≃ X) (graph : s.graph s e ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : + SetMembers.raw (M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph p) = + graphRename s t e (SetMembers.raw p) := SetMembers.raw_ofMem _ _ + +theorem renameSmallCondition_inverse (e : X ≃ X) + (graph : s.graph s e ∈ M.sets) (inverse : s.graph s e.symm ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : + M.renameSmallCondition s t pairing unions powers separation hX hY hN e.symm inverse + (M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph p) = p := by + apply SetMembers.raw_injective + rw [raw_renameSmallCondition, raw_renameSmallCondition] + exact graphRename_inverse s t e + (M.smallFunction_raw_properties s.carrier t.carrier N p).2.1.shape + +theorem renameSmallCondition_le_iff (e : X ≃ X) (graph : s.graph s e ∈ M.sets) + (p q : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : + letI _smallOrder := M.smallFunctionOrder s.carrier t.carrier N + M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph p ≤ + M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph q ↔ p ≤ q := by + let smallOrder := M.smallFunctionOrder s.carrier t.carrier N + rw [M.smallFunction_le_iff, M.smallFunction_le_iff, raw_renameSmallCondition, raw_renameSmallCondition] + constructor + · intro subset + have back := graphRename_mono s t e.symm subset + rw [graphRename_inverse s t e (M.smallFunction_raw_properties s.carrier t.carrier N q).2.1.shape, + graphRename_inverse s t e (M.smallFunction_raw_properties s.carrier t.carrier N p).2.1.shape] at back + exact back + · exact graphRename_mono s t e + +noncomputable def renameSmallOrderIso (e : X ≃ X) (graph : s.graph s e ∈ M.sets) : + letI _smallOrder := M.smallFunctionOrder s.carrier t.carrier N + SetMembers (M.smallPartialFunctions s.carrier t.carrier N) ≃o + SetMembers (M.smallPartialFunctions s.carrier t.carrier N) := by + letI smallOrder := M.smallFunctionOrder s.carrier t.carrier N + have inverse := M.inverse_function_graph_mem s s pairing unions powers separation e hX hX graph + exact { + toFun := M.renameSmallCondition s t pairing unions powers separation hX hY hN e graph + invFun := M.renameSmallCondition s t pairing unions powers separation hX hY hN e.symm inverse + left_inv := M.renameSmallCondition_inverse s t pairing unions powers separation hX hY hN e graph inverse + right_inv := M.renameSmallCondition_inverse s t pairing unions powers separation hX hY hN e.symm inverse graph + map_rel_iff' := fun {p q} => M.renameSmallCondition_le_iff s t pairing unions powers separation hX hY hN e graph p q } + +theorem raw_renameSmallOrderIso (e : X ≃ X) (graph : s.graph s e ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier N)) : + letI _smallOrder := M.smallFunctionOrder s.carrier t.carrier N + SetMembers.raw (M.renameSmallOrderIso s t pairing unions powers separation hX hY hN e graph p) = + graphRename s t e (SetMembers.raw p) := SetMembers.raw_ofMem _ _ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundFixation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundFixation.lean index 03ec2ff13b37a127fd01e5366b0e5a47b962de99..65a1eaf33563cbcd96a23259a95119ccf25acebc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundFixation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundFixation.lean @@ -1,165 +1,165 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentImages - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid -local notation "J" => stageOneAssignments I T -local notation "graph" => M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 -local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 -include pairing unions powers separation collection carrier order maps closed closed2 familyGround - -theorem stageOneAssignment_fixed (g : G) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) - (indexFixed : refinementIndexCode ∅ (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val = - refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : - let x := stageOneAssignment - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val - ZFSet.pair x x ∈ graph g := by - apply (M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround - g C E U Rf Rc u w index hu hw _).2 - rw [indexFixed, fixedU, fixedW] - -theorem stageOneAssignment_fixed_of_anchor_le (D : L) (g : G) - (actor : g ∈ d.principalFix D) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) (anchor : E ≤ D) - (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : - let x := stageOneAssignment - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val - ZFSet.pair x x ∈ graph g := by - obtain ⟨lower, domain, fine, coarse, _⟩ := - (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order ∅ T T2 valid familyGround C E U Rf Rc).1 index - have atE : g ∈ d.principalFix E := d.principalFix_antitone anchor actor - exact M.stageOneAssignment_fixed a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround - g C E U Rf Rc u w index hu hw - (M.niceRefinementIndex_fixed a s b d ∅ T T2 C E U.val Rf.val Rc.val - lower.le domain fine coarse g atE) fixedU fixedW - -theorem stageOneAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} - (subset : A ⊆ J) (fixed : ∀ x ∈ A, ZFSet.pair x x ∈ graph g) : image g A = A := by - have function : FunctionGraphOn J (graph g) := ⟨J, - M.stageOneAssignmentActionGraph_function a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround g⟩ - apply ZFSet.ext - intro y - constructor - · intro hy - obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy - exact (function.unique entry (fixed x hx)).symm ▸ hx - · intro hy - exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ - -theorem stageOneAssignmentImage_eq_of_anchor_le (D : L) (g : G) - (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) - (bounds : ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s), - refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → - u.val ∈ T → w.val ∈ T → - stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A → - E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w) : image g A = A := by - apply M.stageOneAssignmentImage_eq_of_fixed a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g subset - intro x hx - obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 (subset hx) - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d ∅ T T2 valid valid2 hi - let u : Name s := ⟨rawU, valid rawU hu⟩ - let w : Name s := ⟨rawW, valid rawW hw⟩ - obtain ⟨anchor, fixedU, fixedW⟩ := bounds C E U Rf Rc u w hi hu hw hx - exact M.stageOneAssignment_fixed_of_anchor_le a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround - D g actor C E U Rf Rc u w hi hu hw anchor fixedU fixedW - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid -local notation "anchors" => refinementIndexFieldGraph I b.carrier 2 - -theorem stageOneDataBounds_assignment_fixes (S mu X tuples A : ZFSet.{u}) (D : L) - (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) - (g : G) (actor : g ∈ d.principalFix D) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (member : ZFSet.pair (stageOneAssignment - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) - (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : - E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w := by - obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, edge, lower, tupleU, tupleW, boundU, boundW⟩ := - (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder anchors tuples - _ u.val w.val (b.encode D)).1 member - have same : rawE = b.encode E := - ((refinementIndexFieldGraph_entry I b.carrier - ![∅, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] 2 rawE).1 edge).2.2 - subst rawE - exact ⟨(b.pair_mem_conditionOrder E D).1 lower, - support fu hfu u tupleU boundU actor, support fw hfw w tupleW boundW actor⟩ - -variable (valid2 : ∀ z ∈ T2, IsName s z) (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -include pairing unions powers separation collection carrier order maps closed closed2 familyGround - -theorem stageOneAssignmentImage_eq_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) - (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) - (g : G) (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments I T) - (bound : ∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : - M.stageOneAssignmentImage a s b d T T2 valid valid2 g A = A := by - apply M.stageOneAssignmentImage_eq_of_anchor_le a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround D g actor subset - intro C E U Rf Rc u w _ _ _ member - exact M.stageOneDataBounds_assignment_fixes a s b d T T2 valid S mu X tuples A D support - g actor C E U Rf Rc u w (bound _ member) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentImages + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid +local notation "J" => stageOneAssignments I T +local notation "graph" => M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 +local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 +include pairing unions powers separation collection carrier order maps closed closed2 familyGround + +theorem stageOneAssignment_fixed (g : G) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) + (indexFixed : refinementIndexCode ∅ (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val = + refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : + let x := stageOneAssignment + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val + ZFSet.pair x x ∈ graph g := by + apply (M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround + g C E U Rf Rc u w index hu hw _).2 + rw [indexFixed, fixedU, fixedW] + +theorem stageOneAssignment_fixed_of_anchor_le (D : L) (g : G) + (actor : g ∈ d.principalFix D) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) (anchor : E ≤ D) + (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : + let x := stageOneAssignment + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val + ZFSet.pair x x ∈ graph g := by + obtain ⟨lower, domain, fine, coarse, _⟩ := + (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order ∅ T T2 valid familyGround C E U Rf Rc).1 index + have atE : g ∈ d.principalFix E := d.principalFix_antitone anchor actor + exact M.stageOneAssignment_fixed a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround + g C E U Rf Rc u w index hu hw + (M.niceRefinementIndex_fixed a s b d ∅ T T2 C E U.val Rf.val Rc.val + lower.le domain fine coarse g atE) fixedU fixedW + +theorem stageOneAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} + (subset : A ⊆ J) (fixed : ∀ x ∈ A, ZFSet.pair x x ∈ graph g) : image g A = A := by + have function : FunctionGraphOn J (graph g) := ⟨J, + M.stageOneAssignmentActionGraph_function a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround g⟩ + apply ZFSet.ext + intro y + constructor + · intro hy + obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy + exact (function.unique entry (fixed x hx)).symm ▸ hx + · intro hy + exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ + +theorem stageOneAssignmentImage_eq_of_anchor_le (D : L) (g : G) + (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) + (bounds : ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s), + refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → + u.val ∈ T → w.val ∈ T → + stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A → + E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w) : image g A = A := by + apply M.stageOneAssignmentImage_eq_of_fixed a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g subset + intro x hx + obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 (subset hx) + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d ∅ T T2 valid valid2 hi + let u : Name s := ⟨rawU, valid rawU hu⟩ + let w : Name s := ⟨rawW, valid rawW hw⟩ + obtain ⟨anchor, fixedU, fixedW⟩ := bounds C E U Rf Rc u w hi hu hw hx + exact M.stageOneAssignment_fixed_of_anchor_le a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround + D g actor C E U Rf Rc u w hi hu hw anchor fixedU fixedW + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid +local notation "anchors" => refinementIndexFieldGraph I b.carrier 2 + +theorem stageOneDataBounds_assignment_fixes (S mu X tuples A : ZFSet.{u}) (D : L) + (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) + (g : G) (actor : g ∈ d.principalFix D) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (member : ZFSet.pair (stageOneAssignment + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) + (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : + E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w := by + obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, edge, lower, tupleU, tupleW, boundU, boundW⟩ := + (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder anchors tuples + _ u.val w.val (b.encode D)).1 member + have same : rawE = b.encode E := + ((refinementIndexFieldGraph_entry I b.carrier + ![∅, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] 2 rawE).1 edge).2.2 + subst rawE + exact ⟨(b.pair_mem_conditionOrder E D).1 lower, + support fu hfu u tupleU boundU actor, support fw hfw w tupleW boundW actor⟩ + +variable (valid2 : ∀ z ∈ T2, IsName s z) (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +include pairing unions powers separation collection carrier order maps closed closed2 familyGround + +theorem stageOneAssignmentImage_eq_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) + (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) + (g : G) (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments I T) + (bound : ∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : + M.stageOneAssignmentImage a s b d T T2 valid valid2 g A = A := by + apply M.stageOneAssignmentImage_eq_of_anchor_le a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround D g actor subset + intro C E U Rf Rc u w _ _ _ member + exact M.stageOneDataBounds_assignment_fixes a s b d T T2 valid S mu X tuples A D support + g actor C E U Rf Rc u w (bound _ member) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundSmallFixation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundSmallFixation.lean index b8ad720fba3a7f0faa68e8cc65240aa88feaa9d5..af5ce607e875659e9558bd230d4f1a9760d15049 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundSmallFixation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneDataBoundSmallFixation.lean @@ -1,146 +1,146 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneGroundAction - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega -local notation "I" => M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid -local notation "image" => M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 - -theorem stageOneSmallAction_fixed_iff : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (smallAct).iso g q = q ↔ - a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row ∧ - image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments := by - let := smallOrder - intro g q - have decoded := M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega g q - have typed := StageOneCondition.act_eq_iff M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps - inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground - omega g ((equivShrink Condition).symm q) - constructor - · intro same - apply typed.1 - exact decoded.symm.trans (congrArg (equivShrink Condition).symm same) - · intro fields - apply (equivShrink Condition).symm.injective - exact decoded.trans (typed.2 fields) - -theorem stageOneSmallAction_fixed : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → - image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments → - (smallAct).iso g q = q := by - let := smallOrder - intro g q row assignments - exact (M.stageOneSmallAction_fixed_iff a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega g q).2 ⟨row, assignments⟩ - -theorem stageOneSmallAction_fixed_of_anchor_le (D : L) : - letI := smallOrder - ∀ (g : G) (_actor : g ∈ d.principalFix D) (q : Shrink Condition), - a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → - (∀ (C E : L) (U Rf Rc : (M.nameDomain c.pairEmpty).names) (u w : Name c.pairEmpty), - refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → - u.val ∈ T → w.val ∈ T → - stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ ((equivShrink Condition).symm q).assignments → - E ≤ D ∧ a.act c.pairEmpty g u = u ∧ a.act c.pairEmpty g w = w) → - (smallAct).iso g q = q := by - let := smallOrder - intro g actor q row bounds - apply (equivShrink Condition).symm.injective - rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega] - exact StageOneCondition.act_fixed_of_anchor_le M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps - inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground - omega D g actor ((equivShrink Condition).symm q) row bounds - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega -local notation "I" => M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid -local notation "anchors" => refinementIndexFieldGraph I b.carrier 2 - -theorem stageOneSmallAction_fixed_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) - (support : ∀ f ∈ S, ∀ u : Name c.pairEmpty, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer c.pairEmpty u) : - letI := smallOrder - ∀ (g : G) (_actor : g ∈ d.principalFix D) (q : Shrink Condition), - a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → - (∀ z ∈ ((equivShrink Condition).symm q).assignments, - ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments - I T S b.carrier mu X b.conditionOrder anchors tuples) → - (smallAct).iso g q = q := by - let := smallOrder - intro g actor q row bound - apply M.stageOneSmallAction_fixed_of_anchor_le a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega D g actor q row - intro C E U Rf Rc u w _ _ _ member - exact M.stageOneDataBounds_assignment_fixes a c.pairEmpty b d T T2 valid S mu X tuples - ((equivShrink Condition).symm q).assignments D support g actor C E U Rf Rc u w (bound _ member) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneGroundAction + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega +local notation "I" => M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid +local notation "image" => M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 + +theorem stageOneSmallAction_fixed_iff : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (smallAct).iso g q = q ↔ + a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row ∧ + image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments := by + let := smallOrder + intro g q + have decoded := M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega g q + have typed := StageOneCondition.act_eq_iff M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps + inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground + omega g ((equivShrink Condition).symm q) + constructor + · intro same + apply typed.1 + exact decoded.symm.trans (congrArg (equivShrink Condition).symm same) + · intro fields + apply (equivShrink Condition).symm.injective + exact decoded.trans (typed.2 fields) + +theorem stageOneSmallAction_fixed : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → + image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments → + (smallAct).iso g q = q := by + let := smallOrder + intro g q row assignments + exact (M.stageOneSmallAction_fixed_iff a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega g q).2 ⟨row, assignments⟩ + +theorem stageOneSmallAction_fixed_of_anchor_le (D : L) : + letI := smallOrder + ∀ (g : G) (_actor : g ∈ d.principalFix D) (q : Shrink Condition), + a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → + (∀ (C E : L) (U Rf Rc : (M.nameDomain c.pairEmpty).names) (u w : Name c.pairEmpty), + refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → + u.val ∈ T → w.val ∈ T → + stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ ((equivShrink Condition).symm q).assignments → + E ≤ D ∧ a.act c.pairEmpty g u = u ∧ a.act c.pairEmpty g w = w) → + (smallAct).iso g q = q := by + let := smallOrder + intro g actor q row bounds + apply (equivShrink Condition).symm.injective + rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega] + exact StageOneCondition.act_fixed_of_anchor_le M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps + inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground + omega D g actor ((equivShrink Condition).symm q) row bounds + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega +local notation "I" => M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid +local notation "anchors" => refinementIndexFieldGraph I b.carrier 2 + +theorem stageOneSmallAction_fixed_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) + (support : ∀ f ∈ S, ∀ u : Name c.pairEmpty, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer c.pairEmpty u) : + letI := smallOrder + ∀ (g : G) (_actor : g ∈ d.principalFix D) (q : Shrink Condition), + a.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → + (∀ z ∈ ((equivShrink Condition).symm q).assignments, + ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments + I T S b.carrier mu X b.conditionOrder anchors tuples) → + (smallAct).iso g q = q := by + let := smallOrder + intro g actor q row bound + apply M.stageOneSmallAction_fixed_of_anchor_le a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega D g actor q row + intro C E U Rf Rc u w _ _ _ member + exact M.stageOneDataBounds_assignment_fixes a c.pairEmpty b d T T2 valid S mu X tuples + ((equivShrink Condition).symm q).assignments D support g actor C E U Rf Rc u w (bound _ member) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneFlatConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneFlatConditions.lean index eef1021b330fc22e94daee2167edd840860a7bdd..71483bc4171342b368e33152780132e48ab0a996 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneFlatConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneFlatConditions.lean @@ -1,200 +1,200 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneSequenceProjections - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - -noncomputable def stageOneForcingOrder : ZFSet.{u} := - rowAssignmentOrder (M.stageOneForcing a c b d T T2 valid) c.carrier - (M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega) - c.conditionOrder - -theorem stageOneForcingOrder_entry (q p : P) (A D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (c.encode q) A) (ZFSet.pair (c.encode p) D) ∈ - M.stageOneForcingOrder a c b d T T2 valid ↔ - ZFSet.pair (c.encode q) A ∈ M.stageOneForcing a c b d T T2 valid ∧ - ZFSet.pair (c.encode p) D ∈ M.stageOneForcing a c b d T T2 valid ∧ q ≤ p ∧ D ⊆ A := by - rw [stageOneForcingOrder, pair_mem_rowAssignmentOrder] - constructor - · rintro ⟨hq,hp,_,_,_,_,rows,subset⟩ - exact ⟨hq,hp,(c.pair_mem_conditionOrder q p).1 rows,subset⟩ - · rintro ⟨hq,hp,rows,subset⟩ - have qFields := (M.pair_mem_stageOneConditions c.carrier _ (c.encode q) A).1 hq - have pFields := (M.pair_mem_stageOneConditions c.carrier _ (c.encode p) D).1 hp - exact ⟨hq,hp,c.encode_mem q, - (M.mem_groundSmallSubsets _ _ A).2 ⟨qFields.2.1,qFields.2.2.1,qFields.2.2.2.1⟩, - c.encode_mem p, - (M.mem_groundSmallSubsets _ _ D).2 ⟨pFields.2.1,pFields.2.2.1,pFields.2.2.2.1⟩, - (c.pair_mem_conditionOrder q p).2 rows,subset⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) - -include pairing unions powers separation carrier order nodes hT indices system in -theorem stageOneForcingOrder_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.stageOneForcingOrder a c b d T T2 valid ∈ M.sets := by - have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT - have small := M.groundSmallSubsets_mem powers separation assignments omega - exact M.rowAssignmentOrder_mem pairing unions powers separation conditions carrier small order - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid - -@[instance_reducible] -noncomputable def stageOneConditionSmallOrder : PartialOrder (Shrink Condition) where - le p q := (equivShrink Condition).symm p ≤ (equivShrink Condition).symm q - le_refl _ := le_rfl - le_trans _ _ _ first second := first.trans second - le_antisymm _ _ first second := (equivShrink Condition).symm.injective (le_antisymm first second) - -noncomputable def stageOneConditionOrderIso : - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - Condition ≃o Shrink Condition := by - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - exact { - toEquiv := equivShrink Condition - map_rel_iff' := by - intro p q - change (equivShrink Condition).symm (equivShrink Condition p) ≤ - (equivShrink Condition).symm (equivShrink Condition q) ↔ p ≤ q - simp only [Equiv.symm_apply_apply] } - -@[instance_reducible] -noncomputable def stageOneConditionSmallTop : - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - OrderTop (Shrink Condition) := by - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - exact { - top := equivShrink Condition ⊤ - le_top p := by - change (equivShrink Condition).symm p ≤ (equivShrink Condition).symm (equivShrink Condition ⊤) - rw [Equiv.symm_apply_apply] - exact le_top } - -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection - -theorem stageOneConditionOrder_graph : - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - (pres).conditionOrder = M.stageOneForcingOrder a c b d T T2 valid := by - let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - apply ZFSet.ext - intro z - rw [Presentation.conditionOrder, Presentation.mem_subset] - constructor - · rintro ⟨⟨q,p⟩, below, rfl⟩ - let q' := (equivShrink Condition).symm q - let p' := (equivShrink Condition).symm p - exact (M.stageOneForcingOrder_entry a c b d T T2 valid q'.row p'.row q'.assignments p'.assignments).2 - ⟨(pres).encode_mem q, (pres).encode_mem p, below.1, below.2⟩ - · intro member - have bound := (mem_rowAssignmentOrder _ _ _ _ z).1 member - obtain ⟨rawQ, hq, rawP, hp, equal⟩ := ZFSet.mem_prod.1 bound.1 - obtain ⟨q, eqQ⟩ := ((pres).mem_carrier rawQ).1 hq - obtain ⟨p, eqP⟩ := ((pres).mem_carrier rawP).1 hp - have entries : ZFSet.pair ((pres).encode q) ((pres).encode p) ∈ - M.stageOneForcingOrder a c b d T T2 valid := by - rw [eqQ, eqP, ← equal] - exact member - let q' := (equivShrink Condition).symm q - let p' := (equivShrink Condition).symm p - have parts := (M.stageOneForcingOrder_entry a c b d T T2 valid - q'.row p'.row q'.assignments p'.assignments).1 entries - refine ⟨(q,p), ⟨parts.2.2.1, parts.2.2.2⟩, ?_⟩ - change ZFSet.pair ((pres).encode q) ((pres).encode p) = z - rw [eqQ, eqP] - exact equal.symm - -theorem stageOneConditionOrder_mem - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - (pres).conditionOrder ∈ M.sets := by - let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection - rw [M.stageOneConditionOrder_graph a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] - exact M.stageOneForcingOrder_mem a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system nodeOrder omega - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid - -noncomputable def stageOneFlatConditionSystem : - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - FlatConditionSystem M c - (M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection) - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) := by - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - exact { - row := M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - assignments := fun q => ((equivShrink Condition).symm q).assignments - encode := fun _ => rfl - le_iff := fun _ _ => Iff.rfl - assignments_mem := fun q => ((equivShrink Condition).symm q).assignments_mem } - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneSequenceProjections + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + +noncomputable def stageOneForcingOrder : ZFSet.{u} := + rowAssignmentOrder (M.stageOneForcing a c b d T T2 valid) c.carrier + (M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega) + c.conditionOrder + +theorem stageOneForcingOrder_entry (q p : P) (A D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (c.encode q) A) (ZFSet.pair (c.encode p) D) ∈ + M.stageOneForcingOrder a c b d T T2 valid ↔ + ZFSet.pair (c.encode q) A ∈ M.stageOneForcing a c b d T T2 valid ∧ + ZFSet.pair (c.encode p) D ∈ M.stageOneForcing a c b d T T2 valid ∧ q ≤ p ∧ D ⊆ A := by + rw [stageOneForcingOrder, pair_mem_rowAssignmentOrder] + constructor + · rintro ⟨hq,hp,_,_,_,_,rows,subset⟩ + exact ⟨hq,hp,(c.pair_mem_conditionOrder q p).1 rows,subset⟩ + · rintro ⟨hq,hp,rows,subset⟩ + have qFields := (M.pair_mem_stageOneConditions c.carrier _ (c.encode q) A).1 hq + have pFields := (M.pair_mem_stageOneConditions c.carrier _ (c.encode p) D).1 hp + exact ⟨hq,hp,c.encode_mem q, + (M.mem_groundSmallSubsets _ _ A).2 ⟨qFields.2.1,qFields.2.2.1,qFields.2.2.2.1⟩, + c.encode_mem p, + (M.mem_groundSmallSubsets _ _ D).2 ⟨pFields.2.1,pFields.2.2.1,pFields.2.2.2.1⟩, + (c.pair_mem_conditionOrder q p).2 rows,subset⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) + +include pairing unions powers separation carrier order nodes hT indices system in +theorem stageOneForcingOrder_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.stageOneForcingOrder a c b d T T2 valid ∈ M.sets := by + have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT + have small := M.groundSmallSubsets_mem powers separation assignments omega + exact M.rowAssignmentOrder_mem pairing unions powers separation conditions carrier small order + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid + +@[instance_reducible] +noncomputable def stageOneConditionSmallOrder : PartialOrder (Shrink Condition) where + le p q := (equivShrink Condition).symm p ≤ (equivShrink Condition).symm q + le_refl _ := le_rfl + le_trans _ _ _ first second := first.trans second + le_antisymm _ _ first second := (equivShrink Condition).symm.injective (le_antisymm first second) + +noncomputable def stageOneConditionOrderIso : + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + Condition ≃o Shrink Condition := by + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + exact { + toEquiv := equivShrink Condition + map_rel_iff' := by + intro p q + change (equivShrink Condition).symm (equivShrink Condition p) ≤ + (equivShrink Condition).symm (equivShrink Condition q) ↔ p ≤ q + simp only [Equiv.symm_apply_apply] } + +@[instance_reducible] +noncomputable def stageOneConditionSmallTop : + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + OrderTop (Shrink Condition) := by + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + exact { + top := equivShrink Condition ⊤ + le_top p := by + change (equivShrink Condition).symm p ≤ (equivShrink Condition).symm (equivShrink Condition ⊤) + rw [Equiv.symm_apply_apply] + exact le_top } + +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection + +theorem stageOneConditionOrder_graph : + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + (pres).conditionOrder = M.stageOneForcingOrder a c b d T T2 valid := by + let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + apply ZFSet.ext + intro z + rw [Presentation.conditionOrder, Presentation.mem_subset] + constructor + · rintro ⟨⟨q,p⟩, below, rfl⟩ + let q' := (equivShrink Condition).symm q + let p' := (equivShrink Condition).symm p + exact (M.stageOneForcingOrder_entry a c b d T T2 valid q'.row p'.row q'.assignments p'.assignments).2 + ⟨(pres).encode_mem q, (pres).encode_mem p, below.1, below.2⟩ + · intro member + have bound := (mem_rowAssignmentOrder _ _ _ _ z).1 member + obtain ⟨rawQ, hq, rawP, hp, equal⟩ := ZFSet.mem_prod.1 bound.1 + obtain ⟨q, eqQ⟩ := ((pres).mem_carrier rawQ).1 hq + obtain ⟨p, eqP⟩ := ((pres).mem_carrier rawP).1 hp + have entries : ZFSet.pair ((pres).encode q) ((pres).encode p) ∈ + M.stageOneForcingOrder a c b d T T2 valid := by + rw [eqQ, eqP, ← equal] + exact member + let q' := (equivShrink Condition).symm q + let p' := (equivShrink Condition).symm p + have parts := (M.stageOneForcingOrder_entry a c b d T T2 valid + q'.row p'.row q'.assignments p'.assignments).1 entries + refine ⟨(q,p), ⟨parts.2.2.1, parts.2.2.2⟩, ?_⟩ + change ZFSet.pair ((pres).encode q) ((pres).encode p) = z + rw [eqQ, eqP] + exact equal.symm + +theorem stageOneConditionOrder_mem + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + (pres).conditionOrder ∈ M.sets := by + let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation carrier order hT base directed system collection + rw [M.stageOneConditionOrder_graph a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] + exact M.stageOneForcingOrder_mem a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system nodeOrder omega + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid + +noncomputable def stageOneFlatConditionSystem : + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + FlatConditionSystem M c + (M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection) + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) := by + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + exact { + row := M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + assignments := fun q => ((equivShrink Condition).symm q).assignments + encode := fun _ => rfl + le_iff := fun _ _ => Iff.rfl + assignments_mem := fun q => ((equivShrink Condition).symm q).assignments_mem } + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGenericProjection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGenericProjection.lean index 029b55ce0ddcebf39eb671f8a0005da9c8f082e4..80b5d67d5da12eded7ed25de20b9a180cad225c5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGenericProjection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGenericProjection.lean @@ -1,83 +1,83 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneProjectedFilters - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid - -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 - -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - -local notation "row" => M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - -theorem stageOnePairedRowGraph_mem - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - (pres).graph c.pairEmpty row ∈ M.sets := by - have target := M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection nodeOrder omega - have original := M.stageOneRowGraph_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - rw [M.stageOneRowGraph_eq_graph a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] at original - have composed := M.relationCompose_mem pairing unions powers separation target carrier pairedCarrier original - (M.pairEmpty_forwardGraph_mem pairing unions powers separation c carrier) - rw [(pres).relationCompose_graph c c.pairEmpty row id] at composed - exact composed - -theorem stageOneProjectedFilter_codedGeneric - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)), H.GenericFor (M.codedFamily (pres)) → - (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT - base directed system collection H).GenericFor (M.codedFamily c.pairEmpty) := by - let instProjectedFilterSmallOrder := smallOrder - intro H generic E member dense - obtain ⟨X, ground, rfl⟩ := member - have target := M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection nodeOrder omega - have graph := M.stageOnePairedRowGraph_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection nodeOrder omega - have preimage := M.presentedPreimage_mem (pres) c.pairEmpty row pairing unions powers separation - target pairedCarrier graph ground - have densePreimage := M.stageOneSmall_dense_row_preimage a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection dense - obtain ⟨q, hq, value⟩ := M.generic_meets_coded_dense (pres) H generic preimage densePreimage - exact ⟨row q, - (M.stageOneProjectedFilter_row a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection H (row q)).2 ⟨q, hq, rfl⟩, value⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneProjectedFilters + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid + +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 + +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + +local notation "row" => M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + +theorem stageOnePairedRowGraph_mem + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + (pres).graph c.pairEmpty row ∈ M.sets := by + have target := M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection nodeOrder omega + have original := M.stageOneRowGraph_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + rw [M.stageOneRowGraph_eq_graph a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] at original + have composed := M.relationCompose_mem pairing unions powers separation target carrier pairedCarrier original + (M.pairEmpty_forwardGraph_mem pairing unions powers separation c carrier) + rw [(pres).relationCompose_graph c c.pairEmpty row id] at composed + exact composed + +theorem stageOneProjectedFilter_codedGeneric + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)), H.GenericFor (M.codedFamily (pres)) → + (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT + base directed system collection H).GenericFor (M.codedFamily c.pairEmpty) := by + let instProjectedFilterSmallOrder := smallOrder + intro H generic E member dense + obtain ⟨X, ground, rfl⟩ := member + have target := M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection nodeOrder omega + have graph := M.stageOnePairedRowGraph_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection nodeOrder omega + have preimage := M.presentedPreimage_mem (pres) c.pairEmpty row pairing unions powers separation + target pairedCarrier graph ground + have densePreimage := M.stageOneSmall_dense_row_preimage a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection dense + obtain ⟨q, hq, value⟩ := M.generic_meets_coded_dense (pres) H generic preimage densePreimage + exact ⟨row q, + (M.stageOneProjectedFilter_row a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection H (row q)).2 ⟨q, hq, rfl⟩, value⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGroundAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGroundAction.lean index 5666f4a8fac6ed3c07f4c2e36952902f3c846b76..38bde936b7219c7cab31bd4283aaf812d69d9dde 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGroundAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneGroundAction.lean @@ -1,642 +1,642 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneDataBoundFixation -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneFlatConditions - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid -local notation "J" => stageOneAssignments I T -local notation "graph" => M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 -local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 -local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps -include pairing unions powers separation collection carrier order maps closed closed2 familyGround - -theorem stageOneAssignmentActionGraph_one {x : ZFSet.{u}} (hx : x ∈ J) (y : ZFSet.{u}) : - ZFSet.pair x y ∈ graph 1 ↔ y = x := by - obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d ∅ T T2 valid valid2 hi - have termOne : (a.act s 1 ⟨u, valid u hu⟩).val = u := - congrArg (fun term : Name s => term.val) (a.act_one s ⟨u, valid u hu⟩) - have wordOne : (a.act s 1 ⟨w, valid w hw⟩).val = w := - congrArg (fun term : Name s => term.val) (a.act_one s ⟨w, valid w hw⟩) - simpa only [d.one, a.act_one, termOne, wordOne] using - M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround 1 C E U Rf Rc - ⟨u, valid u hu⟩ ⟨w, valid w hw⟩ hi hu hw y - -theorem stageOneAssignmentActionGraph_mul (g h : G) {x : ZFSet.{u}} (hx : x ∈ J) (z : ZFSet.{u}) : - ZFSet.pair x z ∈ graph (g * h) ↔ - ∃ y ∈ J, ZFSet.pair x y ∈ graph h ∧ ZFSet.pair y z ∈ graph g := by - obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d ∅ T T2 valid valid2 hi - let nu : Name s := ⟨u, valid u hu⟩ - let nw : Name s := ⟨w, valid w hw⟩ - have indexH := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps ∅ T T2 valid closed closed2 familyGround h C E U Rf Rc).mpr hi - let y := stageOneAssignment (refinementIndexCode ∅ (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val) - (a.act s h nu).val (a.act s h nw).val - have hy : y ∈ J := (stageOneAssignment_mem_assignments I T _ _ _).2 - ⟨indexH, closed h nu hu, closed h nw hw⟩ - have atH := M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround h C E U Rf Rc nu nw hi hu hw - have atG := M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround g - (d.iso h C) (d.iso h E) (move h U) (move h Rf) (move h Rc) - (a.act s h nu) (a.act s h nw) indexH (closed h nu hu) (closed h nw hw) z - have atMul := M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround (g * h) - C E U Rf Rc nu nw hi hu hw z - simp only [M.stageOneNameAction_val] at atG - have same : ZFSet.pair (stageOneAssignment - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u w) z ∈ graph (g * h) ↔ - ZFSet.pair y z ∈ graph g := by - dsimp only [y] - rw [atMul, atG] - simp only [d.mul, a.act_mul] - constructor - · intro entry - exact ⟨y, hy, (atH y).mpr rfl, same.mp entry⟩ - · rintro ⟨y', _, eh, eg⟩ - have equal : y' = y := (atH y').mp eh - exact same.mpr (equal ▸ eg) - -theorem stageOneAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by - apply ZFSet.ext - intro y - constructor - · intro hy - obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph 1) y).1 hy - exact (M.stageOneAssignmentActionGraph_one a s b d T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround (subset hx) y).mp entry ▸ hx - · intro hy - exact (mem_relationImage A J (graph 1) y).2 ⟨subset hy, y, hy, - (M.stageOneAssignmentActionGraph_one a s b d T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround (subset hy) y).mpr rfl⟩ - -theorem stageOneAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : - image (g * h) A = image g (image h A) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨hz, x, hx, entry⟩ := (mem_relationImage A J (graph (g * h)) z).1 hz - obtain ⟨y, hy, eh, eg⟩ := - (M.stageOneAssignmentActionGraph_mul a s b d T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mp entry - exact (mem_relationImage (image h A) J (graph g) z).2 - ⟨hz, y, (mem_relationImage A J (graph h) y).2 ⟨hy, x, hx, eh⟩, eg⟩ - · intro hz - obtain ⟨hz, y, hy, eg⟩ := (mem_relationImage (image h A) J (graph g) z).1 hz - obtain ⟨hy, x, hx, eh⟩ := (mem_relationImage A J (graph h) y).1 hy - exact (mem_relationImage A J (graph (g * h)) z).2 ⟨hz, x, hx, - (M.stageOneAssignmentActionGraph_mul a s b d T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mpr ⟨y, hy, eh, eg⟩⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - -include maps closed closed2 familyGround in -theorem stageOneTests_image_iff (g : G) (A : ZFSet.{u}) (p : P) : - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 (M.stageOneAssignmentImage a s b d T T2 valid valid2 g A) (a.iso g p) ↔ - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 A p := by - have term (w : (M.nameDomain s).names) : (move g w).val.val ∈ T ↔ w.val.val ∈ T := by - constructor - · intro member - have original := closed g⁻¹ (a.act s g w.val) member - simpa only [a.act_inv_left] using original - · exact closed g w.val - have index := M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps ∅ T T2 valid closed closed2 familyGround g - have image := M.stageOneAssignmentImage_entry a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g - have single := M.stageOneSingleTests_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed b d base directed system g - have collision := M.stageOneCollisionTest_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed g - constructor - · intro tests C E U Rf Rc - dsimp only - intro member - obtain ⟨hs, hc⟩ := tests (d.iso g C) (d.iso g E) (move g U) (move g Rf) (move g Rc) - ((index C E U Rf Rc).mpr member) - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - exact (single C E U Rf Rc u w p).mp - (hs (move g u) (move g w) ((term u).mpr hu) ((term w).mpr hw) - ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry)) - · intro u u' w w' hu hu' hw hw' entry entry' - exact (collision Rf Rc u u' w w' p).mp - (hc (move g u) (move g u') (move g w) (move g w') - ((term u).mpr hu) ((term u').mpr hu') ((term w).mpr hw) ((term w').mpr hw') - ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry) - ((image C E U Rf Rc u'.val w'.val member hu' hw' A).mpr entry')) - · intro tests C E U Rf Rc - obtain ⟨C, rfl⟩ := (d.iso g).surjective C - obtain ⟨E, rfl⟩ := (d.iso g).surjective E - obtain ⟨U, rfl⟩ := (move g).surjective U - obtain ⟨Rf, rfl⟩ := (move g).surjective Rf - obtain ⟨Rc, rfl⟩ := (move g).surjective Rc - dsimp only - intro member - have old := (index C E U Rf Rc).mp member - obtain ⟨hs, hc⟩ := tests C E U Rf Rc old - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - obtain ⟨u, rfl⟩ := (move g).surjective u - obtain ⟨w, rfl⟩ := (move g).surjective w - have hu := (term u).mp hu - have hw := (term w).mp hw - exact (single C E U Rf Rc u w p).mpr - (hs u w hu hw ((image C E U Rf Rc u.val w.val old hu hw A).mp entry)) - · intro u u' w w' hu hu' hw hw' entry entry' - obtain ⟨u, rfl⟩ := (move g).surjective u - obtain ⟨u', rfl⟩ := (move g).surjective u' - obtain ⟨w, rfl⟩ := (move g).surjective w - obtain ⟨w', rfl⟩ := (move g).surjective w' - have hu := (term u).mp hu - have hu' := (term u').mp hu' - have hw := (term w).mp hw - have hw' := (term w').mp hw' - exact (collision Rf Rc u u' w w' p).mpr - (hc u u' w w' hu hu' hw hw' - ((image C E U Rf Rc u.val w.val old hu hw A).mp entry) - ((image C E U Rf Rc u'.val w'.val old hu' hw' A).mp entry')) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) -local notation "Q" => M.stageOneForcing a c b d T T2 valid -local notation "J" => stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T -local notation "B" => M.groundSmallSubsets J ZFSet.omega -local notation "assignmentFamily" => M.stageOneAssignmentActionFamily a c.pairEmpty t b d T T2 valid valid2 - -noncomputable def stageOneFullActionGraph : ZFSet.{u} := - rowAssignmentActionGraph t.carrier Q c.carrier B J (a.conditionMapFamily c t) assignmentFamily - -theorem stageOneFullActionGraph_entry (g : G) (p q : P) (A D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode p) A)) (ZFSet.pair (c.encode q) D) ∈ - M.stageOneFullActionGraph a c t b d T T2 valid valid2 ↔ - ZFSet.pair (c.encode p) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ a.iso g p = q ∧ - D = M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g A := by - rw [stageOneFullActionGraph, pair_mem_rowAssignmentActionGraph] - constructor - · rintro ⟨_,source,target,_,_,_,_,rf,af,indexed,row,indexedA,image⟩ - have rowEq := (a.pair_mem_conditionMapFamily c t g rf).1 indexed - have assignmentEq := (M.pair_mem_stageOneAssignmentActionFamily a c.pairEmpty t b d - T T2 valid valid2 g af).1 indexedA - rw [assignmentEq] at image - exact ⟨source,target,(c.pair_mem_graph c (a.iso g) p q).1 (rowEq ▸ row),image⟩ - · rintro ⟨source,target,moved,image⟩ - have sourceBound := ZFSet.pair_mem_prod.1 ((M.mem_stageOneConditions c.carrier _ _).1 source).1 - have targetBound := ZFSet.pair_mem_prod.1 ((M.mem_stageOneConditions c.carrier _ _).1 target).1 - exact ⟨t.encode_mem g,source,target,sourceBound.1,sourceBound.2,targetBound.1,targetBound.2, - _,_,(a.pair_mem_conditionMapFamily c t g _).2 rfl, - (c.pair_mem_graph c (a.iso g) p q).2 moved, - (M.pair_mem_stageOneAssignmentActionFamily a c.pairEmpty t b d T T2 valid valid2 g _).2 rfl,image⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -include pairing unions powers separation carrier order nodes hT indices system - -theorem stageOneFullActionGraph_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (group : t.carrier ∈ M.sets) (rowMaps : a.conditionMapFamily c t ∈ M.sets) - (assignmentMaps : assignmentFamily ∈ M.sets) : - M.stageOneFullActionGraph a c t b d T T2 valid valid2 ∈ M.sets := by - have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT - exact M.rowAssignmentActionGraph_mem pairing unions powers separation group conditions carrier - (M.groundSmallSubsets_mem powers separation assignments omega) assignments rowMaps assignmentMaps - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) -variable (valid2 : ∀ z ∈ T2, IsName s z) (t : Presentation G) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (hT2 : T2 ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d ∅ T T2 valid ∈ M.sets) -variable (omega : ZFSet.omega ∈ M.sets) - -namespace StageOneCondition -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 -local notation "J" => stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T -local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 - -noncomputable def act (g : G) (p : Condition) : Condition where - row := a.iso g p.row - assignments := image g p.assignments - assignments_mem := M.stageOneAssignmentImage_small a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround - nodeMaps hT hT2 indexGround omega g p.assignments_mem - tests := (M.stageOneTests_image_iff a s b d T T2 valid valid2 t pairing unions powers separation - collection carrier order maps hT closed closed2 familyGround base directed system g p.assignments p.row).mpr p.tests - -local notation "act'" => act M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega - -theorem act_fields (g : G) (p : Condition) : - (act' g p).row = a.iso g p.row ∧ (act' g p).assignments = image g p.assignments := ⟨rfl, rfl⟩ - -theorem act_one (p : Condition) : act' 1 p = p := by - apply ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 - · exact a.one p.row - · exact M.stageOneAssignmentImage_one a s b d T T2 valid valid2 t pairing unions powers separation - collection carrier order maps closed closed2 familyGround - ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).mp p.assignments_mem).2.1 - -theorem act_mul (g h : G) (p : Condition) : act' (g * h) p = act' g (act' h p) := by - apply ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 - · exact a.mul g h p.row - · exact M.stageOneAssignmentImage_mul a s b d T T2 valid valid2 t pairing unions powers separation - collection carrier order maps closed closed2 familyGround g h - ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).mp p.assignments_mem).2.1 - -theorem act_inv_left (g : G) (p : Condition) : act' g⁻¹ (act' g p) = p := by - rw [← act_mul M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega, - inv_mul_cancel, act_one] - -theorem act_inv_right (g : G) (p : Condition) : act' g (act' g⁻¹ p) = p := by - rw [← act_mul M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega, - mul_inv_cancel, act_one] - -theorem act_le_iff (g : G) (p q : Condition) : act' g p ≤ act' g q ↔ p ≤ q := by - have mono : ∀ g (p q : Condition), p ≤ q → act' g p ≤ act' g q := by - intro g p q below - exact ⟨(a.iso g).monotone below.1, - M.stageOneAssignmentImage_mono a s b d T T2 valid valid2 g below.2⟩ - constructor - · intro below - have back := mono g⁻¹ _ _ below - simpa only [act_inv_left] using back - · exact mono g p q - -noncomputable def actOrderIso (g : G) : Condition ≃o Condition where - toFun := act' g - invFun := act' g⁻¹ - left_inv := act_inv_left M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega g - right_inv := act_inv_right M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega g - map_rel_iff' := act_le_iff M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega g _ _ - -noncomputable def posetAction : PosetAction G Condition where - iso := actOrderIso M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega - one := act_one M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega - mul := act_mul M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega - -end StageOneCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "typedAct" => StageOneCondition.act M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps - inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega - -noncomputable def stageOneSmallAction : - letI := smallOrder - PosetAction G (Shrink Condition) := by - letI := smallOrder - let original := StageOneCondition.posetAction M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps - inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega - let e := M.stageOneConditionOrderIso a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - exact { - iso := fun g => (e.symm.trans (original.iso g)).trans e - one := by - intro q - change e (original.iso 1 (e.symm q)) = q - rw [original.one, e.apply_symm_apply] - mul := by - intro g h q - change e (original.iso (g * h) (e.symm q)) = - e (original.iso g (e.symm (e (original.iso h (e.symm q))))) - rw [e.symm_apply_apply, original.mul] } - -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega - -theorem stageOneSmallAction_decode : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (equivShrink Condition).symm ((smallAct).iso g q) = - typedAct g ((equivShrink Condition).symm q) := by - let := smallOrder - intro g q - change (equivShrink Condition).symm - (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ - exact (equivShrink Condition).symm_apply_apply _ - -theorem stageOneSmallAction_encode : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (pres).encode ((smallAct).iso g q) = - ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm q).row)) - (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g - ((equivShrink Condition).symm q).assignments) := by - let := smallOrder - intro g q - change (pres).encode - (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ - exact M.stageOneConditionPresentation_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection _ - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) -variable (valid2 : ∀ z ∈ T2, IsName s z) (t : Presentation G) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (hT2 : T2 ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -variable (indexGround : M.niceRefinementIndices a s b d ∅ T T2 valid ∈ M.sets) -variable (omega : ZFSet.omega ∈ M.sets) - -namespace StageOneCondition -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 -local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid -local notation "J" => stageOneAssignments I T -local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 -local notation "act'" => act M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega -local notation "action" => posetAction M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega - -theorem act_eq_iff (g : G) (p : Condition) : - act' g p = p ↔ a.iso g p.row = p.row ∧ image g p.assignments = p.assignments := by - constructor - · intro same - exact ⟨congrArg (fun q : Condition => q.row) same, - congrArg (fun q : Condition => q.assignments) same⟩ - · rintro ⟨row, assignments⟩ - exact ext M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 row assignments - -theorem posetAction_fixed (g : G) (p : Condition) - (row : a.iso g p.row = p.row) (assignments : image g p.assignments = p.assignments) : - (action).iso g p = p := - (act_eq_iff M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround - indexGround omega g p).2 ⟨row, assignments⟩ - -theorem act_fixed_of_anchor_le (D : L) (g : G) (actor : g ∈ d.principalFix D) (p : Condition) - (row : a.iso g p.row = p.row) - (bounds : ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s), - refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → - u.val ∈ T → w.val ∈ T → - stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ p.assignments → - E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w) : act' g p = p := by - apply (act_eq_iff M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround - indexGround omega g p).2 - exact ⟨row, M.stageOneAssignmentImage_eq_of_anchor_le a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround - D g actor ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 bounds⟩ - -end StageOneCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "typedAct" => StageOneCondition.act M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps - inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega - -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega -local notation "fullGraph" => M.stageOneFullActionGraph a c t b d T T2 valid valid2 - -theorem stageOneSmallActionGraph_eq : - letI := smallOrder - (smallAct).actionGraph (pres) t = fullGraph := by - let := smallOrder - have encoded (g : G) (x : Shrink Condition) := M.stageOneSmallAction_encode a c b d T T2 valid - pairing unions powers separation carrier order nodes hT indices base directed system collection t inputs hT2 omega g x - have meaning (g : G) (x y : Shrink Condition) : - ZFSet.pair (ZFSet.pair (t.encode g) ((pres).encode x)) ((pres).encode y) ∈ fullGraph ↔ - (smallAct).iso g x = y := by - change ZFSet.pair (ZFSet.pair (t.encode g) - (ZFSet.pair (c.encode ((equivShrink Condition).symm x).row) - ((equivShrink Condition).symm x).assignments)) - (ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments) ∈ fullGraph ↔ _ - rw [M.stageOneFullActionGraph_entry] - constructor - · rintro ⟨_,_,rowEqual,assignmentEqual⟩ - apply (pres).injective - rw [encoded] - change ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm x).row)) - (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g - ((equivShrink Condition).symm x).assignments) = - ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments - rw [rowEqual, assignmentEqual] - · intro equal - have codeEqual := congrArg (pres).encode equal - rw [encoded] at codeEqual - change ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm x).row)) - (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g - ((equivShrink Condition).symm x).assignments) = - ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments at codeEqual - obtain ⟨rowEqual,assignmentEqual⟩ := ZFSet.pair_injective codeEqual - exact ⟨(pres).encode_mem x,(pres).encode_mem y,c.injective rowEqual,assignmentEqual.symm⟩ - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨⟨g,x⟩,rfl⟩ := ((t.product (pres)).mem_graph (pres) (fun gx => (smallAct).iso gx.1 gx.2) z).1 member - exact (meaning g x ((smallAct).iso g x)).2 rfl - · intro member - have boundMember := member - unfold stageOneFullActionGraph rowAssignmentActionGraph at boundMember - have bounds : z ∈ ZFSet.prod (ZFSet.prod t.carrier (pres).carrier) (pres).carrier := - (ZFSet.mem_sep.1 boundMember).1 - obtain ⟨source,hSource,y,hy,rfl⟩ := ZFSet.mem_prod.1 bounds - obtain ⟨g,hg,x,hx,rfl⟩ := ZFSet.mem_prod.1 hSource - obtain ⟨g,rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨x,rfl⟩ := ((pres).mem_carrier x).1 hx - obtain ⟨y,rfl⟩ := ((pres).mem_carrier y).1 hy - exact ((smallAct).triple_mem_actionGraph (pres) t g x y).2 ((meaning g x y).1 member) - -variable (nodeOrder : b.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (originalMaps : a.conditionMapFamily c t ∈ M.sets) -include nodeOrder group originalMaps - -theorem stageOneSmallActionGraph_mem : - letI := smallOrder - (smallAct).actionGraph (pres) t ∈ M.sets := by - let := smallOrder - rw [M.stageOneSmallActionGraph_eq a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega] - have assignmentMaps := M.stageOneAssignmentActionFamily_mem_of_inputs a c.pairEmpty t b d T T2 valid valid2 - pairing unions powers separation collection pairedCarrier group nodes pairedOrder inputs.condition_maps - inputs.node_maps hT hT2 indices.index_ground inputs.terms_closed inputs.pairs_closed inputs.family_ground - exact M.stageOneFullActionGraph_mem a c t b d T T2 valid valid2 pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega group originalMaps assignmentMaps - -theorem stageOneSmallActionMapFamily_mem : - letI := smallOrder - (smallAct).conditionMapFamily (pres) t ∈ M.sets := by - let := smallOrder - exact M.conditionMapFamily_mem_of_actionGraph (smallAct) (pres) t pairing unions powers separation collection - (M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection nodeOrder omega) group - (M.stageOneSmallActionGraph_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega nodeOrder group originalMaps) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneDataBoundFixation +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneFlatConditions + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid +local notation "J" => stageOneAssignments I T +local notation "graph" => M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 +local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 +local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps +include pairing unions powers separation collection carrier order maps closed closed2 familyGround + +theorem stageOneAssignmentActionGraph_one {x : ZFSet.{u}} (hx : x ∈ J) (y : ZFSet.{u}) : + ZFSet.pair x y ∈ graph 1 ↔ y = x := by + obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d ∅ T T2 valid valid2 hi + have termOne : (a.act s 1 ⟨u, valid u hu⟩).val = u := + congrArg (fun term : Name s => term.val) (a.act_one s ⟨u, valid u hu⟩) + have wordOne : (a.act s 1 ⟨w, valid w hw⟩).val = w := + congrArg (fun term : Name s => term.val) (a.act_one s ⟨w, valid w hw⟩) + simpa only [d.one, a.act_one, termOne, wordOne] using + M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround 1 C E U Rf Rc + ⟨u, valid u hu⟩ ⟨w, valid w hw⟩ hi hu hw y + +theorem stageOneAssignmentActionGraph_mul (g h : G) {x : ZFSet.{u}} (hx : x ∈ J) (z : ZFSet.{u}) : + ZFSet.pair x z ∈ graph (g * h) ↔ + ∃ y ∈ J, ZFSet.pair x y ∈ graph h ∧ ZFSet.pair y z ∈ graph g := by + obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d ∅ T T2 valid valid2 hi + let nu : Name s := ⟨u, valid u hu⟩ + let nw : Name s := ⟨w, valid w hw⟩ + have indexH := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps ∅ T T2 valid closed closed2 familyGround h C E U Rf Rc).mpr hi + let y := stageOneAssignment (refinementIndexCode ∅ (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val) + (a.act s h nu).val (a.act s h nw).val + have hy : y ∈ J := (stageOneAssignment_mem_assignments I T _ _ _).2 + ⟨indexH, closed h nu hu, closed h nw hw⟩ + have atH := M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround h C E U Rf Rc nu nw hi hu hw + have atG := M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround g + (d.iso h C) (d.iso h E) (move h U) (move h Rf) (move h Rc) + (a.act s h nu) (a.act s h nw) indexH (closed h nu hu) (closed h nw hw) z + have atMul := M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround (g * h) + C E U Rf Rc nu nw hi hu hw z + simp only [M.stageOneNameAction_val] at atG + have same : ZFSet.pair (stageOneAssignment + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u w) z ∈ graph (g * h) ↔ + ZFSet.pair y z ∈ graph g := by + dsimp only [y] + rw [atMul, atG] + simp only [d.mul, a.act_mul] + constructor + · intro entry + exact ⟨y, hy, (atH y).mpr rfl, same.mp entry⟩ + · rintro ⟨y', _, eh, eg⟩ + have equal : y' = y := (atH y').mp eh + exact same.mpr (equal ▸ eg) + +theorem stageOneAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by + apply ZFSet.ext + intro y + constructor + · intro hy + obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph 1) y).1 hy + exact (M.stageOneAssignmentActionGraph_one a s b d T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround (subset hx) y).mp entry ▸ hx + · intro hy + exact (mem_relationImage A J (graph 1) y).2 ⟨subset hy, y, hy, + (M.stageOneAssignmentActionGraph_one a s b d T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround (subset hy) y).mpr rfl⟩ + +theorem stageOneAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : + image (g * h) A = image g (image h A) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨hz, x, hx, entry⟩ := (mem_relationImage A J (graph (g * h)) z).1 hz + obtain ⟨y, hy, eh, eg⟩ := + (M.stageOneAssignmentActionGraph_mul a s b d T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mp entry + exact (mem_relationImage (image h A) J (graph g) z).2 + ⟨hz, y, (mem_relationImage A J (graph h) y).2 ⟨hy, x, hx, eh⟩, eg⟩ + · intro hz + obtain ⟨hz, y, hy, eg⟩ := (mem_relationImage (image h A) J (graph g) z).1 hz + obtain ⟨hy, x, hx, eh⟩ := (mem_relationImage A J (graph h) y).1 hy + exact (mem_relationImage A J (graph (g * h)) z).2 ⟨hz, x, hx, + (M.stageOneAssignmentActionGraph_mul a s b d T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mpr ⟨y, hy, eh, eg⟩⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + +include maps closed closed2 familyGround in +theorem stageOneTests_image_iff (g : G) (A : ZFSet.{u}) (p : P) : + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 (M.stageOneAssignmentImage a s b d T T2 valid valid2 g A) (a.iso g p) ↔ + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 A p := by + have term (w : (M.nameDomain s).names) : (move g w).val.val ∈ T ↔ w.val.val ∈ T := by + constructor + · intro member + have original := closed g⁻¹ (a.act s g w.val) member + simpa only [a.act_inv_left] using original + · exact closed g w.val + have index := M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps ∅ T T2 valid closed closed2 familyGround g + have image := M.stageOneAssignmentImage_entry a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g + have single := M.stageOneSingleTests_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed b d base directed system g + have collision := M.stageOneCollisionTest_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed g + constructor + · intro tests C E U Rf Rc + dsimp only + intro member + obtain ⟨hs, hc⟩ := tests (d.iso g C) (d.iso g E) (move g U) (move g Rf) (move g Rc) + ((index C E U Rf Rc).mpr member) + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + exact (single C E U Rf Rc u w p).mp + (hs (move g u) (move g w) ((term u).mpr hu) ((term w).mpr hw) + ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry)) + · intro u u' w w' hu hu' hw hw' entry entry' + exact (collision Rf Rc u u' w w' p).mp + (hc (move g u) (move g u') (move g w) (move g w') + ((term u).mpr hu) ((term u').mpr hu') ((term w).mpr hw) ((term w').mpr hw') + ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry) + ((image C E U Rf Rc u'.val w'.val member hu' hw' A).mpr entry')) + · intro tests C E U Rf Rc + obtain ⟨C, rfl⟩ := (d.iso g).surjective C + obtain ⟨E, rfl⟩ := (d.iso g).surjective E + obtain ⟨U, rfl⟩ := (move g).surjective U + obtain ⟨Rf, rfl⟩ := (move g).surjective Rf + obtain ⟨Rc, rfl⟩ := (move g).surjective Rc + dsimp only + intro member + have old := (index C E U Rf Rc).mp member + obtain ⟨hs, hc⟩ := tests C E U Rf Rc old + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + obtain ⟨u, rfl⟩ := (move g).surjective u + obtain ⟨w, rfl⟩ := (move g).surjective w + have hu := (term u).mp hu + have hw := (term w).mp hw + exact (single C E U Rf Rc u w p).mpr + (hs u w hu hw ((image C E U Rf Rc u.val w.val old hu hw A).mp entry)) + · intro u u' w w' hu hu' hw hw' entry entry' + obtain ⟨u, rfl⟩ := (move g).surjective u + obtain ⟨u', rfl⟩ := (move g).surjective u' + obtain ⟨w, rfl⟩ := (move g).surjective w + obtain ⟨w', rfl⟩ := (move g).surjective w' + have hu := (term u).mp hu + have hu' := (term u').mp hu' + have hw := (term w).mp hw + have hw' := (term w').mp hw' + exact (collision Rf Rc u u' w w' p).mpr + (hc u u' w w' hu hu' hw hw' + ((image C E U Rf Rc u.val w.val old hu hw A).mp entry) + ((image C E U Rf Rc u'.val w'.val old hu' hw' A).mp entry')) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) +local notation "Q" => M.stageOneForcing a c b d T T2 valid +local notation "J" => stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T +local notation "B" => M.groundSmallSubsets J ZFSet.omega +local notation "assignmentFamily" => M.stageOneAssignmentActionFamily a c.pairEmpty t b d T T2 valid valid2 + +noncomputable def stageOneFullActionGraph : ZFSet.{u} := + rowAssignmentActionGraph t.carrier Q c.carrier B J (a.conditionMapFamily c t) assignmentFamily + +theorem stageOneFullActionGraph_entry (g : G) (p q : P) (A D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode p) A)) (ZFSet.pair (c.encode q) D) ∈ + M.stageOneFullActionGraph a c t b d T T2 valid valid2 ↔ + ZFSet.pair (c.encode p) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ a.iso g p = q ∧ + D = M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g A := by + rw [stageOneFullActionGraph, pair_mem_rowAssignmentActionGraph] + constructor + · rintro ⟨_,source,target,_,_,_,_,rf,af,indexed,row,indexedA,image⟩ + have rowEq := (a.pair_mem_conditionMapFamily c t g rf).1 indexed + have assignmentEq := (M.pair_mem_stageOneAssignmentActionFamily a c.pairEmpty t b d + T T2 valid valid2 g af).1 indexedA + rw [assignmentEq] at image + exact ⟨source,target,(c.pair_mem_graph c (a.iso g) p q).1 (rowEq ▸ row),image⟩ + · rintro ⟨source,target,moved,image⟩ + have sourceBound := ZFSet.pair_mem_prod.1 ((M.mem_stageOneConditions c.carrier _ _).1 source).1 + have targetBound := ZFSet.pair_mem_prod.1 ((M.mem_stageOneConditions c.carrier _ _).1 target).1 + exact ⟨t.encode_mem g,source,target,sourceBound.1,sourceBound.2,targetBound.1,targetBound.2, + _,_,(a.pair_mem_conditionMapFamily c t g _).2 rfl, + (c.pair_mem_graph c (a.iso g) p q).2 moved, + (M.pair_mem_stageOneAssignmentActionFamily a c.pairEmpty t b d T T2 valid valid2 g _).2 rfl,image⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +include pairing unions powers separation carrier order nodes hT indices system + +theorem stageOneFullActionGraph_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (group : t.carrier ∈ M.sets) (rowMaps : a.conditionMapFamily c t ∈ M.sets) + (assignmentMaps : assignmentFamily ∈ M.sets) : + M.stageOneFullActionGraph a c t b d T T2 valid valid2 ∈ M.sets := by + have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT + exact M.rowAssignmentActionGraph_mem pairing unions powers separation group conditions carrier + (M.groundSmallSubsets_mem powers separation assignments omega) assignments rowMaps assignmentMaps + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) +variable (valid2 : ∀ z ∈ T2, IsName s z) (t : Presentation G) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (hT2 : T2 ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d ∅ T T2 valid ∈ M.sets) +variable (omega : ZFSet.omega ∈ M.sets) + +namespace StageOneCondition +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 +local notation "J" => stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T +local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 + +noncomputable def act (g : G) (p : Condition) : Condition where + row := a.iso g p.row + assignments := image g p.assignments + assignments_mem := M.stageOneAssignmentImage_small a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround + nodeMaps hT hT2 indexGround omega g p.assignments_mem + tests := (M.stageOneTests_image_iff a s b d T T2 valid valid2 t pairing unions powers separation + collection carrier order maps hT closed closed2 familyGround base directed system g p.assignments p.row).mpr p.tests + +local notation "act'" => act M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega + +theorem act_fields (g : G) (p : Condition) : + (act' g p).row = a.iso g p.row ∧ (act' g p).assignments = image g p.assignments := ⟨rfl, rfl⟩ + +theorem act_one (p : Condition) : act' 1 p = p := by + apply ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 + · exact a.one p.row + · exact M.stageOneAssignmentImage_one a s b d T T2 valid valid2 t pairing unions powers separation + collection carrier order maps closed closed2 familyGround + ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).mp p.assignments_mem).2.1 + +theorem act_mul (g h : G) (p : Condition) : act' (g * h) p = act' g (act' h p) := by + apply ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 + · exact a.mul g h p.row + · exact M.stageOneAssignmentImage_mul a s b d T T2 valid valid2 t pairing unions powers separation + collection carrier order maps closed closed2 familyGround g h + ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).mp p.assignments_mem).2.1 + +theorem act_inv_left (g : G) (p : Condition) : act' g⁻¹ (act' g p) = p := by + rw [← act_mul M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega, + inv_mul_cancel, act_one] + +theorem act_inv_right (g : G) (p : Condition) : act' g (act' g⁻¹ p) = p := by + rw [← act_mul M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega, + mul_inv_cancel, act_one] + +theorem act_le_iff (g : G) (p q : Condition) : act' g p ≤ act' g q ↔ p ≤ q := by + have mono : ∀ g (p q : Condition), p ≤ q → act' g p ≤ act' g q := by + intro g p q below + exact ⟨(a.iso g).monotone below.1, + M.stageOneAssignmentImage_mono a s b d T T2 valid valid2 g below.2⟩ + constructor + · intro below + have back := mono g⁻¹ _ _ below + simpa only [act_inv_left] using back + · exact mono g p q + +noncomputable def actOrderIso (g : G) : Condition ≃o Condition where + toFun := act' g + invFun := act' g⁻¹ + left_inv := act_inv_left M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega g + right_inv := act_inv_right M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega g + map_rel_iff' := act_le_iff M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega g _ _ + +noncomputable def posetAction : PosetAction G Condition where + iso := actOrderIso M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega + one := act_one M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega + mul := act_mul M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega + +end StageOneCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "typedAct" => StageOneCondition.act M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps + inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega + +noncomputable def stageOneSmallAction : + letI := smallOrder + PosetAction G (Shrink Condition) := by + letI := smallOrder + let original := StageOneCondition.posetAction M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps + inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega + let e := M.stageOneConditionOrderIso a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + exact { + iso := fun g => (e.symm.trans (original.iso g)).trans e + one := by + intro q + change e (original.iso 1 (e.symm q)) = q + rw [original.one, e.apply_symm_apply] + mul := by + intro g h q + change e (original.iso (g * h) (e.symm q)) = + e (original.iso g (e.symm (e (original.iso h (e.symm q))))) + rw [e.symm_apply_apply, original.mul] } + +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega + +theorem stageOneSmallAction_decode : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (equivShrink Condition).symm ((smallAct).iso g q) = + typedAct g ((equivShrink Condition).symm q) := by + let := smallOrder + intro g q + change (equivShrink Condition).symm + (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ + exact (equivShrink Condition).symm_apply_apply _ + +theorem stageOneSmallAction_encode : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (pres).encode ((smallAct).iso g q) = + ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm q).row)) + (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g + ((equivShrink Condition).symm q).assignments) := by + let := smallOrder + intro g q + change (pres).encode + (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ + exact M.stageOneConditionPresentation_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection _ + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) +variable (valid2 : ∀ z ∈ T2, IsName s z) (t : Presentation G) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (hT2 : T2 ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +variable (indexGround : M.niceRefinementIndices a s b d ∅ T T2 valid ∈ M.sets) +variable (omega : ZFSet.omega ∈ M.sets) + +namespace StageOneCondition +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 +local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid +local notation "J" => stageOneAssignments I T +local notation "image" => M.stageOneAssignmentImage a s b d T T2 valid valid2 +local notation "act'" => act M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega +local notation "action" => posetAction M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround indexGround omega + +theorem act_eq_iff (g : G) (p : Condition) : + act' g p = p ↔ a.iso g p.row = p.row ∧ image g p.assignments = p.assignments := by + constructor + · intro same + exact ⟨congrArg (fun q : Condition => q.row) same, + congrArg (fun q : Condition => q.assignments) same⟩ + · rintro ⟨row, assignments⟩ + exact ext M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 row assignments + +theorem posetAction_fixed (g : G) (p : Condition) + (row : a.iso g p.row = p.row) (assignments : image g p.assignments = p.assignments) : + (action).iso g p = p := + (act_eq_iff M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround + indexGround omega g p).2 ⟨row, assignments⟩ + +theorem act_fixed_of_anchor_le (D : L) (g : G) (actor : g ∈ d.principalFix D) (p : Condition) + (row : a.iso g p.row = p.row) + (bounds : ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s), + refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → + u.val ∈ T → w.val ∈ T → + stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ p.assignments → + E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w) : act' g p = p := by + apply (act_eq_iff M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 valid2 t maps nodeMaps hT2 closed closed2 familyGround + indexGround omega g p).2 + exact ⟨row, M.stageOneAssignmentImage_eq_of_anchor_le a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround + D g actor ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 bounds⟩ + +end StageOneCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "typedAct" => StageOneCondition.act M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps + inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega + +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega +local notation "fullGraph" => M.stageOneFullActionGraph a c t b d T T2 valid valid2 + +theorem stageOneSmallActionGraph_eq : + letI := smallOrder + (smallAct).actionGraph (pres) t = fullGraph := by + let := smallOrder + have encoded (g : G) (x : Shrink Condition) := M.stageOneSmallAction_encode a c b d T T2 valid + pairing unions powers separation carrier order nodes hT indices base directed system collection t inputs hT2 omega g x + have meaning (g : G) (x y : Shrink Condition) : + ZFSet.pair (ZFSet.pair (t.encode g) ((pres).encode x)) ((pres).encode y) ∈ fullGraph ↔ + (smallAct).iso g x = y := by + change ZFSet.pair (ZFSet.pair (t.encode g) + (ZFSet.pair (c.encode ((equivShrink Condition).symm x).row) + ((equivShrink Condition).symm x).assignments)) + (ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments) ∈ fullGraph ↔ _ + rw [M.stageOneFullActionGraph_entry] + constructor + · rintro ⟨_,_,rowEqual,assignmentEqual⟩ + apply (pres).injective + rw [encoded] + change ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm x).row)) + (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g + ((equivShrink Condition).symm x).assignments) = + ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments + rw [rowEqual, assignmentEqual] + · intro equal + have codeEqual := congrArg (pres).encode equal + rw [encoded] at codeEqual + change ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm x).row)) + (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g + ((equivShrink Condition).symm x).assignments) = + ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments at codeEqual + obtain ⟨rowEqual,assignmentEqual⟩ := ZFSet.pair_injective codeEqual + exact ⟨(pres).encode_mem x,(pres).encode_mem y,c.injective rowEqual,assignmentEqual.symm⟩ + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨⟨g,x⟩,rfl⟩ := ((t.product (pres)).mem_graph (pres) (fun gx => (smallAct).iso gx.1 gx.2) z).1 member + exact (meaning g x ((smallAct).iso g x)).2 rfl + · intro member + have boundMember := member + unfold stageOneFullActionGraph rowAssignmentActionGraph at boundMember + have bounds : z ∈ ZFSet.prod (ZFSet.prod t.carrier (pres).carrier) (pres).carrier := + (ZFSet.mem_sep.1 boundMember).1 + obtain ⟨source,hSource,y,hy,rfl⟩ := ZFSet.mem_prod.1 bounds + obtain ⟨g,hg,x,hx,rfl⟩ := ZFSet.mem_prod.1 hSource + obtain ⟨g,rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨x,rfl⟩ := ((pres).mem_carrier x).1 hx + obtain ⟨y,rfl⟩ := ((pres).mem_carrier y).1 hy + exact ((smallAct).triple_mem_actionGraph (pres) t g x y).2 ((meaning g x y).1 member) + +variable (nodeOrder : b.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (originalMaps : a.conditionMapFamily c t ∈ M.sets) +include nodeOrder group originalMaps + +theorem stageOneSmallActionGraph_mem : + letI := smallOrder + (smallAct).actionGraph (pres) t ∈ M.sets := by + let := smallOrder + rw [M.stageOneSmallActionGraph_eq a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega] + have assignmentMaps := M.stageOneAssignmentActionFamily_mem_of_inputs a c.pairEmpty t b d T T2 valid valid2 + pairing unions powers separation collection pairedCarrier group nodes pairedOrder inputs.condition_maps + inputs.node_maps hT hT2 indices.index_ground inputs.terms_closed inputs.pairs_closed inputs.family_ground + exact M.stageOneFullActionGraph_mem a c t b d T T2 valid valid2 pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega group originalMaps assignmentMaps + +theorem stageOneSmallActionMapFamily_mem : + letI := smallOrder + (smallAct).conditionMapFamily (pres) t ∈ M.sets := by + let := smallOrder + exact M.conditionMapFamily_mem_of_actionGraph (smallAct) (pres) t pairing unions powers separation collection + (M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection nodeOrder omega) group + (M.stageOneSmallActionGraph_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega nodeOrder group originalMaps) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLiftFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLiftFamilies.lean index e1f7a5f0da61833b4b9f052897d25675ef421d60..4a9a1c6c746b6c8d3e7c3845bfacf13948a684fa 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLiftFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLiftFamilies.lean @@ -1,435 +1,435 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneGroundAction - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "typedAct" => StageOneCondition.act M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps - inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega - -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 - -theorem stageOneSmallAction_empty : - letI := smallOrder - ∀ (g : G) (p : P), (smallAct).iso g (incl p) = incl (a.iso g p) := by - let := smallOrder - intro g p - apply (equivShrink Condition).symm.injective - rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega] - change typedAct g ((equivShrink Condition).symm (equivShrink Condition (emptyRow p))) = - (equivShrink Condition).symm (equivShrink Condition (emptyRow (a.iso g p))) - rw [(equivShrink Condition).symm_apply_apply, (equivShrink Condition).symm_apply_apply] - apply StageOneCondition.ext M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 - · rfl - · change relationImage ∅ _ _ = ∅ - apply ZFSet.ext - intro z - rw [mem_relationImage] - constructor - · rintro ⟨_, x, hx, _⟩ - exact (ZFSet.notMem_empty x hx).elim - · intro hz - exact (ZFSet.notMem_empty z hz).elim - -structure StageOneSmallActionLaws - (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where - row : letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - ((equivShrink Condition).symm (action.iso g q)).row = - a.iso g ((equivShrink Condition).symm q).row - assignments : letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - ((equivShrink Condition).symm (action.iso g q)).assignments = - M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g - ((equivShrink Condition).symm q).assignments - code : letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (pres).encode (action.iso g q) = - ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm q).row)) - (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g - ((equivShrink Condition).symm q).assignments) - inclusion : letI := smallOrder - ∀ (g : G) (p : P), action.iso g (incl p) = incl (a.iso g p) - -theorem stageOneSmallAction_laws : - StageOneSmallActionLaws M a c b d T T2 valid pairing unions powers separation carrier order - nodes hT indices base directed system collection (smallAct) := by - constructor - · intro g q - rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega] - rfl - · intro g q - rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega] - rfl - · exact M.stageOneSmallAction_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega - · exact M.stageOneSmallAction_empty a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "J" => stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T - -private theorem flat_coordinates : - letI := smallOrder - ∀ (F : FlatConditionSystem M c (pres) J) (q : Shrink Condition), - F.row q = ((equivShrink Condition).symm q).row ∧ - F.assignments q = ((equivShrink Condition).symm q).assignments := by - let := smallOrder - intro F q - have equal := (F.encode q).symm - change ZFSet.pair (c.encode (F.row q)) (F.assignments q) = - ZFSet.pair (c.encode ((equivShrink Condition).symm q).row) - ((equivShrink Condition).symm q).assignments at equal - exact ⟨c.injective (ZFSet.pair_inj.1 equal).1, (ZFSet.pair_inj.1 equal).2⟩ - -theorem stageOneFlatAction_row : - letI := smallOrder - ∀ (F : FlatConditionSystem M c (pres) J) (action : PosetAction G (Shrink Condition)), - StageOneSmallActionLaws M a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection action → - ∀ (g : G) (q : Shrink Condition), F.row (action.iso g q) = a.iso g (F.row q) := by - let := smallOrder - intro F action laws g q - rw [(flat_coordinates M a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection F (action.iso g q)).1, - (flat_coordinates M a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection F q).1] - exact laws.row g q - -theorem stageOneFlatAction_assignments : - letI := smallOrder - ∀ (F : FlatConditionSystem M c (pres) J) (action : PosetAction G (Shrink Condition)), - StageOneSmallActionLaws M a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection action → - ∀ (g : G) (q : Shrink Condition), F.assignments (action.iso g q) = - M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g (F.assignments q) := by - let := smallOrder - intro F action laws g q - rw [(flat_coordinates M a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection F (action.iso g q)).2, - (flat_coordinates M a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection F q).2] - exact laws.assignments g q - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "liftName" => M.stageOneNameLift a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection - -theorem stageOneNameLift_act : - letI := smallOrder - ∀ (g : G) (τ : Name c.pairEmpty), - (smallAct).act (pres) g (liftName τ) = liftName (a.act c.pairEmpty g τ) := by - let := smallOrder - intro g τ - exact a.act_rename_of_equivariant (smallAct) c.pairEmpty (pres) incl - (fun g p => (M.stageOneSmallAction_empty a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega g p).symm) g τ - -theorem stageOneNameLift_stabilizer : - letI := smallOrder - ∀ τ : Name c.pairEmpty, (smallAct).stabilizer (pres) (liftName τ) = a.stabilizer c.pairEmpty τ := by - let := smallOrder - intro τ - apply Subgroup.ext - intro g - change (smallAct).act (pres) g (liftName τ) = liftName τ ↔ a.act c.pairEmpty g τ = τ - rw [M.stageOneNameLift_act a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega] - constructor - · intro equal - apply Subtype.ext - have codes := congrArg Subtype.val equal - simpa only [M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] using codes - · intro equal - exact congrArg liftName equal - -theorem stageOneNameLift_supported (K : Subgroup G) (τ : Name c.pairEmpty) - (supported : K ≤ a.stabilizer c.pairEmpty τ) : - letI := smallOrder - K ≤ (smallAct).stabilizer (pres) (liftName τ) := by - let := smallOrder - rw [M.stageOneNameLift_stabilizer a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega] - exact supported - -end - -section -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "liftName" => M.stageOneNameLift a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection - -theorem stageOneNameLift_hs (F : NormalSubgroupFamily G) (τ : Name c.pairEmpty) - (hs : HereditarilySymmetric a c.pairEmpty F τ) : - letI := smallOrder - HereditarilySymmetric (smallAct) (pres) F (liftName τ) := by - let := smallOrder - exact hs.rename (smallAct) (pres) incl - (fun g p => (M.stageOneSmallAction_empty a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega g p).symm) - -theorem stageOneNameFamily_valid (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) : - ∀ z ∈ X, IsName (pres) z := by - intro z hz - have lifted := (liftName ⟨z, oldValid z hz⟩).property - exact (congrArg (IsName (pres)) - (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection ⟨z, oldValid z hz⟩)).mp lifted - -theorem stageOneNameFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) : - Name.renamedFamily (pres) incl X oldValid = X := by - apply ZFSet.ext - intro z - rw [Name.mem_renamedFamily] - constructor - · rintro ⟨τ, hτ, equal⟩ - have codes := M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection τ - exact (equal.trans codes).symm ▸ hτ - · intro hz - exact ⟨⟨z, oldValid z hz⟩, hz, - (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection ⟨z, oldValid z hz⟩).symm⟩ - -theorem stageOneNameFamily_transport (F : NormalSubgroupFamily G) (X : ZFSet.{u}) - (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) - (closed : ∀ g (τ : Name c.pairEmpty), τ.val ∈ X → (a.act c.pairEmpty g τ).val ∈ X) - (children : ∀ τ : Name c.pairEmpty, τ.val ∈ X → HereditarilySymmetric a c.pairEmpty F τ) : - letI := smallOrder - (∀ z ∈ X, IsName (pres) z) ∧ - (∀ g (τ : Name (pres)), τ.val ∈ X → ((smallAct).act (pres) g τ).val ∈ X) ∧ - (∀ τ : Name (pres), τ.val ∈ X → HereditarilySymmetric (smallAct) (pres) F τ) := by - let := smallOrder - refine ⟨M.stageOneNameFamily_valid a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection X oldValid, ?_, ?_⟩ - · intro g τ hτ - let σ : Name c.pairEmpty := ⟨τ.val, oldValid τ.val hτ⟩ - have same : liftName σ = τ := Subtype.ext - (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection σ) - rw [← same, M.stageOneNameLift_act a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega, - M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] - exact closed g σ hτ - · intro τ hτ - let σ : Name c.pairEmpty := ⟨τ.val, oldValid τ.val hτ⟩ - have same : liftName σ = τ := Subtype.ext - (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection σ) - rw [← same] - exact M.stageOneNameLift_hs a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega F σ (children σ hτ) - -end - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "liftName" => M.stageOneNameLift a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection - -theorem stageOneNameAction_val_eq : - letI := smallOrder - ∀ (g : G) (τ : Name c.pairEmpty) (σ : Name (pres)), σ.val = τ.val → - ((smallAct).act (pres) g σ).val = (a.act c.pairEmpty g τ).val := by - let := smallOrder - intro g τ σ same - have lifted : liftName τ = σ := Subtype.ext - ((M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection τ).trans same.symm) - rw [← lifted, M.stageOneNameLift_act a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega, - M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] - -theorem stageOneTermActionGraph_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) - (newValid : ∀ z ∈ X, IsName (pres) z) : - letI := smallOrder - ∀ g : G, Name.renameFamilyGraph (pres) ((smallAct).iso g) X newValid = - Name.renameFamilyGraph c.pairEmpty (a.iso g) X oldValid := by - let := smallOrder - intro g - apply ZFSet.ext - intro z - rw [Name.mem_renameFamilyGraph, Name.mem_renameFamilyGraph] - constructor - · rintro ⟨σ, hs, rfl⟩ - let τ : Name c.pairEmpty := ⟨σ.val, oldValid σ.val hs⟩ - refine ⟨τ, hs, ?_⟩ - have same := M.stageOneNameAction_val_eq a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega g τ σ rfl - exact congrArg (ZFSet.pair σ.val) same - · rintro ⟨τ, ht, rfl⟩ - let σ : Name (pres) := ⟨τ.val, newValid τ.val ht⟩ - refine ⟨σ, ht, ?_⟩ - have same := M.stageOneNameAction_val_eq a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega g τ σ rfl - exact congrArg (ZFSet.pair τ.val) same.symm - -theorem stageOneTermActionFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) - (newValid : ∀ z ∈ X, IsName (pres) z) : - letI := smallOrder - (smallAct).termActionFamily (pres) t X newValid = a.termActionFamily c.pairEmpty t X oldValid := by - let := smallOrder - unfold PosetAction.termActionFamily - congr 1 - funext g - exact M.stageOneTermActionGraph_eq a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega X oldValid newValid g - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneGroundAction + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "typedAct" => StageOneCondition.act M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 valid2 t inputs.condition_maps + inputs.node_maps hT2 inputs.terms_closed inputs.pairs_closed inputs.family_ground indices.index_ground omega + +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 + +theorem stageOneSmallAction_empty : + letI := smallOrder + ∀ (g : G) (p : P), (smallAct).iso g (incl p) = incl (a.iso g p) := by + let := smallOrder + intro g p + apply (equivShrink Condition).symm.injective + rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega] + change typedAct g ((equivShrink Condition).symm (equivShrink Condition (emptyRow p))) = + (equivShrink Condition).symm (equivShrink Condition (emptyRow (a.iso g p))) + rw [(equivShrink Condition).symm_apply_apply, (equivShrink Condition).symm_apply_apply] + apply StageOneCondition.ext M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 + · rfl + · change relationImage ∅ _ _ = ∅ + apply ZFSet.ext + intro z + rw [mem_relationImage] + constructor + · rintro ⟨_, x, hx, _⟩ + exact (ZFSet.notMem_empty x hx).elim + · intro hz + exact (ZFSet.notMem_empty z hz).elim + +structure StageOneSmallActionLaws + (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where + row : letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + ((equivShrink Condition).symm (action.iso g q)).row = + a.iso g ((equivShrink Condition).symm q).row + assignments : letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + ((equivShrink Condition).symm (action.iso g q)).assignments = + M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g + ((equivShrink Condition).symm q).assignments + code : letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (pres).encode (action.iso g q) = + ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm q).row)) + (M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g + ((equivShrink Condition).symm q).assignments) + inclusion : letI := smallOrder + ∀ (g : G) (p : P), action.iso g (incl p) = incl (a.iso g p) + +theorem stageOneSmallAction_laws : + StageOneSmallActionLaws M a c b d T T2 valid pairing unions powers separation carrier order + nodes hT indices base directed system collection (smallAct) := by + constructor + · intro g q + rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega] + rfl + · intro g q + rw [M.stageOneSmallAction_decode a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega] + rfl + · exact M.stageOneSmallAction_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega + · exact M.stageOneSmallAction_empty a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "J" => stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T + +private theorem flat_coordinates : + letI := smallOrder + ∀ (F : FlatConditionSystem M c (pres) J) (q : Shrink Condition), + F.row q = ((equivShrink Condition).symm q).row ∧ + F.assignments q = ((equivShrink Condition).symm q).assignments := by + let := smallOrder + intro F q + have equal := (F.encode q).symm + change ZFSet.pair (c.encode (F.row q)) (F.assignments q) = + ZFSet.pair (c.encode ((equivShrink Condition).symm q).row) + ((equivShrink Condition).symm q).assignments at equal + exact ⟨c.injective (ZFSet.pair_inj.1 equal).1, (ZFSet.pair_inj.1 equal).2⟩ + +theorem stageOneFlatAction_row : + letI := smallOrder + ∀ (F : FlatConditionSystem M c (pres) J) (action : PosetAction G (Shrink Condition)), + StageOneSmallActionLaws M a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection action → + ∀ (g : G) (q : Shrink Condition), F.row (action.iso g q) = a.iso g (F.row q) := by + let := smallOrder + intro F action laws g q + rw [(flat_coordinates M a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection F (action.iso g q)).1, + (flat_coordinates M a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection F q).1] + exact laws.row g q + +theorem stageOneFlatAction_assignments : + letI := smallOrder + ∀ (F : FlatConditionSystem M c (pres) J) (action : PosetAction G (Shrink Condition)), + StageOneSmallActionLaws M a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection action → + ∀ (g : G) (q : Shrink Condition), F.assignments (action.iso g q) = + M.stageOneAssignmentImage a c.pairEmpty b d T T2 valid valid2 g (F.assignments q) := by + let := smallOrder + intro F action laws g q + rw [(flat_coordinates M a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection F (action.iso g q)).2, + (flat_coordinates M a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection F q).2] + exact laws.assignments g q + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "liftName" => M.stageOneNameLift a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection + +theorem stageOneNameLift_act : + letI := smallOrder + ∀ (g : G) (τ : Name c.pairEmpty), + (smallAct).act (pres) g (liftName τ) = liftName (a.act c.pairEmpty g τ) := by + let := smallOrder + intro g τ + exact a.act_rename_of_equivariant (smallAct) c.pairEmpty (pres) incl + (fun g p => (M.stageOneSmallAction_empty a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega g p).symm) g τ + +theorem stageOneNameLift_stabilizer : + letI := smallOrder + ∀ τ : Name c.pairEmpty, (smallAct).stabilizer (pres) (liftName τ) = a.stabilizer c.pairEmpty τ := by + let := smallOrder + intro τ + apply Subgroup.ext + intro g + change (smallAct).act (pres) g (liftName τ) = liftName τ ↔ a.act c.pairEmpty g τ = τ + rw [M.stageOneNameLift_act a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega] + constructor + · intro equal + apply Subtype.ext + have codes := congrArg Subtype.val equal + simpa only [M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] using codes + · intro equal + exact congrArg liftName equal + +theorem stageOneNameLift_supported (K : Subgroup G) (τ : Name c.pairEmpty) + (supported : K ≤ a.stabilizer c.pairEmpty τ) : + letI := smallOrder + K ≤ (smallAct).stabilizer (pres) (liftName τ) := by + let := smallOrder + rw [M.stageOneNameLift_stabilizer a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega] + exact supported + +end + +section +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "liftName" => M.stageOneNameLift a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection + +theorem stageOneNameLift_hs (F : NormalSubgroupFamily G) (τ : Name c.pairEmpty) + (hs : HereditarilySymmetric a c.pairEmpty F τ) : + letI := smallOrder + HereditarilySymmetric (smallAct) (pres) F (liftName τ) := by + let := smallOrder + exact hs.rename (smallAct) (pres) incl + (fun g p => (M.stageOneSmallAction_empty a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega g p).symm) + +theorem stageOneNameFamily_valid (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) : + ∀ z ∈ X, IsName (pres) z := by + intro z hz + have lifted := (liftName ⟨z, oldValid z hz⟩).property + exact (congrArg (IsName (pres)) + (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection ⟨z, oldValid z hz⟩)).mp lifted + +theorem stageOneNameFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) : + Name.renamedFamily (pres) incl X oldValid = X := by + apply ZFSet.ext + intro z + rw [Name.mem_renamedFamily] + constructor + · rintro ⟨τ, hτ, equal⟩ + have codes := M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection τ + exact (equal.trans codes).symm ▸ hτ + · intro hz + exact ⟨⟨z, oldValid z hz⟩, hz, + (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection ⟨z, oldValid z hz⟩).symm⟩ + +theorem stageOneNameFamily_transport (F : NormalSubgroupFamily G) (X : ZFSet.{u}) + (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) + (closed : ∀ g (τ : Name c.pairEmpty), τ.val ∈ X → (a.act c.pairEmpty g τ).val ∈ X) + (children : ∀ τ : Name c.pairEmpty, τ.val ∈ X → HereditarilySymmetric a c.pairEmpty F τ) : + letI := smallOrder + (∀ z ∈ X, IsName (pres) z) ∧ + (∀ g (τ : Name (pres)), τ.val ∈ X → ((smallAct).act (pres) g τ).val ∈ X) ∧ + (∀ τ : Name (pres), τ.val ∈ X → HereditarilySymmetric (smallAct) (pres) F τ) := by + let := smallOrder + refine ⟨M.stageOneNameFamily_valid a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection X oldValid, ?_, ?_⟩ + · intro g τ hτ + let σ : Name c.pairEmpty := ⟨τ.val, oldValid τ.val hτ⟩ + have same : liftName σ = τ := Subtype.ext + (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection σ) + rw [← same, M.stageOneNameLift_act a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega, + M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] + exact closed g σ hτ + · intro τ hτ + let σ : Name c.pairEmpty := ⟨τ.val, oldValid τ.val hτ⟩ + have same : liftName σ = τ := Subtype.ext + (M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection σ) + rw [← same] + exact M.stageOneNameLift_hs a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega F σ (children σ hτ) + +end + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "liftName" => M.stageOneNameLift a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection + +theorem stageOneNameAction_val_eq : + letI := smallOrder + ∀ (g : G) (τ : Name c.pairEmpty) (σ : Name (pres)), σ.val = τ.val → + ((smallAct).act (pres) g σ).val = (a.act c.pairEmpty g τ).val := by + let := smallOrder + intro g τ σ same + have lifted : liftName τ = σ := Subtype.ext + ((M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection τ).trans same.symm) + rw [← lifted, M.stageOneNameLift_act a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega, + M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] + +theorem stageOneTermActionGraph_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) + (newValid : ∀ z ∈ X, IsName (pres) z) : + letI := smallOrder + ∀ g : G, Name.renameFamilyGraph (pres) ((smallAct).iso g) X newValid = + Name.renameFamilyGraph c.pairEmpty (a.iso g) X oldValid := by + let := smallOrder + intro g + apply ZFSet.ext + intro z + rw [Name.mem_renameFamilyGraph, Name.mem_renameFamilyGraph] + constructor + · rintro ⟨σ, hs, rfl⟩ + let τ : Name c.pairEmpty := ⟨σ.val, oldValid σ.val hs⟩ + refine ⟨τ, hs, ?_⟩ + have same := M.stageOneNameAction_val_eq a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega g τ σ rfl + exact congrArg (ZFSet.pair σ.val) same + · rintro ⟨τ, ht, rfl⟩ + let σ : Name (pres) := ⟨τ.val, newValid τ.val ht⟩ + refine ⟨σ, ht, ?_⟩ + have same := M.stageOneNameAction_val_eq a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega g τ σ rfl + exact congrArg (ZFSet.pair τ.val) same.symm + +theorem stageOneTermActionFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName c.pairEmpty z) + (newValid : ∀ z ∈ X, IsName (pres) z) : + letI := smallOrder + (smallAct).termActionFamily (pres) t X newValid = a.termActionFamily c.pairEmpty t X oldValid := by + let := smallOrder + unfold PosetAction.termActionFamily + congr 1 + funext g + exact M.stageOneTermActionGraph_eq a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega X oldValid newValid g + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLifting.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLifting.lean index 1ff7fedbc701b6d897d315aeb4f80780a4885b79..ba368ecd733bc900e2549ee6063634bd769cd5e1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLifting.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneNameLifting.lean @@ -1,581 +1,581 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeInternalClosure - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -def StageOneConditionCode (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) - (z : ZFSet.{u}) : Prop := - ∃ p A, z = ZFSet.pair p A ∧ stageOneRawTests M d A (ZFSet.pair p ∅) - -namespace SetFormula - -def stageOneConditionFormula {n : Nat} (d : Fin 15 → Fin n) (z : Fin n) : SetFormula n := - let old := suffixIndex n 4 - let v := prefixIndex n 4 - exBlock 4 (.conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)).toFormula - (.conj (BoundedFormula.emptyFormula (v 2)).toFormula - (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 2)).toFormula - (stageOneTestsFormula (fun j => old (d j)) (v 1) (v 3))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_stageOneConditionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n : Nat} (d : Fin 15 → Fin n) (z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (stageOneConditionFormula d z) env ↔ - StageOneConditionCode M (fun j => env (d j)) (env z) := by - rw [stageOneConditionFormula, realize_exBlock] - have actual (f : Fin 4 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (.conj - (BoundedFormula.orderedPairFormula (suffixIndex n 4 z) (prefixIndex n 4 0) (prefixIndex n 4 1)).toFormula - (.conj (BoundedFormula.emptyFormula (prefixIndex n 4 2)).toFormula - (.conj (BoundedFormula.orderedPairFormula (prefixIndex n 4 3) (prefixIndex n 4 0) (prefixIndex n 4 2)).toFormula - (stageOneTestsFormula (fun j => suffixIndex n 4 (d j)) (prefixIndex n 4 1) (prefixIndex n 4 3))))) - (extendMany 4 f env) ↔ - env z = ZFSet.pair (f 0) (f 1) ∧ f 2 = ∅ ∧ f 3 = ZFSet.pair (f 0) (f 2) ∧ - stageOneRawTests M (fun j => env (d j)) (f 1) (f 3) := by - have allground := extendMany_members 4 f env ground members - apply and_congr - · rw [BoundedFormula.realize_toFormula M _ _ allground, BoundedFormula.truth_orderedPairFormula] - simp only [extendMany_prefix, extendMany_suffix] - apply and_congr - · rw [BoundedFormula.realize_toFormula M _ _ allground, BoundedFormula.truth_emptyFormula] - simp only [extendMany_prefix] - apply and_congr - · rw [BoundedFormula.realize_toFormula M _ _ allground, BoundedFormula.truth_orderedPairFormula] - simp only [extendMany_prefix] - rw [M.realize_stageOneTestsFormula _ _ _ _ allground] - simp only [extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, body⟩ - obtain ⟨pair, empty, lower, tests⟩ := (actual f ground).1 body - refine ⟨f 0, f 1, pair, ?_⟩ - rw [empty] at lower - exact lower ▸ tests - · rintro ⟨p, A, equal, tests⟩ - have hp : p ∈ M.sets := M.pair_left (equal ▸ members z) - have hA : A ∈ M.sets := M.pair_right (equal ▸ members z) - have empty : (∅ : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env z, members z⟩ - have lower := M.orderedPair_mem pairing hp empty - let f : Fin 4 → ZFSet.{u} := ![p,A,∅,ZFSet.pair p ∅] - have ground : ∀ j, f j ∈ M.sets := - Fin.cases hp (Fin.cases hA (Fin.cases empty (Fin.cases lower (fun j => Fin.elim0 j)))) - exact ⟨f, ground, (actual f ground).2 ⟨equal,rfl,rfl,tests⟩⟩ - -noncomputable def stageOneConditions (rawRowCarrier : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (StageOneConditionCode M d) (M.stageOneCandidateBound rawRowCarrier (d 0) (d 6)) - -theorem mem_stageOneConditions (rawRowCarrier : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) (z : ZFSet.{u}) : - z ∈ M.stageOneConditions rawRowCarrier d ↔ - z ∈ M.stageOneCandidateBound rawRowCarrier (d 0) (d 6) ∧ StageOneConditionCode M d z := - ZFSet.mem_sep - -theorem pair_mem_stageOneConditions (rawRowCarrier : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) (p A : ZFSet.{u}) : - ZFSet.pair p A ∈ M.stageOneConditions rawRowCarrier d ↔ - p ∈ rawRowCarrier ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments (d 0) (d 6) ∧ - M.groundEmbeddable A ZFSet.omega ∧ stageOneRawTests M d A (ZFSet.pair p ∅) := by - rw [M.mem_stageOneConditions, M.pair_mem_stageOneCandidateBound] - constructor - · rintro ⟨⟨hp,hA,subset,small⟩,p',A',equal,tests⟩ - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective equal - exact ⟨hp,hA,subset,small,tests⟩ - · rintro ⟨hp,hA,subset,small,tests⟩ - exact ⟨⟨hp,hA,subset,small⟩,p,A,rfl,tests⟩ - -theorem stageOneConditions_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {rawRowCarrier : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) (hRow : rawRowCarrier ∈ M.sets) - (members : ∀ j, d j ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.stageOneConditions rawRowCarrier d ∈ M.sets := by - have bound := M.stageOneCandidateBound_mem pairing unions powers separation hRow (members 0) (members 6) omega - let phi : SetFormula 16 := stageOneConditionFormula Fin.succ 0 - have ground := M.separation_mem separation phi d members bound - have equal : ZFSet.sep (fun z => Realize M.sets phi (extend z d)) - (M.stageOneCandidateBound rawRowCarrier (d 0) (d 6)) = M.stageOneConditions rawRowCarrier d := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_stageOneConditions] - apply and_congr_right - intro hz - exact M.realize_stageOneConditionFormula pairing Fin.succ 0 (extend z d) - (Fin.cases (M.transitive bound hz) members) - exact equal ▸ ground - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) - -structure StageOneCondition where - row : P - assignments : ZFSet.{u} - assignments_mem : assignments ∈ M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega - tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 assignments row - -namespace StageOneCondition -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 - -@[ext] theorem ext {p q : Condition} (rows : p.row = q.row) (data : p.assignments = q.assignments) : p = q := by - cases p - cases q - cases rows - cases data - rfl - -noncomputable def empty (row : P) : Condition where - row := row - assignments := ∅ - assignments_mem := (M.mem_groundSmallSubsets _ _ ∅).2 - ⟨M.empty_mem ⟨T, hT⟩, ZFSet.empty_subset _, M.empty_groundEmbeddable ZFSet.omega ⟨T, hT⟩⟩ - tests := M.stageOneTests_empty s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 row - -theorem empty_row (row : P) : - (empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 row).row = row := rfl - -theorem empty_assignments (row : P) : - (empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 row).assignments = ∅ := rfl - -end StageOneCondition - - - - - -namespace StageOneCondition -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 - -instance partialOrder : PartialOrder Condition where - le p q := p.row ≤ q.row ∧ q.assignments ⊆ p.assignments - le_refl _ := ⟨le_rfl, fun _ h => h⟩ - le_trans _ _ _ first second := ⟨first.1.trans second.1, fun _ h => first.2 (second.2 h)⟩ - le_antisymm p q first second := by - apply ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 - (le_antisymm first.1 second.1) - apply ZFSet.ext - intro z - exact ⟨fun h => second.2 h, fun h => first.2 h⟩ - -theorem le_iff (p q : Condition) : p ≤ q ↔ p.row ≤ q.row ∧ q.assignments ⊆ p.assignments := Iff.rfl - -def rowProjection : Condition →o P where - toFun p := p.row - monotone' _ _ below := below.1 - -noncomputable def emptyEmbedding : P ↪o Condition where - toFun := empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 - inj' _ _ equal := congrArg StageOneCondition.row equal - map_rel_iff' := ⟨fun below => below.1, fun below => ⟨below, fun _ h => h⟩⟩ - -noncomputable instance orderTop : OrderTop Condition where - top := empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 ⊤ - le_top p := ⟨le_top, ZFSet.empty_subset p.assignments⟩ - -theorem rowProjection_empty (row : P) : - rowProjection M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 - (empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 row) = row := rfl - -end StageOneCondition - - - - -namespace StageOneCondition -variable {M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2} -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 - -noncomputable def withRow (p : Condition) (row : P) (below : row ≤ p.row) : Condition where - row := row - assignments := p.assignments - assignments_mem := p.assignments_mem - tests := M.stageOneTests_mono s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 p.assignments p.tests below - -theorem withRow_row (p : Condition) (row : P) (below : row ≤ p.row) : - (p.withRow row below).row = row := rfl - -theorem withRow_assignments (p : Condition) (row : P) (below : row ≤ p.row) : - (p.withRow row below).assignments = p.assignments := rfl - -theorem withRow_le (p : Condition) (row : P) (below : row ≤ p.row) : - p.withRow row below ≤ p := ⟨below, fun _ h => h⟩ - -theorem exists_lift_row (p : Condition) (row : P) (below : row ≤ p.row) : - ∃ q : Condition, q ≤ p ∧ q.row = row ∧ q.assignments = p.assignments := - ⟨p.withRow row below, p.withRow_le row below, rfl, rfl⟩ - -end StageOneCondition - - - - -namespace StageOneCondition -variable {M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2} -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 - -noncomputable def code (p : Condition) (c : Presentation P) : ZFSet.{u} := - ZFSet.pair (c.encode p.row) p.assignments - -theorem code_eq_iff (c : Presentation P) (p q : Condition) : - p.code c = q.code c ↔ p.row = q.row ∧ p.assignments = q.assignments := by - rw [code, code, ZFSet.pair_inj] - exact and_congr c.injective.eq_iff Iff.rfl - -theorem code_injective (c : Presentation P) : Function.Injective (fun p : Condition => p.code c) := by - intro p q equal - obtain ⟨rows, assignments⟩ := (code_eq_iff c p q).1 equal - exact ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 rows assignments - -theorem code_mem_candidateBound (c : Presentation P) (p : Condition) : - p.code c ∈ M.stageOneCandidateBound c.carrier - (M.niceRefinementIndices a s b d ∅ T T2 valid) T := - ZFSet.pair_mem_prod.2 ⟨c.encode_mem p.row, p.assignments_mem⟩ - -instance small : Small.{u} Condition := by - let bound := M.stageOneCandidateBound s.carrier (M.niceRefinementIndices a s b d ∅ T T2 valid) T - let f : Condition → bound := fun p => ⟨p.code s, code_mem_candidateBound s p⟩ - apply small_of_injective.{u} (f := f) - intro p q equal - exact code_injective s (congrArg Subtype.val equal) - -end StageOneCondition - - - - -namespace StageOneCondition -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 - -noncomputable def chainUnion (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) - (below : ∀ n, row ≤ (seq n).row) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) : Condition where - row := row - assignments := stageOneAssignmentUnion (fun n => (seq n).assignments) - assignments_mem := small - tests := M.stageOneTests_union s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 (fun n => (seq n).assignments) (fun n => (seq n).row) row - (fun _ _ less => (decreasing less).2) below (fun n => (seq n).tests) - -theorem chainUnion_row (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) - (below : ∀ n, row ≤ (seq n).row) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) : - (chainUnion M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 seq decreasing row below small).row = row := rfl - -theorem chainUnion_assignments (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) - (below : ∀ n, row ≤ (seq n).row) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) : - (chainUnion M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 seq decreasing row below small).assignments = - stageOneAssignmentUnion (fun n => (seq n).assignments) := rfl - -theorem chainUnion_le (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) - (below : ∀ n, row ≤ (seq n).row) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) (n : Nat) : - chainUnion M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 seq decreasing row below small ≤ seq n := - ⟨below n, stageOneAssignmentUnion_contains (fun n => (seq n).assignments) n⟩ - -end StageOneCondition -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - -noncomputable def stageOneForcing : ZFSet.{u} := - M.stageOneConditions c.carrier (M.stageOneFormulaData a c.pairEmpty b d T T2 valid) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) - -include pairing unions powers separation carrier order nodes hT indices system in -theorem stageOneForcing_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.stageOneForcing a c b d T T2 valid ∈ M.sets := by - have pairedCarrier := M.pairEmpty_carrier_mem pairing unions powers separation c carrier - have pairedOrder := M.pairEmpty_order_mem pairing unions powers separation c carrier order - exact M.stageOneConditions_mem pairing unions powers separation _ carrier - (M.stageOneFormulaData_members a c.pairEmpty b d T T2 valid pairing unions powers separation - hT pairedCarrier pairedOrder nodes nodeOrder valid2 indices base directed system) omega - -variable (collection : CollectionSchema M.sets) - -include nodes indices in -theorem stageOneForcing_entry (p : P) (A : ZFSet.{u}) : - ZFSet.pair (c.encode p) A ∈ M.stageOneForcing a c b d T T2 valid ↔ - A ∈ M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega ∧ - M.stageOneTests c.pairEmpty pairing unions powers separation collection - (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) - (M.pairEmpty_order_mem pairing unions powers separation c carrier order) hT valid - a b d base directed system T2 A p := by - rw [stageOneForcing, M.pair_mem_stageOneConditions, M.mem_groundSmallSubsets] - have tests := M.stageOneRawTests_iff a c.pairEmpty b d pairing unions powers separation collection - (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) - (M.pairEmpty_order_mem pairing unions powers separation c carrier order) nodes hT valid indices - base directed system A p - constructor - · rintro ⟨_, ground, subset, small, raw⟩ - exact ⟨⟨ground, subset, small⟩, tests.1 raw⟩ - · rintro ⟨⟨ground, subset, small⟩, typed⟩ - exact ⟨c.encode_mem p, ground, subset, small, tests.2 typed⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid - -include nodes indices in -theorem stageOneConditionCode_mem (p : Condition) : p.code c ∈ Q := - (M.stageOneForcing_entry a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system collection p.row p.assignments).2 ⟨p.assignments_mem, p.tests⟩ - -include nodes indices in -theorem exists_stageOneConditionCode {z : ZFSet.{u}} (member : z ∈ Q) : - ∃ p : Condition, p.code c = z := by - have candidate := (M.mem_stageOneConditions c.carrier - (M.stageOneFormulaData a c.pairEmpty b d T T2 valid) z).1 member - obtain ⟨row, A, small, equal⟩ := M.exists_stageOneCandidate_fields c _ _ candidate.1 - have tests := (M.stageOneForcing_entry a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection row A).1 (equal ▸ member) - exact ⟨⟨row, A, small, tests.2⟩, equal.symm⟩ - -include nodes indices in -theorem stageOneConditionCode_range : - ZFSet.range (fun p : Condition => p.code c) = Q := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_range] - constructor - · rintro ⟨p, rfl⟩ - exact M.stageOneConditionCode_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection p - · intro member - exact M.exists_stageOneConditionCode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection member - -noncomputable def stageOneConditionEquiv : Condition ≃ SetMembers Q := - Equiv.ofBijective - (fun p => SetMembers.ofMem (p.code c) (M.stageOneConditionCode_mem a c b d T T2 valid - pairing unions powers separation carrier order nodes hT indices base directed system collection p)) - ⟨by - intro p q equal - apply StageOneCondition.code_injective c - have raw := congrArg SetMembers.raw equal - simpa only [SetMembers.raw_ofMem] using raw, - by - intro x - obtain ⟨p, equal⟩ := M.exists_stageOneConditionCode a c b d T T2 valid - pairing unions powers separation carrier order nodes hT indices base directed system collection - (SetMembers.raw_mem x) - refine ⟨p, SetMembers.raw_injective Q ?_⟩ - exact (SetMembers.raw_ofMem _ _).trans equal⟩ - -theorem stageOneConditionEquiv_raw (p : Condition) : - SetMembers.raw (M.stageOneConditionEquiv a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection p) = p.code c := - SetMembers.raw_ofMem _ _ - -noncomputable def stageOneConditionPresentation : Presentation (Shrink Condition) where - carrier := Q - encode x := ((equivShrink Condition).symm x).code c - injective := StageOneCondition.code_injective c |>.comp (equivShrink Condition).symm.injective - mem_carrier z := by - constructor - · intro member - obtain ⟨p, equal⟩ := M.exists_stageOneConditionCode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection member - exact ⟨equivShrink Condition p, by simpa only [Equiv.symm_apply_apply] using equal⟩ - · rintro ⟨x, equal⟩ - exact equal ▸ M.stageOneConditionCode_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection ((equivShrink Condition).symm x) - -theorem stageOneConditionPresentation_encode (p : Condition) : - (M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection).encode (equivShrink Condition p) = p.code c := by - exact congrArg (fun q : Condition => q.code c) ((equivShrink Condition).symm_apply_apply p) - -include nodes indices system in -theorem stageOneConditionPresentation_carrier_mem - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - (M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection).carrier ∈ M.sets := - M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system nodeOrder omega - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid - -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 - -noncomputable def stageOneEmptyInclusion (p : P) : Shrink Condition := - equivShrink Condition (emptyRow p) - -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - -theorem stageOneEmptyInclusion_encode (p : P) : - (pres).encode (incl p) = c.pairEmpty.encode p := - M.stageOneConditionPresentation_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection (emptyRow p) - -theorem stageOneEmptyInclusion_lowerGraph : - c.pairEmpty.graph (pres) incl = identityFunctionGraph c.pairEmpty.carrier := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph, mem_identityFunctionGraph] - constructor - · rintro ⟨p, rfl⟩ - rw [M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection p] - exact ⟨c.pairEmpty.encode p, c.pairEmpty.encode_mem p, rfl⟩ - · rintro ⟨x, hx, rfl⟩ - obtain ⟨p, rfl⟩ := (c.pairEmpty.mem_carrier x).1 hx - exact ⟨p, congrArg (ZFSet.pair (c.pairEmpty.encode p)) - (M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection p)⟩ - -theorem stageOneEmptyInclusion_lowerGraph_mem : - c.pairEmpty.graph (pres) incl ∈ M.sets := by - rw [M.stageOneEmptyInclusion_lowerGraph a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] - exact M.identityFunctionGraph_mem pairing unions powers separation pairedCarrier - -theorem stageOneEmptyInclusion_originalGraph : - c.graph (pres) incl = c.graph c.pairEmpty id := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph, Presentation.mem_graph] - simp only [M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection, id_eq] - -theorem stageOneEmptyInclusion_originalGraph_mem : c.graph (pres) incl ∈ M.sets := by - rw [M.stageOneEmptyInclusion_originalGraph a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] - exact M.pairEmpty_forwardGraph_mem pairing unions powers separation c carrier - -noncomputable def stageOneNameLift (tau : Name c.pairEmpty) : Name (pres) := - Name.rename (pres) incl tau - -theorem stageOneNameLift_val (tau : Name c.pairEmpty) : - (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system collection tau).val = tau.val := - Name.rename_val_of_encode (pres) incl - (M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection) tau - -theorem stageOneNameLift_mem (tau : Name c.pairEmpty) (ground : tau.val ∈ M.sets) : - (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system collection tau).val ∈ M.sets := by - rw [M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system collection] - exact ground - -theorem stageOneNameLift_eval (H : Set (Shrink Condition)) (tau : Name c.pairEmpty) : - Name.eval H (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system collection tau) = Name.eval {p | incl p ∈ H} tau := - Name.eval_rename (pres) incl H tau - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeInternalClosure + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +def StageOneConditionCode (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) + (z : ZFSet.{u}) : Prop := + ∃ p A, z = ZFSet.pair p A ∧ stageOneRawTests M d A (ZFSet.pair p ∅) + +namespace SetFormula + +def stageOneConditionFormula {n : Nat} (d : Fin 15 → Fin n) (z : Fin n) : SetFormula n := + let old := suffixIndex n 4 + let v := prefixIndex n 4 + exBlock 4 (.conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)).toFormula + (.conj (BoundedFormula.emptyFormula (v 2)).toFormula + (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 2)).toFormula + (stageOneTestsFormula (fun j => old (d j)) (v 1) (v 3))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_stageOneConditionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n : Nat} (d : Fin 15 → Fin n) (z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (stageOneConditionFormula d z) env ↔ + StageOneConditionCode M (fun j => env (d j)) (env z) := by + rw [stageOneConditionFormula, realize_exBlock] + have actual (f : Fin 4 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (.conj + (BoundedFormula.orderedPairFormula (suffixIndex n 4 z) (prefixIndex n 4 0) (prefixIndex n 4 1)).toFormula + (.conj (BoundedFormula.emptyFormula (prefixIndex n 4 2)).toFormula + (.conj (BoundedFormula.orderedPairFormula (prefixIndex n 4 3) (prefixIndex n 4 0) (prefixIndex n 4 2)).toFormula + (stageOneTestsFormula (fun j => suffixIndex n 4 (d j)) (prefixIndex n 4 1) (prefixIndex n 4 3))))) + (extendMany 4 f env) ↔ + env z = ZFSet.pair (f 0) (f 1) ∧ f 2 = ∅ ∧ f 3 = ZFSet.pair (f 0) (f 2) ∧ + stageOneRawTests M (fun j => env (d j)) (f 1) (f 3) := by + have allground := extendMany_members 4 f env ground members + apply and_congr + · rw [BoundedFormula.realize_toFormula M _ _ allground, BoundedFormula.truth_orderedPairFormula] + simp only [extendMany_prefix, extendMany_suffix] + apply and_congr + · rw [BoundedFormula.realize_toFormula M _ _ allground, BoundedFormula.truth_emptyFormula] + simp only [extendMany_prefix] + apply and_congr + · rw [BoundedFormula.realize_toFormula M _ _ allground, BoundedFormula.truth_orderedPairFormula] + simp only [extendMany_prefix] + rw [M.realize_stageOneTestsFormula _ _ _ _ allground] + simp only [extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, body⟩ + obtain ⟨pair, empty, lower, tests⟩ := (actual f ground).1 body + refine ⟨f 0, f 1, pair, ?_⟩ + rw [empty] at lower + exact lower ▸ tests + · rintro ⟨p, A, equal, tests⟩ + have hp : p ∈ M.sets := M.pair_left (equal ▸ members z) + have hA : A ∈ M.sets := M.pair_right (equal ▸ members z) + have empty : (∅ : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env z, members z⟩ + have lower := M.orderedPair_mem pairing hp empty + let f : Fin 4 → ZFSet.{u} := ![p,A,∅,ZFSet.pair p ∅] + have ground : ∀ j, f j ∈ M.sets := + Fin.cases hp (Fin.cases hA (Fin.cases empty (Fin.cases lower (fun j => Fin.elim0 j)))) + exact ⟨f, ground, (actual f ground).2 ⟨equal,rfl,rfl,tests⟩⟩ + +noncomputable def stageOneConditions (rawRowCarrier : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (StageOneConditionCode M d) (M.stageOneCandidateBound rawRowCarrier (d 0) (d 6)) + +theorem mem_stageOneConditions (rawRowCarrier : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) (z : ZFSet.{u}) : + z ∈ M.stageOneConditions rawRowCarrier d ↔ + z ∈ M.stageOneCandidateBound rawRowCarrier (d 0) (d 6) ∧ StageOneConditionCode M d z := + ZFSet.mem_sep + +theorem pair_mem_stageOneConditions (rawRowCarrier : ZFSet.{u}) (d : Fin 15 → ZFSet.{u}) (p A : ZFSet.{u}) : + ZFSet.pair p A ∈ M.stageOneConditions rawRowCarrier d ↔ + p ∈ rawRowCarrier ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments (d 0) (d 6) ∧ + M.groundEmbeddable A ZFSet.omega ∧ stageOneRawTests M d A (ZFSet.pair p ∅) := by + rw [M.mem_stageOneConditions, M.pair_mem_stageOneCandidateBound] + constructor + · rintro ⟨⟨hp,hA,subset,small⟩,p',A',equal,tests⟩ + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective equal + exact ⟨hp,hA,subset,small,tests⟩ + · rintro ⟨hp,hA,subset,small,tests⟩ + exact ⟨⟨hp,hA,subset,small⟩,p,A,rfl,tests⟩ + +theorem stageOneConditions_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {rawRowCarrier : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) (hRow : rawRowCarrier ∈ M.sets) + (members : ∀ j, d j ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.stageOneConditions rawRowCarrier d ∈ M.sets := by + have bound := M.stageOneCandidateBound_mem pairing unions powers separation hRow (members 0) (members 6) omega + let phi : SetFormula 16 := stageOneConditionFormula Fin.succ 0 + have ground := M.separation_mem separation phi d members bound + have equal : ZFSet.sep (fun z => Realize M.sets phi (extend z d)) + (M.stageOneCandidateBound rawRowCarrier (d 0) (d 6)) = M.stageOneConditions rawRowCarrier d := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_stageOneConditions] + apply and_congr_right + intro hz + exact M.realize_stageOneConditionFormula pairing Fin.succ 0 (extend z d) + (Fin.cases (M.transitive bound hz) members) + exact equal ▸ ground + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) + +structure StageOneCondition where + row : P + assignments : ZFSet.{u} + assignments_mem : assignments ∈ M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega + tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 assignments row + +namespace StageOneCondition +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 + +@[ext] theorem ext {p q : Condition} (rows : p.row = q.row) (data : p.assignments = q.assignments) : p = q := by + cases p + cases q + cases rows + cases data + rfl + +noncomputable def empty (row : P) : Condition where + row := row + assignments := ∅ + assignments_mem := (M.mem_groundSmallSubsets _ _ ∅).2 + ⟨M.empty_mem ⟨T, hT⟩, ZFSet.empty_subset _, M.empty_groundEmbeddable ZFSet.omega ⟨T, hT⟩⟩ + tests := M.stageOneTests_empty s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 row + +theorem empty_row (row : P) : + (empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 row).row = row := rfl + +theorem empty_assignments (row : P) : + (empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 row).assignments = ∅ := rfl + +end StageOneCondition + + + + + +namespace StageOneCondition +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 + +instance partialOrder : PartialOrder Condition where + le p q := p.row ≤ q.row ∧ q.assignments ⊆ p.assignments + le_refl _ := ⟨le_rfl, fun _ h => h⟩ + le_trans _ _ _ first second := ⟨first.1.trans second.1, fun _ h => first.2 (second.2 h)⟩ + le_antisymm p q first second := by + apply ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 + (le_antisymm first.1 second.1) + apply ZFSet.ext + intro z + exact ⟨fun h => second.2 h, fun h => first.2 h⟩ + +theorem le_iff (p q : Condition) : p ≤ q ↔ p.row ≤ q.row ∧ q.assignments ⊆ p.assignments := Iff.rfl + +def rowProjection : Condition →o P where + toFun p := p.row + monotone' _ _ below := below.1 + +noncomputable def emptyEmbedding : P ↪o Condition where + toFun := empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 + inj' _ _ equal := congrArg StageOneCondition.row equal + map_rel_iff' := ⟨fun below => below.1, fun below => ⟨below, fun _ h => h⟩⟩ + +noncomputable instance orderTop : OrderTop Condition where + top := empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 ⊤ + le_top p := ⟨le_top, ZFSet.empty_subset p.assignments⟩ + +theorem rowProjection_empty (row : P) : + rowProjection M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 + (empty M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 row) = row := rfl + +end StageOneCondition + + + + +namespace StageOneCondition +variable {M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2} +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 + +noncomputable def withRow (p : Condition) (row : P) (below : row ≤ p.row) : Condition where + row := row + assignments := p.assignments + assignments_mem := p.assignments_mem + tests := M.stageOneTests_mono s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 p.assignments p.tests below + +theorem withRow_row (p : Condition) (row : P) (below : row ≤ p.row) : + (p.withRow row below).row = row := rfl + +theorem withRow_assignments (p : Condition) (row : P) (below : row ≤ p.row) : + (p.withRow row below).assignments = p.assignments := rfl + +theorem withRow_le (p : Condition) (row : P) (below : row ≤ p.row) : + p.withRow row below ≤ p := ⟨below, fun _ h => h⟩ + +theorem exists_lift_row (p : Condition) (row : P) (below : row ≤ p.row) : + ∃ q : Condition, q ≤ p ∧ q.row = row ∧ q.assignments = p.assignments := + ⟨p.withRow row below, p.withRow_le row below, rfl, rfl⟩ + +end StageOneCondition + + + + +namespace StageOneCondition +variable {M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2} +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 + +noncomputable def code (p : Condition) (c : Presentation P) : ZFSet.{u} := + ZFSet.pair (c.encode p.row) p.assignments + +theorem code_eq_iff (c : Presentation P) (p q : Condition) : + p.code c = q.code c ↔ p.row = q.row ∧ p.assignments = q.assignments := by + rw [code, code, ZFSet.pair_inj] + exact and_congr c.injective.eq_iff Iff.rfl + +theorem code_injective (c : Presentation P) : Function.Injective (fun p : Condition => p.code c) := by + intro p q equal + obtain ⟨rows, assignments⟩ := (code_eq_iff c p q).1 equal + exact ext M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2 rows assignments + +theorem code_mem_candidateBound (c : Presentation P) (p : Condition) : + p.code c ∈ M.stageOneCandidateBound c.carrier + (M.niceRefinementIndices a s b d ∅ T T2 valid) T := + ZFSet.pair_mem_prod.2 ⟨c.encode_mem p.row, p.assignments_mem⟩ + +instance small : Small.{u} Condition := by + let bound := M.stageOneCandidateBound s.carrier (M.niceRefinementIndices a s b d ∅ T T2 valid) T + let f : Condition → bound := fun p => ⟨p.code s, code_mem_candidateBound s p⟩ + apply small_of_injective.{u} (f := f) + intro p q equal + exact code_injective s (congrArg Subtype.val equal) + +end StageOneCondition + + + + +namespace StageOneCondition +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 + +noncomputable def chainUnion (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) + (below : ∀ n, row ≤ (seq n).row) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) : Condition where + row := row + assignments := stageOneAssignmentUnion (fun n => (seq n).assignments) + assignments_mem := small + tests := M.stageOneTests_union s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 (fun n => (seq n).assignments) (fun n => (seq n).row) row + (fun _ _ less => (decreasing less).2) below (fun n => (seq n).tests) + +theorem chainUnion_row (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) + (below : ∀ n, row ≤ (seq n).row) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) : + (chainUnion M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 seq decreasing row below small).row = row := rfl + +theorem chainUnion_assignments (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) + (below : ∀ n, row ≤ (seq n).row) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) : + (chainUnion M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 seq decreasing row below small).assignments = + stageOneAssignmentUnion (fun n => (seq n).assignments) := rfl + +theorem chainUnion_le (seq : Nat → Condition) (decreasing : Antitone seq) (row : P) + (below : ∀ n, row ≤ (seq n).row) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) ZFSet.omega) (n : Nat) : + chainUnion M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 seq decreasing row below small ≤ seq n := + ⟨below n, stageOneAssignmentUnion_contains (fun n => (seq n).assignments) n⟩ + +end StageOneCondition +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + +noncomputable def stageOneForcing : ZFSet.{u} := + M.stageOneConditions c.carrier (M.stageOneFormulaData a c.pairEmpty b d T T2 valid) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) + +include pairing unions powers separation carrier order nodes hT indices system in +theorem stageOneForcing_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.stageOneForcing a c b d T T2 valid ∈ M.sets := by + have pairedCarrier := M.pairEmpty_carrier_mem pairing unions powers separation c carrier + have pairedOrder := M.pairEmpty_order_mem pairing unions powers separation c carrier order + exact M.stageOneConditions_mem pairing unions powers separation _ carrier + (M.stageOneFormulaData_members a c.pairEmpty b d T T2 valid pairing unions powers separation + hT pairedCarrier pairedOrder nodes nodeOrder valid2 indices base directed system) omega + +variable (collection : CollectionSchema M.sets) + +include nodes indices in +theorem stageOneForcing_entry (p : P) (A : ZFSet.{u}) : + ZFSet.pair (c.encode p) A ∈ M.stageOneForcing a c b d T T2 valid ↔ + A ∈ M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega ∧ + M.stageOneTests c.pairEmpty pairing unions powers separation collection + (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) + (M.pairEmpty_order_mem pairing unions powers separation c carrier order) hT valid + a b d base directed system T2 A p := by + rw [stageOneForcing, M.pair_mem_stageOneConditions, M.mem_groundSmallSubsets] + have tests := M.stageOneRawTests_iff a c.pairEmpty b d pairing unions powers separation collection + (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) + (M.pairEmpty_order_mem pairing unions powers separation c carrier order) nodes hT valid indices + base directed system A p + constructor + · rintro ⟨_, ground, subset, small, raw⟩ + exact ⟨⟨ground, subset, small⟩, tests.1 raw⟩ + · rintro ⟨⟨ground, subset, small⟩, typed⟩ + exact ⟨c.encode_mem p, ground, subset, small, tests.2 typed⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid + +include nodes indices in +theorem stageOneConditionCode_mem (p : Condition) : p.code c ∈ Q := + (M.stageOneForcing_entry a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system collection p.row p.assignments).2 ⟨p.assignments_mem, p.tests⟩ + +include nodes indices in +theorem exists_stageOneConditionCode {z : ZFSet.{u}} (member : z ∈ Q) : + ∃ p : Condition, p.code c = z := by + have candidate := (M.mem_stageOneConditions c.carrier + (M.stageOneFormulaData a c.pairEmpty b d T T2 valid) z).1 member + obtain ⟨row, A, small, equal⟩ := M.exists_stageOneCandidate_fields c _ _ candidate.1 + have tests := (M.stageOneForcing_entry a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection row A).1 (equal ▸ member) + exact ⟨⟨row, A, small, tests.2⟩, equal.symm⟩ + +include nodes indices in +theorem stageOneConditionCode_range : + ZFSet.range (fun p : Condition => p.code c) = Q := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_range] + constructor + · rintro ⟨p, rfl⟩ + exact M.stageOneConditionCode_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection p + · intro member + exact M.exists_stageOneConditionCode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection member + +noncomputable def stageOneConditionEquiv : Condition ≃ SetMembers Q := + Equiv.ofBijective + (fun p => SetMembers.ofMem (p.code c) (M.stageOneConditionCode_mem a c b d T T2 valid + pairing unions powers separation carrier order nodes hT indices base directed system collection p)) + ⟨by + intro p q equal + apply StageOneCondition.code_injective c + have raw := congrArg SetMembers.raw equal + simpa only [SetMembers.raw_ofMem] using raw, + by + intro x + obtain ⟨p, equal⟩ := M.exists_stageOneConditionCode a c b d T T2 valid + pairing unions powers separation carrier order nodes hT indices base directed system collection + (SetMembers.raw_mem x) + refine ⟨p, SetMembers.raw_injective Q ?_⟩ + exact (SetMembers.raw_ofMem _ _).trans equal⟩ + +theorem stageOneConditionEquiv_raw (p : Condition) : + SetMembers.raw (M.stageOneConditionEquiv a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection p) = p.code c := + SetMembers.raw_ofMem _ _ + +noncomputable def stageOneConditionPresentation : Presentation (Shrink Condition) where + carrier := Q + encode x := ((equivShrink Condition).symm x).code c + injective := StageOneCondition.code_injective c |>.comp (equivShrink Condition).symm.injective + mem_carrier z := by + constructor + · intro member + obtain ⟨p, equal⟩ := M.exists_stageOneConditionCode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection member + exact ⟨equivShrink Condition p, by simpa only [Equiv.symm_apply_apply] using equal⟩ + · rintro ⟨x, equal⟩ + exact equal ▸ M.stageOneConditionCode_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection ((equivShrink Condition).symm x) + +theorem stageOneConditionPresentation_encode (p : Condition) : + (M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection).encode (equivShrink Condition p) = p.code c := by + exact congrArg (fun q : Condition => q.code c) ((equivShrink Condition).symm_apply_apply p) + +include nodes indices system in +theorem stageOneConditionPresentation_carrier_mem + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + (M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection).carrier ∈ M.sets := + M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system nodeOrder omega + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid + +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 + +noncomputable def stageOneEmptyInclusion (p : P) : Shrink Condition := + equivShrink Condition (emptyRow p) + +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + +theorem stageOneEmptyInclusion_encode (p : P) : + (pres).encode (incl p) = c.pairEmpty.encode p := + M.stageOneConditionPresentation_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection (emptyRow p) + +theorem stageOneEmptyInclusion_lowerGraph : + c.pairEmpty.graph (pres) incl = identityFunctionGraph c.pairEmpty.carrier := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph, mem_identityFunctionGraph] + constructor + · rintro ⟨p, rfl⟩ + rw [M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection p] + exact ⟨c.pairEmpty.encode p, c.pairEmpty.encode_mem p, rfl⟩ + · rintro ⟨x, hx, rfl⟩ + obtain ⟨p, rfl⟩ := (c.pairEmpty.mem_carrier x).1 hx + exact ⟨p, congrArg (ZFSet.pair (c.pairEmpty.encode p)) + (M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection p)⟩ + +theorem stageOneEmptyInclusion_lowerGraph_mem : + c.pairEmpty.graph (pres) incl ∈ M.sets := by + rw [M.stageOneEmptyInclusion_lowerGraph a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] + exact M.identityFunctionGraph_mem pairing unions powers separation pairedCarrier + +theorem stageOneEmptyInclusion_originalGraph : + c.graph (pres) incl = c.graph c.pairEmpty id := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph, Presentation.mem_graph] + simp only [M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection, id_eq] + +theorem stageOneEmptyInclusion_originalGraph_mem : c.graph (pres) incl ∈ M.sets := by + rw [M.stageOneEmptyInclusion_originalGraph a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] + exact M.pairEmpty_forwardGraph_mem pairing unions powers separation c carrier + +noncomputable def stageOneNameLift (tau : Name c.pairEmpty) : Name (pres) := + Name.rename (pres) incl tau + +theorem stageOneNameLift_val (tau : Name c.pairEmpty) : + (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system collection tau).val = tau.val := + Name.rename_val_of_encode (pres) incl + (M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection) tau + +theorem stageOneNameLift_mem (tau : Name c.pairEmpty) (ground : tau.val ∈ M.sets) : + (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system collection tau).val ∈ M.sets := by + rw [M.stageOneNameLift_val a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system collection] + exact ground + +theorem stageOneNameLift_eval (H : Set (Shrink Condition)) (tau : Name c.pairEmpty) : + Name.eval H (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system collection tau) = Name.eval {p | incl p ∈ H} tau := + Name.eval_rename (pres) incl H tau + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneRawNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneRawNames.lean index e26b653f622623540529853320f63f5bc0f0b125..c758c13d569dc258722a62e938a3d8e6fa982172 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneRawNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageOneRawNames.lean @@ -1,76 +1,76 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundStageOneFormulaData - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -theorem stageOneRawClass_iff (R w : (M.nameDomain s).names) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) R.val.val w.val.val z ↔ - z = (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w).val.val := - M.realize_refinementClassCodeFormula s pairing unions powers separation collection carrier order - hT valid R.val w.val R.property w.property z hz - -theorem stageOneClassName_mem_bound (R w : (M.nameDomain s).names) : - (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w).val.val ∈ - M.groundRelations T s.carrier := - (M.mem_groundRelations T s.carrier _).2 - ⟨(M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w).property, - Name.refinementClass_subset T valid R.val w.val⟩ - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable {T2 : ZFSet.{u}} {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) - -include indices in -theorem stageOneFormulaData_fields (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid) : - let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let data := M.stageOneFormulaData a s b d T T2 valid - (∀ z, ZFSet.pair idx z ∈ data 1 ↔ z = b.encode C) ∧ - (∀ z, ZFSet.pair idx z ∈ data 2 ↔ z = b.encode E) ∧ - (∀ z, ZFSet.pair idx z ∈ data 3 ↔ z = U.val.val) ∧ - (∀ z, ZFSet.pair idx z ∈ data 4 ↔ z = Rf.val.val) ∧ - (∀ z, ZFSet.pair idx z ∈ data 5 ↔ z = Rc.val.val) := - ⟨M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 1, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 2, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 3, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 4, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 5⟩ - -include indices in -theorem stageOneFormulaData_map (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid) (z : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) z ∈ - M.stageOneFormulaData a s b d T T2 valid 12 ↔ - z = (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc).val.val := - M.niceRefinementNameGraph_entry a s b d indices pairing unions powers separation collection hT carrier order - 2 C E U Rf Rc member z - -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem stageOneFormulaData_visibility (v : L) (z : ZFSet.{u}) : - ZFSet.pair (b.encode v) z ∈ M.stageOneFormulaData a s b d T T2 valid 13 ↔ - z = (M.stageOneVisibilityName s valid a b d base directed system v).val.val := - system.visibility_entries v z - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundStageOneFormulaData + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +theorem stageOneRawClass_iff (R w : (M.nameDomain s).names) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) R.val.val w.val.val z ↔ + z = (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w).val.val := + M.realize_refinementClassCodeFormula s pairing unions powers separation collection carrier order + hT valid R.val w.val R.property w.property z hz + +theorem stageOneClassName_mem_bound (R w : (M.nameDomain s).names) : + (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w).val.val ∈ + M.groundRelations T s.carrier := + (M.mem_groundRelations T s.carrier _).2 + ⟨(M.stageOneClassName s pairing unions powers separation collection carrier order hT valid R w).property, + Name.refinementClass_subset T valid R.val w.val⟩ + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable {T2 : ZFSet.{u}} {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) + +include indices in +theorem stageOneFormulaData_fields (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid) : + let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let data := M.stageOneFormulaData a s b d T T2 valid + (∀ z, ZFSet.pair idx z ∈ data 1 ↔ z = b.encode C) ∧ + (∀ z, ZFSet.pair idx z ∈ data 2 ↔ z = b.encode E) ∧ + (∀ z, ZFSet.pair idx z ∈ data 3 ↔ z = U.val.val) ∧ + (∀ z, ZFSet.pair idx z ∈ data 4 ↔ z = Rf.val.val) ∧ + (∀ z, ZFSet.pair idx z ∈ data 5 ↔ z = Rc.val.val) := + ⟨M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 1, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 2, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 3, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 4, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 5⟩ + +include indices in +theorem stageOneFormulaData_map (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid) (z : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) z ∈ + M.stageOneFormulaData a s b d T T2 valid 12 ↔ + z = (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc).val.val := + M.niceRefinementNameGraph_entry a s b d indices pairing unions powers separation collection hT carrier order + 2 C E U Rf Rc member z + +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem stageOneFormulaData_visibility (v : L) (z : ZFSet.{u}) : + ZFSet.pair (b.encode v) z ∈ M.stageOneFormulaData a s b d T T2 valid 13 ↔ + z = (M.stageOneVisibilityName s valid a b d base directed system v).val.val := + system.visibility_entries v z + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeActionInputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeActionInputs.lean index 77427f739930f29d4cdff43588c62fe9c0502cec..2658c83fbe718aa65a4efe03cb57fadec3dea97b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeActionInputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeActionInputs.lean @@ -1,512 +1,512 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorNameGraphs -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeAssignmentFamilies - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetRealization -universe u v -variable {G : Type v} {R P : Type u} [Group G] -variable [PartialOrder R] [PartialOrder P] - -structure FlatSuccessorActionInputs (M : TransitiveGround.{u}) - (c : Presentation R) (s : Presentation P) - (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) - (rowAction : PosetAction G R) (lowerAction : PosetAction G P) - (image : G → ZFSet.{u} → ZFSet.{u}) : Prop where - small : ∀ g A, A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega → - image g A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega - one : ∀ A, A ⊆ stageOneAssignments I T → image 1 A = A - mul : ∀ g h A, A ⊆ stageOneAssignments I T → - image (g * h) A = image g (image h A) - mono : ∀ g A B, A ⊆ B → image g A ⊆ image g B - lower_code : ∀ g (p : FlatSuccessorCondition M c s I T levels alpha tests), - s.encode (lowerAction.iso g p.lower) = ZFSet.pair (c.encode (rowAction.iso g p.row)) - (assignmentCut levels alpha (image g p.assignments)) - tests : ∀ g (p : FlatSuccessorCondition M c s I T levels alpha tests), - tests (image g p.assignments) (lowerAction.iso g p.lower) - -end - -section -open SetRealization SetFormula -universe u v -variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) - -namespace FlatSuccessorCondition -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "J" => stageOneAssignments I T - -noncomputable def act (g : G) (p : Condition) : Condition where - row := rowAction.iso g p.row - assignments := image g p.assignments - assignments_mem := inputs.small g p.assignments p.assignments_mem - lower := lowerAction.iso g p.lower - lower_code := inputs.lower_code g p - tests := inputs.tests g p - -local notation "act'" => act M c s I T levels alpha tests rowAction lowerAction image inputs - -theorem act_fields (g : G) (p : Condition) : - (act' g p).row = rowAction.iso g p.row ∧ - (act' g p).assignments = image g p.assignments ∧ (act' g p).lower = lowerAction.iso g p.lower := - ⟨rfl, rfl, rfl⟩ - -theorem act_one (p : Condition) : act' 1 p = p := by - apply ext M c s I T levels alpha tests - · exact rowAction.one p.row - · exact inputs.one p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 - -theorem act_mul (g h : G) (p : Condition) : act' (g * h) p = act' g (act' h p) := by - apply ext M c s I T levels alpha tests - · exact rowAction.mul g h p.row - · exact inputs.mul g h p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 - -theorem act_inv_left (g : G) (p : Condition) : act' g⁻¹ (act' g p) = p := by - rw [← act_mul M c s I T levels alpha tests rowAction lowerAction image inputs, inv_mul_cancel, act_one] - -theorem act_inv_right (g : G) (p : Condition) : act' g (act' g⁻¹ p) = p := by - rw [← act_mul M c s I T levels alpha tests rowAction lowerAction image inputs, mul_inv_cancel, act_one] - -theorem act_le_iff (g : G) (p q : Condition) : act' g p ≤ act' g q ↔ p ≤ q := by - have mono : ∀ g (p q : Condition), p ≤ q → act' g p ≤ act' g q := by - intro g p q below - exact ⟨(rowAction.iso g).monotone below.1, inputs.mono g q.assignments p.assignments below.2⟩ - constructor - · intro below - have back := mono g⁻¹ _ _ below - simpa only [act_inv_left] using back - · exact mono g p q - -noncomputable def actOrderIso (g : G) : Condition ≃o Condition where - toFun := act' g - invFun := act' g⁻¹ - left_inv := act_inv_left M c s I T levels alpha tests rowAction lowerAction image inputs g - right_inv := act_inv_right M c s I T levels alpha tests rowAction lowerAction image inputs g - map_rel_iff' := act_le_iff M c s I T levels alpha tests rowAction lowerAction image inputs g _ _ - -noncomputable def posetAction : PosetAction G Condition where - iso := actOrderIso M c s I T levels alpha tests rowAction lowerAction image inputs - one := act_one M c s I T levels alpha tests rowAction lowerAction image inputs - mul := act_mul M c s I T levels alpha tests rowAction lowerAction image inputs - -end FlatSuccessorCondition - -namespace FlatSuccessorCondition -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "act'" => act M c s I T levels alpha tests rowAction lowerAction image inputs - -theorem act_eq_iff (g : G) (p : Condition) : - act' g p = p ↔ rowAction.iso g p.row = p.row ∧ image g p.assignments = p.assignments := by - constructor - · intro same - exact ⟨congrArg (fun q : Condition => q.row) same, - congrArg (fun q : Condition => q.assignments) same⟩ - · rintro ⟨row, assignments⟩ - exact ext M c s I T levels alpha tests row assignments - -end FlatSuccessorCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u v -variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -local notation "typedAct" => FlatSuccessorCondition.act M c s I T levels alpha tests rowAction lowerAction image inputs - -noncomputable def flatSuccessorSmallAction : - letI := smallOrder - PosetAction G (Shrink Condition) := by - letI := smallOrder - let original := FlatSuccessorCondition.posetAction M c s I T levels alpha tests rowAction lowerAction image inputs - let e := M.flatSuccessorOrderIso c s I T levels alpha tests - exact { - iso := fun g => (e.symm.trans (original.iso g)).trans e - one := by - intro q - change e (original.iso 1 (e.symm q)) = q - rw [original.one, e.apply_symm_apply] - mul := by - intro g h q - change e (original.iso (g * h) (e.symm q)) = - e (original.iso g (e.symm (e (original.iso h (e.symm q))))) - rw [e.symm_apply_apply, original.mul] } - -local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs - -theorem flatSuccessorSmallAction_decode : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (equivShrink Condition).symm ((smallAct).iso g q) = - typedAct g ((equivShrink Condition).symm q) := by - let := smallOrder - intro g q - change (equivShrink Condition).symm - (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ - exact (equivShrink Condition).symm_apply_apply _ - -theorem flatSuccessorSmallAction_encode : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (pres).encode ((smallAct).iso g q) = - ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm q).row)) - (image g ((equivShrink Condition).symm q).assignments) := by - let := smallOrder - intro g q - change (pres).encode - (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ - exact M.flatSuccessorPresentation_encode c s I T levels alpha tests _ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests - rowAction lowerAction image inputs -variable (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) -variable (image_eq : ∀ g A, image g A = relationImage A (stageOneAssignments I T) (assignmentGraph g)) -local notation "fullGraph" => M.flatSuccessorFullActionGraph c s I T levels alpha tests - rowAction t assignmentGraph -include image_eq - -theorem flatSuccessorSmallActionGraph_eq : - letI := smallOrder - (smallAct).actionGraph (pres) t = fullGraph := by - let := smallOrder - have encoded (g : G) (x : Shrink Condition) := M.flatSuccessorSmallAction_encode c s I T levels alpha tests rowAction lowerAction image inputs g x - have meaning (g : G) (x y : Shrink Condition) : - ZFSet.pair (ZFSet.pair (t.encode g) ((pres).encode x)) ((pres).encode y) ∈ fullGraph ↔ - (smallAct).iso g x = y := by - change ZFSet.pair (ZFSet.pair (t.encode g) - (ZFSet.pair (c.encode ((equivShrink Condition).symm x).row) - ((equivShrink Condition).symm x).assignments)) - (ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments) ∈ fullGraph ↔ _ - rw [M.flatSuccessorFullActionGraph_entry, ← image_eq g] - constructor - · rintro ⟨_,_,rowEqual,assignmentEqual⟩ - apply (pres).injective - rw [encoded] - change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) - (image g ((equivShrink Condition).symm x).assignments) = - ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments - rw [rowEqual, assignmentEqual] - · intro equal - have codeEqual := congrArg (pres).encode equal - rw [encoded] at codeEqual - change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) - (image g ((equivShrink Condition).symm x).assignments) = - ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments at codeEqual - obtain ⟨rowEqual,assignmentEqual⟩ := ZFSet.pair_injective codeEqual - exact ⟨(pres).encode_mem x,(pres).encode_mem y,c.injective rowEqual,assignmentEqual.symm⟩ - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨⟨g,x⟩,rfl⟩ := ((t.product (pres)).mem_graph (pres) (fun gx => (smallAct).iso gx.1 gx.2) z).1 member - exact (meaning g x ((smallAct).iso g x)).2 rfl - · intro member - have boundMember := member - unfold flatSuccessorFullActionGraph rowAssignmentActionGraph at boundMember - have bounds : z ∈ ZFSet.prod (ZFSet.prod t.carrier (pres).carrier) (pres).carrier := - (ZFSet.mem_sep.1 boundMember).1 - obtain ⟨source,hSource,y,hy,rfl⟩ := ZFSet.mem_prod.1 bounds - obtain ⟨g,hg,x,hx,rfl⟩ := ZFSet.mem_prod.1 hSource - obtain ⟨g,rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨x,rfl⟩ := ((pres).mem_carrier x).1 hx - obtain ⟨y,rfl⟩ := ((pres).mem_carrier y).1 hy - exact ((smallAct).triple_mem_actionGraph (pres) t g x y).2 ((meaning g x y).1 member) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (rows : c.carrier ∈ M.sets) -variable (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) -variable (assignments : stageOneAssignments I T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) -variable (assignmentMaps : familyCodeGraph t.encode assignmentGraph ∈ M.sets) -include pairing unions powers separation rows conditions assignments omega group rowMaps assignmentMaps - -theorem flatSuccessorSmallActionGraph_mem : - letI := smallOrder - (smallAct).actionGraph (pres) t ∈ M.sets := by - let := smallOrder - rw [M.flatSuccessorSmallActionGraph_eq c s I T levels alpha tests - rowAction lowerAction image inputs t assignmentGraph image_eq] - exact M.flatSuccessorFullActionGraph_mem c s I T levels alpha tests rowAction t assignmentGraph - pairing unions powers separation rows conditions assignments omega group rowMaps assignmentMaps - -theorem flatSuccessorSmallActionMapFamily_mem (collection : CollectionSchema M.sets) : - letI := smallOrder - (smallAct).conditionMapFamily (pres) t ∈ M.sets := by - let := smallOrder - exact M.conditionMapFamily_mem_of_actionGraph (smallAct) (pres) t - pairing unions powers separation collection conditions group - (M.flatSuccessorSmallActionGraph_mem c s I T levels alpha tests - rowAction lowerAction image inputs t assignmentGraph image_eq - pairing unions powers separation rows conditions assignments omega group rowMaps assignmentMaps) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u v -variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs - -theorem flatSuccessorSmallAction_fixed_iff : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (smallAct).iso g q = q ↔ - rowAction.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row ∧ - image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments := by - let := smallOrder - intro g q - have decoded := M.flatSuccessorSmallAction_decode c s I T levels alpha tests - rowAction lowerAction image inputs g q - have typed := FlatSuccessorCondition.act_eq_iff M c s I T levels alpha tests - rowAction lowerAction image inputs g ((equivShrink Condition).symm q) - constructor - · intro same - apply typed.1 - exact decoded.symm.trans (congrArg (equivShrink Condition).symm same) - · intro fields - apply (equivShrink Condition).symm.injective - exact decoded.trans (typed.2 fields) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u v -variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "smallRestrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F -local notation "smallInc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws - -theorem flatSuccessorSmallRestriction_equivariant : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - smallRestrict ((smallAct).iso g q) = lowerAction.iso g (smallRestrict q) := by - let := smallOrder - intro g q - change ((equivShrink Condition).symm ((smallAct).iso g q)).lower = - lowerAction.iso g ((equivShrink Condition).symm q).lower - rw [M.flatSuccessorSmallAction_decode] - rfl - -theorem flatSuccessorSmallInclusion_equivariant : - letI := smallOrder - ∀ (g : G) (p : P), - (smallAct).iso g (smallInc p) = smallInc (lowerAction.iso g p) := by - let := smallOrder - have retract (p : P) : smallRestrict (smallInc p) = p := by - change ((equivShrink Condition).symm - (equivShrink Condition (FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws p))).lower = p - rw [Equiv.symm_apply_apply] - rfl - have le_include (q : Shrink Condition) (p : P) : - q ≤ smallInc p ↔ smallRestrict q ≤ p := by - change (equivShrink Condition).symm q ≤ - (equivShrink Condition).symm (equivShrink Condition - (FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws p)) ↔ _ - rw [Equiv.symm_apply_apply] - exact FlatSuccessorCondition.le_inclusion_iff M c s I T levels alpha tests F laws _ p - have forward (h : G) (p : P) : - (smallAct).iso h (smallInc p) ≤ smallInc (lowerAction.iso h p) := by - apply (le_include _ _).2 - rw [M.flatSuccessorSmallRestriction_equivariant, retract] - intro g p - apply le_antisymm (forward g p) - have back := ((smallAct).iso g).monotone (forward g⁻¹ (lowerAction.iso g p)) - have cancel : lowerAction.iso g⁻¹ (lowerAction.iso g p) = p := by - rw [← lowerAction.mul, inv_mul_cancel, lowerAction.one] - rw [cancel, ← (smallAct).mul, mul_inv_cancel, (smallAct).one] at back - exact back - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u v -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws -local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws -variable {G : Type v} [Group G] -variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) -variable (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) -local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs - -theorem flatSuccessorNameLift_act : - letI := smallOrder - ∀ (g : G) (τ : Name s), - (smallAct).act (pres) g (liftName τ) = liftName (lowerAction.act s g τ) := by - let := smallOrder - intro g τ - exact lowerAction.act_rename_of_equivariant (smallAct) s (pres) inc - (fun g p => (M.flatSuccessorSmallInclusion_equivariant c s I T levels alpha tests rowAction lowerAction image inputs F laws g p).symm) g τ - -theorem flatSuccessorNameLift_stabilizer : - letI := smallOrder - ∀ τ : Name s, (smallAct).stabilizer (pres) (liftName τ) = lowerAction.stabilizer s τ := by - let := smallOrder - intro τ - apply Subgroup.ext - intro g - change (smallAct).act (pres) g (liftName τ) = liftName τ ↔ lowerAction.act s g τ = τ - rw [M.flatSuccessorNameLift_act c s I T levels alpha tests F laws rowAction lowerAction image inputs] - constructor - · intro equal - apply Subtype.ext - have codes := congrArg Subtype.val equal - simpa only [M.flatSuccessorNameLift_val c s I T levels alpha tests F laws] using codes - · intro equal - exact congrArg liftName equal - -theorem flatSuccessorNameLift_supported (K : Subgroup G) (τ : Name s) - (supported : K ≤ lowerAction.stabilizer s τ) : - letI := smallOrder - K ≤ (smallAct).stabilizer (pres) (liftName τ) := by - let := smallOrder - rw [M.flatSuccessorNameLift_stabilizer c s I T levels alpha tests F laws rowAction lowerAction image inputs] - exact supported - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P P2 L : Type u} -variable [Group G] [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable (a0 : PosetAction G R) (s0 c : Presentation R) -variable (a1 : PosetAction G P) (s1 : Presentation P) -variable (a2 : PosetAction G P2) (s2 : Presentation P2) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 -local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T - -theorem stageThreeActionInputs - (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) - (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) - (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) - (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) - (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) - (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) - (first : RefinementIndexLevelCode I0 ∅) (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (third : RefinementIndexLevelCode I2 (natSetCode 2)) - (omega : ZFSet.omega ∈ M.sets) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (system2 : NiceNameSystem M a2 s2 b d base directed T v2) - (F : FlatConditionSystem M c s2 (stageOneAssignments (I0 ∪ I1) T)) - (row_equivariant : ∀ g q, F.row (a2.iso g q) = a0.iso g (F.row q)) - (data_equivariant : ∀ g q, F.assignments (a2.iso g q) = - M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g (F.assignments q)) : - FlatSuccessorActionInputs M c s2 ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) - (M.refinementLevelTests s2 pairing unions powers separation collection carrier2 order2 hT v2 - a2 b d base directed system2 (natSetCode 2) T2) a0 a2 image := by - let tests := M.refinementLevelTests s2 pairing unions powers separation collection carrier2 order2 hT v2 - a2 b d base directed system2 (natSetCode 2) T2 - refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ - · intro g A member - exact M.stageThreeAssignmentImage_small a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third hT hT2 hI0 hI1 hI2 omega g member - · intro A subset - exact M.stageThreeAssignmentImage_one a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third subset - · intro g h A subset - exact M.stageThreeAssignmentImage_mul a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third g h subset - · intro g A B subset - exact M.stageThreeAssignmentImage_mono a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g subset - · intro g p - rw [F.encode, row_equivariant, data_equivariant, - FlatSuccessorCondition.lower_row M c s2 ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F p, - FlatSuccessorCondition.lower_assignments M c s2 ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F p] - exact congrArg (ZFSet.pair (c.encode (a0.iso g p.row))) - (M.stageThreeAssignmentImage_cut a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 - params0 params1 first second third g p.assignments).symm - · intro g p - exact (M.stageThreeTests_image_iff a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier2 order2 params2.condition_maps hT - params2.terms_closed params2.pairs_closed params2.family_ground base directed system2 first second third - g p.assignments p.lower).2 p.tests - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorNameGraphs +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeAssignmentFamilies + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetRealization +universe u v +variable {G : Type v} {R P : Type u} [Group G] +variable [PartialOrder R] [PartialOrder P] + +structure FlatSuccessorActionInputs (M : TransitiveGround.{u}) + (c : Presentation R) (s : Presentation P) + (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) + (rowAction : PosetAction G R) (lowerAction : PosetAction G P) + (image : G → ZFSet.{u} → ZFSet.{u}) : Prop where + small : ∀ g A, A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega → + image g A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega + one : ∀ A, A ⊆ stageOneAssignments I T → image 1 A = A + mul : ∀ g h A, A ⊆ stageOneAssignments I T → + image (g * h) A = image g (image h A) + mono : ∀ g A B, A ⊆ B → image g A ⊆ image g B + lower_code : ∀ g (p : FlatSuccessorCondition M c s I T levels alpha tests), + s.encode (lowerAction.iso g p.lower) = ZFSet.pair (c.encode (rowAction.iso g p.row)) + (assignmentCut levels alpha (image g p.assignments)) + tests : ∀ g (p : FlatSuccessorCondition M c s I T levels alpha tests), + tests (image g p.assignments) (lowerAction.iso g p.lower) + +end + +section +open SetRealization SetFormula +universe u v +variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) + +namespace FlatSuccessorCondition +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "J" => stageOneAssignments I T + +noncomputable def act (g : G) (p : Condition) : Condition where + row := rowAction.iso g p.row + assignments := image g p.assignments + assignments_mem := inputs.small g p.assignments p.assignments_mem + lower := lowerAction.iso g p.lower + lower_code := inputs.lower_code g p + tests := inputs.tests g p + +local notation "act'" => act M c s I T levels alpha tests rowAction lowerAction image inputs + +theorem act_fields (g : G) (p : Condition) : + (act' g p).row = rowAction.iso g p.row ∧ + (act' g p).assignments = image g p.assignments ∧ (act' g p).lower = lowerAction.iso g p.lower := + ⟨rfl, rfl, rfl⟩ + +theorem act_one (p : Condition) : act' 1 p = p := by + apply ext M c s I T levels alpha tests + · exact rowAction.one p.row + · exact inputs.one p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 + +theorem act_mul (g h : G) (p : Condition) : act' (g * h) p = act' g (act' h p) := by + apply ext M c s I T levels alpha tests + · exact rowAction.mul g h p.row + · exact inputs.mul g h p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 + +theorem act_inv_left (g : G) (p : Condition) : act' g⁻¹ (act' g p) = p := by + rw [← act_mul M c s I T levels alpha tests rowAction lowerAction image inputs, inv_mul_cancel, act_one] + +theorem act_inv_right (g : G) (p : Condition) : act' g (act' g⁻¹ p) = p := by + rw [← act_mul M c s I T levels alpha tests rowAction lowerAction image inputs, mul_inv_cancel, act_one] + +theorem act_le_iff (g : G) (p q : Condition) : act' g p ≤ act' g q ↔ p ≤ q := by + have mono : ∀ g (p q : Condition), p ≤ q → act' g p ≤ act' g q := by + intro g p q below + exact ⟨(rowAction.iso g).monotone below.1, inputs.mono g q.assignments p.assignments below.2⟩ + constructor + · intro below + have back := mono g⁻¹ _ _ below + simpa only [act_inv_left] using back + · exact mono g p q + +noncomputable def actOrderIso (g : G) : Condition ≃o Condition where + toFun := act' g + invFun := act' g⁻¹ + left_inv := act_inv_left M c s I T levels alpha tests rowAction lowerAction image inputs g + right_inv := act_inv_right M c s I T levels alpha tests rowAction lowerAction image inputs g + map_rel_iff' := act_le_iff M c s I T levels alpha tests rowAction lowerAction image inputs g _ _ + +noncomputable def posetAction : PosetAction G Condition where + iso := actOrderIso M c s I T levels alpha tests rowAction lowerAction image inputs + one := act_one M c s I T levels alpha tests rowAction lowerAction image inputs + mul := act_mul M c s I T levels alpha tests rowAction lowerAction image inputs + +end FlatSuccessorCondition + +namespace FlatSuccessorCondition +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "act'" => act M c s I T levels alpha tests rowAction lowerAction image inputs + +theorem act_eq_iff (g : G) (p : Condition) : + act' g p = p ↔ rowAction.iso g p.row = p.row ∧ image g p.assignments = p.assignments := by + constructor + · intro same + exact ⟨congrArg (fun q : Condition => q.row) same, + congrArg (fun q : Condition => q.assignments) same⟩ + · rintro ⟨row, assignments⟩ + exact ext M c s I T levels alpha tests row assignments + +end FlatSuccessorCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u v +variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +local notation "typedAct" => FlatSuccessorCondition.act M c s I T levels alpha tests rowAction lowerAction image inputs + +noncomputable def flatSuccessorSmallAction : + letI := smallOrder + PosetAction G (Shrink Condition) := by + letI := smallOrder + let original := FlatSuccessorCondition.posetAction M c s I T levels alpha tests rowAction lowerAction image inputs + let e := M.flatSuccessorOrderIso c s I T levels alpha tests + exact { + iso := fun g => (e.symm.trans (original.iso g)).trans e + one := by + intro q + change e (original.iso 1 (e.symm q)) = q + rw [original.one, e.apply_symm_apply] + mul := by + intro g h q + change e (original.iso (g * h) (e.symm q)) = + e (original.iso g (e.symm (e (original.iso h (e.symm q))))) + rw [e.symm_apply_apply, original.mul] } + +local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs + +theorem flatSuccessorSmallAction_decode : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (equivShrink Condition).symm ((smallAct).iso g q) = + typedAct g ((equivShrink Condition).symm q) := by + let := smallOrder + intro g q + change (equivShrink Condition).symm + (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ + exact (equivShrink Condition).symm_apply_apply _ + +theorem flatSuccessorSmallAction_encode : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (pres).encode ((smallAct).iso g q) = + ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm q).row)) + (image g ((equivShrink Condition).symm q).assignments) := by + let := smallOrder + intro g q + change (pres).encode + (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ + exact M.flatSuccessorPresentation_encode c s I T levels alpha tests _ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests + rowAction lowerAction image inputs +variable (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) +variable (image_eq : ∀ g A, image g A = relationImage A (stageOneAssignments I T) (assignmentGraph g)) +local notation "fullGraph" => M.flatSuccessorFullActionGraph c s I T levels alpha tests + rowAction t assignmentGraph +include image_eq + +theorem flatSuccessorSmallActionGraph_eq : + letI := smallOrder + (smallAct).actionGraph (pres) t = fullGraph := by + let := smallOrder + have encoded (g : G) (x : Shrink Condition) := M.flatSuccessorSmallAction_encode c s I T levels alpha tests rowAction lowerAction image inputs g x + have meaning (g : G) (x y : Shrink Condition) : + ZFSet.pair (ZFSet.pair (t.encode g) ((pres).encode x)) ((pres).encode y) ∈ fullGraph ↔ + (smallAct).iso g x = y := by + change ZFSet.pair (ZFSet.pair (t.encode g) + (ZFSet.pair (c.encode ((equivShrink Condition).symm x).row) + ((equivShrink Condition).symm x).assignments)) + (ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments) ∈ fullGraph ↔ _ + rw [M.flatSuccessorFullActionGraph_entry, ← image_eq g] + constructor + · rintro ⟨_,_,rowEqual,assignmentEqual⟩ + apply (pres).injective + rw [encoded] + change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) + (image g ((equivShrink Condition).symm x).assignments) = + ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments + rw [rowEqual, assignmentEqual] + · intro equal + have codeEqual := congrArg (pres).encode equal + rw [encoded] at codeEqual + change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) + (image g ((equivShrink Condition).symm x).assignments) = + ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments at codeEqual + obtain ⟨rowEqual,assignmentEqual⟩ := ZFSet.pair_injective codeEqual + exact ⟨(pres).encode_mem x,(pres).encode_mem y,c.injective rowEqual,assignmentEqual.symm⟩ + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨⟨g,x⟩,rfl⟩ := ((t.product (pres)).mem_graph (pres) (fun gx => (smallAct).iso gx.1 gx.2) z).1 member + exact (meaning g x ((smallAct).iso g x)).2 rfl + · intro member + have boundMember := member + unfold flatSuccessorFullActionGraph rowAssignmentActionGraph at boundMember + have bounds : z ∈ ZFSet.prod (ZFSet.prod t.carrier (pres).carrier) (pres).carrier := + (ZFSet.mem_sep.1 boundMember).1 + obtain ⟨source,hSource,y,hy,rfl⟩ := ZFSet.mem_prod.1 bounds + obtain ⟨g,hg,x,hx,rfl⟩ := ZFSet.mem_prod.1 hSource + obtain ⟨g,rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨x,rfl⟩ := ((pres).mem_carrier x).1 hx + obtain ⟨y,rfl⟩ := ((pres).mem_carrier y).1 hy + exact ((smallAct).triple_mem_actionGraph (pres) t g x y).2 ((meaning g x y).1 member) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (rows : c.carrier ∈ M.sets) +variable (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) +variable (assignments : stageOneAssignments I T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) +variable (assignmentMaps : familyCodeGraph t.encode assignmentGraph ∈ M.sets) +include pairing unions powers separation rows conditions assignments omega group rowMaps assignmentMaps + +theorem flatSuccessorSmallActionGraph_mem : + letI := smallOrder + (smallAct).actionGraph (pres) t ∈ M.sets := by + let := smallOrder + rw [M.flatSuccessorSmallActionGraph_eq c s I T levels alpha tests + rowAction lowerAction image inputs t assignmentGraph image_eq] + exact M.flatSuccessorFullActionGraph_mem c s I T levels alpha tests rowAction t assignmentGraph + pairing unions powers separation rows conditions assignments omega group rowMaps assignmentMaps + +theorem flatSuccessorSmallActionMapFamily_mem (collection : CollectionSchema M.sets) : + letI := smallOrder + (smallAct).conditionMapFamily (pres) t ∈ M.sets := by + let := smallOrder + exact M.conditionMapFamily_mem_of_actionGraph (smallAct) (pres) t + pairing unions powers separation collection conditions group + (M.flatSuccessorSmallActionGraph_mem c s I T levels alpha tests + rowAction lowerAction image inputs t assignmentGraph image_eq + pairing unions powers separation rows conditions assignments omega group rowMaps assignmentMaps) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u v +variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs + +theorem flatSuccessorSmallAction_fixed_iff : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (smallAct).iso g q = q ↔ + rowAction.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row ∧ + image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments := by + let := smallOrder + intro g q + have decoded := M.flatSuccessorSmallAction_decode c s I T levels alpha tests + rowAction lowerAction image inputs g q + have typed := FlatSuccessorCondition.act_eq_iff M c s I T levels alpha tests + rowAction lowerAction image inputs g ((equivShrink Condition).symm q) + constructor + · intro same + apply typed.1 + exact decoded.symm.trans (congrArg (equivShrink Condition).symm same) + · intro fields + apply (equivShrink Condition).symm.injective + exact decoded.trans (typed.2 fields) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u v +variable (M : TransitiveGround.{u}) {G : Type v} {R P : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "smallRestrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F +local notation "smallInc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws + +theorem flatSuccessorSmallRestriction_equivariant : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + smallRestrict ((smallAct).iso g q) = lowerAction.iso g (smallRestrict q) := by + let := smallOrder + intro g q + change ((equivShrink Condition).symm ((smallAct).iso g q)).lower = + lowerAction.iso g ((equivShrink Condition).symm q).lower + rw [M.flatSuccessorSmallAction_decode] + rfl + +theorem flatSuccessorSmallInclusion_equivariant : + letI := smallOrder + ∀ (g : G) (p : P), + (smallAct).iso g (smallInc p) = smallInc (lowerAction.iso g p) := by + let := smallOrder + have retract (p : P) : smallRestrict (smallInc p) = p := by + change ((equivShrink Condition).symm + (equivShrink Condition (FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws p))).lower = p + rw [Equiv.symm_apply_apply] + rfl + have le_include (q : Shrink Condition) (p : P) : + q ≤ smallInc p ↔ smallRestrict q ≤ p := by + change (equivShrink Condition).symm q ≤ + (equivShrink Condition).symm (equivShrink Condition + (FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws p)) ↔ _ + rw [Equiv.symm_apply_apply] + exact FlatSuccessorCondition.le_inclusion_iff M c s I T levels alpha tests F laws _ p + have forward (h : G) (p : P) : + (smallAct).iso h (smallInc p) ≤ smallInc (lowerAction.iso h p) := by + apply (le_include _ _).2 + rw [M.flatSuccessorSmallRestriction_equivariant, retract] + intro g p + apply le_antisymm (forward g p) + have back := ((smallAct).iso g).monotone (forward g⁻¹ (lowerAction.iso g p)) + have cancel : lowerAction.iso g⁻¹ (lowerAction.iso g p) = p := by + rw [← lowerAction.mul, inv_mul_cancel, lowerAction.one] + rw [cancel, ← (smallAct).mul, mul_inv_cancel, (smallAct).one] at back + exact back + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u v +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws +local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws +variable {G : Type v} [Group G] +variable (rowAction : PosetAction G R) (lowerAction : PosetAction G P) +variable (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : FlatSuccessorActionInputs M c s I T levels alpha tests rowAction lowerAction image) +local notation "smallAct" => M.flatSuccessorSmallAction c s I T levels alpha tests rowAction lowerAction image inputs + +theorem flatSuccessorNameLift_act : + letI := smallOrder + ∀ (g : G) (τ : Name s), + (smallAct).act (pres) g (liftName τ) = liftName (lowerAction.act s g τ) := by + let := smallOrder + intro g τ + exact lowerAction.act_rename_of_equivariant (smallAct) s (pres) inc + (fun g p => (M.flatSuccessorSmallInclusion_equivariant c s I T levels alpha tests rowAction lowerAction image inputs F laws g p).symm) g τ + +theorem flatSuccessorNameLift_stabilizer : + letI := smallOrder + ∀ τ : Name s, (smallAct).stabilizer (pres) (liftName τ) = lowerAction.stabilizer s τ := by + let := smallOrder + intro τ + apply Subgroup.ext + intro g + change (smallAct).act (pres) g (liftName τ) = liftName τ ↔ lowerAction.act s g τ = τ + rw [M.flatSuccessorNameLift_act c s I T levels alpha tests F laws rowAction lowerAction image inputs] + constructor + · intro equal + apply Subtype.ext + have codes := congrArg Subtype.val equal + simpa only [M.flatSuccessorNameLift_val c s I T levels alpha tests F laws] using codes + · intro equal + exact congrArg liftName equal + +theorem flatSuccessorNameLift_supported (K : Subgroup G) (τ : Name s) + (supported : K ≤ lowerAction.stabilizer s τ) : + letI := smallOrder + K ≤ (smallAct).stabilizer (pres) (liftName τ) := by + let := smallOrder + rw [M.flatSuccessorNameLift_stabilizer c s I T levels alpha tests F laws rowAction lowerAction image inputs] + exact supported + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P P2 L : Type u} +variable [Group G] [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable (a0 : PosetAction G R) (s0 c : Presentation R) +variable (a1 : PosetAction G P) (s1 : Presentation P) +variable (a2 : PosetAction G P2) (s2 : Presentation P2) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 +local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T + +theorem stageThreeActionInputs + (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) + (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) + (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) + (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) + (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) + (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) + (first : RefinementIndexLevelCode I0 ∅) (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (third : RefinementIndexLevelCode I2 (natSetCode 2)) + (omega : ZFSet.omega ∈ M.sets) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (system2 : NiceNameSystem M a2 s2 b d base directed T v2) + (F : FlatConditionSystem M c s2 (stageOneAssignments (I0 ∪ I1) T)) + (row_equivariant : ∀ g q, F.row (a2.iso g q) = a0.iso g (F.row q)) + (data_equivariant : ∀ g q, F.assignments (a2.iso g q) = + M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g (F.assignments q)) : + FlatSuccessorActionInputs M c s2 ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) + (M.refinementLevelTests s2 pairing unions powers separation collection carrier2 order2 hT v2 + a2 b d base directed system2 (natSetCode 2) T2) a0 a2 image := by + let tests := M.refinementLevelTests s2 pairing unions powers separation collection carrier2 order2 hT v2 + a2 b d base directed system2 (natSetCode 2) T2 + refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro g A member + exact M.stageThreeAssignmentImage_small a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third hT hT2 hI0 hI1 hI2 omega g member + · intro A subset + exact M.stageThreeAssignmentImage_one a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third subset + · intro g h A subset + exact M.stageThreeAssignmentImage_mul a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third g h subset + · intro g A B subset + exact M.stageThreeAssignmentImage_mono a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g subset + · intro g p + rw [F.encode, row_equivariant, data_equivariant, + FlatSuccessorCondition.lower_row M c s2 ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F p, + FlatSuccessorCondition.lower_assignments M c s2 ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F p] + exact congrArg (ZFSet.pair (c.encode (a0.iso g p.row))) + (M.stageThreeAssignmentImage_cut a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 + params0 params1 first second third g p.assignments).symm + · intro g p + exact (M.stageThreeTests_image_iff a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier2 order2 params2.condition_maps hT + params2.terms_closed params2.pairs_closed params2.family_ground base directed system2 first second third + g p.assignments p.lower).2 p.tests + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeDataBoundFixation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeDataBoundFixation.lean index 8da221767992c33af40c888e45f3890be99a2449..312c776679ef376e3cf496813780640507c3f5fe 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeDataBoundFixation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageThreeDataBoundFixation.lean @@ -1,445 +1,445 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoActionInputs - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "J" => stageOneAssignments I T -local notation "graph" => M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 -local notation "image" => M.refinementAssignmentImage a s b d level T T2 valid valid2 -include pairing unions powers separation collection carrier order maps closed closed2 familyGround - -theorem refinementAssignment_fixed (g : G) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) - (indexFixed : refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val = - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : - let x := stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val - ZFSet.pair x x ∈ graph g := by - apply (M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround - g C E U Rf Rc u w index hu hw _).2 - rw [indexFixed, fixedU, fixedW] - -theorem refinementAssignment_fixed_of_anchor_le (D : L) (g : G) - (actor : g ∈ d.principalFix D) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) (anchor : E ≤ D) - (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : - let x := stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val - ZFSet.pair x x ∈ graph g := by - obtain ⟨lower, domain, fine, coarse, _⟩ := - (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order level T T2 valid familyGround C E U Rf Rc).1 index - have atE : g ∈ d.principalFix E := d.principalFix_antitone anchor actor - exact M.refinementAssignment_fixed a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround - g C E U Rf Rc u w index hu hw - (M.niceRefinementIndex_fixed a s b d level T T2 C E U.val Rf.val Rc.val - lower.le domain fine coarse g atE) fixedU fixedW - -theorem refinementAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} - (subset : A ⊆ J) (fixed : ∀ x ∈ A, ZFSet.pair x x ∈ graph g) : image g A = A := by - have function : FunctionGraphOn J (graph g) := ⟨J, - M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround g⟩ - apply ZFSet.ext - intro y - constructor - · intro hy - obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy - exact (function.unique entry (fixed x hx)).symm ▸ hx - · intro hy - exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ - -theorem refinementAssignmentImage_eq_of_anchor_le (D : L) (g : G) - (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) - (bounds : ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s), - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → - u.val ∈ T → w.val ∈ T → - stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A → - E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w) : image g A = A := by - apply M.refinementAssignmentImage_eq_of_fixed a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g subset - intro x hx - obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 (subset hx) - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi - let u : Name s := ⟨rawU, valid rawU hu⟩ - let w : Name s := ⟨rawW, valid rawW hw⟩ - obtain ⟨anchor, fixedU, fixedW⟩ := bounds C E U Rf Rc u w hi hu hw hx - exact M.refinementAssignment_fixed_of_anchor_le a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround - D g actor C E U Rf Rc u w hi hu hw anchor fixedU fixedW - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (I level T : ZFSet.{u}) -local notation "anchors" => refinementIndexFieldGraph I b.carrier 2 - -omit [OrderTop P] in -theorem refinementDataBounds_assignment_fixes (S mu X tuples A : ZFSet.{u}) (D : L) - (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) - (g : G) (actor : g ∈ d.principalFix D) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (member : ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) - (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : - E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w := by - obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, edge, lower, tupleU, tupleW, boundU, boundW⟩ := - (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder anchors tuples - _ u.val w.val (b.encode D)).1 member - have same : rawE = b.encode E := - ((refinementIndexFieldGraph_entry I b.carrier - ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] 2 rawE).1 edge).2.2 - subst rawE - exact ⟨(b.pair_mem_conditionOrder E D).1 lower, - support fu hfu u tupleU boundU actor, support fw hfw w tupleW boundW actor⟩ - -variable (T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -include pairing unions powers separation collection carrier order maps closed closed2 familyGround - -theorem refinementAssignment_fixed_of_dataBound (S mu X tuples A : ZFSet.{u}) (D : L) - (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) - (g : G) (actor : g ∈ d.principalFix D) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) - (hu : u.val ∈ T) (hw : w.val ∈ T) - (member : ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) - (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : - let z := stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val - ZFSet.pair z z ∈ M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g := by - obtain ⟨anchor, fixedU, fixedW⟩ := M.refinementDataBounds_assignment_fixes a s b d I level T - S mu X tuples A D support g actor C E U Rf Rc u w member - exact M.refinementAssignment_fixed_of_anchor_le a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround - D g actor C E U Rf Rc u w index hu hw anchor fixedU fixedW - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable {G P0 P1 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "J" => stageOneAssignments (I0 ∪ I1) T -local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t - pairing unions powers separation collection carrier0 order0 params0 -local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier1 order1 params1 -include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -include first second - -theorem stageTwoAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} - (subset : A ⊆ J) (fixed : ∀ z ∈ A, ZFSet.pair z z ∈ graph g) : image g A = A := by - rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] - have function : FunctionGraphOn J (graph g) := ⟨J, - (M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - first second).function g⟩ - apply ZFSet.ext - intro y - constructor - · intro member - obtain ⟨_, z, hz, entry⟩ := (mem_relationImage A J (graph g) y).1 member - exact (function.unique entry (fixed z hz)).symm ▸ hz - · intro hy - exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ - -theorem stageTwoAssignmentImage_eq_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) - (support0 : ∀ f ∈ S, ∀ u : Name s0, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a0.stabilizer s0 u) - (support1 : ∀ f ∈ S, ∀ u : Name s1, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a1.stabilizer s1 u) - (g : G) (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) - (bound : ∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ - stageOneDataBounds A (I0 ∪ I1) T S b.carrier mu X b.conditionOrder - (refinementIndexFieldGraph (I0 ∪ I1) b.carrier 2) tuples) : image g A = A := by - apply M.stageTwoAssignmentImage_eq_of_fixed a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - first second g subset - intro z hz - obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := - (mem_stageOneAssignments (I0 ∪ I1) T z).1 (subset hz) - rcases ZFSet.mem_union.1 hi with hi | hi - · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a0 s0 b d ∅ T T2 v0 v02 hi - let u : Name s0 := ⟨rawU, v0 rawU hu⟩ - let w : Name s0 := ⟨rawW, v0 rawW hw⟩ - apply ZFSet.mem_union.2 - left - exact M.refinementAssignment_fixed_of_dataBound a0 s0 b d (I0 ∪ I1) ∅ T T2 v0 v02 t - pairing unions powers separation collection carrier0 order0 params0.condition_maps - params0.terms_closed params0.pairs_closed params0.family_ground - S mu X tuples A D support0 g actor C E U Rf Rc u w hi hu hw (bound _ hz) - · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a1 s1 b d (natSetCode 1) T T2 v1 v12 hi - let u : Name s1 := ⟨rawU, v1 rawU hu⟩ - let w : Name s1 := ⟨rawW, v1 rawW hw⟩ - apply ZFSet.mem_union.2 - right - exact M.refinementAssignment_fixed_of_dataBound a1 s1 b d (I0 ∪ I1) (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier1 order1 params1.condition_maps - params1.terms_closed params1.pairs_closed params1.family_ground - S mu X tuples A D support1 g actor C E U Rf Rc u w hi hu hw (bound _ hz) - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a0 : PosetAction G R) (s0 c : Presentation R) -variable (a1 : PosetAction G P) (s1 : Presentation P) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 - -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system1 : NiceNameSystem M a1 s1 b d base directed T v1) -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -variable (inputs : StageTwoConditionActionInputs M c - (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) a1 s1 b d T T2 v1 - pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 - (M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12)) -local notation "Condition" => StageTwoCondition M c I0 a1 s1 b d T T2 v1 - pairing unions powers separation collection carrier1 order1 hT base directed system1 -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a1 s1 b d T T2 v1 - pairing unions powers separation collection carrier1 order1 hT base directed system1 -local notation "smallAct" => M.stageTwoSmallAction c I0 a1 s1 b d T T2 v1 - pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 image inputs -include carrier0 order0 params0 params1 first second - -theorem stageTwoSmallAction_fixed_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) - (support0 : ∀ f ∈ S, ∀ u : Name s0, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a0.stabilizer s0 u) - (support1 : ∀ f ∈ S, ∀ u : Name s1, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a1.stabilizer s1 u) : - letI := smallOrder - ∀ (g : G) (_actor : g ∈ d.principalFix D) (q : Shrink Condition), - a0.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → - (∀ z ∈ ((equivShrink Condition).symm q).assignments, - ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments - (I0 ∪ I1) T S b.carrier mu X b.conditionOrder - (refinementIndexFieldGraph (I0 ∪ I1) b.carrier 2) tuples) → - (smallAct).iso g q = q := by - let := smallOrder - intro g actor q row bound - apply (M.stageTwoSmallAction_fixed_iff c I0 a1 s1 b d T T2 v1 - pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 image inputs g q).2 - refine ⟨row, ?_⟩ - exact M.stageTwoAssignmentImage_eq_of_dataBound a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second - S mu X tuples D support0 support1 g actor - ((M.mem_groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega _).1 - ((equivShrink Condition).symm q).assignments_mem).2.1 bound - -end - -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] -variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (a2 : PosetAction G P2) (s2 : Presentation P2) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 -local notation "Jold" => stageOneAssignments (I0 ∪ I1) T -local notation "Jnew" => stageOneAssignments I2 T -local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T -local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 -local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second -local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t - pairing unions powers separation collection carrier2 order2 params2 - -variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) -include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third - -theorem stageThreeAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} - (subset : A ⊆ J) (fixed : ∀ z ∈ A, ZFSet.pair z z ∈ graph g) : image g A = A := by - rw [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second] - have function : FunctionGraphOn J (graph g) := ⟨J, - (M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third).function g⟩ - apply ZFSet.ext - intro y - constructor - · intro member - obtain ⟨_, z, hz, entry⟩ := (mem_relationImage A J (graph g) y).1 member - exact (function.unique entry (fixed z hz)).symm ▸ hz - · intro hy - exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ - -theorem stageThreeAssignmentImage_eq_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) - (support0 : ∀ f ∈ S, ∀ u : Name s0, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a0.stabilizer s0 u) - (support1 : ∀ f ∈ S, ∀ u : Name s1, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a1.stabilizer s1 u) - (support2 : ∀ f ∈ S, ∀ u : Name s2, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a2.stabilizer s2 u) - (g : G) (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) - (bound : ∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ - stageOneDataBounds A ((I0 ∪ I1) ∪ I2) T S b.carrier mu X b.conditionOrder - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2) tuples) : image g A = A := by - apply M.stageThreeAssignmentImage_eq_of_fixed a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third g subset - intro z hz - obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := - (mem_stageOneAssignments ((I0 ∪ I1) ∪ I2) T z).1 (subset hz) - rcases ZFSet.mem_union.1 hi with old | hi - · rcases ZFSet.mem_union.1 old with hi | hi - · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a0 s0 b d ∅ T T2 v0 v02 hi - let u : Name s0 := ⟨rawU, v0 rawU hu⟩ - let w : Name s0 := ⟨rawW, v0 rawW hw⟩ - apply ZFSet.mem_union.2 - left - apply ZFSet.mem_union.2 - left - exact M.refinementAssignment_fixed_of_dataBound a0 s0 b d ((I0 ∪ I1) ∪ I2) ∅ T T2 v0 v02 t - pairing unions powers separation collection carrier0 order0 params0.condition_maps - params0.terms_closed params0.pairs_closed params0.family_ground - S mu X tuples A D support0 g actor C E U Rf Rc u w hi hu hw (bound _ hz) - · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a1 s1 b d (natSetCode 1) T T2 v1 v12 hi - let u : Name s1 := ⟨rawU, v1 rawU hu⟩ - let w : Name s1 := ⟨rawW, v1 rawW hw⟩ - apply ZFSet.mem_union.2 - left - apply ZFSet.mem_union.2 - right - exact M.refinementAssignment_fixed_of_dataBound a1 s1 b d ((I0 ∪ I1) ∪ I2) (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier1 order1 params1.condition_maps - params1.terms_closed params1.pairs_closed params1.family_ground - S mu X tuples A D support1 g actor C E U Rf Rc u w hi hu hw (bound _ hz) - · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a2 s2 b d (natSetCode 2) T T2 v2 v22 hi - let u : Name s2 := ⟨rawU, v2 rawU hu⟩ - let w : Name s2 := ⟨rawW, v2 rawW hw⟩ - apply ZFSet.mem_union.2 - right - exact M.refinementAssignment_fixed_of_dataBound a2 s2 b d ((I0 ∪ I1) ∪ I2) (natSetCode 2) T T2 v2 v22 t - pairing unions powers separation collection carrier2 order2 params2.condition_maps - params2.terms_closed params2.pairs_closed params2.family_ground - S mu X tuples A D support2 g actor C E U Rf Rc u w hi hu hw (bound _ hz) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoActionInputs + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "J" => stageOneAssignments I T +local notation "graph" => M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 +local notation "image" => M.refinementAssignmentImage a s b d level T T2 valid valid2 +include pairing unions powers separation collection carrier order maps closed closed2 familyGround + +theorem refinementAssignment_fixed (g : G) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) + (indexFixed : refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val = + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : + let x := stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val + ZFSet.pair x x ∈ graph g := by + apply (M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround + g C E U Rf Rc u w index hu hw _).2 + rw [indexFixed, fixedU, fixedW] + +theorem refinementAssignment_fixed_of_anchor_le (D : L) (g : G) + (actor : g ∈ d.principalFix D) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) (anchor : E ≤ D) + (fixedU : a.act s g u = u) (fixedW : a.act s g w = w) : + let x := stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val + ZFSet.pair x x ∈ graph g := by + obtain ⟨lower, domain, fine, coarse, _⟩ := + (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order level T T2 valid familyGround C E U Rf Rc).1 index + have atE : g ∈ d.principalFix E := d.principalFix_antitone anchor actor + exact M.refinementAssignment_fixed a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround + g C E U Rf Rc u w index hu hw + (M.niceRefinementIndex_fixed a s b d level T T2 C E U.val Rf.val Rc.val + lower.le domain fine coarse g atE) fixedU fixedW + +theorem refinementAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} + (subset : A ⊆ J) (fixed : ∀ x ∈ A, ZFSet.pair x x ∈ graph g) : image g A = A := by + have function : FunctionGraphOn J (graph g) := ⟨J, + M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround g⟩ + apply ZFSet.ext + intro y + constructor + · intro hy + obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy + exact (function.unique entry (fixed x hx)).symm ▸ hx + · intro hy + exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ + +theorem refinementAssignmentImage_eq_of_anchor_le (D : L) (g : G) + (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) + (bounds : ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s), + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I → + u.val ∈ T → w.val ∈ T → + stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A → + E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w) : image g A = A := by + apply M.refinementAssignmentImage_eq_of_fixed a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g subset + intro x hx + obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 (subset hx) + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi + let u : Name s := ⟨rawU, valid rawU hu⟩ + let w : Name s := ⟨rawW, valid rawW hw⟩ + obtain ⟨anchor, fixedU, fixedW⟩ := bounds C E U Rf Rc u w hi hu hw hx + exact M.refinementAssignment_fixed_of_anchor_le a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround + D g actor C E U Rf Rc u w hi hu hw anchor fixedU fixedW + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (I level T : ZFSet.{u}) +local notation "anchors" => refinementIndexFieldGraph I b.carrier 2 + +omit [OrderTop P] in +theorem refinementDataBounds_assignment_fixes (S mu X tuples A : ZFSet.{u}) (D : L) + (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) + (g : G) (actor : g ∈ d.principalFix D) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (member : ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) + (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : + E ≤ D ∧ a.act s g u = u ∧ a.act s g w = w := by + obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, edge, lower, tupleU, tupleW, boundU, boundW⟩ := + (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder anchors tuples + _ u.val w.val (b.encode D)).1 member + have same : rawE = b.encode E := + ((refinementIndexFieldGraph_entry I b.carrier + ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] 2 rawE).1 edge).2.2 + subst rawE + exact ⟨(b.pair_mem_conditionOrder E D).1 lower, + support fu hfu u tupleU boundU actor, support fw hfw w tupleW boundW actor⟩ + +variable (T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +include pairing unions powers separation collection carrier order maps closed closed2 familyGround + +theorem refinementAssignment_fixed_of_dataBound (S mu X tuples A : ZFSet.{u}) (D : L) + (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) + (g : G) (actor : g ∈ d.principalFix D) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) + (hu : u.val ∈ T) (hw : w.val ∈ T) + (member : ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val) + (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) : + let z := stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val + ZFSet.pair z z ∈ M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 g := by + obtain ⟨anchor, fixedU, fixedW⟩ := M.refinementDataBounds_assignment_fixes a s b d I level T + S mu X tuples A D support g actor C E U Rf Rc u w member + exact M.refinementAssignment_fixed_of_anchor_le a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround + D g actor C E U Rf Rc u w index hu hw anchor fixedU fixedW + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable {G P0 P1 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "J" => stageOneAssignments (I0 ∪ I1) T +local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t + pairing unions powers separation collection carrier0 order0 params0 +local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier1 order1 params1 +include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +include first second + +theorem stageTwoAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} + (subset : A ⊆ J) (fixed : ∀ z ∈ A, ZFSet.pair z z ∈ graph g) : image g A = A := by + rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] + have function : FunctionGraphOn J (graph g) := ⟨J, + (M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + first second).function g⟩ + apply ZFSet.ext + intro y + constructor + · intro member + obtain ⟨_, z, hz, entry⟩ := (mem_relationImage A J (graph g) y).1 member + exact (function.unique entry (fixed z hz)).symm ▸ hz + · intro hy + exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ + +theorem stageTwoAssignmentImage_eq_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) + (support0 : ∀ f ∈ S, ∀ u : Name s0, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a0.stabilizer s0 u) + (support1 : ∀ f ∈ S, ∀ u : Name s1, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a1.stabilizer s1 u) + (g : G) (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) + (bound : ∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ + stageOneDataBounds A (I0 ∪ I1) T S b.carrier mu X b.conditionOrder + (refinementIndexFieldGraph (I0 ∪ I1) b.carrier 2) tuples) : image g A = A := by + apply M.stageTwoAssignmentImage_eq_of_fixed a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + first second g subset + intro z hz + obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := + (mem_stageOneAssignments (I0 ∪ I1) T z).1 (subset hz) + rcases ZFSet.mem_union.1 hi with hi | hi + · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a0 s0 b d ∅ T T2 v0 v02 hi + let u : Name s0 := ⟨rawU, v0 rawU hu⟩ + let w : Name s0 := ⟨rawW, v0 rawW hw⟩ + apply ZFSet.mem_union.2 + left + exact M.refinementAssignment_fixed_of_dataBound a0 s0 b d (I0 ∪ I1) ∅ T T2 v0 v02 t + pairing unions powers separation collection carrier0 order0 params0.condition_maps + params0.terms_closed params0.pairs_closed params0.family_ground + S mu X tuples A D support0 g actor C E U Rf Rc u w hi hu hw (bound _ hz) + · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a1 s1 b d (natSetCode 1) T T2 v1 v12 hi + let u : Name s1 := ⟨rawU, v1 rawU hu⟩ + let w : Name s1 := ⟨rawW, v1 rawW hw⟩ + apply ZFSet.mem_union.2 + right + exact M.refinementAssignment_fixed_of_dataBound a1 s1 b d (I0 ∪ I1) (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier1 order1 params1.condition_maps + params1.terms_closed params1.pairs_closed params1.family_ground + S mu X tuples A D support1 g actor C E U Rf Rc u w hi hu hw (bound _ hz) + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a0 : PosetAction G R) (s0 c : Presentation R) +variable (a1 : PosetAction G P) (s1 : Presentation P) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 + +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system1 : NiceNameSystem M a1 s1 b d base directed T v1) +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +variable (inputs : StageTwoConditionActionInputs M c + (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) a1 s1 b d T T2 v1 + pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 + (M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12)) +local notation "Condition" => StageTwoCondition M c I0 a1 s1 b d T T2 v1 + pairing unions powers separation collection carrier1 order1 hT base directed system1 +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a1 s1 b d T T2 v1 + pairing unions powers separation collection carrier1 order1 hT base directed system1 +local notation "smallAct" => M.stageTwoSmallAction c I0 a1 s1 b d T T2 v1 + pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 image inputs +include carrier0 order0 params0 params1 first second + +theorem stageTwoSmallAction_fixed_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) + (support0 : ∀ f ∈ S, ∀ u : Name s0, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a0.stabilizer s0 u) + (support1 : ∀ f ∈ S, ∀ u : Name s1, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a1.stabilizer s1 u) : + letI := smallOrder + ∀ (g : G) (_actor : g ∈ d.principalFix D) (q : Shrink Condition), + a0.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row → + (∀ z ∈ ((equivShrink Condition).symm q).assignments, + ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments + (I0 ∪ I1) T S b.carrier mu X b.conditionOrder + (refinementIndexFieldGraph (I0 ∪ I1) b.carrier 2) tuples) → + (smallAct).iso g q = q := by + let := smallOrder + intro g actor q row bound + apply (M.stageTwoSmallAction_fixed_iff c I0 a1 s1 b d T T2 v1 + pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 image inputs g q).2 + refine ⟨row, ?_⟩ + exact M.stageTwoAssignmentImage_eq_of_dataBound a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second + S mu X tuples D support0 support1 g actor + ((M.mem_groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega _).1 + ((equivShrink Condition).symm q).assignments_mem).2.1 bound + +end + +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] +variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (a2 : PosetAction G P2) (s2 : Presentation P2) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 +local notation "Jold" => stageOneAssignments (I0 ∪ I1) T +local notation "Jnew" => stageOneAssignments I2 T +local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T +local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 +local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second +local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t + pairing unions powers separation collection carrier2 order2 params2 + +variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) +include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third + +theorem stageThreeAssignmentImage_eq_of_fixed (g : G) {A : ZFSet.{u}} + (subset : A ⊆ J) (fixed : ∀ z ∈ A, ZFSet.pair z z ∈ graph g) : image g A = A := by + rw [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second] + have function : FunctionGraphOn J (graph g) := ⟨J, + (M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third).function g⟩ + apply ZFSet.ext + intro y + constructor + · intro member + obtain ⟨_, z, hz, entry⟩ := (mem_relationImage A J (graph g) y).1 member + exact (function.unique entry (fixed z hz)).symm ▸ hz + · intro hy + exact (mem_relationImage A J (graph g) y).2 ⟨subset hy, y, hy, fixed y hy⟩ + +theorem stageThreeAssignmentImage_eq_of_dataBound (S mu X tuples : ZFSet.{u}) (D : L) + (support0 : ∀ f ∈ S, ∀ u : Name s0, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a0.stabilizer s0 u) + (support1 : ∀ f ∈ S, ∀ u : Name s1, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a1.stabilizer s1 u) + (support2 : ∀ f ∈ S, ∀ u : Name s2, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a2.stabilizer s2 u) + (g : G) (actor : g ∈ d.principalFix D) {A : ZFSet.{u}} (subset : A ⊆ J) + (bound : ∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ + stageOneDataBounds A ((I0 ∪ I1) ∪ I2) T S b.carrier mu X b.conditionOrder + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2) tuples) : image g A = A := by + apply M.stageThreeAssignmentImage_eq_of_fixed a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third g subset + intro z hz + obtain ⟨idx, hi, rawU, hu, rawW, hw, rfl⟩ := + (mem_stageOneAssignments ((I0 ∪ I1) ∪ I2) T z).1 (subset hz) + rcases ZFSet.mem_union.1 hi with old | hi + · rcases ZFSet.mem_union.1 old with hi | hi + · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a0 s0 b d ∅ T T2 v0 v02 hi + let u : Name s0 := ⟨rawU, v0 rawU hu⟩ + let w : Name s0 := ⟨rawW, v0 rawW hw⟩ + apply ZFSet.mem_union.2 + left + apply ZFSet.mem_union.2 + left + exact M.refinementAssignment_fixed_of_dataBound a0 s0 b d ((I0 ∪ I1) ∪ I2) ∅ T T2 v0 v02 t + pairing unions powers separation collection carrier0 order0 params0.condition_maps + params0.terms_closed params0.pairs_closed params0.family_ground + S mu X tuples A D support0 g actor C E U Rf Rc u w hi hu hw (bound _ hz) + · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a1 s1 b d (natSetCode 1) T T2 v1 v12 hi + let u : Name s1 := ⟨rawU, v1 rawU hu⟩ + let w : Name s1 := ⟨rawW, v1 rawW hw⟩ + apply ZFSet.mem_union.2 + left + apply ZFSet.mem_union.2 + right + exact M.refinementAssignment_fixed_of_dataBound a1 s1 b d ((I0 ∪ I1) ∪ I2) (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier1 order1 params1.condition_maps + params1.terms_closed params1.pairs_closed params1.family_ground + S mu X tuples A D support1 g actor C E U Rf Rc u w hi hu hw (bound _ hz) + · obtain ⟨C,E,U,Rf,Rc,rfl⟩ := M.exists_niceRefinementIndex_fields a2 s2 b d (natSetCode 2) T T2 v2 v22 hi + let u : Name s2 := ⟨rawU, v2 rawU hu⟩ + let w : Name s2 := ⟨rawW, v2 rawW hw⟩ + apply ZFSet.mem_union.2 + right + exact M.refinementAssignment_fixed_of_dataBound a2 s2 b d ((I0 ∪ I1) ∪ I2) (natSetCode 2) T T2 v2 v22 t + pairing unions powers separation collection carrier2 order2 params2.condition_maps + params2.terms_closed params2.pairs_closed params2.family_ground + S mu X tuples A D support2 g actor C E U Rf Rc u w hi hu hw (bound _ hz) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoActionInputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoActionInputs.lean index 4639ccb50423455d4e2064b360a8143282c6bb98..66b70282e6e06b79e1904f4ab4d02b9355a8252f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoActionInputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoActionInputs.lean @@ -1,565 +1,565 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoConditionTop -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeAssignmentFamilies - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (rowAction : PosetAction G R) (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) -local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid -local notation "J" => stageOneAssignments (I0 ∪ I1) T -local notation "B" => M.groundSmallSubsets J ZFSet.omega -local notation "assignmentFamily" => familyCodeGraph t.encode assignmentGraph - -noncomputable def stageTwoFullActionGraph : ZFSet.{u} := - rowAssignmentActionGraph t.carrier Q c.carrier B J - (rowAction.conditionMapFamily c t) assignmentFamily - -theorem stageTwoFullActionGraph_entry (g : G) (p q : R) (A D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode p) A)) (ZFSet.pair (c.encode q) D) ∈ - M.stageTwoFullActionGraph c I0 a s b d T T2 valid rowAction t assignmentGraph ↔ - ZFSet.pair (c.encode p) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ rowAction.iso g p = q ∧ - D = relationImage A J (assignmentGraph g) := by - rw [stageTwoFullActionGraph, pair_mem_rowAssignmentActionGraph] - constructor - · rintro ⟨_,source,target,_,_,_,_,rf,af,indexed,row,indexedA,image⟩ - have rowEq := (rowAction.pair_mem_conditionMapFamily c t g rf).1 indexed - have assignmentEq := (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g af).1 indexedA - rw [assignmentEq] at image - exact ⟨source,target,(c.pair_mem_graph c (rowAction.iso g) p q).1 (rowEq ▸ row),image⟩ - · rintro ⟨source,target,moved,image⟩ - have sourceBound := (M.stageTwoForcing_raw_entry c.carrier I0 a s b d T T2 valid (c.encode p) A).1 source - have targetBound := (M.stageTwoForcing_raw_entry c.carrier I0 a s b d T T2 valid (c.encode q) D).1 target - exact ⟨t.encode_mem g,source,target,sourceBound.1,sourceBound.2.1,targetBound.1,targetBound.2.1, - _,_,(rowAction.pair_mem_conditionMapFamily c t g _).2 rfl, - (c.pair_mem_graph c (rowAction.iso g) p q).2 moved, - (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g _).2 rfl,image⟩ - -theorem stageTwoFullActionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hT : T ∈ M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (valid2 : ∀ z ∈ T2, IsName s z) - (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (system : NiceNameSystem M a s b d base directed T valid) - (omega : ZFSet.omega ∈ M.sets) (group : t.carrier ∈ M.sets) - (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) - (assignmentMaps : assignmentFamily ∈ M.sets) : - M.stageTwoFullActionGraph c I0 a s b d T T2 valid rowAction t assignmentGraph ∈ M.sets := by - have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid - pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices - base directed system omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions hI0 indices.index_ground) hT - exact M.rowAssignmentActionGraph_mem pairing unions powers separation group conditions rows - (M.groundSmallSubsets_mem powers separation assignments omega) assignments rowMaps assignmentMaps - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageTwoConditionActionInputs (M : TransitiveGround.{u}) - (c : Presentation R) (I0 : ZFSet.{u}) - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (system : NiceNameSystem M a s b d base directed T valid) - (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) : Prop where - small : ∀ g A, A ∈ M.groundSmallSubsets - (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) ZFSet.omega → - image g A ∈ M.groundSmallSubsets - (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) ZFSet.omega - one : ∀ A, A ⊆ stageOneAssignments - (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T → image 1 A = A - mul : ∀ g h A, A ⊆ stageOneAssignments - (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T → - image (g * h) A = image g (image h A) - mono : ∀ g A B, A ⊆ B → image g A ⊆ image g B - lower_code : ∀ g (p : StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system), - s.encode (a.iso g p.lower) = ZFSet.pair (c.encode (rowAction.iso g p.row)) - (assignmentCut (stageTwoAssignmentLevels I0 - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) - (natSetCode 1) (image g p.assignments)) - tests : ∀ g (p : StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system), - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 (image g p.assignments) (a.iso g p.lower) - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "J" => stageOneAssignments - (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T - -noncomputable def act (g : G) (p : Condition) : Condition where - row := rowAction.iso g p.row - assignments := image g p.assignments - assignments_mem := inputs.small g p.assignments p.assignments_mem - lower := a.iso g p.lower - lower_code := inputs.lower_code g p - tests := inputs.tests g p - -local notation "act'" => act M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs - -theorem act_fields (g : G) (p : Condition) : - (act' g p).row = rowAction.iso g p.row ∧ - (act' g p).assignments = image g p.assignments ∧ (act' g p).lower = a.iso g p.lower := - ⟨rfl, rfl, rfl⟩ - -theorem act_one (p : Condition) : act' 1 p = p := by - apply ext M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system - · exact rowAction.one p.row - · exact inputs.one p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 - -theorem act_mul (g h : G) (p : Condition) : act' (g * h) p = act' g (act' h p) := by - apply ext M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system - · exact rowAction.mul g h p.row - · exact inputs.mul g h p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 - -theorem act_inv_left (g : G) (p : Condition) : act' g⁻¹ (act' g p) = p := by - rw [← act_mul M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs, inv_mul_cancel, act_one] - -theorem act_inv_right (g : G) (p : Condition) : act' g (act' g⁻¹ p) = p := by - rw [← act_mul M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs, mul_inv_cancel, act_one] - -theorem act_le_iff (g : G) (p q : Condition) : act' g p ≤ act' g q ↔ p ≤ q := by - have mono : ∀ g (p q : Condition), p ≤ q → act' g p ≤ act' g q := by - intro g p q below - exact ⟨(rowAction.iso g).monotone below.1, inputs.mono g q.assignments p.assignments below.2⟩ - constructor - · intro below - have back := mono g⁻¹ _ _ below - simpa only [act_inv_left] using back - · exact mono g p q - -noncomputable def actOrderIso (g : G) : Condition ≃o Condition where - toFun := act' g - invFun := act' g⁻¹ - left_inv := act_inv_left M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs g - right_inv := act_inv_right M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs g - map_rel_iff' := act_le_iff M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs g _ _ - -noncomputable def posetAction : PosetAction G Condition where - iso := actOrderIso M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs - one := act_one M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs - mul := act_mul M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs - -end StageTwoCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system -local notation "typedAct" => StageTwoCondition.act M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -noncomputable def stageTwoSmallAction : - letI := smallOrder - PosetAction G (Shrink Condition) := by - letI := smallOrder - let original := StageTwoCondition.posetAction M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - let e := M.stageTwoConditionOrderIso c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - exact { - iso := fun g => (e.symm.trans (original.iso g)).trans e - one := by - intro q - change e (original.iso 1 (e.symm q)) = q - rw [original.one, e.apply_symm_apply] - mul := by - intro g h q - change e (original.iso (g * h) (e.symm q)) = - e (original.iso g (e.symm (e (original.iso h (e.symm q))))) - rw [e.symm_apply_apply, original.mul] } - -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -theorem stageTwoSmallAction_decode : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (equivShrink Condition).symm ((smallAct).iso g q) = - typedAct g ((equivShrink Condition).symm q) := by - let := smallOrder - intro g q - change (equivShrink Condition).symm - (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ - exact (equivShrink Condition).symm_apply_apply _ - -theorem stageTwoSmallAction_encode : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (pres).encode ((smallAct).iso g q) = - ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm q).row)) - (image g ((equivShrink Condition).symm q).assignments) := by - let := smallOrder - intro g q - change (pres).encode - (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ - exact M.stageTwoConditionPresentation_encode c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system _ - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "act'" => act M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system rowAction image inputs - -theorem act_eq_iff (g : G) (p : Condition) : - act' g p = p ↔ rowAction.iso g p.row = p.row ∧ image g p.assignments = p.assignments := by - constructor - · intro same - exact ⟨congrArg (fun q : Condition => q.row) same, - congrArg (fun q : Condition => q.assignments) same⟩ - · rintro ⟨row, assignments⟩ - exact ext M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system row assignments - -end StageTwoCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system -local notation "typedAct" => StageTwoCondition.act M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs -variable (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) -local notation "J" => stageOneAssignments - (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T -variable (image_eq : ∀ g A, image g A = relationImage A - (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) - (assignmentGraph g)) -local notation "fullGraph" => M.stageTwoFullActionGraph c I0 a s b d T T2 valid rowAction t assignmentGraph -include image_eq - -theorem stageTwoSmallActionGraph_eq : - letI := smallOrder - (smallAct).actionGraph (pres) t = fullGraph := by - let := smallOrder - have encoded (g : G) (x : Shrink Condition) := M.stageTwoSmallAction_encode c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rowAction image inputs g x - have meaning (g : G) (x y : Shrink Condition) : - ZFSet.pair (ZFSet.pair (t.encode g) ((pres).encode x)) ((pres).encode y) ∈ fullGraph ↔ - (smallAct).iso g x = y := by - change ZFSet.pair (ZFSet.pair (t.encode g) - (ZFSet.pair (c.encode ((equivShrink Condition).symm x).row) - ((equivShrink Condition).symm x).assignments)) - (ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments) ∈ fullGraph ↔ _ - rw [M.stageTwoFullActionGraph_entry, ← image_eq g] - constructor - · rintro ⟨_,_,rowEqual,assignmentEqual⟩ - apply (pres).injective - rw [encoded] - change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) - (image g ((equivShrink Condition).symm x).assignments) = - ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments - rw [rowEqual, assignmentEqual] - · intro equal - have codeEqual := congrArg (pres).encode equal - rw [encoded] at codeEqual - change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) - (image g ((equivShrink Condition).symm x).assignments) = - ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) - ((equivShrink Condition).symm y).assignments at codeEqual - obtain ⟨rowEqual,assignmentEqual⟩ := ZFSet.pair_injective codeEqual - exact ⟨(pres).encode_mem x,(pres).encode_mem y,c.injective rowEqual,assignmentEqual.symm⟩ - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨⟨g,x⟩,rfl⟩ := ((t.product (pres)).mem_graph (pres) (fun gx => (smallAct).iso gx.1 gx.2) z).1 member - exact (meaning g x ((smallAct).iso g x)).2 rfl - · intro member - have boundMember := member - unfold stageTwoFullActionGraph rowAssignmentActionGraph at boundMember - have bounds : z ∈ ZFSet.prod (ZFSet.prod t.carrier (pres).carrier) (pres).carrier := - (ZFSet.mem_sep.1 boundMember).1 - obtain ⟨source,hSource,y,hy,rfl⟩ := ZFSet.mem_prod.1 bounds - obtain ⟨g,hg,x,hx,rfl⟩ := ZFSet.mem_prod.1 hSource - obtain ⟨g,rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨x,rfl⟩ := ((pres).mem_carrier x).1 hx - obtain ⟨y,rfl⟩ := ((pres).mem_carrier y).1 hy - exact ((smallAct).triple_mem_actionGraph (pres) t g x y).2 ((meaning g x y).1 member) - -variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) -variable (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) -variable (assignmentMaps : familyCodeGraph t.encode assignmentGraph ∈ M.sets) -include rows hI0 nodeOrder omega group rowMaps assignmentMaps - -theorem stageTwoSmallActionGraph_mem : - letI := smallOrder - (smallAct).actionGraph (pres) t ∈ M.sets := by - let := smallOrder - rw [M.stageTwoSmallActionGraph_eq c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rowAction image inputs t assignmentGraph image_eq] - exact M.stageTwoFullActionGraph_mem c I0 a s b d T T2 valid rowAction t assignmentGraph - pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices - base directed system omega group rowMaps assignmentMaps - -theorem stageTwoSmallActionMapFamily_mem : - letI := smallOrder - (smallAct).conditionMapFamily (pres) t ∈ M.sets := by - let := smallOrder - have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid - pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices - base directed system omega - exact M.conditionMapFamily_mem_of_actionGraph (smallAct) (pres) t - pairing unions powers separation collection conditions group - (M.stageTwoSmallActionGraph_mem c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rowAction image inputs t assignmentGraph image_eq rows hI0 nodeOrder omega group rowMaps assignmentMaps) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -theorem stageTwoSmallAction_fixed_iff : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - (smallAct).iso g q = q ↔ - rowAction.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row ∧ - image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments := by - let := smallOrder - intro g q - have decoded := M.stageTwoSmallAction_decode c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs g q - have typed := StageTwoCondition.act_eq_iff M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - g ((equivShrink Condition).symm q) - constructor - · intro same - apply typed.1 - exact decoded.symm.trans (congrArg (equivShrink Condition).symm same) - · intro fields - apply (equivShrink Condition).symm.injective - exact decoded.trans (typed.2 fields) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a0 : PosetAction G R) (s0 c : Presentation R) -variable (a1 : PosetAction G P) (s1 : Presentation P) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 - -theorem stageTwoActionInputs - (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) - (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) - (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) - (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (first : RefinementIndexLevelCode I0 ∅) (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (omega : ZFSet.omega ∈ M.sets) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (system1 : NiceNameSystem M a1 s1 b d base directed T v1) - (F : FlatConditionSystem M c s1 (stageOneAssignments I0 T)) - (row_equivariant : ∀ g q, F.row (a1.iso g q) = a0.iso g (F.row q)) - (data_equivariant : ∀ g q, F.assignments (a1.iso g q) = - M.refinementAssignmentImage a0 s0 b d ∅ T T2 v0 v02 g (F.assignments q)) : - StageTwoConditionActionInputs M c I0 a1 s1 b d T T2 v1 - pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 image := by - refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ - · intro g A member - exact M.stageTwoAssignmentImage_small a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - first second hT hT2 hI0 hI1 omega g member - · intro A subset - exact M.stageTwoAssignmentImage_one a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - first second subset - · intro g h A subset - exact M.stageTwoAssignmentImage_mul a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - first second g h subset - · intro g A B subset - exact M.stageTwoAssignmentImage_mono a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g subset - · intro g p - rw [F.encode, row_equivariant, data_equivariant, - StageTwoCondition.lower_row M c I0 a1 s1 b d T T2 v1 pairing unions powers separation - collection carrier1 order1 hT base directed system1 F p, - StageTwoCondition.lower_assignments M c I0 a1 s1 b d T T2 v1 pairing unions powers separation - collection carrier1 order1 hT base directed system1 F p] - exact congrArg (ZFSet.pair (c.encode (a0.iso g p.row))) (M.stageTwoAssignmentImage_cut a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 params0 first second g p.assignments).symm - · intro g p - exact (M.stageTwoTests_image_iff a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier1 order1 params1.condition_maps hT - params1.terms_closed params1.pairs_closed params1.family_ground base directed system1 first second - g p.assignments p.lower).2 p.tests - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoConditionTop +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeAssignmentFamilies + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (rowAction : PosetAction G R) (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) +local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid +local notation "J" => stageOneAssignments (I0 ∪ I1) T +local notation "B" => M.groundSmallSubsets J ZFSet.omega +local notation "assignmentFamily" => familyCodeGraph t.encode assignmentGraph + +noncomputable def stageTwoFullActionGraph : ZFSet.{u} := + rowAssignmentActionGraph t.carrier Q c.carrier B J + (rowAction.conditionMapFamily c t) assignmentFamily + +theorem stageTwoFullActionGraph_entry (g : G) (p q : R) (A D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode p) A)) (ZFSet.pair (c.encode q) D) ∈ + M.stageTwoFullActionGraph c I0 a s b d T T2 valid rowAction t assignmentGraph ↔ + ZFSet.pair (c.encode p) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧ rowAction.iso g p = q ∧ + D = relationImage A J (assignmentGraph g) := by + rw [stageTwoFullActionGraph, pair_mem_rowAssignmentActionGraph] + constructor + · rintro ⟨_,source,target,_,_,_,_,rf,af,indexed,row,indexedA,image⟩ + have rowEq := (rowAction.pair_mem_conditionMapFamily c t g rf).1 indexed + have assignmentEq := (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g af).1 indexedA + rw [assignmentEq] at image + exact ⟨source,target,(c.pair_mem_graph c (rowAction.iso g) p q).1 (rowEq ▸ row),image⟩ + · rintro ⟨source,target,moved,image⟩ + have sourceBound := (M.stageTwoForcing_raw_entry c.carrier I0 a s b d T T2 valid (c.encode p) A).1 source + have targetBound := (M.stageTwoForcing_raw_entry c.carrier I0 a s b d T T2 valid (c.encode q) D).1 target + exact ⟨t.encode_mem g,source,target,sourceBound.1,sourceBound.2.1,targetBound.1,targetBound.2.1, + _,_,(rowAction.pair_mem_conditionMapFamily c t g _).2 rfl, + (c.pair_mem_graph c (rowAction.iso g) p q).2 moved, + (pair_mem_familyCodeGraph t.encode assignmentGraph t.injective g _).2 rfl,image⟩ + +theorem stageTwoFullActionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hT : T ∈ M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (valid2 : ∀ z ∈ T2, IsName s z) + (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (system : NiceNameSystem M a s b d base directed T valid) + (omega : ZFSet.omega ∈ M.sets) (group : t.carrier ∈ M.sets) + (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) + (assignmentMaps : assignmentFamily ∈ M.sets) : + M.stageTwoFullActionGraph c I0 a s b d T T2 valid rowAction t assignmentGraph ∈ M.sets := by + have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid + pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices + base directed system omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions hI0 indices.index_ground) hT + exact M.rowAssignmentActionGraph_mem pairing unions powers separation group conditions rows + (M.groundSmallSubsets_mem powers separation assignments omega) assignments rowMaps assignmentMaps + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageTwoConditionActionInputs (M : TransitiveGround.{u}) + (c : Presentation R) (I0 : ZFSet.{u}) + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (system : NiceNameSystem M a s b d base directed T valid) + (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) : Prop where + small : ∀ g A, A ∈ M.groundSmallSubsets + (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) ZFSet.omega → + image g A ∈ M.groundSmallSubsets + (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) ZFSet.omega + one : ∀ A, A ⊆ stageOneAssignments + (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T → image 1 A = A + mul : ∀ g h A, A ⊆ stageOneAssignments + (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T → + image (g * h) A = image g (image h A) + mono : ∀ g A B, A ⊆ B → image g A ⊆ image g B + lower_code : ∀ g (p : StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system), + s.encode (a.iso g p.lower) = ZFSet.pair (c.encode (rowAction.iso g p.row)) + (assignmentCut (stageTwoAssignmentLevels I0 + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) + (natSetCode 1) (image g p.assignments)) + tests : ∀ g (p : StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system), + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 (image g p.assignments) (a.iso g p.lower) + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "J" => stageOneAssignments + (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T + +noncomputable def act (g : G) (p : Condition) : Condition where + row := rowAction.iso g p.row + assignments := image g p.assignments + assignments_mem := inputs.small g p.assignments p.assignments_mem + lower := a.iso g p.lower + lower_code := inputs.lower_code g p + tests := inputs.tests g p + +local notation "act'" => act M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs + +theorem act_fields (g : G) (p : Condition) : + (act' g p).row = rowAction.iso g p.row ∧ + (act' g p).assignments = image g p.assignments ∧ (act' g p).lower = a.iso g p.lower := + ⟨rfl, rfl, rfl⟩ + +theorem act_one (p : Condition) : act' 1 p = p := by + apply ext M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system + · exact rowAction.one p.row + · exact inputs.one p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 + +theorem act_mul (g h : G) (p : Condition) : act' (g * h) p = act' g (act' h p) := by + apply ext M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system + · exact rowAction.mul g h p.row + · exact inputs.mul g h p.assignments ((M.mem_groundSmallSubsets J ZFSet.omega p.assignments).1 p.assignments_mem).2.1 + +theorem act_inv_left (g : G) (p : Condition) : act' g⁻¹ (act' g p) = p := by + rw [← act_mul M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs, inv_mul_cancel, act_one] + +theorem act_inv_right (g : G) (p : Condition) : act' g (act' g⁻¹ p) = p := by + rw [← act_mul M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs, mul_inv_cancel, act_one] + +theorem act_le_iff (g : G) (p q : Condition) : act' g p ≤ act' g q ↔ p ≤ q := by + have mono : ∀ g (p q : Condition), p ≤ q → act' g p ≤ act' g q := by + intro g p q below + exact ⟨(rowAction.iso g).monotone below.1, inputs.mono g q.assignments p.assignments below.2⟩ + constructor + · intro below + have back := mono g⁻¹ _ _ below + simpa only [act_inv_left] using back + · exact mono g p q + +noncomputable def actOrderIso (g : G) : Condition ≃o Condition where + toFun := act' g + invFun := act' g⁻¹ + left_inv := act_inv_left M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs g + right_inv := act_inv_right M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs g + map_rel_iff' := act_le_iff M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs g _ _ + +noncomputable def posetAction : PosetAction G Condition where + iso := actOrderIso M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs + one := act_one M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs + mul := act_mul M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs + +end StageTwoCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system +local notation "typedAct" => StageTwoCondition.act M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +noncomputable def stageTwoSmallAction : + letI := smallOrder + PosetAction G (Shrink Condition) := by + letI := smallOrder + let original := StageTwoCondition.posetAction M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + let e := M.stageTwoConditionOrderIso c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + exact { + iso := fun g => (e.symm.trans (original.iso g)).trans e + one := by + intro q + change e (original.iso 1 (e.symm q)) = q + rw [original.one, e.apply_symm_apply] + mul := by + intro g h q + change e (original.iso (g * h) (e.symm q)) = + e (original.iso g (e.symm (e (original.iso h (e.symm q))))) + rw [e.symm_apply_apply, original.mul] } + +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +theorem stageTwoSmallAction_decode : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (equivShrink Condition).symm ((smallAct).iso g q) = + typedAct g ((equivShrink Condition).symm q) := by + let := smallOrder + intro g q + change (equivShrink Condition).symm + (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ + exact (equivShrink Condition).symm_apply_apply _ + +theorem stageTwoSmallAction_encode : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (pres).encode ((smallAct).iso g q) = + ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm q).row)) + (image g ((equivShrink Condition).symm q).assignments) := by + let := smallOrder + intro g q + change (pres).encode + (equivShrink Condition (typedAct g ((equivShrink Condition).symm q))) = _ + exact M.stageTwoConditionPresentation_encode c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system _ + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "act'" => act M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system rowAction image inputs + +theorem act_eq_iff (g : G) (p : Condition) : + act' g p = p ↔ rowAction.iso g p.row = p.row ∧ image g p.assignments = p.assignments := by + constructor + · intro same + exact ⟨congrArg (fun q : Condition => q.row) same, + congrArg (fun q : Condition => q.assignments) same⟩ + · rintro ⟨row, assignments⟩ + exact ext M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system row assignments + +end StageTwoCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system +local notation "typedAct" => StageTwoCondition.act M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs +variable (t : Presentation G) (assignmentGraph : G → ZFSet.{u}) +local notation "J" => stageOneAssignments + (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T +variable (image_eq : ∀ g A, image g A = relationImage A + (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) + (assignmentGraph g)) +local notation "fullGraph" => M.stageTwoFullActionGraph c I0 a s b d T T2 valid rowAction t assignmentGraph +include image_eq + +theorem stageTwoSmallActionGraph_eq : + letI := smallOrder + (smallAct).actionGraph (pres) t = fullGraph := by + let := smallOrder + have encoded (g : G) (x : Shrink Condition) := M.stageTwoSmallAction_encode c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rowAction image inputs g x + have meaning (g : G) (x y : Shrink Condition) : + ZFSet.pair (ZFSet.pair (t.encode g) ((pres).encode x)) ((pres).encode y) ∈ fullGraph ↔ + (smallAct).iso g x = y := by + change ZFSet.pair (ZFSet.pair (t.encode g) + (ZFSet.pair (c.encode ((equivShrink Condition).symm x).row) + ((equivShrink Condition).symm x).assignments)) + (ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments) ∈ fullGraph ↔ _ + rw [M.stageTwoFullActionGraph_entry, ← image_eq g] + constructor + · rintro ⟨_,_,rowEqual,assignmentEqual⟩ + apply (pres).injective + rw [encoded] + change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) + (image g ((equivShrink Condition).symm x).assignments) = + ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments + rw [rowEqual, assignmentEqual] + · intro equal + have codeEqual := congrArg (pres).encode equal + rw [encoded] at codeEqual + change ZFSet.pair (c.encode (rowAction.iso g ((equivShrink Condition).symm x).row)) + (image g ((equivShrink Condition).symm x).assignments) = + ZFSet.pair (c.encode ((equivShrink Condition).symm y).row) + ((equivShrink Condition).symm y).assignments at codeEqual + obtain ⟨rowEqual,assignmentEqual⟩ := ZFSet.pair_injective codeEqual + exact ⟨(pres).encode_mem x,(pres).encode_mem y,c.injective rowEqual,assignmentEqual.symm⟩ + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨⟨g,x⟩,rfl⟩ := ((t.product (pres)).mem_graph (pres) (fun gx => (smallAct).iso gx.1 gx.2) z).1 member + exact (meaning g x ((smallAct).iso g x)).2 rfl + · intro member + have boundMember := member + unfold stageTwoFullActionGraph rowAssignmentActionGraph at boundMember + have bounds : z ∈ ZFSet.prod (ZFSet.prod t.carrier (pres).carrier) (pres).carrier := + (ZFSet.mem_sep.1 boundMember).1 + obtain ⟨source,hSource,y,hy,rfl⟩ := ZFSet.mem_prod.1 bounds + obtain ⟨g,hg,x,hx,rfl⟩ := ZFSet.mem_prod.1 hSource + obtain ⟨g,rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨x,rfl⟩ := ((pres).mem_carrier x).1 hx + obtain ⟨y,rfl⟩ := ((pres).mem_carrier y).1 hy + exact ((smallAct).triple_mem_actionGraph (pres) t g x y).2 ((meaning g x y).1 member) + +variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) +variable (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (rowMaps : rowAction.conditionMapFamily c t ∈ M.sets) +variable (assignmentMaps : familyCodeGraph t.encode assignmentGraph ∈ M.sets) +include rows hI0 nodeOrder omega group rowMaps assignmentMaps + +theorem stageTwoSmallActionGraph_mem : + letI := smallOrder + (smallAct).actionGraph (pres) t ∈ M.sets := by + let := smallOrder + rw [M.stageTwoSmallActionGraph_eq c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rowAction image inputs t assignmentGraph image_eq] + exact M.stageTwoFullActionGraph_mem c I0 a s b d T T2 valid rowAction t assignmentGraph + pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices + base directed system omega group rowMaps assignmentMaps + +theorem stageTwoSmallActionMapFamily_mem : + letI := smallOrder + (smallAct).conditionMapFamily (pres) t ∈ M.sets := by + let := smallOrder + have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid + pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices + base directed system omega + exact M.conditionMapFamily_mem_of_actionGraph (smallAct) (pres) t + pairing unions powers separation collection conditions group + (M.stageTwoSmallActionGraph_mem c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rowAction image inputs t assignmentGraph image_eq rows hI0 nodeOrder omega group rowMaps assignmentMaps) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +theorem stageTwoSmallAction_fixed_iff : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + (smallAct).iso g q = q ↔ + rowAction.iso g ((equivShrink Condition).symm q).row = ((equivShrink Condition).symm q).row ∧ + image g ((equivShrink Condition).symm q).assignments = ((equivShrink Condition).symm q).assignments := by + let := smallOrder + intro g q + have decoded := M.stageTwoSmallAction_decode c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs g q + have typed := StageTwoCondition.act_eq_iff M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + g ((equivShrink Condition).symm q) + constructor + · intro same + apply typed.1 + exact decoded.symm.trans (congrArg (equivShrink Condition).symm same) + · intro fields + apply (equivShrink Condition).symm.injective + exact decoded.trans (typed.2 fields) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a0 : PosetAction G R) (s0 c : Presentation R) +variable (a1 : PosetAction G P) (s1 : Presentation P) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 + +theorem stageTwoActionInputs + (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) + (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) + (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) + (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (first : RefinementIndexLevelCode I0 ∅) (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (omega : ZFSet.omega ∈ M.sets) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (system1 : NiceNameSystem M a1 s1 b d base directed T v1) + (F : FlatConditionSystem M c s1 (stageOneAssignments I0 T)) + (row_equivariant : ∀ g q, F.row (a1.iso g q) = a0.iso g (F.row q)) + (data_equivariant : ∀ g q, F.assignments (a1.iso g q) = + M.refinementAssignmentImage a0 s0 b d ∅ T T2 v0 v02 g (F.assignments q)) : + StageTwoConditionActionInputs M c I0 a1 s1 b d T T2 v1 + pairing unions powers separation collection carrier1 order1 hT base directed system1 a0 image := by + refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro g A member + exact M.stageTwoAssignmentImage_small a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + first second hT hT2 hI0 hI1 omega g member + · intro A subset + exact M.stageTwoAssignmentImage_one a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + first second subset + · intro g h A subset + exact M.stageTwoAssignmentImage_mul a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + first second g h subset + · intro g A B subset + exact M.stageTwoAssignmentImage_mono a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g subset + · intro g p + rw [F.encode, row_equivariant, data_equivariant, + StageTwoCondition.lower_row M c I0 a1 s1 b d T T2 v1 pairing unions powers separation + collection carrier1 order1 hT base directed system1 F p, + StageTwoCondition.lower_assignments M c I0 a1 s1 b d T T2 v1 pairing unions powers separation + collection carrier1 order1 hT base directed system1 F p] + exact congrArg (ZFSet.pair (c.encode (a0.iso g p.row))) (M.stageTwoAssignmentImage_cut a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 params0 first second g p.assignments).symm + · intro g p + exact (M.stageTwoTests_image_iff a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier1 order1 params1.condition_maps hT + params1.terms_closed params1.pairs_closed params1.family_ground base directed system1 first second + g p.assignments p.lower).2 p.tests + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoConditionTop.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoConditionTop.lean index 28e705f8a8f6359a2fe0208a9eb91bf6ae500f7e..fcddb3e59109b5837844b52f20395b8be879bdae 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoConditionTop.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoConditionTop.lean @@ -1,559 +1,559 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBinaryRowStageOneRefinement - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid - -structure StageTwoCondition where - row : R - assignments : ZFSet.{u} - assignments_mem : assignments ∈ - M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega - lower : P - lower_code : s.encode lower = ZFSet.pair (c.encode row) - (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) assignments) - tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 assignments lower - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -@[ext] theorem ext {p q : Condition} - (rows : p.row = q.row) (data : p.assignments = q.assignments) : p = q := by - cases p with - | mk rp Ap smallp lp codep testp => - cases q with - | mk rq Aq smallq lq codeq testq => - dsimp only at rows data - subst rq - subst Aq - have equal : lp = lq := s.injective (codep.trans codeq.symm) - subst lq - rfl - -noncomputable def code (p : Condition) : ZFSet.{u} := ZFSet.pair (c.encode p.row) p.assignments - -theorem code_eq_iff (p q : Condition) : - code M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system p = - code M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system q ↔ p.row = q.row ∧ p.assignments = q.assignments := by - unfold code - rw [ZFSet.pair_inj] - exact and_congr c.injective.eq_iff Iff.rfl - -theorem code_injective : Function.Injective (code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system) := by - intro p q equal - obtain ⟨rows, data⟩ := (code_eq_iff M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system p q).1 equal - exact ext M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rows data - -theorem code_mem_candidateBound (p : Condition) : - code M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system p ∈ M.stageOneCandidateBound c.carrier (I0 ∪ I1) T := - ZFSet.pair_mem_prod.2 ⟨c.encode_mem p.row, p.assignments_mem⟩ - -instance small : Small.{u} Condition := by - let bound := M.stageOneCandidateBound c.carrier (I0 ∪ I1) T - let f : Condition → bound := fun p => - ⟨code M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system p, - code_mem_candidateBound M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system p⟩ - apply small_of_injective (f := f) - intro p q equal - exact code_injective M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system (congrArg Subtype.val equal) - -end StageTwoCondition - -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -include nodes indices in -theorem stageTwoConditionCode_mem (p : Condition) : code p ∈ Q := - (M.stageTwoForcing_entry c.carrier I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system (c.encode p.row) p.assignments).2 - ⟨c.encode_mem p.row, p.assignments_mem, p.lower, p.lower_code, p.tests⟩ - -include nodes indices in -theorem exists_stageTwoConditionCode {z : ZFSet.{u}} (member : z ∈ Q) : - ∃ p : Condition, code p = z := by - have candidate := (M.mem_stageTwoConditions c.carrier - (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) - (stageTwoAssignmentLevels I0 (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) - (natSetCode 1) (M.refinementLevelFormulaData a s b d (natSetCode 1) T T2 valid) z).1 member - obtain ⟨row, A, small, equal⟩ := M.exists_stageOneCandidate_fields c _ _ candidate.1 - obtain ⟨_, _, lower, lowerCode, tests⟩ := - (M.stageTwoForcing_entry c.carrier I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system (c.encode row) A).1 - (equal ▸ member) - exact ⟨⟨row, A, small, lower, lowerCode, tests⟩, equal.symm⟩ - -noncomputable def stageTwoConditionPresentation : Presentation (Shrink Condition) where - carrier := Q - encode x := code ((equivShrink Condition).symm x) - injective := (StageTwoCondition.code_injective M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system).comp - (equivShrink Condition).symm.injective - mem_carrier z := by - constructor - · intro member - obtain ⟨p, equal⟩ := M.exists_stageTwoConditionCode c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system member - exact ⟨equivShrink Condition p, by simpa only [Equiv.symm_apply_apply] using equal⟩ - · rintro ⟨x, equal⟩ - exact equal ▸ M.stageTwoConditionCode_mem c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - ((equivShrink Condition).symm x) - -theorem stageTwoConditionPresentation_encode (p : Condition) : - (M.stageTwoConditionPresentation c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system).encode (equivShrink Condition p) = - code p := - congrArg code ((equivShrink Condition).symm_apply_apply p) - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -instance partialOrder : PartialOrder Condition where - le p q := p.row ≤ q.row ∧ q.assignments ⊆ p.assignments - le_refl _ := ⟨le_rfl, fun _ h => h⟩ - le_trans _ _ _ first second := ⟨first.1.trans second.1, fun _ h => first.2 (second.2 h)⟩ - le_antisymm p q first second := by - apply ext M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system (le_antisymm first.1 second.1) - apply ZFSet.ext - intro z - exact ⟨fun h => second.2 h, fun h => first.2 h⟩ - -theorem le_iff (p q : Condition) : - p ≤ q ↔ p.row ≤ q.row ∧ q.assignments ⊆ p.assignments := Iff.rfl - -def rowProjection : Condition →o R where - toFun p := p.row - monotone' _ _ below := below.1 - -end StageTwoCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -@[instance_reducible] noncomputable def stageTwoConditionSmallOrder : PartialOrder (Shrink Condition) where - le p q := (equivShrink Condition).symm p ≤ (equivShrink Condition).symm q - le_refl _ := le_rfl - le_trans _ _ _ first second := first.trans second - le_antisymm _ _ first second := (equivShrink Condition).symm.injective (le_antisymm first second) - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -noncomputable def stageTwoConditionOrderIso : - letI := smallOrder - Condition ≃o Shrink Condition := by - letI := smallOrder - exact { - toEquiv := equivShrink Condition - map_rel_iff' := by - intro p q - change (equivShrink Condition).symm (equivShrink Condition p) ≤ - (equivShrink Condition).symm (equivShrink Condition q) ↔ p ≤ q - simp only [Equiv.symm_apply_apply] } - -noncomputable def stageTwoFlatConditionSystem : - letI := smallOrder - FlatConditionSystem M c pres - (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) := by - letI := smallOrder - exact { - row := fun p => ((equivShrink Condition).symm p).row - assignments := fun p => ((equivShrink Condition).symm p).assignments - encode := fun _ => rfl - le_iff := fun _ _ => Iff.rfl - assignments_mem := fun p => ((equivShrink Condition).symm p).assignments_mem } - -theorem stageTwoConditionOrder_mem - (hRow : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) - (rowOrder : c.conditionOrder ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - letI := smallOrder - (pres).conditionOrder ∈ M.sets := by - let := smallOrder - have ground := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid - pairing unions powers separation hRow hI0 hT carrier order nodes nodeOrder valid2 - indices base directed system omega - exact (M.stageTwoFlatConditionSystem c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system).conditionOrder_mem - pairing unions powers separation hRow ground - (M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions hI0 indices.index_ground) hT) omega rowOrder - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -local notation "levels" => stageTwoAssignmentLevels I0 - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T - -theorem lower_row (p : Condition) : F.row p.lower = p.row := by - have equal := (F.encode p.lower).symm.trans p.lower_code - exact c.injective (ZFSet.pair_inj.1 equal).1 - -theorem lower_assignments (p : Condition) : - F.assignments p.lower = assignmentCut levels (natSetCode 1) p.assignments := by - exact (ZFSet.pair_inj.1 ((F.encode p.lower).symm.trans p.lower_code)).2 - -def restriction : Condition →o P where - toFun p := p.lower - monotone' := by - intro p q below - apply (F.le_iff p.lower q.lower).2 - constructor - · rw [lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F p, - lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F q] - exact below.1 - · rw [lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F p, - lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F q] - exact assignmentCut_mono below.2 - -end StageTwoCondition - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -local notation "levels" => stageTwoAssignmentLevels I0 - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T - -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) - -noncomputable def includeLower (q : P) : Condition := by - have facts := - (M.mem_groundSmallSubsets (stageOneAssignments I0 T) ZFSet.omega (F.assignments q)).1 - (F.assignments_mem q) - have ground := facts.1 - have subsetOld := facts.2.1 - have small := facts.2.2 - refine ⟨F.row q, F.assignments q, ?_, q, ?_, ?_⟩ - · apply (M.mem_groundSmallSubsets _ _ _).2 - refine ⟨ground, ?_, small⟩ - intro z hz - obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := - (mem_stageOneAssignments I0 T z).1 (subsetOld hz) - exact (stageOneAssignment_mem_assignments _ T t u w).2 - ⟨ZFSet.mem_union.2 (Or.inl ht), hu, hw⟩ - · rw [stageTwoAssignmentCut_one_eq first second subsetOld] - exact F.encode q - · exact M.refinementLevelTests_stageTwoOld s pairing unions powers separation collection - carrier order hT valid a b d base directed system first second q subsetOld - -local notation "inc" => includeLower M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "restrict" => restriction M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F - -theorem includeLower_lower (q : P) : (inc q).lower = q := rfl - -theorem includeLower_code (q : P) : - code M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system (inc q) = s.encode q := - (F.encode q).symm - -noncomputable def inclusion : P ↪o Condition where - toFun := inc - inj' _ _ equal := congrArg StageTwoCondition.lower equal - map_rel_iff' := by - intro p q - exact (F.le_iff p q).symm - -theorem restriction_inclusion (q : P) : - restrict (inclusion M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F first second q) = q := rfl - -theorem le_inclusion_iff (p : Condition) (q : P) : - p ≤ inclusion M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F first second q ↔ restrict p ≤ q := by - change p.row ≤ F.row q ∧ F.assignments q ⊆ p.assignments ↔ p.lower ≤ q - rw [F.le_iff, lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F p, - lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F p] - apply and_congr_right - intro _ - have subsetOld := ((M.mem_groundSmallSubsets _ _ (F.assignments q)).1 - (F.assignments_mem q)).2.1 - constructor - · intro subset - rw [stageTwoAssignmentCut_one first second] - exact fun z hz => ZFSet.mem_sep.2 ⟨subset hz, subsetOld hz⟩ - · intro subset - exact fun _ hz => assignmentCut_subset _ _ _ (subset hz) - -end StageTwoCondition - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -local notation "levels" => stageTwoAssignmentLevels I0 - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T - -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) - -noncomputable def splice (p : Condition) (q : P) (below : q ≤ p.lower) : Condition := by - have old := (M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q) - have memberq : F.assignments q ∈ M.groundSmallSubsets - (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) - ZFSet.omega := by - apply (M.mem_groundSmallSubsets _ _ _).2 - refine ⟨old.1, ?_, old.2.2⟩ - intro z hz - obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 (old.2.1 hz) - exact (stageOneAssignment_mem_assignments _ T t u w).2 - ⟨ZFSet.mem_union.2 (Or.inl ht), hu, hw⟩ - have graph := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT - have hOne := M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega 1) - have lowerCut := stageTwoAssignmentSplice_lower_eq first second p.assignments old.2.1 - exact { - row := F.row q - assignments := assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments - assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation - infinite choice graph hOne memberq p.assignments_mem - lower := q - lower_code := by rw [lowerCut]; exact F.encode q - tests := (M.refinementLevelTests_stageTwoSplice s pairing unions powers separation collection - carrier order hT valid a b d base directed system first second (F.assignments q) p.assignments q).2 - (M.refinementLevelTests_mono s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 p.assignments p.tests below) } - -local notation "lifted" => splice M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F first second infinite choice hI0 hI1 - -theorem splice_row (p : Condition) (q : P) (below : q ≤ p.lower) : - (lifted p q below).row = F.row q := rfl - -theorem splice_assignments (p : Condition) (q : P) (below : q ≤ p.lower) : - (lifted p q below).assignments = - assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments := rfl - -theorem splice_lower (p : Condition) (q : P) (below : q ≤ p.lower) : - (lifted p q below).lower = q := rfl - -theorem splice_le (p : Condition) (q : P) (below : q ≤ p.lower) : lifted p q below ≤ p := by - obtain ⟨rows, data⟩ := (F.le_iff q p.lower).1 below - have lowerRow := lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F p - have lowerData := lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F p - refine ⟨rows.trans_eq lowerRow, ?_⟩ - change p.assignments ⊆ assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments - apply assignmentSplice_extends - rw [stageTwoAssignmentCut_one_eq first second - ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1, ← lowerData] - exact data - -include first second infinite choice hI0 hI1 in -theorem exists_lift_restriction (p : Condition) (q : P) (below : q ≤ p.lower) : - ∃ r : Condition, r ≤ p ∧ r.lower = q ∧ r.row = F.row q ∧ - r.assignments = assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments := - ⟨lifted p q below, splice_le M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F first second infinite choice hI0 hI1 p q below, - rfl, rfl, rfl⟩ - -end StageTwoCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -@[instance_reducible] noncomputable def stageTwoConditionTop : OrderTop Condition where - top := inc ⊤ - le_top p := (StageTwoCondition.le_inclusion_iff M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second p ⊤).2 le_top - -@[instance_reducible] noncomputable def stageTwoConditionSmallTop : - letI := smallOrder - OrderTop (Shrink Condition) := by - letI := smallOrder - letI := M.stageTwoConditionTop c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system F first second - exact { - top := equivShrink Condition ⊤ - le_top p := by - change (equivShrink Condition).symm p ≤ (equivShrink Condition).symm (equivShrink Condition ⊤) - rw [Equiv.symm_apply_apply] - exact le_top } - -theorem stageTwoConditionPresentation_top : - letI := smallOrder - letI := M.stageTwoConditionSmallTop c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system F first second - (pres).encode ⊤ = s.encode ⊤ := by - let := smallOrder - let := M.stageTwoConditionSmallTop c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system F first second - change (pres).encode (equivShrink Condition (inc ⊤)) = s.encode ⊤ - rw [M.stageTwoConditionPresentation_encode c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system] - exact StageTwoCondition.includeLower_code M c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system F first second ⊤ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBinaryRowStageOneRefinement + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid + +structure StageTwoCondition where + row : R + assignments : ZFSet.{u} + assignments_mem : assignments ∈ + M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega + lower : P + lower_code : s.encode lower = ZFSet.pair (c.encode row) + (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) assignments) + tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 assignments lower + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +@[ext] theorem ext {p q : Condition} + (rows : p.row = q.row) (data : p.assignments = q.assignments) : p = q := by + cases p with + | mk rp Ap smallp lp codep testp => + cases q with + | mk rq Aq smallq lq codeq testq => + dsimp only at rows data + subst rq + subst Aq + have equal : lp = lq := s.injective (codep.trans codeq.symm) + subst lq + rfl + +noncomputable def code (p : Condition) : ZFSet.{u} := ZFSet.pair (c.encode p.row) p.assignments + +theorem code_eq_iff (p q : Condition) : + code M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system p = + code M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system q ↔ p.row = q.row ∧ p.assignments = q.assignments := by + unfold code + rw [ZFSet.pair_inj] + exact and_congr c.injective.eq_iff Iff.rfl + +theorem code_injective : Function.Injective (code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system) := by + intro p q equal + obtain ⟨rows, data⟩ := (code_eq_iff M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system p q).1 equal + exact ext M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rows data + +theorem code_mem_candidateBound (p : Condition) : + code M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system p ∈ M.stageOneCandidateBound c.carrier (I0 ∪ I1) T := + ZFSet.pair_mem_prod.2 ⟨c.encode_mem p.row, p.assignments_mem⟩ + +instance small : Small.{u} Condition := by + let bound := M.stageOneCandidateBound c.carrier (I0 ∪ I1) T + let f : Condition → bound := fun p => + ⟨code M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system p, + code_mem_candidateBound M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system p⟩ + apply small_of_injective (f := f) + intro p q equal + exact code_injective M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system (congrArg Subtype.val equal) + +end StageTwoCondition + +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +include nodes indices in +theorem stageTwoConditionCode_mem (p : Condition) : code p ∈ Q := + (M.stageTwoForcing_entry c.carrier I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system (c.encode p.row) p.assignments).2 + ⟨c.encode_mem p.row, p.assignments_mem, p.lower, p.lower_code, p.tests⟩ + +include nodes indices in +theorem exists_stageTwoConditionCode {z : ZFSet.{u}} (member : z ∈ Q) : + ∃ p : Condition, code p = z := by + have candidate := (M.mem_stageTwoConditions c.carrier + (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) + (stageTwoAssignmentLevels I0 (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) + (natSetCode 1) (M.refinementLevelFormulaData a s b d (natSetCode 1) T T2 valid) z).1 member + obtain ⟨row, A, small, equal⟩ := M.exists_stageOneCandidate_fields c _ _ candidate.1 + obtain ⟨_, _, lower, lowerCode, tests⟩ := + (M.stageTwoForcing_entry c.carrier I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system (c.encode row) A).1 + (equal ▸ member) + exact ⟨⟨row, A, small, lower, lowerCode, tests⟩, equal.symm⟩ + +noncomputable def stageTwoConditionPresentation : Presentation (Shrink Condition) where + carrier := Q + encode x := code ((equivShrink Condition).symm x) + injective := (StageTwoCondition.code_injective M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system).comp + (equivShrink Condition).symm.injective + mem_carrier z := by + constructor + · intro member + obtain ⟨p, equal⟩ := M.exists_stageTwoConditionCode c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system member + exact ⟨equivShrink Condition p, by simpa only [Equiv.symm_apply_apply] using equal⟩ + · rintro ⟨x, equal⟩ + exact equal ▸ M.stageTwoConditionCode_mem c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + ((equivShrink Condition).symm x) + +theorem stageTwoConditionPresentation_encode (p : Condition) : + (M.stageTwoConditionPresentation c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system).encode (equivShrink Condition p) = + code p := + congrArg code ((equivShrink Condition).symm_apply_apply p) + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +instance partialOrder : PartialOrder Condition where + le p q := p.row ≤ q.row ∧ q.assignments ⊆ p.assignments + le_refl _ := ⟨le_rfl, fun _ h => h⟩ + le_trans _ _ _ first second := ⟨first.1.trans second.1, fun _ h => first.2 (second.2 h)⟩ + le_antisymm p q first second := by + apply ext M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system (le_antisymm first.1 second.1) + apply ZFSet.ext + intro z + exact ⟨fun h => second.2 h, fun h => first.2 h⟩ + +theorem le_iff (p q : Condition) : + p ≤ q ↔ p.row ≤ q.row ∧ q.assignments ⊆ p.assignments := Iff.rfl + +def rowProjection : Condition →o R where + toFun p := p.row + monotone' _ _ below := below.1 + +end StageTwoCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +@[instance_reducible] noncomputable def stageTwoConditionSmallOrder : PartialOrder (Shrink Condition) where + le p q := (equivShrink Condition).symm p ≤ (equivShrink Condition).symm q + le_refl _ := le_rfl + le_trans _ _ _ first second := first.trans second + le_antisymm _ _ first second := (equivShrink Condition).symm.injective (le_antisymm first second) + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +noncomputable def stageTwoConditionOrderIso : + letI := smallOrder + Condition ≃o Shrink Condition := by + letI := smallOrder + exact { + toEquiv := equivShrink Condition + map_rel_iff' := by + intro p q + change (equivShrink Condition).symm (equivShrink Condition p) ≤ + (equivShrink Condition).symm (equivShrink Condition q) ↔ p ≤ q + simp only [Equiv.symm_apply_apply] } + +noncomputable def stageTwoFlatConditionSystem : + letI := smallOrder + FlatConditionSystem M c pres + (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) := by + letI := smallOrder + exact { + row := fun p => ((equivShrink Condition).symm p).row + assignments := fun p => ((equivShrink Condition).symm p).assignments + encode := fun _ => rfl + le_iff := fun _ _ => Iff.rfl + assignments_mem := fun p => ((equivShrink Condition).symm p).assignments_mem } + +theorem stageTwoConditionOrder_mem + (hRow : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) + (rowOrder : c.conditionOrder ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + letI := smallOrder + (pres).conditionOrder ∈ M.sets := by + let := smallOrder + have ground := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid + pairing unions powers separation hRow hI0 hT carrier order nodes nodeOrder valid2 + indices base directed system omega + exact (M.stageTwoFlatConditionSystem c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system).conditionOrder_mem + pairing unions powers separation hRow ground + (M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions hI0 indices.index_ground) hT) omega rowOrder + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +local notation "levels" => stageTwoAssignmentLevels I0 + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T + +theorem lower_row (p : Condition) : F.row p.lower = p.row := by + have equal := (F.encode p.lower).symm.trans p.lower_code + exact c.injective (ZFSet.pair_inj.1 equal).1 + +theorem lower_assignments (p : Condition) : + F.assignments p.lower = assignmentCut levels (natSetCode 1) p.assignments := by + exact (ZFSet.pair_inj.1 ((F.encode p.lower).symm.trans p.lower_code)).2 + +def restriction : Condition →o P where + toFun p := p.lower + monotone' := by + intro p q below + apply (F.le_iff p.lower q.lower).2 + constructor + · rw [lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F p, + lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F q] + exact below.1 + · rw [lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F p, + lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F q] + exact assignmentCut_mono below.2 + +end StageTwoCondition + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +local notation "levels" => stageTwoAssignmentLevels I0 + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T + +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) + +noncomputable def includeLower (q : P) : Condition := by + have facts := + (M.mem_groundSmallSubsets (stageOneAssignments I0 T) ZFSet.omega (F.assignments q)).1 + (F.assignments_mem q) + have ground := facts.1 + have subsetOld := facts.2.1 + have small := facts.2.2 + refine ⟨F.row q, F.assignments q, ?_, q, ?_, ?_⟩ + · apply (M.mem_groundSmallSubsets _ _ _).2 + refine ⟨ground, ?_, small⟩ + intro z hz + obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := + (mem_stageOneAssignments I0 T z).1 (subsetOld hz) + exact (stageOneAssignment_mem_assignments _ T t u w).2 + ⟨ZFSet.mem_union.2 (Or.inl ht), hu, hw⟩ + · rw [stageTwoAssignmentCut_one_eq first second subsetOld] + exact F.encode q + · exact M.refinementLevelTests_stageTwoOld s pairing unions powers separation collection + carrier order hT valid a b d base directed system first second q subsetOld + +local notation "inc" => includeLower M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "restrict" => restriction M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F + +theorem includeLower_lower (q : P) : (inc q).lower = q := rfl + +theorem includeLower_code (q : P) : + code M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system (inc q) = s.encode q := + (F.encode q).symm + +noncomputable def inclusion : P ↪o Condition where + toFun := inc + inj' _ _ equal := congrArg StageTwoCondition.lower equal + map_rel_iff' := by + intro p q + exact (F.le_iff p q).symm + +theorem restriction_inclusion (q : P) : + restrict (inclusion M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F first second q) = q := rfl + +theorem le_inclusion_iff (p : Condition) (q : P) : + p ≤ inclusion M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F first second q ↔ restrict p ≤ q := by + change p.row ≤ F.row q ∧ F.assignments q ⊆ p.assignments ↔ p.lower ≤ q + rw [F.le_iff, lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F p, + lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F p] + apply and_congr_right + intro _ + have subsetOld := ((M.mem_groundSmallSubsets _ _ (F.assignments q)).1 + (F.assignments_mem q)).2.1 + constructor + · intro subset + rw [stageTwoAssignmentCut_one first second] + exact fun z hz => ZFSet.mem_sep.2 ⟨subset hz, subsetOld hz⟩ + · intro subset + exact fun _ hz => assignmentCut_subset _ _ _ (subset hz) + +end StageTwoCondition + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +local notation "levels" => stageTwoAssignmentLevels I0 + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T + +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) + +noncomputable def splice (p : Condition) (q : P) (below : q ≤ p.lower) : Condition := by + have old := (M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q) + have memberq : F.assignments q ∈ M.groundSmallSubsets + (stageOneAssignments (I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) + ZFSet.omega := by + apply (M.mem_groundSmallSubsets _ _ _).2 + refine ⟨old.1, ?_, old.2.2⟩ + intro z hz + obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 (old.2.1 hz) + exact (stageOneAssignment_mem_assignments _ T t u w).2 + ⟨ZFSet.mem_union.2 (Or.inl ht), hu, hw⟩ + have graph := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT + have hOne := M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega 1) + have lowerCut := stageTwoAssignmentSplice_lower_eq first second p.assignments old.2.1 + exact { + row := F.row q + assignments := assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments + assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation + infinite choice graph hOne memberq p.assignments_mem + lower := q + lower_code := by rw [lowerCut]; exact F.encode q + tests := (M.refinementLevelTests_stageTwoSplice s pairing unions powers separation collection + carrier order hT valid a b d base directed system first second (F.assignments q) p.assignments q).2 + (M.refinementLevelTests_mono s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 p.assignments p.tests below) } + +local notation "lifted" => splice M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F first second infinite choice hI0 hI1 + +theorem splice_row (p : Condition) (q : P) (below : q ≤ p.lower) : + (lifted p q below).row = F.row q := rfl + +theorem splice_assignments (p : Condition) (q : P) (below : q ≤ p.lower) : + (lifted p q below).assignments = + assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments := rfl + +theorem splice_lower (p : Condition) (q : P) (below : q ≤ p.lower) : + (lifted p q below).lower = q := rfl + +theorem splice_le (p : Condition) (q : P) (below : q ≤ p.lower) : lifted p q below ≤ p := by + obtain ⟨rows, data⟩ := (F.le_iff q p.lower).1 below + have lowerRow := lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F p + have lowerData := lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F p + refine ⟨rows.trans_eq lowerRow, ?_⟩ + change p.assignments ⊆ assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments + apply assignmentSplice_extends + rw [stageTwoAssignmentCut_one_eq first second + ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1, ← lowerData] + exact data + +include first second infinite choice hI0 hI1 in +theorem exists_lift_restriction (p : Condition) (q : P) (below : q ≤ p.lower) : + ∃ r : Condition, r ≤ p ∧ r.lower = q ∧ r.row = F.row q ∧ + r.assignments = assignmentSplice levels (natSetCode 1) (F.assignments q) p.assignments := + ⟨lifted p q below, splice_le M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F first second infinite choice hI0 hI1 p q below, + rfl, rfl, rfl⟩ + +end StageTwoCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +@[instance_reducible] noncomputable def stageTwoConditionTop : OrderTop Condition where + top := inc ⊤ + le_top p := (StageTwoCondition.le_inclusion_iff M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second p ⊤).2 le_top + +@[instance_reducible] noncomputable def stageTwoConditionSmallTop : + letI := smallOrder + OrderTop (Shrink Condition) := by + letI := smallOrder + letI := M.stageTwoConditionTop c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system F first second + exact { + top := equivShrink Condition ⊤ + le_top p := by + change (equivShrink Condition).symm p ≤ (equivShrink Condition).symm (equivShrink Condition ⊤) + rw [Equiv.symm_apply_apply] + exact le_top } + +theorem stageTwoConditionPresentation_top : + letI := smallOrder + letI := M.stageTwoConditionSmallTop c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system F first second + (pres).encode ⊤ = s.encode ⊤ := by + let := smallOrder + let := M.stageTwoConditionSmallTop c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system F first second + change (pres).encode (equivShrink Condition (inc ⊤)) = s.encode ⊤ + rw [M.stageTwoConditionPresentation_encode c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system] + exact StageTwoCondition.includeLower_code M c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system F first second ⊤ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameGraphs.lean index b40ad2f853baae5bf53ea90777f96d710109f8a5..dfc64a94ade1630311399fb9e79d75a971601275 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameGraphs.lean @@ -1,183 +1,183 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoClosureData - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -noncomputable def stageTwoNameLift (tau : Name s) : Name (pres) := by - letI := smallOrder - exact Name.rename (pres) inc tau - -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second - -theorem stageTwoNameLift_val (tau : Name s) : (liftName tau).val = tau.val := by - let := smallOrder - exact Name.rename_val_of_encode (pres) inc - (M.stageTwoSmallInclusion_encode c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second) tau - -theorem stageTwoNameLift_mem (tau : Name s) (ground : tau.val ∈ M.sets) : - (liftName tau).val ∈ M.sets := by - rw [M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second] - exact ground - -theorem stageTwoNameLift_eval : - letI := smallOrder - ∀ (H : Set (Shrink Condition)) (tau : Name s), - Name.eval H (liftName tau) = Name.eval {p | inc p ∈ H} tau := by - let := smallOrder - intro H tau - exact Name.eval_rename (pres) inc H tau - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second - -theorem stageTwoSmallInclusion_graph : - letI := smallOrder - s.graph (pres) inc = identityFunctionGraph s.carrier := by - let := smallOrder - apply ZFSet.ext - intro z - rw [Presentation.mem_graph, mem_identityFunctionGraph] - constructor - · rintro ⟨p, rfl⟩ - rw [M.stageTwoSmallInclusion_encode] - exact ⟨s.encode p, s.encode_mem p, rfl⟩ - · rintro ⟨x, hx, rfl⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx - exact ⟨p, congrArg (ZFSet.pair (s.encode p)) - (M.stageTwoSmallInclusion_encode c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second p)⟩ - -theorem stageTwoSmallInclusion_graph_mem : - letI := smallOrder - s.graph (pres) inc ∈ M.sets := by - let := smallOrder - rw [M.stageTwoSmallInclusion_graph] - exact M.identityFunctionGraph_mem pairing unions powers separation carrier - -theorem stageTwoNameLiftGraph_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : - letI := smallOrder - Name.renameFamilyGraph (pres) inc X oldValid = identityFunctionGraph X := by - let := smallOrder - apply ZFSet.ext - intro z - rw [Name.mem_renameFamilyGraph, mem_identityFunctionGraph] - constructor - · rintro ⟨tau, member, equal⟩ - have sameCode := M.stageTwoNameLift_val c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second tau - exact ⟨tau.val, member, equal.trans (congrArg (ZFSet.pair tau.val) sameCode)⟩ - · rintro ⟨x, member, rfl⟩ - let tau : Name s := ⟨x, oldValid x member⟩ - refine ⟨tau, member, ?_⟩ - exact (congrArg (ZFSet.pair x) (M.stageTwoNameLift_val c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second tau)).symm - -theorem stageTwoNameLiftGraph_mem (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) - (ground : X ∈ M.sets) : - letI := smallOrder - Name.renameFamilyGraph (pres) inc X oldValid ∈ M.sets := by - let := smallOrder - rw [M.stageTwoNameLiftGraph_eq] - exact M.identityFunctionGraph_mem pairing unions powers separation ground - -noncomputable def stageTwoGroundNameLift (tau : (M.nameDomain s).names) : (M.nameDomain (pres)).names := - ⟨liftName tau.val, M.stageTwoNameLift_mem c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second tau.val tau.property⟩ - -theorem stageTwoGroundNameLift_val (tau : (M.nameDomain s).names) : - (M.stageTwoGroundNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second tau).val.val = tau.val.val := - M.stageTwoNameLift_val c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second tau.val - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoClosureData + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +noncomputable def stageTwoNameLift (tau : Name s) : Name (pres) := by + letI := smallOrder + exact Name.rename (pres) inc tau + +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second + +theorem stageTwoNameLift_val (tau : Name s) : (liftName tau).val = tau.val := by + let := smallOrder + exact Name.rename_val_of_encode (pres) inc + (M.stageTwoSmallInclusion_encode c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second) tau + +theorem stageTwoNameLift_mem (tau : Name s) (ground : tau.val ∈ M.sets) : + (liftName tau).val ∈ M.sets := by + rw [M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second] + exact ground + +theorem stageTwoNameLift_eval : + letI := smallOrder + ∀ (H : Set (Shrink Condition)) (tau : Name s), + Name.eval H (liftName tau) = Name.eval {p | inc p ∈ H} tau := by + let := smallOrder + intro H tau + exact Name.eval_rename (pres) inc H tau + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second + +theorem stageTwoSmallInclusion_graph : + letI := smallOrder + s.graph (pres) inc = identityFunctionGraph s.carrier := by + let := smallOrder + apply ZFSet.ext + intro z + rw [Presentation.mem_graph, mem_identityFunctionGraph] + constructor + · rintro ⟨p, rfl⟩ + rw [M.stageTwoSmallInclusion_encode] + exact ⟨s.encode p, s.encode_mem p, rfl⟩ + · rintro ⟨x, hx, rfl⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier x).1 hx + exact ⟨p, congrArg (ZFSet.pair (s.encode p)) + (M.stageTwoSmallInclusion_encode c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second p)⟩ + +theorem stageTwoSmallInclusion_graph_mem : + letI := smallOrder + s.graph (pres) inc ∈ M.sets := by + let := smallOrder + rw [M.stageTwoSmallInclusion_graph] + exact M.identityFunctionGraph_mem pairing unions powers separation carrier + +theorem stageTwoNameLiftGraph_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : + letI := smallOrder + Name.renameFamilyGraph (pres) inc X oldValid = identityFunctionGraph X := by + let := smallOrder + apply ZFSet.ext + intro z + rw [Name.mem_renameFamilyGraph, mem_identityFunctionGraph] + constructor + · rintro ⟨tau, member, equal⟩ + have sameCode := M.stageTwoNameLift_val c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second tau + exact ⟨tau.val, member, equal.trans (congrArg (ZFSet.pair tau.val) sameCode)⟩ + · rintro ⟨x, member, rfl⟩ + let tau : Name s := ⟨x, oldValid x member⟩ + refine ⟨tau, member, ?_⟩ + exact (congrArg (ZFSet.pair x) (M.stageTwoNameLift_val c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second tau)).symm + +theorem stageTwoNameLiftGraph_mem (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) + (ground : X ∈ M.sets) : + letI := smallOrder + Name.renameFamilyGraph (pres) inc X oldValid ∈ M.sets := by + let := smallOrder + rw [M.stageTwoNameLiftGraph_eq] + exact M.identityFunctionGraph_mem pairing unions powers separation ground + +noncomputable def stageTwoGroundNameLift (tau : (M.nameDomain s).names) : (M.nameDomain (pres)).names := + ⟨liftName tau.val, M.stageTwoNameLift_mem c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second tau.val tau.property⟩ + +theorem stageTwoGroundNameLift_val (tau : (M.nameDomain s).names) : + (M.stageTwoGroundNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second tau).val.val = tau.val.val := + M.stageTwoNameLift_val c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second tau.val + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameLiftFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameLiftFamilies.lean index 80f3dfefb184daf3cc0af32aefce0f4a9c6c2992..d57b8efd2f0c6d323015e06ea35802c0e673c894 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameLiftFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNameLiftFamilies.lean @@ -1,117 +1,117 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNamePositionSupports - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -include infinite choice hI0 hI1 in -theorem stageTwoNameLift_hs (supports : NormalSubgroupFamily G) (τ : Name s) - (hs : HereditarilySymmetric a s supports τ) : - letI := smallOrder - HereditarilySymmetric (smallAct) (pres) supports (liftName τ) := by - let := smallOrder - exact hs.rename (smallAct) (pres) incl - (fun g p => (M.stageTwoSmallInclusion_equivariant c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - rowAction image inputs F first second infinite choice hI0 hI1 g p).symm) - -include F first second in -theorem stageTwoNameFamily_valid (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : - ∀ z ∈ X, IsName (pres) z := by - intro z hz - have lifted := (liftName ⟨z, oldValid z hz⟩).property - erw [M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second] at lifted - exact lifted - -theorem stageTwoNameFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : - Name.renamedFamily (pres) incl X oldValid = X := by - apply ZFSet.ext - intro z - rw [Name.mem_renamedFamily] - constructor - · rintro ⟨τ, hτ, equal⟩ - have codes := M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second τ - exact (equal.trans codes).symm ▸ hτ - · intro hz - exact ⟨⟨z, oldValid z hz⟩, hz, - (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second ⟨z, oldValid z hz⟩).symm⟩ - -include F first second infinite choice hI0 hI1 in -theorem stageTwoNameFamily_transport (supports : NormalSubgroupFamily G) (X : ZFSet.{u}) - (oldValid : ∀ z ∈ X, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ X → (a.act s g τ).val ∈ X) - (children : ∀ τ : Name s, τ.val ∈ X → HereditarilySymmetric a s supports τ) : - letI := smallOrder - (∀ z ∈ X, IsName (pres) z) ∧ - (∀ g (τ : Name (pres)), τ.val ∈ X → ((smallAct).act (pres) g τ).val ∈ X) ∧ - (∀ τ : Name (pres), τ.val ∈ X → HereditarilySymmetric (smallAct) (pres) supports τ) := by - let := smallOrder - refine ⟨M.stageTwoNameFamily_valid c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second X oldValid, ?_, ?_⟩ - · intro g τ hτ - let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ - have same : liftName σ = τ := Subtype.ext - (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second σ) - rw [← same, M.stageTwoNameLift_act c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second rowAction image inputs infinite choice hI0 hI1, - M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second] - exact closed g σ hτ - · intro τ hτ - let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ - have same : liftName σ = τ := Subtype.ext - (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second σ) - rw [← same] - exact M.stageTwoNameLift_hs c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second rowAction image inputs infinite choice hI0 hI1 supports σ (children σ hτ) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNamePositionSupports + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +include infinite choice hI0 hI1 in +theorem stageTwoNameLift_hs (supports : NormalSubgroupFamily G) (τ : Name s) + (hs : HereditarilySymmetric a s supports τ) : + letI := smallOrder + HereditarilySymmetric (smallAct) (pres) supports (liftName τ) := by + let := smallOrder + exact hs.rename (smallAct) (pres) incl + (fun g p => (M.stageTwoSmallInclusion_equivariant c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + rowAction image inputs F first second infinite choice hI0 hI1 g p).symm) + +include F first second in +theorem stageTwoNameFamily_valid (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : + ∀ z ∈ X, IsName (pres) z := by + intro z hz + have lifted := (liftName ⟨z, oldValid z hz⟩).property + erw [M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second] at lifted + exact lifted + +theorem stageTwoNameFamily_eq (X : ZFSet.{u}) (oldValid : ∀ z ∈ X, IsName s z) : + Name.renamedFamily (pres) incl X oldValid = X := by + apply ZFSet.ext + intro z + rw [Name.mem_renamedFamily] + constructor + · rintro ⟨τ, hτ, equal⟩ + have codes := M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second τ + exact (equal.trans codes).symm ▸ hτ + · intro hz + exact ⟨⟨z, oldValid z hz⟩, hz, + (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second ⟨z, oldValid z hz⟩).symm⟩ + +include F first second infinite choice hI0 hI1 in +theorem stageTwoNameFamily_transport (supports : NormalSubgroupFamily G) (X : ZFSet.{u}) + (oldValid : ∀ z ∈ X, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ X → (a.act s g τ).val ∈ X) + (children : ∀ τ : Name s, τ.val ∈ X → HereditarilySymmetric a s supports τ) : + letI := smallOrder + (∀ z ∈ X, IsName (pres) z) ∧ + (∀ g (τ : Name (pres)), τ.val ∈ X → ((smallAct).act (pres) g τ).val ∈ X) ∧ + (∀ τ : Name (pres), τ.val ∈ X → HereditarilySymmetric (smallAct) (pres) supports τ) := by + let := smallOrder + refine ⟨M.stageTwoNameFamily_valid c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second X oldValid, ?_, ?_⟩ + · intro g τ hτ + let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ + have same : liftName σ = τ := Subtype.ext + (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second σ) + rw [← same, M.stageTwoNameLift_act c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second rowAction image inputs infinite choice hI0 hI1, + M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second] + exact closed g σ hτ + · intro τ hτ + let σ : Name s := ⟨τ.val, oldValid τ.val hτ⟩ + have same : liftName σ = τ := Subtype.ext + (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second σ) + rw [← same] + exact M.stageTwoNameLift_hs c I0 a s b d T T2 valid pairing unions powers separation collection carrier order nodes hT indices base directed system F first second rowAction image inputs infinite choice hI0 hI1 supports σ (children σ hτ) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNamePositionSupports.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNamePositionSupports.lean index f71a62aa941dcebb0ff73bc7dbc35596dec493bc..6c19d9c3e503b3948a9f9a38bddd501888500393 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNamePositionSupports.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStageTwoNamePositionSupports.lean @@ -1,450 +1,450 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoActionInputs -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameGraphs - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace CompleteProjection -universe u -variable {G P Q : Type u} [Group G] [PartialOrder P] [PartialOrder Q] -variable {restriction : Q →o P} {inclusion : P ↪o Q} - -theorem inclusion_equivariant (projection : CompleteProjection restriction inclusion) - (upper : PosetAction G Q) (lower : PosetAction G P) - (equivariant : ∀ g q, restriction (upper.iso g q) = lower.iso g (restriction q)) - (g : G) (p : P) : upper.iso g (inclusion p) = inclusion (lower.iso g p) := by - have forward (h : G) (q : P) : upper.iso h (inclusion q) ≤ inclusion (lower.iso h q) := by - apply (projection.le_include_iff _ _).2 - rw [equivariant, projection.retract] - apply le_antisymm (forward g p) - have back := (upper.iso g).monotone (forward g⁻¹ (lower.iso g p)) - have cancel : lower.iso g⁻¹ (lower.iso g p) = p := by - rw [← lower.mul, inv_mul_cancel, lower.one] - rw [cancel, ← upper.mul, mul_inv_cancel, upper.one] at back - exact back - -end CompleteProjection - -namespace PosetAction -open SetRealization -universe u -variable {G P Q L : Type u} [Group G] [PartialOrder P] [PartialOrder Q] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (e : PosetAction G Q) (t : Presentation Q) -variable (liftName : Name s → Name t) -variable (codes : ∀ τ, (liftName τ).val = τ.val) -variable (stabilizers : ∀ τ, e.stabilizer t (liftName τ) = a.stabilizer s τ) -include codes stabilizers - -theorem positionSupport_of_codeLift (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (b : Presentation L) (d : PosetAction G L) (S mu X tuples : ZFSet.{u}) (D : L) - (range : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ T) - (support : ∀ f ∈ S, ∀ τ : Name s, ZFSet.pair f τ.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s τ) : - ∀ f ∈ S, ∀ τ : Name t, ZFSet.pair f τ.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ e.stabilizer t τ := by - intro f hf τ entry bound - let lower : Name s := ⟨τ.val, valid τ.val (range f τ.val entry)⟩ - have same : liftName lower = τ := Subtype.ext (codes lower) - rw [← same, stabilizers] - exact support f hf lower entry bound - -end PosetAction - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs -local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "smallInc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -theorem stageTwoSmallRestriction_equivariant : - letI := smallOrder - ∀ (g : G) (q : Shrink Condition), - smallRestrict ((smallAct).iso g q) = a.iso g (smallRestrict q) := by - let := smallOrder - intro g q - change ((equivShrink Condition).symm ((smallAct).iso g q)).lower = - a.iso g ((equivShrink Condition).symm q).lower - rw [M.stageTwoSmallAction_decode] - rfl - -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) - -include infinite choice hI0 hI1 in -theorem stageTwoSmallInclusion_equivariant : - letI := smallOrder - ∀ (g : G) (p : P), - (smallAct).iso g (smallInc p) = smallInc (a.iso g p) := by - let := smallOrder - have projection := M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - infinite choice hI0 hI1 - exact projection.inclusion_equivariant smallAct a - (M.stageTwoSmallRestriction_equivariant c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs F) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -include infinite choice hI0 hI1 - -theorem stageTwoNameLift_act : - letI := smallOrder - ∀ (g : G) (τ : Name s), - (smallAct).act (pres) g (liftName τ) = liftName (a.act s g τ) := by - let := smallOrder - intro g τ - exact a.act_rename_of_equivariant (smallAct) s (pres) incl - (fun g p => (M.stageTwoSmallInclusion_equivariant c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - rowAction image inputs F first second infinite choice hI0 hI1 g p).symm) g τ - -theorem stageTwoNameLift_stabilizer : - letI := smallOrder - ∀ τ : Name s, (smallAct).stabilizer (pres) (liftName τ) = a.stabilizer s τ := by - let := smallOrder - intro τ - apply Subgroup.ext - intro g - change (smallAct).act (pres) g (liftName τ) = liftName τ ↔ a.act s g τ = τ - rw [M.stageTwoNameLift_act c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second - rowAction image inputs infinite choice hI0 hI1] - constructor - · intro equal - apply Subtype.ext - have codes := congrArg Subtype.val equal - simpa only [M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second] using codes - · intro equal - exact congrArg liftName equal - -theorem stageTwoNameLift_supported (K : Subgroup G) (τ : Name s) - (supported : K ≤ a.stabilizer s τ) : - letI := smallOrder - K ≤ (smallAct).stabilizer (pres) (liftName τ) := by - let := smallOrder - rw [M.stageTwoNameLift_stabilizer c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second - rowAction image inputs infinite choice hI0 hI1] - exact supported - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -include F first second infinite choice hI0 hI1 in -theorem stageTwoNameLift_positionSupport (S mu X tuples : ZFSet.{u}) (D : L) - (range : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ T) - (support : ∀ f ∈ S, ∀ τ : Name s, ZFSet.pair f τ.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s τ) : - letI := smallOrder - ∀ f ∈ S, ∀ τ : Name (pres), ZFSet.pair f τ.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ (smallAct).stabilizer (pres) τ := by - let := smallOrder - exact a.positionSupport_of_codeLift s (smallAct) (pres) liftName - (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second) - (M.stageTwoNameLift_stabilizer c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second - rowAction image inputs infinite choice hI0 hI1) - T valid b d S mu X tuples D range support - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageTwoActionData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : Prop where - closure_data : StageTwoClosureData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection - valid2 : ∀ z ∈ T2, IsName c.pairEmpty z - term_graphs : - let next := closure_data.projection_data.carrier_data.index_data.next - ∀ g, Name.renameFamilyGraph s (e.iso g) T next.valid1 = - Name.renameFamilyGraph c.pairEmpty (a.iso g) T valid - term_families : - let next := closure_data.projection_data.carrier_data.index_data.next - e.termActionFamily s actors T next.valid1 = a.termActionFamily c.pairEmpty actors T valid - actions : - let prior := closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 - let graph := M.stageTwoAssignmentActionGraph a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - let restriction := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F - let inclusion := M.stageTwoSmallInclusion c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F closure_data.projection_data.first_level next.indices.levelCode - (∀ g A, image g A = relationImage A (stageOneAssignments (I0 ∪ I1) T) (graph g)) ∧ - familyCodeGraph actors.encode graph ∈ M.sets ∧ - action.actionGraph pres actors ∈ M.sets ∧ action.conditionMapFamily pres actors ∈ M.sets ∧ - (∀ g (q : Shrink Condition), - ((equivShrink Condition).symm (action.iso g q)).row = a.iso g ((equivShrink Condition).symm q).row ∧ - ((equivShrink Condition).symm (action.iso g q)).assignments = image g ((equivShrink Condition).symm q).assignments ∧ - ((equivShrink Condition).symm (action.iso g q)).lower = e.iso g ((equivShrink Condition).symm q).lower) ∧ - (∀ g (q : Shrink Condition), pres.encode (action.iso g q) = - ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm q).row)) - (image g ((equivShrink Condition).symm q).assignments)) ∧ - (∀ g q, restriction (action.iso g q) = e.iso g (restriction q)) ∧ - (∀ g p, action.iso g (inclusion p) = inclusion (e.iso g p)) - -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) -variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - -theorem stageTwoActionData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (prior : StageTwoClosureData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (params0 : StageOneActionParameters M a c.pairEmpty actors nodes d T T2 valid) - (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (hT2 : T2 ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) (group : actors.carrier ∈ M.sets) - (rowMaps : a.conditionMapFamily c actors ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (row_equivariant : ∀ (F : FlatConditionSystem M c s - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) T)) g q, - F.row (e.iso g q) = a.iso g (F.row q)) - (data_equivariant : ∀ (F : FlatConditionSystem M c s - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) T)) g q, - F.assignments (e.iso g q) = M.stageOneAssignmentImage a c.pairEmpty nodes d T T2 valid valid2 g (F.assignments q)) - (termGraphs : ∀ g, - Name.renameFamilyGraph s (e.iso g) T prior.projection_data.carrier_data.index_data.next.valid1 = - Name.renameFamilyGraph c.pairEmpty (a.iso g) T valid) : - StageTwoActionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection := by - let data := prior.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 - let graph := M.stageTwoAssignmentActionGraph a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 - have carrier0 := M.pairEmpty_carrier_mem pairing unions powers separation c rows - have order0 := M.pairEmpty_order_mem pairing unions powers separation c rows rowOrder - have omega := M.omega_mem separation infinite - obtain ⟨F, hNodes, _⟩ := prior.projection_data.projections - have inputs := M.stageTwoActionInputs a c.pairEmpty c e s nodes d T T2 valid valid2 next.valid1 next.valid2 - actors pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground - data.lower_order_ground params0 next.inputs data.terms_ground hT2 hI0 next.indices.index_ground - prior.projection_data.first_level next.indices.levelCode omega base directed next.first F - (row_equivariant F) (data_equivariant F) - have imageEq : ∀ g A, image g A = relationImage A - (stageOneAssignments (I0 ∪ M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1) T) (graph g) := - M.stageTwoAssignmentImage_eq_relationImage a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 - actors pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground - data.lower_order_ground params0 next.inputs - have familyGround : familyCodeGraph actors.encode graph ∈ M.sets := - M.stageTwoAssignmentActionFamily_mem_of_inputs a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 - actors pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground - data.lower_order_ground params0 next.inputs group hNodes data.terms_ground hT2 hI0 next.indices.index_ground omega - refine ⟨prior, valid2, termGraphs, ?_, ?_⟩ - · unfold PosetAction.termActionFamily - congr 1 - funext g - exact termGraphs g - · refine ⟨F, ?_⟩ - let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first - refine ⟨hNodes, inputs, imageEq, familyGround, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact M.stageTwoSmallActionGraph_mem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first a image inputs actors graph imageEq - rows hI0 nodeOrder omega group rowMaps familyGround - · exact M.stageTwoSmallActionMapFamily_mem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first a image inputs actors graph imageEq - rows hI0 nodeOrder omega group rowMaps familyGround - · intro g q - rw [M.stageTwoSmallAction_decode] - exact ⟨rfl, rfl, rfl⟩ - · exact M.stageTwoSmallAction_encode c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first a image inputs - · exact M.stageTwoSmallRestriction_equivariant c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first a image inputs F - · exact M.stageTwoSmallInclusion_equivariant c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first a image inputs F prior.projection_data.first_level next.indices.levelCode - infinite choice hI0 next.indices.index_ground - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoActionInputs +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameGraphs + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace CompleteProjection +universe u +variable {G P Q : Type u} [Group G] [PartialOrder P] [PartialOrder Q] +variable {restriction : Q →o P} {inclusion : P ↪o Q} + +theorem inclusion_equivariant (projection : CompleteProjection restriction inclusion) + (upper : PosetAction G Q) (lower : PosetAction G P) + (equivariant : ∀ g q, restriction (upper.iso g q) = lower.iso g (restriction q)) + (g : G) (p : P) : upper.iso g (inclusion p) = inclusion (lower.iso g p) := by + have forward (h : G) (q : P) : upper.iso h (inclusion q) ≤ inclusion (lower.iso h q) := by + apply (projection.le_include_iff _ _).2 + rw [equivariant, projection.retract] + apply le_antisymm (forward g p) + have back := (upper.iso g).monotone (forward g⁻¹ (lower.iso g p)) + have cancel : lower.iso g⁻¹ (lower.iso g p) = p := by + rw [← lower.mul, inv_mul_cancel, lower.one] + rw [cancel, ← upper.mul, mul_inv_cancel, upper.one] at back + exact back + +end CompleteProjection + +namespace PosetAction +open SetRealization +universe u +variable {G P Q L : Type u} [Group G] [PartialOrder P] [PartialOrder Q] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (e : PosetAction G Q) (t : Presentation Q) +variable (liftName : Name s → Name t) +variable (codes : ∀ τ, (liftName τ).val = τ.val) +variable (stabilizers : ∀ τ, e.stabilizer t (liftName τ) = a.stabilizer s τ) +include codes stabilizers + +theorem positionSupport_of_codeLift (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (b : Presentation L) (d : PosetAction G L) (S mu X tuples : ZFSet.{u}) (D : L) + (range : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ T) + (support : ∀ f ∈ S, ∀ τ : Name s, ZFSet.pair f τ.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s τ) : + ∀ f ∈ S, ∀ τ : Name t, ZFSet.pair f τ.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ e.stabilizer t τ := by + intro f hf τ entry bound + let lower : Name s := ⟨τ.val, valid τ.val (range f τ.val entry)⟩ + have same : liftName lower = τ := Subtype.ext (codes lower) + rw [← same, stabilizers] + exact support f hf lower entry bound + +end PosetAction + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs +local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "smallInc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +theorem stageTwoSmallRestriction_equivariant : + letI := smallOrder + ∀ (g : G) (q : Shrink Condition), + smallRestrict ((smallAct).iso g q) = a.iso g (smallRestrict q) := by + let := smallOrder + intro g q + change ((equivShrink Condition).symm ((smallAct).iso g q)).lower = + a.iso g ((equivShrink Condition).symm q).lower + rw [M.stageTwoSmallAction_decode] + rfl + +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) + +include infinite choice hI0 hI1 in +theorem stageTwoSmallInclusion_equivariant : + letI := smallOrder + ∀ (g : G) (p : P), + (smallAct).iso g (smallInc p) = smallInc (a.iso g p) := by + let := smallOrder + have projection := M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + infinite choice hI0 hI1 + exact projection.inclusion_equivariant smallAct a + (M.stageTwoSmallRestriction_equivariant c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs F) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +include infinite choice hI0 hI1 + +theorem stageTwoNameLift_act : + letI := smallOrder + ∀ (g : G) (τ : Name s), + (smallAct).act (pres) g (liftName τ) = liftName (a.act s g τ) := by + let := smallOrder + intro g τ + exact a.act_rename_of_equivariant (smallAct) s (pres) incl + (fun g p => (M.stageTwoSmallInclusion_equivariant c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + rowAction image inputs F first second infinite choice hI0 hI1 g p).symm) g τ + +theorem stageTwoNameLift_stabilizer : + letI := smallOrder + ∀ τ : Name s, (smallAct).stabilizer (pres) (liftName τ) = a.stabilizer s τ := by + let := smallOrder + intro τ + apply Subgroup.ext + intro g + change (smallAct).act (pres) g (liftName τ) = liftName τ ↔ a.act s g τ = τ + rw [M.stageTwoNameLift_act c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second + rowAction image inputs infinite choice hI0 hI1] + constructor + · intro equal + apply Subtype.ext + have codes := congrArg Subtype.val equal + simpa only [M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second] using codes + · intro equal + exact congrArg liftName equal + +theorem stageTwoNameLift_supported (K : Subgroup G) (τ : Name s) + (supported : K ≤ a.stabilizer s τ) : + letI := smallOrder + K ≤ (smallAct).stabilizer (pres) (liftName τ) := by + let := smallOrder + rw [M.stageTwoNameLift_stabilizer c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second + rowAction image inputs infinite choice hI0 hI1] + exact supported + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +include F first second infinite choice hI0 hI1 in +theorem stageTwoNameLift_positionSupport (S mu X tuples : ZFSet.{u}) (D : L) + (range : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ T) + (support : ∀ f ∈ S, ∀ τ : Name s, ZFSet.pair f τ.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s τ) : + letI := smallOrder + ∀ f ∈ S, ∀ τ : Name (pres), ZFSet.pair f τ.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ (smallAct).stabilizer (pres) τ := by + let := smallOrder + exact a.positionSupport_of_codeLift s (smallAct) (pres) liftName + (M.stageTwoNameLift_val c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second) + (M.stageTwoNameLift_stabilizer c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second + rowAction image inputs infinite choice hI0 hI1) + T valid b d S mu X tuples D range support + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageTwoActionData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : Prop where + closure_data : StageTwoClosureData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection + valid2 : ∀ z ∈ T2, IsName c.pairEmpty z + term_graphs : + let next := closure_data.projection_data.carrier_data.index_data.next + ∀ g, Name.renameFamilyGraph s (e.iso g) T next.valid1 = + Name.renameFamilyGraph c.pairEmpty (a.iso g) T valid + term_families : + let next := closure_data.projection_data.carrier_data.index_data.next + e.termActionFamily s actors T next.valid1 = a.termActionFamily c.pairEmpty actors T valid + actions : + let prior := closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 + let graph := M.stageTwoAssignmentActionGraph a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + let restriction := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F + let inclusion := M.stageTwoSmallInclusion c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F closure_data.projection_data.first_level next.indices.levelCode + (∀ g A, image g A = relationImage A (stageOneAssignments (I0 ∪ I1) T) (graph g)) ∧ + familyCodeGraph actors.encode graph ∈ M.sets ∧ + action.actionGraph pres actors ∈ M.sets ∧ action.conditionMapFamily pres actors ∈ M.sets ∧ + (∀ g (q : Shrink Condition), + ((equivShrink Condition).symm (action.iso g q)).row = a.iso g ((equivShrink Condition).symm q).row ∧ + ((equivShrink Condition).symm (action.iso g q)).assignments = image g ((equivShrink Condition).symm q).assignments ∧ + ((equivShrink Condition).symm (action.iso g q)).lower = e.iso g ((equivShrink Condition).symm q).lower) ∧ + (∀ g (q : Shrink Condition), pres.encode (action.iso g q) = + ZFSet.pair (c.encode (a.iso g ((equivShrink Condition).symm q).row)) + (image g ((equivShrink Condition).symm q).assignments)) ∧ + (∀ g q, restriction (action.iso g q) = e.iso g (restriction q)) ∧ + (∀ g p, action.iso g (inclusion p) = inclusion (e.iso g p)) + +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) +variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + +theorem stageTwoActionData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (prior : StageTwoClosureData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (params0 : StageOneActionParameters M a c.pairEmpty actors nodes d T T2 valid) + (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (hT2 : T2 ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) (group : actors.carrier ∈ M.sets) + (rowMaps : a.conditionMapFamily c actors ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (row_equivariant : ∀ (F : FlatConditionSystem M c s + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) T)) g q, + F.row (e.iso g q) = a.iso g (F.row q)) + (data_equivariant : ∀ (F : FlatConditionSystem M c s + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) T)) g q, + F.assignments (e.iso g q) = M.stageOneAssignmentImage a c.pairEmpty nodes d T T2 valid valid2 g (F.assignments q)) + (termGraphs : ∀ g, + Name.renameFamilyGraph s (e.iso g) T prior.projection_data.carrier_data.index_data.next.valid1 = + Name.renameFamilyGraph c.pairEmpty (a.iso g) T valid) : + StageTwoActionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection := by + let data := prior.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 + let graph := M.stageTwoAssignmentActionGraph a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 + have carrier0 := M.pairEmpty_carrier_mem pairing unions powers separation c rows + have order0 := M.pairEmpty_order_mem pairing unions powers separation c rows rowOrder + have omega := M.omega_mem separation infinite + obtain ⟨F, hNodes, _⟩ := prior.projection_data.projections + have inputs := M.stageTwoActionInputs a c.pairEmpty c e s nodes d T T2 valid valid2 next.valid1 next.valid2 + actors pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground + data.lower_order_ground params0 next.inputs data.terms_ground hT2 hI0 next.indices.index_ground + prior.projection_data.first_level next.indices.levelCode omega base directed next.first F + (row_equivariant F) (data_equivariant F) + have imageEq : ∀ g A, image g A = relationImage A + (stageOneAssignments (I0 ∪ M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1) T) (graph g) := + M.stageTwoAssignmentImage_eq_relationImage a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 + actors pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground + data.lower_order_ground params0 next.inputs + have familyGround : familyCodeGraph actors.encode graph ∈ M.sets := + M.stageTwoAssignmentActionFamily_mem_of_inputs a c.pairEmpty e s nodes d T T2 valid valid2 next.valid1 next.valid2 + actors pairing unions powers separation collection carrier0 order0 data.lower_carrier_ground + data.lower_order_ground params0 next.inputs group hNodes data.terms_ground hT2 hI0 next.indices.index_ground omega + refine ⟨prior, valid2, termGraphs, ?_, ?_⟩ + · unfold PosetAction.termActionFamily + congr 1 + funext g + exact termGraphs g + · refine ⟨F, ?_⟩ + let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first + refine ⟨hNodes, inputs, imageEq, familyGround, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact M.stageTwoSmallActionGraph_mem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first a image inputs actors graph imageEq + rows hI0 nodeOrder omega group rowMaps familyGround + · exact M.stageTwoSmallActionMapFamily_mem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first a image inputs actors graph imageEq + rows hI0 nodeOrder omega group rowMaps familyGround + · intro g q + rw [M.stageTwoSmallAction_decode] + exact ⟨rfl, rfl, rfl⟩ + · exact M.stageTwoSmallAction_encode c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first a image inputs + · exact M.stageTwoSmallRestriction_equivariant c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first a image inputs F + · exact M.stageTwoSmallInclusion_equivariant c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first a image inputs F prior.projection_data.first_level next.indices.levelCode + infinite choice hI0 next.indices.index_ground + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredPreparedFamilyActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredPreparedFamilyActions.lean index 7e84f0197ab763941046e3b2865dfebc8267b84e..7cf612b707b0253a1f2b970e69406cc887ae63c6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredPreparedFamilyActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredPreparedFamilyActions.lean @@ -1,740 +1,740 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStoredStructuralRequestActions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def certificateUsedSupports (nodes k : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun v => ∃ z F B f, - ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B) nodes - -theorem mem_certificateUsedSupports (nodes k v : ZFSet.{u}) : - v ∈ certificateUsedSupports nodes k ↔ v ∈ nodes ∧ - ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B := - ZFSet.mem_sep - -noncomputable def preparationEventUsedSupports (nodes event : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun v => ∃ alpha r k enumerations, - event = ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) ∧ - ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B) nodes - -theorem preparationEventUsedSupports_active (nodes alpha r k enumerations : ZFSet.{u}) : - preparationEventUsedSupports nodes (ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations))) = - certificateUsedSupports nodes k := by - apply ZFSet.ext - intro v - rw [preparationEventUsedSupports, ZFSet.mem_sep, mem_certificateUsedSupports] - apply and_congr_right - intro _ - constructor - · rintro ⟨alpha', r', k', e', equal, data⟩ - have middle := (ZFSet.pair_inj.1 equal).2 - have last := (ZFSet.pair_inj.1 middle).2 - have same := (ZFSet.pair_inj.1 last).1 - exact same.symm ▸ data - · intro data - exact ⟨alpha, r, k, enumerations, rfl, data⟩ - -theorem preparationEventUsedSupports_idle (nodes : ZFSet.{u}) : - preparationEventUsedSupports nodes ∅ = ∅ := by - apply ZFSet.ext - intro v - rw [preparationEventUsedSupports, ZFSet.mem_sep] - constructor - · rintro ⟨_, alpha, r, k, enumerations, equal, _⟩ - have member : ({alpha} : ZFSet.{u}) ∈ - ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) := by - exact ZFSet.mem_insert _ _ - rw [← equal] at member - exact False.elim (ZFSet.notMem_empty _ member) - · intro member - exact False.elim (ZFSet.notMem_empty _ member) - -namespace BoundedFormula - -def certificateBasisMemberFormula {n} (v k : Fin n) : BoundedFormula n := - exGraphFields k (exPairFields 0 (exPairFields 0 (.mem v.succ.succ.succ.succ.succ.succ 1))) - -theorem truth_certificateBasisMemberFormula {n} (v k : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (certificateBasisMemberFormula v k) env ↔ - ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧ env v ∈ B := by - simp only [certificateBasisMemberFormula, truth_exGraphFields, truth_exPairFields, Truth] - change (∃ z c, ZFSet.pair z c ∈ env k ∧ ∃ F tail, c = ZFSet.pair F tail ∧ - ∃ B f, tail = ZFSet.pair B f ∧ env v ∈ B) ↔ _ - constructor - · rintro ⟨z, c, edge, F, tail, rfl, B, f, rfl, member⟩ - exact ⟨z, F, B, f, edge, member⟩ - · rintro ⟨z, F, B, f, edge, member⟩ - exact ⟨z, _, edge, F, _, rfl, B, f, rfl, member⟩ - -def preparationEventSupportFormula {n} (v event : Fin n) : BoundedFormula n := - exPairFields event (exPairFields 0 (exPairFields 0 - (certificateBasisMemberFormula v.succ.succ.succ.succ.succ.succ 1))) - -theorem truth_preparationEventSupportFormula {n} (v event : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (preparationEventSupportFormula v event) env ↔ - ∃ alpha r k enumerations, - env event = ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) ∧ - ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ env v ∈ B := by - simp only [preparationEventSupportFormula, truth_exPairFields, truth_certificateBasisMemberFormula] - change (∃ alpha output, env event = ZFSet.pair alpha output ∧ ∃ r tail, - output = ZFSet.pair r tail ∧ ∃ k enumerations, tail = ZFSet.pair k enumerations ∧ - ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ env v ∈ B) ↔ _ - constructor - · rintro ⟨alpha, output, equal, r, tail, rfl, k, enumerations, rfl, data⟩ - exact ⟨alpha, r, k, enumerations, equal, data⟩ - · rintro ⟨alpha, r, k, enumerations, equal, data⟩ - exact ⟨alpha, _, equal, r, _, rfl, k, enumerations, rfl, data⟩ - -end BoundedFormula - - - - - - -def preparationTupleCode (F B f e names : ZFSet.{u}) : ZFSet.{u} := - ZFSet.pair (ZFSet.pair F (ZFSet.pair B f)) (ZFSet.pair e names) - -private noncomputable def tupleImageWithOmega - (omega nodes N nodeMap nameMap F B f e names : ZFSet.{u}) : ZFSet.{u} := - preparationTupleCode (relationImage F nodes nodeMap) (relationImage B nodes nodeMap) - (relationCompose nodes B N (relationConverse B nodes nodeMap) - (relationCompose B N N f nameMap)) - (relationCompose omega B nodes e nodeMap) (relationCompose omega N N names nameMap) - -noncomputable def preparationTupleImage - (nodes N nodeMap nameMap F B f e names : ZFSet.{u}) : ZFSet.{u} := - tupleImageWithOmega ZFSet.omega nodes N nodeMap nameMap F B f e names - -noncomputable def preparationTupleActionGraph - (C E nodes N nodeMap nameMap : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ F B f e names, z = ZFSet.pair (preparationTupleCode F B f e names) - (preparationTupleImage nodes N nodeMap nameMap F B f e names)) - (ZFSet.prod (ZFSet.prod C E) (ZFSet.prod C E)) - -theorem pair_mem_preparationTupleActionGraph (C E nodes N nodeMap nameMap F B f e names y : ZFSet.{u}) : - ZFSet.pair (preparationTupleCode F B f e names) y ∈ - preparationTupleActionGraph C E nodes N nodeMap nameMap ↔ - preparationTupleCode F B f e names ∈ ZFSet.prod C E ∧ y ∈ ZFSet.prod C E ∧ - y = preparationTupleImage nodes N nodeMap nameMap F B f e names := by - rw [preparationTupleActionGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨bounds, F', B', f', e', names', equal⟩ - obtain ⟨keys, values⟩ := ZFSet.pair_inj.1 equal - have fields : F = F' ∧ B = B' ∧ f = f' ∧ e = e' ∧ names = names' := by - simpa only [preparationTupleCode, ZFSet.pair_inj, and_assoc] using keys - obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := fields - exact ⟨bounds.1, bounds.2, values⟩ - · rintro ⟨hx, hy, rfl⟩ - exact ⟨⟨hx, hy⟩, F, B, f, e, names, rfl⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -private noncomputable def pairDefinition : - GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => ZFSet.pair (env 0) (env 1)) where - formula := orderedPairFormula 0 1 2 - closed := fun _ h => M.orderedPair_mem pairing (h 0) (h 1) - correct := fun _ h _ hz => M.realize_orderedPairFormula pairing 0 1 2 _ hz (h 0) (h 1) - -private noncomputable def imageDefinition : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => relationImage (env 0) (env 1) (env 2)) where - formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula - closed := fun _ h => M.relationImage_mem separation (h 0) (h 1) (h 2) - correct := by - intro env h z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz h), - BoundedFormula.truth_relationImageEqualityFormula] - rfl - -private noncomputable def converseDefinition : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => relationConverse (env 0) (env 1) (env 2)) where - formula := exactSetFormula 0 (BoundedFormula.converseEntryFormula 0 2 3 4).toFormula - closed := fun _ h => M.relationConverse_mem pairing unions powers separation (h 0) (h 1) (h 2) - correct := by - intro env h z hz - apply M.realize_exactSetFormula 0 _ _ hz - (fun w hw => M.transitive - (M.relationConverse_mem pairing unions powers separation (h 0) (h 1) (h 2)) hw) - intro w hw - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz h)), - BoundedFormula.truth_converseEntryFormula, mem_relationConverse] - rfl - -private noncomputable def composeDefinition : - GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => - relationCompose (env 0) (env 1) (env 2) (env 3) (env 4)) where - formula := exactSetFormula 0 (BoundedFormula.composeEntryFormula 0 2 3 4 5 6).toFormula - closed := fun _ h => M.relationCompose_mem pairing unions powers separation (h 0) (h 1) (h 2) (h 3) (h 4) - correct := by - intro env h z hz - apply M.realize_exactSetFormula 0 _ _ hz - (fun w hw => M.transitive - (M.relationCompose_mem pairing unions powers separation (h 0) (h 1) (h 2) (h 3) (h 4)) hw) - intro w hw - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz h)), - BoundedFormula.truth_composeEntryFormula, mem_relationCompose] - rfl - -private noncomputable def actionPairDefinition : - GroundDefinableFunction M (fun env : Fin 10 → ZFSet.{u} => - ZFSet.pair (preparationTupleCode (env 0) (env 1) (env 2) (env 3) (env 4)) - (tupleImageWithOmega (env 9) (env 5) (env 6) (env 7) (env 8) - (env 0) (env 1) (env 2) (env 3) (env 4))) := by - let v := GroundSetTerm.var M (n := 10) - let pair (x y : GroundSetTerm M 10) := GroundSetTerm.app (pairDefinition M pairing) ![x,y] - let image (x : GroundSetTerm M 10) := GroundSetTerm.app (imageDefinition M separation) ![x,v 5,v 7] - let compose (x y z r f : GroundSetTerm M 10) := - GroundSetTerm.app (composeDefinition M pairing unions powers separation) ![x,y,z,r,f] - let inverse := GroundSetTerm.app (converseDefinition M pairing unions powers separation) ![v 1,v 5,v 7] - let movedF := compose (v 5) (v 1) (v 6) inverse (compose (v 1) (v 6) (v 6) (v 2) (v 8)) - let movedE := compose (v 9) (v 1) (v 5) (v 3) (v 7) - let movedNames := compose (v 9) (v 6) (v 6) (v 4) (v 8) - exact (pair (pair (pair (v 0) (pair (v 1) (v 2))) (pair (v 3) (v 4))) - (pair (pair (image (v 0)) (pair (image (v 1)) movedF)) (pair movedE movedNames))).definition - -include pairing unions powers separation in -theorem preparationTupleActionGraph_mem - {C E nodes N nodeMap nameMap : ZFSet.{u}} - (hC : C ∈ M.sets) (hE : E ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hN : N ∈ M.sets) (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - preparationTupleActionGraph C E nodes N nodeMap nameMap ∈ M.sets := by - let defined := actionPairDefinition M pairing unions powers separation - let slots : Fin 11 → Fin 11 := ![5,0,1,2,3,4,6,7,8,9,10] - let formula := exBlock 5 (SetFormula.reindex slots defined.formula) - let params : Fin 5 → ZFSet.{u} := ![nodes,N,nodeMap,nameMap,ZFSet.omega] - have paramsGround : ∀ j, params j ∈ M.sets := by - intro j - exact Fin.cases hNodes (Fin.cases hN (Fin.cases hNodeMap - (Fin.cases hNameMap (Fin.cases omega (fun k => Fin.elim0 k))))) j - have bound := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hC hE) - (M.prod_mem pairing unions powers separation hC hE) - have selected := M.separation_mem separation formula params paramsGround bound - have same : ZFSet.sep (fun z => Realize M.sets formula (extend z params)) - (ZFSet.prod (ZFSet.prod C E) (ZFSet.prod C E)) = - preparationTupleActionGraph C E nodes N nodeMap nameMap := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, preparationTupleActionGraph, ZFSet.mem_sep] - apply and_congr_right - intro hz - have zGround := M.transitive bound hz - rw [show formula = exBlock 5 (SetFormula.reindex slots defined.formula) from rfl, - realize_exBlock] - constructor - · rintro ⟨fields, grounds, meaning⟩ - rw [realize_reindex] at meaning - have values : (fun j => extendMany 5 fields (extend z params) (slots j)) = - extend z (extendMany 5 fields params) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j - rw [values] at meaning - have equal := (defined.correct (extendMany 5 fields params) - (extendMany_members 5 fields params grounds paramsGround) z zGround).1 meaning - exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, equal⟩ - · rintro ⟨F,B,f,e,names,equal⟩ - have inputGround : preparationTupleCode F B f e names ∈ M.sets := - M.pair_left (equal ▸ zGround) - have hF := M.pair_left (M.pair_left inputGround) - have hB := M.pair_left (M.pair_right (M.pair_left inputGround)) - have hf := M.pair_right (M.pair_right (M.pair_left inputGround)) - have he := M.pair_left (M.pair_right inputGround) - have hNames := M.pair_right (M.pair_right inputGround) - let fields : Fin 5 → ZFSet.{u} := ![F,B,f,e,names] - have grounds : ∀ j, fields j ∈ M.sets := by - intro j - exact Fin.cases hF (Fin.cases hB (Fin.cases hf - (Fin.cases he (Fin.cases hNames (fun k => Fin.elim0 k))))) j - refine ⟨fields,grounds,?_⟩ - rw [realize_reindex] - have values : (fun j => extendMany 5 fields (extend z params) (slots j)) = - extend z (extendMany 5 fields params) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j - rw [values] - exact (defined.correct (extendMany 5 fields params) - (extendMany_members 5 fields params grounds paramsGround) z zGround).2 equal - exact same ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem preparationTupleImage_mem_bound - {nodes N W nodeMap nameMap F B f e names : ZFSet.{u}} - (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) - (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (localBound : N ⊆ W) - (nodeInjection : InjectionCode nodes nodes nodeMap) - (member : preparationTupleCode F B f e names ∈ ZFSet.prod - (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W)) : - preparationTupleImage nodes N nodeMap nameMap F B f e names ∈ ZFSet.prod - (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) := by - have parts := ZFSet.pair_mem_prod.1 member - obtain ⟨⟨hF,_⟩,⟨hB,Bsub,small⟩,hf,_⟩ := - (M.mem_supportedEqualityCertificateBound nodes W F B f).1 parts.1 - have enumParts := ZFSet.pair_mem_prod.1 parts.2 - have he := ((M.mem_groundRelations ZFSet.omega nodes e).1 enumParts.1).1 - have hNames := ((M.mem_groundRelations ZFSet.omega W names).1 enumParts.2).1 - have hImageF := M.relationImage_mem separation hF hNodes hNodeMap - have hImageB := M.relationImage_mem separation hB hNodes hNodeMap - have hMovedF := M.relationCompose_mem pairing unions powers separation hNodes hB hN - (M.relationConverse_mem pairing unions powers separation hB hNodes hNodeMap) - (M.relationCompose_mem pairing unions powers separation hB hN hN hf hNameMap) - have hMovedE := M.relationCompose_mem pairing unions powers separation omega hB hNodes he hNodeMap - have hMovedNames := M.relationCompose_mem pairing unions powers separation omega hN hN hNames hNameMap - change ZFSet.pair - (ZFSet.pair (relationImage F nodes nodeMap) (ZFSet.pair (relationImage B nodes nodeMap) - (relationCompose nodes B N (relationConverse B nodes nodeMap) (relationCompose B N N f nameMap)))) - (ZFSet.pair (relationCompose ZFSet.omega B nodes e nodeMap) - (relationCompose ZFSet.omega N N names nameMap)) ∈ _ - apply ZFSet.pair_mem_prod.2 - constructor - · apply (M.mem_supportedEqualityCertificateBound nodes W _ _ _).2 - refine ⟨⟨hImageF, fun _ h => ((mem_relationImage _ _ _ _).1 h).1⟩, - ⟨hImageB, fun _ h => ((mem_relationImage _ _ _ _).1 h).1, - M.groundEmbeddable_image pairing unions powers separation hB hNodes omega hNodeMap - nodeInjection Bsub small⟩, hMovedF, ?_⟩ - intro z hz - obtain ⟨v,hv,tau,ht,rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - exact ZFSet.pair_mem_prod.2 ⟨hv,localBound ht⟩ - · apply ZFSet.pair_mem_prod.2 - refine ⟨(M.mem_groundRelations ZFSet.omega nodes _).2 - ⟨hMovedE, fun _ h => (ZFSet.mem_sep.1 h).1⟩, - (M.mem_groundRelations ZFSet.omega W _).2 ⟨hMovedNames,?_⟩⟩ - intro z hz - obtain ⟨n,hn,tau,ht,rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - exact ZFSet.pair_mem_prod.2 ⟨hn,localBound ht⟩ - -theorem preparationTupleActionGraph_function - {nodes N W nodeMap nameMap : ZFSet.{u}} - (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) - (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (localBound : N ⊆ W) - (nodeInjection : InjectionCode nodes nodes nodeMap) : - let D := ZFSet.prod (M.supportedEqualityCertificateBound nodes W) - (M.synchronizedEnumerationBound nodes W) - ZFSet.IsFunc D D (preparationTupleActionGraph - (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) - nodes N nodeMap nameMap) := by - dsimp only - refine ⟨fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩ - intro x hx - obtain ⟨cert,hcert,enm,henm,rfl⟩ := ZFSet.mem_prod.1 hx - obtain ⟨F,hF,rest,hrest,rfl⟩ := ZFSet.mem_prod.1 hcert - obtain ⟨B,hB,f,hf,rfl⟩ := ZFSet.mem_prod.1 hrest - obtain ⟨e,he,names,hnames,rfl⟩ := ZFSet.mem_prod.1 henm - have input : preparationTupleCode F B f e names ∈ ZFSet.prod - (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) := - ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hF,ZFSet.pair_mem_prod.2 ⟨hB,hf⟩⟩, - ZFSet.pair_mem_prod.2 ⟨he,hnames⟩⟩ - have output := M.preparationTupleImage_mem_bound pairing unions powers separation - hNodes hN hNodeMap hNameMap omega localBound nodeInjection input - refine ⟨preparationTupleImage nodes N nodeMap nameMap F B f e names, - (pair_mem_preparationTupleActionGraph _ _ _ _ _ _ _ _ _ _ _ _).2 ⟨input,output,rfl⟩, ?_⟩ - intro y hy - exact ((pair_mem_preparationTupleActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 hy).2.2 - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing -universe u -variable (M : TransitiveGround.{u}) -variable {nodes N W nodeMap nameMap J k enums : ZFSet.{u}} -local notation "C" => M.supportedEqualityCertificateBound nodes W -local notation "E" => M.synchronizedEnumerationBound nodes W -local notation "tuples" => preparationTupleActionGraph C E nodes N nodeMap nameMap -local notation "movedK" => preparationFamilyFirst J N C E nameMap tuples k enums -variable (nodeBound : nodeMap ⊆ ZFSet.prod nodes nodes) -variable (keys : InjectionCode N N nameMap) (sourceKeys : J ⊆ N) -variable (tupleFunction : ZFSet.IsFunc - (ZFSet.prod (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W)) - (ZFSet.prod (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W)) - (preparationTupleActionGraph (M.supportedEqualityCertificateBound nodes W) - (M.synchronizedEnumerationBound nodes W) nodes N nodeMap nameMap)) -variable (first : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) -variable (second : ZFSet.IsFunc J (M.synchronizedEnumerationBound nodes W) enums) -include nodeBound keys sourceKeys tupleFunction first second - -theorem preparationFamilyFirst_usedSupports_image : - certificateUsedSupports nodes movedK = - relationImage (certificateUsedSupports nodes k) nodes nodeMap := by - have functions := preparationFamilyImages_function keys tupleFunction first second - apply ZFSet.ext - intro v - constructor - · intro member - obtain ⟨hv, z, Fg, Bg, fg, cert, basis⟩ := (mem_certificateUsedSupports nodes movedK v).1 member - have hz := (ZFSet.pair_mem_prod.1 (functions.1.1 cert)).1 - obtain ⟨enm, enum, _⟩ := functions.2.2 z hz - obtain ⟨eg, _, namesg, _, rfl⟩ := ZFSet.mem_prod.1 - (ZFSet.pair_mem_prod.1 (functions.2.1 enum)).2 - obtain ⟨oldZ, oldC, oldE, oldCert, oldEnum, _key, tuple⟩ := - (preparationFamilyImages_entry keys tupleFunction first second z _ _).1 ⟨cert, enum⟩ - obtain ⟨F, _, tail, hTail, rfl⟩ := ZFSet.mem_prod.1 - (ZFSet.pair_mem_prod.1 (first.1 oldCert)).2 - obtain ⟨B, _, f, _, rfl⟩ := ZFSet.mem_prod.1 hTail - obtain ⟨e, _, names, _, rfl⟩ := ZFSet.mem_prod.1 - (ZFSet.pair_mem_prod.1 (second.1 oldEnum)).2 - have equal := ((pair_mem_preparationTupleActionGraph C E nodes N nodeMap nameMap - F B f e names _).1 tuple).2.2 - have basisEq : Bg = relationImage B nodes nodeMap := - (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).1).2).1 - obtain ⟨_, w, hw, edge⟩ := (mem_relationImage B nodes nodeMap v).1 (basisEq ▸ basis) - have hwNodes := (ZFSet.pair_mem_prod.1 (nodeBound edge)).1 - exact (mem_relationImage _ nodes nodeMap v).2 - ⟨hv, w, (mem_certificateUsedSupports nodes k w).2 - ⟨hwNodes, oldZ, F, B, f, oldCert, hw⟩, edge⟩ - · intro member - obtain ⟨hv, w, hw, edge⟩ := (mem_relationImage _ nodes nodeMap v).1 member - obtain ⟨_, z, F, B, f, cert, basis⟩ := (mem_certificateUsedSupports nodes k w).1 hw - have bounds := ZFSet.pair_mem_prod.1 (first.1 cert) - obtain ⟨enm, enum, _⟩ := second.2 z bounds.1 - have enumBound := (ZFSet.pair_mem_prod.1 (second.1 enum)).2 - obtain ⟨e, he, names, hn, rfl⟩ := ZFSet.mem_prod.1 enumBound - obtain ⟨zg, key, _⟩ := keys.function.2 z (sourceKeys bounds.1) - have input : preparationTupleCode F B f e names ∈ ZFSet.prod C E := - ZFSet.pair_mem_prod.2 ⟨bounds.2, ZFSet.pair_mem_prod.2 ⟨he, hn⟩⟩ - obtain ⟨value, tuple, _⟩ := tupleFunction.2 _ input - have equal := ((pair_mem_preparationTupleActionGraph C E nodes N nodeMap nameMap - F B f e names value).1 tuple).2.2 - rw [equal] at tuple - have moved := (preparationFamilyImages_entry keys tupleFunction first second zg - (ZFSet.pair (relationImage F nodes nodeMap) - (ZFSet.pair (relationImage B nodes nodeMap) - (relationCompose nodes B N (relationConverse B nodes nodeMap) - (relationCompose B N N f nameMap)))) - (ZFSet.pair (relationCompose ZFSet.omega B nodes e nodeMap) - (relationCompose ZFSet.omega N N names nameMap))).2 - ⟨z, _, _, cert, enum, key, tuple⟩ - exact (mem_certificateUsedSupports nodes movedK v).2 - ⟨hv, zg, _, _, _, moved.1, - (mem_relationImage B nodes nodeMap v).2 ⟨hv, w, basis, edge⟩⟩ - -theorem preparationFamilyFirst_usedSupports_subset {S : ZFSet.{u}} - (bound : certificateUsedSupports nodes k ⊆ S) : - certificateUsedSupports nodes movedK ⊆ relationImage S nodes nodeMap := by - rw [preparationFamilyFirst_usedSupports_image M nodeBound keys sourceKeys tupleFunction first second] - intro v member - obtain ⟨hv, w, hw, edge⟩ := (mem_relationImage _ nodes nodeMap v).1 member - exact (mem_relationImage S nodes nodeMap v).2 ⟨hv, w, bound hw, edge⟩ - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (omega : ZFSet.omega ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -include pairing unions powers separation collection carrier order group nodes supports maps nodeMaps omega hT valid closed - -theorem preparedCertificateFamily_act - (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) - {J W k enums : ZFSet.{u}} (hJ : J ∈ M.sets) (hW : W ∈ M.sets) - (hk : k ∈ M.sets) (hEnums : enums ∈ M.sets) - (requestBound : J ⊆ M.groundRelations T s.carrier) - (localBound : M.groundRelations T s.carrier ⊆ W) (p : P) (g : G) - (family : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) - b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega J - (M.supportedEqualityCertificateBound b.carrier W) (M.synchronizedEnumerationBound b.carrier W) k enums) : - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - let C := M.supportedEqualityCertificateBound b.carrier W - let E := M.synchronizedEnumerationBound b.carrier W - let keyMap := Name.renameFamilyGraph s (a.iso g) N validN - let nodeMap := b.graph b (d.iso g) - let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap - let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums - let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums - movedK ∈ M.sets ∧ movedEnums ∈ M.sets ∧ - PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) - b.carrier b.conditionOrder meetGraph N (M.niceVisibilityGraph a s b T d.principalFix) - (s.encode ⊤) ZFSet.omega (relationImage J N keyMap) C E movedK movedEnums := by - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - let C := M.supportedEqualityCertificateBound b.carrier W - let E := M.synchronizedEnumerationBound b.carrier W - let keyMap := Name.renameFamilyGraph s (a.iso g) N validN - let nodeMap := b.graph b (d.iso g) - let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap - have hN := M.groundRelations_mem pairing unions powers separation hT carrier - have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation nodes hW omega - have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation nodes hW omega - have keyGround := (M.groundRelations_nameAction_ground_function a s t pairing unions powers - separation collection carrier maps T closed hT valid g).1 - have keyInjection : InjectionCode N N keyMap := stageOneTermAction_injection a s N validN - (M.groundRelations_act_mem a s t pairing unions powers separation collection carrier maps T closed) g - have nodeGround := M.conditionMap_graph_mem d b t nodeMaps g - have nodeInjection := b.graph_injection b (d.iso g) (d.iso g).injective - have tupleGround := M.preparationTupleActionGraph_mem pairing unions powers separation hC hE nodes hN nodeGround keyGround omega - have tupleFunction := M.preparationTupleActionGraph_function pairing unions powers separation - nodes hN nodeGround keyGround omega localBound nodeInjection - have ground := M.preparationFamilyImages_mem pairing unions powers separation - hJ hN hC hE keyGround tupleGround hk hEnums - have functions := preparationFamilyImages_function keyInjection tupleFunction family.1 family.2.1 - dsimp only - refine ⟨ground.2.1, ground.2.2, functions.1, functions.2, ?_⟩ - intro x F' B' f' e' names' stored enumerated - obtain ⟨z, c, enm, oldK, oldE, keyEdge, tupleEdge⟩ := - (preparationFamilyImages_entry keyInjection tupleFunction family.1 family.2.1 - x (ZFSet.pair F' (ZFSet.pair B' f')) (ZFSet.pair e' names')).1 ⟨stored, enumerated⟩ - have zInJ := (ZFSet.pair_mem_prod.1 (family.1.1 oldK)).1 - have cBound := (ZFSet.pair_mem_prod.1 (family.1.1 oldK)).2 - have eBound := (ZFSet.pair_mem_prod.1 (family.2.1.1 oldE)).2 - obtain ⟨F, _, rest, restBound, rfl⟩ := ZFSet.mem_prod.1 cBound - obtain ⟨B, _, f, _, rfl⟩ := ZFSet.mem_prod.1 restBound - obtain ⟨e, _, names, _, rfl⟩ := ZFSet.mem_prod.1 eBound - let oldName : Name s := ⟨z, validN z (requestBound zInJ)⟩ - let old : (M.nameDomain s).names := ⟨oldName, ((M.mem_groundRelations T s.carrier z).1 (requestBound zInJ)).1⟩ - have keyEqual := ((Name.pair_mem_renameFamilyGraph s (a.iso g) N validN oldName x).1 keyEdge).2 - have moved := M.preparedCertificateCode_act a s t b d pairing unions powers separation collection - carrier order group nodes supports maps hT valid closed meetGraph meet old F B f e names p g - (family.2.2 z F B f e names oldK oldE) - have tupleEqual := ((pair_mem_preparationTupleActionGraph C E b.carrier N nodeMap keyMap - F B f e names (preparationTupleCode F' B' f' e' names')).1 tupleEdge).2.2 - have fields : F' = relationImage F b.carrier nodeMap ∧ - B' = relationImage B b.carrier nodeMap ∧ - f' = Name.actedRepresentativeGraph a s b d N validN g B f ∧ - e' = relationCompose ZFSet.omega B b.carrier e nodeMap ∧ - names' = Name.actedEnumerationGraph a s N validN g ZFSet.omega names := by - change ZFSet.pair (ZFSet.pair F' (ZFSet.pair B' f')) (ZFSet.pair e' names') = - ZFSet.pair (ZFSet.pair (relationImage F b.carrier nodeMap) - (ZFSet.pair (relationImage B b.carrier nodeMap) (Name.actedRepresentativeGraph a s b d N validN g B f))) - (ZFSet.pair (relationCompose ZFSet.omega B b.carrier e nodeMap) - (Name.actedEnumerationGraph a s N validN g ZFSet.omega names)) at tupleEqual - simpa only [ZFSet.pair_inj, and_assoc] using tupleEqual - obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := fields - rw [keyEqual] - exact moved - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (omega : ZFSet.omega ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -include pairing unions powers separation collection carrier order group nodes supports maps nodeMaps omega hT valid closed - -theorem preparedCertificateFamily_act_support - (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) - {J W k enums S : ZFSet.{u}} (hJ : J ∈ M.sets) (hW : W ∈ M.sets) - (hk : k ∈ M.sets) (hEnums : enums ∈ M.sets) (hS : S ∈ M.sets) - (requestBound : J ⊆ M.groundRelations T s.carrier) - (localBound : M.groundRelations T s.carrier ⊆ W) - (supportNodes : S ⊆ b.carrier) (small : M.groundEmbeddable S ZFSet.omega) - (p : P) (g : G) - (family : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) - b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega J - (M.supportedEqualityCertificateBound b.carrier W) (M.synchronizedEnumerationBound b.carrier W) k enums) - (supportBound : certificateUsedSupports b.carrier k ⊆ S) : - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - let C := M.supportedEqualityCertificateBound b.carrier W - let E := M.synchronizedEnumerationBound b.carrier W - let keyMap := Name.renameFamilyGraph s (a.iso g) N validN - let nodeMap := b.graph b (d.iso g) - let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap - let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums - let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums - let movedS := relationImage S b.carrier nodeMap - movedK ∈ M.sets ∧ movedEnums ∈ M.sets ∧ movedS ∈ M.sets ∧ - movedS ⊆ b.carrier ∧ M.groundEmbeddable movedS ZFSet.omega ∧ - PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) - b.carrier b.conditionOrder meetGraph N (M.niceVisibilityGraph a s b T d.principalFix) - (s.encode ⊤) ZFSet.omega (relationImage J N keyMap) C E movedK movedEnums ∧ - certificateUsedSupports b.carrier movedK = - relationImage (certificateUsedSupports b.carrier k) b.carrier nodeMap ∧ - certificateUsedSupports b.carrier movedK ⊆ movedS := by - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - let keyMap := Name.renameFamilyGraph s (a.iso g) N validN - have prepared := M.preparedCertificateFamily_act a s t b d pairing unions powers separation - collection carrier order group nodes supports maps nodeMaps omega hT valid closed - meetGraph meet hJ hW hk hEnums requestBound localBound p g family - have hN := M.groundRelations_mem pairing unions powers separation hT carrier - have keyGround := (M.groundRelations_nameAction_ground_function a s t pairing unions powers - separation collection carrier maps T closed hT valid g).1 - have keyInjection : InjectionCode N N keyMap := stageOneTermAction_injection a s N validN - (M.groundRelations_act_mem a s t pairing unions powers separation collection carrier maps T closed) g - have nodeGround := M.conditionMap_graph_mem d b t nodeMaps g - have nodeInjection := b.graph_injection b (d.iso g) (d.iso g).injective - have tupleFunction := M.preparationTupleActionGraph_function pairing unions powers separation - nodes hN nodeGround keyGround omega localBound nodeInjection - dsimp only - exact ⟨prepared.1, prepared.2.1, M.relationImage_mem separation hS nodes nodeGround, - fun v hv => ((mem_relationImage S b.carrier (b.graph b (d.iso g)) v).1 hv).1, - M.groundEmbeddable_image pairing unions powers separation hS nodes omega nodeGround - nodeInjection supportNodes small, prepared.2.2, - preparationFamilyFirst_usedSupports_image M nodeInjection.function.1 keyInjection requestBound - tupleFunction family.1 family.2.1, - preparationFamilyFirst_usedSupports_subset M nodeInjection.function.1 keyInjection requestBound - tupleFunction family.1 family.2.1 supportBound⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (group : t.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (omega : ZFSet.omega ∈ M.sets) -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) -include pairing unions powers separation collection members maps nodeMaps group supports omega closed closed2 valid2 - -theorem storedPreparationFamily_structural_act_support - (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) {stages history : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level - (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t)) ∈ history) - (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) - {A W k enums S : ZFSet.{u}} (hA : A ∈ M.sets) (hW : W ∈ M.sets) - (hk : k ∈ M.sets) (hEnums : enums ∈ M.sets) (hS : S ∈ M.sets) - (localBound : M.groundRelations T s.carrier ⊆ W) - (supportNodes : S ⊆ b.carrier) (small : M.groundEmbeddable S ZFSet.omega) - (p : P) (g : G) - (family : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) - b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega - (M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid)) - (M.supportedEqualityCertificateBound b.carrier W) (M.synchronizedEnumerationBound b.carrier W) k enums) - (supportBound : certificateUsedSupports b.carrier k ⊆ S) : - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - let J := M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid) - let C := M.supportedEqualityCertificateBound b.carrier W - let E := M.synchronizedEnumerationBound b.carrier W - let keyMap := Name.renameFamilyGraph s (a.iso g) N validN - let nodeMap := b.graph b (d.iso g) - let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap - let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums - let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums - let movedS := relationImage S b.carrier nodeMap - let movedA := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A - movedK ∈ M.sets ∧ movedEnums ∈ M.sets ∧ movedS ∈ M.sets ∧ - movedS ⊆ b.carrier ∧ M.groundEmbeddable movedS ZFSet.omega ∧ - PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) - b.carrier b.conditionOrder meetGraph N (M.niceVisibilityGraph a s b T d.principalFix) - (s.encode ⊤) ZFSet.omega - (M.storedPreparationRequests movedA (M.refinementLevelFormulaData a s b d level T T2 valid)) - C E movedK movedEnums ∧ - certificateUsedSupports b.carrier movedK = - relationImage (certificateUsedSupports b.carrier k) b.carrier nodeMap ∧ - certificateUsedSupports b.carrier movedK ⊆ movedS := by - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - let J := M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid) - let C := M.supportedEqualityCertificateBound b.carrier W - let E := M.synchronizedEnumerationBound b.carrier W - let keyMap := Name.renameFamilyGraph s (a.iso g) N validN - let nodeMap := b.graph b (d.iso g) - let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap - let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums - let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums - have hJ := M.storedPreparationRequests_mem pairing unions powers separation hA _ members - have requestBound : J ⊆ N := by - intro z hz - change z ∈ relationImage _ N _ ∪ relationImage _ N _ at hz - rcases ZFSet.mem_union.1 hz with left | right - · exact ((mem_relationImage _ N _ z).1 left).1 - · exact ((mem_relationImage _ N _ z).1 right).1 - have moved := M.preparedCertificateFamily_act_support a s t b d pairing unions powers separation - collection (members 7) (members 8) group (members 10) supports maps nodeMaps omega (members 6) valid closed - meetGraph meet hJ hW hk hEnums hS requestBound localBound supportNodes small p g family supportBound - have requests := M.storedPreparationRequests_structural_act a s b d level T T2 valid valid2 t - pairing unions powers separation collection members maps nodeMaps group (members 10) supports closed closed2 - hLevel hT2 function stored hA g - dsimp only at moved requests ⊢ - refine ⟨moved.1, moved.2.1, moved.2.2.1, moved.2.2.2.1, moved.2.2.2.2.1, - ?_, moved.2.2.2.2.2.2⟩ - exact (congrArg (fun domain => PreparedCertificateFamilyCode M s.carrier s.conditionOrder - (s.encode (a.iso g p)) b.carrier b.conditionOrder meetGraph N - (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega domain C E movedK movedEnums) - requests).mp moved.2.2.2.2.2.1 - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStoredStructuralRequestActions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def certificateUsedSupports (nodes k : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun v => ∃ z F B f, + ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B) nodes + +theorem mem_certificateUsedSupports (nodes k v : ZFSet.{u}) : + v ∈ certificateUsedSupports nodes k ↔ v ∈ nodes ∧ + ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B := + ZFSet.mem_sep + +noncomputable def preparationEventUsedSupports (nodes event : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun v => ∃ alpha r k enumerations, + event = ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) ∧ + ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ v ∈ B) nodes + +theorem preparationEventUsedSupports_active (nodes alpha r k enumerations : ZFSet.{u}) : + preparationEventUsedSupports nodes (ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations))) = + certificateUsedSupports nodes k := by + apply ZFSet.ext + intro v + rw [preparationEventUsedSupports, ZFSet.mem_sep, mem_certificateUsedSupports] + apply and_congr_right + intro _ + constructor + · rintro ⟨alpha', r', k', e', equal, data⟩ + have middle := (ZFSet.pair_inj.1 equal).2 + have last := (ZFSet.pair_inj.1 middle).2 + have same := (ZFSet.pair_inj.1 last).1 + exact same.symm ▸ data + · intro data + exact ⟨alpha, r, k, enumerations, rfl, data⟩ + +theorem preparationEventUsedSupports_idle (nodes : ZFSet.{u}) : + preparationEventUsedSupports nodes ∅ = ∅ := by + apply ZFSet.ext + intro v + rw [preparationEventUsedSupports, ZFSet.mem_sep] + constructor + · rintro ⟨_, alpha, r, k, enumerations, equal, _⟩ + have member : ({alpha} : ZFSet.{u}) ∈ + ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) := by + exact ZFSet.mem_insert _ _ + rw [← equal] at member + exact False.elim (ZFSet.notMem_empty _ member) + · intro member + exact False.elim (ZFSet.notMem_empty _ member) + +namespace BoundedFormula + +def certificateBasisMemberFormula {n} (v k : Fin n) : BoundedFormula n := + exGraphFields k (exPairFields 0 (exPairFields 0 (.mem v.succ.succ.succ.succ.succ.succ 1))) + +theorem truth_certificateBasisMemberFormula {n} (v k : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (certificateBasisMemberFormula v k) env ↔ + ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧ env v ∈ B := by + simp only [certificateBasisMemberFormula, truth_exGraphFields, truth_exPairFields, Truth] + change (∃ z c, ZFSet.pair z c ∈ env k ∧ ∃ F tail, c = ZFSet.pair F tail ∧ + ∃ B f, tail = ZFSet.pair B f ∧ env v ∈ B) ↔ _ + constructor + · rintro ⟨z, c, edge, F, tail, rfl, B, f, rfl, member⟩ + exact ⟨z, F, B, f, edge, member⟩ + · rintro ⟨z, F, B, f, edge, member⟩ + exact ⟨z, _, edge, F, _, rfl, B, f, rfl, member⟩ + +def preparationEventSupportFormula {n} (v event : Fin n) : BoundedFormula n := + exPairFields event (exPairFields 0 (exPairFields 0 + (certificateBasisMemberFormula v.succ.succ.succ.succ.succ.succ 1))) + +theorem truth_preparationEventSupportFormula {n} (v event : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (preparationEventSupportFormula v event) env ↔ + ∃ alpha r k enumerations, + env event = ZFSet.pair alpha (ZFSet.pair r (ZFSet.pair k enumerations)) ∧ + ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ env v ∈ B := by + simp only [preparationEventSupportFormula, truth_exPairFields, truth_certificateBasisMemberFormula] + change (∃ alpha output, env event = ZFSet.pair alpha output ∧ ∃ r tail, + output = ZFSet.pair r tail ∧ ∃ k enumerations, tail = ZFSet.pair k enumerations ∧ + ∃ z F B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ env v ∈ B) ↔ _ + constructor + · rintro ⟨alpha, output, equal, r, tail, rfl, k, enumerations, rfl, data⟩ + exact ⟨alpha, r, k, enumerations, equal, data⟩ + · rintro ⟨alpha, r, k, enumerations, equal, data⟩ + exact ⟨alpha, _, equal, r, _, rfl, k, enumerations, rfl, data⟩ + +end BoundedFormula + + + + + + +def preparationTupleCode (F B f e names : ZFSet.{u}) : ZFSet.{u} := + ZFSet.pair (ZFSet.pair F (ZFSet.pair B f)) (ZFSet.pair e names) + +private noncomputable def tupleImageWithOmega + (omega nodes N nodeMap nameMap F B f e names : ZFSet.{u}) : ZFSet.{u} := + preparationTupleCode (relationImage F nodes nodeMap) (relationImage B nodes nodeMap) + (relationCompose nodes B N (relationConverse B nodes nodeMap) + (relationCompose B N N f nameMap)) + (relationCompose omega B nodes e nodeMap) (relationCompose omega N N names nameMap) + +noncomputable def preparationTupleImage + (nodes N nodeMap nameMap F B f e names : ZFSet.{u}) : ZFSet.{u} := + tupleImageWithOmega ZFSet.omega nodes N nodeMap nameMap F B f e names + +noncomputable def preparationTupleActionGraph + (C E nodes N nodeMap nameMap : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ F B f e names, z = ZFSet.pair (preparationTupleCode F B f e names) + (preparationTupleImage nodes N nodeMap nameMap F B f e names)) + (ZFSet.prod (ZFSet.prod C E) (ZFSet.prod C E)) + +theorem pair_mem_preparationTupleActionGraph (C E nodes N nodeMap nameMap F B f e names y : ZFSet.{u}) : + ZFSet.pair (preparationTupleCode F B f e names) y ∈ + preparationTupleActionGraph C E nodes N nodeMap nameMap ↔ + preparationTupleCode F B f e names ∈ ZFSet.prod C E ∧ y ∈ ZFSet.prod C E ∧ + y = preparationTupleImage nodes N nodeMap nameMap F B f e names := by + rw [preparationTupleActionGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨bounds, F', B', f', e', names', equal⟩ + obtain ⟨keys, values⟩ := ZFSet.pair_inj.1 equal + have fields : F = F' ∧ B = B' ∧ f = f' ∧ e = e' ∧ names = names' := by + simpa only [preparationTupleCode, ZFSet.pair_inj, and_assoc] using keys + obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := fields + exact ⟨bounds.1, bounds.2, values⟩ + · rintro ⟨hx, hy, rfl⟩ + exact ⟨⟨hx, hy⟩, F, B, f, e, names, rfl⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +private noncomputable def pairDefinition : + GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => ZFSet.pair (env 0) (env 1)) where + formula := orderedPairFormula 0 1 2 + closed := fun _ h => M.orderedPair_mem pairing (h 0) (h 1) + correct := fun _ h _ hz => M.realize_orderedPairFormula pairing 0 1 2 _ hz (h 0) (h 1) + +private noncomputable def imageDefinition : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => relationImage (env 0) (env 1) (env 2)) where + formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula + closed := fun _ h => M.relationImage_mem separation (h 0) (h 1) (h 2) + correct := by + intro env h z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz h), + BoundedFormula.truth_relationImageEqualityFormula] + rfl + +private noncomputable def converseDefinition : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => relationConverse (env 0) (env 1) (env 2)) where + formula := exactSetFormula 0 (BoundedFormula.converseEntryFormula 0 2 3 4).toFormula + closed := fun _ h => M.relationConverse_mem pairing unions powers separation (h 0) (h 1) (h 2) + correct := by + intro env h z hz + apply M.realize_exactSetFormula 0 _ _ hz + (fun w hw => M.transitive + (M.relationConverse_mem pairing unions powers separation (h 0) (h 1) (h 2)) hw) + intro w hw + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz h)), + BoundedFormula.truth_converseEntryFormula, mem_relationConverse] + rfl + +private noncomputable def composeDefinition : + GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => + relationCompose (env 0) (env 1) (env 2) (env 3) (env 4)) where + formula := exactSetFormula 0 (BoundedFormula.composeEntryFormula 0 2 3 4 5 6).toFormula + closed := fun _ h => M.relationCompose_mem pairing unions powers separation (h 0) (h 1) (h 2) (h 3) (h 4) + correct := by + intro env h z hz + apply M.realize_exactSetFormula 0 _ _ hz + (fun w hw => M.transitive + (M.relationCompose_mem pairing unions powers separation (h 0) (h 1) (h 2) (h 3) (h 4)) hw) + intro w hw + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz h)), + BoundedFormula.truth_composeEntryFormula, mem_relationCompose] + rfl + +private noncomputable def actionPairDefinition : + GroundDefinableFunction M (fun env : Fin 10 → ZFSet.{u} => + ZFSet.pair (preparationTupleCode (env 0) (env 1) (env 2) (env 3) (env 4)) + (tupleImageWithOmega (env 9) (env 5) (env 6) (env 7) (env 8) + (env 0) (env 1) (env 2) (env 3) (env 4))) := by + let v := GroundSetTerm.var M (n := 10) + let pair (x y : GroundSetTerm M 10) := GroundSetTerm.app (pairDefinition M pairing) ![x,y] + let image (x : GroundSetTerm M 10) := GroundSetTerm.app (imageDefinition M separation) ![x,v 5,v 7] + let compose (x y z r f : GroundSetTerm M 10) := + GroundSetTerm.app (composeDefinition M pairing unions powers separation) ![x,y,z,r,f] + let inverse := GroundSetTerm.app (converseDefinition M pairing unions powers separation) ![v 1,v 5,v 7] + let movedF := compose (v 5) (v 1) (v 6) inverse (compose (v 1) (v 6) (v 6) (v 2) (v 8)) + let movedE := compose (v 9) (v 1) (v 5) (v 3) (v 7) + let movedNames := compose (v 9) (v 6) (v 6) (v 4) (v 8) + exact (pair (pair (pair (v 0) (pair (v 1) (v 2))) (pair (v 3) (v 4))) + (pair (pair (image (v 0)) (pair (image (v 1)) movedF)) (pair movedE movedNames))).definition + +include pairing unions powers separation in +theorem preparationTupleActionGraph_mem + {C E nodes N nodeMap nameMap : ZFSet.{u}} + (hC : C ∈ M.sets) (hE : E ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hN : N ∈ M.sets) (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + preparationTupleActionGraph C E nodes N nodeMap nameMap ∈ M.sets := by + let defined := actionPairDefinition M pairing unions powers separation + let slots : Fin 11 → Fin 11 := ![5,0,1,2,3,4,6,7,8,9,10] + let formula := exBlock 5 (SetFormula.reindex slots defined.formula) + let params : Fin 5 → ZFSet.{u} := ![nodes,N,nodeMap,nameMap,ZFSet.omega] + have paramsGround : ∀ j, params j ∈ M.sets := by + intro j + exact Fin.cases hNodes (Fin.cases hN (Fin.cases hNodeMap + (Fin.cases hNameMap (Fin.cases omega (fun k => Fin.elim0 k))))) j + have bound := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hC hE) + (M.prod_mem pairing unions powers separation hC hE) + have selected := M.separation_mem separation formula params paramsGround bound + have same : ZFSet.sep (fun z => Realize M.sets formula (extend z params)) + (ZFSet.prod (ZFSet.prod C E) (ZFSet.prod C E)) = + preparationTupleActionGraph C E nodes N nodeMap nameMap := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, preparationTupleActionGraph, ZFSet.mem_sep] + apply and_congr_right + intro hz + have zGround := M.transitive bound hz + rw [show formula = exBlock 5 (SetFormula.reindex slots defined.formula) from rfl, + realize_exBlock] + constructor + · rintro ⟨fields, grounds, meaning⟩ + rw [realize_reindex] at meaning + have values : (fun j => extendMany 5 fields (extend z params) (slots j)) = + extend z (extendMany 5 fields params) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j + rw [values] at meaning + have equal := (defined.correct (extendMany 5 fields params) + (extendMany_members 5 fields params grounds paramsGround) z zGround).1 meaning + exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, equal⟩ + · rintro ⟨F,B,f,e,names,equal⟩ + have inputGround : preparationTupleCode F B f e names ∈ M.sets := + M.pair_left (equal ▸ zGround) + have hF := M.pair_left (M.pair_left inputGround) + have hB := M.pair_left (M.pair_right (M.pair_left inputGround)) + have hf := M.pair_right (M.pair_right (M.pair_left inputGround)) + have he := M.pair_left (M.pair_right inputGround) + have hNames := M.pair_right (M.pair_right inputGround) + let fields : Fin 5 → ZFSet.{u} := ![F,B,f,e,names] + have grounds : ∀ j, fields j ∈ M.sets := by + intro j + exact Fin.cases hF (Fin.cases hB (Fin.cases hf + (Fin.cases he (Fin.cases hNames (fun k => Fin.elim0 k))))) j + refine ⟨fields,grounds,?_⟩ + rw [realize_reindex] + have values : (fun j => extendMany 5 fields (extend z params) (slots j)) = + extend z (extendMany 5 fields params) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))))) j + rw [values] + exact (defined.correct (extendMany 5 fields params) + (extendMany_members 5 fields params grounds paramsGround) z zGround).2 equal + exact same ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem preparationTupleImage_mem_bound + {nodes N W nodeMap nameMap F B f e names : ZFSet.{u}} + (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) + (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (localBound : N ⊆ W) + (nodeInjection : InjectionCode nodes nodes nodeMap) + (member : preparationTupleCode F B f e names ∈ ZFSet.prod + (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W)) : + preparationTupleImage nodes N nodeMap nameMap F B f e names ∈ ZFSet.prod + (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) := by + have parts := ZFSet.pair_mem_prod.1 member + obtain ⟨⟨hF,_⟩,⟨hB,Bsub,small⟩,hf,_⟩ := + (M.mem_supportedEqualityCertificateBound nodes W F B f).1 parts.1 + have enumParts := ZFSet.pair_mem_prod.1 parts.2 + have he := ((M.mem_groundRelations ZFSet.omega nodes e).1 enumParts.1).1 + have hNames := ((M.mem_groundRelations ZFSet.omega W names).1 enumParts.2).1 + have hImageF := M.relationImage_mem separation hF hNodes hNodeMap + have hImageB := M.relationImage_mem separation hB hNodes hNodeMap + have hMovedF := M.relationCompose_mem pairing unions powers separation hNodes hB hN + (M.relationConverse_mem pairing unions powers separation hB hNodes hNodeMap) + (M.relationCompose_mem pairing unions powers separation hB hN hN hf hNameMap) + have hMovedE := M.relationCompose_mem pairing unions powers separation omega hB hNodes he hNodeMap + have hMovedNames := M.relationCompose_mem pairing unions powers separation omega hN hN hNames hNameMap + change ZFSet.pair + (ZFSet.pair (relationImage F nodes nodeMap) (ZFSet.pair (relationImage B nodes nodeMap) + (relationCompose nodes B N (relationConverse B nodes nodeMap) (relationCompose B N N f nameMap)))) + (ZFSet.pair (relationCompose ZFSet.omega B nodes e nodeMap) + (relationCompose ZFSet.omega N N names nameMap)) ∈ _ + apply ZFSet.pair_mem_prod.2 + constructor + · apply (M.mem_supportedEqualityCertificateBound nodes W _ _ _).2 + refine ⟨⟨hImageF, fun _ h => ((mem_relationImage _ _ _ _).1 h).1⟩, + ⟨hImageB, fun _ h => ((mem_relationImage _ _ _ _).1 h).1, + M.groundEmbeddable_image pairing unions powers separation hB hNodes omega hNodeMap + nodeInjection Bsub small⟩, hMovedF, ?_⟩ + intro z hz + obtain ⟨v,hv,tau,ht,rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + exact ZFSet.pair_mem_prod.2 ⟨hv,localBound ht⟩ + · apply ZFSet.pair_mem_prod.2 + refine ⟨(M.mem_groundRelations ZFSet.omega nodes _).2 + ⟨hMovedE, fun _ h => (ZFSet.mem_sep.1 h).1⟩, + (M.mem_groundRelations ZFSet.omega W _).2 ⟨hMovedNames,?_⟩⟩ + intro z hz + obtain ⟨n,hn,tau,ht,rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + exact ZFSet.pair_mem_prod.2 ⟨hn,localBound ht⟩ + +theorem preparationTupleActionGraph_function + {nodes N W nodeMap nameMap : ZFSet.{u}} + (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) + (hNodeMap : nodeMap ∈ M.sets) (hNameMap : nameMap ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (localBound : N ⊆ W) + (nodeInjection : InjectionCode nodes nodes nodeMap) : + let D := ZFSet.prod (M.supportedEqualityCertificateBound nodes W) + (M.synchronizedEnumerationBound nodes W) + ZFSet.IsFunc D D (preparationTupleActionGraph + (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) + nodes N nodeMap nameMap) := by + dsimp only + refine ⟨fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩ + intro x hx + obtain ⟨cert,hcert,enm,henm,rfl⟩ := ZFSet.mem_prod.1 hx + obtain ⟨F,hF,rest,hrest,rfl⟩ := ZFSet.mem_prod.1 hcert + obtain ⟨B,hB,f,hf,rfl⟩ := ZFSet.mem_prod.1 hrest + obtain ⟨e,he,names,hnames,rfl⟩ := ZFSet.mem_prod.1 henm + have input : preparationTupleCode F B f e names ∈ ZFSet.prod + (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) := + ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hF,ZFSet.pair_mem_prod.2 ⟨hB,hf⟩⟩, + ZFSet.pair_mem_prod.2 ⟨he,hnames⟩⟩ + have output := M.preparationTupleImage_mem_bound pairing unions powers separation + hNodes hN hNodeMap hNameMap omega localBound nodeInjection input + refine ⟨preparationTupleImage nodes N nodeMap nameMap F B f e names, + (pair_mem_preparationTupleActionGraph _ _ _ _ _ _ _ _ _ _ _ _).2 ⟨input,output,rfl⟩, ?_⟩ + intro y hy + exact ((pair_mem_preparationTupleActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 hy).2.2 + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing +universe u +variable (M : TransitiveGround.{u}) +variable {nodes N W nodeMap nameMap J k enums : ZFSet.{u}} +local notation "C" => M.supportedEqualityCertificateBound nodes W +local notation "E" => M.synchronizedEnumerationBound nodes W +local notation "tuples" => preparationTupleActionGraph C E nodes N nodeMap nameMap +local notation "movedK" => preparationFamilyFirst J N C E nameMap tuples k enums +variable (nodeBound : nodeMap ⊆ ZFSet.prod nodes nodes) +variable (keys : InjectionCode N N nameMap) (sourceKeys : J ⊆ N) +variable (tupleFunction : ZFSet.IsFunc + (ZFSet.prod (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W)) + (ZFSet.prod (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W)) + (preparationTupleActionGraph (M.supportedEqualityCertificateBound nodes W) + (M.synchronizedEnumerationBound nodes W) nodes N nodeMap nameMap)) +variable (first : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) +variable (second : ZFSet.IsFunc J (M.synchronizedEnumerationBound nodes W) enums) +include nodeBound keys sourceKeys tupleFunction first second + +theorem preparationFamilyFirst_usedSupports_image : + certificateUsedSupports nodes movedK = + relationImage (certificateUsedSupports nodes k) nodes nodeMap := by + have functions := preparationFamilyImages_function keys tupleFunction first second + apply ZFSet.ext + intro v + constructor + · intro member + obtain ⟨hv, z, Fg, Bg, fg, cert, basis⟩ := (mem_certificateUsedSupports nodes movedK v).1 member + have hz := (ZFSet.pair_mem_prod.1 (functions.1.1 cert)).1 + obtain ⟨enm, enum, _⟩ := functions.2.2 z hz + obtain ⟨eg, _, namesg, _, rfl⟩ := ZFSet.mem_prod.1 + (ZFSet.pair_mem_prod.1 (functions.2.1 enum)).2 + obtain ⟨oldZ, oldC, oldE, oldCert, oldEnum, _key, tuple⟩ := + (preparationFamilyImages_entry keys tupleFunction first second z _ _).1 ⟨cert, enum⟩ + obtain ⟨F, _, tail, hTail, rfl⟩ := ZFSet.mem_prod.1 + (ZFSet.pair_mem_prod.1 (first.1 oldCert)).2 + obtain ⟨B, _, f, _, rfl⟩ := ZFSet.mem_prod.1 hTail + obtain ⟨e, _, names, _, rfl⟩ := ZFSet.mem_prod.1 + (ZFSet.pair_mem_prod.1 (second.1 oldEnum)).2 + have equal := ((pair_mem_preparationTupleActionGraph C E nodes N nodeMap nameMap + F B f e names _).1 tuple).2.2 + have basisEq : Bg = relationImage B nodes nodeMap := + (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).1).2).1 + obtain ⟨_, w, hw, edge⟩ := (mem_relationImage B nodes nodeMap v).1 (basisEq ▸ basis) + have hwNodes := (ZFSet.pair_mem_prod.1 (nodeBound edge)).1 + exact (mem_relationImage _ nodes nodeMap v).2 + ⟨hv, w, (mem_certificateUsedSupports nodes k w).2 + ⟨hwNodes, oldZ, F, B, f, oldCert, hw⟩, edge⟩ + · intro member + obtain ⟨hv, w, hw, edge⟩ := (mem_relationImage _ nodes nodeMap v).1 member + obtain ⟨_, z, F, B, f, cert, basis⟩ := (mem_certificateUsedSupports nodes k w).1 hw + have bounds := ZFSet.pair_mem_prod.1 (first.1 cert) + obtain ⟨enm, enum, _⟩ := second.2 z bounds.1 + have enumBound := (ZFSet.pair_mem_prod.1 (second.1 enum)).2 + obtain ⟨e, he, names, hn, rfl⟩ := ZFSet.mem_prod.1 enumBound + obtain ⟨zg, key, _⟩ := keys.function.2 z (sourceKeys bounds.1) + have input : preparationTupleCode F B f e names ∈ ZFSet.prod C E := + ZFSet.pair_mem_prod.2 ⟨bounds.2, ZFSet.pair_mem_prod.2 ⟨he, hn⟩⟩ + obtain ⟨value, tuple, _⟩ := tupleFunction.2 _ input + have equal := ((pair_mem_preparationTupleActionGraph C E nodes N nodeMap nameMap + F B f e names value).1 tuple).2.2 + rw [equal] at tuple + have moved := (preparationFamilyImages_entry keys tupleFunction first second zg + (ZFSet.pair (relationImage F nodes nodeMap) + (ZFSet.pair (relationImage B nodes nodeMap) + (relationCompose nodes B N (relationConverse B nodes nodeMap) + (relationCompose B N N f nameMap)))) + (ZFSet.pair (relationCompose ZFSet.omega B nodes e nodeMap) + (relationCompose ZFSet.omega N N names nameMap))).2 + ⟨z, _, _, cert, enum, key, tuple⟩ + exact (mem_certificateUsedSupports nodes movedK v).2 + ⟨hv, zg, _, _, _, moved.1, + (mem_relationImage B nodes nodeMap v).2 ⟨hv, w, basis, edge⟩⟩ + +theorem preparationFamilyFirst_usedSupports_subset {S : ZFSet.{u}} + (bound : certificateUsedSupports nodes k ⊆ S) : + certificateUsedSupports nodes movedK ⊆ relationImage S nodes nodeMap := by + rw [preparationFamilyFirst_usedSupports_image M nodeBound keys sourceKeys tupleFunction first second] + intro v member + obtain ⟨hv, w, hw, edge⟩ := (mem_relationImage _ nodes nodeMap v).1 member + exact (mem_relationImage S nodes nodeMap v).2 ⟨hv, w, bound hw, edge⟩ + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (omega : ZFSet.omega ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +include pairing unions powers separation collection carrier order group nodes supports maps nodeMaps omega hT valid closed + +theorem preparedCertificateFamily_act + (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) + {J W k enums : ZFSet.{u}} (hJ : J ∈ M.sets) (hW : W ∈ M.sets) + (hk : k ∈ M.sets) (hEnums : enums ∈ M.sets) + (requestBound : J ⊆ M.groundRelations T s.carrier) + (localBound : M.groundRelations T s.carrier ⊆ W) (p : P) (g : G) + (family : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) + b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega J + (M.supportedEqualityCertificateBound b.carrier W) (M.synchronizedEnumerationBound b.carrier W) k enums) : + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + let C := M.supportedEqualityCertificateBound b.carrier W + let E := M.synchronizedEnumerationBound b.carrier W + let keyMap := Name.renameFamilyGraph s (a.iso g) N validN + let nodeMap := b.graph b (d.iso g) + let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap + let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums + let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums + movedK ∈ M.sets ∧ movedEnums ∈ M.sets ∧ + PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) + b.carrier b.conditionOrder meetGraph N (M.niceVisibilityGraph a s b T d.principalFix) + (s.encode ⊤) ZFSet.omega (relationImage J N keyMap) C E movedK movedEnums := by + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + let C := M.supportedEqualityCertificateBound b.carrier W + let E := M.synchronizedEnumerationBound b.carrier W + let keyMap := Name.renameFamilyGraph s (a.iso g) N validN + let nodeMap := b.graph b (d.iso g) + let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap + have hN := M.groundRelations_mem pairing unions powers separation hT carrier + have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation nodes hW omega + have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation nodes hW omega + have keyGround := (M.groundRelations_nameAction_ground_function a s t pairing unions powers + separation collection carrier maps T closed hT valid g).1 + have keyInjection : InjectionCode N N keyMap := stageOneTermAction_injection a s N validN + (M.groundRelations_act_mem a s t pairing unions powers separation collection carrier maps T closed) g + have nodeGround := M.conditionMap_graph_mem d b t nodeMaps g + have nodeInjection := b.graph_injection b (d.iso g) (d.iso g).injective + have tupleGround := M.preparationTupleActionGraph_mem pairing unions powers separation hC hE nodes hN nodeGround keyGround omega + have tupleFunction := M.preparationTupleActionGraph_function pairing unions powers separation + nodes hN nodeGround keyGround omega localBound nodeInjection + have ground := M.preparationFamilyImages_mem pairing unions powers separation + hJ hN hC hE keyGround tupleGround hk hEnums + have functions := preparationFamilyImages_function keyInjection tupleFunction family.1 family.2.1 + dsimp only + refine ⟨ground.2.1, ground.2.2, functions.1, functions.2, ?_⟩ + intro x F' B' f' e' names' stored enumerated + obtain ⟨z, c, enm, oldK, oldE, keyEdge, tupleEdge⟩ := + (preparationFamilyImages_entry keyInjection tupleFunction family.1 family.2.1 + x (ZFSet.pair F' (ZFSet.pair B' f')) (ZFSet.pair e' names')).1 ⟨stored, enumerated⟩ + have zInJ := (ZFSet.pair_mem_prod.1 (family.1.1 oldK)).1 + have cBound := (ZFSet.pair_mem_prod.1 (family.1.1 oldK)).2 + have eBound := (ZFSet.pair_mem_prod.1 (family.2.1.1 oldE)).2 + obtain ⟨F, _, rest, restBound, rfl⟩ := ZFSet.mem_prod.1 cBound + obtain ⟨B, _, f, _, rfl⟩ := ZFSet.mem_prod.1 restBound + obtain ⟨e, _, names, _, rfl⟩ := ZFSet.mem_prod.1 eBound + let oldName : Name s := ⟨z, validN z (requestBound zInJ)⟩ + let old : (M.nameDomain s).names := ⟨oldName, ((M.mem_groundRelations T s.carrier z).1 (requestBound zInJ)).1⟩ + have keyEqual := ((Name.pair_mem_renameFamilyGraph s (a.iso g) N validN oldName x).1 keyEdge).2 + have moved := M.preparedCertificateCode_act a s t b d pairing unions powers separation collection + carrier order group nodes supports maps hT valid closed meetGraph meet old F B f e names p g + (family.2.2 z F B f e names oldK oldE) + have tupleEqual := ((pair_mem_preparationTupleActionGraph C E b.carrier N nodeMap keyMap + F B f e names (preparationTupleCode F' B' f' e' names')).1 tupleEdge).2.2 + have fields : F' = relationImage F b.carrier nodeMap ∧ + B' = relationImage B b.carrier nodeMap ∧ + f' = Name.actedRepresentativeGraph a s b d N validN g B f ∧ + e' = relationCompose ZFSet.omega B b.carrier e nodeMap ∧ + names' = Name.actedEnumerationGraph a s N validN g ZFSet.omega names := by + change ZFSet.pair (ZFSet.pair F' (ZFSet.pair B' f')) (ZFSet.pair e' names') = + ZFSet.pair (ZFSet.pair (relationImage F b.carrier nodeMap) + (ZFSet.pair (relationImage B b.carrier nodeMap) (Name.actedRepresentativeGraph a s b d N validN g B f))) + (ZFSet.pair (relationCompose ZFSet.omega B b.carrier e nodeMap) + (Name.actedEnumerationGraph a s N validN g ZFSet.omega names)) at tupleEqual + simpa only [ZFSet.pair_inj, and_assoc] using tupleEqual + obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := fields + rw [keyEqual] + exact moved + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (omega : ZFSet.omega ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +include pairing unions powers separation collection carrier order group nodes supports maps nodeMaps omega hT valid closed + +theorem preparedCertificateFamily_act_support + (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) + {J W k enums S : ZFSet.{u}} (hJ : J ∈ M.sets) (hW : W ∈ M.sets) + (hk : k ∈ M.sets) (hEnums : enums ∈ M.sets) (hS : S ∈ M.sets) + (requestBound : J ⊆ M.groundRelations T s.carrier) + (localBound : M.groundRelations T s.carrier ⊆ W) + (supportNodes : S ⊆ b.carrier) (small : M.groundEmbeddable S ZFSet.omega) + (p : P) (g : G) + (family : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) + b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega J + (M.supportedEqualityCertificateBound b.carrier W) (M.synchronizedEnumerationBound b.carrier W) k enums) + (supportBound : certificateUsedSupports b.carrier k ⊆ S) : + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + let C := M.supportedEqualityCertificateBound b.carrier W + let E := M.synchronizedEnumerationBound b.carrier W + let keyMap := Name.renameFamilyGraph s (a.iso g) N validN + let nodeMap := b.graph b (d.iso g) + let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap + let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums + let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums + let movedS := relationImage S b.carrier nodeMap + movedK ∈ M.sets ∧ movedEnums ∈ M.sets ∧ movedS ∈ M.sets ∧ + movedS ⊆ b.carrier ∧ M.groundEmbeddable movedS ZFSet.omega ∧ + PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) + b.carrier b.conditionOrder meetGraph N (M.niceVisibilityGraph a s b T d.principalFix) + (s.encode ⊤) ZFSet.omega (relationImage J N keyMap) C E movedK movedEnums ∧ + certificateUsedSupports b.carrier movedK = + relationImage (certificateUsedSupports b.carrier k) b.carrier nodeMap ∧ + certificateUsedSupports b.carrier movedK ⊆ movedS := by + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + let keyMap := Name.renameFamilyGraph s (a.iso g) N validN + have prepared := M.preparedCertificateFamily_act a s t b d pairing unions powers separation + collection carrier order group nodes supports maps nodeMaps omega hT valid closed + meetGraph meet hJ hW hk hEnums requestBound localBound p g family + have hN := M.groundRelations_mem pairing unions powers separation hT carrier + have keyGround := (M.groundRelations_nameAction_ground_function a s t pairing unions powers + separation collection carrier maps T closed hT valid g).1 + have keyInjection : InjectionCode N N keyMap := stageOneTermAction_injection a s N validN + (M.groundRelations_act_mem a s t pairing unions powers separation collection carrier maps T closed) g + have nodeGround := M.conditionMap_graph_mem d b t nodeMaps g + have nodeInjection := b.graph_injection b (d.iso g) (d.iso g).injective + have tupleFunction := M.preparationTupleActionGraph_function pairing unions powers separation + nodes hN nodeGround keyGround omega localBound nodeInjection + dsimp only + exact ⟨prepared.1, prepared.2.1, M.relationImage_mem separation hS nodes nodeGround, + fun v hv => ((mem_relationImage S b.carrier (b.graph b (d.iso g)) v).1 hv).1, + M.groundEmbeddable_image pairing unions powers separation hS nodes omega nodeGround + nodeInjection supportNodes small, prepared.2.2, + preparationFamilyFirst_usedSupports_image M nodeInjection.function.1 keyInjection requestBound + tupleFunction family.1 family.2.1, + preparationFamilyFirst_usedSupports_subset M nodeInjection.function.1 keyInjection requestBound + tupleFunction family.1 family.2.1 supportBound⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (group : t.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (omega : ZFSet.omega ∈ M.sets) +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) +include pairing unions powers separation collection members maps nodeMaps group supports omega closed closed2 valid2 + +theorem storedPreparationFamily_structural_act_support + (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) {stages history : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level + (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t)) ∈ history) + (meetGraph : ZFSet.{u}) (meet : MeetOrderCode b.carrier b.conditionOrder meetGraph) + {A W k enums S : ZFSet.{u}} (hA : A ∈ M.sets) (hW : W ∈ M.sets) + (hk : k ∈ M.sets) (hEnums : enums ∈ M.sets) (hS : S ∈ M.sets) + (localBound : M.groundRelations T s.carrier ⊆ W) + (supportNodes : S ⊆ b.carrier) (small : M.groundEmbeddable S ZFSet.omega) + (p : P) (g : G) + (family : PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) + b.carrier b.conditionOrder meetGraph (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega + (M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid)) + (M.supportedEqualityCertificateBound b.carrier W) (M.synchronizedEnumerationBound b.carrier W) k enums) + (supportBound : certificateUsedSupports b.carrier k ⊆ S) : + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + let J := M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid) + let C := M.supportedEqualityCertificateBound b.carrier W + let E := M.synchronizedEnumerationBound b.carrier W + let keyMap := Name.renameFamilyGraph s (a.iso g) N validN + let nodeMap := b.graph b (d.iso g) + let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap + let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums + let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums + let movedS := relationImage S b.carrier nodeMap + let movedA := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A + movedK ∈ M.sets ∧ movedEnums ∈ M.sets ∧ movedS ∈ M.sets ∧ + movedS ⊆ b.carrier ∧ M.groundEmbeddable movedS ZFSet.omega ∧ + PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode (a.iso g p)) + b.carrier b.conditionOrder meetGraph N (M.niceVisibilityGraph a s b T d.principalFix) + (s.encode ⊤) ZFSet.omega + (M.storedPreparationRequests movedA (M.refinementLevelFormulaData a s b d level T T2 valid)) + C E movedK movedEnums ∧ + certificateUsedSupports b.carrier movedK = + relationImage (certificateUsedSupports b.carrier k) b.carrier nodeMap ∧ + certificateUsedSupports b.carrier movedK ⊆ movedS := by + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + let J := M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid) + let C := M.supportedEqualityCertificateBound b.carrier W + let E := M.synchronizedEnumerationBound b.carrier W + let keyMap := Name.renameFamilyGraph s (a.iso g) N validN + let nodeMap := b.graph b (d.iso g) + let tupleMap := preparationTupleActionGraph C E b.carrier N nodeMap keyMap + let movedK := preparationFamilyFirst J N C E keyMap tupleMap k enums + let movedEnums := preparationFamilySecond J N C E keyMap tupleMap k enums + have hJ := M.storedPreparationRequests_mem pairing unions powers separation hA _ members + have requestBound : J ⊆ N := by + intro z hz + change z ∈ relationImage _ N _ ∪ relationImage _ N _ at hz + rcases ZFSet.mem_union.1 hz with left | right + · exact ((mem_relationImage _ N _ z).1 left).1 + · exact ((mem_relationImage _ N _ z).1 right).1 + have moved := M.preparedCertificateFamily_act_support a s t b d pairing unions powers separation + collection (members 7) (members 8) group (members 10) supports maps nodeMaps omega (members 6) valid closed + meetGraph meet hJ hW hk hEnums hS requestBound localBound supportNodes small p g family supportBound + have requests := M.storedPreparationRequests_structural_act a s b d level T T2 valid valid2 t + pairing unions powers separation collection members maps nodeMaps group (members 10) supports closed closed2 + hLevel hT2 function stored hA g + dsimp only at moved requests ⊢ + refine ⟨moved.1, moved.2.1, moved.2.2.1, moved.2.2.2.1, moved.2.2.2.2.1, + ?_, moved.2.2.2.2.2.2⟩ + exact (congrArg (fun domain => PreparedCertificateFamilyCode M s.carrier s.conditionOrder + (s.encode (a.iso g p)) b.carrier b.conditionOrder meetGraph N + (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) ZFSet.omega domain C E movedK movedEnums) + requests).mp moved.2.2.2.2.2.1 + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredStructuralRequestActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredStructuralRequestActions.lean index 040f7a44e417e0e3291e1cd5fffdbf9cd6406ecc..4311c588505ddc48b37c2feabc3b3f2b608a2d36 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredStructuralRequestActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStoredStructuralRequestActions.lean @@ -1,398 +1,398 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.StructuralPreparationSourceImages - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) -variable (T : ZFSet.{u}) -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -include pairing unions powers separation collection carrier maps closed - -theorem groundRelations_act_mem (g : G) (z : Name s) - (member : z.val ∈ M.groundRelations T s.carrier) : - (a.act s g z).val ∈ M.groundRelations T s.carrier := by - obtain ⟨ground, subset⟩ := (M.mem_groundRelations T s.carrier z.val).1 member - refine (M.mem_groundRelations T s.carrier _).2 - ⟨M.act_mem s a t pairing unions powers separation collection carrier maps g z ground, ?_⟩ - intro x hx - obtain ⟨sigma, q, rfl⟩ := Name.entries_cover (a.act s g z) hx - obtain ⟨tau, p, entry, moved, _condition⟩ := - (Name.entry_rename s (a.iso g) z sigma q).1 hx - have child := closed g tau (ZFSet.pair_mem_prod.1 (subset entry)).1 - have same : a.act s g tau = sigma := moved - exact ZFSet.pair_mem_prod.2 ⟨same ▸ child, s.encode_mem q⟩ - -theorem groundRelations_nameAction_ground_function - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) (g : G) : - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - Name.renameFamilyGraph s (a.iso g) N validN ∈ M.sets ∧ - ZFSet.IsFunc N N (Name.renameFamilyGraph s (a.iso g) N validN) := by - dsimp only - refine ⟨M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier - (a.iso g) (M.conditionMap_graph_mem a s t maps g) _ - (M.groundRelations_mem pairing unions powers separation hT carrier) _, ?_⟩ - exact Name.renameFamilyGraph_act_function a s _ _ g - (M.groundRelations_act_mem a s t pairing unions powers separation collection carrier maps T closed g) - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) -include pairing unions powers separation collection members valid2 - -theorem niceAssignmentClassGraphs_function {A : ZFSet.{u}} (hA : A ∈ M.sets) - (shape : A ⊆ stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T) - (side : Fin 2) : - ZFSet.IsFunc A (M.groundRelations T s.carrier) - (M.niceAssignmentClassGraphs a s b d level T T2 valid A side) := by - refine ⟨?_, ?_⟩ - · intro z hz - unfold niceAssignmentClassGraphs assignmentClassGraph at hz - exact (ZFSet.mem_sep.1 hz).1 - · intro x hx - obtain ⟨i, hi, rawU, hu, rawW, hw, rfl⟩ := - (mem_stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T x).1 (shape hx) - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi - let u : Name s := ⟨rawU, valid rawU hu⟩ - let w : Name s := ⟨rawW, valid rawW hw⟩ - let R : Name s := Fin.cases Rc.val (fun _ => Rf.val) side - let v : Name s := Fin.cases u (fun _ => w) side - let z := Name.refinementClass T valid R v - have lookup := M.niceAssignmentClassGraphs_entry a s b d level T T2 valid - pairing unions powers separation collection members hA C E U Rf Rc hi u w hu hw hx side - exact ⟨z.val, (lookup z.val).2 rfl, fun y edge => (lookup y).1 edge⟩ - -variable (t : Presentation G) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) -include maps closed closed2 - -theorem niceAssignmentClassGraphs_act_entry - {A : ZFSet.{u}} (hA : A ∈ M.sets) (g : G) - (hImage : M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ∈ M.sets) - (C E : L) (U Rf Rc : (M.nameDomain s).names) - (idx : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) - (u w : Name s) (hu : u.val ∈ T) (hw : w.val ∈ T) - (member : stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val w.val ∈ A) (side : Fin 2) (z : Name s) : - ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) - (a.act s g u).val (a.act s g w).val) (a.act s g z).val ∈ - M.niceAssignmentClassGraphs a s b d level T T2 valid - (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) side ↔ - ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val w.val) z.val ∈ M.niceAssignmentClassGraphs a s b d level T T2 valid A side := by - have carrier : s.carrier ∈ M.sets := members 7 - have order : s.conditionOrder ∈ M.sets := members 8 - have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid - let move (v : (M.nameDomain s).names) : (M.nameDomain s).names := - ⟨a.act s g v.val, M.act_mem s a t pairing unions powers separation collection carrier maps g v.val v.property⟩ - have movedIdx := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation - collection carrier order maps level T T2 valid closed closed2 family g C E U Rf Rc).2 idx - have movedMember := (M.refinementAssignmentImage_entry a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 family - g C E U Rf Rc u w idx hu hw A).2 member - have oldEntry := M.niceAssignmentClassGraphs_entry a s b d level T T2 valid - pairing unions powers separation collection members hA C E U Rf Rc idx u w hu hw member side z.val - have newEntry := M.niceAssignmentClassGraphs_entry a s b d level T T2 valid - pairing unions powers separation collection members hImage (d.iso g C) (d.iso g E) - (move U) (move Rf) (move Rc) movedIdx (a.act s g u) (a.act s g w) - (closed g u hu) (closed g w hw) movedMember side (a.act s g z).val - rw [newEntry, oldEntry] - have equivariant : - a.act s g (Name.refinementClass T valid - (Fin.cases (motive := fun _ => Name s) Rc.val (fun _ => Rf.val) side) - (Fin.cases (motive := fun _ => Name s) u (fun _ => w) side)) = - Name.refinementClass T valid - (Fin.cases (motive := fun _ => Name s) (move Rc).val (fun _ => (move Rf).val) side) - (Fin.cases (motive := fun _ => Name s) (a.act s g u) (fun _ => a.act s g w) side) := by - refine Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)) side - · exact Name.act_refinementClass a T valid closed g Rc.val u - · exact Name.act_refinementClass a T valid closed g Rf.val w - rw [← equivariant] - constructor - · intro equal - exact congrArg Subtype.val ((a.nameEquiv s g).injective (Subtype.ext equal)) - · intro equal - exact congrArg (fun v : Name s => (a.act s g v).val) (Subtype.ext equal) - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) -include pairing unions powers separation collection members maps nodeMaps closed closed2 - -theorem niceAssignmentClassImage_act (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) - {A : ZFSet.{u}} (hA : A ∈ M.sets) - (shape : A ⊆ stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T) - (g : G) (side : Fin 2) : - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - relationImage - (relationImage A N (M.niceAssignmentClassGraphs a s b d level T T2 valid A side)) N - (Name.renameFamilyGraph s (a.iso g) N validN) = - relationImage (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) N - (M.niceAssignmentClassGraphs a s b d level T T2 valid - (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) side) := by - dsimp only - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - have carrier : s.carrier ∈ M.sets := members 7 - have order : s.conditionOrder ∈ M.sets := members 8 - have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid - have hGraph := M.refinementAssignmentActionGraph_mem a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier maps nodeMaps hLevel (members 6) hT2 (members 0) g - have hImage := M.relationImage_mem separation hA - (M.stageOneAssignments_mem pairing unions powers separation (members 0) (members 6)) hGraph - have action := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 family g - have source := M.niceAssignmentClassGraphs_function a s b d level T T2 valid valid2 - pairing unions powers separation collection members hA shape side - have moved := M.niceAssignmentClassGraphs_function a s b d level T T2 valid valid2 - pairing unions powers separation collection members hImage - (M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A) side - have names := M.groundRelations_nameAction_ground_function a s t - pairing unions powers separation collection carrier maps T closed (members 6) valid g - refine relationImage_commuting_square source moved ?_ names.2 ?_ - · intro x hx - obtain ⟨y, edge, _⟩ := action.2 x (shape hx) - exact ⟨y, (ZFSet.pair_mem_prod.1 (action.1 edge)).2, edge⟩ - · intro x hx y x' y' requested acted renamed - have hy : y ∈ N := (ZFSet.pair_mem_prod.1 (source.1 requested)).2 - let z : Name s := ⟨y, validN y hy⟩ - have movedY : y' = (a.act s g z).val := - ((Name.pair_mem_renameFamilyGraph s (a.iso g) N validN z y').1 renamed).2 - obtain ⟨i, hi, rawU, hu, rawW, hw, rfl⟩ := - (mem_stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T x).1 (shape hx) - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi - let u : Name s := ⟨rawU, valid rawU hu⟩ - let w : Name s := ⟨rawW, valid rawW hw⟩ - have movedX := (M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 family - g C E U Rf Rc u w hi hu hw x').1 acted - rw [movedX, movedY] - exact (M.niceAssignmentClassGraphs_act_entry a s b d level T T2 valid valid2 - pairing unions powers separation collection members t maps closed closed2 - hA g hImage C E U Rf Rc hi u w hu hw hx side z).2 requested - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) -include pairing unions powers separation collection members maps nodeMaps closed closed2 - -theorem storedPreparationRequests_act (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) - {A : ZFSet.{u}} (hA : A ∈ M.sets) (g : G) : - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - relationImage - (M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid)) N - (Name.renameFamilyGraph s (a.iso g) N validN) = - M.storedPreparationRequests (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) - (M.refinementLevelFormulaData a s b d level T T2 valid) := by - dsimp only - let I := M.niceRefinementIndices a s b d level T T2 valid - let selected := assignmentOnIndices I T A - have selectedGround : selected ∈ M.sets := M.assignmentOnIndices_mem pairing unions powers separation - (members 0) (members 6) hA - have selectedShape : selected ⊆ stageOneAssignments I T := - fun z hz => ((mem_assignmentOnIndices I T A z).1 hz).2 - have selectedImage : assignmentOnIndices I T - (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) = - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by - apply ZFSet.ext - intro z - rw [mem_assignmentOnIndices] - exact and_iff_left_of_imp - (fun hz => M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A hz) - have carrier : s.carrier ∈ M.sets := members 7 - have order : s.conditionOrder ∈ M.sets := members 8 - have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid - have action := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 family g - have imageSelected : M.refinementAssignmentImage a s b d level T T2 valid valid2 g selected = - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := - (relationImage_source_selection action A).symm - have first := M.niceAssignmentClassImage_act a s b d level T T2 valid valid2 t - pairing unions powers separation collection members maps nodeMaps closed closed2 - hLevel hT2 selectedGround selectedShape g 0 - have second := M.niceAssignmentClassImage_act a s b d level T T2 valid valid2 t - pairing unions powers separation collection members maps nodeMaps closed closed2 - hLevel hT2 selectedGround selectedShape g 1 - dsimp only at first second - rw [imageSelected] at first second - rw [M.storedPreparationRequests_typed, M.storedPreparationRequests_typed] - dsimp only - rw [selectedImage, relationImage_source_union] - exact congrArg₂ (fun left right : ZFSet.{u} => left ∪ right) first second - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) -include pairing unions powers separation collection members maps nodeMaps group nodes supports closed closed2 valid2 - -theorem structuralAssignmentImage_selection_eq_refinement - (hLevel : level ∈ M.sets) {stages history : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level - (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t)) ∈ history) - (A : ZFSet.{u}) (g : G) : - assignmentOnIndices (M.niceRefinementIndices a s b d level T T2 valid) T - (M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A) = - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by - let I := M.niceRefinementIndices a s b d level T T2 valid - let selected := assignmentOnIndices I T A - have carrier : s.carrier ∈ M.sets := members 7 - have order : s.conditionOrder ∈ M.sets := members 8 - have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid - have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports maps level T T2 valid valid2 - have graphEq := M.rawStageRefinementAssignmentActionGraph_eq a s t b d - pairing unions powers separation collection carrier group nodes order maps nodeMaps supports - level T T2 hLevel (members 6) valid valid2 closed closed2 family (members 0) g - have selectedEq := M.structuralAssignmentImage_select_branch t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 function stored (t.encode g) A - dsimp only at selectedEq - rw [dataEq] at selectedEq - have selectedShape : selected ⊆ stageOneAssignments - (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by - rw [dataEq] - exact fun z hz => ((mem_assignmentOnIndices I T A z).1 hz).2 - have branchEq := M.structuralAssignmentImage_branch t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 function (t.encode_mem g) stored selectedShape - rw [dataEq, graphEq] at branchEq - have action := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 family g - exact selectedEq.trans (branchEq.trans (relationImage_source_selection action A).symm) - -theorem storedPreparationRequests_structural_act - (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) {stages history : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level - (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t)) ∈ history) - {A : ZFSet.{u}} (hA : A ∈ M.sets) (g : G) : - let N := M.groundRelations T s.carrier - let validN : ∀ z ∈ N, IsName s z := fun z hz => - Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 - relationImage - (M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid)) N - (Name.renameFamilyGraph s (a.iso g) N validN) = - M.storedPreparationRequests - (M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A) - (M.refinementLevelFormulaData a s b d level T T2 valid) := by - dsimp only - have selection := M.structuralAssignmentImage_selection_eq_refinement a s b d level T T2 valid valid2 t - pairing unions powers separation collection members maps nodeMaps group nodes supports closed closed2 - hLevel function stored A g - have localSelection : assignmentOnIndices (M.niceRefinementIndices a s b d level T T2 valid) T - (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) = - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by - apply ZFSet.ext - intro z - rw [mem_assignmentOnIndices] - exact and_iff_left_of_imp - (fun hz => M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A hz) - have requests := M.storedPreparationRequests_act a s b d level T T2 valid valid2 t - pairing unions powers separation collection members maps nodeMaps closed closed2 hLevel hT2 hA g - refine requests.trans ?_ - rw [M.storedPreparationRequests_typed, M.storedPreparationRequests_typed] - dsimp only - rw [selection, localSelection] - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.StructuralPreparationSourceImages + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) +variable (T : ZFSet.{u}) +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +include pairing unions powers separation collection carrier maps closed + +theorem groundRelations_act_mem (g : G) (z : Name s) + (member : z.val ∈ M.groundRelations T s.carrier) : + (a.act s g z).val ∈ M.groundRelations T s.carrier := by + obtain ⟨ground, subset⟩ := (M.mem_groundRelations T s.carrier z.val).1 member + refine (M.mem_groundRelations T s.carrier _).2 + ⟨M.act_mem s a t pairing unions powers separation collection carrier maps g z ground, ?_⟩ + intro x hx + obtain ⟨sigma, q, rfl⟩ := Name.entries_cover (a.act s g z) hx + obtain ⟨tau, p, entry, moved, _condition⟩ := + (Name.entry_rename s (a.iso g) z sigma q).1 hx + have child := closed g tau (ZFSet.pair_mem_prod.1 (subset entry)).1 + have same : a.act s g tau = sigma := moved + exact ZFSet.pair_mem_prod.2 ⟨same ▸ child, s.encode_mem q⟩ + +theorem groundRelations_nameAction_ground_function + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) (g : G) : + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + Name.renameFamilyGraph s (a.iso g) N validN ∈ M.sets ∧ + ZFSet.IsFunc N N (Name.renameFamilyGraph s (a.iso g) N validN) := by + dsimp only + refine ⟨M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier + (a.iso g) (M.conditionMap_graph_mem a s t maps g) _ + (M.groundRelations_mem pairing unions powers separation hT carrier) _, ?_⟩ + exact Name.renameFamilyGraph_act_function a s _ _ g + (M.groundRelations_act_mem a s t pairing unions powers separation collection carrier maps T closed g) + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) +include pairing unions powers separation collection members valid2 + +theorem niceAssignmentClassGraphs_function {A : ZFSet.{u}} (hA : A ∈ M.sets) + (shape : A ⊆ stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T) + (side : Fin 2) : + ZFSet.IsFunc A (M.groundRelations T s.carrier) + (M.niceAssignmentClassGraphs a s b d level T T2 valid A side) := by + refine ⟨?_, ?_⟩ + · intro z hz + unfold niceAssignmentClassGraphs assignmentClassGraph at hz + exact (ZFSet.mem_sep.1 hz).1 + · intro x hx + obtain ⟨i, hi, rawU, hu, rawW, hw, rfl⟩ := + (mem_stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T x).1 (shape hx) + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi + let u : Name s := ⟨rawU, valid rawU hu⟩ + let w : Name s := ⟨rawW, valid rawW hw⟩ + let R : Name s := Fin.cases Rc.val (fun _ => Rf.val) side + let v : Name s := Fin.cases u (fun _ => w) side + let z := Name.refinementClass T valid R v + have lookup := M.niceAssignmentClassGraphs_entry a s b d level T T2 valid + pairing unions powers separation collection members hA C E U Rf Rc hi u w hu hw hx side + exact ⟨z.val, (lookup z.val).2 rfl, fun y edge => (lookup y).1 edge⟩ + +variable (t : Presentation G) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) +include maps closed closed2 + +theorem niceAssignmentClassGraphs_act_entry + {A : ZFSet.{u}} (hA : A ∈ M.sets) (g : G) + (hImage : M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ∈ M.sets) + (C E : L) (U Rf Rc : (M.nameDomain s).names) + (idx : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) + (u w : Name s) (hu : u.val ∈ T) (hw : w.val ∈ T) + (member : stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val w.val ∈ A) (side : Fin 2) (z : Name s) : + ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) + (a.act s g u).val (a.act s g w).val) (a.act s g z).val ∈ + M.niceAssignmentClassGraphs a s b d level T T2 valid + (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) side ↔ + ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val w.val) z.val ∈ M.niceAssignmentClassGraphs a s b d level T T2 valid A side := by + have carrier : s.carrier ∈ M.sets := members 7 + have order : s.conditionOrder ∈ M.sets := members 8 + have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid + let move (v : (M.nameDomain s).names) : (M.nameDomain s).names := + ⟨a.act s g v.val, M.act_mem s a t pairing unions powers separation collection carrier maps g v.val v.property⟩ + have movedIdx := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation + collection carrier order maps level T T2 valid closed closed2 family g C E U Rf Rc).2 idx + have movedMember := (M.refinementAssignmentImage_entry a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 family + g C E U Rf Rc u w idx hu hw A).2 member + have oldEntry := M.niceAssignmentClassGraphs_entry a s b d level T T2 valid + pairing unions powers separation collection members hA C E U Rf Rc idx u w hu hw member side z.val + have newEntry := M.niceAssignmentClassGraphs_entry a s b d level T T2 valid + pairing unions powers separation collection members hImage (d.iso g C) (d.iso g E) + (move U) (move Rf) (move Rc) movedIdx (a.act s g u) (a.act s g w) + (closed g u hu) (closed g w hw) movedMember side (a.act s g z).val + rw [newEntry, oldEntry] + have equivariant : + a.act s g (Name.refinementClass T valid + (Fin.cases (motive := fun _ => Name s) Rc.val (fun _ => Rf.val) side) + (Fin.cases (motive := fun _ => Name s) u (fun _ => w) side)) = + Name.refinementClass T valid + (Fin.cases (motive := fun _ => Name s) (move Rc).val (fun _ => (move Rf).val) side) + (Fin.cases (motive := fun _ => Name s) (a.act s g u) (fun _ => a.act s g w) side) := by + refine Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)) side + · exact Name.act_refinementClass a T valid closed g Rc.val u + · exact Name.act_refinementClass a T valid closed g Rf.val w + rw [← equivariant] + constructor + · intro equal + exact congrArg Subtype.val ((a.nameEquiv s g).injective (Subtype.ext equal)) + · intro equal + exact congrArg (fun v : Name s => (a.act s g v).val) (Subtype.ext equal) + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) +include pairing unions powers separation collection members maps nodeMaps closed closed2 + +theorem niceAssignmentClassImage_act (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) + {A : ZFSet.{u}} (hA : A ∈ M.sets) + (shape : A ⊆ stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T) + (g : G) (side : Fin 2) : + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + relationImage + (relationImage A N (M.niceAssignmentClassGraphs a s b d level T T2 valid A side)) N + (Name.renameFamilyGraph s (a.iso g) N validN) = + relationImage (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) N + (M.niceAssignmentClassGraphs a s b d level T T2 valid + (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) side) := by + dsimp only + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + have carrier : s.carrier ∈ M.sets := members 7 + have order : s.conditionOrder ∈ M.sets := members 8 + have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid + have hGraph := M.refinementAssignmentActionGraph_mem a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier maps nodeMaps hLevel (members 6) hT2 (members 0) g + have hImage := M.relationImage_mem separation hA + (M.stageOneAssignments_mem pairing unions powers separation (members 0) (members 6)) hGraph + have action := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 family g + have source := M.niceAssignmentClassGraphs_function a s b d level T T2 valid valid2 + pairing unions powers separation collection members hA shape side + have moved := M.niceAssignmentClassGraphs_function a s b d level T T2 valid valid2 + pairing unions powers separation collection members hImage + (M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A) side + have names := M.groundRelations_nameAction_ground_function a s t + pairing unions powers separation collection carrier maps T closed (members 6) valid g + refine relationImage_commuting_square source moved ?_ names.2 ?_ + · intro x hx + obtain ⟨y, edge, _⟩ := action.2 x (shape hx) + exact ⟨y, (ZFSet.pair_mem_prod.1 (action.1 edge)).2, edge⟩ + · intro x hx y x' y' requested acted renamed + have hy : y ∈ N := (ZFSet.pair_mem_prod.1 (source.1 requested)).2 + let z : Name s := ⟨y, validN y hy⟩ + have movedY : y' = (a.act s g z).val := + ((Name.pair_mem_renameFamilyGraph s (a.iso g) N validN z y').1 renamed).2 + obtain ⟨i, hi, rawU, hu, rawW, hw, rfl⟩ := + (mem_stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T x).1 (shape hx) + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi + let u : Name s := ⟨rawU, valid rawU hu⟩ + let w : Name s := ⟨rawW, valid rawW hw⟩ + have movedX := (M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 family + g C E U Rf Rc u w hi hu hw x').1 acted + rw [movedX, movedY] + exact (M.niceAssignmentClassGraphs_act_entry a s b d level T T2 valid valid2 + pairing unions powers separation collection members t maps closed closed2 + hA g hImage C E U Rf Rc hi u w hu hw hx side z).2 requested + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) +include pairing unions powers separation collection members maps nodeMaps closed closed2 + +theorem storedPreparationRequests_act (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) + {A : ZFSet.{u}} (hA : A ∈ M.sets) (g : G) : + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + relationImage + (M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid)) N + (Name.renameFamilyGraph s (a.iso g) N validN) = + M.storedPreparationRequests (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) + (M.refinementLevelFormulaData a s b d level T T2 valid) := by + dsimp only + let I := M.niceRefinementIndices a s b d level T T2 valid + let selected := assignmentOnIndices I T A + have selectedGround : selected ∈ M.sets := M.assignmentOnIndices_mem pairing unions powers separation + (members 0) (members 6) hA + have selectedShape : selected ⊆ stageOneAssignments I T := + fun z hz => ((mem_assignmentOnIndices I T A z).1 hz).2 + have selectedImage : assignmentOnIndices I T + (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) = + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by + apply ZFSet.ext + intro z + rw [mem_assignmentOnIndices] + exact and_iff_left_of_imp + (fun hz => M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A hz) + have carrier : s.carrier ∈ M.sets := members 7 + have order : s.conditionOrder ∈ M.sets := members 8 + have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid + have action := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 family g + have imageSelected : M.refinementAssignmentImage a s b d level T T2 valid valid2 g selected = + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := + (relationImage_source_selection action A).symm + have first := M.niceAssignmentClassImage_act a s b d level T T2 valid valid2 t + pairing unions powers separation collection members maps nodeMaps closed closed2 + hLevel hT2 selectedGround selectedShape g 0 + have second := M.niceAssignmentClassImage_act a s b d level T T2 valid valid2 t + pairing unions powers separation collection members maps nodeMaps closed closed2 + hLevel hT2 selectedGround selectedShape g 1 + dsimp only at first second + rw [imageSelected] at first second + rw [M.storedPreparationRequests_typed, M.storedPreparationRequests_typed] + dsimp only + rw [selectedImage, relationImage_source_union] + exact congrArg₂ (fun left right : ZFSet.{u} => left ∪ right) first second + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +variable (closed2 : ∀ g (z : Name s), z.val ∈ T2 → (a.act s g z).val ∈ T2) +include pairing unions powers separation collection members maps nodeMaps group nodes supports closed closed2 valid2 + +theorem structuralAssignmentImage_selection_eq_refinement + (hLevel : level ∈ M.sets) {stages history : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level + (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t)) ∈ history) + (A : ZFSet.{u}) (g : G) : + assignmentOnIndices (M.niceRefinementIndices a s b d level T T2 valid) T + (M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A) = + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by + let I := M.niceRefinementIndices a s b d level T T2 valid + let selected := assignmentOnIndices I T A + have carrier : s.carrier ∈ M.sets := members 7 + have order : s.conditionOrder ∈ M.sets := members 8 + have family := M.familySet_mem s ⊤ pairing unions powers separation (members 6) (members 9) valid + have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports maps level T T2 valid valid2 + have graphEq := M.rawStageRefinementAssignmentActionGraph_eq a s t b d + pairing unions powers separation collection carrier group nodes order maps nodeMaps supports + level T T2 hLevel (members 6) valid valid2 closed closed2 family (members 0) g + have selectedEq := M.structuralAssignmentImage_select_branch t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 function stored (t.encode g) A + dsimp only at selectedEq + rw [dataEq] at selectedEq + have selectedShape : selected ⊆ stageOneAssignments + (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by + rw [dataEq] + exact fun z hz => ((mem_assignmentOnIndices I T A z).1 hz).2 + have branchEq := M.structuralAssignmentImage_branch t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 function (t.encode_mem g) stored selectedShape + rw [dataEq, graphEq] at branchEq + have action := M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 family g + exact selectedEq.trans (branchEq.trans (relationImage_source_selection action A).symm) + +theorem storedPreparationRequests_structural_act + (hLevel : level ∈ M.sets) (hT2 : T2 ∈ M.sets) {stages history : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level + (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t)) ∈ history) + {A : ZFSet.{u}} (hA : A ∈ M.sets) (g : G) : + let N := M.groundRelations T s.carrier + let validN : ∀ z ∈ N, IsName s z := fun z hz => + Name.isName_of_subset valid ((M.mem_groundRelations T s.carrier z).1 hz).2 + relationImage + (M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid)) N + (Name.renameFamilyGraph s (a.iso g) N validN) = + M.storedPreparationRequests + (M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A) + (M.refinementLevelFormulaData a s b d level T T2 valid) := by + dsimp only + have selection := M.structuralAssignmentImage_selection_eq_refinement a s b d level T T2 valid valid2 t + pairing unions powers separation collection members maps nodeMaps group nodes supports closed closed2 + hLevel function stored A g + have localSelection : assignmentOnIndices (M.niceRefinementIndices a s b d level T T2 valid) T + (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) = + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A := by + apply ZFSet.ext + intro z + rw [mem_assignmentOnIndices] + exact and_iff_left_of_imp + (fun hz => M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A hz) + have requests := M.storedPreparationRequests_act a s b d level T T2 valid valid2 t + pairing unions powers separation collection members maps nodeMaps closed closed2 hLevel hT2 hA g + refine requests.trans ?_ + rw [M.storedPreparationRequests_typed, M.storedPreparationRequests_typed] + dsimp only + rw [selection, localSelection] + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingActionGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingActionGraphs.lean index 1d2bd34ea363e90339253f1de8eb2c61086973ac..daa85a73a7ae900ecd884d85e1d6b5b72789f7a2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingActionGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingActionGraphs.lean @@ -1,192 +1,192 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementHistoryOrderOutputFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.StructuralAssignmentActionFormulas - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def structuralForcingCarrier - (rows G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := - M.refinementHistoryForcing rows T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -include pairing unions powers separation collection in -theorem structuralForcingCarrier_mem (env : Fin 9 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.structuralForcingCarrier (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) (env 8) ∈ M.sets := - M.refinementHistoryForcing_mem pairing unions powers separation (members 0) (members 5) (members 7) - ((M.definable_structuralRefinementHistory pairing unions powers separation collection).closed - (fun j => env j.succ) (fun j => members j.succ)) omega - -noncomputable def structuralForcingCarrierFormula {n : Nat} - (output rows G nodes nodeOrder basis T T2 stages history N : Fin n) : SetFormula n := - .ex (.conj - (reindex (extend 0 ![G.succ, nodes.succ, nodeOrder.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) - (M.definable_structuralRefinementHistory pairing unions powers separation collection).formula) - (refinementHistoryForcingOutputFormula output.succ rows.succ T.succ stages.succ 0 N.succ)) - -theorem realize_structuralForcingCarrierFormula {n : Nat} - (output rows G nodes nodeOrder basis T T2 stages history N : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) : - Realize M.sets (M.structuralForcingCarrierFormula pairing unions powers separation collection - output rows G nodes nodeOrder basis T T2 stages history N) env ↔ - env output = M.structuralForcingCarrier (env rows) (env G) (env nodes) (env nodeOrder) - (env basis) (env T) (env T2) (env stages) (env history) := by - unfold structuralForcingCarrierFormula - rw [realize_ex] - let params : Fin 8 → ZFSet.{u} := ![env G, env nodes, env nodeOrder, env basis, env T, env T2, env stages, env history] - have ground : ∀ j, params j ∈ M.sets := Fin.cases (members G) (Fin.cases (members nodes) - (Fin.cases (members nodeOrder) (Fin.cases (members basis) (Fin.cases (members T) - (Fin.cases (members T2) (Fin.cases (members stages) (Fin.cases (members history) (fun j => Fin.elim0 j)))))))) - have args (H : ZFSet.{u}) : - (fun j : Fin 8 => extend H env - (![G.succ, nodes.succ, nodeOrder.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ] j)) = params := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))) j - have meaning (H : ZFSet.{u}) (hH : H ∈ M.sets) : - Realize M.sets (.conj - (reindex (extend 0 ![G.succ, nodes.succ, nodeOrder.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) - (M.definable_structuralRefinementHistory pairing unions powers separation collection).formula) - (refinementHistoryForcingOutputFormula output.succ rows.succ T.succ stages.succ 0 N.succ)) - (extend H env) ↔ - H = M.structuralRefinementHistory (env G) (env nodes) (env nodeOrder) (env basis) - (env T) (env T2) (env stages) (env history) ∧ - env output = M.refinementHistoryForcing (env rows) (env T) (env stages) H := by - apply and_congr - · rw [realize_reindex, map_extend, args] - exact (M.definable_structuralRefinementHistory pairing unions powers separation collection).correct - params ground H hH - · exact M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation - output.succ rows.succ T.succ stages.succ 0 N.succ (extend H env) (Fin.cases hH members) naturals - constructor - · rintro ⟨H, hH, holds⟩ - obtain ⟨rfl, equal⟩ := (meaning H hH).1 holds - exact equal - · intro equal - have packed := (M.definable_structuralRefinementHistory pairing unions powers separation collection).closed params ground - exact ⟨_, packed, (meaning _ packed).2 ⟨rfl, equal⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -noncomputable def definable_structuralAssignments : - GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => - M.structuralAssignments (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) := by - let v := GroundSetTerm.var M (n := 8) - let packed := GroundSetTerm.app (M.definable_structuralRefinementHistory pairing unions powers separation collection) - ![v 0,v 1,v 2,v 3,v 4,v 5,v 6,v 7] - let indices := GroundSetTerm.app (M.definable_refinementDataHistoryIndices pairing unions powers separation) ![v 6,packed] - let product (x y : GroundSetTerm M 8) := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x,y] - exact (product indices (product (v 4) (v 4))).definition - -noncomputable def definable_structuralAssignmentActionGraph : - GroundDefinableFunction M (fun env : Fin 9 → ZFSet.{u} => - M.structuralAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) (env 8)) := by - let v := GroundSetTerm.var M (n := 9) - let J := GroundSetTerm.app (M.definable_structuralAssignments pairing unions powers separation collection) - ![v 0,v 1,v 2,v 4,v 5,v 6,v 7,v 8] - let product (x y : GroundSetTerm M 9) := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x,y] - let bound := product (product (v 0) J) J - let term := GroundSetTerm.app (M.definable_separation separation - (M.structuralAssignmentEntryFormula pairing unions powers separation collection)) - ![bound,v 0,v 1,v 2,v 3,v 4,v 5,v 6,v 7,v 8] - have equal (env : Fin 9 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - term.eval env = M.structuralAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) - (env 4) (env 5) (env 6) (env 7) (env 8) := by - have args : (fun j : Fin 9 => (![bound,v 0,v 1,v 2,v 3,v 4,v 5,v 6,v 7,v 8] j.succ).eval env) = env := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))) j - change ZFSet.sep (fun z => Realize M.sets - (M.structuralAssignmentEntryFormula pairing unions powers separation collection) (extend z _)) (bound.eval env) = _ - rw [args] - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, holds⟩ - exact (M.realize_structuralAssignmentEntryFormula pairing unions powers separation collection - (extend z env) (Fin.cases (M.transitive (bound.ground env members) hz) members)).1 holds - · intro member - have raw := member - unfold structuralAssignmentActionGraph at raw - have hz : z ∈ bound.eval env := (ZFSet.mem_sep.1 raw).1 - exact ⟨hz, (M.realize_structuralAssignmentEntryFormula pairing unions powers separation collection - (extend z env) (Fin.cases (M.transitive (bound.ground env members) hz) members)).2 member⟩ - exact { formula := term.definition.formula - closed := fun env members => equal env members ▸ term.ground env members - correct := fun env members z hz => (term.correct env members z hz).trans - (congrArg (fun x => z = x) (equal env members)).to_iff } - -include pairing unions powers separation collection in -theorem structuralAssignmentActionGraph_mem {G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}} - (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) (hna : nodeAction ∈ M.sets) - (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hs : stages ∈ M.sets) (hh : history ∈ M.sets) : - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ∈ M.sets := - (M.definable_structuralAssignmentActionGraph pairing unions powers separation collection).closed - ![G,nodes,nodeOrder,nodeAction,basis,T,T2,stages,history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hna (Fin.cases hb (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j)))))))))) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem structuralForcingActionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {rows rowAction G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hRowAction : rowAction ∈ M.sets) - (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) - (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - rawRowAssignmentActionGraph G - (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history) rows - (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history).sUnion.sUnion - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) rowAction - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) ∈ M.sets := by - have hQ := M.structuralForcingCarrier_mem pairing unions powers separation collection - ![rows,G,nodes,nodeOrder,basis,T,T2,stages,history] - (Fin.cases hRows (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb - (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j)))))))))) omega - have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed - ![G,nodes,nodeOrder,basis,T,T2,stages,history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT - (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hF := M.structuralAssignmentActionGraph_mem pairing unions powers separation collection - hG hn hno hna hb hT hT2 hs hh - exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection - hG hQ hRows (M.union_mem unions (M.union_mem unions hQ)) hJ hRowAction hF - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementHistoryOrderOutputFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.StructuralAssignmentActionFormulas + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def structuralForcingCarrier + (rows G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := + M.refinementHistoryForcing rows T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +include pairing unions powers separation collection in +theorem structuralForcingCarrier_mem (env : Fin 9 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.structuralForcingCarrier (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) (env 8) ∈ M.sets := + M.refinementHistoryForcing_mem pairing unions powers separation (members 0) (members 5) (members 7) + ((M.definable_structuralRefinementHistory pairing unions powers separation collection).closed + (fun j => env j.succ) (fun j => members j.succ)) omega + +noncomputable def structuralForcingCarrierFormula {n : Nat} + (output rows G nodes nodeOrder basis T T2 stages history N : Fin n) : SetFormula n := + .ex (.conj + (reindex (extend 0 ![G.succ, nodes.succ, nodeOrder.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) + (M.definable_structuralRefinementHistory pairing unions powers separation collection).formula) + (refinementHistoryForcingOutputFormula output.succ rows.succ T.succ stages.succ 0 N.succ)) + +theorem realize_structuralForcingCarrierFormula {n : Nat} + (output rows G nodes nodeOrder basis T T2 stages history N : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) : + Realize M.sets (M.structuralForcingCarrierFormula pairing unions powers separation collection + output rows G nodes nodeOrder basis T T2 stages history N) env ↔ + env output = M.structuralForcingCarrier (env rows) (env G) (env nodes) (env nodeOrder) + (env basis) (env T) (env T2) (env stages) (env history) := by + unfold structuralForcingCarrierFormula + rw [realize_ex] + let params : Fin 8 → ZFSet.{u} := ![env G, env nodes, env nodeOrder, env basis, env T, env T2, env stages, env history] + have ground : ∀ j, params j ∈ M.sets := Fin.cases (members G) (Fin.cases (members nodes) + (Fin.cases (members nodeOrder) (Fin.cases (members basis) (Fin.cases (members T) + (Fin.cases (members T2) (Fin.cases (members stages) (Fin.cases (members history) (fun j => Fin.elim0 j)))))))) + have args (H : ZFSet.{u}) : + (fun j : Fin 8 => extend H env + (![G.succ, nodes.succ, nodeOrder.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ] j)) = params := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))) j + have meaning (H : ZFSet.{u}) (hH : H ∈ M.sets) : + Realize M.sets (.conj + (reindex (extend 0 ![G.succ, nodes.succ, nodeOrder.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) + (M.definable_structuralRefinementHistory pairing unions powers separation collection).formula) + (refinementHistoryForcingOutputFormula output.succ rows.succ T.succ stages.succ 0 N.succ)) + (extend H env) ↔ + H = M.structuralRefinementHistory (env G) (env nodes) (env nodeOrder) (env basis) + (env T) (env T2) (env stages) (env history) ∧ + env output = M.refinementHistoryForcing (env rows) (env T) (env stages) H := by + apply and_congr + · rw [realize_reindex, map_extend, args] + exact (M.definable_structuralRefinementHistory pairing unions powers separation collection).correct + params ground H hH + · exact M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation + output.succ rows.succ T.succ stages.succ 0 N.succ (extend H env) (Fin.cases hH members) naturals + constructor + · rintro ⟨H, hH, holds⟩ + obtain ⟨rfl, equal⟩ := (meaning H hH).1 holds + exact equal + · intro equal + have packed := (M.definable_structuralRefinementHistory pairing unions powers separation collection).closed params ground + exact ⟨_, packed, (meaning _ packed).2 ⟨rfl, equal⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +noncomputable def definable_structuralAssignments : + GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => + M.structuralAssignments (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) := by + let v := GroundSetTerm.var M (n := 8) + let packed := GroundSetTerm.app (M.definable_structuralRefinementHistory pairing unions powers separation collection) + ![v 0,v 1,v 2,v 3,v 4,v 5,v 6,v 7] + let indices := GroundSetTerm.app (M.definable_refinementDataHistoryIndices pairing unions powers separation) ![v 6,packed] + let product (x y : GroundSetTerm M 8) := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x,y] + exact (product indices (product (v 4) (v 4))).definition + +noncomputable def definable_structuralAssignmentActionGraph : + GroundDefinableFunction M (fun env : Fin 9 → ZFSet.{u} => + M.structuralAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) (env 8)) := by + let v := GroundSetTerm.var M (n := 9) + let J := GroundSetTerm.app (M.definable_structuralAssignments pairing unions powers separation collection) + ![v 0,v 1,v 2,v 4,v 5,v 6,v 7,v 8] + let product (x y : GroundSetTerm M 9) := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x,y] + let bound := product (product (v 0) J) J + let term := GroundSetTerm.app (M.definable_separation separation + (M.structuralAssignmentEntryFormula pairing unions powers separation collection)) + ![bound,v 0,v 1,v 2,v 3,v 4,v 5,v 6,v 7,v 8] + have equal (env : Fin 9 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + term.eval env = M.structuralAssignmentActionGraph (env 0) (env 1) (env 2) (env 3) + (env 4) (env 5) (env 6) (env 7) (env 8) := by + have args : (fun j : Fin 9 => (![bound,v 0,v 1,v 2,v 3,v 4,v 5,v 6,v 7,v 8] j.succ).eval env) = env := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))) j + change ZFSet.sep (fun z => Realize M.sets + (M.structuralAssignmentEntryFormula pairing unions powers separation collection) (extend z _)) (bound.eval env) = _ + rw [args] + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, holds⟩ + exact (M.realize_structuralAssignmentEntryFormula pairing unions powers separation collection + (extend z env) (Fin.cases (M.transitive (bound.ground env members) hz) members)).1 holds + · intro member + have raw := member + unfold structuralAssignmentActionGraph at raw + have hz : z ∈ bound.eval env := (ZFSet.mem_sep.1 raw).1 + exact ⟨hz, (M.realize_structuralAssignmentEntryFormula pairing unions powers separation collection + (extend z env) (Fin.cases (M.transitive (bound.ground env members) hz) members)).2 member⟩ + exact { formula := term.definition.formula + closed := fun env members => equal env members ▸ term.ground env members + correct := fun env members z hz => (term.correct env members z hz).trans + (congrArg (fun x => z = x) (equal env members)).to_iff } + +include pairing unions powers separation collection in +theorem structuralAssignmentActionGraph_mem {G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}} + (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) (hna : nodeAction ∈ M.sets) + (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hs : stages ∈ M.sets) (hh : history ∈ M.sets) : + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ∈ M.sets := + (M.definable_structuralAssignmentActionGraph pairing unions powers separation collection).closed + ![G,nodes,nodeOrder,nodeAction,basis,T,T2,stages,history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hna (Fin.cases hb (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j)))))))))) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem structuralForcingActionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {rows rowAction G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hRowAction : rowAction ∈ M.sets) + (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) + (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + rawRowAssignmentActionGraph G + (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history) rows + (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history).sUnion.sUnion + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) rowAction + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) ∈ M.sets := by + have hQ := M.structuralForcingCarrier_mem pairing unions powers separation collection + ![rows,G,nodes,nodeOrder,basis,T,T2,stages,history] + (Fin.cases hRows (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb + (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j)))))))))) omega + have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed + ![G,nodes,nodeOrder,basis,T,T2,stages,history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT + (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hF := M.structuralAssignmentActionGraph_mem pairing unions powers separation collection + hG hn hno hna hb hT hT2 hs hh + exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection + hG hQ hRows (M.union_mem unions (M.union_mem unions hQ)) hJ hRowAction hF + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingHistoryConstruction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingHistoryConstruction.lean index 601497469735a2cc6ab025409f1e35ed529adeba..bf09970e05213629ac3eccaa67b7421bade2eaa7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingHistoryConstruction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundStructuralForcingHistoryConstruction.lean @@ -1,515 +1,515 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingActionGraphs -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSmallAssignmentCuts -import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveStructuralRefinementHistories - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem small_refinementConditionFamily_prefix - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows T K history D : ZFSet.{u}} (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) - (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) (hD : D ∈ M.sets) - (ordinal : ordinalSetProperty K) (omega : ZFSet.omega ∈ K) - (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (run : RecursiveRefinementDataHistory M rows T K history) - (small : GroundBelow M D K) (members : D ⊆ M.refinementHistoryForcing rows T K history) : - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K history T) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing rows T beta (graphRestriction beta history) := by - let J := stageOneAssignments (refinementDataHistoryIndices K history) T - let S := M.groundSmallSubsets J ZFSet.omega - let projection := productSecond rows S - let R := relationImage D S projection - let U := ⋃₀ R - have hJ : J ∈ M.sets := M.stageOneAssignments_mem pairing unions powers separation - (M.refinementDataHistoryIndices_mem pairing unions powers separation hK hHistory) hT - have hS : S ∈ M.sets := M.groundSmallSubsets_mem powers separation hJ (M.transitive hK omega) - have hProjection : projection ∈ M.sets := M.productSecond_mem pairing unions powers separation hRows hS - have hR : R ∈ M.sets := M.relationImage_mem separation hD hS hProjection - have hU : U ∈ M.sets := M.union_mem unions hR - have smallR : GroundBelow M R K := small.function_image pairing unions powers separation choice - hD hS hK hProjection (productSecond_function rows S) - have smallU : GroundBelow M U K := GroundBelow.sUnion pairing unions powers separation choice - hR hK ordinal regular strong smallR (fun A hA => - GroundBelow.of_countable omega ((M.mem_groundSmallSubsets J ZFSet.omega A).1 - ((mem_relationImage D S projection A).1 hA).1).2.2) - have subset : U ⊆ J := by - intro z hz - obtain ⟨A, hA, hz⟩ := ZFSet.mem_sUnion.1 hz - have inS := ((mem_relationImage D S projection A).1 hA).1 - exact ((M.mem_groundSmallSubsets J ZFSet.omega A).1 inS).2.1 hz - obtain ⟨beta, hBeta, cuts⟩ := M.small_assignmentCuts_bounded pairing unions powers separation - hU hK (M.refinementDataHistoryLevels_mem pairing unions powers separation hK hHistory hT) - regular smallU run.data.levels_function subset - refine ⟨beta, hBeta, ?_⟩ - intro row A member - have actual := members member - have candidate := ((M.mem_refinementHistoryForcing rows T K history _).1 actual).1 - have pair : row ∈ rows ∧ A ∈ S := ZFSet.pair_mem_prod.1 candidate - have inR : A ∈ R := (mem_relationImage D S projection A).2 ⟨pair.2, ZFSet.pair row A, - member, (mem_productSecond rows S _).2 ⟨row, pair.1, A, pair.2, rfl⟩⟩ - have cut := cuts A (fun z hz => ZFSet.mem_sUnion.2 ⟨A, inR, hz⟩) - exact ⟨cut, cut ▸ run.cut_mem actual hBeta⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def rawFlatForcingStage - (Q rows rowOrder rowTop rowAction G J assignmentAction : ZFSet.{u}) : ZFSet.{u} := - forcingStageCode Q (rawRowAssignmentOrder Q rowOrder) (ZFSet.pair rowTop ∅) - (rawRowAssignmentActionGraph G Q rows (⋃₀ ⋃₀ Q) J rowAction assignmentAction) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def definable_emptyFromGround : - GroundDefinableFunction M (fun _env : Fin 1 → ZFSet.{u} => (∅ : ZFSet.{u})) where - formula := (BoundedFormula.emptyFormula 0).toFormula - closed := fun env members => M.empty_mem ⟨env 0, members 0⟩ - correct := by - intro env members z hz - exact (BoundedFormula.realize_toFormula M _ (extend z env) (Fin.cases hz members)).trans - (BoundedFormula.truth_emptyFormula 0 _) - -noncomputable def definable_rawFlatForcingStage - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => - rawFlatForcingStage (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) := by - let v := GroundSetTerm.var M (n := 8) - let order := GroundSetTerm.app (M.definable_rawRowAssignmentOrder pairing unions powers separation) ![v 0, v 2] - let emptyData := GroundSetTerm.app M.definable_emptyFromGround ![v 0] - let top := GroundSetTerm.app (M.definable_nonemptyTuple pairing 1) ![v 3, emptyData] - let dataBound := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 0] - let action := GroundSetTerm.app (M.definable_rawRowAssignmentActionGraph pairing unions powers separation collection) - ![v 5, v 0, v 1, dataBound, v 6, v 4, v 7] - exact (GroundSetTerm.app (M.definable_nonemptyTuple pairing 3) ![v 0, order, top, action]).definition - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def structuralForcingStageFromCarrier - (Q rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := - rawFlatForcingStage Q rows rowOrder rowTop rowAction G - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) - -noncomputable def definable_structuralForcingStageFromCarrier - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 14 → ZFSet.{u} => - M.structuralForcingStageFromCarrier (env 0) (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) (env 12) (env 13)) := by - let v := GroundSetTerm.var M (n := 14) - let assignments := GroundSetTerm.app (M.definable_structuralAssignments pairing unions powers separation collection) - ![v 5, v 6, v 7, v 9, v 10, v 11, v 12, v 13] - let action := GroundSetTerm.app (M.definable_structuralAssignmentActionGraph pairing unions powers separation collection) - ![v 5, v 6, v 7, v 8, v 9, v 10, v 11, v 12, v 13] - exact (GroundSetTerm.app (M.definable_rawFlatForcingStage pairing unions powers separation collection) - ![v 0, v 1, v 2, v 3, v 4, v 5, assignments, action]).definition - - - - - -noncomputable def structuralForcingStage - (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := - M.structuralForcingStageFromCarrier - (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history) - rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -include pairing unions powers separation collection in -theorem structuralForcingStage_mem (env : Fin 13 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.structuralForcingStage (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) - (env 7) (env 8) (env 9) (env 10) (env 11) (env 12) ∈ M.sets := by - have carrier := M.structuralForcingCarrier_mem pairing unions powers separation collection - ![env 0, env 4, env 5, env 6, env 8, env 9, env 10, env 11, env 12] - (Fin.cases (members 0) (Fin.cases (members 4) (Fin.cases (members 5) - (Fin.cases (members 6) (Fin.cases (members 8) (Fin.cases (members 9) - (Fin.cases (members 10) (Fin.cases (members 11) (Fin.cases (members 12) (fun j => Fin.elim0 j)))))))))) omega - exact (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).closed - (extend _ env) (Fin.cases carrier members) - -noncomputable def structuralForcingStageFormula {n : Nat} - (output rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history N : Fin n) : SetFormula n := - .ex (.conj - (M.structuralForcingCarrierFormula pairing unions powers separation collection - 0 rows.succ G.succ nodes.succ nodeOrder.succ basis.succ T.succ T2.succ stages.succ history.succ N.succ) - (reindex (extend output.succ ![0, rows.succ, rowOrder.succ, rowTop.succ, rowAction.succ, - G.succ, nodes.succ, nodeOrder.succ, nodeAction.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) - (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).formula)) - -theorem realize_structuralForcingStageFormula {n : Nat} - (output rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history N : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) : - Realize M.sets (M.structuralForcingStageFormula pairing unions powers separation collection - output rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history N) env ↔ - env output = M.structuralForcingStage (env rows) (env rowOrder) (env rowTop) (env rowAction) - (env G) (env nodes) (env nodeOrder) (env nodeAction) (env basis) (env T) (env T2) (env stages) (env history) := by - unfold structuralForcingStageFormula - rw [realize_ex] - let params : Fin 13 → ZFSet.{u} := ![env rows, env rowOrder, env rowTop, env rowAction, - env G, env nodes, env nodeOrder, env nodeAction, env basis, env T, env T2, env stages, env history] - have ground : ∀ j, params j ∈ M.sets := Fin.cases (members rows) (Fin.cases (members rowOrder) - (Fin.cases (members rowTop) (Fin.cases (members rowAction) (Fin.cases (members G) - (Fin.cases (members nodes) (Fin.cases (members nodeOrder) (Fin.cases (members nodeAction) - (Fin.cases (members basis) (Fin.cases (members T) (Fin.cases (members T2) - (Fin.cases (members stages) (Fin.cases (members history) (fun j => Fin.elim0 j))))))))))))) - have args (Q : ZFSet.{u}) : - (fun j : Fin 14 => extend Q env (![0, rows.succ, rowOrder.succ, rowTop.succ, rowAction.succ, - G.succ, nodes.succ, nodeOrder.succ, nodeAction.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ] j)) = - extend Q params := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))))))))) j - have meaning (Q : ZFSet.{u}) (hQ : Q ∈ M.sets) : - Realize M.sets (.conj - (M.structuralForcingCarrierFormula pairing unions powers separation collection - 0 rows.succ G.succ nodes.succ nodeOrder.succ basis.succ T.succ T2.succ stages.succ history.succ N.succ) - (reindex (extend output.succ ![0, rows.succ, rowOrder.succ, rowTop.succ, rowAction.succ, - G.succ, nodes.succ, nodeOrder.succ, nodeAction.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) - (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).formula)) - (extend Q env) ↔ - Q = M.structuralForcingCarrier (env rows) (env G) (env nodes) (env nodeOrder) (env basis) - (env T) (env T2) (env stages) (env history) ∧ - env output = M.structuralForcingStageFromCarrier Q (env rows) (env rowOrder) (env rowTop) (env rowAction) - (env G) (env nodes) (env nodeOrder) (env nodeAction) (env basis) (env T) (env T2) (env stages) (env history) := by - apply and_congr - · exact M.realize_structuralForcingCarrierFormula pairing unions powers separation collection - 0 rows.succ G.succ nodes.succ nodeOrder.succ basis.succ T.succ T2.succ stages.succ history.succ N.succ - (extend Q env) (Fin.cases hQ members) naturals - · rw [realize_reindex, map_extend, args] - exact (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).correct - (extend Q params) (Fin.cases hQ ground) (env output) (members output) - constructor - · rintro ⟨Q, hQ, holds⟩ - obtain ⟨rfl, equal⟩ := (meaning Q hQ).1 holds - exact equal - · intro equal - have carrier := M.structuralForcingCarrier_mem pairing unions powers separation collection - ![env rows, env G, env nodes, env nodeOrder, env basis, env T, env T2, env stages, env history] - (Fin.cases (members rows) (Fin.cases (members G) (Fin.cases (members nodes) - (Fin.cases (members nodeOrder) (Fin.cases (members basis) (Fin.cases (members T) - (Fin.cases (members T2) (Fin.cases (members stages) (Fin.cases (members history) (fun j => Fin.elim0 j)))))))))) - (naturals ▸ members N) - exact ⟨_, carrier, (meaning _ carrier).2 ⟨rfl, equal⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -noncomputable def structuralForcingStepFormula : SetFormula 15 := - M.structuralForcingStageFormula pairing unions powers separation collection - 2 3 4 5 6 7 8 9 10 11 12 13 0 1 14 - -theorem realize_structuralForcingStepFormula (params : Fin 12 → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) (naturals : params 11 = ZFSet.omega) - {alpha prior output : ZFSet.{u}} (ha : alpha ∈ M.sets) (hp : prior ∈ M.sets) (ho : output ∈ M.sets) : - Realize M.sets (M.structuralForcingStepFormula pairing unions powers separation collection) - (extend alpha (extend prior (extend output params))) ↔ - output = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) - (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) alpha prior := - M.realize_structuralForcingStageFormula pairing unions powers separation collection - 2 3 4 5 6 7 8 9 10 11 12 13 0 1 14 _ (Fin.cases ha (Fin.cases hp (Fin.cases ho members))) naturals - -theorem structuralForcingStepClosure (params : Fin 12 → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) (naturals : params 11 = ZFSet.omega) - {stages : ZFSet.{u}} (hs : stages ∈ M.sets) : - GroundOrdinalStepClosure M stages (M.structuralForcingStepFormula pairing unions powers separation collection) params := by - intro alpha halpha prior hprior _trace - have ha := M.transitive hs halpha - let args : Fin 13 → ZFSet.{u} := ![params 0,params 1,params 2,params 3,params 4,params 5, - params 6,params 7,params 8,params 9,params 10,alpha,prior] - have ground : ∀ j, args j ∈ M.sets := by - exact Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) - (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) - (Fin.cases (members 8) (Fin.cases (members 9) (Fin.cases (members 10) - (Fin.cases ha (Fin.cases hprior (fun j => Fin.elim0 j))))))))))))) - have outputGround := M.structuralForcingStage_mem pairing unions powers separation collection args ground - (naturals ▸ members 11) - refine ⟨_, outputGround, ?_, ?_⟩ - · exact (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals - ha hprior outputGround).2 rfl - · intro output ho recognized - exact (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals - ha hprior ho).1 recognized - -theorem exists_structuralForcingTrace (params : Fin 12 → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) (naturals : params 11 = ZFSet.omega) - {stages : ZFSet.{u}} (hs : stages ∈ M.sets) (ordinal : ordinalSetProperty stages) : - ∃ history ∈ M.sets, - OrdinalRecursionTrace (groundRecursionStep M - (M.structuralForcingStepFormula pairing unions powers separation collection) params) stages history ∧ - OrdinalRecursionTrace (fun alpha prior output => - output = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) - (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) alpha prior) stages history ∧ - (∀ other, OrdinalRecursionTrace (groundRecursionStep M - (M.structuralForcingStepFormula pairing unions powers separation collection) params) stages other → other = history) ∧ - ∀ alpha ∈ stages, ∀ output ∈ M.sets, - ZFSet.pair alpha output ∈ history ↔ - output = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) - (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) alpha (graphRestriction alpha history) := by - obtain ⟨history, hh, trace, unique, entry⟩ := M.exists_unique_ordinalRecursionTrace pairing unions separation collection - hs ordinal (M.structuralForcingStepFormula pairing unions powers separation collection) params members - (M.structuralForcingStepClosure pairing unions powers separation collection params members naturals hs) - refine ⟨history, hh, trace, ⟨trace.1, ?_⟩, unique, ?_⟩ - · intro alpha halpha output stored - have step := trace.2 alpha halpha output stored - exact (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals - (M.transitive hs halpha) step.1 step.2.1).1 step.2.2 - intro alpha halpha output ho - have ha := M.transitive hs halpha - exact (entry alpha halpha output ho).trans - (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals - ha (M.graphRestriction_mem unions separation ha hh) ho) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G L : Type u} -variable [Group G] [PartialOrder L] -variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) -variable (rows rowOrder rowTop rowAction T T2 : ZFSet.{u}) -local notation "step" => fun level prior output => - output = M.structuralForcingStage rows rowOrder rowTop rowAction t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level prior - -theorem structuralTrace_prefix_ground - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) (trace : OrdinalRecursionTrace step stages history) - {level P order top action : ZFSet.{u}} - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) : - level ∈ M.sets ∧ ordinalSetProperty level ∧ graphRestriction level history ∈ M.sets ∧ - OrdinalRecursionTrace step level (graphRestriction level history) ∧ - P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets := by - have member := trace.1.pair_source stored - have hLevel := M.transitive hStages member - have levelOrdinal := ordinalSetProperty_member ordinal member - have codeGround := M.transitive (M.union_mem unions (M.union_mem unions hHistory)) - (pair_second_mem_doubleUnion stored) - exact ⟨hLevel, levelOrdinal, M.graphRestriction_mem unions separation hLevel hHistory, - trace.restrict levelOrdinal (ordinal.1 level member), M.forcingStageCode_fields codeGround⟩ - -theorem structuralTrace_stageWitnesses - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (current : ∀ level prior, level ∈ M.sets → prior ∈ M.sets → ordinalSetProperty level → - OrdinalRecursionTrace step level prior → - (∀ earlier P order top action, ZFSet.pair earlier (forcingStageCode P order top action) ∈ prior → - RawRefinementStageWitness M t b d base directed T T2 earlier P order top action) → - ∀ P order top action, - forcingStageCode P order top action = - M.structuralForcingStage rows rowOrder rowTop rowAction t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level prior → - RawRefinementStageWitness M t b d base directed T T2 level P order top action) - {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) (trace : OrdinalRecursionTrace step stages history) : - ∀ level P order top action, ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M t b d base directed T T2 level P order top action := by - intro level - induction level using ZFSet.inductionOn with - | h level ih => - intro P order top action stored - obtain ⟨hLevel, levelOrdinal, hPrefix, prefixTrace, _fields⟩ := - M.structuralTrace_prefix_ground t b d rows rowOrder rowTop rowAction T T2 - unions separation hStages hHistory ordinal trace stored - apply current level (graphRestriction level history) hLevel hPrefix levelOrdinal prefixTrace - · intro earlier P' order' top' action' entry - have prefixEntry := pair_mem_graphRestriction.1 entry - exact ih earlier prefixEntry.2 P' order' top' action' prefixEntry.1 - · exact trace.2 level (trace.1.pair_source stored) _ stored - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - -theorem structuralForcingStage_eq (stages history : ZFSet.{u}) : - M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history = - forcingStageCode - (M.refinementHistoryForcing rows T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) - (M.refinementHistoryOrder rows rowOrder T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) - (ZFSet.pair rowTop ∅) - (rawRowAssignmentActionGraph G - (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history) - rows (⋃₀ ⋃₀ (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history)) - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) rowAction - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history)) := by - unfold structuralForcingStage structuralForcingStageFromCarrier rawFlatForcingStage structuralForcingCarrier - rw [M.refinementHistoryOrder_raw] - -theorem structuralForcingTrace_recursiveOrder {stages history : ZFSet.{u}} - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace - (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction - G nodes nodeOrder nodeAction basis T T2 level prior) stages history) : - RecursiveRefinementOrderHistory M rows rowOrder T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - apply M.structuralRefinementHistory_recursiveOrder_of_trace G nodes nodeOrder basis T T2 - rows rowOrder stages history ordinal trace - intro level prior stage equal - exact ⟨_, _, equal.trans (M.structuralForcingStage_eq rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 level prior)⟩ - -theorem structuralForcingTrace_stageOrderTop {stages history : ZFSet.{u}} - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace - (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction - G nodes nodeOrder nodeAction basis T T2 level prior) stages history) - (hRows : rows ∈ M.sets) (rowOrderLaw : PartialOrderCode rows rowOrder) - (topMem : rowTop ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row rowTop ∈ rowOrder) : - ∀ level P order top action, ZFSet.pair level (forcingStageCode P order top action) ∈ history → - PartialOrderCode P order ∧ top ∈ P ∧ ∀ p ∈ P, ZFSet.pair p top ∈ order := by - intro level P order top action stored - have hl := trace.1.pair_source stored - have cutOrdinal := ordinalSetProperty_member ordinal hl - have earlier := trace.restrict cutOrdinal (ordinal.1 level hl) - have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 cutOrdinal earlier - have equal := (trace.2 level hl _ stored).trans - (M.structuralForcingStage_eq rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 - level (graphRestriction level history)) - obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal - exact ⟨M.refinementHistoryOrder_partialOrder rowOrderLaw T level _, - run.carriers.empty_assignments cutOrdinal hRows topMem, - run.carriers.greatest cutOrdinal hRows topMem topRows⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem structuralForcingTrace_small_family_prefix - (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hNodeOrder : nodeOrder ∈ M.sets) (hBasis : basis ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - {K history : ZFSet.{u}} (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) - (trace : OrdinalRecursionTrace - (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction - G nodes nodeOrder nodeAction basis T T2 level prior) K history) : - let packed := M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history - ∀ D ∈ M.sets, GroundBelow M D K → D ⊆ M.refinementHistoryForcing rows T K packed → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed T) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing rows T beta (graphRestriction beta packed) := by - dsimp only - intro D hD small members - have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![G, nodes, nodeOrder, basis, T, T2, K, history] - (Fin.cases hG (Fin.cases hNodes (Fin.cases hNodeOrder (Fin.cases hBasis - (Fin.cases hT (Fin.cases hT2 (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 conditions.1 trace - exact M.small_refinementConditionFamily_prefix pairing unions powers separation choice hRows hT hK - packed hD conditions.1 conditions.2.1 conditions.2.2.1 conditions.2.2.2 run.carriers small members - - - - - -theorem exists_structuralForcingHistory - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (params : Fin 12 → ZFSet.{u}) (members : ∀ j, params j ∈ M.sets) - (naturals : params 11 = ZFSet.omega) - {stages : ZFSet.{u}} (hStages : stages ∈ M.sets) (ordinal : ordinalSetProperty stages) - (rowOrderLaw : PartialOrderCode (params 0) (params 1)) - (topMem : params 2 ∈ params 0) - (topRows : ∀ row ∈ params 0, ZFSet.pair row (params 2) ∈ params 1) : - ∃ history ∈ M.sets, - OrdinalRecursionTrace (fun level prior stage => - stage = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) - (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) level prior) stages history ∧ - M.structuralRefinementHistory (params 4) (params 5) (params 6) (params 8) (params 9) (params 10) - stages history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M (params 0) (params 1) (params 9) stages - (M.structuralRefinementHistory (params 4) (params 5) (params 6) (params 8) (params 9) (params 10) - stages history) ∧ - ∀ level P order top action, ZFSet.pair level (forcingStageCode P order top action) ∈ history → - PartialOrderCode P order ∧ top ∈ P ∧ ∀ p ∈ P, ZFSet.pair p top ∈ order := by - obtain ⟨history, hHistory, _groundTrace, trace, _unique, _lookup⟩ := - M.exists_structuralForcingTrace pairing unions powers separation collection params members naturals hStages ordinal - refine ⟨history, hHistory, trace, ?_, ?_, ?_⟩ - · exact (M.definable_structuralRefinementHistory pairing unions powers separation collection).closed - ![params 4, params 5, params 6, params 8, params 9, params 10, stages, history] - (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) - (Fin.cases (members 8) (Fin.cases (members 9) (Fin.cases (members 10) - (Fin.cases hStages (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - · exact M.structuralForcingTrace_recursiveOrder (params 0) (params 1) (params 2) (params 3) - (params 4) (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) ordinal trace - · exact M.structuralForcingTrace_stageOrderTop (params 0) (params 1) (params 2) (params 3) - (params 4) (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) - ordinal trace (members 0) rowOrderLaw topMem topRows - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingActionGraphs +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSmallAssignmentCuts +import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveStructuralRefinementHistories + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem small_refinementConditionFamily_prefix + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows T K history D : ZFSet.{u}} (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) + (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) (hD : D ∈ M.sets) + (ordinal : ordinalSetProperty K) (omega : ZFSet.omega ∈ K) + (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (run : RecursiveRefinementDataHistory M rows T K history) + (small : GroundBelow M D K) (members : D ⊆ M.refinementHistoryForcing rows T K history) : + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K history T) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing rows T beta (graphRestriction beta history) := by + let J := stageOneAssignments (refinementDataHistoryIndices K history) T + let S := M.groundSmallSubsets J ZFSet.omega + let projection := productSecond rows S + let R := relationImage D S projection + let U := ⋃₀ R + have hJ : J ∈ M.sets := M.stageOneAssignments_mem pairing unions powers separation + (M.refinementDataHistoryIndices_mem pairing unions powers separation hK hHistory) hT + have hS : S ∈ M.sets := M.groundSmallSubsets_mem powers separation hJ (M.transitive hK omega) + have hProjection : projection ∈ M.sets := M.productSecond_mem pairing unions powers separation hRows hS + have hR : R ∈ M.sets := M.relationImage_mem separation hD hS hProjection + have hU : U ∈ M.sets := M.union_mem unions hR + have smallR : GroundBelow M R K := small.function_image pairing unions powers separation choice + hD hS hK hProjection (productSecond_function rows S) + have smallU : GroundBelow M U K := GroundBelow.sUnion pairing unions powers separation choice + hR hK ordinal regular strong smallR (fun A hA => + GroundBelow.of_countable omega ((M.mem_groundSmallSubsets J ZFSet.omega A).1 + ((mem_relationImage D S projection A).1 hA).1).2.2) + have subset : U ⊆ J := by + intro z hz + obtain ⟨A, hA, hz⟩ := ZFSet.mem_sUnion.1 hz + have inS := ((mem_relationImage D S projection A).1 hA).1 + exact ((M.mem_groundSmallSubsets J ZFSet.omega A).1 inS).2.1 hz + obtain ⟨beta, hBeta, cuts⟩ := M.small_assignmentCuts_bounded pairing unions powers separation + hU hK (M.refinementDataHistoryLevels_mem pairing unions powers separation hK hHistory hT) + regular smallU run.data.levels_function subset + refine ⟨beta, hBeta, ?_⟩ + intro row A member + have actual := members member + have candidate := ((M.mem_refinementHistoryForcing rows T K history _).1 actual).1 + have pair : row ∈ rows ∧ A ∈ S := ZFSet.pair_mem_prod.1 candidate + have inR : A ∈ R := (mem_relationImage D S projection A).2 ⟨pair.2, ZFSet.pair row A, + member, (mem_productSecond rows S _).2 ⟨row, pair.1, A, pair.2, rfl⟩⟩ + have cut := cuts A (fun z hz => ZFSet.mem_sUnion.2 ⟨A, inR, hz⟩) + exact ⟨cut, cut ▸ run.cut_mem actual hBeta⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def rawFlatForcingStage + (Q rows rowOrder rowTop rowAction G J assignmentAction : ZFSet.{u}) : ZFSet.{u} := + forcingStageCode Q (rawRowAssignmentOrder Q rowOrder) (ZFSet.pair rowTop ∅) + (rawRowAssignmentActionGraph G Q rows (⋃₀ ⋃₀ Q) J rowAction assignmentAction) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def definable_emptyFromGround : + GroundDefinableFunction M (fun _env : Fin 1 → ZFSet.{u} => (∅ : ZFSet.{u})) where + formula := (BoundedFormula.emptyFormula 0).toFormula + closed := fun env members => M.empty_mem ⟨env 0, members 0⟩ + correct := by + intro env members z hz + exact (BoundedFormula.realize_toFormula M _ (extend z env) (Fin.cases hz members)).trans + (BoundedFormula.truth_emptyFormula 0 _) + +noncomputable def definable_rawFlatForcingStage + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => + rawFlatForcingStage (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) := by + let v := GroundSetTerm.var M (n := 8) + let order := GroundSetTerm.app (M.definable_rawRowAssignmentOrder pairing unions powers separation) ![v 0, v 2] + let emptyData := GroundSetTerm.app M.definable_emptyFromGround ![v 0] + let top := GroundSetTerm.app (M.definable_nonemptyTuple pairing 1) ![v 3, emptyData] + let dataBound := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 0] + let action := GroundSetTerm.app (M.definable_rawRowAssignmentActionGraph pairing unions powers separation collection) + ![v 5, v 0, v 1, dataBound, v 6, v 4, v 7] + exact (GroundSetTerm.app (M.definable_nonemptyTuple pairing 3) ![v 0, order, top, action]).definition + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def structuralForcingStageFromCarrier + (Q rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := + rawFlatForcingStage Q rows rowOrder rowTop rowAction G + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) + +noncomputable def definable_structuralForcingStageFromCarrier + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 14 → ZFSet.{u} => + M.structuralForcingStageFromCarrier (env 0) (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) (env 12) (env 13)) := by + let v := GroundSetTerm.var M (n := 14) + let assignments := GroundSetTerm.app (M.definable_structuralAssignments pairing unions powers separation collection) + ![v 5, v 6, v 7, v 9, v 10, v 11, v 12, v 13] + let action := GroundSetTerm.app (M.definable_structuralAssignmentActionGraph pairing unions powers separation collection) + ![v 5, v 6, v 7, v 8, v 9, v 10, v 11, v 12, v 13] + exact (GroundSetTerm.app (M.definable_rawFlatForcingStage pairing unions powers separation collection) + ![v 0, v 1, v 2, v 3, v 4, v 5, assignments, action]).definition + + + + + +noncomputable def structuralForcingStage + (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := + M.structuralForcingStageFromCarrier + (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history) + rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +include pairing unions powers separation collection in +theorem structuralForcingStage_mem (env : Fin 13 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.structuralForcingStage (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) + (env 7) (env 8) (env 9) (env 10) (env 11) (env 12) ∈ M.sets := by + have carrier := M.structuralForcingCarrier_mem pairing unions powers separation collection + ![env 0, env 4, env 5, env 6, env 8, env 9, env 10, env 11, env 12] + (Fin.cases (members 0) (Fin.cases (members 4) (Fin.cases (members 5) + (Fin.cases (members 6) (Fin.cases (members 8) (Fin.cases (members 9) + (Fin.cases (members 10) (Fin.cases (members 11) (Fin.cases (members 12) (fun j => Fin.elim0 j)))))))))) omega + exact (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).closed + (extend _ env) (Fin.cases carrier members) + +noncomputable def structuralForcingStageFormula {n : Nat} + (output rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history N : Fin n) : SetFormula n := + .ex (.conj + (M.structuralForcingCarrierFormula pairing unions powers separation collection + 0 rows.succ G.succ nodes.succ nodeOrder.succ basis.succ T.succ T2.succ stages.succ history.succ N.succ) + (reindex (extend output.succ ![0, rows.succ, rowOrder.succ, rowTop.succ, rowAction.succ, + G.succ, nodes.succ, nodeOrder.succ, nodeAction.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) + (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).formula)) + +theorem realize_structuralForcingStageFormula {n : Nat} + (output rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history N : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) : + Realize M.sets (M.structuralForcingStageFormula pairing unions powers separation collection + output rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history N) env ↔ + env output = M.structuralForcingStage (env rows) (env rowOrder) (env rowTop) (env rowAction) + (env G) (env nodes) (env nodeOrder) (env nodeAction) (env basis) (env T) (env T2) (env stages) (env history) := by + unfold structuralForcingStageFormula + rw [realize_ex] + let params : Fin 13 → ZFSet.{u} := ![env rows, env rowOrder, env rowTop, env rowAction, + env G, env nodes, env nodeOrder, env nodeAction, env basis, env T, env T2, env stages, env history] + have ground : ∀ j, params j ∈ M.sets := Fin.cases (members rows) (Fin.cases (members rowOrder) + (Fin.cases (members rowTop) (Fin.cases (members rowAction) (Fin.cases (members G) + (Fin.cases (members nodes) (Fin.cases (members nodeOrder) (Fin.cases (members nodeAction) + (Fin.cases (members basis) (Fin.cases (members T) (Fin.cases (members T2) + (Fin.cases (members stages) (Fin.cases (members history) (fun j => Fin.elim0 j))))))))))))) + have args (Q : ZFSet.{u}) : + (fun j : Fin 14 => extend Q env (![0, rows.succ, rowOrder.succ, rowTop.succ, rowAction.succ, + G.succ, nodes.succ, nodeOrder.succ, nodeAction.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ] j)) = + extend Q params := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))))))))) j + have meaning (Q : ZFSet.{u}) (hQ : Q ∈ M.sets) : + Realize M.sets (.conj + (M.structuralForcingCarrierFormula pairing unions powers separation collection + 0 rows.succ G.succ nodes.succ nodeOrder.succ basis.succ T.succ T2.succ stages.succ history.succ N.succ) + (reindex (extend output.succ ![0, rows.succ, rowOrder.succ, rowTop.succ, rowAction.succ, + G.succ, nodes.succ, nodeOrder.succ, nodeAction.succ, basis.succ, T.succ, T2.succ, stages.succ, history.succ]) + (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).formula)) + (extend Q env) ↔ + Q = M.structuralForcingCarrier (env rows) (env G) (env nodes) (env nodeOrder) (env basis) + (env T) (env T2) (env stages) (env history) ∧ + env output = M.structuralForcingStageFromCarrier Q (env rows) (env rowOrder) (env rowTop) (env rowAction) + (env G) (env nodes) (env nodeOrder) (env nodeAction) (env basis) (env T) (env T2) (env stages) (env history) := by + apply and_congr + · exact M.realize_structuralForcingCarrierFormula pairing unions powers separation collection + 0 rows.succ G.succ nodes.succ nodeOrder.succ basis.succ T.succ T2.succ stages.succ history.succ N.succ + (extend Q env) (Fin.cases hQ members) naturals + · rw [realize_reindex, map_extend, args] + exact (M.definable_structuralForcingStageFromCarrier pairing unions powers separation collection).correct + (extend Q params) (Fin.cases hQ ground) (env output) (members output) + constructor + · rintro ⟨Q, hQ, holds⟩ + obtain ⟨rfl, equal⟩ := (meaning Q hQ).1 holds + exact equal + · intro equal + have carrier := M.structuralForcingCarrier_mem pairing unions powers separation collection + ![env rows, env G, env nodes, env nodeOrder, env basis, env T, env T2, env stages, env history] + (Fin.cases (members rows) (Fin.cases (members G) (Fin.cases (members nodes) + (Fin.cases (members nodeOrder) (Fin.cases (members basis) (Fin.cases (members T) + (Fin.cases (members T2) (Fin.cases (members stages) (Fin.cases (members history) (fun j => Fin.elim0 j)))))))))) + (naturals ▸ members N) + exact ⟨_, carrier, (meaning _ carrier).2 ⟨rfl, equal⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +noncomputable def structuralForcingStepFormula : SetFormula 15 := + M.structuralForcingStageFormula pairing unions powers separation collection + 2 3 4 5 6 7 8 9 10 11 12 13 0 1 14 + +theorem realize_structuralForcingStepFormula (params : Fin 12 → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) (naturals : params 11 = ZFSet.omega) + {alpha prior output : ZFSet.{u}} (ha : alpha ∈ M.sets) (hp : prior ∈ M.sets) (ho : output ∈ M.sets) : + Realize M.sets (M.structuralForcingStepFormula pairing unions powers separation collection) + (extend alpha (extend prior (extend output params))) ↔ + output = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) + (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) alpha prior := + M.realize_structuralForcingStageFormula pairing unions powers separation collection + 2 3 4 5 6 7 8 9 10 11 12 13 0 1 14 _ (Fin.cases ha (Fin.cases hp (Fin.cases ho members))) naturals + +theorem structuralForcingStepClosure (params : Fin 12 → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) (naturals : params 11 = ZFSet.omega) + {stages : ZFSet.{u}} (hs : stages ∈ M.sets) : + GroundOrdinalStepClosure M stages (M.structuralForcingStepFormula pairing unions powers separation collection) params := by + intro alpha halpha prior hprior _trace + have ha := M.transitive hs halpha + let args : Fin 13 → ZFSet.{u} := ![params 0,params 1,params 2,params 3,params 4,params 5, + params 6,params 7,params 8,params 9,params 10,alpha,prior] + have ground : ∀ j, args j ∈ M.sets := by + exact Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) + (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) (Fin.cases (members 7) + (Fin.cases (members 8) (Fin.cases (members 9) (Fin.cases (members 10) + (Fin.cases ha (Fin.cases hprior (fun j => Fin.elim0 j))))))))))))) + have outputGround := M.structuralForcingStage_mem pairing unions powers separation collection args ground + (naturals ▸ members 11) + refine ⟨_, outputGround, ?_, ?_⟩ + · exact (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals + ha hprior outputGround).2 rfl + · intro output ho recognized + exact (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals + ha hprior ho).1 recognized + +theorem exists_structuralForcingTrace (params : Fin 12 → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) (naturals : params 11 = ZFSet.omega) + {stages : ZFSet.{u}} (hs : stages ∈ M.sets) (ordinal : ordinalSetProperty stages) : + ∃ history ∈ M.sets, + OrdinalRecursionTrace (groundRecursionStep M + (M.structuralForcingStepFormula pairing unions powers separation collection) params) stages history ∧ + OrdinalRecursionTrace (fun alpha prior output => + output = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) + (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) alpha prior) stages history ∧ + (∀ other, OrdinalRecursionTrace (groundRecursionStep M + (M.structuralForcingStepFormula pairing unions powers separation collection) params) stages other → other = history) ∧ + ∀ alpha ∈ stages, ∀ output ∈ M.sets, + ZFSet.pair alpha output ∈ history ↔ + output = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) + (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) alpha (graphRestriction alpha history) := by + obtain ⟨history, hh, trace, unique, entry⟩ := M.exists_unique_ordinalRecursionTrace pairing unions separation collection + hs ordinal (M.structuralForcingStepFormula pairing unions powers separation collection) params members + (M.structuralForcingStepClosure pairing unions powers separation collection params members naturals hs) + refine ⟨history, hh, trace, ⟨trace.1, ?_⟩, unique, ?_⟩ + · intro alpha halpha output stored + have step := trace.2 alpha halpha output stored + exact (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals + (M.transitive hs halpha) step.1 step.2.1).1 step.2.2 + intro alpha halpha output ho + have ha := M.transitive hs halpha + exact (entry alpha halpha output ho).trans + (M.realize_structuralForcingStepFormula pairing unions powers separation collection params members naturals + ha (M.graphRestriction_mem unions separation ha hh) ho) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G L : Type u} +variable [Group G] [PartialOrder L] +variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) +variable (rows rowOrder rowTop rowAction T T2 : ZFSet.{u}) +local notation "step" => fun level prior output => + output = M.structuralForcingStage rows rowOrder rowTop rowAction t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level prior + +theorem structuralTrace_prefix_ground + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) (trace : OrdinalRecursionTrace step stages history) + {level P order top action : ZFSet.{u}} + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) : + level ∈ M.sets ∧ ordinalSetProperty level ∧ graphRestriction level history ∈ M.sets ∧ + OrdinalRecursionTrace step level (graphRestriction level history) ∧ + P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets := by + have member := trace.1.pair_source stored + have hLevel := M.transitive hStages member + have levelOrdinal := ordinalSetProperty_member ordinal member + have codeGround := M.transitive (M.union_mem unions (M.union_mem unions hHistory)) + (pair_second_mem_doubleUnion stored) + exact ⟨hLevel, levelOrdinal, M.graphRestriction_mem unions separation hLevel hHistory, + trace.restrict levelOrdinal (ordinal.1 level member), M.forcingStageCode_fields codeGround⟩ + +theorem structuralTrace_stageWitnesses + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (current : ∀ level prior, level ∈ M.sets → prior ∈ M.sets → ordinalSetProperty level → + OrdinalRecursionTrace step level prior → + (∀ earlier P order top action, ZFSet.pair earlier (forcingStageCode P order top action) ∈ prior → + RawRefinementStageWitness M t b d base directed T T2 earlier P order top action) → + ∀ P order top action, + forcingStageCode P order top action = + M.structuralForcingStage rows rowOrder rowTop rowAction t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level prior → + RawRefinementStageWitness M t b d base directed T T2 level P order top action) + {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) (trace : OrdinalRecursionTrace step stages history) : + ∀ level P order top action, ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M t b d base directed T T2 level P order top action := by + intro level + induction level using ZFSet.inductionOn with + | h level ih => + intro P order top action stored + obtain ⟨hLevel, levelOrdinal, hPrefix, prefixTrace, _fields⟩ := + M.structuralTrace_prefix_ground t b d rows rowOrder rowTop rowAction T T2 + unions separation hStages hHistory ordinal trace stored + apply current level (graphRestriction level history) hLevel hPrefix levelOrdinal prefixTrace + · intro earlier P' order' top' action' entry + have prefixEntry := pair_mem_graphRestriction.1 entry + exact ih earlier prefixEntry.2 P' order' top' action' prefixEntry.1 + · exact trace.2 level (trace.1.pair_source stored) _ stored + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + +theorem structuralForcingStage_eq (stages history : ZFSet.{u}) : + M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 stages history = + forcingStageCode + (M.refinementHistoryForcing rows T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) + (M.refinementHistoryOrder rows rowOrder T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) + (ZFSet.pair rowTop ∅) + (rawRowAssignmentActionGraph G + (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history) + rows (⋃₀ ⋃₀ (M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history)) + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) rowAction + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history)) := by + unfold structuralForcingStage structuralForcingStageFromCarrier rawFlatForcingStage structuralForcingCarrier + rw [M.refinementHistoryOrder_raw] + +theorem structuralForcingTrace_recursiveOrder {stages history : ZFSet.{u}} + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace + (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction + G nodes nodeOrder nodeAction basis T T2 level prior) stages history) : + RecursiveRefinementOrderHistory M rows rowOrder T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + apply M.structuralRefinementHistory_recursiveOrder_of_trace G nodes nodeOrder basis T T2 + rows rowOrder stages history ordinal trace + intro level prior stage equal + exact ⟨_, _, equal.trans (M.structuralForcingStage_eq rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 level prior)⟩ + +theorem structuralForcingTrace_stageOrderTop {stages history : ZFSet.{u}} + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace + (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction + G nodes nodeOrder nodeAction basis T T2 level prior) stages history) + (hRows : rows ∈ M.sets) (rowOrderLaw : PartialOrderCode rows rowOrder) + (topMem : rowTop ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row rowTop ∈ rowOrder) : + ∀ level P order top action, ZFSet.pair level (forcingStageCode P order top action) ∈ history → + PartialOrderCode P order ∧ top ∈ P ∧ ∀ p ∈ P, ZFSet.pair p top ∈ order := by + intro level P order top action stored + have hl := trace.1.pair_source stored + have cutOrdinal := ordinalSetProperty_member ordinal hl + have earlier := trace.restrict cutOrdinal (ordinal.1 level hl) + have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 cutOrdinal earlier + have equal := (trace.2 level hl _ stored).trans + (M.structuralForcingStage_eq rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 + level (graphRestriction level history)) + obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal + exact ⟨M.refinementHistoryOrder_partialOrder rowOrderLaw T level _, + run.carriers.empty_assignments cutOrdinal hRows topMem, + run.carriers.greatest cutOrdinal hRows topMem topRows⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem structuralForcingTrace_small_family_prefix + (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hNodeOrder : nodeOrder ∈ M.sets) (hBasis : basis ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + {K history : ZFSet.{u}} (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) + (trace : OrdinalRecursionTrace + (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction + G nodes nodeOrder nodeAction basis T T2 level prior) K history) : + let packed := M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history + ∀ D ∈ M.sets, GroundBelow M D K → D ⊆ M.refinementHistoryForcing rows T K packed → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed T) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing rows T beta (graphRestriction beta packed) := by + dsimp only + intro D hD small members + have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![G, nodes, nodeOrder, basis, T, T2, K, history] + (Fin.cases hG (Fin.cases hNodes (Fin.cases hNodeOrder (Fin.cases hBasis + (Fin.cases hT (Fin.cases hT2 (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 conditions.1 trace + exact M.small_refinementConditionFamily_prefix pairing unions powers separation choice hRows hT hK + packed hD conditions.1 conditions.2.1 conditions.2.2.1 conditions.2.2.2 run.carriers small members + + + + + +theorem exists_structuralForcingHistory + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (params : Fin 12 → ZFSet.{u}) (members : ∀ j, params j ∈ M.sets) + (naturals : params 11 = ZFSet.omega) + {stages : ZFSet.{u}} (hStages : stages ∈ M.sets) (ordinal : ordinalSetProperty stages) + (rowOrderLaw : PartialOrderCode (params 0) (params 1)) + (topMem : params 2 ∈ params 0) + (topRows : ∀ row ∈ params 0, ZFSet.pair row (params 2) ∈ params 1) : + ∃ history ∈ M.sets, + OrdinalRecursionTrace (fun level prior stage => + stage = M.structuralForcingStage (params 0) (params 1) (params 2) (params 3) (params 4) + (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) level prior) stages history ∧ + M.structuralRefinementHistory (params 4) (params 5) (params 6) (params 8) (params 9) (params 10) + stages history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M (params 0) (params 1) (params 9) stages + (M.structuralRefinementHistory (params 4) (params 5) (params 6) (params 8) (params 9) (params 10) + stages history) ∧ + ∀ level P order top action, ZFSet.pair level (forcingStageCode P order top action) ∈ history → + PartialOrderCode P order ∧ top ∈ P ∧ ∀ p ∈ P, ZFSet.pair p top ∈ order := by + obtain ⟨history, hHistory, _groundTrace, trace, _unique, _lookup⟩ := + M.exists_structuralForcingTrace pairing unions powers separation collection params members naturals hStages ordinal + refine ⟨history, hHistory, trace, ?_, ?_, ?_⟩ + · exact (M.definable_structuralRefinementHistory pairing unions powers separation collection).closed + ![params 4, params 5, params 6, params 8, params 9, params 10, stages, history] + (Fin.cases (members 4) (Fin.cases (members 5) (Fin.cases (members 6) + (Fin.cases (members 8) (Fin.cases (members 9) (Fin.cases (members 10) + (Fin.cases hStages (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + · exact M.structuralForcingTrace_recursiveOrder (params 0) (params 1) (params 2) (params 3) + (params 4) (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) ordinal trace + · exact M.structuralForcingTrace_stageOrderTop (params 0) (params 1) (params 2) (params 3) + (params 4) (params 5) (params 6) (params 7) (params 8) (params 9) (params 10) + ordinal trace (members 0) rowOrderLaw topMem topRows + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateFamilyDecisions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateFamilyDecisions.lean index f62ceedec396eab83fcfd7da5b6f7cbd43c76ee0..89b437b1702e50c153c9775d3293d8c63b2bd87d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateFamilyDecisions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateFamilyDecisions.lean @@ -1,206 +1,206 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSupportedCertificateFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation L) -variable (T : ZFSet.{u}) (K : L → Subgroup G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (omega : ZFSet.omega ∈ M.sets) - -noncomputable def supportedCertificateFamilyEnv (nodeOrder J k : ZFSet.{u}) - (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) - (validJ : ∀ z ∈ J, IsName s z) : Assignment (M.nameDomain s) 12 := - let check (x : ZFSet.{u}) (hx : x ∈ M.sets) : (M.nameDomain s).names := - ⟨Name.check s ⊤ x, M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) x hx⟩ - let N := M.niceSupportNameCodes a s T K - let hN := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation - collection carrier group nodes supports maps hT valid - ![check k hk, check J hJ, check (M.groundPower b.carrier) (M.groundPower_mem powers nodes), - check (M.groundSmallSubsets b.carrier ZFSet.omega) - (M.groundSmallSubsets_mem powers separation nodes omega), - check (M.groundRelations b.carrier N) - (M.groundRelations_mem pairing unions powers separation nodes hN), - check b.carrier nodes, check N hN, check nodeOrder hOrder, - check (M.niceSupportRelation a s b T K) - (M.niceSupportRelation_mem a s b T K t pairing unions powers separation collection - carrier group nodes supports maps hT valid), - ⟨Name.inputEvaluationName s J validJ, - M.inputEvaluationName_mem s pairing unions powers separation collection carrier hJ validJ⟩, - ⟨M.niceSupportEvaluationName a s T K, - M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation collection - carrier group nodes supports maps hT valid⟩, - ⟨M.niceVisibilityEvaluationName a s b T K, - M.niceVisibilityEvaluationName_mem a s b t K pairing unions powers separation collection - carrier group nodes supports maps hT valid⟩] - -theorem realize_supportedCertificateFamilyEnv (nodeOrder J k : ZFSet.{u}) - (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) - (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) : - Realize ((M.nameDomain s).values {p | H.mem p}) supportedCertificateFamilyFormula - (evalAssignment {p | H.mem p} - (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ)) ↔ - k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H := by - let env := M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ - let extension : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, - (M.nameDomain s).values_transitive _⟩ - have fields : evalAssignment {p | H.mem p} env = - ![k, J, M.groundPower b.carrier, M.groundSmallSubsets b.carrier ZFSet.omega, - M.groundRelations b.carrier (M.niceSupportNameCodes a s T K), b.carrier, - M.niceSupportNameCodes a s T K, nodeOrder, M.niceSupportRelation a s b T K, - Name.eval {p | H.mem p} (Name.inputEvaluationName s J validJ), - Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K), - Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K)] := by - funext i - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)))))))))))) i - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · exact Name.eval_check _ ⊤ H.top_mem _ - · rfl - · rfl - · rfl - have meaning := extension.realize_supportedCertificateFamilyFormula - (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩) - rw [fields] at meaning - change Realize extension.sets supportedCertificateFamilyFormula - (evalAssignment {p | H.mem p} env) ↔ _ - rw [fields] - exact meaning - -theorem exists_forced_supportedCertificateFamily (nodeOrder J k : ZFSet.{u}) - (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) - (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (selected : k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) - (p : P) (hp : H.mem p) : - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain s) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) q := by - let env := M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ - have truth := (M.realize_supportedCertificateFamilyEnv a s t b T K pairing unions powers separation - collection carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ H).2 selected - obtain ⟨r, hr, forced⟩ := (forcing_truth (M.nameDomain s) H generic - supportedCertificateFamilyFormula env).1 truth - obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr - exact ⟨q, hq, qp, forces_mono (M.nameDomain s) supportedCertificateFamilyFormula env forced qr⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation L) -variable (T : ZFSet.{u}) (K : L → Subgroup G) -private theorem actual_certificate (nodeOrder J k : ZFSet.{u}) - (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) (z : Name s) - (F B f : ZFSet.{u}) - (selected : k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) - (entry : ZFSet.pair z.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k) : - SupportedEqualityCertificate b.carrier (M.niceSupportNameCodes a s T K) nodeOrder - (M.niceSupportRelation a s b T K) - (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) - (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K)) - (Name.eval {p | H.mem p} z) F B f := by - obtain ⟨_, _, _, _, value, evaluated, certificate⟩ := - (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 (selected entry) - have equal := (Name.inputEvaluationName_entry s J validJ z H value).1 evaluated - exact equal.2.symm ▸ certificate - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (omega : ZFSet.omega ∈ M.sets) - -theorem forces_supportedCertificateFamily_profile (nodeOrder J k : ZFSet.{u}) - (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) - (validJ : ∀ z ∈ J, IsName s z) (small : M.sets.Countable) - (z : (M.nameDomain s).names) (F B f : ZFSet.{u}) - (q : P) (forced : Forces (M.nameDomain s) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) q) - (entry : ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k) - (hF : F ∈ M.sets) : M.DecidesVisibilityProfile a s b K T F z.val q := by - apply (M.forces_visibilityProfile_iff a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid small F hF z q).1 - apply (M.ordinaryForces_iff_all_generics s small carrier visibilityProfileFormula - (M.visibilityProfileEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid F hF z) q).2 - intro H hq generic - have truth := forces_sound (M.nameDomain s) H generic supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) hq forced - have selected := (M.realize_supportedCertificateFamilyEnv a s t b T K pairing unions powers - separation collection carrier group nodes supports maps hT valid omega nodeOrder J k - hOrder hJ hk validJ H).1 truth - have certificate := actual_certificate M a s b T K nodeOrder J k validJ H z.val F B f selected entry - apply (M.realize_visibilityProfileEnv a s t b K pairing unions powers separation collection - carrier group nodes supports maps hT valid F hF z H).2 - intro v - exact certificate.2.2.2.2.1 (b.encode v) - (Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v))) - ((M.niceVisibilityEvaluationName_entry a s b T K H v _).2 rfl) (b.encode_mem v) - -theorem forces_supportedCertificateFamily_equality (nodeOrder J k : ZFSet.{u}) - (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) - (validJ : ∀ z ∈ J, IsName s z) (small : M.sets.Countable) - (z : (M.nameDomain s).names) (F B f : ZFSet.{u}) - (q : P) (forced : Forces (M.nameDomain s) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) q) - (entry : ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k) - (v : ZFSet.{u}) (hv : v ∈ B) (tau : Name s) - (ht : tau.val ∈ M.niceSupportNameCodes a s T K) - (selectedEntry : ZFSet.pair v tau.val ∈ f) : Name.ForcesEq q z.val tau := by - let named : (M.nameDomain s).names := - ⟨tau, ((M.mem_niceSupportNameCodes a s T K tau.val).1 ht).1⟩ - change Forces (M.nameDomain s) (.equal 0 1 : SetFormula 2) ![z, named] q - apply (M.ordinaryForces_iff_all_generics s small carrier (.equal 0 1) ![z, named] q).2 - intro H hq generic - have truth := forces_sound (M.nameDomain s) H generic supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection - carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) hq forced - have selected := (M.realize_supportedCertificateFamilyEnv a s t b T K pairing unions powers - separation collection carrier group nodes supports maps hT valid omega nodeOrder J k - hOrder hJ hk validJ H).1 truth - have certificate := actual_certificate M a s b T K nodeOrder J k validJ H z.val F B f selected entry - have result := certificate.2.2.2.2.2 v hv tau.val ht selectedEntry - exact ((M.niceSupportEvaluationName_entry a s T K tau ht H _).1 result.2).symm - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSupportedCertificateFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation L) +variable (T : ZFSet.{u}) (K : L → Subgroup G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (omega : ZFSet.omega ∈ M.sets) + +noncomputable def supportedCertificateFamilyEnv (nodeOrder J k : ZFSet.{u}) + (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) + (validJ : ∀ z ∈ J, IsName s z) : Assignment (M.nameDomain s) 12 := + let check (x : ZFSet.{u}) (hx : x ∈ M.sets) : (M.nameDomain s).names := + ⟨Name.check s ⊤ x, M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) x hx⟩ + let N := M.niceSupportNameCodes a s T K + let hN := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation + collection carrier group nodes supports maps hT valid + ![check k hk, check J hJ, check (M.groundPower b.carrier) (M.groundPower_mem powers nodes), + check (M.groundSmallSubsets b.carrier ZFSet.omega) + (M.groundSmallSubsets_mem powers separation nodes omega), + check (M.groundRelations b.carrier N) + (M.groundRelations_mem pairing unions powers separation nodes hN), + check b.carrier nodes, check N hN, check nodeOrder hOrder, + check (M.niceSupportRelation a s b T K) + (M.niceSupportRelation_mem a s b T K t pairing unions powers separation collection + carrier group nodes supports maps hT valid), + ⟨Name.inputEvaluationName s J validJ, + M.inputEvaluationName_mem s pairing unions powers separation collection carrier hJ validJ⟩, + ⟨M.niceSupportEvaluationName a s T K, + M.niceSupportEvaluationName_mem a s T K t b pairing unions powers separation collection + carrier group nodes supports maps hT valid⟩, + ⟨M.niceVisibilityEvaluationName a s b T K, + M.niceVisibilityEvaluationName_mem a s b t K pairing unions powers separation collection + carrier group nodes supports maps hT valid⟩] + +theorem realize_supportedCertificateFamilyEnv (nodeOrder J k : ZFSet.{u}) + (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) + (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) : + Realize ((M.nameDomain s).values {p | H.mem p}) supportedCertificateFamilyFormula + (evalAssignment {p | H.mem p} + (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ)) ↔ + k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H := by + let env := M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ + let extension : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, + (M.nameDomain s).values_transitive _⟩ + have fields : evalAssignment {p | H.mem p} env = + ![k, J, M.groundPower b.carrier, M.groundSmallSubsets b.carrier ZFSet.omega, + M.groundRelations b.carrier (M.niceSupportNameCodes a s T K), b.carrier, + M.niceSupportNameCodes a s T K, nodeOrder, M.niceSupportRelation a s b T K, + Name.eval {p | H.mem p} (Name.inputEvaluationName s J validJ), + Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K), + Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K)] := by + funext i + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun j => Fin.elim0 j)))))))))))) i + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · exact Name.eval_check _ ⊤ H.top_mem _ + · rfl + · rfl + · rfl + have meaning := extension.realize_supportedCertificateFamilyFormula + (evalAssignment {p | H.mem p} env) (fun i => ⟨env i, rfl⟩) + rw [fields] at meaning + change Realize extension.sets supportedCertificateFamilyFormula + (evalAssignment {p | H.mem p} env) ↔ _ + rw [fields] + exact meaning + +theorem exists_forced_supportedCertificateFamily (nodeOrder J k : ZFSet.{u}) + (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) + (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (selected : k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) + (p : P) (hp : H.mem p) : + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain s) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) q := by + let env := M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ + have truth := (M.realize_supportedCertificateFamilyEnv a s t b T K pairing unions powers separation + collection carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ H).2 selected + obtain ⟨r, hr, forced⟩ := (forcing_truth (M.nameDomain s) H generic + supportedCertificateFamilyFormula env).1 truth + obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr + exact ⟨q, hq, qp, forces_mono (M.nameDomain s) supportedCertificateFamilyFormula env forced qr⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation L) +variable (T : ZFSet.{u}) (K : L → Subgroup G) +private theorem actual_certificate (nodeOrder J k : ZFSet.{u}) + (validJ : ∀ z ∈ J, IsName s z) (H : ConditionFilter P) (z : Name s) + (F B f : ZFSet.{u}) + (selected : k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) + (entry : ZFSet.pair z.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k) : + SupportedEqualityCertificate b.carrier (M.niceSupportNameCodes a s T K) nodeOrder + (M.niceSupportRelation a s b T K) + (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) + (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T K)) + (Name.eval {p | H.mem p} z) F B f := by + obtain ⟨_, _, _, _, value, evaluated, certificate⟩ := + (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 (selected entry) + have equal := (Name.inputEvaluationName_entry s J validJ z H value).1 evaluated + exact equal.2.symm ▸ certificate + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t K ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (omega : ZFSet.omega ∈ M.sets) + +theorem forces_supportedCertificateFamily_profile (nodeOrder J k : ZFSet.{u}) + (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) + (validJ : ∀ z ∈ J, IsName s z) (small : M.sets.Countable) + (z : (M.nameDomain s).names) (F B f : ZFSet.{u}) + (q : P) (forced : Forces (M.nameDomain s) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) q) + (entry : ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k) + (hF : F ∈ M.sets) : M.DecidesVisibilityProfile a s b K T F z.val q := by + apply (M.forces_visibilityProfile_iff a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid small F hF z q).1 + apply (M.ordinaryForces_iff_all_generics s small carrier visibilityProfileFormula + (M.visibilityProfileEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid F hF z) q).2 + intro H hq generic + have truth := forces_sound (M.nameDomain s) H generic supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) hq forced + have selected := (M.realize_supportedCertificateFamilyEnv a s t b T K pairing unions powers + separation collection carrier group nodes supports maps hT valid omega nodeOrder J k + hOrder hJ hk validJ H).1 truth + have certificate := actual_certificate M a s b T K nodeOrder J k validJ H z.val F B f selected entry + apply (M.realize_visibilityProfileEnv a s t b K pairing unions powers separation collection + carrier group nodes supports maps hT valid F hF z H).2 + intro v + exact certificate.2.2.2.2.1 (b.encode v) + (Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v))) + ((M.niceVisibilityEvaluationName_entry a s b T K H v _).2 rfl) (b.encode_mem v) + +theorem forces_supportedCertificateFamily_equality (nodeOrder J k : ZFSet.{u}) + (hOrder : nodeOrder ∈ M.sets) (hJ : J ∈ M.sets) (hk : k ∈ M.sets) + (validJ : ∀ z ∈ J, IsName s z) (small : M.sets.Countable) + (z : (M.nameDomain s).names) (F B f : ZFSet.{u}) + (q : P) (forced : Forces (M.nameDomain s) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) q) + (entry : ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k) + (v : ZFSet.{u}) (hv : v ∈ B) (tau : Name s) + (ht : tau.val ∈ M.niceSupportNameCodes a s T K) + (selectedEntry : ZFSet.pair v tau.val ∈ f) : Name.ForcesEq q z.val tau := by + let named : (M.nameDomain s).names := + ⟨tau, ((M.mem_niceSupportNameCodes a s T K tau.val).1 ht).1⟩ + change Forces (M.nameDomain s) (.equal 0 1 : SetFormula 2) ![z, named] q + apply (M.ordinaryForces_iff_all_generics s small carrier (.equal 0 1) ![z, named] q).2 + intro H hq generic + have truth := forces_sound (M.nameDomain s) H generic supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv a s t b T K pairing unions powers separation collection + carrier group nodes supports maps hT valid omega nodeOrder J k hOrder hJ hk validJ) hq forced + have selected := (M.realize_supportedCertificateFamilyEnv a s t b T K pairing unions powers + separation collection carrier group nodes supports maps hT valid omega nodeOrder J k + hOrder hJ hk validJ H).1 truth + have certificate := actual_certificate M a s b T K nodeOrder J k validJ H z.val F B f selected entry + have result := certificate.2.2.2.2.2 v hv tau.val ht selectedEntry + exact ((M.niceSupportEvaluationName_entry a s T K tau ht H _).1 result.2).symm + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateProfiles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateProfiles.lean index 02174c43927558fbf9c130526ff0a2242915458f..21d5aa3afa2a795f5ab8ac475e363121e1faa6d2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateProfiles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSupportedCertificateProfiles.lean @@ -1,53 +1,53 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.SupportedCertificateRelations - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -theorem SupportedEqualityCertificate.basis_nonempty - {nodes N order R niceEval visibilityEval value F B f : ZFSet.{u}} - (certificate : SupportedEqualityCertificate nodes N order R niceEval visibilityEval value F B f) - (nonempty : F.Nonempty) : B.Nonempty := by - obtain ⟨v, hv⟩ := nonempty - obtain ⟨w, hw, _⟩ := certificate.2.2.1 v hv - exact ⟨w, hw⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -theorem supportedCertificate_profile_eq - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) - (d : PosetAction G L) (T : ZFSet.{u}) (H : ConditionFilter P) - {N order R niceEval value F B f : ZFSet.{u}} - (certificate : SupportedEqualityCertificate b.carrier N order R niceEval - (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T d.principalFix)) - value F B f) : - F = M.visibleSupportProfile a s b d T H value := by - have describes (v : L) : - value ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) ↔ - b.encode v ∈ F := - certificate.2.2.2.2.1 (b.encode v) _ - ((M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v _).2 rfl) - (b.encode_mem v) - apply ZFSet.ext - intro x - constructor - · intro member - obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (certificate.1 member) - exact (M.encode_mem_visibleSupportProfile a s b d T H value v).2 ((describes v).2 member) - · intro member - obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ member) - exact (describes v).1 ((M.encode_mem_visibleSupportProfile a s b d T H value v).1 member) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.SupportedCertificateRelations + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +theorem SupportedEqualityCertificate.basis_nonempty + {nodes N order R niceEval visibilityEval value F B f : ZFSet.{u}} + (certificate : SupportedEqualityCertificate nodes N order R niceEval visibilityEval value F B f) + (nonempty : F.Nonempty) : B.Nonempty := by + obtain ⟨v, hv⟩ := nonempty + obtain ⟨w, hw, _⟩ := certificate.2.2.1 v hv + exact ⟨w, hw⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +theorem supportedCertificate_profile_eq + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) + (d : PosetAction G L) (T : ZFSet.{u}) (H : ConditionFilter P) + {N order R niceEval value F B f : ZFSet.{u}} + (certificate : SupportedEqualityCertificate b.carrier N order R niceEval + (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T d.principalFix)) + value F B f) : + F = M.visibleSupportProfile a s b d T H value := by + have describes (v : L) : + value ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) ↔ + b.encode v ∈ F := + certificate.2.2.2.2.1 (b.encode v) _ + ((M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v _).2 rfl) + (b.encode_mem v) + apply ZFSet.ext + intro x + constructor + · intro member + obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (certificate.1 member) + exact (M.encode_mem_visibleSupportProfile a s b d T H value v).2 ((describes v).2 member) + · intro member + obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ member) + exact (describes v).1 ((M.encode_mem_visibleSupportProfile a s b d T H value v).1 member) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricCollection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricCollection.lean index 1cd5c1e761fc7cd549f41959d227da92141cfd47..4d981e258a7e6e85fb9622065e6ea96cfd4994ae 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricCollection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricCollection.lean @@ -1,134 +1,134 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ForcingWitnessFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMixtureTermBounds - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem symmetricForcingWitnessBound (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {n : Nat} (φ : SetFormula (n + 2)) - (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) - (τ : (a.symmetricDomain s (M.nameDomain s) F).names) : - ∃ W ∈ M.sets, ∀ σ : (a.symmetricDomain s (M.nameDomain s) F).names, ∀ p, - (∃ r, Name.Entry σ.val τ.val r) → - (∃ ρ : (a.symmetricDomain s (M.nameDomain s) F).names, - Forces (a.symmetricDomain s (M.nameDomain s) F) φ (extend σ (extend ρ nameEnv)) p) → - ∃ ρ : (a.symmetricDomain s (M.nameDomain s) F).names, ρ.val.val ∈ W ∧ - Forces (a.symmetricDomain s (M.nameDomain s) F) φ (extend σ (extend ρ nameEnv)) p := by - let D := a.symmetricDomain s (M.nameDomain s) F - let context := extend s.carrier (extend s.conditionOrder (extend t.carrier (extend b.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) (fun i => (nameEnv i).val.val)))))) - let params : Fin 6 → Fin (n + 6) := extend 0 (extend 1 (extend 2 (extend 3 (extend 4 (extend 5 Fin.elim0))))) - have members : ∀ i, context i ∈ M.sets := - Fin.cases carrier (Fin.cases order (Fin.cases group (Fin.cases indices (Fin.cases supports - (Fin.cases maps (fun i => (nameEnv i).property.1)))))) - let selected := forcingWitnessFormula symmetricGroundPrimitives φ (fun j => (params j).succ.succ) - (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ) 0 1 - have correct : ∀ z ∈ M.sets, ∀ y ∈ M.sets, - Realize M.sets selected (extend z (extend y context)) ↔ - ∃ σ : D.names, ∃ p, z = ZFSet.pair σ.val.val (s.encode p) ∧ - ∃ ρ : D.names, ρ.val.val = y ∧ Forces D φ (extend σ (extend ρ nameEnv)) p := by - intro z hz y hy - apply M.realize_forcingWitnessFormula s D (fun _ h => h.1) pairing carrier order symmetricGroundPrimitives φ - (fun j => (params j).succ.succ) (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ) - 0 1 (extend z (extend y context)) rfl rfl _ _ nameEnv (fun _ => rfl) hz hy - · exact M.equalityMeaning_lifted s D (fun _ h => h.1) pairing unions powers separation collection - carrier order 0 1 _ rfl rfl - · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps 0 2 3 4 5 _ rfl rfl rfl rfl rfl - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers - (M.union_mem unions (M.union_mem unions τ.property.1)) carrier - obtain ⟨W, hW, witnesses⟩ := M.partialCollection_witness collection selected context members hB - refine ⟨W, hW, ?_⟩ - intro σ p entry possible - obtain ⟨r, entry⟩ := entry - have hb := pairBound σ.val.val (Name.child_mem_doubleUnion entry) (s.encode p) (s.encode_mem p) - have hz := M.transitive hB hb - have existsRaw : ∃ y ∈ M.sets, Realize M.sets selected - (extend (ZFSet.pair σ.val.val (s.encode p)) (extend y context)) := by - obtain ⟨ρ, forced⟩ := possible - exact ⟨ρ.val.val, ρ.property.1, (correct _ hz _ ρ.property.1).2 ⟨σ, p, rfl, ρ, rfl, forced⟩⟩ - obtain ⟨y, hy, rel⟩ := witnesses _ hb existsRaw - obtain ⟨ν, q, shape, ρ, eqρ, forced⟩ := (correct _ hz y (M.transitive hW hy)).1 rel - have parts := ZFSet.pair_inj.1 shape - have names : σ = ν := Subtype.ext (Subtype.ext parts.1) - have conditions : p = q := s.injective parts.2 - refine ⟨ρ, eqρ.symm ▸ hy, ?_⟩ - rwa [← names, ← conditions] at forced - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem symmetric_collection (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : - CollectionSchema ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := by - classical - let D := a.symmetricDomain s (M.nameDomain s) F - intro n φ params members X hX total - have reps := fun i => (D.mem_values _ (params i)).1 (members i) - choose names inDomain values using reps - let env : Assignment D n := fun i => ⟨names i, inDomain i⟩ - have evals : evalAssignment {p | H.mem p} env = params := funext values - obtain ⟨τ, hτ, rfl⟩ := (D.mem_values _ X).1 hX - obtain ⟨W, hW, bounds⟩ := M.symmetricForcingWitnessBound a s t b F K basis - pairing unions powers separation collection carrier order group indices supports maps φ env ⟨τ, hτ⟩ - have orbitM := M.orbitCodes_mem a s t pairing unions powers separation collection carrier group maps W hW - let C := Name.codedPower D (a.orbitCodes s (M.nameDomain s) W) - have groundC := M.symmetricCodedPower_mem a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps _ orbitM - have symC := a.orbitCodedPower_hs s (M.nameDomain s) F - (fun g σ hσ => M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ) W - have hC : C ∈ D.names := ⟨groundC, symC⟩ - refine ⟨Name.eval {p | H.mem p} C, (D.mem_values _ _).2 ⟨C, hC, rfl⟩, ?_⟩ - intro x hx member - obtain ⟨σ, r, entry, _, value⟩ := (Name.mem_eval _ τ x).1 member - have hσ := D.children hτ entry - obtain ⟨y, hy, rel⟩ := total x hx member - obtain ⟨ρ, hρ, valueρ⟩ := (D.mem_values _ y).1 hy - have truth : Realize (D.values {p | H.mem p}) φ - (evalAssignment {p | H.mem p} (extend ⟨σ, hσ⟩ (extend ⟨ρ, hρ⟩ env))) := by - rw [evalAssignment_extend, evalAssignment_extend, value, valueρ, evals] - exact rel - obtain ⟨p, hp, forced⟩ := (forcing_truth D H generic φ (extend ⟨σ, hσ⟩ (extend ⟨ρ, hρ⟩ env))).1 truth - obtain ⟨ν, νW, forcedν⟩ := bounds ⟨σ, hσ⟩ p ⟨r, entry⟩ ⟨⟨ρ, hρ⟩, forced⟩ - have orbitν := a.mem_orbitCodes_of_mem s (M.nameDomain s) ν.property.1 νW - have νC : Name.eval {p | H.mem p} ν.val ∈ Name.eval {p | H.mem p} C := - (Name.mem_eval_codedPower D _ H _).2 ⟨ν.val, ν.property, orbitν, rfl⟩ - have truthν := forces_sound D H generic φ (extend ⟨σ, hσ⟩ (extend ν env)) hp forcedν - rw [evalAssignment_extend, evalAssignment_extend, value, evals] at truthν - exact ⟨Name.eval {p | H.mem p} ν.val, (D.mem_values _ _).2 ⟨ν.val, ν.property, rfl⟩, νC, truthν⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ForcingWitnessFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMixtureTermBounds + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem symmetricForcingWitnessBound (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {n : Nat} (φ : SetFormula (n + 2)) + (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) + (τ : (a.symmetricDomain s (M.nameDomain s) F).names) : + ∃ W ∈ M.sets, ∀ σ : (a.symmetricDomain s (M.nameDomain s) F).names, ∀ p, + (∃ r, Name.Entry σ.val τ.val r) → + (∃ ρ : (a.symmetricDomain s (M.nameDomain s) F).names, + Forces (a.symmetricDomain s (M.nameDomain s) F) φ (extend σ (extend ρ nameEnv)) p) → + ∃ ρ : (a.symmetricDomain s (M.nameDomain s) F).names, ρ.val.val ∈ W ∧ + Forces (a.symmetricDomain s (M.nameDomain s) F) φ (extend σ (extend ρ nameEnv)) p := by + let D := a.symmetricDomain s (M.nameDomain s) F + let context := extend s.carrier (extend s.conditionOrder (extend t.carrier (extend b.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) (fun i => (nameEnv i).val.val)))))) + let params : Fin 6 → Fin (n + 6) := extend 0 (extend 1 (extend 2 (extend 3 (extend 4 (extend 5 Fin.elim0))))) + have members : ∀ i, context i ∈ M.sets := + Fin.cases carrier (Fin.cases order (Fin.cases group (Fin.cases indices (Fin.cases supports + (Fin.cases maps (fun i => (nameEnv i).property.1)))))) + let selected := forcingWitnessFormula symmetricGroundPrimitives φ (fun j => (params j).succ.succ) + (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ) 0 1 + have correct : ∀ z ∈ M.sets, ∀ y ∈ M.sets, + Realize M.sets selected (extend z (extend y context)) ↔ + ∃ σ : D.names, ∃ p, z = ZFSet.pair σ.val.val (s.encode p) ∧ + ∃ ρ : D.names, ρ.val.val = y ∧ Forces D φ (extend σ (extend ρ nameEnv)) p := by + intro z hz y hy + apply M.realize_forcingWitnessFormula s D (fun _ h => h.1) pairing carrier order symmetricGroundPrimitives φ + (fun j => (params j).succ.succ) (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ) + 0 1 (extend z (extend y context)) rfl rfl _ _ nameEnv (fun _ => rfl) hz hy + · exact M.equalityMeaning_lifted s D (fun _ h => h.1) pairing unions powers separation collection + carrier order 0 1 _ rfl rfl + · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps 0 2 3 4 5 _ rfl rfl rfl rfl rfl + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers + (M.union_mem unions (M.union_mem unions τ.property.1)) carrier + obtain ⟨W, hW, witnesses⟩ := M.partialCollection_witness collection selected context members hB + refine ⟨W, hW, ?_⟩ + intro σ p entry possible + obtain ⟨r, entry⟩ := entry + have hb := pairBound σ.val.val (Name.child_mem_doubleUnion entry) (s.encode p) (s.encode_mem p) + have hz := M.transitive hB hb + have existsRaw : ∃ y ∈ M.sets, Realize M.sets selected + (extend (ZFSet.pair σ.val.val (s.encode p)) (extend y context)) := by + obtain ⟨ρ, forced⟩ := possible + exact ⟨ρ.val.val, ρ.property.1, (correct _ hz _ ρ.property.1).2 ⟨σ, p, rfl, ρ, rfl, forced⟩⟩ + obtain ⟨y, hy, rel⟩ := witnesses _ hb existsRaw + obtain ⟨ν, q, shape, ρ, eqρ, forced⟩ := (correct _ hz y (M.transitive hW hy)).1 rel + have parts := ZFSet.pair_inj.1 shape + have names : σ = ν := Subtype.ext (Subtype.ext parts.1) + have conditions : p = q := s.injective parts.2 + refine ⟨ρ, eqρ.symm ▸ hy, ?_⟩ + rwa [← names, ← conditions] at forced + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem symmetric_collection (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : + CollectionSchema ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := by + classical + let D := a.symmetricDomain s (M.nameDomain s) F + intro n φ params members X hX total + have reps := fun i => (D.mem_values _ (params i)).1 (members i) + choose names inDomain values using reps + let env : Assignment D n := fun i => ⟨names i, inDomain i⟩ + have evals : evalAssignment {p | H.mem p} env = params := funext values + obtain ⟨τ, hτ, rfl⟩ := (D.mem_values _ X).1 hX + obtain ⟨W, hW, bounds⟩ := M.symmetricForcingWitnessBound a s t b F K basis + pairing unions powers separation collection carrier order group indices supports maps φ env ⟨τ, hτ⟩ + have orbitM := M.orbitCodes_mem a s t pairing unions powers separation collection carrier group maps W hW + let C := Name.codedPower D (a.orbitCodes s (M.nameDomain s) W) + have groundC := M.symmetricCodedPower_mem a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps _ orbitM + have symC := a.orbitCodedPower_hs s (M.nameDomain s) F + (fun g σ hσ => M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ) W + have hC : C ∈ D.names := ⟨groundC, symC⟩ + refine ⟨Name.eval {p | H.mem p} C, (D.mem_values _ _).2 ⟨C, hC, rfl⟩, ?_⟩ + intro x hx member + obtain ⟨σ, r, entry, _, value⟩ := (Name.mem_eval _ τ x).1 member + have hσ := D.children hτ entry + obtain ⟨y, hy, rel⟩ := total x hx member + obtain ⟨ρ, hρ, valueρ⟩ := (D.mem_values _ y).1 hy + have truth : Realize (D.values {p | H.mem p}) φ + (evalAssignment {p | H.mem p} (extend ⟨σ, hσ⟩ (extend ⟨ρ, hρ⟩ env))) := by + rw [evalAssignment_extend, evalAssignment_extend, value, valueρ, evals] + exact rel + obtain ⟨p, hp, forced⟩ := (forcing_truth D H generic φ (extend ⟨σ, hσ⟩ (extend ⟨ρ, hρ⟩ env))).1 truth + obtain ⟨ν, νW, forcedν⟩ := bounds ⟨σ, hσ⟩ p ⟨r, entry⟩ ⟨⟨ρ, hρ⟩, forced⟩ + have orbitν := a.mem_orbitCodes_of_mem s (M.nameDomain s) ν.property.1 νW + have νC : Name.eval {p | H.mem p} ν.val ∈ Name.eval {p | H.mem p} C := + (Name.mem_eval_codedPower D _ H _).2 ⟨ν.val, ν.property, orbitν, rfl⟩ + have truthν := forces_sound D H generic φ (extend ⟨σ, hσ⟩ (extend ν env)) hp forcedν + rw [evalAssignment_extend, evalAssignment_extend, value, evals] at truthν + exact ⟨Name.eval {p | H.mem p} ν.val, (D.mem_values _ _).2 ⟨ν.val, ν.property, rfl⟩, νC, truthν⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricPowerSet.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricPowerSet.lean index 618f998bcad4cbdcacc9dea4ac24c115ffc885c3..12ead19069fbc81c68a7c9089d353d98d0a111fb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricPowerSet.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundSymmetricPowerSet.lean @@ -1,180 +1,180 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundGraphValueDescendantWitnesses - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def codedPowerEntryFormula {k m : Nat} (N : SetFormula (k + 1)) - (params : Fin k → Fin m) (z W top : Fin m) : SetFormula m := - ex (.conj (.mem 0 W.succ) (.conj (domainApplication N (fun j => (params j).succ) 0) - (orderedPairFormula z.succ 0 top.succ))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] (s : Presentation P) - -theorem realize_codedPowerEntryFormula (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {k m : Nat} (N : SetFormula (k + 1)) (params : Fin k → Fin m) (zi wi ti : Fin m) - (env : Fin m → ZFSet.{u}) - (domain : M.DomainMeaning s D N (fun j => env (params j))) - (top : env ti = s.encode ⊤) (htop : env ti ∈ M.sets) (hz : env zi ∈ M.sets) : - Realize M.sets (codedPowerEntryFormula N params zi wi ti) env ↔ - env zi ∈ (Name.codedPower D (env wi)).val := by - rw [codedPowerEntryFormula, realize_ex] - constructor - · rintro ⟨x, hx, hW, name, shape⟩ - rw [realize_domainApplication] at name - obtain ⟨σ, rfl⟩ := (domain x hx).1 name - have eq := (M.realize_orderedPairFormula pairing zi.succ 0 ti.succ - (extend σ.val.val env) hz hx htop).1 shape - change env zi = ZFSet.pair σ.val.val (env ti) at eq - rw [eq, top] - exact (Name.entry_codedPower D (env wi) σ.val ⊤).2 ⟨σ.property, hW, rfl⟩ - · intro member - obtain ⟨σ, p, eq⟩ := Name.entries_cover (Name.codedPower D (env wi)) member - have entry : Name.Entry σ (Name.codedPower D (env wi)) p := by - change ZFSet.pair σ.val (s.encode p) ∈ (Name.codedPower D (env wi)).val - rwa [← eq] - obtain ⟨hσ, hW, rfl⟩ := (Name.entry_codedPower D (env wi) σ p).1 entry - refine ⟨σ.val, ground σ hσ, hW, ?_, ?_⟩ - · rw [realize_domainApplication] - exact (domain σ.val (ground σ hσ)).2 ⟨⟨σ, hσ⟩, rfl⟩ - · apply (M.realize_orderedPairFormula pairing zi.succ 0 ti.succ - (extend σ.val env) hz (ground σ hσ) htop).2 - change env zi = ZFSet.pair σ.val (env ti) - rwa [top] - -theorem codedPower_mem (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) - {k : Nat} (N : SetFormula (k + 1)) (params : Fin k → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) (domain : M.DomainMeaning s D N params) - (W : ZFSet.{u}) (hW : W ∈ M.sets) : (Name.codedPower D W).val ∈ M.sets := by - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW carrier - have bound : (Name.codedPower D W).val ⊆ B := by - intro z hz - obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.codedPower D W) hz - obtain ⟨_, hσ, _⟩ := (Name.entry_codedPower D W σ p).1 hz - exact pairBound σ.val hσ (s.encode p) (s.encode_mem p) - let formula := codedPowerEntryFormula N (fun j => j.succ.succ.succ) 0 1 2 - let context := extend W (extend (s.encode ⊤) params) - have htop := M.transitive carrier (s.encode_mem ⊤) - have correct : ∀ z ∈ M.sets, Realize M.sets formula (extend z context) ↔ - z ∈ (Name.codedPower D W).val := by - intro z hz - exact M.realize_codedPowerEntryFormula s D ground pairing N (fun j => j.succ.succ.succ) - 0 1 2 (extend z context) domain rfl htop hz - have selected := M.separation_mem separation formula context - (Fin.cases hW (Fin.cases htop members)) hB - have eq : ZFSet.sep (fun z => Realize M.sets formula (extend z context)) B = - (Name.codedPower D W).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (correct z (M.transitive hB hz)).1 rel - · intro hz - exact ⟨bound hz, (correct z (M.transitive hB (bound hz))).2 hz⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem symmetricEnvelope_mem (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (τ : (a.symmetricDomain s (M.nameDomain s) F).names) : (Name.envelope τ.val).val ∈ M.sets := by - rw [← Name.separationName_true _ τ.property] - exact M.symmetricSeparationName_mem a s t b F K basis pairing unions powers separation collection - carrier order group indices supports maps (.equal 0 0) Fin.elim0 τ - -theorem symmetricCodedPower_mem [OrderTop P] (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (W : ZFSet.{u}) (hW : W ∈ M.sets) : - (Name.codedPower (a.symmetricDomain s (M.nameDomain s) F) W).val ∈ M.sets := by - apply M.codedPower_mem s (a.symmetricDomain s (M.nameDomain s) F) (fun _ h => h.1) - pairing unions powers separation carrier (liftedHereditaryFormula 0 1 2 3 4) - (symmetryParameters a s t b K) _ _ W hW - · exact Fin.cases carrier (Fin.cases group (Fin.cases indices - (Fin.cases supports (Fin.cases maps (fun i => Fin.elim0 i))))) - · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps 0 1 2 3 4 _ rfl rfl rfl rfl rfl - -theorem symmetric_powerSet [OrderTop P] (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : - Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) powerSet Fin.elim0 := by - let D := a.symmetricDomain s (M.nameDomain s) F - have closed : ∀ g τ, τ ∈ (M.nameDomain s).names → a.act s g τ ∈ (M.nameDomain s).names := - fun g τ hτ => M.act_mem s a t pairing unions powers separation collection carrier maps g τ hτ - have moved : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names := - fun g _ hτ => a.symmetricDomain_translated s (M.nameDomain s) F closed g hτ - have separated : ∀ {n} (φ : SetFormula (n + 1)) (env : Assignment D n) τ, - τ ∈ D.names → Name.separationName D φ env τ ∈ D.names := by - intro n φ env τ hτ - exact ⟨M.symmetricSeparationName_mem a s t b F K basis pairing unions powers separation collection - carrier order group indices supports maps φ env ⟨τ, hτ⟩, - a.separationName_hs s D moved F φ env hτ.2 (fun i => (env i).property.2)⟩ - apply realize_powerSet_of_witnesses (D.values {p | H.mem p}) - (fun _ hx _ hz => D.values_transitive _ hx hz) - intro x hx - obtain ⟨τ, hτ, rfl⟩ := (Name.NameDomain.mem_values D _ x).1 hx - have envelopeM := M.symmetricEnvelope_mem a s t b F K basis pairing unions powers separation collection - carrier order group indices supports maps ⟨τ, hτ⟩ - obtain ⟨W, hW, subsets⟩ := M.power_witness powers envelopeM - have bounded : ∀ σ ∈ D.names, σ.val ∈ W ↔ σ.val ⊆ (Name.envelope τ).val := - fun σ hσ => subsets σ.val hσ.1 - have powerM := M.symmetricCodedPower_mem a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps W hW - have powerHS := a.codedPower_hs s (M.nameDomain s) F closed W (Name.envelope τ) - (a.envelope_hs s F hτ.2) bounded - refine ⟨Name.eval {p | H.mem p} (Name.codedPower D W), - (Name.NameDomain.mem_values D _ _).2 ⟨Name.codedPower D W, ⟨powerM, powerHS⟩, rfl⟩, ?_⟩ - intro z hz - exact Name.mem_eval_codedPower_iff D H generic separated ⟨τ, hτ⟩ W bounded z hz - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundGraphValueDescendantWitnesses + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def codedPowerEntryFormula {k m : Nat} (N : SetFormula (k + 1)) + (params : Fin k → Fin m) (z W top : Fin m) : SetFormula m := + ex (.conj (.mem 0 W.succ) (.conj (domainApplication N (fun j => (params j).succ) 0) + (orderedPairFormula z.succ 0 top.succ))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] (s : Presentation P) + +theorem realize_codedPowerEntryFormula (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {k m : Nat} (N : SetFormula (k + 1)) (params : Fin k → Fin m) (zi wi ti : Fin m) + (env : Fin m → ZFSet.{u}) + (domain : M.DomainMeaning s D N (fun j => env (params j))) + (top : env ti = s.encode ⊤) (htop : env ti ∈ M.sets) (hz : env zi ∈ M.sets) : + Realize M.sets (codedPowerEntryFormula N params zi wi ti) env ↔ + env zi ∈ (Name.codedPower D (env wi)).val := by + rw [codedPowerEntryFormula, realize_ex] + constructor + · rintro ⟨x, hx, hW, name, shape⟩ + rw [realize_domainApplication] at name + obtain ⟨σ, rfl⟩ := (domain x hx).1 name + have eq := (M.realize_orderedPairFormula pairing zi.succ 0 ti.succ + (extend σ.val.val env) hz hx htop).1 shape + change env zi = ZFSet.pair σ.val.val (env ti) at eq + rw [eq, top] + exact (Name.entry_codedPower D (env wi) σ.val ⊤).2 ⟨σ.property, hW, rfl⟩ + · intro member + obtain ⟨σ, p, eq⟩ := Name.entries_cover (Name.codedPower D (env wi)) member + have entry : Name.Entry σ (Name.codedPower D (env wi)) p := by + change ZFSet.pair σ.val (s.encode p) ∈ (Name.codedPower D (env wi)).val + rwa [← eq] + obtain ⟨hσ, hW, rfl⟩ := (Name.entry_codedPower D (env wi) σ p).1 entry + refine ⟨σ.val, ground σ hσ, hW, ?_, ?_⟩ + · rw [realize_domainApplication] + exact (domain σ.val (ground σ hσ)).2 ⟨⟨σ, hσ⟩, rfl⟩ + · apply (M.realize_orderedPairFormula pairing zi.succ 0 ti.succ + (extend σ.val env) hz (ground σ hσ) htop).2 + change env zi = ZFSet.pair σ.val (env ti) + rwa [top] + +theorem codedPower_mem (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) + {k : Nat} (N : SetFormula (k + 1)) (params : Fin k → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) (domain : M.DomainMeaning s D N params) + (W : ZFSet.{u}) (hW : W ∈ M.sets) : (Name.codedPower D W).val ∈ M.sets := by + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW carrier + have bound : (Name.codedPower D W).val ⊆ B := by + intro z hz + obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.codedPower D W) hz + obtain ⟨_, hσ, _⟩ := (Name.entry_codedPower D W σ p).1 hz + exact pairBound σ.val hσ (s.encode p) (s.encode_mem p) + let formula := codedPowerEntryFormula N (fun j => j.succ.succ.succ) 0 1 2 + let context := extend W (extend (s.encode ⊤) params) + have htop := M.transitive carrier (s.encode_mem ⊤) + have correct : ∀ z ∈ M.sets, Realize M.sets formula (extend z context) ↔ + z ∈ (Name.codedPower D W).val := by + intro z hz + exact M.realize_codedPowerEntryFormula s D ground pairing N (fun j => j.succ.succ.succ) + 0 1 2 (extend z context) domain rfl htop hz + have selected := M.separation_mem separation formula context + (Fin.cases hW (Fin.cases htop members)) hB + have eq : ZFSet.sep (fun z => Realize M.sets formula (extend z context)) B = + (Name.codedPower D W).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (correct z (M.transitive hB hz)).1 rel + · intro hz + exact ⟨bound hz, (correct z (M.transitive hB (bound hz))).2 hz⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem symmetricEnvelope_mem (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (τ : (a.symmetricDomain s (M.nameDomain s) F).names) : (Name.envelope τ.val).val ∈ M.sets := by + rw [← Name.separationName_true _ τ.property] + exact M.symmetricSeparationName_mem a s t b F K basis pairing unions powers separation collection + carrier order group indices supports maps (.equal 0 0) Fin.elim0 τ + +theorem symmetricCodedPower_mem [OrderTop P] (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (W : ZFSet.{u}) (hW : W ∈ M.sets) : + (Name.codedPower (a.symmetricDomain s (M.nameDomain s) F) W).val ∈ M.sets := by + apply M.codedPower_mem s (a.symmetricDomain s (M.nameDomain s) F) (fun _ h => h.1) + pairing unions powers separation carrier (liftedHereditaryFormula 0 1 2 3 4) + (symmetryParameters a s t b K) _ _ W hW + · exact Fin.cases carrier (Fin.cases group (Fin.cases indices + (Fin.cases supports (Fin.cases maps (fun i => Fin.elim0 i))))) + · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps 0 1 2 3 4 _ rfl rfl rfl rfl rfl + +theorem symmetric_powerSet [OrderTop P] (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : + Realize ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) powerSet Fin.elim0 := by + let D := a.symmetricDomain s (M.nameDomain s) F + have closed : ∀ g τ, τ ∈ (M.nameDomain s).names → a.act s g τ ∈ (M.nameDomain s).names := + fun g τ hτ => M.act_mem s a t pairing unions powers separation collection carrier maps g τ hτ + have moved : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names := + fun g _ hτ => a.symmetricDomain_translated s (M.nameDomain s) F closed g hτ + have separated : ∀ {n} (φ : SetFormula (n + 1)) (env : Assignment D n) τ, + τ ∈ D.names → Name.separationName D φ env τ ∈ D.names := by + intro n φ env τ hτ + exact ⟨M.symmetricSeparationName_mem a s t b F K basis pairing unions powers separation collection + carrier order group indices supports maps φ env ⟨τ, hτ⟩, + a.separationName_hs s D moved F φ env hτ.2 (fun i => (env i).property.2)⟩ + apply realize_powerSet_of_witnesses (D.values {p | H.mem p}) + (fun _ hx _ hz => D.values_transitive _ hx hz) + intro x hx + obtain ⟨τ, hτ, rfl⟩ := (Name.NameDomain.mem_values D _ x).1 hx + have envelopeM := M.symmetricEnvelope_mem a s t b F K basis pairing unions powers separation collection + carrier order group indices supports maps ⟨τ, hτ⟩ + obtain ⟨W, hW, subsets⟩ := M.power_witness powers envelopeM + have bounded : ∀ σ ∈ D.names, σ.val ∈ W ↔ σ.val ⊆ (Name.envelope τ).val := + fun σ hσ => subsets σ.val hσ.1 + have powerM := M.symmetricCodedPower_mem a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps W hW + have powerHS := a.codedPower_hs s (M.nameDomain s) F closed W (Name.envelope τ) + (a.envelope_hs s F hτ.2) bounded + refine ⟨Name.eval {p | H.mem p} (Name.codedPower D W), + (Name.NameDomain.mem_values D _ _).2 ⟨Name.codedPower D W, ⟨powerM, powerHS⟩, rfl⟩, ?_⟩ + intro z hz + exact Name.mem_eval_codedPower_iff D H generic separated ⟨τ, hτ⟩ W bounded z hz + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTaskBearingSuccessorWitness.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTaskBearingSuccessorWitness.lean index b7b1f8ee67b38534e983bec1efa5c1b83c5a95a9..b0327e8cdea631be4a2296d5137fdab7b8fc0848 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTaskBearingSuccessorWitness.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTaskBearingSuccessorWitness.lean @@ -1,104 +1,104 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainBoundTaskOutput -import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source : GroundLinkedMainStage M K Labels C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source.main Labels) - -theorem exists_taskBearingLinkedTarget - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) - (serial : GroundSerializedChronology M (insert certificate.target.cutoff certificate.target.cutoff) C D rD) - (agreement : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → - serial.fields.value j s = certificate.target.history.fieldValue j s) - (invariant : certificate.target.Invariant K Labels) - (rank : ZFSet.rank serial.code < ZFSet.rank K) : - ∃ target : GroundLinkedMainStage M K Labels C D rD, - target.main = certificate.target ∧ - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source.code target.code - certificate.transition.map.code := by - let target : GroundLinkedMainStage M K Labels C D rD := - ⟨certificate.target, serial, agreement, invariant, rank⟩ - let extra : Fin 8 → ZFSet.{u} := - fun j => certificate.successorOutputValues (Fin.natAdd 21 (j.castAdd 1)) - let maps : Fin 4 → ZFSet.{u} := Fin.cases certificate.transition.map.points - (Fin.cases certificate.transition.map.actors - (Fin.cases source.main.birth (fun _ => certificate.target.birth))) - let fields : Fin 60 → ZFSet.{u} := - Fin.addCases (m := 24) (n := 36) source.rawFields - (Fin.addCases (m := 24) (n := 12) target.rawFields - (Fin.addCases (m := 4) (n := 8) maps extra)) - have extraGround : ∀ j, extra j ∈ M.sets := fun j => - certificate.successorOutputValues_ground pairing unions powers separation infinite hLabels _ - have mapsGround : ∀ j, maps j ∈ M.sets := - Fin.cases certificate.transition.map.points_ground - (Fin.cases certificate.transition.map.actors_ground - (Fin.cases source.main.birth_ground (fun _ => certificate.target.birth_ground))) - have ground : ∀ j, fields j ∈ M.sets := by - intro j - refine Fin.addCases (m := 24) (n := 36) ?_ ?_ j - · intro a - simpa only [fields, Fin.addCases_left] using source.rawFields_ground pairing a - · intro a - refine Fin.addCases (m := 24) (n := 12) ?_ ?_ a - · intro b - simpa only [fields, Fin.addCases_right, Fin.addCases_left] using target.rawFields_ground pairing b - · intro b - refine Fin.addCases (m := 4) (n := 8) ?_ ?_ b - · intro c - simpa only [fields, Fin.addCases_right, Fin.addCases_left] using mapsGround c - · intro c - simpa only [fields, Fin.addCases_right] using extraGround c - have sourceFields : (fun j : Fin 24 => fields (j.castAdd 36)) = source.rawFields := by - funext j - simp only [fields, Fin.addCases_left] - have targetFields : (fun j : Fin 24 => fields (Fin.natAdd 24 (j.castAdd 12))) = target.rawFields := by - funext j - simp only [fields, Fin.addCases_right, Fin.addCases_left] - have taskFields : (fun j : Fin 8 => fields (Fin.natAdd 52 j)) = extra := by - funext j - have index : Fin.natAdd 52 j = Fin.natAdd 24 (Fin.natAdd 24 (Fin.natAdd 4 j)) := by - apply Fin.ext - change 52 + j.val = 24 + (24 + (4 + j.val)) - simp only [← Nat.add_assoc] - rw [index] - simp only [fields, Fin.addCases_right] - have outputs : linkedSuccessorOutputFields source.rawFields target.rawFields - certificate.transition.map.points certificate.transition.map.actors extra = - certificate.successorOutputValues := by - obtain ⟨s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10⟩ := source.rawFields_stage_projections - obtain ⟨t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10⟩ := target.rawFields_stage_projections - obtain ⟨o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18, o19, o20, o21, o22, o23, o24, o25, o26, o27, o28, o29⟩ := - certificate.successorOutputValues_projections - apply linkedSuccessorOutputFields_eq - exact ⟨ - s0.trans o0.symm, t0.trans o1.symm, s1.trans o2.symm, t1.trans o3.symm, - s2.trans o4.symm, t2.trans o5.symm, s3.trans o6.symm, t3.trans o7.symm, - s4.trans o8.symm, t4.trans o9.symm, s6.trans o10.symm, t6.trans o11.symm, - s7.trans o12.symm, t7.trans o13.symm, s8.trans o14.symm, t8.trans o15.symm, - s10.trans o16.symm, t10.trans o17.symm, o18.symm, o19.symm, - s9.trans o20.symm, rfl, rfl, rfl, - rfl, rfl, rfl, rfl, - rfl, t9.trans o29.symm⟩ - refine ⟨target, rfl, fields, ground, ?_⟩ - rw [sourceFields, targetFields, taskFields] - change TaskBearingMainSuccessorRawCode M K Labels C D rD ZFSet.omega source.code target.code - certificate.transition.map.code certificate.transition.map.points certificate.transition.map.actors - source.main.birth certificate.target.birth source.rawFields target.rawFields extra - refine ⟨source.transition_rawFields target certificate.transition certificate.coversOldBirths, - certificate.cutoff_strict, ?_⟩ - rw [outputs] - exact certificate.boundSuccessorOutput pairing unions powers separation infinite hLabels - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainBoundTaskOutput +import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source : GroundLinkedMainStage M K Labels C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source.main Labels) + +theorem exists_taskBearingLinkedTarget + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) + (serial : GroundSerializedChronology M (insert certificate.target.cutoff certificate.target.cutoff) C D rD) + (agreement : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → + serial.fields.value j s = certificate.target.history.fieldValue j s) + (invariant : certificate.target.Invariant K Labels) + (rank : ZFSet.rank serial.code < ZFSet.rank K) : + ∃ target : GroundLinkedMainStage M K Labels C D rD, + target.main = certificate.target ∧ + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source.code target.code + certificate.transition.map.code := by + let target : GroundLinkedMainStage M K Labels C D rD := + ⟨certificate.target, serial, agreement, invariant, rank⟩ + let extra : Fin 8 → ZFSet.{u} := + fun j => certificate.successorOutputValues (Fin.natAdd 21 (j.castAdd 1)) + let maps : Fin 4 → ZFSet.{u} := Fin.cases certificate.transition.map.points + (Fin.cases certificate.transition.map.actors + (Fin.cases source.main.birth (fun _ => certificate.target.birth))) + let fields : Fin 60 → ZFSet.{u} := + Fin.addCases (m := 24) (n := 36) source.rawFields + (Fin.addCases (m := 24) (n := 12) target.rawFields + (Fin.addCases (m := 4) (n := 8) maps extra)) + have extraGround : ∀ j, extra j ∈ M.sets := fun j => + certificate.successorOutputValues_ground pairing unions powers separation infinite hLabels _ + have mapsGround : ∀ j, maps j ∈ M.sets := + Fin.cases certificate.transition.map.points_ground + (Fin.cases certificate.transition.map.actors_ground + (Fin.cases source.main.birth_ground (fun _ => certificate.target.birth_ground))) + have ground : ∀ j, fields j ∈ M.sets := by + intro j + refine Fin.addCases (m := 24) (n := 36) ?_ ?_ j + · intro a + simpa only [fields, Fin.addCases_left] using source.rawFields_ground pairing a + · intro a + refine Fin.addCases (m := 24) (n := 12) ?_ ?_ a + · intro b + simpa only [fields, Fin.addCases_right, Fin.addCases_left] using target.rawFields_ground pairing b + · intro b + refine Fin.addCases (m := 4) (n := 8) ?_ ?_ b + · intro c + simpa only [fields, Fin.addCases_right, Fin.addCases_left] using mapsGround c + · intro c + simpa only [fields, Fin.addCases_right] using extraGround c + have sourceFields : (fun j : Fin 24 => fields (j.castAdd 36)) = source.rawFields := by + funext j + simp only [fields, Fin.addCases_left] + have targetFields : (fun j : Fin 24 => fields (Fin.natAdd 24 (j.castAdd 12))) = target.rawFields := by + funext j + simp only [fields, Fin.addCases_right, Fin.addCases_left] + have taskFields : (fun j : Fin 8 => fields (Fin.natAdd 52 j)) = extra := by + funext j + have index : Fin.natAdd 52 j = Fin.natAdd 24 (Fin.natAdd 24 (Fin.natAdd 4 j)) := by + apply Fin.ext + change 52 + j.val = 24 + (24 + (4 + j.val)) + simp only [← Nat.add_assoc] + rw [index] + simp only [fields, Fin.addCases_right] + have outputs : linkedSuccessorOutputFields source.rawFields target.rawFields + certificate.transition.map.points certificate.transition.map.actors extra = + certificate.successorOutputValues := by + obtain ⟨s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10⟩ := source.rawFields_stage_projections + obtain ⟨t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10⟩ := target.rawFields_stage_projections + obtain ⟨o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18, o19, o20, o21, o22, o23, o24, o25, o26, o27, o28, o29⟩ := + certificate.successorOutputValues_projections + apply linkedSuccessorOutputFields_eq + exact ⟨ + s0.trans o0.symm, t0.trans o1.symm, s1.trans o2.symm, t1.trans o3.symm, + s2.trans o4.symm, t2.trans o5.symm, s3.trans o6.symm, t3.trans o7.symm, + s4.trans o8.symm, t4.trans o9.symm, s6.trans o10.symm, t6.trans o11.symm, + s7.trans o12.symm, t7.trans o13.symm, s8.trans o14.symm, t8.trans o15.symm, + s10.trans o16.symm, t10.trans o17.symm, o18.symm, o19.symm, + s9.trans o20.symm, rfl, rfl, rfl, + rfl, rfl, rfl, rfl, + rfl, t9.trans o29.symm⟩ + refine ⟨target, rfl, fields, ground, ?_⟩ + rw [sourceFields, targetFields, taskFields] + change TaskBearingMainSuccessorRawCode M K Labels C D rD ZFSet.omega source.code target.code + certificate.transition.map.code certificate.transition.map.points certificate.transition.map.actors + source.main.birth certificate.target.birth source.rawFields target.rawFields extra + refine ⟨source.transition_rawFields target certificate.transition certificate.coversOldBirths, + certificate.cutoff_strict, ?_⟩ + rw [outputs] + exact certificate.boundSuccessorOutput pairing unions powers separation infinite hLabels + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTestedMeetFilters.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTestedMeetFilters.lean index 85c3d4ee17458791ce0d571eaf76074858e46d64..ac68b8a5b677e87647b21e6f5c62c79bfd1bf5fe 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTestedMeetFilters.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundTestedMeetFilters.lean @@ -1,310 +1,310 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMeetGeneratorSteps -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def groundMeetFilters (P r μ : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (MeetFilterCode P r μ) (M.groundPower P) - -theorem mem_groundMeetFilters (P r μ F : ZFSet.{u}) : - F ∈ M.groundMeetFilters P r μ ↔ F ∈ M.sets ∧ MeetFilterCode P r μ F := by - rw [groundMeetFilters, ZFSet.mem_sep, M.mem_groundPower] - exact ⟨fun h => ⟨h.1.1, h.2⟩, fun h => ⟨⟨h.1, h.2.subset⟩, h.2⟩⟩ - -theorem groundMeetFilters_mem (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) - {P r μ : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (meet : MeetOrderCode P r μ) : M.groundMeetFilters P r μ ∈ M.sets := by - let params := extend P (extend r (extend μ Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.meetFilterFormula 1 2 3 0) params - (Fin.cases hP (Fin.cases hr (Fin.cases hμ (fun i => Fin.elim0 i)))) - (M.groundPower_mem powers hP) - have equal : ZFSet.sep (fun F => BoundedFormula.Truth - (BoundedFormula.meetFilterFormula 1 2 3 0) (extend F params)) (M.groundPower P) = - M.groundMeetFilters P r μ := by - apply ZFSet.ext - intro F - rw [ZFSet.mem_sep, groundMeetFilters, ZFSet.mem_sep] - exact and_congr_right (fun _ => - BoundedFormula.truth_meetFilterFormula 1 2 3 0 (extend F params) meet) - exact equal ▸ selected - -end TransitiveGround - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def generatedMeetFilter (P r μ A : ZFSet.{u}) : ZFSet.{u} := - relationImage (relationImage A P (M.finitePathClosure P (meetGeneratorSteps P μ A))) P r - -theorem mem_generatedMeetFilter {P r μ A : ZFSet.{u}} (subset : A ⊆ P) (x : ZFSet.{u}) : - x ∈ M.generatedMeetFilter P r μ A ↔ - x ∈ P ∧ ∃ a ∈ A, ∃ b ∈ P, ∃ t ∈ M.finiteWords P, - FiniteRelationPathCode ZFSet.omega P (meetGeneratorSteps P μ A) a b t ∧ - ZFSet.pair b x ∈ r := by - rw [generatedMeetFilter, mem_relationImage] - constructor - · rintro ⟨hx, b, hb, lower⟩ - obtain ⟨hbP, a, ha, path⟩ := (mem_relationImage _ _ _ b).1 hb - obtain ⟨_, _, t, ht, code⟩ := (M.pair_mem_finitePathClosure_iff _ _ a b).1 path - exact ⟨hx, a, ha, b, hbP, t, ht, code, lower⟩ - · rintro ⟨hx, a, ha, b, hb, t, ht, code, lower⟩ - exact ⟨hx, b, (mem_relationImage _ _ _ b).2 ⟨hb, a, ha, - (M.pair_mem_finitePathClosure_iff _ _ a b).2 ⟨subset ha, hb, t, ht, code⟩⟩, lower⟩ - -theorem generatedMeetFilter_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {P r μ A : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) - (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) : M.generatedMeetFilter P r μ A ∈ M.sets := - M.relationImage_mem separation - (M.relationImage_mem separation hA hP - (M.finitePathClosure_mem pairing unions powers separation infinite hP - (M.meetGeneratorSteps_mem pairing unions powers separation hP hμ hA))) hP hr - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -include pairing unions separation infinite - -theorem generatedMeetFilter_small_iff {P r μ A : ZFSet.{u}} - (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) (x : SetMembers P) : - SetMembers.raw x ∈ M.generatedMeetFilter P r μ A ↔ - generatedMeetPredicate code.toSmallMeetOrder (fun a => SetMembers.raw a ∈ A) x := by - have paths := M.pair_mem_finitePathClosure pairing unions separation infinite - (SetMembers.presentation P) (meetGeneratorStep code.toSmallMeetOrder - (fun a => SetMembers.raw a ∈ A)) (code.meetGeneratorSteps_iff subset) hP - rw [generatedMeetFilter, mem_relationImage] - constructor - · rintro ⟨_, b, hb, lower⟩ - obtain ⟨hbP, a, ha, path⟩ := (mem_relationImage _ _ _ b).1 hb - let a' := SetMembers.ofMem a (subset ha) - let b' := SetMembers.ofMem b hbP - have path' : ZFSet.pair (SetMembers.raw a') (SetMembers.raw b') ∈ - M.finitePathClosure P (meetGeneratorSteps P μ A) := by - simpa only [a', b', SetMembers.raw_ofMem] using path - refine ⟨a', ?_, b', (paths a' b').1 path', ?_⟩ - · simpa only [a', SetMembers.raw_ofMem] using ha - · change ZFSet.pair (SetMembers.raw b') (SetMembers.raw x) ∈ r - simpa only [b', SetMembers.raw_ofMem] using lower - · rintro ⟨a, ha, b, path, lower⟩ - exact ⟨SetMembers.raw_mem x, SetMembers.raw b, - (mem_relationImage _ _ _ _).2 ⟨SetMembers.raw_mem b, SetMembers.raw a, ha, - (paths a b).2 path⟩, lower⟩ - -theorem generatedMeetFilter_contains {P r μ A : ZFSet.{u}} - (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) : - A ⊆ M.generatedMeetFilter P r μ A := by - intro x hx - have member := (M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset - (SetMembers.ofMem x (subset hx))).2 - (generatedMeetPredicate_contains code.toSmallMeetOrder _ - (by simpa only [SetMembers.raw_ofMem] using hx)) - simpa only [SetMembers.raw_ofMem] using member - -theorem generatedMeetFilter_filter {P r μ A : ZFSet.{u}} - (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) (nonempty : A.Nonempty) : - MeetFilterCode P r μ (M.generatedMeetFilter P r μ A) := by - have exactMem := M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset - have typedNonempty : ∃ a : SetMembers P, SetMembers.raw a ∈ A := by - obtain ⟨a, ha⟩ := nonempty - exact ⟨SetMembers.ofMem a (subset ha), by - simpa only [SetMembers.raw_ofMem] using (show a ∈ A from ha)⟩ - let typed := PartitionPilot.generatedMeetFilter code.toSmallMeetOrder - (fun a => SetMembers.raw a ∈ A) typedNonempty - have bounded : M.generatedMeetFilter P r μ A ⊆ P := - fun x hx => ((mem_relationImage _ _ _ x).1 hx).1 - refine ⟨bounded, ?_, ?_, ?_⟩ - · obtain ⟨a, ha⟩ := nonempty - exact ⟨a, M.generatedMeetFilter_contains pairing unions separation infinite hP code subset ha⟩ - · intro x hx y hy lower - let x' := SetMembers.ofMem x (bounded hx) - let y' := SetMembers.ofMem y hy - have hx' : typed.mem x' := (exactMem x').1 (by simpa only [x', SetMembers.raw_ofMem] using hx) - have lower' : code.toSmallMeetOrder.le x' y' := by - change ZFSet.pair (SetMembers.raw x') (SetMembers.raw y') ∈ r - simpa only [x', y', SetMembers.raw_ofMem] using lower - have member := (exactMem y').2 (typed.upward hx' lower') - simpa only [y', SetMembers.raw_ofMem] using member - · intro x hx y hy z entry - have hz := (ZFSet.pair_mem_prod.1 (code.operation.1 entry)).2 - let x' := SetMembers.ofMem x (bounded hx) - let y' := SetMembers.ofMem y (bounded hy) - let z' := SetMembers.ofMem z hz - have hx' : typed.mem x' := (exactMem x').1 (by simpa only [x', SetMembers.raw_ofMem] using hx) - have hy' : typed.mem y' := (exactMem y').1 (by simpa only [y', SetMembers.raw_ofMem] using hy) - have equal : code.toSmallMeetOrder.meet x' y' = z' := - (code.toSmallMeetOrder_meet_eq_iff x' y' z').2 - (by simpa only [x', y', z', SetMembers.raw_ofMem] using entry) - have member := (exactMem z').2 (equal ▸ typed.closed_meet hx' hy') - simpa only [z', SetMembers.raw_ofMem] using member - -theorem generatedMeetFilter_least {P r μ A F : ZFSet.{u}} - (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) - (filter : MeetFilterCode P r μ F) (contains : A ⊆ F) : - M.generatedMeetFilter P r μ A ⊆ F := by - let typed : Compression.MeetFilter code.toSmallMeetOrder := { - mem := fun x => SetMembers.raw x ∈ F - nonempty := by - obtain ⟨x, hx⟩ := filter.nonempty - exact ⟨SetMembers.ofMem x (filter.subset hx), by - simpa only [SetMembers.raw_ofMem] using (show x ∈ F from hx)⟩ - upward := fun {x y} hx lower => filter.upward _ hx _ (SetMembers.raw_mem y) lower - closed_meet := fun {x y} hx hy => filter.closed_meet _ hx _ hy _ (code.smallMeet_entry x y) } - intro x hx - have hxP := ((mem_relationImage _ _ _ x).1 hx).1 - let x' := SetMembers.ofMem x hxP - have predicate := (M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset x').1 - (by simpa only [x', SetMembers.raw_ofMem] using hx) - have member := generatedMeetPredicate_least code.toSmallMeetOrder _ typed - (fun a ha => contains ha) predicate - simpa only [typed, x', SetMembers.raw_ofMem] using member - -theorem generatedMeetFilter_lower_bound {P r μ A e : ZFSet.{u}} - (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) - (he : e ∈ P) (above : ∀ a ∈ A, ZFSet.pair e a ∈ r) : - ∀ x ∈ M.generatedMeetFilter P r μ A, ZFSet.pair e x ∈ r := by - intro x hx - have hxP := ((mem_relationImage _ _ _ x).1 hx).1 - let x' := SetMembers.ofMem x hxP - let e' := SetMembers.ofMem e he - have predicate := (M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset x').1 - (by simpa only [x', SetMembers.raw_ofMem] using hx) - have lower := generatedMeetPredicate_lower_bound code.toSmallMeetOrder _ e' - (fun a ha => by - change ZFSet.pair (SetMembers.raw e') (SetMembers.raw a) ∈ r - simpa only [e', SetMembers.raw_ofMem] using above _ ha) predicate - change ZFSet.pair (SetMembers.raw e') (SetMembers.raw x') ∈ r at lower - simpa only [e', x', SetMembers.raw_ofMem] using lower - -end TransitiveGround - -section -open SetFormula -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem generatedMeetFilter_eq_of_coinitial - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {P r μ B F : ZFSet.{u}} (hP : P ∈ M.sets) (meet : MeetOrderCode P r μ) - (filter : MeetFilterCode P r μ F) (subset : B ⊆ F) - (coinitial : ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ r) : - M.generatedMeetFilter P r μ B = F := by - have bounded : B ⊆ P := fun _ hx => filter.subset (subset hx) - have nonempty : B.Nonempty := by - obtain ⟨x, hx⟩ := filter.nonempty - obtain ⟨b, hb, _⟩ := coinitial x hx - exact ⟨b, hb⟩ - have generated := M.generatedMeetFilter_filter pairing unions separation infinite hP meet bounded nonempty - have contains := M.generatedMeetFilter_contains pairing unions separation infinite hP meet bounded - have least := M.generatedMeetFilter_least pairing unions separation infinite hP meet bounded filter subset - apply ZFSet.ext - intro x - refine ⟨fun hx => least hx, ?_⟩ - intro hx - obtain ⟨b, hb, lower⟩ := coinitial x hx - exact generated.upward b (contains hb) x (filter.subset hx) lower - -end TransitiveGround - -namespace GroundSequenceReflection -variable {M N : TransitiveGround.{u}} {P : ZFSet.{u}} -variable (reflection : GroundSequenceReflection M N P) -include reflection - -theorem coinitial_filter - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets infinity Fin.elim0) - {r μ B F : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (meet : MeetOrderCode P r μ) (hB : B ∈ N.sets) - (small : N.groundEmbeddable B ZFSet.omega) - (filter : MeetFilterCode P r μ F) (subset : B ⊆ F) - (coinitial : ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ r) : - B ∈ M.sets ∧ M.groundEmbeddable B ZFSet.omega ∧ - M.generatedMeetFilter P r μ B = F ∧ F ∈ M.sets := by - obtain ⟨ground, countable⟩ := reflection.countable_subset pairing unions powers separation infinite choice - pairingN unionsN powersN separationN infiniteN hP hB - (fun _ hb => filter.subset (subset hb)) small - have equal := M.generatedMeetFilter_eq_of_coinitial pairing unions separation infinite - hP meet filter subset coinitial - have generatedGround := M.generatedMeetFilter_mem pairing unions powers separation infinite hP hr hμ ground - exact ⟨ground, countable, equal, equal ▸ generatedGround⟩ - -end GroundSequenceReflection -end - -universe u - -noncomputable def testedMeetFilter (F r e : ZFSet.{u}) : ZFSet.{u} := - relationImage {e} F r - -theorem mem_testedMeetFilter (F r e x : ZFSet.{u}) : - x ∈ testedMeetFilter F r e ↔ x ∈ F ∧ ZFSet.pair e x ∈ r := by - rw [testedMeetFilter, mem_relationImage] - constructor - · rintro ⟨hx, a, ha, edge⟩ - exact ⟨hx, (ZFSet.mem_singleton.1 ha) ▸ edge⟩ - · rintro ⟨hx, edge⟩ - exact ⟨hx, e, ZFSet.mem_singleton.2 rfl, edge⟩ - -theorem testedMeetFilter_filter {L r meet F e : ZFSet.{u}} - (code : MeetOrderCode L r meet) (filter : MeetFilterCode L r meet F) - (he : e ∈ L) - (directed : ∀ x ∈ L, ∀ y ∈ L, ∃ z ∈ L, ZFSet.pair x z ∈ r ∧ ZFSet.pair y z ∈ r) : - MeetFilterCode L r meet (testedMeetFilter F r e) := by - refine ⟨fun x hx => filter.subset ((mem_testedMeetFilter F r e x).1 hx).1, ?_, ?_, ?_⟩ - · obtain ⟨x, hx⟩ := filter.nonempty - obtain ⟨z, hz, xz, ez⟩ := directed x (filter.subset hx) e he - exact ⟨z, (mem_testedMeetFilter F r e z).2 ⟨filter.upward x hx z hz xz, ez⟩⟩ - · intro x hx y hy xy - have parts := (mem_testedMeetFilter F r e x).1 hx - exact (mem_testedMeetFilter F r e y).2 - ⟨filter.upward x parts.1 y hy xy, code.order.trans e he x (filter.subset parts.1) y hy parts.2 xy⟩ - · intro x hx y hy z entry - have px := (mem_testedMeetFilter F r e x).1 hx - have py := (mem_testedMeetFilter F r e y).1 hy - exact (mem_testedMeetFilter F r e z).2 - ⟨filter.closed_meet x px.1 y py.1 z entry, code.greatest x y z e he entry px.2 py.2⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem testedMeetFilter_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (separation : SeparationSchema M.sets) - {F r e : ZFSet.{u}} (hF : F ∈ M.sets) (hr : r ∈ M.sets) (he : e ∈ M.sets) : - testedMeetFilter F r e ∈ M.sets := - M.relationImage_mem separation - (by simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing he he) hF hr - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMeetGeneratorSteps +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def groundMeetFilters (P r μ : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (MeetFilterCode P r μ) (M.groundPower P) + +theorem mem_groundMeetFilters (P r μ F : ZFSet.{u}) : + F ∈ M.groundMeetFilters P r μ ↔ F ∈ M.sets ∧ MeetFilterCode P r μ F := by + rw [groundMeetFilters, ZFSet.mem_sep, M.mem_groundPower] + exact ⟨fun h => ⟨h.1.1, h.2⟩, fun h => ⟨⟨h.1, h.2.subset⟩, h.2⟩⟩ + +theorem groundMeetFilters_mem (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) + {P r μ : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (meet : MeetOrderCode P r μ) : M.groundMeetFilters P r μ ∈ M.sets := by + let params := extend P (extend r (extend μ Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.meetFilterFormula 1 2 3 0) params + (Fin.cases hP (Fin.cases hr (Fin.cases hμ (fun i => Fin.elim0 i)))) + (M.groundPower_mem powers hP) + have equal : ZFSet.sep (fun F => BoundedFormula.Truth + (BoundedFormula.meetFilterFormula 1 2 3 0) (extend F params)) (M.groundPower P) = + M.groundMeetFilters P r μ := by + apply ZFSet.ext + intro F + rw [ZFSet.mem_sep, groundMeetFilters, ZFSet.mem_sep] + exact and_congr_right (fun _ => + BoundedFormula.truth_meetFilterFormula 1 2 3 0 (extend F params) meet) + exact equal ▸ selected + +end TransitiveGround + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def generatedMeetFilter (P r μ A : ZFSet.{u}) : ZFSet.{u} := + relationImage (relationImage A P (M.finitePathClosure P (meetGeneratorSteps P μ A))) P r + +theorem mem_generatedMeetFilter {P r μ A : ZFSet.{u}} (subset : A ⊆ P) (x : ZFSet.{u}) : + x ∈ M.generatedMeetFilter P r μ A ↔ + x ∈ P ∧ ∃ a ∈ A, ∃ b ∈ P, ∃ t ∈ M.finiteWords P, + FiniteRelationPathCode ZFSet.omega P (meetGeneratorSteps P μ A) a b t ∧ + ZFSet.pair b x ∈ r := by + rw [generatedMeetFilter, mem_relationImage] + constructor + · rintro ⟨hx, b, hb, lower⟩ + obtain ⟨hbP, a, ha, path⟩ := (mem_relationImage _ _ _ b).1 hb + obtain ⟨_, _, t, ht, code⟩ := (M.pair_mem_finitePathClosure_iff _ _ a b).1 path + exact ⟨hx, a, ha, b, hbP, t, ht, code, lower⟩ + · rintro ⟨hx, a, ha, b, hb, t, ht, code, lower⟩ + exact ⟨hx, b, (mem_relationImage _ _ _ b).2 ⟨hb, a, ha, + (M.pair_mem_finitePathClosure_iff _ _ a b).2 ⟨subset ha, hb, t, ht, code⟩⟩, lower⟩ + +theorem generatedMeetFilter_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {P r μ A : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) + (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) : M.generatedMeetFilter P r μ A ∈ M.sets := + M.relationImage_mem separation + (M.relationImage_mem separation hA hP + (M.finitePathClosure_mem pairing unions powers separation infinite hP + (M.meetGeneratorSteps_mem pairing unions powers separation hP hμ hA))) hP hr + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +include pairing unions separation infinite + +theorem generatedMeetFilter_small_iff {P r μ A : ZFSet.{u}} + (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) (x : SetMembers P) : + SetMembers.raw x ∈ M.generatedMeetFilter P r μ A ↔ + generatedMeetPredicate code.toSmallMeetOrder (fun a => SetMembers.raw a ∈ A) x := by + have paths := M.pair_mem_finitePathClosure pairing unions separation infinite + (SetMembers.presentation P) (meetGeneratorStep code.toSmallMeetOrder + (fun a => SetMembers.raw a ∈ A)) (code.meetGeneratorSteps_iff subset) hP + rw [generatedMeetFilter, mem_relationImage] + constructor + · rintro ⟨_, b, hb, lower⟩ + obtain ⟨hbP, a, ha, path⟩ := (mem_relationImage _ _ _ b).1 hb + let a' := SetMembers.ofMem a (subset ha) + let b' := SetMembers.ofMem b hbP + have path' : ZFSet.pair (SetMembers.raw a') (SetMembers.raw b') ∈ + M.finitePathClosure P (meetGeneratorSteps P μ A) := by + simpa only [a', b', SetMembers.raw_ofMem] using path + refine ⟨a', ?_, b', (paths a' b').1 path', ?_⟩ + · simpa only [a', SetMembers.raw_ofMem] using ha + · change ZFSet.pair (SetMembers.raw b') (SetMembers.raw x) ∈ r + simpa only [b', SetMembers.raw_ofMem] using lower + · rintro ⟨a, ha, b, path, lower⟩ + exact ⟨SetMembers.raw_mem x, SetMembers.raw b, + (mem_relationImage _ _ _ _).2 ⟨SetMembers.raw_mem b, SetMembers.raw a, ha, + (paths a b).2 path⟩, lower⟩ + +theorem generatedMeetFilter_contains {P r μ A : ZFSet.{u}} + (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) : + A ⊆ M.generatedMeetFilter P r μ A := by + intro x hx + have member := (M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset + (SetMembers.ofMem x (subset hx))).2 + (generatedMeetPredicate_contains code.toSmallMeetOrder _ + (by simpa only [SetMembers.raw_ofMem] using hx)) + simpa only [SetMembers.raw_ofMem] using member + +theorem generatedMeetFilter_filter {P r μ A : ZFSet.{u}} + (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) (nonempty : A.Nonempty) : + MeetFilterCode P r μ (M.generatedMeetFilter P r μ A) := by + have exactMem := M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset + have typedNonempty : ∃ a : SetMembers P, SetMembers.raw a ∈ A := by + obtain ⟨a, ha⟩ := nonempty + exact ⟨SetMembers.ofMem a (subset ha), by + simpa only [SetMembers.raw_ofMem] using (show a ∈ A from ha)⟩ + let typed := PartitionPilot.generatedMeetFilter code.toSmallMeetOrder + (fun a => SetMembers.raw a ∈ A) typedNonempty + have bounded : M.generatedMeetFilter P r μ A ⊆ P := + fun x hx => ((mem_relationImage _ _ _ x).1 hx).1 + refine ⟨bounded, ?_, ?_, ?_⟩ + · obtain ⟨a, ha⟩ := nonempty + exact ⟨a, M.generatedMeetFilter_contains pairing unions separation infinite hP code subset ha⟩ + · intro x hx y hy lower + let x' := SetMembers.ofMem x (bounded hx) + let y' := SetMembers.ofMem y hy + have hx' : typed.mem x' := (exactMem x').1 (by simpa only [x', SetMembers.raw_ofMem] using hx) + have lower' : code.toSmallMeetOrder.le x' y' := by + change ZFSet.pair (SetMembers.raw x') (SetMembers.raw y') ∈ r + simpa only [x', y', SetMembers.raw_ofMem] using lower + have member := (exactMem y').2 (typed.upward hx' lower') + simpa only [y', SetMembers.raw_ofMem] using member + · intro x hx y hy z entry + have hz := (ZFSet.pair_mem_prod.1 (code.operation.1 entry)).2 + let x' := SetMembers.ofMem x (bounded hx) + let y' := SetMembers.ofMem y (bounded hy) + let z' := SetMembers.ofMem z hz + have hx' : typed.mem x' := (exactMem x').1 (by simpa only [x', SetMembers.raw_ofMem] using hx) + have hy' : typed.mem y' := (exactMem y').1 (by simpa only [y', SetMembers.raw_ofMem] using hy) + have equal : code.toSmallMeetOrder.meet x' y' = z' := + (code.toSmallMeetOrder_meet_eq_iff x' y' z').2 + (by simpa only [x', y', z', SetMembers.raw_ofMem] using entry) + have member := (exactMem z').2 (equal ▸ typed.closed_meet hx' hy') + simpa only [z', SetMembers.raw_ofMem] using member + +theorem generatedMeetFilter_least {P r μ A F : ZFSet.{u}} + (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) + (filter : MeetFilterCode P r μ F) (contains : A ⊆ F) : + M.generatedMeetFilter P r μ A ⊆ F := by + let typed : Compression.MeetFilter code.toSmallMeetOrder := { + mem := fun x => SetMembers.raw x ∈ F + nonempty := by + obtain ⟨x, hx⟩ := filter.nonempty + exact ⟨SetMembers.ofMem x (filter.subset hx), by + simpa only [SetMembers.raw_ofMem] using (show x ∈ F from hx)⟩ + upward := fun {x y} hx lower => filter.upward _ hx _ (SetMembers.raw_mem y) lower + closed_meet := fun {x y} hx hy => filter.closed_meet _ hx _ hy _ (code.smallMeet_entry x y) } + intro x hx + have hxP := ((mem_relationImage _ _ _ x).1 hx).1 + let x' := SetMembers.ofMem x hxP + have predicate := (M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset x').1 + (by simpa only [x', SetMembers.raw_ofMem] using hx) + have member := generatedMeetPredicate_least code.toSmallMeetOrder _ typed + (fun a ha => contains ha) predicate + simpa only [typed, x', SetMembers.raw_ofMem] using member + +theorem generatedMeetFilter_lower_bound {P r μ A e : ZFSet.{u}} + (hP : P ∈ M.sets) (code : MeetOrderCode P r μ) (subset : A ⊆ P) + (he : e ∈ P) (above : ∀ a ∈ A, ZFSet.pair e a ∈ r) : + ∀ x ∈ M.generatedMeetFilter P r μ A, ZFSet.pair e x ∈ r := by + intro x hx + have hxP := ((mem_relationImage _ _ _ x).1 hx).1 + let x' := SetMembers.ofMem x hxP + let e' := SetMembers.ofMem e he + have predicate := (M.generatedMeetFilter_small_iff pairing unions separation infinite hP code subset x').1 + (by simpa only [x', SetMembers.raw_ofMem] using hx) + have lower := generatedMeetPredicate_lower_bound code.toSmallMeetOrder _ e' + (fun a ha => by + change ZFSet.pair (SetMembers.raw e') (SetMembers.raw a) ∈ r + simpa only [e', SetMembers.raw_ofMem] using above _ ha) predicate + change ZFSet.pair (SetMembers.raw e') (SetMembers.raw x') ∈ r at lower + simpa only [e', x', SetMembers.raw_ofMem] using lower + +end TransitiveGround + +section +open SetFormula +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem generatedMeetFilter_eq_of_coinitial + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {P r μ B F : ZFSet.{u}} (hP : P ∈ M.sets) (meet : MeetOrderCode P r μ) + (filter : MeetFilterCode P r μ F) (subset : B ⊆ F) + (coinitial : ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ r) : + M.generatedMeetFilter P r μ B = F := by + have bounded : B ⊆ P := fun _ hx => filter.subset (subset hx) + have nonempty : B.Nonempty := by + obtain ⟨x, hx⟩ := filter.nonempty + obtain ⟨b, hb, _⟩ := coinitial x hx + exact ⟨b, hb⟩ + have generated := M.generatedMeetFilter_filter pairing unions separation infinite hP meet bounded nonempty + have contains := M.generatedMeetFilter_contains pairing unions separation infinite hP meet bounded + have least := M.generatedMeetFilter_least pairing unions separation infinite hP meet bounded filter subset + apply ZFSet.ext + intro x + refine ⟨fun hx => least hx, ?_⟩ + intro hx + obtain ⟨b, hb, lower⟩ := coinitial x hx + exact generated.upward b (contains hb) x (filter.subset hx) lower + +end TransitiveGround + +namespace GroundSequenceReflection +variable {M N : TransitiveGround.{u}} {P : ZFSet.{u}} +variable (reflection : GroundSequenceReflection M N P) +include reflection + +theorem coinitial_filter + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets infinity Fin.elim0) + {r μ B F : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (meet : MeetOrderCode P r μ) (hB : B ∈ N.sets) + (small : N.groundEmbeddable B ZFSet.omega) + (filter : MeetFilterCode P r μ F) (subset : B ⊆ F) + (coinitial : ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ r) : + B ∈ M.sets ∧ M.groundEmbeddable B ZFSet.omega ∧ + M.generatedMeetFilter P r μ B = F ∧ F ∈ M.sets := by + obtain ⟨ground, countable⟩ := reflection.countable_subset pairing unions powers separation infinite choice + pairingN unionsN powersN separationN infiniteN hP hB + (fun _ hb => filter.subset (subset hb)) small + have equal := M.generatedMeetFilter_eq_of_coinitial pairing unions separation infinite + hP meet filter subset coinitial + have generatedGround := M.generatedMeetFilter_mem pairing unions powers separation infinite hP hr hμ ground + exact ⟨ground, countable, equal, equal ▸ generatedGround⟩ + +end GroundSequenceReflection +end + +universe u + +noncomputable def testedMeetFilter (F r e : ZFSet.{u}) : ZFSet.{u} := + relationImage {e} F r + +theorem mem_testedMeetFilter (F r e x : ZFSet.{u}) : + x ∈ testedMeetFilter F r e ↔ x ∈ F ∧ ZFSet.pair e x ∈ r := by + rw [testedMeetFilter, mem_relationImage] + constructor + · rintro ⟨hx, a, ha, edge⟩ + exact ⟨hx, (ZFSet.mem_singleton.1 ha) ▸ edge⟩ + · rintro ⟨hx, edge⟩ + exact ⟨hx, e, ZFSet.mem_singleton.2 rfl, edge⟩ + +theorem testedMeetFilter_filter {L r meet F e : ZFSet.{u}} + (code : MeetOrderCode L r meet) (filter : MeetFilterCode L r meet F) + (he : e ∈ L) + (directed : ∀ x ∈ L, ∀ y ∈ L, ∃ z ∈ L, ZFSet.pair x z ∈ r ∧ ZFSet.pair y z ∈ r) : + MeetFilterCode L r meet (testedMeetFilter F r e) := by + refine ⟨fun x hx => filter.subset ((mem_testedMeetFilter F r e x).1 hx).1, ?_, ?_, ?_⟩ + · obtain ⟨x, hx⟩ := filter.nonempty + obtain ⟨z, hz, xz, ez⟩ := directed x (filter.subset hx) e he + exact ⟨z, (mem_testedMeetFilter F r e z).2 ⟨filter.upward x hx z hz xz, ez⟩⟩ + · intro x hx y hy xy + have parts := (mem_testedMeetFilter F r e x).1 hx + exact (mem_testedMeetFilter F r e y).2 + ⟨filter.upward x parts.1 y hy xy, code.order.trans e he x (filter.subset parts.1) y hy parts.2 xy⟩ + · intro x hx y hy z entry + have px := (mem_testedMeetFilter F r e x).1 hx + have py := (mem_testedMeetFilter F r e y).1 hy + exact (mem_testedMeetFilter F r e z).2 + ⟨filter.closed_meet x px.1 y py.1 z entry, code.greatest x y z e he entry px.2 py.2⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem testedMeetFilter_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (separation : SeparationSchema M.sets) + {F r e : ZFSet.{u}} (hF : F ∈ M.sets) (hr : r ∈ M.sets) (he : e ∈ M.sets) : + testedMeetFilter F r e ∈ M.sets := + M.relationImage_mem separation + (by simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing he he) hF hr + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundUnionSizeWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundUnionSizeWitnesses.lean index 7ab6d016f7e8491f28e8074ec13480823277bfb7..717724609defcfb4ce6c9b3a44afd5ffe35539fb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundUnionSizeWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundUnionSizeWitnesses.lean @@ -1,266 +1,266 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowFamilies - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -open scoped ZFSet -universe u - -noncomputable def belowWitnessRelation (R K W : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ A ∈ R, ∃ β ∈ K, ∃ f ∈ W, - z = ZFSet.pair A (ZFSet.pair β f) ∧ InjectionCode A β f) (ZFSet.prod R (ZFSet.prod K W)) - -theorem pair_mem_belowWitnessRelation (R K W A β f : ZFSet.{u}) : - ZFSet.pair A (ZFSet.pair β f) ∈ belowWitnessRelation R K W ↔ - A ∈ R ∧ β ∈ K ∧ f ∈ W ∧ InjectionCode A β f := by - rw [belowWitnessRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, A', hA, β', hβ, f', hf, equal, code⟩ - obtain ⟨hAeq, inner⟩ := ZFSet.pair_inj.1 equal - obtain ⟨hβeq, hfeq⟩ := ZFSet.pair_inj.1 inner - subst A' - subst β' - subst f' - exact ⟨hA, hβ, hf, code⟩ - · rintro ⟨hA, hβ, hf, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hA, ZFSet.pair_mem_prod.2 ⟨hβ, hf⟩⟩, - A, hA, β, hβ, f, hf, rfl, code⟩ - -theorem belowWitnessRelation_subset (R K W : ZFSet.{u}) : - belowWitnessRelation R K W ⊆ ZFSet.prod R (ZFSet.prod K W) := - fun _ entry => (ZFSet.mem_sep.1 entry).1 - -namespace BoundedFormula - -def belowWitnessEntryFormula {n} (z r k w : Fin n) : BoundedFormula n := - exMem r (exMem k.succ (exMem w.succ.succ - (.conj (orderedRightTripleFormula z.succ.succ.succ 2 1 0) (injectionFormula 2 1 0)))) - -theorem truth_belowWitnessEntryFormula {n} (z r k w : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (belowWitnessEntryFormula z r k w) env ↔ - ∃ A ∈ env r, ∃ β ∈ env k, ∃ f ∈ env w, - env z = ZFSet.pair A (ZFSet.pair β f) ∧ InjectionCode A β f := by - simp only [belowWitnessEntryFormula, truth_exMem, Truth, - truth_orderedRightTripleFormula, truth_injectionFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem belowWitnessRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {R K W : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) (hW : W ∈ M.sets) : - belowWitnessRelation R K W ∈ M.sets := by - let params := extend R (extend K (extend W Fin.elim0)) - have selected := M.bounded_separation_mem separation (BoundedFormula.belowWitnessEntryFormula 0 1 2 3) - params (Fin.cases hR (Fin.cases hK (Fin.cases hW (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hR (M.prod_mem pairing unions powers separation hK hW)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.belowWitnessEntryFormula 0 1 2 3) (extend z params)) - (ZFSet.prod R (ZFSet.prod K W)) = belowWitnessRelation R K W := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, belowWitnessRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_belowWitnessEntryFormula 0 1 2 3 _) - exact equal ▸ selected - -noncomputable def groundBelowWitnesses (R B K : ZFSet.{u}) : ZFSet.{u} := - belowWitnessRelation R K (M.groundRelations B K) - -theorem groundBelowWitnesses_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {R B K : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hK : K ∈ M.sets) : - M.groundBelowWitnesses R B K ∈ M.sets := - M.belowWitnessRelation_mem pairing unions powers separation hR hK - (M.groundRelations_mem pairing unions powers separation hB hK) - -theorem groundBelow_iff_boundedWitness {A B K : ZFSet.{u}} - (subset : A ⊆ B) (transitive : ∀ β ∈ K, β ⊆ K) : - GroundBelow M A K ↔ ∃ β ∈ K, ∃ f ∈ M.groundRelations B K, InjectionCode A β f := by - constructor - · rintro ⟨β, hβ, f, hf, code⟩ - have bound : f ⊆ ZFSet.prod B K := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨subset hx, transitive β hβ hy⟩ - exact ⟨β, hβ, f, (M.mem_groundRelations B K f).2 ⟨hf, bound⟩, code⟩ - · rintro ⟨β, hβ, f, hf, code⟩ - exact ⟨β, hβ, f, ((M.mem_groundRelations B K f).1 hf).1, code⟩ - -theorem groundBelowWitnesses_total_iff {R B K : ZFSet.{u}} - (subsets : ∀ A ∈ R, A ⊆ B) (transitive : ∀ β ∈ K, β ⊆ K) : - (∀ A ∈ R, ∃ q ∈ ZFSet.prod K (M.groundRelations B K), - ZFSet.pair A q ∈ M.groundBelowWitnesses R B K) ↔ - ∀ A ∈ R, GroundBelow M A K := by - constructor - · intro total A hA - obtain ⟨q, hq, entry⟩ := total A hA - obtain ⟨β, hβ, f, hf, rfl⟩ := ZFSet.mem_prod.1 hq - have code := ((pair_mem_belowWitnessRelation R K (M.groundRelations B K) A β f).1 entry).2.2.2 - exact (M.groundBelow_iff_boundedWitness (subsets A hA) transitive).2 ⟨β, hβ, f, hf, code⟩ - · intro small A hA - obtain ⟨β, hβ, f, hf, code⟩ := - (M.groundBelow_iff_boundedWitness (subsets A hA) transitive).1 (small A hA) - exact ⟨ZFSet.pair β f, ZFSet.pair_mem_prod.2 ⟨hβ, hf⟩, - (pair_mem_belowWitnessRelation R K (M.groundRelations B K) A β f).2 ⟨hA, hβ, hf, code⟩⟩ - -theorem uniform_below_witnesses - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R B K : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hK : K ∈ M.sets) - (subsets : ∀ A ∈ R, A ⊆ B) (transitive : ∀ β ∈ K, β ⊆ K) - (small : ∀ A ∈ R, GroundBelow M A K) : - ∃ F ∈ M.sets, ZFSet.IsFunc R (ZFSet.prod K (M.groundRelations B K)) F ∧ - ∀ A q, ZFSet.pair A q ∈ F → - ∃ β ∈ K, ∃ f ∈ M.sets, q = ZFSet.pair β f ∧ InjectionCode A β f := by - have hW := M.groundRelations_mem pairing unions powers separation hB hK - have relation := M.groundBelowWitnesses_mem pairing unions powers separation hR hB hK - have total := (M.groundBelowWitnesses_total_iff subsets transitive).2 small - obtain ⟨F, hF, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice - hR (M.prod_mem pairing unions powers separation hK hW) relation total - refine ⟨F, hF, function, ?_⟩ - intro A q entry - have hq := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨β, hβ, f, hf, rfl⟩ := ZFSet.mem_prod.1 hq - have code := ((pair_mem_belowWitnessRelation R K (M.groundRelations B K) A β f).1 - (selected entry)).2.2.2 - exact ⟨β, hβ, f, ((M.mem_groundRelations B K f).1 hf).1, rfl, code⟩ - -theorem uniform_below_family - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) - (transitive : ∀ β ∈ K, β ⊆ K) (small : ∀ A ∈ R, GroundBelow M A K) : - ∃ F ∈ M.sets, ZFSet.IsFunc R (ZFSet.prod K (M.groundRelations (⋃₀ R) K)) F ∧ - ∀ A q, ZFSet.pair A q ∈ F → - ∃ β ∈ K, ∃ f ∈ M.sets, q = ZFSet.pair β f ∧ InjectionCode A β f := - M.uniform_below_witnesses pairing unions powers separation choice hR (M.union_mem unions hR) hK - (fun A hA _ hx => ZFSet.mem_sUnion.2 ⟨A, hA, hx⟩) transitive small - -end TransitiveGround - -namespace GroundRegular -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} (regular : GroundRegular M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include regular pairing unions powers separation - -theorem bound_witnesses {R W F : ZFSet.{u}} - (hR : R ∈ M.sets) (hK : K ∈ M.sets) (hW : W ∈ M.sets) (hF : F ∈ M.sets) - (ordinal : ordinalSetProperty K) (small : GroundBelow M R K) - (family : ZFSet.IsFunc R (ZFSet.prod K W) F) - (witnesses : ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → InjectionCode A β f) : - ∃ δ ∈ K, ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → - β ∈ δ ∧ InjectionCode A β f ∧ InjectionCode A δ f := by - obtain ⟨δ, hδ, bounded⟩ := regular.bound_paired pairing unions powers separation hR hK hW hF small family - refine ⟨δ, hδ, ?_⟩ - intro A β f entry - have hβ := bounded A β f entry - have code := witnesses A β f entry - refine ⟨hβ, code, ⟨⟨?_, code.function.2⟩, code.injective⟩⟩ - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, (ordinal.2 δ hδ) β hβ y hy⟩ - -end GroundRegular - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem uniform_below_common_bound - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (indices : GroundBelow M R K) (small : ∀ A ∈ R, GroundBelow M A K) : - ∃ δ ∈ K, ∃ F ∈ M.sets, - ZFSet.IsFunc R (ZFSet.prod K (M.groundRelations (⋃₀ R) K)) F ∧ - ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → - f ∈ M.sets ∧ β ∈ δ ∧ InjectionCode A β f ∧ InjectionCode A δ f := by - obtain ⟨F, hF, family, witnesses⟩ := M.uniform_below_family - pairing unions powers separation choice hR hK ordinal.1 small - have actual : ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → - f ∈ M.sets ∧ InjectionCode A β f := by - intro A β f entry - obtain ⟨β', _, f', hf, equal, code⟩ := witnesses A (ZFSet.pair β f) entry - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hf, code⟩ - obtain ⟨δ, hδ, bounded⟩ := regular.bound_witnesses pairing unions powers separation hR hK - (M.groundRelations_mem pairing unions powers separation (M.union_mem unions hR) hK) hF - ordinal indices family (fun A β f entry => (actual A β f entry).2) - exact ⟨δ, hδ, F, hF, family, fun A β f entry => - ⟨(actual A β f entry).1, bounded A β f entry⟩⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -open scoped ZFSet -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include M pairing unions powers separation choice - -theorem selected_union_embeds_product {R W D F : ZFSet.{u}} - (hR : R ∈ M.sets) (hW : W ∈ M.sets) (hD : D ∈ M.sets) (hF : F ∈ M.sets) - (family : ZFSet.IsFunc R W F) - (codes : ∀ A f, ZFSet.pair A f ∈ F → InjectionCode A D f) : - M.groundEmbeddable (⋃₀ R) (ZFSet.prod R D) := - M.groundEmbeddable_of_partial_surjection pairing unions powers separation choice - (M.prod_mem pairing unions powers separation hR hD) (M.union_mem unions hR) - (M.unionSizeRelation_mem pairing unions powers separation (M.union_mem unions hR) hR hW hD hF) - (unionSizeRelation_partial family codes) (unionSizeRelation_onto family codes) - -theorem paired_union_embeds_product {R K W D F : ZFSet.{u}} - (hR : R ∈ M.sets) (hK : K ∈ M.sets) (hW : W ∈ M.sets) - (hD : D ∈ M.sets) (hF : F ∈ M.sets) - (family : ZFSet.IsFunc R (ZFSet.prod K W) F) - (codes : ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → InjectionCode A D f) : - M.groundEmbeddable (⋃₀ R) (ZFSet.prod R D) := by - let H := relationCompose R (ZFSet.prod K W) W F (productSecond K W) - have hH : H ∈ M.sets := M.relationCompose_mem pairing unions powers separation hR - (M.prod_mem pairing unions powers separation hK hW) hW hF - (M.productSecond_mem pairing unions powers separation hK hW) - have selected : ZFSet.IsFunc R W H := - relationCompose_function_of_subset family (productSecond_function K W) (fun _ h => h) - have actual : ∀ A f, ZFSet.pair A f ∈ H → InjectionCode A D f := by - intro A f entry - obtain ⟨_, _, q, _, aq, projection⟩ := (pair_mem_relationCompose _ _ _ _ _ A f).1 entry - obtain ⟨β, _, g, _, equal⟩ := (mem_productSecond K W (ZFSet.pair q f)).1 projection - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact codes A β f aq - exact M.selected_union_embeds_product pairing unions powers separation choice hR hW hD hH selected actual - -theorem regular_union_embeds_product {R K : ZFSet.{u}} - (hR : R ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (indices : GroundBelow M R K) (small : ∀ A ∈ R, GroundBelow M A K) : - ∃ D ∈ K, M.groundEmbeddable (⋃₀ R) (ZFSet.prod R D) := by - obtain ⟨D, hD, F, hF, family, witnesses⟩ := M.uniform_below_common_bound - pairing unions powers separation choice hR hK ordinal regular indices small - exact ⟨D, hD, M.paired_union_embeds_product pairing unions powers separation choice hR hK - (M.groundRelations_mem pairing unions powers separation (M.union_mem unions hR) hK) - (M.transitive hK hD) hF family (fun A β f entry => (witnesses A β f entry).2.2.2)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowFamilies + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +open scoped ZFSet +universe u + +noncomputable def belowWitnessRelation (R K W : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ A ∈ R, ∃ β ∈ K, ∃ f ∈ W, + z = ZFSet.pair A (ZFSet.pair β f) ∧ InjectionCode A β f) (ZFSet.prod R (ZFSet.prod K W)) + +theorem pair_mem_belowWitnessRelation (R K W A β f : ZFSet.{u}) : + ZFSet.pair A (ZFSet.pair β f) ∈ belowWitnessRelation R K W ↔ + A ∈ R ∧ β ∈ K ∧ f ∈ W ∧ InjectionCode A β f := by + rw [belowWitnessRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, A', hA, β', hβ, f', hf, equal, code⟩ + obtain ⟨hAeq, inner⟩ := ZFSet.pair_inj.1 equal + obtain ⟨hβeq, hfeq⟩ := ZFSet.pair_inj.1 inner + subst A' + subst β' + subst f' + exact ⟨hA, hβ, hf, code⟩ + · rintro ⟨hA, hβ, hf, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hA, ZFSet.pair_mem_prod.2 ⟨hβ, hf⟩⟩, + A, hA, β, hβ, f, hf, rfl, code⟩ + +theorem belowWitnessRelation_subset (R K W : ZFSet.{u}) : + belowWitnessRelation R K W ⊆ ZFSet.prod R (ZFSet.prod K W) := + fun _ entry => (ZFSet.mem_sep.1 entry).1 + +namespace BoundedFormula + +def belowWitnessEntryFormula {n} (z r k w : Fin n) : BoundedFormula n := + exMem r (exMem k.succ (exMem w.succ.succ + (.conj (orderedRightTripleFormula z.succ.succ.succ 2 1 0) (injectionFormula 2 1 0)))) + +theorem truth_belowWitnessEntryFormula {n} (z r k w : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (belowWitnessEntryFormula z r k w) env ↔ + ∃ A ∈ env r, ∃ β ∈ env k, ∃ f ∈ env w, + env z = ZFSet.pair A (ZFSet.pair β f) ∧ InjectionCode A β f := by + simp only [belowWitnessEntryFormula, truth_exMem, Truth, + truth_orderedRightTripleFormula, truth_injectionFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem belowWitnessRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {R K W : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) (hW : W ∈ M.sets) : + belowWitnessRelation R K W ∈ M.sets := by + let params := extend R (extend K (extend W Fin.elim0)) + have selected := M.bounded_separation_mem separation (BoundedFormula.belowWitnessEntryFormula 0 1 2 3) + params (Fin.cases hR (Fin.cases hK (Fin.cases hW (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hR (M.prod_mem pairing unions powers separation hK hW)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.belowWitnessEntryFormula 0 1 2 3) (extend z params)) + (ZFSet.prod R (ZFSet.prod K W)) = belowWitnessRelation R K W := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, belowWitnessRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_belowWitnessEntryFormula 0 1 2 3 _) + exact equal ▸ selected + +noncomputable def groundBelowWitnesses (R B K : ZFSet.{u}) : ZFSet.{u} := + belowWitnessRelation R K (M.groundRelations B K) + +theorem groundBelowWitnesses_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {R B K : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hK : K ∈ M.sets) : + M.groundBelowWitnesses R B K ∈ M.sets := + M.belowWitnessRelation_mem pairing unions powers separation hR hK + (M.groundRelations_mem pairing unions powers separation hB hK) + +theorem groundBelow_iff_boundedWitness {A B K : ZFSet.{u}} + (subset : A ⊆ B) (transitive : ∀ β ∈ K, β ⊆ K) : + GroundBelow M A K ↔ ∃ β ∈ K, ∃ f ∈ M.groundRelations B K, InjectionCode A β f := by + constructor + · rintro ⟨β, hβ, f, hf, code⟩ + have bound : f ⊆ ZFSet.prod B K := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨subset hx, transitive β hβ hy⟩ + exact ⟨β, hβ, f, (M.mem_groundRelations B K f).2 ⟨hf, bound⟩, code⟩ + · rintro ⟨β, hβ, f, hf, code⟩ + exact ⟨β, hβ, f, ((M.mem_groundRelations B K f).1 hf).1, code⟩ + +theorem groundBelowWitnesses_total_iff {R B K : ZFSet.{u}} + (subsets : ∀ A ∈ R, A ⊆ B) (transitive : ∀ β ∈ K, β ⊆ K) : + (∀ A ∈ R, ∃ q ∈ ZFSet.prod K (M.groundRelations B K), + ZFSet.pair A q ∈ M.groundBelowWitnesses R B K) ↔ + ∀ A ∈ R, GroundBelow M A K := by + constructor + · intro total A hA + obtain ⟨q, hq, entry⟩ := total A hA + obtain ⟨β, hβ, f, hf, rfl⟩ := ZFSet.mem_prod.1 hq + have code := ((pair_mem_belowWitnessRelation R K (M.groundRelations B K) A β f).1 entry).2.2.2 + exact (M.groundBelow_iff_boundedWitness (subsets A hA) transitive).2 ⟨β, hβ, f, hf, code⟩ + · intro small A hA + obtain ⟨β, hβ, f, hf, code⟩ := + (M.groundBelow_iff_boundedWitness (subsets A hA) transitive).1 (small A hA) + exact ⟨ZFSet.pair β f, ZFSet.pair_mem_prod.2 ⟨hβ, hf⟩, + (pair_mem_belowWitnessRelation R K (M.groundRelations B K) A β f).2 ⟨hA, hβ, hf, code⟩⟩ + +theorem uniform_below_witnesses + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R B K : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hK : K ∈ M.sets) + (subsets : ∀ A ∈ R, A ⊆ B) (transitive : ∀ β ∈ K, β ⊆ K) + (small : ∀ A ∈ R, GroundBelow M A K) : + ∃ F ∈ M.sets, ZFSet.IsFunc R (ZFSet.prod K (M.groundRelations B K)) F ∧ + ∀ A q, ZFSet.pair A q ∈ F → + ∃ β ∈ K, ∃ f ∈ M.sets, q = ZFSet.pair β f ∧ InjectionCode A β f := by + have hW := M.groundRelations_mem pairing unions powers separation hB hK + have relation := M.groundBelowWitnesses_mem pairing unions powers separation hR hB hK + have total := (M.groundBelowWitnesses_total_iff subsets transitive).2 small + obtain ⟨F, hF, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice + hR (M.prod_mem pairing unions powers separation hK hW) relation total + refine ⟨F, hF, function, ?_⟩ + intro A q entry + have hq := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨β, hβ, f, hf, rfl⟩ := ZFSet.mem_prod.1 hq + have code := ((pair_mem_belowWitnessRelation R K (M.groundRelations B K) A β f).1 + (selected entry)).2.2.2 + exact ⟨β, hβ, f, ((M.mem_groundRelations B K f).1 hf).1, rfl, code⟩ + +theorem uniform_below_family + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) + (transitive : ∀ β ∈ K, β ⊆ K) (small : ∀ A ∈ R, GroundBelow M A K) : + ∃ F ∈ M.sets, ZFSet.IsFunc R (ZFSet.prod K (M.groundRelations (⋃₀ R) K)) F ∧ + ∀ A q, ZFSet.pair A q ∈ F → + ∃ β ∈ K, ∃ f ∈ M.sets, q = ZFSet.pair β f ∧ InjectionCode A β f := + M.uniform_below_witnesses pairing unions powers separation choice hR (M.union_mem unions hR) hK + (fun A hA _ hx => ZFSet.mem_sUnion.2 ⟨A, hA, hx⟩) transitive small + +end TransitiveGround + +namespace GroundRegular +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} (regular : GroundRegular M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include regular pairing unions powers separation + +theorem bound_witnesses {R W F : ZFSet.{u}} + (hR : R ∈ M.sets) (hK : K ∈ M.sets) (hW : W ∈ M.sets) (hF : F ∈ M.sets) + (ordinal : ordinalSetProperty K) (small : GroundBelow M R K) + (family : ZFSet.IsFunc R (ZFSet.prod K W) F) + (witnesses : ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → InjectionCode A β f) : + ∃ δ ∈ K, ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → + β ∈ δ ∧ InjectionCode A β f ∧ InjectionCode A δ f := by + obtain ⟨δ, hδ, bounded⟩ := regular.bound_paired pairing unions powers separation hR hK hW hF small family + refine ⟨δ, hδ, ?_⟩ + intro A β f entry + have hβ := bounded A β f entry + have code := witnesses A β f entry + refine ⟨hβ, code, ⟨⟨?_, code.function.2⟩, code.injective⟩⟩ + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, (ordinal.2 δ hδ) β hβ y hy⟩ + +end GroundRegular + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem uniform_below_common_bound + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (indices : GroundBelow M R K) (small : ∀ A ∈ R, GroundBelow M A K) : + ∃ δ ∈ K, ∃ F ∈ M.sets, + ZFSet.IsFunc R (ZFSet.prod K (M.groundRelations (⋃₀ R) K)) F ∧ + ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → + f ∈ M.sets ∧ β ∈ δ ∧ InjectionCode A β f ∧ InjectionCode A δ f := by + obtain ⟨F, hF, family, witnesses⟩ := M.uniform_below_family + pairing unions powers separation choice hR hK ordinal.1 small + have actual : ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → + f ∈ M.sets ∧ InjectionCode A β f := by + intro A β f entry + obtain ⟨β', _, f', hf, equal, code⟩ := witnesses A (ZFSet.pair β f) entry + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hf, code⟩ + obtain ⟨δ, hδ, bounded⟩ := regular.bound_witnesses pairing unions powers separation hR hK + (M.groundRelations_mem pairing unions powers separation (M.union_mem unions hR) hK) hF + ordinal indices family (fun A β f entry => (actual A β f entry).2) + exact ⟨δ, hδ, F, hF, family, fun A β f entry => + ⟨(actual A β f entry).1, bounded A β f entry⟩⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +open scoped ZFSet +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include M pairing unions powers separation choice + +theorem selected_union_embeds_product {R W D F : ZFSet.{u}} + (hR : R ∈ M.sets) (hW : W ∈ M.sets) (hD : D ∈ M.sets) (hF : F ∈ M.sets) + (family : ZFSet.IsFunc R W F) + (codes : ∀ A f, ZFSet.pair A f ∈ F → InjectionCode A D f) : + M.groundEmbeddable (⋃₀ R) (ZFSet.prod R D) := + M.groundEmbeddable_of_partial_surjection pairing unions powers separation choice + (M.prod_mem pairing unions powers separation hR hD) (M.union_mem unions hR) + (M.unionSizeRelation_mem pairing unions powers separation (M.union_mem unions hR) hR hW hD hF) + (unionSizeRelation_partial family codes) (unionSizeRelation_onto family codes) + +theorem paired_union_embeds_product {R K W D F : ZFSet.{u}} + (hR : R ∈ M.sets) (hK : K ∈ M.sets) (hW : W ∈ M.sets) + (hD : D ∈ M.sets) (hF : F ∈ M.sets) + (family : ZFSet.IsFunc R (ZFSet.prod K W) F) + (codes : ∀ A β f, ZFSet.pair A (ZFSet.pair β f) ∈ F → InjectionCode A D f) : + M.groundEmbeddable (⋃₀ R) (ZFSet.prod R D) := by + let H := relationCompose R (ZFSet.prod K W) W F (productSecond K W) + have hH : H ∈ M.sets := M.relationCompose_mem pairing unions powers separation hR + (M.prod_mem pairing unions powers separation hK hW) hW hF + (M.productSecond_mem pairing unions powers separation hK hW) + have selected : ZFSet.IsFunc R W H := + relationCompose_function_of_subset family (productSecond_function K W) (fun _ h => h) + have actual : ∀ A f, ZFSet.pair A f ∈ H → InjectionCode A D f := by + intro A f entry + obtain ⟨_, _, q, _, aq, projection⟩ := (pair_mem_relationCompose _ _ _ _ _ A f).1 entry + obtain ⟨β, _, g, _, equal⟩ := (mem_productSecond K W (ZFSet.pair q f)).1 projection + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact codes A β f aq + exact M.selected_union_embeds_product pairing unions powers separation choice hR hW hD hH selected actual + +theorem regular_union_embeds_product {R K : ZFSet.{u}} + (hR : R ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (indices : GroundBelow M R K) (small : ∀ A ∈ R, GroundBelow M A K) : + ∃ D ∈ K, M.groundEmbeddable (⋃₀ R) (ZFSet.prod R D) := by + obtain ⟨D, hD, F, hF, family, witnesses⟩ := M.uniform_below_common_bound + pairing unions powers separation choice hR hK ordinal regular indices small + exact ⟨D, hD, M.paired_union_embeds_product pairing unions powers separation choice hR hK + (M.groundRelations_mem pairing unions powers separation (M.union_mem unions hR) hK) + (M.transitive hK hD) hF family (fun A β f entry => (witnesses A β f entry).2.2.2)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundVaryingFamilyEvaluation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundVaryingFamilyEvaluation.lean index 11ac784cbadb4323c82e3cbff1e66c57769eb4ae..9822f881bdd45ae7c4134c6990ce4d2c7cd5d54d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundVaryingFamilyEvaluation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GroundVaryingFamilyEvaluation.lean @@ -1,223 +1,223 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BatchGraphSetFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFunctionRangeFamilies - -namespace OAI - -namespace PartitionPilot.Forcing - -section - -universe u - -def familyEvaluationGraph (K P L V Ss Es : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ k ∈ K, ∃ S ∈ V, ∃ e ∈ P, ∃ y ∈ L, - z = ZFSet.pair k y ∧ ZFSet.pair k S ∈ Ss ∧ - ZFSet.pair k e ∈ Es ∧ ZFSet.pair e y ∈ S) (ZFSet.prod K L) - -theorem pair_mem_familyEvaluationGraph (K P L V Ss Es k y : ZFSet.{u}) : - ZFSet.pair k y ∈ familyEvaluationGraph K P L V Ss Es ↔ - k ∈ K ∧ y ∈ L ∧ ∃ S ∈ V, ∃ e ∈ P, - ZFSet.pair k S ∈ Ss ∧ ZFSet.pair k e ∈ Es ∧ ZFSet.pair e y ∈ S := by - rw [familyEvaluationGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hk, hy⟩, k', _, S, hS, e, he, y', _, eq, ks, ke, ey⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hk, hy, S, hS, e, he, ks, ke, ey⟩ - · rintro ⟨hk, hy, S, hS, e, he, ks, ke, ey⟩ - exact ⟨⟨hk, hy⟩, k, hk, S, hS, e, he, y, hy, rfl, ks, ke, ey⟩ - -theorem familyEvaluationGraph_entry_iff {K P L V Ss Es k S e y : ZFSet.{u}} - (functions : ZFSet.IsFunc K V Ss) (arguments : ZFSet.IsFunc K P Es) - (ks : ZFSet.pair k S ∈ Ss) (ke : ZFSet.pair k e ∈ Es) : - ZFSet.pair k y ∈ familyEvaluationGraph K P L V Ss Es ↔ - y ∈ L ∧ ZFSet.pair e y ∈ S := by - rw [pair_mem_familyEvaluationGraph] - constructor - · rintro ⟨_, hy, S', _, e', _, ks', ke', entry⟩ - have eqS := (show FunctionGraphOn K Ss from ⟨V, functions⟩).unique ks' ks - have eqE := (show FunctionGraphOn K Es from ⟨P, arguments⟩).unique ke' ke - exact ⟨hy, eqE ▸ eqS ▸ entry⟩ - · rintro ⟨hy, entry⟩ - have hs := ZFSet.pair_mem_prod.1 (functions.1 ks) - have he := ZFSet.pair_mem_prod.1 (arguments.1 ke) - exact ⟨hs.1, hy, S, hs.2, e, he.2, ks, ke, entry⟩ - -theorem familyEvaluationGraph_function {K P L V Ss Es : ZFSet.{u}} - (functions : ZFSet.IsFunc K V Ss) (arguments : ZFSet.IsFunc K P Es) - (valid : ∀ k S, ZFSet.pair k S ∈ Ss → ZFSet.IsFunc P L S) : - ZFSet.IsFunc K L (familyEvaluationGraph K P L V Ss Es) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro k hk - obtain ⟨S, ks, _⟩ := functions.2 k hk - obtain ⟨e, ke, _⟩ := arguments.2 k hk - have function := valid k S ks - obtain ⟨y, ey, unique⟩ := function.2 e (ZFSet.pair_mem_prod.1 (arguments.1 ke)).2 - refine ⟨y, (familyEvaluationGraph_entry_iff functions arguments ks ke).2 - ⟨(ZFSet.pair_mem_prod.1 (function.1 ey)).2, ey⟩, ?_⟩ - intro z hz - exact unique z ((familyEvaluationGraph_entry_iff functions arguments ks ke).1 hz).2 - -namespace BoundedFormula - -open SetFormula - -def familyEvaluationEntryFormula {n} (z k p l v ss es : Fin n) : BoundedFormula n := - exMem k (exMem v.succ (exMem p.succ.succ (exMem l.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ 3 0) - (.conj (pairMembershipFormula 3 2 ss.succ.succ.succ.succ) - (.conj (pairMembershipFormula 3 1 es.succ.succ.succ.succ) - (pairMembershipFormula 1 0 2))))))) - -theorem truth_familyEvaluationEntryFormula {n} (z k p l v ss es : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (familyEvaluationEntryFormula z k p l v ss es) env ↔ - ∃ i ∈ env k, ∃ S ∈ env v, ∃ e ∈ env p, ∃ y ∈ env l, - env z = ZFSet.pair i y ∧ ZFSet.pair i S ∈ env ss ∧ - ZFSet.pair i e ∈ env es ∧ ZFSet.pair e y ∈ S := by - simp only [familyEvaluationEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem familyEvaluationGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {K P L V Ss Es : ZFSet.{u}} (hK : K ∈ M.sets) (hP : P ∈ M.sets) - (hL : L ∈ M.sets) (hV : V ∈ M.sets) (hSs : Ss ∈ M.sets) (hEs : Es ∈ M.sets) : - familyEvaluationGraph K P L V Ss Es ∈ M.sets := by - let params := extend K (extend P (extend L (extend V (extend Ss (extend Es Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.familyEvaluationEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hK (Fin.cases hP (Fin.cases hL (Fin.cases hV (Fin.cases hSs - (Fin.cases hEs (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hK hL) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.familyEvaluationEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod K L) = familyEvaluationGraph K P L V Ss Es := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, familyEvaluationGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_familyEvaluationEntryFormula 0 1 2 3 4 5 6 _) - exact equal ▸ selected - -end TransitiveGround - -end - -section -open SetFormula -universe u - -namespace SetFormula - -def familyEvaluationSetFormula {n} (output K P L V Ss Es : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.familyEvaluationEntryFormula - 0 K.succ P.succ L.succ V.succ Ss.succ Es.succ).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_familyEvaluationSetFormula {n} (output K P L V Ss Es : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (familyEvaluationSetFormula output K P L V Ss Es) env ↔ - env output = familyEvaluationGraph (env K) (env P) (env L) (env V) (env Ss) (env Es) := by - apply M.realize_exactBoundedSetFormula output _ env members - (M.familyEvaluationGraph_mem pairing unions powers separation - (members K) (members P) (members L) (members V) (members Ss) (members Es)) - intro z - rw [BoundedFormula.truth_familyEvaluationEntryFormula] - change (∃ i ∈ env K, ∃ S ∈ env V, ∃ e ∈ env P, ∃ y ∈ env L, - z = ZFSet.pair i y ∧ ZFSet.pair i S ∈ env Ss ∧ - ZFSet.pair i e ∈ env Es ∧ ZFSet.pair e y ∈ S) ↔ _ - rw [familyEvaluationGraph, ZFSet.mem_sep] - constructor - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨i, hi, _, _, _, _, y, hy, rfl, _⟩ := witness - exact ZFSet.pair_mem_prod.2 ⟨hi, hy⟩ - · exact And.right - -noncomputable def definable_familyEvaluation : GroundDefinableFunction M - (fun env : Fin 6 → ZFSet.{u} => - familyEvaluationGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) where - formula := familyEvaluationSetFormula 0 1 2 3 4 5 6 - closed := fun _ members => M.familyEvaluationGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) - correct := fun env members z hz => M.realize_familyEvaluationSetFormula - pairing unions powers separation 0 1 2 3 4 5 6 (extend z env) (Fin.cases hz members) - -end TransitiveGround -end - -open SetFormula -universe u v -variable {I : Type v} [Small.{u} I] - -theorem TransitiveGround.familyCodeGraph_evaluation_ground (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (key arguments graphs values : I → ZFSet.{u}) (injective : Function.Injective key) - (domain : ZFSet.range key ∈ M.sets) - (argumentsGround : familyCodeGraph key arguments ∈ M.sets) - (graphsGround : familyCodeGraph key graphs ∈ M.sets) - (lookup : ∀ i y, ZFSet.pair (arguments i) y ∈ graphs i ↔ y = values i) : - familyCodeGraph key values ∈ M.sets := by - let Ss := familyCodeGraph key graphs - let Es := familyCodeGraph key arguments - let P := ZFSet.sUnion (ZFSet.sUnion Es) - let V := ZFSet.sUnion (ZFSet.sUnion Ss) - let L := ZFSet.sUnion (ZFSet.sUnion (ZFSet.sUnion V)) - let evaluated := familyEvaluationGraph (ZFSet.range key) P L V Ss Es - have hP : P ∈ M.sets := M.union_mem unions (M.union_mem unions argumentsGround) - have hV : V ∈ M.sets := M.union_mem unions (M.union_mem unions graphsGround) - have hL : L ∈ M.sets := M.union_mem unions (M.union_mem unions (M.union_mem unions hV)) - have ground : evaluated ∈ M.sets := - M.familyEvaluationGraph_mem pairing unions powers separation domain hP hL hV graphsGround argumentsGround - have graphFunction : ZFSet.IsFunc (ZFSet.range key) V Ss := - (familyCodeGraph_function key graphs injective).to_isFunc - have argumentFunction : ZFSet.IsFunc (ZFSet.range key) P Es := - (familyCodeGraph_function key arguments injective).to_isFunc - have valueBound (i : I) : values i ∈ L := by - have stored : graphs i ∈ V := - pair_second_mem_doubleUnion ((pair_mem_familyCodeGraph key graphs injective i _).2 rfl) - have entry : ZFSet.pair (arguments i) (values i) ∈ ZFSet.sUnion V := - ZFSet.mem_sUnion.2 ⟨graphs i, stored, (lookup i _).2 rfl⟩ - exact pair_second_mem_doubleUnion entry - have entries (i : I) (y : ZFSet.{u}) : ZFSet.pair (key i) y ∈ evaluated ↔ y = values i := by - rw [familyEvaluationGraph_entry_iff graphFunction argumentFunction - ((pair_mem_familyCodeGraph key graphs injective i _).2 rfl) - ((pair_mem_familyCodeGraph key arguments injective i _).2 rfl), lookup i y] - exact ⟨And.right, fun equal => ⟨equal.symm ▸ valueBound i, equal⟩⟩ - have function : FunctionGraphOn (ZFSet.range key) evaluated := by - refine ⟨L, fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx - exact ⟨values i, (entries i _).2 rfl, fun y hy => (entries i y).1 hy⟩ - exact familyCodeGraph_ground_of_entries ground function key values rfl (fun i => (entries i _).2 rfl) - -theorem familyCodeGraph_evaluation_rank_le (key arguments graphs values : I → ZFSet.{u}) - (entries : ∀ i, ZFSet.pair (arguments i) (values i) ∈ graphs i) : - ZFSet.rank (familyCodeGraph key values) ≤ ZFSet.rank (familyCodeGraph key graphs) := by - apply familyCodeGraph_rank_mono - intro i - exact (ZFSet.rank_lt_of_mem (pair_second_mem_doubleUnion (entries i))).le.trans - ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BatchGraphSetFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFunctionRangeFamilies + +namespace OAI + +namespace PartitionPilot.Forcing + +section + +universe u + +def familyEvaluationGraph (K P L V Ss Es : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ k ∈ K, ∃ S ∈ V, ∃ e ∈ P, ∃ y ∈ L, + z = ZFSet.pair k y ∧ ZFSet.pair k S ∈ Ss ∧ + ZFSet.pair k e ∈ Es ∧ ZFSet.pair e y ∈ S) (ZFSet.prod K L) + +theorem pair_mem_familyEvaluationGraph (K P L V Ss Es k y : ZFSet.{u}) : + ZFSet.pair k y ∈ familyEvaluationGraph K P L V Ss Es ↔ + k ∈ K ∧ y ∈ L ∧ ∃ S ∈ V, ∃ e ∈ P, + ZFSet.pair k S ∈ Ss ∧ ZFSet.pair k e ∈ Es ∧ ZFSet.pair e y ∈ S := by + rw [familyEvaluationGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hk, hy⟩, k', _, S, hS, e, he, y', _, eq, ks, ke, ey⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hk, hy, S, hS, e, he, ks, ke, ey⟩ + · rintro ⟨hk, hy, S, hS, e, he, ks, ke, ey⟩ + exact ⟨⟨hk, hy⟩, k, hk, S, hS, e, he, y, hy, rfl, ks, ke, ey⟩ + +theorem familyEvaluationGraph_entry_iff {K P L V Ss Es k S e y : ZFSet.{u}} + (functions : ZFSet.IsFunc K V Ss) (arguments : ZFSet.IsFunc K P Es) + (ks : ZFSet.pair k S ∈ Ss) (ke : ZFSet.pair k e ∈ Es) : + ZFSet.pair k y ∈ familyEvaluationGraph K P L V Ss Es ↔ + y ∈ L ∧ ZFSet.pair e y ∈ S := by + rw [pair_mem_familyEvaluationGraph] + constructor + · rintro ⟨_, hy, S', _, e', _, ks', ke', entry⟩ + have eqS := (show FunctionGraphOn K Ss from ⟨V, functions⟩).unique ks' ks + have eqE := (show FunctionGraphOn K Es from ⟨P, arguments⟩).unique ke' ke + exact ⟨hy, eqE ▸ eqS ▸ entry⟩ + · rintro ⟨hy, entry⟩ + have hs := ZFSet.pair_mem_prod.1 (functions.1 ks) + have he := ZFSet.pair_mem_prod.1 (arguments.1 ke) + exact ⟨hs.1, hy, S, hs.2, e, he.2, ks, ke, entry⟩ + +theorem familyEvaluationGraph_function {K P L V Ss Es : ZFSet.{u}} + (functions : ZFSet.IsFunc K V Ss) (arguments : ZFSet.IsFunc K P Es) + (valid : ∀ k S, ZFSet.pair k S ∈ Ss → ZFSet.IsFunc P L S) : + ZFSet.IsFunc K L (familyEvaluationGraph K P L V Ss Es) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro k hk + obtain ⟨S, ks, _⟩ := functions.2 k hk + obtain ⟨e, ke, _⟩ := arguments.2 k hk + have function := valid k S ks + obtain ⟨y, ey, unique⟩ := function.2 e (ZFSet.pair_mem_prod.1 (arguments.1 ke)).2 + refine ⟨y, (familyEvaluationGraph_entry_iff functions arguments ks ke).2 + ⟨(ZFSet.pair_mem_prod.1 (function.1 ey)).2, ey⟩, ?_⟩ + intro z hz + exact unique z ((familyEvaluationGraph_entry_iff functions arguments ks ke).1 hz).2 + +namespace BoundedFormula + +open SetFormula + +def familyEvaluationEntryFormula {n} (z k p l v ss es : Fin n) : BoundedFormula n := + exMem k (exMem v.succ (exMem p.succ.succ (exMem l.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ 3 0) + (.conj (pairMembershipFormula 3 2 ss.succ.succ.succ.succ) + (.conj (pairMembershipFormula 3 1 es.succ.succ.succ.succ) + (pairMembershipFormula 1 0 2))))))) + +theorem truth_familyEvaluationEntryFormula {n} (z k p l v ss es : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (familyEvaluationEntryFormula z k p l v ss es) env ↔ + ∃ i ∈ env k, ∃ S ∈ env v, ∃ e ∈ env p, ∃ y ∈ env l, + env z = ZFSet.pair i y ∧ ZFSet.pair i S ∈ env ss ∧ + ZFSet.pair i e ∈ env es ∧ ZFSet.pair e y ∈ S := by + simp only [familyEvaluationEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem familyEvaluationGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {K P L V Ss Es : ZFSet.{u}} (hK : K ∈ M.sets) (hP : P ∈ M.sets) + (hL : L ∈ M.sets) (hV : V ∈ M.sets) (hSs : Ss ∈ M.sets) (hEs : Es ∈ M.sets) : + familyEvaluationGraph K P L V Ss Es ∈ M.sets := by + let params := extend K (extend P (extend L (extend V (extend Ss (extend Es Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.familyEvaluationEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hK (Fin.cases hP (Fin.cases hL (Fin.cases hV (Fin.cases hSs + (Fin.cases hEs (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hK hL) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.familyEvaluationEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod K L) = familyEvaluationGraph K P L V Ss Es := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, familyEvaluationGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_familyEvaluationEntryFormula 0 1 2 3 4 5 6 _) + exact equal ▸ selected + +end TransitiveGround + +end + +section +open SetFormula +universe u + +namespace SetFormula + +def familyEvaluationSetFormula {n} (output K P L V Ss Es : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.familyEvaluationEntryFormula + 0 K.succ P.succ L.succ V.succ Ss.succ Es.succ).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_familyEvaluationSetFormula {n} (output K P L V Ss Es : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (familyEvaluationSetFormula output K P L V Ss Es) env ↔ + env output = familyEvaluationGraph (env K) (env P) (env L) (env V) (env Ss) (env Es) := by + apply M.realize_exactBoundedSetFormula output _ env members + (M.familyEvaluationGraph_mem pairing unions powers separation + (members K) (members P) (members L) (members V) (members Ss) (members Es)) + intro z + rw [BoundedFormula.truth_familyEvaluationEntryFormula] + change (∃ i ∈ env K, ∃ S ∈ env V, ∃ e ∈ env P, ∃ y ∈ env L, + z = ZFSet.pair i y ∧ ZFSet.pair i S ∈ env Ss ∧ + ZFSet.pair i e ∈ env Es ∧ ZFSet.pair e y ∈ S) ↔ _ + rw [familyEvaluationGraph, ZFSet.mem_sep] + constructor + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨i, hi, _, _, _, _, y, hy, rfl, _⟩ := witness + exact ZFSet.pair_mem_prod.2 ⟨hi, hy⟩ + · exact And.right + +noncomputable def definable_familyEvaluation : GroundDefinableFunction M + (fun env : Fin 6 → ZFSet.{u} => + familyEvaluationGraph (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) where + formula := familyEvaluationSetFormula 0 1 2 3 4 5 6 + closed := fun _ members => M.familyEvaluationGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) + correct := fun env members z hz => M.realize_familyEvaluationSetFormula + pairing unions powers separation 0 1 2 3 4 5 6 (extend z env) (Fin.cases hz members) + +end TransitiveGround +end + +open SetFormula +universe u v +variable {I : Type v} [Small.{u} I] + +theorem TransitiveGround.familyCodeGraph_evaluation_ground (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (key arguments graphs values : I → ZFSet.{u}) (injective : Function.Injective key) + (domain : ZFSet.range key ∈ M.sets) + (argumentsGround : familyCodeGraph key arguments ∈ M.sets) + (graphsGround : familyCodeGraph key graphs ∈ M.sets) + (lookup : ∀ i y, ZFSet.pair (arguments i) y ∈ graphs i ↔ y = values i) : + familyCodeGraph key values ∈ M.sets := by + let Ss := familyCodeGraph key graphs + let Es := familyCodeGraph key arguments + let P := ZFSet.sUnion (ZFSet.sUnion Es) + let V := ZFSet.sUnion (ZFSet.sUnion Ss) + let L := ZFSet.sUnion (ZFSet.sUnion (ZFSet.sUnion V)) + let evaluated := familyEvaluationGraph (ZFSet.range key) P L V Ss Es + have hP : P ∈ M.sets := M.union_mem unions (M.union_mem unions argumentsGround) + have hV : V ∈ M.sets := M.union_mem unions (M.union_mem unions graphsGround) + have hL : L ∈ M.sets := M.union_mem unions (M.union_mem unions (M.union_mem unions hV)) + have ground : evaluated ∈ M.sets := + M.familyEvaluationGraph_mem pairing unions powers separation domain hP hL hV graphsGround argumentsGround + have graphFunction : ZFSet.IsFunc (ZFSet.range key) V Ss := + (familyCodeGraph_function key graphs injective).to_isFunc + have argumentFunction : ZFSet.IsFunc (ZFSet.range key) P Es := + (familyCodeGraph_function key arguments injective).to_isFunc + have valueBound (i : I) : values i ∈ L := by + have stored : graphs i ∈ V := + pair_second_mem_doubleUnion ((pair_mem_familyCodeGraph key graphs injective i _).2 rfl) + have entry : ZFSet.pair (arguments i) (values i) ∈ ZFSet.sUnion V := + ZFSet.mem_sUnion.2 ⟨graphs i, stored, (lookup i _).2 rfl⟩ + exact pair_second_mem_doubleUnion entry + have entries (i : I) (y : ZFSet.{u}) : ZFSet.pair (key i) y ∈ evaluated ↔ y = values i := by + rw [familyEvaluationGraph_entry_iff graphFunction argumentFunction + ((pair_mem_familyCodeGraph key graphs injective i _).2 rfl) + ((pair_mem_familyCodeGraph key arguments injective i _).2 rfl), lookup i y] + exact ⟨And.right, fun equal => ⟨equal.symm ▸ valueBound i, equal⟩⟩ + have function : FunctionGraphOn (ZFSet.range key) evaluated := by + refine ⟨L, fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx + exact ⟨values i, (entries i _).2 rfl, fun y hy => (entries i y).1 hy⟩ + exact familyCodeGraph_ground_of_entries ground function key values rfl (fun i => (entries i _).2 rfl) + +theorem familyCodeGraph_evaluation_rank_le (key arguments graphs values : I → ZFSet.{u}) + (entries : ∀ i, ZFSet.pair (arguments i) (values i) ∈ graphs i) : + ZFSet.rank (familyCodeGraph key values) ≤ ZFSet.rank (familyCodeGraph key graphs) := by + apply familyCodeGraph_rank_mono + intro i + exact (ZFSet.rank_lt_of_mem (pair_second_mem_doubleUnion (entries i))).le.trans + ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GrowthLayerWitnessRestrictions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GrowthLayerWitnessRestrictions.lean index 0ea282e31680cd982c61b577ff41db4633546095..2bc04f83cf1cd76a20de8bc2ed221617338c3602 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GrowthLayerWitnessRestrictions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/GrowthLayerWitnessRestrictions.lean @@ -1,120 +1,120 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -namespace CopyEmbeddingFamilyCode - -theorem restrict_sources_iff - {Qs rs μs L r μ t I Indices Maps S : ZFSet.{u}} (before : t ⊆ S) : - CopyEmbeddingFamilyCode (graphRestriction S Qs) (graphRestriction S rs) - (graphRestriction S μs) L r μ t I Indices Maps ↔ - CopyEmbeddingFamilyCode Qs rs μs L r μ t I Indices Maps := by - constructor - · intro code i hi s hs e P R V index map qField rField mField - exact code i hi s hs e P R V index map - (pair_mem_graphRestriction.2 ⟨qField, before hs⟩) - (pair_mem_graphRestriction.2 ⟨rField, before hs⟩) - (pair_mem_graphRestriction.2 ⟨mField, before hs⟩) - · intro code i hi s hs e P R V index map qField rField mField - exact code i hi s hs e P R V index map - (pair_mem_graphRestriction.1 qField).1 (pair_mem_graphRestriction.1 rField).1 - (pair_mem_graphRestriction.1 mField).1 - -end CopyEmbeddingFamilyCode - -namespace CopyImageCoverCode - -theorem restrict_sources_iff - {Qs L t I parts Indices Maps S : ZFSet.{u}} (before : t ⊆ S) : - CopyImageCoverCode (graphRestriction S Qs) L t I parts Indices Maps ↔ - CopyImageCoverCode Qs L t I parts Indices Maps := by - constructor - · intro code i hi s hs e P x hx index map qField part - exact code i hi s hs e P x hx index map (pair_mem_graphRestriction.2 ⟨qField, before hs⟩) part - · intro code i hi s hs e P x hx index map qField part - exact code i hi s hs e P x hx index map (pair_mem_graphRestriction.1 qField).1 part - -end CopyImageCoverCode - -namespace ComponentImageCoverCode - -theorem restrict_sources_iff - {Qs L t I Components Indices Maps S : ZFSet.{u}} (before : t ⊆ S) : - ComponentImageCoverCode (graphRestriction S Qs) L t I Components Indices Maps ↔ - ComponentImageCoverCode Qs L t I Components Indices Maps := by - constructor - · intro code i hi s hs e P x hx index map qField component - exact code i hi s hs e P x hx index map - (pair_mem_graphRestriction.2 ⟨qField, before hs⟩) component - · intro code i hi s hs e P x hx index map qField component - exact code i hi s hs e P x hx index map (pair_mem_graphRestriction.1 qField).1 component - -end ComponentImageCoverCode - -namespace CopyLayerCode - -theorem restrict_sources_iff - {Qs rs μs L r μ birth t I parts Indices Maps W N injection S : ZFSet.{u}} - (before : t ⊆ S) : - CopyLayerCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) - L r μ birth t I parts Indices Maps W N injection ↔ - CopyLayerCode Qs rs μs L r μ birth t I parts Indices Maps W N injection := by - constructor - · intro code - exact ⟨code.small, code.indices, code.maps, - (CopyEmbeddingFamilyCode.restrict_sources_iff before).1 code.embedding, - code.cover, (CopyImageCoverCode.restrict_sources_iff before).1 code.inCopy⟩ - · intro code - exact ⟨code.small, code.indices, code.maps, - (CopyEmbeddingFamilyCode.restrict_sources_iff before).2 code.embedding, - code.cover, (CopyImageCoverCode.restrict_sources_iff before).2 code.inCopy⟩ - -end CopyLayerCode - -namespace SeparatedLayerCode - -theorem restrict_sources_iff - {Qs rs μs L r μ birth t I Indices Maps W Components F S : ZFSet.{u}} - (before : t ⊆ S) : - SeparatedLayerCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) - L r μ birth t I Indices Maps W Components F ↔ - SeparatedLayerCode Qs rs μs L r μ birth t I Indices Maps W Components F := by - constructor - · intro code - exact ⟨code.indices, code.maps, code.fiber, code.components, - (CopyEmbeddingFamilyCode.restrict_sources_iff before).1 code.embedding, - (ComponentImageCoverCode.restrict_sources_iff before).1 code.cover, code.separated⟩ - · intro code - exact ⟨code.indices, code.maps, code.fiber, code.components, - (CopyEmbeddingFamilyCode.restrict_sources_iff before).2 code.embedding, - (ComponentImageCoverCode.restrict_sources_iff before).2 code.cover, code.separated⟩ - -end SeparatedLayerCode - -namespace GrowthLayerWitnessCode - -theorem restrict_sources_iff {Qs rs μs L r μ birth t N z S : ZFSet.{u}} - (before : t ⊆ S) : - GrowthLayerWitnessCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) - L r μ birth t N z ↔ GrowthLayerWitnessCode Qs rs μs L r μ birth t N z := by - simp only [GrowthLayerWitnessCode, CopyLayerCode.restrict_sources_iff before, - SeparatedLayerCode.restrict_sources_iff before] - -theorem restrict_sources {Qs rs μs L r μ birth t N z S : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) - (transitive : setTransitive S) (ht : t ∈ S) : - GrowthLayerWitnessCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) - L r μ birth t N z := - (restrict_sources_iff (fun _ hs => transitive t ht _ hs)).2 code - -end GrowthLayerWitnessCode -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +namespace CopyEmbeddingFamilyCode + +theorem restrict_sources_iff + {Qs rs μs L r μ t I Indices Maps S : ZFSet.{u}} (before : t ⊆ S) : + CopyEmbeddingFamilyCode (graphRestriction S Qs) (graphRestriction S rs) + (graphRestriction S μs) L r μ t I Indices Maps ↔ + CopyEmbeddingFamilyCode Qs rs μs L r μ t I Indices Maps := by + constructor + · intro code i hi s hs e P R V index map qField rField mField + exact code i hi s hs e P R V index map + (pair_mem_graphRestriction.2 ⟨qField, before hs⟩) + (pair_mem_graphRestriction.2 ⟨rField, before hs⟩) + (pair_mem_graphRestriction.2 ⟨mField, before hs⟩) + · intro code i hi s hs e P R V index map qField rField mField + exact code i hi s hs e P R V index map + (pair_mem_graphRestriction.1 qField).1 (pair_mem_graphRestriction.1 rField).1 + (pair_mem_graphRestriction.1 mField).1 + +end CopyEmbeddingFamilyCode + +namespace CopyImageCoverCode + +theorem restrict_sources_iff + {Qs L t I parts Indices Maps S : ZFSet.{u}} (before : t ⊆ S) : + CopyImageCoverCode (graphRestriction S Qs) L t I parts Indices Maps ↔ + CopyImageCoverCode Qs L t I parts Indices Maps := by + constructor + · intro code i hi s hs e P x hx index map qField part + exact code i hi s hs e P x hx index map (pair_mem_graphRestriction.2 ⟨qField, before hs⟩) part + · intro code i hi s hs e P x hx index map qField part + exact code i hi s hs e P x hx index map (pair_mem_graphRestriction.1 qField).1 part + +end CopyImageCoverCode + +namespace ComponentImageCoverCode + +theorem restrict_sources_iff + {Qs L t I Components Indices Maps S : ZFSet.{u}} (before : t ⊆ S) : + ComponentImageCoverCode (graphRestriction S Qs) L t I Components Indices Maps ↔ + ComponentImageCoverCode Qs L t I Components Indices Maps := by + constructor + · intro code i hi s hs e P x hx index map qField component + exact code i hi s hs e P x hx index map + (pair_mem_graphRestriction.2 ⟨qField, before hs⟩) component + · intro code i hi s hs e P x hx index map qField component + exact code i hi s hs e P x hx index map (pair_mem_graphRestriction.1 qField).1 component + +end ComponentImageCoverCode + +namespace CopyLayerCode + +theorem restrict_sources_iff + {Qs rs μs L r μ birth t I parts Indices Maps W N injection S : ZFSet.{u}} + (before : t ⊆ S) : + CopyLayerCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) + L r μ birth t I parts Indices Maps W N injection ↔ + CopyLayerCode Qs rs μs L r μ birth t I parts Indices Maps W N injection := by + constructor + · intro code + exact ⟨code.small, code.indices, code.maps, + (CopyEmbeddingFamilyCode.restrict_sources_iff before).1 code.embedding, + code.cover, (CopyImageCoverCode.restrict_sources_iff before).1 code.inCopy⟩ + · intro code + exact ⟨code.small, code.indices, code.maps, + (CopyEmbeddingFamilyCode.restrict_sources_iff before).2 code.embedding, + code.cover, (CopyImageCoverCode.restrict_sources_iff before).2 code.inCopy⟩ + +end CopyLayerCode + +namespace SeparatedLayerCode + +theorem restrict_sources_iff + {Qs rs μs L r μ birth t I Indices Maps W Components F S : ZFSet.{u}} + (before : t ⊆ S) : + SeparatedLayerCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) + L r μ birth t I Indices Maps W Components F ↔ + SeparatedLayerCode Qs rs μs L r μ birth t I Indices Maps W Components F := by + constructor + · intro code + exact ⟨code.indices, code.maps, code.fiber, code.components, + (CopyEmbeddingFamilyCode.restrict_sources_iff before).1 code.embedding, + (ComponentImageCoverCode.restrict_sources_iff before).1 code.cover, code.separated⟩ + · intro code + exact ⟨code.indices, code.maps, code.fiber, code.components, + (CopyEmbeddingFamilyCode.restrict_sources_iff before).2 code.embedding, + (ComponentImageCoverCode.restrict_sources_iff before).2 code.cover, code.separated⟩ + +end SeparatedLayerCode + +namespace GrowthLayerWitnessCode + +theorem restrict_sources_iff {Qs rs μs L r μ birth t N z S : ZFSet.{u}} + (before : t ⊆ S) : + GrowthLayerWitnessCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) + L r μ birth t N z ↔ GrowthLayerWitnessCode Qs rs μs L r μ birth t N z := by + simp only [GrowthLayerWitnessCode, CopyLayerCode.restrict_sources_iff before, + SeparatedLayerCode.restrict_sources_iff before] + +theorem restrict_sources {Qs rs μs L r μ birth t N z S : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) + (transitive : setTransitive S) (ht : t ∈ S) : + GrowthLayerWitnessCode (graphRestriction S Qs) (graphRestriction S rs) (graphRestriction S μs) + L r μ birth t N z := + (restrict_sources_iff (fun _ hs => transitive t ht _ hs)).2 code + +end GrowthLayerWitnessCode +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealChain.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealChain.lean index a4e85aea65886e13a5bf6850842c46e0dc152d7d..23640ec57ff9e39ffb13d83b6bccba520a579b58 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealChain.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealChain.lean @@ -1,195 +1,195 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.PrincipalBatch - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u - -structure IdealChain where - Point : Nat → Type u - order : ∀ n, MeetOrder (Point n) - next : ∀ n, IdealEmbedding (order n) (order (n + 1)) - -namespace IdealChain -variable (c : IdealChain.{u}) - -noncomputable def up {n m : Nat} (h : n ≤ m) (x : c.Point n) : c.Point m := - Nat.leRecOn h (fun {k} x => (c.next k).toFun x) x - -theorem up_self (n : Nat) (x : c.Point n) : c.up (Nat.le_refl n) x = x := - Nat.leRecOn_self x - -theorem up_succ {n m : Nat} (h : n ≤ m) (x : c.Point n) : - c.up (Nat.le_succ_of_le h) x = (c.next m).toFun (c.up h x) := - Nat.leRecOn_succ h x - -theorem up_comp {n m k : Nat} (hnm : n ≤ m) (hmk : m ≤ k) (x : c.Point n) : - c.up (Nat.le_trans hnm hmk) x = c.up hmk (c.up hnm x) := - Nat.leRecOn_trans hnm hmk x - -theorem up_le {n m : Nat} (h : n ≤ m) (x y : c.Point n) : - (c.order m).le (c.up h x) (c.up h y) ↔ (c.order n).le x y := by - induction h with - | refl => rw [c.up_self, c.up_self] - | @step m h ih => rw [c.up_succ h, c.up_succ h, (c.next m).le_iff, ih] - -theorem up_ideal {n m : Nat} (h : n ≤ m) (a : c.Point n) (x : c.Point m) - (lower : (c.order m).le x (c.up h a)) : ∃ b, c.up h b = x := by - induction h with - | refl => exact ⟨x, c.up_self _ _⟩ - | @step m h ih => - rw [c.up_succ h] at lower - rcases (c.next m).ideal (c.up h a) x lower with ⟨y, rfl⟩ - rcases ih y (((c.next m).le_iff _ _).mp lower) with ⟨b, eq⟩ - exact ⟨b, by rw [c.up_succ h, eq]⟩ - -noncomputable def raise {n m : Nat} (h : n ≤ m) : IdealEmbedding (c.order n) (c.order m) := - IdealEmbedding.ofOrderMap (c.up h) (c.up_le h) (c.up_ideal h) - -def Label := (n : Nat) × c.Point n - -def Related (x y : c.Label) : Prop := - ∃ (k : Nat) (hx : x.1 ≤ k) (hy : y.1 ≤ k), c.up hx x.2 = c.up hy y.2 - -theorem related_refl (x : c.Label) : c.Related x x := ⟨x.1, le_refl _, le_refl _, rfl⟩ - -theorem related_symm {x y : c.Label} (h : c.Related x y) : c.Related y x := by - rcases h with ⟨k, hx, hy, eq⟩ - exact ⟨k, hy, hx, eq.symm⟩ - -theorem related_trans {x y z : c.Label} (hxy : c.Related x y) (hyz : c.Related y z) : - c.Related x z := by - rcases hxy with ⟨k, hx, hy, eq1⟩ - rcases hyz with ⟨l, hy', hz, eq2⟩ - refine ⟨max k l, le_trans hx (Nat.le_max_left _ _), le_trans hz (Nat.le_max_right _ _), ?_⟩ - calc - c.up _ x.2 = c.up (Nat.le_max_left k l) (c.up hx x.2) := c.up_comp _ _ _ - _ = c.up (Nat.le_max_left k l) (c.up hy y.2) := congrArg _ eq1 - _ = c.up (Nat.le_max_right k l) (c.up hy' y.2) := - (c.up_comp _ _ _).symm.trans (c.up_comp _ _ _) - _ = c.up (Nat.le_max_right k l) (c.up hz z.2) := congrArg _ eq2 - _ = c.up _ z.2 := (c.up_comp _ _ _).symm - -def setoid : Setoid c.Label := ⟨c.Related, c.related_refl, c.related_symm, c.related_trans⟩ -def Union := Quotient c.setoid -def point (n : Nat) (x : c.Point n) : c.Union := Quotient.mk c.setoid ⟨n, x⟩ - -theorem include_up {n m : Nat} (h : n ≤ m) (x : c.Point n) : - c.point m (c.up h x) = c.point n x := by - apply Quotient.sound - exact ⟨m, le_refl _, h, c.up_self _ _⟩ - -theorem include_injective (n : Nat) : Function.Injective (c.point n) := by - intro x y eq - rcases Quotient.exact eq with ⟨k, hx, hy, same⟩ - exact embedding_injective (c.raise hx).toMeetEmbedding same - -theorem cover (x : c.Union) : ∃ n a, c.point n a = x := by - induction x using Quotient.ind with - | _ x => exact ⟨x.1, x.2, rfl⟩ - -theorem pair_cover (x y : c.Union) : - ∃ n a b, c.point n a = x ∧ c.point n b = y := by - rcases c.cover x with ⟨n, a, rfl⟩ - rcases c.cover y with ⟨m, b, rfl⟩ - exact ⟨max n m, c.up (Nat.le_max_left _ _) a, c.up (Nat.le_max_right _ _) b, - c.include_up _ _, c.include_up _ _⟩ - -def Le (x y : c.Union) : Prop := - ∃ n a b, c.point n a = x ∧ c.point n b = y ∧ (c.order n).le a b - -theorem le_stage (n : Nat) (a b : c.Point n) : - c.Le (c.point n a) (c.point n b) ↔ (c.order n).le a b := by - constructor - · rintro ⟨m, x, y, hx, hy, lower⟩ - let k := max n m - have ex : c.up (Nat.le_max_right n m) x = c.up (Nat.le_max_left n m) a := by - apply c.include_injective k - rw [c.include_up, c.include_up] - exact hx - have ey : c.up (Nat.le_max_right n m) y = c.up (Nat.le_max_left n m) b := by - apply c.include_injective k - rw [c.include_up, c.include_up] - exact hy - have lifted := (c.up_le (Nat.le_max_right n m) x y).mpr lower - rw [ex, ey] at lifted - exact (c.up_le (Nat.le_max_left n m) a b).mp lifted - · intro h - exact ⟨n, a, b, rfl, rfl, h⟩ - -theorem le_refl (x : c.Union) : c.Le x x := by - rcases c.cover x with ⟨n, a, rfl⟩ - exact (c.le_stage n a a).mpr ((c.order n).refl a) - -theorem le_trans {x y z : c.Union} (hxy : c.Le x y) (hyz : c.Le y z) : c.Le x z := by - rcases hxy with ⟨n, a, b, ha, hb, lower1⟩ - rcases hyz with ⟨m, d, e, hd, he, lower2⟩ - have middle : c.up (Nat.le_max_left n m) b = c.up (Nat.le_max_right n m) d := by - apply c.include_injective (max n m) - rw [c.include_up, c.include_up] - exact hb.trans hd.symm - have left := (c.up_le (Nat.le_max_left n m) a b).mpr lower1 - rw [middle] at left - exact ⟨max n m, _, _, (c.include_up _ _).trans ha, (c.include_up _ _).trans he, - (c.order _).trans left ((c.up_le (Nat.le_max_right n m) d e).mpr lower2)⟩ - -theorem le_antisymm {x y : c.Union} (hxy : c.Le x y) (hyx : c.Le y x) : x = y := by - rcases c.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - exact congrArg (c.point n) ((c.order n).antisymm - ((c.le_stage _ _ _).mp hxy) ((c.le_stage _ _ _).mp hyx)) - -theorem include_ideal (n : Nat) (a : c.Point n) (x : c.Union) (lower : c.Le x (c.point n a)) : - ∃ b, c.point n b = x := by - rcases c.cover x with ⟨m, b, rfl⟩ - have lifted : c.Le (c.point (max n m) (c.up (Nat.le_max_right n m) b)) - (c.point (max n m) (c.up (Nat.le_max_left n m) a)) := by - rw [c.include_up, c.include_up] - exact lower - rcases c.up_ideal (Nat.le_max_left n m) a _ ((c.le_stage _ _ _).mp lifted) with ⟨d, eq⟩ - refine ⟨d, ?_⟩ - rw [← c.include_up (Nat.le_max_left n m) d, eq, c.include_up] - -theorem stage_meet_spec (n : Nat) (a b : c.Point n) : - c.Le (c.point n ((c.order n).meet a b)) (c.point n a) ∧ - c.Le (c.point n ((c.order n).meet a b)) (c.point n b) ∧ - ∀ z, c.Le z (c.point n a) → c.Le z (c.point n b) → - c.Le z (c.point n ((c.order n).meet a b)) := by - refine ⟨(c.le_stage _ _ _).mpr ((c.order n).meet_le_left a b), - (c.le_stage _ _ _).mpr ((c.order n).meet_le_right a b), ?_⟩ - intro z hza hzb - rcases c.include_ideal n a z hza with ⟨d, rfl⟩ - exact (c.le_stage _ _ _).mpr ((c.order n).le_meet - ((c.le_stage _ _ _).mp hza) ((c.le_stage _ _ _).mp hzb)) - -theorem meets_exist (x y : c.Union) : - ∃ m, c.Le m x ∧ c.Le m y ∧ ∀ z, c.Le z x → c.Le z y → c.Le z m := by - rcases c.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - exact ⟨c.point n ((c.order n).meet a b), c.stage_meet_spec n a b⟩ - -noncomputable def unionOrder : MeetOrder c.Union where - le := c.Le - meet x y := Classical.choose (c.meets_exist x y) - refl := c.le_refl - trans := c.le_trans - antisymm := c.le_antisymm - meet_le_left x y := (Classical.choose_spec (c.meets_exist x y)).1 - meet_le_right x y := (Classical.choose_spec (c.meets_exist x y)).2.1 - le_meet {z x y} := (Classical.choose_spec (c.meets_exist x y)).2.2 z - -noncomputable def inclusion (n : Nat) : IdealEmbedding (c.order n) c.unionOrder := - IdealEmbedding.ofOrderMap (c.point n) (c.le_stage n) (c.include_ideal n) - -theorem vertex_preserved (n : Nat) {V : Type u} {Q : MeetOrder V} - (f : IdealEmbedding Q (c.order n)) : - ∃ e : IdealEmbedding Q c.unionOrder, ∀ x, e.toFun x = c.point n (f.toFun x) := - ⟨f.comp (c.inclusion n), fun _ => rfl⟩ - -end IdealChain -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.PrincipalBatch + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u + +structure IdealChain where + Point : Nat → Type u + order : ∀ n, MeetOrder (Point n) + next : ∀ n, IdealEmbedding (order n) (order (n + 1)) + +namespace IdealChain +variable (c : IdealChain.{u}) + +noncomputable def up {n m : Nat} (h : n ≤ m) (x : c.Point n) : c.Point m := + Nat.leRecOn h (fun {k} x => (c.next k).toFun x) x + +theorem up_self (n : Nat) (x : c.Point n) : c.up (Nat.le_refl n) x = x := + Nat.leRecOn_self x + +theorem up_succ {n m : Nat} (h : n ≤ m) (x : c.Point n) : + c.up (Nat.le_succ_of_le h) x = (c.next m).toFun (c.up h x) := + Nat.leRecOn_succ h x + +theorem up_comp {n m k : Nat} (hnm : n ≤ m) (hmk : m ≤ k) (x : c.Point n) : + c.up (Nat.le_trans hnm hmk) x = c.up hmk (c.up hnm x) := + Nat.leRecOn_trans hnm hmk x + +theorem up_le {n m : Nat} (h : n ≤ m) (x y : c.Point n) : + (c.order m).le (c.up h x) (c.up h y) ↔ (c.order n).le x y := by + induction h with + | refl => rw [c.up_self, c.up_self] + | @step m h ih => rw [c.up_succ h, c.up_succ h, (c.next m).le_iff, ih] + +theorem up_ideal {n m : Nat} (h : n ≤ m) (a : c.Point n) (x : c.Point m) + (lower : (c.order m).le x (c.up h a)) : ∃ b, c.up h b = x := by + induction h with + | refl => exact ⟨x, c.up_self _ _⟩ + | @step m h ih => + rw [c.up_succ h] at lower + rcases (c.next m).ideal (c.up h a) x lower with ⟨y, rfl⟩ + rcases ih y (((c.next m).le_iff _ _).mp lower) with ⟨b, eq⟩ + exact ⟨b, by rw [c.up_succ h, eq]⟩ + +noncomputable def raise {n m : Nat} (h : n ≤ m) : IdealEmbedding (c.order n) (c.order m) := + IdealEmbedding.ofOrderMap (c.up h) (c.up_le h) (c.up_ideal h) + +def Label := (n : Nat) × c.Point n + +def Related (x y : c.Label) : Prop := + ∃ (k : Nat) (hx : x.1 ≤ k) (hy : y.1 ≤ k), c.up hx x.2 = c.up hy y.2 + +theorem related_refl (x : c.Label) : c.Related x x := ⟨x.1, le_refl _, le_refl _, rfl⟩ + +theorem related_symm {x y : c.Label} (h : c.Related x y) : c.Related y x := by + rcases h with ⟨k, hx, hy, eq⟩ + exact ⟨k, hy, hx, eq.symm⟩ + +theorem related_trans {x y z : c.Label} (hxy : c.Related x y) (hyz : c.Related y z) : + c.Related x z := by + rcases hxy with ⟨k, hx, hy, eq1⟩ + rcases hyz with ⟨l, hy', hz, eq2⟩ + refine ⟨max k l, le_trans hx (Nat.le_max_left _ _), le_trans hz (Nat.le_max_right _ _), ?_⟩ + calc + c.up _ x.2 = c.up (Nat.le_max_left k l) (c.up hx x.2) := c.up_comp _ _ _ + _ = c.up (Nat.le_max_left k l) (c.up hy y.2) := congrArg _ eq1 + _ = c.up (Nat.le_max_right k l) (c.up hy' y.2) := + (c.up_comp _ _ _).symm.trans (c.up_comp _ _ _) + _ = c.up (Nat.le_max_right k l) (c.up hz z.2) := congrArg _ eq2 + _ = c.up _ z.2 := (c.up_comp _ _ _).symm + +def setoid : Setoid c.Label := ⟨c.Related, c.related_refl, c.related_symm, c.related_trans⟩ +def Union := Quotient c.setoid +def point (n : Nat) (x : c.Point n) : c.Union := Quotient.mk c.setoid ⟨n, x⟩ + +theorem include_up {n m : Nat} (h : n ≤ m) (x : c.Point n) : + c.point m (c.up h x) = c.point n x := by + apply Quotient.sound + exact ⟨m, le_refl _, h, c.up_self _ _⟩ + +theorem include_injective (n : Nat) : Function.Injective (c.point n) := by + intro x y eq + rcases Quotient.exact eq with ⟨k, hx, hy, same⟩ + exact embedding_injective (c.raise hx).toMeetEmbedding same + +theorem cover (x : c.Union) : ∃ n a, c.point n a = x := by + induction x using Quotient.ind with + | _ x => exact ⟨x.1, x.2, rfl⟩ + +theorem pair_cover (x y : c.Union) : + ∃ n a b, c.point n a = x ∧ c.point n b = y := by + rcases c.cover x with ⟨n, a, rfl⟩ + rcases c.cover y with ⟨m, b, rfl⟩ + exact ⟨max n m, c.up (Nat.le_max_left _ _) a, c.up (Nat.le_max_right _ _) b, + c.include_up _ _, c.include_up _ _⟩ + +def Le (x y : c.Union) : Prop := + ∃ n a b, c.point n a = x ∧ c.point n b = y ∧ (c.order n).le a b + +theorem le_stage (n : Nat) (a b : c.Point n) : + c.Le (c.point n a) (c.point n b) ↔ (c.order n).le a b := by + constructor + · rintro ⟨m, x, y, hx, hy, lower⟩ + let k := max n m + have ex : c.up (Nat.le_max_right n m) x = c.up (Nat.le_max_left n m) a := by + apply c.include_injective k + rw [c.include_up, c.include_up] + exact hx + have ey : c.up (Nat.le_max_right n m) y = c.up (Nat.le_max_left n m) b := by + apply c.include_injective k + rw [c.include_up, c.include_up] + exact hy + have lifted := (c.up_le (Nat.le_max_right n m) x y).mpr lower + rw [ex, ey] at lifted + exact (c.up_le (Nat.le_max_left n m) a b).mp lifted + · intro h + exact ⟨n, a, b, rfl, rfl, h⟩ + +theorem le_refl (x : c.Union) : c.Le x x := by + rcases c.cover x with ⟨n, a, rfl⟩ + exact (c.le_stage n a a).mpr ((c.order n).refl a) + +theorem le_trans {x y z : c.Union} (hxy : c.Le x y) (hyz : c.Le y z) : c.Le x z := by + rcases hxy with ⟨n, a, b, ha, hb, lower1⟩ + rcases hyz with ⟨m, d, e, hd, he, lower2⟩ + have middle : c.up (Nat.le_max_left n m) b = c.up (Nat.le_max_right n m) d := by + apply c.include_injective (max n m) + rw [c.include_up, c.include_up] + exact hb.trans hd.symm + have left := (c.up_le (Nat.le_max_left n m) a b).mpr lower1 + rw [middle] at left + exact ⟨max n m, _, _, (c.include_up _ _).trans ha, (c.include_up _ _).trans he, + (c.order _).trans left ((c.up_le (Nat.le_max_right n m) d e).mpr lower2)⟩ + +theorem le_antisymm {x y : c.Union} (hxy : c.Le x y) (hyx : c.Le y x) : x = y := by + rcases c.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + exact congrArg (c.point n) ((c.order n).antisymm + ((c.le_stage _ _ _).mp hxy) ((c.le_stage _ _ _).mp hyx)) + +theorem include_ideal (n : Nat) (a : c.Point n) (x : c.Union) (lower : c.Le x (c.point n a)) : + ∃ b, c.point n b = x := by + rcases c.cover x with ⟨m, b, rfl⟩ + have lifted : c.Le (c.point (max n m) (c.up (Nat.le_max_right n m) b)) + (c.point (max n m) (c.up (Nat.le_max_left n m) a)) := by + rw [c.include_up, c.include_up] + exact lower + rcases c.up_ideal (Nat.le_max_left n m) a _ ((c.le_stage _ _ _).mp lifted) with ⟨d, eq⟩ + refine ⟨d, ?_⟩ + rw [← c.include_up (Nat.le_max_left n m) d, eq, c.include_up] + +theorem stage_meet_spec (n : Nat) (a b : c.Point n) : + c.Le (c.point n ((c.order n).meet a b)) (c.point n a) ∧ + c.Le (c.point n ((c.order n).meet a b)) (c.point n b) ∧ + ∀ z, c.Le z (c.point n a) → c.Le z (c.point n b) → + c.Le z (c.point n ((c.order n).meet a b)) := by + refine ⟨(c.le_stage _ _ _).mpr ((c.order n).meet_le_left a b), + (c.le_stage _ _ _).mpr ((c.order n).meet_le_right a b), ?_⟩ + intro z hza hzb + rcases c.include_ideal n a z hza with ⟨d, rfl⟩ + exact (c.le_stage _ _ _).mpr ((c.order n).le_meet + ((c.le_stage _ _ _).mp hza) ((c.le_stage _ _ _).mp hzb)) + +theorem meets_exist (x y : c.Union) : + ∃ m, c.Le m x ∧ c.Le m y ∧ ∀ z, c.Le z x → c.Le z y → c.Le z m := by + rcases c.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + exact ⟨c.point n ((c.order n).meet a b), c.stage_meet_spec n a b⟩ + +noncomputable def unionOrder : MeetOrder c.Union where + le := c.Le + meet x y := Classical.choose (c.meets_exist x y) + refl := c.le_refl + trans := c.le_trans + antisymm := c.le_antisymm + meet_le_left x y := (Classical.choose_spec (c.meets_exist x y)).1 + meet_le_right x y := (Classical.choose_spec (c.meets_exist x y)).2.1 + le_meet {z x y} := (Classical.choose_spec (c.meets_exist x y)).2.2 z + +noncomputable def inclusion (n : Nat) : IdealEmbedding (c.order n) c.unionOrder := + IdealEmbedding.ofOrderMap (c.point n) (c.le_stage n) (c.include_ideal n) + +theorem vertex_preserved (n : Nat) {V : Type u} {Q : MeetOrder V} + (f : IdealEmbedding Q (c.order n)) : + ∃ e : IdealEmbedding Q c.unionOrder, ∀ x, e.toFun x = c.point n (f.toFun x) := + ⟨f.comp (c.inclusion n), fun _ => rfl⟩ + +end IdealChain +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealInsertionProfileTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealInsertionProfileTransport.lean index efa40b708bbfb17936773219621e38a576b1aa9a..9c0fc1555ae9b247c91a24f421e7124ce7de9b09 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealInsertionProfileTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IdealInsertionProfileTransport.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHeightPushforward - -namespace OAI - -section - -namespace PartitionPilot.Forcing.IdealEmbeddingCode -open Compression Compression.RecursiveMaps -universe u -variable {P Q rP rQ μP μQ e : ZFSet.{u}} -variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) -variable (source : MeetOrderCode P rP μP) (target : MeetOrderCode Q rQ μQ) - -noncomputable def toIdealEmbedding : IdealEmbedding source.toMeetOrder target.toMeetOrder where - toMeetEmbedding := code.toMeetEmbeddingCode.toMeetEmbedding source target - ideal v z lower := by - obtain ⟨x, hx, _, entry⟩ := code.ideal v.val _ z.val - (code.toMeetEmbeddingCode.toMeetEmbedding_entry source target v) z.property lower - exact ⟨⟨x, hx⟩, (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target ⟨x,hx⟩ z).2 entry⟩ - -include code source target in -theorem capProfile {top c v K F c' v' K' : ZFSet.{u}} - (hTop : top ∈ P) (greatest : ∀ x ∈ P, ZFSet.pair x top ∈ rP) - (profile : CodedCapProfile P rP μP c v K F) - (imageC : ZFSet.pair c c' ∈ e) (imageV : ZFSet.pair v v' ∈ e) (imageK : ZFSet.pair K K' ∈ e) : - CodedCapProfile Q rQ μQ c' v' K' (relationImage F Q e) := by - let embed := code.toIdealEmbedding source target - have hc' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 imageC)).2 - have hv' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 imageV)).2 - have hK' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 imageK)).2 - have subset : relationImage F Q e ⊆ Q := by - intro x hx - exact ((mem_relationImage _ _ _ _).1 hx).1 - have nonempty : ∃ f, f ∈ relationImage F Q e := by - obtain ⟨f, hf⟩ := profile.nonempty - obtain ⟨y, entry, _⟩ := code.injection.function.2 f (profile.filter_subset hf) - exact ⟨y, (mem_relationImage _ _ _ _).2 ⟨(ZFSet.pair_mem_prod.1 (code.injection.function.1 entry)).2, f, hf, entry⟩⟩ - have old := (CodedInsertionProfile.iff_profile source profile.target_mem profile.separator_mem profile.cap_mem - profile.filter_subset).1 profile.profile - have ne : ∃ f : {f : ZFSet.{u} // f ∈ P}, f.val ∈ F := by - obtain ⟨f, hf⟩ := profile.nonempty - exact ⟨⟨f, profile.filter_subset hf⟩, hf⟩ - have inherited := embed.preservesProfiles ⟨top,hTop⟩ (fun x => greatest x.val x.property) - ⟨c,profile.target_mem⟩ ⟨v,profile.separator_mem⟩ ⟨K,profile.cap_mem⟩ (fun f => f.val ∈ F) - ne profile.separator_not_below_cap old - have ec : embed.toFun ⟨c,profile.target_mem⟩ = ⟨c',hc'⟩ := - (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ _).2 imageC - have ev : embed.toFun ⟨v,profile.separator_mem⟩ = ⟨v',hv'⟩ := - (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ _).2 imageV - have ek : embed.toFun ⟨K,profile.cap_mem⟩ = ⟨K',hK'⟩ := - (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ _).2 imageK - have pred : (fun y : {y : ZFSet.{u} // y ∈ Q} => y.val ∈ relationImage F Q e) = - imageFamily embed.toMeetEmbedding (fun f => f.val ∈ F) := by - funext y - apply propext - rw [mem_relationImage] - constructor - · rintro ⟨_, x, hx, entry⟩ - exact ⟨⟨x,profile.filter_subset hx⟩, hx, - (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ y).2 entry⟩ - · rintro ⟨x, hx, equal⟩ - exact ⟨y.property, x.val, hx, - (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target x y).1 equal⟩ - have transported := (profileOver_iff_image embed.toMeetEmbedding _ _ _ _).1 inherited - rw [ec, ev, ek, ← pred] at transported - exact ⟨hc', hv', hK', subset, nonempty, - (CodedInsertionProfile.iff_profile target hc' hv' hK' subset).2 transported, - code.monotone _ _ _ _ profile.target_below_cap imageC imageK, - fun lower => profile.cap_not_below_target (code.reflect _ _ _ _ imageK imageC lower), - fun lower => profile.separator_not_below_cap (code.reflect _ _ _ _ imageV imageK lower)⟩ - -end PartitionPilot.Forcing.IdealEmbeddingCode - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHeightPushforward + +namespace OAI + +section + +namespace PartitionPilot.Forcing.IdealEmbeddingCode +open Compression Compression.RecursiveMaps +universe u +variable {P Q rP rQ μP μQ e : ZFSet.{u}} +variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) +variable (source : MeetOrderCode P rP μP) (target : MeetOrderCode Q rQ μQ) + +noncomputable def toIdealEmbedding : IdealEmbedding source.toMeetOrder target.toMeetOrder where + toMeetEmbedding := code.toMeetEmbeddingCode.toMeetEmbedding source target + ideal v z lower := by + obtain ⟨x, hx, _, entry⟩ := code.ideal v.val _ z.val + (code.toMeetEmbeddingCode.toMeetEmbedding_entry source target v) z.property lower + exact ⟨⟨x, hx⟩, (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target ⟨x,hx⟩ z).2 entry⟩ + +include code source target in +theorem capProfile {top c v K F c' v' K' : ZFSet.{u}} + (hTop : top ∈ P) (greatest : ∀ x ∈ P, ZFSet.pair x top ∈ rP) + (profile : CodedCapProfile P rP μP c v K F) + (imageC : ZFSet.pair c c' ∈ e) (imageV : ZFSet.pair v v' ∈ e) (imageK : ZFSet.pair K K' ∈ e) : + CodedCapProfile Q rQ μQ c' v' K' (relationImage F Q e) := by + let embed := code.toIdealEmbedding source target + have hc' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 imageC)).2 + have hv' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 imageV)).2 + have hK' := (ZFSet.pair_mem_prod.1 (code.injection.function.1 imageK)).2 + have subset : relationImage F Q e ⊆ Q := by + intro x hx + exact ((mem_relationImage _ _ _ _).1 hx).1 + have nonempty : ∃ f, f ∈ relationImage F Q e := by + obtain ⟨f, hf⟩ := profile.nonempty + obtain ⟨y, entry, _⟩ := code.injection.function.2 f (profile.filter_subset hf) + exact ⟨y, (mem_relationImage _ _ _ _).2 ⟨(ZFSet.pair_mem_prod.1 (code.injection.function.1 entry)).2, f, hf, entry⟩⟩ + have old := (CodedInsertionProfile.iff_profile source profile.target_mem profile.separator_mem profile.cap_mem + profile.filter_subset).1 profile.profile + have ne : ∃ f : {f : ZFSet.{u} // f ∈ P}, f.val ∈ F := by + obtain ⟨f, hf⟩ := profile.nonempty + exact ⟨⟨f, profile.filter_subset hf⟩, hf⟩ + have inherited := embed.preservesProfiles ⟨top,hTop⟩ (fun x => greatest x.val x.property) + ⟨c,profile.target_mem⟩ ⟨v,profile.separator_mem⟩ ⟨K,profile.cap_mem⟩ (fun f => f.val ∈ F) + ne profile.separator_not_below_cap old + have ec : embed.toFun ⟨c,profile.target_mem⟩ = ⟨c',hc'⟩ := + (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ _).2 imageC + have ev : embed.toFun ⟨v,profile.separator_mem⟩ = ⟨v',hv'⟩ := + (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ _).2 imageV + have ek : embed.toFun ⟨K,profile.cap_mem⟩ = ⟨K',hK'⟩ := + (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ _).2 imageK + have pred : (fun y : {y : ZFSet.{u} // y ∈ Q} => y.val ∈ relationImage F Q e) = + imageFamily embed.toMeetEmbedding (fun f => f.val ∈ F) := by + funext y + apply propext + rw [mem_relationImage] + constructor + · rintro ⟨_, x, hx, entry⟩ + exact ⟨⟨x,profile.filter_subset hx⟩, hx, + (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target _ y).2 entry⟩ + · rintro ⟨x, hx, equal⟩ + exact ⟨y.property, x.val, hx, + (code.toMeetEmbeddingCode.toMeetEmbedding_eq_iff source target x y).1 equal⟩ + have transported := (profileOver_iff_image embed.toMeetEmbedding _ _ _ _).1 inherited + rw [ec, ev, ek, ← pred] at transported + exact ⟨hc', hv', hK', subset, nonempty, + (CodedInsertionProfile.iff_profile target hc' hv' hK' subset).2 transported, + code.monotone _ _ _ _ profile.target_below_cap imageC imageK, + fun lower => profile.cap_not_below_target (code.reflect _ _ _ _ imageK imageC lower), + fun lower => profile.separator_not_below_cap (code.reflect _ _ _ _ imageV imageK lower)⟩ + +end PartitionPilot.Forcing.IdealEmbeddingCode + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IndexedTupleNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IndexedTupleNames.lean index 17e2a6851b0541670826485658e400bc144b4f1a..02420d7bc59297917b70421de2a694f5a6fdba9e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IndexedTupleNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/IndexedTupleNames.lean @@ -1,906 +1,906 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CheckCertificates - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_checkState_fixedPoint - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (top : ZFSet.{u}) (htop : top ∈ M.sets) (B : ZFSet.{u}) (hB : B ∈ M.sets) : - ∃ R ∈ M.sets, R ⊆ B ∧ - definableOperator M.sets checkStateFormula (extend top Fin.elim0) B R = R := by - have mono : ∀ R ∈ M.sets, ∀ S ∈ M.sets, R ⊆ B → S ⊆ B → R ⊆ S → - definableOperator M.sets checkStateFormula (extend top Fin.elim0) B R ⊆ - definableOperator M.sets checkStateFormula (extend top Fin.elim0) B S := by - intro R hr S hs _ _ sub z hz - obtain ⟨hzB, step⟩ := ZFSet.mem_sep.1 hz - have hzM := M.transitive hB hzB - obtain ⟨x, hx, y, hy, shape, raw⟩ := (M.realize_checkState pairing top z R htop hzM hr).1 step - exact ZFSet.mem_sep.2 ⟨hzB, (M.realize_checkState pairing top z S htop hzM hs).2 - ⟨x, hx, y, hy, shape, M.rawCheckStep_mono sub raw⟩⟩ - obtain ⟨R, hr, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation - checkStateFormula (extend top Fin.elim0) (Fin.cases htop (fun i => Fin.elim0 i)) hB mono - exact ⟨R, hr, bound, fixed⟩ - -theorem exists_groundCheck_certificate {P : Type u} (s : Presentation P) (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hone : s.encode one ∈ M.sets) (x : ZFSet.{u}) (hx : x ∈ M.sets) - (hcheck : (Name.check s one x).val ∈ M.sets) : - ∃ R ∈ M.sets, Realize M.sets checkCertificateFormula (extend R (extend (s.encode one) Fin.elim0)) ∧ - ZFSet.pair x (Name.check s one x).val ∈ R := by - obtain ⟨T, hT, xT, checkT, trans⟩ := M.exists_pair_transitiveCover pairing unions separation collection hx hcheck - let N : TransitiveGround.{u} := ⟨{z | z ∈ T}, fun hz hy => trans _ hz _ hy⟩ - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT - obtain ⟨R, hr, bound, fixed⟩ := M.exists_checkState_fixedPoint pairing unions powers separation - (s.encode one) hone B hB - have certificate : Realize M.sets checkCertificateFormula (extend R (extend (s.encode one) Fin.elim0)) := by - apply (M.realize_postfixedFormula checkStateFormula (extend (s.encode one) Fin.elim0) hr bound).2 - rw [fixed] - have complete : ∀ v, v ∈ T → (Name.check s one v).val ∈ T → - ZFSet.pair v (Name.check s one v).val ∈ R := by - intro v - induction v using ZFSet.inductionOn with - | h v ih => - intro hv hc - have childT : ∀ w ∈ v, (Name.check s one w).val ∈ T := by - intro w hw - exact (N.nameDomain s).children hc ((Name.entry_check one v (Name.check s one w) one).2 - ⟨w, hw, rfl, rfl⟩) - have raw : M.RawCheckStep (s.encode one) R v (Name.check s one v).val := by - constructor - · intro w hw - exact ⟨(Name.check s one w).val, M.transitive hT (childT w hw), - ih w hw (trans _ hv _ hw) (childT w hw), - (Name.mem_check_code s one v _).2 ⟨w, hw, rfl⟩⟩ - · intro z hz - obtain ⟨w, hw, eq⟩ := (Name.mem_check_code s one v z).1 hz - exact ⟨w, hw, (Name.check s one w).val, M.transitive hT (childT w hw), - ih w hw (trans _ hv _ hw) (childT w hw), eq⟩ - have member : ZFSet.pair v (Name.check s one v).val ∈ - definableOperator M.sets checkStateFormula (extend (s.encode one) Fin.elim0) B R := - ZFSet.mem_sep.2 ⟨pairBound v hv (Name.check s one v).val hc, - (M.realize_checkState pairing (s.encode one) _ R hone - (M.orderedPair_mem pairing (M.transitive hT hv) (M.transitive hT hc)) hr).2 - ⟨v, M.transitive hT hv, (Name.check s one v).val, M.transitive hT hc, rfl, raw⟩⟩ - rwa [fixed] at member - exact ⟨R, hr, certificate, complete x xT checkT⟩ - -theorem realize_uniformCheckFormula {P : Type u} (s : Presentation P) (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hone : s.encode one ∈ M.sets) (x y : ZFSet.{u}) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets uniformCheckFormula (extend x (extend y (extend (s.encode one) Fin.elim0))) ↔ - y = (Name.check s one x).val := by - rw [uniformCheckFormula, realize_ex] - constructor - · rintro ⟨R, hr, cert, rel⟩ - rw [realize_binaryApplication, map_empty] at cert - exact M.checkCertificate_sound s one pairing hone hr cert x hx y hy - ((M.realize_pairMembershipFormula pairing 1 2 0 - (extend R (extend x (extend y (extend (s.encode one) Fin.elim0)))) hx hy hr).1 rel) - · intro eq - obtain ⟨R, hr, cert, rel⟩ := M.exists_groundCheck_certificate s one pairing unions powers separation collection - hone x hx (eq ▸ hy) - refine ⟨R, hr, ?_, ?_⟩ - · rw [realize_binaryApplication, map_empty] - exact cert - · apply (M.realize_pairMembershipFormula pairing 1 2 0 - (extend R (extend x (extend y (extend (s.encode one) Fin.elim0)))) hx hy hr).2 - rwa [eq] - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def checkEntryFormula : SetFormula 3 := - ex (ex (.conj (.mem 1 3) - (.conj (binaryApplication uniformCheckFormula (extend 4 Fin.elim0) 1 0) - (orderedPairFormula 2 0 4)))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem realize_checkEntryFormula (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hone : s.encode one ∈ M.sets) (x z : ZFSet.{u}) (hx : x ∈ M.sets) (hz : z ∈ M.sets) - (children : ∀ v ∈ x, (Name.check s one v).val ∈ M.sets) : - Realize M.sets checkEntryFormula (extend z (extend x (extend (s.encode one) Fin.elim0))) ↔ - z ∈ (Name.check s one x).val := by - rw [checkEntryFormula, realize_ex, Name.mem_check_code] - constructor - · rintro ⟨v, hv, body⟩ - obtain ⟨w, hw, member, checked, shape⟩ := (realize_ex M.sets _ _).1 body - rw [realize_binaryApplication, map_extend, map_empty] at checked - have eq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v w hv hw).1 checked - have pair := (M.realize_orderedPairFormula pairing 2 0 4 - (extend w (extend v (extend z (extend x (extend (s.encode one) Fin.elim0))))) hz hw hone).1 shape - exact ⟨v, member, pair.trans (congrArg (fun q => ZFSet.pair q (s.encode one)) eq)⟩ - · rintro ⟨v, member, eq⟩ - refine ⟨v, M.transitive hx member, ?_⟩ - rw [realize_ex] - refine ⟨(Name.check s one v).val, children v member, member, ?_, ?_⟩ - · rw [realize_binaryApplication, map_extend, map_empty] - exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v _ - (M.transitive hx member) (children v member)).2 rfl - · exact (M.realize_orderedPairFormula pairing 2 0 4 - (extend (Name.check s one v).val (extend v (extend z (extend x (extend (s.encode one) Fin.elim0))))) - hz (children v member) hone).2 eq - -theorem check_mem (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hone : s.encode one ∈ M.sets) : - ∀ x ∈ M.sets, (Name.check s one x).val ∈ M.sets := by - intro x - induction x using ZFSet.inductionOn with - | h x ih => - intro hx - have children : ∀ v ∈ x, (Name.check s one v).val ∈ M.sets := - fun v hv => ih v hv (M.transitive hx hv) - have witnesses : ∀ v ∈ x, ∃ w ∈ M.sets, - Realize M.sets uniformCheckFormula (extend v (extend w (extend (s.encode one) Fin.elim0))) := by - intro v hv - exact ⟨(Name.check s one v).val, children v hv, - (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v _ - (M.transitive hx hv) (children v hv)).2 rfl⟩ - obtain ⟨W, hW, covers⟩ := M.collection_witness collection uniformCheckFormula (extend (s.encode one) Fin.elim0) - (Fin.cases hone (fun i => Fin.elim0 i)) hx witnesses - have inW : ∀ v ∈ x, (Name.check s one v).val ∈ W := by - intro v hv - obtain ⟨w, hw, rel⟩ := covers v hv - have eq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v w - (M.transitive hx hv) (M.transitive hW hw)).1 rel - exact eq ▸ hw - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW - (M.unorderedPair_mem pairing hone hone) - have bound : (Name.check s one x).val ⊆ B := by - intro z hz - obtain ⟨v, hv, rfl⟩ := (Name.mem_check_code s one x z).1 hz - exact pairBound _ (inW v hv) _ (ZFSet.mem_pair.2 (Or.inl rfl)) - have selected := M.separation_mem separation checkEntryFormula (extend x (extend (s.encode one) Fin.elim0)) - (Fin.cases hx (Fin.cases hone (fun i => Fin.elim0 i))) hB - have eq : ZFSet.sep (fun z => Realize M.sets checkEntryFormula - (extend z (extend x (extend (s.encode one) Fin.elim0)))) B = (Name.check s one x).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (M.realize_checkEntryFormula s one pairing unions powers separation collection hone x z hx - (M.transitive hB hz) children).1 rel - · intro hz - exact ⟨bound hz, (M.realize_checkEntryFormula s one pairing unions powers separation collection hone x z hx - (M.transitive hB (bound hz)) children).2 hz⟩ - exact eq ▸ selected - -theorem ground_subset_symmetric_values {G : Type u} [Group G] [PartialOrder P] [OrderTop P] - (a : PosetAction G P) (F : Compression.RecursiveMaps.NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : - M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p} := by - intro x hx - exact (Name.NameDomain.mem_values _ _ _).2 ⟨Name.check s ⊤ x, - ⟨M.check_mem s ⊤ pairing unions powers separation collection (M.transitive carrier (s.encode_mem ⊤)) x hx, - HereditarilySymmetric.check a s F x⟩, Name.eval_check _ ⊤ H.top_mem x⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -noncomputable def pairNameCode (one x y : ZFSet.{u}) : ZFSet.{u} := - {ZFSet.pair x one, ZFSet.pair y one} - -noncomputable def orderedPairNameCode (one x y : ZFSet.{u}) : ZFSet.{u} := - pairNameCode one (pairNameCode one x x) (pairNameCode one x y) - -namespace Name -variable {P : Type u} {s : Presentation P} - -theorem orderedPair_code (one : P) (σ τ : Name s) : - (orderedPair one σ τ).val = orderedPairNameCode (s.encode one) σ.val τ.val := by - have single : singleton one σ = unorderedPair one σ σ := by - apply Name.ext - intro ν p - simp only [singleton, unorderedPair, entry_assemble] - constructor - · rintro ⟨_, rfl, rfl⟩ - exact ⟨true, rfl, rfl⟩ - · rintro ⟨b, equal, rfl⟩ - have same : (if b then σ else σ) = σ := by split <;> rfl - exact ⟨(), same.symm.trans equal, rfl⟩ - rw [orderedPair, single] - rw [TransitiveGround.pairName_code, TransitiveGround.pairName_code, - TransitiveGround.pairName_code] - rfl - -end Name - -namespace SetFormula - -def pairNameCodeFormula {n} (z x y one : Fin n) : SetFormula n := - ex (ex (.conj (orderedPairFormula 1 x.succ.succ one.succ.succ) - (.conj (orderedPairFormula 0 y.succ.succ one.succ.succ) - (unorderedPairFormula z.succ.succ 1 0)))) - -def orderedPairNameCodeFormula {n} (z x y one : Fin n) : SetFormula n := - ex (ex (.conj (pairNameCodeFormula 1 x.succ.succ x.succ.succ one.succ.succ) - (.conj (pairNameCodeFormula 0 x.succ.succ y.succ.succ one.succ.succ) - (pairNameCodeFormula z.succ.succ 1 0 one.succ.succ)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem pairNameCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {one x y : ZFSet.{u}} (hone : one ∈ M.sets) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : - pairNameCode one x y ∈ M.sets := - M.unorderedPair_mem pairing (M.orderedPair_mem pairing hx hone) (M.orderedPair_mem pairing hy hone) - -theorem orderedPairNameCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {one x y : ZFSet.{u}} (hone : one ∈ M.sets) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : - orderedPairNameCode one x y ∈ M.sets := - M.pairNameCode_mem pairing hone (M.pairNameCode_mem pairing hone hx hx) - (M.pairNameCode_mem pairing hone hx hy) - -theorem realize_pairNameCodeFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n} (z x y one : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (pairNameCodeFormula z x y one) env ↔ - env z = pairNameCode (env one) (env x) (env y) := by - rw [pairNameCodeFormula, realize_ex] - constructor - · rintro ⟨a, ha, rest⟩ - obtain ⟨b, hb, left, right, shape⟩ := (realize_ex M.sets _ _).1 rest - have ea := (M.realize_orderedPairFormula pairing 1 x.succ.succ one.succ.succ - _ ha (members x) (members one)).1 left - have eb := (M.realize_orderedPairFormula pairing 0 y.succ.succ one.succ.succ - _ hb (members y) (members one)).1 right - have ez := (M.realize_unorderedPairFormula z.succ.succ 1 0 _ (members z) ha hb).1 shape - exact ez.trans (congrArg₂ (fun p q : ZFSet.{u} => ({p, q} : ZFSet.{u})) ea eb) - · intro equal - have ha := M.orderedPair_mem pairing (members x) (members one) - have hb := M.orderedPair_mem pairing (members y) (members one) - refine ⟨ZFSet.pair (env x) (env one), ha, ?_⟩ - rw [realize_ex] - refine ⟨ZFSet.pair (env y) (env one), hb, ?_, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing 1 x.succ.succ one.succ.succ - _ ha (members x) (members one)).2 rfl - · exact (M.realize_orderedPairFormula pairing 0 y.succ.succ one.succ.succ - _ hb (members y) (members one)).2 rfl - · exact (M.realize_unorderedPairFormula z.succ.succ 1 0 _ (members z) ha hb).2 equal - -theorem realize_orderedPairNameCodeFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n} (z x y one : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (orderedPairNameCodeFormula z x y one) env ↔ - env z = orderedPairNameCode (env one) (env x) (env y) := by - rw [orderedPairNameCodeFormula, realize_ex] - constructor - · rintro ⟨a, ha, rest⟩ - obtain ⟨b, hb, left, right, shape⟩ := (realize_ex M.sets _ _).1 rest - have all : ∀ j, (extend b (extend a env)) j ∈ M.sets := Fin.cases hb (Fin.cases ha members) - have ea := (M.realize_pairNameCodeFormula pairing 1 x.succ.succ x.succ.succ one.succ.succ _ all).1 left - have eb := (M.realize_pairNameCodeFormula pairing 0 x.succ.succ y.succ.succ one.succ.succ _ all).1 right - have ez := (M.realize_pairNameCodeFormula pairing z.succ.succ 1 0 one.succ.succ _ all).1 shape - exact ez.trans (congrArg₂ (pairNameCode (env one)) ea eb) - · intro equal - have ha := M.pairNameCode_mem pairing (members one) (members x) (members x) - have hb := M.pairNameCode_mem pairing (members one) (members x) (members y) - refine ⟨pairNameCode (env one) (env x) (env x), ha, ?_⟩ - rw [realize_ex] - have all : ∀ j, (extend (pairNameCode (env one) (env x) (env y)) - (extend (pairNameCode (env one) (env x) (env x)) env)) j ∈ M.sets := - Fin.cases hb (Fin.cases ha members) - exact ⟨pairNameCode (env one) (env x) (env y), hb, - (M.realize_pairNameCodeFormula pairing 1 x.succ.succ x.succ.succ one.succ.succ _ all).2 rfl, - (M.realize_pairNameCodeFormula pairing 0 x.succ.succ y.succ.succ one.succ.succ _ all).2 rfl, - (M.realize_pairNameCodeFormula pairing z.succ.succ 1 0 one.succ.succ _ all).2 equal⟩ - -end TransitiveGround - - - - - -def checkCodePresentation (one : ZFSet.{u}) : Presentation (ULift.{u} Unit) where - carrier := {one} - encode _ := one - injective := fun _ _ _ => Subsingleton.elim _ _ - mem_carrier x := by - rw [ZFSet.mem_singleton] - exact ⟨fun h => ⟨⟨()⟩, h.symm⟩, fun ⟨_, h⟩ => h.symm⟩ - -noncomputable def checkNameCode (one x : ZFSet.{u}) : ZFSet.{u} := - (Name.check (checkCodePresentation one) ⟨()⟩ x).val - -namespace Name - -theorem check_code_eq {P : Type u} (s : Presentation P) (one : P) (x : ZFSet.{u}) : - (check s one x).val = checkNameCode (s.encode one) x := by - induction x using ZFSet.inductionOn with - | h x ih => - apply ZFSet.ext - intro z - change z ∈ (check s one x).val ↔ z ∈ (check (checkCodePresentation (s.encode one)) ⟨()⟩ x).val - rw [mem_check_code, mem_check_code] - apply exists_congr - intro y - apply and_congr_right - intro hy - rw [ih y hy] - rfl - -end Name - -namespace SetFormula - -def checkNameCodeFormula {n} (output x one : Fin n) : SetFormula n := - binaryApplication uniformCheckFormula (extend one Fin.elim0) x output - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem checkNameCode_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {one x : ZFSet.{u}} (hone : one ∈ M.sets) (hx : x ∈ M.sets) : - checkNameCode one x ∈ M.sets := - M.check_mem (checkCodePresentation one) ⟨()⟩ pairing unions powers separation collection hone x hx - -theorem realize_checkNameCodeFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {n} (output x one : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (checkNameCodeFormula output x one) env ↔ - env output = checkNameCode (env one) (env x) := by - rw [checkNameCodeFormula, realize_binaryApplication, map_extend, map_empty] - exact M.realize_uniformCheckFormula (checkCodePresentation (env one)) ⟨()⟩ - pairing unions powers separation collection (members one) (env x) (env output) - (members x) (members output) - -end TransitiveGround - - - - - -namespace Name -variable {P : Type u} {s : Presentation P} {I f : ZFSet.{u}} - -noncomputable def indexedGraphName (one : P) (function : FunctionGraphOn I f) - (names : ∀ i, IsName s (function.value i)) : Name s := - assemble (fun i : I => orderedPair one (check s one i.val) - ⟨function.value i, names i⟩) (fun _ => one) - -theorem mem_indexedGraphName_code (one : P) (function : FunctionGraphOn I f) - (names : ∀ i, IsName s (function.value i)) (z : ZFSet.{u}) : - z ∈ (indexedGraphName one function names).val ↔ - ∃ i : I, z = ZFSet.pair - (orderedPairNameCode (s.encode one) (check s one i.val).val (function.value i)) - (s.encode one) := by - change z ∈ ZFSet.range _ ↔ _ - rw [ZFSet.mem_range] - apply exists_congr - intro index - let named : Name s := ⟨function.value index, names index⟩ - change ZFSet.pair (orderedPair one (check s one index.val) named).val (s.encode one) = z ↔ _ - rw [orderedPair_code] - exact eq_comm - -theorem mem_eval_indexedGraphName (H : Set P) (one : P) (hone : one ∈ H) - (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) (z : ZFSet.{u}) : - z ∈ eval H (indexedGraphName one function names) ↔ - ∃ i : I, ZFSet.pair i.val (eval H ⟨function.value i, names i⟩) = z := by - rw [indexedGraphName, mem_eval_assemble] - simp only [hone, true_and] - apply exists_congr - intro index - let named : Name s := ⟨function.value index, names index⟩ - change eval H (orderedPair one (check s one index.val) named) = z ↔ - ZFSet.pair index.val (eval H named) = z - rw [eval_orderedPair H one hone, eval_check H one hone] - -theorem pair_mem_eval_indexedGraphName (H : Set P) (one : P) (hone : one ∈ H) - (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) - (i : I.toSet) (x : ZFSet.{u}) : - ZFSet.pair i.val x ∈ eval H (indexedGraphName one function names) ↔ - eval H ⟨function.value i, names i⟩ = x := by - rw [mem_eval_indexedGraphName H one hone] - constructor - · rintro ⟨j, equal⟩ - have ji : j = i := Subtype.ext (ZFSet.pair_inj.1 equal).1 - subst j - exact (ZFSet.pair_inj.1 equal).2 - · intro equal - exact ⟨i, congrArg (ZFSet.pair i.val) equal⟩ - -theorem eval_indexedGraphName_function (H : Set P) (one : P) (hone : one ∈ H) - (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) : - ZFSet.IsFunc I (ZFSet.range (fun i : I => eval H ⟨function.value i, names i⟩)) - (eval H (indexedGraphName one function names)) := by - constructor - · intro z hz - obtain ⟨i, rfl⟩ := (mem_eval_indexedGraphName H one hone function names z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨i.property, ZFSet.mem_range.2 ⟨i, rfl⟩⟩ - · intro i hi - let j : I.toSet := ⟨i, hi⟩ - refine ⟨eval H ⟨function.value j, names j⟩, - (pair_mem_eval_indexedGraphName H one hone function names j _).2 rfl, ?_⟩ - intro x hx - exact ((pair_mem_eval_indexedGraphName H one hone function names j x).1 hx).symm - -end Name - -namespace SetFormula - -def indexedGraphValueFormula : SetFormula 4 := - ex (ex (.conj (pairMembershipFormula 2 1 4) - (.conj (binaryApplication uniformCheckFormula (extend 5 Fin.elim0) 2 0) - (orderedPairNameCodeFormula 3 0 1 5)))) - -def indexedGraphNameEntryFormula : SetFormula 4 := - ex (ex (.conj (.mem 1 3) - (.conj (binaryApplication indexedGraphValueFormula (extend 4 (extend 5 Fin.elim0)) 1 0) - (orderedPairFormula 2 0 5)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) (one : P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (hone : s.encode one ∈ M.sets) -include pairing unions powers separation collection hone - -theorem realize_indexedGraphValueFormula {I f : ZFSet.{u}} - (hf : f ∈ M.sets) (function : FunctionGraphOn I f) (i : I.toSet) - (hi : i.val ∈ M.sets) (w : ZFSet.{u}) (hw : w ∈ M.sets) : - Realize M.sets indexedGraphValueFormula - (extend i.val (extend w (extend f (extend (s.encode one) Fin.elim0)))) ↔ - w = orderedPairNameCode (s.encode one) (Name.check s one i.val).val (function.value i) := by - rw [indexedGraphValueFormula, realize_ex] - constructor - · rintro ⟨v, hv, rest⟩ - obtain ⟨k, hk, entry, checked, shape⟩ := (realize_ex M.sets _ _).1 rest - have ev := function.value_eq_of_entry i - ((M.realize_pairMembershipFormula pairing 2 1 4 _ hi hv hf).1 entry) - rw [realize_binaryApplication, map_extend, map_empty] at checked - have ek := (M.realize_uniformCheckFormula s one pairing unions powers separation collection - hone i.val k hi hk).1 checked - have all : ∀ j, (extend k (extend v (extend i.val - (extend w (extend f (extend (s.encode one) Fin.elim0)))))) j ∈ M.sets := - Fin.cases hk (Fin.cases hv (Fin.cases hi (Fin.cases hw (Fin.cases hf - (Fin.cases hone (fun j => Fin.elim0 j)))))) - have eq := (M.realize_orderedPairNameCodeFormula pairing 3 0 1 5 _ all).1 shape - exact eq.trans (congrArg₂ (orderedPairNameCode (s.encode one)) ek ev.symm) - · intro equal - have hv := function.value_mem M hf i - have hk := M.check_mem s one pairing unions powers separation collection hone i.val hi - refine ⟨function.value i, hv, ?_⟩ - rw [realize_ex] - refine ⟨(Name.check s one i.val).val, hk, ?_, ?_, ?_⟩ - · exact (M.realize_pairMembershipFormula pairing 2 1 4 _ hi hv hf).2 (function.value_entry i) - · rw [realize_binaryApplication, map_extend, map_empty] - exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection - hone i.val _ hi hk).2 rfl - · have all : ∀ j, (extend (Name.check s one i.val).val (extend (function.value i) - (extend i.val (extend w (extend f (extend (s.encode one) Fin.elim0)))))) j ∈ M.sets := - Fin.cases hk (Fin.cases hv (Fin.cases hi (Fin.cases hw (Fin.cases hf - (Fin.cases hone (fun j => Fin.elim0 j)))))) - exact (M.realize_orderedPairNameCodeFormula pairing 3 0 1 5 _ all).2 equal - -theorem realize_indexedGraphNameEntryFormula {I f : ZFSet.{u}} - (hI : I ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I f) - (names : ∀ i, IsName s (function.value i)) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets indexedGraphNameEntryFormula - (extend z (extend I (extend f (extend (s.encode one) Fin.elim0)))) ↔ - z ∈ (Name.indexedGraphName one function names).val := by - rw [indexedGraphNameEntryFormula, realize_ex, Name.mem_indexedGraphName_code] - constructor - · rintro ⟨i, hiM, rest⟩ - obtain ⟨w, hw, hi, code, shape⟩ := (realize_ex M.sets _ _).1 rest - rw [realize_binaryApplication, map_extend, map_extend, map_empty] at code - have eq := (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection - hone hf function ⟨i, hi⟩ hiM w hw).1 code - have shapeEq := (M.realize_orderedPairFormula pairing 2 0 5 _ hz hw hone).1 shape - exact ⟨⟨i, hi⟩, shapeEq.trans (congrArg (fun v => ZFSet.pair v (s.encode one)) eq)⟩ - · rintro ⟨i, shape⟩ - have hiM := M.transitive hI i.property - have hw := M.orderedPairNameCode_mem pairing hone - (M.check_mem s one pairing unions powers separation collection hone i.val hiM) - (function.value_mem M hf i) - refine ⟨i.val, hiM, ?_⟩ - rw [realize_ex] - refine ⟨orderedPairNameCode (s.encode one) (Name.check s one i.val).val (function.value i), - hw, i.property, ?_, ?_⟩ - · rw [realize_binaryApplication, map_extend, map_extend, map_empty] - exact (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection - hone hf function i hiM _ hw).2 rfl - · exact (M.realize_orderedPairFormula pairing 2 0 5 _ hz hw hone).2 shape - -theorem indexedGraphName_mem {I f : ZFSet.{u}} - (hI : I ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I f) - (names : ∀ i, IsName s (function.value i)) : - (Name.indexedGraphName one function names).val ∈ M.sets := by - let params := extend f (extend (s.encode one) Fin.elim0) - have members : ∀ j, params j ∈ M.sets := Fin.cases hf (Fin.cases hone (fun j => Fin.elim0 j)) - have witnesses : ∀ i ∈ I, ∃ w ∈ M.sets, - Realize M.sets indexedGraphValueFormula (extend i (extend w params)) := by - intro i hi - let j : I.toSet := ⟨i, hi⟩ - have hiM := M.transitive hI hi - have hw := M.orderedPairNameCode_mem pairing hone - (M.check_mem s one pairing unions powers separation collection hone i hiM) - (function.value_mem M hf j) - exact ⟨_, hw, (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection - hone hf function j hiM _ hw).2 rfl⟩ - obtain ⟨W, hW, covers⟩ := M.collection_witness collection indexedGraphValueFormula params members hI witnesses - have inW (i : I.toSet) : - orderedPairNameCode (s.encode one) (Name.check s one i.val).val (function.value i) ∈ W := by - obtain ⟨w, hw, code⟩ := covers i.val i.property - have eq := (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection - hone hf function i (M.transitive hI i.property) w (M.transitive hW hw)).1 code - exact eq ▸ hw - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW - (M.unorderedPair_mem pairing hone hone) - have bound : (Name.indexedGraphName one function names).val ⊆ B := by - intro z hz - obtain ⟨i, rfl⟩ := (Name.mem_indexedGraphName_code one function names z).1 hz - exact pairBound _ (inW i) _ (ZFSet.mem_pair.2 (Or.inl rfl)) - let entryParams := extend I (extend f (extend (s.encode one) Fin.elim0)) - have selected := M.separation_mem separation indexedGraphNameEntryFormula entryParams - (Fin.cases hI (Fin.cases hf (Fin.cases hone (fun j => Fin.elim0 j)))) hB - have equal : ZFSet.sep (fun z => Realize M.sets indexedGraphNameEntryFormula - (extend z entryParams)) B = (Name.indexedGraphName one function names).val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, code⟩ - exact (M.realize_indexedGraphNameEntryFormula s one pairing unions powers separation collection - hone hI hf function names z (M.transitive hB hz)).1 code - · intro hz - exact ⟨bound hz, (M.realize_indexedGraphNameEntryFormula s one pairing unions powers separation collection - hone hI hf function names z (M.transitive hB (bound hz))).2 hz⟩ - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def orderedPairNameFamily (one X Y : ZFSet.{u}) : ZFSet.{u} := - ZFSet.range (fun p : X × Y => orderedPairNameCode one p.1.val p.2.val) - -theorem mem_orderedPairNameFamily (one X Y z : ZFSet.{u}) : - z ∈ orderedPairNameFamily one X Y ↔ - ∃ x ∈ X, ∃ y ∈ Y, z = orderedPairNameCode one x y := by - rw [orderedPairNameFamily, ZFSet.mem_range] - constructor - · rintro ⟨p, equal⟩ - exact ⟨p.1.val, p.1.property, p.2.val, p.2.property, equal.symm⟩ - · rintro ⟨x, hx, y, hy, equal⟩ - exact ⟨(⟨x, hx⟩, ⟨y, hy⟩), equal.symm⟩ - -theorem pairNameCode_subset {one x y B : ZFSet.{u}} (hx : x ∈ B) (hy : y ∈ B) : - pairNameCode one x y ⊆ ZFSet.prod B {one} := by - intro z hz - rcases ZFSet.mem_pair.1 hz with rfl | rfl - · exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_singleton.2 rfl⟩ - · exact ZFSet.pair_mem_prod.2 ⟨hy, ZFSet.mem_singleton.2 rfl⟩ - -noncomputable def iteratedPairNameFamily (one T : ZFSet.{u}) : Nat → ZFSet.{u} - | 0 => T - | n + 1 => orderedPairNameFamily one (iteratedPairNameFamily one T n) T - -theorem iteratedPairNameFamily_zero (one T : ZFSet.{u}) : - iteratedPairNameFamily one T 0 = T := rfl - -theorem iteratedPairNameFamily_succ (one T : ZFSet.{u}) (n : Nat) : - iteratedPairNameFamily one T (n + 1) = - orderedPairNameFamily one (iteratedPairNameFamily one T n) T := rfl - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -namespace Name -variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) - -private theorem inputFunction (J : ZFSet.{u}) : FunctionGraphOn J (identityFunctionGraph J) := - ⟨J, (identityFunctionGraph_injection J).function⟩ - -private theorem inputValue (J : ZFSet.{u}) (i : J.toSet) : - (inputFunction J).value i = i.val := - (inputFunction J).value_eq_of_entry i - ((pair_mem_identityFunctionGraph J i.val i.val).2 ⟨rfl, i.property⟩) - -omit [PartialOrder P] [OrderTop P] in -private theorem inputValid (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) (i : J.toSet) : - IsName s ((inputFunction J).value i) := by - rw [inputValue] - exact valid i.val i.property - -noncomputable def inputEvaluationName (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) : Name s := - indexedGraphName ⊤ (inputFunction J) (inputValid s J valid) - -theorem inputEvaluationName_entry (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) - (tau : Name s) (H : ConditionFilter P) (x : ZFSet.{u}) : - ZFSet.pair tau.val x ∈ eval {p | H.mem p} (inputEvaluationName s J valid) ↔ - tau.val ∈ J ∧ eval {p | H.mem p} tau = x := by - rw [inputEvaluationName, - mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem (inputFunction J) - (inputValid s J valid)] - constructor - · rintro ⟨i, equal⟩ - obtain ⟨code, value⟩ := ZFSet.pair_inj.1 equal - have same : (⟨(inputFunction J).value i, inputValid s J valid i⟩ : Name s) = tau := - Subtype.ext ((inputValue J i).trans code) - exact ⟨code ▸ i.property, same ▸ value⟩ - · rintro ⟨member, value⟩ - let i : J.toSet := ⟨tau.val, member⟩ - have same : (⟨(inputFunction J).value i, inputValid s J valid i⟩ : Name s) = tau := - Subtype.ext (inputValue J i) - exact ⟨i, congrArg (ZFSet.pair tau.val) (same ▸ value)⟩ - -end Name - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) - -theorem inputEvaluationName_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) - {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName s z) : - (Name.inputEvaluationName s J valid).val ∈ M.sets := - M.indexedGraphName_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) hJ - (M.identityFunctionGraph_mem pairing unions powers separation hJ) _ _ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {P : Type u} - -noncomputable def namePool (s : Presentation P) (B : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (IsName s) B - -theorem mem_namePool (s : Presentation P) (B x : ZFSet.{u}) : - x ∈ namePool s B ↔ x ∈ B ∧ IsName s x := ZFSet.mem_sep - -namespace TransitiveGround - -theorem namePool_mem (M : TransitiveGround.{u}) (s : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) : - namePool s B ∈ M.sets := by - have selected := M.separation_mem separation uniformNameFormula (extend s.carrier Fin.elim0) - (Fin.cases carrier (fun j => Fin.elim0 j)) hB - have equal : ZFSet.sep (fun x => Realize M.sets uniformNameFormula - (extend x (extend s.carrier Fin.elim0))) B = namePool s B := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, mem_namePool] - apply and_congr_right - intro hx - exact M.realize_uniformNameFormula s pairing unions powers separation collection - carrier x (M.transitive hB hx) - exact equal ▸ selected - -end TransitiveGround - -namespace Name -variable {s : Presentation P} - -theorem child_mem_namePool {σ β : Name s} {p : P} (entry : Entry σ β p) : - σ.val ∈ namePool s (ZFSet.sUnion (ZFSet.sUnion β.val)) := - (mem_namePool _ _ _).2 ⟨child_mem_doubleUnion entry, σ.property⟩ - -theorem indexedGraphName_covers_eval (H : Set P) (one : P) (hone : one ∈ H) - (β : Name s) {I f : ZFSet.{u}} (function : FunctionGraphOn I f) - (names : ∀ i, IsName s (function.value i)) - (onto : ∀ v ∈ namePool s (ZFSet.sUnion (ZFSet.sUnion β.val)), - ∃ i ∈ I, ZFSet.pair i v ∈ f) : - ∀ x ∈ eval H β, ∃ i ∈ I, ZFSet.pair i x ∈ eval H (indexedGraphName one function names) := by - intro x hx - obtain ⟨σ, p, entry, _, value⟩ := (mem_eval H β x).1 hx - obtain ⟨i, hi, named⟩ := onto σ.val (child_mem_namePool entry) - let j : I.toSet := ⟨i, hi⟩ - have rawEqual := function.value_eq_of_entry j named - have nameEqual : (⟨function.value j, names j⟩ : Name s) = σ := Subtype.ext rawEqual - refine ⟨i, hi, (pair_mem_eval_indexedGraphName H one hone function names j x).2 ?_⟩ - exact (congrArg (eval H) nameEqual).trans value - -end Name - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P Q : Type u} {s : Presentation P} - -noncomputable def indexedTuple (one : P) (I : ZFSet.{u}) - (names : I.toSet → Name s) : Name s := - assemble (fun i : I => orderedPair one (check s one i.val) (names i)) (fun _ => one) - -theorem indexedGraphName_eq_indexedTuple {I f : ZFSet.{u}} (one : P) - (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) : - indexedGraphName one function names = - indexedTuple one I (fun i => ⟨function.value i, names i⟩) := rfl - -theorem mem_eval_indexedTuple (H : Set P) (one : P) (hone : one ∈ H) - (I : ZFSet.{u}) (names : I.toSet → Name s) (z : ZFSet.{u}) : - z ∈ eval H (indexedTuple one I names) ↔ - ∃ i : I, ZFSet.pair i.val (eval H (names i)) = z := by - rw [indexedTuple, mem_eval_assemble] - simp only [hone, true_and, eval_orderedPair H one hone, eval_check H one hone] - -theorem pair_mem_eval_indexedTuple (H : Set P) (one : P) (hone : one ∈ H) - (I : ZFSet.{u}) (names : I.toSet → Name s) (i : I.toSet) (x : ZFSet.{u}) : - ZFSet.pair i.val x ∈ eval H (indexedTuple one I names) ↔ eval H (names i) = x := by - rw [mem_eval_indexedTuple H one hone] - constructor - · rintro ⟨j, eq⟩ - have ji : j = i := Subtype.ext (ZFSet.pair_inj.1 eq).1 - subst j - exact (ZFSet.pair_inj.1 eq).2 - · intro eq - exact ⟨i, congrArg (ZFSet.pair i.val) eq⟩ - -theorem eval_indexedTuple_function (H : Set P) (one : P) (hone : one ∈ H) - (I : ZFSet.{u}) (names : I.toSet → Name s) : - ZFSet.IsFunc I (ZFSet.range (fun i : I => eval H (names i))) - (eval H (indexedTuple one I names)) := by - constructor - · intro z hz - obtain ⟨i, rfl⟩ := (mem_eval_indexedTuple H one hone I names z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨i.property, ZFSet.mem_range.2 ⟨i, rfl⟩⟩ - · intro i hi - let j : I.toSet := ⟨i, hi⟩ - refine ⟨eval H (names j), (pair_mem_eval_indexedTuple H one hone I names j _).2 rfl, ?_⟩ - intro x hx - exact ((pair_mem_eval_indexedTuple H one hone I names j x).1 hx).symm - -theorem eval_indexedTuple_domain_eq (H : Set P) (one : P) (hone : one ∈ H) - {I J : ZFSet.{u}} (names : I.toSet → Name s) (other : J.toSet → Name s) - (eq : eval H (indexedTuple one I names) = eval H (indexedTuple one J other)) : I = J := by - apply ZFSet.ext - intro x - constructor - · intro hx - have entry := (pair_mem_eval_indexedTuple H one hone I names ⟨x, hx⟩ _).2 rfl - rw [eq] at entry - obtain ⟨j, hj⟩ := (mem_eval_indexedTuple H one hone J other _).1 entry - have same : j.val = x := (ZFSet.pair_inj.1 hj).1 - rw [← same] - exact j.property - · intro hx - have entry := (pair_mem_eval_indexedTuple H one hone J other ⟨x, hx⟩ _).2 rfl - rw [← eq] at entry - obtain ⟨i, hi⟩ := (mem_eval_indexedTuple H one hone I names _).1 entry - have same : i.val = x := (ZFSet.pair_inj.1 hi).1 - rw [← same] - exact i.property - -theorem eval_indexedTuple_eq_iff (H : Set P) (one : P) (hone : one ∈ H) - (I : ZFSet.{u}) (names other : I.toSet → Name s) : - eval H (indexedTuple one I names) = eval H (indexedTuple one I other) ↔ - ∀ i, eval H (names i) = eval H (other i) := by - constructor - · intro eq i - have entry := (pair_mem_eval_indexedTuple H one hone I other i _).2 rfl - rw [← eq] at entry - exact (pair_mem_eval_indexedTuple H one hone I names i _).1 entry - · intro eq - apply ZFSet.ext - intro z - rw [mem_eval_indexedTuple H one hone, mem_eval_indexedTuple H one hone] - exact exists_congr (fun i => by rw [eq i]) - -theorem rename_indexedTuple (t : Presentation Q) (f : P → Q) (one : P) - (I : ZFSet.{u}) (names : I.toSet → Name s) : - rename t f (indexedTuple one I names) = - indexedTuple (f one) I (fun i => rename t f (names i)) := by - rw [indexedTuple, rename_assemble, indexedTuple] - apply congrArg (fun ns : I → Name t => assemble ns (fun _ => f one)) - funext i - rw [rename_orderedPair, rename_check] - -theorem act_indexedTuple {G : Type v} [Group G] [PartialOrder P] [OrderTop P] - (a : PosetAction G P) (g : G) (I : ZFSet.{u}) (names : I.toSet → Name s) : - a.act s g (indexedTuple ⊤ I names) = indexedTuple ⊤ I (fun i => a.act s g (names i)) := by - change rename s (a.iso g) _ = _ - rw [rename_indexedTuple, (a.iso g).map_top] - rfl - -theorem indexedTuple_supported {G : Type v} [Group G] [PartialOrder P] [OrderTop P] - (a : PosetAction G P) (I : ZFSet.{u}) (names : I.toSet → Name s) - (K : Subgroup G) (fixed : ∀ g ∈ K, ∀ i, a.act s g (names i) = names i) : - K ≤ a.stabilizer s (indexedTuple ⊤ I names) := by - intro g hg - change a.act s g (indexedTuple ⊤ I names) = _ - rw [act_indexedTuple] - exact congrArg (indexedTuple ⊤ I) (funext (fixed g hg)) - -theorem indexedTuple_hs {G : Type v} [Group G] [PartialOrder P] [OrderTop P] - (a : PosetAction G P) (F : NormalSubgroupFamily G) (I : ZFSet.{u}) - (names : I.toSet → Name s) (K : Subgroup G) (hK : F.mem K) - (fixed : ∀ g ∈ K, ∀ i, a.act s g (names i) = names i) - (children : ∀ i, HereditarilySymmetric a s F (names i)) : - HereditarilySymmetric a s F (indexedTuple ⊤ I names) := by - apply HereditarilySymmetric.assemble - · exact F.upward hK (indexedTuple_supported a I names K fixed) - · intro i - exact (HereditarilySymmetric.check a s F i.val).orderedPair (children i) - -end PartitionPilot.Forcing.Name - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CheckCertificates + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_checkState_fixedPoint + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (top : ZFSet.{u}) (htop : top ∈ M.sets) (B : ZFSet.{u}) (hB : B ∈ M.sets) : + ∃ R ∈ M.sets, R ⊆ B ∧ + definableOperator M.sets checkStateFormula (extend top Fin.elim0) B R = R := by + have mono : ∀ R ∈ M.sets, ∀ S ∈ M.sets, R ⊆ B → S ⊆ B → R ⊆ S → + definableOperator M.sets checkStateFormula (extend top Fin.elim0) B R ⊆ + definableOperator M.sets checkStateFormula (extend top Fin.elim0) B S := by + intro R hr S hs _ _ sub z hz + obtain ⟨hzB, step⟩ := ZFSet.mem_sep.1 hz + have hzM := M.transitive hB hzB + obtain ⟨x, hx, y, hy, shape, raw⟩ := (M.realize_checkState pairing top z R htop hzM hr).1 step + exact ZFSet.mem_sep.2 ⟨hzB, (M.realize_checkState pairing top z S htop hzM hs).2 + ⟨x, hx, y, hy, shape, M.rawCheckStep_mono sub raw⟩⟩ + obtain ⟨R, hr, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation + checkStateFormula (extend top Fin.elim0) (Fin.cases htop (fun i => Fin.elim0 i)) hB mono + exact ⟨R, hr, bound, fixed⟩ + +theorem exists_groundCheck_certificate {P : Type u} (s : Presentation P) (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hone : s.encode one ∈ M.sets) (x : ZFSet.{u}) (hx : x ∈ M.sets) + (hcheck : (Name.check s one x).val ∈ M.sets) : + ∃ R ∈ M.sets, Realize M.sets checkCertificateFormula (extend R (extend (s.encode one) Fin.elim0)) ∧ + ZFSet.pair x (Name.check s one x).val ∈ R := by + obtain ⟨T, hT, xT, checkT, trans⟩ := M.exists_pair_transitiveCover pairing unions separation collection hx hcheck + let N : TransitiveGround.{u} := ⟨{z | z ∈ T}, fun hz hy => trans _ hz _ hy⟩ + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT + obtain ⟨R, hr, bound, fixed⟩ := M.exists_checkState_fixedPoint pairing unions powers separation + (s.encode one) hone B hB + have certificate : Realize M.sets checkCertificateFormula (extend R (extend (s.encode one) Fin.elim0)) := by + apply (M.realize_postfixedFormula checkStateFormula (extend (s.encode one) Fin.elim0) hr bound).2 + rw [fixed] + have complete : ∀ v, v ∈ T → (Name.check s one v).val ∈ T → + ZFSet.pair v (Name.check s one v).val ∈ R := by + intro v + induction v using ZFSet.inductionOn with + | h v ih => + intro hv hc + have childT : ∀ w ∈ v, (Name.check s one w).val ∈ T := by + intro w hw + exact (N.nameDomain s).children hc ((Name.entry_check one v (Name.check s one w) one).2 + ⟨w, hw, rfl, rfl⟩) + have raw : M.RawCheckStep (s.encode one) R v (Name.check s one v).val := by + constructor + · intro w hw + exact ⟨(Name.check s one w).val, M.transitive hT (childT w hw), + ih w hw (trans _ hv _ hw) (childT w hw), + (Name.mem_check_code s one v _).2 ⟨w, hw, rfl⟩⟩ + · intro z hz + obtain ⟨w, hw, eq⟩ := (Name.mem_check_code s one v z).1 hz + exact ⟨w, hw, (Name.check s one w).val, M.transitive hT (childT w hw), + ih w hw (trans _ hv _ hw) (childT w hw), eq⟩ + have member : ZFSet.pair v (Name.check s one v).val ∈ + definableOperator M.sets checkStateFormula (extend (s.encode one) Fin.elim0) B R := + ZFSet.mem_sep.2 ⟨pairBound v hv (Name.check s one v).val hc, + (M.realize_checkState pairing (s.encode one) _ R hone + (M.orderedPair_mem pairing (M.transitive hT hv) (M.transitive hT hc)) hr).2 + ⟨v, M.transitive hT hv, (Name.check s one v).val, M.transitive hT hc, rfl, raw⟩⟩ + rwa [fixed] at member + exact ⟨R, hr, certificate, complete x xT checkT⟩ + +theorem realize_uniformCheckFormula {P : Type u} (s : Presentation P) (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hone : s.encode one ∈ M.sets) (x y : ZFSet.{u}) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets uniformCheckFormula (extend x (extend y (extend (s.encode one) Fin.elim0))) ↔ + y = (Name.check s one x).val := by + rw [uniformCheckFormula, realize_ex] + constructor + · rintro ⟨R, hr, cert, rel⟩ + rw [realize_binaryApplication, map_empty] at cert + exact M.checkCertificate_sound s one pairing hone hr cert x hx y hy + ((M.realize_pairMembershipFormula pairing 1 2 0 + (extend R (extend x (extend y (extend (s.encode one) Fin.elim0)))) hx hy hr).1 rel) + · intro eq + obtain ⟨R, hr, cert, rel⟩ := M.exists_groundCheck_certificate s one pairing unions powers separation collection + hone x hx (eq ▸ hy) + refine ⟨R, hr, ?_, ?_⟩ + · rw [realize_binaryApplication, map_empty] + exact cert + · apply (M.realize_pairMembershipFormula pairing 1 2 0 + (extend R (extend x (extend y (extend (s.encode one) Fin.elim0)))) hx hy hr).2 + rwa [eq] + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def checkEntryFormula : SetFormula 3 := + ex (ex (.conj (.mem 1 3) + (.conj (binaryApplication uniformCheckFormula (extend 4 Fin.elim0) 1 0) + (orderedPairFormula 2 0 4)))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem realize_checkEntryFormula (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hone : s.encode one ∈ M.sets) (x z : ZFSet.{u}) (hx : x ∈ M.sets) (hz : z ∈ M.sets) + (children : ∀ v ∈ x, (Name.check s one v).val ∈ M.sets) : + Realize M.sets checkEntryFormula (extend z (extend x (extend (s.encode one) Fin.elim0))) ↔ + z ∈ (Name.check s one x).val := by + rw [checkEntryFormula, realize_ex, Name.mem_check_code] + constructor + · rintro ⟨v, hv, body⟩ + obtain ⟨w, hw, member, checked, shape⟩ := (realize_ex M.sets _ _).1 body + rw [realize_binaryApplication, map_extend, map_empty] at checked + have eq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v w hv hw).1 checked + have pair := (M.realize_orderedPairFormula pairing 2 0 4 + (extend w (extend v (extend z (extend x (extend (s.encode one) Fin.elim0))))) hz hw hone).1 shape + exact ⟨v, member, pair.trans (congrArg (fun q => ZFSet.pair q (s.encode one)) eq)⟩ + · rintro ⟨v, member, eq⟩ + refine ⟨v, M.transitive hx member, ?_⟩ + rw [realize_ex] + refine ⟨(Name.check s one v).val, children v member, member, ?_, ?_⟩ + · rw [realize_binaryApplication, map_extend, map_empty] + exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v _ + (M.transitive hx member) (children v member)).2 rfl + · exact (M.realize_orderedPairFormula pairing 2 0 4 + (extend (Name.check s one v).val (extend v (extend z (extend x (extend (s.encode one) Fin.elim0))))) + hz (children v member) hone).2 eq + +theorem check_mem (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hone : s.encode one ∈ M.sets) : + ∀ x ∈ M.sets, (Name.check s one x).val ∈ M.sets := by + intro x + induction x using ZFSet.inductionOn with + | h x ih => + intro hx + have children : ∀ v ∈ x, (Name.check s one v).val ∈ M.sets := + fun v hv => ih v hv (M.transitive hx hv) + have witnesses : ∀ v ∈ x, ∃ w ∈ M.sets, + Realize M.sets uniformCheckFormula (extend v (extend w (extend (s.encode one) Fin.elim0))) := by + intro v hv + exact ⟨(Name.check s one v).val, children v hv, + (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v _ + (M.transitive hx hv) (children v hv)).2 rfl⟩ + obtain ⟨W, hW, covers⟩ := M.collection_witness collection uniformCheckFormula (extend (s.encode one) Fin.elim0) + (Fin.cases hone (fun i => Fin.elim0 i)) hx witnesses + have inW : ∀ v ∈ x, (Name.check s one v).val ∈ W := by + intro v hv + obtain ⟨w, hw, rel⟩ := covers v hv + have eq := (M.realize_uniformCheckFormula s one pairing unions powers separation collection hone v w + (M.transitive hx hv) (M.transitive hW hw)).1 rel + exact eq ▸ hw + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW + (M.unorderedPair_mem pairing hone hone) + have bound : (Name.check s one x).val ⊆ B := by + intro z hz + obtain ⟨v, hv, rfl⟩ := (Name.mem_check_code s one x z).1 hz + exact pairBound _ (inW v hv) _ (ZFSet.mem_pair.2 (Or.inl rfl)) + have selected := M.separation_mem separation checkEntryFormula (extend x (extend (s.encode one) Fin.elim0)) + (Fin.cases hx (Fin.cases hone (fun i => Fin.elim0 i))) hB + have eq : ZFSet.sep (fun z => Realize M.sets checkEntryFormula + (extend z (extend x (extend (s.encode one) Fin.elim0)))) B = (Name.check s one x).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (M.realize_checkEntryFormula s one pairing unions powers separation collection hone x z hx + (M.transitive hB hz) children).1 rel + · intro hz + exact ⟨bound hz, (M.realize_checkEntryFormula s one pairing unions powers separation collection hone x z hx + (M.transitive hB (bound hz)) children).2 hz⟩ + exact eq ▸ selected + +theorem ground_subset_symmetric_values {G : Type u} [Group G] [PartialOrder P] [OrderTop P] + (a : PosetAction G P) (F : Compression.RecursiveMaps.NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : + M.sets ⊆ (a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p} := by + intro x hx + exact (Name.NameDomain.mem_values _ _ _).2 ⟨Name.check s ⊤ x, + ⟨M.check_mem s ⊤ pairing unions powers separation collection (M.transitive carrier (s.encode_mem ⊤)) x hx, + HereditarilySymmetric.check a s F x⟩, Name.eval_check _ ⊤ H.top_mem x⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +noncomputable def pairNameCode (one x y : ZFSet.{u}) : ZFSet.{u} := + {ZFSet.pair x one, ZFSet.pair y one} + +noncomputable def orderedPairNameCode (one x y : ZFSet.{u}) : ZFSet.{u} := + pairNameCode one (pairNameCode one x x) (pairNameCode one x y) + +namespace Name +variable {P : Type u} {s : Presentation P} + +theorem orderedPair_code (one : P) (σ τ : Name s) : + (orderedPair one σ τ).val = orderedPairNameCode (s.encode one) σ.val τ.val := by + have single : singleton one σ = unorderedPair one σ σ := by + apply Name.ext + intro ν p + simp only [singleton, unorderedPair, entry_assemble] + constructor + · rintro ⟨_, rfl, rfl⟩ + exact ⟨true, rfl, rfl⟩ + · rintro ⟨b, equal, rfl⟩ + have same : (if b then σ else σ) = σ := by split <;> rfl + exact ⟨(), same.symm.trans equal, rfl⟩ + rw [orderedPair, single] + rw [TransitiveGround.pairName_code, TransitiveGround.pairName_code, + TransitiveGround.pairName_code] + rfl + +end Name + +namespace SetFormula + +def pairNameCodeFormula {n} (z x y one : Fin n) : SetFormula n := + ex (ex (.conj (orderedPairFormula 1 x.succ.succ one.succ.succ) + (.conj (orderedPairFormula 0 y.succ.succ one.succ.succ) + (unorderedPairFormula z.succ.succ 1 0)))) + +def orderedPairNameCodeFormula {n} (z x y one : Fin n) : SetFormula n := + ex (ex (.conj (pairNameCodeFormula 1 x.succ.succ x.succ.succ one.succ.succ) + (.conj (pairNameCodeFormula 0 x.succ.succ y.succ.succ one.succ.succ) + (pairNameCodeFormula z.succ.succ 1 0 one.succ.succ)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem pairNameCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {one x y : ZFSet.{u}} (hone : one ∈ M.sets) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : + pairNameCode one x y ∈ M.sets := + M.unorderedPair_mem pairing (M.orderedPair_mem pairing hx hone) (M.orderedPair_mem pairing hy hone) + +theorem orderedPairNameCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {one x y : ZFSet.{u}} (hone : one ∈ M.sets) (hx : x ∈ M.sets) (hy : y ∈ M.sets) : + orderedPairNameCode one x y ∈ M.sets := + M.pairNameCode_mem pairing hone (M.pairNameCode_mem pairing hone hx hx) + (M.pairNameCode_mem pairing hone hx hy) + +theorem realize_pairNameCodeFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n} (z x y one : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (pairNameCodeFormula z x y one) env ↔ + env z = pairNameCode (env one) (env x) (env y) := by + rw [pairNameCodeFormula, realize_ex] + constructor + · rintro ⟨a, ha, rest⟩ + obtain ⟨b, hb, left, right, shape⟩ := (realize_ex M.sets _ _).1 rest + have ea := (M.realize_orderedPairFormula pairing 1 x.succ.succ one.succ.succ + _ ha (members x) (members one)).1 left + have eb := (M.realize_orderedPairFormula pairing 0 y.succ.succ one.succ.succ + _ hb (members y) (members one)).1 right + have ez := (M.realize_unorderedPairFormula z.succ.succ 1 0 _ (members z) ha hb).1 shape + exact ez.trans (congrArg₂ (fun p q : ZFSet.{u} => ({p, q} : ZFSet.{u})) ea eb) + · intro equal + have ha := M.orderedPair_mem pairing (members x) (members one) + have hb := M.orderedPair_mem pairing (members y) (members one) + refine ⟨ZFSet.pair (env x) (env one), ha, ?_⟩ + rw [realize_ex] + refine ⟨ZFSet.pair (env y) (env one), hb, ?_, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing 1 x.succ.succ one.succ.succ + _ ha (members x) (members one)).2 rfl + · exact (M.realize_orderedPairFormula pairing 0 y.succ.succ one.succ.succ + _ hb (members y) (members one)).2 rfl + · exact (M.realize_unorderedPairFormula z.succ.succ 1 0 _ (members z) ha hb).2 equal + +theorem realize_orderedPairNameCodeFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n} (z x y one : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (orderedPairNameCodeFormula z x y one) env ↔ + env z = orderedPairNameCode (env one) (env x) (env y) := by + rw [orderedPairNameCodeFormula, realize_ex] + constructor + · rintro ⟨a, ha, rest⟩ + obtain ⟨b, hb, left, right, shape⟩ := (realize_ex M.sets _ _).1 rest + have all : ∀ j, (extend b (extend a env)) j ∈ M.sets := Fin.cases hb (Fin.cases ha members) + have ea := (M.realize_pairNameCodeFormula pairing 1 x.succ.succ x.succ.succ one.succ.succ _ all).1 left + have eb := (M.realize_pairNameCodeFormula pairing 0 x.succ.succ y.succ.succ one.succ.succ _ all).1 right + have ez := (M.realize_pairNameCodeFormula pairing z.succ.succ 1 0 one.succ.succ _ all).1 shape + exact ez.trans (congrArg₂ (pairNameCode (env one)) ea eb) + · intro equal + have ha := M.pairNameCode_mem pairing (members one) (members x) (members x) + have hb := M.pairNameCode_mem pairing (members one) (members x) (members y) + refine ⟨pairNameCode (env one) (env x) (env x), ha, ?_⟩ + rw [realize_ex] + have all : ∀ j, (extend (pairNameCode (env one) (env x) (env y)) + (extend (pairNameCode (env one) (env x) (env x)) env)) j ∈ M.sets := + Fin.cases hb (Fin.cases ha members) + exact ⟨pairNameCode (env one) (env x) (env y), hb, + (M.realize_pairNameCodeFormula pairing 1 x.succ.succ x.succ.succ one.succ.succ _ all).2 rfl, + (M.realize_pairNameCodeFormula pairing 0 x.succ.succ y.succ.succ one.succ.succ _ all).2 rfl, + (M.realize_pairNameCodeFormula pairing z.succ.succ 1 0 one.succ.succ _ all).2 equal⟩ + +end TransitiveGround + + + + + +def checkCodePresentation (one : ZFSet.{u}) : Presentation (ULift.{u} Unit) where + carrier := {one} + encode _ := one + injective := fun _ _ _ => Subsingleton.elim _ _ + mem_carrier x := by + rw [ZFSet.mem_singleton] + exact ⟨fun h => ⟨⟨()⟩, h.symm⟩, fun ⟨_, h⟩ => h.symm⟩ + +noncomputable def checkNameCode (one x : ZFSet.{u}) : ZFSet.{u} := + (Name.check (checkCodePresentation one) ⟨()⟩ x).val + +namespace Name + +theorem check_code_eq {P : Type u} (s : Presentation P) (one : P) (x : ZFSet.{u}) : + (check s one x).val = checkNameCode (s.encode one) x := by + induction x using ZFSet.inductionOn with + | h x ih => + apply ZFSet.ext + intro z + change z ∈ (check s one x).val ↔ z ∈ (check (checkCodePresentation (s.encode one)) ⟨()⟩ x).val + rw [mem_check_code, mem_check_code] + apply exists_congr + intro y + apply and_congr_right + intro hy + rw [ih y hy] + rfl + +end Name + +namespace SetFormula + +def checkNameCodeFormula {n} (output x one : Fin n) : SetFormula n := + binaryApplication uniformCheckFormula (extend one Fin.elim0) x output + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem checkNameCode_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {one x : ZFSet.{u}} (hone : one ∈ M.sets) (hx : x ∈ M.sets) : + checkNameCode one x ∈ M.sets := + M.check_mem (checkCodePresentation one) ⟨()⟩ pairing unions powers separation collection hone x hx + +theorem realize_checkNameCodeFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {n} (output x one : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (checkNameCodeFormula output x one) env ↔ + env output = checkNameCode (env one) (env x) := by + rw [checkNameCodeFormula, realize_binaryApplication, map_extend, map_empty] + exact M.realize_uniformCheckFormula (checkCodePresentation (env one)) ⟨()⟩ + pairing unions powers separation collection (members one) (env x) (env output) + (members x) (members output) + +end TransitiveGround + + + + + +namespace Name +variable {P : Type u} {s : Presentation P} {I f : ZFSet.{u}} + +noncomputable def indexedGraphName (one : P) (function : FunctionGraphOn I f) + (names : ∀ i, IsName s (function.value i)) : Name s := + assemble (fun i : I => orderedPair one (check s one i.val) + ⟨function.value i, names i⟩) (fun _ => one) + +theorem mem_indexedGraphName_code (one : P) (function : FunctionGraphOn I f) + (names : ∀ i, IsName s (function.value i)) (z : ZFSet.{u}) : + z ∈ (indexedGraphName one function names).val ↔ + ∃ i : I, z = ZFSet.pair + (orderedPairNameCode (s.encode one) (check s one i.val).val (function.value i)) + (s.encode one) := by + change z ∈ ZFSet.range _ ↔ _ + rw [ZFSet.mem_range] + apply exists_congr + intro index + let named : Name s := ⟨function.value index, names index⟩ + change ZFSet.pair (orderedPair one (check s one index.val) named).val (s.encode one) = z ↔ _ + rw [orderedPair_code] + exact eq_comm + +theorem mem_eval_indexedGraphName (H : Set P) (one : P) (hone : one ∈ H) + (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) (z : ZFSet.{u}) : + z ∈ eval H (indexedGraphName one function names) ↔ + ∃ i : I, ZFSet.pair i.val (eval H ⟨function.value i, names i⟩) = z := by + rw [indexedGraphName, mem_eval_assemble] + simp only [hone, true_and] + apply exists_congr + intro index + let named : Name s := ⟨function.value index, names index⟩ + change eval H (orderedPair one (check s one index.val) named) = z ↔ + ZFSet.pair index.val (eval H named) = z + rw [eval_orderedPair H one hone, eval_check H one hone] + +theorem pair_mem_eval_indexedGraphName (H : Set P) (one : P) (hone : one ∈ H) + (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) + (i : I.toSet) (x : ZFSet.{u}) : + ZFSet.pair i.val x ∈ eval H (indexedGraphName one function names) ↔ + eval H ⟨function.value i, names i⟩ = x := by + rw [mem_eval_indexedGraphName H one hone] + constructor + · rintro ⟨j, equal⟩ + have ji : j = i := Subtype.ext (ZFSet.pair_inj.1 equal).1 + subst j + exact (ZFSet.pair_inj.1 equal).2 + · intro equal + exact ⟨i, congrArg (ZFSet.pair i.val) equal⟩ + +theorem eval_indexedGraphName_function (H : Set P) (one : P) (hone : one ∈ H) + (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) : + ZFSet.IsFunc I (ZFSet.range (fun i : I => eval H ⟨function.value i, names i⟩)) + (eval H (indexedGraphName one function names)) := by + constructor + · intro z hz + obtain ⟨i, rfl⟩ := (mem_eval_indexedGraphName H one hone function names z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨i.property, ZFSet.mem_range.2 ⟨i, rfl⟩⟩ + · intro i hi + let j : I.toSet := ⟨i, hi⟩ + refine ⟨eval H ⟨function.value j, names j⟩, + (pair_mem_eval_indexedGraphName H one hone function names j _).2 rfl, ?_⟩ + intro x hx + exact ((pair_mem_eval_indexedGraphName H one hone function names j x).1 hx).symm + +end Name + +namespace SetFormula + +def indexedGraphValueFormula : SetFormula 4 := + ex (ex (.conj (pairMembershipFormula 2 1 4) + (.conj (binaryApplication uniformCheckFormula (extend 5 Fin.elim0) 2 0) + (orderedPairNameCodeFormula 3 0 1 5)))) + +def indexedGraphNameEntryFormula : SetFormula 4 := + ex (ex (.conj (.mem 1 3) + (.conj (binaryApplication indexedGraphValueFormula (extend 4 (extend 5 Fin.elim0)) 1 0) + (orderedPairFormula 2 0 5)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) (one : P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (hone : s.encode one ∈ M.sets) +include pairing unions powers separation collection hone + +theorem realize_indexedGraphValueFormula {I f : ZFSet.{u}} + (hf : f ∈ M.sets) (function : FunctionGraphOn I f) (i : I.toSet) + (hi : i.val ∈ M.sets) (w : ZFSet.{u}) (hw : w ∈ M.sets) : + Realize M.sets indexedGraphValueFormula + (extend i.val (extend w (extend f (extend (s.encode one) Fin.elim0)))) ↔ + w = orderedPairNameCode (s.encode one) (Name.check s one i.val).val (function.value i) := by + rw [indexedGraphValueFormula, realize_ex] + constructor + · rintro ⟨v, hv, rest⟩ + obtain ⟨k, hk, entry, checked, shape⟩ := (realize_ex M.sets _ _).1 rest + have ev := function.value_eq_of_entry i + ((M.realize_pairMembershipFormula pairing 2 1 4 _ hi hv hf).1 entry) + rw [realize_binaryApplication, map_extend, map_empty] at checked + have ek := (M.realize_uniformCheckFormula s one pairing unions powers separation collection + hone i.val k hi hk).1 checked + have all : ∀ j, (extend k (extend v (extend i.val + (extend w (extend f (extend (s.encode one) Fin.elim0)))))) j ∈ M.sets := + Fin.cases hk (Fin.cases hv (Fin.cases hi (Fin.cases hw (Fin.cases hf + (Fin.cases hone (fun j => Fin.elim0 j)))))) + have eq := (M.realize_orderedPairNameCodeFormula pairing 3 0 1 5 _ all).1 shape + exact eq.trans (congrArg₂ (orderedPairNameCode (s.encode one)) ek ev.symm) + · intro equal + have hv := function.value_mem M hf i + have hk := M.check_mem s one pairing unions powers separation collection hone i.val hi + refine ⟨function.value i, hv, ?_⟩ + rw [realize_ex] + refine ⟨(Name.check s one i.val).val, hk, ?_, ?_, ?_⟩ + · exact (M.realize_pairMembershipFormula pairing 2 1 4 _ hi hv hf).2 (function.value_entry i) + · rw [realize_binaryApplication, map_extend, map_empty] + exact (M.realize_uniformCheckFormula s one pairing unions powers separation collection + hone i.val _ hi hk).2 rfl + · have all : ∀ j, (extend (Name.check s one i.val).val (extend (function.value i) + (extend i.val (extend w (extend f (extend (s.encode one) Fin.elim0)))))) j ∈ M.sets := + Fin.cases hk (Fin.cases hv (Fin.cases hi (Fin.cases hw (Fin.cases hf + (Fin.cases hone (fun j => Fin.elim0 j)))))) + exact (M.realize_orderedPairNameCodeFormula pairing 3 0 1 5 _ all).2 equal + +theorem realize_indexedGraphNameEntryFormula {I f : ZFSet.{u}} + (hI : I ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I f) + (names : ∀ i, IsName s (function.value i)) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets indexedGraphNameEntryFormula + (extend z (extend I (extend f (extend (s.encode one) Fin.elim0)))) ↔ + z ∈ (Name.indexedGraphName one function names).val := by + rw [indexedGraphNameEntryFormula, realize_ex, Name.mem_indexedGraphName_code] + constructor + · rintro ⟨i, hiM, rest⟩ + obtain ⟨w, hw, hi, code, shape⟩ := (realize_ex M.sets _ _).1 rest + rw [realize_binaryApplication, map_extend, map_extend, map_empty] at code + have eq := (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection + hone hf function ⟨i, hi⟩ hiM w hw).1 code + have shapeEq := (M.realize_orderedPairFormula pairing 2 0 5 _ hz hw hone).1 shape + exact ⟨⟨i, hi⟩, shapeEq.trans (congrArg (fun v => ZFSet.pair v (s.encode one)) eq)⟩ + · rintro ⟨i, shape⟩ + have hiM := M.transitive hI i.property + have hw := M.orderedPairNameCode_mem pairing hone + (M.check_mem s one pairing unions powers separation collection hone i.val hiM) + (function.value_mem M hf i) + refine ⟨i.val, hiM, ?_⟩ + rw [realize_ex] + refine ⟨orderedPairNameCode (s.encode one) (Name.check s one i.val).val (function.value i), + hw, i.property, ?_, ?_⟩ + · rw [realize_binaryApplication, map_extend, map_extend, map_empty] + exact (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection + hone hf function i hiM _ hw).2 rfl + · exact (M.realize_orderedPairFormula pairing 2 0 5 _ hz hw hone).2 shape + +theorem indexedGraphName_mem {I f : ZFSet.{u}} + (hI : I ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I f) + (names : ∀ i, IsName s (function.value i)) : + (Name.indexedGraphName one function names).val ∈ M.sets := by + let params := extend f (extend (s.encode one) Fin.elim0) + have members : ∀ j, params j ∈ M.sets := Fin.cases hf (Fin.cases hone (fun j => Fin.elim0 j)) + have witnesses : ∀ i ∈ I, ∃ w ∈ M.sets, + Realize M.sets indexedGraphValueFormula (extend i (extend w params)) := by + intro i hi + let j : I.toSet := ⟨i, hi⟩ + have hiM := M.transitive hI hi + have hw := M.orderedPairNameCode_mem pairing hone + (M.check_mem s one pairing unions powers separation collection hone i hiM) + (function.value_mem M hf j) + exact ⟨_, hw, (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection + hone hf function j hiM _ hw).2 rfl⟩ + obtain ⟨W, hW, covers⟩ := M.collection_witness collection indexedGraphValueFormula params members hI witnesses + have inW (i : I.toSet) : + orderedPairNameCode (s.encode one) (Name.check s one i.val).val (function.value i) ∈ W := by + obtain ⟨w, hw, code⟩ := covers i.val i.property + have eq := (M.realize_indexedGraphValueFormula s one pairing unions powers separation collection + hone hf function i (M.transitive hI i.property) w (M.transitive hW hw)).1 code + exact eq ▸ hw + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers hW + (M.unorderedPair_mem pairing hone hone) + have bound : (Name.indexedGraphName one function names).val ⊆ B := by + intro z hz + obtain ⟨i, rfl⟩ := (Name.mem_indexedGraphName_code one function names z).1 hz + exact pairBound _ (inW i) _ (ZFSet.mem_pair.2 (Or.inl rfl)) + let entryParams := extend I (extend f (extend (s.encode one) Fin.elim0)) + have selected := M.separation_mem separation indexedGraphNameEntryFormula entryParams + (Fin.cases hI (Fin.cases hf (Fin.cases hone (fun j => Fin.elim0 j)))) hB + have equal : ZFSet.sep (fun z => Realize M.sets indexedGraphNameEntryFormula + (extend z entryParams)) B = (Name.indexedGraphName one function names).val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, code⟩ + exact (M.realize_indexedGraphNameEntryFormula s one pairing unions powers separation collection + hone hI hf function names z (M.transitive hB hz)).1 code + · intro hz + exact ⟨bound hz, (M.realize_indexedGraphNameEntryFormula s one pairing unions powers separation collection + hone hI hf function names z (M.transitive hB (bound hz))).2 hz⟩ + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def orderedPairNameFamily (one X Y : ZFSet.{u}) : ZFSet.{u} := + ZFSet.range (fun p : X × Y => orderedPairNameCode one p.1.val p.2.val) + +theorem mem_orderedPairNameFamily (one X Y z : ZFSet.{u}) : + z ∈ orderedPairNameFamily one X Y ↔ + ∃ x ∈ X, ∃ y ∈ Y, z = orderedPairNameCode one x y := by + rw [orderedPairNameFamily, ZFSet.mem_range] + constructor + · rintro ⟨p, equal⟩ + exact ⟨p.1.val, p.1.property, p.2.val, p.2.property, equal.symm⟩ + · rintro ⟨x, hx, y, hy, equal⟩ + exact ⟨(⟨x, hx⟩, ⟨y, hy⟩), equal.symm⟩ + +theorem pairNameCode_subset {one x y B : ZFSet.{u}} (hx : x ∈ B) (hy : y ∈ B) : + pairNameCode one x y ⊆ ZFSet.prod B {one} := by + intro z hz + rcases ZFSet.mem_pair.1 hz with rfl | rfl + · exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_singleton.2 rfl⟩ + · exact ZFSet.pair_mem_prod.2 ⟨hy, ZFSet.mem_singleton.2 rfl⟩ + +noncomputable def iteratedPairNameFamily (one T : ZFSet.{u}) : Nat → ZFSet.{u} + | 0 => T + | n + 1 => orderedPairNameFamily one (iteratedPairNameFamily one T n) T + +theorem iteratedPairNameFamily_zero (one T : ZFSet.{u}) : + iteratedPairNameFamily one T 0 = T := rfl + +theorem iteratedPairNameFamily_succ (one T : ZFSet.{u}) (n : Nat) : + iteratedPairNameFamily one T (n + 1) = + orderedPairNameFamily one (iteratedPairNameFamily one T n) T := rfl + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +namespace Name +variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) + +private theorem inputFunction (J : ZFSet.{u}) : FunctionGraphOn J (identityFunctionGraph J) := + ⟨J, (identityFunctionGraph_injection J).function⟩ + +private theorem inputValue (J : ZFSet.{u}) (i : J.toSet) : + (inputFunction J).value i = i.val := + (inputFunction J).value_eq_of_entry i + ((pair_mem_identityFunctionGraph J i.val i.val).2 ⟨rfl, i.property⟩) + +omit [PartialOrder P] [OrderTop P] in +private theorem inputValid (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) (i : J.toSet) : + IsName s ((inputFunction J).value i) := by + rw [inputValue] + exact valid i.val i.property + +noncomputable def inputEvaluationName (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) : Name s := + indexedGraphName ⊤ (inputFunction J) (inputValid s J valid) + +theorem inputEvaluationName_entry (J : ZFSet.{u}) (valid : ∀ z ∈ J, IsName s z) + (tau : Name s) (H : ConditionFilter P) (x : ZFSet.{u}) : + ZFSet.pair tau.val x ∈ eval {p | H.mem p} (inputEvaluationName s J valid) ↔ + tau.val ∈ J ∧ eval {p | H.mem p} tau = x := by + rw [inputEvaluationName, + mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem (inputFunction J) + (inputValid s J valid)] + constructor + · rintro ⟨i, equal⟩ + obtain ⟨code, value⟩ := ZFSet.pair_inj.1 equal + have same : (⟨(inputFunction J).value i, inputValid s J valid i⟩ : Name s) = tau := + Subtype.ext ((inputValue J i).trans code) + exact ⟨code ▸ i.property, same ▸ value⟩ + · rintro ⟨member, value⟩ + let i : J.toSet := ⟨tau.val, member⟩ + have same : (⟨(inputFunction J).value i, inputValid s J valid i⟩ : Name s) = tau := + Subtype.ext (inputValue J i) + exact ⟨i, congrArg (ZFSet.pair tau.val) (same ▸ value)⟩ + +end Name + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) + +theorem inputEvaluationName_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (carrier : s.carrier ∈ M.sets) + {J : ZFSet.{u}} (hJ : J ∈ M.sets) (valid : ∀ z ∈ J, IsName s z) : + (Name.inputEvaluationName s J valid).val ∈ M.sets := + M.indexedGraphName_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) hJ + (M.identityFunctionGraph_mem pairing unions powers separation hJ) _ _ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {P : Type u} + +noncomputable def namePool (s : Presentation P) (B : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (IsName s) B + +theorem mem_namePool (s : Presentation P) (B x : ZFSet.{u}) : + x ∈ namePool s B ↔ x ∈ B ∧ IsName s x := ZFSet.mem_sep + +namespace TransitiveGround + +theorem namePool_mem (M : TransitiveGround.{u}) (s : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) : + namePool s B ∈ M.sets := by + have selected := M.separation_mem separation uniformNameFormula (extend s.carrier Fin.elim0) + (Fin.cases carrier (fun j => Fin.elim0 j)) hB + have equal : ZFSet.sep (fun x => Realize M.sets uniformNameFormula + (extend x (extend s.carrier Fin.elim0))) B = namePool s B := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, mem_namePool] + apply and_congr_right + intro hx + exact M.realize_uniformNameFormula s pairing unions powers separation collection + carrier x (M.transitive hB hx) + exact equal ▸ selected + +end TransitiveGround + +namespace Name +variable {s : Presentation P} + +theorem child_mem_namePool {σ β : Name s} {p : P} (entry : Entry σ β p) : + σ.val ∈ namePool s (ZFSet.sUnion (ZFSet.sUnion β.val)) := + (mem_namePool _ _ _).2 ⟨child_mem_doubleUnion entry, σ.property⟩ + +theorem indexedGraphName_covers_eval (H : Set P) (one : P) (hone : one ∈ H) + (β : Name s) {I f : ZFSet.{u}} (function : FunctionGraphOn I f) + (names : ∀ i, IsName s (function.value i)) + (onto : ∀ v ∈ namePool s (ZFSet.sUnion (ZFSet.sUnion β.val)), + ∃ i ∈ I, ZFSet.pair i v ∈ f) : + ∀ x ∈ eval H β, ∃ i ∈ I, ZFSet.pair i x ∈ eval H (indexedGraphName one function names) := by + intro x hx + obtain ⟨σ, p, entry, _, value⟩ := (mem_eval H β x).1 hx + obtain ⟨i, hi, named⟩ := onto σ.val (child_mem_namePool entry) + let j : I.toSet := ⟨i, hi⟩ + have rawEqual := function.value_eq_of_entry j named + have nameEqual : (⟨function.value j, names j⟩ : Name s) = σ := Subtype.ext rawEqual + refine ⟨i, hi, (pair_mem_eval_indexedGraphName H one hone function names j x).2 ?_⟩ + exact (congrArg (eval H) nameEqual).trans value + +end Name + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P Q : Type u} {s : Presentation P} + +noncomputable def indexedTuple (one : P) (I : ZFSet.{u}) + (names : I.toSet → Name s) : Name s := + assemble (fun i : I => orderedPair one (check s one i.val) (names i)) (fun _ => one) + +theorem indexedGraphName_eq_indexedTuple {I f : ZFSet.{u}} (one : P) + (function : FunctionGraphOn I f) (names : ∀ i, IsName s (function.value i)) : + indexedGraphName one function names = + indexedTuple one I (fun i => ⟨function.value i, names i⟩) := rfl + +theorem mem_eval_indexedTuple (H : Set P) (one : P) (hone : one ∈ H) + (I : ZFSet.{u}) (names : I.toSet → Name s) (z : ZFSet.{u}) : + z ∈ eval H (indexedTuple one I names) ↔ + ∃ i : I, ZFSet.pair i.val (eval H (names i)) = z := by + rw [indexedTuple, mem_eval_assemble] + simp only [hone, true_and, eval_orderedPair H one hone, eval_check H one hone] + +theorem pair_mem_eval_indexedTuple (H : Set P) (one : P) (hone : one ∈ H) + (I : ZFSet.{u}) (names : I.toSet → Name s) (i : I.toSet) (x : ZFSet.{u}) : + ZFSet.pair i.val x ∈ eval H (indexedTuple one I names) ↔ eval H (names i) = x := by + rw [mem_eval_indexedTuple H one hone] + constructor + · rintro ⟨j, eq⟩ + have ji : j = i := Subtype.ext (ZFSet.pair_inj.1 eq).1 + subst j + exact (ZFSet.pair_inj.1 eq).2 + · intro eq + exact ⟨i, congrArg (ZFSet.pair i.val) eq⟩ + +theorem eval_indexedTuple_function (H : Set P) (one : P) (hone : one ∈ H) + (I : ZFSet.{u}) (names : I.toSet → Name s) : + ZFSet.IsFunc I (ZFSet.range (fun i : I => eval H (names i))) + (eval H (indexedTuple one I names)) := by + constructor + · intro z hz + obtain ⟨i, rfl⟩ := (mem_eval_indexedTuple H one hone I names z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨i.property, ZFSet.mem_range.2 ⟨i, rfl⟩⟩ + · intro i hi + let j : I.toSet := ⟨i, hi⟩ + refine ⟨eval H (names j), (pair_mem_eval_indexedTuple H one hone I names j _).2 rfl, ?_⟩ + intro x hx + exact ((pair_mem_eval_indexedTuple H one hone I names j x).1 hx).symm + +theorem eval_indexedTuple_domain_eq (H : Set P) (one : P) (hone : one ∈ H) + {I J : ZFSet.{u}} (names : I.toSet → Name s) (other : J.toSet → Name s) + (eq : eval H (indexedTuple one I names) = eval H (indexedTuple one J other)) : I = J := by + apply ZFSet.ext + intro x + constructor + · intro hx + have entry := (pair_mem_eval_indexedTuple H one hone I names ⟨x, hx⟩ _).2 rfl + rw [eq] at entry + obtain ⟨j, hj⟩ := (mem_eval_indexedTuple H one hone J other _).1 entry + have same : j.val = x := (ZFSet.pair_inj.1 hj).1 + rw [← same] + exact j.property + · intro hx + have entry := (pair_mem_eval_indexedTuple H one hone J other ⟨x, hx⟩ _).2 rfl + rw [← eq] at entry + obtain ⟨i, hi⟩ := (mem_eval_indexedTuple H one hone I names _).1 entry + have same : i.val = x := (ZFSet.pair_inj.1 hi).1 + rw [← same] + exact i.property + +theorem eval_indexedTuple_eq_iff (H : Set P) (one : P) (hone : one ∈ H) + (I : ZFSet.{u}) (names other : I.toSet → Name s) : + eval H (indexedTuple one I names) = eval H (indexedTuple one I other) ↔ + ∀ i, eval H (names i) = eval H (other i) := by + constructor + · intro eq i + have entry := (pair_mem_eval_indexedTuple H one hone I other i _).2 rfl + rw [← eq] at entry + exact (pair_mem_eval_indexedTuple H one hone I names i _).1 entry + · intro eq + apply ZFSet.ext + intro z + rw [mem_eval_indexedTuple H one hone, mem_eval_indexedTuple H one hone] + exact exists_congr (fun i => by rw [eq i]) + +theorem rename_indexedTuple (t : Presentation Q) (f : P → Q) (one : P) + (I : ZFSet.{u}) (names : I.toSet → Name s) : + rename t f (indexedTuple one I names) = + indexedTuple (f one) I (fun i => rename t f (names i)) := by + rw [indexedTuple, rename_assemble, indexedTuple] + apply congrArg (fun ns : I → Name t => assemble ns (fun _ => f one)) + funext i + rw [rename_orderedPair, rename_check] + +theorem act_indexedTuple {G : Type v} [Group G] [PartialOrder P] [OrderTop P] + (a : PosetAction G P) (g : G) (I : ZFSet.{u}) (names : I.toSet → Name s) : + a.act s g (indexedTuple ⊤ I names) = indexedTuple ⊤ I (fun i => a.act s g (names i)) := by + change rename s (a.iso g) _ = _ + rw [rename_indexedTuple, (a.iso g).map_top] + rfl + +theorem indexedTuple_supported {G : Type v} [Group G] [PartialOrder P] [OrderTop P] + (a : PosetAction G P) (I : ZFSet.{u}) (names : I.toSet → Name s) + (K : Subgroup G) (fixed : ∀ g ∈ K, ∀ i, a.act s g (names i) = names i) : + K ≤ a.stabilizer s (indexedTuple ⊤ I names) := by + intro g hg + change a.act s g (indexedTuple ⊤ I names) = _ + rw [act_indexedTuple] + exact congrArg (indexedTuple ⊤ I) (funext (fixed g hg)) + +theorem indexedTuple_hs {G : Type v} [Group G] [PartialOrder P] [OrderTop P] + (a : PosetAction G P) (F : NormalSubgroupFamily G) (I : ZFSet.{u}) + (names : I.toSet → Name s) (K : Subgroup G) (hK : F.mem K) + (fixed : ∀ g ∈ K, ∀ i, a.act s g (names i) = names i) + (children : ∀ i, HereditarilySymmetric a s F (names i)) : + HereditarilySymmetric a s F (indexedTuple ⊤ I names) := by + apply HereditarilySymmetric.assemble + · exact F.upward hK (indexedTuple_supported a I names K fixed) + · intro i + exact (HereditarilySymmetric.check a s F i.val).orderedPair (children i) + +end PartitionPilot.Forcing.Name + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialAction.lean index 3bc8c61a17b7fb9a7b8d6f02cee7ce907692c98e..8ee40abc118a9b03339de1129c4cd0822b082d14 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialAction.lean @@ -1,183 +1,183 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.TaskSystem - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem - -open Attachment - -universe u - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -theorem initialFreshEq {i j : Task} {y : A} - {hi : ¬ P.le y (f.datum i).source} {hj : ¬ P.le y (f.datum j).source} (eq : i = j) : - (⟨i, ⟨y, hi⟩⟩ : f.initial.batch.Fresh) = ⟨j, ⟨y, hj⟩⟩ := by - cases eq - rfl - -noncomputable def initialRename (g : G) (x : f.initial.batch.Fresh) : f.initial.batch.Fresh := - ⟨f.perm g x.1, ⟨x.2.val, by - change ¬ P.le x.2.val (f.datum (f.perm g x.1)).source - rw [f.source_invariant] - exact x.2.property⟩⟩ - -noncomputable def initialAct (g : G) : A ⊕ f.initial.batch.Fresh → A ⊕ f.initial.batch.Fresh - | .inl x => .inl ((f.action g).toFun x) - | .inr x => .inr (f.initialRename g x) - -theorem initialRename_left (g : G) (x : f.initial.batch.Fresh) : - f.initialRename (f.group.inv g) (f.initialRename g x) = x := by - rcases x with ⟨i, y, hy⟩ - exact f.initialFreshEq (f.perm_left g i) - -theorem initialRename_right (g : G) (x : f.initial.batch.Fresh) : - f.initialRename g (f.initialRename (f.group.inv g) x) = x := by - rcases x with ⟨i, y, hy⟩ - exact f.initialFreshEq (f.perm_right g i) - -theorem initialAct_left (g : G) (x : A ⊕ f.initial.batch.Fresh) : - f.initialAct (f.group.inv g) (f.initialAct g x) = x := by - cases x with - | inl x => exact congrArg Sum.inl (f.action_left g x) - | inr x => exact congrArg Sum.inr (f.initialRename_left g x) - -theorem initialAct_right (g : G) (x : A ⊕ f.initial.batch.Fresh) : - f.initialAct g (f.initialAct (f.group.inv g) x) = x := by - cases x with - | inl x => exact congrArg Sum.inl (f.action_right g x) - | inr x => exact congrArg Sum.inr (f.initialRename_right g x) - -theorem initialShadow (g : G) (x : f.initial.batch.Fresh) : - f.initial.batch.shadow (f.initialRename g x) = - (f.action g).toFun (f.initial.batch.shadow x) := by - change (f.action (f.representative (f.perm g x.1))).toFun - (P.meet x.2.val (f.datum (f.perm g x.1)).source) = - (f.action g).toFun ((f.action (f.representative x.1)).toFun - (P.meet x.2.val (f.datum x.1).source)) - rw [f.source_invariant] - exact (f.ground_compatible g x.1 _ (P.meet_le_right _ _)).symm - -theorem initialInside_forward (g : G) {x y : f.initial.batch.Fresh} - (h : f.initial.batch.Inside x y) : - f.initial.batch.Inside (f.initialRename g x) (f.initialRename g y) := by - rcases x with ⟨i, x⟩ - rcases y with ⟨j, y⟩ - rcases h with ⟨eq, h⟩ - cases eq - exact ⟨rfl, h⟩ - -theorem initialInside_iff (g : G) (x y : f.initial.batch.Fresh) : - f.initial.batch.Inside (f.initialRename g x) (f.initialRename g y) ↔ - f.initial.batch.Inside x y := by - constructor - · intro h - have h' := f.initialInside_forward (f.group.inv g) h - rw [f.initialRename_left, f.initialRename_left] at h' - exact h' - · exact f.initialInside_forward g - -theorem initialOrder (g : G) (x y : A ⊕ f.initial.batch.Fresh) : - f.initial.batch.extension.le (f.initialAct g x) (f.initialAct g y) ↔ - f.initial.batch.extension.le x y := by - cases x with - | inl x => - cases y with - | inl y => exact (f.action g).le_iff x y - | inr y => - change P.le ((f.action g).toFun x) (f.initial.batch.shadow (f.initialRename g y)) ↔ _ - rw [f.initialShadow] - exact (f.action g).le_iff _ _ - | inr x => - cases y with - | inl y => exact f.filter_covariant g x.1 y - | inr y => - change (f.initial.batch.Inside (f.initialRename g x) (f.initialRename g y) ∨ - (f.datum (f.perm g x.1)).filter.mem (f.initial.batch.shadow (f.initialRename g y))) ↔ - (f.initial.batch.Inside x y ∨ (f.datum x.1).filter.mem (f.initial.batch.shadow y)) - rw [f.initialInside_iff, f.initialShadow, f.filter_covariant] - -noncomputable def initialIso (g : G) : MeetIso f.initial.batch.extension f.initial.batch.extension := - isoOfOrder (f.initialAct g) (f.initialAct (f.group.inv g)) - (f.initialAct_left g) (f.initialAct_right g) (f.initialOrder g) - -theorem initialIso_old (g : G) (x : A) : - (f.initialIso g).toFun (.inl x) = .inl ((f.action g).toFun x) := rfl - -theorem initialIso_one (x : A ⊕ f.initial.batch.Fresh) : - (f.initialIso f.group.one).toFun x = x := by - cases x with - | inl x => exact congrArg Sum.inl (f.action_one x) - | inr x => - rcases x with ⟨i, y, hy⟩ - exact congrArg Sum.inr (f.initialFreshEq (f.perm_one i)) - -theorem initialIso_mul (g h : G) (x : A ⊕ f.initial.batch.Fresh) : - (f.initialIso (f.group.mul g h)).toFun x = - (f.initialIso g).toFun ((f.initialIso h).toFun x) := by - cases x with - | inl x => exact congrArg Sum.inl (f.action_mul g h x) - | inr x => - rcases x with ⟨i, y, hy⟩ - exact congrArg Sum.inr (f.initialFreshEq (f.perm_mul g h i)) - -theorem initial_equivariant (g : G) (i : Task) (x : A) : - (f.initialIso g).toFun ((f.initial.copy i).toFun x) = - (f.initial.copy (f.perm g i)).toFun x := by - classical - change (f.initialIso g).toFun (f.initial.batch.represent i x) = - f.initial.batch.represent (f.perm g i) x - by_cases hx : P.le x (f.datum i).source - · have hx' : P.le x (f.datum (f.perm g i)).source := by rw [f.source_invariant]; exact hx - rw [f.initial.batch.represent_old i x hx, f.initial.batch.represent_old (f.perm g i) x hx'] - exact congrArg Sum.inl (f.ground_compatible g i x hx) - · have hx' : ¬ P.le x (f.datum (f.perm g i)).source := by rw [f.source_invariant]; exact hx - rw [f.initial.batch.represent_new i x hx, f.initial.batch.represent_new (f.perm g i) x hx'] - rfl - -theorem initial_agreement (g h : G) (v : A) - (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) - (x : A ⊕ f.initial.batch.Fresh) (below : f.initial.batch.extension.le x (.inl v)) : - (f.initialIso g).toFun x = (f.initialIso h).toFun x := by - cases x with - | inl x => exact congrArg Sum.inl (agree x below) - | inr x => - rcases x with ⟨i, y, hy⟩ - exact congrArg Sum.inr (f.initialFreshEq (f.positive_perms_agree g h v agree i below)) - -noncomputable def initialInputs : Inputs f.initial.batch Task where - source i := (f.datum i).source - previous := f.initial.copy - representative i := f.initialIso (f.representative i) - agree := f.initial.copy_agrees_on_base - -noncomputable def initialSymmetry (g : G) : TaskSymmetry f.initialInputs where - perm := f.perm g - inverse := f.perm (f.group.inv g) - left_inverse := f.perm_left g - right_inverse := f.perm_right g - current := f.initialIso g - source := f.source_invariant g - intertwine := f.initial_equivariant g - -theorem initial_negative (i : Task) (v : A) (negative : ¬ (f.datum i).filter.mem v) : - f.initial.batch.extension.le - (f.initial.batch.extension.meet ((f.initial.copy i).toFun f.top) (.inl v)) - ((f.initial.copy i).toFun (f.datum i).source) := by - have src := f.initial.copy_agrees_on_base i (f.datum i).source (P.refl _) - change f.initial.batch.extension.le - (f.initial.batch.extension.meet (f.initial.batch.represent i f.top) (.inl v)) _ - rw [f.initial.batch.represent_new i f.top (f.source_proper i), src, - f.initial.batch.shadow_meet_eq ⟨i, ⟨f.top, f.source_proper i⟩⟩ v negative] - have hs := f.initial.batch.cap_shadow i f.top f.greatest (f.source_proper i) - change f.initial.batch.shadow ⟨i, ⟨f.top, f.source_proper i⟩⟩ = _ at hs - rw [hs] - exact P.meet_le_left _ _ - -end PartitionPilot.Compression.RecursiveMaps.TaskSystem - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.TaskSystem + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem + +open Attachment + +universe u + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +theorem initialFreshEq {i j : Task} {y : A} + {hi : ¬ P.le y (f.datum i).source} {hj : ¬ P.le y (f.datum j).source} (eq : i = j) : + (⟨i, ⟨y, hi⟩⟩ : f.initial.batch.Fresh) = ⟨j, ⟨y, hj⟩⟩ := by + cases eq + rfl + +noncomputable def initialRename (g : G) (x : f.initial.batch.Fresh) : f.initial.batch.Fresh := + ⟨f.perm g x.1, ⟨x.2.val, by + change ¬ P.le x.2.val (f.datum (f.perm g x.1)).source + rw [f.source_invariant] + exact x.2.property⟩⟩ + +noncomputable def initialAct (g : G) : A ⊕ f.initial.batch.Fresh → A ⊕ f.initial.batch.Fresh + | .inl x => .inl ((f.action g).toFun x) + | .inr x => .inr (f.initialRename g x) + +theorem initialRename_left (g : G) (x : f.initial.batch.Fresh) : + f.initialRename (f.group.inv g) (f.initialRename g x) = x := by + rcases x with ⟨i, y, hy⟩ + exact f.initialFreshEq (f.perm_left g i) + +theorem initialRename_right (g : G) (x : f.initial.batch.Fresh) : + f.initialRename g (f.initialRename (f.group.inv g) x) = x := by + rcases x with ⟨i, y, hy⟩ + exact f.initialFreshEq (f.perm_right g i) + +theorem initialAct_left (g : G) (x : A ⊕ f.initial.batch.Fresh) : + f.initialAct (f.group.inv g) (f.initialAct g x) = x := by + cases x with + | inl x => exact congrArg Sum.inl (f.action_left g x) + | inr x => exact congrArg Sum.inr (f.initialRename_left g x) + +theorem initialAct_right (g : G) (x : A ⊕ f.initial.batch.Fresh) : + f.initialAct g (f.initialAct (f.group.inv g) x) = x := by + cases x with + | inl x => exact congrArg Sum.inl (f.action_right g x) + | inr x => exact congrArg Sum.inr (f.initialRename_right g x) + +theorem initialShadow (g : G) (x : f.initial.batch.Fresh) : + f.initial.batch.shadow (f.initialRename g x) = + (f.action g).toFun (f.initial.batch.shadow x) := by + change (f.action (f.representative (f.perm g x.1))).toFun + (P.meet x.2.val (f.datum (f.perm g x.1)).source) = + (f.action g).toFun ((f.action (f.representative x.1)).toFun + (P.meet x.2.val (f.datum x.1).source)) + rw [f.source_invariant] + exact (f.ground_compatible g x.1 _ (P.meet_le_right _ _)).symm + +theorem initialInside_forward (g : G) {x y : f.initial.batch.Fresh} + (h : f.initial.batch.Inside x y) : + f.initial.batch.Inside (f.initialRename g x) (f.initialRename g y) := by + rcases x with ⟨i, x⟩ + rcases y with ⟨j, y⟩ + rcases h with ⟨eq, h⟩ + cases eq + exact ⟨rfl, h⟩ + +theorem initialInside_iff (g : G) (x y : f.initial.batch.Fresh) : + f.initial.batch.Inside (f.initialRename g x) (f.initialRename g y) ↔ + f.initial.batch.Inside x y := by + constructor + · intro h + have h' := f.initialInside_forward (f.group.inv g) h + rw [f.initialRename_left, f.initialRename_left] at h' + exact h' + · exact f.initialInside_forward g + +theorem initialOrder (g : G) (x y : A ⊕ f.initial.batch.Fresh) : + f.initial.batch.extension.le (f.initialAct g x) (f.initialAct g y) ↔ + f.initial.batch.extension.le x y := by + cases x with + | inl x => + cases y with + | inl y => exact (f.action g).le_iff x y + | inr y => + change P.le ((f.action g).toFun x) (f.initial.batch.shadow (f.initialRename g y)) ↔ _ + rw [f.initialShadow] + exact (f.action g).le_iff _ _ + | inr x => + cases y with + | inl y => exact f.filter_covariant g x.1 y + | inr y => + change (f.initial.batch.Inside (f.initialRename g x) (f.initialRename g y) ∨ + (f.datum (f.perm g x.1)).filter.mem (f.initial.batch.shadow (f.initialRename g y))) ↔ + (f.initial.batch.Inside x y ∨ (f.datum x.1).filter.mem (f.initial.batch.shadow y)) + rw [f.initialInside_iff, f.initialShadow, f.filter_covariant] + +noncomputable def initialIso (g : G) : MeetIso f.initial.batch.extension f.initial.batch.extension := + isoOfOrder (f.initialAct g) (f.initialAct (f.group.inv g)) + (f.initialAct_left g) (f.initialAct_right g) (f.initialOrder g) + +theorem initialIso_old (g : G) (x : A) : + (f.initialIso g).toFun (.inl x) = .inl ((f.action g).toFun x) := rfl + +theorem initialIso_one (x : A ⊕ f.initial.batch.Fresh) : + (f.initialIso f.group.one).toFun x = x := by + cases x with + | inl x => exact congrArg Sum.inl (f.action_one x) + | inr x => + rcases x with ⟨i, y, hy⟩ + exact congrArg Sum.inr (f.initialFreshEq (f.perm_one i)) + +theorem initialIso_mul (g h : G) (x : A ⊕ f.initial.batch.Fresh) : + (f.initialIso (f.group.mul g h)).toFun x = + (f.initialIso g).toFun ((f.initialIso h).toFun x) := by + cases x with + | inl x => exact congrArg Sum.inl (f.action_mul g h x) + | inr x => + rcases x with ⟨i, y, hy⟩ + exact congrArg Sum.inr (f.initialFreshEq (f.perm_mul g h i)) + +theorem initial_equivariant (g : G) (i : Task) (x : A) : + (f.initialIso g).toFun ((f.initial.copy i).toFun x) = + (f.initial.copy (f.perm g i)).toFun x := by + classical + change (f.initialIso g).toFun (f.initial.batch.represent i x) = + f.initial.batch.represent (f.perm g i) x + by_cases hx : P.le x (f.datum i).source + · have hx' : P.le x (f.datum (f.perm g i)).source := by rw [f.source_invariant]; exact hx + rw [f.initial.batch.represent_old i x hx, f.initial.batch.represent_old (f.perm g i) x hx'] + exact congrArg Sum.inl (f.ground_compatible g i x hx) + · have hx' : ¬ P.le x (f.datum (f.perm g i)).source := by rw [f.source_invariant]; exact hx + rw [f.initial.batch.represent_new i x hx, f.initial.batch.represent_new (f.perm g i) x hx'] + rfl + +theorem initial_agreement (g h : G) (v : A) + (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) + (x : A ⊕ f.initial.batch.Fresh) (below : f.initial.batch.extension.le x (.inl v)) : + (f.initialIso g).toFun x = (f.initialIso h).toFun x := by + cases x with + | inl x => exact congrArg Sum.inl (agree x below) + | inr x => + rcases x with ⟨i, y, hy⟩ + exact congrArg Sum.inr (f.initialFreshEq (f.positive_perms_agree g h v agree i below)) + +noncomputable def initialInputs : Inputs f.initial.batch Task where + source i := (f.datum i).source + previous := f.initial.copy + representative i := f.initialIso (f.representative i) + agree := f.initial.copy_agrees_on_base + +noncomputable def initialSymmetry (g : G) : TaskSymmetry f.initialInputs where + perm := f.perm g + inverse := f.perm (f.group.inv g) + left_inverse := f.perm_left g + right_inverse := f.perm_right g + current := f.initialIso g + source := f.source_invariant g + intertwine := f.initial_equivariant g + +theorem initial_negative (i : Task) (v : A) (negative : ¬ (f.datum i).filter.mem v) : + f.initial.batch.extension.le + (f.initial.batch.extension.meet ((f.initial.copy i).toFun f.top) (.inl v)) + ((f.initial.copy i).toFun (f.datum i).source) := by + have src := f.initial.copy_agrees_on_base i (f.datum i).source (P.refl _) + change f.initial.batch.extension.le + (f.initial.batch.extension.meet (f.initial.batch.represent i f.top) (.inl v)) _ + rw [f.initial.batch.represent_new i f.top (f.source_proper i), src, + f.initial.batch.shadow_meet_eq ⟨i, ⟨f.top, f.source_proper i⟩⟩ v negative] + have hs := f.initial.batch.cap_shadow i f.top f.greatest (f.source_proper i) + change f.initial.batch.shadow ⟨i, ⟨f.top, f.source_proper i⟩⟩ = _ at hs + rw [hs] + exact P.meet_le_left _ _ + +end PartitionPilot.Compression.RecursiveMaps.TaskSystem + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRecursiveActionAgreement.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRecursiveActionAgreement.lean index eae57e822d193fccad388219e1040bca285a7186..d941d3fa60857a89c2967c74e4a9d2f3dd999e8a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRecursiveActionAgreement.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRecursiveActionAgreement.lean @@ -1,187 +1,187 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RecursiveActionRealization -import OAI.SetTheory.PartitionPrinciple.Transfinite.InitialRecursiveTaskLaws - -namespace OAI - -namespace PartitionPilot.Forcing.CodedRecursiveTaskAction - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (s : CodedRecursiveTaskAction h T) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -include s in -theorem nextAction_agreement - (g k : {g : ZFSet.{u} // g ∈ G}) - (topPoint : {x : ZFSet.{u} // x ∈ D}) - (top : ∀ x ∈ D, ZFSet.pair x topPoint.val ∈ rD) - (v : {x : ZFSet.{u} // x ∈ D}) (positive : ZFSet.{u} → Prop) - (negative : ∀ i S a cap base w, - ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ Sources → - ZFSet.pair topPoint.val cap ∈ S → ZFSet.pair a base ∈ S → - ¬ positive i → ZFSet.pair (ZFSet.pair cap v.val) w ∈ d.batchMeetGraph → - ZFSet.pair w base ∈ d.batchOrder) - (currentAgree : ActionAgreementBelow d.batchCarrier d.batchOrder A g.val k.val v.val) - (taskAgree : ∀ i i' i'', positive i → - ZFSet.pair (ZFSet.pair g.val i) i' ∈ T → - ZFSet.pair (ZFSet.pair k.val i) i'' ∈ T → i' = i'') : - ActionAgreementBelow next.batchCarrier next.batchOrder - (h.nextActionGraph T) g.val k.val v.val := by - have typedNegative : ∀ i : {i : ZFSet.{u} // i ∈ I}, ¬ positive i.val → - d.templates.extension.le - (d.templates.extension.meet ((h.toInputs.previous i).toFun topPoint) (.inl v)) - ((h.toInputs.previous i).toFun (h.toInputs.source i)) := by - intro i notPositive - apply (d.coding.le_encode _ _).1 - exact negative i.val (h.maps.value i) (h.source i).val _ _ _ - (h.maps.value_entry i) (h.source_entry i) - (h.toInputs_previous_entry i topPoint) - (h.toInputs_previous_entry i (h.toInputs.source i)) notPositive - (d.coding.encoded_meet_entry ((h.toInputs.previous i).toFun topPoint) (.inl v)) - have typedCurrent : ∀ x, d.templates.extension.le x (.inl v) → - (s.toTaskSymmetry g).current.toFun x = (s.toTaskSymmetry k).current.toFun x := by - intro x lower - apply d.coding.encode_injective - exact currentAgree.entry_eq h.action k.property (d.coding.encode_mem x) - ((d.coding.le_encode x (.inl v)).2 lower) - (s.toTaskSymmetry_current_entry g x) (s.toTaskSymmetry_current_entry k x) - have typedTasks : ∀ i : {i : ZFSet.{u} // i ∈ I}, positive i.val → - (s.toTaskSymmetry g).perm i = (s.toTaskSymmetry k).perm i := by - intro i pos - exact Subtype.ext (taskAgree i.val _ _ pos - (s.toTaskSymmetry_perm_entry g i) (s.toTaskSymmetry_perm_entry k i)) - have outputs {x y z : ZFSet.{u}} (hx : x ∈ next.batchCarrier) - (lower : ZFSet.pair x v.val ∈ next.batchOrder) - (first : ZFSet.pair (ZFSet.pair g.val x) y ∈ h.nextActionGraph T) - (second : ZFSet.pair (ZFSet.pair k.val x) z ∈ h.nextActionGraph T) : y = z := by - obtain ⟨a, rfl⟩ := h.nextEncode_surjective M next x hx - have below := (h.next_le_encode M next a (.inl (.inl v))).1 lower - have same := (s.toTaskSymmetry g).agreement_persists (s.toTaskSymmetry k) - topPoint (fun p => top p.val p.property) v (fun i => positive i.val) - typedNegative typedCurrent typedTasks a below - exact ((s.nextAction_entry_iff M next g a y).1 first).trans - ((congrArg (h.nextEncode M next) same).trans - ((s.nextAction_entry_iff M next k a z).1 second).symm) - intro x hx y _ lower - constructor - · intro first - obtain ⟨z, second, _⟩ := (s.nextAction_code M next).function.2 - (ZFSet.pair k.val x) (ZFSet.pair_mem_prod.2 ⟨k.property, hx⟩) - exact (outputs hx lower first second).symm ▸ second - · intro second - obtain ⟨z, first, _⟩ := (s.nextAction_code M next).function.2 - (ZFSet.pair g.val x) (ZFSet.pair_mem_prod.2 ⟨g.property, hx⟩) - exact outputs hx lower first second ▸ first - -end PartitionPilot.Forcing.CodedRecursiveTaskAction - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundInitialTaskAction - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - ∀ Reps (h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B), - CodedRecursiveTaskAction h (M.groundTaskTransport P G r μ A Labels) := by - dsimp only - intro Reps h - refine ⟨M.groundTaskTransport_setAction pairing unions powers separation hP hG hA - group action meet, ?_, ?_⟩ - · intro g i j a b task first second - exact M.groundInitialTask_source task first second - · intro g i j S S' q x y task first second image image' - exact M.groundInitialTask_intertwine pairing unions powers separation hP hG hr hμ hA hLabels - group action meet task first second image image' - -theorem groundInitialTask_positive_agreement - {P G r μ A Labels m inv one g h v i i' i'' F : ZFSet.{u}} - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (agree : ActionAgreementBelow P r A g h v) - (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (positive : v ∈ F) - (first : ZFSet.pair (ZFSet.pair g i) i' ∈ M.groundTaskTransport P G r μ A Labels) - (second : ZFSet.pair (ZFSet.pair h i) i'' ∈ M.groundTaskTransport P G r μ A Labels) : - i' = i'' := by - have hi := ((triple_mem_taskTransportGraph G _ P _ _ Labels A g i i').1 first).2.1 - obtain ⟨a, ha, c, hc, base, hb, s, hs, F', hF, label, hl, equal, _⟩ := - (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi - have filterEq : F = F' := - ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 4).1 (equal ▸ filter)).2 - exact M.groundTaskTransport_positive_agreement group action meet agree - (filterEq ▸ positive) (equal ▸ first) (equal ▸ second) - -theorem groundInitialRecursiveAction_agreement - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one T g h v : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hT : T ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) - (hg : g ∈ G) (hh : h ∈ G) (hv : v ∈ P) - (agree : ActionAgreementBelow P r A g h v) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) - As (literalTaskBaseGraph I P R U Labels) - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - ∀ Reps (inputs : CodedRecursiveMapInputs d I Maps As Reps G m inv one B) - (next : inputs.NextInputs M), - ActionAgreementBelow next.batchCarrier next.batchOrder - (inputs.nextActionGraph (M.groundTaskTransport P G r μ A Labels)) g h v := by - dsimp only - intro Reps inputs next - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let positive : ZFSet.{u} → Prop := fun i => - ∃ F, ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels ∧ v ∈ F - have symmetry := M.groundInitialTaskAction pairing unions powers separation - hP hG hr hμ hA hLabels group action meet Reps inputs - apply symmetry.nextAction_agreement M next ⟨g, hg⟩ ⟨h, hh⟩ ⟨T, hT⟩ top ⟨v, hv⟩ positive - · intro i S a cap base w mapEntry source capEntry baseEntry negative entry - have hi := inputs.maps.pair_source mapEntry - obtain ⟨a', ha, c, hc, ell, hell, sep, hsep, F, hF, label, hl, equal, _⟩ := - (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi - have target : ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels := by - rw [equal] - exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 1).2 ⟨equal ▸ hi, rfl⟩ - have filter : ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels := by - rw [equal] - exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 4).2 ⟨equal ▸ hi, rfl⟩ - exact M.groundInitialMap_negative_cap pairing unions powers separation - hP hG hr hμ hA hLabels group action meet hT top mapEntry source target filter - capEntry baseEntry hv (fun hvF => negative ⟨F, filter, hvF⟩) entry - · exact M.groundEligibleBatchAction_agreement pairing unions powers separation - hP hG hA group action meet hg hh hv agree - · intro i i' i'' hp first second - obtain ⟨F, filter, hvF⟩ := hp - exact M.groundInitialTask_positive_agreement group action meet agree filter hvF first second - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RecursiveActionRealization +import OAI.SetTheory.PartitionPrinciple.Transfinite.InitialRecursiveTaskLaws + +namespace OAI + +namespace PartitionPilot.Forcing.CodedRecursiveTaskAction + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (s : CodedRecursiveTaskAction h T) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +include s in +theorem nextAction_agreement + (g k : {g : ZFSet.{u} // g ∈ G}) + (topPoint : {x : ZFSet.{u} // x ∈ D}) + (top : ∀ x ∈ D, ZFSet.pair x topPoint.val ∈ rD) + (v : {x : ZFSet.{u} // x ∈ D}) (positive : ZFSet.{u} → Prop) + (negative : ∀ i S a cap base w, + ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ Sources → + ZFSet.pair topPoint.val cap ∈ S → ZFSet.pair a base ∈ S → + ¬ positive i → ZFSet.pair (ZFSet.pair cap v.val) w ∈ d.batchMeetGraph → + ZFSet.pair w base ∈ d.batchOrder) + (currentAgree : ActionAgreementBelow d.batchCarrier d.batchOrder A g.val k.val v.val) + (taskAgree : ∀ i i' i'', positive i → + ZFSet.pair (ZFSet.pair g.val i) i' ∈ T → + ZFSet.pair (ZFSet.pair k.val i) i'' ∈ T → i' = i'') : + ActionAgreementBelow next.batchCarrier next.batchOrder + (h.nextActionGraph T) g.val k.val v.val := by + have typedNegative : ∀ i : {i : ZFSet.{u} // i ∈ I}, ¬ positive i.val → + d.templates.extension.le + (d.templates.extension.meet ((h.toInputs.previous i).toFun topPoint) (.inl v)) + ((h.toInputs.previous i).toFun (h.toInputs.source i)) := by + intro i notPositive + apply (d.coding.le_encode _ _).1 + exact negative i.val (h.maps.value i) (h.source i).val _ _ _ + (h.maps.value_entry i) (h.source_entry i) + (h.toInputs_previous_entry i topPoint) + (h.toInputs_previous_entry i (h.toInputs.source i)) notPositive + (d.coding.encoded_meet_entry ((h.toInputs.previous i).toFun topPoint) (.inl v)) + have typedCurrent : ∀ x, d.templates.extension.le x (.inl v) → + (s.toTaskSymmetry g).current.toFun x = (s.toTaskSymmetry k).current.toFun x := by + intro x lower + apply d.coding.encode_injective + exact currentAgree.entry_eq h.action k.property (d.coding.encode_mem x) + ((d.coding.le_encode x (.inl v)).2 lower) + (s.toTaskSymmetry_current_entry g x) (s.toTaskSymmetry_current_entry k x) + have typedTasks : ∀ i : {i : ZFSet.{u} // i ∈ I}, positive i.val → + (s.toTaskSymmetry g).perm i = (s.toTaskSymmetry k).perm i := by + intro i pos + exact Subtype.ext (taskAgree i.val _ _ pos + (s.toTaskSymmetry_perm_entry g i) (s.toTaskSymmetry_perm_entry k i)) + have outputs {x y z : ZFSet.{u}} (hx : x ∈ next.batchCarrier) + (lower : ZFSet.pair x v.val ∈ next.batchOrder) + (first : ZFSet.pair (ZFSet.pair g.val x) y ∈ h.nextActionGraph T) + (second : ZFSet.pair (ZFSet.pair k.val x) z ∈ h.nextActionGraph T) : y = z := by + obtain ⟨a, rfl⟩ := h.nextEncode_surjective M next x hx + have below := (h.next_le_encode M next a (.inl (.inl v))).1 lower + have same := (s.toTaskSymmetry g).agreement_persists (s.toTaskSymmetry k) + topPoint (fun p => top p.val p.property) v (fun i => positive i.val) + typedNegative typedCurrent typedTasks a below + exact ((s.nextAction_entry_iff M next g a y).1 first).trans + ((congrArg (h.nextEncode M next) same).trans + ((s.nextAction_entry_iff M next k a z).1 second).symm) + intro x hx y _ lower + constructor + · intro first + obtain ⟨z, second, _⟩ := (s.nextAction_code M next).function.2 + (ZFSet.pair k.val x) (ZFSet.pair_mem_prod.2 ⟨k.property, hx⟩) + exact (outputs hx lower first second).symm ▸ second + · intro second + obtain ⟨z, first, _⟩ := (s.nextAction_code M next).function.2 + (ZFSet.pair g.val x) (ZFSet.pair_mem_prod.2 ⟨g.property, hx⟩) + exact outputs hx lower first second ▸ first + +end PartitionPilot.Forcing.CodedRecursiveTaskAction + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundInitialTaskAction + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + ∀ Reps (h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B), + CodedRecursiveTaskAction h (M.groundTaskTransport P G r μ A Labels) := by + dsimp only + intro Reps h + refine ⟨M.groundTaskTransport_setAction pairing unions powers separation hP hG hA + group action meet, ?_, ?_⟩ + · intro g i j a b task first second + exact M.groundInitialTask_source task first second + · intro g i j S S' q x y task first second image image' + exact M.groundInitialTask_intertwine pairing unions powers separation hP hG hr hμ hA hLabels + group action meet task first second image image' + +theorem groundInitialTask_positive_agreement + {P G r μ A Labels m inv one g h v i i' i'' F : ZFSet.{u}} + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (agree : ActionAgreementBelow P r A g h v) + (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (positive : v ∈ F) + (first : ZFSet.pair (ZFSet.pair g i) i' ∈ M.groundTaskTransport P G r μ A Labels) + (second : ZFSet.pair (ZFSet.pair h i) i'' ∈ M.groundTaskTransport P G r μ A Labels) : + i' = i'' := by + have hi := ((triple_mem_taskTransportGraph G _ P _ _ Labels A g i i').1 first).2.1 + obtain ⟨a, ha, c, hc, base, hb, s, hs, F', hF, label, hl, equal, _⟩ := + (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi + have filterEq : F = F' := + ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 4).1 (equal ▸ filter)).2 + exact M.groundTaskTransport_positive_agreement group action meet agree + (filterEq ▸ positive) (equal ▸ first) (equal ▸ second) + +theorem groundInitialRecursiveAction_agreement + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one T g h v : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hT : T ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) + (hg : g ∈ G) (hh : h ∈ G) (hv : v ∈ P) + (agree : ActionAgreementBelow P r A g h v) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) + As (literalTaskBaseGraph I P R U Labels) + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + ∀ Reps (inputs : CodedRecursiveMapInputs d I Maps As Reps G m inv one B) + (next : inputs.NextInputs M), + ActionAgreementBelow next.batchCarrier next.batchOrder + (inputs.nextActionGraph (M.groundTaskTransport P G r μ A Labels)) g h v := by + dsimp only + intro Reps inputs next + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let positive : ZFSet.{u} → Prop := fun i => + ∃ F, ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels ∧ v ∈ F + have symmetry := M.groundInitialTaskAction pairing unions powers separation + hP hG hr hμ hA hLabels group action meet Reps inputs + apply symmetry.nextAction_agreement M next ⟨g, hg⟩ ⟨h, hh⟩ ⟨T, hT⟩ top ⟨v, hv⟩ positive + · intro i S a cap base w mapEntry source capEntry baseEntry negative entry + have hi := inputs.maps.pair_source mapEntry + obtain ⟨a', ha, c, hc, ell, hell, sep, hsep, F, hF, label, hl, equal, _⟩ := + (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi + have target : ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels := by + rw [equal] + exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 1).2 ⟨equal ▸ hi, rfl⟩ + have filter : ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels := by + rw [equal] + exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 4).2 ⟨equal ▸ hi, rfl⟩ + exact M.groundInitialMap_negative_cap pairing unions powers separation + hP hG hr hμ hA hLabels group action meet hT top mapEntry source target filter + capEntry baseEntry hv (fun hvF => negative ⟨F, filter, hvF⟩) entry + · exact M.groundEligibleBatchAction_agreement pairing unions powers separation + hP hG hA group action meet hg hh hv agree + · intro i i' i'' hp first second + obtain ⟨F, filter, hvF⟩ := hp + exact M.groundInitialTask_positive_agreement group action meet agree filter hvF first second + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRowForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRowForcing.lean index 4d3211e71cfa28f1c4559bbecb151b9ff0b51324..bff165c4912d6cc58a086ba56b0269dcbb6a1da4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRowForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/InitialRowForcing.lean @@ -1,477 +1,477 @@ -import Mathlib.Algebra.Group.Subgroup.Map -import OAI.SetTheory.PartitionPrinciple.Forcing.GenericPartialFunctions -import OAI.SetTheory.PartitionPrinciple.Geometry.FinalRectangles -import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalCardinality - -namespace OAI - - -namespace PartitionPilot.Forcing.CountableCondition - -universe u v w z -variable {I : Type u} {J : Type v} {K : Type w} {A : Type z} - -noncomputable def rename (e : I ≃ J) (p : CountableCondition I A) : CountableCondition J A where - value j := p.value (e.symm j) - countable_domain := (p.countable_domain.image e).mono (by - intro j hj - exact ⟨e.symm j, hj, e.apply_symm_apply j⟩) - -theorem rename_value (e : I ≃ J) (p : CountableCondition I A) (i : I) : - (rename e p).value (e i) = p.value i := by - change p.value (e.symm (e i)) = p.value i - rw [e.symm_apply_apply] - -theorem rename_refl (p : CountableCondition I A) : rename (Equiv.refl I) p = p := ext rfl - -theorem rename_trans (e : I ≃ J) (f : J ≃ K) (p : CountableCondition I A) : - rename f (rename e p) = rename (e.trans f) p := ext rfl - -theorem rename_symm (e : I ≃ J) (p : CountableCondition I A) : rename e.symm (rename e p) = p := by - apply ext - funext i - exact rename_value e p i - -theorem rename_le_iff (e : I ≃ J) (p q : CountableCondition I A) : - rename e p ≤ rename e q ↔ p ≤ q := by - constructor - · intro lower i a value - have old : (rename e q).value (e i) = some a := (rename_value e q i).trans value - exact (rename_value e p i).symm.trans (lower (e i) a old) - · intro lower j a value - exact lower (e.symm j) a value - -noncomputable def renameOrderIso (e : I ≃ J) : CountableCondition I A ≃o CountableCondition J A where - toFun := rename e - invFun := rename e.symm - left_inv := rename_symm e - right_inv := rename_symm e.symm - map_rel_iff' := rename_le_iff e _ _ - -theorem rename_top (e : I ≃ J) : rename (A := A) e ⊤ = ⊤ := ext rfl - -theorem rename_fixed (e : I ≃ I) (p : CountableCondition I A) - (fixed : ∀ i ∈ p.domain, e i = i) : rename e p = p := by - apply le_antisymm - · intro i a value - have defined : i ∈ p.domain := by - change p.value i ≠ none - rw [value] - exact Option.some_ne_none _ - have read := rename_value e p i - rw [fixed i defined] at read - exact read.trans value - · intro i a value - change p.value (e.symm i) = some a at value - have defined : e.symm i ∈ p.domain := by - change p.value (e.symm i) ≠ none - rw [value] - exact Option.some_ne_none _ - have same := fixed (e.symm i) defined - rw [e.apply_symm_apply] at same - exact same.symm ▸ value - -end PartitionPilot.Forcing.CountableCondition - - - -namespace PartitionPilot.Forcing - -open Cardinal Compression.RecursiveMaps -open scoped Cardinal - -namespace CountableCondition -universe u v -variable {I : Type u} {A : Type v} - -def graphCode (p : CountableCondition I A) : Set (I × A) := - {ia | p.value ia.1 = some ia.2} - -theorem graphCode_injective : Function.Injective (graphCode (I := I) (A := A)) := by - intro p q eq - apply le_antisymm - · intro i a ha - have mem : (i, a) ∈ q.graphCode := ha - rw [← eq] at mem - exact mem - · intro i a ha - have mem : (i, a) ∈ p.graphCode := ha - rw [eq] at mem - exact mem - -theorem cardinal_lt (κ : Cardinal.{max u v}) (inaccessible : κ.IsInaccessible) - (smallPairs : #(I × A) < κ) : #(CountableCondition I A) < κ := - (Cardinal.mk_le_of_injective graphCode_injective).trans_lt - (SizeBounds.sets_lt κ inaccessible smallPairs) - -end CountableCondition - -namespace Rows -open CountableColumns -universe u - -abbrev Conditions (I : Type u) := CountableCondition (I × Column) Bool - -def differentRows {I : Type u} (i j : I) : Set (Conditions I) := - {p | ∃ α, p.value (i, α) = some false ∧ p.value (j, α) = some true} - -theorem fresh_column {I : Type u} (p : Conditions I) : ∃ α : Column, ∀ i, p.value (i, α) = none := by - classical - let : Countable p.domain := p.countable_domain.to_subtype - let α := upperBound (fun x : p.domain => x.val.2) - refine ⟨α, ?_⟩ - intro i - by_contra defined - have impossible := upperBound_above (fun x : p.domain => x.val.2) ⟨(i, α), defined⟩ - exact lt_irrefl α impossible - -theorem differentRows_dense {I : Type u} (i j : I) (ne : i ≠ j) : Dense (differentRows i j) := by - classical - intro p - rcases fresh_column p with ⟨α, fresh⟩ - have ij : (i, α) ≠ (j, α) := fun eq => ne (congrArg Prod.fst eq) - have ji : (j, α) ≠ (i, α) := Ne.symm ij - let p1 := p.assign (i, α) false - have p1_le : p1 ≤ p := p.assign_le (i, α) false (fresh i) - have j_fresh : p1.value (j, α) = none := - (p.assign_other (i, α) (j, α) false ji).trans (fresh j) - let q := p1.assign (j, α) true - have q_le : q ≤ p1 := p1.assign_le (j, α) true j_fresh - refine ⟨q, le_trans q_le p1_le, α, ?_, ?_⟩ - · exact (p1.assign_other (j, α) (i, α) true ij).trans (p.assign_same (i, α) false) - · exact p1.assign_same (j, α) true - -theorem differentRows_downwardClosed {I : Type u} (i j : I) : DownwardClosed (differentRows i j) := by - rintro p q le ⟨α, hi, hj⟩ - exact ⟨α, le (i, α) false hi, le (j, α) true hj⟩ - -open MainStage.OrdinalRun - -abbrev Position := {x : FinalPoint Column // x ≠ finalBottom Column} -abbrev RowForcing := Conditions Position - -theorem rowForcing_countablyClosed : CountablyClosed RowForcing := CountableCondition.countablyClosed - -theorem positions_cardinal_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : #Position < κ := - SizeBounds.subtype_lt κ (countableOrdinalLabels_final_cardinal_bounds κ inaccessible).1 _ - -theorem coordinates_cardinal_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : - #(Position × Column) < κ := - SizeBounds.prod_lt κ inaccessible (positions_cardinal_lt κ inaccessible) - (cardinal_lt_inaccessible κ inaccessible) - -theorem rowForcing_cardinal_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : #RowForcing < κ := by - apply CountableCondition.cardinal_lt κ inaccessible - rw [Cardinal.mk_prod, Cardinal.lift_uzero, Cardinal.mk_bool, Cardinal.lift_ofNat] - exact Cardinal.mul_lt_of_lt inaccessible.1.le (coordinates_cardinal_lt κ inaccessible) - ((Cardinal.natCast_lt_aleph0 (n := 2)).trans inaccessible.1) - -end Rows -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.Rows - -open Compression.RecursiveMaps.CountableColumns CountableCondition -universe u -variable {I : Type u} - -def denseFamily (I : Type u) : Set (Set (Conditions I)) := - {D | (∃ c, D = definedAt c) ∨ ∃ i j, i ≠ j ∧ D = differentRows i j} - -theorem denseFamily_dense {D : Set (Conditions I)} (member : D ∈ denseFamily I) : Dense D := by - rcases member with ⟨c, rfl⟩ | ⟨i, j, ne, rfl⟩ - · exact definedAt_dense c - · exact differentRows_dense i j ne - -theorem generic_meets_coordinates (F : ConditionFilter (Conditions I)) - (generic : F.GenericFor (denseFamily I)) (c : I × Column) : F.Meets (definedAt c) := - generic _ (Or.inl ⟨c, rfl⟩) (definedAt_dense c) - -noncomputable def row (F : ConditionFilter (Conditions I)) - (generic : F.GenericFor (denseFamily I)) (i : I) : Set Column := - {α | readValue F (generic_meets_coordinates F generic) (i, α) = true} - -theorem mem_row_iff (F : ConditionFilter (Conditions I)) (generic : F.GenericFor (denseFamily I)) - (i : I) (α : Column) : α ∈ row F generic i ↔ ∃ p, F.mem p ∧ p.value (i, α) = some true := - readValue_iff F (generic_meets_coordinates F generic) (i, α) true - -theorem row_injective (F : ConditionFilter (Conditions I)) (generic : F.GenericFor (denseFamily I)) : - Function.Injective (row F generic) := by - classical - intro i j eq - by_contra ne - rcases generic _ (Or.inr ⟨i, j, ne, rfl⟩) (differentRows_dense i j ne) with ⟨p, hp, α, hi, hj⟩ - have positive : α ∈ row F generic j := (mem_row_iff F generic j α).2 ⟨p, hp, hj⟩ - have negative : α ∉ row F generic i := by - intro member - have value := readValue_of_condition F (generic_meets_coordinates F generic) hp hi - change readValue F (generic_meets_coordinates F generic) (i, α) = true at member - exact Bool.noConfusion (value.symm.trans member) - exact negative (eq.symm ▸ positive) - -theorem actual_generic_rows (F : ConditionFilter RowForcing) (generic : F.GenericFor (denseFamily Position)) : - ∃ rows : Position → Set Column, Function.Injective rows ∧ - ∀ i α, α ∈ rows i ↔ ∃ p, F.mem p ∧ p.value (i, α) = some true := - ⟨row F generic, row_injective F generic, mem_row_iff F generic⟩ - -end PartitionPilot.Forcing.Rows - - - -namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction - -universe u -variable {A G : Type u} [Group G] {P : MeetOrder A} (a : OrderAction G P) - -theorem act_inv_left (g : G) (x : A) : (a.iso g⁻¹).toFun ((a.iso g).toFun x) = x := by - rw [← a.mul, inv_mul_cancel, a.one] - -theorem act_inv_right (g : G) (x : A) : (a.iso g).toFun ((a.iso g⁻¹).toFun x) = x := by - rw [← a.mul, mul_inv_cancel, a.one] - -def fixSubgroup (C : A) : Subgroup G where - carrier := {g | ∀ x, P.le x C → (a.iso g).toFun x = x} - one_mem' := fun x _ => a.one x - mul_mem' {g h} hg hh x lower := by rw [a.mul, hh x lower, hg x lower] - inv_mem' {g} hg x lower := by - apply embedding_injective (a.iso g).toMeetEmbedding - exact (a.act_inv_right g x).trans (hg x lower).symm - -theorem fix_antitone {C D : A} (lower : P.le C D) : a.fixSubgroup D ≤ a.fixSubgroup C := - fun _ fixed x hx => fixed x (P.trans hx lower) - -def conjugateHom (g : G) : G →* G where - toFun h := g * h * g⁻¹ - map_one' := by simp - map_mul' h k := by simp [mul_assoc] - -theorem fix_conjugation (g h : G) (C : A) : - conjugateHom g h ∈ a.fixSubgroup ((a.iso g).toFun C) ↔ h ∈ a.fixSubgroup C := by - constructor - · intro fixed x lower - apply embedding_injective (a.iso g).toMeetEmbedding - have eq := fixed ((a.iso g).toFun x) (((a.iso g).le_iff _ _).mpr lower) - change (a.iso (g * h * g⁻¹)).toFun ((a.iso g).toFun x) = (a.iso g).toFun x at eq - rw [a.mul, a.mul, a.act_inv_left] at eq - exact eq - · intro fixed x lower - have old : P.le ((a.iso g⁻¹).toFun x) C := by - have h := ((a.iso g⁻¹).le_iff _ _).mpr lower - rw [a.act_inv_left] at h - exact h - change (a.iso (g * h * g⁻¹)).toFun x = x - rw [a.mul, a.mul, fixed _ old, a.act_inv_right] - -def SupportedSubgroup (K : Subgroup G) : Prop := ∃ C, a.fixSubgroup C ≤ K - -theorem supported_top (C : A) : a.SupportedSubgroup ⊤ := ⟨C, le_top⟩ - -theorem supported_upward {K H : Subgroup G} (small : a.SupportedSubgroup K) (lower : K ≤ H) : - a.SupportedSubgroup H := by - rcases small with ⟨C, hc⟩ - exact ⟨C, le_trans hc lower⟩ - -theorem supported_inf - (bounded : ∀ C D, ∃ E, P.le C E ∧ P.le D E) - {K H : Subgroup G} (left : a.SupportedSubgroup K) (right : a.SupportedSubgroup H) : - a.SupportedSubgroup (K ⊓ H) := by - rcases left with ⟨C, hc⟩ - rcases right with ⟨D, hd⟩ - rcases bounded C D with ⟨E, ce, de⟩ - exact ⟨E, le_inf (le_trans (a.fix_antitone ce) hc) (le_trans (a.fix_antitone de) hd)⟩ - -theorem supported_conjugate (g : G) {K : Subgroup G} (supported : a.SupportedSubgroup K) : - a.SupportedSubgroup (K.map (conjugateHom g)) := by - rcases supported with ⟨C, hc⟩ - refine ⟨(a.iso g).toFun C, ?_⟩ - intro h fixed - let k := g⁻¹ * h * g - have eq : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] - have old : k ∈ a.fixSubgroup C := (a.fix_conjugation g k C).mp (eq.symm ▸ fixed) - exact Subgroup.mem_map.mpr ⟨k, hc old, eq⟩ - -end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction - - - -namespace PartitionPilot.Compression.RecursiveMaps - -open CosetGeometry.OrderAction -universe u v - -structure NormalSubgroupFamily (G : Type u) [Group G] where - mem : Subgroup G → Prop - top : mem ⊤ - upward : ∀ {K H}, mem K → K ≤ H → mem H - inf : ∀ {K H}, mem K → mem H → mem (K ⊓ H) - conjugate : ∀ g {K}, mem K → mem (K.map (conjugateHom g)) - -namespace MainStage.OrdinalRun -variable (Label : Type 1) - -noncomputable def supportFamily : NormalSubgroupFamily (FinalActor Label) where - mem := (finalAction Label).SupportedSubgroup - top := (finalAction Label).supported_top (finalBottom Label) - upward := (finalAction Label).supported_upward - inf := (finalAction Label).supported_inf (by - intro C D - rcases final_countable_upper_bound Label {C, D} ((Set.countable_singleton D).insert C) with - ⟨E, bound⟩ - exact ⟨E, bound C (Set.mem_insert _ _), - bound D (Set.mem_insert_of_mem _ (Set.mem_singleton D))⟩) - conjugate := (finalAction Label).supported_conjugate - -theorem supportFamily_countably_complete {I : Type v} [Countable I] - (K : I → Subgroup (FinalActor Label)) (supported : ∀ i, (supportFamily Label).mem (K i)) : - (supportFamily Label).mem (⨅ i, K i) := by - classical - change ∀ i, ∃ C, (finalAction Label).fixSubgroup C ≤ K i at supported - choose C lower using supported - rcases final_countable_upper_bound Label (Set.range C) (Set.countable_range C) with ⟨D, bound⟩ - refine ⟨D, le_iInf (fun i => ?_)⟩ - exact le_trans ((finalAction Label).fix_antitone (bound (C i) (Set.mem_range_self i))) (lower i) - -end MainStage.OrdinalRun - -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Forcing.Rows - -open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns -open Compression.RecursiveMaps.MainStage.OrdinalRun CountableCondition - -theorem action_bottom (g : FinalActor Column) : - ((finalAction Column).iso g).toFun (finalBottom Column) = finalBottom Column := by - apply (finalOrder Column).antisymm - · have lower := (((finalAction Column).iso g).le_iff _ _).2 - (finalBottom_least Column (((finalAction Column).iso g⁻¹).toFun (finalBottom Column))) - rw [(finalAction Column).act_inv_right] at lower - exact lower - · exact finalBottom_least Column _ - -noncomputable def positionAction (g : FinalActor Column) (i : Position) : Position := - ⟨((finalAction Column).iso g).toFun i.val, by - intro eq - apply i.property - exact Compression.embedding_injective ((finalAction Column).iso g).toMeetEmbedding - (eq.trans (action_bottom g).symm)⟩ - -theorem positionAction_one (i : Position) : positionAction 1 i = i := - Subtype.ext ((finalAction Column).one i.val) - -theorem positionAction_mul (g h : FinalActor Column) (i : Position) : - positionAction (g * h) i = positionAction g (positionAction h i) := - Subtype.ext ((finalAction Column).mul g h i.val) - -noncomputable def positionPermutation (g : FinalActor Column) : Position ≃ Position where - toFun := positionAction g - invFun := positionAction g⁻¹ - left_inv i := Subtype.ext ((finalAction Column).act_inv_left g i.val) - right_inv i := Subtype.ext ((finalAction Column).act_inv_right g i.val) - -noncomputable def coordinatePermutation (g : FinalActor Column) : Position × Column ≃ Position × Column := - Equiv.prodCongr (positionPermutation g) (Equiv.refl Column) - -theorem coordinatePermutation_one : coordinatePermutation 1 = Equiv.refl (Position × Column) := by - apply Equiv.ext - intro x - exact Prod.ext (positionAction_one x.1) rfl - -theorem coordinatePermutation_mul (g h : FinalActor Column) : - coordinatePermutation (g * h) = (coordinatePermutation h).trans (coordinatePermutation g) := by - apply Equiv.ext - intro x - exact Prod.ext (positionAction_mul g h x.1) rfl - -noncomputable def rowAction (g : FinalActor Column) : RowForcing ≃o RowForcing := - renameOrderIso (coordinatePermutation g) - -theorem rowAction_one (p : RowForcing) : rowAction 1 p = p := by - change rename (coordinatePermutation 1) p = p - rw [coordinatePermutation_one, rename_refl] - -theorem rowAction_mul (g h : FinalActor Column) (p : RowForcing) : - rowAction (g * h) p = rowAction g (rowAction h p) := by - change rename (coordinatePermutation (g * h)) p = - rename (coordinatePermutation g) (rename (coordinatePermutation h) p) - rw [coordinatePermutation_mul, rename_trans] - -theorem rowAction_value (g : FinalActor Column) (p : RowForcing) (i : Position) (α : Column) : - (rowAction g p).value (positionAction g i, α) = p.value (i, α) := - rename_value (coordinatePermutation g) p (i, α) - -theorem rowAction_top (g : FinalActor Column) : rowAction g ⊤ = ⊤ := - rename_top (coordinatePermutation g) - -theorem rowAction_le_iff (g : FinalActor Column) (p q : RowForcing) : - rowAction g p ≤ rowAction g q ↔ p ≤ q := - rename_le_iff (coordinatePermutation g) p q - -theorem rowCondition_supported (p : RowForcing) : - ∃ C : FinalPoint Column, ∀ g : FinalActor Column, - g ∈ (finalAction Column).fixSubgroup C → rowAction g p = p := by - let positions : Set (FinalPoint Column) := (fun c : Position × Column => c.1.val) '' p.domain - have small : positions.Countable := p.countable_domain.image (fun c => c.1.val) - rcases final_countable_upper_bound Column positions small with ⟨C, bound⟩ - refine ⟨C, ?_⟩ - intro g fixed - apply rename_fixed - intro c hc - apply Prod.ext - · apply Subtype.ext - exact fixed c.1.val (bound c.1.val ⟨c, hc, rfl⟩) - · rfl - -end PartitionPilot.Forcing.Rows - - - -namespace PartitionPilot.Forcing.Rows - -open Cardinal Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns -open Compression.RecursiveMaps.MainStage.OrdinalRun SetRealization -open scoped Cardinal - -noncomputable def rowConditionPresentation : Presentation RowForcing := Presentation.canonical RowForcing - -theorem rowConditionPresentation_rank_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : - ZFSet.rank rowConditionPresentation.carrier < κ.ord := - Presentation.canonical_rank_lt _ κ (rowForcing_cardinal_lt κ inaccessible) - -structure InitialRowForcingLaws (κ : Cardinal.{1}) : Prop where - closed : CountablyClosed RowForcing - small : #RowForcing < κ - rank : ZFSet.rank rowConditionPresentation.carrier < κ.ord - coordinate_dense : ∀ c : Position × Column, Dense (CountableCondition.definedAt (A := Bool) c) - different_dense : ∀ i j : Position, i ≠ j → Dense (differentRows i j) - countable_decisions : ∀ (A : Nat → Type 1) (d : DecisionSystem RowForcing A), Dense d.commonDecisions - action_one : ∀ p, rowAction 1 p = p - action_mul : ∀ g h p, rowAction (g * h) p = rowAction g (rowAction h p) - action_value : ∀ g p i α, (rowAction g p).value (positionAction g i, α) = p.value (i, α) - condition_support : ∀ p, ∃ C : FinalPoint Column, ∀ g : FinalActor Column, - g ∈ (finalAction Column).fixSubgroup C → rowAction g p = p - generic_rows : ∀ F : ConditionFilter RowForcing, F.GenericFor (denseFamily Position) → - ∃ rows : Position → Set Column, Function.Injective rows ∧ - ∀ i α, α ∈ rows i ↔ ∃ p, F.mem p ∧ p.value (i, α) = some true - -theorem initial_row_forcing_laws (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : - InitialRowForcingLaws κ where - closed := rowForcing_countablyClosed - small := rowForcing_cardinal_lt κ inaccessible - rank := rowConditionPresentation_rank_lt κ inaccessible - coordinate_dense := CountableCondition.definedAt_dense - different_dense := differentRows_dense - countable_decisions := fun _ d => d.commonDecisions_dense rowForcing_countablyClosed - action_one := rowAction_one - action_mul := rowAction_mul - action_value := rowAction_value - condition_support := rowCondition_supported - generic_rows := actual_generic_rows - -end PartitionPilot.Forcing.Rows - -end OAI +import Mathlib.Algebra.Group.Subgroup.Map +import OAI.SetTheory.PartitionPrinciple.Forcing.GenericPartialFunctions +import OAI.SetTheory.PartitionPrinciple.Geometry.FinalRectangles +import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalCardinality + +namespace OAI + + +namespace PartitionPilot.Forcing.CountableCondition + +universe u v w z +variable {I : Type u} {J : Type v} {K : Type w} {A : Type z} + +noncomputable def rename (e : I ≃ J) (p : CountableCondition I A) : CountableCondition J A where + value j := p.value (e.symm j) + countable_domain := (p.countable_domain.image e).mono (by + intro j hj + exact ⟨e.symm j, hj, e.apply_symm_apply j⟩) + +theorem rename_value (e : I ≃ J) (p : CountableCondition I A) (i : I) : + (rename e p).value (e i) = p.value i := by + change p.value (e.symm (e i)) = p.value i + rw [e.symm_apply_apply] + +theorem rename_refl (p : CountableCondition I A) : rename (Equiv.refl I) p = p := ext rfl + +theorem rename_trans (e : I ≃ J) (f : J ≃ K) (p : CountableCondition I A) : + rename f (rename e p) = rename (e.trans f) p := ext rfl + +theorem rename_symm (e : I ≃ J) (p : CountableCondition I A) : rename e.symm (rename e p) = p := by + apply ext + funext i + exact rename_value e p i + +theorem rename_le_iff (e : I ≃ J) (p q : CountableCondition I A) : + rename e p ≤ rename e q ↔ p ≤ q := by + constructor + · intro lower i a value + have old : (rename e q).value (e i) = some a := (rename_value e q i).trans value + exact (rename_value e p i).symm.trans (lower (e i) a old) + · intro lower j a value + exact lower (e.symm j) a value + +noncomputable def renameOrderIso (e : I ≃ J) : CountableCondition I A ≃o CountableCondition J A where + toFun := rename e + invFun := rename e.symm + left_inv := rename_symm e + right_inv := rename_symm e.symm + map_rel_iff' := rename_le_iff e _ _ + +theorem rename_top (e : I ≃ J) : rename (A := A) e ⊤ = ⊤ := ext rfl + +theorem rename_fixed (e : I ≃ I) (p : CountableCondition I A) + (fixed : ∀ i ∈ p.domain, e i = i) : rename e p = p := by + apply le_antisymm + · intro i a value + have defined : i ∈ p.domain := by + change p.value i ≠ none + rw [value] + exact Option.some_ne_none _ + have read := rename_value e p i + rw [fixed i defined] at read + exact read.trans value + · intro i a value + change p.value (e.symm i) = some a at value + have defined : e.symm i ∈ p.domain := by + change p.value (e.symm i) ≠ none + rw [value] + exact Option.some_ne_none _ + have same := fixed (e.symm i) defined + rw [e.apply_symm_apply] at same + exact same.symm ▸ value + +end PartitionPilot.Forcing.CountableCondition + + + +namespace PartitionPilot.Forcing + +open Cardinal Compression.RecursiveMaps +open scoped Cardinal + +namespace CountableCondition +universe u v +variable {I : Type u} {A : Type v} + +def graphCode (p : CountableCondition I A) : Set (I × A) := + {ia | p.value ia.1 = some ia.2} + +theorem graphCode_injective : Function.Injective (graphCode (I := I) (A := A)) := by + intro p q eq + apply le_antisymm + · intro i a ha + have mem : (i, a) ∈ q.graphCode := ha + rw [← eq] at mem + exact mem + · intro i a ha + have mem : (i, a) ∈ p.graphCode := ha + rw [eq] at mem + exact mem + +theorem cardinal_lt (κ : Cardinal.{max u v}) (inaccessible : κ.IsInaccessible) + (smallPairs : #(I × A) < κ) : #(CountableCondition I A) < κ := + (Cardinal.mk_le_of_injective graphCode_injective).trans_lt + (SizeBounds.sets_lt κ inaccessible smallPairs) + +end CountableCondition + +namespace Rows +open CountableColumns +universe u + +abbrev Conditions (I : Type u) := CountableCondition (I × Column) Bool + +def differentRows {I : Type u} (i j : I) : Set (Conditions I) := + {p | ∃ α, p.value (i, α) = some false ∧ p.value (j, α) = some true} + +theorem fresh_column {I : Type u} (p : Conditions I) : ∃ α : Column, ∀ i, p.value (i, α) = none := by + classical + let : Countable p.domain := p.countable_domain.to_subtype + let α := upperBound (fun x : p.domain => x.val.2) + refine ⟨α, ?_⟩ + intro i + by_contra defined + have impossible := upperBound_above (fun x : p.domain => x.val.2) ⟨(i, α), defined⟩ + exact lt_irrefl α impossible + +theorem differentRows_dense {I : Type u} (i j : I) (ne : i ≠ j) : Dense (differentRows i j) := by + classical + intro p + rcases fresh_column p with ⟨α, fresh⟩ + have ij : (i, α) ≠ (j, α) := fun eq => ne (congrArg Prod.fst eq) + have ji : (j, α) ≠ (i, α) := Ne.symm ij + let p1 := p.assign (i, α) false + have p1_le : p1 ≤ p := p.assign_le (i, α) false (fresh i) + have j_fresh : p1.value (j, α) = none := + (p.assign_other (i, α) (j, α) false ji).trans (fresh j) + let q := p1.assign (j, α) true + have q_le : q ≤ p1 := p1.assign_le (j, α) true j_fresh + refine ⟨q, le_trans q_le p1_le, α, ?_, ?_⟩ + · exact (p1.assign_other (j, α) (i, α) true ij).trans (p.assign_same (i, α) false) + · exact p1.assign_same (j, α) true + +theorem differentRows_downwardClosed {I : Type u} (i j : I) : DownwardClosed (differentRows i j) := by + rintro p q le ⟨α, hi, hj⟩ + exact ⟨α, le (i, α) false hi, le (j, α) true hj⟩ + +open MainStage.OrdinalRun + +abbrev Position := {x : FinalPoint Column // x ≠ finalBottom Column} +abbrev RowForcing := Conditions Position + +theorem rowForcing_countablyClosed : CountablyClosed RowForcing := CountableCondition.countablyClosed + +theorem positions_cardinal_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : #Position < κ := + SizeBounds.subtype_lt κ (countableOrdinalLabels_final_cardinal_bounds κ inaccessible).1 _ + +theorem coordinates_cardinal_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : + #(Position × Column) < κ := + SizeBounds.prod_lt κ inaccessible (positions_cardinal_lt κ inaccessible) + (cardinal_lt_inaccessible κ inaccessible) + +theorem rowForcing_cardinal_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : #RowForcing < κ := by + apply CountableCondition.cardinal_lt κ inaccessible + rw [Cardinal.mk_prod, Cardinal.lift_uzero, Cardinal.mk_bool, Cardinal.lift_ofNat] + exact Cardinal.mul_lt_of_lt inaccessible.1.le (coordinates_cardinal_lt κ inaccessible) + ((Cardinal.natCast_lt_aleph0 (n := 2)).trans inaccessible.1) + +end Rows +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.Rows + +open Compression.RecursiveMaps.CountableColumns CountableCondition +universe u +variable {I : Type u} + +def denseFamily (I : Type u) : Set (Set (Conditions I)) := + {D | (∃ c, D = definedAt c) ∨ ∃ i j, i ≠ j ∧ D = differentRows i j} + +theorem denseFamily_dense {D : Set (Conditions I)} (member : D ∈ denseFamily I) : Dense D := by + rcases member with ⟨c, rfl⟩ | ⟨i, j, ne, rfl⟩ + · exact definedAt_dense c + · exact differentRows_dense i j ne + +theorem generic_meets_coordinates (F : ConditionFilter (Conditions I)) + (generic : F.GenericFor (denseFamily I)) (c : I × Column) : F.Meets (definedAt c) := + generic _ (Or.inl ⟨c, rfl⟩) (definedAt_dense c) + +noncomputable def row (F : ConditionFilter (Conditions I)) + (generic : F.GenericFor (denseFamily I)) (i : I) : Set Column := + {α | readValue F (generic_meets_coordinates F generic) (i, α) = true} + +theorem mem_row_iff (F : ConditionFilter (Conditions I)) (generic : F.GenericFor (denseFamily I)) + (i : I) (α : Column) : α ∈ row F generic i ↔ ∃ p, F.mem p ∧ p.value (i, α) = some true := + readValue_iff F (generic_meets_coordinates F generic) (i, α) true + +theorem row_injective (F : ConditionFilter (Conditions I)) (generic : F.GenericFor (denseFamily I)) : + Function.Injective (row F generic) := by + classical + intro i j eq + by_contra ne + rcases generic _ (Or.inr ⟨i, j, ne, rfl⟩) (differentRows_dense i j ne) with ⟨p, hp, α, hi, hj⟩ + have positive : α ∈ row F generic j := (mem_row_iff F generic j α).2 ⟨p, hp, hj⟩ + have negative : α ∉ row F generic i := by + intro member + have value := readValue_of_condition F (generic_meets_coordinates F generic) hp hi + change readValue F (generic_meets_coordinates F generic) (i, α) = true at member + exact Bool.noConfusion (value.symm.trans member) + exact negative (eq.symm ▸ positive) + +theorem actual_generic_rows (F : ConditionFilter RowForcing) (generic : F.GenericFor (denseFamily Position)) : + ∃ rows : Position → Set Column, Function.Injective rows ∧ + ∀ i α, α ∈ rows i ↔ ∃ p, F.mem p ∧ p.value (i, α) = some true := + ⟨row F generic, row_injective F generic, mem_row_iff F generic⟩ + +end PartitionPilot.Forcing.Rows + + + +namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction + +universe u +variable {A G : Type u} [Group G] {P : MeetOrder A} (a : OrderAction G P) + +theorem act_inv_left (g : G) (x : A) : (a.iso g⁻¹).toFun ((a.iso g).toFun x) = x := by + rw [← a.mul, inv_mul_cancel, a.one] + +theorem act_inv_right (g : G) (x : A) : (a.iso g).toFun ((a.iso g⁻¹).toFun x) = x := by + rw [← a.mul, mul_inv_cancel, a.one] + +def fixSubgroup (C : A) : Subgroup G where + carrier := {g | ∀ x, P.le x C → (a.iso g).toFun x = x} + one_mem' := fun x _ => a.one x + mul_mem' {g h} hg hh x lower := by rw [a.mul, hh x lower, hg x lower] + inv_mem' {g} hg x lower := by + apply embedding_injective (a.iso g).toMeetEmbedding + exact (a.act_inv_right g x).trans (hg x lower).symm + +theorem fix_antitone {C D : A} (lower : P.le C D) : a.fixSubgroup D ≤ a.fixSubgroup C := + fun _ fixed x hx => fixed x (P.trans hx lower) + +def conjugateHom (g : G) : G →* G where + toFun h := g * h * g⁻¹ + map_one' := by simp + map_mul' h k := by simp [mul_assoc] + +theorem fix_conjugation (g h : G) (C : A) : + conjugateHom g h ∈ a.fixSubgroup ((a.iso g).toFun C) ↔ h ∈ a.fixSubgroup C := by + constructor + · intro fixed x lower + apply embedding_injective (a.iso g).toMeetEmbedding + have eq := fixed ((a.iso g).toFun x) (((a.iso g).le_iff _ _).mpr lower) + change (a.iso (g * h * g⁻¹)).toFun ((a.iso g).toFun x) = (a.iso g).toFun x at eq + rw [a.mul, a.mul, a.act_inv_left] at eq + exact eq + · intro fixed x lower + have old : P.le ((a.iso g⁻¹).toFun x) C := by + have h := ((a.iso g⁻¹).le_iff _ _).mpr lower + rw [a.act_inv_left] at h + exact h + change (a.iso (g * h * g⁻¹)).toFun x = x + rw [a.mul, a.mul, fixed _ old, a.act_inv_right] + +def SupportedSubgroup (K : Subgroup G) : Prop := ∃ C, a.fixSubgroup C ≤ K + +theorem supported_top (C : A) : a.SupportedSubgroup ⊤ := ⟨C, le_top⟩ + +theorem supported_upward {K H : Subgroup G} (small : a.SupportedSubgroup K) (lower : K ≤ H) : + a.SupportedSubgroup H := by + rcases small with ⟨C, hc⟩ + exact ⟨C, le_trans hc lower⟩ + +theorem supported_inf + (bounded : ∀ C D, ∃ E, P.le C E ∧ P.le D E) + {K H : Subgroup G} (left : a.SupportedSubgroup K) (right : a.SupportedSubgroup H) : + a.SupportedSubgroup (K ⊓ H) := by + rcases left with ⟨C, hc⟩ + rcases right with ⟨D, hd⟩ + rcases bounded C D with ⟨E, ce, de⟩ + exact ⟨E, le_inf (le_trans (a.fix_antitone ce) hc) (le_trans (a.fix_antitone de) hd)⟩ + +theorem supported_conjugate (g : G) {K : Subgroup G} (supported : a.SupportedSubgroup K) : + a.SupportedSubgroup (K.map (conjugateHom g)) := by + rcases supported with ⟨C, hc⟩ + refine ⟨(a.iso g).toFun C, ?_⟩ + intro h fixed + let k := g⁻¹ * h * g + have eq : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] + have old : k ∈ a.fixSubgroup C := (a.fix_conjugation g k C).mp (eq.symm ▸ fixed) + exact Subgroup.mem_map.mpr ⟨k, hc old, eq⟩ + +end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction + + + +namespace PartitionPilot.Compression.RecursiveMaps + +open CosetGeometry.OrderAction +universe u v + +structure NormalSubgroupFamily (G : Type u) [Group G] where + mem : Subgroup G → Prop + top : mem ⊤ + upward : ∀ {K H}, mem K → K ≤ H → mem H + inf : ∀ {K H}, mem K → mem H → mem (K ⊓ H) + conjugate : ∀ g {K}, mem K → mem (K.map (conjugateHom g)) + +namespace MainStage.OrdinalRun +variable (Label : Type 1) + +noncomputable def supportFamily : NormalSubgroupFamily (FinalActor Label) where + mem := (finalAction Label).SupportedSubgroup + top := (finalAction Label).supported_top (finalBottom Label) + upward := (finalAction Label).supported_upward + inf := (finalAction Label).supported_inf (by + intro C D + rcases final_countable_upper_bound Label {C, D} ((Set.countable_singleton D).insert C) with + ⟨E, bound⟩ + exact ⟨E, bound C (Set.mem_insert _ _), + bound D (Set.mem_insert_of_mem _ (Set.mem_singleton D))⟩) + conjugate := (finalAction Label).supported_conjugate + +theorem supportFamily_countably_complete {I : Type v} [Countable I] + (K : I → Subgroup (FinalActor Label)) (supported : ∀ i, (supportFamily Label).mem (K i)) : + (supportFamily Label).mem (⨅ i, K i) := by + classical + change ∀ i, ∃ C, (finalAction Label).fixSubgroup C ≤ K i at supported + choose C lower using supported + rcases final_countable_upper_bound Label (Set.range C) (Set.countable_range C) with ⟨D, bound⟩ + refine ⟨D, le_iInf (fun i => ?_)⟩ + exact le_trans ((finalAction Label).fix_antitone (bound (C i) (Set.mem_range_self i))) (lower i) + +end MainStage.OrdinalRun + +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Forcing.Rows + +open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns +open Compression.RecursiveMaps.MainStage.OrdinalRun CountableCondition + +theorem action_bottom (g : FinalActor Column) : + ((finalAction Column).iso g).toFun (finalBottom Column) = finalBottom Column := by + apply (finalOrder Column).antisymm + · have lower := (((finalAction Column).iso g).le_iff _ _).2 + (finalBottom_least Column (((finalAction Column).iso g⁻¹).toFun (finalBottom Column))) + rw [(finalAction Column).act_inv_right] at lower + exact lower + · exact finalBottom_least Column _ + +noncomputable def positionAction (g : FinalActor Column) (i : Position) : Position := + ⟨((finalAction Column).iso g).toFun i.val, by + intro eq + apply i.property + exact Compression.embedding_injective ((finalAction Column).iso g).toMeetEmbedding + (eq.trans (action_bottom g).symm)⟩ + +theorem positionAction_one (i : Position) : positionAction 1 i = i := + Subtype.ext ((finalAction Column).one i.val) + +theorem positionAction_mul (g h : FinalActor Column) (i : Position) : + positionAction (g * h) i = positionAction g (positionAction h i) := + Subtype.ext ((finalAction Column).mul g h i.val) + +noncomputable def positionPermutation (g : FinalActor Column) : Position ≃ Position where + toFun := positionAction g + invFun := positionAction g⁻¹ + left_inv i := Subtype.ext ((finalAction Column).act_inv_left g i.val) + right_inv i := Subtype.ext ((finalAction Column).act_inv_right g i.val) + +noncomputable def coordinatePermutation (g : FinalActor Column) : Position × Column ≃ Position × Column := + Equiv.prodCongr (positionPermutation g) (Equiv.refl Column) + +theorem coordinatePermutation_one : coordinatePermutation 1 = Equiv.refl (Position × Column) := by + apply Equiv.ext + intro x + exact Prod.ext (positionAction_one x.1) rfl + +theorem coordinatePermutation_mul (g h : FinalActor Column) : + coordinatePermutation (g * h) = (coordinatePermutation h).trans (coordinatePermutation g) := by + apply Equiv.ext + intro x + exact Prod.ext (positionAction_mul g h x.1) rfl + +noncomputable def rowAction (g : FinalActor Column) : RowForcing ≃o RowForcing := + renameOrderIso (coordinatePermutation g) + +theorem rowAction_one (p : RowForcing) : rowAction 1 p = p := by + change rename (coordinatePermutation 1) p = p + rw [coordinatePermutation_one, rename_refl] + +theorem rowAction_mul (g h : FinalActor Column) (p : RowForcing) : + rowAction (g * h) p = rowAction g (rowAction h p) := by + change rename (coordinatePermutation (g * h)) p = + rename (coordinatePermutation g) (rename (coordinatePermutation h) p) + rw [coordinatePermutation_mul, rename_trans] + +theorem rowAction_value (g : FinalActor Column) (p : RowForcing) (i : Position) (α : Column) : + (rowAction g p).value (positionAction g i, α) = p.value (i, α) := + rename_value (coordinatePermutation g) p (i, α) + +theorem rowAction_top (g : FinalActor Column) : rowAction g ⊤ = ⊤ := + rename_top (coordinatePermutation g) + +theorem rowAction_le_iff (g : FinalActor Column) (p q : RowForcing) : + rowAction g p ≤ rowAction g q ↔ p ≤ q := + rename_le_iff (coordinatePermutation g) p q + +theorem rowCondition_supported (p : RowForcing) : + ∃ C : FinalPoint Column, ∀ g : FinalActor Column, + g ∈ (finalAction Column).fixSubgroup C → rowAction g p = p := by + let positions : Set (FinalPoint Column) := (fun c : Position × Column => c.1.val) '' p.domain + have small : positions.Countable := p.countable_domain.image (fun c => c.1.val) + rcases final_countable_upper_bound Column positions small with ⟨C, bound⟩ + refine ⟨C, ?_⟩ + intro g fixed + apply rename_fixed + intro c hc + apply Prod.ext + · apply Subtype.ext + exact fixed c.1.val (bound c.1.val ⟨c, hc, rfl⟩) + · rfl + +end PartitionPilot.Forcing.Rows + + + +namespace PartitionPilot.Forcing.Rows + +open Cardinal Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns +open Compression.RecursiveMaps.MainStage.OrdinalRun SetRealization +open scoped Cardinal + +noncomputable def rowConditionPresentation : Presentation RowForcing := Presentation.canonical RowForcing + +theorem rowConditionPresentation_rank_lt (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : + ZFSet.rank rowConditionPresentation.carrier < κ.ord := + Presentation.canonical_rank_lt _ κ (rowForcing_cardinal_lt κ inaccessible) + +structure InitialRowForcingLaws (κ : Cardinal.{1}) : Prop where + closed : CountablyClosed RowForcing + small : #RowForcing < κ + rank : ZFSet.rank rowConditionPresentation.carrier < κ.ord + coordinate_dense : ∀ c : Position × Column, Dense (CountableCondition.definedAt (A := Bool) c) + different_dense : ∀ i j : Position, i ≠ j → Dense (differentRows i j) + countable_decisions : ∀ (A : Nat → Type 1) (d : DecisionSystem RowForcing A), Dense d.commonDecisions + action_one : ∀ p, rowAction 1 p = p + action_mul : ∀ g h p, rowAction (g * h) p = rowAction g (rowAction h p) + action_value : ∀ g p i α, (rowAction g p).value (positionAction g i, α) = p.value (i, α) + condition_support : ∀ p, ∃ C : FinalPoint Column, ∀ g : FinalActor Column, + g ∈ (finalAction Column).fixSubgroup C → rowAction g p = p + generic_rows : ∀ F : ConditionFilter RowForcing, F.GenericFor (denseFamily Position) → + ∃ rows : Position → Set Column, Function.Injective rows ∧ + ∀ i α, α ∈ rows i ↔ ∃ p, F.mem p ∧ p.value (i, α) = some true + +theorem initial_row_forcing_laws (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : + InitialRowForcingLaws κ where + closed := rowForcing_countablyClosed + small := rowForcing_cardinal_lt κ inaccessible + rank := rowConditionPresentation_rank_lt κ inaccessible + coordinate_dense := CountableCondition.definedAt_dense + different_dense := differentRows_dense + countable_decisions := fun _ d => d.commonDecisions_dense rowForcing_countablyClosed + action_one := rowAction_one + action_mul := rowAction_mul + action_value := rowAction_value + condition_support := rowCondition_supported + generic_rows := actual_generic_rows + +end PartitionPilot.Forcing.Rows + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/LimitAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/LimitAction.lean index 83e407927329193c3b2b5b8b1a862e70e8b2c454..c2bf1f45945d7bae9bd0ff19133884471ce638fb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/LimitAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/LimitAction.lean @@ -1,85 +1,85 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.LimitGroup - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps -open CosetGeometry -universe u - -structure ActionSystem {I : Type u} [LinearOrder I] (g : GroupSystem I) (p : MeetSystem I) where - action : ∀ i, OrderAction (g.system.Point i) (p.order i) - compatible : ∀ {i j} (h : i ≤ j) s x, - p.system.map h (((action i).iso s).toFun x) = - ((action j).iso (g.system.map h s)).toFun (p.system.map h x) - -namespace ActionSystem -variable {I : Type u} [LinearOrder I] {g : GroupSystem I} {p : MeetSystem I} - (a : ActionSystem g p) - -def act : g.system.Union → p.system.Union → p.system.Union := - g.system.binary p.system p.system (fun i s x => ((a.action i).iso s).toFun x) a.compatible - -theorem act_point (i : I) (s : g.system.Point i) (x : p.system.Point i) : - a.act (g.system.point i s) (p.system.point i x) = - p.system.point i (((a.action i).iso s).toFun x) := - g.system.binary_point p.system p.system (fun i s x => ((a.action i).iso s).toFun x) - a.compatible i s x - -variable [Nonempty I] - -theorem act_one (x : p.system.Union) : a.act 1 x = x := by - rcases p.system.cover x with ⟨i, x, rfl⟩ - change a.act g.one _ = _ - rw [g.one_point i, a.act_point, (a.action i).one] - -theorem act_mul (s t : g.system.Union) (x : p.system.Union) : - a.act (s * t) x = a.act s (a.act t x) := by - rcases g.system.triple_cover g.system p.system s t x with ⟨i, s, t, x, rfl, rfl, rfl⟩ - change a.act (g.mul _ _) _ = _ - rw [g.mul_point, a.act_point, a.act_point, a.act_point, (a.action i).mul] - -theorem act_left_inverse (s : g.system.Union) (x : p.system.Union) : - a.act s⁻¹ (a.act s x) = x := by - rw [← a.act_mul, inv_mul_cancel, a.act_one] - -theorem act_right_inverse (s : g.system.Union) (x : p.system.Union) : - a.act s (a.act s⁻¹ x) = x := by - rw [← a.act_mul, mul_inv_cancel, a.act_one] - -omit [Nonempty I] in -theorem act_le_iff (s : g.system.Union) (x y : p.system.Union) : - p.unionOrder.le (a.act s x) (a.act s y) ↔ p.unionOrder.le x y := by - rcases g.system.triple_cover p.system p.system s x y with ⟨i, s, x, y, rfl, rfl, rfl⟩ - change p.Le _ _ ↔ p.Le _ _ - rw [a.act_point, a.act_point, p.le_stage, p.le_stage, (a.action i).iso s |>.le_iff] - -noncomputable def unionIso (s : g.system.Union) : MeetIso p.unionOrder p.unionOrder := - isoOfOrder (a.act s) (a.act s⁻¹) (a.act_left_inverse s) (a.act_right_inverse s) (a.act_le_iff s) - -noncomputable def unionAction : OrderAction g.system.Union p.unionOrder where - iso := a.unionIso - one := a.act_one - mul := a.act_mul - -theorem unionAction_stage (i : I) (s : g.system.Point i) (x : p.system.Point i) : - (a.unionAction.iso ((g.inclusion i) s)).toFun ((p.inclusion i).toFun x) = - (p.inclusion i).toFun (((a.action i).iso s).toFun x) := a.act_point i s x - -noncomputable def topAction : OrderAction g.system.Union p.boundedOrder := - FixedTop.action p.unionOrder a.unionAction - -theorem topAction_stage (i : I) (s : g.system.Point i) (x : p.system.Point i) : - (a.topAction.iso ((g.inclusion i) s)).toFun ((p.boundedInclusion i).toFun x) = - (p.boundedInclusion i).toFun (((a.action i).iso s).toFun x) := - congrArg some (a.act_point i s x) - -theorem top_fixed (s : g.system.Union) : (a.topAction.iso s).toFun none = none := rfl - -end ActionSystem -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.LimitGroup + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps +open CosetGeometry +universe u + +structure ActionSystem {I : Type u} [LinearOrder I] (g : GroupSystem I) (p : MeetSystem I) where + action : ∀ i, OrderAction (g.system.Point i) (p.order i) + compatible : ∀ {i j} (h : i ≤ j) s x, + p.system.map h (((action i).iso s).toFun x) = + ((action j).iso (g.system.map h s)).toFun (p.system.map h x) + +namespace ActionSystem +variable {I : Type u} [LinearOrder I] {g : GroupSystem I} {p : MeetSystem I} + (a : ActionSystem g p) + +def act : g.system.Union → p.system.Union → p.system.Union := + g.system.binary p.system p.system (fun i s x => ((a.action i).iso s).toFun x) a.compatible + +theorem act_point (i : I) (s : g.system.Point i) (x : p.system.Point i) : + a.act (g.system.point i s) (p.system.point i x) = + p.system.point i (((a.action i).iso s).toFun x) := + g.system.binary_point p.system p.system (fun i s x => ((a.action i).iso s).toFun x) + a.compatible i s x + +variable [Nonempty I] + +theorem act_one (x : p.system.Union) : a.act 1 x = x := by + rcases p.system.cover x with ⟨i, x, rfl⟩ + change a.act g.one _ = _ + rw [g.one_point i, a.act_point, (a.action i).one] + +theorem act_mul (s t : g.system.Union) (x : p.system.Union) : + a.act (s * t) x = a.act s (a.act t x) := by + rcases g.system.triple_cover g.system p.system s t x with ⟨i, s, t, x, rfl, rfl, rfl⟩ + change a.act (g.mul _ _) _ = _ + rw [g.mul_point, a.act_point, a.act_point, a.act_point, (a.action i).mul] + +theorem act_left_inverse (s : g.system.Union) (x : p.system.Union) : + a.act s⁻¹ (a.act s x) = x := by + rw [← a.act_mul, inv_mul_cancel, a.act_one] + +theorem act_right_inverse (s : g.system.Union) (x : p.system.Union) : + a.act s (a.act s⁻¹ x) = x := by + rw [← a.act_mul, mul_inv_cancel, a.act_one] + +omit [Nonempty I] in +theorem act_le_iff (s : g.system.Union) (x y : p.system.Union) : + p.unionOrder.le (a.act s x) (a.act s y) ↔ p.unionOrder.le x y := by + rcases g.system.triple_cover p.system p.system s x y with ⟨i, s, x, y, rfl, rfl, rfl⟩ + change p.Le _ _ ↔ p.Le _ _ + rw [a.act_point, a.act_point, p.le_stage, p.le_stage, (a.action i).iso s |>.le_iff] + +noncomputable def unionIso (s : g.system.Union) : MeetIso p.unionOrder p.unionOrder := + isoOfOrder (a.act s) (a.act s⁻¹) (a.act_left_inverse s) (a.act_right_inverse s) (a.act_le_iff s) + +noncomputable def unionAction : OrderAction g.system.Union p.unionOrder where + iso := a.unionIso + one := a.act_one + mul := a.act_mul + +theorem unionAction_stage (i : I) (s : g.system.Point i) (x : p.system.Point i) : + (a.unionAction.iso ((g.inclusion i) s)).toFun ((p.inclusion i).toFun x) = + (p.inclusion i).toFun (((a.action i).iso s).toFun x) := a.act_point i s x + +noncomputable def topAction : OrderAction g.system.Union p.boundedOrder := + FixedTop.action p.unionOrder a.unionAction + +theorem topAction_stage (i : I) (s : g.system.Point i) (x : p.system.Point i) : + (a.topAction.iso ((g.inclusion i) s)).toFun ((p.boundedInclusion i).toFun x) = + (p.boundedInclusion i).toFun (((a.action i).iso s).toFun x) := + congrArg some (a.act_point i s x) + +theorem top_fixed (s : g.system.Union) : (a.topAction.iso s).toFun none = none := rfl + +end ActionSystem +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalStepCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalStepCodes.lean index 8123883fe27a989bd4adf5a99b9d758916115e60..9290ff264355a3acf753907b10269b98efda19c0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalStepCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalStepCodes.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixSelectedStepTotality - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -def MainPrefixConditionalStepCode (M : TransitiveGround.{u}) - (K Labels C D rD N f old next : ZFSet.{u}) : Prop := - MainPrefixSelectedStepCode f old next ∨ - ∃ T S E, old = mainPrefixCode T S E ∧ NonzeroLimitOrdinalCode T ∧ - MainPrefixLimitStepCode M K Labels C D rD N old next - -namespace MainPrefixConditionalStepCode -variable {M : TransitiveGround.{u}} {K Labels C D rD N f old next : ZFSet.{u}} -variable (code : MainPrefixConditionalStepCode M K Labels C D rD N f old next) -include code - -theorem extension : MainPrefixExtends old next := by - rcases code with selected | ⟨_, _, _, _, _, limit⟩ - · obtain ⟨_, _, _, _, _, _, _, _, _, _, extension, _⟩ := selected - exact extension - · exact limit.extension - -theorem next_fields {T S E : ZFSet.{u}} (oldCode : old = mainPrefixCode T S E) : - ∃ S' E', next = mainPrefixCode (insert T T) S' E' := by - rcases code with selected | ⟨_, _, _, _, _, limit⟩ - · obtain ⟨b, F, G, F', G', _, _, _, first, second, _⟩ := selected - have index := (mainPrefixCode_inj.1 (oldCode.symm.trans first)).1 - exact ⟨F', G', by simpa only [index] using second⟩ - · obtain ⟨_, _, _, T', S', E', _, nextCode, _⟩ := limit.extension - exact ⟨S', E', by simpa only [limit.indices_successor oldCode nextCode] using nextCode⟩ - -theorem selected_of_successor {b S E : ZFSet.{u}} - (oldCode : old = mainPrefixCode (insert b b) S E) : - MainPrefixSelectedStepCode f old next := by - rcases code with selected | ⟨T, F, G, first, limit, _⟩ - · exact selected - · have index := (mainPrefixCode_inj.1 (oldCode.symm.trans first)).1 - exact False.elim (not_nonzeroLimitOrdinalCode_successor b (index.symm ▸ limit)) - -theorem limit_of_nonzeroLimit {T S E : ZFSet.{u}} - (oldCode : old = mainPrefixCode T S E) (nonzero : NonzeroLimitOrdinalCode T) : - MainPrefixLimitStepCode M K Labels C D rD N old next := by - rcases code with selected | ⟨_, _, _, _, _, limit⟩ - · obtain ⟨b, F, G, _, _, _, _, _, first, _⟩ := selected - have index := (mainPrefixCode_inj.1 (oldCode.symm.trans first)).1 - exact False.elim (not_nonzeroLimitOrdinalCode_successor b (index ▸ nonzero)) - · exact limit - -end MainPrefixConditionalStepCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixSelectedStepTotality + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +def MainPrefixConditionalStepCode (M : TransitiveGround.{u}) + (K Labels C D rD N f old next : ZFSet.{u}) : Prop := + MainPrefixSelectedStepCode f old next ∨ + ∃ T S E, old = mainPrefixCode T S E ∧ NonzeroLimitOrdinalCode T ∧ + MainPrefixLimitStepCode M K Labels C D rD N old next + +namespace MainPrefixConditionalStepCode +variable {M : TransitiveGround.{u}} {K Labels C D rD N f old next : ZFSet.{u}} +variable (code : MainPrefixConditionalStepCode M K Labels C D rD N f old next) +include code + +theorem extension : MainPrefixExtends old next := by + rcases code with selected | ⟨_, _, _, _, _, limit⟩ + · obtain ⟨_, _, _, _, _, _, _, _, _, _, extension, _⟩ := selected + exact extension + · exact limit.extension + +theorem next_fields {T S E : ZFSet.{u}} (oldCode : old = mainPrefixCode T S E) : + ∃ S' E', next = mainPrefixCode (insert T T) S' E' := by + rcases code with selected | ⟨_, _, _, _, _, limit⟩ + · obtain ⟨b, F, G, F', G', _, _, _, first, second, _⟩ := selected + have index := (mainPrefixCode_inj.1 (oldCode.symm.trans first)).1 + exact ⟨F', G', by simpa only [index] using second⟩ + · obtain ⟨_, _, _, T', S', E', _, nextCode, _⟩ := limit.extension + exact ⟨S', E', by simpa only [limit.indices_successor oldCode nextCode] using nextCode⟩ + +theorem selected_of_successor {b S E : ZFSet.{u}} + (oldCode : old = mainPrefixCode (insert b b) S E) : + MainPrefixSelectedStepCode f old next := by + rcases code with selected | ⟨T, F, G, first, limit, _⟩ + · exact selected + · have index := (mainPrefixCode_inj.1 (oldCode.symm.trans first)).1 + exact False.elim (not_nonzeroLimitOrdinalCode_successor b (index.symm ▸ limit)) + +theorem limit_of_nonzeroLimit {T S E : ZFSet.{u}} + (oldCode : old = mainPrefixCode T S E) (nonzero : NonzeroLimitOrdinalCode T) : + MainPrefixLimitStepCode M K Labels C D rD N old next := by + rcases code with selected | ⟨_, _, _, _, _, limit⟩ + · obtain ⟨b, F, G, _, _, _, _, _, first, _⟩ := selected + have index := (mainPrefixCode_inj.1 (oldCode.symm.trans first)).1 + exact False.elim (not_nonzeroLimitOrdinalCode_successor b (index ▸ nonzero)) + · exact limit + +end MainPrefixConditionalStepCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalTraceLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalTraceLaws.lean index 0cb212268930b83a5ee2feeeeb32c66faa669cd0..fbfae52de7fbee97c5538d74ebb3ab83f6ade50c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalTraceLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MainPrefixConditionalTraceLaws.lean @@ -1,48 +1,48 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainPrefixSelectedTraceLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.OrdinalRecursionTrace -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD N f B seed g A p : ZFSet.{u}} -variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) -variable (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD N f old next) -include trace chosen - -theorem mainPrefix_selected_successor (ordinal : ordinalSetProperty A) - {β old next : ZFSet.{u}} (member : insert β β ∈ A) - (oldEntry : ZFSet.pair β old ∈ p) (nextEntry : ZFSet.pair (insert β β) next ∈ p) : - MainPrefixSelectedStepCode f old next := by - have entry := trace.mainPrefix_successor_entry ordinal member oldEntry nextEntry - obtain ⟨S, E, oldCode⟩ := (trace.mainPrefix_values oldEntry).2 - exact (chosen old next entry).selected_of_successor oldCode - -theorem mainPrefix_selected_limit (ordinal : ordinalSetProperty A) - (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) - {α next : ZFSet.{u}} (member : α ∈ A) (limit : NonzeroLimitOrdinalCode α) - (nextEntry : ZFSet.pair α next ∈ p) : - ∃ input, MainPrefixHistoryUnionCode (graphRestriction α p) input ∧ - MainPrefixAtIndex α input ∧ ZFSet.pair input next ∈ g ∧ - MainPrefixLimitStepCode M K Labels C D rD N input next := by - have ordinalIndex := ordinalSetProperty_member ordinal member - have earlier := trace.restrict ordinalIndex (fun x hx => ordinal.1 α member x hx) - have history := earlier.preservedMainPrefixHistory candidates - obtain ⟨input, union, entry⟩ := (trace.2 α member next nextEntry).selected_of_nonzero limit.1 - have equal := union.unique history.union_code - have atIndex : MainPrefixAtIndex α input := by - rw [equal] - refine ⟨history.graphFamily.stageUnion, history.graphFamily.transitionUnion, ?_⟩ - change mainPrefixCode history.graphFamily.indexUnion _ _ = _ - rw [history.graphFamily_indexUnion ordinalIndex] - obtain ⟨S, E, inputCode⟩ := atIndex - exact ⟨input, union, ⟨S, E, inputCode⟩, entry, - (chosen input next entry).limit_of_nonzeroLimit inputCode limit⟩ - -end PartitionPilot.Forcing.OrdinalRecursionTrace - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainPrefixSelectedTraceLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.OrdinalRecursionTrace +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD N f B seed g A p : ZFSet.{u}} +variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) +variable (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD N f old next) +include trace chosen + +theorem mainPrefix_selected_successor (ordinal : ordinalSetProperty A) + {β old next : ZFSet.{u}} (member : insert β β ∈ A) + (oldEntry : ZFSet.pair β old ∈ p) (nextEntry : ZFSet.pair (insert β β) next ∈ p) : + MainPrefixSelectedStepCode f old next := by + have entry := trace.mainPrefix_successor_entry ordinal member oldEntry nextEntry + obtain ⟨S, E, oldCode⟩ := (trace.mainPrefix_values oldEntry).2 + exact (chosen old next entry).selected_of_successor oldCode + +theorem mainPrefix_selected_limit (ordinal : ordinalSetProperty A) + (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) + {α next : ZFSet.{u}} (member : α ∈ A) (limit : NonzeroLimitOrdinalCode α) + (nextEntry : ZFSet.pair α next ∈ p) : + ∃ input, MainPrefixHistoryUnionCode (graphRestriction α p) input ∧ + MainPrefixAtIndex α input ∧ ZFSet.pair input next ∈ g ∧ + MainPrefixLimitStepCode M K Labels C D rD N input next := by + have ordinalIndex := ordinalSetProperty_member ordinal member + have earlier := trace.restrict ordinalIndex (fun x hx => ordinal.1 α member x hx) + have history := earlier.preservedMainPrefixHistory candidates + obtain ⟨input, union, entry⟩ := (trace.2 α member next nextEntry).selected_of_nonzero limit.1 + have equal := union.unique history.union_code + have atIndex : MainPrefixAtIndex α input := by + rw [equal] + refine ⟨history.graphFamily.stageUnion, history.graphFamily.transitionUnion, ?_⟩ + change mainPrefixCode history.graphFamily.indexUnion _ _ = _ + rw [history.graphFamily_indexUnion ordinalIndex] + obtain ⟨S, E, inputCode⟩ := atIndex + exact ⟨input, union, ⟨S, E, inputCode⟩, entry, + (chosen input next entry).limit_of_nonzeroLimit inputCode limit⟩ + +end PartitionPilot.Forcing.OrdinalRecursionTrace + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MeetOrderPosetActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MeetOrderPosetActions.lean index 5db7f98836ea30ad5313aae03d6f7d9c16ebb2e0..bb0cd08891ca3565995c9510aab08579c0948843 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MeetOrderPosetActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/MeetOrderPosetActions.lean @@ -1,73 +1,73 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports - -namespace OAI - -section - -namespace PartitionPilot.MeetOrder - -universe u - -@[instance_reducible] -def toPartialOrder {I : Type u} (P : MeetOrder I) : PartialOrder I where - le := P.le - le_refl := P.refl - le_trans _ _ _ := P.trans - le_antisymm _ _ := P.antisymm - -end PartitionPilot.MeetOrder - -namespace PartitionPilot.Compression.MeetIso - -universe u v - -def toOrderIso {I : Type u} {J : Type v} {P : MeetOrder I} {Q : MeetOrder J} (f : MeetIso P Q) : - letI := P.toPartialOrder - letI := Q.toPartialOrder - I ≃o J := by - letI := P.toPartialOrder - letI := Q.toPartialOrder - exact { - toFun := f.toFun - invFun := f.inverse - left_inv := f.left_inverse - right_inv := f.right_inverse - map_rel_iff' := f.le_iff _ _ } - -end PartitionPilot.Compression.MeetIso - -namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction - -open SetRealization -universe u -variable {I G : Type u} [Group G] {P : MeetOrder I} (a : OrderAction G P) - -def toPosetAction : - letI := P.toPartialOrder - Forcing.PosetAction G I := by - letI := P.toPartialOrder - exact { iso := fun g => (a.iso g).toOrderIso, one := a.one, mul := a.mul } - -theorem principalFix_eq (C : I) : - letI := P.toPartialOrder - a.toPosetAction.principalFix C = a.fixSubgroup C := rfl - -theorem actionGraph_eq (s : GeometryPresentation I G) : - letI := P.toPartialOrder - a.toPosetAction.actionGraph s.points s.actors = s.actionGraph P a := rfl - -end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction - -namespace PartitionPilot.SetRealization.GeometryPresentation - -universe u - -theorem conditionOrder_eq {I G : Type u} (s : GeometryPresentation I G) (P : MeetOrder I) : - letI := P.toPartialOrder - s.points.conditionOrder = s.orderRelation P := rfl - -end PartitionPilot.SetRealization.GeometryPresentation - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports + +namespace OAI + +section + +namespace PartitionPilot.MeetOrder + +universe u + +@[instance_reducible] +def toPartialOrder {I : Type u} (P : MeetOrder I) : PartialOrder I where + le := P.le + le_refl := P.refl + le_trans _ _ _ := P.trans + le_antisymm _ _ := P.antisymm + +end PartitionPilot.MeetOrder + +namespace PartitionPilot.Compression.MeetIso + +universe u v + +def toOrderIso {I : Type u} {J : Type v} {P : MeetOrder I} {Q : MeetOrder J} (f : MeetIso P Q) : + letI := P.toPartialOrder + letI := Q.toPartialOrder + I ≃o J := by + letI := P.toPartialOrder + letI := Q.toPartialOrder + exact { + toFun := f.toFun + invFun := f.inverse + left_inv := f.left_inverse + right_inv := f.right_inverse + map_rel_iff' := f.le_iff _ _ } + +end PartitionPilot.Compression.MeetIso + +namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction + +open SetRealization +universe u +variable {I G : Type u} [Group G] {P : MeetOrder I} (a : OrderAction G P) + +def toPosetAction : + letI := P.toPartialOrder + Forcing.PosetAction G I := by + letI := P.toPartialOrder + exact { iso := fun g => (a.iso g).toOrderIso, one := a.one, mul := a.mul } + +theorem principalFix_eq (C : I) : + letI := P.toPartialOrder + a.toPosetAction.principalFix C = a.fixSubgroup C := rfl + +theorem actionGraph_eq (s : GeometryPresentation I G) : + letI := P.toPartialOrder + a.toPosetAction.actionGraph s.points s.actors = s.actionGraph P a := rfl + +end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.OrderAction + +namespace PartitionPilot.SetRealization.GeometryPresentation + +universe u + +theorem conditionOrder_eq {I G : Type u} (s : GeometryPresentation I G) (P : MeetOrder I) : + letI := P.toPartialOrder + s.points.conditionOrder = s.orderRelation P := rfl + +end PartitionPilot.SetRealization.GeometryPresentation + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameFamilySetTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameFamilySetTransport.lean index c9bf3a925fdc09a9730ba5dde0d8c9ad76716334..d93bddc6d963e24faa86c678f390d8aa186cd357 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameFamilySetTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameFamilySetTransport.lean @@ -1,66 +1,66 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} -variable {G : Type v} [Group G] (a : PosetAction G P) - -theorem act_familySet_transport (T U : ZFSet.{u}) - (validT : ∀ z ∈ T, IsName s z) (validU : ∀ z ∈ U, IsName s z) - (g : G) (transport : ∀ τ : Name s, (a.act s g τ).val ∈ U ↔ τ.val ∈ T) : - a.act s g (familySet ⊤ T validT) = familySet ⊤ U validU := by - apply Name.ext - intro σ p - change Entry σ (rename s (a.iso g) (familySet ⊤ T validT)) p ↔ _ - rw [entry_rename, entry_familySet] - constructor - · rintro ⟨τ, q, entry, equal, hp⟩ - obtain ⟨hτ, rfl⟩ := (entry_familySet ⊤ T validT τ q).1 entry - have target := (transport τ).2 hτ - change a.act s g τ = σ at equal - exact ⟨equal ▸ target, hp.symm.trans (a.iso g).map_top⟩ - · rintro ⟨hσ, rfl⟩ - have back : (a.act s g⁻¹ σ).val ∈ T := (transport _).1 (by - simpa only [a.act_inv_right] using hσ) - exact ⟨a.act s g⁻¹ σ, ⊤, - (entry_familySet ⊤ T validT _ ⊤).2 ⟨back, rfl⟩, - a.act_inv_right s g σ, (a.iso g).map_top⟩ - -theorem familySet_support (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (K : Subgroup G) (supported : ∀ τ : Name s, τ.val ∈ T → K ≤ a.stabilizer s τ) : - K ≤ a.stabilizer s (familySet ⊤ T valid) := by - intro g hg - apply Name.ext - intro σ p - change Entry σ (rename s (a.iso g) (familySet ⊤ T valid)) p ↔ _ - rw [entry_rename, entry_familySet] - constructor - · rintro ⟨τ, q, entry, equal, hp⟩ - obtain ⟨hτ, rfl⟩ := (entry_familySet ⊤ T valid τ q).1 entry - have fixed := supported τ hτ hg - change a.act s g τ = σ at equal - rw [fixed] at equal - exact ⟨equal ▸ hτ, hp.symm.trans (a.iso g).map_top⟩ - · rintro ⟨hσ, rfl⟩ - exact ⟨σ, ⊤, (entry_familySet ⊤ T valid σ ⊤).2 ⟨hσ, rfl⟩, - supported σ hσ hg, (a.iso g).map_top⟩ - -theorem familySet_hs_of_supported (F : NormalSubgroupFamily G) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (K : Subgroup G) (member : F.mem K) - (supported : ∀ τ : Name s, τ.val ∈ T → K ≤ a.stabilizer s τ) - (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (familySet ⊤ T valid) := - HereditarilySymmetric.mk (F.upward member (familySet_support a T valid K supported)) - (fun τ p entry => children τ ((entry_familySet ⊤ T valid τ p).1 entry).1) - -end PartitionPilot.Forcing.Name - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} +variable {G : Type v} [Group G] (a : PosetAction G P) + +theorem act_familySet_transport (T U : ZFSet.{u}) + (validT : ∀ z ∈ T, IsName s z) (validU : ∀ z ∈ U, IsName s z) + (g : G) (transport : ∀ τ : Name s, (a.act s g τ).val ∈ U ↔ τ.val ∈ T) : + a.act s g (familySet ⊤ T validT) = familySet ⊤ U validU := by + apply Name.ext + intro σ p + change Entry σ (rename s (a.iso g) (familySet ⊤ T validT)) p ↔ _ + rw [entry_rename, entry_familySet] + constructor + · rintro ⟨τ, q, entry, equal, hp⟩ + obtain ⟨hτ, rfl⟩ := (entry_familySet ⊤ T validT τ q).1 entry + have target := (transport τ).2 hτ + change a.act s g τ = σ at equal + exact ⟨equal ▸ target, hp.symm.trans (a.iso g).map_top⟩ + · rintro ⟨hσ, rfl⟩ + have back : (a.act s g⁻¹ σ).val ∈ T := (transport _).1 (by + simpa only [a.act_inv_right] using hσ) + exact ⟨a.act s g⁻¹ σ, ⊤, + (entry_familySet ⊤ T validT _ ⊤).2 ⟨back, rfl⟩, + a.act_inv_right s g σ, (a.iso g).map_top⟩ + +theorem familySet_support (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (K : Subgroup G) (supported : ∀ τ : Name s, τ.val ∈ T → K ≤ a.stabilizer s τ) : + K ≤ a.stabilizer s (familySet ⊤ T valid) := by + intro g hg + apply Name.ext + intro σ p + change Entry σ (rename s (a.iso g) (familySet ⊤ T valid)) p ↔ _ + rw [entry_rename, entry_familySet] + constructor + · rintro ⟨τ, q, entry, equal, hp⟩ + obtain ⟨hτ, rfl⟩ := (entry_familySet ⊤ T valid τ q).1 entry + have fixed := supported τ hτ hg + change a.act s g τ = σ at equal + rw [fixed] at equal + exact ⟨equal ▸ hτ, hp.symm.trans (a.iso g).map_top⟩ + · rintro ⟨hσ, rfl⟩ + exact ⟨σ, ⊤, (entry_familySet ⊤ T valid σ ⊤).2 ⟨hσ, rfl⟩, + supported σ hσ hg, (a.iso g).map_top⟩ + +theorem familySet_hs_of_supported (F : NormalSubgroupFamily G) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (K : Subgroup G) (member : F.mem K) + (supported : ∀ τ : Name s, τ.val ∈ T → K ≤ a.stabilizer s τ) + (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (familySet ⊤ T valid) := + HereditarilySymmetric.mk (F.upward member (familySet_support a T valid K supported)) + (fun τ p entry => children τ ((entry_familySet ⊤ T valid τ p).1 entry).1) + +end PartitionPilot.Forcing.Name + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameMixingRanks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameMixingRanks.lean index 970de2db0a66f99b766cca06f26a803163a7feb8..8f4d928b3e53e1e5485cb240d42d29fea90a7a70 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameMixingRanks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameMixingRanks.lean @@ -1,505 +1,505 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames - -namespace OAI - - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P Q : Type u} {s : Presentation P} - -noncomputable def nameRank (τ : Name s) : Ordinal.{u} := ZFSet.rank (eval Set.univ τ) - -theorem eval_univ (τ : Name s) : - eval Set.univ τ = ZFSet.range (fun a : Entries τ => eval Set.univ a.val.1) := by - apply ZFSet.ext - intro x - rw [mem_eval, ZFSet.mem_range] - constructor - · rintro ⟨σ, p, h, _, eq⟩ - exact ⟨⟨(σ, p), h⟩, eq⟩ - · rintro ⟨a, eq⟩ - exact ⟨a.val.1, a.val.2, a.property, Set.mem_univ _, eq⟩ - -theorem nameRank_eq (τ : Name s) : - nameRank τ = ⨆ a : Entries τ, Order.succ (nameRank a.val.1) := by - change ZFSet.rank (eval Set.univ τ) = _ - rw [eval_univ, ZFSet.rank_range] - rfl - -theorem entry_nameRank_lt {σ τ : Name s} {p : P} (h : Entry σ τ p) : - nameRank σ < nameRank τ := - ZFSet.rank_lt_of_mem ((mem_eval Set.univ τ _).2 ⟨σ, p, h, Set.mem_univ _, rfl⟩) - -theorem nameRank_rename (t : Presentation Q) (f : P → Q) (τ : Name s) : - nameRank (rename t f τ) = nameRank τ := by - unfold nameRank - rw [eval_rename] - rfl - -theorem rank_eval_le (H : Set P) (τ : Name s) : ZFSet.rank (eval H τ) ≤ nameRank τ := by - induction τ using inductionOn with - | step τ ih => - rw [ZFSet.rank_le_iff] - intro x hx - obtain ⟨σ, p, entry, _, rfl⟩ := (mem_eval H τ x).1 hx - exact (ih σ p entry).trans_lt (entry_nameRank_lt entry) - -theorem nameRank_check (one : P) (x : ZFSet.{u}) : nameRank (check s one x) = ZFSet.rank x := by - unfold nameRank - rw [eval_check Set.univ one (Set.mem_univ one)] - -end PartitionPilot.Forcing.Name - - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -noncomputable def selectName (R : Name s → P → Prop) (τ : Name s) : Name s := - assemble (fun z : {z : Entries τ × P // z.2 ≤ z.1.val.2 ∧ R z.1.val.1 z.2} => z.val.1.val.1) - (fun z => z.val.2) - -theorem entry_selectName (R : Name s → P → Prop) (τ σ : Name s) (p : P) : - Entry σ (selectName R τ) p ↔ ∃ r, Entry σ τ r ∧ p ≤ r ∧ R σ p := by - rw [selectName, entry_assemble] - constructor - · rintro ⟨z, rfl, rfl⟩ - exact ⟨z.val.1.val.2, z.val.1.property, z.property⟩ - · rintro ⟨r, entry, pr, hR⟩ - exact ⟨⟨(⟨(σ, r), entry⟩, p), pr, hR⟩, rfl, rfl⟩ - -theorem nameRank_selectName_le (R : Name s → P → Prop) (τ : Name s) : - nameRank (selectName R τ) ≤ nameRank τ := by - change ZFSet.rank (eval Set.univ (selectName R τ)) ≤ nameRank τ - rw [ZFSet.rank_le_iff] - intro x hx - obtain ⟨σ, p, entry, _, rfl⟩ := (mem_eval Set.univ (selectName R τ) x).1 hx - obtain ⟨r, old, _, _⟩ := (entry_selectName R τ σ p).1 entry - exact (rank_eval_le Set.univ σ).trans_lt (entry_nameRank_lt old) - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem act_selectName (g : G) (R R' : Name s → P → Prop) - (transport : ∀ σ p, R' (a.act s g σ) (a.iso g p) ↔ R σ p) (τ : Name s) : - a.act s g (Name.selectName R τ) = Name.selectName R' (a.act s g τ) := by - apply Name.ext - intro σ p - obtain ⟨σ, rfl⟩ := (a.nameEquiv s g).surjective σ - obtain ⟨p, rfl⟩ := (a.iso g).surjective p - change Name.Entry (a.act s g σ) (a.act s g (Name.selectName R τ)) (a.iso g p) ↔ - Name.Entry (a.act s g σ) (Name.selectName R' (a.act s g τ)) (a.iso g p) - rw [a.entry_act, Name.entry_selectName, Name.entry_selectName] - constructor - · rintro ⟨r, entry, pr, hR⟩ - exact ⟨a.iso g r, (a.entry_act s g σ τ r).2 entry, - (a.iso g).monotone pr, (transport σ p).2 hR⟩ - · rintro ⟨r, entry, pr, hR⟩ - obtain ⟨r, rfl⟩ := (a.iso g).surjective r - exact ⟨r, (a.entry_act s g σ τ r).1 entry, (a.iso g).le_iff_le.1 pr, (transport σ p).1 hR⟩ - -end PartitionPilot.Forcing.PosetAction - -end - - -namespace PartitionPilot.Forcing.Name - -open SetRealization SetFormula -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -def separationPredicate (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) - (env : Assignment D n) (σ : Name s) (p : P) : Prop := - ∃ h : σ ∈ D.names, Forces D φ (extend ⟨σ, h⟩ env) p - -noncomputable def separationName (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) - (env : Assignment D n) (τ : Name s) : Name s := selectName (separationPredicate D φ env) τ - -theorem entry_separationName (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) - (env : Assignment D n) (τ σ : Name s) (p : P) : - Entry σ (separationName D φ env τ) p ↔ - ∃ r, Entry σ τ r ∧ p ≤ r ∧ ∃ h : σ ∈ D.names, Forces D φ (extend ⟨σ, h⟩ env) p := by - rw [separationName, entry_selectName] - rfl - -theorem eval_separationName (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) {n : Nat} (φ : SetFormula (n + 1)) - (env : Assignment D n) {τ : Name s} (hτ : τ ∈ D.names) : - eval {p | H.mem p} (separationName D φ env τ) = - ZFSet.sep (fun x => Realize (D.values {p | H.mem p}) φ - (extend x (evalAssignment {p | H.mem p} env))) (eval {p | H.mem p} τ) := by - apply ZFSet.ext - intro x - rw [mem_eval, ZFSet.mem_sep] - constructor - · rintro ⟨σ, p, entry, hp, value⟩ - obtain ⟨r, old, pr, hσ, forced⟩ := (entry_separationName D φ env τ σ p).1 entry - have truth := forces_sound D H generic φ (extend ⟨σ, hσ⟩ env) hp forced - rw [evalAssignment_extend, value] at truth - exact ⟨(mem_eval _ τ x).2 ⟨σ, r, old, H.upward hp pr, value⟩, truth⟩ - · rintro ⟨member, truth⟩ - obtain ⟨σ, r, entry, hr, value⟩ := (mem_eval _ τ x).1 member - have hσ := D.children hτ entry - have instanceTruth : Realize (D.values {p | H.mem p}) φ - (evalAssignment {p | H.mem p} (extend ⟨σ, hσ⟩ env)) := by - rw [evalAssignment_extend, value] - exact truth - obtain ⟨q, hq, forced⟩ := (forcing_truth D H generic φ (extend ⟨σ, hσ⟩ env)).1 instanceTruth - obtain ⟨p, hp, pr, pq⟩ := H.directed hr hq - exact ⟨σ, p, (entry_separationName D φ env τ σ p).2 - ⟨r, entry, pr, hσ, forces_mono D φ (extend ⟨σ, hσ⟩ env) forced pq⟩, hp, value⟩ - -theorem nameRank_separationName_le (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) - (env : Assignment D n) (τ : Name s) : nameRank (separationName D φ env τ) ≤ nameRank τ := - nameRank_selectName_le (separationPredicate D φ env) τ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u v -variable {G : Type v} [Group G] [Small.{u} G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -def MixIndices (K : Subgroup G) (p : P) (τ : Name s) := - {z : K × Name.Entries τ × P // - z.2.2 ≤ a.iso z.1.val p ∧ z.2.2 ≤ a.iso z.1.val z.2.1.val.2} - -instance mixIndices_small (K : Subgroup G) (p : P) (τ : Name s) : - Small.{u} (a.MixIndices s K p τ) := by - unfold MixIndices - infer_instance - -noncomputable def mix (K : Subgroup G) (p : P) (τ : Name s) : Name s := - Name.assemble (fun z : a.MixIndices s K p τ => a.act s z.val.1.val z.val.2.1.val.1) - (fun z => z.val.2.2) - -theorem entry_mix (K : Subgroup G) (p : P) (τ σ : Name s) (q : P) : - Name.Entry σ (a.mix s K p τ) q ↔ - ∃ g ∈ K, ∃ ν r, Name.Entry ν τ r ∧ a.act s g ν = σ ∧ - q ≤ a.iso g p ∧ q ≤ a.iso g r := by - rw [mix, Name.entry_assemble] - constructor - · rintro ⟨z, eq, rfl⟩ - exact ⟨z.val.1.val, z.val.1.property, z.val.2.1.val.1, z.val.2.1.val.2, - z.val.2.1.property, eq, z.property⟩ - · rintro ⟨g, hg, ν, r, entry, eq, lower⟩ - exact ⟨⟨(⟨g, hg⟩, ⟨(ν, r), entry⟩, q), lower⟩, eq, rfl⟩ - -theorem mix_entry_translated (K : Subgroup G) (p : P) (τ : Name s) - {σ : Name s} {q : P} (entry : Name.Entry σ (a.mix s K p τ) q) - {h : G} (hh : h ∈ K) : - Name.Entry (a.act s h σ) (a.mix s K p τ) (a.iso h q) := by - obtain ⟨g, hg, ν, r, old, eq, qp, qr⟩ := (a.entry_mix s K p τ σ q).1 entry - apply (a.entry_mix s K p τ _ _).2 - refine ⟨h * g, K.mul_mem hh hg, ν, r, old, ?_, ?_, ?_⟩ - · rw [a.act_mul, eq] - · rw [a.mul] - exact (a.iso h).monotone qp - · rw [a.mul] - exact (a.iso h).monotone qr - -theorem mix_fixed (K : Subgroup G) (p : P) (τ : Name s) {g : G} (hg : g ∈ K) : - a.act s g (a.mix s K p τ) = a.mix s K p τ := by - apply Name.ext - intro σ q - change Name.Entry σ (Name.rename s (a.iso g) (a.mix s K p τ)) q ↔ _ - rw [Name.entry_rename] - constructor - · rintro ⟨ν, r, entry, eq, hr⟩ - change a.act s g ν = σ at eq - have h := a.mix_entry_translated s K p τ entry hg - simpa only [eq, hr] using h - · intro entry - have moved := a.mix_entry_translated s K p τ entry (K.inv_mem hg) - refine ⟨a.act s g⁻¹ σ, a.iso g⁻¹ q, moved, a.act_inv_right s g σ, ?_⟩ - rw [← a.mul, mul_inv_cancel, a.one] - -theorem mix_hs (F : NormalSubgroupFamily G) (K : Subgroup G) (hK : F.mem K) - (p : P) {τ : Name s} (hτ : HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (a.mix s K p τ) := by - refine HereditarilySymmetric.mk (F.upward hK ?_) ?_ - · intro g hg - exact a.mix_fixed s K p τ hg - · intro σ q entry - obtain ⟨g, _, ν, r, old, rfl, _, _⟩ := (a.entry_mix s K p τ σ q).1 entry - exact (hτ.member old).translated g - -theorem mem_eval_mix (K : Subgroup G) (p : P) (τ : Name s) - (H : ConditionFilter P) (x : ZFSet.{u}) : - x ∈ Name.eval {q | H.mem q} (a.mix s K p τ) ↔ - ∃ g ∈ K, H.mem (a.iso g p) ∧ x ∈ Name.eval {q | H.mem q} (a.act s g τ) := by - rw [Name.mem_eval] - constructor - · rintro ⟨σ, q, entry, hq, eq⟩ - obtain ⟨g, hg, ν, r, old, rfl, qp, qr⟩ := (a.entry_mix s K p τ σ q).1 entry - refine ⟨g, hg, H.upward hq qp, ?_⟩ - apply (Name.mem_eval {q | H.mem q} (a.act s g τ) x).2 - exact ⟨a.act s g ν, a.iso g r, (a.entry_act s g ν τ r).2 old, - H.upward hq qr, eq⟩ - · rintro ⟨g, hg, hp, hx⟩ - obtain ⟨σ, q, entry, hq, eq⟩ := (Name.mem_eval {q | H.mem q} (a.act s g τ) x).1 hx - change Name.Entry σ (Name.rename s (a.iso g) τ) q at entry - obtain ⟨ν, r, old, rfl, rfl⟩ := (Name.entry_rename s (a.iso g) τ σ q).1 entry - obtain ⟨c, hc, cp, cr⟩ := H.directed hp hq - exact ⟨a.act s g ν, c, - (a.entry_mix s K p τ _ c).2 ⟨g, hg, ν, r, old, rfl, cp, cr⟩, hc, eq⟩ - -theorem eval_mix_of_active_equal (K : Subgroup G) (p : P) (τ : Name s) - (H : ConditionFilter P) (hp : H.mem p) - (agree : ∀ g ∈ K, H.mem (a.iso g p) → - Name.eval {q | H.mem q} (a.act s g τ) = Name.eval {q | H.mem q} τ) : - Name.eval {q | H.mem q} (a.mix s K p τ) = Name.eval {q | H.mem q} τ := by - apply ZFSet.ext - intro x - rw [a.mem_eval_mix s] - constructor - · rintro ⟨g, hg, active, hx⟩ - rwa [agree g hg active] at hx - · intro hx - refine ⟨1, K.one_mem, ?_, ?_⟩ - · simpa only [a.one] using hp - · simpa only [a.act_one] using hx - -end PartitionPilot.Forcing.PosetAction - - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -def UnionIndices (τ : Name s) := - {z : (Σ e : Entries τ, Entries e.val.1) × P // - z.2 ≤ z.1.1.val.2 ∧ z.2 ≤ z.1.2.val.2} - -instance unionIndices_small (τ : Name s) : Small.{u} (UnionIndices τ) := by - unfold UnionIndices - infer_instance - -noncomputable def unionName (τ : Name s) : Name s := - assemble (fun z : UnionIndices τ => z.val.1.2.val.1) (fun z => z.val.2) - -theorem entry_unionName (τ σ : Name s) (p : P) : Entry σ (unionName τ) p ↔ - ∃ ν r q, Entry ν τ r ∧ Entry σ ν q ∧ p ≤ r ∧ p ≤ q := by - rw [unionName, entry_assemble] - constructor - · rintro ⟨z, rfl, rfl⟩ - exact ⟨z.val.1.1.val.1, z.val.1.1.val.2, z.val.1.2.val.2, - z.val.1.1.property, z.val.1.2.property, z.property⟩ - · rintro ⟨ν, r, q, topEntry, child, pr, pq⟩ - exact ⟨⟨(⟨⟨(ν, r), topEntry⟩, ⟨(σ, q), child⟩⟩, p), pr, pq⟩, rfl, rfl⟩ - -theorem eval_unionName (H : ConditionFilter P) (τ : Name s) : - eval {p | H.mem p} (unionName τ) = ZFSet.sUnion (eval {p | H.mem p} τ) := by - apply ZFSet.ext - intro x - rw [mem_eval, ZFSet.mem_sUnion] - constructor - · rintro ⟨σ, p, entry, hp, value⟩ - obtain ⟨ν, r, q, topEntry, child, pr, pq⟩ := (entry_unionName τ σ p).1 entry - exact ⟨eval {p | H.mem p} ν, - (mem_eval _ τ _).2 ⟨ν, r, topEntry, H.upward hp pr, rfl⟩, - (mem_eval _ ν x).2 ⟨σ, q, child, H.upward hp pq, value⟩⟩ - · rintro ⟨y, hy, hx⟩ - obtain ⟨ν, r, topEntry, hr, rfl⟩ := (mem_eval _ τ y).1 hy - obtain ⟨σ, q, child, hq, value⟩ := (mem_eval _ ν x).1 hx - obtain ⟨p, hp, pr, pq⟩ := H.directed hr hq - exact ⟨σ, p, (entry_unionName τ σ p).2 ⟨ν, r, q, topEntry, child, pr, pq⟩, hp, value⟩ - -theorem nameRank_unionName_le (τ : Name s) : nameRank (unionName τ) ≤ nameRank τ := by - change ZFSet.rank (eval Set.univ (unionName τ)) ≤ nameRank τ - rw [ZFSet.rank_le_iff] - intro x hx - obtain ⟨σ, p, entry, _, rfl⟩ := (mem_eval Set.univ (unionName τ) x).1 hx - obtain ⟨ν, r, q, topEntry, child, _, _⟩ := (entry_unionName τ σ p).1 entry - exact (rank_eval_le Set.univ σ).trans_lt - ((entry_nameRank_lt child).trans (entry_nameRank_lt topEntry)) - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem act_unionName (g : G) (τ : Name s) : - a.act s g (Name.unionName τ) = Name.unionName (a.act s g τ) := by - apply Name.ext - intro σ p - obtain ⟨σ, rfl⟩ := (a.nameEquiv s g).surjective σ - obtain ⟨p, rfl⟩ := (a.iso g).surjective p - change Name.Entry (a.act s g σ) (a.act s g (Name.unionName τ)) (a.iso g p) ↔ - Name.Entry (a.act s g σ) (Name.unionName (a.act s g τ)) (a.iso g p) - rw [a.entry_act, Name.entry_unionName, Name.entry_unionName] - constructor - · rintro ⟨ν, r, q, topEntry, child, pr, pq⟩ - exact ⟨a.act s g ν, a.iso g r, a.iso g q, - (a.entry_act s g ν τ r).2 topEntry, (a.entry_act s g σ ν q).2 child, - (a.iso g).monotone pr, (a.iso g).monotone pq⟩ - · rintro ⟨ν, r, q, topEntry, child, pr, pq⟩ - obtain ⟨ν, rfl⟩ := (a.nameEquiv s g).surjective ν - obtain ⟨r, rfl⟩ := (a.iso g).surjective r - obtain ⟨q, rfl⟩ := (a.iso g).surjective q - exact ⟨ν, r, q, (a.entry_act s g ν τ r).1 topEntry, - (a.entry_act s g σ ν q).1 child, (a.iso g).le_iff_le.1 pr, (a.iso g).le_iff_le.1 pq⟩ - -theorem unionName_hs (F : NormalSubgroupFamily G) {τ : Name s} - (hτ : HereditarilySymmetric a s F τ) : HereditarilySymmetric a s F (Name.unionName τ) := by - refine HereditarilySymmetric.mk (F.upward hτ.symmetric ?_) ?_ - · intro g fixed - change a.act s g (Name.unionName τ) = Name.unionName τ - rw [a.act_unionName] - exact congrArg Name.unionName fixed - · intro σ p entry - obtain ⟨ν, r, q, topEntry, child, _, _⟩ := (Name.entry_unionName τ σ p).1 entry - exact (hτ.member topEntry).member child - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.Name - -open SetRealization SetFormula -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -noncomputable def envelope (τ : Name s) : Name s := selectName (fun _ _ => True) τ - -theorem entry_envelope (τ σ : Name s) (p : P) : - Entry σ (envelope τ) p ↔ ∃ r, Entry σ τ r ∧ p ≤ r := by - simp only [envelope, entry_selectName, and_true] - -theorem selectName_subset_envelope (R : Name s → P → Prop) (τ : Name s) : - (selectName R τ).val ⊆ (envelope τ).val := by - intro z hz - obtain ⟨σ, p, rfl⟩ := entries_cover (selectName R τ) hz - obtain ⟨r, old, pr, _⟩ := (entry_selectName R τ σ p).1 hz - exact (entry_envelope τ σ p).2 ⟨r, old, pr⟩ - -omit [Preorder P] in -theorem eval_mono (H : Set P) {σ τ : Name s} (sub : σ.val ⊆ τ.val) : - eval H σ ⊆ eval H τ := by - intro x hx - obtain ⟨ν, p, entry, hp, eq⟩ := (mem_eval H σ x).1 hx - exact (mem_eval H τ x).2 ⟨ν, p, sub entry, hp, eq⟩ - -theorem eval_envelope (H : ConditionFilter P) (τ : Name s) : - eval {p | H.mem p} (envelope τ) = eval {p | H.mem p} τ := by - apply ZFSet.ext - intro x - rw [mem_eval, mem_eval] - constructor - · rintro ⟨σ, p, entry, hp, eq⟩ - obtain ⟨r, old, pr⟩ := (entry_envelope τ σ p).1 entry - exact ⟨σ, r, old, H.upward hp pr, eq⟩ - · rintro ⟨σ, p, entry, hp, eq⟩ - exact ⟨σ, p, (entry_envelope τ σ p).2 ⟨p, entry, le_rfl⟩, hp, eq⟩ - -theorem separationName_true (D : NameDomain s) {τ : Name s} (hτ : τ ∈ D.names) : - separationName D (.equal 0 0) Fin.elim0 τ = envelope τ := by - apply ext - intro σ p - rw [entry_separationName, entry_envelope] - constructor - · rintro ⟨r, old, pr, _⟩ - exact ⟨r, old, pr⟩ - · rintro ⟨r, old, pr⟩ - exact ⟨r, old, pr, D.children hτ old, forcesEq_refl σ p⟩ - -omit [Preorder P] in -theorem rename_mono (f : P → P) {σ τ : Name s} (sub : σ.val ⊆ τ.val) : - (rename s f σ).val ⊆ (rename s f τ).val := by - intro z hz - obtain ⟨ν, p, rfl⟩ := entries_cover (rename s f σ) hz - obtain ⟨χ, q, entry, eq, hp⟩ := (entry_rename s f σ ν p).1 hz - exact (entry_rename s f τ ν p).2 ⟨χ, q, sub entry, eq, hp⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem act_envelope (g : G) (τ : Name s) : - a.act s g (Name.envelope τ) = Name.envelope (a.act s g τ) := - a.act_selectName s g (fun _ _ => True) (fun _ _ => True) (fun _ _ => Iff.rfl) τ - -theorem envelope_hs (F : NormalSubgroupFamily G) {τ : Name s} - (hτ : HereditarilySymmetric a s F τ) : HereditarilySymmetric a s F (Name.envelope τ) := by - refine HereditarilySymmetric.mk (F.upward hτ.symmetric ?_) ?_ - · intro g hg - change a.act s g (Name.envelope τ) = Name.envelope τ - rw [a.act_envelope, show a.act s g τ = τ from hg] - · intro σ p entry - obtain ⟨r, old, _⟩ := (Name.entry_envelope τ σ p).1 entry - exact hτ.member old - -theorem act_subset_iff_fixed (g : G) {σ τ : Name s} (fixed : a.act s g τ = τ) : - (a.act s g σ).val ⊆ τ.val ↔ σ.val ⊆ τ.val := by - constructor - · intro sub - have h := Name.rename_mono (a.iso g⁻¹) sub - change (a.act s g⁻¹ (a.act s g σ)).val ⊆ (a.act s g⁻¹ τ).val at h - rw [a.act_inv_left, ← fixed, a.act_inv_left] at h - exact h - · intro sub - have h := Name.rename_mono (a.iso g) sub - change (a.act s g σ).val ⊆ (a.act s g τ).val at h - rwa [fixed] at h - -end PartitionPilot.Forcing.PosetAction - -end - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem nameRank_act (g : G) (τ : Name s) : - Name.nameRank (a.act s g τ) = Name.nameRank τ := - Name.nameRank_rename s (a.iso g) τ - -theorem nameRank_mix_le [Small.{u} G] (K : Subgroup G) (p : P) (τ : Name s) : - Name.nameRank (a.mix s K p τ) ≤ Name.nameRank τ := by - change ZFSet.rank (Name.eval Set.univ (a.mix s K p τ)) ≤ Name.nameRank τ - rw [ZFSet.rank_le_iff] - intro value hv - obtain ⟨σ, q, entry, _, rfl⟩ := (Name.mem_eval Set.univ (a.mix s K p τ) value).1 hv - obtain ⟨g, _, ν, r, old, rfl, _, _⟩ := (a.entry_mix s K p τ σ q).1 entry - apply (Name.rank_eval_le Set.univ (a.act s g ν)).trans_lt - rw [a.nameRank_act] - exact Name.entry_nameRank_lt old - -end PartitionPilot.Forcing.PosetAction - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames + +namespace OAI + + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P Q : Type u} {s : Presentation P} + +noncomputable def nameRank (τ : Name s) : Ordinal.{u} := ZFSet.rank (eval Set.univ τ) + +theorem eval_univ (τ : Name s) : + eval Set.univ τ = ZFSet.range (fun a : Entries τ => eval Set.univ a.val.1) := by + apply ZFSet.ext + intro x + rw [mem_eval, ZFSet.mem_range] + constructor + · rintro ⟨σ, p, h, _, eq⟩ + exact ⟨⟨(σ, p), h⟩, eq⟩ + · rintro ⟨a, eq⟩ + exact ⟨a.val.1, a.val.2, a.property, Set.mem_univ _, eq⟩ + +theorem nameRank_eq (τ : Name s) : + nameRank τ = ⨆ a : Entries τ, Order.succ (nameRank a.val.1) := by + change ZFSet.rank (eval Set.univ τ) = _ + rw [eval_univ, ZFSet.rank_range] + rfl + +theorem entry_nameRank_lt {σ τ : Name s} {p : P} (h : Entry σ τ p) : + nameRank σ < nameRank τ := + ZFSet.rank_lt_of_mem ((mem_eval Set.univ τ _).2 ⟨σ, p, h, Set.mem_univ _, rfl⟩) + +theorem nameRank_rename (t : Presentation Q) (f : P → Q) (τ : Name s) : + nameRank (rename t f τ) = nameRank τ := by + unfold nameRank + rw [eval_rename] + rfl + +theorem rank_eval_le (H : Set P) (τ : Name s) : ZFSet.rank (eval H τ) ≤ nameRank τ := by + induction τ using inductionOn with + | step τ ih => + rw [ZFSet.rank_le_iff] + intro x hx + obtain ⟨σ, p, entry, _, rfl⟩ := (mem_eval H τ x).1 hx + exact (ih σ p entry).trans_lt (entry_nameRank_lt entry) + +theorem nameRank_check (one : P) (x : ZFSet.{u}) : nameRank (check s one x) = ZFSet.rank x := by + unfold nameRank + rw [eval_check Set.univ one (Set.mem_univ one)] + +end PartitionPilot.Forcing.Name + + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +noncomputable def selectName (R : Name s → P → Prop) (τ : Name s) : Name s := + assemble (fun z : {z : Entries τ × P // z.2 ≤ z.1.val.2 ∧ R z.1.val.1 z.2} => z.val.1.val.1) + (fun z => z.val.2) + +theorem entry_selectName (R : Name s → P → Prop) (τ σ : Name s) (p : P) : + Entry σ (selectName R τ) p ↔ ∃ r, Entry σ τ r ∧ p ≤ r ∧ R σ p := by + rw [selectName, entry_assemble] + constructor + · rintro ⟨z, rfl, rfl⟩ + exact ⟨z.val.1.val.2, z.val.1.property, z.property⟩ + · rintro ⟨r, entry, pr, hR⟩ + exact ⟨⟨(⟨(σ, r), entry⟩, p), pr, hR⟩, rfl, rfl⟩ + +theorem nameRank_selectName_le (R : Name s → P → Prop) (τ : Name s) : + nameRank (selectName R τ) ≤ nameRank τ := by + change ZFSet.rank (eval Set.univ (selectName R τ)) ≤ nameRank τ + rw [ZFSet.rank_le_iff] + intro x hx + obtain ⟨σ, p, entry, _, rfl⟩ := (mem_eval Set.univ (selectName R τ) x).1 hx + obtain ⟨r, old, _, _⟩ := (entry_selectName R τ σ p).1 entry + exact (rank_eval_le Set.univ σ).trans_lt (entry_nameRank_lt old) + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem act_selectName (g : G) (R R' : Name s → P → Prop) + (transport : ∀ σ p, R' (a.act s g σ) (a.iso g p) ↔ R σ p) (τ : Name s) : + a.act s g (Name.selectName R τ) = Name.selectName R' (a.act s g τ) := by + apply Name.ext + intro σ p + obtain ⟨σ, rfl⟩ := (a.nameEquiv s g).surjective σ + obtain ⟨p, rfl⟩ := (a.iso g).surjective p + change Name.Entry (a.act s g σ) (a.act s g (Name.selectName R τ)) (a.iso g p) ↔ + Name.Entry (a.act s g σ) (Name.selectName R' (a.act s g τ)) (a.iso g p) + rw [a.entry_act, Name.entry_selectName, Name.entry_selectName] + constructor + · rintro ⟨r, entry, pr, hR⟩ + exact ⟨a.iso g r, (a.entry_act s g σ τ r).2 entry, + (a.iso g).monotone pr, (transport σ p).2 hR⟩ + · rintro ⟨r, entry, pr, hR⟩ + obtain ⟨r, rfl⟩ := (a.iso g).surjective r + exact ⟨r, (a.entry_act s g σ τ r).1 entry, (a.iso g).le_iff_le.1 pr, (transport σ p).1 hR⟩ + +end PartitionPilot.Forcing.PosetAction + +end + + +namespace PartitionPilot.Forcing.Name + +open SetRealization SetFormula +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +def separationPredicate (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) + (env : Assignment D n) (σ : Name s) (p : P) : Prop := + ∃ h : σ ∈ D.names, Forces D φ (extend ⟨σ, h⟩ env) p + +noncomputable def separationName (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) + (env : Assignment D n) (τ : Name s) : Name s := selectName (separationPredicate D φ env) τ + +theorem entry_separationName (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) + (env : Assignment D n) (τ σ : Name s) (p : P) : + Entry σ (separationName D φ env τ) p ↔ + ∃ r, Entry σ τ r ∧ p ≤ r ∧ ∃ h : σ ∈ D.names, Forces D φ (extend ⟨σ, h⟩ env) p := by + rw [separationName, entry_selectName] + rfl + +theorem eval_separationName (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) {n : Nat} (φ : SetFormula (n + 1)) + (env : Assignment D n) {τ : Name s} (hτ : τ ∈ D.names) : + eval {p | H.mem p} (separationName D φ env τ) = + ZFSet.sep (fun x => Realize (D.values {p | H.mem p}) φ + (extend x (evalAssignment {p | H.mem p} env))) (eval {p | H.mem p} τ) := by + apply ZFSet.ext + intro x + rw [mem_eval, ZFSet.mem_sep] + constructor + · rintro ⟨σ, p, entry, hp, value⟩ + obtain ⟨r, old, pr, hσ, forced⟩ := (entry_separationName D φ env τ σ p).1 entry + have truth := forces_sound D H generic φ (extend ⟨σ, hσ⟩ env) hp forced + rw [evalAssignment_extend, value] at truth + exact ⟨(mem_eval _ τ x).2 ⟨σ, r, old, H.upward hp pr, value⟩, truth⟩ + · rintro ⟨member, truth⟩ + obtain ⟨σ, r, entry, hr, value⟩ := (mem_eval _ τ x).1 member + have hσ := D.children hτ entry + have instanceTruth : Realize (D.values {p | H.mem p}) φ + (evalAssignment {p | H.mem p} (extend ⟨σ, hσ⟩ env)) := by + rw [evalAssignment_extend, value] + exact truth + obtain ⟨q, hq, forced⟩ := (forcing_truth D H generic φ (extend ⟨σ, hσ⟩ env)).1 instanceTruth + obtain ⟨p, hp, pr, pq⟩ := H.directed hr hq + exact ⟨σ, p, (entry_separationName D φ env τ σ p).2 + ⟨r, entry, pr, hσ, forces_mono D φ (extend ⟨σ, hσ⟩ env) forced pq⟩, hp, value⟩ + +theorem nameRank_separationName_le (D : NameDomain s) {n : Nat} (φ : SetFormula (n + 1)) + (env : Assignment D n) (τ : Name s) : nameRank (separationName D φ env τ) ≤ nameRank τ := + nameRank_selectName_le (separationPredicate D φ env) τ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u v +variable {G : Type v} [Group G] [Small.{u} G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +def MixIndices (K : Subgroup G) (p : P) (τ : Name s) := + {z : K × Name.Entries τ × P // + z.2.2 ≤ a.iso z.1.val p ∧ z.2.2 ≤ a.iso z.1.val z.2.1.val.2} + +instance mixIndices_small (K : Subgroup G) (p : P) (τ : Name s) : + Small.{u} (a.MixIndices s K p τ) := by + unfold MixIndices + infer_instance + +noncomputable def mix (K : Subgroup G) (p : P) (τ : Name s) : Name s := + Name.assemble (fun z : a.MixIndices s K p τ => a.act s z.val.1.val z.val.2.1.val.1) + (fun z => z.val.2.2) + +theorem entry_mix (K : Subgroup G) (p : P) (τ σ : Name s) (q : P) : + Name.Entry σ (a.mix s K p τ) q ↔ + ∃ g ∈ K, ∃ ν r, Name.Entry ν τ r ∧ a.act s g ν = σ ∧ + q ≤ a.iso g p ∧ q ≤ a.iso g r := by + rw [mix, Name.entry_assemble] + constructor + · rintro ⟨z, eq, rfl⟩ + exact ⟨z.val.1.val, z.val.1.property, z.val.2.1.val.1, z.val.2.1.val.2, + z.val.2.1.property, eq, z.property⟩ + · rintro ⟨g, hg, ν, r, entry, eq, lower⟩ + exact ⟨⟨(⟨g, hg⟩, ⟨(ν, r), entry⟩, q), lower⟩, eq, rfl⟩ + +theorem mix_entry_translated (K : Subgroup G) (p : P) (τ : Name s) + {σ : Name s} {q : P} (entry : Name.Entry σ (a.mix s K p τ) q) + {h : G} (hh : h ∈ K) : + Name.Entry (a.act s h σ) (a.mix s K p τ) (a.iso h q) := by + obtain ⟨g, hg, ν, r, old, eq, qp, qr⟩ := (a.entry_mix s K p τ σ q).1 entry + apply (a.entry_mix s K p τ _ _).2 + refine ⟨h * g, K.mul_mem hh hg, ν, r, old, ?_, ?_, ?_⟩ + · rw [a.act_mul, eq] + · rw [a.mul] + exact (a.iso h).monotone qp + · rw [a.mul] + exact (a.iso h).monotone qr + +theorem mix_fixed (K : Subgroup G) (p : P) (τ : Name s) {g : G} (hg : g ∈ K) : + a.act s g (a.mix s K p τ) = a.mix s K p τ := by + apply Name.ext + intro σ q + change Name.Entry σ (Name.rename s (a.iso g) (a.mix s K p τ)) q ↔ _ + rw [Name.entry_rename] + constructor + · rintro ⟨ν, r, entry, eq, hr⟩ + change a.act s g ν = σ at eq + have h := a.mix_entry_translated s K p τ entry hg + simpa only [eq, hr] using h + · intro entry + have moved := a.mix_entry_translated s K p τ entry (K.inv_mem hg) + refine ⟨a.act s g⁻¹ σ, a.iso g⁻¹ q, moved, a.act_inv_right s g σ, ?_⟩ + rw [← a.mul, mul_inv_cancel, a.one] + +theorem mix_hs (F : NormalSubgroupFamily G) (K : Subgroup G) (hK : F.mem K) + (p : P) {τ : Name s} (hτ : HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (a.mix s K p τ) := by + refine HereditarilySymmetric.mk (F.upward hK ?_) ?_ + · intro g hg + exact a.mix_fixed s K p τ hg + · intro σ q entry + obtain ⟨g, _, ν, r, old, rfl, _, _⟩ := (a.entry_mix s K p τ σ q).1 entry + exact (hτ.member old).translated g + +theorem mem_eval_mix (K : Subgroup G) (p : P) (τ : Name s) + (H : ConditionFilter P) (x : ZFSet.{u}) : + x ∈ Name.eval {q | H.mem q} (a.mix s K p τ) ↔ + ∃ g ∈ K, H.mem (a.iso g p) ∧ x ∈ Name.eval {q | H.mem q} (a.act s g τ) := by + rw [Name.mem_eval] + constructor + · rintro ⟨σ, q, entry, hq, eq⟩ + obtain ⟨g, hg, ν, r, old, rfl, qp, qr⟩ := (a.entry_mix s K p τ σ q).1 entry + refine ⟨g, hg, H.upward hq qp, ?_⟩ + apply (Name.mem_eval {q | H.mem q} (a.act s g τ) x).2 + exact ⟨a.act s g ν, a.iso g r, (a.entry_act s g ν τ r).2 old, + H.upward hq qr, eq⟩ + · rintro ⟨g, hg, hp, hx⟩ + obtain ⟨σ, q, entry, hq, eq⟩ := (Name.mem_eval {q | H.mem q} (a.act s g τ) x).1 hx + change Name.Entry σ (Name.rename s (a.iso g) τ) q at entry + obtain ⟨ν, r, old, rfl, rfl⟩ := (Name.entry_rename s (a.iso g) τ σ q).1 entry + obtain ⟨c, hc, cp, cr⟩ := H.directed hp hq + exact ⟨a.act s g ν, c, + (a.entry_mix s K p τ _ c).2 ⟨g, hg, ν, r, old, rfl, cp, cr⟩, hc, eq⟩ + +theorem eval_mix_of_active_equal (K : Subgroup G) (p : P) (τ : Name s) + (H : ConditionFilter P) (hp : H.mem p) + (agree : ∀ g ∈ K, H.mem (a.iso g p) → + Name.eval {q | H.mem q} (a.act s g τ) = Name.eval {q | H.mem q} τ) : + Name.eval {q | H.mem q} (a.mix s K p τ) = Name.eval {q | H.mem q} τ := by + apply ZFSet.ext + intro x + rw [a.mem_eval_mix s] + constructor + · rintro ⟨g, hg, active, hx⟩ + rwa [agree g hg active] at hx + · intro hx + refine ⟨1, K.one_mem, ?_, ?_⟩ + · simpa only [a.one] using hp + · simpa only [a.act_one] using hx + +end PartitionPilot.Forcing.PosetAction + + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +def UnionIndices (τ : Name s) := + {z : (Σ e : Entries τ, Entries e.val.1) × P // + z.2 ≤ z.1.1.val.2 ∧ z.2 ≤ z.1.2.val.2} + +instance unionIndices_small (τ : Name s) : Small.{u} (UnionIndices τ) := by + unfold UnionIndices + infer_instance + +noncomputable def unionName (τ : Name s) : Name s := + assemble (fun z : UnionIndices τ => z.val.1.2.val.1) (fun z => z.val.2) + +theorem entry_unionName (τ σ : Name s) (p : P) : Entry σ (unionName τ) p ↔ + ∃ ν r q, Entry ν τ r ∧ Entry σ ν q ∧ p ≤ r ∧ p ≤ q := by + rw [unionName, entry_assemble] + constructor + · rintro ⟨z, rfl, rfl⟩ + exact ⟨z.val.1.1.val.1, z.val.1.1.val.2, z.val.1.2.val.2, + z.val.1.1.property, z.val.1.2.property, z.property⟩ + · rintro ⟨ν, r, q, topEntry, child, pr, pq⟩ + exact ⟨⟨(⟨⟨(ν, r), topEntry⟩, ⟨(σ, q), child⟩⟩, p), pr, pq⟩, rfl, rfl⟩ + +theorem eval_unionName (H : ConditionFilter P) (τ : Name s) : + eval {p | H.mem p} (unionName τ) = ZFSet.sUnion (eval {p | H.mem p} τ) := by + apply ZFSet.ext + intro x + rw [mem_eval, ZFSet.mem_sUnion] + constructor + · rintro ⟨σ, p, entry, hp, value⟩ + obtain ⟨ν, r, q, topEntry, child, pr, pq⟩ := (entry_unionName τ σ p).1 entry + exact ⟨eval {p | H.mem p} ν, + (mem_eval _ τ _).2 ⟨ν, r, topEntry, H.upward hp pr, rfl⟩, + (mem_eval _ ν x).2 ⟨σ, q, child, H.upward hp pq, value⟩⟩ + · rintro ⟨y, hy, hx⟩ + obtain ⟨ν, r, topEntry, hr, rfl⟩ := (mem_eval _ τ y).1 hy + obtain ⟨σ, q, child, hq, value⟩ := (mem_eval _ ν x).1 hx + obtain ⟨p, hp, pr, pq⟩ := H.directed hr hq + exact ⟨σ, p, (entry_unionName τ σ p).2 ⟨ν, r, q, topEntry, child, pr, pq⟩, hp, value⟩ + +theorem nameRank_unionName_le (τ : Name s) : nameRank (unionName τ) ≤ nameRank τ := by + change ZFSet.rank (eval Set.univ (unionName τ)) ≤ nameRank τ + rw [ZFSet.rank_le_iff] + intro x hx + obtain ⟨σ, p, entry, _, rfl⟩ := (mem_eval Set.univ (unionName τ) x).1 hx + obtain ⟨ν, r, q, topEntry, child, _, _⟩ := (entry_unionName τ σ p).1 entry + exact (rank_eval_le Set.univ σ).trans_lt + ((entry_nameRank_lt child).trans (entry_nameRank_lt topEntry)) + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem act_unionName (g : G) (τ : Name s) : + a.act s g (Name.unionName τ) = Name.unionName (a.act s g τ) := by + apply Name.ext + intro σ p + obtain ⟨σ, rfl⟩ := (a.nameEquiv s g).surjective σ + obtain ⟨p, rfl⟩ := (a.iso g).surjective p + change Name.Entry (a.act s g σ) (a.act s g (Name.unionName τ)) (a.iso g p) ↔ + Name.Entry (a.act s g σ) (Name.unionName (a.act s g τ)) (a.iso g p) + rw [a.entry_act, Name.entry_unionName, Name.entry_unionName] + constructor + · rintro ⟨ν, r, q, topEntry, child, pr, pq⟩ + exact ⟨a.act s g ν, a.iso g r, a.iso g q, + (a.entry_act s g ν τ r).2 topEntry, (a.entry_act s g σ ν q).2 child, + (a.iso g).monotone pr, (a.iso g).monotone pq⟩ + · rintro ⟨ν, r, q, topEntry, child, pr, pq⟩ + obtain ⟨ν, rfl⟩ := (a.nameEquiv s g).surjective ν + obtain ⟨r, rfl⟩ := (a.iso g).surjective r + obtain ⟨q, rfl⟩ := (a.iso g).surjective q + exact ⟨ν, r, q, (a.entry_act s g ν τ r).1 topEntry, + (a.entry_act s g σ ν q).1 child, (a.iso g).le_iff_le.1 pr, (a.iso g).le_iff_le.1 pq⟩ + +theorem unionName_hs (F : NormalSubgroupFamily G) {τ : Name s} + (hτ : HereditarilySymmetric a s F τ) : HereditarilySymmetric a s F (Name.unionName τ) := by + refine HereditarilySymmetric.mk (F.upward hτ.symmetric ?_) ?_ + · intro g fixed + change a.act s g (Name.unionName τ) = Name.unionName τ + rw [a.act_unionName] + exact congrArg Name.unionName fixed + · intro σ p entry + obtain ⟨ν, r, q, topEntry, child, _, _⟩ := (Name.entry_unionName τ σ p).1 entry + exact (hτ.member topEntry).member child + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.Name + +open SetRealization SetFormula +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +noncomputable def envelope (τ : Name s) : Name s := selectName (fun _ _ => True) τ + +theorem entry_envelope (τ σ : Name s) (p : P) : + Entry σ (envelope τ) p ↔ ∃ r, Entry σ τ r ∧ p ≤ r := by + simp only [envelope, entry_selectName, and_true] + +theorem selectName_subset_envelope (R : Name s → P → Prop) (τ : Name s) : + (selectName R τ).val ⊆ (envelope τ).val := by + intro z hz + obtain ⟨σ, p, rfl⟩ := entries_cover (selectName R τ) hz + obtain ⟨r, old, pr, _⟩ := (entry_selectName R τ σ p).1 hz + exact (entry_envelope τ σ p).2 ⟨r, old, pr⟩ + +omit [Preorder P] in +theorem eval_mono (H : Set P) {σ τ : Name s} (sub : σ.val ⊆ τ.val) : + eval H σ ⊆ eval H τ := by + intro x hx + obtain ⟨ν, p, entry, hp, eq⟩ := (mem_eval H σ x).1 hx + exact (mem_eval H τ x).2 ⟨ν, p, sub entry, hp, eq⟩ + +theorem eval_envelope (H : ConditionFilter P) (τ : Name s) : + eval {p | H.mem p} (envelope τ) = eval {p | H.mem p} τ := by + apply ZFSet.ext + intro x + rw [mem_eval, mem_eval] + constructor + · rintro ⟨σ, p, entry, hp, eq⟩ + obtain ⟨r, old, pr⟩ := (entry_envelope τ σ p).1 entry + exact ⟨σ, r, old, H.upward hp pr, eq⟩ + · rintro ⟨σ, p, entry, hp, eq⟩ + exact ⟨σ, p, (entry_envelope τ σ p).2 ⟨p, entry, le_rfl⟩, hp, eq⟩ + +theorem separationName_true (D : NameDomain s) {τ : Name s} (hτ : τ ∈ D.names) : + separationName D (.equal 0 0) Fin.elim0 τ = envelope τ := by + apply ext + intro σ p + rw [entry_separationName, entry_envelope] + constructor + · rintro ⟨r, old, pr, _⟩ + exact ⟨r, old, pr⟩ + · rintro ⟨r, old, pr⟩ + exact ⟨r, old, pr, D.children hτ old, forcesEq_refl σ p⟩ + +omit [Preorder P] in +theorem rename_mono (f : P → P) {σ τ : Name s} (sub : σ.val ⊆ τ.val) : + (rename s f σ).val ⊆ (rename s f τ).val := by + intro z hz + obtain ⟨ν, p, rfl⟩ := entries_cover (rename s f σ) hz + obtain ⟨χ, q, entry, eq, hp⟩ := (entry_rename s f σ ν p).1 hz + exact (entry_rename s f τ ν p).2 ⟨χ, q, sub entry, eq, hp⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem act_envelope (g : G) (τ : Name s) : + a.act s g (Name.envelope τ) = Name.envelope (a.act s g τ) := + a.act_selectName s g (fun _ _ => True) (fun _ _ => True) (fun _ _ => Iff.rfl) τ + +theorem envelope_hs (F : NormalSubgroupFamily G) {τ : Name s} + (hτ : HereditarilySymmetric a s F τ) : HereditarilySymmetric a s F (Name.envelope τ) := by + refine HereditarilySymmetric.mk (F.upward hτ.symmetric ?_) ?_ + · intro g hg + change a.act s g (Name.envelope τ) = Name.envelope τ + rw [a.act_envelope, show a.act s g τ = τ from hg] + · intro σ p entry + obtain ⟨r, old, _⟩ := (Name.entry_envelope τ σ p).1 entry + exact hτ.member old + +theorem act_subset_iff_fixed (g : G) {σ τ : Name s} (fixed : a.act s g τ = τ) : + (a.act s g σ).val ⊆ τ.val ↔ σ.val ⊆ τ.val := by + constructor + · intro sub + have h := Name.rename_mono (a.iso g⁻¹) sub + change (a.act s g⁻¹ (a.act s g σ)).val ⊆ (a.act s g⁻¹ τ).val at h + rw [a.act_inv_left, ← fixed, a.act_inv_left] at h + exact h + · intro sub + have h := Name.rename_mono (a.iso g) sub + change (a.act s g σ).val ⊆ (a.act s g τ).val at h + rwa [fixed] at h + +end PartitionPilot.Forcing.PosetAction + +end + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem nameRank_act (g : G) (τ : Name s) : + Name.nameRank (a.act s g τ) = Name.nameRank τ := + Name.nameRank_rename s (a.iso g) τ + +theorem nameRank_mix_le [Small.{u} G] (K : Subgroup G) (p : P) (τ : Name s) : + Name.nameRank (a.mix s K p τ) ≤ Name.nameRank τ := by + change ZFSet.rank (Name.eval Set.univ (a.mix s K p τ)) ≤ Name.nameRank τ + rw [ZFSet.rank_le_iff] + intro value hv + obtain ⟨σ, q, entry, _, rfl⟩ := (Name.mem_eval Set.univ (a.mix s K p τ) value).1 hv + obtain ⟨g, _, ν, r, old, rfl, _, _⟩ := (a.entry_mix s K p τ σ q).1 entry + apply (Name.rank_eval_le Set.univ (a.act s g ν)).trans_lt + rw [a.nameRank_act] + exact Name.entry_nameRank_lt old + +end PartitionPilot.Forcing.PosetAction + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameOrbitBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameOrbitBounds.lean index 8fe9342f5a31105a7f261c7b26ac7582b7562fc4..04b8427c837912a9d8121c2c040c3de8dd23b618 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameOrbitBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameOrbitBounds.lean @@ -1,326 +1,326 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FormulaSymmetry -import OAI.SetTheory.PartitionPrinciple.Forcing.NameMixingRanks - -namespace OAI - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps SetFormula -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem separationPredicate_act (D : Name.NameDomain s) - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (g : G) {n : Nat} (φ : SetFormula (n + 1)) (env : Assignment D n) (σ : Name s) (p : P) : - Name.separationPredicate D φ (a.actAssignment s D closed g env) (a.act s g σ) (a.iso g p) ↔ - Name.separationPredicate D φ env σ p := by - constructor - · rintro ⟨movedMem, forced⟩ - have oldMem : σ ∈ D.names := by - have h := closed g⁻¹ (a.act s g σ) movedMem - simpa only [a.act_inv_left] using h - refine ⟨oldMem, (a.formula_forces_act_iff s D closed g φ (extend ⟨σ, oldMem⟩ env) p).1 ?_⟩ - rw [a.actAssignment_extend] - exact forced - · rintro ⟨hσ, forced⟩ - refine ⟨closed g σ hσ, ?_⟩ - have h := (a.formula_forces_act_iff s D closed g φ (extend ⟨σ, hσ⟩ env) p).2 forced - rw [a.actAssignment_extend] at h - exact h - -theorem act_separationName (D : Name.NameDomain s) - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (g : G) {n : Nat} (φ : SetFormula (n + 1)) (env : Assignment D n) (τ : Name s) : - a.act s g (Name.separationName D φ env τ) = - Name.separationName D φ (a.actAssignment s D closed g env) (a.act s g τ) := - a.act_selectName s g (Name.separationPredicate D φ env) - (Name.separationPredicate D φ (a.actAssignment s D closed g env)) - (a.separationPredicate_act s D closed g φ env) τ - -theorem separationName_hs (D : Name.NameDomain s) - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (F : NormalSubgroupFamily G) {n : Nat} (φ : SetFormula (n + 1)) - (env : Assignment D n) {τ : Name s} (hτ : HereditarilySymmetric a s F τ) - (params : ∀ i, HereditarilySymmetric a s F (env i).val) : - HereditarilySymmetric a s F (Name.separationName D φ env τ) := by - let K := a.stabilizer s τ ⊓ ⨅ i, a.stabilizer s (env i).val - have hK : F.mem K := F.inf hτ.symmetric - (F.fin_iInf (fun i => a.stabilizer s (env i).val) (fun i => (params i).symmetric)) - refine HereditarilySymmetric.mk (F.upward hK ?_) ?_ - · intro g hg - have fixedτ : a.act s g τ = τ := hg.1 - have fixedEnv : a.actAssignment s D closed g env = env := by - funext i - apply Subtype.ext - exact (iInf_le (fun j => a.stabilizer s (env j).val) i) hg.2 - change a.act s g (Name.separationName D φ env τ) = Name.separationName D φ env τ - rw [a.act_separationName s D closed, fixedτ, fixedEnv] - · intro σ p entry - obtain ⟨r, old, _, _⟩ := (Name.entry_separationName D φ env τ σ p).1 entry - exact hτ.member old - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -def symmetricDomain (D : Name.NameDomain s) (F : NormalSubgroupFamily G) : Name.NameDomain s where - names := {τ | τ ∈ D.names ∧ HereditarilySymmetric a s F τ} - children h entry := ⟨D.children h.1 entry, h.2.member entry⟩ - -theorem symmetricDomain_translated (D : Name.NameDomain s) (F : NormalSubgroupFamily G) - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (g : G) {τ : Name s} (hτ : τ ∈ (a.symmetricDomain s D F).names) : - a.act s g τ ∈ (a.symmetricDomain s D F).names := - ⟨closed g τ hτ.1, hτ.2.translated g⟩ - -theorem symmetricDomain_mix [Small.{u} G] (D : Name.NameDomain s) (F : NormalSubgroupFamily G) - (K : Subgroup G) (hK : F.mem K) (p : P) - (closed : ∀ τ ∈ D.names, a.mix s K p τ ∈ D.names) - {τ : Name s} (hτ : τ ∈ (a.symmetricDomain s D F).names) : - a.mix s K p τ ∈ (a.symmetricDomain s D F).names := - ⟨closed τ hτ.1, a.mix_hs s F K hK p hτ.2⟩ - -theorem mem_symmetric_values (D : Name.NameDomain s) (F : NormalSubgroupFamily G) - (H : Set P) (x : ZFSet.{u}) : - x ∈ (a.symmetricDomain s D F).values H ↔ - ∃ τ ∈ D.names, HereditarilySymmetric a s F τ ∧ Name.eval H τ = x := by - rw [Name.NameDomain.mem_values] - constructor - · rintro ⟨τ, ⟨hτ, hs⟩, eq⟩ - exact ⟨τ, hτ, hs, eq⟩ - · rintro ⟨τ, hτ, hs, eq⟩ - exact ⟨τ, ⟨hτ, hs⟩, eq⟩ - -end PartitionPilot.Forcing.PosetAction - - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -def BoundedNames (D : NameDomain s) (W : ZFSet.{u}) := {σ : D.names // σ.val.val ∈ W} - -instance boundedNames_small (D : NameDomain s) (W : ZFSet.{u}) : Small.{u} (BoundedNames D W) := by - let f : BoundedNames D W → W := fun σ => ⟨σ.val.val.val, σ.property⟩ - apply small_of_injective.{u} (f := f) - intro σ τ eq - have raw : σ.val.val.val = τ.val.val.val := congrArg (fun z : W => z.val) eq - exact Subtype.ext (Subtype.ext (Subtype.ext raw)) - -noncomputable def codedPower [OrderTop P] (D : NameDomain s) (W : ZFSet.{u}) : Name s := - assemble (fun σ : BoundedNames D W => σ.val.val) (fun _ => ⊤) - -theorem entry_codedPower [OrderTop P] (D : NameDomain s) (W : ZFSet.{u}) (σ : Name s) (p : P) : - Entry σ (codedPower D W) p ↔ σ ∈ D.names ∧ σ.val ∈ W ∧ p = ⊤ := by - rw [codedPower, entry_assemble] - constructor - · rintro ⟨i, rfl, rfl⟩ - exact ⟨i.val.property, i.property, rfl⟩ - · rintro ⟨hσ, hW, rfl⟩ - exact ⟨⟨⟨σ, hσ⟩, hW⟩, rfl, rfl⟩ - -theorem mem_eval_codedPower [OrderTop P] (D : NameDomain s) (W : ZFSet.{u}) - (H : ConditionFilter P) (x : ZFSet.{u}) : - x ∈ eval {p | H.mem p} (codedPower D W) ↔ - ∃ σ ∈ D.names, σ.val ∈ W ∧ eval {p | H.mem p} σ = x := by - rw [mem_eval] - constructor - · rintro ⟨σ, p, entry, _, eq⟩ - obtain ⟨hσ, hW, _⟩ := (entry_codedPower D W σ p).1 entry - exact ⟨σ, hσ, hW, eq⟩ - · rintro ⟨σ, hσ, hW, eq⟩ - exact ⟨σ, ⊤, (entry_codedPower D W σ ⊤).2 ⟨hσ, hW, rfl⟩, H.top_mem, eq⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem act_codedPower_fixed (D : Name.NameDomain s) - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (W : ZFSet.{u}) (g : G) - (invariant : ∀ σ ∈ D.names, (a.act s g σ).val ∈ W ↔ σ.val ∈ W) : - a.act s g (Name.codedPower D W) = Name.codedPower D W := by - apply Name.ext - intro σ p - obtain ⟨σ, rfl⟩ := (a.nameEquiv s g).surjective σ - obtain ⟨p, rfl⟩ := (a.iso g).surjective p - change Name.Entry (a.act s g σ) (a.act s g (Name.codedPower D W)) (a.iso g p) ↔ _ - rw [a.entry_act, Name.entry_codedPower, Name.entry_codedPower] - constructor - · rintro ⟨hσ, hW, rfl⟩ - exact ⟨closed g σ hσ, (invariant σ hσ).2 hW, (a.iso g).map_top⟩ - · rintro ⟨hσ, hW, hp⟩ - have old : σ ∈ D.names := by - have h := closed g⁻¹ (a.act s g σ) hσ - simpa only [a.act_inv_left] using h - exact ⟨old, (invariant σ old).1 hW, (a.iso g).injective (hp.trans (a.iso g).map_top.symm)⟩ - -theorem codedPower_hs (D : Name.NameDomain s) (F : NormalSubgroupFamily G) - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (W : ZFSet.{u}) (τ : Name s) (hτ : HereditarilySymmetric a s F τ) - (bounded : ∀ σ ∈ (a.symmetricDomain s D F).names, σ.val ∈ W ↔ σ.val ⊆ τ.val) : - HereditarilySymmetric a s F (Name.codedPower (a.symmetricDomain s D F) W) := by - let E := a.symmetricDomain s D F - have moved : ∀ g σ, σ ∈ E.names → a.act s g σ ∈ E.names := - fun g _ h => a.symmetricDomain_translated s D F closed g h - refine HereditarilySymmetric.mk (F.upward hτ.symmetric ?_) ?_ - · intro g hg - apply a.act_codedPower_fixed s E moved W g - intro σ hσ - rw [bounded _ (moved g σ hσ), bounded σ hσ] - exact a.act_subset_iff_fixed s g hg - · intro σ p entry - exact ((Name.entry_codedPower E W σ p).1 entry).1.2 - -end PartitionPilot.Forcing.PosetAction - -end - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps SetFormula -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) -variable (D : Name.NameDomain s) (F : NormalSubgroupFamily G) - -theorem symmetricDomain_nonempty (nonempty : D.names.Nonempty) : - (a.symmetricDomain s D F).names.Nonempty := - ⟨Name.empty s, D.empty_mem nonempty, a.empty_hs s F⟩ - -theorem symmetric_values_pair [OrderTop P] - (pairs : ∀ σ ∈ D.names, ∀ τ ∈ D.names, Name.unorderedPair ⊤ σ τ ∈ D.names) - (H : ConditionFilter P) {x y : ZFSet.{u}} - (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) - (hy : y ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : - ({x, y} : ZFSet.{u}) ∈ (a.symmetricDomain s D F).values {p | H.mem p} := by - obtain ⟨σ, hσ, symσ, rfl⟩ := (a.mem_symmetric_values s D F _ x).1 hx - obtain ⟨τ, hτ, symτ, rfl⟩ := (a.mem_symmetric_values s D F _ y).1 hy - exact (a.mem_symmetric_values s D F _ _).2 - ⟨Name.unorderedPair ⊤ σ τ, pairs σ hσ τ hτ, symσ.unorderedPair symτ, - Name.eval_unorderedPair _ ⊤ H.top_mem σ τ⟩ - -theorem symmetric_values_union - (unions : ∀ τ ∈ D.names, Name.unionName τ ∈ D.names) - (H : ConditionFilter P) {x : ZFSet.{u}} - (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : - ZFSet.sUnion x ∈ (a.symmetricDomain s D F).values {p | H.mem p} := by - obtain ⟨τ, hτ, symτ, rfl⟩ := (a.mem_symmetric_values s D F _ x).1 hx - exact (a.mem_symmetric_values s D F _ _).2 - ⟨Name.unionName τ, unions τ hτ, a.unionName_hs s F symτ, Name.eval_unionName H τ⟩ - -theorem symmetric_values_separation - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s D F))) - {n : Nat} (φ : SetFormula (n + 1)) (env : Assignment (a.symmetricDomain s D F) n) - (separated : ∀ τ ∈ (a.symmetricDomain s D F).names, - Name.separationName (a.symmetricDomain s D F) φ env τ ∈ D.names) - {x : ZFSet.{u}} (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : - ZFSet.sep (fun z => Realize ((a.symmetricDomain s D F).values {p | H.mem p}) φ - (extend z (evalAssignment {p | H.mem p} env))) x ∈ - (a.symmetricDomain s D F).values {p | H.mem p} := by - obtain ⟨τ, hτ, rfl⟩ := ((a.symmetricDomain s D F).mem_values _ x).1 hx - refine (a.mem_symmetric_values s D F _ _).2 - ⟨Name.separationName (a.symmetricDomain s D F) φ env τ, separated τ hτ, ?_, ?_⟩ - · exact a.separationName_hs s (a.symmetricDomain s D F) - (fun g _ h => a.symmetricDomain_translated s D F closed g h) F φ env hτ.2 - (fun i => (env i).property.2) - · exact Name.eval_separationName (a.symmetricDomain s D F) H generic φ env hτ - -theorem symmetric_values_separation_params - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s D F))) - {n : Nat} (φ : SetFormula (n + 1)) - (separated : ∀ (env : Assignment (a.symmetricDomain s D F) n) - τ, τ ∈ (a.symmetricDomain s D F).names → - Name.separationName (a.symmetricDomain s D F) φ env τ ∈ D.names) - (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ (a.symmetricDomain s D F).values {p | H.mem p}) - {x : ZFSet.{u}} (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : - ZFSet.sep (fun z => Realize ((a.symmetricDomain s D F).values {p | H.mem p}) φ - (extend z params)) x ∈ (a.symmetricDomain s D F).values {p | H.mem p} := by - classical - have reps := fun i => ((a.symmetricDomain s D F).mem_values _ (params i)).1 (members i) - choose names inDomain values using reps - let env : Assignment (a.symmetricDomain s D F) n := fun i => ⟨names i, inDomain i⟩ - have evals : evalAssignment {p | H.mem p} env = params := funext values - have h := a.symmetric_values_separation s D F closed H generic φ env (separated env) hx - rw [evals] at h - exact h - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u -variable {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -noncomputable def orbitCodes (D : Name.NameDomain s) (W : ZFSet.{u}) : ZFSet.{u} := - ZFSet.range (fun i : G × Name.BoundedNames D W => (a.act s i.1 i.2.val.val).val) - -theorem mem_orbitCodes (D : Name.NameDomain s) (W y : ZFSet.{u}) : - y ∈ a.orbitCodes s D W ↔ ∃ g σ, σ ∈ D.names ∧ σ.val ∈ W ∧ y = (a.act s g σ).val := by - rw [orbitCodes, ZFSet.mem_range] - constructor - · rintro ⟨⟨g, σ⟩, eq⟩ - exact ⟨g, σ.val.val, σ.val.property, σ.property, eq.symm⟩ - · rintro ⟨g, σ, hσ, hW, eq⟩ - exact ⟨(g, ⟨⟨σ, hσ⟩, hW⟩), eq.symm⟩ - -theorem mem_orbitCodes_of_mem (D : Name.NameDomain s) {W : ZFSet.{u}} {σ : Name s} - (hσ : σ ∈ D.names) (hW : σ.val ∈ W) : σ.val ∈ a.orbitCodes s D W := by - exact (a.mem_orbitCodes s D W σ.val).2 ⟨1, σ, hσ, hW, congrArg Subtype.val (a.act_one s σ).symm⟩ - -theorem act_mem_orbitCodes_iff (D : Name.NameDomain s) (W : ZFSet.{u}) (g : G) (σ : Name s) : - (a.act s g σ).val ∈ a.orbitCodes s D W ↔ σ.val ∈ a.orbitCodes s D W := by - rw [a.mem_orbitCodes, a.mem_orbitCodes] - constructor - · rintro ⟨h, τ, hτ, hW, eq⟩ - have names : a.act s g σ = a.act s h τ := Subtype.ext eq - refine ⟨g⁻¹ * h, τ, hτ, hW, ?_⟩ - rw [a.act_mul, ← names, a.act_inv_left] - · rintro ⟨h, τ, hτ, hW, eq⟩ - have names : σ = a.act s h τ := Subtype.ext eq - refine ⟨g * h, τ, hτ, hW, ?_⟩ - rw [names, a.act_mul] - -theorem orbitCodedPower_hs [OrderTop P] (D : Name.NameDomain s) (F : NormalSubgroupFamily G) - (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) (W : ZFSet.{u}) : - HereditarilySymmetric a s F (Name.codedPower (a.symmetricDomain s D F) (a.orbitCodes s D W)) := by - let E := a.symmetricDomain s D F - refine HereditarilySymmetric.mk (F.upward F.top ?_) ?_ - · intro g _ - apply a.act_codedPower_fixed s E (fun h _ hx => a.symmetricDomain_translated s D F closed h hx) - (a.orbitCodes s D W) g - exact fun σ _ => a.act_mem_orbitCodes_iff s D W g σ - · intro σ p entry - exact ((Name.entry_codedPower E (a.orbitCodes s D W) σ p).1 entry).1.2 - -end PartitionPilot.Forcing.PosetAction - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FormulaSymmetry +import OAI.SetTheory.PartitionPrinciple.Forcing.NameMixingRanks + +namespace OAI + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps SetFormula +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem separationPredicate_act (D : Name.NameDomain s) + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (g : G) {n : Nat} (φ : SetFormula (n + 1)) (env : Assignment D n) (σ : Name s) (p : P) : + Name.separationPredicate D φ (a.actAssignment s D closed g env) (a.act s g σ) (a.iso g p) ↔ + Name.separationPredicate D φ env σ p := by + constructor + · rintro ⟨movedMem, forced⟩ + have oldMem : σ ∈ D.names := by + have h := closed g⁻¹ (a.act s g σ) movedMem + simpa only [a.act_inv_left] using h + refine ⟨oldMem, (a.formula_forces_act_iff s D closed g φ (extend ⟨σ, oldMem⟩ env) p).1 ?_⟩ + rw [a.actAssignment_extend] + exact forced + · rintro ⟨hσ, forced⟩ + refine ⟨closed g σ hσ, ?_⟩ + have h := (a.formula_forces_act_iff s D closed g φ (extend ⟨σ, hσ⟩ env) p).2 forced + rw [a.actAssignment_extend] at h + exact h + +theorem act_separationName (D : Name.NameDomain s) + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (g : G) {n : Nat} (φ : SetFormula (n + 1)) (env : Assignment D n) (τ : Name s) : + a.act s g (Name.separationName D φ env τ) = + Name.separationName D φ (a.actAssignment s D closed g env) (a.act s g τ) := + a.act_selectName s g (Name.separationPredicate D φ env) + (Name.separationPredicate D φ (a.actAssignment s D closed g env)) + (a.separationPredicate_act s D closed g φ env) τ + +theorem separationName_hs (D : Name.NameDomain s) + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (F : NormalSubgroupFamily G) {n : Nat} (φ : SetFormula (n + 1)) + (env : Assignment D n) {τ : Name s} (hτ : HereditarilySymmetric a s F τ) + (params : ∀ i, HereditarilySymmetric a s F (env i).val) : + HereditarilySymmetric a s F (Name.separationName D φ env τ) := by + let K := a.stabilizer s τ ⊓ ⨅ i, a.stabilizer s (env i).val + have hK : F.mem K := F.inf hτ.symmetric + (F.fin_iInf (fun i => a.stabilizer s (env i).val) (fun i => (params i).symmetric)) + refine HereditarilySymmetric.mk (F.upward hK ?_) ?_ + · intro g hg + have fixedτ : a.act s g τ = τ := hg.1 + have fixedEnv : a.actAssignment s D closed g env = env := by + funext i + apply Subtype.ext + exact (iInf_le (fun j => a.stabilizer s (env j).val) i) hg.2 + change a.act s g (Name.separationName D φ env τ) = Name.separationName D φ env τ + rw [a.act_separationName s D closed, fixedτ, fixedEnv] + · intro σ p entry + obtain ⟨r, old, _, _⟩ := (Name.entry_separationName D φ env τ σ p).1 entry + exact hτ.member old + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +def symmetricDomain (D : Name.NameDomain s) (F : NormalSubgroupFamily G) : Name.NameDomain s where + names := {τ | τ ∈ D.names ∧ HereditarilySymmetric a s F τ} + children h entry := ⟨D.children h.1 entry, h.2.member entry⟩ + +theorem symmetricDomain_translated (D : Name.NameDomain s) (F : NormalSubgroupFamily G) + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (g : G) {τ : Name s} (hτ : τ ∈ (a.symmetricDomain s D F).names) : + a.act s g τ ∈ (a.symmetricDomain s D F).names := + ⟨closed g τ hτ.1, hτ.2.translated g⟩ + +theorem symmetricDomain_mix [Small.{u} G] (D : Name.NameDomain s) (F : NormalSubgroupFamily G) + (K : Subgroup G) (hK : F.mem K) (p : P) + (closed : ∀ τ ∈ D.names, a.mix s K p τ ∈ D.names) + {τ : Name s} (hτ : τ ∈ (a.symmetricDomain s D F).names) : + a.mix s K p τ ∈ (a.symmetricDomain s D F).names := + ⟨closed τ hτ.1, a.mix_hs s F K hK p hτ.2⟩ + +theorem mem_symmetric_values (D : Name.NameDomain s) (F : NormalSubgroupFamily G) + (H : Set P) (x : ZFSet.{u}) : + x ∈ (a.symmetricDomain s D F).values H ↔ + ∃ τ ∈ D.names, HereditarilySymmetric a s F τ ∧ Name.eval H τ = x := by + rw [Name.NameDomain.mem_values] + constructor + · rintro ⟨τ, ⟨hτ, hs⟩, eq⟩ + exact ⟨τ, hτ, hs, eq⟩ + · rintro ⟨τ, hτ, hs, eq⟩ + exact ⟨τ, ⟨hτ, hs⟩, eq⟩ + +end PartitionPilot.Forcing.PosetAction + + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +def BoundedNames (D : NameDomain s) (W : ZFSet.{u}) := {σ : D.names // σ.val.val ∈ W} + +instance boundedNames_small (D : NameDomain s) (W : ZFSet.{u}) : Small.{u} (BoundedNames D W) := by + let f : BoundedNames D W → W := fun σ => ⟨σ.val.val.val, σ.property⟩ + apply small_of_injective.{u} (f := f) + intro σ τ eq + have raw : σ.val.val.val = τ.val.val.val := congrArg (fun z : W => z.val) eq + exact Subtype.ext (Subtype.ext (Subtype.ext raw)) + +noncomputable def codedPower [OrderTop P] (D : NameDomain s) (W : ZFSet.{u}) : Name s := + assemble (fun σ : BoundedNames D W => σ.val.val) (fun _ => ⊤) + +theorem entry_codedPower [OrderTop P] (D : NameDomain s) (W : ZFSet.{u}) (σ : Name s) (p : P) : + Entry σ (codedPower D W) p ↔ σ ∈ D.names ∧ σ.val ∈ W ∧ p = ⊤ := by + rw [codedPower, entry_assemble] + constructor + · rintro ⟨i, rfl, rfl⟩ + exact ⟨i.val.property, i.property, rfl⟩ + · rintro ⟨hσ, hW, rfl⟩ + exact ⟨⟨⟨σ, hσ⟩, hW⟩, rfl, rfl⟩ + +theorem mem_eval_codedPower [OrderTop P] (D : NameDomain s) (W : ZFSet.{u}) + (H : ConditionFilter P) (x : ZFSet.{u}) : + x ∈ eval {p | H.mem p} (codedPower D W) ↔ + ∃ σ ∈ D.names, σ.val ∈ W ∧ eval {p | H.mem p} σ = x := by + rw [mem_eval] + constructor + · rintro ⟨σ, p, entry, _, eq⟩ + obtain ⟨hσ, hW, _⟩ := (entry_codedPower D W σ p).1 entry + exact ⟨σ, hσ, hW, eq⟩ + · rintro ⟨σ, hσ, hW, eq⟩ + exact ⟨σ, ⊤, (entry_codedPower D W σ ⊤).2 ⟨hσ, hW, rfl⟩, H.top_mem, eq⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem act_codedPower_fixed (D : Name.NameDomain s) + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (W : ZFSet.{u}) (g : G) + (invariant : ∀ σ ∈ D.names, (a.act s g σ).val ∈ W ↔ σ.val ∈ W) : + a.act s g (Name.codedPower D W) = Name.codedPower D W := by + apply Name.ext + intro σ p + obtain ⟨σ, rfl⟩ := (a.nameEquiv s g).surjective σ + obtain ⟨p, rfl⟩ := (a.iso g).surjective p + change Name.Entry (a.act s g σ) (a.act s g (Name.codedPower D W)) (a.iso g p) ↔ _ + rw [a.entry_act, Name.entry_codedPower, Name.entry_codedPower] + constructor + · rintro ⟨hσ, hW, rfl⟩ + exact ⟨closed g σ hσ, (invariant σ hσ).2 hW, (a.iso g).map_top⟩ + · rintro ⟨hσ, hW, hp⟩ + have old : σ ∈ D.names := by + have h := closed g⁻¹ (a.act s g σ) hσ + simpa only [a.act_inv_left] using h + exact ⟨old, (invariant σ old).1 hW, (a.iso g).injective (hp.trans (a.iso g).map_top.symm)⟩ + +theorem codedPower_hs (D : Name.NameDomain s) (F : NormalSubgroupFamily G) + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (W : ZFSet.{u}) (τ : Name s) (hτ : HereditarilySymmetric a s F τ) + (bounded : ∀ σ ∈ (a.symmetricDomain s D F).names, σ.val ∈ W ↔ σ.val ⊆ τ.val) : + HereditarilySymmetric a s F (Name.codedPower (a.symmetricDomain s D F) W) := by + let E := a.symmetricDomain s D F + have moved : ∀ g σ, σ ∈ E.names → a.act s g σ ∈ E.names := + fun g _ h => a.symmetricDomain_translated s D F closed g h + refine HereditarilySymmetric.mk (F.upward hτ.symmetric ?_) ?_ + · intro g hg + apply a.act_codedPower_fixed s E moved W g + intro σ hσ + rw [bounded _ (moved g σ hσ), bounded σ hσ] + exact a.act_subset_iff_fixed s g hg + · intro σ p entry + exact ((Name.entry_codedPower E W σ p).1 entry).1.2 + +end PartitionPilot.Forcing.PosetAction + +end + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps SetFormula +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) +variable (D : Name.NameDomain s) (F : NormalSubgroupFamily G) + +theorem symmetricDomain_nonempty (nonempty : D.names.Nonempty) : + (a.symmetricDomain s D F).names.Nonempty := + ⟨Name.empty s, D.empty_mem nonempty, a.empty_hs s F⟩ + +theorem symmetric_values_pair [OrderTop P] + (pairs : ∀ σ ∈ D.names, ∀ τ ∈ D.names, Name.unorderedPair ⊤ σ τ ∈ D.names) + (H : ConditionFilter P) {x y : ZFSet.{u}} + (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) + (hy : y ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : + ({x, y} : ZFSet.{u}) ∈ (a.symmetricDomain s D F).values {p | H.mem p} := by + obtain ⟨σ, hσ, symσ, rfl⟩ := (a.mem_symmetric_values s D F _ x).1 hx + obtain ⟨τ, hτ, symτ, rfl⟩ := (a.mem_symmetric_values s D F _ y).1 hy + exact (a.mem_symmetric_values s D F _ _).2 + ⟨Name.unorderedPair ⊤ σ τ, pairs σ hσ τ hτ, symσ.unorderedPair symτ, + Name.eval_unorderedPair _ ⊤ H.top_mem σ τ⟩ + +theorem symmetric_values_union + (unions : ∀ τ ∈ D.names, Name.unionName τ ∈ D.names) + (H : ConditionFilter P) {x : ZFSet.{u}} + (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : + ZFSet.sUnion x ∈ (a.symmetricDomain s D F).values {p | H.mem p} := by + obtain ⟨τ, hτ, symτ, rfl⟩ := (a.mem_symmetric_values s D F _ x).1 hx + exact (a.mem_symmetric_values s D F _ _).2 + ⟨Name.unionName τ, unions τ hτ, a.unionName_hs s F symτ, Name.eval_unionName H τ⟩ + +theorem symmetric_values_separation + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s D F))) + {n : Nat} (φ : SetFormula (n + 1)) (env : Assignment (a.symmetricDomain s D F) n) + (separated : ∀ τ ∈ (a.symmetricDomain s D F).names, + Name.separationName (a.symmetricDomain s D F) φ env τ ∈ D.names) + {x : ZFSet.{u}} (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : + ZFSet.sep (fun z => Realize ((a.symmetricDomain s D F).values {p | H.mem p}) φ + (extend z (evalAssignment {p | H.mem p} env))) x ∈ + (a.symmetricDomain s D F).values {p | H.mem p} := by + obtain ⟨τ, hτ, rfl⟩ := ((a.symmetricDomain s D F).mem_values _ x).1 hx + refine (a.mem_symmetric_values s D F _ _).2 + ⟨Name.separationName (a.symmetricDomain s D F) φ env τ, separated τ hτ, ?_, ?_⟩ + · exact a.separationName_hs s (a.symmetricDomain s D F) + (fun g _ h => a.symmetricDomain_translated s D F closed g h) F φ env hτ.2 + (fun i => (env i).property.2) + · exact Name.eval_separationName (a.symmetricDomain s D F) H generic φ env hτ + +theorem symmetric_values_separation_params + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s D F))) + {n : Nat} (φ : SetFormula (n + 1)) + (separated : ∀ (env : Assignment (a.symmetricDomain s D F) n) + τ, τ ∈ (a.symmetricDomain s D F).names → + Name.separationName (a.symmetricDomain s D F) φ env τ ∈ D.names) + (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ (a.symmetricDomain s D F).values {p | H.mem p}) + {x : ZFSet.{u}} (hx : x ∈ (a.symmetricDomain s D F).values {p | H.mem p}) : + ZFSet.sep (fun z => Realize ((a.symmetricDomain s D F).values {p | H.mem p}) φ + (extend z params)) x ∈ (a.symmetricDomain s D F).values {p | H.mem p} := by + classical + have reps := fun i => ((a.symmetricDomain s D F).mem_values _ (params i)).1 (members i) + choose names inDomain values using reps + let env : Assignment (a.symmetricDomain s D F) n := fun i => ⟨names i, inDomain i⟩ + have evals : evalAssignment {p | H.mem p} env = params := funext values + have h := a.symmetric_values_separation s D F closed H generic φ env (separated env) hx + rw [evals] at h + exact h + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u +variable {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +noncomputable def orbitCodes (D : Name.NameDomain s) (W : ZFSet.{u}) : ZFSet.{u} := + ZFSet.range (fun i : G × Name.BoundedNames D W => (a.act s i.1 i.2.val.val).val) + +theorem mem_orbitCodes (D : Name.NameDomain s) (W y : ZFSet.{u}) : + y ∈ a.orbitCodes s D W ↔ ∃ g σ, σ ∈ D.names ∧ σ.val ∈ W ∧ y = (a.act s g σ).val := by + rw [orbitCodes, ZFSet.mem_range] + constructor + · rintro ⟨⟨g, σ⟩, eq⟩ + exact ⟨g, σ.val.val, σ.val.property, σ.property, eq.symm⟩ + · rintro ⟨g, σ, hσ, hW, eq⟩ + exact ⟨(g, ⟨⟨σ, hσ⟩, hW⟩), eq.symm⟩ + +theorem mem_orbitCodes_of_mem (D : Name.NameDomain s) {W : ZFSet.{u}} {σ : Name s} + (hσ : σ ∈ D.names) (hW : σ.val ∈ W) : σ.val ∈ a.orbitCodes s D W := by + exact (a.mem_orbitCodes s D W σ.val).2 ⟨1, σ, hσ, hW, congrArg Subtype.val (a.act_one s σ).symm⟩ + +theorem act_mem_orbitCodes_iff (D : Name.NameDomain s) (W : ZFSet.{u}) (g : G) (σ : Name s) : + (a.act s g σ).val ∈ a.orbitCodes s D W ↔ σ.val ∈ a.orbitCodes s D W := by + rw [a.mem_orbitCodes, a.mem_orbitCodes] + constructor + · rintro ⟨h, τ, hτ, hW, eq⟩ + have names : a.act s g σ = a.act s h τ := Subtype.ext eq + refine ⟨g⁻¹ * h, τ, hτ, hW, ?_⟩ + rw [a.act_mul, ← names, a.act_inv_left] + · rintro ⟨h, τ, hτ, hW, eq⟩ + have names : σ = a.act s h τ := Subtype.ext eq + refine ⟨g * h, τ, hτ, hW, ?_⟩ + rw [names, a.act_mul] + +theorem orbitCodedPower_hs [OrderTop P] (D : Name.NameDomain s) (F : NormalSubgroupFamily G) + (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) (W : ZFSet.{u}) : + HereditarilySymmetric a s F (Name.codedPower (a.symmetricDomain s D F) (a.orbitCodes s D W)) := by + let E := a.symmetricDomain s D F + refine HereditarilySymmetric.mk (F.upward F.top ?_) ?_ + · intro g _ + apply a.act_codedPower_fixed s E (fun h _ hx => a.symmetricDomain_translated s D F closed h hx) + (a.orbitCodes s D W) g + exact fun σ _ => a.act_mem_orbitCodes_iff s D W g σ + · intro σ p entry + exact ((Name.entry_codedPower E (a.orbitCodes s D W) σ p).1 entry).1.2 + +end PartitionPilot.Forcing.PosetAction + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NamePresentationEquivalences.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NamePresentationEquivalences.lean index c38eddda9d38a209d535f95a31c822a6ee436efc..565679136003dc537e1a34ea882f6f2812f11938 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NamePresentationEquivalences.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NamePresentationEquivalences.lean @@ -1,118 +1,118 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.NaturalSetCodes - -namespace OAI - -section - -namespace PartitionPilot.SetRealization.Presentation -universe u -variable {P : Type u} (s : Presentation P) - -noncomputable def intoSet (B : ZFSet.{u}) (sub : s.carrier ⊆ B) : P → SetMembers B := - fun p => SetMembers.ofMem (s.encode p) (sub (s.encode_mem p)) - -theorem encode_intoSet (B : ZFSet.{u}) (sub : s.carrier ⊆ B) (p : P) : - (SetMembers.presentation B).encode (s.intoSet B sub p) = s.encode p := - SetMembers.raw_ofMem _ _ - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P Q : Type u} {s : Presentation P} - -theorem rename_val_of_encode (t : Presentation Q) (f : P → Q) - (codes : ∀ p, t.encode (f p) = s.encode p) (τ : Name s) : - (rename t f τ).val = τ.val := by - induction τ using inductionOn with - | step τ ih => - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨ρ, q, rfl⟩ := entries_cover (rename t f τ) hz - obtain ⟨σ, p, entry, rfl, rfl⟩ := (entry_rename t f τ ρ q).1 hz - rw [ih σ p entry, codes p] - exact entry - · intro hz - obtain ⟨σ, p, rfl⟩ := entries_cover τ hz - have entry := (entry_rename t f τ (rename t f σ) (f p)).2 ⟨σ, p, hz, rfl, rfl⟩ - change ZFSet.pair (rename t f σ).val (t.encode (f p)) ∈ (rename t f τ).val at entry - simpa only [ih σ p hz, codes p] using entry - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P : Type u} (s t : Presentation P) - -noncomputable def presentationEquiv : Name s ≃ Name t where - toFun := rename t id - invFun := rename s id - left_inv τ := by rw [rename_comp]; exact rename_id τ - right_inv τ := by rw [rename_comp]; exact rename_id τ - -theorem eval_presentationEquiv (H : Set P) (τ : Name s) : - eval H (presentationEquiv s t τ) = eval H τ := - eval_rename t id H τ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.PosetAction -open SetRealization -universe u v -variable {P : Type u} {G : Type v} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s t : Presentation P) - -theorem act_presentationEquiv (g : G) (τ : Name s) : - a.act t g (Name.presentationEquiv s t τ) = Name.presentationEquiv s t (a.act s g τ) := by - change Name.rename t (a.iso g) (Name.rename t id τ) = - Name.rename t id (Name.rename s (a.iso g) τ) - rw [Name.rename_comp, Name.rename_comp] - rfl - -theorem stabilizer_presentationEquiv (τ : Name s) : - a.stabilizer t (Name.presentationEquiv s t τ) = a.stabilizer s τ := by - apply Subgroup.ext - intro g - change a.act t g (Name.presentationEquiv s t τ) = Name.presentationEquiv s t τ ↔ a.act s g τ = τ - rw [a.act_presentationEquiv] - exact (Name.presentationEquiv s t).injective.eq_iff - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.HereditarilySymmetric -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} {G : Type v} [Group G] [PartialOrder P] -variable {a : PosetAction G P} {s : Presentation P} {F : NormalSubgroupFamily G} - -theorem presentationEquiv (t : Presentation P) {τ : Name s} - (hs : HereditarilySymmetric a s F τ) : - HereditarilySymmetric a t F (Name.presentationEquiv s t τ) := by - induction τ using Name.inductionOn with - | step τ ih => - refine .mk ?_ ?_ - · rw [a.stabilizer_presentationEquiv] - exact hs.symmetric - · intro ν p entry - obtain ⟨σ, q, old, rfl, _⟩ := (Name.entry_rename t id τ ν p).1 entry - exact ih σ q old (hs.member old) - -theorem presentationEquiv_iff (t : Presentation P) (τ : Name s) : - HereditarilySymmetric a t F (Name.presentationEquiv s t τ) ↔ HereditarilySymmetric a s F τ := by - constructor - · intro h - have back := h.presentationEquiv s - exact (Name.presentationEquiv s t).symm_apply_apply τ ▸ back - · exact fun h => h.presentationEquiv t - -end PartitionPilot.Forcing.HereditarilySymmetric - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.NaturalSetCodes + +namespace OAI + +section + +namespace PartitionPilot.SetRealization.Presentation +universe u +variable {P : Type u} (s : Presentation P) + +noncomputable def intoSet (B : ZFSet.{u}) (sub : s.carrier ⊆ B) : P → SetMembers B := + fun p => SetMembers.ofMem (s.encode p) (sub (s.encode_mem p)) + +theorem encode_intoSet (B : ZFSet.{u}) (sub : s.carrier ⊆ B) (p : P) : + (SetMembers.presentation B).encode (s.intoSet B sub p) = s.encode p := + SetMembers.raw_ofMem _ _ + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P Q : Type u} {s : Presentation P} + +theorem rename_val_of_encode (t : Presentation Q) (f : P → Q) + (codes : ∀ p, t.encode (f p) = s.encode p) (τ : Name s) : + (rename t f τ).val = τ.val := by + induction τ using inductionOn with + | step τ ih => + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨ρ, q, rfl⟩ := entries_cover (rename t f τ) hz + obtain ⟨σ, p, entry, rfl, rfl⟩ := (entry_rename t f τ ρ q).1 hz + rw [ih σ p entry, codes p] + exact entry + · intro hz + obtain ⟨σ, p, rfl⟩ := entries_cover τ hz + have entry := (entry_rename t f τ (rename t f σ) (f p)).2 ⟨σ, p, hz, rfl, rfl⟩ + change ZFSet.pair (rename t f σ).val (t.encode (f p)) ∈ (rename t f τ).val at entry + simpa only [ih σ p hz, codes p] using entry + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P : Type u} (s t : Presentation P) + +noncomputable def presentationEquiv : Name s ≃ Name t where + toFun := rename t id + invFun := rename s id + left_inv τ := by rw [rename_comp]; exact rename_id τ + right_inv τ := by rw [rename_comp]; exact rename_id τ + +theorem eval_presentationEquiv (H : Set P) (τ : Name s) : + eval H (presentationEquiv s t τ) = eval H τ := + eval_rename t id H τ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.PosetAction +open SetRealization +universe u v +variable {P : Type u} {G : Type v} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s t : Presentation P) + +theorem act_presentationEquiv (g : G) (τ : Name s) : + a.act t g (Name.presentationEquiv s t τ) = Name.presentationEquiv s t (a.act s g τ) := by + change Name.rename t (a.iso g) (Name.rename t id τ) = + Name.rename t id (Name.rename s (a.iso g) τ) + rw [Name.rename_comp, Name.rename_comp] + rfl + +theorem stabilizer_presentationEquiv (τ : Name s) : + a.stabilizer t (Name.presentationEquiv s t τ) = a.stabilizer s τ := by + apply Subgroup.ext + intro g + change a.act t g (Name.presentationEquiv s t τ) = Name.presentationEquiv s t τ ↔ a.act s g τ = τ + rw [a.act_presentationEquiv] + exact (Name.presentationEquiv s t).injective.eq_iff + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.HereditarilySymmetric +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} {G : Type v} [Group G] [PartialOrder P] +variable {a : PosetAction G P} {s : Presentation P} {F : NormalSubgroupFamily G} + +theorem presentationEquiv (t : Presentation P) {τ : Name s} + (hs : HereditarilySymmetric a s F τ) : + HereditarilySymmetric a t F (Name.presentationEquiv s t τ) := by + induction τ using Name.inductionOn with + | step τ ih => + refine .mk ?_ ?_ + · rw [a.stabilizer_presentationEquiv] + exact hs.symmetric + · intro ν p entry + obtain ⟨σ, q, old, rfl, _⟩ := (Name.entry_rename t id τ ν p).1 entry + exact ih σ q old (hs.member old) + +theorem presentationEquiv_iff (t : Presentation P) (τ : Name s) : + HereditarilySymmetric a t F (Name.presentationEquiv s t τ) ↔ HereditarilySymmetric a s F τ := by + constructor + · intro h + have back := h.presentationEquiv s + exact (Name.presentationEquiv s t).symm_apply_apply τ ▸ back + · exact fun h => h.presentationEquiv t + +end PartitionPilot.Forcing.HereditarilySymmetric + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameRenameSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameRenameSteps.lean index 6b3173c94424a788b053be2e9c39d1ee4889a183..0bb57fc8a707328418f41a1178fbf7d0e927d9b4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameRenameSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NameRenameSteps.lean @@ -1,375 +1,375 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.UniformGroundNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def ordinaryGroundPrimitives {k : Nat} (c o : Fin k) : ForcingPrimitives k := - withGroundEquality c o (liftedNameFormula c) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_ordinaryGroundForcing - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k n m : Nat} (c o : Fin k) (φ : SetFormula n) - (params : Fin k → Fin m) (pi : Fin m) (names : Fin n → Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (p : P) (nameEnv : Assignment (M.nameDomain s) n) (hp : env pi = s.encode p) - (hnames : ∀ i, env (names i) = (nameEnv i).val.val) : - Realize M.sets (forcingTranslation (ordinaryGroundPrimitives c o) φ params pi names) env ↔ - Forces (M.nameDomain s) φ nameEnv p := - M.realize_forcingWithGroundEquality s (M.nameDomain s) (fun _ h => h) pairing unions powers - separation collection carrier order c o (liftedNameFormula c) φ params pi names env hc ho - (M.domainMeaning_liftedNames s pairing unions powers separation collection carrier c _ hc) - p nameEnv hp hnames - -theorem ordinaryForcingSet_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {n : Nat} (φ : SetFormula n) (nameEnv : Assignment (M.nameDomain s) n) : - s.subset (fun p => Forces (M.nameDomain s) φ nameEnv p) ∈ M.sets := by - let context := extend s.carrier (extend s.conditionOrder (fun i => (nameEnv i).val.val)) - let params : Fin 2 → Fin (n + 2) := extend 0 (extend 1 Fin.elim0) - have members : ∀ i, context i ∈ M.sets := - Fin.cases carrier (Fin.cases order (fun i => (nameEnv i).property)) - apply M.forcingSet_mem_withGroundEquality s (M.nameDomain s) (fun _ h => h) pairing unions powers - separation collection carrier order 0 1 (liftedNameFormula 0) φ params (fun i => i.succ.succ) - context members rfl rfl - · exact M.domainMeaning_liftedNames s pairing unions powers separation collection carrier 0 _ rfl - · exact fun _ => rfl - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.SetFormula - -def candidateForcingFormula {n : Nat} (phi : SetFormula (n + 1)) : SetFormula (n + 4) := - ex (.conj (.mem 0 2) - (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) phi - (extend 3 (extend 4 Fin.elim0)) 1 - (extend 0 (fun i => i.succ.succ.succ.succ.succ)))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -include pairing unions powers separation collection carrier order - -theorem realize_candidateForcingFormula {n : Nat} (phi : SetFormula (n + 1)) - (env : Assignment (M.nameDomain s) n) (W : ZFSet.{u}) - (valid : ∀ z ∈ W, IsName s z) (p : P) : - Realize M.sets (candidateForcingFormula phi) - (extend (s.encode p) (extend W (extend s.carrier - (extend s.conditionOrder (fun i => (env i).val.val))))) ↔ - ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ - Forces (M.nameDomain s) phi (extend tau env) p := by - let params := extend (s.encode p) (extend W (extend s.carrier - (extend s.conditionOrder (fun i => (env i).val.val)))) - change Realize M.sets (candidateForcingFormula phi) params ↔ _ - rw [candidateForcingFormula, realize_ex] - constructor - · rintro ⟨z, hz, member, forced⟩ - change z ∈ W at member - let tau : (M.nameDomain s).names := ⟨⟨z, valid z member⟩, hz⟩ - refine ⟨tau, member, ?_⟩ - exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection - carrier order 0 1 phi (extend 3 (extend 4 Fin.elim0)) 1 - (extend 0 (fun i => i.succ.succ.succ.succ.succ)) (extend z params) - rfl rfl p (extend tau env) rfl (Fin.cases rfl (fun _ => rfl))).1 forced - · rintro ⟨tau, member, forced⟩ - refine ⟨tau.val.val, tau.property, member, ?_⟩ - exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection - carrier order 0 1 phi (extend 3 (extend 4 Fin.elim0)) 1 - (extend 0 (fun i => i.succ.succ.succ.succ.succ)) (extend tau.val.val params) - rfl rfl p (extend tau env) rfl (Fin.cases rfl (fun _ => rfl))).2 forced - -theorem candidateForcingSet_mem {n : Nat} (phi : SetFormula (n + 1)) - (env : Assignment (M.nameDomain s) n) (W : ZFSet.{u}) (ground : W ∈ M.sets) - (valid : ∀ z ∈ W, IsName s z) : - s.subset (fun p => ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ - Forces (M.nameDomain s) phi (extend tau env) p) ∈ M.sets := by - let params := extend W (extend s.carrier (extend s.conditionOrder (fun i => (env i).val.val))) - have equal : s.subset (fun p => ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ - Forces (M.nameDomain s) phi (extend tau env) p) = - ZFSet.sep (fun z => Realize M.sets (candidateForcingFormula phi) (extend z params)) s.carrier := by - apply ZFSet.ext - intro z - rw [s.mem_subset, ZFSet.mem_sep] - constructor - · rintro ⟨p, forced, rfl⟩ - exact ⟨s.encode_mem p, (M.realize_candidateForcingFormula s pairing unions powers separation - collection carrier order phi env W valid p).2 forced⟩ - · rintro ⟨member, truth⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 member - exact ⟨p, (M.realize_candidateForcingFormula s pairing unions powers separation collection - carrier order phi env W valid p).1 truth, rfl⟩ - rw [equal] - exact M.separation_mem separation (candidateForcingFormula phi) params - (Fin.cases ground (Fin.cases carrier (Fin.cases order (fun i => (env i).property)))) carrier - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -def RenameStep (f : P → P) (R : Name s → Name s → Prop) (σ τ : Name s) : Prop := - (∀ ν p, Entry ν σ p → ∃ ρ, Entry ρ τ (f p) ∧ R ν ρ) ∧ - (∀ ρ q, Entry ρ τ q → ∃ ν p, Entry ν σ p ∧ f p = q ∧ R ν ρ) - -theorem rename_eq_step (f : P → P) (σ τ : Name s) : - rename s f σ = τ ↔ RenameStep f (fun ν ρ => rename s f ν = ρ) σ τ := by - constructor - · intro eq - constructor - · intro ν p entry - refine ⟨rename s f ν, ?_, rfl⟩ - rw [← eq, entry_rename] - exact ⟨ν, p, entry, rfl, rfl⟩ - · intro ρ q entry - rw [← eq, entry_rename] at entry - obtain ⟨ν, p, old, image, condition⟩ := entry - exact ⟨ν, p, old, condition, image⟩ - · rintro ⟨left, right⟩ - apply ext - intro ρ q - rw [entry_rename] - constructor - · rintro ⟨ν, p, entry, image, condition⟩ - obtain ⟨χ, matched, hχ⟩ := left ν p entry - have eq : χ = ρ := hχ.symm.trans image - simpa only [eq, condition] using matched - · intro entry - obtain ⟨ν, p, old, condition, image⟩ := right ρ q entry - exact ⟨ν, p, old, image, condition⟩ - -theorem rename_postfixed_sound (D : NameDomain s) (f : P → P) (R : Name s → Name s → Prop) - (post : ∀ σ ∈ D.names, ∀ τ ∈ D.names, R σ τ → RenameStep f R σ τ) : - ∀ σ ∈ D.names, ∀ τ ∈ D.names, R σ τ → rename s f σ = τ := by - intro σ - induction σ using inductionOn with - | step σ ih => - intro hσ τ hτ rel - obtain ⟨left, right⟩ := post σ hσ τ hτ rel - apply (rename_eq_step f σ τ).2 - constructor - · intro ν p entry - obtain ⟨ρ, matched, child⟩ := left ν p entry - exact ⟨ρ, matched, ih ν p entry (D.children hσ entry) ρ (D.children hτ matched) child⟩ - · intro ρ q entry - obtain ⟨ν, p, old, condition, child⟩ := right ρ q entry - exact ⟨ν, p, old, condition, ih ν p old (D.children hσ old) ρ (D.children hτ entry) child⟩ - -theorem rename_prefixed_complete (D : NameDomain s) (f : P → P) (R : Name s → Name s → Prop) - (pre : ∀ σ ∈ D.names, ∀ τ ∈ D.names, RenameStep f R σ τ → R σ τ) : - ∀ σ ∈ D.names, ∀ τ ∈ D.names, rename s f σ = τ → R σ τ := by - intro σ - induction σ using inductionOn with - | step σ ih => - intro hσ τ hτ eq - obtain ⟨left, right⟩ := (rename_eq_step f σ τ).1 eq - apply pre σ hσ τ hτ - constructor - · intro ν p entry - obtain ⟨ρ, matched, child⟩ := left ν p entry - exact ⟨ρ, matched, ih ν p entry (D.children hσ entry) ρ (D.children hτ matched) child⟩ - · intro ρ q entry - obtain ⟨ν, p, old, condition, child⟩ := right ρ q entry - exact ⟨ν, p, old, condition, ih ν p old (D.children hσ old) ρ (D.children hτ entry) child⟩ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace SetFormula - -def ordinaryEqualityDecisionFormula {n : Nat} - (carrier order condition sigma tau : Fin n) : SetFormula n := - disj - (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.equal 0 1) - (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) - (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.neg (.equal 0 1)) - (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def ordinaryEqualityDecisions (Q order sigma tau : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun p => Realize M.sets (ordinaryEqualityDecisionFormula 1 2 0 3 4) - (extend p ![Q, order, sigma, tau])) Q - -theorem ordinaryEqualityDecisions_subset (Q order sigma tau : ZFSet.{u}) : - M.ordinaryEqualityDecisions Q order sigma tau ⊆ Q := - fun _ h => (ZFSet.mem_sep.1 h).1 - -variable {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_ordinaryEqualityDecisionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {n : Nat} (ci oi pi si ti : Fin n) (env : Fin n → ZFSet.{u}) - (sigma tau : (M.nameDomain s).names) (p : P) - (hc : env ci = s.carrier) (ho : env oi = s.conditionOrder) - (hp : env pi = s.encode p) (hs : env si = sigma.val.val) (ht : env ti = tau.val.val) : - Realize M.sets (ordinaryEqualityDecisionFormula ci oi pi si ti) env ↔ - Name.ForcesEq p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesEq q sigma.val tau.val := by - rw [ordinaryEqualityDecisionFormula, realize_disj] - let names : Assignment (M.nameDomain s) 2 := extend sigma (extend tau Fin.elim0) - have meaning (phi : SetFormula 2) := M.realize_ordinaryGroundForcing s pairing unions powers - separation collection carrier order (0 : Fin 2) 1 phi (extend ci (extend oi Fin.elim0)) pi - (extend si (extend ti Fin.elim0)) env hc ho p names hp - (Fin.cases hs (Fin.cases ht (fun i => Fin.elim0 i))) - exact or_congr (meaning (.equal 0 1)) (meaning (.neg (.equal 0 1))) - -theorem ordinaryEqualityDecisions_entry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (sigma tau : (M.nameDomain s).names) (p : P) : - s.encode p ∈ M.ordinaryEqualityDecisions s.carrier s.conditionOrder sigma.val.val tau.val.val ↔ - Name.ForcesEq p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesEq q sigma.val tau.val := by - rw [ordinaryEqualityDecisions, ZFSet.mem_sep, and_iff_right (s.encode_mem p)] - exact M.realize_ordinaryEqualityDecisionFormula s pairing unions powers separation collection - carrier order 1 2 0 3 4 _ sigma tau p rfl rfl rfl rfl rfl - -theorem ordinaryEqualityDecisions_dense - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (sigma tau : (M.nameDomain s).names) : - ∀ p ∈ s.carrier, ∃ q ∈ M.ordinaryEqualityDecisions s.carrier s.conditionOrder - sigma.val.val tau.val.val, ZFSet.pair q p ∈ s.conditionOrder := by - intro z hz - obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz - obtain ⟨q, below, decided⟩ := decisionWitness_dense (M.nameDomain s) (.equal 0 1) - (extend sigma (extend tau Fin.elim0)) p - exact ⟨s.encode q, - (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection carrier order - sigma tau q).2 decided, (s.pair_mem_conditionOrder q p).2 below⟩ - -end TransitiveGround - - - - -namespace SetFormula - -def ordinaryMembershipDecisionFormula {n : Nat} - (carrier order condition sigma tau : Fin n) : SetFormula n := - disj - (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.mem 0 1) - (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) - (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.neg (.mem 0 1)) - (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def ordinaryMembershipDecisions (Q order sigma tau : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun p => Realize M.sets (ordinaryMembershipDecisionFormula 1 2 0 3 4) - (extend p ![Q, order, sigma, tau])) Q - -theorem ordinaryMembershipDecisions_subset (Q order sigma tau : ZFSet.{u}) : - M.ordinaryMembershipDecisions Q order sigma tau ⊆ Q := - fun _ h => (ZFSet.mem_sep.1 h).1 - -variable {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_ordinaryMembershipDecisionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {n : Nat} (ci oi pi si ti : Fin n) (env : Fin n → ZFSet.{u}) - (sigma tau : (M.nameDomain s).names) (p : P) - (hc : env ci = s.carrier) (ho : env oi = s.conditionOrder) - (hp : env pi = s.encode p) (hs : env si = sigma.val.val) (ht : env ti = tau.val.val) : - Realize M.sets (ordinaryMembershipDecisionFormula ci oi pi si ti) env ↔ - Name.ForcesMem p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesMem q sigma.val tau.val := by - rw [ordinaryMembershipDecisionFormula, realize_disj] - let names : Assignment (M.nameDomain s) 2 := extend sigma (extend tau Fin.elim0) - have meaning (phi : SetFormula 2) := M.realize_ordinaryGroundForcing s pairing unions powers - separation collection carrier order (0 : Fin 2) 1 phi (extend ci (extend oi Fin.elim0)) pi - (extend si (extend ti Fin.elim0)) env hc ho p names hp - (Fin.cases hs (Fin.cases ht (fun i => Fin.elim0 i))) - exact or_congr (meaning (.mem 0 1)) (meaning (.neg (.mem 0 1))) - -theorem ordinaryMembershipDecisions_entry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (sigma tau : (M.nameDomain s).names) (p : P) : - s.encode p ∈ M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma.val.val tau.val.val ↔ - Name.ForcesMem p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesMem q sigma.val tau.val := by - rw [ordinaryMembershipDecisions, ZFSet.mem_sep, and_iff_right (s.encode_mem p)] - exact M.realize_ordinaryMembershipDecisionFormula s pairing unions powers separation collection - carrier order 1 2 0 3 4 _ sigma tau p rfl rfl rfl rfl rfl - -theorem ordinaryMembershipDecisions_dense - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (sigma tau : (M.nameDomain s).names) : - ∀ p ∈ s.carrier, ∃ q ∈ M.ordinaryMembershipDecisions s.carrier s.conditionOrder - sigma.val.val tau.val.val, ZFSet.pair q p ∈ s.conditionOrder := by - intro z hz - obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz - obtain ⟨q, below, decided⟩ := decisionWitness_dense (M.nameDomain s) (.mem 0 1) - (extend sigma (extend tau Fin.elim0)) p - exact ⟨s.encode q, - (M.ordinaryMembershipDecisions_entry s pairing unions powers separation collection carrier order - sigma tau q).2 decided, (s.pair_mem_conditionOrder q p).2 below⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.UniformGroundNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def ordinaryGroundPrimitives {k : Nat} (c o : Fin k) : ForcingPrimitives k := + withGroundEquality c o (liftedNameFormula c) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_ordinaryGroundForcing + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k n m : Nat} (c o : Fin k) (φ : SetFormula n) + (params : Fin k → Fin m) (pi : Fin m) (names : Fin n → Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (p : P) (nameEnv : Assignment (M.nameDomain s) n) (hp : env pi = s.encode p) + (hnames : ∀ i, env (names i) = (nameEnv i).val.val) : + Realize M.sets (forcingTranslation (ordinaryGroundPrimitives c o) φ params pi names) env ↔ + Forces (M.nameDomain s) φ nameEnv p := + M.realize_forcingWithGroundEquality s (M.nameDomain s) (fun _ h => h) pairing unions powers + separation collection carrier order c o (liftedNameFormula c) φ params pi names env hc ho + (M.domainMeaning_liftedNames s pairing unions powers separation collection carrier c _ hc) + p nameEnv hp hnames + +theorem ordinaryForcingSet_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {n : Nat} (φ : SetFormula n) (nameEnv : Assignment (M.nameDomain s) n) : + s.subset (fun p => Forces (M.nameDomain s) φ nameEnv p) ∈ M.sets := by + let context := extend s.carrier (extend s.conditionOrder (fun i => (nameEnv i).val.val)) + let params : Fin 2 → Fin (n + 2) := extend 0 (extend 1 Fin.elim0) + have members : ∀ i, context i ∈ M.sets := + Fin.cases carrier (Fin.cases order (fun i => (nameEnv i).property)) + apply M.forcingSet_mem_withGroundEquality s (M.nameDomain s) (fun _ h => h) pairing unions powers + separation collection carrier order 0 1 (liftedNameFormula 0) φ params (fun i => i.succ.succ) + context members rfl rfl + · exact M.domainMeaning_liftedNames s pairing unions powers separation collection carrier 0 _ rfl + · exact fun _ => rfl + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.SetFormula + +def candidateForcingFormula {n : Nat} (phi : SetFormula (n + 1)) : SetFormula (n + 4) := + ex (.conj (.mem 0 2) + (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) phi + (extend 3 (extend 4 Fin.elim0)) 1 + (extend 0 (fun i => i.succ.succ.succ.succ.succ)))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +include pairing unions powers separation collection carrier order + +theorem realize_candidateForcingFormula {n : Nat} (phi : SetFormula (n + 1)) + (env : Assignment (M.nameDomain s) n) (W : ZFSet.{u}) + (valid : ∀ z ∈ W, IsName s z) (p : P) : + Realize M.sets (candidateForcingFormula phi) + (extend (s.encode p) (extend W (extend s.carrier + (extend s.conditionOrder (fun i => (env i).val.val))))) ↔ + ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ + Forces (M.nameDomain s) phi (extend tau env) p := by + let params := extend (s.encode p) (extend W (extend s.carrier + (extend s.conditionOrder (fun i => (env i).val.val)))) + change Realize M.sets (candidateForcingFormula phi) params ↔ _ + rw [candidateForcingFormula, realize_ex] + constructor + · rintro ⟨z, hz, member, forced⟩ + change z ∈ W at member + let tau : (M.nameDomain s).names := ⟨⟨z, valid z member⟩, hz⟩ + refine ⟨tau, member, ?_⟩ + exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection + carrier order 0 1 phi (extend 3 (extend 4 Fin.elim0)) 1 + (extend 0 (fun i => i.succ.succ.succ.succ.succ)) (extend z params) + rfl rfl p (extend tau env) rfl (Fin.cases rfl (fun _ => rfl))).1 forced + · rintro ⟨tau, member, forced⟩ + refine ⟨tau.val.val, tau.property, member, ?_⟩ + exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection + carrier order 0 1 phi (extend 3 (extend 4 Fin.elim0)) 1 + (extend 0 (fun i => i.succ.succ.succ.succ.succ)) (extend tau.val.val params) + rfl rfl p (extend tau env) rfl (Fin.cases rfl (fun _ => rfl))).2 forced + +theorem candidateForcingSet_mem {n : Nat} (phi : SetFormula (n + 1)) + (env : Assignment (M.nameDomain s) n) (W : ZFSet.{u}) (ground : W ∈ M.sets) + (valid : ∀ z ∈ W, IsName s z) : + s.subset (fun p => ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ + Forces (M.nameDomain s) phi (extend tau env) p) ∈ M.sets := by + let params := extend W (extend s.carrier (extend s.conditionOrder (fun i => (env i).val.val))) + have equal : s.subset (fun p => ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ + Forces (M.nameDomain s) phi (extend tau env) p) = + ZFSet.sep (fun z => Realize M.sets (candidateForcingFormula phi) (extend z params)) s.carrier := by + apply ZFSet.ext + intro z + rw [s.mem_subset, ZFSet.mem_sep] + constructor + · rintro ⟨p, forced, rfl⟩ + exact ⟨s.encode_mem p, (M.realize_candidateForcingFormula s pairing unions powers separation + collection carrier order phi env W valid p).2 forced⟩ + · rintro ⟨member, truth⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 member + exact ⟨p, (M.realize_candidateForcingFormula s pairing unions powers separation collection + carrier order phi env W valid p).1 truth, rfl⟩ + rw [equal] + exact M.separation_mem separation (candidateForcingFormula phi) params + (Fin.cases ground (Fin.cases carrier (Fin.cases order (fun i => (env i).property)))) carrier + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +def RenameStep (f : P → P) (R : Name s → Name s → Prop) (σ τ : Name s) : Prop := + (∀ ν p, Entry ν σ p → ∃ ρ, Entry ρ τ (f p) ∧ R ν ρ) ∧ + (∀ ρ q, Entry ρ τ q → ∃ ν p, Entry ν σ p ∧ f p = q ∧ R ν ρ) + +theorem rename_eq_step (f : P → P) (σ τ : Name s) : + rename s f σ = τ ↔ RenameStep f (fun ν ρ => rename s f ν = ρ) σ τ := by + constructor + · intro eq + constructor + · intro ν p entry + refine ⟨rename s f ν, ?_, rfl⟩ + rw [← eq, entry_rename] + exact ⟨ν, p, entry, rfl, rfl⟩ + · intro ρ q entry + rw [← eq, entry_rename] at entry + obtain ⟨ν, p, old, image, condition⟩ := entry + exact ⟨ν, p, old, condition, image⟩ + · rintro ⟨left, right⟩ + apply ext + intro ρ q + rw [entry_rename] + constructor + · rintro ⟨ν, p, entry, image, condition⟩ + obtain ⟨χ, matched, hχ⟩ := left ν p entry + have eq : χ = ρ := hχ.symm.trans image + simpa only [eq, condition] using matched + · intro entry + obtain ⟨ν, p, old, condition, image⟩ := right ρ q entry + exact ⟨ν, p, old, image, condition⟩ + +theorem rename_postfixed_sound (D : NameDomain s) (f : P → P) (R : Name s → Name s → Prop) + (post : ∀ σ ∈ D.names, ∀ τ ∈ D.names, R σ τ → RenameStep f R σ τ) : + ∀ σ ∈ D.names, ∀ τ ∈ D.names, R σ τ → rename s f σ = τ := by + intro σ + induction σ using inductionOn with + | step σ ih => + intro hσ τ hτ rel + obtain ⟨left, right⟩ := post σ hσ τ hτ rel + apply (rename_eq_step f σ τ).2 + constructor + · intro ν p entry + obtain ⟨ρ, matched, child⟩ := left ν p entry + exact ⟨ρ, matched, ih ν p entry (D.children hσ entry) ρ (D.children hτ matched) child⟩ + · intro ρ q entry + obtain ⟨ν, p, old, condition, child⟩ := right ρ q entry + exact ⟨ν, p, old, condition, ih ν p old (D.children hσ old) ρ (D.children hτ entry) child⟩ + +theorem rename_prefixed_complete (D : NameDomain s) (f : P → P) (R : Name s → Name s → Prop) + (pre : ∀ σ ∈ D.names, ∀ τ ∈ D.names, RenameStep f R σ τ → R σ τ) : + ∀ σ ∈ D.names, ∀ τ ∈ D.names, rename s f σ = τ → R σ τ := by + intro σ + induction σ using inductionOn with + | step σ ih => + intro hσ τ hτ eq + obtain ⟨left, right⟩ := (rename_eq_step f σ τ).1 eq + apply pre σ hσ τ hτ + constructor + · intro ν p entry + obtain ⟨ρ, matched, child⟩ := left ν p entry + exact ⟨ρ, matched, ih ν p entry (D.children hσ entry) ρ (D.children hτ matched) child⟩ + · intro ρ q entry + obtain ⟨ν, p, old, condition, child⟩ := right ρ q entry + exact ⟨ν, p, old, condition, ih ν p old (D.children hσ old) ρ (D.children hτ entry) child⟩ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace SetFormula + +def ordinaryEqualityDecisionFormula {n : Nat} + (carrier order condition sigma tau : Fin n) : SetFormula n := + disj + (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.equal 0 1) + (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) + (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.neg (.equal 0 1)) + (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def ordinaryEqualityDecisions (Q order sigma tau : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun p => Realize M.sets (ordinaryEqualityDecisionFormula 1 2 0 3 4) + (extend p ![Q, order, sigma, tau])) Q + +theorem ordinaryEqualityDecisions_subset (Q order sigma tau : ZFSet.{u}) : + M.ordinaryEqualityDecisions Q order sigma tau ⊆ Q := + fun _ h => (ZFSet.mem_sep.1 h).1 + +variable {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_ordinaryEqualityDecisionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {n : Nat} (ci oi pi si ti : Fin n) (env : Fin n → ZFSet.{u}) + (sigma tau : (M.nameDomain s).names) (p : P) + (hc : env ci = s.carrier) (ho : env oi = s.conditionOrder) + (hp : env pi = s.encode p) (hs : env si = sigma.val.val) (ht : env ti = tau.val.val) : + Realize M.sets (ordinaryEqualityDecisionFormula ci oi pi si ti) env ↔ + Name.ForcesEq p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesEq q sigma.val tau.val := by + rw [ordinaryEqualityDecisionFormula, realize_disj] + let names : Assignment (M.nameDomain s) 2 := extend sigma (extend tau Fin.elim0) + have meaning (phi : SetFormula 2) := M.realize_ordinaryGroundForcing s pairing unions powers + separation collection carrier order (0 : Fin 2) 1 phi (extend ci (extend oi Fin.elim0)) pi + (extend si (extend ti Fin.elim0)) env hc ho p names hp + (Fin.cases hs (Fin.cases ht (fun i => Fin.elim0 i))) + exact or_congr (meaning (.equal 0 1)) (meaning (.neg (.equal 0 1))) + +theorem ordinaryEqualityDecisions_entry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (sigma tau : (M.nameDomain s).names) (p : P) : + s.encode p ∈ M.ordinaryEqualityDecisions s.carrier s.conditionOrder sigma.val.val tau.val.val ↔ + Name.ForcesEq p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesEq q sigma.val tau.val := by + rw [ordinaryEqualityDecisions, ZFSet.mem_sep, and_iff_right (s.encode_mem p)] + exact M.realize_ordinaryEqualityDecisionFormula s pairing unions powers separation collection + carrier order 1 2 0 3 4 _ sigma tau p rfl rfl rfl rfl rfl + +theorem ordinaryEqualityDecisions_dense + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (sigma tau : (M.nameDomain s).names) : + ∀ p ∈ s.carrier, ∃ q ∈ M.ordinaryEqualityDecisions s.carrier s.conditionOrder + sigma.val.val tau.val.val, ZFSet.pair q p ∈ s.conditionOrder := by + intro z hz + obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz + obtain ⟨q, below, decided⟩ := decisionWitness_dense (M.nameDomain s) (.equal 0 1) + (extend sigma (extend tau Fin.elim0)) p + exact ⟨s.encode q, + (M.ordinaryEqualityDecisions_entry s pairing unions powers separation collection carrier order + sigma tau q).2 decided, (s.pair_mem_conditionOrder q p).2 below⟩ + +end TransitiveGround + + + + +namespace SetFormula + +def ordinaryMembershipDecisionFormula {n : Nat} + (carrier order condition sigma tau : Fin n) : SetFormula n := + disj + (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.mem 0 1) + (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) + (forcingTranslation (ordinaryGroundPrimitives (0 : Fin 2) 1) (.neg (.mem 0 1)) + (extend carrier (extend order Fin.elim0)) condition (extend sigma (extend tau Fin.elim0))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def ordinaryMembershipDecisions (Q order sigma tau : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun p => Realize M.sets (ordinaryMembershipDecisionFormula 1 2 0 3 4) + (extend p ![Q, order, sigma, tau])) Q + +theorem ordinaryMembershipDecisions_subset (Q order sigma tau : ZFSet.{u}) : + M.ordinaryMembershipDecisions Q order sigma tau ⊆ Q := + fun _ h => (ZFSet.mem_sep.1 h).1 + +variable {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_ordinaryMembershipDecisionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {n : Nat} (ci oi pi si ti : Fin n) (env : Fin n → ZFSet.{u}) + (sigma tau : (M.nameDomain s).names) (p : P) + (hc : env ci = s.carrier) (ho : env oi = s.conditionOrder) + (hp : env pi = s.encode p) (hs : env si = sigma.val.val) (ht : env ti = tau.val.val) : + Realize M.sets (ordinaryMembershipDecisionFormula ci oi pi si ti) env ↔ + Name.ForcesMem p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesMem q sigma.val tau.val := by + rw [ordinaryMembershipDecisionFormula, realize_disj] + let names : Assignment (M.nameDomain s) 2 := extend sigma (extend tau Fin.elim0) + have meaning (phi : SetFormula 2) := M.realize_ordinaryGroundForcing s pairing unions powers + separation collection carrier order (0 : Fin 2) 1 phi (extend ci (extend oi Fin.elim0)) pi + (extend si (extend ti Fin.elim0)) env hc ho p names hp + (Fin.cases hs (Fin.cases ht (fun i => Fin.elim0 i))) + exact or_congr (meaning (.mem 0 1)) (meaning (.neg (.mem 0 1))) + +theorem ordinaryMembershipDecisions_entry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (sigma tau : (M.nameDomain s).names) (p : P) : + s.encode p ∈ M.ordinaryMembershipDecisions s.carrier s.conditionOrder sigma.val.val tau.val.val ↔ + Name.ForcesMem p sigma.val tau.val ∨ ∀ q, q ≤ p → ¬ Name.ForcesMem q sigma.val tau.val := by + rw [ordinaryMembershipDecisions, ZFSet.mem_sep, and_iff_right (s.encode_mem p)] + exact M.realize_ordinaryMembershipDecisionFormula s pairing unions powers separation collection + carrier order 1 2 0 3 4 _ sigma tau p rfl rfl rfl rfl rfl + +theorem ordinaryMembershipDecisions_dense + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (sigma tau : (M.nameDomain s).names) : + ∀ p ∈ s.carrier, ∃ q ∈ M.ordinaryMembershipDecisions s.carrier s.conditionOrder + sigma.val.val tau.val.val, ZFSet.pair q p ∈ s.conditionOrder := by + intro z hz + obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz + obtain ⟨q, below, decided⟩ := decisionWitness_dense (M.nameDomain s) (.mem 0 1) + (extend sigma (extend tau Fin.elim0)) p + exact ⟨s.encode q, + (M.ordinaryMembershipDecisions_entry s pairing unions powers separation collection carrier order + sigma tau q).2 decided, (s.pair_mem_conditionOrder q p).2 below⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NatActionUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NatActionUnions.lean index 5d6bdbb71840108fcc2789111dd964aff21ba94e..f906106d4d62bd69ac12c9c0b1366f66ac2badfe 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NatActionUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/NatActionUnions.lean @@ -1,67 +1,67 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.SeparationFulfillmentCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.NatUnionCode -universe u - -theorem posetAction {P r a : Nat → ZFSet.{u}} {G m e L R A : ZFSet.{u}} - (carrier : NatUnionCode P L) (relation : NatUnionCode r R) (action : NatUnionCode a A) - (codes : ∀ n, PosetActionCode G (P n) m e (r n) (a n)) - (relationMono : ∀ n j, n ≤ j → r n ⊆ r j) - (actionMono : ∀ n j, n ≤ j → a n ⊆ a j) : PosetActionCode G L m e R A := by - refine ⟨(carrier.prod_left G).isFunc carrier action (fun n => (codes n).function) actionMono, - ?_, ?_, ?_⟩ - · intro p hp - obtain ⟨n, hn⟩ := (carrier p).1 hp - exact action.subset n ((codes n).one p hn) - · intro g hg h hh k hk p _ q _ v _ product first second - obtain ⟨i, hi⟩ := (action _).1 first - obtain ⟨j, hj⟩ := (action _).1 second - let n := max i j - have firstN := actionMono i n (le_max_left i j) hi - have secondN := actionMono j n (le_max_right i j) hj - have firstShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 firstN) - have secondShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 secondN) - exact action.subset n ((codes n).mul g hg h hh k hk - p (ZFSet.pair_mem_prod.1 firstShape.1).2 q firstShape.2 v secondShape.2 product firstN secondN) - · intro g hg p _ q _ v _ w _ first second lower - obtain ⟨i, hi⟩ := (action _).1 first - obtain ⟨j, hj⟩ := (action _).1 second - obtain ⟨k, hk⟩ := (relation _).1 lower - let n := max k (max i j) - have kn : k ≤ n := le_max_left k (max i j) - have inN : i ≤ n := (le_max_left i j).trans (le_max_right k (max i j)) - have jn : j ≤ n := (le_max_right i j).trans (le_max_right k (max i j)) - have firstN := actionMono i n inN hi - have secondN := actionMono j n jn hj - have firstShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 firstN) - have secondShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 secondN) - exact relation.subset n ((codes n).monotone g hg - p (ZFSet.pair_mem_prod.1 firstShape.1).2 - q (ZFSet.pair_mem_prod.1 secondShape.1).2 v firstShape.2 w secondShape.2 - firstN secondN (relationMono k n kn hk)) - -theorem action_entry_iff {P r a : Nat → ZFSet.{u}} {G m e L R A : ZFSet.{u}} - (action : NatUnionCode a A) (unionCode : PosetActionCode G L m e R A) - (codes : ∀ n, PosetActionCode G (P n) m e (r n) (a n)) - (n : Nat) {g x y : ZFSet.{u}} (hx : x ∈ P n) : - ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ a n := by - by_cases hg : g ∈ G - · exact action.function_entry_iff unionCode.function (fun n => (codes n).function) n - (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) - · constructor - · intro entry - exact (hg (ZFSet.pair_mem_prod.1 - (ZFSet.pair_mem_prod.1 (unionCode.function.1 entry)).1).1).elim - · intro entry - exact (hg (ZFSet.pair_mem_prod.1 - (ZFSet.pair_mem_prod.1 ((codes n).function.1 entry)).1).1).elim - -end PartitionPilot.Forcing.NatUnionCode - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.SeparationFulfillmentCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.NatUnionCode +universe u + +theorem posetAction {P r a : Nat → ZFSet.{u}} {G m e L R A : ZFSet.{u}} + (carrier : NatUnionCode P L) (relation : NatUnionCode r R) (action : NatUnionCode a A) + (codes : ∀ n, PosetActionCode G (P n) m e (r n) (a n)) + (relationMono : ∀ n j, n ≤ j → r n ⊆ r j) + (actionMono : ∀ n j, n ≤ j → a n ⊆ a j) : PosetActionCode G L m e R A := by + refine ⟨(carrier.prod_left G).isFunc carrier action (fun n => (codes n).function) actionMono, + ?_, ?_, ?_⟩ + · intro p hp + obtain ⟨n, hn⟩ := (carrier p).1 hp + exact action.subset n ((codes n).one p hn) + · intro g hg h hh k hk p _ q _ v _ product first second + obtain ⟨i, hi⟩ := (action _).1 first + obtain ⟨j, hj⟩ := (action _).1 second + let n := max i j + have firstN := actionMono i n (le_max_left i j) hi + have secondN := actionMono j n (le_max_right i j) hj + have firstShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 firstN) + have secondShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 secondN) + exact action.subset n ((codes n).mul g hg h hh k hk + p (ZFSet.pair_mem_prod.1 firstShape.1).2 q firstShape.2 v secondShape.2 product firstN secondN) + · intro g hg p _ q _ v _ w _ first second lower + obtain ⟨i, hi⟩ := (action _).1 first + obtain ⟨j, hj⟩ := (action _).1 second + obtain ⟨k, hk⟩ := (relation _).1 lower + let n := max k (max i j) + have kn : k ≤ n := le_max_left k (max i j) + have inN : i ≤ n := (le_max_left i j).trans (le_max_right k (max i j)) + have jn : j ≤ n := (le_max_right i j).trans (le_max_right k (max i j)) + have firstN := actionMono i n inN hi + have secondN := actionMono j n jn hj + have firstShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 firstN) + have secondShape := ZFSet.pair_mem_prod.1 ((codes n).function.1 secondN) + exact relation.subset n ((codes n).monotone g hg + p (ZFSet.pair_mem_prod.1 firstShape.1).2 + q (ZFSet.pair_mem_prod.1 secondShape.1).2 v firstShape.2 w secondShape.2 + firstN secondN (relationMono k n kn hk)) + +theorem action_entry_iff {P r a : Nat → ZFSet.{u}} {G m e L R A : ZFSet.{u}} + (action : NatUnionCode a A) (unionCode : PosetActionCode G L m e R A) + (codes : ∀ n, PosetActionCode G (P n) m e (r n) (a n)) + (n : Nat) {g x y : ZFSet.{u}} (hx : x ∈ P n) : + ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ a n := by + by_cases hg : g ∈ G + · exact action.function_entry_iff unionCode.function (fun n => (codes n).function) n + (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) + · constructor + · intro entry + exact (hg (ZFSet.pair_mem_prod.1 + (ZFSet.pair_mem_prod.1 (unionCode.function.1 entry)).1).1).elim + · intro entry + exact (hg (ZFSet.pair_mem_prod.1 + (ZFSet.pair_mem_prod.1 ((codes n).function.1 entry)).1).1).elim + +end PartitionPilot.Forcing.NatUnionCode + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OrbitPairGraphNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OrbitPairGraphNames.lean index eea61cf6af5db9c4e018a3b19ef71bb77803bbfc..ea73edcbde4d841c7ef770aa1e79ba41db70a437 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OrbitPairGraphNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OrbitPairGraphNames.lean @@ -1,712 +1,712 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CountableSetFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.InitialRowForcing - -namespace OAI - - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u v -variable {P Q R : Type u} {s : Presentation P} - -noncomputable def rename (t : Presentation Q) (f : P → Q) (τ : Name s) : Name t := - assemble (fun a : Entries τ => rename t f a.val.1) (fun a => f a.val.2) -termination_by ZFSet.rank τ.val -decreasing_by exact entry_rank_lt a.property - -theorem entry_rename (t : Presentation Q) (f : P → Q) (τ : Name s) - (σ : Name t) (q : Q) : - Entry σ (rename t f τ) q ↔ - ∃ ν p, Entry ν τ p ∧ rename t f ν = σ ∧ f p = q := by - rw [rename, entry_assemble] - constructor - · rintro ⟨a, eq, hp⟩ - exact ⟨a.val.1, a.val.2, a.property, eq, hp⟩ - · rintro ⟨ν, p, h, eq, hp⟩ - exact ⟨⟨(ν, p), h⟩, eq, hp⟩ - -theorem rename_assemble (t : Presentation Q) (f : P → Q) - {α : Type v} [Small.{u} α] (names : α → Name s) (conditions : α → P) : - rename t f (assemble names conditions) = - assemble (fun i => rename t f (names i)) (fun i => f (conditions i)) := by - apply ext - intro σ q - rw [entry_rename, entry_assemble] - constructor - · rintro ⟨ν, p, h, eq, hp⟩ - obtain ⟨i, rfl, rfl⟩ := (entry_assemble names conditions ν p).1 h - exact ⟨i, eq, hp⟩ - · rintro ⟨i, eq, hp⟩ - exact ⟨names i, conditions i, - (entry_assemble names conditions _ _).2 ⟨i, rfl, rfl⟩, eq, hp⟩ - -theorem rename_id (τ : Name s) : rename s id τ = τ := by - induction τ using inductionOn with - | step τ ih => - apply ext - intro σ p - rw [entry_rename] - constructor - · rintro ⟨ν, q, h, eq, hp⟩ - rw [ih ν q h] at eq - simpa only [id_eq, ← eq, ← hp] using h - · intro h - exact ⟨σ, p, h, ih σ p h, rfl⟩ - -theorem rename_comp (t : Presentation Q) (r : Presentation R) - (f : P → Q) (g : Q → R) (τ : Name s) : - rename r g (rename t f τ) = rename r (g ∘ f) τ := by - induction τ using inductionOn with - | step τ ih => - apply ext - intro σ q - rw [entry_rename, entry_rename] - constructor - · rintro ⟨ν, p, h, eq, hp⟩ - obtain ⟨χ, a, ha, rfl, rfl⟩ := (entry_rename t f τ ν p).1 h - exact ⟨χ, a, ha, (ih χ a ha).symm.trans eq, hp⟩ - · rintro ⟨χ, a, ha, eq, hp⟩ - exact ⟨rename t f χ, f a, (entry_rename t f τ _ _).2 ⟨χ, a, ha, rfl, rfl⟩, - (ih χ a ha).trans eq, hp⟩ - -theorem rename_empty (t : Presentation Q) (f : P → Q) : - rename t f (empty s) = empty t := by - apply ext - intro σ p - rw [entry_rename] - constructor - · rintro ⟨ν, q, h, _, _⟩ - exact False.elim (not_entry_empty ν q h) - · exact False.elim ∘ not_entry_empty σ p - -theorem rename_check (t : Presentation Q) (f : P → Q) (one : P) (x : ZFSet.{u}) : - rename t f (check s one x) = check t (f one) x := by - induction x using ZFSet.inductionOn with - | h x ih => - rw [check, rename_assemble, check] - apply congrArg (fun names : x → Name t => assemble names (fun _ => f one)) - funext y - exact ih y.val y.property - -theorem rename_check_fixed (f : P → P) (one : P) (fixed : f one = one) (x : ZFSet.{u}) : - rename s f (check s one x) = check s one x := by - rw [rename_check, fixed] - -theorem rename_singleton (t : Presentation Q) (f : P → Q) (one : P) (σ : Name s) : - rename t f (singleton one σ) = singleton (f one) (rename t f σ) := by - rw [singleton, rename_assemble] - rfl - -theorem rename_unorderedPair (t : Presentation Q) (f : P → Q) - (one : P) (σ τ : Name s) : - rename t f (unorderedPair one σ τ) = - unorderedPair (f one) (rename t f σ) (rename t f τ) := by - rw [unorderedPair, rename_assemble, unorderedPair] - apply congrArg (fun names : Bool → Name t => assemble names (fun _ => f one)) - funext b - cases b <;> rfl - -theorem rename_orderedPair (t : Presentation Q) (f : P → Q) - (one : P) (σ τ : Name s) : - rename t f (orderedPair one σ τ) = - orderedPair (f one) (rename t f σ) (rename t f τ) := by - rw [orderedPair, rename_unorderedPair, rename_singleton, rename_unorderedPair] - rfl - -theorem eval_rename (t : Presentation Q) (f : P → Q) (H : Set Q) (τ : Name s) : - eval H (rename t f τ) = eval {p | f p ∈ H} τ := by - induction τ using inductionOn with - | step τ ih => - apply ZFSet.ext - intro x - rw [mem_eval, mem_eval] - constructor - · rintro ⟨ν, q, h, hq, eq⟩ - obtain ⟨σ, p, hp, rfl, rfl⟩ := (entry_rename t f τ ν q).1 h - exact ⟨σ, p, hp, hq, (ih σ p hp).symm.trans eq⟩ - · rintro ⟨σ, p, hp, hq, eq⟩ - exact ⟨rename t f σ, f p, - (entry_rename t f τ _ _).2 ⟨σ, p, hp, rfl, rfl⟩, - hq, (ih σ p hp).trans eq⟩ - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing - -open SetRealization Compression.RecursiveMaps.CosetGeometry.OrderAction -universe u v - -structure PosetAction (G : Type v) [Group G] (P : Type u) [PartialOrder P] where - iso : G → P ≃o P - one : ∀ p, iso 1 p = p - mul : ∀ g h p, iso (g * h) p = iso g (iso h p) - -namespace PosetAction -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -noncomputable def act (g : G) (τ : Name s) : Name s := Name.rename s (a.iso g) τ - -theorem act_one (τ : Name s) : a.act s 1 τ = τ := by - have eq : (a.iso 1 : P → P) = id := funext a.one - change Name.rename s (a.iso 1) τ = τ - rw [eq, Name.rename_id] - -theorem act_mul (g h : G) (τ : Name s) : - a.act s (g * h) τ = a.act s g (a.act s h τ) := by - have eq : (a.iso (g * h) : P → P) = (a.iso g : P → P) ∘ a.iso h := - funext (a.mul g h) - change Name.rename s (a.iso (g * h)) τ = - Name.rename s (a.iso g) (Name.rename s (a.iso h) τ) - rw [Name.rename_comp, eq] - -theorem act_inv_left (g : G) (τ : Name s) : a.act s g⁻¹ (a.act s g τ) = τ := by - rw [← act_mul, inv_mul_cancel, act_one] - -theorem act_inv_right (g : G) (τ : Name s) : a.act s g (a.act s g⁻¹ τ) = τ := by - rw [← act_mul, mul_inv_cancel, act_one] - -noncomputable def nameEquiv (g : G) : Name s ≃ Name s where - toFun := a.act s g - invFun := a.act s g⁻¹ - left_inv := a.act_inv_left s g - right_inv := a.act_inv_right s g - -theorem entry_act (g : G) (σ τ : Name s) (p : P) : - Name.Entry (a.act s g σ) (a.act s g τ) (a.iso g p) ↔ Name.Entry σ τ p := by - change Name.Entry (a.act s g σ) (Name.rename s (a.iso g) τ) (a.iso g p) ↔ _ - rw [Name.entry_rename] - constructor - · rintro ⟨ν, q, h, eq, hp⟩ - have eqν : ν = σ := (a.nameEquiv s g).injective eq - have eqp : q = p := (a.iso g).injective hp - simpa only [← eqν, ← eqp] using h - · intro h - exact ⟨σ, p, h, rfl, rfl⟩ - -theorem eval_act (g : G) (H : Set P) (τ : Name s) : - Name.eval H (a.act s g τ) = Name.eval {p | a.iso g p ∈ H} τ := - Name.eval_rename s (a.iso g) H τ - -theorem act_check [OrderTop P] (g : G) (x : ZFSet.{u}) : - a.act s g (Name.check s ⊤ x) = Name.check s ⊤ x := - Name.rename_check_fixed (a.iso g) ⊤ (a.iso g).map_top x - -def stabilizer (τ : Name s) : Subgroup G where - carrier := {g | a.act s g τ = τ} - one_mem' := a.act_one s τ - mul_mem' {g h} hg hh := by - change a.act s (g * h) τ = τ - change a.act s g τ = τ at hg - change a.act s h τ = τ at hh - rw [a.act_mul, hh, hg] - inv_mem' {g} hg := by - have eq := a.act_inv_left s g τ - rw [hg] at eq - exact eq - -theorem stabilizer_conjugation (g : G) (τ : Name s) : - a.stabilizer s (a.act s g τ) = (a.stabilizer s τ).map (conjugateHom g) := by - apply Subgroup.ext - intro h - constructor - · intro fixed - let k := g⁻¹ * h * g - have eq : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] - refine Subgroup.mem_map.2 ⟨k, ?_, eq⟩ - change a.act s (g⁻¹ * h * g) τ = τ - rw [a.act_mul, a.act_mul] - change a.act s h (a.act s g τ) = a.act s g τ at fixed - rw [fixed, a.act_inv_left] - · intro member - obtain ⟨k, fixed, rfl⟩ := Subgroup.mem_map.1 member - change a.act s (g * k * g⁻¹) (a.act s g τ) = a.act s g τ - change a.act s k τ = τ at fixed - rw [a.act_mul, a.act_mul, a.act_inv_left, fixed] - -def pullbackFilter (g : G) (F : ConditionFilter P) : ConditionFilter P where - mem p := F.mem (a.iso g p) - nonempty := by - obtain ⟨p, hp⟩ := F.nonempty - exact ⟨(a.iso g).symm p, by simpa using hp⟩ - upward {p q} hp hpq := F.upward hp ((a.iso g).monotone hpq) - directed {p q} hp hq := by - obtain ⟨r, hr, rp, rq⟩ := F.directed hp hq - refine ⟨(a.iso g).symm r, ?_, ?_, ?_⟩ - · simpa using hr - · simpa using (a.iso g).symm.monotone rp - · simpa using (a.iso g).symm.monotone rq - -end PosetAction -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem forcesEq_act (g : G) {p : P} {σ τ : Name s} (eq : Name.ForcesEq p σ τ) : - Name.ForcesEq (a.iso g p) (a.act s g σ) (a.act s g τ) := by - induction σ using Name.inductionOn generalizing p τ with - | step σ ih => - rw [Name.ForcesEq] at eq ⊢ - constructor - · intro ρ r entry q qp qr - change Name.Entry ρ (Name.rename s (a.iso g) σ) r at entry - obtain ⟨ρ₀, r₀, old, rfl, rfl⟩ := (Name.entry_rename s (a.iso g) σ ρ r).1 entry - have oldp : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp - have oldr : (a.iso g).symm q ≤ r₀ := by simpa using (a.iso g).symm.monotone qr - obtain ⟨t, tq, ν, k, target, tk, childEq⟩ := eq.1 ρ₀ r₀ old _ oldp oldr - refine ⟨a.iso g t, ?_, a.act s g ν, a.iso g k, - (a.entry_act s g ν τ k).2 target, (a.iso g).monotone tk, ih ρ₀ r₀ old childEq⟩ - simpa using (a.iso g).monotone tq - · intro ν k entry q qp qk - change Name.Entry ν (Name.rename s (a.iso g) τ) k at entry - obtain ⟨ν₀, k₀, old, rfl, rfl⟩ := (Name.entry_rename s (a.iso g) τ ν k).1 entry - have oldp : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp - have oldk : (a.iso g).symm q ≤ k₀ := by simpa using (a.iso g).symm.monotone qk - obtain ⟨t, tq, ρ, r, target, tr, childEq⟩ := eq.2 ν₀ k₀ old _ oldp oldk - refine ⟨a.iso g t, ?_, a.act s g ρ, a.iso g r, - (a.entry_act s g ρ σ r).2 target, (a.iso g).monotone tr, ih ρ r target childEq⟩ - simpa using (a.iso g).monotone tq - -theorem forcesEq_act_iff (g : G) (p : P) (σ τ : Name s) : - Name.ForcesEq (a.iso g p) (a.act s g σ) (a.act s g τ) ↔ Name.ForcesEq p σ τ := by - constructor - · intro eq - have old := a.forcesEq_act s g⁻¹ eq - rw [← a.mul, inv_mul_cancel, a.one, a.act_inv_left, a.act_inv_left] at old - exact old - · exact a.forcesEq_act s g - -theorem forcesMem_act (g : G) {p : P} {σ τ : Name s} (mem : Name.ForcesMem p σ τ) : - Name.ForcesMem (a.iso g p) (a.act s g σ) (a.act s g τ) := by - intro q qp - have oldp : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp - obtain ⟨t, tq, ν, r, entry, tr, eq⟩ := mem _ oldp - refine ⟨a.iso g t, ?_, a.act s g ν, a.iso g r, - (a.entry_act s g ν τ r).2 entry, (a.iso g).monotone tr, a.forcesEq_act s g eq⟩ - simpa using (a.iso g).monotone tq - -theorem forcesMem_act_iff (g : G) (p : P) (σ τ : Name s) : - Name.ForcesMem (a.iso g p) (a.act s g σ) (a.act s g τ) ↔ Name.ForcesMem p σ τ := by - constructor - · intro mem - have old := a.forcesMem_act s g⁻¹ mem - rw [← a.mul, inv_mul_cancel, a.one, a.act_inv_left, a.act_inv_left] at old - exact old - · exact a.forcesMem_act s g - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.PosetAction -open SetRealization -universe u v -variable {P Q : Type u} {G : Type v} [Group G] -variable [PartialOrder P] [PartialOrder Q] -variable (a : PosetAction G P) (e : PosetAction G Q) -variable (s : Presentation P) (t : Presentation Q) (f : P → Q) -variable (equivariant : ∀ g p, f (a.iso g p) = e.iso g (f p)) - -include equivariant - -theorem act_rename_of_equivariant (g : G) (τ : Name s) : - e.act t g (Name.rename t f τ) = Name.rename t f (a.act s g τ) := by - change Name.rename t (e.iso g) (Name.rename t f τ) = - Name.rename t f (Name.rename s (a.iso g) τ) - rw [Name.rename_comp, Name.rename_comp] - have equal : (e.iso g : Q → Q) ∘ f = f ∘ a.iso g := - funext (fun p => (equivariant g p).symm) - rw [equal] - -theorem stabilizer_le_rename (τ : Name s) : - a.stabilizer s τ ≤ e.stabilizer t (Name.rename t f τ) := by - intro g fixed - change e.act t g (Name.rename t f τ) = Name.rename t f τ - change a.act s g τ = τ at fixed - rw [a.act_rename_of_equivariant e s t f equivariant, fixed] - -theorem support_le_rename {K : Subgroup G} {τ : Name s} - (supported : K ≤ a.stabilizer s τ) : - K ≤ e.stabilizer t (Name.rename t f τ) := - supported.trans (a.stabilizer_le_rename e s t f equivariant τ) - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps.CosetGeometry -universe u v -variable {A G : Type v} [Group G] {L : MeetOrder A} (geom : OrderAction G L) -variable {P : Type u} [PartialOrder P] (a : PosetAction G P) (s : Presentation P) - -theorem act_eq_of_support_agreement {C : A} {τ : Name s} {g h : G} - (support : geom.fixSubgroup C ≤ a.stabilizer s τ) - (agree : ∀ z, L.le z C → (geom.iso g).toFun z = (geom.iso h).toFun z) : - a.act s g τ = a.act s h τ := by - have fixed : h⁻¹ * g ∈ geom.fixSubgroup C := by - intro z hz - rw [geom.mul, agree z hz, geom.act_inv_left] - have eq := support fixed - change a.act s (h⁻¹ * g) τ = τ at eq - have translated := congrArg (a.act s h) eq - rw [a.act_mul, a.act_inv_right] at translated - exact translated - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing - -open SetRealization Compression.RecursiveMaps -universe u v w -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] - -inductive HereditarilySymmetric (a : PosetAction G P) (s : Presentation P) - (F : NormalSubgroupFamily G) : Name s → Prop - | mk {τ} : F.mem (a.stabilizer s τ) → - (∀ σ p, Name.Entry σ τ p → HereditarilySymmetric a s F σ) → - HereditarilySymmetric a s F τ - -namespace HereditarilySymmetric -variable {a : PosetAction G P} {s : Presentation P} {F : NormalSubgroupFamily G} - -theorem symmetric {τ : Name s} (h : HereditarilySymmetric a s F τ) : - F.mem (a.stabilizer s τ) := by - cases h with - | mk hs _ => exact hs - -theorem member {τ σ : Name s} (h : HereditarilySymmetric a s F τ) - {p : P} (entry : Name.Entry σ τ p) : HereditarilySymmetric a s F σ := by - cases h with - | mk _ children => exact children σ p entry - -theorem translated {τ : Name s} (h : HereditarilySymmetric a s F τ) (g : G) : - HereditarilySymmetric a s F (a.act s g τ) := by - induction τ using Name.inductionOn with - | step τ ih => - refine HereditarilySymmetric.mk ?_ ?_ - · rw [a.stabilizer_conjugation] - exact F.conjugate g h.symmetric - · intro ν p entry - change Name.Entry ν (Name.rename s (a.iso g) τ) p at entry - obtain ⟨σ, q, hσ, rfl, _⟩ := (Name.entry_rename s (a.iso g) τ ν p).1 entry - exact ih σ q hσ (h.member hσ) - -theorem assemble {α : Type w} [Small.{u} α] (names : α → Name s) (conditions : α → P) - (sym : F.mem (a.stabilizer s (Name.assemble names conditions))) - (children : ∀ i, HereditarilySymmetric a s F (names i)) : - HereditarilySymmetric a s F (Name.assemble names conditions) := by - refine HereditarilySymmetric.mk sym ?_ - intro σ p entry - obtain ⟨i, rfl, _⟩ := (Name.entry_assemble names conditions σ p).1 entry - exact children i - -theorem assemble_common [OrderTop P] {α : Type w} [Small.{u} α] - (names : α → Name s) (children : ∀ i, HereditarilySymmetric a s F (names i)) - (K : Subgroup G) (hK : F.mem K) (fixed : ∀ g ∈ K, ∀ i, a.act s g (names i) = names i) : - HereditarilySymmetric a s F (Name.assemble names (fun _ => ⊤)) := by - apply assemble names (fun _ => ⊤) _ children - apply F.upward hK - intro g hg - change Name.rename s (a.iso g) (Name.assemble names (fun _ => ⊤)) = _ - rw [Name.rename_assemble] - have top : a.iso g ⊤ = ⊤ := (a.iso g).map_top - simp only [top] - apply congrArg (fun ns : α → Name s => Name.assemble ns (fun _ => ⊤)) - funext i - exact fixed g hg i - -theorem check [OrderTop P] (a : PosetAction G P) (s : Presentation P) - (F : NormalSubgroupFamily G) (x : ZFSet.{u}) : - HereditarilySymmetric a s F (Name.check s ⊤ x) := by - induction x using ZFSet.inductionOn with - | h x ih => - rw [Name.check] - exact assemble_common (fun y : x => Name.check s ⊤ y.val) - (fun y => ih y.val y.property) ⊤ F.top (fun g _ y => a.act_check s g y.val) - -theorem singleton [OrderTop P] {τ : Name s} (h : HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (Name.singleton ⊤ τ) := - assemble_common (fun _ : Unit => τ) (fun _ => h) (a.stabilizer s τ) h.symmetric - (fun _ fixed _ => fixed) - -theorem unorderedPair [OrderTop P] {σ τ : Name s} - (hσ : HereditarilySymmetric a s F σ) (hτ : HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (Name.unorderedPair ⊤ σ τ) := by - apply assemble_common (fun b : Bool => if b then σ else τ) - (fun b => by cases b; exact hτ; exact hσ) - (a.stabilizer s σ ⊓ a.stabilizer s τ) (F.inf hσ.symmetric hτ.symmetric) - intro g fixed b - cases b - · exact fixed.2 - · exact fixed.1 - -theorem orderedPair [OrderTop P] {σ τ : Name s} - (hσ : HereditarilySymmetric a s F σ) (hτ : HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (Name.orderedPair ⊤ σ τ) := - hσ.singleton.unorderedPair (hσ.unorderedPair hτ) - -end HereditarilySymmetric -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.Forcing.Name.NameDomain - -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -theorem empty_mem (D : NameDomain s) (nonempty : D.names.Nonempty) : empty s ∈ D.names := by - classical - have step : ∀ τ : Name s, τ ∈ D.names → empty s ∈ D.names := by - intro τ - induction τ using inductionOn with - | step τ ih => - intro hτ - by_cases member : ∃ σ p, Entry σ τ p - · obtain ⟨σ, p, entry⟩ := member - exact ih σ p entry (D.children hτ entry) - · have eq : τ = empty s := by - apply Name.ext - intro σ p - constructor - · intro h - exact False.elim (member ⟨σ, p, h⟩) - · intro h - exact False.elim (not_entry_empty σ p h) - exact eq ▸ hτ - obtain ⟨τ, hτ⟩ := nonempty - exact step τ hτ - -theorem empty_value_mem (D : NameDomain s) (nonempty : D.names.Nonempty) (H : Set P) : - (∅ : ZFSet.{u}) ∈ D.values H := - (D.mem_values H ∅).2 ⟨empty s, D.empty_mem nonempty, eval_empty H⟩ - -end PartitionPilot.Forcing.Name.NameDomain - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] - -theorem empty_hs (a : PosetAction G P) (s : Presentation P) (F : NormalSubgroupFamily G) : - HereditarilySymmetric a s F (Name.empty s) := by - refine HereditarilySymmetric.mk (F.upward F.top ?_) ?_ - · intro g _ - exact Name.rename_empty s (a.iso g) - · intro σ p entry - exact False.elim (Name.not_entry_empty σ p entry) - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.SetFormula - -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -theorem realize_emptySet (D : Name.NameDomain s) (nonempty : D.names.Nonempty) (H : Set P) : - Realize (D.values H) emptySet Fin.elim0 := by - rw [emptySet, realize_ex] - refine ⟨∅, D.empty_value_mem nonempty H, ?_⟩ - intro x _ member - exact ZFSet.notMem_empty x member - -end PartitionPilot.Forcing.SetFormula - -end - - -namespace PartitionPilot.Forcing.HereditarilySymmetric -open SetRealization Compression.RecursiveMaps -universe u v -variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] -variable {G : Type v} [Group G] -variable {a : PosetAction G P} {s : Presentation P} -variable (e : PosetAction G Q) (t : Presentation Q) (f : P → Q) -variable (equivariant : ∀ g p, f (a.iso g p) = e.iso g (f p)) -variable {F : NormalSubgroupFamily G} -include equivariant - -theorem rename {τ : Name s} (hs : HereditarilySymmetric a s F τ) : - HereditarilySymmetric e t F (Name.rename t f τ) := by - induction τ using Name.inductionOn with - | step τ ih => - refine .mk ?_ ?_ - · exact F.upward hs.symmetric (a.stabilizer_le_rename e s t f equivariant τ) - · intro ν q entry - obtain ⟨σ, p, old, rfl, _⟩ := (Name.entry_rename t f τ ν q).1 entry - exact ih σ p old (hs.member old) - -end PartitionPilot.Forcing.HereditarilySymmetric - - - -namespace PartitionPilot.Compression.RecursiveMaps.NormalSubgroupFamily - -universe u -variable {G : Type u} [Group G] - -theorem fin_iInf (F : NormalSubgroupFamily G) {n : Nat} - (K : Fin n → Subgroup G) (hK : ∀ i, F.mem (K i)) : F.mem (⨅ i, K i) := by - induction n with - | zero => - apply F.upward F.top - apply le_iInf - intro i - exact Fin.elim0 i - | succ n ih => - have split : (⨅ i, K i) = K 0 ⊓ ⨅ i : Fin n, K i.succ := by - apply le_antisymm - · exact le_inf (iInf_le K 0) (le_iInf (fun i => iInf_le K i.succ)) - · apply le_iInf - intro i - refine Fin.cases ?_ (fun j => ?_) i - · exact inf_le_left - · exact le_trans inf_le_right (iInf_le (fun j : Fin n => K j.succ) j) - rw [split] - exact F.inf (hK 0) (ih (fun i => K i.succ) (fun i => hK i.succ)) - -end PartitionPilot.Compression.RecursiveMaps.NormalSubgroupFamily - - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u -variable {G P : Type u} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) - -noncomputable def orbitPairGraph (tuple tau : Name s) : Name s := - assemble (fun g : G => orderedPair ⊤ (a.act s g tuple) (a.act s g tau)) (fun _ => ⊤) - -theorem entry_orbitPairGraph (tuple tau sigma : Name s) (p : P) : - Entry sigma (orbitPairGraph a s tuple tau) p ↔ - ∃ g : G, orderedPair ⊤ (a.act s g tuple) (a.act s g tau) = sigma ∧ p = ⊤ := by - rw [orbitPairGraph, entry_assemble] - exact exists_congr (fun _ => and_congr_right (fun _ => eq_comm)) - -theorem mem_eval_orbitPairGraph (tuple tau : Name s) (H : Set P) (topMember : (⊤ : P) ∈ H) - (z : ZFSet.{u}) : - z ∈ eval H (orbitPairGraph a s tuple tau) ↔ - ∃ g : G, ZFSet.pair (eval H (a.act s g tuple)) (eval H (a.act s g tau)) = z := by - rw [mem_eval] - constructor - · rintro ⟨sigma, p, entry, _hp, equal⟩ - obtain ⟨g, rfl, rfl⟩ := (entry_orbitPairGraph a s tuple tau sigma p).1 entry - exact ⟨g, (eval_orderedPair H ⊤ topMember _ _).symm.trans equal⟩ - · rintro ⟨g, equal⟩ - exact ⟨orderedPair ⊤ (a.act s g tuple) (a.act s g tau), ⊤, - (entry_orbitPairGraph a s tuple tau _ ⊤).2 ⟨g, rfl, rfl⟩, - topMember, (eval_orderedPair H ⊤ topMember _ _).trans equal⟩ - -private theorem act_pair (g : G) (x y : Name s) : - a.act s g (orderedPair ⊤ x y) = orderedPair ⊤ (a.act s g x) (a.act s g y) := by - change rename s (a.iso g) (orderedPair ⊤ x y) = _ - rw [rename_orderedPair, (a.iso g).map_top] - rfl - -theorem act_orbitPairGraph (tuple tau : Name s) (g : G) : - a.act s g (orbitPairGraph a s tuple tau) = orbitPairGraph a s tuple tau := by - apply Name.ext - intro sigma p - change Entry sigma (rename s (a.iso g) (orbitPairGraph a s tuple tau)) p ↔ _ - rw [entry_rename, entry_orbitPairGraph] - constructor - · rintro ⟨nu, q, entry, equal, condition⟩ - obtain ⟨h, rfl, rfl⟩ := (entry_orbitPairGraph a s tuple tau nu q).1 entry - change a.act s g (orderedPair ⊤ (a.act s h tuple) (a.act s h tau)) = sigma at equal - rw [act_pair, ← a.act_mul, ← a.act_mul] at equal - exact ⟨g * h, equal, condition.symm.trans (a.iso g).map_top⟩ - · rintro ⟨h, rfl, rfl⟩ - refine ⟨orderedPair ⊤ (a.act s (g⁻¹ * h) tuple) (a.act s (g⁻¹ * h) tau), ⊤, - (entry_orbitPairGraph a s tuple tau _ ⊤).2 ⟨g⁻¹ * h, rfl, rfl⟩, ?_, (a.iso g).map_top⟩ - change a.act s g (orderedPair ⊤ (a.act s (g⁻¹ * h) tuple) (a.act s (g⁻¹ * h) tau)) = _ - rw [act_pair, ← a.act_mul, ← a.act_mul, mul_inv_cancel_left] - -theorem orbitPairGraph_hs (F : NormalSubgroupFamily G) (tuple tau : Name s) - (tupleHS : HereditarilySymmetric a s F tuple) (tauHS : HereditarilySymmetric a s F tau) : - HereditarilySymmetric a s F (orbitPairGraph a s tuple tau) := by - apply HereditarilySymmetric.mk (F.upward F.top ?_) ?_ - · intro g _ - exact act_orbitPairGraph a s tuple tau g - · intro sigma p entry - obtain ⟨g, rfl, _⟩ := (entry_orbitPairGraph a s tuple tau sigma p).1 entry - exact (tupleHS.translated g).orderedPair (tauHS.translated g) - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem pair_left {x y : ZFSet.{u}} (h : ZFSet.pair x y ∈ M.sets) : x ∈ M.sets := - M.transitive (M.transitive h (ZFSet.mem_pair.2 (Or.inl rfl))) (ZFSet.mem_singleton.2 rfl) - -theorem pair_right {x y : ZFSet.{u}} (h : ZFSet.pair x y ∈ M.sets) : y ∈ M.sets := - M.transitive (M.transitive h (ZFSet.mem_pair.2 (Or.inr rfl))) (ZFSet.mem_pair.2 (Or.inr rfl)) - -def nameDomain : Name.NameDomain s where - names := {τ | τ.val ∈ M.sets} - children hτ entry := M.pair_left (M.transitive hτ entry) - -theorem mem_nameDomain (τ : Name s) : τ ∈ (M.nameDomain s).names ↔ τ.val ∈ M.sets := Iff.rfl - -theorem empty_mem (nonempty : M.sets.Nonempty) : (∅ : ZFSet.{u}) ∈ M.sets := by - classical - have descend : ∀ x : ZFSet.{u}, x ∈ M.sets → (∅ : ZFSet.{u}) ∈ M.sets := by - intro x - induction x using ZFSet.inductionOn with - | h x ih => - intro hx - by_cases member : ∃ y, y ∈ x - · obtain ⟨y, hy⟩ := member - exact ih y hy (M.transitive hx hy) - · have eq : x = ∅ := by - apply ZFSet.ext - intro y - exact ⟨fun h => False.elim (member ⟨y, h⟩), fun h => False.elim (ZFSet.notMem_empty y h)⟩ - exact eq ▸ hx - obtain ⟨x, hx⟩ := nonempty - exact descend x hx - -theorem nameDomain_nonempty (nonempty : M.sets.Nonempty) : (M.nameDomain s).names.Nonempty := - ⟨Name.empty s, M.empty_mem nonempty⟩ - -theorem nameDomain_countable (small : M.sets.Countable) : (M.nameDomain s).names.Countable := - small.preimage Subtype.val_injective - -theorem conditions_countable (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) : - Countable P := by - let : Countable M.sets := small - let f : P → M.sets := fun p => ⟨s.encode p, M.transitive carrier (s.encode_mem p)⟩ - have injective : Function.Injective f := fun _ _ h => s.injective (congrArg Subtype.val h) - exact injective.countable - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CountableSetFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.InitialRowForcing + +namespace OAI + + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u v +variable {P Q R : Type u} {s : Presentation P} + +noncomputable def rename (t : Presentation Q) (f : P → Q) (τ : Name s) : Name t := + assemble (fun a : Entries τ => rename t f a.val.1) (fun a => f a.val.2) +termination_by ZFSet.rank τ.val +decreasing_by exact entry_rank_lt a.property + +theorem entry_rename (t : Presentation Q) (f : P → Q) (τ : Name s) + (σ : Name t) (q : Q) : + Entry σ (rename t f τ) q ↔ + ∃ ν p, Entry ν τ p ∧ rename t f ν = σ ∧ f p = q := by + rw [rename, entry_assemble] + constructor + · rintro ⟨a, eq, hp⟩ + exact ⟨a.val.1, a.val.2, a.property, eq, hp⟩ + · rintro ⟨ν, p, h, eq, hp⟩ + exact ⟨⟨(ν, p), h⟩, eq, hp⟩ + +theorem rename_assemble (t : Presentation Q) (f : P → Q) + {α : Type v} [Small.{u} α] (names : α → Name s) (conditions : α → P) : + rename t f (assemble names conditions) = + assemble (fun i => rename t f (names i)) (fun i => f (conditions i)) := by + apply ext + intro σ q + rw [entry_rename, entry_assemble] + constructor + · rintro ⟨ν, p, h, eq, hp⟩ + obtain ⟨i, rfl, rfl⟩ := (entry_assemble names conditions ν p).1 h + exact ⟨i, eq, hp⟩ + · rintro ⟨i, eq, hp⟩ + exact ⟨names i, conditions i, + (entry_assemble names conditions _ _).2 ⟨i, rfl, rfl⟩, eq, hp⟩ + +theorem rename_id (τ : Name s) : rename s id τ = τ := by + induction τ using inductionOn with + | step τ ih => + apply ext + intro σ p + rw [entry_rename] + constructor + · rintro ⟨ν, q, h, eq, hp⟩ + rw [ih ν q h] at eq + simpa only [id_eq, ← eq, ← hp] using h + · intro h + exact ⟨σ, p, h, ih σ p h, rfl⟩ + +theorem rename_comp (t : Presentation Q) (r : Presentation R) + (f : P → Q) (g : Q → R) (τ : Name s) : + rename r g (rename t f τ) = rename r (g ∘ f) τ := by + induction τ using inductionOn with + | step τ ih => + apply ext + intro σ q + rw [entry_rename, entry_rename] + constructor + · rintro ⟨ν, p, h, eq, hp⟩ + obtain ⟨χ, a, ha, rfl, rfl⟩ := (entry_rename t f τ ν p).1 h + exact ⟨χ, a, ha, (ih χ a ha).symm.trans eq, hp⟩ + · rintro ⟨χ, a, ha, eq, hp⟩ + exact ⟨rename t f χ, f a, (entry_rename t f τ _ _).2 ⟨χ, a, ha, rfl, rfl⟩, + (ih χ a ha).trans eq, hp⟩ + +theorem rename_empty (t : Presentation Q) (f : P → Q) : + rename t f (empty s) = empty t := by + apply ext + intro σ p + rw [entry_rename] + constructor + · rintro ⟨ν, q, h, _, _⟩ + exact False.elim (not_entry_empty ν q h) + · exact False.elim ∘ not_entry_empty σ p + +theorem rename_check (t : Presentation Q) (f : P → Q) (one : P) (x : ZFSet.{u}) : + rename t f (check s one x) = check t (f one) x := by + induction x using ZFSet.inductionOn with + | h x ih => + rw [check, rename_assemble, check] + apply congrArg (fun names : x → Name t => assemble names (fun _ => f one)) + funext y + exact ih y.val y.property + +theorem rename_check_fixed (f : P → P) (one : P) (fixed : f one = one) (x : ZFSet.{u}) : + rename s f (check s one x) = check s one x := by + rw [rename_check, fixed] + +theorem rename_singleton (t : Presentation Q) (f : P → Q) (one : P) (σ : Name s) : + rename t f (singleton one σ) = singleton (f one) (rename t f σ) := by + rw [singleton, rename_assemble] + rfl + +theorem rename_unorderedPair (t : Presentation Q) (f : P → Q) + (one : P) (σ τ : Name s) : + rename t f (unorderedPair one σ τ) = + unorderedPair (f one) (rename t f σ) (rename t f τ) := by + rw [unorderedPair, rename_assemble, unorderedPair] + apply congrArg (fun names : Bool → Name t => assemble names (fun _ => f one)) + funext b + cases b <;> rfl + +theorem rename_orderedPair (t : Presentation Q) (f : P → Q) + (one : P) (σ τ : Name s) : + rename t f (orderedPair one σ τ) = + orderedPair (f one) (rename t f σ) (rename t f τ) := by + rw [orderedPair, rename_unorderedPair, rename_singleton, rename_unorderedPair] + rfl + +theorem eval_rename (t : Presentation Q) (f : P → Q) (H : Set Q) (τ : Name s) : + eval H (rename t f τ) = eval {p | f p ∈ H} τ := by + induction τ using inductionOn with + | step τ ih => + apply ZFSet.ext + intro x + rw [mem_eval, mem_eval] + constructor + · rintro ⟨ν, q, h, hq, eq⟩ + obtain ⟨σ, p, hp, rfl, rfl⟩ := (entry_rename t f τ ν q).1 h + exact ⟨σ, p, hp, hq, (ih σ p hp).symm.trans eq⟩ + · rintro ⟨σ, p, hp, hq, eq⟩ + exact ⟨rename t f σ, f p, + (entry_rename t f τ _ _).2 ⟨σ, p, hp, rfl, rfl⟩, + hq, (ih σ p hp).trans eq⟩ + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing + +open SetRealization Compression.RecursiveMaps.CosetGeometry.OrderAction +universe u v + +structure PosetAction (G : Type v) [Group G] (P : Type u) [PartialOrder P] where + iso : G → P ≃o P + one : ∀ p, iso 1 p = p + mul : ∀ g h p, iso (g * h) p = iso g (iso h p) + +namespace PosetAction +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +noncomputable def act (g : G) (τ : Name s) : Name s := Name.rename s (a.iso g) τ + +theorem act_one (τ : Name s) : a.act s 1 τ = τ := by + have eq : (a.iso 1 : P → P) = id := funext a.one + change Name.rename s (a.iso 1) τ = τ + rw [eq, Name.rename_id] + +theorem act_mul (g h : G) (τ : Name s) : + a.act s (g * h) τ = a.act s g (a.act s h τ) := by + have eq : (a.iso (g * h) : P → P) = (a.iso g : P → P) ∘ a.iso h := + funext (a.mul g h) + change Name.rename s (a.iso (g * h)) τ = + Name.rename s (a.iso g) (Name.rename s (a.iso h) τ) + rw [Name.rename_comp, eq] + +theorem act_inv_left (g : G) (τ : Name s) : a.act s g⁻¹ (a.act s g τ) = τ := by + rw [← act_mul, inv_mul_cancel, act_one] + +theorem act_inv_right (g : G) (τ : Name s) : a.act s g (a.act s g⁻¹ τ) = τ := by + rw [← act_mul, mul_inv_cancel, act_one] + +noncomputable def nameEquiv (g : G) : Name s ≃ Name s where + toFun := a.act s g + invFun := a.act s g⁻¹ + left_inv := a.act_inv_left s g + right_inv := a.act_inv_right s g + +theorem entry_act (g : G) (σ τ : Name s) (p : P) : + Name.Entry (a.act s g σ) (a.act s g τ) (a.iso g p) ↔ Name.Entry σ τ p := by + change Name.Entry (a.act s g σ) (Name.rename s (a.iso g) τ) (a.iso g p) ↔ _ + rw [Name.entry_rename] + constructor + · rintro ⟨ν, q, h, eq, hp⟩ + have eqν : ν = σ := (a.nameEquiv s g).injective eq + have eqp : q = p := (a.iso g).injective hp + simpa only [← eqν, ← eqp] using h + · intro h + exact ⟨σ, p, h, rfl, rfl⟩ + +theorem eval_act (g : G) (H : Set P) (τ : Name s) : + Name.eval H (a.act s g τ) = Name.eval {p | a.iso g p ∈ H} τ := + Name.eval_rename s (a.iso g) H τ + +theorem act_check [OrderTop P] (g : G) (x : ZFSet.{u}) : + a.act s g (Name.check s ⊤ x) = Name.check s ⊤ x := + Name.rename_check_fixed (a.iso g) ⊤ (a.iso g).map_top x + +def stabilizer (τ : Name s) : Subgroup G where + carrier := {g | a.act s g τ = τ} + one_mem' := a.act_one s τ + mul_mem' {g h} hg hh := by + change a.act s (g * h) τ = τ + change a.act s g τ = τ at hg + change a.act s h τ = τ at hh + rw [a.act_mul, hh, hg] + inv_mem' {g} hg := by + have eq := a.act_inv_left s g τ + rw [hg] at eq + exact eq + +theorem stabilizer_conjugation (g : G) (τ : Name s) : + a.stabilizer s (a.act s g τ) = (a.stabilizer s τ).map (conjugateHom g) := by + apply Subgroup.ext + intro h + constructor + · intro fixed + let k := g⁻¹ * h * g + have eq : conjugateHom g k = h := by simp [conjugateHom, k, mul_assoc] + refine Subgroup.mem_map.2 ⟨k, ?_, eq⟩ + change a.act s (g⁻¹ * h * g) τ = τ + rw [a.act_mul, a.act_mul] + change a.act s h (a.act s g τ) = a.act s g τ at fixed + rw [fixed, a.act_inv_left] + · intro member + obtain ⟨k, fixed, rfl⟩ := Subgroup.mem_map.1 member + change a.act s (g * k * g⁻¹) (a.act s g τ) = a.act s g τ + change a.act s k τ = τ at fixed + rw [a.act_mul, a.act_mul, a.act_inv_left, fixed] + +def pullbackFilter (g : G) (F : ConditionFilter P) : ConditionFilter P where + mem p := F.mem (a.iso g p) + nonempty := by + obtain ⟨p, hp⟩ := F.nonempty + exact ⟨(a.iso g).symm p, by simpa using hp⟩ + upward {p q} hp hpq := F.upward hp ((a.iso g).monotone hpq) + directed {p q} hp hq := by + obtain ⟨r, hr, rp, rq⟩ := F.directed hp hq + refine ⟨(a.iso g).symm r, ?_, ?_, ?_⟩ + · simpa using hr + · simpa using (a.iso g).symm.monotone rp + · simpa using (a.iso g).symm.monotone rq + +end PosetAction +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem forcesEq_act (g : G) {p : P} {σ τ : Name s} (eq : Name.ForcesEq p σ τ) : + Name.ForcesEq (a.iso g p) (a.act s g σ) (a.act s g τ) := by + induction σ using Name.inductionOn generalizing p τ with + | step σ ih => + rw [Name.ForcesEq] at eq ⊢ + constructor + · intro ρ r entry q qp qr + change Name.Entry ρ (Name.rename s (a.iso g) σ) r at entry + obtain ⟨ρ₀, r₀, old, rfl, rfl⟩ := (Name.entry_rename s (a.iso g) σ ρ r).1 entry + have oldp : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp + have oldr : (a.iso g).symm q ≤ r₀ := by simpa using (a.iso g).symm.monotone qr + obtain ⟨t, tq, ν, k, target, tk, childEq⟩ := eq.1 ρ₀ r₀ old _ oldp oldr + refine ⟨a.iso g t, ?_, a.act s g ν, a.iso g k, + (a.entry_act s g ν τ k).2 target, (a.iso g).monotone tk, ih ρ₀ r₀ old childEq⟩ + simpa using (a.iso g).monotone tq + · intro ν k entry q qp qk + change Name.Entry ν (Name.rename s (a.iso g) τ) k at entry + obtain ⟨ν₀, k₀, old, rfl, rfl⟩ := (Name.entry_rename s (a.iso g) τ ν k).1 entry + have oldp : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp + have oldk : (a.iso g).symm q ≤ k₀ := by simpa using (a.iso g).symm.monotone qk + obtain ⟨t, tq, ρ, r, target, tr, childEq⟩ := eq.2 ν₀ k₀ old _ oldp oldk + refine ⟨a.iso g t, ?_, a.act s g ρ, a.iso g r, + (a.entry_act s g ρ σ r).2 target, (a.iso g).monotone tr, ih ρ r target childEq⟩ + simpa using (a.iso g).monotone tq + +theorem forcesEq_act_iff (g : G) (p : P) (σ τ : Name s) : + Name.ForcesEq (a.iso g p) (a.act s g σ) (a.act s g τ) ↔ Name.ForcesEq p σ τ := by + constructor + · intro eq + have old := a.forcesEq_act s g⁻¹ eq + rw [← a.mul, inv_mul_cancel, a.one, a.act_inv_left, a.act_inv_left] at old + exact old + · exact a.forcesEq_act s g + +theorem forcesMem_act (g : G) {p : P} {σ τ : Name s} (mem : Name.ForcesMem p σ τ) : + Name.ForcesMem (a.iso g p) (a.act s g σ) (a.act s g τ) := by + intro q qp + have oldp : (a.iso g).symm q ≤ p := by simpa using (a.iso g).symm.monotone qp + obtain ⟨t, tq, ν, r, entry, tr, eq⟩ := mem _ oldp + refine ⟨a.iso g t, ?_, a.act s g ν, a.iso g r, + (a.entry_act s g ν τ r).2 entry, (a.iso g).monotone tr, a.forcesEq_act s g eq⟩ + simpa using (a.iso g).monotone tq + +theorem forcesMem_act_iff (g : G) (p : P) (σ τ : Name s) : + Name.ForcesMem (a.iso g p) (a.act s g σ) (a.act s g τ) ↔ Name.ForcesMem p σ τ := by + constructor + · intro mem + have old := a.forcesMem_act s g⁻¹ mem + rw [← a.mul, inv_mul_cancel, a.one, a.act_inv_left, a.act_inv_left] at old + exact old + · exact a.forcesMem_act s g + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.PosetAction +open SetRealization +universe u v +variable {P Q : Type u} {G : Type v} [Group G] +variable [PartialOrder P] [PartialOrder Q] +variable (a : PosetAction G P) (e : PosetAction G Q) +variable (s : Presentation P) (t : Presentation Q) (f : P → Q) +variable (equivariant : ∀ g p, f (a.iso g p) = e.iso g (f p)) + +include equivariant + +theorem act_rename_of_equivariant (g : G) (τ : Name s) : + e.act t g (Name.rename t f τ) = Name.rename t f (a.act s g τ) := by + change Name.rename t (e.iso g) (Name.rename t f τ) = + Name.rename t f (Name.rename s (a.iso g) τ) + rw [Name.rename_comp, Name.rename_comp] + have equal : (e.iso g : Q → Q) ∘ f = f ∘ a.iso g := + funext (fun p => (equivariant g p).symm) + rw [equal] + +theorem stabilizer_le_rename (τ : Name s) : + a.stabilizer s τ ≤ e.stabilizer t (Name.rename t f τ) := by + intro g fixed + change e.act t g (Name.rename t f τ) = Name.rename t f τ + change a.act s g τ = τ at fixed + rw [a.act_rename_of_equivariant e s t f equivariant, fixed] + +theorem support_le_rename {K : Subgroup G} {τ : Name s} + (supported : K ≤ a.stabilizer s τ) : + K ≤ e.stabilizer t (Name.rename t f τ) := + supported.trans (a.stabilizer_le_rename e s t f equivariant τ) + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps.CosetGeometry +universe u v +variable {A G : Type v} [Group G] {L : MeetOrder A} (geom : OrderAction G L) +variable {P : Type u} [PartialOrder P] (a : PosetAction G P) (s : Presentation P) + +theorem act_eq_of_support_agreement {C : A} {τ : Name s} {g h : G} + (support : geom.fixSubgroup C ≤ a.stabilizer s τ) + (agree : ∀ z, L.le z C → (geom.iso g).toFun z = (geom.iso h).toFun z) : + a.act s g τ = a.act s h τ := by + have fixed : h⁻¹ * g ∈ geom.fixSubgroup C := by + intro z hz + rw [geom.mul, agree z hz, geom.act_inv_left] + have eq := support fixed + change a.act s (h⁻¹ * g) τ = τ at eq + have translated := congrArg (a.act s h) eq + rw [a.act_mul, a.act_inv_right] at translated + exact translated + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing + +open SetRealization Compression.RecursiveMaps +universe u v w +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] + +inductive HereditarilySymmetric (a : PosetAction G P) (s : Presentation P) + (F : NormalSubgroupFamily G) : Name s → Prop + | mk {τ} : F.mem (a.stabilizer s τ) → + (∀ σ p, Name.Entry σ τ p → HereditarilySymmetric a s F σ) → + HereditarilySymmetric a s F τ + +namespace HereditarilySymmetric +variable {a : PosetAction G P} {s : Presentation P} {F : NormalSubgroupFamily G} + +theorem symmetric {τ : Name s} (h : HereditarilySymmetric a s F τ) : + F.mem (a.stabilizer s τ) := by + cases h with + | mk hs _ => exact hs + +theorem member {τ σ : Name s} (h : HereditarilySymmetric a s F τ) + {p : P} (entry : Name.Entry σ τ p) : HereditarilySymmetric a s F σ := by + cases h with + | mk _ children => exact children σ p entry + +theorem translated {τ : Name s} (h : HereditarilySymmetric a s F τ) (g : G) : + HereditarilySymmetric a s F (a.act s g τ) := by + induction τ using Name.inductionOn with + | step τ ih => + refine HereditarilySymmetric.mk ?_ ?_ + · rw [a.stabilizer_conjugation] + exact F.conjugate g h.symmetric + · intro ν p entry + change Name.Entry ν (Name.rename s (a.iso g) τ) p at entry + obtain ⟨σ, q, hσ, rfl, _⟩ := (Name.entry_rename s (a.iso g) τ ν p).1 entry + exact ih σ q hσ (h.member hσ) + +theorem assemble {α : Type w} [Small.{u} α] (names : α → Name s) (conditions : α → P) + (sym : F.mem (a.stabilizer s (Name.assemble names conditions))) + (children : ∀ i, HereditarilySymmetric a s F (names i)) : + HereditarilySymmetric a s F (Name.assemble names conditions) := by + refine HereditarilySymmetric.mk sym ?_ + intro σ p entry + obtain ⟨i, rfl, _⟩ := (Name.entry_assemble names conditions σ p).1 entry + exact children i + +theorem assemble_common [OrderTop P] {α : Type w} [Small.{u} α] + (names : α → Name s) (children : ∀ i, HereditarilySymmetric a s F (names i)) + (K : Subgroup G) (hK : F.mem K) (fixed : ∀ g ∈ K, ∀ i, a.act s g (names i) = names i) : + HereditarilySymmetric a s F (Name.assemble names (fun _ => ⊤)) := by + apply assemble names (fun _ => ⊤) _ children + apply F.upward hK + intro g hg + change Name.rename s (a.iso g) (Name.assemble names (fun _ => ⊤)) = _ + rw [Name.rename_assemble] + have top : a.iso g ⊤ = ⊤ := (a.iso g).map_top + simp only [top] + apply congrArg (fun ns : α → Name s => Name.assemble ns (fun _ => ⊤)) + funext i + exact fixed g hg i + +theorem check [OrderTop P] (a : PosetAction G P) (s : Presentation P) + (F : NormalSubgroupFamily G) (x : ZFSet.{u}) : + HereditarilySymmetric a s F (Name.check s ⊤ x) := by + induction x using ZFSet.inductionOn with + | h x ih => + rw [Name.check] + exact assemble_common (fun y : x => Name.check s ⊤ y.val) + (fun y => ih y.val y.property) ⊤ F.top (fun g _ y => a.act_check s g y.val) + +theorem singleton [OrderTop P] {τ : Name s} (h : HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (Name.singleton ⊤ τ) := + assemble_common (fun _ : Unit => τ) (fun _ => h) (a.stabilizer s τ) h.symmetric + (fun _ fixed _ => fixed) + +theorem unorderedPair [OrderTop P] {σ τ : Name s} + (hσ : HereditarilySymmetric a s F σ) (hτ : HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (Name.unorderedPair ⊤ σ τ) := by + apply assemble_common (fun b : Bool => if b then σ else τ) + (fun b => by cases b; exact hτ; exact hσ) + (a.stabilizer s σ ⊓ a.stabilizer s τ) (F.inf hσ.symmetric hτ.symmetric) + intro g fixed b + cases b + · exact fixed.2 + · exact fixed.1 + +theorem orderedPair [OrderTop P] {σ τ : Name s} + (hσ : HereditarilySymmetric a s F σ) (hτ : HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (Name.orderedPair ⊤ σ τ) := + hσ.singleton.unorderedPair (hσ.unorderedPair hτ) + +end HereditarilySymmetric +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.Forcing.Name.NameDomain + +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +theorem empty_mem (D : NameDomain s) (nonempty : D.names.Nonempty) : empty s ∈ D.names := by + classical + have step : ∀ τ : Name s, τ ∈ D.names → empty s ∈ D.names := by + intro τ + induction τ using inductionOn with + | step τ ih => + intro hτ + by_cases member : ∃ σ p, Entry σ τ p + · obtain ⟨σ, p, entry⟩ := member + exact ih σ p entry (D.children hτ entry) + · have eq : τ = empty s := by + apply Name.ext + intro σ p + constructor + · intro h + exact False.elim (member ⟨σ, p, h⟩) + · intro h + exact False.elim (not_entry_empty σ p h) + exact eq ▸ hτ + obtain ⟨τ, hτ⟩ := nonempty + exact step τ hτ + +theorem empty_value_mem (D : NameDomain s) (nonempty : D.names.Nonempty) (H : Set P) : + (∅ : ZFSet.{u}) ∈ D.values H := + (D.mem_values H ∅).2 ⟨empty s, D.empty_mem nonempty, eval_empty H⟩ + +end PartitionPilot.Forcing.Name.NameDomain + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] + +theorem empty_hs (a : PosetAction G P) (s : Presentation P) (F : NormalSubgroupFamily G) : + HereditarilySymmetric a s F (Name.empty s) := by + refine HereditarilySymmetric.mk (F.upward F.top ?_) ?_ + · intro g _ + exact Name.rename_empty s (a.iso g) + · intro σ p entry + exact False.elim (Name.not_entry_empty σ p entry) + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.SetFormula + +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +theorem realize_emptySet (D : Name.NameDomain s) (nonempty : D.names.Nonempty) (H : Set P) : + Realize (D.values H) emptySet Fin.elim0 := by + rw [emptySet, realize_ex] + refine ⟨∅, D.empty_value_mem nonempty H, ?_⟩ + intro x _ member + exact ZFSet.notMem_empty x member + +end PartitionPilot.Forcing.SetFormula + +end + + +namespace PartitionPilot.Forcing.HereditarilySymmetric +open SetRealization Compression.RecursiveMaps +universe u v +variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] +variable {G : Type v} [Group G] +variable {a : PosetAction G P} {s : Presentation P} +variable (e : PosetAction G Q) (t : Presentation Q) (f : P → Q) +variable (equivariant : ∀ g p, f (a.iso g p) = e.iso g (f p)) +variable {F : NormalSubgroupFamily G} +include equivariant + +theorem rename {τ : Name s} (hs : HereditarilySymmetric a s F τ) : + HereditarilySymmetric e t F (Name.rename t f τ) := by + induction τ using Name.inductionOn with + | step τ ih => + refine .mk ?_ ?_ + · exact F.upward hs.symmetric (a.stabilizer_le_rename e s t f equivariant τ) + · intro ν q entry + obtain ⟨σ, p, old, rfl, _⟩ := (Name.entry_rename t f τ ν q).1 entry + exact ih σ p old (hs.member old) + +end PartitionPilot.Forcing.HereditarilySymmetric + + + +namespace PartitionPilot.Compression.RecursiveMaps.NormalSubgroupFamily + +universe u +variable {G : Type u} [Group G] + +theorem fin_iInf (F : NormalSubgroupFamily G) {n : Nat} + (K : Fin n → Subgroup G) (hK : ∀ i, F.mem (K i)) : F.mem (⨅ i, K i) := by + induction n with + | zero => + apply F.upward F.top + apply le_iInf + intro i + exact Fin.elim0 i + | succ n ih => + have split : (⨅ i, K i) = K 0 ⊓ ⨅ i : Fin n, K i.succ := by + apply le_antisymm + · exact le_inf (iInf_le K 0) (le_iInf (fun i => iInf_le K i.succ)) + · apply le_iInf + intro i + refine Fin.cases ?_ (fun j => ?_) i + · exact inf_le_left + · exact le_trans inf_le_right (iInf_le (fun j : Fin n => K j.succ) j) + rw [split] + exact F.inf (hK 0) (ih (fun i => K i.succ) (fun i => hK i.succ)) + +end PartitionPilot.Compression.RecursiveMaps.NormalSubgroupFamily + + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u +variable {G P : Type u} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) + +noncomputable def orbitPairGraph (tuple tau : Name s) : Name s := + assemble (fun g : G => orderedPair ⊤ (a.act s g tuple) (a.act s g tau)) (fun _ => ⊤) + +theorem entry_orbitPairGraph (tuple tau sigma : Name s) (p : P) : + Entry sigma (orbitPairGraph a s tuple tau) p ↔ + ∃ g : G, orderedPair ⊤ (a.act s g tuple) (a.act s g tau) = sigma ∧ p = ⊤ := by + rw [orbitPairGraph, entry_assemble] + exact exists_congr (fun _ => and_congr_right (fun _ => eq_comm)) + +theorem mem_eval_orbitPairGraph (tuple tau : Name s) (H : Set P) (topMember : (⊤ : P) ∈ H) + (z : ZFSet.{u}) : + z ∈ eval H (orbitPairGraph a s tuple tau) ↔ + ∃ g : G, ZFSet.pair (eval H (a.act s g tuple)) (eval H (a.act s g tau)) = z := by + rw [mem_eval] + constructor + · rintro ⟨sigma, p, entry, _hp, equal⟩ + obtain ⟨g, rfl, rfl⟩ := (entry_orbitPairGraph a s tuple tau sigma p).1 entry + exact ⟨g, (eval_orderedPair H ⊤ topMember _ _).symm.trans equal⟩ + · rintro ⟨g, equal⟩ + exact ⟨orderedPair ⊤ (a.act s g tuple) (a.act s g tau), ⊤, + (entry_orbitPairGraph a s tuple tau _ ⊤).2 ⟨g, rfl, rfl⟩, + topMember, (eval_orderedPair H ⊤ topMember _ _).trans equal⟩ + +private theorem act_pair (g : G) (x y : Name s) : + a.act s g (orderedPair ⊤ x y) = orderedPair ⊤ (a.act s g x) (a.act s g y) := by + change rename s (a.iso g) (orderedPair ⊤ x y) = _ + rw [rename_orderedPair, (a.iso g).map_top] + rfl + +theorem act_orbitPairGraph (tuple tau : Name s) (g : G) : + a.act s g (orbitPairGraph a s tuple tau) = orbitPairGraph a s tuple tau := by + apply Name.ext + intro sigma p + change Entry sigma (rename s (a.iso g) (orbitPairGraph a s tuple tau)) p ↔ _ + rw [entry_rename, entry_orbitPairGraph] + constructor + · rintro ⟨nu, q, entry, equal, condition⟩ + obtain ⟨h, rfl, rfl⟩ := (entry_orbitPairGraph a s tuple tau nu q).1 entry + change a.act s g (orderedPair ⊤ (a.act s h tuple) (a.act s h tau)) = sigma at equal + rw [act_pair, ← a.act_mul, ← a.act_mul] at equal + exact ⟨g * h, equal, condition.symm.trans (a.iso g).map_top⟩ + · rintro ⟨h, rfl, rfl⟩ + refine ⟨orderedPair ⊤ (a.act s (g⁻¹ * h) tuple) (a.act s (g⁻¹ * h) tau), ⊤, + (entry_orbitPairGraph a s tuple tau _ ⊤).2 ⟨g⁻¹ * h, rfl, rfl⟩, ?_, (a.iso g).map_top⟩ + change a.act s g (orderedPair ⊤ (a.act s (g⁻¹ * h) tuple) (a.act s (g⁻¹ * h) tau)) = _ + rw [act_pair, ← a.act_mul, ← a.act_mul, mul_inv_cancel_left] + +theorem orbitPairGraph_hs (F : NormalSubgroupFamily G) (tuple tau : Name s) + (tupleHS : HereditarilySymmetric a s F tuple) (tauHS : HereditarilySymmetric a s F tau) : + HereditarilySymmetric a s F (orbitPairGraph a s tuple tau) := by + apply HereditarilySymmetric.mk (F.upward F.top ?_) ?_ + · intro g _ + exact act_orbitPairGraph a s tuple tau g + · intro sigma p entry + obtain ⟨g, rfl, _⟩ := (entry_orbitPairGraph a s tuple tau sigma p).1 entry + exact (tupleHS.translated g).orderedPair (tauHS.translated g) + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem pair_left {x y : ZFSet.{u}} (h : ZFSet.pair x y ∈ M.sets) : x ∈ M.sets := + M.transitive (M.transitive h (ZFSet.mem_pair.2 (Or.inl rfl))) (ZFSet.mem_singleton.2 rfl) + +theorem pair_right {x y : ZFSet.{u}} (h : ZFSet.pair x y ∈ M.sets) : y ∈ M.sets := + M.transitive (M.transitive h (ZFSet.mem_pair.2 (Or.inr rfl))) (ZFSet.mem_pair.2 (Or.inr rfl)) + +def nameDomain : Name.NameDomain s where + names := {τ | τ.val ∈ M.sets} + children hτ entry := M.pair_left (M.transitive hτ entry) + +theorem mem_nameDomain (τ : Name s) : τ ∈ (M.nameDomain s).names ↔ τ.val ∈ M.sets := Iff.rfl + +theorem empty_mem (nonempty : M.sets.Nonempty) : (∅ : ZFSet.{u}) ∈ M.sets := by + classical + have descend : ∀ x : ZFSet.{u}, x ∈ M.sets → (∅ : ZFSet.{u}) ∈ M.sets := by + intro x + induction x using ZFSet.inductionOn with + | h x ih => + intro hx + by_cases member : ∃ y, y ∈ x + · obtain ⟨y, hy⟩ := member + exact ih y hy (M.transitive hx hy) + · have eq : x = ∅ := by + apply ZFSet.ext + intro y + exact ⟨fun h => False.elim (member ⟨y, h⟩), fun h => False.elim (ZFSet.notMem_empty y h)⟩ + exact eq ▸ hx + obtain ⟨x, hx⟩ := nonempty + exact descend x hx + +theorem nameDomain_nonempty (nonempty : M.sets.Nonempty) : (M.nameDomain s).names.Nonempty := + ⟨Name.empty s, M.empty_mem nonempty⟩ + +theorem nameDomain_countable (small : M.sets.Countable) : (M.nameDomain s).names.Countable := + small.preimage Subtype.val_injective + +theorem conditions_countable (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) : + Countable P := by + let : Countable M.sets := small + let f : P → M.sets := fun p => ⟨s.encode p, M.transitive carrier (s.encode_mem p)⟩ + have injective : Function.Injective f := fun _ _ h => s.injective (congrArg Subtype.val h) + exact injective.countable + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OwnerBirthLayerTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OwnerBirthLayerTransport.lean index 8469434d041677dcbf2fc0708d81017ff4148317..9322c5ed3eb1e37eb9592d7cb8dbcfbf457580da 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OwnerBirthLayerTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/OwnerBirthLayerTransport.lean @@ -1,146 +1,146 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHeightPushforward -import OAI.SetTheory.PartitionPrinciple.Transfinite.OwnerBirthLayers - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem MeetEmbeddingCode.compose {A B C rA rB rC μA μB μC e f : ZFSet.{u}} - (first : MeetEmbeddingCode A B rA rB μA μB e) - (second : MeetEmbeddingCode B C rB rC μB μC f) : - MeetEmbeddingCode A C rA rC μA μC (relationCompose A B C e f) := by - refine ⟨first.injection.compose second.injection, ?_, ?_⟩ - · intro x y x' y' lower xx yy - obtain ⟨_, _, a, _, xa, ax⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx - obtain ⟨_, _, b, _, yb, by'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy - exact second.monotone a b x' y' (first.monotone x y a b lower xa yb) ax by' - · intro x y z x' y' z' meet xx yy zz - obtain ⟨_, _, a, _, xa, ax⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx - obtain ⟨_, _, b, _, yb, by'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy - obtain ⟨_, _, c, _, zc, cz⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 zz - exact second.map_meet a b c x' y' z' (first.map_meet x y z a b c meet xa yb zc) ax by' cz - -theorem relationImage_compose_point {A B C e f x y : ZFSet.{u}} - (image : x ∈ relationImage A B e) (hy : y ∈ C) (entry : ZFSet.pair x y ∈ f) : - y ∈ relationImage A C (relationCompose A B C e f) := by - obtain ⟨hx, a, ha, copied⟩ := (mem_relationImage _ _ _ _).1 image - exact (mem_relationImage _ _ _ _).2 ⟨hy, a, ha, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨ha, hy, x, hx, copied, entry⟩⟩ - -theorem OldBridgeCode.map {A B rA rB μA μB birthA birthB t x y x' y' e : ZFSet.{u}} - (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) - (preserves : ∀ a b s, ZFSet.pair a b ∈ e → ZFSet.pair a s ∈ birthA → ZFSet.pair b s ∈ birthB) - (xx : ZFSet.pair x x' ∈ e) (yy : ZFSet.pair y y' ∈ e) - (bridge : OldBridgeCode A rA μA birthA t x y) : OldBridgeCode B rB μB birthB t x' y' := by - rcases bridge with ⟨z, s, meet, born, before⟩ | ⟨z, hz, s, born, before, between⟩ - · have hz := (ZFSet.pair_mem_prod.1 (source.operation.1 meet)).2 - obtain ⟨z', zz, _⟩ := embedding.injection.function.2 z hz - exact Or.inl ⟨z', s, embedding.map_meet x y z x' y' z' meet xx yy zz, - preserves z z' s zz born, before⟩ - · obtain ⟨z', zz, _⟩ := embedding.injection.function.2 z hz - refine Or.inr ⟨z', (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 zz)).2, - s, preserves z z' s zz born, before, ?_⟩ - exact between.elim - (fun h => Or.inl ⟨embedding.monotone x z x' z' h.1 xx zz, embedding.monotone z y z' y' h.2 zz yy⟩) - (fun h => Or.inr ⟨embedding.monotone y z y' z' h.1 yy zz, embedding.monotone z x z' x' h.2 zz xx⟩) - -noncomputable def CodedGrowthLayer.pushforward - {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {A B rA rB μA μB old born t e : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet A rA μA old t) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) - (groundSources : ∀ s ∈ t, Space s ∈ M.sets) - (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) - (preserves : ∀ x y a, ZFSet.pair x y ∈ e → (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) - (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : - CodedGrowthLayer M Space sourceOrder sourceMeet B rB μB born t := by - classical - cases layer with - | countablePoints D ground small cover => - let retained := ZFSet.sep (fun x => x ∈ A) D - have retainedGround : retained ∈ M.sets := - M.bounded_separation_mem separation (.mem 0 1) (extend A Fin.elim0) - (Fin.cases hA (fun i => Fin.elim0 i)) ground - have retainedSmall := M.groundEmbeddable_restrict separation retainedGround hOmega - (fun _ h => (ZFSet.mem_sep.1 h).1) small - refine .countablePoints (relationImage retained B e) - (M.relationImage_mem separation retainedGround hB he) - (M.groundEmbeddable_image pairing unions powers separation retainedGround hB hOmega he - embedding.injection (fun _ h => (ZFSet.mem_sep.1 h).2) retainedSmall) ?_ - intro y hy yt - obtain ⟨x, hx, xy⟩ := noNew y hy yt - exact (mem_relationImage _ _ _ _).2 ⟨hy, x, - ZFSet.mem_sep.2 ⟨cover x hx ((preserves x y t xy).1 yt), hx⟩, xy⟩ - | copies I parts groundI small groundParts index copy earlier groundCopy copyCode cover inCopy => - refine .copies I (relationCompose I A B parts e) groundI small - (M.relationCompose_mem pairing unions powers separation groundI hA hB groundParts he) - index (fun i => relationCompose (Space (index i)) A B (copy i) e) earlier - (fun i hi => M.relationCompose_mem pairing unions powers separation - (groundSources (index i) (earlier i hi)) hA hB (groundCopy i hi) he) - (fun i hi => (copyCode i hi).compose embedding) ?_ ?_ - · intro y hy yt - obtain ⟨x, hx, xy⟩ := noNew y hy yt - obtain ⟨i, hi, part⟩ := cover x hx ((preserves x y t xy).1 yt) - exact ⟨i, hi, (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hi, hy, x, hx, part, xy⟩⟩ - · intro i hi y hy part - obtain ⟨_, _, x, hx, oldPart, xy⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 part - exact relationImage_compose_point (inCopy i hi x hx oldPart) hy xy - | separated I index copy earlier groundCopy copyCode component cover separated => - let pre (x : {x : ZFSet.{u} // x ∈ B ∧ ZFSet.pair x t ∈ born}) : - {x : ZFSet.{u} // x ∈ A ∧ ZFSet.pair x t ∈ old} := - let a := Classical.choose (noNew x.val x.property.1 x.property.2) - have spec := Classical.choose_spec (noNew x.val x.property.1 x.property.2) - ⟨a, spec.1, (preserves a x.val t spec.2).1 x.property.2⟩ - have preEntry (x : {x : ZFSet.{u} // x ∈ B ∧ ZFSet.pair x t ∈ born}) : - ZFSet.pair (pre x).val x.val ∈ e := - (Classical.choose_spec (noNew x.val x.property.1 x.property.2)).2 - refine .separated I index (fun i => relationCompose (Space (index i)) A B (copy i) e) earlier - (fun i => M.relationCompose_mem pairing unions powers separation - (groundSources (index i) (earlier i)) hA hB (groundCopy i) he) - (fun i => (copyCode i).compose embedding) (fun x => component (pre x)) ?_ ?_ - · intro x - exact relationImage_compose_point (cover (pre x)) x.property.1 (preEntry x) - · intro x y different - exact (separated (pre x) (pre y) different).map source embedding - (fun a b s copied born => (preserves a b s copied).2 born) (preEntry x) (preEntry y) - -noncomputable def CodedGrowthLayer.ownerBirth_pushforward - {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {A B L rA rL μA μL old T0 T levels stamps t e : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet A rA μA old t) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hL : L ∈ M.sets) (he : e ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) - (groundSources : ∀ s ∈ t, Space s ∈ M.sets) - (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A L rA rL μA μL e) - (carrier : L ⊆ B) (oldFunction : ZFSet.IsFunc A T0 old) - (before : ∀ n a, ZFSet.pair (natSetCode n) a ∈ stamps → t ∈ a) : - CodedGrowthLayer M Space sourceOrder sourceMeet L rL μL - (ownerBirthGraph (relationImage A B e) B T (pushedHeightGraph A B T0 e old) levels stamps) t := by - have injection : InjectionCode A B e := by - refine ⟨⟨?_, embedding.injection.function.2⟩, embedding.injection.injective⟩ - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (embedding.injection.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, carrier hy⟩ - have pushed := pushedHeightGraph_function injection oldFunction - apply layer.pushforward pairing unions powers separation hA hL he hOmega groundSources source embedding - · intro x y a copied - have bounds := ZFSet.pair_mem_prod.1 (injection.function.1 copied) - have oldPoint := (mem_relationImage A B e y).2 ⟨bounds.2, x, bounds.1, copied⟩ - rw [ownerBirthGraph_old_iff oldPoint, pushedHeightGraph_entry injection oldFunction copied] - · intro y _ entry - rcases (pair_mem_ownerBirthGraph _ _ _ _ _ _ _ _).1 entry with oldEntry | freshEntry - · exact (mem_relationImage A B e y).1 (ZFSet.pair_mem_prod.1 (pushed.1 oldEntry)).1 |>.2 - · obtain ⟨_, _, _, n, hn, _, stamp⟩ := freshEntry - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact (ZFSet.mem_irrefl t (before n t stamp)).elim - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundHeightPushforward +import OAI.SetTheory.PartitionPrinciple.Transfinite.OwnerBirthLayers + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem MeetEmbeddingCode.compose {A B C rA rB rC μA μB μC e f : ZFSet.{u}} + (first : MeetEmbeddingCode A B rA rB μA μB e) + (second : MeetEmbeddingCode B C rB rC μB μC f) : + MeetEmbeddingCode A C rA rC μA μC (relationCompose A B C e f) := by + refine ⟨first.injection.compose second.injection, ?_, ?_⟩ + · intro x y x' y' lower xx yy + obtain ⟨_, _, a, _, xa, ax⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx + obtain ⟨_, _, b, _, yb, by'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy + exact second.monotone a b x' y' (first.monotone x y a b lower xa yb) ax by' + · intro x y z x' y' z' meet xx yy zz + obtain ⟨_, _, a, _, xa, ax⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx + obtain ⟨_, _, b, _, yb, by'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy + obtain ⟨_, _, c, _, zc, cz⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 zz + exact second.map_meet a b c x' y' z' (first.map_meet x y z a b c meet xa yb zc) ax by' cz + +theorem relationImage_compose_point {A B C e f x y : ZFSet.{u}} + (image : x ∈ relationImage A B e) (hy : y ∈ C) (entry : ZFSet.pair x y ∈ f) : + y ∈ relationImage A C (relationCompose A B C e f) := by + obtain ⟨hx, a, ha, copied⟩ := (mem_relationImage _ _ _ _).1 image + exact (mem_relationImage _ _ _ _).2 ⟨hy, a, ha, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨ha, hy, x, hx, copied, entry⟩⟩ + +theorem OldBridgeCode.map {A B rA rB μA μB birthA birthB t x y x' y' e : ZFSet.{u}} + (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) + (preserves : ∀ a b s, ZFSet.pair a b ∈ e → ZFSet.pair a s ∈ birthA → ZFSet.pair b s ∈ birthB) + (xx : ZFSet.pair x x' ∈ e) (yy : ZFSet.pair y y' ∈ e) + (bridge : OldBridgeCode A rA μA birthA t x y) : OldBridgeCode B rB μB birthB t x' y' := by + rcases bridge with ⟨z, s, meet, born, before⟩ | ⟨z, hz, s, born, before, between⟩ + · have hz := (ZFSet.pair_mem_prod.1 (source.operation.1 meet)).2 + obtain ⟨z', zz, _⟩ := embedding.injection.function.2 z hz + exact Or.inl ⟨z', s, embedding.map_meet x y z x' y' z' meet xx yy zz, + preserves z z' s zz born, before⟩ + · obtain ⟨z', zz, _⟩ := embedding.injection.function.2 z hz + refine Or.inr ⟨z', (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 zz)).2, + s, preserves z z' s zz born, before, ?_⟩ + exact between.elim + (fun h => Or.inl ⟨embedding.monotone x z x' z' h.1 xx zz, embedding.monotone z y z' y' h.2 zz yy⟩) + (fun h => Or.inr ⟨embedding.monotone y z y' z' h.1 yy zz, embedding.monotone z x z' x' h.2 zz xx⟩) + +noncomputable def CodedGrowthLayer.pushforward + {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {A B rA rB μA μB old born t e : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet A rA μA old t) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) + (groundSources : ∀ s ∈ t, Space s ∈ M.sets) + (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) + (preserves : ∀ x y a, ZFSet.pair x y ∈ e → (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) + (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : + CodedGrowthLayer M Space sourceOrder sourceMeet B rB μB born t := by + classical + cases layer with + | countablePoints D ground small cover => + let retained := ZFSet.sep (fun x => x ∈ A) D + have retainedGround : retained ∈ M.sets := + M.bounded_separation_mem separation (.mem 0 1) (extend A Fin.elim0) + (Fin.cases hA (fun i => Fin.elim0 i)) ground + have retainedSmall := M.groundEmbeddable_restrict separation retainedGround hOmega + (fun _ h => (ZFSet.mem_sep.1 h).1) small + refine .countablePoints (relationImage retained B e) + (M.relationImage_mem separation retainedGround hB he) + (M.groundEmbeddable_image pairing unions powers separation retainedGround hB hOmega he + embedding.injection (fun _ h => (ZFSet.mem_sep.1 h).2) retainedSmall) ?_ + intro y hy yt + obtain ⟨x, hx, xy⟩ := noNew y hy yt + exact (mem_relationImage _ _ _ _).2 ⟨hy, x, + ZFSet.mem_sep.2 ⟨cover x hx ((preserves x y t xy).1 yt), hx⟩, xy⟩ + | copies I parts groundI small groundParts index copy earlier groundCopy copyCode cover inCopy => + refine .copies I (relationCompose I A B parts e) groundI small + (M.relationCompose_mem pairing unions powers separation groundI hA hB groundParts he) + index (fun i => relationCompose (Space (index i)) A B (copy i) e) earlier + (fun i hi => M.relationCompose_mem pairing unions powers separation + (groundSources (index i) (earlier i hi)) hA hB (groundCopy i hi) he) + (fun i hi => (copyCode i hi).compose embedding) ?_ ?_ + · intro y hy yt + obtain ⟨x, hx, xy⟩ := noNew y hy yt + obtain ⟨i, hi, part⟩ := cover x hx ((preserves x y t xy).1 yt) + exact ⟨i, hi, (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hi, hy, x, hx, part, xy⟩⟩ + · intro i hi y hy part + obtain ⟨_, _, x, hx, oldPart, xy⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 part + exact relationImage_compose_point (inCopy i hi x hx oldPart) hy xy + | separated I index copy earlier groundCopy copyCode component cover separated => + let pre (x : {x : ZFSet.{u} // x ∈ B ∧ ZFSet.pair x t ∈ born}) : + {x : ZFSet.{u} // x ∈ A ∧ ZFSet.pair x t ∈ old} := + let a := Classical.choose (noNew x.val x.property.1 x.property.2) + have spec := Classical.choose_spec (noNew x.val x.property.1 x.property.2) + ⟨a, spec.1, (preserves a x.val t spec.2).1 x.property.2⟩ + have preEntry (x : {x : ZFSet.{u} // x ∈ B ∧ ZFSet.pair x t ∈ born}) : + ZFSet.pair (pre x).val x.val ∈ e := + (Classical.choose_spec (noNew x.val x.property.1 x.property.2)).2 + refine .separated I index (fun i => relationCompose (Space (index i)) A B (copy i) e) earlier + (fun i => M.relationCompose_mem pairing unions powers separation + (groundSources (index i) (earlier i)) hA hB (groundCopy i) he) + (fun i => (copyCode i).compose embedding) (fun x => component (pre x)) ?_ ?_ + · intro x + exact relationImage_compose_point (cover (pre x)) x.property.1 (preEntry x) + · intro x y different + exact (separated (pre x) (pre y) different).map source embedding + (fun a b s copied born => (preserves a b s copied).2 born) (preEntry x) (preEntry y) + +noncomputable def CodedGrowthLayer.ownerBirth_pushforward + {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {A B L rA rL μA μL old T0 T levels stamps t e : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet A rA μA old t) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hL : L ∈ M.sets) (he : e ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) + (groundSources : ∀ s ∈ t, Space s ∈ M.sets) + (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A L rA rL μA μL e) + (carrier : L ⊆ B) (oldFunction : ZFSet.IsFunc A T0 old) + (before : ∀ n a, ZFSet.pair (natSetCode n) a ∈ stamps → t ∈ a) : + CodedGrowthLayer M Space sourceOrder sourceMeet L rL μL + (ownerBirthGraph (relationImage A B e) B T (pushedHeightGraph A B T0 e old) levels stamps) t := by + have injection : InjectionCode A B e := by + refine ⟨⟨?_, embedding.injection.function.2⟩, embedding.injection.injective⟩ + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (embedding.injection.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, carrier hy⟩ + have pushed := pushedHeightGraph_function injection oldFunction + apply layer.pushforward pairing unions powers separation hA hL he hOmega groundSources source embedding + · intro x y a copied + have bounds := ZFSet.pair_mem_prod.1 (injection.function.1 copied) + have oldPoint := (mem_relationImage A B e y).2 ⟨bounds.2, x, bounds.1, copied⟩ + rw [ownerBirthGraph_old_iff oldPoint, pushedHeightGraph_entry injection oldFunction copied] + · intro y _ entry + rcases (pair_mem_ownerBirthGraph _ _ _ _ _ _ _ _).1 entry with oldEntry | freshEntry + · exact (mem_relationImage A B e y).1 (ZFSet.pair_mem_prod.1 (pushed.1 oldEntry)).1 |>.2 + · obtain ⟨_, _, _, n, hn, _, stamp⟩ := freshEntry + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact (ZFSet.mem_irrefl t (before n t stamp)).elim + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PairFamilyEvaluation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PairFamilyEvaluation.lean index 9fd7081c38388e20060fd896371c47b3fa02fcd8..886bfb9321e3ba0fd14843fcadb8173ad06f252e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PairFamilyEvaluation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PairFamilyEvaluation.lean @@ -1,175 +1,175 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} {s : Presentation P} - -theorem orderedPairNameFamily_valid (one : P) {X Y : ZFSet.{u}} - (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) : - ∀ z ∈ orderedPairNameFamily (s.encode one) X Y, IsName s z := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := (mem_orderedPairNameFamily _ X Y z).1 hz - have code := Name.orderedPair_code one (⟨x, validX x hx⟩ : Name s) - (⟨y, validY y hy⟩ : Name s) - exact code ▸ (Name.orderedPair one ⟨x, validX x hx⟩ ⟨y, validY y hy⟩).property - -theorem iteratedPairNameFamily_valid (one : P) {T : ZFSet.{u}} - (valid : ∀ z ∈ T, IsName s z) (n : Nat) : - ∀ z ∈ iteratedPairNameFamily (s.encode one) T n, IsName s z := by - induction n with - | zero => exact valid - | succ n ih => exact orderedPairNameFamily_valid one ih valid - -variable {G : Type v} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (F : NormalSubgroupFamily G) - -theorem orderedPairNameFamily_hs {X Y : ZFSet.{u}} - (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) - (childrenX : ∀ τ : Name s, τ.val ∈ X → HereditarilySymmetric a s F τ) - (childrenY : ∀ τ : Name s, τ.val ∈ Y → HereditarilySymmetric a s F τ) : - ∀ τ : Name s, τ.val ∈ orderedPairNameFamily (s.encode ⊤) X Y → - HereditarilySymmetric a s F τ := by - intro τ hτ - obtain ⟨x, hx, y, hy, equal⟩ := (mem_orderedPairNameFamily _ X Y τ.val).1 hτ - let σ : Name s := ⟨x, validX x hx⟩ - let ν : Name s := ⟨y, validY y hy⟩ - have same : τ = Name.orderedPair ⊤ σ ν := - Subtype.ext (equal.trans (Name.orderedPair_code ⊤ σ ν).symm) - rw [same] - exact (childrenX σ hx).orderedPair (childrenY ν hy) - -theorem orderedPairNameFamily_closed {X Y : ZFSet.{u}} - (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) - (closedX : ∀ g (τ : Name s), τ.val ∈ X → (a.act s g τ).val ∈ X) - (closedY : ∀ g (τ : Name s), τ.val ∈ Y → (a.act s g τ).val ∈ Y) : - ∀ g (τ : Name s), τ.val ∈ orderedPairNameFamily (s.encode ⊤) X Y → - (a.act s g τ).val ∈ orderedPairNameFamily (s.encode ⊤) X Y := by - intro g τ hτ - obtain ⟨x, hx, y, hy, equal⟩ := (mem_orderedPairNameFamily _ X Y τ.val).1 hτ - let σ : Name s := ⟨x, validX x hx⟩ - let ν : Name s := ⟨y, validY y hy⟩ - have same : τ = Name.orderedPair ⊤ σ ν := - Subtype.ext (equal.trans (Name.orderedPair_code ⊤ σ ν).symm) - have acted : a.act s g τ = Name.orderedPair ⊤ (a.act s g σ) (a.act s g ν) := by - rw [same] - change Name.rename s (a.iso g) _ = _ - rw [Name.rename_orderedPair, (a.iso g).map_top] - rfl - exact (mem_orderedPairNameFamily _ X Y _).2 - ⟨(a.act s g σ).val, closedX g σ hx, (a.act s g ν).val, closedY g ν hy, - (congrArg Subtype.val acted).trans (Name.orderedPair_code ⊤ _ _)⟩ - -theorem iteratedPairNameFamily_hs {T : ZFSet.{u}} - (valid : ∀ z ∈ T, IsName s z) - (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) (n : Nat) : - ∀ τ : Name s, τ.val ∈ iteratedPairNameFamily (s.encode ⊤) T n → - HereditarilySymmetric a s F τ := by - induction n with - | zero => exact children - | succ n ih => - exact orderedPairNameFamily_hs a F - (iteratedPairNameFamily_valid ⊤ valid n) valid ih children - -theorem iteratedPairNameFamily_closed {T : ZFSet.{u}} - (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) (n : Nat) : - ∀ g (τ : Name s), τ.val ∈ iteratedPairNameFamily (s.encode ⊤) T n → - (a.act s g τ).val ∈ iteratedPairNameFamily (s.encode ⊤) T n := by - induction n with - | zero => exact closed - | succ n ih => - exact orderedPairNameFamily_closed a - (iteratedPairNameFamily_valid ⊤ valid n) valid ih closed - -theorem iteratedPairNameFamilySet_invariant {T : ZFSet.{u}} - (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (n : Nat) (g : G) : - a.act s g (Name.familySet ⊤ (iteratedPairNameFamily (s.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n)) = - Name.familySet ⊤ (iteratedPairNameFamily (s.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) := - Name.act_familySet a _ _ (iteratedPairNameFamily_closed a valid closed n) g - -theorem iteratedPairNameFamilySet_hs {T : ZFSet.{u}} - (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) (n : Nat) : - HereditarilySymmetric a s F - (Name.familySet ⊤ (iteratedPairNameFamily (s.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n)) := - Name.familySet_hs a F _ _ (iteratedPairNameFamily_closed a valid closed n) - (iteratedPairNameFamily_hs a F valid children n) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -theorem eval_familySet_orderedPairNameFamily (H : Set P) (one : P) (hone : one ∈ H) - (X Y : ZFSet.{u}) (validX : ∀ z ∈ X, IsName s z) - (validY : ∀ z ∈ Y, IsName s z) - (validPair : ∀ z ∈ orderedPairNameFamily (s.encode one) X Y, IsName s z) : - eval H (familySet one (orderedPairNameFamily (s.encode one) X Y) validPair) = - ZFSet.prod (eval H (familySet one X validX)) (eval H (familySet one Y validY)) := by - apply ZFSet.ext - intro z - rw [mem_eval_familySet H one hone, ZFSet.mem_prod] - constructor - · rintro ⟨tau, member, value⟩ - obtain ⟨x, hx, y, hy, equal⟩ := (mem_orderedPairNameFamily _ X Y tau.val).1 member - let sigma : Name s := ⟨x, validX x hx⟩ - let nu : Name s := ⟨y, validY y hy⟩ - have same : tau = orderedPair one sigma nu := - Subtype.ext (equal.trans (orderedPair_code one sigma nu).symm) - refine ⟨eval H sigma, (mem_eval_familySet H one hone X validX _).2 ⟨sigma, hx, rfl⟩, - eval H nu, (mem_eval_familySet H one hone Y validY _).2 ⟨nu, hy, rfl⟩, ?_⟩ - rw [same, eval_orderedPair H one hone] at value - exact value.symm - · rintro ⟨x, hx, y, hy, equal⟩ - obtain ⟨sigma, memberX, valueX⟩ := (mem_eval_familySet H one hone X validX x).1 hx - obtain ⟨nu, memberY, valueY⟩ := (mem_eval_familySet H one hone Y validY y).1 hy - refine ⟨orderedPair one sigma nu, ?_, ?_⟩ - · exact (mem_orderedPairNameFamily _ X Y _).2 - ⟨sigma.val, memberX, nu.val, memberY, orderedPair_code one sigma nu⟩ - · rw [eval_orderedPair H one hone, valueX, valueY] - exact equal.symm - -theorem refinementValidity_familySet_power_bounds (H : Set P) (one : P) (hone : one ∈ H) - (oneCode T : ZFSet.{u}) (sameCode : oneCode = s.encode one) - (valid : ∀ z ∈ T, IsName s z) - (validPower : ∀ i : Fin 3, ∀ z ∈ iteratedPairNameFamily oneCode T (![0, 1, 1] i), - IsName s z) - (values : Fin 3 → ZFSet.{u}) - (raw : RefinementValidityCode (eval H (familySet one T valid)) - (values 0) (values 1) (values 2)) : - ∀ i : Fin 3, values i ⊆ - eval H (familySet one (iteratedPairNameFamily oneCode T (![0, 1, 1] i)) (validPower i)) := by - subst oneCode - have relationBound (R : ZFSet.{u}) (shape : R ⊆ ZFSet.prod (values 0) (values 0)) : - R ⊆ eval H (familySet one (orderedPairNameFamily (s.encode one) T T) - (orderedPairNameFamily_valid one valid valid)) := by - rw [eval_familySet_orderedPairNameFamily H one hone T T valid valid] - intro z member - obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 (shape member) - exact ZFSet.mem_prod.2 ⟨x, raw.1 hx, y, raw.1 hy, equal⟩ - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i))) - · exact raw.1 - · exact relationBound (values 1) raw.2.1.shape - · exact relationBound (values 2) raw.2.2.1.shape - -end PartitionPilot.Forcing.Name - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} {s : Presentation P} + +theorem orderedPairNameFamily_valid (one : P) {X Y : ZFSet.{u}} + (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) : + ∀ z ∈ orderedPairNameFamily (s.encode one) X Y, IsName s z := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := (mem_orderedPairNameFamily _ X Y z).1 hz + have code := Name.orderedPair_code one (⟨x, validX x hx⟩ : Name s) + (⟨y, validY y hy⟩ : Name s) + exact code ▸ (Name.orderedPair one ⟨x, validX x hx⟩ ⟨y, validY y hy⟩).property + +theorem iteratedPairNameFamily_valid (one : P) {T : ZFSet.{u}} + (valid : ∀ z ∈ T, IsName s z) (n : Nat) : + ∀ z ∈ iteratedPairNameFamily (s.encode one) T n, IsName s z := by + induction n with + | zero => exact valid + | succ n ih => exact orderedPairNameFamily_valid one ih valid + +variable {G : Type v} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (F : NormalSubgroupFamily G) + +theorem orderedPairNameFamily_hs {X Y : ZFSet.{u}} + (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) + (childrenX : ∀ τ : Name s, τ.val ∈ X → HereditarilySymmetric a s F τ) + (childrenY : ∀ τ : Name s, τ.val ∈ Y → HereditarilySymmetric a s F τ) : + ∀ τ : Name s, τ.val ∈ orderedPairNameFamily (s.encode ⊤) X Y → + HereditarilySymmetric a s F τ := by + intro τ hτ + obtain ⟨x, hx, y, hy, equal⟩ := (mem_orderedPairNameFamily _ X Y τ.val).1 hτ + let σ : Name s := ⟨x, validX x hx⟩ + let ν : Name s := ⟨y, validY y hy⟩ + have same : τ = Name.orderedPair ⊤ σ ν := + Subtype.ext (equal.trans (Name.orderedPair_code ⊤ σ ν).symm) + rw [same] + exact (childrenX σ hx).orderedPair (childrenY ν hy) + +theorem orderedPairNameFamily_closed {X Y : ZFSet.{u}} + (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) + (closedX : ∀ g (τ : Name s), τ.val ∈ X → (a.act s g τ).val ∈ X) + (closedY : ∀ g (τ : Name s), τ.val ∈ Y → (a.act s g τ).val ∈ Y) : + ∀ g (τ : Name s), τ.val ∈ orderedPairNameFamily (s.encode ⊤) X Y → + (a.act s g τ).val ∈ orderedPairNameFamily (s.encode ⊤) X Y := by + intro g τ hτ + obtain ⟨x, hx, y, hy, equal⟩ := (mem_orderedPairNameFamily _ X Y τ.val).1 hτ + let σ : Name s := ⟨x, validX x hx⟩ + let ν : Name s := ⟨y, validY y hy⟩ + have same : τ = Name.orderedPair ⊤ σ ν := + Subtype.ext (equal.trans (Name.orderedPair_code ⊤ σ ν).symm) + have acted : a.act s g τ = Name.orderedPair ⊤ (a.act s g σ) (a.act s g ν) := by + rw [same] + change Name.rename s (a.iso g) _ = _ + rw [Name.rename_orderedPair, (a.iso g).map_top] + rfl + exact (mem_orderedPairNameFamily _ X Y _).2 + ⟨(a.act s g σ).val, closedX g σ hx, (a.act s g ν).val, closedY g ν hy, + (congrArg Subtype.val acted).trans (Name.orderedPair_code ⊤ _ _)⟩ + +theorem iteratedPairNameFamily_hs {T : ZFSet.{u}} + (valid : ∀ z ∈ T, IsName s z) + (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) (n : Nat) : + ∀ τ : Name s, τ.val ∈ iteratedPairNameFamily (s.encode ⊤) T n → + HereditarilySymmetric a s F τ := by + induction n with + | zero => exact children + | succ n ih => + exact orderedPairNameFamily_hs a F + (iteratedPairNameFamily_valid ⊤ valid n) valid ih children + +theorem iteratedPairNameFamily_closed {T : ZFSet.{u}} + (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) (n : Nat) : + ∀ g (τ : Name s), τ.val ∈ iteratedPairNameFamily (s.encode ⊤) T n → + (a.act s g τ).val ∈ iteratedPairNameFamily (s.encode ⊤) T n := by + induction n with + | zero => exact closed + | succ n ih => + exact orderedPairNameFamily_closed a + (iteratedPairNameFamily_valid ⊤ valid n) valid ih closed + +theorem iteratedPairNameFamilySet_invariant {T : ZFSet.{u}} + (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (n : Nat) (g : G) : + a.act s g (Name.familySet ⊤ (iteratedPairNameFamily (s.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n)) = + Name.familySet ⊤ (iteratedPairNameFamily (s.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) := + Name.act_familySet a _ _ (iteratedPairNameFamily_closed a valid closed n) g + +theorem iteratedPairNameFamilySet_hs {T : ZFSet.{u}} + (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) (n : Nat) : + HereditarilySymmetric a s F + (Name.familySet ⊤ (iteratedPairNameFamily (s.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n)) := + Name.familySet_hs a F _ _ (iteratedPairNameFamily_closed a valid closed n) + (iteratedPairNameFamily_hs a F valid children n) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +theorem eval_familySet_orderedPairNameFamily (H : Set P) (one : P) (hone : one ∈ H) + (X Y : ZFSet.{u}) (validX : ∀ z ∈ X, IsName s z) + (validY : ∀ z ∈ Y, IsName s z) + (validPair : ∀ z ∈ orderedPairNameFamily (s.encode one) X Y, IsName s z) : + eval H (familySet one (orderedPairNameFamily (s.encode one) X Y) validPair) = + ZFSet.prod (eval H (familySet one X validX)) (eval H (familySet one Y validY)) := by + apply ZFSet.ext + intro z + rw [mem_eval_familySet H one hone, ZFSet.mem_prod] + constructor + · rintro ⟨tau, member, value⟩ + obtain ⟨x, hx, y, hy, equal⟩ := (mem_orderedPairNameFamily _ X Y tau.val).1 member + let sigma : Name s := ⟨x, validX x hx⟩ + let nu : Name s := ⟨y, validY y hy⟩ + have same : tau = orderedPair one sigma nu := + Subtype.ext (equal.trans (orderedPair_code one sigma nu).symm) + refine ⟨eval H sigma, (mem_eval_familySet H one hone X validX _).2 ⟨sigma, hx, rfl⟩, + eval H nu, (mem_eval_familySet H one hone Y validY _).2 ⟨nu, hy, rfl⟩, ?_⟩ + rw [same, eval_orderedPair H one hone] at value + exact value.symm + · rintro ⟨x, hx, y, hy, equal⟩ + obtain ⟨sigma, memberX, valueX⟩ := (mem_eval_familySet H one hone X validX x).1 hx + obtain ⟨nu, memberY, valueY⟩ := (mem_eval_familySet H one hone Y validY y).1 hy + refine ⟨orderedPair one sigma nu, ?_, ?_⟩ + · exact (mem_orderedPairNameFamily _ X Y _).2 + ⟨sigma.val, memberX, nu.val, memberY, orderedPair_code one sigma nu⟩ + · rw [eval_orderedPair H one hone, valueX, valueY] + exact equal.symm + +theorem refinementValidity_familySet_power_bounds (H : Set P) (one : P) (hone : one ∈ H) + (oneCode T : ZFSet.{u}) (sameCode : oneCode = s.encode one) + (valid : ∀ z ∈ T, IsName s z) + (validPower : ∀ i : Fin 3, ∀ z ∈ iteratedPairNameFamily oneCode T (![0, 1, 1] i), + IsName s z) + (values : Fin 3 → ZFSet.{u}) + (raw : RefinementValidityCode (eval H (familySet one T valid)) + (values 0) (values 1) (values 2)) : + ∀ i : Fin 3, values i ⊆ + eval H (familySet one (iteratedPairNameFamily oneCode T (![0, 1, 1] i)) (validPower i)) := by + subst oneCode + have relationBound (R : ZFSet.{u}) (shape : R ⊆ ZFSet.prod (values 0) (values 0)) : + R ⊆ eval H (familySet one (orderedPairNameFamily (s.encode one) T T) + (orderedPairNameFamily_valid one valid valid)) := by + rw [eval_familySet_orderedPairNameFamily H one hone T T valid valid] + intro z member + obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 (shape member) + exact ZFSet.mem_prod.2 ⟨x, raw.1 hx, y, raw.1 hy, equal⟩ + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i))) + · exact raw.1 + · exact relationBound (values 1) raw.2.1.shape + · exact relationBound (values 2) raw.2.2.1.shape + +end PartitionPilot.Forcing.Name + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PreparedWitnessCertificateGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PreparedWitnessCertificateGraphs.lean index b3a2a9a2d253de8ee23d4c84d4f3d3cfa54ab46d..23199094df34ff12db8db3c77462f428a81bf70c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PreparedWitnessCertificateGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PreparedWitnessCertificateGraphs.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def preparedWitnessCertificateGraph (stages Q K E : ZFSet.{u}) : ZFSet.{u} := - let tail := ZFSet.prod K E - let output := ZFSet.prod Q tail - let L := ZFSet.prod stages output - relationCompose L tail K - (relationCompose L output tail (productSecond stages output) (productSecond Q tail)) - (productFirst K E) - -theorem preparedWitnessCertificateGraph_function (stages Q K E : ZFSet.{u}) : - ZFSet.IsFunc (ZFSet.prod stages (ZFSet.prod Q (ZFSet.prod K E))) K - (preparedWitnessCertificateGraph stages Q K E) := - relationCompose_function_of_subset - (relationCompose_function_of_subset (productSecond_function _ _) (productSecond_function _ _) - (fun _ h => h)) (productFirst_function _ _) (fun _ h => h) - -theorem pair_mem_preparedWitnessCertificateGraph (stages Q K E y k : ZFSet.{u}) : - ZFSet.pair y k ∈ preparedWitnessCertificateGraph stages Q K E ↔ - k ∈ K ∧ ∃ alpha ∈ stages, ∃ source ∈ Q, ∃ enumerations ∈ E, - y = ZFSet.pair alpha (ZFSet.pair source (ZFSet.pair k enumerations)) := by - rw [preparedWitnessCertificateGraph, pair_mem_relationCompose] - constructor - · rintro ⟨_, hk, tail, _, first, projected⟩ - obtain ⟨k', _, enums, he, equal⟩ := (mem_productFirst _ _ _).1 projected - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨_, _, output, _, first, second⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first - obtain ⟨source, hsource, tail', _, equal⟩ := (mem_productSecond _ _ _).1 second - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨alpha, ha, output', _, equal⟩ := (mem_productSecond _ _ _).1 first - obtain ⟨value, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hk, alpha, ha, source, hsource, enums, he, value⟩ - · rintro ⟨hk, alpha, ha, source, hs, enums, he, rfl⟩ - have ht := ZFSet.pair_mem_prod.2 ⟨hk, he⟩ - have ho := ZFSet.pair_mem_prod.2 ⟨hs, ht⟩ - have hy := ZFSet.pair_mem_prod.2 ⟨ha, ho⟩ - exact ⟨hy, hk, _, ht, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hy, ht, _, ho, - (mem_productSecond _ _ _).2 ⟨alpha, ha, _, ho, rfl⟩, - (mem_productSecond _ _ _).2 ⟨source, hs, _, ht, rfl⟩⟩, - (mem_productFirst _ _ _).2 ⟨k, hk, enums, he, rfl⟩⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem preparedWitnessCertificateGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {stages Q K E : ZFSet.{u}} (hStages : stages ∈ M.sets) (hQ : Q ∈ M.sets) - (hK : K ∈ M.sets) (hE : E ∈ M.sets) : - preparedWitnessCertificateGraph stages Q K E ∈ M.sets := by - have ht := M.prod_mem pairing unions powers separation hK hE - have ho := M.prod_mem pairing unions powers separation hQ ht - have hL := M.prod_mem pairing unions powers separation hStages ho - exact M.relationCompose_mem pairing unions powers separation hL ht hK - (M.relationCompose_mem pairing unions powers separation hL ho ht - (M.productSecond_mem pairing unions powers separation hStages ho) - (M.productSecond_mem pairing unions powers separation hQ ht)) - (M.productFirst_mem pairing unions powers separation hK hE) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def preparedWitnessCertificateGraph (stages Q K E : ZFSet.{u}) : ZFSet.{u} := + let tail := ZFSet.prod K E + let output := ZFSet.prod Q tail + let L := ZFSet.prod stages output + relationCompose L tail K + (relationCompose L output tail (productSecond stages output) (productSecond Q tail)) + (productFirst K E) + +theorem preparedWitnessCertificateGraph_function (stages Q K E : ZFSet.{u}) : + ZFSet.IsFunc (ZFSet.prod stages (ZFSet.prod Q (ZFSet.prod K E))) K + (preparedWitnessCertificateGraph stages Q K E) := + relationCompose_function_of_subset + (relationCompose_function_of_subset (productSecond_function _ _) (productSecond_function _ _) + (fun _ h => h)) (productFirst_function _ _) (fun _ h => h) + +theorem pair_mem_preparedWitnessCertificateGraph (stages Q K E y k : ZFSet.{u}) : + ZFSet.pair y k ∈ preparedWitnessCertificateGraph stages Q K E ↔ + k ∈ K ∧ ∃ alpha ∈ stages, ∃ source ∈ Q, ∃ enumerations ∈ E, + y = ZFSet.pair alpha (ZFSet.pair source (ZFSet.pair k enumerations)) := by + rw [preparedWitnessCertificateGraph, pair_mem_relationCompose] + constructor + · rintro ⟨_, hk, tail, _, first, projected⟩ + obtain ⟨k', _, enums, he, equal⟩ := (mem_productFirst _ _ _).1 projected + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨_, _, output, _, first, second⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first + obtain ⟨source, hsource, tail', _, equal⟩ := (mem_productSecond _ _ _).1 second + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨alpha, ha, output', _, equal⟩ := (mem_productSecond _ _ _).1 first + obtain ⟨value, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hk, alpha, ha, source, hsource, enums, he, value⟩ + · rintro ⟨hk, alpha, ha, source, hs, enums, he, rfl⟩ + have ht := ZFSet.pair_mem_prod.2 ⟨hk, he⟩ + have ho := ZFSet.pair_mem_prod.2 ⟨hs, ht⟩ + have hy := ZFSet.pair_mem_prod.2 ⟨ha, ho⟩ + exact ⟨hy, hk, _, ht, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hy, ht, _, ho, + (mem_productSecond _ _ _).2 ⟨alpha, ha, _, ho, rfl⟩, + (mem_productSecond _ _ _).2 ⟨source, hs, _, ht, rfl⟩⟩, + (mem_productFirst _ _ _).2 ⟨k, hk, enums, he, rfl⟩⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem preparedWitnessCertificateGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {stages Q K E : ZFSet.{u}} (hStages : stages ∈ M.sets) (hQ : Q ∈ M.sets) + (hK : K ∈ M.sets) (hE : E ∈ M.sets) : + preparedWitnessCertificateGraph stages Q K E ∈ M.sets := by + have ht := M.prod_mem pairing unions powers separation hK hE + have ho := M.prod_mem pairing unions powers separation hQ ht + have hL := M.prod_mem pairing unions powers separation hStages ho + exact M.relationCompose_mem pairing unions powers separation hL ht hK + (M.relationCompose_mem pairing unions powers separation hL ho ht + (M.productSecond_mem pairing unions powers separation hStages ho) + (M.productSecond_mem pairing unions powers separation hQ ht)) + (M.productFirst_mem pairing unions powers separation hK hE) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PresentedMeetActionCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PresentedMeetActionCodes.lean index 345e079f5fb541dcac511f3337965178bfad9969..267cd5986ebe1174faac2d39d9c47b553a08faf0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PresentedMeetActionCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/PresentedMeetActionCodes.lean @@ -1,97 +1,97 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FixedTopCodes - -namespace OAI - -section - -namespace PartitionPilot.SetRealization.Presentation -open Forcing Compression.RecursiveMaps.CosetGeometry -universe u -variable {A : Type u} (s : Presentation A) (P : MeetOrder A) {r : ZFSet.{u}} -variable (shape : r ⊆ ZFSet.prod s.carrier s.carrier) -variable (related : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) - -include shape related in -theorem partialOrderCode : PartialOrderCode s.carrier r := by - refine ⟨shape, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - exact (related x x).2 (P.refl x) - · intro x hx y hy xy yx - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - exact congrArg s.encode (P.antisymm ((related x y).1 xy) ((related y x).1 yx)) - · intro x hx y hy z hz xy yz - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - exact (related x z).2 (P.trans ((related x y).1 xy) ((related y z).1 yz)) - -include shape related in -theorem canonicalMeetOrderCode : MeetOrderCode s.carrier r (canonicalMeetGraph s.carrier r) := by - apply canonicalMeetGraph_code (s.partialOrderCode P shape related) - intro x hx y hy - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - refine ⟨s.encode (P.meet x y), s.encode_mem _, (related _ _).2 (P.meet_le_left x y), - (related _ _).2 (P.meet_le_right x y), ?_⟩ - intro w hw wx wy - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - exact (related _ _).2 (P.le_meet ((related _ _).1 wx) ((related _ _).1 wy)) - -include related in -theorem canonicalMeetGraph_iff (x y z : A) : - ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode z) ∈ - canonicalMeetGraph s.carrier r ↔ P.meet x y = z := by - rw [pair_mem_canonicalMeetGraph] - constructor - · rintro ⟨_, _, _, left, right, greatest⟩ - apply P.antisymm - · exact (related _ _).1 (greatest (s.encode (P.meet x y)) (s.encode_mem _) - ((related _ _).2 (P.meet_le_left x y)) ((related _ _).2 (P.meet_le_right x y))) - · exact P.le_meet ((related _ _).1 left) ((related _ _).1 right) - · rintro rfl - refine ⟨s.encode_mem _, s.encode_mem _, s.encode_mem _, - (related _ _).2 (P.meet_le_left x y), (related _ _).2 (P.meet_le_right x y), ?_⟩ - intro w hw wx wy - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - exact (related _ _).2 (P.le_meet ((related _ _).1 wx) ((related _ _).1 wy)) - -variable {G : Type u} [Group G] (t : Presentation G) (a : OrderAction G P) -include related in -theorem posetActionCode : PosetActionCode t.carrier s.carrier - ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) r - ((t.product s).graph s (fun gx => (a.iso gx.1).toFun gx.2)) := by - refine ⟨(t.product s).graph_isFunc s _, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - exact ((t.product s).pair_mem_graph s _ (1, x) x).2 (a.one x) - · intro g hg h hh k hk x hx y hy z hz gh xy yz - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨h, rfl⟩ := (t.mem_carrier h).1 hh - obtain ⟨k, rfl⟩ := (t.mem_carrier k).1 hk - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - have product := ((t.product t).pair_mem_graph t _ (g, h) k).1 gh - have first := ((t.product s).pair_mem_graph s _ (h, x) y).1 xy - have second := ((t.product s).pair_mem_graph s _ (g, y) z).1 yz - apply ((t.product s).pair_mem_graph s _ (k, x) z).2 - rw [← product, a.mul, first, second] - · intro g hg x hx y hy z hz w hw xz yw xy - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - have first := ((t.product s).pair_mem_graph s _ (g, x) z).1 xz - have second := ((t.product s).pair_mem_graph s _ (g, y) w).1 yw - apply (related z w).2 - rw [← first, ← second] - exact ((a.iso g).le_iff x y).2 ((related x y).1 xy) - -end PartitionPilot.SetRealization.Presentation - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FixedTopCodes + +namespace OAI + +section + +namespace PartitionPilot.SetRealization.Presentation +open Forcing Compression.RecursiveMaps.CosetGeometry +universe u +variable {A : Type u} (s : Presentation A) (P : MeetOrder A) {r : ZFSet.{u}} +variable (shape : r ⊆ ZFSet.prod s.carrier s.carrier) +variable (related : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) + +include shape related in +theorem partialOrderCode : PartialOrderCode s.carrier r := by + refine ⟨shape, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + exact (related x x).2 (P.refl x) + · intro x hx y hy xy yx + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + exact congrArg s.encode (P.antisymm ((related x y).1 xy) ((related y x).1 yx)) + · intro x hx y hy z hz xy yz + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + exact (related x z).2 (P.trans ((related x y).1 xy) ((related y z).1 yz)) + +include shape related in +theorem canonicalMeetOrderCode : MeetOrderCode s.carrier r (canonicalMeetGraph s.carrier r) := by + apply canonicalMeetGraph_code (s.partialOrderCode P shape related) + intro x hx y hy + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + refine ⟨s.encode (P.meet x y), s.encode_mem _, (related _ _).2 (P.meet_le_left x y), + (related _ _).2 (P.meet_le_right x y), ?_⟩ + intro w hw wx wy + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + exact (related _ _).2 (P.le_meet ((related _ _).1 wx) ((related _ _).1 wy)) + +include related in +theorem canonicalMeetGraph_iff (x y z : A) : + ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode z) ∈ + canonicalMeetGraph s.carrier r ↔ P.meet x y = z := by + rw [pair_mem_canonicalMeetGraph] + constructor + · rintro ⟨_, _, _, left, right, greatest⟩ + apply P.antisymm + · exact (related _ _).1 (greatest (s.encode (P.meet x y)) (s.encode_mem _) + ((related _ _).2 (P.meet_le_left x y)) ((related _ _).2 (P.meet_le_right x y))) + · exact P.le_meet ((related _ _).1 left) ((related _ _).1 right) + · rintro rfl + refine ⟨s.encode_mem _, s.encode_mem _, s.encode_mem _, + (related _ _).2 (P.meet_le_left x y), (related _ _).2 (P.meet_le_right x y), ?_⟩ + intro w hw wx wy + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + exact (related _ _).2 (P.le_meet ((related _ _).1 wx) ((related _ _).1 wy)) + +variable {G : Type u} [Group G] (t : Presentation G) (a : OrderAction G P) +include related in +theorem posetActionCode : PosetActionCode t.carrier s.carrier + ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) r + ((t.product s).graph s (fun gx => (a.iso gx.1).toFun gx.2)) := by + refine ⟨(t.product s).graph_isFunc s _, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + exact ((t.product s).pair_mem_graph s _ (1, x) x).2 (a.one x) + · intro g hg h hh k hk x hx y hy z hz gh xy yz + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨h, rfl⟩ := (t.mem_carrier h).1 hh + obtain ⟨k, rfl⟩ := (t.mem_carrier k).1 hk + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + have product := ((t.product t).pair_mem_graph t _ (g, h) k).1 gh + have first := ((t.product s).pair_mem_graph s _ (h, x) y).1 xy + have second := ((t.product s).pair_mem_graph s _ (g, y) z).1 yz + apply ((t.product s).pair_mem_graph s _ (k, x) z).2 + rw [← product, a.mul, first, second] + · intro g hg x hx y hy z hz w hw xz yw xy + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + have first := ((t.product s).pair_mem_graph s _ (g, x) z).1 xz + have second := ((t.product s).pair_mem_graph s _ (g, y) w).1 yw + apply (related z w).2 + rw [← first, ← second] + exact ((a.iso g).le_iff x y).2 ((related x y).1 xy) + +end PartitionPilot.SetRealization.Presentation + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ProfileTransport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ProfileTransport.lean index e6a15c435d249488c157844075f66717dad44158..5ff4f58e2997d11fba8a70ebbd3853d123806b65 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ProfileTransport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/ProfileTransport.lean @@ -1,89 +1,89 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.PrincipalBatch - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u -variable {A B C : Type u} {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} - -def PreservesProfiles (e : MeetEmbedding P Q) : Prop := - ∀ c v K F, (∃ a, F a) → ¬ P.le v K → Profile P c v K F → ProfileOver e c v K F - -theorem profileOver_iff_image (e : MeetEmbedding P Q) (c v K : A) (F : A → Prop) : - ProfileOver e c v K F ↔ - Profile Q (e.toFun c) (e.toFun v) (e.toFun K) (imageFamily e F) := by - constructor - · intro h x above - exact ⟨fun hp => (h x above).1 ((positive_imageFamily e F x).mp hp), - fun hn => (h x above).2 (fun hp => hn ((positive_imageFamily e F x).mpr hp))⟩ - · intro h x above - exact ⟨fun hp => (h x above).1 ((positive_imageFamily e F x).mpr hp), - fun hn => (h x above).2 (fun hp => hn ((positive_imageFamily e F x).mp hp))⟩ - -theorem preservesProfiles_identity (P : MeetOrder A) : - PreservesProfiles (identityIso P).toMeetEmbedding := fun _ _ _ _ _ _ h => h - -theorem preservesProfiles_comp (e : MeetEmbedding P Q) (j : MeetEmbedding Q R) - (he : PreservesProfiles e) (hj : PreservesProfiles j) : PreservesProfiles (compose e j) := by - intro c v K F nonempty separate profile - have old := (profileOver_iff_image e c v K F).mp (he c v K F nonempty separate profile) - have nonempty' : ∃ b, imageFamily e F b := by - rcases nonempty with ⟨a, ha⟩ - exact ⟨e.toFun a, a, ha, rfl⟩ - have separate' : ¬ Q.le (e.toFun v) (e.toFun K) := fun h => separate ((e.le_iff _ _).mp h) - have next := hj (e.toFun c) (e.toFun v) (e.toFun K) (imageFamily e F) nonempty' separate' old - intro x above - exact ⟨fun hp => (next x above).1 ((positiveOver_imageFamily e j F x).mpr hp), - fun hn => (next x above).2 (fun hp => hn ((positiveOver_imageFamily e j F x).mp hp))⟩ - -theorem profileOver_at_embedding (e : MeetEmbedding P Q) (j : MeetEmbedding Q R) - (i : MeetEmbedding P R) (coherent : ∀ a, j.toFun (e.toFun a) = i.toFun a) - (c v K : A) (F : A → Prop) (profile : ProfileOver e c v K F) (x : B) - (above : R.le (i.toFun v) (j.toFun x)) : - (PositiveOver i F (j.toFun x) → R.le (i.toFun K) (j.toFun x)) ∧ - (¬ PositiveOver i F (j.toFun x) → R.meet (i.toFun K) (j.toFun x) = i.toFun c) := by - have above' : Q.le (e.toFun v) x := by - apply (j.le_iff _ _).mp - rw [coherent] - exact above - have positive : PositiveOver i F (j.toFun x) ↔ PositiveOver e F x := by - constructor - · rintro ⟨a, ha, lower⟩ - rw [← coherent a] at lower - exact ⟨a, ha, (j.le_iff _ _).mp lower⟩ - · rintro ⟨a, ha, lower⟩ - refine ⟨a, ha, ?_⟩ - rw [← coherent a] - exact (j.le_iff _ _).mpr lower - constructor - · intro hp - rw [← coherent K] - exact (j.le_iff _ _).mpr ((profile x above').1 (positive.mp hp)) - · intro hn - rw [← coherent K, ← j.map_meet, (profile x above').2 (fun hp => hn (positive.mpr hp)), coherent] - -theorem IdealEmbedding.hasOldShadow (e : IdealEmbedding P Q) (top : A) - (greatest : ∀ a, P.le a top) (x : B) : HasOldShadow e.toMeetEmbedding x := by - refine ⟨e.projection top x, e.greatest_part top greatest x, ?_⟩ - intro a _ - rw [e.map_meet, e.projection_spec] - apply Q.antisymm - · exact Q.le_meet - (Q.le_meet (Q.meet_le_left _ _) (Q.trans (Q.meet_le_right _ _) ((e.le_iff _ _).mpr (greatest a)))) - (Q.meet_le_right _ _) - · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_left _ _)) (Q.meet_le_right _ _) - -theorem IdealEmbedding.preservesProfiles (e : IdealEmbedding P Q) (top : A) - (greatest : ∀ a, P.le a top) : PreservesProfiles e.toMeetEmbedding := by - intro c v K F nonempty separate profile - exact profile_persists_one_step e.toMeetEmbedding c v K F nonempty profile separate - (fun x => Or.inr (Or.inl (e.hasOldShadow top greatest x))) - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.PrincipalBatch + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u +variable {A B C : Type u} {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} + +def PreservesProfiles (e : MeetEmbedding P Q) : Prop := + ∀ c v K F, (∃ a, F a) → ¬ P.le v K → Profile P c v K F → ProfileOver e c v K F + +theorem profileOver_iff_image (e : MeetEmbedding P Q) (c v K : A) (F : A → Prop) : + ProfileOver e c v K F ↔ + Profile Q (e.toFun c) (e.toFun v) (e.toFun K) (imageFamily e F) := by + constructor + · intro h x above + exact ⟨fun hp => (h x above).1 ((positive_imageFamily e F x).mp hp), + fun hn => (h x above).2 (fun hp => hn ((positive_imageFamily e F x).mpr hp))⟩ + · intro h x above + exact ⟨fun hp => (h x above).1 ((positive_imageFamily e F x).mpr hp), + fun hn => (h x above).2 (fun hp => hn ((positive_imageFamily e F x).mp hp))⟩ + +theorem preservesProfiles_identity (P : MeetOrder A) : + PreservesProfiles (identityIso P).toMeetEmbedding := fun _ _ _ _ _ _ h => h + +theorem preservesProfiles_comp (e : MeetEmbedding P Q) (j : MeetEmbedding Q R) + (he : PreservesProfiles e) (hj : PreservesProfiles j) : PreservesProfiles (compose e j) := by + intro c v K F nonempty separate profile + have old := (profileOver_iff_image e c v K F).mp (he c v K F nonempty separate profile) + have nonempty' : ∃ b, imageFamily e F b := by + rcases nonempty with ⟨a, ha⟩ + exact ⟨e.toFun a, a, ha, rfl⟩ + have separate' : ¬ Q.le (e.toFun v) (e.toFun K) := fun h => separate ((e.le_iff _ _).mp h) + have next := hj (e.toFun c) (e.toFun v) (e.toFun K) (imageFamily e F) nonempty' separate' old + intro x above + exact ⟨fun hp => (next x above).1 ((positiveOver_imageFamily e j F x).mpr hp), + fun hn => (next x above).2 (fun hp => hn ((positiveOver_imageFamily e j F x).mp hp))⟩ + +theorem profileOver_at_embedding (e : MeetEmbedding P Q) (j : MeetEmbedding Q R) + (i : MeetEmbedding P R) (coherent : ∀ a, j.toFun (e.toFun a) = i.toFun a) + (c v K : A) (F : A → Prop) (profile : ProfileOver e c v K F) (x : B) + (above : R.le (i.toFun v) (j.toFun x)) : + (PositiveOver i F (j.toFun x) → R.le (i.toFun K) (j.toFun x)) ∧ + (¬ PositiveOver i F (j.toFun x) → R.meet (i.toFun K) (j.toFun x) = i.toFun c) := by + have above' : Q.le (e.toFun v) x := by + apply (j.le_iff _ _).mp + rw [coherent] + exact above + have positive : PositiveOver i F (j.toFun x) ↔ PositiveOver e F x := by + constructor + · rintro ⟨a, ha, lower⟩ + rw [← coherent a] at lower + exact ⟨a, ha, (j.le_iff _ _).mp lower⟩ + · rintro ⟨a, ha, lower⟩ + refine ⟨a, ha, ?_⟩ + rw [← coherent a] + exact (j.le_iff _ _).mpr lower + constructor + · intro hp + rw [← coherent K] + exact (j.le_iff _ _).mpr ((profile x above').1 (positive.mp hp)) + · intro hn + rw [← coherent K, ← j.map_meet, (profile x above').2 (fun hp => hn (positive.mpr hp)), coherent] + +theorem IdealEmbedding.hasOldShadow (e : IdealEmbedding P Q) (top : A) + (greatest : ∀ a, P.le a top) (x : B) : HasOldShadow e.toMeetEmbedding x := by + refine ⟨e.projection top x, e.greatest_part top greatest x, ?_⟩ + intro a _ + rw [e.map_meet, e.projection_spec] + apply Q.antisymm + · exact Q.le_meet + (Q.le_meet (Q.meet_le_left _ _) (Q.trans (Q.meet_le_right _ _) ((e.le_iff _ _).mpr (greatest a)))) + (Q.meet_le_right _ _) + · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_left _ _)) (Q.meet_le_right _ _) + +theorem IdealEmbedding.preservesProfiles (e : IdealEmbedding P Q) (top : A) + (greatest : ∀ a, P.le a top) : PreservesProfiles e.toMeetEmbedding := by + intro c v K F nonempty separate profile + exact profile_persists_one_step e.toMeetEmbedding c v K F nonempty profile separate + (fun x => Or.inr (Or.inl (e.hasOldShadow top greatest x))) + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveAction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveAction.lean index 084960d54057cc00d081f7d2a3e069710868ebaa..a4332fa4496a8695842dee5922c4918b16f6382c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveAction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveAction.lean @@ -1,335 +1,335 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveMaps - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Attachment - -universe u v w z - -def isoOfOrder {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} - (f : A → B) (g : B → A) (left : ∀ x, g (f x) = x) - (right : ∀ y, f (g y) = y) - (order : ∀ x y, Q.le (f x) (f y) ↔ P.le x y) : MeetIso P Q where - toFun := f - le_iff := order - map_meet x y := by - apply Q.antisymm - · exact Q.le_meet ((order _ _).mpr (P.meet_le_left x y)) - ((order _ _).mpr (P.meet_le_right x y)) - · have hx : P.le (g (Q.meet (f x) (f y))) x := by - apply (order _ _).mp - rw [right] - exact Q.meet_le_left _ _ - have hy : P.le (g (Q.meet (f x) (f y))) y := by - apply (order _ _).mp - rw [right] - exact Q.meet_le_right _ _ - have h := (order _ _).mpr (P.le_meet hx hy) - rw [right] at h - exact h - inverse := g - left_inverse := left - right_inverse := right - -def inverseIso {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} - (f : MeetIso P Q) : MeetIso Q P := - isoOfOrder f.inverse f.toFun f.right_inverse f.left_inverse (by - intro x y - have h := f.le_iff (f.inverse x) (f.inverse y) - rw [f.right_inverse, f.right_inverse] at h - exact h.symm) - -structure TaskSymmetry {O : Type u} {I : Type w} {P : MeetOrder O} - {b : Templates.{u,v,w} P I} {Task : Type z} (d : Inputs b Task) where - perm : Task → Task - inverse : Task → Task - left_inverse : ∀ i, inverse (perm i) = i - right_inverse : ∀ i, perm (inverse i) = i - current : MeetIso b.extension b.extension - source : ∀ i, d.source (perm i) = d.source i - intertwine : ∀ i p, current.toFun ((d.previous i).toFun p) = - (d.previous (perm i)).toFun p - -namespace TaskSymmetry - -variable {O : Type u} {I : Type w} {P : MeetOrder O} - {b : Templates.{u,v,w} P I} {Task : Type z} {d : Inputs b Task} - (s : TaskSymmetry d) - -noncomputable def symm : TaskSymmetry d where - perm := s.inverse - inverse := s.perm - left_inverse := s.right_inverse - right_inverse := s.left_inverse - current := inverseIso s.current - source i := by - have h := s.source (s.inverse i) - rw [s.right_inverse] at h - exact h.symm - intertwine i p := by - have h := congrArg s.current.inverse (s.intertwine (s.inverse i) p) - rw [s.current.left_inverse, s.right_inverse] at h - exact h.symm - -def renameLabel (label : d.Labels) : d.Labels := - ⟨s.perm label.1, ⟨label.2.val, by - rw [s.source] - exact label.2.property⟩⟩ - -def renameFresh (x : d.nextBatch.Fresh) : d.nextBatch.Fresh := - ⟨s.renameLabel x.1, x.2⟩ - -def act : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh → - (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh - | .inl x => .inl (s.current.toFun x) - | .inr x => .inr (s.renameFresh x) - -theorem fresh_task_eq {i j : Task} {h : I} - {hi : ¬ b.upper h (d.source i)} {hj : ¬ b.upper h (d.source j)} - {y : b.Space h} {outside : ¬ (b.order h).le y (b.anchor h)} (eq : i = j) : - (⟨⟨i, ⟨h, hi⟩⟩, ⟨y, outside⟩⟩ : d.nextBatch.Fresh) = - ⟨⟨j, ⟨h, hj⟩⟩, ⟨y, outside⟩⟩ := by - cases eq - rfl - -theorem rename_left (x : d.nextBatch.Fresh) : - s.symm.renameFresh (s.renameFresh x) = x := by - rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ - change (⟨⟨s.inverse (s.perm i), ⟨h, _⟩⟩, ⟨y, outside⟩⟩ : d.nextBatch.Fresh) = _ - exact fresh_task_eq (s.left_inverse i) - -theorem rename_right (x : d.nextBatch.Fresh) : - s.renameFresh (s.symm.renameFresh x) = x := by - rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ - change (⟨⟨s.perm (s.inverse i), ⟨h, _⟩⟩, ⟨y, outside⟩⟩ : d.nextBatch.Fresh) = _ - exact fresh_task_eq (s.right_inverse i) - -theorem act_left (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : - s.symm.act (s.act x) = x := by - cases x with - | inl x => exact congrArg Sum.inl (s.current.left_inverse x) - | inr x => exact congrArg Sum.inr (s.rename_left x) - -theorem act_right (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : - s.act (s.symm.act x) = x := by - cases x with - | inl x => exact congrArg Sum.inl (s.current.right_inverse x) - | inr x => exact congrArg Sum.inr (s.rename_right x) - -theorem shadow_covariant (x : d.nextBatch.Fresh) : - d.nextBatch.shadow (s.renameFresh x) = - s.current.toFun (d.nextBatch.shadow x) := - (s.intertwine x.1.1 - ((b.embed x.1.2.val).toFun (cut (b.order x.1.2.val) - (b.anchor x.1.2.val) x.2.val))).symm - -theorem upper_covariant (label : d.Labels) (x : O ⊕ b.Fresh) : - d.nextBatch.upper (s.renameLabel label) (s.current.toFun x) ↔ - d.nextBatch.upper label x := by - change (∃ p, b.upper label.2.val p ∧ - b.extension.le ((d.previous (s.perm label.1)).toFun p) (s.current.toFun x)) ↔ - (∃ p, b.upper label.2.val p ∧ b.extension.le ((d.previous label.1).toFun p) x) - constructor - · rintro ⟨p, hp, hpx⟩ - rw [← s.intertwine] at hpx - exact ⟨p, hp, (s.current.le_iff _ _).mp hpx⟩ - · rintro ⟨p, hp, hpx⟩ - refine ⟨p, hp, ?_⟩ - rw [← s.intertwine] - exact (s.current.le_iff _ _).mpr hpx - -theorem inside_forward {x y : d.nextBatch.Fresh} (h : d.nextBatch.Inside x y) : - d.nextBatch.Inside (s.renameFresh x) (s.renameFresh y) := by - rcases x with ⟨i, x⟩ - rcases y with ⟨j, y⟩ - rcases h with ⟨eq, h⟩ - cases eq - exact ⟨rfl, h⟩ - -theorem inside_iff (x y : d.nextBatch.Fresh) : - d.nextBatch.Inside (s.renameFresh x) (s.renameFresh y) ↔ - d.nextBatch.Inside x y := by - constructor - · intro h - have h' := s.symm.inside_forward h - rw [s.rename_left, s.rename_left] at h' - exact h' - · exact s.inside_forward - -theorem act_order (x y : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : - d.nextBatch.extension.le (s.act x) (s.act y) ↔ d.nextBatch.extension.le x y := by - cases x with - | inl x => - cases y with - | inl y => exact s.current.le_iff x y - | inr y => - change b.extension.le (s.current.toFun x) (d.nextBatch.shadow (s.renameFresh y)) ↔ _ - rw [s.shadow_covariant] - exact s.current.le_iff _ _ - | inr x => - cases y with - | inl y => exact s.upper_covariant x.1 y - | inr y => - change (d.nextBatch.Inside (s.renameFresh x) (s.renameFresh y) ∨ - d.nextBatch.upper (s.renameLabel x.1) (d.nextBatch.shadow (s.renameFresh y))) ↔ - (d.nextBatch.Inside x y ∨ d.nextBatch.upper x.1 (d.nextBatch.shadow y)) - rw [s.inside_iff, s.shadow_covariant, s.upper_covariant] - -noncomputable def nextIso : MeetIso d.nextBatch.extension d.nextBatch.extension := - isoOfOrder s.act s.symm.act s.act_left s.act_right s.act_order - -theorem nextIso_old (x : O ⊕ b.Fresh) : - s.nextIso.toFun (.inl x) = .inl (s.current.toFun x) := rfl - -theorem nextIso_fresh (x : d.nextBatch.Fresh) : - s.nextIso.toFun (.inr x) = .inr (s.renameFresh x) := rfl - -theorem nextIso_meet (x y : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : - s.nextIso.toFun (d.nextBatch.extension.meet x y) = - d.nextBatch.extension.meet (s.nextIso.toFun x) (s.nextIso.toFun y) := - s.nextIso.map_meet x y - -noncomputable def identity : TaskSymmetry d where - perm i := i - inverse i := i - left_inverse _ := rfl - right_inverse _ := rfl - current := isoOfOrder (fun x => x) (fun x => x) (fun _ => rfl) - (fun _ => rfl) (fun _ _ => Iff.rfl) - source _ := rfl - intertwine _ _ := rfl - -noncomputable def comp (t : TaskSymmetry d) : TaskSymmetry d where - perm i := s.perm (t.perm i) - inverse i := t.inverse (s.inverse i) - left_inverse i := by rw [s.left_inverse, t.left_inverse] - right_inverse i := by rw [t.right_inverse, s.right_inverse] - current := { - toMeetEmbedding := compose t.current.toMeetEmbedding s.current.toMeetEmbedding - inverse x := t.current.inverse (s.current.inverse x) - left_inverse x := by - change t.current.inverse (s.current.inverse (s.current.toFun (t.current.toFun x))) = x - rw [s.current.left_inverse, t.current.left_inverse] - right_inverse x := by - change s.current.toFun (t.current.toFun (t.current.inverse (s.current.inverse x))) = x - rw [t.current.right_inverse, s.current.right_inverse] } - source i := by rw [s.source, t.source] - intertwine i p := by - change s.current.toFun (t.current.toFun ((d.previous i).toFun p)) = _ - rw [t.intertwine, s.intertwine] - -theorem next_identity (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : - (identity (d := d)).nextIso.toFun x = x := by - cases x <;> rfl - -theorem next_composition (t : TaskSymmetry d) - (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : - (s.comp t).nextIso.toFun x = s.nextIso.toFun (t.nextIso.toFun x) := by - cases x <;> rfl - -theorem next_inverse (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : - s.symm.nextIso.toFun (s.nextIso.toFun x) = x := - s.act_left x - -theorem lift_equivariant - (compatible : ∀ i x, b.extension.le x (.inl (d.source i)) → - s.current.toFun ((d.representative i).toFun x) = - (d.representative (s.perm i)).toFun x) - (i : Task) (x : O ⊕ b.Fresh) : - s.nextIso.toFun (d.lift i x) = d.lift (s.perm i) x := by - cases x with - | inl p => exact congrArg Sum.inl (s.intertwine i p) - | inr x => - classical - by_cases h : b.upper x.1 (d.source i) - · have h' : b.upper x.1 (d.source (s.perm i)) := by rw [s.source]; exact h - rw [d.lift_new_inside i x h, d.lift_new_inside (s.perm i) x h', s.nextIso_old] - exact congrArg Sum.inl (compatible i (.inr x) h) - · have h' : ¬ b.upper x.1 (d.source (s.perm i)) := by rw [s.source]; exact h - rw [d.lift_new_outside i x h, d.lift_new_outside (s.perm i) x h', s.nextIso_fresh] - rfl - -theorem fresh_positive (T : O) (top : ∀ p, P.le p T) (v : O) - (positive : Task → Prop) - (negative : ∀ i, ¬ positive i → - b.extension.le (b.extension.meet ((d.previous i).toFun T) (.inl v)) - ((d.previous i).toFun (d.source i))) - (x : d.nextBatch.Fresh) - (below : d.nextBatch.extension.le (.inr x) (.inl (.inl v))) : - positive x.1.1 := by - classical - apply Classical.byContradiction - intro hn - rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, y⟩ - have cap := d.fresh_below_cap i ⟨h, y⟩ eligible T top - have lower := d.nextBatch.extension.le_meet cap below - have hm : d.nextBatch.extension.meet (.inl ((d.previous i).toFun T)) (.inl (.inl v)) = - .inl (b.extension.meet ((d.previous i).toFun T) (.inl v)) := - (d.nextBatch.oldEmbedding.map_meet _ _).symm - rw [hm] at lower - have neg := (d.nextBatch.oldEmbedding.le_iff _ _).mpr (negative i hn) - exact d.fresh_outside_base i ⟨h, y⟩ eligible (d.nextBatch.extension.trans lower neg) - -theorem agreement_persists (t : TaskSymmetry d) - (T : O) (top : ∀ p, P.le p T) (v : O) (positive : Task → Prop) - (negative : ∀ i, ¬ positive i → - b.extension.le (b.extension.meet ((d.previous i).toFun T) (.inl v)) - ((d.previous i).toFun (d.source i))) - (current_agree : ∀ x, b.extension.le x (.inl v) → - s.current.toFun x = t.current.toFun x) - (task_agree : ∀ i, positive i → s.perm i = t.perm i) - (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) - (below : d.nextBatch.extension.le x (.inl (.inl v))) : - s.nextIso.toFun x = t.nextIso.toFun x := by - cases x with - | inl x => exact congrArg Sum.inl (current_agree x below) - | inr x => - have pos := fresh_positive T top v positive negative x below - have eq := task_agree x.1.1 pos - rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ - apply congrArg Sum.inr - exact fresh_task_eq eq - -end TaskSymmetry - -namespace Inputs - -variable {O : Type u} {I : Type w} {P : MeetOrder O} - {b : Templates.{u,v,w} P I} {Task : Type z} (d : Inputs b Task) - -noncomputable def nextInputs (reps : Task → TaskSymmetry d) - (current_reps : ∀ i x, (reps i).current.toFun x = (d.representative i).toFun x) : - Inputs d.nextBatch Task where - source i := .inl (d.source i) - previous := d.liftedEmbedding - representative i := (reps i).nextIso - agree i x hx := by - change d.lift i x = .inl ((reps i).current.toFun x) - rw [current_reps] - exact d.lift_agrees_on_base i x hx - -noncomputable def nextSymmetry (reps : Task → TaskSymmetry d) - (current_reps : ∀ i x, (reps i).current.toFun x = (d.representative i).toFun x) - (s : TaskSymmetry d) - (compatible : ∀ i x, b.extension.le x (.inl (d.source i)) → - s.current.toFun ((d.representative i).toFun x) = - (d.representative (s.perm i)).toFun x) : - TaskSymmetry (d.nextInputs reps current_reps) where - perm := s.perm - inverse := s.inverse - left_inverse := s.left_inverse - right_inverse := s.right_inverse - current := s.nextIso - source i := congrArg Sum.inl (s.source i) - intertwine := s.lift_equivariant compatible - -end Inputs -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveMaps + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Attachment + +universe u v w z + +def isoOfOrder {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} + (f : A → B) (g : B → A) (left : ∀ x, g (f x) = x) + (right : ∀ y, f (g y) = y) + (order : ∀ x y, Q.le (f x) (f y) ↔ P.le x y) : MeetIso P Q where + toFun := f + le_iff := order + map_meet x y := by + apply Q.antisymm + · exact Q.le_meet ((order _ _).mpr (P.meet_le_left x y)) + ((order _ _).mpr (P.meet_le_right x y)) + · have hx : P.le (g (Q.meet (f x) (f y))) x := by + apply (order _ _).mp + rw [right] + exact Q.meet_le_left _ _ + have hy : P.le (g (Q.meet (f x) (f y))) y := by + apply (order _ _).mp + rw [right] + exact Q.meet_le_right _ _ + have h := (order _ _).mpr (P.le_meet hx hy) + rw [right] at h + exact h + inverse := g + left_inverse := left + right_inverse := right + +def inverseIso {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} + (f : MeetIso P Q) : MeetIso Q P := + isoOfOrder f.inverse f.toFun f.right_inverse f.left_inverse (by + intro x y + have h := f.le_iff (f.inverse x) (f.inverse y) + rw [f.right_inverse, f.right_inverse] at h + exact h.symm) + +structure TaskSymmetry {O : Type u} {I : Type w} {P : MeetOrder O} + {b : Templates.{u,v,w} P I} {Task : Type z} (d : Inputs b Task) where + perm : Task → Task + inverse : Task → Task + left_inverse : ∀ i, inverse (perm i) = i + right_inverse : ∀ i, perm (inverse i) = i + current : MeetIso b.extension b.extension + source : ∀ i, d.source (perm i) = d.source i + intertwine : ∀ i p, current.toFun ((d.previous i).toFun p) = + (d.previous (perm i)).toFun p + +namespace TaskSymmetry + +variable {O : Type u} {I : Type w} {P : MeetOrder O} + {b : Templates.{u,v,w} P I} {Task : Type z} {d : Inputs b Task} + (s : TaskSymmetry d) + +noncomputable def symm : TaskSymmetry d where + perm := s.inverse + inverse := s.perm + left_inverse := s.right_inverse + right_inverse := s.left_inverse + current := inverseIso s.current + source i := by + have h := s.source (s.inverse i) + rw [s.right_inverse] at h + exact h.symm + intertwine i p := by + have h := congrArg s.current.inverse (s.intertwine (s.inverse i) p) + rw [s.current.left_inverse, s.right_inverse] at h + exact h.symm + +def renameLabel (label : d.Labels) : d.Labels := + ⟨s.perm label.1, ⟨label.2.val, by + rw [s.source] + exact label.2.property⟩⟩ + +def renameFresh (x : d.nextBatch.Fresh) : d.nextBatch.Fresh := + ⟨s.renameLabel x.1, x.2⟩ + +def act : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh → + (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh + | .inl x => .inl (s.current.toFun x) + | .inr x => .inr (s.renameFresh x) + +theorem fresh_task_eq {i j : Task} {h : I} + {hi : ¬ b.upper h (d.source i)} {hj : ¬ b.upper h (d.source j)} + {y : b.Space h} {outside : ¬ (b.order h).le y (b.anchor h)} (eq : i = j) : + (⟨⟨i, ⟨h, hi⟩⟩, ⟨y, outside⟩⟩ : d.nextBatch.Fresh) = + ⟨⟨j, ⟨h, hj⟩⟩, ⟨y, outside⟩⟩ := by + cases eq + rfl + +theorem rename_left (x : d.nextBatch.Fresh) : + s.symm.renameFresh (s.renameFresh x) = x := by + rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ + change (⟨⟨s.inverse (s.perm i), ⟨h, _⟩⟩, ⟨y, outside⟩⟩ : d.nextBatch.Fresh) = _ + exact fresh_task_eq (s.left_inverse i) + +theorem rename_right (x : d.nextBatch.Fresh) : + s.renameFresh (s.symm.renameFresh x) = x := by + rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ + change (⟨⟨s.perm (s.inverse i), ⟨h, _⟩⟩, ⟨y, outside⟩⟩ : d.nextBatch.Fresh) = _ + exact fresh_task_eq (s.right_inverse i) + +theorem act_left (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : + s.symm.act (s.act x) = x := by + cases x with + | inl x => exact congrArg Sum.inl (s.current.left_inverse x) + | inr x => exact congrArg Sum.inr (s.rename_left x) + +theorem act_right (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : + s.act (s.symm.act x) = x := by + cases x with + | inl x => exact congrArg Sum.inl (s.current.right_inverse x) + | inr x => exact congrArg Sum.inr (s.rename_right x) + +theorem shadow_covariant (x : d.nextBatch.Fresh) : + d.nextBatch.shadow (s.renameFresh x) = + s.current.toFun (d.nextBatch.shadow x) := + (s.intertwine x.1.1 + ((b.embed x.1.2.val).toFun (cut (b.order x.1.2.val) + (b.anchor x.1.2.val) x.2.val))).symm + +theorem upper_covariant (label : d.Labels) (x : O ⊕ b.Fresh) : + d.nextBatch.upper (s.renameLabel label) (s.current.toFun x) ↔ + d.nextBatch.upper label x := by + change (∃ p, b.upper label.2.val p ∧ + b.extension.le ((d.previous (s.perm label.1)).toFun p) (s.current.toFun x)) ↔ + (∃ p, b.upper label.2.val p ∧ b.extension.le ((d.previous label.1).toFun p) x) + constructor + · rintro ⟨p, hp, hpx⟩ + rw [← s.intertwine] at hpx + exact ⟨p, hp, (s.current.le_iff _ _).mp hpx⟩ + · rintro ⟨p, hp, hpx⟩ + refine ⟨p, hp, ?_⟩ + rw [← s.intertwine] + exact (s.current.le_iff _ _).mpr hpx + +theorem inside_forward {x y : d.nextBatch.Fresh} (h : d.nextBatch.Inside x y) : + d.nextBatch.Inside (s.renameFresh x) (s.renameFresh y) := by + rcases x with ⟨i, x⟩ + rcases y with ⟨j, y⟩ + rcases h with ⟨eq, h⟩ + cases eq + exact ⟨rfl, h⟩ + +theorem inside_iff (x y : d.nextBatch.Fresh) : + d.nextBatch.Inside (s.renameFresh x) (s.renameFresh y) ↔ + d.nextBatch.Inside x y := by + constructor + · intro h + have h' := s.symm.inside_forward h + rw [s.rename_left, s.rename_left] at h' + exact h' + · exact s.inside_forward + +theorem act_order (x y : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : + d.nextBatch.extension.le (s.act x) (s.act y) ↔ d.nextBatch.extension.le x y := by + cases x with + | inl x => + cases y with + | inl y => exact s.current.le_iff x y + | inr y => + change b.extension.le (s.current.toFun x) (d.nextBatch.shadow (s.renameFresh y)) ↔ _ + rw [s.shadow_covariant] + exact s.current.le_iff _ _ + | inr x => + cases y with + | inl y => exact s.upper_covariant x.1 y + | inr y => + change (d.nextBatch.Inside (s.renameFresh x) (s.renameFresh y) ∨ + d.nextBatch.upper (s.renameLabel x.1) (d.nextBatch.shadow (s.renameFresh y))) ↔ + (d.nextBatch.Inside x y ∨ d.nextBatch.upper x.1 (d.nextBatch.shadow y)) + rw [s.inside_iff, s.shadow_covariant, s.upper_covariant] + +noncomputable def nextIso : MeetIso d.nextBatch.extension d.nextBatch.extension := + isoOfOrder s.act s.symm.act s.act_left s.act_right s.act_order + +theorem nextIso_old (x : O ⊕ b.Fresh) : + s.nextIso.toFun (.inl x) = .inl (s.current.toFun x) := rfl + +theorem nextIso_fresh (x : d.nextBatch.Fresh) : + s.nextIso.toFun (.inr x) = .inr (s.renameFresh x) := rfl + +theorem nextIso_meet (x y : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : + s.nextIso.toFun (d.nextBatch.extension.meet x y) = + d.nextBatch.extension.meet (s.nextIso.toFun x) (s.nextIso.toFun y) := + s.nextIso.map_meet x y + +noncomputable def identity : TaskSymmetry d where + perm i := i + inverse i := i + left_inverse _ := rfl + right_inverse _ := rfl + current := isoOfOrder (fun x => x) (fun x => x) (fun _ => rfl) + (fun _ => rfl) (fun _ _ => Iff.rfl) + source _ := rfl + intertwine _ _ := rfl + +noncomputable def comp (t : TaskSymmetry d) : TaskSymmetry d where + perm i := s.perm (t.perm i) + inverse i := t.inverse (s.inverse i) + left_inverse i := by rw [s.left_inverse, t.left_inverse] + right_inverse i := by rw [t.right_inverse, s.right_inverse] + current := { + toMeetEmbedding := compose t.current.toMeetEmbedding s.current.toMeetEmbedding + inverse x := t.current.inverse (s.current.inverse x) + left_inverse x := by + change t.current.inverse (s.current.inverse (s.current.toFun (t.current.toFun x))) = x + rw [s.current.left_inverse, t.current.left_inverse] + right_inverse x := by + change s.current.toFun (t.current.toFun (t.current.inverse (s.current.inverse x))) = x + rw [t.current.right_inverse, s.current.right_inverse] } + source i := by rw [s.source, t.source] + intertwine i p := by + change s.current.toFun (t.current.toFun ((d.previous i).toFun p)) = _ + rw [t.intertwine, s.intertwine] + +theorem next_identity (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : + (identity (d := d)).nextIso.toFun x = x := by + cases x <;> rfl + +theorem next_composition (t : TaskSymmetry d) + (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : + (s.comp t).nextIso.toFun x = s.nextIso.toFun (t.nextIso.toFun x) := by + cases x <;> rfl + +theorem next_inverse (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) : + s.symm.nextIso.toFun (s.nextIso.toFun x) = x := + s.act_left x + +theorem lift_equivariant + (compatible : ∀ i x, b.extension.le x (.inl (d.source i)) → + s.current.toFun ((d.representative i).toFun x) = + (d.representative (s.perm i)).toFun x) + (i : Task) (x : O ⊕ b.Fresh) : + s.nextIso.toFun (d.lift i x) = d.lift (s.perm i) x := by + cases x with + | inl p => exact congrArg Sum.inl (s.intertwine i p) + | inr x => + classical + by_cases h : b.upper x.1 (d.source i) + · have h' : b.upper x.1 (d.source (s.perm i)) := by rw [s.source]; exact h + rw [d.lift_new_inside i x h, d.lift_new_inside (s.perm i) x h', s.nextIso_old] + exact congrArg Sum.inl (compatible i (.inr x) h) + · have h' : ¬ b.upper x.1 (d.source (s.perm i)) := by rw [s.source]; exact h + rw [d.lift_new_outside i x h, d.lift_new_outside (s.perm i) x h', s.nextIso_fresh] + rfl + +theorem fresh_positive (T : O) (top : ∀ p, P.le p T) (v : O) + (positive : Task → Prop) + (negative : ∀ i, ¬ positive i → + b.extension.le (b.extension.meet ((d.previous i).toFun T) (.inl v)) + ((d.previous i).toFun (d.source i))) + (x : d.nextBatch.Fresh) + (below : d.nextBatch.extension.le (.inr x) (.inl (.inl v))) : + positive x.1.1 := by + classical + apply Classical.byContradiction + intro hn + rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, y⟩ + have cap := d.fresh_below_cap i ⟨h, y⟩ eligible T top + have lower := d.nextBatch.extension.le_meet cap below + have hm : d.nextBatch.extension.meet (.inl ((d.previous i).toFun T)) (.inl (.inl v)) = + .inl (b.extension.meet ((d.previous i).toFun T) (.inl v)) := + (d.nextBatch.oldEmbedding.map_meet _ _).symm + rw [hm] at lower + have neg := (d.nextBatch.oldEmbedding.le_iff _ _).mpr (negative i hn) + exact d.fresh_outside_base i ⟨h, y⟩ eligible (d.nextBatch.extension.trans lower neg) + +theorem agreement_persists (t : TaskSymmetry d) + (T : O) (top : ∀ p, P.le p T) (v : O) (positive : Task → Prop) + (negative : ∀ i, ¬ positive i → + b.extension.le (b.extension.meet ((d.previous i).toFun T) (.inl v)) + ((d.previous i).toFun (d.source i))) + (current_agree : ∀ x, b.extension.le x (.inl v) → + s.current.toFun x = t.current.toFun x) + (task_agree : ∀ i, positive i → s.perm i = t.perm i) + (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) + (below : d.nextBatch.extension.le x (.inl (.inl v))) : + s.nextIso.toFun x = t.nextIso.toFun x := by + cases x with + | inl x => exact congrArg Sum.inl (current_agree x below) + | inr x => + have pos := fresh_positive T top v positive negative x below + have eq := task_agree x.1.1 pos + rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ + apply congrArg Sum.inr + exact fresh_task_eq eq + +end TaskSymmetry + +namespace Inputs + +variable {O : Type u} {I : Type w} {P : MeetOrder O} + {b : Templates.{u,v,w} P I} {Task : Type z} (d : Inputs b Task) + +noncomputable def nextInputs (reps : Task → TaskSymmetry d) + (current_reps : ∀ i x, (reps i).current.toFun x = (d.representative i).toFun x) : + Inputs d.nextBatch Task where + source i := .inl (d.source i) + previous := d.liftedEmbedding + representative i := (reps i).nextIso + agree i x hx := by + change d.lift i x = .inl ((reps i).current.toFun x) + rw [current_reps] + exact d.lift_agrees_on_base i x hx + +noncomputable def nextSymmetry (reps : Task → TaskSymmetry d) + (current_reps : ∀ i x, (reps i).current.toFun x = (d.representative i).toFun x) + (s : TaskSymmetry d) + (compatible : ∀ i x, b.extension.le x (.inl (d.source i)) → + s.current.toFun ((d.representative i).toFun x) = + (d.representative (s.perm i)).toFun x) : + TaskSymmetry (d.nextInputs reps current_reps) where + perm := s.perm + inverse := s.inverse + left_inverse := s.left_inverse + right_inverse := s.right_inverse + current := s.nextIso + source i := congrArg Sum.inl (s.source i) + intertwine := s.lift_equivariant compatible + +end Inputs +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveNextTaskActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveNextTaskActions.lean index 63777b8be22fd68af6927cfd12847120d2fe61d5..c30002056d9f6e50a0438dac1ed4ce298d60f8e6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveNextTaskActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveNextTaskActions.lean @@ -1,97 +1,97 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveNextMapInputs - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} - -def RecursiveRepresentativeCompatibility - (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) (T : ZFSet.{u}) : Prop := - ∀ g i j a u v x y z, ZFSet.pair (ZFSet.pair g i) j ∈ T → - ZFSet.pair i a ∈ Sources → ZFSet.pair i u ∈ Reps → ZFSet.pair j v ∈ Reps → - x ∈ d.batchCarrier → ZFSet.pair x a ∈ d.batchOrder → - ZFSet.pair (ZFSet.pair u x) y ∈ A → ZFSet.pair (ZFSet.pair v x) z ∈ A → - ZFSet.pair (ZFSet.pair g y) z ∈ A - -namespace CodedRecursiveTaskAction - -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (s : CodedRecursiveTaskAction h T) - -theorem toTaskSymmetry_compatible (compatible : RecursiveRepresentativeCompatibility h T) - (g : {g : ZFSet.{u} // g ∈ G}) (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) - (below : d.templates.extension.le x (.inl (h.toInputs.source i))) : - (s.toTaskSymmetry g).current.toFun ((h.toInputs.representative i).toFun x) = - (h.toInputs.representative ((s.toTaskSymmetry g).perm i)).toFun x := by - apply d.coding.encode_injective - exact h.action.toSetAction.entry_unique - (s.toTaskSymmetry_current_entry g ((h.toInputs.representative i).toFun x)) - (compatible g.val i.val ((s.toTaskSymmetry g).perm i).val (h.source i).val - (h.actor i).val (h.actor ((s.toTaskSymmetry g).perm i)).val - (d.coding.encode x) _ _ (s.toTaskSymmetry_perm_entry g i) - (h.source_entry i) (h.actor_entry i) (h.actor_entry ((s.toTaskSymmetry g).perm i)) - (d.coding.encode_mem x) ((d.coding.le_encode x (.inl (h.toInputs.source i))).2 below) - (h.toInputs_representative_entry i x) - (h.toInputs_representative_entry ((s.toTaskSymmetry g).perm i) x)) - -include s in -theorem liftSection_equivariant (M : TransitiveGround.{u}) (next : h.NextInputs M) - (compatible : RecursiveRepresentativeCompatibility h T) - {g i j x y z : ZFSet.{u}} (transport : ZFSet.pair (ZFSet.pair g i) j ∈ T) - (first : ZFSet.pair x y ∈ h.liftSection M next i) - (second : ZFSet.pair x z ∈ h.liftSection M next j) : - ZFSet.pair (ZFSet.pair g y) z ∈ h.nextActionGraph T := by - have shape := s.taskAction.entry_shape transport - let actor : {g : ZFSet.{u} // g ∈ G} := ⟨g, shape.1⟩ - let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, shape.2.1⟩ - let target : {i : ZFSet.{u} // i ∈ I} := ⟨j, shape.2.2⟩ - have perm : (s.toTaskSymmetry actor).perm index = target := - Subtype.ext (s.taskAction.entry_unique (s.toTaskSymmetry_perm_entry actor index) transport) - have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next shape.2.1).1 first)).1 - obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx - rw [(h.liftSection_entry_iff M next index X y).1 first, - (h.liftSection_entry_iff M next target X z).1 second] - have equation := (s.toTaskSymmetry actor).lift_equivariant - (s.toTaskSymmetry_compatible compatible actor) index X - rw [perm] at equation - have entry := s.nextAction_entry M next actor (h.toInputs.lift index X) - rwa [equation] at entry - -end CodedRecursiveTaskAction - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.CodedRecursiveTaskAction - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (s : CodedRecursiveTaskAction h T) - -include s in -theorem nextTaskAction_of_family (M : TransitiveGround.{u}) (next : h.NextInputs M) - (compatible : RecursiveRepresentativeCompatibility h T) - (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ - i ∈ I ∧ f = h.liftSection M next i) - (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T)) : CodedRecursiveTaskAction inputs T := by - refine ⟨s.taskAction, s.source, ?_⟩ - intro g i j f f' x y z transport firstFamily secondFamily first second - obtain ⟨_, rfl⟩ := (entries i f).1 firstFamily - obtain ⟨_, rfl⟩ := (entries j f').1 secondFamily - exact s.liftSection_equivariant M next compatible transport first second - -end PartitionPilot.Forcing.CodedRecursiveTaskAction - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveNextMapInputs + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} + +def RecursiveRepresentativeCompatibility + (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) (T : ZFSet.{u}) : Prop := + ∀ g i j a u v x y z, ZFSet.pair (ZFSet.pair g i) j ∈ T → + ZFSet.pair i a ∈ Sources → ZFSet.pair i u ∈ Reps → ZFSet.pair j v ∈ Reps → + x ∈ d.batchCarrier → ZFSet.pair x a ∈ d.batchOrder → + ZFSet.pair (ZFSet.pair u x) y ∈ A → ZFSet.pair (ZFSet.pair v x) z ∈ A → + ZFSet.pair (ZFSet.pair g y) z ∈ A + +namespace CodedRecursiveTaskAction + +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (s : CodedRecursiveTaskAction h T) + +theorem toTaskSymmetry_compatible (compatible : RecursiveRepresentativeCompatibility h T) + (g : {g : ZFSet.{u} // g ∈ G}) (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) + (below : d.templates.extension.le x (.inl (h.toInputs.source i))) : + (s.toTaskSymmetry g).current.toFun ((h.toInputs.representative i).toFun x) = + (h.toInputs.representative ((s.toTaskSymmetry g).perm i)).toFun x := by + apply d.coding.encode_injective + exact h.action.toSetAction.entry_unique + (s.toTaskSymmetry_current_entry g ((h.toInputs.representative i).toFun x)) + (compatible g.val i.val ((s.toTaskSymmetry g).perm i).val (h.source i).val + (h.actor i).val (h.actor ((s.toTaskSymmetry g).perm i)).val + (d.coding.encode x) _ _ (s.toTaskSymmetry_perm_entry g i) + (h.source_entry i) (h.actor_entry i) (h.actor_entry ((s.toTaskSymmetry g).perm i)) + (d.coding.encode_mem x) ((d.coding.le_encode x (.inl (h.toInputs.source i))).2 below) + (h.toInputs_representative_entry i x) + (h.toInputs_representative_entry ((s.toTaskSymmetry g).perm i) x)) + +include s in +theorem liftSection_equivariant (M : TransitiveGround.{u}) (next : h.NextInputs M) + (compatible : RecursiveRepresentativeCompatibility h T) + {g i j x y z : ZFSet.{u}} (transport : ZFSet.pair (ZFSet.pair g i) j ∈ T) + (first : ZFSet.pair x y ∈ h.liftSection M next i) + (second : ZFSet.pair x z ∈ h.liftSection M next j) : + ZFSet.pair (ZFSet.pair g y) z ∈ h.nextActionGraph T := by + have shape := s.taskAction.entry_shape transport + let actor : {g : ZFSet.{u} // g ∈ G} := ⟨g, shape.1⟩ + let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, shape.2.1⟩ + let target : {i : ZFSet.{u} // i ∈ I} := ⟨j, shape.2.2⟩ + have perm : (s.toTaskSymmetry actor).perm index = target := + Subtype.ext (s.taskAction.entry_unique (s.toTaskSymmetry_perm_entry actor index) transport) + have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next shape.2.1).1 first)).1 + obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx + rw [(h.liftSection_entry_iff M next index X y).1 first, + (h.liftSection_entry_iff M next target X z).1 second] + have equation := (s.toTaskSymmetry actor).lift_equivariant + (s.toTaskSymmetry_compatible compatible actor) index X + rw [perm] at equation + have entry := s.nextAction_entry M next actor (h.toInputs.lift index X) + rwa [equation] at entry + +end CodedRecursiveTaskAction + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.CodedRecursiveTaskAction + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (s : CodedRecursiveTaskAction h T) + +include s in +theorem nextTaskAction_of_family (M : TransitiveGround.{u}) (next : h.NextInputs M) + (compatible : RecursiveRepresentativeCompatibility h T) + (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ + i ∈ I ∧ f = h.liftSection M next i) + (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T)) : CodedRecursiveTaskAction inputs T := by + refine ⟨s.taskAction, s.source, ?_⟩ + intro g i j f f' x y z transport firstFamily secondFamily first second + obtain ⟨_, rfl⟩ := (entries i f).1 firstFamily + obtain ⟨_, rfl⟩ := (entries j f').1 secondFamily + exact s.liftSection_equivariant M next compatible transport first second + +end PartitionPilot.Forcing.CodedRecursiveTaskAction + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveRefinementUnionConditions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveRefinementUnionConditions.lean index 24a4ebf5cee9a45dee2c5c69c0883519cd718ca8..55640894476eb7696edfad0050fc2f3e0ce465d6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveRefinementUnionConditions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RecursiveRefinementUnionConditions.lean @@ -1,189 +1,189 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable {alpha p Ap q Aq : ZFSet.{u}} -local notation "levels" => refinementDataHistoryLevels stages history T -local notation "spliced" => assignmentSplice levels alpha Aq Ap -include run - -theorem splice_mem_of_candidates (ordinal : ordinalSetProperty stages) - (cutOrdinal : ordinalSetProperty alpha) (cutSubset : alpha ⊆ stages) - (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ A lower stronger, stageOneRawTests M d A lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) - (upper : ZFSet.pair p Ap ∈ M.refinementHistoryForcing rows T stages history) - (lower : ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T alpha (graphRestriction alpha history)) - (rowsBelow : ZFSet.pair q p ∈ rowOrder) - (contains : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq) - (candidate : ZFSet.pair q spliced ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) - (candidates : ∀ gamma ∈ stages, ZFSet.pair q (assignmentCut levels gamma spliced) ∈ - M.stageOneCandidateBound rows - (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : - ZFSet.pair q spliced ∈ M.refinementHistoryForcing rows T stages history := by - have dataExtended : Ap ⊆ spliced := assignmentSplice_extends contains - have oldTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 upper).2 - have lowerTests := ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).2 - have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) - (proved : ZFSet.pair q (assignmentCut levels beta spliced) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : - stageOneRawTests M d spliced (ZFSet.pair q (assignmentCut levels beta spliced)) := by - by_cases inside : beta ∈ alpha - · have stored := (forcingHistoryConditionCode_lookup_iff - (run.carriers.data.function.restrict cutSubset)).1 lowerTests beta inside - (refinementFormulaDataCode d) (pair_mem_graphRestriction.2 ⟨entry, inside⟩) - have checked := (stageTwoConditionCode_pair_iff M d _ beta q Aq).1 - ((packedSuccessorConditionCode_code_iff M _ beta d _).1 stored) - have sameCut := run.carriers.data.prefix_cut cutSubset (cutOrdinal.1 beta inside) Aq - rw [sameCut] at checked - have sameSplice : assignmentCut levels beta spliced = assignmentCut levels beta Aq := - assignmentCut_splice_below (cutOrdinal.1 beta inside) Aq Ap - rw [sameSplice] - exact (run.carriers.data.rawTests_splice_below entry M alpha Aq Ap _ inside).2 checked.2 - · have stored := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 oldTests - beta hbeta (refinementFormulaDataCode d) entry - have checked := (stageTwoConditionCode_pair_iff M d _ beta p Ap).1 - ((packedSuccessorConditionCode_code_iff M _ beta d _).1 stored) - have order : ZFSet.pair (ZFSet.pair q (assignmentCut levels beta spliced)) - (ZFSet.pair p (assignmentCut levels beta Ap)) ∈ d 8 := by - rw [run.order beta d entry] - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - _ _ _ _).2 ⟨proved, run.carriers.cut_mem upper hbeta, rowsBelow, assignmentCut_mono dataExtended⟩ - exact (run.carriers.data.rawTests_splice_above entry M alpha Aq Ap _ inside).2 - (mono beta d entry Ap _ _ checked.2 order) - have earlier : ∀ gamma ∈ stages, ZFSet.pair q (assignmentCut levels gamma spliced) ∈ - M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by - intro gamma - induction gamma using ZFSet.inductionOn with - | h gamma ih => - intro hgamma - apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 - refine ⟨candidates gamma hgamma, ?_⟩ - intro beta hbeta - have betaFull := ordinal.1 gamma hgamma beta hbeta - have betaSubset := ordinal.2 gamma hgamma beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - have proved := ih beta hbeta betaFull - have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset - (assignmentCut levels gamma spliced) - refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 - rw [sameCut, assignmentCut_nested betaSubset] - refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ - exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) - (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma spliced member) - apply (M.mem_refinementHistoryForcing rows T stages history _).2 - refine ⟨candidate, ?_⟩ - intro beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - refine ⟨refinementFormulaDataCode d, entry, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 - exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, - step beta hbeta d entry (earlier beta hbeta)⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - - - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -local notation "levels" => refinementDataHistoryLevels stages history T -include run - -theorem union_lower_bound_of_candidates (ordinal : ordinalSetProperty stages) - (unionTests : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ (family lower : Nat → ZFSet.{u}) q, - (∀ n m, n ≤ m → family n ⊆ family m) → - (∀ n, ZFSet.pair q (lower n) ∈ d 8) → - (∀ n, stageOneRawTests M d (family n) (lower n)) → - stageOneRawTests M d (stageOneAssignmentUnion family) q) - (family row : Nat → ZFSet.{u}) (q : ZFSet.{u}) - (members : ∀ n, ZFSet.pair (row n) (family n) ∈ M.refinementHistoryForcing rows T stages history) - (increasing : ∀ n m, n ≤ m → family n ⊆ family m) - (rowsBelow : ∀ n, ZFSet.pair q (row n) ∈ rowOrder) - (candidate : ZFSet.pair q (stageOneAssignmentUnion family) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) - (candidates : ∀ gamma ∈ stages, - ZFSet.pair q (assignmentCut levels gamma (stageOneAssignmentUnion family)) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : - ZFSet.pair q (stageOneAssignmentUnion family) ∈ M.refinementHistoryForcing rows T stages history ∧ - ∀ n, ZFSet.pair (ZFSet.pair q (stageOneAssignmentUnion family)) (ZFSet.pair (row n) (family n)) ∈ - M.refinementHistoryOrder rows rowOrder T stages history := by - have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) - (proved : ZFSet.pair q (assignmentCut levels beta (stageOneAssignmentUnion family)) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : - stageOneRawTests M d (stageOneAssignmentUnion family) - (ZFSet.pair q (assignmentCut levels beta (stageOneAssignmentUnion family))) := by - apply unionTests beta d entry family - (fun n => ZFSet.pair (row n) (assignmentCut levels beta (family n))) _ increasing - · intro n - rw [run.order beta d entry] - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - _ _ _ _).2 ⟨proved, run.carriers.cut_mem (members n) hbeta, rowsBelow n, - assignmentCut_mono (stageOneAssignmentUnion_contains family n)⟩ - · intro n - have oldTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 (members n)).2 - have stored := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 oldTests - beta hbeta (refinementFormulaDataCode d) entry - exact ((stageTwoConditionCode_pair_iff M d _ beta (row n) (family n)).1 - ((packedSuccessorConditionCode_code_iff M _ beta d _).1 stored)).2 - have earlier : ∀ gamma ∈ stages, - ZFSet.pair q (assignmentCut levels gamma (stageOneAssignmentUnion family)) ∈ - M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by - intro gamma - induction gamma using ZFSet.inductionOn with - | h gamma ih => - intro hgamma - apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 - refine ⟨candidates gamma hgamma, ?_⟩ - intro beta hbeta - have betaFull := ordinal.1 gamma hgamma beta hbeta - have betaSubset := ordinal.2 gamma hgamma beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - have proved := ih beta hbeta betaFull - have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset - (assignmentCut levels gamma (stageOneAssignmentUnion family)) - refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 - rw [sameCut, assignmentCut_nested betaSubset] - refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ - exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) - (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma (stageOneAssignmentUnion family) member) - have member : ZFSet.pair q (stageOneAssignmentUnion family) ∈ M.refinementHistoryForcing rows T stages history := by - apply (M.mem_refinementHistoryForcing rows T stages history _).2 - refine ⟨candidate, ?_⟩ - intro beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - refine ⟨refinementFormulaDataCode d, entry, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 - exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, - step beta hbeta d entry (earlier beta hbeta)⟩ - exact ⟨member, fun n => (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 - ⟨member, members n, rowsBelow n, stageOneAssignmentUnion_contains family n⟩⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable {alpha p Ap q Aq : ZFSet.{u}} +local notation "levels" => refinementDataHistoryLevels stages history T +local notation "spliced" => assignmentSplice levels alpha Aq Ap +include run + +theorem splice_mem_of_candidates (ordinal : ordinalSetProperty stages) + (cutOrdinal : ordinalSetProperty alpha) (cutSubset : alpha ⊆ stages) + (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ A lower stronger, stageOneRawTests M d A lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) + (upper : ZFSet.pair p Ap ∈ M.refinementHistoryForcing rows T stages history) + (lower : ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T alpha (graphRestriction alpha history)) + (rowsBelow : ZFSet.pair q p ∈ rowOrder) + (contains : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq) + (candidate : ZFSet.pair q spliced ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) + (candidates : ∀ gamma ∈ stages, ZFSet.pair q (assignmentCut levels gamma spliced) ∈ + M.stageOneCandidateBound rows + (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : + ZFSet.pair q spliced ∈ M.refinementHistoryForcing rows T stages history := by + have dataExtended : Ap ⊆ spliced := assignmentSplice_extends contains + have oldTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 upper).2 + have lowerTests := ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).2 + have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) + (proved : ZFSet.pair q (assignmentCut levels beta spliced) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : + stageOneRawTests M d spliced (ZFSet.pair q (assignmentCut levels beta spliced)) := by + by_cases inside : beta ∈ alpha + · have stored := (forcingHistoryConditionCode_lookup_iff + (run.carriers.data.function.restrict cutSubset)).1 lowerTests beta inside + (refinementFormulaDataCode d) (pair_mem_graphRestriction.2 ⟨entry, inside⟩) + have checked := (stageTwoConditionCode_pair_iff M d _ beta q Aq).1 + ((packedSuccessorConditionCode_code_iff M _ beta d _).1 stored) + have sameCut := run.carriers.data.prefix_cut cutSubset (cutOrdinal.1 beta inside) Aq + rw [sameCut] at checked + have sameSplice : assignmentCut levels beta spliced = assignmentCut levels beta Aq := + assignmentCut_splice_below (cutOrdinal.1 beta inside) Aq Ap + rw [sameSplice] + exact (run.carriers.data.rawTests_splice_below entry M alpha Aq Ap _ inside).2 checked.2 + · have stored := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 oldTests + beta hbeta (refinementFormulaDataCode d) entry + have checked := (stageTwoConditionCode_pair_iff M d _ beta p Ap).1 + ((packedSuccessorConditionCode_code_iff M _ beta d _).1 stored) + have order : ZFSet.pair (ZFSet.pair q (assignmentCut levels beta spliced)) + (ZFSet.pair p (assignmentCut levels beta Ap)) ∈ d 8 := by + rw [run.order beta d entry] + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + _ _ _ _).2 ⟨proved, run.carriers.cut_mem upper hbeta, rowsBelow, assignmentCut_mono dataExtended⟩ + exact (run.carriers.data.rawTests_splice_above entry M alpha Aq Ap _ inside).2 + (mono beta d entry Ap _ _ checked.2 order) + have earlier : ∀ gamma ∈ stages, ZFSet.pair q (assignmentCut levels gamma spliced) ∈ + M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by + intro gamma + induction gamma using ZFSet.inductionOn with + | h gamma ih => + intro hgamma + apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 + refine ⟨candidates gamma hgamma, ?_⟩ + intro beta hbeta + have betaFull := ordinal.1 gamma hgamma beta hbeta + have betaSubset := ordinal.2 gamma hgamma beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + have proved := ih beta hbeta betaFull + have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset + (assignmentCut levels gamma spliced) + refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 + rw [sameCut, assignmentCut_nested betaSubset] + refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ + exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) + (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma spliced member) + apply (M.mem_refinementHistoryForcing rows T stages history _).2 + refine ⟨candidate, ?_⟩ + intro beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + refine ⟨refinementFormulaDataCode d, entry, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 + exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, + step beta hbeta d entry (earlier beta hbeta)⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + + + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +local notation "levels" => refinementDataHistoryLevels stages history T +include run + +theorem union_lower_bound_of_candidates (ordinal : ordinalSetProperty stages) + (unionTests : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ (family lower : Nat → ZFSet.{u}) q, + (∀ n m, n ≤ m → family n ⊆ family m) → + (∀ n, ZFSet.pair q (lower n) ∈ d 8) → + (∀ n, stageOneRawTests M d (family n) (lower n)) → + stageOneRawTests M d (stageOneAssignmentUnion family) q) + (family row : Nat → ZFSet.{u}) (q : ZFSet.{u}) + (members : ∀ n, ZFSet.pair (row n) (family n) ∈ M.refinementHistoryForcing rows T stages history) + (increasing : ∀ n m, n ≤ m → family n ⊆ family m) + (rowsBelow : ∀ n, ZFSet.pair q (row n) ∈ rowOrder) + (candidate : ZFSet.pair q (stageOneAssignmentUnion family) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) + (candidates : ∀ gamma ∈ stages, + ZFSet.pair q (assignmentCut levels gamma (stageOneAssignmentUnion family)) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : + ZFSet.pair q (stageOneAssignmentUnion family) ∈ M.refinementHistoryForcing rows T stages history ∧ + ∀ n, ZFSet.pair (ZFSet.pair q (stageOneAssignmentUnion family)) (ZFSet.pair (row n) (family n)) ∈ + M.refinementHistoryOrder rows rowOrder T stages history := by + have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) + (proved : ZFSet.pair q (assignmentCut levels beta (stageOneAssignmentUnion family)) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : + stageOneRawTests M d (stageOneAssignmentUnion family) + (ZFSet.pair q (assignmentCut levels beta (stageOneAssignmentUnion family))) := by + apply unionTests beta d entry family + (fun n => ZFSet.pair (row n) (assignmentCut levels beta (family n))) _ increasing + · intro n + rw [run.order beta d entry] + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + _ _ _ _).2 ⟨proved, run.carriers.cut_mem (members n) hbeta, rowsBelow n, + assignmentCut_mono (stageOneAssignmentUnion_contains family n)⟩ + · intro n + have oldTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 (members n)).2 + have stored := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 oldTests + beta hbeta (refinementFormulaDataCode d) entry + exact ((stageTwoConditionCode_pair_iff M d _ beta (row n) (family n)).1 + ((packedSuccessorConditionCode_code_iff M _ beta d _).1 stored)).2 + have earlier : ∀ gamma ∈ stages, + ZFSet.pair q (assignmentCut levels gamma (stageOneAssignmentUnion family)) ∈ + M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by + intro gamma + induction gamma using ZFSet.inductionOn with + | h gamma ih => + intro hgamma + apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 + refine ⟨candidates gamma hgamma, ?_⟩ + intro beta hbeta + have betaFull := ordinal.1 gamma hgamma beta hbeta + have betaSubset := ordinal.2 gamma hgamma beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + have proved := ih beta hbeta betaFull + have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset + (assignmentCut levels gamma (stageOneAssignmentUnion family)) + refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 + rw [sameCut, assignmentCut_nested betaSubset] + refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ + exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) + (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma (stageOneAssignmentUnion family) member) + have member : ZFSet.pair q (stageOneAssignmentUnion family) ∈ M.refinementHistoryForcing rows T stages history := by + apply (M.mem_refinementHistoryForcing rows T stages history _).2 + refine ⟨candidate, ?_⟩ + intro beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + refine ⟨refinementFormulaDataCode d, entry, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta q _).2 + exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, + step beta hbeta d entry (earlier beta hbeta)⟩ + exact ⟨member, fun n => (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 + ⟨member, members n, rowsBelow n, stageOneAssignmentUnion_contains family n⟩⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentActionLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentActionLaws.lean index a973a9a3a6edfb27d68c5836814458f8e404fa74..c3823c629d295c24381c0c1c30b4ac66d937449a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentActionLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentActionLaws.lean @@ -1,116 +1,116 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementAssignmentImages - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "J" => stageOneAssignments I T -local notation "graph" => M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 -local notation "image" => M.refinementAssignmentImage a s b d level T T2 valid valid2 -local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps -include pairing unions powers separation collection carrier order maps closed closed2 familyGround - -theorem refinementAssignmentActionGraph_one {x : ZFSet.{u}} (hx : x ∈ J) (y : ZFSet.{u}) : - ZFSet.pair x y ∈ graph 1 ↔ y = x := by - obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi - have entry := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround 1 C E U Rf Rc - ⟨u, valid u hu⟩ ⟨w, valid w hw⟩ hi hu hw y - rw [a.act_one s ⟨u, valid u hu⟩, a.act_one s ⟨w, valid w hw⟩] at entry - simpa only [d.one, a.act_one] using entry - -theorem refinementAssignmentActionGraph_mul (g h : G) {x : ZFSet.{u}} (hx : x ∈ J) (z : ZFSet.{u}) : - ZFSet.pair x z ∈ graph (g * h) ↔ - ∃ y ∈ J, ZFSet.pair x y ∈ graph h ∧ ZFSet.pair y z ∈ graph g := by - obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi - let nu : Name s := ⟨u, valid u hu⟩ - let nw : Name s := ⟨w, valid w hw⟩ - have indexH := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps level T T2 valid closed closed2 familyGround h C E U Rf Rc).mpr hi - let y := stageOneAssignment (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val) - (a.act s h nu).val (a.act s h nw).val - have hy : y ∈ J := (stageOneAssignment_mem_assignments I T _ _ _).2 - ⟨indexH, closed h nu hu, closed h nw hw⟩ - have atH := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround h C E U Rf Rc nu nw hi hu hw - have atG := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround g - (d.iso h C) (d.iso h E) (move h U) (move h Rf) (move h Rc) - (a.act s h nu) (a.act s h nw) indexH (closed h nu hu) (closed h nw hw) z - have atMul := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround (g * h) - C E U Rf Rc nu nw hi hu hw z - simp only [M.stageOneNameAction_val] at atG - have same : ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u w) z ∈ graph (g * h) ↔ - ZFSet.pair y z ∈ graph g := by - dsimp only [y] - rw [atMul, atG] - simp only [d.mul, a.act_mul] - constructor - · intro entry - exact ⟨y, hy, (atH y).mpr rfl, same.mp entry⟩ - · rintro ⟨y', _, eh, eg⟩ - have equal : y' = y := (atH y').mp eh - exact same.mpr (equal ▸ eg) - -theorem refinementAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by - apply ZFSet.ext - intro y - constructor - · intro hy - obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph 1) y).1 hy - exact (M.refinementAssignmentActionGraph_one a s b d level T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround (subset hx) y).mp entry ▸ hx - · intro hy - exact (mem_relationImage A J (graph 1) y).2 ⟨subset hy, y, hy, - (M.refinementAssignmentActionGraph_one a s b d level T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround (subset hy) y).mpr rfl⟩ - -theorem refinementAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : - image (g * h) A = image g (image h A) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨hz, x, hx, entry⟩ := (mem_relationImage A J (graph (g * h)) z).1 hz - obtain ⟨y, hy, eh, eg⟩ := - (M.refinementAssignmentActionGraph_mul a s b d level T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mp entry - exact (mem_relationImage (image h A) J (graph g) z).2 - ⟨hz, y, (mem_relationImage A J (graph h) y).2 ⟨hy, x, hx, eh⟩, eg⟩ - · intro hz - obtain ⟨hz, y, hy, eg⟩ := (mem_relationImage (image h A) J (graph g) z).1 hz - obtain ⟨hy, x, hx, eh⟩ := (mem_relationImage A J (graph h) y).1 hy - exact (mem_relationImage A J (graph (g * h)) z).2 ⟨hz, x, hx, - (M.refinementAssignmentActionGraph_mul a s b d level T T2 valid valid2 t pairing unions powers - separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mpr ⟨y, hy, eh, eg⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementAssignmentImages + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "J" => stageOneAssignments I T +local notation "graph" => M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 +local notation "image" => M.refinementAssignmentImage a s b d level T T2 valid valid2 +local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps +include pairing unions powers separation collection carrier order maps closed closed2 familyGround + +theorem refinementAssignmentActionGraph_one {x : ZFSet.{u}} (hx : x ∈ J) (y : ZFSet.{u}) : + ZFSet.pair x y ∈ graph 1 ↔ y = x := by + obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi + have entry := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround 1 C E U Rf Rc + ⟨u, valid u hu⟩ ⟨w, valid w hw⟩ hi hu hw y + rw [a.act_one s ⟨u, valid u hu⟩, a.act_one s ⟨w, valid w hw⟩] at entry + simpa only [d.one, a.act_one] using entry + +theorem refinementAssignmentActionGraph_mul (g h : G) {x : ZFSet.{u}} (hx : x ∈ J) (z : ZFSet.{u}) : + ZFSet.pair x z ∈ graph (g * h) ↔ + ∃ y ∈ J, ZFSet.pair x y ∈ graph h ∧ ZFSet.pair y z ∈ graph g := by + obtain ⟨idx, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 hx + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi + let nu : Name s := ⟨u, valid u hu⟩ + let nw : Name s := ⟨w, valid w hw⟩ + have indexH := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps level T T2 valid closed closed2 familyGround h C E U Rf Rc).mpr hi + let y := stageOneAssignment (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val) + (a.act s h nu).val (a.act s h nw).val + have hy : y ∈ J := (stageOneAssignment_mem_assignments I T _ _ _).2 + ⟨indexH, closed h nu hu, closed h nw hw⟩ + have atH := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround h C E U Rf Rc nu nw hi hu hw + have atG := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround g + (d.iso h C) (d.iso h E) (move h U) (move h Rf) (move h Rc) + (a.act s h nu) (a.act s h nw) indexH (closed h nu hu) (closed h nw hw) z + have atMul := M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround (g * h) + C E U Rf Rc nu nw hi hu hw z + simp only [M.stageOneNameAction_val] at atG + have same : ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u w) z ∈ graph (g * h) ↔ + ZFSet.pair y z ∈ graph g := by + dsimp only [y] + rw [atMul, atG] + simp only [d.mul, a.act_mul] + constructor + · intro entry + exact ⟨y, hy, (atH y).mpr rfl, same.mp entry⟩ + · rintro ⟨y', _, eh, eg⟩ + have equal : y' = y := (atH y').mp eh + exact same.mpr (equal ▸ eg) + +theorem refinementAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by + apply ZFSet.ext + intro y + constructor + · intro hy + obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A J (graph 1) y).1 hy + exact (M.refinementAssignmentActionGraph_one a s b d level T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround (subset hx) y).mp entry ▸ hx + · intro hy + exact (mem_relationImage A J (graph 1) y).2 ⟨subset hy, y, hy, + (M.refinementAssignmentActionGraph_one a s b d level T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround (subset hy) y).mpr rfl⟩ + +theorem refinementAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : + image (g * h) A = image g (image h A) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨hz, x, hx, entry⟩ := (mem_relationImage A J (graph (g * h)) z).1 hz + obtain ⟨y, hy, eh, eg⟩ := + (M.refinementAssignmentActionGraph_mul a s b d level T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mp entry + exact (mem_relationImage (image h A) J (graph g) z).2 + ⟨hz, y, (mem_relationImage A J (graph h) y).2 ⟨hy, x, hx, eh⟩, eg⟩ + · intro hz + obtain ⟨hz, y, hy, eg⟩ := (mem_relationImage (image h A) J (graph g) z).1 hz + obtain ⟨hy, x, hx, eh⟩ := (mem_relationImage A J (graph h) y).1 hy + exact (mem_relationImage A J (graph (g * h)) z).2 ⟨hz, x, hx, + (M.refinementAssignmentActionGraph_mul a s b d level T T2 valid valid2 t pairing unions powers + separation collection carrier order maps closed closed2 familyGround g h (subset hx) z).mpr ⟨y, hy, eh, eg⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelActions.lean index 5ac73362020322637ef1526aba64daf0a6fe4890..853a8400f98a02c1d8680b51c839291b08f426dc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelActions.lean @@ -1,105 +1,105 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundRefinementQuotientNames - -namespace OAI - - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P Q : Type u} [PartialOrder P] [OrderTop P] -variable [PartialOrder Q] [OrderTop Q] {G : Type v} [Group G] -variable (a : PosetAction G P) (e : PosetAction G Q) -variable (s : Presentation P) (upper : Presentation Q) (incl : P → Q) -variable (equivariant : ∀ g p, incl (a.iso g p) = e.iso g (incl p)) -variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - -include equivariant closed - -theorem act_refinementAssignmentLabel (g : G) (idx movedIdx : ZFSet.{u}) - (Rf Rc : Name s) - (occurrences : ∀ (v w : Name s) (p : Q) (_hv : v.val ∈ T) (_hw : w.val ∈ T), - (∃ row A, upper.encode (e.iso g p) = ZFSet.pair row A ∧ - stageOneAssignment movedIdx (a.act s g v).val (a.act s g w).val ∈ A) ↔ - (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A)) : - e.act upper g (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc) = - refinementAssignmentLabel upper incl ⊤ T valid movedIdx (a.act s g Rf) (a.act s g Rc) := by - have paired (v w : Name s) : - e.act upper g (orderedPair ⊤ (rename upper incl (refinementClass T valid Rc v)) - (rename upper incl (refinementClass T valid Rf w))) = - orderedPair ⊤ (rename upper incl (refinementClass T valid (a.act s g Rc) (a.act s g v))) - (rename upper incl (refinementClass T valid (a.act s g Rf) (a.act s g w))) := by - change rename upper (e.iso g) _ = _ - rw [rename_orderedPair, (e.iso g).map_top] - change orderedPair ⊤ (e.act upper g _) (e.act upper g _) = _ - rw [a.act_rename_of_equivariant e s upper incl equivariant, - a.act_rename_of_equivariant e s upper incl equivariant, - act_refinementClass a T valid closed, act_refinementClass a T valid closed] - apply ext - intro sigma p - obtain ⟨sigma, rfl⟩ := (e.nameEquiv upper g).surjective sigma - obtain ⟨p, rfl⟩ := (e.iso g).surjective p - change Entry (e.act upper g sigma) - (e.act upper g (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc)) (e.iso g p) ↔ - Entry (e.act upper g sigma) - (refinementAssignmentLabel upper incl ⊤ T valid movedIdx (a.act s g Rf) (a.act s g Rc)) (e.iso g p) - rw [e.entry_act, entry_refinementAssignmentLabel, entry_refinementAssignmentLabel] - constructor - · rintro ⟨v, w, hv, hw, literal, equal⟩ - refine ⟨a.act s g v, a.act s g w, closed g v hv, closed g w hw, - (occurrences v w p hv hw).2 literal, ?_⟩ - exact (paired v w).symm.trans (congrArg (e.act upper g) equal) - · rintro ⟨v, w, hv, hw, literal, equal⟩ - let oldV := a.act s g⁻¹ v - let oldW := a.act s g⁻¹ w - have oldVmem : oldV.val ∈ T := closed g⁻¹ v hv - have oldWmem : oldW.val ∈ T := closed g⁻¹ w hw - have vEq : a.act s g oldV = v := a.act_inv_right s g v - have wEq : a.act s g oldW = w := a.act_inv_right s g w - have oldLiteral := (occurrences oldV oldW p oldVmem oldWmem).1 - (by rw [vEq, wEq]; exact literal) - refine ⟨oldV, oldW, oldVmem, oldWmem, oldLiteral, ?_⟩ - apply (e.nameEquiv upper g).injective - change e.act upper g _ = e.act upper g sigma - rw [paired, vEq, wEq] - exact equal - -theorem refinementAssignmentLabel_support (idx : ZFSet.{u}) (Rf Rc : Name s) - (K : Subgroup G) - (occurrences : ∀ g ∈ K, ∀ (v w : Name s) (p : Q) (_hv : v.val ∈ T) (_hw : w.val ∈ T), - (∃ row A, upper.encode (e.iso g p) = ZFSet.pair row A ∧ - stageOneAssignment idx (a.act s g v).val (a.act s g w).val ∈ A) ↔ - (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A)) - (fine : K ≤ a.stabilizer s Rf) (coarse : K ≤ a.stabilizer s Rc) : - K ≤ e.stabilizer upper (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc) := by - intro g hg - change e.act upper g _ = _ - rw [act_refinementAssignmentLabel a e s upper incl equivariant T valid closed - g idx idx Rf Rc (occurrences g hg), fine hg, coarse hg] - -theorem refinementAssignmentLabel_hs (F : NormalSubgroupFamily G) - (children : ∀ z : Name s, z.val ∈ T → HereditarilySymmetric a s F z) - (idx : ZFSet.{u}) (Rf Rc : Name s) (K : Subgroup G) (member : F.mem K) - (occurrences : ∀ g ∈ K, ∀ (v w : Name s) (p : Q) (_hv : v.val ∈ T) (_hw : w.val ∈ T), - (∃ row A, upper.encode (e.iso g p) = ZFSet.pair row A ∧ - stageOneAssignment idx (a.act s g v).val (a.act s g w).val ∈ A) ↔ - (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A)) - (fine : K ≤ a.stabilizer s Rf) (coarse : K ≤ a.stabilizer s Rc) - (fineHS : HereditarilySymmetric a s F Rf) (coarseHS : HereditarilySymmetric a s F Rc) : - HereditarilySymmetric e upper F - (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc) := by - refine HereditarilySymmetric.mk - (F.upward member (refinementAssignmentLabel_support a e s upper incl equivariant T valid closed - idx Rf Rc K occurrences fine coarse)) ?_ - intro sigma p entry - obtain ⟨v, w, hv, hw, _literal, rfl⟩ := - (entry_refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc sigma p).1 entry - exact ((refinementClass_hs_of_hs a T valid closed F children Rc v coarseHS (children v hv)).rename - e upper incl equivariant).orderedPair - ((refinementClass_hs_of_hs a T valid closed F children Rf w fineHS (children w hw)).rename - e upper incl equivariant) - -end PartitionPilot.Forcing.Name - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundRefinementQuotientNames + +namespace OAI + + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P Q : Type u} [PartialOrder P] [OrderTop P] +variable [PartialOrder Q] [OrderTop Q] {G : Type v} [Group G] +variable (a : PosetAction G P) (e : PosetAction G Q) +variable (s : Presentation P) (upper : Presentation Q) (incl : P → Q) +variable (equivariant : ∀ g p, incl (a.iso g p) = e.iso g (incl p)) +variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + +include equivariant closed + +theorem act_refinementAssignmentLabel (g : G) (idx movedIdx : ZFSet.{u}) + (Rf Rc : Name s) + (occurrences : ∀ (v w : Name s) (p : Q) (_hv : v.val ∈ T) (_hw : w.val ∈ T), + (∃ row A, upper.encode (e.iso g p) = ZFSet.pair row A ∧ + stageOneAssignment movedIdx (a.act s g v).val (a.act s g w).val ∈ A) ↔ + (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A)) : + e.act upper g (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc) = + refinementAssignmentLabel upper incl ⊤ T valid movedIdx (a.act s g Rf) (a.act s g Rc) := by + have paired (v w : Name s) : + e.act upper g (orderedPair ⊤ (rename upper incl (refinementClass T valid Rc v)) + (rename upper incl (refinementClass T valid Rf w))) = + orderedPair ⊤ (rename upper incl (refinementClass T valid (a.act s g Rc) (a.act s g v))) + (rename upper incl (refinementClass T valid (a.act s g Rf) (a.act s g w))) := by + change rename upper (e.iso g) _ = _ + rw [rename_orderedPair, (e.iso g).map_top] + change orderedPair ⊤ (e.act upper g _) (e.act upper g _) = _ + rw [a.act_rename_of_equivariant e s upper incl equivariant, + a.act_rename_of_equivariant e s upper incl equivariant, + act_refinementClass a T valid closed, act_refinementClass a T valid closed] + apply ext + intro sigma p + obtain ⟨sigma, rfl⟩ := (e.nameEquiv upper g).surjective sigma + obtain ⟨p, rfl⟩ := (e.iso g).surjective p + change Entry (e.act upper g sigma) + (e.act upper g (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc)) (e.iso g p) ↔ + Entry (e.act upper g sigma) + (refinementAssignmentLabel upper incl ⊤ T valid movedIdx (a.act s g Rf) (a.act s g Rc)) (e.iso g p) + rw [e.entry_act, entry_refinementAssignmentLabel, entry_refinementAssignmentLabel] + constructor + · rintro ⟨v, w, hv, hw, literal, equal⟩ + refine ⟨a.act s g v, a.act s g w, closed g v hv, closed g w hw, + (occurrences v w p hv hw).2 literal, ?_⟩ + exact (paired v w).symm.trans (congrArg (e.act upper g) equal) + · rintro ⟨v, w, hv, hw, literal, equal⟩ + let oldV := a.act s g⁻¹ v + let oldW := a.act s g⁻¹ w + have oldVmem : oldV.val ∈ T := closed g⁻¹ v hv + have oldWmem : oldW.val ∈ T := closed g⁻¹ w hw + have vEq : a.act s g oldV = v := a.act_inv_right s g v + have wEq : a.act s g oldW = w := a.act_inv_right s g w + have oldLiteral := (occurrences oldV oldW p oldVmem oldWmem).1 + (by rw [vEq, wEq]; exact literal) + refine ⟨oldV, oldW, oldVmem, oldWmem, oldLiteral, ?_⟩ + apply (e.nameEquiv upper g).injective + change e.act upper g _ = e.act upper g sigma + rw [paired, vEq, wEq] + exact equal + +theorem refinementAssignmentLabel_support (idx : ZFSet.{u}) (Rf Rc : Name s) + (K : Subgroup G) + (occurrences : ∀ g ∈ K, ∀ (v w : Name s) (p : Q) (_hv : v.val ∈ T) (_hw : w.val ∈ T), + (∃ row A, upper.encode (e.iso g p) = ZFSet.pair row A ∧ + stageOneAssignment idx (a.act s g v).val (a.act s g w).val ∈ A) ↔ + (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A)) + (fine : K ≤ a.stabilizer s Rf) (coarse : K ≤ a.stabilizer s Rc) : + K ≤ e.stabilizer upper (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc) := by + intro g hg + change e.act upper g _ = _ + rw [act_refinementAssignmentLabel a e s upper incl equivariant T valid closed + g idx idx Rf Rc (occurrences g hg), fine hg, coarse hg] + +theorem refinementAssignmentLabel_hs (F : NormalSubgroupFamily G) + (children : ∀ z : Name s, z.val ∈ T → HereditarilySymmetric a s F z) + (idx : ZFSet.{u}) (Rf Rc : Name s) (K : Subgroup G) (member : F.mem K) + (occurrences : ∀ g ∈ K, ∀ (v w : Name s) (p : Q) (_hv : v.val ∈ T) (_hw : w.val ∈ T), + (∃ row A, upper.encode (e.iso g p) = ZFSet.pair row A ∧ + stageOneAssignment idx (a.act s g v).val (a.act s g w).val ∈ A) ↔ + (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A)) + (fine : K ≤ a.stabilizer s Rf) (coarse : K ≤ a.stabilizer s Rc) + (fineHS : HereditarilySymmetric a s F Rf) (coarseHS : HereditarilySymmetric a s F Rc) : + HereditarilySymmetric e upper F + (refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc) := by + refine HereditarilySymmetric.mk + (F.upward member (refinementAssignmentLabel_support a e s upper incl equivariant T valid closed + idx Rf Rc K occurrences fine coarse)) ?_ + intro sigma p entry + obtain ⟨v, w, hv, hw, _literal, rfl⟩ := + (entry_refinementAssignmentLabel upper incl ⊤ T valid idx Rf Rc sigma p).1 entry + exact ((refinementClass_hs_of_hs a T valid closed F children Rc v coarseHS (children v hv)).rename + e upper incl equivariant).orderedPair + ((refinementClass_hs_of_hs a T valid closed F children Rf w fineHS (children w hw)).rename + e upper incl equivariant) + +end PartitionPilot.Forcing.Name + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelNames.lean index 92aab8acb7bc4fb592ef633e0428e1dcf6cbd18c..109df7cbd35bc6c791b89fa58e18bd0edbc2ed61 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementAssignmentLabelNames.lean @@ -1,300 +1,300 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.EquivalenceClassCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization -import OAI.SetTheory.PartitionPrinciple.Transfinite.StageOneDataBoundLaws - -namespace OAI - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} - -noncomputable def refinementClass (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (R w : Name s) : Name s := - selectName (fun z p => ForcesMem p (orderedPair ⊤ z w) R) (familySet ⊤ T valid) - -theorem entry_refinementClass (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (R w z : Name s) (p : P) : - Entry z (refinementClass T valid R w) p ↔ - z.val ∈ T ∧ ForcesMem p (orderedPair ⊤ z w) R := by - rw [refinementClass, entry_selectName] - constructor - · rintro ⟨r, entry, _, forced⟩ - exact ⟨((entry_familySet ⊤ T valid z r).1 entry).1, forced⟩ - · rintro ⟨member, forced⟩ - exact ⟨⊤, (entry_familySet ⊤ T valid z ⊤).2 ⟨member, rfl⟩, le_top, forced⟩ - -theorem refinementClass_subset (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (R w : Name s) : (refinementClass T valid R w).val ⊆ ZFSet.prod T s.carrier := by - intro x member - obtain ⟨z, p, rfl⟩ := entries_cover (refinementClass T valid R w) member - exact ZFSet.pair_mem_prod.2 - ⟨((entry_refinementClass T valid R w z p).1 member).1, s.encode_mem p⟩ - -theorem eval_refinementClass (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (R w : Name s) - (hR : R ∈ D.names) - (pairs : ∀ z : Name s, z.val ∈ T → orderedPair ⊤ z w ∈ D.names) : - eval {p | H.mem p} (refinementClass T valid R w) = - equivalenceClass (eval {p | H.mem p} (familySet ⊤ T valid)) - (eval {p | H.mem p} R) (eval {p | H.mem p} w) := by - apply ZFSet.ext - intro x - rw [mem_eval, mem_equivalenceClass] - constructor - · rintro ⟨z, p, entry, hp, rfl⟩ - obtain ⟨member, forced⟩ := (entry_refinementClass T valid R w z p).1 entry - have related := forcesMem_sound D H generic (pairs z member) hR hp forced - rw [eval_orderedPair {p | H.mem p} ⊤ H.top_mem z w] at related - exact ⟨(mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid _).2 ⟨z, member, rfl⟩, related⟩ - · rintro ⟨member, related⟩ - obtain ⟨z, hz, rfl⟩ := (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).1 member - have named : eval {p | H.mem p} (orderedPair ⊤ z w) ∈ eval {p | H.mem p} R := by - rw [eval_orderedPair {p | H.mem p} ⊤ H.top_mem z w] - exact related - obtain ⟨p, hp, forced⟩ := (eval_mem_iff_forcesMem D H generic (pairs z hz) hR).1 named - exact ⟨z, p, (entry_refinementClass T valid R w z p).2 ⟨hz, forced⟩, hp, rfl⟩ - -variable {G : Type v} [Group G] (a : PosetAction G P) - -theorem act_refinementClass (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - (g : G) (R w : Name s) : - a.act s g (refinementClass T valid R w) = - refinementClass T valid (a.act s g R) (a.act s g w) := by - unfold refinementClass - rw [a.act_selectName s g _ (fun z p => ForcesMem p (orderedPair ⊤ z (a.act s g w)) (a.act s g R))] - · rw [act_familySet a T valid closed] - · intro z p - have paired : a.act s g (orderedPair ⊤ z w) = - orderedPair ⊤ (a.act s g z) (a.act s g w) := by - change rename s (a.iso g) _ = _ - rw [rename_orderedPair, (a.iso g).map_top] - rfl - rw [← paired] - exact a.forcesMem_act_iff s g p (orderedPair ⊤ z w) R - -theorem refinementClass_support (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - (R w : Name s) (K : Subgroup G) - (relation : K ≤ a.stabilizer s R) (representative : K ≤ a.stabilizer s w) : - K ≤ a.stabilizer s (refinementClass T valid R w) := by - intro g hg - change a.act s g _ = _ - rw [act_refinementClass a T valid closed, relation hg, representative hg] - -theorem refinementClass_hs (F : NormalSubgroupFamily G) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - (children : ∀ z : Name s, z.val ∈ T → HereditarilySymmetric a s F z) - (R w : Name s) (K : Subgroup G) (member : F.mem K) - (relation : K ≤ a.stabilizer s R) (representative : K ≤ a.stabilizer s w) : - HereditarilySymmetric a s F (refinementClass T valid R w) := - HereditarilySymmetric.mk - (F.upward member (refinementClass_support a T valid closed R w K relation representative)) - (fun z p entry => children z ((entry_refinementClass T valid R w z p).1 entry).1) - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace SetFormula - -def refinementClassEntryFormula : SetFormula 7 := - ex (ex (ex (.conj (.mem 2 4) (.conj (.mem 1 7) - (.conj (orderedPairFormula 3 2 1) - (.conj (orderedPairNameCodeFormula 0 2 6 9) - (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) - ![7, 8] 1 ![0, 5]))))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection carrier order in -theorem realize_refinementClassEntryFormula {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) - (x : ZFSet.{u}) (hx : x ∈ M.sets) : - Realize M.sets refinementClassEntryFormula - (extend x (extend T (extend R.val (extend w.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0))))))) ↔ - x ∈ (Name.refinementClass T valid R w).val := by - let env := extend x (extend T (extend R.val (extend w.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))) - have hone := M.transitive carrier (s.encode_mem ⊤) - have members : ∀ j, env j ∈ M.sets := - Fin.cases hx (Fin.cases hT (Fin.cases hR (Fin.cases hw - (Fin.cases carrier (Fin.cases order (Fin.cases hone (fun j => Fin.elim0 j))))))) - change Realize M.sets refinementClassEntryFormula env ↔ _ - rw [refinementClassEntryFormula, realize_ex] - constructor - · rintro ⟨z, hz, body⟩ - obtain ⟨q, hq, body⟩ := (realize_ex M.sets _ _).1 body - obtain ⟨v, hv, member, hqP, entry, pairName, forced⟩ := (realize_ex M.sets _ _).1 body - change z ∈ T at member - change q ∈ s.carrier at hqP - obtain ⟨p, rfl⟩ := (s.mem_carrier q).1 hqP - let σ : Name s := ⟨z, valid z member⟩ - have hpGround := M.transitive carrier (s.encode_mem p) - have all : ∀ j, (extend v (extend (s.encode p) (extend z env))) j ∈ M.sets := - Fin.cases hv (Fin.cases hpGround (Fin.cases hz members)) - have entryEq := (M.realize_orderedPairFormula pairing 3 2 1 _ hx hz hpGround).1 entry - change x = ZFSet.pair z (s.encode p) at entryEq - have pairEq := (M.realize_orderedPairNameCodeFormula pairing 0 2 6 9 _ all).1 pairName - have named : v = (Name.orderedPair ⊤ σ w).val := - pairEq.trans (Name.orderedPair_code ⊤ σ w).symm - have hpair : (Name.orderedPair ⊤ σ w).val ∈ M.sets := named ▸ hv - let names : Assignment (M.nameDomain s) 2 := - extend ⟨Name.orderedPair ⊤ σ w, hpair⟩ (extend ⟨R, hR⟩ Fin.elim0) - have atom := (M.realize_ordinaryGroundForcing s pairing unions powers separation collection - carrier order 0 1 (.mem 0 1) ![7, 8] 1 ![0, 5] _ rfl rfl p names rfl - (Fin.cases named (Fin.cases rfl (fun j => Fin.elim0 j)))).1 forced - rw [entryEq] - exact (Name.entry_refinementClass T valid R w σ p).2 ⟨member, atom⟩ - · intro member - obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.refinementClass T valid R w) member - obtain ⟨hσT, forced⟩ := (Name.entry_refinementClass T valid R w σ p).1 member - have hσ := M.transitive hT hσT - have hp := M.transitive carrier (s.encode_mem p) - have hpair : (Name.orderedPair ⊤ σ w).val ∈ M.sets := by - rw [Name.orderedPair_code] - exact M.orderedPairNameCode_mem pairing hone hσ hw - refine ⟨σ.val, hσ, ?_⟩ - rw [realize_ex] - refine ⟨s.encode p, hp, ?_⟩ - rw [realize_ex] - refine ⟨(Name.orderedPair ⊤ σ w).val, hpair, hσT, s.encode_mem p, ?_, ?_, ?_⟩ - · exact (M.realize_orderedPairFormula pairing 3 2 1 _ hx hσ hp).2 rfl - · exact (M.realize_orderedPairNameCodeFormula pairing 0 2 6 9 _ - (Fin.cases hpair (Fin.cases hp (Fin.cases hσ members)))).2 - (Name.orderedPair_code ⊤ σ w) - · let names : Assignment (M.nameDomain s) 2 := - extend ⟨Name.orderedPair ⊤ σ w, hpair⟩ (extend ⟨R, hR⟩ Fin.elim0) - exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection - carrier order 0 1 (.mem 0 1) ![7, 8] 1 ![0, 5] _ rfl rfl p names rfl - (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))).2 forced - -include pairing unions powers separation collection carrier order in -theorem refinementClass_eq_selection {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) : - (Name.refinementClass T valid R w).val = - ZFSet.sep (fun x => Realize M.sets refinementClassEntryFormula - (extend x (extend T (extend R.val (extend w.val - (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))))) - (ZFSet.prod T s.carrier) := by - have bound := M.prod_mem pairing unions powers separation hT carrier - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep] - constructor - · intro member - have hx := Name.refinementClass_subset T valid R w member - exact ⟨hx, (M.realize_refinementClassEntryFormula s pairing unions powers separation collection - carrier order hT valid R w hR hw x (M.transitive bound hx)).2 member⟩ - · rintro ⟨hx, formula⟩ - exact (M.realize_refinementClassEntryFormula s pairing unions powers separation collection - carrier order hT valid R w hR hw x (M.transitive bound hx)).1 formula - -include pairing unions powers separation collection carrier order in -theorem refinementClass_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) : - (Name.refinementClass T valid R w).val ∈ M.sets := by - rw [M.refinementClass_eq_selection s pairing unions powers separation collection carrier order - hT valid R w hR hw] - exact M.separation_mem separation refinementClassEntryFormula _ - (Fin.cases hT (Fin.cases hR (Fin.cases hw (Fin.cases carrier (Fin.cases order - (Fin.cases (M.transitive carrier (s.encode_mem ⊤)) (fun j => Fin.elim0 j))))))) - (M.prod_mem pairing unions powers separation hT carrier) - -include pairing carrier in -theorem eval_refinementClass {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - Name.eval {p | H.mem p} (Name.refinementClass T valid R w) = - equivalenceClass (Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (Name.eval {p | H.mem p} R) (Name.eval {p | H.mem p} w) := by - apply Name.eval_refinementClass (M.nameDomain s) H (fun E hE dense => generic E (Or.inl hE) dense) - T valid R w hR - intro z hz - change (Name.orderedPair ⊤ z w).val ∈ M.sets - rw [Name.orderedPair_code] - exact M.orderedPairNameCode_mem pairing (M.transitive carrier (s.encode_mem ⊤)) - (M.transitive hT hz) hw - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P Q : Type u} [PartialOrder P] [OrderTop P] -variable {s : Presentation P} (upper : Presentation Q) (incl : P → Q) (one : Q) - -noncomputable def refinementAssignmentLabel (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (Rf Rc : Name s) : Name upper := - assemble - (fun a : {a : (T × T) × Q // - ∃ row A, upper.encode a.2 = ZFSet.pair row A ∧ - stageOneAssignment idx a.1.1.val a.1.2.val ∈ A} => - orderedPair one - (rename upper incl (refinementClass T valid Rc - ⟨a.val.1.1.val, valid _ a.val.1.1.property⟩)) - (rename upper incl (refinementClass T valid Rf - ⟨a.val.1.2.val, valid _ a.val.1.2.property⟩))) - (fun a => a.val.2) - -theorem entry_refinementAssignmentLabel (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (Rf Rc : Name s) - (sigma : Name upper) (p : Q) : - Entry sigma (refinementAssignmentLabel upper incl one T valid idx Rf Rc) p ↔ - ∃ v w : Name s, v.val ∈ T ∧ w.val ∈ T ∧ - (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A) ∧ - orderedPair one (rename upper incl (refinementClass T valid Rc v)) - (rename upper incl (refinementClass T valid Rf w)) = sigma := by - rw [refinementAssignmentLabel, entry_assemble] - constructor - · rintro ⟨a, equal, condition⟩ - refine ⟨⟨a.val.1.1.val, valid _ a.val.1.1.property⟩, - ⟨a.val.1.2.val, valid _ a.val.1.2.property⟩, - a.val.1.1.property, a.val.1.2.property, ?_, equal⟩ - exact condition ▸ a.property - · rintro ⟨v, w, hv, hw, literal, equal⟩ - exact ⟨⟨((⟨v.val, hv⟩, ⟨w.val, hw⟩), p), literal⟩, equal, rfl⟩ - -theorem mem_eval_refinementAssignmentLabel (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (Rf Rc : Name s) - (H : Set Q) (hone : one ∈ H) (z : ZFSet.{u}) : - z ∈ eval H (refinementAssignmentLabel upper incl one T valid idx Rf Rc) ↔ - ∃ (p : Q) (v w : Name s), p ∈ H ∧ v.val ∈ T ∧ w.val ∈ T ∧ - (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A) ∧ - ZFSet.pair (eval {q | incl q ∈ H} (refinementClass T valid Rc v)) - (eval {q | incl q ∈ H} (refinementClass T valid Rf w)) = z := by - rw [mem_eval] - constructor - · rintro ⟨sigma, p, entry, hp, equal⟩ - obtain ⟨v, w, hv, hw, literal, rfl⟩ := - (entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc sigma p).1 entry - refine ⟨p, v, w, hp, hv, hw, literal, ?_⟩ - simpa only [eval_orderedPair H one hone, eval_rename] using equal - · rintro ⟨p, v, w, hp, hv, hw, literal, equal⟩ - refine ⟨_, p, (entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc _ p).2 - ⟨v, w, hv, hw, literal, rfl⟩, hp, ?_⟩ - simpa only [eval_orderedPair H one hone, eval_rename] using equal - -end PartitionPilot.Forcing.Name - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.EquivalenceClassCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization +import OAI.SetTheory.PartitionPrinciple.Transfinite.StageOneDataBoundLaws + +namespace OAI + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} + +noncomputable def refinementClass (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (R w : Name s) : Name s := + selectName (fun z p => ForcesMem p (orderedPair ⊤ z w) R) (familySet ⊤ T valid) + +theorem entry_refinementClass (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (R w z : Name s) (p : P) : + Entry z (refinementClass T valid R w) p ↔ + z.val ∈ T ∧ ForcesMem p (orderedPair ⊤ z w) R := by + rw [refinementClass, entry_selectName] + constructor + · rintro ⟨r, entry, _, forced⟩ + exact ⟨((entry_familySet ⊤ T valid z r).1 entry).1, forced⟩ + · rintro ⟨member, forced⟩ + exact ⟨⊤, (entry_familySet ⊤ T valid z ⊤).2 ⟨member, rfl⟩, le_top, forced⟩ + +theorem refinementClass_subset (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (R w : Name s) : (refinementClass T valid R w).val ⊆ ZFSet.prod T s.carrier := by + intro x member + obtain ⟨z, p, rfl⟩ := entries_cover (refinementClass T valid R w) member + exact ZFSet.pair_mem_prod.2 + ⟨((entry_refinementClass T valid R w z p).1 member).1, s.encode_mem p⟩ + +theorem eval_refinementClass (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (R w : Name s) + (hR : R ∈ D.names) + (pairs : ∀ z : Name s, z.val ∈ T → orderedPair ⊤ z w ∈ D.names) : + eval {p | H.mem p} (refinementClass T valid R w) = + equivalenceClass (eval {p | H.mem p} (familySet ⊤ T valid)) + (eval {p | H.mem p} R) (eval {p | H.mem p} w) := by + apply ZFSet.ext + intro x + rw [mem_eval, mem_equivalenceClass] + constructor + · rintro ⟨z, p, entry, hp, rfl⟩ + obtain ⟨member, forced⟩ := (entry_refinementClass T valid R w z p).1 entry + have related := forcesMem_sound D H generic (pairs z member) hR hp forced + rw [eval_orderedPair {p | H.mem p} ⊤ H.top_mem z w] at related + exact ⟨(mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid _).2 ⟨z, member, rfl⟩, related⟩ + · rintro ⟨member, related⟩ + obtain ⟨z, hz, rfl⟩ := (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).1 member + have named : eval {p | H.mem p} (orderedPair ⊤ z w) ∈ eval {p | H.mem p} R := by + rw [eval_orderedPair {p | H.mem p} ⊤ H.top_mem z w] + exact related + obtain ⟨p, hp, forced⟩ := (eval_mem_iff_forcesMem D H generic (pairs z hz) hR).1 named + exact ⟨z, p, (entry_refinementClass T valid R w z p).2 ⟨hz, forced⟩, hp, rfl⟩ + +variable {G : Type v} [Group G] (a : PosetAction G P) + +theorem act_refinementClass (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + (g : G) (R w : Name s) : + a.act s g (refinementClass T valid R w) = + refinementClass T valid (a.act s g R) (a.act s g w) := by + unfold refinementClass + rw [a.act_selectName s g _ (fun z p => ForcesMem p (orderedPair ⊤ z (a.act s g w)) (a.act s g R))] + · rw [act_familySet a T valid closed] + · intro z p + have paired : a.act s g (orderedPair ⊤ z w) = + orderedPair ⊤ (a.act s g z) (a.act s g w) := by + change rename s (a.iso g) _ = _ + rw [rename_orderedPair, (a.iso g).map_top] + rfl + rw [← paired] + exact a.forcesMem_act_iff s g p (orderedPair ⊤ z w) R + +theorem refinementClass_support (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + (R w : Name s) (K : Subgroup G) + (relation : K ≤ a.stabilizer s R) (representative : K ≤ a.stabilizer s w) : + K ≤ a.stabilizer s (refinementClass T valid R w) := by + intro g hg + change a.act s g _ = _ + rw [act_refinementClass a T valid closed, relation hg, representative hg] + +theorem refinementClass_hs (F : NormalSubgroupFamily G) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + (children : ∀ z : Name s, z.val ∈ T → HereditarilySymmetric a s F z) + (R w : Name s) (K : Subgroup G) (member : F.mem K) + (relation : K ≤ a.stabilizer s R) (representative : K ≤ a.stabilizer s w) : + HereditarilySymmetric a s F (refinementClass T valid R w) := + HereditarilySymmetric.mk + (F.upward member (refinementClass_support a T valid closed R w K relation representative)) + (fun z p entry => children z ((entry_refinementClass T valid R w z p).1 entry).1) + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace SetFormula + +def refinementClassEntryFormula : SetFormula 7 := + ex (ex (ex (.conj (.mem 2 4) (.conj (.mem 1 7) + (.conj (orderedPairFormula 3 2 1) + (.conj (orderedPairNameCodeFormula 0 2 6 9) + (forcingTranslation (ordinaryGroundPrimitives 0 1) (.mem 0 1) + ![7, 8] 1 ![0, 5]))))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection carrier order in +theorem realize_refinementClassEntryFormula {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) + (x : ZFSet.{u}) (hx : x ∈ M.sets) : + Realize M.sets refinementClassEntryFormula + (extend x (extend T (extend R.val (extend w.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0))))))) ↔ + x ∈ (Name.refinementClass T valid R w).val := by + let env := extend x (extend T (extend R.val (extend w.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))) + have hone := M.transitive carrier (s.encode_mem ⊤) + have members : ∀ j, env j ∈ M.sets := + Fin.cases hx (Fin.cases hT (Fin.cases hR (Fin.cases hw + (Fin.cases carrier (Fin.cases order (Fin.cases hone (fun j => Fin.elim0 j))))))) + change Realize M.sets refinementClassEntryFormula env ↔ _ + rw [refinementClassEntryFormula, realize_ex] + constructor + · rintro ⟨z, hz, body⟩ + obtain ⟨q, hq, body⟩ := (realize_ex M.sets _ _).1 body + obtain ⟨v, hv, member, hqP, entry, pairName, forced⟩ := (realize_ex M.sets _ _).1 body + change z ∈ T at member + change q ∈ s.carrier at hqP + obtain ⟨p, rfl⟩ := (s.mem_carrier q).1 hqP + let σ : Name s := ⟨z, valid z member⟩ + have hpGround := M.transitive carrier (s.encode_mem p) + have all : ∀ j, (extend v (extend (s.encode p) (extend z env))) j ∈ M.sets := + Fin.cases hv (Fin.cases hpGround (Fin.cases hz members)) + have entryEq := (M.realize_orderedPairFormula pairing 3 2 1 _ hx hz hpGround).1 entry + change x = ZFSet.pair z (s.encode p) at entryEq + have pairEq := (M.realize_orderedPairNameCodeFormula pairing 0 2 6 9 _ all).1 pairName + have named : v = (Name.orderedPair ⊤ σ w).val := + pairEq.trans (Name.orderedPair_code ⊤ σ w).symm + have hpair : (Name.orderedPair ⊤ σ w).val ∈ M.sets := named ▸ hv + let names : Assignment (M.nameDomain s) 2 := + extend ⟨Name.orderedPair ⊤ σ w, hpair⟩ (extend ⟨R, hR⟩ Fin.elim0) + have atom := (M.realize_ordinaryGroundForcing s pairing unions powers separation collection + carrier order 0 1 (.mem 0 1) ![7, 8] 1 ![0, 5] _ rfl rfl p names rfl + (Fin.cases named (Fin.cases rfl (fun j => Fin.elim0 j)))).1 forced + rw [entryEq] + exact (Name.entry_refinementClass T valid R w σ p).2 ⟨member, atom⟩ + · intro member + obtain ⟨σ, p, rfl⟩ := Name.entries_cover (Name.refinementClass T valid R w) member + obtain ⟨hσT, forced⟩ := (Name.entry_refinementClass T valid R w σ p).1 member + have hσ := M.transitive hT hσT + have hp := M.transitive carrier (s.encode_mem p) + have hpair : (Name.orderedPair ⊤ σ w).val ∈ M.sets := by + rw [Name.orderedPair_code] + exact M.orderedPairNameCode_mem pairing hone hσ hw + refine ⟨σ.val, hσ, ?_⟩ + rw [realize_ex] + refine ⟨s.encode p, hp, ?_⟩ + rw [realize_ex] + refine ⟨(Name.orderedPair ⊤ σ w).val, hpair, hσT, s.encode_mem p, ?_, ?_, ?_⟩ + · exact (M.realize_orderedPairFormula pairing 3 2 1 _ hx hσ hp).2 rfl + · exact (M.realize_orderedPairNameCodeFormula pairing 0 2 6 9 _ + (Fin.cases hpair (Fin.cases hp (Fin.cases hσ members)))).2 + (Name.orderedPair_code ⊤ σ w) + · let names : Assignment (M.nameDomain s) 2 := + extend ⟨Name.orderedPair ⊤ σ w, hpair⟩ (extend ⟨R, hR⟩ Fin.elim0) + exact (M.realize_ordinaryGroundForcing s pairing unions powers separation collection + carrier order 0 1 (.mem 0 1) ![7, 8] 1 ![0, 5] _ rfl rfl p names rfl + (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j)))).2 forced + +include pairing unions powers separation collection carrier order in +theorem refinementClass_eq_selection {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) : + (Name.refinementClass T valid R w).val = + ZFSet.sep (fun x => Realize M.sets refinementClassEntryFormula + (extend x (extend T (extend R.val (extend w.val + (extend s.carrier (extend s.conditionOrder (extend (s.encode ⊤) Fin.elim0)))))))) + (ZFSet.prod T s.carrier) := by + have bound := M.prod_mem pairing unions powers separation hT carrier + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep] + constructor + · intro member + have hx := Name.refinementClass_subset T valid R w member + exact ⟨hx, (M.realize_refinementClassEntryFormula s pairing unions powers separation collection + carrier order hT valid R w hR hw x (M.transitive bound hx)).2 member⟩ + · rintro ⟨hx, formula⟩ + exact (M.realize_refinementClassEntryFormula s pairing unions powers separation collection + carrier order hT valid R w hR hw x (M.transitive bound hx)).1 formula + +include pairing unions powers separation collection carrier order in +theorem refinementClass_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) : + (Name.refinementClass T valid R w).val ∈ M.sets := by + rw [M.refinementClass_eq_selection s pairing unions powers separation collection carrier order + hT valid R w hR hw] + exact M.separation_mem separation refinementClassEntryFormula _ + (Fin.cases hT (Fin.cases hR (Fin.cases hw (Fin.cases carrier (Fin.cases order + (Fin.cases (M.transitive carrier (s.encode_mem ⊤)) (fun j => Fin.elim0 j))))))) + (M.prod_mem pairing unions powers separation hT carrier) + +include pairing carrier in +theorem eval_refinementClass {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (R w : Name s) (hR : R.val ∈ M.sets) (hw : w.val ∈ M.sets) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + Name.eval {p | H.mem p} (Name.refinementClass T valid R w) = + equivalenceClass (Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (Name.eval {p | H.mem p} R) (Name.eval {p | H.mem p} w) := by + apply Name.eval_refinementClass (M.nameDomain s) H (fun E hE dense => generic E (Or.inl hE) dense) + T valid R w hR + intro z hz + change (Name.orderedPair ⊤ z w).val ∈ M.sets + rw [Name.orderedPair_code] + exact M.orderedPairNameCode_mem pairing (M.transitive carrier (s.encode_mem ⊤)) + (M.transitive hT hz) hw + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P Q : Type u} [PartialOrder P] [OrderTop P] +variable {s : Presentation P} (upper : Presentation Q) (incl : P → Q) (one : Q) + +noncomputable def refinementAssignmentLabel (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (Rf Rc : Name s) : Name upper := + assemble + (fun a : {a : (T × T) × Q // + ∃ row A, upper.encode a.2 = ZFSet.pair row A ∧ + stageOneAssignment idx a.1.1.val a.1.2.val ∈ A} => + orderedPair one + (rename upper incl (refinementClass T valid Rc + ⟨a.val.1.1.val, valid _ a.val.1.1.property⟩)) + (rename upper incl (refinementClass T valid Rf + ⟨a.val.1.2.val, valid _ a.val.1.2.property⟩))) + (fun a => a.val.2) + +theorem entry_refinementAssignmentLabel (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (Rf Rc : Name s) + (sigma : Name upper) (p : Q) : + Entry sigma (refinementAssignmentLabel upper incl one T valid idx Rf Rc) p ↔ + ∃ v w : Name s, v.val ∈ T ∧ w.val ∈ T ∧ + (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A) ∧ + orderedPair one (rename upper incl (refinementClass T valid Rc v)) + (rename upper incl (refinementClass T valid Rf w)) = sigma := by + rw [refinementAssignmentLabel, entry_assemble] + constructor + · rintro ⟨a, equal, condition⟩ + refine ⟨⟨a.val.1.1.val, valid _ a.val.1.1.property⟩, + ⟨a.val.1.2.val, valid _ a.val.1.2.property⟩, + a.val.1.1.property, a.val.1.2.property, ?_, equal⟩ + exact condition ▸ a.property + · rintro ⟨v, w, hv, hw, literal, equal⟩ + exact ⟨⟨((⟨v.val, hv⟩, ⟨w.val, hw⟩), p), literal⟩, equal, rfl⟩ + +theorem mem_eval_refinementAssignmentLabel (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (idx : ZFSet.{u}) (Rf Rc : Name s) + (H : Set Q) (hone : one ∈ H) (z : ZFSet.{u}) : + z ∈ eval H (refinementAssignmentLabel upper incl one T valid idx Rf Rc) ↔ + ∃ (p : Q) (v w : Name s), p ∈ H ∧ v.val ∈ T ∧ w.val ∈ T ∧ + (∃ row A, upper.encode p = ZFSet.pair row A ∧ stageOneAssignment idx v.val w.val ∈ A) ∧ + ZFSet.pair (eval {q | incl q ∈ H} (refinementClass T valid Rc v)) + (eval {q | incl q ∈ H} (refinementClass T valid Rf w)) = z := by + rw [mem_eval] + constructor + · rintro ⟨sigma, p, entry, hp, equal⟩ + obtain ⟨v, w, hv, hw, literal, rfl⟩ := + (entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc sigma p).1 entry + refine ⟨p, v, w, hp, hv, hw, literal, ?_⟩ + simpa only [eval_orderedPair H one hone, eval_rename] using equal + · rintro ⟨p, v, w, hp, hv, hw, literal, equal⟩ + refine ⟨_, p, (entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc _ p).2 + ⟨v, w, hv, hw, literal, rfl⟩, hp, ?_⟩ + simpa only [eval_orderedPair H one hone, eval_rename] using equal + +end PartitionPilot.Forcing.Name + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementCoarseImageNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementCoarseImageNames.lean index 94b651c22aefdb5c1b8ab1f00f61d2b39b2debda..123ffe4abf250050eec613c1b0c9cb25f9454061 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementCoarseImageNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementCoarseImageNames.lean @@ -1,140 +1,140 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.EquivalenceClassCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u v - -noncomputable def coarseClassImage (U sigma Rc : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ y ∈ sigma, y ∈ U ∧ ZFSet.pair z y ∈ Rc) U - -theorem mem_coarseClassImage (U sigma Rc z : ZFSet.{u}) : - z ∈ coarseClassImage U sigma Rc ↔ - z ∈ U ∧ ∃ y ∈ sigma, y ∈ U ∧ ZFSet.pair z y ∈ Rc := ZFSet.mem_sep - -theorem coarseClassImage_of_fineClass {U Rf Rc x : ZFSet.{u}} - (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) - (refinement : Rf ⊆ Rc) (hx : x ∈ U) : - coarseClassImage U (equivalenceClass U Rf x) Rc = equivalenceClass U Rc x := by - apply ZFSet.ext - intro z - rw [mem_coarseClassImage, mem_equivalenceClass] - constructor - · rintro ⟨hz, y, hy, _, related⟩ - exact ⟨hz, coarse.trans z y x related (refinement ((mem_equivalenceClass U Rf x y).1 hy).2)⟩ - · rintro ⟨hz, related⟩ - exact ⟨hz, x, fine.class_self hx, hx, related⟩ - -namespace BoundedFormula - -def coarseClassImageFormula : BoundedFormula 4 := - .conj (.mem 0 1) (exMem 2 (.conj (.mem 0 2) (pairMembershipFormula 1 0 4))) - -theorem truth_coarseClassImageFormula (env : Fin 4 → ZFSet.{u}) : - Truth coarseClassImageFormula env ↔ env 0 ∈ coarseClassImage (env 1) (env 2) (env 3) := by - rw [mem_coarseClassImage] - change (env 0 ∈ env 1 ∧ Truth (exMem 2 (.conj (.mem 0 2) (pairMembershipFormula 1 0 4))) env) ↔ _ - rw [truth_exMem] - exact and_congr_right (fun _ => exists_congr (fun y => and_congr_right (fun _ => - and_congr_right (fun _ => truth_pairMembershipFormula 1 0 4 (extend y env))))) - -end BoundedFormula - -namespace Name -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} - -noncomputable def refinementCoarseImage (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) : Name s := - separationName D BoundedFormula.coarseClassImageFormula.toFormula - (extend U (extend sigma (extend Rc Fin.elim0))) (familySet ⊤ T valid) - -theorem entry_refinementCoarseImage (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) (z : Name s) (p : P) : - Entry z (refinementCoarseImage D T valid U sigma Rc) p ↔ - z.val ∈ T ∧ ∃ h : z ∈ D.names, - Forces D BoundedFormula.coarseClassImageFormula.toFormula - (extend ⟨z, h⟩ (extend U (extend sigma (extend Rc Fin.elim0)))) p := by - rw [refinementCoarseImage, entry_separationName] - constructor - · rintro ⟨r, entry, _, forced⟩ - exact ⟨((entry_familySet ⊤ T valid z r).1 entry).1, forced⟩ - · rintro ⟨hz, forced⟩ - exact ⟨⊤, (entry_familySet ⊤ T valid z ⊤).2 ⟨hz, rfl⟩, le_top, forced⟩ - -theorem eval_refinementCoarseImage (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) : - eval {p | H.mem p} (refinementCoarseImage D T valid U sigma Rc) = - coarseClassImage (eval {p | H.mem p} U.val) (eval {p | H.mem p} sigma.val) - (eval {p | H.mem p} Rc.val) ∩ eval {p | H.mem p} (familySet ⊤ T valid) := by - rw [refinementCoarseImage, eval_separationName D H generic _ _ family] - let evaluated : TransitiveGround.{u} := ⟨D.values {p | H.mem p}, D.values_transitive _⟩ - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, ZFSet.mem_inter] - constructor - · rintro ⟨hx, formula⟩ - have members : ∀ j, extend x (evalAssignment {p | H.mem p} - (extend U (extend sigma (extend Rc Fin.elim0)))) j ∈ D.values {p | H.mem p} := - Fin.cases ((D.values_transitive _ (show eval {p | H.mem p} (familySet ⊤ T valid) ∈ D.values {p | H.mem p} from ⟨⟨_, family⟩, rfl⟩)) hx) - (fun j => ⟨(extend U (extend sigma (extend Rc Fin.elim0))) j, rfl⟩) - have truth := (BoundedFormula.realize_toFormula evaluated BoundedFormula.coarseClassImageFormula _ members).1 formula - exact ⟨(BoundedFormula.truth_coarseClassImageFormula _).1 truth, hx⟩ - · rintro ⟨member, hx⟩ - have members : ∀ j, extend x (evalAssignment {p | H.mem p} - (extend U (extend sigma (extend Rc Fin.elim0)))) j ∈ D.values {p | H.mem p} := - Fin.cases ((D.values_transitive _ (show eval {p | H.mem p} (familySet ⊤ T valid) ∈ D.values {p | H.mem p} from ⟨⟨_, family⟩, rfl⟩)) hx) - (fun j => ⟨(extend U (extend sigma (extend Rc Fin.elim0))) j, rfl⟩) - exact ⟨hx, (BoundedFormula.realize_toFormula evaluated BoundedFormula.coarseClassImageFormula _ members).2 - ((BoundedFormula.truth_coarseClassImageFormula (extend x (evalAssignment {p | H.mem p} - (extend U (extend sigma (extend Rc Fin.elim0)))))).2 member)⟩ - -theorem eval_refinementCoarseImage_of_subset (D : NameDomain s) (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) - (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily D)) - (subset : eval {p | H.mem p} U.val ⊆ eval {p | H.mem p} (familySet ⊤ T valid)) : - eval {p | H.mem p} (refinementCoarseImage D T valid U sigma Rc) = - coarseClassImage (eval {p | H.mem p} U.val) (eval {p | H.mem p} sigma.val) - (eval {p | H.mem p} Rc.val) := by - rw [eval_refinementCoarseImage D T valid U sigma Rc family H generic] - apply ZFSet.ext - intro x - exact ⟨fun h => (ZFSet.mem_inter.1 h).1, - fun h => ZFSet.mem_inter.2 ⟨h, subset ((mem_coarseClassImage _ _ _ _).1 h).1⟩⟩ - -variable {G : Type v} [Group G] (a : PosetAction G P) - -theorem refinementCoarseImage_support (D : NameDomain s) - (closed : ∀ g z, z ∈ D.names → a.act s g z ∈ D.names) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - (U sigma Rc : D.names) (K : Subgroup G) - (domain : K ≤ a.stabilizer s U.val) (witness : K ≤ a.stabilizer s sigma.val) - (relation : K ≤ a.stabilizer s Rc.val) : - K ≤ a.stabilizer s (refinementCoarseImage D T valid U sigma Rc) := by - intro g hg - change a.act s g (refinementCoarseImage D T valid U sigma Rc) = _ - unfold refinementCoarseImage - rw [a.act_separationName s D closed, act_familySet a T valid terms] - have env : a.actAssignment s D closed g (extend U (extend sigma (extend Rc Fin.elim0))) = - extend U (extend sigma (extend Rc Fin.elim0)) := by - funext j - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i))) j - · exact Subtype.ext (domain hg) - · exact Subtype.ext (witness hg) - · exact Subtype.ext (relation hg) - rw [env] - -end Name - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.EquivalenceClassCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u v + +noncomputable def coarseClassImage (U sigma Rc : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ y ∈ sigma, y ∈ U ∧ ZFSet.pair z y ∈ Rc) U + +theorem mem_coarseClassImage (U sigma Rc z : ZFSet.{u}) : + z ∈ coarseClassImage U sigma Rc ↔ + z ∈ U ∧ ∃ y ∈ sigma, y ∈ U ∧ ZFSet.pair z y ∈ Rc := ZFSet.mem_sep + +theorem coarseClassImage_of_fineClass {U Rf Rc x : ZFSet.{u}} + (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) + (refinement : Rf ⊆ Rc) (hx : x ∈ U) : + coarseClassImage U (equivalenceClass U Rf x) Rc = equivalenceClass U Rc x := by + apply ZFSet.ext + intro z + rw [mem_coarseClassImage, mem_equivalenceClass] + constructor + · rintro ⟨hz, y, hy, _, related⟩ + exact ⟨hz, coarse.trans z y x related (refinement ((mem_equivalenceClass U Rf x y).1 hy).2)⟩ + · rintro ⟨hz, related⟩ + exact ⟨hz, x, fine.class_self hx, hx, related⟩ + +namespace BoundedFormula + +def coarseClassImageFormula : BoundedFormula 4 := + .conj (.mem 0 1) (exMem 2 (.conj (.mem 0 2) (pairMembershipFormula 1 0 4))) + +theorem truth_coarseClassImageFormula (env : Fin 4 → ZFSet.{u}) : + Truth coarseClassImageFormula env ↔ env 0 ∈ coarseClassImage (env 1) (env 2) (env 3) := by + rw [mem_coarseClassImage] + change (env 0 ∈ env 1 ∧ Truth (exMem 2 (.conj (.mem 0 2) (pairMembershipFormula 1 0 4))) env) ↔ _ + rw [truth_exMem] + exact and_congr_right (fun _ => exists_congr (fun y => and_congr_right (fun _ => + and_congr_right (fun _ => truth_pairMembershipFormula 1 0 4 (extend y env))))) + +end BoundedFormula + +namespace Name +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} + +noncomputable def refinementCoarseImage (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) : Name s := + separationName D BoundedFormula.coarseClassImageFormula.toFormula + (extend U (extend sigma (extend Rc Fin.elim0))) (familySet ⊤ T valid) + +theorem entry_refinementCoarseImage (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) (z : Name s) (p : P) : + Entry z (refinementCoarseImage D T valid U sigma Rc) p ↔ + z.val ∈ T ∧ ∃ h : z ∈ D.names, + Forces D BoundedFormula.coarseClassImageFormula.toFormula + (extend ⟨z, h⟩ (extend U (extend sigma (extend Rc Fin.elim0)))) p := by + rw [refinementCoarseImage, entry_separationName] + constructor + · rintro ⟨r, entry, _, forced⟩ + exact ⟨((entry_familySet ⊤ T valid z r).1 entry).1, forced⟩ + · rintro ⟨hz, forced⟩ + exact ⟨⊤, (entry_familySet ⊤ T valid z ⊤).2 ⟨hz, rfl⟩, le_top, forced⟩ + +theorem eval_refinementCoarseImage (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) : + eval {p | H.mem p} (refinementCoarseImage D T valid U sigma Rc) = + coarseClassImage (eval {p | H.mem p} U.val) (eval {p | H.mem p} sigma.val) + (eval {p | H.mem p} Rc.val) ∩ eval {p | H.mem p} (familySet ⊤ T valid) := by + rw [refinementCoarseImage, eval_separationName D H generic _ _ family] + let evaluated : TransitiveGround.{u} := ⟨D.values {p | H.mem p}, D.values_transitive _⟩ + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, ZFSet.mem_inter] + constructor + · rintro ⟨hx, formula⟩ + have members : ∀ j, extend x (evalAssignment {p | H.mem p} + (extend U (extend sigma (extend Rc Fin.elim0)))) j ∈ D.values {p | H.mem p} := + Fin.cases ((D.values_transitive _ (show eval {p | H.mem p} (familySet ⊤ T valid) ∈ D.values {p | H.mem p} from ⟨⟨_, family⟩, rfl⟩)) hx) + (fun j => ⟨(extend U (extend sigma (extend Rc Fin.elim0))) j, rfl⟩) + have truth := (BoundedFormula.realize_toFormula evaluated BoundedFormula.coarseClassImageFormula _ members).1 formula + exact ⟨(BoundedFormula.truth_coarseClassImageFormula _).1 truth, hx⟩ + · rintro ⟨member, hx⟩ + have members : ∀ j, extend x (evalAssignment {p | H.mem p} + (extend U (extend sigma (extend Rc Fin.elim0)))) j ∈ D.values {p | H.mem p} := + Fin.cases ((D.values_transitive _ (show eval {p | H.mem p} (familySet ⊤ T valid) ∈ D.values {p | H.mem p} from ⟨⟨_, family⟩, rfl⟩)) hx) + (fun j => ⟨(extend U (extend sigma (extend Rc Fin.elim0))) j, rfl⟩) + exact ⟨hx, (BoundedFormula.realize_toFormula evaluated BoundedFormula.coarseClassImageFormula _ members).2 + ((BoundedFormula.truth_coarseClassImageFormula (extend x (evalAssignment {p | H.mem p} + (extend U (extend sigma (extend Rc Fin.elim0)))))).2 member)⟩ + +theorem eval_refinementCoarseImage_of_subset (D : NameDomain s) (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : D.names) + (family : familySet ⊤ T valid ∈ D.names) (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily D)) + (subset : eval {p | H.mem p} U.val ⊆ eval {p | H.mem p} (familySet ⊤ T valid)) : + eval {p | H.mem p} (refinementCoarseImage D T valid U sigma Rc) = + coarseClassImage (eval {p | H.mem p} U.val) (eval {p | H.mem p} sigma.val) + (eval {p | H.mem p} Rc.val) := by + rw [eval_refinementCoarseImage D T valid U sigma Rc family H generic] + apply ZFSet.ext + intro x + exact ⟨fun h => (ZFSet.mem_inter.1 h).1, + fun h => ZFSet.mem_inter.2 ⟨h, subset ((mem_coarseClassImage _ _ _ _).1 h).1⟩⟩ + +variable {G : Type v} [Group G] (a : PosetAction G P) + +theorem refinementCoarseImage_support (D : NameDomain s) + (closed : ∀ g z, z ∈ D.names → a.act s g z ∈ D.names) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + (U sigma Rc : D.names) (K : Subgroup G) + (domain : K ≤ a.stabilizer s U.val) (witness : K ≤ a.stabilizer s sigma.val) + (relation : K ≤ a.stabilizer s Rc.val) : + K ≤ a.stabilizer s (refinementCoarseImage D T valid U sigma Rc) := by + intro g hg + change a.act s g (refinementCoarseImage D T valid U sigma Rc) = _ + unfold refinementCoarseImage + rw [a.act_separationName s D closed, act_familySet a T valid terms] + have env : a.actAssignment s D closed g (extend U (extend sigma (extend Rc Fin.elim0))) = + extend U (extend sigma (extend Rc Fin.elim0)) := by + funext j + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i))) j + · exact Subtype.ext (domain hg) + · exact Subtype.ext (witness hg) + · exact Subtype.ext (relation hg) + rw [env] + +end Name + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementDataBoundActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementDataBoundActions.lean index 1e4405fc75a33477e364e495d5ee88b10cf18966..f97ce2b3918b6b360ffd6be5a33378018b829a11 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementDataBoundActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RefinementDataBoundActions.lean @@ -1,95 +1,95 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorFullActionGraph - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {L G : Type u} [PartialOrder L] [OrderBot L] [Group G] - -theorem RowPositionBound.action (a : PosetAction G L) (s : Presentation L) (g : G) - {mu f : ZFSet.{u}} {D : L} - (bound : RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D)) : - RowPositionBound mu s.nonbottom.carrier s.conditionOrder - (rowPositionSequenceAction a s g mu f) (s.encode (a.iso g D)) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨i, hi, _, _, x, hx, rfl, _, _⟩ := - (mem_relationCompose _ _ _ _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hi, hx⟩ - · intro i x entry - obtain ⟨_, _, y, hy, original, moved⟩ := - (pair_mem_relationCompose _ _ _ _ _ i x).1 entry - obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy - obtain ⟨v, hv⟩ := (s.nonbottom.mem_graph s.nonbottom (a.nonbottom.iso g) _).1 moved - obtain ⟨same, value⟩ := ZFSet.pair_inj.1 hv - have equal : v = y := s.nonbottom.injective same - have lower := (s.pair_mem_conditionOrder y.val D).1 (bound.2 i _ original) - have result := (s.pair_mem_conditionOrder (a.iso g y.val) (a.iso g D)).2 - ((a.iso g).monotone lower) - rw [equal] at value - exact value ▸ result - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {G P L : Type u} [Group G] [PartialOrder P] [PartialOrder L] [OrderBot L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - -theorem refinementDataBound_act - (I T S mu tuples A movedA level : ZFSet.{u}) (g : G) (C E D : L) - (U Rf Rc u w : Name s) - (tupleAction : ∀ f ∈ S, ∀ tau : Name s, ZFSet.pair f tau.val ∈ tuples → - rowPositionSequenceAction d b g mu f ∈ S ∧ - ZFSet.pair (rowPositionSequenceAction d b g mu f) (a.act s g tau).val ∈ tuples) - (bound : ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val Rf.val Rc.val) u.val w.val) - (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu b.nonbottom.carrier b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples) - (movedMember : stageOneAssignment - (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val) - (a.act s g u).val (a.act s g w).val ∈ movedA) - (movedIndex : refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val ∈ I) - (movedU : (a.act s g u).val ∈ T) (movedW : (a.act s g w).val ∈ T) : - ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val) - (a.act s g u).val (a.act s g w).val) (b.encode (d.iso g D)) ∈ - stageOneDataBounds movedA I T S b.carrier mu b.nonbottom.carrier b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples := by - obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, anchor, lower, - tupleU, tupleW, boundU, boundW⟩ := - (stageOneDataBounds_assignment_entry A I T S b.carrier mu b.nonbottom.carrier - b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples _ u.val w.val (b.encode D)).1 bound - have same : rawE = b.encode E := - ((refinementIndexFieldGraph_entry I b.carrier - ![level, b.encode C, b.encode E, U.val, Rf.val, Rc.val] 2 rawE).1 anchor).2.2 - subst rawE - obtain ⟨hfuMoved, tupleUMoved⟩ := tupleAction fu hfu u tupleU - obtain ⟨hfwMoved, tupleWMoved⟩ := tupleAction fw hfw w tupleW - refine (stageOneDataBounds_assignment_entry movedA I T S b.carrier mu b.nonbottom.carrier - b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples _ _ _ _).2 - ⟨movedMember, b.encode_mem _, movedIndex, movedU, movedW, - b.encode (d.iso g E), b.encode_mem _, rowPositionSequenceAction d b g mu fu, hfuMoved, - rowPositionSequenceAction d b g mu fw, hfwMoved, ?_, ?_, - tupleUMoved, tupleWMoved, boundU.action d b g, boundW.action d b g⟩ - · exact (refinementIndexFieldGraph_entry I b.carrier - ![level, b.encode (d.iso g C), b.encode (d.iso g E), - (a.act s g U).val, (a.act s g Rf).val, (a.act s g Rc).val] 2 _).2 - ⟨movedIndex, b.encode_mem _, rfl⟩ - · exact (b.pair_mem_conditionOrder (d.iso g E) (d.iso g D)).2 - ((d.iso g).monotone ((b.pair_mem_conditionOrder E D).1 lower)) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorFullActionGraph + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {L G : Type u} [PartialOrder L] [OrderBot L] [Group G] + +theorem RowPositionBound.action (a : PosetAction G L) (s : Presentation L) (g : G) + {mu f : ZFSet.{u}} {D : L} + (bound : RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D)) : + RowPositionBound mu s.nonbottom.carrier s.conditionOrder + (rowPositionSequenceAction a s g mu f) (s.encode (a.iso g D)) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨i, hi, _, _, x, hx, rfl, _, _⟩ := + (mem_relationCompose _ _ _ _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hi, hx⟩ + · intro i x entry + obtain ⟨_, _, y, hy, original, moved⟩ := + (pair_mem_relationCompose _ _ _ _ _ i x).1 entry + obtain ⟨y, rfl⟩ := (s.nonbottom.mem_carrier y).1 hy + obtain ⟨v, hv⟩ := (s.nonbottom.mem_graph s.nonbottom (a.nonbottom.iso g) _).1 moved + obtain ⟨same, value⟩ := ZFSet.pair_inj.1 hv + have equal : v = y := s.nonbottom.injective same + have lower := (s.pair_mem_conditionOrder y.val D).1 (bound.2 i _ original) + have result := (s.pair_mem_conditionOrder (a.iso g y.val) (a.iso g D)).2 + ((a.iso g).monotone lower) + rw [equal] at value + exact value ▸ result + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {G P L : Type u} [Group G] [PartialOrder P] [PartialOrder L] [OrderBot L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + +theorem refinementDataBound_act + (I T S mu tuples A movedA level : ZFSet.{u}) (g : G) (C E D : L) + (U Rf Rc u w : Name s) + (tupleAction : ∀ f ∈ S, ∀ tau : Name s, ZFSet.pair f tau.val ∈ tuples → + rowPositionSequenceAction d b g mu f ∈ S ∧ + ZFSet.pair (rowPositionSequenceAction d b g mu f) (a.act s g tau).val ∈ tuples) + (bound : ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val Rf.val Rc.val) u.val w.val) + (b.encode D) ∈ stageOneDataBounds A I T S b.carrier mu b.nonbottom.carrier b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples) + (movedMember : stageOneAssignment + (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val) + (a.act s g u).val (a.act s g w).val ∈ movedA) + (movedIndex : refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val ∈ I) + (movedU : (a.act s g u).val ∈ T) (movedW : (a.act s g w).val ∈ T) : + ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U).val (a.act s g Rf).val (a.act s g Rc).val) + (a.act s g u).val (a.act s g w).val) (b.encode (d.iso g D)) ∈ + stageOneDataBounds movedA I T S b.carrier mu b.nonbottom.carrier b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples := by + obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, anchor, lower, + tupleU, tupleW, boundU, boundW⟩ := + (stageOneDataBounds_assignment_entry A I T S b.carrier mu b.nonbottom.carrier + b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples _ u.val w.val (b.encode D)).1 bound + have same : rawE = b.encode E := + ((refinementIndexFieldGraph_entry I b.carrier + ![level, b.encode C, b.encode E, U.val, Rf.val, Rc.val] 2 rawE).1 anchor).2.2 + subst rawE + obtain ⟨hfuMoved, tupleUMoved⟩ := tupleAction fu hfu u tupleU + obtain ⟨hfwMoved, tupleWMoved⟩ := tupleAction fw hfw w tupleW + refine (stageOneDataBounds_assignment_entry movedA I T S b.carrier mu b.nonbottom.carrier + b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples _ _ _ _).2 + ⟨movedMember, b.encode_mem _, movedIndex, movedU, movedW, + b.encode (d.iso g E), b.encode_mem _, rowPositionSequenceAction d b g mu fu, hfuMoved, + rowPositionSequenceAction d b g mu fw, hfwMoved, ?_, ?_, + tupleUMoved, tupleWMoved, boundU.action d b g, boundW.action d b g⟩ + · exact (refinementIndexFieldGraph_entry I b.carrier + ![level, b.encode (d.iso g C), b.encode (d.iso g E), + (a.act s g U).val, (a.act s g Rf).val, (a.act s g Rc).val] 2 _).2 + ⟨movedIndex, b.encode_mem _, rfl⟩ + · exact (b.pair_mem_conditionOrder (d.iso g E) (d.iso g D)).2 + ((d.iso g).monotone ((b.pair_mem_conditionOrder E D).1 lower)) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RelationActionFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RelationActionFamilies.lean index 81d907466c43474808d19dfd6cb4f57cd561cb6a..0d7c8a3243cdb1036df0a38af9c07b6ca7d03599 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RelationActionFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RelationActionFamilies.lean @@ -1,157 +1,157 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -structure RelationActionLaws (G : Type u) [Group G] (X : ZFSet.{u}) - (graph : G → ZFSet.{u}) : Prop where - function : ∀ g, ZFSet.IsFunc X X (graph g) - injection : ∀ g, InjectionCode X X (graph g) - one : ∀ x ∈ X, ∀ y, ZFSet.pair x y ∈ graph 1 ↔ y = x - mul : ∀ g h, ∀ x ∈ X, ∀ z, ZFSet.pair x z ∈ graph (g * h) ↔ - ∃ y ∈ X, ZFSet.pair x y ∈ graph h ∧ ZFSet.pair y z ∈ graph g - -namespace RelationActionLaws -variable {G : Type u} [Group G] {X Y : ZFSet.{u}} {f h : G → ZFSet.{u}} - -theorem union (first : RelationActionLaws G X f) (second : RelationActionLaws G Y h) - (apart : ∀ z, z ∈ X → z ∈ Y → False) : - RelationActionLaws G (X ∪ Y) (fun g => f g ∪ h g) := by - refine ⟨fun g => disjointFunction_union (first.function g) (second.function g) apart, - fun g => disjointInjection_union (first.injection g) (second.injection g) apart, ?_, ?_⟩ - · intro x hx y - rcases ZFSet.mem_union.1 hx with left | right - · rw [ZFSet.mem_union, first.one x left y] - exact ⟨fun entry => entry.elim id (fun other => False.elim - (apart x left (ZFSet.pair_mem_prod.1 ((second.function 1).1 other)).1)), Or.inl⟩ - · rw [ZFSet.mem_union, second.one x right y] - exact ⟨fun entry => entry.elim (fun other => False.elim - (apart x (ZFSet.pair_mem_prod.1 ((first.function 1).1 other)).1 right)) id, Or.inr⟩ - · intro g k x hx z - constructor - · intro member - rcases ZFSet.mem_union.1 member with left | right - · have source := (ZFSet.pair_mem_prod.1 ((first.function (g * k)).1 left)).1 - obtain ⟨y, hy, ek, eg⟩ := (first.mul g k x source z).1 left - exact ⟨y, ZFSet.mem_union.2 (Or.inl hy), ZFSet.mem_union.2 (Or.inl ek), - ZFSet.mem_union.2 (Or.inl eg)⟩ - · have source := (ZFSet.pair_mem_prod.1 ((second.function (g * k)).1 right)).1 - obtain ⟨y, hy, ek, eg⟩ := (second.mul g k x source z).1 right - exact ⟨y, ZFSet.mem_union.2 (Or.inr hy), ZFSet.mem_union.2 (Or.inr ek), - ZFSet.mem_union.2 (Or.inr eg)⟩ - · rintro ⟨y, _, ek, eg⟩ - rcases ZFSet.mem_union.1 ek with left | right - · have fields := ZFSet.pair_mem_prod.1 ((first.function k).1 left) - rcases ZFSet.mem_union.1 eg with same | other - · exact ZFSet.mem_union.2 (Or.inl ((first.mul g k x fields.1 z).2 - ⟨y, fields.2, left, same⟩)) - · exact False.elim (apart y fields.2 (ZFSet.pair_mem_prod.1 ((second.function g).1 other)).1) - · have fields := ZFSet.pair_mem_prod.1 ((second.function k).1 right) - rcases ZFSet.mem_union.1 eg with other | same - · exact False.elim (apart y (ZFSet.pair_mem_prod.1 ((first.function g).1 other)).1 fields.2) - · exact ZFSet.mem_union.2 (Or.inr ((second.mul g k x fields.1 z).2 - ⟨y, fields.2, right, same⟩)) - -theorem image_one (laws : RelationActionLaws G X f) {A : ZFSet.{u}} (subset : A ⊆ X) : - relationImage A X (f 1) = A := by - apply ZFSet.ext - intro y - constructor - · intro member - obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A X (f 1) y).1 member - exact (laws.one x (subset hx) y).1 entry ▸ hx - · intro member - exact (mem_relationImage A X (f 1) y).2 - ⟨subset member, y, member, (laws.one y (subset member) y).2 rfl⟩ - -theorem image_mul (laws : RelationActionLaws G X f) (g k : G) - {A : ZFSet.{u}} (subset : A ⊆ X) : - relationImage A X (f (g * k)) = relationImage (relationImage A X (f k)) X (f g) := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨hz, x, hx, entry⟩ := (mem_relationImage A X (f (g * k)) z).1 member - obtain ⟨y, hy, ek, eg⟩ := (laws.mul g k x (subset hx) z).1 entry - exact (mem_relationImage _ X (f g) z).2 - ⟨hz, y, (mem_relationImage A X (f k) y).2 ⟨hy, x, hx, ek⟩, eg⟩ - · intro member - obtain ⟨hz, y, hy, eg⟩ := (mem_relationImage _ X (f g) z).1 member - obtain ⟨hy, x, hx, ek⟩ := (mem_relationImage A X (f k) y).1 hy - exact (mem_relationImage A X (f (g * k)) z).2 - ⟨hz, x, hx, (laws.mul g k x (subset hx) z).2 ⟨y, hy, ek, eg⟩⟩ - -end RelationActionLaws -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.RelationActionLaws -universe u v -variable {G : Type u} [Group G] {ι : Type v} - -theorem of_disjoint_family (X : ι → ZFSet.{u}) (branch : ι → G → ZFSet.{u}) - (Y : ZFSet.{u}) (whole : G → ZFSet.{u}) - (cover : ∀ x, x ∈ Y ↔ ∃ i, x ∈ X i) - (entries : ∀ g z, z ∈ whole g ↔ ∃ i, z ∈ branch i g) - (apart : ∀ i j x, x ∈ X i → x ∈ X j → i = j) - (laws : ∀ i, RelationActionLaws G (X i) (branch i)) : - RelationActionLaws G Y whole := by - have bounds (g : G) : whole g ⊆ ZFSet.prod Y Y := by - intro z hz - obtain ⟨i, hi⟩ := (entries g z).1 hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (((laws i).function g).1 hi) - exact ZFSet.pair_mem_prod.2 ⟨(cover x).2 ⟨i, hx⟩, (cover y).2 ⟨i, hy⟩⟩ - have functions (g : G) : ZFSet.IsFunc Y Y (whole g) := by - refine ⟨bounds g, ?_⟩ - intro x hx - obtain ⟨i, hi⟩ := (cover x).1 hx - obtain ⟨y, edge, unique⟩ := ((laws i).function g).2 x hi - refine ⟨y, (entries g _).2 ⟨i, edge⟩, ?_⟩ - intro z hz - obtain ⟨j, other⟩ := (entries g _).1 hz - have same := apart i j x hi (ZFSet.pair_mem_prod.1 (((laws j).function g).1 other)).1 - subst j - exact unique z other - refine ⟨functions, ?_, ?_, ?_⟩ - · intro g - refine ⟨functions g, ?_⟩ - intro x y z hx hy - obtain ⟨i, ei⟩ := (entries g _).1 hx - obtain ⟨j, ej⟩ := (entries g _).1 hy - have same := apart i j z (ZFSet.pair_mem_prod.1 (((laws i).function g).1 ei)).2 - (ZFSet.pair_mem_prod.1 (((laws j).function g).1 ej)).2 - subst j - exact ((laws i).injection g).injective x y z ei ej - · intro x hx y - constructor - · intro edge - obtain ⟨i, hi⟩ := (entries 1 _).1 edge - exact ((laws i).one x (ZFSet.pair_mem_prod.1 (((laws i).function 1).1 hi)).1 y).1 hi - · intro equal - obtain ⟨i, hi⟩ := (cover x).1 hx - exact (entries 1 _).2 ⟨i, ((laws i).one x hi y).2 equal⟩ - · intro g h x _ z - constructor - · intro edge - obtain ⟨i, hi⟩ := (entries (g * h) _).1 edge - have source := (ZFSet.pair_mem_prod.1 (((laws i).function (g * h)).1 hi)).1 - obtain ⟨y, hy, eh, eg⟩ := ((laws i).mul g h x source z).1 hi - exact ⟨y, (cover y).2 ⟨i, hy⟩, (entries h _).2 ⟨i, eh⟩, (entries g _).2 ⟨i, eg⟩⟩ - · rintro ⟨y, _, eh, eg⟩ - obtain ⟨i, ei⟩ := (entries h _).1 eh - obtain ⟨j, ej⟩ := (entries g _).1 eg - have fields := ZFSet.pair_mem_prod.1 (((laws i).function h).1 ei) - have same := apart i j y fields.2 (ZFSet.pair_mem_prod.1 (((laws j).function g).1 ej)).1 - subst j - exact (entries (g * h) _).2 ⟨i, ((laws i).mul g h x fields.1 z).2 ⟨y, fields.2, ei, ej⟩⟩ - -end PartitionPilot.Forcing.RelationActionLaws - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +structure RelationActionLaws (G : Type u) [Group G] (X : ZFSet.{u}) + (graph : G → ZFSet.{u}) : Prop where + function : ∀ g, ZFSet.IsFunc X X (graph g) + injection : ∀ g, InjectionCode X X (graph g) + one : ∀ x ∈ X, ∀ y, ZFSet.pair x y ∈ graph 1 ↔ y = x + mul : ∀ g h, ∀ x ∈ X, ∀ z, ZFSet.pair x z ∈ graph (g * h) ↔ + ∃ y ∈ X, ZFSet.pair x y ∈ graph h ∧ ZFSet.pair y z ∈ graph g + +namespace RelationActionLaws +variable {G : Type u} [Group G] {X Y : ZFSet.{u}} {f h : G → ZFSet.{u}} + +theorem union (first : RelationActionLaws G X f) (second : RelationActionLaws G Y h) + (apart : ∀ z, z ∈ X → z ∈ Y → False) : + RelationActionLaws G (X ∪ Y) (fun g => f g ∪ h g) := by + refine ⟨fun g => disjointFunction_union (first.function g) (second.function g) apart, + fun g => disjointInjection_union (first.injection g) (second.injection g) apart, ?_, ?_⟩ + · intro x hx y + rcases ZFSet.mem_union.1 hx with left | right + · rw [ZFSet.mem_union, first.one x left y] + exact ⟨fun entry => entry.elim id (fun other => False.elim + (apart x left (ZFSet.pair_mem_prod.1 ((second.function 1).1 other)).1)), Or.inl⟩ + · rw [ZFSet.mem_union, second.one x right y] + exact ⟨fun entry => entry.elim (fun other => False.elim + (apart x (ZFSet.pair_mem_prod.1 ((first.function 1).1 other)).1 right)) id, Or.inr⟩ + · intro g k x hx z + constructor + · intro member + rcases ZFSet.mem_union.1 member with left | right + · have source := (ZFSet.pair_mem_prod.1 ((first.function (g * k)).1 left)).1 + obtain ⟨y, hy, ek, eg⟩ := (first.mul g k x source z).1 left + exact ⟨y, ZFSet.mem_union.2 (Or.inl hy), ZFSet.mem_union.2 (Or.inl ek), + ZFSet.mem_union.2 (Or.inl eg)⟩ + · have source := (ZFSet.pair_mem_prod.1 ((second.function (g * k)).1 right)).1 + obtain ⟨y, hy, ek, eg⟩ := (second.mul g k x source z).1 right + exact ⟨y, ZFSet.mem_union.2 (Or.inr hy), ZFSet.mem_union.2 (Or.inr ek), + ZFSet.mem_union.2 (Or.inr eg)⟩ + · rintro ⟨y, _, ek, eg⟩ + rcases ZFSet.mem_union.1 ek with left | right + · have fields := ZFSet.pair_mem_prod.1 ((first.function k).1 left) + rcases ZFSet.mem_union.1 eg with same | other + · exact ZFSet.mem_union.2 (Or.inl ((first.mul g k x fields.1 z).2 + ⟨y, fields.2, left, same⟩)) + · exact False.elim (apart y fields.2 (ZFSet.pair_mem_prod.1 ((second.function g).1 other)).1) + · have fields := ZFSet.pair_mem_prod.1 ((second.function k).1 right) + rcases ZFSet.mem_union.1 eg with other | same + · exact False.elim (apart y (ZFSet.pair_mem_prod.1 ((first.function g).1 other)).1 fields.2) + · exact ZFSet.mem_union.2 (Or.inr ((second.mul g k x fields.1 z).2 + ⟨y, fields.2, right, same⟩)) + +theorem image_one (laws : RelationActionLaws G X f) {A : ZFSet.{u}} (subset : A ⊆ X) : + relationImage A X (f 1) = A := by + apply ZFSet.ext + intro y + constructor + · intro member + obtain ⟨_, x, hx, entry⟩ := (mem_relationImage A X (f 1) y).1 member + exact (laws.one x (subset hx) y).1 entry ▸ hx + · intro member + exact (mem_relationImage A X (f 1) y).2 + ⟨subset member, y, member, (laws.one y (subset member) y).2 rfl⟩ + +theorem image_mul (laws : RelationActionLaws G X f) (g k : G) + {A : ZFSet.{u}} (subset : A ⊆ X) : + relationImage A X (f (g * k)) = relationImage (relationImage A X (f k)) X (f g) := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨hz, x, hx, entry⟩ := (mem_relationImage A X (f (g * k)) z).1 member + obtain ⟨y, hy, ek, eg⟩ := (laws.mul g k x (subset hx) z).1 entry + exact (mem_relationImage _ X (f g) z).2 + ⟨hz, y, (mem_relationImage A X (f k) y).2 ⟨hy, x, hx, ek⟩, eg⟩ + · intro member + obtain ⟨hz, y, hy, eg⟩ := (mem_relationImage _ X (f g) z).1 member + obtain ⟨hy, x, hx, ek⟩ := (mem_relationImage A X (f k) y).1 hy + exact (mem_relationImage A X (f (g * k)) z).2 + ⟨hz, x, hx, (laws.mul g k x (subset hx) z).2 ⟨y, hy, ek, eg⟩⟩ + +end RelationActionLaws +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.RelationActionLaws +universe u v +variable {G : Type u} [Group G] {ι : Type v} + +theorem of_disjoint_family (X : ι → ZFSet.{u}) (branch : ι → G → ZFSet.{u}) + (Y : ZFSet.{u}) (whole : G → ZFSet.{u}) + (cover : ∀ x, x ∈ Y ↔ ∃ i, x ∈ X i) + (entries : ∀ g z, z ∈ whole g ↔ ∃ i, z ∈ branch i g) + (apart : ∀ i j x, x ∈ X i → x ∈ X j → i = j) + (laws : ∀ i, RelationActionLaws G (X i) (branch i)) : + RelationActionLaws G Y whole := by + have bounds (g : G) : whole g ⊆ ZFSet.prod Y Y := by + intro z hz + obtain ⟨i, hi⟩ := (entries g z).1 hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (((laws i).function g).1 hi) + exact ZFSet.pair_mem_prod.2 ⟨(cover x).2 ⟨i, hx⟩, (cover y).2 ⟨i, hy⟩⟩ + have functions (g : G) : ZFSet.IsFunc Y Y (whole g) := by + refine ⟨bounds g, ?_⟩ + intro x hx + obtain ⟨i, hi⟩ := (cover x).1 hx + obtain ⟨y, edge, unique⟩ := ((laws i).function g).2 x hi + refine ⟨y, (entries g _).2 ⟨i, edge⟩, ?_⟩ + intro z hz + obtain ⟨j, other⟩ := (entries g _).1 hz + have same := apart i j x hi (ZFSet.pair_mem_prod.1 (((laws j).function g).1 other)).1 + subst j + exact unique z other + refine ⟨functions, ?_, ?_, ?_⟩ + · intro g + refine ⟨functions g, ?_⟩ + intro x y z hx hy + obtain ⟨i, ei⟩ := (entries g _).1 hx + obtain ⟨j, ej⟩ := (entries g _).1 hy + have same := apart i j z (ZFSet.pair_mem_prod.1 (((laws i).function g).1 ei)).2 + (ZFSet.pair_mem_prod.1 (((laws j).function g).1 ej)).2 + subst j + exact ((laws i).injection g).injective x y z ei ej + · intro x hx y + constructor + · intro edge + obtain ⟨i, hi⟩ := (entries 1 _).1 edge + exact ((laws i).one x (ZFSet.pair_mem_prod.1 (((laws i).function 1).1 hi)).1 y).1 hi + · intro equal + obtain ⟨i, hi⟩ := (cover x).1 hx + exact (entries 1 _).2 ⟨i, ((laws i).one x hi y).2 equal⟩ + · intro g h x _ z + constructor + · intro edge + obtain ⟨i, hi⟩ := (entries (g * h) _).1 edge + have source := (ZFSet.pair_mem_prod.1 (((laws i).function (g * h)).1 hi)).1 + obtain ⟨y, hy, eh, eg⟩ := ((laws i).mul g h x source z).1 hi + exact ⟨y, (cover y).2 ⟨i, hy⟩, (entries h _).2 ⟨i, eh⟩, (entries g _).2 ⟨i, eg⟩⟩ + · rintro ⟨y, _, eh, eg⟩ + obtain ⟨i, ei⟩ := (entries h _).1 eh + obtain ⟨j, ej⟩ := (entries g _).1 eg + have fields := ZFSet.pair_mem_prod.1 (((laws i).function h).1 ei) + have same := apart i j y fields.2 (ZFSet.pair_mem_prod.1 (((laws j).function g).1 ej)).1 + subst j + exact (entries (g * h) _).2 ⟨i, ((laws i).mul g h x fields.1 z).2 ⟨y, fields.2, ei, ej⟩⟩ + +end PartitionPilot.Forcing.RelationActionLaws + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RenamedPairNameFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RenamedPairNameFamilies.lean index e188c24c4c56c0b2cd00bedbfbd33ba167342d5f..cc81c19e5d8082e5300abdffb6b4bbf14b5967b4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RenamedPairNameFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RenamedPairNameFamilies.lean @@ -1,590 +1,590 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionAtomicTruth -import OAI.SetTheory.PartitionPrinciple.Forcing.PairFamilyEvaluation - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P Q : Type u} - -theorem exists_uniformRename_between (s : Presentation P) (t : Presentation Q) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) - (f : P → Q) (hf : s.graph t f ∈ M.sets) : - ∃ G ∈ M.sets, - G = s.graph t f ∪ identityFunctionGraph - (ZFSet.sep (fun x => x ∉ s.carrier) (s.carrier ∪ t.carrier)) ∧ - ∀ (σ : Name s) (τ : Name t), σ.val ∈ M.sets → τ.val ∈ M.sets → - (Realize M.sets uniformRenameFormula - (extend σ.val (extend τ.val (extend (s.carrier ∪ t.carrier) (extend G Fin.elim0)))) ↔ - Name.rename t f σ = τ) := by - let U := s.carrier ∪ t.carrier - let D := ZFSet.sep (fun x => x ∉ s.carrier) U - let F := s.graph t f - let G := F ∪ identityFunctionGraph D - have subS : s.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inl hx) - have subT : t.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inr hx) - have hU : U ∈ M.sets := M.binary_union_mem pairing unions hs ht - have hD : D ∈ M.sets := M.bounded_separation_mem separation (.neg (.mem 0 1)) - (extend s.carrier Fin.elim0) (Fin.cases hs (fun i => Fin.elim0 i)) hU - have hG : G ∈ M.sets := M.binary_union_mem pairing unions hf - (M.identityFunctionGraph_mem pairing unions powers separation hD) - have ff := s.graph_isFunc t f - have full : ZFSet.IsFunc U U G := by - constructor - · intro z hz - rcases ZFSet.mem_union.1 hz with old | identity - · obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (ff.1 old) - exact ZFSet.mem_prod.2 ⟨x, subS hx, y, subT hy, eq⟩ - · obtain ⟨x, hx, rfl⟩ := (mem_identityFunctionGraph D z).1 identity - exact ZFSet.pair_mem_prod.2 ⟨(ZFSet.mem_sep.1 hx).1, (ZFSet.mem_sep.1 hx).1⟩ - · intro x hx - by_cases source : x ∈ s.carrier - · obtain ⟨y, entry, unique⟩ := ff.2 x source - refine ⟨y, ZFSet.mem_union.2 (Or.inl entry), ?_⟩ - intro z hz - rcases ZFSet.mem_union.1 hz with old | identity - · exact unique z old - · exact False.elim ((ZFSet.mem_sep.1 - ((pair_mem_identityFunctionGraph D x z).1 identity).2).2 source) - · refine ⟨x, ZFSet.mem_union.2 (Or.inr - ((pair_mem_identityFunctionGraph D x x).2 ⟨rfl, ZFSet.mem_sep.2 ⟨hx, source⟩⟩)), ?_⟩ - intro z hz - rcases ZFSet.mem_union.1 hz with old | identity - · exact False.elim (source (ZFSet.pair_mem_prod.1 (ff.1 old)).1) - · exact ((pair_mem_identityFunctionGraph D x z).1 identity).1.symm - let u := SetMembers.presentation U - let es := s.intoSet U subS - let et := t.intoSet U subT - let h := u.decodeFunction u G full - have commute (p : P) : h (es p) = et (f p) := by - apply (u.decodeFunction_iff u G full (es p) (et (f p))).2 - rw [s.encode_intoSet U subS, t.encode_intoSet U subT] - exact ZFSet.mem_union.2 (Or.inl ((s.pair_mem_graph t f p (f p)).2 rfl)) - refine ⟨G, hG, rfl, ?_⟩ - intro σ τ hσ hτ - have sourceCode := Name.rename_val_of_encode u es (s.encode_intoSet U subS) σ - have targetCode := Name.rename_val_of_encode u et (t.encode_intoSet U subT) τ - have graph : u.graph u h = G := u.graph_decodeFunction u G full - have exactFormula := M.realize_uniformRenameFormula u pairing unions powers separation collection hU h - (graph ▸ hG) (Name.rename u es σ) (Name.rename u et τ) - (sourceCode ▸ hσ) (targetCode ▸ hτ) - change Realize M.sets uniformRenameFormula - (extend (Name.rename u es σ).val (extend (Name.rename u et τ).val - (extend U (extend (u.graph u h) Fin.elim0)))) ↔ _ at exactFormula - rw [sourceCode, targetCode, graph] at exactFormula - refine exactFormula.trans ?_ - have equation : Name.rename u h (Name.rename u es σ) = - Name.rename u et (Name.rename t f σ) := by - rw [Name.rename_comp, Name.rename_comp] - apply congrArg (fun k => Name.rename u k σ) - funext p - exact commute p - rw [equation] - constructor - · intro equal - apply Subtype.ext - have codes := congrArg Subtype.val equal - simpa only [Name.rename_val_of_encode u et (t.encode_intoSet U subT)] using codes - · intro equal - exact congrArg (Name.rename u et) equal - -end PartitionPilot.Forcing.TransitiveGround - -section - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P Q : Type u} {s : Presentation P} - -noncomputable def renameFamilyGraph (t : Presentation Q) (f : P → Q) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : ZFSet.{u} := - familyCodeGraph (fun x : T => x.val) - (fun x => (rename t f ⟨x.val, valid x.val x.property⟩).val) - -noncomputable def renamedFamily (t : Presentation Q) (f : P → Q) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : ZFSet.{u} := - functionGraphRange T (renameFamilyGraph t f T valid) - -theorem mem_renameFamilyGraph (t : Presentation Q) (f : P → Q) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) (z : ZFSet.{u}) : - z ∈ renameFamilyGraph t f T valid ↔ - ∃ σ : Name s, σ.val ∈ T ∧ z = ZFSet.pair σ.val (rename t f σ).val := by - rw [renameFamilyGraph, mem_familyCodeGraph] - constructor - · rintro ⟨x, rfl⟩ - exact ⟨⟨x.val, valid x.val x.property⟩, x.property, rfl⟩ - · rintro ⟨σ, hσ, rfl⟩ - exact ⟨⟨σ.val, hσ⟩, rfl⟩ - -theorem pair_mem_renameFamilyGraph (t : Presentation Q) (f : P → Q) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) (σ : Name s) (y : ZFSet.{u}) : - ZFSet.pair σ.val y ∈ renameFamilyGraph t f T valid ↔ - σ.val ∈ T ∧ y = (rename t f σ).val := by - rw [mem_renameFamilyGraph] - constructor - · rintro ⟨τ, hτ, eq⟩ - obtain ⟨keys, values⟩ := ZFSet.pair_inj.1 eq - have same : σ = τ := Subtype.ext keys - exact ⟨same.symm ▸ hτ, by simpa only [same] using values⟩ - · rintro ⟨hσ, rfl⟩ - exact ⟨σ, hσ, rfl⟩ - -theorem renameFamilyGraph_function (t : Presentation Q) (f : P → Q) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : - ZFSet.IsFunc T (renamedFamily t f T valid) (renameFamilyGraph t f T valid) := by - apply functionGraphRange_function - have keys : ZFSet.range (fun x : T => x.val) = T := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_range] - exact ⟨fun ⟨y, eq⟩ => eq ▸ y.property, fun hx => ⟨⟨x, hx⟩, rfl⟩⟩ - simpa only [keys, renameFamilyGraph] using familyCodeGraph_function (fun x : T => x.val) - (fun x => (rename t f ⟨x.val, valid x.val x.property⟩).val) Subtype.val_injective - -theorem mem_renamedFamily (t : Presentation Q) (f : P → Q) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) (y : ZFSet.{u}) : - y ∈ renamedFamily t f T valid ↔ ∃ σ : Name s, σ.val ∈ T ∧ y = (rename t f σ).val := by - rw [renamedFamily, mem_functionGraphRange] - constructor - · rintro ⟨x, hx, entry⟩ - let σ : Name s := ⟨x, valid x hx⟩ - exact ⟨σ, hx, ((pair_mem_renameFamilyGraph t f T valid σ y).1 entry).2⟩ - · rintro ⟨σ, hσ, equal⟩ - exact ⟨σ.val, hσ, (pair_mem_renameFamilyGraph t f T valid σ y).2 ⟨hσ, equal⟩⟩ - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing.SetFormula - -def renamedNameFamilyPairFormula : SetFormula 5 := - .ex (.conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 0) - (.conj (binaryApplication uniformRenameFormula (extend 4 (extend 5 Fin.elim0)) 1 0) - (orderedPairFormula 2 1 0))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P Q : Type u} (s : Presentation P) (t : Presentation Q) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem renameFamilyGraph_mem (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) - (f : P → Q) (hf : s.graph t f ∈ M.sets) - (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ x ∈ T, IsName s x) : - Name.renameFamilyGraph t f T valid ∈ M.sets := by - obtain ⟨G, hG, _, recognizes⟩ := M.exists_uniformRename_between s t - pairing unions powers separation collection hs ht f hf - let U := s.carrier ∪ t.carrier - let params := extend t.carrier (extend U (extend G Fin.elim0)) - have hU : U ∈ M.sets := M.binary_union_mem pairing unions hs ht - have meaning (σ : Name s) (hσ : σ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets renamedNameFamilyPairFormula (extend σ.val (extend z params)) ↔ - z = ZFSet.pair σ.val (Name.rename t f σ).val := by - rw [renamedNameFamilyPairFormula, realize_ex] - constructor - · rintro ⟨v, hv, named, renamed, pair⟩ - rw [realize_domainApplication, map_extend, map_empty] at named - have validV : IsName t v := - (M.realize_uniformNameFormula t pairing unions powers separation collection ht v hv).1 named - rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed - have eq := (recognizes σ ⟨v, validV⟩ hσ hv).1 renamed - have pairEq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hv).1 pair - exact (congrArg Subtype.val eq).symm ▸ pairEq - · intro equal - have hv := M.rename_between_mem s t pairing unions powers separation collection hs ht f hf σ hσ - refine ⟨(Name.rename t f σ).val, hv, ?_, ?_, ?_⟩ - · rw [realize_domainApplication, map_extend, map_empty] - exact (M.realize_uniformNameFormula t pairing unions powers separation collection ht _ hv).2 - (Name.rename t f σ).property - · rw [realize_binaryApplication, map_extend, map_extend, map_empty] - exact (recognizes σ (Name.rename t f σ) hσ hv).2 rfl - · exact (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hv).2 equal - apply M.definable_image_mem separation collection renamedNameFamilyPairFormula params - (Fin.cases ht (Fin.cases hU (Fin.cases hG (fun i => Fin.elim0 i)))) hT - · intro z hz - obtain ⟨σ, hσ, rfl⟩ := (Name.mem_renameFamilyGraph t f T valid z).1 hz - exact M.orderedPair_mem pairing (M.transitive hT hσ) - (M.rename_between_mem s t pairing unions powers separation collection hs ht f hf σ (M.transitive hT hσ)) - · intro z hz - rw [Name.mem_renameFamilyGraph] - constructor - · rintro ⟨σ, hσ, eq⟩ - exact ⟨σ.val, hσ, (meaning σ (M.transitive hT hσ) z hz).2 eq⟩ - · rintro ⟨x, hx, rel⟩ - exact ⟨⟨x, valid x hx⟩, hx, (meaning ⟨x, valid x hx⟩ (M.transitive hT hx) z hz).1 rel⟩ - · intro x hx y hy z hz first second - exact ((meaning ⟨x, valid x hx⟩ (M.transitive hT hx) y hy).1 first).trans - ((meaning ⟨x, valid x hx⟩ (M.transitive hT hx) z hz).1 second).symm - -theorem renamedFamily_mem (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) - (f : P → Q) (hf : s.graph t f ∈ M.sets) - (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ x ∈ T, IsName s x) : - Name.renamedFamily t f T valid ∈ M.sets := - M.functionGraphRange_mem unions separation hT - (M.renameFamilyGraph_mem s t pairing unions powers separation collection hs ht f hf T hT valid) - -end PartitionPilot.Forcing.TransitiveGround - -end - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace SetFormula - -def termActionEntryFormula : SetFormula 5 := - .ex (.ex (.conj (.mem 1 4) (.conj (.mem 0 4) - (.conj (orderedPairFormula 2 1 0) (reindex ![3, 1, 0, 5, 6] nameActionFormula))))) - -def termActionSetFormula : SetFormula 5 := - exactSetFormula 0 (reindex (extend 0 (fun j : Fin 4 => j.succ.succ)) termActionEntryFormula) - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (hT : T ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -include pairing unions powers separation collection carrier group maps hT closed - -theorem realize_termActionEntryFormula (g : G) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets termActionEntryFormula ![z, t.encode g, T, s.carrier, a.conditionMapFamily s t] ↔ - z ∈ Name.renameFamilyGraph s (a.iso g) T valid := by - let env : Fin 5 → ZFSet.{u} := ![z, t.encode g, T, s.carrier, a.conditionMapFamily s t] - have args (x y : ZFSet.{u}) : - (fun j : Fin 5 => (extend y (extend x env)) (![3, 1, 0, 5, 6] j)) = - ![t.encode g, x, y, s.carrier, a.conditionMapFamily s t] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun k => Fin.elim0 k))))) j - change Realize M.sets termActionEntryFormula env ↔ _ - simp only [termActionEntryFormula, realize_ex] - constructor - · rintro ⟨x, hxm, y, hym, hx, hy, paired, acted⟩ - let w : Name s := ⟨x, valid x hx⟩ - let v : Name s := ⟨y, valid y hy⟩ - have equal := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hxm hym).1 paired - change z = ZFSet.pair x y at equal - rw [realize_reindex, args] at acted - have action := (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g w v hxm hym).1 acted - exact equal.symm ▸ (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w y).2 - ⟨hx, congrArg Subtype.val action.symm⟩ - · intro entry - obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T valid z).1 entry - have hwm := M.transitive hT hw - have actedT := closed g w hw - have actedGround := M.transitive hT actedT - refine ⟨w.val, hwm, (a.act s g w).val, actedGround, hw, actedT, - (M.realize_orderedPairFormula pairing 2 1 0 _ hz hwm actedGround).2 rfl, ?_⟩ - rw [realize_reindex, args] - exact (M.realize_nameActionFormula a s t pairing unions powers separation collection - carrier group maps g w (a.act s g w) hwm actedGround).2 rfl - -theorem realize_termActionSetFormula (g : G) (F : ZFSet.{u}) (hF : F ∈ M.sets) : - Realize M.sets termActionSetFormula ![F, t.encode g, T, s.carrier, a.conditionMapFamily s t] ↔ - F = Name.renameFamilyGraph s (a.iso g) T valid := by - have graph := M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier - (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid - apply M.realize_exactSetFormula 0 _ _ hF (fun _ h => M.transitive graph h) - intro z hz - rw [realize_reindex, map_extend] - exact M.realize_termActionEntryFormula a s t T valid pairing unions powers separation collection - carrier group maps hT closed g z hz - -end TransitiveGround -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.PosetAction -open SetRealization -universe u -variable {G P Q L : Type u} [Group G] [PartialOrder P] [PartialOrder Q] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (e : PosetAction G Q) (t : Presentation Q) -variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid' : ∀ z ∈ T, IsName t z) -variable (graphs : ∀ g, Name.renameFamilyGraph t (e.iso g) T valid' = - Name.renameFamilyGraph s (a.iso g) T valid) -include graphs - -theorem support_of_term_graphs (u : Name s) (v : Name t) (member : u.val ∈ T) - (same : v.val = u.val) {K : Subgroup G} (supported : K ≤ a.stabilizer s u) : - K ≤ e.stabilizer t v := by - intro g hg - have fixed : a.act s g u = u := supported hg - have entry : ZFSet.pair u.val u.val ∈ Name.renameFamilyGraph s (a.iso g) T valid := - (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u u.val).2 - ⟨member, (congrArg Subtype.val fixed).symm⟩ - rw [← graphs g] at entry - have target : ZFSet.pair v.val v.val ∈ Name.renameFamilyGraph t (e.iso g) T valid' := by - simpa only [same] using entry - have value := ((Name.pair_mem_renameFamilyGraph t (e.iso g) T valid' v v.val).1 target).2 - exact Subtype.ext value.symm - -theorem positionSupport_of_term_graphs (b : Presentation L) (d : PosetAction G L) - (S mu X tuples : ZFSet.{u}) (D : L) - (range : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ T) - (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) : - ∀ f ∈ S, ∀ v : Name t, ZFSet.pair f v.val ∈ tuples → - RowPositionBound mu X b.conditionOrder f (b.encode D) → - d.principalFix D ≤ e.stabilizer t v := by - intro f hf v entry bound - have member := range f v.val entry - let u : Name s := ⟨v.val, valid v.val member⟩ - exact a.support_of_term_graphs s e t T valid valid' graphs u v member rfl - (support f hf u entry bound) - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P Q : Type u} {s : Presentation P} - -theorem renamedFamily_valid (t : Presentation Q) (f : P → Q) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : - ∀ y ∈ renamedFamily t f T valid, IsName t y := by - intro y hy - obtain ⟨σ, _, rfl⟩ := (mem_renamedFamily t f T valid y).1 hy - exact (rename t f σ).property - -theorem presentationFamily_injection (t : Presentation P) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : - InjectionCode T (renamedFamily t id T valid) (renameFamilyGraph t id T valid) := by - refine ⟨renameFamilyGraph_function t id T valid, ?_⟩ - intro x y z first second - obtain ⟨σ, _, shapeσ⟩ := (mem_renameFamilyGraph t id T valid (ZFSet.pair x z)).1 first - obtain ⟨τ, _, shapeτ⟩ := (mem_renameFamilyGraph t id T valid (ZFSet.pair y z)).1 second - obtain ⟨rfl, eqσ⟩ := ZFSet.pair_inj.1 shapeσ - obtain ⟨rfl, eqτ⟩ := ZFSet.pair_inj.1 shapeτ - have images : presentationEquiv s t σ = presentationEquiv s t τ := - Subtype.ext (eqσ.symm.trans eqτ) - exact congrArg Subtype.val ((presentationEquiv s t).injective images) - -theorem rename_familySet (t : Presentation Q) (f : P → Q) (one : P) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : - rename t f (familySet one T valid) = - familySet (f one) (renamedFamily t f T valid) (renamedFamily_valid t f T valid) := by - apply Name.ext - intro τ q - rw [entry_rename, entry_familySet] - constructor - · rintro ⟨σ, p, entry, rfl, rfl⟩ - obtain ⟨hσ, rfl⟩ := (entry_familySet one T valid σ p).1 entry - exact ⟨(mem_renamedFamily t f T valid _).2 ⟨σ, hσ, rfl⟩, rfl⟩ - · rintro ⟨hτ, rfl⟩ - obtain ⟨σ, hσ, equal⟩ := (mem_renamedFamily t f T valid τ.val).1 hτ - exact ⟨σ, one, (entry_familySet one T valid σ one).2 ⟨hσ, rfl⟩, - Subtype.ext equal.symm, rfl⟩ - -theorem eval_renamedFamily (t : Presentation P) (T : ZFSet.{u}) - (valid : ∀ x ∈ T, IsName s x) (H : Set P) (x : ZFSet.{u}) : - (∃ τ : Name t, τ.val ∈ renamedFamily t id T valid ∧ eval H τ = x) ↔ - ∃ σ : Name s, σ.val ∈ T ∧ eval H σ = x := by - constructor - · rintro ⟨τ, hτ, equal⟩ - obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ - have names : τ = presentationEquiv s t σ := Subtype.ext codes - exact ⟨σ, hσ, by rw [names, eval_presentationEquiv] at equal; exact equal⟩ - · rintro ⟨σ, hσ, equal⟩ - exact ⟨presentationEquiv s t σ, (mem_renamedFamily t id T valid _).2 ⟨σ, hσ, rfl⟩, - (eval_presentationEquiv s t H σ).trans equal⟩ - -variable {G : Type v} [Group G] [PartialOrder P] - -theorem renamedFamily_closed (a : PosetAction G P) (t : Presentation P) - (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) - (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) : - ∀ g (τ : Name t), τ.val ∈ renamedFamily t id T valid → - (a.act t g τ).val ∈ renamedFamily t id T valid := by - intro g τ hτ - obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ - have names : τ = presentationEquiv s t σ := Subtype.ext codes - rw [names, a.act_presentationEquiv] - exact (mem_renamedFamily t id T valid _).2 ⟨a.act s g σ, closed g σ hσ, rfl⟩ - -theorem renamedFamily_hs (a : PosetAction G P) (t : Presentation P) - (F : NormalSubgroupFamily G) (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) - (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : - ∀ τ : Name t, τ.val ∈ renamedFamily t id T valid → HereditarilySymmetric a t F τ := by - intro τ hτ - obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ - have names : τ = presentationEquiv s t σ := Subtype.ext codes - exact names.symm ▸ (children σ hσ).presentationEquiv t - -end PartitionPilot.Forcing.Name - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace SetFormula - -def termActionFamilyEntryFormula : SetFormula 5 := - .ex (.ex (.conj (.mem 1 3) (.conj (orderedPairFormula 2 1 0) - (reindex ![0, 1, 4, 5, 6] termActionSetFormula)))) - -end SetFormula -namespace PosetAction -variable {G P : Type u} [Group G] [PartialOrder P] - -noncomputable def termActionFamily (a : PosetAction G P) (s : Presentation P) - (t : Presentation G) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : ZFSet.{u} := - familyCodeGraph t.encode (fun g => Name.renameFamilyGraph s (a.iso g) T valid) - -theorem pair_mem_termActionFamily (a : PosetAction G P) (s : Presentation P) - (t : Presentation G) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (g : G) (F : ZFSet.{u}) : - ZFSet.pair (t.encode g) F ∈ a.termActionFamily s t T valid ↔ - F = Name.renameFamilyGraph s (a.iso g) T valid := - pair_mem_familyCodeGraph _ _ t.injective g F - -theorem termActionFamily_function (a : PosetAction G P) (s : Presentation P) - (t : Presentation G) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : - FunctionGraphOn t.carrier (a.termActionFamily s t T valid) := by - have equal : ZFSet.range t.encode = t.carrier := by - apply ZFSet.ext - intro x - exact ZFSet.mem_range.trans (t.mem_carrier x).symm - simpa only [equal, termActionFamily] using familyCodeGraph_function t.encode - (fun g => Name.renameFamilyGraph s (a.iso g) T valid) t.injective - -end PosetAction -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) (hT : T ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -include pairing unions powers separation collection carrier group maps hT closed - -theorem termActionFamily_mem : a.termActionFamily s t T valid ∈ M.sets := by - let values := fun g => Name.renameFamilyGraph s (a.iso g) T valid - have graphGround (g : G) := M.renameFamilyGraph_mem s s pairing unions powers separation collection - carrier carrier (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid - have graphBound (g : G) : values g ∈ M.groundRelations T T := by - refine (M.mem_groundRelations T T _).2 ⟨graphGround g, ?_⟩ - intro z hz - obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T valid z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hw, closed g w hw⟩ - let params : Fin 4 → ZFSet.{u} := ![t.carrier, T, s.carrier, a.conditionMapFamily s t] - have paramsGround : ∀ j, params j ∈ M.sets := Fin.cases group (Fin.cases hT - (Fin.cases carrier (Fin.cases maps (fun j => Fin.elim0 j)))) - have args (z raw F : ZFSet.{u}) : - (fun j : Fin 5 => (extend F (extend raw (extend z params))) (![0, 1, 4, 5, 6] j)) = - ![F, raw, T, s.carrier, a.conditionMapFamily s t] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun k => Fin.elim0 k))))) j - have meaning (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets termActionFamilyEntryFormula (extend z params) ↔ - z ∈ a.termActionFamily s t T valid := by - simp only [termActionFamilyEntryFormula, realize_ex] - constructor - · rintro ⟨raw, hr, F, hF, actor, paired, coded⟩ - obtain ⟨g, rfl⟩ := (t.mem_carrier raw).1 actor - have pairEq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hr hF).1 paired - change z = ZFSet.pair (t.encode g) F at pairEq - rw [realize_reindex, args] at coded - have equal := (M.realize_termActionSetFormula a s t T valid pairing unions powers separation - collection carrier group maps hT closed g F hF).1 coded - exact (mem_familyCodeGraph _ _ z).2 ⟨g, by simpa only [equal] using pairEq.symm⟩ - · intro member - obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 member - have hg := M.transitive group (t.encode_mem g) - refine ⟨t.encode g, hg, values g, graphGround g, t.encode_mem g, - (M.realize_orderedPairFormula pairing 2 1 0 _ hz hg (graphGround g)).2 rfl, ?_⟩ - rw [realize_reindex, args] - exact (M.realize_termActionSetFormula a s t T valid pairing unions powers separation - collection carrier group maps hT closed g (values g) (graphGround g)).2 rfl - let B := ZFSet.prod t.carrier (M.groundRelations T T) - have hB := M.prod_mem pairing unions powers separation group - (M.groundRelations_mem pairing unions powers separation hT hT) - have subset : a.termActionFamily s t T valid ⊆ B := by - intro z hz - obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨t.encode_mem g, graphBound g⟩ - have equal : ZFSet.sep (fun z => Realize M.sets termActionFamilyEntryFormula - (extend z params)) B = a.termActionFamily s t T valid := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - exact ⟨fun h => (meaning z (M.transitive hB h.1)).1 h.2, - fun h => ⟨subset h, (meaning z (M.transitive hB (subset h))).2 h⟩⟩ - exact equal ▸ M.separation_mem separation termActionFamilyEntryFormula params paramsGround hB - -end TransitiveGround -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.Name -open SetRealization -universe u -variable {P Q : Type u} {s : Presentation P} - -theorem renamedFamily_orderedPairNameFamily (t : Presentation Q) (f : P → Q) (one : P) - (X Y : ZFSet.{u}) (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) : - renamedFamily t f (orderedPairNameFamily (s.encode one) X Y) - (orderedPairNameFamily_valid one validX validY) = - orderedPairNameFamily (t.encode (f one)) - (renamedFamily t f X validX) (renamedFamily t f Y validY) := by - apply ZFSet.ext - intro z - rw [mem_renamedFamily, mem_orderedPairNameFamily] - constructor - · rintro ⟨σ, hσ, equal⟩ - obtain ⟨x, hx, y, hy, codes⟩ := (mem_orderedPairNameFamily _ X Y σ.val).1 hσ - let ρ : Name s := ⟨x, validX x hx⟩ - let ν : Name s := ⟨y, validY y hy⟩ - have same : σ = orderedPair one ρ ν := - Subtype.ext (codes.trans (orderedPair_code one ρ ν).symm) - refine ⟨(rename t f ρ).val, (mem_renamedFamily t f X validX _).2 ⟨ρ, hx, rfl⟩, - (rename t f ν).val, (mem_renamedFamily t f Y validY _).2 ⟨ν, hy, rfl⟩, ?_⟩ - rw [same, rename_orderedPair, orderedPair_code] at equal - exact equal - · rintro ⟨x, hx, y, hy, equal⟩ - obtain ⟨ρ, hρ, rfl⟩ := (mem_renamedFamily t f X validX x).1 hx - obtain ⟨ν, hν, rfl⟩ := (mem_renamedFamily t f Y validY y).1 hy - refine ⟨orderedPair one ρ ν, - (mem_orderedPairNameFamily _ X Y _).2 ⟨ρ.val, hρ, ν.val, hν, orderedPair_code one ρ ν⟩, ?_⟩ - rw [rename_orderedPair, orderedPair_code] - exact equal - -theorem renamedFamily_iteratedPairNameFamily (t : Presentation Q) (f : P → Q) (one : P) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (n : Nat) : - renamedFamily t f (iteratedPairNameFamily (s.encode one) T n) - (iteratedPairNameFamily_valid one valid n) = - iteratedPairNameFamily (t.encode (f one)) (renamedFamily t f T valid) n := by - induction n with - | zero => rfl - | succ n ih => - change renamedFamily t f (orderedPairNameFamily (s.encode one) - (iteratedPairNameFamily (s.encode one) T n) T) - (orderedPairNameFamily_valid one (iteratedPairNameFamily_valid one valid n) valid) = _ - rw [renamedFamily_orderedPairNameFamily t f one _ _ - (iteratedPairNameFamily_valid one valid n) valid, ih] - rfl - -end PartitionPilot.Forcing.Name - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionAtomicTruth +import OAI.SetTheory.PartitionPrinciple.Forcing.PairFamilyEvaluation + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P Q : Type u} + +theorem exists_uniformRename_between (s : Presentation P) (t : Presentation Q) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) + (f : P → Q) (hf : s.graph t f ∈ M.sets) : + ∃ G ∈ M.sets, + G = s.graph t f ∪ identityFunctionGraph + (ZFSet.sep (fun x => x ∉ s.carrier) (s.carrier ∪ t.carrier)) ∧ + ∀ (σ : Name s) (τ : Name t), σ.val ∈ M.sets → τ.val ∈ M.sets → + (Realize M.sets uniformRenameFormula + (extend σ.val (extend τ.val (extend (s.carrier ∪ t.carrier) (extend G Fin.elim0)))) ↔ + Name.rename t f σ = τ) := by + let U := s.carrier ∪ t.carrier + let D := ZFSet.sep (fun x => x ∉ s.carrier) U + let F := s.graph t f + let G := F ∪ identityFunctionGraph D + have subS : s.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inl hx) + have subT : t.carrier ⊆ U := fun _ hx => ZFSet.mem_union.2 (Or.inr hx) + have hU : U ∈ M.sets := M.binary_union_mem pairing unions hs ht + have hD : D ∈ M.sets := M.bounded_separation_mem separation (.neg (.mem 0 1)) + (extend s.carrier Fin.elim0) (Fin.cases hs (fun i => Fin.elim0 i)) hU + have hG : G ∈ M.sets := M.binary_union_mem pairing unions hf + (M.identityFunctionGraph_mem pairing unions powers separation hD) + have ff := s.graph_isFunc t f + have full : ZFSet.IsFunc U U G := by + constructor + · intro z hz + rcases ZFSet.mem_union.1 hz with old | identity + · obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (ff.1 old) + exact ZFSet.mem_prod.2 ⟨x, subS hx, y, subT hy, eq⟩ + · obtain ⟨x, hx, rfl⟩ := (mem_identityFunctionGraph D z).1 identity + exact ZFSet.pair_mem_prod.2 ⟨(ZFSet.mem_sep.1 hx).1, (ZFSet.mem_sep.1 hx).1⟩ + · intro x hx + by_cases source : x ∈ s.carrier + · obtain ⟨y, entry, unique⟩ := ff.2 x source + refine ⟨y, ZFSet.mem_union.2 (Or.inl entry), ?_⟩ + intro z hz + rcases ZFSet.mem_union.1 hz with old | identity + · exact unique z old + · exact False.elim ((ZFSet.mem_sep.1 + ((pair_mem_identityFunctionGraph D x z).1 identity).2).2 source) + · refine ⟨x, ZFSet.mem_union.2 (Or.inr + ((pair_mem_identityFunctionGraph D x x).2 ⟨rfl, ZFSet.mem_sep.2 ⟨hx, source⟩⟩)), ?_⟩ + intro z hz + rcases ZFSet.mem_union.1 hz with old | identity + · exact False.elim (source (ZFSet.pair_mem_prod.1 (ff.1 old)).1) + · exact ((pair_mem_identityFunctionGraph D x z).1 identity).1.symm + let u := SetMembers.presentation U + let es := s.intoSet U subS + let et := t.intoSet U subT + let h := u.decodeFunction u G full + have commute (p : P) : h (es p) = et (f p) := by + apply (u.decodeFunction_iff u G full (es p) (et (f p))).2 + rw [s.encode_intoSet U subS, t.encode_intoSet U subT] + exact ZFSet.mem_union.2 (Or.inl ((s.pair_mem_graph t f p (f p)).2 rfl)) + refine ⟨G, hG, rfl, ?_⟩ + intro σ τ hσ hτ + have sourceCode := Name.rename_val_of_encode u es (s.encode_intoSet U subS) σ + have targetCode := Name.rename_val_of_encode u et (t.encode_intoSet U subT) τ + have graph : u.graph u h = G := u.graph_decodeFunction u G full + have exactFormula := M.realize_uniformRenameFormula u pairing unions powers separation collection hU h + (graph ▸ hG) (Name.rename u es σ) (Name.rename u et τ) + (sourceCode ▸ hσ) (targetCode ▸ hτ) + change Realize M.sets uniformRenameFormula + (extend (Name.rename u es σ).val (extend (Name.rename u et τ).val + (extend U (extend (u.graph u h) Fin.elim0)))) ↔ _ at exactFormula + rw [sourceCode, targetCode, graph] at exactFormula + refine exactFormula.trans ?_ + have equation : Name.rename u h (Name.rename u es σ) = + Name.rename u et (Name.rename t f σ) := by + rw [Name.rename_comp, Name.rename_comp] + apply congrArg (fun k => Name.rename u k σ) + funext p + exact commute p + rw [equation] + constructor + · intro equal + apply Subtype.ext + have codes := congrArg Subtype.val equal + simpa only [Name.rename_val_of_encode u et (t.encode_intoSet U subT)] using codes + · intro equal + exact congrArg (Name.rename u et) equal + +end PartitionPilot.Forcing.TransitiveGround + +section + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P Q : Type u} {s : Presentation P} + +noncomputable def renameFamilyGraph (t : Presentation Q) (f : P → Q) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : ZFSet.{u} := + familyCodeGraph (fun x : T => x.val) + (fun x => (rename t f ⟨x.val, valid x.val x.property⟩).val) + +noncomputable def renamedFamily (t : Presentation Q) (f : P → Q) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : ZFSet.{u} := + functionGraphRange T (renameFamilyGraph t f T valid) + +theorem mem_renameFamilyGraph (t : Presentation Q) (f : P → Q) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) (z : ZFSet.{u}) : + z ∈ renameFamilyGraph t f T valid ↔ + ∃ σ : Name s, σ.val ∈ T ∧ z = ZFSet.pair σ.val (rename t f σ).val := by + rw [renameFamilyGraph, mem_familyCodeGraph] + constructor + · rintro ⟨x, rfl⟩ + exact ⟨⟨x.val, valid x.val x.property⟩, x.property, rfl⟩ + · rintro ⟨σ, hσ, rfl⟩ + exact ⟨⟨σ.val, hσ⟩, rfl⟩ + +theorem pair_mem_renameFamilyGraph (t : Presentation Q) (f : P → Q) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) (σ : Name s) (y : ZFSet.{u}) : + ZFSet.pair σ.val y ∈ renameFamilyGraph t f T valid ↔ + σ.val ∈ T ∧ y = (rename t f σ).val := by + rw [mem_renameFamilyGraph] + constructor + · rintro ⟨τ, hτ, eq⟩ + obtain ⟨keys, values⟩ := ZFSet.pair_inj.1 eq + have same : σ = τ := Subtype.ext keys + exact ⟨same.symm ▸ hτ, by simpa only [same] using values⟩ + · rintro ⟨hσ, rfl⟩ + exact ⟨σ, hσ, rfl⟩ + +theorem renameFamilyGraph_function (t : Presentation Q) (f : P → Q) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : + ZFSet.IsFunc T (renamedFamily t f T valid) (renameFamilyGraph t f T valid) := by + apply functionGraphRange_function + have keys : ZFSet.range (fun x : T => x.val) = T := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_range] + exact ⟨fun ⟨y, eq⟩ => eq ▸ y.property, fun hx => ⟨⟨x, hx⟩, rfl⟩⟩ + simpa only [keys, renameFamilyGraph] using familyCodeGraph_function (fun x : T => x.val) + (fun x => (rename t f ⟨x.val, valid x.val x.property⟩).val) Subtype.val_injective + +theorem mem_renamedFamily (t : Presentation Q) (f : P → Q) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) (y : ZFSet.{u}) : + y ∈ renamedFamily t f T valid ↔ ∃ σ : Name s, σ.val ∈ T ∧ y = (rename t f σ).val := by + rw [renamedFamily, mem_functionGraphRange] + constructor + · rintro ⟨x, hx, entry⟩ + let σ : Name s := ⟨x, valid x hx⟩ + exact ⟨σ, hx, ((pair_mem_renameFamilyGraph t f T valid σ y).1 entry).2⟩ + · rintro ⟨σ, hσ, equal⟩ + exact ⟨σ.val, hσ, (pair_mem_renameFamilyGraph t f T valid σ y).2 ⟨hσ, equal⟩⟩ + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing.SetFormula + +def renamedNameFamilyPairFormula : SetFormula 5 := + .ex (.conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 0) + (.conj (binaryApplication uniformRenameFormula (extend 4 (extend 5 Fin.elim0)) 1 0) + (orderedPairFormula 2 1 0))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P Q : Type u} (s : Presentation P) (t : Presentation Q) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem renameFamilyGraph_mem (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) + (f : P → Q) (hf : s.graph t f ∈ M.sets) + (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ x ∈ T, IsName s x) : + Name.renameFamilyGraph t f T valid ∈ M.sets := by + obtain ⟨G, hG, _, recognizes⟩ := M.exists_uniformRename_between s t + pairing unions powers separation collection hs ht f hf + let U := s.carrier ∪ t.carrier + let params := extend t.carrier (extend U (extend G Fin.elim0)) + have hU : U ∈ M.sets := M.binary_union_mem pairing unions hs ht + have meaning (σ : Name s) (hσ : σ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets renamedNameFamilyPairFormula (extend σ.val (extend z params)) ↔ + z = ZFSet.pair σ.val (Name.rename t f σ).val := by + rw [renamedNameFamilyPairFormula, realize_ex] + constructor + · rintro ⟨v, hv, named, renamed, pair⟩ + rw [realize_domainApplication, map_extend, map_empty] at named + have validV : IsName t v := + (M.realize_uniformNameFormula t pairing unions powers separation collection ht v hv).1 named + rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed + have eq := (recognizes σ ⟨v, validV⟩ hσ hv).1 renamed + have pairEq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hv).1 pair + exact (congrArg Subtype.val eq).symm ▸ pairEq + · intro equal + have hv := M.rename_between_mem s t pairing unions powers separation collection hs ht f hf σ hσ + refine ⟨(Name.rename t f σ).val, hv, ?_, ?_, ?_⟩ + · rw [realize_domainApplication, map_extend, map_empty] + exact (M.realize_uniformNameFormula t pairing unions powers separation collection ht _ hv).2 + (Name.rename t f σ).property + · rw [realize_binaryApplication, map_extend, map_extend, map_empty] + exact (recognizes σ (Name.rename t f σ) hσ hv).2 rfl + · exact (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hv).2 equal + apply M.definable_image_mem separation collection renamedNameFamilyPairFormula params + (Fin.cases ht (Fin.cases hU (Fin.cases hG (fun i => Fin.elim0 i)))) hT + · intro z hz + obtain ⟨σ, hσ, rfl⟩ := (Name.mem_renameFamilyGraph t f T valid z).1 hz + exact M.orderedPair_mem pairing (M.transitive hT hσ) + (M.rename_between_mem s t pairing unions powers separation collection hs ht f hf σ (M.transitive hT hσ)) + · intro z hz + rw [Name.mem_renameFamilyGraph] + constructor + · rintro ⟨σ, hσ, eq⟩ + exact ⟨σ.val, hσ, (meaning σ (M.transitive hT hσ) z hz).2 eq⟩ + · rintro ⟨x, hx, rel⟩ + exact ⟨⟨x, valid x hx⟩, hx, (meaning ⟨x, valid x hx⟩ (M.transitive hT hx) z hz).1 rel⟩ + · intro x hx y hy z hz first second + exact ((meaning ⟨x, valid x hx⟩ (M.transitive hT hx) y hy).1 first).trans + ((meaning ⟨x, valid x hx⟩ (M.transitive hT hx) z hz).1 second).symm + +theorem renamedFamily_mem (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) + (f : P → Q) (hf : s.graph t f ∈ M.sets) + (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ x ∈ T, IsName s x) : + Name.renamedFamily t f T valid ∈ M.sets := + M.functionGraphRange_mem unions separation hT + (M.renameFamilyGraph_mem s t pairing unions powers separation collection hs ht f hf T hT valid) + +end PartitionPilot.Forcing.TransitiveGround + +end + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace SetFormula + +def termActionEntryFormula : SetFormula 5 := + .ex (.ex (.conj (.mem 1 4) (.conj (.mem 0 4) + (.conj (orderedPairFormula 2 1 0) (reindex ![3, 1, 0, 5, 6] nameActionFormula))))) + +def termActionSetFormula : SetFormula 5 := + exactSetFormula 0 (reindex (extend 0 (fun j : Fin 4 => j.succ.succ)) termActionEntryFormula) + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (hT : T ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +include pairing unions powers separation collection carrier group maps hT closed + +theorem realize_termActionEntryFormula (g : G) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets termActionEntryFormula ![z, t.encode g, T, s.carrier, a.conditionMapFamily s t] ↔ + z ∈ Name.renameFamilyGraph s (a.iso g) T valid := by + let env : Fin 5 → ZFSet.{u} := ![z, t.encode g, T, s.carrier, a.conditionMapFamily s t] + have args (x y : ZFSet.{u}) : + (fun j : Fin 5 => (extend y (extend x env)) (![3, 1, 0, 5, 6] j)) = + ![t.encode g, x, y, s.carrier, a.conditionMapFamily s t] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun k => Fin.elim0 k))))) j + change Realize M.sets termActionEntryFormula env ↔ _ + simp only [termActionEntryFormula, realize_ex] + constructor + · rintro ⟨x, hxm, y, hym, hx, hy, paired, acted⟩ + let w : Name s := ⟨x, valid x hx⟩ + let v : Name s := ⟨y, valid y hy⟩ + have equal := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hxm hym).1 paired + change z = ZFSet.pair x y at equal + rw [realize_reindex, args] at acted + have action := (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g w v hxm hym).1 acted + exact equal.symm ▸ (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid w y).2 + ⟨hx, congrArg Subtype.val action.symm⟩ + · intro entry + obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T valid z).1 entry + have hwm := M.transitive hT hw + have actedT := closed g w hw + have actedGround := M.transitive hT actedT + refine ⟨w.val, hwm, (a.act s g w).val, actedGround, hw, actedT, + (M.realize_orderedPairFormula pairing 2 1 0 _ hz hwm actedGround).2 rfl, ?_⟩ + rw [realize_reindex, args] + exact (M.realize_nameActionFormula a s t pairing unions powers separation collection + carrier group maps g w (a.act s g w) hwm actedGround).2 rfl + +theorem realize_termActionSetFormula (g : G) (F : ZFSet.{u}) (hF : F ∈ M.sets) : + Realize M.sets termActionSetFormula ![F, t.encode g, T, s.carrier, a.conditionMapFamily s t] ↔ + F = Name.renameFamilyGraph s (a.iso g) T valid := by + have graph := M.renameFamilyGraph_mem s s pairing unions powers separation collection carrier carrier + (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid + apply M.realize_exactSetFormula 0 _ _ hF (fun _ h => M.transitive graph h) + intro z hz + rw [realize_reindex, map_extend] + exact M.realize_termActionEntryFormula a s t T valid pairing unions powers separation collection + carrier group maps hT closed g z hz + +end TransitiveGround +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.PosetAction +open SetRealization +universe u +variable {G P Q L : Type u} [Group G] [PartialOrder P] [PartialOrder Q] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (e : PosetAction G Q) (t : Presentation Q) +variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid' : ∀ z ∈ T, IsName t z) +variable (graphs : ∀ g, Name.renameFamilyGraph t (e.iso g) T valid' = + Name.renameFamilyGraph s (a.iso g) T valid) +include graphs + +theorem support_of_term_graphs (u : Name s) (v : Name t) (member : u.val ∈ T) + (same : v.val = u.val) {K : Subgroup G} (supported : K ≤ a.stabilizer s u) : + K ≤ e.stabilizer t v := by + intro g hg + have fixed : a.act s g u = u := supported hg + have entry : ZFSet.pair u.val u.val ∈ Name.renameFamilyGraph s (a.iso g) T valid := + (Name.pair_mem_renameFamilyGraph s (a.iso g) T valid u u.val).2 + ⟨member, (congrArg Subtype.val fixed).symm⟩ + rw [← graphs g] at entry + have target : ZFSet.pair v.val v.val ∈ Name.renameFamilyGraph t (e.iso g) T valid' := by + simpa only [same] using entry + have value := ((Name.pair_mem_renameFamilyGraph t (e.iso g) T valid' v v.val).1 target).2 + exact Subtype.ext value.symm + +theorem positionSupport_of_term_graphs (b : Presentation L) (d : PosetAction G L) + (S mu X tuples : ZFSet.{u}) (D : L) + (range : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ T) + (support : ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) : + ∀ f ∈ S, ∀ v : Name t, ZFSet.pair f v.val ∈ tuples → + RowPositionBound mu X b.conditionOrder f (b.encode D) → + d.principalFix D ≤ e.stabilizer t v := by + intro f hf v entry bound + have member := range f v.val entry + let u : Name s := ⟨v.val, valid v.val member⟩ + exact a.support_of_term_graphs s e t T valid valid' graphs u v member rfl + (support f hf u entry bound) + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P Q : Type u} {s : Presentation P} + +theorem renamedFamily_valid (t : Presentation Q) (f : P → Q) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : + ∀ y ∈ renamedFamily t f T valid, IsName t y := by + intro y hy + obtain ⟨σ, _, rfl⟩ := (mem_renamedFamily t f T valid y).1 hy + exact (rename t f σ).property + +theorem presentationFamily_injection (t : Presentation P) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : + InjectionCode T (renamedFamily t id T valid) (renameFamilyGraph t id T valid) := by + refine ⟨renameFamilyGraph_function t id T valid, ?_⟩ + intro x y z first second + obtain ⟨σ, _, shapeσ⟩ := (mem_renameFamilyGraph t id T valid (ZFSet.pair x z)).1 first + obtain ⟨τ, _, shapeτ⟩ := (mem_renameFamilyGraph t id T valid (ZFSet.pair y z)).1 second + obtain ⟨rfl, eqσ⟩ := ZFSet.pair_inj.1 shapeσ + obtain ⟨rfl, eqτ⟩ := ZFSet.pair_inj.1 shapeτ + have images : presentationEquiv s t σ = presentationEquiv s t τ := + Subtype.ext (eqσ.symm.trans eqτ) + exact congrArg Subtype.val ((presentationEquiv s t).injective images) + +theorem rename_familySet (t : Presentation Q) (f : P → Q) (one : P) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) : + rename t f (familySet one T valid) = + familySet (f one) (renamedFamily t f T valid) (renamedFamily_valid t f T valid) := by + apply Name.ext + intro τ q + rw [entry_rename, entry_familySet] + constructor + · rintro ⟨σ, p, entry, rfl, rfl⟩ + obtain ⟨hσ, rfl⟩ := (entry_familySet one T valid σ p).1 entry + exact ⟨(mem_renamedFamily t f T valid _).2 ⟨σ, hσ, rfl⟩, rfl⟩ + · rintro ⟨hτ, rfl⟩ + obtain ⟨σ, hσ, equal⟩ := (mem_renamedFamily t f T valid τ.val).1 hτ + exact ⟨σ, one, (entry_familySet one T valid σ one).2 ⟨hσ, rfl⟩, + Subtype.ext equal.symm, rfl⟩ + +theorem eval_renamedFamily (t : Presentation P) (T : ZFSet.{u}) + (valid : ∀ x ∈ T, IsName s x) (H : Set P) (x : ZFSet.{u}) : + (∃ τ : Name t, τ.val ∈ renamedFamily t id T valid ∧ eval H τ = x) ↔ + ∃ σ : Name s, σ.val ∈ T ∧ eval H σ = x := by + constructor + · rintro ⟨τ, hτ, equal⟩ + obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ + have names : τ = presentationEquiv s t σ := Subtype.ext codes + exact ⟨σ, hσ, by rw [names, eval_presentationEquiv] at equal; exact equal⟩ + · rintro ⟨σ, hσ, equal⟩ + exact ⟨presentationEquiv s t σ, (mem_renamedFamily t id T valid _).2 ⟨σ, hσ, rfl⟩, + (eval_presentationEquiv s t H σ).trans equal⟩ + +variable {G : Type v} [Group G] [PartialOrder P] + +theorem renamedFamily_closed (a : PosetAction G P) (t : Presentation P) + (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) + (closed : ∀ g (σ : Name s), σ.val ∈ T → (a.act s g σ).val ∈ T) : + ∀ g (τ : Name t), τ.val ∈ renamedFamily t id T valid → + (a.act t g τ).val ∈ renamedFamily t id T valid := by + intro g τ hτ + obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ + have names : τ = presentationEquiv s t σ := Subtype.ext codes + rw [names, a.act_presentationEquiv] + exact (mem_renamedFamily t id T valid _).2 ⟨a.act s g σ, closed g σ hσ, rfl⟩ + +theorem renamedFamily_hs (a : PosetAction G P) (t : Presentation P) + (F : NormalSubgroupFamily G) (T : ZFSet.{u}) (valid : ∀ x ∈ T, IsName s x) + (children : ∀ σ : Name s, σ.val ∈ T → HereditarilySymmetric a s F σ) : + ∀ τ : Name t, τ.val ∈ renamedFamily t id T valid → HereditarilySymmetric a t F τ := by + intro τ hτ + obtain ⟨σ, hσ, codes⟩ := (mem_renamedFamily t id T valid τ.val).1 hτ + have names : τ = presentationEquiv s t σ := Subtype.ext codes + exact names.symm ▸ (children σ hσ).presentationEquiv t + +end PartitionPilot.Forcing.Name + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace SetFormula + +def termActionFamilyEntryFormula : SetFormula 5 := + .ex (.ex (.conj (.mem 1 3) (.conj (orderedPairFormula 2 1 0) + (reindex ![0, 1, 4, 5, 6] termActionSetFormula)))) + +end SetFormula +namespace PosetAction +variable {G P : Type u} [Group G] [PartialOrder P] + +noncomputable def termActionFamily (a : PosetAction G P) (s : Presentation P) + (t : Presentation G) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : ZFSet.{u} := + familyCodeGraph t.encode (fun g => Name.renameFamilyGraph s (a.iso g) T valid) + +theorem pair_mem_termActionFamily (a : PosetAction G P) (s : Presentation P) + (t : Presentation G) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (g : G) (F : ZFSet.{u}) : + ZFSet.pair (t.encode g) F ∈ a.termActionFamily s t T valid ↔ + F = Name.renameFamilyGraph s (a.iso g) T valid := + pair_mem_familyCodeGraph _ _ t.injective g F + +theorem termActionFamily_function (a : PosetAction G P) (s : Presentation P) + (t : Presentation G) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : + FunctionGraphOn t.carrier (a.termActionFamily s t T valid) := by + have equal : ZFSet.range t.encode = t.carrier := by + apply ZFSet.ext + intro x + exact ZFSet.mem_range.trans (t.mem_carrier x).symm + simpa only [equal, termActionFamily] using familyCodeGraph_function t.encode + (fun g => Name.renameFamilyGraph s (a.iso g) T valid) t.injective + +end PosetAction +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) (hT : T ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +include pairing unions powers separation collection carrier group maps hT closed + +theorem termActionFamily_mem : a.termActionFamily s t T valid ∈ M.sets := by + let values := fun g => Name.renameFamilyGraph s (a.iso g) T valid + have graphGround (g : G) := M.renameFamilyGraph_mem s s pairing unions powers separation collection + carrier carrier (a.iso g) (M.conditionMap_graph_mem a s t maps g) T hT valid + have graphBound (g : G) : values g ∈ M.groundRelations T T := by + refine (M.mem_groundRelations T T _).2 ⟨graphGround g, ?_⟩ + intro z hz + obtain ⟨w, hw, rfl⟩ := (Name.mem_renameFamilyGraph s (a.iso g) T valid z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hw, closed g w hw⟩ + let params : Fin 4 → ZFSet.{u} := ![t.carrier, T, s.carrier, a.conditionMapFamily s t] + have paramsGround : ∀ j, params j ∈ M.sets := Fin.cases group (Fin.cases hT + (Fin.cases carrier (Fin.cases maps (fun j => Fin.elim0 j)))) + have args (z raw F : ZFSet.{u}) : + (fun j : Fin 5 => (extend F (extend raw (extend z params))) (![0, 1, 4, 5, 6] j)) = + ![F, raw, T, s.carrier, a.conditionMapFamily s t] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun k => Fin.elim0 k))))) j + have meaning (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets termActionFamilyEntryFormula (extend z params) ↔ + z ∈ a.termActionFamily s t T valid := by + simp only [termActionFamilyEntryFormula, realize_ex] + constructor + · rintro ⟨raw, hr, F, hF, actor, paired, coded⟩ + obtain ⟨g, rfl⟩ := (t.mem_carrier raw).1 actor + have pairEq := (M.realize_orderedPairFormula pairing 2 1 0 _ hz hr hF).1 paired + change z = ZFSet.pair (t.encode g) F at pairEq + rw [realize_reindex, args] at coded + have equal := (M.realize_termActionSetFormula a s t T valid pairing unions powers separation + collection carrier group maps hT closed g F hF).1 coded + exact (mem_familyCodeGraph _ _ z).2 ⟨g, by simpa only [equal] using pairEq.symm⟩ + · intro member + obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 member + have hg := M.transitive group (t.encode_mem g) + refine ⟨t.encode g, hg, values g, graphGround g, t.encode_mem g, + (M.realize_orderedPairFormula pairing 2 1 0 _ hz hg (graphGround g)).2 rfl, ?_⟩ + rw [realize_reindex, args] + exact (M.realize_termActionSetFormula a s t T valid pairing unions powers separation + collection carrier group maps hT closed g (values g) (graphGround g)).2 rfl + let B := ZFSet.prod t.carrier (M.groundRelations T T) + have hB := M.prod_mem pairing unions powers separation group + (M.groundRelations_mem pairing unions powers separation hT hT) + have subset : a.termActionFamily s t T valid ⊆ B := by + intro z hz + obtain ⟨g, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨t.encode_mem g, graphBound g⟩ + have equal : ZFSet.sep (fun z => Realize M.sets termActionFamilyEntryFormula + (extend z params)) B = a.termActionFamily s t T valid := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + exact ⟨fun h => (meaning z (M.transitive hB h.1)).1 h.2, + fun h => ⟨subset h, (meaning z (M.transitive hB (subset h))).2 h⟩⟩ + exact equal ▸ M.separation_mem separation termActionFamilyEntryFormula params paramsGround hB + +end TransitiveGround +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.Name +open SetRealization +universe u +variable {P Q : Type u} {s : Presentation P} + +theorem renamedFamily_orderedPairNameFamily (t : Presentation Q) (f : P → Q) (one : P) + (X Y : ZFSet.{u}) (validX : ∀ z ∈ X, IsName s z) (validY : ∀ z ∈ Y, IsName s z) : + renamedFamily t f (orderedPairNameFamily (s.encode one) X Y) + (orderedPairNameFamily_valid one validX validY) = + orderedPairNameFamily (t.encode (f one)) + (renamedFamily t f X validX) (renamedFamily t f Y validY) := by + apply ZFSet.ext + intro z + rw [mem_renamedFamily, mem_orderedPairNameFamily] + constructor + · rintro ⟨σ, hσ, equal⟩ + obtain ⟨x, hx, y, hy, codes⟩ := (mem_orderedPairNameFamily _ X Y σ.val).1 hσ + let ρ : Name s := ⟨x, validX x hx⟩ + let ν : Name s := ⟨y, validY y hy⟩ + have same : σ = orderedPair one ρ ν := + Subtype.ext (codes.trans (orderedPair_code one ρ ν).symm) + refine ⟨(rename t f ρ).val, (mem_renamedFamily t f X validX _).2 ⟨ρ, hx, rfl⟩, + (rename t f ν).val, (mem_renamedFamily t f Y validY _).2 ⟨ν, hy, rfl⟩, ?_⟩ + rw [same, rename_orderedPair, orderedPair_code] at equal + exact equal + · rintro ⟨x, hx, y, hy, equal⟩ + obtain ⟨ρ, hρ, rfl⟩ := (mem_renamedFamily t f X validX x).1 hx + obtain ⟨ν, hν, rfl⟩ := (mem_renamedFamily t f Y validY y).1 hy + refine ⟨orderedPair one ρ ν, + (mem_orderedPairNameFamily _ X Y _).2 ⟨ρ.val, hρ, ν.val, hν, orderedPair_code one ρ ν⟩, ?_⟩ + rw [rename_orderedPair, orderedPair_code] + exact equal + +theorem renamedFamily_iteratedPairNameFamily (t : Presentation Q) (f : P → Q) (one : P) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (n : Nat) : + renamedFamily t f (iteratedPairNameFamily (s.encode one) T n) + (iteratedPairNameFamily_valid one valid n) = + iteratedPairNameFamily (t.encode (f one)) (renamedFamily t f T valid) n := by + induction n with + | zero => rfl + | succ n ih => + change renamedFamily t f (orderedPairNameFamily (s.encode one) + (iteratedPairNameFamily (s.encode one) T n) T) + (orderedPairNameFamily_valid one (iteratedPairNameFamily_valid one valid n) valid) = _ + rw [renamedFamily_orderedPairNameFamily t f one _ _ + (iteratedPairNameFamily_valid one valid n) valid, ih] + rfl + +end PartitionPilot.Forcing.Name + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RequestedSupportOwners.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RequestedSupportOwners.lean index d62ea021e6358a5bcae811a05b6cb4b5143e8ff5..e60d6570f208918268088815a5c9791b30fb342c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RequestedSupportOwners.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RequestedSupportOwners.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.OutwardSchedule -import OAI.SetTheory.PartitionPrinciple.Geometry.RootedSupportOrder - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -open Attachment CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -theorem leastSupport_root_copy_iff (x : f.Node a) : - (f.diagram a).scheme.LeastSupport (TileStars.root J f.Letters R) x ↔ - ∃ y, (f.copy a 1).toFun y = x := by - refine ((f.diagram a).scheme.leastSupport_root_iff x).trans ?_ - constructor - · rintro ⟨y, hy⟩ - exact ⟨y, (f.copy_one a y).trans hy⟩ - · rintro ⟨y, hy⟩ - exact ⟨y, (f.copy_one a y).symm.trans hy⟩ - -theorem leastSupport_coset_iff (c : CosetGeometry.Vertex J f.Letters) (x : f.Node a) : - (f.diagram a).scheme.LeastSupport (.inl c) x ↔ - c = CosetGeometry.root J f.Letters ∧ ∃ y, (f.copy a 1).toFun y = x := by - constructor - · intro least - by_cases zero : (f.diagram a).scheme.depth (.inl c) = 0 - · have root := (f.diagram a).scheme.zero_eq_root (.inl c) zero - have hc : c = CosetGeometry.root J f.Letters := Sum.inl.inj root - subst c - exact ⟨rfl, (f.leastSupport_root_copy_iff a x).mp least⟩ - · rcases least.1 with ⟨y, rfl⟩ - exact False.elim (((f.diagram a).scheme.leastSupport_vertex_iff (.inl c) zero y).mp least - (f.old_local_full a c zero y)) - · rintro ⟨rfl, old⟩ - exact (f.leastSupport_root_copy_iff a x).mpr old - -theorem tile_depth_ne_zero (w : External J f.Letters) (r : R) : - (f.diagram a).scheme.depth (.inr (w, r)) ≠ 0 := by - intro zero - exact Sum.inr_ne_inl ((f.diagram a).scheme.zero_eq_root (.inr (w, r)) zero) - -theorem leastSupport_tile_iff (w : External J f.Letters) (r : R) - (y : (f.tile r).Space) : - (f.diagram a).scheme.LeastSupport (.inr (w, r)) ((f.placedTile a w r).toFun y) ↔ - ¬ (f.tile r).order.le y - ((f.diagram a).localGlue (.inr (w, r)) (f.tile_depth_ne_zero a w r)).rightAnchor := - (f.diagram a).scheme.leastSupport_vertex_iff (.inr (w, r)) (f.tile_depth_ne_zero a w r) y - -theorem leastSupport_cases (v : TileStars.Vertex J f.Letters R) (x : f.Node a) - (least : (f.diagram a).scheme.LeastSupport v x) : - (v = TileStars.root J f.Letters R ∧ ∃ y, (f.copy a 1).toFun y = x) ∨ - ∃ w r, ∃ y : (f.tile r).Space, v = .inr (w, r) ∧ - (f.placedTile a w r).toFun y = x ∧ - ¬ (f.tile r).order.le y - ((f.diagram a).localGlue (.inr (w, r)) (f.tile_depth_ne_zero a w r)).rightAnchor := by - cases v with - | inl c => - rcases (f.leastSupport_coset_iff a c x).mp least with ⟨rfl, old⟩ - exact Or.inl ⟨rfl, old⟩ - | inr c => - rcases least.1 with ⟨y, rfl⟩ - exact Or.inr ⟨c.1, c.2, y, rfl, rfl, (f.leastSupport_tile_iff a c.1 c.2 y).mp least⟩ - -theorem new_point_has_fresh_tile (x : f.Node a) - (newPoint : ¬ ∃ y, (f.copy a 1).toFun y = x) : - ∃ w r, ∃ y : (f.tile r).Space, - (f.diagram a).scheme.LeastSupport (.inr (w, r)) x ∧ - (f.placedTile a w r).toFun y = x ∧ - ¬ (f.tile r).order.le y - ((f.diagram a).localGlue (.inr (w, r)) (f.tile_depth_ne_zero a w r)).rightAnchor := by - rcases (f.diagram a).scheme.existsUnique_leastSupport x with ⟨v, least, _⟩ - rcases f.leastSupport_cases a v x least with ⟨_, old⟩ | ⟨w, r, y, rfl, eq, fresh⟩ - · exact False.elim (newPoint old) - · exact ⟨w, r, y, least, eq, fresh⟩ - -end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.OutwardSchedule +import OAI.SetTheory.PartitionPrinciple.Geometry.RootedSupportOrder + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +open Attachment CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +theorem leastSupport_root_copy_iff (x : f.Node a) : + (f.diagram a).scheme.LeastSupport (TileStars.root J f.Letters R) x ↔ + ∃ y, (f.copy a 1).toFun y = x := by + refine ((f.diagram a).scheme.leastSupport_root_iff x).trans ?_ + constructor + · rintro ⟨y, hy⟩ + exact ⟨y, (f.copy_one a y).trans hy⟩ + · rintro ⟨y, hy⟩ + exact ⟨y, (f.copy_one a y).symm.trans hy⟩ + +theorem leastSupport_coset_iff (c : CosetGeometry.Vertex J f.Letters) (x : f.Node a) : + (f.diagram a).scheme.LeastSupport (.inl c) x ↔ + c = CosetGeometry.root J f.Letters ∧ ∃ y, (f.copy a 1).toFun y = x := by + constructor + · intro least + by_cases zero : (f.diagram a).scheme.depth (.inl c) = 0 + · have root := (f.diagram a).scheme.zero_eq_root (.inl c) zero + have hc : c = CosetGeometry.root J f.Letters := Sum.inl.inj root + subst c + exact ⟨rfl, (f.leastSupport_root_copy_iff a x).mp least⟩ + · rcases least.1 with ⟨y, rfl⟩ + exact False.elim (((f.diagram a).scheme.leastSupport_vertex_iff (.inl c) zero y).mp least + (f.old_local_full a c zero y)) + · rintro ⟨rfl, old⟩ + exact (f.leastSupport_root_copy_iff a x).mpr old + +theorem tile_depth_ne_zero (w : External J f.Letters) (r : R) : + (f.diagram a).scheme.depth (.inr (w, r)) ≠ 0 := by + intro zero + exact Sum.inr_ne_inl ((f.diagram a).scheme.zero_eq_root (.inr (w, r)) zero) + +theorem leastSupport_tile_iff (w : External J f.Letters) (r : R) + (y : (f.tile r).Space) : + (f.diagram a).scheme.LeastSupport (.inr (w, r)) ((f.placedTile a w r).toFun y) ↔ + ¬ (f.tile r).order.le y + ((f.diagram a).localGlue (.inr (w, r)) (f.tile_depth_ne_zero a w r)).rightAnchor := + (f.diagram a).scheme.leastSupport_vertex_iff (.inr (w, r)) (f.tile_depth_ne_zero a w r) y + +theorem leastSupport_cases (v : TileStars.Vertex J f.Letters R) (x : f.Node a) + (least : (f.diagram a).scheme.LeastSupport v x) : + (v = TileStars.root J f.Letters R ∧ ∃ y, (f.copy a 1).toFun y = x) ∨ + ∃ w r, ∃ y : (f.tile r).Space, v = .inr (w, r) ∧ + (f.placedTile a w r).toFun y = x ∧ + ¬ (f.tile r).order.le y + ((f.diagram a).localGlue (.inr (w, r)) (f.tile_depth_ne_zero a w r)).rightAnchor := by + cases v with + | inl c => + rcases (f.leastSupport_coset_iff a c x).mp least with ⟨rfl, old⟩ + exact Or.inl ⟨rfl, old⟩ + | inr c => + rcases least.1 with ⟨y, rfl⟩ + exact Or.inr ⟨c.1, c.2, y, rfl, rfl, (f.leastSupport_tile_iff a c.1 c.2 y).mp least⟩ + +theorem new_point_has_fresh_tile (x : f.Node a) + (newPoint : ¬ ∃ y, (f.copy a 1).toFun y = x) : + ∃ w r, ∃ y : (f.tile r).Space, + (f.diagram a).scheme.LeastSupport (.inr (w, r)) x ∧ + (f.placedTile a w r).toFun y = x ∧ + ¬ (f.tile r).order.le y + ((f.diagram a).localGlue (.inr (w, r)) (f.tile_depth_ne_zero a w r)).rightAnchor := by + rcases (f.diagram a).scheme.existsUnique_leastSupport x with ⟨v, least, _⟩ + rcases f.leastSupport_cases a v x least with ⟨_, old⟩ | ⟨w, r, y, rfl, eq, fresh⟩ + · exact False.elim (newPoint old) + · exact ⟨w, r, y, least, eq, fresh⟩ + +end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RootedSupportOwners.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RootedSupportOwners.lean index 2025f5a4aea3e91238f4dd76a621e3a15665e77a..30b30054d673d259500cc9c03981ee7bf1c8f06b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RootedSupportOwners.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RootedSupportOwners.lean @@ -1,120 +1,120 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.TileTreeGluing - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -open Attachment -universe u -variable {V : Type u} (d : Scheme V) - -def Supports (v : V) (x : d.Node) : Prop := ∃ a, (d.vertex v).toFun a = x - -def LeastSupport (v : V) (x : d.Node) : Prop := - d.Supports v x ∧ ∀ w, d.Supports w x → d.depth v ≤ d.depth w - -theorem fresh_stage_vertex (n : Nat) (x : (d.stages n).batch.Fresh) - (w : V) (hw : d.depth w ≤ n + 1) (a : d.Space w) - (eq : ((d.stages (n + 1)).vertex w hw).toFun a = Sum.inr x) : - w = x.1.val := by - classical - let s := d.stages n - change (s.successor.vertex w hw).toFun a = Sum.inr x at eq - by_cases old : d.depth w ≤ n - · rw [s.successor_old w old a] at eq - exact False.elim (Sum.inl_ne_inr eq) - · let i : s.Layer := ⟨w, by omega⟩ - rw [s.successor_new i a] at eq - change s.batch.componentMap i ((s.batch.glue i).represent a) = Sum.inr x at eq - by_cases base : (d.order w).le a (d.childAnchor w (s.layer_nonzero i)) - · rw [(s.batch.glue i).represent_old a base] at eq - exact False.elim (Sum.inl_ne_inr eq) - · rw [(s.batch.glue i).represent_new a base] at eq - exact congrArg (fun z : s.batch.Fresh => z.1.val) (Sum.inr.inj eq) - -theorem fresh_vertex_eq (v : V) (h : d.depth v ≠ 0) (a : d.Space v) - (fresh : ¬ (d.order v).le a (d.childAnchor v h)) - (w : V) (hw : d.depth w ≤ d.depth v) (b : d.Space w) - (eq : (d.vertex w).toFun b = (d.vertex v).toFun a) : w = v := by - let n := d.depth (d.parent v) - let s := d.stages n - let i : s.Layer := ⟨v, (d.parent_depth v h).symm⟩ - let x : s.batch.Fresh := ⟨i, ⟨a, fresh⟩⟩ - have hv : (d.vertex v).toFun a = d.chain.point (n + 1) (Sum.inr x) := by - rw [d.vertex_at v (n + 1) i.property.le a] - change d.chain.point (n + 1) ((s.successor.vertex v i.property.le).toFun a) = _ - rw [s.successor_new i a] - change d.chain.point (n + 1) (s.batch.componentMap i ((s.batch.glue i).represent a)) = _ - rw [(s.batch.glue i).represent_new a fresh] - rfl - have hw' : d.depth w ≤ n + 1 := hw.trans i.property.le - have stageEq : ((d.stages (n + 1)).vertex w hw').toFun b = Sum.inr x := by - apply d.chain.include_injective (n + 1) - rw [← d.vertex_at w (n + 1) hw' b] - exact eq.trans hv - exact d.fresh_stage_vertex n x w hw' b stageEq - -theorem supports_parent_iff (v : V) (h : d.depth v ≠ 0) (a : d.Space v) : - d.Supports (d.parent v) ((d.vertex v).toFun a) ↔ - (d.order v).le a (d.childAnchor v h) := by - constructor - · rintro ⟨b, eq⟩ - by_contra fresh - have smaller := d.parent_depth v h - have same := d.fresh_vertex_eq v h a fresh (d.parent v) (by omega) b eq - rw [same] at smaller - omega - · intro base - exact ⟨((d.link v h).toFun ⟨a, base⟩).val, - (d.parent_identification v h ⟨a, base⟩).symm⟩ - -theorem leastSupport_vertex_iff (v : V) (h : d.depth v ≠ 0) (a : d.Space v) : - d.LeastSupport v ((d.vertex v).toFun a) ↔ - ¬ (d.order v).le a (d.childAnchor v h) := by - constructor - · intro least base - have parent := least.2 (d.parent v) ((d.supports_parent_iff v h a).mpr base) - have smaller := d.parent_depth v h - omega - · intro fresh - refine ⟨⟨a, rfl⟩, ?_⟩ - rintro w ⟨b, eq⟩ - by_contra notle - have same := d.fresh_vertex_eq v h a fresh w (by omega) b eq - subst w - exact notle (Nat.le_refl _) - -theorem leastSupport_root_iff (x : d.Node) : - d.LeastSupport d.root x ↔ d.Supports d.root x := by - exact ⟨And.left, fun hx => ⟨hx, fun _ _ => by rw [d.depth_root]; exact Nat.zero_le _⟩⟩ - -theorem leastSupport_unique {v w : V} {x : d.Node} - (first : d.LeastSupport v x) (second : d.LeastSupport w x) : v = w := by - have sameDepth := Nat.le_antisymm (first.2 w second.1) (second.2 v first.1) - by_cases zero : d.depth v = 0 - · exact (d.zero_eq_root v zero).trans (d.zero_eq_root w (sameDepth.symm.trans zero)).symm - · rcases first.1 with ⟨a, rfl⟩ - rcases second.1 with ⟨b, eq⟩ - exact (d.fresh_vertex_eq v zero a ((d.leastSupport_vertex_iff v zero a).mp first) - w sameDepth.symm.le b eq).symm - -theorem existsUnique_leastSupport (x : d.Node) : ∃! v, d.LeastSupport v x := by - classical - have present : ∃ n, ∃ v, d.depth v = n ∧ d.Supports v x := by - rcases d.cover x with ⟨v, a, eq⟩ - exact ⟨d.depth v, v, rfl, a, eq⟩ - rcases Nat.find_spec present with ⟨v, hv, support⟩ - have least : d.LeastSupport v x := by - refine ⟨support, ?_⟩ - intro w hw - rw [hv] - exact Nat.find_min' present ⟨w, rfl, hw⟩ - exact ⟨v, least, fun w hw => d.leastSupport_unique hw least⟩ - -end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.TileTreeGluing + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +open Attachment +universe u +variable {V : Type u} (d : Scheme V) + +def Supports (v : V) (x : d.Node) : Prop := ∃ a, (d.vertex v).toFun a = x + +def LeastSupport (v : V) (x : d.Node) : Prop := + d.Supports v x ∧ ∀ w, d.Supports w x → d.depth v ≤ d.depth w + +theorem fresh_stage_vertex (n : Nat) (x : (d.stages n).batch.Fresh) + (w : V) (hw : d.depth w ≤ n + 1) (a : d.Space w) + (eq : ((d.stages (n + 1)).vertex w hw).toFun a = Sum.inr x) : + w = x.1.val := by + classical + let s := d.stages n + change (s.successor.vertex w hw).toFun a = Sum.inr x at eq + by_cases old : d.depth w ≤ n + · rw [s.successor_old w old a] at eq + exact False.elim (Sum.inl_ne_inr eq) + · let i : s.Layer := ⟨w, by omega⟩ + rw [s.successor_new i a] at eq + change s.batch.componentMap i ((s.batch.glue i).represent a) = Sum.inr x at eq + by_cases base : (d.order w).le a (d.childAnchor w (s.layer_nonzero i)) + · rw [(s.batch.glue i).represent_old a base] at eq + exact False.elim (Sum.inl_ne_inr eq) + · rw [(s.batch.glue i).represent_new a base] at eq + exact congrArg (fun z : s.batch.Fresh => z.1.val) (Sum.inr.inj eq) + +theorem fresh_vertex_eq (v : V) (h : d.depth v ≠ 0) (a : d.Space v) + (fresh : ¬ (d.order v).le a (d.childAnchor v h)) + (w : V) (hw : d.depth w ≤ d.depth v) (b : d.Space w) + (eq : (d.vertex w).toFun b = (d.vertex v).toFun a) : w = v := by + let n := d.depth (d.parent v) + let s := d.stages n + let i : s.Layer := ⟨v, (d.parent_depth v h).symm⟩ + let x : s.batch.Fresh := ⟨i, ⟨a, fresh⟩⟩ + have hv : (d.vertex v).toFun a = d.chain.point (n + 1) (Sum.inr x) := by + rw [d.vertex_at v (n + 1) i.property.le a] + change d.chain.point (n + 1) ((s.successor.vertex v i.property.le).toFun a) = _ + rw [s.successor_new i a] + change d.chain.point (n + 1) (s.batch.componentMap i ((s.batch.glue i).represent a)) = _ + rw [(s.batch.glue i).represent_new a fresh] + rfl + have hw' : d.depth w ≤ n + 1 := hw.trans i.property.le + have stageEq : ((d.stages (n + 1)).vertex w hw').toFun b = Sum.inr x := by + apply d.chain.include_injective (n + 1) + rw [← d.vertex_at w (n + 1) hw' b] + exact eq.trans hv + exact d.fresh_stage_vertex n x w hw' b stageEq + +theorem supports_parent_iff (v : V) (h : d.depth v ≠ 0) (a : d.Space v) : + d.Supports (d.parent v) ((d.vertex v).toFun a) ↔ + (d.order v).le a (d.childAnchor v h) := by + constructor + · rintro ⟨b, eq⟩ + by_contra fresh + have smaller := d.parent_depth v h + have same := d.fresh_vertex_eq v h a fresh (d.parent v) (by omega) b eq + rw [same] at smaller + omega + · intro base + exact ⟨((d.link v h).toFun ⟨a, base⟩).val, + (d.parent_identification v h ⟨a, base⟩).symm⟩ + +theorem leastSupport_vertex_iff (v : V) (h : d.depth v ≠ 0) (a : d.Space v) : + d.LeastSupport v ((d.vertex v).toFun a) ↔ + ¬ (d.order v).le a (d.childAnchor v h) := by + constructor + · intro least base + have parent := least.2 (d.parent v) ((d.supports_parent_iff v h a).mpr base) + have smaller := d.parent_depth v h + omega + · intro fresh + refine ⟨⟨a, rfl⟩, ?_⟩ + rintro w ⟨b, eq⟩ + by_contra notle + have same := d.fresh_vertex_eq v h a fresh w (by omega) b eq + subst w + exact notle (Nat.le_refl _) + +theorem leastSupport_root_iff (x : d.Node) : + d.LeastSupport d.root x ↔ d.Supports d.root x := by + exact ⟨And.left, fun hx => ⟨hx, fun _ _ => by rw [d.depth_root]; exact Nat.zero_le _⟩⟩ + +theorem leastSupport_unique {v w : V} {x : d.Node} + (first : d.LeastSupport v x) (second : d.LeastSupport w x) : v = w := by + have sameDepth := Nat.le_antisymm (first.2 w second.1) (second.2 v first.1) + by_cases zero : d.depth v = 0 + · exact (d.zero_eq_root v zero).trans (d.zero_eq_root w (sameDepth.symm.trans zero)).symm + · rcases first.1 with ⟨a, rfl⟩ + rcases second.1 with ⟨b, eq⟩ + exact (d.fresh_vertex_eq v zero a ((d.leastSupport_vertex_iff v zero a).mp first) + w sameDepth.symm.le b eq).symm + +theorem existsUnique_leastSupport (x : d.Node) : ∃! v, d.LeastSupport v x := by + classical + have present : ∃ n, ∃ v, d.depth v = n ∧ d.Supports v x := by + rcases d.cover x with ⟨v, a, eq⟩ + exact ⟨d.depth v, v, rfl, a, eq⟩ + rcases Nat.find_spec present with ⟨v, hv, support⟩ + have least : d.LeastSupport v x := by + refine ⟨support, ?_⟩ + intro w hw + rw [hv] + exact Nat.find_min' present ⟨w, rfl, hw⟩ + exact ⟨v, least, fun w hw => d.leastSupport_unique hw least⟩ + +end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowNames.lean index 512cb0fa4cc063fe34e02d292c9976b8ca1874ee..d5fbb7668610457063774f75e92f6f12608715b6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowNames.lean @@ -1,122 +1,122 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Rows - -open SetRealization Compression.RecursiveMaps -open Compression.RecursiveMaps.CountableColumns Compression.RecursiveMaps.MainStage.OrdinalRun - -noncomputable def namePresentation : Presentation RowForcing := Presentation.canonical RowForcing - -noncomputable def posetAction : PosetAction (FinalActor Column) RowForcing where - iso := rowAction - one := rowAction_one - mul := rowAction_mul - -noncomputable def columnCode (α : Column) : ZFSet.{1} := ordinalCode (Ordinal.lift.{1,0} α.val) - -theorem columnCode_injective : Function.Injective columnCode := by - intro α β eq - exact Subtype.ext (Ordinal.lift_inj.1 (ordinalCode_injective eq)) - -noncomputable def rowName (i : Position) : Name namePresentation := - Name.assemble - (fun c : {c : Column × RowForcing // c.2.value (i, c.1) = some true} => - Name.check namePresentation ⊤ (columnCode c.val.1)) - (fun c => c.val.2) - -theorem entry_rowName (i : Position) (σ : Name namePresentation) (p : RowForcing) : - Name.Entry σ (rowName i) p ↔ ∃ α, - Name.check namePresentation ⊤ (columnCode α) = σ ∧ p.value (i, α) = some true := by - rw [rowName, Name.entry_assemble] - constructor - · rintro ⟨c, eq, rfl⟩ - exact ⟨c.val.1, eq, c.property⟩ - · rintro ⟨α, eq, hp⟩ - exact ⟨⟨(α, p), hp⟩, eq, rfl⟩ - -theorem rowName_action (g : FinalActor Column) (i : Position) : - posetAction.act namePresentation g (rowName i) = rowName (positionAction g i) := by - apply Name.ext - intro σ q - change Name.Entry σ (Name.rename namePresentation (rowAction g) (rowName i)) q ↔ _ - rw [Name.entry_rename, entry_rowName] - constructor - · rintro ⟨ν, p, entry, eq, rfl⟩ - obtain ⟨α, rfl, hp⟩ := (entry_rowName i ν p).1 entry - refine ⟨α, ?_, (rowAction_value g p i α).trans hp⟩ - exact (posetAction.act_check namePresentation g (columnCode α)).symm.trans eq - · rintro ⟨α, rfl, hq⟩ - let p := (rowAction g).symm q - have pq : rowAction g p = q := (rowAction g).apply_symm_apply q - have hp : p.value (i, α) = some true := by - have hv := rowAction_value g p i α - rw [pq] at hv - exact hv.symm.trans hq - exact ⟨Name.check namePresentation ⊤ (columnCode α), p, - (entry_rowName i _ p).2 ⟨α, rfl, hp⟩, - posetAction.act_check namePresentation g (columnCode α), pq⟩ - -theorem rowName_supported (i : Position) : - (finalAction Column).fixSubgroup i.val ≤ posetAction.stabilizer namePresentation (rowName i) := by - intro g fixed - change posetAction.act namePresentation g (rowName i) = rowName i - rw [rowName_action] - apply congrArg rowName - exact Subtype.ext (fixed i.val ((finalOrder Column).refl i.val)) - -theorem rowName_hs (i : Position) : - HereditarilySymmetric posetAction namePresentation (supportFamily Column) (rowName i) := by - refine HereditarilySymmetric.mk ⟨i.val, rowName_supported i⟩ ?_ - intro σ p entry - obtain ⟨α, rfl, _⟩ := (entry_rowName i σ p).1 entry - exact HereditarilySymmetric.check posetAction namePresentation (supportFamily Column) (columnCode α) - -theorem mem_eval_rowName (H : Set RowForcing) (top : ⊤ ∈ H) (i : Position) (x : ZFSet.{1}) : - x ∈ Name.eval H (rowName i) ↔ - ∃ α p, p ∈ H ∧ p.value (i, α) = some true ∧ columnCode α = x := by - rw [Name.mem_eval] - constructor - · rintro ⟨σ, p, entry, hp, eq⟩ - obtain ⟨α, rfl, value⟩ := (entry_rowName i σ p).1 entry - rw [Name.eval_check H ⊤ top] at eq - exact ⟨α, p, hp, value, eq⟩ - · rintro ⟨α, p, hp, value, eq⟩ - exact ⟨Name.check namePresentation ⊤ (columnCode α), p, - (entry_rowName i _ p).2 ⟨α, rfl, value⟩, hp, - (Name.eval_check H ⊤ top (columnCode α)).trans eq⟩ - -theorem column_mem_eval_rowName (F : ConditionFilter RowForcing) (i : Position) (α : Column) : - columnCode α ∈ Name.eval {p | F.mem p} (rowName i) ↔ - ∃ p, F.mem p ∧ p.value (i, α) = some true := by - rw [mem_eval_rowName {p | F.mem p} F.top_mem] - constructor - · rintro ⟨β, p, hp, value, eq⟩ - have same := columnCode_injective eq - exact ⟨p, hp, same ▸ value⟩ - · rintro ⟨p, hp, value⟩ - exact ⟨α, p, hp, value, rfl⟩ - -theorem rowName_recovers_row (F : ConditionFilter RowForcing) - (generic : F.GenericFor (denseFamily Position)) (i : Position) (α : Column) : - columnCode α ∈ Name.eval {p | F.mem p} (rowName i) ↔ α ∈ row F generic i := by - rw [column_mem_eval_rowName, mem_row_iff] - -theorem rowName_values_injective (F : ConditionFilter RowForcing) - (generic : F.GenericFor (denseFamily Position)) : - Function.Injective (fun i => Name.eval {p | F.mem p} (rowName i)) := by - intro i j eq - change Name.eval {p | F.mem p} (rowName i) = Name.eval {p | F.mem p} (rowName j) at eq - apply row_injective F generic - apply Set.ext - intro α - rw [← rowName_recovers_row F generic, ← rowName_recovers_row F generic, eq] - -end PartitionPilot.Forcing.Rows - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Rows + +open SetRealization Compression.RecursiveMaps +open Compression.RecursiveMaps.CountableColumns Compression.RecursiveMaps.MainStage.OrdinalRun + +noncomputable def namePresentation : Presentation RowForcing := Presentation.canonical RowForcing + +noncomputable def posetAction : PosetAction (FinalActor Column) RowForcing where + iso := rowAction + one := rowAction_one + mul := rowAction_mul + +noncomputable def columnCode (α : Column) : ZFSet.{1} := ordinalCode (Ordinal.lift.{1,0} α.val) + +theorem columnCode_injective : Function.Injective columnCode := by + intro α β eq + exact Subtype.ext (Ordinal.lift_inj.1 (ordinalCode_injective eq)) + +noncomputable def rowName (i : Position) : Name namePresentation := + Name.assemble + (fun c : {c : Column × RowForcing // c.2.value (i, c.1) = some true} => + Name.check namePresentation ⊤ (columnCode c.val.1)) + (fun c => c.val.2) + +theorem entry_rowName (i : Position) (σ : Name namePresentation) (p : RowForcing) : + Name.Entry σ (rowName i) p ↔ ∃ α, + Name.check namePresentation ⊤ (columnCode α) = σ ∧ p.value (i, α) = some true := by + rw [rowName, Name.entry_assemble] + constructor + · rintro ⟨c, eq, rfl⟩ + exact ⟨c.val.1, eq, c.property⟩ + · rintro ⟨α, eq, hp⟩ + exact ⟨⟨(α, p), hp⟩, eq, rfl⟩ + +theorem rowName_action (g : FinalActor Column) (i : Position) : + posetAction.act namePresentation g (rowName i) = rowName (positionAction g i) := by + apply Name.ext + intro σ q + change Name.Entry σ (Name.rename namePresentation (rowAction g) (rowName i)) q ↔ _ + rw [Name.entry_rename, entry_rowName] + constructor + · rintro ⟨ν, p, entry, eq, rfl⟩ + obtain ⟨α, rfl, hp⟩ := (entry_rowName i ν p).1 entry + refine ⟨α, ?_, (rowAction_value g p i α).trans hp⟩ + exact (posetAction.act_check namePresentation g (columnCode α)).symm.trans eq + · rintro ⟨α, rfl, hq⟩ + let p := (rowAction g).symm q + have pq : rowAction g p = q := (rowAction g).apply_symm_apply q + have hp : p.value (i, α) = some true := by + have hv := rowAction_value g p i α + rw [pq] at hv + exact hv.symm.trans hq + exact ⟨Name.check namePresentation ⊤ (columnCode α), p, + (entry_rowName i _ p).2 ⟨α, rfl, hp⟩, + posetAction.act_check namePresentation g (columnCode α), pq⟩ + +theorem rowName_supported (i : Position) : + (finalAction Column).fixSubgroup i.val ≤ posetAction.stabilizer namePresentation (rowName i) := by + intro g fixed + change posetAction.act namePresentation g (rowName i) = rowName i + rw [rowName_action] + apply congrArg rowName + exact Subtype.ext (fixed i.val ((finalOrder Column).refl i.val)) + +theorem rowName_hs (i : Position) : + HereditarilySymmetric posetAction namePresentation (supportFamily Column) (rowName i) := by + refine HereditarilySymmetric.mk ⟨i.val, rowName_supported i⟩ ?_ + intro σ p entry + obtain ⟨α, rfl, _⟩ := (entry_rowName i σ p).1 entry + exact HereditarilySymmetric.check posetAction namePresentation (supportFamily Column) (columnCode α) + +theorem mem_eval_rowName (H : Set RowForcing) (top : ⊤ ∈ H) (i : Position) (x : ZFSet.{1}) : + x ∈ Name.eval H (rowName i) ↔ + ∃ α p, p ∈ H ∧ p.value (i, α) = some true ∧ columnCode α = x := by + rw [Name.mem_eval] + constructor + · rintro ⟨σ, p, entry, hp, eq⟩ + obtain ⟨α, rfl, value⟩ := (entry_rowName i σ p).1 entry + rw [Name.eval_check H ⊤ top] at eq + exact ⟨α, p, hp, value, eq⟩ + · rintro ⟨α, p, hp, value, eq⟩ + exact ⟨Name.check namePresentation ⊤ (columnCode α), p, + (entry_rowName i _ p).2 ⟨α, rfl, value⟩, hp, + (Name.eval_check H ⊤ top (columnCode α)).trans eq⟩ + +theorem column_mem_eval_rowName (F : ConditionFilter RowForcing) (i : Position) (α : Column) : + columnCode α ∈ Name.eval {p | F.mem p} (rowName i) ↔ + ∃ p, F.mem p ∧ p.value (i, α) = some true := by + rw [mem_eval_rowName {p | F.mem p} F.top_mem] + constructor + · rintro ⟨β, p, hp, value, eq⟩ + have same := columnCode_injective eq + exact ⟨p, hp, same ▸ value⟩ + · rintro ⟨p, hp, value⟩ + exact ⟨α, p, hp, value, rfl⟩ + +theorem rowName_recovers_row (F : ConditionFilter RowForcing) + (generic : F.GenericFor (denseFamily Position)) (i : Position) (α : Column) : + columnCode α ∈ Name.eval {p | F.mem p} (rowName i) ↔ α ∈ row F generic i := by + rw [column_mem_eval_rowName, mem_row_iff] + +theorem rowName_values_injective (F : ConditionFilter RowForcing) + (generic : F.GenericFor (denseFamily Position)) : + Function.Injective (fun i => Name.eval {p | F.mem p} (rowName i)) := by + intro i j eq + change Name.eval {p | F.mem p} (rowName i) = Name.eval {p | F.mem p} (rowName j) at eq + apply row_injective F generic + apply Set.ext + intro α + rw [← rowName_recovers_row F generic, ← rowName_recovers_row F generic, eq] + +end PartitionPilot.Forcing.Rows + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowSupportDescent.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowSupportDescent.lean index c7b30070c9f30281bd8b5d072f73da99238bd7b9..63d43ee45d4d6d3b15565a3578ee46a545c29f97 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowSupportDescent.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/RowSupportDescent.lean @@ -1,70 +1,70 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RowCopyRefinements - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Rows - -open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns -open Compression.RecursiveMaps.MainStage.OrdinalRun - -def descentWitnessFamily (p : RowForcing) (C B D : FinalPoint Column) - (x y : Name namePresentation) : Set (Set RowForcing) := - posetAction.copyWitnessFamily namePresentation - ((finalAction Column).fixSubgroup ((finalOrder Column).meet C B)) - (Separated D ((finalOrder Column).meet C B)) p x y - -theorem row_mix_capture (p : RowForcing) (C B D : FinalPoint Column) - (x y : Name namePresentation) (bp : Bounds p D) - (cd : (finalOrder Column).le C D) (bd : (finalOrder Column).le B D) - (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) - (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) - (H : ConditionFilter RowForcing) (generic : H.GenericFor (descentWitnessFamily p C B D x y)) - (hp : H.mem p) - (xy : ∀ g, H.mem (rowAction g p) → - Name.eval {q | H.mem q} (posetAction.act namePresentation g x) = - Name.eval {q | H.mem q} (posetAction.act namePresentation g y)) : - Name.eval {q | H.mem q} (posetAction.mix namePresentation - ((finalAction Column).fixSubgroup ((finalOrder Column).meet C B)) p x) = - Name.eval {q | H.mem q} x := by - apply posetAction.mix_capture_from_refinements namePresentation - ((finalAction Column).fixSubgroup ((finalOrder Column).meet C B)) - (Separated D ((finalOrder Column).meet C B)) p x y H generic hp xy - · exact rectangle_refinement p C B D x y bp cd bd sx sy - · intro g₁ hg₁ g₂ hg₂ r ref₁ _ - exact separation_refinement p ((finalOrder Column).meet C B) D bp - ((finalOrder Column).trans ((finalOrder Column).meet_le_left C B) cd) - g₁ hg₁ g₂ hg₂ r ref₁ - -theorem row_common_support (p : RowForcing) (C B D : FinalPoint Column) - (x y : Name namePresentation) (bp : Bounds p D) - (cd : (finalOrder Column).le C D) (bd : (finalOrder Column).le B D) - (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) - (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) - (hs : HereditarilySymmetric posetAction namePresentation (supportFamily Column) x) - (H : ConditionFilter RowForcing) (generic : H.GenericFor (descentWitnessFamily p C B D x y)) - (hp : H.mem p) - (xy : ∀ g, H.mem (rowAction g p) → - Name.eval {q | H.mem q} (posetAction.act namePresentation g x) = - Name.eval {q | H.mem q} (posetAction.act namePresentation g y)) : - ∃ z : Name namePresentation, - HereditarilySymmetric posetAction namePresentation (supportFamily Column) z ∧ - (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) ≤ - posetAction.stabilizer namePresentation z ∧ - Name.nameRank z ≤ Name.nameRank x ∧ - Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by - let K := (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) - refine ⟨posetAction.mix namePresentation K p x, - posetAction.mix_hs namePresentation (supportFamily Column) K - ⟨(finalOrder Column).meet C B, le_rfl⟩ p hs, ?_, - posetAction.nameRank_mix_le namePresentation K p x, ?_⟩ - · intro g hg - exact posetAction.mix_fixed namePresentation K p x hg - · exact row_mix_capture p C B D x y bp cd bd sx sy H generic hp xy - -end PartitionPilot.Forcing.Rows - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RowCopyRefinements + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Rows + +open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns +open Compression.RecursiveMaps.MainStage.OrdinalRun + +def descentWitnessFamily (p : RowForcing) (C B D : FinalPoint Column) + (x y : Name namePresentation) : Set (Set RowForcing) := + posetAction.copyWitnessFamily namePresentation + ((finalAction Column).fixSubgroup ((finalOrder Column).meet C B)) + (Separated D ((finalOrder Column).meet C B)) p x y + +theorem row_mix_capture (p : RowForcing) (C B D : FinalPoint Column) + (x y : Name namePresentation) (bp : Bounds p D) + (cd : (finalOrder Column).le C D) (bd : (finalOrder Column).le B D) + (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) + (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) + (H : ConditionFilter RowForcing) (generic : H.GenericFor (descentWitnessFamily p C B D x y)) + (hp : H.mem p) + (xy : ∀ g, H.mem (rowAction g p) → + Name.eval {q | H.mem q} (posetAction.act namePresentation g x) = + Name.eval {q | H.mem q} (posetAction.act namePresentation g y)) : + Name.eval {q | H.mem q} (posetAction.mix namePresentation + ((finalAction Column).fixSubgroup ((finalOrder Column).meet C B)) p x) = + Name.eval {q | H.mem q} x := by + apply posetAction.mix_capture_from_refinements namePresentation + ((finalAction Column).fixSubgroup ((finalOrder Column).meet C B)) + (Separated D ((finalOrder Column).meet C B)) p x y H generic hp xy + · exact rectangle_refinement p C B D x y bp cd bd sx sy + · intro g₁ hg₁ g₂ hg₂ r ref₁ _ + exact separation_refinement p ((finalOrder Column).meet C B) D bp + ((finalOrder Column).trans ((finalOrder Column).meet_le_left C B) cd) + g₁ hg₁ g₂ hg₂ r ref₁ + +theorem row_common_support (p : RowForcing) (C B D : FinalPoint Column) + (x y : Name namePresentation) (bp : Bounds p D) + (cd : (finalOrder Column).le C D) (bd : (finalOrder Column).le B D) + (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) + (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) + (hs : HereditarilySymmetric posetAction namePresentation (supportFamily Column) x) + (H : ConditionFilter RowForcing) (generic : H.GenericFor (descentWitnessFamily p C B D x y)) + (hp : H.mem p) + (xy : ∀ g, H.mem (rowAction g p) → + Name.eval {q | H.mem q} (posetAction.act namePresentation g x) = + Name.eval {q | H.mem q} (posetAction.act namePresentation g y)) : + ∃ z : Name namePresentation, + HereditarilySymmetric posetAction namePresentation (supportFamily Column) z ∧ + (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) ≤ + posetAction.stabilizer namePresentation z ∧ + Name.nameRank z ≤ Name.nameRank x ∧ + Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by + let K := (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) + refine ⟨posetAction.mix namePresentation K p x, + posetAction.mix_hs namePresentation (supportFamily Column) K + ⟨(finalOrder Column).meet C B, le_rfl⟩ p hs, ?_, + posetAction.nameRank_mix_le namePresentation K p x, ?_⟩ + · intro g hg + exact posetAction.mix_fixed namePresentation K p x hg + · exact row_mix_capture p C B D x y bp cd bd sx sy H generic hp xy + +end PartitionPilot.Forcing.Rows + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SmallCodedMeetActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SmallCodedMeetActions.lean index ee0f90994f697c3312fdc2c96a87e83c42c6f438..c4801e7c59ceba6f76d40e112d305c597c9f3ff9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SmallCodedMeetActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SmallCodedMeetActions.lean @@ -1,119 +1,119 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.DecodedMeetMaps - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -namespace MeetOrderCode - -variable {P r μ : ZFSet.{u}} (code : MeetOrderCode P r μ) - -noncomputable def smallMeet (x y : SetMembers P) : SetMembers P := - ((SetMembers.presentation P).product (SetMembers.presentation P)).decodeFunction - (SetMembers.presentation P) μ code.operation (x, y) - -theorem smallMeet_entry (x y : SetMembers P) : - ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) - (SetMembers.raw (code.smallMeet x y)) ∈ μ := - ((SetMembers.presentation P).product (SetMembers.presentation P)).decodeFunction_mem - (SetMembers.presentation P) μ code.operation (x, y) - -theorem smallMeet_eq_iff (x y z : SetMembers P) : - code.smallMeet x y = z ↔ ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) - (SetMembers.raw z) ∈ μ := - ((SetMembers.presentation P).product (SetMembers.presentation P)).decodeFunction_iff - (SetMembers.presentation P) μ code.operation (x, y) z - -noncomputable def toSmallMeetOrder : MeetOrder (SetMembers P) where - le x y := ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ r - meet := code.smallMeet - refl x := code.order.refl _ (SetMembers.raw_mem x) - trans {x y z} := code.order.trans _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) - _ (SetMembers.raw_mem z) - antisymm {x y} xy yx := SetMembers.raw_injective P - (code.order.antisymm _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) xy yx) - meet_le_left x y := code.lower_left _ _ _ (code.smallMeet_entry x y) - meet_le_right x y := code.lower_right _ _ _ (code.smallMeet_entry x y) - le_meet {x y z} := code.greatest _ _ _ _ (SetMembers.raw_mem x) (code.smallMeet_entry y z) - -theorem toSmallMeetOrder_le_iff (x y : SetMembers P) : - code.toSmallMeetOrder.le x y ↔ ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ r := Iff.rfl - -theorem toSmallMeetOrder_meet_entry (x y : SetMembers P) : - ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) - (SetMembers.raw (code.toSmallMeetOrder.meet x y)) ∈ μ := code.smallMeet_entry x y - -theorem toSmallMeetOrder_meet_eq_iff (x y z : SetMembers P) : - code.toSmallMeetOrder.meet x y = z ↔ - ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) (SetMembers.raw z) ∈ μ := - code.smallMeet_eq_iff x y z - -theorem smallMeet_graph_eq : - ((SetMembers.presentation P).product (SetMembers.presentation P)).graph - (SetMembers.presentation P) (fun xy => code.toSmallMeetOrder.meet xy.1 xy.2) = μ := - ((SetMembers.presentation P).product (SetMembers.presentation P)).graph_decodeFunction - (SetMembers.presentation P) μ code.operation - -end MeetOrderCode - -namespace PosetActionCode - -variable {G P m inv one r μ A : ZFSet.{u}} (action : PosetActionCode G P m one r A) - -noncomputable def toSmallMeetIso (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) - (g : SetMembers G) : Compression.MeetIso meet.toSmallMeetOrder meet.toSmallMeetOrder := by - letI := group.toGroup - exact { - toFun := action.act g - le_iff := fun x y => action.raw_order_iff group meet.order (SetMembers.raw_mem g) - (action.act_mem g x) (action.act_mem g y) - map_meet := fun x y => by - symm - apply (meet.smallMeet_eq_iff _ _ _).2 - exact action.raw_map_meet group meet (SetMembers.raw_mem g) (meet.smallMeet_entry x y) - (action.act_mem g x) (action.act_mem g y) (action.act_mem g (meet.smallMeet x y)) - inverse := action.act g⁻¹ - left_inverse := action.act_inv_left group g - right_inverse := action.act_inv_right group g } - -noncomputable def toOrderAction (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) : - letI := group.toGroup - Compression.RecursiveMaps.CosetGeometry.OrderAction (SetMembers G) meet.toSmallMeetOrder := by - letI := group.toGroup - exact { - iso := action.toSmallMeetIso group meet - one := action.act_one group - mul := action.act_mul group } - -theorem toOrderAction_entry (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) - (g : SetMembers G) (x : SetMembers P) : - letI := group.toGroup - ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) - (SetMembers.raw (((action.toOrderAction group meet).iso g).toFun x)) ∈ A := action.act_mem g x - -theorem toOrderAction_eq_iff (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) - (g : SetMembers G) (x y : SetMembers P) : - letI := group.toGroup - ((action.toOrderAction group meet).iso g).toFun x = y ↔ - ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) (SetMembers.raw y) ∈ A := - action.act_eq_iff g x y - -theorem toOrderAction_graph_eq (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) : - letI := group.toGroup - ((SetMembers.presentation G).product (SetMembers.presentation P)).graph (SetMembers.presentation P) - (fun gx => ((action.toOrderAction group meet).iso gx.1).toFun gx.2) = A := - ((SetMembers.presentation G).product (SetMembers.presentation P)).graph_decodeFunction - (SetMembers.presentation P) A action.function - -end PosetActionCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.DecodedMeetMaps + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +namespace MeetOrderCode + +variable {P r μ : ZFSet.{u}} (code : MeetOrderCode P r μ) + +noncomputable def smallMeet (x y : SetMembers P) : SetMembers P := + ((SetMembers.presentation P).product (SetMembers.presentation P)).decodeFunction + (SetMembers.presentation P) μ code.operation (x, y) + +theorem smallMeet_entry (x y : SetMembers P) : + ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) + (SetMembers.raw (code.smallMeet x y)) ∈ μ := + ((SetMembers.presentation P).product (SetMembers.presentation P)).decodeFunction_mem + (SetMembers.presentation P) μ code.operation (x, y) + +theorem smallMeet_eq_iff (x y z : SetMembers P) : + code.smallMeet x y = z ↔ ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) + (SetMembers.raw z) ∈ μ := + ((SetMembers.presentation P).product (SetMembers.presentation P)).decodeFunction_iff + (SetMembers.presentation P) μ code.operation (x, y) z + +noncomputable def toSmallMeetOrder : MeetOrder (SetMembers P) where + le x y := ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ r + meet := code.smallMeet + refl x := code.order.refl _ (SetMembers.raw_mem x) + trans {x y z} := code.order.trans _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) + _ (SetMembers.raw_mem z) + antisymm {x y} xy yx := SetMembers.raw_injective P + (code.order.antisymm _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) xy yx) + meet_le_left x y := code.lower_left _ _ _ (code.smallMeet_entry x y) + meet_le_right x y := code.lower_right _ _ _ (code.smallMeet_entry x y) + le_meet {x y z} := code.greatest _ _ _ _ (SetMembers.raw_mem x) (code.smallMeet_entry y z) + +theorem toSmallMeetOrder_le_iff (x y : SetMembers P) : + code.toSmallMeetOrder.le x y ↔ ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ r := Iff.rfl + +theorem toSmallMeetOrder_meet_entry (x y : SetMembers P) : + ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) + (SetMembers.raw (code.toSmallMeetOrder.meet x y)) ∈ μ := code.smallMeet_entry x y + +theorem toSmallMeetOrder_meet_eq_iff (x y z : SetMembers P) : + code.toSmallMeetOrder.meet x y = z ↔ + ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) (SetMembers.raw z) ∈ μ := + code.smallMeet_eq_iff x y z + +theorem smallMeet_graph_eq : + ((SetMembers.presentation P).product (SetMembers.presentation P)).graph + (SetMembers.presentation P) (fun xy => code.toSmallMeetOrder.meet xy.1 xy.2) = μ := + ((SetMembers.presentation P).product (SetMembers.presentation P)).graph_decodeFunction + (SetMembers.presentation P) μ code.operation + +end MeetOrderCode + +namespace PosetActionCode + +variable {G P m inv one r μ A : ZFSet.{u}} (action : PosetActionCode G P m one r A) + +noncomputable def toSmallMeetIso (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) + (g : SetMembers G) : Compression.MeetIso meet.toSmallMeetOrder meet.toSmallMeetOrder := by + letI := group.toGroup + exact { + toFun := action.act g + le_iff := fun x y => action.raw_order_iff group meet.order (SetMembers.raw_mem g) + (action.act_mem g x) (action.act_mem g y) + map_meet := fun x y => by + symm + apply (meet.smallMeet_eq_iff _ _ _).2 + exact action.raw_map_meet group meet (SetMembers.raw_mem g) (meet.smallMeet_entry x y) + (action.act_mem g x) (action.act_mem g y) (action.act_mem g (meet.smallMeet x y)) + inverse := action.act g⁻¹ + left_inverse := action.act_inv_left group g + right_inverse := action.act_inv_right group g } + +noncomputable def toOrderAction (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) : + letI := group.toGroup + Compression.RecursiveMaps.CosetGeometry.OrderAction (SetMembers G) meet.toSmallMeetOrder := by + letI := group.toGroup + exact { + iso := action.toSmallMeetIso group meet + one := action.act_one group + mul := action.act_mul group } + +theorem toOrderAction_entry (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) + (g : SetMembers G) (x : SetMembers P) : + letI := group.toGroup + ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) + (SetMembers.raw (((action.toOrderAction group meet).iso g).toFun x)) ∈ A := action.act_mem g x + +theorem toOrderAction_eq_iff (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) + (g : SetMembers G) (x y : SetMembers P) : + letI := group.toGroup + ((action.toOrderAction group meet).iso g).toFun x = y ↔ + ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) (SetMembers.raw y) ∈ A := + action.act_eq_iff g x y + +theorem toOrderAction_graph_eq (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) : + letI := group.toGroup + ((SetMembers.presentation G).product (SetMembers.presentation P)).graph (SetMembers.presentation P) + (fun gx => ((action.toOrderAction group meet).iso gx.1).toFun gx.2) = A := + ((SetMembers.presentation G).product (SetMembers.presentation P)).graph_decodeFunction + (SetMembers.presentation P) A action.function + +end PosetActionCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageOneEvaluatedAssignments.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageOneEvaluatedAssignments.lean index b8bd397402d48e241b592db8096e988cc0627aef..df670df2e1db772784541d82396bae4993370f87 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageOneEvaluatedAssignments.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageOneEvaluatedAssignments.lean @@ -1,184 +1,184 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -theorem stageOneCollisionTest_eval (Rf Rc u u' w w' : (M.nameDomain s).names) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (test : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' p) : - (Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u.val) = - Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u'.val) ↔ - Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val) = - Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w'.val)) := - M.refinementCollision_eval s _ H generic hp test - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem stageOneSingleTests_eval (C E : L) (U Rf Rc u w : (M.nameDomain s).names) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (tests : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p) : - (Name.eval {q | H.mem q} u.val ∈ Name.eval {q | H.mem q} U.val ∧ - Name.eval {q | H.mem q} w.val ∈ Name.eval {q | H.mem q} U.val) ∧ - (∀ v : L, E ≤ v → - (Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u.val) ∈ - Name.eval {q | H.mem q} (M.niceVisibilityName a s T (d.principalFix v)) ↔ - Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val) ∈ - Name.eval {q | H.mem q} (M.niceVisibilityName a s T (d.principalFix v)))) ∧ - (Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val) ∈ - Name.eval {q | H.mem q} (M.niceVisibilityName a s T (d.principalFix C)) → - ZFSet.pair (Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val)) - (Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u.val)) ∈ - Name.eval {q | H.mem q} (Name.refinementNaturalMap T valid U.val Rf.val Rc.val)) := - ⟨M.refinementActivity_eval s _ H generic hp tests.1, - fun v hv => M.refinementProfile_eval s _ H generic hp (tests.2.1 v hv), - M.refinementCompatibility_eval s _ H generic hp tests.2.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace Name -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} - -noncomputable def stageOneEvaluatedAssignments (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (H : Set P) (Rf Rc : Name s) (idx A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.range (fun uv : {uv : ↥T × ↥T // stageOneAssignment idx uv.1.val uv.2.val ∈ A} => - ZFSet.pair - (eval H (refinementClass T valid Rc ⟨uv.val.1.val, valid _ uv.val.1.property⟩)) - (eval H (refinementClass T valid Rf ⟨uv.val.2.val, valid _ uv.val.2.property⟩))) - -theorem mem_stageOneEvaluatedAssignments (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (H : Set P) (Rf Rc : Name s) (idx A z : ZFSet.{u}) : - z ∈ stageOneEvaluatedAssignments T valid H Rf Rc idx A ↔ - ∃ u : Name s, u.val ∈ T ∧ ∃ w : Name s, w.val ∈ T ∧ - stageOneAssignment idx u.val w.val ∈ A ∧ - z = ZFSet.pair (eval H (refinementClass T valid Rc u)) - (eval H (refinementClass T valid Rf w)) := by - rw [stageOneEvaluatedAssignments, ZFSet.mem_range] - constructor - · rintro ⟨uv, equal⟩ - exact ⟨⟨uv.val.1.val, valid _ uv.val.1.property⟩, uv.val.1.property, - ⟨uv.val.2.val, valid _ uv.val.2.property⟩, uv.val.2.property, uv.property, equal.symm⟩ - · rintro ⟨u, hu, w, hw, entry, equal⟩ - exact ⟨⟨(⟨u.val, hu⟩, ⟨w.val, hw⟩), entry⟩, equal.symm⟩ - -theorem pair_mem_stageOneEvaluatedAssignments (T : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (H : Set P) (Rf Rc : Name s) (idx A x y : ZFSet.{u}) : - ZFSet.pair x y ∈ stageOneEvaluatedAssignments T valid H Rf Rc idx A ↔ - ∃ u : Name s, u.val ∈ T ∧ ∃ w : Name s, w.val ∈ T ∧ - stageOneAssignment idx u.val w.val ∈ A ∧ - x = eval H (refinementClass T valid Rc u) ∧ - y = eval H (refinementClass T valid Rf w) := by - rw [mem_stageOneEvaluatedAssignments] - simp only [ZFSet.pair_inj] - -end Name -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem stageOneTests_partial_injection (T2 A : ZFSet.{u}) (p : P) - (tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 A p) - (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) (hp : H.mem p) : - let graph := Name.stageOneEvaluatedAssignments T valid {q | H.mem q} Rf.val Rc.val - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) A - PartialFunctionCode - (Name.eval {q | H.mem q} (Name.refinementQuotient T valid U.val Rc.val)) - (Name.eval {q | H.mem q} (Name.refinementQuotient T valid U.val Rf.val)) graph ∧ - (∀ x x' y, ZFSet.pair x y ∈ graph → ZFSet.pair x' y ∈ graph → x = x') := by - let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let hset : Set P := {q | H.mem q} - have clauses := tests C E U Rf Rc member - have active (u w : Name s) (hu : u.val ∈ T) (hw : w.val ∈ T) - (entry : stageOneAssignment idx u.val w.val ∈ A) : - Name.eval hset u ∈ Name.eval hset U.val ∧ Name.eval hset w ∈ Name.eval hset U.val := by - have single := clauses.1 ⟨u, M.transitive hT hu⟩ ⟨w, M.transitive hT hw⟩ hu hw entry - exact (M.stageOneSingleTests_eval s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc ⟨u, M.transitive hT hu⟩ ⟨w, M.transitive hT hw⟩ - H generic hp single).1 - have collide (u u' w w' : Name s) (hu : u.val ∈ T) (hu' : u'.val ∈ T) - (hw : w.val ∈ T) (hw' : w'.val ∈ T) - (entry : stageOneAssignment idx u.val w.val ∈ A) - (entry' : stageOneAssignment idx u'.val w'.val ∈ A) : - (Name.eval hset (Name.refinementClass T valid Rc.val u) = - Name.eval hset (Name.refinementClass T valid Rc.val u') ↔ - Name.eval hset (Name.refinementClass T valid Rf.val w) = - Name.eval hset (Name.refinementClass T valid Rf.val w')) := by - exact M.stageOneCollisionTest_eval s pairing unions powers separation collection carrier order hT valid - Rf Rc ⟨u, M.transitive hT hu⟩ ⟨u', M.transitive hT hu'⟩ - ⟨w, M.transitive hT hw⟩ ⟨w', M.transitive hT hw'⟩ H generic hp - (clauses.2 _ _ _ _ hu hu' hw hw' entry entry') - have familyGround := M.familySet_mem s ⊤ pairing unions powers separation hT - (M.transitive carrier (s.encode_mem ⊤)) valid - have forced := ((M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order ∅ T T2 valid familyGround C E U Rf Rc).1 member).2.2.2.2 - have values := M.refinementObjects_eval s pairing carrier hT valid familyGround U Rf Rc - H generic H.top_mem forced - refine ⟨⟨?_, ?_⟩, ?_⟩ - · intro z hz - obtain ⟨u, hu, w, hw, entry, rfl⟩ := - (Name.mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A z).1 hz - have inDomain := active u w hu hw entry - rw [values.coarse_quotient, values.fine_quotient] - apply ZFSet.pair_mem_prod.2 - constructor - · rw [values.coarse_class u hu] - exact Forcing.equivalenceClass_mem inDomain.1 - · rw [values.fine_class w hw] - exact Forcing.equivalenceClass_mem inDomain.2 - · intro x y z first second - obtain ⟨u, hu, w, hw, entry, xe, ye⟩ := - (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x y).1 first - obtain ⟨u', hu', w', hw', entry', xe', ze⟩ := - (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x z).1 second - exact ye.trans (((collide u u' w w' hu hu' hw hw' entry entry').1 (xe.symm.trans xe')).trans ze.symm) - · intro x x' y first second - obtain ⟨u, hu, w, hw, entry, xe, ye⟩ := - (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x y).1 first - obtain ⟨u', hu', w', hw', entry', xe', ye'⟩ := - (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x' y).1 second - exact xe.trans (((collide u u' w w' hu hu' hw hw' entry entry').2 (ye.symm.trans ye')).trans xe'.symm) - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +theorem stageOneCollisionTest_eval (Rf Rc u u' w w' : (M.nameDomain s).names) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (test : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' p) : + (Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u.val) = + Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u'.val) ↔ + Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val) = + Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w'.val)) := + M.refinementCollision_eval s _ H generic hp test + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem stageOneSingleTests_eval (C E : L) (U Rf Rc u w : (M.nameDomain s).names) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (tests : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p) : + (Name.eval {q | H.mem q} u.val ∈ Name.eval {q | H.mem q} U.val ∧ + Name.eval {q | H.mem q} w.val ∈ Name.eval {q | H.mem q} U.val) ∧ + (∀ v : L, E ≤ v → + (Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u.val) ∈ + Name.eval {q | H.mem q} (M.niceVisibilityName a s T (d.principalFix v)) ↔ + Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val) ∈ + Name.eval {q | H.mem q} (M.niceVisibilityName a s T (d.principalFix v)))) ∧ + (Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val) ∈ + Name.eval {q | H.mem q} (M.niceVisibilityName a s T (d.principalFix C)) → + ZFSet.pair (Name.eval {q | H.mem q} (Name.refinementClass T valid Rf.val w.val)) + (Name.eval {q | H.mem q} (Name.refinementClass T valid Rc.val u.val)) ∈ + Name.eval {q | H.mem q} (Name.refinementNaturalMap T valid U.val Rf.val Rc.val)) := + ⟨M.refinementActivity_eval s _ H generic hp tests.1, + fun v hv => M.refinementProfile_eval s _ H generic hp (tests.2.1 v hv), + M.refinementCompatibility_eval s _ H generic hp tests.2.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace Name +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} + +noncomputable def stageOneEvaluatedAssignments (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (H : Set P) (Rf Rc : Name s) (idx A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.range (fun uv : {uv : ↥T × ↥T // stageOneAssignment idx uv.1.val uv.2.val ∈ A} => + ZFSet.pair + (eval H (refinementClass T valid Rc ⟨uv.val.1.val, valid _ uv.val.1.property⟩)) + (eval H (refinementClass T valid Rf ⟨uv.val.2.val, valid _ uv.val.2.property⟩))) + +theorem mem_stageOneEvaluatedAssignments (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (H : Set P) (Rf Rc : Name s) (idx A z : ZFSet.{u}) : + z ∈ stageOneEvaluatedAssignments T valid H Rf Rc idx A ↔ + ∃ u : Name s, u.val ∈ T ∧ ∃ w : Name s, w.val ∈ T ∧ + stageOneAssignment idx u.val w.val ∈ A ∧ + z = ZFSet.pair (eval H (refinementClass T valid Rc u)) + (eval H (refinementClass T valid Rf w)) := by + rw [stageOneEvaluatedAssignments, ZFSet.mem_range] + constructor + · rintro ⟨uv, equal⟩ + exact ⟨⟨uv.val.1.val, valid _ uv.val.1.property⟩, uv.val.1.property, + ⟨uv.val.2.val, valid _ uv.val.2.property⟩, uv.val.2.property, uv.property, equal.symm⟩ + · rintro ⟨u, hu, w, hw, entry, equal⟩ + exact ⟨⟨(⟨u.val, hu⟩, ⟨w.val, hw⟩), entry⟩, equal.symm⟩ + +theorem pair_mem_stageOneEvaluatedAssignments (T : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (H : Set P) (Rf Rc : Name s) (idx A x y : ZFSet.{u}) : + ZFSet.pair x y ∈ stageOneEvaluatedAssignments T valid H Rf Rc idx A ↔ + ∃ u : Name s, u.val ∈ T ∧ ∃ w : Name s, w.val ∈ T ∧ + stageOneAssignment idx u.val w.val ∈ A ∧ + x = eval H (refinementClass T valid Rc u) ∧ + y = eval H (refinementClass T valid Rf w) := by + rw [mem_stageOneEvaluatedAssignments] + simp only [ZFSet.pair_inj] + +end Name +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem stageOneTests_partial_injection (T2 A : ZFSet.{u}) (p : P) + (tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 A p) + (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) (hp : H.mem p) : + let graph := Name.stageOneEvaluatedAssignments T valid {q | H.mem q} Rf.val Rc.val + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) A + PartialFunctionCode + (Name.eval {q | H.mem q} (Name.refinementQuotient T valid U.val Rc.val)) + (Name.eval {q | H.mem q} (Name.refinementQuotient T valid U.val Rf.val)) graph ∧ + (∀ x x' y, ZFSet.pair x y ∈ graph → ZFSet.pair x' y ∈ graph → x = x') := by + let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let hset : Set P := {q | H.mem q} + have clauses := tests C E U Rf Rc member + have active (u w : Name s) (hu : u.val ∈ T) (hw : w.val ∈ T) + (entry : stageOneAssignment idx u.val w.val ∈ A) : + Name.eval hset u ∈ Name.eval hset U.val ∧ Name.eval hset w ∈ Name.eval hset U.val := by + have single := clauses.1 ⟨u, M.transitive hT hu⟩ ⟨w, M.transitive hT hw⟩ hu hw entry + exact (M.stageOneSingleTests_eval s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc ⟨u, M.transitive hT hu⟩ ⟨w, M.transitive hT hw⟩ + H generic hp single).1 + have collide (u u' w w' : Name s) (hu : u.val ∈ T) (hu' : u'.val ∈ T) + (hw : w.val ∈ T) (hw' : w'.val ∈ T) + (entry : stageOneAssignment idx u.val w.val ∈ A) + (entry' : stageOneAssignment idx u'.val w'.val ∈ A) : + (Name.eval hset (Name.refinementClass T valid Rc.val u) = + Name.eval hset (Name.refinementClass T valid Rc.val u') ↔ + Name.eval hset (Name.refinementClass T valid Rf.val w) = + Name.eval hset (Name.refinementClass T valid Rf.val w')) := by + exact M.stageOneCollisionTest_eval s pairing unions powers separation collection carrier order hT valid + Rf Rc ⟨u, M.transitive hT hu⟩ ⟨u', M.transitive hT hu'⟩ + ⟨w, M.transitive hT hw⟩ ⟨w', M.transitive hT hw'⟩ H generic hp + (clauses.2 _ _ _ _ hu hu' hw hw' entry entry') + have familyGround := M.familySet_mem s ⊤ pairing unions powers separation hT + (M.transitive carrier (s.encode_mem ⊤)) valid + have forced := ((M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order ∅ T T2 valid familyGround C E U Rf Rc).1 member).2.2.2.2 + have values := M.refinementObjects_eval s pairing carrier hT valid familyGround U Rf Rc + H generic H.top_mem forced + refine ⟨⟨?_, ?_⟩, ?_⟩ + · intro z hz + obtain ⟨u, hu, w, hw, entry, rfl⟩ := + (Name.mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A z).1 hz + have inDomain := active u w hu hw entry + rw [values.coarse_quotient, values.fine_quotient] + apply ZFSet.pair_mem_prod.2 + constructor + · rw [values.coarse_class u hu] + exact Forcing.equivalenceClass_mem inDomain.1 + · rw [values.fine_class w hw] + exact Forcing.equivalenceClass_mem inDomain.2 + · intro x y z first second + obtain ⟨u, hu, w, hw, entry, xe, ye⟩ := + (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x y).1 first + obtain ⟨u', hu', w', hw', entry', xe', ze⟩ := + (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x z).1 second + exact ye.trans (((collide u u' w w' hu hu' hw hw' entry entry').1 (xe.symm.trans xe')).trans ze.symm) + · intro x x' y first second + obtain ⟨u, hu, w, hw, entry, xe, ye⟩ := + (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x y).1 first + obtain ⟨u', hu', w', hw', entry', xe', ye'⟩ := + (Name.pair_mem_stageOneEvaluatedAssignments T valid hset Rf.val Rc.val idx A x' y).1 second + exact xe.trans (((collide u u' w w' hu hu' hw hw' entry entry').2 (ye.symm.trans ye')).trans xe'.symm) + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageThreeAssignmentTestActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageThreeAssignmentTestActions.lean index 107829f00b23cd4cdb1f75c3bb478b25f65b2c1a..fca84a8b95958e639d9cb6bb12b8d8e8a509b451 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageThreeAssignmentTestActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageThreeAssignmentTestActions.lean @@ -1,120 +1,120 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementLevelThreeUnionGuards - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem stageThreeAssignments_disjoint {I0 I1 I2 T : ZFSet.{u}} - (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (third : RefinementIndexLevelCode I2 (natSetCode 2)) : - ∀ z, z ∈ stageOneAssignments (I0 ∪ I1) T → z ∈ stageOneAssignments I2 T → False := by - intro z old new - obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments (I0 ∪ I1) T z).1 old - have other := ((stageOneAssignment_mem_assignments I2 T i u w).1 new).1 - have apart := first.three_levels_disjoint second third - rcases ZFSet.mem_union.1 hi with h0 | h1 - · exact apart.2.1 i ⟨h0,other⟩ - · exact apart.2.2 i ⟨h1,other⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] -variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (a2 : PosetAction G P2) (s2 : Presentation P2) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 -local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T - -noncomputable def stageThreeAssignmentActionGraph (g : G) : ZFSet.{u} := - M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g ∪ - M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 g - -noncomputable def stageThreeAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := - M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A ∪ - M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 g A - -theorem stageThreeAssignmentImage_subset (g : G) (A : ZFSet.{u}) : - M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g A ⊆ J := by - rw [stageOneAssignments_union] - intro z member - rcases ZFSet.mem_union.1 member with old | new - · exact ZFSet.mem_union.2 (Or.inl (M.stageTwoAssignmentImage_subset a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A old)) - · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_subset a2 s2 b d (natSetCode 2) T T2 v2 v22 g A new)) - -theorem stageThreeAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : - M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g A ⊆ - M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g B := by - intro z member - rcases ZFSet.mem_union.1 member with old | new - · exact ZFSet.mem_union.2 (Or.inl (M.stageTwoAssignmentImage_mono a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g subset old)) - · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_mono a2 s2 b d (natSetCode 2) T T2 v2 v22 g subset new)) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) -variable (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (a2 : PosetAction G P2) (s2 : Presentation P2) -variable (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s2.carrier ∈ M.sets) (order : s2.conditionOrder ∈ M.sets) -variable (maps : a2.conditionMapFamily s2 t ∈ M.sets) (hT : T ∈ M.sets) -variable (closed : ∀ g (w : Name s2), w.val ∈ T → (a2.act s2 g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s2), w.val ∈ T2 → (a2.act s2 g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T v2).val ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a2 s2 b d base directed T v2) -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -variable (third : RefinementIndexLevelCode - (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) -include maps closed closed2 familyGround first second third - -theorem stageThreeTests_image_iff (g : G) (A : ZFSet.{u}) (p : P2) : - M.refinementLevelTests s2 pairing unions powers separation collection carrier order hT v2 - a2 b d base directed system (natSetCode 2) T2 - (M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g A) (a2.iso g p) ↔ - M.refinementLevelTests s2 pairing unions powers separation collection carrier order hT v2 - a2 b d base directed system (natSetCode 2) T2 A p := by - have union := M.refinementLevelTests_stageThreeUnion s2 pairing unions powers separation collection - carrier order hT v2 a2 b d base directed system first second third - (M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A) - (M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 g A) (a2.iso g p) - (M.stageTwoAssignmentImage_subset a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A) - exact union.trans (M.refinementLevelTests_image_iff a2 s2 b d (natSetCode 2) T T2 v2 v22 t - pairing unions powers separation collection carrier order maps hT closed closed2 familyGround - base directed system g A p) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementLevelThreeUnionGuards + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem stageThreeAssignments_disjoint {I0 I1 I2 T : ZFSet.{u}} + (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (third : RefinementIndexLevelCode I2 (natSetCode 2)) : + ∀ z, z ∈ stageOneAssignments (I0 ∪ I1) T → z ∈ stageOneAssignments I2 T → False := by + intro z old new + obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments (I0 ∪ I1) T z).1 old + have other := ((stageOneAssignment_mem_assignments I2 T i u w).1 new).1 + have apart := first.three_levels_disjoint second third + rcases ZFSet.mem_union.1 hi with h0 | h1 + · exact apart.2.1 i ⟨h0,other⟩ + · exact apart.2.2 i ⟨h1,other⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] +variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (a2 : PosetAction G P2) (s2 : Presentation P2) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 +local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T + +noncomputable def stageThreeAssignmentActionGraph (g : G) : ZFSet.{u} := + M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g ∪ + M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 g + +noncomputable def stageThreeAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := + M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A ∪ + M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 g A + +theorem stageThreeAssignmentImage_subset (g : G) (A : ZFSet.{u}) : + M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g A ⊆ J := by + rw [stageOneAssignments_union] + intro z member + rcases ZFSet.mem_union.1 member with old | new + · exact ZFSet.mem_union.2 (Or.inl (M.stageTwoAssignmentImage_subset a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A old)) + · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_subset a2 s2 b d (natSetCode 2) T T2 v2 v22 g A new)) + +theorem stageThreeAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : + M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g A ⊆ + M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g B := by + intro z member + rcases ZFSet.mem_union.1 member with old | new + · exact ZFSet.mem_union.2 (Or.inl (M.stageTwoAssignmentImage_mono a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g subset old)) + · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_mono a2 s2 b d (natSetCode 2) T T2 v2 v22 g subset new)) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) +variable (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (a2 : PosetAction G P2) (s2 : Presentation P2) +variable (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s2.carrier ∈ M.sets) (order : s2.conditionOrder ∈ M.sets) +variable (maps : a2.conditionMapFamily s2 t ∈ M.sets) (hT : T ∈ M.sets) +variable (closed : ∀ g (w : Name s2), w.val ∈ T → (a2.act s2 g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s2), w.val ∈ T2 → (a2.act s2 g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T v2).val ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a2 s2 b d base directed T v2) +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +variable (third : RefinementIndexLevelCode + (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) +include maps closed closed2 familyGround first second third + +theorem stageThreeTests_image_iff (g : G) (A : ZFSet.{u}) (p : P2) : + M.refinementLevelTests s2 pairing unions powers separation collection carrier order hT v2 + a2 b d base directed system (natSetCode 2) T2 + (M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 g A) (a2.iso g p) ↔ + M.refinementLevelTests s2 pairing unions powers separation collection carrier order hT v2 + a2 b d base directed system (natSetCode 2) T2 A p := by + have union := M.refinementLevelTests_stageThreeUnion s2 pairing unions powers separation collection + carrier order hT v2 a2 b d base directed system first second third + (M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A) + (M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 g A) (a2.iso g p) + (M.stageTwoAssignmentImage_subset a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A) + exact union.trans (M.refinementLevelTests_image_iff a2 s2 b d (natSetCode 2) T T2 v2 v22 t + pairing unions powers separation collection carrier order maps hT closed closed2 familyGround + base directed system g A p) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoAssignmentTestActions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoAssignmentTestActions.lean index 5fd3b53e6bd6871d44bc8b6476b162a7a8fd4c47..39342fb6125cb3f79ccec4c62928a260312a6ae3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoAssignmentTestActions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoAssignmentTestActions.lean @@ -1,212 +1,212 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementAssignmentImages -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementRawTestMonotonicity - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - -include maps closed closed2 familyGround in -theorem refinementLevelTests_image_iff (g : G) (A : ZFSet.{u}) (p : P) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) (a.iso g p) ↔ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A p := by - have term (w : (M.nameDomain s).names) : (move g w).val.val ∈ T ↔ w.val.val ∈ T := by - constructor - · intro member - have original := closed g⁻¹ (a.act s g w.val) member - simpa only [a.act_inv_left] using original - · exact closed g w.val - have index := M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps level T T2 valid closed closed2 familyGround g - have image := M.refinementAssignmentImage_entry a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g - have single := M.stageOneSingleTests_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed b d base directed system g - have collision := M.stageOneCollisionTest_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed g - constructor - · intro tests C E U Rf Rc - dsimp only - intro member - obtain ⟨hs, hc⟩ := tests (d.iso g C) (d.iso g E) (move g U) (move g Rf) (move g Rc) - ((index C E U Rf Rc).mpr member) - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - exact (single C E U Rf Rc u w p).mp - (hs (move g u) (move g w) ((term u).mpr hu) ((term w).mpr hw) - ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry)) - · intro u u' w w' hu hu' hw hw' entry entry' - exact (collision Rf Rc u u' w w' p).mp - (hc (move g u) (move g u') (move g w) (move g w') - ((term u).mpr hu) ((term u').mpr hu') ((term w).mpr hw) ((term w').mpr hw') - ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry) - ((image C E U Rf Rc u'.val w'.val member hu' hw' A).mpr entry')) - · intro tests C E U Rf Rc - obtain ⟨C, rfl⟩ := (d.iso g).surjective C - obtain ⟨E, rfl⟩ := (d.iso g).surjective E - obtain ⟨U, rfl⟩ := (move g).surjective U - obtain ⟨Rf, rfl⟩ := (move g).surjective Rf - obtain ⟨Rc, rfl⟩ := (move g).surjective Rc - dsimp only - intro member - have old := (index C E U Rf Rc).mp member - obtain ⟨hs, hc⟩ := tests C E U Rf Rc old - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - obtain ⟨u, rfl⟩ := (move g).surjective u - obtain ⟨w, rfl⟩ := (move g).surjective w - have hu := (term u).mp hu - have hw := (term w).mp hw - exact (single C E U Rf Rc u w p).mpr - (hs u w hu hw ((image C E U Rf Rc u.val w.val old hu hw A).mp entry)) - · intro u u' w w' hu hu' hw hw' entry entry' - obtain ⟨u, rfl⟩ := (move g).surjective u - obtain ⟨u', rfl⟩ := (move g).surjective u' - obtain ⟨w, rfl⟩ := (move g).surjective w - obtain ⟨w', rfl⟩ := (move g).surjective w' - have hu := (term u).mp hu - have hu' := (term u').mp hu' - have hw := (term w).mp hw - have hw' := (term w').mp hw' - exact (collision Rf Rc u u' w w' p).mpr - (hc u u' w w' hu hu' hw hw' - ((image C E U Rf Rc u.val w.val old hu hw A).mp entry) - ((image C E U Rf Rc u'.val w'.val old hu' hw' A).mp entry')) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem stageOneAssignments_union (I0 I1 T : ZFSet.{u}) : - stageOneAssignments (I0 ∪ I1) T = stageOneAssignments I0 T ∪ stageOneAssignments I1 T := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments (I0 ∪ I1) T z).1 member - rcases ZFSet.mem_union.1 hi with left | right - · exact ZFSet.mem_union.2 (Or.inl ((stageOneAssignment_mem_assignments I0 T i u w).2 ⟨left,hu,hw⟩)) - · exact ZFSet.mem_union.2 (Or.inr ((stageOneAssignment_mem_assignments I1 T i u w).2 ⟨right,hu,hw⟩)) - · intro member - rcases ZFSet.mem_union.1 member with left | right - · obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I0 T z).1 left - exact (stageOneAssignment_mem_assignments (I0 ∪ I1) T i u w).2 ⟨ZFSet.mem_union.2 (Or.inl hi),hu,hw⟩ - · obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I1 T z).1 right - exact (stageOneAssignment_mem_assignments (I0 ∪ I1) T i u w).2 ⟨ZFSet.mem_union.2 (Or.inr hi),hu,hw⟩ - -theorem stageTwoAssignments_disjoint {I0 I1 T : ZFSet.{u}} - (first : RefinementIndexLevelCode I0 ∅) (second : RefinementIndexLevelCode I1 (natSetCode 1)) : - ∀ z, z ∈ stageOneAssignments I0 T → z ∈ stageOneAssignments I1 T → False := by - intro z left right - obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I0 T z).1 left - have other := ((stageOneAssignment_mem_assignments I1 T i u w).1 right).1 - exact first.disjoint second (fun equal => Nat.zero_ne_one (natSetCode_injective equal)) i ⟨hi,other⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {G P0 P1 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "J" => stageOneAssignments (I0 ∪ I1) T - -noncomputable def stageTwoAssignmentActionGraph (g : G) : ZFSet.{u} := - M.refinementAssignmentActionGraph a0 s0 b d ∅ T T2 v0 v02 g ∪ - M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12 g - -noncomputable def stageTwoAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := - M.refinementAssignmentImage a0 s0 b d ∅ T T2 v0 v02 g A ∪ - M.refinementAssignmentImage a1 s1 b d (natSetCode 1) T T2 v1 v12 g A - -theorem stageTwoAssignmentImage_subset (g : G) (A : ZFSet.{u}) : - M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A ⊆ J := by - rw [stageOneAssignments_union] - intro z member - rcases ZFSet.mem_union.1 member with left | right - · exact ZFSet.mem_union.2 (Or.inl (M.refinementAssignmentImage_subset a0 s0 b d ∅ T T2 v0 v02 g A left)) - · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_subset a1 s1 b d (natSetCode 1) T T2 v1 v12 g A right)) - -theorem stageTwoAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : - M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A ⊆ - M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g B := by - intro z member - rcases ZFSet.mem_union.1 member with left | right - · exact ZFSet.mem_union.2 (Or.inl (M.refinementAssignmentImage_mono a0 s0 b d ∅ T T2 v0 v02 g subset left)) - · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_mono a1 s1 b d (natSetCode 1) T T2 v1 v12 g subset right)) - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P0 P1 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) -variable (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s1.carrier ∈ M.sets) (order : s1.conditionOrder ∈ M.sets) -variable (maps : a1.conditionMapFamily s1 t ∈ M.sets) (hT : T ∈ M.sets) -variable (closed : ∀ g (w : Name s1), w.val ∈ T → (a1.act s1 g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s1), w.val ∈ T2 → (a1.act s1 g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T v1).val ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a1 s1 b d base directed T v1) -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -include maps closed closed2 familyGround first second - -theorem stageTwoTests_image_iff (g : G) (A : ZFSet.{u}) (p : P1) : - M.refinementLevelTests s1 pairing unions powers separation collection carrier order hT v1 - a1 b d base directed system (natSetCode 1) T2 - (M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A) (a1.iso g p) ↔ - M.refinementLevelTests s1 pairing unions powers separation collection carrier order hT v1 - a1 b d base directed system (natSetCode 1) T2 A p := by - have union := M.refinementLevelTests_stageTwoUnion s1 pairing unions powers separation collection - carrier order hT v1 a1 b d base directed system first second - (M.refinementAssignmentImage a0 s0 b d ∅ T T2 v0 v02 g A) - (M.refinementAssignmentImage a1 s1 b d (natSetCode 1) T T2 v1 v12 g A) (a1.iso g p) - (M.refinementAssignmentImage_subset a0 s0 b d ∅ T T2 v0 v02 g A) - exact union.trans (M.refinementLevelTests_image_iff a1 s1 b d (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier order maps hT closed closed2 familyGround - base directed system g A p) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementAssignmentImages +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementRawTestMonotonicity + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "move" => M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + +include maps closed closed2 familyGround in +theorem refinementLevelTests_image_iff (g : G) (A : ZFSet.{u}) (p : P) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 (M.refinementAssignmentImage a s b d level T T2 valid valid2 g A) (a.iso g p) ↔ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A p := by + have term (w : (M.nameDomain s).names) : (move g w).val.val ∈ T ↔ w.val.val ∈ T := by + constructor + · intro member + have original := closed g⁻¹ (a.act s g w.val) member + simpa only [a.act_inv_left] using original + · exact closed g w.val + have index := M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps level T T2 valid closed closed2 familyGround g + have image := M.refinementAssignmentImage_entry a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g + have single := M.stageOneSingleTests_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed b d base directed system g + have collision := M.stageOneCollisionTest_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed g + constructor + · intro tests C E U Rf Rc + dsimp only + intro member + obtain ⟨hs, hc⟩ := tests (d.iso g C) (d.iso g E) (move g U) (move g Rf) (move g Rc) + ((index C E U Rf Rc).mpr member) + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + exact (single C E U Rf Rc u w p).mp + (hs (move g u) (move g w) ((term u).mpr hu) ((term w).mpr hw) + ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry)) + · intro u u' w w' hu hu' hw hw' entry entry' + exact (collision Rf Rc u u' w w' p).mp + (hc (move g u) (move g u') (move g w) (move g w') + ((term u).mpr hu) ((term u').mpr hu') ((term w).mpr hw) ((term w').mpr hw') + ((image C E U Rf Rc u.val w.val member hu hw A).mpr entry) + ((image C E U Rf Rc u'.val w'.val member hu' hw' A).mpr entry')) + · intro tests C E U Rf Rc + obtain ⟨C, rfl⟩ := (d.iso g).surjective C + obtain ⟨E, rfl⟩ := (d.iso g).surjective E + obtain ⟨U, rfl⟩ := (move g).surjective U + obtain ⟨Rf, rfl⟩ := (move g).surjective Rf + obtain ⟨Rc, rfl⟩ := (move g).surjective Rc + dsimp only + intro member + have old := (index C E U Rf Rc).mp member + obtain ⟨hs, hc⟩ := tests C E U Rf Rc old + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + obtain ⟨u, rfl⟩ := (move g).surjective u + obtain ⟨w, rfl⟩ := (move g).surjective w + have hu := (term u).mp hu + have hw := (term w).mp hw + exact (single C E U Rf Rc u w p).mpr + (hs u w hu hw ((image C E U Rf Rc u.val w.val old hu hw A).mp entry)) + · intro u u' w w' hu hu' hw hw' entry entry' + obtain ⟨u, rfl⟩ := (move g).surjective u + obtain ⟨u', rfl⟩ := (move g).surjective u' + obtain ⟨w, rfl⟩ := (move g).surjective w + obtain ⟨w', rfl⟩ := (move g).surjective w' + have hu := (term u).mp hu + have hu' := (term u').mp hu' + have hw := (term w).mp hw + have hw' := (term w').mp hw' + exact (collision Rf Rc u u' w w' p).mpr + (hc u u' w w' hu hu' hw hw' + ((image C E U Rf Rc u.val w.val old hu hw A).mp entry) + ((image C E U Rf Rc u'.val w'.val old hu' hw' A).mp entry')) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem stageOneAssignments_union (I0 I1 T : ZFSet.{u}) : + stageOneAssignments (I0 ∪ I1) T = stageOneAssignments I0 T ∪ stageOneAssignments I1 T := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments (I0 ∪ I1) T z).1 member + rcases ZFSet.mem_union.1 hi with left | right + · exact ZFSet.mem_union.2 (Or.inl ((stageOneAssignment_mem_assignments I0 T i u w).2 ⟨left,hu,hw⟩)) + · exact ZFSet.mem_union.2 (Or.inr ((stageOneAssignment_mem_assignments I1 T i u w).2 ⟨right,hu,hw⟩)) + · intro member + rcases ZFSet.mem_union.1 member with left | right + · obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I0 T z).1 left + exact (stageOneAssignment_mem_assignments (I0 ∪ I1) T i u w).2 ⟨ZFSet.mem_union.2 (Or.inl hi),hu,hw⟩ + · obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I1 T z).1 right + exact (stageOneAssignment_mem_assignments (I0 ∪ I1) T i u w).2 ⟨ZFSet.mem_union.2 (Or.inr hi),hu,hw⟩ + +theorem stageTwoAssignments_disjoint {I0 I1 T : ZFSet.{u}} + (first : RefinementIndexLevelCode I0 ∅) (second : RefinementIndexLevelCode I1 (natSetCode 1)) : + ∀ z, z ∈ stageOneAssignments I0 T → z ∈ stageOneAssignments I1 T → False := by + intro z left right + obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I0 T z).1 left + have other := ((stageOneAssignment_mem_assignments I1 T i u w).1 right).1 + exact first.disjoint second (fun equal => Nat.zero_ne_one (natSetCode_injective equal)) i ⟨hi,other⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {G P0 P1 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "J" => stageOneAssignments (I0 ∪ I1) T + +noncomputable def stageTwoAssignmentActionGraph (g : G) : ZFSet.{u} := + M.refinementAssignmentActionGraph a0 s0 b d ∅ T T2 v0 v02 g ∪ + M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12 g + +noncomputable def stageTwoAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := + M.refinementAssignmentImage a0 s0 b d ∅ T T2 v0 v02 g A ∪ + M.refinementAssignmentImage a1 s1 b d (natSetCode 1) T T2 v1 v12 g A + +theorem stageTwoAssignmentImage_subset (g : G) (A : ZFSet.{u}) : + M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A ⊆ J := by + rw [stageOneAssignments_union] + intro z member + rcases ZFSet.mem_union.1 member with left | right + · exact ZFSet.mem_union.2 (Or.inl (M.refinementAssignmentImage_subset a0 s0 b d ∅ T T2 v0 v02 g A left)) + · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_subset a1 s1 b d (natSetCode 1) T T2 v1 v12 g A right)) + +theorem stageTwoAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : + M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A ⊆ + M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g B := by + intro z member + rcases ZFSet.mem_union.1 member with left | right + · exact ZFSet.mem_union.2 (Or.inl (M.refinementAssignmentImage_mono a0 s0 b d ∅ T T2 v0 v02 g subset left)) + · exact ZFSet.mem_union.2 (Or.inr (M.refinementAssignmentImage_mono a1 s1 b d (natSetCode 1) T T2 v1 v12 g subset right)) + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P0 P1 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) +variable (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s1.carrier ∈ M.sets) (order : s1.conditionOrder ∈ M.sets) +variable (maps : a1.conditionMapFamily s1 t ∈ M.sets) (hT : T ∈ M.sets) +variable (closed : ∀ g (w : Name s1), w.val ∈ T → (a1.act s1 g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s1), w.val ∈ T2 → (a1.act s1 g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T v1).val ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a1 s1 b d base directed T v1) +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +include maps closed closed2 familyGround first second + +theorem stageTwoTests_image_iff (g : G) (A : ZFSet.{u}) (p : P1) : + M.refinementLevelTests s1 pairing unions powers separation collection carrier order hT v1 + a1 b d base directed system (natSetCode 1) T2 + (M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A) (a1.iso g p) ↔ + M.refinementLevelTests s1 pairing unions powers separation collection carrier order hT v1 + a1 b d base directed system (natSetCode 1) T2 A p := by + have union := M.refinementLevelTests_stageTwoUnion s1 pairing unions powers separation collection + carrier order hT v1 a1 b d base directed system first second + (M.refinementAssignmentImage a0 s0 b d ∅ T T2 v0 v02 g A) + (M.refinementAssignmentImage a1 s1 b d (natSetCode 1) T T2 v1 v12 g A) (a1.iso g p) + (M.refinementAssignmentImage_subset a0 s0 b d ∅ T T2 v0 v02 g A) + exact union.trans (M.refinementLevelTests_image_iff a1 s1 b d (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier order maps hT closed closed2 familyGround + base directed system g A p) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoConditionUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoConditionUnions.lean index ea7c9e74d4868aa693a94f96e1f855521d39d4e3..d9ca2591e474634781959f5e601618e3dc369012 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoConditionUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StageTwoConditionUnions.lean @@ -1,109 +1,109 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoConditionTop - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -local notation "levels" => stageTwoAssignmentLevels I0 (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T -local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid)) T) ZFSet.omega -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) (hI1 : (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) ∈ M.sets) -noncomputable def chainUnion (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : Condition := by - have old := (M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q) - have memberq : F.assignments q ∈ B := by - apply (M.mem_groundSmallSubsets _ _ _).2 - refine ⟨old.1, ?_, old.2.2⟩ - intro z hz - obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 (old.2.1 hz) - exact (stageOneAssignment_mem_assignments _ T t u w).2 - ⟨ZFSet.mem_union.2 (Or.inl ht), hu, hw⟩ - have graph := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT - have hOne := M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega 1) - have lowerCut := stageTwoAssignmentSplice_lower_eq first second (stageOneAssignmentUnion (fun n => (seq n).assignments)) old.2.1 - exact { - row := F.row q - assignments := assignmentSplice levels (natSetCode 1) (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) - assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation - infinite choice graph hOne memberq small - lower := q - lower_code := by rw [lowerCut]; exact F.encode q - tests := (M.refinementLevelTests_stageTwoSplice s pairing unions powers separation collection - carrier order hT valid a b d base directed system first second (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) q).2 - (M.refinementLevelTests_union s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 - (fun n => (seq n).assignments) (fun n => (seq n).lower) q - (fun _ _ less => (decreasing less).2) below (fun n => (seq n).tests)) } - -local notation "bound" => chainUnion M c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system F first second infinite choice hI0 hI1 - -theorem chainUnion_row (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : - (bound seq decreasing q below small).row = F.row q := rfl - -theorem chainUnion_assignments (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : - (bound seq decreasing q below small).assignments = - assignmentSplice levels (natSetCode 1) (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) := rfl - -theorem chainUnion_lower (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : - (bound seq decreasing q below small).lower = q := rfl - -theorem chainUnion_le (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) - (below : ∀ n, q ≤ (seq n).lower) - (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) (n : Nat) : - bound seq decreasing q below small ≤ seq n := by - have rows := ((F.le_iff q (seq n).lower).1 (below n)).1 - have rowEqual := lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F (seq n) - have contains : (stageOneAssignmentUnion (fun n => (seq n).assignments)) ⊆ assignmentSplice levels (natSetCode 1) (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) := by - apply assignmentSplice_extends - rw [stageTwoAssignmentCut_one_eq first second - ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1] - intro z hz - obtain ⟨member, level⟩ := (mem_assignmentCut levels (natSetCode 1) (stageOneAssignmentUnion (fun n => (seq n).assignments)) z).1 hz - obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion (fun n => (seq n).assignments) z).1 member - have lowerMember : z ∈ F.assignments (seq m).lower := by - rw [lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection - carrier order hT base directed system F (seq m)] - exact (mem_assignmentCut levels (natSetCode 1) (seq m).assignments z).2 ⟨hm, level⟩ - exact ((F.le_iff q (seq m).lower).1 (below m)).2 lowerMember - exact ⟨rows.trans_eq rowEqual, fun z hz => contains - (stageOneAssignmentUnion_contains (fun n => (seq n).assignments) n hz)⟩ - -end StageTwoCondition -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoConditionTop + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +local notation "levels" => stageTwoAssignmentLevels I0 (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T +local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid)) T) ZFSet.omega +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) (hI1 : (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) ∈ M.sets) +noncomputable def chainUnion (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : Condition := by + have old := (M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q) + have memberq : F.assignments q ∈ B := by + apply (M.mem_groundSmallSubsets _ _ _).2 + refine ⟨old.1, ?_, old.2.2⟩ + intro z hz + obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 (old.2.1 hz) + exact (stageOneAssignment_mem_assignments _ T t u w).2 + ⟨ZFSet.mem_union.2 (Or.inl ht), hu, hw⟩ + have graph := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT + have hOne := M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega 1) + have lowerCut := stageTwoAssignmentSplice_lower_eq first second (stageOneAssignmentUnion (fun n => (seq n).assignments)) old.2.1 + exact { + row := F.row q + assignments := assignmentSplice levels (natSetCode 1) (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) + assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation + infinite choice graph hOne memberq small + lower := q + lower_code := by rw [lowerCut]; exact F.encode q + tests := (M.refinementLevelTests_stageTwoSplice s pairing unions powers separation collection + carrier order hT valid a b d base directed system first second (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) q).2 + (M.refinementLevelTests_union s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 + (fun n => (seq n).assignments) (fun n => (seq n).lower) q + (fun _ _ less => (decreasing less).2) below (fun n => (seq n).tests)) } + +local notation "bound" => chainUnion M c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system F first second infinite choice hI0 hI1 + +theorem chainUnion_row (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : + (bound seq decreasing q below small).row = F.row q := rfl + +theorem chainUnion_assignments (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : + (bound seq decreasing q below small).assignments = + assignmentSplice levels (natSetCode 1) (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) := rfl + +theorem chainUnion_lower (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) : + (bound seq decreasing q below small).lower = q := rfl + +theorem chainUnion_le (seq : Nat → Condition) (decreasing : Antitone seq) (q : P) + (below : ∀ n, q ≤ (seq n).lower) + (small : stageOneAssignmentUnion (fun n => (seq n).assignments) ∈ B) (n : Nat) : + bound seq decreasing q below small ≤ seq n := by + have rows := ((F.le_iff q (seq n).lower).1 (below n)).1 + have rowEqual := lower_row M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F (seq n) + have contains : (stageOneAssignmentUnion (fun n => (seq n).assignments)) ⊆ assignmentSplice levels (natSetCode 1) (F.assignments q) (stageOneAssignmentUnion (fun n => (seq n).assignments)) := by + apply assignmentSplice_extends + rw [stageTwoAssignmentCut_one_eq first second + ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1] + intro z hz + obtain ⟨member, level⟩ := (mem_assignmentCut levels (natSetCode 1) (stageOneAssignmentUnion (fun n => (seq n).assignments)) z).1 hz + obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion (fun n => (seq n).assignments) z).1 member + have lowerMember : z ∈ F.assignments (seq m).lower := by + rw [lower_assignments M c I0 a s b d T T2 valid pairing unions powers separation collection + carrier order hT base directed system F (seq m)] + exact (mem_assignmentCut levels (natSetCode 1) (seq m).assignments z).2 ⟨hm, level⟩ + exact ((F.le_iff q (seq m).lower).1 (below m)).2 lowerMember + exact ⟨rows.trans_eq rowEqual, fun z hz => contains + (stageOneAssignmentUnion_contains (fun n => (seq n).assignments) n hz)⟩ + +end StageTwoCondition +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionGraphs.lean index 7be667a4a0cef4b49718090d59595549fad38ccc..b549f84ace53062cc2579762eea5c698fecd9eb5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionGraphs.lean @@ -1,92 +1,92 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralRefinementHistories - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def structuralAssignments (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := - stageOneAssignments (refinementDataHistoryIndices stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) T - -theorem rawStageRefinementAssignmentActionGraph_bound - (g G nodes nodeOrder nodeAction basis T T2 stages history level P order top action : ZFSet.{u}) - (hl : level ∈ stages) (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) : - M.rawStageRefinementAssignmentActionGraph g P order top action G nodes nodeOrder nodeAction basis T T2 level ⊆ - ZFSet.prod (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) := by - let data := M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level - have packed : ZFSet.pair level (refinementFormulaDataCode data) ∈ - M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history := - (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨hl, P, order, top, action, stored, rfl⟩ - have includeIndex : data 0 ⊆ refinementDataHistoryIndices stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - intro i hi - exact (mem_refinementDataHistoryIndices _ _ _).2 ⟨level, hl, data, packed, hi⟩ - have includeAssignments : stageOneAssignments (data 0) T ⊆ - M.structuralAssignments G nodes nodeOrder basis T T2 stages history := by - intro x hx - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 hx - exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨includeIndex hi, hu, hw⟩ - intro z hz - unfold rawStageRefinementAssignmentActionGraph rawRefinementAssignmentActionGraph relationProduct at hz - have bound : z ∈ ZFSet.prod (stageOneAssignments (data 0) T) (stageOneAssignments (data 0) T) := - (ZFSet.mem_sep.1 hz).1 - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 bound - exact ZFSet.pair_mem_prod.2 ⟨includeAssignments hx, includeAssignments hy⟩ - -noncomputable def structuralAssignmentActionGraph - (G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := - let J := M.structuralAssignments G nodes nodeOrder basis T T2 stages history - ZFSet.sep (fun z => ∃ g ∈ G, ∃ x y, z = ZFSet.pair (ZFSet.pair g x) y ∧ - ∃ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action - G nodes nodeOrder nodeAction basis T T2 level) - (ZFSet.prod (ZFSet.prod G J) J) - -theorem mem_structuralAssignmentActionGraph - (G nodes nodeOrder nodeAction basis T T2 stages history z : ZFSet.{u}) : - z ∈ M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ↔ - ∃ g ∈ G, ∃ x y, z = ZFSet.pair (ZFSet.pair g x) y ∧ - ∃ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action - G nodes nodeOrder nodeAction basis T T2 level := by - rw [structuralAssignmentActionGraph, ZFSet.mem_sep] - constructor - · exact And.right - · rintro ⟨g, hg, x, y, rfl, level, hl, P, order, top, action, stored, edge⟩ - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_bound g G nodes nodeOrder nodeAction basis T T2 - stages history level P order top action hl stored edge) - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, bounds.1⟩, bounds.2⟩, - g, hg, x, y, rfl, level, hl, P, order, top, action, stored, edge⟩ - -theorem pair_mem_structuralAssignmentActionGraph - (G nodes nodeOrder nodeAction basis T T2 stages history g x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ↔ - g ∈ G ∧ ∃ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action - G nodes nodeOrder nodeAction basis T T2 level := by - rw [M.mem_structuralAssignmentActionGraph] - constructor - · rintro ⟨g', hg, x', y', equal, rest⟩ - obtain ⟨first, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first - exact ⟨hg, rest⟩ - · rintro ⟨hg, rest⟩ - exact ⟨g, hg, x, y, rfl, rest⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralRefinementHistories + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def structuralAssignments (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := + stageOneAssignments (refinementDataHistoryIndices stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) T + +theorem rawStageRefinementAssignmentActionGraph_bound + (g G nodes nodeOrder nodeAction basis T T2 stages history level P order top action : ZFSet.{u}) + (hl : level ∈ stages) (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) : + M.rawStageRefinementAssignmentActionGraph g P order top action G nodes nodeOrder nodeAction basis T T2 level ⊆ + ZFSet.prod (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) := by + let data := M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level + have packed : ZFSet.pair level (refinementFormulaDataCode data) ∈ + M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history := + (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨hl, P, order, top, action, stored, rfl⟩ + have includeIndex : data 0 ⊆ refinementDataHistoryIndices stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + intro i hi + exact (mem_refinementDataHistoryIndices _ _ _).2 ⟨level, hl, data, packed, hi⟩ + have includeAssignments : stageOneAssignments (data 0) T ⊆ + M.structuralAssignments G nodes nodeOrder basis T T2 stages history := by + intro x hx + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 hx + exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨includeIndex hi, hu, hw⟩ + intro z hz + unfold rawStageRefinementAssignmentActionGraph rawRefinementAssignmentActionGraph relationProduct at hz + have bound : z ∈ ZFSet.prod (stageOneAssignments (data 0) T) (stageOneAssignments (data 0) T) := + (ZFSet.mem_sep.1 hz).1 + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 bound + exact ZFSet.pair_mem_prod.2 ⟨includeAssignments hx, includeAssignments hy⟩ + +noncomputable def structuralAssignmentActionGraph + (G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := + let J := M.structuralAssignments G nodes nodeOrder basis T T2 stages history + ZFSet.sep (fun z => ∃ g ∈ G, ∃ x y, z = ZFSet.pair (ZFSet.pair g x) y ∧ + ∃ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action + G nodes nodeOrder nodeAction basis T T2 level) + (ZFSet.prod (ZFSet.prod G J) J) + +theorem mem_structuralAssignmentActionGraph + (G nodes nodeOrder nodeAction basis T T2 stages history z : ZFSet.{u}) : + z ∈ M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ↔ + ∃ g ∈ G, ∃ x y, z = ZFSet.pair (ZFSet.pair g x) y ∧ + ∃ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action + G nodes nodeOrder nodeAction basis T T2 level := by + rw [structuralAssignmentActionGraph, ZFSet.mem_sep] + constructor + · exact And.right + · rintro ⟨g, hg, x, y, rfl, level, hl, P, order, top, action, stored, edge⟩ + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_bound g G nodes nodeOrder nodeAction basis T T2 + stages history level P order top action hl stored edge) + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, bounds.1⟩, bounds.2⟩, + g, hg, x, y, rfl, level, hl, P, order, top, action, stored, edge⟩ + +theorem pair_mem_structuralAssignmentActionGraph + (G nodes nodeOrder nodeAction basis T T2 stages history g x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ↔ + g ∈ G ∧ ∃ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action + G nodes nodeOrder nodeAction basis T T2 level := by + rw [M.mem_structuralAssignmentActionGraph] + constructor + · rintro ⟨g', hg, x', y', equal, rest⟩ + obtain ⟨first, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first + exact ⟨hg, rest⟩ + · rintro ⟨hg, rest⟩ + exact ⟨g, hg, x, y, rfl, rest⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionLaws.lean index 1d18ae3c22fb7c1f69ff3e1873ab9ec85b73ffd2..c9b66eb43e62184bc05db2b6541a7f625cfd42a8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralAssignmentActionLaws.lean @@ -1,74 +1,74 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.StructuralPreparationSourceImages - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {H : Type u} [Group H] - -theorem structuralAssignment_relationLaws (t : Presentation H) - (nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) - (function : FunctionGraphOn stages history) - (branches : ∀ level ∈ stages, ∀ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RelationActionLaws H - (stageOneAssignments (M.rawRefinementFormulaData P order top action - t.carrier nodes nodeOrder basis T T2 level 0) T) - (fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) P order top action - t.carrier nodes nodeOrder nodeAction basis T T2 level)) : - RelationActionLaws H - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) - (fun g => rawActionSection (t.encode g) - (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history)) := by - let ι := {v : Fin 5 → ZFSet.{u} // v 0 ∈ stages ∧ - ZFSet.pair (v 0) (forcingStageCode (v 1) (v 2) (v 3) (v 4)) ∈ history} - let X (i : ι) := stageOneAssignments (M.rawRefinementFormulaData (i.val 1) (i.val 2) - (i.val 3) (i.val 4) t.carrier nodes nodeOrder basis T T2 (i.val 0) 0) T - let branch (i : ι) (g : H) := M.rawStageRefinementAssignmentActionGraph (t.encode g) - (i.val 1) (i.val 2) (i.val 3) (i.val 4) - t.carrier nodes nodeOrder nodeAction basis T T2 (i.val 0) - let J := M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history - let graph := M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history - have cover (x : ZFSet.{u}) : x ∈ J ↔ ∃ i : ι, x ∈ X i := by - rw [M.mem_structuralAssignments] - constructor - · rintro ⟨level, hl, P, order, top, action, stored, member⟩ - exact ⟨⟨![level, P, order, top, action], hl, stored⟩, member⟩ - · rintro ⟨i, member⟩ - exact ⟨i.val 0, i.property.1, i.val 1, i.val 2, i.val 3, i.val 4, i.property.2, member⟩ - apply RelationActionLaws.of_disjoint_family X branch J (fun g => rawActionSection (t.encode g) graph J) cover - · intro g z - constructor - · intro member - obtain ⟨x, _hx, y, _hy, rfl, edge⟩ := - (BoundedFormula.truth_actionSectionEntryFormula 0 1 2 3 _).1 - ((mem_rawActionSection (t.encode g) graph J z).1 member) - obtain ⟨_hg, level, hl, P, order, top, action, stored, entry⟩ := - (M.pair_mem_structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) x y).1 edge - exact ⟨⟨![level, P, order, top, action], hl, stored⟩, entry⟩ - · rintro ⟨i, member⟩ - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound (t.encode g) - (i.val 1) (i.val 2) (i.val 3) (i.val 4) t.carrier nodes nodeOrder nodeAction basis T T2 (i.val 0) member) - exact (pair_mem_rawActionSection _ _ _ _ _).2 - ⟨(cover x).2 ⟨i, hx⟩, (cover y).2 ⟨i, hy⟩, - (M.pair_mem_structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) x y).2 - ⟨t.encode_mem g, i.val 0, i.property.1, i.val 1, i.val 2, i.val 3, i.val 4, i.property.2, member⟩⟩ - · intro i j x hi hj - have equal := M.structuralAssignment_branch_unique t.carrier nodes nodeOrder basis T T2 - function i.property.2 j.property.2 hi hj - apply Subtype.ext - exact funext (Fin.cases equal.1 (Fin.cases equal.2.1 (Fin.cases equal.2.2.1 - (Fin.cases equal.2.2.2.1 (Fin.cases equal.2.2.2.2 (fun k => Fin.elim0 k)))))) - · intro i - exact branches (i.val 0) i.property.1 (i.val 1) (i.val 2) (i.val 3) (i.val 4) i.property.2 - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.StructuralPreparationSourceImages + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {H : Type u} [Group H] + +theorem structuralAssignment_relationLaws (t : Presentation H) + (nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) + (function : FunctionGraphOn stages history) + (branches : ∀ level ∈ stages, ∀ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RelationActionLaws H + (stageOneAssignments (M.rawRefinementFormulaData P order top action + t.carrier nodes nodeOrder basis T T2 level 0) T) + (fun g => M.rawStageRefinementAssignmentActionGraph (t.encode g) P order top action + t.carrier nodes nodeOrder nodeAction basis T T2 level)) : + RelationActionLaws H + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) + (fun g => rawActionSection (t.encode g) + (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history)) := by + let ι := {v : Fin 5 → ZFSet.{u} // v 0 ∈ stages ∧ + ZFSet.pair (v 0) (forcingStageCode (v 1) (v 2) (v 3) (v 4)) ∈ history} + let X (i : ι) := stageOneAssignments (M.rawRefinementFormulaData (i.val 1) (i.val 2) + (i.val 3) (i.val 4) t.carrier nodes nodeOrder basis T T2 (i.val 0) 0) T + let branch (i : ι) (g : H) := M.rawStageRefinementAssignmentActionGraph (t.encode g) + (i.val 1) (i.val 2) (i.val 3) (i.val 4) + t.carrier nodes nodeOrder nodeAction basis T T2 (i.val 0) + let J := M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history + let graph := M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history + have cover (x : ZFSet.{u}) : x ∈ J ↔ ∃ i : ι, x ∈ X i := by + rw [M.mem_structuralAssignments] + constructor + · rintro ⟨level, hl, P, order, top, action, stored, member⟩ + exact ⟨⟨![level, P, order, top, action], hl, stored⟩, member⟩ + · rintro ⟨i, member⟩ + exact ⟨i.val 0, i.property.1, i.val 1, i.val 2, i.val 3, i.val 4, i.property.2, member⟩ + apply RelationActionLaws.of_disjoint_family X branch J (fun g => rawActionSection (t.encode g) graph J) cover + · intro g z + constructor + · intro member + obtain ⟨x, _hx, y, _hy, rfl, edge⟩ := + (BoundedFormula.truth_actionSectionEntryFormula 0 1 2 3 _).1 + ((mem_rawActionSection (t.encode g) graph J z).1 member) + obtain ⟨_hg, level, hl, P, order, top, action, stored, entry⟩ := + (M.pair_mem_structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) x y).1 edge + exact ⟨⟨![level, P, order, top, action], hl, stored⟩, entry⟩ + · rintro ⟨i, member⟩ + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound (t.encode g) + (i.val 1) (i.val 2) (i.val 3) (i.val 4) t.carrier nodes nodeOrder nodeAction basis T T2 (i.val 0) member) + exact (pair_mem_rawActionSection _ _ _ _ _).2 + ⟨(cover x).2 ⟨i, hx⟩, (cover y).2 ⟨i, hy⟩, + (M.pair_mem_structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) x y).2 + ⟨t.encode_mem g, i.val 0, i.property.1, i.val 1, i.val 2, i.val 3, i.val 4, i.property.2, member⟩⟩ + · intro i j x hi hj + have equal := M.structuralAssignment_branch_unique t.carrier nodes nodeOrder basis T T2 + function i.property.2 j.property.2 hi hj + apply Subtype.ext + exact funext (Fin.cases equal.1 (Fin.cases equal.2.1 (Fin.cases equal.2.2.1 + (Fin.cases equal.2.2.2.1 (Fin.cases equal.2.2.2.2 (fun k => Fin.elim0 k)))))) + · intro i + exact branches (i.val 0) i.property.1 (i.val 1) (i.val 2) (i.val 3) (i.val 4) i.property.2 + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralForcingStageWitnessStep.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralForcingStageWitnessStep.lean index 60a8c9165c81ace5bb2672a89d5485ec8d2cce3e..6c0ca127052cf77b20041f2980915b547c23cce7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralForcingStageWitnessStep.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/StructuralForcingStageWitnessStep.lean @@ -1,512 +1,512 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction -import OAI.SetTheory.PartitionPrinciple.Forcing.StructuralAssignmentActionLaws -import OAI.SetTheory.PartitionPrinciple.Geometry.PresentedRowAssignmentTotality - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing.PosetActionCode -open SetRealization -universe u -variable {G P : Type u} [Group G] [PartialOrder P] -variable (t : Presentation G) (s : Presentation P) {A : ZFSet.{u}} -variable (h : PosetActionCode t.carrier s.carrier - ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) s.conditionOrder A) - -noncomputable def presentedAct (g : G) (p : P) : P := - (t.product s).decodeFunction s A h.function (g, p) - -theorem presentedAct_entry (g : G) (p : P) : - ZFSet.pair (ZFSet.pair (t.encode g) (s.encode p)) (s.encode (h.presentedAct t s g p)) ∈ A := - (t.product s).decodeFunction_mem s A h.function (g, p) - -theorem presentedAct_eq_iff (g : G) (p q : P) : - h.presentedAct t s g p = q ↔ ZFSet.pair (ZFSet.pair (t.encode g) (s.encode p)) (s.encode q) ∈ A := - (t.product s).decodeFunction_iff s A h.function (g, p) q - -theorem presentedAct_one (p : P) : h.presentedAct t s 1 p = p := - (h.presentedAct_eq_iff t s 1 p p).2 (h.one _ (s.encode_mem p)) - -theorem presentedAct_mul (g j : G) (p : P) : - h.presentedAct t s (g * j) p = h.presentedAct t s g (h.presentedAct t s j p) := by - apply (h.presentedAct_eq_iff t s _ _ _).2 - exact h.mul _ (t.encode_mem g) _ (t.encode_mem j) _ (t.encode_mem (g * j)) - _ (s.encode_mem p) _ (s.encode_mem _) _ (s.encode_mem _) - (((t.product t).pair_mem_graph t (fun gh => gh.1 * gh.2) (g, j) (g * j)).2 rfl) - (h.presentedAct_entry t s j p) (h.presentedAct_entry t s g (h.presentedAct t s j p)) - -theorem presentedAct_inv_left (g : G) (p : P) : - h.presentedAct t s g⁻¹ (h.presentedAct t s g p) = p := by - rw [← h.presentedAct_mul t s, inv_mul_cancel, h.presentedAct_one t s] - -theorem presentedAct_inv_right (g : G) (p : P) : - h.presentedAct t s g (h.presentedAct t s g⁻¹ p) = p := by - rw [← h.presentedAct_mul t s, mul_inv_cancel, h.presentedAct_one t s] - -theorem presentedAct_monotone (g : G) : Monotone (h.presentedAct t s g) := by - intro p q below - apply (s.pair_mem_conditionOrder _ _).1 - exact h.monotone _ (t.encode_mem g) _ (s.encode_mem p) _ (s.encode_mem q) - _ (s.encode_mem _) _ (s.encode_mem _) (h.presentedAct_entry t s g p) - (h.presentedAct_entry t s g q) ((s.pair_mem_conditionOrder p q).2 below) - -theorem presentedAct_le_iff (g : G) (p q : P) : - h.presentedAct t s g p ≤ h.presentedAct t s g q ↔ p ≤ q := by - constructor - · intro below - have back := h.presentedAct_monotone t s g⁻¹ below - simpa only [h.presentedAct_inv_left t s] using back - · exact fun below => h.presentedAct_monotone t s g below - -noncomputable def toPresentedPosetAction : PosetAction G P where - iso g := { - toFun := h.presentedAct t s g - invFun := h.presentedAct t s g⁻¹ - left_inv := h.presentedAct_inv_left t s g - right_inv := h.presentedAct_inv_right t s g - map_rel_iff' := h.presentedAct_le_iff t s g _ _ } - one := h.presentedAct_one t s - mul := h.presentedAct_mul t s - -theorem toPresentedPosetAction_graph : (h.toPresentedPosetAction t s).actionGraph s t = A := - (t.product s).graph_decodeFunction s A h.function - -end PartitionPilot.Forcing.PosetActionCode - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {G R : Type u} [Group G] [PartialOrder R] -variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) -variable (Q J B : ZFSet.{u}) - -theorem presentedRowAssignmentGraph_code - (shape : Q ⊆ ZFSet.prod c.carrier (ZFSet.powerset J)) - (laws : RelationActionLaws G J (fun g => rawActionSection (t.encode g) B J)) - (preserves : ∀ g : G, ∀ r : R, ∀ A, - ZFSet.pair (c.encode r) A ∈ Q → - ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) : - PosetActionCode t.carrier Q ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) - (rawRowAssignmentOrder Q c.conditionOrder) - (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by - refine ⟨presentedRowAssignmentGraph_function a c t Q J B shape preserves, ?_, ?_, ?_⟩ - · intro p hp - obtain ⟨r, A, hA, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp - exact (presentedRowAssignmentGraph_entry a c t Q J B 1 r r A A).2 - ⟨hp, hp, a.one r, (laws.image_one (ZFSet.mem_powerset.1 hA)).symm⟩ - · intro g hg h hh k hk p hp q hq r hr product first second - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨h, rfl⟩ := (t.mem_carrier h).1 hh - obtain ⟨k, rfl⟩ := (t.mem_carrier k).1 hk - have gh := ((t.product t).pair_mem_graph t (fun gh => gh.1 * gh.2) (g, h) k).1 product - obtain ⟨rp, A, hA, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp - obtain ⟨rq, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hq - obtain ⟨rr, E, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hr - obtain ⟨_, _, firstRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B h rp rq A D).1 first - obtain ⟨_, _, secondRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g rq rr _ E).1 second - apply (presentedRowAssignmentGraph_entry a c t Q J B k rp rr A _).2 - refine ⟨hp, hr, ?_, ?_⟩ - · rw [← gh, a.mul, firstRow, secondRow] - · rw [← gh] - exact (laws.image_mul g h (ZFSet.mem_powerset.1 hA)).symm - · intro g hg p hp q hq r hr s hs first second below - obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg - obtain ⟨rp, A, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp - obtain ⟨rq, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hq - obtain ⟨rr, E, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hr - obtain ⟨rs, F, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hs - obtain ⟨_, _, firstRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g rp rr A E).1 first - obtain ⟨_, _, secondRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g rq rs D F).1 second - obtain ⟨_, _, rows, assignments⟩ := (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).1 below - apply (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).2 - refine ⟨hr, hs, ?_, ?_⟩ - · apply (c.pair_mem_conditionOrder rr rs).2 - rw [← firstRow, ← secondRow] - exact (a.iso g).monotone ((c.pair_mem_conditionOrder rp rq).1 rows) - · intro y hy - obtain ⟨hy, x, hx, edge⟩ := (mem_relationImage _ J _ y).1 hy - exact (mem_relationImage _ J _ y).2 ⟨hy, x, assignments hx, edge⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem structuralForcingCarrier_shape - (rows G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : - M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history ⊆ - ZFSet.prod rows (ZFSet.powerset - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history)) := by - intro z member - have candidate := (M.mem_refinementHistoryForcing rows T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) z).1 member |>.1 - obtain ⟨row, hrow, A, _hA, subset, _small, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 candidate - exact ZFSet.pair_mem_prod.2 ⟨hrow, ZFSet.mem_powerset.2 subset⟩ - -theorem structuralForcingCarrier_action_candidate - {G R : Type u} [Group G] [PartialOrder R] - (a : PosetAction G R) (c : Presentation R) (t : Presentation G) - (nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (hG : t.carrier ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) - (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) - (laws : RelationActionLaws G - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) - (fun g => rawActionSection (t.encode g) - (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history))) - (g : G) (row : R) (A : ZFSet.{u}) - (member : ZFSet.pair (c.encode row) A ∈ - M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) : - ZFSet.pair (c.encode (a.iso g row)) - (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) ∈ - M.stageOneCandidateBound c.carrier - (refinementDataHistoryIndices stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history)) T := by - have candidate := (M.mem_refinementHistoryForcing c.carrier T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - (ZFSet.pair (c.encode row) A)).1 member |>.1 - have small := (ZFSet.pair_mem_prod.1 candidate).2 - exact ZFSet.pair_mem_prod.2 ⟨c.encode_mem (a.iso g row), - M.structuralAssignmentImage_small pairing unions powers separation collection - hG hn hno hna hb hT hT2 hs hh omega (M.transitive hG (t.encode_mem g)) - (laws.injection g) small⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {G R : Type u} [Group G] [PartialOrder R] -variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) -variable (nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) -variable (laws : RelationActionLaws G - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) - (fun g => rawActionSection (t.encode g) - (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history))) -variable (preserves : ∀ g : G, ∀ r : R, ∀ A, - ZFSet.pair (c.encode r) A ∈ M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history → - ZFSet.pair (c.encode (a.iso g r)) - (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) ∈ - M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) - -noncomputable def structuralForcingAction : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - PosetAction G (SetMembers (M.refinementHistoryForcing c.carrier T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history))) := by - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - let Q := M.refinementHistoryForcing c.carrier T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - have code : PosetActionCode t.carrier Q ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) - (SetMembers.presentation Q).conditionOrder - (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) (a.actionGraph c t) - (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history)) := by - rw [M.refinementHistoryDecodedOrder_eq, M.refinementHistoryOrder_raw] - exact presentedRowAssignmentGraph_code a c t Q _ _ - (M.structuralForcingCarrier_shape c.carrier t.carrier nodes nodeOrder basis T T2 stages history) laws preserves - exact code.toPresentedPosetAction t (SetMembers.presentation Q) - -theorem structuralForcingAction_graph : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - (M.structuralForcingAction a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves).actionGraph - (SetMembers.presentation (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history)) t = - rawRowAssignmentActionGraph t.carrier - (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) c.carrier - (⋃₀ ⋃₀ (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history)) - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) (a.actionGraph c t) - (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - unfold structuralForcingAction - exact PosetActionCode.toPresentedPosetAction_graph _ _ _ - -theorem structuralForcingAction_coordinates : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - ∀ g (p : SetMembers (M.refinementHistoryForcing c.carrier T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history))) r A, - SetMembers.raw p = ZFSet.pair (c.encode r) A → - SetMembers.raw ((M.structuralForcingAction a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves).iso g p) = - ZFSet.pair (c.encode (a.iso g r)) - (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - intro g p r A equal - let Q := M.refinementHistoryForcing c.carrier T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) - let act := M.structuralForcingAction a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves - have edge := (act.triple_mem_actionGraph (SetMembers.presentation Q) t g p (act.iso g p)).2 rfl - have graph := M.structuralForcingAction_graph a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves - change act.actionGraph (SetMembers.presentation Q) t = _ at graph - rw [graph] at edge - change ZFSet.pair (ZFSet.pair (t.encode g) (SetMembers.raw p)) (SetMembers.raw (act.iso g p)) ∈ _ at edge - obtain ⟨q, D, _, target⟩ := exists_presentedRowAssignmentCoordinates c - (M.structuralForcingCarrier_shape c.carrier t.carrier nodes nodeOrder basis T T2 stages history) (SetMembers.raw_mem (act.iso g p)) - rw [equal, target] at edge - obtain ⟨_, _, row, data⟩ := (presentedRowAssignmentGraph_entry a c t Q _ _ g r q A D).1 edge - rw [target, row, data] - rfl - -omit [Group G] in -theorem structuralAssignmentImage_empty (g : ZFSet.{u}) : - M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history g ∅ = ∅ := by - apply ZFSet.ext - intro y - constructor - · intro member - obtain ⟨_, x, hx, _⟩ := (mem_relationImage _ _ _ y).1 member - exact False.elim (ZFSet.notMem_empty x hx) - · intro member - exact False.elim (ZFSet.notMem_empty y member) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {G R : Type u} [Group G] [PartialOrder R] -variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) -variable (rowTop nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - -theorem structuralTrace_cutAction {stages history level P order top action : ZFSet.{u}} - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun beta prior stage => - stage = M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier nodes nodeOrder nodeAction basis T T2 beta prior) stages history) - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) - (function : ZFSet.IsFunc (ZFSet.prod t.carrier P) P action) - (g : G) (r : R) (A : ZFSet.{u}) - (lower : ZFSet.pair (c.encode r) - (assignmentCut (refinementDataHistoryLevels stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) T) level A) ∈ P) : - let levels := refinementDataHistoryLevels stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) T - let moved := M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A - let nextLower := ZFSet.pair (c.encode (a.iso g r)) (assignmentCut levels level moved) - nextLower ∈ P ∧ - ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) (assignmentCut levels level A))) nextLower ∈ action := by - dsimp only - have hl := trace.1.pair_source stored - have code := (trace.2 level hl _ stored).trans - (M.structuralForcingStage_eq c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier nodes nodeOrder nodeAction basis T T2 level (graphRestriction level history)) - obtain ⟨carrierEq, _orderEq, _topEq, actionEq⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 code - rw [carrierEq, actionEq] at function - have lowerMember := carrierEq ▸ lower - have result := presentedRowAssignmentGraph_totalValue a c t - (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 level (graphRestriction level history)) - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 level (graphRestriction level history)) - (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 level (graphRestriction level history)) - (M.refinementHistoryForcing_shape c.carrier T level - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 level (graphRestriction level history))) - function g r _ lowerMember - rw [carrierEq, actionEq] - rw [M.structuralAssignmentImage_prefix_cut t.carrier nodes nodeOrder nodeAction basis T T2 - trace.1 (ordinal.1 level hl)] - exact result - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R : Type u} [Group G] [PartialOrder R] -variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) -variable (rowTop nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - -theorem structuralForcingCarrier_action_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (hG : t.carrier ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) - (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - {stages history : ZFSet.{u}} (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun beta prior stage => - stage = M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier nodes nodeOrder nodeAction basis T T2 beta prior) stages history) - (laws : RelationActionLaws G - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) - (fun g => rawActionSection (t.encode g) - (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) - (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history))) - (functions : ∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - ZFSet.IsFunc (ZFSet.prod t.carrier P) P action) - (symmetry : ∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - ∀ (g : G) (A p q : ZFSet.{u}), ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ action → - (stageOneRawTests M (M.rawRefinementFormulaData P order top action t.carrier nodes nodeOrder basis T T2 level) - (relationImage A - (stageOneAssignments (M.rawRefinementFormulaData P order top action t.carrier nodes nodeOrder basis T T2 level 0) T) - (M.rawStageRefinementAssignmentActionGraph (t.encode g) P order top action t.carrier - nodes nodeOrder nodeAction basis T T2 level)) q ↔ - stageOneRawTests M (M.rawRefinementFormulaData P order top action t.carrier nodes nodeOrder basis T T2 level) A p)) - (g : G) (row : R) (A : ZFSet.{u}) - (member : ZFSet.pair (c.encode row) A ∈ - M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) : - ZFSet.pair (c.encode (a.iso g row)) - (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) ∈ - M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history := by - have candidate := M.structuralForcingCarrier_action_candidate a c t nodes nodeOrder nodeAction basis T T2 - stages history pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh omega laws g row A member - have previous := (M.mem_refinementHistoryForcing c.carrier T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) _).1 member |>.2 - apply (M.mem_refinementHistoryForcing c.carrier T stages - (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) _).2 - refine ⟨candidate, ?_⟩ - intro level hl - obtain ⟨packet, entry, valid⟩ := previous level hl - obtain ⟨data, rfl⟩ := M.structuralRefinementHistory_decoded t.carrier nodes nodeOrder basis T T2 stages history entry - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields t.carrier nodes nodeOrder basis T T2 stages history data entry - refine ⟨_, entry, ?_⟩ - rw [packedSuccessorConditionCode_code_iff, stageTwoConditionCode_pair_iff] at valid ⊢ - obtain ⟨lower, tests⟩ := valid - have moved := M.structuralTrace_cutAction a c t rowTop nodes nodeOrder nodeAction basis T T2 - ordinal trace stored (functions level P order top action stored) g row A lower - refine ⟨moved.1, ?_⟩ - apply (M.structuralAssignmentImage_rawTests_branch_iff t.carrier nodes nodeOrder nodeAction basis T T2 - trace.1 (t.encode_mem g) stored A _).2 - exact (symmetry level P order top action stored g A _ _ moved.2).2 tests - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder L] -variable (c : Presentation R) (a : PosetAction G R) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T T2 rowTop : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (rowOrderGround : c.conditionOrder ∈ M.sets) -variable (rowAction : a.actionGraph c t ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (nodeOrder : b.conditionOrder ∈ M.sets) (nodeAction : d.actionGraph b t ∈ M.sets) -variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -variable (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) -variable (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) -variable (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) -variable (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) -variable (symmetric1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) -variable (symmetric2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) -variable (topMem : rowTop ∈ c.carrier) -variable (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) -include pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction - nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows - -theorem structuralForcingStage_witness_step - {stages history : ZFSet.{u}} (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history) - (earlier : ∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M t b d base directed T T2 level P order top action) - (P order top action : ZFSet.{u}) - (output : forcingStageCode P order top action = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history) : - RawRefinementStageWitness M t b d base directed T T2 stages P order top action := by - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - have hPacked : packed ∈ M.sets := - M.structuralRefinementHistory_mem pairing unions powers separation collection - ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] - (Fin.cases group (Fin.cases nodes (Fin.cases nodeOrder (Fin.cases supports - (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - have fields : ∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - ∀ j, (![level, P, order, top, action] : Fin 5 → ZFSet.{u}) j ∈ M.sets := by - intro level P order top action stored - exact M.nonemptyTupleCode_field_mem 4 ![level, P, order, top, action] (M.transitive hh stored) - have laws := M.structuralAssignment_relationLaws t b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history trace.1 (by - intro level _hl P order top action stored - have ground := fields level P order top action stored - exact (earlier level P order top action stored).relationLaws pairing unions powers separation collection - (ground 1) group nodes (ground 2) supports (ground 0) hT) - have preserves := M.structuralForcingCarrier_action_mem a c t rowTop b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 - pairing unions powers separation collection group nodes nodeOrder nodeAction supports hT hT2 hs hh omega - ordinal trace laws (fun level P order top action stored => - (earlier level P order top action stored).action_function) (by - intro level P order top action stored g A p q edge - have ground := fields level P order top action stored - exact (earlier level P order top action stored).rawTests_actionGraph_iff - pairing unions powers separation collection (ground 1) group nodes (ground 2) supports (ground 0) hT g A p q edge) - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let := M.refinementHistoryOrderTop c.conditionOrder_code T stages packed run.carriers ordinal carrier rowTop topMem topRows - let e := M.structuralForcingAction a c t b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history laws preserves - have graph := M.structuralForcingAction_graph a c t b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history laws preserves - have actionGround : e.actionGraph (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages packed)) t ∈ M.sets := by - change e.actionGraph (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages packed)) t = _ at graph - rw [graph] - exact M.structuralForcingActionGraph_mem pairing unions powers separation collection - carrier rowAction group nodes nodeOrder nodeAction supports hT hT2 hs hh omega - have system := M.recursiveRefinementStageSystem c a t b d base directed T T2 stages packed run.carriers ordinal - pairing unions powers separation collection carrier rowOrderGround group nodes nodeOrder nodeMaps supports hT hT2 hs hPacked omega - valid1 valid2 closed1 closed2 symmetric1 symmetric2 rowTop topMem topRows e - (fun g A => M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A) - (M.structuralForcingAction_coordinates a c t b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history laws preserves) - (fun g => M.structuralAssignmentImage_empty t b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g)) actionGround - have equal := output.trans (M.structuralForcingStage_eq c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history) - obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal - exact ⟨M.refinementHistoryOrder_partialOrder c.conditionOrder_code T stages packed, - run.carriers.empty_assignments ordinal carrier topMem, - run.carriers.greatest ordinal carrier topMem topRows, e, graph, system⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction +import OAI.SetTheory.PartitionPrinciple.Forcing.StructuralAssignmentActionLaws +import OAI.SetTheory.PartitionPrinciple.Geometry.PresentedRowAssignmentTotality + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing.PosetActionCode +open SetRealization +universe u +variable {G P : Type u} [Group G] [PartialOrder P] +variable (t : Presentation G) (s : Presentation P) {A : ZFSet.{u}} +variable (h : PosetActionCode t.carrier s.carrier + ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) s.conditionOrder A) + +noncomputable def presentedAct (g : G) (p : P) : P := + (t.product s).decodeFunction s A h.function (g, p) + +theorem presentedAct_entry (g : G) (p : P) : + ZFSet.pair (ZFSet.pair (t.encode g) (s.encode p)) (s.encode (h.presentedAct t s g p)) ∈ A := + (t.product s).decodeFunction_mem s A h.function (g, p) + +theorem presentedAct_eq_iff (g : G) (p q : P) : + h.presentedAct t s g p = q ↔ ZFSet.pair (ZFSet.pair (t.encode g) (s.encode p)) (s.encode q) ∈ A := + (t.product s).decodeFunction_iff s A h.function (g, p) q + +theorem presentedAct_one (p : P) : h.presentedAct t s 1 p = p := + (h.presentedAct_eq_iff t s 1 p p).2 (h.one _ (s.encode_mem p)) + +theorem presentedAct_mul (g j : G) (p : P) : + h.presentedAct t s (g * j) p = h.presentedAct t s g (h.presentedAct t s j p) := by + apply (h.presentedAct_eq_iff t s _ _ _).2 + exact h.mul _ (t.encode_mem g) _ (t.encode_mem j) _ (t.encode_mem (g * j)) + _ (s.encode_mem p) _ (s.encode_mem _) _ (s.encode_mem _) + (((t.product t).pair_mem_graph t (fun gh => gh.1 * gh.2) (g, j) (g * j)).2 rfl) + (h.presentedAct_entry t s j p) (h.presentedAct_entry t s g (h.presentedAct t s j p)) + +theorem presentedAct_inv_left (g : G) (p : P) : + h.presentedAct t s g⁻¹ (h.presentedAct t s g p) = p := by + rw [← h.presentedAct_mul t s, inv_mul_cancel, h.presentedAct_one t s] + +theorem presentedAct_inv_right (g : G) (p : P) : + h.presentedAct t s g (h.presentedAct t s g⁻¹ p) = p := by + rw [← h.presentedAct_mul t s, mul_inv_cancel, h.presentedAct_one t s] + +theorem presentedAct_monotone (g : G) : Monotone (h.presentedAct t s g) := by + intro p q below + apply (s.pair_mem_conditionOrder _ _).1 + exact h.monotone _ (t.encode_mem g) _ (s.encode_mem p) _ (s.encode_mem q) + _ (s.encode_mem _) _ (s.encode_mem _) (h.presentedAct_entry t s g p) + (h.presentedAct_entry t s g q) ((s.pair_mem_conditionOrder p q).2 below) + +theorem presentedAct_le_iff (g : G) (p q : P) : + h.presentedAct t s g p ≤ h.presentedAct t s g q ↔ p ≤ q := by + constructor + · intro below + have back := h.presentedAct_monotone t s g⁻¹ below + simpa only [h.presentedAct_inv_left t s] using back + · exact fun below => h.presentedAct_monotone t s g below + +noncomputable def toPresentedPosetAction : PosetAction G P where + iso g := { + toFun := h.presentedAct t s g + invFun := h.presentedAct t s g⁻¹ + left_inv := h.presentedAct_inv_left t s g + right_inv := h.presentedAct_inv_right t s g + map_rel_iff' := h.presentedAct_le_iff t s g _ _ } + one := h.presentedAct_one t s + mul := h.presentedAct_mul t s + +theorem toPresentedPosetAction_graph : (h.toPresentedPosetAction t s).actionGraph s t = A := + (t.product s).graph_decodeFunction s A h.function + +end PartitionPilot.Forcing.PosetActionCode + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {G R : Type u} [Group G] [PartialOrder R] +variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) +variable (Q J B : ZFSet.{u}) + +theorem presentedRowAssignmentGraph_code + (shape : Q ⊆ ZFSet.prod c.carrier (ZFSet.powerset J)) + (laws : RelationActionLaws G J (fun g => rawActionSection (t.encode g) B J)) + (preserves : ∀ g : G, ∀ r : R, ∀ A, + ZFSet.pair (c.encode r) A ∈ Q → + ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) : + PosetActionCode t.carrier Q ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) + (rawRowAssignmentOrder Q c.conditionOrder) + (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by + refine ⟨presentedRowAssignmentGraph_function a c t Q J B shape preserves, ?_, ?_, ?_⟩ + · intro p hp + obtain ⟨r, A, hA, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp + exact (presentedRowAssignmentGraph_entry a c t Q J B 1 r r A A).2 + ⟨hp, hp, a.one r, (laws.image_one (ZFSet.mem_powerset.1 hA)).symm⟩ + · intro g hg h hh k hk p hp q hq r hr product first second + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨h, rfl⟩ := (t.mem_carrier h).1 hh + obtain ⟨k, rfl⟩ := (t.mem_carrier k).1 hk + have gh := ((t.product t).pair_mem_graph t (fun gh => gh.1 * gh.2) (g, h) k).1 product + obtain ⟨rp, A, hA, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp + obtain ⟨rq, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hq + obtain ⟨rr, E, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hr + obtain ⟨_, _, firstRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B h rp rq A D).1 first + obtain ⟨_, _, secondRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g rq rr _ E).1 second + apply (presentedRowAssignmentGraph_entry a c t Q J B k rp rr A _).2 + refine ⟨hp, hr, ?_, ?_⟩ + · rw [← gh, a.mul, firstRow, secondRow] + · rw [← gh] + exact (laws.image_mul g h (ZFSet.mem_powerset.1 hA)).symm + · intro g hg p hp q hq r hr s hs first second below + obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg + obtain ⟨rp, A, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp + obtain ⟨rq, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hq + obtain ⟨rr, E, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hr + obtain ⟨rs, F, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hs + obtain ⟨_, _, firstRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g rp rr A E).1 first + obtain ⟨_, _, secondRow, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g rq rs D F).1 second + obtain ⟨_, _, rows, assignments⟩ := (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).1 below + apply (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).2 + refine ⟨hr, hs, ?_, ?_⟩ + · apply (c.pair_mem_conditionOrder rr rs).2 + rw [← firstRow, ← secondRow] + exact (a.iso g).monotone ((c.pair_mem_conditionOrder rp rq).1 rows) + · intro y hy + obtain ⟨hy, x, hx, edge⟩ := (mem_relationImage _ J _ y).1 hy + exact (mem_relationImage _ J _ y).2 ⟨hy, x, assignments hx, edge⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem structuralForcingCarrier_shape + (rows G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : + M.structuralForcingCarrier rows G nodes nodeOrder basis T T2 stages history ⊆ + ZFSet.prod rows (ZFSet.powerset + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history)) := by + intro z member + have candidate := (M.mem_refinementHistoryForcing rows T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) z).1 member |>.1 + obtain ⟨row, hrow, A, _hA, subset, _small, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 candidate + exact ZFSet.pair_mem_prod.2 ⟨hrow, ZFSet.mem_powerset.2 subset⟩ + +theorem structuralForcingCarrier_action_candidate + {G R : Type u} [Group G] [PartialOrder R] + (a : PosetAction G R) (c : Presentation R) (t : Presentation G) + (nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (hG : t.carrier ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) + (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) + (laws : RelationActionLaws G + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) + (fun g => rawActionSection (t.encode g) + (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history))) + (g : G) (row : R) (A : ZFSet.{u}) + (member : ZFSet.pair (c.encode row) A ∈ + M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) : + ZFSet.pair (c.encode (a.iso g row)) + (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) ∈ + M.stageOneCandidateBound c.carrier + (refinementDataHistoryIndices stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history)) T := by + have candidate := (M.mem_refinementHistoryForcing c.carrier T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + (ZFSet.pair (c.encode row) A)).1 member |>.1 + have small := (ZFSet.pair_mem_prod.1 candidate).2 + exact ZFSet.pair_mem_prod.2 ⟨c.encode_mem (a.iso g row), + M.structuralAssignmentImage_small pairing unions powers separation collection + hG hn hno hna hb hT hT2 hs hh omega (M.transitive hG (t.encode_mem g)) + (laws.injection g) small⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {G R : Type u} [Group G] [PartialOrder R] +variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) +variable (nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) +variable (laws : RelationActionLaws G + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) + (fun g => rawActionSection (t.encode g) + (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history))) +variable (preserves : ∀ g : G, ∀ r : R, ∀ A, + ZFSet.pair (c.encode r) A ∈ M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history → + ZFSet.pair (c.encode (a.iso g r)) + (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) ∈ + M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) + +noncomputable def structuralForcingAction : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + PosetAction G (SetMembers (M.refinementHistoryForcing c.carrier T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history))) := by + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + let Q := M.refinementHistoryForcing c.carrier T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + have code : PosetActionCode t.carrier Q ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) + (SetMembers.presentation Q).conditionOrder + (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) (a.actionGraph c t) + (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history)) := by + rw [M.refinementHistoryDecodedOrder_eq, M.refinementHistoryOrder_raw] + exact presentedRowAssignmentGraph_code a c t Q _ _ + (M.structuralForcingCarrier_shape c.carrier t.carrier nodes nodeOrder basis T T2 stages history) laws preserves + exact code.toPresentedPosetAction t (SetMembers.presentation Q) + +theorem structuralForcingAction_graph : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + (M.structuralForcingAction a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves).actionGraph + (SetMembers.presentation (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history)) t = + rawRowAssignmentActionGraph t.carrier + (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) c.carrier + (⋃₀ ⋃₀ (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history)) + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) (a.actionGraph c t) + (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + unfold structuralForcingAction + exact PosetActionCode.toPresentedPosetAction_graph _ _ _ + +theorem structuralForcingAction_coordinates : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + ∀ g (p : SetMembers (M.refinementHistoryForcing c.carrier T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history))) r A, + SetMembers.raw p = ZFSet.pair (c.encode r) A → + SetMembers.raw ((M.structuralForcingAction a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves).iso g p) = + ZFSet.pair (c.encode (a.iso g r)) + (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + intro g p r A equal + let Q := M.refinementHistoryForcing c.carrier T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) + let act := M.structuralForcingAction a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves + have edge := (act.triple_mem_actionGraph (SetMembers.presentation Q) t g p (act.iso g p)).2 rfl + have graph := M.structuralForcingAction_graph a c t nodes nodeOrder nodeAction basis T T2 stages history laws preserves + change act.actionGraph (SetMembers.presentation Q) t = _ at graph + rw [graph] at edge + change ZFSet.pair (ZFSet.pair (t.encode g) (SetMembers.raw p)) (SetMembers.raw (act.iso g p)) ∈ _ at edge + obtain ⟨q, D, _, target⟩ := exists_presentedRowAssignmentCoordinates c + (M.structuralForcingCarrier_shape c.carrier t.carrier nodes nodeOrder basis T T2 stages history) (SetMembers.raw_mem (act.iso g p)) + rw [equal, target] at edge + obtain ⟨_, _, row, data⟩ := (presentedRowAssignmentGraph_entry a c t Q _ _ g r q A D).1 edge + rw [target, row, data] + rfl + +omit [Group G] in +theorem structuralAssignmentImage_empty (g : ZFSet.{u}) : + M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history g ∅ = ∅ := by + apply ZFSet.ext + intro y + constructor + · intro member + obtain ⟨_, x, hx, _⟩ := (mem_relationImage _ _ _ y).1 member + exact False.elim (ZFSet.notMem_empty x hx) + · intro member + exact False.elim (ZFSet.notMem_empty y member) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {G R : Type u} [Group G] [PartialOrder R] +variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) +variable (rowTop nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + +theorem structuralTrace_cutAction {stages history level P order top action : ZFSet.{u}} + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun beta prior stage => + stage = M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier nodes nodeOrder nodeAction basis T T2 beta prior) stages history) + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) + (function : ZFSet.IsFunc (ZFSet.prod t.carrier P) P action) + (g : G) (r : R) (A : ZFSet.{u}) + (lower : ZFSet.pair (c.encode r) + (assignmentCut (refinementDataHistoryLevels stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) T) level A) ∈ P) : + let levels := refinementDataHistoryLevels stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) T + let moved := M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A + let nextLower := ZFSet.pair (c.encode (a.iso g r)) (assignmentCut levels level moved) + nextLower ∈ P ∧ + ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) (assignmentCut levels level A))) nextLower ∈ action := by + dsimp only + have hl := trace.1.pair_source stored + have code := (trace.2 level hl _ stored).trans + (M.structuralForcingStage_eq c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier nodes nodeOrder nodeAction basis T T2 level (graphRestriction level history)) + obtain ⟨carrierEq, _orderEq, _topEq, actionEq⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 code + rw [carrierEq, actionEq] at function + have lowerMember := carrierEq ▸ lower + have result := presentedRowAssignmentGraph_totalValue a c t + (M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 level (graphRestriction level history)) + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 level (graphRestriction level history)) + (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 level (graphRestriction level history)) + (M.refinementHistoryForcing_shape c.carrier T level + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 level (graphRestriction level history))) + function g r _ lowerMember + rw [carrierEq, actionEq] + rw [M.structuralAssignmentImage_prefix_cut t.carrier nodes nodeOrder nodeAction basis T T2 + trace.1 (ordinal.1 level hl)] + exact result + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R : Type u} [Group G] [PartialOrder R] +variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) +variable (rowTop nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + +theorem structuralForcingCarrier_action_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (hG : t.carrier ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) + (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + {stages history : ZFSet.{u}} (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun beta prior stage => + stage = M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier nodes nodeOrder nodeAction basis T T2 beta prior) stages history) + (laws : RelationActionLaws G + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history) + (fun g => rawActionSection (t.encode g) + (M.structuralAssignmentActionGraph t.carrier nodes nodeOrder nodeAction basis T T2 stages history) + (M.structuralAssignments t.carrier nodes nodeOrder basis T T2 stages history))) + (functions : ∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + ZFSet.IsFunc (ZFSet.prod t.carrier P) P action) + (symmetry : ∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + ∀ (g : G) (A p q : ZFSet.{u}), ZFSet.pair (ZFSet.pair (t.encode g) p) q ∈ action → + (stageOneRawTests M (M.rawRefinementFormulaData P order top action t.carrier nodes nodeOrder basis T T2 level) + (relationImage A + (stageOneAssignments (M.rawRefinementFormulaData P order top action t.carrier nodes nodeOrder basis T T2 level 0) T) + (M.rawStageRefinementAssignmentActionGraph (t.encode g) P order top action t.carrier + nodes nodeOrder nodeAction basis T T2 level)) q ↔ + stageOneRawTests M (M.rawRefinementFormulaData P order top action t.carrier nodes nodeOrder basis T T2 level) A p)) + (g : G) (row : R) (A : ZFSet.{u}) + (member : ZFSet.pair (c.encode row) A ∈ + M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history) : + ZFSet.pair (c.encode (a.iso g row)) + (M.structuralAssignmentImage t.carrier nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) A) ∈ + M.structuralForcingCarrier c.carrier t.carrier nodes nodeOrder basis T T2 stages history := by + have candidate := M.structuralForcingCarrier_action_candidate a c t nodes nodeOrder nodeAction basis T T2 + stages history pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh omega laws g row A member + have previous := (M.mem_refinementHistoryForcing c.carrier T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) _).1 member |>.2 + apply (M.mem_refinementHistoryForcing c.carrier T stages + (M.structuralRefinementHistory t.carrier nodes nodeOrder basis T T2 stages history) _).2 + refine ⟨candidate, ?_⟩ + intro level hl + obtain ⟨packet, entry, valid⟩ := previous level hl + obtain ⟨data, rfl⟩ := M.structuralRefinementHistory_decoded t.carrier nodes nodeOrder basis T T2 stages history entry + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields t.carrier nodes nodeOrder basis T T2 stages history data entry + refine ⟨_, entry, ?_⟩ + rw [packedSuccessorConditionCode_code_iff, stageTwoConditionCode_pair_iff] at valid ⊢ + obtain ⟨lower, tests⟩ := valid + have moved := M.structuralTrace_cutAction a c t rowTop nodes nodeOrder nodeAction basis T T2 + ordinal trace stored (functions level P order top action stored) g row A lower + refine ⟨moved.1, ?_⟩ + apply (M.structuralAssignmentImage_rawTests_branch_iff t.carrier nodes nodeOrder nodeAction basis T T2 + trace.1 (t.encode_mem g) stored A _).2 + exact (symmetry level P order top action stored g A _ _ moved.2).2 tests + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder L] +variable (c : Presentation R) (a : PosetAction G R) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T T2 rowTop : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (rowOrderGround : c.conditionOrder ∈ M.sets) +variable (rowAction : a.actionGraph c t ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (nodeOrder : b.conditionOrder ∈ M.sets) (nodeAction : d.actionGraph b t ∈ M.sets) +variable (nodeMaps : d.conditionMapFamily b t ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +variable (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) +variable (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) +variable (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) +variable (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) +variable (symmetric1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) +variable (symmetric2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) +variable (topMem : rowTop ∈ c.carrier) +variable (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) +include pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction + nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows + +theorem structuralForcingStage_witness_step + {stages history : ZFSet.{u}} (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history) + (earlier : ∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M t b d base directed T T2 level P order top action) + (P order top action : ZFSet.{u}) + (output : forcingStageCode P order top action = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history) : + RawRefinementStageWitness M t b d base directed T T2 stages P order top action := by + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + have hPacked : packed ∈ M.sets := + M.structuralRefinementHistory_mem pairing unions powers separation collection + ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] + (Fin.cases group (Fin.cases nodes (Fin.cases nodeOrder (Fin.cases supports + (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + have fields : ∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + ∀ j, (![level, P, order, top, action] : Fin 5 → ZFSet.{u}) j ∈ M.sets := by + intro level P order top action stored + exact M.nonemptyTupleCode_field_mem 4 ![level, P, order, top, action] (M.transitive hh stored) + have laws := M.structuralAssignment_relationLaws t b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history trace.1 (by + intro level _hl P order top action stored + have ground := fields level P order top action stored + exact (earlier level P order top action stored).relationLaws pairing unions powers separation collection + (ground 1) group nodes (ground 2) supports (ground 0) hT) + have preserves := M.structuralForcingCarrier_action_mem a c t rowTop b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 + pairing unions powers separation collection group nodes nodeOrder nodeAction supports hT hT2 hs hh omega + ordinal trace laws (fun level P order top action stored => + (earlier level P order top action stored).action_function) (by + intro level P order top action stored g A p q edge + have ground := fields level P order top action stored + exact (earlier level P order top action stored).rawTests_actionGraph_iff + pairing unions powers separation collection (ground 1) group nodes (ground 2) supports (ground 0) hT g A p q edge) + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let := M.refinementHistoryOrderTop c.conditionOrder_code T stages packed run.carriers ordinal carrier rowTop topMem topRows + let e := M.structuralForcingAction a c t b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history laws preserves + have graph := M.structuralForcingAction_graph a c t b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history laws preserves + have actionGround : e.actionGraph (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages packed)) t ∈ M.sets := by + change e.actionGraph (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages packed)) t = _ at graph + rw [graph] + exact M.structuralForcingActionGraph_mem pairing unions powers separation collection + carrier rowAction group nodes nodeOrder nodeAction supports hT hT2 hs hh omega + have system := M.recursiveRefinementStageSystem c a t b d base directed T T2 stages packed run.carriers ordinal + pairing unions powers separation collection carrier rowOrderGround group nodes nodeOrder nodeMaps supports hT hT2 hs hPacked omega + valid1 valid2 closed1 closed2 symmetric1 symmetric2 rowTop topMem topRows e + (fun g A => M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) A) + (M.structuralForcingAction_coordinates a c t b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history laws preserves) + (fun g => M.structuralAssignmentImage_empty t b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g)) actionGround + have equal := output.trans (M.structuralForcingStage_eq c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history) + obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal + exact ⟨M.refinementHistoryOrder_partialOrder c.conditionOrder_code T stages packed, + run.carriers.empty_assignments ordinal carrier topMem, + run.carriers.greatest ordinal carrier topMem topRows, e, graph, system⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SymmetricGroundForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SymmetricGroundForcing.lean index d701067c6f3ce3ecd585e4932a5351d9c4f31bb0..5e9d528998f261d64c5a04899e005f06f2f6fedc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SymmetricGroundForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/SymmetricGroundForcing.lean @@ -1,326 +1,326 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.NameSupportFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def nameSymmetryFormula : SetFormula 6 := - exConditions 3 (allConditions 3 (imp (pairMembershipFormula 1 0 6) - (atomicApplication nameActionFormula (extend 3 (extend 7 Fin.elim0)) 0 2 2))) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -noncomputable def symmetryParameters (K : I → Subgroup G) : Fin 5 → ZFSet.{u} := - extend s.carrier (extend t.carrier (extend b.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) - -theorem realize_nameSymmetryFormula (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (τ : Name s) (hτ : τ.val ∈ M.sets) : - Realize M.sets nameSymmetryFormula (extend τ.val (symmetryParameters a s t b K)) ↔ - F.mem (a.stabilizer s τ) := by - let env := extend τ.val (symmetryParameters a s t b K) - rw [basis (a.stabilizer s τ), nameSymmetryFormula, - M.realize_exConditions b 3 _ env indices rfl] - apply exists_congr - intro i - rw [M.realize_allConditions t 3 _ (extend (b.encode i) env) group rfl] - change (∀ g, Realize M.sets _ _) ↔ ∀ g, g ∈ K i → a.act s g τ = τ - apply forall_congr' - intro g - let e := extend (t.encode g) (extend (b.encode i) env) - rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 6 e - (M.transitive indices (b.encode_mem i)) (M.transitive group (t.encode_mem g)) supports] - change (ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K → Realize M.sets _ e) ↔ _ - rw [pair_mem_supportBasisCode] - apply forall_congr' - intro _ - rw [realize_atomicApplication, map_extend, map_extend, map_empty] - exact M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps g τ τ hτ hτ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.SetFormula - -def hereditaryStepFormula : SetFormula 7 := - .conj (domainApplication nameSymmetryFormula (fun j => j.succ.succ) 0) - (binaryApplication nameCodeStepFormula (extend 2 Fin.elim0) 0 1) - -def hereditaryCertificateFormula : SetFormula 6 := postfixedFormula hereditaryStepFormula - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem realize_hereditaryStepFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) - (params : Fin 5 → ZFSet.{u}) (hc : params 0 = s.carrier) - (x R : ZFSet.{u}) (hx : x ∈ M.sets) (hr : R ∈ M.sets) : - Realize M.sets hereditaryStepFormula (extend x (extend R params)) ↔ - Realize M.sets nameSymmetryFormula (extend x params) ∧ NameCodeStep s R x := by - change (Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _ - rw [realize_domainApplication, realize_binaryApplication, map_extend, map_empty] - change (Realize M.sets nameSymmetryFormula (extend x params) ∧ - Realize M.sets nameCodeStepFormula (extend x (extend R (extend (params 0) Fin.elim0)))) ↔ _ - rw [hc, M.realize_nameCodeStepFormula s pairing carrier x R hx hr] - -theorem hereditaryCertificate_isName - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) - (params : Fin 5 → ZFSet.{u}) (hc : params 0 = s.carrier) - {R : ZFSet.{u}} (hr : R ∈ M.sets) - (certificate : Realize M.sets hereditaryCertificateFormula (extend R params)) : - ∀ x ∈ R, IsName s x := by - apply nameCodePostfixed_sound s R - intro x hx - exact ((M.realize_hereditaryStepFormula s pairing carrier params hc x R (M.transitive hr hx) hr).1 - ((realize_imp M.sets _ _ _).1 (certificate x (M.transitive hr hx)) hx)).2 - -variable {I G : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (t : Presentation G) (b : Presentation I) - -theorem hereditaryCertificate_sound (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {R : ZFSet.{u}} (hr : R ∈ M.sets) - (certificate : Realize M.sets hereditaryCertificateFormula (extend R (symmetryParameters a s t b K))) : - ∀ τ : Name s, τ.val ∈ R → HereditarilySymmetric a s F τ := by - intro τ - induction τ using Name.inductionOn with - | step τ ih => - intro hτ - have hτM := M.transitive hr hτ - have step := (M.realize_hereditaryStepFormula s pairing carrier (symmetryParameters a s t b K) - rfl τ.val R hτM hr).1 ((realize_imp M.sets _ _ _).1 (certificate τ.val hτM) hτ) - apply HereditarilySymmetric.mk - · exact (M.realize_nameSymmetryFormula a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps τ hτM).1 step.1 - · intro σ p entry - obtain ⟨x, hx, q, shape⟩ := step.2 _ entry - have eq := (ZFSet.pair_inj.1 shape).1 - exact ih σ p entry (eq ▸ hx) - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem exists_hereditary_certificate (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (τ : Name s) (hτ : τ.val ∈ M.sets) (hs : HereditarilySymmetric a s F τ) : - ∃ R ∈ M.sets, Realize M.sets hereditaryCertificateFormula - (extend R (symmetryParameters a s t b K)) ∧ τ.val ∈ R := by - obtain ⟨T, hT, τT, trans⟩ := M.exists_transitiveCover pairing unions separation collection τ.val hτ - let D := a.symmetricDomain s (namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy)) F - let params := symmetryParameters a s t b K - have members : ∀ i, params i ∈ M.sets := - Fin.cases carrier (Fin.cases group (Fin.cases indices (Fin.cases supports - (Fin.cases maps (fun i => Fin.elim0 i))))) - have mono : ∀ R ∈ M.sets, ∀ S ∈ M.sets, R ⊆ T → S ⊆ T → R ⊆ S → - definableOperator M.sets hereditaryStepFormula params T R ⊆ - definableOperator M.sets hereditaryStepFormula params T S := by - intro R hr S hS _ _ sub x hx - obtain ⟨hxT, step⟩ := ZFSet.mem_sep.1 hx - have hxM := M.transitive hT hxT - obtain ⟨sym, children⟩ := (M.realize_hereditaryStepFormula s pairing carrier params rfl x R hxM hr).1 step - exact ZFSet.mem_sep.2 ⟨hxT, (M.realize_hereditaryStepFormula s pairing carrier params rfl x S hxM hS).2 - ⟨sym, nameCodeStep_mono s sub children⟩⟩ - obtain ⟨R, hr, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation - hereditaryStepFormula params members hT mono - have certificate : Realize M.sets hereditaryCertificateFormula (extend R params) := by - apply (M.realize_postfixedFormula hereditaryStepFormula params hr bound).2 - rw [fixed] - have pre : ∀ ν ∈ D.names, NameCodeStep s R ν.val → ν.val ∈ R := by - intro ν hν step - have hνM := M.transitive hT hν.1 - have sym := (M.realize_nameSymmetryFormula a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps ν hνM).2 hν.2.symmetric - have member : ν.val ∈ definableOperator M.sets hereditaryStepFormula params T R := - ZFSet.mem_sep.2 ⟨hν.1, - (M.realize_hereditaryStepFormula s pairing carrier params rfl ν.val R hνM hr).2 ⟨sym, step⟩⟩ - rwa [fixed] at member - exact ⟨R, hr, certificate, nameCodePrefixed_complete s D R pre τ ⟨τT, hs⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def uniformHereditaryFormula : SetFormula 6 := - ex (.conj (domainApplication hereditaryCertificateFormula (fun j => j.succ.succ) 0) (.mem 1 0)) - -def liftedHereditaryFormula {k : Nat} (c g i b a : Fin k) : SetFormula (k + 1) := - domainApplication uniformHereditaryFormula - (extend c.succ (extend g.succ (extend i.succ (extend b.succ (extend a.succ Fin.elim0))))) 0 - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem realize_uniformHereditaryFormula (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (x : ZFSet.{u}) (hx : x ∈ M.sets) : - Realize M.sets uniformHereditaryFormula (extend x (symmetryParameters a s t b K)) ↔ - ∃ h : IsName s x, HereditarilySymmetric a s F ⟨x, h⟩ := by - rw [uniformHereditaryFormula, realize_ex] - constructor - · rintro ⟨R, hr, certificate, member⟩ - have cert := (realize_domainApplication M.sets hereditaryCertificateFormula _ _ _).1 certificate - have name := M.hereditaryCertificate_isName s pairing carrier (symmetryParameters a s t b K) rfl hr cert x member - exact ⟨name, M.hereditaryCertificate_sound s a t b F K basis pairing unions powers separation collection - carrier group indices supports maps hr cert ⟨x, name⟩ member⟩ - · rintro ⟨name, hs⟩ - obtain ⟨R, hr, certificate, member⟩ := M.exists_hereditary_certificate a s t b F K basis - pairing unions powers separation collection carrier group indices supports maps ⟨x, name⟩ hx hs - exact ⟨R, hr, (realize_domainApplication M.sets hereditaryCertificateFormula _ _ _).2 certificate, member⟩ - -theorem domainMeaning_liftedHereditary (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {k : Nat} (c g i j l : Fin k) (constants : Fin k → ZFSet.{u}) - (hc : constants c = s.carrier) (hg : constants g = t.carrier) (hi : constants i = b.carrier) - (hj : constants j = supportBasisCode b t K) (hl : constants l = a.conditionMapFamily s t) : - M.DomainMeaning s (a.symmetricDomain s (M.nameDomain s) F) - (liftedHereditaryFormula c g i j l) constants := by - intro x hx - rw [liftedHereditaryFormula, realize_domainApplication, - map_extend, map_extend, map_extend, map_extend, map_extend, map_empty] - change Realize M.sets uniformHereditaryFormula (extend x - (extend (constants c) (extend (constants g) (extend (constants i) - (extend (constants j) (extend (constants l) Fin.elim0)))))) ↔ _ - rw [hc, hg, hi, hj, hl] - change Realize M.sets uniformHereditaryFormula (extend x (symmetryParameters a s t b K)) ↔ _ - rw [M.realize_uniformHereditaryFormula a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps x hx] - constructor - · rintro ⟨name, hs⟩ - exact ⟨⟨⟨x, name⟩, hx, hs⟩, rfl⟩ - · rintro ⟨τ, rfl⟩ - exact ⟨τ.val.property, τ.property.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.SetFormula - -def symmetricGroundPrimitives : ForcingPrimitives 6 := - withGroundEquality 0 1 (liftedHereditaryFormula 0 2 3 4 5) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem realize_symmetricGroundForcing (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {n m : Nat} (φ : SetFormula n) (params : Fin 6 → Fin m) - (pi : Fin m) (names : Fin n → Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params 0) = s.carrier) (ho : env (params 1) = s.conditionOrder) - (hg : env (params 2) = t.carrier) (hi : env (params 3) = b.carrier) - (hj : env (params 4) = supportBasisCode b t K) (hl : env (params 5) = a.conditionMapFamily s t) - (p : P) (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) - (hp : env pi = s.encode p) (hnames : ∀ i, env (names i) = (nameEnv i).val.val) : - Realize M.sets (forcingTranslation symmetricGroundPrimitives φ params pi names) env ↔ - Forces (a.symmetricDomain s (M.nameDomain s) F) φ nameEnv p := - M.realize_forcingWithGroundEquality s (a.symmetricDomain s (M.nameDomain s) F) (fun _ h => h.1) - pairing unions powers separation collection carrier order 0 1 (liftedHereditaryFormula 0 2 3 4 5) - φ params pi names env hc ho - (M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection carrier - group indices supports maps 0 2 3 4 5 _ hc hg hi hj hl) p nameEnv hp hnames - -theorem symmetricForcingSet_mem (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {n : Nat} (φ : SetFormula n) (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) : - s.subset (fun p => Forces (a.symmetricDomain s (M.nameDomain s) F) φ nameEnv p) ∈ M.sets := by - let context := extend s.carrier (extend s.conditionOrder (extend t.carrier (extend b.carrier - (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) (fun i => (nameEnv i).val.val)))))) - let params : Fin 6 → Fin (n + 6) := extend 0 (extend 1 (extend 2 (extend 3 (extend 4 (extend 5 Fin.elim0))))) - have members : ∀ i, context i ∈ M.sets := - Fin.cases carrier (Fin.cases order (Fin.cases group (Fin.cases indices (Fin.cases supports - (Fin.cases maps (fun i => (nameEnv i).property.1)))))) - apply M.forcingSet_mem_withGroundEquality s (a.symmetricDomain s (M.nameDomain s) F) (fun _ h => h.1) - pairing unions powers separation collection carrier order 0 1 (liftedHereditaryFormula 0 2 3 4 5) φ - params (fun i => i.succ.succ.succ.succ.succ.succ) context members rfl rfl - · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection - carrier group indices supports maps 0 2 3 4 5 _ rfl rfl rfl rfl rfl - · exact fun _ => rfl - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.NameSupportFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def nameSymmetryFormula : SetFormula 6 := + exConditions 3 (allConditions 3 (imp (pairMembershipFormula 1 0 6) + (atomicApplication nameActionFormula (extend 3 (extend 7 Fin.elim0)) 0 2 2))) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +noncomputable def symmetryParameters (K : I → Subgroup G) : Fin 5 → ZFSet.{u} := + extend s.carrier (extend t.carrier (extend b.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))) + +theorem realize_nameSymmetryFormula (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (τ : Name s) (hτ : τ.val ∈ M.sets) : + Realize M.sets nameSymmetryFormula (extend τ.val (symmetryParameters a s t b K)) ↔ + F.mem (a.stabilizer s τ) := by + let env := extend τ.val (symmetryParameters a s t b K) + rw [basis (a.stabilizer s τ), nameSymmetryFormula, + M.realize_exConditions b 3 _ env indices rfl] + apply exists_congr + intro i + rw [M.realize_allConditions t 3 _ (extend (b.encode i) env) group rfl] + change (∀ g, Realize M.sets _ _) ↔ ∀ g, g ∈ K i → a.act s g τ = τ + apply forall_congr' + intro g + let e := extend (t.encode g) (extend (b.encode i) env) + rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 6 e + (M.transitive indices (b.encode_mem i)) (M.transitive group (t.encode_mem g)) supports] + change (ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K → Realize M.sets _ e) ↔ _ + rw [pair_mem_supportBasisCode] + apply forall_congr' + intro _ + rw [realize_atomicApplication, map_extend, map_extend, map_empty] + exact M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps g τ τ hτ hτ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.SetFormula + +def hereditaryStepFormula : SetFormula 7 := + .conj (domainApplication nameSymmetryFormula (fun j => j.succ.succ) 0) + (binaryApplication nameCodeStepFormula (extend 2 Fin.elim0) 0 1) + +def hereditaryCertificateFormula : SetFormula 6 := postfixedFormula hereditaryStepFormula + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem realize_hereditaryStepFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) + (params : Fin 5 → ZFSet.{u}) (hc : params 0 = s.carrier) + (x R : ZFSet.{u}) (hx : x ∈ M.sets) (hr : R ∈ M.sets) : + Realize M.sets hereditaryStepFormula (extend x (extend R params)) ↔ + Realize M.sets nameSymmetryFormula (extend x params) ∧ NameCodeStep s R x := by + change (Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _ + rw [realize_domainApplication, realize_binaryApplication, map_extend, map_empty] + change (Realize M.sets nameSymmetryFormula (extend x params) ∧ + Realize M.sets nameCodeStepFormula (extend x (extend R (extend (params 0) Fin.elim0)))) ↔ _ + rw [hc, M.realize_nameCodeStepFormula s pairing carrier x R hx hr] + +theorem hereditaryCertificate_isName + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) + (params : Fin 5 → ZFSet.{u}) (hc : params 0 = s.carrier) + {R : ZFSet.{u}} (hr : R ∈ M.sets) + (certificate : Realize M.sets hereditaryCertificateFormula (extend R params)) : + ∀ x ∈ R, IsName s x := by + apply nameCodePostfixed_sound s R + intro x hx + exact ((M.realize_hereditaryStepFormula s pairing carrier params hc x R (M.transitive hr hx) hr).1 + ((realize_imp M.sets _ _ _).1 (certificate x (M.transitive hr hx)) hx)).2 + +variable {I G : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (t : Presentation G) (b : Presentation I) + +theorem hereditaryCertificate_sound (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {R : ZFSet.{u}} (hr : R ∈ M.sets) + (certificate : Realize M.sets hereditaryCertificateFormula (extend R (symmetryParameters a s t b K))) : + ∀ τ : Name s, τ.val ∈ R → HereditarilySymmetric a s F τ := by + intro τ + induction τ using Name.inductionOn with + | step τ ih => + intro hτ + have hτM := M.transitive hr hτ + have step := (M.realize_hereditaryStepFormula s pairing carrier (symmetryParameters a s t b K) + rfl τ.val R hτM hr).1 ((realize_imp M.sets _ _ _).1 (certificate τ.val hτM) hτ) + apply HereditarilySymmetric.mk + · exact (M.realize_nameSymmetryFormula a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps τ hτM).1 step.1 + · intro σ p entry + obtain ⟨x, hx, q, shape⟩ := step.2 _ entry + have eq := (ZFSet.pair_inj.1 shape).1 + exact ih σ p entry (eq ▸ hx) + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem exists_hereditary_certificate (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (τ : Name s) (hτ : τ.val ∈ M.sets) (hs : HereditarilySymmetric a s F τ) : + ∃ R ∈ M.sets, Realize M.sets hereditaryCertificateFormula + (extend R (symmetryParameters a s t b K)) ∧ τ.val ∈ R := by + obtain ⟨T, hT, τT, trans⟩ := M.exists_transitiveCover pairing unions separation collection τ.val hτ + let D := a.symmetricDomain s (namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy)) F + let params := symmetryParameters a s t b K + have members : ∀ i, params i ∈ M.sets := + Fin.cases carrier (Fin.cases group (Fin.cases indices (Fin.cases supports + (Fin.cases maps (fun i => Fin.elim0 i))))) + have mono : ∀ R ∈ M.sets, ∀ S ∈ M.sets, R ⊆ T → S ⊆ T → R ⊆ S → + definableOperator M.sets hereditaryStepFormula params T R ⊆ + definableOperator M.sets hereditaryStepFormula params T S := by + intro R hr S hS _ _ sub x hx + obtain ⟨hxT, step⟩ := ZFSet.mem_sep.1 hx + have hxM := M.transitive hT hxT + obtain ⟨sym, children⟩ := (M.realize_hereditaryStepFormula s pairing carrier params rfl x R hxM hr).1 step + exact ZFSet.mem_sep.2 ⟨hxT, (M.realize_hereditaryStepFormula s pairing carrier params rfl x S hxM hS).2 + ⟨sym, nameCodeStep_mono s sub children⟩⟩ + obtain ⟨R, hr, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation + hereditaryStepFormula params members hT mono + have certificate : Realize M.sets hereditaryCertificateFormula (extend R params) := by + apply (M.realize_postfixedFormula hereditaryStepFormula params hr bound).2 + rw [fixed] + have pre : ∀ ν ∈ D.names, NameCodeStep s R ν.val → ν.val ∈ R := by + intro ν hν step + have hνM := M.transitive hT hν.1 + have sym := (M.realize_nameSymmetryFormula a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps ν hνM).2 hν.2.symmetric + have member : ν.val ∈ definableOperator M.sets hereditaryStepFormula params T R := + ZFSet.mem_sep.2 ⟨hν.1, + (M.realize_hereditaryStepFormula s pairing carrier params rfl ν.val R hνM hr).2 ⟨sym, step⟩⟩ + rwa [fixed] at member + exact ⟨R, hr, certificate, nameCodePrefixed_complete s D R pre τ ⟨τT, hs⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def uniformHereditaryFormula : SetFormula 6 := + ex (.conj (domainApplication hereditaryCertificateFormula (fun j => j.succ.succ) 0) (.mem 1 0)) + +def liftedHereditaryFormula {k : Nat} (c g i b a : Fin k) : SetFormula (k + 1) := + domainApplication uniformHereditaryFormula + (extend c.succ (extend g.succ (extend i.succ (extend b.succ (extend a.succ Fin.elim0))))) 0 + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem realize_uniformHereditaryFormula (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (x : ZFSet.{u}) (hx : x ∈ M.sets) : + Realize M.sets uniformHereditaryFormula (extend x (symmetryParameters a s t b K)) ↔ + ∃ h : IsName s x, HereditarilySymmetric a s F ⟨x, h⟩ := by + rw [uniformHereditaryFormula, realize_ex] + constructor + · rintro ⟨R, hr, certificate, member⟩ + have cert := (realize_domainApplication M.sets hereditaryCertificateFormula _ _ _).1 certificate + have name := M.hereditaryCertificate_isName s pairing carrier (symmetryParameters a s t b K) rfl hr cert x member + exact ⟨name, M.hereditaryCertificate_sound s a t b F K basis pairing unions powers separation collection + carrier group indices supports maps hr cert ⟨x, name⟩ member⟩ + · rintro ⟨name, hs⟩ + obtain ⟨R, hr, certificate, member⟩ := M.exists_hereditary_certificate a s t b F K basis + pairing unions powers separation collection carrier group indices supports maps ⟨x, name⟩ hx hs + exact ⟨R, hr, (realize_domainApplication M.sets hereditaryCertificateFormula _ _ _).2 certificate, member⟩ + +theorem domainMeaning_liftedHereditary (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {k : Nat} (c g i j l : Fin k) (constants : Fin k → ZFSet.{u}) + (hc : constants c = s.carrier) (hg : constants g = t.carrier) (hi : constants i = b.carrier) + (hj : constants j = supportBasisCode b t K) (hl : constants l = a.conditionMapFamily s t) : + M.DomainMeaning s (a.symmetricDomain s (M.nameDomain s) F) + (liftedHereditaryFormula c g i j l) constants := by + intro x hx + rw [liftedHereditaryFormula, realize_domainApplication, + map_extend, map_extend, map_extend, map_extend, map_extend, map_empty] + change Realize M.sets uniformHereditaryFormula (extend x + (extend (constants c) (extend (constants g) (extend (constants i) + (extend (constants j) (extend (constants l) Fin.elim0)))))) ↔ _ + rw [hc, hg, hi, hj, hl] + change Realize M.sets uniformHereditaryFormula (extend x (symmetryParameters a s t b K)) ↔ _ + rw [M.realize_uniformHereditaryFormula a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps x hx] + constructor + · rintro ⟨name, hs⟩ + exact ⟨⟨⟨x, name⟩, hx, hs⟩, rfl⟩ + · rintro ⟨τ, rfl⟩ + exact ⟨τ.val.property, τ.property.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.SetFormula + +def symmetricGroundPrimitives : ForcingPrimitives 6 := + withGroundEquality 0 1 (liftedHereditaryFormula 0 2 3 4 5) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem realize_symmetricGroundForcing (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {n m : Nat} (φ : SetFormula n) (params : Fin 6 → Fin m) + (pi : Fin m) (names : Fin n → Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params 0) = s.carrier) (ho : env (params 1) = s.conditionOrder) + (hg : env (params 2) = t.carrier) (hi : env (params 3) = b.carrier) + (hj : env (params 4) = supportBasisCode b t K) (hl : env (params 5) = a.conditionMapFamily s t) + (p : P) (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) + (hp : env pi = s.encode p) (hnames : ∀ i, env (names i) = (nameEnv i).val.val) : + Realize M.sets (forcingTranslation symmetricGroundPrimitives φ params pi names) env ↔ + Forces (a.symmetricDomain s (M.nameDomain s) F) φ nameEnv p := + M.realize_forcingWithGroundEquality s (a.symmetricDomain s (M.nameDomain s) F) (fun _ h => h.1) + pairing unions powers separation collection carrier order 0 1 (liftedHereditaryFormula 0 2 3 4 5) + φ params pi names env hc ho + (M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection carrier + group indices supports maps 0 2 3 4 5 _ hc hg hi hj hl) p nameEnv hp hnames + +theorem symmetricForcingSet_mem (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {n : Nat} (φ : SetFormula n) (nameEnv : Assignment (a.symmetricDomain s (M.nameDomain s) F) n) : + s.subset (fun p => Forces (a.symmetricDomain s (M.nameDomain s) F) φ nameEnv p) ∈ M.sets := by + let context := extend s.carrier (extend s.conditionOrder (extend t.carrier (extend b.carrier + (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) (fun i => (nameEnv i).val.val)))))) + let params : Fin 6 → Fin (n + 6) := extend 0 (extend 1 (extend 2 (extend 3 (extend 4 (extend 5 Fin.elim0))))) + have members : ∀ i, context i ∈ M.sets := + Fin.cases carrier (Fin.cases order (Fin.cases group (Fin.cases indices (Fin.cases supports + (Fin.cases maps (fun i => (nameEnv i).property.1)))))) + apply M.forcingSet_mem_withGroundEquality s (a.symmetricDomain s (M.nameDomain s) F) (fun _ h => h.1) + pairing unions powers separation collection carrier order 0 1 (liftedHereditaryFormula 0 2 3 4 5) φ + params (fun i => i.succ.succ.succ.succ.succ.succ) context members rfl rfl + · exact M.domainMeaning_liftedHereditary a s t b F K basis pairing unions powers separation collection + carrier group indices supports maps 0 2 3 4 5 _ rfl rfl rfl rfl rfl + · exact fun _ => rfl + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/TaskTransportCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/TaskTransportCodes.lean index 94da349aa295d6558385b2550be49198340d87a6..5fa99442398e295d9214701bb886537277233e4a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/TaskTransportCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/TaskTransportCodes.lean @@ -1,148 +1,148 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedFilterImages -import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -theorem EligibleTaskCode.transport {P G r μ A a c base s F m inv e δ c' s' : ZFSet.{u}} - (code : EligibleTaskCode P G r μ A a c base s F) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hδ : δ ∈ G) - (target : ZFSet.pair (ZFSet.pair δ c) c' ∈ A) - (separator : ZFSet.pair (ZFSet.pair δ s) s' ∈ A) : - EligibleTaskCode P G r μ A a c' (actionPostcompose P A δ base) s' (actionImage P A δ F) := by - refine ⟨code.source_mem, (ZFSet.pair_mem_prod.1 (action.function.1 target)).2, - (ZFSet.pair_mem_prod.1 (action.function.1 separator)).2, - actionImage_filter group action meet hδ code.filter, - (action.raw_order_iff group meet.order hδ target separator).2 code.lower, - fun h => code.strict ((action.raw_order_iff group meet.order hδ separator target).1 h), - actionImage_lower_bound action code.filter.subset hδ code.separator_mem separator code.upper, ?_⟩ - obtain ⟨g, hg, represented⟩ := code.representative - obtain ⟨k, product, _⟩ := group.mul_function.2 (ZFSet.pair δ g) (ZFSet.pair_mem_prod.2 ⟨hδ, hg⟩) - have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2 - exact ⟨k, hk, represented.transport action hg hδ hk product target⟩ - -def TaskTransportCode (P R U Labels A g t t' : ZFSet.{u}) : Prop := - ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ s ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, - ∃ c' ∈ P, ∃ base' ∈ R, ∃ s' ∈ P, ∃ F' ∈ U, - t = literalTaskCode a c base s F label ∧ - t' = literalTaskCode a c' base' s' F' label ∧ - ZFSet.pair (ZFSet.pair g c) c' ∈ A ∧ ZFSet.pair (ZFSet.pair g s) s' ∈ A ∧ - base' = actionPostcompose P A g base ∧ F' = actionImage P A g F - -theorem TaskTransportCode.unique {G P m e r A R U Labels g t t' t'' : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (hg : g ∈ G) - (first : TaskTransportCode P R U Labels A g t t') - (second : TaskTransportCode P R U Labels A g t t'') : t' = t'' := by - obtain ⟨a, _, c, hc, base, _, s, hs, F, _, label, _, c', _, base', _, s', _, F', _, - old, new, target, separator, baseEq, filterEq⟩ := first - obtain ⟨b, _, d, _, ell, _, v, _, J, _, tag, _, d', _, ell', _, v', _, J', _, - old', new', target', separator', baseEq', filterEq'⟩ := second - obtain ⟨ha, hd, hell, hv, hJ, htag⟩ := literalTaskCode_inj.1 (old.symm.trans old') - subst b d ell v J tag - obtain ⟨w, _, uniqueC⟩ := action.function.2 (ZFSet.pair g c) (ZFSet.pair_mem_prod.2 ⟨hg, hc⟩) - obtain ⟨v, _, uniqueS⟩ := action.function.2 (ZFSet.pair g s) (ZFSet.pair_mem_prod.2 ⟨hg, hs⟩) - have hc' := (uniqueC c' target).trans (uniqueC d' target').symm - have hs' := (uniqueS s' separator).trans (uniqueS v' separator').symm - rw [new, new', hc', hs', baseEq, baseEq', filterEq, filterEq'] - -theorem TaskTransportCode.one {G P m e r A R U Labels t : ZFSet.{u}} - (action : PosetActionCode G P m e r A) - (shape : ∀ base ∈ R, base ⊆ ZFSet.prod P P) (subsets : ∀ F ∈ U, F ⊆ P) - (ht : t ∈ literalTaskBound P R U Labels) : TaskTransportCode P R U Labels A e t t := by - obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, rfl⟩ := - (mem_literalTaskBound P R U Labels t).1 ht - exact ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, - c, hc, base, hbase, s, hs, F, hF, rfl, rfl, action.one c hc, action.one s hs, - (actionPostcompose_one action (shape base hbase)).symm, - (actionImage_one action (subsets F hF)).symm⟩ - -theorem TaskTransportCode.mul {G P m e r A R U Labels g h k t t' t'' : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (subsets : ∀ F ∈ U, F ⊆ P) - (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) - (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) - (first : TaskTransportCode P R U Labels A h t t') - (second : TaskTransportCode P R U Labels A g t' t'') : - TaskTransportCode P R U Labels A k t t'' := by - obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, - c', hc', base', _, s', hs', F', _, old, middle, target, separator, baseEq, filterEq⟩ := first - obtain ⟨b, _, d, _, ell, _, v, _, J, _, tag, _, - d', hd', ell', hell', v', hv', J', hJ', middle', new, target', separator', baseEq', filterEq'⟩ := second - obtain ⟨ha', hd, hell, hv, hJ, htag⟩ := literalTaskCode_inj.1 (middle.symm.trans middle') - subst b d ell v J tag - refine ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, - d', hd', ell', hell', v', hv', J', hJ', old, new, - action.mul g hg h hh k hk c hc c' hc' d' hd' product target target', - action.mul g hg h hh k hk s hs s' hs' v' hv' product separator separator', ?_, ?_⟩ - · rw [baseEq', baseEq, actionPostcompose_mul action hg hh hk product] - · rw [filterEq', filterEq, actionImage_mul action (subsets F hF) hg hh hk product] - -noncomputable def taskTransportGraph (G I P R U Labels A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ g ∈ G, ∃ t ∈ I, ∃ t' ∈ I, - z = ZFSet.pair (ZFSet.pair g t) t' ∧ TaskTransportCode P R U Labels A g t t') - (ZFSet.prod (ZFSet.prod G I) I) - -theorem taskTransportGraph_subset (G I P R U Labels A : ZFSet.{u}) : - taskTransportGraph G I P R U Labels A ⊆ ZFSet.prod (ZFSet.prod G I) I := - fun _ h => (ZFSet.mem_sep.1 h).1 - -theorem triple_mem_taskTransportGraph (G I P R U Labels A g t t' : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g t) t' ∈ taskTransportGraph G I P R U Labels A ↔ - g ∈ G ∧ t ∈ I ∧ t' ∈ I ∧ TaskTransportCode P R U Labels A g t t' := by - rw [taskTransportGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, g', hg, s, hs, s', hs', equal, transported⟩ - obtain ⟨pairEq, last⟩ := ZFSet.pair_inj.1 equal - obtain ⟨first, middle⟩ := ZFSet.pair_inj.1 pairEq - subst g' s s' - exact ⟨hg, hs, hs', transported⟩ - · rintro ⟨hg, ht, ht', transported⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, ht⟩, ht'⟩, - g, hg, t, ht, t', ht', rfl, transported⟩ - -theorem taskTransportGraph_function {G I P R U Labels A m e r : ZFSet.{u}} - (action : PosetActionCode G P m e r A) - (total : ∀ g ∈ G, ∀ t ∈ I, ∃ t' ∈ I, TaskTransportCode P R U Labels A g t t') : - ZFSet.IsFunc (ZFSet.prod G I) I (taskTransportGraph G I P R U Labels A) := by - refine ⟨taskTransportGraph_subset G I P R U Labels A, ?_⟩ - intro v hv - obtain ⟨g, hg, t, ht, rfl⟩ := ZFSet.mem_prod.1 hv - obtain ⟨t', ht', transported⟩ := total g hg t ht - refine ⟨t', (triple_mem_taskTransportGraph G I P R U Labels A g t t').2 - ⟨hg, ht, ht', transported⟩, ?_⟩ - intro t'' entry - have parts := (triple_mem_taskTransportGraph G I P R U Labels A g t t'').1 entry - exact TaskTransportCode.unique action hg parts.2.2.2 transported - -theorem taskTransportGraph_one {G I P R U Labels A m e r : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (he : e ∈ G) - (shape : ∀ base ∈ R, base ⊆ ZFSet.prod P P) (subsets : ∀ F ∈ U, F ⊆ P) - (bound : I ⊆ literalTaskBound P R U Labels) : - ∀ t ∈ I, ZFSet.pair (ZFSet.pair e t) t ∈ taskTransportGraph G I P R U Labels A := by - intro t ht - exact (triple_mem_taskTransportGraph G I P R U Labels A e t t).2 - ⟨he, ht, ht, TaskTransportCode.one action shape subsets (bound ht)⟩ - -theorem taskTransportGraph_mul {G I P R U Labels A m e r : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (subsets : ∀ F ∈ U, F ⊆ P) - {g h k t t' t'' : ZFSet.{u}} (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) - (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) - (first : ZFSet.pair (ZFSet.pair h t) t' ∈ taskTransportGraph G I P R U Labels A) - (second : ZFSet.pair (ZFSet.pair g t') t'' ∈ taskTransportGraph G I P R U Labels A) : - ZFSet.pair (ZFSet.pair k t) t'' ∈ taskTransportGraph G I P R U Labels A := by - have parts := (triple_mem_taskTransportGraph G I P R U Labels A h t t').1 first - have parts' := (triple_mem_taskTransportGraph G I P R U Labels A g t' t'').1 second - exact (triple_mem_taskTransportGraph G I P R U Labels A k t t'').2 - ⟨hk, parts.2.1, parts'.2.2.1, - TaskTransportCode.mul action subsets hg hh hk product parts.2.2.2 parts'.2.2.2⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedFilterImages +import OAI.SetTheory.PartitionPrinciple.Definability.TaskRepresentativeCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +theorem EligibleTaskCode.transport {P G r μ A a c base s F m inv e δ c' s' : ZFSet.{u}} + (code : EligibleTaskCode P G r μ A a c base s F) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hδ : δ ∈ G) + (target : ZFSet.pair (ZFSet.pair δ c) c' ∈ A) + (separator : ZFSet.pair (ZFSet.pair δ s) s' ∈ A) : + EligibleTaskCode P G r μ A a c' (actionPostcompose P A δ base) s' (actionImage P A δ F) := by + refine ⟨code.source_mem, (ZFSet.pair_mem_prod.1 (action.function.1 target)).2, + (ZFSet.pair_mem_prod.1 (action.function.1 separator)).2, + actionImage_filter group action meet hδ code.filter, + (action.raw_order_iff group meet.order hδ target separator).2 code.lower, + fun h => code.strict ((action.raw_order_iff group meet.order hδ separator target).1 h), + actionImage_lower_bound action code.filter.subset hδ code.separator_mem separator code.upper, ?_⟩ + obtain ⟨g, hg, represented⟩ := code.representative + obtain ⟨k, product, _⟩ := group.mul_function.2 (ZFSet.pair δ g) (ZFSet.pair_mem_prod.2 ⟨hδ, hg⟩) + have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2 + exact ⟨k, hk, represented.transport action hg hδ hk product target⟩ + +def TaskTransportCode (P R U Labels A g t t' : ZFSet.{u}) : Prop := + ∃ a ∈ P, ∃ c ∈ P, ∃ base ∈ R, ∃ s ∈ P, ∃ F ∈ U, ∃ label ∈ Labels, + ∃ c' ∈ P, ∃ base' ∈ R, ∃ s' ∈ P, ∃ F' ∈ U, + t = literalTaskCode a c base s F label ∧ + t' = literalTaskCode a c' base' s' F' label ∧ + ZFSet.pair (ZFSet.pair g c) c' ∈ A ∧ ZFSet.pair (ZFSet.pair g s) s' ∈ A ∧ + base' = actionPostcompose P A g base ∧ F' = actionImage P A g F + +theorem TaskTransportCode.unique {G P m e r A R U Labels g t t' t'' : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (hg : g ∈ G) + (first : TaskTransportCode P R U Labels A g t t') + (second : TaskTransportCode P R U Labels A g t t'') : t' = t'' := by + obtain ⟨a, _, c, hc, base, _, s, hs, F, _, label, _, c', _, base', _, s', _, F', _, + old, new, target, separator, baseEq, filterEq⟩ := first + obtain ⟨b, _, d, _, ell, _, v, _, J, _, tag, _, d', _, ell', _, v', _, J', _, + old', new', target', separator', baseEq', filterEq'⟩ := second + obtain ⟨ha, hd, hell, hv, hJ, htag⟩ := literalTaskCode_inj.1 (old.symm.trans old') + subst b d ell v J tag + obtain ⟨w, _, uniqueC⟩ := action.function.2 (ZFSet.pair g c) (ZFSet.pair_mem_prod.2 ⟨hg, hc⟩) + obtain ⟨v, _, uniqueS⟩ := action.function.2 (ZFSet.pair g s) (ZFSet.pair_mem_prod.2 ⟨hg, hs⟩) + have hc' := (uniqueC c' target).trans (uniqueC d' target').symm + have hs' := (uniqueS s' separator).trans (uniqueS v' separator').symm + rw [new, new', hc', hs', baseEq, baseEq', filterEq, filterEq'] + +theorem TaskTransportCode.one {G P m e r A R U Labels t : ZFSet.{u}} + (action : PosetActionCode G P m e r A) + (shape : ∀ base ∈ R, base ⊆ ZFSet.prod P P) (subsets : ∀ F ∈ U, F ⊆ P) + (ht : t ∈ literalTaskBound P R U Labels) : TaskTransportCode P R U Labels A e t t := by + obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, rfl⟩ := + (mem_literalTaskBound P R U Labels t).1 ht + exact ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, + c, hc, base, hbase, s, hs, F, hF, rfl, rfl, action.one c hc, action.one s hs, + (actionPostcompose_one action (shape base hbase)).symm, + (actionImage_one action (subsets F hF)).symm⟩ + +theorem TaskTransportCode.mul {G P m e r A R U Labels g h k t t' t'' : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (subsets : ∀ F ∈ U, F ⊆ P) + (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) + (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) + (first : TaskTransportCode P R U Labels A h t t') + (second : TaskTransportCode P R U Labels A g t' t'') : + TaskTransportCode P R U Labels A k t t'' := by + obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, + c', hc', base', _, s', hs', F', _, old, middle, target, separator, baseEq, filterEq⟩ := first + obtain ⟨b, _, d, _, ell, _, v, _, J, _, tag, _, + d', hd', ell', hell', v', hv', J', hJ', middle', new, target', separator', baseEq', filterEq'⟩ := second + obtain ⟨ha', hd, hell, hv, hJ, htag⟩ := literalTaskCode_inj.1 (middle.symm.trans middle') + subst b d ell v J tag + refine ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, label, hlabel, + d', hd', ell', hell', v', hv', J', hJ', old, new, + action.mul g hg h hh k hk c hc c' hc' d' hd' product target target', + action.mul g hg h hh k hk s hs s' hs' v' hv' product separator separator', ?_, ?_⟩ + · rw [baseEq', baseEq, actionPostcompose_mul action hg hh hk product] + · rw [filterEq', filterEq, actionImage_mul action (subsets F hF) hg hh hk product] + +noncomputable def taskTransportGraph (G I P R U Labels A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ g ∈ G, ∃ t ∈ I, ∃ t' ∈ I, + z = ZFSet.pair (ZFSet.pair g t) t' ∧ TaskTransportCode P R U Labels A g t t') + (ZFSet.prod (ZFSet.prod G I) I) + +theorem taskTransportGraph_subset (G I P R U Labels A : ZFSet.{u}) : + taskTransportGraph G I P R U Labels A ⊆ ZFSet.prod (ZFSet.prod G I) I := + fun _ h => (ZFSet.mem_sep.1 h).1 + +theorem triple_mem_taskTransportGraph (G I P R U Labels A g t t' : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g t) t' ∈ taskTransportGraph G I P R U Labels A ↔ + g ∈ G ∧ t ∈ I ∧ t' ∈ I ∧ TaskTransportCode P R U Labels A g t t' := by + rw [taskTransportGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, g', hg, s, hs, s', hs', equal, transported⟩ + obtain ⟨pairEq, last⟩ := ZFSet.pair_inj.1 equal + obtain ⟨first, middle⟩ := ZFSet.pair_inj.1 pairEq + subst g' s s' + exact ⟨hg, hs, hs', transported⟩ + · rintro ⟨hg, ht, ht', transported⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, ht⟩, ht'⟩, + g, hg, t, ht, t', ht', rfl, transported⟩ + +theorem taskTransportGraph_function {G I P R U Labels A m e r : ZFSet.{u}} + (action : PosetActionCode G P m e r A) + (total : ∀ g ∈ G, ∀ t ∈ I, ∃ t' ∈ I, TaskTransportCode P R U Labels A g t t') : + ZFSet.IsFunc (ZFSet.prod G I) I (taskTransportGraph G I P R U Labels A) := by + refine ⟨taskTransportGraph_subset G I P R U Labels A, ?_⟩ + intro v hv + obtain ⟨g, hg, t, ht, rfl⟩ := ZFSet.mem_prod.1 hv + obtain ⟨t', ht', transported⟩ := total g hg t ht + refine ⟨t', (triple_mem_taskTransportGraph G I P R U Labels A g t t').2 + ⟨hg, ht, ht', transported⟩, ?_⟩ + intro t'' entry + have parts := (triple_mem_taskTransportGraph G I P R U Labels A g t t'').1 entry + exact TaskTransportCode.unique action hg parts.2.2.2 transported + +theorem taskTransportGraph_one {G I P R U Labels A m e r : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (he : e ∈ G) + (shape : ∀ base ∈ R, base ⊆ ZFSet.prod P P) (subsets : ∀ F ∈ U, F ⊆ P) + (bound : I ⊆ literalTaskBound P R U Labels) : + ∀ t ∈ I, ZFSet.pair (ZFSet.pair e t) t ∈ taskTransportGraph G I P R U Labels A := by + intro t ht + exact (triple_mem_taskTransportGraph G I P R U Labels A e t t).2 + ⟨he, ht, ht, TaskTransportCode.one action shape subsets (bound ht)⟩ + +theorem taskTransportGraph_mul {G I P R U Labels A m e r : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (subsets : ∀ F ∈ U, F ⊆ P) + {g h k t t' t'' : ZFSet.{u}} (hg : g ∈ G) (hh : h ∈ G) (hk : k ∈ G) + (product : ZFSet.pair (ZFSet.pair g h) k ∈ m) + (first : ZFSet.pair (ZFSet.pair h t) t' ∈ taskTransportGraph G I P R U Labels A) + (second : ZFSet.pair (ZFSet.pair g t') t'' ∈ taskTransportGraph G I P R U Labels A) : + ZFSet.pair (ZFSet.pair k t) t'' ∈ taskTransportGraph G I P R U Labels A := by + have parts := (triple_mem_taskTransportGraph G I P R U Labels A h t t').1 first + have parts' := (triple_mem_taskTransportGraph G I P R U Labels A g t' t'').1 second + exact (triple_mem_taskTransportGraph G I P R U Labels A k t t'').2 + ⟨hk, parts.2.1, parts'.2.2.1, + TaskTransportCode.mul action subsets hg hh hk product parts.2.2.2 parts'.2.2.2⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundNames.lean index 5f8bd54c4dec4b06a32913ae1e16d3266f68d7e5..acc139e8da40187afd20eb0363182f21956b7d1f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundNames.lean @@ -1,439 +1,439 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.UniformAtomicEquality - -namespace OAI - - -namespace PartitionPilot.Forcing - -open SetRealization -universe u -variable {P : Type u} (s : Presentation P) - -def NameCodeStep (S x : ZFSet.{u}) : Prop := - ∀ z ∈ x, ∃ y ∈ S, ∃ p, z = ZFSet.pair y (s.encode p) - -theorem nameCodeStep_mono {S T x : ZFSet.{u}} (sub : S ⊆ T) (h : NameCodeStep s S x) : - NameCodeStep s T x := by - intro z hz - obtain ⟨y, hy, p, shape⟩ := h z hz - exact ⟨y, sub hy, p, shape⟩ - -theorem nameCodePostfixed_sound (S : ZFSet.{u}) (post : ∀ x ∈ S, NameCodeStep s S x) : - ∀ x ∈ S, IsName s x := by - intro x - apply (InvImage.wf (fun z : ZFSet.{u} => ZFSet.rank z) wellFounded_lt).induction x - intro x ih hx - apply IsName.mk - · intro z hz - obtain ⟨y, _, p, shape⟩ := post x hx z hz - exact ⟨y, p, shape⟩ - · intro y p entry - obtain ⟨v, hv, q, shape⟩ := post x hx _ entry - have eq := (ZFSet.pair_inj.1 shape).1 - have hy : y ∈ S := eq ▸ hv - have lt : ZFSet.rank y < ZFSet.rank x := - (ZFSet.rank_lt_of_mem (ZFSet.mem_singleton.2 rfl : y ∈ ({y} : ZFSet.{u}))).trans - ((ZFSet.rank_lt_of_mem (ZFSet.mem_pair.2 (Or.inl rfl) : - ({y} : ZFSet.{u}) ∈ ZFSet.pair y (s.encode p))).trans (ZFSet.rank_lt_of_mem entry)) - exact ih y lt hy - -theorem nameCodePrefixed_complete (D : Name.NameDomain s) (S : ZFSet.{u}) - (pre : ∀ τ ∈ D.names, NameCodeStep s S τ.val → τ.val ∈ S) : - ∀ τ ∈ D.names, τ.val ∈ S := by - intro τ - induction τ using Name.inductionOn with - | step τ ih => - intro hτ - apply pre τ hτ - intro z hz - obtain ⟨ν, p, rfl⟩ := Name.entries_cover τ hz - exact ⟨ν.val, ih ν p hz (D.children hτ hz), p, rfl⟩ - -namespace SetFormula - -def nameCodeStepFormula : SetFormula 3 := - .all (imp (.mem 0 1) (ex (.conj (.mem 0 3) - (exConditions 4 (orderedPairFormula 2 1 0))))) - -def nameCertificateFormula : SetFormula 2 := postfixedFormula nameCodeStepFormula - -end SetFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_nameCodeStepFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) - (x S : ZFSet.{u}) (hx : x ∈ M.sets) (hS : S ∈ M.sets) : - Realize M.sets nameCodeStepFormula (extend x (extend S (extend s.carrier Fin.elim0))) ↔ - NameCodeStep s S x := by - let env := extend x (extend S (extend s.carrier Fin.elim0)) - change (∀ z ∈ M.sets, Realize M.sets _ (extend z env)) ↔ _ - constructor - · intro h z hz - obtain ⟨y, hy, member, rest⟩ := (realize_ex M.sets _ _).1 - ((realize_imp M.sets _ _ _).1 (h z (M.transitive hx hz)) hz) - obtain ⟨p, shape⟩ := (M.realize_exConditions s 4 _ (extend y (extend z env)) carrier rfl).1 rest - exact ⟨y, member, p, - (M.realize_orderedPairFormula pairing 2 1 0 (extend (s.encode p) (extend y (extend z env))) - (M.transitive hx hz) hy (M.transitive carrier (s.encode_mem p))).1 shape⟩ - · intro h z hzM - apply (realize_imp M.sets _ _ _).2 - intro hz - obtain ⟨y, hy, p, shape⟩ := h z hz - rw [realize_ex] - refine ⟨y, M.transitive hS hy, hy, ?_⟩ - apply (M.realize_exConditions s 4 _ (extend y (extend z env)) carrier rfl).2 - exact ⟨p, (M.realize_orderedPairFormula pairing 2 1 0 - (extend (s.encode p) (extend y (extend z env))) hzM (M.transitive hS hy) - (M.transitive carrier (s.encode_mem p))).2 shape⟩ - -theorem nameCertificate_sound - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) - {S : ZFSet.{u}} (hS : S ∈ M.sets) - (certificate : Realize M.sets nameCertificateFormula (extend S (extend s.carrier Fin.elim0))) : - ∀ x ∈ S, IsName s x := by - apply nameCodePostfixed_sound s S - intro x hx - exact (M.realize_nameCodeStepFormula s pairing carrier x S (M.transitive hS hx) hS).1 - ((realize_imp M.sets _ _ _).1 (certificate x (M.transitive hS hx)) hx) - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.SetFormula - -universe u - -structure ForcingPrimitives (k : Nat) where - carrier : Fin k - order : Fin k - equality : SetFormula (k + 3) - domain : SetFormula (k + 1) - -def domainApplication {k m : Nat} (N : SetFormula (k + 1)) - (params : Fin k → Fin m) (x : Fin m) : SetFormula m := reindex (extend x params) N - -theorem realize_domainApplication (U : Set ZFSet.{u}) {k m : Nat} - (N : SetFormula (k + 1)) (params : Fin k → Fin m) (x : Fin m) (env : Fin m → ZFSet.{u}) : - Realize U (domainApplication N params x) env ↔ - Realize U N (extend (env x) (fun i => env (params i))) := by - rw [domainApplication, realize_reindex, map_extend] - -def forcingTranslation {k : Nat} (A : ForcingPrimitives k) : - {n m : Nat} → SetFormula n → (Fin k → Fin m) → Fin m → (Fin n → Fin m) → SetFormula m - | _, _, .equal i j, params, p, names => atomicApplication A.equality params p (names i) (names j) - | _, _, .mem i j, params, p, names => - membershipFormula A.equality A.carrier A.order params p (names i) (names j) - | _, _, .neg φ, params, p, names => - allConditions (params A.carrier) <| - imp (pairMembershipFormula 0 p.succ (params A.order).succ) <| - .neg (forcingTranslation A φ (fun j => (params j).succ) 0 (fun i => (names i).succ)) - | _, _, .conj φ ψ, params, p, names => - .conj (forcingTranslation A φ params p names) (forcingTranslation A ψ params p names) - | _, _, .all φ, params, p, names => - .all <| imp (domainApplication A.domain (fun j => (params j).succ) 0) <| - forcingTranslation A φ (fun j => (params j).succ) p.succ - (extend 0 (fun i => (names i).succ)) - -end PartitionPilot.Forcing.SetFormula - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -def DomainMeaning (D : Name.NameDomain s) {k : Nat} (N : SetFormula (k + 1)) - (constants : Fin k → ZFSet.{u}) : Prop := - ∀ x ∈ M.sets, Realize M.sets N (extend x constants) ↔ ∃ τ : D.names, τ.val.val = x - -theorem realize_forcingTranslation (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k n : Nat} (A : ForcingPrimitives k) (φ : SetFormula n) : - ∀ {m} (params : Fin k → Fin m) (pi : Fin m) (names : Fin n → Fin m) - (env : Fin m → ZFSet.{u}), - env (params A.carrier) = s.carrier → env (params A.order) = s.conditionOrder → - M.EqualityMeaning s D A.equality (fun j => env (params j)) → - M.DomainMeaning s D A.domain (fun j => env (params j)) → - ∀ (p : P) (nameEnv : Assignment D n), env pi = s.encode p → - (∀ i, env (names i) = (nameEnv i).val.val) → - (Realize M.sets (forcingTranslation A φ params pi names) env ↔ Forces D φ nameEnv p) := by - induction φ with - | equal i j => - intro m params pi names env hc ho atomic domain p nameEnv hp hnames - change Realize M.sets (atomicApplication A.equality params pi (names i) (names j)) env ↔ _ - rw [realize_atomicApplication, hp, hnames i, hnames j] - exact atomic p (nameEnv i) (nameEnv j) - | mem i j => - intro m params pi names env hc ho atomic domain p nameEnv hp hnames - exact M.realize_membershipFormula s D ground pairing carrier order A.equality - A.carrier A.order params pi (names i) (names j) env hc ho atomic p - (nameEnv i) (nameEnv j) hp (hnames i) (hnames j) - | neg φ ih => - intro m params pi names env hc ho atomic domain p nameEnv hp hnames - change Realize M.sets (allConditions _ _) env ↔ - ∀ q, q ≤ p → ¬ Forces D φ nameEnv q - rw [M.realize_allConditions s (params A.carrier) _ env carrier hc] - apply forall_congr' - intro q - rw [realize_imp, M.realize_conditionLE s pairing carrier order 0 pi.succ - (params A.order).succ (extend (s.encode q) env) q p rfl hp ho] - apply forall_congr' - intro _ - exact not_congr (ih (fun j => (params j).succ) 0 (fun i => (names i).succ) - (extend (s.encode q) env) hc ho atomic domain q nameEnv rfl hnames) - | conj φ ψ ihφ ihψ => - intro m params pi names env hc ho atomic domain p nameEnv hp hnames - exact and_congr (ihφ params pi names env hc ho atomic domain p nameEnv hp hnames) - (ihψ params pi names env hc ho atomic domain p nameEnv hp hnames) - | all φ ih => - intro m params pi names env hc ho atomic domain p nameEnv hp hnames - change (∀ x ∈ M.sets, Realize M.sets (imp - (domainApplication A.domain (fun j => (params j).succ) 0) - (forcingTranslation A φ (fun j => (params j).succ) pi.succ - (extend 0 (fun i => (names i).succ)))) (extend x env)) ↔ - ∀ τ : D.names, Forces D φ (extend τ nameEnv) p - constructor - · intro h τ - have hx := ground τ.val τ.property - have belongs : Realize M.sets (domainApplication A.domain (fun j => (params j).succ) 0) - (extend τ.val.val env) := - (realize_domainApplication M.sets A.domain _ _ _).2 ((domain τ.val.val hx).2 ⟨τ, rfl⟩) - have body := (realize_imp M.sets _ _ _).1 (h τ.val.val hx) belongs - apply (ih (fun j => (params j).succ) pi.succ (extend 0 (fun i => (names i).succ)) - (extend τ.val.val env) hc ho atomic domain p (extend τ nameEnv) hp ?_).1 body - intro i - exact Fin.cases rfl (fun j => hnames j) i - · intro h x hx - rw [realize_imp, realize_domainApplication] - intro belongs - obtain ⟨τ, rfl⟩ := (domain x hx).1 belongs - apply (ih (fun j => (params j).succ) pi.succ (extend 0 (fun i => (names i).succ)) - (extend τ.val.val env) hc ho atomic domain p (extend τ nameEnv) hp ?_).2 (h τ) - intro i - exact Fin.cases rfl (fun j => hnames j) i - - - - - - -theorem forcingSet_mem (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (separation : SeparationSchema M.sets) - {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula n) - (params : Fin k → Fin m) (names : Fin n → Fin m) (context : Fin m → ZFSet.{u}) - (members : ∀ i, context i ∈ M.sets) - (hc : context (params A.carrier) = s.carrier) - (ho : context (params A.order) = s.conditionOrder) - (atomic : M.EqualityMeaning s D A.equality (fun j => context (params j))) - (domain : M.DomainMeaning s D A.domain (fun j => context (params j))) - (nameEnv : Assignment D n) (hnames : ∀ i, context (names i) = (nameEnv i).val.val) : - s.subset (fun p => Forces D φ nameEnv p) ∈ M.sets := by - let translated := forcingTranslation A φ (fun j => (params j).succ) 0 (fun i => (names i).succ) - have selected := M.separation_mem separation translated context members carrier - have eq : ZFSet.sep (fun z => Realize M.sets translated (extend z context)) s.carrier = - s.subset (fun p => Forces D φ nameEnv p) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, s.mem_subset] - constructor - · rintro ⟨hz, truth⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz - exact ⟨p, (M.realize_forcingTranslation s D ground pairing carrier order A φ - (fun j => (params j).succ) 0 (fun i => (names i).succ) (extend (s.encode p) context) - hc ho atomic domain p nameEnv rfl hnames).1 truth, rfl⟩ - · rintro ⟨p, forced, rfl⟩ - exact ⟨s.encode_mem p, (M.realize_forcingTranslation s D ground pairing carrier order A φ - (fun j => (params j).succ) 0 (fun i => (names i).succ) (extend (s.encode p) context) - hc ho atomic domain p nameEnv rfl hnames).2 forced⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem exists_groundName_certificate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) : - ∃ S ∈ M.sets, Realize M.sets nameCertificateFormula (extend S (extend s.carrier Fin.elim0)) ∧ - τ.val ∈ S := by - obtain ⟨T, hT, τT, trans⟩ := M.exists_transitiveCover pairing unions separation collection τ.val hτ - let D := namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy) - let params := extend s.carrier Fin.elim0 - have members : ∀ i, params i ∈ M.sets := Fin.cases carrier (fun i => Fin.elim0 i) - have mono : ∀ S ∈ M.sets, ∀ U ∈ M.sets, S ⊆ T → U ⊆ T → S ⊆ U → - definableOperator M.sets nameCodeStepFormula params T S ⊆ - definableOperator M.sets nameCodeStepFormula params T U := by - intro S hS U hU _ _ sub x hx - obtain ⟨hxT, step⟩ := ZFSet.mem_sep.1 hx - have hxM := M.transitive hT hxT - exact ZFSet.mem_sep.2 ⟨hxT, (M.realize_nameCodeStepFormula s pairing carrier x U hxM hU).2 - (nameCodeStep_mono s sub ((M.realize_nameCodeStepFormula s pairing carrier x S hxM hS).1 step))⟩ - obtain ⟨S, hS, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation - nameCodeStepFormula params members hT mono - have certificate : Realize M.sets nameCertificateFormula (extend S params) := by - apply (M.realize_postfixedFormula nameCodeStepFormula params hS bound).2 - rw [fixed] - have pre : ∀ ν ∈ D.names, NameCodeStep s S ν.val → ν.val ∈ S := by - intro ν hν step - have member : ν.val ∈ definableOperator M.sets nameCodeStepFormula params T S := - ZFSet.mem_sep.2 ⟨hν, (M.realize_nameCodeStepFormula s pairing carrier ν.val S - (M.transitive hT hν) hS).2 step⟩ - rwa [fixed] at member - exact ⟨S, hS, certificate, nameCodePrefixed_complete s D S pre τ τT⟩ - -theorem isName_iff_exists_certificate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (x : ZFSet.{u}) (hx : x ∈ M.sets) : - IsName s x ↔ - ∃ S ∈ M.sets, Realize M.sets nameCertificateFormula (extend S (extend s.carrier Fin.elim0)) ∧ - x ∈ S := by - constructor - · intro name - exact M.exists_groundName_certificate s pairing unions powers separation collection carrier ⟨x, name⟩ hx - · rintro ⟨S, hS, certificate, member⟩ - exact M.nameCertificate_sound s pairing carrier hS certificate x member - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def withGroundEquality {k : Nat} (c o : Fin k) (N : SetFormula (k + 1)) : ForcingPrimitives k where - carrier := c - order := o - equality := liftedEqualityFormula c o - domain := N - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_forcingWithGroundEquality (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k n m : Nat} (c o : Fin k) (N : SetFormula (k + 1)) (φ : SetFormula n) - (params : Fin k → Fin m) (pi : Fin m) (names : Fin n → Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (domain : M.DomainMeaning s D N (fun j => env (params j))) - (p : P) (nameEnv : Assignment D n) (hp : env pi = s.encode p) - (hnames : ∀ i, env (names i) = (nameEnv i).val.val) : - Realize M.sets (forcingTranslation (withGroundEquality c o N) φ params pi names) env ↔ - Forces D φ nameEnv p := - M.realize_forcingTranslation s D ground pairing carrier order (withGroundEquality c o N) φ - params pi names env hc ho - (M.equalityMeaning_lifted s D ground pairing unions powers separation collection carrier order c o _ hc ho) - domain p nameEnv hp hnames - -theorem forcingSet_mem_withGroundEquality (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k n m : Nat} (c o : Fin k) (N : SetFormula (k + 1)) (φ : SetFormula n) - (params : Fin k → Fin m) (names : Fin n → Fin m) (context : Fin m → ZFSet.{u}) - (members : ∀ i, context i ∈ M.sets) - (hc : context (params c) = s.carrier) (ho : context (params o) = s.conditionOrder) - (domain : M.DomainMeaning s D N (fun j => context (params j))) - (nameEnv : Assignment D n) (hnames : ∀ i, context (names i) = (nameEnv i).val.val) : - s.subset (fun p => Forces D φ nameEnv p) ∈ M.sets := - M.forcingSet_mem s D ground pairing carrier order separation (withGroundEquality c o N) φ params names - context members hc ho - (M.equalityMeaning_lifted s D ground pairing unions powers separation collection carrier order c o _ hc ho) - domain nameEnv hnames - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.SetFormula - -def uniformNameFormula : SetFormula 2 := - ex (.conj (domainApplication nameCertificateFormula (extend 2 Fin.elim0) 0) (.mem 1 0)) - -def liftedNameFormula {k : Nat} (c : Fin k) : SetFormula (k + 1) := - domainApplication uniformNameFormula (extend c.succ Fin.elim0) 0 - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) - -theorem realize_uniformNameFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (x : ZFSet.{u}) (hx : x ∈ M.sets) : - Realize M.sets uniformNameFormula (extend x (extend s.carrier Fin.elim0)) ↔ IsName s x := by - rw [M.isName_iff_exists_certificate s pairing unions powers separation collection carrier x hx, - uniformNameFormula, realize_ex] - apply exists_congr - intro S - apply and_congr_right - intro _ - change (Realize M.sets _ _ ∧ x ∈ S) ↔ _ - rw [realize_domainApplication, map_extend, map_empty] - rfl - -theorem domainMeaning_liftedNames - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) - {k : Nat} (c : Fin k) (constants : Fin k → ZFSet.{u}) (hc : constants c = s.carrier) : - M.DomainMeaning s (M.nameDomain s) (liftedNameFormula c) constants := by - intro x hx - rw [liftedNameFormula, realize_domainApplication, map_extend, map_empty] - change Realize M.sets uniformNameFormula (extend x (extend (constants c) Fin.elim0)) ↔ _ - rw [hc, M.realize_uniformNameFormula s pairing unions powers separation collection carrier x hx] - constructor - · intro name - exact ⟨⟨⟨x, name⟩, hx⟩, rfl⟩ - · rintro ⟨τ, rfl⟩ - exact τ.val.property - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.UniformAtomicEquality + +namespace OAI + + +namespace PartitionPilot.Forcing + +open SetRealization +universe u +variable {P : Type u} (s : Presentation P) + +def NameCodeStep (S x : ZFSet.{u}) : Prop := + ∀ z ∈ x, ∃ y ∈ S, ∃ p, z = ZFSet.pair y (s.encode p) + +theorem nameCodeStep_mono {S T x : ZFSet.{u}} (sub : S ⊆ T) (h : NameCodeStep s S x) : + NameCodeStep s T x := by + intro z hz + obtain ⟨y, hy, p, shape⟩ := h z hz + exact ⟨y, sub hy, p, shape⟩ + +theorem nameCodePostfixed_sound (S : ZFSet.{u}) (post : ∀ x ∈ S, NameCodeStep s S x) : + ∀ x ∈ S, IsName s x := by + intro x + apply (InvImage.wf (fun z : ZFSet.{u} => ZFSet.rank z) wellFounded_lt).induction x + intro x ih hx + apply IsName.mk + · intro z hz + obtain ⟨y, _, p, shape⟩ := post x hx z hz + exact ⟨y, p, shape⟩ + · intro y p entry + obtain ⟨v, hv, q, shape⟩ := post x hx _ entry + have eq := (ZFSet.pair_inj.1 shape).1 + have hy : y ∈ S := eq ▸ hv + have lt : ZFSet.rank y < ZFSet.rank x := + (ZFSet.rank_lt_of_mem (ZFSet.mem_singleton.2 rfl : y ∈ ({y} : ZFSet.{u}))).trans + ((ZFSet.rank_lt_of_mem (ZFSet.mem_pair.2 (Or.inl rfl) : + ({y} : ZFSet.{u}) ∈ ZFSet.pair y (s.encode p))).trans (ZFSet.rank_lt_of_mem entry)) + exact ih y lt hy + +theorem nameCodePrefixed_complete (D : Name.NameDomain s) (S : ZFSet.{u}) + (pre : ∀ τ ∈ D.names, NameCodeStep s S τ.val → τ.val ∈ S) : + ∀ τ ∈ D.names, τ.val ∈ S := by + intro τ + induction τ using Name.inductionOn with + | step τ ih => + intro hτ + apply pre τ hτ + intro z hz + obtain ⟨ν, p, rfl⟩ := Name.entries_cover τ hz + exact ⟨ν.val, ih ν p hz (D.children hτ hz), p, rfl⟩ + +namespace SetFormula + +def nameCodeStepFormula : SetFormula 3 := + .all (imp (.mem 0 1) (ex (.conj (.mem 0 3) + (exConditions 4 (orderedPairFormula 2 1 0))))) + +def nameCertificateFormula : SetFormula 2 := postfixedFormula nameCodeStepFormula + +end SetFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_nameCodeStepFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) + (x S : ZFSet.{u}) (hx : x ∈ M.sets) (hS : S ∈ M.sets) : + Realize M.sets nameCodeStepFormula (extend x (extend S (extend s.carrier Fin.elim0))) ↔ + NameCodeStep s S x := by + let env := extend x (extend S (extend s.carrier Fin.elim0)) + change (∀ z ∈ M.sets, Realize M.sets _ (extend z env)) ↔ _ + constructor + · intro h z hz + obtain ⟨y, hy, member, rest⟩ := (realize_ex M.sets _ _).1 + ((realize_imp M.sets _ _ _).1 (h z (M.transitive hx hz)) hz) + obtain ⟨p, shape⟩ := (M.realize_exConditions s 4 _ (extend y (extend z env)) carrier rfl).1 rest + exact ⟨y, member, p, + (M.realize_orderedPairFormula pairing 2 1 0 (extend (s.encode p) (extend y (extend z env))) + (M.transitive hx hz) hy (M.transitive carrier (s.encode_mem p))).1 shape⟩ + · intro h z hzM + apply (realize_imp M.sets _ _ _).2 + intro hz + obtain ⟨y, hy, p, shape⟩ := h z hz + rw [realize_ex] + refine ⟨y, M.transitive hS hy, hy, ?_⟩ + apply (M.realize_exConditions s 4 _ (extend y (extend z env)) carrier rfl).2 + exact ⟨p, (M.realize_orderedPairFormula pairing 2 1 0 + (extend (s.encode p) (extend y (extend z env))) hzM (M.transitive hS hy) + (M.transitive carrier (s.encode_mem p))).2 shape⟩ + +theorem nameCertificate_sound + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) + {S : ZFSet.{u}} (hS : S ∈ M.sets) + (certificate : Realize M.sets nameCertificateFormula (extend S (extend s.carrier Fin.elim0))) : + ∀ x ∈ S, IsName s x := by + apply nameCodePostfixed_sound s S + intro x hx + exact (M.realize_nameCodeStepFormula s pairing carrier x S (M.transitive hS hx) hS).1 + ((realize_imp M.sets _ _ _).1 (certificate x (M.transitive hS hx)) hx) + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.SetFormula + +universe u + +structure ForcingPrimitives (k : Nat) where + carrier : Fin k + order : Fin k + equality : SetFormula (k + 3) + domain : SetFormula (k + 1) + +def domainApplication {k m : Nat} (N : SetFormula (k + 1)) + (params : Fin k → Fin m) (x : Fin m) : SetFormula m := reindex (extend x params) N + +theorem realize_domainApplication (U : Set ZFSet.{u}) {k m : Nat} + (N : SetFormula (k + 1)) (params : Fin k → Fin m) (x : Fin m) (env : Fin m → ZFSet.{u}) : + Realize U (domainApplication N params x) env ↔ + Realize U N (extend (env x) (fun i => env (params i))) := by + rw [domainApplication, realize_reindex, map_extend] + +def forcingTranslation {k : Nat} (A : ForcingPrimitives k) : + {n m : Nat} → SetFormula n → (Fin k → Fin m) → Fin m → (Fin n → Fin m) → SetFormula m + | _, _, .equal i j, params, p, names => atomicApplication A.equality params p (names i) (names j) + | _, _, .mem i j, params, p, names => + membershipFormula A.equality A.carrier A.order params p (names i) (names j) + | _, _, .neg φ, params, p, names => + allConditions (params A.carrier) <| + imp (pairMembershipFormula 0 p.succ (params A.order).succ) <| + .neg (forcingTranslation A φ (fun j => (params j).succ) 0 (fun i => (names i).succ)) + | _, _, .conj φ ψ, params, p, names => + .conj (forcingTranslation A φ params p names) (forcingTranslation A ψ params p names) + | _, _, .all φ, params, p, names => + .all <| imp (domainApplication A.domain (fun j => (params j).succ) 0) <| + forcingTranslation A φ (fun j => (params j).succ) p.succ + (extend 0 (fun i => (names i).succ)) + +end PartitionPilot.Forcing.SetFormula + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +def DomainMeaning (D : Name.NameDomain s) {k : Nat} (N : SetFormula (k + 1)) + (constants : Fin k → ZFSet.{u}) : Prop := + ∀ x ∈ M.sets, Realize M.sets N (extend x constants) ↔ ∃ τ : D.names, τ.val.val = x + +theorem realize_forcingTranslation (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k n : Nat} (A : ForcingPrimitives k) (φ : SetFormula n) : + ∀ {m} (params : Fin k → Fin m) (pi : Fin m) (names : Fin n → Fin m) + (env : Fin m → ZFSet.{u}), + env (params A.carrier) = s.carrier → env (params A.order) = s.conditionOrder → + M.EqualityMeaning s D A.equality (fun j => env (params j)) → + M.DomainMeaning s D A.domain (fun j => env (params j)) → + ∀ (p : P) (nameEnv : Assignment D n), env pi = s.encode p → + (∀ i, env (names i) = (nameEnv i).val.val) → + (Realize M.sets (forcingTranslation A φ params pi names) env ↔ Forces D φ nameEnv p) := by + induction φ with + | equal i j => + intro m params pi names env hc ho atomic domain p nameEnv hp hnames + change Realize M.sets (atomicApplication A.equality params pi (names i) (names j)) env ↔ _ + rw [realize_atomicApplication, hp, hnames i, hnames j] + exact atomic p (nameEnv i) (nameEnv j) + | mem i j => + intro m params pi names env hc ho atomic domain p nameEnv hp hnames + exact M.realize_membershipFormula s D ground pairing carrier order A.equality + A.carrier A.order params pi (names i) (names j) env hc ho atomic p + (nameEnv i) (nameEnv j) hp (hnames i) (hnames j) + | neg φ ih => + intro m params pi names env hc ho atomic domain p nameEnv hp hnames + change Realize M.sets (allConditions _ _) env ↔ + ∀ q, q ≤ p → ¬ Forces D φ nameEnv q + rw [M.realize_allConditions s (params A.carrier) _ env carrier hc] + apply forall_congr' + intro q + rw [realize_imp, M.realize_conditionLE s pairing carrier order 0 pi.succ + (params A.order).succ (extend (s.encode q) env) q p rfl hp ho] + apply forall_congr' + intro _ + exact not_congr (ih (fun j => (params j).succ) 0 (fun i => (names i).succ) + (extend (s.encode q) env) hc ho atomic domain q nameEnv rfl hnames) + | conj φ ψ ihφ ihψ => + intro m params pi names env hc ho atomic domain p nameEnv hp hnames + exact and_congr (ihφ params pi names env hc ho atomic domain p nameEnv hp hnames) + (ihψ params pi names env hc ho atomic domain p nameEnv hp hnames) + | all φ ih => + intro m params pi names env hc ho atomic domain p nameEnv hp hnames + change (∀ x ∈ M.sets, Realize M.sets (imp + (domainApplication A.domain (fun j => (params j).succ) 0) + (forcingTranslation A φ (fun j => (params j).succ) pi.succ + (extend 0 (fun i => (names i).succ)))) (extend x env)) ↔ + ∀ τ : D.names, Forces D φ (extend τ nameEnv) p + constructor + · intro h τ + have hx := ground τ.val τ.property + have belongs : Realize M.sets (domainApplication A.domain (fun j => (params j).succ) 0) + (extend τ.val.val env) := + (realize_domainApplication M.sets A.domain _ _ _).2 ((domain τ.val.val hx).2 ⟨τ, rfl⟩) + have body := (realize_imp M.sets _ _ _).1 (h τ.val.val hx) belongs + apply (ih (fun j => (params j).succ) pi.succ (extend 0 (fun i => (names i).succ)) + (extend τ.val.val env) hc ho atomic domain p (extend τ nameEnv) hp ?_).1 body + intro i + exact Fin.cases rfl (fun j => hnames j) i + · intro h x hx + rw [realize_imp, realize_domainApplication] + intro belongs + obtain ⟨τ, rfl⟩ := (domain x hx).1 belongs + apply (ih (fun j => (params j).succ) pi.succ (extend 0 (fun i => (names i).succ)) + (extend τ.val.val env) hc ho atomic domain p (extend τ nameEnv) hp ?_).2 (h τ) + intro i + exact Fin.cases rfl (fun j => hnames j) i + + + + + + +theorem forcingSet_mem (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (separation : SeparationSchema M.sets) + {k n m : Nat} (A : ForcingPrimitives k) (φ : SetFormula n) + (params : Fin k → Fin m) (names : Fin n → Fin m) (context : Fin m → ZFSet.{u}) + (members : ∀ i, context i ∈ M.sets) + (hc : context (params A.carrier) = s.carrier) + (ho : context (params A.order) = s.conditionOrder) + (atomic : M.EqualityMeaning s D A.equality (fun j => context (params j))) + (domain : M.DomainMeaning s D A.domain (fun j => context (params j))) + (nameEnv : Assignment D n) (hnames : ∀ i, context (names i) = (nameEnv i).val.val) : + s.subset (fun p => Forces D φ nameEnv p) ∈ M.sets := by + let translated := forcingTranslation A φ (fun j => (params j).succ) 0 (fun i => (names i).succ) + have selected := M.separation_mem separation translated context members carrier + have eq : ZFSet.sep (fun z => Realize M.sets translated (extend z context)) s.carrier = + s.subset (fun p => Forces D φ nameEnv p) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, s.mem_subset] + constructor + · rintro ⟨hz, truth⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier z).1 hz + exact ⟨p, (M.realize_forcingTranslation s D ground pairing carrier order A φ + (fun j => (params j).succ) 0 (fun i => (names i).succ) (extend (s.encode p) context) + hc ho atomic domain p nameEnv rfl hnames).1 truth, rfl⟩ + · rintro ⟨p, forced, rfl⟩ + exact ⟨s.encode_mem p, (M.realize_forcingTranslation s D ground pairing carrier order A φ + (fun j => (params j).succ) 0 (fun i => (names i).succ) (extend (s.encode p) context) + hc ho atomic domain p nameEnv rfl hnames).2 forced⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem exists_groundName_certificate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) : + ∃ S ∈ M.sets, Realize M.sets nameCertificateFormula (extend S (extend s.carrier Fin.elim0)) ∧ + τ.val ∈ S := by + obtain ⟨T, hT, τT, trans⟩ := M.exists_transitiveCover pairing unions separation collection τ.val hτ + let D := namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy) + let params := extend s.carrier Fin.elim0 + have members : ∀ i, params i ∈ M.sets := Fin.cases carrier (fun i => Fin.elim0 i) + have mono : ∀ S ∈ M.sets, ∀ U ∈ M.sets, S ⊆ T → U ⊆ T → S ⊆ U → + definableOperator M.sets nameCodeStepFormula params T S ⊆ + definableOperator M.sets nameCodeStepFormula params T U := by + intro S hS U hU _ _ sub x hx + obtain ⟨hxT, step⟩ := ZFSet.mem_sep.1 hx + have hxM := M.transitive hT hxT + exact ZFSet.mem_sep.2 ⟨hxT, (M.realize_nameCodeStepFormula s pairing carrier x U hxM hU).2 + (nameCodeStep_mono s sub ((M.realize_nameCodeStepFormula s pairing carrier x S hxM hS).1 step))⟩ + obtain ⟨S, hS, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation + nameCodeStepFormula params members hT mono + have certificate : Realize M.sets nameCertificateFormula (extend S params) := by + apply (M.realize_postfixedFormula nameCodeStepFormula params hS bound).2 + rw [fixed] + have pre : ∀ ν ∈ D.names, NameCodeStep s S ν.val → ν.val ∈ S := by + intro ν hν step + have member : ν.val ∈ definableOperator M.sets nameCodeStepFormula params T S := + ZFSet.mem_sep.2 ⟨hν, (M.realize_nameCodeStepFormula s pairing carrier ν.val S + (M.transitive hT hν) hS).2 step⟩ + rwa [fixed] at member + exact ⟨S, hS, certificate, nameCodePrefixed_complete s D S pre τ τT⟩ + +theorem isName_iff_exists_certificate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (x : ZFSet.{u}) (hx : x ∈ M.sets) : + IsName s x ↔ + ∃ S ∈ M.sets, Realize M.sets nameCertificateFormula (extend S (extend s.carrier Fin.elim0)) ∧ + x ∈ S := by + constructor + · intro name + exact M.exists_groundName_certificate s pairing unions powers separation collection carrier ⟨x, name⟩ hx + · rintro ⟨S, hS, certificate, member⟩ + exact M.nameCertificate_sound s pairing carrier hS certificate x member + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def withGroundEquality {k : Nat} (c o : Fin k) (N : SetFormula (k + 1)) : ForcingPrimitives k where + carrier := c + order := o + equality := liftedEqualityFormula c o + domain := N + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_forcingWithGroundEquality (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k n m : Nat} (c o : Fin k) (N : SetFormula (k + 1)) (φ : SetFormula n) + (params : Fin k → Fin m) (pi : Fin m) (names : Fin n → Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (domain : M.DomainMeaning s D N (fun j => env (params j))) + (p : P) (nameEnv : Assignment D n) (hp : env pi = s.encode p) + (hnames : ∀ i, env (names i) = (nameEnv i).val.val) : + Realize M.sets (forcingTranslation (withGroundEquality c o N) φ params pi names) env ↔ + Forces D φ nameEnv p := + M.realize_forcingTranslation s D ground pairing carrier order (withGroundEquality c o N) φ + params pi names env hc ho + (M.equalityMeaning_lifted s D ground pairing unions powers separation collection carrier order c o _ hc ho) + domain p nameEnv hp hnames + +theorem forcingSet_mem_withGroundEquality (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k n m : Nat} (c o : Fin k) (N : SetFormula (k + 1)) (φ : SetFormula n) + (params : Fin k → Fin m) (names : Fin n → Fin m) (context : Fin m → ZFSet.{u}) + (members : ∀ i, context i ∈ M.sets) + (hc : context (params c) = s.carrier) (ho : context (params o) = s.conditionOrder) + (domain : M.DomainMeaning s D N (fun j => context (params j))) + (nameEnv : Assignment D n) (hnames : ∀ i, context (names i) = (nameEnv i).val.val) : + s.subset (fun p => Forces D φ nameEnv p) ∈ M.sets := + M.forcingSet_mem s D ground pairing carrier order separation (withGroundEquality c o N) φ params names + context members hc ho + (M.equalityMeaning_lifted s D ground pairing unions powers separation collection carrier order c o _ hc ho) + domain nameEnv hnames + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.SetFormula + +def uniformNameFormula : SetFormula 2 := + ex (.conj (domainApplication nameCertificateFormula (extend 2 Fin.elim0) 0) (.mem 1 0)) + +def liftedNameFormula {k : Nat} (c : Fin k) : SetFormula (k + 1) := + domainApplication uniformNameFormula (extend c.succ Fin.elim0) 0 + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P) + +theorem realize_uniformNameFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (x : ZFSet.{u}) (hx : x ∈ M.sets) : + Realize M.sets uniformNameFormula (extend x (extend s.carrier Fin.elim0)) ↔ IsName s x := by + rw [M.isName_iff_exists_certificate s pairing unions powers separation collection carrier x hx, + uniformNameFormula, realize_ex] + apply exists_congr + intro S + apply and_congr_right + intro _ + change (Realize M.sets _ _ ∧ x ∈ S) ↔ _ + rw [realize_domainApplication, map_extend, map_empty] + rfl + +theorem domainMeaning_liftedNames + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) + {k : Nat} (c : Fin k) (constants : Fin k → ZFSet.{u}) (hc : constants c = s.carrier) : + M.DomainMeaning s (M.nameDomain s) (liftedNameFormula c) constants := by + intro x hx + rw [liftedNameFormula, realize_domainApplication, map_extend, map_empty] + change Realize M.sets uniformNameFormula (extend x (extend (constants c) Fin.elim0)) ↔ _ + rw [hc, M.realize_uniformNameFormula s pairing unions powers separation collection carrier x hx] + constructor + · intro name + exact ⟨⟨⟨x, name⟩, hx⟩, rfl⟩ + · rintro ⟨τ, rfl⟩ + exact τ.val.property + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundSizeWitnesses.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundSizeWitnesses.lean index 4cf3ceabfa9ae85f57169ba57acaf43246e73187..39b7a034ca5addaba271a7e7dba93d162b6b6d41 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundSizeWitnesses.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniformGroundSizeWitnesses.lean @@ -1,92 +1,92 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ParentSupportCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def sizeWitnessRelation (R W N : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ p ∈ R, ∃ f ∈ W, z = ZFSet.pair p f ∧ InjectionCode p N f) (ZFSet.prod R W) - -theorem pair_mem_sizeWitnessRelation (R W N p f : ZFSet.{u}) : - ZFSet.pair p f ∈ sizeWitnessRelation R W N ↔ p ∈ R ∧ f ∈ W ∧ InjectionCode p N f := by - rw [sizeWitnessRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, q, hq, g, hg, eq, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hq, hg, code⟩ - · rintro ⟨hp, hf, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hp, hf⟩, p, hp, f, hf, rfl, code⟩ - -namespace BoundedFormula - -open SetFormula - -def sizeWitnessEntryFormula {k} (z r w n : Fin k) : BoundedFormula k := - exMem r (exMem w.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (injectionFormula 1 n.succ.succ 0))) - -theorem truth_sizeWitnessEntryFormula {k} (z r w n : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (sizeWitnessEntryFormula z r w n) env ↔ - ∃ p ∈ env r, ∃ f ∈ env w, env z = ZFSet.pair p f ∧ InjectionCode p (env n) f := by - simp only [sizeWitnessEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_injectionFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem sizeWitnessRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {R W N : ZFSet.{u}} (hR : R ∈ M.sets) (hW : W ∈ M.sets) (hN : N ∈ M.sets) : - sizeWitnessRelation R W N ∈ M.sets := by - let params := extend R (extend W (extend N Fin.elim0)) - have selected := M.bounded_separation_mem separation (BoundedFormula.sizeWitnessEntryFormula 0 1 2 3) - params (Fin.cases hR (Fin.cases hW (Fin.cases hN (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hR hW) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.sizeWitnessEntryFormula 0 1 2 3) - (extend z params)) (ZFSet.prod R W) = sizeWitnessRelation R W N := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, sizeWitnessRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_sizeWitnessEntryFormula 0 1 2 3 _) - exact eq ▸ selected - -theorem uniform_size_witnesses - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R B N : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) - (subsets : ∀ p ∈ R, p ⊆ B) (small : ∀ p ∈ R, M.groundEmbeddable p N) : - ∃ F ∈ M.sets, ZFSet.IsFunc R (M.groundRelations B N) F ∧ - ∀ p f, ZFSet.pair p f ∈ F → InjectionCode p N f := by - let W := M.groundRelations B N - have hW := M.groundRelations_mem pairing unions powers separation hB hN - have hT := M.sizeWitnessRelation_mem pairing unions powers separation hR hW hN - have total (p : ZFSet.{u}) (hp : p ∈ R) : ∃ f ∈ W, ZFSet.pair p f ∈ sizeWitnessRelation R W N := by - obtain ⟨f, hf, code⟩ := small p hp - have bound : f ⊆ ZFSet.prod B N := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨subsets p hp hx, hy⟩ - have hfW := (M.mem_groundRelations B N f).2 ⟨hf, bound⟩ - exact ⟨f, hfW, (pair_mem_sizeWitnessRelation R W N p f).2 ⟨hp, hfW, code⟩⟩ - obtain ⟨F, hF, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice hR hW hT total - exact ⟨F, hF, func, fun p f rel => ((pair_mem_sizeWitnessRelation R W N p f).1 (selected rel)).2.2⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ParentSupportCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def sizeWitnessRelation (R W N : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ p ∈ R, ∃ f ∈ W, z = ZFSet.pair p f ∧ InjectionCode p N f) (ZFSet.prod R W) + +theorem pair_mem_sizeWitnessRelation (R W N p f : ZFSet.{u}) : + ZFSet.pair p f ∈ sizeWitnessRelation R W N ↔ p ∈ R ∧ f ∈ W ∧ InjectionCode p N f := by + rw [sizeWitnessRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, q, hq, g, hg, eq, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hq, hg, code⟩ + · rintro ⟨hp, hf, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hp, hf⟩, p, hp, f, hf, rfl, code⟩ + +namespace BoundedFormula + +open SetFormula + +def sizeWitnessEntryFormula {k} (z r w n : Fin k) : BoundedFormula k := + exMem r (exMem w.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (injectionFormula 1 n.succ.succ 0))) + +theorem truth_sizeWitnessEntryFormula {k} (z r w n : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (sizeWitnessEntryFormula z r w n) env ↔ + ∃ p ∈ env r, ∃ f ∈ env w, env z = ZFSet.pair p f ∧ InjectionCode p (env n) f := by + simp only [sizeWitnessEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_injectionFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem sizeWitnessRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {R W N : ZFSet.{u}} (hR : R ∈ M.sets) (hW : W ∈ M.sets) (hN : N ∈ M.sets) : + sizeWitnessRelation R W N ∈ M.sets := by + let params := extend R (extend W (extend N Fin.elim0)) + have selected := M.bounded_separation_mem separation (BoundedFormula.sizeWitnessEntryFormula 0 1 2 3) + params (Fin.cases hR (Fin.cases hW (Fin.cases hN (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hR hW) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.sizeWitnessEntryFormula 0 1 2 3) + (extend z params)) (ZFSet.prod R W) = sizeWitnessRelation R W N := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, sizeWitnessRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_sizeWitnessEntryFormula 0 1 2 3 _) + exact eq ▸ selected + +theorem uniform_size_witnesses + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R B N : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) + (subsets : ∀ p ∈ R, p ⊆ B) (small : ∀ p ∈ R, M.groundEmbeddable p N) : + ∃ F ∈ M.sets, ZFSet.IsFunc R (M.groundRelations B N) F ∧ + ∀ p f, ZFSet.pair p f ∈ F → InjectionCode p N f := by + let W := M.groundRelations B N + have hW := M.groundRelations_mem pairing unions powers separation hB hN + have hT := M.sizeWitnessRelation_mem pairing unions powers separation hR hW hN + have total (p : ZFSet.{u}) (hp : p ∈ R) : ∃ f ∈ W, ZFSet.pair p f ∈ sizeWitnessRelation R W N := by + obtain ⟨f, hf, code⟩ := small p hp + have bound : f ⊆ ZFSet.prod B N := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨subsets p hp hx, hy⟩ + have hfW := (M.mem_groundRelations B N f).2 ⟨hf, bound⟩ + exact ⟨f, hfW, (pair_mem_sizeWitnessRelation R W N p f).2 ⟨hp, hfW, code⟩⟩ + obtain ⟨F, hF, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice hR hW hT total + exact ⟨F, hF, func, fun p f rel => ((pair_mem_sizeWitnessRelation R W N p f).1 (selected rel)).2.2⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniqueFiberForcing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniqueFiberForcing.lean index 51e350f8fb7a0a46986c6266232601f62e562a9a..7fcd21a522c3d5c1db8f1ac4971db33742459c61 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniqueFiberForcing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Forcing/UniqueFiberForcing.lean @@ -1,80 +1,80 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ParentSupportCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def uniqueFiberFormula {n} (s x f : Fin n) : BoundedFormula n := - .conj (.mem x s) (.conj (pairMembershipFormula s x f) - (.allMem s (imp (pairMembershipFormula s.succ 0 f.succ) (.equal 0 x.succ)))) - -theorem truth_uniqueFiberFormula {n} (s x f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (uniqueFiberFormula s x f) env ↔ env x ∈ env s ∧ - ZFSet.pair (env s) (env x) ∈ env f ∧ - ∀ z ∈ env s, ZFSet.pair (env s) z ∈ env f → z = env x := by - simp only [uniqueFiberFormula, Truth, truth_pairMembershipFormula, truth_imp] - rfl - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.SetFormula - -open SetRealization -universe u -variable {P : Type u} {s : Presentation P} - -theorem realize_uniqueFiber_values (D : Name.NameDomain s) (H : Set P) - {n} (i j k : Fin n) (env : Assignment D n) : - Realize (D.values H) (BoundedFormula.uniqueFiberFormula i j k).toFormula (evalAssignment H env) ↔ - Name.eval H (env j).val ∈ Name.eval H (env i).val ∧ - ZFSet.pair (Name.eval H (env i).val) (Name.eval H (env j).val) ∈ Name.eval H (env k).val ∧ - ∀ z ∈ Name.eval H (env i).val, - ZFSet.pair (Name.eval H (env i).val) z ∈ Name.eval H (env k).val → - z = Name.eval H (env j).val := by - let N : TransitiveGround := ⟨D.values H, D.values_transitive H⟩ - exact (BoundedFormula.realize_toFormula N _ _ (fun l => ⟨env l, rfl⟩)).trans - (BoundedFormula.truth_uniqueFiberFormula i j k (evalAssignment H env)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization SetFormula -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] - -theorem uniqueFiber_eq_of_fixed_names (a : PosetAction G P) (s : Presentation P) - (D : Name.NameDomain s) (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) - (g : G) (S x f : D.names) - (fixedS : a.act s g S.val = S.val) (fixedF : a.act s g f.val = f.val) - (p : P) - (forced : Forces D (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula - (extend S (extend x (extend f Fin.elim0))) p) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) - (hp : H.mem p) (hgp : H.mem (a.iso g p)) : - Name.eval {q | H.mem q} x.val = Name.eval {q | H.mem q} (a.act s g x.val) := by - let env := extend S (extend x (extend f Fin.elim0)) - have original := (realize_uniqueFiber_values D {q | H.mem q} 0 1 2 env).1 - (forces_sound D H generic _ env hp forced) - have moved := (a.formula_forces_act_iff s D closed g - (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula env p).2 forced - have translated := (realize_uniqueFiber_values D {q | H.mem q} 0 1 2 - (a.actAssignment s D closed g env)).1 - (forces_sound D H generic _ _ hgp moved) - change Name.eval {q | H.mem q} (a.act s g x.val) ∈ Name.eval {q | H.mem q} (a.act s g S.val) ∧ - ZFSet.pair (Name.eval {q | H.mem q} (a.act s g S.val)) - (Name.eval {q | H.mem q} (a.act s g x.val)) ∈ Name.eval {q | H.mem q} (a.act s g f.val) ∧ _ - at translated - rw [fixedS, fixedF] at translated - exact (original.2.2 _ translated.1 translated.2.1).symm - -end PartitionPilot.Forcing.PosetAction - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ParentSupportCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def uniqueFiberFormula {n} (s x f : Fin n) : BoundedFormula n := + .conj (.mem x s) (.conj (pairMembershipFormula s x f) + (.allMem s (imp (pairMembershipFormula s.succ 0 f.succ) (.equal 0 x.succ)))) + +theorem truth_uniqueFiberFormula {n} (s x f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (uniqueFiberFormula s x f) env ↔ env x ∈ env s ∧ + ZFSet.pair (env s) (env x) ∈ env f ∧ + ∀ z ∈ env s, ZFSet.pair (env s) z ∈ env f → z = env x := by + simp only [uniqueFiberFormula, Truth, truth_pairMembershipFormula, truth_imp] + rfl + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.SetFormula + +open SetRealization +universe u +variable {P : Type u} {s : Presentation P} + +theorem realize_uniqueFiber_values (D : Name.NameDomain s) (H : Set P) + {n} (i j k : Fin n) (env : Assignment D n) : + Realize (D.values H) (BoundedFormula.uniqueFiberFormula i j k).toFormula (evalAssignment H env) ↔ + Name.eval H (env j).val ∈ Name.eval H (env i).val ∧ + ZFSet.pair (Name.eval H (env i).val) (Name.eval H (env j).val) ∈ Name.eval H (env k).val ∧ + ∀ z ∈ Name.eval H (env i).val, + ZFSet.pair (Name.eval H (env i).val) z ∈ Name.eval H (env k).val → + z = Name.eval H (env j).val := by + let N : TransitiveGround := ⟨D.values H, D.values_transitive H⟩ + exact (BoundedFormula.realize_toFormula N _ _ (fun l => ⟨env l, rfl⟩)).trans + (BoundedFormula.truth_uniqueFiberFormula i j k (evalAssignment H env)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization SetFormula +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] + +theorem uniqueFiber_eq_of_fixed_names (a : PosetAction G P) (s : Presentation P) + (D : Name.NameDomain s) (closed : ∀ g τ, τ ∈ D.names → a.act s g τ ∈ D.names) + (g : G) (S x f : D.names) + (fixedS : a.act s g S.val = S.val) (fixedF : a.act s g f.val = f.val) + (p : P) + (forced : Forces D (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula + (extend S (extend x (extend f Fin.elim0))) p) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily D)) + (hp : H.mem p) (hgp : H.mem (a.iso g p)) : + Name.eval {q | H.mem q} x.val = Name.eval {q | H.mem q} (a.act s g x.val) := by + let env := extend S (extend x (extend f Fin.elim0)) + have original := (realize_uniqueFiber_values D {q | H.mem q} 0 1 2 env).1 + (forces_sound D H generic _ env hp forced) + have moved := (a.formula_forces_act_iff s D closed g + (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula env p).2 forced + have translated := (realize_uniqueFiber_values D {q | H.mem q} 0 1 2 + (a.actAssignment s D closed g env)).1 + (forces_sound D H generic _ _ hgp moved) + change Name.eval {q | H.mem q} (a.act s g x.val) ∈ Name.eval {q | H.mem q} (a.act s g S.val) ∧ + ZFSet.pair (Name.eval {q | H.mem q} (a.act s g S.val)) + (Name.eval {q | H.mem q} (a.act s g x.val)) ∈ Name.eval {q | H.mem q} (a.act s g f.val) ∧ _ + at translated + rw [fixedS, fixedF] at translated + exact (original.2.2 _ translated.1 translated.2.1).symm + +end PartitionPilot.Forcing.PosetAction + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentIndexLevels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentIndexLevels.lean index 097187a9eb5fbbe3ea9b771c411e7f3db594c34d..50def2073976a25a1cb373ccf6aa1c8152fa4559 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentIndexLevels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentIndexLevels.lean @@ -1,62 +1,62 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.StageOneDataBoundLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -noncomputable def assignmentIndexLevels (I T eta levels : ZFSet.{u}) : ZFSet.{u} := - relationCompose (stageOneAssignments I T) I eta - (productFirst I (ZFSet.prod T T)) levels - -theorem pair_mem_assignmentIndexLevels (I T eta levels z level : ZFSet.{u}) : - ZFSet.pair z level ∈ assignmentIndexLevels I T eta levels ↔ - ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, - z = stageOneAssignment i u w ∧ level ∈ eta ∧ ZFSet.pair i level ∈ levels := by - rw [assignmentIndexLevels, pair_mem_relationCompose] - constructor - · rintro ⟨_, hl, i, hi, projection, entry⟩ - obtain ⟨j, _, rest, hr, equal⟩ := (mem_productFirst I (ZFSet.prod T T) _).1 projection - obtain ⟨hz, hji⟩ := ZFSet.pair_inj.1 equal - obtain ⟨u, hu, w, hw, rfl⟩ := ZFSet.mem_prod.1 hr - exact ⟨i, hi, u, hu, w, hw, hji ▸ hz, hl, entry⟩ - · rintro ⟨i, hi, u, hu, w, hw, rfl, hl, entry⟩ - refine ⟨(stageOneAssignment_mem_assignments I T i u w).2 ⟨hi, hu, hw⟩, - hl, i, hi, ?_, entry⟩ - exact (mem_productFirst I (ZFSet.prod T T) _).2 - ⟨i, hi, ZFSet.pair u w, ZFSet.pair_mem_prod.2 ⟨hu, hw⟩, rfl⟩ - -theorem assignmentIndexLevels_entry (I T eta levels i u w level : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment i u w) level ∈ assignmentIndexLevels I T eta levels ↔ - i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ level ∈ eta ∧ ZFSet.pair i level ∈ levels := by - rw [pair_mem_assignmentIndexLevels] - constructor - · rintro ⟨j, hj, v, hv, x, hx, equal, hl, entry⟩ - obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i u w j v x).1 equal - exact ⟨hj, hv, hx, hl, entry⟩ - · rintro ⟨hi, hu, hw, hl, entry⟩ - exact ⟨i, hi, u, hu, w, hw, rfl, hl, entry⟩ - -theorem assignmentIndexLevels_function {I T eta levels : ZFSet.{u}} - (function : ZFSet.IsFunc I eta levels) : - ZFSet.IsFunc (stageOneAssignments I T) eta (assignmentIndexLevels I T eta levels) := by - refine ⟨?_, ?_⟩ - · intro z hz - rw [assignmentIndexLevels, relationCompose] at hz - exact (ZFSet.mem_sep.1 hz).1 - · intro z hz - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 hz - obtain ⟨level, entry, unique⟩ := function.2 i hi - have hl := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - refine ⟨level, (assignmentIndexLevels_entry I T eta levels i u w level).2 - ⟨hi, hu, hw, hl, entry⟩, ?_⟩ - intro other ho - exact unique other ((assignmentIndexLevels_entry I T eta levels i u w other).1 ho).2.2.2.2 - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.StageOneDataBoundLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +noncomputable def assignmentIndexLevels (I T eta levels : ZFSet.{u}) : ZFSet.{u} := + relationCompose (stageOneAssignments I T) I eta + (productFirst I (ZFSet.prod T T)) levels + +theorem pair_mem_assignmentIndexLevels (I T eta levels z level : ZFSet.{u}) : + ZFSet.pair z level ∈ assignmentIndexLevels I T eta levels ↔ + ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, + z = stageOneAssignment i u w ∧ level ∈ eta ∧ ZFSet.pair i level ∈ levels := by + rw [assignmentIndexLevels, pair_mem_relationCompose] + constructor + · rintro ⟨_, hl, i, hi, projection, entry⟩ + obtain ⟨j, _, rest, hr, equal⟩ := (mem_productFirst I (ZFSet.prod T T) _).1 projection + obtain ⟨hz, hji⟩ := ZFSet.pair_inj.1 equal + obtain ⟨u, hu, w, hw, rfl⟩ := ZFSet.mem_prod.1 hr + exact ⟨i, hi, u, hu, w, hw, hji ▸ hz, hl, entry⟩ + · rintro ⟨i, hi, u, hu, w, hw, rfl, hl, entry⟩ + refine ⟨(stageOneAssignment_mem_assignments I T i u w).2 ⟨hi, hu, hw⟩, + hl, i, hi, ?_, entry⟩ + exact (mem_productFirst I (ZFSet.prod T T) _).2 + ⟨i, hi, ZFSet.pair u w, ZFSet.pair_mem_prod.2 ⟨hu, hw⟩, rfl⟩ + +theorem assignmentIndexLevels_entry (I T eta levels i u w level : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment i u w) level ∈ assignmentIndexLevels I T eta levels ↔ + i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ level ∈ eta ∧ ZFSet.pair i level ∈ levels := by + rw [pair_mem_assignmentIndexLevels] + constructor + · rintro ⟨j, hj, v, hv, x, hx, equal, hl, entry⟩ + obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i u w j v x).1 equal + exact ⟨hj, hv, hx, hl, entry⟩ + · rintro ⟨hi, hu, hw, hl, entry⟩ + exact ⟨i, hi, u, hu, w, hw, rfl, hl, entry⟩ + +theorem assignmentIndexLevels_function {I T eta levels : ZFSet.{u}} + (function : ZFSet.IsFunc I eta levels) : + ZFSet.IsFunc (stageOneAssignments I T) eta (assignmentIndexLevels I T eta levels) := by + refine ⟨?_, ?_⟩ + · intro z hz + rw [assignmentIndexLevels, relationCompose] at hz + exact (ZFSet.mem_sep.1 hz).1 + · intro z hz + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 hz + obtain ⟨level, entry, unique⟩ := function.2 i hi + have hl := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + refine ⟨level, (assignmentIndexLevels_entry I T eta levels i u w level).2 + ⟨hi, hu, hw, hl, entry⟩, ?_⟩ + intro other ho + exact unique other ((assignmentIndexLevels_entry I T eta levels i u w other).1 ho).2.2.2.2 + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentNestedSplices.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentNestedSplices.lean index 4614b0e0ed57f1cbc5a2d165cd8b1e76ea884253..8073cf4e4930ce35ed4c5d9831d5b7c81f90502d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentNestedSplices.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AssignmentNestedSplices.lean @@ -1,200 +1,200 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.NatUnionCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -def assignmentCut (levels alpha A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) A - -def assignmentUpper (levels alpha A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∉ assignmentCut levels alpha A) A - -def assignmentSplice (levels alpha Aq Ap : ZFSet.{u}) : ZFSet.{u} := - assignmentCut levels alpha Aq ∪ assignmentUpper levels alpha Ap - -theorem mem_assignmentCut (levels alpha A z : ZFSet.{u}) : - z ∈ assignmentCut levels alpha A ↔ - z ∈ A ∧ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels := - ZFSet.mem_sep - -theorem mem_assignmentUpper (levels alpha A z : ZFSet.{u}) : - z ∈ assignmentUpper levels alpha A ↔ - z ∈ A ∧ ¬ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels := by - rw [assignmentUpper, ZFSet.mem_sep, mem_assignmentCut] - constructor - · rintro ⟨hz, outside⟩ - exact ⟨hz, fun lower => outside ⟨hz, lower⟩⟩ - · rintro ⟨hz, outside⟩ - exact ⟨hz, fun lower => outside lower.2⟩ - -theorem mem_assignmentSplice (levels alpha Aq Ap z : ZFSet.{u}) : - z ∈ assignmentSplice levels alpha Aq Ap ↔ - (z ∈ Aq ∧ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) ∨ - (z ∈ Ap ∧ ¬ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) := by - rw [assignmentSplice, ZFSet.mem_union, mem_assignmentCut, mem_assignmentUpper] - -theorem assignmentCut_subset (levels alpha A : ZFSet.{u}) : - assignmentCut levels alpha A ⊆ A := - fun _ hz => ((mem_assignmentCut levels alpha A _).1 hz).1 - -theorem assignmentUpper_subset (levels alpha A : ZFSet.{u}) : - assignmentUpper levels alpha A ⊆ A := - fun _ hz => ((mem_assignmentUpper levels alpha A _).1 hz).1 - -theorem assignmentSplice_subset (levels alpha Aq Ap : ZFSet.{u}) : - assignmentSplice levels alpha Aq Ap ⊆ Aq ∪ Ap := by - intro z hz - rcases (mem_assignmentSplice levels alpha Aq Ap z).1 hz with lower | upper - · exact ZFSet.mem_union.2 (Or.inl lower.1) - · exact ZFSet.mem_union.2 (Or.inr upper.1) - -theorem assignmentCut_mono {levels alpha A B : ZFSet.{u}} (subset : A ⊆ B) : - assignmentCut levels alpha A ⊆ assignmentCut levels alpha B := by - intro z hz - obtain ⟨hz, lower⟩ := (mem_assignmentCut levels alpha A z).1 hz - exact (mem_assignmentCut levels alpha B z).2 ⟨subset hz, lower⟩ - -theorem assignmentCut_nested {levels alpha beta A : ZFSet.{u}} - (below : alpha ⊆ beta) : - assignmentCut levels alpha (assignmentCut levels beta A) = - assignmentCut levels alpha A := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut, mem_assignmentCut, mem_assignmentCut] - constructor - · rintro ⟨⟨hz, _⟩, lower⟩ - exact ⟨hz, lower⟩ - · rintro ⟨hz, xi, hxi, entry⟩ - exact ⟨⟨hz, xi, below hxi, entry⟩, xi, hxi, entry⟩ - -theorem assignmentCut_eq_of_lower {levels alpha A : ZFSet.{u}} - (lower : ∀ z ∈ A, ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) : - assignmentCut levels alpha A = A := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut] - exact ⟨fun hz => hz.1, fun hz => ⟨hz, lower z hz⟩⟩ - -theorem assignmentCut_full {J eta levels A : ZFSet.{u}} - (function : ZFSet.IsFunc J eta levels) (subset : A ⊆ J) : - assignmentCut levels eta A = A := by - apply assignmentCut_eq_of_lower - intro z hz - obtain ⟨xi, entry, _⟩ := function.2 z (subset hz) - exact ⟨xi, (ZFSet.pair_mem_prod.1 (function.1 entry)).2, entry⟩ - -theorem assignmentCut_splice (levels alpha Aq Ap : ZFSet.{u}) : - assignmentCut levels alpha (assignmentSplice levels alpha Aq Ap) = - assignmentCut levels alpha Aq := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut, mem_assignmentSplice, mem_assignmentCut] - constructor - · rintro ⟨lower | upper, level⟩ - · exact lower - · exact False.elim (upper.2 level) - · intro lower - exact ⟨Or.inl lower, lower.2⟩ - -theorem assignmentUpper_splice (levels alpha Aq Ap : ZFSet.{u}) : - assignmentUpper levels alpha (assignmentSplice levels alpha Aq Ap) = - assignmentUpper levels alpha Ap := by - apply ZFSet.ext - intro z - rw [mem_assignmentUpper, mem_assignmentSplice, mem_assignmentUpper] - constructor - · rintro ⟨lower | upper, outside⟩ - · exact False.elim (outside lower.2) - · exact upper - · intro upper - exact ⟨Or.inr upper, upper.2⟩ - -theorem assignmentSplice_self (levels alpha A : ZFSet.{u}) : - assignmentSplice levels alpha A A = A := by - classical - apply ZFSet.ext - intro z - rw [mem_assignmentSplice] - constructor - · exact fun h => h.elim And.left And.left - · intro hz - by_cases lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels - · exact Or.inl ⟨hz, lower⟩ - · exact Or.inr ⟨hz, lower⟩ - -theorem assignmentSplice_of_lower {levels alpha Aq Ap : ZFSet.{u}} - (lower : ∀ z ∈ Aq, ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) : - assignmentSplice levels alpha Aq Ap = Aq ∪ assignmentUpper levels alpha Ap ∧ - assignmentCut levels alpha (assignmentSplice levels alpha Aq Ap) = Aq := by - have equal := assignmentCut_eq_of_lower lower - exact ⟨by rw [assignmentSplice, equal], by rw [assignmentCut_splice, equal]⟩ - -theorem assignmentSplice_extends {levels alpha Aq Ap : ZFSet.{u}} - (contains : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq) : - Ap ⊆ assignmentSplice levels alpha Aq Ap := by - classical - intro z hz - by_cases lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels - · exact ZFSet.mem_union.2 (Or.inl (contains - ((mem_assignmentCut levels alpha Ap z).2 ⟨hz, lower⟩))) - · exact (mem_assignmentSplice levels alpha Aq Ap z).2 (Or.inr ⟨hz, lower⟩) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u -variable {levels alpha beta : ZFSet.{u}} (below : alpha ⊆ beta) -include below - -theorem assignmentCut_splice_below (Aq Ap : ZFSet.{u}) : - assignmentCut levels alpha (assignmentSplice levels beta Aq Ap) = - assignmentCut levels alpha Aq := by - calc - _ = assignmentCut levels alpha - (assignmentCut levels beta (assignmentSplice levels beta Aq Ap)) := - (assignmentCut_nested below).symm - _ = assignmentCut levels alpha (assignmentCut levels beta Aq) := by rw [assignmentCut_splice] - _ = _ := assignmentCut_nested below - -theorem assignmentUpper_splice_above (Aq Ap : ZFSet.{u}) : - assignmentUpper levels beta (assignmentSplice levels alpha Aq Ap) = - assignmentUpper levels beta Ap := by - apply ZFSet.ext - intro z - rw [mem_assignmentUpper, mem_assignmentSplice, mem_assignmentUpper] - constructor - · rintro ⟨lower | upper, outside⟩ - · obtain ⟨xi, hxi, entry⟩ := lower.2 - exact False.elim (outside ⟨xi, below hxi, entry⟩) - · exact ⟨upper.1, outside⟩ - · rintro ⟨member, outside⟩ - exact ⟨Or.inr ⟨member, fun ⟨xi, hxi, entry⟩ => outside ⟨xi, below hxi, entry⟩⟩, outside⟩ - -theorem assignmentSplice_nested (Ar Aq Ap : ZFSet.{u}) : - assignmentSplice levels alpha Ar (assignmentSplice levels beta Aq Ap) = - assignmentSplice levels beta (assignmentSplice levels alpha Ar Aq) Ap := by - classical - apply ZFSet.ext - intro z - simp only [mem_assignmentSplice] - by_cases lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels - · obtain ⟨xi, hxi, entry⟩ := lower - have lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels := ⟨xi, hxi, entry⟩ - have higher : ∃ xi ∈ beta, ZFSet.pair z xi ∈ levels := ⟨xi, below hxi, entry⟩ - simp only [lower, higher, and_true, not_true_eq_false, and_false, or_false] - · by_cases higher : ∃ xi ∈ beta, ZFSet.pair z xi ∈ levels - · simp only [lower, higher, and_true, not_true_eq_false, and_false, or_false, - not_false_eq_true, false_or] - · simp only [lower, higher, and_true, and_false, not_false_eq_true, false_or] - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.NatUnionCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +def assignmentCut (levels alpha A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) A + +def assignmentUpper (levels alpha A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∉ assignmentCut levels alpha A) A + +def assignmentSplice (levels alpha Aq Ap : ZFSet.{u}) : ZFSet.{u} := + assignmentCut levels alpha Aq ∪ assignmentUpper levels alpha Ap + +theorem mem_assignmentCut (levels alpha A z : ZFSet.{u}) : + z ∈ assignmentCut levels alpha A ↔ + z ∈ A ∧ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels := + ZFSet.mem_sep + +theorem mem_assignmentUpper (levels alpha A z : ZFSet.{u}) : + z ∈ assignmentUpper levels alpha A ↔ + z ∈ A ∧ ¬ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels := by + rw [assignmentUpper, ZFSet.mem_sep, mem_assignmentCut] + constructor + · rintro ⟨hz, outside⟩ + exact ⟨hz, fun lower => outside ⟨hz, lower⟩⟩ + · rintro ⟨hz, outside⟩ + exact ⟨hz, fun lower => outside lower.2⟩ + +theorem mem_assignmentSplice (levels alpha Aq Ap z : ZFSet.{u}) : + z ∈ assignmentSplice levels alpha Aq Ap ↔ + (z ∈ Aq ∧ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) ∨ + (z ∈ Ap ∧ ¬ ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) := by + rw [assignmentSplice, ZFSet.mem_union, mem_assignmentCut, mem_assignmentUpper] + +theorem assignmentCut_subset (levels alpha A : ZFSet.{u}) : + assignmentCut levels alpha A ⊆ A := + fun _ hz => ((mem_assignmentCut levels alpha A _).1 hz).1 + +theorem assignmentUpper_subset (levels alpha A : ZFSet.{u}) : + assignmentUpper levels alpha A ⊆ A := + fun _ hz => ((mem_assignmentUpper levels alpha A _).1 hz).1 + +theorem assignmentSplice_subset (levels alpha Aq Ap : ZFSet.{u}) : + assignmentSplice levels alpha Aq Ap ⊆ Aq ∪ Ap := by + intro z hz + rcases (mem_assignmentSplice levels alpha Aq Ap z).1 hz with lower | upper + · exact ZFSet.mem_union.2 (Or.inl lower.1) + · exact ZFSet.mem_union.2 (Or.inr upper.1) + +theorem assignmentCut_mono {levels alpha A B : ZFSet.{u}} (subset : A ⊆ B) : + assignmentCut levels alpha A ⊆ assignmentCut levels alpha B := by + intro z hz + obtain ⟨hz, lower⟩ := (mem_assignmentCut levels alpha A z).1 hz + exact (mem_assignmentCut levels alpha B z).2 ⟨subset hz, lower⟩ + +theorem assignmentCut_nested {levels alpha beta A : ZFSet.{u}} + (below : alpha ⊆ beta) : + assignmentCut levels alpha (assignmentCut levels beta A) = + assignmentCut levels alpha A := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut, mem_assignmentCut, mem_assignmentCut] + constructor + · rintro ⟨⟨hz, _⟩, lower⟩ + exact ⟨hz, lower⟩ + · rintro ⟨hz, xi, hxi, entry⟩ + exact ⟨⟨hz, xi, below hxi, entry⟩, xi, hxi, entry⟩ + +theorem assignmentCut_eq_of_lower {levels alpha A : ZFSet.{u}} + (lower : ∀ z ∈ A, ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) : + assignmentCut levels alpha A = A := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut] + exact ⟨fun hz => hz.1, fun hz => ⟨hz, lower z hz⟩⟩ + +theorem assignmentCut_full {J eta levels A : ZFSet.{u}} + (function : ZFSet.IsFunc J eta levels) (subset : A ⊆ J) : + assignmentCut levels eta A = A := by + apply assignmentCut_eq_of_lower + intro z hz + obtain ⟨xi, entry, _⟩ := function.2 z (subset hz) + exact ⟨xi, (ZFSet.pair_mem_prod.1 (function.1 entry)).2, entry⟩ + +theorem assignmentCut_splice (levels alpha Aq Ap : ZFSet.{u}) : + assignmentCut levels alpha (assignmentSplice levels alpha Aq Ap) = + assignmentCut levels alpha Aq := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut, mem_assignmentSplice, mem_assignmentCut] + constructor + · rintro ⟨lower | upper, level⟩ + · exact lower + · exact False.elim (upper.2 level) + · intro lower + exact ⟨Or.inl lower, lower.2⟩ + +theorem assignmentUpper_splice (levels alpha Aq Ap : ZFSet.{u}) : + assignmentUpper levels alpha (assignmentSplice levels alpha Aq Ap) = + assignmentUpper levels alpha Ap := by + apply ZFSet.ext + intro z + rw [mem_assignmentUpper, mem_assignmentSplice, mem_assignmentUpper] + constructor + · rintro ⟨lower | upper, outside⟩ + · exact False.elim (outside lower.2) + · exact upper + · intro upper + exact ⟨Or.inr upper, upper.2⟩ + +theorem assignmentSplice_self (levels alpha A : ZFSet.{u}) : + assignmentSplice levels alpha A A = A := by + classical + apply ZFSet.ext + intro z + rw [mem_assignmentSplice] + constructor + · exact fun h => h.elim And.left And.left + · intro hz + by_cases lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels + · exact Or.inl ⟨hz, lower⟩ + · exact Or.inr ⟨hz, lower⟩ + +theorem assignmentSplice_of_lower {levels alpha Aq Ap : ZFSet.{u}} + (lower : ∀ z ∈ Aq, ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels) : + assignmentSplice levels alpha Aq Ap = Aq ∪ assignmentUpper levels alpha Ap ∧ + assignmentCut levels alpha (assignmentSplice levels alpha Aq Ap) = Aq := by + have equal := assignmentCut_eq_of_lower lower + exact ⟨by rw [assignmentSplice, equal], by rw [assignmentCut_splice, equal]⟩ + +theorem assignmentSplice_extends {levels alpha Aq Ap : ZFSet.{u}} + (contains : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq) : + Ap ⊆ assignmentSplice levels alpha Aq Ap := by + classical + intro z hz + by_cases lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels + · exact ZFSet.mem_union.2 (Or.inl (contains + ((mem_assignmentCut levels alpha Ap z).2 ⟨hz, lower⟩))) + · exact (mem_assignmentSplice levels alpha Aq Ap z).2 (Or.inr ⟨hz, lower⟩) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u +variable {levels alpha beta : ZFSet.{u}} (below : alpha ⊆ beta) +include below + +theorem assignmentCut_splice_below (Aq Ap : ZFSet.{u}) : + assignmentCut levels alpha (assignmentSplice levels beta Aq Ap) = + assignmentCut levels alpha Aq := by + calc + _ = assignmentCut levels alpha + (assignmentCut levels beta (assignmentSplice levels beta Aq Ap)) := + (assignmentCut_nested below).symm + _ = assignmentCut levels alpha (assignmentCut levels beta Aq) := by rw [assignmentCut_splice] + _ = _ := assignmentCut_nested below + +theorem assignmentUpper_splice_above (Aq Ap : ZFSet.{u}) : + assignmentUpper levels beta (assignmentSplice levels alpha Aq Ap) = + assignmentUpper levels beta Ap := by + apply ZFSet.ext + intro z + rw [mem_assignmentUpper, mem_assignmentSplice, mem_assignmentUpper] + constructor + · rintro ⟨lower | upper, outside⟩ + · obtain ⟨xi, hxi, entry⟩ := lower.2 + exact False.elim (outside ⟨xi, below hxi, entry⟩) + · exact ⟨upper.1, outside⟩ + · rintro ⟨member, outside⟩ + exact ⟨Or.inr ⟨member, fun ⟨xi, hxi, entry⟩ => outside ⟨xi, below hxi, entry⟩⟩, outside⟩ + +theorem assignmentSplice_nested (Ar Aq Ap : ZFSet.{u}) : + assignmentSplice levels alpha Ar (assignmentSplice levels beta Aq Ap) = + assignmentSplice levels beta (assignmentSplice levels alpha Ar Aq) Ap := by + classical + apply ZFSet.ext + intro z + simp only [mem_assignmentSplice] + by_cases lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels + · obtain ⟨xi, hxi, entry⟩ := lower + have lower : ∃ xi ∈ alpha, ZFSet.pair z xi ∈ levels := ⟨xi, hxi, entry⟩ + have higher : ∃ xi ∈ beta, ZFSet.pair z xi ∈ levels := ⟨xi, below hxi, entry⟩ + simp only [lower, higher, and_true, not_true_eq_false, and_false, or_false] + · by_cases higher : ∃ xi ∈ beta, ZFSet.pair z xi ∈ levels + · simp only [lower, higher, and_true, not_true_eq_false, and_false, or_false, + not_false_eq_true, false_or] + · simp only [lower, higher, and_true, and_false, not_false_eq_true, false_or] + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicEqualitySteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicEqualitySteps.lean index 899afe604d91625cfe000b6b4a7c26ab1a11601f..b2776c155876e441358126bfb61db17a1f3b7d17 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicEqualitySteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicEqualitySteps.lean @@ -1,95 +1,95 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.EvaluatedDomains - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -def EqualityStep (R : P → Name s → Name s → Prop) (p : P) (σ τ : Name s) : Prop := - (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → - ∃ t, t ≤ q ∧ ∃ ν k, Entry ν τ k ∧ t ≤ k ∧ R t ρ ν) ∧ - (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → - ∃ t, t ≤ q ∧ ∃ ρ r, Entry ρ σ r ∧ t ≤ r ∧ R t ρ ν) - -def RelationMembership (R : P → Name s → Name s → Prop) (p : P) (σ τ : Name s) : Prop := - ∀ q, q ≤ p → ∃ t, t ≤ q ∧ ∃ ν r, Entry ν τ r ∧ t ≤ r ∧ R t σ ν - -theorem equalityStep_mono {R S : P → Name s → Name s → Prop} - (mono : ∀ p σ τ, R p σ τ → S p σ τ) {p : P} {σ τ : Name s} - (h : EqualityStep R p σ τ) : EqualityStep S p σ τ := by - constructor - · intro ρ r hr q qp qr - obtain ⟨t, tq, ν, k, hk, tk, rel⟩ := h.1 ρ r hr q qp qr - exact ⟨t, tq, ν, k, hk, tk, mono t ρ ν rel⟩ - · intro ν k hk q qp qk - obtain ⟨t, tq, ρ, r, hr, tr, rel⟩ := h.2 ν k hk q qp qk - exact ⟨t, tq, ρ, r, hr, tr, mono t ρ ν rel⟩ - -theorem forcesEq_step (p : P) (σ τ : Name s) : ForcesEq p σ τ ↔ EqualityStep ForcesEq p σ τ := by - rw [ForcesEq] - simp only [EqualityStep, exists_prop] - -theorem equalityStep_dense (R : P → Name s → Name s → Prop) (p : P) (σ τ : Name s) : - EqualityStep R p σ τ ↔ - (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → RelationMembership R q ρ τ) ∧ - (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → - RelationMembership (fun t ρ ν => R t ν ρ) q ν σ) := by - constructor - · intro h - exact ⟨fun ρ r hr q qp qr t tq => h.1 ρ r hr t (tq.trans qp) (tq.trans qr), - fun ν k hk q qp qk t tq => h.2 ν k hk t (tq.trans qp) (tq.trans qk)⟩ - · rintro ⟨left, right⟩ - exact ⟨fun ρ r hr q qp qr => left ρ r hr q qp qr q le_rfl, - fun ν k hk q qp qk => right ν k hk q qp qk q le_rfl⟩ - -theorem postfixed_equality_sound (D : NameDomain s) (R : P → Name s → Name s → Prop) - (post : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, R p σ τ → EqualityStep R p σ τ) : - ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, R p σ τ → ForcesEq p σ τ := by - intro σ - induction σ using inductionOn with - | step σ ih => - intro hσ τ hτ p rel - have h := post σ hσ τ hτ p rel - rw [forcesEq_step] - constructor - · intro ρ r hr q qp qr - obtain ⟨t, tq, ν, k, hk, tk, hrel⟩ := h.1 ρ r hr q qp qr - exact ⟨t, tq, ν, k, hk, tk, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ - · intro ν k hk q qp qk - obtain ⟨t, tq, ρ, r, hr, tr, hrel⟩ := h.2 ν k hk q qp qk - exact ⟨t, tq, ρ, r, hr, tr, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ - -theorem prefixed_equality_complete (D : NameDomain s) (R : P → Name s → Name s → Prop) - (pre : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, EqualityStep R p σ τ → R p σ τ) : - ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, ForcesEq p σ τ → R p σ τ := by - intro σ - induction σ using inductionOn with - | step σ ih => - intro hσ τ hτ p forced - have h := (forcesEq_step p σ τ).1 forced - apply pre σ hσ τ hτ p - constructor - · intro ρ r hr q qp qr - obtain ⟨t, tq, ν, k, hk, tk, hrel⟩ := h.1 ρ r hr q qp qr - exact ⟨t, tq, ν, k, hk, tk, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ - · intro ν k hk q qp qk - obtain ⟨t, tq, ρ, r, hr, tr, hrel⟩ := h.2 ν k hk q qp qk - exact ⟨t, tq, ρ, r, hr, tr, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ - -theorem fixed_equality_iff (D : NameDomain s) (R : P → Name s → Name s → Prop) - (fixed : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, R p σ τ ↔ EqualityStep R p σ τ) - {σ τ : Name s} (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) (p : P) : - R p σ τ ↔ ForcesEq p σ τ := - ⟨postfixed_equality_sound D R (fun σ hσ τ hτ p => (fixed σ hσ τ hτ p).1) σ hσ τ hτ p, - prefixed_equality_complete D R (fun σ hσ τ hτ p => (fixed σ hσ τ hτ p).2) σ hσ τ hτ p⟩ - -end PartitionPilot.Forcing.Name - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.EvaluatedDomains + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +def EqualityStep (R : P → Name s → Name s → Prop) (p : P) (σ τ : Name s) : Prop := + (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → + ∃ t, t ≤ q ∧ ∃ ν k, Entry ν τ k ∧ t ≤ k ∧ R t ρ ν) ∧ + (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → + ∃ t, t ≤ q ∧ ∃ ρ r, Entry ρ σ r ∧ t ≤ r ∧ R t ρ ν) + +def RelationMembership (R : P → Name s → Name s → Prop) (p : P) (σ τ : Name s) : Prop := + ∀ q, q ≤ p → ∃ t, t ≤ q ∧ ∃ ν r, Entry ν τ r ∧ t ≤ r ∧ R t σ ν + +theorem equalityStep_mono {R S : P → Name s → Name s → Prop} + (mono : ∀ p σ τ, R p σ τ → S p σ τ) {p : P} {σ τ : Name s} + (h : EqualityStep R p σ τ) : EqualityStep S p σ τ := by + constructor + · intro ρ r hr q qp qr + obtain ⟨t, tq, ν, k, hk, tk, rel⟩ := h.1 ρ r hr q qp qr + exact ⟨t, tq, ν, k, hk, tk, mono t ρ ν rel⟩ + · intro ν k hk q qp qk + obtain ⟨t, tq, ρ, r, hr, tr, rel⟩ := h.2 ν k hk q qp qk + exact ⟨t, tq, ρ, r, hr, tr, mono t ρ ν rel⟩ + +theorem forcesEq_step (p : P) (σ τ : Name s) : ForcesEq p σ τ ↔ EqualityStep ForcesEq p σ τ := by + rw [ForcesEq] + simp only [EqualityStep, exists_prop] + +theorem equalityStep_dense (R : P → Name s → Name s → Prop) (p : P) (σ τ : Name s) : + EqualityStep R p σ τ ↔ + (∀ ρ r, Entry ρ σ r → ∀ q, q ≤ p → q ≤ r → RelationMembership R q ρ τ) ∧ + (∀ ν k, Entry ν τ k → ∀ q, q ≤ p → q ≤ k → + RelationMembership (fun t ρ ν => R t ν ρ) q ν σ) := by + constructor + · intro h + exact ⟨fun ρ r hr q qp qr t tq => h.1 ρ r hr t (tq.trans qp) (tq.trans qr), + fun ν k hk q qp qk t tq => h.2 ν k hk t (tq.trans qp) (tq.trans qk)⟩ + · rintro ⟨left, right⟩ + exact ⟨fun ρ r hr q qp qr => left ρ r hr q qp qr q le_rfl, + fun ν k hk q qp qk => right ν k hk q qp qk q le_rfl⟩ + +theorem postfixed_equality_sound (D : NameDomain s) (R : P → Name s → Name s → Prop) + (post : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, R p σ τ → EqualityStep R p σ τ) : + ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, R p σ τ → ForcesEq p σ τ := by + intro σ + induction σ using inductionOn with + | step σ ih => + intro hσ τ hτ p rel + have h := post σ hσ τ hτ p rel + rw [forcesEq_step] + constructor + · intro ρ r hr q qp qr + obtain ⟨t, tq, ν, k, hk, tk, hrel⟩ := h.1 ρ r hr q qp qr + exact ⟨t, tq, ν, k, hk, tk, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ + · intro ν k hk q qp qk + obtain ⟨t, tq, ρ, r, hr, tr, hrel⟩ := h.2 ν k hk q qp qk + exact ⟨t, tq, ρ, r, hr, tr, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ + +theorem prefixed_equality_complete (D : NameDomain s) (R : P → Name s → Name s → Prop) + (pre : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, EqualityStep R p σ τ → R p σ τ) : + ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, ForcesEq p σ τ → R p σ τ := by + intro σ + induction σ using inductionOn with + | step σ ih => + intro hσ τ hτ p forced + have h := (forcesEq_step p σ τ).1 forced + apply pre σ hσ τ hτ p + constructor + · intro ρ r hr q qp qr + obtain ⟨t, tq, ν, k, hk, tk, hrel⟩ := h.1 ρ r hr q qp qr + exact ⟨t, tq, ν, k, hk, tk, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ + · intro ν k hk q qp qk + obtain ⟨t, tq, ρ, r, hr, tr, hrel⟩ := h.2 ν k hk q qp qk + exact ⟨t, tq, ρ, r, hr, tr, ih ρ r hr (D.children hσ hr) ν (D.children hτ hk) t hrel⟩ + +theorem fixed_equality_iff (D : NameDomain s) (R : P → Name s → Name s → Prop) + (fixed : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, R p σ τ ↔ EqualityStep R p σ τ) + {σ τ : Name s} (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) (p : P) : + R p σ τ ↔ ForcesEq p σ τ := + ⟨postfixed_equality_sound D R (fun σ hσ τ hτ p => (fixed σ hσ τ hτ p).1) σ hσ τ hτ p, + prefixed_equality_complete D R (fun σ hσ τ hτ p => (fixed σ hσ τ hτ p).2) σ hσ τ hτ p⟩ + +end PartitionPilot.Forcing.Name + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicSoundness.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicSoundness.lean index 4ac69a4c7355b7b5d3714732a65851bf8dfaa7c2..b7adaecdbd1a89d4488706fea1b75a607af36dca 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicSoundness.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/AtomicSoundness.lean @@ -1,55 +1,55 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.EvaluatedDomains - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Name - -open SetRealization -universe u -variable {P : Type u} [Preorder P] {s : Presentation P} - -theorem forcesEq_sound (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) : - ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, H.mem p → ForcesEq p σ τ → - eval {q | H.mem q} σ = eval {q | H.mem q} τ := by - intro σ - induction σ using inductionOn with - | step σ ih => - intro hσ τ hτ p hp eq - apply ZFSet.ext - intro value - constructor - · intro hv - obtain ⟨ρ, r, entry, hr, old⟩ := (mem_eval {q | H.mem q} σ value).1 hv - obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr - have hρ := D.children hσ entry - obtain ⟨t, ht, ν, k, target, tk, childEq⟩ := generic_mem_witness D H generic hρ hτ hq - (forcesEq_left eq entry qp qr) - have values := ih ρ r entry hρ ν (D.children hτ target) t ht childEq - exact (mem_eval {q | H.mem q} τ value).2 - ⟨ν, k, target, H.upward ht tk, values.symm.trans old⟩ - · intro hv - obtain ⟨ν, k, entry, hk, old⟩ := (mem_eval {q | H.mem q} τ value).1 hv - obtain ⟨q, hq, qp, qk⟩ := H.directed hp hk - have hν := D.children hτ entry - obtain ⟨t, ht, ρ, r, target, tr, childEq⟩ := generic_mem_witness D H generic hν hσ hq - (forcesEq_right eq entry qp qk) - have values := ih ρ r target (D.children hσ target) ν hν t ht (forcesEq_symm childEq) - exact (mem_eval {q | H.mem q} σ value).2 - ⟨ρ, r, target, H.upward ht tr, values.trans old⟩ - -theorem forcesMem_sound (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} - (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) {p : P} (hp : H.mem p) - (h : ForcesMem p σ τ) : eval {q | H.mem q} σ ∈ eval {q | H.mem q} τ := by - obtain ⟨q, hq, ν, r, entry, qr, eq⟩ := generic_mem_witness D H generic hσ hτ hp h - have values := forcesEq_sound D H generic σ hσ ν (D.children hτ entry) q hq eq - exact (mem_eval {q | H.mem q} τ _).2 ⟨ν, r, entry, H.upward hq qr, values.symm⟩ - -end PartitionPilot.Forcing.Name - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.EvaluatedDomains + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Name + +open SetRealization +universe u +variable {P : Type u} [Preorder P] {s : Presentation P} + +theorem forcesEq_sound (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) : + ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, H.mem p → ForcesEq p σ τ → + eval {q | H.mem q} σ = eval {q | H.mem q} τ := by + intro σ + induction σ using inductionOn with + | step σ ih => + intro hσ τ hτ p hp eq + apply ZFSet.ext + intro value + constructor + · intro hv + obtain ⟨ρ, r, entry, hr, old⟩ := (mem_eval {q | H.mem q} σ value).1 hv + obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr + have hρ := D.children hσ entry + obtain ⟨t, ht, ν, k, target, tk, childEq⟩ := generic_mem_witness D H generic hρ hτ hq + (forcesEq_left eq entry qp qr) + have values := ih ρ r entry hρ ν (D.children hτ target) t ht childEq + exact (mem_eval {q | H.mem q} τ value).2 + ⟨ν, k, target, H.upward ht tk, values.symm.trans old⟩ + · intro hv + obtain ⟨ν, k, entry, hk, old⟩ := (mem_eval {q | H.mem q} τ value).1 hv + obtain ⟨q, hq, qp, qk⟩ := H.directed hp hk + have hν := D.children hτ entry + obtain ⟨t, ht, ρ, r, target, tr, childEq⟩ := generic_mem_witness D H generic hν hσ hq + (forcesEq_right eq entry qp qk) + have values := ih ρ r target (D.children hσ target) ν hν t ht (forcesEq_symm childEq) + exact (mem_eval {q | H.mem q} σ value).2 + ⟨ρ, r, target, H.upward ht tr, values.trans old⟩ + +theorem forcesMem_sound (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) {σ τ : Name s} + (hσ : σ ∈ D.names) (hτ : τ ∈ D.names) {p : P} (hp : H.mem p) + (h : ForcesMem p σ τ) : eval {q | H.mem q} σ ∈ eval {q | H.mem q} τ := by + obtain ⟨q, hq, ν, r, entry, qr, eq⟩ := generic_mem_witness D H generic hσ hτ hp h + have values := forcesEq_sound D H generic σ hσ ν (D.children hτ entry) q hq eq + exact (mem_eval {q | H.mem q} τ _).2 ⟨ν, r, entry, H.upward hq qr, values.symm⟩ + +end PartitionPilot.Forcing.Name + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/BinaryTiles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/BinaryTiles.lean index f9a3f6b9dc35ecb638286f3cedd192bd615dde35..700ac04072eff89983e547cbc16b8fa81db4ee55 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/BinaryTiles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/BinaryTiles.lean @@ -1,343 +1,343 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.AttachmentCoinitiality - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation - -open Attachment - -universe u v - -structure Input {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) where - leftAnchor : A - rightAnchor : B - overlap : MeetIso (idealOrder Q rightAnchor) (idealOrder P leftAnchor) - -namespace Input - -variable {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} (g : Input P Q) - -def Fresh := {b : B // ¬ Q.le b g.rightAnchor} - -def Node := A ⊕ g.Fresh - -def shadow (b : B) : A := (g.overlap.toFun (cut Q g.rightAnchor b)).val - -theorem shadow_le_anchor (b : B) : P.le (g.shadow b) g.leftAnchor := - (g.overlap.toFun (cut Q g.rightAnchor b)).property - -theorem shadow_mono {b c : B} (h : Q.le b c) : P.le (g.shadow b) (g.shadow c) := - (g.overlap.le_iff _ _).mpr (cut_mono Q g.rightAnchor h) - -theorem shadow_meet (b c : B) : g.shadow (Q.meet b c) = P.meet (g.shadow b) (g.shadow c) := by - unfold shadow - rw [cut_meet, g.overlap.map_meet] - rfl - -def data : Data P g.Fresh Unit where - component _ := () - base _ := g.leftAnchor - upper _ _ := False - upper_up := by intro _ _ _ h _; exact h - upper_meet := by intro _ _ _ h _; exact h - base_le_upper _ _ h := False.elim h - base_not_upper _ h := h - shadow x := g.shadow x.val - shadow_le_base x := g.shadow_le_anchor x.val - inside x y := Q.le x.val y.val - inside_refl x := Q.refl x.val - inside_trans := Q.trans - inside_antisymm hxy hyx := Subtype.ext (Q.antisymm hxy hyx) - inside_component _ := rfl - inside_shadow := g.shadow_mono - -theorem component_meets : ComponentMeets g.data := by - classical - intro x y _ - by_cases old : Q.le (Q.meet x.val y.val) g.rightAnchor - · exact Or.inr (fun z hx hy => z.property (Q.trans (Q.le_meet hx hy) old)) - · exact Or.inl ⟨⟨Q.meet x.val y.val, old⟩, Q.meet_le_left _ _, Q.meet_le_right _ _, - fun _ hx hy => Q.le_meet hx hy, g.shadow_meet x.val y.val⟩ - -noncomputable def order : MeetOrder g.Node := meetOrder g.data g.component_meets - -noncomputable def left : MeetEmbedding P g.order := oldEmbedding g.data g.component_meets - -noncomputable def represent (b : B) : g.Node := by - classical - exact if h : Q.le b g.rightAnchor then .inl (g.overlap.toFun ⟨b, h⟩).val - else .inr ⟨b, h⟩ - -theorem represent_old (b : B) (h : Q.le b g.rightAnchor) : - g.represent b = .inl (g.overlap.toFun ⟨b, h⟩).val := by - unfold represent - exact dite_eq_left h - -theorem represent_new (b : B) (h : ¬ Q.le b g.rightAnchor) : - g.represent b = .inr ⟨b, h⟩ := by - unfold represent - exact dite_eq_right h - -theorem represent_le_iff (b c : B) : g.order.le (g.represent b) (g.represent c) ↔ Q.le b c := by - classical - by_cases hb : Q.le b g.rightAnchor - · rw [g.represent_old b hb] - by_cases hc : Q.le c g.rightAnchor - · rw [g.represent_old c hc] - exact g.overlap.le_iff _ _ - · rw [g.represent_new c hc] - change P.le (g.overlap.toFun ⟨b, hb⟩).val (g.overlap.toFun (cut Q g.rightAnchor c)).val ↔ _ - change (idealOrder P g.leftAnchor).le (g.overlap.toFun ⟨b, hb⟩) - (g.overlap.toFun (cut Q g.rightAnchor c)) ↔ _ - rw [g.overlap.le_iff] - exact ⟨fun h => Q.trans h (Q.meet_le_left _ _), fun h => Q.le_meet h hb⟩ - · rw [g.represent_new b hb] - by_cases hc : Q.le c g.rightAnchor - · rw [g.represent_old c hc] - exact ⟨False.elim, fun h => hb (Q.trans h hc)⟩ - · rw [g.represent_new c hc] - exact ⟨fun h => h.elim id False.elim, Or.inl⟩ - -theorem old_below_represent (a : A) (b : B) : - g.order.le (.inl a) (g.represent b) ↔ P.le a (g.shadow b) := by - classical - by_cases h : Q.le b g.rightAnchor - · rw [g.represent_old b h] - unfold shadow - rw [cut_of_le Q g.rightAnchor b h] - exact Iff.rfl - · rw [g.represent_new b h] - exact Iff.rfl - -theorem represented_meet (b c : B) : - IsMeet g.data (g.represent b) (g.represent c) (g.represent (Q.meet b c)) := by - refine ⟨(g.represent_le_iff _ _).mpr (Q.meet_le_left _ _), - (g.represent_le_iff _ _).mpr (Q.meet_le_right _ _), ?_⟩ - intro x hx hy - cases x with - | inl a => - apply (g.old_below_represent a _).mpr - rw [g.shadow_meet] - exact P.le_meet ((g.old_below_represent a b).mp hx) ((g.old_below_represent a c).mp hy) - | inr x => - have represented : g.represent x.val = Sum.inr x := g.represent_new x.val x.property - rw [← represented] at hx hy ⊢ - exact (g.represent_le_iff _ _).mpr - (Q.le_meet ((g.represent_le_iff _ _).mp hx) ((g.represent_le_iff _ _).mp hy)) - -noncomputable def right : MeetEmbedding Q g.order where - toFun := g.represent - le_iff := g.represent_le_iff - map_meet b c := (meet_eq g.data g.component_meets (g.represented_meet b c)).symm - -theorem cover (x : g.Node) : (∃ a, g.left.toFun a = x) ∨ (∃ b, g.right.toFun b = x) := by - cases x with - | inl a => exact Or.inl ⟨a, rfl⟩ - | inr b => exact Or.inr ⟨b.val, g.represent_new b.val b.property⟩ - -theorem left_ideal (a : A) (x : g.Node) (h : g.order.le x (g.left.toFun a)) : - ∃ b, g.left.toFun b = x := by - cases x with - | inl b => exact ⟨b, rfl⟩ - | inr x => exact False.elim h - -theorem overlap_exact (a : A) (b : B) : - g.right.toFun b = g.left.toFun a ↔ - ∃ h : Q.le b g.rightAnchor, (g.overlap.toFun ⟨b, h⟩).val = a := by - classical - change g.represent b = Sum.inl a ↔ _ - by_cases h : Q.le b g.rightAnchor - · rw [g.represent_old b h] - constructor - · intro eq - exact ⟨h, Sum.inl.inj eq⟩ - · rintro ⟨_, eq⟩ - exact congrArg Sum.inl eq - · rw [g.represent_new b h] - exact ⟨(fun eq => by cases eq), fun ⟨hb, _⟩ => False.elim (h hb)⟩ - -theorem old_in_right (a : A) : - (∃ b, g.right.toFun b = g.left.toFun a) ↔ P.le a g.leftAnchor := by - constructor - · rintro ⟨b, eq⟩ - rcases (g.overlap_exact a b).mp eq with ⟨hb, val⟩ - exact val ▸ (g.overlap.toFun ⟨b, hb⟩).property - · intro ha - let b := g.overlap.inverse ⟨a, ha⟩ - refine ⟨b.val, (g.overlap_exact a b.val).mpr ⟨b.property, ?_⟩⟩ - exact congrArg Subtype.val (g.overlap.right_inverse ⟨a, ha⟩) - -theorem right_ideal (b : B) (x : g.Node) (h : g.order.le x (g.right.toFun b)) : - ∃ c, g.right.toFun c = x := by - cases x with - | inl a => - apply (g.old_in_right a).mpr - exact P.trans ((g.old_below_represent a b).mp h) (g.shadow_le_anchor b) - | inr x => exact ⟨x.val, g.represent_new x.val x.property⟩ - -theorem cross_meet (a : A) (b : B) : - g.order.meet (g.left.toFun a) (g.right.toFun b) = .inl (P.meet a (g.shadow b)) := by - apply meet_eq g.data g.component_meets - refine ⟨P.meet_le_left _ _, (g.old_below_represent _ b).mpr (P.meet_le_right _ _), ?_⟩ - intro x hx hy - rcases g.left_ideal a x hx with ⟨c, rfl⟩ - exact P.le_meet hx ((g.old_below_represent c b).mp hy) - -theorem new_shadow_meet (b : g.Fresh) (a : A) : - g.order.meet (.inr b) (.inl a) = .inl (P.meet (g.shadow b.val) a) := - meet_eq g.data g.component_meets (Attachment.shadow_meet g.data b a (fun h => h)) - -theorem principal_cross_meet (a : A) (b : B) : - g.order.meet (g.left.toFun a) (g.right.toFun b) = - g.left.toFun (P.meet (P.meet a g.leftAnchor) (g.shadow b)) := by - rw [g.cross_meet] - apply congrArg Sum.inl - apply P.antisymm - · exact P.le_meet - (P.le_meet (P.meet_le_left _ _) - (P.trans (P.meet_le_right _ _) (g.shadow_le_anchor b))) - (P.meet_le_right _ _) - · exact P.le_meet - (P.trans (P.meet_le_left _ _) (P.meet_le_left _ _)) (P.meet_le_right _ _) - -theorem greatest_old_part (b : B) : - ∀ a, g.order.le (g.left.toFun a) (g.right.toFun b) ↔ P.le a (g.shadow b) := - fun a => g.old_below_represent a b - -theorem left_principal (top : A) (greatest : ∀ a, P.le a top) (x : g.Node) : - g.order.le x (g.left.toFun top) ↔ ∃ a, g.left.toFun a = x := by - constructor - · exact g.left_ideal top x - · rintro ⟨a, rfl⟩ - exact (g.left.le_iff _ _).mpr (greatest a) - -theorem right_principal (top : B) (greatest : ∀ b, Q.le b top) (x : g.Node) : - g.order.le x (g.right.toFun top) ↔ ∃ b, g.right.toFun b = x := by - constructor - · exact g.right_ideal top x - · rintro ⟨b, rfl⟩ - exact (g.right.le_iff _ _).mpr (greatest b) - -theorem least_preserved (zero : A) (least : ∀ a, P.le zero a) : - ∀ x, g.order.le (g.left.toFun zero) x := by - intro x - cases x with - | inl a => exact least a - | inr b => exact least (g.shadow b.val) - -theorem bottoms_agree (zeroA : A) (zeroB : B) - (leastA : ∀ a, P.le zeroA a) (leastB : ∀ b, Q.le zeroB b) : - g.right.toFun zeroB = g.left.toFun zeroA := by - have lower := g.least_preserved zeroA leastA (g.right.toFun zeroB) - rcases g.right_ideal zeroB (g.left.toFun zeroA) lower with ⟨b, eq⟩ - apply g.order.antisymm - · rw [← eq] - exact (g.right.le_iff _ _).mpr (leastB b) - · exact lower - -theorem comparison_in_vertex (x y : g.Node) (lower : g.order.le x y) : - (∃ a b, g.left.toFun a = x ∧ g.left.toFun b = y ∧ P.le a b) ∨ - (∃ a b, g.right.toFun a = x ∧ g.right.toFun b = y ∧ Q.le a b) := by - rcases g.cover y with ⟨b, rfl⟩ | ⟨b, rfl⟩ - · rcases g.left_ideal b x lower with ⟨a, rfl⟩ - exact Or.inl ⟨a, b, rfl, rfl, (g.left.le_iff _ _).mp lower⟩ - · rcases g.right_ideal b x lower with ⟨a, rfl⟩ - exact Or.inr ⟨a, b, rfl, rfl, (g.right.le_iff _ _).mp lower⟩ - -end Input - -end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation - - - -namespace PartitionPilot.Compression.RecursiveMaps.BinaryTiles - -open Attachment PrincipalAmalgamation - -universe u - -variable {A : Type u} (P : MeetOrder A) - -noncomputable def vertex (g : Input P P) : Bool → MeetEmbedding P g.order - | false => g.left - | true => g.right - -theorem vertex_cover (g : Input P P) (x : g.Node) : - ∃ i y, (vertex P g i).toFun y = x := by - rcases g.cover x with ⟨y, eq⟩ | ⟨y, eq⟩ - · exact ⟨false, y, eq⟩ - · exact ⟨true, y, eq⟩ - -def separation (W : A) : Input P P where - leftAnchor := W - rightAnchor := W - overlap := - { toFun := id - le_iff := fun _ _ => Iff.rfl - map_meet := fun _ _ => rfl - inverse := id - left_inverse := fun _ => rfl - right_inverse := fun _ => rfl } - -theorem separation_fixes (W x : A) (below : P.le x W) : - (separation P W).right.toFun x = (separation P W).left.toFun x := - (separation P W).represent_old x below - -theorem separation_intersection (W x : A) : - (∃ y, (separation P W).right.toFun y = (separation P W).left.toFun x) ↔ P.le x W := - (separation P W).old_in_right x - -theorem separation_cross_meet (W D X : A) (belowD : P.le W D) (belowX : P.le W X) : - (separation P W).order.meet ((separation P W).right.toFun D) - ((separation P W).left.toFun X) = (separation P W).left.toFun W := by - rw [meet_comm, (separation P W).cross_meet] - change Sum.inl (P.meet X (P.meet D W)) = Sum.inl W - have dw : P.meet D W = W := - P.antisymm (P.meet_le_right _ _) (P.le_meet belowD (P.refl W)) - have xw : P.meet X W = W := - P.antisymm (P.meet_le_right _ _) (P.le_meet belowX (P.refl W)) - rw [dw, xw] - -def compression (T K : A) (top : ∀ x, P.le x T) (S : MeetIso P (idealOrder P K)) : - Input P P where - leftAnchor := K - rightAnchor := T - overlap := - { toFun := fun x => S.toFun x.val - le_iff := fun x y => S.le_iff x.val y.val - map_meet := fun x y => S.map_meet x.val y.val - inverse := fun y => ⟨S.inverse y, top _⟩ - left_inverse := fun x => Subtype.ext (S.left_inverse x.val) - right_inverse := fun y => S.right_inverse y } - -theorem compression_identification (T K : A) (top : ∀ x, P.le x T) - (S : MeetIso P (idealOrder P K)) (x : A) : - (compression P T K top S).right.toFun x = - (compression P T K top S).left.toFun (S.toFun x).val := - (compression P T K top S).represent_old x (top x) - -theorem compression_no_new_nodes (T K : A) (top : ∀ x, P.le x T) - (S : MeetIso P (idealOrder P K)) (x : (compression P T K top S).Node) : - ∃ a, (compression P T K top S).left.toFun a = x := by - cases x with - | inl a => exact ⟨a, rfl⟩ - | inr b => exact False.elim (b.property (top b.val)) - -theorem compression_top (T K : A) (top : ∀ x, P.le x T) - (S : MeetIso P (idealOrder P K)) : - (compression P T K top S).right.toFun T = - (compression P T K top S).left.toFun K := by - rw [compression_identification] - apply congrArg (compression P T K top S).left.toFun - apply P.antisymm (S.toFun T).property - have bound := (S.le_iff (S.inverse ⟨K, P.refl K⟩) T).mpr (top _) - rw [S.right_inverse] at bound - exact bound - -end PartitionPilot.Compression.RecursiveMaps.BinaryTiles - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.AttachmentCoinitiality + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation + +open Attachment + +universe u v + +structure Input {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) where + leftAnchor : A + rightAnchor : B + overlap : MeetIso (idealOrder Q rightAnchor) (idealOrder P leftAnchor) + +namespace Input + +variable {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} (g : Input P Q) + +def Fresh := {b : B // ¬ Q.le b g.rightAnchor} + +def Node := A ⊕ g.Fresh + +def shadow (b : B) : A := (g.overlap.toFun (cut Q g.rightAnchor b)).val + +theorem shadow_le_anchor (b : B) : P.le (g.shadow b) g.leftAnchor := + (g.overlap.toFun (cut Q g.rightAnchor b)).property + +theorem shadow_mono {b c : B} (h : Q.le b c) : P.le (g.shadow b) (g.shadow c) := + (g.overlap.le_iff _ _).mpr (cut_mono Q g.rightAnchor h) + +theorem shadow_meet (b c : B) : g.shadow (Q.meet b c) = P.meet (g.shadow b) (g.shadow c) := by + unfold shadow + rw [cut_meet, g.overlap.map_meet] + rfl + +def data : Data P g.Fresh Unit where + component _ := () + base _ := g.leftAnchor + upper _ _ := False + upper_up := by intro _ _ _ h _; exact h + upper_meet := by intro _ _ _ h _; exact h + base_le_upper _ _ h := False.elim h + base_not_upper _ h := h + shadow x := g.shadow x.val + shadow_le_base x := g.shadow_le_anchor x.val + inside x y := Q.le x.val y.val + inside_refl x := Q.refl x.val + inside_trans := Q.trans + inside_antisymm hxy hyx := Subtype.ext (Q.antisymm hxy hyx) + inside_component _ := rfl + inside_shadow := g.shadow_mono + +theorem component_meets : ComponentMeets g.data := by + classical + intro x y _ + by_cases old : Q.le (Q.meet x.val y.val) g.rightAnchor + · exact Or.inr (fun z hx hy => z.property (Q.trans (Q.le_meet hx hy) old)) + · exact Or.inl ⟨⟨Q.meet x.val y.val, old⟩, Q.meet_le_left _ _, Q.meet_le_right _ _, + fun _ hx hy => Q.le_meet hx hy, g.shadow_meet x.val y.val⟩ + +noncomputable def order : MeetOrder g.Node := meetOrder g.data g.component_meets + +noncomputable def left : MeetEmbedding P g.order := oldEmbedding g.data g.component_meets + +noncomputable def represent (b : B) : g.Node := by + classical + exact if h : Q.le b g.rightAnchor then .inl (g.overlap.toFun ⟨b, h⟩).val + else .inr ⟨b, h⟩ + +theorem represent_old (b : B) (h : Q.le b g.rightAnchor) : + g.represent b = .inl (g.overlap.toFun ⟨b, h⟩).val := by + unfold represent + exact dite_eq_left h + +theorem represent_new (b : B) (h : ¬ Q.le b g.rightAnchor) : + g.represent b = .inr ⟨b, h⟩ := by + unfold represent + exact dite_eq_right h + +theorem represent_le_iff (b c : B) : g.order.le (g.represent b) (g.represent c) ↔ Q.le b c := by + classical + by_cases hb : Q.le b g.rightAnchor + · rw [g.represent_old b hb] + by_cases hc : Q.le c g.rightAnchor + · rw [g.represent_old c hc] + exact g.overlap.le_iff _ _ + · rw [g.represent_new c hc] + change P.le (g.overlap.toFun ⟨b, hb⟩).val (g.overlap.toFun (cut Q g.rightAnchor c)).val ↔ _ + change (idealOrder P g.leftAnchor).le (g.overlap.toFun ⟨b, hb⟩) + (g.overlap.toFun (cut Q g.rightAnchor c)) ↔ _ + rw [g.overlap.le_iff] + exact ⟨fun h => Q.trans h (Q.meet_le_left _ _), fun h => Q.le_meet h hb⟩ + · rw [g.represent_new b hb] + by_cases hc : Q.le c g.rightAnchor + · rw [g.represent_old c hc] + exact ⟨False.elim, fun h => hb (Q.trans h hc)⟩ + · rw [g.represent_new c hc] + exact ⟨fun h => h.elim id False.elim, Or.inl⟩ + +theorem old_below_represent (a : A) (b : B) : + g.order.le (.inl a) (g.represent b) ↔ P.le a (g.shadow b) := by + classical + by_cases h : Q.le b g.rightAnchor + · rw [g.represent_old b h] + unfold shadow + rw [cut_of_le Q g.rightAnchor b h] + exact Iff.rfl + · rw [g.represent_new b h] + exact Iff.rfl + +theorem represented_meet (b c : B) : + IsMeet g.data (g.represent b) (g.represent c) (g.represent (Q.meet b c)) := by + refine ⟨(g.represent_le_iff _ _).mpr (Q.meet_le_left _ _), + (g.represent_le_iff _ _).mpr (Q.meet_le_right _ _), ?_⟩ + intro x hx hy + cases x with + | inl a => + apply (g.old_below_represent a _).mpr + rw [g.shadow_meet] + exact P.le_meet ((g.old_below_represent a b).mp hx) ((g.old_below_represent a c).mp hy) + | inr x => + have represented : g.represent x.val = Sum.inr x := g.represent_new x.val x.property + rw [← represented] at hx hy ⊢ + exact (g.represent_le_iff _ _).mpr + (Q.le_meet ((g.represent_le_iff _ _).mp hx) ((g.represent_le_iff _ _).mp hy)) + +noncomputable def right : MeetEmbedding Q g.order where + toFun := g.represent + le_iff := g.represent_le_iff + map_meet b c := (meet_eq g.data g.component_meets (g.represented_meet b c)).symm + +theorem cover (x : g.Node) : (∃ a, g.left.toFun a = x) ∨ (∃ b, g.right.toFun b = x) := by + cases x with + | inl a => exact Or.inl ⟨a, rfl⟩ + | inr b => exact Or.inr ⟨b.val, g.represent_new b.val b.property⟩ + +theorem left_ideal (a : A) (x : g.Node) (h : g.order.le x (g.left.toFun a)) : + ∃ b, g.left.toFun b = x := by + cases x with + | inl b => exact ⟨b, rfl⟩ + | inr x => exact False.elim h + +theorem overlap_exact (a : A) (b : B) : + g.right.toFun b = g.left.toFun a ↔ + ∃ h : Q.le b g.rightAnchor, (g.overlap.toFun ⟨b, h⟩).val = a := by + classical + change g.represent b = Sum.inl a ↔ _ + by_cases h : Q.le b g.rightAnchor + · rw [g.represent_old b h] + constructor + · intro eq + exact ⟨h, Sum.inl.inj eq⟩ + · rintro ⟨_, eq⟩ + exact congrArg Sum.inl eq + · rw [g.represent_new b h] + exact ⟨(fun eq => by cases eq), fun ⟨hb, _⟩ => False.elim (h hb)⟩ + +theorem old_in_right (a : A) : + (∃ b, g.right.toFun b = g.left.toFun a) ↔ P.le a g.leftAnchor := by + constructor + · rintro ⟨b, eq⟩ + rcases (g.overlap_exact a b).mp eq with ⟨hb, val⟩ + exact val ▸ (g.overlap.toFun ⟨b, hb⟩).property + · intro ha + let b := g.overlap.inverse ⟨a, ha⟩ + refine ⟨b.val, (g.overlap_exact a b.val).mpr ⟨b.property, ?_⟩⟩ + exact congrArg Subtype.val (g.overlap.right_inverse ⟨a, ha⟩) + +theorem right_ideal (b : B) (x : g.Node) (h : g.order.le x (g.right.toFun b)) : + ∃ c, g.right.toFun c = x := by + cases x with + | inl a => + apply (g.old_in_right a).mpr + exact P.trans ((g.old_below_represent a b).mp h) (g.shadow_le_anchor b) + | inr x => exact ⟨x.val, g.represent_new x.val x.property⟩ + +theorem cross_meet (a : A) (b : B) : + g.order.meet (g.left.toFun a) (g.right.toFun b) = .inl (P.meet a (g.shadow b)) := by + apply meet_eq g.data g.component_meets + refine ⟨P.meet_le_left _ _, (g.old_below_represent _ b).mpr (P.meet_le_right _ _), ?_⟩ + intro x hx hy + rcases g.left_ideal a x hx with ⟨c, rfl⟩ + exact P.le_meet hx ((g.old_below_represent c b).mp hy) + +theorem new_shadow_meet (b : g.Fresh) (a : A) : + g.order.meet (.inr b) (.inl a) = .inl (P.meet (g.shadow b.val) a) := + meet_eq g.data g.component_meets (Attachment.shadow_meet g.data b a (fun h => h)) + +theorem principal_cross_meet (a : A) (b : B) : + g.order.meet (g.left.toFun a) (g.right.toFun b) = + g.left.toFun (P.meet (P.meet a g.leftAnchor) (g.shadow b)) := by + rw [g.cross_meet] + apply congrArg Sum.inl + apply P.antisymm + · exact P.le_meet + (P.le_meet (P.meet_le_left _ _) + (P.trans (P.meet_le_right _ _) (g.shadow_le_anchor b))) + (P.meet_le_right _ _) + · exact P.le_meet + (P.trans (P.meet_le_left _ _) (P.meet_le_left _ _)) (P.meet_le_right _ _) + +theorem greatest_old_part (b : B) : + ∀ a, g.order.le (g.left.toFun a) (g.right.toFun b) ↔ P.le a (g.shadow b) := + fun a => g.old_below_represent a b + +theorem left_principal (top : A) (greatest : ∀ a, P.le a top) (x : g.Node) : + g.order.le x (g.left.toFun top) ↔ ∃ a, g.left.toFun a = x := by + constructor + · exact g.left_ideal top x + · rintro ⟨a, rfl⟩ + exact (g.left.le_iff _ _).mpr (greatest a) + +theorem right_principal (top : B) (greatest : ∀ b, Q.le b top) (x : g.Node) : + g.order.le x (g.right.toFun top) ↔ ∃ b, g.right.toFun b = x := by + constructor + · exact g.right_ideal top x + · rintro ⟨b, rfl⟩ + exact (g.right.le_iff _ _).mpr (greatest b) + +theorem least_preserved (zero : A) (least : ∀ a, P.le zero a) : + ∀ x, g.order.le (g.left.toFun zero) x := by + intro x + cases x with + | inl a => exact least a + | inr b => exact least (g.shadow b.val) + +theorem bottoms_agree (zeroA : A) (zeroB : B) + (leastA : ∀ a, P.le zeroA a) (leastB : ∀ b, Q.le zeroB b) : + g.right.toFun zeroB = g.left.toFun zeroA := by + have lower := g.least_preserved zeroA leastA (g.right.toFun zeroB) + rcases g.right_ideal zeroB (g.left.toFun zeroA) lower with ⟨b, eq⟩ + apply g.order.antisymm + · rw [← eq] + exact (g.right.le_iff _ _).mpr (leastB b) + · exact lower + +theorem comparison_in_vertex (x y : g.Node) (lower : g.order.le x y) : + (∃ a b, g.left.toFun a = x ∧ g.left.toFun b = y ∧ P.le a b) ∨ + (∃ a b, g.right.toFun a = x ∧ g.right.toFun b = y ∧ Q.le a b) := by + rcases g.cover y with ⟨b, rfl⟩ | ⟨b, rfl⟩ + · rcases g.left_ideal b x lower with ⟨a, rfl⟩ + exact Or.inl ⟨a, b, rfl, rfl, (g.left.le_iff _ _).mp lower⟩ + · rcases g.right_ideal b x lower with ⟨a, rfl⟩ + exact Or.inr ⟨a, b, rfl, rfl, (g.right.le_iff _ _).mp lower⟩ + +end Input + +end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation + + + +namespace PartitionPilot.Compression.RecursiveMaps.BinaryTiles + +open Attachment PrincipalAmalgamation + +universe u + +variable {A : Type u} (P : MeetOrder A) + +noncomputable def vertex (g : Input P P) : Bool → MeetEmbedding P g.order + | false => g.left + | true => g.right + +theorem vertex_cover (g : Input P P) (x : g.Node) : + ∃ i y, (vertex P g i).toFun y = x := by + rcases g.cover x with ⟨y, eq⟩ | ⟨y, eq⟩ + · exact ⟨false, y, eq⟩ + · exact ⟨true, y, eq⟩ + +def separation (W : A) : Input P P where + leftAnchor := W + rightAnchor := W + overlap := + { toFun := id + le_iff := fun _ _ => Iff.rfl + map_meet := fun _ _ => rfl + inverse := id + left_inverse := fun _ => rfl + right_inverse := fun _ => rfl } + +theorem separation_fixes (W x : A) (below : P.le x W) : + (separation P W).right.toFun x = (separation P W).left.toFun x := + (separation P W).represent_old x below + +theorem separation_intersection (W x : A) : + (∃ y, (separation P W).right.toFun y = (separation P W).left.toFun x) ↔ P.le x W := + (separation P W).old_in_right x + +theorem separation_cross_meet (W D X : A) (belowD : P.le W D) (belowX : P.le W X) : + (separation P W).order.meet ((separation P W).right.toFun D) + ((separation P W).left.toFun X) = (separation P W).left.toFun W := by + rw [meet_comm, (separation P W).cross_meet] + change Sum.inl (P.meet X (P.meet D W)) = Sum.inl W + have dw : P.meet D W = W := + P.antisymm (P.meet_le_right _ _) (P.le_meet belowD (P.refl W)) + have xw : P.meet X W = W := + P.antisymm (P.meet_le_right _ _) (P.le_meet belowX (P.refl W)) + rw [dw, xw] + +def compression (T K : A) (top : ∀ x, P.le x T) (S : MeetIso P (idealOrder P K)) : + Input P P where + leftAnchor := K + rightAnchor := T + overlap := + { toFun := fun x => S.toFun x.val + le_iff := fun x y => S.le_iff x.val y.val + map_meet := fun x y => S.map_meet x.val y.val + inverse := fun y => ⟨S.inverse y, top _⟩ + left_inverse := fun x => Subtype.ext (S.left_inverse x.val) + right_inverse := fun y => S.right_inverse y } + +theorem compression_identification (T K : A) (top : ∀ x, P.le x T) + (S : MeetIso P (idealOrder P K)) (x : A) : + (compression P T K top S).right.toFun x = + (compression P T K top S).left.toFun (S.toFun x).val := + (compression P T K top S).represent_old x (top x) + +theorem compression_no_new_nodes (T K : A) (top : ∀ x, P.le x T) + (S : MeetIso P (idealOrder P K)) (x : (compression P T K top S).Node) : + ∃ a, (compression P T K top S).left.toFun a = x := by + cases x with + | inl a => exact ⟨a, rfl⟩ + | inr b => exact False.elim (b.property (top b.val)) + +theorem compression_top (T K : A) (top : ∀ x, P.le x T) + (S : MeetIso P (idealOrder P K)) : + (compression P T K top S).right.toFun T = + (compression P T K top S).left.toFun K := by + rw [compression_identification] + apply congrArg (compression P T K top S).left.toFun + apply P.antisymm (S.toFun T).property + have bound := (S.le_iff (S.inverse ⟨K, P.refl K⟩) T).mpr (top _) + rw [S.right_inverse] at bound + exact bound + +end PartitionPilot.Compression.RecursiveMaps.BinaryTiles + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CheckCertificates.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CheckCertificates.lean index fb6da76673f51495fd21c808ec37d4a1882029b5..e76567a8e0f811b9c2257ec859dfce185b88787f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CheckCertificates.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CheckCertificates.lean @@ -1,67 +1,67 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RawCheckFormulas - -namespace OAI - - -namespace PartitionPilot.Forcing.SetFormula - -def checkStateFormula : SetFormula 3 := - ex (ex (.conj (orderedPairFormula 2 1 0) (checkStepFormula 4 3 1 0))) - -def checkCertificateFormula : SetFormula 2 := postfixedFormula checkStateFormula - -def uniformCheckFormula : SetFormula 3 := - ex (.conj (binaryApplication checkCertificateFormula Fin.elim0 0 3) (pairMembershipFormula 1 2 0)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_checkState - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (top z R : ZFSet.{u}) (htop : top ∈ M.sets) (hz : z ∈ M.sets) (hr : R ∈ M.sets) : - Realize M.sets checkStateFormula (extend z (extend R (extend top Fin.elim0))) ↔ - ∃ x ∈ M.sets, ∃ y ∈ M.sets, z = ZFSet.pair x y ∧ M.RawCheckStep top R x y := by - rw [checkStateFormula, realize_ex] - apply exists_congr - intro x - apply and_congr_right - intro hx - rw [realize_ex] - apply exists_congr - intro y - apply and_congr_right - intro hy - let e := extend y (extend x (extend z (extend R (extend top Fin.elim0)))) - change (Realize M.sets _ e ∧ Realize M.sets _ e) ↔ _ - rw [M.realize_orderedPairFormula pairing 2 1 0 e hz hx hy, - M.realize_checkStepFormula pairing 4 3 1 0 e htop hr hx hy] - rfl - -theorem checkCertificate_sound {P : Type u} (s : Presentation P) (one : P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (hone : s.encode one ∈ M.sets) - {R : ZFSet.{u}} (hr : R ∈ M.sets) - (certificate : Realize M.sets checkCertificateFormula (extend R (extend (s.encode one) Fin.elim0))) : - ∀ x ∈ M.sets, ∀ y ∈ M.sets, ZFSet.pair x y ∈ R → y = (Name.check s one x).val := by - have post : ∀ x ∈ M.sets, ∀ y ∈ M.sets, ZFSet.pair x y ∈ R → - M.RawCheckStep (s.encode one) R x y := by - intro x _ y _ rel - have step := (realize_imp M.sets _ _ _).1 (certificate _ (M.transitive hr rel)) rel - obtain ⟨v, _, w, _, eq, raw⟩ := (M.realize_checkState pairing (s.encode one) _ R - hone (M.transitive hr rel) hr).1 step - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact raw - intro x - induction x using ZFSet.inductionOn with - | h x ih => - intro hx y hy rel - exact M.rawCheckStep_eq s one (post x hx y hy rel) - (fun v hv w hw relation => ih v hv (M.transitive hx hv) w hw relation) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RawCheckFormulas + +namespace OAI + + +namespace PartitionPilot.Forcing.SetFormula + +def checkStateFormula : SetFormula 3 := + ex (ex (.conj (orderedPairFormula 2 1 0) (checkStepFormula 4 3 1 0))) + +def checkCertificateFormula : SetFormula 2 := postfixedFormula checkStateFormula + +def uniformCheckFormula : SetFormula 3 := + ex (.conj (binaryApplication checkCertificateFormula Fin.elim0 0 3) (pairMembershipFormula 1 2 0)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_checkState + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (top z R : ZFSet.{u}) (htop : top ∈ M.sets) (hz : z ∈ M.sets) (hr : R ∈ M.sets) : + Realize M.sets checkStateFormula (extend z (extend R (extend top Fin.elim0))) ↔ + ∃ x ∈ M.sets, ∃ y ∈ M.sets, z = ZFSet.pair x y ∧ M.RawCheckStep top R x y := by + rw [checkStateFormula, realize_ex] + apply exists_congr + intro x + apply and_congr_right + intro hx + rw [realize_ex] + apply exists_congr + intro y + apply and_congr_right + intro hy + let e := extend y (extend x (extend z (extend R (extend top Fin.elim0)))) + change (Realize M.sets _ e ∧ Realize M.sets _ e) ↔ _ + rw [M.realize_orderedPairFormula pairing 2 1 0 e hz hx hy, + M.realize_checkStepFormula pairing 4 3 1 0 e htop hr hx hy] + rfl + +theorem checkCertificate_sound {P : Type u} (s : Presentation P) (one : P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (hone : s.encode one ∈ M.sets) + {R : ZFSet.{u}} (hr : R ∈ M.sets) + (certificate : Realize M.sets checkCertificateFormula (extend R (extend (s.encode one) Fin.elim0))) : + ∀ x ∈ M.sets, ∀ y ∈ M.sets, ZFSet.pair x y ∈ R → y = (Name.check s one x).val := by + have post : ∀ x ∈ M.sets, ∀ y ∈ M.sets, ZFSet.pair x y ∈ R → + M.RawCheckStep (s.encode one) R x y := by + intro x _ y _ rel + have step := (realize_imp M.sets _ _ _).1 (certificate _ (M.transitive hr rel)) rel + obtain ⟨v, _, w, _, eq, raw⟩ := (M.realize_checkState pairing (s.encode one) _ R + hone (M.transitive hr rel) hr).1 step + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact raw + intro x + induction x using ZFSet.inductionOn with + | h x ih => + intro hx y hy rel + exact M.rawCheckStep_eq s one (post x hx y hy rel) + (fun v hv w hw relation => ih v hv (M.transitive hx hv) w hw relation) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompatibleCopies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompatibleCopies.lean index 173b2654063e516fcb4191472cba727bb8a458df..1d5a11b6cfdc6d43bbb87e27e984a9235957b3c9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompatibleCopies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompatibleCopies.lean @@ -1,158 +1,158 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.AmalgamationCoinitiality - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.CompatibleCopies - -universe u v - -structure Data {A : Type u} (P : MeetOrder A) (I : Type v) where - top : A - greatest : ∀ x, P.le x top - anchor : I → I → A - change : I → I → MeetIso P P - self_anchor : ∀ i, anchor i i = top - self_change : ∀ i x, (change i i).toFun x = x - reverse : ∀ i j x, (change j i).toFun ((change i j).toFun x) = x - anchor_change : ∀ i j, (change i j).toFun (anchor i j) = anchor j i - triangle_domain : ∀ i j k, i ≠ j → j ≠ k → i ≠ k → ∀ x, P.le x (anchor i j) → - (P.le ((change i j).toFun x) (anchor j k) ↔ P.le x (anchor i k)) - triangle_change : ∀ i j k, i ≠ j → j ≠ k → i ≠ k → ∀ x, - P.le x (anchor i j) → P.le x (anchor i k) → - (change j k).toFun ((change i j).toFun x) = (change i k).toFun x - -namespace Data - -variable {A : Type u} {I : Type v} {P : MeetOrder A} (d : Data P I) - -theorem change_anchor_bound (i j : I) (x : A) (h : P.le x (d.anchor i j)) : - P.le ((d.change i j).toFun x) (d.anchor j i) := by - rw [← d.anchor_change i j] - exact ((d.change i j).le_iff _ _).mpr h - -theorem domain (i j k : I) (x : A) (h : P.le x (d.anchor i j)) : - P.le ((d.change i j).toFun x) (d.anchor j k) ↔ P.le x (d.anchor i k) := by - classical - by_cases ij : i = j - · subst j - rw [d.self_change] - · by_cases jk : j = k - · subst k - rw [d.self_anchor] - exact ⟨fun _ => h, fun _ => d.greatest _⟩ - · by_cases ik : i = k - · subst k - rw [d.self_anchor] - exact ⟨fun _ => d.greatest _, fun _ => d.change_anchor_bound i j x h⟩ - · exact d.triangle_domain i j k ij jk ik x h - -theorem cocycle (i j k : I) (x : A) - (hij : P.le x (d.anchor i j)) (hik : P.le x (d.anchor i k)) : - (d.change j k).toFun ((d.change i j).toFun x) = (d.change i k).toFun x := by - classical - by_cases ij : i = j - · subst j - rw [d.self_change] - · by_cases jk : j = k - · subst k - rw [d.self_change] - · by_cases ik : i = k - · subst k - rw [d.reverse, d.self_change] - · exact d.triangle_change i j k ij jk ik x hij hik - -def Label (_d : Data P I) := I × A - -def Related (x y : d.Label) : Prop := - P.le x.2 (d.anchor x.1 y.1) ∧ (d.change x.1 y.1).toFun x.2 = y.2 - -theorem related_refl (x : d.Label) : d.Related x x := by - constructor - · rw [d.self_anchor] - exact d.greatest _ - · exact d.self_change _ _ - -theorem related_symm {x y : d.Label} (h : d.Related x y) : d.Related y x := by - constructor - · rw [← h.2] - exact d.change_anchor_bound _ _ _ h.1 - · rw [← h.2, d.reverse] - -theorem related_trans {x y z : d.Label} (hxy : d.Related x y) (hyz : d.Related y z) : - d.Related x z := by - have changed : P.le ((d.change x.1 y.1).toFun x.2) (d.anchor y.1 z.1) := by - rw [hxy.2] - exact hyz.1 - have hxz := (d.domain x.1 y.1 z.1 x.2 hxy.1).mp changed - refine ⟨hxz, ?_⟩ - rw [← d.cocycle x.1 y.1 z.1 x.2 hxy.1 hxz, hxy.2] - exact hyz.2 - -def setoid : Setoid d.Label where - r := d.Related - iseqv := ⟨d.related_refl, d.related_symm, d.related_trans⟩ - -def Le (x y : d.Label) : Prop := - P.le x.2 (d.anchor x.1 y.1) ∧ P.le ((d.change x.1 y.1).toFun x.2) y.2 - -theorem le_refl (x : d.Label) : d.Le x x := - ⟨(d.related_refl x).1, (d.self_change _ _).symm ▸ P.refl x.2⟩ - -theorem related_le {x y : d.Label} (h : d.Related x y) : d.Le x y := - ⟨h.1, h.2.symm ▸ P.refl y.2⟩ - -theorem le_trans {x y z : d.Label} (hxy : d.Le x y) (hyz : d.Le y z) : d.Le x z := by - have changed := P.trans hxy.2 hyz.1 - have hxz := (d.domain x.1 y.1 z.1 x.2 hxy.1).mp changed - refine ⟨hxz, ?_⟩ - rw [← d.cocycle x.1 y.1 z.1 x.2 hxy.1 hxz] - exact P.trans (((d.change y.1 z.1).le_iff _ _).mpr hxy.2) hyz.2 - -theorem le_antisymm_related {x y : d.Label} (hxy : d.Le x y) (hyx : d.Le y x) : - d.Related x y := by - refine ⟨hxy.1, P.antisymm hxy.2 ?_⟩ - have lower := ((d.change x.1 y.1).le_iff _ _).mpr hyx.2 - rw [d.reverse] at lower - exact lower - -theorem same_vertex_le (i : I) (x y : A) : d.Le (i, x) (i, y) ↔ P.le x y := by - constructor - · intro h - simpa only [d.self_change] using h.2 - · intro h - exact ⟨(d.self_anchor i).symm ▸ d.greatest x, (d.self_change i x).symm ▸ h⟩ - -def part (i j : I) (y : A) : A := (d.change j i).toFun (P.meet y (d.anchor j i)) - -theorem part_anchor (i j : I) (y : A) : P.le (d.part i j y) (d.anchor i j) := - d.change_anchor_bound j i _ (P.meet_le_right _ _) - -theorem part_below (i j : I) (y : A) : d.Le (i, d.part i j y) (j, y) := by - refine ⟨d.part_anchor i j y, ?_⟩ - change P.le ((d.change i j).toFun ((d.change j i).toFun _)) y - rw [d.reverse] - exact P.meet_le_left _ _ - -theorem below_iff_part (i j : I) (x y : A) : d.Le (i, x) (j, y) ↔ P.le x (d.part i j y) := by - constructor - · intro h - have lower := ((d.change j i).le_iff _ _).mpr - (P.le_meet h.2 (d.change_anchor_bound i j x h.1)) - rw [d.reverse] at lower - exact lower - · intro h - exact d.le_trans ((d.same_vertex_le i _ _).mpr h) (d.part_below i j y) - -theorem move_to_upper_vertex {x y : d.Label} (lower : d.Le x y) : - d.Related x (y.1, (d.change x.1 y.1).toFun x.2) ∧ - P.le ((d.change x.1 y.1).toFun x.2) y.2 := - ⟨⟨lower.1, rfl⟩, lower.2⟩ - -end Data -end PartitionPilot.Compression.RecursiveMaps.CompatibleCopies - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.AmalgamationCoinitiality + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.CompatibleCopies + +universe u v + +structure Data {A : Type u} (P : MeetOrder A) (I : Type v) where + top : A + greatest : ∀ x, P.le x top + anchor : I → I → A + change : I → I → MeetIso P P + self_anchor : ∀ i, anchor i i = top + self_change : ∀ i x, (change i i).toFun x = x + reverse : ∀ i j x, (change j i).toFun ((change i j).toFun x) = x + anchor_change : ∀ i j, (change i j).toFun (anchor i j) = anchor j i + triangle_domain : ∀ i j k, i ≠ j → j ≠ k → i ≠ k → ∀ x, P.le x (anchor i j) → + (P.le ((change i j).toFun x) (anchor j k) ↔ P.le x (anchor i k)) + triangle_change : ∀ i j k, i ≠ j → j ≠ k → i ≠ k → ∀ x, + P.le x (anchor i j) → P.le x (anchor i k) → + (change j k).toFun ((change i j).toFun x) = (change i k).toFun x + +namespace Data + +variable {A : Type u} {I : Type v} {P : MeetOrder A} (d : Data P I) + +theorem change_anchor_bound (i j : I) (x : A) (h : P.le x (d.anchor i j)) : + P.le ((d.change i j).toFun x) (d.anchor j i) := by + rw [← d.anchor_change i j] + exact ((d.change i j).le_iff _ _).mpr h + +theorem domain (i j k : I) (x : A) (h : P.le x (d.anchor i j)) : + P.le ((d.change i j).toFun x) (d.anchor j k) ↔ P.le x (d.anchor i k) := by + classical + by_cases ij : i = j + · subst j + rw [d.self_change] + · by_cases jk : j = k + · subst k + rw [d.self_anchor] + exact ⟨fun _ => h, fun _ => d.greatest _⟩ + · by_cases ik : i = k + · subst k + rw [d.self_anchor] + exact ⟨fun _ => d.greatest _, fun _ => d.change_anchor_bound i j x h⟩ + · exact d.triangle_domain i j k ij jk ik x h + +theorem cocycle (i j k : I) (x : A) + (hij : P.le x (d.anchor i j)) (hik : P.le x (d.anchor i k)) : + (d.change j k).toFun ((d.change i j).toFun x) = (d.change i k).toFun x := by + classical + by_cases ij : i = j + · subst j + rw [d.self_change] + · by_cases jk : j = k + · subst k + rw [d.self_change] + · by_cases ik : i = k + · subst k + rw [d.reverse, d.self_change] + · exact d.triangle_change i j k ij jk ik x hij hik + +def Label (_d : Data P I) := I × A + +def Related (x y : d.Label) : Prop := + P.le x.2 (d.anchor x.1 y.1) ∧ (d.change x.1 y.1).toFun x.2 = y.2 + +theorem related_refl (x : d.Label) : d.Related x x := by + constructor + · rw [d.self_anchor] + exact d.greatest _ + · exact d.self_change _ _ + +theorem related_symm {x y : d.Label} (h : d.Related x y) : d.Related y x := by + constructor + · rw [← h.2] + exact d.change_anchor_bound _ _ _ h.1 + · rw [← h.2, d.reverse] + +theorem related_trans {x y z : d.Label} (hxy : d.Related x y) (hyz : d.Related y z) : + d.Related x z := by + have changed : P.le ((d.change x.1 y.1).toFun x.2) (d.anchor y.1 z.1) := by + rw [hxy.2] + exact hyz.1 + have hxz := (d.domain x.1 y.1 z.1 x.2 hxy.1).mp changed + refine ⟨hxz, ?_⟩ + rw [← d.cocycle x.1 y.1 z.1 x.2 hxy.1 hxz, hxy.2] + exact hyz.2 + +def setoid : Setoid d.Label where + r := d.Related + iseqv := ⟨d.related_refl, d.related_symm, d.related_trans⟩ + +def Le (x y : d.Label) : Prop := + P.le x.2 (d.anchor x.1 y.1) ∧ P.le ((d.change x.1 y.1).toFun x.2) y.2 + +theorem le_refl (x : d.Label) : d.Le x x := + ⟨(d.related_refl x).1, (d.self_change _ _).symm ▸ P.refl x.2⟩ + +theorem related_le {x y : d.Label} (h : d.Related x y) : d.Le x y := + ⟨h.1, h.2.symm ▸ P.refl y.2⟩ + +theorem le_trans {x y z : d.Label} (hxy : d.Le x y) (hyz : d.Le y z) : d.Le x z := by + have changed := P.trans hxy.2 hyz.1 + have hxz := (d.domain x.1 y.1 z.1 x.2 hxy.1).mp changed + refine ⟨hxz, ?_⟩ + rw [← d.cocycle x.1 y.1 z.1 x.2 hxy.1 hxz] + exact P.trans (((d.change y.1 z.1).le_iff _ _).mpr hxy.2) hyz.2 + +theorem le_antisymm_related {x y : d.Label} (hxy : d.Le x y) (hyx : d.Le y x) : + d.Related x y := by + refine ⟨hxy.1, P.antisymm hxy.2 ?_⟩ + have lower := ((d.change x.1 y.1).le_iff _ _).mpr hyx.2 + rw [d.reverse] at lower + exact lower + +theorem same_vertex_le (i : I) (x y : A) : d.Le (i, x) (i, y) ↔ P.le x y := by + constructor + · intro h + simpa only [d.self_change] using h.2 + · intro h + exact ⟨(d.self_anchor i).symm ▸ d.greatest x, (d.self_change i x).symm ▸ h⟩ + +def part (i j : I) (y : A) : A := (d.change j i).toFun (P.meet y (d.anchor j i)) + +theorem part_anchor (i j : I) (y : A) : P.le (d.part i j y) (d.anchor i j) := + d.change_anchor_bound j i _ (P.meet_le_right _ _) + +theorem part_below (i j : I) (y : A) : d.Le (i, d.part i j y) (j, y) := by + refine ⟨d.part_anchor i j y, ?_⟩ + change P.le ((d.change i j).toFun ((d.change j i).toFun _)) y + rw [d.reverse] + exact P.meet_le_left _ _ + +theorem below_iff_part (i j : I) (x y : A) : d.Le (i, x) (j, y) ↔ P.le x (d.part i j y) := by + constructor + · intro h + have lower := ((d.change j i).le_iff _ _).mpr + (P.le_meet h.2 (d.change_anchor_bound i j x h.1)) + rw [d.reverse] at lower + exact lower + · intro h + exact d.le_trans ((d.same_vertex_le i _ _).mpr h) (d.part_below i j y) + +theorem move_to_upper_vertex {x y : d.Label} (lower : d.Le x y) : + d.Related x (y.1, (d.change x.1 y.1).toFun x.2) ∧ + P.le ((d.change x.1 y.1).toFun x.2) y.2 := + ⟨⟨lower.1, rfl⟩, lower.2⟩ + +end Data +end PartitionPilot.Compression.RecursiveMaps.CompatibleCopies + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompleteProjectionPredensity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompleteProjectionPredensity.lean index bc1689fb3700937cdea40a3e9f870d17f3c7f52b..9ed534261710ffff0e16acb35687a4419b78cfe8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompleteProjectionPredensity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompleteProjectionPredensity.lean @@ -1,265 +1,265 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.ConditionQuantifiers - -namespace OAI - - -namespace PartitionPilot.Forcing - -section -universe u v -variable {Upper : Type u} {Lower : Type v} [PartialOrder Upper] [PartialOrder Lower] - -structure CompleteProjection (restriction : Upper →o Lower) - (inclusion : Lower ↪o Upper) : Prop where - retract : ∀ q, restriction (inclusion q) = q - le_include_iff : ∀ p q, p ≤ inclusion q ↔ restriction p ≤ q - lift : ∀ p q, q ≤ restriction p → ∃ r, r ≤ p ∧ restriction r = q - -namespace CompleteProjection -variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} -variable (projection : CompleteProjection restriction inclusion) -include projection - -theorem le_include_restriction (p : Upper) : p ≤ inclusion (restriction p) := - (projection.le_include_iff p (restriction p)).2 le_rfl - -theorem compatible_include_iff (p : Upper) (q : Lower) : - Compatible p (inclusion q) ↔ Compatible (restriction p) q := by - constructor - · rintro ⟨r, rp, rq⟩ - exact ⟨restriction r, restriction.monotone rp, (projection.le_include_iff r q).1 rq⟩ - · rintro ⟨q', below, included⟩ - obtain ⟨r, rp, equal⟩ := projection.lift p q' below - refine ⟨r, rp, (projection.le_include_iff r q).2 ?_⟩ - exact equal.symm ▸ included - -theorem included_compatible_iff (p q : Lower) : - Compatible (inclusion p) (inclusion q) ↔ Compatible p q := by - rw [projection.compatible_include_iff, projection.retract] - -theorem dense_preimage {E : Set Lower} (dense : Dense E) : - Dense {p : Upper | restriction p ∈ E} := by - intro p - obtain ⟨q, below, member⟩ := dense (restriction p) - obtain ⟨r, rp, equal⟩ := projection.lift p q below - refine ⟨r, rp, ?_⟩ - change restriction r ∈ E - rw [equal] - exact member - -theorem predense_inclusion {E : Set Lower} - (predense : ∀ q : Lower, ∃ r ∈ E, Compatible q r) : - ∀ p : Upper, ∃ r ∈ E, Compatible p (inclusion r) := by - intro p - obtain ⟨r, member, compatible⟩ := predense (restriction p) - exact ⟨r, member, (projection.compatible_include_iff p r).2 compatible⟩ - -def projectedFilter (H : ConditionFilter Upper) : ConditionFilter Lower where - mem q := H.mem (inclusion q) - nonempty := by - obtain ⟨p, member⟩ := H.nonempty - exact ⟨restriction p, H.upward member (projection.le_include_restriction p)⟩ - upward := by - intro p q member below - exact H.upward member (inclusion.monotone below) - directed := by - intro p q hp hq - obtain ⟨r, member, rp, rq⟩ := H.directed hp hq - exact ⟨restriction r, H.upward member (projection.le_include_restriction r), - (projection.le_include_iff r p).1 rp, (projection.le_include_iff r q).1 rq⟩ - -theorem projectedFilter_mem_iff (H : ConditionFilter Upper) (q : Lower) : - (projection.projectedFilter H).mem q ↔ - ∃ p : Upper, H.mem p ∧ restriction p = q := by - constructor - · intro member - exact ⟨inclusion q, member, projection.retract q⟩ - · rintro ⟨p, member, rfl⟩ - exact H.upward member (projection.le_include_restriction p) - -theorem projectedFilter_meets_iff (H : ConditionFilter Upper) (E : Set Lower) : - (projection.projectedFilter H).Meets E ↔ H.Meets {p : Upper | restriction p ∈ E} := by - constructor - · rintro ⟨q, member, hq⟩ - obtain ⟨p, hp, rfl⟩ := (projection.projectedFilter_mem_iff H q).1 member - exact ⟨p, hp, hq⟩ - · rintro ⟨p, member, hp⟩ - exact ⟨restriction p, (projection.projectedFilter_mem_iff H (restriction p)).2 - ⟨p, member, rfl⟩, hp⟩ - -theorem projectedFilter_generic (H : ConditionFilter Upper) (family : Set (Set Lower)) - (generic : H.GenericFor ((fun E : Set Lower => {p : Upper | restriction p ∈ E}) '' family)) : - (projection.projectedFilter H).GenericFor family := by - intro E member dense - exact (projection.projectedFilter_meets_iff H E).2 - (generic _ ⟨E, member, rfl⟩ (projection.dense_preimage dense)) - -end CompleteProjection -end - - - -namespace CompleteProjection -universe u v -variable {Upper : Type u} {Lower : Type v} [PartialOrder Upper] [PartialOrder Lower] -variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} -variable (projection : CompleteProjection restriction inclusion) -include projection - -theorem denseBelow_preimage_iff (q : Upper) (E : Set Lower) : - DenseBelow q {r | restriction r ∈ E} ↔ DenseBelow (restriction q) E := by - constructor - · intro dense p pq - obtain ⟨r, rq, rp⟩ := projection.lift q p pq - obtain ⟨v, vr, member⟩ := dense r rq - exact ⟨restriction v, (restriction.monotone vr).trans_eq rp, member⟩ - · intro dense r rq - obtain ⟨p, pr, member⟩ := dense (restriction r) (restriction.monotone rq) - obtain ⟨v, vr, vp⟩ := projection.lift r p pr - exact ⟨v, vr, show restriction v ∈ E from vp.symm ▸ member⟩ - -end CompleteProjection - - - -namespace Name -open SetRealization -universe u -variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] -variable (s : Presentation P) (t : Presentation Q) -variable (pi : Q →o P) (inc : P ↪o Q) (projection : CompleteProjection pi inc) -include projection - -theorem forcesEq_rename_completeProjection (q : Q) (σ τ : Name s) : - ForcesEq q (rename t inc σ) (rename t inc τ) ↔ ForcesEq (pi q) σ τ := by - induction σ using inductionOn generalizing τ q with - | step σ ih => - rw [ForcesEq, ForcesEq] - constructor - · rintro ⟨left, right⟩ - constructor - · intro ρ r hr p pq pr - obtain ⟨v, vq, vp⟩ := projection.lift q p pq - have vr : v ≤ inc r := (projection.le_include_iff v r).2 (vp.symm ▸ pr) - have entry := (entry_rename t inc σ (rename t inc ρ) (inc r)).2 ⟨ρ, r, hr, rfl, rfl⟩ - obtain ⟨w, wv, ν, k, hk, wk, eq⟩ := left _ _ entry v vq vr - obtain ⟨ν₀, k₀, old, rfl, rfl⟩ := (entry_rename t inc τ ν k).1 hk - exact ⟨pi w, (pi.monotone wv).trans_eq vp, ν₀, k₀, old, - (projection.le_include_iff w k₀).1 wk, (ih ρ r hr (q := w) (τ := ν₀)).1 eq⟩ - · intro ν k hk p pq pk - obtain ⟨v, vq, vp⟩ := projection.lift q p pq - have vk : v ≤ inc k := (projection.le_include_iff v k).2 (vp.symm ▸ pk) - have entry := (entry_rename t inc τ (rename t inc ν) (inc k)).2 ⟨ν, k, hk, rfl, rfl⟩ - obtain ⟨w, wv, ρ, r, hr, wr, eq⟩ := right _ _ entry v vq vk - obtain ⟨ρ₀, r₀, old, rfl, rfl⟩ := (entry_rename t inc σ ρ r).1 hr - exact ⟨pi w, (pi.monotone wv).trans_eq vp, ρ₀, r₀, old, - (projection.le_include_iff w r₀).1 wr, (ih ρ₀ r₀ old (q := w) (τ := ν)).1 eq⟩ - · rintro ⟨left, right⟩ - constructor - · intro ρ r hr v vq vr - obtain ⟨ρ₀, r₀, old, rfl, rfl⟩ := (entry_rename t inc σ ρ r).1 hr - obtain ⟨p, pv, ν, k, hk, pk, eq⟩ := - left ρ₀ r₀ old (pi v) (pi.monotone vq) ((projection.le_include_iff v r₀).1 vr) - obtain ⟨w, wv, wp⟩ := projection.lift v p pv - refine ⟨w, wv, rename t inc ν, inc k, - (entry_rename t inc τ (rename t inc ν) (inc k)).2 ⟨ν, k, hk, rfl, rfl⟩, - (projection.le_include_iff w k).2 (wp.symm ▸ pk), ?_⟩ - exact (ih ρ₀ r₀ old (q := w) (τ := ν)).2 (wp.symm ▸ eq) - · intro ν k hk v vq vk - obtain ⟨ν₀, k₀, old, rfl, rfl⟩ := (entry_rename t inc τ ν k).1 hk - obtain ⟨p, pv, ρ, r, hr, pr, eq⟩ := - right ν₀ k₀ old (pi v) (pi.monotone vq) ((projection.le_include_iff v k₀).1 vk) - obtain ⟨w, wv, wp⟩ := projection.lift v p pv - refine ⟨w, wv, rename t inc ρ, inc r, - (entry_rename t inc σ (rename t inc ρ) (inc r)).2 ⟨ρ, r, hr, rfl, rfl⟩, - (projection.le_include_iff w r).2 (wp.symm ▸ pr), ?_⟩ - exact (ih ρ r hr (q := w) (τ := ν₀)).2 (wp.symm ▸ eq) - -end Name - - - -namespace Name -open SetRealization -universe u -variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] -variable (s : Presentation P) (t : Presentation Q) -variable (pi : Q →o P) (inc : P ↪o Q) (projection : CompleteProjection pi inc) -include projection - -theorem memWitness_rename_completeProjection (q : Q) (σ τ : Name s) : - q ∈ MemWitness (rename t inc σ) (rename t inc τ) ↔ pi q ∈ MemWitness σ τ := by - constructor - · rintro ⟨ν, r, entry, qr, eq⟩ - obtain ⟨ν₀, r₀, old, rfl, rfl⟩ := (entry_rename t inc τ ν r).1 entry - exact ⟨ν₀, r₀, old, (projection.le_include_iff q r₀).1 qr, - (forcesEq_rename_completeProjection s t pi inc projection q σ ν₀).1 eq⟩ - · rintro ⟨ν, r, entry, qr, eq⟩ - exact ⟨rename t inc ν, inc r, - (entry_rename t inc τ (rename t inc ν) (inc r)).2 ⟨ν, r, entry, rfl, rfl⟩, - (projection.le_include_iff q r).2 qr, - (forcesEq_rename_completeProjection s t pi inc projection q σ ν).2 eq⟩ - -theorem forcesMem_rename_completeProjection (q : Q) (σ τ : Name s) : - ForcesMem q (rename t inc σ) (rename t inc τ) ↔ ForcesMem (pi q) σ τ := by - have witnesses : MemWitness (rename t inc σ) (rename t inc τ) = - {r : Q | pi r ∈ MemWitness σ τ} := by - apply Set.ext - intro r - exact memWitness_rename_completeProjection s t pi inc projection r σ τ - change DenseBelow q _ ↔ DenseBelow (pi q) _ - rw [witnesses] - exact projection.denseBelow_preimage_iff q (MemWitness σ τ) - -end Name - - - -namespace CompleteProjection -open SetRealization -universe u -variable {Upper Lower : Type u} [PartialOrder Upper] [PartialOrder Lower] -variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} -variable (projection : CompleteProjection restriction inclusion) -include projection - -theorem predense_inclusion_iff {E : Set Lower} : - (∀ p : Upper, ∃ r ∈ E, Compatible p (inclusion r)) ↔ - (∀ q : Lower, ∃ r ∈ E, Compatible q r) := by - constructor - · intro predense q - obtain ⟨r, member, common⟩ := predense (inclusion q) - exact ⟨r, member, (projection.included_compatible_iff q r).1 common⟩ - · exact projection.predense_inclusion - -theorem raw_predense_restriction (s : Presentation Upper) (t : Presentation Lower) - (unchanged : ∀ q, s.encode (inclusion q) = t.encode q) - {A : ZFSet.{u}} (within : A ⊆ t.carrier) - (predense : ∀ q ∈ s.carrier, ∃ p ∈ A, ∃ r ∈ s.carrier, - ZFSet.pair r q ∈ s.conditionOrder ∧ ZFSet.pair r p ∈ s.conditionOrder) : - ∀ q ∈ t.carrier, ∃ p ∈ A, ∃ r ∈ t.carrier, - ZFSet.pair r q ∈ t.conditionOrder ∧ ZFSet.pair r p ∈ t.conditionOrder := by - have upper : ∀ p : Upper, ∃ q, t.encode q ∈ A ∧ Compatible p (inclusion q) := by - intro p - obtain ⟨x, hx, z, hz, zp, zx⟩ := predense (s.encode p) (s.encode_mem p) - obtain ⟨q, qCode⟩ := (t.mem_carrier x).1 (within hx) - obtain ⟨r, rCode⟩ := (s.mem_carrier z).1 hz - refine ⟨q, qCode.symm ▸ hx, r, ?_, ?_⟩ - · apply (s.pair_mem_conditionOrder r p).1 - rwa [rCode] - · apply (s.pair_mem_conditionOrder r (inclusion q)).1 - rwa [rCode, unchanged q, qCode] - have lower := (projection.predense_inclusion_iff (E := {q | t.encode q ∈ A})).1 upper - intro x hx - obtain ⟨q, qCode⟩ := (t.mem_carrier x).1 hx - obtain ⟨p, hp, r, rq, rp⟩ := lower q - refine ⟨t.encode p, hp, t.encode r, t.encode_mem r, ?_, - (t.pair_mem_conditionOrder r p).2 rp⟩ - rw [← qCode] - exact (t.pair_mem_conditionOrder r q).2 rq - -end CompleteProjection - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.ConditionQuantifiers + +namespace OAI + + +namespace PartitionPilot.Forcing + +section +universe u v +variable {Upper : Type u} {Lower : Type v} [PartialOrder Upper] [PartialOrder Lower] + +structure CompleteProjection (restriction : Upper →o Lower) + (inclusion : Lower ↪o Upper) : Prop where + retract : ∀ q, restriction (inclusion q) = q + le_include_iff : ∀ p q, p ≤ inclusion q ↔ restriction p ≤ q + lift : ∀ p q, q ≤ restriction p → ∃ r, r ≤ p ∧ restriction r = q + +namespace CompleteProjection +variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} +variable (projection : CompleteProjection restriction inclusion) +include projection + +theorem le_include_restriction (p : Upper) : p ≤ inclusion (restriction p) := + (projection.le_include_iff p (restriction p)).2 le_rfl + +theorem compatible_include_iff (p : Upper) (q : Lower) : + Compatible p (inclusion q) ↔ Compatible (restriction p) q := by + constructor + · rintro ⟨r, rp, rq⟩ + exact ⟨restriction r, restriction.monotone rp, (projection.le_include_iff r q).1 rq⟩ + · rintro ⟨q', below, included⟩ + obtain ⟨r, rp, equal⟩ := projection.lift p q' below + refine ⟨r, rp, (projection.le_include_iff r q).2 ?_⟩ + exact equal.symm ▸ included + +theorem included_compatible_iff (p q : Lower) : + Compatible (inclusion p) (inclusion q) ↔ Compatible p q := by + rw [projection.compatible_include_iff, projection.retract] + +theorem dense_preimage {E : Set Lower} (dense : Dense E) : + Dense {p : Upper | restriction p ∈ E} := by + intro p + obtain ⟨q, below, member⟩ := dense (restriction p) + obtain ⟨r, rp, equal⟩ := projection.lift p q below + refine ⟨r, rp, ?_⟩ + change restriction r ∈ E + rw [equal] + exact member + +theorem predense_inclusion {E : Set Lower} + (predense : ∀ q : Lower, ∃ r ∈ E, Compatible q r) : + ∀ p : Upper, ∃ r ∈ E, Compatible p (inclusion r) := by + intro p + obtain ⟨r, member, compatible⟩ := predense (restriction p) + exact ⟨r, member, (projection.compatible_include_iff p r).2 compatible⟩ + +def projectedFilter (H : ConditionFilter Upper) : ConditionFilter Lower where + mem q := H.mem (inclusion q) + nonempty := by + obtain ⟨p, member⟩ := H.nonempty + exact ⟨restriction p, H.upward member (projection.le_include_restriction p)⟩ + upward := by + intro p q member below + exact H.upward member (inclusion.monotone below) + directed := by + intro p q hp hq + obtain ⟨r, member, rp, rq⟩ := H.directed hp hq + exact ⟨restriction r, H.upward member (projection.le_include_restriction r), + (projection.le_include_iff r p).1 rp, (projection.le_include_iff r q).1 rq⟩ + +theorem projectedFilter_mem_iff (H : ConditionFilter Upper) (q : Lower) : + (projection.projectedFilter H).mem q ↔ + ∃ p : Upper, H.mem p ∧ restriction p = q := by + constructor + · intro member + exact ⟨inclusion q, member, projection.retract q⟩ + · rintro ⟨p, member, rfl⟩ + exact H.upward member (projection.le_include_restriction p) + +theorem projectedFilter_meets_iff (H : ConditionFilter Upper) (E : Set Lower) : + (projection.projectedFilter H).Meets E ↔ H.Meets {p : Upper | restriction p ∈ E} := by + constructor + · rintro ⟨q, member, hq⟩ + obtain ⟨p, hp, rfl⟩ := (projection.projectedFilter_mem_iff H q).1 member + exact ⟨p, hp, hq⟩ + · rintro ⟨p, member, hp⟩ + exact ⟨restriction p, (projection.projectedFilter_mem_iff H (restriction p)).2 + ⟨p, member, rfl⟩, hp⟩ + +theorem projectedFilter_generic (H : ConditionFilter Upper) (family : Set (Set Lower)) + (generic : H.GenericFor ((fun E : Set Lower => {p : Upper | restriction p ∈ E}) '' family)) : + (projection.projectedFilter H).GenericFor family := by + intro E member dense + exact (projection.projectedFilter_meets_iff H E).2 + (generic _ ⟨E, member, rfl⟩ (projection.dense_preimage dense)) + +end CompleteProjection +end + + + +namespace CompleteProjection +universe u v +variable {Upper : Type u} {Lower : Type v} [PartialOrder Upper] [PartialOrder Lower] +variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} +variable (projection : CompleteProjection restriction inclusion) +include projection + +theorem denseBelow_preimage_iff (q : Upper) (E : Set Lower) : + DenseBelow q {r | restriction r ∈ E} ↔ DenseBelow (restriction q) E := by + constructor + · intro dense p pq + obtain ⟨r, rq, rp⟩ := projection.lift q p pq + obtain ⟨v, vr, member⟩ := dense r rq + exact ⟨restriction v, (restriction.monotone vr).trans_eq rp, member⟩ + · intro dense r rq + obtain ⟨p, pr, member⟩ := dense (restriction r) (restriction.monotone rq) + obtain ⟨v, vr, vp⟩ := projection.lift r p pr + exact ⟨v, vr, show restriction v ∈ E from vp.symm ▸ member⟩ + +end CompleteProjection + + + +namespace Name +open SetRealization +universe u +variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] +variable (s : Presentation P) (t : Presentation Q) +variable (pi : Q →o P) (inc : P ↪o Q) (projection : CompleteProjection pi inc) +include projection + +theorem forcesEq_rename_completeProjection (q : Q) (σ τ : Name s) : + ForcesEq q (rename t inc σ) (rename t inc τ) ↔ ForcesEq (pi q) σ τ := by + induction σ using inductionOn generalizing τ q with + | step σ ih => + rw [ForcesEq, ForcesEq] + constructor + · rintro ⟨left, right⟩ + constructor + · intro ρ r hr p pq pr + obtain ⟨v, vq, vp⟩ := projection.lift q p pq + have vr : v ≤ inc r := (projection.le_include_iff v r).2 (vp.symm ▸ pr) + have entry := (entry_rename t inc σ (rename t inc ρ) (inc r)).2 ⟨ρ, r, hr, rfl, rfl⟩ + obtain ⟨w, wv, ν, k, hk, wk, eq⟩ := left _ _ entry v vq vr + obtain ⟨ν₀, k₀, old, rfl, rfl⟩ := (entry_rename t inc τ ν k).1 hk + exact ⟨pi w, (pi.monotone wv).trans_eq vp, ν₀, k₀, old, + (projection.le_include_iff w k₀).1 wk, (ih ρ r hr (q := w) (τ := ν₀)).1 eq⟩ + · intro ν k hk p pq pk + obtain ⟨v, vq, vp⟩ := projection.lift q p pq + have vk : v ≤ inc k := (projection.le_include_iff v k).2 (vp.symm ▸ pk) + have entry := (entry_rename t inc τ (rename t inc ν) (inc k)).2 ⟨ν, k, hk, rfl, rfl⟩ + obtain ⟨w, wv, ρ, r, hr, wr, eq⟩ := right _ _ entry v vq vk + obtain ⟨ρ₀, r₀, old, rfl, rfl⟩ := (entry_rename t inc σ ρ r).1 hr + exact ⟨pi w, (pi.monotone wv).trans_eq vp, ρ₀, r₀, old, + (projection.le_include_iff w r₀).1 wr, (ih ρ₀ r₀ old (q := w) (τ := ν)).1 eq⟩ + · rintro ⟨left, right⟩ + constructor + · intro ρ r hr v vq vr + obtain ⟨ρ₀, r₀, old, rfl, rfl⟩ := (entry_rename t inc σ ρ r).1 hr + obtain ⟨p, pv, ν, k, hk, pk, eq⟩ := + left ρ₀ r₀ old (pi v) (pi.monotone vq) ((projection.le_include_iff v r₀).1 vr) + obtain ⟨w, wv, wp⟩ := projection.lift v p pv + refine ⟨w, wv, rename t inc ν, inc k, + (entry_rename t inc τ (rename t inc ν) (inc k)).2 ⟨ν, k, hk, rfl, rfl⟩, + (projection.le_include_iff w k).2 (wp.symm ▸ pk), ?_⟩ + exact (ih ρ₀ r₀ old (q := w) (τ := ν)).2 (wp.symm ▸ eq) + · intro ν k hk v vq vk + obtain ⟨ν₀, k₀, old, rfl, rfl⟩ := (entry_rename t inc τ ν k).1 hk + obtain ⟨p, pv, ρ, r, hr, pr, eq⟩ := + right ν₀ k₀ old (pi v) (pi.monotone vq) ((projection.le_include_iff v k₀).1 vk) + obtain ⟨w, wv, wp⟩ := projection.lift v p pv + refine ⟨w, wv, rename t inc ρ, inc r, + (entry_rename t inc σ (rename t inc ρ) (inc r)).2 ⟨ρ, r, hr, rfl, rfl⟩, + (projection.le_include_iff w r).2 (wp.symm ▸ pr), ?_⟩ + exact (ih ρ r hr (q := w) (τ := ν₀)).2 (wp.symm ▸ eq) + +end Name + + + +namespace Name +open SetRealization +universe u +variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] +variable (s : Presentation P) (t : Presentation Q) +variable (pi : Q →o P) (inc : P ↪o Q) (projection : CompleteProjection pi inc) +include projection + +theorem memWitness_rename_completeProjection (q : Q) (σ τ : Name s) : + q ∈ MemWitness (rename t inc σ) (rename t inc τ) ↔ pi q ∈ MemWitness σ τ := by + constructor + · rintro ⟨ν, r, entry, qr, eq⟩ + obtain ⟨ν₀, r₀, old, rfl, rfl⟩ := (entry_rename t inc τ ν r).1 entry + exact ⟨ν₀, r₀, old, (projection.le_include_iff q r₀).1 qr, + (forcesEq_rename_completeProjection s t pi inc projection q σ ν₀).1 eq⟩ + · rintro ⟨ν, r, entry, qr, eq⟩ + exact ⟨rename t inc ν, inc r, + (entry_rename t inc τ (rename t inc ν) (inc r)).2 ⟨ν, r, entry, rfl, rfl⟩, + (projection.le_include_iff q r).2 qr, + (forcesEq_rename_completeProjection s t pi inc projection q σ ν).2 eq⟩ + +theorem forcesMem_rename_completeProjection (q : Q) (σ τ : Name s) : + ForcesMem q (rename t inc σ) (rename t inc τ) ↔ ForcesMem (pi q) σ τ := by + have witnesses : MemWitness (rename t inc σ) (rename t inc τ) = + {r : Q | pi r ∈ MemWitness σ τ} := by + apply Set.ext + intro r + exact memWitness_rename_completeProjection s t pi inc projection r σ τ + change DenseBelow q _ ↔ DenseBelow (pi q) _ + rw [witnesses] + exact projection.denseBelow_preimage_iff q (MemWitness σ τ) + +end Name + + + +namespace CompleteProjection +open SetRealization +universe u +variable {Upper Lower : Type u} [PartialOrder Upper] [PartialOrder Lower] +variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} +variable (projection : CompleteProjection restriction inclusion) +include projection + +theorem predense_inclusion_iff {E : Set Lower} : + (∀ p : Upper, ∃ r ∈ E, Compatible p (inclusion r)) ↔ + (∀ q : Lower, ∃ r ∈ E, Compatible q r) := by + constructor + · intro predense q + obtain ⟨r, member, common⟩ := predense (inclusion q) + exact ⟨r, member, (projection.included_compatible_iff q r).1 common⟩ + · exact projection.predense_inclusion + +theorem raw_predense_restriction (s : Presentation Upper) (t : Presentation Lower) + (unchanged : ∀ q, s.encode (inclusion q) = t.encode q) + {A : ZFSet.{u}} (within : A ⊆ t.carrier) + (predense : ∀ q ∈ s.carrier, ∃ p ∈ A, ∃ r ∈ s.carrier, + ZFSet.pair r q ∈ s.conditionOrder ∧ ZFSet.pair r p ∈ s.conditionOrder) : + ∀ q ∈ t.carrier, ∃ p ∈ A, ∃ r ∈ t.carrier, + ZFSet.pair r q ∈ t.conditionOrder ∧ ZFSet.pair r p ∈ t.conditionOrder := by + have upper : ∀ p : Upper, ∃ q, t.encode q ∈ A ∧ Compatible p (inclusion q) := by + intro p + obtain ⟨x, hx, z, hz, zp, zx⟩ := predense (s.encode p) (s.encode_mem p) + obtain ⟨q, qCode⟩ := (t.mem_carrier x).1 (within hx) + obtain ⟨r, rCode⟩ := (s.mem_carrier z).1 hz + refine ⟨q, qCode.symm ▸ hx, r, ?_, ?_⟩ + · apply (s.pair_mem_conditionOrder r p).1 + rwa [rCode] + · apply (s.pair_mem_conditionOrder r (inclusion q)).1 + rwa [rCode, unchanged q, qCode] + have lower := (projection.predense_inclusion_iff (E := {q | t.encode q ∈ A})).1 upper + intro x hx + obtain ⟨q, qCode⟩ := (t.mem_carrier x).1 hx + obtain ⟨p, hp, r, rq, rp⟩ := lower q + refine ⟨t.encode p, hp, t.encode r, t.encode_mem r, ?_, + (t.pair_mem_conditionOrder r p).2 rp⟩ + rw [← qCode] + exact (t.pair_mem_conditionOrder r q).2 rq + +end CompleteProjection + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/Compression.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/Compression.lean index 330a5232efd9570087510b38b1ffd63ec4e7930a..115d5ec65fd0e4b1ca506ca0395f04dbe9da48cf 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/Compression.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/Compression.lean @@ -1,1337 +1,1337 @@ -import Init - -namespace OAI - - -namespace PartitionPilot - -section - -universe u v - -structure MeetOrder (α : Type u) where - le : α → α → Prop - meet : α → α → α - refl : ∀ a, le a a - trans : ∀ {a b c}, le a b → le b c → le a c - antisymm : ∀ {a b}, le a b → le b a → a = b - meet_le_left : ∀ a b, le (meet a b) a - meet_le_right : ∀ a b, le (meet a b) b - le_meet : ∀ {a b c}, le a b → le a c → le a (meet b c) - -theorem meet_comm {α : Type u} (P : MeetOrder α) (a b : α) : - P.meet a b = P.meet b a := by - apply P.antisymm - · exact P.le_meet (P.meet_le_right a b) (P.meet_le_left a b) - · exact P.le_meet (P.meet_le_right b a) (P.meet_le_left b a) - -structure MeetEmbedding {α : Type u} {β : Type v} - (P : MeetOrder α) (Q : MeetOrder β) where - toFun : α → β - le_iff : ∀ a b, Q.le (toFun a) (toFun b) ↔ P.le a b - map_meet : ∀ a b, toFun (P.meet a b) = Q.meet (toFun a) (toFun b) - -def Positive {α : Type u} (P : MeetOrder α) (F : α → Prop) (x : α) : Prop := - ∃ f, F f ∧ P.le f x - -def Profile {α : Type u} (P : MeetOrder α) (c e K : α) (F : α → Prop) : Prop := - ∀ x, P.le e x → - (Positive P F x → P.le K x) ∧ - (¬ Positive P F x → P.meet K x = c) - -def PositiveOver {α : Type u} {β : Type v} - {P : MeetOrder α} {Q : MeetOrder β} - (i : MeetEmbedding P Q) (F : α → Prop) (x : β) : Prop := - ∃ f, F f ∧ Q.le (i.toFun f) x - -def ProfileOver {α : Type u} {β : Type v} - {P : MeetOrder α} {Q : MeetOrder β} - (i : MeetEmbedding P Q) (c e K : α) (F : α → Prop) : Prop := - ∀ x, Q.le (i.toFun e) x → - (PositiveOver i F x → Q.le (i.toFun K) x) ∧ - (¬ PositiveOver i F x → Q.meet (i.toFun K) x = i.toFun c) - -def HasOldShadow {α : Type u} {β : Type v} - {P : MeetOrder α} {Q : MeetOrder β} - (i : MeetEmbedding P Q) (x : β) : Prop := - ∃ l, - (∀ a, Q.le (i.toFun a) x ↔ P.le a l) ∧ - (∀ a, ¬ Q.le x (i.toFun a) → - Q.meet x (i.toFun a) = i.toFun (P.meet l a)) - -def IsGreatest {β : Type v} (Q : MeetOrder β) (x : β) : Prop := - ∀ y, Q.le y x - -def PermittedExtension {α : Type u} {β : Type v} - {P : MeetOrder α} {Q : MeetOrder β} - (i : MeetEmbedding P Q) : Prop := - ∀ x, (∃ a, i.toFun a = x) ∨ HasOldShadow i x ∨ IsGreatest Q x - -theorem profile_at_shadow {α : Type u} {β : Type v} - {P : MeetOrder α} {Q : MeetOrder β} - (i : MeetEmbedding P Q) (c e K : α) (F : α → Prop) - (old_profile : Profile P c e K F) - (e_not_le_K : ¬ P.le e K) - (x : β) (above_e : Q.le (i.toFun e) x) - (shadow : HasOldShadow i x) : - (PositiveOver i F x → Q.le (i.toFun K) x) ∧ - (¬ PositiveOver i F x → Q.meet (i.toFun K) x = i.toFun c) := by - cases shadow with - | intro l hl => - have part := hl.left - have shadow_meet := hl.right - have e_le_l : P.le e l := (part e).mp above_e - have x_not_le_K : ¬ Q.le x (i.toFun K) := by - intro hx - exact e_not_le_K ((i.le_iff e K).mp (Q.trans above_e hx)) - have positives : PositiveOver i F x ↔ Positive P F l := by - constructor - · intro hp - cases hp with - | intro f hf => exact ⟨f, hf.left, (part f).mp hf.right⟩ - · intro hp - cases hp with - | intro f hf => exact ⟨f, hf.left, (part f).mpr hf.right⟩ - have inherited := old_profile l e_le_l - constructor - · intro hp - exact (part K).mpr (inherited.left (positives.mp hp)) - · intro hn - have hn_old : ¬ Positive P F l := fun hp => hn (positives.mpr hp) - calc - Q.meet (i.toFun K) x = Q.meet x (i.toFun K) := meet_comm Q _ _ - _ = i.toFun (P.meet l K) := shadow_meet K x_not_le_K - _ = i.toFun (P.meet K l) := congrArg i.toFun (meet_comm P l K) - _ = i.toFun c := congrArg i.toFun (inherited.right hn_old) - -theorem profile_persists_one_step {α : Type u} {β : Type v} - {P : MeetOrder α} {Q : MeetOrder β} - (i : MeetEmbedding P Q) (c e K : α) (F : α → Prop) - (nonempty_F : ∃ f, F f) - (old_profile : Profile P c e K F) - (e_not_le_K : ¬ P.le e K) - (extension : PermittedExtension i) : - ProfileOver i c e K F := by - intro x above_e - cases extension x with - | inl old => - cases old with - | intro a ha => - cases ha - have e_le_a : P.le e a := (i.le_iff e a).mp above_e - have positives : PositiveOver i F (i.toFun a) ↔ Positive P F a := by - constructor - · intro hp - cases hp with - | intro f hf => exact ⟨f, hf.left, (i.le_iff f a).mp hf.right⟩ - · intro hp - cases hp with - | intro f hf => exact ⟨f, hf.left, (i.le_iff f a).mpr hf.right⟩ - have inherited := old_profile a e_le_a - constructor - · intro hp - exact (i.le_iff K a).mpr (inherited.left (positives.mp hp)) - · intro hn - have hn_old : ¬ Positive P F a := fun hp => hn (positives.mpr hp) - calc - Q.meet (i.toFun K) (i.toFun a) = i.toFun (P.meet K a) := - (i.map_meet K a).symm - _ = i.toFun c := congrArg i.toFun (inherited.right hn_old) - | inr fresh => - cases fresh with - | inl shadow => - exact profile_at_shadow i c e K F old_profile e_not_le_K x above_e shadow - | inr top => - constructor - · intro _ - exact top (i.toFun K) - · intro hn - cases nonempty_F with - | intro f hf => exact False.elim (hn ⟨f, hf, top (i.toFun f)⟩) - -def NodeProfile {α : Type u} (P : MeetOrder α) (c K : α) - (F : α → Prop) (x : α) : Prop := - (Positive P F x → P.le K x) ∧ - (¬ Positive P F x → P.meet K x = c) - -def ProfileOn {α : Type u} (P : MeetOrder α) (c e K : α) - (F S : α → Prop) : Prop := - ∀ x, S x → P.le e x → NodeProfile P c K F x - -def ShadowIn {α : Type u} (P : MeetOrder α) (Old : α → Prop) - (x l : α) : Prop := - Old l ∧ - (∀ a, Old a → (P.le a x ↔ P.le a l)) ∧ - (∀ a, Old a → ¬ P.le x a → P.meet x a = P.meet l a) - -def GreatestIn {α : Type u} (P : MeetOrder α) (S : α → Prop) (x : α) : Prop := - ∀ y, S y → P.le y x - -def ContainsAnchors {α : Type u} (S : α → Prop) (e K : α) (F : α → Prop) : Prop := - S e ∧ S K ∧ ∀ f, F f → S f - -theorem profile_on_shadow {α : Type u} (P : MeetOrder α) - (c e K : α) (F Old : α → Prop) - (anchors : ContainsAnchors Old e K F) - (old_profile : ProfileOn P c e K F Old) - (e_not_le_K : ¬ P.le e K) - (x l : α) (above_e : P.le e x) - (shadow : ShadowIn P Old x l) : NodeProfile P c K F x := by - have part := shadow.right.left - have shadow_meet := shadow.right.right - have e_le_l : P.le e l := (part e anchors.left).mp above_e - have x_not_le_K : ¬ P.le x K := fun hx => e_not_le_K (P.trans above_e hx) - have positives : Positive P F x ↔ Positive P F l := by - constructor - · intro hp - cases hp with - | intro f hf => - exact ⟨f, hf.left, (part f (anchors.right.right f hf.left)).mp hf.right⟩ - · intro hp - cases hp with - | intro f hf => - exact ⟨f, hf.left, (part f (anchors.right.right f hf.left)).mpr hf.right⟩ - have inherited := old_profile l shadow.left e_le_l - constructor - · intro hp - exact (part K anchors.right.left).mpr (inherited.left (positives.mp hp)) - · intro hn - have hn_old : ¬ Positive P F l := fun hp => hn (positives.mpr hp) - calc - P.meet K x = P.meet x K := meet_comm P _ _ - _ = P.meet l K := shadow_meet K anchors.right.left x_not_le_K - _ = P.meet K l := meet_comm P _ _ - _ = c := inherited.right hn_old - -def SuccessorNodes {α : Type u} (P : MeetOrder α) (Old Current : α → Prop) : Prop := - ∀ x, Current x → - Old x ∨ (∃ l, ShadowIn P Old x l) ∨ GreatestIn P Current x - -def StageCases {α : Type u} {I : Type v} (P : MeetOrder α) - (earlier : I → I → Prop) (Initial : α → Prop) (stage : I → α → Prop) - (i : I) : Prop := - (∀ x, stage i x → Initial x) ∨ - (∃ j, earlier j i ∧ SuccessorNodes P (stage j) (stage i)) ∨ - (∀ x, stage i x → ∃ j, earlier j i ∧ stage j x) - -theorem profile_at_every_stage {α : Type u} {I : Type v} - (P : MeetOrder α) (c e K : α) (F Initial : α → Prop) - (earlier : I → I → Prop) (wf : WellFounded earlier) - (stage : I → α → Prop) - (nonempty_F : ∃ f, F f) - (e_not_le_K : ¬ P.le e K) - (initial_profile : ProfileOn P c e K F Initial) - (anchors : ∀ i, ContainsAnchors (stage i) e K F) - (cases_at : ∀ i, StageCases P earlier Initial stage i) : - ∀ i, ProfileOn P c e K F (stage i) := by - intro i - apply wf.induction i - intro current ih - intro x hx above_e - cases cases_at current with - | inl initial => - exact initial_profile x (initial x hx) above_e - | inr growth => - cases growth with - | inl successor => - cases successor with - | intro old h => - have old_profile := ih old h.left - cases h.right x hx with - | inl old_node => exact old_profile x old_node above_e - | inr new_node => - cases new_node with - | inl has_shadow => - cases has_shadow with - | intro l shadow => - exact profile_on_shadow P c e K F (stage old) (anchors old) - old_profile e_not_le_K x l above_e shadow - | inr top => - constructor - · intro _ - exact top K (anchors current).right.left - · intro hn - cases nonempty_F with - | intro f hf => - exact False.elim (hn ⟨f, hf, top f ((anchors current).right.right f hf)⟩) - | inr limit => - cases limit x hx with - | intro old h => exact ih old h.left x h.right above_e - -theorem profile_persists_through_growth {α : Type u} {I : Type v} - (P : MeetOrder α) (c e K : α) (F Initial : α → Prop) - (earlier : I → I → Prop) (wf : WellFounded earlier) - (stage : I → α → Prop) - (nonempty_F : ∃ f, F f) - (e_not_le_K : ¬ P.le e K) - (initial_profile : ProfileOn P c e K F Initial) - (anchors : ∀ i, ContainsAnchors (stage i) e K F) - (cases_at : ∀ i, StageCases P earlier Initial stage i) - (covers : ∀ x, ∃ i, stage i x) : - Profile P c e K F := by - have at_stage := profile_at_every_stage P c e K F Initial earlier wf stage - nonempty_F e_not_le_K initial_profile anchors cases_at - intro x above_e - cases covers x with - | intro i hi => exact at_stage i x hi above_e - -end - - - -namespace Attachment - -universe u v w - -structure Data {O : Type u} (P : MeetOrder O) (N : Type v) (I : Type w) where - component : N → I - base : I → O - upper : I → O → Prop - upper_up : ∀ i {a b}, upper i a → P.le a b → upper i b - upper_meet : ∀ i {a b}, upper i a → upper i b → upper i (P.meet a b) - base_le_upper : ∀ i a, upper i a → P.le (base i) a - base_not_upper : ∀ i, ¬ upper i (base i) - shadow : N → O - shadow_le_base : ∀ x, P.le (shadow x) (base (component x)) - inside : N → N → Prop - inside_refl : ∀ x, inside x x - inside_trans : ∀ {x y z}, inside x y → inside y z → inside x z - inside_antisymm : ∀ {x y}, inside x y → inside y x → x = y - inside_component : ∀ {x y}, inside x y → component x = component y - inside_shadow : ∀ {x y}, inside x y → P.le (shadow x) (shadow y) - -variable {O : Type u} {N : Type v} {I : Type w} {P : MeetOrder O} - -def FreshLe (d : Data P N I) (x y : N) : Prop := - d.inside x y ∨ d.upper (d.component x) (d.shadow y) - -def Le (d : Data P N I) : O ⊕ N → O ⊕ N → Prop - | .inl a, .inl b => P.le a b - | .inl a, .inr y => P.le a (d.shadow y) - | .inr x, .inl b => d.upper (d.component x) b - | .inr x, .inr y => FreshLe d x y - -theorem not_upper_shadow (d : Data P N I) (x : N) : - ¬ d.upper (d.component x) (d.shadow x) := by - intro h - exact d.base_not_upper _ (d.upper_up _ h (d.shadow_le_base x)) - -theorem fresh_shadow_mono (d : Data P N I) {x y : N} - (h : FreshLe d x y) : P.le (d.shadow x) (d.shadow y) := by - cases h with - | inl h => exact d.inside_shadow h - | inr h => exact P.trans (d.shadow_le_base x) (d.base_le_upper _ _ h) - -theorem fresh_trans (d : Data P N I) {x y z : N} - (hxy : FreshLe d x y) (hyz : FreshLe d y z) : FreshLe d x z := by - cases hxy with - | inl hxy => - cases hyz with - | inl hyz => exact Or.inl (d.inside_trans hxy hyz) - | inr hyz => - exact Or.inr ((d.inside_component hxy).symm ▸ hyz) - | inr hxy => exact Or.inr (d.upper_up _ hxy (fresh_shadow_mono d hyz)) - -theorem fresh_antisymm (d : Data P N I) {x y : N} - (hxy : FreshLe d x y) (hyx : FreshLe d y x) : x = y := by - cases hxy with - | inl hxy => - cases hyx with - | inl hyx => exact d.inside_antisymm hxy hyx - | inr hyx => - exact False.elim (not_upper_shadow d x ((d.inside_component hxy).symm ▸ hyx)) - | inr hxy => - exact False.elim (not_upper_shadow d x (d.upper_up _ hxy (fresh_shadow_mono d hyx))) - -theorem le_refl (d : Data P N I) (x : O ⊕ N) : Le d x x := by - cases x with - | inl a => exact P.refl a - | inr x => exact Or.inl (d.inside_refl x) - -theorem le_trans (d : Data P N I) {x y z : O ⊕ N} - (hxy : Le d x y) (hyz : Le d y z) : Le d x z := by - cases x with - | inl a => - cases y with - | inl b => - cases z with - | inl c => exact P.trans hxy hyz - | inr z => exact P.trans hxy hyz - | inr y => - cases z with - | inl c => exact P.trans hxy (P.trans (d.shadow_le_base y) (d.base_le_upper _ _ hyz)) - | inr z => exact P.trans hxy (fresh_shadow_mono d hyz) - | inr x => - cases y with - | inl b => - cases z with - | inl c => exact d.upper_up _ hxy hyz - | inr z => exact Or.inr (d.upper_up _ hxy hyz) - | inr y => - cases z with - | inl c => - cases hxy with - | inl hxy => - change d.upper (d.component x) c - exact (d.inside_component hxy).symm ▸ hyz - | inr hxy => - exact d.upper_up _ hxy (P.trans (d.shadow_le_base y) (d.base_le_upper _ _ hyz)) - | inr z => exact fresh_trans d hxy hyz - -theorem le_antisymm (d : Data P N I) {x y : O ⊕ N} - (hxy : Le d x y) (hyx : Le d y x) : x = y := by - cases x with - | inl a => - cases y with - | inl b => exact congrArg Sum.inl (P.antisymm hxy hyx) - | inr y => exact False.elim (not_upper_shadow d y (d.upper_up _ hyx hxy)) - | inr x => - cases y with - | inl b => exact False.elim (not_upper_shadow d x (d.upper_up _ hxy hyx)) - | inr y => exact congrArg Sum.inr (fresh_antisymm d hxy hyx) - -theorem fresh_same_component (d : Data P N I) {x y : N} - (same : d.component x = d.component y) : - FreshLe d x y ↔ d.inside x y := by - constructor - · intro h - cases h with - | inl h => exact h - | inr h => exact False.elim (not_upper_shadow d y (same ▸ h)) - · exact Or.inl - -theorem fresh_different_components (d : Data P N I) {x y : N} - (different : d.component x ≠ d.component y) : - FreshLe d x y ↔ d.upper (d.component x) (d.shadow y) := by - constructor - · intro h - cases h with - | inl h => exact False.elim (different (d.inside_component h)) - | inr h => exact h - · exact Or.inr - -def IsMeet (d : Data P N I) (a b m : O ⊕ N) : Prop := - Le d m a ∧ Le d m b ∧ ∀ t, Le d t a → Le d t b → Le d t m - -theorem old_meet (d : Data P N I) (a b : O) : - IsMeet d (.inl a) (.inl b) (.inl (P.meet a b)) := by - refine ⟨P.meet_le_left a b, P.meet_le_right a b, ?_⟩ - intro t hta htb - cases t with - | inl c => exact P.le_meet hta htb - | inr x => exact d.upper_meet _ hta htb - -theorem shadow_meet (d : Data P N I) (x : N) (a : O) - (not_above : ¬ d.upper (d.component x) a) : - IsMeet d (.inr x) (.inl a) (.inl (P.meet (d.shadow x) a)) := by - refine ⟨P.meet_le_left _ _, P.meet_le_right _ _, ?_⟩ - intro t htx hta - cases t with - | inl b => exact P.le_meet htx hta - | inr y => - cases htx with - | inl inside => exact False.elim (not_above (d.inside_component inside ▸ hta)) - | inr mediated => exact d.upper_meet _ mediated hta - -theorem cross_meet (d : Data P N I) (x z : N) - (different : d.component x ≠ d.component z) - (not_xz : ¬ FreshLe d x z) (not_zx : ¬ FreshLe d z x) : - IsMeet d (.inr x) (.inr z) (.inl (P.meet (d.shadow x) (d.shadow z))) := by - refine ⟨P.meet_le_left _ _, P.meet_le_right _ _, ?_⟩ - intro t htx htz - cases t with - | inl b => exact P.le_meet htx htz - | inr y => - cases htx with - | inl hyx => - cases htz with - | inl hyz => - exact False.elim (different ((d.inside_component hyx).symm.trans (d.inside_component hyz))) - | inr hyz => exact False.elim (not_xz (Or.inr (d.inside_component hyx ▸ hyz))) - | inr hyx => - cases htz with - | inl hyz => exact False.elim (not_zx (Or.inr (d.inside_component hyz ▸ hyx))) - | inr hyz => exact d.upper_meet _ hyx hyz - -def ComponentMeets (d : Data P N I) : Prop := - ∀ x z, d.component x = d.component z → - (∃ m, d.inside m x ∧ d.inside m z ∧ - (∀ y, d.inside y x → d.inside y z → d.inside y m) ∧ - d.shadow m = P.meet (d.shadow x) (d.shadow z)) ∨ - (∀ y, d.inside y x → d.inside y z → False) - -theorem inside_mediated_impossible (d : Data P N I) {y x z : N} - (inside : d.inside y x) (same : d.component x = d.component z) - (mediated : d.upper (d.component y) (d.shadow z)) : False := by - exact not_upper_shadow d z ((d.inside_component inside).trans same ▸ mediated) - -theorem component_fresh_meet (d : Data P N I) (x z m : N) - (same : d.component x = d.component z) - (hmx : d.inside m x) (hmz : d.inside m z) - (greatest : ∀ y, d.inside y x → d.inside y z → d.inside y m) - (shadows : d.shadow m = P.meet (d.shadow x) (d.shadow z)) : - IsMeet d (.inr x) (.inr z) (.inr m) := by - refine ⟨Or.inl hmx, Or.inl hmz, ?_⟩ - intro t htx htz - cases t with - | inl a => - change P.le a (d.shadow m) - rw [shadows] - exact P.le_meet htx htz - | inr y => - cases htx with - | inl hyx => - cases htz with - | inl hyz => exact Or.inl (greatest y hyx hyz) - | inr hyz => exact False.elim (inside_mediated_impossible d hyx same hyz) - | inr hyx => - cases htz with - | inl hyz => exact False.elim (inside_mediated_impossible d hyz same.symm hyx) - | inr hyz => - apply Or.inr - rw [shadows] - exact d.upper_meet _ hyx hyz - -theorem component_old_meet (d : Data P N I) (x z : N) - (same : d.component x = d.component z) - (no_new_lower : ∀ y, d.inside y x → d.inside y z → False) : - IsMeet d (.inr x) (.inr z) (.inl (P.meet (d.shadow x) (d.shadow z))) := by - refine ⟨P.meet_le_left _ _, P.meet_le_right _ _, ?_⟩ - intro t htx htz - cases t with - | inl a => exact P.le_meet htx htz - | inr y => - cases htx with - | inl hyx => - cases htz with - | inl hyz => exact False.elim (no_new_lower y hyx hyz) - | inr hyz => exact False.elim (inside_mediated_impossible d hyx same hyz) - | inr hyx => - cases htz with - | inl hyz => exact False.elim (inside_mediated_impossible d hyz same.symm hyx) - | inr hyz => exact d.upper_meet _ hyx hyz - -theorem meet_of_le (d : Data P N I) {a b : O ⊕ N} (h : Le d a b) : - IsMeet d a b a := ⟨le_refl d a, h, fun _ hta _ => hta⟩ - -theorem meet_symm (d : Data P N I) {a b m : O ⊕ N} - (h : IsMeet d a b m) : IsMeet d b a m := - ⟨h.right.left, h.left, fun t htb hta => h.right.right t hta htb⟩ - -theorem all_meets (d : Data P N I) (local_meets : ComponentMeets d) - (a b : O ⊕ N) : ∃ m, IsMeet d a b m := by - classical - cases a with - | inl a => - cases b with - | inl b => exact ⟨_, old_meet d a b⟩ - | inr y => - by_cases h : d.upper (d.component y) a - · exact ⟨_, meet_symm d (meet_of_le d h)⟩ - · exact ⟨_, meet_symm d (shadow_meet d y a h)⟩ - | inr x => - cases b with - | inl b => - by_cases h : d.upper (d.component x) b - · exact ⟨_, meet_of_le d h⟩ - · exact ⟨_, shadow_meet d x b h⟩ - | inr z => - by_cases same : d.component x = d.component z - · cases local_meets x z same with - | inl fresh => - rcases fresh with ⟨m, hmx, hmz, greatest, shadows⟩ - exact ⟨_, component_fresh_meet d x z m same hmx hmz greatest shadows⟩ - | inr old => exact ⟨_, component_old_meet d x z same old⟩ - · by_cases h : FreshLe d x z - · exact ⟨_, meet_of_le d h⟩ - · by_cases h' : FreshLe d z x - · exact ⟨_, meet_symm d (meet_of_le d h')⟩ - · exact ⟨_, cross_meet d x z same h h'⟩ - -noncomputable def meetOrder (d : Data P N I) (local_meets : ComponentMeets d) : - MeetOrder (O ⊕ N) where - le := Le d - meet a b := Classical.choose (all_meets d local_meets a b) - refl := le_refl d - trans := le_trans d - antisymm := le_antisymm d - meet_le_left a b := (Classical.choose_spec (all_meets d local_meets a b)).left - meet_le_right a b := (Classical.choose_spec (all_meets d local_meets a b)).right.left - le_meet hab hac := (Classical.choose_spec (all_meets d local_meets _ _)).right.right _ hab hac - -theorem meet_eq (d : Data P N I) (local_meets : ComponentMeets d) - {a b m : O ⊕ N} (h : IsMeet d a b m) : - (meetOrder d local_meets).meet a b = m := by - let Q := meetOrder d local_meets - apply le_antisymm d - · exact h.right.right _ (Q.meet_le_left a b) (Q.meet_le_right a b) - · exact Q.le_meet h.left h.right.left - -noncomputable def oldEmbedding (d : Data P N I) (local_meets : ComponentMeets d) : - MeetEmbedding P (meetOrder d local_meets) where - toFun := Sum.inl - le_iff _ _ := Iff.rfl - map_meet a b := (meet_eq d local_meets (old_meet d a b)).symm - -theorem has_old_shadow (d : Data P N I) (local_meets : ComponentMeets d) (x : N) : - HasOldShadow (oldEmbedding d local_meets) (.inr x) := by - refine ⟨d.shadow x, fun _ => Iff.rfl, ?_⟩ - intro a h - exact meet_eq d local_meets (shadow_meet d x a h) - -theorem permitted_extension (d : Data P N I) (local_meets : ComponentMeets d) : - PermittedExtension (oldEmbedding d local_meets) := by - intro x - cases x with - | inl a => exact Or.inl ⟨a, rfl⟩ - | inr x => exact Or.inr (Or.inl (has_old_shadow d local_meets x)) - -theorem attachment_preserves_profile (d : Data P N I) (local_meets : ComponentMeets d) - (c e K : O) (F : O → Prop) (nonempty_F : ∃ f, F f) - (old_profile : Profile P c e K F) (e_not_le_K : ¬ P.le e K) : - ProfileOver (oldEmbedding d local_meets) c e K F := - profile_persists_one_step (oldEmbedding d local_meets) c e K F - nonempty_F old_profile e_not_le_K (permitted_extension d local_meets) - -end Attachment - - - -namespace Attachment - -universe u v w - -def idealOrder {A : Type v} (Q : MeetOrder A) (a : A) : - MeetOrder {x : A // Q.le x a} where - le x y := Q.le x.val y.val - meet x y := ⟨Q.meet x.val y.val, Q.trans (Q.meet_le_left _ _) x.property⟩ - refl x := Q.refl x.val - trans hxy hyz := Q.trans hxy hyz - antisymm hxy hyx := Subtype.ext (Q.antisymm hxy hyx) - meet_le_left x y := Q.meet_le_left x.val y.val - meet_le_right x y := Q.meet_le_right x.val y.val - le_meet hxy hxz := Q.le_meet hxy hxz - -def cut {A : Type v} (Q : MeetOrder A) (a x : A) : {y : A // Q.le y a} := - ⟨Q.meet x a, Q.meet_le_right x a⟩ - -theorem cut_mono {A : Type v} (Q : MeetOrder A) (a : A) {x y : A} - (h : Q.le x y) : (idealOrder Q a).le (cut Q a x) (cut Q a y) := - Q.le_meet (Q.trans (Q.meet_le_left x a) h) (Q.meet_le_right x a) - -theorem cut_meet {A : Type v} (Q : MeetOrder A) (a x y : A) : - cut Q a (Q.meet x y) = (idealOrder Q a).meet (cut Q a x) (cut Q a y) := by - apply Subtype.ext - change Q.meet (Q.meet x y) a = Q.meet (Q.meet x a) (Q.meet y a) - apply Q.antisymm - · apply Q.le_meet - · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_left x y)) (Q.meet_le_right _ _) - · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_right x y)) (Q.meet_le_right _ _) - · apply Q.le_meet - · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_left x a)) - (Q.trans (Q.meet_le_right _ _) (Q.meet_le_left y a)) - · exact Q.trans (Q.meet_le_left _ _) (Q.meet_le_right x a) - -theorem cut_of_le {A : Type v} (Q : MeetOrder A) (a x : A) (h : Q.le x a) : - cut Q a x = ⟨x, h⟩ := by - apply Subtype.ext - exact Q.antisymm (Q.meet_le_left x a) (Q.le_meet (Q.refl x) h) - -structure Templates {O : Type u} (P : MeetOrder O) (I : Type w) where - Space : I → Type v - order : ∀ i, MeetOrder (Space i) - anchor : ∀ i, Space i - embed : ∀ i, MeetEmbedding (idealOrder (order i) (anchor i)) P - upper : I → O → Prop - upper_nonempty : ∀ i, ∃ a, upper i a - upper_up : ∀ i {a b}, upper i a → P.le a b → upper i b - upper_meet : ∀ i {a b}, upper i a → upper i b → upper i (P.meet a b) - separator : I → O - base_le_separator : ∀ i, - P.le ((embed i).toFun ⟨anchor i, (order i).refl _⟩) (separator i) - separator_not_le_base : ∀ i, - ¬ P.le (separator i) ((embed i).toFun ⟨anchor i, (order i).refl _⟩) - separator_le_upper : ∀ i a, upper i a → P.le (separator i) a - -namespace Templates - -variable {O : Type u} {I : Type w} {P : MeetOrder O} (b : Templates.{u,v,w} P I) - -def Fresh := (i : I) × {y : b.Space i // ¬ (b.order i).le y (b.anchor i)} - -def base (i : I) : O := (b.embed i).toFun ⟨b.anchor i, (b.order i).refl _⟩ - -def shadow (x : b.Fresh) : O := (b.embed x.1).toFun (cut (b.order x.1) (b.anchor x.1) x.2.val) - -def Inside (x y : b.Fresh) : Prop := - ∃ h : x.1 = y.1, (b.order x.1).le x.2.val (h.symm ▸ y.2.val) - -theorem inside_refl (x : b.Fresh) : b.Inside x x := ⟨rfl, (b.order x.1).refl x.2.val⟩ - -theorem inside_trans {x y z : b.Fresh} (hxy : b.Inside x y) (hyz : b.Inside y z) : - b.Inside x z := by - rcases x with ⟨i, x⟩ - rcases y with ⟨j, y⟩ - rcases z with ⟨k, z⟩ - rcases hxy with ⟨hij, hxy⟩ - cases hij - rcases hyz with ⟨hjk, hyz⟩ - cases hjk - exact ⟨rfl, (b.order i).trans hxy hyz⟩ - -theorem inside_antisymm {x y : b.Fresh} (hxy : b.Inside x y) (hyx : b.Inside y x) : - x = y := by - rcases x with ⟨i, x⟩ - rcases y with ⟨j, y⟩ - rcases hxy with ⟨hij, hxy⟩ - cases hij - rcases hyx with ⟨hii, hyx⟩ - cases hii - exact congrArg (Sigma.mk i) (Subtype.ext ((b.order i).antisymm hxy hyx)) - -theorem inside_shadow {x y : b.Fresh} (hxy : b.Inside x y) : - P.le (b.shadow x) (b.shadow y) := by - rcases x with ⟨i, x⟩ - rcases y with ⟨j, y⟩ - rcases hxy with ⟨hij, hxy⟩ - cases hij - exact ((b.embed i).le_iff _ _).mpr (cut_mono (b.order i) (b.anchor i) hxy) - -def data : Data P b.Fresh I where - component := Sigma.fst - base := b.base - upper := b.upper - upper_up := b.upper_up - upper_meet := b.upper_meet - base_le_upper i a h := P.trans (b.base_le_separator i) (b.separator_le_upper i a h) - base_not_upper i h := b.separator_not_le_base i (b.separator_le_upper i (b.base i) h) - shadow := b.shadow - shadow_le_base x := ((b.embed x.1).le_iff _ _).mpr ((b.order x.1).meet_le_right _ _) - inside := b.Inside - inside_refl := b.inside_refl - inside_trans := b.inside_trans - inside_antisymm := b.inside_antisymm - inside_component h := h.choose - inside_shadow := b.inside_shadow - -theorem mapped_cut_meet (i : I) (x y : b.Space i) : - (b.embed i).toFun (cut (b.order i) (b.anchor i) ((b.order i).meet x y)) = - P.meet ((b.embed i).toFun (cut (b.order i) (b.anchor i) x)) - ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) := by - rw [cut_meet] - exact (b.embed i).map_meet _ _ - -theorem component_meets : ComponentMeets b.data := by - classical - intro x z same - rcases x with ⟨i, x⟩ - rcases z with ⟨j, z⟩ - change i = j at same - cases same - by_cases old : (b.order i).le ((b.order i).meet x.val z.val) (b.anchor i) - · apply Or.inr - intro y hyx hyz - rcases y with ⟨k, y⟩ - rcases hyx with ⟨hki, hyx⟩ - cases hki - rcases hyz with ⟨hkk, hyz⟩ - cases hkk - exact y.property ((b.order i).trans ((b.order i).le_meet hyx hyz) old) - · apply Or.inl - let m : b.Fresh := ⟨i, ⟨(b.order i).meet x.val z.val, old⟩⟩ - refine ⟨m, ⟨rfl, (b.order i).meet_le_left _ _⟩, ⟨rfl, (b.order i).meet_le_right _ _⟩, ?_, ?_⟩ - · intro y hyx hyz - rcases y with ⟨k, y⟩ - rcases hyx with ⟨hki, hyx⟩ - cases hki - rcases hyz with ⟨hkk, hyz⟩ - cases hkk - exact ⟨rfl, (b.order i).le_meet hyx hyz⟩ - · exact b.mapped_cut_meet i x.val z.val - -noncomputable def extension : MeetOrder (O ⊕ b.Fresh) := meetOrder b.data b.component_meets - -noncomputable def oldEmbedding : MeetEmbedding P b.extension := - Attachment.oldEmbedding b.data b.component_meets - -theorem shadow_verified (x : b.Fresh) : HasOldShadow b.oldEmbedding (.inr x) := - has_old_shadow b.data b.component_meets x - -theorem persistence (c e K : O) (F : O → Prop) (nonempty_F : ∃ f, F f) - (old_profile : Profile P c e K F) (e_not_le_K : ¬ P.le e K) : - ProfileOver b.oldEmbedding c e K F := - attachment_preserves_profile b.data b.component_meets c e K F nonempty_F old_profile e_not_le_K - -noncomputable def represent (i : I) (y : b.Space i) : O ⊕ b.Fresh := by - classical - exact if h : (b.order i).le y (b.anchor i) then - .inl ((b.embed i).toFun ⟨y, h⟩) - else .inr ⟨i, ⟨y, h⟩⟩ - -theorem represent_old (i : I) (y : b.Space i) (h : (b.order i).le y (b.anchor i)) : - b.represent i y = .inl ((b.embed i).toFun ⟨y, h⟩) := by - simp only [represent, dite_eq_left h] - -theorem represent_new (i : I) (y : b.Space i) (h : ¬ (b.order i).le y (b.anchor i)) : - b.represent i y = .inr ⟨i, ⟨y, h⟩⟩ := by - simp only [represent, dite_eq_right h] - -theorem represent_le_iff (i : I) (x y : b.Space i) : - Le b.data (b.represent i x) (b.represent i y) ↔ (b.order i).le x y := by - classical - by_cases hx : (b.order i).le x (b.anchor i) - · rw [b.represent_old i x hx] - by_cases hy : (b.order i).le y (b.anchor i) - · rw [b.represent_old i y hy] - exact (b.embed i).le_iff _ _ - · rw [b.represent_new i y hy] - change P.le ((b.embed i).toFun ⟨x, hx⟩) - ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) ↔ _ - rw [(b.embed i).le_iff] - constructor - · intro h - exact (b.order i).trans h ((b.order i).meet_le_left y (b.anchor i)) - · intro h - exact (b.order i).le_meet h hx - · rw [b.represent_new i x hx] - by_cases hy : (b.order i).le y (b.anchor i) - · rw [b.represent_old i y hy] - constructor - · intro h - have hbase : P.le ((b.embed i).toFun ⟨y, hy⟩) (b.base i) := - ((b.embed i).le_iff _ _).mpr hy - exact False.elim (b.data.base_not_upper i (b.upper_up i h hbase)) - · intro h - exact False.elim (hx ((b.order i).trans h hy)) - · rw [b.represent_new i y hy] - change FreshLe b.data ⟨i, ⟨x, hx⟩⟩ ⟨i, ⟨y, hy⟩⟩ ↔ _ - rw [fresh_same_component b.data (x := ⟨i, ⟨x, hx⟩⟩) (y := ⟨i, ⟨y, hy⟩⟩) rfl] - constructor - · rintro ⟨h, hxy⟩ - cases h - exact hxy - · intro hxy - exact ⟨rfl, hxy⟩ - -theorem old_below_represent (i : I) (y : b.Space i) (a : O) : - Le b.data (.inl a) (b.represent i y) ↔ - P.le a ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) := by - classical - by_cases hy : (b.order i).le y (b.anchor i) - · rw [b.represent_old i y hy, cut_of_le _ _ _ hy] - exact Iff.rfl - · rw [b.represent_new i y hy] - exact Iff.rfl - -theorem upper_shadow_below_represent (i : I) (y : b.Space i) (x : b.Fresh) - (h : b.upper x.1 ((b.embed i).toFun (cut (b.order i) (b.anchor i) y))) : - Le b.data (.inr x) (b.represent i y) := by - classical - by_cases hy : (b.order i).le y (b.anchor i) - · rw [b.represent_old i y hy] - rw [cut_of_le _ _ _ hy] at h - exact h - · rw [b.represent_new i y hy] - exact Or.inr h - -theorem foreign_below_represent (i : I) (y : b.Space i) (x : b.Fresh) - (different : x.1 ≠ i) - (h : Le b.data (.inr x) (b.represent i y)) : - b.upper x.1 ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) := by - classical - by_cases hy : (b.order i).le y (b.anchor i) - · rw [b.represent_old i y hy] at h - rw [cut_of_le _ _ _ hy] - exact h - · rw [b.represent_new i y hy] at h - exact (fresh_different_components b.data (x := x) (y := ⟨i, ⟨y, hy⟩⟩) different).mp h - -theorem represented_meet (i : I) (x z : b.Space i) : - IsMeet b.data (b.represent i x) (b.represent i z) - (b.represent i ((b.order i).meet x z)) := by - classical - refine ⟨(b.represent_le_iff i _ _).mpr ((b.order i).meet_le_left x z), - (b.represent_le_iff i _ _).mpr ((b.order i).meet_le_right x z), ?_⟩ - intro t htx htz - cases t with - | inl a => - apply (b.old_below_represent i _ a).mpr - rw [b.mapped_cut_meet] - exact P.le_meet ((b.old_below_represent i x a).mp htx) - ((b.old_below_represent i z a).mp htz) - | inr y => - rcases y with ⟨j, y⟩ - by_cases same : j = i - · cases same - have repr_y := b.represent_new i y.val y.property - rw [← repr_y] at htx htz ⊢ - apply (b.represent_le_iff i _ _).mpr - exact (b.order i).le_meet ((b.represent_le_iff i _ _).mp htx) - ((b.represent_le_iff i _ _).mp htz) - · apply b.upper_shadow_below_represent - rw [b.mapped_cut_meet] - exact b.upper_meet j (b.foreign_below_represent i x ⟨j, y⟩ same htx) - (b.foreign_below_represent i z ⟨j, y⟩ same htz) - -noncomputable def templateEmbedding (i : I) : MeetEmbedding (b.order i) b.extension where - toFun := b.represent i - le_iff := b.represent_le_iff i - map_meet x z := (meet_eq b.data b.component_meets (b.represented_meet i x z)).symm - -theorem template_agrees_on_base (i : I) (y : b.Space i) - (hy : (b.order i).le y (b.anchor i)) : - (b.templateEmbedding i).toFun y = .inl ((b.embed i).toFun ⟨y, hy⟩) := - b.represent_old i y hy - -theorem greatest_preserved (T : O) (top : ∀ a, P.le a T) : - ∀ x, b.extension.le x (.inl T) := by - intro x - cases x with - | inl a => exact top a - | inr x => - rcases b.upper_nonempty x.1 with ⟨a, ha⟩ - exact b.upper_up x.1 ha (top a) - -theorem least_preserved (zero : O) (bottom : ∀ a, P.le zero a) : - ∀ x, b.extension.le (.inl zero) x := by - intro x - cases x with - | inl a => exact bottom a - | inr x => exact bottom (b.shadow x) - -theorem cross_meet_eq (x z : b.Fresh) (different : x.1 ≠ z.1) - (not_xz : ¬ b.extension.le (.inr x) (.inr z)) - (not_zx : ¬ b.extension.le (.inr z) (.inr x)) : - b.extension.meet (.inr x) (.inr z) = .inl (P.meet (b.shadow x) (b.shadow z)) := - meet_eq b.data b.component_meets (cross_meet b.data x z different not_xz not_zx) - -theorem old_lower_iff (a : O) (x : b.Fresh) : - b.extension.le (.inl a) (.inr x) ↔ P.le a (b.shadow x) := Iff.rfl - -theorem old_upper_iff (a : O) (x : b.Fresh) : - b.extension.le (.inr x) (.inl a) ↔ b.upper x.1 a := Iff.rfl - -theorem cross_le_iff (x z : b.Fresh) (different : x.1 ≠ z.1) : - b.extension.le (.inr x) (.inr z) ↔ b.upper x.1 (b.shadow z) := - fresh_different_components b.data (x := x) (y := z) different - -theorem shadow_meet_eq (x : b.Fresh) (a : O) - (not_above : ¬ b.extension.le (.inr x) (.inl a)) : - b.extension.meet (.inr x) (.inl a) = .inl (P.meet (b.shadow x) a) := - meet_eq b.data b.component_meets (shadow_meet b.data x a not_above) - -theorem template_preserves_zero (i : I) (qzero : b.Space i) (zero : O) - (qbottom : ∀ y, (b.order i).le qzero y) - (base_zero : (b.embed i).toFun ⟨qzero, qbottom (b.anchor i)⟩ = zero) : - (b.templateEmbedding i).toFun qzero = .inl zero := by - rw [b.template_agrees_on_base i qzero (qbottom (b.anchor i)), base_zero] - -end Templates -end Attachment - - - - -universe u v w - -theorem meet_eq_left_of_le {A : Type u} (P : MeetOrder A) {x y : A} - (h : P.le x y) : P.meet x y = x := - P.antisymm (P.meet_le_left x y) (P.le_meet (P.refl x) h) - -namespace Attachment.Templates - -variable {O : Type u} {I : Type w} {P : MeetOrder O} (b : Templates.{u,v,w} P I) - -def originalFamily (i : I) : O ⊕ b.Fresh → Prop - | .inl a => b.upper i a - | .inr _ => False - -theorem positive_old_iff (i : I) (a : O) : - Positive b.extension (b.originalFamily i) (.inl a) ↔ b.upper i a := by - constructor - · rintro ⟨f, hf, hfa⟩ - cases f with - | inl f => exact b.upper_up i hf hfa - | inr f => exact False.elim hf - · intro ha - exact ⟨.inl a, ha, P.refl a⟩ - -theorem positive_new_iff (i : I) (x : b.Fresh) : - Positive b.extension (b.originalFamily i) (.inr x) ↔ b.upper i (b.shadow x) := by - constructor - · rintro ⟨f, hf, hfx⟩ - cases f with - | inl f => exact b.upper_up i hf hfx - | inr f => exact False.elim hf - · intro hx - exact ⟨.inl (b.shadow x), hx, P.refl _⟩ - -def cap (i : I) (t : b.Space i) (outside : ¬ (b.order i).le t (b.anchor i)) : b.Fresh := - ⟨i, ⟨t, outside⟩⟩ - -theorem cap_shadow (i : I) (t : b.Space i) - (top : ∀ y, (b.order i).le y t) - (outside : ¬ (b.order i).le t (b.anchor i)) : - b.shadow (b.cap i t outside) = b.base i := by - change (b.embed i).toFun (cut (b.order i) (b.anchor i) t) = _ - have hcut : cut (b.order i) (b.anchor i) t = - ⟨b.anchor i, (b.order i).refl _⟩ := by - apply Subtype.ext - exact (b.order i).antisymm ((b.order i).meet_le_right _ _) - ((b.order i).le_meet (top _) ((b.order i).refl _)) - exact congrArg (b.embed i).toFun hcut - -theorem cap_strict_above_base (i : I) (t : b.Space i) - (top : ∀ y, (b.order i).le y t) - (outside : ¬ (b.order i).le t (b.anchor i)) : - b.extension.le (.inl (b.base i)) (.inr (b.cap i t outside)) ∧ - ¬ b.extension.le (.inr (b.cap i t outside)) (.inl (b.base i)) := by - constructor - · change P.le (b.base i) (b.shadow (b.cap i t outside)) - rw [b.cap_shadow i t top outside] - exact P.refl _ - · exact b.data.base_not_upper i - -theorem separator_not_below_cap (i : I) (t : b.Space i) - (top : ∀ y, (b.order i).le y t) - (outside : ¬ (b.order i).le t (b.anchor i)) : - ¬ b.extension.le (.inl (b.separator i)) (.inr (b.cap i t outside)) := by - intro h - change P.le (b.separator i) (b.shadow (b.cap i t outside)) at h - rw [b.cap_shadow i t top outside] at h - exact b.separator_not_le_base i h - -theorem initial_profile (i : I) (t : b.Space i) - (top : ∀ y, (b.order i).le y t) - (outside : ¬ (b.order i).le t (b.anchor i)) : - Profile b.extension (.inl (b.base i)) (.inl (b.separator i)) - (.inr (b.cap i t outside)) (b.originalFamily i) := by - intro x above_e - cases x with - | inl a => - constructor - · intro hp - exact (b.positive_old_iff i a).mp hp - · intro hn - have not_upper : ¬ b.upper i a := fun ha => hn ((b.positive_old_iff i a).mpr ha) - calc - b.extension.meet (.inr (b.cap i t outside)) (.inl a) = - .inl (P.meet (b.shadow (b.cap i t outside)) a) := - b.shadow_meet_eq _ a not_upper - _ = .inl (P.meet (b.base i) a) := by rw [b.cap_shadow i t top outside] - _ = .inl (b.base i) := congrArg Sum.inl - (meet_eq_left_of_le P (P.trans (b.base_le_separator i) above_e)) - | inr x => - have different : i ≠ x.1 := by - intro same - have hs := b.data.shadow_le_base x - change P.le (b.shadow x) (b.base x.1) at hs - rw [← same] at hs - exact b.separator_not_le_base i (P.trans above_e hs) - have not_xk : ¬ b.extension.le (.inr x) (.inr (b.cap i t outside)) := by - intro h - exact b.separator_not_below_cap i t top outside (b.extension.trans above_e h) - constructor - · intro hp - exact (b.cross_le_iff _ x different).mpr ((b.positive_new_iff i x).mp hp) - · intro hn - have not_kx : ¬ b.extension.le (.inr (b.cap i t outside)) (.inr x) := by - intro h - exact hn ((b.positive_new_iff i x).mpr ((b.cross_le_iff _ x different).mp h)) - calc - b.extension.meet (.inr (b.cap i t outside)) (.inr x) = - .inl (P.meet (b.shadow (b.cap i t outside)) (b.shadow x)) := - b.cross_meet_eq _ x different not_kx not_xk - _ = .inl (P.meet (b.base i) (b.shadow x)) := by rw [b.cap_shadow i t top outside] - _ = .inl (b.base i) := congrArg Sum.inl - (meet_eq_left_of_le P (P.trans (b.base_le_separator i) above_e)) - -theorem cap_alternatives (i j : I) (different : i ≠ j) - (ti : b.Space i) (tj : b.Space j) - (top_i : ∀ y, (b.order i).le y ti) (top_j : ∀ y, (b.order j).le y tj) - (outside_i : ¬ (b.order i).le ti (b.anchor i)) - (outside_j : ¬ (b.order j).le tj (b.anchor j)) : - b.extension.le (.inr (b.cap i ti outside_i)) (.inl (b.base j)) ∨ - b.extension.le (.inr (b.cap j tj outside_j)) (.inl (b.base i)) ∨ - b.extension.meet (.inr (b.cap i ti outside_i)) (.inr (b.cap j tj outside_j)) = - b.extension.meet (.inl (b.base i)) (.inl (b.base j)) := by - classical - by_cases hij : b.extension.le (.inr (b.cap i ti outside_i)) (.inr (b.cap j tj outside_j)) - · apply Or.inl - have h := (b.cross_le_iff _ _ different).mp hij - rw [b.cap_shadow j tj top_j outside_j] at h - exact h - · apply Or.inr - by_cases hji : b.extension.le (.inr (b.cap j tj outside_j)) (.inr (b.cap i ti outside_i)) - · apply Or.inl - have h := (b.cross_le_iff _ _ (Ne.symm different)).mp hji - rw [b.cap_shadow i ti top_i outside_i] at h - exact h - · apply Or.inr - rw [b.cross_meet_eq _ _ different hij hji, - b.cap_shadow i ti top_i outside_i, b.cap_shadow j tj top_j outside_j] - exact b.oldEmbedding.map_meet _ _ - -theorem equal_base_caps_meet (i j : I) (different : i ≠ j) - (same_base : b.base i = b.base j) - (ti : b.Space i) (tj : b.Space j) - (top_i : ∀ y, (b.order i).le y ti) (top_j : ∀ y, (b.order j).le y tj) - (outside_i : ¬ (b.order i).le ti (b.anchor i)) - (outside_j : ¬ (b.order j).le tj (b.anchor j)) : - b.extension.meet (.inr (b.cap i ti outside_i)) (.inr (b.cap j tj outside_j)) = - .inl (b.base i) := by - have h := b.cap_alternatives i j different ti tj top_i top_j outside_i outside_j - cases h with - | inl h => - have h' : b.upper i (b.base j) := h - rw [← same_base] at h' - exact False.elim (b.data.base_not_upper i h') - | inr h => - cases h with - | inl h => - have h' : b.upper j (b.base i) := h - rw [same_base] at h' - exact False.elim (b.data.base_not_upper j h') - | inr h => - rw [← same_base] at h - exact h.trans (meet_eq_left_of_le b.extension (b.extension.refl _)) - -theorem initial_profile_persists {A : Type v} {Q : MeetOrder A} - (next : MeetEmbedding b.extension Q) (allowed : PermittedExtension next) - (i : I) (t : b.Space i) (top : ∀ y, (b.order i).le y t) - (outside : ¬ (b.order i).le t (b.anchor i)) : - ProfileOver next (.inl (b.base i)) (.inl (b.separator i)) - (.inr (b.cap i t outside)) (b.originalFamily i) := by - have family_nonempty : ∃ f, b.originalFamily i f := by - rcases b.upper_nonempty i with ⟨f, hf⟩ - exact ⟨.inl f, hf⟩ - exact profile_persists_one_step next _ _ _ _ family_nonempty - (b.initial_profile i t top outside) (b.separator_not_below_cap i t top outside) allowed - -end Attachment.Templates - -namespace Compression - -structure MeetFilter {A : Type u} (P : MeetOrder A) where - mem : A → Prop - nonempty : ∃ x, mem x - upward : ∀ {x y}, mem x → P.le x y → mem y - closed_meet : ∀ {x y}, mem x → mem y → mem (P.meet x y) - -def pushFilter {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} - (s : MeetEmbedding P Q) (F : MeetFilter P) : MeetFilter Q where - mem y := ∃ x, F.mem x ∧ Q.le (s.toFun x) y - nonempty := by - rcases F.nonempty with ⟨x, hx⟩ - exact ⟨s.toFun x, x, hx, Q.refl _⟩ - upward := by - rintro a b ⟨x, hx, hxa⟩ hab - exact ⟨x, hx, Q.trans hxa hab⟩ - closed_meet := by - rintro a b ⟨x, hx, hxa⟩ ⟨y, hy, hyb⟩ - refine ⟨P.meet x y, F.closed_meet hx hy, ?_⟩ - rw [s.map_meet] - exact Q.le_meet (Q.trans (Q.meet_le_left _ _) hxa) - (Q.trans (Q.meet_le_right _ _) hyb) - -theorem pushFilter_trace {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} - (s : MeetEmbedding P Q) (F : MeetFilter P) (x : A) : - (pushFilter s F).mem (s.toFun x) ↔ F.mem x := by - constructor - · rintro ⟨y, hy, hyx⟩ - exact F.upward hy ((s.le_iff y x).mp hyx) - · intro hx - exact ⟨x, hx, Q.refl _⟩ - -theorem pushFilter_lower_bound {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} - (s : MeetEmbedding P Q) (F : MeetFilter P) (e : A) - (lower : ∀ f, F.mem f → P.le e f) : - ∀ y, (pushFilter s F).mem y → Q.le (s.toFun e) y := by - rintro y ⟨f, hf, hfy⟩ - exact Q.trans ((s.le_iff e f).mpr (lower f hf)) hfy - -structure MeetIso {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) - extends MeetEmbedding P Q where - inverse : B → A - left_inverse : ∀ x, inverse (toFun x) = x - right_inverse : ∀ y, toFun (inverse y) = y - -theorem filter_image_from_slice {A : Type u} (P : MeetOrder A) (F : MeetFilter P) - (g : MeetIso P P) (v : A) (hv : F.mem v) (y : A) : - (∃ f, F.mem f ∧ g.toFun f = y) ↔ - (∃ x, F.mem x ∧ P.le x v ∧ P.le (g.toFun x) y) := by - constructor - · rintro ⟨f, hf, rfl⟩ - exact ⟨P.meet f v, F.closed_meet hf hv, P.meet_le_right f v, - (g.le_iff _ _).mpr (P.meet_le_left f v)⟩ - · rintro ⟨x, hx, _, hxy⟩ - have hxinv : P.le x (g.inverse y) := by - apply (g.le_iff _ _).mp - rw [g.right_inverse] - exact hxy - exact ⟨g.inverse y, F.upward hx hxinv, g.right_inverse y⟩ - -theorem filter_images_agree {A : Type u} (P : MeetOrder A) (F : MeetFilter P) - (g h : MeetIso P P) (v : A) (hv : F.mem v) - (agree : ∀ x, P.le x v → g.toFun x = h.toFun x) : - ∀ y, (∃ f, F.mem f ∧ g.toFun f = y) ↔ (∃ f, F.mem f ∧ h.toFun f = y) := by - intro y - rw [filter_image_from_slice P F g v hv, filter_image_from_slice P F h v hv] - constructor - · rintro ⟨x, hx, hxv, hxy⟩ - exact ⟨x, hx, hxv, agree x hxv ▸ hxy⟩ - · rintro ⟨x, hx, hxv, hxy⟩ - exact ⟨x, hx, hxv, (agree x hxv).symm ▸ hxy⟩ - -theorem meet_insert_upper {A : Type u} (P : MeetOrder A) (x y a : A) - (hya : P.le y a) : P.meet x y = P.meet (P.meet x a) y := by - apply P.antisymm - · exact P.le_meet (P.le_meet (P.meet_le_left x y) (P.trans (P.meet_le_right x y) hya)) - (P.meet_le_right x y) - · exact P.le_meet (P.trans (P.meet_le_left _ _) (P.meet_le_left x a)) - (P.meet_le_right _ _) - -theorem base_meet_patch {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) - (s : A → B) (g : MeetEmbedding P Q) (a : A) (c : B) - (ga : g.toFun a = c) - (agree : ∀ y, P.le y a → s y = g.toFun y) - (cut_law : ∀ x, Q.meet (s x) c = s (P.meet x a)) - (x y : A) (hya : P.le y a) : Q.meet (s x) (s y) = s (P.meet x y) := by - have syc : Q.le (s y) c := by - rw [agree y hya, ← ga] - exact (g.le_iff y a).mpr hya - calc - Q.meet (s x) (s y) = Q.meet (Q.meet (s x) c) (s y) := meet_insert_upper Q _ _ _ syc - _ = Q.meet (s (P.meet x a)) (s y) := by rw [cut_law] - _ = Q.meet (g.toFun (P.meet x a)) (g.toFun y) := by - rw [agree _ (P.meet_le_right x a), agree y hya] - _ = g.toFun (P.meet (P.meet x a) y) := (g.map_meet _ _).symm - _ = g.toFun (P.meet x y) := congrArg g.toFun (meet_insert_upper P x y a hya).symm - _ = s (P.meet x y) := (agree _ (P.trans (P.meet_le_right x y) hya)).symm - -theorem base_ideal_filled {A : Type u} (P : MeetOrder A) (s : A → A) - (g : MeetIso P P) (a : A) - (agree : ∀ y, P.le y a → s y = g.toFun y) : - ∀ x, P.le x (g.toFun a) → ∃ y, s y = x := by - intro x hx - have hy : P.le (g.inverse x) a := by - apply (g.le_iff _ _).mp - rw [g.right_inverse] - exact hx - exact ⟨g.inverse x, (agree _ hy).trans (g.right_inverse x)⟩ - -theorem range_completion_from_accounting {A : Type u} {J : Type v} - (P : MeetOrder A) (Original : A → Prop) (base cap : J → A) (s : J → A → A) - (base_filled : ∀ i x, P.le x (base i) → ∃ y, s i y = x) - (old_shadow : ∀ i x, Original x → P.le x (cap i) → P.le x (base i)) - (separation : ∀ i j, i ≠ j → - P.le (cap i) (base j) ∨ P.le (cap j) (base i) ∨ - P.meet (cap i) (cap j) = P.meet (base i) (base j)) - (accounting : ∀ x, Original x ∨ - ∃ j y, s j y = x ∧ P.le x (cap j) ∧ ¬ P.le x (base j)) : - ∀ i x, P.le x (cap i) → ∃ y, s i y = x := by - classical - intro i x hxi - cases accounting x with - | inl old => exact base_filled i x (old_shadow i x old hxi) - | inr new => - rcases new with ⟨j, y, hy, hxj, not_base⟩ - by_cases same : j = i - · cases same - exact ⟨y, hy⟩ - · cases separation j i same with - | inl hjci => exact base_filled i x (P.trans hxj hjci) - | inr h => - cases h with - | inl hicj => exact False.elim (not_base (P.trans hxi hicj)) - | inr hmeet => - have hxmeet : P.le x (P.meet (base j) (base i)) := hmeet ▸ P.le_meet hxj hxi - exact base_filled i x (P.trans hxmeet (P.meet_le_right _ _)) - -theorem embedding_injective {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} - (s : MeetEmbedding P Q) {x y : A} (h : s.toFun x = s.toFun y) : x = y := by - apply P.antisymm - · apply (s.le_iff x y).mp - rw [h] - exact Q.refl _ - · apply (s.le_iff y x).mp - rw [h] - exact Q.refl _ - -noncomputable def isoOntoIdeal {A : Type u} (P : MeetOrder A) - (s : MeetEmbedding P P) (k : A) - (below : ∀ x, P.le (s.toFun x) k) - (onto : ∀ z, P.le z k → ∃ x, s.toFun x = z) : - MeetIso P (Attachment.idealOrder P k) where - toFun x := ⟨s.toFun x, below x⟩ - le_iff x y := s.le_iff x y - map_meet x y := Subtype.ext (s.map_meet x y) - inverse z := Classical.choose (onto z.val z.property) - left_inverse x := embedding_injective s (Classical.choose_spec (onto (s.toFun x) (below x))) - right_inverse z := Subtype.ext (Classical.choose_spec (onto z.val z.property)) - -structure InitialTasks {A : Type u} (P : MeetOrder A) (J : Type v) where - source : J → A - representative : J → MeetIso P P - filter : J → MeetFilter P - separator : J → A - base_le_separator : ∀ i, P.le ((representative i).toFun (source i)) (separator i) - separator_not_le_base : ∀ i, ¬ P.le (separator i) ((representative i).toFun (source i)) - separator_le_filter : ∀ i f, (filter i).mem f → P.le (separator i) f - -namespace InitialTasks - -variable {A : Type u} {J : Type v} {P : MeetOrder A} (d : InitialTasks P J) - -def batch : Attachment.Templates P J where - Space _ := A - order _ := P - anchor := d.source - embed i := { - toFun y := (d.representative i).toFun y.val - le_iff x y := (d.representative i).le_iff x.val y.val - map_meet x y := (d.representative i).map_meet x.val y.val } - upper i := (d.filter i).mem - upper_nonempty i := (d.filter i).nonempty - upper_up i := (d.filter i).upward - upper_meet i := (d.filter i).closed_meet - separator := d.separator - base_le_separator := d.base_le_separator - separator_not_le_base := d.separator_not_le_base - separator_le_upper := d.separator_le_filter - -noncomputable def copy (i : J) : MeetEmbedding P d.batch.extension := - d.batch.templateEmbedding i - -theorem copy_agrees_on_base (i : J) (y : A) (hy : P.le y (d.source i)) : - (d.copy i).toFun y = .inl ((d.representative i).toFun y) := - d.batch.template_agrees_on_base i y hy - -theorem copy_initial_profile (T : A) (top : ∀ y, P.le y T) - (outside : ∀ i, ¬ P.le T (d.source i)) (i : J) : - Profile d.batch.extension (.inl ((d.representative i).toFun (d.source i))) - (.inl (d.separator i)) ((d.copy i).toFun T) (d.batch.originalFamily i) := by - change Profile d.batch.extension (.inl (d.batch.base i)) (.inl (d.batch.separator i)) - (d.batch.represent i T) (d.batch.originalFamily i) - rw [d.batch.represent_new i T (outside i)] - exact d.batch.initial_profile i T top (outside i) - -theorem copy_cap_separation (T : A) (top : ∀ y, P.le y T) - (outside : ∀ i, ¬ P.le T (d.source i)) (i j : J) (different : i ≠ j) : - d.batch.extension.le ((d.copy i).toFun T) (.inl (d.batch.base j)) ∨ - d.batch.extension.le ((d.copy j).toFun T) (.inl (d.batch.base i)) ∨ - d.batch.extension.meet ((d.copy i).toFun T) ((d.copy j).toFun T) = - d.batch.extension.meet (.inl (d.batch.base i)) (.inl (d.batch.base j)) := by - change d.batch.extension.le (d.batch.represent i T) (.inl (d.batch.base j)) ∨ - d.batch.extension.le (d.batch.represent j T) (.inl (d.batch.base i)) ∨ - d.batch.extension.meet (d.batch.represent i T) (d.batch.represent j T) = _ - rw [d.batch.represent_new i T (outside i), d.batch.represent_new j T (outside j)] - exact d.batch.cap_alternatives i j different T T top top (outside i) (outside j) - -end InitialTasks - -end Compression - -end PartitionPilot - -end OAI +import Init + +namespace OAI + + +namespace PartitionPilot + +section + +universe u v + +structure MeetOrder (α : Type u) where + le : α → α → Prop + meet : α → α → α + refl : ∀ a, le a a + trans : ∀ {a b c}, le a b → le b c → le a c + antisymm : ∀ {a b}, le a b → le b a → a = b + meet_le_left : ∀ a b, le (meet a b) a + meet_le_right : ∀ a b, le (meet a b) b + le_meet : ∀ {a b c}, le a b → le a c → le a (meet b c) + +theorem meet_comm {α : Type u} (P : MeetOrder α) (a b : α) : + P.meet a b = P.meet b a := by + apply P.antisymm + · exact P.le_meet (P.meet_le_right a b) (P.meet_le_left a b) + · exact P.le_meet (P.meet_le_right b a) (P.meet_le_left b a) + +structure MeetEmbedding {α : Type u} {β : Type v} + (P : MeetOrder α) (Q : MeetOrder β) where + toFun : α → β + le_iff : ∀ a b, Q.le (toFun a) (toFun b) ↔ P.le a b + map_meet : ∀ a b, toFun (P.meet a b) = Q.meet (toFun a) (toFun b) + +def Positive {α : Type u} (P : MeetOrder α) (F : α → Prop) (x : α) : Prop := + ∃ f, F f ∧ P.le f x + +def Profile {α : Type u} (P : MeetOrder α) (c e K : α) (F : α → Prop) : Prop := + ∀ x, P.le e x → + (Positive P F x → P.le K x) ∧ + (¬ Positive P F x → P.meet K x = c) + +def PositiveOver {α : Type u} {β : Type v} + {P : MeetOrder α} {Q : MeetOrder β} + (i : MeetEmbedding P Q) (F : α → Prop) (x : β) : Prop := + ∃ f, F f ∧ Q.le (i.toFun f) x + +def ProfileOver {α : Type u} {β : Type v} + {P : MeetOrder α} {Q : MeetOrder β} + (i : MeetEmbedding P Q) (c e K : α) (F : α → Prop) : Prop := + ∀ x, Q.le (i.toFun e) x → + (PositiveOver i F x → Q.le (i.toFun K) x) ∧ + (¬ PositiveOver i F x → Q.meet (i.toFun K) x = i.toFun c) + +def HasOldShadow {α : Type u} {β : Type v} + {P : MeetOrder α} {Q : MeetOrder β} + (i : MeetEmbedding P Q) (x : β) : Prop := + ∃ l, + (∀ a, Q.le (i.toFun a) x ↔ P.le a l) ∧ + (∀ a, ¬ Q.le x (i.toFun a) → + Q.meet x (i.toFun a) = i.toFun (P.meet l a)) + +def IsGreatest {β : Type v} (Q : MeetOrder β) (x : β) : Prop := + ∀ y, Q.le y x + +def PermittedExtension {α : Type u} {β : Type v} + {P : MeetOrder α} {Q : MeetOrder β} + (i : MeetEmbedding P Q) : Prop := + ∀ x, (∃ a, i.toFun a = x) ∨ HasOldShadow i x ∨ IsGreatest Q x + +theorem profile_at_shadow {α : Type u} {β : Type v} + {P : MeetOrder α} {Q : MeetOrder β} + (i : MeetEmbedding P Q) (c e K : α) (F : α → Prop) + (old_profile : Profile P c e K F) + (e_not_le_K : ¬ P.le e K) + (x : β) (above_e : Q.le (i.toFun e) x) + (shadow : HasOldShadow i x) : + (PositiveOver i F x → Q.le (i.toFun K) x) ∧ + (¬ PositiveOver i F x → Q.meet (i.toFun K) x = i.toFun c) := by + cases shadow with + | intro l hl => + have part := hl.left + have shadow_meet := hl.right + have e_le_l : P.le e l := (part e).mp above_e + have x_not_le_K : ¬ Q.le x (i.toFun K) := by + intro hx + exact e_not_le_K ((i.le_iff e K).mp (Q.trans above_e hx)) + have positives : PositiveOver i F x ↔ Positive P F l := by + constructor + · intro hp + cases hp with + | intro f hf => exact ⟨f, hf.left, (part f).mp hf.right⟩ + · intro hp + cases hp with + | intro f hf => exact ⟨f, hf.left, (part f).mpr hf.right⟩ + have inherited := old_profile l e_le_l + constructor + · intro hp + exact (part K).mpr (inherited.left (positives.mp hp)) + · intro hn + have hn_old : ¬ Positive P F l := fun hp => hn (positives.mpr hp) + calc + Q.meet (i.toFun K) x = Q.meet x (i.toFun K) := meet_comm Q _ _ + _ = i.toFun (P.meet l K) := shadow_meet K x_not_le_K + _ = i.toFun (P.meet K l) := congrArg i.toFun (meet_comm P l K) + _ = i.toFun c := congrArg i.toFun (inherited.right hn_old) + +theorem profile_persists_one_step {α : Type u} {β : Type v} + {P : MeetOrder α} {Q : MeetOrder β} + (i : MeetEmbedding P Q) (c e K : α) (F : α → Prop) + (nonempty_F : ∃ f, F f) + (old_profile : Profile P c e K F) + (e_not_le_K : ¬ P.le e K) + (extension : PermittedExtension i) : + ProfileOver i c e K F := by + intro x above_e + cases extension x with + | inl old => + cases old with + | intro a ha => + cases ha + have e_le_a : P.le e a := (i.le_iff e a).mp above_e + have positives : PositiveOver i F (i.toFun a) ↔ Positive P F a := by + constructor + · intro hp + cases hp with + | intro f hf => exact ⟨f, hf.left, (i.le_iff f a).mp hf.right⟩ + · intro hp + cases hp with + | intro f hf => exact ⟨f, hf.left, (i.le_iff f a).mpr hf.right⟩ + have inherited := old_profile a e_le_a + constructor + · intro hp + exact (i.le_iff K a).mpr (inherited.left (positives.mp hp)) + · intro hn + have hn_old : ¬ Positive P F a := fun hp => hn (positives.mpr hp) + calc + Q.meet (i.toFun K) (i.toFun a) = i.toFun (P.meet K a) := + (i.map_meet K a).symm + _ = i.toFun c := congrArg i.toFun (inherited.right hn_old) + | inr fresh => + cases fresh with + | inl shadow => + exact profile_at_shadow i c e K F old_profile e_not_le_K x above_e shadow + | inr top => + constructor + · intro _ + exact top (i.toFun K) + · intro hn + cases nonempty_F with + | intro f hf => exact False.elim (hn ⟨f, hf, top (i.toFun f)⟩) + +def NodeProfile {α : Type u} (P : MeetOrder α) (c K : α) + (F : α → Prop) (x : α) : Prop := + (Positive P F x → P.le K x) ∧ + (¬ Positive P F x → P.meet K x = c) + +def ProfileOn {α : Type u} (P : MeetOrder α) (c e K : α) + (F S : α → Prop) : Prop := + ∀ x, S x → P.le e x → NodeProfile P c K F x + +def ShadowIn {α : Type u} (P : MeetOrder α) (Old : α → Prop) + (x l : α) : Prop := + Old l ∧ + (∀ a, Old a → (P.le a x ↔ P.le a l)) ∧ + (∀ a, Old a → ¬ P.le x a → P.meet x a = P.meet l a) + +def GreatestIn {α : Type u} (P : MeetOrder α) (S : α → Prop) (x : α) : Prop := + ∀ y, S y → P.le y x + +def ContainsAnchors {α : Type u} (S : α → Prop) (e K : α) (F : α → Prop) : Prop := + S e ∧ S K ∧ ∀ f, F f → S f + +theorem profile_on_shadow {α : Type u} (P : MeetOrder α) + (c e K : α) (F Old : α → Prop) + (anchors : ContainsAnchors Old e K F) + (old_profile : ProfileOn P c e K F Old) + (e_not_le_K : ¬ P.le e K) + (x l : α) (above_e : P.le e x) + (shadow : ShadowIn P Old x l) : NodeProfile P c K F x := by + have part := shadow.right.left + have shadow_meet := shadow.right.right + have e_le_l : P.le e l := (part e anchors.left).mp above_e + have x_not_le_K : ¬ P.le x K := fun hx => e_not_le_K (P.trans above_e hx) + have positives : Positive P F x ↔ Positive P F l := by + constructor + · intro hp + cases hp with + | intro f hf => + exact ⟨f, hf.left, (part f (anchors.right.right f hf.left)).mp hf.right⟩ + · intro hp + cases hp with + | intro f hf => + exact ⟨f, hf.left, (part f (anchors.right.right f hf.left)).mpr hf.right⟩ + have inherited := old_profile l shadow.left e_le_l + constructor + · intro hp + exact (part K anchors.right.left).mpr (inherited.left (positives.mp hp)) + · intro hn + have hn_old : ¬ Positive P F l := fun hp => hn (positives.mpr hp) + calc + P.meet K x = P.meet x K := meet_comm P _ _ + _ = P.meet l K := shadow_meet K anchors.right.left x_not_le_K + _ = P.meet K l := meet_comm P _ _ + _ = c := inherited.right hn_old + +def SuccessorNodes {α : Type u} (P : MeetOrder α) (Old Current : α → Prop) : Prop := + ∀ x, Current x → + Old x ∨ (∃ l, ShadowIn P Old x l) ∨ GreatestIn P Current x + +def StageCases {α : Type u} {I : Type v} (P : MeetOrder α) + (earlier : I → I → Prop) (Initial : α → Prop) (stage : I → α → Prop) + (i : I) : Prop := + (∀ x, stage i x → Initial x) ∨ + (∃ j, earlier j i ∧ SuccessorNodes P (stage j) (stage i)) ∨ + (∀ x, stage i x → ∃ j, earlier j i ∧ stage j x) + +theorem profile_at_every_stage {α : Type u} {I : Type v} + (P : MeetOrder α) (c e K : α) (F Initial : α → Prop) + (earlier : I → I → Prop) (wf : WellFounded earlier) + (stage : I → α → Prop) + (nonempty_F : ∃ f, F f) + (e_not_le_K : ¬ P.le e K) + (initial_profile : ProfileOn P c e K F Initial) + (anchors : ∀ i, ContainsAnchors (stage i) e K F) + (cases_at : ∀ i, StageCases P earlier Initial stage i) : + ∀ i, ProfileOn P c e K F (stage i) := by + intro i + apply wf.induction i + intro current ih + intro x hx above_e + cases cases_at current with + | inl initial => + exact initial_profile x (initial x hx) above_e + | inr growth => + cases growth with + | inl successor => + cases successor with + | intro old h => + have old_profile := ih old h.left + cases h.right x hx with + | inl old_node => exact old_profile x old_node above_e + | inr new_node => + cases new_node with + | inl has_shadow => + cases has_shadow with + | intro l shadow => + exact profile_on_shadow P c e K F (stage old) (anchors old) + old_profile e_not_le_K x l above_e shadow + | inr top => + constructor + · intro _ + exact top K (anchors current).right.left + · intro hn + cases nonempty_F with + | intro f hf => + exact False.elim (hn ⟨f, hf, top f ((anchors current).right.right f hf)⟩) + | inr limit => + cases limit x hx with + | intro old h => exact ih old h.left x h.right above_e + +theorem profile_persists_through_growth {α : Type u} {I : Type v} + (P : MeetOrder α) (c e K : α) (F Initial : α → Prop) + (earlier : I → I → Prop) (wf : WellFounded earlier) + (stage : I → α → Prop) + (nonempty_F : ∃ f, F f) + (e_not_le_K : ¬ P.le e K) + (initial_profile : ProfileOn P c e K F Initial) + (anchors : ∀ i, ContainsAnchors (stage i) e K F) + (cases_at : ∀ i, StageCases P earlier Initial stage i) + (covers : ∀ x, ∃ i, stage i x) : + Profile P c e K F := by + have at_stage := profile_at_every_stage P c e K F Initial earlier wf stage + nonempty_F e_not_le_K initial_profile anchors cases_at + intro x above_e + cases covers x with + | intro i hi => exact at_stage i x hi above_e + +end + + + +namespace Attachment + +universe u v w + +structure Data {O : Type u} (P : MeetOrder O) (N : Type v) (I : Type w) where + component : N → I + base : I → O + upper : I → O → Prop + upper_up : ∀ i {a b}, upper i a → P.le a b → upper i b + upper_meet : ∀ i {a b}, upper i a → upper i b → upper i (P.meet a b) + base_le_upper : ∀ i a, upper i a → P.le (base i) a + base_not_upper : ∀ i, ¬ upper i (base i) + shadow : N → O + shadow_le_base : ∀ x, P.le (shadow x) (base (component x)) + inside : N → N → Prop + inside_refl : ∀ x, inside x x + inside_trans : ∀ {x y z}, inside x y → inside y z → inside x z + inside_antisymm : ∀ {x y}, inside x y → inside y x → x = y + inside_component : ∀ {x y}, inside x y → component x = component y + inside_shadow : ∀ {x y}, inside x y → P.le (shadow x) (shadow y) + +variable {O : Type u} {N : Type v} {I : Type w} {P : MeetOrder O} + +def FreshLe (d : Data P N I) (x y : N) : Prop := + d.inside x y ∨ d.upper (d.component x) (d.shadow y) + +def Le (d : Data P N I) : O ⊕ N → O ⊕ N → Prop + | .inl a, .inl b => P.le a b + | .inl a, .inr y => P.le a (d.shadow y) + | .inr x, .inl b => d.upper (d.component x) b + | .inr x, .inr y => FreshLe d x y + +theorem not_upper_shadow (d : Data P N I) (x : N) : + ¬ d.upper (d.component x) (d.shadow x) := by + intro h + exact d.base_not_upper _ (d.upper_up _ h (d.shadow_le_base x)) + +theorem fresh_shadow_mono (d : Data P N I) {x y : N} + (h : FreshLe d x y) : P.le (d.shadow x) (d.shadow y) := by + cases h with + | inl h => exact d.inside_shadow h + | inr h => exact P.trans (d.shadow_le_base x) (d.base_le_upper _ _ h) + +theorem fresh_trans (d : Data P N I) {x y z : N} + (hxy : FreshLe d x y) (hyz : FreshLe d y z) : FreshLe d x z := by + cases hxy with + | inl hxy => + cases hyz with + | inl hyz => exact Or.inl (d.inside_trans hxy hyz) + | inr hyz => + exact Or.inr ((d.inside_component hxy).symm ▸ hyz) + | inr hxy => exact Or.inr (d.upper_up _ hxy (fresh_shadow_mono d hyz)) + +theorem fresh_antisymm (d : Data P N I) {x y : N} + (hxy : FreshLe d x y) (hyx : FreshLe d y x) : x = y := by + cases hxy with + | inl hxy => + cases hyx with + | inl hyx => exact d.inside_antisymm hxy hyx + | inr hyx => + exact False.elim (not_upper_shadow d x ((d.inside_component hxy).symm ▸ hyx)) + | inr hxy => + exact False.elim (not_upper_shadow d x (d.upper_up _ hxy (fresh_shadow_mono d hyx))) + +theorem le_refl (d : Data P N I) (x : O ⊕ N) : Le d x x := by + cases x with + | inl a => exact P.refl a + | inr x => exact Or.inl (d.inside_refl x) + +theorem le_trans (d : Data P N I) {x y z : O ⊕ N} + (hxy : Le d x y) (hyz : Le d y z) : Le d x z := by + cases x with + | inl a => + cases y with + | inl b => + cases z with + | inl c => exact P.trans hxy hyz + | inr z => exact P.trans hxy hyz + | inr y => + cases z with + | inl c => exact P.trans hxy (P.trans (d.shadow_le_base y) (d.base_le_upper _ _ hyz)) + | inr z => exact P.trans hxy (fresh_shadow_mono d hyz) + | inr x => + cases y with + | inl b => + cases z with + | inl c => exact d.upper_up _ hxy hyz + | inr z => exact Or.inr (d.upper_up _ hxy hyz) + | inr y => + cases z with + | inl c => + cases hxy with + | inl hxy => + change d.upper (d.component x) c + exact (d.inside_component hxy).symm ▸ hyz + | inr hxy => + exact d.upper_up _ hxy (P.trans (d.shadow_le_base y) (d.base_le_upper _ _ hyz)) + | inr z => exact fresh_trans d hxy hyz + +theorem le_antisymm (d : Data P N I) {x y : O ⊕ N} + (hxy : Le d x y) (hyx : Le d y x) : x = y := by + cases x with + | inl a => + cases y with + | inl b => exact congrArg Sum.inl (P.antisymm hxy hyx) + | inr y => exact False.elim (not_upper_shadow d y (d.upper_up _ hyx hxy)) + | inr x => + cases y with + | inl b => exact False.elim (not_upper_shadow d x (d.upper_up _ hxy hyx)) + | inr y => exact congrArg Sum.inr (fresh_antisymm d hxy hyx) + +theorem fresh_same_component (d : Data P N I) {x y : N} + (same : d.component x = d.component y) : + FreshLe d x y ↔ d.inside x y := by + constructor + · intro h + cases h with + | inl h => exact h + | inr h => exact False.elim (not_upper_shadow d y (same ▸ h)) + · exact Or.inl + +theorem fresh_different_components (d : Data P N I) {x y : N} + (different : d.component x ≠ d.component y) : + FreshLe d x y ↔ d.upper (d.component x) (d.shadow y) := by + constructor + · intro h + cases h with + | inl h => exact False.elim (different (d.inside_component h)) + | inr h => exact h + · exact Or.inr + +def IsMeet (d : Data P N I) (a b m : O ⊕ N) : Prop := + Le d m a ∧ Le d m b ∧ ∀ t, Le d t a → Le d t b → Le d t m + +theorem old_meet (d : Data P N I) (a b : O) : + IsMeet d (.inl a) (.inl b) (.inl (P.meet a b)) := by + refine ⟨P.meet_le_left a b, P.meet_le_right a b, ?_⟩ + intro t hta htb + cases t with + | inl c => exact P.le_meet hta htb + | inr x => exact d.upper_meet _ hta htb + +theorem shadow_meet (d : Data P N I) (x : N) (a : O) + (not_above : ¬ d.upper (d.component x) a) : + IsMeet d (.inr x) (.inl a) (.inl (P.meet (d.shadow x) a)) := by + refine ⟨P.meet_le_left _ _, P.meet_le_right _ _, ?_⟩ + intro t htx hta + cases t with + | inl b => exact P.le_meet htx hta + | inr y => + cases htx with + | inl inside => exact False.elim (not_above (d.inside_component inside ▸ hta)) + | inr mediated => exact d.upper_meet _ mediated hta + +theorem cross_meet (d : Data P N I) (x z : N) + (different : d.component x ≠ d.component z) + (not_xz : ¬ FreshLe d x z) (not_zx : ¬ FreshLe d z x) : + IsMeet d (.inr x) (.inr z) (.inl (P.meet (d.shadow x) (d.shadow z))) := by + refine ⟨P.meet_le_left _ _, P.meet_le_right _ _, ?_⟩ + intro t htx htz + cases t with + | inl b => exact P.le_meet htx htz + | inr y => + cases htx with + | inl hyx => + cases htz with + | inl hyz => + exact False.elim (different ((d.inside_component hyx).symm.trans (d.inside_component hyz))) + | inr hyz => exact False.elim (not_xz (Or.inr (d.inside_component hyx ▸ hyz))) + | inr hyx => + cases htz with + | inl hyz => exact False.elim (not_zx (Or.inr (d.inside_component hyz ▸ hyx))) + | inr hyz => exact d.upper_meet _ hyx hyz + +def ComponentMeets (d : Data P N I) : Prop := + ∀ x z, d.component x = d.component z → + (∃ m, d.inside m x ∧ d.inside m z ∧ + (∀ y, d.inside y x → d.inside y z → d.inside y m) ∧ + d.shadow m = P.meet (d.shadow x) (d.shadow z)) ∨ + (∀ y, d.inside y x → d.inside y z → False) + +theorem inside_mediated_impossible (d : Data P N I) {y x z : N} + (inside : d.inside y x) (same : d.component x = d.component z) + (mediated : d.upper (d.component y) (d.shadow z)) : False := by + exact not_upper_shadow d z ((d.inside_component inside).trans same ▸ mediated) + +theorem component_fresh_meet (d : Data P N I) (x z m : N) + (same : d.component x = d.component z) + (hmx : d.inside m x) (hmz : d.inside m z) + (greatest : ∀ y, d.inside y x → d.inside y z → d.inside y m) + (shadows : d.shadow m = P.meet (d.shadow x) (d.shadow z)) : + IsMeet d (.inr x) (.inr z) (.inr m) := by + refine ⟨Or.inl hmx, Or.inl hmz, ?_⟩ + intro t htx htz + cases t with + | inl a => + change P.le a (d.shadow m) + rw [shadows] + exact P.le_meet htx htz + | inr y => + cases htx with + | inl hyx => + cases htz with + | inl hyz => exact Or.inl (greatest y hyx hyz) + | inr hyz => exact False.elim (inside_mediated_impossible d hyx same hyz) + | inr hyx => + cases htz with + | inl hyz => exact False.elim (inside_mediated_impossible d hyz same.symm hyx) + | inr hyz => + apply Or.inr + rw [shadows] + exact d.upper_meet _ hyx hyz + +theorem component_old_meet (d : Data P N I) (x z : N) + (same : d.component x = d.component z) + (no_new_lower : ∀ y, d.inside y x → d.inside y z → False) : + IsMeet d (.inr x) (.inr z) (.inl (P.meet (d.shadow x) (d.shadow z))) := by + refine ⟨P.meet_le_left _ _, P.meet_le_right _ _, ?_⟩ + intro t htx htz + cases t with + | inl a => exact P.le_meet htx htz + | inr y => + cases htx with + | inl hyx => + cases htz with + | inl hyz => exact False.elim (no_new_lower y hyx hyz) + | inr hyz => exact False.elim (inside_mediated_impossible d hyx same hyz) + | inr hyx => + cases htz with + | inl hyz => exact False.elim (inside_mediated_impossible d hyz same.symm hyx) + | inr hyz => exact d.upper_meet _ hyx hyz + +theorem meet_of_le (d : Data P N I) {a b : O ⊕ N} (h : Le d a b) : + IsMeet d a b a := ⟨le_refl d a, h, fun _ hta _ => hta⟩ + +theorem meet_symm (d : Data P N I) {a b m : O ⊕ N} + (h : IsMeet d a b m) : IsMeet d b a m := + ⟨h.right.left, h.left, fun t htb hta => h.right.right t hta htb⟩ + +theorem all_meets (d : Data P N I) (local_meets : ComponentMeets d) + (a b : O ⊕ N) : ∃ m, IsMeet d a b m := by + classical + cases a with + | inl a => + cases b with + | inl b => exact ⟨_, old_meet d a b⟩ + | inr y => + by_cases h : d.upper (d.component y) a + · exact ⟨_, meet_symm d (meet_of_le d h)⟩ + · exact ⟨_, meet_symm d (shadow_meet d y a h)⟩ + | inr x => + cases b with + | inl b => + by_cases h : d.upper (d.component x) b + · exact ⟨_, meet_of_le d h⟩ + · exact ⟨_, shadow_meet d x b h⟩ + | inr z => + by_cases same : d.component x = d.component z + · cases local_meets x z same with + | inl fresh => + rcases fresh with ⟨m, hmx, hmz, greatest, shadows⟩ + exact ⟨_, component_fresh_meet d x z m same hmx hmz greatest shadows⟩ + | inr old => exact ⟨_, component_old_meet d x z same old⟩ + · by_cases h : FreshLe d x z + · exact ⟨_, meet_of_le d h⟩ + · by_cases h' : FreshLe d z x + · exact ⟨_, meet_symm d (meet_of_le d h')⟩ + · exact ⟨_, cross_meet d x z same h h'⟩ + +noncomputable def meetOrder (d : Data P N I) (local_meets : ComponentMeets d) : + MeetOrder (O ⊕ N) where + le := Le d + meet a b := Classical.choose (all_meets d local_meets a b) + refl := le_refl d + trans := le_trans d + antisymm := le_antisymm d + meet_le_left a b := (Classical.choose_spec (all_meets d local_meets a b)).left + meet_le_right a b := (Classical.choose_spec (all_meets d local_meets a b)).right.left + le_meet hab hac := (Classical.choose_spec (all_meets d local_meets _ _)).right.right _ hab hac + +theorem meet_eq (d : Data P N I) (local_meets : ComponentMeets d) + {a b m : O ⊕ N} (h : IsMeet d a b m) : + (meetOrder d local_meets).meet a b = m := by + let Q := meetOrder d local_meets + apply le_antisymm d + · exact h.right.right _ (Q.meet_le_left a b) (Q.meet_le_right a b) + · exact Q.le_meet h.left h.right.left + +noncomputable def oldEmbedding (d : Data P N I) (local_meets : ComponentMeets d) : + MeetEmbedding P (meetOrder d local_meets) where + toFun := Sum.inl + le_iff _ _ := Iff.rfl + map_meet a b := (meet_eq d local_meets (old_meet d a b)).symm + +theorem has_old_shadow (d : Data P N I) (local_meets : ComponentMeets d) (x : N) : + HasOldShadow (oldEmbedding d local_meets) (.inr x) := by + refine ⟨d.shadow x, fun _ => Iff.rfl, ?_⟩ + intro a h + exact meet_eq d local_meets (shadow_meet d x a h) + +theorem permitted_extension (d : Data P N I) (local_meets : ComponentMeets d) : + PermittedExtension (oldEmbedding d local_meets) := by + intro x + cases x with + | inl a => exact Or.inl ⟨a, rfl⟩ + | inr x => exact Or.inr (Or.inl (has_old_shadow d local_meets x)) + +theorem attachment_preserves_profile (d : Data P N I) (local_meets : ComponentMeets d) + (c e K : O) (F : O → Prop) (nonempty_F : ∃ f, F f) + (old_profile : Profile P c e K F) (e_not_le_K : ¬ P.le e K) : + ProfileOver (oldEmbedding d local_meets) c e K F := + profile_persists_one_step (oldEmbedding d local_meets) c e K F + nonempty_F old_profile e_not_le_K (permitted_extension d local_meets) + +end Attachment + + + +namespace Attachment + +universe u v w + +def idealOrder {A : Type v} (Q : MeetOrder A) (a : A) : + MeetOrder {x : A // Q.le x a} where + le x y := Q.le x.val y.val + meet x y := ⟨Q.meet x.val y.val, Q.trans (Q.meet_le_left _ _) x.property⟩ + refl x := Q.refl x.val + trans hxy hyz := Q.trans hxy hyz + antisymm hxy hyx := Subtype.ext (Q.antisymm hxy hyx) + meet_le_left x y := Q.meet_le_left x.val y.val + meet_le_right x y := Q.meet_le_right x.val y.val + le_meet hxy hxz := Q.le_meet hxy hxz + +def cut {A : Type v} (Q : MeetOrder A) (a x : A) : {y : A // Q.le y a} := + ⟨Q.meet x a, Q.meet_le_right x a⟩ + +theorem cut_mono {A : Type v} (Q : MeetOrder A) (a : A) {x y : A} + (h : Q.le x y) : (idealOrder Q a).le (cut Q a x) (cut Q a y) := + Q.le_meet (Q.trans (Q.meet_le_left x a) h) (Q.meet_le_right x a) + +theorem cut_meet {A : Type v} (Q : MeetOrder A) (a x y : A) : + cut Q a (Q.meet x y) = (idealOrder Q a).meet (cut Q a x) (cut Q a y) := by + apply Subtype.ext + change Q.meet (Q.meet x y) a = Q.meet (Q.meet x a) (Q.meet y a) + apply Q.antisymm + · apply Q.le_meet + · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_left x y)) (Q.meet_le_right _ _) + · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_right x y)) (Q.meet_le_right _ _) + · apply Q.le_meet + · exact Q.le_meet (Q.trans (Q.meet_le_left _ _) (Q.meet_le_left x a)) + (Q.trans (Q.meet_le_right _ _) (Q.meet_le_left y a)) + · exact Q.trans (Q.meet_le_left _ _) (Q.meet_le_right x a) + +theorem cut_of_le {A : Type v} (Q : MeetOrder A) (a x : A) (h : Q.le x a) : + cut Q a x = ⟨x, h⟩ := by + apply Subtype.ext + exact Q.antisymm (Q.meet_le_left x a) (Q.le_meet (Q.refl x) h) + +structure Templates {O : Type u} (P : MeetOrder O) (I : Type w) where + Space : I → Type v + order : ∀ i, MeetOrder (Space i) + anchor : ∀ i, Space i + embed : ∀ i, MeetEmbedding (idealOrder (order i) (anchor i)) P + upper : I → O → Prop + upper_nonempty : ∀ i, ∃ a, upper i a + upper_up : ∀ i {a b}, upper i a → P.le a b → upper i b + upper_meet : ∀ i {a b}, upper i a → upper i b → upper i (P.meet a b) + separator : I → O + base_le_separator : ∀ i, + P.le ((embed i).toFun ⟨anchor i, (order i).refl _⟩) (separator i) + separator_not_le_base : ∀ i, + ¬ P.le (separator i) ((embed i).toFun ⟨anchor i, (order i).refl _⟩) + separator_le_upper : ∀ i a, upper i a → P.le (separator i) a + +namespace Templates + +variable {O : Type u} {I : Type w} {P : MeetOrder O} (b : Templates.{u,v,w} P I) + +def Fresh := (i : I) × {y : b.Space i // ¬ (b.order i).le y (b.anchor i)} + +def base (i : I) : O := (b.embed i).toFun ⟨b.anchor i, (b.order i).refl _⟩ + +def shadow (x : b.Fresh) : O := (b.embed x.1).toFun (cut (b.order x.1) (b.anchor x.1) x.2.val) + +def Inside (x y : b.Fresh) : Prop := + ∃ h : x.1 = y.1, (b.order x.1).le x.2.val (h.symm ▸ y.2.val) + +theorem inside_refl (x : b.Fresh) : b.Inside x x := ⟨rfl, (b.order x.1).refl x.2.val⟩ + +theorem inside_trans {x y z : b.Fresh} (hxy : b.Inside x y) (hyz : b.Inside y z) : + b.Inside x z := by + rcases x with ⟨i, x⟩ + rcases y with ⟨j, y⟩ + rcases z with ⟨k, z⟩ + rcases hxy with ⟨hij, hxy⟩ + cases hij + rcases hyz with ⟨hjk, hyz⟩ + cases hjk + exact ⟨rfl, (b.order i).trans hxy hyz⟩ + +theorem inside_antisymm {x y : b.Fresh} (hxy : b.Inside x y) (hyx : b.Inside y x) : + x = y := by + rcases x with ⟨i, x⟩ + rcases y with ⟨j, y⟩ + rcases hxy with ⟨hij, hxy⟩ + cases hij + rcases hyx with ⟨hii, hyx⟩ + cases hii + exact congrArg (Sigma.mk i) (Subtype.ext ((b.order i).antisymm hxy hyx)) + +theorem inside_shadow {x y : b.Fresh} (hxy : b.Inside x y) : + P.le (b.shadow x) (b.shadow y) := by + rcases x with ⟨i, x⟩ + rcases y with ⟨j, y⟩ + rcases hxy with ⟨hij, hxy⟩ + cases hij + exact ((b.embed i).le_iff _ _).mpr (cut_mono (b.order i) (b.anchor i) hxy) + +def data : Data P b.Fresh I where + component := Sigma.fst + base := b.base + upper := b.upper + upper_up := b.upper_up + upper_meet := b.upper_meet + base_le_upper i a h := P.trans (b.base_le_separator i) (b.separator_le_upper i a h) + base_not_upper i h := b.separator_not_le_base i (b.separator_le_upper i (b.base i) h) + shadow := b.shadow + shadow_le_base x := ((b.embed x.1).le_iff _ _).mpr ((b.order x.1).meet_le_right _ _) + inside := b.Inside + inside_refl := b.inside_refl + inside_trans := b.inside_trans + inside_antisymm := b.inside_antisymm + inside_component h := h.choose + inside_shadow := b.inside_shadow + +theorem mapped_cut_meet (i : I) (x y : b.Space i) : + (b.embed i).toFun (cut (b.order i) (b.anchor i) ((b.order i).meet x y)) = + P.meet ((b.embed i).toFun (cut (b.order i) (b.anchor i) x)) + ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) := by + rw [cut_meet] + exact (b.embed i).map_meet _ _ + +theorem component_meets : ComponentMeets b.data := by + classical + intro x z same + rcases x with ⟨i, x⟩ + rcases z with ⟨j, z⟩ + change i = j at same + cases same + by_cases old : (b.order i).le ((b.order i).meet x.val z.val) (b.anchor i) + · apply Or.inr + intro y hyx hyz + rcases y with ⟨k, y⟩ + rcases hyx with ⟨hki, hyx⟩ + cases hki + rcases hyz with ⟨hkk, hyz⟩ + cases hkk + exact y.property ((b.order i).trans ((b.order i).le_meet hyx hyz) old) + · apply Or.inl + let m : b.Fresh := ⟨i, ⟨(b.order i).meet x.val z.val, old⟩⟩ + refine ⟨m, ⟨rfl, (b.order i).meet_le_left _ _⟩, ⟨rfl, (b.order i).meet_le_right _ _⟩, ?_, ?_⟩ + · intro y hyx hyz + rcases y with ⟨k, y⟩ + rcases hyx with ⟨hki, hyx⟩ + cases hki + rcases hyz with ⟨hkk, hyz⟩ + cases hkk + exact ⟨rfl, (b.order i).le_meet hyx hyz⟩ + · exact b.mapped_cut_meet i x.val z.val + +noncomputable def extension : MeetOrder (O ⊕ b.Fresh) := meetOrder b.data b.component_meets + +noncomputable def oldEmbedding : MeetEmbedding P b.extension := + Attachment.oldEmbedding b.data b.component_meets + +theorem shadow_verified (x : b.Fresh) : HasOldShadow b.oldEmbedding (.inr x) := + has_old_shadow b.data b.component_meets x + +theorem persistence (c e K : O) (F : O → Prop) (nonempty_F : ∃ f, F f) + (old_profile : Profile P c e K F) (e_not_le_K : ¬ P.le e K) : + ProfileOver b.oldEmbedding c e K F := + attachment_preserves_profile b.data b.component_meets c e K F nonempty_F old_profile e_not_le_K + +noncomputable def represent (i : I) (y : b.Space i) : O ⊕ b.Fresh := by + classical + exact if h : (b.order i).le y (b.anchor i) then + .inl ((b.embed i).toFun ⟨y, h⟩) + else .inr ⟨i, ⟨y, h⟩⟩ + +theorem represent_old (i : I) (y : b.Space i) (h : (b.order i).le y (b.anchor i)) : + b.represent i y = .inl ((b.embed i).toFun ⟨y, h⟩) := by + simp only [represent, dite_eq_left h] + +theorem represent_new (i : I) (y : b.Space i) (h : ¬ (b.order i).le y (b.anchor i)) : + b.represent i y = .inr ⟨i, ⟨y, h⟩⟩ := by + simp only [represent, dite_eq_right h] + +theorem represent_le_iff (i : I) (x y : b.Space i) : + Le b.data (b.represent i x) (b.represent i y) ↔ (b.order i).le x y := by + classical + by_cases hx : (b.order i).le x (b.anchor i) + · rw [b.represent_old i x hx] + by_cases hy : (b.order i).le y (b.anchor i) + · rw [b.represent_old i y hy] + exact (b.embed i).le_iff _ _ + · rw [b.represent_new i y hy] + change P.le ((b.embed i).toFun ⟨x, hx⟩) + ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) ↔ _ + rw [(b.embed i).le_iff] + constructor + · intro h + exact (b.order i).trans h ((b.order i).meet_le_left y (b.anchor i)) + · intro h + exact (b.order i).le_meet h hx + · rw [b.represent_new i x hx] + by_cases hy : (b.order i).le y (b.anchor i) + · rw [b.represent_old i y hy] + constructor + · intro h + have hbase : P.le ((b.embed i).toFun ⟨y, hy⟩) (b.base i) := + ((b.embed i).le_iff _ _).mpr hy + exact False.elim (b.data.base_not_upper i (b.upper_up i h hbase)) + · intro h + exact False.elim (hx ((b.order i).trans h hy)) + · rw [b.represent_new i y hy] + change FreshLe b.data ⟨i, ⟨x, hx⟩⟩ ⟨i, ⟨y, hy⟩⟩ ↔ _ + rw [fresh_same_component b.data (x := ⟨i, ⟨x, hx⟩⟩) (y := ⟨i, ⟨y, hy⟩⟩) rfl] + constructor + · rintro ⟨h, hxy⟩ + cases h + exact hxy + · intro hxy + exact ⟨rfl, hxy⟩ + +theorem old_below_represent (i : I) (y : b.Space i) (a : O) : + Le b.data (.inl a) (b.represent i y) ↔ + P.le a ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) := by + classical + by_cases hy : (b.order i).le y (b.anchor i) + · rw [b.represent_old i y hy, cut_of_le _ _ _ hy] + exact Iff.rfl + · rw [b.represent_new i y hy] + exact Iff.rfl + +theorem upper_shadow_below_represent (i : I) (y : b.Space i) (x : b.Fresh) + (h : b.upper x.1 ((b.embed i).toFun (cut (b.order i) (b.anchor i) y))) : + Le b.data (.inr x) (b.represent i y) := by + classical + by_cases hy : (b.order i).le y (b.anchor i) + · rw [b.represent_old i y hy] + rw [cut_of_le _ _ _ hy] at h + exact h + · rw [b.represent_new i y hy] + exact Or.inr h + +theorem foreign_below_represent (i : I) (y : b.Space i) (x : b.Fresh) + (different : x.1 ≠ i) + (h : Le b.data (.inr x) (b.represent i y)) : + b.upper x.1 ((b.embed i).toFun (cut (b.order i) (b.anchor i) y)) := by + classical + by_cases hy : (b.order i).le y (b.anchor i) + · rw [b.represent_old i y hy] at h + rw [cut_of_le _ _ _ hy] + exact h + · rw [b.represent_new i y hy] at h + exact (fresh_different_components b.data (x := x) (y := ⟨i, ⟨y, hy⟩⟩) different).mp h + +theorem represented_meet (i : I) (x z : b.Space i) : + IsMeet b.data (b.represent i x) (b.represent i z) + (b.represent i ((b.order i).meet x z)) := by + classical + refine ⟨(b.represent_le_iff i _ _).mpr ((b.order i).meet_le_left x z), + (b.represent_le_iff i _ _).mpr ((b.order i).meet_le_right x z), ?_⟩ + intro t htx htz + cases t with + | inl a => + apply (b.old_below_represent i _ a).mpr + rw [b.mapped_cut_meet] + exact P.le_meet ((b.old_below_represent i x a).mp htx) + ((b.old_below_represent i z a).mp htz) + | inr y => + rcases y with ⟨j, y⟩ + by_cases same : j = i + · cases same + have repr_y := b.represent_new i y.val y.property + rw [← repr_y] at htx htz ⊢ + apply (b.represent_le_iff i _ _).mpr + exact (b.order i).le_meet ((b.represent_le_iff i _ _).mp htx) + ((b.represent_le_iff i _ _).mp htz) + · apply b.upper_shadow_below_represent + rw [b.mapped_cut_meet] + exact b.upper_meet j (b.foreign_below_represent i x ⟨j, y⟩ same htx) + (b.foreign_below_represent i z ⟨j, y⟩ same htz) + +noncomputable def templateEmbedding (i : I) : MeetEmbedding (b.order i) b.extension where + toFun := b.represent i + le_iff := b.represent_le_iff i + map_meet x z := (meet_eq b.data b.component_meets (b.represented_meet i x z)).symm + +theorem template_agrees_on_base (i : I) (y : b.Space i) + (hy : (b.order i).le y (b.anchor i)) : + (b.templateEmbedding i).toFun y = .inl ((b.embed i).toFun ⟨y, hy⟩) := + b.represent_old i y hy + +theorem greatest_preserved (T : O) (top : ∀ a, P.le a T) : + ∀ x, b.extension.le x (.inl T) := by + intro x + cases x with + | inl a => exact top a + | inr x => + rcases b.upper_nonempty x.1 with ⟨a, ha⟩ + exact b.upper_up x.1 ha (top a) + +theorem least_preserved (zero : O) (bottom : ∀ a, P.le zero a) : + ∀ x, b.extension.le (.inl zero) x := by + intro x + cases x with + | inl a => exact bottom a + | inr x => exact bottom (b.shadow x) + +theorem cross_meet_eq (x z : b.Fresh) (different : x.1 ≠ z.1) + (not_xz : ¬ b.extension.le (.inr x) (.inr z)) + (not_zx : ¬ b.extension.le (.inr z) (.inr x)) : + b.extension.meet (.inr x) (.inr z) = .inl (P.meet (b.shadow x) (b.shadow z)) := + meet_eq b.data b.component_meets (cross_meet b.data x z different not_xz not_zx) + +theorem old_lower_iff (a : O) (x : b.Fresh) : + b.extension.le (.inl a) (.inr x) ↔ P.le a (b.shadow x) := Iff.rfl + +theorem old_upper_iff (a : O) (x : b.Fresh) : + b.extension.le (.inr x) (.inl a) ↔ b.upper x.1 a := Iff.rfl + +theorem cross_le_iff (x z : b.Fresh) (different : x.1 ≠ z.1) : + b.extension.le (.inr x) (.inr z) ↔ b.upper x.1 (b.shadow z) := + fresh_different_components b.data (x := x) (y := z) different + +theorem shadow_meet_eq (x : b.Fresh) (a : O) + (not_above : ¬ b.extension.le (.inr x) (.inl a)) : + b.extension.meet (.inr x) (.inl a) = .inl (P.meet (b.shadow x) a) := + meet_eq b.data b.component_meets (shadow_meet b.data x a not_above) + +theorem template_preserves_zero (i : I) (qzero : b.Space i) (zero : O) + (qbottom : ∀ y, (b.order i).le qzero y) + (base_zero : (b.embed i).toFun ⟨qzero, qbottom (b.anchor i)⟩ = zero) : + (b.templateEmbedding i).toFun qzero = .inl zero := by + rw [b.template_agrees_on_base i qzero (qbottom (b.anchor i)), base_zero] + +end Templates +end Attachment + + + + +universe u v w + +theorem meet_eq_left_of_le {A : Type u} (P : MeetOrder A) {x y : A} + (h : P.le x y) : P.meet x y = x := + P.antisymm (P.meet_le_left x y) (P.le_meet (P.refl x) h) + +namespace Attachment.Templates + +variable {O : Type u} {I : Type w} {P : MeetOrder O} (b : Templates.{u,v,w} P I) + +def originalFamily (i : I) : O ⊕ b.Fresh → Prop + | .inl a => b.upper i a + | .inr _ => False + +theorem positive_old_iff (i : I) (a : O) : + Positive b.extension (b.originalFamily i) (.inl a) ↔ b.upper i a := by + constructor + · rintro ⟨f, hf, hfa⟩ + cases f with + | inl f => exact b.upper_up i hf hfa + | inr f => exact False.elim hf + · intro ha + exact ⟨.inl a, ha, P.refl a⟩ + +theorem positive_new_iff (i : I) (x : b.Fresh) : + Positive b.extension (b.originalFamily i) (.inr x) ↔ b.upper i (b.shadow x) := by + constructor + · rintro ⟨f, hf, hfx⟩ + cases f with + | inl f => exact b.upper_up i hf hfx + | inr f => exact False.elim hf + · intro hx + exact ⟨.inl (b.shadow x), hx, P.refl _⟩ + +def cap (i : I) (t : b.Space i) (outside : ¬ (b.order i).le t (b.anchor i)) : b.Fresh := + ⟨i, ⟨t, outside⟩⟩ + +theorem cap_shadow (i : I) (t : b.Space i) + (top : ∀ y, (b.order i).le y t) + (outside : ¬ (b.order i).le t (b.anchor i)) : + b.shadow (b.cap i t outside) = b.base i := by + change (b.embed i).toFun (cut (b.order i) (b.anchor i) t) = _ + have hcut : cut (b.order i) (b.anchor i) t = + ⟨b.anchor i, (b.order i).refl _⟩ := by + apply Subtype.ext + exact (b.order i).antisymm ((b.order i).meet_le_right _ _) + ((b.order i).le_meet (top _) ((b.order i).refl _)) + exact congrArg (b.embed i).toFun hcut + +theorem cap_strict_above_base (i : I) (t : b.Space i) + (top : ∀ y, (b.order i).le y t) + (outside : ¬ (b.order i).le t (b.anchor i)) : + b.extension.le (.inl (b.base i)) (.inr (b.cap i t outside)) ∧ + ¬ b.extension.le (.inr (b.cap i t outside)) (.inl (b.base i)) := by + constructor + · change P.le (b.base i) (b.shadow (b.cap i t outside)) + rw [b.cap_shadow i t top outside] + exact P.refl _ + · exact b.data.base_not_upper i + +theorem separator_not_below_cap (i : I) (t : b.Space i) + (top : ∀ y, (b.order i).le y t) + (outside : ¬ (b.order i).le t (b.anchor i)) : + ¬ b.extension.le (.inl (b.separator i)) (.inr (b.cap i t outside)) := by + intro h + change P.le (b.separator i) (b.shadow (b.cap i t outside)) at h + rw [b.cap_shadow i t top outside] at h + exact b.separator_not_le_base i h + +theorem initial_profile (i : I) (t : b.Space i) + (top : ∀ y, (b.order i).le y t) + (outside : ¬ (b.order i).le t (b.anchor i)) : + Profile b.extension (.inl (b.base i)) (.inl (b.separator i)) + (.inr (b.cap i t outside)) (b.originalFamily i) := by + intro x above_e + cases x with + | inl a => + constructor + · intro hp + exact (b.positive_old_iff i a).mp hp + · intro hn + have not_upper : ¬ b.upper i a := fun ha => hn ((b.positive_old_iff i a).mpr ha) + calc + b.extension.meet (.inr (b.cap i t outside)) (.inl a) = + .inl (P.meet (b.shadow (b.cap i t outside)) a) := + b.shadow_meet_eq _ a not_upper + _ = .inl (P.meet (b.base i) a) := by rw [b.cap_shadow i t top outside] + _ = .inl (b.base i) := congrArg Sum.inl + (meet_eq_left_of_le P (P.trans (b.base_le_separator i) above_e)) + | inr x => + have different : i ≠ x.1 := by + intro same + have hs := b.data.shadow_le_base x + change P.le (b.shadow x) (b.base x.1) at hs + rw [← same] at hs + exact b.separator_not_le_base i (P.trans above_e hs) + have not_xk : ¬ b.extension.le (.inr x) (.inr (b.cap i t outside)) := by + intro h + exact b.separator_not_below_cap i t top outside (b.extension.trans above_e h) + constructor + · intro hp + exact (b.cross_le_iff _ x different).mpr ((b.positive_new_iff i x).mp hp) + · intro hn + have not_kx : ¬ b.extension.le (.inr (b.cap i t outside)) (.inr x) := by + intro h + exact hn ((b.positive_new_iff i x).mpr ((b.cross_le_iff _ x different).mp h)) + calc + b.extension.meet (.inr (b.cap i t outside)) (.inr x) = + .inl (P.meet (b.shadow (b.cap i t outside)) (b.shadow x)) := + b.cross_meet_eq _ x different not_kx not_xk + _ = .inl (P.meet (b.base i) (b.shadow x)) := by rw [b.cap_shadow i t top outside] + _ = .inl (b.base i) := congrArg Sum.inl + (meet_eq_left_of_le P (P.trans (b.base_le_separator i) above_e)) + +theorem cap_alternatives (i j : I) (different : i ≠ j) + (ti : b.Space i) (tj : b.Space j) + (top_i : ∀ y, (b.order i).le y ti) (top_j : ∀ y, (b.order j).le y tj) + (outside_i : ¬ (b.order i).le ti (b.anchor i)) + (outside_j : ¬ (b.order j).le tj (b.anchor j)) : + b.extension.le (.inr (b.cap i ti outside_i)) (.inl (b.base j)) ∨ + b.extension.le (.inr (b.cap j tj outside_j)) (.inl (b.base i)) ∨ + b.extension.meet (.inr (b.cap i ti outside_i)) (.inr (b.cap j tj outside_j)) = + b.extension.meet (.inl (b.base i)) (.inl (b.base j)) := by + classical + by_cases hij : b.extension.le (.inr (b.cap i ti outside_i)) (.inr (b.cap j tj outside_j)) + · apply Or.inl + have h := (b.cross_le_iff _ _ different).mp hij + rw [b.cap_shadow j tj top_j outside_j] at h + exact h + · apply Or.inr + by_cases hji : b.extension.le (.inr (b.cap j tj outside_j)) (.inr (b.cap i ti outside_i)) + · apply Or.inl + have h := (b.cross_le_iff _ _ (Ne.symm different)).mp hji + rw [b.cap_shadow i ti top_i outside_i] at h + exact h + · apply Or.inr + rw [b.cross_meet_eq _ _ different hij hji, + b.cap_shadow i ti top_i outside_i, b.cap_shadow j tj top_j outside_j] + exact b.oldEmbedding.map_meet _ _ + +theorem equal_base_caps_meet (i j : I) (different : i ≠ j) + (same_base : b.base i = b.base j) + (ti : b.Space i) (tj : b.Space j) + (top_i : ∀ y, (b.order i).le y ti) (top_j : ∀ y, (b.order j).le y tj) + (outside_i : ¬ (b.order i).le ti (b.anchor i)) + (outside_j : ¬ (b.order j).le tj (b.anchor j)) : + b.extension.meet (.inr (b.cap i ti outside_i)) (.inr (b.cap j tj outside_j)) = + .inl (b.base i) := by + have h := b.cap_alternatives i j different ti tj top_i top_j outside_i outside_j + cases h with + | inl h => + have h' : b.upper i (b.base j) := h + rw [← same_base] at h' + exact False.elim (b.data.base_not_upper i h') + | inr h => + cases h with + | inl h => + have h' : b.upper j (b.base i) := h + rw [same_base] at h' + exact False.elim (b.data.base_not_upper j h') + | inr h => + rw [← same_base] at h + exact h.trans (meet_eq_left_of_le b.extension (b.extension.refl _)) + +theorem initial_profile_persists {A : Type v} {Q : MeetOrder A} + (next : MeetEmbedding b.extension Q) (allowed : PermittedExtension next) + (i : I) (t : b.Space i) (top : ∀ y, (b.order i).le y t) + (outside : ¬ (b.order i).le t (b.anchor i)) : + ProfileOver next (.inl (b.base i)) (.inl (b.separator i)) + (.inr (b.cap i t outside)) (b.originalFamily i) := by + have family_nonempty : ∃ f, b.originalFamily i f := by + rcases b.upper_nonempty i with ⟨f, hf⟩ + exact ⟨.inl f, hf⟩ + exact profile_persists_one_step next _ _ _ _ family_nonempty + (b.initial_profile i t top outside) (b.separator_not_below_cap i t top outside) allowed + +end Attachment.Templates + +namespace Compression + +structure MeetFilter {A : Type u} (P : MeetOrder A) where + mem : A → Prop + nonempty : ∃ x, mem x + upward : ∀ {x y}, mem x → P.le x y → mem y + closed_meet : ∀ {x y}, mem x → mem y → mem (P.meet x y) + +def pushFilter {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} + (s : MeetEmbedding P Q) (F : MeetFilter P) : MeetFilter Q where + mem y := ∃ x, F.mem x ∧ Q.le (s.toFun x) y + nonempty := by + rcases F.nonempty with ⟨x, hx⟩ + exact ⟨s.toFun x, x, hx, Q.refl _⟩ + upward := by + rintro a b ⟨x, hx, hxa⟩ hab + exact ⟨x, hx, Q.trans hxa hab⟩ + closed_meet := by + rintro a b ⟨x, hx, hxa⟩ ⟨y, hy, hyb⟩ + refine ⟨P.meet x y, F.closed_meet hx hy, ?_⟩ + rw [s.map_meet] + exact Q.le_meet (Q.trans (Q.meet_le_left _ _) hxa) + (Q.trans (Q.meet_le_right _ _) hyb) + +theorem pushFilter_trace {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} + (s : MeetEmbedding P Q) (F : MeetFilter P) (x : A) : + (pushFilter s F).mem (s.toFun x) ↔ F.mem x := by + constructor + · rintro ⟨y, hy, hyx⟩ + exact F.upward hy ((s.le_iff y x).mp hyx) + · intro hx + exact ⟨x, hx, Q.refl _⟩ + +theorem pushFilter_lower_bound {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} + (s : MeetEmbedding P Q) (F : MeetFilter P) (e : A) + (lower : ∀ f, F.mem f → P.le e f) : + ∀ y, (pushFilter s F).mem y → Q.le (s.toFun e) y := by + rintro y ⟨f, hf, hfy⟩ + exact Q.trans ((s.le_iff e f).mpr (lower f hf)) hfy + +structure MeetIso {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) + extends MeetEmbedding P Q where + inverse : B → A + left_inverse : ∀ x, inverse (toFun x) = x + right_inverse : ∀ y, toFun (inverse y) = y + +theorem filter_image_from_slice {A : Type u} (P : MeetOrder A) (F : MeetFilter P) + (g : MeetIso P P) (v : A) (hv : F.mem v) (y : A) : + (∃ f, F.mem f ∧ g.toFun f = y) ↔ + (∃ x, F.mem x ∧ P.le x v ∧ P.le (g.toFun x) y) := by + constructor + · rintro ⟨f, hf, rfl⟩ + exact ⟨P.meet f v, F.closed_meet hf hv, P.meet_le_right f v, + (g.le_iff _ _).mpr (P.meet_le_left f v)⟩ + · rintro ⟨x, hx, _, hxy⟩ + have hxinv : P.le x (g.inverse y) := by + apply (g.le_iff _ _).mp + rw [g.right_inverse] + exact hxy + exact ⟨g.inverse y, F.upward hx hxinv, g.right_inverse y⟩ + +theorem filter_images_agree {A : Type u} (P : MeetOrder A) (F : MeetFilter P) + (g h : MeetIso P P) (v : A) (hv : F.mem v) + (agree : ∀ x, P.le x v → g.toFun x = h.toFun x) : + ∀ y, (∃ f, F.mem f ∧ g.toFun f = y) ↔ (∃ f, F.mem f ∧ h.toFun f = y) := by + intro y + rw [filter_image_from_slice P F g v hv, filter_image_from_slice P F h v hv] + constructor + · rintro ⟨x, hx, hxv, hxy⟩ + exact ⟨x, hx, hxv, agree x hxv ▸ hxy⟩ + · rintro ⟨x, hx, hxv, hxy⟩ + exact ⟨x, hx, hxv, (agree x hxv).symm ▸ hxy⟩ + +theorem meet_insert_upper {A : Type u} (P : MeetOrder A) (x y a : A) + (hya : P.le y a) : P.meet x y = P.meet (P.meet x a) y := by + apply P.antisymm + · exact P.le_meet (P.le_meet (P.meet_le_left x y) (P.trans (P.meet_le_right x y) hya)) + (P.meet_le_right x y) + · exact P.le_meet (P.trans (P.meet_le_left _ _) (P.meet_le_left x a)) + (P.meet_le_right _ _) + +theorem base_meet_patch {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) + (s : A → B) (g : MeetEmbedding P Q) (a : A) (c : B) + (ga : g.toFun a = c) + (agree : ∀ y, P.le y a → s y = g.toFun y) + (cut_law : ∀ x, Q.meet (s x) c = s (P.meet x a)) + (x y : A) (hya : P.le y a) : Q.meet (s x) (s y) = s (P.meet x y) := by + have syc : Q.le (s y) c := by + rw [agree y hya, ← ga] + exact (g.le_iff y a).mpr hya + calc + Q.meet (s x) (s y) = Q.meet (Q.meet (s x) c) (s y) := meet_insert_upper Q _ _ _ syc + _ = Q.meet (s (P.meet x a)) (s y) := by rw [cut_law] + _ = Q.meet (g.toFun (P.meet x a)) (g.toFun y) := by + rw [agree _ (P.meet_le_right x a), agree y hya] + _ = g.toFun (P.meet (P.meet x a) y) := (g.map_meet _ _).symm + _ = g.toFun (P.meet x y) := congrArg g.toFun (meet_insert_upper P x y a hya).symm + _ = s (P.meet x y) := (agree _ (P.trans (P.meet_le_right x y) hya)).symm + +theorem base_ideal_filled {A : Type u} (P : MeetOrder A) (s : A → A) + (g : MeetIso P P) (a : A) + (agree : ∀ y, P.le y a → s y = g.toFun y) : + ∀ x, P.le x (g.toFun a) → ∃ y, s y = x := by + intro x hx + have hy : P.le (g.inverse x) a := by + apply (g.le_iff _ _).mp + rw [g.right_inverse] + exact hx + exact ⟨g.inverse x, (agree _ hy).trans (g.right_inverse x)⟩ + +theorem range_completion_from_accounting {A : Type u} {J : Type v} + (P : MeetOrder A) (Original : A → Prop) (base cap : J → A) (s : J → A → A) + (base_filled : ∀ i x, P.le x (base i) → ∃ y, s i y = x) + (old_shadow : ∀ i x, Original x → P.le x (cap i) → P.le x (base i)) + (separation : ∀ i j, i ≠ j → + P.le (cap i) (base j) ∨ P.le (cap j) (base i) ∨ + P.meet (cap i) (cap j) = P.meet (base i) (base j)) + (accounting : ∀ x, Original x ∨ + ∃ j y, s j y = x ∧ P.le x (cap j) ∧ ¬ P.le x (base j)) : + ∀ i x, P.le x (cap i) → ∃ y, s i y = x := by + classical + intro i x hxi + cases accounting x with + | inl old => exact base_filled i x (old_shadow i x old hxi) + | inr new => + rcases new with ⟨j, y, hy, hxj, not_base⟩ + by_cases same : j = i + · cases same + exact ⟨y, hy⟩ + · cases separation j i same with + | inl hjci => exact base_filled i x (P.trans hxj hjci) + | inr h => + cases h with + | inl hicj => exact False.elim (not_base (P.trans hxi hicj)) + | inr hmeet => + have hxmeet : P.le x (P.meet (base j) (base i)) := hmeet ▸ P.le_meet hxj hxi + exact base_filled i x (P.trans hxmeet (P.meet_le_right _ _)) + +theorem embedding_injective {A : Type u} {B : Type v} {P : MeetOrder A} {Q : MeetOrder B} + (s : MeetEmbedding P Q) {x y : A} (h : s.toFun x = s.toFun y) : x = y := by + apply P.antisymm + · apply (s.le_iff x y).mp + rw [h] + exact Q.refl _ + · apply (s.le_iff y x).mp + rw [h] + exact Q.refl _ + +noncomputable def isoOntoIdeal {A : Type u} (P : MeetOrder A) + (s : MeetEmbedding P P) (k : A) + (below : ∀ x, P.le (s.toFun x) k) + (onto : ∀ z, P.le z k → ∃ x, s.toFun x = z) : + MeetIso P (Attachment.idealOrder P k) where + toFun x := ⟨s.toFun x, below x⟩ + le_iff x y := s.le_iff x y + map_meet x y := Subtype.ext (s.map_meet x y) + inverse z := Classical.choose (onto z.val z.property) + left_inverse x := embedding_injective s (Classical.choose_spec (onto (s.toFun x) (below x))) + right_inverse z := Subtype.ext (Classical.choose_spec (onto z.val z.property)) + +structure InitialTasks {A : Type u} (P : MeetOrder A) (J : Type v) where + source : J → A + representative : J → MeetIso P P + filter : J → MeetFilter P + separator : J → A + base_le_separator : ∀ i, P.le ((representative i).toFun (source i)) (separator i) + separator_not_le_base : ∀ i, ¬ P.le (separator i) ((representative i).toFun (source i)) + separator_le_filter : ∀ i f, (filter i).mem f → P.le (separator i) f + +namespace InitialTasks + +variable {A : Type u} {J : Type v} {P : MeetOrder A} (d : InitialTasks P J) + +def batch : Attachment.Templates P J where + Space _ := A + order _ := P + anchor := d.source + embed i := { + toFun y := (d.representative i).toFun y.val + le_iff x y := (d.representative i).le_iff x.val y.val + map_meet x y := (d.representative i).map_meet x.val y.val } + upper i := (d.filter i).mem + upper_nonempty i := (d.filter i).nonempty + upper_up i := (d.filter i).upward + upper_meet i := (d.filter i).closed_meet + separator := d.separator + base_le_separator := d.base_le_separator + separator_not_le_base := d.separator_not_le_base + separator_le_upper := d.separator_le_filter + +noncomputable def copy (i : J) : MeetEmbedding P d.batch.extension := + d.batch.templateEmbedding i + +theorem copy_agrees_on_base (i : J) (y : A) (hy : P.le y (d.source i)) : + (d.copy i).toFun y = .inl ((d.representative i).toFun y) := + d.batch.template_agrees_on_base i y hy + +theorem copy_initial_profile (T : A) (top : ∀ y, P.le y T) + (outside : ∀ i, ¬ P.le T (d.source i)) (i : J) : + Profile d.batch.extension (.inl ((d.representative i).toFun (d.source i))) + (.inl (d.separator i)) ((d.copy i).toFun T) (d.batch.originalFamily i) := by + change Profile d.batch.extension (.inl (d.batch.base i)) (.inl (d.batch.separator i)) + (d.batch.represent i T) (d.batch.originalFamily i) + rw [d.batch.represent_new i T (outside i)] + exact d.batch.initial_profile i T top (outside i) + +theorem copy_cap_separation (T : A) (top : ∀ y, P.le y T) + (outside : ∀ i, ¬ P.le T (d.source i)) (i j : J) (different : i ≠ j) : + d.batch.extension.le ((d.copy i).toFun T) (.inl (d.batch.base j)) ∨ + d.batch.extension.le ((d.copy j).toFun T) (.inl (d.batch.base i)) ∨ + d.batch.extension.meet ((d.copy i).toFun T) ((d.copy j).toFun T) = + d.batch.extension.meet (.inl (d.batch.base i)) (.inl (d.batch.base j)) := by + change d.batch.extension.le (d.batch.represent i T) (.inl (d.batch.base j)) ∨ + d.batch.extension.le (d.batch.represent j T) (.inl (d.batch.base i)) ∨ + d.batch.extension.meet (d.batch.represent i T) (d.batch.represent j T) = _ + rw [d.batch.represent_new i T (outside i), d.batch.represent_new j T (outside j)] + exact d.batch.cap_alternatives i j different T T top top (outside i) (outside j) + +end InitialTasks + +end Compression + +end PartitionPilot + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionExternalTileOverlaps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionExternalTileOverlaps.lean index d4c201d93819ffe9611f293f3203955f5a3ae967..de0950c091dc3da1d14a1f40f4d3dae0b52c4d27 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionExternalTileOverlaps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionExternalTileOverlaps.lean @@ -1,690 +1,690 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedRangeCompletion -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRequestOverlaps -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData -import OAI.SetTheory.PartitionPrinciple.Transfinite.SmallTileHeightInputs - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -structure GroundCompressionCompletion (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ : ZFSet.{u}) where - algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T - bases_ground : algebra.bases ∈ M.sets - caps_ground : algebra.caps τ ∈ M.sets - bases_function : ZFSet.IsFunc I (algebra.union.fields 0) algebra.bases - caps_function : ZFSet.IsFunc I (algebra.union.fields 0) (algebra.caps τ) - top_mem : τ ∈ algebra.union.fields 0 - top : ∀ x ∈ algebra.union.fields 0, ZFSet.pair x τ ∈ algebra.union.fields 1 - range : ∀ i f k x, ZFSet.pair i f ∈ algebra.maps → ZFSet.pair i k ∈ algebra.caps τ → - ((∃ y ∈ algebra.union.fields 0, ZFSet.pair y x ∈ f) ↔ - x ∈ algebra.union.fields 0 ∧ ZFSet.pair x k ∈ algebra.union.fields 1) - equivariant : ∀ g i j f h x y z, - ZFSet.pair (ZFSet.pair g i) j ∈ T → - ZFSet.pair i f ∈ algebra.maps → ZFSet.pair j h ∈ algebra.maps → - ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ h → - ZFSet.pair (ZFSet.pair g y) z ∈ algebra.union.fields 12 - source_agreement : ∀ i f a g x y, - ZFSet.pair i f ∈ algebra.maps → ZFSet.pair i a ∈ Sources → ZFSet.pair i g ∈ Reps → - ZFSet.pair x a ∈ algebra.union.fields 1 → - (ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ algebra.union.fields 12) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} - -namespace GroundCompressionUnionData - -theorem fields_unique - (first second : GroundCompressionUnionData M initial I Sources Reps G m one T) : - first.fields = second.fields := by - funext j - apply ZFSet.ext - intro z - exact (first.fieldUnion j z).trans (second.fieldUnion j z).symm - -theorem unique - (first second : GroundCompressionUnionData M initial I Sources Reps G m one T) : - first = second := by - have equal := first.fields_unique second - cases first - cases second - cases equal - rfl - -end GroundCompressionUnionData - -namespace GroundCompressionAlgebra - -theorem unique - (first second : GroundCompressionAlgebra M initial I Sources Reps G m one T) : - first = second := by - have sameUnion := first.union.unique second.union - have sameMaps : first.maps = second.maps := by - rw [first.maps_eq_sections, second.maps_eq_sections, sameUnion] - cases first - cases second - cases sameUnion - cases sameMaps - rfl - -end GroundCompressionAlgebra - -namespace GroundCompressionCompletion - -theorem unique - (first second : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : - first = second := by - have equal := first.algebra.unique second.algebra - cases first - cases second - cases equal - rfl - -end GroundCompressionCompletion -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization Compression Compression.RecursiveMaps -universe u - -private theorem externalRectangleParameters_exists {P G r μ A : ZFSet.{u}} - (z : SetMembers (externalRectangles P G r μ A)) : - ∃ v : ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u}, - SetMembers.raw z = externalRectangleCode v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 ∧ - ExternalRectangleCode P G r μ A v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 := by - obtain ⟨c, b, d, g, h, equal, code⟩ := - (mem_externalRectangles P G r μ A _).1 (SetMembers.raw_mem z) - exact ⟨(c, b, d, g, h), equal, code⟩ - -noncomputable def externalRectangleParameters {P G r μ A : ZFSet.{u}} - (z : SetMembers (externalRectangles P G r μ A)) : - ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u} := - Classical.choose (externalRectangleParameters_exists z) - -theorem externalRectangleParameters_spec {P G r μ A : ZFSet.{u}} - (z : SetMembers (externalRectangles P G r μ A)) : - let v := externalRectangleParameters z - SetMembers.raw z = externalRectangleCode v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 ∧ - ExternalRectangleCode P G r μ A v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 := - Classical.choose_spec (externalRectangleParameters_exists z) - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -noncomputable def externalMap (i : SetMembers I) : ZFSet.{u} := - completion.algebra.function.value ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ - -theorem externalMap_entry (i : SetMembers I) : - ZFSet.pair (SetMembers.raw i) (completion.externalMap i) ∈ completion.algebra.maps := - completion.algebra.function.value_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ - -noncomputable def externalCap (i : SetMembers I) : SetMembers (completion.algebra.union.fields 0) := - (SetMembers.presentation I).decodeFunction (SetMembers.presentation (completion.algebra.union.fields 0)) - (completion.algebra.caps τ) completion.caps_function i - -theorem externalCap_entry (i : SetMembers I) : - ZFSet.pair (SetMembers.raw i) (SetMembers.raw (completion.externalCap i)) ∈ completion.algebra.caps τ := - (SetMembers.presentation I).decodeFunction_mem (SetMembers.presentation (completion.algebra.union.fields 0)) - (completion.algebra.caps τ) completion.caps_function i - -noncomputable def externalCopy (i : SetMembers I) : - MeetIso completion.algebra.union.meet.toSmallMeetOrder - (Attachment.idealOrder completion.algebra.union.meet.toSmallMeetOrder (completion.externalCap i)) := - smallCompressionTileIso completion.algebra.union.meet - (completion.algebra.embedding _ _ (completion.externalMap_entry i)) (completion.externalCap i) - (fun x => completion.range _ _ _ x (completion.externalMap_entry i) (completion.externalCap_entry i)) - -theorem externalCopy_entry (i : SetMembers I) (x : SetMembers (completion.algebra.union.fields 0)) : - ZFSet.pair (SetMembers.raw x) (SetMembers.raw ((completion.externalCopy i).toFun x).val) ∈ - completion.externalMap i := - smallCompressionTileIso_entry _ _ _ _ x - -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (compression : CompressionOriginalData P0 r0 μ0 A0 G - (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) - -noncomputable def externalRectangle - (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : - ActionRectangle completion.algebra.union.meet.toSmallMeetOrder - (completion.algebra.union.action.toSmallMeetIso group completion.algebra.union.meet) := - (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle - group completion.algebra.union.action completion.algebra.union.meet - -theorem externalRectangle_fields (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : - let rectangle := completion.externalRectangle group oldAction compression z - externalRectangleCode (SetMembers.raw rectangle.C) (SetMembers.raw rectangle.B) - (SetMembers.raw rectangle.D) (SetMembers.raw rectangle.first) (SetMembers.raw rectangle.second) = - SetMembers.raw z := by - have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields - group completion.algebra.union.action completion.algebra.union.meet - change externalRectangleCode _ _ _ _ _ = _ - dsimp only [externalRectangle] - rw [fields.1, fields.2.1, fields.2.2.1, fields.2.2.2.1, fields.2.2.2.2] - exact (externalRectangleParameters_spec z).1.symm - -noncomputable def externalRequest : - ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) → - TileRequests.Request completion.algebra.union.meet.toSmallMeetOrder - | .inl i => .compression (completion.externalCap i) (completion.externalCopy i) - | .inr (.inl x) => .separation (SetMembers.ofMem (SetMembers.raw x) - (compression.subset (SetMembers.raw_mem x))) - | .inr (.inr z) => .rectangle ((completion.externalRectangle group oldAction compression z).toInput - (SetMembers.ofMem τ completion.top_mem) (fun x => by - simpa only [MeetOrderCode.toSmallMeetOrder, SetMembers.raw_ofMem] using - completion.top _ (SetMembers.raw_mem x))) - -noncomputable def externalFamily : TileRequests.Family completion.algebra.union.meet.toSmallMeetOrder - (ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) where - top := SetMembers.ofMem τ completion.top_mem - greatest x := by - simpa only [MeetOrderCode.toSmallMeetOrder, SetMembers.raw_ofMem] using - completion.top _ (SetMembers.raw_mem x) - request := completion.externalRequest group oldAction compression - -theorem externalFamily_child (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : - (completion.externalFamily group oldAction compression).Child r = ExternalRequestChild r := by - rcases r with i | (x | z) <;> rfl - -noncomputable def externalFamilyLetterEquiv : - (completion.externalFamily group oldAction compression).Letters ≃ - Sigma (@ExternalRequestChild I P0 (externalRectangles P0 G r0 μ0 A0)) where - toFun x := ⟨x.1, cast (completion.externalFamily_child group oldAction compression x.1) x.2⟩ - invFun x := ⟨x.1, cast (completion.externalFamily_child group oldAction compression x.1).symm x.2⟩ - left_inv x := by cases x; simp; rfl - right_inv x := by cases x; simp - -noncomputable def externalFamilyLetterPresentation : - Presentation (completion.externalFamily group oldAction compression).Letters where - carrier := externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) - encode x := externalRequestLetterCode (completion.externalFamilyLetterEquiv group oldAction compression x) - injective := (externalRequestLetterCode_injective _ _ _).comp - (completion.externalFamilyLetterEquiv group oldAction compression).injective - mem_carrier z := by - have member : z ∈ externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) ↔ - ∃ x : Sigma (@ExternalRequestChild I P0 (externalRectangles P0 G r0 μ0 A0)), - externalRequestLetterCode x = z := - (externalRequestLetterPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).mem_carrier z - rw [member] - exact ⟨fun ⟨x, hx⟩ => ⟨(completion.externalFamilyLetterEquiv group oldAction compression).symm x, by - simpa only [Equiv.apply_symm_apply] using hx⟩, fun ⟨x, hx⟩ => - ⟨completion.externalFamilyLetterEquiv group oldAction compression x, hx⟩⟩ - -theorem externalFamilyLetterPresentation_carrier : - (completion.externalFamilyLetterPresentation group oldAction compression).carrier = - externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) := rfl - -end GroundCompressionCompletion - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def externalCompressionField (I V F : ZFSet.{u}) : ZFSet.{u} := - relationCompose (ZFSet.prod {natSetCode 0} I) I V (productSecond {natSetCode 0} I) F - -private theorem compressionProjection_entry_iff (I i j : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (natSetCode 0) i) j ∈ productSecond {natSetCode 0} I ↔ - i ∈ I ∧ j = i := by - rw [mem_productSecond] - constructor - · rintro ⟨t, ht, x, hx, equal⟩ - have sameI := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).1).2 - exact ⟨sameI.symm ▸ hx, (ZFSet.pair_inj.1 equal).2.trans sameI.symm⟩ - · rintro ⟨hi, equal⟩ - subst j - exact ⟨natSetCode 0, ZFSet.mem_singleton.2 rfl, i, hi, rfl⟩ - -theorem externalCompressionField_entry_iff {I V F i y : ZFSet.{u}} - (function : ZFSet.IsFunc I V F) : - ZFSet.pair (ZFSet.pair (natSetCode 0) i) y ∈ externalCompressionField I V F ↔ - ZFSet.pair i y ∈ F := by - rw [externalCompressionField, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, j, _, projection, entry⟩ - have same := (compressionProjection_entry_iff I i j).1 projection - exact same.2 ▸ entry - · intro entry - have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, bounds.1⟩, bounds.2, - i, bounds.1, (compressionProjection_entry_iff I i i).2 ⟨bounds.1, rfl⟩, entry⟩ - -theorem externalCompressionField_function {I V F : ZFSet.{u}} - (function : ZFSet.IsFunc I V F) : - ZFSet.IsFunc (ZFSet.prod {natSetCode 0} I) V (externalCompressionField I V F) := - relationCompose_function_of_subset (productSecond_function {natSetCode 0} I) function (fun _ h => h) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem externalCompressionField_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I V F : ZFSet.{u}} (hI : I ∈ M.sets) (hV : V ∈ M.sets) (hF : F ∈ M.sets) : - externalCompressionField I V F ∈ M.sets := by - have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I, hI⟩ - have single : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing zero zero - exact M.relationCompose_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation single hI) hI hV - (M.productSecond_mem pairing unions powers separation single hI) hF - -end TransitiveGround - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -noncomputable def externalMaps : ZFSet.{u} := - externalCompressionField I completion.algebra.maps.sUnion.sUnion completion.algebra.maps - -noncomputable def externalCaps : ZFSet.{u} := - externalCompressionField I (completion.algebra.union.fields 0) (completion.algebra.caps τ) - -theorem external_fields_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) : - completion.externalMaps ∈ M.sets ∧ completion.externalCaps ∈ M.sets ∧ - FunctionGraphOn (ZFSet.prod {natSetCode 0} I) completion.externalMaps ∧ - ZFSet.IsFunc (ZFSet.prod {natSetCode 0} I) (completion.algebra.union.fields 0) completion.externalCaps := - ⟨M.externalCompressionField_mem pairing unions powers separation hI - (M.union_mem unions (M.union_mem unions completion.algebra.ground)) completion.algebra.ground, - M.externalCompressionField_mem pairing unions powers separation hI - (completion.algebra.union.ground 0) completion.caps_ground, - ⟨_, externalCompressionField_function completion.algebra.function.to_isFunc⟩, - externalCompressionField_function completion.caps_function⟩ - -theorem external_fields_entries (i f k : ZFSet.{u}) : - (ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps ↔ - ZFSet.pair i f ∈ completion.algebra.maps) ∧ - (ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps ↔ - ZFSet.pair i k ∈ completion.algebra.caps τ) := - ⟨externalCompressionField_entry_iff completion.algebra.function.to_isFunc, - externalCompressionField_entry_iff completion.caps_function⟩ - -theorem external_fields_range {i f k : ZFSet.{u}} - (map : ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps) - (cap : ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps) : - MeetEmbeddingCode (completion.algebra.union.fields 0) (completion.algebra.union.fields 0) - (completion.algebra.union.fields 1) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 2) f ∧ - ∀ x, ((∃ y ∈ completion.algebra.union.fields 0, ZFSet.pair y x ∈ f) ↔ - x ∈ completion.algebra.union.fields 0 ∧ ZFSet.pair x k ∈ completion.algebra.union.fields 1) := by - have originalMap := ((completion.external_fields_entries i f k).1).1 map - have originalCap := ((completion.external_fields_entries i f k).2).1 cap - exact ⟨completion.algebra.embedding i f originalMap, - fun x => completion.range i f k x originalMap originalCap⟩ - -end GroundCompressionCompletion - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) - -theorem completion_of_accounting - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (accounting : CompressionRangeAccounting P0 I (algebra.union.fields 0) - (algebra.union.fields 1) (algebra.union.fields 2) algebra.maps algebra.bases (algebra.caps τ)) : - Nonempty (GroundCompressionCompletion M state.data I Sources Reps G m one T τ) := by - obtain ⟨basesGround, capsGround⟩ := state.union_markings_ground algebra - pairing unions powers separation hI hSources - refine ⟨{ - algebra := algebra - bases_ground := basesGround - caps_ground := capsGround - bases_function := state.union_bases_function algebra - caps_function := state.union_caps_function algebra - top_mem := state.union_original_subset algebra.union seed.top_mem - top := fun _ hx => state.union_top algebra pairing unions powers separation - hI hSources hReps hG hT hx - range := ?_ - equivariant := ?_ - source_agreement := ?_ - }⟩ - · intro i f k x indexed capped - apply accounting.range_iff algebra.union.meet algebra.function algebra.embedding - (state.union_bases_function algebra) (state.union_caps_function algebra) ?_ - (algebra.function.pair_source indexed) indexed capped - intro j _ graph cap map capEntry y z image - exact state.union_map_range_below_cap algebra pairing unions powers separation - hI hSources hReps hG hT map ((state.union_cap_entry_iff algebra map).1 capEntry) image - · intro g i j f h x y z transport firstMap secondMap first second - exact state.union_map_equivariant algebra pairing unions powers separation - hI hSources hReps hG hT transport firstMap secondMap first second - · intro i f a g x y map source representative below - exact state.union_map_agrees_on_source algebra pairing unions powers separation - hI hSources hReps hG hT map source representative below - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing -universe u - -structure GroundHeightedCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P0 C D rD original : ZFSet.{u}) where - completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ - heights : GroundCompressionHeightData M initial I Sources Reps G m one T - completion.algebra.union P0 C D rD original - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionCompletion -open SetRealization -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (compression : CompressionOriginalData P0 r0 μ0 A0 G - (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) - -theorem externalFamily_compression_letter (i : SetMembers I) : - (completion.externalFamilyLetterPresentation group oldAction compression).encode ⟨.inl i, ⟨()⟩⟩ = - ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0) := rfl - -theorem externalFamily_separation_letter (x : SetMembers P0) : - (completion.externalFamilyLetterPresentation group oldAction compression).encode ⟨.inr (.inl x), ⟨()⟩⟩ = - ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw x)) (natSetCode 0) := rfl - -theorem externalFamily_rectangle_letter (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (b : Bool) : - (completion.externalFamilyLetterPresentation group oldAction compression).encode ⟨.inr (.inr z), ⟨b⟩⟩ = - ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (externalSignCode b) := rfl - -noncomputable def externalFamilyVertexCode - (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : - Option ((completion.externalFamily group oldAction compression).Child r) → ZFSet.{u} - | none => natSetCode 0 - | some child => insert - (externalRequestChildCode r (cast (completion.externalFamily_child group oldAction compression r) child)) - (externalRequestChildCode r (cast (completion.externalFamily_child group oldAction compression r) child)) - -theorem externalFamilyVertexCode_root - (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : - completion.externalFamilyVertexCode group oldAction compression r none = natSetCode 0 := rfl - -theorem externalFamilyVertexCode_compression (i : SetMembers I) : - completion.externalFamilyVertexCode group oldAction compression (.inl i) (some ⟨()⟩) = natSetCode 1 := rfl - -theorem externalFamilyVertexCode_separation (x : SetMembers P0) : - completion.externalFamilyVertexCode group oldAction compression (.inr (.inl x)) (some ⟨()⟩) = natSetCode 1 := rfl - -theorem externalFamilyVertexCode_rectangle (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (b : Bool) : - completion.externalFamilyVertexCode group oldAction compression (.inr (.inr z)) (some ⟨b⟩) = - natSetCode (if b then 2 else 1) := by cases b <;> rfl - -end PartitionPilot.Forcing.GroundCompressionCompletion - - - -namespace PartitionPilot.Forcing -universe u - -structure GroundProfiledCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P0 C D rD original Targets Separators Filters : ZFSet.{u}) where - heighted : GroundHeightedCompression M initial I Sources Reps G m one T τ P0 C D rD original - profiles : CodedCompressionProfiles - (heighted.completion.algebra.union.fields 0) (heighted.completion.algebra.union.fields 1) - (heighted.completion.algebra.union.fields 2) (heighted.completion.algebra.caps τ) - Targets Separators Filters - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -theorem externalMaps_compression_iff (i : SetMembers I) (f : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) f ∈ completion.externalMaps ↔ - f = completion.externalMap i := by - rw [(completion.external_fields_entries (SetMembers.raw i) f ∅).1] - exact ⟨fun entry => (completion.algebra.function.unique entry (completion.externalMap_entry i)), - fun equal => equal.symm ▸ completion.externalMap_entry i⟩ - -theorem externalMaps_tag {tag x f : ZFSet.{u}} - (entry : ZFSet.pair (ZFSet.pair tag x) f ∈ completion.externalMaps) : tag = natSetCode 0 := by - have function := externalCompressionField_function completion.algebra.function.to_isFunc - have domain := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 - exact ZFSet.mem_singleton.1 (ZFSet.pair_mem_prod.1 domain).1 - -theorem externalMap_external_bound (i : SetMembers I) : completion.externalMap i ∈ completion.externalMaps.sUnion.sUnion := - pair_second_mem_doubleUnion ((completion.externalMaps_compression_iff i _).2 rfl) - -theorem externalOverlapForward_compression {P Rectangles r A : ZFSet.{u}} - (task : SetMembers I) (i x j y : ZFSet.{u}) : - ExternalRequestOverlapForward P G Rectangles completion.externalMaps completion.externalMaps.sUnion.sUnion r A - (natSetCode 0) (natSetCode 1) (natSetCode 2) - (ZFSet.pair (natSetCode 0) (SetMembers.raw task)) i x j y ↔ - i = natSetCode 0 ∧ j = natSetCode 1 ∧ ZFSet.pair y x ∈ completion.externalMap task := by - simp only [ExternalRequestOverlapForward, ZFSet.pair_inj, natSetCode_injective.eq_iff, - completion.externalMaps_compression_iff] - simp - intro _ _ _ - simpa only [ZFSet.mem_sUnion] using completion.externalMap_external_bound task - -theorem externalOverlapForward_separation {P Rectangles r A : ZFSet.{u}} - (point : SetMembers P) (i x j y : ZFSet.{u}) : - ExternalRequestOverlapForward P G Rectangles completion.externalMaps completion.externalMaps.sUnion.sUnion r A - (natSetCode 0) (natSetCode 1) (natSetCode 2) - (ZFSet.pair (natSetCode 1) (SetMembers.raw point)) i x j y ↔ - i = natSetCode 0 ∧ j = natSetCode 1 ∧ x = y ∧ ZFSet.pair x (SetMembers.raw point) ∈ r := by - have empty : ∀ f, ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw point)) f ∉ completion.externalMaps := by - intro f entry - have equal := natSetCode_injective (completion.externalMaps_tag entry) - exact Nat.noConfusion equal - simp only [ExternalRequestOverlapForward, ZFSet.pair_inj, natSetCode_injective.eq_iff] - simp [empty, SetMembers.raw_mem point] - -theorem externalOverlapForward_rectangle {P r0 μ0 A0 r A : ZFSet.{u}} - (z : SetMembers (externalRectangles P G r0 μ0 A0)) (i x j y : ZFSet.{u}) : - let v := externalRectangleParameters z - ExternalRequestOverlapForward P G (externalRectangles P G r0 μ0 A0) - completion.externalMaps completion.externalMaps.sUnion.sUnion r A - (natSetCode 0) (natSetCode 1) (natSetCode 2) - (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) i x j y ↔ - (i = natSetCode 0 ∧ j = natSetCode 1 ∧ ZFSet.pair y v.1 ∈ r ∧ ZFSet.pair (ZFSet.pair v.2.2.2.1 y) x ∈ A) ∨ - (i = natSetCode 0 ∧ j = natSetCode 2 ∧ ZFSet.pair y v.1 ∈ r ∧ ZFSet.pair (ZFSet.pair v.2.2.2.2 y) x ∈ A) ∨ - (i = natSetCode 1 ∧ j = natSetCode 2 ∧ x = y ∧ ZFSet.pair x v.2.1 ∈ r) := by - have empty : ∀ f, ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) f ∉ completion.externalMaps := by - intro f entry - have equal := natSetCode_injective (completion.externalMaps_tag entry) - exact Nat.noConfusion equal - dsimp only - rw [ExternalRequestOverlapForward] - constructor - · rintro (⟨_, _, f, _, entry, _⟩ | ⟨_, _, w, _, equal, _⟩ | rect) - · exact False.elim (empty f entry) - · exact False.elim (by have eq := natSetCode_injective (ZFSet.pair_inj.1 equal).1; omega) - · obtain ⟨t, _, c, _, b, _, d, _, g, _, h, _, qt, tuple, overlap⟩ := rect - have equalT := (ZFSet.pair_inj.1 qt).2 - have coords := externalRectangleCode_inj.1 - (tuple.symm.trans (equalT.symm.trans (externalRectangleParameters_spec z).1)) - obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := coords - exact overlap - · intro overlap - have params := externalRectangleParameters_spec z - exact Or.inr (Or.inr ⟨SetMembers.raw z, SetMembers.raw_mem z, - _, params.2.1, _, params.2.2.1, _, params.2.2.2.1, _, params.2.2.2.2.1, _, params.2.2.2.2.2.1, - rfl, params.1, overlap⟩) - -end GroundCompressionCompletion -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -structure GroundBornCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P0 C D rD original Targets Separators Filters base old : ZFSet.{u}) where - profiled : GroundProfiledCompression M initial I Sources Reps G m one T τ P0 C D rD original - Targets Separators Filters - births : GroundCompressionBirthData M initial I Sources Reps G m one T - profiled.heighted.completion.algebra.union base old - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionCompletion -open SetRealization Compression Compression.RecursiveMaps -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (compression : CompressionOriginalData P0 r0 μ0 A0 G - (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) - -local notation "p" => completion.algebra.union.meet.toSmallMeetOrder -local notation "f" => completion.externalFamily group oldAction compression -local notation "U" => completion.algebra.union.fields 0 -local notation "ru" => completion.algebra.union.fields 1 -local notation "au" => completion.algebra.union.fields 12 - -theorem externalFamily_diagonal_iff - (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) - (i : Option ((f).Child r)) (x y : SetMembers U) : - ((f).flatVertex r i).toFun x = ((f).flatVertex r i).toFun y ↔ SetMembers.raw x = SetMembers.raw y := - ⟨fun same => congrArg SetMembers.raw (embedding_injective ((f).flatVertex r i).toMeetEmbedding same), - fun same => congrArg ((f).flatVertex r i).toFun (SetMembers.raw_injective U same)⟩ - -theorem externalFamily_compression_overlap (task : SetMembers I) (x y : SetMembers U) : - ((f).flatVertex (.inl task) none).toFun x = ((f).flatVertex (.inl task) (some ⟨()⟩)).toFun y ↔ - ZFSet.pair (SetMembers.raw y) (SetMembers.raw x) ∈ completion.externalMap task := by - change (BinaryTiles.compression p (f).top (completion.externalCap task) (f).greatest - (completion.externalCopy task)).left.toFun x = - (BinaryTiles.compression p (f).top (completion.externalCap task) (f).greatest - (completion.externalCopy task)).right.toFun y ↔ _ - rw [BinaryTiles.compression_identification] - change Sum.inl x = Sum.inl ((completion.externalCopy task).toFun y).val ↔ _ - rw [Sum.inl.injEq, eq_comm] - exact (completion.algebra.embedding _ _ (completion.externalMap_entry task)).smallValue_eq_iff y x - -theorem externalFamily_separation_overlap (point : SetMembers P0) (x y : SetMembers U) : - ((f).flatVertex (.inr (.inl point)) none).toFun x = - ((f).flatVertex (.inr (.inl point)) (some ⟨()⟩)).toFun y ↔ - SetMembers.raw x = SetMembers.raw y ∧ ZFSet.pair (SetMembers.raw x) (SetMembers.raw point) ∈ ru := by - let W := SetMembers.ofMem (SetMembers.raw point) (compression.subset (SetMembers.raw_mem point)) - change (BinaryTiles.separation p W).left.toFun x = (BinaryTiles.separation p W).right.toFun y ↔ _ - rw [eq_comm, (BinaryTiles.separation p W).overlap_exact] - change (∃ _ : ZFSet.pair (SetMembers.raw y) (SetMembers.raw W) ∈ ru, y = x) ↔ _ - simp only [W, SetMembers.raw_ofMem] - constructor - · rintro ⟨lower, rfl⟩ - exact ⟨rfl, lower⟩ - · rintro ⟨same, lower⟩ - have equal := SetMembers.raw_injective U same - exact ⟨by simpa only [← equal] using lower, equal.symm⟩ - -theorem externalFamily_rectangle_first_overlap - (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x y : SetMembers U) : - let v := externalRectangleParameters z - ((f).flatVertex (.inr (.inr z)) none).toFun x = - ((f).flatVertex (.inr (.inr z)) (some ⟨false⟩)).toFun y ↔ - ZFSet.pair (SetMembers.raw y) v.1 ∈ ru ∧ - ZFSet.pair (ZFSet.pair v.2.2.2.1 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by - let rect := completion.externalRectangle group oldAction compression z - let tile := rect.toInput (f).top (f).greatest - change tile.root.toFun x = tile.first.toFun y ↔ _ - rw [eq_comm, tile.first_root_intersection] - have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields - group completion.algebra.union.action completion.algebra.union.meet - have code : (p).le y tile.C ↔ ZFSet.pair (SetMembers.raw y) (externalRectangleParameters z).1 ∈ ru := by - change ZFSet.pair (SetMembers.raw y) (SetMembers.raw rect.C) ∈ ru ↔ _ - rw [show SetMembers.raw rect.C = _ from fields.1] - have actor : tile.g1.toFun y = x ↔ - ZFSet.pair (ZFSet.pair (externalRectangleParameters z).2.2.2.1 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by - change completion.algebra.union.action.act rect.first y = x ↔ _ - rw [completion.algebra.union.action.act_eq_iff] - rw [show SetMembers.raw rect.first = _ from fields.2.2.2.1] - exact and_congr code actor - -theorem externalFamily_rectangle_second_overlap - (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x y : SetMembers U) : - let v := externalRectangleParameters z - ((f).flatVertex (.inr (.inr z)) none).toFun x = - ((f).flatVertex (.inr (.inr z)) (some ⟨true⟩)).toFun y ↔ - ZFSet.pair (SetMembers.raw y) v.1 ∈ ru ∧ - ZFSet.pair (ZFSet.pair v.2.2.2.2 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by - let rect := completion.externalRectangle group oldAction compression z - let tile := rect.toInput (f).top (f).greatest - change tile.root.toFun x = tile.second.toFun y ↔ _ - rw [eq_comm, tile.second_root_intersection] - have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields - group completion.algebra.union.action completion.algebra.union.meet - have code : (p).le y tile.C ↔ ZFSet.pair (SetMembers.raw y) (externalRectangleParameters z).1 ∈ ru := by - change ZFSet.pair (SetMembers.raw y) (SetMembers.raw rect.C) ∈ ru ↔ _ - rw [show SetMembers.raw rect.C = _ from fields.1] - have actor : tile.g2.toFun y = x ↔ - ZFSet.pair (ZFSet.pair (externalRectangleParameters z).2.2.2.2 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by - change completion.algebra.union.action.act rect.second y = x ↔ _ - rw [completion.algebra.union.action.act_eq_iff] - rw [show SetMembers.raw rect.second = _ from fields.2.2.2.2] - exact and_congr code actor - -theorem externalFamily_rectangle_children_overlap - (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x y : SetMembers U) : - let v := externalRectangleParameters z - ((f).flatVertex (.inr (.inr z)) (some ⟨false⟩)).toFun x = - ((f).flatVertex (.inr (.inr z)) (some ⟨true⟩)).toFun y ↔ - SetMembers.raw x = SetMembers.raw y ∧ ZFSet.pair (SetMembers.raw x) v.2.1 ∈ ru := by - let rect := completion.externalRectangle group oldAction compression z - let tile := rect.toInput (f).top (f).greatest - change tile.first.toFun x = tile.second.toFun y ↔ _ - rw [tile.children_intersection] - have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields - group completion.algebra.union.action completion.algebra.union.meet - change (ZFSet.pair (SetMembers.raw x) (SetMembers.raw rect.B) ∈ ru ∧ x = y) ↔ _ - rw [show SetMembers.raw rect.B = _ from fields.2.1] - rw [← (SetMembers.raw_injective U).eq_iff, and_comm] - -end PartitionPilot.Forcing.GroundCompressionCompletion - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedRangeCompletion +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRequestOverlaps +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData +import OAI.SetTheory.PartitionPrinciple.Transfinite.SmallTileHeightInputs + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +structure GroundCompressionCompletion (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ : ZFSet.{u}) where + algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T + bases_ground : algebra.bases ∈ M.sets + caps_ground : algebra.caps τ ∈ M.sets + bases_function : ZFSet.IsFunc I (algebra.union.fields 0) algebra.bases + caps_function : ZFSet.IsFunc I (algebra.union.fields 0) (algebra.caps τ) + top_mem : τ ∈ algebra.union.fields 0 + top : ∀ x ∈ algebra.union.fields 0, ZFSet.pair x τ ∈ algebra.union.fields 1 + range : ∀ i f k x, ZFSet.pair i f ∈ algebra.maps → ZFSet.pair i k ∈ algebra.caps τ → + ((∃ y ∈ algebra.union.fields 0, ZFSet.pair y x ∈ f) ↔ + x ∈ algebra.union.fields 0 ∧ ZFSet.pair x k ∈ algebra.union.fields 1) + equivariant : ∀ g i j f h x y z, + ZFSet.pair (ZFSet.pair g i) j ∈ T → + ZFSet.pair i f ∈ algebra.maps → ZFSet.pair j h ∈ algebra.maps → + ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ h → + ZFSet.pair (ZFSet.pair g y) z ∈ algebra.union.fields 12 + source_agreement : ∀ i f a g x y, + ZFSet.pair i f ∈ algebra.maps → ZFSet.pair i a ∈ Sources → ZFSet.pair i g ∈ Reps → + ZFSet.pair x a ∈ algebra.union.fields 1 → + (ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ algebra.union.fields 12) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} + +namespace GroundCompressionUnionData + +theorem fields_unique + (first second : GroundCompressionUnionData M initial I Sources Reps G m one T) : + first.fields = second.fields := by + funext j + apply ZFSet.ext + intro z + exact (first.fieldUnion j z).trans (second.fieldUnion j z).symm + +theorem unique + (first second : GroundCompressionUnionData M initial I Sources Reps G m one T) : + first = second := by + have equal := first.fields_unique second + cases first + cases second + cases equal + rfl + +end GroundCompressionUnionData + +namespace GroundCompressionAlgebra + +theorem unique + (first second : GroundCompressionAlgebra M initial I Sources Reps G m one T) : + first = second := by + have sameUnion := first.union.unique second.union + have sameMaps : first.maps = second.maps := by + rw [first.maps_eq_sections, second.maps_eq_sections, sameUnion] + cases first + cases second + cases sameUnion + cases sameMaps + rfl + +end GroundCompressionAlgebra + +namespace GroundCompressionCompletion + +theorem unique + (first second : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : + first = second := by + have equal := first.algebra.unique second.algebra + cases first + cases second + cases equal + rfl + +end GroundCompressionCompletion +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization Compression Compression.RecursiveMaps +universe u + +private theorem externalRectangleParameters_exists {P G r μ A : ZFSet.{u}} + (z : SetMembers (externalRectangles P G r μ A)) : + ∃ v : ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u}, + SetMembers.raw z = externalRectangleCode v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 ∧ + ExternalRectangleCode P G r μ A v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 := by + obtain ⟨c, b, d, g, h, equal, code⟩ := + (mem_externalRectangles P G r μ A _).1 (SetMembers.raw_mem z) + exact ⟨(c, b, d, g, h), equal, code⟩ + +noncomputable def externalRectangleParameters {P G r μ A : ZFSet.{u}} + (z : SetMembers (externalRectangles P G r μ A)) : + ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u} × ZFSet.{u} := + Classical.choose (externalRectangleParameters_exists z) + +theorem externalRectangleParameters_spec {P G r μ A : ZFSet.{u}} + (z : SetMembers (externalRectangles P G r μ A)) : + let v := externalRectangleParameters z + SetMembers.raw z = externalRectangleCode v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 ∧ + ExternalRectangleCode P G r μ A v.1 v.2.1 v.2.2.1 v.2.2.2.1 v.2.2.2.2 := + Classical.choose_spec (externalRectangleParameters_exists z) + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +noncomputable def externalMap (i : SetMembers I) : ZFSet.{u} := + completion.algebra.function.value ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ + +theorem externalMap_entry (i : SetMembers I) : + ZFSet.pair (SetMembers.raw i) (completion.externalMap i) ∈ completion.algebra.maps := + completion.algebra.function.value_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ + +noncomputable def externalCap (i : SetMembers I) : SetMembers (completion.algebra.union.fields 0) := + (SetMembers.presentation I).decodeFunction (SetMembers.presentation (completion.algebra.union.fields 0)) + (completion.algebra.caps τ) completion.caps_function i + +theorem externalCap_entry (i : SetMembers I) : + ZFSet.pair (SetMembers.raw i) (SetMembers.raw (completion.externalCap i)) ∈ completion.algebra.caps τ := + (SetMembers.presentation I).decodeFunction_mem (SetMembers.presentation (completion.algebra.union.fields 0)) + (completion.algebra.caps τ) completion.caps_function i + +noncomputable def externalCopy (i : SetMembers I) : + MeetIso completion.algebra.union.meet.toSmallMeetOrder + (Attachment.idealOrder completion.algebra.union.meet.toSmallMeetOrder (completion.externalCap i)) := + smallCompressionTileIso completion.algebra.union.meet + (completion.algebra.embedding _ _ (completion.externalMap_entry i)) (completion.externalCap i) + (fun x => completion.range _ _ _ x (completion.externalMap_entry i) (completion.externalCap_entry i)) + +theorem externalCopy_entry (i : SetMembers I) (x : SetMembers (completion.algebra.union.fields 0)) : + ZFSet.pair (SetMembers.raw x) (SetMembers.raw ((completion.externalCopy i).toFun x).val) ∈ + completion.externalMap i := + smallCompressionTileIso_entry _ _ _ _ x + +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (compression : CompressionOriginalData P0 r0 μ0 A0 G + (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) + +noncomputable def externalRectangle + (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : + ActionRectangle completion.algebra.union.meet.toSmallMeetOrder + (completion.algebra.union.action.toSmallMeetIso group completion.algebra.union.meet) := + (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle + group completion.algebra.union.action completion.algebra.union.meet + +theorem externalRectangle_fields (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : + let rectangle := completion.externalRectangle group oldAction compression z + externalRectangleCode (SetMembers.raw rectangle.C) (SetMembers.raw rectangle.B) + (SetMembers.raw rectangle.D) (SetMembers.raw rectangle.first) (SetMembers.raw rectangle.second) = + SetMembers.raw z := by + have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields + group completion.algebra.union.action completion.algebra.union.meet + change externalRectangleCode _ _ _ _ _ = _ + dsimp only [externalRectangle] + rw [fields.1, fields.2.1, fields.2.2.1, fields.2.2.2.1, fields.2.2.2.2] + exact (externalRectangleParameters_spec z).1.symm + +noncomputable def externalRequest : + ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) → + TileRequests.Request completion.algebra.union.meet.toSmallMeetOrder + | .inl i => .compression (completion.externalCap i) (completion.externalCopy i) + | .inr (.inl x) => .separation (SetMembers.ofMem (SetMembers.raw x) + (compression.subset (SetMembers.raw_mem x))) + | .inr (.inr z) => .rectangle ((completion.externalRectangle group oldAction compression z).toInput + (SetMembers.ofMem τ completion.top_mem) (fun x => by + simpa only [MeetOrderCode.toSmallMeetOrder, SetMembers.raw_ofMem] using + completion.top _ (SetMembers.raw_mem x))) + +noncomputable def externalFamily : TileRequests.Family completion.algebra.union.meet.toSmallMeetOrder + (ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) where + top := SetMembers.ofMem τ completion.top_mem + greatest x := by + simpa only [MeetOrderCode.toSmallMeetOrder, SetMembers.raw_ofMem] using + completion.top _ (SetMembers.raw_mem x) + request := completion.externalRequest group oldAction compression + +theorem externalFamily_child (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : + (completion.externalFamily group oldAction compression).Child r = ExternalRequestChild r := by + rcases r with i | (x | z) <;> rfl + +noncomputable def externalFamilyLetterEquiv : + (completion.externalFamily group oldAction compression).Letters ≃ + Sigma (@ExternalRequestChild I P0 (externalRectangles P0 G r0 μ0 A0)) where + toFun x := ⟨x.1, cast (completion.externalFamily_child group oldAction compression x.1) x.2⟩ + invFun x := ⟨x.1, cast (completion.externalFamily_child group oldAction compression x.1).symm x.2⟩ + left_inv x := by cases x; simp; rfl + right_inv x := by cases x; simp + +noncomputable def externalFamilyLetterPresentation : + Presentation (completion.externalFamily group oldAction compression).Letters where + carrier := externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) + encode x := externalRequestLetterCode (completion.externalFamilyLetterEquiv group oldAction compression x) + injective := (externalRequestLetterCode_injective _ _ _).comp + (completion.externalFamilyLetterEquiv group oldAction compression).injective + mem_carrier z := by + have member : z ∈ externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) ↔ + ∃ x : Sigma (@ExternalRequestChild I P0 (externalRectangles P0 G r0 μ0 A0)), + externalRequestLetterCode x = z := + (externalRequestLetterPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).mem_carrier z + rw [member] + exact ⟨fun ⟨x, hx⟩ => ⟨(completion.externalFamilyLetterEquiv group oldAction compression).symm x, by + simpa only [Equiv.apply_symm_apply] using hx⟩, fun ⟨x, hx⟩ => + ⟨completion.externalFamilyLetterEquiv group oldAction compression x, hx⟩⟩ + +theorem externalFamilyLetterPresentation_carrier : + (completion.externalFamilyLetterPresentation group oldAction compression).carrier = + externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) := rfl + +end GroundCompressionCompletion + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def externalCompressionField (I V F : ZFSet.{u}) : ZFSet.{u} := + relationCompose (ZFSet.prod {natSetCode 0} I) I V (productSecond {natSetCode 0} I) F + +private theorem compressionProjection_entry_iff (I i j : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (natSetCode 0) i) j ∈ productSecond {natSetCode 0} I ↔ + i ∈ I ∧ j = i := by + rw [mem_productSecond] + constructor + · rintro ⟨t, ht, x, hx, equal⟩ + have sameI := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).1).2 + exact ⟨sameI.symm ▸ hx, (ZFSet.pair_inj.1 equal).2.trans sameI.symm⟩ + · rintro ⟨hi, equal⟩ + subst j + exact ⟨natSetCode 0, ZFSet.mem_singleton.2 rfl, i, hi, rfl⟩ + +theorem externalCompressionField_entry_iff {I V F i y : ZFSet.{u}} + (function : ZFSet.IsFunc I V F) : + ZFSet.pair (ZFSet.pair (natSetCode 0) i) y ∈ externalCompressionField I V F ↔ + ZFSet.pair i y ∈ F := by + rw [externalCompressionField, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, j, _, projection, entry⟩ + have same := (compressionProjection_entry_iff I i j).1 projection + exact same.2 ▸ entry + · intro entry + have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, bounds.1⟩, bounds.2, + i, bounds.1, (compressionProjection_entry_iff I i i).2 ⟨bounds.1, rfl⟩, entry⟩ + +theorem externalCompressionField_function {I V F : ZFSet.{u}} + (function : ZFSet.IsFunc I V F) : + ZFSet.IsFunc (ZFSet.prod {natSetCode 0} I) V (externalCompressionField I V F) := + relationCompose_function_of_subset (productSecond_function {natSetCode 0} I) function (fun _ h => h) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem externalCompressionField_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I V F : ZFSet.{u}} (hI : I ∈ M.sets) (hV : V ∈ M.sets) (hF : F ∈ M.sets) : + externalCompressionField I V F ∈ M.sets := by + have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I, hI⟩ + have single : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing zero zero + exact M.relationCompose_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation single hI) hI hV + (M.productSecond_mem pairing unions powers separation single hI) hF + +end TransitiveGround + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +noncomputable def externalMaps : ZFSet.{u} := + externalCompressionField I completion.algebra.maps.sUnion.sUnion completion.algebra.maps + +noncomputable def externalCaps : ZFSet.{u} := + externalCompressionField I (completion.algebra.union.fields 0) (completion.algebra.caps τ) + +theorem external_fields_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) : + completion.externalMaps ∈ M.sets ∧ completion.externalCaps ∈ M.sets ∧ + FunctionGraphOn (ZFSet.prod {natSetCode 0} I) completion.externalMaps ∧ + ZFSet.IsFunc (ZFSet.prod {natSetCode 0} I) (completion.algebra.union.fields 0) completion.externalCaps := + ⟨M.externalCompressionField_mem pairing unions powers separation hI + (M.union_mem unions (M.union_mem unions completion.algebra.ground)) completion.algebra.ground, + M.externalCompressionField_mem pairing unions powers separation hI + (completion.algebra.union.ground 0) completion.caps_ground, + ⟨_, externalCompressionField_function completion.algebra.function.to_isFunc⟩, + externalCompressionField_function completion.caps_function⟩ + +theorem external_fields_entries (i f k : ZFSet.{u}) : + (ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps ↔ + ZFSet.pair i f ∈ completion.algebra.maps) ∧ + (ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps ↔ + ZFSet.pair i k ∈ completion.algebra.caps τ) := + ⟨externalCompressionField_entry_iff completion.algebra.function.to_isFunc, + externalCompressionField_entry_iff completion.caps_function⟩ + +theorem external_fields_range {i f k : ZFSet.{u}} + (map : ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps) + (cap : ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps) : + MeetEmbeddingCode (completion.algebra.union.fields 0) (completion.algebra.union.fields 0) + (completion.algebra.union.fields 1) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 2) f ∧ + ∀ x, ((∃ y ∈ completion.algebra.union.fields 0, ZFSet.pair y x ∈ f) ↔ + x ∈ completion.algebra.union.fields 0 ∧ ZFSet.pair x k ∈ completion.algebra.union.fields 1) := by + have originalMap := ((completion.external_fields_entries i f k).1).1 map + have originalCap := ((completion.external_fields_entries i f k).2).1 cap + exact ⟨completion.algebra.embedding i f originalMap, + fun x => completion.range i f k x originalMap originalCap⟩ + +end GroundCompressionCompletion + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) + +theorem completion_of_accounting + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (accounting : CompressionRangeAccounting P0 I (algebra.union.fields 0) + (algebra.union.fields 1) (algebra.union.fields 2) algebra.maps algebra.bases (algebra.caps τ)) : + Nonempty (GroundCompressionCompletion M state.data I Sources Reps G m one T τ) := by + obtain ⟨basesGround, capsGround⟩ := state.union_markings_ground algebra + pairing unions powers separation hI hSources + refine ⟨{ + algebra := algebra + bases_ground := basesGround + caps_ground := capsGround + bases_function := state.union_bases_function algebra + caps_function := state.union_caps_function algebra + top_mem := state.union_original_subset algebra.union seed.top_mem + top := fun _ hx => state.union_top algebra pairing unions powers separation + hI hSources hReps hG hT hx + range := ?_ + equivariant := ?_ + source_agreement := ?_ + }⟩ + · intro i f k x indexed capped + apply accounting.range_iff algebra.union.meet algebra.function algebra.embedding + (state.union_bases_function algebra) (state.union_caps_function algebra) ?_ + (algebra.function.pair_source indexed) indexed capped + intro j _ graph cap map capEntry y z image + exact state.union_map_range_below_cap algebra pairing unions powers separation + hI hSources hReps hG hT map ((state.union_cap_entry_iff algebra map).1 capEntry) image + · intro g i j f h x y z transport firstMap secondMap first second + exact state.union_map_equivariant algebra pairing unions powers separation + hI hSources hReps hG hT transport firstMap secondMap first second + · intro i f a g x y map source representative below + exact state.union_map_agrees_on_source algebra pairing unions powers separation + hI hSources hReps hG hT map source representative below + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing +universe u + +structure GroundHeightedCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P0 C D rD original : ZFSet.{u}) where + completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ + heights : GroundCompressionHeightData M initial I Sources Reps G m one T + completion.algebra.union P0 C D rD original + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionCompletion +open SetRealization +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (compression : CompressionOriginalData P0 r0 μ0 A0 G + (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) + +theorem externalFamily_compression_letter (i : SetMembers I) : + (completion.externalFamilyLetterPresentation group oldAction compression).encode ⟨.inl i, ⟨()⟩⟩ = + ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0) := rfl + +theorem externalFamily_separation_letter (x : SetMembers P0) : + (completion.externalFamilyLetterPresentation group oldAction compression).encode ⟨.inr (.inl x), ⟨()⟩⟩ = + ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw x)) (natSetCode 0) := rfl + +theorem externalFamily_rectangle_letter (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (b : Bool) : + (completion.externalFamilyLetterPresentation group oldAction compression).encode ⟨.inr (.inr z), ⟨b⟩⟩ = + ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (externalSignCode b) := rfl + +noncomputable def externalFamilyVertexCode + (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : + Option ((completion.externalFamily group oldAction compression).Child r) → ZFSet.{u} + | none => natSetCode 0 + | some child => insert + (externalRequestChildCode r (cast (completion.externalFamily_child group oldAction compression r) child)) + (externalRequestChildCode r (cast (completion.externalFamily_child group oldAction compression r) child)) + +theorem externalFamilyVertexCode_root + (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : + completion.externalFamilyVertexCode group oldAction compression r none = natSetCode 0 := rfl + +theorem externalFamilyVertexCode_compression (i : SetMembers I) : + completion.externalFamilyVertexCode group oldAction compression (.inl i) (some ⟨()⟩) = natSetCode 1 := rfl + +theorem externalFamilyVertexCode_separation (x : SetMembers P0) : + completion.externalFamilyVertexCode group oldAction compression (.inr (.inl x)) (some ⟨()⟩) = natSetCode 1 := rfl + +theorem externalFamilyVertexCode_rectangle (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (b : Bool) : + completion.externalFamilyVertexCode group oldAction compression (.inr (.inr z)) (some ⟨b⟩) = + natSetCode (if b then 2 else 1) := by cases b <;> rfl + +end PartitionPilot.Forcing.GroundCompressionCompletion + + + +namespace PartitionPilot.Forcing +universe u + +structure GroundProfiledCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P0 C D rD original Targets Separators Filters : ZFSet.{u}) where + heighted : GroundHeightedCompression M initial I Sources Reps G m one T τ P0 C D rD original + profiles : CodedCompressionProfiles + (heighted.completion.algebra.union.fields 0) (heighted.completion.algebra.union.fields 1) + (heighted.completion.algebra.union.fields 2) (heighted.completion.algebra.caps τ) + Targets Separators Filters + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +theorem externalMaps_compression_iff (i : SetMembers I) (f : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) f ∈ completion.externalMaps ↔ + f = completion.externalMap i := by + rw [(completion.external_fields_entries (SetMembers.raw i) f ∅).1] + exact ⟨fun entry => (completion.algebra.function.unique entry (completion.externalMap_entry i)), + fun equal => equal.symm ▸ completion.externalMap_entry i⟩ + +theorem externalMaps_tag {tag x f : ZFSet.{u}} + (entry : ZFSet.pair (ZFSet.pair tag x) f ∈ completion.externalMaps) : tag = natSetCode 0 := by + have function := externalCompressionField_function completion.algebra.function.to_isFunc + have domain := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 + exact ZFSet.mem_singleton.1 (ZFSet.pair_mem_prod.1 domain).1 + +theorem externalMap_external_bound (i : SetMembers I) : completion.externalMap i ∈ completion.externalMaps.sUnion.sUnion := + pair_second_mem_doubleUnion ((completion.externalMaps_compression_iff i _).2 rfl) + +theorem externalOverlapForward_compression {P Rectangles r A : ZFSet.{u}} + (task : SetMembers I) (i x j y : ZFSet.{u}) : + ExternalRequestOverlapForward P G Rectangles completion.externalMaps completion.externalMaps.sUnion.sUnion r A + (natSetCode 0) (natSetCode 1) (natSetCode 2) + (ZFSet.pair (natSetCode 0) (SetMembers.raw task)) i x j y ↔ + i = natSetCode 0 ∧ j = natSetCode 1 ∧ ZFSet.pair y x ∈ completion.externalMap task := by + simp only [ExternalRequestOverlapForward, ZFSet.pair_inj, natSetCode_injective.eq_iff, + completion.externalMaps_compression_iff] + simp + intro _ _ _ + simpa only [ZFSet.mem_sUnion] using completion.externalMap_external_bound task + +theorem externalOverlapForward_separation {P Rectangles r A : ZFSet.{u}} + (point : SetMembers P) (i x j y : ZFSet.{u}) : + ExternalRequestOverlapForward P G Rectangles completion.externalMaps completion.externalMaps.sUnion.sUnion r A + (natSetCode 0) (natSetCode 1) (natSetCode 2) + (ZFSet.pair (natSetCode 1) (SetMembers.raw point)) i x j y ↔ + i = natSetCode 0 ∧ j = natSetCode 1 ∧ x = y ∧ ZFSet.pair x (SetMembers.raw point) ∈ r := by + have empty : ∀ f, ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw point)) f ∉ completion.externalMaps := by + intro f entry + have equal := natSetCode_injective (completion.externalMaps_tag entry) + exact Nat.noConfusion equal + simp only [ExternalRequestOverlapForward, ZFSet.pair_inj, natSetCode_injective.eq_iff] + simp [empty, SetMembers.raw_mem point] + +theorem externalOverlapForward_rectangle {P r0 μ0 A0 r A : ZFSet.{u}} + (z : SetMembers (externalRectangles P G r0 μ0 A0)) (i x j y : ZFSet.{u}) : + let v := externalRectangleParameters z + ExternalRequestOverlapForward P G (externalRectangles P G r0 μ0 A0) + completion.externalMaps completion.externalMaps.sUnion.sUnion r A + (natSetCode 0) (natSetCode 1) (natSetCode 2) + (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) i x j y ↔ + (i = natSetCode 0 ∧ j = natSetCode 1 ∧ ZFSet.pair y v.1 ∈ r ∧ ZFSet.pair (ZFSet.pair v.2.2.2.1 y) x ∈ A) ∨ + (i = natSetCode 0 ∧ j = natSetCode 2 ∧ ZFSet.pair y v.1 ∈ r ∧ ZFSet.pair (ZFSet.pair v.2.2.2.2 y) x ∈ A) ∨ + (i = natSetCode 1 ∧ j = natSetCode 2 ∧ x = y ∧ ZFSet.pair x v.2.1 ∈ r) := by + have empty : ∀ f, ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) f ∉ completion.externalMaps := by + intro f entry + have equal := natSetCode_injective (completion.externalMaps_tag entry) + exact Nat.noConfusion equal + dsimp only + rw [ExternalRequestOverlapForward] + constructor + · rintro (⟨_, _, f, _, entry, _⟩ | ⟨_, _, w, _, equal, _⟩ | rect) + · exact False.elim (empty f entry) + · exact False.elim (by have eq := natSetCode_injective (ZFSet.pair_inj.1 equal).1; omega) + · obtain ⟨t, _, c, _, b, _, d, _, g, _, h, _, qt, tuple, overlap⟩ := rect + have equalT := (ZFSet.pair_inj.1 qt).2 + have coords := externalRectangleCode_inj.1 + (tuple.symm.trans (equalT.symm.trans (externalRectangleParameters_spec z).1)) + obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := coords + exact overlap + · intro overlap + have params := externalRectangleParameters_spec z + exact Or.inr (Or.inr ⟨SetMembers.raw z, SetMembers.raw_mem z, + _, params.2.1, _, params.2.2.1, _, params.2.2.2.1, _, params.2.2.2.2.1, _, params.2.2.2.2.2.1, + rfl, params.1, overlap⟩) + +end GroundCompressionCompletion +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +structure GroundBornCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P0 C D rD original Targets Separators Filters base old : ZFSet.{u}) where + profiled : GroundProfiledCompression M initial I Sources Reps G m one T τ P0 C D rD original + Targets Separators Filters + births : GroundCompressionBirthData M initial I Sources Reps G m one T + profiled.heighted.completion.algebra.union base old + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionCompletion +open SetRealization Compression Compression.RecursiveMaps +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (compression : CompressionOriginalData P0 r0 μ0 A0 G + (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) + +local notation "p" => completion.algebra.union.meet.toSmallMeetOrder +local notation "f" => completion.externalFamily group oldAction compression +local notation "U" => completion.algebra.union.fields 0 +local notation "ru" => completion.algebra.union.fields 1 +local notation "au" => completion.algebra.union.fields 12 + +theorem externalFamily_diagonal_iff + (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) + (i : Option ((f).Child r)) (x y : SetMembers U) : + ((f).flatVertex r i).toFun x = ((f).flatVertex r i).toFun y ↔ SetMembers.raw x = SetMembers.raw y := + ⟨fun same => congrArg SetMembers.raw (embedding_injective ((f).flatVertex r i).toMeetEmbedding same), + fun same => congrArg ((f).flatVertex r i).toFun (SetMembers.raw_injective U same)⟩ + +theorem externalFamily_compression_overlap (task : SetMembers I) (x y : SetMembers U) : + ((f).flatVertex (.inl task) none).toFun x = ((f).flatVertex (.inl task) (some ⟨()⟩)).toFun y ↔ + ZFSet.pair (SetMembers.raw y) (SetMembers.raw x) ∈ completion.externalMap task := by + change (BinaryTiles.compression p (f).top (completion.externalCap task) (f).greatest + (completion.externalCopy task)).left.toFun x = + (BinaryTiles.compression p (f).top (completion.externalCap task) (f).greatest + (completion.externalCopy task)).right.toFun y ↔ _ + rw [BinaryTiles.compression_identification] + change Sum.inl x = Sum.inl ((completion.externalCopy task).toFun y).val ↔ _ + rw [Sum.inl.injEq, eq_comm] + exact (completion.algebra.embedding _ _ (completion.externalMap_entry task)).smallValue_eq_iff y x + +theorem externalFamily_separation_overlap (point : SetMembers P0) (x y : SetMembers U) : + ((f).flatVertex (.inr (.inl point)) none).toFun x = + ((f).flatVertex (.inr (.inl point)) (some ⟨()⟩)).toFun y ↔ + SetMembers.raw x = SetMembers.raw y ∧ ZFSet.pair (SetMembers.raw x) (SetMembers.raw point) ∈ ru := by + let W := SetMembers.ofMem (SetMembers.raw point) (compression.subset (SetMembers.raw_mem point)) + change (BinaryTiles.separation p W).left.toFun x = (BinaryTiles.separation p W).right.toFun y ↔ _ + rw [eq_comm, (BinaryTiles.separation p W).overlap_exact] + change (∃ _ : ZFSet.pair (SetMembers.raw y) (SetMembers.raw W) ∈ ru, y = x) ↔ _ + simp only [W, SetMembers.raw_ofMem] + constructor + · rintro ⟨lower, rfl⟩ + exact ⟨rfl, lower⟩ + · rintro ⟨same, lower⟩ + have equal := SetMembers.raw_injective U same + exact ⟨by simpa only [← equal] using lower, equal.symm⟩ + +theorem externalFamily_rectangle_first_overlap + (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x y : SetMembers U) : + let v := externalRectangleParameters z + ((f).flatVertex (.inr (.inr z)) none).toFun x = + ((f).flatVertex (.inr (.inr z)) (some ⟨false⟩)).toFun y ↔ + ZFSet.pair (SetMembers.raw y) v.1 ∈ ru ∧ + ZFSet.pair (ZFSet.pair v.2.2.2.1 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by + let rect := completion.externalRectangle group oldAction compression z + let tile := rect.toInput (f).top (f).greatest + change tile.root.toFun x = tile.first.toFun y ↔ _ + rw [eq_comm, tile.first_root_intersection] + have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields + group completion.algebra.union.action completion.algebra.union.meet + have code : (p).le y tile.C ↔ ZFSet.pair (SetMembers.raw y) (externalRectangleParameters z).1 ∈ ru := by + change ZFSet.pair (SetMembers.raw y) (SetMembers.raw rect.C) ∈ ru ↔ _ + rw [show SetMembers.raw rect.C = _ from fields.1] + have actor : tile.g1.toFun y = x ↔ + ZFSet.pair (ZFSet.pair (externalRectangleParameters z).2.2.2.1 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by + change completion.algebra.union.action.act rect.first y = x ↔ _ + rw [completion.algebra.union.action.act_eq_iff] + rw [show SetMembers.raw rect.first = _ from fields.2.2.2.1] + exact and_congr code actor + +theorem externalFamily_rectangle_second_overlap + (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x y : SetMembers U) : + let v := externalRectangleParameters z + ((f).flatVertex (.inr (.inr z)) none).toFun x = + ((f).flatVertex (.inr (.inr z)) (some ⟨true⟩)).toFun y ↔ + ZFSet.pair (SetMembers.raw y) v.1 ∈ ru ∧ + ZFSet.pair (ZFSet.pair v.2.2.2.2 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by + let rect := completion.externalRectangle group oldAction compression z + let tile := rect.toInput (f).top (f).greatest + change tile.root.toFun x = tile.second.toFun y ↔ _ + rw [eq_comm, tile.second_root_intersection] + have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields + group completion.algebra.union.action completion.algebra.union.meet + have code : (p).le y tile.C ↔ ZFSet.pair (SetMembers.raw y) (externalRectangleParameters z).1 ∈ ru := by + change ZFSet.pair (SetMembers.raw y) (SetMembers.raw rect.C) ∈ ru ↔ _ + rw [show SetMembers.raw rect.C = _ from fields.1] + have actor : tile.g2.toFun y = x ↔ + ZFSet.pair (ZFSet.pair (externalRectangleParameters z).2.2.2.2 (SetMembers.raw y)) (SetMembers.raw x) ∈ au := by + change completion.algebra.union.action.act rect.second y = x ↔ _ + rw [completion.algebra.union.action.act_eq_iff] + rw [show SetMembers.raw rect.second = _ from fields.2.2.2.2] + exact and_congr code actor + +theorem externalFamily_rectangle_children_overlap + (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x y : SetMembers U) : + let v := externalRectangleParameters z + ((f).flatVertex (.inr (.inr z)) (some ⟨false⟩)).toFun x = + ((f).flatVertex (.inr (.inr z)) (some ⟨true⟩)).toFun y ↔ + SetMembers.raw x = SetMembers.raw y ∧ ZFSet.pair (SetMembers.raw x) v.2.1 ∈ ru := by + let rect := completion.externalRectangle group oldAction compression z + let tile := rect.toInput (f).top (f).greatest + change tile.first.toFun x = tile.second.toFun y ↔ _ + rw [tile.children_intersection] + have fields := (((externalRectangleParameters_spec z).2).lift_compression compression oldAction).toSmallActionRectangle_fields + group completion.algebra.union.action completion.algebra.union.meet + change (ZFSet.pair (SetMembers.raw x) (SetMembers.raw rect.B) ∈ ru ∧ x = y) ↔ _ + rw [show SetMembers.raw rect.B = _ from fields.2.1] + rw [← (SetMembers.raw_injective U).eq_iff, and_comm] + +end PartitionPilot.Forcing.GroundCompressionCompletion + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionTheorem.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionTheorem.lean index cdb25f03c7fe49035683687180c268a6db0e3691..055cbbdffa52ec9c35a7c7bfe1c442908598fcc3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionTheorem.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionTheorem.lean @@ -1,43 +1,43 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.InaccessibleBounds - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Cardinal RationalHeights -open scoped Cardinal - -universe u v - -structure CompressionExtension {A G Task Label : Type u} {P : MeetOrder A} - (f : TaskSystem P G Task Label) extends CompressionAlgebra f where - cardinal_bound : #Space ≤ max ℵ₀ (max #Task #A) - height_extension : ∀ (Column : Type v) (C : LinearHeightOrder Column) - (seed : StrictHeight P (lexOrder C).toHeightOrder), CountableRange seed.value → - ∃ height : StrictHeight order (lexOrder C).toHeightOrder, - (∀ x, height.value (original.toFun x) = seed.value x) ∧ - CountableRange height.value ∧ - (∀ x, (lexOrder C).Weak (height.value x) (seed.value f.top)) - -namespace TaskSystem - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -noncomputable def compressionExtension : CompressionExtension.{u,v} f where - toCompressionAlgebra := f.compressionAlgebra - cardinal_bound := f.union_cardinal_bound - height_extension _ C seed countable := f.rational_height_extension C seed countable - -theorem compression_lemma (κ : Cardinal.{u}) (uncountable : ℵ₀ < κ) - (original : #A < κ) (tasks : #Task < κ) : - ∃ extension : CompressionExtension.{u,v} f, #extension.Space < κ := - ⟨f.compressionExtension, f.union_cardinal_lt κ uncountable original tasks⟩ - -end TaskSystem -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.InaccessibleBounds + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Cardinal RationalHeights +open scoped Cardinal + +universe u v + +structure CompressionExtension {A G Task Label : Type u} {P : MeetOrder A} + (f : TaskSystem P G Task Label) extends CompressionAlgebra f where + cardinal_bound : #Space ≤ max ℵ₀ (max #Task #A) + height_extension : ∀ (Column : Type v) (C : LinearHeightOrder Column) + (seed : StrictHeight P (lexOrder C).toHeightOrder), CountableRange seed.value → + ∃ height : StrictHeight order (lexOrder C).toHeightOrder, + (∀ x, height.value (original.toFun x) = seed.value x) ∧ + CountableRange height.value ∧ + (∀ x, (lexOrder C).Weak (height.value x) (seed.value f.top)) + +namespace TaskSystem + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +noncomputable def compressionExtension : CompressionExtension.{u,v} f where + toCompressionAlgebra := f.compressionAlgebra + cardinal_bound := f.union_cardinal_bound + height_extension _ C seed countable := f.rational_height_extension C seed countable + +theorem compression_lemma (κ : Cardinal.{u}) (uncountable : ℵ₀ < κ) + (original : #A < κ) (tasks : #Task < κ) : + ∃ extension : CompressionExtension.{u,v} f, #extension.Space < κ := + ⟨f.compressionExtension, f.union_cardinal_lt κ uncountable original tasks⟩ + +end TaskSystem +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionUnionBaseFilling.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionUnionBaseFilling.lean index a9ed0b7bf8b199d65de6a41322e44aa7117c3a89..2cc614a140cf6dcedb6097794172c3e596819fb9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionUnionBaseFilling.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/CompressionUnionBaseFilling.lean @@ -1,571 +1,571 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionOrigins - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -theorem mapFamilySection_union {D C families : Nat → ZFSet.{u}} - {I U V allFamilies : ZFSet.{u}} - (domain : NatUnionCode D U) (range : NatUnionCode C V) - (familyUnion : NatUnionCode families allFamilies) - (maps : ∀ n, FunctionGraphOn I (families n)) - (functions : ∀ n i f, ZFSet.pair i f ∈ families n → ZFSet.IsFunc (D n) (C n) f) - (i : {i : ZFSet.{u} // i ∈ I}) : - NatUnionCode (fun n => (maps n).value i) - (indexedRelationSection U V (mapFamilyApplicationGraph I U V allFamilies) i.val) := by - intro z - constructor - · intro member - obtain ⟨x, _, y, _, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ _).1 member - obtain ⟨_, _, _, f, indexed, value⟩ := (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).1 entry - obtain ⟨n, oldIndexed⟩ := (familyUnion _).1 indexed - have equal := (maps n).value_eq_of_entry i oldIndexed - refine ⟨n, ?_⟩ - change ZFSet.pair x y ∈ (maps n).value i - rw [equal] - exact value - · rintro ⟨n, member⟩ - have indexed := (maps n).value_entry i - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((functions n i.val _ indexed).1 member) - apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 - refine ⟨domain.subset n hx, range.subset n hy, ?_⟩ - exact (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).2 - ⟨i.property, domain.subset n hx, range.subset n hy, (maps n).value i, - familyUnion.subset n indexed, member⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem exists_groundMapUnionFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {D C families : Nat → ZFSet.{u}} {I U V allFamilies : ZFSet.{u}} - (hI : I ∈ M.sets) (hU : U ∈ M.sets) (hV : V ∈ M.sets) (hFamilies : allFamilies ∈ M.sets) - (domain : NatUnionCode D U) (range : NatUnionCode C V) - (familyUnion : NatUnionCode families allFamilies) - (maps : ∀ n, FunctionGraphOn I (families n)) - (functions : ∀ n i f, ZFSet.pair i f ∈ families n → ZFSet.IsFunc (D n) (C n) f) : - ∃ result ∈ M.sets, FunctionGraphOn I result ∧ - ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ f, ZFSet.pair i.val f ∈ result → - NatUnionCode (fun n => (maps n).value i) f := by - let flat := mapFamilyApplicationGraph I U V allFamilies - have hFlat := M.mapFamilyApplicationGraph_mem pairing unions powers separation hI hU hV hFamilies - obtain ⟨hResult, resultFunction, entries⟩ := - M.indexedRelationSections_spec pairing unions powers separation hI hU hV hFlat - refine ⟨M.indexedRelationSections I U V flat, hResult, ⟨_, resultFunction⟩, ?_⟩ - intro i f entry - have equal := ((entries i.val f).1 entry).2 - rw [equal] - exact mapFamilySection_union domain range familyUnion maps functions i - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundMeetEmbeddingUnionFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {D C rD rC μD μC families : Nat → ZFSet.{u}} - {I U V RU RV MU MV allFamilies : ZFSet.{u}} - (hI : I ∈ M.sets) (hU : U ∈ M.sets) (hV : V ∈ M.sets) (hFamilies : allFamilies ∈ M.sets) - (domain : NatUnionCode D U) (range : NatUnionCode C V) - (domainOrder : NatUnionCode rD RU) (rangeOrder : NatUnionCode rC RV) - (domainMeet : NatUnionCode μD MU) (rangeMeet : NatUnionCode μC MV) - (familyUnion : NatUnionCode families allFamilies) - (maps : ∀ n, FunctionGraphOn I (families n)) - (embeddings : ∀ n i f, ZFSet.pair i f ∈ families n → - MeetEmbeddingCode (D n) (C n) (rD n) (rC n) (μD n) (μC n) f) - (mapMono : ∀ n m, n ≤ m → ∀ i f g, - ZFSet.pair i f ∈ families n → ZFSet.pair i g ∈ families m → f ⊆ g) - (orderMono : ∀ n m, n ≤ m → rD n ⊆ rD m) - (meetMono : ∀ n m, n ≤ m → μD n ⊆ μD m) : - ∃ result ∈ M.sets, FunctionGraphOn I result ∧ - ∀ i f, ZFSet.pair i f ∈ result → - MeetEmbeddingCode U V RU RV MU MV f ∧ - (∀ z, z ∈ f ↔ ∃ n, ∃ old, ZFSet.pair i old ∈ families n ∧ z ∈ old) ∧ - ∀ n old, ZFSet.pair i old ∈ families n → ∀ x ∈ D n, ∀ y, - ZFSet.pair x y ∈ f ↔ ZFSet.pair x y ∈ old := by - obtain ⟨result, hResult, resultFunction, sections⟩ := - M.exists_groundMapUnionFamily pairing unions powers separation hI hU hV hFamilies - domain range familyUnion maps (fun n i f entry => (embeddings n i f entry).injection.function) - refine ⟨result, hResult, resultFunction, ?_⟩ - intro i f entry - have hi : i ∈ I := resultFunction.pair_source entry - let task : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have graph := sections task f entry - have finiteEmbedding (n : Nat) := embeddings n i _ ((maps n).value_entry task) - have increasing : ∀ n m, n ≤ m → (maps n).value task ⊆ (maps m).value task := - fun n m lower => mapMono n m lower i _ _ ((maps n).value_entry task) ((maps m).value_entry task) - have full := domain.meetEmbedding range domainOrder rangeOrder domainMeet rangeMeet - graph finiteEmbedding increasing orderMono meetMono - refine ⟨full, ?_, ?_⟩ - · intro z - rw [graph z] - constructor - · rintro ⟨n, member⟩ - exact ⟨n, (maps n).value task, (maps n).value_entry task, member⟩ - · rintro ⟨n, old, indexed, member⟩ - have equal := (maps n).value_eq_of_entry task indexed - refine ⟨n, ?_⟩ - change z ∈ (maps n).value task - rw [equal] - exact member - · intro n old indexed x hx y - have equal := (maps n).value_eq_of_entry task indexed - exact (graph.function_entry_iff full.injection.function - (fun n => (finiteEmbedding n).injection.function) n hx).trans - (by rw [equal]) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem exists_groundUnionMaps - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (union : GroundCompressionUnionData M state.data I Sources Reps G m one T) : - ∃ maps ∈ M.sets, FunctionGraphOn I maps ∧ - ∀ i f, ZFSet.pair i f ∈ maps → - MeetEmbeddingCode (union.fields 0) (union.fields 0) (union.fields 1) (union.fields 1) - (union.fields 2) (union.fields 2) f ∧ - (∀ z, z ∈ f ↔ ∃ n, ∃ old, - ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps ∧ z ∈ old) ∧ - ∀ n old, ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps → - ∀ x ∈ (state.data.iterate M I Sources Reps G T n).D, ∀ y, - ZFSet.pair x y ∈ f ↔ ZFSet.pair x y ∈ old := by - have codes := state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT - have mono {n k : Nat} (before : n ≤ k) := - state.canonical_iterate_graphs_mono pairing unions powers separation hI hSources hReps hG hT before - exact M.exists_groundMeetEmbeddingUnionFamily pairing unions powers separation - hI (union.ground 0) (union.ground 0) (union.ground 11) - (union.fieldUnion 0) union.currentCarrier (union.fieldUnion 1) union.currentOrder - (union.fieldUnion 2) union.currentMeet (union.fieldUnion 11) - (fun n => (codes n).2.2.2.1) (fun n => (codes n).2.2.2.2) - (fun _ _ before => (mono before).2.2.2.2.2.2.2) - (fun _ _ before => (mono before).2.1) (fun _ _ before => (mono before).2.2.1) - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure GroundCompressionAlgebra (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T : ZFSet.{u}) where - union : GroundCompressionUnionData M initial I Sources Reps G m one T - maps : ZFSet.{u} - ground : maps ∈ M.sets - function : FunctionGraphOn I maps - embedding : ∀ i f, ZFSet.pair i f ∈ maps → - MeetEmbeddingCode (union.fields 0) (union.fields 0) (union.fields 1) (union.fields 1) - (union.fields 2) (union.fields 2) f - entries : ∀ i f, ZFSet.pair i f ∈ maps → ∀ z, - z ∈ f ↔ ∃ n, ∃ old, ZFSet.pair i old ∈ (initial.iterate M I Sources Reps G T n).Maps ∧ z ∈ old - restrict : ∀ i f, ZFSet.pair i f ∈ maps → ∀ n old, - ZFSet.pair i old ∈ (initial.iterate M I Sources Reps G T n).Maps → - ∀ x ∈ (initial.iterate M I Sources Reps G T n).D, ∀ y, - ZFSet.pair x y ∈ f ↔ ZFSet.pair x y ∈ old - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem exists_groundAlgebra - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : - Nonempty (GroundCompressionAlgebra M state.data I Sources Reps G m one T) := by - obtain ⟨union⟩ := state.exists_groundUnion pairing unions powers separation collection infinite - hI hSources hReps hG hT - obtain ⟨maps, ground, function, correct⟩ := state.exists_groundUnionMaps - pairing unions powers separation hI hSources hReps hG hT union - exact ⟨⟨union, maps, ground, function, fun i f entry => (correct i f entry).1, - fun i f entry => (correct i f entry).2.1, fun i f entry => (correct i f entry).2.2⟩⟩ - -end GroundCompressionState - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem union_fresh_accounting - (initial : FiniteCompressionAccounting P0 I Sources τ state.data) : - ∀ x ∈ algebra.union.fields 0, x ∈ P0 ∨ - ∃ i ∈ I, ∃ f a k b, ∃ y ∈ algebra.union.fields 0, - ZFSet.pair i f ∈ algebra.maps ∧ ZFSet.pair i a ∈ Sources ∧ - ZFSet.pair τ k ∈ f ∧ ZFSet.pair a b ∈ f ∧ ZFSet.pair y x ∈ f ∧ - ZFSet.pair x k ∈ algebra.union.fields 1 ∧ ZFSet.pair x b ∉ algebra.union.fields 1 := by - intro x hx - obtain ⟨n, hn⟩ := (algebra.union.currentCarrier x).1 hx - rcases state.canonical_iterate_accounting pairing unions powers separation hI hSources hReps hG hT - initial n x hn with original | accounted - · exact Or.inl original - · obtain ⟨i, hi, S, a, k, b, y, hy, indexed, source, cap, base, image, lower, outside⟩ := accounted - obtain ⟨f, unionIndexed⟩ := algebra.function.total hi - have finite := (state.canonical_iterate_codes pairing unions powers separation - hI hSources hReps hG hT n).2.2.2.2 i S indexed - have hb := (ZFSet.pair_mem_prod.1 (finite.injection.function.1 base)).2 - have reflect := algebra.union.currentOrder.order_entry_iff - (fun _ _ before => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT before).2.2.2.2.1) - (fun _ _ before => (state.canonical_iterate_coherent pairing unions powers separation - hI hSources hReps hG hT before).currentOrder) n hn hb - refine Or.inr ⟨i, hi, f, a, k, b, y, (algebra.union.fieldUnion 0).subset n hy, - unionIndexed, source, - (algebra.entries i f unionIndexed _).2 ⟨n, S, indexed, cap⟩, - (algebra.entries i f unionIndexed _).2 ⟨n, S, indexed, base⟩, - (algebra.entries i f unionIndexed _).2 ⟨n, S, indexed, image⟩, - algebra.union.currentOrder.subset n lower, ?_⟩ - exact fun unionLower => outside (reflect.1 unionLower) - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem union_map_equivariant {g i j f f' x y z : ZFSet.{u}} - (transport : ZFSet.pair (ZFSet.pair g i) j ∈ T) - (firstMap : ZFSet.pair i f ∈ algebra.maps) (secondMap : ZFSet.pair j f' ∈ algebra.maps) - (first : ZFSet.pair x y ∈ f) (second : ZFSet.pair x z ∈ f') : - ZFSet.pair (ZFSet.pair g y) z ∈ algebra.union.fields 12 := by - have hx := (ZFSet.pair_mem_prod.1 ((algebra.embedding i f firstMap).injection.function.1 first)).1 - obtain ⟨n, hn⟩ := (algebra.union.fieldUnion 0 x).1 hx - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - obtain ⟨old, oldEntry⟩ := current.inputs.maps.total (algebra.function.pair_source firstMap) - obtain ⟨old', oldEntry'⟩ := current.inputs.maps.total (algebra.function.pair_source secondMap) - have canonicalOld : ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps := by - simpa only [equal] using oldEntry - have canonicalOld' : ZFSet.pair j old' ∈ (state.data.iterate M I Sources Reps G T n).Maps := by - simpa only [equal] using oldEntry' - have firstOld := (algebra.restrict i f firstMap n old canonicalOld x hn y).1 first - have secondOld := (algebra.restrict j f' secondMap n old' canonicalOld' x hn z).1 second - apply (algebra.union.fieldUnion 12).subset n - have intertwined := current.task.intertwine g i j old old' x y z - transport oldEntry oldEntry' firstOld secondOld - rw [equal] at intertwined - exact intertwined - -theorem union_map_agrees_on_source {i f a g x y : ZFSet.{u}} - (map : ZFSet.pair i f ∈ algebra.maps) (source : ZFSet.pair i a ∈ Sources) - (representative : ZFSet.pair i g ∈ Reps) - (below : ZFSet.pair x a ∈ algebra.union.fields 1) : - ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ algebra.union.fields 12 := by - obtain ⟨n, lower⟩ := (algebra.union.fieldUnion 1 (ZFSet.pair x a)).1 below - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have lowerCurrent : ZFSet.pair x a ∈ current.data.rD := by - rw [equal] - exact lower - have hx := (ZFSet.pair_mem_prod.1 (current.batch.oldOrder.order.relation lowerCurrent)).1 - have hxCanonical : x ∈ (state.data.iterate M I Sources Reps G T n).D := by - simpa only [equal] using hx - obtain ⟨old, oldEntry⟩ := current.inputs.maps.total (algebra.function.pair_source map) - have canonicalOld : ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps := by - simpa only [equal] using oldEntry - have agreement : ZFSet.pair x y ∈ old ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ (state.data.iterate M I Sources Reps G T n).A := by - simpa only [equal] using current.inputs.agreement i a g old x y - source representative oldEntry hx lowerCurrent - exact (algebra.restrict i f map n old canonicalOld x hxCanonical y).trans - (agreement.trans (state.union_action_iff algebra.union pairing unions powers separation - hI hSources hReps hG hT n (old_mem_taggedExtension hxCanonical)).symm) - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionAlgebra -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T : ZFSet.{u}} -variable (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) - -theorem map_eq_section {i f : ZFSet.{u}} (entry : ZFSet.pair i f ∈ algebra.maps) : - f = indexedRelationSection (algebra.union.fields 0) (algebra.union.fields 0) - (mapFamilyApplicationGraph I (algebra.union.fields 0) (algebra.union.fields 0) - (algebra.union.fields 11)) i := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 - ((algebra.embedding i f entry).injection.function.1 hz) - obtain ⟨n, old, indexed, oldEntry⟩ := (algebra.entries i f entry _).1 hz - exact (pair_mem_indexedRelationSection _ _ _ _ _ _).2 ⟨hx, hy, - (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).2 - ⟨algebra.function.pair_source entry, hx, hy, old, - (algebra.union.fieldUnion 11).subset n indexed, oldEntry⟩⟩ - · intro hz - obtain ⟨x, hx, y, hy, rfl, flat⟩ := (mem_indexedRelationSection _ _ _ _ _).1 hz - obtain ⟨_, _, _, old, indexed, oldEntry⟩ := - (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).1 flat - obtain ⟨n, atStage⟩ := (algebra.union.fieldUnion 11 _).1 indexed - exact (algebra.entries i f entry _).2 ⟨n, old, atStage, oldEntry⟩ - -theorem maps_eq_sections : - algebra.maps = M.indexedRelationSections I (algebra.union.fields 0) (algebra.union.fields 0) - (mapFamilyApplicationGraph I (algebra.union.fields 0) (algebra.union.fields 0) - (algebra.union.fields 11)) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨i, _, f, rfl⟩ := algebra.function.shape z hz - exact (M.pair_mem_indexedRelationSections _ _ _ _ _ _).2 - ⟨algebra.function.pair_source hz, - (M.mem_groundRelations _ _ _).2 - ⟨M.pair_right (M.transitive algebra.ground hz), - (algebra.embedding i f hz).injection.function.1⟩, - algebra.map_eq_section hz⟩ - · intro hz - obtain ⟨_, i, hi, f, _, rfl, equal⟩ := ZFSet.mem_sep.1 hz - obtain ⟨old, entry⟩ := algebra.function.total hi - have same : old = f := (algebra.map_eq_section entry).trans equal.symm - exact same ▸ entry - -end PartitionPilot.Forcing.GroundCompressionAlgebra - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace GroundCompressionAlgebra -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T : ZFSet.{u}} - -def bases (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) : ZFSet.{u} := - familyEvaluationGraph I (algebra.union.fields 0) (algebra.union.fields 0) - (ZFSet.sUnion (ZFSet.sUnion algebra.maps)) algebra.maps Sources - -noncomputable def caps (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) - (τ : ZFSet.{u}) : ZFSet.{u} := - familyEvaluationGraph I (algebra.union.fields 0) (algebra.union.fields 0) - (ZFSet.sUnion (ZFSet.sUnion algebra.maps)) algebra.maps (constantFamilyGraph I τ) - -end GroundCompressionAlgebra - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) - -theorem union_sources_function : ZFSet.IsFunc I (algebra.union.fields 0) Sources := by - refine ⟨?_, seed.sources.2⟩ - intro z hz - obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (seed.sources.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hi, state.union_original_subset algebra.union ha⟩ - -theorem union_top_arguments_function : - ZFSet.IsFunc I (algebra.union.fields 0) (constantFamilyGraph I τ) := by - refine ⟨?_, (constantFamilyGraph_function I τ).2⟩ - intro z hz - obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 ((constantFamilyGraph_function I τ).1 hz) - have equal := ZFSet.mem_singleton.1 ha - subst a - exact ZFSet.pair_mem_prod.2 ⟨hi, state.union_original_subset algebra.union seed.top_mem⟩ - -theorem union_bases_function : ZFSet.IsFunc I (algebra.union.fields 0) algebra.bases := - familyEvaluationGraph_function algebra.function.to_isFunc (state.union_sources_function algebra) - (fun i f entry => (algebra.embedding i f entry).injection.function) - -theorem union_caps_function : ZFSet.IsFunc I (algebra.union.fields 0) (algebra.caps τ) := - familyEvaluationGraph_function algebra.function.to_isFunc (state.union_top_arguments_function algebra) - (fun i f entry => (algebra.embedding i f entry).injection.function) - -theorem union_base_entry_iff {i f a b : ZFSet.{u}} (map : ZFSet.pair i f ∈ algebra.maps) - (source : ZFSet.pair i a ∈ Sources) : - ZFSet.pair i b ∈ algebra.bases ↔ ZFSet.pair a b ∈ f := by - rw [GroundCompressionAlgebra.bases, - familyEvaluationGraph_entry_iff algebra.function.to_isFunc (state.union_sources_function algebra) map source] - exact ⟨fun h => h.2, fun h => ⟨(ZFSet.pair_mem_prod.1 - ((algebra.embedding i f map).injection.function.1 h)).2, h⟩⟩ - -theorem union_cap_entry_iff {i f k : ZFSet.{u}} (map : ZFSet.pair i f ∈ algebra.maps) : - ZFSet.pair i k ∈ algebra.caps τ ↔ ZFSet.pair τ k ∈ f := by - have argument := (pair_mem_constantFamilyGraph I τ i τ).2 - ⟨(ZFSet.pair_mem_prod.1 (algebra.function.to_isFunc.1 map)).1, rfl⟩ - rw [GroundCompressionAlgebra.caps, - familyEvaluationGraph_entry_iff algebra.function.to_isFunc (state.union_top_arguments_function algebra) map argument] - exact ⟨fun h => h.2, fun h => ⟨(ZFSet.pair_mem_prod.1 - ((algebra.embedding i f map).injection.function.1 h)).2, h⟩⟩ - -theorem union_markings_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) : - algebra.bases ∈ M.sets ∧ algebra.caps τ ∈ M.sets := by - have hValues := M.union_mem unions (M.union_mem unions algebra.ground) - have hτ := M.transitive state.ground.carrier (state.invariant.originalSubset seed.top_mem) - exact ⟨M.familyEvaluationGraph_mem pairing unions powers separation hI (algebra.union.ground 0) - (algebra.union.ground 0) hValues algebra.ground hSources, - M.familyEvaluationGraph_mem pairing unions powers separation hI (algebra.union.ground 0) - (algebra.union.ground 0) hValues algebra.ground - (M.constantFamilyGraph_mem pairing unions powers separation hI hτ)⟩ - -end GroundCompressionState -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialCompressionAlgebra - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ _seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, - Nonempty (GroundCompressionAlgebra M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T) := by - dsimp only - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, initial, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, seed, ?_⟩ - rw [← initialData] - exact initial.exists_groundAlgebra pairing unions powers separation collection infinite - hI hSources hReps hG hT - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem union_top {x : ZFSet.{u}} (hx : x ∈ algebra.union.fields 0) : - ZFSet.pair x τ ∈ algebra.union.fields 1 := by - obtain ⟨n, hn⟩ := (algebra.union.fieldUnion 0 x).1 hx - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have hxCurrent : x ∈ current.data.D := by - rw [equal] - exact hn - apply (algebra.union.fieldUnion 1).subset n - have belowTop := current.invariant.top x hxCurrent - rw [equal] at belowTop - exact belowTop - -theorem union_map_base_filling {i f a g b x : ZFSet.{u}} - (map : ZFSet.pair i f ∈ algebra.maps) (source : ZFSet.pair i a ∈ Sources) - (representative : ZFSet.pair i g ∈ Reps) (base : ZFSet.pair a b ∈ f) - (hx : x ∈ algebra.union.fields 0) (below : ZFSet.pair x b ∈ algebra.union.fields 1) : - ∃ y ∈ algebra.union.fields 0, ZFSet.pair y x ∈ f := by - have hg := (ZFSet.pair_mem_prod.1 (state.inputs.representatives.1 representative)).2 - have ha := (ZFSet.pair_mem_prod.1 ((algebra.embedding i f map).injection.function.1 base)).1 - have actedBase := (state.union_map_agrees_on_source algebra pairing unions powers separation - hI hSources hReps hG hT map source representative (algebra.union.meet.order.refl a ha)).1 base - obtain ⟨y, hy, acted⟩ := algebra.union.action.raw_preimage state.inputs.group hg hx - have belowSource := (algebra.union.action.raw_order_iff state.inputs.group - algebra.union.meet.order hg acted actedBase).1 below - exact ⟨y, hy, (state.union_map_agrees_on_source algebra pairing unions powers separation - hI hSources hReps hG hT map source representative belowSource).2 acted⟩ - -theorem union_map_range_below_cap {i f k x y : ZFSet.{u}} - (map : ZFSet.pair i f ∈ algebra.maps) (cap : ZFSet.pair τ k ∈ f) - (image : ZFSet.pair x y ∈ f) : ZFSet.pair y k ∈ algebra.union.fields 1 := by - have embedding := algebra.embedding i f map - have hx := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).1 - exact embedding.monotone x τ y k - (state.union_top algebra pairing unions powers separation hI hSources hReps hG hT hx) image cap - -end PartitionPilot.Forcing.GroundCompressionState - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionOrigins + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +theorem mapFamilySection_union {D C families : Nat → ZFSet.{u}} + {I U V allFamilies : ZFSet.{u}} + (domain : NatUnionCode D U) (range : NatUnionCode C V) + (familyUnion : NatUnionCode families allFamilies) + (maps : ∀ n, FunctionGraphOn I (families n)) + (functions : ∀ n i f, ZFSet.pair i f ∈ families n → ZFSet.IsFunc (D n) (C n) f) + (i : {i : ZFSet.{u} // i ∈ I}) : + NatUnionCode (fun n => (maps n).value i) + (indexedRelationSection U V (mapFamilyApplicationGraph I U V allFamilies) i.val) := by + intro z + constructor + · intro member + obtain ⟨x, _, y, _, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ _).1 member + obtain ⟨_, _, _, f, indexed, value⟩ := (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).1 entry + obtain ⟨n, oldIndexed⟩ := (familyUnion _).1 indexed + have equal := (maps n).value_eq_of_entry i oldIndexed + refine ⟨n, ?_⟩ + change ZFSet.pair x y ∈ (maps n).value i + rw [equal] + exact value + · rintro ⟨n, member⟩ + have indexed := (maps n).value_entry i + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((functions n i.val _ indexed).1 member) + apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 + refine ⟨domain.subset n hx, range.subset n hy, ?_⟩ + exact (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).2 + ⟨i.property, domain.subset n hx, range.subset n hy, (maps n).value i, + familyUnion.subset n indexed, member⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem exists_groundMapUnionFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {D C families : Nat → ZFSet.{u}} {I U V allFamilies : ZFSet.{u}} + (hI : I ∈ M.sets) (hU : U ∈ M.sets) (hV : V ∈ M.sets) (hFamilies : allFamilies ∈ M.sets) + (domain : NatUnionCode D U) (range : NatUnionCode C V) + (familyUnion : NatUnionCode families allFamilies) + (maps : ∀ n, FunctionGraphOn I (families n)) + (functions : ∀ n i f, ZFSet.pair i f ∈ families n → ZFSet.IsFunc (D n) (C n) f) : + ∃ result ∈ M.sets, FunctionGraphOn I result ∧ + ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ f, ZFSet.pair i.val f ∈ result → + NatUnionCode (fun n => (maps n).value i) f := by + let flat := mapFamilyApplicationGraph I U V allFamilies + have hFlat := M.mapFamilyApplicationGraph_mem pairing unions powers separation hI hU hV hFamilies + obtain ⟨hResult, resultFunction, entries⟩ := + M.indexedRelationSections_spec pairing unions powers separation hI hU hV hFlat + refine ⟨M.indexedRelationSections I U V flat, hResult, ⟨_, resultFunction⟩, ?_⟩ + intro i f entry + have equal := ((entries i.val f).1 entry).2 + rw [equal] + exact mapFamilySection_union domain range familyUnion maps functions i + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundMeetEmbeddingUnionFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {D C rD rC μD μC families : Nat → ZFSet.{u}} + {I U V RU RV MU MV allFamilies : ZFSet.{u}} + (hI : I ∈ M.sets) (hU : U ∈ M.sets) (hV : V ∈ M.sets) (hFamilies : allFamilies ∈ M.sets) + (domain : NatUnionCode D U) (range : NatUnionCode C V) + (domainOrder : NatUnionCode rD RU) (rangeOrder : NatUnionCode rC RV) + (domainMeet : NatUnionCode μD MU) (rangeMeet : NatUnionCode μC MV) + (familyUnion : NatUnionCode families allFamilies) + (maps : ∀ n, FunctionGraphOn I (families n)) + (embeddings : ∀ n i f, ZFSet.pair i f ∈ families n → + MeetEmbeddingCode (D n) (C n) (rD n) (rC n) (μD n) (μC n) f) + (mapMono : ∀ n m, n ≤ m → ∀ i f g, + ZFSet.pair i f ∈ families n → ZFSet.pair i g ∈ families m → f ⊆ g) + (orderMono : ∀ n m, n ≤ m → rD n ⊆ rD m) + (meetMono : ∀ n m, n ≤ m → μD n ⊆ μD m) : + ∃ result ∈ M.sets, FunctionGraphOn I result ∧ + ∀ i f, ZFSet.pair i f ∈ result → + MeetEmbeddingCode U V RU RV MU MV f ∧ + (∀ z, z ∈ f ↔ ∃ n, ∃ old, ZFSet.pair i old ∈ families n ∧ z ∈ old) ∧ + ∀ n old, ZFSet.pair i old ∈ families n → ∀ x ∈ D n, ∀ y, + ZFSet.pair x y ∈ f ↔ ZFSet.pair x y ∈ old := by + obtain ⟨result, hResult, resultFunction, sections⟩ := + M.exists_groundMapUnionFamily pairing unions powers separation hI hU hV hFamilies + domain range familyUnion maps (fun n i f entry => (embeddings n i f entry).injection.function) + refine ⟨result, hResult, resultFunction, ?_⟩ + intro i f entry + have hi : i ∈ I := resultFunction.pair_source entry + let task : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have graph := sections task f entry + have finiteEmbedding (n : Nat) := embeddings n i _ ((maps n).value_entry task) + have increasing : ∀ n m, n ≤ m → (maps n).value task ⊆ (maps m).value task := + fun n m lower => mapMono n m lower i _ _ ((maps n).value_entry task) ((maps m).value_entry task) + have full := domain.meetEmbedding range domainOrder rangeOrder domainMeet rangeMeet + graph finiteEmbedding increasing orderMono meetMono + refine ⟨full, ?_, ?_⟩ + · intro z + rw [graph z] + constructor + · rintro ⟨n, member⟩ + exact ⟨n, (maps n).value task, (maps n).value_entry task, member⟩ + · rintro ⟨n, old, indexed, member⟩ + have equal := (maps n).value_eq_of_entry task indexed + refine ⟨n, ?_⟩ + change z ∈ (maps n).value task + rw [equal] + exact member + · intro n old indexed x hx y + have equal := (maps n).value_eq_of_entry task indexed + exact (graph.function_entry_iff full.injection.function + (fun n => (finiteEmbedding n).injection.function) n hx).trans + (by rw [equal]) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem exists_groundUnionMaps + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (union : GroundCompressionUnionData M state.data I Sources Reps G m one T) : + ∃ maps ∈ M.sets, FunctionGraphOn I maps ∧ + ∀ i f, ZFSet.pair i f ∈ maps → + MeetEmbeddingCode (union.fields 0) (union.fields 0) (union.fields 1) (union.fields 1) + (union.fields 2) (union.fields 2) f ∧ + (∀ z, z ∈ f ↔ ∃ n, ∃ old, + ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps ∧ z ∈ old) ∧ + ∀ n old, ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps → + ∀ x ∈ (state.data.iterate M I Sources Reps G T n).D, ∀ y, + ZFSet.pair x y ∈ f ↔ ZFSet.pair x y ∈ old := by + have codes := state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT + have mono {n k : Nat} (before : n ≤ k) := + state.canonical_iterate_graphs_mono pairing unions powers separation hI hSources hReps hG hT before + exact M.exists_groundMeetEmbeddingUnionFamily pairing unions powers separation + hI (union.ground 0) (union.ground 0) (union.ground 11) + (union.fieldUnion 0) union.currentCarrier (union.fieldUnion 1) union.currentOrder + (union.fieldUnion 2) union.currentMeet (union.fieldUnion 11) + (fun n => (codes n).2.2.2.1) (fun n => (codes n).2.2.2.2) + (fun _ _ before => (mono before).2.2.2.2.2.2.2) + (fun _ _ before => (mono before).2.1) (fun _ _ before => (mono before).2.2.1) + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure GroundCompressionAlgebra (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T : ZFSet.{u}) where + union : GroundCompressionUnionData M initial I Sources Reps G m one T + maps : ZFSet.{u} + ground : maps ∈ M.sets + function : FunctionGraphOn I maps + embedding : ∀ i f, ZFSet.pair i f ∈ maps → + MeetEmbeddingCode (union.fields 0) (union.fields 0) (union.fields 1) (union.fields 1) + (union.fields 2) (union.fields 2) f + entries : ∀ i f, ZFSet.pair i f ∈ maps → ∀ z, + z ∈ f ↔ ∃ n, ∃ old, ZFSet.pair i old ∈ (initial.iterate M I Sources Reps G T n).Maps ∧ z ∈ old + restrict : ∀ i f, ZFSet.pair i f ∈ maps → ∀ n old, + ZFSet.pair i old ∈ (initial.iterate M I Sources Reps G T n).Maps → + ∀ x ∈ (initial.iterate M I Sources Reps G T n).D, ∀ y, + ZFSet.pair x y ∈ f ↔ ZFSet.pair x y ∈ old + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem exists_groundAlgebra + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : + Nonempty (GroundCompressionAlgebra M state.data I Sources Reps G m one T) := by + obtain ⟨union⟩ := state.exists_groundUnion pairing unions powers separation collection infinite + hI hSources hReps hG hT + obtain ⟨maps, ground, function, correct⟩ := state.exists_groundUnionMaps + pairing unions powers separation hI hSources hReps hG hT union + exact ⟨⟨union, maps, ground, function, fun i f entry => (correct i f entry).1, + fun i f entry => (correct i f entry).2.1, fun i f entry => (correct i f entry).2.2⟩⟩ + +end GroundCompressionState + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem union_fresh_accounting + (initial : FiniteCompressionAccounting P0 I Sources τ state.data) : + ∀ x ∈ algebra.union.fields 0, x ∈ P0 ∨ + ∃ i ∈ I, ∃ f a k b, ∃ y ∈ algebra.union.fields 0, + ZFSet.pair i f ∈ algebra.maps ∧ ZFSet.pair i a ∈ Sources ∧ + ZFSet.pair τ k ∈ f ∧ ZFSet.pair a b ∈ f ∧ ZFSet.pair y x ∈ f ∧ + ZFSet.pair x k ∈ algebra.union.fields 1 ∧ ZFSet.pair x b ∉ algebra.union.fields 1 := by + intro x hx + obtain ⟨n, hn⟩ := (algebra.union.currentCarrier x).1 hx + rcases state.canonical_iterate_accounting pairing unions powers separation hI hSources hReps hG hT + initial n x hn with original | accounted + · exact Or.inl original + · obtain ⟨i, hi, S, a, k, b, y, hy, indexed, source, cap, base, image, lower, outside⟩ := accounted + obtain ⟨f, unionIndexed⟩ := algebra.function.total hi + have finite := (state.canonical_iterate_codes pairing unions powers separation + hI hSources hReps hG hT n).2.2.2.2 i S indexed + have hb := (ZFSet.pair_mem_prod.1 (finite.injection.function.1 base)).2 + have reflect := algebra.union.currentOrder.order_entry_iff + (fun _ _ before => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT before).2.2.2.2.1) + (fun _ _ before => (state.canonical_iterate_coherent pairing unions powers separation + hI hSources hReps hG hT before).currentOrder) n hn hb + refine Or.inr ⟨i, hi, f, a, k, b, y, (algebra.union.fieldUnion 0).subset n hy, + unionIndexed, source, + (algebra.entries i f unionIndexed _).2 ⟨n, S, indexed, cap⟩, + (algebra.entries i f unionIndexed _).2 ⟨n, S, indexed, base⟩, + (algebra.entries i f unionIndexed _).2 ⟨n, S, indexed, image⟩, + algebra.union.currentOrder.subset n lower, ?_⟩ + exact fun unionLower => outside (reflect.1 unionLower) + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem union_map_equivariant {g i j f f' x y z : ZFSet.{u}} + (transport : ZFSet.pair (ZFSet.pair g i) j ∈ T) + (firstMap : ZFSet.pair i f ∈ algebra.maps) (secondMap : ZFSet.pair j f' ∈ algebra.maps) + (first : ZFSet.pair x y ∈ f) (second : ZFSet.pair x z ∈ f') : + ZFSet.pair (ZFSet.pair g y) z ∈ algebra.union.fields 12 := by + have hx := (ZFSet.pair_mem_prod.1 ((algebra.embedding i f firstMap).injection.function.1 first)).1 + obtain ⟨n, hn⟩ := (algebra.union.fieldUnion 0 x).1 hx + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + obtain ⟨old, oldEntry⟩ := current.inputs.maps.total (algebra.function.pair_source firstMap) + obtain ⟨old', oldEntry'⟩ := current.inputs.maps.total (algebra.function.pair_source secondMap) + have canonicalOld : ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps := by + simpa only [equal] using oldEntry + have canonicalOld' : ZFSet.pair j old' ∈ (state.data.iterate M I Sources Reps G T n).Maps := by + simpa only [equal] using oldEntry' + have firstOld := (algebra.restrict i f firstMap n old canonicalOld x hn y).1 first + have secondOld := (algebra.restrict j f' secondMap n old' canonicalOld' x hn z).1 second + apply (algebra.union.fieldUnion 12).subset n + have intertwined := current.task.intertwine g i j old old' x y z + transport oldEntry oldEntry' firstOld secondOld + rw [equal] at intertwined + exact intertwined + +theorem union_map_agrees_on_source {i f a g x y : ZFSet.{u}} + (map : ZFSet.pair i f ∈ algebra.maps) (source : ZFSet.pair i a ∈ Sources) + (representative : ZFSet.pair i g ∈ Reps) + (below : ZFSet.pair x a ∈ algebra.union.fields 1) : + ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ algebra.union.fields 12 := by + obtain ⟨n, lower⟩ := (algebra.union.fieldUnion 1 (ZFSet.pair x a)).1 below + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have lowerCurrent : ZFSet.pair x a ∈ current.data.rD := by + rw [equal] + exact lower + have hx := (ZFSet.pair_mem_prod.1 (current.batch.oldOrder.order.relation lowerCurrent)).1 + have hxCanonical : x ∈ (state.data.iterate M I Sources Reps G T n).D := by + simpa only [equal] using hx + obtain ⟨old, oldEntry⟩ := current.inputs.maps.total (algebra.function.pair_source map) + have canonicalOld : ZFSet.pair i old ∈ (state.data.iterate M I Sources Reps G T n).Maps := by + simpa only [equal] using oldEntry + have agreement : ZFSet.pair x y ∈ old ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ (state.data.iterate M I Sources Reps G T n).A := by + simpa only [equal] using current.inputs.agreement i a g old x y + source representative oldEntry hx lowerCurrent + exact (algebra.restrict i f map n old canonicalOld x hxCanonical y).trans + (agreement.trans (state.union_action_iff algebra.union pairing unions powers separation + hI hSources hReps hG hT n (old_mem_taggedExtension hxCanonical)).symm) + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionAlgebra +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T : ZFSet.{u}} +variable (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) + +theorem map_eq_section {i f : ZFSet.{u}} (entry : ZFSet.pair i f ∈ algebra.maps) : + f = indexedRelationSection (algebra.union.fields 0) (algebra.union.fields 0) + (mapFamilyApplicationGraph I (algebra.union.fields 0) (algebra.union.fields 0) + (algebra.union.fields 11)) i := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 + ((algebra.embedding i f entry).injection.function.1 hz) + obtain ⟨n, old, indexed, oldEntry⟩ := (algebra.entries i f entry _).1 hz + exact (pair_mem_indexedRelationSection _ _ _ _ _ _).2 ⟨hx, hy, + (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).2 + ⟨algebra.function.pair_source entry, hx, hy, old, + (algebra.union.fieldUnion 11).subset n indexed, oldEntry⟩⟩ + · intro hz + obtain ⟨x, hx, y, hy, rfl, flat⟩ := (mem_indexedRelationSection _ _ _ _ _).1 hz + obtain ⟨_, _, _, old, indexed, oldEntry⟩ := + (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).1 flat + obtain ⟨n, atStage⟩ := (algebra.union.fieldUnion 11 _).1 indexed + exact (algebra.entries i f entry _).2 ⟨n, old, atStage, oldEntry⟩ + +theorem maps_eq_sections : + algebra.maps = M.indexedRelationSections I (algebra.union.fields 0) (algebra.union.fields 0) + (mapFamilyApplicationGraph I (algebra.union.fields 0) (algebra.union.fields 0) + (algebra.union.fields 11)) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨i, _, f, rfl⟩ := algebra.function.shape z hz + exact (M.pair_mem_indexedRelationSections _ _ _ _ _ _).2 + ⟨algebra.function.pair_source hz, + (M.mem_groundRelations _ _ _).2 + ⟨M.pair_right (M.transitive algebra.ground hz), + (algebra.embedding i f hz).injection.function.1⟩, + algebra.map_eq_section hz⟩ + · intro hz + obtain ⟨_, i, hi, f, _, rfl, equal⟩ := ZFSet.mem_sep.1 hz + obtain ⟨old, entry⟩ := algebra.function.total hi + have same : old = f := (algebra.map_eq_section entry).trans equal.symm + exact same ▸ entry + +end PartitionPilot.Forcing.GroundCompressionAlgebra + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace GroundCompressionAlgebra +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T : ZFSet.{u}} + +def bases (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) : ZFSet.{u} := + familyEvaluationGraph I (algebra.union.fields 0) (algebra.union.fields 0) + (ZFSet.sUnion (ZFSet.sUnion algebra.maps)) algebra.maps Sources + +noncomputable def caps (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) + (τ : ZFSet.{u}) : ZFSet.{u} := + familyEvaluationGraph I (algebra.union.fields 0) (algebra.union.fields 0) + (ZFSet.sUnion (ZFSet.sUnion algebra.maps)) algebra.maps (constantFamilyGraph I τ) + +end GroundCompressionAlgebra + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) + +theorem union_sources_function : ZFSet.IsFunc I (algebra.union.fields 0) Sources := by + refine ⟨?_, seed.sources.2⟩ + intro z hz + obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (seed.sources.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hi, state.union_original_subset algebra.union ha⟩ + +theorem union_top_arguments_function : + ZFSet.IsFunc I (algebra.union.fields 0) (constantFamilyGraph I τ) := by + refine ⟨?_, (constantFamilyGraph_function I τ).2⟩ + intro z hz + obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 ((constantFamilyGraph_function I τ).1 hz) + have equal := ZFSet.mem_singleton.1 ha + subst a + exact ZFSet.pair_mem_prod.2 ⟨hi, state.union_original_subset algebra.union seed.top_mem⟩ + +theorem union_bases_function : ZFSet.IsFunc I (algebra.union.fields 0) algebra.bases := + familyEvaluationGraph_function algebra.function.to_isFunc (state.union_sources_function algebra) + (fun i f entry => (algebra.embedding i f entry).injection.function) + +theorem union_caps_function : ZFSet.IsFunc I (algebra.union.fields 0) (algebra.caps τ) := + familyEvaluationGraph_function algebra.function.to_isFunc (state.union_top_arguments_function algebra) + (fun i f entry => (algebra.embedding i f entry).injection.function) + +theorem union_base_entry_iff {i f a b : ZFSet.{u}} (map : ZFSet.pair i f ∈ algebra.maps) + (source : ZFSet.pair i a ∈ Sources) : + ZFSet.pair i b ∈ algebra.bases ↔ ZFSet.pair a b ∈ f := by + rw [GroundCompressionAlgebra.bases, + familyEvaluationGraph_entry_iff algebra.function.to_isFunc (state.union_sources_function algebra) map source] + exact ⟨fun h => h.2, fun h => ⟨(ZFSet.pair_mem_prod.1 + ((algebra.embedding i f map).injection.function.1 h)).2, h⟩⟩ + +theorem union_cap_entry_iff {i f k : ZFSet.{u}} (map : ZFSet.pair i f ∈ algebra.maps) : + ZFSet.pair i k ∈ algebra.caps τ ↔ ZFSet.pair τ k ∈ f := by + have argument := (pair_mem_constantFamilyGraph I τ i τ).2 + ⟨(ZFSet.pair_mem_prod.1 (algebra.function.to_isFunc.1 map)).1, rfl⟩ + rw [GroundCompressionAlgebra.caps, + familyEvaluationGraph_entry_iff algebra.function.to_isFunc (state.union_top_arguments_function algebra) map argument] + exact ⟨fun h => h.2, fun h => ⟨(ZFSet.pair_mem_prod.1 + ((algebra.embedding i f map).injection.function.1 h)).2, h⟩⟩ + +theorem union_markings_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) : + algebra.bases ∈ M.sets ∧ algebra.caps τ ∈ M.sets := by + have hValues := M.union_mem unions (M.union_mem unions algebra.ground) + have hτ := M.transitive state.ground.carrier (state.invariant.originalSubset seed.top_mem) + exact ⟨M.familyEvaluationGraph_mem pairing unions powers separation hI (algebra.union.ground 0) + (algebra.union.ground 0) hValues algebra.ground hSources, + M.familyEvaluationGraph_mem pairing unions powers separation hI (algebra.union.ground 0) + (algebra.union.ground 0) hValues algebra.ground + (M.constantFamilyGraph_mem pairing unions powers separation hI hτ)⟩ + +end GroundCompressionState +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialCompressionAlgebra + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ _seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, + Nonempty (GroundCompressionAlgebra M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T) := by + dsimp only + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, initial, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, seed, ?_⟩ + rw [← initialData] + exact initial.exists_groundAlgebra pairing unions powers separation collection infinite + hI hSources hReps hG hT + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem union_top {x : ZFSet.{u}} (hx : x ∈ algebra.union.fields 0) : + ZFSet.pair x τ ∈ algebra.union.fields 1 := by + obtain ⟨n, hn⟩ := (algebra.union.fieldUnion 0 x).1 hx + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have hxCurrent : x ∈ current.data.D := by + rw [equal] + exact hn + apply (algebra.union.fieldUnion 1).subset n + have belowTop := current.invariant.top x hxCurrent + rw [equal] at belowTop + exact belowTop + +theorem union_map_base_filling {i f a g b x : ZFSet.{u}} + (map : ZFSet.pair i f ∈ algebra.maps) (source : ZFSet.pair i a ∈ Sources) + (representative : ZFSet.pair i g ∈ Reps) (base : ZFSet.pair a b ∈ f) + (hx : x ∈ algebra.union.fields 0) (below : ZFSet.pair x b ∈ algebra.union.fields 1) : + ∃ y ∈ algebra.union.fields 0, ZFSet.pair y x ∈ f := by + have hg := (ZFSet.pair_mem_prod.1 (state.inputs.representatives.1 representative)).2 + have ha := (ZFSet.pair_mem_prod.1 ((algebra.embedding i f map).injection.function.1 base)).1 + have actedBase := (state.union_map_agrees_on_source algebra pairing unions powers separation + hI hSources hReps hG hT map source representative (algebra.union.meet.order.refl a ha)).1 base + obtain ⟨y, hy, acted⟩ := algebra.union.action.raw_preimage state.inputs.group hg hx + have belowSource := (algebra.union.action.raw_order_iff state.inputs.group + algebra.union.meet.order hg acted actedBase).1 below + exact ⟨y, hy, (state.union_map_agrees_on_source algebra pairing unions powers separation + hI hSources hReps hG hT map source representative belowSource).2 acted⟩ + +theorem union_map_range_below_cap {i f k x y : ZFSet.{u}} + (map : ZFSet.pair i f ∈ algebra.maps) (cap : ZFSet.pair τ k ∈ f) + (image : ZFSet.pair x y ∈ f) : ZFSet.pair y k ∈ algebra.union.fields 1 := by + have embedding := algebra.embedding i f map + have hx := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).1 + exact embedding.monotone x τ y k + (state.union_top algebra pairing unions powers separation hI hSources hReps hG hT hx) image cap + +end PartitionPilot.Forcing.GroundCompressionState + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedGroundGroups.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedGroundGroups.lean index 60a6d6eb7c6c0f6fcf087d4edb261d33b18da392..f9ef72913cf44c91d160e7c81decf8b960a296cb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedGroundGroups.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedGroundGroups.lean @@ -1,117 +1,117 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.DecodedFunctionGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroupCode - -open SetRealization -universe u -variable {G m i e : ZFSet.{u}} (h : GroupCode G m i e) - -noncomputable def mul (x y : SetMembers G) : SetMembers G := - ((SetMembers.presentation G).product (SetMembers.presentation G)).decodeFunction - (SetMembers.presentation G) m h.mul_function (x, y) - -noncomputable def inv (x : SetMembers G) : SetMembers G := - (SetMembers.presentation G).decodeFunction (SetMembers.presentation G) i h.inv_function x - -noncomputable def one : SetMembers G := SetMembers.ofMem e h.identity_mem - -theorem raw_one : SetMembers.raw h.one = e := SetMembers.raw_ofMem e h.identity_mem - -theorem mul_mem (x y : SetMembers G) : - ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) (SetMembers.raw (h.mul x y)) ∈ m := - ((SetMembers.presentation G).product (SetMembers.presentation G)).decodeFunction_mem - (SetMembers.presentation G) m h.mul_function (x, y) - -theorem inv_mem (x : SetMembers G) : - ZFSet.pair (SetMembers.raw x) (SetMembers.raw (h.inv x)) ∈ i := - (SetMembers.presentation G).decodeFunction_mem (SetMembers.presentation G) i h.inv_function x - -theorem mul_eq_iff (x y z : SetMembers G) : h.mul x y = z ↔ - ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) (SetMembers.raw z) ∈ m := - ((SetMembers.presentation G).product (SetMembers.presentation G)).decodeFunction_iff - (SetMembers.presentation G) m h.mul_function (x, y) z - -theorem decoded_one_mul (x : SetMembers G) : h.mul h.one x = x := by - apply (h.mul_eq_iff _ _ _).2 - rw [h.raw_one] - exact h.one_mul _ (SetMembers.raw_mem x) - -theorem decoded_mul_one (x : SetMembers G) : h.mul x h.one = x := by - apply (h.mul_eq_iff _ _ _).2 - rw [h.raw_one] - exact h.mul_one _ (SetMembers.raw_mem x) - -theorem decoded_inv_mul (x : SetMembers G) : h.mul (h.inv x) x = h.one := by - apply (h.mul_eq_iff _ _ _).2 - rw [h.raw_one] - exact h.inv_mul _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem (h.inv x)) (h.inv_mem x) - -theorem decoded_mul_assoc (x y z : SetMembers G) : - h.mul (h.mul x y) z = h.mul x (h.mul y z) := by - apply Eq.symm - apply (h.mul_eq_iff _ _ _).2 - exact h.mul_assoc _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) _ (SetMembers.raw_mem z) - _ (SetMembers.raw_mem (h.mul x y)) _ (SetMembers.raw_mem (h.mul y z)) - _ (SetMembers.raw_mem (h.mul (h.mul x y) z)) (h.mul_mem x y) (h.mul_mem y z) - (h.mul_mem (h.mul x y) z) - -@[instance_reducible] noncomputable def toGroup : Group (SetMembers G) where - mul := h.mul - one := h.one - inv := h.inv - mul_assoc := h.decoded_mul_assoc - one_mul := h.decoded_one_mul - mul_one := h.decoded_mul_one - inv_mul_cancel := h.decoded_inv_mul - -theorem multiplication_graph_eq : - letI := h.toGroup - ((SetMembers.presentation G).product (SetMembers.presentation G)).graph - (SetMembers.presentation G) (fun x => x.1 * x.2) = m := by - let := h.toGroup - exact ((SetMembers.presentation G).product (SetMembers.presentation G)).graph_decodeFunction - (SetMembers.presentation G) m h.mul_function - -theorem inverse_graph_eq : - letI := h.toGroup - (SetMembers.presentation G).graph (SetMembers.presentation G) (fun x => x⁻¹) = i := by - let := h.toGroup - exact (SetMembers.presentation G).graph_decodeFunction (SetMembers.presentation G) i h.inv_function - -theorem identity_code_eq : - letI := h.toGroup - (SetMembers.presentation G).encode 1 = e := h.raw_one - -end PartitionPilot.Forcing.GroupCode - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -@[instance_reducible] noncomputable def decodedGroup {G m i e : ZFSet.{u}} - (hG : G ∈ M.sets) (hm : m ∈ M.sets) (hi : i ∈ M.sets) (he : e ∈ M.sets) - (laws : Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula - (extend G (extend m (extend i (extend e Fin.elim0))))) : Group (SetMembers G) := - ((M.realize_groupCode hG hm hi he).1 laws).toGroup - -theorem decoded_group_graphs_mem {G m i e : ZFSet.{u}} (h : GroupCode G m i e) - (hm : m ∈ M.sets) (hi : i ∈ M.sets) : - letI := h.toGroup - ((SetMembers.presentation G).product (SetMembers.presentation G)).graph - (SetMembers.presentation G) (fun x => x.1 * x.2) ∈ M.sets ∧ - (SetMembers.presentation G).graph (SetMembers.presentation G) (fun x => x⁻¹) ∈ M.sets := by - let := h.toGroup - rw [h.multiplication_graph_eq, h.inverse_graph_eq] - exact ⟨hm, hi⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.DecodedFunctionGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroupCode + +open SetRealization +universe u +variable {G m i e : ZFSet.{u}} (h : GroupCode G m i e) + +noncomputable def mul (x y : SetMembers G) : SetMembers G := + ((SetMembers.presentation G).product (SetMembers.presentation G)).decodeFunction + (SetMembers.presentation G) m h.mul_function (x, y) + +noncomputable def inv (x : SetMembers G) : SetMembers G := + (SetMembers.presentation G).decodeFunction (SetMembers.presentation G) i h.inv_function x + +noncomputable def one : SetMembers G := SetMembers.ofMem e h.identity_mem + +theorem raw_one : SetMembers.raw h.one = e := SetMembers.raw_ofMem e h.identity_mem + +theorem mul_mem (x y : SetMembers G) : + ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) (SetMembers.raw (h.mul x y)) ∈ m := + ((SetMembers.presentation G).product (SetMembers.presentation G)).decodeFunction_mem + (SetMembers.presentation G) m h.mul_function (x, y) + +theorem inv_mem (x : SetMembers G) : + ZFSet.pair (SetMembers.raw x) (SetMembers.raw (h.inv x)) ∈ i := + (SetMembers.presentation G).decodeFunction_mem (SetMembers.presentation G) i h.inv_function x + +theorem mul_eq_iff (x y z : SetMembers G) : h.mul x y = z ↔ + ZFSet.pair (ZFSet.pair (SetMembers.raw x) (SetMembers.raw y)) (SetMembers.raw z) ∈ m := + ((SetMembers.presentation G).product (SetMembers.presentation G)).decodeFunction_iff + (SetMembers.presentation G) m h.mul_function (x, y) z + +theorem decoded_one_mul (x : SetMembers G) : h.mul h.one x = x := by + apply (h.mul_eq_iff _ _ _).2 + rw [h.raw_one] + exact h.one_mul _ (SetMembers.raw_mem x) + +theorem decoded_mul_one (x : SetMembers G) : h.mul x h.one = x := by + apply (h.mul_eq_iff _ _ _).2 + rw [h.raw_one] + exact h.mul_one _ (SetMembers.raw_mem x) + +theorem decoded_inv_mul (x : SetMembers G) : h.mul (h.inv x) x = h.one := by + apply (h.mul_eq_iff _ _ _).2 + rw [h.raw_one] + exact h.inv_mul _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem (h.inv x)) (h.inv_mem x) + +theorem decoded_mul_assoc (x y z : SetMembers G) : + h.mul (h.mul x y) z = h.mul x (h.mul y z) := by + apply Eq.symm + apply (h.mul_eq_iff _ _ _).2 + exact h.mul_assoc _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) _ (SetMembers.raw_mem z) + _ (SetMembers.raw_mem (h.mul x y)) _ (SetMembers.raw_mem (h.mul y z)) + _ (SetMembers.raw_mem (h.mul (h.mul x y) z)) (h.mul_mem x y) (h.mul_mem y z) + (h.mul_mem (h.mul x y) z) + +@[instance_reducible] noncomputable def toGroup : Group (SetMembers G) where + mul := h.mul + one := h.one + inv := h.inv + mul_assoc := h.decoded_mul_assoc + one_mul := h.decoded_one_mul + mul_one := h.decoded_mul_one + inv_mul_cancel := h.decoded_inv_mul + +theorem multiplication_graph_eq : + letI := h.toGroup + ((SetMembers.presentation G).product (SetMembers.presentation G)).graph + (SetMembers.presentation G) (fun x => x.1 * x.2) = m := by + let := h.toGroup + exact ((SetMembers.presentation G).product (SetMembers.presentation G)).graph_decodeFunction + (SetMembers.presentation G) m h.mul_function + +theorem inverse_graph_eq : + letI := h.toGroup + (SetMembers.presentation G).graph (SetMembers.presentation G) (fun x => x⁻¹) = i := by + let := h.toGroup + exact (SetMembers.presentation G).graph_decodeFunction (SetMembers.presentation G) i h.inv_function + +theorem identity_code_eq : + letI := h.toGroup + (SetMembers.presentation G).encode 1 = e := h.raw_one + +end PartitionPilot.Forcing.GroupCode + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +@[instance_reducible] noncomputable def decodedGroup {G m i e : ZFSet.{u}} + (hG : G ∈ M.sets) (hm : m ∈ M.sets) (hi : i ∈ M.sets) (he : e ∈ M.sets) + (laws : Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula + (extend G (extend m (extend i (extend e Fin.elim0))))) : Group (SetMembers G) := + ((M.realize_groupCode hG hm hi he).1 laws).toGroup + +theorem decoded_group_graphs_mem {G m i e : ZFSet.{u}} (h : GroupCode G m i e) + (hm : m ∈ M.sets) (hi : i ∈ M.sets) : + letI := h.toGroup + ((SetMembers.presentation G).product (SetMembers.presentation G)).graph + (SetMembers.presentation G) (fun x => x.1 * x.2) ∈ M.sets ∧ + (SetMembers.presentation G).graph (SetMembers.presentation G) (fun x => x⁻¹) ∈ M.sets := by + let := h.toGroup + rw [h.multiplication_graph_eq, h.inverse_graph_eq] + exact ⟨hm, hi⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedMeetMaps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedMeetMaps.lean index c719803897455665276c982b5deb75cd0d419a71..462488fa422a7e16253d39e221632ece0ea9e5a5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedMeetMaps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DecodedMeetMaps.lean @@ -1,149 +1,149 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.ActionPostcompositionCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace MeetEmbeddingCode - -variable {P L rP rL μP μL S : ZFSet.{u}} -variable (embedding : MeetEmbeddingCode P L rP rL μP μL S) - -noncomputable def value (x : {x : ZFSet.{u} // x ∈ P}) : - {y : ZFSet.{u} // y ∈ L} := - let graph : FunctionGraphOn P S := ⟨L, embedding.injection.function⟩ - ⟨graph.value x, (ZFSet.pair_mem_prod.1 - (embedding.injection.function.1 (graph.value_entry x))).2⟩ - -theorem value_entry (x : {x : ZFSet.{u} // x ∈ P}) : - ZFSet.pair x.val (embedding.value x).val ∈ S := - (show FunctionGraphOn P S from ⟨L, embedding.injection.function⟩).value_entry x - -theorem value_eq_iff (x : {x : ZFSet.{u} // x ∈ P}) - (y : {y : ZFSet.{u} // y ∈ L}) : - embedding.value x = y ↔ ZFSet.pair x.val y.val ∈ S := by - constructor - · intro equal - exact equal ▸ embedding.value_entry x - · intro entry - exact Subtype.ext ((show FunctionGraphOn P S from - ⟨L, embedding.injection.function⟩).unique (embedding.value_entry x) entry) - -noncomputable def toMeetEmbedding (source : MeetOrderCode P rP μP) - (target : MeetOrderCode L rL μL) : - MeetEmbedding source.toMeetOrder target.toMeetOrder where - toFun := embedding.value - le_iff x y := embedding.order_iff source target - (embedding.value_entry x) (embedding.value_entry y) - map_meet x y := by - apply Subtype.ext - exact (show FunctionGraphOn (ZFSet.prod L L) μL from - ⟨L, target.operation⟩).unique - (embedding.map_meet _ _ _ _ _ _ (source.toMeetOrder_meet_entry x y) - (embedding.value_entry x) (embedding.value_entry y) - (embedding.value_entry (source.toMeetOrder.meet x y))) - (target.toMeetOrder_meet_entry (embedding.value x) (embedding.value y)) - -theorem toMeetEmbedding_entry (source : MeetOrderCode P rP μP) - (target : MeetOrderCode L rL μL) (x : {x : ZFSet.{u} // x ∈ P}) : - ZFSet.pair x.val ((embedding.toMeetEmbedding source target).toFun x).val ∈ S := - embedding.value_entry x - -theorem toMeetEmbedding_eq_iff (source : MeetOrderCode P rP μP) - (target : MeetOrderCode L rL μL) (x : {x : ZFSet.{u} // x ∈ P}) - (y : {y : ZFSet.{u} // y ∈ L}) : - (embedding.toMeetEmbedding source target).toFun x = y ↔ - ZFSet.pair x.val y.val ∈ S := embedding.value_eq_iff x y - -end MeetEmbeddingCode - -namespace PosetActionCode - -variable {G P m inv e r μ A : ZFSet.{u}} -variable (action : PosetActionCode G P m e r A) - -noncomputable def rawAct (g : {g : ZFSet.{u} // g ∈ G}) - (x : {x : ZFSet.{u} // x ∈ P}) : {y : ZFSet.{u} // y ∈ P} := - let graph : FunctionGraphOn (ZFSet.prod G P) A := ⟨P, action.function⟩ - let input := (⟨ZFSet.pair g.val x.val, - ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ : - {z : ZFSet.{u} // z ∈ ZFSet.prod G P}) - ⟨graph.value input, (ZFSet.pair_mem_prod.1 - (action.function.1 (graph.value_entry input))).2⟩ - -theorem rawAct_entry (g : {g : ZFSet.{u} // g ∈ G}) - (x : {x : ZFSet.{u} // x ∈ P}) : - ZFSet.pair (ZFSet.pair g.val x.val) (action.rawAct g x).val ∈ A := - (show FunctionGraphOn (ZFSet.prod G P) A from ⟨P, action.function⟩).value_entry - ⟨ZFSet.pair g.val x.val, ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ - -theorem rawAct_eq_iff (g : {g : ZFSet.{u} // g ∈ G}) - (x y : {x : ZFSet.{u} // x ∈ P}) : - action.rawAct g x = y ↔ ZFSet.pair (ZFSet.pair g.val x.val) y.val ∈ A := by - constructor - · intro equal - exact equal ▸ action.rawAct_entry g x - · intro entry - exact Subtype.ext ((show FunctionGraphOn (ZFSet.prod G P) A from - ⟨P, action.function⟩).unique (action.rawAct_entry g x) entry) - -theorem rawAct_injective (group : GroupCode G m inv e) (order : PartialOrderCode P r) - (g : {g : ZFSet.{u} // g ∈ G}) : Function.Injective (action.rawAct g) := by - intro x y equal - have lower : ZFSet.pair (action.rawAct g x).val (action.rawAct g y).val ∈ r := by - rw [equal] - exact order.refl _ (action.rawAct g y).property - have back : ZFSet.pair (action.rawAct g y).val (action.rawAct g x).val ∈ r := by - rw [equal] - exact order.refl _ (action.rawAct g y).property - exact Subtype.ext (order.antisymm x.val x.property y.val y.property - ((action.raw_order_iff group order g.property - (action.rawAct_entry g x) (action.rawAct_entry g y)).1 lower) - ((action.raw_order_iff group order g.property - (action.rawAct_entry g y) (action.rawAct_entry g x)).1 back)) - -theorem rawAct_surjective (group : GroupCode G m inv e) - (g : {g : ZFSet.{u} // g ∈ G}) : Function.Surjective (action.rawAct g) := by - intro y - obtain ⟨x, hx, entry⟩ := action.raw_preimage group g.property y.property - exact ⟨⟨x, hx⟩, (action.rawAct_eq_iff g ⟨x, hx⟩ y).2 entry⟩ - -noncomputable def toMeetIso (group : GroupCode G m inv e) (meet : MeetOrderCode P r μ) - (g : {g : ZFSet.{u} // g ∈ G}) : - Compression.MeetIso meet.toMeetOrder meet.toMeetOrder where - toFun := action.rawAct g - le_iff x y := action.raw_order_iff group meet.order g.property - (action.rawAct_entry g x) (action.rawAct_entry g y) - map_meet x y := by - apply Subtype.ext - exact (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique - (action.raw_map_meet group meet g.property (meet.toMeetOrder_meet_entry x y) - (action.rawAct_entry g x) (action.rawAct_entry g y) - (action.rawAct_entry g (meet.toMeetOrder.meet x y))) - (meet.toMeetOrder_meet_entry (action.rawAct g x) (action.rawAct g y)) - inverse y := Classical.choose (action.rawAct_surjective group g y) - left_inverse x := action.rawAct_injective group meet.order g - (Classical.choose_spec (action.rawAct_surjective group g (action.rawAct g x))) - right_inverse y := Classical.choose_spec (action.rawAct_surjective group g y) - -theorem toMeetIso_entry (group : GroupCode G m inv e) (meet : MeetOrderCode P r μ) - (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ P}) : - ZFSet.pair (ZFSet.pair g.val x.val) - ((action.toMeetIso group meet g).toFun x).val ∈ A := action.rawAct_entry g x - -theorem toMeetIso_eq_iff (group : GroupCode G m inv e) (meet : MeetOrderCode P r μ) - (g : {g : ZFSet.{u} // g ∈ G}) (x y : {x : ZFSet.{u} // x ∈ P}) : - (action.toMeetIso group meet g).toFun x = y ↔ - ZFSet.pair (ZFSet.pair g.val x.val) y.val ∈ A := action.rawAct_eq_iff g x y - -end PosetActionCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.ActionPostcompositionCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace MeetEmbeddingCode + +variable {P L rP rL μP μL S : ZFSet.{u}} +variable (embedding : MeetEmbeddingCode P L rP rL μP μL S) + +noncomputable def value (x : {x : ZFSet.{u} // x ∈ P}) : + {y : ZFSet.{u} // y ∈ L} := + let graph : FunctionGraphOn P S := ⟨L, embedding.injection.function⟩ + ⟨graph.value x, (ZFSet.pair_mem_prod.1 + (embedding.injection.function.1 (graph.value_entry x))).2⟩ + +theorem value_entry (x : {x : ZFSet.{u} // x ∈ P}) : + ZFSet.pair x.val (embedding.value x).val ∈ S := + (show FunctionGraphOn P S from ⟨L, embedding.injection.function⟩).value_entry x + +theorem value_eq_iff (x : {x : ZFSet.{u} // x ∈ P}) + (y : {y : ZFSet.{u} // y ∈ L}) : + embedding.value x = y ↔ ZFSet.pair x.val y.val ∈ S := by + constructor + · intro equal + exact equal ▸ embedding.value_entry x + · intro entry + exact Subtype.ext ((show FunctionGraphOn P S from + ⟨L, embedding.injection.function⟩).unique (embedding.value_entry x) entry) + +noncomputable def toMeetEmbedding (source : MeetOrderCode P rP μP) + (target : MeetOrderCode L rL μL) : + MeetEmbedding source.toMeetOrder target.toMeetOrder where + toFun := embedding.value + le_iff x y := embedding.order_iff source target + (embedding.value_entry x) (embedding.value_entry y) + map_meet x y := by + apply Subtype.ext + exact (show FunctionGraphOn (ZFSet.prod L L) μL from + ⟨L, target.operation⟩).unique + (embedding.map_meet _ _ _ _ _ _ (source.toMeetOrder_meet_entry x y) + (embedding.value_entry x) (embedding.value_entry y) + (embedding.value_entry (source.toMeetOrder.meet x y))) + (target.toMeetOrder_meet_entry (embedding.value x) (embedding.value y)) + +theorem toMeetEmbedding_entry (source : MeetOrderCode P rP μP) + (target : MeetOrderCode L rL μL) (x : {x : ZFSet.{u} // x ∈ P}) : + ZFSet.pair x.val ((embedding.toMeetEmbedding source target).toFun x).val ∈ S := + embedding.value_entry x + +theorem toMeetEmbedding_eq_iff (source : MeetOrderCode P rP μP) + (target : MeetOrderCode L rL μL) (x : {x : ZFSet.{u} // x ∈ P}) + (y : {y : ZFSet.{u} // y ∈ L}) : + (embedding.toMeetEmbedding source target).toFun x = y ↔ + ZFSet.pair x.val y.val ∈ S := embedding.value_eq_iff x y + +end MeetEmbeddingCode + +namespace PosetActionCode + +variable {G P m inv e r μ A : ZFSet.{u}} +variable (action : PosetActionCode G P m e r A) + +noncomputable def rawAct (g : {g : ZFSet.{u} // g ∈ G}) + (x : {x : ZFSet.{u} // x ∈ P}) : {y : ZFSet.{u} // y ∈ P} := + let graph : FunctionGraphOn (ZFSet.prod G P) A := ⟨P, action.function⟩ + let input := (⟨ZFSet.pair g.val x.val, + ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ : + {z : ZFSet.{u} // z ∈ ZFSet.prod G P}) + ⟨graph.value input, (ZFSet.pair_mem_prod.1 + (action.function.1 (graph.value_entry input))).2⟩ + +theorem rawAct_entry (g : {g : ZFSet.{u} // g ∈ G}) + (x : {x : ZFSet.{u} // x ∈ P}) : + ZFSet.pair (ZFSet.pair g.val x.val) (action.rawAct g x).val ∈ A := + (show FunctionGraphOn (ZFSet.prod G P) A from ⟨P, action.function⟩).value_entry + ⟨ZFSet.pair g.val x.val, ZFSet.pair_mem_prod.2 ⟨g.property, x.property⟩⟩ + +theorem rawAct_eq_iff (g : {g : ZFSet.{u} // g ∈ G}) + (x y : {x : ZFSet.{u} // x ∈ P}) : + action.rawAct g x = y ↔ ZFSet.pair (ZFSet.pair g.val x.val) y.val ∈ A := by + constructor + · intro equal + exact equal ▸ action.rawAct_entry g x + · intro entry + exact Subtype.ext ((show FunctionGraphOn (ZFSet.prod G P) A from + ⟨P, action.function⟩).unique (action.rawAct_entry g x) entry) + +theorem rawAct_injective (group : GroupCode G m inv e) (order : PartialOrderCode P r) + (g : {g : ZFSet.{u} // g ∈ G}) : Function.Injective (action.rawAct g) := by + intro x y equal + have lower : ZFSet.pair (action.rawAct g x).val (action.rawAct g y).val ∈ r := by + rw [equal] + exact order.refl _ (action.rawAct g y).property + have back : ZFSet.pair (action.rawAct g y).val (action.rawAct g x).val ∈ r := by + rw [equal] + exact order.refl _ (action.rawAct g y).property + exact Subtype.ext (order.antisymm x.val x.property y.val y.property + ((action.raw_order_iff group order g.property + (action.rawAct_entry g x) (action.rawAct_entry g y)).1 lower) + ((action.raw_order_iff group order g.property + (action.rawAct_entry g y) (action.rawAct_entry g x)).1 back)) + +theorem rawAct_surjective (group : GroupCode G m inv e) + (g : {g : ZFSet.{u} // g ∈ G}) : Function.Surjective (action.rawAct g) := by + intro y + obtain ⟨x, hx, entry⟩ := action.raw_preimage group g.property y.property + exact ⟨⟨x, hx⟩, (action.rawAct_eq_iff g ⟨x, hx⟩ y).2 entry⟩ + +noncomputable def toMeetIso (group : GroupCode G m inv e) (meet : MeetOrderCode P r μ) + (g : {g : ZFSet.{u} // g ∈ G}) : + Compression.MeetIso meet.toMeetOrder meet.toMeetOrder where + toFun := action.rawAct g + le_iff x y := action.raw_order_iff group meet.order g.property + (action.rawAct_entry g x) (action.rawAct_entry g y) + map_meet x y := by + apply Subtype.ext + exact (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique + (action.raw_map_meet group meet g.property (meet.toMeetOrder_meet_entry x y) + (action.rawAct_entry g x) (action.rawAct_entry g y) + (action.rawAct_entry g (meet.toMeetOrder.meet x y))) + (meet.toMeetOrder_meet_entry (action.rawAct g x) (action.rawAct g y)) + inverse y := Classical.choose (action.rawAct_surjective group g y) + left_inverse x := action.rawAct_injective group meet.order g + (Classical.choose_spec (action.rawAct_surjective group g (action.rawAct g x))) + right_inverse y := Classical.choose_spec (action.rawAct_surjective group g y) + +theorem toMeetIso_entry (group : GroupCode G m inv e) (meet : MeetOrderCode P r μ) + (g : {g : ZFSet.{u} // g ∈ G}) (x : {x : ZFSet.{u} // x ∈ P}) : + ZFSet.pair (ZFSet.pair g.val x.val) + ((action.toMeetIso group meet g).toFun x).val ∈ A := action.rawAct_entry g x + +theorem toMeetIso_eq_iff (group : GroupCode G m inv e) (meet : MeetOrderCode P r μ) + (g : {g : ZFSet.{u} // g ∈ G}) (x y : {x : ZFSet.{u} // x ∈ P}) : + (action.toMeetIso group meet g).toFun x = y ↔ + ZFSet.pair (ZFSet.pair g.val x.val) y.val ∈ A := action.rawAct_eq_iff g x y + +end PosetActionCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DepthLayerHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DepthLayerHeights.lean index d8a25be221e3dbea113d6aa852e2604998afb990..0752eb334b1a48f5804b237f170c915ae5bdc2e8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DepthLayerHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DepthLayerHeights.lean @@ -1,64 +1,64 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.InaccessibleBounds - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps -universe u v w -variable {X : Type u} {Column : Type v} {Coord : Type w} {P : MeetOrder X} -variable (C : LinearHeightOrder Column) (D : LinearHeightOrder Coord) -variable (depth : X → Nat) (columns : Nat → Column) -variable (seed : {x : X // depth x = 0} → Column × Coord) -variable (coordinate : {x : X // depth x ≠ 0} → Coord) - -def depthHeightValue (x : X) : Column × Coord := - if h : depth x = 0 then seed ⟨x, h⟩ else (columns (depth x), coordinate ⟨x, h⟩) - -theorem depthHeightValue_old (x : X) (h : depth x = 0) : - depthHeightValue depth columns seed coordinate x = seed ⟨x, h⟩ := by - simp only [depthHeightValue, dite_eq_left h] - -theorem depthHeightValue_fresh (x : X) (h : depth x ≠ 0) : - depthHeightValue depth columns seed coordinate x = (columns (depth x), coordinate ⟨x, h⟩) := by - simp only [depthHeightValue, dite_eq_right h] - -def depthLayerHeight - (monotone : ∀ x y, P.le x y → depth x ≤ depth y) - (increasing : ∀ n m, n < m → C.lt (columns n) (columns m)) - (above : ∀ x n, C.lt (seed x).1 (columns n)) - (seedStrict : ∀ x y, P.le x.val y.val → x.val ≠ y.val → (C.lex D).lt (seed x) (seed y)) - (coordinateStrict : ∀ x y, depth x.val = depth y.val → P.le x.val y.val → - x.val ≠ y.val → D.lt (coordinate x) (coordinate y)) : - StrictHeight P (C.lex D).toHeightOrder where - value := depthHeightValue depth columns seed coordinate - strict x y lower different := by - have depths := monotone x y lower - by_cases hx : depth x = 0 - · rw [depthHeightValue_old depth columns seed coordinate x hx] - by_cases hy : depth y = 0 - · rw [depthHeightValue_old depth columns seed coordinate y hy] - exact seedStrict ⟨x, hx⟩ ⟨y, hy⟩ lower different - · rw [depthHeightValue_fresh depth columns seed coordinate y hy] - exact Or.inl (above ⟨x, hx⟩ (depth y)) - · have hy : depth y ≠ 0 := by omega - rw [depthHeightValue_fresh depth columns seed coordinate x hx, - depthHeightValue_fresh depth columns seed coordinate y hy] - by_cases same : depth x = depth y - · exact Or.inr ⟨congrArg columns same, coordinateStrict ⟨x, hx⟩ ⟨y, hy⟩ same lower different⟩ - · exact Or.inl (increasing _ _ (by omega)) - -theorem depthHeightValue_column_bound (cap : Column) - (oldBound : ∀ x, C.lt (seed x).1 cap) (columnBound : ∀ n, C.lt (columns n) cap) (x : X) : - C.lt (depthHeightValue depth columns seed coordinate x).1 cap := by - by_cases h : depth x = 0 - · rw [depthHeightValue_old depth columns seed coordinate x h] - exact oldBound ⟨x, h⟩ - · rw [depthHeightValue_fresh depth columns seed coordinate x h] - exact columnBound (depth x) - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.InaccessibleBounds + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps +universe u v w +variable {X : Type u} {Column : Type v} {Coord : Type w} {P : MeetOrder X} +variable (C : LinearHeightOrder Column) (D : LinearHeightOrder Coord) +variable (depth : X → Nat) (columns : Nat → Column) +variable (seed : {x : X // depth x = 0} → Column × Coord) +variable (coordinate : {x : X // depth x ≠ 0} → Coord) + +def depthHeightValue (x : X) : Column × Coord := + if h : depth x = 0 then seed ⟨x, h⟩ else (columns (depth x), coordinate ⟨x, h⟩) + +theorem depthHeightValue_old (x : X) (h : depth x = 0) : + depthHeightValue depth columns seed coordinate x = seed ⟨x, h⟩ := by + simp only [depthHeightValue, dite_eq_left h] + +theorem depthHeightValue_fresh (x : X) (h : depth x ≠ 0) : + depthHeightValue depth columns seed coordinate x = (columns (depth x), coordinate ⟨x, h⟩) := by + simp only [depthHeightValue, dite_eq_right h] + +def depthLayerHeight + (monotone : ∀ x y, P.le x y → depth x ≤ depth y) + (increasing : ∀ n m, n < m → C.lt (columns n) (columns m)) + (above : ∀ x n, C.lt (seed x).1 (columns n)) + (seedStrict : ∀ x y, P.le x.val y.val → x.val ≠ y.val → (C.lex D).lt (seed x) (seed y)) + (coordinateStrict : ∀ x y, depth x.val = depth y.val → P.le x.val y.val → + x.val ≠ y.val → D.lt (coordinate x) (coordinate y)) : + StrictHeight P (C.lex D).toHeightOrder where + value := depthHeightValue depth columns seed coordinate + strict x y lower different := by + have depths := monotone x y lower + by_cases hx : depth x = 0 + · rw [depthHeightValue_old depth columns seed coordinate x hx] + by_cases hy : depth y = 0 + · rw [depthHeightValue_old depth columns seed coordinate y hy] + exact seedStrict ⟨x, hx⟩ ⟨y, hy⟩ lower different + · rw [depthHeightValue_fresh depth columns seed coordinate y hy] + exact Or.inl (above ⟨x, hx⟩ (depth y)) + · have hy : depth y ≠ 0 := by omega + rw [depthHeightValue_fresh depth columns seed coordinate x hx, + depthHeightValue_fresh depth columns seed coordinate y hy] + by_cases same : depth x = depth y + · exact Or.inr ⟨congrArg columns same, coordinateStrict ⟨x, hx⟩ ⟨y, hy⟩ same lower different⟩ + · exact Or.inl (increasing _ _ (by omega)) + +theorem depthHeightValue_column_bound (cap : Column) + (oldBound : ∀ x, C.lt (seed x).1 cap) (columnBound : ∀ n, C.lt (columns n) cap) (x : X) : + C.lt (depthHeightValue depth columns seed coordinate x).1 cap := by + by_cases h : depth x = 0 + · rw [depthHeightValue_old depth columns seed coordinate x h] + exact oldBound ⟨x, h⟩ + · rw [depthHeightValue_fresh depth columns seed coordinate x h] + exact columnBound (depth x) + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DirectSystem.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DirectSystem.lean index f3d314fda65c3330a4c051cc073b1e1c4b323793..0277c0260129d7bcca671c2abce0d6012185d3fc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DirectSystem.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/DirectSystem.lean @@ -1,132 +1,132 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalExternalHeights - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u v - -structure DirectSystem (I : Type u) [LinearOrder I] where - Point : I → Type u - map : ∀ {i j}, i ≤ j → Point i → Point j - map_self : ∀ i x, map (le_refl i) x = x - map_comp : ∀ {i j k} (hij : i ≤ j) (hjk : j ≤ k) x, - map (le_trans hij hjk) x = map hjk (map hij x) - injective : ∀ {i j} (h : i ≤ j), Function.Injective (map h) - -namespace DirectSystem -variable {I : Type u} [LinearOrder I] (c : DirectSystem I) - -def Label := (i : I) × c.Point i -def Related (x y : c.Label) : Prop := - ∃ (k : I) (hx : x.1 ≤ k) (hy : y.1 ≤ k), c.map hx x.2 = c.map hy y.2 - -theorem related_refl (x : c.Label) : c.Related x x := ⟨x.1, le_rfl, le_rfl, rfl⟩ -theorem related_symm {x y : c.Label} (h : c.Related x y) : c.Related y x := by - rcases h with ⟨k, hx, hy, eq⟩ - exact ⟨k, hy, hx, eq.symm⟩ - -theorem related_trans {x y z : c.Label} (hxy : c.Related x y) (hyz : c.Related y z) : - c.Related x z := by - rcases hxy with ⟨k, hx, hy, eq1⟩ - rcases hyz with ⟨l, hy', hz, eq2⟩ - refine ⟨max k l, le_trans hx (le_max_left _ _), le_trans hz (le_max_right _ _), ?_⟩ - calc - c.map _ x.2 = c.map (le_max_left k l) (c.map hx x.2) := c.map_comp _ _ _ - _ = c.map (le_max_left k l) (c.map hy y.2) := congrArg _ eq1 - _ = c.map (le_max_right k l) (c.map hy' y.2) := - (c.map_comp _ _ _).symm.trans (c.map_comp _ _ _) - _ = c.map (le_max_right k l) (c.map hz z.2) := congrArg _ eq2 - _ = c.map _ z.2 := (c.map_comp _ _ _).symm - -def setoid : Setoid c.Label := ⟨c.Related, c.related_refl, c.related_symm, c.related_trans⟩ -def Union := Quotient c.setoid -def point (i : I) (x : c.Point i) : c.Union := Quotient.mk c.setoid ⟨i, x⟩ - -theorem point_map {i j : I} (h : i ≤ j) (x : c.Point i) : - c.point j (c.map h x) = c.point i x := by - apply Quotient.sound - exact ⟨j, le_rfl, h, c.map_self _ _⟩ - -theorem point_injective (i : I) : Function.Injective (c.point i) := by - intro x y eq - rcases Quotient.exact eq with ⟨k, hx, hy, same⟩ - exact c.injective hx same - -theorem cover (x : c.Union) : ∃ i a, c.point i a = x := by - induction x using Quotient.ind with - | _ x => exact ⟨x.1, x.2, rfl⟩ - -theorem pair_cover (d : DirectSystem I) (x : c.Union) (y : d.Union) : - ∃ i a b, c.point i a = x ∧ d.point i b = y := by - rcases c.cover x with ⟨i, a, rfl⟩ - rcases d.cover y with ⟨j, b, rfl⟩ - exact ⟨max i j, c.map (le_max_left _ _) a, d.map (le_max_right _ _) b, - c.point_map _ _, d.point_map _ _⟩ - -theorem triple_cover (d e : DirectSystem I) (x : c.Union) (y : d.Union) (z : e.Union) : - ∃ i a b t, c.point i a = x ∧ d.point i b = y ∧ e.point i t = z := by - rcases c.pair_cover d x y with ⟨i, a, b, rfl, rfl⟩ - rcases e.cover z with ⟨j, t, rfl⟩ - exact ⟨max i j, c.map (le_max_left _ _) a, d.map (le_max_left _ _) b, - e.map (le_max_right _ _) t, c.point_map _ _, d.point_map _ _, e.point_map _ _⟩ - -def descend {H : Type v} (value : ∀ i, c.Point i → H) - (coherent : ∀ {i j} (h : i ≤ j) x, value j (c.map h x) = value i x) : c.Union → H := - Quotient.lift (fun x => value x.1 x.2) (by - intro x y related - rcases related with ⟨k, hx, hy, eq⟩ - exact (coherent hx x.2).symm.trans ((congrArg (value k) eq).trans (coherent hy y.2))) - -theorem descend_point {H : Type v} (value : ∀ i, c.Point i → H) - (coherent : ∀ {i j} (h : i ≤ j) x, value j (c.map h x) = value i x) (i : I) (x : c.Point i) : - c.descend value coherent (c.point i x) = value i x := rfl - -section Binary -variable (d e : DirectSystem I) (op : ∀ i, c.Point i → d.Point i → e.Point i) - (coherent : ∀ {i j} (h : i ≤ j) x y, - e.map h (op i x y) = op j (c.map h x) (d.map h y)) - -def binaryLabel (x : c.Label) (y : d.Label) : e.Union := - e.point (max x.1 y.1) - (op _ (c.map (le_max_left _ _) x.2) (d.map (le_max_right _ _) y.2)) - -include coherent - -theorem binaryLabel_at (x : c.Label) (y : d.Label) (k : I) (hx : x.1 ≤ k) (hy : y.1 ≤ k) : - c.binaryLabel d e op x y = e.point k (op k (c.map hx x.2) (d.map hy y.2)) := by - let h : max x.1 y.1 ≤ k := max_le hx hy - change e.point (max x.1 y.1) _ = _ - rw [← e.point_map h, coherent, ← c.map_comp, ← d.map_comp] - -theorem binaryLabel_respects (x x' : c.Label) (y y' : d.Label) - (eqx : c.Related x x') (eqy : d.Related y y') : - c.binaryLabel d e op x y = c.binaryLabel d e op x' y' := by - rcases eqx with ⟨k, hx, hx', eqx⟩ - rcases eqy with ⟨l, hy, hy', eqy⟩ - rw [c.binaryLabel_at d e op coherent x y (max k l) - (le_trans hx (le_max_left _ _)) (le_trans hy (le_max_right _ _)), - c.binaryLabel_at d e op coherent x' y' (max k l) - (le_trans hx' (le_max_left _ _)) (le_trans hy' (le_max_right _ _))] - rw [c.map_comp hx (le_max_left _ _), c.map_comp hx' (le_max_left _ _), - d.map_comp hy (le_max_right _ _), d.map_comp hy' (le_max_right _ _), eqx, eqy] - -def binary : c.Union → d.Union → e.Union := - Quotient.lift₂ (c.binaryLabel d e op) - (fun x y x' y' hx hy => c.binaryLabel_respects d e op coherent x x' y y' hx hy) - -theorem binary_point (i : I) (x : c.Point i) (y : d.Point i) : - c.binary d e op coherent (c.point i x) (d.point i y) = e.point i (op i x y) := by - change c.binaryLabel d e op ⟨i, x⟩ ⟨i, y⟩ = _ - erw [c.binaryLabel_at d e op coherent _ _ i le_rfl le_rfl, c.map_self, d.map_self] - -end Binary - -end DirectSystem -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalExternalHeights + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u v + +structure DirectSystem (I : Type u) [LinearOrder I] where + Point : I → Type u + map : ∀ {i j}, i ≤ j → Point i → Point j + map_self : ∀ i x, map (le_refl i) x = x + map_comp : ∀ {i j k} (hij : i ≤ j) (hjk : j ≤ k) x, + map (le_trans hij hjk) x = map hjk (map hij x) + injective : ∀ {i j} (h : i ≤ j), Function.Injective (map h) + +namespace DirectSystem +variable {I : Type u} [LinearOrder I] (c : DirectSystem I) + +def Label := (i : I) × c.Point i +def Related (x y : c.Label) : Prop := + ∃ (k : I) (hx : x.1 ≤ k) (hy : y.1 ≤ k), c.map hx x.2 = c.map hy y.2 + +theorem related_refl (x : c.Label) : c.Related x x := ⟨x.1, le_rfl, le_rfl, rfl⟩ +theorem related_symm {x y : c.Label} (h : c.Related x y) : c.Related y x := by + rcases h with ⟨k, hx, hy, eq⟩ + exact ⟨k, hy, hx, eq.symm⟩ + +theorem related_trans {x y z : c.Label} (hxy : c.Related x y) (hyz : c.Related y z) : + c.Related x z := by + rcases hxy with ⟨k, hx, hy, eq1⟩ + rcases hyz with ⟨l, hy', hz, eq2⟩ + refine ⟨max k l, le_trans hx (le_max_left _ _), le_trans hz (le_max_right _ _), ?_⟩ + calc + c.map _ x.2 = c.map (le_max_left k l) (c.map hx x.2) := c.map_comp _ _ _ + _ = c.map (le_max_left k l) (c.map hy y.2) := congrArg _ eq1 + _ = c.map (le_max_right k l) (c.map hy' y.2) := + (c.map_comp _ _ _).symm.trans (c.map_comp _ _ _) + _ = c.map (le_max_right k l) (c.map hz z.2) := congrArg _ eq2 + _ = c.map _ z.2 := (c.map_comp _ _ _).symm + +def setoid : Setoid c.Label := ⟨c.Related, c.related_refl, c.related_symm, c.related_trans⟩ +def Union := Quotient c.setoid +def point (i : I) (x : c.Point i) : c.Union := Quotient.mk c.setoid ⟨i, x⟩ + +theorem point_map {i j : I} (h : i ≤ j) (x : c.Point i) : + c.point j (c.map h x) = c.point i x := by + apply Quotient.sound + exact ⟨j, le_rfl, h, c.map_self _ _⟩ + +theorem point_injective (i : I) : Function.Injective (c.point i) := by + intro x y eq + rcases Quotient.exact eq with ⟨k, hx, hy, same⟩ + exact c.injective hx same + +theorem cover (x : c.Union) : ∃ i a, c.point i a = x := by + induction x using Quotient.ind with + | _ x => exact ⟨x.1, x.2, rfl⟩ + +theorem pair_cover (d : DirectSystem I) (x : c.Union) (y : d.Union) : + ∃ i a b, c.point i a = x ∧ d.point i b = y := by + rcases c.cover x with ⟨i, a, rfl⟩ + rcases d.cover y with ⟨j, b, rfl⟩ + exact ⟨max i j, c.map (le_max_left _ _) a, d.map (le_max_right _ _) b, + c.point_map _ _, d.point_map _ _⟩ + +theorem triple_cover (d e : DirectSystem I) (x : c.Union) (y : d.Union) (z : e.Union) : + ∃ i a b t, c.point i a = x ∧ d.point i b = y ∧ e.point i t = z := by + rcases c.pair_cover d x y with ⟨i, a, b, rfl, rfl⟩ + rcases e.cover z with ⟨j, t, rfl⟩ + exact ⟨max i j, c.map (le_max_left _ _) a, d.map (le_max_left _ _) b, + e.map (le_max_right _ _) t, c.point_map _ _, d.point_map _ _, e.point_map _ _⟩ + +def descend {H : Type v} (value : ∀ i, c.Point i → H) + (coherent : ∀ {i j} (h : i ≤ j) x, value j (c.map h x) = value i x) : c.Union → H := + Quotient.lift (fun x => value x.1 x.2) (by + intro x y related + rcases related with ⟨k, hx, hy, eq⟩ + exact (coherent hx x.2).symm.trans ((congrArg (value k) eq).trans (coherent hy y.2))) + +theorem descend_point {H : Type v} (value : ∀ i, c.Point i → H) + (coherent : ∀ {i j} (h : i ≤ j) x, value j (c.map h x) = value i x) (i : I) (x : c.Point i) : + c.descend value coherent (c.point i x) = value i x := rfl + +section Binary +variable (d e : DirectSystem I) (op : ∀ i, c.Point i → d.Point i → e.Point i) + (coherent : ∀ {i j} (h : i ≤ j) x y, + e.map h (op i x y) = op j (c.map h x) (d.map h y)) + +def binaryLabel (x : c.Label) (y : d.Label) : e.Union := + e.point (max x.1 y.1) + (op _ (c.map (le_max_left _ _) x.2) (d.map (le_max_right _ _) y.2)) + +include coherent + +theorem binaryLabel_at (x : c.Label) (y : d.Label) (k : I) (hx : x.1 ≤ k) (hy : y.1 ≤ k) : + c.binaryLabel d e op x y = e.point k (op k (c.map hx x.2) (d.map hy y.2)) := by + let h : max x.1 y.1 ≤ k := max_le hx hy + change e.point (max x.1 y.1) _ = _ + rw [← e.point_map h, coherent, ← c.map_comp, ← d.map_comp] + +theorem binaryLabel_respects (x x' : c.Label) (y y' : d.Label) + (eqx : c.Related x x') (eqy : d.Related y y') : + c.binaryLabel d e op x y = c.binaryLabel d e op x' y' := by + rcases eqx with ⟨k, hx, hx', eqx⟩ + rcases eqy with ⟨l, hy, hy', eqy⟩ + rw [c.binaryLabel_at d e op coherent x y (max k l) + (le_trans hx (le_max_left _ _)) (le_trans hy (le_max_right _ _)), + c.binaryLabel_at d e op coherent x' y' (max k l) + (le_trans hx' (le_max_left _ _)) (le_trans hy' (le_max_right _ _))] + rw [c.map_comp hx (le_max_left _ _), c.map_comp hx' (le_max_left _ _), + d.map_comp hy (le_max_right _ _), d.map_comp hy' (le_max_right _ _), eqx, eqy] + +def binary : c.Union → d.Union → e.Union := + Quotient.lift₂ (c.binaryLabel d e op) + (fun x y x' y' hx hy => c.binaryLabel_respects d e op coherent x x' y y' hx hy) + +theorem binary_point (i : I) (x : c.Point i) (y : d.Point i) : + c.binary d e op coherent (c.point i x) (d.point i y) = e.point i (op i x y) := by + change c.binaryLabel d e op ⟨i, x⟩ ⟨i, y⟩ = _ + erw [c.binaryLabel_at d e op coherent _ _ i le_rfl le_rfl, c.map_self, d.map_self] + +end Binary + +end DirectSystem +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleBatchAgreement.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleBatchAgreement.lean index a6414dfe3cb6d146576f8a30d62929e967e4bd6a..486c84f3a4833d30437fdb12bd213409ae59eb24 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleBatchAgreement.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleBatchAgreement.lean @@ -1,121 +1,121 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.EligibleBatchEquivariance - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -universe u - -theorem groundEligibleFreshAction_positive_agreement (M : TransitiveGround.{u}) - {P G r μ A Labels m inv e g h v q q' q'' : ZFSet.{u}} - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (agree : ActionAgreementBelow P r A g h v) - (first : ZFSet.pair (ZFSet.pair g q) q' ∈ M.groundEligibleFreshAction P G r μ A Labels) - (second : ZFSet.pair (ZFSet.pair h q) q'' ∈ M.groundEligibleFreshAction P G r μ A Labels) - (upper : ZFSet.pair q v ∈ batchAttachmentUpperGraph - (M.groundEligibleTasks P G r μ A Labels) P - (constantFamilyGraph (M.groundEligibleTasks P G r μ A Labels) P) - (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)) : q' = q'' := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) - let T := M.groundTaskTransport P G r μ A Labels - obtain ⟨_, _, _, i, hi, i', _, x, _, source, target, firstTask⟩ := - (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first - obtain ⟨_, _, _, j, _, j', _, y, _, source', target', secondTask⟩ := - (triple_mem_indexedTaskActionGraph G I P N T h q q'').1 second - have indices : i = j := (ZFSet.pair_inj.1 (source.symm.trans source')).1 - have points : x = y := (ZFSet.pair_inj.1 (source.symm.trans source')).2 - subst j y - obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, _⟩ := - (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi - subst i - rw [source] at upper - have positive := ((literalTask_upper_iff ha hc hb hs hF hl).1 upper).2.2.2 - have same := M.groundTaskTransport_positive_agreement group action meet agree positive firstTask secondTask - exact target.trans ((congrArg (fun task => ZFSet.pair task x) same).trans target'.symm) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -universe u - -theorem codedAttachmentOrder_below_old - {P N r inside shadow upper x v : ZFSet.{u}} (hv : v ∈ P) : - ZFSet.pair x v ∈ codedAttachmentOrder P N r inside shadow upper ↔ - (x ∈ P ∧ ZFSet.pair x v ∈ r) ∨ - ∃ q ∈ N, x = ZFSet.pair P q ∧ ZFSet.pair q v ∈ upper := by - rw [pair_mem_codedAttachmentOrder] - constructor - · rintro ⟨_, _, old | oldFresh | freshOld | freshFresh⟩ - · exact Or.inl ⟨old.1, old.2.2⟩ - · obtain ⟨_, q, _, _, _, equal, _⟩ := oldFresh - exact False.elim (pair_tag_not_mem P q (equal ▸ hv)) - · exact Or.inr freshOld.2 - · obtain ⟨_, _, t, _, _, equal, _⟩ := freshFresh - exact False.elim (pair_tag_not_mem P t (equal ▸ hv)) - · rintro (⟨hx, lower⟩ | ⟨q, hq, rfl, upperEntry⟩) - · exact ⟨old_mem_taggedExtension hx, old_mem_taggedExtension hv, Or.inl ⟨hx, hv, lower⟩⟩ - · exact ⟨pair_mem_taggedExtension.2 hq, old_mem_taggedExtension hv, - Or.inr (Or.inr (Or.inl ⟨hv, q, hq, rfl, upperEntry⟩))⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem groundEligibleBatchAction_agreement - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv e g h v : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) (hv : v ∈ P) - (agree : ActionAgreementBelow P r A g h v) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ActionAgreementBelow d.batchCarrier d.batchOrder (M.groundEligibleBatchAction P G r μ A Labels) g h v := by - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - have full := M.groundEligibleBatchAction_code (Labels := Labels) - pairing unions powers separation hP hG hA group action meet - have fresh := M.groundEligibleFreshAction_setAction (Labels := Labels) - pairing unions powers separation hP hG hA group action meet - have outputs {x y z : ZFSet.{u}} (lower : ZFSet.pair x v ∈ d.batchOrder) - (first : ZFSet.pair (ZFSet.pair g x) y ∈ B) - (second : ZFSet.pair (ZFSet.pair h x) z ∈ B) : y = z := by - rcases (codedAttachmentOrder_below_old hv).1 lower with ⟨hx, below⟩ | ⟨q, _, rfl, upper⟩ - · exact agree.entry_eq action hh hx below - ((M.groundEligibleBatchAction_old_iff hx).1 first) - ((M.groundEligibleBatchAction_old_iff hx).1 second) - · obtain ⟨q', _, rfl, firstFresh⟩ := - (taggedActionGraph_fresh_iff action.toSetAction fresh).1 first - obtain ⟨q'', _, rfl, secondFresh⟩ := - (taggedActionGraph_fresh_iff action.toSetAction fresh).1 second - exact congrArg (ZFSet.pair P) - (M.groundEligibleFreshAction_positive_agreement group action meet agree firstFresh secondFresh upper) - change ActionAgreementBelow d.batchCarrier d.batchOrder B g h v - intro x hx y _ lower - constructor - · intro first - obtain ⟨z, second, _⟩ := full.function.2 (ZFSet.pair h x) (ZFSet.pair_mem_prod.2 ⟨hh, hx⟩) - exact (outputs lower first second).symm ▸ second - · intro second - obtain ⟨z, first, _⟩ := full.function.2 (ZFSet.pair g x) (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) - exact outputs lower first second ▸ first - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.EligibleBatchEquivariance + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +universe u + +theorem groundEligibleFreshAction_positive_agreement (M : TransitiveGround.{u}) + {P G r μ A Labels m inv e g h v q q' q'' : ZFSet.{u}} + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (agree : ActionAgreementBelow P r A g h v) + (first : ZFSet.pair (ZFSet.pair g q) q' ∈ M.groundEligibleFreshAction P G r μ A Labels) + (second : ZFSet.pair (ZFSet.pair h q) q'' ∈ M.groundEligibleFreshAction P G r μ A Labels) + (upper : ZFSet.pair q v ∈ batchAttachmentUpperGraph + (M.groundEligibleTasks P G r μ A Labels) P + (constantFamilyGraph (M.groundEligibleTasks P G r μ A Labels) P) + (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)) : q' = q'' := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let N := indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) + let T := M.groundTaskTransport P G r μ A Labels + obtain ⟨_, _, _, i, hi, i', _, x, _, source, target, firstTask⟩ := + (triple_mem_indexedTaskActionGraph G I P N T g q q').1 first + obtain ⟨_, _, _, j, _, j', _, y, _, source', target', secondTask⟩ := + (triple_mem_indexedTaskActionGraph G I P N T h q q'').1 second + have indices : i = j := (ZFSet.pair_inj.1 (source.symm.trans source')).1 + have points : x = y := (ZFSet.pair_inj.1 (source.symm.trans source')).2 + subst j y + obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, _⟩ := + (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi + subst i + rw [source] at upper + have positive := ((literalTask_upper_iff ha hc hb hs hF hl).1 upper).2.2.2 + have same := M.groundTaskTransport_positive_agreement group action meet agree positive firstTask secondTask + exact target.trans ((congrArg (fun task => ZFSet.pair task x) same).trans target'.symm) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +universe u + +theorem codedAttachmentOrder_below_old + {P N r inside shadow upper x v : ZFSet.{u}} (hv : v ∈ P) : + ZFSet.pair x v ∈ codedAttachmentOrder P N r inside shadow upper ↔ + (x ∈ P ∧ ZFSet.pair x v ∈ r) ∨ + ∃ q ∈ N, x = ZFSet.pair P q ∧ ZFSet.pair q v ∈ upper := by + rw [pair_mem_codedAttachmentOrder] + constructor + · rintro ⟨_, _, old | oldFresh | freshOld | freshFresh⟩ + · exact Or.inl ⟨old.1, old.2.2⟩ + · obtain ⟨_, q, _, _, _, equal, _⟩ := oldFresh + exact False.elim (pair_tag_not_mem P q (equal ▸ hv)) + · exact Or.inr freshOld.2 + · obtain ⟨_, _, t, _, _, equal, _⟩ := freshFresh + exact False.elim (pair_tag_not_mem P t (equal ▸ hv)) + · rintro (⟨hx, lower⟩ | ⟨q, hq, rfl, upperEntry⟩) + · exact ⟨old_mem_taggedExtension hx, old_mem_taggedExtension hv, Or.inl ⟨hx, hv, lower⟩⟩ + · exact ⟨pair_mem_taggedExtension.2 hq, old_mem_taggedExtension hv, + Or.inr (Or.inr (Or.inl ⟨hv, q, hq, rfl, upperEntry⟩))⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem groundEligibleBatchAction_agreement + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv e g h v : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hg : g ∈ G) (hh : h ∈ G) (hv : v ∈ P) + (agree : ActionAgreementBelow P r A g h v) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ActionAgreementBelow d.batchCarrier d.batchOrder (M.groundEligibleBatchAction P G r μ A Labels) g h v := by + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + have full := M.groundEligibleBatchAction_code (Labels := Labels) + pairing unions powers separation hP hG hA group action meet + have fresh := M.groundEligibleFreshAction_setAction (Labels := Labels) + pairing unions powers separation hP hG hA group action meet + have outputs {x y z : ZFSet.{u}} (lower : ZFSet.pair x v ∈ d.batchOrder) + (first : ZFSet.pair (ZFSet.pair g x) y ∈ B) + (second : ZFSet.pair (ZFSet.pair h x) z ∈ B) : y = z := by + rcases (codedAttachmentOrder_below_old hv).1 lower with ⟨hx, below⟩ | ⟨q, _, rfl, upper⟩ + · exact agree.entry_eq action hh hx below + ((M.groundEligibleBatchAction_old_iff hx).1 first) + ((M.groundEligibleBatchAction_old_iff hx).1 second) + · obtain ⟨q', _, rfl, firstFresh⟩ := + (taggedActionGraph_fresh_iff action.toSetAction fresh).1 first + obtain ⟨q'', _, rfl, secondFresh⟩ := + (taggedActionGraph_fresh_iff action.toSetAction fresh).1 second + exact congrArg (ZFSet.pair P) + (M.groundEligibleFreshAction_positive_agreement group action meet agree firstFresh secondFresh upper) + change ActionAgreementBelow d.batchCarrier d.batchOrder B g h v + intro x hx y _ lower + constructor + · intro first + obtain ⟨z, second, _⟩ := full.function.2 (ZFSet.pair h x) (ZFSet.pair_mem_prod.2 ⟨hh, hx⟩) + exact (outputs lower first second).symm ▸ second + · intro second + obtain ⟨z, first, _⟩ := full.function.2 (ZFSet.pair g x) (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) + exact outputs lower first second ▸ first + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleTaskCovariance.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleTaskCovariance.lean index 0e4a5b317275906c0a8cc62a2607a88a505743d5..bf1d82f112078483eafc524f5d880a8070bfd6d8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleTaskCovariance.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/EligibleTaskCovariance.lean @@ -1,194 +1,194 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization -import OAI.SetTheory.PartitionPrinciple.Forcing.TaskTransportCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -theorem literalTask_fresh_iff {I P R U Labels r a c base s F label q : ZFSet.{u}} - (ha : a ∈ P) (hc : c ∈ P) (hb : base ∈ R) (hs : s ∈ P) - (hF : F ∈ U) (hl : label ∈ Labels) : - ZFSet.pair (literalTaskCode a c base s F label) q ∈ - indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) ↔ - literalTaskCode a c base s F label ∈ I ∧ q ∈ P ∧ ZFSet.pair q a ∉ r := by - rw [pair_mem_indexedAttachmentFresh] - constructor - · rintro ⟨hi, Q, r', a', eQ, er, ea, hq, fresh⟩ - obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 eQ).2 - obtain rfl := ((pair_mem_constantFamilyGraph I r _ r').1 er).2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 ea).2 - exact ⟨hi, hq, fresh⟩ - · rintro ⟨hi, hq, fresh⟩ - exact ⟨hi, P, r, a, (pair_mem_constantFamilyGraph I P _ P).2 ⟨hi, rfl⟩, - (pair_mem_constantFamilyGraph I r _ r).2 ⟨hi, rfl⟩, - (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).2 ⟨hi, rfl⟩, hq, fresh⟩ - -theorem literalTask_shadow_iff {I P R U Labels μ a c base s F label q x : ZFSet.{u}} - (ha : a ∈ P) (hc : c ∈ P) (hb : base ∈ R) (hs : s ∈ P) - (hF : F ∈ U) (hl : label ∈ Labels) : - ZFSet.pair (ZFSet.pair (literalTaskCode a c base s F label) q) x ∈ - batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) ↔ - literalTaskCode a c base s F label ∈ I ∧ - ZFSet.pair q x ∈ attachmentShadowGraph P P μ base a := by - rw [pair_mem_batchAttachmentShadowGraph] - constructor - · rintro ⟨hi, Q, μ', a', base', eQ, eμ, ea, eb, entry⟩ - obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 eQ).2 - obtain rfl := ((pair_mem_constantFamilyGraph I μ _ μ').1 eμ).2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 ea).2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).1 eb).2 - exact ⟨hi, entry⟩ - · rintro ⟨hi, entry⟩ - exact ⟨hi, P, μ, a, base, - (pair_mem_constantFamilyGraph I P _ P).2 ⟨hi, rfl⟩, - (pair_mem_constantFamilyGraph I μ _ μ).2 ⟨hi, rfl⟩, - (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).2 ⟨hi, rfl⟩, - (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).2 ⟨hi, rfl⟩, entry⟩ - -theorem literalTask_upper_iff {I P R U Labels a c base s F label q x : ZFSet.{u}} - (ha : a ∈ P) (hc : c ∈ P) (hb : base ∈ R) (hs : s ∈ P) - (hF : F ∈ U) (hl : label ∈ Labels) : - ZFSet.pair (ZFSet.pair (literalTaskCode a c base s F label) q) x ∈ - batchAttachmentUpperGraph I P (constantFamilyGraph I P) - (literalTaskFilterGraph I P R U Labels) ↔ - literalTaskCode a c base s F label ∈ I ∧ q ∈ P ∧ x ∈ P ∧ x ∈ F := by - rw [pair_mem_batchAttachmentUpperGraph] - constructor - · rintro ⟨hi, hx, Q, F', eQ, eF, hq, upper⟩ - obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 eQ).2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 4).1 eF).2 - exact ⟨hi, hq, hx, upper⟩ - · rintro ⟨hi, hq, hx, upper⟩ - exact ⟨hi, hx, P, F, (pair_mem_constantFamilyGraph I P _ P).2 ⟨hi, rfl⟩, - (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 4).2 ⟨hi, rfl⟩, hq, upper⟩ - -theorem constantTask_inside_iff (I P r t q s v : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair t q) (ZFSet.pair s v) ∈ - batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r) ↔ - t = s ∧ t ∈ I ∧ q ∈ P ∧ v ∈ P ∧ ZFSet.pair q v ∈ r := by - rw [pair_mem_batchAttachmentInsideGraph] - constructor - · rintro ⟨equal, ht, Q, r', eQ, er, hq, hv, lower⟩ - obtain rfl := ((pair_mem_constantFamilyGraph I P t Q).1 eQ).2 - obtain rfl := ((pair_mem_constantFamilyGraph I r t r').1 er).2 - exact ⟨equal, ht, hq, hv, lower⟩ - · rintro ⟨equal, ht, hq, hv, lower⟩ - exact ⟨equal, ht, P, r, (pair_mem_constantFamilyGraph I P t P).2 ⟨ht, rfl⟩, - (pair_mem_constantFamilyGraph I r t r).2 ⟨ht, rfl⟩, hq, hv, lower⟩ - -namespace TaskTransportCode - -variable {I P R U Labels A g t t' : ZFSet.{u}} -variable (transport : TaskTransportCode P R U Labels A g t t') -include transport - -theorem source_eq {a a' : ZFSet.{u}} - (first : ZFSet.pair t a ∈ literalTaskSourceGraph I P R U Labels) - (second : ZFSet.pair t' a' ∈ literalTaskSourceGraph I P R U Labels) : a = a' := by - obtain ⟨b, hb, c, hc, base, hbase, s, hs, F, hF, label, hl, - c', hc', base', hbase', s', hs', F', hF', rfl, rfl, _⟩ := transport - have left := ((literalTaskFieldGraph_entry_iff hb hc hbase hs hF hl 0).1 first).2 - have right := ((literalTaskFieldGraph_entry_iff hb hc' hbase' hs' hF' hl 0).1 second).2 - exact left.trans right.symm - -theorem label_eq {label label' : ZFSet.{u}} - (first : ZFSet.pair t label ∈ literalTaskLabelGraph I P R U Labels) - (second : ZFSet.pair t' label' ∈ literalTaskLabelGraph I P R U Labels) : label = label' := by - obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, l, hl, - c', hc', base', hbase', s', hs', F', hF', rfl, rfl, _⟩ := transport - have left := ((literalTaskFieldGraph_entry_iff ha hc hbase hs hF hl 5).1 first).2 - have right := ((literalTaskFieldGraph_entry_iff ha hc' hbase' hs' hF' hl 5).1 second).2 - exact left.trans right.symm - -theorem base_eq {base base' : ZFSet.{u}} - (first : ZFSet.pair t base ∈ literalTaskBaseGraph I P R U Labels) - (second : ZFSet.pair t' base' ∈ literalTaskBaseGraph I P R U Labels) : - base' = actionPostcompose P A g base := by - obtain ⟨a, ha, c, hc, b, hb, s, hs, F, hF, label, hl, - c', hc', b', hb', s', hs', F', hF', rfl, rfl, _, _, equal, _⟩ := transport - have left := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).1 first).2 - have right := ((literalTaskFieldGraph_entry_iff ha hc' hb' hs' hF' hl 2).1 second).2 - exact right.trans (equal.trans (congrArg (actionPostcompose P A g) left.symm)) - -theorem filter_eq {F F' : ZFSet.{u}} - (first : ZFSet.pair t F ∈ literalTaskFilterGraph I P R U Labels) - (second : ZFSet.pair t' F' ∈ literalTaskFilterGraph I P R U Labels) : - F' = actionImage P A g F := by - obtain ⟨a, ha, c, hc, base, hb, s, hs, J, hJ, label, hl, - c', hc', base', hb', s', hs', J', hJ', rfl, rfl, _, _, _, equal⟩ := transport - have left := ((literalTaskFieldGraph_entry_iff ha hc hb hs hJ hl 4).1 first).2 - have right := ((literalTaskFieldGraph_entry_iff ha hc' hb' hs' hJ' hl 4).1 second).2 - exact right.trans (equal.trans (congrArg (actionImage P A g) left.symm)) - -theorem fresh_iff {r q : ZFSet.{u}} (ht : t ∈ I) (ht' : t' ∈ I) : - ZFSet.pair t q ∈ indexedAttachmentFresh I (constantFamilyGraph I P) - (constantFamilyGraph I r) (literalTaskSourceGraph I P R U Labels) ↔ - ZFSet.pair t' q ∈ indexedAttachmentFresh I (constantFamilyGraph I P) - (constantFamilyGraph I r) (literalTaskSourceGraph I P R U Labels) := by - obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, - c', hc', base', hb', s', hs', F', hF', rfl, rfl, _⟩ := transport - rw [literalTask_fresh_iff ha hc hb hs hF hl, - literalTask_fresh_iff ha hc' hb' hs' hF' hl] - exact and_congr (iff_of_true ht ht') Iff.rfl - -theorem shadow_covariant {G m e r μ q x x' : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (ht' : t' ∈ I) - (shadow : ZFSet.pair (ZFSet.pair t q) x ∈ - batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels)) - (acted : ZFSet.pair (ZFSet.pair g x) x' ∈ A) : - ZFSet.pair (ZFSet.pair t' q) x' ∈ - batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by - obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, - c', hc', base', hb', s', hs', F', hF', rfl, rfl, _, _, equal, _⟩ := transport - have old := ((literalTask_shadow_iff ha hc hb hs hF hl).1 shadow).2 - obtain ⟨hq, hx, b, hbp, meet, entry⟩ := (pair_mem_attachmentShadowGraph P P μ base a q x).1 old - have hx' := (ZFSet.pair_mem_prod.1 (action.function.1 acted)).2 - apply (literalTask_shadow_iff ha hc' hb' hs' hF' hl).2 - refine ⟨ht', (pair_mem_attachmentShadowGraph P P μ base' a q x').2 - ⟨hq, hx', b, hbp, meet, ?_⟩⟩ - rw [equal] - exact (pair_mem_actionPostcompose P A g base b x').2 ⟨hbp, hx', x, hx, entry, acted⟩ - -theorem upper_covariant {G m e r q x x' : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (ht' : t' ∈ I) - (upper : ZFSet.pair (ZFSet.pair t q) x ∈ - batchAttachmentUpperGraph I P (constantFamilyGraph I P) (literalTaskFilterGraph I P R U Labels)) - (acted : ZFSet.pair (ZFSet.pair g x) x' ∈ A) : - ZFSet.pair (ZFSet.pair t' q) x' ∈ - batchAttachmentUpperGraph I P (constantFamilyGraph I P) (literalTaskFilterGraph I P R U Labels) := by - obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, - c', hc', base', hb', s', hs', F', hF', rfl, rfl, _, _, _, equal⟩ := transport - obtain ⟨_, hq, _, hxF⟩ := (literalTask_upper_iff ha hc hb hs hF hl).1 upper - have hx' := (ZFSet.pair_mem_prod.1 (action.function.1 acted)).2 - apply (literalTask_upper_iff ha hc' hb' hs' hF' hl).2 - refine ⟨ht', hq, hx', ?_⟩ - rw [equal] - exact (mem_actionImage P A g F x').2 ⟨hx', x, hxF, acted⟩ - -theorem inside_covariant {G m e r s s' q v : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (hg : g ∈ G) - (second : TaskTransportCode P R U Labels A g s s') (ht' : t' ∈ I) - (inside : ZFSet.pair (ZFSet.pair t q) (ZFSet.pair s v) ∈ - batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r)) : - ZFSet.pair (ZFSet.pair t' q) (ZFSet.pair s' v) ∈ - batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r) := by - obtain ⟨equal, _, hq, hv, lower⟩ := (constantTask_inside_iff I P r t q s v).1 inside - subst s - exact (constantTask_inside_iff I P r t' q s' v).2 - ⟨TaskTransportCode.unique action hg transport second, ht', hq, hv, lower⟩ - -end TaskTransportCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization +import OAI.SetTheory.PartitionPrinciple.Forcing.TaskTransportCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +theorem literalTask_fresh_iff {I P R U Labels r a c base s F label q : ZFSet.{u}} + (ha : a ∈ P) (hc : c ∈ P) (hb : base ∈ R) (hs : s ∈ P) + (hF : F ∈ U) (hl : label ∈ Labels) : + ZFSet.pair (literalTaskCode a c base s F label) q ∈ + indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) ↔ + literalTaskCode a c base s F label ∈ I ∧ q ∈ P ∧ ZFSet.pair q a ∉ r := by + rw [pair_mem_indexedAttachmentFresh] + constructor + · rintro ⟨hi, Q, r', a', eQ, er, ea, hq, fresh⟩ + obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 eQ).2 + obtain rfl := ((pair_mem_constantFamilyGraph I r _ r').1 er).2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 ea).2 + exact ⟨hi, hq, fresh⟩ + · rintro ⟨hi, hq, fresh⟩ + exact ⟨hi, P, r, a, (pair_mem_constantFamilyGraph I P _ P).2 ⟨hi, rfl⟩, + (pair_mem_constantFamilyGraph I r _ r).2 ⟨hi, rfl⟩, + (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).2 ⟨hi, rfl⟩, hq, fresh⟩ + +theorem literalTask_shadow_iff {I P R U Labels μ a c base s F label q x : ZFSet.{u}} + (ha : a ∈ P) (hc : c ∈ P) (hb : base ∈ R) (hs : s ∈ P) + (hF : F ∈ U) (hl : label ∈ Labels) : + ZFSet.pair (ZFSet.pair (literalTaskCode a c base s F label) q) x ∈ + batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) ↔ + literalTaskCode a c base s F label ∈ I ∧ + ZFSet.pair q x ∈ attachmentShadowGraph P P μ base a := by + rw [pair_mem_batchAttachmentShadowGraph] + constructor + · rintro ⟨hi, Q, μ', a', base', eQ, eμ, ea, eb, entry⟩ + obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 eQ).2 + obtain rfl := ((pair_mem_constantFamilyGraph I μ _ μ').1 eμ).2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 ea).2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).1 eb).2 + exact ⟨hi, entry⟩ + · rintro ⟨hi, entry⟩ + exact ⟨hi, P, μ, a, base, + (pair_mem_constantFamilyGraph I P _ P).2 ⟨hi, rfl⟩, + (pair_mem_constantFamilyGraph I μ _ μ).2 ⟨hi, rfl⟩, + (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).2 ⟨hi, rfl⟩, + (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).2 ⟨hi, rfl⟩, entry⟩ + +theorem literalTask_upper_iff {I P R U Labels a c base s F label q x : ZFSet.{u}} + (ha : a ∈ P) (hc : c ∈ P) (hb : base ∈ R) (hs : s ∈ P) + (hF : F ∈ U) (hl : label ∈ Labels) : + ZFSet.pair (ZFSet.pair (literalTaskCode a c base s F label) q) x ∈ + batchAttachmentUpperGraph I P (constantFamilyGraph I P) + (literalTaskFilterGraph I P R U Labels) ↔ + literalTaskCode a c base s F label ∈ I ∧ q ∈ P ∧ x ∈ P ∧ x ∈ F := by + rw [pair_mem_batchAttachmentUpperGraph] + constructor + · rintro ⟨hi, hx, Q, F', eQ, eF, hq, upper⟩ + obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 eQ).2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 4).1 eF).2 + exact ⟨hi, hq, hx, upper⟩ + · rintro ⟨hi, hq, hx, upper⟩ + exact ⟨hi, hx, P, F, (pair_mem_constantFamilyGraph I P _ P).2 ⟨hi, rfl⟩, + (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 4).2 ⟨hi, rfl⟩, hq, upper⟩ + +theorem constantTask_inside_iff (I P r t q s v : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair t q) (ZFSet.pair s v) ∈ + batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r) ↔ + t = s ∧ t ∈ I ∧ q ∈ P ∧ v ∈ P ∧ ZFSet.pair q v ∈ r := by + rw [pair_mem_batchAttachmentInsideGraph] + constructor + · rintro ⟨equal, ht, Q, r', eQ, er, hq, hv, lower⟩ + obtain rfl := ((pair_mem_constantFamilyGraph I P t Q).1 eQ).2 + obtain rfl := ((pair_mem_constantFamilyGraph I r t r').1 er).2 + exact ⟨equal, ht, hq, hv, lower⟩ + · rintro ⟨equal, ht, hq, hv, lower⟩ + exact ⟨equal, ht, P, r, (pair_mem_constantFamilyGraph I P t P).2 ⟨ht, rfl⟩, + (pair_mem_constantFamilyGraph I r t r).2 ⟨ht, rfl⟩, hq, hv, lower⟩ + +namespace TaskTransportCode + +variable {I P R U Labels A g t t' : ZFSet.{u}} +variable (transport : TaskTransportCode P R U Labels A g t t') +include transport + +theorem source_eq {a a' : ZFSet.{u}} + (first : ZFSet.pair t a ∈ literalTaskSourceGraph I P R U Labels) + (second : ZFSet.pair t' a' ∈ literalTaskSourceGraph I P R U Labels) : a = a' := by + obtain ⟨b, hb, c, hc, base, hbase, s, hs, F, hF, label, hl, + c', hc', base', hbase', s', hs', F', hF', rfl, rfl, _⟩ := transport + have left := ((literalTaskFieldGraph_entry_iff hb hc hbase hs hF hl 0).1 first).2 + have right := ((literalTaskFieldGraph_entry_iff hb hc' hbase' hs' hF' hl 0).1 second).2 + exact left.trans right.symm + +theorem label_eq {label label' : ZFSet.{u}} + (first : ZFSet.pair t label ∈ literalTaskLabelGraph I P R U Labels) + (second : ZFSet.pair t' label' ∈ literalTaskLabelGraph I P R U Labels) : label = label' := by + obtain ⟨a, ha, c, hc, base, hbase, s, hs, F, hF, l, hl, + c', hc', base', hbase', s', hs', F', hF', rfl, rfl, _⟩ := transport + have left := ((literalTaskFieldGraph_entry_iff ha hc hbase hs hF hl 5).1 first).2 + have right := ((literalTaskFieldGraph_entry_iff ha hc' hbase' hs' hF' hl 5).1 second).2 + exact left.trans right.symm + +theorem base_eq {base base' : ZFSet.{u}} + (first : ZFSet.pair t base ∈ literalTaskBaseGraph I P R U Labels) + (second : ZFSet.pair t' base' ∈ literalTaskBaseGraph I P R U Labels) : + base' = actionPostcompose P A g base := by + obtain ⟨a, ha, c, hc, b, hb, s, hs, F, hF, label, hl, + c', hc', b', hb', s', hs', F', hF', rfl, rfl, _, _, equal, _⟩ := transport + have left := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).1 first).2 + have right := ((literalTaskFieldGraph_entry_iff ha hc' hb' hs' hF' hl 2).1 second).2 + exact right.trans (equal.trans (congrArg (actionPostcompose P A g) left.symm)) + +theorem filter_eq {F F' : ZFSet.{u}} + (first : ZFSet.pair t F ∈ literalTaskFilterGraph I P R U Labels) + (second : ZFSet.pair t' F' ∈ literalTaskFilterGraph I P R U Labels) : + F' = actionImage P A g F := by + obtain ⟨a, ha, c, hc, base, hb, s, hs, J, hJ, label, hl, + c', hc', base', hb', s', hs', J', hJ', rfl, rfl, _, _, _, equal⟩ := transport + have left := ((literalTaskFieldGraph_entry_iff ha hc hb hs hJ hl 4).1 first).2 + have right := ((literalTaskFieldGraph_entry_iff ha hc' hb' hs' hJ' hl 4).1 second).2 + exact right.trans (equal.trans (congrArg (actionImage P A g) left.symm)) + +theorem fresh_iff {r q : ZFSet.{u}} (ht : t ∈ I) (ht' : t' ∈ I) : + ZFSet.pair t q ∈ indexedAttachmentFresh I (constantFamilyGraph I P) + (constantFamilyGraph I r) (literalTaskSourceGraph I P R U Labels) ↔ + ZFSet.pair t' q ∈ indexedAttachmentFresh I (constantFamilyGraph I P) + (constantFamilyGraph I r) (literalTaskSourceGraph I P R U Labels) := by + obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, + c', hc', base', hb', s', hs', F', hF', rfl, rfl, _⟩ := transport + rw [literalTask_fresh_iff ha hc hb hs hF hl, + literalTask_fresh_iff ha hc' hb' hs' hF' hl] + exact and_congr (iff_of_true ht ht') Iff.rfl + +theorem shadow_covariant {G m e r μ q x x' : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (ht' : t' ∈ I) + (shadow : ZFSet.pair (ZFSet.pair t q) x ∈ + batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels)) + (acted : ZFSet.pair (ZFSet.pair g x) x' ∈ A) : + ZFSet.pair (ZFSet.pair t' q) x' ∈ + batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by + obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, + c', hc', base', hb', s', hs', F', hF', rfl, rfl, _, _, equal, _⟩ := transport + have old := ((literalTask_shadow_iff ha hc hb hs hF hl).1 shadow).2 + obtain ⟨hq, hx, b, hbp, meet, entry⟩ := (pair_mem_attachmentShadowGraph P P μ base a q x).1 old + have hx' := (ZFSet.pair_mem_prod.1 (action.function.1 acted)).2 + apply (literalTask_shadow_iff ha hc' hb' hs' hF' hl).2 + refine ⟨ht', (pair_mem_attachmentShadowGraph P P μ base' a q x').2 + ⟨hq, hx', b, hbp, meet, ?_⟩⟩ + rw [equal] + exact (pair_mem_actionPostcompose P A g base b x').2 ⟨hbp, hx', x, hx, entry, acted⟩ + +theorem upper_covariant {G m e r q x x' : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (ht' : t' ∈ I) + (upper : ZFSet.pair (ZFSet.pair t q) x ∈ + batchAttachmentUpperGraph I P (constantFamilyGraph I P) (literalTaskFilterGraph I P R U Labels)) + (acted : ZFSet.pair (ZFSet.pair g x) x' ∈ A) : + ZFSet.pair (ZFSet.pair t' q) x' ∈ + batchAttachmentUpperGraph I P (constantFamilyGraph I P) (literalTaskFilterGraph I P R U Labels) := by + obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, + c', hc', base', hb', s', hs', F', hF', rfl, rfl, _, _, _, equal⟩ := transport + obtain ⟨_, hq, _, hxF⟩ := (literalTask_upper_iff ha hc hb hs hF hl).1 upper + have hx' := (ZFSet.pair_mem_prod.1 (action.function.1 acted)).2 + apply (literalTask_upper_iff ha hc' hb' hs' hF' hl).2 + refine ⟨ht', hq, hx', ?_⟩ + rw [equal] + exact (mem_actionImage P A g F x').2 ⟨hx', x, hxF, acted⟩ + +theorem inside_covariant {G m e r s s' q v : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (hg : g ∈ G) + (second : TaskTransportCode P R U Labels A g s s') (ht' : t' ∈ I) + (inside : ZFSet.pair (ZFSet.pair t q) (ZFSet.pair s v) ∈ + batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r)) : + ZFSet.pair (ZFSet.pair t' q) (ZFSet.pair s' v) ∈ + batchAttachmentInsideGraph I (constantFamilyGraph I P) (constantFamilyGraph I r) := by + obtain ⟨equal, _, hq, hv, lower⟩ := (constantTask_inside_iff I P r t q s v).1 inside + subst s + exact (constantTask_inside_iff I P r t' q s' v).2 + ⟨TaskTransportCode.unique action hg transport second, ht', hq, hv, lower⟩ + +end TaskTransportCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalColumnOrders.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalColumnOrders.lean index b12a3cc305c6c5591457894c5cab2310d7168cac..93567bb23506eff7c03d72dc8f427d64aaceef43 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalColumnOrders.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalColumnOrders.lean @@ -1,41 +1,41 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalColumnCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps -universe u - -noncomputable def ordinalColumnOrder {C : ZFSet.{u}} (ordinal : ordinalSetProperty C) : - LinearHeightOrder (SetMembers C) where - lt x y := SetMembers.raw x ∈ SetMembers.raw y - irrefl x := ZFSet.mem_irrefl (SetMembers.raw x) - trans {x y z} lower upper := ordinal.2 (SetMembers.raw z) (SetMembers.raw_mem z) (SetMembers.raw y) upper (SetMembers.raw x) lower - compare x y := (ordinalSetProperty_mem_compare ordinal (SetMembers.raw_mem x) (SetMembers.raw_mem y)).imp id - (fun h => h.imp (fun eq => SetMembers.raw_injective C eq) id) - -namespace ExternalColumnCode -variable {C K base sequence cap : ZFSet.{u}} (code : ExternalColumnCode C K base sequence cap) - -theorem typed_increasing (ordinal : ordinalSetProperty C) (n : Nat) : - (ordinalColumnOrder ordinal).lt (code.smallColumn n) (code.smallColumn (n + 1)) := - code.smallColumn_increasing n - -theorem typed_cap_bound (ordinal : ordinalSetProperty C) (n : Nat) : - (ordinalColumnOrder ordinal).lt (code.smallColumn n) (SetMembers.ofMem cap code.cap_mem) := by - simpa only [ordinalColumnOrder, SetMembers.raw_ofMem] using code.smallColumn_bounded n - -theorem typed_old_bound (ordinal : ordinalSetProperty C) (x : SetMembers C) - (member : SetMembers.raw x ∈ K) (n : Nat) : - (ordinalColumnOrder ordinal).lt x (code.smallColumn n) := by - simpa only [ordinalColumnOrder, smallColumn, SetMembers.raw_ofMem] using code.old_below member n - -end ExternalColumnCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalColumnCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps +universe u + +noncomputable def ordinalColumnOrder {C : ZFSet.{u}} (ordinal : ordinalSetProperty C) : + LinearHeightOrder (SetMembers C) where + lt x y := SetMembers.raw x ∈ SetMembers.raw y + irrefl x := ZFSet.mem_irrefl (SetMembers.raw x) + trans {x y z} lower upper := ordinal.2 (SetMembers.raw z) (SetMembers.raw_mem z) (SetMembers.raw y) upper (SetMembers.raw x) lower + compare x y := (ordinalSetProperty_mem_compare ordinal (SetMembers.raw_mem x) (SetMembers.raw_mem y)).imp id + (fun h => h.imp (fun eq => SetMembers.raw_injective C eq) id) + +namespace ExternalColumnCode +variable {C K base sequence cap : ZFSet.{u}} (code : ExternalColumnCode C K base sequence cap) + +theorem typed_increasing (ordinal : ordinalSetProperty C) (n : Nat) : + (ordinalColumnOrder ordinal).lt (code.smallColumn n) (code.smallColumn (n + 1)) := + code.smallColumn_increasing n + +theorem typed_cap_bound (ordinal : ordinalSetProperty C) (n : Nat) : + (ordinalColumnOrder ordinal).lt (code.smallColumn n) (SetMembers.ofMem cap code.cap_mem) := by + simpa only [ordinalColumnOrder, SetMembers.raw_ofMem] using code.smallColumn_bounded n + +theorem typed_old_bound (ordinal : ordinalSetProperty C) (x : SetMembers C) + (member : SetMembers.raw x ∈ K) (n : Nat) : + (ordinalColumnOrder ordinal).lt x (code.smallColumn n) := by + simpa only [ordinalColumnOrder, smallColumn, SetMembers.raw_ofMem] using code.old_below member n + +end ExternalColumnCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalCopyDescent.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalCopyDescent.lean index 803ec776322c129dfc23e6dfe9f912788d582ee8..a69d7a0fe602a3627f3d1891ec86c995079a5d08 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalCopyDescent.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalCopyDescent.lean @@ -1,97 +1,97 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalCopyRelations - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family -open Attachment CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -noncomputable def flatTileValue (w : External J f.Letters) (r : R) - (z : (f.tile r).Space) : f.FlatQuotient a := - f.flatClass a (f.flatWord w r (Classical.choose (f.flatVertex_cover r z))) - (Classical.choose (Classical.choose_spec (f.flatVertex_cover r z))) - -theorem flatTileValue_vertex (w : External J f.Letters) (r : R) - (i : Option (f.Child r)) (x : A) : - f.flatTileValue a w r ((f.flatVertex r i).toFun x) = - f.flatClass a (f.flatWord w r i) x := by - unfold flatTileValue - apply f.flatClass_tile a - exact Classical.choose_spec (Classical.choose_spec (f.flatVertex_cover r _)) - -noncomputable def flatIncidenceValue : - (v : TileStars.Vertex J f.Letters R) → f.Space v → f.FlatQuotient a - | .inl v, x => f.flatClass a (representative J f.Letters v) x - | .inr c, x => f.flatTileValue a c.1 c.2 x - -theorem flatIncidenceValue_copy (w : External J f.Letters) (x : A) : - f.flatIncidenceValue a (.inl (point J f.Letters w)) ((a.chart w).toFun x) = - f.flatClass a w x := by - change f.flatClass a (representative J f.Letters (point J f.Letters w)) - ((a.iso (coordinate J f.Letters w)).toFun x) = _ - rw [← f.flatClass_coordinate, coordinate_spec] - -theorem flatIncidence_stem (w : External J f.Letters) (r : R) : - (f.diagram a).Equation (f.flatIncidenceValue a) (.inl (w, r), true) := by - intro x - change f.flatIncidenceValue a (.inl (point J f.Letters w)) x.val = - f.flatTileValue a w r ((f.tile r).root.toFun ((a.chart w).inverse x.val)) - have vertex := f.flatTileValue_vertex a w r none ((a.chart w).inverse x.val) - change f.flatTileValue a w r ((f.tile r).root.toFun ((a.chart w).inverse x.val)) = - f.flatClass a w ((a.chart w).inverse x.val) at vertex - rw [vertex] - have eq := f.flatIncidenceValue_copy a w ((a.chart w).inverse x.val) - erw [(a.chart w).right_inverse] at eq - exact eq - -theorem flatIncidence_branch (w : External J f.Letters) (r : R) (j : f.Child r) : - (f.diagram a).Equation (f.flatIncidenceValue a) (.inr (w, ⟨r, j⟩), true) := by - intro x - let i := f.vertexIdealIso ((f.tile r).child j) - obtain ⟨y, rfl⟩ : ∃ y, i.toFun y = x := ⟨i.inverse x, i.right_inverse x⟩ - change f.flatTileValue a w r (((f.tile r).child j).toFun y) = - f.flatIncidenceValue a (.inl (point J f.Letters (w * generator J f.Letters ⟨r, j⟩))) - ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val - have formula : ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val = - (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun y := f.branch_formula a w r j y - rw [formula, f.flatIncidenceValue_copy] - exact f.flatTileValue_vertex a w r (some j) y - -theorem flatIncidence_edges (d : TileStars.Dart J f.Letters R) : - (f.diagram a).Equation (f.flatIncidenceValue a) d := by - rcases d with ⟨e, b⟩ - have forward : (f.diagram a).Equation (f.flatIncidenceValue a) (e, true) := by - cases e with - | inl c => exact f.flatIncidence_stem a c.1 c.2 - | inr c => exact f.flatIncidence_branch a c.1 c.2.1 c.2.2 - cases b - · exact (f.diagram a).equation_of_reverse (f.flatIncidenceValue a) (e, false) forward - · exact forward - -noncomputable def toFlatQuotient (z : f.Node a) : f.FlatQuotient a := - (f.diagram a).descend (f.flatIncidenceValue a) (f.flatIncidence_edges a) z - -theorem toFlatQuotient_copy (w : External J f.Letters) (x : A) : - f.toFlatQuotient a ((f.copy a w).toFun x) = f.flatClass a w x := by - change (f.diagram a).descend (f.flatIncidenceValue a) (f.flatIncidence_edges a) - (((f.diagram a).vertex (.inl (point J f.Letters w))).toFun ((a.chart w).toFun x)) = _ - erw [(f.diagram a).descend_vertex, f.flatIncidenceValue_copy] - -theorem flatPath_iff_copy_eq (x y : f.FlatLabel (J := J)) : - f.FlatPath a x y ↔ (f.copy a x.1).toFun x.2 = (f.copy a y.1).toFun y.2 := by - constructor - · exact FlatPath.copy_eq f a - · intro equal - have classes := congrArg (f.toFlatQuotient a) equal - rw [f.toFlatQuotient_copy, f.toFlatQuotient_copy] at classes - exact Quotient.exact classes - -end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalCopyRelations + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family +open Attachment CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +noncomputable def flatTileValue (w : External J f.Letters) (r : R) + (z : (f.tile r).Space) : f.FlatQuotient a := + f.flatClass a (f.flatWord w r (Classical.choose (f.flatVertex_cover r z))) + (Classical.choose (Classical.choose_spec (f.flatVertex_cover r z))) + +theorem flatTileValue_vertex (w : External J f.Letters) (r : R) + (i : Option (f.Child r)) (x : A) : + f.flatTileValue a w r ((f.flatVertex r i).toFun x) = + f.flatClass a (f.flatWord w r i) x := by + unfold flatTileValue + apply f.flatClass_tile a + exact Classical.choose_spec (Classical.choose_spec (f.flatVertex_cover r _)) + +noncomputable def flatIncidenceValue : + (v : TileStars.Vertex J f.Letters R) → f.Space v → f.FlatQuotient a + | .inl v, x => f.flatClass a (representative J f.Letters v) x + | .inr c, x => f.flatTileValue a c.1 c.2 x + +theorem flatIncidenceValue_copy (w : External J f.Letters) (x : A) : + f.flatIncidenceValue a (.inl (point J f.Letters w)) ((a.chart w).toFun x) = + f.flatClass a w x := by + change f.flatClass a (representative J f.Letters (point J f.Letters w)) + ((a.iso (coordinate J f.Letters w)).toFun x) = _ + rw [← f.flatClass_coordinate, coordinate_spec] + +theorem flatIncidence_stem (w : External J f.Letters) (r : R) : + (f.diagram a).Equation (f.flatIncidenceValue a) (.inl (w, r), true) := by + intro x + change f.flatIncidenceValue a (.inl (point J f.Letters w)) x.val = + f.flatTileValue a w r ((f.tile r).root.toFun ((a.chart w).inverse x.val)) + have vertex := f.flatTileValue_vertex a w r none ((a.chart w).inverse x.val) + change f.flatTileValue a w r ((f.tile r).root.toFun ((a.chart w).inverse x.val)) = + f.flatClass a w ((a.chart w).inverse x.val) at vertex + rw [vertex] + have eq := f.flatIncidenceValue_copy a w ((a.chart w).inverse x.val) + erw [(a.chart w).right_inverse] at eq + exact eq + +theorem flatIncidence_branch (w : External J f.Letters) (r : R) (j : f.Child r) : + (f.diagram a).Equation (f.flatIncidenceValue a) (.inr (w, ⟨r, j⟩), true) := by + intro x + let i := f.vertexIdealIso ((f.tile r).child j) + obtain ⟨y, rfl⟩ : ∃ y, i.toFun y = x := ⟨i.inverse x, i.right_inverse x⟩ + change f.flatTileValue a w r (((f.tile r).child j).toFun y) = + f.flatIncidenceValue a (.inl (point J f.Letters (w * generator J f.Letters ⟨r, j⟩))) + ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val + have formula : ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val = + (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun y := f.branch_formula a w r j y + rw [formula, f.flatIncidenceValue_copy] + exact f.flatTileValue_vertex a w r (some j) y + +theorem flatIncidence_edges (d : TileStars.Dart J f.Letters R) : + (f.diagram a).Equation (f.flatIncidenceValue a) d := by + rcases d with ⟨e, b⟩ + have forward : (f.diagram a).Equation (f.flatIncidenceValue a) (e, true) := by + cases e with + | inl c => exact f.flatIncidence_stem a c.1 c.2 + | inr c => exact f.flatIncidence_branch a c.1 c.2.1 c.2.2 + cases b + · exact (f.diagram a).equation_of_reverse (f.flatIncidenceValue a) (e, false) forward + · exact forward + +noncomputable def toFlatQuotient (z : f.Node a) : f.FlatQuotient a := + (f.diagram a).descend (f.flatIncidenceValue a) (f.flatIncidence_edges a) z + +theorem toFlatQuotient_copy (w : External J f.Letters) (x : A) : + f.toFlatQuotient a ((f.copy a w).toFun x) = f.flatClass a w x := by + change (f.diagram a).descend (f.flatIncidenceValue a) (f.flatIncidence_edges a) + (((f.diagram a).vertex (.inl (point J f.Letters w))).toFun ((a.chart w).toFun x)) = _ + erw [(f.diagram a).descend_vertex, f.flatIncidenceValue_copy] + +theorem flatPath_iff_copy_eq (x y : f.FlatLabel (J := J)) : + f.FlatPath a x y ↔ (f.copy a x.1).toFun x.2 = (f.copy a y.1).toFun y.2 := by + constructor + · exact FlatPath.copy_eq f a + · intro equal + have classes := congrArg (f.toFlatQuotient a) equal + rw [f.toFlatQuotient_copy, f.toFlatQuotient_copy] at classes + exact Quotient.exact classes + +end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalHeights.lean index cafd1117570ecba2548ac3f57f32327d33482cce..5c41167455f3f977ef1940e4a36bb5d7983225b6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalHeights.lean @@ -1,148 +1,148 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FixedTop - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open RationalHeights -universe u v - -namespace LinearHeightOrder -variable {Column : Type u} {Coord : Type v} - -theorem first_weak (C : LinearHeightOrder Column) (D : LinearHeightOrder Coord) - {x y : Column × Coord} (lower : (C.lex D).Weak x y) : C.Weak x.1 y.1 := by - rcases lower with eq | lower | ⟨eq, _⟩ - · exact Or.inl (congrArg Prod.fst eq) - · exact Or.inr lower - · exact Or.inl eq - -end LinearHeightOrder - -structure ColumnRoom {Column : Type v} (C : LinearHeightOrder Column) (old : Column) where - column : Nat → Column - increasing : ∀ n, C.lt (column n) (column (n + 1)) - starts_above : C.lt old (column 0) - cap : Column - below_cap : ∀ n, C.lt (column n) cap - -namespace FixedTop -variable {A : Type u} {H : Type v} {P : MeetOrder A} {R : HeightOrder H} - (height : StrictHeight P R) (topValue : H) - (above : ∀ x, R.lt (height.value x) topValue) - -def heightValue : Option A → H - | none => topValue - | some x => height.value x - -def extendHeight : StrictHeight (order P) R where - value := heightValue height topValue - strict x y lower different := by - cases x with - | none => - cases y with - | none => exact False.elim (different rfl) - | some y => exact False.elim lower - | some x => - cases y with - | none => exact above x - | some y => exact height.strict x y lower (fun eq => different (congrArg some eq)) - -theorem extendHeight_countable (countable : CountableRange height.value) : - CountableRange (extendHeight height topValue above).value := by - rcases countable with ⟨oldCode, equal⟩ - let code : Option A → Nat - | none => 0 - | some x => oldCode x + 1 - refine ⟨code, ?_⟩ - intro x y eq - cases x with - | none => - cases y with - | none => rfl - | some y => change 0 = oldCode y + 1 at eq; omega - | some x => - cases y with - | none => change oldCode x + 1 = 0 at eq; omega - | some y => exact equal x y (by change oldCode x + 1 = oldCode y + 1 at eq; omega) - -end FixedTop - -namespace TileRequests.Family - -open CosetGeometry -variable {A J R : Type u} [Group J] {P : MeetOrder A} - {Column : Type v} (f : Family P R) (a : OrderAction J P) - (C : LinearHeightOrder Column) (seed : StrictHeight P (lexOrder C).toHeightOrder) - (countable : CountableRange seed.value) - (room : ColumnRoom C (seed.value f.top).1) - -noncomputable def localHeight : (v : TileStars.Vertex J f.Letters R) → - StrictHeight (f.localOrder v) Rational.order.toHeightOrder - | .inl _ => Classical.choose (rational_assignment (lexOrder C) seed f.top countable) - | .inr c => (f.request c.2).rationalHeight f.top f.greatest (lexOrder C) seed countable - -theorem seed_column_bound (x : A) : C.lt (seed.value x).1 (room.column 0) := - C.weak_lt (C.first_weak Rational.order.toLinearHeightOrder (seed.mono (f.greatest x))) - room.starts_above - -noncomputable def gluedHeight : StrictHeight (f.gluedOrder a) (lexOrder C).toHeightOrder := - (f.diagram a).scheme.externalHeight C room.column room.increasing seed - (f.seed_column_bound C seed room) (f.localHeight C seed countable) - -theorem gluedHeight_original (x : A) : - (f.gluedHeight a C seed countable room).value ((f.copy a 1).toFun x) = seed.value x := by - rw [f.copy_one] - exact (f.diagram a).scheme.externalHeight_original C room.column room.increasing seed - (f.seed_column_bound C seed room) (f.localHeight C seed countable) x - -theorem gluedHeight_countable : CountableRange (f.gluedHeight a C seed countable room).value := - (f.diagram a).scheme.externalHeight_countable C room.column room.increasing seed - (f.seed_column_bound C seed room) (f.localHeight C seed countable) countable - -theorem gluedHeight_column_bound (x : f.Node a) : - C.lt ((f.gluedHeight a C seed countable room).value x).1 room.cap := - (f.diagram a).scheme.externalHeight_column_bound C room.column room.increasing seed - (f.seed_column_bound C seed room) (f.localHeight C seed countable) room.cap room.below_cap x - -noncomputable def extensionHeight : StrictHeight (f.extensionOrder a) (lexOrder C).toHeightOrder := - FixedTop.extendHeight (f.gluedHeight a C seed countable room) (room.cap, zero) - (fun x => Or.inl (f.gluedHeight_column_bound a C seed countable room x)) - -theorem extensionHeight_original (x : A) : - (f.extensionHeight a C seed countable room).value ((f.extensionCopy a 1).toFun x) = - seed.value x := f.gluedHeight_original a C seed countable room x - -theorem extensionHeight_countable : - CountableRange (f.extensionHeight a C seed countable room).value := - FixedTop.extendHeight_countable _ _ _ (f.gluedHeight_countable a C seed countable room) - -theorem extensionHeight_top : - (f.extensionHeight a C seed countable room).value none = (room.cap, zero) := rfl - -theorem extensionHeight_bounded (x : f.Extension a) : - (lexOrder C).Weak ((f.extensionHeight a C seed countable room).value x) (room.cap, zero) := - (f.extensionHeight a C seed countable room).mono (f.extension_greatest a x) - -include countable in - -theorem external_height_extension : - ∃ height : StrictHeight (f.extensionOrder a) (lexOrder C).toHeightOrder, - (∀ x, height.value ((f.extensionCopy a 1).toFun x) = seed.value x) ∧ - CountableRange height.value ∧ height.value none = (room.cap, zero) ∧ - (∀ x, (lexOrder C).Weak (height.value x) (room.cap, zero)) := - ⟨f.extensionHeight a C seed countable room, - f.extensionHeight_original a C seed countable room, - f.extensionHeight_countable a C seed countable room, - f.extensionHeight_top a C seed countable room, - f.extensionHeight_bounded a C seed countable room⟩ - -end TileRequests.Family - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FixedTop + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open RationalHeights +universe u v + +namespace LinearHeightOrder +variable {Column : Type u} {Coord : Type v} + +theorem first_weak (C : LinearHeightOrder Column) (D : LinearHeightOrder Coord) + {x y : Column × Coord} (lower : (C.lex D).Weak x y) : C.Weak x.1 y.1 := by + rcases lower with eq | lower | ⟨eq, _⟩ + · exact Or.inl (congrArg Prod.fst eq) + · exact Or.inr lower + · exact Or.inl eq + +end LinearHeightOrder + +structure ColumnRoom {Column : Type v} (C : LinearHeightOrder Column) (old : Column) where + column : Nat → Column + increasing : ∀ n, C.lt (column n) (column (n + 1)) + starts_above : C.lt old (column 0) + cap : Column + below_cap : ∀ n, C.lt (column n) cap + +namespace FixedTop +variable {A : Type u} {H : Type v} {P : MeetOrder A} {R : HeightOrder H} + (height : StrictHeight P R) (topValue : H) + (above : ∀ x, R.lt (height.value x) topValue) + +def heightValue : Option A → H + | none => topValue + | some x => height.value x + +def extendHeight : StrictHeight (order P) R where + value := heightValue height topValue + strict x y lower different := by + cases x with + | none => + cases y with + | none => exact False.elim (different rfl) + | some y => exact False.elim lower + | some x => + cases y with + | none => exact above x + | some y => exact height.strict x y lower (fun eq => different (congrArg some eq)) + +theorem extendHeight_countable (countable : CountableRange height.value) : + CountableRange (extendHeight height topValue above).value := by + rcases countable with ⟨oldCode, equal⟩ + let code : Option A → Nat + | none => 0 + | some x => oldCode x + 1 + refine ⟨code, ?_⟩ + intro x y eq + cases x with + | none => + cases y with + | none => rfl + | some y => change 0 = oldCode y + 1 at eq; omega + | some x => + cases y with + | none => change oldCode x + 1 = 0 at eq; omega + | some y => exact equal x y (by change oldCode x + 1 = oldCode y + 1 at eq; omega) + +end FixedTop + +namespace TileRequests.Family + +open CosetGeometry +variable {A J R : Type u} [Group J] {P : MeetOrder A} + {Column : Type v} (f : Family P R) (a : OrderAction J P) + (C : LinearHeightOrder Column) (seed : StrictHeight P (lexOrder C).toHeightOrder) + (countable : CountableRange seed.value) + (room : ColumnRoom C (seed.value f.top).1) + +noncomputable def localHeight : (v : TileStars.Vertex J f.Letters R) → + StrictHeight (f.localOrder v) Rational.order.toHeightOrder + | .inl _ => Classical.choose (rational_assignment (lexOrder C) seed f.top countable) + | .inr c => (f.request c.2).rationalHeight f.top f.greatest (lexOrder C) seed countable + +theorem seed_column_bound (x : A) : C.lt (seed.value x).1 (room.column 0) := + C.weak_lt (C.first_weak Rational.order.toLinearHeightOrder (seed.mono (f.greatest x))) + room.starts_above + +noncomputable def gluedHeight : StrictHeight (f.gluedOrder a) (lexOrder C).toHeightOrder := + (f.diagram a).scheme.externalHeight C room.column room.increasing seed + (f.seed_column_bound C seed room) (f.localHeight C seed countable) + +theorem gluedHeight_original (x : A) : + (f.gluedHeight a C seed countable room).value ((f.copy a 1).toFun x) = seed.value x := by + rw [f.copy_one] + exact (f.diagram a).scheme.externalHeight_original C room.column room.increasing seed + (f.seed_column_bound C seed room) (f.localHeight C seed countable) x + +theorem gluedHeight_countable : CountableRange (f.gluedHeight a C seed countable room).value := + (f.diagram a).scheme.externalHeight_countable C room.column room.increasing seed + (f.seed_column_bound C seed room) (f.localHeight C seed countable) countable + +theorem gluedHeight_column_bound (x : f.Node a) : + C.lt ((f.gluedHeight a C seed countable room).value x).1 room.cap := + (f.diagram a).scheme.externalHeight_column_bound C room.column room.increasing seed + (f.seed_column_bound C seed room) (f.localHeight C seed countable) room.cap room.below_cap x + +noncomputable def extensionHeight : StrictHeight (f.extensionOrder a) (lexOrder C).toHeightOrder := + FixedTop.extendHeight (f.gluedHeight a C seed countable room) (room.cap, zero) + (fun x => Or.inl (f.gluedHeight_column_bound a C seed countable room x)) + +theorem extensionHeight_original (x : A) : + (f.extensionHeight a C seed countable room).value ((f.extensionCopy a 1).toFun x) = + seed.value x := f.gluedHeight_original a C seed countable room x + +theorem extensionHeight_countable : + CountableRange (f.extensionHeight a C seed countable room).value := + FixedTop.extendHeight_countable _ _ _ (f.gluedHeight_countable a C seed countable room) + +theorem extensionHeight_top : + (f.extensionHeight a C seed countable room).value none = (room.cap, zero) := rfl + +theorem extensionHeight_bounded (x : f.Extension a) : + (lexOrder C).Weak ((f.extensionHeight a C seed countable room).value x) (room.cap, zero) := + (f.extensionHeight a C seed countable room).mono (f.extension_greatest a x) + +include countable in + +theorem external_height_extension : + ∃ height : StrictHeight (f.extensionOrder a) (lexOrder C).toHeightOrder, + (∀ x, height.value ((f.extensionCopy a 1).toFun x) = seed.value x) ∧ + CountableRange height.value ∧ height.value none = (room.cap, zero) ∧ + (∀ x, (lexOrder C).Weak (height.value x) (room.cap, zero)) := + ⟨f.extensionHeight a C seed countable room, + f.extensionHeight_original a C seed countable room, + f.extensionHeight_countable a C seed countable room, + f.extensionHeight_top a C seed countable room, + f.extensionHeight_bounded a C seed countable room⟩ + +end TileRequests.Family + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalOwnerCoordinateLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalOwnerCoordinateLaws.lean index 9c5977d409e8f6ca84fdcccf168a436686a48191..5a9ae1aa5703c6083db6d26d518a925568113035 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalOwnerCoordinateLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalOwnerCoordinateLaws.lean @@ -1,543 +1,543 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalStarOverlapRealization -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalTileCoordinateRealization -import OAI.SetTheory.PartitionPrinciple.Definability.LeastSlotOwnerCodes -import OAI.SetTheory.PartitionPrinciple.Definability.RootedSupportOwnerFunction -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalOldAction -import OAI.SetTheory.PartitionPrinciple.Forcing.RequestedSupportOwners - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (P r μ A : ZFSet.{u}) -noncomputable def externalIdentityCopyGraph : ZFSet.{u} := - completion.externalCopyGraph P r μ A - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) -noncomputable def externalSeedCarrier : ZFSet.{u} := - relationImage (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) - (completion.externalIdentityCopyGraph P r μ A) -noncomputable def externalSeedHeight (C D seed : ZFSet.{u}) : ZFSet.{u} := - pushedHeightGraph (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) - (ZFSet.prod C D) (completion.externalIdentityCopyGraph P r μ A) seed - -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG - -theorem externalIdentityCopyGraph_eq_graph : - letI := group.toGroup - E = (SetMembers.presentation U).graph (q) ((family).copy (action) 1).toFun := by - let := group.toGroup - have equal := data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG 1 - rw [← completion.externalFamilyGroupPresentation_identity group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground] at equal - exact equal - -theorem externalSeedCarrier_iff : - letI := group.toGroup - ∀ y, (q).encode y ∈ P ↔ ∃ x : SetMembers U, ((family).copy (action) 1).toFun x = y := by - let := group.toGroup - intro y - rw [GroundCompressionCompletion.externalSeedCarrier, mem_relationImage, - data.externalIdentityCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] - constructor - · rintro ⟨_, x, hx, entry⟩ - let a := SetMembers.ofMem x hx - refine ⟨a, ((SetMembers.presentation U).pair_mem_graph (q) _ a y).1 ?_⟩ - change ZFSet.pair (SetMembers.raw a) ((q).encode y) ∈ _ - simpa only [a, SetMembers.raw_ofMem] using entry - · rintro ⟨x, equal⟩ - exact ⟨data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG ▸ (q).encode_mem y, - SetMembers.raw x, SetMembers.raw_mem x, ((SetMembers.presentation U).pair_mem_graph (q) _ x y).2 equal⟩ - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalSeedHeights_spec (hP0 : P0 ∈ M.sets) {C D rD original : ZFSet.{u}} - (heights : GroundCompressionHeightData M initial I Sources Reps G m one T completion.algebra.union P0 C D rD original) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) : - P ∈ M.sets ∧ completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height ∈ M.sets ∧ - StrictLexHeightCode P C D (completion.externalPointOrder P0 r0 μ0 A0) - (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height) rD ∧ - relationImage P (ZFSet.prod C D) (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height) = - relationImage U (ZFSet.prod C D) heights.height ∧ - M.groundEmbeddable (relationImage P (ZFSet.prod C D) - (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height)) ZFSet.omega := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have copyGround := geometry.copies_ground _ data.group.group_code.identity_mem - have copy := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have range := pushedHeightGraph_range copy.injection heights.code.function - refine ⟨M.relationImage_mem separation (completion.algebra.union.ground 0) geometry.carrier_ground copyGround, - M.pushedHeightGraph_mem pairing unions powers separation (completion.algebra.union.ground 0) - geometry.carrier_ground (M.prod_mem pairing unions powers separation hC hD) copyGround heights.height_ground, - pushedHeightGraph_strictLex copy heights.code, range, ?_⟩ - exact range.symm ▸ heights.range_countable - -theorem externalSeedHeight_entry {C D rD original : ZFSet.{u}} - (heights : GroundCompressionHeightData M initial I Sources Reps G m one T completion.algebra.union P0 C D rD original) : - letI := group.toGroup - ∀ x y, ZFSet.pair ((q).encode (((family).copy (action) 1).toFun x)) y ∈ - completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height ↔ - ZFSet.pair (SetMembers.raw x) y ∈ heights.height := by - let := group.toGroup - intro x y - have copy := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - apply pushedHeightGraph_entry copy.injection heights.code.function - change ZFSet.pair (SetMembers.raw x) ((q).encode (((family).copy (action) 1).toFun x)) ∈ E - rw [data.externalIdentityCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] - exact ((SetMembers.presentation U).pair_mem_graph (q) _ x _).2 rfl - -end GroundExternalGeometryInputs - - - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -noncomputable def externalStarOwner (P r μ A : ZFSet.{u}) : ZFSet.{u} := - leastSupportGraph - (M.externalStarVertices G (externalChildLetters I P (externalRectangles P G r μ A)) - (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) - (completion.externalPointCarrier P r μ A) - (M.externalStarDepth G (externalChildLetters I P (externalRectangles P G r μ A)) - (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) - (completion.externalStarSupports P r μ A) - -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "scheme" => TileStars.Spaces.scheme - (Compression.RecursiveMaps.TileRequests.Family.diagram (family) (action)) -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG - -theorem externalStarOwner_iff : - letI := group.toGroup - ∀ x v, ZFSet.pair ((q).encode x) ((sVertex).encode v) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ - (scheme).LeastSupport v x := by - let := group.toGroup - intro x v - have entry := leastSupportGraph_entry (sVertex) (q) (scheme).depth (scheme).Supports - (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStarSupports_iff group oldAction pairing unions powers separation infinite hG) x v - rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1, - data.externalPointPresentation_carrier] at entry - exact entry - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarOwner_ground_function (hP0 : P0 ∈ M.sets) : - completion.externalStarOwner P0 r0 μ0 A0 ∈ M.sets ∧ - ZFSet.IsFunc (completion.externalPointCarrier P0 r0 μ0 A0) - (M.externalStarVertices G letters requests m one) (completion.externalStarOwner P0 r0 μ0 A0) := by - let := group.toGroup - have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have points := (data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0).carrier_ground - have depths := (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).1 - have supports := data.externalStarSupports_ground group oldAction pairing unions powers separation infinite hG hP0 - refine ⟨M.leastSupportGraph_mem pairing unions powers separation infinite vertices points depths supports, ?_⟩ - have function := leastSupportGraph_function (sVertex) (q) (scheme).depth (scheme).Supports - (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStarSupports_iff group oldAction pairing unions powers separation infinite hG) - (scheme).existsUnique_leastSupport - rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1, - data.externalPointPresentation_carrier] at function - exact function - -end GroundExternalGeometryInputs -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "scheme" => TileStars.Spaces.scheme - (Compression.RecursiveMaps.TileRequests.Family.diagram (family) (action)) -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "oldCopy" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) -local notation "oldImage" => relationImage U Q oldCopy - -theorem externalStarOwner_subset : completion.externalStarOwner P0 r0 μ0 A0 ⊆ - ZFSet.prod Q (M.externalStarVertices G letters requests m one) := by - intro z hz - unfold GroundCompressionCompletion.externalStarOwner leastSupportGraph at hz - exact (ZFSet.mem_sep.1 hz).1 - -theorem externalStarOwner_value_iff : - letI := group.toGroup - ∀ x v, ZFSet.pair ((q).encode x) ((sVertex).encode v) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ - (scheme).owner x = v := by - let := group.toGroup - intro x v - exact (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG x v).trans - ((scheme).owner_eq_iff x v).symm - -theorem externalStarOwner_eq_graph : - letI := group.toGroup - completion.externalStarOwner P0 r0 μ0 A0 = (q).graph (sVertex) (scheme).owner := by - let := group.toGroup - apply presentedGraph_eq (q) (sVertex) (scheme).owner - · rw [data.externalPointPresentation_carrier, - (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1] - exact externalStarOwner_subset - · exact data.externalStarOwner_value_iff group oldAction pairing unions powers separation infinite hG - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarOwner_order_depth {x y v w : ZFSet.{u}} {n k : Nat} - (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) - (first : ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0) - (second : ZFSet.pair y w ∈ completion.externalStarOwner P0 r0 μ0 A0) - (firstDepth : ZFSet.pair v (natSetCode n) ∈ M.externalStarDepth G letters requests m one) - (secondDepth : ZFSet.pair w (natSetCode k) ∈ M.externalStarDepth G letters requests m one) : - n ≤ k ∧ (n = k → v = w) := by - let := group.toGroup - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have vc := (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 - have firstShape := ZFSet.pair_mem_prod.1 (externalStarOwner_subset first) - have secondShape := ZFSet.pair_mem_prod.1 (externalStarOwner_subset second) - obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ firstShape.1) - obtain ⟨y, rfl⟩ := ((q).mem_carrier y).1 (qc.symm ▸ secondShape.1) - obtain ⟨v, rfl⟩ := ((sVertex).mem_carrier v).1 (vc.symm ▸ firstShape.2) - obtain ⟨w, rfl⟩ := ((sVertex).mem_carrier w).1 (vc.symm ▸ secondShape.2) - have firstOwner := (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG x v).1 first - have secondOwner := (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG y w).1 second - have order := ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 x y).1 lower - have hn := (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG v n).1 firstDepth - have hk := (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG w k).1 secondDepth - refine ⟨?_, ?_⟩ - · rw [hn, hk] - exact (scheme).leastSupport_depth_mono firstOwner secondOwner order - · intro same - exact congrArg (sVertex).encode ((scheme).leastSupport_eq_of_depth_eq firstOwner secondOwner order - (hn.symm.trans (same.trans hk))) - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarOwner_root_iff : - ∀ x, ZFSet.pair x (M.externalStarRoot G letters m one) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ - x ∈ oldImage := by - let := group.toGroup - intro x - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have rootEq := data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG - have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have copies := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.2.2 - constructor - · intro entry - have hx := (ZFSet.pair_mem_prod.1 (externalStarOwner_subset entry)).1 - obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ hx) - rw [rootEq, data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG] at entry - obtain ⟨a, image⟩ := ((family).leastSupport_root_copy_iff (action) x).1 entry - refine (mem_relationImage _ _ _ _).2 ⟨hx, SetMembers.raw a, SetMembers.raw_mem a, ?_⟩ - have copyEntry := (copies 1 a x).2 image - rw [← identity] at copyEntry - exact copyEntry - · intro hx - obtain ⟨member, a, ha, entry⟩ := (mem_relationImage _ _ _ _).1 hx - obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ member) - let a' := SetMembers.ofMem a ha - have copyEntry : ZFSet.pair (SetMembers.raw a') ((q).encode x) ∈ - completion.externalCopyGraph P0 r0 μ0 A0 ((sGroup).encode 1) := by - simpa only [identity, a', SetMembers.raw_ofMem] using entry - have image := (copies 1 a' x).1 copyEntry - rw [rootEq, data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG] - exact ((family).leastSupport_root_copy_iff (action) x).2 ⟨a', image⟩ - -theorem externalStarOwner_fresh_tile : - letI := group.toGroup - ∀ x v, ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0 → x ∉ oldImage → - ∃ w r, ∃ y : ((family).tile r).Space, - v = (sVertex).encode (.inr (w, r)) ∧ x = (q).encode (((family).placedTile (action) w r).toFun y) ∧ - ¬ ((family).tile r).order.le y - (((family).diagram (action)).localGlue (.inr (w, r)) ((family).tile_depth_ne_zero (action) w r)).rightAnchor := by - let := group.toGroup - intro x v entry fresh - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have vc := (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 - have shape := ZFSet.pair_mem_prod.1 (externalStarOwner_subset entry) - obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ shape.1) - obtain ⟨v, rfl⟩ := ((sVertex).mem_carrier v).1 (vc.symm ▸ shape.2) - have least := (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG x v).1 entry - rcases (family).leastSupport_cases (action) v x least with ⟨rfl, _⟩ | ⟨w, r, y, rfl, eq, outside⟩ - · apply False.elim - apply fresh - apply (data.externalStarOwner_root_iff group oldAction pairing unions powers separation infinite hG _).1 - rw [data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] - exact entry - · exact ⟨w, r, y, rfl, congrArg (q).encode eq.symm, outside⟩ - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "scheme" => TileStars.Spaces.scheme - (Compression.RecursiveMaps.TileRequests.Family.diagram (family) (action)) -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "oldCopy" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) -local notation "oldImage" => relationImage U Q oldCopy -local notation "seedCarrier" => completion.externalSeedCarrier P0 r0 μ0 A0 - -include data group oldAction pairing unions powers separation infinite hG - -theorem externalStarOwner_seed_iff (x : ZFSet.{u}) : - ZFSet.pair x (M.externalStarRoot G letters m one) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ - x ∈ seedCarrier := - data.externalStarOwner_root_iff group oldAction pairing unions powers separation infinite hG x - -theorem externalSeedCarrier_lower {x y : ZFSet.{u}} (hx : x ∈ Q) (hy : y ∈ seedCarrier) - (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) : x ∈ seedCarrier := by - have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - obtain ⟨_, a, _, entry⟩ := (mem_relationImage _ _ _ _).1 hy - obtain ⟨b, hb, _, image⟩ := ideal.ideal a y x entry hx lower - exact (mem_relationImage _ _ _ _).2 ⟨hx, b, hb, image⟩ - -theorem externalSeedCarrier_no_new_below {x y : ZFSet.{u}} (hx : x ∈ Q) - (fresh : x ∉ seedCarrier) (old : y ∈ seedCarrier) : - ZFSet.pair x y ∉ completion.externalPointOrder P0 r0 μ0 A0 := - fun lower => fresh (data.externalSeedCarrier_lower group oldAction pairing unions powers separation infinite hG hx old lower) - -theorem externalStarOwner_order {x y v w n k : ZFSet.{u}} - (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) - (first : ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0) - (second : ZFSet.pair y w ∈ completion.externalStarOwner P0 r0 μ0 A0) - (firstDepth : ZFSet.pair v n ∈ M.externalStarDepth G letters requests m one) - (secondDepth : ZFSet.pair w k ∈ M.externalStarDepth G letters requests m one) : - (n = k ∨ n ∈ k) ∧ (n = k → v = w) := by - have depthFunction := (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).2 - have hn := (ZFSet.pair_mem_prod.1 (depthFunction.1 firstDepth)).2 - have hk := (ZFSet.pair_mem_prod.1 (depthFunction.1 secondDepth)).2 - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - have laws := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG - lower first second firstDepth secondDepth - refine ⟨?_, fun same => laws.2 (natSetCode_injective same)⟩ - rcases Nat.lt_or_eq_of_le laws.1 with less | same - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "c" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "E" => M.externalGroupCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one -local notation "C" => M.externalCosetCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one -variable {D rD lo hi : ZFSet.{u}} -variable (heights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi completion) -local notation "coordinates" => heights.coordinates -local notation "localp" => data.localTilePresentation group oldAction pairing unions powers separation infinite hG -include data group oldAction pairing unions powers separation infinite hG - -theorem externalTileCoordinates_support : - letI := group.toGroup - ∀ v x d, ZFSet.pair (ZFSet.pair v x) d ∈ coordinates → - ∃ (w : External (SetMembers G) (family).Letters) (r : Index) (a : ((family).tile r).Space), - v = (vpres).encode (.inr (w, r)) ∧ x = (q).encode (((family).placedTile (action) w r).toFun a) := by - let := group.toGroup - intro v x d entry - have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have acted := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.2.1 - obtain ⟨_, hx, _, w, hw, r, hr, y, _, h, _, equal, selected, acting, value⟩ := - (pair_mem_transportedTileCoordinates _ _ _ _ _ _ _ _ _ _).1 entry - obtain ⟨w, rfl⟩ := ((s).mem_carrier w).1 (sc.symm ▸ hw) - obtain ⟨r, rfl⟩ := ((externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).mem_carrier r).1 hr - have code := (heights.values _ _ selected).2.1 - have localMember := (ZFSet.pair_mem_prod.1 (code.function.1 value)).1 - obtain ⟨a, rfl⟩ := (data.localTileCarrier_image group oldAction pairing unions powers separation infinite hG r y).1 localMember - obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ hx) - have translated := (acted w (((family).placedTile (action) 1 r).toFun a) x).1 acting - rw [(family).translate_tile, mul_one] at translated - exact ⟨w, r, a, equal, congrArg (q).encode translated.symm⟩ - -include heights in -theorem externalTileCoordinates_owner_total : - ∀ x ∈ Q, x ∉ completion.externalSeedCarrier P0 r0 μ0 A0 → ∀ v, - ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0 → - ∃ d ∈ D, ZFSet.pair (ZFSet.pair v x) d ∈ coordinates := by - let := group.toGroup - intro x _ fresh v owner - obtain ⟨w, r, a, rfl, rfl, _⟩ := - data.externalStarOwner_fresh_tile group oldAction pairing unions powers separation infinite hG x v owner fresh - exact data.externalTileCoordinates_total group oldAction pairing unions powers separation infinite hG heights w r a - -include heights in -theorem externalTileCoordinates_raw_strict : - ∀ v x y a b, ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0 → x ≠ y → - ZFSet.pair (ZFSet.pair v x) a ∈ coordinates → - ZFSet.pair (ZFSet.pair v y) b ∈ coordinates → ZFSet.pair a b ∈ rD := by - let := group.toGroup - intro v x y a b lower distinct first second - obtain ⟨w, r, x', rfl, rfl⟩ := - data.externalTileCoordinates_support group oldAction pairing unions powers separation infinite hG heights v x a first - obtain ⟨w', r', y', sameVertex, samePoint⟩ := - data.externalTileCoordinates_support group oldAction pairing unions powers separation infinite hG heights _ y b second - have same := Sum.inr.inj ((vpres).injective sameVertex) - obtain ⟨rfl, rfl⟩ := Prod.mk.inj same - subst y - have localLower := (((family).placedTile (action) w r).le_iff x' y').1 - (((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 _ _).1 lower) - have localDistinct : x' ≠ y' := fun equal => distinct (congrArg - (fun z => (q).encode (((family).placedTile (action) w r).toFun z)) equal) - exact data.externalTileCoordinates_strict group oldAction pairing unions powers separation infinite hG - heights w r x' y' localDistinct localLower a b first second - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - -namespace PartitionPilot.Forcing -universe u -namespace GroundExternalLocalHeightData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (localHeights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 D rD lo hi completion) - -noncomputable def externalHeightGraph (C seed columns : ZFSet.{u}) : ZFSet.{u} := - externalOwnerHeightGraph (completion.externalSeedCarrier P0 r0 μ0 A0) - (completion.externalPointCarrier P0 r0 μ0 A0) - (M.externalStarVertices G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) - (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one) C D - (completion.externalSeedHeight P0 r0 μ0 A0 C D seed) - (completion.externalStarOwner P0 r0 μ0 A0) - (M.externalStarDepth G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) - (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one) - columns localHeights.coordinates - -end GroundExternalLocalHeightData - -structure GroundExternalHeightData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi seed : ZFSet.{u}) - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) where - localHeights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi completion - columns : GroundExternalColumnData M C (heightColumns (completion.externalSeedCarrier P0 r0 μ0 A0) C D - (completion.externalSeedHeight P0 r0 μ0 A0 C D seed)) - height_ground : localHeights.externalHeightGraph C seed columns.sequence ∈ M.sets - code : StrictLexHeightCode (completion.externalPointCarrier P0 r0 μ0 A0) C D - (completion.externalPointOrder P0 r0 μ0 A0) (localHeights.externalHeightGraph C seed columns.sequence) rD - range_ground : relationImage (completion.externalPointCarrier P0 r0 μ0 A0) (ZFSet.prod C D) - (localHeights.externalHeightGraph C seed columns.sequence) ∈ M.sets - range_countable : M.groundEmbeddable (relationImage (completion.externalPointCarrier P0 r0 μ0 A0) (ZFSet.prod C D) - (localHeights.externalHeightGraph C seed columns.sequence)) ZFSet.omega - preserves_seed : ∀ x y z, ZFSet.pair x y ∈ completion.externalIdentityCopyGraph P0 r0 μ0 A0 → - (ZFSet.pair y z ∈ localHeights.externalHeightGraph C seed columns.sequence ↔ ZFSet.pair x z ∈ seed) - below_cap : ∀ x a d, ZFSet.pair x (ZFSet.pair a d) ∈ localHeights.externalHeightGraph C seed columns.sequence → - a ∈ columns.cap - -namespace GroundExternalHeightData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi seed : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -noncomputable def height (data : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) : ZFSet.{u} := - data.localHeights.externalHeightGraph C seed data.columns.sequence - -end GroundExternalHeightData - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalStarOverlapRealization +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalTileCoordinateRealization +import OAI.SetTheory.PartitionPrinciple.Definability.LeastSlotOwnerCodes +import OAI.SetTheory.PartitionPrinciple.Definability.RootedSupportOwnerFunction +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalOldAction +import OAI.SetTheory.PartitionPrinciple.Forcing.RequestedSupportOwners + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (P r μ A : ZFSet.{u}) +noncomputable def externalIdentityCopyGraph : ZFSet.{u} := + completion.externalCopyGraph P r μ A + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) +noncomputable def externalSeedCarrier : ZFSet.{u} := + relationImage (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) + (completion.externalIdentityCopyGraph P r μ A) +noncomputable def externalSeedHeight (C D seed : ZFSet.{u}) : ZFSet.{u} := + pushedHeightGraph (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) + (ZFSet.prod C D) (completion.externalIdentityCopyGraph P r μ A) seed + +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG + +theorem externalIdentityCopyGraph_eq_graph : + letI := group.toGroup + E = (SetMembers.presentation U).graph (q) ((family).copy (action) 1).toFun := by + let := group.toGroup + have equal := data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG 1 + rw [← completion.externalFamilyGroupPresentation_identity group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground] at equal + exact equal + +theorem externalSeedCarrier_iff : + letI := group.toGroup + ∀ y, (q).encode y ∈ P ↔ ∃ x : SetMembers U, ((family).copy (action) 1).toFun x = y := by + let := group.toGroup + intro y + rw [GroundCompressionCompletion.externalSeedCarrier, mem_relationImage, + data.externalIdentityCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] + constructor + · rintro ⟨_, x, hx, entry⟩ + let a := SetMembers.ofMem x hx + refine ⟨a, ((SetMembers.presentation U).pair_mem_graph (q) _ a y).1 ?_⟩ + change ZFSet.pair (SetMembers.raw a) ((q).encode y) ∈ _ + simpa only [a, SetMembers.raw_ofMem] using entry + · rintro ⟨x, equal⟩ + exact ⟨data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG ▸ (q).encode_mem y, + SetMembers.raw x, SetMembers.raw_mem x, ((SetMembers.presentation U).pair_mem_graph (q) _ x y).2 equal⟩ + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalSeedHeights_spec (hP0 : P0 ∈ M.sets) {C D rD original : ZFSet.{u}} + (heights : GroundCompressionHeightData M initial I Sources Reps G m one T completion.algebra.union P0 C D rD original) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) : + P ∈ M.sets ∧ completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height ∈ M.sets ∧ + StrictLexHeightCode P C D (completion.externalPointOrder P0 r0 μ0 A0) + (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height) rD ∧ + relationImage P (ZFSet.prod C D) (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height) = + relationImage U (ZFSet.prod C D) heights.height ∧ + M.groundEmbeddable (relationImage P (ZFSet.prod C D) + (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height)) ZFSet.omega := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have copyGround := geometry.copies_ground _ data.group.group_code.identity_mem + have copy := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have range := pushedHeightGraph_range copy.injection heights.code.function + refine ⟨M.relationImage_mem separation (completion.algebra.union.ground 0) geometry.carrier_ground copyGround, + M.pushedHeightGraph_mem pairing unions powers separation (completion.algebra.union.ground 0) + geometry.carrier_ground (M.prod_mem pairing unions powers separation hC hD) copyGround heights.height_ground, + pushedHeightGraph_strictLex copy heights.code, range, ?_⟩ + exact range.symm ▸ heights.range_countable + +theorem externalSeedHeight_entry {C D rD original : ZFSet.{u}} + (heights : GroundCompressionHeightData M initial I Sources Reps G m one T completion.algebra.union P0 C D rD original) : + letI := group.toGroup + ∀ x y, ZFSet.pair ((q).encode (((family).copy (action) 1).toFun x)) y ∈ + completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height ↔ + ZFSet.pair (SetMembers.raw x) y ∈ heights.height := by + let := group.toGroup + intro x y + have copy := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + apply pushedHeightGraph_entry copy.injection heights.code.function + change ZFSet.pair (SetMembers.raw x) ((q).encode (((family).copy (action) 1).toFun x)) ∈ E + rw [data.externalIdentityCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] + exact ((SetMembers.presentation U).pair_mem_graph (q) _ x _).2 rfl + +end GroundExternalGeometryInputs + + + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +noncomputable def externalStarOwner (P r μ A : ZFSet.{u}) : ZFSet.{u} := + leastSupportGraph + (M.externalStarVertices G (externalChildLetters I P (externalRectangles P G r μ A)) + (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) + (completion.externalPointCarrier P r μ A) + (M.externalStarDepth G (externalChildLetters I P (externalRectangles P G r μ A)) + (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) + (completion.externalStarSupports P r μ A) + +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "scheme" => TileStars.Spaces.scheme + (Compression.RecursiveMaps.TileRequests.Family.diagram (family) (action)) +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG + +theorem externalStarOwner_iff : + letI := group.toGroup + ∀ x v, ZFSet.pair ((q).encode x) ((sVertex).encode v) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ + (scheme).LeastSupport v x := by + let := group.toGroup + intro x v + have entry := leastSupportGraph_entry (sVertex) (q) (scheme).depth (scheme).Supports + (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStarSupports_iff group oldAction pairing unions powers separation infinite hG) x v + rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1, + data.externalPointPresentation_carrier] at entry + exact entry + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarOwner_ground_function (hP0 : P0 ∈ M.sets) : + completion.externalStarOwner P0 r0 μ0 A0 ∈ M.sets ∧ + ZFSet.IsFunc (completion.externalPointCarrier P0 r0 μ0 A0) + (M.externalStarVertices G letters requests m one) (completion.externalStarOwner P0 r0 μ0 A0) := by + let := group.toGroup + have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have points := (data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0).carrier_ground + have depths := (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).1 + have supports := data.externalStarSupports_ground group oldAction pairing unions powers separation infinite hG hP0 + refine ⟨M.leastSupportGraph_mem pairing unions powers separation infinite vertices points depths supports, ?_⟩ + have function := leastSupportGraph_function (sVertex) (q) (scheme).depth (scheme).Supports + (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStarSupports_iff group oldAction pairing unions powers separation infinite hG) + (scheme).existsUnique_leastSupport + rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1, + data.externalPointPresentation_carrier] at function + exact function + +end GroundExternalGeometryInputs +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "scheme" => TileStars.Spaces.scheme + (Compression.RecursiveMaps.TileRequests.Family.diagram (family) (action)) +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "oldCopy" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) +local notation "oldImage" => relationImage U Q oldCopy + +theorem externalStarOwner_subset : completion.externalStarOwner P0 r0 μ0 A0 ⊆ + ZFSet.prod Q (M.externalStarVertices G letters requests m one) := by + intro z hz + unfold GroundCompressionCompletion.externalStarOwner leastSupportGraph at hz + exact (ZFSet.mem_sep.1 hz).1 + +theorem externalStarOwner_value_iff : + letI := group.toGroup + ∀ x v, ZFSet.pair ((q).encode x) ((sVertex).encode v) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ + (scheme).owner x = v := by + let := group.toGroup + intro x v + exact (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG x v).trans + ((scheme).owner_eq_iff x v).symm + +theorem externalStarOwner_eq_graph : + letI := group.toGroup + completion.externalStarOwner P0 r0 μ0 A0 = (q).graph (sVertex) (scheme).owner := by + let := group.toGroup + apply presentedGraph_eq (q) (sVertex) (scheme).owner + · rw [data.externalPointPresentation_carrier, + (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1] + exact externalStarOwner_subset + · exact data.externalStarOwner_value_iff group oldAction pairing unions powers separation infinite hG + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarOwner_order_depth {x y v w : ZFSet.{u}} {n k : Nat} + (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) + (first : ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0) + (second : ZFSet.pair y w ∈ completion.externalStarOwner P0 r0 μ0 A0) + (firstDepth : ZFSet.pair v (natSetCode n) ∈ M.externalStarDepth G letters requests m one) + (secondDepth : ZFSet.pair w (natSetCode k) ∈ M.externalStarDepth G letters requests m one) : + n ≤ k ∧ (n = k → v = w) := by + let := group.toGroup + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have vc := (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 + have firstShape := ZFSet.pair_mem_prod.1 (externalStarOwner_subset first) + have secondShape := ZFSet.pair_mem_prod.1 (externalStarOwner_subset second) + obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ firstShape.1) + obtain ⟨y, rfl⟩ := ((q).mem_carrier y).1 (qc.symm ▸ secondShape.1) + obtain ⟨v, rfl⟩ := ((sVertex).mem_carrier v).1 (vc.symm ▸ firstShape.2) + obtain ⟨w, rfl⟩ := ((sVertex).mem_carrier w).1 (vc.symm ▸ secondShape.2) + have firstOwner := (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG x v).1 first + have secondOwner := (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG y w).1 second + have order := ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 x y).1 lower + have hn := (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG v n).1 firstDepth + have hk := (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG w k).1 secondDepth + refine ⟨?_, ?_⟩ + · rw [hn, hk] + exact (scheme).leastSupport_depth_mono firstOwner secondOwner order + · intro same + exact congrArg (sVertex).encode ((scheme).leastSupport_eq_of_depth_eq firstOwner secondOwner order + (hn.symm.trans (same.trans hk))) + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarOwner_root_iff : + ∀ x, ZFSet.pair x (M.externalStarRoot G letters m one) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ + x ∈ oldImage := by + let := group.toGroup + intro x + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have rootEq := data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG + have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have copies := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.2.2 + constructor + · intro entry + have hx := (ZFSet.pair_mem_prod.1 (externalStarOwner_subset entry)).1 + obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ hx) + rw [rootEq, data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG] at entry + obtain ⟨a, image⟩ := ((family).leastSupport_root_copy_iff (action) x).1 entry + refine (mem_relationImage _ _ _ _).2 ⟨hx, SetMembers.raw a, SetMembers.raw_mem a, ?_⟩ + have copyEntry := (copies 1 a x).2 image + rw [← identity] at copyEntry + exact copyEntry + · intro hx + obtain ⟨member, a, ha, entry⟩ := (mem_relationImage _ _ _ _).1 hx + obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ member) + let a' := SetMembers.ofMem a ha + have copyEntry : ZFSet.pair (SetMembers.raw a') ((q).encode x) ∈ + completion.externalCopyGraph P0 r0 μ0 A0 ((sGroup).encode 1) := by + simpa only [identity, a', SetMembers.raw_ofMem] using entry + have image := (copies 1 a' x).1 copyEntry + rw [rootEq, data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG] + exact ((family).leastSupport_root_copy_iff (action) x).2 ⟨a', image⟩ + +theorem externalStarOwner_fresh_tile : + letI := group.toGroup + ∀ x v, ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0 → x ∉ oldImage → + ∃ w r, ∃ y : ((family).tile r).Space, + v = (sVertex).encode (.inr (w, r)) ∧ x = (q).encode (((family).placedTile (action) w r).toFun y) ∧ + ¬ ((family).tile r).order.le y + (((family).diagram (action)).localGlue (.inr (w, r)) ((family).tile_depth_ne_zero (action) w r)).rightAnchor := by + let := group.toGroup + intro x v entry fresh + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have vc := (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 + have shape := ZFSet.pair_mem_prod.1 (externalStarOwner_subset entry) + obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ shape.1) + obtain ⟨v, rfl⟩ := ((sVertex).mem_carrier v).1 (vc.symm ▸ shape.2) + have least := (data.externalStarOwner_iff group oldAction pairing unions powers separation infinite hG x v).1 entry + rcases (family).leastSupport_cases (action) v x least with ⟨rfl, _⟩ | ⟨w, r, y, rfl, eq, outside⟩ + · apply False.elim + apply fresh + apply (data.externalStarOwner_root_iff group oldAction pairing unions powers separation infinite hG _).1 + rw [data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] + exact entry + · exact ⟨w, r, y, rfl, congrArg (q).encode eq.symm, outside⟩ + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "scheme" => TileStars.Spaces.scheme + (Compression.RecursiveMaps.TileRequests.Family.diagram (family) (action)) +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "oldCopy" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) +local notation "oldImage" => relationImage U Q oldCopy +local notation "seedCarrier" => completion.externalSeedCarrier P0 r0 μ0 A0 + +include data group oldAction pairing unions powers separation infinite hG + +theorem externalStarOwner_seed_iff (x : ZFSet.{u}) : + ZFSet.pair x (M.externalStarRoot G letters m one) ∈ completion.externalStarOwner P0 r0 μ0 A0 ↔ + x ∈ seedCarrier := + data.externalStarOwner_root_iff group oldAction pairing unions powers separation infinite hG x + +theorem externalSeedCarrier_lower {x y : ZFSet.{u}} (hx : x ∈ Q) (hy : y ∈ seedCarrier) + (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) : x ∈ seedCarrier := by + have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + obtain ⟨_, a, _, entry⟩ := (mem_relationImage _ _ _ _).1 hy + obtain ⟨b, hb, _, image⟩ := ideal.ideal a y x entry hx lower + exact (mem_relationImage _ _ _ _).2 ⟨hx, b, hb, image⟩ + +theorem externalSeedCarrier_no_new_below {x y : ZFSet.{u}} (hx : x ∈ Q) + (fresh : x ∉ seedCarrier) (old : y ∈ seedCarrier) : + ZFSet.pair x y ∉ completion.externalPointOrder P0 r0 μ0 A0 := + fun lower => fresh (data.externalSeedCarrier_lower group oldAction pairing unions powers separation infinite hG hx old lower) + +theorem externalStarOwner_order {x y v w n k : ZFSet.{u}} + (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) + (first : ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0) + (second : ZFSet.pair y w ∈ completion.externalStarOwner P0 r0 μ0 A0) + (firstDepth : ZFSet.pair v n ∈ M.externalStarDepth G letters requests m one) + (secondDepth : ZFSet.pair w k ∈ M.externalStarDepth G letters requests m one) : + (n = k ∨ n ∈ k) ∧ (n = k → v = w) := by + have depthFunction := (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).2 + have hn := (ZFSet.pair_mem_prod.1 (depthFunction.1 firstDepth)).2 + have hk := (ZFSet.pair_mem_prod.1 (depthFunction.1 secondDepth)).2 + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + have laws := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG + lower first second firstDepth secondDepth + refine ⟨?_, fun same => laws.2 (natSetCode_injective same)⟩ + rcases Nat.lt_or_eq_of_le laws.1 with less | same + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "c" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "E" => M.externalGroupCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one +local notation "C" => M.externalCosetCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one +variable {D rD lo hi : ZFSet.{u}} +variable (heights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi completion) +local notation "coordinates" => heights.coordinates +local notation "localp" => data.localTilePresentation group oldAction pairing unions powers separation infinite hG +include data group oldAction pairing unions powers separation infinite hG + +theorem externalTileCoordinates_support : + letI := group.toGroup + ∀ v x d, ZFSet.pair (ZFSet.pair v x) d ∈ coordinates → + ∃ (w : External (SetMembers G) (family).Letters) (r : Index) (a : ((family).tile r).Space), + v = (vpres).encode (.inr (w, r)) ∧ x = (q).encode (((family).placedTile (action) w r).toFun a) := by + let := group.toGroup + intro v x d entry + have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have acted := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.2.1 + obtain ⟨_, hx, _, w, hw, r, hr, y, _, h, _, equal, selected, acting, value⟩ := + (pair_mem_transportedTileCoordinates _ _ _ _ _ _ _ _ _ _).1 entry + obtain ⟨w, rfl⟩ := ((s).mem_carrier w).1 (sc.symm ▸ hw) + obtain ⟨r, rfl⟩ := ((externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).mem_carrier r).1 hr + have code := (heights.values _ _ selected).2.1 + have localMember := (ZFSet.pair_mem_prod.1 (code.function.1 value)).1 + obtain ⟨a, rfl⟩ := (data.localTileCarrier_image group oldAction pairing unions powers separation infinite hG r y).1 localMember + obtain ⟨x, rfl⟩ := ((q).mem_carrier x).1 (qc.symm ▸ hx) + have translated := (acted w (((family).placedTile (action) 1 r).toFun a) x).1 acting + rw [(family).translate_tile, mul_one] at translated + exact ⟨w, r, a, equal, congrArg (q).encode translated.symm⟩ + +include heights in +theorem externalTileCoordinates_owner_total : + ∀ x ∈ Q, x ∉ completion.externalSeedCarrier P0 r0 μ0 A0 → ∀ v, + ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0 → + ∃ d ∈ D, ZFSet.pair (ZFSet.pair v x) d ∈ coordinates := by + let := group.toGroup + intro x _ fresh v owner + obtain ⟨w, r, a, rfl, rfl, _⟩ := + data.externalStarOwner_fresh_tile group oldAction pairing unions powers separation infinite hG x v owner fresh + exact data.externalTileCoordinates_total group oldAction pairing unions powers separation infinite hG heights w r a + +include heights in +theorem externalTileCoordinates_raw_strict : + ∀ v x y a b, ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0 → x ≠ y → + ZFSet.pair (ZFSet.pair v x) a ∈ coordinates → + ZFSet.pair (ZFSet.pair v y) b ∈ coordinates → ZFSet.pair a b ∈ rD := by + let := group.toGroup + intro v x y a b lower distinct first second + obtain ⟨w, r, x', rfl, rfl⟩ := + data.externalTileCoordinates_support group oldAction pairing unions powers separation infinite hG heights v x a first + obtain ⟨w', r', y', sameVertex, samePoint⟩ := + data.externalTileCoordinates_support group oldAction pairing unions powers separation infinite hG heights _ y b second + have same := Sum.inr.inj ((vpres).injective sameVertex) + obtain ⟨rfl, rfl⟩ := Prod.mk.inj same + subst y + have localLower := (((family).placedTile (action) w r).le_iff x' y').1 + (((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 _ _).1 lower) + have localDistinct : x' ≠ y' := fun equal => distinct (congrArg + (fun z => (q).encode (((family).placedTile (action) w r).toFun z)) equal) + exact data.externalTileCoordinates_strict group oldAction pairing unions powers separation infinite hG + heights w r x' y' localDistinct localLower a b first second + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + +namespace PartitionPilot.Forcing +universe u +namespace GroundExternalLocalHeightData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (localHeights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 D rD lo hi completion) + +noncomputable def externalHeightGraph (C seed columns : ZFSet.{u}) : ZFSet.{u} := + externalOwnerHeightGraph (completion.externalSeedCarrier P0 r0 μ0 A0) + (completion.externalPointCarrier P0 r0 μ0 A0) + (M.externalStarVertices G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) + (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one) C D + (completion.externalSeedHeight P0 r0 μ0 A0 C D seed) + (completion.externalStarOwner P0 r0 μ0 A0) + (M.externalStarDepth G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) + (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one) + columns localHeights.coordinates + +end GroundExternalLocalHeightData + +structure GroundExternalHeightData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi seed : ZFSet.{u}) + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) where + localHeights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi completion + columns : GroundExternalColumnData M C (heightColumns (completion.externalSeedCarrier P0 r0 μ0 A0) C D + (completion.externalSeedHeight P0 r0 μ0 A0 C D seed)) + height_ground : localHeights.externalHeightGraph C seed columns.sequence ∈ M.sets + code : StrictLexHeightCode (completion.externalPointCarrier P0 r0 μ0 A0) C D + (completion.externalPointOrder P0 r0 μ0 A0) (localHeights.externalHeightGraph C seed columns.sequence) rD + range_ground : relationImage (completion.externalPointCarrier P0 r0 μ0 A0) (ZFSet.prod C D) + (localHeights.externalHeightGraph C seed columns.sequence) ∈ M.sets + range_countable : M.groundEmbeddable (relationImage (completion.externalPointCarrier P0 r0 μ0 A0) (ZFSet.prod C D) + (localHeights.externalHeightGraph C seed columns.sequence)) ZFSet.omega + preserves_seed : ∀ x y z, ZFSet.pair x y ∈ completion.externalIdentityCopyGraph P0 r0 μ0 A0 → + (ZFSet.pair y z ∈ localHeights.externalHeightGraph C seed columns.sequence ↔ ZFSet.pair x z ∈ seed) + below_cap : ∀ x a d, ZFSet.pair x (ZFSet.pair a d) ∈ localHeights.externalHeightGraph C seed columns.sequence → + a ∈ columns.cap + +namespace GroundExternalHeightData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi seed : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +noncomputable def height (data : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) : ZFSet.{u} := + data.localHeights.externalHeightGraph C seed data.columns.sequence + +end GroundExternalHeightData + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTileVertexPresentation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTileVertexPresentation.lean index ebda26b087eb2a9de6f098c906cfe20eff0bf390..c4c9110b78a4c109a55e68a4c350a92c8d9c23e3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTileVertexPresentation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTileVertexPresentation.lean @@ -1,149 +1,149 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundCompressionCompletion -open SetRealization -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (compression : CompressionOriginalData P0 r0 μ0 A0 G - (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) - -theorem externalFamilyVertexCode_injective - (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : - Function.Injective (completion.externalFamilyVertexCode group oldAction compression r) := by - rcases r with i | (x | z) - all_goals - intro v w equal - cases v with - | none => - cases w with - | none => rfl - | some w => - cases w with | up w => - cases w <;> simp only [externalFamilyVertexCode_root, externalFamilyVertexCode_compression, - externalFamilyVertexCode_separation, externalFamilyVertexCode_rectangle, - natSetCode_injective.eq_iff] at equal <;> contradiction - | some v => - cases w with - | none => - cases v with | up v => - cases v <;> simp only [externalFamilyVertexCode_root, externalFamilyVertexCode_compression, - externalFamilyVertexCode_separation, externalFamilyVertexCode_rectangle, - natSetCode_injective.eq_iff] at equal <;> contradiction - | some w => - cases v with | up v => - cases w with | up w => - cases v <;> cases w <;> simp_all only [externalFamilyVertexCode_compression, - externalFamilyVertexCode_separation, externalFamilyVertexCode_rectangle, - natSetCode_injective.eq_iff, Bool.false_eq_true] <;> simp_all - -theorem externalFamilyVertexCode_range - (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) (v : ZFSet.{u}) : - (v = natSetCode 0 ∨ v = natSetCode 1 ∨ - (externalRequestIndexCode r ∈ ZFSet.prod {natSetCode 2} (externalRectangles P0 G r0 μ0 A0) ∧ - v = natSetCode 2)) ↔ - ∃ i, completion.externalFamilyVertexCode group oldAction compression r i = v := by - rcases r with j | (x | z) - · simp only [externalRequestIndexCode, ZFSet.pair_mem_prod, ZFSet.mem_singleton, - natSetCode_injective.eq_iff, show ¬ (0 : Nat) = 2 by decide, false_and, or_false] - constructor - · rintro (rfl | rfl) - · exact ⟨none, rfl⟩ - · exact ⟨some ⟨()⟩, rfl⟩ - · rintro ⟨i, rfl⟩ - cases i with - | none => exact Or.inl rfl - | some i => exact Or.inr rfl - · simp only [externalRequestIndexCode, ZFSet.pair_mem_prod, ZFSet.mem_singleton, - natSetCode_injective.eq_iff, show ¬ (1 : Nat) = 2 by decide, false_and, or_false] - constructor - · rintro (rfl | rfl) - · exact ⟨none, rfl⟩ - · exact ⟨some ⟨()⟩, rfl⟩ - · rintro ⟨i, rfl⟩ - cases i with - | none => exact Or.inl rfl - | some i => exact Or.inr rfl - · simp only [externalRequestIndexCode, ZFSet.pair_mem_prod, ZFSet.mem_singleton, - SetMembers.raw_mem, and_self, true_and] - constructor - · rintro (rfl | rfl | rfl) - · exact ⟨none, rfl⟩ - · exact ⟨some ⟨false⟩, rfl⟩ - · exact ⟨some ⟨true⟩, rfl⟩ - · rintro ⟨i, rfl⟩ - cases i with - | none => exact Or.inl rfl - | some i => - cases i with | up b => - cases b - · exact Or.inr (Or.inl rfl) - · exact Or.inr (Or.inr rfl) - -noncomputable def externalFamilyTileVertexPresentation : - Presentation (Sigma fun r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) => - Option ((completion.externalFamily group oldAction compression).Child r) × - SetMembers (completion.algebra.union.fields 0)) where - carrier := externalTileVertices (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) - (externalRectangles P0 G r0 μ0 A0) (completion.algebra.union.fields 0) - encode v := ZFSet.pair (ZFSet.pair (externalRequestIndexCode v.1) - (completion.externalFamilyVertexCode group oldAction compression v.1 v.2.1)) (SetMembers.raw v.2.2) - injective := by - rintro ⟨r, i, x⟩ ⟨s, j, y⟩ equal - have outer := ZFSet.pair_inj.1 equal - have inner := ZFSet.pair_inj.1 outer.1 - have same := externalRequestIndexCode_injective I P0 (externalRectangles P0 G r0 μ0 A0) inner.1 - cases same - have vertex := completion.externalFamilyVertexCode_injective group oldAction compression r inner.2 - have point := SetMembers.raw_injective _ outer.2 - cases vertex - cases point - rfl - mem_carrier z := by - constructor - · intro hz - have shape : ∃ q i x, z = ZFSet.pair (ZFSet.pair q i) x := by - rcases ZFSet.mem_union.1 hz with h | h - all_goals - obtain ⟨qi, hqi, x, _, rfl⟩ := ZFSet.mem_prod.1 h - obtain ⟨q, _, i, _, rfl⟩ := ZFSet.mem_prod.1 hqi - exact ⟨q, i, x, rfl⟩ - obtain ⟨q, i, x, rfl⟩ := shape - obtain ⟨hqi, hx⟩ := (triple_mem_externalTileVertices _ _ _ _ _ _).1 hz - have hq : q ∈ externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) := by - rcases hqi with ⟨hq, _⟩ | ⟨hq, _⟩ - · exact hq - · exact ZFSet.mem_union.2 (Or.inr hq) - obtain ⟨r, rfl⟩ := ((externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).mem_carrier q).1 hq - have hv : i = natSetCode 0 ∨ i = natSetCode 1 ∨ - (externalRequestIndexCode r ∈ ZFSet.prod {natSetCode 2} (externalRectangles P0 G r0 μ0 A0) ∧ - i = natSetCode 2) := by tauto - obtain ⟨v, rfl⟩ := (completion.externalFamilyVertexCode_range group oldAction compression r i).1 hv - exact ⟨⟨r, v, SetMembers.ofMem x hx⟩, by simp only [SetMembers.raw_ofMem]; rfl⟩ - · rintro ⟨⟨r, i, x⟩, rfl⟩ - apply (triple_mem_externalTileVertices _ _ _ _ _ _).2 - refine ⟨?_, SetMembers.raw_mem x⟩ - have hv := (completion.externalFamilyVertexCode_range group oldAction compression r _).2 ⟨i, rfl⟩ - have hq := (externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r - tauto - -theorem externalFamilyTileVertexPresentation_encode - (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) - (i : Option ((completion.externalFamily group oldAction compression).Child r)) - (x : SetMembers (completion.algebra.union.fields 0)) : - (completion.externalFamilyTileVertexPresentation group oldAction compression).encode ⟨r, i, x⟩ = - ZFSet.pair (ZFSet.pair (externalRequestIndexCode r) - (completion.externalFamilyVertexCode group oldAction compression r i)) (SetMembers.raw x) := rfl - -end PartitionPilot.Forcing.GroundCompressionCompletion - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundCompressionCompletion +open SetRealization +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (compression : CompressionOriginalData P0 r0 μ0 A0 G + (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) + +theorem externalFamilyVertexCode_injective + (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) : + Function.Injective (completion.externalFamilyVertexCode group oldAction compression r) := by + rcases r with i | (x | z) + all_goals + intro v w equal + cases v with + | none => + cases w with + | none => rfl + | some w => + cases w with | up w => + cases w <;> simp only [externalFamilyVertexCode_root, externalFamilyVertexCode_compression, + externalFamilyVertexCode_separation, externalFamilyVertexCode_rectangle, + natSetCode_injective.eq_iff] at equal <;> contradiction + | some v => + cases w with + | none => + cases v with | up v => + cases v <;> simp only [externalFamilyVertexCode_root, externalFamilyVertexCode_compression, + externalFamilyVertexCode_separation, externalFamilyVertexCode_rectangle, + natSetCode_injective.eq_iff] at equal <;> contradiction + | some w => + cases v with | up v => + cases w with | up w => + cases v <;> cases w <;> simp_all only [externalFamilyVertexCode_compression, + externalFamilyVertexCode_separation, externalFamilyVertexCode_rectangle, + natSetCode_injective.eq_iff, Bool.false_eq_true] <;> simp_all + +theorem externalFamilyVertexCode_range + (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) (v : ZFSet.{u}) : + (v = natSetCode 0 ∨ v = natSetCode 1 ∨ + (externalRequestIndexCode r ∈ ZFSet.prod {natSetCode 2} (externalRectangles P0 G r0 μ0 A0) ∧ + v = natSetCode 2)) ↔ + ∃ i, completion.externalFamilyVertexCode group oldAction compression r i = v := by + rcases r with j | (x | z) + · simp only [externalRequestIndexCode, ZFSet.pair_mem_prod, ZFSet.mem_singleton, + natSetCode_injective.eq_iff, show ¬ (0 : Nat) = 2 by decide, false_and, or_false] + constructor + · rintro (rfl | rfl) + · exact ⟨none, rfl⟩ + · exact ⟨some ⟨()⟩, rfl⟩ + · rintro ⟨i, rfl⟩ + cases i with + | none => exact Or.inl rfl + | some i => exact Or.inr rfl + · simp only [externalRequestIndexCode, ZFSet.pair_mem_prod, ZFSet.mem_singleton, + natSetCode_injective.eq_iff, show ¬ (1 : Nat) = 2 by decide, false_and, or_false] + constructor + · rintro (rfl | rfl) + · exact ⟨none, rfl⟩ + · exact ⟨some ⟨()⟩, rfl⟩ + · rintro ⟨i, rfl⟩ + cases i with + | none => exact Or.inl rfl + | some i => exact Or.inr rfl + · simp only [externalRequestIndexCode, ZFSet.pair_mem_prod, ZFSet.mem_singleton, + SetMembers.raw_mem, and_self, true_and] + constructor + · rintro (rfl | rfl | rfl) + · exact ⟨none, rfl⟩ + · exact ⟨some ⟨false⟩, rfl⟩ + · exact ⟨some ⟨true⟩, rfl⟩ + · rintro ⟨i, rfl⟩ + cases i with + | none => exact Or.inl rfl + | some i => + cases i with | up b => + cases b + · exact Or.inr (Or.inl rfl) + · exact Or.inr (Or.inr rfl) + +noncomputable def externalFamilyTileVertexPresentation : + Presentation (Sigma fun r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) => + Option ((completion.externalFamily group oldAction compression).Child r) × + SetMembers (completion.algebra.union.fields 0)) where + carrier := externalTileVertices (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) + (externalRectangles P0 G r0 μ0 A0) (completion.algebra.union.fields 0) + encode v := ZFSet.pair (ZFSet.pair (externalRequestIndexCode v.1) + (completion.externalFamilyVertexCode group oldAction compression v.1 v.2.1)) (SetMembers.raw v.2.2) + injective := by + rintro ⟨r, i, x⟩ ⟨s, j, y⟩ equal + have outer := ZFSet.pair_inj.1 equal + have inner := ZFSet.pair_inj.1 outer.1 + have same := externalRequestIndexCode_injective I P0 (externalRectangles P0 G r0 μ0 A0) inner.1 + cases same + have vertex := completion.externalFamilyVertexCode_injective group oldAction compression r inner.2 + have point := SetMembers.raw_injective _ outer.2 + cases vertex + cases point + rfl + mem_carrier z := by + constructor + · intro hz + have shape : ∃ q i x, z = ZFSet.pair (ZFSet.pair q i) x := by + rcases ZFSet.mem_union.1 hz with h | h + all_goals + obtain ⟨qi, hqi, x, _, rfl⟩ := ZFSet.mem_prod.1 h + obtain ⟨q, _, i, _, rfl⟩ := ZFSet.mem_prod.1 hqi + exact ⟨q, i, x, rfl⟩ + obtain ⟨q, i, x, rfl⟩ := shape + obtain ⟨hqi, hx⟩ := (triple_mem_externalTileVertices _ _ _ _ _ _).1 hz + have hq : q ∈ externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) := by + rcases hqi with ⟨hq, _⟩ | ⟨hq, _⟩ + · exact hq + · exact ZFSet.mem_union.2 (Or.inr hq) + obtain ⟨r, rfl⟩ := ((externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).mem_carrier q).1 hq + have hv : i = natSetCode 0 ∨ i = natSetCode 1 ∨ + (externalRequestIndexCode r ∈ ZFSet.prod {natSetCode 2} (externalRectangles P0 G r0 μ0 A0) ∧ + i = natSetCode 2) := by tauto + obtain ⟨v, rfl⟩ := (completion.externalFamilyVertexCode_range group oldAction compression r i).1 hv + exact ⟨⟨r, v, SetMembers.ofMem x hx⟩, by simp only [SetMembers.raw_ofMem]; rfl⟩ + · rintro ⟨⟨r, i, x⟩, rfl⟩ + apply (triple_mem_externalTileVertices _ _ _ _ _ _).2 + refine ⟨?_, SetMembers.raw_mem x⟩ + have hv := (completion.externalFamilyVertexCode_range group oldAction compression r _).2 ⟨i, rfl⟩ + have hq := (externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r + tauto + +theorem externalFamilyTileVertexPresentation_encode + (r : ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0)) + (i : Option ((completion.externalFamily group oldAction compression).Child r)) + (x : SetMembers (completion.algebra.union.fields 0)) : + (completion.externalFamilyTileVertexPresentation group oldAction compression).encode ⟨r, i, x⟩ = + ZFSet.pair (ZFSet.pair (externalRequestIndexCode r) + (completion.externalFamilyVertexCode group oldAction compression r i)) (SetMembers.raw x) := rfl + +end PartitionPilot.Forcing.GroundCompressionCompletion + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTranslation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTranslation.lean index c711f8eb0859bb8218e15fbd0e2ad251d440c5d4..731429f4395e4dd7647e134a9e4f5ad25eb8861d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTranslation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/ExternalTranslation.lean @@ -1,415 +1,415 @@ -import OAI.SetTheory.PartitionPrinciple.Models.IncidenceQuotient - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -namespace TileRequests.Family - -open Attachment CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -def fullIdeal : MeetIso (idealOrder P f.top) P where - toFun := Subtype.val - le_iff _ _ := Iff.rfl - map_meet _ _ := rfl - inverse x := ⟨x, f.greatest x⟩ - left_inverse _ := rfl - right_inverse _ := rfl - -noncomputable def vertexIdealIso {B : Type u} {Q : MeetOrder B} (i : IdealEmbedding P Q) : - MeetIso P (idealOrder Q (i.toFun f.top)) := - RootedGluing.chainIso (inverseIso f.fullIdeal) (i.principalIso f.top) - -def Space : TileStars.Vertex J f.Letters R → Type u - | .inl _ => A - | .inr c => (f.tile c.2).Space - -noncomputable def localOrder : (v : TileStars.Vertex J f.Letters R) → MeetOrder (f.Space v) - | .inl _ => P - | .inr c => (f.tile c.2).order - -noncomputable def leftAnchor (e : TileStars.Edge J f.Letters R) : - f.Space (TileStars.source J f.Letters R Sigma.fst (e, true)) := by - cases e with - | inl c => exact f.top - | inr e => exact ((f.tile e.2.1).child e.2.2).toFun f.top - -noncomputable def rightAnchor (e : TileStars.Edge J f.Letters R) : - f.Space (TileStars.target J f.Letters R Sigma.fst (e, true)) := by - cases e with - | inl c => exact (f.tile c.2).root.toFun f.top - | inr e => exact f.top - -noncomputable def edgeOverlap (e : TileStars.Edge J f.Letters R) : MeetIso - (idealOrder (f.localOrder (TileStars.source J f.Letters R Sigma.fst (e, true))) (f.leftAnchor e)) - (idealOrder (f.localOrder (TileStars.target J f.Letters R Sigma.fst (e, true))) (f.rightAnchor e)) := by - cases e with - | inl c => - exact RootedGluing.chainIso f.fullIdeal (RootedGluing.chainIso - (inverseIso (a.chart c.1)) (f.vertexIdealIso (f.tile c.2).root)) - | inr e => - exact RootedGluing.chainIso (inverseIso (f.vertexIdealIso ((f.tile e.2.1).child e.2.2))) - (RootedGluing.chainIso (a.chart (e.1 * generator J f.Letters e.2)) (inverseIso f.fullIdeal)) - -noncomputable def diagram : TileStars.Spaces J f.Letters R Sigma.fst where - Space := f.Space - order := f.localOrder - leftAnchor := f.leftAnchor - rightAnchor := f.rightAnchor - overlap := f.edgeOverlap a - -def Node := (f.diagram a).Node -noncomputable def gluedOrder : MeetOrder (f.Node a) := (f.diagram a).gluedOrder - -noncomputable def copy (w : External J f.Letters) : IdealEmbedding P (f.gluedOrder a) := - (a.ideal (coordinate J f.Letters w)).comp ((f.diagram a).vertex (.inl (point J f.Letters w))) - -noncomputable def placedTile (w : External J f.Letters) (r : R) : - IdealEmbedding (f.tile r).order (f.gluedOrder a) := (f.diagram a).vertex (.inr (w, r)) - -theorem copy_coordinate (w : External J f.Letters) (j : J) (x : A) : - (f.copy a (w * old J f.Letters j)).toFun x = (f.copy a w).toFun ((a.iso j).toFun x) := by - change ((f.diagram a).vertex (.inl (point J f.Letters (w * old J f.Letters j)))).toFun - ((a.chart (w * old J f.Letters j)).toFun x) = _ - rw [point_mul_old, a.chart_mul_old] - rfl - -theorem copy_one (x : A) : (f.copy a 1).toFun x = - ((f.diagram a).vertex (.inl (root J f.Letters))).toFun x := by - change ((f.diagram a).vertex (.inl (root J f.Letters))).toFun ((a.chart 1).toFun x) = _ - rw [a.chart_one] - -theorem stem_formula (w : External J f.Letters) (r : R) (x : A) : - ((f.edgeOverlap a (.inl (w, r))).toFun ⟨(a.chart w).toFun x, f.greatest _⟩).val = - (f.tile r).root.toFun x := by - change (f.tile r).root.toFun ((a.chart w).inverse ((a.chart w).toFun x)) = _ - rw [(a.chart w).left_inverse] - -theorem branch_formula (w : External J f.Letters) (r : R) (j : f.Child r) (x : A) : - ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun - ⟨((f.tile r).child j).toFun x, (((f.tile r).child j).le_iff _ _).mpr (f.greatest x)⟩).val = - (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun x := by - have inv := (f.vertexIdealIso ((f.tile r).child j)).left_inverse x - change (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun - ((f.vertexIdealIso ((f.tile r).child j)).inverse - ((f.vertexIdealIso ((f.tile r).child j)).toFun x)) = _ - rw [inv] - -theorem root_identification (w : External J f.Letters) (r : R) (x : A) : - (f.placedTile a w r).toFun ((f.tile r).root.toFun x) = (f.copy a w).toFun x := by - have eq := (f.diagram a).edge_identification (.inl (w, r), true) - ⟨(a.chart w).toFun x, f.greatest _⟩ - change (f.copy a w).toFun x = (f.placedTile a w r).toFun - ((f.edgeOverlap a (.inl (w, r))).toFun ⟨(a.chart w).toFun x, f.greatest _⟩).val at eq - rw [f.stem_formula] at eq - exact eq.symm - -theorem child_identification (w : External J f.Letters) (r : R) (j : f.Child r) (x : A) : - (f.placedTile a w r).toFun (((f.tile r).child j).toFun x) = - (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x := by - have eq := (f.diagram a).edge_identification (.inr (w, ⟨r, j⟩), true) - ⟨((f.tile r).child j).toFun x, (((f.tile r).child j).le_iff _ _).mpr (f.greatest x)⟩ - change (f.placedTile a w r).toFun (((f.tile r).child j).toFun x) = - ((f.diagram a).vertex (.inl (point J f.Letters (w * generator J f.Letters ⟨r, j⟩)))).toFun - ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun - ⟨((f.tile r).child j).toFun x, (((f.tile r).child j).le_iff _ _).mpr (f.greatest x)⟩).val at eq - rw [f.branch_formula] at eq - exact eq - -theorem copy_principal (w : External J f.Letters) (z : f.Node a) : - (f.gluedOrder a).le z ((f.copy a w).toFun f.top) ↔ ∃ x, (f.copy a w).toFun x = z := - (f.copy a w).principal f.top f.greatest z - -theorem copy_greatest_part (w : External J f.Letters) (z : f.Node a) (x : A) : - (f.gluedOrder a).le ((f.copy a w).toFun x) z ↔ - P.le x ((f.copy a w).projection f.top z) := - (f.copy a w).greatest_part f.top f.greatest z x - -theorem copy_cover (z : f.Node a) : ∃ w x, (f.copy a w).toFun x = z := by - rcases (f.diagram a).cover z with ⟨v, x, rfl⟩ - cases v with - | inl v => - refine ⟨representative J f.Letters v, (a.chart (representative J f.Letters v)).inverse x, ?_⟩ - change ((f.diagram a).vertex (.inl (point J f.Letters (representative J f.Letters v)))).toFun - ((a.chart (representative J f.Letters v)).toFun - ((a.chart (representative J f.Letters v)).inverse x)) = _ - erw [(a.chart (representative J f.Letters v)).right_inverse, representative_spec] - | inr c => - rcases (f.tile c.2).cover x with ⟨y, rfl⟩ | ⟨j, y, rfl⟩ - · exact ⟨c.1, y, (f.root_identification a c.1 c.2 y).symm⟩ - · exact ⟨c.1 * generator J f.Letters ⟨c.2, j⟩, y, - (f.child_identification a c.1 c.2 j y).symm⟩ - -theorem comparison_in_copy (x y : f.Node a) (h : (f.gluedOrder a).le x y) : - ∃ w b c, (f.copy a w).toFun b = x ∧ (f.copy a w).toFun c = y ∧ P.le b c := by - rcases f.copy_cover a y with ⟨w, c, rfl⟩ - rcases (f.copy a w).ideal c x h with ⟨b, rfl⟩ - exact ⟨w, b, c, rfl, rfl, ((f.copy a w).le_iff b c).mp h⟩ - -theorem copy_injective (w : External J f.Letters) (x y : A) : - (f.copy a w).toFun x = (f.copy a w).toFun y ↔ x = y := by - constructor - · exact embedding_injective (f.copy a w).toMeetEmbedding - · exact congrArg (f.copy a w).toFun - -end TileRequests.Family - - - -namespace TileRequests - -open Attachment CosetGeometry -universe u -variable {A J : Type u} [Group J] {P : MeetOrder A} - -namespace Family -variable {R : Type u} (f : Family P R) (a : OrderAction J P) - -theorem transfer_child_root (w : External J f.Letters) (r : R) (j : f.Child r) (x y : A) - (h : ((f.tile r).child j).toFun x = (f.tile r).root.toFun y) : - (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x = (f.copy a w).toFun y := by - rw [← f.child_identification, ← f.root_identification, h] - -theorem transfer_child_root_meet (w : External J f.Letters) (r : R) (j : f.Child r) (x y z : A) - (h : (f.tile r).order.meet (((f.tile r).child j).toFun x) ((f.tile r).root.toFun y) = - (f.tile r).root.toFun z) : - (f.gluedOrder a).meet ((f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x) - ((f.copy a w).toFun y) = (f.copy a w).toFun z := by - rw [← f.child_identification, ← f.root_identification, ← f.root_identification, - ← (f.placedTile a w r).map_meet, h] - -theorem transfer_child_child_meet (w : External J f.Letters) (r : R) - (j k : f.Child r) (x y z : A) - (h : (f.tile r).order.meet (((f.tile r).child j).toFun x) (((f.tile r).child k).toFun y) = - ((f.tile r).child j).toFun z) : - (f.gluedOrder a).meet ((f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x) - ((f.copy a (w * generator J f.Letters ⟨r, k⟩)).toFun y) = - (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun z := by - rw [← f.child_identification, ← f.child_identification, ← f.child_identification, - ← (f.placedTile a w r).map_meet, h] - -end Family - -namespace AllGeometry -variable (T : A) (greatest : ∀ x, P.le x T) (a : OrderAction J P) - -noncomputable abbrev family : Family P (Request P) := Family.all T greatest -abbrev Letters := (family T greatest).Letters - -theorem separation_fixes (w : External J (Letters T greatest)) (W x : A) (below : P.le x W) : - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.separation W, ⟨()⟩⟩)).toFun x = - ((family T greatest).copy a w).toFun x := - (family T greatest).transfer_child_root a w (.separation W) ⟨()⟩ x x - (Request.separation_agrees T greatest W x below) - -theorem separation_meet (w : External J (Letters T greatest)) (W D X : A) - (belowD : P.le W D) (belowX : P.le W X) : - ((family T greatest).gluedOrder a).meet - (((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.separation W, ⟨()⟩⟩)).toFun D) - (((family T greatest).copy a w).toFun X) = ((family T greatest).copy a w).toFun W := - (family T greatest).transfer_child_root_meet a w (.separation W) ⟨()⟩ D X W - (BinaryTiles.separation_cross_meet P W D X belowD belowX) - -theorem compression_restriction (w : External J (Letters T greatest)) (K : A) - (S : MeetIso P (idealOrder P K)) (x : A) : - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.compression K S, ⟨()⟩⟩)).toFun x = - ((family T greatest).copy a w).toFun (S.toFun x).val := - (family T greatest).transfer_child_root a w (.compression K S) ⟨()⟩ x (S.toFun x).val - (Request.compression_agrees T greatest K S x) - -theorem compression_top (w : External J (Letters T greatest)) (K : A) - (S : MeetIso P (idealOrder P K)) : - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.compression K S, ⟨()⟩⟩)).toFun T = - ((family T greatest).copy a w).toFun K := - (family T greatest).transfer_child_root a w (.compression K S) ⟨()⟩ T K - (BinaryTiles.compression_top P T K greatest S) - -theorem rectangle_first_agrees (w : External J (Letters T greatest)) (r : Rectangle.Input P) - (x : A) (below : P.le x r.C) : - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun x = - ((family T greatest).copy a w).toFun (r.g1.toFun x) := - (family T greatest).transfer_child_root a w (.rectangle r) ⟨false⟩ x (r.g1.toFun x) - (r.first_agrees x below) - -theorem rectangle_second_agrees (w : External J (Letters T greatest)) (r : Rectangle.Input P) - (x : A) (below : P.le x r.C) : - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun x = - ((family T greatest).copy a w).toFun (r.g2.toFun x) := - (family T greatest).transfer_child_root a w (.rectangle r) ⟨true⟩ x (r.g2.toFun x) - (r.second_agrees x below) - -theorem rectangle_children_intersection (w : External J (Letters T greatest)) - (r : Rectangle.Input P) (x y : A) : - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun x = - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun y ↔ - P.le x r.B ∧ x = y := by - erw [← (family T greatest).child_identification, ← (family T greatest).child_identification] - constructor - · intro h - exact (r.children_intersection x y).mp - (embedding_injective ((family T greatest).placedTile a w (.rectangle r)).toMeetEmbedding h) - · intro h - exact congrArg ((family T greatest).placedTile a w (.rectangle r)).toFun - ((r.children_intersection x y).mpr h) - -theorem rectangle_first_meet_root (w : External J (Letters T greatest)) - (r : Rectangle.Input P) (x : A) : - ((family T greatest).gluedOrder a).meet - (((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun r.D) - (((family T greatest).copy a w).toFun x) = - ((family T greatest).copy a w).toFun (P.meet (r.g1.toFun r.C) x) := - (family T greatest).transfer_child_root_meet a w (.rectangle r) ⟨false⟩ r.D x _ - (r.first_meet_root x) - -theorem rectangle_second_meet_root (w : External J (Letters T greatest)) - (r : Rectangle.Input P) (x : A) : - ((family T greatest).gluedOrder a).meet - (((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun r.D) - (((family T greatest).copy a w).toFun x) = - ((family T greatest).copy a w).toFun (P.meet (r.g2.toFun r.C) x) := - (family T greatest).transfer_child_root_meet a w (.rectangle r) ⟨true⟩ r.D x _ - (r.second_meet_root x) - -theorem rectangle_children_meet (w : External J (Letters T greatest)) (r : Rectangle.Input P) : - ((family T greatest).gluedOrder a).meet - (((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun r.D) - (((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun r.D) = - ((family T greatest).copy a - (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun r.B := - (family T greatest).transfer_child_child_meet a w (.rectangle r) ⟨false⟩ ⟨true⟩ r.D r.D r.B - r.children_meet - -end AllGeometry - -end TileRequests - - - -namespace CosetGeometry.TileStars.Spaces - -universe u -variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) -variable {B : Type u} (value : ∀ v, g.Space v → B) -variable (edges : ∀ d, g.Equation value d) - -include edges in -theorem values_respect_parents {x y : g.scheme.Label} (h : g.scheme.Related x y) : - value x.1 x.2 = value y.1 y.2 := by - induction h with - | parent v hv x => exact g.parents_of_equations value edges v hv x - | refl => rfl - | symm h ih => exact ih.symm - | trans h1 h2 ih1 ih2 => exact ih1.trans ih2 - -noncomputable def descend (z : g.Node) : B := - Quotient.lift (fun x => value x.1 x.2) - (fun _ _ h => g.values_respect_parents value edges h) (g.scheme.toGenerated z) - -theorem descend_vertex (v : Vertex J S R) (x : g.Space v) : - g.descend value edges ((g.vertex v).toFun x) = value v x := by - change Quotient.lift _ _ (g.scheme.toGenerated ((g.scheme.vertex v).toFun x)) = _ - erw [g.scheme.toGenerated_vertex] - rfl - -theorem descend_unique (h : g.Node → B) (vertices : ∀ v x, h ((g.vertex v).toFun x) = value v x) : - h = g.descend value edges := by - funext z - rcases g.cover z with ⟨v, x, rfl⟩ - exact (vertices v x).trans (g.descend_vertex value edges v x).symm - -end CosetGeometry.TileStars.Spaces - - - -namespace TileRequests.Family - -open Attachment CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -noncomputable def translationValue (g : External J f.Letters) : - (v : TileStars.Vertex J f.Letters R) → f.Space v → f.Node a - | .inl v, x => (f.copy a (g * representative J f.Letters v)).toFun x - | .inr c, x => (f.placedTile a (g * c.1) c.2).toFun x - -theorem translationValue_copy (g w : External J f.Letters) (x : A) : - f.translationValue a g (.inl (point J f.Letters w)) ((a.chart w).toFun x) = - (f.copy a (g * w)).toFun x := by - change (f.copy a (g * representative J f.Letters (point J f.Letters w))).toFun - ((a.iso (coordinate J f.Letters w)).toFun x) = _ - rw [← f.copy_coordinate, mul_assoc, coordinate_spec] - -theorem translation_stem (g w : External J f.Letters) (r : R) : - (f.diagram a).Equation (f.translationValue a g) (.inl (w, r), true) := by - intro x - change f.translationValue a g (.inl (point J f.Letters w)) x.val = - (f.placedTile a (g * w) r).toFun ((f.tile r).root.toFun ((a.chart w).inverse x.val)) - rw [f.root_identification] - have eq := f.translationValue_copy a g w ((a.chart w).inverse x.val) - erw [(a.chart w).right_inverse] at eq - exact eq - -theorem translation_branch (g w : External J f.Letters) (r : R) (j : f.Child r) : - (f.diagram a).Equation (f.translationValue a g) (.inr (w, ⟨r, j⟩), true) := by - intro x - let i := f.vertexIdealIso ((f.tile r).child j) - obtain ⟨y, rfl⟩ : ∃ y, i.toFun y = x := ⟨i.inverse x, i.right_inverse x⟩ - change (f.placedTile a (g * w) r).toFun (((f.tile r).child j).toFun y) = - f.translationValue a g (.inl (point J f.Letters (w * generator J f.Letters ⟨r, j⟩))) - ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val - have formula : ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val = - (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun y := f.branch_formula a w r j y - rw [formula, f.translationValue_copy, ← mul_assoc] - exact f.child_identification a (g * w) r j y - -theorem translation_edges (g : External J f.Letters) (d : TileStars.Dart J f.Letters R) : - (f.diagram a).Equation (f.translationValue a g) d := by - rcases d with ⟨e, b⟩ - have forward : (f.diagram a).Equation (f.translationValue a g) (e, true) := by - cases e with - | inl c => exact f.translation_stem a g c.1 c.2 - | inr c => exact f.translation_branch a g c.1 c.2.1 c.2.2 - cases b - · exact (f.diagram a).equation_of_reverse (f.translationValue a g) (e, false) forward - · exact forward - -noncomputable def translate (g : External J f.Letters) : f.Node a → f.Node a := - (f.diagram a).descend (f.translationValue a g) (f.translation_edges a g) - -theorem translate_vertex (g : External J f.Letters) (v : TileStars.Vertex J f.Letters R) - (x : f.Space v) : - f.translate a g (((f.diagram a).vertex v).toFun x) = f.translationValue a g v x := - (f.diagram a).descend_vertex (f.translationValue a g) (f.translation_edges a g) v x - -theorem translate_copy (g w : External J f.Letters) (x : A) : - f.translate a g ((f.copy a w).toFun x) = (f.copy a (g * w)).toFun x := by - change f.translate a g (((f.diagram a).vertex (.inl (point J f.Letters w))).toFun - ((a.chart w).toFun x)) = _ - erw [f.translate_vertex, f.translationValue_copy] - -theorem translate_tile (g w : External J f.Letters) (r : R) (x : (f.tile r).Space) : - f.translate a g ((f.placedTile a w r).toFun x) = (f.placedTile a (g * w) r).toFun x := - f.translate_vertex a g (.inr (w, r)) x - -end TileRequests.Family - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.IncidenceQuotient + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +namespace TileRequests.Family + +open Attachment CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +def fullIdeal : MeetIso (idealOrder P f.top) P where + toFun := Subtype.val + le_iff _ _ := Iff.rfl + map_meet _ _ := rfl + inverse x := ⟨x, f.greatest x⟩ + left_inverse _ := rfl + right_inverse _ := rfl + +noncomputable def vertexIdealIso {B : Type u} {Q : MeetOrder B} (i : IdealEmbedding P Q) : + MeetIso P (idealOrder Q (i.toFun f.top)) := + RootedGluing.chainIso (inverseIso f.fullIdeal) (i.principalIso f.top) + +def Space : TileStars.Vertex J f.Letters R → Type u + | .inl _ => A + | .inr c => (f.tile c.2).Space + +noncomputable def localOrder : (v : TileStars.Vertex J f.Letters R) → MeetOrder (f.Space v) + | .inl _ => P + | .inr c => (f.tile c.2).order + +noncomputable def leftAnchor (e : TileStars.Edge J f.Letters R) : + f.Space (TileStars.source J f.Letters R Sigma.fst (e, true)) := by + cases e with + | inl c => exact f.top + | inr e => exact ((f.tile e.2.1).child e.2.2).toFun f.top + +noncomputable def rightAnchor (e : TileStars.Edge J f.Letters R) : + f.Space (TileStars.target J f.Letters R Sigma.fst (e, true)) := by + cases e with + | inl c => exact (f.tile c.2).root.toFun f.top + | inr e => exact f.top + +noncomputable def edgeOverlap (e : TileStars.Edge J f.Letters R) : MeetIso + (idealOrder (f.localOrder (TileStars.source J f.Letters R Sigma.fst (e, true))) (f.leftAnchor e)) + (idealOrder (f.localOrder (TileStars.target J f.Letters R Sigma.fst (e, true))) (f.rightAnchor e)) := by + cases e with + | inl c => + exact RootedGluing.chainIso f.fullIdeal (RootedGluing.chainIso + (inverseIso (a.chart c.1)) (f.vertexIdealIso (f.tile c.2).root)) + | inr e => + exact RootedGluing.chainIso (inverseIso (f.vertexIdealIso ((f.tile e.2.1).child e.2.2))) + (RootedGluing.chainIso (a.chart (e.1 * generator J f.Letters e.2)) (inverseIso f.fullIdeal)) + +noncomputable def diagram : TileStars.Spaces J f.Letters R Sigma.fst where + Space := f.Space + order := f.localOrder + leftAnchor := f.leftAnchor + rightAnchor := f.rightAnchor + overlap := f.edgeOverlap a + +def Node := (f.diagram a).Node +noncomputable def gluedOrder : MeetOrder (f.Node a) := (f.diagram a).gluedOrder + +noncomputable def copy (w : External J f.Letters) : IdealEmbedding P (f.gluedOrder a) := + (a.ideal (coordinate J f.Letters w)).comp ((f.diagram a).vertex (.inl (point J f.Letters w))) + +noncomputable def placedTile (w : External J f.Letters) (r : R) : + IdealEmbedding (f.tile r).order (f.gluedOrder a) := (f.diagram a).vertex (.inr (w, r)) + +theorem copy_coordinate (w : External J f.Letters) (j : J) (x : A) : + (f.copy a (w * old J f.Letters j)).toFun x = (f.copy a w).toFun ((a.iso j).toFun x) := by + change ((f.diagram a).vertex (.inl (point J f.Letters (w * old J f.Letters j)))).toFun + ((a.chart (w * old J f.Letters j)).toFun x) = _ + rw [point_mul_old, a.chart_mul_old] + rfl + +theorem copy_one (x : A) : (f.copy a 1).toFun x = + ((f.diagram a).vertex (.inl (root J f.Letters))).toFun x := by + change ((f.diagram a).vertex (.inl (root J f.Letters))).toFun ((a.chart 1).toFun x) = _ + rw [a.chart_one] + +theorem stem_formula (w : External J f.Letters) (r : R) (x : A) : + ((f.edgeOverlap a (.inl (w, r))).toFun ⟨(a.chart w).toFun x, f.greatest _⟩).val = + (f.tile r).root.toFun x := by + change (f.tile r).root.toFun ((a.chart w).inverse ((a.chart w).toFun x)) = _ + rw [(a.chart w).left_inverse] + +theorem branch_formula (w : External J f.Letters) (r : R) (j : f.Child r) (x : A) : + ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun + ⟨((f.tile r).child j).toFun x, (((f.tile r).child j).le_iff _ _).mpr (f.greatest x)⟩).val = + (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun x := by + have inv := (f.vertexIdealIso ((f.tile r).child j)).left_inverse x + change (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun + ((f.vertexIdealIso ((f.tile r).child j)).inverse + ((f.vertexIdealIso ((f.tile r).child j)).toFun x)) = _ + rw [inv] + +theorem root_identification (w : External J f.Letters) (r : R) (x : A) : + (f.placedTile a w r).toFun ((f.tile r).root.toFun x) = (f.copy a w).toFun x := by + have eq := (f.diagram a).edge_identification (.inl (w, r), true) + ⟨(a.chart w).toFun x, f.greatest _⟩ + change (f.copy a w).toFun x = (f.placedTile a w r).toFun + ((f.edgeOverlap a (.inl (w, r))).toFun ⟨(a.chart w).toFun x, f.greatest _⟩).val at eq + rw [f.stem_formula] at eq + exact eq.symm + +theorem child_identification (w : External J f.Letters) (r : R) (j : f.Child r) (x : A) : + (f.placedTile a w r).toFun (((f.tile r).child j).toFun x) = + (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x := by + have eq := (f.diagram a).edge_identification (.inr (w, ⟨r, j⟩), true) + ⟨((f.tile r).child j).toFun x, (((f.tile r).child j).le_iff _ _).mpr (f.greatest x)⟩ + change (f.placedTile a w r).toFun (((f.tile r).child j).toFun x) = + ((f.diagram a).vertex (.inl (point J f.Letters (w * generator J f.Letters ⟨r, j⟩)))).toFun + ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun + ⟨((f.tile r).child j).toFun x, (((f.tile r).child j).le_iff _ _).mpr (f.greatest x)⟩).val at eq + rw [f.branch_formula] at eq + exact eq + +theorem copy_principal (w : External J f.Letters) (z : f.Node a) : + (f.gluedOrder a).le z ((f.copy a w).toFun f.top) ↔ ∃ x, (f.copy a w).toFun x = z := + (f.copy a w).principal f.top f.greatest z + +theorem copy_greatest_part (w : External J f.Letters) (z : f.Node a) (x : A) : + (f.gluedOrder a).le ((f.copy a w).toFun x) z ↔ + P.le x ((f.copy a w).projection f.top z) := + (f.copy a w).greatest_part f.top f.greatest z x + +theorem copy_cover (z : f.Node a) : ∃ w x, (f.copy a w).toFun x = z := by + rcases (f.diagram a).cover z with ⟨v, x, rfl⟩ + cases v with + | inl v => + refine ⟨representative J f.Letters v, (a.chart (representative J f.Letters v)).inverse x, ?_⟩ + change ((f.diagram a).vertex (.inl (point J f.Letters (representative J f.Letters v)))).toFun + ((a.chart (representative J f.Letters v)).toFun + ((a.chart (representative J f.Letters v)).inverse x)) = _ + erw [(a.chart (representative J f.Letters v)).right_inverse, representative_spec] + | inr c => + rcases (f.tile c.2).cover x with ⟨y, rfl⟩ | ⟨j, y, rfl⟩ + · exact ⟨c.1, y, (f.root_identification a c.1 c.2 y).symm⟩ + · exact ⟨c.1 * generator J f.Letters ⟨c.2, j⟩, y, + (f.child_identification a c.1 c.2 j y).symm⟩ + +theorem comparison_in_copy (x y : f.Node a) (h : (f.gluedOrder a).le x y) : + ∃ w b c, (f.copy a w).toFun b = x ∧ (f.copy a w).toFun c = y ∧ P.le b c := by + rcases f.copy_cover a y with ⟨w, c, rfl⟩ + rcases (f.copy a w).ideal c x h with ⟨b, rfl⟩ + exact ⟨w, b, c, rfl, rfl, ((f.copy a w).le_iff b c).mp h⟩ + +theorem copy_injective (w : External J f.Letters) (x y : A) : + (f.copy a w).toFun x = (f.copy a w).toFun y ↔ x = y := by + constructor + · exact embedding_injective (f.copy a w).toMeetEmbedding + · exact congrArg (f.copy a w).toFun + +end TileRequests.Family + + + +namespace TileRequests + +open Attachment CosetGeometry +universe u +variable {A J : Type u} [Group J] {P : MeetOrder A} + +namespace Family +variable {R : Type u} (f : Family P R) (a : OrderAction J P) + +theorem transfer_child_root (w : External J f.Letters) (r : R) (j : f.Child r) (x y : A) + (h : ((f.tile r).child j).toFun x = (f.tile r).root.toFun y) : + (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x = (f.copy a w).toFun y := by + rw [← f.child_identification, ← f.root_identification, h] + +theorem transfer_child_root_meet (w : External J f.Letters) (r : R) (j : f.Child r) (x y z : A) + (h : (f.tile r).order.meet (((f.tile r).child j).toFun x) ((f.tile r).root.toFun y) = + (f.tile r).root.toFun z) : + (f.gluedOrder a).meet ((f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x) + ((f.copy a w).toFun y) = (f.copy a w).toFun z := by + rw [← f.child_identification, ← f.root_identification, ← f.root_identification, + ← (f.placedTile a w r).map_meet, h] + +theorem transfer_child_child_meet (w : External J f.Letters) (r : R) + (j k : f.Child r) (x y z : A) + (h : (f.tile r).order.meet (((f.tile r).child j).toFun x) (((f.tile r).child k).toFun y) = + ((f.tile r).child j).toFun z) : + (f.gluedOrder a).meet ((f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x) + ((f.copy a (w * generator J f.Letters ⟨r, k⟩)).toFun y) = + (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun z := by + rw [← f.child_identification, ← f.child_identification, ← f.child_identification, + ← (f.placedTile a w r).map_meet, h] + +end Family + +namespace AllGeometry +variable (T : A) (greatest : ∀ x, P.le x T) (a : OrderAction J P) + +noncomputable abbrev family : Family P (Request P) := Family.all T greatest +abbrev Letters := (family T greatest).Letters + +theorem separation_fixes (w : External J (Letters T greatest)) (W x : A) (below : P.le x W) : + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.separation W, ⟨()⟩⟩)).toFun x = + ((family T greatest).copy a w).toFun x := + (family T greatest).transfer_child_root a w (.separation W) ⟨()⟩ x x + (Request.separation_agrees T greatest W x below) + +theorem separation_meet (w : External J (Letters T greatest)) (W D X : A) + (belowD : P.le W D) (belowX : P.le W X) : + ((family T greatest).gluedOrder a).meet + (((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.separation W, ⟨()⟩⟩)).toFun D) + (((family T greatest).copy a w).toFun X) = ((family T greatest).copy a w).toFun W := + (family T greatest).transfer_child_root_meet a w (.separation W) ⟨()⟩ D X W + (BinaryTiles.separation_cross_meet P W D X belowD belowX) + +theorem compression_restriction (w : External J (Letters T greatest)) (K : A) + (S : MeetIso P (idealOrder P K)) (x : A) : + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.compression K S, ⟨()⟩⟩)).toFun x = + ((family T greatest).copy a w).toFun (S.toFun x).val := + (family T greatest).transfer_child_root a w (.compression K S) ⟨()⟩ x (S.toFun x).val + (Request.compression_agrees T greatest K S x) + +theorem compression_top (w : External J (Letters T greatest)) (K : A) + (S : MeetIso P (idealOrder P K)) : + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.compression K S, ⟨()⟩⟩)).toFun T = + ((family T greatest).copy a w).toFun K := + (family T greatest).transfer_child_root a w (.compression K S) ⟨()⟩ T K + (BinaryTiles.compression_top P T K greatest S) + +theorem rectangle_first_agrees (w : External J (Letters T greatest)) (r : Rectangle.Input P) + (x : A) (below : P.le x r.C) : + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun x = + ((family T greatest).copy a w).toFun (r.g1.toFun x) := + (family T greatest).transfer_child_root a w (.rectangle r) ⟨false⟩ x (r.g1.toFun x) + (r.first_agrees x below) + +theorem rectangle_second_agrees (w : External J (Letters T greatest)) (r : Rectangle.Input P) + (x : A) (below : P.le x r.C) : + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun x = + ((family T greatest).copy a w).toFun (r.g2.toFun x) := + (family T greatest).transfer_child_root a w (.rectangle r) ⟨true⟩ x (r.g2.toFun x) + (r.second_agrees x below) + +theorem rectangle_children_intersection (w : External J (Letters T greatest)) + (r : Rectangle.Input P) (x y : A) : + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun x = + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun y ↔ + P.le x r.B ∧ x = y := by + erw [← (family T greatest).child_identification, ← (family T greatest).child_identification] + constructor + · intro h + exact (r.children_intersection x y).mp + (embedding_injective ((family T greatest).placedTile a w (.rectangle r)).toMeetEmbedding h) + · intro h + exact congrArg ((family T greatest).placedTile a w (.rectangle r)).toFun + ((r.children_intersection x y).mpr h) + +theorem rectangle_first_meet_root (w : External J (Letters T greatest)) + (r : Rectangle.Input P) (x : A) : + ((family T greatest).gluedOrder a).meet + (((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun r.D) + (((family T greatest).copy a w).toFun x) = + ((family T greatest).copy a w).toFun (P.meet (r.g1.toFun r.C) x) := + (family T greatest).transfer_child_root_meet a w (.rectangle r) ⟨false⟩ r.D x _ + (r.first_meet_root x) + +theorem rectangle_second_meet_root (w : External J (Letters T greatest)) + (r : Rectangle.Input P) (x : A) : + ((family T greatest).gluedOrder a).meet + (((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun r.D) + (((family T greatest).copy a w).toFun x) = + ((family T greatest).copy a w).toFun (P.meet (r.g2.toFun r.C) x) := + (family T greatest).transfer_child_root_meet a w (.rectangle r) ⟨true⟩ r.D x _ + (r.second_meet_root x) + +theorem rectangle_children_meet (w : External J (Letters T greatest)) (r : Rectangle.Input P) : + ((family T greatest).gluedOrder a).meet + (((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun r.D) + (((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨true⟩⟩)).toFun r.D) = + ((family T greatest).copy a + (w * generator J (Letters T greatest) ⟨.rectangle r, ⟨false⟩⟩)).toFun r.B := + (family T greatest).transfer_child_child_meet a w (.rectangle r) ⟨false⟩ ⟨true⟩ r.D r.D r.B + r.children_meet + +end AllGeometry + +end TileRequests + + + +namespace CosetGeometry.TileStars.Spaces + +universe u +variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) +variable {B : Type u} (value : ∀ v, g.Space v → B) +variable (edges : ∀ d, g.Equation value d) + +include edges in +theorem values_respect_parents {x y : g.scheme.Label} (h : g.scheme.Related x y) : + value x.1 x.2 = value y.1 y.2 := by + induction h with + | parent v hv x => exact g.parents_of_equations value edges v hv x + | refl => rfl + | symm h ih => exact ih.symm + | trans h1 h2 ih1 ih2 => exact ih1.trans ih2 + +noncomputable def descend (z : g.Node) : B := + Quotient.lift (fun x => value x.1 x.2) + (fun _ _ h => g.values_respect_parents value edges h) (g.scheme.toGenerated z) + +theorem descend_vertex (v : Vertex J S R) (x : g.Space v) : + g.descend value edges ((g.vertex v).toFun x) = value v x := by + change Quotient.lift _ _ (g.scheme.toGenerated ((g.scheme.vertex v).toFun x)) = _ + erw [g.scheme.toGenerated_vertex] + rfl + +theorem descend_unique (h : g.Node → B) (vertices : ∀ v x, h ((g.vertex v).toFun x) = value v x) : + h = g.descend value edges := by + funext z + rcases g.cover z with ⟨v, x, rfl⟩ + exact (vertices v x).trans (g.descend_vertex value edges v x).symm + +end CosetGeometry.TileStars.Spaces + + + +namespace TileRequests.Family + +open Attachment CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +noncomputable def translationValue (g : External J f.Letters) : + (v : TileStars.Vertex J f.Letters R) → f.Space v → f.Node a + | .inl v, x => (f.copy a (g * representative J f.Letters v)).toFun x + | .inr c, x => (f.placedTile a (g * c.1) c.2).toFun x + +theorem translationValue_copy (g w : External J f.Letters) (x : A) : + f.translationValue a g (.inl (point J f.Letters w)) ((a.chart w).toFun x) = + (f.copy a (g * w)).toFun x := by + change (f.copy a (g * representative J f.Letters (point J f.Letters w))).toFun + ((a.iso (coordinate J f.Letters w)).toFun x) = _ + rw [← f.copy_coordinate, mul_assoc, coordinate_spec] + +theorem translation_stem (g w : External J f.Letters) (r : R) : + (f.diagram a).Equation (f.translationValue a g) (.inl (w, r), true) := by + intro x + change f.translationValue a g (.inl (point J f.Letters w)) x.val = + (f.placedTile a (g * w) r).toFun ((f.tile r).root.toFun ((a.chart w).inverse x.val)) + rw [f.root_identification] + have eq := f.translationValue_copy a g w ((a.chart w).inverse x.val) + erw [(a.chart w).right_inverse] at eq + exact eq + +theorem translation_branch (g w : External J f.Letters) (r : R) (j : f.Child r) : + (f.diagram a).Equation (f.translationValue a g) (.inr (w, ⟨r, j⟩), true) := by + intro x + let i := f.vertexIdealIso ((f.tile r).child j) + obtain ⟨y, rfl⟩ : ∃ y, i.toFun y = x := ⟨i.inverse x, i.right_inverse x⟩ + change (f.placedTile a (g * w) r).toFun (((f.tile r).child j).toFun y) = + f.translationValue a g (.inl (point J f.Letters (w * generator J f.Letters ⟨r, j⟩))) + ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val + have formula : ((f.edgeOverlap a (.inr (w, ⟨r, j⟩))).toFun (i.toFun y)).val = + (a.chart (w * generator J f.Letters ⟨r, j⟩)).toFun y := f.branch_formula a w r j y + rw [formula, f.translationValue_copy, ← mul_assoc] + exact f.child_identification a (g * w) r j y + +theorem translation_edges (g : External J f.Letters) (d : TileStars.Dart J f.Letters R) : + (f.diagram a).Equation (f.translationValue a g) d := by + rcases d with ⟨e, b⟩ + have forward : (f.diagram a).Equation (f.translationValue a g) (e, true) := by + cases e with + | inl c => exact f.translation_stem a g c.1 c.2 + | inr c => exact f.translation_branch a g c.1 c.2.1 c.2.2 + cases b + · exact (f.diagram a).equation_of_reverse (f.translationValue a g) (e, false) forward + · exact forward + +noncomputable def translate (g : External J f.Letters) : f.Node a → f.Node a := + (f.diagram a).descend (f.translationValue a g) (f.translation_edges a g) + +theorem translate_vertex (g : External J f.Letters) (v : TileStars.Vertex J f.Letters R) + (x : f.Space v) : + f.translate a g (((f.diagram a).vertex v).toFun x) = f.translationValue a g v x := + (f.diagram a).descend_vertex (f.translationValue a g) (f.translation_edges a g) v x + +theorem translate_copy (g w : External J f.Letters) (x : A) : + f.translate a g ((f.copy a w).toFun x) = (f.copy a (g * w)).toFun x := by + change f.translate a g (((f.diagram a).vertex (.inl (point J f.Letters w))).toFun + ((a.chart w).toFun x)) = _ + erw [f.translate_vertex, f.translationValue_copy] + +theorem translate_tile (g w : External J f.Letters) (r : R) (x : (f.tile r).Space) : + f.translate a g ((f.placedTile a w r).toFun x) = (f.placedTile a (g * w) r).toFun x := + f.translate_vertex a g (.inr (w, r)) x + +end TileRequests.Family + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalProfilePersistence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalProfilePersistence.lean index a6a3891325fecc1409f101ce39c46843cfe5400f..f50d9c81a0b9186b25e76c90cae41110e356adc8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalProfilePersistence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalProfilePersistence.lean @@ -1,157 +1,157 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthExtensions - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open CountableColumns RationalHeights -variable (Label : Type 1) -local instance : Nonempty Column := ⟨natural 0⟩ - -noncomputable def FinalPoint : Type 1 := (diagram Label).orders.system.Union -noncomputable def FinalActor : Type 1 := (diagram Label).groups.system.Union - -noncomputable instance finalGroup : Group (FinalActor Label) := - inferInstanceAs (Group (diagram Label).groups.system.Union) - -noncomputable def finalOrder : MeetOrder (FinalPoint Label) := (diagram Label).orders.unionOrder - -noncomputable def finalAction : CosetGeometry.OrderAction (FinalActor Label) (finalOrder Label) := - (diagram Label).actions.unionAction - -noncomputable def finalHeight : StrictHeight (finalOrder Label) - (lexOrder CountableColumns.order).toHeightOrder := (diagram Label).heights.unionHeight - -noncomputable def finalBottom : FinalPoint Label := (diagram Label).unionBottom - -theorem finalBottom_least (x : FinalPoint Label) : (finalOrder Label).le (finalBottom Label) x := - (diagram Label).unionBottom_least x - -noncomputable def finalInclusion (a : Column) : MeetEmbedding (stage Label a).order (finalOrder Label) := - (diagram Label).orders.inclusion a - -noncomputable def finalGroupInclusion (a : Column) : (stage Label a).Actor →* FinalActor Label := - (diagram Label).groups.inclusion a - -theorem finalGroupInclusion_injective (a : Column) : Function.Injective (finalGroupInclusion Label a) := - (diagram Label).groups.inclusion_injective a - -theorem final_points_coherent {a b : Column} (h : a ≤ b) (x : (stage Label a).Point) : - (finalInclusion Label b).toFun ((transition Label h).points.toFun x) = - (finalInclusion Label a).toFun x := (diagram Label).orders.system.point_map h x - -theorem final_actors_coherent {a b : Column} (h : a ≤ b) (g : (stage Label a).Actor) : - finalGroupInclusion Label b ((transition Label h).actors g) = finalGroupInclusion Label a g := - (diagram Label).groups.system.point_map h g - -theorem final_point_cover (x : FinalPoint Label) : ∃ a y, (finalInclusion Label a).toFun y = x := - (diagram Label).orders.system.cover x - -theorem final_actor_cover (g : FinalActor Label) : ∃ a h, finalGroupInclusion Label a h = g := - (diagram Label).groups.system.cover g - -theorem final_height_stage (a : Column) (x : (stage Label a).Point) : - (finalHeight Label).value ((finalInclusion Label a).toFun x) = (stage Label a).height.value x := rfl - -theorem final_action_stage (a : Column) (g : (stage Label a).Actor) (x : (stage Label a).Point) : - ((finalAction Label).iso (finalGroupInclusion Label a g)).toFun ((finalInclusion Label a).toFun x) = - (finalInclusion Label a).toFun (((stage Label a).action.iso g).toFun x) := - (diagram Label).actions.act_point a g x - -theorem final_agreement (a : Column) (g k : (stage Label a).Actor) (v : (stage Label a).Point) - (agree : ∀ x, (stage Label a).order.le x v → - ((stage Label a).action.iso g).toFun x = ((stage Label a).action.iso k).toFun x) - (x : FinalPoint Label) (lower : (finalOrder Label).le x ((finalInclusion Label a).toFun v)) : - ((finalAction Label).iso (finalGroupInclusion Label a g)).toFun x = - ((finalAction Label).iso (finalGroupInclusion Label a k)).toFun x := - (diagram Label).actions.union_agreement (diagram Label).agreements a g k v agree x lower - -theorem final_no_maximal (x : FinalPoint Label) : - ∃ y, (finalOrder Label).le x y ∧ ¬ (finalOrder Label).le y x := by - rcases final_point_cover Label x with ⟨a, x, rfl⟩ - let b := start a - have h : a < b := lt_start a - refine ⟨(finalInclusion Label b).toFun (stage Label b).top, ?_, ?_⟩ - · rw [← final_points_coherent Label h.le x] - exact ((finalInclusion Label b).le_iff _ _).mpr ((stage Label b).greatest _) - · intro lower - rw [← final_points_coherent Label h.le x] at lower - exact strict_top Label h x (((finalInclusion Label b).le_iff _ _).mp lower) - -theorem final_no_greatest : ¬ ∃ top : FinalPoint Label, ∀ x, (finalOrder Label).le x top := by - rintro ⟨top, greatest⟩ - rcases final_no_maximal Label top with ⟨y, _, strict⟩ - exact strict (greatest y) - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -end - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -universe u - -theorem Transition.preservesProfiles_transport {s t t' : MainStage.{u}} - (f : Transition s t) (eq : t = t') : - PreservesProfiles (f.transport rfl eq).points ↔ PreservesProfiles f.points := by - cases eq - rfl - -open CountableColumns - -theorem ordinalStep_preservesProfiles (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (preserves : ∀ {i j} (h : i ≤ j), PreservesProfiles (d.transition h).points) - (i : Set.Iio a) : PreservesProfiles ((ordinalStep Label a d).leg i).points := by - classical - have inhabited : Nonempty (Set.Iio a) := ⟨i⟩ - by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last - · have eq : ordinalStep Label a d = - (d.lastCone hasLast.choose hasLast.choose_spec).extend (d := d) - ((d.stage hasLast.choose).nextTransition Label) := - (dite_eq_left inhabited).trans (dite_eq_left hasLast) - rw [eq] - exact preservesProfiles_comp (d.transition (hasLast.choose_spec i)).points - ((d.stage hasLast.choose).nextTransition Label).points - (preserves (hasLast.choose_spec i)) ((d.stage hasLast.choose).next_preservesProfiles Label) - · let := inhabited - have eq : ordinalStep Label a d = d.limitCone := - (dite_eq_left inhabited).trans (dite_eq_right hasLast) - rw [eq] - exact d.limit_preservesProfiles preserves i - -namespace OrdinalRun -variable (Label : Type 1) - -theorem transition_preservesProfiles_at (b : Column) : - ∀ a (h : a ≤ b), PreservesProfiles (transition Label h).points := by - refine (show WellFounded ((· < ·) : Column → Column → Prop) from wellFounded_lt).induction - (C := fun b => ∀ a (h : a ≤ b), PreservesProfiles (transition Label h).points) b ?_ - intro b ih a h - rcases lt_or_eq_of_le h with lower | rfl - · apply (Transition.preservesProfiles_transport (transition Label h) - (Transfinite.stage_generated (ordinalStep Label) b)).mp - have maps : (transition Label h).transport rfl - (Transfinite.stage_generated (ordinalStep Label) b) = - (ordinalStep Label b (before Label b)).leg ⟨a, lower⟩ := - Transfinite.transition_generated (ordinalStep Label) b ⟨a, lower⟩ - rw [maps] - exact ordinalStep_preservesProfiles Label b (before Label b) - (fun {_ j} hj => ih j.val j.property _ hj) ⟨a, lower⟩ - · rw [transition_self] - exact preservesProfiles_identity (stage Label a).order - -theorem final_preservesProfiles (a : Column) : PreservesProfiles (finalInclusion Label a) := - (diagram Label).union_preservesProfiles - (fun {_ j} h => transition_preservesProfiles_at Label j _ h) a - -end OrdinalRun - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthExtensions + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open CountableColumns RationalHeights +variable (Label : Type 1) +local instance : Nonempty Column := ⟨natural 0⟩ + +noncomputable def FinalPoint : Type 1 := (diagram Label).orders.system.Union +noncomputable def FinalActor : Type 1 := (diagram Label).groups.system.Union + +noncomputable instance finalGroup : Group (FinalActor Label) := + inferInstanceAs (Group (diagram Label).groups.system.Union) + +noncomputable def finalOrder : MeetOrder (FinalPoint Label) := (diagram Label).orders.unionOrder + +noncomputable def finalAction : CosetGeometry.OrderAction (FinalActor Label) (finalOrder Label) := + (diagram Label).actions.unionAction + +noncomputable def finalHeight : StrictHeight (finalOrder Label) + (lexOrder CountableColumns.order).toHeightOrder := (diagram Label).heights.unionHeight + +noncomputable def finalBottom : FinalPoint Label := (diagram Label).unionBottom + +theorem finalBottom_least (x : FinalPoint Label) : (finalOrder Label).le (finalBottom Label) x := + (diagram Label).unionBottom_least x + +noncomputable def finalInclusion (a : Column) : MeetEmbedding (stage Label a).order (finalOrder Label) := + (diagram Label).orders.inclusion a + +noncomputable def finalGroupInclusion (a : Column) : (stage Label a).Actor →* FinalActor Label := + (diagram Label).groups.inclusion a + +theorem finalGroupInclusion_injective (a : Column) : Function.Injective (finalGroupInclusion Label a) := + (diagram Label).groups.inclusion_injective a + +theorem final_points_coherent {a b : Column} (h : a ≤ b) (x : (stage Label a).Point) : + (finalInclusion Label b).toFun ((transition Label h).points.toFun x) = + (finalInclusion Label a).toFun x := (diagram Label).orders.system.point_map h x + +theorem final_actors_coherent {a b : Column} (h : a ≤ b) (g : (stage Label a).Actor) : + finalGroupInclusion Label b ((transition Label h).actors g) = finalGroupInclusion Label a g := + (diagram Label).groups.system.point_map h g + +theorem final_point_cover (x : FinalPoint Label) : ∃ a y, (finalInclusion Label a).toFun y = x := + (diagram Label).orders.system.cover x + +theorem final_actor_cover (g : FinalActor Label) : ∃ a h, finalGroupInclusion Label a h = g := + (diagram Label).groups.system.cover g + +theorem final_height_stage (a : Column) (x : (stage Label a).Point) : + (finalHeight Label).value ((finalInclusion Label a).toFun x) = (stage Label a).height.value x := rfl + +theorem final_action_stage (a : Column) (g : (stage Label a).Actor) (x : (stage Label a).Point) : + ((finalAction Label).iso (finalGroupInclusion Label a g)).toFun ((finalInclusion Label a).toFun x) = + (finalInclusion Label a).toFun (((stage Label a).action.iso g).toFun x) := + (diagram Label).actions.act_point a g x + +theorem final_agreement (a : Column) (g k : (stage Label a).Actor) (v : (stage Label a).Point) + (agree : ∀ x, (stage Label a).order.le x v → + ((stage Label a).action.iso g).toFun x = ((stage Label a).action.iso k).toFun x) + (x : FinalPoint Label) (lower : (finalOrder Label).le x ((finalInclusion Label a).toFun v)) : + ((finalAction Label).iso (finalGroupInclusion Label a g)).toFun x = + ((finalAction Label).iso (finalGroupInclusion Label a k)).toFun x := + (diagram Label).actions.union_agreement (diagram Label).agreements a g k v agree x lower + +theorem final_no_maximal (x : FinalPoint Label) : + ∃ y, (finalOrder Label).le x y ∧ ¬ (finalOrder Label).le y x := by + rcases final_point_cover Label x with ⟨a, x, rfl⟩ + let b := start a + have h : a < b := lt_start a + refine ⟨(finalInclusion Label b).toFun (stage Label b).top, ?_, ?_⟩ + · rw [← final_points_coherent Label h.le x] + exact ((finalInclusion Label b).le_iff _ _).mpr ((stage Label b).greatest _) + · intro lower + rw [← final_points_coherent Label h.le x] at lower + exact strict_top Label h x (((finalInclusion Label b).le_iff _ _).mp lower) + +theorem final_no_greatest : ¬ ∃ top : FinalPoint Label, ∀ x, (finalOrder Label).le x top := by + rintro ⟨top, greatest⟩ + rcases final_no_maximal Label top with ⟨y, _, strict⟩ + exact strict (greatest y) + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +end + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +universe u + +theorem Transition.preservesProfiles_transport {s t t' : MainStage.{u}} + (f : Transition s t) (eq : t = t') : + PreservesProfiles (f.transport rfl eq).points ↔ PreservesProfiles f.points := by + cases eq + rfl + +open CountableColumns + +theorem ordinalStep_preservesProfiles (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (preserves : ∀ {i j} (h : i ≤ j), PreservesProfiles (d.transition h).points) + (i : Set.Iio a) : PreservesProfiles ((ordinalStep Label a d).leg i).points := by + classical + have inhabited : Nonempty (Set.Iio a) := ⟨i⟩ + by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last + · have eq : ordinalStep Label a d = + (d.lastCone hasLast.choose hasLast.choose_spec).extend (d := d) + ((d.stage hasLast.choose).nextTransition Label) := + (dite_eq_left inhabited).trans (dite_eq_left hasLast) + rw [eq] + exact preservesProfiles_comp (d.transition (hasLast.choose_spec i)).points + ((d.stage hasLast.choose).nextTransition Label).points + (preserves (hasLast.choose_spec i)) ((d.stage hasLast.choose).next_preservesProfiles Label) + · let := inhabited + have eq : ordinalStep Label a d = d.limitCone := + (dite_eq_left inhabited).trans (dite_eq_right hasLast) + rw [eq] + exact d.limit_preservesProfiles preserves i + +namespace OrdinalRun +variable (Label : Type 1) + +theorem transition_preservesProfiles_at (b : Column) : + ∀ a (h : a ≤ b), PreservesProfiles (transition Label h).points := by + refine (show WellFounded ((· < ·) : Column → Column → Prop) from wellFounded_lt).induction + (C := fun b => ∀ a (h : a ≤ b), PreservesProfiles (transition Label h).points) b ?_ + intro b ih a h + rcases lt_or_eq_of_le h with lower | rfl + · apply (Transition.preservesProfiles_transport (transition Label h) + (Transfinite.stage_generated (ordinalStep Label) b)).mp + have maps : (transition Label h).transport rfl + (Transfinite.stage_generated (ordinalStep Label) b) = + (ordinalStep Label b (before Label b)).leg ⟨a, lower⟩ := + Transfinite.transition_generated (ordinalStep Label) b ⟨a, lower⟩ + rw [maps] + exact ordinalStep_preservesProfiles Label b (before Label b) + (fun {_ j} hj => ih j.val j.property _ hj) ⟨a, lower⟩ + · rw [transition_self] + exact preservesProfiles_identity (stage Label a).order + +theorem final_preservesProfiles (a : Column) : PreservesProfiles (finalInclusion Label a) := + (diagram Label).union_preservesProfiles + (fun {_ j} h => transition_preservesProfiles_at Label j _ h) a + +end OrdinalRun + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalRectangles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalRectangles.lean index 1465e900ec629a80c6933cceff3fd4d742a2f1e0..c1f4870dbc0c8f73e6bdc61f9b036aeaf847b0d7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalRectangles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FinalRectangles.lean @@ -1,109 +1,109 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalRectangleStages - -namespace OAI - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -variable (Label : Type 1) - -theorem rectangle_data_in_stage - (r : ActionRectangle (finalOrder Label) (finalAction Label).iso) (X : FinalPoint Label) : - ∃ a, ∃ t : ActionRectangle (stage Label a).order (stage Label a).action.iso, - ∃ Y : (stage Label a).Point, - (finalInclusion Label a).toFun t.C = r.C ∧ - (finalInclusion Label a).toFun t.B = r.B ∧ - (finalInclusion Label a).toFun t.D = r.D ∧ - finalGroupInclusion Label a t.first = r.first ∧ - finalGroupInclusion Label a t.second = r.second ∧ - (finalInclusion Label a).toFun Y = X := by - let points (j : Bool × Bool) : FinalPoint Label := - if j.1 then (if j.2 then X else r.D) else (if j.2 then r.B else r.C) - let actors (j : Bool) : FinalActor Label := if j then r.second else r.first - rcases countable_data_in_stage Label points actors with ⟨a, hp, hg⟩ - obtain ⟨C, hC⟩ : ∃ C, (finalInclusion Label a).toFun C = r.C := hp (false, false) - obtain ⟨B, hB⟩ : ∃ B, (finalInclusion Label a).toFun B = r.B := hp (false, true) - obtain ⟨D, hD⟩ : ∃ D, (finalInclusion Label a).toFun D = r.D := hp (true, false) - obtain ⟨Y, hY⟩ : ∃ Y, (finalInclusion Label a).toFun Y = X := hp (true, true) - obtain ⟨g1, hg1⟩ : ∃ g, finalGroupInclusion Label a g = r.first := hg false - obtain ⟨g2, hg2⟩ : ∃ g, finalGroupInclusion Label a g = r.second := hg true - have cd : (stage Label a).order.le C D := by - apply ((finalInclusion Label a).le_iff _ _).mp - rw [hC, hD] - exact r.C_le_D - have bd : (stage Label a).order.le B D := by - apply ((finalInclusion Label a).le_iff _ _).mp - rw [hB, hD] - exact r.B_le_D - have agree : ∀ x, (stage Label a).order.le x ((stage Label a).order.meet C B) → - ((stage Label a).action.iso g1).toFun x = ((stage Label a).action.iso g2).toFun x := by - intro x lower - apply embedding_injective (finalInclusion Label a) - rw [← final_action_stage Label a g1 x, ← final_action_stage Label a g2 x, hg1, hg2] - apply r.agree - have h := ((finalInclusion Label a).le_iff _ _).mpr lower - rw [(finalInclusion Label a).map_meet, hC, hB] at h - exact h - have separated : (stage Label a).order.meet - (((stage Label a).action.iso g1).toFun D) (((stage Label a).action.iso g2).toFun D) = - ((stage Label a).action.iso g1).toFun ((stage Label a).order.meet C B) := by - apply embedding_injective (finalInclusion Label a) - rw [(finalInclusion Label a).map_meet, - ← final_action_stage Label a g1 D, ← final_action_stage Label a g2 D, - ← final_action_stage Label a g1 ((stage Label a).order.meet C B), - (finalInclusion Label a).map_meet, hC, hB, hD, hg1, hg2] - exact r.separated - exact ⟨a, ⟨C, B, D, g1, g2, cd, bd, agree, separated⟩, Y, hC, hB, hD, hg1, hg2, hY⟩ - -theorem final_rectangles - (r : ActionRectangle (finalOrder Label) (finalAction Label).iso) (X : FinalPoint Label) - (first_upper : (finalOrder Label).le (((finalAction Label).iso r.first).toFun r.D) X) - (second_upper : (finalOrder Label).le (((finalAction Label).iso r.second).toFun r.D) X) : - ∃ h1 h2 : FinalActor Label, - (∀ z, (finalOrder Label).le z r.C → - ((finalAction Label).iso h1).toFun z = ((finalAction Label).iso r.first).toFun z) ∧ - (∀ z, (finalOrder Label).le z r.C → - ((finalAction Label).iso h2).toFun z = ((finalAction Label).iso r.second).toFun z) ∧ - (∀ z, (finalOrder Label).le z r.B → - ((finalAction Label).iso h1).toFun z = ((finalAction Label).iso h2).toFun z) ∧ - (finalOrder Label).meet (((finalAction Label).iso h1).toFun r.D) X = - ((finalAction Label).iso r.first).toFun r.C ∧ - (finalOrder Label).meet (((finalAction Label).iso h2).toFun r.D) X = - ((finalAction Label).iso r.second).toFun r.C ∧ - (finalOrder Label).meet (((finalAction Label).iso h1).toFun r.D) - (((finalAction Label).iso h2).toFun r.D) = ((finalAction Label).iso h1).toFun r.B := by - rcases rectangle_data_in_stage Label r X with ⟨a, t, Y, hC, hB, hD, hg1, hg2, hY⟩ - rcases final_rectangles_at Label a t Y with ⟨h, agreeC, agreeB, rootMeet, pairMeet⟩ - have actors (j : Bool) : finalGroupInclusion Label a ((stage Label a).rectangleOldActor t j) = - if j then r.second else r.first := by - cases j with - | false => exact hg1 - | true => exact hg2 - have cAgree (j : Bool) (z : FinalPoint Label) (lower : (finalOrder Label).le z r.C) : - ((finalAction Label).iso (h j)).toFun z = - ((finalAction Label).iso (if j then r.second else r.first)).toFun z := by - have eq := agreeC j z (hC.symm ▸ lower) - rw [actors] at eq - exact eq - have mappedRoot (j : Bool) : - (finalInclusion Label a).toFun ((stage Label a).order.meet - (((stage Label a).action.iso ((stage Label a).rectangleOldActor t j)).toFun t.C) Y) = - ((finalAction Label).iso (if j then r.second else r.first)).toFun r.C := by - rw [(finalInclusion Label a).map_meet, ← final_action_stage, actors, hC, hY] - apply meet_eq_left_of_le - cases j with - | false => - exact (finalOrder Label).trans - ((((finalAction Label).iso r.first).le_iff _ _).mpr r.C_le_D) first_upper - | true => - exact (finalOrder Label).trans - ((((finalAction Label).iso r.second).le_iff _ _).mpr r.C_le_D) second_upper - refine ⟨h false, h true, cAgree false, cAgree true, ?_, ?_, ?_, ?_⟩ - · simpa only [hB] using agreeB - · simpa only [hD, hY, Bool.false_eq_true, ↓reduceIte] using - (rootMeet false).trans (mappedRoot false) - · simpa only [hD, hY, ↓reduceIte] using (rootMeet true).trans (mappedRoot true) - · simpa only [hD, hB] using pairMeet - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalRectangleStages + +namespace OAI + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +variable (Label : Type 1) + +theorem rectangle_data_in_stage + (r : ActionRectangle (finalOrder Label) (finalAction Label).iso) (X : FinalPoint Label) : + ∃ a, ∃ t : ActionRectangle (stage Label a).order (stage Label a).action.iso, + ∃ Y : (stage Label a).Point, + (finalInclusion Label a).toFun t.C = r.C ∧ + (finalInclusion Label a).toFun t.B = r.B ∧ + (finalInclusion Label a).toFun t.D = r.D ∧ + finalGroupInclusion Label a t.first = r.first ∧ + finalGroupInclusion Label a t.second = r.second ∧ + (finalInclusion Label a).toFun Y = X := by + let points (j : Bool × Bool) : FinalPoint Label := + if j.1 then (if j.2 then X else r.D) else (if j.2 then r.B else r.C) + let actors (j : Bool) : FinalActor Label := if j then r.second else r.first + rcases countable_data_in_stage Label points actors with ⟨a, hp, hg⟩ + obtain ⟨C, hC⟩ : ∃ C, (finalInclusion Label a).toFun C = r.C := hp (false, false) + obtain ⟨B, hB⟩ : ∃ B, (finalInclusion Label a).toFun B = r.B := hp (false, true) + obtain ⟨D, hD⟩ : ∃ D, (finalInclusion Label a).toFun D = r.D := hp (true, false) + obtain ⟨Y, hY⟩ : ∃ Y, (finalInclusion Label a).toFun Y = X := hp (true, true) + obtain ⟨g1, hg1⟩ : ∃ g, finalGroupInclusion Label a g = r.first := hg false + obtain ⟨g2, hg2⟩ : ∃ g, finalGroupInclusion Label a g = r.second := hg true + have cd : (stage Label a).order.le C D := by + apply ((finalInclusion Label a).le_iff _ _).mp + rw [hC, hD] + exact r.C_le_D + have bd : (stage Label a).order.le B D := by + apply ((finalInclusion Label a).le_iff _ _).mp + rw [hB, hD] + exact r.B_le_D + have agree : ∀ x, (stage Label a).order.le x ((stage Label a).order.meet C B) → + ((stage Label a).action.iso g1).toFun x = ((stage Label a).action.iso g2).toFun x := by + intro x lower + apply embedding_injective (finalInclusion Label a) + rw [← final_action_stage Label a g1 x, ← final_action_stage Label a g2 x, hg1, hg2] + apply r.agree + have h := ((finalInclusion Label a).le_iff _ _).mpr lower + rw [(finalInclusion Label a).map_meet, hC, hB] at h + exact h + have separated : (stage Label a).order.meet + (((stage Label a).action.iso g1).toFun D) (((stage Label a).action.iso g2).toFun D) = + ((stage Label a).action.iso g1).toFun ((stage Label a).order.meet C B) := by + apply embedding_injective (finalInclusion Label a) + rw [(finalInclusion Label a).map_meet, + ← final_action_stage Label a g1 D, ← final_action_stage Label a g2 D, + ← final_action_stage Label a g1 ((stage Label a).order.meet C B), + (finalInclusion Label a).map_meet, hC, hB, hD, hg1, hg2] + exact r.separated + exact ⟨a, ⟨C, B, D, g1, g2, cd, bd, agree, separated⟩, Y, hC, hB, hD, hg1, hg2, hY⟩ + +theorem final_rectangles + (r : ActionRectangle (finalOrder Label) (finalAction Label).iso) (X : FinalPoint Label) + (first_upper : (finalOrder Label).le (((finalAction Label).iso r.first).toFun r.D) X) + (second_upper : (finalOrder Label).le (((finalAction Label).iso r.second).toFun r.D) X) : + ∃ h1 h2 : FinalActor Label, + (∀ z, (finalOrder Label).le z r.C → + ((finalAction Label).iso h1).toFun z = ((finalAction Label).iso r.first).toFun z) ∧ + (∀ z, (finalOrder Label).le z r.C → + ((finalAction Label).iso h2).toFun z = ((finalAction Label).iso r.second).toFun z) ∧ + (∀ z, (finalOrder Label).le z r.B → + ((finalAction Label).iso h1).toFun z = ((finalAction Label).iso h2).toFun z) ∧ + (finalOrder Label).meet (((finalAction Label).iso h1).toFun r.D) X = + ((finalAction Label).iso r.first).toFun r.C ∧ + (finalOrder Label).meet (((finalAction Label).iso h2).toFun r.D) X = + ((finalAction Label).iso r.second).toFun r.C ∧ + (finalOrder Label).meet (((finalAction Label).iso h1).toFun r.D) + (((finalAction Label).iso h2).toFun r.D) = ((finalAction Label).iso h1).toFun r.B := by + rcases rectangle_data_in_stage Label r X with ⟨a, t, Y, hC, hB, hD, hg1, hg2, hY⟩ + rcases final_rectangles_at Label a t Y with ⟨h, agreeC, agreeB, rootMeet, pairMeet⟩ + have actors (j : Bool) : finalGroupInclusion Label a ((stage Label a).rectangleOldActor t j) = + if j then r.second else r.first := by + cases j with + | false => exact hg1 + | true => exact hg2 + have cAgree (j : Bool) (z : FinalPoint Label) (lower : (finalOrder Label).le z r.C) : + ((finalAction Label).iso (h j)).toFun z = + ((finalAction Label).iso (if j then r.second else r.first)).toFun z := by + have eq := agreeC j z (hC.symm ▸ lower) + rw [actors] at eq + exact eq + have mappedRoot (j : Bool) : + (finalInclusion Label a).toFun ((stage Label a).order.meet + (((stage Label a).action.iso ((stage Label a).rectangleOldActor t j)).toFun t.C) Y) = + ((finalAction Label).iso (if j then r.second else r.first)).toFun r.C := by + rw [(finalInclusion Label a).map_meet, ← final_action_stage, actors, hC, hY] + apply meet_eq_left_of_le + cases j with + | false => + exact (finalOrder Label).trans + ((((finalAction Label).iso r.first).le_iff _ _).mpr r.C_le_D) first_upper + | true => + exact (finalOrder Label).trans + ((((finalAction Label).iso r.second).le_iff _ _).mpr r.C_le_D) second_upper + refine ⟨h false, h true, cAgree false, cAgree true, ?_, ?_, ?_, ?_⟩ + · simpa only [hB] using agreeB + · simpa only [hD, hY, Bool.false_eq_true, ↓reduceIte] using + (rootMeet false).trans (mappedRoot false) + · simpa only [hD, hY, ↓reduceIte] using (rootMeet true).trans (mappedRoot true) + · simpa only [hD, hB] using pairMeet + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIntervalExtension.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIntervalExtension.lean index 4810bad16b6e2483f8af96bcbe7c11dee6027804..184b2ccec75dfe5aca67c15a5eec843db0f52641 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIntervalExtension.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIntervalExtension.lean @@ -1,104 +1,104 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IntervalSequenceFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -open Compression.RecursiveMaps -universe u - -theorem intervalComparisons_of_preserved {A D rA rD a b z y : ZFSet.{u}} - (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD) - (ha : a ∈ A) (hb : b ∈ A) (hz : z ∈ D) (hy : y ∈ D) - (same : a = b → z = y) - (forward : ZFSet.pair a b ∈ rA → ZFSet.pair z y ∈ rD) - (backward : ZFSet.pair b a ∈ rA → ZFSet.pair y z ∈ rD) : - (a = b ↔ z = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair z y ∈ rD) ∧ - (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y z ∈ rD) := by - refine ⟨⟨same, ?_⟩, ⟨forward, ?_⟩, ⟨backward, ?_⟩⟩ - · intro equal - rcases source.compare a ha b hb with less | equalSource | more - · have rel := forward less - rw [equal] at rel - exact False.elim (target.irrefl y hy rel) - · exact equalSource - · have rel := backward more - rw [equal] at rel - exact False.elim (target.irrefl y hy rel) - · intro rel - rcases source.compare a ha b hb with less | equal | more - · exact less - · rw [same equal] at rel - exact False.elim (target.irrefl y hy rel) - · exact False.elim (target.irrefl z hz (target.trans z y z rel (backward more))) - · intro rel - rcases source.compare a ha b hb with less | equal | more - · exact False.elim (target.irrefl y hy (target.trans y z y rel (forward less))) - · rw [same equal] at rel - exact False.elim (target.irrefl y hy rel) - · exact more - -theorem finite_intervalNextCandidate_exists - {A D rA rD e lo hi p : ZFSet.{u}} (n : Nat) - (code : IntervalSequenceCode (natSetCode n) A D rA rD e lo hi p) - (enumeration : ZFSet.IsFunc ZFSet.omega A e) - (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) - (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : - ∃ y, intervalNextCandidate (natSetCode n) A D rA rD e lo hi p y := by - classical - let enumerate : Nat → {a : ZFSet.{u} // a ∈ A} := fun k => - ⟨Classical.choose (enumeration.2 (natSetCode k) (natSetCode_mem_omega k)), - (ZFSet.pair_mem_prod.1 (enumeration.1 - (Classical.choose_spec (enumeration.2 (natSetCode k) (natSetCode_mem_omega k))).1)).2⟩ - have enumerateEntry (k : Nat) : ZFSet.pair (natSetCode k) (enumerate k).val ∈ e := - (Classical.choose_spec (enumeration.2 (natSetCode k) (natSetCode_mem_omega k))).1 - let value : Nat → {q : ZFSet.{u} // q ∈ D} := fun k => - if hk : k < n then - ⟨Classical.choose (code.function.2 (natSetCode k) ((natSetCode_mem_iff k n).2 hk)), - (ZFSet.pair_mem_prod.1 (code.function.1 - (Classical.choose_spec (code.function.2 (natSetCode k) - ((natSetCode_mem_iff k n).2 hk))).1)).2⟩ - else ⟨lo, loD⟩ - have valueEntry (k : Nat) (hk : k < n) : - ZFSet.pair (natSetCode k) (value k).val ∈ p := by - dsimp only [value] - rw [dite_eq_left hk] - exact (Classical.choose_spec (code.function.2 (natSetCode k) - ((natSetCode_mem_iff k n).2 hk))).1 - let initial : CountableInterpolation.Partial source.toLinearHeightOrder target.toDenseHeightOrder - enumerate ⟨lo, loD⟩ ⟨hi, hiD⟩ n := { - value := value - lower := fun k hk => (code.inside _ _ (valueEntry k hk)).1 - upper := fun k hk => (code.inside _ _ (valueEntry k hk)).2 - strict := fun i j hi hj less => (code.order _ _ _ _ _ _ - (enumerateEntry i) (enumerateEntry j) (valueEntry i hi) (valueEntry j hj)).1 less - equal := fun i j hi hj equal => Subtype.ext ((code.agree _ _ _ _ _ _ - (enumerateEntry i) (enumerateEntry j) (valueEntry i hi) (valueEntry j hj)).1 - (congrArg Subtype.val equal)) } - obtain ⟨y, lower, upper, forward, backward, same⟩ := CountableInterpolation.next_exists initial gap - refine ⟨y.val, y.property, lower, upper, ?_⟩ - intro i hi a _ b _ z _ ea eb iz - obtain ⟨k, hk, rfl⟩ := (mem_natSetCode i n).1 hi - have enumFunction : FunctionGraphOn ZFSet.omega e := ⟨A, enumeration⟩ - have valueFunction : FunctionGraphOn (natSetCode n) p := ⟨D, code.function⟩ - have first : (enumerate k).val = a := enumFunction.unique (enumerateEntry k) ea - have second : (enumerate n).val = b := enumFunction.unique (enumerateEntry n) eb - have previous : (value k).val = z := valueFunction.unique (valueEntry k hk) iz - have comparisons := intervalComparisons_of_preserved source target.toStrictLinearOrderCode - (enumerate k).property (enumerate n).property (value k).property y.property - (fun equal => congrArg Subtype.val (same k hk (Subtype.ext equal))) - (forward k hk) (backward k hk) - change ((enumerate k).val = (enumerate n).val ↔ (value k).val = y.val) ∧ - (ZFSet.pair (enumerate k).val (enumerate n).val ∈ rA ↔ ZFSet.pair (value k).val y.val ∈ rD) ∧ - (ZFSet.pair (enumerate n).val (enumerate k).val ∈ rA ↔ ZFSet.pair y.val (value k).val ∈ rD) - at comparisons - rw [first, second, previous] at comparisons - exact comparisons - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IntervalSequenceFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +open Compression.RecursiveMaps +universe u + +theorem intervalComparisons_of_preserved {A D rA rD a b z y : ZFSet.{u}} + (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD) + (ha : a ∈ A) (hb : b ∈ A) (hz : z ∈ D) (hy : y ∈ D) + (same : a = b → z = y) + (forward : ZFSet.pair a b ∈ rA → ZFSet.pair z y ∈ rD) + (backward : ZFSet.pair b a ∈ rA → ZFSet.pair y z ∈ rD) : + (a = b ↔ z = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair z y ∈ rD) ∧ + (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y z ∈ rD) := by + refine ⟨⟨same, ?_⟩, ⟨forward, ?_⟩, ⟨backward, ?_⟩⟩ + · intro equal + rcases source.compare a ha b hb with less | equalSource | more + · have rel := forward less + rw [equal] at rel + exact False.elim (target.irrefl y hy rel) + · exact equalSource + · have rel := backward more + rw [equal] at rel + exact False.elim (target.irrefl y hy rel) + · intro rel + rcases source.compare a ha b hb with less | equal | more + · exact less + · rw [same equal] at rel + exact False.elim (target.irrefl y hy rel) + · exact False.elim (target.irrefl z hz (target.trans z y z rel (backward more))) + · intro rel + rcases source.compare a ha b hb with less | equal | more + · exact False.elim (target.irrefl y hy (target.trans y z y rel (forward less))) + · rw [same equal] at rel + exact False.elim (target.irrefl y hy rel) + · exact more + +theorem finite_intervalNextCandidate_exists + {A D rA rD e lo hi p : ZFSet.{u}} (n : Nat) + (code : IntervalSequenceCode (natSetCode n) A D rA rD e lo hi p) + (enumeration : ZFSet.IsFunc ZFSet.omega A e) + (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) + (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : + ∃ y, intervalNextCandidate (natSetCode n) A D rA rD e lo hi p y := by + classical + let enumerate : Nat → {a : ZFSet.{u} // a ∈ A} := fun k => + ⟨Classical.choose (enumeration.2 (natSetCode k) (natSetCode_mem_omega k)), + (ZFSet.pair_mem_prod.1 (enumeration.1 + (Classical.choose_spec (enumeration.2 (natSetCode k) (natSetCode_mem_omega k))).1)).2⟩ + have enumerateEntry (k : Nat) : ZFSet.pair (natSetCode k) (enumerate k).val ∈ e := + (Classical.choose_spec (enumeration.2 (natSetCode k) (natSetCode_mem_omega k))).1 + let value : Nat → {q : ZFSet.{u} // q ∈ D} := fun k => + if hk : k < n then + ⟨Classical.choose (code.function.2 (natSetCode k) ((natSetCode_mem_iff k n).2 hk)), + (ZFSet.pair_mem_prod.1 (code.function.1 + (Classical.choose_spec (code.function.2 (natSetCode k) + ((natSetCode_mem_iff k n).2 hk))).1)).2⟩ + else ⟨lo, loD⟩ + have valueEntry (k : Nat) (hk : k < n) : + ZFSet.pair (natSetCode k) (value k).val ∈ p := by + dsimp only [value] + rw [dite_eq_left hk] + exact (Classical.choose_spec (code.function.2 (natSetCode k) + ((natSetCode_mem_iff k n).2 hk))).1 + let initial : CountableInterpolation.Partial source.toLinearHeightOrder target.toDenseHeightOrder + enumerate ⟨lo, loD⟩ ⟨hi, hiD⟩ n := { + value := value + lower := fun k hk => (code.inside _ _ (valueEntry k hk)).1 + upper := fun k hk => (code.inside _ _ (valueEntry k hk)).2 + strict := fun i j hi hj less => (code.order _ _ _ _ _ _ + (enumerateEntry i) (enumerateEntry j) (valueEntry i hi) (valueEntry j hj)).1 less + equal := fun i j hi hj equal => Subtype.ext ((code.agree _ _ _ _ _ _ + (enumerateEntry i) (enumerateEntry j) (valueEntry i hi) (valueEntry j hj)).1 + (congrArg Subtype.val equal)) } + obtain ⟨y, lower, upper, forward, backward, same⟩ := CountableInterpolation.next_exists initial gap + refine ⟨y.val, y.property, lower, upper, ?_⟩ + intro i hi a _ b _ z _ ea eb iz + obtain ⟨k, hk, rfl⟩ := (mem_natSetCode i n).1 hi + have enumFunction : FunctionGraphOn ZFSet.omega e := ⟨A, enumeration⟩ + have valueFunction : FunctionGraphOn (natSetCode n) p := ⟨D, code.function⟩ + have first : (enumerate k).val = a := enumFunction.unique (enumerateEntry k) ea + have second : (enumerate n).val = b := enumFunction.unique (enumerateEntry n) eb + have previous : (value k).val = z := valueFunction.unique (valueEntry k hk) iz + have comparisons := intervalComparisons_of_preserved source target.toStrictLinearOrderCode + (enumerate k).property (enumerate n).property (value k).property y.property + (fun equal => congrArg Subtype.val (same k hk (Subtype.ext equal))) + (forward k hk) (backward k hk) + change ((enumerate k).val = (enumerate n).val ↔ (value k).val = y.val) ∧ + (ZFSet.pair (enumerate k).val (enumerate n).val ∈ rA ↔ ZFSet.pair (value k).val y.val ∈ rD) ∧ + (ZFSet.pair (enumerate n).val (enumerate k).val ∈ rA ↔ ZFSet.pair y.val (value k).val ∈ rD) + at comparisons + rw [first, second, previous] at comparisons + exact comparisons + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIterationTraces.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIterationTraces.lean index 02459007f45fdbb26e2abc0095f406c2da702e9b..6165d4ff02a4c3ab6f58ddbcd9a4f9c87060a8d2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIterationTraces.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteIterationTraces.lean @@ -1,100 +1,100 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs - -namespace OAI - - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -def natIterate {B : Type u} (f : B → B) (b : B) : Nat → B - | 0 => b - | n + 1 => f (natIterate f b n) - -structure IterationTraceCode (N D B step base t : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc D B t - seed : ZFSet.pair ∅ base ∈ t - next : ∀ i ∈ N, ∀ j ∈ D, ∀ x ∈ B, ∀ y ∈ B, - j = insert i i → ZFSet.pair i x ∈ t → ZFSet.pair j y ∈ t → ZFSet.pair x y ∈ step - -noncomputable def finiteIterationTrace {B : Type u} (s : Presentation B) (f : B → B) - (b : B) (n : Nat) : ZFSet.{u} := - (natInitialPresentation (n + 1)).graph s (fun i => natIterate f b i.down.val) - -theorem pair_mem_finiteIterationTrace {B : Type u} (s : Presentation B) (f : B → B) - (b : B) (n k : Nat) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode k) y ∈ finiteIterationTrace s f b n ↔ - k ≤ n ∧ y = s.encode (natIterate f b k) := by - rw [finiteIterationTrace, Presentation.mem_graph] - constructor - · rintro ⟨i, eq⟩ - obtain ⟨first, second⟩ := ZFSet.pair_inj.1 eq - have same : i.down.val = k := natSetCode_injective first - exact ⟨by have := i.down.isLt; omega, by simpa only [same] using second.symm⟩ - · rintro ⟨hk, rfl⟩ - exact ⟨⟨⟨k, by omega⟩⟩, rfl⟩ - -theorem finiteIterationTrace_code {B : Type u} (s : Presentation B) (f : B → B) - (b : B) (n : Nat) : - IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier - (s.graph s f) (s.encode b) (finiteIterationTrace s f b n) := by - refine ⟨(natInitialPresentation (n + 1)).graph_isFunc s _, ?_, ?_⟩ - · exact (pair_mem_finiteIterationTrace s f b n 0 _).2 ⟨Nat.zero_le _, rfl⟩ - · intro i hi j _ x _ y _ successor prev next - obtain ⟨k, hk, rfl⟩ := (mem_natSetCode i n).1 hi - have previous := ((pair_mem_finiteIterationTrace s f b n k x).1 prev).2 - have jcode : j = natSetCode (k + 1) := successor - have following := ((pair_mem_finiteIterationTrace s f b n (k + 1) y).1 (jcode ▸ next)).2 - rw [previous, following] - exact (s.pair_mem_graph s f _ _).2 rfl - -theorem IterationTraceCode.value {B : Type u} (s : Presentation B) (f : B → B) (b : B) - {n : Nat} {t : ZFSet.{u}} - (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier - (s.graph s f) (s.encode b) t) : - ∀ k ≤ n, ZFSet.pair (natSetCode k) (s.encode (natIterate f b k)) ∈ t := by - intro k - induction k with - | zero => exact fun _ => trace.seed - | succ k ih => - intro hk - have domain := (natSetCode_mem_iff (k + 1) (n + 1)).2 (by omega) - obtain ⟨y, rel, _⟩ := trace.function.2 (natSetCode (k + 1)) domain - have hy := (ZFSet.pair_mem_prod.1 (trace.function.1 rel)).2 - obtain ⟨c, eq⟩ := (s.mem_carrier y).1 hy - have step := trace.next (natSetCode k) ((natSetCode_mem_iff k n).2 (by omega)) - (natSetCode (k + 1)) domain _ (s.encode_mem _) y hy rfl (ih (by omega)) rel - rw [← eq] at step - have output := (s.pair_mem_graph s f _ c).1 step - have same : y = s.encode (natIterate f b (k + 1)) := eq.symm.trans (congrArg s.encode output.symm) - exact same ▸ rel - -theorem IterationTraceCode.output {B : Type u} (s : Presentation B) (f : B → B) (b : B) - {n : Nat} {t y : ZFSet.{u}} - (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier - (s.graph s f) (s.encode b) t) (rel : ZFSet.pair (natSetCode n) y ∈ t) : - y = s.encode (natIterate f b n) := by - obtain ⟨z, _, unique⟩ := trace.function.2 (natSetCode n) - ((natSetCode_mem_iff n (n + 1)).2 (by omega)) - exact (unique y rel).trans (unique _ (trace.value s f b n (Nat.le_refl n))).symm - -namespace TransitiveGround - -open SetFormula - -theorem finiteIterationTrace_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {B : Type u} (s : Presentation B) (f : B → B) (b : B) (n : Nat) - (hB : s.carrier ∈ M.sets) : finiteIterationTrace s f b n ∈ M.sets := - M.finite_function_graph_mem pairing unions (natInitialPresentation (n + 1)) s _ - (M.natSetCode_mem separation infinite (n + 1)) hB - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs + +namespace OAI + + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +def natIterate {B : Type u} (f : B → B) (b : B) : Nat → B + | 0 => b + | n + 1 => f (natIterate f b n) + +structure IterationTraceCode (N D B step base t : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc D B t + seed : ZFSet.pair ∅ base ∈ t + next : ∀ i ∈ N, ∀ j ∈ D, ∀ x ∈ B, ∀ y ∈ B, + j = insert i i → ZFSet.pair i x ∈ t → ZFSet.pair j y ∈ t → ZFSet.pair x y ∈ step + +noncomputable def finiteIterationTrace {B : Type u} (s : Presentation B) (f : B → B) + (b : B) (n : Nat) : ZFSet.{u} := + (natInitialPresentation (n + 1)).graph s (fun i => natIterate f b i.down.val) + +theorem pair_mem_finiteIterationTrace {B : Type u} (s : Presentation B) (f : B → B) + (b : B) (n k : Nat) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode k) y ∈ finiteIterationTrace s f b n ↔ + k ≤ n ∧ y = s.encode (natIterate f b k) := by + rw [finiteIterationTrace, Presentation.mem_graph] + constructor + · rintro ⟨i, eq⟩ + obtain ⟨first, second⟩ := ZFSet.pair_inj.1 eq + have same : i.down.val = k := natSetCode_injective first + exact ⟨by have := i.down.isLt; omega, by simpa only [same] using second.symm⟩ + · rintro ⟨hk, rfl⟩ + exact ⟨⟨⟨k, by omega⟩⟩, rfl⟩ + +theorem finiteIterationTrace_code {B : Type u} (s : Presentation B) (f : B → B) + (b : B) (n : Nat) : + IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier + (s.graph s f) (s.encode b) (finiteIterationTrace s f b n) := by + refine ⟨(natInitialPresentation (n + 1)).graph_isFunc s _, ?_, ?_⟩ + · exact (pair_mem_finiteIterationTrace s f b n 0 _).2 ⟨Nat.zero_le _, rfl⟩ + · intro i hi j _ x _ y _ successor prev next + obtain ⟨k, hk, rfl⟩ := (mem_natSetCode i n).1 hi + have previous := ((pair_mem_finiteIterationTrace s f b n k x).1 prev).2 + have jcode : j = natSetCode (k + 1) := successor + have following := ((pair_mem_finiteIterationTrace s f b n (k + 1) y).1 (jcode ▸ next)).2 + rw [previous, following] + exact (s.pair_mem_graph s f _ _).2 rfl + +theorem IterationTraceCode.value {B : Type u} (s : Presentation B) (f : B → B) (b : B) + {n : Nat} {t : ZFSet.{u}} + (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier + (s.graph s f) (s.encode b) t) : + ∀ k ≤ n, ZFSet.pair (natSetCode k) (s.encode (natIterate f b k)) ∈ t := by + intro k + induction k with + | zero => exact fun _ => trace.seed + | succ k ih => + intro hk + have domain := (natSetCode_mem_iff (k + 1) (n + 1)).2 (by omega) + obtain ⟨y, rel, _⟩ := trace.function.2 (natSetCode (k + 1)) domain + have hy := (ZFSet.pair_mem_prod.1 (trace.function.1 rel)).2 + obtain ⟨c, eq⟩ := (s.mem_carrier y).1 hy + have step := trace.next (natSetCode k) ((natSetCode_mem_iff k n).2 (by omega)) + (natSetCode (k + 1)) domain _ (s.encode_mem _) y hy rfl (ih (by omega)) rel + rw [← eq] at step + have output := (s.pair_mem_graph s f _ c).1 step + have same : y = s.encode (natIterate f b (k + 1)) := eq.symm.trans (congrArg s.encode output.symm) + exact same ▸ rel + +theorem IterationTraceCode.output {B : Type u} (s : Presentation B) (f : B → B) (b : B) + {n : Nat} {t y : ZFSet.{u}} + (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier + (s.graph s f) (s.encode b) t) (rel : ZFSet.pair (natSetCode n) y ∈ t) : + y = s.encode (natIterate f b n) := by + obtain ⟨z, _, unique⟩ := trace.function.2 (natSetCode n) + ((natSetCode_mem_iff n (n + 1)).2 (by omega)) + exact (unique y rel).trans (unique _ (trace.value s f b n (Nat.le_refl n))).symm + +namespace TransitiveGround + +open SetFormula + +theorem finiteIterationTrace_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {B : Type u} (s : Presentation B) (f : B → B) (b : B) (n : Nat) + (hB : s.carrier ∈ M.sets) : finiteIterationTrace s f b n ∈ M.sets := + M.finite_function_graph_mem pairing unions (natInitialPresentation (n + 1)) s _ + (M.natSetCode_mem separation infinite (n + 1)) hB + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteWordOperations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteWordOperations.lean index 82a3e1ae13e3b5bab002d6c19de8c76e3037c139..b1c9e90a3459f22ce229e5fabcf57cc04d82cf74 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteWordOperations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FiniteWordOperations.lean @@ -1,174 +1,174 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.DepthSlotCodes -import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordMapCodes - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -def FiniteWordAppendCode (A omega add f g h : ZFSet.{u}) : Prop := - ∃ m ∈ omega, ∃ n ∈ omega, ∃ p ∈ omega, - ZFSet.IsFunc m A f ∧ ZFSet.IsFunc n A g ∧ ZFSet.IsFunc p A h ∧ - ZFSet.pair (ZFSet.pair m n) p ∈ add ∧ - ∀ i ∈ p, ∀ a ∈ A, ZFSet.pair i a ∈ h ↔ - ZFSet.pair i a ∈ f ∨ ∃ j ∈ n, - ZFSet.pair (ZFSet.pair m j) i ∈ add ∧ ZFSet.pair j a ∈ g - -def FiniteWordReverseCode (A omega add f h : ZFSet.{u}) : Prop := - ∃ n ∈ omega, ZFSet.IsFunc n A f ∧ ZFSet.IsFunc n A h ∧ - ∀ i ∈ n, ∀ a ∈ A, ZFSet.pair i a ∈ h ↔ - ∃ j ∈ n, ∃ k ∈ n, ZFSet.pair (ZFSet.pair i j) k ∈ add ∧ - n = insert k k ∧ ZFSet.pair j a ∈ f - -theorem finiteWordGraph_append_entry {B : Type u} (s : Presentation B) - (xs ys : List B) (k : Nat) (a : ZFSet.{u}) : - ZFSet.pair (natSetCode k) a ∈ finiteWordGraph s (xs ++ ys) ↔ - ZFSet.pair (natSetCode k) a ∈ finiteWordGraph s xs ∨ - ∃ j, k = xs.length + j ∧ ZFSet.pair (natSetCode j) a ∈ finiteWordGraph s ys := by - constructor - · intro entry - obtain ⟨hk, value⟩ := (pair_mem_finiteWordGraph s (xs ++ ys) k a).1 entry - by_cases left : k < xs.length - · apply Or.inl - apply (pair_mem_finiteWordGraph s xs k a).2 - refine ⟨left, ?_⟩ - simpa only [List.get_eq_getElem, List.getElem_append_left left] using value - · have right : xs.length ≤ k := Nat.le_of_not_gt left - have hj : k - xs.length < ys.length := by simp only [List.length_append] at hk; omega - refine Or.inr ⟨k - xs.length, by omega, (pair_mem_finiteWordGraph s ys _ a).2 ⟨hj, ?_⟩⟩ - simpa only [List.get_eq_getElem, List.getElem_append_right right] using value - · rintro (entry | ⟨j, equal, entry⟩) - · obtain ⟨hk, value⟩ := (pair_mem_finiteWordGraph s xs k a).1 entry - apply (pair_mem_finiteWordGraph s (xs ++ ys) k a).2 - have bound : k < (xs ++ ys).length := by simp only [List.length_append]; omega - refine ⟨bound, ?_⟩ - simpa only [List.get_eq_getElem, List.getElem_append_left hk] using value - · subst k - obtain ⟨hj, value⟩ := (pair_mem_finiteWordGraph s ys j a).1 entry - apply (pair_mem_finiteWordGraph s (xs ++ ys) (xs.length + j) a).2 - have bound : xs.length + j < (xs ++ ys).length := by simp only [List.length_append]; omega - refine ⟨bound, ?_⟩ - simpa only [List.get_eq_getElem, - List.getElem_append_right (Nat.le_add_right xs.length j), Nat.add_sub_cancel_left] using value - -theorem finiteWordGraph_reverse_entry {B : Type u} (s : Presentation B) - (xs : List B) (i : Nat) (a : ZFSet.{u}) : - ZFSet.pair (natSetCode i) a ∈ finiteWordGraph s xs.reverse ↔ - ∃ j, i + j + 1 = xs.length ∧ ZFSet.pair (natSetCode j) a ∈ finiteWordGraph s xs := by - constructor - · intro entry - obtain ⟨hi, value⟩ := (pair_mem_finiteWordGraph s xs.reverse i a).1 entry - have bound : i < xs.length := by simpa only [List.length_reverse] using hi - have hj : xs.length - 1 - i < xs.length := by omega - refine ⟨xs.length - 1 - i, by omega, (pair_mem_finiteWordGraph s xs _ a).2 ⟨hj, ?_⟩⟩ - simpa only [List.get_eq_getElem, List.getElem_reverse] using value - · rintro ⟨j, sum, entry⟩ - obtain ⟨hj, value⟩ := (pair_mem_finiteWordGraph s xs j a).1 entry - have hi : i < xs.reverse.length := by simp only [List.length_reverse]; omega - have equal : xs.length - 1 - i = j := by omega - apply (pair_mem_finiteWordGraph s xs.reverse i a).2 - refine ⟨hi, ?_⟩ - simpa only [List.get_eq_getElem, List.getElem_reverse, equal] using value - -theorem finiteWordGraph_append_code {B : Type u} (s : Presentation B) (xs ys : List B) : - FiniteWordAppendCode s.carrier ZFSet.omega natAddGraph - (finiteWordGraph s xs) (finiteWordGraph s ys) (finiteWordGraph s (xs ++ ys)) := by - refine ⟨natSetCode xs.length, natSetCode_mem_omega _, natSetCode ys.length, natSetCode_mem_omega _, - natSetCode (xs.length + ys.length), natSetCode_mem_omega _, finiteWordGraph_function s xs, - finiteWordGraph_function s ys, ?_, (pair_mem_natAddGraph _ _ _).2 rfl, ?_⟩ - · simpa only [List.length_append] using finiteWordGraph_function s (xs ++ ys) - · intro i hi a _ - obtain ⟨k, _, rfl⟩ := (mem_natSetCode i (xs.length + ys.length)).1 hi - rw [finiteWordGraph_append_entry] - apply or_congr Iff.rfl - constructor - · rintro ⟨j, equal, entry⟩ - have hj := (ZFSet.pair_mem_prod.1 ((finiteWordGraph_function s ys).1 entry)).1 - exact ⟨natSetCode j, hj, (pair_mem_natAddGraph _ _ _).2 equal, entry⟩ - · rintro ⟨j, hj, sum, entry⟩ - obtain ⟨l, _, rfl⟩ := (mem_natSetCode j ys.length).1 hj - exact ⟨l, (pair_mem_natAddGraph _ _ _).1 sum, entry⟩ - -theorem finiteWordGraph_reverse_code {B : Type u} (s : Presentation B) (xs : List B) : - FiniteWordReverseCode s.carrier ZFSet.omega natAddGraph - (finiteWordGraph s xs) (finiteWordGraph s xs.reverse) := by - refine ⟨natSetCode xs.length, natSetCode_mem_omega _, finiteWordGraph_function s xs, ?_, ?_⟩ - · simpa only [List.length_reverse] using finiteWordGraph_function s xs.reverse - · intro i hi a _ - obtain ⟨k, _, rfl⟩ := (mem_natSetCode i xs.length).1 hi - rw [finiteWordGraph_reverse_entry] - constructor - · rintro ⟨j, sum, entry⟩ - have hj := (ZFSet.pair_mem_prod.1 ((finiteWordGraph_function s xs).1 entry)).1 - refine ⟨natSetCode j, hj, natSetCode (k + j), (natSetCode_mem_iff _ _).2 (by omega), - (pair_mem_natAddGraph _ _ _).2 rfl, ?_, entry⟩ - exact (congrArg natSetCode sum).symm - · rintro ⟨j, hj, l, hl, sum, successor, entry⟩ - obtain ⟨j, _, rfl⟩ := (mem_natSetCode j xs.length).1 hj - obtain ⟨l, _, rfl⟩ := (mem_natSetCode l xs.length).1 hl - have added := (pair_mem_natAddGraph _ _ _).1 sum - have length : xs.length = l + 1 := natSetCode_injective successor - exact ⟨j, by omega, entry⟩ - -theorem FiniteWordAppendCode.unique {A f g h h' : ZFSet.{u}} - (first : FiniteWordAppendCode A ZFSet.omega natAddGraph f g h) - (second : FiniteWordAppendCode A ZFSet.omega natAddGraph f g h') : h = h' := by - obtain ⟨m, hm, n, hn, p, hp, fm, gn, funH, sum, entries⟩ := first - obtain ⟨m', hm', n', hn', p', hp', fm', gn', funH', sum', entries'⟩ := second - obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode _).1 hm - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode _).1 hn - obtain ⟨p, rfl⟩ := (mem_omega_iff_natSetCode _).1 hp - obtain ⟨m', rfl⟩ := (mem_omega_iff_natSetCode _).1 hm' - obtain ⟨n', rfl⟩ := (mem_omega_iff_natSetCode _).1 hn' - obtain ⟨p', rfl⟩ := (mem_omega_iff_natSetCode _).1 hp' - have mEqual := finiteWord_domain_unique fm' fm - have nEqual := finiteWord_domain_unique gn' gn - subst m' n' - have pEqual := ((pair_mem_natAddGraph _ _ _).1 sum').trans ((pair_mem_natAddGraph _ _ _).1 sum).symm - subst p' - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH.1 hz) - exact (entries' i hi a ha).2 ((entries i hi a ha).1 hz) - · intro hz - obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH'.1 hz) - exact (entries i hi a ha).2 ((entries' i hi a ha).1 hz) - -theorem FiniteWordReverseCode.unique {A f h h' : ZFSet.{u}} - (first : FiniteWordReverseCode A ZFSet.omega natAddGraph f h) - (second : FiniteWordReverseCode A ZFSet.omega natAddGraph f h') : h = h' := by - obtain ⟨n, hn, funF, funH, entries⟩ := first - obtain ⟨n', hn', funF', funH', entries'⟩ := second - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode _).1 hn - obtain ⟨n', rfl⟩ := (mem_omega_iff_natSetCode _).1 hn' - have same := finiteWord_domain_unique funF' funF - subst n' - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH.1 hz) - exact (entries' i hi a ha).2 ((entries i hi a ha).1 hz) - · intro hz - obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH'.1 hz) - exact (entries i hi a ha).2 ((entries' i hi a ha).1 hz) - -theorem finiteWordAppendCode_iff {B : Type u} (s : Presentation B) (xs ys : List B) (h : ZFSet.{u}) : - FiniteWordAppendCode s.carrier ZFSet.omega natAddGraph - (finiteWordGraph s xs) (finiteWordGraph s ys) h ↔ h = finiteWordGraph s (xs ++ ys) := - ⟨fun code => code.unique (finiteWordGraph_append_code s xs ys), - fun equal => equal.symm ▸ finiteWordGraph_append_code s xs ys⟩ - -theorem finiteWordReverseCode_iff {B : Type u} (s : Presentation B) (xs : List B) (h : ZFSet.{u}) : - FiniteWordReverseCode s.carrier ZFSet.omega natAddGraph (finiteWordGraph s xs) h ↔ - h = finiteWordGraph s xs.reverse := - ⟨fun code => code.unique (finiteWordGraph_reverse_code s xs), - fun equal => equal.symm ▸ finiteWordGraph_reverse_code s xs⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.DepthSlotCodes +import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordMapCodes + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +def FiniteWordAppendCode (A omega add f g h : ZFSet.{u}) : Prop := + ∃ m ∈ omega, ∃ n ∈ omega, ∃ p ∈ omega, + ZFSet.IsFunc m A f ∧ ZFSet.IsFunc n A g ∧ ZFSet.IsFunc p A h ∧ + ZFSet.pair (ZFSet.pair m n) p ∈ add ∧ + ∀ i ∈ p, ∀ a ∈ A, ZFSet.pair i a ∈ h ↔ + ZFSet.pair i a ∈ f ∨ ∃ j ∈ n, + ZFSet.pair (ZFSet.pair m j) i ∈ add ∧ ZFSet.pair j a ∈ g + +def FiniteWordReverseCode (A omega add f h : ZFSet.{u}) : Prop := + ∃ n ∈ omega, ZFSet.IsFunc n A f ∧ ZFSet.IsFunc n A h ∧ + ∀ i ∈ n, ∀ a ∈ A, ZFSet.pair i a ∈ h ↔ + ∃ j ∈ n, ∃ k ∈ n, ZFSet.pair (ZFSet.pair i j) k ∈ add ∧ + n = insert k k ∧ ZFSet.pair j a ∈ f + +theorem finiteWordGraph_append_entry {B : Type u} (s : Presentation B) + (xs ys : List B) (k : Nat) (a : ZFSet.{u}) : + ZFSet.pair (natSetCode k) a ∈ finiteWordGraph s (xs ++ ys) ↔ + ZFSet.pair (natSetCode k) a ∈ finiteWordGraph s xs ∨ + ∃ j, k = xs.length + j ∧ ZFSet.pair (natSetCode j) a ∈ finiteWordGraph s ys := by + constructor + · intro entry + obtain ⟨hk, value⟩ := (pair_mem_finiteWordGraph s (xs ++ ys) k a).1 entry + by_cases left : k < xs.length + · apply Or.inl + apply (pair_mem_finiteWordGraph s xs k a).2 + refine ⟨left, ?_⟩ + simpa only [List.get_eq_getElem, List.getElem_append_left left] using value + · have right : xs.length ≤ k := Nat.le_of_not_gt left + have hj : k - xs.length < ys.length := by simp only [List.length_append] at hk; omega + refine Or.inr ⟨k - xs.length, by omega, (pair_mem_finiteWordGraph s ys _ a).2 ⟨hj, ?_⟩⟩ + simpa only [List.get_eq_getElem, List.getElem_append_right right] using value + · rintro (entry | ⟨j, equal, entry⟩) + · obtain ⟨hk, value⟩ := (pair_mem_finiteWordGraph s xs k a).1 entry + apply (pair_mem_finiteWordGraph s (xs ++ ys) k a).2 + have bound : k < (xs ++ ys).length := by simp only [List.length_append]; omega + refine ⟨bound, ?_⟩ + simpa only [List.get_eq_getElem, List.getElem_append_left hk] using value + · subst k + obtain ⟨hj, value⟩ := (pair_mem_finiteWordGraph s ys j a).1 entry + apply (pair_mem_finiteWordGraph s (xs ++ ys) (xs.length + j) a).2 + have bound : xs.length + j < (xs ++ ys).length := by simp only [List.length_append]; omega + refine ⟨bound, ?_⟩ + simpa only [List.get_eq_getElem, + List.getElem_append_right (Nat.le_add_right xs.length j), Nat.add_sub_cancel_left] using value + +theorem finiteWordGraph_reverse_entry {B : Type u} (s : Presentation B) + (xs : List B) (i : Nat) (a : ZFSet.{u}) : + ZFSet.pair (natSetCode i) a ∈ finiteWordGraph s xs.reverse ↔ + ∃ j, i + j + 1 = xs.length ∧ ZFSet.pair (natSetCode j) a ∈ finiteWordGraph s xs := by + constructor + · intro entry + obtain ⟨hi, value⟩ := (pair_mem_finiteWordGraph s xs.reverse i a).1 entry + have bound : i < xs.length := by simpa only [List.length_reverse] using hi + have hj : xs.length - 1 - i < xs.length := by omega + refine ⟨xs.length - 1 - i, by omega, (pair_mem_finiteWordGraph s xs _ a).2 ⟨hj, ?_⟩⟩ + simpa only [List.get_eq_getElem, List.getElem_reverse] using value + · rintro ⟨j, sum, entry⟩ + obtain ⟨hj, value⟩ := (pair_mem_finiteWordGraph s xs j a).1 entry + have hi : i < xs.reverse.length := by simp only [List.length_reverse]; omega + have equal : xs.length - 1 - i = j := by omega + apply (pair_mem_finiteWordGraph s xs.reverse i a).2 + refine ⟨hi, ?_⟩ + simpa only [List.get_eq_getElem, List.getElem_reverse, equal] using value + +theorem finiteWordGraph_append_code {B : Type u} (s : Presentation B) (xs ys : List B) : + FiniteWordAppendCode s.carrier ZFSet.omega natAddGraph + (finiteWordGraph s xs) (finiteWordGraph s ys) (finiteWordGraph s (xs ++ ys)) := by + refine ⟨natSetCode xs.length, natSetCode_mem_omega _, natSetCode ys.length, natSetCode_mem_omega _, + natSetCode (xs.length + ys.length), natSetCode_mem_omega _, finiteWordGraph_function s xs, + finiteWordGraph_function s ys, ?_, (pair_mem_natAddGraph _ _ _).2 rfl, ?_⟩ + · simpa only [List.length_append] using finiteWordGraph_function s (xs ++ ys) + · intro i hi a _ + obtain ⟨k, _, rfl⟩ := (mem_natSetCode i (xs.length + ys.length)).1 hi + rw [finiteWordGraph_append_entry] + apply or_congr Iff.rfl + constructor + · rintro ⟨j, equal, entry⟩ + have hj := (ZFSet.pair_mem_prod.1 ((finiteWordGraph_function s ys).1 entry)).1 + exact ⟨natSetCode j, hj, (pair_mem_natAddGraph _ _ _).2 equal, entry⟩ + · rintro ⟨j, hj, sum, entry⟩ + obtain ⟨l, _, rfl⟩ := (mem_natSetCode j ys.length).1 hj + exact ⟨l, (pair_mem_natAddGraph _ _ _).1 sum, entry⟩ + +theorem finiteWordGraph_reverse_code {B : Type u} (s : Presentation B) (xs : List B) : + FiniteWordReverseCode s.carrier ZFSet.omega natAddGraph + (finiteWordGraph s xs) (finiteWordGraph s xs.reverse) := by + refine ⟨natSetCode xs.length, natSetCode_mem_omega _, finiteWordGraph_function s xs, ?_, ?_⟩ + · simpa only [List.length_reverse] using finiteWordGraph_function s xs.reverse + · intro i hi a _ + obtain ⟨k, _, rfl⟩ := (mem_natSetCode i xs.length).1 hi + rw [finiteWordGraph_reverse_entry] + constructor + · rintro ⟨j, sum, entry⟩ + have hj := (ZFSet.pair_mem_prod.1 ((finiteWordGraph_function s xs).1 entry)).1 + refine ⟨natSetCode j, hj, natSetCode (k + j), (natSetCode_mem_iff _ _).2 (by omega), + (pair_mem_natAddGraph _ _ _).2 rfl, ?_, entry⟩ + exact (congrArg natSetCode sum).symm + · rintro ⟨j, hj, l, hl, sum, successor, entry⟩ + obtain ⟨j, _, rfl⟩ := (mem_natSetCode j xs.length).1 hj + obtain ⟨l, _, rfl⟩ := (mem_natSetCode l xs.length).1 hl + have added := (pair_mem_natAddGraph _ _ _).1 sum + have length : xs.length = l + 1 := natSetCode_injective successor + exact ⟨j, by omega, entry⟩ + +theorem FiniteWordAppendCode.unique {A f g h h' : ZFSet.{u}} + (first : FiniteWordAppendCode A ZFSet.omega natAddGraph f g h) + (second : FiniteWordAppendCode A ZFSet.omega natAddGraph f g h') : h = h' := by + obtain ⟨m, hm, n, hn, p, hp, fm, gn, funH, sum, entries⟩ := first + obtain ⟨m', hm', n', hn', p', hp', fm', gn', funH', sum', entries'⟩ := second + obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode _).1 hm + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode _).1 hn + obtain ⟨p, rfl⟩ := (mem_omega_iff_natSetCode _).1 hp + obtain ⟨m', rfl⟩ := (mem_omega_iff_natSetCode _).1 hm' + obtain ⟨n', rfl⟩ := (mem_omega_iff_natSetCode _).1 hn' + obtain ⟨p', rfl⟩ := (mem_omega_iff_natSetCode _).1 hp' + have mEqual := finiteWord_domain_unique fm' fm + have nEqual := finiteWord_domain_unique gn' gn + subst m' n' + have pEqual := ((pair_mem_natAddGraph _ _ _).1 sum').trans ((pair_mem_natAddGraph _ _ _).1 sum).symm + subst p' + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH.1 hz) + exact (entries' i hi a ha).2 ((entries i hi a ha).1 hz) + · intro hz + obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH'.1 hz) + exact (entries i hi a ha).2 ((entries' i hi a ha).1 hz) + +theorem FiniteWordReverseCode.unique {A f h h' : ZFSet.{u}} + (first : FiniteWordReverseCode A ZFSet.omega natAddGraph f h) + (second : FiniteWordReverseCode A ZFSet.omega natAddGraph f h') : h = h' := by + obtain ⟨n, hn, funF, funH, entries⟩ := first + obtain ⟨n', hn', funF', funH', entries'⟩ := second + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode _).1 hn + obtain ⟨n', rfl⟩ := (mem_omega_iff_natSetCode _).1 hn' + have same := finiteWord_domain_unique funF' funF + subst n' + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH.1 hz) + exact (entries' i hi a ha).2 ((entries i hi a ha).1 hz) + · intro hz + obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (funH'.1 hz) + exact (entries i hi a ha).2 ((entries' i hi a ha).1 hz) + +theorem finiteWordAppendCode_iff {B : Type u} (s : Presentation B) (xs ys : List B) (h : ZFSet.{u}) : + FiniteWordAppendCode s.carrier ZFSet.omega natAddGraph + (finiteWordGraph s xs) (finiteWordGraph s ys) h ↔ h = finiteWordGraph s (xs ++ ys) := + ⟨fun code => code.unique (finiteWordGraph_append_code s xs ys), + fun equal => equal.symm ▸ finiteWordGraph_append_code s xs ys⟩ + +theorem finiteWordReverseCode_iff {B : Type u} (s : Presentation B) (xs : List B) (h : ZFSet.{u}) : + FiniteWordReverseCode s.carrier ZFSet.omega natAddGraph (finiteWordGraph s xs) h ↔ + h = finiteWordGraph s xs.reverse := + ⟨fun code => code.unique (finiteWordGraph_reverse_code s xs), + fun equal => equal.symm ▸ finiteWordGraph_reverse_code s xs⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FixedCompressionSeeds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FixedCompressionSeeds.lean index 4a0c77b534419927a69ffa1a07b34d0cb4f5ff5c..e380bc19d87e5c54d33aa547d59c0a68c29bb978 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FixedCompressionSeeds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/FixedCompressionSeeds.lean @@ -1,32 +1,32 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.InitialRecursiveActionAgreement -import OAI.SetTheory.PartitionPrinciple.Forcing.RecursiveNextTaskActions - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -structure FixedCompressionSeed - (P r μ A τ I Sources Reps G m inv one T Filters : ZFSet.{u}) : Prop where - originalOrder : MeetOrderCode P r μ - originalAction : PosetActionCode G P m one r A - top_mem : τ ∈ P - sources : ZFSet.IsFunc I P Sources - filters : FunctionGraphOn I Filters - productAgreement : ∀ δ i j g h k a, - ZFSet.pair (ZFSet.pair δ i) j ∈ T → ZFSet.pair i a ∈ Sources → - ZFSet.pair i g ∈ Reps → ZFSet.pair j h ∈ Reps → - ZFSet.pair (ZFSet.pair δ g) k ∈ m → ActionAgreementBelow P r A k h a - positiveAgreement : ∀ g h v i j k F, - ActionAgreementBelow P r A g h v → ZFSet.pair i F ∈ Filters → v ∈ F → - ZFSet.pair (ZFSet.pair g i) j ∈ T → - ZFSet.pair (ZFSet.pair h i) k ∈ T → j = k - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.InitialRecursiveActionAgreement +import OAI.SetTheory.PartitionPrinciple.Forcing.RecursiveNextTaskActions + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +structure FixedCompressionSeed + (P r μ A τ I Sources Reps G m inv one T Filters : ZFSet.{u}) : Prop where + originalOrder : MeetOrderCode P r μ + originalAction : PosetActionCode G P m one r A + top_mem : τ ∈ P + sources : ZFSet.IsFunc I P Sources + filters : FunctionGraphOn I Filters + productAgreement : ∀ δ i j g h k a, + ZFSet.pair (ZFSet.pair δ i) j ∈ T → ZFSet.pair i a ∈ Sources → + ZFSet.pair i g ∈ Reps → ZFSet.pair j h ∈ Reps → + ZFSet.pair (ZFSet.pair δ g) k ∈ m → ActionAgreementBelow P r A k h a + positiveAgreement : ∀ g h v i j k F, + ActionAgreementBelow P r A g h v → ZFSet.pair i F ∈ Filters → v ∈ F → + ZFSet.pair (ZFSet.pair g i) j ∈ T → + ZFSet.pair (ZFSet.pair h i) k ∈ T → j = k + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GluingHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GluingHeights.lean index 4998a1be02ad657f9668b5034fe4add24c22518e..a900579daf0d8a1bb521d70845cc6df26cd0a2b4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GluingHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GluingHeights.lean @@ -1,794 +1,794 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.NatUnionCodes -import OAI.SetTheory.PartitionPrinciple.Models.RootedGluingQuotient - -namespace OAI - - -namespace PartitionPilot - -namespace Compression.RecursiveMaps.CosetGeometry - -universe u -variable (J S : Type u) [Group J] - -theorem representative_exists (v : Vertex J S) : ∃ w, point J S w = v := by - induction v using Quotient.ind with - | _ w => exact ⟨w, rfl⟩ - -noncomputable def representative (v : Vertex J S) : External J S := by - classical - exact if v = root J S then 1 else Classical.choose (representative_exists J S v) - -theorem representative_spec (v : Vertex J S) : point J S (representative J S v) = v := by - classical - by_cases h : v = root J S - · subst v - simp only [representative] - rfl - · simp only [representative, ite_eq_right h] - exact Classical.choose_spec (representative_exists J S v) - -theorem representative_root : representative J S (root J S) = 1 := by - simp [representative] - -theorem coordinate_exists (w : External J S) : - ∃ j, representative J S (point J S w) * old J S j = w := - (point_eq J S _ w).mp (representative_spec J S (point J S w)) - -noncomputable def coordinate (w : External J S) : J := Classical.choose (coordinate_exists J S w) - -theorem coordinate_spec (w : External J S) : - representative J S (point J S w) * old J S (coordinate J S w) = w := - Classical.choose_spec (coordinate_exists J S w) - -theorem coordinate_unique (w : External J S) (j : J) - (eq : representative J S (point J S w) * old J S j = w) : coordinate J S w = j := - old_injective J S (mul_left_cancel ((coordinate_spec J S w).trans eq.symm)) - -theorem point_mul_old (w : External J S) (j : J) : point J S (w * old J S j) = point J S w := - ((point_eq J S w (w * old J S j)).mpr ⟨j, rfl⟩).symm - -theorem coordinate_mul_old (w : External J S) (j : J) : - coordinate J S (w * old J S j) = coordinate J S w * j := by - apply coordinate_unique J S - rw [point_mul_old, map_mul, ← mul_assoc, coordinate_spec] - -theorem coordinate_one : coordinate J S 1 = 1 := by - apply coordinate_unique J S - change representative J S (root J S) * old J S 1 = 1 - rw [representative_root, map_one, mul_one] - -theorem coordinate_old (j : J) : coordinate J S (old J S j) = j := by - have h := coordinate_mul_old J S 1 j - simpa only [one_mul, coordinate_one] using h - -structure OrderAction {A : Type u} (P : MeetOrder A) where - iso : J → MeetIso P P - one : ∀ x, (iso 1).toFun x = x - mul : ∀ g h x, (iso (g * h)).toFun x = (iso g).toFun ((iso h).toFun x) - -namespace OrderAction -variable {J S} {A : Type u} {P : MeetOrder A} (a : OrderAction J P) - -noncomputable def chart (w : External J S) : MeetIso P P := a.iso (coordinate J S w) - -theorem chart_one (x : A) : (a.chart (S := S) 1).toFun x = x := by - change (a.iso (coordinate J S 1)).toFun x = x - rw [coordinate_one, a.one] - -theorem chart_mul_old (w : External J S) (j : J) (x : A) : - (a.chart (w * old J S j)).toFun x = (a.chart w).toFun ((a.iso j).toFun x) := by - change (a.iso (coordinate J S (w * old J S j))).toFun x = _ - rw [coordinate_mul_old, a.mul] - rfl - -def Label (_a : OrderAction J P) := Vertex J S × A - -noncomputable def label (w : External J S) (x : A) : a.Label (S := S) := - (point J S w, (a.chart w).toFun x) - -theorem label_mul_old (w : External J S) (j : J) (x : A) : - a.label (w * old J S j) x = a.label w ((a.iso j).toFun x) := by - apply Prod.ext - · exact point_mul_old J S w j - · exact a.chart_mul_old w j x - -theorem label_same_rep (w : External J S) (x y : A) : a.label w x = a.label w y ↔ x = y := by - constructor - · intro eq - exact embedding_injective (a.chart w).toMeetEmbedding (congrArg Prod.snd eq) - · rintro rfl - rfl - -theorem label_eq_iff (w v : External J S) (x y : A) : - a.label w x = a.label v y ↔ ∃ j, w * old J S j = v ∧ x = (a.iso j).toFun y := by - constructor - · intro eq - have cosets := congrArg Prod.fst eq - rcases (point_eq J S w v).mp cosets with ⟨j, rfl⟩ - rw [a.label_mul_old] at eq - exact ⟨j, rfl, (a.label_same_rep _ _ _).mp eq⟩ - · rintro ⟨j, rfl, rfl⟩ - exact (a.label_mul_old w j y).symm - -def ideal (j : J) : IdealEmbedding P P where - toMeetEmbedding := (a.iso j).toMeetEmbedding - ideal _ x _ := ⟨(a.iso j).inverse x, (a.iso j).right_inverse x⟩ - -theorem fixes_top (T : A) (greatest : ∀ x, P.le x T) (j : J) : (a.iso j).toFun T = T := by - apply P.antisymm (greatest _) - have lower := ((a.iso j).le_iff _ _).mpr (greatest ((a.iso j).inverse T)) - rw [(a.iso j).right_inverse] at lower - exact lower - -end OrderAction - -def taskSystem_orderAction {A G Task Label : Type u} {P : MeetOrder A} - (f : TaskSystem P G Task Label) : - letI : Group G := groupOfData f.group - OrderAction G P := by - letI : Group G := groupOfData f.group - exact { iso := f.action, one := f.action_one, mul := f.action_mul } - -end Compression.RecursiveMaps.CosetGeometry - - - -namespace SetRealization - -open Compression.RecursiveMaps.CosetGeometry -universe u - -structure GeometryPresentation (A G : Type u) where - points : Presentation A - actors : Presentation G - -namespace GeometryPresentation - -variable {A G : Type u} [Group G] (s : GeometryPresentation A G) - -noncomputable def orderRelation (P : MeetOrder A) : ZFSet.{u} := - (s.points.product s.points).subset (fun xy => P.le xy.1 xy.2) - -noncomputable def meetGraph (P : MeetOrder A) : ZFSet.{u} := - (s.points.product s.points).graph s.points (fun xy => P.meet xy.1 xy.2) - -noncomputable def multiplicationGraph : ZFSet.{u} := - (s.actors.product s.actors).graph s.actors (fun gh => gh.1 * gh.2) - -noncomputable def inverseGraph : ZFSet.{u} := - s.actors.graph s.actors (fun g => g⁻¹) - -noncomputable def actionGraph (P : MeetOrder A) (a : OrderAction G P) : ZFSet.{u} := - (s.actors.product s.points).graph s.points (fun gx => (a.iso gx.1).toFun gx.2) - -noncomputable def package (P : MeetOrder A) (a : OrderAction G P) (bottom : A) : ZFSet.{u} := - ZFSet.pair s.points.carrier (ZFSet.pair s.actors.carrier - (ZFSet.pair (s.orderRelation P) (ZFSet.pair (s.meetGraph P) - (ZFSet.pair s.multiplicationGraph (ZFSet.pair s.inverseGraph - (ZFSet.pair (s.actionGraph P a) (ZFSet.pair (s.points.encode bottom) (s.actors.encode 1)))))))) - -omit [Group G] in -theorem orderRelation_iff (P : MeetOrder A) (x y : A) : - ZFSet.pair (s.points.encode x) (s.points.encode y) ∈ s.orderRelation P ↔ P.le x y := - (s.points.product s.points).encode_mem_subset (fun xy => P.le xy.1 xy.2) (x, y) - -omit [Group G] in -theorem meetGraph_iff (P : MeetOrder A) (x y z : A) : - ZFSet.pair (ZFSet.pair (s.points.encode x) (s.points.encode y)) (s.points.encode z) - ∈ s.meetGraph P ↔ P.meet x y = z := - (s.points.product s.points).pair_mem_graph s.points _ (x, y) z - -theorem multiplicationGraph_iff (g h k : G) : - ZFSet.pair (ZFSet.pair (s.actors.encode g) (s.actors.encode h)) (s.actors.encode k) - ∈ s.multiplicationGraph ↔ g * h = k := - (s.actors.product s.actors).pair_mem_graph s.actors _ (g, h) k - -theorem inverseGraph_iff (g h : G) : - ZFSet.pair (s.actors.encode g) (s.actors.encode h) ∈ s.inverseGraph ↔ g⁻¹ = h := - s.actors.pair_mem_graph s.actors _ g h - -theorem actionGraph_iff (P : MeetOrder A) (a : OrderAction G P) (g : G) (x y : A) : - ZFSet.pair (ZFSet.pair (s.actors.encode g) (s.points.encode x)) (s.points.encode y) - ∈ s.actionGraph P a ↔ (a.iso g).toFun x = y := - (s.actors.product s.points).pair_mem_graph s.points _ (g, x) y - -theorem operation_graphs_are_functions (P : MeetOrder A) (a : OrderAction G P) : - ZFSet.IsFunc (ZFSet.prod s.points.carrier s.points.carrier) s.points.carrier (s.meetGraph P) ∧ - ZFSet.IsFunc (ZFSet.prod s.actors.carrier s.actors.carrier) s.actors.carrier s.multiplicationGraph ∧ - ZFSet.IsFunc s.actors.carrier s.actors.carrier s.inverseGraph ∧ - ZFSet.IsFunc (ZFSet.prod s.actors.carrier s.points.carrier) s.points.carrier (s.actionGraph P a) := - ⟨(s.points.product s.points).graph_isFunc s.points _, - (s.actors.product s.actors).graph_isFunc s.actors _, - s.actors.graph_isFunc s.actors _, - (s.actors.product s.points).graph_isFunc s.points _⟩ - -structure RankBounds (P : MeetOrder A) (a : OrderAction G P) (bottom : A) (o : Ordinal.{u}) : Prop where - points : ZFSet.rank s.points.carrier < o - actors : ZFSet.rank s.actors.carrier < o - order_relation : ZFSet.rank (s.orderRelation P) < o - meet_graph : ZFSet.rank (s.meetGraph P) < o - multiplication_graph : ZFSet.rank s.multiplicationGraph < o - inverse_graph : ZFSet.rank s.inverseGraph < o - action_graph : ZFSet.rank (s.actionGraph P a) < o - bottom_code : ZFSet.rank (s.points.encode bottom) < o - identity_code : ZFSet.rank (s.actors.encode 1) < o - package : ZFSet.rank (s.package P a bottom) < o - -theorem rank_bounds (P : MeetOrder A) (a : OrderAction G P) (bottom : A) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (hp : ZFSet.rank s.points.carrier < o) (hg : ZFSet.rank s.actors.carrier < o) : - s.RankBounds P a bottom o := by - have pp := s.points.product_rank_lt limit s.points hp hp - have gg := s.actors.product_rank_lt limit s.actors hg hg - have gp := s.actors.product_rank_lt limit s.points hg hp - have orderBound : ZFSet.rank (s.orderRelation P) < o := - (s.points.product s.points).subset_rank_lt pp _ - have meetBound : ZFSet.rank (s.meetGraph P) < o := - (s.points.product s.points).graph_rank_lt s.points _ limit pp hp - have mulBound : ZFSet.rank s.multiplicationGraph < o := - (s.actors.product s.actors).graph_rank_lt s.actors _ limit gg hg - have invBound : ZFSet.rank s.inverseGraph < o := - s.actors.graph_rank_lt s.actors _ limit hg hg - have actionBound : ZFSet.rank (s.actionGraph P a) < o := - (s.actors.product s.points).graph_rank_lt s.points _ limit gp hp - have bottomBound : ZFSet.rank (s.points.encode bottom) < o := - (ZFSet.rank_lt_of_mem (s.points.encode_mem bottom)).trans hp - have oneBound : ZFSet.rank (s.actors.encode 1) < o := - (ZFSet.rank_lt_of_mem (s.actors.encode_mem 1)).trans hg - refine ⟨hp, hg, orderBound, meetBound, mulBound, invBound, actionBound, bottomBound, oneBound, ?_⟩ - exact rank_orderedPair_lt limit hp (rank_orderedPair_lt limit hg - (rank_orderedPair_lt limit orderBound (rank_orderedPair_lt limit meetBound - (rank_orderedPair_lt limit mulBound (rank_orderedPair_lt limit invBound - (rank_orderedPair_lt limit actionBound (rank_orderedPair_lt limit bottomBound oneBound))))))) - -end GeometryPresentation -end SetRealization - - - -namespace Compression.RecursiveMaps.TileRequests - -open Attachment -universe u -variable {A : Type u} (P : MeetOrder A) - -structure Tile (Child : Type u) where - Space : Type u - order : MeetOrder Space - root : IdealEmbedding P order - child : Child → IdealEmbedding P order - cover : ∀ z, (∃ x, root.toFun x = z) ∨ ∃ j x, (child j).toFun x = z - -namespace Tile -variable {P} - -noncomputable def binary (g : PrincipalAmalgamation.Input P P) : Tile P (ULift.{u} Unit) where - Space := g.Node - order := g.order - root := { toMeetEmbedding := g.left, ideal := g.left_ideal } - child _ := { toMeetEmbedding := g.right, ideal := g.right_ideal } - cover z := by - rcases g.cover z with ⟨x, eq⟩ | ⟨x, eq⟩ - · exact Or.inl ⟨x, eq⟩ - · exact Or.inr ⟨⟨()⟩, x, eq⟩ - -noncomputable def rectangle (r : Rectangle.Input P) : Tile P (ULift.{u} Bool) where - Space := r.copies.Node - order := r.copies.order - root := { toMeetEmbedding := r.root, ideal := r.copies.vertex_ideal .root } - child j := match j.down with - | false => { toMeetEmbedding := r.first, ideal := r.copies.vertex_ideal .one } - | true => { toMeetEmbedding := r.second, ideal := r.copies.vertex_ideal .two } - cover z := by - rcases r.three_vertex_cover z with ⟨i, x, eq⟩ - cases i with - | root => exact Or.inl ⟨x, eq⟩ - | one => exact Or.inr ⟨⟨false⟩, x, eq⟩ - | two => exact Or.inr ⟨⟨true⟩, x, eq⟩ - -end Tile - -inductive Request where - | separation (W : A) - | compression (K : A) (copy : MeetIso P (idealOrder P K)) - | rectangle (data : Rectangle.Input P) - -namespace Request -variable {P} - -def Child : Request P → Type u - | .separation _ => ULift.{u} Unit - | .compression _ _ => ULift.{u} Unit - | .rectangle _ => ULift.{u} Bool - -noncomputable def tile (T : A) (greatest : ∀ x, P.le x T) : (r : Request P) → Tile P r.Child - | .separation W => Tile.binary (BinaryTiles.separation P W) - | .compression K copy => Tile.binary (BinaryTiles.compression P T K greatest copy) - | .rectangle r => Tile.rectangle r - -theorem separation_agrees (T : A) (greatest : ∀ x, P.le x T) (W x : A) (below : P.le x W) : - (((Request.separation W).tile T greatest).child ⟨()⟩).toFun x = - ((Request.separation W).tile T greatest).root.toFun x := - BinaryTiles.separation_fixes P W x below - -theorem compression_agrees (T : A) (greatest : ∀ x, P.le x T) (K : A) - (copy : MeetIso P (idealOrder P K)) (x : A) : - (((Request.compression K copy).tile T greatest).child ⟨()⟩).toFun x = - ((Request.compression K copy).tile T greatest).root.toFun (copy.toFun x).val := - BinaryTiles.compression_identification P T K greatest copy x - -theorem rectangle_agrees (T : A) (greatest : ∀ x, P.le x T) (r : Rectangle.Input P) (x : A) - (below : P.le x r.C) : - (((Request.rectangle r).tile T greatest).child ⟨false⟩).toFun x = - ((Request.rectangle r).tile T greatest).root.toFun (r.g1.toFun x) ∧ - (((Request.rectangle r).tile T greatest).child ⟨true⟩).toFun x = - ((Request.rectangle r).tile T greatest).root.toFun (r.g2.toFun x) := - ⟨r.first_agrees x below, r.second_agrees x below⟩ - -end Request - -structure Family (R : Type u) where - top : A - greatest : ∀ x, P.le x top - request : R → Request P - -namespace Family -variable {P} {R : Type u} (f : Family P R) - -def Child (r : R) := (f.request r).Child -def Letters := Sigma f.Child -noncomputable def tile (r : R) : Tile P (f.Child r) := (f.request r).tile f.top f.greatest - -noncomputable def all (T : A) (greatest : ∀ x, P.le x T) : Family P (Request P) := - ⟨T, greatest, id⟩ - -end Family - -end Compression.RecursiveMaps.TileRequests - - - -namespace Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces - -open Attachment -universe u -variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) -variable {B : Type u} (value : ∀ v, g.Space v → B) - -def Realizes (v w : Vertex J S R) (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : Prop := - ∀ x : {x : g.Space w // (g.order w).le x i.rightAnchor}, - value w x.val = value v (i.overlap.toFun x).val - -theorem realizes_reindex {v w v' w' : Vertex J S R} (hv : v = v') (hw : w = w') - (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : - g.Realizes value v' w' (g.reindexInput hv hw i) ↔ g.Realizes value v w i := by - cases hv - cases hw - rfl - -def Equation (d : Dart J S R) : Prop := - ∀ x : {x : g.Space (source J S R request d) // - (g.order (source J S R request d)).le x (g.anchor d)}, - value (source J S R request d) x.val = - value (target J S R request d) ((g.arrow d).toFun x).val - -theorem equation_of_reverse (d : Dart J S R) (h : g.Equation value (reverse J S R d)) : - g.Equation value d := by - rcases d with ⟨e, b⟩ - cases b - · intro y - have eq := h ((g.overlap e).inverse y) - change value (source J S R request (e, true)) ((g.overlap e).inverse y).val = - value (target J S R request (e, true)) ((g.overlap e).toFun ((g.overlap e).inverse y)).val at eq - erw [(g.overlap e).right_inverse] at eq - exact eq.symm - · intro x - have eq := h ((g.overlap e).toFun x) - change value (target J S R request (e, true)) ((g.overlap e).toFun x).val = - value (source J S R request (e, true)) ((g.overlap e).inverse ((g.overlap e).toFun x)).val at eq - erw [(g.overlap e).left_inverse] at eq - exact eq.symm - -section -variable (parents : ∀ v (h : depth J S R request v ≠ 0), - g.Realizes value (parent J S R request v) v (g.localGlue v h)) -include parents - -theorem incoming_realizes (v : Vertex J S R) (nonroot : v ≠ root J S R) : - g.Realizes value (source J S R request (incoming J S R request v nonroot)) - (target J S R request (incoming J S R request v nonroot)) - (g.edgeInput (incoming J S R request v nonroot)) := by - have nonzero : depth J S R request v ≠ 0 := fun h => nonroot ((depth_zero_iff J S R request v).mp h) - exact (g.realizes_reindex value (parent_eq J S R request v nonroot).symm - (incoming_target J S R request v nonroot) _).mp (parents v nonzero) - -theorem equation_of_extension (d : Dart J S R) - (eq : rootPath J S R request (target J S R request d) = - rootPath J S R request (source J S R request d) ++ [d]) : g.Equation value d := by - have realized := g.incoming_realizes value parents (target J S R request d) - (extension_nonroot J S R request d eq) - rw [incoming_of_extension J S R request d eq] at realized - intro x - have same := realized ((g.arrow d).toFun x) - change value (target J S R request d) ((g.arrow d).toFun x).val = - value (source J S R request d) ((g.arrow d).inverse ((g.arrow d).toFun x)).val at same - rw [(g.arrow d).left_inverse] at same - exact same.symm - -theorem equations_of_parents (d : Dart J S R) : g.Equation value d := by - rcases edge_root_paths J S R request d with forward | backward - · exact g.equation_of_extension value parents d forward - · apply g.equation_of_reverse value d - apply g.equation_of_extension value parents (reverse J S R d) - simpa only [source_reverse, target_reverse] using backward - -end - -theorem edge_identification (d : Dart J S R) - (x : {x : g.Space (source J S R request d) // - (g.order (source J S R request d)).le x (g.anchor d)}) : - (g.vertex (source J S R request d)).toFun x.val = - (g.vertex (target J S R request d)).toFun ((g.arrow d).toFun x).val := - g.equations_of_parents (fun v => (g.vertex v).toFun) - (fun v h => g.parent_identification v h) d x - -end Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces - - - -namespace Compression.RecursiveMaps - -open RationalHeights -universe u v w - -namespace IdealEmbedding -variable {A : Type u} {B : Type v} {H : Type w} - {P : MeetOrder A} {Q : MeetOrder B} - -theorem projection_mono (f : IdealEmbedding P Q) (top : A) {x y : B} - (lower : Q.le x y) : P.le (f.projection top x) (f.projection top y) := by - apply (f.le_iff _ _).mp - rw [f.projection_spec, f.projection_spec] - exact Q.le_meet (Q.trans (Q.meet_le_left _ _) lower) (Q.meet_le_right _ _) - -theorem projection_image (f : IdealEmbedding P Q) (top : A) - (greatest : ∀ a, P.le a top) (a : A) : f.projection top (f.toFun a) = a := by - apply embedding_injective f.toMeetEmbedding - rw [f.projection_spec] - exact Q.antisymm (Q.meet_le_left _ _) - (Q.le_meet (Q.refl _) ((f.le_iff _ _).mpr (greatest a))) - -theorem projected_strict (f : IdealEmbedding P Q) (top : A) - (greatest : ∀ a, P.le a top) {R : HeightOrder H} (height : StrictHeight P R) - (x y : B) (lower : Q.le x y) (different : x ≠ y) (in_copy : ∃ a, f.toFun a = y) : - R.lt (height.value (f.projection top x)) (height.value (f.projection top y)) := by - rcases in_copy with ⟨b, rfl⟩ - rcases f.ideal b x lower with ⟨a, rfl⟩ - rw [f.projection_image top greatest, f.projection_image top greatest] - exact height.strict a b ((f.le_iff _ _).mp lower) - (fun eq => different (congrArg f.toFun eq)) - -end IdealEmbedding - -namespace LinearHeightOrder -variable {H : Type u} {K : Type v} - -theorem lex_weak (R : LinearHeightOrder H) (S : LinearHeightOrder K) {x y : H × K} - (first : R.Weak x.1 y.1) (second : S.Weak x.2 y.2) : (R.lex S).Weak x y := by - rcases first with eq | lower - · rcases second with eq' | lower - · exact Or.inl (Prod.ext eq eq') - · exact Or.inr (Or.inr ⟨eq, lower⟩) - · exact Or.inr (Or.inl lower) - -theorem lex_strict (R : LinearHeightOrder H) (S : LinearHeightOrder K) {x y : H × K} - (first : R.Weak x.1 y.1) - (strict : R.lt x.1 y.1 ∨ S.lt x.2 y.2) : (R.lex S).lt x y := by - rcases first with eq | lower - · rcases strict with lower | lower - · exact False.elim (R.irrefl _ (eq ▸ lower)) - · exact Or.inr ⟨eq, lower⟩ - · exact Or.inl lower - -end LinearHeightOrder - -theorem countable_range_pair {X : Type u} {H : Type v} {K : Type w} - {f : X → H} {g : X → K} (hf : CountableRange f) (hg : CountableRange g) : - CountableRange (fun x => (f x, g x)) := by - rcases hf with ⟨a, ha⟩ - rcases hg with ⟨b, hb⟩ - exact ⟨fun x => natPair (a x) (b x), fun x y eq => - Prod.ext (ha x y (natPair_injective eq).1) (hb x y (natPair_injective eq).2)⟩ - -theorem countable_range_precompose {X : Type u} {Y : Type v} {H : Type w} - {f : Y → H} (hf : CountableRange f) (g : X → Y) : CountableRange (fun x => f (g x)) := by - rcases hf with ⟨code, equal⟩ - exact ⟨fun x => code (g x), fun x y eq => equal (g x) (g y) eq⟩ - -namespace RationalHeights - -def zero : Rational := Rational.mk ⟨0, 1, by decide⟩ -def one : Rational := Rational.mk ⟨1, 1, by decide⟩ - -theorem zero_lt_one : Rational.lt zero one := by - change (0 : Int) * 1 < 1 * 1 - decide - -theorem rational_assignment {X : Type u} {H : Type v} {P : MeetOrder X} - (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) - (base : X) (countable : CountableRange seed.value) : - ∃ height : StrictHeight P Rational.order.toHeightOrder, - ∀ x, Rational.lt zero (height.value x) ∧ Rational.lt (height.value x) one := by - rcases countable_range_interpolation R Rational.order seed.value base countable - zero one zero_lt_one with ⟨assign, bounds, strict, _⟩ - exact ⟨⟨assign, fun x y lower different => strict x y (seed.strict x y lower different)⟩, bounds⟩ - -end RationalHeights - -namespace TileRequests.Tile -variable {A : Type u} {H : Type v} {P : MeetOrder A} - (top : A) (greatest : ∀ a, P.le a top) - (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) - -noncomputable def binaryTuple (t : Tile P (ULift.{u} Unit)) : - StrictHeight t.order (R.lex R).toHeightOrder where - value x := (seed.value (t.root.projection top x), - seed.value ((t.child ⟨()⟩).projection top x)) - strict x y lower different := by - apply R.lex_strict R (seed.mono (t.root.projection_mono top lower)) - rcases t.cover y with root | ⟨j, a, eq⟩ - · exact Or.inl (t.root.projected_strict top greatest seed x y lower different root) - · rcases j with ⟨⟨⟩⟩ - exact Or.inr ((t.child ⟨()⟩).projected_strict top greatest seed x y lower different ⟨a, eq⟩) - -noncomputable def rectangleTuple (t : Tile P (ULift.{u} Bool)) : - StrictHeight t.order (R.lex (R.lex R)).toHeightOrder where - value x := (seed.value (t.root.projection top x), - seed.value ((t.child ⟨false⟩).projection top x), - seed.value ((t.child ⟨true⟩).projection top x)) - strict x y lower different := by - apply R.lex_strict (R.lex R) (seed.mono (t.root.projection_mono top lower)) - rcases t.cover y with root | ⟨j, a, eq⟩ - · exact Or.inl (t.root.projected_strict top greatest seed x y lower different root) - · apply Or.inr - apply R.lex_strict R (seed.mono ((t.child ⟨false⟩).projection_mono top lower)) - rcases j with ⟨j⟩ - cases j with - | false => exact Or.inl ((t.child ⟨false⟩).projected_strict top greatest seed - x y lower different ⟨a, eq⟩) - | true => exact Or.inr ((t.child ⟨true⟩).projected_strict top greatest seed - x y lower different ⟨a, eq⟩) - -theorem binaryTuple_countable (countable : CountableRange seed.value) - (t : Tile P (ULift.{u} Unit)) : CountableRange (binaryTuple top greatest R seed t).value := - countable_range_pair (countable_range_precompose countable (t.root.projection top)) - (countable_range_precompose countable ((t.child ⟨()⟩).projection top)) - -theorem rectangleTuple_countable (countable : CountableRange seed.value) - (t : Tile P (ULift.{u} Bool)) : CountableRange (rectangleTuple top greatest R seed t).value := - countable_range_pair (countable_range_precompose countable (t.root.projection top)) - (countable_range_pair - (countable_range_precompose countable ((t.child ⟨false⟩).projection top)) - (countable_range_precompose countable ((t.child ⟨true⟩).projection top))) - -noncomputable def binaryHeight (countable : CountableRange seed.value) - (t : Tile P (ULift.{u} Unit)) : StrictHeight t.order Rational.order.toHeightOrder := - Classical.choose (rational_assignment (R.lex R) (binaryTuple top greatest R seed t) - (t.root.toFun top) (binaryTuple_countable top greatest R seed countable t)) - -noncomputable def rectangleHeight (countable : CountableRange seed.value) - (t : Tile P (ULift.{u} Bool)) : StrictHeight t.order Rational.order.toHeightOrder := - Classical.choose (rational_assignment (R.lex (R.lex R)) (rectangleTuple top greatest R seed t) - (t.root.toFun top) (rectangleTuple_countable top greatest R seed countable t)) - -end TileRequests.Tile - -namespace TileRequests.Request -variable {A : Type u} {H : Type v} {P : MeetOrder A} - (top : A) (greatest : ∀ a, P.le a top) - (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) - (countable : CountableRange seed.value) - -noncomputable def rationalHeight : (r : Request P) → - StrictHeight (r.tile top greatest).order Rational.order.toHeightOrder - | .separation _ => Tile.binaryHeight top greatest R seed countable _ - | .compression _ _ => Tile.binaryHeight top greatest R seed countable _ - | .rectangle _ => Tile.rectangleHeight top greatest R seed countable _ - -end TileRequests.Request - -end Compression.RecursiveMaps - - - -namespace Compression.RecursiveMaps - -open RationalHeights -universe u v - -namespace PrincipalBatch.Family -variable {A I : Type u} {H : Type v} {P : MeetOrder A} {R : HeightOrder H} - (b : PrincipalBatch.Family P I) (old : StrictHeight P R) - (component : ∀ i, StrictHeight (b.order i) R) - -def heightValue : b.Node → H - | .inl x => old.value x - | .inr x => (component x.1).value x.2.val - -def extendHeight - (above : ∀ x (y : b.Fresh), R.lt (old.value x) ((component y.1).value y.2.val)) : - StrictHeight b.extension R where - value := b.heightValue old component - strict x y lower different := by - cases x with - | inl x => - cases y with - | inl y => exact old.strict x y lower (fun eq => different (congrArg Sum.inl eq)) - | inr y => exact above x y - | inr x => - cases y with - | inl y => exact False.elim lower - | inr y => - rcases lower with inside | impossible - · rcases x with ⟨i, x, hx⟩ - rcases y with ⟨j, y, hy⟩ - rcases inside with ⟨eq, inside⟩ - cases eq - apply (component i).strict x y inside - intro eq - cases eq - exact different rfl - · exact False.elim impossible - -end PrincipalBatch.Family - -namespace IdealChain -variable (c : IdealChain.{u}) {H : Type v} (R : HeightOrder H) - -structure HeightSystem where - height : ∀ n, StrictHeight (c.order n) R - step : ∀ n x, (height (n + 1)).value ((c.next n).toFun x) = (height n).value x - -namespace HeightSystem -variable {c R} (h : HeightSystem c R) - -theorem up {n m : Nat} (lower : n ≤ m) (x : c.Point n) : - (h.height m).value (c.up lower x) = (h.height n).value x := by - induction lower with - | refl => rw [c.up_self] - | @step m lower ih => rw [c.up_succ lower, h.step, ih] - -def value : c.Union → H := Quotient.lift (fun x => (h.height x.1).value x.2) (by - intro x y related - rcases related with ⟨k, hx, hy, eq⟩ - exact (h.up hx x.2).symm.trans ((congrArg (h.height k).value eq).trans (h.up hy y.2))) - -theorem value_point (n : Nat) (x : c.Point n) : - h.value (c.point n x) = (h.height n).value x := rfl - -def unionHeight : StrictHeight c.unionOrder R where - value := h.value - strict x y lower different := by - rcases c.pair_cover x y with ⟨n, x, y, rfl, rfl⟩ - exact (h.height n).strict x y ((c.le_stage n x y).mp lower) - (fun eq => different (congrArg (c.point n) eq)) - -theorem unionHeight_countable (countable : ∀ n, CountableRange (h.height n).value) : - CountableRange h.unionHeight.value := by - classical - let code (n : Nat) : c.Point n → Nat := Classical.choose (countable n) - have equal (n : Nat) := Classical.choose_spec (countable n) - let labelValue (x : c.Label) := (h.height x.1).value x.2 - have label_equal (x y : c.Label) - (eq : natPair x.1 (code x.1 x.2) = natPair y.1 (code y.1 y.2)) : - labelValue x = labelValue y := by - rcases x with ⟨n, x⟩ - rcases y with ⟨m, y⟩ - rcases natPair_injective eq with ⟨same, codes⟩ - cases same - exact equal n x y codes - have out_value (x : c.Union) : labelValue (Quotient.out x) = h.value x := - congrArg h.value (Quotient.out_eq x) - refine ⟨fun x => natPair (Quotient.out x).1 - (code (Quotient.out x).1 (Quotient.out x).2), ?_⟩ - intro x y eq - exact (out_value x).symm.trans ((label_equal _ _ eq).trans (out_value y)) - -end HeightSystem -end IdealChain - -namespace RootedGluing.Scheme -variable {V : Type u} {Column : Type v} (d : RootedGluing.Scheme V) - (C : LinearHeightOrder Column) (column : Nat → Column) - (increasing : ∀ n, C.lt (column n) (column (n + 1))) - (seed : StrictHeight (d.order d.root) (lexOrder C).toHeightOrder) - (seed_bound : ∀ x, C.lt (seed.value x).1 (column 0)) - (localHeight : ∀ v, StrictHeight (d.order v) Rational.order.toHeightOrder) - -structure BoundedHeight (n : Nat) where - height : StrictHeight (d.stages n).order (lexOrder C).toHeightOrder - bound : ∀ x, C.lt (height.value x).1 (column n) - -noncomputable def nextBounded (n : Nat) (old : d.BoundedHeight C column n) : - d.BoundedHeight C column (n + 1) := { - height := (d.stages n).batch.extendHeight old.height - (fun i => { - value := fun x => (column n, (localHeight i.val).value x) - strict := fun x y lower different => - Or.inr ⟨rfl, (localHeight i.val).strict x y lower different⟩ }) - (fun x _ => Or.inl (old.bound x)) - bound := by - intro x - cases x with - | inl x => exact C.trans (old.bound x) (increasing n) - | inr x => exact increasing n } - -noncomputable def boundedStages : (n : Nat) → d.BoundedHeight C column n - | 0 => ⟨seed, seed_bound⟩ - | n + 1 => d.nextBounded C column increasing localHeight n (boundedStages n) - -noncomputable def heightSystem : d.chain.HeightSystem (lexOrder C).toHeightOrder where - height n := (d.boundedStages C column increasing seed seed_bound localHeight n).height - step _ _ := rfl - -noncomputable def externalHeight : StrictHeight d.gluedOrder (lexOrder C).toHeightOrder := - (d.heightSystem C column increasing seed seed_bound localHeight).unionHeight - -theorem externalHeight_stage (n : Nat) (x : (d.stages n).Point) : - (d.externalHeight C column increasing seed seed_bound localHeight).value (d.chain.point n x) = - (d.boundedStages C column increasing seed seed_bound localHeight n).height.value x := rfl - -theorem externalHeight_original (x : d.Space d.root) : - (d.externalHeight C column increasing seed seed_bound localHeight).value - ((d.vertex d.root).toFun x) = seed.value x := by - rw [d.vertex_at d.root 0 d.depth_root.le] - rfl - -theorem boundedStages_countable (seed_countable : CountableRange seed.value) (n : Nat) : - CountableRange (d.boundedStages C column increasing seed seed_bound localHeight n).height.value := by - induction n with - | zero => exact seed_countable - | succ n ih => - rcases ih with ⟨oldCode, old_equal⟩ - let code : (d.stages (n + 1)).Point → Nat - | .inl x => 2 * oldCode x - | .inr x => 2 * Rational.code ((localHeight x.1.val).value x.2.val) + 1 - refine ⟨code, ?_⟩ - intro x y eq - cases x with - | inl x => - cases y with - | inl y => exact old_equal x y (by change 2 * oldCode x = 2 * oldCode y at eq; omega) - | inr y => change 2 * oldCode x = 2 * _ + 1 at eq; omega - | inr x => - cases y with - | inl y => change 2 * _ + 1 = 2 * oldCode y at eq; omega - | inr y => - change (column n, (localHeight x.1.val).value x.2.val) = - (column n, (localHeight y.1.val).value y.2.val) - refine Prod.ext rfl ?_ - apply Rational.code_injective - change 2 * Rational.code ((localHeight x.1.val).value x.2.val) + 1 = - 2 * Rational.code ((localHeight y.1.val).value y.2.val) + 1 at eq - dsimp only - omega - -theorem externalHeight_countable (seed_countable : CountableRange seed.value) : - CountableRange (d.externalHeight C column increasing seed seed_bound localHeight).value := - (d.heightSystem C column increasing seed seed_bound localHeight).unionHeight_countable - (d.boundedStages_countable C column increasing seed seed_bound localHeight seed_countable) - -theorem externalHeight_column_bound (cap : Column) (above : ∀ n, C.lt (column n) cap) - (x : d.Node) : - C.lt ((d.externalHeight C column increasing seed seed_bound localHeight).value x).1 cap := by - rcases d.chain.cover x with ⟨n, x, rfl⟩ - exact C.trans ((d.boundedStages C column increasing seed seed_bound localHeight n).bound x) (above n) - -end RootedGluing.Scheme - -end Compression.RecursiveMaps - -end PartitionPilot - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.NatUnionCodes +import OAI.SetTheory.PartitionPrinciple.Models.RootedGluingQuotient + +namespace OAI + + +namespace PartitionPilot + +namespace Compression.RecursiveMaps.CosetGeometry + +universe u +variable (J S : Type u) [Group J] + +theorem representative_exists (v : Vertex J S) : ∃ w, point J S w = v := by + induction v using Quotient.ind with + | _ w => exact ⟨w, rfl⟩ + +noncomputable def representative (v : Vertex J S) : External J S := by + classical + exact if v = root J S then 1 else Classical.choose (representative_exists J S v) + +theorem representative_spec (v : Vertex J S) : point J S (representative J S v) = v := by + classical + by_cases h : v = root J S + · subst v + simp only [representative] + rfl + · simp only [representative, ite_eq_right h] + exact Classical.choose_spec (representative_exists J S v) + +theorem representative_root : representative J S (root J S) = 1 := by + simp [representative] + +theorem coordinate_exists (w : External J S) : + ∃ j, representative J S (point J S w) * old J S j = w := + (point_eq J S _ w).mp (representative_spec J S (point J S w)) + +noncomputable def coordinate (w : External J S) : J := Classical.choose (coordinate_exists J S w) + +theorem coordinate_spec (w : External J S) : + representative J S (point J S w) * old J S (coordinate J S w) = w := + Classical.choose_spec (coordinate_exists J S w) + +theorem coordinate_unique (w : External J S) (j : J) + (eq : representative J S (point J S w) * old J S j = w) : coordinate J S w = j := + old_injective J S (mul_left_cancel ((coordinate_spec J S w).trans eq.symm)) + +theorem point_mul_old (w : External J S) (j : J) : point J S (w * old J S j) = point J S w := + ((point_eq J S w (w * old J S j)).mpr ⟨j, rfl⟩).symm + +theorem coordinate_mul_old (w : External J S) (j : J) : + coordinate J S (w * old J S j) = coordinate J S w * j := by + apply coordinate_unique J S + rw [point_mul_old, map_mul, ← mul_assoc, coordinate_spec] + +theorem coordinate_one : coordinate J S 1 = 1 := by + apply coordinate_unique J S + change representative J S (root J S) * old J S 1 = 1 + rw [representative_root, map_one, mul_one] + +theorem coordinate_old (j : J) : coordinate J S (old J S j) = j := by + have h := coordinate_mul_old J S 1 j + simpa only [one_mul, coordinate_one] using h + +structure OrderAction {A : Type u} (P : MeetOrder A) where + iso : J → MeetIso P P + one : ∀ x, (iso 1).toFun x = x + mul : ∀ g h x, (iso (g * h)).toFun x = (iso g).toFun ((iso h).toFun x) + +namespace OrderAction +variable {J S} {A : Type u} {P : MeetOrder A} (a : OrderAction J P) + +noncomputable def chart (w : External J S) : MeetIso P P := a.iso (coordinate J S w) + +theorem chart_one (x : A) : (a.chart (S := S) 1).toFun x = x := by + change (a.iso (coordinate J S 1)).toFun x = x + rw [coordinate_one, a.one] + +theorem chart_mul_old (w : External J S) (j : J) (x : A) : + (a.chart (w * old J S j)).toFun x = (a.chart w).toFun ((a.iso j).toFun x) := by + change (a.iso (coordinate J S (w * old J S j))).toFun x = _ + rw [coordinate_mul_old, a.mul] + rfl + +def Label (_a : OrderAction J P) := Vertex J S × A + +noncomputable def label (w : External J S) (x : A) : a.Label (S := S) := + (point J S w, (a.chart w).toFun x) + +theorem label_mul_old (w : External J S) (j : J) (x : A) : + a.label (w * old J S j) x = a.label w ((a.iso j).toFun x) := by + apply Prod.ext + · exact point_mul_old J S w j + · exact a.chart_mul_old w j x + +theorem label_same_rep (w : External J S) (x y : A) : a.label w x = a.label w y ↔ x = y := by + constructor + · intro eq + exact embedding_injective (a.chart w).toMeetEmbedding (congrArg Prod.snd eq) + · rintro rfl + rfl + +theorem label_eq_iff (w v : External J S) (x y : A) : + a.label w x = a.label v y ↔ ∃ j, w * old J S j = v ∧ x = (a.iso j).toFun y := by + constructor + · intro eq + have cosets := congrArg Prod.fst eq + rcases (point_eq J S w v).mp cosets with ⟨j, rfl⟩ + rw [a.label_mul_old] at eq + exact ⟨j, rfl, (a.label_same_rep _ _ _).mp eq⟩ + · rintro ⟨j, rfl, rfl⟩ + exact (a.label_mul_old w j y).symm + +def ideal (j : J) : IdealEmbedding P P where + toMeetEmbedding := (a.iso j).toMeetEmbedding + ideal _ x _ := ⟨(a.iso j).inverse x, (a.iso j).right_inverse x⟩ + +theorem fixes_top (T : A) (greatest : ∀ x, P.le x T) (j : J) : (a.iso j).toFun T = T := by + apply P.antisymm (greatest _) + have lower := ((a.iso j).le_iff _ _).mpr (greatest ((a.iso j).inverse T)) + rw [(a.iso j).right_inverse] at lower + exact lower + +end OrderAction + +def taskSystem_orderAction {A G Task Label : Type u} {P : MeetOrder A} + (f : TaskSystem P G Task Label) : + letI : Group G := groupOfData f.group + OrderAction G P := by + letI : Group G := groupOfData f.group + exact { iso := f.action, one := f.action_one, mul := f.action_mul } + +end Compression.RecursiveMaps.CosetGeometry + + + +namespace SetRealization + +open Compression.RecursiveMaps.CosetGeometry +universe u + +structure GeometryPresentation (A G : Type u) where + points : Presentation A + actors : Presentation G + +namespace GeometryPresentation + +variable {A G : Type u} [Group G] (s : GeometryPresentation A G) + +noncomputable def orderRelation (P : MeetOrder A) : ZFSet.{u} := + (s.points.product s.points).subset (fun xy => P.le xy.1 xy.2) + +noncomputable def meetGraph (P : MeetOrder A) : ZFSet.{u} := + (s.points.product s.points).graph s.points (fun xy => P.meet xy.1 xy.2) + +noncomputable def multiplicationGraph : ZFSet.{u} := + (s.actors.product s.actors).graph s.actors (fun gh => gh.1 * gh.2) + +noncomputable def inverseGraph : ZFSet.{u} := + s.actors.graph s.actors (fun g => g⁻¹) + +noncomputable def actionGraph (P : MeetOrder A) (a : OrderAction G P) : ZFSet.{u} := + (s.actors.product s.points).graph s.points (fun gx => (a.iso gx.1).toFun gx.2) + +noncomputable def package (P : MeetOrder A) (a : OrderAction G P) (bottom : A) : ZFSet.{u} := + ZFSet.pair s.points.carrier (ZFSet.pair s.actors.carrier + (ZFSet.pair (s.orderRelation P) (ZFSet.pair (s.meetGraph P) + (ZFSet.pair s.multiplicationGraph (ZFSet.pair s.inverseGraph + (ZFSet.pair (s.actionGraph P a) (ZFSet.pair (s.points.encode bottom) (s.actors.encode 1)))))))) + +omit [Group G] in +theorem orderRelation_iff (P : MeetOrder A) (x y : A) : + ZFSet.pair (s.points.encode x) (s.points.encode y) ∈ s.orderRelation P ↔ P.le x y := + (s.points.product s.points).encode_mem_subset (fun xy => P.le xy.1 xy.2) (x, y) + +omit [Group G] in +theorem meetGraph_iff (P : MeetOrder A) (x y z : A) : + ZFSet.pair (ZFSet.pair (s.points.encode x) (s.points.encode y)) (s.points.encode z) + ∈ s.meetGraph P ↔ P.meet x y = z := + (s.points.product s.points).pair_mem_graph s.points _ (x, y) z + +theorem multiplicationGraph_iff (g h k : G) : + ZFSet.pair (ZFSet.pair (s.actors.encode g) (s.actors.encode h)) (s.actors.encode k) + ∈ s.multiplicationGraph ↔ g * h = k := + (s.actors.product s.actors).pair_mem_graph s.actors _ (g, h) k + +theorem inverseGraph_iff (g h : G) : + ZFSet.pair (s.actors.encode g) (s.actors.encode h) ∈ s.inverseGraph ↔ g⁻¹ = h := + s.actors.pair_mem_graph s.actors _ g h + +theorem actionGraph_iff (P : MeetOrder A) (a : OrderAction G P) (g : G) (x y : A) : + ZFSet.pair (ZFSet.pair (s.actors.encode g) (s.points.encode x)) (s.points.encode y) + ∈ s.actionGraph P a ↔ (a.iso g).toFun x = y := + (s.actors.product s.points).pair_mem_graph s.points _ (g, x) y + +theorem operation_graphs_are_functions (P : MeetOrder A) (a : OrderAction G P) : + ZFSet.IsFunc (ZFSet.prod s.points.carrier s.points.carrier) s.points.carrier (s.meetGraph P) ∧ + ZFSet.IsFunc (ZFSet.prod s.actors.carrier s.actors.carrier) s.actors.carrier s.multiplicationGraph ∧ + ZFSet.IsFunc s.actors.carrier s.actors.carrier s.inverseGraph ∧ + ZFSet.IsFunc (ZFSet.prod s.actors.carrier s.points.carrier) s.points.carrier (s.actionGraph P a) := + ⟨(s.points.product s.points).graph_isFunc s.points _, + (s.actors.product s.actors).graph_isFunc s.actors _, + s.actors.graph_isFunc s.actors _, + (s.actors.product s.points).graph_isFunc s.points _⟩ + +structure RankBounds (P : MeetOrder A) (a : OrderAction G P) (bottom : A) (o : Ordinal.{u}) : Prop where + points : ZFSet.rank s.points.carrier < o + actors : ZFSet.rank s.actors.carrier < o + order_relation : ZFSet.rank (s.orderRelation P) < o + meet_graph : ZFSet.rank (s.meetGraph P) < o + multiplication_graph : ZFSet.rank s.multiplicationGraph < o + inverse_graph : ZFSet.rank s.inverseGraph < o + action_graph : ZFSet.rank (s.actionGraph P a) < o + bottom_code : ZFSet.rank (s.points.encode bottom) < o + identity_code : ZFSet.rank (s.actors.encode 1) < o + package : ZFSet.rank (s.package P a bottom) < o + +theorem rank_bounds (P : MeetOrder A) (a : OrderAction G P) (bottom : A) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (hp : ZFSet.rank s.points.carrier < o) (hg : ZFSet.rank s.actors.carrier < o) : + s.RankBounds P a bottom o := by + have pp := s.points.product_rank_lt limit s.points hp hp + have gg := s.actors.product_rank_lt limit s.actors hg hg + have gp := s.actors.product_rank_lt limit s.points hg hp + have orderBound : ZFSet.rank (s.orderRelation P) < o := + (s.points.product s.points).subset_rank_lt pp _ + have meetBound : ZFSet.rank (s.meetGraph P) < o := + (s.points.product s.points).graph_rank_lt s.points _ limit pp hp + have mulBound : ZFSet.rank s.multiplicationGraph < o := + (s.actors.product s.actors).graph_rank_lt s.actors _ limit gg hg + have invBound : ZFSet.rank s.inverseGraph < o := + s.actors.graph_rank_lt s.actors _ limit hg hg + have actionBound : ZFSet.rank (s.actionGraph P a) < o := + (s.actors.product s.points).graph_rank_lt s.points _ limit gp hp + have bottomBound : ZFSet.rank (s.points.encode bottom) < o := + (ZFSet.rank_lt_of_mem (s.points.encode_mem bottom)).trans hp + have oneBound : ZFSet.rank (s.actors.encode 1) < o := + (ZFSet.rank_lt_of_mem (s.actors.encode_mem 1)).trans hg + refine ⟨hp, hg, orderBound, meetBound, mulBound, invBound, actionBound, bottomBound, oneBound, ?_⟩ + exact rank_orderedPair_lt limit hp (rank_orderedPair_lt limit hg + (rank_orderedPair_lt limit orderBound (rank_orderedPair_lt limit meetBound + (rank_orderedPair_lt limit mulBound (rank_orderedPair_lt limit invBound + (rank_orderedPair_lt limit actionBound (rank_orderedPair_lt limit bottomBound oneBound))))))) + +end GeometryPresentation +end SetRealization + + + +namespace Compression.RecursiveMaps.TileRequests + +open Attachment +universe u +variable {A : Type u} (P : MeetOrder A) + +structure Tile (Child : Type u) where + Space : Type u + order : MeetOrder Space + root : IdealEmbedding P order + child : Child → IdealEmbedding P order + cover : ∀ z, (∃ x, root.toFun x = z) ∨ ∃ j x, (child j).toFun x = z + +namespace Tile +variable {P} + +noncomputable def binary (g : PrincipalAmalgamation.Input P P) : Tile P (ULift.{u} Unit) where + Space := g.Node + order := g.order + root := { toMeetEmbedding := g.left, ideal := g.left_ideal } + child _ := { toMeetEmbedding := g.right, ideal := g.right_ideal } + cover z := by + rcases g.cover z with ⟨x, eq⟩ | ⟨x, eq⟩ + · exact Or.inl ⟨x, eq⟩ + · exact Or.inr ⟨⟨()⟩, x, eq⟩ + +noncomputable def rectangle (r : Rectangle.Input P) : Tile P (ULift.{u} Bool) where + Space := r.copies.Node + order := r.copies.order + root := { toMeetEmbedding := r.root, ideal := r.copies.vertex_ideal .root } + child j := match j.down with + | false => { toMeetEmbedding := r.first, ideal := r.copies.vertex_ideal .one } + | true => { toMeetEmbedding := r.second, ideal := r.copies.vertex_ideal .two } + cover z := by + rcases r.three_vertex_cover z with ⟨i, x, eq⟩ + cases i with + | root => exact Or.inl ⟨x, eq⟩ + | one => exact Or.inr ⟨⟨false⟩, x, eq⟩ + | two => exact Or.inr ⟨⟨true⟩, x, eq⟩ + +end Tile + +inductive Request where + | separation (W : A) + | compression (K : A) (copy : MeetIso P (idealOrder P K)) + | rectangle (data : Rectangle.Input P) + +namespace Request +variable {P} + +def Child : Request P → Type u + | .separation _ => ULift.{u} Unit + | .compression _ _ => ULift.{u} Unit + | .rectangle _ => ULift.{u} Bool + +noncomputable def tile (T : A) (greatest : ∀ x, P.le x T) : (r : Request P) → Tile P r.Child + | .separation W => Tile.binary (BinaryTiles.separation P W) + | .compression K copy => Tile.binary (BinaryTiles.compression P T K greatest copy) + | .rectangle r => Tile.rectangle r + +theorem separation_agrees (T : A) (greatest : ∀ x, P.le x T) (W x : A) (below : P.le x W) : + (((Request.separation W).tile T greatest).child ⟨()⟩).toFun x = + ((Request.separation W).tile T greatest).root.toFun x := + BinaryTiles.separation_fixes P W x below + +theorem compression_agrees (T : A) (greatest : ∀ x, P.le x T) (K : A) + (copy : MeetIso P (idealOrder P K)) (x : A) : + (((Request.compression K copy).tile T greatest).child ⟨()⟩).toFun x = + ((Request.compression K copy).tile T greatest).root.toFun (copy.toFun x).val := + BinaryTiles.compression_identification P T K greatest copy x + +theorem rectangle_agrees (T : A) (greatest : ∀ x, P.le x T) (r : Rectangle.Input P) (x : A) + (below : P.le x r.C) : + (((Request.rectangle r).tile T greatest).child ⟨false⟩).toFun x = + ((Request.rectangle r).tile T greatest).root.toFun (r.g1.toFun x) ∧ + (((Request.rectangle r).tile T greatest).child ⟨true⟩).toFun x = + ((Request.rectangle r).tile T greatest).root.toFun (r.g2.toFun x) := + ⟨r.first_agrees x below, r.second_agrees x below⟩ + +end Request + +structure Family (R : Type u) where + top : A + greatest : ∀ x, P.le x top + request : R → Request P + +namespace Family +variable {P} {R : Type u} (f : Family P R) + +def Child (r : R) := (f.request r).Child +def Letters := Sigma f.Child +noncomputable def tile (r : R) : Tile P (f.Child r) := (f.request r).tile f.top f.greatest + +noncomputable def all (T : A) (greatest : ∀ x, P.le x T) : Family P (Request P) := + ⟨T, greatest, id⟩ + +end Family + +end Compression.RecursiveMaps.TileRequests + + + +namespace Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces + +open Attachment +universe u +variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) +variable {B : Type u} (value : ∀ v, g.Space v → B) + +def Realizes (v w : Vertex J S R) (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : Prop := + ∀ x : {x : g.Space w // (g.order w).le x i.rightAnchor}, + value w x.val = value v (i.overlap.toFun x).val + +theorem realizes_reindex {v w v' w' : Vertex J S R} (hv : v = v') (hw : w = w') + (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : + g.Realizes value v' w' (g.reindexInput hv hw i) ↔ g.Realizes value v w i := by + cases hv + cases hw + rfl + +def Equation (d : Dart J S R) : Prop := + ∀ x : {x : g.Space (source J S R request d) // + (g.order (source J S R request d)).le x (g.anchor d)}, + value (source J S R request d) x.val = + value (target J S R request d) ((g.arrow d).toFun x).val + +theorem equation_of_reverse (d : Dart J S R) (h : g.Equation value (reverse J S R d)) : + g.Equation value d := by + rcases d with ⟨e, b⟩ + cases b + · intro y + have eq := h ((g.overlap e).inverse y) + change value (source J S R request (e, true)) ((g.overlap e).inverse y).val = + value (target J S R request (e, true)) ((g.overlap e).toFun ((g.overlap e).inverse y)).val at eq + erw [(g.overlap e).right_inverse] at eq + exact eq.symm + · intro x + have eq := h ((g.overlap e).toFun x) + change value (target J S R request (e, true)) ((g.overlap e).toFun x).val = + value (source J S R request (e, true)) ((g.overlap e).inverse ((g.overlap e).toFun x)).val at eq + erw [(g.overlap e).left_inverse] at eq + exact eq.symm + +section +variable (parents : ∀ v (h : depth J S R request v ≠ 0), + g.Realizes value (parent J S R request v) v (g.localGlue v h)) +include parents + +theorem incoming_realizes (v : Vertex J S R) (nonroot : v ≠ root J S R) : + g.Realizes value (source J S R request (incoming J S R request v nonroot)) + (target J S R request (incoming J S R request v nonroot)) + (g.edgeInput (incoming J S R request v nonroot)) := by + have nonzero : depth J S R request v ≠ 0 := fun h => nonroot ((depth_zero_iff J S R request v).mp h) + exact (g.realizes_reindex value (parent_eq J S R request v nonroot).symm + (incoming_target J S R request v nonroot) _).mp (parents v nonzero) + +theorem equation_of_extension (d : Dart J S R) + (eq : rootPath J S R request (target J S R request d) = + rootPath J S R request (source J S R request d) ++ [d]) : g.Equation value d := by + have realized := g.incoming_realizes value parents (target J S R request d) + (extension_nonroot J S R request d eq) + rw [incoming_of_extension J S R request d eq] at realized + intro x + have same := realized ((g.arrow d).toFun x) + change value (target J S R request d) ((g.arrow d).toFun x).val = + value (source J S R request d) ((g.arrow d).inverse ((g.arrow d).toFun x)).val at same + rw [(g.arrow d).left_inverse] at same + exact same.symm + +theorem equations_of_parents (d : Dart J S R) : g.Equation value d := by + rcases edge_root_paths J S R request d with forward | backward + · exact g.equation_of_extension value parents d forward + · apply g.equation_of_reverse value d + apply g.equation_of_extension value parents (reverse J S R d) + simpa only [source_reverse, target_reverse] using backward + +end + +theorem edge_identification (d : Dart J S R) + (x : {x : g.Space (source J S R request d) // + (g.order (source J S R request d)).le x (g.anchor d)}) : + (g.vertex (source J S R request d)).toFun x.val = + (g.vertex (target J S R request d)).toFun ((g.arrow d).toFun x).val := + g.equations_of_parents (fun v => (g.vertex v).toFun) + (fun v h => g.parent_identification v h) d x + +end Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces + + + +namespace Compression.RecursiveMaps + +open RationalHeights +universe u v w + +namespace IdealEmbedding +variable {A : Type u} {B : Type v} {H : Type w} + {P : MeetOrder A} {Q : MeetOrder B} + +theorem projection_mono (f : IdealEmbedding P Q) (top : A) {x y : B} + (lower : Q.le x y) : P.le (f.projection top x) (f.projection top y) := by + apply (f.le_iff _ _).mp + rw [f.projection_spec, f.projection_spec] + exact Q.le_meet (Q.trans (Q.meet_le_left _ _) lower) (Q.meet_le_right _ _) + +theorem projection_image (f : IdealEmbedding P Q) (top : A) + (greatest : ∀ a, P.le a top) (a : A) : f.projection top (f.toFun a) = a := by + apply embedding_injective f.toMeetEmbedding + rw [f.projection_spec] + exact Q.antisymm (Q.meet_le_left _ _) + (Q.le_meet (Q.refl _) ((f.le_iff _ _).mpr (greatest a))) + +theorem projected_strict (f : IdealEmbedding P Q) (top : A) + (greatest : ∀ a, P.le a top) {R : HeightOrder H} (height : StrictHeight P R) + (x y : B) (lower : Q.le x y) (different : x ≠ y) (in_copy : ∃ a, f.toFun a = y) : + R.lt (height.value (f.projection top x)) (height.value (f.projection top y)) := by + rcases in_copy with ⟨b, rfl⟩ + rcases f.ideal b x lower with ⟨a, rfl⟩ + rw [f.projection_image top greatest, f.projection_image top greatest] + exact height.strict a b ((f.le_iff _ _).mp lower) + (fun eq => different (congrArg f.toFun eq)) + +end IdealEmbedding + +namespace LinearHeightOrder +variable {H : Type u} {K : Type v} + +theorem lex_weak (R : LinearHeightOrder H) (S : LinearHeightOrder K) {x y : H × K} + (first : R.Weak x.1 y.1) (second : S.Weak x.2 y.2) : (R.lex S).Weak x y := by + rcases first with eq | lower + · rcases second with eq' | lower + · exact Or.inl (Prod.ext eq eq') + · exact Or.inr (Or.inr ⟨eq, lower⟩) + · exact Or.inr (Or.inl lower) + +theorem lex_strict (R : LinearHeightOrder H) (S : LinearHeightOrder K) {x y : H × K} + (first : R.Weak x.1 y.1) + (strict : R.lt x.1 y.1 ∨ S.lt x.2 y.2) : (R.lex S).lt x y := by + rcases first with eq | lower + · rcases strict with lower | lower + · exact False.elim (R.irrefl _ (eq ▸ lower)) + · exact Or.inr ⟨eq, lower⟩ + · exact Or.inl lower + +end LinearHeightOrder + +theorem countable_range_pair {X : Type u} {H : Type v} {K : Type w} + {f : X → H} {g : X → K} (hf : CountableRange f) (hg : CountableRange g) : + CountableRange (fun x => (f x, g x)) := by + rcases hf with ⟨a, ha⟩ + rcases hg with ⟨b, hb⟩ + exact ⟨fun x => natPair (a x) (b x), fun x y eq => + Prod.ext (ha x y (natPair_injective eq).1) (hb x y (natPair_injective eq).2)⟩ + +theorem countable_range_precompose {X : Type u} {Y : Type v} {H : Type w} + {f : Y → H} (hf : CountableRange f) (g : X → Y) : CountableRange (fun x => f (g x)) := by + rcases hf with ⟨code, equal⟩ + exact ⟨fun x => code (g x), fun x y eq => equal (g x) (g y) eq⟩ + +namespace RationalHeights + +def zero : Rational := Rational.mk ⟨0, 1, by decide⟩ +def one : Rational := Rational.mk ⟨1, 1, by decide⟩ + +theorem zero_lt_one : Rational.lt zero one := by + change (0 : Int) * 1 < 1 * 1 + decide + +theorem rational_assignment {X : Type u} {H : Type v} {P : MeetOrder X} + (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) + (base : X) (countable : CountableRange seed.value) : + ∃ height : StrictHeight P Rational.order.toHeightOrder, + ∀ x, Rational.lt zero (height.value x) ∧ Rational.lt (height.value x) one := by + rcases countable_range_interpolation R Rational.order seed.value base countable + zero one zero_lt_one with ⟨assign, bounds, strict, _⟩ + exact ⟨⟨assign, fun x y lower different => strict x y (seed.strict x y lower different)⟩, bounds⟩ + +end RationalHeights + +namespace TileRequests.Tile +variable {A : Type u} {H : Type v} {P : MeetOrder A} + (top : A) (greatest : ∀ a, P.le a top) + (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) + +noncomputable def binaryTuple (t : Tile P (ULift.{u} Unit)) : + StrictHeight t.order (R.lex R).toHeightOrder where + value x := (seed.value (t.root.projection top x), + seed.value ((t.child ⟨()⟩).projection top x)) + strict x y lower different := by + apply R.lex_strict R (seed.mono (t.root.projection_mono top lower)) + rcases t.cover y with root | ⟨j, a, eq⟩ + · exact Or.inl (t.root.projected_strict top greatest seed x y lower different root) + · rcases j with ⟨⟨⟩⟩ + exact Or.inr ((t.child ⟨()⟩).projected_strict top greatest seed x y lower different ⟨a, eq⟩) + +noncomputable def rectangleTuple (t : Tile P (ULift.{u} Bool)) : + StrictHeight t.order (R.lex (R.lex R)).toHeightOrder where + value x := (seed.value (t.root.projection top x), + seed.value ((t.child ⟨false⟩).projection top x), + seed.value ((t.child ⟨true⟩).projection top x)) + strict x y lower different := by + apply R.lex_strict (R.lex R) (seed.mono (t.root.projection_mono top lower)) + rcases t.cover y with root | ⟨j, a, eq⟩ + · exact Or.inl (t.root.projected_strict top greatest seed x y lower different root) + · apply Or.inr + apply R.lex_strict R (seed.mono ((t.child ⟨false⟩).projection_mono top lower)) + rcases j with ⟨j⟩ + cases j with + | false => exact Or.inl ((t.child ⟨false⟩).projected_strict top greatest seed + x y lower different ⟨a, eq⟩) + | true => exact Or.inr ((t.child ⟨true⟩).projected_strict top greatest seed + x y lower different ⟨a, eq⟩) + +theorem binaryTuple_countable (countable : CountableRange seed.value) + (t : Tile P (ULift.{u} Unit)) : CountableRange (binaryTuple top greatest R seed t).value := + countable_range_pair (countable_range_precompose countable (t.root.projection top)) + (countable_range_precompose countable ((t.child ⟨()⟩).projection top)) + +theorem rectangleTuple_countable (countable : CountableRange seed.value) + (t : Tile P (ULift.{u} Bool)) : CountableRange (rectangleTuple top greatest R seed t).value := + countable_range_pair (countable_range_precompose countable (t.root.projection top)) + (countable_range_pair + (countable_range_precompose countable ((t.child ⟨false⟩).projection top)) + (countable_range_precompose countable ((t.child ⟨true⟩).projection top))) + +noncomputable def binaryHeight (countable : CountableRange seed.value) + (t : Tile P (ULift.{u} Unit)) : StrictHeight t.order Rational.order.toHeightOrder := + Classical.choose (rational_assignment (R.lex R) (binaryTuple top greatest R seed t) + (t.root.toFun top) (binaryTuple_countable top greatest R seed countable t)) + +noncomputable def rectangleHeight (countable : CountableRange seed.value) + (t : Tile P (ULift.{u} Bool)) : StrictHeight t.order Rational.order.toHeightOrder := + Classical.choose (rational_assignment (R.lex (R.lex R)) (rectangleTuple top greatest R seed t) + (t.root.toFun top) (rectangleTuple_countable top greatest R seed countable t)) + +end TileRequests.Tile + +namespace TileRequests.Request +variable {A : Type u} {H : Type v} {P : MeetOrder A} + (top : A) (greatest : ∀ a, P.le a top) + (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) + (countable : CountableRange seed.value) + +noncomputable def rationalHeight : (r : Request P) → + StrictHeight (r.tile top greatest).order Rational.order.toHeightOrder + | .separation _ => Tile.binaryHeight top greatest R seed countable _ + | .compression _ _ => Tile.binaryHeight top greatest R seed countable _ + | .rectangle _ => Tile.rectangleHeight top greatest R seed countable _ + +end TileRequests.Request + +end Compression.RecursiveMaps + + + +namespace Compression.RecursiveMaps + +open RationalHeights +universe u v + +namespace PrincipalBatch.Family +variable {A I : Type u} {H : Type v} {P : MeetOrder A} {R : HeightOrder H} + (b : PrincipalBatch.Family P I) (old : StrictHeight P R) + (component : ∀ i, StrictHeight (b.order i) R) + +def heightValue : b.Node → H + | .inl x => old.value x + | .inr x => (component x.1).value x.2.val + +def extendHeight + (above : ∀ x (y : b.Fresh), R.lt (old.value x) ((component y.1).value y.2.val)) : + StrictHeight b.extension R where + value := b.heightValue old component + strict x y lower different := by + cases x with + | inl x => + cases y with + | inl y => exact old.strict x y lower (fun eq => different (congrArg Sum.inl eq)) + | inr y => exact above x y + | inr x => + cases y with + | inl y => exact False.elim lower + | inr y => + rcases lower with inside | impossible + · rcases x with ⟨i, x, hx⟩ + rcases y with ⟨j, y, hy⟩ + rcases inside with ⟨eq, inside⟩ + cases eq + apply (component i).strict x y inside + intro eq + cases eq + exact different rfl + · exact False.elim impossible + +end PrincipalBatch.Family + +namespace IdealChain +variable (c : IdealChain.{u}) {H : Type v} (R : HeightOrder H) + +structure HeightSystem where + height : ∀ n, StrictHeight (c.order n) R + step : ∀ n x, (height (n + 1)).value ((c.next n).toFun x) = (height n).value x + +namespace HeightSystem +variable {c R} (h : HeightSystem c R) + +theorem up {n m : Nat} (lower : n ≤ m) (x : c.Point n) : + (h.height m).value (c.up lower x) = (h.height n).value x := by + induction lower with + | refl => rw [c.up_self] + | @step m lower ih => rw [c.up_succ lower, h.step, ih] + +def value : c.Union → H := Quotient.lift (fun x => (h.height x.1).value x.2) (by + intro x y related + rcases related with ⟨k, hx, hy, eq⟩ + exact (h.up hx x.2).symm.trans ((congrArg (h.height k).value eq).trans (h.up hy y.2))) + +theorem value_point (n : Nat) (x : c.Point n) : + h.value (c.point n x) = (h.height n).value x := rfl + +def unionHeight : StrictHeight c.unionOrder R where + value := h.value + strict x y lower different := by + rcases c.pair_cover x y with ⟨n, x, y, rfl, rfl⟩ + exact (h.height n).strict x y ((c.le_stage n x y).mp lower) + (fun eq => different (congrArg (c.point n) eq)) + +theorem unionHeight_countable (countable : ∀ n, CountableRange (h.height n).value) : + CountableRange h.unionHeight.value := by + classical + let code (n : Nat) : c.Point n → Nat := Classical.choose (countable n) + have equal (n : Nat) := Classical.choose_spec (countable n) + let labelValue (x : c.Label) := (h.height x.1).value x.2 + have label_equal (x y : c.Label) + (eq : natPair x.1 (code x.1 x.2) = natPair y.1 (code y.1 y.2)) : + labelValue x = labelValue y := by + rcases x with ⟨n, x⟩ + rcases y with ⟨m, y⟩ + rcases natPair_injective eq with ⟨same, codes⟩ + cases same + exact equal n x y codes + have out_value (x : c.Union) : labelValue (Quotient.out x) = h.value x := + congrArg h.value (Quotient.out_eq x) + refine ⟨fun x => natPair (Quotient.out x).1 + (code (Quotient.out x).1 (Quotient.out x).2), ?_⟩ + intro x y eq + exact (out_value x).symm.trans ((label_equal _ _ eq).trans (out_value y)) + +end HeightSystem +end IdealChain + +namespace RootedGluing.Scheme +variable {V : Type u} {Column : Type v} (d : RootedGluing.Scheme V) + (C : LinearHeightOrder Column) (column : Nat → Column) + (increasing : ∀ n, C.lt (column n) (column (n + 1))) + (seed : StrictHeight (d.order d.root) (lexOrder C).toHeightOrder) + (seed_bound : ∀ x, C.lt (seed.value x).1 (column 0)) + (localHeight : ∀ v, StrictHeight (d.order v) Rational.order.toHeightOrder) + +structure BoundedHeight (n : Nat) where + height : StrictHeight (d.stages n).order (lexOrder C).toHeightOrder + bound : ∀ x, C.lt (height.value x).1 (column n) + +noncomputable def nextBounded (n : Nat) (old : d.BoundedHeight C column n) : + d.BoundedHeight C column (n + 1) := { + height := (d.stages n).batch.extendHeight old.height + (fun i => { + value := fun x => (column n, (localHeight i.val).value x) + strict := fun x y lower different => + Or.inr ⟨rfl, (localHeight i.val).strict x y lower different⟩ }) + (fun x _ => Or.inl (old.bound x)) + bound := by + intro x + cases x with + | inl x => exact C.trans (old.bound x) (increasing n) + | inr x => exact increasing n } + +noncomputable def boundedStages : (n : Nat) → d.BoundedHeight C column n + | 0 => ⟨seed, seed_bound⟩ + | n + 1 => d.nextBounded C column increasing localHeight n (boundedStages n) + +noncomputable def heightSystem : d.chain.HeightSystem (lexOrder C).toHeightOrder where + height n := (d.boundedStages C column increasing seed seed_bound localHeight n).height + step _ _ := rfl + +noncomputable def externalHeight : StrictHeight d.gluedOrder (lexOrder C).toHeightOrder := + (d.heightSystem C column increasing seed seed_bound localHeight).unionHeight + +theorem externalHeight_stage (n : Nat) (x : (d.stages n).Point) : + (d.externalHeight C column increasing seed seed_bound localHeight).value (d.chain.point n x) = + (d.boundedStages C column increasing seed seed_bound localHeight n).height.value x := rfl + +theorem externalHeight_original (x : d.Space d.root) : + (d.externalHeight C column increasing seed seed_bound localHeight).value + ((d.vertex d.root).toFun x) = seed.value x := by + rw [d.vertex_at d.root 0 d.depth_root.le] + rfl + +theorem boundedStages_countable (seed_countable : CountableRange seed.value) (n : Nat) : + CountableRange (d.boundedStages C column increasing seed seed_bound localHeight n).height.value := by + induction n with + | zero => exact seed_countable + | succ n ih => + rcases ih with ⟨oldCode, old_equal⟩ + let code : (d.stages (n + 1)).Point → Nat + | .inl x => 2 * oldCode x + | .inr x => 2 * Rational.code ((localHeight x.1.val).value x.2.val) + 1 + refine ⟨code, ?_⟩ + intro x y eq + cases x with + | inl x => + cases y with + | inl y => exact old_equal x y (by change 2 * oldCode x = 2 * oldCode y at eq; omega) + | inr y => change 2 * oldCode x = 2 * _ + 1 at eq; omega + | inr x => + cases y with + | inl y => change 2 * _ + 1 = 2 * oldCode y at eq; omega + | inr y => + change (column n, (localHeight x.1.val).value x.2.val) = + (column n, (localHeight y.1.val).value y.2.val) + refine Prod.ext rfl ?_ + apply Rational.code_injective + change 2 * Rational.code ((localHeight x.1.val).value x.2.val) + 1 = + 2 * Rational.code ((localHeight y.1.val).value y.2.val) + 1 at eq + dsimp only + omega + +theorem externalHeight_countable (seed_countable : CountableRange seed.value) : + CountableRange (d.externalHeight C column increasing seed seed_bound localHeight).value := + (d.heightSystem C column increasing seed seed_bound localHeight).unionHeight_countable + (d.boundedStages_countable C column increasing seed seed_bound localHeight seed_countable) + +theorem externalHeight_column_bound (cap : Column) (above : ∀ n, C.lt (column n) cap) + (x : d.Node) : + C.lt ((d.externalHeight C column increasing seed seed_bound localHeight).value x).1 cap := by + rcases d.chain.cover x with ⟨n, x, rfl⟩ + exact C.trans ((d.boundedStages C column increasing seed seed_bound localHeight n).bound x) (above n) + +end RootedGluing.Scheme + +end Compression.RecursiveMaps + +end PartitionPilot + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAbsentLiftRangeCollisions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAbsentLiftRangeCollisions.lean index 02a0f65009d66a1fc7371ce58e3a8b55d0085fd2..9d0de42ed386219204396a152a3c391515913b1f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAbsentLiftRangeCollisions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAbsentLiftRangeCollisions.lean @@ -1,420 +1,420 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementCollisionSymmetry -import OAI.SetTheory.PartitionPrinciple.Forcing.StageOneEvaluatedAssignments - -namespace OAI - -section - - -namespace PartitionPilot.Forcing.SetFormula - -def refinementVisibleLiftFormula : SetFormula 4 := - ex (.conj (.mem 0 1) (.conj (.mem 0 2) - (BoundedFormula.pairMembershipFormula 0 3 4).toFormula)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -theorem refinementVisibleLift_groundTerm_dense (small : M.sets.Countable) - (U Rf Rc visibility target : (M.nameDomain s).names) (p : P) : - let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid U.val Rf.val U.property Rf.property⟩ - let map := M.stageOneMapName s pairing unions powers separation collection carrier order - hT valid U Rf Rc - Forces (M.nameDomain s) refinementVisibleLiftFormula ![quotient, visibility, target, map] p → - DenseBelow p {q | ∃ w : (M.nameDomain s).names, w.val.val ∈ T ∧ - Name.ForcesMem q w.val U.val ∧ - let fine := M.stageOneClassName s pairing unions powers separation collection carrier order - hT valid Rf w - Name.ForcesMem q fine.val visibility.val ∧ - Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![fine, target, map] q} := by - let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid U.val Rf.val U.property Rf.property⟩ - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - let env : Assignment (M.nameDomain s) 4 := ![quotient, visibility, target, map] - let phi : SetFormula 5 := .conj (.mem 0 2) (BoundedFormula.pairMembershipFormula 0 3 4).toFormula - change Forces (M.nameDomain s) (ex (.conj (.mem 0 1) phi)) env p → _ - intro forced r rp - obtain ⟨q, qr, rho, member, property⟩ := - (forces_ex_iff (M.nameDomain s) (.conj (.mem 0 1) phi) env p).1 forced r rp - change Name.ForcesMem q rho.val quotient.val at member - obtain ⟨v, vq, sigma, k, entry, vk, equal⟩ := member q le_rfl - obtain ⟨w, hw, active, same⟩ := - (Name.entry_refinementQuotient T valid U.val Rf.val sigma k).1 entry - let wName : (M.nameDomain s).names := ⟨w, M.transitive hT hw⟩ - let fine := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf wName - have sameFine : fine.val = sigma := same - have equality : Name.ForcesEq v rho.val fine.val := sameFine.symm ▸ equal - have propertyV : Forces (M.nameDomain s) phi (extend rho env) v := - forces_mono (M.nameDomain s) phi (extend rho env) property vq - have selected : Forces (M.nameDomain s) phi (extend fine env) v := - (M.ordinaryForces_replace_first s small carrier phi env rho fine v equality).1 propertyV - refine ⟨v, vq.trans qr, wName, hw, Name.forcesMem_mono active vk, ?_⟩ - exact selected - -end PartitionPilot.Forcing.TransitiveGround - -end - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -theorem refinementActiveTerm_fineLift (small : M.sets.Countable) - (U Rf Rc u : (M.nameDomain s).names) (term : u.val.val ∈ T) (p : P) - (active : Name.ForcesMem p u.val U.val) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid U.val Rf.val U.property Rf.property⟩ - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - Name.ForcesMem p (cls Rf u).val quotient.val ∧ - Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![cls Rf u, cls Rc u, map] p := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - have fineEntry := (Name.entry_refinementQuotient T valid U.val Rf.val _ p).2 - ⟨u.val, term, active, rfl⟩ - have mapEntry := (Name.entry_refinementNaturalMap T valid U.val Rf.val Rc.val _ p).2 - ⟨u.val, term, active, rfl⟩ - refine ⟨Name.forcesMem_entry fineEntry, ?_⟩ - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).2 - apply (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).2 - have inMap := (Name.mem_eval {q | H.mem q} map.val _).2 - ⟨_, p, mapEntry, hp, rfl⟩ - rw [Name.eval_orderedPair {q | H.mem q} ⊤ H.top_mem] at inMap - exact inMap - -theorem refinementAbsentVisibleLift_nonvisible (small : M.sets.Countable) - (U Rf Rc u visibility : (M.nameDomain s).names) (term : u.val.val ∈ T) (p : P) - (active : Name.ForcesMem p u.val U.val) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid U.val Rf.val U.property Rf.property⟩ - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - Forces (M.nameDomain s) (.neg refinementVisibleLiftFormula) - ![quotient, visibility, cls Rc u, map] p → - Name.ForcesMem p (cls Rf u).val quotient.val ∧ - Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![cls Rf u, cls Rc u, map] p ∧ - (∀ q, q ≤ p → ¬ Name.ForcesMem q (cls Rf u).val visibility.val) := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid U.val Rf.val U.property Rf.property⟩ - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - intro absent - obtain ⟨member, mapped⟩ := M.refinementActiveTerm_fineLift s pairing unions powers separation collection - carrier order hT valid small U Rf Rc u term p active - refine ⟨member, mapped, ?_⟩ - intro q qp visible - apply absent q qp - apply (forces_ex_iff (M.nameDomain s) _ ![quotient, visibility, cls Rc u, map] q).2 - intro r rq - refine ⟨r, le_rfl, cls Rf u, Name.forcesMem_mono member (rq.trans qp), - Name.forcesMem_mono visible rq, ?_⟩ - exact forces_mono (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![cls Rf u, cls Rc u, map] mapped (rq.trans qp) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (small : M.sets.Countable) - -include small in -theorem stageOneCollisionTest_self (Rf Rc u w : (M.nameDomain s).names) (p : P) : - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u w w p := by - unfold stageOneCollisionTest - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementCollisionFormula _ (fun j => ⟨_, rfl⟩)).2 - exact ⟨fun _ => rfl, fun _ => rfl⟩ - -include small in -theorem stageOneCollisionTest_diagonal (R u v : (M.nameDomain s).names) (p : P) : - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - R R u v u v p := by - unfold stageOneCollisionTest - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementCollisionFormula _ (fun j => ⟨_, rfl⟩)).2 - exact Iff.rfl - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -include small in -theorem stageOneSingleTests_diagonal (C E : L) (U R u : (M.nameDomain s).names) - (term : u.val.val ∈ T) (p : P) (active : Name.ForcesMem p u.val U.val) : - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U R R u u p := by - refine ⟨⟨active, active⟩, ?_, ?_⟩ - · intro v hv - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementProfileFormula _ (fun j => ⟨_, rfl⟩)).2 - exact Iff.rfl - · apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementCompatibilityFormula _ (fun j => ⟨_, rfl⟩)).2 - intro visible - let cls := Name.refinementClass T valid R.val u.val - change ZFSet.pair (Name.eval {q | H.mem q} cls) (Name.eval {q | H.mem q} cls) ∈ - Name.eval {q | H.mem q} (Name.refinementNaturalMap T valid U.val R.val R.val) - apply (Name.mem_eval _ _ _).2 - refine ⟨Name.orderedPair ⊤ cls cls, p, ?_, hp, ?_⟩ - · exact (Name.entry_refinementNaturalMap T valid U.val R.val R.val _ p).2 - ⟨u.val, term, active, rfl⟩ - · exact Name.eval_orderedPair _ ⊤ H.top_mem cls cls - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (s : Presentation P) (carrier : s.carrier ∈ M.sets) -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable {T : ZFSet.{u}} (valid : ∀ z ∈ T, IsName s z) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -include carrier in -theorem absentLift_profile_inequalities (small : M.sets.Countable) - (C K : L) (moved old : (M.nameDomain s).names) (profile : ZFSet.{u}) - (r q : P) (below : q ≤ r) - (decisions : M.DecidesVisibilityProfile a s b d.principalFix T profile old.val r) - (survivor : b.encode C ∉ profile → b.encode K ∉ profile) : - let vis := M.stageOneVisibilityName s valid a b d base directed system - Name.ForcesMem q moved.val (vis K).val → - (∀ p, p ≤ q → ¬ Name.ForcesMem p moved.val (vis C).val) → - (∀ p, p ≤ q → ¬ Name.ForcesEq p moved.val old.val) ∧ - (∀ p, p ≤ q → ¬ Name.ForcesEq p old.val moved.val) := by - dsimp only - let vis := M.stageOneVisibilityName s valid a b d base directed system - intro visible absent - have negative : Forces (M.nameDomain s) (.neg (.equal 0 1)) ![moved, old] q := by - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ q).2 - intro H hq generic same - change Name.eval {p | H.mem p} moved.val = Name.eval {p | H.mem p} old.val at same - classical - by_cases atC : b.encode C ∈ profile - · have oldVisible := Name.forcesMem_mono ((decisions C).1 atC) below - have seen := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) - old.property (vis C).property hq oldVisible - have movedNegative : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![moved, vis C] q := absent - have unseen : Name.eval {p | H.mem p} moved.val ∉ Name.eval {p | H.mem p} (vis C).val := - forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) ![moved, vis C] hq movedNegative - exact unseen (same.symm ▸ seen) - · have oldNegative : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![old, vis K] q := - fun p pq => (decisions K).2 (survivor atC) p (pq.trans below) - have unseen : Name.eval {p | H.mem p} old.val ∉ Name.eval {p | H.mem p} (vis K).val := - forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) ![old, vis K] hq oldNegative - have seen := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) - moved.property (vis K).property hq visible - exact unseen (same ▸ seen) - exact ⟨negative, fun p pq equal => negative p pq (Name.forcesEq_symm equal)⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) - -theorem refinementAbsentLift_profile_collisions (small : M.sets.Countable) - (C K : L) (Rf Rc u oldU w oldW : (M.nameDomain s).names) - (profile : ZFSet.{u}) (r q : P) (below : q ≤ r) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - M.DecidesVisibilityProfile a s b d.principalFix T profile (cls Rf oldW).val r → - (b.encode C ∉ profile → b.encode K ∉ profile) → - Name.ForcesMem q (cls Rf w).val (vis K).val → - (∀ p, p ≤ q → ¬ Name.ForcesMem p (cls Rf w).val (vis C).val) → - (∀ p, p ≤ q → ¬ Name.ForcesEq p (cls Rc u).val (cls Rc oldU).val) → - (∀ p, p ≤ q → ¬ Name.ForcesEq p (cls Rf w).val (cls Rf oldW).val) ∧ - (∀ p, p ≤ q → ¬ Name.ForcesEq p (cls Rf oldW).val (cls Rf w).val) ∧ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u oldU w oldW q ∧ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc oldU u oldW w q ∧ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u w w q := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - intro decisions survivor visible absent coarseDifferent - obtain ⟨fineDifferent, fineDifferent'⟩ := M.absentLift_profile_inequalities s carrier a b d valid - base directed system small C K (cls Rf w) (cls Rf oldW) profile r q below - decisions survivor visible absent - have collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u oldU w oldW q := by - constructor - · intro p pq facts - exact coarseDifferent p pq facts.1 - · intro p pq facts - exact fineDifferent p pq facts.1 - exact ⟨fineDifferent, fineDifferent', collision, - M.stageOneCollisionTest_symm s pairing unions powers separation collection carrier order hT valid - Rf Rc u oldU w oldW q collision, - M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid - small Rf Rc u w q⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include indices in -theorem refinementVisibleLift_collisions (small : M.sets.Countable) - (C E : L) (U Rf Rc u v w oldW visibility : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (p : P) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - Name.ForcesMem p (cls Rf w).val visibility.val → - Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![cls Rf w, cls Rc u, map] p → - Forces (M.nameDomain s) refinementCompatibilityFormula - ![cls Rf oldW, visibility, cls Rc v, map] p → - (∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) → - (∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rf w).val (cls Rf oldW).val) ∧ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u v w oldW p ∧ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc v u oldW w p ∧ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u w w p := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - intro visible selected oldGuard different - have coarseNegative : Forces (M.nameDomain s) (.neg (.equal 0 1)) ![cls Rc u, cls Rc v] p := different - have values (H : ConditionFilter P) (hp : H.mem p) - (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - Name.eval {q | H.mem q} (cls Rc u).val ≠ Name.eval {q | H.mem q} (cls Rc v).val ∧ - Name.eval {q | H.mem q} (cls Rf w).val ≠ Name.eval {q | H.mem q} (cls Rf oldW).val := by - have coarseDifferent : Name.eval {q | H.mem q} (cls Rc u).val ≠ - Name.eval {q | H.mem q} (cls Rc v).val := - forces_sound (M.nameDomain s) H generic (.neg (.equal 0 1)) ![cls Rc u, cls Rc v] hp coarseNegative - refine ⟨coarseDifferent, ?_⟩ - intro sameFine - have visibleValue := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) - (cls Rf w).property visibility.property hp visible - have oldVisible : Name.eval {q | H.mem q} (cls Rf oldW).val ∈ - Name.eval {q | H.mem q} visibility.val := sameFine ▸ visibleValue - have oldEntry := M.refinementCompatibility_eval s - ![cls Rf oldW, visibility, cls Rc v, map] H generic hp oldGuard oldVisible - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - have selectedTruth := forces_sound (M.nameDomain s) H generic - (BoundedFormula.pairMembershipFormula 0 1 2).toFormula ![cls Rf w, cls Rc u, map] hp selected - have selectedEntry : ZFSet.pair (Name.eval {q | H.mem q} (cls Rf w).val) - (Name.eval {q | H.mem q} (cls Rc u).val) ∈ Name.eval {q | H.mem q} map.val := - (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).1 - ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).1 selectedTruth) - obtain ⟨_, _, _, _, forced⟩ := (indices.typed_entries C E U Rf Rc).1 member - have objects := M.refinementObjects_eval s pairing carrier hT valid indices.family_ground - U Rf Rc H generic H.top_mem forced - have oldEntry' : ZFSet.pair (Name.eval {q | H.mem q} (cls Rf w).val) - (Name.eval {q | H.mem q} (cls Rc v).val) ∈ Name.eval {q | H.mem q} map.val := - sameFine.symm ▸ oldEntry - exact coarseDifferent ((functionCode_partial objects.function).unique _ _ _ selectedEntry oldEntry') - have fineNegative : Forces (M.nameDomain s) (.neg (.equal 0 1)) ![cls Rf w, cls Rf oldW] p := by - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - exact (values H hp generic).2 - have collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u v w oldW p := by - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementCollisionFormula _ (fun j => ⟨_, rfl⟩)).2 - have differentValues := values H hp generic - exact ⟨fun eq => False.elim (differentValues.1 eq), fun eq => False.elim (differentValues.2 eq)⟩ - exact ⟨fineNegative, collision, - M.stageOneCollisionTest_symm s pairing unions powers separation collection carrier order hT valid - Rf Rc u v w oldW p collision, - M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid - small Rf Rc u w p⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementCollisionSymmetry +import OAI.SetTheory.PartitionPrinciple.Forcing.StageOneEvaluatedAssignments + +namespace OAI + +section + + +namespace PartitionPilot.Forcing.SetFormula + +def refinementVisibleLiftFormula : SetFormula 4 := + ex (.conj (.mem 0 1) (.conj (.mem 0 2) + (BoundedFormula.pairMembershipFormula 0 3 4).toFormula)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +theorem refinementVisibleLift_groundTerm_dense (small : M.sets.Countable) + (U Rf Rc visibility target : (M.nameDomain s).names) (p : P) : + let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid U.val Rf.val U.property Rf.property⟩ + let map := M.stageOneMapName s pairing unions powers separation collection carrier order + hT valid U Rf Rc + Forces (M.nameDomain s) refinementVisibleLiftFormula ![quotient, visibility, target, map] p → + DenseBelow p {q | ∃ w : (M.nameDomain s).names, w.val.val ∈ T ∧ + Name.ForcesMem q w.val U.val ∧ + let fine := M.stageOneClassName s pairing unions powers separation collection carrier order + hT valid Rf w + Name.ForcesMem q fine.val visibility.val ∧ + Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![fine, target, map] q} := by + let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid U.val Rf.val U.property Rf.property⟩ + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + let env : Assignment (M.nameDomain s) 4 := ![quotient, visibility, target, map] + let phi : SetFormula 5 := .conj (.mem 0 2) (BoundedFormula.pairMembershipFormula 0 3 4).toFormula + change Forces (M.nameDomain s) (ex (.conj (.mem 0 1) phi)) env p → _ + intro forced r rp + obtain ⟨q, qr, rho, member, property⟩ := + (forces_ex_iff (M.nameDomain s) (.conj (.mem 0 1) phi) env p).1 forced r rp + change Name.ForcesMem q rho.val quotient.val at member + obtain ⟨v, vq, sigma, k, entry, vk, equal⟩ := member q le_rfl + obtain ⟨w, hw, active, same⟩ := + (Name.entry_refinementQuotient T valid U.val Rf.val sigma k).1 entry + let wName : (M.nameDomain s).names := ⟨w, M.transitive hT hw⟩ + let fine := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf wName + have sameFine : fine.val = sigma := same + have equality : Name.ForcesEq v rho.val fine.val := sameFine.symm ▸ equal + have propertyV : Forces (M.nameDomain s) phi (extend rho env) v := + forces_mono (M.nameDomain s) phi (extend rho env) property vq + have selected : Forces (M.nameDomain s) phi (extend fine env) v := + (M.ordinaryForces_replace_first s small carrier phi env rho fine v equality).1 propertyV + refine ⟨v, vq.trans qr, wName, hw, Name.forcesMem_mono active vk, ?_⟩ + exact selected + +end PartitionPilot.Forcing.TransitiveGround + +end + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +theorem refinementActiveTerm_fineLift (small : M.sets.Countable) + (U Rf Rc u : (M.nameDomain s).names) (term : u.val.val ∈ T) (p : P) + (active : Name.ForcesMem p u.val U.val) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid U.val Rf.val U.property Rf.property⟩ + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + Name.ForcesMem p (cls Rf u).val quotient.val ∧ + Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![cls Rf u, cls Rc u, map] p := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + have fineEntry := (Name.entry_refinementQuotient T valid U.val Rf.val _ p).2 + ⟨u.val, term, active, rfl⟩ + have mapEntry := (Name.entry_refinementNaturalMap T valid U.val Rf.val Rc.val _ p).2 + ⟨u.val, term, active, rfl⟩ + refine ⟨Name.forcesMem_entry fineEntry, ?_⟩ + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).2 + apply (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).2 + have inMap := (Name.mem_eval {q | H.mem q} map.val _).2 + ⟨_, p, mapEntry, hp, rfl⟩ + rw [Name.eval_orderedPair {q | H.mem q} ⊤ H.top_mem] at inMap + exact inMap + +theorem refinementAbsentVisibleLift_nonvisible (small : M.sets.Countable) + (U Rf Rc u visibility : (M.nameDomain s).names) (term : u.val.val ∈ T) (p : P) + (active : Name.ForcesMem p u.val U.val) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid U.val Rf.val U.property Rf.property⟩ + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + Forces (M.nameDomain s) (.neg refinementVisibleLiftFormula) + ![quotient, visibility, cls Rc u, map] p → + Name.ForcesMem p (cls Rf u).val quotient.val ∧ + Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![cls Rf u, cls Rc u, map] p ∧ + (∀ q, q ≤ p → ¬ Name.ForcesMem q (cls Rf u).val visibility.val) := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid U.val Rf.val U.property Rf.property⟩ + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + intro absent + obtain ⟨member, mapped⟩ := M.refinementActiveTerm_fineLift s pairing unions powers separation collection + carrier order hT valid small U Rf Rc u term p active + refine ⟨member, mapped, ?_⟩ + intro q qp visible + apply absent q qp + apply (forces_ex_iff (M.nameDomain s) _ ![quotient, visibility, cls Rc u, map] q).2 + intro r rq + refine ⟨r, le_rfl, cls Rf u, Name.forcesMem_mono member (rq.trans qp), + Name.forcesMem_mono visible rq, ?_⟩ + exact forces_mono (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![cls Rf u, cls Rc u, map] mapped (rq.trans qp) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (small : M.sets.Countable) + +include small in +theorem stageOneCollisionTest_self (Rf Rc u w : (M.nameDomain s).names) (p : P) : + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u w w p := by + unfold stageOneCollisionTest + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementCollisionFormula _ (fun j => ⟨_, rfl⟩)).2 + exact ⟨fun _ => rfl, fun _ => rfl⟩ + +include small in +theorem stageOneCollisionTest_diagonal (R u v : (M.nameDomain s).names) (p : P) : + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + R R u v u v p := by + unfold stageOneCollisionTest + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementCollisionFormula _ (fun j => ⟨_, rfl⟩)).2 + exact Iff.rfl + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +include small in +theorem stageOneSingleTests_diagonal (C E : L) (U R u : (M.nameDomain s).names) + (term : u.val.val ∈ T) (p : P) (active : Name.ForcesMem p u.val U.val) : + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U R R u u p := by + refine ⟨⟨active, active⟩, ?_, ?_⟩ + · intro v hv + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementProfileFormula _ (fun j => ⟨_, rfl⟩)).2 + exact Iff.rfl + · apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementCompatibilityFormula _ (fun j => ⟨_, rfl⟩)).2 + intro visible + let cls := Name.refinementClass T valid R.val u.val + change ZFSet.pair (Name.eval {q | H.mem q} cls) (Name.eval {q | H.mem q} cls) ∈ + Name.eval {q | H.mem q} (Name.refinementNaturalMap T valid U.val R.val R.val) + apply (Name.mem_eval _ _ _).2 + refine ⟨Name.orderedPair ⊤ cls cls, p, ?_, hp, ?_⟩ + · exact (Name.entry_refinementNaturalMap T valid U.val R.val R.val _ p).2 + ⟨u.val, term, active, rfl⟩ + · exact Name.eval_orderedPair _ ⊤ H.top_mem cls cls + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (s : Presentation P) (carrier : s.carrier ∈ M.sets) +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable {T : ZFSet.{u}} (valid : ∀ z ∈ T, IsName s z) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +include carrier in +theorem absentLift_profile_inequalities (small : M.sets.Countable) + (C K : L) (moved old : (M.nameDomain s).names) (profile : ZFSet.{u}) + (r q : P) (below : q ≤ r) + (decisions : M.DecidesVisibilityProfile a s b d.principalFix T profile old.val r) + (survivor : b.encode C ∉ profile → b.encode K ∉ profile) : + let vis := M.stageOneVisibilityName s valid a b d base directed system + Name.ForcesMem q moved.val (vis K).val → + (∀ p, p ≤ q → ¬ Name.ForcesMem p moved.val (vis C).val) → + (∀ p, p ≤ q → ¬ Name.ForcesEq p moved.val old.val) ∧ + (∀ p, p ≤ q → ¬ Name.ForcesEq p old.val moved.val) := by + dsimp only + let vis := M.stageOneVisibilityName s valid a b d base directed system + intro visible absent + have negative : Forces (M.nameDomain s) (.neg (.equal 0 1)) ![moved, old] q := by + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ q).2 + intro H hq generic same + change Name.eval {p | H.mem p} moved.val = Name.eval {p | H.mem p} old.val at same + classical + by_cases atC : b.encode C ∈ profile + · have oldVisible := Name.forcesMem_mono ((decisions C).1 atC) below + have seen := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) + old.property (vis C).property hq oldVisible + have movedNegative : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![moved, vis C] q := absent + have unseen : Name.eval {p | H.mem p} moved.val ∉ Name.eval {p | H.mem p} (vis C).val := + forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) ![moved, vis C] hq movedNegative + exact unseen (same.symm ▸ seen) + · have oldNegative : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![old, vis K] q := + fun p pq => (decisions K).2 (survivor atC) p (pq.trans below) + have unseen : Name.eval {p | H.mem p} old.val ∉ Name.eval {p | H.mem p} (vis K).val := + forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) ![old, vis K] hq oldNegative + have seen := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) + moved.property (vis K).property hq visible + exact unseen (same ▸ seen) + exact ⟨negative, fun p pq equal => negative p pq (Name.forcesEq_symm equal)⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) + +theorem refinementAbsentLift_profile_collisions (small : M.sets.Countable) + (C K : L) (Rf Rc u oldU w oldW : (M.nameDomain s).names) + (profile : ZFSet.{u}) (r q : P) (below : q ≤ r) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + M.DecidesVisibilityProfile a s b d.principalFix T profile (cls Rf oldW).val r → + (b.encode C ∉ profile → b.encode K ∉ profile) → + Name.ForcesMem q (cls Rf w).val (vis K).val → + (∀ p, p ≤ q → ¬ Name.ForcesMem p (cls Rf w).val (vis C).val) → + (∀ p, p ≤ q → ¬ Name.ForcesEq p (cls Rc u).val (cls Rc oldU).val) → + (∀ p, p ≤ q → ¬ Name.ForcesEq p (cls Rf w).val (cls Rf oldW).val) ∧ + (∀ p, p ≤ q → ¬ Name.ForcesEq p (cls Rf oldW).val (cls Rf w).val) ∧ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u oldU w oldW q ∧ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc oldU u oldW w q ∧ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u w w q := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + intro decisions survivor visible absent coarseDifferent + obtain ⟨fineDifferent, fineDifferent'⟩ := M.absentLift_profile_inequalities s carrier a b d valid + base directed system small C K (cls Rf w) (cls Rf oldW) profile r q below + decisions survivor visible absent + have collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u oldU w oldW q := by + constructor + · intro p pq facts + exact coarseDifferent p pq facts.1 + · intro p pq facts + exact fineDifferent p pq facts.1 + exact ⟨fineDifferent, fineDifferent', collision, + M.stageOneCollisionTest_symm s pairing unions powers separation collection carrier order hT valid + Rf Rc u oldU w oldW q collision, + M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid + small Rf Rc u w q⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include indices in +theorem refinementVisibleLift_collisions (small : M.sets.Countable) + (C E : L) (U Rf Rc u v w oldW visibility : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (p : P) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + Name.ForcesMem p (cls Rf w).val visibility.val → + Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![cls Rf w, cls Rc u, map] p → + Forces (M.nameDomain s) refinementCompatibilityFormula + ![cls Rf oldW, visibility, cls Rc v, map] p → + (∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) → + (∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rf w).val (cls Rf oldW).val) ∧ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u v w oldW p ∧ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc v u oldW w p ∧ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u w w p := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + intro visible selected oldGuard different + have coarseNegative : Forces (M.nameDomain s) (.neg (.equal 0 1)) ![cls Rc u, cls Rc v] p := different + have values (H : ConditionFilter P) (hp : H.mem p) + (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + Name.eval {q | H.mem q} (cls Rc u).val ≠ Name.eval {q | H.mem q} (cls Rc v).val ∧ + Name.eval {q | H.mem q} (cls Rf w).val ≠ Name.eval {q | H.mem q} (cls Rf oldW).val := by + have coarseDifferent : Name.eval {q | H.mem q} (cls Rc u).val ≠ + Name.eval {q | H.mem q} (cls Rc v).val := + forces_sound (M.nameDomain s) H generic (.neg (.equal 0 1)) ![cls Rc u, cls Rc v] hp coarseNegative + refine ⟨coarseDifferent, ?_⟩ + intro sameFine + have visibleValue := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) + (cls Rf w).property visibility.property hp visible + have oldVisible : Name.eval {q | H.mem q} (cls Rf oldW).val ∈ + Name.eval {q | H.mem q} visibility.val := sameFine ▸ visibleValue + have oldEntry := M.refinementCompatibility_eval s + ![cls Rf oldW, visibility, cls Rc v, map] H generic hp oldGuard oldVisible + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + have selectedTruth := forces_sound (M.nameDomain s) H generic + (BoundedFormula.pairMembershipFormula 0 1 2).toFormula ![cls Rf w, cls Rc u, map] hp selected + have selectedEntry : ZFSet.pair (Name.eval {q | H.mem q} (cls Rf w).val) + (Name.eval {q | H.mem q} (cls Rc u).val) ∈ Name.eval {q | H.mem q} map.val := + (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).1 + ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).1 selectedTruth) + obtain ⟨_, _, _, _, forced⟩ := (indices.typed_entries C E U Rf Rc).1 member + have objects := M.refinementObjects_eval s pairing carrier hT valid indices.family_ground + U Rf Rc H generic H.top_mem forced + have oldEntry' : ZFSet.pair (Name.eval {q | H.mem q} (cls Rf w).val) + (Name.eval {q | H.mem q} (cls Rc v).val) ∈ Name.eval {q | H.mem q} map.val := + sameFine.symm ▸ oldEntry + exact coarseDifferent ((functionCode_partial objects.function).unique _ _ _ selectedEntry oldEntry') + have fineNegative : Forces (M.nameDomain s) (.neg (.equal 0 1)) ![cls Rf w, cls Rf oldW] p := by + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + exact (values H hp generic).2 + have collision : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u v w oldW p := by + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementCollisionFormula _ (fun j => ⟨_, rfl⟩)).2 + have differentValues := values H hp generic + exact ⟨fun eq => False.elim (differentValues.1 eq), fun eq => False.elim (differentValues.2 eq)⟩ + exact ⟨fineNegative, collision, + M.stageOneCollisionTest_symm s pairing unions powers separation collection carrier order hT valid + Rf Rc u v w oldW p collision, + M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid + small Rf Rc u w p⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentIndexLevels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentIndexLevels.lean index 86dbc0f12eef7b9a7ee998e12b10f0c0f4fe45a0..ed58d2528348231115a266b63f3298a6fcca7fe3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentIndexLevels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentIndexLevels.lean @@ -1,169 +1,169 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoAssignmentSplices - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem assignmentCut_mem (separation : SeparationSchema M.sets) - {levels alpha A : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hA : A ∈ M.sets) : - assignmentCut levels alpha A ∈ M.sets := by - let formula : BoundedFormula 3 := BoundedFormula.exMem 1 - (BoundedFormula.pairMembershipFormula 1 0 3) - let params := extend alpha (extend levels Fin.elim0) - have ground := M.bounded_separation_mem separation formula params - (Fin.cases hAlpha (Fin.cases hLevels (fun i => Fin.elim0 i))) hA - have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) A = - assignmentCut levels alpha A := by - apply ZFSet.ext - intro z - simp only [ZFSet.mem_sep, assignmentCut, formula, - BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] - rfl - exact equal ▸ ground - -theorem assignmentUpper_mem (separation : SeparationSchema M.sets) - {levels alpha A : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hA : A ∈ M.sets) : - assignmentUpper levels alpha A ∈ M.sets := by - exact M.bounded_separation_mem separation (.neg (.mem 0 1)) - (extend (assignmentCut levels alpha A) Fin.elim0) - (Fin.cases (M.assignmentCut_mem separation hLevels hAlpha hA) (fun i => Fin.elim0 i)) hA - -theorem assignmentSplice_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - {levels alpha Aq Ap : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hAq : Aq ∈ M.sets) (hAp : Ap ∈ M.sets) : - assignmentSplice levels alpha Aq Ap ∈ M.sets := - M.binary_union_mem pairing unions - (M.assignmentCut_mem separation hLevels hAlpha hAq) - (M.assignmentUpper_mem separation hLevels hAlpha hAp) - -theorem assignmentCut_small (separation : SeparationSchema M.sets) - {levels alpha A N : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : - M.groundEmbeddable (assignmentCut levels alpha A) N := - M.groundEmbeddable_restrict separation - (M.assignmentCut_mem separation hLevels hAlpha hA) hN - (assignmentCut_subset levels alpha A) small - -theorem assignmentUpper_small (separation : SeparationSchema M.sets) - {levels alpha A N : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : - M.groundEmbeddable (assignmentUpper levels alpha A) N := - M.groundEmbeddable_restrict separation - (M.assignmentUpper_mem separation hLevels hAlpha hA) hN - (assignmentUpper_subset levels alpha A) small - -theorem assignmentSplice_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {levels alpha Aq Ap : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (hAq : Aq ∈ M.sets) (hAp : Ap ∈ M.sets) - (smallq : M.groundEmbeddable Aq ZFSet.omega) - (smallp : M.groundEmbeddable Ap ZFSet.omega) : - M.groundEmbeddable (assignmentSplice levels alpha Aq Ap) ZFSet.omega := - M.groundEmbeddable_restrict separation - (M.assignmentSplice_mem pairing unions separation hLevels hAlpha hAq hAp) - (M.omega_mem separation infinite) (assignmentSplice_subset levels alpha Aq Ap) - (M.groundCountable_binary_union pairing unions powers separation infinite choice - hAq hAp smallq smallp) - -theorem assignmentSplice_mem_groundSmallSubsets - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {J levels alpha Aq Ap : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - (memberq : Aq ∈ M.groundSmallSubsets J ZFSet.omega) - (memberp : Ap ∈ M.groundSmallSubsets J ZFSet.omega) : - assignmentSplice levels alpha Aq Ap ∈ M.groundSmallSubsets J ZFSet.omega := by - obtain ⟨hAq, subsetq, smallq⟩ := (M.mem_groundSmallSubsets J ZFSet.omega Aq).1 memberq - obtain ⟨hAp, subsetp, smallp⟩ := (M.mem_groundSmallSubsets J ZFSet.omega Ap).1 memberp - refine (M.mem_groundSmallSubsets J ZFSet.omega _).2 - ⟨M.assignmentSplice_mem pairing unions separation hLevels hAlpha hAq hAp, ?_, - M.assignmentSplice_countable pairing unions powers separation infinite choice - hLevels hAlpha hAq hAp smallq smallp⟩ - intro z hz - exact (ZFSet.mem_union.1 (assignmentSplice_subset levels alpha Aq Ap hz)).elim - (fun member => subsetq member) (fun member => subsetp member) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem assignmentIndexLevels_mem {I T eta levels : ZFSet.{u}} - (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hEta : eta ∈ M.sets) - (hLevels : levels ∈ M.sets) : assignmentIndexLevels I T eta levels ∈ M.sets := - M.relationCompose_mem pairing unions powers separation - (M.stageOneAssignments_mem pairing unions powers separation hI hT) hI hEta - (M.productFirst_mem pairing unions powers separation hI - (M.prod_mem pairing unions powers separation hT hT)) hLevels - -theorem stageTwoAssignmentLevels_mem {I0 I1 T : ZFSet.{u}} - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hT : T ∈ M.sets) : - stageTwoAssignmentLevels I0 I1 T ∈ M.sets := by - have hz := M.empty_mem ⟨I0, hI0⟩ - have ho : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hz hz - have hEta := M.unorderedPair_mem pairing hz ho - have hI := M.binary_union_mem pairing unions hI0 hI1 - exact M.assignmentIndexLevels_mem pairing unions powers separation hI hT hEta - (M.refinementIndexFieldGraph_mem pairing unions powers separation hI hEta 0) - -theorem stageTwoAssignmentCuts_mem {I0 I1 T A : ZFSet.{u}} - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 0) A ∈ M.sets ∧ - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A ∈ M.sets ∧ - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 2) A ∈ M.sets := by - have hz := M.empty_mem ⟨I0, hI0⟩ - have ho : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hz hz - have ht : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions ho ho - have graph := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT - exact ⟨M.assignmentCut_mem separation graph hz hA, - M.assignmentCut_mem separation graph ho hA, M.assignmentCut_mem separation graph ht hA⟩ - -theorem stageTwoAssignmentCut_one_mem_groundSmallSubsets - (infinite : Realize M.sets infinity Fin.elim0) - {I0 I1 T A : ZFSet.{u}} - (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hT : T ∈ M.sets) - (member : A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A ∈ - M.groundSmallSubsets (stageOneAssignments I0 T) ZFSet.omega := by - obtain ⟨hA, _, small⟩ := (M.mem_groundSmallSubsets _ _ A).1 member - have ground := (M.stageTwoAssignmentCuts_mem pairing unions powers separation hI0 hI1 hT hA).2.1 - exact (M.mem_groundSmallSubsets _ _ _).2 ⟨ground, - stageTwoAssignmentCut_one_subset first second A, - M.groundEmbeddable_restrict separation ground (M.omega_mem separation infinite) - (assignmentCut_subset _ _ A) small⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoAssignmentSplices + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem assignmentCut_mem (separation : SeparationSchema M.sets) + {levels alpha A : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hA : A ∈ M.sets) : + assignmentCut levels alpha A ∈ M.sets := by + let formula : BoundedFormula 3 := BoundedFormula.exMem 1 + (BoundedFormula.pairMembershipFormula 1 0 3) + let params := extend alpha (extend levels Fin.elim0) + have ground := M.bounded_separation_mem separation formula params + (Fin.cases hAlpha (Fin.cases hLevels (fun i => Fin.elim0 i))) hA + have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) A = + assignmentCut levels alpha A := by + apply ZFSet.ext + intro z + simp only [ZFSet.mem_sep, assignmentCut, formula, + BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] + rfl + exact equal ▸ ground + +theorem assignmentUpper_mem (separation : SeparationSchema M.sets) + {levels alpha A : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hA : A ∈ M.sets) : + assignmentUpper levels alpha A ∈ M.sets := by + exact M.bounded_separation_mem separation (.neg (.mem 0 1)) + (extend (assignmentCut levels alpha A) Fin.elim0) + (Fin.cases (M.assignmentCut_mem separation hLevels hAlpha hA) (fun i => Fin.elim0 i)) hA + +theorem assignmentSplice_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + {levels alpha Aq Ap : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hAq : Aq ∈ M.sets) (hAp : Ap ∈ M.sets) : + assignmentSplice levels alpha Aq Ap ∈ M.sets := + M.binary_union_mem pairing unions + (M.assignmentCut_mem separation hLevels hAlpha hAq) + (M.assignmentUpper_mem separation hLevels hAlpha hAp) + +theorem assignmentCut_small (separation : SeparationSchema M.sets) + {levels alpha A N : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : + M.groundEmbeddable (assignmentCut levels alpha A) N := + M.groundEmbeddable_restrict separation + (M.assignmentCut_mem separation hLevels hAlpha hA) hN + (assignmentCut_subset levels alpha A) small + +theorem assignmentUpper_small (separation : SeparationSchema M.sets) + {levels alpha A N : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : + M.groundEmbeddable (assignmentUpper levels alpha A) N := + M.groundEmbeddable_restrict separation + (M.assignmentUpper_mem separation hLevels hAlpha hA) hN + (assignmentUpper_subset levels alpha A) small + +theorem assignmentSplice_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {levels alpha Aq Ap : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (hAq : Aq ∈ M.sets) (hAp : Ap ∈ M.sets) + (smallq : M.groundEmbeddable Aq ZFSet.omega) + (smallp : M.groundEmbeddable Ap ZFSet.omega) : + M.groundEmbeddable (assignmentSplice levels alpha Aq Ap) ZFSet.omega := + M.groundEmbeddable_restrict separation + (M.assignmentSplice_mem pairing unions separation hLevels hAlpha hAq hAp) + (M.omega_mem separation infinite) (assignmentSplice_subset levels alpha Aq Ap) + (M.groundCountable_binary_union pairing unions powers separation infinite choice + hAq hAp smallq smallp) + +theorem assignmentSplice_mem_groundSmallSubsets + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {J levels alpha Aq Ap : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + (memberq : Aq ∈ M.groundSmallSubsets J ZFSet.omega) + (memberp : Ap ∈ M.groundSmallSubsets J ZFSet.omega) : + assignmentSplice levels alpha Aq Ap ∈ M.groundSmallSubsets J ZFSet.omega := by + obtain ⟨hAq, subsetq, smallq⟩ := (M.mem_groundSmallSubsets J ZFSet.omega Aq).1 memberq + obtain ⟨hAp, subsetp, smallp⟩ := (M.mem_groundSmallSubsets J ZFSet.omega Ap).1 memberp + refine (M.mem_groundSmallSubsets J ZFSet.omega _).2 + ⟨M.assignmentSplice_mem pairing unions separation hLevels hAlpha hAq hAp, ?_, + M.assignmentSplice_countable pairing unions powers separation infinite choice + hLevels hAlpha hAq hAp smallq smallp⟩ + intro z hz + exact (ZFSet.mem_union.1 (assignmentSplice_subset levels alpha Aq Ap hz)).elim + (fun member => subsetq member) (fun member => subsetp member) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem assignmentIndexLevels_mem {I T eta levels : ZFSet.{u}} + (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hEta : eta ∈ M.sets) + (hLevels : levels ∈ M.sets) : assignmentIndexLevels I T eta levels ∈ M.sets := + M.relationCompose_mem pairing unions powers separation + (M.stageOneAssignments_mem pairing unions powers separation hI hT) hI hEta + (M.productFirst_mem pairing unions powers separation hI + (M.prod_mem pairing unions powers separation hT hT)) hLevels + +theorem stageTwoAssignmentLevels_mem {I0 I1 T : ZFSet.{u}} + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hT : T ∈ M.sets) : + stageTwoAssignmentLevels I0 I1 T ∈ M.sets := by + have hz := M.empty_mem ⟨I0, hI0⟩ + have ho : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hz hz + have hEta := M.unorderedPair_mem pairing hz ho + have hI := M.binary_union_mem pairing unions hI0 hI1 + exact M.assignmentIndexLevels_mem pairing unions powers separation hI hT hEta + (M.refinementIndexFieldGraph_mem pairing unions powers separation hI hEta 0) + +theorem stageTwoAssignmentCuts_mem {I0 I1 T A : ZFSet.{u}} + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 0) A ∈ M.sets ∧ + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A ∈ M.sets ∧ + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 2) A ∈ M.sets := by + have hz := M.empty_mem ⟨I0, hI0⟩ + have ho : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hz hz + have ht : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions ho ho + have graph := M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 hI1 hT + exact ⟨M.assignmentCut_mem separation graph hz hA, + M.assignmentCut_mem separation graph ho hA, M.assignmentCut_mem separation graph ht hA⟩ + +theorem stageTwoAssignmentCut_one_mem_groundSmallSubsets + (infinite : Realize M.sets infinity Fin.elim0) + {I0 I1 T A : ZFSet.{u}} + (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hT : T ∈ M.sets) + (member : A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A ∈ + M.groundSmallSubsets (stageOneAssignments I0 T) ZFSet.omega := by + obtain ⟨hA, _, small⟩ := (M.mem_groundSmallSubsets _ _ A).1 member + have ground := (M.stageTwoAssignmentCuts_mem pairing unions powers separation hI0 hI1 hT hA).2.1 + exact (M.mem_groundSmallSubsets _ _ _).2 ⟨ground, + stageTwoAssignmentCut_one_subset first second A, + M.groundEmbeddable_restrict separation ground (M.omega_mem separation infinite) + (assignmentCut_subset _ _ A) small⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentLabelDomainTotality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentLabelDomainTotality.lean index 00f06f8885abd56c6d757752f516f04a4d6d1df6..0e9b320a9690a8c00ec6c404c18a554e5691dec4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentLabelDomainTotality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentLabelDomainTotality.lean @@ -1,88 +1,88 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRepresentedDomainConditions - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P Q : Type u} -variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] -variable (lower : Presentation P) (upper : Presentation Q) -variable {restriction : Q →o P} {inclusion : P ↪o Q} -variable (projection : CompleteProjection restriction inclusion) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) -variable (lowerOrder : lower.conditionOrder ∈ M.sets) -variable (inclusionGround : lower.graph upper inclusion ∈ M.sets) -variable {levels alpha T : ZFSet.{u}} -variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName lower z) (idx : ZFSet.{u}) (hIdx : idx ∈ M.sets) -variable (U Rc : (M.nameDomain lower).names) (Rf : Name lower) -variable (cutCoordinates : ∀ p : Q, ∃ row A : ZFSet.{u}, upper.encode p = ZFSet.pair row A ∧ - lower.encode (restriction p) = ZFSet.pair row (assignmentCut levels alpha A)) -variable (H : ConditionFilter Q) (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) -include pairing unions powers separation collection lowerGround upperGround lowerOrder inclusionGround - hLevels hAlpha hT hIdx cutCoordinates ordinary - -local notation "lowerH" => projection.projectedFilter H -local notation "label" => Name.refinementAssignmentLabel upper inclusion ⊤ T valid idx Rf Rc.val -local notation "domainSet" => (M.representedDomainConditions lower upper.carrier levels alpha T valid idx U Rc) - -theorem refinementAssignmentLabel_represents_active_term - (u : (M.nameDomain lower).names) (_hu : u.val.val ∈ T) - (ground : domainSet u ∈ M.sets) - (dense : Dense {p : Q | upper.encode p ∈ domainSet u}) - (active : ∃ q : P, (lowerH).mem q ∧ Name.ForcesMem q u.val U.val) : - ∃ a : ZFSet.{u}, ZFSet.pair - (Name.eval {q | (lowerH).mem q} (Name.refinementClass T valid Rc.val u.val)) a ∈ - Name.eval {p | H.mem p} label := by - obtain ⟨p, hp, inD⟩ := M.ordinary_generic_meets_ground_dense upper pairing unions powers separation - H ordinary ground (M.representedDomainConditions_subset lower _ _ _ _ valid idx U Rc u) dense - obtain ⟨row, A, pCode, cutCode⟩ := cutCoordinates p - have cutMember : (lowerH).mem (restriction p) := - (projection.projectedFilter_mem_iff H _).2 ⟨p, hp, rfl⟩ - have branches := (M.pair_mem_representedDomainConditions lower pairing unions powers separation collection - lowerGround lowerOrder upperGround hLevels hAlpha hT valid hIdx U Rc u row A - (restriction p) cutCode).1 (pCode ▸ inD) - rcases branches.2 with inactive | ⟨_active, v, w, hv, hw, literal, forcedEqual⟩ - · obtain ⟨q, hq, activeQ⟩ := active - obtain ⟨r, _hr, rp, rq⟩ := (lowerH).directed cutMember hq - exact False.elim (inactive r rp (Name.forcesMem_mono activeQ rq)) - · have classU := M.refinementClass_mem lower pairing unions powers separation collection - lowerGround lowerOrder hT valid Rc.val u.val Rc.property u.property - have classV := M.refinementClass_mem lower pairing unions powers separation collection - lowerGround lowerOrder hT valid Rc.val v Rc.property (M.transitive hT hv) - have equal := (M.completeProjection_eval_eq_iff_forcesEq lower upper projection - pairing unions powers separation collection lowerGround upperGround inclusionGround H ordinary - (Name.refinementClass T valid Rc.val u.val) (Name.refinementClass T valid Rc.val v) - classU classV).2 ⟨restriction p, cutMember, forcedEqual⟩ - let a := Name.eval {q | (lowerH).mem q} (Name.refinementClass T valid Rf w) - refine ⟨a, (Name.mem_eval_refinementAssignmentLabel upper inclusion ⊤ T valid idx Rf Rc.val - {p | H.mem p} H.top_mem _).2 ?_⟩ - exact ⟨p, v, w, hp, hv, hw, ⟨row, A, pCode, literal⟩, - congrArg (fun x => ZFSet.pair x a) equal.symm⟩ - -theorem refinementAssignmentLabel_domain_total - (density : ∀ u : (M.nameDomain lower).names, u.val.val ∈ T → - domainSet u ∈ M.sets ∧ Dense {p : Q | upper.encode p ∈ domainSet u}) : - ∀ b ∈ Name.eval {q | (lowerH).mem q} (Name.refinementQuotient T valid U.val Rc.val), - ∃ a : ZFSet.{u}, ZFSet.pair b a ∈ Name.eval {p | H.mem p} label := by - intro b member - obtain ⟨sigma, q, entry, hq, equal⟩ := (Name.mem_eval {q | (lowerH).mem q} - (Name.refinementQuotient T valid U.val Rc.val) b).1 member - obtain ⟨u, hu, active, rfl⟩ := (Name.entry_refinementQuotient T valid U.val Rc.val sigma q).1 entry - let term : (M.nameDomain lower).names := ⟨u, M.transitive hT hu⟩ - have result := M.refinementAssignmentLabel_represents_active_term lower upper projection - pairing unions powers separation collection lowerGround upperGround lowerOrder inclusionGround - hLevels hAlpha hT valid idx hIdx U Rc Rf cutCoordinates H ordinary term hu - (density term hu).1 (density term hu).2 ⟨q, hq, active⟩ - exact equal ▸ result - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRepresentedDomainConditions + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P Q : Type u} +variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] +variable (lower : Presentation P) (upper : Presentation Q) +variable {restriction : Q →o P} {inclusion : P ↪o Q} +variable (projection : CompleteProjection restriction inclusion) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) +variable (lowerOrder : lower.conditionOrder ∈ M.sets) +variable (inclusionGround : lower.graph upper inclusion ∈ M.sets) +variable {levels alpha T : ZFSet.{u}} +variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName lower z) (idx : ZFSet.{u}) (hIdx : idx ∈ M.sets) +variable (U Rc : (M.nameDomain lower).names) (Rf : Name lower) +variable (cutCoordinates : ∀ p : Q, ∃ row A : ZFSet.{u}, upper.encode p = ZFSet.pair row A ∧ + lower.encode (restriction p) = ZFSet.pair row (assignmentCut levels alpha A)) +variable (H : ConditionFilter Q) (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) +include pairing unions powers separation collection lowerGround upperGround lowerOrder inclusionGround + hLevels hAlpha hT hIdx cutCoordinates ordinary + +local notation "lowerH" => projection.projectedFilter H +local notation "label" => Name.refinementAssignmentLabel upper inclusion ⊤ T valid idx Rf Rc.val +local notation "domainSet" => (M.representedDomainConditions lower upper.carrier levels alpha T valid idx U Rc) + +theorem refinementAssignmentLabel_represents_active_term + (u : (M.nameDomain lower).names) (_hu : u.val.val ∈ T) + (ground : domainSet u ∈ M.sets) + (dense : Dense {p : Q | upper.encode p ∈ domainSet u}) + (active : ∃ q : P, (lowerH).mem q ∧ Name.ForcesMem q u.val U.val) : + ∃ a : ZFSet.{u}, ZFSet.pair + (Name.eval {q | (lowerH).mem q} (Name.refinementClass T valid Rc.val u.val)) a ∈ + Name.eval {p | H.mem p} label := by + obtain ⟨p, hp, inD⟩ := M.ordinary_generic_meets_ground_dense upper pairing unions powers separation + H ordinary ground (M.representedDomainConditions_subset lower _ _ _ _ valid idx U Rc u) dense + obtain ⟨row, A, pCode, cutCode⟩ := cutCoordinates p + have cutMember : (lowerH).mem (restriction p) := + (projection.projectedFilter_mem_iff H _).2 ⟨p, hp, rfl⟩ + have branches := (M.pair_mem_representedDomainConditions lower pairing unions powers separation collection + lowerGround lowerOrder upperGround hLevels hAlpha hT valid hIdx U Rc u row A + (restriction p) cutCode).1 (pCode ▸ inD) + rcases branches.2 with inactive | ⟨_active, v, w, hv, hw, literal, forcedEqual⟩ + · obtain ⟨q, hq, activeQ⟩ := active + obtain ⟨r, _hr, rp, rq⟩ := (lowerH).directed cutMember hq + exact False.elim (inactive r rp (Name.forcesMem_mono activeQ rq)) + · have classU := M.refinementClass_mem lower pairing unions powers separation collection + lowerGround lowerOrder hT valid Rc.val u.val Rc.property u.property + have classV := M.refinementClass_mem lower pairing unions powers separation collection + lowerGround lowerOrder hT valid Rc.val v Rc.property (M.transitive hT hv) + have equal := (M.completeProjection_eval_eq_iff_forcesEq lower upper projection + pairing unions powers separation collection lowerGround upperGround inclusionGround H ordinary + (Name.refinementClass T valid Rc.val u.val) (Name.refinementClass T valid Rc.val v) + classU classV).2 ⟨restriction p, cutMember, forcedEqual⟩ + let a := Name.eval {q | (lowerH).mem q} (Name.refinementClass T valid Rf w) + refine ⟨a, (Name.mem_eval_refinementAssignmentLabel upper inclusion ⊤ T valid idx Rf Rc.val + {p | H.mem p} H.top_mem _).2 ?_⟩ + exact ⟨p, v, w, hp, hv, hw, ⟨row, A, pCode, literal⟩, + congrArg (fun x => ZFSet.pair x a) equal.symm⟩ + +theorem refinementAssignmentLabel_domain_total + (density : ∀ u : (M.nameDomain lower).names, u.val.val ∈ T → + domainSet u ∈ M.sets ∧ Dense {p : Q | upper.encode p ∈ domainSet u}) : + ∀ b ∈ Name.eval {q | (lowerH).mem q} (Name.refinementQuotient T valid U.val Rc.val), + ∃ a : ZFSet.{u}, ZFSet.pair b a ∈ Name.eval {p | H.mem p} label := by + intro b member + obtain ⟨sigma, q, entry, hq, equal⟩ := (Name.mem_eval {q | (lowerH).mem q} + (Name.refinementQuotient T valid U.val Rc.val) b).1 member + obtain ⟨u, hu, active, rfl⟩ := (Name.entry_refinementQuotient T valid U.val Rc.val sigma q).1 entry + let term : (M.nameDomain lower).names := ⟨u, M.transitive hT hu⟩ + have result := M.refinementAssignmentLabel_represents_active_term lower upper projection + pairing unions powers separation collection lowerGround upperGround lowerOrder inclusionGround + hLevels hAlpha hT valid idx hIdx U Rc Rf cutCoordinates H ordinary term hu + (density term hu).1 (density term hu).2 ⟨q, hq, active⟩ + exact equal ▸ result + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRepresentativeClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRepresentativeClosure.lean index 8201cd0aa778d9955abd577fe052839ede7b3df7..f49c6edf1b891604b456483e40d987af758068b7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRepresentativeClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRepresentativeClosure.lean @@ -1,274 +1,274 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.AssignmentQueryFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u - -theorem assignmentOnIndices_indices_on {I T X A : ZFSet.{u}} - (shape : A ⊆ stageOneAssignments I T) : - assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T A = - assignmentOnIndices X T A := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨hA, inside⟩ := (mem_assignmentOnIndices _ T A z).1 member - obtain ⟨t, ht, v, hv, w, hw, rfl⟩ := (mem_stageOneAssignments _ T z).1 inside - rw [assignmentIndices_on] at ht - exact (assignmentOnIndices_entry X T A t v w).2 - ⟨hA, (ZFSet.mem_inter.1 ht).2, hv, hw⟩ - · intro member - have hA := ((mem_assignmentOnIndices X T A z).1 member).1 - obtain ⟨t, ht, v, hv, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 (shape hA) - exact (assignmentOnIndices_entry _ T A t v w).2 - ⟨hA, (mem_assignmentIndices I T (assignmentOnIndices X T A) t).2 - ⟨ht, v, hv, w, hw, member⟩, hv, hw⟩ - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem assignmentQueryRelation_mem {I T C D : ZFSet.{u}} - (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) : - assignmentQueryRelation I T C D ∈ M.sets := by - let f := productFirst I (ZFSet.prod T T) - have hf : f ∈ M.sets := M.productFirst_mem pairing unions powers separation hI - (M.prod_mem pairing unions powers separation hT hT) - let params := extend I (extend f Fin.elim0) - have selected := M.bounded_separation_mem separation - (BoundedFormula.assignmentQueryRelationFormula 0 1 2) params - (Fin.cases hI (Fin.cases hf (fun j => Fin.elim0 j))) - (M.prod_mem pairing unions powers separation hC hD) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.assignmentQueryRelationFormula 0 1 2) (extend z params)) - (ZFSet.prod C D) = assignmentQueryRelation I T C D := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, assignmentQueryRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_assignmentQueryRelationFormula 0 1 2 - (extend z params) T rfl) - exact equal ▸ selected - -theorem realizedAssignmentQueries_mem {I T C D : ZFSet.{u}} - (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) : - realizedAssignmentQueries I T C D ∈ M.sets := - M.relationImage_mem separation hD hC (M.relationConverse_mem pairing unions powers separation - hC hD (M.assignmentQueryRelation_mem pairing unions powers separation hI hT hC hD)) - -theorem exists_assignmentQuerySelector - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I T C D : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) : - ∃ F ∈ M.sets, ZFSet.IsFunc (realizedAssignmentQueries I T C D) D F ∧ - F ⊆ assignmentQueryRelation I T C D := by - apply M.uniformize_relation pairing unions powers separation choice - (M.realizedAssignmentQueries_mem pairing unions powers separation hI hT hC hD) hD - (M.assignmentQueryRelation_mem pairing unions powers separation hI hT hC hD) - intro q member - exact ((mem_realizedAssignmentQueries I T C D q).1 member).2 - -theorem exists_stageOneAssignmentQuerySelector - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows I T D : ZFSet.{u}} (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) - (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (hD : D ∈ M.sets) : - ∃ F ∈ M.sets, - ZFSet.IsFunc (realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D) D F ∧ - F ⊆ assignmentQueryRelation I T (M.stageOneCandidateBound rows I T) D := - M.exists_assignmentQuerySelector pairing unions powers separation choice hI hT - (M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega) hD - -end TransitiveGround - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundOmegaOneClosure - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - {n : Nat} {f : (Fin (n + 1) → ZFSet.{u}) → ZFSet.{u}} - (defined : GroundDefinableFunction M f) (params : Fin n → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) - (inflationary : ∀ X ∈ M.sets, X ⊆ I → X ⊆ f (extend X params)) - (preserves : ∀ X ∈ M.sets, X ⊆ I → GroundBelow M X K → - f (extend X params) ⊆ I ∧ GroundBelow M (f (extend X params)) K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ history ∈ M.sets, - OrdinalRecursionTrace (fun alpha prior output => - output = f (extend (refinementHistoryIndices alpha prior) params)) C history ∧ - let X := refinementHistoryIndices C history - X ∈ M.sets ∧ X ⊆ I ∧ GroundBelow M X K ∧ - (∀ alpha Y, ZFSet.pair alpha Y ∈ history → - Y ∈ M.sets ∧ Y ⊆ I ∧ GroundBelow M Y K) ∧ - (∀ alpha beta Y Z, ZFSet.pair alpha Y ∈ history → - ZFSet.pair beta Z ∈ history → alpha ∈ beta → Y ⊆ Z) ∧ - ∀ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega → B ⊆ X → - ∃ beta ∈ C, - let U := refinementHistoryIndices beta history - U ∈ M.sets ∧ U ⊆ X ∧ GroundBelow M U K ∧ B ⊆ U ∧ f (extend U params) ⊆ X := by - let C := M.groundOmegaOne pairing unions powers separation collection infinite - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have hC := spec.1 - obtain ⟨history, hh, trace⟩ := M.exists_historyUnionTrace pairing unions separation collection - defined params members hC spec.2.1 - have bounds := M.historyUnionTrace_below pairing unions powers separation choice hK conditions - (fun X => f (extend X params)) preserves C - (conditions.groundOmegaOne_mem pairing unions powers separation collection infinite hK) history hh trace - let X := refinementHistoryIndices C history - have hX : X ∈ M.sets := M.refinementHistoryIndices_mem unions separation hC hh - have step (beta Y : ZFSet.{u}) (entry : ZFSet.pair beta Y ∈ history) : - Y = f (extend (refinementHistoryIndices beta history) params) := by - have result := trace.2 beta (trace.1.pair_source entry) Y entry - change Y = f (extend (refinementHistoryIndices beta (graphRestriction beta history)) params) at result - rw [refinementHistoryIndices_restrict (fun _ hx => hx)] at result - exact result - have earlierUnion (beta : ZFSet.{u}) (member : beta ∈ C) : - refinementHistoryIndices beta history ∈ M.sets ∧ - refinementHistoryIndices beta history ⊆ X ∧ - GroundBelow M (refinementHistoryIndices beta history) K := by - have ground := M.refinementHistoryIndices_mem unions separation (M.transitive hC member) hh - have subset := refinementHistoryIndices_mono (history := history) (spec.2.1.1 beta member) - exact ⟨ground, subset, bounds.2.2.restrict separation ground hK subset⟩ - refine ⟨history, hh, trace, hX, bounds.2.1, bounds.2.2, ?_, ?_, ?_⟩ - · intro alpha Y entry - exact ⟨M.transitive (M.union_mem unions (M.union_mem unions hh)) - (pair_second_mem_doubleUnion entry), bounds.1 alpha Y entry⟩ - · intro alpha beta Y Z first second before x inside - have earlier := earlierUnion beta (trace.1.pair_source second) - rw [step beta Z second] - exact inflationary _ earlier.1 (fun _ hx => bounds.2.1 (earlier.2.1 hx)) - ((mem_refinementHistoryIndices beta history x).2 ⟨alpha, before, Y, first, inside⟩) - · intro B hB small subset - obtain ⟨beta, member, captured⟩ := M.historyUnion_countable_capture - pairing unions powers separation collection infinite choice hh hB small subset - have earlier := earlierUnion beta member - refine ⟨beta, member, earlier.1, earlier.2.1, earlier.2.2, captured, ?_⟩ - obtain ⟨Y, entry⟩ := trace.1.total member - rw [← step beta Y entry] - intro x inside - exact (mem_refinementHistoryIndices C history x).2 ⟨beta, member, Y, entry, inside⟩ - -theorem assignmentQueryClosure_representatives - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows I T D c X : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (hX : X ∈ M.sets) - (shape : D ⊆ M.stageOneCandidateBound rows I T) - (selector : ZFSet.IsFunc - (realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D) D c) - (selected : c ⊆ assignmentQueryRelation I T (M.stageOneCandidateBound rows I T) D) - (capture : ∀ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega → B ⊆ X → - ∃ U, B ⊆ U ∧ representativeIndexStep I T - (realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D) c U ⊆ X) : - ∀ row A, ZFSet.pair row A ∈ D → - ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ - assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = - assignmentOnIndices X T A := by - intro row A member - let L := assignmentOnIndices X T A - let B := assignmentIndices I T L - let Q := realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D - have data := (M.pair_mem_stageOneCandidateBound rows I T row A).1 (shape member) - have hL : L ∈ M.sets := M.assignmentOnIndices_mem pairing unions powers separation hX hT data.2.1 - have smallL := M.assignmentOnIndices_small pairing unions powers separation hX hT data.2.1 - omega data.2.2.2 - have listShape : L ⊆ stageOneAssignments I T := - fun _ h => data.2.2.1 ((mem_assignmentOnIndices X T A _).1 h).1 - have queryCandidate : ZFSet.pair row L ∈ M.stageOneCandidateBound rows I T := - (M.pair_mem_stageOneCandidateBound rows I T row L).2 ⟨data.1, hL, listShape, smallL⟩ - have query : ZFSet.pair row L ∈ Q := - (mem_realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D _).2 - ⟨queryCandidate, ZFSet.pair row A, member, - (assignmentQueryRelation_entry I T (M.stageOneCandidateBound rows I T) D row L row A).2 - ⟨queryCandidate, member, rfl, assignmentOnIndices_indices_on data.2.2.1⟩⟩ - have hB : B ∈ M.sets := M.assignmentIndices_mem pairing unions powers separation hI hT hL - have smallB := M.assignmentIndices_small pairing unions powers separation choice hI hT hL omega smallL - have subsetB : B ⊆ X := by - intro i hi - change i ∈ assignmentIndices I T (assignmentOnIndices X T A) at hi - rw [assignmentIndices_on] at hi - exact (ZFSet.mem_inter.1 hi).2 - obtain ⟨U, captured, closed⟩ := capture B hB smallB subsetB - obtain ⟨p, entry, _⟩ := selector.2 (ZFSet.pair row L) query - have inD := (ZFSet.pair_mem_prod.1 (selector.1 entry)).2 - obtain ⟨other, _, C, _, _, _, rfl⟩ := - (M.mem_stageOneCandidateBound rows I T p).1 (shape inD) - have matched := (assignmentQueryRelation_entry I T (M.stageOneCandidateBound rows I T) D - row L other C).1 (selected entry) - obtain rfl := matched.2.2.1 - refine ⟨C, inD, ?_, matched.2.2.2⟩ - have localQuery : AssignmentQueryWithin U T (ZFSet.pair row L) := - ⟨row, L, rfl, (assignment_subset_iff_indices_subset listShape).2 captured⟩ - exact fun _ h => closed (representativeIndexStep_covers query localQuery entry h) - -theorem exists_assignmentRepresentativeClosure - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows I T D K : ZFSet.{u}} (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) - (hT : T ∈ M.sets) (hD : D ∈ M.sets) (hK : K ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) - (smallRows : GroundBelow M rows K) (smallT : GroundBelow M T K) - (shape : D ⊆ M.stageOneCandidateBound rows I T) : - ∃ X ∈ M.sets, X ⊆ I ∧ GroundBelow M X K ∧ - ∀ row A, ZFSet.pair row A ∈ D → - ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ - assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = - assignmentOnIndices X T A := by - have omega := M.omega_mem separation infinite - let Q := realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D - have hQ : Q ∈ M.sets := M.realizedAssignmentQueries_mem pairing unions powers separation hI hT - (M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega) hD - have queries : Q ⊆ M.stageOneCandidateBound rows I T := - fun _ h => ((mem_realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D _).1 h).1 - obtain ⟨c, hc, selector, selected⟩ := M.exists_stageOneAssignmentQuerySelector - pairing unions powers separation choice hRows hI hT omega hD - let params : Fin 4 → ZFSet.{u} := extend I (extend T (extend Q (extend c Fin.elim0))) - have members : ∀ j, params j ∈ M.sets := - Fin.cases hI (Fin.cases hT (Fin.cases hQ (Fin.cases hc (fun j => Fin.elim0 j)))) - have inflationary : ∀ X ∈ M.sets, X ⊆ I → - X ⊆ representativeIndexStep I T Q c X := - fun X _ _ => representativeIndexStep_contains I T Q c X - have preserves : ∀ X ∈ M.sets, X ⊆ I → GroundBelow M X K → - representativeIndexStep I T Q c X ⊆ I ∧ - GroundBelow M (representativeIndexStep I T Q c X) K := by - intro X hX subset smallX - exact ⟨representativeIndexStep_subset subset, - M.representativeIndexStep_below pairing unions powers separation infinite choice - hRows hI hT hQ hc hD hX hK conditions selector queries shape smallRows smallT smallX⟩ - obtain ⟨history, _, _, hX, subsetX, smallX, _, _, capture⟩ := - M.exists_groundOmegaOneClosure pairing unions powers separation collection infinite choice - hK conditions (M.definable_representativeIndexStep pairing unions separation) - params members inflationary preserves - refine ⟨_, hX, subsetX, smallX, - M.assignmentQueryClosure_representatives pairing unions powers separation choice - hI hT omega hX shape selector selected ?_⟩ - intro B hB countable subset - obtain ⟨beta, _, _, _, _, bounded, closed⟩ := capture B hB countable subset - exact ⟨refinementHistoryIndices beta history, bounded, closed⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.AssignmentQueryFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u + +theorem assignmentOnIndices_indices_on {I T X A : ZFSet.{u}} + (shape : A ⊆ stageOneAssignments I T) : + assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T A = + assignmentOnIndices X T A := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨hA, inside⟩ := (mem_assignmentOnIndices _ T A z).1 member + obtain ⟨t, ht, v, hv, w, hw, rfl⟩ := (mem_stageOneAssignments _ T z).1 inside + rw [assignmentIndices_on] at ht + exact (assignmentOnIndices_entry X T A t v w).2 + ⟨hA, (ZFSet.mem_inter.1 ht).2, hv, hw⟩ + · intro member + have hA := ((mem_assignmentOnIndices X T A z).1 member).1 + obtain ⟨t, ht, v, hv, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 (shape hA) + exact (assignmentOnIndices_entry _ T A t v w).2 + ⟨hA, (mem_assignmentIndices I T (assignmentOnIndices X T A) t).2 + ⟨ht, v, hv, w, hw, member⟩, hv, hw⟩ + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem assignmentQueryRelation_mem {I T C D : ZFSet.{u}} + (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) : + assignmentQueryRelation I T C D ∈ M.sets := by + let f := productFirst I (ZFSet.prod T T) + have hf : f ∈ M.sets := M.productFirst_mem pairing unions powers separation hI + (M.prod_mem pairing unions powers separation hT hT) + let params := extend I (extend f Fin.elim0) + have selected := M.bounded_separation_mem separation + (BoundedFormula.assignmentQueryRelationFormula 0 1 2) params + (Fin.cases hI (Fin.cases hf (fun j => Fin.elim0 j))) + (M.prod_mem pairing unions powers separation hC hD) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.assignmentQueryRelationFormula 0 1 2) (extend z params)) + (ZFSet.prod C D) = assignmentQueryRelation I T C D := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, assignmentQueryRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_assignmentQueryRelationFormula 0 1 2 + (extend z params) T rfl) + exact equal ▸ selected + +theorem realizedAssignmentQueries_mem {I T C D : ZFSet.{u}} + (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) : + realizedAssignmentQueries I T C D ∈ M.sets := + M.relationImage_mem separation hD hC (M.relationConverse_mem pairing unions powers separation + hC hD (M.assignmentQueryRelation_mem pairing unions powers separation hI hT hC hD)) + +theorem exists_assignmentQuerySelector + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I T C D : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) : + ∃ F ∈ M.sets, ZFSet.IsFunc (realizedAssignmentQueries I T C D) D F ∧ + F ⊆ assignmentQueryRelation I T C D := by + apply M.uniformize_relation pairing unions powers separation choice + (M.realizedAssignmentQueries_mem pairing unions powers separation hI hT hC hD) hD + (M.assignmentQueryRelation_mem pairing unions powers separation hI hT hC hD) + intro q member + exact ((mem_realizedAssignmentQueries I T C D q).1 member).2 + +theorem exists_stageOneAssignmentQuerySelector + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows I T D : ZFSet.{u}} (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) + (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (hD : D ∈ M.sets) : + ∃ F ∈ M.sets, + ZFSet.IsFunc (realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D) D F ∧ + F ⊆ assignmentQueryRelation I T (M.stageOneCandidateBound rows I T) D := + M.exists_assignmentQuerySelector pairing unions powers separation choice hI hT + (M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega) hD + +end TransitiveGround + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundOmegaOneClosure + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + {n : Nat} {f : (Fin (n + 1) → ZFSet.{u}) → ZFSet.{u}} + (defined : GroundDefinableFunction M f) (params : Fin n → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) + (inflationary : ∀ X ∈ M.sets, X ⊆ I → X ⊆ f (extend X params)) + (preserves : ∀ X ∈ M.sets, X ⊆ I → GroundBelow M X K → + f (extend X params) ⊆ I ∧ GroundBelow M (f (extend X params)) K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ history ∈ M.sets, + OrdinalRecursionTrace (fun alpha prior output => + output = f (extend (refinementHistoryIndices alpha prior) params)) C history ∧ + let X := refinementHistoryIndices C history + X ∈ M.sets ∧ X ⊆ I ∧ GroundBelow M X K ∧ + (∀ alpha Y, ZFSet.pair alpha Y ∈ history → + Y ∈ M.sets ∧ Y ⊆ I ∧ GroundBelow M Y K) ∧ + (∀ alpha beta Y Z, ZFSet.pair alpha Y ∈ history → + ZFSet.pair beta Z ∈ history → alpha ∈ beta → Y ⊆ Z) ∧ + ∀ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega → B ⊆ X → + ∃ beta ∈ C, + let U := refinementHistoryIndices beta history + U ∈ M.sets ∧ U ⊆ X ∧ GroundBelow M U K ∧ B ⊆ U ∧ f (extend U params) ⊆ X := by + let C := M.groundOmegaOne pairing unions powers separation collection infinite + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have hC := spec.1 + obtain ⟨history, hh, trace⟩ := M.exists_historyUnionTrace pairing unions separation collection + defined params members hC spec.2.1 + have bounds := M.historyUnionTrace_below pairing unions powers separation choice hK conditions + (fun X => f (extend X params)) preserves C + (conditions.groundOmegaOne_mem pairing unions powers separation collection infinite hK) history hh trace + let X := refinementHistoryIndices C history + have hX : X ∈ M.sets := M.refinementHistoryIndices_mem unions separation hC hh + have step (beta Y : ZFSet.{u}) (entry : ZFSet.pair beta Y ∈ history) : + Y = f (extend (refinementHistoryIndices beta history) params) := by + have result := trace.2 beta (trace.1.pair_source entry) Y entry + change Y = f (extend (refinementHistoryIndices beta (graphRestriction beta history)) params) at result + rw [refinementHistoryIndices_restrict (fun _ hx => hx)] at result + exact result + have earlierUnion (beta : ZFSet.{u}) (member : beta ∈ C) : + refinementHistoryIndices beta history ∈ M.sets ∧ + refinementHistoryIndices beta history ⊆ X ∧ + GroundBelow M (refinementHistoryIndices beta history) K := by + have ground := M.refinementHistoryIndices_mem unions separation (M.transitive hC member) hh + have subset := refinementHistoryIndices_mono (history := history) (spec.2.1.1 beta member) + exact ⟨ground, subset, bounds.2.2.restrict separation ground hK subset⟩ + refine ⟨history, hh, trace, hX, bounds.2.1, bounds.2.2, ?_, ?_, ?_⟩ + · intro alpha Y entry + exact ⟨M.transitive (M.union_mem unions (M.union_mem unions hh)) + (pair_second_mem_doubleUnion entry), bounds.1 alpha Y entry⟩ + · intro alpha beta Y Z first second before x inside + have earlier := earlierUnion beta (trace.1.pair_source second) + rw [step beta Z second] + exact inflationary _ earlier.1 (fun _ hx => bounds.2.1 (earlier.2.1 hx)) + ((mem_refinementHistoryIndices beta history x).2 ⟨alpha, before, Y, first, inside⟩) + · intro B hB small subset + obtain ⟨beta, member, captured⟩ := M.historyUnion_countable_capture + pairing unions powers separation collection infinite choice hh hB small subset + have earlier := earlierUnion beta member + refine ⟨beta, member, earlier.1, earlier.2.1, earlier.2.2, captured, ?_⟩ + obtain ⟨Y, entry⟩ := trace.1.total member + rw [← step beta Y entry] + intro x inside + exact (mem_refinementHistoryIndices C history x).2 ⟨beta, member, Y, entry, inside⟩ + +theorem assignmentQueryClosure_representatives + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows I T D c X : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (hX : X ∈ M.sets) + (shape : D ⊆ M.stageOneCandidateBound rows I T) + (selector : ZFSet.IsFunc + (realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D) D c) + (selected : c ⊆ assignmentQueryRelation I T (M.stageOneCandidateBound rows I T) D) + (capture : ∀ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega → B ⊆ X → + ∃ U, B ⊆ U ∧ representativeIndexStep I T + (realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D) c U ⊆ X) : + ∀ row A, ZFSet.pair row A ∈ D → + ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ + assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = + assignmentOnIndices X T A := by + intro row A member + let L := assignmentOnIndices X T A + let B := assignmentIndices I T L + let Q := realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D + have data := (M.pair_mem_stageOneCandidateBound rows I T row A).1 (shape member) + have hL : L ∈ M.sets := M.assignmentOnIndices_mem pairing unions powers separation hX hT data.2.1 + have smallL := M.assignmentOnIndices_small pairing unions powers separation hX hT data.2.1 + omega data.2.2.2 + have listShape : L ⊆ stageOneAssignments I T := + fun _ h => data.2.2.1 ((mem_assignmentOnIndices X T A _).1 h).1 + have queryCandidate : ZFSet.pair row L ∈ M.stageOneCandidateBound rows I T := + (M.pair_mem_stageOneCandidateBound rows I T row L).2 ⟨data.1, hL, listShape, smallL⟩ + have query : ZFSet.pair row L ∈ Q := + (mem_realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D _).2 + ⟨queryCandidate, ZFSet.pair row A, member, + (assignmentQueryRelation_entry I T (M.stageOneCandidateBound rows I T) D row L row A).2 + ⟨queryCandidate, member, rfl, assignmentOnIndices_indices_on data.2.2.1⟩⟩ + have hB : B ∈ M.sets := M.assignmentIndices_mem pairing unions powers separation hI hT hL + have smallB := M.assignmentIndices_small pairing unions powers separation choice hI hT hL omega smallL + have subsetB : B ⊆ X := by + intro i hi + change i ∈ assignmentIndices I T (assignmentOnIndices X T A) at hi + rw [assignmentIndices_on] at hi + exact (ZFSet.mem_inter.1 hi).2 + obtain ⟨U, captured, closed⟩ := capture B hB smallB subsetB + obtain ⟨p, entry, _⟩ := selector.2 (ZFSet.pair row L) query + have inD := (ZFSet.pair_mem_prod.1 (selector.1 entry)).2 + obtain ⟨other, _, C, _, _, _, rfl⟩ := + (M.mem_stageOneCandidateBound rows I T p).1 (shape inD) + have matched := (assignmentQueryRelation_entry I T (M.stageOneCandidateBound rows I T) D + row L other C).1 (selected entry) + obtain rfl := matched.2.2.1 + refine ⟨C, inD, ?_, matched.2.2.2⟩ + have localQuery : AssignmentQueryWithin U T (ZFSet.pair row L) := + ⟨row, L, rfl, (assignment_subset_iff_indices_subset listShape).2 captured⟩ + exact fun _ h => closed (representativeIndexStep_covers query localQuery entry h) + +theorem exists_assignmentRepresentativeClosure + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows I T D K : ZFSet.{u}} (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) + (hT : T ∈ M.sets) (hD : D ∈ M.sets) (hK : K ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) + (smallRows : GroundBelow M rows K) (smallT : GroundBelow M T K) + (shape : D ⊆ M.stageOneCandidateBound rows I T) : + ∃ X ∈ M.sets, X ⊆ I ∧ GroundBelow M X K ∧ + ∀ row A, ZFSet.pair row A ∈ D → + ∃ C, ZFSet.pair row C ∈ D ∧ assignmentIndices I T C ⊆ X ∧ + assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = + assignmentOnIndices X T A := by + have omega := M.omega_mem separation infinite + let Q := realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D + have hQ : Q ∈ M.sets := M.realizedAssignmentQueries_mem pairing unions powers separation hI hT + (M.stageOneCandidateBound_mem pairing unions powers separation hRows hI hT omega) hD + have queries : Q ⊆ M.stageOneCandidateBound rows I T := + fun _ h => ((mem_realizedAssignmentQueries I T (M.stageOneCandidateBound rows I T) D _).1 h).1 + obtain ⟨c, hc, selector, selected⟩ := M.exists_stageOneAssignmentQuerySelector + pairing unions powers separation choice hRows hI hT omega hD + let params : Fin 4 → ZFSet.{u} := extend I (extend T (extend Q (extend c Fin.elim0))) + have members : ∀ j, params j ∈ M.sets := + Fin.cases hI (Fin.cases hT (Fin.cases hQ (Fin.cases hc (fun j => Fin.elim0 j)))) + have inflationary : ∀ X ∈ M.sets, X ⊆ I → + X ⊆ representativeIndexStep I T Q c X := + fun X _ _ => representativeIndexStep_contains I T Q c X + have preserves : ∀ X ∈ M.sets, X ⊆ I → GroundBelow M X K → + representativeIndexStep I T Q c X ⊆ I ∧ + GroundBelow M (representativeIndexStep I T Q c X) K := by + intro X hX subset smallX + exact ⟨representativeIndexStep_subset subset, + M.representativeIndexStep_below pairing unions powers separation infinite choice + hRows hI hT hQ hc hD hX hK conditions selector queries shape smallRows smallT smallX⟩ + obtain ⟨history, _, _, hX, subsetX, smallX, _, _, capture⟩ := + M.exists_groundOmegaOneClosure pairing unions powers separation collection infinite choice + hK conditions (M.definable_representativeIndexStep pairing unions separation) + params members inflationary preserves + refine ⟨_, hX, subsetX, smallX, + M.assignmentQueryClosure_representatives pairing unions powers separation choice + hI hT omega hX shape selector selected ?_⟩ + intro B hB countable subset + obtain ⟨beta, _, _, _, _, bounded, closed⟩ := capture B hB countable subset + exact ⟨refinementHistoryIndices beta history, bounded, closed⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRequestBatches.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRequestBatches.lean index f2e2947a453425449bb94f6fd509df0a2d28a4a5..130da15184abf9ec2472903898f091682fb69ccb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRequestBatches.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAssignmentRequestBatches.lean @@ -1,253 +1,253 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -private noncomputable def storedClassFormula (side : Fin 2) : SetFormula 4 := - let w := prefixIndex 4 15 - let old := suffixIndex 4 15 - exBlock 15 (.ex (.conj - (BoundedFormula.nonemptyTupleFormula 14 0 (fun j => (w j).succ)).toFormula - (.conj (BoundedFormula.pairMembershipFormula (old 0).succ 0 (old 2).succ).toFormula - (reindex (extend (old 1).succ (extend (old 3).succ (fun j => (w j).succ))) - (M.definable_storedAssignmentClassGraph pairing unions powers separation side).formula)))) - -private theorem realize_storedClassFormula (side : Fin 2) - (env : Fin 4 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (storedClassFormula M pairing unions powers separation side) env ↔ - ∃ d : Fin 15 → ZFSet.{u}, (∀ j, d j ∈ M.sets) ∧ - ZFSet.pair (env 0) (refinementFormulaDataCode d) ∈ env 2 ∧ - env 1 = M.storedAssignmentClassGraph (env 3) d side := by - unfold storedClassFormula - rw [realize_exBlock] - apply exists_congr - intro d - apply and_congr_right - intro ground - have args (code : ZFSet.{u}) : - (fun j => extend code (extendMany 15 d env) - (extend (suffixIndex 4 15 1).succ - (extend (suffixIndex 4 15 3).succ (fun j => (prefixIndex 4 15 j).succ)) j)) = - extend (env 1) (extend (env 3) d) := by - rw [map_extend, map_extend] - simp only [extend, Fin.cases_succ, extendMany_suffix, extendMany_prefix] - simp only [realize_ex] - constructor - · rintro ⟨code, hc, tuple, stored, output⟩ - have all : ∀ j, (extend code (extendMany 15 d env)) j ∈ M.sets := - Fin.cases hc (extendMany_members 15 d env ground members) - have eqCode := (BoundedFormula.truth_nonemptyTupleFormula 14 0 - (fun j => (prefixIndex 4 15 j).succ) _).1 - ((BoundedFormula.realize_toFormula M _ _ all).1 tuple) - change code = refinementFormulaDataCode d at eqCode - have edge := (BoundedFormula.truth_pairMembershipFormula - (suffixIndex 4 15 0).succ 0 (suffixIndex 4 15 2).succ _).1 - ((BoundedFormula.realize_toFormula M _ _ all).1 stored) - change ZFSet.pair (env 0) code ∈ env 2 at edge - rw [realize_reindex, args] at output - have value := ((M.definable_storedAssignmentClassGraph pairing unions powers separation side).correct - (extend (env 3) d) (Fin.cases (members 3) ground) (env 1) (members 1)).1 output - exact ⟨eqCode ▸ edge, value⟩ - · rintro ⟨edge, value⟩ - let code := refinementFormulaDataCode d - have hc := M.refinementFormulaDataCode_mem pairing d ground - have all : ∀ j, (extend code (extendMany 15 d env)) j ∈ M.sets := - Fin.cases hc (extendMany_members 15 d env ground members) - refine ⟨code, hc, ?_, ?_, ?_⟩ - · apply (BoundedFormula.realize_toFormula M _ _ all).2 - exact (BoundedFormula.truth_nonemptyTupleFormula 14 0 - (fun j => (prefixIndex 4 15 j).succ) _).2 rfl - · apply (BoundedFormula.realize_toFormula M _ _ all).2 - exact (BoundedFormula.truth_pairMembershipFormula - (suffixIndex 4 15 0).succ 0 (suffixIndex 4 15 2).succ _).2 edge - · rw [realize_reindex, args] - exact ((M.definable_storedAssignmentClassGraph pairing unions powers separation side).correct - (extend (env 3) d) (Fin.cases (members 3) ground) (env 1) (members 1)).2 value - -include pairing unions powers separation in -theorem exists_storedAssignmentClassFamily - (collection : CollectionSchema M.sets) (side : Fin 2) - {levels stages history A T : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hHistory : history ∈ M.sets) (hA : A ∈ M.sets) - (inside : levels ⊆ stages) (valid : RefinementDataHistory stages history T) : - ∃ graph ∈ M.sets, FunctionGraphOn levels graph ∧ - ∀ alpha (d : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → - ∀ y, ZFSet.pair alpha y ∈ graph ↔ - alpha ∈ levels ∧ y = M.storedAssignmentClassGraph A d side := by - let params : Fin 2 → ZFSet.{u} := ![history, A] - have members : ∀ j, params j ∈ M.sets := Fin.cases hHistory (Fin.cases hA (fun j => Fin.elim0 j)) - let formula := storedClassFormula M pairing unions powers separation side - have meaning (alpha y : ZFSet.{u}) (ha : alpha ∈ M.sets) (hy : y ∈ M.sets) := - realize_storedClassFormula M pairing unions powers separation side - (extend alpha (extend y params)) (Fin.cases ha (Fin.cases hy members)) - have unique (alpha y z : ZFSet.{u}) (ha : alpha ∈ M.sets) (hy : y ∈ M.sets) (hz : z ∈ M.sets) - (first : Realize M.sets formula (extend alpha (extend y params))) - (second : Realize M.sets formula (extend alpha (extend z params))) : y = z := by - obtain ⟨d, _, de, dy⟩ := (meaning alpha y ha hy).1 first - obtain ⟨e, _, ee, ez⟩ := (meaning alpha z ha hz).1 second - have same := refinementFormulaDataCode_injective (valid.function.unique de ee) - exact dy.trans (same ▸ ez.symm) - obtain ⟨B, hB, bounded⟩ := M.collection_witness collection formula params members hLevels (by - intro alpha ha - obtain ⟨code, entry⟩ := valid.function.total (inside ha) - obtain ⟨d, rfl⟩ := valid.decoded alpha code entry - have fields := M.refinementFormulaDataCode_fields_mem _ (M.pair_right (M.transitive hHistory entry)) - have output := (M.definable_storedAssignmentClassGraph pairing unions powers separation side).closed - (extend A d) (Fin.cases hA fields) - exact ⟨_, output, (meaning alpha _ (M.transitive hLevels ha) output).2 ⟨d, fields, entry, rfl⟩⟩) - let graph := M.definableRelation formula params levels B - have hGraph := M.definableRelation_mem pairing unions powers separation formula params members hLevels hB - refine ⟨graph, hGraph, ⟨B, fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩, ?_⟩ - · intro alpha ha - obtain ⟨y, hy, rel⟩ := bounded alpha ha - refine ⟨y, (M.pair_mem_definableRelation formula params levels B alpha y).2 ⟨ha, hy, rel⟩, ?_⟩ - intro z hz - obtain ⟨_, hz, rz⟩ := (M.pair_mem_definableRelation formula params levels B alpha z).1 hz - exact unique alpha z y (M.transitive hLevels ha) (M.transitive hB hz) (M.transitive hB hy) rz rel - · intro alpha d entry y - rw [M.pair_mem_definableRelation] - constructor - · rintro ⟨ha, hy, rel⟩ - obtain ⟨e, _, ee, ey⟩ := (meaning alpha y (M.transitive hLevels ha) (M.transitive hB hy)).1 rel - have same := refinementFormulaDataCode_injective (valid.function.unique ee entry) - exact ⟨ha, same ▸ ey⟩ - · rintro ⟨ha, rfl⟩ - obtain ⟨z, hz, rel⟩ := bounded alpha ha - obtain ⟨e, _, ee, ez⟩ := (meaning alpha z (M.transitive hLevels ha) (M.transitive hB hz)).1 rel - have same := refinementFormulaDataCode_injective (valid.function.unique ee entry) - have eq : z = M.storedAssignmentClassGraph A d side := same ▸ ez - exact eq ▸ ⟨ha, hz, rel⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include pairing unions powers separation collection infinite choice - -open scoped ZFSet - -theorem exists_assignmentRequestBatch {stages history T A : ZFSet.{u}} - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) - (hA : A ∈ M.sets) (smallA : M.groundEmbeddable A ZFSet.omega) - (valid : RefinementDataHistory stages history T) - (shape : A ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) - (localFunctions : ∀ alpha (d : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → - ∀ side, FunctionGraphOn (assignmentOnIndices (d 0) T A) - (M.storedAssignmentClassGraph A d side)) : - let levels := relationImage A stages (refinementDataHistoryLevels stages history T) - levels ∈ M.sets ∧ M.groundEmbeddable levels ZFSet.omega ∧ levels ⊆ stages ∧ - ∃ families : Fin 2 → ZFSet.{u}, - (∀ side, families side ∈ M.sets ∧ FunctionGraphOn levels (families side)) ∧ - (∀ side alpha (d : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → - ∀ graph, ZFSet.pair alpha graph ∈ families side ↔ - alpha ∈ levels ∧ graph = M.storedAssignmentClassGraph A d side) ∧ - let flat := fun side => ⋃₀ functionGraphRange levels (families side) - let requests := fun side => functionGraphRange A (flat side) - (∀ side, flat side ∈ M.sets ∧ FunctionGraphOn A (flat side)) ∧ - (requests 0 ∪ requests 1) ∈ M.sets ∧ - M.groundEmbeddable (requests 0 ∪ requests 1) ZFSet.omega := by - let levels := relationImage A stages (refinementDataHistoryLevels stages history T) - have hOmega := M.omega_mem separation infinite - have hLevelGraph := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT - have hLevels := M.relationImage_mem separation hA hStages hLevelGraph - have smallLevels := M.groundEmbeddable_function_image pairing unions powers separation choice - hA hStages hOmega hLevelGraph valid.levels_function smallA - have inside : levels ⊆ stages := fun _ h => (mem_relationImage _ _ _ _).1 h |>.1 - have family (side : Fin 2) := M.exists_storedAssignmentClassFamily pairing unions powers separation - collection side hLevels hHistory hA inside valid - choose families ground functions entries using family - let flat := fun side => ⋃₀ functionGraphRange levels (families side) - have flatEntry (side : Fin 2) (z : ZFSet.{u}) : z ∈ flat side ↔ - ∃ alpha ∈ levels, ∃ d : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ - z ∈ M.storedAssignmentClassGraph A d side := by - rw [ZFSet.mem_sUnion] - constructor - · rintro ⟨g, hg, hz⟩ - obtain ⟨alpha, ha, stored⟩ := (mem_functionGraphRange levels (families side) g).1 hg - obtain ⟨code, entry⟩ := valid.function.total (inside ha) - obtain ⟨d, rfl⟩ := valid.decoded alpha code entry - exact ⟨alpha, ha, d, entry, ((entries side alpha d entry g).1 stored).2 ▸ hz⟩ - · rintro ⟨alpha, ha, d, entry, hz⟩ - exact ⟨_, (mem_functionGraphRange levels (families side) _).2 - ⟨alpha, ha, (entries side alpha d entry _).2 ⟨ha, rfl⟩⟩, hz⟩ - have levelOf {alpha : ZFSet.{u}} {d : Fin 15 → ZFSet.{u}} - (entry : ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history) - {x : ZFSet.{u}} (hx : x ∈ assignmentOnIndices (d 0) T A) : - ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T := by - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 - ((mem_assignmentOnIndices _ _ _ _).1 hx).2 - have terms := valid.terms alpha d entry - exact valid.coverage alpha (valid.function.pair_source entry) d entry i hi u - (terms.symm ▸ hu) w (terms.symm ▸ hw) - have cover (x : ZFSet.{u}) (hx : x ∈ A) : - ∃ alpha ∈ levels, ∃ d : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ - x ∈ assignmentOnIndices (d 0) T A := by - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 (shape hx) - obtain ⟨alpha, ha, d, entry, idx⟩ := (mem_refinementDataHistoryIndices _ _ _).1 hi - have selected := (mem_assignmentOnIndices (d 0) T A _).2 - ⟨hx, (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨idx, hu, hw⟩⟩ - exact ⟨alpha, (mem_relationImage _ _ _ _).2 ⟨ha, _, hx, levelOf entry selected⟩, - d, entry, selected⟩ - have flatGround (side : Fin 2) : flat side ∈ M.sets := - M.union_mem unions (M.functionGraphRange_mem unions separation hLevels (ground side)) - have flatFunction (side : Fin 2) : FunctionGraphOn A (flat side) := by - refine ⟨⋃₀ ⋃₀ flat side, ?_, ?_⟩ - · intro z hz - obtain ⟨alpha, _, d, entry, member⟩ := (flatEntry side z).1 hz - obtain ⟨x, hx, y, rfl⟩ := (localFunctions alpha d entry side).shape z member - exact ZFSet.pair_mem_prod.2 - ⟨((mem_assignmentOnIndices _ _ _ _).1 hx).1, pair_second_mem_doubleUnion hz⟩ - · intro x hx - obtain ⟨alpha, ha, d, entry, selected⟩ := cover x hx - obtain ⟨y, hy⟩ := (localFunctions alpha d entry side).total selected - refine ⟨y, (flatEntry side _).2 ⟨alpha, ha, d, entry, hy⟩, ?_⟩ - intro z hz - obtain ⟨beta, _, e, ee, ez⟩ := (flatEntry side _).1 hz - have betaSelected := (localFunctions beta e ee side).pair_source ez - have sameLevel := (functionCode_partial valid.levels_function).unique x beta alpha - (levelOf ee betaSelected) (levelOf entry selected) - subst beta - have same := refinementFormulaDataCode_injective (valid.function.unique ee entry) - subst e - exact (localFunctions alpha d entry side).unique ez hy - let requests := fun side => functionGraphRange A (flat side) - have requestGround (side : Fin 2) : requests side ∈ M.sets := - M.functionGraphRange_mem unions separation hA (flatGround side) - have requestSmall (side : Fin 2) : M.groundEmbeddable (requests side) ZFSet.omega := - M.groundEmbeddable_function_image pairing unions powers separation choice hA - (M.union_mem unions (M.union_mem unions (flatGround side))) hOmega (flatGround side) - (flatFunction side).to_isFunc smallA - exact ⟨hLevels, smallLevels, inside, families, fun side => ⟨ground side, functions side⟩, - entries, fun side => ⟨flatGround side, flatFunction side⟩, - M.binary_union_mem pairing unions (requestGround 0) (requestGround 1), - M.groundCountable_binary_union pairing unions powers separation infinite choice - (requestGround 0) (requestGround 1) (requestSmall 0) (requestSmall 1)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +private noncomputable def storedClassFormula (side : Fin 2) : SetFormula 4 := + let w := prefixIndex 4 15 + let old := suffixIndex 4 15 + exBlock 15 (.ex (.conj + (BoundedFormula.nonemptyTupleFormula 14 0 (fun j => (w j).succ)).toFormula + (.conj (BoundedFormula.pairMembershipFormula (old 0).succ 0 (old 2).succ).toFormula + (reindex (extend (old 1).succ (extend (old 3).succ (fun j => (w j).succ))) + (M.definable_storedAssignmentClassGraph pairing unions powers separation side).formula)))) + +private theorem realize_storedClassFormula (side : Fin 2) + (env : Fin 4 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (storedClassFormula M pairing unions powers separation side) env ↔ + ∃ d : Fin 15 → ZFSet.{u}, (∀ j, d j ∈ M.sets) ∧ + ZFSet.pair (env 0) (refinementFormulaDataCode d) ∈ env 2 ∧ + env 1 = M.storedAssignmentClassGraph (env 3) d side := by + unfold storedClassFormula + rw [realize_exBlock] + apply exists_congr + intro d + apply and_congr_right + intro ground + have args (code : ZFSet.{u}) : + (fun j => extend code (extendMany 15 d env) + (extend (suffixIndex 4 15 1).succ + (extend (suffixIndex 4 15 3).succ (fun j => (prefixIndex 4 15 j).succ)) j)) = + extend (env 1) (extend (env 3) d) := by + rw [map_extend, map_extend] + simp only [extend, Fin.cases_succ, extendMany_suffix, extendMany_prefix] + simp only [realize_ex] + constructor + · rintro ⟨code, hc, tuple, stored, output⟩ + have all : ∀ j, (extend code (extendMany 15 d env)) j ∈ M.sets := + Fin.cases hc (extendMany_members 15 d env ground members) + have eqCode := (BoundedFormula.truth_nonemptyTupleFormula 14 0 + (fun j => (prefixIndex 4 15 j).succ) _).1 + ((BoundedFormula.realize_toFormula M _ _ all).1 tuple) + change code = refinementFormulaDataCode d at eqCode + have edge := (BoundedFormula.truth_pairMembershipFormula + (suffixIndex 4 15 0).succ 0 (suffixIndex 4 15 2).succ _).1 + ((BoundedFormula.realize_toFormula M _ _ all).1 stored) + change ZFSet.pair (env 0) code ∈ env 2 at edge + rw [realize_reindex, args] at output + have value := ((M.definable_storedAssignmentClassGraph pairing unions powers separation side).correct + (extend (env 3) d) (Fin.cases (members 3) ground) (env 1) (members 1)).1 output + exact ⟨eqCode ▸ edge, value⟩ + · rintro ⟨edge, value⟩ + let code := refinementFormulaDataCode d + have hc := M.refinementFormulaDataCode_mem pairing d ground + have all : ∀ j, (extend code (extendMany 15 d env)) j ∈ M.sets := + Fin.cases hc (extendMany_members 15 d env ground members) + refine ⟨code, hc, ?_, ?_, ?_⟩ + · apply (BoundedFormula.realize_toFormula M _ _ all).2 + exact (BoundedFormula.truth_nonemptyTupleFormula 14 0 + (fun j => (prefixIndex 4 15 j).succ) _).2 rfl + · apply (BoundedFormula.realize_toFormula M _ _ all).2 + exact (BoundedFormula.truth_pairMembershipFormula + (suffixIndex 4 15 0).succ 0 (suffixIndex 4 15 2).succ _).2 edge + · rw [realize_reindex, args] + exact ((M.definable_storedAssignmentClassGraph pairing unions powers separation side).correct + (extend (env 3) d) (Fin.cases (members 3) ground) (env 1) (members 1)).2 value + +include pairing unions powers separation in +theorem exists_storedAssignmentClassFamily + (collection : CollectionSchema M.sets) (side : Fin 2) + {levels stages history A T : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hHistory : history ∈ M.sets) (hA : A ∈ M.sets) + (inside : levels ⊆ stages) (valid : RefinementDataHistory stages history T) : + ∃ graph ∈ M.sets, FunctionGraphOn levels graph ∧ + ∀ alpha (d : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → + ∀ y, ZFSet.pair alpha y ∈ graph ↔ + alpha ∈ levels ∧ y = M.storedAssignmentClassGraph A d side := by + let params : Fin 2 → ZFSet.{u} := ![history, A] + have members : ∀ j, params j ∈ M.sets := Fin.cases hHistory (Fin.cases hA (fun j => Fin.elim0 j)) + let formula := storedClassFormula M pairing unions powers separation side + have meaning (alpha y : ZFSet.{u}) (ha : alpha ∈ M.sets) (hy : y ∈ M.sets) := + realize_storedClassFormula M pairing unions powers separation side + (extend alpha (extend y params)) (Fin.cases ha (Fin.cases hy members)) + have unique (alpha y z : ZFSet.{u}) (ha : alpha ∈ M.sets) (hy : y ∈ M.sets) (hz : z ∈ M.sets) + (first : Realize M.sets formula (extend alpha (extend y params))) + (second : Realize M.sets formula (extend alpha (extend z params))) : y = z := by + obtain ⟨d, _, de, dy⟩ := (meaning alpha y ha hy).1 first + obtain ⟨e, _, ee, ez⟩ := (meaning alpha z ha hz).1 second + have same := refinementFormulaDataCode_injective (valid.function.unique de ee) + exact dy.trans (same ▸ ez.symm) + obtain ⟨B, hB, bounded⟩ := M.collection_witness collection formula params members hLevels (by + intro alpha ha + obtain ⟨code, entry⟩ := valid.function.total (inside ha) + obtain ⟨d, rfl⟩ := valid.decoded alpha code entry + have fields := M.refinementFormulaDataCode_fields_mem _ (M.pair_right (M.transitive hHistory entry)) + have output := (M.definable_storedAssignmentClassGraph pairing unions powers separation side).closed + (extend A d) (Fin.cases hA fields) + exact ⟨_, output, (meaning alpha _ (M.transitive hLevels ha) output).2 ⟨d, fields, entry, rfl⟩⟩) + let graph := M.definableRelation formula params levels B + have hGraph := M.definableRelation_mem pairing unions powers separation formula params members hLevels hB + refine ⟨graph, hGraph, ⟨B, fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩, ?_⟩ + · intro alpha ha + obtain ⟨y, hy, rel⟩ := bounded alpha ha + refine ⟨y, (M.pair_mem_definableRelation formula params levels B alpha y).2 ⟨ha, hy, rel⟩, ?_⟩ + intro z hz + obtain ⟨_, hz, rz⟩ := (M.pair_mem_definableRelation formula params levels B alpha z).1 hz + exact unique alpha z y (M.transitive hLevels ha) (M.transitive hB hz) (M.transitive hB hy) rz rel + · intro alpha d entry y + rw [M.pair_mem_definableRelation] + constructor + · rintro ⟨ha, hy, rel⟩ + obtain ⟨e, _, ee, ey⟩ := (meaning alpha y (M.transitive hLevels ha) (M.transitive hB hy)).1 rel + have same := refinementFormulaDataCode_injective (valid.function.unique ee entry) + exact ⟨ha, same ▸ ey⟩ + · rintro ⟨ha, rfl⟩ + obtain ⟨z, hz, rel⟩ := bounded alpha ha + obtain ⟨e, _, ee, ez⟩ := (meaning alpha z (M.transitive hLevels ha) (M.transitive hB hz)).1 rel + have same := refinementFormulaDataCode_injective (valid.function.unique ee entry) + have eq : z = M.storedAssignmentClassGraph A d side := same ▸ ez + exact eq ▸ ⟨ha, hz, rel⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include pairing unions powers separation collection infinite choice + +open scoped ZFSet + +theorem exists_assignmentRequestBatch {stages history T A : ZFSet.{u}} + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) + (hA : A ∈ M.sets) (smallA : M.groundEmbeddable A ZFSet.omega) + (valid : RefinementDataHistory stages history T) + (shape : A ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) + (localFunctions : ∀ alpha (d : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → + ∀ side, FunctionGraphOn (assignmentOnIndices (d 0) T A) + (M.storedAssignmentClassGraph A d side)) : + let levels := relationImage A stages (refinementDataHistoryLevels stages history T) + levels ∈ M.sets ∧ M.groundEmbeddable levels ZFSet.omega ∧ levels ⊆ stages ∧ + ∃ families : Fin 2 → ZFSet.{u}, + (∀ side, families side ∈ M.sets ∧ FunctionGraphOn levels (families side)) ∧ + (∀ side alpha (d : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → + ∀ graph, ZFSet.pair alpha graph ∈ families side ↔ + alpha ∈ levels ∧ graph = M.storedAssignmentClassGraph A d side) ∧ + let flat := fun side => ⋃₀ functionGraphRange levels (families side) + let requests := fun side => functionGraphRange A (flat side) + (∀ side, flat side ∈ M.sets ∧ FunctionGraphOn A (flat side)) ∧ + (requests 0 ∪ requests 1) ∈ M.sets ∧ + M.groundEmbeddable (requests 0 ∪ requests 1) ZFSet.omega := by + let levels := relationImage A stages (refinementDataHistoryLevels stages history T) + have hOmega := M.omega_mem separation infinite + have hLevelGraph := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT + have hLevels := M.relationImage_mem separation hA hStages hLevelGraph + have smallLevels := M.groundEmbeddable_function_image pairing unions powers separation choice + hA hStages hOmega hLevelGraph valid.levels_function smallA + have inside : levels ⊆ stages := fun _ h => (mem_relationImage _ _ _ _).1 h |>.1 + have family (side : Fin 2) := M.exists_storedAssignmentClassFamily pairing unions powers separation + collection side hLevels hHistory hA inside valid + choose families ground functions entries using family + let flat := fun side => ⋃₀ functionGraphRange levels (families side) + have flatEntry (side : Fin 2) (z : ZFSet.{u}) : z ∈ flat side ↔ + ∃ alpha ∈ levels, ∃ d : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ + z ∈ M.storedAssignmentClassGraph A d side := by + rw [ZFSet.mem_sUnion] + constructor + · rintro ⟨g, hg, hz⟩ + obtain ⟨alpha, ha, stored⟩ := (mem_functionGraphRange levels (families side) g).1 hg + obtain ⟨code, entry⟩ := valid.function.total (inside ha) + obtain ⟨d, rfl⟩ := valid.decoded alpha code entry + exact ⟨alpha, ha, d, entry, ((entries side alpha d entry g).1 stored).2 ▸ hz⟩ + · rintro ⟨alpha, ha, d, entry, hz⟩ + exact ⟨_, (mem_functionGraphRange levels (families side) _).2 + ⟨alpha, ha, (entries side alpha d entry _).2 ⟨ha, rfl⟩⟩, hz⟩ + have levelOf {alpha : ZFSet.{u}} {d : Fin 15 → ZFSet.{u}} + (entry : ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history) + {x : ZFSet.{u}} (hx : x ∈ assignmentOnIndices (d 0) T A) : + ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T := by + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 + ((mem_assignmentOnIndices _ _ _ _).1 hx).2 + have terms := valid.terms alpha d entry + exact valid.coverage alpha (valid.function.pair_source entry) d entry i hi u + (terms.symm ▸ hu) w (terms.symm ▸ hw) + have cover (x : ZFSet.{u}) (hx : x ∈ A) : + ∃ alpha ∈ levels, ∃ d : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ + x ∈ assignmentOnIndices (d 0) T A := by + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 (shape hx) + obtain ⟨alpha, ha, d, entry, idx⟩ := (mem_refinementDataHistoryIndices _ _ _).1 hi + have selected := (mem_assignmentOnIndices (d 0) T A _).2 + ⟨hx, (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨idx, hu, hw⟩⟩ + exact ⟨alpha, (mem_relationImage _ _ _ _).2 ⟨ha, _, hx, levelOf entry selected⟩, + d, entry, selected⟩ + have flatGround (side : Fin 2) : flat side ∈ M.sets := + M.union_mem unions (M.functionGraphRange_mem unions separation hLevels (ground side)) + have flatFunction (side : Fin 2) : FunctionGraphOn A (flat side) := by + refine ⟨⋃₀ ⋃₀ flat side, ?_, ?_⟩ + · intro z hz + obtain ⟨alpha, _, d, entry, member⟩ := (flatEntry side z).1 hz + obtain ⟨x, hx, y, rfl⟩ := (localFunctions alpha d entry side).shape z member + exact ZFSet.pair_mem_prod.2 + ⟨((mem_assignmentOnIndices _ _ _ _).1 hx).1, pair_second_mem_doubleUnion hz⟩ + · intro x hx + obtain ⟨alpha, ha, d, entry, selected⟩ := cover x hx + obtain ⟨y, hy⟩ := (localFunctions alpha d entry side).total selected + refine ⟨y, (flatEntry side _).2 ⟨alpha, ha, d, entry, hy⟩, ?_⟩ + intro z hz + obtain ⟨beta, _, e, ee, ez⟩ := (flatEntry side _).1 hz + have betaSelected := (localFunctions beta e ee side).pair_source ez + have sameLevel := (functionCode_partial valid.levels_function).unique x beta alpha + (levelOf ee betaSelected) (levelOf entry selected) + subst beta + have same := refinementFormulaDataCode_injective (valid.function.unique ee entry) + subst e + exact (localFunctions alpha d entry side).unique ez hy + let requests := fun side => functionGraphRange A (flat side) + have requestGround (side : Fin 2) : requests side ∈ M.sets := + M.functionGraphRange_mem unions separation hA (flatGround side) + have requestSmall (side : Fin 2) : M.groundEmbeddable (requests side) ZFSet.omega := + M.groundEmbeddable_function_image pairing unions powers separation choice hA + (M.union_mem unions (M.union_mem unions (flatGround side))) hOmega (flatGround side) + (flatFunction side).to_isFunc smallA + exact ⟨hLevels, smallLevels, inside, families, fun side => ⟨ground side, functions side⟩, + entries, fun side => ⟨flatGround side, flatFunction side⟩, + M.binary_union_mem pairing unions (requestGround 0) (requestGround 1), + M.groundCountable_binary_union pairing unions powers separation infinite choice + (requestGround 0) (requestGround 1) (requestSmall 0) (requestSmall 1)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAttachmentEmbeddings.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAttachmentEmbeddings.lean index fdb7bcf4a61cfe0ef63899737c1a7fc23467a3cb..d7f1e18f579c6c2fd96596a18c2c226f559e94bd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAttachmentEmbeddings.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundAttachmentEmbeddings.lean @@ -1,350 +1,350 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IndexedAttachmentCodes - -namespace OAI - - -namespace PartitionPilot.Forcing - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem taggedExtension_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P N : ZFSet.{u}} (hP : P ∈ M.sets) (hN : N ∈ M.sets) : - taggedExtension P N ∈ M.sets := by - have singleton : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - exact M.binary_union_mem pairing unions hP - (M.prod_mem pairing unions powers separation singleton hN) - -end TransitiveGround - - - - -universe u - -namespace BoundedFormula - -open SetFormula - -def attachmentShadowEntryFormula {n} (z q p μ ell a : Fin n) : BoundedFormula n := - exMem q (exMem p.succ - (.conj (orderedPairFormula z.succ.succ 1 0) - (exMem q.succ.succ - (.conj (tripleMembershipFormula 2 a.succ.succ.succ 0 μ.succ.succ.succ) - (pairMembershipFormula 0 1 ell.succ.succ.succ))))) - -theorem truth_attachmentShadowEntryFormula {n} (z q p μ ell a : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (attachmentShadowEntryFormula z q p μ ell a) env ↔ - env z ∈ attachmentShadowGraph (env q) (env p) (env μ) (env ell) (env a) := by - simp only [attachmentShadowEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_tripleMembershipFormula, truth_pairMembershipFormula, - mem_attachmentShadowGraph] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem attachmentIdeal_mem (separation : SeparationSchema M.sets) - {Q rQ a : ZFSet.{u}} (hQ : Q ∈ M.sets) (hrQ : rQ ∈ M.sets) - (ha : a ∈ M.sets) : attachmentIdeal Q rQ a ∈ M.sets := by - let params := extend a (extend rQ Fin.elim0) - have selected := M.bounded_separation_mem separation - (BoundedFormula.pairMembershipFormula 0 1 2) params - (Fin.cases ha (Fin.cases hrQ (fun i => Fin.elim0 i))) hQ - have equal : ZFSet.sep (fun q => BoundedFormula.Truth - (BoundedFormula.pairMembershipFormula 0 1 2) (extend q params)) Q = - attachmentIdeal Q rQ a := by - apply ZFSet.ext - intro q - rw [ZFSet.mem_sep, mem_attachmentIdeal, BoundedFormula.truth_pairMembershipFormula] - rfl - exact equal ▸ selected - -theorem freshPart_mem (separation : SeparationSchema M.sets) - {Q rQ a : ZFSet.{u}} (hQ : Q ∈ M.sets) (hrQ : rQ ∈ M.sets) - (ha : a ∈ M.sets) : freshPart Q rQ a ∈ M.sets := by - let params := extend a (extend rQ Fin.elim0) - have selected := M.bounded_separation_mem separation - (.neg (BoundedFormula.pairMembershipFormula 0 1 2)) params - (Fin.cases ha (Fin.cases hrQ (fun i => Fin.elim0 i))) hQ - have equal : ZFSet.sep (fun q => BoundedFormula.Truth - (.neg (BoundedFormula.pairMembershipFormula 0 1 2)) (extend q params)) Q = - freshPart Q rQ a := by - apply ZFSet.ext - intro q - simp only [ZFSet.mem_sep, mem_freshPart, BoundedFormula.Truth, - BoundedFormula.truth_pairMembershipFormula] - rfl - exact equal ▸ selected - -theorem attachmentShadowGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Q P μQ ell a : ZFSet.{u}} (hQ : Q ∈ M.sets) (hP : P ∈ M.sets) - (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) (ha : a ∈ M.sets) : - attachmentShadowGraph Q P μQ ell a ∈ M.sets := by - let params := extend Q (extend P (extend μQ (extend ell (extend a Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.attachmentShadowEntryFormula 0 1 2 3 4 5) params - (Fin.cases hQ (Fin.cases hP (Fin.cases hμQ (Fin.cases hell - (Fin.cases ha (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hQ hP) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.attachmentShadowEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod Q P) = attachmentShadowGraph Q P μQ ell a := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_attachmentShadowEntryFormula] - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact equal ▸ selected - -end TransitiveGround - - - - - - -noncomputable def attachmentOldEmbeddingGraph (P : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ P, z = ZFSet.pair x x) (ZFSet.prod P P) - -noncomputable def attachmentFreshEmbeddingGraph (P N : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ q ∈ N, z = ZFSet.pair q (ZFSet.pair P q)) - (ZFSet.prod N (taggedExtension P N)) - -noncomputable def attachmentTemplateEmbeddingGraph (P Q rQ ell a : ZFSet.{u}) : ZFSet.{u} := - ell ∪ attachmentFreshEmbeddingGraph P (freshPart Q rQ a) - -theorem mem_attachmentOldEmbeddingGraph (P z : ZFSet.{u}) : - z ∈ attachmentOldEmbeddingGraph P ↔ ∃ x ∈ P, z = ZFSet.pair x x := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · rintro ⟨x, hx, rfl⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hx⟩, x, hx, rfl⟩ - -theorem pair_mem_attachmentOldEmbeddingGraph (P x y : ZFSet.{u}) : - ZFSet.pair x y ∈ attachmentOldEmbeddingGraph P ↔ x ∈ P ∧ y = x := by - rw [mem_attachmentOldEmbeddingGraph] - constructor - · rintro ⟨z, hz, eq⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hz, rfl⟩ - · rintro ⟨hx, rfl⟩ - exact ⟨_, hx, rfl⟩ - -theorem attachmentOldEmbeddingGraph_isFunc (P N : ZFSet.{u}) : - ZFSet.IsFunc P (taggedExtension P N) (attachmentOldEmbeddingGraph P) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, rfl⟩ := (mem_attachmentOldEmbeddingGraph P z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hx, old_mem_taggedExtension hx⟩ - · intro x hx - exact ⟨x, (pair_mem_attachmentOldEmbeddingGraph P x x).2 ⟨hx, rfl⟩, - fun y hy => ((pair_mem_attachmentOldEmbeddingGraph P x y).1 hy).2⟩ - -theorem attachmentOldEmbeddingGraph_injection (P N : ZFSet.{u}) : - InjectionCode P (taggedExtension P N) (attachmentOldEmbeddingGraph P) := by - refine ⟨attachmentOldEmbeddingGraph_isFunc P N, ?_⟩ - intro x y z hx hy - exact ((pair_mem_attachmentOldEmbeddingGraph P x z).1 hx).2.symm.trans - ((pair_mem_attachmentOldEmbeddingGraph P y z).1 hy).2 - -theorem mem_attachmentFreshEmbeddingGraph (P N z : ZFSet.{u}) : - z ∈ attachmentFreshEmbeddingGraph P N ↔ ∃ q ∈ N, z = ZFSet.pair q (ZFSet.pair P q) := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · rintro ⟨q, hq, rfl⟩ - exact ZFSet.mem_sep.2 - ⟨ZFSet.pair_mem_prod.2 ⟨hq, pair_mem_taggedExtension.2 hq⟩, q, hq, rfl⟩ - -theorem pair_mem_attachmentFreshEmbeddingGraph (P N q y : ZFSet.{u}) : - ZFSet.pair q y ∈ attachmentFreshEmbeddingGraph P N ↔ q ∈ N ∧ y = ZFSet.pair P q := by - rw [mem_attachmentFreshEmbeddingGraph] - constructor - · rintro ⟨r, hr, eq⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hr, rfl⟩ - · rintro ⟨hq, rfl⟩ - exact ⟨q, hq, rfl⟩ - -theorem mem_attachmentTemplateEmbeddingGraph (P Q rQ ell a z : ZFSet.{u}) : - z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ - z ∈ ell ∨ ∃ q ∈ freshPart Q rQ a, z = ZFSet.pair q (ZFSet.pair P q) := by - rw [attachmentTemplateEmbeddingGraph, ZFSet.mem_union, mem_attachmentFreshEmbeddingGraph] - -theorem pair_mem_attachmentTemplateEmbeddingGraph (P Q rQ ell a q y : ZFSet.{u}) : - ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ - ZFSet.pair q y ∈ ell ∨ (q ∈ freshPart Q rQ a ∧ y = ZFSet.pair P q) := by - rw [attachmentTemplateEmbeddingGraph, ZFSet.mem_union, pair_mem_attachmentFreshEmbeddingGraph] - -theorem attachmentTemplateEmbeddingGraph_of_ideal {P Q rQ ell a q y : ZFSet.{u}} - (hq : q ∈ attachmentIdeal Q rQ a) : - ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ ZFSet.pair q y ∈ ell := by - rw [pair_mem_attachmentTemplateEmbeddingGraph] - exact ⟨fun h => h.elim id (fun h => False.elim (attachmentIdeal_not_freshPart hq h.1)), Or.inl⟩ - -theorem attachmentTemplateEmbeddingGraph_of_fresh {P Q rQ ell a q y : ZFSet.{u}} - (function : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) - (hq : q ∈ freshPart Q rQ a) : - ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ y = ZFSet.pair P q := by - rw [pair_mem_attachmentTemplateEmbeddingGraph] - constructor - · intro h - rcases h with h | h - · exact False.elim (attachmentIdeal_not_freshPart (ZFSet.pair_mem_prod.1 (function.1 h)).1 hq) - · exact h.2 - · exact fun eq => Or.inr ⟨hq, eq⟩ - -theorem attachmentTemplateEmbeddingGraph_isFunc {P Q rQ ell a : ZFSet.{u}} - (function : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) : - ZFSet.IsFunc Q (taggedExtension P (freshPart Q rQ a)) - (attachmentTemplateEmbeddingGraph P Q rQ ell a) := by - classical - refine ⟨?_, ?_⟩ - · intro z hz - rcases (mem_attachmentTemplateEmbeddingGraph P Q rQ ell a z).1 hz with old | ⟨q, hq, rfl⟩ - · obtain ⟨q, hq, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 old) - exact ZFSet.pair_mem_prod.2 ⟨((mem_attachmentIdeal Q rQ a q).1 hq).1, old_mem_taggedExtension hy⟩ - · exact ZFSet.pair_mem_prod.2 - ⟨((mem_freshPart Q rQ a q).1 hq).1, pair_mem_taggedExtension.2 hq⟩ - · intro q hq - by_cases below : ZFSet.pair q a ∈ rQ - · have ideal := (mem_attachmentIdeal Q rQ a q).2 ⟨hq, below⟩ - obtain ⟨y, entry, unique⟩ := function.2 q ideal - exact ⟨y, attachmentTemplateEmbeddingGraph_of_ideal ideal |>.2 entry, - fun z hz => unique z ((attachmentTemplateEmbeddingGraph_of_ideal ideal).1 hz)⟩ - · have fresh := (mem_freshPart Q rQ a q).2 ⟨hq, below⟩ - exact ⟨ZFSet.pair P q, (attachmentTemplateEmbeddingGraph_of_fresh function fresh).2 rfl, - fun y hy => (attachmentTemplateEmbeddingGraph_of_fresh function fresh).1 hy⟩ - -theorem attachmentTemplateEmbeddingGraph_injection {P Q rQ ell a : ZFSet.{u}} - (embedding : InjectionCode (attachmentIdeal Q rQ a) P ell) : - InjectionCode Q (taggedExtension P (freshPart Q rQ a)) - (attachmentTemplateEmbeddingGraph P Q rQ ell a) := by - refine ⟨attachmentTemplateEmbeddingGraph_isFunc embedding.function, ?_⟩ - intro x y z hx hy - rcases (pair_mem_attachmentTemplateEmbeddingGraph P Q rQ ell a x z).1 hx with hx | hx - · rcases (pair_mem_attachmentTemplateEmbeddingGraph P Q rQ ell a y z).1 hy with hy | hy - · exact embedding.injective x y z hx hy - · exact False.elim (pair_tag_not_mem P y (hy.2 ▸ (ZFSet.pair_mem_prod.1 (embedding.function.1 hx)).2)) - · rcases (pair_mem_attachmentTemplateEmbeddingGraph P Q rQ ell a y z).1 hy with hy | hy - · exact False.elim (pair_tag_not_mem P x (hx.2 ▸ (ZFSet.pair_mem_prod.1 (embedding.function.1 hy)).2)) - · exact (ZFSet.pair_inj.1 (hx.2.symm.trans hy.2)).2 - - - - - - -namespace BoundedFormula - -open SetFormula - -def attachmentOldEmbeddingEntryFormula {n} (z p : Fin n) : BoundedFormula n := - exMem p (orderedPairFormula z.succ 0 0) - -def attachmentFreshEmbeddingEntryFormula {n} (z p d : Fin n) : BoundedFormula n := - exMem d (exMem z.succ (exMem 0 - (.conj (orderedPairFormula 0 p.succ.succ.succ 2) - (orderedPairFormula z.succ.succ.succ 2 0)))) - -theorem truth_attachmentOldEmbeddingEntryFormula {n} (z p : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (attachmentOldEmbeddingEntryFormula z p) env ↔ - ∃ x ∈ env p, env z = ZFSet.pair x x := by - simp only [attachmentOldEmbeddingEntryFormula, truth_exMem, truth_orderedPairFormula] - rfl - -theorem truth_attachmentFreshEmbeddingEntryFormula {n} (z p d : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (attachmentFreshEmbeddingEntryFormula z p d) env ↔ - ∃ q ∈ env d, env z = ZFSet.pair q (ZFSet.pair (env p) q) := by - simp only [attachmentFreshEmbeddingEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - change (∃ q ∈ env d, ∃ a ∈ env z, ∃ b ∈ a, - b = ZFSet.pair (env p) q ∧ env z = ZFSet.pair q b) ↔ _ - constructor - · rintro ⟨q, hq, _, _, b, _, rfl, eq⟩ - exact ⟨q, hq, eq⟩ - · rintro ⟨q, hq, eq⟩ - refine ⟨q, hq, {q, ZFSet.pair (env p) q}, ?_, ZFSet.pair (env p) q, - ZFSet.mem_pair.2 (Or.inr rfl), rfl, eq⟩ - rw [eq] - exact ZFSet.mem_pair.2 (Or.inr rfl) - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem attachmentOldEmbeddingGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P : ZFSet.{u}} (hP : P ∈ M.sets) : attachmentOldEmbeddingGraph P ∈ M.sets := by - let params := extend P Fin.elim0 - have selected := M.bounded_separation_mem separation - (BoundedFormula.attachmentOldEmbeddingEntryFormula 0 1) params - (Fin.cases hP (fun i => Fin.elim0 i)) - (M.prod_mem pairing unions powers separation hP hP) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.attachmentOldEmbeddingEntryFormula 0 1) (extend z params)) - (ZFSet.prod P P) = attachmentOldEmbeddingGraph P := by - apply ZFSet.ext - intro z - rw [attachmentOldEmbeddingGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_attachmentOldEmbeddingEntryFormula 0 1 _) - exact eq ▸ selected - -theorem attachmentFreshEmbeddingGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P N : ZFSet.{u}} (hP : P ∈ M.sets) (hN : N ∈ M.sets) : - attachmentFreshEmbeddingGraph P N ∈ M.sets := by - let params := extend P (extend N Fin.elim0) - have selected := M.bounded_separation_mem separation - (BoundedFormula.attachmentFreshEmbeddingEntryFormula 0 1 2) params - (Fin.cases hP (Fin.cases hN (fun i => Fin.elim0 i))) - (M.prod_mem pairing unions powers separation hN - (M.taggedExtension_mem pairing unions powers separation hP hN)) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.attachmentFreshEmbeddingEntryFormula 0 1 2) (extend z params)) - (ZFSet.prod N (taggedExtension P N)) = attachmentFreshEmbeddingGraph P N := by - apply ZFSet.ext - intro z - rw [attachmentFreshEmbeddingGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_attachmentFreshEmbeddingEntryFormula 0 1 2 _) - exact eq ▸ selected - -theorem attachmentTemplateEmbeddingGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P Q rQ ell a : ZFSet.{u}} (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) - (hrQ : rQ ∈ M.sets) (hell : ell ∈ M.sets) (ha : a ∈ M.sets) : - attachmentTemplateEmbeddingGraph P Q rQ ell a ∈ M.sets := - M.binary_union_mem pairing unions hell - (M.attachmentFreshEmbeddingGraph_mem pairing unions powers separation hP - (M.freshPart_mem separation hQ hrQ ha)) - -end TransitiveGround - - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IndexedAttachmentCodes + +namespace OAI + + +namespace PartitionPilot.Forcing + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem taggedExtension_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P N : ZFSet.{u}} (hP : P ∈ M.sets) (hN : N ∈ M.sets) : + taggedExtension P N ∈ M.sets := by + have singleton : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + exact M.binary_union_mem pairing unions hP + (M.prod_mem pairing unions powers separation singleton hN) + +end TransitiveGround + + + + +universe u + +namespace BoundedFormula + +open SetFormula + +def attachmentShadowEntryFormula {n} (z q p μ ell a : Fin n) : BoundedFormula n := + exMem q (exMem p.succ + (.conj (orderedPairFormula z.succ.succ 1 0) + (exMem q.succ.succ + (.conj (tripleMembershipFormula 2 a.succ.succ.succ 0 μ.succ.succ.succ) + (pairMembershipFormula 0 1 ell.succ.succ.succ))))) + +theorem truth_attachmentShadowEntryFormula {n} (z q p μ ell a : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (attachmentShadowEntryFormula z q p μ ell a) env ↔ + env z ∈ attachmentShadowGraph (env q) (env p) (env μ) (env ell) (env a) := by + simp only [attachmentShadowEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_tripleMembershipFormula, truth_pairMembershipFormula, + mem_attachmentShadowGraph] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem attachmentIdeal_mem (separation : SeparationSchema M.sets) + {Q rQ a : ZFSet.{u}} (hQ : Q ∈ M.sets) (hrQ : rQ ∈ M.sets) + (ha : a ∈ M.sets) : attachmentIdeal Q rQ a ∈ M.sets := by + let params := extend a (extend rQ Fin.elim0) + have selected := M.bounded_separation_mem separation + (BoundedFormula.pairMembershipFormula 0 1 2) params + (Fin.cases ha (Fin.cases hrQ (fun i => Fin.elim0 i))) hQ + have equal : ZFSet.sep (fun q => BoundedFormula.Truth + (BoundedFormula.pairMembershipFormula 0 1 2) (extend q params)) Q = + attachmentIdeal Q rQ a := by + apply ZFSet.ext + intro q + rw [ZFSet.mem_sep, mem_attachmentIdeal, BoundedFormula.truth_pairMembershipFormula] + rfl + exact equal ▸ selected + +theorem freshPart_mem (separation : SeparationSchema M.sets) + {Q rQ a : ZFSet.{u}} (hQ : Q ∈ M.sets) (hrQ : rQ ∈ M.sets) + (ha : a ∈ M.sets) : freshPart Q rQ a ∈ M.sets := by + let params := extend a (extend rQ Fin.elim0) + have selected := M.bounded_separation_mem separation + (.neg (BoundedFormula.pairMembershipFormula 0 1 2)) params + (Fin.cases ha (Fin.cases hrQ (fun i => Fin.elim0 i))) hQ + have equal : ZFSet.sep (fun q => BoundedFormula.Truth + (.neg (BoundedFormula.pairMembershipFormula 0 1 2)) (extend q params)) Q = + freshPart Q rQ a := by + apply ZFSet.ext + intro q + simp only [ZFSet.mem_sep, mem_freshPart, BoundedFormula.Truth, + BoundedFormula.truth_pairMembershipFormula] + rfl + exact equal ▸ selected + +theorem attachmentShadowGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Q P μQ ell a : ZFSet.{u}} (hQ : Q ∈ M.sets) (hP : P ∈ M.sets) + (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) (ha : a ∈ M.sets) : + attachmentShadowGraph Q P μQ ell a ∈ M.sets := by + let params := extend Q (extend P (extend μQ (extend ell (extend a Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.attachmentShadowEntryFormula 0 1 2 3 4 5) params + (Fin.cases hQ (Fin.cases hP (Fin.cases hμQ (Fin.cases hell + (Fin.cases ha (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hQ hP) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.attachmentShadowEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod Q P) = attachmentShadowGraph Q P μQ ell a := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_attachmentShadowEntryFormula] + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact equal ▸ selected + +end TransitiveGround + + + + + + +noncomputable def attachmentOldEmbeddingGraph (P : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ P, z = ZFSet.pair x x) (ZFSet.prod P P) + +noncomputable def attachmentFreshEmbeddingGraph (P N : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ q ∈ N, z = ZFSet.pair q (ZFSet.pair P q)) + (ZFSet.prod N (taggedExtension P N)) + +noncomputable def attachmentTemplateEmbeddingGraph (P Q rQ ell a : ZFSet.{u}) : ZFSet.{u} := + ell ∪ attachmentFreshEmbeddingGraph P (freshPart Q rQ a) + +theorem mem_attachmentOldEmbeddingGraph (P z : ZFSet.{u}) : + z ∈ attachmentOldEmbeddingGraph P ↔ ∃ x ∈ P, z = ZFSet.pair x x := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · rintro ⟨x, hx, rfl⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hx⟩, x, hx, rfl⟩ + +theorem pair_mem_attachmentOldEmbeddingGraph (P x y : ZFSet.{u}) : + ZFSet.pair x y ∈ attachmentOldEmbeddingGraph P ↔ x ∈ P ∧ y = x := by + rw [mem_attachmentOldEmbeddingGraph] + constructor + · rintro ⟨z, hz, eq⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hz, rfl⟩ + · rintro ⟨hx, rfl⟩ + exact ⟨_, hx, rfl⟩ + +theorem attachmentOldEmbeddingGraph_isFunc (P N : ZFSet.{u}) : + ZFSet.IsFunc P (taggedExtension P N) (attachmentOldEmbeddingGraph P) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, rfl⟩ := (mem_attachmentOldEmbeddingGraph P z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hx, old_mem_taggedExtension hx⟩ + · intro x hx + exact ⟨x, (pair_mem_attachmentOldEmbeddingGraph P x x).2 ⟨hx, rfl⟩, + fun y hy => ((pair_mem_attachmentOldEmbeddingGraph P x y).1 hy).2⟩ + +theorem attachmentOldEmbeddingGraph_injection (P N : ZFSet.{u}) : + InjectionCode P (taggedExtension P N) (attachmentOldEmbeddingGraph P) := by + refine ⟨attachmentOldEmbeddingGraph_isFunc P N, ?_⟩ + intro x y z hx hy + exact ((pair_mem_attachmentOldEmbeddingGraph P x z).1 hx).2.symm.trans + ((pair_mem_attachmentOldEmbeddingGraph P y z).1 hy).2 + +theorem mem_attachmentFreshEmbeddingGraph (P N z : ZFSet.{u}) : + z ∈ attachmentFreshEmbeddingGraph P N ↔ ∃ q ∈ N, z = ZFSet.pair q (ZFSet.pair P q) := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · rintro ⟨q, hq, rfl⟩ + exact ZFSet.mem_sep.2 + ⟨ZFSet.pair_mem_prod.2 ⟨hq, pair_mem_taggedExtension.2 hq⟩, q, hq, rfl⟩ + +theorem pair_mem_attachmentFreshEmbeddingGraph (P N q y : ZFSet.{u}) : + ZFSet.pair q y ∈ attachmentFreshEmbeddingGraph P N ↔ q ∈ N ∧ y = ZFSet.pair P q := by + rw [mem_attachmentFreshEmbeddingGraph] + constructor + · rintro ⟨r, hr, eq⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hr, rfl⟩ + · rintro ⟨hq, rfl⟩ + exact ⟨q, hq, rfl⟩ + +theorem mem_attachmentTemplateEmbeddingGraph (P Q rQ ell a z : ZFSet.{u}) : + z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ + z ∈ ell ∨ ∃ q ∈ freshPart Q rQ a, z = ZFSet.pair q (ZFSet.pair P q) := by + rw [attachmentTemplateEmbeddingGraph, ZFSet.mem_union, mem_attachmentFreshEmbeddingGraph] + +theorem pair_mem_attachmentTemplateEmbeddingGraph (P Q rQ ell a q y : ZFSet.{u}) : + ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ + ZFSet.pair q y ∈ ell ∨ (q ∈ freshPart Q rQ a ∧ y = ZFSet.pair P q) := by + rw [attachmentTemplateEmbeddingGraph, ZFSet.mem_union, pair_mem_attachmentFreshEmbeddingGraph] + +theorem attachmentTemplateEmbeddingGraph_of_ideal {P Q rQ ell a q y : ZFSet.{u}} + (hq : q ∈ attachmentIdeal Q rQ a) : + ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ ZFSet.pair q y ∈ ell := by + rw [pair_mem_attachmentTemplateEmbeddingGraph] + exact ⟨fun h => h.elim id (fun h => False.elim (attachmentIdeal_not_freshPart hq h.1)), Or.inl⟩ + +theorem attachmentTemplateEmbeddingGraph_of_fresh {P Q rQ ell a q y : ZFSet.{u}} + (function : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) + (hq : q ∈ freshPart Q rQ a) : + ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ y = ZFSet.pair P q := by + rw [pair_mem_attachmentTemplateEmbeddingGraph] + constructor + · intro h + rcases h with h | h + · exact False.elim (attachmentIdeal_not_freshPart (ZFSet.pair_mem_prod.1 (function.1 h)).1 hq) + · exact h.2 + · exact fun eq => Or.inr ⟨hq, eq⟩ + +theorem attachmentTemplateEmbeddingGraph_isFunc {P Q rQ ell a : ZFSet.{u}} + (function : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) : + ZFSet.IsFunc Q (taggedExtension P (freshPart Q rQ a)) + (attachmentTemplateEmbeddingGraph P Q rQ ell a) := by + classical + refine ⟨?_, ?_⟩ + · intro z hz + rcases (mem_attachmentTemplateEmbeddingGraph P Q rQ ell a z).1 hz with old | ⟨q, hq, rfl⟩ + · obtain ⟨q, hq, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 old) + exact ZFSet.pair_mem_prod.2 ⟨((mem_attachmentIdeal Q rQ a q).1 hq).1, old_mem_taggedExtension hy⟩ + · exact ZFSet.pair_mem_prod.2 + ⟨((mem_freshPart Q rQ a q).1 hq).1, pair_mem_taggedExtension.2 hq⟩ + · intro q hq + by_cases below : ZFSet.pair q a ∈ rQ + · have ideal := (mem_attachmentIdeal Q rQ a q).2 ⟨hq, below⟩ + obtain ⟨y, entry, unique⟩ := function.2 q ideal + exact ⟨y, attachmentTemplateEmbeddingGraph_of_ideal ideal |>.2 entry, + fun z hz => unique z ((attachmentTemplateEmbeddingGraph_of_ideal ideal).1 hz)⟩ + · have fresh := (mem_freshPart Q rQ a q).2 ⟨hq, below⟩ + exact ⟨ZFSet.pair P q, (attachmentTemplateEmbeddingGraph_of_fresh function fresh).2 rfl, + fun y hy => (attachmentTemplateEmbeddingGraph_of_fresh function fresh).1 hy⟩ + +theorem attachmentTemplateEmbeddingGraph_injection {P Q rQ ell a : ZFSet.{u}} + (embedding : InjectionCode (attachmentIdeal Q rQ a) P ell) : + InjectionCode Q (taggedExtension P (freshPart Q rQ a)) + (attachmentTemplateEmbeddingGraph P Q rQ ell a) := by + refine ⟨attachmentTemplateEmbeddingGraph_isFunc embedding.function, ?_⟩ + intro x y z hx hy + rcases (pair_mem_attachmentTemplateEmbeddingGraph P Q rQ ell a x z).1 hx with hx | hx + · rcases (pair_mem_attachmentTemplateEmbeddingGraph P Q rQ ell a y z).1 hy with hy | hy + · exact embedding.injective x y z hx hy + · exact False.elim (pair_tag_not_mem P y (hy.2 ▸ (ZFSet.pair_mem_prod.1 (embedding.function.1 hx)).2)) + · rcases (pair_mem_attachmentTemplateEmbeddingGraph P Q rQ ell a y z).1 hy with hy | hy + · exact False.elim (pair_tag_not_mem P x (hx.2 ▸ (ZFSet.pair_mem_prod.1 (embedding.function.1 hy)).2)) + · exact (ZFSet.pair_inj.1 (hx.2.symm.trans hy.2)).2 + + + + + + +namespace BoundedFormula + +open SetFormula + +def attachmentOldEmbeddingEntryFormula {n} (z p : Fin n) : BoundedFormula n := + exMem p (orderedPairFormula z.succ 0 0) + +def attachmentFreshEmbeddingEntryFormula {n} (z p d : Fin n) : BoundedFormula n := + exMem d (exMem z.succ (exMem 0 + (.conj (orderedPairFormula 0 p.succ.succ.succ 2) + (orderedPairFormula z.succ.succ.succ 2 0)))) + +theorem truth_attachmentOldEmbeddingEntryFormula {n} (z p : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (attachmentOldEmbeddingEntryFormula z p) env ↔ + ∃ x ∈ env p, env z = ZFSet.pair x x := by + simp only [attachmentOldEmbeddingEntryFormula, truth_exMem, truth_orderedPairFormula] + rfl + +theorem truth_attachmentFreshEmbeddingEntryFormula {n} (z p d : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (attachmentFreshEmbeddingEntryFormula z p d) env ↔ + ∃ q ∈ env d, env z = ZFSet.pair q (ZFSet.pair (env p) q) := by + simp only [attachmentFreshEmbeddingEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + change (∃ q ∈ env d, ∃ a ∈ env z, ∃ b ∈ a, + b = ZFSet.pair (env p) q ∧ env z = ZFSet.pair q b) ↔ _ + constructor + · rintro ⟨q, hq, _, _, b, _, rfl, eq⟩ + exact ⟨q, hq, eq⟩ + · rintro ⟨q, hq, eq⟩ + refine ⟨q, hq, {q, ZFSet.pair (env p) q}, ?_, ZFSet.pair (env p) q, + ZFSet.mem_pair.2 (Or.inr rfl), rfl, eq⟩ + rw [eq] + exact ZFSet.mem_pair.2 (Or.inr rfl) + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem attachmentOldEmbeddingGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P : ZFSet.{u}} (hP : P ∈ M.sets) : attachmentOldEmbeddingGraph P ∈ M.sets := by + let params := extend P Fin.elim0 + have selected := M.bounded_separation_mem separation + (BoundedFormula.attachmentOldEmbeddingEntryFormula 0 1) params + (Fin.cases hP (fun i => Fin.elim0 i)) + (M.prod_mem pairing unions powers separation hP hP) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.attachmentOldEmbeddingEntryFormula 0 1) (extend z params)) + (ZFSet.prod P P) = attachmentOldEmbeddingGraph P := by + apply ZFSet.ext + intro z + rw [attachmentOldEmbeddingGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_attachmentOldEmbeddingEntryFormula 0 1 _) + exact eq ▸ selected + +theorem attachmentFreshEmbeddingGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P N : ZFSet.{u}} (hP : P ∈ M.sets) (hN : N ∈ M.sets) : + attachmentFreshEmbeddingGraph P N ∈ M.sets := by + let params := extend P (extend N Fin.elim0) + have selected := M.bounded_separation_mem separation + (BoundedFormula.attachmentFreshEmbeddingEntryFormula 0 1 2) params + (Fin.cases hP (Fin.cases hN (fun i => Fin.elim0 i))) + (M.prod_mem pairing unions powers separation hN + (M.taggedExtension_mem pairing unions powers separation hP hN)) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.attachmentFreshEmbeddingEntryFormula 0 1 2) (extend z params)) + (ZFSet.prod N (taggedExtension P N)) = attachmentFreshEmbeddingGraph P N := by + apply ZFSet.ext + intro z + rw [attachmentFreshEmbeddingGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_attachmentFreshEmbeddingEntryFormula 0 1 2 _) + exact eq ▸ selected + +theorem attachmentTemplateEmbeddingGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P Q rQ ell a : ZFSet.{u}} (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) + (hrQ : rQ ∈ M.sets) (hell : ell ∈ M.sets) (ha : a ∈ M.sets) : + attachmentTemplateEmbeddingGraph P Q rQ ell a ∈ M.sets := + M.binary_union_mem pairing unions hell + (M.attachmentFreshEmbeddingGraph_mem pairing unions powers separation hP + (M.freshPart_mem separation hQ hrQ ha)) + +end TransitiveGround + + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchAttachment.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchAttachment.lean index 16351a7e88ede8d00ccf8d9ff1a65d902e23ef6c..2affa00bf237b81b03757296b3c90c352f386faf 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchAttachment.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchAttachment.lean @@ -1,282 +1,282 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BatchGraphSetFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.CodedTemplateShadowLaws - -namespace OAI - -namespace PartitionPilot.Forcing.CodedTemplateAttachment -universe u v w -variable {J : Type v} {P r μ N inside shadow upper : ZFSet.{u}} -variable {old : MeetOrderCode P r μ} {b : Attachment.Templates.{u+1,w,v} old.toMeetOrder J} -variable (d : CodedTemplateAttachment old b N inside shadow upper) - -theorem encoded_embedding_order_iff {A r μ graph : ZFSet.{u}} - (source : MeetOrderCode A r μ) - (embedding : MeetEmbedding source.toMeetOrder b.extension) - (function : ZFSet.IsFunc A d.carrier graph) - (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, - ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) - {x y x' y' : ZFSet.{u}} (hx : ZFSet.pair x x' ∈ graph) (hy : ZFSet.pair y y' ∈ graph) : - ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ r := by - have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 - have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 - obtain ⟨w, _, uniqueX⟩ := function.2 x hxA - obtain ⟨v, _, uniqueY⟩ := function.2 y hyA - have eqX := (uniqueX x' hx).trans (uniqueX _ (entries ⟨x, hxA⟩)).symm - have eqY := (uniqueY y' hy).trans (uniqueY _ (entries ⟨y, hyA⟩)).symm - rw [eqX, eqY, d.le_encode] - exact embedding.le_iff ⟨x, hxA⟩ ⟨y, hyA⟩ - -theorem encoded_embedding_code {A r μ graph : ZFSet.{u}} - (source : MeetOrderCode A r μ) - (embedding : MeetEmbedding source.toMeetOrder b.extension) - (function : ZFSet.IsFunc A d.carrier graph) - (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, - ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) : - MeetEmbeddingCode A d.carrier r d.order μ d.meetGraph graph := by - refine ⟨⟨function, ?_⟩, ?_, ?_⟩ - · intro x y z hx hy - have xA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 - have yA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 - have zL := (ZFSet.pair_mem_prod.1 (function.1 hx)).2 - have refl := d.partialOrder.refl z zL - exact source.order.antisymm x xA y yA - ((d.encoded_embedding_order_iff source embedding function entries hx hy).1 refl) - ((d.encoded_embedding_order_iff source embedding function entries hy hx).1 refl) - · intro x y x' y' lower hx hy - exact (d.encoded_embedding_order_iff source embedding function entries hx hy).2 lower - · intro x y z x' y' z' meet hx hy hz - have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 - have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 - have hzA := (ZFSet.pair_mem_prod.1 (function.1 hz)).1 - let X : {x : ZFSet.{u} // x ∈ A} := ⟨x, hxA⟩ - let Y : {y : ZFSet.{u} // y ∈ A} := ⟨y, hyA⟩ - let Z : {z : ZFSet.{u} // z ∈ A} := ⟨z, hzA⟩ - have image_eq (t : {t : ZFSet.{u} // t ∈ A}) (v : ZFSet.{u}) - (entry : ZFSet.pair t.val v ∈ graph) : v = d.encode (embedding.toFun t) := by - obtain ⟨w, _, unique⟩ := function.2 t.val t.property - exact (unique v entry).trans (unique _ (entries t)).symm - have meet_eq : source.toMeetOrder.meet X Y = Z := by - apply Subtype.ext - obtain ⟨w, _, unique⟩ := source.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.2 ⟨hxA, hyA⟩) - exact (unique _ (source.toMeetOrder_meet_entry X Y)).trans (unique z meet).symm - have mapped : embedding.toFun Z = - b.extension.meet (embedding.toFun X) (embedding.toFun Y) := by - rw [← meet_eq] - exact embedding.map_meet X Y - rw [image_eq X x' hx, image_eq Y y' hy, image_eq Z z' hz, mapped] - exact d.encoded_meet_entry (embedding.toFun X) (embedding.toFun Y) - -theorem old_embedding_code : - MeetEmbeddingCode P d.carrier r d.order μ d.meetGraph (attachmentOldEmbeddingGraph P) := by - apply d.encoded_embedding_code old b.oldEmbedding - (attachmentOldEmbeddingGraph_isFunc P N) - intro p - exact (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩ - -end PartitionPilot.Forcing.CodedTemplateAttachment - -namespace PartitionPilot.Forcing.AttachmentBatchInputs - -universe u -variable {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) -include d - -theorem batch_template_graph_entry (i : {i : ZFSet.{u} // i ∈ I}) - (q : {q : ZFSet.{u} // q ∈ d.space i}) : - ZFSet.pair q.val (d.coding.encode (d.templates.represent i q)) ∈ - batchTemplateGraph I P Qs rs As Es i.val := by - classical - apply (pair_mem_batchTemplateGraph I P Qs rs As Es i.val q.val _).2 - apply (d.batch_template_entry_iff i q.val _).2 - by_cases below : (d.fiber i).templateOrder.toMeetOrder.le q - ⟨d.anchor i, (d.fiber i).anchor_mem⟩ - · rw [d.templates.represent_old i q below] - exact Or.inl ((d.fiber i).baseMap_entry ⟨q, below⟩) - · rw [d.templates.represent_new i q below] - exact Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.property, below⟩, rfl⟩ - -theorem batch_template_graph_entry_iff (i : {i : ZFSet.{u} // i ∈ I}) - (q : {q : ZFSet.{u} // q ∈ d.space i}) (y : ZFSet.{u}) : - ZFSet.pair q.val y ∈ batchTemplateGraph I P Qs rs As Es i.val ↔ - y = d.coding.encode (d.templates.represent i q) := by - constructor - · intro entry - obtain ⟨v, _, unique⟩ := (d.batch_template_fiber_function i).2 q.val q.property - exact (unique y entry).trans (unique _ (d.batch_template_graph_entry i q)).symm - · intro equal - exact equal.symm ▸ d.batch_template_graph_entry i q - -theorem batch_template_embedding_code (i : {i : ZFSet.{u} // i ∈ I}) : - MeetEmbeddingCode (d.space i) d.batchCarrier (d.rel i) d.batchOrder - (d.meet i) d.batchMeetGraph (batchTemplateGraph I P Qs rs As Es i.val) := - d.coding.encoded_embedding_code (d.fiber i).templateOrder (d.templates.templateEmbedding i) - (d.batch_template_fiber_function i) (d.batch_template_graph_entry i) - -theorem batch_template_order_iff (i : {i : ZFSet.{u} // i ∈ I}) - {x y x' y' : ZFSet.{u}} - (hx : ZFSet.pair x x' ∈ batchTemplateGraph I P Qs rs As Es i.val) - (hy : ZFSet.pair y y' ∈ batchTemplateGraph I P Qs rs As Es i.val) : - ZFSet.pair x' y' ∈ d.batchOrder ↔ ZFSet.pair x y ∈ d.rel i := - d.coding.encoded_embedding_order_iff (d.fiber i).templateOrder (d.templates.templateEmbedding i) - (d.batch_template_fiber_function i) (d.batch_template_graph_entry i) hx hy - -theorem batch_template_old_agreement (i : {i : ZFSet.{u} // i ∈ I}) - {q p : ZFSet.{u}} (entry : ZFSet.pair q p ∈ d.embed i) : - ZFSet.pair q p ∈ batchTemplateGraph I P Qs rs As Es i.val ∧ - ZFSet.pair p p ∈ attachmentOldEmbeddingGraph P := by - have shape := ZFSet.pair_mem_prod.1 ((d.fiber i).base_function.1 entry) - exact ⟨(pair_mem_batchTemplateGraph I P Qs rs As Es i.val q p).2 - ((d.batch_template_entry_iff i q p).2 (Or.inl entry)), - (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨shape.2, rfl⟩⟩ - -end PartitionPilot.Forcing.AttachmentBatchInputs - -namespace PartitionPilot.Forcing.AttachmentBatchInputs -universe u -variable {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - -noncomputable def batchFreshNode (i : {i : ZFSet.{u} // i ∈ I}) {q : ZFSet.{u}} - (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) : d.templates.Fresh := - ⟨i, ⟨⟨q, ((mem_freshPart _ _ _ q).1 hq).1⟩, ((mem_freshPart _ _ _ q).1 hq).2⟩⟩ - -theorem batch_old_lower_iff (i : {i : ZFSet.{u} // i ∈ I}) {q s p : ZFSet.{u}} - (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) (hp : p ∈ P) - (hs : ZFSet.pair (ZFSet.pair i.val q) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) : - ZFSet.pair p (ZFSet.pair P (ZFSet.pair i.val q)) ∈ d.batchOrder ↔ ZFSet.pair p s ∈ rP := by - have eq := d.coding.shadow_value (d.batchFreshNode i hq) s hs - rw [eq] - exact d.coding.old_lower_iff ⟨p, hp⟩ (d.batchFreshNode i hq) - -theorem batch_old_upper_iff (i : {i : ZFSet.{u} // i ∈ I}) {q p : ZFSet.{u}} - (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) (hp : p ∈ P) : - ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) p ∈ d.batchOrder ↔ p ∈ d.filter i := - d.coding.old_upper_iff (d.batchFreshNode i hq) ⟨p, hp⟩ - -theorem batch_cross_lower_iff (i j : {i : ZFSet.{u} // i ∈ I}) {q t s : ZFSet.{u}} - (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) - (ht : t ∈ freshPart (d.space j) (d.rel j) (d.anchor j)) (different : i ≠ j) - (hs : ZFSet.pair (ZFSet.pair j.val t) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) : - ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) (ZFSet.pair P (ZFSet.pair j.val t)) ∈ - d.batchOrder ↔ s ∈ d.filter i := by - have eq := d.coding.shadow_value (d.batchFreshNode j ht) s hs - rw [eq] - exact d.coding.cross_lower_iff (d.batchFreshNode i hq) (d.batchFreshNode j ht) different - -theorem batch_shadow_meet_code (i : {i : ZFSet.{u} // i ∈ I}) {q p s v : ZFSet.{u}} - (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) (hp : p ∈ P) - (hs : ZFSet.pair (ZFSet.pair i.val q) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) - (oldMeet : ZFSet.pair (ZFSet.pair s p) v ∈ μP) - (notAbove : ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) p ∉ d.batchOrder) : - ZFSet.pair (ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) p) v ∈ d.batchMeetGraph := by - let x := d.batchFreshNode i hq - let y : {p : ZFSet.{u} // p ∈ P} := ⟨p, hp⟩ - have sameShadow := d.coding.shadow_value x s hs - obtain ⟨m, _, unique⟩ := d.oldOrder.operation.2 - (ZFSet.pair (d.templates.shadow x).val p) - (ZFSet.pair_mem_prod.2 ⟨(d.templates.shadow x).property, hp⟩) - have sameMeet : v = (d.oldOrder.toMeetOrder.meet (d.templates.shadow x) y).val := - (unique v (sameShadow ▸ oldMeet)).trans - (unique _ (d.oldOrder.toMeetOrder_meet_entry (d.templates.shadow x) y)).symm - exact sameMeet.symm ▸ d.coding.encoded_shadow_meet x y notAbove - -theorem batch_cross_meet_code (i j : {i : ZFSet.{u} // i ∈ I}) {q t s z v : ZFSet.{u}} - (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) - (ht : t ∈ freshPart (d.space j) (d.rel j) (d.anchor j)) (different : i ≠ j) - (hs : ZFSet.pair (ZFSet.pair i.val q) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) - (hz : ZFSet.pair (ZFSet.pair j.val t) z ∈ batchAttachmentShadowGraph I P Qs μs As Es) - (oldMeet : ZFSet.pair (ZFSet.pair s z) v ∈ μP) - (notQT : ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) - (ZFSet.pair P (ZFSet.pair j.val t)) ∉ d.batchOrder) - (notTQ : ZFSet.pair (ZFSet.pair P (ZFSet.pair j.val t)) - (ZFSet.pair P (ZFSet.pair i.val q)) ∉ d.batchOrder) : - ZFSet.pair (ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) - (ZFSet.pair P (ZFSet.pair j.val t))) v ∈ d.batchMeetGraph := by - let x := d.batchFreshNode i hq - let y := d.batchFreshNode j ht - have sameS := d.coding.shadow_value x s hs - have sameZ := d.coding.shadow_value y z hz - obtain ⟨m, _, unique⟩ := d.oldOrder.operation.2 - (ZFSet.pair (d.templates.shadow x).val (d.templates.shadow y).val) - (ZFSet.pair_mem_prod.2 ⟨(d.templates.shadow x).property, (d.templates.shadow y).property⟩) - have sameMeet : v = (d.oldOrder.toMeetOrder.meet (d.templates.shadow x) (d.templates.shadow y)).val := - (unique v (sameS ▸ sameZ ▸ oldMeet)).trans - (unique _ (d.oldOrder.toMeetOrder_meet_entry (d.templates.shadow x) (d.templates.shadow y))).symm - exact sameMeet.symm ▸ d.coding.encoded_cross_meet x y different notQT notTQ - -end PartitionPilot.Forcing.AttachmentBatchInputs - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem batchAttachment_ground_codes - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (hP : P ∈ M.sets) (hrP : rP ∈ M.sets) (hI : I ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) : - d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ - batchAttachmentShadowGraph I P Qs μs As Es ∈ M.sets ∧ - batchAttachmentTemplateGraph I P Qs rs As Es ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets := by - have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs - have hL := M.taggedExtension_mem pairing unions powers separation hP hN - have inside := M.batchAttachmentInsideGraph_mem pairing unions powers separation hI hQs hrs - have shadow := M.batchAttachmentShadowGraph_mem pairing unions powers separation hI hP hQs hμs hAs hEs - have upper := M.batchAttachmentUpperGraph_mem pairing unions powers separation hI hP hQs hFs - have order := M.codedAttachmentOrder_mem pairing unions powers separation hP hN hrP inside shadow upper - exact ⟨hL, order, M.canonicalMeetGraph_mem pairing unions powers separation hL order, - shadow, M.batchAttachmentTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs, - M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP⟩ - -theorem exists_batchAttachment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (hP : P ∈ M.sets) (hrP : rP ∈ M.sets) (hI : I ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) - (_hSs : Ss ∈ M.sets) : - ∃ L ∈ M.sets, ∃ r ∈ M.sets, ∃ μ ∈ M.sets, ∃ shadow ∈ M.sets, - ∃ representation ∈ M.sets, ∃ oldMap ∈ M.sets, - L = taggedExtension P (indexedAttachmentFresh I Qs rs As) ∧ - r = codedAttachmentOrder P (indexedAttachmentFresh I Qs rs As) rP - (batchAttachmentInsideGraph I Qs rs) shadow (batchAttachmentUpperGraph I P Qs Fs) ∧ - μ = canonicalMeetGraph L r ∧ - shadow = batchAttachmentShadowGraph I P Qs μs As Es ∧ - representation = batchAttachmentTemplateGraph I P Qs rs As Es ∧ - oldMap = attachmentOldEmbeddingGraph P ∧ - MeetOrderCode L r μ ∧ - ZFSet.IsFunc (indexedAttachmentDomain I Qs) P shadow ∧ - ZFSet.IsFunc (indexedAttachmentDomain I Qs) L representation ∧ - MeetEmbeddingCode P L rP r μP μ oldMap ∧ - (∀ p ∈ P, ZFSet.pair p p ∈ oldMap) ∧ - (∀ i : {i : ZFSet.{u} // i ∈ I}, - batchTemplateGraph I P Qs rs As Es i.val ∈ M.sets ∧ - MeetEmbeddingCode (d.space i) L (d.rel i) r (d.meet i) μ - (batchTemplateGraph I P Qs rs As Es i.val)) := by - obtain ⟨hL, hr, hμ, hs, ht, ho⟩ := M.batchAttachment_ground_codes - pairing unions powers separation d hP hrP hI hQs hrs hμs hAs hEs hFs - refine ⟨d.batchCarrier, hL, d.batchOrder, hr, d.batchMeetGraph, hμ, - batchAttachmentShadowGraph I P Qs μs As Es, hs, - batchAttachmentTemplateGraph I P Qs rs As Es, ht, - attachmentOldEmbeddingGraph P, ho, rfl, rfl, rfl, rfl, rfl, rfl, - d.batch_meetOrder, d.batch_shadow_function, d.batch_template_function, - d.coding.old_embedding_code, - (fun p hp => (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨hp, rfl⟩), ?_⟩ - intro i - exact ⟨M.batchTemplateGraph_mem pairing unions powers separation - hI hP hQs hrs hAs hEs (M.transitive hI i.property), d.batch_template_embedding_code i⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BatchGraphSetFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.CodedTemplateShadowLaws + +namespace OAI + +namespace PartitionPilot.Forcing.CodedTemplateAttachment +universe u v w +variable {J : Type v} {P r μ N inside shadow upper : ZFSet.{u}} +variable {old : MeetOrderCode P r μ} {b : Attachment.Templates.{u+1,w,v} old.toMeetOrder J} +variable (d : CodedTemplateAttachment old b N inside shadow upper) + +theorem encoded_embedding_order_iff {A r μ graph : ZFSet.{u}} + (source : MeetOrderCode A r μ) + (embedding : MeetEmbedding source.toMeetOrder b.extension) + (function : ZFSet.IsFunc A d.carrier graph) + (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, + ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) + {x y x' y' : ZFSet.{u}} (hx : ZFSet.pair x x' ∈ graph) (hy : ZFSet.pair y y' ∈ graph) : + ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ r := by + have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 + have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 + obtain ⟨w, _, uniqueX⟩ := function.2 x hxA + obtain ⟨v, _, uniqueY⟩ := function.2 y hyA + have eqX := (uniqueX x' hx).trans (uniqueX _ (entries ⟨x, hxA⟩)).symm + have eqY := (uniqueY y' hy).trans (uniqueY _ (entries ⟨y, hyA⟩)).symm + rw [eqX, eqY, d.le_encode] + exact embedding.le_iff ⟨x, hxA⟩ ⟨y, hyA⟩ + +theorem encoded_embedding_code {A r μ graph : ZFSet.{u}} + (source : MeetOrderCode A r μ) + (embedding : MeetEmbedding source.toMeetOrder b.extension) + (function : ZFSet.IsFunc A d.carrier graph) + (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, + ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) : + MeetEmbeddingCode A d.carrier r d.order μ d.meetGraph graph := by + refine ⟨⟨function, ?_⟩, ?_, ?_⟩ + · intro x y z hx hy + have xA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 + have yA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 + have zL := (ZFSet.pair_mem_prod.1 (function.1 hx)).2 + have refl := d.partialOrder.refl z zL + exact source.order.antisymm x xA y yA + ((d.encoded_embedding_order_iff source embedding function entries hx hy).1 refl) + ((d.encoded_embedding_order_iff source embedding function entries hy hx).1 refl) + · intro x y x' y' lower hx hy + exact (d.encoded_embedding_order_iff source embedding function entries hx hy).2 lower + · intro x y z x' y' z' meet hx hy hz + have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 + have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 + have hzA := (ZFSet.pair_mem_prod.1 (function.1 hz)).1 + let X : {x : ZFSet.{u} // x ∈ A} := ⟨x, hxA⟩ + let Y : {y : ZFSet.{u} // y ∈ A} := ⟨y, hyA⟩ + let Z : {z : ZFSet.{u} // z ∈ A} := ⟨z, hzA⟩ + have image_eq (t : {t : ZFSet.{u} // t ∈ A}) (v : ZFSet.{u}) + (entry : ZFSet.pair t.val v ∈ graph) : v = d.encode (embedding.toFun t) := by + obtain ⟨w, _, unique⟩ := function.2 t.val t.property + exact (unique v entry).trans (unique _ (entries t)).symm + have meet_eq : source.toMeetOrder.meet X Y = Z := by + apply Subtype.ext + obtain ⟨w, _, unique⟩ := source.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.2 ⟨hxA, hyA⟩) + exact (unique _ (source.toMeetOrder_meet_entry X Y)).trans (unique z meet).symm + have mapped : embedding.toFun Z = + b.extension.meet (embedding.toFun X) (embedding.toFun Y) := by + rw [← meet_eq] + exact embedding.map_meet X Y + rw [image_eq X x' hx, image_eq Y y' hy, image_eq Z z' hz, mapped] + exact d.encoded_meet_entry (embedding.toFun X) (embedding.toFun Y) + +theorem old_embedding_code : + MeetEmbeddingCode P d.carrier r d.order μ d.meetGraph (attachmentOldEmbeddingGraph P) := by + apply d.encoded_embedding_code old b.oldEmbedding + (attachmentOldEmbeddingGraph_isFunc P N) + intro p + exact (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩ + +end PartitionPilot.Forcing.CodedTemplateAttachment + +namespace PartitionPilot.Forcing.AttachmentBatchInputs + +universe u +variable {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) +include d + +theorem batch_template_graph_entry (i : {i : ZFSet.{u} // i ∈ I}) + (q : {q : ZFSet.{u} // q ∈ d.space i}) : + ZFSet.pair q.val (d.coding.encode (d.templates.represent i q)) ∈ + batchTemplateGraph I P Qs rs As Es i.val := by + classical + apply (pair_mem_batchTemplateGraph I P Qs rs As Es i.val q.val _).2 + apply (d.batch_template_entry_iff i q.val _).2 + by_cases below : (d.fiber i).templateOrder.toMeetOrder.le q + ⟨d.anchor i, (d.fiber i).anchor_mem⟩ + · rw [d.templates.represent_old i q below] + exact Or.inl ((d.fiber i).baseMap_entry ⟨q, below⟩) + · rw [d.templates.represent_new i q below] + exact Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.property, below⟩, rfl⟩ + +theorem batch_template_graph_entry_iff (i : {i : ZFSet.{u} // i ∈ I}) + (q : {q : ZFSet.{u} // q ∈ d.space i}) (y : ZFSet.{u}) : + ZFSet.pair q.val y ∈ batchTemplateGraph I P Qs rs As Es i.val ↔ + y = d.coding.encode (d.templates.represent i q) := by + constructor + · intro entry + obtain ⟨v, _, unique⟩ := (d.batch_template_fiber_function i).2 q.val q.property + exact (unique y entry).trans (unique _ (d.batch_template_graph_entry i q)).symm + · intro equal + exact equal.symm ▸ d.batch_template_graph_entry i q + +theorem batch_template_embedding_code (i : {i : ZFSet.{u} // i ∈ I}) : + MeetEmbeddingCode (d.space i) d.batchCarrier (d.rel i) d.batchOrder + (d.meet i) d.batchMeetGraph (batchTemplateGraph I P Qs rs As Es i.val) := + d.coding.encoded_embedding_code (d.fiber i).templateOrder (d.templates.templateEmbedding i) + (d.batch_template_fiber_function i) (d.batch_template_graph_entry i) + +theorem batch_template_order_iff (i : {i : ZFSet.{u} // i ∈ I}) + {x y x' y' : ZFSet.{u}} + (hx : ZFSet.pair x x' ∈ batchTemplateGraph I P Qs rs As Es i.val) + (hy : ZFSet.pair y y' ∈ batchTemplateGraph I P Qs rs As Es i.val) : + ZFSet.pair x' y' ∈ d.batchOrder ↔ ZFSet.pair x y ∈ d.rel i := + d.coding.encoded_embedding_order_iff (d.fiber i).templateOrder (d.templates.templateEmbedding i) + (d.batch_template_fiber_function i) (d.batch_template_graph_entry i) hx hy + +theorem batch_template_old_agreement (i : {i : ZFSet.{u} // i ∈ I}) + {q p : ZFSet.{u}} (entry : ZFSet.pair q p ∈ d.embed i) : + ZFSet.pair q p ∈ batchTemplateGraph I P Qs rs As Es i.val ∧ + ZFSet.pair p p ∈ attachmentOldEmbeddingGraph P := by + have shape := ZFSet.pair_mem_prod.1 ((d.fiber i).base_function.1 entry) + exact ⟨(pair_mem_batchTemplateGraph I P Qs rs As Es i.val q p).2 + ((d.batch_template_entry_iff i q p).2 (Or.inl entry)), + (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨shape.2, rfl⟩⟩ + +end PartitionPilot.Forcing.AttachmentBatchInputs + +namespace PartitionPilot.Forcing.AttachmentBatchInputs +universe u +variable {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + +noncomputable def batchFreshNode (i : {i : ZFSet.{u} // i ∈ I}) {q : ZFSet.{u}} + (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) : d.templates.Fresh := + ⟨i, ⟨⟨q, ((mem_freshPart _ _ _ q).1 hq).1⟩, ((mem_freshPart _ _ _ q).1 hq).2⟩⟩ + +theorem batch_old_lower_iff (i : {i : ZFSet.{u} // i ∈ I}) {q s p : ZFSet.{u}} + (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) (hp : p ∈ P) + (hs : ZFSet.pair (ZFSet.pair i.val q) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) : + ZFSet.pair p (ZFSet.pair P (ZFSet.pair i.val q)) ∈ d.batchOrder ↔ ZFSet.pair p s ∈ rP := by + have eq := d.coding.shadow_value (d.batchFreshNode i hq) s hs + rw [eq] + exact d.coding.old_lower_iff ⟨p, hp⟩ (d.batchFreshNode i hq) + +theorem batch_old_upper_iff (i : {i : ZFSet.{u} // i ∈ I}) {q p : ZFSet.{u}} + (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) (hp : p ∈ P) : + ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) p ∈ d.batchOrder ↔ p ∈ d.filter i := + d.coding.old_upper_iff (d.batchFreshNode i hq) ⟨p, hp⟩ + +theorem batch_cross_lower_iff (i j : {i : ZFSet.{u} // i ∈ I}) {q t s : ZFSet.{u}} + (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) + (ht : t ∈ freshPart (d.space j) (d.rel j) (d.anchor j)) (different : i ≠ j) + (hs : ZFSet.pair (ZFSet.pair j.val t) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) : + ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) (ZFSet.pair P (ZFSet.pair j.val t)) ∈ + d.batchOrder ↔ s ∈ d.filter i := by + have eq := d.coding.shadow_value (d.batchFreshNode j ht) s hs + rw [eq] + exact d.coding.cross_lower_iff (d.batchFreshNode i hq) (d.batchFreshNode j ht) different + +theorem batch_shadow_meet_code (i : {i : ZFSet.{u} // i ∈ I}) {q p s v : ZFSet.{u}} + (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) (hp : p ∈ P) + (hs : ZFSet.pair (ZFSet.pair i.val q) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) + (oldMeet : ZFSet.pair (ZFSet.pair s p) v ∈ μP) + (notAbove : ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) p ∉ d.batchOrder) : + ZFSet.pair (ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) p) v ∈ d.batchMeetGraph := by + let x := d.batchFreshNode i hq + let y : {p : ZFSet.{u} // p ∈ P} := ⟨p, hp⟩ + have sameShadow := d.coding.shadow_value x s hs + obtain ⟨m, _, unique⟩ := d.oldOrder.operation.2 + (ZFSet.pair (d.templates.shadow x).val p) + (ZFSet.pair_mem_prod.2 ⟨(d.templates.shadow x).property, hp⟩) + have sameMeet : v = (d.oldOrder.toMeetOrder.meet (d.templates.shadow x) y).val := + (unique v (sameShadow ▸ oldMeet)).trans + (unique _ (d.oldOrder.toMeetOrder_meet_entry (d.templates.shadow x) y)).symm + exact sameMeet.symm ▸ d.coding.encoded_shadow_meet x y notAbove + +theorem batch_cross_meet_code (i j : {i : ZFSet.{u} // i ∈ I}) {q t s z v : ZFSet.{u}} + (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) + (ht : t ∈ freshPart (d.space j) (d.rel j) (d.anchor j)) (different : i ≠ j) + (hs : ZFSet.pair (ZFSet.pair i.val q) s ∈ batchAttachmentShadowGraph I P Qs μs As Es) + (hz : ZFSet.pair (ZFSet.pair j.val t) z ∈ batchAttachmentShadowGraph I P Qs μs As Es) + (oldMeet : ZFSet.pair (ZFSet.pair s z) v ∈ μP) + (notQT : ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) + (ZFSet.pair P (ZFSet.pair j.val t)) ∉ d.batchOrder) + (notTQ : ZFSet.pair (ZFSet.pair P (ZFSet.pair j.val t)) + (ZFSet.pair P (ZFSet.pair i.val q)) ∉ d.batchOrder) : + ZFSet.pair (ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) + (ZFSet.pair P (ZFSet.pair j.val t))) v ∈ d.batchMeetGraph := by + let x := d.batchFreshNode i hq + let y := d.batchFreshNode j ht + have sameS := d.coding.shadow_value x s hs + have sameZ := d.coding.shadow_value y z hz + obtain ⟨m, _, unique⟩ := d.oldOrder.operation.2 + (ZFSet.pair (d.templates.shadow x).val (d.templates.shadow y).val) + (ZFSet.pair_mem_prod.2 ⟨(d.templates.shadow x).property, (d.templates.shadow y).property⟩) + have sameMeet : v = (d.oldOrder.toMeetOrder.meet (d.templates.shadow x) (d.templates.shadow y)).val := + (unique v (sameS ▸ sameZ ▸ oldMeet)).trans + (unique _ (d.oldOrder.toMeetOrder_meet_entry (d.templates.shadow x) (d.templates.shadow y))).symm + exact sameMeet.symm ▸ d.coding.encoded_cross_meet x y different notQT notTQ + +end PartitionPilot.Forcing.AttachmentBatchInputs + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem batchAttachment_ground_codes + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (hP : P ∈ M.sets) (hrP : rP ∈ M.sets) (hI : I ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) : + d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ + batchAttachmentShadowGraph I P Qs μs As Es ∈ M.sets ∧ + batchAttachmentTemplateGraph I P Qs rs As Es ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets := by + have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs + have hL := M.taggedExtension_mem pairing unions powers separation hP hN + have inside := M.batchAttachmentInsideGraph_mem pairing unions powers separation hI hQs hrs + have shadow := M.batchAttachmentShadowGraph_mem pairing unions powers separation hI hP hQs hμs hAs hEs + have upper := M.batchAttachmentUpperGraph_mem pairing unions powers separation hI hP hQs hFs + have order := M.codedAttachmentOrder_mem pairing unions powers separation hP hN hrP inside shadow upper + exact ⟨hL, order, M.canonicalMeetGraph_mem pairing unions powers separation hL order, + shadow, M.batchAttachmentTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs, + M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP⟩ + +theorem exists_batchAttachment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (hP : P ∈ M.sets) (hrP : rP ∈ M.sets) (hI : I ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) + (_hSs : Ss ∈ M.sets) : + ∃ L ∈ M.sets, ∃ r ∈ M.sets, ∃ μ ∈ M.sets, ∃ shadow ∈ M.sets, + ∃ representation ∈ M.sets, ∃ oldMap ∈ M.sets, + L = taggedExtension P (indexedAttachmentFresh I Qs rs As) ∧ + r = codedAttachmentOrder P (indexedAttachmentFresh I Qs rs As) rP + (batchAttachmentInsideGraph I Qs rs) shadow (batchAttachmentUpperGraph I P Qs Fs) ∧ + μ = canonicalMeetGraph L r ∧ + shadow = batchAttachmentShadowGraph I P Qs μs As Es ∧ + representation = batchAttachmentTemplateGraph I P Qs rs As Es ∧ + oldMap = attachmentOldEmbeddingGraph P ∧ + MeetOrderCode L r μ ∧ + ZFSet.IsFunc (indexedAttachmentDomain I Qs) P shadow ∧ + ZFSet.IsFunc (indexedAttachmentDomain I Qs) L representation ∧ + MeetEmbeddingCode P L rP r μP μ oldMap ∧ + (∀ p ∈ P, ZFSet.pair p p ∈ oldMap) ∧ + (∀ i : {i : ZFSet.{u} // i ∈ I}, + batchTemplateGraph I P Qs rs As Es i.val ∈ M.sets ∧ + MeetEmbeddingCode (d.space i) L (d.rel i) r (d.meet i) μ + (batchTemplateGraph I P Qs rs As Es i.val)) := by + obtain ⟨hL, hr, hμ, hs, ht, ho⟩ := M.batchAttachment_ground_codes + pairing unions powers separation d hP hrP hI hQs hrs hμs hAs hEs hFs + refine ⟨d.batchCarrier, hL, d.batchOrder, hr, d.batchMeetGraph, hμ, + batchAttachmentShadowGraph I P Qs μs As Es, hs, + batchAttachmentTemplateGraph I P Qs rs As Es, ht, + attachmentOldEmbeddingGraph P, ho, rfl, rfl, rfl, rfl, rfl, rfl, + d.batch_meetOrder, d.batch_shadow_function, d.batch_template_function, + d.coding.old_embedding_code, + (fun p hp => (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨hp, rfl⟩), ?_⟩ + intro i + exact ⟨M.batchTemplateGraph_mem pairing unions powers separation + hI hP hQs hrs hAs hEs (M.transitive hI i.property), d.batch_template_embedding_code i⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchEmbeddingRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchEmbeddingRecognition.lean index c3669e290e28334c0e9adc971aeed68a5da3246b..220a4ce490291f9651ce0c08d1a2261cde34ea1d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchEmbeddingRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchEmbeddingRecognition.lean @@ -1,492 +1,492 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedCompressionFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.RecursivePrimitiveFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchAttachment - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundDefinableFunction -open SetFormula -universe u - -def withAux {M : TransitiveGround.{u}} {n} - {a f : (Fin n → ZFSet.{u}) → ZFSet.{u}} - (aux : GroundDefinableFunction M a) (body : SetFormula (n + 2)) - (closed : ∀ env, (∀ i, env i ∈ M.sets) → f env ∈ M.sets) - (correct : ∀ env, (∀ i, env i ∈ M.sets) → ∀ z ∈ M.sets, - Realize M.sets body (extend (a env) (extend z env)) ↔ z = f env) : - GroundDefinableFunction M f where - formula := ex (.conj - (SetFormula.reindex (extend 0 (fun i => i.succ.succ)) aux.formula) body) - closed := closed - correct := by - intro env members z hz - simp only [realize_ex, Realize] - constructor - · rintro ⟨value, hvalue, specified, result⟩ - have equal : value = a env := by - apply (aux.correct env members value hvalue).1 - have meaning := (realize_reindex M.sets _ aux.formula _).1 specified - rw [map_extend] at meaning - exact meaning - subst value - exact (correct env members z hz).1 result - · intro equal - refine ⟨a env, aux.closed env members, ?_, (correct env members z hz).2 equal⟩ - rw [realize_reindex, map_extend] - exact (aux.correct env members (a env) (aux.closed env members)).2 rfl - -def withAuxFamily {M : TransitiveGround.{u}} {n k} - {a : Fin k → (Fin n → ZFSet.{u}) → ZFSet.{u}} - {f : (Fin n → ZFSet.{u}) → ZFSet.{u}} - (aux : ∀ j, GroundDefinableFunction M (a j)) (body : SetFormula (n + 1 + k)) - (closed : ∀ env, (∀ i, env i ∈ M.sets) → f env ∈ M.sets) - (correct : ∀ env, (∀ i, env i ∈ M.sets) → ∀ z ∈ M.sets, - Realize M.sets body (extendMany k (fun j => a j env) (extend z env)) ↔ z = f env) : - GroundDefinableFunction M f where - formula := exBlock k (.conj - (conjBlock k (fun j => SetFormula.reindex - (extend (prefixIndex (n + 1) k j) (fun i => suffixIndex (n + 1) k i.succ)) (aux j).formula)) body) - closed := closed - correct := by - intro env members z hz - rw [realize_exBlock] - constructor - · rintro ⟨fields, fieldMembers, clauses, result⟩ - have each := (realize_conjBlock M.sets _ _ _).1 clauses - have values : fields = fun j => a j env := by - funext j - have meaning := (realize_reindex M.sets _ _ _).1 (each j) - rw [map_extend] at meaning - simp only [extendMany_prefix, extendMany_suffix] at meaning - exact ((aux j).correct env members (fields j) (fieldMembers j)).1 meaning - exact (correct env members z hz).1 (values ▸ result) - · intro equal - let fields : Fin k → ZFSet.{u} := fun j => a j env - have fieldMembers : ∀ j, fields j ∈ M.sets := fun j => (aux j).closed env members - refine ⟨fields, fieldMembers, ?_, (correct env members z hz).2 equal⟩ - apply (realize_conjBlock M.sets _ _ _).2 - intro j - rw [realize_reindex, map_extend] - simp only [extendMany_prefix, extendMany_suffix] - exact ((aux j).correct env members (fields j) (fieldMembers j)).2 rfl - -end GroundDefinableFunction - -section -open SetFormula -universe u - -namespace SetFormula - -def indexedDomainSetFormula {n} (output i qs qb : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.indexedAttachmentDomainEntryFormula 0 i.succ qs.succ qb.succ).toFormula - -def batchTemplateSetFormula {n} (output domain carrier p i points es eb fresh : Fin n) : SetFormula n := - exactSetFormula output (reindex - (Fin.cases 0 (Fin.cases domain.succ (Fin.cases carrier.succ (Fin.cases p.succ - (Fin.cases i.succ (Fin.cases points.succ (Fin.cases es.succ - (Fin.cases eb.succ (Fin.cases fresh.succ Fin.elim0))))))))) - BoundedFormula.batchTemplateGraphFormula.toFormula) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_indexedDomainSetFormula {n} (output i qs qb : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) - (bound : env qb = ZFSet.sUnion (ZFSet.sUnion (env qs))) : - Realize M.sets (indexedDomainSetFormula output i qs qb) env ↔ - env output = indexedAttachmentDomain (env i) (env qs) := by - apply M.realize_exactBoundedSetFormula output _ env members - (M.indexedAttachmentDomain_mem pairing unions powers separation (members i) (members qs)) - intro z - rw [BoundedFormula.truth_indexedAttachmentDomainEntryFormula] - change (∃ j ∈ env i, ∃ Q ∈ env qb, ∃ q ∈ Q, - ZFSet.pair j Q ∈ env qs ∧ z = ZFSet.pair j q) ↔ _ - rw [bound, indexedAttachmentDomain, ZFSet.mem_sep] - constructor - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨j, hj, Q, _, q, hq, entry, equal⟩ := witness - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hj, mem_familyPointBound_of_entry entry hq⟩ - · exact And.right - -theorem realize_batchTemplateSetFormula {n} - (output domain carrier p i qs rs anchors es points eb fresh : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) - (domain_eq : env domain = indexedAttachmentDomain (env i) (env qs)) - (fresh_eq : env fresh = indexedAttachmentFresh (env i) (env qs) (env rs) (env anchors)) - (carrier_eq : env carrier = taggedExtension (env p) (env fresh)) - (points_eq : env points = familyPointBound (env qs)) - (base_bound : env eb = ZFSet.sUnion (ZFSet.sUnion (env es))) : - Realize M.sets (batchTemplateSetFormula output domain carrier p i points es eb fresh) env ↔ - env output = batchAttachmentTemplateGraph (env i) (env p) (env qs) (env rs) (env anchors) (env es) := by - apply M.realize_exactReindexedBoundedSetFormula output _ _ env members - (M.batchAttachmentTemplateGraph_mem pairing unions powers separation - (members i) (members p) (members qs) (members rs) (members anchors) (members es)) - intro z - rw [BoundedFormula.truth_batchTemplateGraphFormula] - change (∃ x ∈ env domain, ∃ y ∈ env carrier, z = ZFSet.pair x y ∧ - ((∃ j ∈ env i, ∃ q ∈ env points, x = ZFSet.pair j q ∧ - ∃ ell ∈ env eb, ZFSet.pair j ell ∈ env es ∧ ZFSet.pair q y ∈ ell) ∨ - (x ∈ env fresh ∧ y = ZFSet.pair (env p) x))) ↔ _ - rw [domain_eq, carrier_eq, points_eq, base_bound, fresh_eq] - dsimp only [batchAttachmentTemplateGraph] - rw [ZFSet.mem_sep] - constructor - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨x, hx, y, hy, equal, _⟩ := witness - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ - · exact And.right - -end TransitiveGround -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def definable_sUnion (unions : Realize M.sets SetFormula.union Fin.elim0) : - GroundDefinableFunction M (fun env : Fin 1 → ZFSet.{u} => ZFSet.sUnion (env 0)) where - formula := sUnionSetFormula 0 1 - closed := fun _env members => M.union_mem unions (members 0) - correct := fun env members z hz => - M.realize_sUnionSetFormula unions 0 1 (extend z env) (Fin.cases hz members) - -noncomputable def definable_doubleUnion (unions : Realize M.sets SetFormula.union Fin.elim0) : - GroundDefinableFunction M (fun env : Fin 1 → ZFSet.{u} => ZFSet.sUnion (ZFSet.sUnion (env 0))) := - (M.definable_sUnion unions).comp (fun _ => M.definable_sUnion unions) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -noncomputable def definable_taggedExtension : GroundDefinableFunction M - (fun env : Fin 2 → ZFSet.{u} => taggedExtension (env 0) (env 1)) where - formula := taggedExtensionSetFormula 0 1 2 - closed := fun _env members => M.taggedExtension_mem pairing unions powers separation (members 0) (members 1) - correct := fun env members z hz => M.realize_taggedExtensionSetFormula pairing unions powers separation - 0 1 2 (extend z env) (Fin.cases hz members) - -noncomputable def definable_canonicalMeet : GroundDefinableFunction M - (fun env : Fin 2 → ZFSet.{u} => canonicalMeetGraph (env 0) (env 1)) where - formula := canonicalMeetSetFormula 0 1 2 - closed := fun _env members => M.canonicalMeetGraph_mem pairing unions powers separation (members 0) (members 1) - correct := fun env members z hz => M.realize_canonicalMeetSetFormula pairing unions powers separation - 0 1 2 (extend z env) (Fin.cases hz members) - -noncomputable def definable_recursiveIndices : GroundDefinableFunction M - (fun env : Fin 6 → ZFSet.{u} => recursiveAttachmentIndices - (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) where - formula := recursiveIndicesSetFormula 0 1 2 3 4 5 6 - closed := fun _env members => M.recursiveAttachmentIndices_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) - correct := fun env members z hz => M.realize_recursiveIndicesSetFormula pairing unions powers separation - 0 1 2 3 4 5 6 (extend z env) (Fin.cases hz members) - -noncomputable def definable_codedAttachmentOrder : GroundDefinableFunction M - (fun env : Fin 6 → ZFSet.{u} => codedAttachmentOrder - (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by - let aux := (M.definable_taggedExtension pairing unions powers separation).reindex - (Fin.cases (0 : Fin 6) (Fin.cases 1 Fin.elim0)) - refine aux.withAux (codedAttachmentOrderSetFormula 1 0 2 3 4 5 6 7) ?_ ?_ - · intro env members - exact M.codedAttachmentOrder_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) - · intro env members z hz - exact M.realize_codedAttachmentOrderSetFormula pairing unions powers separation 1 0 2 3 4 5 6 7 - _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl - -noncomputable def definable_pairSecondField : GroundDefinableFunction M - (fun env : Fin 4 → ZFSet.{u} => pairSecondField (env 0) (env 1) (env 2) (env 3)) := by - let aux := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (3 : Fin 4)) - refine aux.withAux (pairFieldSetFormula false 1 2 3 4 0 5) ?_ ?_ - · intro env members - exact M.pairFieldGraph_mem pairing unions powers separation false - (members 0) (members 1) (members 2) (aux.closed env members) (members 3) - · intro env members z hz - exact M.realize_pairSecondFieldSetFormula pairing unions powers separation 1 2 3 4 0 5 - _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl - -noncomputable def definable_indexedFresh : GroundDefinableFunction M - (fun env : Fin 4 → ZFSet.{u} => indexedAttachmentFresh (env 0) (env 1) (env 2) (env 3)) := by - let aux := fun j : Fin 3 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => j.succ) - refine GroundDefinableFunction.withAuxFamily aux (indexedFreshSetFormula 3 4 5 6 7 0 1 2) ?_ ?_ - · intro env members - exact M.indexedAttachmentFresh_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) - · intro env members z hz - exact M.realize_indexedFreshSetFormula pairing unions powers separation 3 4 5 6 7 0 1 2 _ - (extendMany_members 3 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl rfl - -noncomputable def definable_batchInside : GroundDefinableFunction M - (fun env : Fin 3 → ZFSet.{u} => batchAttachmentInsideGraph (env 0) (env 1) (env 2)) := by - let aux := fun j : Fin 2 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => j.succ) - refine GroundDefinableFunction.withAuxFamily aux (batchInsideSetFormula 2 3 4 5 0 1) ?_ ?_ - · intro env members - exact M.batchAttachmentInsideGraph_mem pairing unions powers separation (members 0) (members 1) (members 2) - · intro env members z hz - exact M.realize_batchInsideSetFormula pairing unions powers separation 2 3 4 5 0 1 _ - (extendMany_members 2 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl - -noncomputable def definable_batchUpper : GroundDefinableFunction M - (fun env : Fin 4 → ZFSet.{u} => batchAttachmentUpperGraph (env 0) (env 1) (env 2) (env 3)) := by - let slots : Fin 2 → Fin 4 := Fin.cases 2 (Fin.cases 3 Fin.elim0) - let aux := fun j : Fin 2 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => slots j) - refine GroundDefinableFunction.withAuxFamily aux (batchUpperSetFormula 2 3 4 5 6 0 1) ?_ ?_ - · intro env members - exact M.batchAttachmentUpperGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) - · intro env members z hz - exact M.realize_batchUpperSetFormula pairing unions powers separation 2 3 4 5 6 0 1 _ - (extendMany_members 2 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl - -noncomputable def definable_batchShadow : GroundDefinableFunction M - (fun env : Fin 6 → ZFSet.{u} => batchAttachmentShadowGraph - (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by - let slots : Fin 4 → Fin 6 := Fin.cases 2 (Fin.cases 3 (Fin.cases 4 (Fin.cases 5 Fin.elim0))) - let aux := fun j : Fin 4 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => slots j) - refine GroundDefinableFunction.withAuxFamily aux (batchShadowSetFormula 4 5 6 7 8 9 10 0 1 2 3) ?_ ?_ - · intro env members - exact M.batchAttachmentShadowGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) - · intro env members z hz - exact M.realize_batchShadowSetFormula pairing unions powers separation 4 5 6 7 8 9 10 0 1 2 3 _ - (extendMany_members 4 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl rfl rfl - -end TransitiveGround - -section -universe u - -theorem batchTemplateGraph_eq_section (I P Qs rs As Es i : ZFSet.{u}) : - batchTemplateGraph I P Qs rs As Es i = - indexedRelationSection (familyPointBound Qs) - (taggedExtension P (indexedAttachmentFresh I Qs rs As)) - (batchAttachmentTemplateGraph I P Qs rs As Es) i := rfl - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -noncomputable def batchEmbeddingFamily (I P Qs rs As Es : ZFSet.{u}) : ZFSet.{u} := - M.indexedRelationSections I (familyPointBound Qs) - (taggedExtension P (indexedAttachmentFresh I Qs rs As)) - (batchAttachmentTemplateGraph I P Qs rs As Es) - -theorem batchEmbeddingFamily_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I P Qs rs As Es : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) : - M.batchEmbeddingFamily I P Qs rs As Es ∈ M.sets ∧ - FunctionGraphOn I (M.batchEmbeddingFamily I P Qs rs As Es) ∧ - ∀ i f, ZFSet.pair i f ∈ M.batchEmbeddingFamily I P Qs rs As Es ↔ - i ∈ I ∧ f = batchTemplateGraph I P Qs rs As Es i := by - have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs - have hL := M.taggedExtension_mem pairing unions powers separation hP hN - have hB := M.familyPointBound_mem unions hQs - have hR := M.batchAttachmentTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs - obtain ⟨member, function, entries⟩ := M.indexedRelationSections_spec - pairing unions powers separation hI hB hL hR - refine ⟨member, ⟨_, function⟩, ?_⟩ - intro i f - exact (entries i f).trans (and_congr Iff.rfl (by rw [batchTemplateGraph_eq_section])) - -theorem exists_batchAttachment_embedding_family - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (hP : P ∈ M.sets) (hrP : rP ∈ M.sets) (hI : I ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) - (_hSs : Ss ∈ M.sets) : - d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode d.batchCarrier d.batchOrder d.batchMeetGraph ∧ - ∃ family ∈ M.sets, FunctionGraphOn I family ∧ - (∀ i f, ZFSet.pair i f ∈ family ↔ i ∈ I ∧ f = batchTemplateGraph I P Qs rs As Es i) ∧ - ∀ (i : {i : ZFSet.{u} // i ∈ I}) f, ZFSet.pair i.val f ∈ family → - MeetEmbeddingCode (d.space i) d.batchCarrier (d.rel i) d.batchOrder - (d.meet i) d.batchMeetGraph f := by - obtain ⟨hL, hr, hm, _, _, _⟩ := M.batchAttachment_ground_codes - pairing unions powers separation d hP hrP hI hQs hrs hμs hAs hEs hFs - obtain ⟨member, function, entries⟩ := M.batchEmbeddingFamily_spec - pairing unions powers separation hI hP hQs hrs hAs hEs - refine ⟨hL, hr, hm, d.batch_meetOrder, M.batchEmbeddingFamily I P Qs rs As Es, - member, function, entries, ?_⟩ - intro i f entry - have eq := ((entries i.val f).1 entry).2 - exact eq.symm ▸ d.batch_template_embedding_code i - -end TransitiveGround - -end - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def definable_liftedCompressionFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 13 → ZFSet.{u} => - M.groundLiftedCompressionFamily (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) - (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) (env 12)) := by - let doubleUnion : GroundDefinableFunction M - (fun env : Fin 1 → ZFSet.{u} => ZFSet.sUnion (ZFSet.sUnion (env 0))) := - (M.definable_sUnion unions).comp (fun _ => M.definable_sUnion unions) - let bounds : Fin 2 → (Fin 13 → ZFSet.{u}) → ZFSet.{u} := - ![(fun env => ZFSet.sUnion (ZFSet.sUnion (env 7))), - (fun env => ZFSet.sUnion (ZFSet.sUnion (env 9)))] - have definedBounds : ∀ j, GroundDefinableFunction M (bounds j) := by - intro j - exact Fin.cases (doubleUnion.reindex (fun _ => 7)) - (Fin.cases (doubleUnion.reindex (fun _ => 9)) (fun k => Fin.elim0 k)) j - refine GroundDefinableFunction.withAuxFamily definedBounds - (liftedCompressionFamilyFormula 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1) ?_ ?_ - · intro env members - exact (M.groundLiftedCompressionFamily_spec pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) - (members 7) (members 8) (members 9) (members 10) (members 11) (members 12)).1 - · intro env members z hz - exact M.realize_liftedCompressionFamilyFormula pairing unions powers separation - 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 - (extend (ZFSet.sUnion (ZFSet.sUnion (env 7))) - (extend (ZFSet.sUnion (ZFSet.sUnion (env 9))) (extend z env))) - (Fin.cases (M.union_mem unions (M.union_mem unions (members 7))) - (Fin.cases (M.union_mem unions (M.union_mem unions (members 9))) - (Fin.cases hz members))) rfl rfl - -end TransitiveGround - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -noncomputable def definable_indexedDomain : GroundDefinableFunction M - (fun env : Fin 2 → ZFSet.{u} => indexedAttachmentDomain (env 0) (env 1)) := by - let aux := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (1 : Fin 2)) - refine aux.withAux (indexedDomainSetFormula 1 2 3 0) ?_ ?_ - · intro env members - exact M.indexedAttachmentDomain_mem pairing unions powers separation (members 0) (members 1) - · intro env members z hz - exact M.realize_indexedDomainSetFormula pairing unions powers separation 1 2 3 0 - _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl - -noncomputable def definable_batchTemplate : GroundDefinableFunction M - (fun env : Fin 6 → ZFSet.{u} => batchAttachmentTemplateGraph - (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by - let domain := (M.definable_indexedDomain pairing unions powers separation).reindex - (Fin.cases (0 : Fin 6) (Fin.cases 2 Fin.elim0)) - let fresh := (M.definable_indexedFresh pairing unions powers separation).reindex - (Fin.cases (0 : Fin 6) (Fin.cases 2 (Fin.cases 3 (Fin.cases 4 Fin.elim0)))) - let carrierValues : Fin 2 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := - Fin.cases (fun env => env 1) (Fin.cases - (fun env => indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4)) Fin.elim0) - let carrier := (M.definable_taggedExtension pairing unions powers separation).comp - (g := carrierValues) - (Fin.cases (GroundDefinableFunction.projection M (1 : Fin 6)) (Fin.cases fresh (fun j => Fin.elim0 j))) - let points := ((M.definable_sUnion unions).comp - (fun _ : Fin 1 => M.definable_doubleUnion unions)).reindex (fun _ : Fin 1 => (2 : Fin 6)) - let bases := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (5 : Fin 6)) - let values : Fin 5 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := Fin.cases - (fun env => indexedAttachmentDomain (env 0) (env 2)) (Fin.cases - (fun env => indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4)) (Fin.cases - (fun env => taggedExtension (env 1) (indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4))) (Fin.cases - (fun env => familyPointBound (env 2)) - (Fin.cases (fun env => ZFSet.sUnion (ZFSet.sUnion (env 5))) Fin.elim0)))) - let aux : ∀ j, GroundDefinableFunction M (values j) := - Fin.cases domain (Fin.cases fresh (Fin.cases carrier (Fin.cases points (Fin.cases bases (fun j => Fin.elim0 j))))) - refine GroundDefinableFunction.withAuxFamily aux (batchTemplateSetFormula 5 0 2 7 6 3 11 4 1) ?_ ?_ - · intro env members - exact M.batchAttachmentTemplateGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) - · intro env members z hz - exact M.realize_batchTemplateSetFormula pairing unions powers separation - 5 0 2 7 6 8 9 10 11 3 4 1 _ - (extendMany_members 5 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) - rfl rfl rfl rfl rfl - -noncomputable def definable_indexedSections : GroundDefinableFunction M - (fun env : Fin 4 → ZFSet.{u} => M.indexedRelationSections (env 0) (env 1) (env 2) (env 3)) where - formula := sectionFamilyFormula 0 1 2 3 4 - closed := fun _ members => (M.indexedRelationSections_spec pairing unions powers separation - (members 0) (members 1) (members 2) (members 3)).1 - correct := fun env members z hz => M.realize_sectionFamilyFormula pairing 0 1 2 3 4 - (extend z env) (Fin.cases hz members) - -noncomputable def definable_batchEmbeddingFamily : GroundDefinableFunction M - (fun env : Fin 6 → ZFSet.{u} => M.batchEmbeddingFamily - (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by - let fresh := (M.definable_indexedFresh pairing unions powers separation).reindex - (Fin.cases (0 : Fin 6) (Fin.cases 2 (Fin.cases 3 (Fin.cases 4 Fin.elim0)))) - let carrierValues : Fin 2 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := - Fin.cases (fun env => env 1) (Fin.cases - (fun env => indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4)) Fin.elim0) - let carrier := (M.definable_taggedExtension pairing unions powers separation).comp - (g := carrierValues) - (Fin.cases (GroundDefinableFunction.projection M (1 : Fin 6)) (Fin.cases fresh (fun j => Fin.elim0 j))) - let points := ((M.definable_sUnion unions).comp - (fun _ : Fin 1 => M.definable_doubleUnion unions)).reindex (fun _ : Fin 1 => (2 : Fin 6)) - let values : Fin 4 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := - Fin.cases (fun env => env 0) (Fin.cases (fun env => familyPointBound (env 2)) - (Fin.cases (fun env => taggedExtension (env 1) - (indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4))) - (Fin.cases (fun env => batchAttachmentTemplateGraph - (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) Fin.elim0))) - exact (M.definable_indexedSections pairing unions powers separation).comp (g := values) - (Fin.cases (GroundDefinableFunction.projection M (0 : Fin 6)) - (Fin.cases points (Fin.cases carrier - (Fin.cases (M.definable_batchTemplate pairing unions powers separation) (fun j => Fin.elim0 j))))) - -noncomputable def batchEmbeddingFamilyFormula {n} - (output I P Qs rs As Es : Fin n) : SetFormula n := - SetFormula.reindex - (Fin.cases output (Fin.cases I (Fin.cases P (Fin.cases Qs - (Fin.cases rs (Fin.cases As (Fin.cases Es Fin.elim0))))))) - (M.definable_batchEmbeddingFamily pairing unions powers separation).formula - -theorem realize_batchEmbeddingFamilyFormula {n} - (output I P Qs rs As Es : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (M.batchEmbeddingFamilyFormula pairing unions powers separation output I P Qs rs As Es) env ↔ - env output = M.batchEmbeddingFamily (env I) (env P) (env Qs) (env rs) (env As) (env Es) := by - let slots : Fin 6 → Fin n := Fin.cases I (Fin.cases P (Fin.cases Qs - (Fin.cases rs (Fin.cases As (Fin.cases Es Fin.elim0))))) - unfold batchEmbeddingFamilyFormula - rw [realize_reindex] - change Realize M.sets (M.definable_batchEmbeddingFamily pairing unions powers separation).formula - (fun j => env (extend output slots j)) ↔ _ - rw [map_extend] - exact (M.definable_batchEmbeddingFamily pairing unions powers separation).correct - (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedCompressionFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.RecursivePrimitiveFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchAttachment + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundDefinableFunction +open SetFormula +universe u + +def withAux {M : TransitiveGround.{u}} {n} + {a f : (Fin n → ZFSet.{u}) → ZFSet.{u}} + (aux : GroundDefinableFunction M a) (body : SetFormula (n + 2)) + (closed : ∀ env, (∀ i, env i ∈ M.sets) → f env ∈ M.sets) + (correct : ∀ env, (∀ i, env i ∈ M.sets) → ∀ z ∈ M.sets, + Realize M.sets body (extend (a env) (extend z env)) ↔ z = f env) : + GroundDefinableFunction M f where + formula := ex (.conj + (SetFormula.reindex (extend 0 (fun i => i.succ.succ)) aux.formula) body) + closed := closed + correct := by + intro env members z hz + simp only [realize_ex, Realize] + constructor + · rintro ⟨value, hvalue, specified, result⟩ + have equal : value = a env := by + apply (aux.correct env members value hvalue).1 + have meaning := (realize_reindex M.sets _ aux.formula _).1 specified + rw [map_extend] at meaning + exact meaning + subst value + exact (correct env members z hz).1 result + · intro equal + refine ⟨a env, aux.closed env members, ?_, (correct env members z hz).2 equal⟩ + rw [realize_reindex, map_extend] + exact (aux.correct env members (a env) (aux.closed env members)).2 rfl + +def withAuxFamily {M : TransitiveGround.{u}} {n k} + {a : Fin k → (Fin n → ZFSet.{u}) → ZFSet.{u}} + {f : (Fin n → ZFSet.{u}) → ZFSet.{u}} + (aux : ∀ j, GroundDefinableFunction M (a j)) (body : SetFormula (n + 1 + k)) + (closed : ∀ env, (∀ i, env i ∈ M.sets) → f env ∈ M.sets) + (correct : ∀ env, (∀ i, env i ∈ M.sets) → ∀ z ∈ M.sets, + Realize M.sets body (extendMany k (fun j => a j env) (extend z env)) ↔ z = f env) : + GroundDefinableFunction M f where + formula := exBlock k (.conj + (conjBlock k (fun j => SetFormula.reindex + (extend (prefixIndex (n + 1) k j) (fun i => suffixIndex (n + 1) k i.succ)) (aux j).formula)) body) + closed := closed + correct := by + intro env members z hz + rw [realize_exBlock] + constructor + · rintro ⟨fields, fieldMembers, clauses, result⟩ + have each := (realize_conjBlock M.sets _ _ _).1 clauses + have values : fields = fun j => a j env := by + funext j + have meaning := (realize_reindex M.sets _ _ _).1 (each j) + rw [map_extend] at meaning + simp only [extendMany_prefix, extendMany_suffix] at meaning + exact ((aux j).correct env members (fields j) (fieldMembers j)).1 meaning + exact (correct env members z hz).1 (values ▸ result) + · intro equal + let fields : Fin k → ZFSet.{u} := fun j => a j env + have fieldMembers : ∀ j, fields j ∈ M.sets := fun j => (aux j).closed env members + refine ⟨fields, fieldMembers, ?_, (correct env members z hz).2 equal⟩ + apply (realize_conjBlock M.sets _ _ _).2 + intro j + rw [realize_reindex, map_extend] + simp only [extendMany_prefix, extendMany_suffix] + exact ((aux j).correct env members (fields j) (fieldMembers j)).2 rfl + +end GroundDefinableFunction + +section +open SetFormula +universe u + +namespace SetFormula + +def indexedDomainSetFormula {n} (output i qs qb : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.indexedAttachmentDomainEntryFormula 0 i.succ qs.succ qb.succ).toFormula + +def batchTemplateSetFormula {n} (output domain carrier p i points es eb fresh : Fin n) : SetFormula n := + exactSetFormula output (reindex + (Fin.cases 0 (Fin.cases domain.succ (Fin.cases carrier.succ (Fin.cases p.succ + (Fin.cases i.succ (Fin.cases points.succ (Fin.cases es.succ + (Fin.cases eb.succ (Fin.cases fresh.succ Fin.elim0))))))))) + BoundedFormula.batchTemplateGraphFormula.toFormula) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_indexedDomainSetFormula {n} (output i qs qb : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) + (bound : env qb = ZFSet.sUnion (ZFSet.sUnion (env qs))) : + Realize M.sets (indexedDomainSetFormula output i qs qb) env ↔ + env output = indexedAttachmentDomain (env i) (env qs) := by + apply M.realize_exactBoundedSetFormula output _ env members + (M.indexedAttachmentDomain_mem pairing unions powers separation (members i) (members qs)) + intro z + rw [BoundedFormula.truth_indexedAttachmentDomainEntryFormula] + change (∃ j ∈ env i, ∃ Q ∈ env qb, ∃ q ∈ Q, + ZFSet.pair j Q ∈ env qs ∧ z = ZFSet.pair j q) ↔ _ + rw [bound, indexedAttachmentDomain, ZFSet.mem_sep] + constructor + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨j, hj, Q, _, q, hq, entry, equal⟩ := witness + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hj, mem_familyPointBound_of_entry entry hq⟩ + · exact And.right + +theorem realize_batchTemplateSetFormula {n} + (output domain carrier p i qs rs anchors es points eb fresh : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) + (domain_eq : env domain = indexedAttachmentDomain (env i) (env qs)) + (fresh_eq : env fresh = indexedAttachmentFresh (env i) (env qs) (env rs) (env anchors)) + (carrier_eq : env carrier = taggedExtension (env p) (env fresh)) + (points_eq : env points = familyPointBound (env qs)) + (base_bound : env eb = ZFSet.sUnion (ZFSet.sUnion (env es))) : + Realize M.sets (batchTemplateSetFormula output domain carrier p i points es eb fresh) env ↔ + env output = batchAttachmentTemplateGraph (env i) (env p) (env qs) (env rs) (env anchors) (env es) := by + apply M.realize_exactReindexedBoundedSetFormula output _ _ env members + (M.batchAttachmentTemplateGraph_mem pairing unions powers separation + (members i) (members p) (members qs) (members rs) (members anchors) (members es)) + intro z + rw [BoundedFormula.truth_batchTemplateGraphFormula] + change (∃ x ∈ env domain, ∃ y ∈ env carrier, z = ZFSet.pair x y ∧ + ((∃ j ∈ env i, ∃ q ∈ env points, x = ZFSet.pair j q ∧ + ∃ ell ∈ env eb, ZFSet.pair j ell ∈ env es ∧ ZFSet.pair q y ∈ ell) ∨ + (x ∈ env fresh ∧ y = ZFSet.pair (env p) x))) ↔ _ + rw [domain_eq, carrier_eq, points_eq, base_bound, fresh_eq] + dsimp only [batchAttachmentTemplateGraph] + rw [ZFSet.mem_sep] + constructor + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨x, hx, y, hy, equal, _⟩ := witness + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ + · exact And.right + +end TransitiveGround +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def definable_sUnion (unions : Realize M.sets SetFormula.union Fin.elim0) : + GroundDefinableFunction M (fun env : Fin 1 → ZFSet.{u} => ZFSet.sUnion (env 0)) where + formula := sUnionSetFormula 0 1 + closed := fun _env members => M.union_mem unions (members 0) + correct := fun env members z hz => + M.realize_sUnionSetFormula unions 0 1 (extend z env) (Fin.cases hz members) + +noncomputable def definable_doubleUnion (unions : Realize M.sets SetFormula.union Fin.elim0) : + GroundDefinableFunction M (fun env : Fin 1 → ZFSet.{u} => ZFSet.sUnion (ZFSet.sUnion (env 0))) := + (M.definable_sUnion unions).comp (fun _ => M.definable_sUnion unions) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +noncomputable def definable_taggedExtension : GroundDefinableFunction M + (fun env : Fin 2 → ZFSet.{u} => taggedExtension (env 0) (env 1)) where + formula := taggedExtensionSetFormula 0 1 2 + closed := fun _env members => M.taggedExtension_mem pairing unions powers separation (members 0) (members 1) + correct := fun env members z hz => M.realize_taggedExtensionSetFormula pairing unions powers separation + 0 1 2 (extend z env) (Fin.cases hz members) + +noncomputable def definable_canonicalMeet : GroundDefinableFunction M + (fun env : Fin 2 → ZFSet.{u} => canonicalMeetGraph (env 0) (env 1)) where + formula := canonicalMeetSetFormula 0 1 2 + closed := fun _env members => M.canonicalMeetGraph_mem pairing unions powers separation (members 0) (members 1) + correct := fun env members z hz => M.realize_canonicalMeetSetFormula pairing unions powers separation + 0 1 2 (extend z env) (Fin.cases hz members) + +noncomputable def definable_recursiveIndices : GroundDefinableFunction M + (fun env : Fin 6 → ZFSet.{u} => recursiveAttachmentIndices + (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) where + formula := recursiveIndicesSetFormula 0 1 2 3 4 5 6 + closed := fun _env members => M.recursiveAttachmentIndices_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) + correct := fun env members z hz => M.realize_recursiveIndicesSetFormula pairing unions powers separation + 0 1 2 3 4 5 6 (extend z env) (Fin.cases hz members) + +noncomputable def definable_codedAttachmentOrder : GroundDefinableFunction M + (fun env : Fin 6 → ZFSet.{u} => codedAttachmentOrder + (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by + let aux := (M.definable_taggedExtension pairing unions powers separation).reindex + (Fin.cases (0 : Fin 6) (Fin.cases 1 Fin.elim0)) + refine aux.withAux (codedAttachmentOrderSetFormula 1 0 2 3 4 5 6 7) ?_ ?_ + · intro env members + exact M.codedAttachmentOrder_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) + · intro env members z hz + exact M.realize_codedAttachmentOrderSetFormula pairing unions powers separation 1 0 2 3 4 5 6 7 + _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl + +noncomputable def definable_pairSecondField : GroundDefinableFunction M + (fun env : Fin 4 → ZFSet.{u} => pairSecondField (env 0) (env 1) (env 2) (env 3)) := by + let aux := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (3 : Fin 4)) + refine aux.withAux (pairFieldSetFormula false 1 2 3 4 0 5) ?_ ?_ + · intro env members + exact M.pairFieldGraph_mem pairing unions powers separation false + (members 0) (members 1) (members 2) (aux.closed env members) (members 3) + · intro env members z hz + exact M.realize_pairSecondFieldSetFormula pairing unions powers separation 1 2 3 4 0 5 + _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl + +noncomputable def definable_indexedFresh : GroundDefinableFunction M + (fun env : Fin 4 → ZFSet.{u} => indexedAttachmentFresh (env 0) (env 1) (env 2) (env 3)) := by + let aux := fun j : Fin 3 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => j.succ) + refine GroundDefinableFunction.withAuxFamily aux (indexedFreshSetFormula 3 4 5 6 7 0 1 2) ?_ ?_ + · intro env members + exact M.indexedAttachmentFresh_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) + · intro env members z hz + exact M.realize_indexedFreshSetFormula pairing unions powers separation 3 4 5 6 7 0 1 2 _ + (extendMany_members 3 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl rfl + +noncomputable def definable_batchInside : GroundDefinableFunction M + (fun env : Fin 3 → ZFSet.{u} => batchAttachmentInsideGraph (env 0) (env 1) (env 2)) := by + let aux := fun j : Fin 2 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => j.succ) + refine GroundDefinableFunction.withAuxFamily aux (batchInsideSetFormula 2 3 4 5 0 1) ?_ ?_ + · intro env members + exact M.batchAttachmentInsideGraph_mem pairing unions powers separation (members 0) (members 1) (members 2) + · intro env members z hz + exact M.realize_batchInsideSetFormula pairing unions powers separation 2 3 4 5 0 1 _ + (extendMany_members 2 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl + +noncomputable def definable_batchUpper : GroundDefinableFunction M + (fun env : Fin 4 → ZFSet.{u} => batchAttachmentUpperGraph (env 0) (env 1) (env 2) (env 3)) := by + let slots : Fin 2 → Fin 4 := Fin.cases 2 (Fin.cases 3 Fin.elim0) + let aux := fun j : Fin 2 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => slots j) + refine GroundDefinableFunction.withAuxFamily aux (batchUpperSetFormula 2 3 4 5 6 0 1) ?_ ?_ + · intro env members + exact M.batchAttachmentUpperGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) + · intro env members z hz + exact M.realize_batchUpperSetFormula pairing unions powers separation 2 3 4 5 6 0 1 _ + (extendMany_members 2 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl + +noncomputable def definable_batchShadow : GroundDefinableFunction M + (fun env : Fin 6 → ZFSet.{u} => batchAttachmentShadowGraph + (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by + let slots : Fin 4 → Fin 6 := Fin.cases 2 (Fin.cases 3 (Fin.cases 4 (Fin.cases 5 Fin.elim0))) + let aux := fun j : Fin 4 => (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => slots j) + refine GroundDefinableFunction.withAuxFamily aux (batchShadowSetFormula 4 5 6 7 8 9 10 0 1 2 3) ?_ ?_ + · intro env members + exact M.batchAttachmentShadowGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) + · intro env members z hz + exact M.realize_batchShadowSetFormula pairing unions powers separation 4 5 6 7 8 9 10 0 1 2 3 _ + (extendMany_members 4 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) rfl rfl rfl rfl + +end TransitiveGround + +section +universe u + +theorem batchTemplateGraph_eq_section (I P Qs rs As Es i : ZFSet.{u}) : + batchTemplateGraph I P Qs rs As Es i = + indexedRelationSection (familyPointBound Qs) + (taggedExtension P (indexedAttachmentFresh I Qs rs As)) + (batchAttachmentTemplateGraph I P Qs rs As Es) i := rfl + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +noncomputable def batchEmbeddingFamily (I P Qs rs As Es : ZFSet.{u}) : ZFSet.{u} := + M.indexedRelationSections I (familyPointBound Qs) + (taggedExtension P (indexedAttachmentFresh I Qs rs As)) + (batchAttachmentTemplateGraph I P Qs rs As Es) + +theorem batchEmbeddingFamily_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I P Qs rs As Es : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) : + M.batchEmbeddingFamily I P Qs rs As Es ∈ M.sets ∧ + FunctionGraphOn I (M.batchEmbeddingFamily I P Qs rs As Es) ∧ + ∀ i f, ZFSet.pair i f ∈ M.batchEmbeddingFamily I P Qs rs As Es ↔ + i ∈ I ∧ f = batchTemplateGraph I P Qs rs As Es i := by + have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs + have hL := M.taggedExtension_mem pairing unions powers separation hP hN + have hB := M.familyPointBound_mem unions hQs + have hR := M.batchAttachmentTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs + obtain ⟨member, function, entries⟩ := M.indexedRelationSections_spec + pairing unions powers separation hI hB hL hR + refine ⟨member, ⟨_, function⟩, ?_⟩ + intro i f + exact (entries i f).trans (and_congr Iff.rfl (by rw [batchTemplateGraph_eq_section])) + +theorem exists_batchAttachment_embedding_family + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (hP : P ∈ M.sets) (hrP : rP ∈ M.sets) (hI : I ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) + (_hSs : Ss ∈ M.sets) : + d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode d.batchCarrier d.batchOrder d.batchMeetGraph ∧ + ∃ family ∈ M.sets, FunctionGraphOn I family ∧ + (∀ i f, ZFSet.pair i f ∈ family ↔ i ∈ I ∧ f = batchTemplateGraph I P Qs rs As Es i) ∧ + ∀ (i : {i : ZFSet.{u} // i ∈ I}) f, ZFSet.pair i.val f ∈ family → + MeetEmbeddingCode (d.space i) d.batchCarrier (d.rel i) d.batchOrder + (d.meet i) d.batchMeetGraph f := by + obtain ⟨hL, hr, hm, _, _, _⟩ := M.batchAttachment_ground_codes + pairing unions powers separation d hP hrP hI hQs hrs hμs hAs hEs hFs + obtain ⟨member, function, entries⟩ := M.batchEmbeddingFamily_spec + pairing unions powers separation hI hP hQs hrs hAs hEs + refine ⟨hL, hr, hm, d.batch_meetOrder, M.batchEmbeddingFamily I P Qs rs As Es, + member, function, entries, ?_⟩ + intro i f entry + have eq := ((entries i.val f).1 entry).2 + exact eq.symm ▸ d.batch_template_embedding_code i + +end TransitiveGround + +end + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def definable_liftedCompressionFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 13 → ZFSet.{u} => + M.groundLiftedCompressionFamily (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) + (env 6) (env 7) (env 8) (env 9) (env 10) (env 11) (env 12)) := by + let doubleUnion : GroundDefinableFunction M + (fun env : Fin 1 → ZFSet.{u} => ZFSet.sUnion (ZFSet.sUnion (env 0))) := + (M.definable_sUnion unions).comp (fun _ => M.definable_sUnion unions) + let bounds : Fin 2 → (Fin 13 → ZFSet.{u}) → ZFSet.{u} := + ![(fun env => ZFSet.sUnion (ZFSet.sUnion (env 7))), + (fun env => ZFSet.sUnion (ZFSet.sUnion (env 9)))] + have definedBounds : ∀ j, GroundDefinableFunction M (bounds j) := by + intro j + exact Fin.cases (doubleUnion.reindex (fun _ => 7)) + (Fin.cases (doubleUnion.reindex (fun _ => 9)) (fun k => Fin.elim0 k)) j + refine GroundDefinableFunction.withAuxFamily definedBounds + (liftedCompressionFamilyFormula 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1) ?_ ?_ + · intro env members + exact (M.groundLiftedCompressionFamily_spec pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) + (members 7) (members 8) (members 9) (members 10) (members 11) (members 12)).1 + · intro env members z hz + exact M.realize_liftedCompressionFamilyFormula pairing unions powers separation + 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 + (extend (ZFSet.sUnion (ZFSet.sUnion (env 7))) + (extend (ZFSet.sUnion (ZFSet.sUnion (env 9))) (extend z env))) + (Fin.cases (M.union_mem unions (M.union_mem unions (members 7))) + (Fin.cases (M.union_mem unions (M.union_mem unions (members 9))) + (Fin.cases hz members))) rfl rfl + +end TransitiveGround + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +noncomputable def definable_indexedDomain : GroundDefinableFunction M + (fun env : Fin 2 → ZFSet.{u} => indexedAttachmentDomain (env 0) (env 1)) := by + let aux := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (1 : Fin 2)) + refine aux.withAux (indexedDomainSetFormula 1 2 3 0) ?_ ?_ + · intro env members + exact M.indexedAttachmentDomain_mem pairing unions powers separation (members 0) (members 1) + · intro env members z hz + exact M.realize_indexedDomainSetFormula pairing unions powers separation 1 2 3 0 + _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl + +noncomputable def definable_batchTemplate : GroundDefinableFunction M + (fun env : Fin 6 → ZFSet.{u} => batchAttachmentTemplateGraph + (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by + let domain := (M.definable_indexedDomain pairing unions powers separation).reindex + (Fin.cases (0 : Fin 6) (Fin.cases 2 Fin.elim0)) + let fresh := (M.definable_indexedFresh pairing unions powers separation).reindex + (Fin.cases (0 : Fin 6) (Fin.cases 2 (Fin.cases 3 (Fin.cases 4 Fin.elim0)))) + let carrierValues : Fin 2 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := + Fin.cases (fun env => env 1) (Fin.cases + (fun env => indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4)) Fin.elim0) + let carrier := (M.definable_taggedExtension pairing unions powers separation).comp + (g := carrierValues) + (Fin.cases (GroundDefinableFunction.projection M (1 : Fin 6)) (Fin.cases fresh (fun j => Fin.elim0 j))) + let points := ((M.definable_sUnion unions).comp + (fun _ : Fin 1 => M.definable_doubleUnion unions)).reindex (fun _ : Fin 1 => (2 : Fin 6)) + let bases := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (5 : Fin 6)) + let values : Fin 5 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := Fin.cases + (fun env => indexedAttachmentDomain (env 0) (env 2)) (Fin.cases + (fun env => indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4)) (Fin.cases + (fun env => taggedExtension (env 1) (indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4))) (Fin.cases + (fun env => familyPointBound (env 2)) + (Fin.cases (fun env => ZFSet.sUnion (ZFSet.sUnion (env 5))) Fin.elim0)))) + let aux : ∀ j, GroundDefinableFunction M (values j) := + Fin.cases domain (Fin.cases fresh (Fin.cases carrier (Fin.cases points (Fin.cases bases (fun j => Fin.elim0 j))))) + refine GroundDefinableFunction.withAuxFamily aux (batchTemplateSetFormula 5 0 2 7 6 3 11 4 1) ?_ ?_ + · intro env members + exact M.batchAttachmentTemplateGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) + · intro env members z hz + exact M.realize_batchTemplateSetFormula pairing unions powers separation + 5 0 2 7 6 8 9 10 11 3 4 1 _ + (extendMany_members 5 _ _ (fun j => (aux j).closed env members) (Fin.cases hz members)) + rfl rfl rfl rfl rfl + +noncomputable def definable_indexedSections : GroundDefinableFunction M + (fun env : Fin 4 → ZFSet.{u} => M.indexedRelationSections (env 0) (env 1) (env 2) (env 3)) where + formula := sectionFamilyFormula 0 1 2 3 4 + closed := fun _ members => (M.indexedRelationSections_spec pairing unions powers separation + (members 0) (members 1) (members 2) (members 3)).1 + correct := fun env members z hz => M.realize_sectionFamilyFormula pairing 0 1 2 3 4 + (extend z env) (Fin.cases hz members) + +noncomputable def definable_batchEmbeddingFamily : GroundDefinableFunction M + (fun env : Fin 6 → ZFSet.{u} => M.batchEmbeddingFamily + (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by + let fresh := (M.definable_indexedFresh pairing unions powers separation).reindex + (Fin.cases (0 : Fin 6) (Fin.cases 2 (Fin.cases 3 (Fin.cases 4 Fin.elim0)))) + let carrierValues : Fin 2 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := + Fin.cases (fun env => env 1) (Fin.cases + (fun env => indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4)) Fin.elim0) + let carrier := (M.definable_taggedExtension pairing unions powers separation).comp + (g := carrierValues) + (Fin.cases (GroundDefinableFunction.projection M (1 : Fin 6)) (Fin.cases fresh (fun j => Fin.elim0 j))) + let points := ((M.definable_sUnion unions).comp + (fun _ : Fin 1 => M.definable_doubleUnion unions)).reindex (fun _ : Fin 1 => (2 : Fin 6)) + let values : Fin 4 → (Fin 6 → ZFSet.{u}) → ZFSet.{u} := + Fin.cases (fun env => env 0) (Fin.cases (fun env => familyPointBound (env 2)) + (Fin.cases (fun env => taggedExtension (env 1) + (indexedAttachmentFresh (env 0) (env 2) (env 3) (env 4))) + (Fin.cases (fun env => batchAttachmentTemplateGraph + (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) Fin.elim0))) + exact (M.definable_indexedSections pairing unions powers separation).comp (g := values) + (Fin.cases (GroundDefinableFunction.projection M (0 : Fin 6)) + (Fin.cases points (Fin.cases carrier + (Fin.cases (M.definable_batchTemplate pairing unions powers separation) (fun j => Fin.elim0 j))))) + +noncomputable def batchEmbeddingFamilyFormula {n} + (output I P Qs rs As Es : Fin n) : SetFormula n := + SetFormula.reindex + (Fin.cases output (Fin.cases I (Fin.cases P (Fin.cases Qs + (Fin.cases rs (Fin.cases As (Fin.cases Es Fin.elim0))))))) + (M.definable_batchEmbeddingFamily pairing unions powers separation).formula + +theorem realize_batchEmbeddingFamilyFormula {n} + (output I P Qs rs As Es : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (M.batchEmbeddingFamilyFormula pairing unions powers separation output I P Qs rs As Es) env ↔ + env output = M.batchEmbeddingFamily (env I) (env P) (env Qs) (env rs) (env As) (env Es) := by + let slots : Fin 6 → Fin n := Fin.cases I (Fin.cases P (Fin.cases Qs + (Fin.cases rs (Fin.cases As (Fin.cases Es Fin.elim0))))) + unfold batchEmbeddingFamilyFormula + rw [realize_reindex] + change Realize M.sets (M.definable_batchEmbeddingFamily pairing unions powers separation).formula + (fun j => env (extend output slots j)) ↔ _ + rw [map_extend] + exact (M.definable_batchEmbeddingFamily pairing unions powers separation).correct + (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchHeightGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchHeightGraphs.lean index e7bf559ca6ee9f76b466fea1581af02acf3e6949..a8866665622f0263857eed125bad9b7d66edb51e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchHeightGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBatchHeightGraphs.lean @@ -1,131 +1,131 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace BoundedFormula - -open SetFormula - -def componentHeightEntryFormula {n} - (w I Qs B Hs Cs E C D boundQs boundHs boundE : Fin n) : BoundedFormula n := - let lift (i : Fin n) : Fin (n + 8) := i.succ.succ.succ.succ.succ.succ.succ.succ - let body : BoundedFormula (n + 8) := - .conj (pairOfPairsFormula (lift w) 7 3 1 0) - (.conj (pairMembershipFormula 7 6 (lift Qs)) - (.conj (pairMembershipFormula 7 5 (lift Hs)) - (.conj (pairMembershipFormula 7 4 (lift E)) - (.conj (pairMembershipFormula 7 1 (lift Cs)) - (.conj (pairMembershipFormula 3 2 5) (pairMembershipFormula 2 0 4)))))) - exMem I (exMem boundQs.succ (exMem boundHs.succ.succ - (exMem boundE.succ.succ.succ (exMem 2 - (exMem B.succ.succ.succ.succ.succ - (exMem C.succ.succ.succ.succ.succ.succ - (exMem D.succ.succ.succ.succ.succ.succ.succ body))))))) - -theorem truth_componentHeightEntryFormula {n} - (w I Qs B Hs Cs E C D boundQs boundHs boundE : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (componentHeightEntryFormula w I Qs B Hs Cs E C D boundQs boundHs boundE) env ↔ - ∃ i ∈ env I, ∃ Q ∈ env boundQs, ∃ g ∈ env boundHs, ∃ f ∈ env boundE, - ∃ q ∈ Q, ∃ a ∈ env B, ∃ c ∈ env C, ∃ z ∈ env D, - env w = ZFSet.pair (ZFSet.pair i q) (ZFSet.pair c z) ∧ - ZFSet.pair i Q ∈ env Qs ∧ ZFSet.pair i g ∈ env Hs ∧ ZFSet.pair i f ∈ env E ∧ - ZFSet.pair i c ∈ env Cs ∧ ZFSet.pair q a ∈ g ∧ ZFSet.pair a z ∈ f := by - simp only [componentHeightEntryFormula, truth_exMem, Truth, - truth_pairOfPairsFormula, truth_pairMembershipFormula] - rfl - -def taggedHeightEntryFormula {n} (w P N H fresh : Fin n) : BoundedFormula n := - exMem N (exMem H.succ - (.conj (orderedTripleFormula w.succ.succ P.succ.succ 1 0) - (pairMembershipFormula 1 0 fresh.succ.succ))) - -theorem truth_taggedHeightEntryFormula {n} (w P N H fresh : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (taggedHeightEntryFormula w P N H fresh) env ↔ - ∃ x ∈ env N, ∃ h ∈ env H, - env w = ZFSet.pair (ZFSet.pair (env P) x) h ∧ ZFSet.pair x h ∈ env fresh := by - simp only [taggedHeightEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem componentHeightGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I Qs B Hs Cs E C D : ZFSet.{u}} - (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hB : B ∈ M.sets) (hHs : Hs ∈ M.sets) - (hCs : Cs ∈ M.sets) (hE : E ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) : - componentHeightGraph I Qs B Hs Cs E C D ∈ M.sets := by - have qBound := M.union_mem unions (M.union_mem unions hQs) - have hBound := M.union_mem unions (M.union_mem unions hHs) - have eBound := M.union_mem unions (M.union_mem unions hE) - let params := extend I (extend Qs (extend B (extend Hs (extend Cs (extend E - (extend C (extend D (extend (⋃₀ ⋃₀ Qs) (extend (⋃₀ ⋃₀ Hs) - (extend (⋃₀ ⋃₀ E) Fin.elim0)))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.componentHeightEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) params - (Fin.cases hI (Fin.cases hQs (Fin.cases hB (Fin.cases hHs (Fin.cases hCs - (Fin.cases hE (Fin.cases hC (Fin.cases hD (Fin.cases qBound - (Fin.cases hBound (Fin.cases eBound (fun i => Fin.elim0 i)))))))))))) - (M.prod_mem pairing unions powers separation - (M.indexedAttachmentDomain_mem pairing unions powers separation hI hQs) - (M.prod_mem pairing unions powers separation hC hD)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.componentHeightEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) (extend z params)) - (ZFSet.prod (indexedAttachmentDomain I Qs) (ZFSet.prod C D)) = - componentHeightGraph I Qs B Hs Cs E C D := by - apply ZFSet.ext - intro z - rw [componentHeightGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_componentHeightEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 _) - exact equal ▸ selected - -theorem taggedHeightGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P N H old fresh : ZFSet.{u}} - (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hH : H ∈ M.sets) - (hold : old ∈ M.sets) (hfresh : fresh ∈ M.sets) : - taggedHeightGraph P N H old fresh ∈ M.sets := by - let params := extend P (extend N (extend H (extend fresh Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.taggedHeightEntryFormula 0 1 2 3 4) params - (Fin.cases hP (Fin.cases hN (Fin.cases hH (Fin.cases hfresh (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation - (M.taggedExtension_mem pairing unions powers separation hP hN) hH) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.taggedHeightEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod (taggedExtension P N) H) = - ZFSet.sep (fun w => ∃ x ∈ N, ∃ h ∈ H, - w = ZFSet.pair (ZFSet.pair P x) h ∧ ZFSet.pair x h ∈ fresh) - (ZFSet.prod (taggedExtension P N) H) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_taggedHeightEntryFormula 0 1 2 3 4 _) - exact M.binary_union_mem pairing unions hold (equal ▸ selected) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace BoundedFormula + +open SetFormula + +def componentHeightEntryFormula {n} + (w I Qs B Hs Cs E C D boundQs boundHs boundE : Fin n) : BoundedFormula n := + let lift (i : Fin n) : Fin (n + 8) := i.succ.succ.succ.succ.succ.succ.succ.succ + let body : BoundedFormula (n + 8) := + .conj (pairOfPairsFormula (lift w) 7 3 1 0) + (.conj (pairMembershipFormula 7 6 (lift Qs)) + (.conj (pairMembershipFormula 7 5 (lift Hs)) + (.conj (pairMembershipFormula 7 4 (lift E)) + (.conj (pairMembershipFormula 7 1 (lift Cs)) + (.conj (pairMembershipFormula 3 2 5) (pairMembershipFormula 2 0 4)))))) + exMem I (exMem boundQs.succ (exMem boundHs.succ.succ + (exMem boundE.succ.succ.succ (exMem 2 + (exMem B.succ.succ.succ.succ.succ + (exMem C.succ.succ.succ.succ.succ.succ + (exMem D.succ.succ.succ.succ.succ.succ.succ body))))))) + +theorem truth_componentHeightEntryFormula {n} + (w I Qs B Hs Cs E C D boundQs boundHs boundE : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (componentHeightEntryFormula w I Qs B Hs Cs E C D boundQs boundHs boundE) env ↔ + ∃ i ∈ env I, ∃ Q ∈ env boundQs, ∃ g ∈ env boundHs, ∃ f ∈ env boundE, + ∃ q ∈ Q, ∃ a ∈ env B, ∃ c ∈ env C, ∃ z ∈ env D, + env w = ZFSet.pair (ZFSet.pair i q) (ZFSet.pair c z) ∧ + ZFSet.pair i Q ∈ env Qs ∧ ZFSet.pair i g ∈ env Hs ∧ ZFSet.pair i f ∈ env E ∧ + ZFSet.pair i c ∈ env Cs ∧ ZFSet.pair q a ∈ g ∧ ZFSet.pair a z ∈ f := by + simp only [componentHeightEntryFormula, truth_exMem, Truth, + truth_pairOfPairsFormula, truth_pairMembershipFormula] + rfl + +def taggedHeightEntryFormula {n} (w P N H fresh : Fin n) : BoundedFormula n := + exMem N (exMem H.succ + (.conj (orderedTripleFormula w.succ.succ P.succ.succ 1 0) + (pairMembershipFormula 1 0 fresh.succ.succ))) + +theorem truth_taggedHeightEntryFormula {n} (w P N H fresh : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (taggedHeightEntryFormula w P N H fresh) env ↔ + ∃ x ∈ env N, ∃ h ∈ env H, + env w = ZFSet.pair (ZFSet.pair (env P) x) h ∧ ZFSet.pair x h ∈ env fresh := by + simp only [taggedHeightEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem componentHeightGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I Qs B Hs Cs E C D : ZFSet.{u}} + (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hB : B ∈ M.sets) (hHs : Hs ∈ M.sets) + (hCs : Cs ∈ M.sets) (hE : E ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) : + componentHeightGraph I Qs B Hs Cs E C D ∈ M.sets := by + have qBound := M.union_mem unions (M.union_mem unions hQs) + have hBound := M.union_mem unions (M.union_mem unions hHs) + have eBound := M.union_mem unions (M.union_mem unions hE) + let params := extend I (extend Qs (extend B (extend Hs (extend Cs (extend E + (extend C (extend D (extend (⋃₀ ⋃₀ Qs) (extend (⋃₀ ⋃₀ Hs) + (extend (⋃₀ ⋃₀ E) Fin.elim0)))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.componentHeightEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) params + (Fin.cases hI (Fin.cases hQs (Fin.cases hB (Fin.cases hHs (Fin.cases hCs + (Fin.cases hE (Fin.cases hC (Fin.cases hD (Fin.cases qBound + (Fin.cases hBound (Fin.cases eBound (fun i => Fin.elim0 i)))))))))))) + (M.prod_mem pairing unions powers separation + (M.indexedAttachmentDomain_mem pairing unions powers separation hI hQs) + (M.prod_mem pairing unions powers separation hC hD)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.componentHeightEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) (extend z params)) + (ZFSet.prod (indexedAttachmentDomain I Qs) (ZFSet.prod C D)) = + componentHeightGraph I Qs B Hs Cs E C D := by + apply ZFSet.ext + intro z + rw [componentHeightGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_componentHeightEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 _) + exact equal ▸ selected + +theorem taggedHeightGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P N H old fresh : ZFSet.{u}} + (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hH : H ∈ M.sets) + (hold : old ∈ M.sets) (hfresh : fresh ∈ M.sets) : + taggedHeightGraph P N H old fresh ∈ M.sets := by + let params := extend P (extend N (extend H (extend fresh Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.taggedHeightEntryFormula 0 1 2 3 4) params + (Fin.cases hP (Fin.cases hN (Fin.cases hH (Fin.cases hfresh (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation + (M.taggedExtension_mem pairing unions powers separation hP hN) hH) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.taggedHeightEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod (taggedExtension P N) H) = + ZFSet.sep (fun w => ∃ x ∈ N, ∃ h ∈ H, + w = ZFSet.pair (ZFSet.pair P x) h ∧ ZFSet.pair x h ∈ fresh) + (ZFSet.prod (taggedExtension P N) H) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_taggedHeightEntryFormula 0 1 2 3 4 _) + exact M.binary_union_mem pairing unions hold (equal ▸ selected) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowExternalPoints.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowExternalPoints.lean index 6b58493bc161315545d75b3ce0609b87cb808832..d350054182ac2982894d4f4b7a930cb5d61af59a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowExternalPoints.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowExternalPoints.lean @@ -1,196 +1,196 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedExternalBirths -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundHistoryUnionBounds - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundBelow -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {A K : ZFSet.{u}} - -theorem finiteWords - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hA : A ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (omegaBelow : ZFSet.omega ∈ K) (alphabet : GroundBelow M A K) : - GroundBelow M (M.finiteWords A) K := by - have natural := GroundBelow.of_member pairing unions powers separation hK omegaBelow - have relations := GroundBelow.relations pairing unions powers separation - (M.omega_mem separation infinite) hA hK ordinal strong natural alphabet - exact relations.restrict separation (M.finiteWords_mem pairing unions powers separation infinite hA) - hK (fun _ member => (ZFSet.mem_sep.1 member).1) - -end GroundBelow - -section -open SetFormula -universe u -namespace GroundBelow -variable {M : TransitiveGround.{u}} {A E K : ZFSet.{u}} - -theorem equivalenceClasses - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hE : E ∈ M.sets) (hK : K ∈ M.sets) - (strong : GroundStrongLimit M K) (small : GroundBelow M A K) : - GroundBelow M (Forcing.equivalenceClasses A E) K := by - have included : Forcing.equivalenceClasses A E ⊆ M.groundPower A := by - intro X hX - rw [M.equivalenceClasses_eq_sep_groundPower separation hA hE] at hX - exact (ZFSet.mem_sep.1 hX).1 - exact (strong.power_closed pairing unions powers separation hA hK small).restrict - separation (M.equivalenceClasses_mem powers separation hA hE) hK included - -end GroundBelow - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem externalGroupCarrier_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {G S m one K : ZFSet.{u}} - (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (omegaBelow : ZFSet.omega ∈ K) (alphabet : GroundBelow M (externalGeneratorAlphabet G S) K) : - GroundBelow M (M.externalGroupCarrier G S m one) K := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet - have hRelation := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm hOne - exact GroundBelow.equivalenceClasses pairing unions powers separation hWords hRelation hK strong - (GroundBelow.finiteWords pairing unions powers separation infinite hAlphabet hK ordinal strong omegaBelow alphabet) - -end TransitiveGround -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -include pairing unions powers separation hK conditions - -theorem externalRectangleBound_below {P G : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (smallP : GroundBelow M P K) (smallG : GroundBelow M G K) : - GroundBelow M (externalRectangleBound P G) K := by - have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK - exact (product ⟨hP, smallP⟩ (product ⟨hP, smallP⟩ - (product ⟨hP, smallP⟩ (product ⟨hG, smallG⟩ ⟨hG, smallG⟩)))).2 - -theorem externalRectangles_below {P G r μ A : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) - (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) - (smallP : GroundBelow M P K) (smallG : GroundBelow M G K) : - GroundBelow M (externalRectangles P G r μ A) K := by - exact (M.externalRectangleBound_below pairing unions powers separation hK conditions hP hG smallP smallG).restrict - separation (M.externalRectangles_mem pairing unions powers separation hP hG hr hμ hA) hK - (fun _ hz => (ZFSet.mem_sep.1 hz).1) - -include infinite choice - -theorem externalRequestCarrier_below {I P Rectangles : ZFSet.{u}} - (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hRectangles : Rectangles ∈ M.sets) - (smallI : GroundBelow M I K) (smallP : GroundBelow M P K) - (smallRectangles : GroundBelow M Rectangles K) : - GroundBelow M (externalRequestCarrier I P Rectangles) K := by - have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK - have join := @GroundInaccessibleConditions.binary_union M K conditions pairing unions powers separation infinite choice hK - have tag := fun n => conditions.singleton pairing unions powers separation infinite hK - (M.natSetCode_mem separation infinite n) - exact (join (join (product (tag 0) ⟨hI, smallI⟩) (product (tag 1) ⟨hP, smallP⟩)) - (product (tag 2) ⟨hRectangles, smallRectangles⟩)).2 - -theorem externalChildLetters_below {I P Rectangles : ZFSet.{u}} - (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hRectangles : Rectangles ∈ M.sets) - (smallI : GroundBelow M I K) (smallP : GroundBelow M P K) - (smallRectangles : GroundBelow M Rectangles K) : - GroundBelow M (externalChildLetters I P Rectangles) K := by - have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK - have join := @GroundInaccessibleConditions.binary_union M K conditions pairing unions powers separation infinite choice hK - have tag := fun n => conditions.singleton pairing unions powers separation infinite hK - (M.natSetCode_mem separation infinite n) - have requests := M.externalRequestCarrier_below pairing unions powers separation infinite choice hK conditions - hI hP hRectangles smallI smallP smallRectangles - exact (join (product ⟨M.externalRequestCarrier_mem pairing unions powers separation hI hP hRectangles, - requests⟩ (tag 0)) (product (product (tag 2) ⟨hRectangles, smallRectangles⟩) (tag 1))).2 - -theorem externalGeneratorAlphabet_below {G S : ZFSet.{u}} - (hG : G ∈ M.sets) (hS : S ∈ M.sets) - (smallG : GroundBelow M G K) (smallS : GroundBelow M S K) : - GroundBelow M (externalGeneratorAlphabet G S) K := by - have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK - have join := @GroundInaccessibleConditions.binary_union M K conditions pairing unions powers separation infinite choice hK - have tag := fun n => conditions.singleton pairing unions powers separation infinite hK - (M.natSetCode_mem separation infinite n) - exact (join (product (tag 0) ⟨hG, smallG⟩) - (product (tag 1) (product ⟨hS, smallS⟩ (conditions.natural pairing unions powers separation infinite hK 2)))).2 - -theorem externalGroupCarrier_below_of_carriers {G S m one : ZFSet.{u}} - (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) - (smallG : GroundBelow M G K) (smallS : GroundBelow M S K) : - GroundBelow M (M.externalGroupCarrier G S m one) K := - M.externalGroupCarrier_below pairing unions powers separation infinite hG hS hm hOne hK - conditions.1 conditions.2.2.2 conditions.2.1 - (M.externalGeneratorAlphabet_below pairing unions powers separation infinite choice hK conditions hG hS smallG smallS) - -end TransitiveGround - -namespace GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P r μ A K : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hK : K ∈ M.sets) -local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) -local notation "actors" => M.externalGroupCarrier G letters m one -local notation "U" => completion.algebra.union.fields 0 -include data pairing unions powers separation infinite hP hG hK - -theorem externalPointCarrier_below - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (groupSmall : GroundBelow M actors K) (pointsSmall : GroundBelow M U K) : - GroundBelow M (completion.externalPointCarrier P r μ A) K := by - have quotient := data.point_quotient_ground pairing unions powers separation infinite hP hG - have hProduct := M.prod_mem pairing unions powers separation - data.group.carrier_mem (completion.algebra.union.ground 0) - have smallProduct := GroundBelow.product pairing unions powers separation - data.group.carrier_mem (completion.algebra.union.ground 0) hK ordinal strong groupSmall pointsSmall - exact GroundBelow.equivalenceClasses pairing unions powers separation - hProduct quotient.1 hK strong smallProduct - -theorem externalBoundedCarrier_below - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (conditions : GroundInaccessibleConditions M K) - (groupSmall : GroundBelow M actors K) (pointsSmall : GroundBelow M U K) : - GroundBelow M (completion.externalBoundedCarrier P r μ A) K := by - have hQ := (data.point_quotient_ground pairing unions powers separation infinite hP hG).2.2.1 - exact GroundBelow.insert pairing unions powers separation infinite choice hQ hQ hK conditions.2.1 - conditions.1 conditions.2.2.1 conditions.2.2.2 - (data.externalPointCarrier_below pairing unions powers separation infinite hP hG hK - conditions.1 conditions.2.2.2 groupSmall pointsSmall) - -end GroundExternalGeometryInputs - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedExternalBirths +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundHistoryUnionBounds + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundBelow +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {A K : ZFSet.{u}} + +theorem finiteWords + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hA : A ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (omegaBelow : ZFSet.omega ∈ K) (alphabet : GroundBelow M A K) : + GroundBelow M (M.finiteWords A) K := by + have natural := GroundBelow.of_member pairing unions powers separation hK omegaBelow + have relations := GroundBelow.relations pairing unions powers separation + (M.omega_mem separation infinite) hA hK ordinal strong natural alphabet + exact relations.restrict separation (M.finiteWords_mem pairing unions powers separation infinite hA) + hK (fun _ member => (ZFSet.mem_sep.1 member).1) + +end GroundBelow + +section +open SetFormula +universe u +namespace GroundBelow +variable {M : TransitiveGround.{u}} {A E K : ZFSet.{u}} + +theorem equivalenceClasses + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hE : E ∈ M.sets) (hK : K ∈ M.sets) + (strong : GroundStrongLimit M K) (small : GroundBelow M A K) : + GroundBelow M (Forcing.equivalenceClasses A E) K := by + have included : Forcing.equivalenceClasses A E ⊆ M.groundPower A := by + intro X hX + rw [M.equivalenceClasses_eq_sep_groundPower separation hA hE] at hX + exact (ZFSet.mem_sep.1 hX).1 + exact (strong.power_closed pairing unions powers separation hA hK small).restrict + separation (M.equivalenceClasses_mem powers separation hA hE) hK included + +end GroundBelow + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem externalGroupCarrier_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {G S m one K : ZFSet.{u}} + (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (omegaBelow : ZFSet.omega ∈ K) (alphabet : GroundBelow M (externalGeneratorAlphabet G S) K) : + GroundBelow M (M.externalGroupCarrier G S m one) K := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet + have hRelation := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm hOne + exact GroundBelow.equivalenceClasses pairing unions powers separation hWords hRelation hK strong + (GroundBelow.finiteWords pairing unions powers separation infinite hAlphabet hK ordinal strong omegaBelow alphabet) + +end TransitiveGround +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +include pairing unions powers separation hK conditions + +theorem externalRectangleBound_below {P G : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (smallP : GroundBelow M P K) (smallG : GroundBelow M G K) : + GroundBelow M (externalRectangleBound P G) K := by + have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK + exact (product ⟨hP, smallP⟩ (product ⟨hP, smallP⟩ + (product ⟨hP, smallP⟩ (product ⟨hG, smallG⟩ ⟨hG, smallG⟩)))).2 + +theorem externalRectangles_below {P G r μ A : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) + (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) + (smallP : GroundBelow M P K) (smallG : GroundBelow M G K) : + GroundBelow M (externalRectangles P G r μ A) K := by + exact (M.externalRectangleBound_below pairing unions powers separation hK conditions hP hG smallP smallG).restrict + separation (M.externalRectangles_mem pairing unions powers separation hP hG hr hμ hA) hK + (fun _ hz => (ZFSet.mem_sep.1 hz).1) + +include infinite choice + +theorem externalRequestCarrier_below {I P Rectangles : ZFSet.{u}} + (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hRectangles : Rectangles ∈ M.sets) + (smallI : GroundBelow M I K) (smallP : GroundBelow M P K) + (smallRectangles : GroundBelow M Rectangles K) : + GroundBelow M (externalRequestCarrier I P Rectangles) K := by + have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK + have join := @GroundInaccessibleConditions.binary_union M K conditions pairing unions powers separation infinite choice hK + have tag := fun n => conditions.singleton pairing unions powers separation infinite hK + (M.natSetCode_mem separation infinite n) + exact (join (join (product (tag 0) ⟨hI, smallI⟩) (product (tag 1) ⟨hP, smallP⟩)) + (product (tag 2) ⟨hRectangles, smallRectangles⟩)).2 + +theorem externalChildLetters_below {I P Rectangles : ZFSet.{u}} + (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hRectangles : Rectangles ∈ M.sets) + (smallI : GroundBelow M I K) (smallP : GroundBelow M P K) + (smallRectangles : GroundBelow M Rectangles K) : + GroundBelow M (externalChildLetters I P Rectangles) K := by + have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK + have join := @GroundInaccessibleConditions.binary_union M K conditions pairing unions powers separation infinite choice hK + have tag := fun n => conditions.singleton pairing unions powers separation infinite hK + (M.natSetCode_mem separation infinite n) + have requests := M.externalRequestCarrier_below pairing unions powers separation infinite choice hK conditions + hI hP hRectangles smallI smallP smallRectangles + exact (join (product ⟨M.externalRequestCarrier_mem pairing unions powers separation hI hP hRectangles, + requests⟩ (tag 0)) (product (product (tag 2) ⟨hRectangles, smallRectangles⟩) (tag 1))).2 + +theorem externalGeneratorAlphabet_below {G S : ZFSet.{u}} + (hG : G ∈ M.sets) (hS : S ∈ M.sets) + (smallG : GroundBelow M G K) (smallS : GroundBelow M S K) : + GroundBelow M (externalGeneratorAlphabet G S) K := by + have product := @GroundInaccessibleConditions.product M K conditions pairing unions powers separation hK + have join := @GroundInaccessibleConditions.binary_union M K conditions pairing unions powers separation infinite choice hK + have tag := fun n => conditions.singleton pairing unions powers separation infinite hK + (M.natSetCode_mem separation infinite n) + exact (join (product (tag 0) ⟨hG, smallG⟩) + (product (tag 1) (product ⟨hS, smallS⟩ (conditions.natural pairing unions powers separation infinite hK 2)))).2 + +theorem externalGroupCarrier_below_of_carriers {G S m one : ZFSet.{u}} + (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) + (smallG : GroundBelow M G K) (smallS : GroundBelow M S K) : + GroundBelow M (M.externalGroupCarrier G S m one) K := + M.externalGroupCarrier_below pairing unions powers separation infinite hG hS hm hOne hK + conditions.1 conditions.2.2.2 conditions.2.1 + (M.externalGeneratorAlphabet_below pairing unions powers separation infinite choice hK conditions hG hS smallG smallS) + +end TransitiveGround + +namespace GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P r μ A K : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hK : K ∈ M.sets) +local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) +local notation "actors" => M.externalGroupCarrier G letters m one +local notation "U" => completion.algebra.union.fields 0 +include data pairing unions powers separation infinite hP hG hK + +theorem externalPointCarrier_below + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (groupSmall : GroundBelow M actors K) (pointsSmall : GroundBelow M U K) : + GroundBelow M (completion.externalPointCarrier P r μ A) K := by + have quotient := data.point_quotient_ground pairing unions powers separation infinite hP hG + have hProduct := M.prod_mem pairing unions powers separation + data.group.carrier_mem (completion.algebra.union.ground 0) + have smallProduct := GroundBelow.product pairing unions powers separation + data.group.carrier_mem (completion.algebra.union.ground 0) hK ordinal strong groupSmall pointsSmall + exact GroundBelow.equivalenceClasses pairing unions powers separation + hProduct quotient.1 hK strong smallProduct + +theorem externalBoundedCarrier_below + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (conditions : GroundInaccessibleConditions M K) + (groupSmall : GroundBelow M actors K) (pointsSmall : GroundBelow M U K) : + GroundBelow M (completion.externalBoundedCarrier P r μ A) K := by + have hQ := (data.point_quotient_ground pairing unions powers separation infinite hP hG).2.2.1 + exact GroundBelow.insert pairing unions powers separation infinite choice hQ hQ hK conditions.2.1 + conditions.1 conditions.2.2.1 conditions.2.2.2 + (data.externalPointCarrier_below pairing unions powers separation infinite hP hG hK + conditions.1 conditions.2.2.2 groupSmall pointsSmall) + +end GroundExternalGeometryInputs + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowFamilies.lean index 785cdafc6d00933a437d462ca4a24b887100c77b..7a76fd131b5327e35dc8db768210912b1c47ee71 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowFamilies.lean @@ -1,53 +1,53 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def groundBelowMembers (R K : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun A => GroundBelow M A K) R - -theorem mem_groundBelowMembers (R K A : ZFSet.{u}) : - A ∈ M.groundBelowMembers R K ↔ A ∈ R ∧ GroundBelow M A K := by - rw [groundBelowMembers, ZFSet.mem_sep] - -theorem groundBelowMembers_mem (separation : SeparationSchema M.sets) - {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) : - M.groundBelowMembers R K ∈ M.sets := by - let params := extend K Fin.elim0 - have selected := M.separation_mem separation (groundBelowFormula 0 1) params - (Fin.cases hK (fun i => Fin.elim0 i)) hR - have equal : ZFSet.sep (fun A => Realize M.sets (groundBelowFormula 0 1) - (extend A params)) R = M.groundBelowMembers R K := by - apply ZFSet.ext - intro A - rw [ZFSet.mem_sep, M.mem_groundBelowMembers] - apply and_congr_right - intro hA - exact M.realize_groundBelowFormula 0 1 _ - (Fin.cases (M.transitive hR hA) (Fin.cases hK (fun i => Fin.elim0 i))) - exact equal ▸ selected - -noncomputable def groundBelowSubsets (B K : ZFSet.{u}) : ZFSet.{u} := - M.groundBelowMembers (M.groundPower B) K - -theorem mem_groundBelowSubsets (B K A : ZFSet.{u}) : - A ∈ M.groundBelowSubsets B K ↔ A ∈ M.sets ∧ A ⊆ B ∧ GroundBelow M A K := by - rw [groundBelowSubsets, M.mem_groundBelowMembers, M.mem_groundPower] - exact and_assoc - -theorem groundBelowSubsets_mem (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) {B K : ZFSet.{u}} - (hB : B ∈ M.sets) (hK : K ∈ M.sets) : M.groundBelowSubsets B K ∈ M.sets := - M.groundBelowMembers_mem separation (M.groundPower_mem powers hB) hK - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def groundBelowMembers (R K : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun A => GroundBelow M A K) R + +theorem mem_groundBelowMembers (R K A : ZFSet.{u}) : + A ∈ M.groundBelowMembers R K ↔ A ∈ R ∧ GroundBelow M A K := by + rw [groundBelowMembers, ZFSet.mem_sep] + +theorem groundBelowMembers_mem (separation : SeparationSchema M.sets) + {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) : + M.groundBelowMembers R K ∈ M.sets := by + let params := extend K Fin.elim0 + have selected := M.separation_mem separation (groundBelowFormula 0 1) params + (Fin.cases hK (fun i => Fin.elim0 i)) hR + have equal : ZFSet.sep (fun A => Realize M.sets (groundBelowFormula 0 1) + (extend A params)) R = M.groundBelowMembers R K := by + apply ZFSet.ext + intro A + rw [ZFSet.mem_sep, M.mem_groundBelowMembers] + apply and_congr_right + intro hA + exact M.realize_groundBelowFormula 0 1 _ + (Fin.cases (M.transitive hR hA) (Fin.cases hK (fun i => Fin.elim0 i))) + exact equal ▸ selected + +noncomputable def groundBelowSubsets (B K : ZFSet.{u}) : ZFSet.{u} := + M.groundBelowMembers (M.groundPower B) K + +theorem mem_groundBelowSubsets (B K A : ZFSet.{u}) : + A ∈ M.groundBelowSubsets B K ↔ A ∈ M.sets ∧ A ⊆ B ∧ GroundBelow M A K := by + rw [groundBelowSubsets, M.mem_groundBelowMembers, M.mem_groundPower] + exact and_assoc + +theorem groundBelowSubsets_mem (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) {B K : ZFSet.{u}} + (hB : B ∈ M.sets) (hK : K ∈ M.sets) : M.groundBelowSubsets B K ∈ M.sets := + M.groundBelowMembers_mem separation (M.groundPower_mem powers hB) hK + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowInitialCompression.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowInitialCompression.lean index f76ee54511a2060af35f1209ea84be7dc5543d91..44257d490ce0a8829655af3c551febae4c8ad35f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowInitialCompression.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBelowInitialCompression.lean @@ -1,418 +1,418 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundUnionSizeWitnesses -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionOrigin - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundBelow -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include pairing unions powers separation choice - -theorem sUnion {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (indices : GroundBelow M R K) (small : ∀ A ∈ R, GroundBelow M A K) : - GroundBelow M R.sUnion K := by - obtain ⟨D, hD, witness⟩ := M.regular_union_embeds_product - pairing unions powers separation choice hR hK ordinal regular indices small - have hDM := M.transitive hK hD - have smallD := GroundBelow.of_member pairing unions powers separation hK hD - have product := GroundBelow.product pairing unions powers separation hR hDM hK ordinal strong indices smallD - exact product.of_embeddable pairing unions powers separation (M.union_mem unions hR) - (M.prod_mem pairing unions powers separation hR hDM) hK witness - -theorem indexed_sUnion {I Q F K : ZFSet.{u}} - (hI : I ∈ M.sets) (hQ : Q ∈ M.sets) (hF : F ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (indices : GroundBelow M I K) (family : ZFSet.IsFunc I Q F) - (small : ∀ i A, ZFSet.pair i A ∈ F → GroundBelow M A K) : - GroundBelow M (relationImage I Q F).sUnion K := by - have hR := M.relationImage_mem separation hI hQ hF - have indexImage := indices.function_image pairing unions powers separation choice hI hQ hK hF family - apply GroundBelow.sUnion pairing unions powers separation choice hR hK ordinal regular strong indexImage - intro A hA - obtain ⟨_, i, _, entry⟩ := (mem_relationImage I Q F A).1 hA - exact small i A entry - -end GroundBelow - -namespace GroundBelow -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) - -theorem of_countable {A : ZFSet.{u}} (omega : ZFSet.omega ∈ K) - (small : M.groundEmbeddable A ZFSet.omega) : GroundBelow M A K := ⟨ZFSet.omega, omega, small⟩ - -include pairing unions powers separation infinite - -theorem singleton {a : ZFSet.{u}} (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) - (ha : a ∈ M.sets) : GroundBelow M ({a} : ZFSet.{u}) K := by - have hEmpty := M.empty_mem ⟨K, hK⟩ - apply of_countable omega - simpa using M.groundEmbeddable_insert pairing unions powers separation infinite hEmpty ha - (M.empty_groundEmbeddable ZFSet.omega ⟨K, hK⟩) - -theorem unorderedPair {a b : ZFSet.{u}} (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) - (ha : a ∈ M.sets) (hb : b ∈ M.sets) : GroundBelow M ({a, b} : ZFSet.{u}) K := by - have hEmpty := M.empty_mem ⟨K, hK⟩ - have first := M.groundEmbeddable_insert pairing unions powers separation infinite hEmpty hb - (M.empty_groundEmbeddable ZFSet.omega ⟨K, hK⟩) - have ground := M.insert_mem pairing unions hb hEmpty - apply of_countable omega - simpa using M.groundEmbeddable_insert pairing unions powers separation infinite ground ha first - -include choice - -theorem binary_union {A B : ZFSet.{u}} - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (first : GroundBelow M A K) (second : GroundBelow M B K) : GroundBelow M (A ∪ B) K := by - have result := sUnion pairing unions powers separation choice (M.unorderedPair_mem pairing hA hB) hK - ordinal regular strong (unorderedPair pairing unions powers separation infinite hK omega hA hB) - (fun X hX => (ZFSet.mem_pair.1 hX).elim (fun equal => equal ▸ first) (fun equal => equal ▸ second)) - simpa only [ZFSet.sUnion_pair] using result - -theorem insert {A a : ZFSet.{u}} - (hA : A ∈ M.sets) (ha : a ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (small : GroundBelow M A K) : GroundBelow M (Insert.insert a A) K := by - have hs : ({a} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ha ha - have result := binary_union pairing unions powers separation infinite choice hs hA hK omega - ordinal regular strong (singleton pairing unions powers separation infinite hK omega ha) small - have equal : ({a} : ZFSet.{u}) ∪ A = Insert.insert a A := by - apply ZFSet.ext - intro x - simp only [ZFSet.mem_union, ZFSet.mem_singleton, ZFSet.mem_insert_iff] - exact equal ▸ result - -end GroundBelow - -namespace GroundBelow -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include pairing unions powers separation choice - -theorem indexedAttachmentDomain {I Qs : ZFSet.{u}} - (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (family : FunctionGraphOn I Qs) (indices : GroundBelow M I K) - (templates : ∀ i Q, ZFSet.pair i Q ∈ Qs → GroundBelow M Q K) : - GroundBelow M (Forcing.indexedAttachmentDomain I Qs) K := by - have hBound := M.union_mem unions (M.union_mem unions hQs) - have hRange := M.relationImage_mem separation hI hBound hQs - have points := GroundBelow.indexed_sUnion pairing unions powers separation choice hI hBound hQs hK - ordinal regular strong indices family.to_isFunc templates - have small := GroundBelow.product pairing unions powers separation hI (M.union_mem unions hRange) - hK ordinal strong indices points - apply small.restrict separation (M.indexedAttachmentDomain_mem pairing unions powers separation hI hQs) hK - intro z hz - obtain ⟨i, hi, q, rfl, Q, entry, hq⟩ := (mem_indexedAttachmentDomain I Qs z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hi, ZFSet.mem_sUnion.2 - ⟨Q, (mem_relationImage I Qs.sUnion.sUnion Qs Q).2 - ⟨pair_second_mem_doubleUnion entry, i, hi, entry⟩, hq⟩⟩ - -theorem indexedAttachmentFresh {I Qs rs As : ZFSet.{u}} - (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (strong : GroundStrongLimit M K) (family : FunctionGraphOn I Qs) (indices : GroundBelow M I K) - (templates : ∀ i Q, ZFSet.pair i Q ∈ Qs → GroundBelow M Q K) : - GroundBelow M (Forcing.indexedAttachmentFresh I Qs rs As) K := - (GroundBelow.indexedAttachmentDomain pairing unions powers separation choice hI hQs hK - ordinal regular strong family indices templates).restrict separation - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) hK - (indexedAttachmentFresh_subset I Qs rs As) - -variable (infinite : Realize M.sets infinity Fin.elim0) -include infinite - -theorem taggedExtension {P N : ZFSet.{u}} - (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (old : GroundBelow M P K) (fresh : GroundBelow M N K) : - GroundBelow M (Forcing.taggedExtension P N) K := by - have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - exact GroundBelow.binary_union pairing unions powers separation infinite choice hP - (M.prod_mem pairing unions powers separation hSingle hN) hK omega ordinal regular strong old - (GroundBelow.product pairing unions powers separation hSingle hN hK ordinal strong - (GroundBelow.singleton pairing unions powers separation infinite hK omega hP) fresh) - -theorem batchCarrier {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) - (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) - (old : GroundBelow M P K) (indices : GroundBelow M I K) - (templates : ∀ i Q, ZFSet.pair i Q ∈ Qs → GroundBelow M Q K) : - GroundBelow M d.batchCarrier K := - GroundBelow.taggedExtension pairing unions powers separation choice infinite hP - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) - hK omega ordinal regular strong old - (GroundBelow.indexedAttachmentFresh pairing unions powers separation choice hI hQs hrs hAs hK - ordinal regular strong d.spaces indices templates) - -end GroundBelow - -namespace GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include pairing unions powers separation infinite choice - -theorem currentCarrier_below {P r μ K : ZFSet.{u}} - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (constant : RecursiveTemplateConstancy P r μ state.data) - (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) - (indices : GroundBelow M state.data.J K) : GroundBelow M state.data.currentCarrier K := by - apply GroundBelow.batchCarrier pairing unions powers separation choice infinite state.batch - state.ground.carrier state.ground.indices state.ground.spaces state.ground.relations state.ground.anchors - hK conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 old indices - intro i Q entry - obtain rfl := ((constant.space_entry_iff i Q).1 entry).2 - exact templates - -theorem canonical_iterate_below - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (constant : RecursiveTemplateConstancy P r μ state.data) - (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) - (indices : GroundBelow M state.data.J K) (tasks : GroundBelow M I K) (n : Nat) : - GroundBelow M (state.data.iterate M I Sources Reps G T n).D K ∧ - GroundBelow M (state.data.iterate M I Sources Reps G T n).J K := by - induction n with - | zero => exact ⟨old, indices⟩ - | succ n ih => - obtain ⟨current, equal⟩ := state.canonical_iterate_valid - pairing unions powers separation hI hSources hReps hG hT n - have currentOld : GroundBelow M current.data.D K := by rw [equal]; exact ih.1 - have currentIndices : GroundBelow M current.data.J K := by rw [equal]; exact ih.2 - have currentConstant : RecursiveTemplateConstancy P r μ current.data := by - rw [equal] - exact constant.iterate M I Sources Reps G T n - rw [RecursiveStateData.iterate_succ, ← equal] - change GroundBelow M current.data.currentCarrier K ∧ - GroundBelow M (recursiveAttachmentIndices I current.data.J current.data.D - current.data.Fs.sUnion.sUnion Sources current.data.Fs) K - refine ⟨current.currentCarrier_below pairing unions powers separation infinite choice - hK conditions currentConstant templates currentOld currentIndices, ?_⟩ - have bound := GroundBelow.product pairing unions powers separation hI current.ground.indices hK - conditions.1 conditions.2.2.2 tasks currentIndices - exact bound.restrict separation - (M.recursiveAttachmentIndices_mem pairing unions powers separation hI current.ground.indices - current.ground.carrier (M.union_mem unions (M.union_mem unions current.ground.filters)) - hSources current.ground.filters) hK (recursiveAttachmentIndices_subset _ _ _ _ _ _) - -theorem canonical_currentCarrier_below - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (constant : RecursiveTemplateConstancy P r μ state.data) - (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) - (indices : GroundBelow M state.data.J K) (tasks : GroundBelow M I K) (n : Nat) : - GroundBelow M (state.data.iterate M I Sources Reps G T n).currentCarrier K := - (state.canonical_iterate_below pairing unions powers separation infinite choice - hI hSources hReps hG hT hK conditions constant templates old indices tasks (n + 1)).1 - -end GroundCompressionState - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem initialCompressionData_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels K : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) - (meet : MeetOrderCode P r μ) (conditions : GroundInaccessibleConditions M K) - (points : GroundBelow M P K) (labels : GroundBelow M Labels K) : - GroundBelow M (M.initialCompressionData P G r μ A Labels).currentCarrier K := by - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - have hSources : Sources ∈ M.sets := (fields 0).1 - have indices := M.groundEligibleTasks_below pairing unions powers separation - hP hG hr hμ hA hLabels hK meet conditions.1 conditions.2.2.2 points labels - have fresh : GroundBelow M - (indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) Sources) K := by - apply GroundBelow.indexedAttachmentFresh pairing unions powers separation choice hI hQs hrs hSources hK - conditions.1 conditions.2.2.1 conditions.2.2.2 - ⟨_, constantFamilyGraph_function I P⟩ indices - intro i Q entry - obtain rfl := ((pair_mem_constantFamilyGraph I P i Q).1 entry).2 - exact points - exact GroundBelow.taggedExtension pairing unions powers separation choice infinite hP - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hSources) - hK conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 points fresh - -end TransitiveGround - -open SetFormula -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem history_field_union_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K history U : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (hHistory : history ∈ M.sets) (states : Nat → RecursiveStateData.{u}) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = (states n).code) - (j : Fin 13) (small : ∀ n, GroundBelow M ((states n).field j) K) - (code : NatUnionCode (fun n => (states n).field j) U) : GroundBelow M U K := by - have hOmega := M.omega_mem separation infinite - obtain ⟨family, hFamily, function, actual⟩ := M.exists_groundStateFieldFamily - pairing separation collection hOmega hHistory states entries j - have hBound := M.union_mem unions (M.union_mem unions hFamily) - have sizes : ∀ i A, ZFSet.pair i A ∈ family → GroundBelow M A K := by - intro i A entry - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 (function.pair_source entry) - rw [(actual n A).1 entry] - exact small n - have bound := GroundBelow.indexed_sUnion pairing unions powers separation choice hOmega hBound hFamily hK - conditions.1 conditions.2.2.1 conditions.2.2.2 - (GroundBelow.of_member pairing unions powers separation hK conditions.2.1) function.to_isFunc sizes - have same : U = (relationImage ZFSet.omega family.sUnion.sUnion family).sUnion := by - apply ZFSet.ext - intro x - rw [code x, ZFSet.mem_sUnion] - constructor - · rintro ⟨n, hx⟩ - have entry := (actual n ((states n).field j)).2 rfl - exact ⟨(states n).field j, - (mem_relationImage _ _ _ _).2 - ⟨pair_second_mem_doubleUnion entry, natSetCode n, natSetCode_mem_omega n, entry⟩, hx⟩ - · rintro ⟨A, hA, hx⟩ - obtain ⟨_, i, hi, entry⟩ := (mem_relationImage _ _ _ _).1 hA - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 hi - refine ⟨n, ?_⟩ - change x ∈ (states n).field j - exact (actual n A).1 entry ▸ hx - exact same.symm ▸ bound - -end TransitiveGround - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem union_below (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (constant : RecursiveTemplateConstancy P r μ state.data) - (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) - (indices : GroundBelow M state.data.J K) (tasks : GroundBelow M I K) : - GroundBelow M (data.fields 0) K := by - obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT - exact M.history_field_union_below pairing unions powers separation collection infinite choice - hK conditions hHistory (state.data.iterate M I Sources Reps G T) entries 0 - (fun n => (state.canonical_iterate_below pairing unions powers separation infinite choice - hI hSources hReps hG hT hK conditions constant templates old indices tasks n).1) - (data.fieldUnion 0) - -end GroundCompressionState - -namespace GroundCompressionOrigin -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) - -include origin in -theorem union_below (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (constant : RecursiveTemplateConstancy P r μ initial) - (templates : GroundBelow M P K) (old : GroundBelow M initial.D K) - (indices : GroundBelow M initial.J K) (tasks : GroundBelow M I K) : - GroundBelow M (data.fields 0) K := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - exact state.union_below data pairing unions powers separation collection infinite choice - hI hSources hReps hG hT hK conditions constant templates old indices tasks - -end GroundCompressionOrigin - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem initialCompressionUnion_below - {P G r μ A Labels τ Sources Reps m inv one T Filters K : ZFSet.{u}} - (origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ (M.groundEligibleTasks P G r μ A Labels) Sources Reps G m inv one T Filters) - (data : GroundCompressionUnionData M (M.initialCompressionData P G r μ A Labels) - (M.groundEligibleTasks P G r μ A Labels) Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hSources : Sources ∈ M.sets) - (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) (hK : K ∈ M.sets) - (meet : MeetOrderCode P r μ) (conditions : GroundInaccessibleConditions M K) - (points : GroundBelow M P K) (labels : GroundBelow M Labels K) : - GroundBelow M (data.fields 0) K := by - have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet - have tasks := M.groundEligibleTasks_below pairing unions powers separation - hP hG hr hμ hA hLabels hK meet conditions.1 conditions.2.2.2 points labels - exact origin.union_below data pairing unions powers separation collection infinite choice - hI hSources hReps hG hT hK conditions - (M.initialCompressionData_template_constancy P G r μ A Labels) points points tasks tasks - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundUnionSizeWitnesses +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionOrigin + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundBelow +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include pairing unions powers separation choice + +theorem sUnion {R K : ZFSet.{u}} (hR : R ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (indices : GroundBelow M R K) (small : ∀ A ∈ R, GroundBelow M A K) : + GroundBelow M R.sUnion K := by + obtain ⟨D, hD, witness⟩ := M.regular_union_embeds_product + pairing unions powers separation choice hR hK ordinal regular indices small + have hDM := M.transitive hK hD + have smallD := GroundBelow.of_member pairing unions powers separation hK hD + have product := GroundBelow.product pairing unions powers separation hR hDM hK ordinal strong indices smallD + exact product.of_embeddable pairing unions powers separation (M.union_mem unions hR) + (M.prod_mem pairing unions powers separation hR hDM) hK witness + +theorem indexed_sUnion {I Q F K : ZFSet.{u}} + (hI : I ∈ M.sets) (hQ : Q ∈ M.sets) (hF : F ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (indices : GroundBelow M I K) (family : ZFSet.IsFunc I Q F) + (small : ∀ i A, ZFSet.pair i A ∈ F → GroundBelow M A K) : + GroundBelow M (relationImage I Q F).sUnion K := by + have hR := M.relationImage_mem separation hI hQ hF + have indexImage := indices.function_image pairing unions powers separation choice hI hQ hK hF family + apply GroundBelow.sUnion pairing unions powers separation choice hR hK ordinal regular strong indexImage + intro A hA + obtain ⟨_, i, _, entry⟩ := (mem_relationImage I Q F A).1 hA + exact small i A entry + +end GroundBelow + +namespace GroundBelow +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) + +theorem of_countable {A : ZFSet.{u}} (omega : ZFSet.omega ∈ K) + (small : M.groundEmbeddable A ZFSet.omega) : GroundBelow M A K := ⟨ZFSet.omega, omega, small⟩ + +include pairing unions powers separation infinite + +theorem singleton {a : ZFSet.{u}} (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) + (ha : a ∈ M.sets) : GroundBelow M ({a} : ZFSet.{u}) K := by + have hEmpty := M.empty_mem ⟨K, hK⟩ + apply of_countable omega + simpa using M.groundEmbeddable_insert pairing unions powers separation infinite hEmpty ha + (M.empty_groundEmbeddable ZFSet.omega ⟨K, hK⟩) + +theorem unorderedPair {a b : ZFSet.{u}} (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) + (ha : a ∈ M.sets) (hb : b ∈ M.sets) : GroundBelow M ({a, b} : ZFSet.{u}) K := by + have hEmpty := M.empty_mem ⟨K, hK⟩ + have first := M.groundEmbeddable_insert pairing unions powers separation infinite hEmpty hb + (M.empty_groundEmbeddable ZFSet.omega ⟨K, hK⟩) + have ground := M.insert_mem pairing unions hb hEmpty + apply of_countable omega + simpa using M.groundEmbeddable_insert pairing unions powers separation infinite ground ha first + +include choice + +theorem binary_union {A B : ZFSet.{u}} + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (first : GroundBelow M A K) (second : GroundBelow M B K) : GroundBelow M (A ∪ B) K := by + have result := sUnion pairing unions powers separation choice (M.unorderedPair_mem pairing hA hB) hK + ordinal regular strong (unorderedPair pairing unions powers separation infinite hK omega hA hB) + (fun X hX => (ZFSet.mem_pair.1 hX).elim (fun equal => equal ▸ first) (fun equal => equal ▸ second)) + simpa only [ZFSet.sUnion_pair] using result + +theorem insert {A a : ZFSet.{u}} + (hA : A ∈ M.sets) (ha : a ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (small : GroundBelow M A K) : GroundBelow M (Insert.insert a A) K := by + have hs : ({a} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ha ha + have result := binary_union pairing unions powers separation infinite choice hs hA hK omega + ordinal regular strong (singleton pairing unions powers separation infinite hK omega ha) small + have equal : ({a} : ZFSet.{u}) ∪ A = Insert.insert a A := by + apply ZFSet.ext + intro x + simp only [ZFSet.mem_union, ZFSet.mem_singleton, ZFSet.mem_insert_iff] + exact equal ▸ result + +end GroundBelow + +namespace GroundBelow +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include pairing unions powers separation choice + +theorem indexedAttachmentDomain {I Qs : ZFSet.{u}} + (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (family : FunctionGraphOn I Qs) (indices : GroundBelow M I K) + (templates : ∀ i Q, ZFSet.pair i Q ∈ Qs → GroundBelow M Q K) : + GroundBelow M (Forcing.indexedAttachmentDomain I Qs) K := by + have hBound := M.union_mem unions (M.union_mem unions hQs) + have hRange := M.relationImage_mem separation hI hBound hQs + have points := GroundBelow.indexed_sUnion pairing unions powers separation choice hI hBound hQs hK + ordinal regular strong indices family.to_isFunc templates + have small := GroundBelow.product pairing unions powers separation hI (M.union_mem unions hRange) + hK ordinal strong indices points + apply small.restrict separation (M.indexedAttachmentDomain_mem pairing unions powers separation hI hQs) hK + intro z hz + obtain ⟨i, hi, q, rfl, Q, entry, hq⟩ := (mem_indexedAttachmentDomain I Qs z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hi, ZFSet.mem_sUnion.2 + ⟨Q, (mem_relationImage I Qs.sUnion.sUnion Qs Q).2 + ⟨pair_second_mem_doubleUnion entry, i, hi, entry⟩, hq⟩⟩ + +theorem indexedAttachmentFresh {I Qs rs As : ZFSet.{u}} + (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (strong : GroundStrongLimit M K) (family : FunctionGraphOn I Qs) (indices : GroundBelow M I K) + (templates : ∀ i Q, ZFSet.pair i Q ∈ Qs → GroundBelow M Q K) : + GroundBelow M (Forcing.indexedAttachmentFresh I Qs rs As) K := + (GroundBelow.indexedAttachmentDomain pairing unions powers separation choice hI hQs hK + ordinal regular strong family indices templates).restrict separation + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) hK + (indexedAttachmentFresh_subset I Qs rs As) + +variable (infinite : Realize M.sets infinity Fin.elim0) +include infinite + +theorem taggedExtension {P N : ZFSet.{u}} + (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (old : GroundBelow M P K) (fresh : GroundBelow M N K) : + GroundBelow M (Forcing.taggedExtension P N) K := by + have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + exact GroundBelow.binary_union pairing unions powers separation infinite choice hP + (M.prod_mem pairing unions powers separation hSingle hN) hK omega ordinal regular strong old + (GroundBelow.product pairing unions powers separation hSingle hN hK ordinal strong + (GroundBelow.singleton pairing unions powers separation infinite hK omega hP) fresh) + +theorem batchCarrier {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) + (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ K) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) (strong : GroundStrongLimit M K) + (old : GroundBelow M P K) (indices : GroundBelow M I K) + (templates : ∀ i Q, ZFSet.pair i Q ∈ Qs → GroundBelow M Q K) : + GroundBelow M d.batchCarrier K := + GroundBelow.taggedExtension pairing unions powers separation choice infinite hP + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) + hK omega ordinal regular strong old + (GroundBelow.indexedAttachmentFresh pairing unions powers separation choice hI hQs hrs hAs hK + ordinal regular strong d.spaces indices templates) + +end GroundBelow + +namespace GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include pairing unions powers separation infinite choice + +theorem currentCarrier_below {P r μ K : ZFSet.{u}} + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (constant : RecursiveTemplateConstancy P r μ state.data) + (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) + (indices : GroundBelow M state.data.J K) : GroundBelow M state.data.currentCarrier K := by + apply GroundBelow.batchCarrier pairing unions powers separation choice infinite state.batch + state.ground.carrier state.ground.indices state.ground.spaces state.ground.relations state.ground.anchors + hK conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 old indices + intro i Q entry + obtain rfl := ((constant.space_entry_iff i Q).1 entry).2 + exact templates + +theorem canonical_iterate_below + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (constant : RecursiveTemplateConstancy P r μ state.data) + (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) + (indices : GroundBelow M state.data.J K) (tasks : GroundBelow M I K) (n : Nat) : + GroundBelow M (state.data.iterate M I Sources Reps G T n).D K ∧ + GroundBelow M (state.data.iterate M I Sources Reps G T n).J K := by + induction n with + | zero => exact ⟨old, indices⟩ + | succ n ih => + obtain ⟨current, equal⟩ := state.canonical_iterate_valid + pairing unions powers separation hI hSources hReps hG hT n + have currentOld : GroundBelow M current.data.D K := by rw [equal]; exact ih.1 + have currentIndices : GroundBelow M current.data.J K := by rw [equal]; exact ih.2 + have currentConstant : RecursiveTemplateConstancy P r μ current.data := by + rw [equal] + exact constant.iterate M I Sources Reps G T n + rw [RecursiveStateData.iterate_succ, ← equal] + change GroundBelow M current.data.currentCarrier K ∧ + GroundBelow M (recursiveAttachmentIndices I current.data.J current.data.D + current.data.Fs.sUnion.sUnion Sources current.data.Fs) K + refine ⟨current.currentCarrier_below pairing unions powers separation infinite choice + hK conditions currentConstant templates currentOld currentIndices, ?_⟩ + have bound := GroundBelow.product pairing unions powers separation hI current.ground.indices hK + conditions.1 conditions.2.2.2 tasks currentIndices + exact bound.restrict separation + (M.recursiveAttachmentIndices_mem pairing unions powers separation hI current.ground.indices + current.ground.carrier (M.union_mem unions (M.union_mem unions current.ground.filters)) + hSources current.ground.filters) hK (recursiveAttachmentIndices_subset _ _ _ _ _ _) + +theorem canonical_currentCarrier_below + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (constant : RecursiveTemplateConstancy P r μ state.data) + (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) + (indices : GroundBelow M state.data.J K) (tasks : GroundBelow M I K) (n : Nat) : + GroundBelow M (state.data.iterate M I Sources Reps G T n).currentCarrier K := + (state.canonical_iterate_below pairing unions powers separation infinite choice + hI hSources hReps hG hT hK conditions constant templates old indices tasks (n + 1)).1 + +end GroundCompressionState + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem initialCompressionData_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels K : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) + (meet : MeetOrderCode P r μ) (conditions : GroundInaccessibleConditions M K) + (points : GroundBelow M P K) (labels : GroundBelow M Labels K) : + GroundBelow M (M.initialCompressionData P G r μ A Labels).currentCarrier K := by + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + have hSources : Sources ∈ M.sets := (fields 0).1 + have indices := M.groundEligibleTasks_below pairing unions powers separation + hP hG hr hμ hA hLabels hK meet conditions.1 conditions.2.2.2 points labels + have fresh : GroundBelow M + (indexedAttachmentFresh I (constantFamilyGraph I P) (constantFamilyGraph I r) Sources) K := by + apply GroundBelow.indexedAttachmentFresh pairing unions powers separation choice hI hQs hrs hSources hK + conditions.1 conditions.2.2.1 conditions.2.2.2 + ⟨_, constantFamilyGraph_function I P⟩ indices + intro i Q entry + obtain rfl := ((pair_mem_constantFamilyGraph I P i Q).1 entry).2 + exact points + exact GroundBelow.taggedExtension pairing unions powers separation choice infinite hP + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hSources) + hK conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 points fresh + +end TransitiveGround + +open SetFormula +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem history_field_union_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K history U : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (hHistory : history ∈ M.sets) (states : Nat → RecursiveStateData.{u}) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = (states n).code) + (j : Fin 13) (small : ∀ n, GroundBelow M ((states n).field j) K) + (code : NatUnionCode (fun n => (states n).field j) U) : GroundBelow M U K := by + have hOmega := M.omega_mem separation infinite + obtain ⟨family, hFamily, function, actual⟩ := M.exists_groundStateFieldFamily + pairing separation collection hOmega hHistory states entries j + have hBound := M.union_mem unions (M.union_mem unions hFamily) + have sizes : ∀ i A, ZFSet.pair i A ∈ family → GroundBelow M A K := by + intro i A entry + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 (function.pair_source entry) + rw [(actual n A).1 entry] + exact small n + have bound := GroundBelow.indexed_sUnion pairing unions powers separation choice hOmega hBound hFamily hK + conditions.1 conditions.2.2.1 conditions.2.2.2 + (GroundBelow.of_member pairing unions powers separation hK conditions.2.1) function.to_isFunc sizes + have same : U = (relationImage ZFSet.omega family.sUnion.sUnion family).sUnion := by + apply ZFSet.ext + intro x + rw [code x, ZFSet.mem_sUnion] + constructor + · rintro ⟨n, hx⟩ + have entry := (actual n ((states n).field j)).2 rfl + exact ⟨(states n).field j, + (mem_relationImage _ _ _ _).2 + ⟨pair_second_mem_doubleUnion entry, natSetCode n, natSetCode_mem_omega n, entry⟩, hx⟩ + · rintro ⟨A, hA, hx⟩ + obtain ⟨_, i, hi, entry⟩ := (mem_relationImage _ _ _ _).1 hA + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 hi + refine ⟨n, ?_⟩ + change x ∈ (states n).field j + exact (actual n A).1 entry ▸ hx + exact same.symm ▸ bound + +end TransitiveGround + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem union_below (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (constant : RecursiveTemplateConstancy P r μ state.data) + (templates : GroundBelow M P K) (old : GroundBelow M state.data.D K) + (indices : GroundBelow M state.data.J K) (tasks : GroundBelow M I K) : + GroundBelow M (data.fields 0) K := by + obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT + exact M.history_field_union_below pairing unions powers separation collection infinite choice + hK conditions hHistory (state.data.iterate M I Sources Reps G T) entries 0 + (fun n => (state.canonical_iterate_below pairing unions powers separation infinite choice + hI hSources hReps hG hT hK conditions constant templates old indices tasks n).1) + (data.fieldUnion 0) + +end GroundCompressionState + +namespace GroundCompressionOrigin +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) + +include origin in +theorem union_below (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {P r μ K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (constant : RecursiveTemplateConstancy P r μ initial) + (templates : GroundBelow M P K) (old : GroundBelow M initial.D K) + (indices : GroundBelow M initial.J K) (tasks : GroundBelow M I K) : + GroundBelow M (data.fields 0) K := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + exact state.union_below data pairing unions powers separation collection infinite choice + hI hSources hReps hG hT hK conditions constant templates old indices tasks + +end GroundCompressionOrigin + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem initialCompressionUnion_below + {P G r μ A Labels τ Sources Reps m inv one T Filters K : ZFSet.{u}} + (origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ (M.groundEligibleTasks P G r μ A Labels) Sources Reps G m inv one T Filters) + (data : GroundCompressionUnionData M (M.initialCompressionData P G r μ A Labels) + (M.groundEligibleTasks P G r μ A Labels) Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hSources : Sources ∈ M.sets) + (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) (hK : K ∈ M.sets) + (meet : MeetOrderCode P r μ) (conditions : GroundInaccessibleConditions M K) + (points : GroundBelow M P K) (labels : GroundBelow M Labels K) : + GroundBelow M (data.fields 0) K := by + have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet + have tasks := M.groundEligibleTasks_below pairing unions powers separation + hP hG hr hμ hA hLabels hK meet conditions.1 conditions.2.2.2 points labels + exact origin.union_below data pairing unions powers separation collection infinite choice + hI hSources hReps hG hT hK conditions + (M.initialCompressionData_template_constancy P G r μ A Labels) points points tasks tasks + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRowRecordedPreparationBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRowRecordedPreparationBounds.lean index df7958a050070f9a0075de73e6f474fb09004f50..98c2c6bb20a3f5a354fcb3efaa90d2f2459471a6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRowRecordedPreparationBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRowRecordedPreparationBounds.lean @@ -1,447 +1,447 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainFinalSemanticStructuralZF -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecordedPreparationSupportInclusions -import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoSupportData - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] -variable (s : Presentation L) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include pairing unions powers separation collection infinite choice hL order hC directed countable_bound - -theorem binaryRowDataSelection {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (I anchors : ZFSet.{u}), - I ∈ M.sets → anchors ∈ M.sets → ZFSet.IsFunc I s.carrier anchors → - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - A ∈ M.groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega → - ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → - M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, - ZFSet.IsFunc A s.carrier f ∧ - f ⊆ stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ - W = (relationImage A s.carrier f ∪ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ - W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ - (∀ x : L, s.encode x ∈ W → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ x : L, s.encode x ∈ extra → x ≤ D) := by - intro c rows S T valid lifted tuples hLifted I anchors hI hAnchors anchorFunction p A member extra hExtra extraSubset smallExtra - have nonbottom := M.nonbottom_carrier_mem s separation hL - have hS := M.rowPositionSequences_mem pairing unions powers separation hL order nonbottom hmu - have hTuples := M.binaryLiftedRowTupleFamily_mem pairing unions powers separation collection infinite - hL order nonbottom hC hmu one valid - obtain ⟨hA,subset,smallA⟩ := (M.mem_groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega A).1 member - have whole := M.stageOneDataBounds_mem pairing unions powers separation hA hI hLifted hS hL - hmu nonbottom order hAnchors hTuples - have total := stageOneDataBounds_total s directed subset anchorFunction - (liftedRowTupleFamily_surjective c (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun f hf => by - obtain ⟨D,hD,bound⟩ := M.rowPositionSequence_bound hf - obtain ⟨D,rfl⟩ := (s.mem_carrier D).1 hD - exact ⟨D,bound⟩) - obtain ⟨hUsed,smallUsed⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation - infinite choice nonbottom hC (M.natSetCode_mem separation infinite 2) (SetMembers.raw_mem p) - have usedSubset : rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) ⊆ s.carrier := by - intro x hx - exact ((s.mem_nonbottom_carrier x).1 (rowUsedRows_subset _ _ _ _ hx)).1 - exact M.exists_stageOneDataBound s pairing unions powers separation infinite choice hA hL whole smallA total - hUsed hExtra usedSubset extraSubset smallUsed smallExtra countable_bound - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) -local notation "I" => refinementDataHistoryIndices stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) - -theorem structuralIndex_anchor_fields {x : ZFSet.{u}} (member : x ∈ I) : - ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v 2 ∈ nodes := by - obtain ⟨level, _hl, data, entry, hx⟩ := (mem_refinementDataHistoryIndices _ _ _).1 member - obtain ⟨_, P, order, top, action, _stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - obtain ⟨v, equal, bounds⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hx - exact ⟨v, equal, bounds 2⟩ - -theorem structuralIndexAnchors_function : - ZFSet.IsFunc I nodes (refinementIndexFieldGraph I nodes 2) := - refinementIndexFieldGraph_function I nodes 2 - (fun _ member => M.structuralIndex_anchor_fields G nodes nodeOrder basis T T2 stages history member) - -include M in - theorem structuralIndexAnchorData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) - (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hs : stages ∈ M.sets) (hh : history ∈ M.sets) : - I ∈ M.sets ∧ refinementIndexFieldGraph I nodes 2 ∈ M.sets ∧ - ZFSet.IsFunc I nodes (refinementIndexFieldGraph I nodes 2) := by - have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![G, nodes, nodeOrder, basis, T, T2, stages, history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb - (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have indices := M.refinementDataHistoryIndices_mem pairing unions powers separation hs packed - exact ⟨indices, M.refinementIndexFieldGraph_mem pairing unions powers separation indices hn 2, - M.structuralIndexAnchors_function G nodes nodeOrder basis T T2 stages history⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] -variable (s : Presentation L) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include pairing unions powers separation collection infinite choice hL order hC directed countable_bound - -theorem binaryRowStructuralDataSelection {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), - G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → - let I := refinementDataHistoryIndices stages - (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) - let anchors := refinementIndexFieldGraph I s.carrier 2 - - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - A ∈ M.groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega → - ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → - M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, - ZFSet.IsFunc A s.carrier f ∧ - f ⊆ stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ - W = (relationImage A s.carrier f ∪ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ - W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ - (∀ x : L, s.encode x ∈ W → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ x : L, s.encode x ∈ extra → x ≤ D) := by - intro c rows S T valid lifted tuples hLifted G basis T2 stages history hG hb hT2 hs hh I anchors - p A member extra hExtra extraSubset extraSmall - obtain ⟨indexGround, anchorGround, anchorFunction⟩ := - M.structuralIndexAnchorData G s.carrier s.conditionOrder basis lifted T2 stages history - pairing unions powers separation collection hG hL order hb hLifted hT2 hs hh - exact M.binaryRowDataSelection s C pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu one valid hLifted I anchors indexGround anchorGround - anchorFunction p A member extra hExtra extraSubset extraSmall - -theorem binaryRowStructuralConditionDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), - G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → - let I := refinementDataHistoryIndices stages - (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) - let anchors := refinementIndexFieldGraph I s.carrier 2 - - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - ZFSet.pair (c.encode p) A ∈ - M.structuralForcingCarrier c.carrier G s.carrier s.conditionOrder basis lifted T2 stages history → - ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → - M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : L, s.encode x ∈ extra → x ≤ D) := by - intro c rows S T valid lifted tuples hLifted G basis T2 stages history hG hb hT2 hs hh I anchors - p A member extra hExtra extraSubset extraSmall - have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages - (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) - (ZFSet.pair (c.encode p) A)).1 member |>.1 - have small := (ZFSet.pair_mem_prod.1 candidate).2 - obtain ⟨D, _f, _hf, _W, _hW, _function, _selected, _equal, _subset, _small, _bound, - bounds, usedBound, extraBound⟩ := - M.binaryRowStructuralDataSelection s C pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu one valid hLifted G basis T2 stages history - hG hb hT2 hs hh p A small extra hExtra extraSubset extraSmall - exact ⟨D, usedBound, bounds, extraBound⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] -variable (s : Presentation L) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include pairing unions powers separation collection infinite choice hL order hC directed countable_bound - -theorem binaryRowRecordedPreparationConditionDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), - G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → - let I := refinementDataHistoryIndices stages - (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) - let anchors := refinementIndexFieldGraph I s.carrier 2 - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - ZFSet.pair (c.encode p) A ∈ - M.structuralForcingCarrier c.carrier G s.carrier s.conditionOrder basis lifted T2 stages history → - ∀ E events : ZFSet.{u}, E ∈ M.sets → ZFSet.IsFunc ZFSet.omega E events → - let recorded := M.preparationUsedSupportUnion s.carrier E events - recorded ∈ M.sets → M.groundEmbeddable recorded ZFSet.omega → - ∀ extra : ZFSet.{u}, extra ∈ M.sets → extra ⊆ s.carrier → - M.groundEmbeddable extra ZFSet.omega → - (recorded ∪ extra) ∈ M.sets ∧ (recorded ∪ extra) ⊆ s.carrier ∧ - M.groundEmbeddable (recorded ∪ extra) ZFSet.omega ∧ - ∃ D : L, - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : L, s.encode x ∈ recorded ∪ extra → x ≤ D) := by - intro c rows S T valid lifted tuples hLifted G basis T2 stages history hG hb hT2 hs hh I anchors - p A member E events hE function recorded hRecorded smallRecorded extra hExtra extraSubset smallExtra - have recordedSubset : recorded ⊆ s.carrier := by - intro v hv - exact ((M.mem_preparationUsedSupportUnion separation hL hE function v).1 hv).1 - have combinedGround := M.binary_union_mem pairing unions hRecorded hExtra - have combinedSubset : recorded ∪ extra ⊆ s.carrier := by - intro v hv - exact (ZFSet.mem_union.1 hv).elim (fun h => recordedSubset h) (fun h => extraSubset h) - have combinedSmall := M.groundCountable_binary_union pairing unions powers separation infinite choice - hRecorded hExtra smallRecorded smallExtra - obtain ⟨D, usedBound, dataBound, combinedBound⟩ := - M.binaryRowStructuralConditionDataBound s C pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu one valid hLifted G basis T2 stages history - hG hb hT2 hs hh p A member (recorded ∪ extra) combinedGround combinedSubset combinedSmall - exact ⟨combinedGround, combinedSubset, combinedSmall, D, usedBound, dataBound, combinedBound⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowSemanticStructuralBoundHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - (∀ z ∈ lifted, IsName c.pairEmpty z) ∧ (∀ z ∈ squared, IsName c.pairEmpty z) ∧ - (∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) ∧ - (∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) ∧ - (∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) ∧ - (∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) ∧ - ∀ stages ∈ M.sets, ordinalSetProperty stages → ∃ history ∈ M.sets, - OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history ∧ - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted stages - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared stages P order top action ∧ - let J := refinementDataHistoryIndices stages - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history) - let anchors := refinementIndexFieldGraph J s.carrier 2 - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - ZFSet.pair (c.encode p) A ∈ - M.structuralForcingCarrier c.carrier b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history → - ∀ extra ∈ M.sets, extra ⊆ s.carrier → M.groundEmbeddable extra ZFSet.omega → - ∃ E : SetMembers geometry.carrier, ∃ f ∈ M.sets, ∃ W ∈ M.sets, - ZFSet.IsFunc A s.carrier f ∧ - f ⊆ stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ - W = (relationImage A s.carrier f ∪ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ - W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ - (∀ x : SetMembers geometry.carrier, s.encode x ∈ W → x ≤ E) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode E) ∈ - stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : SetMembers geometry.carrier, - s.encode x ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → x ≤ E) ∧ - (∀ x : SetMembers geometry.carrier, s.encode x ∈ extra → x ≤ E) := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground order action - have countableBound := geometry.decoded_countable_bound - (fun W hW subset small => (fulfilled.countable_localization W hW subset small).2) - have original := fulfilled.exists_rowSemanticStructuralFinalHistory collection infinite choice hK standard indices - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := original - obtain ⟨hLifted, hSquared, hGraph, injection, valid1, valid2, - closed1, closed2, children1, children2, histories⟩ := data - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, hGraph, injection, valid1, valid2, - closed1, closed2, children1, children2, ?_⟩ - intro stages hStages ordinal - obtain ⟨history, hHistory, trace, hPacked, historyRun, witnesses, - P, stageOrder, top, stageAction, code, fields, witness⟩ := histories stages hStages ordinal - refine ⟨history, hHistory, trace, hPacked, historyRun, witnesses, - P, stageOrder, top, stageAction, code, fields, witness, ?_⟩ - intro p A member extra hExtra extraSubset extraSmall - have candidate := (M.mem_refinementHistoryForcing c.carrier _ stages _ - (ZFSet.pair (c.encode p) A)).1 member |>.1 - have small := (ZFSet.pair_mem_prod.1 candidate).2 - exact M.binaryRowStructuralDataSelection s columns pairing unions powers separation collection infinite choice - geometry.carrier_ground order hColumns directed countableBound hmu ⊤ valid hLifted - b.carrier (supportBasisCode s b a.principalFix) _ stages history - geometry.actors_ground supports hSquared hStages hHistory p A small extra hExtra extraSubset extraSmall - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainFinalSemanticStructuralZF +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecordedPreparationSupportInclusions +import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoSupportData + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] +variable (s : Presentation L) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include pairing unions powers separation collection infinite choice hL order hC directed countable_bound + +theorem binaryRowDataSelection {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (I anchors : ZFSet.{u}), + I ∈ M.sets → anchors ∈ M.sets → ZFSet.IsFunc I s.carrier anchors → + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + A ∈ M.groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega → + ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → + M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, + ZFSet.IsFunc A s.carrier f ∧ + f ⊆ stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ + W = (relationImage A s.carrier f ∪ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ + W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ + (∀ x : L, s.encode x ∈ W → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ x : L, s.encode x ∈ extra → x ≤ D) := by + intro c rows S T valid lifted tuples hLifted I anchors hI hAnchors anchorFunction p A member extra hExtra extraSubset smallExtra + have nonbottom := M.nonbottom_carrier_mem s separation hL + have hS := M.rowPositionSequences_mem pairing unions powers separation hL order nonbottom hmu + have hTuples := M.binaryLiftedRowTupleFamily_mem pairing unions powers separation collection infinite + hL order nonbottom hC hmu one valid + obtain ⟨hA,subset,smallA⟩ := (M.mem_groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega A).1 member + have whole := M.stageOneDataBounds_mem pairing unions powers separation hA hI hLifted hS hL + hmu nonbottom order hAnchors hTuples + have total := stageOneDataBounds_total s directed subset anchorFunction + (liftedRowTupleFamily_surjective c (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun f hf => by + obtain ⟨D,hD,bound⟩ := M.rowPositionSequence_bound hf + obtain ⟨D,rfl⟩ := (s.mem_carrier D).1 hD + exact ⟨D,bound⟩) + obtain ⟨hUsed,smallUsed⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation + infinite choice nonbottom hC (M.natSetCode_mem separation infinite 2) (SetMembers.raw_mem p) + have usedSubset : rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) ⊆ s.carrier := by + intro x hx + exact ((s.mem_nonbottom_carrier x).1 (rowUsedRows_subset _ _ _ _ hx)).1 + exact M.exists_stageOneDataBound s pairing unions powers separation infinite choice hA hL whole smallA total + hUsed hExtra usedSubset extraSubset smallUsed smallExtra countable_bound + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) +local notation "I" => refinementDataHistoryIndices stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) + +theorem structuralIndex_anchor_fields {x : ZFSet.{u}} (member : x ∈ I) : + ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v 2 ∈ nodes := by + obtain ⟨level, _hl, data, entry, hx⟩ := (mem_refinementDataHistoryIndices _ _ _).1 member + obtain ⟨_, P, order, top, action, _stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + obtain ⟨v, equal, bounds⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hx + exact ⟨v, equal, bounds 2⟩ + +theorem structuralIndexAnchors_function : + ZFSet.IsFunc I nodes (refinementIndexFieldGraph I nodes 2) := + refinementIndexFieldGraph_function I nodes 2 + (fun _ member => M.structuralIndex_anchor_fields G nodes nodeOrder basis T T2 stages history member) + +include M in + theorem structuralIndexAnchorData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) + (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hs : stages ∈ M.sets) (hh : history ∈ M.sets) : + I ∈ M.sets ∧ refinementIndexFieldGraph I nodes 2 ∈ M.sets ∧ + ZFSet.IsFunc I nodes (refinementIndexFieldGraph I nodes 2) := by + have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![G, nodes, nodeOrder, basis, T, T2, stages, history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb + (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have indices := M.refinementDataHistoryIndices_mem pairing unions powers separation hs packed + exact ⟨indices, M.refinementIndexFieldGraph_mem pairing unions powers separation indices hn 2, + M.structuralIndexAnchors_function G nodes nodeOrder basis T T2 stages history⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] +variable (s : Presentation L) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include pairing unions powers separation collection infinite choice hL order hC directed countable_bound + +theorem binaryRowStructuralDataSelection {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), + G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → + let I := refinementDataHistoryIndices stages + (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) + let anchors := refinementIndexFieldGraph I s.carrier 2 + + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + A ∈ M.groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega → + ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → + M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, + ZFSet.IsFunc A s.carrier f ∧ + f ⊆ stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ + W = (relationImage A s.carrier f ∪ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ + W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ + (∀ x : L, s.encode x ∈ W → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ x : L, s.encode x ∈ extra → x ≤ D) := by + intro c rows S T valid lifted tuples hLifted G basis T2 stages history hG hb hT2 hs hh I anchors + p A member extra hExtra extraSubset extraSmall + obtain ⟨indexGround, anchorGround, anchorFunction⟩ := + M.structuralIndexAnchorData G s.carrier s.conditionOrder basis lifted T2 stages history + pairing unions powers separation collection hG hL order hb hLifted hT2 hs hh + exact M.binaryRowDataSelection s C pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu one valid hLifted I anchors indexGround anchorGround + anchorFunction p A member extra hExtra extraSubset extraSmall + +theorem binaryRowStructuralConditionDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), + G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → + let I := refinementDataHistoryIndices stages + (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) + let anchors := refinementIndexFieldGraph I s.carrier 2 + + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + ZFSet.pair (c.encode p) A ∈ + M.structuralForcingCarrier c.carrier G s.carrier s.conditionOrder basis lifted T2 stages history → + ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → + M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : L, s.encode x ∈ extra → x ≤ D) := by + intro c rows S T valid lifted tuples hLifted G basis T2 stages history hG hb hT2 hs hh I anchors + p A member extra hExtra extraSubset extraSmall + have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages + (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) + (ZFSet.pair (c.encode p) A)).1 member |>.1 + have small := (ZFSet.pair_mem_prod.1 candidate).2 + obtain ⟨D, _f, _hf, _W, _hW, _function, _selected, _equal, _subset, _small, _bound, + bounds, usedBound, extraBound⟩ := + M.binaryRowStructuralDataSelection s C pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu one valid hLifted G basis T2 stages history + hG hb hT2 hs hh p A small extra hExtra extraSubset extraSmall + exact ⟨D, usedBound, bounds, extraBound⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] +variable (s : Presentation L) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include pairing unions powers separation collection infinite choice hL order hC directed countable_bound + +theorem binaryRowRecordedPreparationConditionDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (G basis T2 stages history : ZFSet.{u}), + G ∈ M.sets → basis ∈ M.sets → T2 ∈ M.sets → stages ∈ M.sets → history ∈ M.sets → + let I := refinementDataHistoryIndices stages + (M.structuralRefinementHistory G s.carrier s.conditionOrder basis lifted T2 stages history) + let anchors := refinementIndexFieldGraph I s.carrier 2 + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + ZFSet.pair (c.encode p) A ∈ + M.structuralForcingCarrier c.carrier G s.carrier s.conditionOrder basis lifted T2 stages history → + ∀ E events : ZFSet.{u}, E ∈ M.sets → ZFSet.IsFunc ZFSet.omega E events → + let recorded := M.preparationUsedSupportUnion s.carrier E events + recorded ∈ M.sets → M.groundEmbeddable recorded ZFSet.omega → + ∀ extra : ZFSet.{u}, extra ∈ M.sets → extra ⊆ s.carrier → + M.groundEmbeddable extra ZFSet.omega → + (recorded ∪ extra) ∈ M.sets ∧ (recorded ∪ extra) ⊆ s.carrier ∧ + M.groundEmbeddable (recorded ∪ extra) ZFSet.omega ∧ + ∃ D : L, + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : L, s.encode x ∈ recorded ∪ extra → x ≤ D) := by + intro c rows S T valid lifted tuples hLifted G basis T2 stages history hG hb hT2 hs hh I anchors + p A member E events hE function recorded hRecorded smallRecorded extra hExtra extraSubset smallExtra + have recordedSubset : recorded ⊆ s.carrier := by + intro v hv + exact ((M.mem_preparationUsedSupportUnion separation hL hE function v).1 hv).1 + have combinedGround := M.binary_union_mem pairing unions hRecorded hExtra + have combinedSubset : recorded ∪ extra ⊆ s.carrier := by + intro v hv + exact (ZFSet.mem_union.1 hv).elim (fun h => recordedSubset h) (fun h => extraSubset h) + have combinedSmall := M.groundCountable_binary_union pairing unions powers separation infinite choice + hRecorded hExtra smallRecorded smallExtra + obtain ⟨D, usedBound, dataBound, combinedBound⟩ := + M.binaryRowStructuralConditionDataBound s C pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu one valid hLifted G basis T2 stages history + hG hb hT2 hs hh p A member (recorded ∪ extra) combinedGround combinedSubset combinedSmall + exact ⟨combinedGround, combinedSubset, combinedSmall, D, usedBound, dataBound, combinedBound⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowSemanticStructuralBoundHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + (∀ z ∈ lifted, IsName c.pairEmpty z) ∧ (∀ z ∈ squared, IsName c.pairEmpty z) ∧ + (∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) ∧ + (∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) ∧ + (∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) ∧ + (∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) ∧ + ∀ stages ∈ M.sets, ordinalSetProperty stages → ∃ history ∈ M.sets, + OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history ∧ + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted stages + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared stages P order top action ∧ + let J := refinementDataHistoryIndices stages + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history) + let anchors := refinementIndexFieldGraph J s.carrier 2 + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + ZFSet.pair (c.encode p) A ∈ + M.structuralForcingCarrier c.carrier b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history → + ∀ extra ∈ M.sets, extra ⊆ s.carrier → M.groundEmbeddable extra ZFSet.omega → + ∃ E : SetMembers geometry.carrier, ∃ f ∈ M.sets, ∃ W ∈ M.sets, + ZFSet.IsFunc A s.carrier f ∧ + f ⊆ stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples ∧ + W = (relationImage A s.carrier f ∪ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) ∪ extra ∧ + W ⊆ s.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ + (∀ x : SetMembers geometry.carrier, s.encode x ∈ W → x ≤ E) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode E) ∈ + stageOneDataBounds A J lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : SetMembers geometry.carrier, + s.encode x ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → x ≤ E) ∧ + (∀ x : SetMembers geometry.carrier, s.encode x ∈ extra → x ≤ E) := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground order action + have countableBound := geometry.decoded_countable_bound + (fun W hW subset small => (fulfilled.countable_localization W hW subset small).2) + have original := fulfilled.exists_rowSemanticStructuralFinalHistory collection infinite choice hK standard indices + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := original + obtain ⟨hLifted, hSquared, hGraph, injection, valid1, valid2, + closed1, closed2, children1, children2, histories⟩ := data + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, hGraph, injection, valid1, valid2, + closed1, closed2, children1, children2, ?_⟩ + intro stages hStages ordinal + obtain ⟨history, hHistory, trace, hPacked, historyRun, witnesses, + P, stageOrder, top, stageAction, code, fields, witness⟩ := histories stages hStages ordinal + refine ⟨history, hHistory, trace, hPacked, historyRun, witnesses, + P, stageOrder, top, stageAction, code, fields, witness, ?_⟩ + intro p A member extra hExtra extraSubset extraSmall + have candidate := (M.mem_refinementHistoryForcing c.carrier _ stages _ + (ZFSet.pair (c.encode p) A)).1 member |>.1 + have small := (ZFSet.pair_mem_prod.1 candidate).2 + exact M.binaryRowStructuralDataSelection s columns pairing unions powers separation collection infinite choice + geometry.carrier_ground order hColumns directed countableBound hmu ⊤ valid hLifted + b.carrier (supportBasisCode s b a.principalFix) _ stages history + geometry.actors_ground supports hSquared hStages hHistory p A small extra hExtra extraSubset extraSmall + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRows.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRows.lean index 93562859073b82ac6990997d2c32756efc80c2a2..f22a82f329cdb994c771efbc2cd8e29b83c0304b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRows.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryRows.lean @@ -1,125 +1,125 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowGenerics - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -theorem mem_two_iff (x : ZFSet.{u}) : - x ∈ natSetCode 2 ↔ x = natSetCode 0 ∨ x = natSetCode 1 := by - rw [mem_natSetCode] - constructor - · rintro ⟨n, hn, rfl⟩ - have cases : n = 0 ∨ n = 1 := by omega - rcases cases with rfl | rfl - · exact Or.inl rfl - · exact Or.inr rfl - · rintro (rfl | rfl) - · exact ⟨0, by omega, rfl⟩ - · exact ⟨1, by omega, rfl⟩ - -theorem two_distinct_values : - ∃ a ∈ natSetCode 2, ∃ b ∈ natSetCode 2, a ≠ (b : ZFSet.{u}) := by - refine ⟨natSetCode 0, (mem_two_iff _).2 (Or.inl rfl), - natSetCode 1, (mem_two_iff _).2 (Or.inr rfl), ?_⟩ - intro eq - have impossible := natSetCode_injective eq - omega - -namespace TransitiveGround - -open SetRealization SetFormula -variable (M : TransitiveGround.{u}) - -noncomputable def binaryGenericRow (I C : ZFSet.{u}) : - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) → - ZFSet.{u} → ZFSet.{u} := by - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - exact fun H i => ZFSet.sep (fun c => ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ - M.countableGenericGraph (ZFSet.prod I C) (natSetCode 2) H) C - -theorem mem_binaryGenericRow (I C : ZFSet.{u}) : - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - ∀ (H : ConditionFilter (SetMembers - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) (i c : ZFSet.{u}), - c ∈ M.binaryGenericRow I C H i ↔ c ∈ C ∧ - ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ - M.countableGenericGraph (ZFSet.prod I C) (natSetCode 2) H := by - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - intro H i c - exact ZFSet.mem_sep - -theorem binaryGenericRow_subset (I C : ZFSet.{u}) : - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - ∀ (H : ConditionFilter (SetMembers - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) (i : ZFSet.{u}), - M.binaryGenericRow I C H i ⊆ C := by - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - intro H i c hc - exact ((M.mem_binaryGenericRow I C H i c).1 hc).1 - -theorem binaryGenericRow_ne - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), - H.GenericFor (M.codedFamily (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) → - M.binaryGenericRow I C H i ≠ M.binaryGenericRow I C H j := by - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - intro H generic same - obtain ⟨c, hc, a, ha, b, hb, ne, first, second, absent⟩ := - M.countableGenericGraph_rows_separated pairing unions powers separation infinite choice - hI hC (M.natSetCode_mem separation infinite 2) hi hj distinct - two_distinct_values uncountable H generic - rcases (mem_two_iff a).1 ha with rfl | rfl - · rcases (mem_two_iff b).1 hb with rfl | rfl - · exact ne rfl - · have right := (M.mem_binaryGenericRow I C H j c).2 ⟨hc, second⟩ - have left := (M.mem_binaryGenericRow I C H i c).1 (same ▸ right) - have impossible := natSetCode_injective - ((M.countableGenericGraph_partial (ZFSet.prod I C) (natSetCode 2) H).unique - (ZFSet.pair i c) (natSetCode 1) (natSetCode 0) left.2 first) - omega - · have left := (M.mem_binaryGenericRow I C H i c).2 ⟨hc, first⟩ - exact absent ((M.mem_binaryGenericRow I C H j c).1 (same ▸ left)).2 - -theorem binaryGenericRows_injective - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), - H.GenericFor (M.codedFamily (SetMembers.presentation - (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) → - Function.Injective (fun i : SetMembers I => M.binaryGenericRow I C H (SetMembers.raw i)) := by - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - intro H generic i j same - apply SetMembers.raw_injective I - by_contra distinct - exact M.binaryGenericRow_ne pairing unions powers separation infinite choice hI hC - (SetMembers.raw_mem i) (SetMembers.raw_mem j) distinct uncountable H generic same - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowGenerics + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +theorem mem_two_iff (x : ZFSet.{u}) : + x ∈ natSetCode 2 ↔ x = natSetCode 0 ∨ x = natSetCode 1 := by + rw [mem_natSetCode] + constructor + · rintro ⟨n, hn, rfl⟩ + have cases : n = 0 ∨ n = 1 := by omega + rcases cases with rfl | rfl + · exact Or.inl rfl + · exact Or.inr rfl + · rintro (rfl | rfl) + · exact ⟨0, by omega, rfl⟩ + · exact ⟨1, by omega, rfl⟩ + +theorem two_distinct_values : + ∃ a ∈ natSetCode 2, ∃ b ∈ natSetCode 2, a ≠ (b : ZFSet.{u}) := by + refine ⟨natSetCode 0, (mem_two_iff _).2 (Or.inl rfl), + natSetCode 1, (mem_two_iff _).2 (Or.inr rfl), ?_⟩ + intro eq + have impossible := natSetCode_injective eq + omega + +namespace TransitiveGround + +open SetRealization SetFormula +variable (M : TransitiveGround.{u}) + +noncomputable def binaryGenericRow (I C : ZFSet.{u}) : + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)) → + ZFSet.{u} → ZFSet.{u} := by + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + exact fun H i => ZFSet.sep (fun c => ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ + M.countableGenericGraph (ZFSet.prod I C) (natSetCode 2) H) C + +theorem mem_binaryGenericRow (I C : ZFSet.{u}) : + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + ∀ (H : ConditionFilter (SetMembers + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) (i c : ZFSet.{u}), + c ∈ M.binaryGenericRow I C H i ↔ c ∈ C ∧ + ZFSet.pair (ZFSet.pair i c) (natSetCode 1) ∈ + M.countableGenericGraph (ZFSet.prod I C) (natSetCode 2) H := by + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + intro H i c + exact ZFSet.mem_sep + +theorem binaryGenericRow_subset (I C : ZFSet.{u}) : + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + ∀ (H : ConditionFilter (SetMembers + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) (i : ZFSet.{u}), + M.binaryGenericRow I C H i ⊆ C := by + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + intro H i c hc + exact ((M.mem_binaryGenericRow I C H i c).1 hc).1 + +theorem binaryGenericRow_ne + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), + H.GenericFor (M.codedFamily (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) → + M.binaryGenericRow I C H i ≠ M.binaryGenericRow I C H j := by + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + intro H generic same + obtain ⟨c, hc, a, ha, b, hb, ne, first, second, absent⟩ := + M.countableGenericGraph_rows_separated pairing unions powers separation infinite choice + hI hC (M.natSetCode_mem separation infinite 2) hi hj distinct + two_distinct_values uncountable H generic + rcases (mem_two_iff a).1 ha with rfl | rfl + · rcases (mem_two_iff b).1 hb with rfl | rfl + · exact ne rfl + · have right := (M.mem_binaryGenericRow I C H j c).2 ⟨hc, second⟩ + have left := (M.mem_binaryGenericRow I C H i c).1 (same ▸ right) + have impossible := natSetCode_injective + ((M.countableGenericGraph_partial (ZFSet.prod I C) (natSetCode 2) H).unique + (ZFSet.pair i c) (natSetCode 1) (natSetCode 0) left.2 first) + omega + · have left := (M.mem_binaryGenericRow I C H i c).2 ⟨hc, first⟩ + exact absent ((M.mem_binaryGenericRow I C H j c).1 (same ▸ left)).2 + +theorem binaryGenericRows_injective + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega)), + H.GenericFor (M.codedFamily (SetMembers.presentation + (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega))) → + Function.Injective (fun i : SetMembers I => M.binaryGenericRow I C H (SetMembers.raw i)) := by + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + intro H generic i j same + apply SetMembers.raw_injective I + by_contra distinct + exact M.binaryGenericRow_ne pairing unions powers separation infinite choice hI hC + (SetMembers.raw_mem i) (SetMembers.raw_mem j) distinct uncountable H generic same + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryUnionFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryUnionFamilies.lean index fd7c6c2b90970c9007c9586bf1440a9f871bb6c8..5dba6386c8e1b94d11c35c20c1cdbb5aa6605499 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryUnionFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundBinaryUnionFamilies.lean @@ -1,123 +1,123 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u -namespace BoundedFormula - -def binaryUnionSetFormula {n} (output first second : Fin n) : BoundedFormula n := - .conj (.allMem output (.disj (.mem 0 first.succ) (.mem 0 second.succ))) - (.conj (.allMem first (.mem 0 output.succ)) (.allMem second (.mem 0 output.succ))) - -theorem truth_binaryUnionSetFormula {n} (output first second : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (binaryUnionSetFormula output first second) env ↔ - env output = env first ∪ env second := by - simp only [binaryUnionSetFormula, Truth, truth_disj, extend, Fin.cases_zero, Fin.cases_succ] - constructor - · rintro ⟨forward, left, right⟩ - apply ZFSet.ext - intro z - exact ⟨fun hz => ZFSet.mem_union.2 (forward z hz), - fun hz => (ZFSet.mem_union.1 hz).elim (left z) (right z)⟩ - · intro equal - refine ⟨fun z hz => ZFSet.mem_union.1 (equal ▸ hz), ?_, ?_⟩ - · intro z hz - exact equal.symm ▸ ZFSet.mem_union.2 (Or.inl hz) - · intro z hz - exact equal.symm ▸ ZFSet.mem_union.2 (Or.inr hz) - -def binaryUnionFamilyEntryFormula : BoundedFormula 7 := - exMem 1 (exMem 3 (exMem 7 (exMem 9 - (.conj (orderedPairFormula 4 3 2) (.conj (pairMembershipFormula 3 1 7) - (.conj (pairMembershipFormula 3 0 8) (binaryUnionSetFormula 2 1 0))))))) - -theorem truth_binaryUnionFamilyEntryFormula (z I W F H RF RH : ZFSet.{u}) : - Truth binaryUnionFamilyEntryFormula ![z,I,W,F,H,RF,RH] ↔ - ∃ x ∈ I, ∃ out ∈ W, ∃ f ∈ RF, ∃ h ∈ RH, - z = ZFSet.pair x out ∧ ZFSet.pair x f ∈ F ∧ ZFSet.pair x h ∈ H ∧ out = f ∪ h := by - simp only [binaryUnionFamilyEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, truth_binaryUnionSetFormula] - rfl - -end BoundedFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem familyCodeGraph_binaryUnions_mem {G : Type u} (t : Presentation G) (f h : G → ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (group : t.carrier ∈ M.sets) - (wholeF : familyCodeGraph t.encode f ∈ M.sets) - (wholeH : familyCodeGraph t.encode h ∈ M.sets) : - familyCodeGraph t.encode (fun g => f g ∪ h g) ∈ M.sets := by - let F := familyCodeGraph t.encode f - let H := familyCodeGraph t.encode h - let RF := ⋃₀ ⋃₀ F - let RH := ⋃₀ ⋃₀ H - let V := (⋃₀ RF) ∪ (⋃₀ RH) - let W := M.groundPower V - let result := familyCodeGraph t.encode (fun g => f g ∪ h g) - have hRF : RF ∈ M.sets := M.union_mem unions (M.union_mem unions wholeF) - have hRH : RH ∈ M.sets := M.union_mem unions (M.union_mem unions wholeH) - have hV : V ∈ M.sets := M.binary_union_mem pairing unions - (M.union_mem unions hRF) (M.union_mem unions hRH) - have hW : W ∈ M.sets := M.groundPower_mem powers hV - have fEntry (g : G) := (pair_mem_familyCodeGraph t.encode f t.injective g (f g)).2 rfl - have hEntry (g : G) := (pair_mem_familyCodeGraph t.encode h t.injective g (h g)).2 rfl - have fiber (g : G) : f g ∪ h g ∈ W := by - apply (M.mem_groundPower V _).2 - refine ⟨M.binary_union_mem pairing unions - (M.transitive hRF (pair_second_mem_doubleUnion (fEntry g))) - (M.transitive hRH (pair_second_mem_doubleUnion (hEntry g))), ?_⟩ - intro z hz - rcases ZFSet.mem_union.1 hz with left | right - · exact ZFSet.mem_union.2 (Or.inl (ZFSet.mem_sUnion.2 - ⟨f g, pair_second_mem_doubleUnion (fEntry g), left⟩)) - · exact ZFSet.mem_union.2 (Or.inr (ZFSet.mem_sUnion.2 - ⟨h g, pair_second_mem_doubleUnion (hEntry g), right⟩)) - let params : Fin 6 → ZFSet.{u} := ![t.carrier,W,F,H,RF,RH] - have members : ∀ j, params j ∈ M.sets := Fin.cases group (Fin.cases hW - (Fin.cases wholeF (Fin.cases wholeH (Fin.cases hRF (Fin.cases hRH (fun j => Fin.elim0 j)))))) - have meaning (z : ZFSet.{u}) : - BoundedFormula.Truth BoundedFormula.binaryUnionFamilyEntryFormula (extend z params) ↔ z ∈ result := by - change BoundedFormula.Truth BoundedFormula.binaryUnionFamilyEntryFormula ![z,t.carrier,W,F,H,RF,RH] ↔ z ∈ result - rw [BoundedFormula.truth_binaryUnionFamilyEntryFormula] - constructor - · rintro ⟨x,hx,out,_,first,_,second,_,equal,fe,he,union⟩ - obtain ⟨g,rfl⟩ := (t.mem_carrier x).1 hx - have ef := (pair_mem_familyCodeGraph t.encode f t.injective g first).1 fe - have eh := (pair_mem_familyCodeGraph t.encode h t.injective g second).1 he - exact (mem_familyCodeGraph _ _ z).2 ⟨g, by simpa only [ef,eh,union] using equal.symm⟩ - · intro member - obtain ⟨g,rfl⟩ := (mem_familyCodeGraph _ _ z).1 member - exact ⟨t.encode g,t.encode_mem g,_,fiber g,f g,pair_second_mem_doubleUnion (fEntry g), - h g,pair_second_mem_doubleUnion (hEntry g),rfl,fEntry g,hEntry g,rfl⟩ - have bound : result ⊆ ZFSet.prod t.carrier W := by - intro z hz - obtain ⟨g,rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨t.encode_mem g,fiber g⟩ - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.binaryUnionFamilyEntryFormula - (extend z params)) (ZFSet.prod t.carrier W) = result := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, meaning] - exact ⟨And.right, fun hz => ⟨bound hz,hz⟩⟩ - change result ∈ M.sets - rw [← equal] - exact M.bounded_separation_mem separation BoundedFormula.binaryUnionFamilyEntryFormula - params members (M.prod_mem pairing unions powers separation group hW) - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u +namespace BoundedFormula + +def binaryUnionSetFormula {n} (output first second : Fin n) : BoundedFormula n := + .conj (.allMem output (.disj (.mem 0 first.succ) (.mem 0 second.succ))) + (.conj (.allMem first (.mem 0 output.succ)) (.allMem second (.mem 0 output.succ))) + +theorem truth_binaryUnionSetFormula {n} (output first second : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (binaryUnionSetFormula output first second) env ↔ + env output = env first ∪ env second := by + simp only [binaryUnionSetFormula, Truth, truth_disj, extend, Fin.cases_zero, Fin.cases_succ] + constructor + · rintro ⟨forward, left, right⟩ + apply ZFSet.ext + intro z + exact ⟨fun hz => ZFSet.mem_union.2 (forward z hz), + fun hz => (ZFSet.mem_union.1 hz).elim (left z) (right z)⟩ + · intro equal + refine ⟨fun z hz => ZFSet.mem_union.1 (equal ▸ hz), ?_, ?_⟩ + · intro z hz + exact equal.symm ▸ ZFSet.mem_union.2 (Or.inl hz) + · intro z hz + exact equal.symm ▸ ZFSet.mem_union.2 (Or.inr hz) + +def binaryUnionFamilyEntryFormula : BoundedFormula 7 := + exMem 1 (exMem 3 (exMem 7 (exMem 9 + (.conj (orderedPairFormula 4 3 2) (.conj (pairMembershipFormula 3 1 7) + (.conj (pairMembershipFormula 3 0 8) (binaryUnionSetFormula 2 1 0))))))) + +theorem truth_binaryUnionFamilyEntryFormula (z I W F H RF RH : ZFSet.{u}) : + Truth binaryUnionFamilyEntryFormula ![z,I,W,F,H,RF,RH] ↔ + ∃ x ∈ I, ∃ out ∈ W, ∃ f ∈ RF, ∃ h ∈ RH, + z = ZFSet.pair x out ∧ ZFSet.pair x f ∈ F ∧ ZFSet.pair x h ∈ H ∧ out = f ∪ h := by + simp only [binaryUnionFamilyEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, truth_binaryUnionSetFormula] + rfl + +end BoundedFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem familyCodeGraph_binaryUnions_mem {G : Type u} (t : Presentation G) (f h : G → ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (group : t.carrier ∈ M.sets) + (wholeF : familyCodeGraph t.encode f ∈ M.sets) + (wholeH : familyCodeGraph t.encode h ∈ M.sets) : + familyCodeGraph t.encode (fun g => f g ∪ h g) ∈ M.sets := by + let F := familyCodeGraph t.encode f + let H := familyCodeGraph t.encode h + let RF := ⋃₀ ⋃₀ F + let RH := ⋃₀ ⋃₀ H + let V := (⋃₀ RF) ∪ (⋃₀ RH) + let W := M.groundPower V + let result := familyCodeGraph t.encode (fun g => f g ∪ h g) + have hRF : RF ∈ M.sets := M.union_mem unions (M.union_mem unions wholeF) + have hRH : RH ∈ M.sets := M.union_mem unions (M.union_mem unions wholeH) + have hV : V ∈ M.sets := M.binary_union_mem pairing unions + (M.union_mem unions hRF) (M.union_mem unions hRH) + have hW : W ∈ M.sets := M.groundPower_mem powers hV + have fEntry (g : G) := (pair_mem_familyCodeGraph t.encode f t.injective g (f g)).2 rfl + have hEntry (g : G) := (pair_mem_familyCodeGraph t.encode h t.injective g (h g)).2 rfl + have fiber (g : G) : f g ∪ h g ∈ W := by + apply (M.mem_groundPower V _).2 + refine ⟨M.binary_union_mem pairing unions + (M.transitive hRF (pair_second_mem_doubleUnion (fEntry g))) + (M.transitive hRH (pair_second_mem_doubleUnion (hEntry g))), ?_⟩ + intro z hz + rcases ZFSet.mem_union.1 hz with left | right + · exact ZFSet.mem_union.2 (Or.inl (ZFSet.mem_sUnion.2 + ⟨f g, pair_second_mem_doubleUnion (fEntry g), left⟩)) + · exact ZFSet.mem_union.2 (Or.inr (ZFSet.mem_sUnion.2 + ⟨h g, pair_second_mem_doubleUnion (hEntry g), right⟩)) + let params : Fin 6 → ZFSet.{u} := ![t.carrier,W,F,H,RF,RH] + have members : ∀ j, params j ∈ M.sets := Fin.cases group (Fin.cases hW + (Fin.cases wholeF (Fin.cases wholeH (Fin.cases hRF (Fin.cases hRH (fun j => Fin.elim0 j)))))) + have meaning (z : ZFSet.{u}) : + BoundedFormula.Truth BoundedFormula.binaryUnionFamilyEntryFormula (extend z params) ↔ z ∈ result := by + change BoundedFormula.Truth BoundedFormula.binaryUnionFamilyEntryFormula ![z,t.carrier,W,F,H,RF,RH] ↔ z ∈ result + rw [BoundedFormula.truth_binaryUnionFamilyEntryFormula] + constructor + · rintro ⟨x,hx,out,_,first,_,second,_,equal,fe,he,union⟩ + obtain ⟨g,rfl⟩ := (t.mem_carrier x).1 hx + have ef := (pair_mem_familyCodeGraph t.encode f t.injective g first).1 fe + have eh := (pair_mem_familyCodeGraph t.encode h t.injective g second).1 he + exact (mem_familyCodeGraph _ _ z).2 ⟨g, by simpa only [ef,eh,union] using equal.symm⟩ + · intro member + obtain ⟨g,rfl⟩ := (mem_familyCodeGraph _ _ z).1 member + exact ⟨t.encode g,t.encode_mem g,_,fiber g,f g,pair_second_mem_doubleUnion (fEntry g), + h g,pair_second_mem_doubleUnion (hEntry g),rfl,fEntry g,hEntry g,rfl⟩ + have bound : result ⊆ ZFSet.prod t.carrier W := by + intro z hz + obtain ⟨g,rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨t.encode_mem g,fiber g⟩ + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.binaryUnionFamilyEntryFormula + (extend z params)) (ZFSet.prod t.carrier W) = result := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, meaning] + exact ⟨And.right, fun hz => ⟨bound hz,hz⟩⟩ + change result ∈ M.sets + rw [← equal] + exact M.bounded_separation_mem separation BoundedFormula.binaryUnionFamilyEntryFormula + params members (M.prod_mem pairing unions powers separation group hW) + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCantorDiagonal.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCantorDiagonal.lean index 16aa94245471b017b34290f0660b7267386f1656..e81201f52a413a0d5779202c06e96507a14cee5e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCantorDiagonal.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCantorDiagonal.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace BoundedFormula - -def injectionDiagonalFormula {n} (x p f : Fin n) : BoundedFormula n := - exMem p (.conj (pairMembershipFormula 0 x.succ f.succ) (.neg (.mem x.succ 0))) - -theorem truth_injectionDiagonalFormula {n} (x p f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (injectionDiagonalFormula x p f) env ↔ - ∃ X ∈ env p, ZFSet.pair X (env x) ∈ env f ∧ env x ∉ X := by - simp only [injectionDiagonalFormula, truth_exMem, Truth, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def injectionDiagonal (A f : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun x => ∃ X ∈ M.groundPower A, ZFSet.pair X x ∈ f ∧ x ∉ X) A - -theorem mem_injectionDiagonal (A f x : ZFSet.{u}) : - x ∈ M.injectionDiagonal A f ↔ - x ∈ A ∧ ∃ X ∈ M.groundPower A, ZFSet.pair X x ∈ f ∧ x ∉ X := ZFSet.mem_sep - -theorem injectionDiagonal_mem - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) : - M.injectionDiagonal A f ∈ M.sets := by - let params := extend (M.groundPower A) (extend f Fin.elim0) - have members : ∀ i, params i ∈ M.sets := - Fin.cases (M.groundPower_mem powers hA) (Fin.cases hf (fun i => Fin.elim0 i)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.injectionDiagonalFormula 0 1 2) params members hA - have eq : ZFSet.sep (fun x => BoundedFormula.Truth - (BoundedFormula.injectionDiagonalFormula 0 1 2) (extend x params)) A = - M.injectionDiagonal A f := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, M.mem_injectionDiagonal, BoundedFormula.truth_injectionDiagonalFormula] - rfl - exact eq ▸ selected - -theorem groundPower_not_embeddable_self - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A : ZFSet.{u}} (hA : A ∈ M.sets) : ¬ M.groundEmbeddable (M.groundPower A) A := by - classical - rintro ⟨f, hf, code⟩ - let D := M.injectionDiagonal A f - have hD : D ∈ M.groundPower A := (M.mem_groundPower A D).2 - ⟨M.injectionDiagonal_mem powers separation hA hf, - fun _ hx => (M.mem_injectionDiagonal A f _).1 hx |>.1⟩ - obtain ⟨y, entry, _⟩ := code.function.2 D hD - have hy : y ∈ A := (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2 - have outside : y ∉ D := by - intro inside - obtain ⟨_, X, _, image, missing⟩ := (M.mem_injectionDiagonal A f y).1 inside - have same : X = D := code.injective X D y image entry - exact missing (same.symm ▸ inside) - exact outside ((M.mem_injectionDiagonal A f y).2 ⟨hy, D, hD, entry, outside⟩) - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace BoundedFormula + +def injectionDiagonalFormula {n} (x p f : Fin n) : BoundedFormula n := + exMem p (.conj (pairMembershipFormula 0 x.succ f.succ) (.neg (.mem x.succ 0))) + +theorem truth_injectionDiagonalFormula {n} (x p f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (injectionDiagonalFormula x p f) env ↔ + ∃ X ∈ env p, ZFSet.pair X (env x) ∈ env f ∧ env x ∉ X := by + simp only [injectionDiagonalFormula, truth_exMem, Truth, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def injectionDiagonal (A f : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun x => ∃ X ∈ M.groundPower A, ZFSet.pair X x ∈ f ∧ x ∉ X) A + +theorem mem_injectionDiagonal (A f x : ZFSet.{u}) : + x ∈ M.injectionDiagonal A f ↔ + x ∈ A ∧ ∃ X ∈ M.groundPower A, ZFSet.pair X x ∈ f ∧ x ∉ X := ZFSet.mem_sep + +theorem injectionDiagonal_mem + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) : + M.injectionDiagonal A f ∈ M.sets := by + let params := extend (M.groundPower A) (extend f Fin.elim0) + have members : ∀ i, params i ∈ M.sets := + Fin.cases (M.groundPower_mem powers hA) (Fin.cases hf (fun i => Fin.elim0 i)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.injectionDiagonalFormula 0 1 2) params members hA + have eq : ZFSet.sep (fun x => BoundedFormula.Truth + (BoundedFormula.injectionDiagonalFormula 0 1 2) (extend x params)) A = + M.injectionDiagonal A f := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, M.mem_injectionDiagonal, BoundedFormula.truth_injectionDiagonalFormula] + rfl + exact eq ▸ selected + +theorem groundPower_not_embeddable_self + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A : ZFSet.{u}} (hA : A ∈ M.sets) : ¬ M.groundEmbeddable (M.groundPower A) A := by + classical + rintro ⟨f, hf, code⟩ + let D := M.injectionDiagonal A f + have hD : D ∈ M.groundPower A := (M.mem_groundPower A D).2 + ⟨M.injectionDiagonal_mem powers separation hA hf, + fun _ hx => (M.mem_injectionDiagonal A f _).1 hx |>.1⟩ + obtain ⟨y, entry, _⟩ := code.function.2 D hD + have hy : y ∈ A := (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2 + have outside : y ∉ D := by + intro inside + obtain ⟨_, X, _, image, missing⟩ := (M.mem_injectionDiagonal A f y).1 inside + have same : X = D := code.injective X D y image entry + exact missing (same.symm ▸ inside) + exact outside ((M.mem_injectionDiagonal A f y).2 ⟨hy, D, hD, entry, outside⟩) + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateBasisUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateBasisUnions.lean index 4204d11d0b272a1ff1ae47af59f5b03bc03cf352..7fa4ad9bbd3bae3356c851e538bd8430fdda9202 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateBasisUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateBasisUnions.lean @@ -1,118 +1,118 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStoredPreparedFamilyActions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def certificateBasisGraph (J nodes N k : ZFSet.{u}) : ZFSet.{u} := - let bases := M.groundSmallSubsets nodes ZFSet.omega - let functions := M.groundRelations nodes N - let tail := ZFSet.prod bases functions - relationCompose J tail bases - (relationCompose J (M.supportedEqualityCertificateBound nodes N) tail k - (productSecond (M.groundPower nodes) tail)) - (productFirst bases functions) - -theorem certificateBasisGraph_function {J nodes N k : ZFSet.{u}} - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) : - ZFSet.IsFunc J (M.groundSmallSubsets nodes ZFSet.omega) - (M.certificateBasisGraph J nodes N k) := - relationCompose_function_of_subset - (relationCompose_function_of_subset function (productSecond_function _ _) (fun _ h => h)) - (productFirst_function _ _) (fun _ h => h) - -theorem pair_mem_certificateBasisGraph {J nodes N k : ZFSet.{u}} - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) - (z B : ZFSet.{u}) : - ZFSet.pair z B ∈ M.certificateBasisGraph J nodes N k ↔ - ∃ F f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k := by - dsimp only [certificateBasisGraph] - rw [pair_mem_relationCompose] - constructor - · rintro ⟨_, _, tail, _, first, projected⟩ - obtain ⟨B', hB, f, hf, equal⟩ := (mem_productFirst _ _ _).1 projected - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨_, _, c, _, edge, projected⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first - obtain ⟨F, hF, tail', ht, equal⟩ := (mem_productSecond _ _ _).1 projected - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨F, f, edge⟩ - · rintro ⟨F, f, edge⟩ - have bound := ZFSet.pair_mem_prod.1 (function.1 edge) - have fields := ZFSet.pair_mem_prod.1 bound.2 - have tail := ZFSet.pair_mem_prod.1 fields.2 - exact ⟨bound.1, tail.1, _, fields.2, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨bound.1, fields.2, _, bound.2, edge, - (mem_productSecond _ _ _).2 ⟨F, fields.1, _, fields.2, rfl⟩⟩, - (mem_productFirst _ _ _).2 ⟨B, tail.1, f, tail.2, rfl⟩⟩ - -theorem certificateBasisGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hN : N ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (hk : k ∈ M.sets) : - M.certificateBasisGraph J nodes N k ∈ M.sets := by - have hBases := M.groundSmallSubsets_mem powers separation hNodes omega - have hFunctions := M.groundRelations_mem pairing unions powers separation hNodes hN - have hTail := M.prod_mem pairing unions powers separation hBases hFunctions - exact M.relationCompose_mem pairing unions powers separation hJ hTail hBases - (M.relationCompose_mem pairing unions powers separation hJ - (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hN omega) - hTail hk (M.productSecond_mem pairing unions powers separation - (M.groundPower_mem powers hNodes) hTail)) - (M.productFirst_mem pairing unions powers separation hBases hFunctions) - -theorem certificateUsedSupports_eq_basisUnion {J nodes N k : ZFSet.{u}} - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) : - certificateUsedSupports nodes k = (relationImage J - (M.groundSmallSubsets nodes ZFSet.omega) (M.certificateBasisGraph J nodes N k)).sUnion := by - apply ZFSet.ext - intro v - rw [mem_certificateUsedSupports, ZFSet.mem_sUnion] - constructor - · rintro ⟨_, z, F, B, f, edge, member⟩ - have bound := ZFSet.pair_mem_prod.1 (function.1 edge) - have hB := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 bound.2).2).1 - exact ⟨B, (mem_relationImage _ _ _ _).2 - ⟨hB, z, bound.1, (M.pair_mem_certificateBasisGraph function z B).2 ⟨F, f, edge⟩⟩, member⟩ - · rintro ⟨B, hB, member⟩ - obtain ⟨hB, z, _, edge⟩ := (mem_relationImage _ _ _ _).1 hB - obtain ⟨F, f, original⟩ := (M.pair_mem_certificateBasisGraph function z B).1 edge - exact ⟨((M.mem_groundSmallSubsets _ _ _).1 hB).2.1 member, z, F, B, f, original, member⟩ - -theorem certificateUsedSupports_ground_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hN : N ∈ M.sets) (hk : k ∈ M.sets) - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) - (smallJ : M.groundEmbeddable J ZFSet.omega) : - certificateUsedSupports nodes k ∈ M.sets ∧ - M.groundEmbeddable (certificateUsedSupports nodes k) ZFSet.omega := by - have omega := M.omega_mem separation infinite - have hBases := M.groundSmallSubsets_mem powers separation hNodes omega - have hGraph := M.certificateBasisGraph_mem pairing unions powers separation hJ hNodes hN omega hk - have graphFunction := M.certificateBasisGraph_function function - have hRange := M.relationImage_mem separation hJ hBases hGraph - have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice - hJ hBases omega hGraph graphFunction smallJ - rw [M.certificateUsedSupports_eq_basisUnion function] - exact ⟨M.union_mem unions hRange, - M.groundCountable_family_union pairing unions powers separation infinite choice hRange rangeSmall - (fun B hB => ((M.mem_groundSmallSubsets _ _ _).1 - ((mem_relationImage _ _ _ _).1 hB).1).2.2)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStoredPreparedFamilyActions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def certificateBasisGraph (J nodes N k : ZFSet.{u}) : ZFSet.{u} := + let bases := M.groundSmallSubsets nodes ZFSet.omega + let functions := M.groundRelations nodes N + let tail := ZFSet.prod bases functions + relationCompose J tail bases + (relationCompose J (M.supportedEqualityCertificateBound nodes N) tail k + (productSecond (M.groundPower nodes) tail)) + (productFirst bases functions) + +theorem certificateBasisGraph_function {J nodes N k : ZFSet.{u}} + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) : + ZFSet.IsFunc J (M.groundSmallSubsets nodes ZFSet.omega) + (M.certificateBasisGraph J nodes N k) := + relationCompose_function_of_subset + (relationCompose_function_of_subset function (productSecond_function _ _) (fun _ h => h)) + (productFirst_function _ _) (fun _ h => h) + +theorem pair_mem_certificateBasisGraph {J nodes N k : ZFSet.{u}} + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) + (z B : ZFSet.{u}) : + ZFSet.pair z B ∈ M.certificateBasisGraph J nodes N k ↔ + ∃ F f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k := by + dsimp only [certificateBasisGraph] + rw [pair_mem_relationCompose] + constructor + · rintro ⟨_, _, tail, _, first, projected⟩ + obtain ⟨B', hB, f, hf, equal⟩ := (mem_productFirst _ _ _).1 projected + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨_, _, c, _, edge, projected⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first + obtain ⟨F, hF, tail', ht, equal⟩ := (mem_productSecond _ _ _).1 projected + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨F, f, edge⟩ + · rintro ⟨F, f, edge⟩ + have bound := ZFSet.pair_mem_prod.1 (function.1 edge) + have fields := ZFSet.pair_mem_prod.1 bound.2 + have tail := ZFSet.pair_mem_prod.1 fields.2 + exact ⟨bound.1, tail.1, _, fields.2, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨bound.1, fields.2, _, bound.2, edge, + (mem_productSecond _ _ _).2 ⟨F, fields.1, _, fields.2, rfl⟩⟩, + (mem_productFirst _ _ _).2 ⟨B, tail.1, f, tail.2, rfl⟩⟩ + +theorem certificateBasisGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hN : N ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) (hk : k ∈ M.sets) : + M.certificateBasisGraph J nodes N k ∈ M.sets := by + have hBases := M.groundSmallSubsets_mem powers separation hNodes omega + have hFunctions := M.groundRelations_mem pairing unions powers separation hNodes hN + have hTail := M.prod_mem pairing unions powers separation hBases hFunctions + exact M.relationCompose_mem pairing unions powers separation hJ hTail hBases + (M.relationCompose_mem pairing unions powers separation hJ + (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hN omega) + hTail hk (M.productSecond_mem pairing unions powers separation + (M.groundPower_mem powers hNodes) hTail)) + (M.productFirst_mem pairing unions powers separation hBases hFunctions) + +theorem certificateUsedSupports_eq_basisUnion {J nodes N k : ZFSet.{u}} + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) : + certificateUsedSupports nodes k = (relationImage J + (M.groundSmallSubsets nodes ZFSet.omega) (M.certificateBasisGraph J nodes N k)).sUnion := by + apply ZFSet.ext + intro v + rw [mem_certificateUsedSupports, ZFSet.mem_sUnion] + constructor + · rintro ⟨_, z, F, B, f, edge, member⟩ + have bound := ZFSet.pair_mem_prod.1 (function.1 edge) + have hB := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 bound.2).2).1 + exact ⟨B, (mem_relationImage _ _ _ _).2 + ⟨hB, z, bound.1, (M.pair_mem_certificateBasisGraph function z B).2 ⟨F, f, edge⟩⟩, member⟩ + · rintro ⟨B, hB, member⟩ + obtain ⟨hB, z, _, edge⟩ := (mem_relationImage _ _ _ _).1 hB + obtain ⟨F, f, original⟩ := (M.pair_mem_certificateBasisGraph function z B).1 edge + exact ⟨((M.mem_groundSmallSubsets _ _ _).1 hB).2.1 member, z, F, B, f, original, member⟩ + +theorem certificateUsedSupports_ground_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hN : N ∈ M.sets) (hk : k ∈ M.sets) + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) + (smallJ : M.groundEmbeddable J ZFSet.omega) : + certificateUsedSupports nodes k ∈ M.sets ∧ + M.groundEmbeddable (certificateUsedSupports nodes k) ZFSet.omega := by + have omega := M.omega_mem separation infinite + have hBases := M.groundSmallSubsets_mem powers separation hNodes omega + have hGraph := M.certificateBasisGraph_mem pairing unions powers separation hJ hNodes hN omega hk + have graphFunction := M.certificateBasisGraph_function function + have hRange := M.relationImage_mem separation hJ hBases hGraph + have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice + hJ hBases omega hGraph graphFunction smallJ + rw [M.certificateUsedSupports_eq_basisUnion function] + exact ⟨M.union_mem unions hRange, + M.groundCountable_family_union pairing unions powers separation infinite choice hRange rangeSmall + (fun B hB => ((M.mem_groundSmallSubsets _ _ _).1 + ((mem_relationImage _ _ _ _).1 hB).1).2.2)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateProfileImageFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateProfileImageFamilies.lean index 071b35d5ace54daeadfefab2b26e05dce94421cb..10363bc19eb256a0cf965c2b5e594197867826ad 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateProfileImageFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCertificateProfileImageFamilies.lean @@ -1,466 +1,466 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PreparedCertificateCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSupportedCertificateFamilies -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionEnumerations - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def synchronizedEnumerationBound (nodes N : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod (M.groundRelations ZFSet.omega nodes) (M.groundRelations ZFSet.omega N) - -theorem synchronizedEnumerationBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {nodes N : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : M.synchronizedEnumerationBound nodes N ∈ M.sets := - M.prod_mem pairing unions powers separation - (M.groundRelations_mem pairing unions powers separation omega hNodes) - (M.groundRelations_mem pairing unions powers separation omega hN) - -noncomputable def certificateEnumerationRelation (J nodes N k : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ j ∈ J, ∃ e ∈ M.groundRelations ZFSet.omega nodes, - ∃ names ∈ M.groundRelations ZFSet.omega N, - z = ZFSet.pair j (ZFSet.pair e names) ∧ - ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ - SynchronizedEnumerationCode ZFSet.omega N B f e names) - (ZFSet.prod J (M.synchronizedEnumerationBound nodes N)) - -theorem pair_mem_certificateEnumerationRelation (J nodes N k j e names : ZFSet.{u}) : - ZFSet.pair j (ZFSet.pair e names) ∈ M.certificateEnumerationRelation J nodes N k ↔ - j ∈ J ∧ e ∈ M.groundRelations ZFSet.omega nodes ∧ - names ∈ M.groundRelations ZFSet.omega N ∧ - ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ - SynchronizedEnumerationCode ZFSet.omega N B f e names := by - rw [certificateEnumerationRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, j', hj, e', he, names', hn, eq, F, B, f, stored, code⟩ - obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 eq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 tail - exact ⟨hj, he, hn, F, B, f, stored, code⟩ - · rintro ⟨hj, he, hn, F, B, f, stored, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hj, ZFSet.pair_mem_prod.2 ⟨he, hn⟩⟩, - j, hj, e, he, names, hn, rfl, F, B, f, stored, code⟩ - -theorem certificateEnumerationRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hN : N ∈ M.sets) (hk : k ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.certificateEnumerationRelation J nodes N k ∈ M.sets := by - have hE := M.groundRelations_mem pairing unions powers separation omega hNodes - have hNames := M.groundRelations_mem pairing unions powers separation omega hN - let params := extend J (extend (M.groundRelations ZFSet.omega nodes) - (extend (M.groundRelations ZFSet.omega N) (extend ZFSet.omega - (extend N (extend k Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.certificateEnumerationEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hJ (Fin.cases hE (Fin.cases hNames (Fin.cases omega - (Fin.cases hN (Fin.cases hk (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hJ - (M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hN omega)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.certificateEnumerationEntryFormula 0 1 2 3 4 5 6) - (extend z params)) (ZFSet.prod J (M.synchronizedEnumerationBound nodes N)) = - M.certificateEnumerationRelation J nodes N k := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, certificateEnumerationRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_certificateEnumerationEntryFormula 0 1 2 3 4 5 6 _) - exact equal ▸ selected - -theorem exists_supportedCertificateEnumerations - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hN : N ∈ M.sets) (hk : k ∈ M.sets) - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) - (certificates : ∀ j F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - B.Nonempty ∧ ZFSet.IsFunc B N f) : - ∃ enumerations ∈ M.sets, - ZFSet.IsFunc J (M.synchronizedEnumerationBound nodes N) enumerations ∧ - enumerations ⊆ M.certificateEnumerationRelation J nodes N k ∧ - ∀ j F B f e names, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → - SynchronizedEnumerationCode ZFSet.omega N B f e names := by - have omega := M.omega_mem separation infinite - have bound := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hN omega - have relation := M.certificateEnumerationRelation_mem pairing unions powers separation - hJ hNodes hN hk omega - have total : ∀ j ∈ J, ∃ pair ∈ M.synchronizedEnumerationBound nodes N, - ZFSet.pair j pair ∈ M.certificateEnumerationRelation J nodes N k := by - intro j hj - obtain ⟨c, jc, _⟩ := function.2 j hj - have hc := (ZFSet.pair_mem_prod.1 (function.1 jc)).2 - obtain ⟨F, _, tail, htail, rfl⟩ := ZFSet.mem_prod.1 hc - obtain ⟨B, _, f, _, rfl⟩ := ZFSet.mem_prod.1 htail - have fields := (M.mem_supportedEqualityCertificateBound nodes N F B f).1 - (ZFSet.pair_mem_prod.1 (function.1 jc)).2 - obtain ⟨nonempty, ff⟩ := certificates j F B f jc - obtain ⟨e, he, names, hn, ef, nf, onto, forward, backward⟩ := - M.groundFunction_enumeration pairing unions powers separation infinite - fields.2.1.1 hN fields.2.2.1 nonempty fields.2.1.2.2 ff - have eBound : e ∈ M.groundRelations ZFSet.omega nodes := by - refine (M.mem_groundRelations ZFSet.omega nodes e).2 ⟨he, ?_⟩ - intro z hz - obtain ⟨n, hno, v, hv, rfl⟩ := ZFSet.mem_prod.1 (ef.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hno, fields.2.1.2.1 hv⟩ - have nBound := (M.mem_groundRelations ZFSet.omega N names).2 ⟨hn, nf.1⟩ - refine ⟨ZFSet.pair e names, ZFSet.pair_mem_prod.2 ⟨eBound, nBound⟩, ?_⟩ - exact (M.pair_mem_certificateEnumerationRelation J nodes N k j e names).2 - ⟨hj, eBound, nBound, F, B, f, jc, ff, ef, nf, onto, forward, backward⟩ - obtain ⟨enumerations, ground, selectedFunction, selected⟩ := - M.uniformize_relation pairing unions powers separation choice hJ bound relation total - refine ⟨enumerations, ground, selectedFunction, selected, ?_⟩ - intro j F B f e names stored entry - obtain ⟨hj, _, _, F', B', f', stored', code⟩ := - (M.pair_mem_certificateEnumerationRelation J nodes N k j e names).1 (selected entry) - obtain ⟨_, _, unique⟩ := function.2 j hj - have equal := (unique _ stored').trans (unique _ stored).symm - have tail := (ZFSet.pair_inj.1 equal).2 - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 tail - exact code - -end TransitiveGround - -section -open SetFormula -universe u - -def PreparedCertificateFamilyCode (M : TransitiveGround.{u}) - (P order q nodes nodeOrder meet N visibility top omega J C E k enumerations : ZFSet.{u}) : Prop := - ZFSet.IsFunc J C k ∧ ZFSet.IsFunc J E enumerations ∧ - ∀ z F B f e names, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - ZFSet.pair z (ZFSet.pair e names) ∈ enumerations → - PreparedCertificateCode M P order q nodes nodeOrder meet N visibility top omega z F B f e names - -namespace SetFormula - -private def preparedFamilyEntries {n} - (P order q nodes nodeOrder meet N visibility top omega k enumerations : Fin n) : SetFormula n := - .all (.all (.all (.all (.all (.all - (imp (.conj (BoundedFormula.certificateGraphEntryAt 5 4 3 2 - k.succ.succ.succ.succ.succ.succ).toFormula - (BoundedFormula.enumerationGraphEntryAt 5 1 0 - enumerations.succ.succ.succ.succ.succ.succ).toFormula) - (preparedCertificateFormula P.succ.succ.succ.succ.succ.succ - order.succ.succ.succ.succ.succ.succ q.succ.succ.succ.succ.succ.succ - nodes.succ.succ.succ.succ.succ.succ nodeOrder.succ.succ.succ.succ.succ.succ - meet.succ.succ.succ.succ.succ.succ N.succ.succ.succ.succ.succ.succ - visibility.succ.succ.succ.succ.succ.succ top.succ.succ.succ.succ.succ.succ - omega.succ.succ.succ.succ.succ.succ 5 4 3 2 1 0))))))) - -def preparedCertificateFamilyFormula {n} - (P order q nodes nodeOrder meet N visibility top omega J C E k enumerations : Fin n) : SetFormula n := - .conj (BoundedFormula.functionFormula J C k).toFormula - (.conj (BoundedFormula.functionFormula J E enumerations).toFormula - (preparedFamilyEntries P order q nodes nodeOrder meet N visibility top omega k enumerations)) - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_preparedCertificateFamilyFormula {n} - (P order q nodes nodeOrder meet N visibility top omega J C E k enumerations : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meetCode : MeetOrderCode (env nodes) (env nodeOrder) (env meet)) : - Realize M.sets - (preparedCertificateFamilyFormula P order q nodes nodeOrder meet N visibility top omega J C E k enumerations) env ↔ - PreparedCertificateFamilyCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) - (env meet) (env N) (env visibility) (env top) (env omega) (env J) - (env C) (env E) (env k) (env enumerations) := by - have entries : Realize M.sets - (SetFormula.preparedFamilyEntries P order q nodes nodeOrder meet N visibility top omega k enumerations) env ↔ - ∀ z F B f e names, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ env k → - ZFSet.pair z (ZFSet.pair e names) ∈ env enumerations → - PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) - (env meet) (env N) (env visibility) (env top) (env omega) z F B f e names := by - let body := SetFormula.imp - (.conj (BoundedFormula.certificateGraphEntryAt 5 4 3 2 k.succ.succ.succ.succ.succ.succ).toFormula - (BoundedFormula.enumerationGraphEntryAt 5 1 0 enumerations.succ.succ.succ.succ.succ.succ).toFormula) - (preparedCertificateFormula P.succ.succ.succ.succ.succ.succ order.succ.succ.succ.succ.succ.succ - q.succ.succ.succ.succ.succ.succ nodes.succ.succ.succ.succ.succ.succ - nodeOrder.succ.succ.succ.succ.succ.succ meet.succ.succ.succ.succ.succ.succ - N.succ.succ.succ.succ.succ.succ visibility.succ.succ.succ.succ.succ.succ - top.succ.succ.succ.succ.succ.succ omega.succ.succ.succ.succ.succ.succ 5 4 3 2 1 0) - have meaning (z F B f e names : ZFSet.{u}) - (hz : z ∈ M.sets) (hF : F ∈ M.sets) (hB : B ∈ M.sets) - (hf : f ∈ M.sets) (he : e ∈ M.sets) (hn : names ∈ M.sets) : - Realize M.sets body (extend names (extend e (extend f (extend B (extend F (extend z env)))))) ↔ - (ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧ - ZFSet.pair z (ZFSet.pair e names) ∈ env enumerations → - PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) - (env meet) (env N) (env visibility) (env top) (env omega) z F B f e names) := by - have extended : ∀ i, (extend names (extend e (extend f (extend B (extend F (extend z env)))))) i ∈ M.sets := Fin.cases hn (Fin.cases he (Fin.cases hf - (Fin.cases hB (Fin.cases hF (Fin.cases hz members))))) - dsimp only [body] - rw [realize_imp, Realize, BoundedFormula.realize_toFormula M _ _ extended, - BoundedFormula.truth_certificateGraphEntryAt, BoundedFormula.realize_toFormula M _ _ extended, - BoundedFormula.truth_enumerationGraphEntryAt, - M.realize_preparedCertificateFormula - P.succ.succ.succ.succ.succ.succ order.succ.succ.succ.succ.succ.succ - q.succ.succ.succ.succ.succ.succ nodes.succ.succ.succ.succ.succ.succ - nodeOrder.succ.succ.succ.succ.succ.succ meet.succ.succ.succ.succ.succ.succ - N.succ.succ.succ.succ.succ.succ visibility.succ.succ.succ.succ.succ.succ - top.succ.succ.succ.succ.succ.succ omega.succ.succ.succ.succ.succ.succ - 5 4 3 2 1 0 _ extended meetCode] - rfl - change (∀ z ∈ M.sets, ∀ F ∈ M.sets, ∀ B ∈ M.sets, ∀ f ∈ M.sets, - ∀ e ∈ M.sets, ∀ names ∈ M.sets, - Realize M.sets body (extend names (extend e (extend f (extend B (extend F (extend z env))))))) ↔ _ - constructor - · intro holds z F B f e names stored enumerated - have kc := M.pair_right (M.transitive (members k) stored) - have ec := M.pair_right (M.transitive (members enumerations) enumerated) - have hz := M.pair_left (M.transitive (members k) stored) - have hF := M.pair_left kc - have hB := M.pair_left (M.pair_right kc) - have hf := M.pair_right (M.pair_right kc) - have he := M.pair_left ec - have hn := M.pair_right ec - exact (meaning z F B f e names hz hF hB hf he hn).1 - (holds z hz F hF B hB f hf e he names hn) ⟨stored, enumerated⟩ - · intro holds z hz F hF B hB f hf e he names hn - exact (meaning z F B f e names hz hF hB hf he hn).2 - (fun h => holds z F B f e names h.1 h.2) - simp only [preparedCertificateFamilyFormula, Realize] - rw [BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_functionFormula, - BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_functionFormula, entries] - rfl - -end TransitiveGround - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def certificateProfileGraph (J nodes W k : ZFSet.{u}) : ZFSet.{u} := - relationCompose J (M.supportedEqualityCertificateBound nodes W) (M.groundPower nodes) k - (productFirst (M.groundPower nodes) - (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes W))) - -noncomputable def certificateProfileImage (J nodes W k : ZFSet.{u}) : ZFSet.{u} := - relationImage J (M.groundPower nodes) (M.certificateProfileGraph J nodes W k) - -theorem certificateProfileGraph_function {J nodes W k : ZFSet.{u}} - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) : - ZFSet.IsFunc J (M.groundPower nodes) (M.certificateProfileGraph J nodes W k) := - relationCompose_function_of_subset function - (productFirst_function (M.groundPower nodes) - (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes W))) - (fun _ member => member) - -theorem pair_mem_certificateProfileGraph {J nodes W k : ZFSet.{u}} - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) - (z F : ZFSet.{u}) : - ZFSet.pair z F ∈ M.certificateProfileGraph J nodes W k ↔ - ∃ B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k := by - rw [certificateProfileGraph, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, value, _, edge, projection⟩ - obtain ⟨profile, hp, tail, ht, equal⟩ := (mem_productFirst _ _ _).1 projection - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨B, hB, f, hf, rfl⟩ := ZFSet.mem_prod.1 ht - exact ⟨B, f, edge⟩ - · rintro ⟨B, f, edge⟩ - have bounds := ZFSet.pair_mem_prod.1 (function.1 edge) - have fields := ZFSet.pair_mem_prod.1 bounds.2 - exact ⟨bounds.1, fields.1, _, bounds.2, edge, - (mem_productFirst _ _ _).2 ⟨F, fields.1, _, fields.2, rfl⟩⟩ - -theorem mem_certificateProfileImage {J nodes W k : ZFSet.{u}} - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) - (F : ZFSet.{u}) : - F ∈ M.certificateProfileImage J nodes W k ↔ - ∃ z B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k := by - rw [certificateProfileImage, mem_relationImage] - constructor - · rintro ⟨_, z, _, edge⟩ - obtain ⟨B, f, selected⟩ := (M.pair_mem_certificateProfileGraph function z F).1 edge - exact ⟨z, B, f, selected⟩ - · rintro ⟨z, B, f, edge⟩ - have projected := (M.pair_mem_certificateProfileGraph function z F).2 ⟨B, f, edge⟩ - have bounds := ZFSet.pair_mem_prod.1 ((M.certificateProfileGraph_function function).1 projected) - exact ⟨bounds.2, z, bounds.1, projected⟩ - -theorem certificateProfileGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {J nodes W k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hW : W ∈ M.sets) (hk : k ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.certificateProfileGraph J nodes W k ∈ M.sets := by - have hProfiles := M.groundPower_mem powers hNodes - have hTail := M.prod_mem pairing unions powers separation - (M.groundSmallSubsets_mem powers separation hNodes omega) - (M.groundRelations_mem pairing unions powers separation hNodes hW) - exact M.relationCompose_mem pairing unions powers separation hJ - (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega) - hProfiles hk (M.productFirst_mem pairing unions powers separation hProfiles hTail) - -theorem certificateProfileImage_mem_small - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {J nodes W k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) - (hW : W ∈ M.sets) (hk : k ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) - (smallJ : M.groundEmbeddable J ZFSet.omega) : - M.certificateProfileImage J nodes W k ∈ M.sets ∧ - M.groundEmbeddable (M.certificateProfileImage J nodes W k) ZFSet.omega := by - have graph := M.certificateProfileGraph_mem pairing unions powers separation hJ hNodes hW hk omega - have profiles := M.groundPower_mem powers hNodes - exact ⟨M.relationImage_mem separation hJ profiles graph, - M.groundEmbeddable_function_image pairing unions powers separation choice hJ profiles omega - graph (M.certificateProfileGraph_function function) smallJ⟩ - -theorem certificateProfileImage_meetFilter - {P order q nodes nodeOrder meet N visibility top omega J W k enumerations : ZFSet.{u}} - (family : PreparedCertificateFamilyCode M P order q nodes nodeOrder meet N visibility top omega J - (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) - k enumerations) {F : ZFSet.{u}} - (member : F ∈ M.certificateProfileImage J nodes W k) : - MeetFilterCode nodes nodeOrder meet F := by - obtain ⟨z, B, f, edge⟩ := (M.mem_certificateProfileImage family.1 F).1 member - have hz := (ZFSet.pair_mem_prod.1 (family.1.1 edge)).1 - obtain ⟨value, enumerated, _unique⟩ := family.2.1.2 z hz - have bounds := (ZFSet.pair_mem_prod.1 (family.2.1.1 enumerated)).2 - obtain ⟨e, _he, names, _hn, rfl⟩ := ZFSet.mem_prod.1 bounds - exact (family.2.2 z F B f e names edge enumerated).1 - -theorem certificateProfileImage_eq_of_domain_subset {J D nodes W k : ZFSet.{u}} - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) - (subset : J ⊆ D) : - M.certificateProfileImage D nodes W k = M.certificateProfileImage J nodes W k := by - apply ZFSet.ext - intro F - simp only [certificateProfileImage, certificateProfileGraph, mem_relationImage, - pair_mem_relationCompose] - constructor - · rintro ⟨hF, z, _hzD, _, _, c, hc, edge, projected⟩ - have hz := (ZFSet.pair_mem_prod.1 (function.1 edge)).1 - exact ⟨hF, z, hz, hz, hF, c, hc, edge, projected⟩ - · rintro ⟨hF, z, hz, _, _, c, hc, edge, projected⟩ - exact ⟨hF, z, subset hz, subset hz, hF, c, hc, edge, projected⟩ - -noncomputable def certificateProfileImageFamily (nodes W : ZFSet.{u}) : ZFSet.{u} := - familyCodeGraph - (fun k : M.groundRelations W (M.supportedEqualityCertificateBound nodes W) => k.val) - (fun k => M.certificateProfileImage W nodes W k.val) - -theorem mem_certificateProfileImageFamily (nodes W z : ZFSet.{u}) : - z ∈ M.certificateProfileImageFamily nodes W ↔ - ∃ k ∈ M.groundRelations W (M.supportedEqualityCertificateBound nodes W), - z = ZFSet.pair k (M.certificateProfileImage W nodes W k) := by - rw [certificateProfileImageFamily, mem_familyCodeGraph] - constructor - · rintro ⟨k, equal⟩ - exact ⟨k.val, k.property, equal.symm⟩ - · rintro ⟨k, hk, equal⟩ - exact ⟨⟨k, hk⟩, equal.symm⟩ - -theorem pair_mem_certificateProfileImageFamily (nodes W k image : ZFSet.{u}) : - ZFSet.pair k image ∈ M.certificateProfileImageFamily nodes W ↔ - k ∈ M.groundRelations W (M.supportedEqualityCertificateBound nodes W) ∧ - image = M.certificateProfileImage W nodes W k := by - rw [M.mem_certificateProfileImageFamily] - constructor - · rintro ⟨r, hr, equal⟩ - obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal - exact ⟨hr, value⟩ - · rintro ⟨hk, rfl⟩ - exact ⟨k, hk, rfl⟩ - -private noncomputable def profileRelationImageDefinition - (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => - relationImage (env 0) (env 1) (env 2)) where - formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula - closed := fun _ members => M.relationImage_mem separation (members 0) (members 1) (members 2) - correct := by - intro env members z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_relationImageEqualityFormula] - rfl - -private noncomputable def profileImageDefinition - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => - relationImage (env 1) (env 3) - (relationCompose (env 1) (env 2) (env 3) (env 0) (env 4))) := by - let v := GroundSetTerm.var M (n := 5) - let composed := GroundSetTerm.app (M.definable_relationCompose pairing unions powers separation) - ![v 1, v 2, v 3, v 0, v 4] - exact (GroundSetTerm.app (profileRelationImageDefinition M separation) - ![v 1, v 3, composed]).definition - -theorem certificateProfileImageFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {nodes W : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hW : W ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.certificateProfileImageFamily nodes W ∈ M.sets := by - let C := M.supportedEqualityCertificateBound nodes W - let PF := M.groundPower nodes - let projection := productFirst PF - (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes W)) - have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega - have hPF := M.groundPower_mem powers hNodes - have hProjection := M.productFirst_mem pairing unions powers separation hPF - (M.prod_mem pairing unions powers separation - (M.groundSmallSubsets_mem powers separation hNodes omega) - (M.groundRelations_mem pairing unions powers separation hNodes hW)) - let defined := profileImageDefinition M pairing unions powers separation - change defined.graph (extend W (extend C (extend PF (extend projection Fin.elim0)))) - (M.groundRelations W C) ∈ M.sets - exact defined.graph_mem pairing separation collection _ - (Fin.cases hW (Fin.cases hC (Fin.cases hPF (Fin.cases hProjection (fun j => Fin.elim0 j))))) - (M.groundRelations_mem pairing unions powers separation hW hC) - -theorem certificateProfileImageFamily_function - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {nodes W : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hW : W ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - ZFSet.IsFunc (M.groundRelations W (M.supportedEqualityCertificateBound nodes W)) - (M.groundPower (M.groundPower nodes)) (M.certificateProfileImageFamily nodes W) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨k, hk, rfl⟩ := (M.mem_certificateProfileImageFamily nodes W z).1 hz - have groundK := ((M.mem_groundRelations _ _ k).1 hk).1 - have groundGraph := M.certificateProfileGraph_mem pairing unions powers separation - hW hNodes hW groundK omega - have groundImage := M.relationImage_mem separation hW (M.groundPower_mem powers hNodes) - groundGraph - exact ZFSet.pair_mem_prod.2 ⟨hk, (M.mem_groundPower _ _).2 - ⟨groundImage, fun F member => (mem_relationImage _ _ _ F).1 member |>.1⟩⟩ - · intro k hk - exact ⟨M.certificateProfileImage W nodes W k, - (M.pair_mem_certificateProfileImageFamily nodes W k _).2 ⟨hk, rfl⟩, - fun image edge => ((M.pair_mem_certificateProfileImageFamily nodes W k image).1 edge).2⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PreparedCertificateCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSupportedCertificateFamilies +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionEnumerations + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def synchronizedEnumerationBound (nodes N : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod (M.groundRelations ZFSet.omega nodes) (M.groundRelations ZFSet.omega N) + +theorem synchronizedEnumerationBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {nodes N : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hN : N ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : M.synchronizedEnumerationBound nodes N ∈ M.sets := + M.prod_mem pairing unions powers separation + (M.groundRelations_mem pairing unions powers separation omega hNodes) + (M.groundRelations_mem pairing unions powers separation omega hN) + +noncomputable def certificateEnumerationRelation (J nodes N k : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ j ∈ J, ∃ e ∈ M.groundRelations ZFSet.omega nodes, + ∃ names ∈ M.groundRelations ZFSet.omega N, + z = ZFSet.pair j (ZFSet.pair e names) ∧ + ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ + SynchronizedEnumerationCode ZFSet.omega N B f e names) + (ZFSet.prod J (M.synchronizedEnumerationBound nodes N)) + +theorem pair_mem_certificateEnumerationRelation (J nodes N k j e names : ZFSet.{u}) : + ZFSet.pair j (ZFSet.pair e names) ∈ M.certificateEnumerationRelation J nodes N k ↔ + j ∈ J ∧ e ∈ M.groundRelations ZFSet.omega nodes ∧ + names ∈ M.groundRelations ZFSet.omega N ∧ + ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ + SynchronizedEnumerationCode ZFSet.omega N B f e names := by + rw [certificateEnumerationRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, j', hj, e', he, names', hn, eq, F, B, f, stored, code⟩ + obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 eq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 tail + exact ⟨hj, he, hn, F, B, f, stored, code⟩ + · rintro ⟨hj, he, hn, F, B, f, stored, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hj, ZFSet.pair_mem_prod.2 ⟨he, hn⟩⟩, + j, hj, e, he, names, hn, rfl, F, B, f, stored, code⟩ + +theorem certificateEnumerationRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hN : N ∈ M.sets) (hk : k ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.certificateEnumerationRelation J nodes N k ∈ M.sets := by + have hE := M.groundRelations_mem pairing unions powers separation omega hNodes + have hNames := M.groundRelations_mem pairing unions powers separation omega hN + let params := extend J (extend (M.groundRelations ZFSet.omega nodes) + (extend (M.groundRelations ZFSet.omega N) (extend ZFSet.omega + (extend N (extend k Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.certificateEnumerationEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hJ (Fin.cases hE (Fin.cases hNames (Fin.cases omega + (Fin.cases hN (Fin.cases hk (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hJ + (M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hN omega)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.certificateEnumerationEntryFormula 0 1 2 3 4 5 6) + (extend z params)) (ZFSet.prod J (M.synchronizedEnumerationBound nodes N)) = + M.certificateEnumerationRelation J nodes N k := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, certificateEnumerationRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_certificateEnumerationEntryFormula 0 1 2 3 4 5 6 _) + exact equal ▸ selected + +theorem exists_supportedCertificateEnumerations + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {J nodes N k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hN : N ∈ M.sets) (hk : k ∈ M.sets) + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes N) k) + (certificates : ∀ j F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + B.Nonempty ∧ ZFSet.IsFunc B N f) : + ∃ enumerations ∈ M.sets, + ZFSet.IsFunc J (M.synchronizedEnumerationBound nodes N) enumerations ∧ + enumerations ⊆ M.certificateEnumerationRelation J nodes N k ∧ + ∀ j F B f e names, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → + SynchronizedEnumerationCode ZFSet.omega N B f e names := by + have omega := M.omega_mem separation infinite + have bound := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hN omega + have relation := M.certificateEnumerationRelation_mem pairing unions powers separation + hJ hNodes hN hk omega + have total : ∀ j ∈ J, ∃ pair ∈ M.synchronizedEnumerationBound nodes N, + ZFSet.pair j pair ∈ M.certificateEnumerationRelation J nodes N k := by + intro j hj + obtain ⟨c, jc, _⟩ := function.2 j hj + have hc := (ZFSet.pair_mem_prod.1 (function.1 jc)).2 + obtain ⟨F, _, tail, htail, rfl⟩ := ZFSet.mem_prod.1 hc + obtain ⟨B, _, f, _, rfl⟩ := ZFSet.mem_prod.1 htail + have fields := (M.mem_supportedEqualityCertificateBound nodes N F B f).1 + (ZFSet.pair_mem_prod.1 (function.1 jc)).2 + obtain ⟨nonempty, ff⟩ := certificates j F B f jc + obtain ⟨e, he, names, hn, ef, nf, onto, forward, backward⟩ := + M.groundFunction_enumeration pairing unions powers separation infinite + fields.2.1.1 hN fields.2.2.1 nonempty fields.2.1.2.2 ff + have eBound : e ∈ M.groundRelations ZFSet.omega nodes := by + refine (M.mem_groundRelations ZFSet.omega nodes e).2 ⟨he, ?_⟩ + intro z hz + obtain ⟨n, hno, v, hv, rfl⟩ := ZFSet.mem_prod.1 (ef.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hno, fields.2.1.2.1 hv⟩ + have nBound := (M.mem_groundRelations ZFSet.omega N names).2 ⟨hn, nf.1⟩ + refine ⟨ZFSet.pair e names, ZFSet.pair_mem_prod.2 ⟨eBound, nBound⟩, ?_⟩ + exact (M.pair_mem_certificateEnumerationRelation J nodes N k j e names).2 + ⟨hj, eBound, nBound, F, B, f, jc, ff, ef, nf, onto, forward, backward⟩ + obtain ⟨enumerations, ground, selectedFunction, selected⟩ := + M.uniformize_relation pairing unions powers separation choice hJ bound relation total + refine ⟨enumerations, ground, selectedFunction, selected, ?_⟩ + intro j F B f e names stored entry + obtain ⟨hj, _, _, F', B', f', stored', code⟩ := + (M.pair_mem_certificateEnumerationRelation J nodes N k j e names).1 (selected entry) + obtain ⟨_, _, unique⟩ := function.2 j hj + have equal := (unique _ stored').trans (unique _ stored).symm + have tail := (ZFSet.pair_inj.1 equal).2 + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 tail + exact code + +end TransitiveGround + +section +open SetFormula +universe u + +def PreparedCertificateFamilyCode (M : TransitiveGround.{u}) + (P order q nodes nodeOrder meet N visibility top omega J C E k enumerations : ZFSet.{u}) : Prop := + ZFSet.IsFunc J C k ∧ ZFSet.IsFunc J E enumerations ∧ + ∀ z F B f e names, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + ZFSet.pair z (ZFSet.pair e names) ∈ enumerations → + PreparedCertificateCode M P order q nodes nodeOrder meet N visibility top omega z F B f e names + +namespace SetFormula + +private def preparedFamilyEntries {n} + (P order q nodes nodeOrder meet N visibility top omega k enumerations : Fin n) : SetFormula n := + .all (.all (.all (.all (.all (.all + (imp (.conj (BoundedFormula.certificateGraphEntryAt 5 4 3 2 + k.succ.succ.succ.succ.succ.succ).toFormula + (BoundedFormula.enumerationGraphEntryAt 5 1 0 + enumerations.succ.succ.succ.succ.succ.succ).toFormula) + (preparedCertificateFormula P.succ.succ.succ.succ.succ.succ + order.succ.succ.succ.succ.succ.succ q.succ.succ.succ.succ.succ.succ + nodes.succ.succ.succ.succ.succ.succ nodeOrder.succ.succ.succ.succ.succ.succ + meet.succ.succ.succ.succ.succ.succ N.succ.succ.succ.succ.succ.succ + visibility.succ.succ.succ.succ.succ.succ top.succ.succ.succ.succ.succ.succ + omega.succ.succ.succ.succ.succ.succ 5 4 3 2 1 0))))))) + +def preparedCertificateFamilyFormula {n} + (P order q nodes nodeOrder meet N visibility top omega J C E k enumerations : Fin n) : SetFormula n := + .conj (BoundedFormula.functionFormula J C k).toFormula + (.conj (BoundedFormula.functionFormula J E enumerations).toFormula + (preparedFamilyEntries P order q nodes nodeOrder meet N visibility top omega k enumerations)) + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_preparedCertificateFamilyFormula {n} + (P order q nodes nodeOrder meet N visibility top omega J C E k enumerations : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meetCode : MeetOrderCode (env nodes) (env nodeOrder) (env meet)) : + Realize M.sets + (preparedCertificateFamilyFormula P order q nodes nodeOrder meet N visibility top omega J C E k enumerations) env ↔ + PreparedCertificateFamilyCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) + (env meet) (env N) (env visibility) (env top) (env omega) (env J) + (env C) (env E) (env k) (env enumerations) := by + have entries : Realize M.sets + (SetFormula.preparedFamilyEntries P order q nodes nodeOrder meet N visibility top omega k enumerations) env ↔ + ∀ z F B f e names, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ env k → + ZFSet.pair z (ZFSet.pair e names) ∈ env enumerations → + PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) + (env meet) (env N) (env visibility) (env top) (env omega) z F B f e names := by + let body := SetFormula.imp + (.conj (BoundedFormula.certificateGraphEntryAt 5 4 3 2 k.succ.succ.succ.succ.succ.succ).toFormula + (BoundedFormula.enumerationGraphEntryAt 5 1 0 enumerations.succ.succ.succ.succ.succ.succ).toFormula) + (preparedCertificateFormula P.succ.succ.succ.succ.succ.succ order.succ.succ.succ.succ.succ.succ + q.succ.succ.succ.succ.succ.succ nodes.succ.succ.succ.succ.succ.succ + nodeOrder.succ.succ.succ.succ.succ.succ meet.succ.succ.succ.succ.succ.succ + N.succ.succ.succ.succ.succ.succ visibility.succ.succ.succ.succ.succ.succ + top.succ.succ.succ.succ.succ.succ omega.succ.succ.succ.succ.succ.succ 5 4 3 2 1 0) + have meaning (z F B f e names : ZFSet.{u}) + (hz : z ∈ M.sets) (hF : F ∈ M.sets) (hB : B ∈ M.sets) + (hf : f ∈ M.sets) (he : e ∈ M.sets) (hn : names ∈ M.sets) : + Realize M.sets body (extend names (extend e (extend f (extend B (extend F (extend z env)))))) ↔ + (ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧ + ZFSet.pair z (ZFSet.pair e names) ∈ env enumerations → + PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder) + (env meet) (env N) (env visibility) (env top) (env omega) z F B f e names) := by + have extended : ∀ i, (extend names (extend e (extend f (extend B (extend F (extend z env)))))) i ∈ M.sets := Fin.cases hn (Fin.cases he (Fin.cases hf + (Fin.cases hB (Fin.cases hF (Fin.cases hz members))))) + dsimp only [body] + rw [realize_imp, Realize, BoundedFormula.realize_toFormula M _ _ extended, + BoundedFormula.truth_certificateGraphEntryAt, BoundedFormula.realize_toFormula M _ _ extended, + BoundedFormula.truth_enumerationGraphEntryAt, + M.realize_preparedCertificateFormula + P.succ.succ.succ.succ.succ.succ order.succ.succ.succ.succ.succ.succ + q.succ.succ.succ.succ.succ.succ nodes.succ.succ.succ.succ.succ.succ + nodeOrder.succ.succ.succ.succ.succ.succ meet.succ.succ.succ.succ.succ.succ + N.succ.succ.succ.succ.succ.succ visibility.succ.succ.succ.succ.succ.succ + top.succ.succ.succ.succ.succ.succ omega.succ.succ.succ.succ.succ.succ + 5 4 3 2 1 0 _ extended meetCode] + rfl + change (∀ z ∈ M.sets, ∀ F ∈ M.sets, ∀ B ∈ M.sets, ∀ f ∈ M.sets, + ∀ e ∈ M.sets, ∀ names ∈ M.sets, + Realize M.sets body (extend names (extend e (extend f (extend B (extend F (extend z env))))))) ↔ _ + constructor + · intro holds z F B f e names stored enumerated + have kc := M.pair_right (M.transitive (members k) stored) + have ec := M.pair_right (M.transitive (members enumerations) enumerated) + have hz := M.pair_left (M.transitive (members k) stored) + have hF := M.pair_left kc + have hB := M.pair_left (M.pair_right kc) + have hf := M.pair_right (M.pair_right kc) + have he := M.pair_left ec + have hn := M.pair_right ec + exact (meaning z F B f e names hz hF hB hf he hn).1 + (holds z hz F hF B hB f hf e he names hn) ⟨stored, enumerated⟩ + · intro holds z hz F hF B hB f hf e he names hn + exact (meaning z F B f e names hz hF hB hf he hn).2 + (fun h => holds z F B f e names h.1 h.2) + simp only [preparedCertificateFamilyFormula, Realize] + rw [BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_functionFormula, + BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_functionFormula, entries] + rfl + +end TransitiveGround + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def certificateProfileGraph (J nodes W k : ZFSet.{u}) : ZFSet.{u} := + relationCompose J (M.supportedEqualityCertificateBound nodes W) (M.groundPower nodes) k + (productFirst (M.groundPower nodes) + (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes W))) + +noncomputable def certificateProfileImage (J nodes W k : ZFSet.{u}) : ZFSet.{u} := + relationImage J (M.groundPower nodes) (M.certificateProfileGraph J nodes W k) + +theorem certificateProfileGraph_function {J nodes W k : ZFSet.{u}} + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) : + ZFSet.IsFunc J (M.groundPower nodes) (M.certificateProfileGraph J nodes W k) := + relationCompose_function_of_subset function + (productFirst_function (M.groundPower nodes) + (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes W))) + (fun _ member => member) + +theorem pair_mem_certificateProfileGraph {J nodes W k : ZFSet.{u}} + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) + (z F : ZFSet.{u}) : + ZFSet.pair z F ∈ M.certificateProfileGraph J nodes W k ↔ + ∃ B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k := by + rw [certificateProfileGraph, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, value, _, edge, projection⟩ + obtain ⟨profile, hp, tail, ht, equal⟩ := (mem_productFirst _ _ _).1 projection + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨B, hB, f, hf, rfl⟩ := ZFSet.mem_prod.1 ht + exact ⟨B, f, edge⟩ + · rintro ⟨B, f, edge⟩ + have bounds := ZFSet.pair_mem_prod.1 (function.1 edge) + have fields := ZFSet.pair_mem_prod.1 bounds.2 + exact ⟨bounds.1, fields.1, _, bounds.2, edge, + (mem_productFirst _ _ _).2 ⟨F, fields.1, _, fields.2, rfl⟩⟩ + +theorem mem_certificateProfileImage {J nodes W k : ZFSet.{u}} + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) + (F : ZFSet.{u}) : + F ∈ M.certificateProfileImage J nodes W k ↔ + ∃ z B f, ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k := by + rw [certificateProfileImage, mem_relationImage] + constructor + · rintro ⟨_, z, _, edge⟩ + obtain ⟨B, f, selected⟩ := (M.pair_mem_certificateProfileGraph function z F).1 edge + exact ⟨z, B, f, selected⟩ + · rintro ⟨z, B, f, edge⟩ + have projected := (M.pair_mem_certificateProfileGraph function z F).2 ⟨B, f, edge⟩ + have bounds := ZFSet.pair_mem_prod.1 ((M.certificateProfileGraph_function function).1 projected) + exact ⟨bounds.2, z, bounds.1, projected⟩ + +theorem certificateProfileGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {J nodes W k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hW : W ∈ M.sets) (hk : k ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.certificateProfileGraph J nodes W k ∈ M.sets := by + have hProfiles := M.groundPower_mem powers hNodes + have hTail := M.prod_mem pairing unions powers separation + (M.groundSmallSubsets_mem powers separation hNodes omega) + (M.groundRelations_mem pairing unions powers separation hNodes hW) + exact M.relationCompose_mem pairing unions powers separation hJ + (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega) + hProfiles hk (M.productFirst_mem pairing unions powers separation hProfiles hTail) + +theorem certificateProfileImage_mem_small + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {J nodes W k : ZFSet.{u}} (hJ : J ∈ M.sets) (hNodes : nodes ∈ M.sets) + (hW : W ∈ M.sets) (hk : k ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) + (smallJ : M.groundEmbeddable J ZFSet.omega) : + M.certificateProfileImage J nodes W k ∈ M.sets ∧ + M.groundEmbeddable (M.certificateProfileImage J nodes W k) ZFSet.omega := by + have graph := M.certificateProfileGraph_mem pairing unions powers separation hJ hNodes hW hk omega + have profiles := M.groundPower_mem powers hNodes + exact ⟨M.relationImage_mem separation hJ profiles graph, + M.groundEmbeddable_function_image pairing unions powers separation choice hJ profiles omega + graph (M.certificateProfileGraph_function function) smallJ⟩ + +theorem certificateProfileImage_meetFilter + {P order q nodes nodeOrder meet N visibility top omega J W k enumerations : ZFSet.{u}} + (family : PreparedCertificateFamilyCode M P order q nodes nodeOrder meet N visibility top omega J + (M.supportedEqualityCertificateBound nodes W) (M.synchronizedEnumerationBound nodes W) + k enumerations) {F : ZFSet.{u}} + (member : F ∈ M.certificateProfileImage J nodes W k) : + MeetFilterCode nodes nodeOrder meet F := by + obtain ⟨z, B, f, edge⟩ := (M.mem_certificateProfileImage family.1 F).1 member + have hz := (ZFSet.pair_mem_prod.1 (family.1.1 edge)).1 + obtain ⟨value, enumerated, _unique⟩ := family.2.1.2 z hz + have bounds := (ZFSet.pair_mem_prod.1 (family.2.1.1 enumerated)).2 + obtain ⟨e, _he, names, _hn, rfl⟩ := ZFSet.mem_prod.1 bounds + exact (family.2.2 z F B f e names edge enumerated).1 + +theorem certificateProfileImage_eq_of_domain_subset {J D nodes W k : ZFSet.{u}} + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k) + (subset : J ⊆ D) : + M.certificateProfileImage D nodes W k = M.certificateProfileImage J nodes W k := by + apply ZFSet.ext + intro F + simp only [certificateProfileImage, certificateProfileGraph, mem_relationImage, + pair_mem_relationCompose] + constructor + · rintro ⟨hF, z, _hzD, _, _, c, hc, edge, projected⟩ + have hz := (ZFSet.pair_mem_prod.1 (function.1 edge)).1 + exact ⟨hF, z, hz, hz, hF, c, hc, edge, projected⟩ + · rintro ⟨hF, z, hz, _, _, c, hc, edge, projected⟩ + exact ⟨hF, z, subset hz, subset hz, hF, c, hc, edge, projected⟩ + +noncomputable def certificateProfileImageFamily (nodes W : ZFSet.{u}) : ZFSet.{u} := + familyCodeGraph + (fun k : M.groundRelations W (M.supportedEqualityCertificateBound nodes W) => k.val) + (fun k => M.certificateProfileImage W nodes W k.val) + +theorem mem_certificateProfileImageFamily (nodes W z : ZFSet.{u}) : + z ∈ M.certificateProfileImageFamily nodes W ↔ + ∃ k ∈ M.groundRelations W (M.supportedEqualityCertificateBound nodes W), + z = ZFSet.pair k (M.certificateProfileImage W nodes W k) := by + rw [certificateProfileImageFamily, mem_familyCodeGraph] + constructor + · rintro ⟨k, equal⟩ + exact ⟨k.val, k.property, equal.symm⟩ + · rintro ⟨k, hk, equal⟩ + exact ⟨⟨k, hk⟩, equal.symm⟩ + +theorem pair_mem_certificateProfileImageFamily (nodes W k image : ZFSet.{u}) : + ZFSet.pair k image ∈ M.certificateProfileImageFamily nodes W ↔ + k ∈ M.groundRelations W (M.supportedEqualityCertificateBound nodes W) ∧ + image = M.certificateProfileImage W nodes W k := by + rw [M.mem_certificateProfileImageFamily] + constructor + · rintro ⟨r, hr, equal⟩ + obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal + exact ⟨hr, value⟩ + · rintro ⟨hk, rfl⟩ + exact ⟨k, hk, rfl⟩ + +private noncomputable def profileRelationImageDefinition + (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => + relationImage (env 0) (env 1) (env 2)) where + formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula + closed := fun _ members => M.relationImage_mem separation (members 0) (members 1) (members 2) + correct := by + intro env members z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_relationImageEqualityFormula] + rfl + +private noncomputable def profileImageDefinition + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => + relationImage (env 1) (env 3) + (relationCompose (env 1) (env 2) (env 3) (env 0) (env 4))) := by + let v := GroundSetTerm.var M (n := 5) + let composed := GroundSetTerm.app (M.definable_relationCompose pairing unions powers separation) + ![v 1, v 2, v 3, v 0, v 4] + exact (GroundSetTerm.app (profileRelationImageDefinition M separation) + ![v 1, v 3, composed]).definition + +theorem certificateProfileImageFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {nodes W : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hW : W ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.certificateProfileImageFamily nodes W ∈ M.sets := by + let C := M.supportedEqualityCertificateBound nodes W + let PF := M.groundPower nodes + let projection := productFirst PF + (ZFSet.prod (M.groundSmallSubsets nodes ZFSet.omega) (M.groundRelations nodes W)) + have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega + have hPF := M.groundPower_mem powers hNodes + have hProjection := M.productFirst_mem pairing unions powers separation hPF + (M.prod_mem pairing unions powers separation + (M.groundSmallSubsets_mem powers separation hNodes omega) + (M.groundRelations_mem pairing unions powers separation hNodes hW)) + let defined := profileImageDefinition M pairing unions powers separation + change defined.graph (extend W (extend C (extend PF (extend projection Fin.elim0)))) + (M.groundRelations W C) ∈ M.sets + exact defined.graph_mem pairing separation collection _ + (Fin.cases hW (Fin.cases hC (Fin.cases hPF (Fin.cases hProjection (fun j => Fin.elim0 j))))) + (M.groundRelations_mem pairing unions powers separation hW hC) + +theorem certificateProfileImageFamily_function + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {nodes W : ZFSet.{u}} (hNodes : nodes ∈ M.sets) (hW : W ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + ZFSet.IsFunc (M.groundRelations W (M.supportedEqualityCertificateBound nodes W)) + (M.groundPower (M.groundPower nodes)) (M.certificateProfileImageFamily nodes W) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨k, hk, rfl⟩ := (M.mem_certificateProfileImageFamily nodes W z).1 hz + have groundK := ((M.mem_groundRelations _ _ k).1 hk).1 + have groundGraph := M.certificateProfileGraph_mem pairing unions powers separation + hW hNodes hW groundK omega + have groundImage := M.relationImage_mem separation hW (M.groundPower_mem powers hNodes) + groundGraph + exact ZFSet.pair_mem_prod.2 ⟨hk, (M.mem_groundPower _ _).2 + ⟨groundImage, fun F member => (mem_relationImage _ _ _ F).1 member |>.1⟩⟩ + · intro k hk + exact ⟨M.certificateProfileImage W nodes W k, + (M.pair_mem_certificateProfileImageFamily nodes W k _).2 ⟨hk, rfl⟩, + fun image edge => ((M.pair_mem_certificateProfileImageFamily nodes W k image).1 edge).2⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCodedBinaryHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCodedBinaryHeights.lean index 95f9b0b47fdcf54c0480341e84b094e311574e64..08c6345f50b36dd7bb659f52a3ae601688af551c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCodedBinaryHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCodedBinaryHeights.lean @@ -1,758 +1,758 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PrincipalTileRealization -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundIdealProjections -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionHeightSteps -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRequestedCompressionTiles - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure StrictHeightGraphCode (L H rL rH h : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc L H h - strict : ∀ x ∈ L, ∀ y ∈ L, x ≠ y → ZFSet.pair x y ∈ rL → - ∀ a b, ZFSet.pair x a ∈ h → ZFSet.pair y b ∈ h → ZFSet.pair a b ∈ rH - -theorem StrictLexHeightCode.strictHeightGraph {L C D r h rD : ZFSet.{u}} - (code : StrictLexHeightCode L C D r h rD) : - StrictHeightGraphCode L (ZFSet.prod C D) r (lexHeightOrder C D rD) h := by - refine ⟨code.function, ?_⟩ - intro x hx y hy different lower a b first second - obtain ⟨c, hc, q, hq, eq⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (code.function.1 first)).2 - obtain ⟨d, hd, v, hv, eq'⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (code.function.1 second)).2 - subst a - subst b - exact (pair_mem_lexHeightOrder _ _ _ _ _ _ _).2 - ⟨hc, hq, hd, hv, code.strict x hx y hy c q d v lower different first second⟩ - -namespace TransitiveGround - -theorem exists_groundHeightInterpolation (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {L H rL rH seed D rD c lo hi : ZFSet.{u}} - (hL : L ∈ M.sets) (hH : H ∈ M.sets) (hrH : rH ∈ M.sets) (hSeed : seed ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (seedCode : StrictHeightGraphCode L H rL rH seed) - (linear : StrictLinearOrderCode H rH) (target : DenseOrderCode D rD) - (injection : InjectionCode D ZFSet.omega c) - (small : M.groundEmbeddable (relationImage L H seed) ZFSet.omega) - (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : - ∃ height ∈ M.sets, StrictHeightGraphCode L D rL rD height ∧ - (∀ x z, ZFSet.pair x z ∈ height → ZFSet.pair lo z ∈ rD ∧ ZFSet.pair z hi ∈ rD) ∧ - relationImage L D height ∈ M.sets ∧ - M.groundEmbeddable (relationImage L D height) ZFSet.omega ∧ - ∀ x y a b q z, ZFSet.pair x a ∈ seed → ZFSet.pair y b ∈ seed → - ZFSet.pair x q ∈ height → ZFSet.pair y z ∈ height → - (a = b ↔ q = z) ∧ (ZFSet.pair a b ∈ rH ↔ ZFSet.pair q z ∈ rD) := by - let R := relationImage L H seed - have hR := M.relationImage_mem separation hL hH hSeed - have hOrder : heightOrderRestriction R rH ∈ M.sets := - M.injection_restriction_mem separation hR hR hrH - have rLinear : StrictLinearOrderCode R (heightOrderRestriction R rH) := - heightOrderRestriction_linear linear (fun _ h => ((mem_relationImage L H seed _).1 h).1) - obtain ⟨e, he, embedding⟩ := M.exists_intervalEmbedding pairing unions powers separation collection infinite - hR hD hOrder hrD hc rLinear target injection small hlo hhi gap - let height := relationCompose L R D seed e - have function := relationCompose_function_of_subset (function_on_relationImage seedCode.function) - embedding.injection.function (fun _ h => h) - have ground : height ∈ M.sets := M.relationCompose_mem pairing unions powers separation hL hR hD hSeed he - have liftEntry {x a z : ZFSet.{u}} (source : ZFSet.pair x a ∈ seed) - (entry : ZFSet.pair x z ∈ height) : ZFSet.pair a z ∈ e := by - obtain ⟨_, _, a', _, other, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - obtain ⟨v, _, unique⟩ := seedCode.function.2 x (ZFSet.pair_mem_prod.1 (seedCode.function.1 source)).1 - have equal := (unique a source).trans (unique a' other).symm - exact equal.symm ▸ image - have exactOrder {x y a b q z : ZFSet.{u}} - (first : ZFSet.pair x a ∈ seed) (second : ZFSet.pair y b ∈ seed) - (left : ZFSet.pair x q ∈ height) (right : ZFSet.pair y z ∈ height) : - (a = b ↔ q = z) ∧ (ZFSet.pair a b ∈ rH ↔ ZFSet.pair q z ∈ rD) := by - have aq := liftEntry first left - have bz := liftEntry second right - have aR := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 aq)).1 - have bR := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 bz)).1 - refine ⟨?_, ?_⟩ - · constructor - · intro equal - subst b - obtain ⟨v, _, unique⟩ := embedding.injection.function.2 a aR - exact (unique q aq).trans (unique z bz).symm - · intro equal - subst z - exact embedding.injection.injective a b q aq bz - · have order := embedding.order a b q z aq bz - rw [pair_mem_heightOrderRestriction] at order - exact ⟨fun hab => order.1 ⟨hab, aR, bR⟩, fun hqz => (order.2 hqz).1⟩ - refine ⟨height, ground, ⟨function, ?_⟩, ?_, M.relationImage_mem separation hL hD ground, ?_, ?_⟩ - · intro x hx y hy different lower q z left right - obtain ⟨a, ax, _⟩ := seedCode.function.2 x hx - obtain ⟨b, byEntry, _⟩ := seedCode.function.2 y hy - exact (exactOrder ax byEntry left right).2.1 (seedCode.strict x hx y hy different lower a b ax byEntry) - · intro x z entry - obtain ⟨_, _, a, _, _, az⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - exact embedding.inside a z az - · exact M.groundEmbeddable_restrict separation (M.relationImage_mem separation hL hD ground) - (M.omega_mem separation infinite) (fun _ h => (mem_relationImage _ _ _ _).1 h |>.1) ⟨c, hc, injection⟩ - · intro x y a b q z first second left right - exact exactOrder first second left right - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open Compression.RecursiveMaps -universe u - -noncomputable def lexProductOrder (C D rC rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, - z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ - (ZFSet.pair c d ∈ rC ∨ (c = d ∧ ZFSet.pair q v ∈ rD))) - (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) - -theorem mem_lexProductOrder (C D rC rD z : ZFSet.{u}) : - z ∈ lexProductOrder C D rC rD ↔ - ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, - z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ - (ZFSet.pair c d ∈ rC ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · rintro ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 - ⟨ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩⟩, - c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ - -theorem pair_mem_lexProductOrder (C D rC rD c q d v : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∈ lexProductOrder C D rC rD ↔ - c ∈ C ∧ q ∈ D ∧ d ∈ C ∧ v ∈ D ∧ (ZFSet.pair c d ∈ rC ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by - rw [mem_lexProductOrder] - constructor - · rintro ⟨c', hc, q', hq, d', hd, v', hv, equal, lower⟩ - obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right - exact ⟨hc, hq, hd, hv, lower⟩ - · rintro ⟨hc, hq, hd, hv, lower⟩ - exact ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ - -theorem lexProductOrder_code {C D rC rD : ZFSet.{u}} - (columns : StrictLinearOrderCode C rC) (target : StrictLinearOrderCode D rD) : - StrictLinearOrderCode (ZFSet.prod C D) (lexProductOrder C D rC rD) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_, ?_, ?_⟩ - · intro x hx hxx - obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx - rcases ((pair_mem_lexProductOrder C D rC rD c q c q).1 hxx).2.2.2.2 with less | same - · exact columns.irrefl c (ZFSet.pair_mem_prod.1 (columns.shape less)).1 less - · exact target.irrefl q hq same.2 - · intro x y z hxy hyz - have xy := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hxy).1 - have yz := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hyz).1 - obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 xy.1 - obtain ⟨d, _, v, _, rfl⟩ := ZFSet.mem_prod.1 xy.2 - obtain ⟨b, hb, w, hw, rfl⟩ := ZFSet.mem_prod.1 yz.2 - have left := ((pair_mem_lexProductOrder C D rC rD c q d v).1 hxy).2.2.2.2 - have right := ((pair_mem_lexProductOrder C D rC rD d v b w).1 hyz).2.2.2.2 - apply (pair_mem_lexProductOrder C D rC rD c q b w).2 - refine ⟨hc, hq, hb, hw, ?_⟩ - rcases left with lower | ⟨same, inside⟩ - · rcases right with lower' | ⟨same', _⟩ - · exact Or.inl (columns.trans c d b lower lower') - · exact Or.inl (same' ▸ lower) - · rcases right with lower' | ⟨same', inside'⟩ - · exact Or.inl (same.symm ▸ lower') - · exact Or.inr ⟨same.trans same', target.trans q v w inside inside'⟩ - · intro x hx y hy - obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx - obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy - rcases columns.compare c hc d hd with lower | same | greater - · exact Or.inl ((pair_mem_lexProductOrder C D rC rD c q d v).2 ⟨hc, hq, hd, hv, Or.inl lower⟩) - · subst d - rcases target.compare q hq v hv with lower | same | greater - · exact Or.inl ((pair_mem_lexProductOrder C D rC rD c q c v).2 - ⟨hc, hq, hc, hv, Or.inr ⟨rfl, lower⟩⟩) - · exact Or.inr (Or.inl (congrArg (ZFSet.pair c) same)) - · exact Or.inr (Or.inr ((pair_mem_lexProductOrder C D rC rD c v c q).2 - ⟨hc, hv, hc, hq, Or.inr ⟨rfl, greater⟩⟩)) - · exact Or.inr (Or.inr ((pair_mem_lexProductOrder C D rC rD d v c q).2 - ⟨hd, hv, hc, hq, Or.inl greater⟩)) - -namespace BoundedFormula - -def lexProductEntryFormula {n} (z C D rC rD : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ - exMem C (exMem D.succ (exMem C.succ.succ (exMem D.succ.succ.succ - (.conj (pairOfPairsFormula (lift z) 3 2 1 0) - (disj (pairMembershipFormula 3 1 (lift rC)) (.conj (.equal 3 1) (pairMembershipFormula 2 0 (lift rD)))))))) - -theorem truth_lexProductEntryFormula {n} (z C D rC rD : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (lexProductEntryFormula z C D rC rD) env ↔ - ∃ c ∈ env C, ∃ q ∈ env D, ∃ d ∈ env C, ∃ v ∈ env D, - env z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ - (ZFSet.pair c d ∈ env rC ∨ (c = d ∧ ZFSet.pair q v ∈ env rD)) := by - simp only [lexProductEntryFormula, truth_exMem, Truth, truth_disj, - truth_pairOfPairsFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem lexProductOrder_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {C D rC rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrC : rC ∈ M.sets) (hrD : rD ∈ M.sets) : - lexProductOrder C D rC rD ∈ M.sets := by - have carrier := M.prod_mem pairing unions powers separation hC hD - let params := extend C (extend D (extend rC (extend rD Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.lexProductEntryFormula 0 1 2 3 4) params - (Fin.cases hC (Fin.cases hD (Fin.cases hrC (Fin.cases hrD (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation carrier carrier) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.lexProductEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) = lexProductOrder C D rC rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, lexProductOrder, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_lexProductEntryFormula 0 1 2 3 4 _) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps SetFormula -universe u - -noncomputable def StrictLinearOrderCode.smallOrder {H rH : ZFSet.{u}} - (code : StrictLinearOrderCode H rH) : LinearHeightOrder (SetMembers H) where - lt x y := ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ rH - irrefl x := code.irrefl _ (SetMembers.raw_mem x) - trans {x y z} := code.trans (SetMembers.raw x) (SetMembers.raw y) (SetMembers.raw z) - compare x y := (code.compare _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y)).imp id - (fun h => h.imp (fun eq => SetMembers.raw_injective H eq) id) - -noncomputable def StrictHeightGraphCode.smallHeight {L H rL rH h μ : ZFSet.{u}} - (code : StrictHeightGraphCode L H rL rH h) (meet : MeetOrderCode L rL μ) - (linear : StrictLinearOrderCode H rH) : - StrictHeight meet.toSmallMeetOrder linear.smallOrder.toHeightOrder where - value := (SetMembers.presentation L).decodeFunction (SetMembers.presentation H) h code.function - strict x y lower different := code.strict _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) - (fun eq => different (SetMembers.raw_injective L eq)) lower _ _ - ((SetMembers.presentation L).decodeFunction_mem (SetMembers.presentation H) h code.function x) - ((SetMembers.presentation L).decodeFunction_mem (SetMembers.presentation H) h code.function y) - -theorem StrictHeightGraphCode.smallHeight_graph {L H rL rH h μ : ZFSet.{u}} - (code : StrictHeightGraphCode L H rL rH h) (meet : MeetOrderCode L rL μ) - (linear : StrictLinearOrderCode H rH) : - (SetMembers.presentation L).graph (SetMembers.presentation H) (code.smallHeight meet linear).value = h := - (SetMembers.presentation L).graph_decodeFunction (SetMembers.presentation H) h code.function - -end PartitionPilot.Forcing - -namespace PartitionPilot.SetRealization.Presentation -open Forcing Compression.RecursiveMaps -universe u -variable {A B C : Type u} - -theorem strictHeightGraphCode (s : Presentation A) (t : Presentation B) - {P : MeetOrder A} {R : HeightOrder B} (height : StrictHeight P R) - {r rH : ZFSet.{u}} - (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) - (target : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rH ↔ R.lt a b) : - StrictHeightGraphCode s.carrier t.carrier r rH (s.graph t height.value) := by - refine ⟨s.graph_isFunc t height.value, ?_⟩ - intro x hx y hy different lower a b first second - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t height.value).1 first)).2 - obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t height.value).1 second)).2 - have firstEq := (s.pair_mem_graph t height.value x a).1 first - have secondEq := (s.pair_mem_graph t height.value y b).1 second - rw [← firstEq, ← secondEq] - exact (target _ _).2 (height.strict x y ((order x y).1 lower) (fun eq => different (congrArg s.encode eq))) - -theorem lexProductOrder_iff (s : Presentation A) (t : Presentation B) - (R : LinearHeightOrder A) (S : LinearHeightOrder B) {rR rS : ZFSet.{u}} - (first : ∀ a b, ZFSet.pair (s.encode a) (s.encode b) ∈ rR ↔ R.lt a b) - (second : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rS ↔ S.lt a b) (x y : A × B) : - ZFSet.pair ((s.product t).encode x) ((s.product t).encode y) ∈ - lexProductOrder s.carrier t.carrier rR rS ↔ (R.lex S).lt x y := by - change ZFSet.pair (ZFSet.pair (s.encode x.1) (t.encode x.2)) - (ZFSet.pair (s.encode y.1) (t.encode y.2)) ∈ _ ↔ _ - rw [pair_mem_lexProductOrder] - simp only [s.encode_mem, t.encode_mem, true_and, first, second, s.injective.eq_iff] - rfl - -theorem compose_graphs (s : Presentation A) (t : Presentation B) (v : Presentation C) - (f : A → B) (g : B → C) : - relationCompose s.carrier t.carrier v.carrier (s.graph t f) (t.graph v g) = - s.graph v (fun x => g (f x)) := by - apply ZFSet.ext - intro z - rw [mem_relationCompose, Presentation.mem_graph] - constructor - · rintro ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy - obtain ⟨c, rfl⟩ := (v.mem_carrier w).1 hw - have ab := (s.pair_mem_graph t f a b).1 first - have bc := (t.pair_mem_graph v g b c).1 second - subst b - subst c - exact ⟨a, rfl⟩ - · rintro ⟨a, rfl⟩ - exact ⟨s.encode a, s.encode_mem a, t.encode (f a), t.encode_mem _, - v.encode (g (f a)), v.encode_mem _, rfl, - (s.pair_mem_graph t f _ _).2 rfl, (t.pair_mem_graph v g _ _).2 rfl⟩ - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {A B C : Type u} (s : Presentation A) (t : Presentation B) (v : Presentation C) - -include pairing unions powers separation - -theorem composed_graph_mem (f : A → B) (g : B → C) - (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) (hv : v.carrier ∈ M.sets) - (hf : s.graph t f ∈ M.sets) (hg : t.graph v g ∈ M.sets) : - s.graph v (fun x => g (f x)) ∈ M.sets := by - rw [← s.compose_graphs t v f g] - exact M.relationCompose_mem pairing unions powers separation hs ht hv hf hg - -theorem paired_graph_mem (f : A → B) (g : A → C) - (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) (hv : v.carrier ∈ M.sets) - (hf : s.graph t f ∈ M.sets) (hg : s.graph v g ∈ M.sets) : - s.graph (t.product v) (fun x => (f x, g x)) ∈ M.sets := by - rw [← pairedGraph_eq s t v f g] - exact M.pairedGraph_mem pairing unions powers separation hs ht hv hf hg - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization Compression.RecursiveMaps SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable {A H : Type u} (s : Presentation A) (t : Presentation H) -variable {P : MeetOrder A} (top : A) (greatest : ∀ a, P.le a top) -variable (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) -variable (hP : s.carrier ∈ M.sets) (hH : t.carrier ∈ M.sets) -variable (hSeed : s.graph t seed.value ∈ M.sets) -variable (small : M.groundEmbeddable (relationImage s.carrier t.carrier (s.graph t seed.value)) ZFSet.omega) - -include pairing unions powers separation infinite hP hH hSeed small - -theorem binaryTuple_ground (tile : TileRequests.Tile P (ULift.{u} Unit)) - (q : Presentation tile.Space) {ν : ZFSet.{u}} - (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) - (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) - (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) - (q.encode (tile.order.meet x y)) ∈ ν) - (root : s.graph q tile.root.toFun ∈ M.sets) - (child : s.graph q (tile.child ⟨()⟩).toFun ∈ M.sets) : - let graph := q.graph (t.product t) (tile.binaryTuple top greatest R seed).value - graph ∈ M.sets ∧ M.groundEmbeddable - (relationImage q.carrier (t.product t).carrier graph) ZFSet.omega := by - dsimp only - have first := M.idealProjection_mem s q tile.root top meetFunction meetEntries - pairing unions powers separation hP hL hν root - have second := M.idealProjection_mem s q (tile.child ⟨()⟩) top meetFunction meetEntries - pairing unions powers separation hP hL hν child - have firstHeight := M.composed_graph_mem pairing unions powers separation q s t - (tile.root.projection top) seed.value hL hP hH first hSeed - have secondHeight := M.composed_graph_mem pairing unions powers separation q s t - ((tile.child ⟨()⟩).projection top) seed.value hL hP hH second hSeed - have graphGround : q.graph (t.product t) (tile.binaryTuple top greatest R seed).value ∈ M.sets := - M.paired_graph_mem pairing unions powers separation q t t _ _ hL hH hH firstHeight secondHeight - refine ⟨graphGround, ?_⟩ - let E := relationImage s.carrier t.carrier (s.graph t seed.value) - have hE : E ∈ M.sets := M.relationImage_mem separation hP hH hSeed - have each (a : A) : t.encode (seed.value a) ∈ E := - (mem_relationImage _ _ _ _).2 ⟨t.encode_mem _, s.encode a, s.encode_mem a, - (s.pair_mem_graph t seed.value _ _).2 rfl⟩ - apply M.groundEmbeddable_restrict separation - (M.relationImage_mem separation hL (M.prod_mem pairing unions powers separation hH hH) graphGround) - (M.omega_mem separation infinite) ?_ - (M.groundEmbeddable_product pairing unions powers separation infinite hE hE small small) - intro z hz - obtain ⟨_, x, hx, entry⟩ := (mem_relationImage _ _ _ _).1 hz - obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx - obtain ⟨y, eq⟩ := (q.mem_graph (t.product t) (tile.binaryTuple top greatest R seed).value _).1 entry - have parts := ZFSet.pair_inj.1 eq - have xy := q.injective parts.1 - subst y - rw [← parts.2] - exact ZFSet.pair_mem_prod.2 ⟨each _, each _⟩ - -theorem rectangleTuple_ground (tile : TileRequests.Tile P (ULift.{u} Bool)) - (q : Presentation tile.Space) {ν : ZFSet.{u}} - (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) - (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) - (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) - (q.encode (tile.order.meet x y)) ∈ ν) - (root : s.graph q tile.root.toFun ∈ M.sets) - (first : s.graph q (tile.child ⟨false⟩).toFun ∈ M.sets) - (second : s.graph q (tile.child ⟨true⟩).toFun ∈ M.sets) : - let graph := q.graph (t.product (t.product t)) (tile.rectangleTuple top greatest R seed).value - graph ∈ M.sets ∧ M.groundEmbeddable - (relationImage q.carrier (t.product (t.product t)).carrier graph) ZFSet.omega := by - dsimp only - have project (e : IdealEmbedding P tile.order) (he : s.graph q e.toFun ∈ M.sets) := - M.composed_graph_mem pairing unions powers separation q s t (e.projection top) seed.value - hL hP hH (M.idealProjection_mem s q e top meetFunction meetEntries - pairing unions powers separation hP hL hν he) hSeed - have pairGround := M.paired_graph_mem pairing unions powers separation q t t _ _ hL hH hH - (project (tile.child ⟨false⟩) first) (project (tile.child ⟨true⟩) second) - have hHH := M.prod_mem pairing unions powers separation hH hH - have graphGround : q.graph (t.product (t.product t)) (tile.rectangleTuple top greatest R seed).value ∈ M.sets := - M.paired_graph_mem pairing unions powers separation q t (t.product t) _ _ hL hH hHH - (project tile.root root) pairGround - refine ⟨graphGround, ?_⟩ - let E := relationImage s.carrier t.carrier (s.graph t seed.value) - have hE : E ∈ M.sets := M.relationImage_mem separation hP hH hSeed - have each (a : A) : t.encode (seed.value a) ∈ E := - (mem_relationImage _ _ _ _).2 ⟨t.encode_mem _, s.encode a, s.encode_mem a, - (s.pair_mem_graph t seed.value _ _).2 rfl⟩ - have smallEE := M.groundEmbeddable_product pairing unions powers separation infinite hE hE small small - have smallEEE := M.groundEmbeddable_product pairing unions powers separation infinite hE - (M.prod_mem pairing unions powers separation hE hE) small smallEE - apply M.groundEmbeddable_restrict separation - (M.relationImage_mem separation hL (M.prod_mem pairing unions powers separation hH hHH) graphGround) - (M.omega_mem separation infinite) ?_ smallEEE - intro z hz - obtain ⟨_, x, hx, entry⟩ := (mem_relationImage _ _ _ _).1 hz - obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx - obtain ⟨y, eq⟩ := (q.mem_graph (t.product (t.product t)) (tile.rectangleTuple top greatest R seed).value _).1 entry - have parts := ZFSet.pair_inj.1 eq - have xy := q.injective parts.1 - subst y - rw [← parts.2] - exact ZFSet.pair_mem_prod.2 ⟨each _, ZFSet.pair_mem_prod.2 ⟨each _, each _⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps SetFormula -universe u - -structure IntervalHeightCode (L r D rD lo hi height : ZFSet.{u}) : Prop - extends StrictHeightGraphCode L D r rD height where - inside : ∀ x z, ZFSet.pair x z ∈ height → ZFSet.pair lo z ∈ rD ∧ ZFSet.pair z hi ∈ rD - -theorem StrictHeightGraphCode.weak {L H r rH h : ZFSet.{u}} - (code : StrictHeightGraphCode L H r rH h) {x y a b : ZFSet.{u}} - (lower : ZFSet.pair x y ∈ r) (first : ZFSet.pair x a ∈ h) (second : ZFSet.pair y b ∈ h) : - a = b ∨ ZFSet.pair a b ∈ rH := by - have hx := (ZFSet.pair_mem_prod.1 (code.function.1 first)).1 - have hy := (ZFSet.pair_mem_prod.1 (code.function.1 second)).1 - by_cases equal : x = y - · subst y - obtain ⟨v, _, unique⟩ := code.function.2 x hx - exact Or.inl ((unique a first).trans (unique b second).symm) - · exact Or.inr (code.strict x hx y hy equal lower a b first second) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable {A H : Type u} (s : Presentation A) (t : Presentation H) -variable {P : MeetOrder A} (top : A) (greatest : ∀ a, P.le a top) -variable (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) -variable {rH D rD c lo hi : ZFSet.{u}} -variable (heightOrder : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rH ↔ R.lt a b) -variable (linear : StrictLinearOrderCode t.carrier rH) -variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) -variable (hP : s.carrier ∈ M.sets) (hH : t.carrier ∈ M.sets) -variable (hSeed : s.graph t seed.value ∈ M.sets) (hrH : rH ∈ M.sets) -variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) -variable (small : M.groundEmbeddable (relationImage s.carrier t.carrier (s.graph t seed.value)) ZFSet.omega) -variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) -include top greatest pairing unions powers separation collection infinite heightOrder linear target injection - hP hH hSeed hrH hD hrD hc small hlo hhi gap - -theorem exists_binaryTileIntervalHeight (tile : TileRequests.Tile P (ULift.{u} Unit)) - (q : Presentation tile.Space) {r ν : ZFSet.{u}} - (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) - (related : ∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ r ↔ tile.order.le x y) - (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) - (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) - (q.encode (tile.order.meet x y)) ∈ ν) - (root : s.graph q tile.root.toFun ∈ M.sets) - (child : s.graph q (tile.child ⟨()⟩).toFun ∈ M.sets) : - ∃ height ∈ M.sets, IntervalHeightCode q.carrier r D rD lo hi height ∧ - relationImage q.carrier D height ∈ M.sets ∧ - M.groundEmbeddable (relationImage q.carrier D height) ZFSet.omega := by - have tuple := M.binaryTuple_ground pairing unions powers separation infinite s t top greatest R seed - hP hH hSeed small tile q hL hν meetFunction meetEntries root child - have strict := q.strictHeightGraphCode (t.product t) (tile.binaryTuple top greatest R seed) related - (t.lexProductOrder_iff t R R heightOrder heightOrder) - obtain ⟨height, ground, code, inside, rangeGround, rangeSmall, _⟩ := - M.exists_groundHeightInterpolation pairing unions powers separation collection infinite hL - (M.prod_mem pairing unions powers separation hH hH) - (M.lexProductOrder_mem pairing unions powers separation hH hH hrH hrH) tuple.1 - hD hrD hc strict (lexProductOrder_code linear linear) target injection tuple.2 hlo hhi gap - exact ⟨height, ground, ⟨code, inside⟩, rangeGround, rangeSmall⟩ - -theorem exists_rectangleTileIntervalHeight (tile : TileRequests.Tile P (ULift.{u} Bool)) - (q : Presentation tile.Space) {r ν : ZFSet.{u}} - (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) - (related : ∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ r ↔ tile.order.le x y) - (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) - (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) - (q.encode (tile.order.meet x y)) ∈ ν) - (root : s.graph q tile.root.toFun ∈ M.sets) - (first : s.graph q (tile.child ⟨false⟩).toFun ∈ M.sets) - (second : s.graph q (tile.child ⟨true⟩).toFun ∈ M.sets) : - ∃ height ∈ M.sets, IntervalHeightCode q.carrier r D rD lo hi height ∧ - relationImage q.carrier D height ∈ M.sets ∧ - M.groundEmbeddable (relationImage q.carrier D height) ZFSet.omega := by - have tuple := M.rectangleTuple_ground pairing unions powers separation infinite s t top greatest R seed - hP hH hSeed small tile q hL hν meetFunction meetEntries root first second - have inner := t.lexProductOrder_iff t R R heightOrder heightOrder - have strict := q.strictHeightGraphCode (t.product (t.product t)) (tile.rectangleTuple top greatest R seed) related - (t.lexProductOrder_iff (t.product t) R (R.lex R) heightOrder inner) - have hHH := M.prod_mem pairing unions powers separation hH hH - have hrHH := M.lexProductOrder_mem pairing unions powers separation hH hH hrH hrH - obtain ⟨height, ground, code, inside, rangeGround, rangeSmall, _⟩ := - M.exists_groundHeightInterpolation pairing unions powers separation collection infinite hL - (M.prod_mem pairing unions powers separation hH hHH) - (M.lexProductOrder_mem pairing unions powers separation hH hHH hrH hrHH) tuple.1 - hD hrD hc strict (lexProductOrder_code linear (lexProductOrder_code linear linear)) - target injection tuple.2 hlo hhi gap - exact ⟨height, ground, ⟨code, inside⟩, rangeGround, rangeSmall⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization Compression.RecursiveMaps SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable {A H : Type u} (s : Presentation A) (t : Presentation H) -variable {P : MeetOrder A} (top : A) (greatest : ∀ a, P.le a top) -variable (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) -variable {rH D rD c lo hi : ZFSet.{u}} -variable (heightOrder : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rH ↔ R.lt a b) -variable (linear : StrictLinearOrderCode t.carrier rH) -variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) -variable (hP : s.carrier ∈ M.sets) (hH : t.carrier ∈ M.sets) -variable (hSeed : s.graph t seed.value ∈ M.sets) (hrH : rH ∈ M.sets) -variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) -variable (small : M.groundEmbeddable (relationImage s.carrier t.carrier (s.graph t seed.value)) ZFSet.omega) -variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) -include top greatest pairing unions powers separation collection infinite heightOrder linear target injection - hP hH hSeed hrH hD hrD hc small hlo hhi gap - -theorem exists_requestTileIntervalHeight (request : TileRequests.Request P) - (q : Presentation (request.tile top greatest).Space) {r ν : ZFSet.{u}} - (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) - (related : ∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ r ↔ (request.tile top greatest).order.le x y) - (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) - (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) - (q.encode ((request.tile top greatest).order.meet x y)) ∈ ν) - (root : s.graph q (request.tile top greatest).root.toFun ∈ M.sets) - (children : ∀ j, s.graph q ((request.tile top greatest).child j).toFun ∈ M.sets) : - ∃ height ∈ M.sets, IntervalHeightCode q.carrier r D rD lo hi height ∧ - relationImage q.carrier D height ∈ M.sets ∧ - M.groundEmbeddable (relationImage q.carrier D height) ZFSet.omega := by - cases request with - | separation W => - exact M.exists_binaryTileIntervalHeight pairing unions powers separation collection infinite s t top greatest R seed - heightOrder linear target injection hP hH hSeed hrH hD hrD hc small hlo hhi gap - _ q hL hν related meetFunction meetEntries root (children ⟨()⟩) - | compression K copy => - exact M.exists_binaryTileIntervalHeight pairing unions powers separation collection infinite s t top greatest R seed - heightOrder linear target injection hP hH hSeed hrH hD hrD hc small hlo hhi gap - _ q hL hν related meetFunction meetEntries root (children ⟨()⟩) - | rectangle data => - exact M.exists_rectangleTileIntervalHeight pairing unions powers separation collection infinite s t top greatest R seed - heightOrder linear target injection hP hH hSeed hrH hD hrD hc small hlo hhi gap - _ q hL hν related meetFunction meetEntries root (children ⟨false⟩) (children ⟨true⟩) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -universe u - -def intervalHeightCandidate (Ps rs D rD lo hi i f : ZFSet.{u}) : Prop := - ∃ P ∈ ⋃₀ ⋃₀ Ps, ∃ r ∈ ⋃₀ ⋃₀ rs, - ZFSet.pair i P ∈ Ps ∧ ZFSet.pair i r ∈ rs ∧ IntervalHeightCode P r D rD lo hi f - -noncomputable def intervalHeightRelation (I W Ps rs D rD lo hi : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ W, z = ZFSet.pair i f ∧ - intervalHeightCandidate Ps rs D rD lo hi i f) (ZFSet.prod I W) - -theorem pair_mem_intervalHeightRelation (I W Ps rs D rD lo hi i f : ZFSet.{u}) : - ZFSet.pair i f ∈ intervalHeightRelation I W Ps rs D rD lo hi ↔ - i ∈ I ∧ f ∈ W ∧ intervalHeightCandidate Ps rs D rD lo hi i f := by - rw [intervalHeightRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, valid⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hi, hf, valid⟩ - · rintro ⟨hi, hf, valid⟩ - exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, valid⟩ - -theorem intervalHeightCandidate_iff {I Ps rs D rD lo hi : ZFSet.{u}} - (sources : FunctionGraphOn I Ps) (orders : FunctionGraphOn I rs) - (i : {i : ZFSet.{u} // i ∈ I}) (f : ZFSet.{u}) : - intervalHeightCandidate Ps rs D rD lo hi i.val f ↔ - IntervalHeightCode (sources.value i) (orders.value i) D rD lo hi f := by - constructor - · rintro ⟨P, _, r, _, pEntry, rEntry, code⟩ - rw [sources.value_eq_of_entry i pEntry, orders.value_eq_of_entry i rEntry] - exact code - · intro code - exact ⟨sources.value i, sources.value_mem_doubleUnion i, - orders.value i, orders.value_mem_doubleUnion i, - sources.value_entry i, orders.value_entry i, code⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization Compression.RecursiveMaps SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable {P r μ H rH old D rD c lo hi : ZFSet.{u}} -variable (source : MeetOrderCode P r μ) (top : SetMembers P) -variable (greatest : ∀ x, source.toSmallMeetOrder.le x top) -variable (height : StrictHeightGraphCode P H r rH old) (linear : StrictLinearOrderCode H rH) -variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) -variable (hP : P ∈ M.sets) (hH : H ∈ M.sets) (hOld : old ∈ M.sets) (hrH : rH ∈ M.sets) -variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) -variable (small : M.groundEmbeddable (relationImage P H old) ZFSet.omega) -variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) -include pairing unions powers separation collection infinite top greatest - height linear target injection hP hH hOld hrH hD hrD hc small hlo hhi gap - -theorem exists_codedBinaryTileHeight {L v ν first second : ZFSet.{u}} - (tileMeet : MeetOrderCode L v ν) (hL : L ∈ M.sets) (hν : ν ∈ M.sets) - (left : MeetEmbeddingCode P L r v μ ν first) (right : MeetEmbeddingCode P L r v μ ν second) - (hFirst : first ∈ M.sets) (hSecond : second ∈ M.sets) - (leftIdeal : ∀ x y z, ZFSet.pair x y ∈ first → z ∈ L → ZFSet.pair z y ∈ v → - ∃ a ∈ P, ZFSet.pair a z ∈ first) - (rightIdeal : ∀ x y z, ZFSet.pair x y ∈ second → z ∈ L → ZFSet.pair z y ∈ v → - ∃ a ∈ P, ZFSet.pair a z ∈ second) - (cover : ∀ z ∈ L, (∃ x ∈ P, ZFSet.pair x z ∈ first) ∨ ∃ x ∈ P, ZFSet.pair x z ∈ second) : - ∃ h ∈ M.sets, IntervalHeightCode L v D rD lo hi h ∧ relationImage L D h ∈ M.sets ∧ - M.groundEmbeddable (relationImage L D h) ZFSet.omega := by - let tile := binaryTileOfCodes source tileMeet left right leftIdeal rightIdeal cover - have seedGround : (SetMembers.presentation P).graph (SetMembers.presentation H) - (height.smallHeight source linear).value ∈ M.sets := by - rw [height.smallHeight_graph] - exact hOld - have seedSmall : M.groundEmbeddable (relationImage P H - ((SetMembers.presentation P).graph (SetMembers.presentation H) (height.smallHeight source linear).value)) ZFSet.omega := by - rw [height.smallHeight_graph] - exact small - have leftGround : (SetMembers.presentation P).graph (SetMembers.presentation L) tile.root.toFun ∈ M.sets := by - change (SetMembers.presentation P).graph (SetMembers.presentation L) left.smallValue ∈ M.sets - rw [left.smallValue_graph] - exact hFirst - have rightGround : (SetMembers.presentation P).graph (SetMembers.presentation L) (tile.child ⟨()⟩).toFun ∈ M.sets := by - change (SetMembers.presentation P).graph (SetMembers.presentation L) right.smallValue ∈ M.sets - rw [right.smallValue_graph] - exact hSecond - exact M.exists_binaryTileIntervalHeight pairing unions powers separation collection infinite - (SetMembers.presentation P) (SetMembers.presentation H) top greatest linear.smallOrder - (height.smallHeight source linear) (fun _ _ => Iff.rfl) linear target injection - hP hH seedGround hrH hD hrD hc seedSmall hlo hhi gap tile (SetMembers.presentation L) - hL hν (fun _ _ => Iff.rfl) tileMeet.operation tileMeet.smallMeet_entry leftGround rightGround - -theorem exists_separationTileHeight {W : ZFSet.{u}} - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hW : W ∈ P) : - ∃ h ∈ M.sets, IntervalHeightCode (separationTileCarrier P r W) (separationTileOrder P r μ W) - D rD lo hi h ∧ relationImage (separationTileCarrier P r W) D h ∈ M.sets ∧ - M.groundEmbeddable (relationImage (separationTileCarrier P r W) D h) ZFSet.omega := by - let tile := separationTileCoding source ⟨W, hW⟩ - have ground := M.separationTile_ground pairing unions powers separation source hP hr hμ hW - have embeddings := separationTile_embeddings source hW - apply M.exists_codedBinaryTileHeight pairing unions powers separation collection infinite - source top greatest height linear target injection hP hH hOld hrH hD hrD hc small hlo hhi gap - tile.meetOrder ground.1 ground.2.2.1 embeddings.1 embeddings.2 ground.2.2.2.1 ground.2.2.2.2 - · intro x y z entry hz lower - obtain ⟨hx, equal⟩ := (pair_mem_attachmentOldEmbeddingGraph P x y).1 entry - subst y - exact tile.old_graph_ideal hx hz lower - · exact fun _ _ _ entry hz lower => tile.template_graph_ideal entry hz lower - · exact tile.vertex_cover - -theorem exists_compressionTileHeight {f : ZFSet.{u}} - (embedding : MeetEmbeddingCode P P r r μ μ f) - (K : {x : ZFSet.{u} // x ∈ P}) - (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : - let topRaw : {x : ZFSet.{u} // x ∈ P} := ⟨SetMembers.raw top, SetMembers.raw_mem top⟩ - let rawGreatest : ∀ x, source.toMeetOrder.le x topRaw := - fun x => by - change ZFSet.pair x.val (SetMembers.raw top) ∈ r - have lower := greatest (SetMembers.ofMem x.val x.property) - change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x.val x.property)) (SetMembers.raw top) ∈ r at lower - simpa only [SetMembers.raw_ofMem] using lower - let tile := compressionTileCoding source embedding topRaw K rawGreatest range - ∃ h ∈ M.sets, IntervalHeightCode tile.carrier tile.order D rD lo hi h ∧ - relationImage tile.carrier D h ∈ M.sets ∧ - M.groundEmbeddable (relationImage tile.carrier D h) ZFSet.omega := by - dsimp only - obtain ⟨h, ground, strict, inside, rangeGround, rangeSmall, _⟩ := - M.exists_groundHeightInterpolation pairing unions powers separation collection infinite - hP hH hrH hOld hD hrD hc height linear target injection small hlo hhi gap - have codes := compressionTile_exact_codes source embedding - ⟨SetMembers.raw top, SetMembers.raw_mem top⟩ K - (fun x => by - change ZFSet.pair x.val (SetMembers.raw top) ∈ r - have lower := greatest (SetMembers.ofMem x.val x.property) - change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x.val x.property)) (SetMembers.raw top) ∈ r at lower - simpa only [SetMembers.raw_ofMem] using lower) range - rw [codes.1, codes.2.1] - exact ⟨h, ground, ⟨strict, inside⟩, rangeGround, rangeSmall⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PrincipalTileRealization +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundIdealProjections +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionHeightSteps +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRequestedCompressionTiles + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure StrictHeightGraphCode (L H rL rH h : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc L H h + strict : ∀ x ∈ L, ∀ y ∈ L, x ≠ y → ZFSet.pair x y ∈ rL → + ∀ a b, ZFSet.pair x a ∈ h → ZFSet.pair y b ∈ h → ZFSet.pair a b ∈ rH + +theorem StrictLexHeightCode.strictHeightGraph {L C D r h rD : ZFSet.{u}} + (code : StrictLexHeightCode L C D r h rD) : + StrictHeightGraphCode L (ZFSet.prod C D) r (lexHeightOrder C D rD) h := by + refine ⟨code.function, ?_⟩ + intro x hx y hy different lower a b first second + obtain ⟨c, hc, q, hq, eq⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (code.function.1 first)).2 + obtain ⟨d, hd, v, hv, eq'⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (code.function.1 second)).2 + subst a + subst b + exact (pair_mem_lexHeightOrder _ _ _ _ _ _ _).2 + ⟨hc, hq, hd, hv, code.strict x hx y hy c q d v lower different first second⟩ + +namespace TransitiveGround + +theorem exists_groundHeightInterpolation (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {L H rL rH seed D rD c lo hi : ZFSet.{u}} + (hL : L ∈ M.sets) (hH : H ∈ M.sets) (hrH : rH ∈ M.sets) (hSeed : seed ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (seedCode : StrictHeightGraphCode L H rL rH seed) + (linear : StrictLinearOrderCode H rH) (target : DenseOrderCode D rD) + (injection : InjectionCode D ZFSet.omega c) + (small : M.groundEmbeddable (relationImage L H seed) ZFSet.omega) + (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : + ∃ height ∈ M.sets, StrictHeightGraphCode L D rL rD height ∧ + (∀ x z, ZFSet.pair x z ∈ height → ZFSet.pair lo z ∈ rD ∧ ZFSet.pair z hi ∈ rD) ∧ + relationImage L D height ∈ M.sets ∧ + M.groundEmbeddable (relationImage L D height) ZFSet.omega ∧ + ∀ x y a b q z, ZFSet.pair x a ∈ seed → ZFSet.pair y b ∈ seed → + ZFSet.pair x q ∈ height → ZFSet.pair y z ∈ height → + (a = b ↔ q = z) ∧ (ZFSet.pair a b ∈ rH ↔ ZFSet.pair q z ∈ rD) := by + let R := relationImage L H seed + have hR := M.relationImage_mem separation hL hH hSeed + have hOrder : heightOrderRestriction R rH ∈ M.sets := + M.injection_restriction_mem separation hR hR hrH + have rLinear : StrictLinearOrderCode R (heightOrderRestriction R rH) := + heightOrderRestriction_linear linear (fun _ h => ((mem_relationImage L H seed _).1 h).1) + obtain ⟨e, he, embedding⟩ := M.exists_intervalEmbedding pairing unions powers separation collection infinite + hR hD hOrder hrD hc rLinear target injection small hlo hhi gap + let height := relationCompose L R D seed e + have function := relationCompose_function_of_subset (function_on_relationImage seedCode.function) + embedding.injection.function (fun _ h => h) + have ground : height ∈ M.sets := M.relationCompose_mem pairing unions powers separation hL hR hD hSeed he + have liftEntry {x a z : ZFSet.{u}} (source : ZFSet.pair x a ∈ seed) + (entry : ZFSet.pair x z ∈ height) : ZFSet.pair a z ∈ e := by + obtain ⟨_, _, a', _, other, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + obtain ⟨v, _, unique⟩ := seedCode.function.2 x (ZFSet.pair_mem_prod.1 (seedCode.function.1 source)).1 + have equal := (unique a source).trans (unique a' other).symm + exact equal.symm ▸ image + have exactOrder {x y a b q z : ZFSet.{u}} + (first : ZFSet.pair x a ∈ seed) (second : ZFSet.pair y b ∈ seed) + (left : ZFSet.pair x q ∈ height) (right : ZFSet.pair y z ∈ height) : + (a = b ↔ q = z) ∧ (ZFSet.pair a b ∈ rH ↔ ZFSet.pair q z ∈ rD) := by + have aq := liftEntry first left + have bz := liftEntry second right + have aR := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 aq)).1 + have bR := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 bz)).1 + refine ⟨?_, ?_⟩ + · constructor + · intro equal + subst b + obtain ⟨v, _, unique⟩ := embedding.injection.function.2 a aR + exact (unique q aq).trans (unique z bz).symm + · intro equal + subst z + exact embedding.injection.injective a b q aq bz + · have order := embedding.order a b q z aq bz + rw [pair_mem_heightOrderRestriction] at order + exact ⟨fun hab => order.1 ⟨hab, aR, bR⟩, fun hqz => (order.2 hqz).1⟩ + refine ⟨height, ground, ⟨function, ?_⟩, ?_, M.relationImage_mem separation hL hD ground, ?_, ?_⟩ + · intro x hx y hy different lower q z left right + obtain ⟨a, ax, _⟩ := seedCode.function.2 x hx + obtain ⟨b, byEntry, _⟩ := seedCode.function.2 y hy + exact (exactOrder ax byEntry left right).2.1 (seedCode.strict x hx y hy different lower a b ax byEntry) + · intro x z entry + obtain ⟨_, _, a, _, _, az⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + exact embedding.inside a z az + · exact M.groundEmbeddable_restrict separation (M.relationImage_mem separation hL hD ground) + (M.omega_mem separation infinite) (fun _ h => (mem_relationImage _ _ _ _).1 h |>.1) ⟨c, hc, injection⟩ + · intro x y a b q z first second left right + exact exactOrder first second left right + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open Compression.RecursiveMaps +universe u + +noncomputable def lexProductOrder (C D rC rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, + z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ + (ZFSet.pair c d ∈ rC ∨ (c = d ∧ ZFSet.pair q v ∈ rD))) + (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) + +theorem mem_lexProductOrder (C D rC rD z : ZFSet.{u}) : + z ∈ lexProductOrder C D rC rD ↔ + ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, + z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ + (ZFSet.pair c d ∈ rC ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · rintro ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 + ⟨ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩⟩, + c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ + +theorem pair_mem_lexProductOrder (C D rC rD c q d v : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∈ lexProductOrder C D rC rD ↔ + c ∈ C ∧ q ∈ D ∧ d ∈ C ∧ v ∈ D ∧ (ZFSet.pair c d ∈ rC ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by + rw [mem_lexProductOrder] + constructor + · rintro ⟨c', hc, q', hq, d', hd, v', hv, equal, lower⟩ + obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right + exact ⟨hc, hq, hd, hv, lower⟩ + · rintro ⟨hc, hq, hd, hv, lower⟩ + exact ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ + +theorem lexProductOrder_code {C D rC rD : ZFSet.{u}} + (columns : StrictLinearOrderCode C rC) (target : StrictLinearOrderCode D rD) : + StrictLinearOrderCode (ZFSet.prod C D) (lexProductOrder C D rC rD) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_, ?_, ?_⟩ + · intro x hx hxx + obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx + rcases ((pair_mem_lexProductOrder C D rC rD c q c q).1 hxx).2.2.2.2 with less | same + · exact columns.irrefl c (ZFSet.pair_mem_prod.1 (columns.shape less)).1 less + · exact target.irrefl q hq same.2 + · intro x y z hxy hyz + have xy := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hxy).1 + have yz := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hyz).1 + obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 xy.1 + obtain ⟨d, _, v, _, rfl⟩ := ZFSet.mem_prod.1 xy.2 + obtain ⟨b, hb, w, hw, rfl⟩ := ZFSet.mem_prod.1 yz.2 + have left := ((pair_mem_lexProductOrder C D rC rD c q d v).1 hxy).2.2.2.2 + have right := ((pair_mem_lexProductOrder C D rC rD d v b w).1 hyz).2.2.2.2 + apply (pair_mem_lexProductOrder C D rC rD c q b w).2 + refine ⟨hc, hq, hb, hw, ?_⟩ + rcases left with lower | ⟨same, inside⟩ + · rcases right with lower' | ⟨same', _⟩ + · exact Or.inl (columns.trans c d b lower lower') + · exact Or.inl (same' ▸ lower) + · rcases right with lower' | ⟨same', inside'⟩ + · exact Or.inl (same.symm ▸ lower') + · exact Or.inr ⟨same.trans same', target.trans q v w inside inside'⟩ + · intro x hx y hy + obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx + obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy + rcases columns.compare c hc d hd with lower | same | greater + · exact Or.inl ((pair_mem_lexProductOrder C D rC rD c q d v).2 ⟨hc, hq, hd, hv, Or.inl lower⟩) + · subst d + rcases target.compare q hq v hv with lower | same | greater + · exact Or.inl ((pair_mem_lexProductOrder C D rC rD c q c v).2 + ⟨hc, hq, hc, hv, Or.inr ⟨rfl, lower⟩⟩) + · exact Or.inr (Or.inl (congrArg (ZFSet.pair c) same)) + · exact Or.inr (Or.inr ((pair_mem_lexProductOrder C D rC rD c v c q).2 + ⟨hc, hv, hc, hq, Or.inr ⟨rfl, greater⟩⟩)) + · exact Or.inr (Or.inr ((pair_mem_lexProductOrder C D rC rD d v c q).2 + ⟨hd, hv, hc, hq, Or.inl greater⟩)) + +namespace BoundedFormula + +def lexProductEntryFormula {n} (z C D rC rD : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ + exMem C (exMem D.succ (exMem C.succ.succ (exMem D.succ.succ.succ + (.conj (pairOfPairsFormula (lift z) 3 2 1 0) + (disj (pairMembershipFormula 3 1 (lift rC)) (.conj (.equal 3 1) (pairMembershipFormula 2 0 (lift rD)))))))) + +theorem truth_lexProductEntryFormula {n} (z C D rC rD : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (lexProductEntryFormula z C D rC rD) env ↔ + ∃ c ∈ env C, ∃ q ∈ env D, ∃ d ∈ env C, ∃ v ∈ env D, + env z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ + (ZFSet.pair c d ∈ env rC ∨ (c = d ∧ ZFSet.pair q v ∈ env rD)) := by + simp only [lexProductEntryFormula, truth_exMem, Truth, truth_disj, + truth_pairOfPairsFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem lexProductOrder_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {C D rC rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrC : rC ∈ M.sets) (hrD : rD ∈ M.sets) : + lexProductOrder C D rC rD ∈ M.sets := by + have carrier := M.prod_mem pairing unions powers separation hC hD + let params := extend C (extend D (extend rC (extend rD Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.lexProductEntryFormula 0 1 2 3 4) params + (Fin.cases hC (Fin.cases hD (Fin.cases hrC (Fin.cases hrD (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation carrier carrier) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.lexProductEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) = lexProductOrder C D rC rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, lexProductOrder, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_lexProductEntryFormula 0 1 2 3 4 _) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps SetFormula +universe u + +noncomputable def StrictLinearOrderCode.smallOrder {H rH : ZFSet.{u}} + (code : StrictLinearOrderCode H rH) : LinearHeightOrder (SetMembers H) where + lt x y := ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ rH + irrefl x := code.irrefl _ (SetMembers.raw_mem x) + trans {x y z} := code.trans (SetMembers.raw x) (SetMembers.raw y) (SetMembers.raw z) + compare x y := (code.compare _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y)).imp id + (fun h => h.imp (fun eq => SetMembers.raw_injective H eq) id) + +noncomputable def StrictHeightGraphCode.smallHeight {L H rL rH h μ : ZFSet.{u}} + (code : StrictHeightGraphCode L H rL rH h) (meet : MeetOrderCode L rL μ) + (linear : StrictLinearOrderCode H rH) : + StrictHeight meet.toSmallMeetOrder linear.smallOrder.toHeightOrder where + value := (SetMembers.presentation L).decodeFunction (SetMembers.presentation H) h code.function + strict x y lower different := code.strict _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) + (fun eq => different (SetMembers.raw_injective L eq)) lower _ _ + ((SetMembers.presentation L).decodeFunction_mem (SetMembers.presentation H) h code.function x) + ((SetMembers.presentation L).decodeFunction_mem (SetMembers.presentation H) h code.function y) + +theorem StrictHeightGraphCode.smallHeight_graph {L H rL rH h μ : ZFSet.{u}} + (code : StrictHeightGraphCode L H rL rH h) (meet : MeetOrderCode L rL μ) + (linear : StrictLinearOrderCode H rH) : + (SetMembers.presentation L).graph (SetMembers.presentation H) (code.smallHeight meet linear).value = h := + (SetMembers.presentation L).graph_decodeFunction (SetMembers.presentation H) h code.function + +end PartitionPilot.Forcing + +namespace PartitionPilot.SetRealization.Presentation +open Forcing Compression.RecursiveMaps +universe u +variable {A B C : Type u} + +theorem strictHeightGraphCode (s : Presentation A) (t : Presentation B) + {P : MeetOrder A} {R : HeightOrder B} (height : StrictHeight P R) + {r rH : ZFSet.{u}} + (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) + (target : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rH ↔ R.lt a b) : + StrictHeightGraphCode s.carrier t.carrier r rH (s.graph t height.value) := by + refine ⟨s.graph_isFunc t height.value, ?_⟩ + intro x hx y hy different lower a b first second + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t height.value).1 first)).2 + obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t height.value).1 second)).2 + have firstEq := (s.pair_mem_graph t height.value x a).1 first + have secondEq := (s.pair_mem_graph t height.value y b).1 second + rw [← firstEq, ← secondEq] + exact (target _ _).2 (height.strict x y ((order x y).1 lower) (fun eq => different (congrArg s.encode eq))) + +theorem lexProductOrder_iff (s : Presentation A) (t : Presentation B) + (R : LinearHeightOrder A) (S : LinearHeightOrder B) {rR rS : ZFSet.{u}} + (first : ∀ a b, ZFSet.pair (s.encode a) (s.encode b) ∈ rR ↔ R.lt a b) + (second : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rS ↔ S.lt a b) (x y : A × B) : + ZFSet.pair ((s.product t).encode x) ((s.product t).encode y) ∈ + lexProductOrder s.carrier t.carrier rR rS ↔ (R.lex S).lt x y := by + change ZFSet.pair (ZFSet.pair (s.encode x.1) (t.encode x.2)) + (ZFSet.pair (s.encode y.1) (t.encode y.2)) ∈ _ ↔ _ + rw [pair_mem_lexProductOrder] + simp only [s.encode_mem, t.encode_mem, true_and, first, second, s.injective.eq_iff] + rfl + +theorem compose_graphs (s : Presentation A) (t : Presentation B) (v : Presentation C) + (f : A → B) (g : B → C) : + relationCompose s.carrier t.carrier v.carrier (s.graph t f) (t.graph v g) = + s.graph v (fun x => g (f x)) := by + apply ZFSet.ext + intro z + rw [mem_relationCompose, Presentation.mem_graph] + constructor + · rintro ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy + obtain ⟨c, rfl⟩ := (v.mem_carrier w).1 hw + have ab := (s.pair_mem_graph t f a b).1 first + have bc := (t.pair_mem_graph v g b c).1 second + subst b + subst c + exact ⟨a, rfl⟩ + · rintro ⟨a, rfl⟩ + exact ⟨s.encode a, s.encode_mem a, t.encode (f a), t.encode_mem _, + v.encode (g (f a)), v.encode_mem _, rfl, + (s.pair_mem_graph t f _ _).2 rfl, (t.pair_mem_graph v g _ _).2 rfl⟩ + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {A B C : Type u} (s : Presentation A) (t : Presentation B) (v : Presentation C) + +include pairing unions powers separation + +theorem composed_graph_mem (f : A → B) (g : B → C) + (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) (hv : v.carrier ∈ M.sets) + (hf : s.graph t f ∈ M.sets) (hg : t.graph v g ∈ M.sets) : + s.graph v (fun x => g (f x)) ∈ M.sets := by + rw [← s.compose_graphs t v f g] + exact M.relationCompose_mem pairing unions powers separation hs ht hv hf hg + +theorem paired_graph_mem (f : A → B) (g : A → C) + (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) (hv : v.carrier ∈ M.sets) + (hf : s.graph t f ∈ M.sets) (hg : s.graph v g ∈ M.sets) : + s.graph (t.product v) (fun x => (f x, g x)) ∈ M.sets := by + rw [← pairedGraph_eq s t v f g] + exact M.pairedGraph_mem pairing unions powers separation hs ht hv hf hg + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization Compression.RecursiveMaps SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable {A H : Type u} (s : Presentation A) (t : Presentation H) +variable {P : MeetOrder A} (top : A) (greatest : ∀ a, P.le a top) +variable (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) +variable (hP : s.carrier ∈ M.sets) (hH : t.carrier ∈ M.sets) +variable (hSeed : s.graph t seed.value ∈ M.sets) +variable (small : M.groundEmbeddable (relationImage s.carrier t.carrier (s.graph t seed.value)) ZFSet.omega) + +include pairing unions powers separation infinite hP hH hSeed small + +theorem binaryTuple_ground (tile : TileRequests.Tile P (ULift.{u} Unit)) + (q : Presentation tile.Space) {ν : ZFSet.{u}} + (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) + (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) + (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) + (q.encode (tile.order.meet x y)) ∈ ν) + (root : s.graph q tile.root.toFun ∈ M.sets) + (child : s.graph q (tile.child ⟨()⟩).toFun ∈ M.sets) : + let graph := q.graph (t.product t) (tile.binaryTuple top greatest R seed).value + graph ∈ M.sets ∧ M.groundEmbeddable + (relationImage q.carrier (t.product t).carrier graph) ZFSet.omega := by + dsimp only + have first := M.idealProjection_mem s q tile.root top meetFunction meetEntries + pairing unions powers separation hP hL hν root + have second := M.idealProjection_mem s q (tile.child ⟨()⟩) top meetFunction meetEntries + pairing unions powers separation hP hL hν child + have firstHeight := M.composed_graph_mem pairing unions powers separation q s t + (tile.root.projection top) seed.value hL hP hH first hSeed + have secondHeight := M.composed_graph_mem pairing unions powers separation q s t + ((tile.child ⟨()⟩).projection top) seed.value hL hP hH second hSeed + have graphGround : q.graph (t.product t) (tile.binaryTuple top greatest R seed).value ∈ M.sets := + M.paired_graph_mem pairing unions powers separation q t t _ _ hL hH hH firstHeight secondHeight + refine ⟨graphGround, ?_⟩ + let E := relationImage s.carrier t.carrier (s.graph t seed.value) + have hE : E ∈ M.sets := M.relationImage_mem separation hP hH hSeed + have each (a : A) : t.encode (seed.value a) ∈ E := + (mem_relationImage _ _ _ _).2 ⟨t.encode_mem _, s.encode a, s.encode_mem a, + (s.pair_mem_graph t seed.value _ _).2 rfl⟩ + apply M.groundEmbeddable_restrict separation + (M.relationImage_mem separation hL (M.prod_mem pairing unions powers separation hH hH) graphGround) + (M.omega_mem separation infinite) ?_ + (M.groundEmbeddable_product pairing unions powers separation infinite hE hE small small) + intro z hz + obtain ⟨_, x, hx, entry⟩ := (mem_relationImage _ _ _ _).1 hz + obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx + obtain ⟨y, eq⟩ := (q.mem_graph (t.product t) (tile.binaryTuple top greatest R seed).value _).1 entry + have parts := ZFSet.pair_inj.1 eq + have xy := q.injective parts.1 + subst y + rw [← parts.2] + exact ZFSet.pair_mem_prod.2 ⟨each _, each _⟩ + +theorem rectangleTuple_ground (tile : TileRequests.Tile P (ULift.{u} Bool)) + (q : Presentation tile.Space) {ν : ZFSet.{u}} + (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) + (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) + (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) + (q.encode (tile.order.meet x y)) ∈ ν) + (root : s.graph q tile.root.toFun ∈ M.sets) + (first : s.graph q (tile.child ⟨false⟩).toFun ∈ M.sets) + (second : s.graph q (tile.child ⟨true⟩).toFun ∈ M.sets) : + let graph := q.graph (t.product (t.product t)) (tile.rectangleTuple top greatest R seed).value + graph ∈ M.sets ∧ M.groundEmbeddable + (relationImage q.carrier (t.product (t.product t)).carrier graph) ZFSet.omega := by + dsimp only + have project (e : IdealEmbedding P tile.order) (he : s.graph q e.toFun ∈ M.sets) := + M.composed_graph_mem pairing unions powers separation q s t (e.projection top) seed.value + hL hP hH (M.idealProjection_mem s q e top meetFunction meetEntries + pairing unions powers separation hP hL hν he) hSeed + have pairGround := M.paired_graph_mem pairing unions powers separation q t t _ _ hL hH hH + (project (tile.child ⟨false⟩) first) (project (tile.child ⟨true⟩) second) + have hHH := M.prod_mem pairing unions powers separation hH hH + have graphGround : q.graph (t.product (t.product t)) (tile.rectangleTuple top greatest R seed).value ∈ M.sets := + M.paired_graph_mem pairing unions powers separation q t (t.product t) _ _ hL hH hHH + (project tile.root root) pairGround + refine ⟨graphGround, ?_⟩ + let E := relationImage s.carrier t.carrier (s.graph t seed.value) + have hE : E ∈ M.sets := M.relationImage_mem separation hP hH hSeed + have each (a : A) : t.encode (seed.value a) ∈ E := + (mem_relationImage _ _ _ _).2 ⟨t.encode_mem _, s.encode a, s.encode_mem a, + (s.pair_mem_graph t seed.value _ _).2 rfl⟩ + have smallEE := M.groundEmbeddable_product pairing unions powers separation infinite hE hE small small + have smallEEE := M.groundEmbeddable_product pairing unions powers separation infinite hE + (M.prod_mem pairing unions powers separation hE hE) small smallEE + apply M.groundEmbeddable_restrict separation + (M.relationImage_mem separation hL (M.prod_mem pairing unions powers separation hH hHH) graphGround) + (M.omega_mem separation infinite) ?_ smallEEE + intro z hz + obtain ⟨_, x, hx, entry⟩ := (mem_relationImage _ _ _ _).1 hz + obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx + obtain ⟨y, eq⟩ := (q.mem_graph (t.product (t.product t)) (tile.rectangleTuple top greatest R seed).value _).1 entry + have parts := ZFSet.pair_inj.1 eq + have xy := q.injective parts.1 + subst y + rw [← parts.2] + exact ZFSet.pair_mem_prod.2 ⟨each _, ZFSet.pair_mem_prod.2 ⟨each _, each _⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps SetFormula +universe u + +structure IntervalHeightCode (L r D rD lo hi height : ZFSet.{u}) : Prop + extends StrictHeightGraphCode L D r rD height where + inside : ∀ x z, ZFSet.pair x z ∈ height → ZFSet.pair lo z ∈ rD ∧ ZFSet.pair z hi ∈ rD + +theorem StrictHeightGraphCode.weak {L H r rH h : ZFSet.{u}} + (code : StrictHeightGraphCode L H r rH h) {x y a b : ZFSet.{u}} + (lower : ZFSet.pair x y ∈ r) (first : ZFSet.pair x a ∈ h) (second : ZFSet.pair y b ∈ h) : + a = b ∨ ZFSet.pair a b ∈ rH := by + have hx := (ZFSet.pair_mem_prod.1 (code.function.1 first)).1 + have hy := (ZFSet.pair_mem_prod.1 (code.function.1 second)).1 + by_cases equal : x = y + · subst y + obtain ⟨v, _, unique⟩ := code.function.2 x hx + exact Or.inl ((unique a first).trans (unique b second).symm) + · exact Or.inr (code.strict x hx y hy equal lower a b first second) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable {A H : Type u} (s : Presentation A) (t : Presentation H) +variable {P : MeetOrder A} (top : A) (greatest : ∀ a, P.le a top) +variable (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) +variable {rH D rD c lo hi : ZFSet.{u}} +variable (heightOrder : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rH ↔ R.lt a b) +variable (linear : StrictLinearOrderCode t.carrier rH) +variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) +variable (hP : s.carrier ∈ M.sets) (hH : t.carrier ∈ M.sets) +variable (hSeed : s.graph t seed.value ∈ M.sets) (hrH : rH ∈ M.sets) +variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) +variable (small : M.groundEmbeddable (relationImage s.carrier t.carrier (s.graph t seed.value)) ZFSet.omega) +variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) +include top greatest pairing unions powers separation collection infinite heightOrder linear target injection + hP hH hSeed hrH hD hrD hc small hlo hhi gap + +theorem exists_binaryTileIntervalHeight (tile : TileRequests.Tile P (ULift.{u} Unit)) + (q : Presentation tile.Space) {r ν : ZFSet.{u}} + (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) + (related : ∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ r ↔ tile.order.le x y) + (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) + (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) + (q.encode (tile.order.meet x y)) ∈ ν) + (root : s.graph q tile.root.toFun ∈ M.sets) + (child : s.graph q (tile.child ⟨()⟩).toFun ∈ M.sets) : + ∃ height ∈ M.sets, IntervalHeightCode q.carrier r D rD lo hi height ∧ + relationImage q.carrier D height ∈ M.sets ∧ + M.groundEmbeddable (relationImage q.carrier D height) ZFSet.omega := by + have tuple := M.binaryTuple_ground pairing unions powers separation infinite s t top greatest R seed + hP hH hSeed small tile q hL hν meetFunction meetEntries root child + have strict := q.strictHeightGraphCode (t.product t) (tile.binaryTuple top greatest R seed) related + (t.lexProductOrder_iff t R R heightOrder heightOrder) + obtain ⟨height, ground, code, inside, rangeGround, rangeSmall, _⟩ := + M.exists_groundHeightInterpolation pairing unions powers separation collection infinite hL + (M.prod_mem pairing unions powers separation hH hH) + (M.lexProductOrder_mem pairing unions powers separation hH hH hrH hrH) tuple.1 + hD hrD hc strict (lexProductOrder_code linear linear) target injection tuple.2 hlo hhi gap + exact ⟨height, ground, ⟨code, inside⟩, rangeGround, rangeSmall⟩ + +theorem exists_rectangleTileIntervalHeight (tile : TileRequests.Tile P (ULift.{u} Bool)) + (q : Presentation tile.Space) {r ν : ZFSet.{u}} + (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) + (related : ∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ r ↔ tile.order.le x y) + (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) + (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) + (q.encode (tile.order.meet x y)) ∈ ν) + (root : s.graph q tile.root.toFun ∈ M.sets) + (first : s.graph q (tile.child ⟨false⟩).toFun ∈ M.sets) + (second : s.graph q (tile.child ⟨true⟩).toFun ∈ M.sets) : + ∃ height ∈ M.sets, IntervalHeightCode q.carrier r D rD lo hi height ∧ + relationImage q.carrier D height ∈ M.sets ∧ + M.groundEmbeddable (relationImage q.carrier D height) ZFSet.omega := by + have tuple := M.rectangleTuple_ground pairing unions powers separation infinite s t top greatest R seed + hP hH hSeed small tile q hL hν meetFunction meetEntries root first second + have inner := t.lexProductOrder_iff t R R heightOrder heightOrder + have strict := q.strictHeightGraphCode (t.product (t.product t)) (tile.rectangleTuple top greatest R seed) related + (t.lexProductOrder_iff (t.product t) R (R.lex R) heightOrder inner) + have hHH := M.prod_mem pairing unions powers separation hH hH + have hrHH := M.lexProductOrder_mem pairing unions powers separation hH hH hrH hrH + obtain ⟨height, ground, code, inside, rangeGround, rangeSmall, _⟩ := + M.exists_groundHeightInterpolation pairing unions powers separation collection infinite hL + (M.prod_mem pairing unions powers separation hH hHH) + (M.lexProductOrder_mem pairing unions powers separation hH hHH hrH hrHH) tuple.1 + hD hrD hc strict (lexProductOrder_code linear (lexProductOrder_code linear linear)) + target injection tuple.2 hlo hhi gap + exact ⟨height, ground, ⟨code, inside⟩, rangeGround, rangeSmall⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization Compression.RecursiveMaps SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable {A H : Type u} (s : Presentation A) (t : Presentation H) +variable {P : MeetOrder A} (top : A) (greatest : ∀ a, P.le a top) +variable (R : LinearHeightOrder H) (seed : StrictHeight P R.toHeightOrder) +variable {rH D rD c lo hi : ZFSet.{u}} +variable (heightOrder : ∀ a b, ZFSet.pair (t.encode a) (t.encode b) ∈ rH ↔ R.lt a b) +variable (linear : StrictLinearOrderCode t.carrier rH) +variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) +variable (hP : s.carrier ∈ M.sets) (hH : t.carrier ∈ M.sets) +variable (hSeed : s.graph t seed.value ∈ M.sets) (hrH : rH ∈ M.sets) +variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) +variable (small : M.groundEmbeddable (relationImage s.carrier t.carrier (s.graph t seed.value)) ZFSet.omega) +variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) +include top greatest pairing unions powers separation collection infinite heightOrder linear target injection + hP hH hSeed hrH hD hrD hc small hlo hhi gap + +theorem exists_requestTileIntervalHeight (request : TileRequests.Request P) + (q : Presentation (request.tile top greatest).Space) {r ν : ZFSet.{u}} + (hL : q.carrier ∈ M.sets) (hν : ν ∈ M.sets) + (related : ∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ r ↔ (request.tile top greatest).order.le x y) + (meetFunction : ZFSet.IsFunc (ZFSet.prod q.carrier q.carrier) q.carrier ν) + (meetEntries : ∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) + (q.encode ((request.tile top greatest).order.meet x y)) ∈ ν) + (root : s.graph q (request.tile top greatest).root.toFun ∈ M.sets) + (children : ∀ j, s.graph q ((request.tile top greatest).child j).toFun ∈ M.sets) : + ∃ height ∈ M.sets, IntervalHeightCode q.carrier r D rD lo hi height ∧ + relationImage q.carrier D height ∈ M.sets ∧ + M.groundEmbeddable (relationImage q.carrier D height) ZFSet.omega := by + cases request with + | separation W => + exact M.exists_binaryTileIntervalHeight pairing unions powers separation collection infinite s t top greatest R seed + heightOrder linear target injection hP hH hSeed hrH hD hrD hc small hlo hhi gap + _ q hL hν related meetFunction meetEntries root (children ⟨()⟩) + | compression K copy => + exact M.exists_binaryTileIntervalHeight pairing unions powers separation collection infinite s t top greatest R seed + heightOrder linear target injection hP hH hSeed hrH hD hrD hc small hlo hhi gap + _ q hL hν related meetFunction meetEntries root (children ⟨()⟩) + | rectangle data => + exact M.exists_rectangleTileIntervalHeight pairing unions powers separation collection infinite s t top greatest R seed + heightOrder linear target injection hP hH hSeed hrH hD hrD hc small hlo hhi gap + _ q hL hν related meetFunction meetEntries root (children ⟨false⟩) (children ⟨true⟩) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +universe u + +def intervalHeightCandidate (Ps rs D rD lo hi i f : ZFSet.{u}) : Prop := + ∃ P ∈ ⋃₀ ⋃₀ Ps, ∃ r ∈ ⋃₀ ⋃₀ rs, + ZFSet.pair i P ∈ Ps ∧ ZFSet.pair i r ∈ rs ∧ IntervalHeightCode P r D rD lo hi f + +noncomputable def intervalHeightRelation (I W Ps rs D rD lo hi : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ W, z = ZFSet.pair i f ∧ + intervalHeightCandidate Ps rs D rD lo hi i f) (ZFSet.prod I W) + +theorem pair_mem_intervalHeightRelation (I W Ps rs D rD lo hi i f : ZFSet.{u}) : + ZFSet.pair i f ∈ intervalHeightRelation I W Ps rs D rD lo hi ↔ + i ∈ I ∧ f ∈ W ∧ intervalHeightCandidate Ps rs D rD lo hi i f := by + rw [intervalHeightRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, valid⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hi, hf, valid⟩ + · rintro ⟨hi, hf, valid⟩ + exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, valid⟩ + +theorem intervalHeightCandidate_iff {I Ps rs D rD lo hi : ZFSet.{u}} + (sources : FunctionGraphOn I Ps) (orders : FunctionGraphOn I rs) + (i : {i : ZFSet.{u} // i ∈ I}) (f : ZFSet.{u}) : + intervalHeightCandidate Ps rs D rD lo hi i.val f ↔ + IntervalHeightCode (sources.value i) (orders.value i) D rD lo hi f := by + constructor + · rintro ⟨P, _, r, _, pEntry, rEntry, code⟩ + rw [sources.value_eq_of_entry i pEntry, orders.value_eq_of_entry i rEntry] + exact code + · intro code + exact ⟨sources.value i, sources.value_mem_doubleUnion i, + orders.value i, orders.value_mem_doubleUnion i, + sources.value_entry i, orders.value_entry i, code⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization Compression.RecursiveMaps SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable {P r μ H rH old D rD c lo hi : ZFSet.{u}} +variable (source : MeetOrderCode P r μ) (top : SetMembers P) +variable (greatest : ∀ x, source.toSmallMeetOrder.le x top) +variable (height : StrictHeightGraphCode P H r rH old) (linear : StrictLinearOrderCode H rH) +variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) +variable (hP : P ∈ M.sets) (hH : H ∈ M.sets) (hOld : old ∈ M.sets) (hrH : rH ∈ M.sets) +variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) +variable (small : M.groundEmbeddable (relationImage P H old) ZFSet.omega) +variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) +include pairing unions powers separation collection infinite top greatest + height linear target injection hP hH hOld hrH hD hrD hc small hlo hhi gap + +theorem exists_codedBinaryTileHeight {L v ν first second : ZFSet.{u}} + (tileMeet : MeetOrderCode L v ν) (hL : L ∈ M.sets) (hν : ν ∈ M.sets) + (left : MeetEmbeddingCode P L r v μ ν first) (right : MeetEmbeddingCode P L r v μ ν second) + (hFirst : first ∈ M.sets) (hSecond : second ∈ M.sets) + (leftIdeal : ∀ x y z, ZFSet.pair x y ∈ first → z ∈ L → ZFSet.pair z y ∈ v → + ∃ a ∈ P, ZFSet.pair a z ∈ first) + (rightIdeal : ∀ x y z, ZFSet.pair x y ∈ second → z ∈ L → ZFSet.pair z y ∈ v → + ∃ a ∈ P, ZFSet.pair a z ∈ second) + (cover : ∀ z ∈ L, (∃ x ∈ P, ZFSet.pair x z ∈ first) ∨ ∃ x ∈ P, ZFSet.pair x z ∈ second) : + ∃ h ∈ M.sets, IntervalHeightCode L v D rD lo hi h ∧ relationImage L D h ∈ M.sets ∧ + M.groundEmbeddable (relationImage L D h) ZFSet.omega := by + let tile := binaryTileOfCodes source tileMeet left right leftIdeal rightIdeal cover + have seedGround : (SetMembers.presentation P).graph (SetMembers.presentation H) + (height.smallHeight source linear).value ∈ M.sets := by + rw [height.smallHeight_graph] + exact hOld + have seedSmall : M.groundEmbeddable (relationImage P H + ((SetMembers.presentation P).graph (SetMembers.presentation H) (height.smallHeight source linear).value)) ZFSet.omega := by + rw [height.smallHeight_graph] + exact small + have leftGround : (SetMembers.presentation P).graph (SetMembers.presentation L) tile.root.toFun ∈ M.sets := by + change (SetMembers.presentation P).graph (SetMembers.presentation L) left.smallValue ∈ M.sets + rw [left.smallValue_graph] + exact hFirst + have rightGround : (SetMembers.presentation P).graph (SetMembers.presentation L) (tile.child ⟨()⟩).toFun ∈ M.sets := by + change (SetMembers.presentation P).graph (SetMembers.presentation L) right.smallValue ∈ M.sets + rw [right.smallValue_graph] + exact hSecond + exact M.exists_binaryTileIntervalHeight pairing unions powers separation collection infinite + (SetMembers.presentation P) (SetMembers.presentation H) top greatest linear.smallOrder + (height.smallHeight source linear) (fun _ _ => Iff.rfl) linear target injection + hP hH seedGround hrH hD hrD hc seedSmall hlo hhi gap tile (SetMembers.presentation L) + hL hν (fun _ _ => Iff.rfl) tileMeet.operation tileMeet.smallMeet_entry leftGround rightGround + +theorem exists_separationTileHeight {W : ZFSet.{u}} + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hW : W ∈ P) : + ∃ h ∈ M.sets, IntervalHeightCode (separationTileCarrier P r W) (separationTileOrder P r μ W) + D rD lo hi h ∧ relationImage (separationTileCarrier P r W) D h ∈ M.sets ∧ + M.groundEmbeddable (relationImage (separationTileCarrier P r W) D h) ZFSet.omega := by + let tile := separationTileCoding source ⟨W, hW⟩ + have ground := M.separationTile_ground pairing unions powers separation source hP hr hμ hW + have embeddings := separationTile_embeddings source hW + apply M.exists_codedBinaryTileHeight pairing unions powers separation collection infinite + source top greatest height linear target injection hP hH hOld hrH hD hrD hc small hlo hhi gap + tile.meetOrder ground.1 ground.2.2.1 embeddings.1 embeddings.2 ground.2.2.2.1 ground.2.2.2.2 + · intro x y z entry hz lower + obtain ⟨hx, equal⟩ := (pair_mem_attachmentOldEmbeddingGraph P x y).1 entry + subst y + exact tile.old_graph_ideal hx hz lower + · exact fun _ _ _ entry hz lower => tile.template_graph_ideal entry hz lower + · exact tile.vertex_cover + +theorem exists_compressionTileHeight {f : ZFSet.{u}} + (embedding : MeetEmbeddingCode P P r r μ μ f) + (K : {x : ZFSet.{u} // x ∈ P}) + (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : + let topRaw : {x : ZFSet.{u} // x ∈ P} := ⟨SetMembers.raw top, SetMembers.raw_mem top⟩ + let rawGreatest : ∀ x, source.toMeetOrder.le x topRaw := + fun x => by + change ZFSet.pair x.val (SetMembers.raw top) ∈ r + have lower := greatest (SetMembers.ofMem x.val x.property) + change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x.val x.property)) (SetMembers.raw top) ∈ r at lower + simpa only [SetMembers.raw_ofMem] using lower + let tile := compressionTileCoding source embedding topRaw K rawGreatest range + ∃ h ∈ M.sets, IntervalHeightCode tile.carrier tile.order D rD lo hi h ∧ + relationImage tile.carrier D h ∈ M.sets ∧ + M.groundEmbeddable (relationImage tile.carrier D h) ZFSet.omega := by + dsimp only + obtain ⟨h, ground, strict, inside, rangeGround, rangeSmall, _⟩ := + M.exists_groundHeightInterpolation pairing unions powers separation collection infinite + hP hH hrH hOld hD hrD hc height linear target injection small hlo hhi gap + have codes := compressionTile_exact_codes source embedding + ⟨SetMembers.raw top, SetMembers.raw_mem top⟩ K + (fun x => by + change ZFSet.pair x.val (SetMembers.raw top) ∈ r + have lower := greatest (SetMembers.ofMem x.val x.property) + change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x.val x.property)) (SetMembers.raw top) ∈ r at lower + simpa only [SetMembers.raw_ofMem] using lower) range + rw [codes.1, codes.2.1] + exact ⟨h, ground, ⟨strict, inside⟩, rangeGround, rangeSmall⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCoherentHeightUnion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCoherentHeightUnion.lean index be287ee545db666d3178c64971b6128bcc4fc1d3..45581d7d0f472994300ec26f43ce399fb0b91690 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCoherentHeightUnion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCoherentHeightUnion.lean @@ -1,96 +1,96 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.NatUnionCode -universe u - -theorem strictLexHeight {P r h : Nat → ZFSet.{u}} {U R H C D rD : ZFSet.{u}} - (carrier : NatUnionCode P U) (relation : NatUnionCode r R) (height : NatUnionCode h H) - (orders : ∀ n, PartialOrderCode (P n) (r n)) - (codes : ∀ n, StrictLexHeightCode (P n) C D (r n) (h n) rD) - (heightMono : ∀ n m, n ≤ m → h n ⊆ h m) : StrictLexHeightCode U C D R H rD := by - have function := carrier.isFunc (NatUnionCode.constant (ZFSet.prod C D)) height - (fun n => (codes n).function) heightMono - refine ⟨function, ?_⟩ - intro x _ y _ c q d v lower different first second - obtain ⟨n, finiteLower⟩ := (relation (ZFSet.pair x y)).1 lower - have bounds := ZFSet.pair_mem_prod.1 ((orders n).relation finiteLower) - exact (codes n).strict x bounds.1 y bounds.2 c q d v finiteLower different - ((height.function_entry_iff function (fun n => (codes n).function) n bounds.1).1 first) - ((height.function_entry_iff function (fun n => (codes n).function) n bounds.2).1 second) - -theorem height_entry_iff {P r h : Nat → ZFSet.{u}} {U R H C D rD : ZFSet.{u}} - (height : NatUnionCode h H) (code : StrictLexHeightCode U C D R H rD) - (codes : ∀ n, StrictLexHeightCode (P n) C D (r n) (h n) rD) - (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ P n) : - ZFSet.pair x y ∈ H ↔ ZFSet.pair x y ∈ h n := - height.function_entry_iff code.function (fun n => (codes n).function) n hx - -theorem height_column_bound {h : Nat → ZFSet.{u}} {H B : ZFSet.{u}} - (height : NatUnionCode h H) - (bounded : ∀ n x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h n → c ∈ B) : - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ H → c ∈ B := by - intro x c q entry - obtain ⟨n, finiteEntry⟩ := (height (ZFSet.pair x (ZFSet.pair c q))).1 entry - exact bounded n x c q finiteEntry - -theorem height_weak_bound {h : Nat → ZFSet.{u}} {H bound order : ZFSet.{u}} - (height : NatUnionCode h H) - (bounded : ∀ n x y, ZFSet.pair x y ∈ h n → - y = bound ∨ ZFSet.pair y bound ∈ order) : - ∀ x y, ZFSet.pair x y ∈ H → y = bound ∨ ZFSet.pair y bound ∈ order := by - intro x y entry - obtain ⟨n, finiteEntry⟩ := (height (ZFSet.pair x y)).1 entry - exact bounded n x y finiteEntry - -end PartitionPilot.Forcing.NatUnionCode - - - -namespace PartitionPilot.Forcing -universe u - -theorem natGraphMono_of_adjacent {graphs : Nat → ZFSet.{u}} - (adjacent : ∀ n, graphs n ⊆ graphs (n + 1)) : - ∀ n m, n ≤ m → graphs n ⊆ graphs m := by - intro n m before - induction m, before using Nat.le_induction with - | base => exact fun _ hx => hx - | succ m _ ih => exact fun _ hx => adjacent m (ih hx) - -namespace TransitiveGround -open SetFormula - -theorem exists_groundCoherentHeightUnion (M : TransitiveGround.{u}) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - {family U R C D rD B : ZFSet.{u}} {P r : Nat → ZFSet.{u}} - (hFamily : family ∈ M.sets) (function : FunctionGraphOn ZFSet.omega family) - (carrier : NatUnionCode P U) (relation : NatUnionCode r R) - (orders : ∀ n, PartialOrderCode (P n) (r n)) - (codes : ∀ n, StrictLexHeightCode (P n) C D (r n) (function.natValue n) rD) - (adjacent : ∀ n, function.natValue n ⊆ function.natValue (n + 1)) - (columns : ∀ n x c q, ZFSet.pair x (ZFSet.pair c q) ∈ function.natValue n → c ∈ B) : - ∃ height ∈ M.sets, - NatUnionCode function.natValue height ∧ StrictLexHeightCode U C D R height rD ∧ - (∀ n x, x ∈ P n → ∀ y, ZFSet.pair x y ∈ height ↔ - ZFSet.pair x y ∈ function.natValue n) ∧ - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ B := by - have exactUnion := naturalFamilyUnion_code function - have code := carrier.strictLexHeight relation exactUnion orders codes (natGraphMono_of_adjacent adjacent) - exact ⟨naturalFamilyUnion family, M.naturalFamilyUnion_mem unions separation hω hFamily, - exactUnion, code, - fun n x hx _ => exactUnion.height_entry_iff code codes n hx, - exactUnion.height_column_bound columns⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.NatUnionCode +universe u + +theorem strictLexHeight {P r h : Nat → ZFSet.{u}} {U R H C D rD : ZFSet.{u}} + (carrier : NatUnionCode P U) (relation : NatUnionCode r R) (height : NatUnionCode h H) + (orders : ∀ n, PartialOrderCode (P n) (r n)) + (codes : ∀ n, StrictLexHeightCode (P n) C D (r n) (h n) rD) + (heightMono : ∀ n m, n ≤ m → h n ⊆ h m) : StrictLexHeightCode U C D R H rD := by + have function := carrier.isFunc (NatUnionCode.constant (ZFSet.prod C D)) height + (fun n => (codes n).function) heightMono + refine ⟨function, ?_⟩ + intro x _ y _ c q d v lower different first second + obtain ⟨n, finiteLower⟩ := (relation (ZFSet.pair x y)).1 lower + have bounds := ZFSet.pair_mem_prod.1 ((orders n).relation finiteLower) + exact (codes n).strict x bounds.1 y bounds.2 c q d v finiteLower different + ((height.function_entry_iff function (fun n => (codes n).function) n bounds.1).1 first) + ((height.function_entry_iff function (fun n => (codes n).function) n bounds.2).1 second) + +theorem height_entry_iff {P r h : Nat → ZFSet.{u}} {U R H C D rD : ZFSet.{u}} + (height : NatUnionCode h H) (code : StrictLexHeightCode U C D R H rD) + (codes : ∀ n, StrictLexHeightCode (P n) C D (r n) (h n) rD) + (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ P n) : + ZFSet.pair x y ∈ H ↔ ZFSet.pair x y ∈ h n := + height.function_entry_iff code.function (fun n => (codes n).function) n hx + +theorem height_column_bound {h : Nat → ZFSet.{u}} {H B : ZFSet.{u}} + (height : NatUnionCode h H) + (bounded : ∀ n x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h n → c ∈ B) : + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ H → c ∈ B := by + intro x c q entry + obtain ⟨n, finiteEntry⟩ := (height (ZFSet.pair x (ZFSet.pair c q))).1 entry + exact bounded n x c q finiteEntry + +theorem height_weak_bound {h : Nat → ZFSet.{u}} {H bound order : ZFSet.{u}} + (height : NatUnionCode h H) + (bounded : ∀ n x y, ZFSet.pair x y ∈ h n → + y = bound ∨ ZFSet.pair y bound ∈ order) : + ∀ x y, ZFSet.pair x y ∈ H → y = bound ∨ ZFSet.pair y bound ∈ order := by + intro x y entry + obtain ⟨n, finiteEntry⟩ := (height (ZFSet.pair x y)).1 entry + exact bounded n x y finiteEntry + +end PartitionPilot.Forcing.NatUnionCode + + + +namespace PartitionPilot.Forcing +universe u + +theorem natGraphMono_of_adjacent {graphs : Nat → ZFSet.{u}} + (adjacent : ∀ n, graphs n ⊆ graphs (n + 1)) : + ∀ n m, n ≤ m → graphs n ⊆ graphs m := by + intro n m before + induction m, before using Nat.le_induction with + | base => exact fun _ hx => hx + | succ m _ ih => exact fun _ hx => adjacent m (ih hx) + +namespace TransitiveGround +open SetFormula + +theorem exists_groundCoherentHeightUnion (M : TransitiveGround.{u}) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + {family U R C D rD B : ZFSet.{u}} {P r : Nat → ZFSet.{u}} + (hFamily : family ∈ M.sets) (function : FunctionGraphOn ZFSet.omega family) + (carrier : NatUnionCode P U) (relation : NatUnionCode r R) + (orders : ∀ n, PartialOrderCode (P n) (r n)) + (codes : ∀ n, StrictLexHeightCode (P n) C D (r n) (function.natValue n) rD) + (adjacent : ∀ n, function.natValue n ⊆ function.natValue (n + 1)) + (columns : ∀ n x c q, ZFSet.pair x (ZFSet.pair c q) ∈ function.natValue n → c ∈ B) : + ∃ height ∈ M.sets, + NatUnionCode function.natValue height ∧ StrictLexHeightCode U C D R height rD ∧ + (∀ n x, x ∈ P n → ∀ y, ZFSet.pair x y ∈ height ↔ + ZFSet.pair x y ∈ function.natValue n) ∧ + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ B := by + have exactUnion := naturalFamilyUnion_code function + have code := carrier.strictLexHeight relation exactUnion orders codes (natGraphMono_of_adjacent adjacent) + exact ⟨naturalFamilyUnion family, M.naturalFamilyUnion_mem unions separation hω hFamily, + exactUnion, code, + fun n x hx _ => exactUnion.height_entry_iff code codes n hx, + exactUnion.height_column_bound columns⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompleteProjectionRefinementTests.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompleteProjectionRefinementTests.lean index 648223025cd5bb2437860c1e3175797365077361..0a2967543b27cff8c0647b51cd5f85332a0a3c0d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompleteProjectionRefinementTests.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompleteProjectionRefinementTests.lean @@ -1,62 +1,62 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {Lower Upper : Type u} -variable [PartialOrder Lower] [PartialOrder Upper] -variable (lower : Presentation Lower) (upper : Presentation Upper) -variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} -variable (projection : CompleteProjection restriction inclusion) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) -variable (inclusionGround : lower.graph upper inclusion ∈ M.sets) -include pairing unions powers separation collection lowerGround upperGround inclusionGround - -theorem completeProjection_refinementCollision_eval - (H : ConditionFilter Upper) (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) - (env : Assignment (M.nameDomain lower) 4) {q : Lower} - (member : (projection.projectedFilter H).mem q) - (test : Forces (M.nameDomain lower) refinementCollisionFormula env q) : - (Name.eval {r | (projection.projectedFilter H).mem r} (env 0).val = - Name.eval {r | (projection.projectedFilter H).mem r} (env 1).val ↔ - Name.eval {r | (projection.projectedFilter H).mem r} (env 2).val = - Name.eval {r | (projection.projectedFilter H).mem r} (env 3).val) := by - let lifted : Assignment (M.nameDomain upper) 4 := fun i => - ⟨Name.rename upper inclusion (env i).val, - M.rename_between_mem lower upper pairing unions powers separation collection - lowerGround upperGround inclusion inclusionGround (env i).val (env i).property⟩ - have atomic (p : Upper) (i j : Fin 4) : - Name.ForcesEq p (lifted i).val (lifted j).val ↔ - Name.ForcesEq (restriction p) (env i).val (env j).val := - Name.forcesEq_rename_completeProjection lower upper restriction inclusion projection p _ _ - have transfer (i j k l : Fin 4) - (clause : ∀ r, r ≤ q → ¬ (Name.ForcesEq r (env i).val (env j).val ∧ - ∀ p, p ≤ r → ¬ Name.ForcesEq p (env k).val (env l).val)) : - ∀ r, r ≤ inclusion q → ¬ (Name.ForcesEq r (lifted i).val (lifted j).val ∧ - ∀ p, p ≤ r → ¬ Name.ForcesEq p (lifted k).val (lifted l).val) := by - intro r rq facts - apply clause (restriction r) ((projection.le_include_iff r q).1 rq) - refine ⟨(atomic r i j).1 facts.1, ?_⟩ - intro p pr eq - obtain ⟨v, vr, vp⟩ := projection.lift r p pr - apply facts.2 v vr - exact (atomic v k l).2 (vp.symm ▸ eq) - have upperTest : Forces (M.nameDomain upper) refinementCollisionFormula lifted (inclusion q) := - ⟨transfer 0 1 2 3 test.1, transfer 2 3 0 1 test.2⟩ - have evaluated := M.refinementCollision_eval upper lifted H ordinary member upperTest - simpa only [lifted, Name.eval_rename, CompleteProjection.projectedFilter, - Set.mem_ofPred_eq] using evaluated - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {Lower Upper : Type u} +variable [PartialOrder Lower] [PartialOrder Upper] +variable (lower : Presentation Lower) (upper : Presentation Upper) +variable {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} +variable (projection : CompleteProjection restriction inclusion) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (lowerGround : lower.carrier ∈ M.sets) (upperGround : upper.carrier ∈ M.sets) +variable (inclusionGround : lower.graph upper inclusion ∈ M.sets) +include pairing unions powers separation collection lowerGround upperGround inclusionGround + +theorem completeProjection_refinementCollision_eval + (H : ConditionFilter Upper) (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) + (env : Assignment (M.nameDomain lower) 4) {q : Lower} + (member : (projection.projectedFilter H).mem q) + (test : Forces (M.nameDomain lower) refinementCollisionFormula env q) : + (Name.eval {r | (projection.projectedFilter H).mem r} (env 0).val = + Name.eval {r | (projection.projectedFilter H).mem r} (env 1).val ↔ + Name.eval {r | (projection.projectedFilter H).mem r} (env 2).val = + Name.eval {r | (projection.projectedFilter H).mem r} (env 3).val) := by + let lifted : Assignment (M.nameDomain upper) 4 := fun i => + ⟨Name.rename upper inclusion (env i).val, + M.rename_between_mem lower upper pairing unions powers separation collection + lowerGround upperGround inclusion inclusionGround (env i).val (env i).property⟩ + have atomic (p : Upper) (i j : Fin 4) : + Name.ForcesEq p (lifted i).val (lifted j).val ↔ + Name.ForcesEq (restriction p) (env i).val (env j).val := + Name.forcesEq_rename_completeProjection lower upper restriction inclusion projection p _ _ + have transfer (i j k l : Fin 4) + (clause : ∀ r, r ≤ q → ¬ (Name.ForcesEq r (env i).val (env j).val ∧ + ∀ p, p ≤ r → ¬ Name.ForcesEq p (env k).val (env l).val)) : + ∀ r, r ≤ inclusion q → ¬ (Name.ForcesEq r (lifted i).val (lifted j).val ∧ + ∀ p, p ≤ r → ¬ Name.ForcesEq p (lifted k).val (lifted l).val) := by + intro r rq facts + apply clause (restriction r) ((projection.le_include_iff r q).1 rq) + refine ⟨(atomic r i j).1 facts.1, ?_⟩ + intro p pr eq + obtain ⟨v, vr, vp⟩ := projection.lift r p pr + apply facts.2 v vr + exact (atomic v k l).2 (vp.symm ▸ eq) + have upperTest : Forces (M.nameDomain upper) refinementCollisionFormula lifted (inclusion q) := + ⟨transfer 0 1 2 3 test.1, transfer 2 3 0 1 test.2⟩ + have evaluated := M.refinementCollision_eval upper lifted H ordinary member upperTest + simpa only [lifted, Name.eval_rename, CompleteProjection.projectedFilter, + Set.mem_ofPred_eq] using evaluated + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedCompressionCertificateRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedCompressionCertificateRecognition.lean index de45856d5b11c40b5033461a849ca1ec69b4b8da..38a32903d1a1717bce8cb1c5869e9f8789346b95 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedCompressionCertificateRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedCompressionCertificateRecognition.lean @@ -1,198 +1,198 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundCompletedCompressionCertificateFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -include pairing unions powers separation collection infinite - -theorem realize_compressionCertificate_iff {Labels z : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hz : z ∈ M.sets) : - Realize M.sets (M.initialCompressionCertificateFormula pairing unions powers separation - 0 1 2 3 4 5 6 7) - (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors - (extend stage.order (extend stage.meetGraph (extend stage.action (extend Labels Fin.elim0)))))))) ↔ - ∃ certificate : GroundInitialCompressionCertificate stage Labels, certificate.code = z := by - let env := extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors - (extend stage.order (extend stage.meetGraph (extend stage.action (extend Labels Fin.elim0))))))) - have members : ∀ i, env i ∈ M.sets := - Fin.cases hz (Fin.cases (M.omega_mem separation infinite) (Fin.cases stage.carrier_ground - (Fin.cases stage.actors_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground - (Fin.cases stage.action_ground (Fin.cases hLabels (fun i => Fin.elim0 i)))))))) - rw [M.realize_initialCompressionCertificateFormula pairing unions powers separation - 0 1 2 3 4 5 6 7 env members stage.meet] - change M.InitialCompressionCertificateCode pairing unions powers separation z ZFSet.omega - stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels ↔ _ - unfold TransitiveGround.InitialCompressionCertificateCode - constructor - · rintro ⟨Reps, hReps, H, hH, U, hU, stored, represented, trace, unionCode⟩ - obtain ⟨certificate, sameReps⟩ := stage.compressionCertificate_of_representatives - pairing unions powers separation collection infinite hLabels hReps represented - have historyCode := (certificate.realize_history_iff pairing unions powers separation - collection infinite hLabels hH) - rw [sameReps] at historyCode - have historyEq := historyCode.1 trace - have unionEq := (certificate.realize_union_iff separation infinite hU hH historyEq).1 unionCode - refine ⟨certificate, ?_⟩ - simpa only [GroundInitialCompressionCertificate.code, sameReps, historyEq, unionEq] using stored.symm - · rintro ⟨certificate, coded⟩ - have hH := certificate.history_ground pairing unions powers separation collection infinite hLabels - have hU := certificate.unionData.code_ground pairing - exact ⟨certificate.Reps, certificate.representatives_ground, certificate.history, hH, - certificate.unionData.code, hU, coded.symm, certificate.representatives, - (certificate.realize_history_iff pairing unions powers separation collection infinite hLabels hH).2 rfl, - (certificate.realize_union_iff separation infinite hU hH rfl).2 rfl⟩ - -theorem exists_groundRecognizedCompressionCertificate - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Labels : ZFSet.{u}} (hLabels : Labels ∈ M.sets) : - ∃ z ∈ M.sets, Realize M.sets - (M.initialCompressionCertificateFormula pairing unions powers separation 0 1 2 3 4 5 6 7) - (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors - (extend stage.order (extend stage.meetGraph (extend stage.action (extend Labels Fin.elim0)))))))) := by - obtain ⟨certificate⟩ := stage.exists_compressionCertificate - pairing unions powers separation collection infinite choice hLabels - have ground := certificate.code_ground pairing unions powers separation collection infinite hLabels - exact ⟨certificate.code, ground, (stage.realize_compressionCertificate_iff - pairing unions powers separation collection infinite hLabels ground).2 ⟨certificate, rfl⟩⟩ - -end PartitionPilot.Forcing.GroundMainStage - - - -namespace PartitionPilot.Forcing.GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -include pairing unions powers separation collection infinite - -theorem realize_completedCompressionCertificate_iff {Labels z : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hz : z ∈ M.sets) : - Realize M.sets (M.completedCompressionCertificateFormula pairing unions powers separation - 0 1 2 3 4 5 6 7 8) - (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors - (extend stage.order (extend stage.meetGraph (extend stage.action - (extend Labels (extend stage.top Fin.elim0))))))))) ↔ - ∃ completed : GroundInitialCompletedCompressionCertificate stage Labels, - completed.code = z := by - let env := extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors - (extend stage.order (extend stage.meetGraph (extend stage.action - (extend Labels (extend stage.top Fin.elim0)))))))) - have members : ∀ j, env j ∈ M.sets := - Fin.cases hz (Fin.cases (M.omega_mem separation infinite) (Fin.cases stage.carrier_ground - (Fin.cases stage.actors_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground - (Fin.cases stage.action_ground (Fin.cases hLabels - (Fin.cases stage.top_ground (fun j => Fin.elim0 j))))))))) - rw [M.realize_completedCompressionCertificateFormula pairing unions powers separation - 0 1 2 3 4 5 6 7 8 env members stage.meet] - change M.CompletedCompressionCertificateCode pairing unions powers separation z ZFSet.omega - stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels stage.top ↔ _ - have initial_iff (c : ZFSet.{u}) (hc : c ∈ M.sets) : - M.InitialCompressionCertificateCode pairing unions powers separation c ZFSet.omega - stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels ↔ - ∃ certificate : GroundInitialCompressionCertificate stage Labels, certificate.code = c := by - have recognized := stage.realize_compressionCertificate_iff - pairing unions powers separation collection infinite hLabels hc - have coreMembers : ∀ j : Fin 8, - (extend c (extend ZFSet.omega (extend stage.carrier (extend stage.actors - (extend stage.order (extend stage.meetGraph (extend stage.action - (extend Labels Fin.elim0)))))))) j ∈ M.sets := - Fin.cases hc (Fin.cases (M.omega_mem separation infinite) - (Fin.cases stage.carrier_ground (Fin.cases stage.actors_ground - (Fin.cases stage.order_ground (Fin.cases stage.meet_ground - (Fin.cases stage.action_ground (Fin.cases hLabels (fun j => Fin.elim0 j)))))))) - exact (M.realize_initialCompressionCertificateFormula pairing unions powers separation - 0 1 2 3 4 5 6 7 _ coreMembers stage.meet).symm.trans recognized - unfold TransitiveGround.CompletedCompressionCertificateCode - constructor - · rintro ⟨stored, storedGround, outer, initialCode, core, fields, inner, unionTuple, maps, bases, caps⟩ - obtain ⟨certificate, certificateEq⟩ := (initial_iff (stored 0) (storedGround 0)).1 initialCode - obtain ⟨completion⟩ := certificate.exists_completion - pairing unions powers separation collection infinite hLabels - have sameCore := nonemptyTupleCode_injective 2 (certificateEq.trans inner) - have sameUnionCode : certificate.unionData.code = core 2 := congrFun sameCore 2 - have sameFields : certificate.unionData.fields = fields := - nonemptyTupleCode_injective 12 (sameUnionCode.trans unionTuple) - have fieldsEq : completion.algebra.union.fields = fields := - (congrArg GroundCompressionUnionData.fields (certificate.completion_union completion)).trans sameFields - have mapsEq : completion.algebra.maps = stored 1 := by - rw [completion.algebra.maps_eq_sections, fieldsEq] - exact maps.symm - have basesEq : completion.algebra.bases = stored 2 := by - unfold GroundCompressionAlgebra.bases - rw [fieldsEq, mapsEq] - exact bases.symm - have capsEq : completion.algebra.caps stage.top = stored 3 := by - unfold GroundCompressionAlgebra.caps - rw [fieldsEq, mapsEq] - exact caps.symm - refine ⟨⟨certificate, completion⟩, ?_⟩ - change nonemptyTupleCode 3 (Fin.cases certificate.code - (Fin.cases completion.algebra.maps (Fin.cases completion.algebra.bases - (fun _ => completion.algebra.caps stage.top)))) = z - rw [certificateEq, mapsEq, basesEq, capsEq] - exact (congrArg (nonemptyTupleCode 3) (by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun k => Fin.elim0 k)))) j)).trans outer.symm - · rintro ⟨completed, coded⟩ - let stored : Fin 4 → ZFSet.{u} := Fin.cases completed.certificate.code - (Fin.cases completed.completion.algebra.maps (Fin.cases completed.completion.algebra.bases - (fun _ => completed.completion.algebra.caps stage.top))) - let core : Fin 3 → ZFSet.{u} := Fin.cases completed.certificate.Reps - (Fin.cases completed.certificate.history (fun _ => completed.certificate.unionData.code)) - have hCore := completed.certificate.code_ground - pairing unions powers separation collection infinite hLabels - have ground : ∀ j, stored j ∈ M.sets := Fin.cases hCore - (Fin.cases completed.completion.algebra.ground - (Fin.cases completed.completion.bases_ground (fun _ => completed.completion.caps_ground))) - refine ⟨stored, ground, coded.symm, (initial_iff _ hCore).2 ⟨completed.certificate, rfl⟩, - core, completed.certificate.unionData.fields, rfl, rfl, ?_, ?_, ?_⟩ - · change completed.completion.algebra.maps = _ - rw [completed.completion.algebra.maps_eq_sections, - completed.certificate.completion_union completed.completion] - rfl - · change completed.completion.algebra.bases = _ - unfold GroundCompressionAlgebra.bases - rw [completed.certificate.completion_union completed.completion] - rfl - · change completed.completion.algebra.caps stage.top = _ - unfold GroundCompressionAlgebra.caps - rw [completed.certificate.completion_union completed.completion] - rfl - -theorem exists_groundRecognizedCompletedCompressionCertificate - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Labels : ZFSet.{u}} (hLabels : Labels ∈ M.sets) : - ∃ z ∈ M.sets, Realize M.sets - (M.completedCompressionCertificateFormula pairing unions powers separation 0 1 2 3 4 5 6 7 8) - (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors - (extend stage.order (extend stage.meetGraph (extend stage.action - (extend Labels (extend stage.top Fin.elim0))))))))) := by - obtain ⟨certificate⟩ := stage.exists_compressionCertificate - pairing unions powers separation collection infinite choice hLabels - obtain ⟨completed, _⟩ := certificate.exists_completedCertificate - pairing unions powers separation collection infinite hLabels - have ground := completed.code_ground pairing unions powers separation collection infinite hLabels - exact ⟨completed.code, ground, (stage.realize_completedCompressionCertificate_iff - pairing unions powers separation collection infinite hLabels ground).2 ⟨completed, rfl⟩⟩ - -end PartitionPilot.Forcing.GroundMainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundCompletedCompressionCertificateFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +include pairing unions powers separation collection infinite + +theorem realize_compressionCertificate_iff {Labels z : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hz : z ∈ M.sets) : + Realize M.sets (M.initialCompressionCertificateFormula pairing unions powers separation + 0 1 2 3 4 5 6 7) + (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors + (extend stage.order (extend stage.meetGraph (extend stage.action (extend Labels Fin.elim0)))))))) ↔ + ∃ certificate : GroundInitialCompressionCertificate stage Labels, certificate.code = z := by + let env := extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors + (extend stage.order (extend stage.meetGraph (extend stage.action (extend Labels Fin.elim0))))))) + have members : ∀ i, env i ∈ M.sets := + Fin.cases hz (Fin.cases (M.omega_mem separation infinite) (Fin.cases stage.carrier_ground + (Fin.cases stage.actors_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground + (Fin.cases stage.action_ground (Fin.cases hLabels (fun i => Fin.elim0 i)))))))) + rw [M.realize_initialCompressionCertificateFormula pairing unions powers separation + 0 1 2 3 4 5 6 7 env members stage.meet] + change M.InitialCompressionCertificateCode pairing unions powers separation z ZFSet.omega + stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels ↔ _ + unfold TransitiveGround.InitialCompressionCertificateCode + constructor + · rintro ⟨Reps, hReps, H, hH, U, hU, stored, represented, trace, unionCode⟩ + obtain ⟨certificate, sameReps⟩ := stage.compressionCertificate_of_representatives + pairing unions powers separation collection infinite hLabels hReps represented + have historyCode := (certificate.realize_history_iff pairing unions powers separation + collection infinite hLabels hH) + rw [sameReps] at historyCode + have historyEq := historyCode.1 trace + have unionEq := (certificate.realize_union_iff separation infinite hU hH historyEq).1 unionCode + refine ⟨certificate, ?_⟩ + simpa only [GroundInitialCompressionCertificate.code, sameReps, historyEq, unionEq] using stored.symm + · rintro ⟨certificate, coded⟩ + have hH := certificate.history_ground pairing unions powers separation collection infinite hLabels + have hU := certificate.unionData.code_ground pairing + exact ⟨certificate.Reps, certificate.representatives_ground, certificate.history, hH, + certificate.unionData.code, hU, coded.symm, certificate.representatives, + (certificate.realize_history_iff pairing unions powers separation collection infinite hLabels hH).2 rfl, + (certificate.realize_union_iff separation infinite hU hH rfl).2 rfl⟩ + +theorem exists_groundRecognizedCompressionCertificate + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Labels : ZFSet.{u}} (hLabels : Labels ∈ M.sets) : + ∃ z ∈ M.sets, Realize M.sets + (M.initialCompressionCertificateFormula pairing unions powers separation 0 1 2 3 4 5 6 7) + (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors + (extend stage.order (extend stage.meetGraph (extend stage.action (extend Labels Fin.elim0)))))))) := by + obtain ⟨certificate⟩ := stage.exists_compressionCertificate + pairing unions powers separation collection infinite choice hLabels + have ground := certificate.code_ground pairing unions powers separation collection infinite hLabels + exact ⟨certificate.code, ground, (stage.realize_compressionCertificate_iff + pairing unions powers separation collection infinite hLabels ground).2 ⟨certificate, rfl⟩⟩ + +end PartitionPilot.Forcing.GroundMainStage + + + +namespace PartitionPilot.Forcing.GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +include pairing unions powers separation collection infinite + +theorem realize_completedCompressionCertificate_iff {Labels z : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hz : z ∈ M.sets) : + Realize M.sets (M.completedCompressionCertificateFormula pairing unions powers separation + 0 1 2 3 4 5 6 7 8) + (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors + (extend stage.order (extend stage.meetGraph (extend stage.action + (extend Labels (extend stage.top Fin.elim0))))))))) ↔ + ∃ completed : GroundInitialCompletedCompressionCertificate stage Labels, + completed.code = z := by + let env := extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors + (extend stage.order (extend stage.meetGraph (extend stage.action + (extend Labels (extend stage.top Fin.elim0)))))))) + have members : ∀ j, env j ∈ M.sets := + Fin.cases hz (Fin.cases (M.omega_mem separation infinite) (Fin.cases stage.carrier_ground + (Fin.cases stage.actors_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground + (Fin.cases stage.action_ground (Fin.cases hLabels + (Fin.cases stage.top_ground (fun j => Fin.elim0 j))))))))) + rw [M.realize_completedCompressionCertificateFormula pairing unions powers separation + 0 1 2 3 4 5 6 7 8 env members stage.meet] + change M.CompletedCompressionCertificateCode pairing unions powers separation z ZFSet.omega + stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels stage.top ↔ _ + have initial_iff (c : ZFSet.{u}) (hc : c ∈ M.sets) : + M.InitialCompressionCertificateCode pairing unions powers separation c ZFSet.omega + stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels ↔ + ∃ certificate : GroundInitialCompressionCertificate stage Labels, certificate.code = c := by + have recognized := stage.realize_compressionCertificate_iff + pairing unions powers separation collection infinite hLabels hc + have coreMembers : ∀ j : Fin 8, + (extend c (extend ZFSet.omega (extend stage.carrier (extend stage.actors + (extend stage.order (extend stage.meetGraph (extend stage.action + (extend Labels Fin.elim0)))))))) j ∈ M.sets := + Fin.cases hc (Fin.cases (M.omega_mem separation infinite) + (Fin.cases stage.carrier_ground (Fin.cases stage.actors_ground + (Fin.cases stage.order_ground (Fin.cases stage.meet_ground + (Fin.cases stage.action_ground (Fin.cases hLabels (fun j => Fin.elim0 j)))))))) + exact (M.realize_initialCompressionCertificateFormula pairing unions powers separation + 0 1 2 3 4 5 6 7 _ coreMembers stage.meet).symm.trans recognized + unfold TransitiveGround.CompletedCompressionCertificateCode + constructor + · rintro ⟨stored, storedGround, outer, initialCode, core, fields, inner, unionTuple, maps, bases, caps⟩ + obtain ⟨certificate, certificateEq⟩ := (initial_iff (stored 0) (storedGround 0)).1 initialCode + obtain ⟨completion⟩ := certificate.exists_completion + pairing unions powers separation collection infinite hLabels + have sameCore := nonemptyTupleCode_injective 2 (certificateEq.trans inner) + have sameUnionCode : certificate.unionData.code = core 2 := congrFun sameCore 2 + have sameFields : certificate.unionData.fields = fields := + nonemptyTupleCode_injective 12 (sameUnionCode.trans unionTuple) + have fieldsEq : completion.algebra.union.fields = fields := + (congrArg GroundCompressionUnionData.fields (certificate.completion_union completion)).trans sameFields + have mapsEq : completion.algebra.maps = stored 1 := by + rw [completion.algebra.maps_eq_sections, fieldsEq] + exact maps.symm + have basesEq : completion.algebra.bases = stored 2 := by + unfold GroundCompressionAlgebra.bases + rw [fieldsEq, mapsEq] + exact bases.symm + have capsEq : completion.algebra.caps stage.top = stored 3 := by + unfold GroundCompressionAlgebra.caps + rw [fieldsEq, mapsEq] + exact caps.symm + refine ⟨⟨certificate, completion⟩, ?_⟩ + change nonemptyTupleCode 3 (Fin.cases certificate.code + (Fin.cases completion.algebra.maps (Fin.cases completion.algebra.bases + (fun _ => completion.algebra.caps stage.top)))) = z + rw [certificateEq, mapsEq, basesEq, capsEq] + exact (congrArg (nonemptyTupleCode 3) (by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun k => Fin.elim0 k)))) j)).trans outer.symm + · rintro ⟨completed, coded⟩ + let stored : Fin 4 → ZFSet.{u} := Fin.cases completed.certificate.code + (Fin.cases completed.completion.algebra.maps (Fin.cases completed.completion.algebra.bases + (fun _ => completed.completion.algebra.caps stage.top))) + let core : Fin 3 → ZFSet.{u} := Fin.cases completed.certificate.Reps + (Fin.cases completed.certificate.history (fun _ => completed.certificate.unionData.code)) + have hCore := completed.certificate.code_ground + pairing unions powers separation collection infinite hLabels + have ground : ∀ j, stored j ∈ M.sets := Fin.cases hCore + (Fin.cases completed.completion.algebra.ground + (Fin.cases completed.completion.bases_ground (fun _ => completed.completion.caps_ground))) + refine ⟨stored, ground, coded.symm, (initial_iff _ hCore).2 ⟨completed.certificate, rfl⟩, + core, completed.certificate.unionData.fields, rfl, rfl, ?_, ?_, ?_⟩ + · change completed.completion.algebra.maps = _ + rw [completed.completion.algebra.maps_eq_sections, + completed.certificate.completion_union completed.completion] + rfl + · change completed.completion.algebra.bases = _ + unfold GroundCompressionAlgebra.bases + rw [completed.certificate.completion_union completed.completion] + rfl + · change completed.completion.algebra.caps stage.top = _ + unfold GroundCompressionAlgebra.caps + rw [completed.certificate.completion_union completed.completion] + rfl + +theorem exists_groundRecognizedCompletedCompressionCertificate + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Labels : ZFSet.{u}} (hLabels : Labels ∈ M.sets) : + ∃ z ∈ M.sets, Realize M.sets + (M.completedCompressionCertificateFormula pairing unions powers separation 0 1 2 3 4 5 6 7 8) + (extend z (extend ZFSet.omega (extend stage.carrier (extend stage.actors + (extend stage.order (extend stage.meetGraph (extend stage.action + (extend Labels (extend stage.top Fin.elim0))))))))) := by + obtain ⟨certificate⟩ := stage.exists_compressionCertificate + pairing unions powers separation collection infinite choice hLabels + obtain ⟨completed, _⟩ := certificate.exists_completedCertificate + pairing unions powers separation collection infinite hLabels + have ground := completed.code_ground pairing unions powers separation collection infinite hLabels + exact ⟨completed.code, ground, (stage.realize_completedCompressionCertificate_iff + pairing unions powers separation collection infinite hLabels ground).2 ⟨completed, rfl⟩⟩ + +end PartitionPilot.Forcing.GroundMainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedMapRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedMapRecognition.lean index 2e3c6d1e2e1615b62ad1fa464c342db4712f45f8..d5e477e085f1453746ac5c49fc3d8c4d2bf2fc66 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedMapRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompletedMapRecognition.lean @@ -1,91 +1,91 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula - -def mapFamilyApplicationSetFormula {n} (output I P Q bound family : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.mapFamilyApplicationEntryFormula 0 I.succ P.succ Q.succ bound.succ family.succ).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_mapFamilyApplicationSetFormula {n} - (output I P Q bound family : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) - (bound_eq : env bound = ZFSet.sUnion (ZFSet.sUnion (env family))) : - Realize M.sets (mapFamilyApplicationSetFormula output I P Q bound family) env ↔ - env output = mapFamilyApplicationGraph (env I) (env P) (env Q) (env family) := by - apply M.realize_exactBoundedSetFormula output _ env members - (M.mapFamilyApplicationGraph_mem pairing unions powers separation - (members I) (members P) (members Q) (members family)) - intro z - rw [BoundedFormula.truth_mapFamilyApplicationEntryFormula] - change (∃ i ∈ env I, ∃ x ∈ env P, ∃ y ∈ env Q, ∃ f ∈ env bound, - z = ZFSet.pair (ZFSet.pair i x) y ∧ ZFSet.pair i f ∈ env family ∧ ZFSet.pair x y ∈ f) ↔ _ - rw [bound_eq, mapFamilyApplicationGraph, ZFSet.mem_sep] - constructor - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨i, hi, x, hx, y, hy, _, _, rfl, _, _⟩ := witness - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩ - · exact And.right - -noncomputable def definable_mapFamilyApplication : GroundDefinableFunction M - (fun env : Fin 4 → ZFSet.{u} => mapFamilyApplicationGraph (env 0) (env 1) (env 2) (env 3)) := by - let aux := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (3 : Fin 4)) - refine aux.withAux (mapFamilyApplicationSetFormula 1 2 3 4 0 5) ?_ ?_ - · intro env members - exact M.mapFamilyApplicationGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) - · intro env members z hz - exact M.realize_mapFamilyApplicationSetFormula pairing unions powers separation - 1 2 3 4 0 5 _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl - -noncomputable def definable_completedMapFamily : GroundDefinableFunction M - (fun env : Fin 3 → ZFSet.{u} => M.indexedRelationSections (env 0) (env 1) (env 1) - (mapFamilyApplicationGraph (env 0) (env 1) (env 1) (env 2))) := by - let v : Fin 3 → GroundSetTerm M 3 := GroundSetTerm.var M - let flat := GroundSetTerm.app (M.definable_mapFamilyApplication pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 1) (Fin.cases (v 2) Fin.elim0)))) - let sections := GroundSetTerm.app (M.definable_indexedSections pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 1) (Fin.cases flat Fin.elim0)))) - exact sections.definition.congr (fun _ => rfl) - -noncomputable def completedMapFamilyFormula {n} (output I U family : Fin n) : SetFormula n := - SetFormula.reindex (Fin.cases output (Fin.cases I (Fin.cases U (Fin.cases family Fin.elim0)))) - (M.definable_completedMapFamily pairing unions powers separation).formula - -theorem realize_completedMapFamilyFormula {n} (output I U family : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.completedMapFamilyFormula pairing unions powers separation output I U family) env ↔ - env output = M.indexedRelationSections (env I) (env U) (env U) - (mapFamilyApplicationGraph (env I) (env U) (env U) (env family)) := by - let slots : Fin 3 → Fin n := Fin.cases I (Fin.cases U (Fin.cases family Fin.elim0)) - unfold completedMapFamilyFormula - rw [realize_reindex] - change Realize M.sets (M.definable_completedMapFamily pairing unions powers separation).formula - (fun j => env (extend output slots j)) ↔ _ - rw [map_extend] - exact (M.definable_completedMapFamily pairing unions powers separation).correct - (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula + +def mapFamilyApplicationSetFormula {n} (output I P Q bound family : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.mapFamilyApplicationEntryFormula 0 I.succ P.succ Q.succ bound.succ family.succ).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_mapFamilyApplicationSetFormula {n} + (output I P Q bound family : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) + (bound_eq : env bound = ZFSet.sUnion (ZFSet.sUnion (env family))) : + Realize M.sets (mapFamilyApplicationSetFormula output I P Q bound family) env ↔ + env output = mapFamilyApplicationGraph (env I) (env P) (env Q) (env family) := by + apply M.realize_exactBoundedSetFormula output _ env members + (M.mapFamilyApplicationGraph_mem pairing unions powers separation + (members I) (members P) (members Q) (members family)) + intro z + rw [BoundedFormula.truth_mapFamilyApplicationEntryFormula] + change (∃ i ∈ env I, ∃ x ∈ env P, ∃ y ∈ env Q, ∃ f ∈ env bound, + z = ZFSet.pair (ZFSet.pair i x) y ∧ ZFSet.pair i f ∈ env family ∧ ZFSet.pair x y ∈ f) ↔ _ + rw [bound_eq, mapFamilyApplicationGraph, ZFSet.mem_sep] + constructor + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨i, hi, x, hx, y, hy, _, _, rfl, _, _⟩ := witness + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩ + · exact And.right + +noncomputable def definable_mapFamilyApplication : GroundDefinableFunction M + (fun env : Fin 4 → ZFSet.{u} => mapFamilyApplicationGraph (env 0) (env 1) (env 2) (env 3)) := by + let aux := (M.definable_doubleUnion unions).reindex (fun _ : Fin 1 => (3 : Fin 4)) + refine aux.withAux (mapFamilyApplicationSetFormula 1 2 3 4 0 5) ?_ ?_ + · intro env members + exact M.mapFamilyApplicationGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) + · intro env members z hz + exact M.realize_mapFamilyApplicationSetFormula pairing unions powers separation + 1 2 3 4 0 5 _ (Fin.cases (aux.closed env members) (Fin.cases hz members)) rfl + +noncomputable def definable_completedMapFamily : GroundDefinableFunction M + (fun env : Fin 3 → ZFSet.{u} => M.indexedRelationSections (env 0) (env 1) (env 1) + (mapFamilyApplicationGraph (env 0) (env 1) (env 1) (env 2))) := by + let v : Fin 3 → GroundSetTerm M 3 := GroundSetTerm.var M + let flat := GroundSetTerm.app (M.definable_mapFamilyApplication pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 1) (Fin.cases (v 2) Fin.elim0)))) + let sections := GroundSetTerm.app (M.definable_indexedSections pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 1) (Fin.cases flat Fin.elim0)))) + exact sections.definition.congr (fun _ => rfl) + +noncomputable def completedMapFamilyFormula {n} (output I U family : Fin n) : SetFormula n := + SetFormula.reindex (Fin.cases output (Fin.cases I (Fin.cases U (Fin.cases family Fin.elim0)))) + (M.definable_completedMapFamily pairing unions powers separation).formula + +theorem realize_completedMapFamilyFormula {n} (output I U family : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.completedMapFamilyFormula pairing unions powers separation output I U family) env ↔ + env output = M.indexedRelationSections (env I) (env U) (env U) + (mapFamilyApplicationGraph (env I) (env U) (env U) (env family)) := by + let slots : Fin 3 → Fin n := Fin.cases I (Fin.cases U (Fin.cases family Fin.elim0)) + unfold completedMapFamilyFormula + rw [realize_reindex] + change Realize M.sets (M.definable_completedMapFamily pairing unions powers separation).formula + (fun j => env (extend output slots j)) ↔ _ + rw [map_extend] + exact (M.definable_completedMapFamily pairing unions powers separation).correct + (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionFiniteFieldGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionFiniteFieldGraphs.lean index f206f48a5442447cc80bba99cdd5f34dc765d258..ff0e0f96eda676880774c95613e8410ac9dae207 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionFiniteFieldGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionFiniteFieldGraphs.lean @@ -1,73 +1,73 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) - -noncomputable def prefixFiniteField (j : Fin 5) (n : Nat) : ZFSet.{u} := - Fin.cases (state.data.iterate M I Sources Reps G T (n + 1)).D - (Fin.cases (state.data.iterate M I Sources Reps G T (n + 1)).rD - (Fin.cases (state.data.iterate M I Sources Reps G T (n + 1)).μD - (Fin.cases (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) - (fun _ => heights.function.natValue (n + 1))))) j - -noncomputable def prefixTerminalField (j : Fin 5) : ZFSet.{u} := - Fin.cases (data.fields 0) (Fin.cases (data.fields 1) (Fin.cases (data.fields 2) - (Fin.cases births.birth (fun _ => heights.height)))) j - -theorem prefixTerminalField_ground (j : Fin 5) : state.prefixTerminalField data births heights j ∈ M.sets := - Fin.cases (data.ground 0) (Fin.cases (data.ground 1) (Fin.cases (data.ground 2) - (Fin.cases births.birth_ground (fun _ => heights.height_ground)))) j - -theorem exists_prefixFiniteGraphs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : - ∃ graphs : Fin 5 → ZFSet.{u}, (∀ j, graphs j ∈ M.sets) ∧ - (∀ j, FunctionGraphOn ZFSet.omega (graphs j)) ∧ - ∀ j n y, ZFSet.pair (natSetCode n) y ∈ graphs j ↔ - y = state.prefixFiniteField data births heights j n := by - have hOmega := M.omega_mem separation infinite - obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT - obtain ⟨Ps, hPs, pFunc, pEntries⟩ := M.exists_groundStateFieldFamily - pairing separation collection hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 0 - obtain ⟨Rs, hRs, rFunc, rEntries⟩ := M.exists_groundStateFieldFamily - pairing separation collection hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 1 - obtain ⟨Ms, hMs, mFunc, mEntries⟩ := M.exists_groundStateFieldFamily - pairing separation collection hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 2 - let sources : Fin 5 → ZFSet.{u} := Fin.cases Ps (Fin.cases Rs (Fin.cases Ms - (Fin.cases births.family (fun _ => heights.family)))) - have ground : ∀ j, sources j ∈ M.sets := Fin.cases hPs (Fin.cases hRs (Fin.cases hMs - (Fin.cases births.family_ground (fun _ => heights.family_ground)))) - have functions : ∀ j, FunctionGraphOn ZFSet.omega (sources j) := Fin.cases pFunc - (Fin.cases rFunc (Fin.cases mFunc (Fin.cases births.family_function (fun _ => heights.function)))) - refine ⟨fun j => naturalFamilyShift (sources j), - fun j => M.naturalFamilyShift_mem pairing unions powers separation infinite (ground j), - fun j => naturalFamilyShift_function (functions j), ?_⟩ - intro j n y - rw [naturalFamilyShift_entries] - exact Fin.cases (pEntries (n + 1) y) (Fin.cases (rEntries (n + 1) y) - (Fin.cases (mEntries (n + 1) y) (Fin.cases (births.family_entries (n + 1) y) - (fun _ => heights.function.natValue_entry_iff (n + 1) y)))) j - -end PartitionPilot.Forcing.GroundCompressionState - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) + +noncomputable def prefixFiniteField (j : Fin 5) (n : Nat) : ZFSet.{u} := + Fin.cases (state.data.iterate M I Sources Reps G T (n + 1)).D + (Fin.cases (state.data.iterate M I Sources Reps G T (n + 1)).rD + (Fin.cases (state.data.iterate M I Sources Reps G T (n + 1)).μD + (Fin.cases (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) + (fun _ => heights.function.natValue (n + 1))))) j + +noncomputable def prefixTerminalField (j : Fin 5) : ZFSet.{u} := + Fin.cases (data.fields 0) (Fin.cases (data.fields 1) (Fin.cases (data.fields 2) + (Fin.cases births.birth (fun _ => heights.height)))) j + +theorem prefixTerminalField_ground (j : Fin 5) : state.prefixTerminalField data births heights j ∈ M.sets := + Fin.cases (data.ground 0) (Fin.cases (data.ground 1) (Fin.cases (data.ground 2) + (Fin.cases births.birth_ground (fun _ => heights.height_ground)))) j + +theorem exists_prefixFiniteGraphs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : + ∃ graphs : Fin 5 → ZFSet.{u}, (∀ j, graphs j ∈ M.sets) ∧ + (∀ j, FunctionGraphOn ZFSet.omega (graphs j)) ∧ + ∀ j n y, ZFSet.pair (natSetCode n) y ∈ graphs j ↔ + y = state.prefixFiniteField data births heights j n := by + have hOmega := M.omega_mem separation infinite + obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT + obtain ⟨Ps, hPs, pFunc, pEntries⟩ := M.exists_groundStateFieldFamily + pairing separation collection hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 0 + obtain ⟨Rs, hRs, rFunc, rEntries⟩ := M.exists_groundStateFieldFamily + pairing separation collection hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 1 + obtain ⟨Ms, hMs, mFunc, mEntries⟩ := M.exists_groundStateFieldFamily + pairing separation collection hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 2 + let sources : Fin 5 → ZFSet.{u} := Fin.cases Ps (Fin.cases Rs (Fin.cases Ms + (Fin.cases births.family (fun _ => heights.family)))) + have ground : ∀ j, sources j ∈ M.sets := Fin.cases hPs (Fin.cases hRs (Fin.cases hMs + (Fin.cases births.family_ground (fun _ => heights.family_ground)))) + have functions : ∀ j, FunctionGraphOn ZFSet.omega (sources j) := Fin.cases pFunc + (Fin.cases rFunc (Fin.cases mFunc (Fin.cases births.family_function (fun _ => heights.function)))) + refine ⟨fun j => naturalFamilyShift (sources j), + fun j => M.naturalFamilyShift_mem pairing unions powers separation infinite (ground j), + fun j => naturalFamilyShift_function (functions j), ?_⟩ + intro j n y + rw [naturalFamilyShift_entries] + exact Fin.cases (pEntries (n + 1) y) (Fin.cases (rEntries (n + 1) y) + (Fin.cases (mEntries (n + 1) y) (Fin.cases (births.family_entries (n + 1) y) + (fun _ => heights.function.natValue_entry_iff (n + 1) y)))) j + +end PartitionPilot.Forcing.GroundCompressionState + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionHeightSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionHeightSteps.lean index 81cec5f5f137a9c3d07786c4f2ae1a0f8163301b..28ce2c6c4b53807c813bea253b01a112cd2834e0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionHeightSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionHeightSteps.lean @@ -1,883 +1,883 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchHeightGraphs -import OAI.SetTheory.PartitionPrinciple.Geometry.HeightColumnBoundLaws -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionHistory - -namespace OAI - - -namespace PartitionPilot.Forcing - -open Compression.RecursiveMaps -universe u - -noncomputable def lexHeightOrder (C D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, - z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ - (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ rD))) - (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) - -theorem mem_lexHeightOrder (C D rD z : ZFSet.{u}) : - z ∈ lexHeightOrder C D rD ↔ - ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, - z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ - (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · rintro ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 - ⟨ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩⟩, - c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ - -theorem pair_mem_lexHeightOrder (C D rD c q d v : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∈ lexHeightOrder C D rD ↔ - c ∈ C ∧ q ∈ D ∧ d ∈ C ∧ v ∈ D ∧ (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by - rw [mem_lexHeightOrder] - constructor - · rintro ⟨c', hc, q', hq, d', hd, v', hv, equal, lower⟩ - obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right - exact ⟨hc, hq, hd, hv, lower⟩ - · rintro ⟨hc, hq, hd, hv, lower⟩ - exact ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ - -theorem lexHeightOrder_code {C D rD : ZFSet.{u}} - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : - StrictLinearOrderCode (ZFSet.prod C D) (lexHeightOrder C D rD) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_, ?_, ?_⟩ - · intro x hx hxx - obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx - rcases ((pair_mem_lexHeightOrder C D rD c q c q).1 hxx).2.2.2.2 with less | same - · exact ZFSet.mem_irrefl c less - · exact target.irrefl q hq same.2 - · intro x y z hxy hyz - have xy := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hxy).1 - have yz := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hyz).1 - obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 xy.1 - obtain ⟨d, _, v, _, rfl⟩ := ZFSet.mem_prod.1 xy.2 - obtain ⟨b, hb, w, hw, rfl⟩ := ZFSet.mem_prod.1 yz.2 - have left := ((pair_mem_lexHeightOrder C D rD c q d v).1 hxy).2.2.2.2 - have right := ((pair_mem_lexHeightOrder C D rD d v b w).1 hyz).2.2.2.2 - apply (pair_mem_lexHeightOrder C D rD c q b w).2 - refine ⟨hc, hq, hb, hw, ?_⟩ - rcases left with lower | ⟨same, inside⟩ - · rcases right with lower' | ⟨same', _⟩ - · exact Or.inl (columns.2 b hb d lower' c lower) - · exact Or.inl (same' ▸ lower) - · rcases right with lower' | ⟨same', inside'⟩ - · exact Or.inl (same.symm ▸ lower') - · exact Or.inr ⟨same.trans same', target.trans q v w inside inside'⟩ - · intro x hx y hy - obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx - obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy - rcases ordinalSetProperty_mem_compare columns hc hd with lower | same | greater - · exact Or.inl ((pair_mem_lexHeightOrder C D rD c q d v).2 ⟨hc, hq, hd, hv, Or.inl lower⟩) - · subst d - rcases target.compare q hq v hv with lower | same | greater - · exact Or.inl ((pair_mem_lexHeightOrder C D rD c q c v).2 - ⟨hc, hq, hc, hv, Or.inr ⟨rfl, lower⟩⟩) - · exact Or.inr (Or.inl (congrArg (ZFSet.pair c) same)) - · exact Or.inr (Or.inr ((pair_mem_lexHeightOrder C D rD c v c q).2 - ⟨hc, hv, hc, hq, Or.inr ⟨rfl, greater⟩⟩)) - · exact Or.inr (Or.inr ((pair_mem_lexHeightOrder C D rD d v c q).2 - ⟨hd, hv, hc, hq, Or.inl greater⟩)) - -namespace StrictLexHeightCode - -noncomputable def value {L C D r h rD : ZFSet.{u}} - (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) : - {y : ZFSet.{u} // y ∈ ZFSet.prod C D} := - let function : FunctionGraphOn L h := ⟨ZFSet.prod C D, code.function⟩ - ⟨function.value x, (ZFSet.pair_mem_prod.1 (code.function.1 (function.value_entry x))).2⟩ - -theorem value_entry {L C D r h rD : ZFSet.{u}} - (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) : - ZFSet.pair x.val (code.value x).val ∈ h := - (show FunctionGraphOn L h from ⟨ZFSet.prod C D, code.function⟩).value_entry x - -theorem value_eq_of_entry {L C D r h rD y : ZFSet.{u}} - (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) - (entry : ZFSet.pair x.val y ∈ h) : (code.value x).val = y := - (show FunctionGraphOn L h from ⟨ZFSet.prod C D, code.function⟩).value_eq_of_entry x entry - -theorem value_pair_iff {L C D r h rD c q : ZFSet.{u}} - (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) : - (code.value x).val = ZFSet.pair c q ↔ ZFSet.pair x.val (ZFSet.pair c q) ∈ h := - ⟨fun equal => equal ▸ code.value_entry x, fun entry => code.value_eq_of_entry x entry⟩ - -noncomputable def toStrictHeight {L C D r μ h rD : ZFSet.{u}} - (code : StrictLexHeightCode L C D r h rD) (meet : MeetOrderCode L r μ) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : - StrictHeight meet.toMeetOrder (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder where - value := code.value - strict x y lower different := by - have xEntry := code.value_entry x - have yEntry := code.value_entry y - obtain ⟨c, hc, q, hq, ex⟩ := ZFSet.mem_prod.1 (code.value x).property - obtain ⟨d, hd, v, hv, ey⟩ := ZFSet.mem_prod.1 (code.value y).property - have xHeight : ZFSet.pair x.val (ZFSet.pair c q) ∈ h := ex ▸ xEntry - have yHeight : ZFSet.pair y.val (ZFSet.pair d v) ∈ h := ey ▸ yEntry - have lex := code.strict x.val x.property y.val y.property c q d v lower - (fun equal => different (Subtype.ext equal)) xHeight yHeight - change ZFSet.pair (code.value x).val (code.value y).val ∈ lexHeightOrder C D rD - rw [ex, ey] - exact (pair_mem_lexHeightOrder C D rD c q d v).2 ⟨hc, hq, hd, hv, lex⟩ - -theorem toStrictHeight_value_entry {L C D r μ h rD : ZFSet.{u}} - (code : StrictLexHeightCode L C D r h rD) (meet : MeetOrderCode L r μ) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) - (x : {a : ZFSet.{u} // a ∈ L}) : - ZFSet.pair x.val ((code.toStrictHeight meet columns target).value x).val ∈ h := - code.value_entry x - -end StrictLexHeightCode - -namespace BoundedFormula - -def lexHeightEntryFormula {n} (z C D rD : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ - exMem C (exMem D.succ (exMem C.succ.succ (exMem D.succ.succ.succ - (.conj (pairOfPairsFormula (lift z) 3 2 1 0) - (disj (.mem 3 1) (.conj (.equal 3 1) (pairMembershipFormula 2 0 (lift rD)))))))) - -theorem truth_lexHeightEntryFormula {n} (z C D rD : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (lexHeightEntryFormula z C D rD) env ↔ - ∃ c ∈ env C, ∃ q ∈ env D, ∃ d ∈ env C, ∃ v ∈ env D, - env z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ - (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ env rD)) := by - simp only [lexHeightEntryFormula, truth_exMem, Truth, truth_disj, - truth_pairOfPairsFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem lexHeightOrder_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {C D rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - lexHeightOrder C D rD ∈ M.sets := by - have carrier := M.prod_mem pairing unions powers separation hC hD - let params := extend C (extend D (extend rD Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.lexHeightEntryFormula 0 1 2 3) params - (Fin.cases hC (Fin.cases hD (Fin.cases hrD (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation carrier carrier) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.lexHeightEntryFormula 0 1 2 3) (extend z params)) - (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) = lexHeightOrder C D rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, lexHeightOrder, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_lexHeightEntryFormula 0 1 2 3 _) - exact equal ▸ selected - -end TransitiveGround - - - - - - -namespace BatchHeightEndpointCode - -variable {P rP μP I Qs rs μs As Es Fs Ss C D old rD Cs los his : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (e : BatchHeightEndpointCode d C D old rD Cs los his) - -noncomputable abbrev column (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := - (show FunctionGraphOn I Cs from ⟨C, e.columns⟩).value i -noncomputable abbrev low (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := - (show FunctionGraphOn I los from ⟨D, e.lows⟩).value i -noncomputable abbrev high (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := - (show FunctionGraphOn I his from ⟨D, e.highs⟩).value i - -theorem column_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (e.column i) ∈ Cs := - (show FunctionGraphOn I Cs from ⟨C, e.columns⟩).value_entry i -theorem low_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (e.low i) ∈ los := - (show FunctionGraphOn I los from ⟨D, e.lows⟩).value_entry i -theorem high_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (e.high i) ∈ his := - (show FunctionGraphOn I his from ⟨D, e.highs⟩).value_entry i - -end BatchHeightEndpointCode - -noncomputable def batchFreshHeightGraph (I Qs rs As Vs Hs Cs E C D : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ ZFSet.prod (indexedAttachmentFresh I Qs rs As) (ZFSet.prod C D)) - (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) - -noncomputable def batchHeightGraph (P I Qs rs As Vs Hs Cs E C D old : ZFSet.{u}) : ZFSet.{u} := - taggedHeightGraph P (indexedAttachmentFresh I Qs rs As) (ZFSet.prod C D) old - (batchFreshHeightGraph I Qs rs As Vs Hs Cs E C D) - -theorem batchHeightGraph_old_entry {P I Qs rs As Vs Hs Cs E C D old x h : ZFSet.{u}} - (hx : x ∈ P) : - ZFSet.pair x h ∈ batchHeightGraph P I Qs rs As Vs Hs Cs E C D old ↔ ZFSet.pair x h ∈ old := - taggedHeightGraph_old_entry hx - -namespace TemplateHeightFamilyInputs - -variable {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D rD old Cs los his E : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (t : TemplateHeightFamilyInputs d Vs vrs Hs) - (e : BatchHeightEndpointCode d C D old rD Cs los his) - (embeddings : FunctionGraphOn I E) - (maps : ∀ i, IntervalEmbeddingCode (t.ranges.value i) D (t.orders.value i) rD - (e.low i) (e.high i) (embeddings.value i)) - -include t e embeddings maps - -theorem batch_component_function : - ZFSet.IsFunc (indexedAttachmentDomain I Qs) (ZFSet.prod C D) - (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) := - t.componentHeightGraph_function e.columns embeddings (fun i => (maps i).injection.function) - (fun i _ member => mem_familyPointBound_of_entry (t.ranges.value_entry i) member) - -theorem batch_fresh_function : - ZFSet.IsFunc (indexedAttachmentFresh I Qs rs As) (ZFSet.prod C D) - (batchFreshHeightGraph I Qs rs As Vs Hs Cs E C D) := by - have full := t.batch_component_function e embeddings maps - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ - intro x hx - obtain ⟨y, entry, unique⟩ := full.2 x (indexedAttachmentFresh_subset I Qs rs As hx) - exact ⟨y, ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 - ⟨hx, (ZFSet.pair_mem_prod.1 (full.1 entry)).2⟩⟩, - fun z hz => unique z (ZFSet.mem_sep.1 hz).1⟩ - -theorem batch_height_function (oldCode : StrictLexHeightCode P C D rP old rD) : - ZFSet.IsFunc d.batchCarrier (ZFSet.prod C D) - (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) := - taggedHeightGraph_function oldCode.function (t.batch_fresh_function e embeddings maps) - -noncomputable def componentValue (i : {i : ZFSet.{u} // i ∈ I}) - (q : d.templates.Space i) : {h : ZFSet.{u} // h ∈ ZFSet.prod C D} := - let function : FunctionGraphOn (indexedAttachmentDomain I Qs) - (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) := - ⟨ZFSet.prod C D, t.batch_component_function e embeddings maps⟩ - let point : {x : ZFSet.{u} // x ∈ indexedAttachmentDomain I Qs} := - ⟨ZFSet.pair i.val q.val, (pair_mem_indexedAttachmentDomain I Qs i.val q.val).2 - ⟨i.property, d.space i, d.space_entry i, q.property⟩⟩ - ⟨function.value point, (ZFSet.pair_mem_prod.1 - ((t.batch_component_function e embeddings maps).1 (function.value_entry point))).2⟩ - -theorem componentValue_entry (i : {i : ZFSet.{u} // i ∈ I}) (q : d.templates.Space i) : - ZFSet.pair (ZFSet.pair i.val q.val) (t.componentValue e embeddings maps i q).val ∈ - componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D := - (show FunctionGraphOn (indexedAttachmentDomain I Qs) - (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) from - ⟨ZFSet.prod C D, t.batch_component_function e embeddings maps⟩).value_entry _ - -theorem componentValue_spec (i : {i : ZFSet.{u} // i ∈ I}) (q : d.templates.Space i) : - ∃ c ∈ C, ∃ z ∈ D, (t.componentValue e embeddings maps i q).val = ZFSet.pair c z ∧ - ZFSet.pair i.val c ∈ Cs ∧ ∃ a ∈ t.ranges.value i, - ZFSet.pair q.val a ∈ t.heights.value i ∧ ZFSet.pair a z ∈ embeddings.value i := by - obtain ⟨c, hc, z, hz, equal⟩ := ZFSet.mem_prod.1 (t.componentValue e embeddings maps i q).property - have entry := equal ▸ t.componentValue_entry e embeddings maps i q - obtain ⟨_, _, _, column, a, _, height, image⟩ := (t.componentHeightGraph_entry_iff embeddings i q.val c z).1 entry - exact ⟨c, hc, z, hz, equal, column, a, - (ZFSet.pair_mem_prod.1 ((t.function i).1 height)).2, height, image⟩ - -noncomputable def componentStrictHeight (columns : ordinalSetProperty C) - (target : StrictLinearOrderCode D rD) (i : {i : ZFSet.{u} // i ∈ I}) : - StrictHeight (d.templates.order i) (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder where - value := t.componentValue e embeddings maps i - strict x y lower different := by - obtain ⟨c, hc, q, hq, ex, colx, a, _, heightx, imagex⟩ := t.componentValue_spec e embeddings maps i x - obtain ⟨b, hb, z, hz, ey, coly, v, _, heighty, imagey⟩ := t.componentValue_spec e embeddings maps i y - have same : c = b := (show FunctionGraphOn I Cs from ⟨C, e.columns⟩).unique colx coly - have strict := t.strict i x.val y.val a v lower (fun equal => different (Subtype.ext equal)) heightx heighty - have imageStrict := ((maps i).order a v q z imagex imagey).1 strict - change ZFSet.pair (t.componentValue e embeddings maps i x).val - (t.componentValue e embeddings maps i y).val ∈ lexHeightOrder C D rD - rw [ex, ey] - exact (pair_mem_lexHeightOrder C D rD c q b z).2 ⟨hc, hq, hb, hz, Or.inr ⟨same, imageStrict⟩⟩ - -theorem component_lower (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) - (x : d.templates.Fresh) : - (lexHeightOrder_code columns target).toLinearHeightOrder.lt - ((oldCode.toStrictHeight d.oldOrder columns target).value (d.templates.base x.1)) - ((t.componentStrictHeight e embeddings maps columns target x.1).value x.2.val) := by - obtain ⟨c, hc, z, hz, value, column, a, _, _, image⟩ := - t.componentValue_spec e embeddings maps x.1 x.2.val - have base := e.base x.1 c (e.low x.1) column (e.low_entry x.1) - have baseValue := oldCode.value_eq_of_entry (d.templates.base x.1) base - have hlo := (ZFSet.pair_mem_prod.1 (e.lows.1 (e.low_entry x.1))).2 - have lower := ((maps x.1).inside a z image).1 - change ZFSet.pair (oldCode.value (d.templates.base x.1)).val - (t.componentValue e embeddings maps x.1 x.2.val).val ∈ lexHeightOrder C D rD - rw [baseValue, value] - exact (pair_mem_lexHeightOrder C D rD c (e.low x.1) c z).2 ⟨hc, hlo, hc, hz, Or.inr ⟨rfl, lower⟩⟩ - -theorem component_upper (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) - (x : d.templates.Fresh) : - (lexHeightOrder_code columns target).toLinearHeightOrder.lt - ((t.componentStrictHeight e embeddings maps columns target x.1).value x.2.val) - ((oldCode.toStrictHeight d.oldOrder columns target).value (d.templates.separator x.1)) := by - obtain ⟨c, hc, z, hz, value, column, a, _, _, image⟩ := - t.componentValue_spec e embeddings maps x.1 x.2.val - obtain ⟨b, hb, v, hv, sepValue⟩ := ZFSet.mem_prod.1 (oldCode.value (d.templates.separator x.1)).property - have sepEntry : ZFSet.pair (d.separator x.1) (ZFSet.pair b v) ∈ old := - sepValue ▸ oldCode.value_entry (d.templates.separator x.1) - have upper := e.interval_upper x.1 column (e.high_entry x.1) ((maps x.1).inside a z image).2 sepEntry - change ZFSet.pair (t.componentValue e embeddings maps x.1 x.2.val).val - (oldCode.value (d.templates.separator x.1)).val ∈ lexHeightOrder C D rD - rw [value, sepValue] - exact (pair_mem_lexHeightOrder C D rD c z b v).2 ⟨hc, hz, hb, hv, upper⟩ - -noncomputable def extendedHeight (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : - StrictHeight d.templates.extension (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder := - AttachmentHeight.extend d.templates (oldCode.toStrictHeight d.oldOrder columns target) - (t.componentStrictHeight e embeddings maps columns target) - (t.component_lower e embeddings maps oldCode columns target) - (t.component_upper e embeddings maps oldCode columns target) - -theorem encoded_height_entry (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) - (x : {p : ZFSet.{u} // p ∈ P} ⊕ d.templates.Fresh) : - ZFSet.pair (d.coding.encode x) ((t.extendedHeight e embeddings maps oldCode columns target).value x).val ∈ - batchHeightGraph P I Qs rs As Vs Hs Cs E C D old := by - cases x with - | inl x => - exact (batchHeightGraph_old_entry x.property).2 (oldCode.value_entry x) - | inr x => - apply (taggedHeightGraph_fresh_entry oldCode.function (t.batch_fresh_function e embeddings maps)).2 - exact ZFSet.mem_sep.2 ⟨t.componentValue_entry e embeddings maps x.1 x.2.val, - ZFSet.pair_mem_prod.2 ⟨d.freshCode_mem x, (t.componentValue e embeddings maps x.1 x.2.val).property⟩⟩ - -theorem batchHeightGraph_strictLex (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : - StrictLexHeightCode d.batchCarrier C D d.batchOrder - (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) rD := by - have function := t.batch_height_function e embeddings maps oldCode - refine ⟨function, ?_⟩ - intro x hx y hy c q b v lower different first second - obtain ⟨s, rfl⟩ := d.coding.encode_surjective x hx - obtain ⟨z, rfl⟩ := d.coding.encode_surjective y hy - have strict := (t.extendedHeight e embeddings maps oldCode columns target).strict s z - ((d.coding.le_encode s z).1 lower) (fun same => different (congrArg d.coding.encode same)) - have graph : FunctionGraphOn d.batchCarrier (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) := - ⟨ZFSet.prod C D, function⟩ - have eqs := graph.unique (t.encoded_height_entry e embeddings maps oldCode columns target s) first - have eqz := graph.unique (t.encoded_height_entry e embeddings maps oldCode columns target z) second - change ZFSet.pair ((t.extendedHeight e embeddings maps oldCode columns target).value s).val - ((t.extendedHeight e embeddings maps oldCode columns target).value z).val ∈ lexHeightOrder C D rD at strict - rw [eqs, eqz] at strict - exact ((pair_mem_lexHeightOrder C D rD c q b v).1 strict).2.2.2.2 - -theorem batchHeightGraph_bound_preserved (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) - {bound : ZFSet.{u}} (hBound : bound ∈ ZFSet.prod C D) - (oldBound : ∀ x ∈ P, ∀ h, ZFSet.pair x h ∈ old → h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD) : - ∀ x ∈ d.batchCarrier, ∀ h, - ZFSet.pair x h ∈ batchHeightGraph P I Qs rs As Vs Hs Cs E C D old → - h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD := by - let R := (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder - have oldWeak : ∀ x, R.Weak ((oldCode.toStrictHeight d.oldOrder columns target).value x) ⟨bound, hBound⟩ := by - intro x - rcases oldBound x.val x.property (oldCode.value x).val (oldCode.value_entry x) with same | less - · exact Or.inl (Subtype.ext same) - · exact Or.inr less - have preserved := AttachmentHeight.bound_preserved d.templates - (oldCode.toStrictHeight d.oldOrder columns target) - (t.componentStrictHeight e embeddings maps columns target) - (t.component_upper e embeddings maps oldCode columns target) ⟨bound, hBound⟩ oldWeak - intro x hx h entry - obtain ⟨s, rfl⟩ := d.coding.encode_surjective x hx - have graph : FunctionGraphOn d.batchCarrier (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) := - ⟨ZFSet.prod C D, t.batch_height_function e embeddings maps oldCode⟩ - have eqs := graph.unique (t.encoded_height_entry e embeddings maps oldCode columns target s) entry - rcases preserved s with same | less - · exact Or.inl (eqs.symm.trans (congrArg Subtype.val same)) - · apply Or.inr - change ZFSet.pair ((t.extendedHeight e embeddings maps oldCode columns target).value s).val bound ∈ - lexHeightOrder C D rD at less - exact eqs ▸ less - -end TemplateHeightFamilyInputs - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -theorem FunctionGraphOn.constant_value {I x : ZFSet.{u}} - (graph : FunctionGraphOn I (constantFamilyGraph I x)) (i : {i : ZFSet.{u} // i ∈ I}) : - graph.value i = x := - ((pair_mem_constantFamilyGraph I x _ _).1 (graph.value_entry i)).2 - -theorem StrictLexHeightCode.strict_entry {P C D r old rD x y a b : ZFSet.{u}} - (code : StrictLexHeightCode P C D r old rD) (lower : ZFSet.pair x y ∈ r) - (different : x ≠ y) (first : ZFSet.pair x a ∈ old) (second : ZFSet.pair y b ∈ old) : - ZFSet.pair a b ∈ lexHeightOrder C D rD := by - have hx := ZFSet.pair_mem_prod.1 (code.function.1 first) - have hy := ZFSet.pair_mem_prod.1 (code.function.1 second) - obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx.2 - obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy.2 - exact (pair_mem_lexHeightOrder C D rD c q d v).2 - ⟨hc, hq, hd, hv, code.strict x hx.1 y hy.1 c q d v lower different first second⟩ - -namespace AttachmentBatchInputs -variable {P rP μP I Qs rs μs As Es Fs Ss P0 r0 C D old rD : ZFSet.{u}} -variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - -theorem constantTemplateHeights - (spaces : ∀ i, d.space i = P0) (relations : ∀ i, d.rel i = r0) - (code : StrictLexHeightCode P0 C D r0 old rD) - (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : - TemplateHeightFamilyInputs d (constantFamilyGraph I (ZFSet.prod C D)) - (constantFamilyGraph I (lexHeightOrder C D rD)) (constantFamilyGraph I old) := by - have rangeGraph : FunctionGraphOn I (constantFamilyGraph I (ZFSet.prod C D)) := - ⟨_, constantFamilyGraph_function I (ZFSet.prod C D)⟩ - have orderGraph : FunctionGraphOn I (constantFamilyGraph I (lexHeightOrder C D rD)) := - ⟨_, constantFamilyGraph_function I (lexHeightOrder C D rD)⟩ - have heightGraph : FunctionGraphOn I (constantFamilyGraph I old) := - ⟨_, constantFamilyGraph_function I old⟩ - refine { - ranges := rangeGraph - orders := orderGraph - heights := heightGraph - linear := ?_ - function := ?_ - strict := ?_ - } - · intro i - simpa only [FunctionGraphOn.constant_value] using lexHeightOrder_code columns target - · intro i - simpa only [FunctionGraphOn.constant_value, spaces i] using code.function - · intro i x y a b lower different first second - simp only [FunctionGraphOn.constant_value] at first second ⊢ - exact code.strict_entry (relations i ▸ lower) different first second - -end AttachmentBatchInputs - - - - - - -noncomputable def fixedTopHeightGraph (P old b q : ZFSet.{u}) : ZFSet.{u} := - insert (ZFSet.pair P (ZFSet.pair b q)) old - -theorem pair_mem_fixedTopHeightGraph (P old b q x y : ZFSet.{u}) : - ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ - (x = P ∧ y = ZFSet.pair b q) ∨ ZFSet.pair x y ∈ old := by - rw [fixedTopHeightGraph, ZFSet.mem_insert_iff, ZFSet.pair_inj] - -theorem fixedTopHeightGraph_old_iff {P old b q x y : ZFSet.{u}} (hx : x ∈ P) : - ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ ZFSet.pair x y ∈ old := by - rw [pair_mem_fixedTopHeightGraph] - exact ⟨fun h => h.elim (fun eq => False.elim (ZFSet.mem_irrefl P (eq.1 ▸ hx))) id, - Or.inr⟩ - -theorem fixedTopHeightGraph_top_iff {P C D old b q y : ZFSet.{u}} - (function : ZFSet.IsFunc P (ZFSet.prod C D) old) : - ZFSet.pair P y ∈ fixedTopHeightGraph P old b q ↔ y = ZFSet.pair b q := by - rw [pair_mem_fixedTopHeightGraph] - exact ⟨fun h => h.elim And.right (fun h => False.elim - (ZFSet.mem_irrefl P (ZFSet.pair_mem_prod.1 (function.1 h)).1)), - fun h => Or.inl ⟨rfl, h⟩⟩ - -theorem fixedTopHeightGraph_function {P C D old b q : ZFSet.{u}} - (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) : - ZFSet.IsFunc (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) := by - refine ⟨?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_insert_iff.1 hz with rfl | hz - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert P P, ZFSet.pair_mem_prod.2 ⟨hb, hq⟩⟩ - · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem P hx, hy⟩ - · intro x hx - rcases ZFSet.mem_insert_iff.1 hx with rfl | hx - · refine ⟨ZFSet.pair b q, ZFSet.mem_insert _ _, ?_⟩ - intro y hy - exact (fixedTopHeightGraph_top_iff function).1 hy - · obtain ⟨y, entry, unique⟩ := function.2 x hx - refine ⟨y, (fixedTopHeightGraph_old_iff hx).2 entry, ?_⟩ - intro z hz - exact unique z ((fixedTopHeightGraph_old_iff hx).1 hz) - -theorem fixedTopHeightGraph_strict {P C D r old rD b q : ZFSet.{u}} - (code : StrictLexHeightCode P C D r old rD) (order : PartialOrderCode P r) - (hb : b ∈ C) (hq : q ∈ D) - (above : ∀ c ∈ heightColumns P C D old, c ∈ b) : - StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) - (fixedTopHeightGraph P old b q) rD := by - refine ⟨fixedTopHeightGraph_function code.function hb hq, ?_⟩ - intro x hx y hy c v d w lower different xEntry yEntry - rcases ZFSet.mem_union.1 lower with lower | top - · have bounds := ZFSet.pair_mem_prod.1 (order.relation lower) - exact code.strict x bounds.1 y bounds.2 c v d w lower different - ((fixedTopHeightGraph_old_iff bounds.1).1 xEntry) - ((fixedTopHeightGraph_old_iff bounds.2).1 yEntry) - · obtain ⟨_, yP⟩ := ZFSet.pair_mem_prod.1 top - have yEq : y = P := ZFSet.mem_singleton.1 yP - subst y - have hxOld : x ∈ P := (ZFSet.mem_insert_iff.1 hx).resolve_left different - have oldEntry := (fixedTopHeightGraph_old_iff hxOld).1 xEntry - have eq := ZFSet.pair_inj.1 ((fixedTopHeightGraph_top_iff code.function).1 yEntry) - rcases eq with ⟨rfl, rfl⟩ - exact Or.inl (above c (mem_heightColumns_of_entry code.function oldEntry)) - -theorem fixedTopHeightGraph_range {P C D old b q : ZFSet.{u}} - (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) : - relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) = - insert (ZFSet.pair b q) (relationImage P (ZFSet.prod C D) old) := by - apply ZFSet.ext - intro y - rw [mem_relationImage, ZFSet.mem_insert_iff, mem_relationImage] - constructor - · rintro ⟨hy, x, hx, entry⟩ - rcases (pair_mem_fixedTopHeightGraph P old b q x y).1 entry with ⟨_, eq⟩ | oldEntry - · exact Or.inl eq - · exact Or.inr ⟨hy, x, (ZFSet.pair_mem_prod.1 (function.1 oldEntry)).1, oldEntry⟩ - · rintro (rfl | ⟨hy, x, hx, entry⟩) - · exact ⟨ZFSet.pair_mem_prod.2 ⟨hb, hq⟩, P, ZFSet.mem_insert P P, - (pair_mem_fixedTopHeightGraph P old b q P _).2 (Or.inl ⟨rfl, rfl⟩)⟩ - · exact ⟨hy, x, ZFSet.mem_insert_of_mem P hx, - (pair_mem_fixedTopHeightGraph P old b q x y).2 (Or.inr entry)⟩ - -theorem fixedTopHeightGraph_old_lt_top {P C D old rD b q x y : ZFSet.{u}} - (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) - (above : ∀ c ∈ heightColumns P C D old, c ∈ b) (entry : ZFSet.pair x y ∈ old) : - ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD := by - have yShape := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨c, hc, v, hv, rfl⟩ := ZFSet.mem_prod.1 yShape - exact (pair_mem_lexHeightOrder C D rD c v b q).2 - ⟨hc, hv, hb, hq, Or.inl (above c (mem_heightColumns_of_entry function entry))⟩ - -theorem fixedTopHeightGraph_bound {P C D old rD b q x y : ZFSet.{u}} - (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) - (above : ∀ c ∈ heightColumns P C D old, c ∈ b) - (entry : ZFSet.pair x y ∈ fixedTopHeightGraph P old b q) : - y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD := by - rcases (pair_mem_fixedTopHeightGraph P old b q x y).1 entry with newEntry | oldEntry - · exact Or.inl newEntry.2 - · exact Or.inr (fixedTopHeightGraph_old_lt_top function hb hq above oldEntry) - - - - - - -theorem batchHeightGraph_columns - {P rP μP I Qs rs μs As Es Fs Ss Vs Hs C D old rD Cs los his E : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (e : BatchHeightEndpointCode d C D old rD Cs los his) - (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) - (x c q : ZFSet.{u}) - (entry : ZFSet.pair x (ZFSet.pair c q) ∈ - batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) : - c ∈ heightColumns P C D old := by - rcases ZFSet.mem_union.1 entry with oldEntry | freshEntry - · exact mem_heightColumns_of_entry oldFunction oldEntry - · obtain ⟨y, hy, h, _, equal, height⟩ := (ZFSet.mem_sep.1 freshEntry).2 - have sameHeight := (ZFSet.pair_inj.1 equal).2 - subst h - obtain ⟨i, hi, p, equalY, _⟩ := (mem_indexedAttachmentFresh I Qs rs As y).1 hy - subst y - have component := (ZFSet.mem_sep.1 height).1 - obtain ⟨_, _, _, Q, g, f, _, _, _, _, column, _⟩ := - (pair_mem_componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D i p c q).1 component - exact mem_heightColumns_of_entry oldFunction - (e.base ⟨i, hi⟩ c (e.low ⟨i, hi⟩) column (e.low_entry ⟨i, hi⟩)) - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem batchFreshHeightGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I Qs rs As Vs Hs Cs E C D : ZFSet.{u}} - (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hVs : Vs ∈ M.sets) (hHs : Hs ∈ M.sets) (hCs : Cs ∈ M.sets) (hE : E ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) : - batchFreshHeightGraph I Qs rs As Vs Hs Cs E C D ∈ M.sets := - M.injection_restriction_mem separation - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) - (M.prod_mem pairing unions powers separation hC hD) - (M.componentHeightGraph_mem pairing unions powers separation hI hQs - (M.familyPointBound_mem unions hVs) hHs hCs hE hC hD) - -theorem batchHeightGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P I Qs rs As Vs Hs Cs E C D old : ZFSet.{u}} - (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) - (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hVs : Vs ∈ M.sets) (hHs : Hs ∈ M.sets) - (hCs : Cs ∈ M.sets) (hE : E ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hOld : old ∈ M.sets) : batchHeightGraph P I Qs rs As Vs Hs Cs E C D old ∈ M.sets := - M.taggedHeightGraph_mem pairing unions powers separation hP - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) - (M.prod_mem pairing unions powers separation hC hD) hOld - (M.batchFreshHeightGraph_mem pairing unions powers separation - hI hQs hrs hAs hVs hHs hCs hE hC hD) - -theorem exists_batchHeight - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD c : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (t : TemplateHeightFamilyInputs d Vs vrs Hs) - (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) - (hVs : Vs ∈ M.sets) (hvrs : vrs ∈ M.sets) (hHs : Hs ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hOld : old ∈ M.sets) (hc : c ∈ M.sets) - (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) - (templateSmall : ∀ i, M.groundEmbeddable (t.ranges.value i) ZFSet.omega) : - ∃ height ∈ M.sets, - StrictLexHeightCode d.batchCarrier C D d.batchOrder height rD ∧ - (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ height ↔ ZFSet.pair p h ∈ old) ∧ - relationImage d.batchCarrier (ZFSet.prod C D) height ∈ M.sets ∧ - M.groundEmbeddable (relationImage d.batchCarrier (ZFSet.prod C D) height) ZFSet.omega ∧ - (∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ heightColumns P C D old) ∧ - ∀ bound ∈ ZFSet.prod C D, - (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ old → - h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD) → - ∀ x ∈ d.batchCarrier, ∀ h, ZFSet.pair x h ∈ height → - h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD := by - obtain ⟨Cs, hCs, los, hlos, his, hhis, endpoints⟩ := M.exists_batchHeightEndpoints - pairing unions powers separation choice d oldCode above - hI hP hC hD hAs hEs hSs hOld hrD - obtain ⟨E, hE, family, valid⟩ := M.exists_templateIntervalFamily - pairing unions powers separation collection infinite choice t endpoints - hI hVs hvrs hlos hhis hD hrD hc target coordinateInjection templateSmall - let embeddings : FunctionGraphOn I E := ⟨M.groundRelations (familyPointBound Vs) D, family⟩ - have maps : ∀ i, IntervalEmbeddingCode (t.ranges.value i) D (t.orders.value i) rD - (endpoints.low i) (endpoints.high i) (embeddings.value i) := by - intro i - exact valid i _ _ _ (endpoints.low_entry i) (endpoints.high_entry i) (embeddings.value_entry i) - let height := batchHeightGraph P I Qs rs As Vs Hs Cs E C D old - have hHeight : height ∈ M.sets := M.batchHeightGraph_mem pairing unions powers separation - hP hI hQs hrs hAs hVs hHs hCs hE hC hD hOld - have hL : d.batchCarrier ∈ M.sets := M.taggedExtension_mem pairing unions powers separation hP - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) - have columnLaw : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → - c ∈ heightColumns P C D old := batchHeightGraph_columns endpoints oldCode.function - obtain ⟨rangeMember, rangeSmall⟩ := M.countable_height_range_of_old_columns - pairing unions powers separation infinite choice hP hL hC hD hOld hHeight - oldSmall ⟨c, hc, coordinateInjection⟩ columnLaw - refine ⟨height, hHeight, - t.batchHeightGraph_strictLex endpoints embeddings maps oldCode columns target.toStrictLinearOrderCode, - (fun p hp h => batchHeightGraph_old_entry hp), rangeMember, rangeSmall, columnLaw, ?_⟩ - intro bound hBound oldBound - exact t.batchHeightGraph_bound_preserved endpoints embeddings maps oldCode columns - target.toStrictLinearOrderCode hBound oldBound - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) - -include pairing unions in -theorem fixedTopHeightGraph_mem {P old b q : ZFSet.{u}} - (hP : P ∈ M.sets) (hOld : old ∈ M.sets) (hb : b ∈ M.sets) (hq : q ∈ M.sets) : - fixedTopHeightGraph P old b q ∈ M.sets := - M.insert_mem pairing unions - (M.orderedPair_mem pairing hP (M.orderedPair_mem pairing hb hq)) hOld - -include choice in -theorem exists_fixedTopHeight - {P D r old rD : ZFSet.{u}} (hP : P ∈ M.sets) (hD : D ∈ M.sets) - (hOld : old ∈ M.sets) (order : PartialOrderCode P r) (nonempty : D.Nonempty) - (code : StrictLexHeightCode P - (M.groundOmegaOne pairing unions powers separation collection infinite) D r old rD) - (small : M.groundEmbeddable (relationImage P (ZFSet.prod - (M.groundOmegaOne pairing unions powers separation collection infinite) D) old) ZFSet.omega) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ b ∈ C, ∃ q ∈ D, ∃ height ∈ M.sets, - height = fixedTopHeightGraph P old b q ∧ - (∀ c ∈ heightColumns P C D old, c ∈ b) ∧ - b ∉ heightColumns P C D old ∧ - StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) height rD ∧ - (∀ x ∈ P, ∀ y, ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ old) ∧ - (∀ y, ZFSet.pair P y ∈ height ↔ y = ZFSet.pair b q) ∧ - relationImage (fixedTopCarrier P) (ZFSet.prod C D) height = - insert (ZFSet.pair b q) (relationImage P (ZFSet.prod C D) old) ∧ - relationImage (fixedTopCarrier P) (ZFSet.prod C D) height ∈ M.sets ∧ - M.groundEmbeddable (relationImage (fixedTopCarrier P) (ZFSet.prod C D) height) ZFSet.omega ∧ - (∀ x y, ZFSet.pair x y ∈ old → - ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) ∧ - (∀ x y, ZFSet.pair x y ∈ height → - y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) := by - let C := M.groundOmegaOne pairing unions powers separation collection infinite - change ∃ b ∈ C, ∃ q ∈ D, ∃ height ∈ M.sets, _ - have hC : C ∈ M.sets := - (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - have hK := M.heightColumns_mem pairing unions powers separation hP hC hD hOld - have smallK := M.heightColumns_countable pairing unions powers separation infinite choice - hP hC hD hOld small - have subset : heightColumns P C D old ⊆ C := - fun x hx => ((mem_relationImage _ C _ x).1 hx).1 - obtain ⟨b, hb, above⟩ := M.groundOmegaOne_countable_bound pairing unions powers separation - collection infinite choice hK subset smallK - obtain ⟨q, hq⟩ := nonempty - have hbM := M.transitive hC hb - have hqM := M.transitive hD hq - have hPair := M.orderedPair_mem pairing hbM hqM - have hRange := M.relationImage_mem separation hP - (M.prod_mem pairing unions powers separation hC hD) hOld - have rangeEq := fixedTopHeightGraph_range code.function hb hq - refine ⟨b, hb, q, hq, fixedTopHeightGraph P old b q, - M.fixedTopHeightGraph_mem pairing unions hP hOld hbM hqM, rfl, above, - fun h => ZFSet.mem_irrefl b (above b h), - fixedTopHeightGraph_strict code order hb hq above, - fun x hx y => fixedTopHeightGraph_old_iff hx, - fun y => fixedTopHeightGraph_top_iff code.function, rangeEq, ?_, ?_, ?_, ?_⟩ - · rw [rangeEq] - exact M.insert_mem pairing unions hPair hRange - · rw [rangeEq] - exact M.groundEmbeddable_insert pairing unions powers separation infinite hRange hPair small - · intro x y entry - exact fixedTopHeightGraph_old_lt_top code.function hb hq above entry - · intro x y entry - exact fixedTopHeightGraph_bound code.function hb hq above entry - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_batchHeight_of_countable_ranges - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD c : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (t : TemplateHeightFamilyInputs d Vs vrs Hs) - (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) - (hVs : Vs ∈ M.sets) (hvrs : vrs ∈ M.sets) (hHs : Hs ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hOld : old ∈ M.sets) (hc : c ∈ M.sets) - (oldCode : StrictLexHeightCode P C D rP old rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) - (templateSmall : ∀ i, M.groundEmbeddable - (relationImage (d.space i) (t.ranges.value i) (t.heights.value i)) ZFSet.omega) : - ∃ height ∈ M.sets, - StrictLexHeightCode d.batchCarrier C D d.batchOrder height rD ∧ - (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ height ↔ ZFSet.pair p h ∈ old) ∧ - relationImage d.batchCarrier (ZFSet.prod C D) height ∈ M.sets ∧ - M.groundEmbeddable (relationImage d.batchCarrier (ZFSet.prod C D) height) ZFSet.omega ∧ - (∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ heightColumns P C D old) ∧ - ∀ bound ∈ ZFSet.prod C D, - (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ old → - h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD) → - ∀ x ∈ d.batchCarrier, ∀ h, ZFSet.pair x h ∈ height → - h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD := by - obtain ⟨Rs, hRs, ors, hors, restricted, rangeEq, _⟩ := - M.exists_templateHeightRanges pairing unions powers separation t hI hQs hVs hvrs hHs - have small : ∀ i, M.groundEmbeddable (restricted.ranges.value i) ZFSet.omega := by - intro i - rw [rangeEq i] - exact templateSmall i - exact M.exists_batchHeight pairing unions powers separation collection infinite choice d restricted - hP hI hQs hrs hAs hEs hSs hRs hors hHs hC hD hrD hOld hc oldCode columns target above - coordinateInjection oldSmall small - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem exists_height_step - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {C D rD c original old : ZFSet.{u}} - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (hOriginal : original ∈ M.sets) (hOld : old ∈ M.sets) - (originalCode : StrictLexHeightCode P0 C D r0 original rD) - (oldCode : StrictLexHeightCode state.data.D C D state.data.rD old rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P0 (ZFSet.prod C D) original) ZFSet.omega) - (oldSmall : M.groundEmbeddable (relationImage state.data.D (ZFSet.prod C D) old) ZFSet.omega) : - ∃ height ∈ M.sets, - StrictLexHeightCode state.data.currentCarrier C D state.data.currentOrder height rD ∧ - (∀ x ∈ state.data.D, ∀ y, ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ old) ∧ - relationImage state.data.currentCarrier (ZFSet.prod C D) height ∈ M.sets ∧ - M.groundEmbeddable (relationImage state.data.currentCarrier (ZFSet.prod C D) height) ZFSet.omega ∧ - (∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ height → a ∈ heightColumns state.data.D C D old) ∧ - ∀ bound ∈ ZFSet.prod C D, - (∀ x ∈ state.data.D, ∀ y, ZFSet.pair x y ∈ old → - y = bound ∨ ZFSet.pair y bound ∈ lexHeightOrder C D rD) → - ∀ x ∈ state.data.currentCarrier, ∀ y, ZFSet.pair x y ∈ height → - y = bound ∨ ZFSet.pair y bound ∈ lexHeightOrder C D rD := by - have spaces : ∀ i, state.batch.space i = P0 := - fun i => ((constant.space_entry_iff _ _).1 (state.batch.space_entry i)).2 - have relations : ∀ i, state.batch.rel i = r0 := - fun i => ((constant.relation_entry_iff _ _).1 (state.batch.rel_entry i)).2 - let templates := state.batch.constantTemplateHeights spaces relations originalCode columns - target.toStrictLinearOrderCode - have templateSmall : ∀ i, M.groundEmbeddable - (relationImage (state.batch.space i) (templates.ranges.value i) (templates.heights.value i)) - ZFSet.omega := by - intro i - simpa only [FunctionGraphOn.constant_value, spaces i] using originalSmall - have hValues := M.prod_mem pairing unions powers separation hC hD - have hOrder := M.lexHeightOrder_mem pairing unions powers separation hC hD hrD - exact M.exists_batchHeight_of_countable_ranges pairing unions powers separation collection infinite choice - state.batch templates state.ground.carrier state.ground.indices state.ground.spaces state.ground.relations - state.ground.anchors state.ground.embeddings state.ground.separators - (M.constantFamilyGraph_mem pairing unions powers separation state.ground.indices hValues) - (M.constantFamilyGraph_mem pairing unions powers separation state.ground.indices hOrder) - (M.constantFamilyGraph_mem pairing unions powers separation state.ground.indices hOriginal) - hC hD hrD hOld hc oldCode columns target above coordinateInjection oldSmall templateSmall - -end PartitionPilot.Forcing.GroundCompressionState - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchHeightGraphs +import OAI.SetTheory.PartitionPrinciple.Geometry.HeightColumnBoundLaws +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionHistory + +namespace OAI + + +namespace PartitionPilot.Forcing + +open Compression.RecursiveMaps +universe u + +noncomputable def lexHeightOrder (C D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, + z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ + (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ rD))) + (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) + +theorem mem_lexHeightOrder (C D rD z : ZFSet.{u}) : + z ∈ lexHeightOrder C D rD ↔ + ∃ c ∈ C, ∃ q ∈ D, ∃ d ∈ C, ∃ v ∈ D, + z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ + (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · rintro ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 + ⟨ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩⟩, + c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ + +theorem pair_mem_lexHeightOrder (C D rD c q d v : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∈ lexHeightOrder C D rD ↔ + c ∈ C ∧ q ∈ D ∧ d ∈ C ∧ v ∈ D ∧ (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ rD)) := by + rw [mem_lexHeightOrder] + constructor + · rintro ⟨c', hc, q', hq, d', hd, v', hv, equal, lower⟩ + obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right + exact ⟨hc, hq, hd, hv, lower⟩ + · rintro ⟨hc, hq, hd, hv, lower⟩ + exact ⟨c, hc, q, hq, d, hd, v, hv, rfl, lower⟩ + +theorem lexHeightOrder_code {C D rD : ZFSet.{u}} + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : + StrictLinearOrderCode (ZFSet.prod C D) (lexHeightOrder C D rD) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_, ?_, ?_⟩ + · intro x hx hxx + obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx + rcases ((pair_mem_lexHeightOrder C D rD c q c q).1 hxx).2.2.2.2 with less | same + · exact ZFSet.mem_irrefl c less + · exact target.irrefl q hq same.2 + · intro x y z hxy hyz + have xy := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hxy).1 + have yz := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hyz).1 + obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 xy.1 + obtain ⟨d, _, v, _, rfl⟩ := ZFSet.mem_prod.1 xy.2 + obtain ⟨b, hb, w, hw, rfl⟩ := ZFSet.mem_prod.1 yz.2 + have left := ((pair_mem_lexHeightOrder C D rD c q d v).1 hxy).2.2.2.2 + have right := ((pair_mem_lexHeightOrder C D rD d v b w).1 hyz).2.2.2.2 + apply (pair_mem_lexHeightOrder C D rD c q b w).2 + refine ⟨hc, hq, hb, hw, ?_⟩ + rcases left with lower | ⟨same, inside⟩ + · rcases right with lower' | ⟨same', _⟩ + · exact Or.inl (columns.2 b hb d lower' c lower) + · exact Or.inl (same' ▸ lower) + · rcases right with lower' | ⟨same', inside'⟩ + · exact Or.inl (same.symm ▸ lower') + · exact Or.inr ⟨same.trans same', target.trans q v w inside inside'⟩ + · intro x hx y hy + obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx + obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy + rcases ordinalSetProperty_mem_compare columns hc hd with lower | same | greater + · exact Or.inl ((pair_mem_lexHeightOrder C D rD c q d v).2 ⟨hc, hq, hd, hv, Or.inl lower⟩) + · subst d + rcases target.compare q hq v hv with lower | same | greater + · exact Or.inl ((pair_mem_lexHeightOrder C D rD c q c v).2 + ⟨hc, hq, hc, hv, Or.inr ⟨rfl, lower⟩⟩) + · exact Or.inr (Or.inl (congrArg (ZFSet.pair c) same)) + · exact Or.inr (Or.inr ((pair_mem_lexHeightOrder C D rD c v c q).2 + ⟨hc, hv, hc, hq, Or.inr ⟨rfl, greater⟩⟩)) + · exact Or.inr (Or.inr ((pair_mem_lexHeightOrder C D rD d v c q).2 + ⟨hd, hv, hc, hq, Or.inl greater⟩)) + +namespace StrictLexHeightCode + +noncomputable def value {L C D r h rD : ZFSet.{u}} + (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) : + {y : ZFSet.{u} // y ∈ ZFSet.prod C D} := + let function : FunctionGraphOn L h := ⟨ZFSet.prod C D, code.function⟩ + ⟨function.value x, (ZFSet.pair_mem_prod.1 (code.function.1 (function.value_entry x))).2⟩ + +theorem value_entry {L C D r h rD : ZFSet.{u}} + (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) : + ZFSet.pair x.val (code.value x).val ∈ h := + (show FunctionGraphOn L h from ⟨ZFSet.prod C D, code.function⟩).value_entry x + +theorem value_eq_of_entry {L C D r h rD y : ZFSet.{u}} + (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) + (entry : ZFSet.pair x.val y ∈ h) : (code.value x).val = y := + (show FunctionGraphOn L h from ⟨ZFSet.prod C D, code.function⟩).value_eq_of_entry x entry + +theorem value_pair_iff {L C D r h rD c q : ZFSet.{u}} + (code : StrictLexHeightCode L C D r h rD) (x : {a : ZFSet.{u} // a ∈ L}) : + (code.value x).val = ZFSet.pair c q ↔ ZFSet.pair x.val (ZFSet.pair c q) ∈ h := + ⟨fun equal => equal ▸ code.value_entry x, fun entry => code.value_eq_of_entry x entry⟩ + +noncomputable def toStrictHeight {L C D r μ h rD : ZFSet.{u}} + (code : StrictLexHeightCode L C D r h rD) (meet : MeetOrderCode L r μ) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : + StrictHeight meet.toMeetOrder (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder where + value := code.value + strict x y lower different := by + have xEntry := code.value_entry x + have yEntry := code.value_entry y + obtain ⟨c, hc, q, hq, ex⟩ := ZFSet.mem_prod.1 (code.value x).property + obtain ⟨d, hd, v, hv, ey⟩ := ZFSet.mem_prod.1 (code.value y).property + have xHeight : ZFSet.pair x.val (ZFSet.pair c q) ∈ h := ex ▸ xEntry + have yHeight : ZFSet.pair y.val (ZFSet.pair d v) ∈ h := ey ▸ yEntry + have lex := code.strict x.val x.property y.val y.property c q d v lower + (fun equal => different (Subtype.ext equal)) xHeight yHeight + change ZFSet.pair (code.value x).val (code.value y).val ∈ lexHeightOrder C D rD + rw [ex, ey] + exact (pair_mem_lexHeightOrder C D rD c q d v).2 ⟨hc, hq, hd, hv, lex⟩ + +theorem toStrictHeight_value_entry {L C D r μ h rD : ZFSet.{u}} + (code : StrictLexHeightCode L C D r h rD) (meet : MeetOrderCode L r μ) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) + (x : {a : ZFSet.{u} // a ∈ L}) : + ZFSet.pair x.val ((code.toStrictHeight meet columns target).value x).val ∈ h := + code.value_entry x + +end StrictLexHeightCode + +namespace BoundedFormula + +def lexHeightEntryFormula {n} (z C D rD : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ + exMem C (exMem D.succ (exMem C.succ.succ (exMem D.succ.succ.succ + (.conj (pairOfPairsFormula (lift z) 3 2 1 0) + (disj (.mem 3 1) (.conj (.equal 3 1) (pairMembershipFormula 2 0 (lift rD)))))))) + +theorem truth_lexHeightEntryFormula {n} (z C D rD : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (lexHeightEntryFormula z C D rD) env ↔ + ∃ c ∈ env C, ∃ q ∈ env D, ∃ d ∈ env C, ∃ v ∈ env D, + env z = ZFSet.pair (ZFSet.pair c q) (ZFSet.pair d v) ∧ + (c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ env rD)) := by + simp only [lexHeightEntryFormula, truth_exMem, Truth, truth_disj, + truth_pairOfPairsFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem lexHeightOrder_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {C D rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + lexHeightOrder C D rD ∈ M.sets := by + have carrier := M.prod_mem pairing unions powers separation hC hD + let params := extend C (extend D (extend rD Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.lexHeightEntryFormula 0 1 2 3) params + (Fin.cases hC (Fin.cases hD (Fin.cases hrD (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation carrier carrier) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.lexHeightEntryFormula 0 1 2 3) (extend z params)) + (ZFSet.prod (ZFSet.prod C D) (ZFSet.prod C D)) = lexHeightOrder C D rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, lexHeightOrder, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_lexHeightEntryFormula 0 1 2 3 _) + exact equal ▸ selected + +end TransitiveGround + + + + + + +namespace BatchHeightEndpointCode + +variable {P rP μP I Qs rs μs As Es Fs Ss C D old rD Cs los his : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (e : BatchHeightEndpointCode d C D old rD Cs los his) + +noncomputable abbrev column (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := + (show FunctionGraphOn I Cs from ⟨C, e.columns⟩).value i +noncomputable abbrev low (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := + (show FunctionGraphOn I los from ⟨D, e.lows⟩).value i +noncomputable abbrev high (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := + (show FunctionGraphOn I his from ⟨D, e.highs⟩).value i + +theorem column_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (e.column i) ∈ Cs := + (show FunctionGraphOn I Cs from ⟨C, e.columns⟩).value_entry i +theorem low_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (e.low i) ∈ los := + (show FunctionGraphOn I los from ⟨D, e.lows⟩).value_entry i +theorem high_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (e.high i) ∈ his := + (show FunctionGraphOn I his from ⟨D, e.highs⟩).value_entry i + +end BatchHeightEndpointCode + +noncomputable def batchFreshHeightGraph (I Qs rs As Vs Hs Cs E C D : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ ZFSet.prod (indexedAttachmentFresh I Qs rs As) (ZFSet.prod C D)) + (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) + +noncomputable def batchHeightGraph (P I Qs rs As Vs Hs Cs E C D old : ZFSet.{u}) : ZFSet.{u} := + taggedHeightGraph P (indexedAttachmentFresh I Qs rs As) (ZFSet.prod C D) old + (batchFreshHeightGraph I Qs rs As Vs Hs Cs E C D) + +theorem batchHeightGraph_old_entry {P I Qs rs As Vs Hs Cs E C D old x h : ZFSet.{u}} + (hx : x ∈ P) : + ZFSet.pair x h ∈ batchHeightGraph P I Qs rs As Vs Hs Cs E C D old ↔ ZFSet.pair x h ∈ old := + taggedHeightGraph_old_entry hx + +namespace TemplateHeightFamilyInputs + +variable {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D rD old Cs los his E : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (t : TemplateHeightFamilyInputs d Vs vrs Hs) + (e : BatchHeightEndpointCode d C D old rD Cs los his) + (embeddings : FunctionGraphOn I E) + (maps : ∀ i, IntervalEmbeddingCode (t.ranges.value i) D (t.orders.value i) rD + (e.low i) (e.high i) (embeddings.value i)) + +include t e embeddings maps + +theorem batch_component_function : + ZFSet.IsFunc (indexedAttachmentDomain I Qs) (ZFSet.prod C D) + (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) := + t.componentHeightGraph_function e.columns embeddings (fun i => (maps i).injection.function) + (fun i _ member => mem_familyPointBound_of_entry (t.ranges.value_entry i) member) + +theorem batch_fresh_function : + ZFSet.IsFunc (indexedAttachmentFresh I Qs rs As) (ZFSet.prod C D) + (batchFreshHeightGraph I Qs rs As Vs Hs Cs E C D) := by + have full := t.batch_component_function e embeddings maps + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ + intro x hx + obtain ⟨y, entry, unique⟩ := full.2 x (indexedAttachmentFresh_subset I Qs rs As hx) + exact ⟨y, ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 + ⟨hx, (ZFSet.pair_mem_prod.1 (full.1 entry)).2⟩⟩, + fun z hz => unique z (ZFSet.mem_sep.1 hz).1⟩ + +theorem batch_height_function (oldCode : StrictLexHeightCode P C D rP old rD) : + ZFSet.IsFunc d.batchCarrier (ZFSet.prod C D) + (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) := + taggedHeightGraph_function oldCode.function (t.batch_fresh_function e embeddings maps) + +noncomputable def componentValue (i : {i : ZFSet.{u} // i ∈ I}) + (q : d.templates.Space i) : {h : ZFSet.{u} // h ∈ ZFSet.prod C D} := + let function : FunctionGraphOn (indexedAttachmentDomain I Qs) + (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) := + ⟨ZFSet.prod C D, t.batch_component_function e embeddings maps⟩ + let point : {x : ZFSet.{u} // x ∈ indexedAttachmentDomain I Qs} := + ⟨ZFSet.pair i.val q.val, (pair_mem_indexedAttachmentDomain I Qs i.val q.val).2 + ⟨i.property, d.space i, d.space_entry i, q.property⟩⟩ + ⟨function.value point, (ZFSet.pair_mem_prod.1 + ((t.batch_component_function e embeddings maps).1 (function.value_entry point))).2⟩ + +theorem componentValue_entry (i : {i : ZFSet.{u} // i ∈ I}) (q : d.templates.Space i) : + ZFSet.pair (ZFSet.pair i.val q.val) (t.componentValue e embeddings maps i q).val ∈ + componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D := + (show FunctionGraphOn (indexedAttachmentDomain I Qs) + (componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D) from + ⟨ZFSet.prod C D, t.batch_component_function e embeddings maps⟩).value_entry _ + +theorem componentValue_spec (i : {i : ZFSet.{u} // i ∈ I}) (q : d.templates.Space i) : + ∃ c ∈ C, ∃ z ∈ D, (t.componentValue e embeddings maps i q).val = ZFSet.pair c z ∧ + ZFSet.pair i.val c ∈ Cs ∧ ∃ a ∈ t.ranges.value i, + ZFSet.pair q.val a ∈ t.heights.value i ∧ ZFSet.pair a z ∈ embeddings.value i := by + obtain ⟨c, hc, z, hz, equal⟩ := ZFSet.mem_prod.1 (t.componentValue e embeddings maps i q).property + have entry := equal ▸ t.componentValue_entry e embeddings maps i q + obtain ⟨_, _, _, column, a, _, height, image⟩ := (t.componentHeightGraph_entry_iff embeddings i q.val c z).1 entry + exact ⟨c, hc, z, hz, equal, column, a, + (ZFSet.pair_mem_prod.1 ((t.function i).1 height)).2, height, image⟩ + +noncomputable def componentStrictHeight (columns : ordinalSetProperty C) + (target : StrictLinearOrderCode D rD) (i : {i : ZFSet.{u} // i ∈ I}) : + StrictHeight (d.templates.order i) (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder where + value := t.componentValue e embeddings maps i + strict x y lower different := by + obtain ⟨c, hc, q, hq, ex, colx, a, _, heightx, imagex⟩ := t.componentValue_spec e embeddings maps i x + obtain ⟨b, hb, z, hz, ey, coly, v, _, heighty, imagey⟩ := t.componentValue_spec e embeddings maps i y + have same : c = b := (show FunctionGraphOn I Cs from ⟨C, e.columns⟩).unique colx coly + have strict := t.strict i x.val y.val a v lower (fun equal => different (Subtype.ext equal)) heightx heighty + have imageStrict := ((maps i).order a v q z imagex imagey).1 strict + change ZFSet.pair (t.componentValue e embeddings maps i x).val + (t.componentValue e embeddings maps i y).val ∈ lexHeightOrder C D rD + rw [ex, ey] + exact (pair_mem_lexHeightOrder C D rD c q b z).2 ⟨hc, hq, hb, hz, Or.inr ⟨same, imageStrict⟩⟩ + +theorem component_lower (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) + (x : d.templates.Fresh) : + (lexHeightOrder_code columns target).toLinearHeightOrder.lt + ((oldCode.toStrictHeight d.oldOrder columns target).value (d.templates.base x.1)) + ((t.componentStrictHeight e embeddings maps columns target x.1).value x.2.val) := by + obtain ⟨c, hc, z, hz, value, column, a, _, _, image⟩ := + t.componentValue_spec e embeddings maps x.1 x.2.val + have base := e.base x.1 c (e.low x.1) column (e.low_entry x.1) + have baseValue := oldCode.value_eq_of_entry (d.templates.base x.1) base + have hlo := (ZFSet.pair_mem_prod.1 (e.lows.1 (e.low_entry x.1))).2 + have lower := ((maps x.1).inside a z image).1 + change ZFSet.pair (oldCode.value (d.templates.base x.1)).val + (t.componentValue e embeddings maps x.1 x.2.val).val ∈ lexHeightOrder C D rD + rw [baseValue, value] + exact (pair_mem_lexHeightOrder C D rD c (e.low x.1) c z).2 ⟨hc, hlo, hc, hz, Or.inr ⟨rfl, lower⟩⟩ + +theorem component_upper (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) + (x : d.templates.Fresh) : + (lexHeightOrder_code columns target).toLinearHeightOrder.lt + ((t.componentStrictHeight e embeddings maps columns target x.1).value x.2.val) + ((oldCode.toStrictHeight d.oldOrder columns target).value (d.templates.separator x.1)) := by + obtain ⟨c, hc, z, hz, value, column, a, _, _, image⟩ := + t.componentValue_spec e embeddings maps x.1 x.2.val + obtain ⟨b, hb, v, hv, sepValue⟩ := ZFSet.mem_prod.1 (oldCode.value (d.templates.separator x.1)).property + have sepEntry : ZFSet.pair (d.separator x.1) (ZFSet.pair b v) ∈ old := + sepValue ▸ oldCode.value_entry (d.templates.separator x.1) + have upper := e.interval_upper x.1 column (e.high_entry x.1) ((maps x.1).inside a z image).2 sepEntry + change ZFSet.pair (t.componentValue e embeddings maps x.1 x.2.val).val + (oldCode.value (d.templates.separator x.1)).val ∈ lexHeightOrder C D rD + rw [value, sepValue] + exact (pair_mem_lexHeightOrder C D rD c z b v).2 ⟨hc, hz, hb, hv, upper⟩ + +noncomputable def extendedHeight (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : + StrictHeight d.templates.extension (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder := + AttachmentHeight.extend d.templates (oldCode.toStrictHeight d.oldOrder columns target) + (t.componentStrictHeight e embeddings maps columns target) + (t.component_lower e embeddings maps oldCode columns target) + (t.component_upper e embeddings maps oldCode columns target) + +theorem encoded_height_entry (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) + (x : {p : ZFSet.{u} // p ∈ P} ⊕ d.templates.Fresh) : + ZFSet.pair (d.coding.encode x) ((t.extendedHeight e embeddings maps oldCode columns target).value x).val ∈ + batchHeightGraph P I Qs rs As Vs Hs Cs E C D old := by + cases x with + | inl x => + exact (batchHeightGraph_old_entry x.property).2 (oldCode.value_entry x) + | inr x => + apply (taggedHeightGraph_fresh_entry oldCode.function (t.batch_fresh_function e embeddings maps)).2 + exact ZFSet.mem_sep.2 ⟨t.componentValue_entry e embeddings maps x.1 x.2.val, + ZFSet.pair_mem_prod.2 ⟨d.freshCode_mem x, (t.componentValue e embeddings maps x.1 x.2.val).property⟩⟩ + +theorem batchHeightGraph_strictLex (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : + StrictLexHeightCode d.batchCarrier C D d.batchOrder + (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) rD := by + have function := t.batch_height_function e embeddings maps oldCode + refine ⟨function, ?_⟩ + intro x hx y hy c q b v lower different first second + obtain ⟨s, rfl⟩ := d.coding.encode_surjective x hx + obtain ⟨z, rfl⟩ := d.coding.encode_surjective y hy + have strict := (t.extendedHeight e embeddings maps oldCode columns target).strict s z + ((d.coding.le_encode s z).1 lower) (fun same => different (congrArg d.coding.encode same)) + have graph : FunctionGraphOn d.batchCarrier (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) := + ⟨ZFSet.prod C D, function⟩ + have eqs := graph.unique (t.encoded_height_entry e embeddings maps oldCode columns target s) first + have eqz := graph.unique (t.encoded_height_entry e embeddings maps oldCode columns target z) second + change ZFSet.pair ((t.extendedHeight e embeddings maps oldCode columns target).value s).val + ((t.extendedHeight e embeddings maps oldCode columns target).value z).val ∈ lexHeightOrder C D rD at strict + rw [eqs, eqz] at strict + exact ((pair_mem_lexHeightOrder C D rD c q b v).1 strict).2.2.2.2 + +theorem batchHeightGraph_bound_preserved (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) + {bound : ZFSet.{u}} (hBound : bound ∈ ZFSet.prod C D) + (oldBound : ∀ x ∈ P, ∀ h, ZFSet.pair x h ∈ old → h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD) : + ∀ x ∈ d.batchCarrier, ∀ h, + ZFSet.pair x h ∈ batchHeightGraph P I Qs rs As Vs Hs Cs E C D old → + h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD := by + let R := (lexHeightOrder_code columns target).toLinearHeightOrder.toHeightOrder + have oldWeak : ∀ x, R.Weak ((oldCode.toStrictHeight d.oldOrder columns target).value x) ⟨bound, hBound⟩ := by + intro x + rcases oldBound x.val x.property (oldCode.value x).val (oldCode.value_entry x) with same | less + · exact Or.inl (Subtype.ext same) + · exact Or.inr less + have preserved := AttachmentHeight.bound_preserved d.templates + (oldCode.toStrictHeight d.oldOrder columns target) + (t.componentStrictHeight e embeddings maps columns target) + (t.component_upper e embeddings maps oldCode columns target) ⟨bound, hBound⟩ oldWeak + intro x hx h entry + obtain ⟨s, rfl⟩ := d.coding.encode_surjective x hx + have graph : FunctionGraphOn d.batchCarrier (batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) := + ⟨ZFSet.prod C D, t.batch_height_function e embeddings maps oldCode⟩ + have eqs := graph.unique (t.encoded_height_entry e embeddings maps oldCode columns target s) entry + rcases preserved s with same | less + · exact Or.inl (eqs.symm.trans (congrArg Subtype.val same)) + · apply Or.inr + change ZFSet.pair ((t.extendedHeight e embeddings maps oldCode columns target).value s).val bound ∈ + lexHeightOrder C D rD at less + exact eqs ▸ less + +end TemplateHeightFamilyInputs + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +theorem FunctionGraphOn.constant_value {I x : ZFSet.{u}} + (graph : FunctionGraphOn I (constantFamilyGraph I x)) (i : {i : ZFSet.{u} // i ∈ I}) : + graph.value i = x := + ((pair_mem_constantFamilyGraph I x _ _).1 (graph.value_entry i)).2 + +theorem StrictLexHeightCode.strict_entry {P C D r old rD x y a b : ZFSet.{u}} + (code : StrictLexHeightCode P C D r old rD) (lower : ZFSet.pair x y ∈ r) + (different : x ≠ y) (first : ZFSet.pair x a ∈ old) (second : ZFSet.pair y b ∈ old) : + ZFSet.pair a b ∈ lexHeightOrder C D rD := by + have hx := ZFSet.pair_mem_prod.1 (code.function.1 first) + have hy := ZFSet.pair_mem_prod.1 (code.function.1 second) + obtain ⟨c, hc, q, hq, rfl⟩ := ZFSet.mem_prod.1 hx.2 + obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy.2 + exact (pair_mem_lexHeightOrder C D rD c q d v).2 + ⟨hc, hq, hd, hv, code.strict x hx.1 y hy.1 c q d v lower different first second⟩ + +namespace AttachmentBatchInputs +variable {P rP μP I Qs rs μs As Es Fs Ss P0 r0 C D old rD : ZFSet.{u}} +variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + +theorem constantTemplateHeights + (spaces : ∀ i, d.space i = P0) (relations : ∀ i, d.rel i = r0) + (code : StrictLexHeightCode P0 C D r0 old rD) + (columns : ordinalSetProperty C) (target : StrictLinearOrderCode D rD) : + TemplateHeightFamilyInputs d (constantFamilyGraph I (ZFSet.prod C D)) + (constantFamilyGraph I (lexHeightOrder C D rD)) (constantFamilyGraph I old) := by + have rangeGraph : FunctionGraphOn I (constantFamilyGraph I (ZFSet.prod C D)) := + ⟨_, constantFamilyGraph_function I (ZFSet.prod C D)⟩ + have orderGraph : FunctionGraphOn I (constantFamilyGraph I (lexHeightOrder C D rD)) := + ⟨_, constantFamilyGraph_function I (lexHeightOrder C D rD)⟩ + have heightGraph : FunctionGraphOn I (constantFamilyGraph I old) := + ⟨_, constantFamilyGraph_function I old⟩ + refine { + ranges := rangeGraph + orders := orderGraph + heights := heightGraph + linear := ?_ + function := ?_ + strict := ?_ + } + · intro i + simpa only [FunctionGraphOn.constant_value] using lexHeightOrder_code columns target + · intro i + simpa only [FunctionGraphOn.constant_value, spaces i] using code.function + · intro i x y a b lower different first second + simp only [FunctionGraphOn.constant_value] at first second ⊢ + exact code.strict_entry (relations i ▸ lower) different first second + +end AttachmentBatchInputs + + + + + + +noncomputable def fixedTopHeightGraph (P old b q : ZFSet.{u}) : ZFSet.{u} := + insert (ZFSet.pair P (ZFSet.pair b q)) old + +theorem pair_mem_fixedTopHeightGraph (P old b q x y : ZFSet.{u}) : + ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ + (x = P ∧ y = ZFSet.pair b q) ∨ ZFSet.pair x y ∈ old := by + rw [fixedTopHeightGraph, ZFSet.mem_insert_iff, ZFSet.pair_inj] + +theorem fixedTopHeightGraph_old_iff {P old b q x y : ZFSet.{u}} (hx : x ∈ P) : + ZFSet.pair x y ∈ fixedTopHeightGraph P old b q ↔ ZFSet.pair x y ∈ old := by + rw [pair_mem_fixedTopHeightGraph] + exact ⟨fun h => h.elim (fun eq => False.elim (ZFSet.mem_irrefl P (eq.1 ▸ hx))) id, + Or.inr⟩ + +theorem fixedTopHeightGraph_top_iff {P C D old b q y : ZFSet.{u}} + (function : ZFSet.IsFunc P (ZFSet.prod C D) old) : + ZFSet.pair P y ∈ fixedTopHeightGraph P old b q ↔ y = ZFSet.pair b q := by + rw [pair_mem_fixedTopHeightGraph] + exact ⟨fun h => h.elim And.right (fun h => False.elim + (ZFSet.mem_irrefl P (ZFSet.pair_mem_prod.1 (function.1 h)).1)), + fun h => Or.inl ⟨rfl, h⟩⟩ + +theorem fixedTopHeightGraph_function {P C D old b q : ZFSet.{u}} + (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) : + ZFSet.IsFunc (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) := by + refine ⟨?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_insert_iff.1 hz with rfl | hz + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert P P, ZFSet.pair_mem_prod.2 ⟨hb, hq⟩⟩ + · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem P hx, hy⟩ + · intro x hx + rcases ZFSet.mem_insert_iff.1 hx with rfl | hx + · refine ⟨ZFSet.pair b q, ZFSet.mem_insert _ _, ?_⟩ + intro y hy + exact (fixedTopHeightGraph_top_iff function).1 hy + · obtain ⟨y, entry, unique⟩ := function.2 x hx + refine ⟨y, (fixedTopHeightGraph_old_iff hx).2 entry, ?_⟩ + intro z hz + exact unique z ((fixedTopHeightGraph_old_iff hx).1 hz) + +theorem fixedTopHeightGraph_strict {P C D r old rD b q : ZFSet.{u}} + (code : StrictLexHeightCode P C D r old rD) (order : PartialOrderCode P r) + (hb : b ∈ C) (hq : q ∈ D) + (above : ∀ c ∈ heightColumns P C D old, c ∈ b) : + StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) + (fixedTopHeightGraph P old b q) rD := by + refine ⟨fixedTopHeightGraph_function code.function hb hq, ?_⟩ + intro x hx y hy c v d w lower different xEntry yEntry + rcases ZFSet.mem_union.1 lower with lower | top + · have bounds := ZFSet.pair_mem_prod.1 (order.relation lower) + exact code.strict x bounds.1 y bounds.2 c v d w lower different + ((fixedTopHeightGraph_old_iff bounds.1).1 xEntry) + ((fixedTopHeightGraph_old_iff bounds.2).1 yEntry) + · obtain ⟨_, yP⟩ := ZFSet.pair_mem_prod.1 top + have yEq : y = P := ZFSet.mem_singleton.1 yP + subst y + have hxOld : x ∈ P := (ZFSet.mem_insert_iff.1 hx).resolve_left different + have oldEntry := (fixedTopHeightGraph_old_iff hxOld).1 xEntry + have eq := ZFSet.pair_inj.1 ((fixedTopHeightGraph_top_iff code.function).1 yEntry) + rcases eq with ⟨rfl, rfl⟩ + exact Or.inl (above c (mem_heightColumns_of_entry code.function oldEntry)) + +theorem fixedTopHeightGraph_range {P C D old b q : ZFSet.{u}} + (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) : + relationImage (fixedTopCarrier P) (ZFSet.prod C D) (fixedTopHeightGraph P old b q) = + insert (ZFSet.pair b q) (relationImage P (ZFSet.prod C D) old) := by + apply ZFSet.ext + intro y + rw [mem_relationImage, ZFSet.mem_insert_iff, mem_relationImage] + constructor + · rintro ⟨hy, x, hx, entry⟩ + rcases (pair_mem_fixedTopHeightGraph P old b q x y).1 entry with ⟨_, eq⟩ | oldEntry + · exact Or.inl eq + · exact Or.inr ⟨hy, x, (ZFSet.pair_mem_prod.1 (function.1 oldEntry)).1, oldEntry⟩ + · rintro (rfl | ⟨hy, x, hx, entry⟩) + · exact ⟨ZFSet.pair_mem_prod.2 ⟨hb, hq⟩, P, ZFSet.mem_insert P P, + (pair_mem_fixedTopHeightGraph P old b q P _).2 (Or.inl ⟨rfl, rfl⟩)⟩ + · exact ⟨hy, x, ZFSet.mem_insert_of_mem P hx, + (pair_mem_fixedTopHeightGraph P old b q x y).2 (Or.inr entry)⟩ + +theorem fixedTopHeightGraph_old_lt_top {P C D old rD b q x y : ZFSet.{u}} + (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) + (above : ∀ c ∈ heightColumns P C D old, c ∈ b) (entry : ZFSet.pair x y ∈ old) : + ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD := by + have yShape := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨c, hc, v, hv, rfl⟩ := ZFSet.mem_prod.1 yShape + exact (pair_mem_lexHeightOrder C D rD c v b q).2 + ⟨hc, hv, hb, hq, Or.inl (above c (mem_heightColumns_of_entry function entry))⟩ + +theorem fixedTopHeightGraph_bound {P C D old rD b q x y : ZFSet.{u}} + (function : ZFSet.IsFunc P (ZFSet.prod C D) old) (hb : b ∈ C) (hq : q ∈ D) + (above : ∀ c ∈ heightColumns P C D old, c ∈ b) + (entry : ZFSet.pair x y ∈ fixedTopHeightGraph P old b q) : + y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD := by + rcases (pair_mem_fixedTopHeightGraph P old b q x y).1 entry with newEntry | oldEntry + · exact Or.inl newEntry.2 + · exact Or.inr (fixedTopHeightGraph_old_lt_top function hb hq above oldEntry) + + + + + + +theorem batchHeightGraph_columns + {P rP μP I Qs rs μs As Es Fs Ss Vs Hs C D old rD Cs los his E : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (e : BatchHeightEndpointCode d C D old rD Cs los his) + (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) + (x c q : ZFSet.{u}) + (entry : ZFSet.pair x (ZFSet.pair c q) ∈ + batchHeightGraph P I Qs rs As Vs Hs Cs E C D old) : + c ∈ heightColumns P C D old := by + rcases ZFSet.mem_union.1 entry with oldEntry | freshEntry + · exact mem_heightColumns_of_entry oldFunction oldEntry + · obtain ⟨y, hy, h, _, equal, height⟩ := (ZFSet.mem_sep.1 freshEntry).2 + have sameHeight := (ZFSet.pair_inj.1 equal).2 + subst h + obtain ⟨i, hi, p, equalY, _⟩ := (mem_indexedAttachmentFresh I Qs rs As y).1 hy + subst y + have component := (ZFSet.mem_sep.1 height).1 + obtain ⟨_, _, _, Q, g, f, _, _, _, _, column, _⟩ := + (pair_mem_componentHeightGraph I Qs (familyPointBound Vs) Hs Cs E C D i p c q).1 component + exact mem_heightColumns_of_entry oldFunction + (e.base ⟨i, hi⟩ c (e.low ⟨i, hi⟩) column (e.low_entry ⟨i, hi⟩)) + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem batchFreshHeightGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I Qs rs As Vs Hs Cs E C D : ZFSet.{u}} + (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hVs : Vs ∈ M.sets) (hHs : Hs ∈ M.sets) (hCs : Cs ∈ M.sets) (hE : E ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) : + batchFreshHeightGraph I Qs rs As Vs Hs Cs E C D ∈ M.sets := + M.injection_restriction_mem separation + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) + (M.prod_mem pairing unions powers separation hC hD) + (M.componentHeightGraph_mem pairing unions powers separation hI hQs + (M.familyPointBound_mem unions hVs) hHs hCs hE hC hD) + +theorem batchHeightGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P I Qs rs As Vs Hs Cs E C D old : ZFSet.{u}} + (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) + (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hVs : Vs ∈ M.sets) (hHs : Hs ∈ M.sets) + (hCs : Cs ∈ M.sets) (hE : E ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hOld : old ∈ M.sets) : batchHeightGraph P I Qs rs As Vs Hs Cs E C D old ∈ M.sets := + M.taggedHeightGraph_mem pairing unions powers separation hP + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) + (M.prod_mem pairing unions powers separation hC hD) hOld + (M.batchFreshHeightGraph_mem pairing unions powers separation + hI hQs hrs hAs hVs hHs hCs hE hC hD) + +theorem exists_batchHeight + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD c : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (t : TemplateHeightFamilyInputs d Vs vrs Hs) + (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) + (hVs : Vs ∈ M.sets) (hvrs : vrs ∈ M.sets) (hHs : Hs ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hOld : old ∈ M.sets) (hc : c ∈ M.sets) + (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) + (templateSmall : ∀ i, M.groundEmbeddable (t.ranges.value i) ZFSet.omega) : + ∃ height ∈ M.sets, + StrictLexHeightCode d.batchCarrier C D d.batchOrder height rD ∧ + (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ height ↔ ZFSet.pair p h ∈ old) ∧ + relationImage d.batchCarrier (ZFSet.prod C D) height ∈ M.sets ∧ + M.groundEmbeddable (relationImage d.batchCarrier (ZFSet.prod C D) height) ZFSet.omega ∧ + (∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ heightColumns P C D old) ∧ + ∀ bound ∈ ZFSet.prod C D, + (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ old → + h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD) → + ∀ x ∈ d.batchCarrier, ∀ h, ZFSet.pair x h ∈ height → + h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD := by + obtain ⟨Cs, hCs, los, hlos, his, hhis, endpoints⟩ := M.exists_batchHeightEndpoints + pairing unions powers separation choice d oldCode above + hI hP hC hD hAs hEs hSs hOld hrD + obtain ⟨E, hE, family, valid⟩ := M.exists_templateIntervalFamily + pairing unions powers separation collection infinite choice t endpoints + hI hVs hvrs hlos hhis hD hrD hc target coordinateInjection templateSmall + let embeddings : FunctionGraphOn I E := ⟨M.groundRelations (familyPointBound Vs) D, family⟩ + have maps : ∀ i, IntervalEmbeddingCode (t.ranges.value i) D (t.orders.value i) rD + (endpoints.low i) (endpoints.high i) (embeddings.value i) := by + intro i + exact valid i _ _ _ (endpoints.low_entry i) (endpoints.high_entry i) (embeddings.value_entry i) + let height := batchHeightGraph P I Qs rs As Vs Hs Cs E C D old + have hHeight : height ∈ M.sets := M.batchHeightGraph_mem pairing unions powers separation + hP hI hQs hrs hAs hVs hHs hCs hE hC hD hOld + have hL : d.batchCarrier ∈ M.sets := M.taggedExtension_mem pairing unions powers separation hP + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) + have columnLaw : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → + c ∈ heightColumns P C D old := batchHeightGraph_columns endpoints oldCode.function + obtain ⟨rangeMember, rangeSmall⟩ := M.countable_height_range_of_old_columns + pairing unions powers separation infinite choice hP hL hC hD hOld hHeight + oldSmall ⟨c, hc, coordinateInjection⟩ columnLaw + refine ⟨height, hHeight, + t.batchHeightGraph_strictLex endpoints embeddings maps oldCode columns target.toStrictLinearOrderCode, + (fun p hp h => batchHeightGraph_old_entry hp), rangeMember, rangeSmall, columnLaw, ?_⟩ + intro bound hBound oldBound + exact t.batchHeightGraph_bound_preserved endpoints embeddings maps oldCode columns + target.toStrictLinearOrderCode hBound oldBound + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) + +include pairing unions in +theorem fixedTopHeightGraph_mem {P old b q : ZFSet.{u}} + (hP : P ∈ M.sets) (hOld : old ∈ M.sets) (hb : b ∈ M.sets) (hq : q ∈ M.sets) : + fixedTopHeightGraph P old b q ∈ M.sets := + M.insert_mem pairing unions + (M.orderedPair_mem pairing hP (M.orderedPair_mem pairing hb hq)) hOld + +include choice in +theorem exists_fixedTopHeight + {P D r old rD : ZFSet.{u}} (hP : P ∈ M.sets) (hD : D ∈ M.sets) + (hOld : old ∈ M.sets) (order : PartialOrderCode P r) (nonempty : D.Nonempty) + (code : StrictLexHeightCode P + (M.groundOmegaOne pairing unions powers separation collection infinite) D r old rD) + (small : M.groundEmbeddable (relationImage P (ZFSet.prod + (M.groundOmegaOne pairing unions powers separation collection infinite) D) old) ZFSet.omega) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ b ∈ C, ∃ q ∈ D, ∃ height ∈ M.sets, + height = fixedTopHeightGraph P old b q ∧ + (∀ c ∈ heightColumns P C D old, c ∈ b) ∧ + b ∉ heightColumns P C D old ∧ + StrictLexHeightCode (fixedTopCarrier P) C D (fixedTopOrder P r) height rD ∧ + (∀ x ∈ P, ∀ y, ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ old) ∧ + (∀ y, ZFSet.pair P y ∈ height ↔ y = ZFSet.pair b q) ∧ + relationImage (fixedTopCarrier P) (ZFSet.prod C D) height = + insert (ZFSet.pair b q) (relationImage P (ZFSet.prod C D) old) ∧ + relationImage (fixedTopCarrier P) (ZFSet.prod C D) height ∈ M.sets ∧ + M.groundEmbeddable (relationImage (fixedTopCarrier P) (ZFSet.prod C D) height) ZFSet.omega ∧ + (∀ x y, ZFSet.pair x y ∈ old → + ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) ∧ + (∀ x y, ZFSet.pair x y ∈ height → + y = ZFSet.pair b q ∨ ZFSet.pair y (ZFSet.pair b q) ∈ lexHeightOrder C D rD) := by + let C := M.groundOmegaOne pairing unions powers separation collection infinite + change ∃ b ∈ C, ∃ q ∈ D, ∃ height ∈ M.sets, _ + have hC : C ∈ M.sets := + (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + have hK := M.heightColumns_mem pairing unions powers separation hP hC hD hOld + have smallK := M.heightColumns_countable pairing unions powers separation infinite choice + hP hC hD hOld small + have subset : heightColumns P C D old ⊆ C := + fun x hx => ((mem_relationImage _ C _ x).1 hx).1 + obtain ⟨b, hb, above⟩ := M.groundOmegaOne_countable_bound pairing unions powers separation + collection infinite choice hK subset smallK + obtain ⟨q, hq⟩ := nonempty + have hbM := M.transitive hC hb + have hqM := M.transitive hD hq + have hPair := M.orderedPair_mem pairing hbM hqM + have hRange := M.relationImage_mem separation hP + (M.prod_mem pairing unions powers separation hC hD) hOld + have rangeEq := fixedTopHeightGraph_range code.function hb hq + refine ⟨b, hb, q, hq, fixedTopHeightGraph P old b q, + M.fixedTopHeightGraph_mem pairing unions hP hOld hbM hqM, rfl, above, + fun h => ZFSet.mem_irrefl b (above b h), + fixedTopHeightGraph_strict code order hb hq above, + fun x hx y => fixedTopHeightGraph_old_iff hx, + fun y => fixedTopHeightGraph_top_iff code.function, rangeEq, ?_, ?_, ?_, ?_⟩ + · rw [rangeEq] + exact M.insert_mem pairing unions hPair hRange + · rw [rangeEq] + exact M.groundEmbeddable_insert pairing unions powers separation infinite hRange hPair small + · intro x y entry + exact fixedTopHeightGraph_old_lt_top code.function hb hq above entry + · intro x y entry + exact fixedTopHeightGraph_bound code.function hb hq above entry + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_batchHeight_of_countable_ranges + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD c : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (t : TemplateHeightFamilyInputs d Vs vrs Hs) + (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) + (hVs : Vs ∈ M.sets) (hvrs : vrs ∈ M.sets) (hHs : Hs ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hOld : old ∈ M.sets) (hc : c ∈ M.sets) + (oldCode : StrictLexHeightCode P C D rP old rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) + (templateSmall : ∀ i, M.groundEmbeddable + (relationImage (d.space i) (t.ranges.value i) (t.heights.value i)) ZFSet.omega) : + ∃ height ∈ M.sets, + StrictLexHeightCode d.batchCarrier C D d.batchOrder height rD ∧ + (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ height ↔ ZFSet.pair p h ∈ old) ∧ + relationImage d.batchCarrier (ZFSet.prod C D) height ∈ M.sets ∧ + M.groundEmbeddable (relationImage d.batchCarrier (ZFSet.prod C D) height) ZFSet.omega ∧ + (∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ heightColumns P C D old) ∧ + ∀ bound ∈ ZFSet.prod C D, + (∀ p ∈ P, ∀ h, ZFSet.pair p h ∈ old → + h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD) → + ∀ x ∈ d.batchCarrier, ∀ h, ZFSet.pair x h ∈ height → + h = bound ∨ ZFSet.pair h bound ∈ lexHeightOrder C D rD := by + obtain ⟨Rs, hRs, ors, hors, restricted, rangeEq, _⟩ := + M.exists_templateHeightRanges pairing unions powers separation t hI hQs hVs hvrs hHs + have small : ∀ i, M.groundEmbeddable (restricted.ranges.value i) ZFSet.omega := by + intro i + rw [rangeEq i] + exact templateSmall i + exact M.exists_batchHeight pairing unions powers separation collection infinite choice d restricted + hP hI hQs hrs hAs hEs hSs hRs hors hHs hC hD hrD hOld hc oldCode columns target above + coordinateInjection oldSmall small + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem exists_height_step + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {C D rD c original old : ZFSet.{u}} + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (hOriginal : original ∈ M.sets) (hOld : old ∈ M.sets) + (originalCode : StrictLexHeightCode P0 C D r0 original rD) + (oldCode : StrictLexHeightCode state.data.D C D state.data.rD old rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P0 (ZFSet.prod C D) original) ZFSet.omega) + (oldSmall : M.groundEmbeddable (relationImage state.data.D (ZFSet.prod C D) old) ZFSet.omega) : + ∃ height ∈ M.sets, + StrictLexHeightCode state.data.currentCarrier C D state.data.currentOrder height rD ∧ + (∀ x ∈ state.data.D, ∀ y, ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ old) ∧ + relationImage state.data.currentCarrier (ZFSet.prod C D) height ∈ M.sets ∧ + M.groundEmbeddable (relationImage state.data.currentCarrier (ZFSet.prod C D) height) ZFSet.omega ∧ + (∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ height → a ∈ heightColumns state.data.D C D old) ∧ + ∀ bound ∈ ZFSet.prod C D, + (∀ x ∈ state.data.D, ∀ y, ZFSet.pair x y ∈ old → + y = bound ∨ ZFSet.pair y bound ∈ lexHeightOrder C D rD) → + ∀ x ∈ state.data.currentCarrier, ∀ y, ZFSet.pair x y ∈ height → + y = bound ∨ ZFSet.pair y bound ∈ lexHeightOrder C D rD := by + have spaces : ∀ i, state.batch.space i = P0 := + fun i => ((constant.space_entry_iff _ _).1 (state.batch.space_entry i)).2 + have relations : ∀ i, state.batch.rel i = r0 := + fun i => ((constant.relation_entry_iff _ _).1 (state.batch.rel_entry i)).2 + let templates := state.batch.constantTemplateHeights spaces relations originalCode columns + target.toStrictLinearOrderCode + have templateSmall : ∀ i, M.groundEmbeddable + (relationImage (state.batch.space i) (templates.ranges.value i) (templates.heights.value i)) + ZFSet.omega := by + intro i + simpa only [FunctionGraphOn.constant_value, spaces i] using originalSmall + have hValues := M.prod_mem pairing unions powers separation hC hD + have hOrder := M.lexHeightOrder_mem pairing unions powers separation hC hD hrD + exact M.exists_batchHeight_of_countable_ranges pairing unions powers separation collection infinite choice + state.batch templates state.ground.carrier state.ground.indices state.ground.spaces state.ground.relations + state.ground.anchors state.ground.embeddings state.ground.separators + (M.constantFamilyGraph_mem pairing unions powers separation state.ground.indices hValues) + (M.constantFamilyGraph_mem pairing unions powers separation state.ground.indices hOrder) + (M.constantFamilyGraph_mem pairing unions powers separation state.ground.indices hOriginal) + hC hD hrD hOld hc oldCode columns target above coordinateInjection oldSmall templateSmall + +end PartitionPilot.Forcing.GroundCompressionState + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionMarkingRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionMarkingRecognition.lean index 5ac062e18814fde70046b63de285c8f15528bb02..81e201c3543c3fbe4f17723e3fe8b202ea27c2f9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionMarkingRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionMarkingRecognition.lean @@ -1,114 +1,114 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -noncomputable def definable_compressionBases : GroundDefinableFunction M - (fun env : Fin 4 → ZFSet.{u} => familyEvaluationGraph - (env 0) (env 1) (env 1) (⋃₀ ⋃₀ env 2) (env 2) (env 3)) := by - let v : Fin 4 → GroundSetTerm M 4 := GroundSetTerm.var M - let bound := GroundSetTerm.app (M.definable_doubleUnion unions) - (fun _ : Fin 1 => v 2) - let evaluated := GroundSetTerm.app (M.definable_familyEvaluation pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 1) - (Fin.cases bound (Fin.cases (v 2) (Fin.cases (v 3) Fin.elim0)))))) - exact evaluated.definition.congr (fun _ => rfl) - -noncomputable def definable_compressionCaps : GroundDefinableFunction M - (fun env : Fin 4 → ZFSet.{u} => familyEvaluationGraph - (env 0) (env 1) (env 1) (⋃₀ ⋃₀ env 2) (env 2) - (constantFamilyGraph (env 0) (env 3))) := by - let v : Fin 4 → GroundSetTerm M 4 := GroundSetTerm.var M - let arguments := GroundSetTerm.app (M.definable_constantFamily pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (v 3) Fin.elim0)) - let evaluated := GroundSetTerm.app (M.definable_compressionBases pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 2) (Fin.cases arguments Fin.elim0)))) - exact evaluated.definition.congr (fun _ => rfl) - -noncomputable def compressionBasesFormula {n} (output I U Maps Sources : Fin n) : SetFormula n := - SetFormula.reindex (Fin.cases output - (Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases Sources Fin.elim0))))) - (M.definable_compressionBases pairing unions powers separation).formula - -noncomputable def compressionCapsFormula {n} (output I U Maps top : Fin n) : SetFormula n := - SetFormula.reindex (Fin.cases output - (Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases top Fin.elim0))))) - (M.definable_compressionCaps pairing unions powers separation).formula - -theorem realize_compressionBasesFormula {n} (output I U Maps Sources : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.compressionBasesFormula pairing unions powers separation output I U Maps Sources) env ↔ - env output = familyEvaluationGraph (env I) (env U) (env U) - (⋃₀ ⋃₀ env Maps) (env Maps) (env Sources) := by - let slots : Fin 4 → Fin n := Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases Sources Fin.elim0))) - unfold compressionBasesFormula - rw [realize_reindex] - change Realize M.sets (M.definable_compressionBases pairing unions powers separation).formula - (fun j => env (extend output slots j)) ↔ _ - rw [map_extend] - exact (M.definable_compressionBases pairing unions powers separation).correct - (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) - -theorem realize_compressionCapsFormula {n} (output I U Maps top : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.compressionCapsFormula pairing unions powers separation output I U Maps top) env ↔ - env output = familyEvaluationGraph (env I) (env U) (env U) - (⋃₀ ⋃₀ env Maps) (env Maps) (constantFamilyGraph (env I) (env top)) := by - let slots : Fin 4 → Fin n := Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases top Fin.elim0))) - unfold compressionCapsFormula - rw [realize_reindex] - change Realize M.sets (M.definable_compressionCaps pairing unions powers separation).formula - (fun j => env (extend output slots j)) ↔ _ - rw [map_extend] - exact (M.definable_compressionCaps pairing unions powers separation).correct - (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) - -end TransitiveGround - -namespace GroundCompressionAlgebra -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T : ZFSet.{u}} -variable (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_basesFormula (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) - {z : ZFSet.{u}} (hz : z ∈ M.sets) : - Realize M.sets (M.compressionBasesFormula pairing unions powers separation 0 1 2 3 4) - (extend z (extend I (extend (algebra.union.fields 0) - (extend algebra.maps (extend Sources Fin.elim0))))) ↔ z = algebra.bases := by - exact M.realize_compressionBasesFormula pairing unions powers separation 0 1 2 3 4 _ - (Fin.cases hz (Fin.cases hI (Fin.cases (algebra.union.ground 0) - (Fin.cases algebra.ground (Fin.cases hSources (fun j => Fin.elim0 j)))))) - -theorem realize_capsFormula (hI : I ∈ M.sets) {top z : ZFSet.{u}} - (hTop : top ∈ M.sets) (hz : z ∈ M.sets) : - Realize M.sets (M.compressionCapsFormula pairing unions powers separation 0 1 2 3 4) - (extend z (extend I (extend (algebra.union.fields 0) - (extend algebra.maps (extend top Fin.elim0))))) ↔ z = algebra.caps top := by - exact M.realize_compressionCapsFormula pairing unions powers separation 0 1 2 3 4 _ - (Fin.cases hz (Fin.cases hI (Fin.cases (algebra.union.ground 0) - (Fin.cases algebra.ground (Fin.cases hTop (fun j => Fin.elim0 j)))))) - -end GroundCompressionAlgebra -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +noncomputable def definable_compressionBases : GroundDefinableFunction M + (fun env : Fin 4 → ZFSet.{u} => familyEvaluationGraph + (env 0) (env 1) (env 1) (⋃₀ ⋃₀ env 2) (env 2) (env 3)) := by + let v : Fin 4 → GroundSetTerm M 4 := GroundSetTerm.var M + let bound := GroundSetTerm.app (M.definable_doubleUnion unions) + (fun _ : Fin 1 => v 2) + let evaluated := GroundSetTerm.app (M.definable_familyEvaluation pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 1) + (Fin.cases bound (Fin.cases (v 2) (Fin.cases (v 3) Fin.elim0)))))) + exact evaluated.definition.congr (fun _ => rfl) + +noncomputable def definable_compressionCaps : GroundDefinableFunction M + (fun env : Fin 4 → ZFSet.{u} => familyEvaluationGraph + (env 0) (env 1) (env 1) (⋃₀ ⋃₀ env 2) (env 2) + (constantFamilyGraph (env 0) (env 3))) := by + let v : Fin 4 → GroundSetTerm M 4 := GroundSetTerm.var M + let arguments := GroundSetTerm.app (M.definable_constantFamily pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (v 3) Fin.elim0)) + let evaluated := GroundSetTerm.app (M.definable_compressionBases pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (v 1) (Fin.cases (v 2) (Fin.cases arguments Fin.elim0)))) + exact evaluated.definition.congr (fun _ => rfl) + +noncomputable def compressionBasesFormula {n} (output I U Maps Sources : Fin n) : SetFormula n := + SetFormula.reindex (Fin.cases output + (Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases Sources Fin.elim0))))) + (M.definable_compressionBases pairing unions powers separation).formula + +noncomputable def compressionCapsFormula {n} (output I U Maps top : Fin n) : SetFormula n := + SetFormula.reindex (Fin.cases output + (Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases top Fin.elim0))))) + (M.definable_compressionCaps pairing unions powers separation).formula + +theorem realize_compressionBasesFormula {n} (output I U Maps Sources : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.compressionBasesFormula pairing unions powers separation output I U Maps Sources) env ↔ + env output = familyEvaluationGraph (env I) (env U) (env U) + (⋃₀ ⋃₀ env Maps) (env Maps) (env Sources) := by + let slots : Fin 4 → Fin n := Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases Sources Fin.elim0))) + unfold compressionBasesFormula + rw [realize_reindex] + change Realize M.sets (M.definable_compressionBases pairing unions powers separation).formula + (fun j => env (extend output slots j)) ↔ _ + rw [map_extend] + exact (M.definable_compressionBases pairing unions powers separation).correct + (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) + +theorem realize_compressionCapsFormula {n} (output I U Maps top : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.compressionCapsFormula pairing unions powers separation output I U Maps top) env ↔ + env output = familyEvaluationGraph (env I) (env U) (env U) + (⋃₀ ⋃₀ env Maps) (env Maps) (constantFamilyGraph (env I) (env top)) := by + let slots : Fin 4 → Fin n := Fin.cases I (Fin.cases U (Fin.cases Maps (Fin.cases top Fin.elim0))) + unfold compressionCapsFormula + rw [realize_reindex] + change Realize M.sets (M.definable_compressionCaps pairing unions powers separation).formula + (fun j => env (extend output slots j)) ↔ _ + rw [map_extend] + exact (M.definable_compressionCaps pairing unions powers separation).correct + (fun j => env (slots j)) (fun j => members (slots j)) (env output) (members output) + +end TransitiveGround + +namespace GroundCompressionAlgebra +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T : ZFSet.{u}} +variable (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_basesFormula (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) + {z : ZFSet.{u}} (hz : z ∈ M.sets) : + Realize M.sets (M.compressionBasesFormula pairing unions powers separation 0 1 2 3 4) + (extend z (extend I (extend (algebra.union.fields 0) + (extend algebra.maps (extend Sources Fin.elim0))))) ↔ z = algebra.bases := by + exact M.realize_compressionBasesFormula pairing unions powers separation 0 1 2 3 4 _ + (Fin.cases hz (Fin.cases hI (Fin.cases (algebra.union.ground 0) + (Fin.cases algebra.ground (Fin.cases hSources (fun j => Fin.elim0 j)))))) + +theorem realize_capsFormula (hI : I ∈ M.sets) {top z : ZFSet.{u}} + (hTop : top ∈ M.sets) (hz : z ∈ M.sets) : + Realize M.sets (M.compressionCapsFormula pairing unions powers separation 0 1 2 3 4) + (extend z (extend I (extend (algebra.union.fields 0) + (extend algebra.maps (extend top Fin.elim0))))) ↔ z = algebra.caps top := by + exact M.realize_compressionCapsFormula pairing unions powers separation 0 1 2 3 4 _ + (Fin.cases hz (Fin.cases hI (Fin.cases (algebra.union.ground 0) + (Fin.cases algebra.ground (Fin.cases hTop (fun j => Fin.elim0 j)))))) + +end GroundCompressionAlgebra +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionOrigins.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionOrigins.lean index 8cd469c8343f746c8caf85729dd0b044c9fcb912..1a8aceb84fab21ecaee13480a3c123b1acbfb282 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionOrigins.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionOrigins.lean @@ -1,582 +1,582 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.NatActionUnions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCoherentHeightUnion -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteAccounting -import OAI.SetTheory.PartitionPrinciple.Geometry.HeightColumnBoundLaws -import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundHistoryFields - -namespace OAI - - -namespace PartitionPilot.Forcing.NatUnionCode -universe u - -theorem injection {D C f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}} - (domain : NatUnionCode D U) (range : NatUnionCode C V) (graph : NatUnionCode f F) - (injections : ∀ n, InjectionCode (D n) (C n) (f n)) - (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) : InjectionCode U V F := by - refine ⟨domain.isFunc range graph (fun n => (injections n).function) graphMono, ?_⟩ - intro x y z first second - obtain ⟨n, hn⟩ := (graph _).1 first - obtain ⟨m, hm⟩ := (graph _).1 second - exact (injections (max n m)).injective x y z - (graphMono n _ (le_max_left n m) hn) (graphMono m _ (le_max_right n m) hm) - -theorem meetEmbedding {D C rD rC μD μC f : Nat → ZFSet.{u}} - {U V RU RV MU MV F : ZFSet.{u}} - (domain : NatUnionCode D U) (range : NatUnionCode C V) - (domainOrder : NatUnionCode rD RU) (rangeOrder : NatUnionCode rC RV) - (domainMeet : NatUnionCode μD MU) (rangeMeet : NatUnionCode μC MV) - (graph : NatUnionCode f F) - (embeddings : ∀ n, MeetEmbeddingCode (D n) (C n) (rD n) (rC n) (μD n) (μC n) (f n)) - (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) - (orderMono : ∀ n m, n ≤ m → rD n ⊆ rD m) - (meetMono : ∀ n m, n ≤ m → μD n ⊆ μD m) : - MeetEmbeddingCode U V RU RV MU MV F := by - refine ⟨domain.injection range graph (fun n => (embeddings n).injection) graphMono, ?_, ?_⟩ - · intro x y x' y' lower first second - obtain ⟨n, hn⟩ := (domainOrder _).1 lower - obtain ⟨j, hj⟩ := (graph _).1 first - obtain ⟨k, hk⟩ := (graph _).1 second - let m := max n (max j k) - have nle : n ≤ m := le_max_left _ _ - have jle : j ≤ m := (le_max_left j k).trans (le_max_right n _) - have kle : k ≤ m := (le_max_right j k).trans (le_max_right n _) - exact rangeOrder.subset m ((embeddings m).monotone x y x' y' - (orderMono n m nle hn) (graphMono j m jle hj) (graphMono k m kle hk)) - · intro x y z x' y' z' meet first second third - obtain ⟨n, hn⟩ := (domainMeet _).1 meet - obtain ⟨i, hi⟩ := (graph _).1 first - obtain ⟨j, hj⟩ := (graph _).1 second - obtain ⟨k, hk⟩ := (graph _).1 third - let m := max n (max i (max j k)) - have nle : n ≤ m := le_max_left _ _ - have ile : i ≤ m := (le_max_left i _).trans (le_max_right n _) - have jle : j ≤ m := ((le_max_left j k).trans (le_max_right i _)).trans (le_max_right n _) - have kle : k ≤ m := ((le_max_right j k).trans (le_max_right i _)).trans (le_max_right n _) - exact rangeMeet.subset m ((embeddings m).map_meet x y z x' y' z' - (meetMono n m nle hn) (graphMono i m ile hi) (graphMono j m jle hj) (graphMono k m kle hk)) - -theorem shift {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}} - (code : NatUnionCode stages union) (first : stages 0 ⊆ stages 1) : - NatUnionCode (fun n => stages (n + 1)) union := by - intro x - constructor - · intro hx - obtain ⟨n, hn⟩ := (code x).1 hx - cases n with - | zero => exact ⟨0, first hn⟩ - | succ n => exact ⟨n, hn⟩ - · rintro ⟨n, hn⟩ - exact code.subset (n + 1) hn - -end PartitionPilot.Forcing.NatUnionCode - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem canonical_iterate_codes (n : Nat) : - let data := state.data.iterate M I Sources Reps G T n - MeetOrderCode data.D data.rD data.μD ∧ - MeetOrderCode data.currentCarrier data.currentOrder data.currentMeet ∧ - PosetActionCode G data.currentCarrier m one data.currentOrder data.A ∧ - FunctionGraphOn I data.Maps ∧ - ∀ i S, ZFSet.pair i S ∈ data.Maps → - MeetEmbeddingCode data.D data.currentCarrier data.rD data.currentOrder data.μD data.currentMeet S := by - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - rw [← equal] - exact ⟨current.batch.oldOrder, current.batch.batch_meetOrder, current.inputs.action, - current.inputs.maps, current.inputs.valid⟩ - -theorem canonical_iterate_graphs_mono {n k : Nat} (before : n ≤ k) : - let first := state.data.iterate M I Sources Reps G T n - let last := state.data.iterate M I Sources Reps G T k - first.D ⊆ last.D ∧ first.rD ⊆ last.rD ∧ first.μD ⊆ last.μD ∧ - first.currentCarrier ⊆ last.currentCarrier ∧ first.currentOrder ⊆ last.currentOrder ∧ - first.currentMeet ⊆ last.currentMeet ∧ first.A ⊆ last.A ∧ - ∀ i S S', ZFSet.pair i S ∈ first.Maps → ZFSet.pair i S' ∈ last.Maps → S ⊆ S' := by - let first := state.data.iterate M I Sources Reps G T n - let last := state.data.iterate M I Sources Reps G T k - have coherent := state.canonical_iterate_coherent pairing unions powers separation - hI hSources hReps hG hT before - obtain ⟨old, current, action, maps, valid⟩ := state.canonical_iterate_codes - pairing unions powers separation hI hSources hReps hG hT n - have pair_subset {X Y f g : ZFSet.{u}} (shape : f ⊆ ZFSet.prod X Y) - (transfer : ∀ x ∈ X, ∀ y ∈ Y, ZFSet.pair x y ∈ f → ZFSet.pair x y ∈ g) : f ⊆ g := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shape hz) - exact transfer x hx y hy hz - refine ⟨coherent.carrier, ?_, ?_, coherent.currentCarrier, ?_, ?_, ?_, ?_⟩ - · exact pair_subset old.order.relation - (fun x hx y hy entry => (coherent.order x hx y hy).2 entry) - · apply pair_subset old.operation.1 - intro xy hxy z _ entry - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - exact (coherent.meet x hx y hy z).2 entry - · exact pair_subset current.order.relation - (fun x hx y hy entry => (coherent.currentOrder x hx y hy).2 entry) - · apply pair_subset current.operation.1 - intro xy hxy z _ entry - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - exact (coherent.currentMeet x hx y hy z).2 entry - · apply pair_subset action.function.1 - intro gx hgx y _ entry - obtain ⟨g, _, x, hx, rfl⟩ := ZFSet.mem_prod.1 hgx - exact (coherent.action g x hx y).2 entry - · intro i S S' oldEntry newEntry - apply pair_subset (valid i S oldEntry).injection.function.1 - intro x hx y _ entry - exact (coherent.maps i (maps.pair_source oldEntry) S S' oldEntry newEntry x hx y).2 entry - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem canonical_iterate_profile {c e K F : ZFSet.{u}} - (hc : c ∈ state.data.currentCarrier) (he : e ∈ state.data.currentCarrier) - (hK : K ∈ state.data.currentCarrier) (subset : F ⊆ state.data.currentCarrier) - (nonempty : ∃ f, f ∈ F) - (profile : CodedInsertionProfile state.data.currentCarrier state.data.currentOrder - state.data.currentMeet c e K F) - (separated : ZFSet.pair e K ∉ state.data.currentOrder) (n : Nat) : - CodedInsertionProfile (state.data.iterate M I Sources Reps G T n).currentCarrier - (state.data.iterate M I Sources Reps G T n).currentOrder - (state.data.iterate M I Sources Reps G T n).currentMeet c e K F := by - induction n with - | zero => exact profile - | succ n ih => - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT (n + 1) - have coherent := state.canonical_iterate_coherent pairing unions powers separation - hI hSources hReps hG hT (Nat.zero_le n) - have hcOld : c ∈ current.data.D := by - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] - using coherent.currentCarrier hc - have heOld : e ∈ current.data.D := by - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] - using coherent.currentCarrier he - have hKOld : K ∈ current.data.D := by - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] - using coherent.currentCarrier hK - have subsetOld : F ⊆ current.data.D := by - intro f hf - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] - using coherent.currentCarrier (subset hf) - have profileOld : CodedInsertionProfile current.data.D current.data.rD current.data.μD c e K F := by - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using ih - have separatedOld : ZFSet.pair e K ∉ current.data.rD := by - intro below - have later : ZFSet.pair e K ∈ (state.data.iterate M I Sources Reps G T n).currentOrder := by - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using below - exact separated ((coherent.currentOrder e he K hK).1 later) - have result := current.batch.insertion_profile_persists hcOld heOld hKOld - subsetOld nonempty profileOld separatedOld - change CodedInsertionProfile current.data.currentCarrier current.data.currentOrder - current.data.currentMeet c e K F at result - simpa only [equal] using result - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure GroundCompressionUnionData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T : ZFSet.{u}) where - fields : Fin 13 → ZFSet.{u} - ground : ∀ j, fields j ∈ M.sets - fieldUnion : ∀ j, NatUnionCode - (fun n => (initial.iterate M I Sources Reps G T n).field j) (fields j) - currentCarrier : NatUnionCode - (fun n => (initial.iterate M I Sources Reps G T n).currentCarrier) (fields 0) - currentOrder : NatUnionCode - (fun n => (initial.iterate M I Sources Reps G T n).currentOrder) (fields 1) - currentMeet : NatUnionCode - (fun n => (initial.iterate M I Sources Reps G T n).currentMeet) (fields 2) - meet : MeetOrderCode (fields 0) (fields 1) (fields 2) - action : PosetActionCode G (fields 0) m one (fields 1) (fields 12) - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem exists_groundUnion - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : - Nonempty (GroundCompressionUnionData M state.data I Sources Reps G m one T) := by - classical - let stages := state.data.iterate M I Sources Reps G T - obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT - have allFields : ∀ j : Fin 13, ∃ U ∈ M.sets, - NatUnionCode (fun n => (stages n).field j) U := by - intro j - obtain ⟨_, _, _, _, U, hU, _, _, _, _, exactUnion⟩ := - M.exists_groundStateFieldUnion pairing unions separation collection - (M.omega_mem separation infinite) hHistory stages entries j - exact ⟨U, hU, exactUnion⟩ - choose fields ground exactFields using allFields - have codes := state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT - have mono {n k : Nat} (h : n ≤ k) := - state.canonical_iterate_graphs_mono pairing unions powers separation hI hSources hReps hG hT h - have carrierUnion : NatUnionCode (fun n => (stages n).D) (fields 0) := exactFields 0 - have orderUnion : NatUnionCode (fun n => (stages n).rD) (fields 1) := exactFields 1 - have meetUnion : NatUnionCode (fun n => (stages n).μD) (fields 2) := exactFields 2 - have actionUnion : NatUnionCode (fun n => (stages n).A) (fields 12) := exactFields 12 - have currentCarrier : NatUnionCode (fun n => (stages n).currentCarrier) (fields 0) := - carrierUnion.shift (mono (Nat.zero_le 1)).1 - have currentOrder : NatUnionCode (fun n => (stages n).currentOrder) (fields 1) := - orderUnion.shift (mono (Nat.zero_le 1)).2.1 - have currentMeet : NatUnionCode (fun n => (stages n).currentMeet) (fields 2) := - meetUnion.shift (mono (Nat.zero_le 1)).2.2.1 - have unionMeet : MeetOrderCode (fields 0) (fields 1) (fields 2) := - carrierUnion.meetOrder orderUnion meetUnion (fun n => (codes n).1) - (fun _ _ h => (mono h).1) (fun _ _ h => (mono h).2.1) (fun _ _ h => (mono h).2.2.1) - have unionAction : PosetActionCode G (fields 0) m one (fields 1) (fields 12) := - currentCarrier.posetAction currentOrder actionUnion (fun n => (codes n).2.2.1) - (fun _ _ h => (mono h).2.2.2.2.1) (fun _ _ h => (mono h).2.2.2.2.2.2.1) - exact ⟨⟨fields, ground, exactFields, currentCarrier, currentOrder, currentMeet, unionMeet, unionAction⟩⟩ - -end GroundCompressionState - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -theorem rank_taggedExtension_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {P N : ZFSet.{u}} (points : ZFSet.rank P < o) (fresh : ZFSet.rank N < o) : - ZFSet.rank (taggedExtension P N) < o := by - rw [taggedExtension, ZFSet.rank_union] - exact max_lt points (rank_product_lt limit (rank_singleton_lt limit points) fresh) - -namespace RecursiveTemplateConstancy -variable {P r μ : ZFSet.{u}} {initial : RecursiveStateData.{u}} -variable (constant : RecursiveTemplateConstancy P r μ initial) -include constant - -theorem fresh_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (indices : ZFSet.rank initial.J < o) (templates : ZFSet.rank P < o) : - ZFSet.rank initial.fresh < o := by - have subset : initial.fresh ⊆ ZFSet.prod initial.J P := by - intro z hz - have domain := indexedAttachmentFresh_subset initial.J initial.Qs initial.rs initial.As hz - obtain ⟨i, hi, q, rfl, Q, entry, hq⟩ := (mem_indexedAttachmentDomain _ _ _).1 domain - exact ZFSet.pair_mem_prod.2 ⟨hi, (constant.space_entry_iff i Q).1 entry |>.2 ▸ hq⟩ - exact (ZFSet.rank_mono subset).trans_lt (rank_product_lt limit indices templates) - -theorem currentCarrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (points : ZFSet.rank initial.D < o) (indices : ZFSet.rank initial.J < o) - (templates : ZFSet.rank P < o) : ZFSet.rank initial.currentCarrier < o := - rank_taggedExtension_lt limit points (constant.fresh_rank_lt limit indices templates) - -theorem iterate_carrier_ranks (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (points : ZFSet.rank initial.D < o) (indices : ZFSet.rank initial.J < o) - (templates : ZFSet.rank P < o) (tasks : ZFSet.rank I < o) (n : Nat) : - ZFSet.rank (initial.iterate M I Sources Reps G T n).D < o ∧ - ZFSet.rank (initial.iterate M I Sources Reps G T n).J < o := by - induction n with - | zero => exact ⟨points, indices⟩ - | succ n ih => - rw [RecursiveStateData.iterate_succ] - refine ⟨(constant.iterate M I Sources Reps G T n).currentCarrier_rank_lt limit ih.1 ih.2 templates, ?_⟩ - exact (ZFSet.rank_mono (recursiveAttachmentIndices_subset _ _ _ _ _ _)).trans_lt - (rank_product_lt limit tasks ih.2) - -end RecursiveTemplateConstancy - -theorem NatUnionCode.rank_le {sets : Nat → ZFSet.{u}} {U : ZFSet.{u}} (code : NatUnionCode sets U) - {o : Ordinal.{u}} (bounds : ∀ n, ZFSet.rank (sets n) < o) : ZFSet.rank U ≤ o := by - apply ZFSet.rank_le_iff.2 - intro x hx - obtain ⟨n, member⟩ := (code x).1 hx - exact (ZFSet.rank_lt_of_mem member).trans (bounds n) - -namespace GroundCompressionUnionData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T : ZFSet.{u}} -variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - -theorem carrier_rank_le {P r μ : ZFSet.{u}} (constant : RecursiveTemplateConstancy P r μ initial) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (points : ZFSet.rank initial.D < o) (indices : ZFSet.rank initial.J < o) - (templates : ZFSet.rank P < o) (tasks : ZFSet.rank I < o) : - ZFSet.rank (data.fields 0) ≤ o := - (data.fieldUnion 0).rank_le - (fun n => (constant.iterate_carrier_ranks M I Sources Reps G T limit points indices templates tasks n).1) - -end GroundCompressionUnionData - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) - -theorem union_original_subset : P0 ⊆ data.fields 0 := by - intro x hx - exact (data.fieldUnion 0).subset 0 (state.invariant.originalSubset hx) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem union_order_iff (n : Nat) {x y : ZFSet.{u}} - (hx : x ∈ (state.data.iterate M I Sources Reps G T n).D) - (hy : y ∈ (state.data.iterate M I Sources Reps G T n).D) : - ZFSet.pair x y ∈ data.fields 1 ↔ ZFSet.pair x y ∈ (state.data.iterate M I Sources Reps G T n).rD := - (data.fieldUnion 1).order_entry_iff - (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation hI hSources hReps hG hT h).2.1) - (fun _ _ h => (state.canonical_iterate_coherent pairing unions powers separation hI hSources hReps hG hT h).order) - n hx hy - -theorem union_meet_iff (n : Nat) {x y z : ZFSet.{u}} - (hx : x ∈ (state.data.iterate M I Sources Reps G T n).D) - (hy : y ∈ (state.data.iterate M I Sources Reps G T n).D) : - ZFSet.pair (ZFSet.pair x y) z ∈ data.fields 2 ↔ - ZFSet.pair (ZFSet.pair x y) z ∈ (state.data.iterate M I Sources Reps G T n).μD := - (data.fieldUnion 2).meet_entry_iff data.meet - (fun n => (state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n).1) n hx hy - -theorem union_action_iff (n : Nat) {g x y : ZFSet.{u}} - (hx : x ∈ (state.data.iterate M I Sources Reps G T n).currentCarrier) : - ZFSet.pair (ZFSet.pair g x) y ∈ data.fields 12 ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ (state.data.iterate M I Sources Reps G T n).A := - (data.fieldUnion 12).action_entry_iff data.action - (fun n => (state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n).2.2.1) n hx - -theorem union_original_order_iff {x y : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : - ZFSet.pair x y ∈ data.fields 1 ↔ ZFSet.pair x y ∈ r0 := - (state.union_order_iff data pairing unions powers separation hI hSources hReps hG hT 0 - (state.invariant.originalSubset hx) (state.invariant.originalSubset hy)).trans - (state.invariant.originalOrder x hx y hy) - -theorem union_original_meet_iff {x y z : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : - ZFSet.pair (ZFSet.pair x y) z ∈ data.fields 2 ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ0 := - (state.union_meet_iff data pairing unions powers separation hI hSources hReps hG hT 0 - (state.invariant.originalSubset hx) (state.invariant.originalSubset hy)).trans - (state.invariant.originalMeet x hx y hy z) - -theorem union_original_action_iff {g x y : ZFSet.{u}} (hx : x ∈ P0) : - ZFSet.pair (ZFSet.pair g x) y ∈ data.fields 12 ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A0 := - (state.union_action_iff data pairing unions powers separation hI hSources hReps hG hT 0 - (old_mem_taggedExtension (state.invariant.originalSubset hx))).trans - (state.invariant.originalAction g x hx y) - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing -universe u - -structure GroundCompressionHeightData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T : ZFSet.{u}) - (union : GroundCompressionUnionData M initial I Sources Reps G m one T) - (P0 C D rD original : ZFSet.{u}) where - family : ZFSet.{u} - family_ground : family ∈ M.sets - function : FunctionGraphOn ZFSet.omega family - zero : function.natValue 0 = original - finite : ∀ n, StrictLexHeightCode (initial.iterate M I Sources Reps G T n).D C D - (initial.iterate M I Sources Reps G T n).rD (function.natValue n) rD - adjacent : ∀ n, function.natValue n ⊆ function.natValue (n + 1) - height : ZFSet.{u} - height_ground : height ∈ M.sets - exact_union : NatUnionCode function.natValue height - code : StrictLexHeightCode (union.fields 0) C D (union.fields 1) height rD - finite_entries : ∀ n x, x ∈ (initial.iterate M I Sources Reps G T n).D → ∀ y, - ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ function.natValue n - original_entries : ∀ x ∈ P0, ∀ y, ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ original - range_ground : relationImage (union.fields 0) (ZFSet.prod C D) height ∈ M.sets - range_countable : M.groundEmbeddable (relationImage (union.fields 0) (ZFSet.prod C D) height) ZFSet.omega - columns : ∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ height → a ∈ heightColumns P0 C D original - - - - - -structure CompressionOriginalData (P r μ A G U u ν B : ZFSet.{u}) : Prop where - subset : P ⊆ U - order : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ u ↔ ZFSet.pair x y ∈ r - meet : ∀ x ∈ P, ∀ y ∈ P, ∀ z, ZFSet.pair (ZFSet.pair x y) z ∈ ν ↔ - ZFSet.pair (ZFSet.pair x y) z ∈ μ - action : ∀ g x, x ∈ P → ∀ y, ZFSet.pair (ZFSet.pair g x) y ∈ B ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A - agreement : ∀ g ∈ G, ∀ h ∈ G, ∀ v ∈ P, ActionAgreementBelow P r A g h v → - ActionAgreementBelow U u B g h v - -namespace GroundCompressionState -open SetFormula -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem union_original_agreement {g h v : ZFSet.{u}} (hg : g ∈ G) (hh : h ∈ G) (hv : v ∈ P0) - (agreement : ActionAgreementBelow P0 r0 A0 g h v) : - ActionAgreementBelow (data.fields 0) (data.fields 1) (data.fields 12) g h v := by - intro x _ y _ below - obtain ⟨n, lower⟩ := (data.currentOrder _).1 below - have codes := state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n - have hx := (ZFSet.pair_mem_prod.1 (codes.2.1.order.relation lower)).1 - have finiteAgreement : ActionAgreementBelow - (state.data.iterate M I Sources Reps G T n).currentCarrier - (state.data.iterate M I Sources Reps G T n).currentOrder - (state.data.iterate M I Sources Reps G T n).A g h v := by - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have agree := current.invariant.agreement g hg h hh v hv agreement - change ActionAgreementBelow current.data.currentCarrier current.data.currentOrder current.data.A g h v at agree - simpa only [equal] using agree - have restrict (k : ZFSet.{u}) := state.union_action_iff data pairing unions powers separation - hI hSources hReps hG hT n (g := k) (y := y) hx - constructor - · intro entry - have first := (restrict g).1 entry - have hy := (ZFSet.pair_mem_prod.1 (codes.2.2.1.function.1 first)).2 - exact (restrict h).2 ((finiteAgreement x hx y hy lower).1 first) - · intro entry - have second := (restrict h).1 entry - have hy := (ZFSet.pair_mem_prod.1 (codes.2.2.1.function.1 second)).2 - exact (restrict g).2 ((finiteAgreement x hx y hy lower).2 second) - -theorem union_original_data : - CompressionOriginalData P0 r0 μ0 A0 G (data.fields 0) (data.fields 1) (data.fields 2) (data.fields 12) := - ⟨state.union_original_subset data, - fun _ hx _ hy => state.union_original_order_iff data pairing unions powers separation hI hSources hReps hG hT hx hy, - fun _ hx _ hy _ => state.union_original_meet_iff data pairing unions powers separation hI hSources hReps hG hT hx hy, - fun _ _ hx _ => state.union_original_action_iff data pairing unions powers separation hI hSources hReps hG hT hx, - fun _ hg _ hh _ hv agree => state.union_original_agreement data pairing unions powers separation - hI hSources hReps hG hT hg hh hv agree⟩ - -end GroundCompressionState - - - - - - -theorem ExternalRectangleCode.lift_compression - {P r μ A G U u ν B m one c b d g h : ZFSet.{u}} - (rectangle : ExternalRectangleCode P G r μ A c b d g h) - (compression : CompressionOriginalData P r μ A G U u ν B) - (action : PosetActionCode G P m one r A) : - ExternalRectangleCode U G u ν B c b d g h := by - obtain ⟨hc, hb, hd, hg, hh, cd, bd, w, hw, cb, agree, separated⟩ := rectangle - refine ⟨compression.subset hc, compression.subset hb, compression.subset hd, hg, hh, - (compression.order c hc d hd).2 cd, (compression.order b hb d hd).2 bd, - w, compression.subset hw, (compression.meet c hc b hb w).2 cb, - compression.agreement g hg h hh w hw agree, ?_⟩ - intro y _ z _ v _ entries - have dy := (compression.action g d hd y).1 entries.1 - have dz := (compression.action h d hd z).1 entries.2.1 - have wv := (compression.action g w hw v).1 entries.2.2 - have hy := (ZFSet.pair_mem_prod.1 (action.function.1 dy)).2 - have hz := (ZFSet.pair_mem_prod.1 (action.function.1 dz)).2 - have hv := (ZFSet.pair_mem_prod.1 (action.function.1 wv)).2 - exact (compression.meet y hy z hz v).2 (separated y hy z hz v hv ⟨dy, dz, wv⟩) - -theorem externalRectangles_subset_compression - {P r μ A G U u ν B m one : ZFSet.{u}} - (compression : CompressionOriginalData P r μ A G U u ν B) - (action : PosetActionCode G P m one r A) : - externalRectangles P G r μ A ⊆ externalRectangles U G u ν B := by - intro x hx - obtain ⟨c, b, d, g, h, rfl, rectangle⟩ := (mem_externalRectangles P G r μ A x).1 hx - exact (externalRectangleCode_mem U G u ν B c b d g h).2 - (rectangle.lift_compression compression action) - - - - - -structure GroundCompressionOrigin (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}) where - seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters - state : GroundCompressionState M seed - initial_data : state.data = initial - -namespace GroundCompressionOrigin -open SetFormula -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) - -include origin in -theorem union_original_data - (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : - CompressionOriginalData P0 r0 μ0 A0 G (data.fields 0) (data.fields 1) (data.fields 2) (data.fields 12) := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - exact state.union_original_data data pairing unions powers separation hI hSources hReps hG hT - -end GroundCompressionOrigin - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.NatActionUnions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCoherentHeightUnion +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteAccounting +import OAI.SetTheory.PartitionPrinciple.Geometry.HeightColumnBoundLaws +import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundHistoryFields + +namespace OAI + + +namespace PartitionPilot.Forcing.NatUnionCode +universe u + +theorem injection {D C f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}} + (domain : NatUnionCode D U) (range : NatUnionCode C V) (graph : NatUnionCode f F) + (injections : ∀ n, InjectionCode (D n) (C n) (f n)) + (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) : InjectionCode U V F := by + refine ⟨domain.isFunc range graph (fun n => (injections n).function) graphMono, ?_⟩ + intro x y z first second + obtain ⟨n, hn⟩ := (graph _).1 first + obtain ⟨m, hm⟩ := (graph _).1 second + exact (injections (max n m)).injective x y z + (graphMono n _ (le_max_left n m) hn) (graphMono m _ (le_max_right n m) hm) + +theorem meetEmbedding {D C rD rC μD μC f : Nat → ZFSet.{u}} + {U V RU RV MU MV F : ZFSet.{u}} + (domain : NatUnionCode D U) (range : NatUnionCode C V) + (domainOrder : NatUnionCode rD RU) (rangeOrder : NatUnionCode rC RV) + (domainMeet : NatUnionCode μD MU) (rangeMeet : NatUnionCode μC MV) + (graph : NatUnionCode f F) + (embeddings : ∀ n, MeetEmbeddingCode (D n) (C n) (rD n) (rC n) (μD n) (μC n) (f n)) + (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) + (orderMono : ∀ n m, n ≤ m → rD n ⊆ rD m) + (meetMono : ∀ n m, n ≤ m → μD n ⊆ μD m) : + MeetEmbeddingCode U V RU RV MU MV F := by + refine ⟨domain.injection range graph (fun n => (embeddings n).injection) graphMono, ?_, ?_⟩ + · intro x y x' y' lower first second + obtain ⟨n, hn⟩ := (domainOrder _).1 lower + obtain ⟨j, hj⟩ := (graph _).1 first + obtain ⟨k, hk⟩ := (graph _).1 second + let m := max n (max j k) + have nle : n ≤ m := le_max_left _ _ + have jle : j ≤ m := (le_max_left j k).trans (le_max_right n _) + have kle : k ≤ m := (le_max_right j k).trans (le_max_right n _) + exact rangeOrder.subset m ((embeddings m).monotone x y x' y' + (orderMono n m nle hn) (graphMono j m jle hj) (graphMono k m kle hk)) + · intro x y z x' y' z' meet first second third + obtain ⟨n, hn⟩ := (domainMeet _).1 meet + obtain ⟨i, hi⟩ := (graph _).1 first + obtain ⟨j, hj⟩ := (graph _).1 second + obtain ⟨k, hk⟩ := (graph _).1 third + let m := max n (max i (max j k)) + have nle : n ≤ m := le_max_left _ _ + have ile : i ≤ m := (le_max_left i _).trans (le_max_right n _) + have jle : j ≤ m := ((le_max_left j k).trans (le_max_right i _)).trans (le_max_right n _) + have kle : k ≤ m := ((le_max_right j k).trans (le_max_right i _)).trans (le_max_right n _) + exact rangeMeet.subset m ((embeddings m).map_meet x y z x' y' z' + (meetMono n m nle hn) (graphMono i m ile hi) (graphMono j m jle hj) (graphMono k m kle hk)) + +theorem shift {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}} + (code : NatUnionCode stages union) (first : stages 0 ⊆ stages 1) : + NatUnionCode (fun n => stages (n + 1)) union := by + intro x + constructor + · intro hx + obtain ⟨n, hn⟩ := (code x).1 hx + cases n with + | zero => exact ⟨0, first hn⟩ + | succ n => exact ⟨n, hn⟩ + · rintro ⟨n, hn⟩ + exact code.subset (n + 1) hn + +end PartitionPilot.Forcing.NatUnionCode + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem canonical_iterate_codes (n : Nat) : + let data := state.data.iterate M I Sources Reps G T n + MeetOrderCode data.D data.rD data.μD ∧ + MeetOrderCode data.currentCarrier data.currentOrder data.currentMeet ∧ + PosetActionCode G data.currentCarrier m one data.currentOrder data.A ∧ + FunctionGraphOn I data.Maps ∧ + ∀ i S, ZFSet.pair i S ∈ data.Maps → + MeetEmbeddingCode data.D data.currentCarrier data.rD data.currentOrder data.μD data.currentMeet S := by + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + rw [← equal] + exact ⟨current.batch.oldOrder, current.batch.batch_meetOrder, current.inputs.action, + current.inputs.maps, current.inputs.valid⟩ + +theorem canonical_iterate_graphs_mono {n k : Nat} (before : n ≤ k) : + let first := state.data.iterate M I Sources Reps G T n + let last := state.data.iterate M I Sources Reps G T k + first.D ⊆ last.D ∧ first.rD ⊆ last.rD ∧ first.μD ⊆ last.μD ∧ + first.currentCarrier ⊆ last.currentCarrier ∧ first.currentOrder ⊆ last.currentOrder ∧ + first.currentMeet ⊆ last.currentMeet ∧ first.A ⊆ last.A ∧ + ∀ i S S', ZFSet.pair i S ∈ first.Maps → ZFSet.pair i S' ∈ last.Maps → S ⊆ S' := by + let first := state.data.iterate M I Sources Reps G T n + let last := state.data.iterate M I Sources Reps G T k + have coherent := state.canonical_iterate_coherent pairing unions powers separation + hI hSources hReps hG hT before + obtain ⟨old, current, action, maps, valid⟩ := state.canonical_iterate_codes + pairing unions powers separation hI hSources hReps hG hT n + have pair_subset {X Y f g : ZFSet.{u}} (shape : f ⊆ ZFSet.prod X Y) + (transfer : ∀ x ∈ X, ∀ y ∈ Y, ZFSet.pair x y ∈ f → ZFSet.pair x y ∈ g) : f ⊆ g := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shape hz) + exact transfer x hx y hy hz + refine ⟨coherent.carrier, ?_, ?_, coherent.currentCarrier, ?_, ?_, ?_, ?_⟩ + · exact pair_subset old.order.relation + (fun x hx y hy entry => (coherent.order x hx y hy).2 entry) + · apply pair_subset old.operation.1 + intro xy hxy z _ entry + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + exact (coherent.meet x hx y hy z).2 entry + · exact pair_subset current.order.relation + (fun x hx y hy entry => (coherent.currentOrder x hx y hy).2 entry) + · apply pair_subset current.operation.1 + intro xy hxy z _ entry + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + exact (coherent.currentMeet x hx y hy z).2 entry + · apply pair_subset action.function.1 + intro gx hgx y _ entry + obtain ⟨g, _, x, hx, rfl⟩ := ZFSet.mem_prod.1 hgx + exact (coherent.action g x hx y).2 entry + · intro i S S' oldEntry newEntry + apply pair_subset (valid i S oldEntry).injection.function.1 + intro x hx y _ entry + exact (coherent.maps i (maps.pair_source oldEntry) S S' oldEntry newEntry x hx y).2 entry + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem canonical_iterate_profile {c e K F : ZFSet.{u}} + (hc : c ∈ state.data.currentCarrier) (he : e ∈ state.data.currentCarrier) + (hK : K ∈ state.data.currentCarrier) (subset : F ⊆ state.data.currentCarrier) + (nonempty : ∃ f, f ∈ F) + (profile : CodedInsertionProfile state.data.currentCarrier state.data.currentOrder + state.data.currentMeet c e K F) + (separated : ZFSet.pair e K ∉ state.data.currentOrder) (n : Nat) : + CodedInsertionProfile (state.data.iterate M I Sources Reps G T n).currentCarrier + (state.data.iterate M I Sources Reps G T n).currentOrder + (state.data.iterate M I Sources Reps G T n).currentMeet c e K F := by + induction n with + | zero => exact profile + | succ n ih => + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT (n + 1) + have coherent := state.canonical_iterate_coherent pairing unions powers separation + hI hSources hReps hG hT (Nat.zero_le n) + have hcOld : c ∈ current.data.D := by + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] + using coherent.currentCarrier hc + have heOld : e ∈ current.data.D := by + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] + using coherent.currentCarrier he + have hKOld : K ∈ current.data.D := by + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] + using coherent.currentCarrier hK + have subsetOld : F ⊆ current.data.D := by + intro f hf + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] + using coherent.currentCarrier (subset hf) + have profileOld : CodedInsertionProfile current.data.D current.data.rD current.data.μD c e K F := by + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using ih + have separatedOld : ZFSet.pair e K ∉ current.data.rD := by + intro below + have later : ZFSet.pair e K ∈ (state.data.iterate M I Sources Reps G T n).currentOrder := by + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using below + exact separated ((coherent.currentOrder e he K hK).1 later) + have result := current.batch.insertion_profile_persists hcOld heOld hKOld + subsetOld nonempty profileOld separatedOld + change CodedInsertionProfile current.data.currentCarrier current.data.currentOrder + current.data.currentMeet c e K F at result + simpa only [equal] using result + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure GroundCompressionUnionData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T : ZFSet.{u}) where + fields : Fin 13 → ZFSet.{u} + ground : ∀ j, fields j ∈ M.sets + fieldUnion : ∀ j, NatUnionCode + (fun n => (initial.iterate M I Sources Reps G T n).field j) (fields j) + currentCarrier : NatUnionCode + (fun n => (initial.iterate M I Sources Reps G T n).currentCarrier) (fields 0) + currentOrder : NatUnionCode + (fun n => (initial.iterate M I Sources Reps G T n).currentOrder) (fields 1) + currentMeet : NatUnionCode + (fun n => (initial.iterate M I Sources Reps G T n).currentMeet) (fields 2) + meet : MeetOrderCode (fields 0) (fields 1) (fields 2) + action : PosetActionCode G (fields 0) m one (fields 1) (fields 12) + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem exists_groundUnion + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : + Nonempty (GroundCompressionUnionData M state.data I Sources Reps G m one T) := by + classical + let stages := state.data.iterate M I Sources Reps G T + obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT + have allFields : ∀ j : Fin 13, ∃ U ∈ M.sets, + NatUnionCode (fun n => (stages n).field j) U := by + intro j + obtain ⟨_, _, _, _, U, hU, _, _, _, _, exactUnion⟩ := + M.exists_groundStateFieldUnion pairing unions separation collection + (M.omega_mem separation infinite) hHistory stages entries j + exact ⟨U, hU, exactUnion⟩ + choose fields ground exactFields using allFields + have codes := state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT + have mono {n k : Nat} (h : n ≤ k) := + state.canonical_iterate_graphs_mono pairing unions powers separation hI hSources hReps hG hT h + have carrierUnion : NatUnionCode (fun n => (stages n).D) (fields 0) := exactFields 0 + have orderUnion : NatUnionCode (fun n => (stages n).rD) (fields 1) := exactFields 1 + have meetUnion : NatUnionCode (fun n => (stages n).μD) (fields 2) := exactFields 2 + have actionUnion : NatUnionCode (fun n => (stages n).A) (fields 12) := exactFields 12 + have currentCarrier : NatUnionCode (fun n => (stages n).currentCarrier) (fields 0) := + carrierUnion.shift (mono (Nat.zero_le 1)).1 + have currentOrder : NatUnionCode (fun n => (stages n).currentOrder) (fields 1) := + orderUnion.shift (mono (Nat.zero_le 1)).2.1 + have currentMeet : NatUnionCode (fun n => (stages n).currentMeet) (fields 2) := + meetUnion.shift (mono (Nat.zero_le 1)).2.2.1 + have unionMeet : MeetOrderCode (fields 0) (fields 1) (fields 2) := + carrierUnion.meetOrder orderUnion meetUnion (fun n => (codes n).1) + (fun _ _ h => (mono h).1) (fun _ _ h => (mono h).2.1) (fun _ _ h => (mono h).2.2.1) + have unionAction : PosetActionCode G (fields 0) m one (fields 1) (fields 12) := + currentCarrier.posetAction currentOrder actionUnion (fun n => (codes n).2.2.1) + (fun _ _ h => (mono h).2.2.2.2.1) (fun _ _ h => (mono h).2.2.2.2.2.2.1) + exact ⟨⟨fields, ground, exactFields, currentCarrier, currentOrder, currentMeet, unionMeet, unionAction⟩⟩ + +end GroundCompressionState + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +theorem rank_taggedExtension_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {P N : ZFSet.{u}} (points : ZFSet.rank P < o) (fresh : ZFSet.rank N < o) : + ZFSet.rank (taggedExtension P N) < o := by + rw [taggedExtension, ZFSet.rank_union] + exact max_lt points (rank_product_lt limit (rank_singleton_lt limit points) fresh) + +namespace RecursiveTemplateConstancy +variable {P r μ : ZFSet.{u}} {initial : RecursiveStateData.{u}} +variable (constant : RecursiveTemplateConstancy P r μ initial) +include constant + +theorem fresh_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (indices : ZFSet.rank initial.J < o) (templates : ZFSet.rank P < o) : + ZFSet.rank initial.fresh < o := by + have subset : initial.fresh ⊆ ZFSet.prod initial.J P := by + intro z hz + have domain := indexedAttachmentFresh_subset initial.J initial.Qs initial.rs initial.As hz + obtain ⟨i, hi, q, rfl, Q, entry, hq⟩ := (mem_indexedAttachmentDomain _ _ _).1 domain + exact ZFSet.pair_mem_prod.2 ⟨hi, (constant.space_entry_iff i Q).1 entry |>.2 ▸ hq⟩ + exact (ZFSet.rank_mono subset).trans_lt (rank_product_lt limit indices templates) + +theorem currentCarrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (points : ZFSet.rank initial.D < o) (indices : ZFSet.rank initial.J < o) + (templates : ZFSet.rank P < o) : ZFSet.rank initial.currentCarrier < o := + rank_taggedExtension_lt limit points (constant.fresh_rank_lt limit indices templates) + +theorem iterate_carrier_ranks (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (points : ZFSet.rank initial.D < o) (indices : ZFSet.rank initial.J < o) + (templates : ZFSet.rank P < o) (tasks : ZFSet.rank I < o) (n : Nat) : + ZFSet.rank (initial.iterate M I Sources Reps G T n).D < o ∧ + ZFSet.rank (initial.iterate M I Sources Reps G T n).J < o := by + induction n with + | zero => exact ⟨points, indices⟩ + | succ n ih => + rw [RecursiveStateData.iterate_succ] + refine ⟨(constant.iterate M I Sources Reps G T n).currentCarrier_rank_lt limit ih.1 ih.2 templates, ?_⟩ + exact (ZFSet.rank_mono (recursiveAttachmentIndices_subset _ _ _ _ _ _)).trans_lt + (rank_product_lt limit tasks ih.2) + +end RecursiveTemplateConstancy + +theorem NatUnionCode.rank_le {sets : Nat → ZFSet.{u}} {U : ZFSet.{u}} (code : NatUnionCode sets U) + {o : Ordinal.{u}} (bounds : ∀ n, ZFSet.rank (sets n) < o) : ZFSet.rank U ≤ o := by + apply ZFSet.rank_le_iff.2 + intro x hx + obtain ⟨n, member⟩ := (code x).1 hx + exact (ZFSet.rank_lt_of_mem member).trans (bounds n) + +namespace GroundCompressionUnionData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T : ZFSet.{u}} +variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + +theorem carrier_rank_le {P r μ : ZFSet.{u}} (constant : RecursiveTemplateConstancy P r μ initial) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (points : ZFSet.rank initial.D < o) (indices : ZFSet.rank initial.J < o) + (templates : ZFSet.rank P < o) (tasks : ZFSet.rank I < o) : + ZFSet.rank (data.fields 0) ≤ o := + (data.fieldUnion 0).rank_le + (fun n => (constant.iterate_carrier_ranks M I Sources Reps G T limit points indices templates tasks n).1) + +end GroundCompressionUnionData + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) + +theorem union_original_subset : P0 ⊆ data.fields 0 := by + intro x hx + exact (data.fieldUnion 0).subset 0 (state.invariant.originalSubset hx) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem union_order_iff (n : Nat) {x y : ZFSet.{u}} + (hx : x ∈ (state.data.iterate M I Sources Reps G T n).D) + (hy : y ∈ (state.data.iterate M I Sources Reps G T n).D) : + ZFSet.pair x y ∈ data.fields 1 ↔ ZFSet.pair x y ∈ (state.data.iterate M I Sources Reps G T n).rD := + (data.fieldUnion 1).order_entry_iff + (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation hI hSources hReps hG hT h).2.1) + (fun _ _ h => (state.canonical_iterate_coherent pairing unions powers separation hI hSources hReps hG hT h).order) + n hx hy + +theorem union_meet_iff (n : Nat) {x y z : ZFSet.{u}} + (hx : x ∈ (state.data.iterate M I Sources Reps G T n).D) + (hy : y ∈ (state.data.iterate M I Sources Reps G T n).D) : + ZFSet.pair (ZFSet.pair x y) z ∈ data.fields 2 ↔ + ZFSet.pair (ZFSet.pair x y) z ∈ (state.data.iterate M I Sources Reps G T n).μD := + (data.fieldUnion 2).meet_entry_iff data.meet + (fun n => (state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n).1) n hx hy + +theorem union_action_iff (n : Nat) {g x y : ZFSet.{u}} + (hx : x ∈ (state.data.iterate M I Sources Reps G T n).currentCarrier) : + ZFSet.pair (ZFSet.pair g x) y ∈ data.fields 12 ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ (state.data.iterate M I Sources Reps G T n).A := + (data.fieldUnion 12).action_entry_iff data.action + (fun n => (state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n).2.2.1) n hx + +theorem union_original_order_iff {x y : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : + ZFSet.pair x y ∈ data.fields 1 ↔ ZFSet.pair x y ∈ r0 := + (state.union_order_iff data pairing unions powers separation hI hSources hReps hG hT 0 + (state.invariant.originalSubset hx) (state.invariant.originalSubset hy)).trans + (state.invariant.originalOrder x hx y hy) + +theorem union_original_meet_iff {x y z : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : + ZFSet.pair (ZFSet.pair x y) z ∈ data.fields 2 ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ0 := + (state.union_meet_iff data pairing unions powers separation hI hSources hReps hG hT 0 + (state.invariant.originalSubset hx) (state.invariant.originalSubset hy)).trans + (state.invariant.originalMeet x hx y hy z) + +theorem union_original_action_iff {g x y : ZFSet.{u}} (hx : x ∈ P0) : + ZFSet.pair (ZFSet.pair g x) y ∈ data.fields 12 ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A0 := + (state.union_action_iff data pairing unions powers separation hI hSources hReps hG hT 0 + (old_mem_taggedExtension (state.invariant.originalSubset hx))).trans + (state.invariant.originalAction g x hx y) + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing +universe u + +structure GroundCompressionHeightData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T : ZFSet.{u}) + (union : GroundCompressionUnionData M initial I Sources Reps G m one T) + (P0 C D rD original : ZFSet.{u}) where + family : ZFSet.{u} + family_ground : family ∈ M.sets + function : FunctionGraphOn ZFSet.omega family + zero : function.natValue 0 = original + finite : ∀ n, StrictLexHeightCode (initial.iterate M I Sources Reps G T n).D C D + (initial.iterate M I Sources Reps G T n).rD (function.natValue n) rD + adjacent : ∀ n, function.natValue n ⊆ function.natValue (n + 1) + height : ZFSet.{u} + height_ground : height ∈ M.sets + exact_union : NatUnionCode function.natValue height + code : StrictLexHeightCode (union.fields 0) C D (union.fields 1) height rD + finite_entries : ∀ n x, x ∈ (initial.iterate M I Sources Reps G T n).D → ∀ y, + ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ function.natValue n + original_entries : ∀ x ∈ P0, ∀ y, ZFSet.pair x y ∈ height ↔ ZFSet.pair x y ∈ original + range_ground : relationImage (union.fields 0) (ZFSet.prod C D) height ∈ M.sets + range_countable : M.groundEmbeddable (relationImage (union.fields 0) (ZFSet.prod C D) height) ZFSet.omega + columns : ∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ height → a ∈ heightColumns P0 C D original + + + + + +structure CompressionOriginalData (P r μ A G U u ν B : ZFSet.{u}) : Prop where + subset : P ⊆ U + order : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ u ↔ ZFSet.pair x y ∈ r + meet : ∀ x ∈ P, ∀ y ∈ P, ∀ z, ZFSet.pair (ZFSet.pair x y) z ∈ ν ↔ + ZFSet.pair (ZFSet.pair x y) z ∈ μ + action : ∀ g x, x ∈ P → ∀ y, ZFSet.pair (ZFSet.pair g x) y ∈ B ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A + agreement : ∀ g ∈ G, ∀ h ∈ G, ∀ v ∈ P, ActionAgreementBelow P r A g h v → + ActionAgreementBelow U u B g h v + +namespace GroundCompressionState +open SetFormula +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem union_original_agreement {g h v : ZFSet.{u}} (hg : g ∈ G) (hh : h ∈ G) (hv : v ∈ P0) + (agreement : ActionAgreementBelow P0 r0 A0 g h v) : + ActionAgreementBelow (data.fields 0) (data.fields 1) (data.fields 12) g h v := by + intro x _ y _ below + obtain ⟨n, lower⟩ := (data.currentOrder _).1 below + have codes := state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n + have hx := (ZFSet.pair_mem_prod.1 (codes.2.1.order.relation lower)).1 + have finiteAgreement : ActionAgreementBelow + (state.data.iterate M I Sources Reps G T n).currentCarrier + (state.data.iterate M I Sources Reps G T n).currentOrder + (state.data.iterate M I Sources Reps G T n).A g h v := by + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have agree := current.invariant.agreement g hg h hh v hv agreement + change ActionAgreementBelow current.data.currentCarrier current.data.currentOrder current.data.A g h v at agree + simpa only [equal] using agree + have restrict (k : ZFSet.{u}) := state.union_action_iff data pairing unions powers separation + hI hSources hReps hG hT n (g := k) (y := y) hx + constructor + · intro entry + have first := (restrict g).1 entry + have hy := (ZFSet.pair_mem_prod.1 (codes.2.2.1.function.1 first)).2 + exact (restrict h).2 ((finiteAgreement x hx y hy lower).1 first) + · intro entry + have second := (restrict h).1 entry + have hy := (ZFSet.pair_mem_prod.1 (codes.2.2.1.function.1 second)).2 + exact (restrict g).2 ((finiteAgreement x hx y hy lower).2 second) + +theorem union_original_data : + CompressionOriginalData P0 r0 μ0 A0 G (data.fields 0) (data.fields 1) (data.fields 2) (data.fields 12) := + ⟨state.union_original_subset data, + fun _ hx _ hy => state.union_original_order_iff data pairing unions powers separation hI hSources hReps hG hT hx hy, + fun _ hx _ hy _ => state.union_original_meet_iff data pairing unions powers separation hI hSources hReps hG hT hx hy, + fun _ _ hx _ => state.union_original_action_iff data pairing unions powers separation hI hSources hReps hG hT hx, + fun _ hg _ hh _ hv agree => state.union_original_agreement data pairing unions powers separation + hI hSources hReps hG hT hg hh hv agree⟩ + +end GroundCompressionState + + + + + + +theorem ExternalRectangleCode.lift_compression + {P r μ A G U u ν B m one c b d g h : ZFSet.{u}} + (rectangle : ExternalRectangleCode P G r μ A c b d g h) + (compression : CompressionOriginalData P r μ A G U u ν B) + (action : PosetActionCode G P m one r A) : + ExternalRectangleCode U G u ν B c b d g h := by + obtain ⟨hc, hb, hd, hg, hh, cd, bd, w, hw, cb, agree, separated⟩ := rectangle + refine ⟨compression.subset hc, compression.subset hb, compression.subset hd, hg, hh, + (compression.order c hc d hd).2 cd, (compression.order b hb d hd).2 bd, + w, compression.subset hw, (compression.meet c hc b hb w).2 cb, + compression.agreement g hg h hh w hw agree, ?_⟩ + intro y _ z _ v _ entries + have dy := (compression.action g d hd y).1 entries.1 + have dz := (compression.action h d hd z).1 entries.2.1 + have wv := (compression.action g w hw v).1 entries.2.2 + have hy := (ZFSet.pair_mem_prod.1 (action.function.1 dy)).2 + have hz := (ZFSet.pair_mem_prod.1 (action.function.1 dz)).2 + have hv := (ZFSet.pair_mem_prod.1 (action.function.1 wv)).2 + exact (compression.meet y hy z hz v).2 (separated y hy z hz v hv ⟨dy, dz, wv⟩) + +theorem externalRectangles_subset_compression + {P r μ A G U u ν B m one : ZFSet.{u}} + (compression : CompressionOriginalData P r μ A G U u ν B) + (action : PosetActionCode G P m one r A) : + externalRectangles P G r μ A ⊆ externalRectangles U G u ν B := by + intro x hx + obtain ⟨c, b, d, g, h, rfl, rectangle⟩ := (mem_externalRectangles P G r μ A x).1 hx + exact (externalRectangleCode_mem U G u ν B c b d g h).2 + (rectangle.lift_compression compression action) + + + + + +structure GroundCompressionOrigin (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}) where + seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters + state : GroundCompressionState M seed + initial_data : state.data = initial + +namespace GroundCompressionOrigin +open SetFormula +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) + +include origin in +theorem union_original_data + (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : + CompressionOriginalData P0 r0 μ0 A0 G (data.fields 0) (data.fields 1) (data.fields 2) (data.fields 12) := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + exact state.union_original_data data pairing unions powers separation hI hSources hReps hG hT + +end GroundCompressionOrigin + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStampBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStampBounds.lean index 6b0a081eb63c76f44ede31b90970235fc74bc287..9e01be205d4a35b36a6d83ac755a08fb927f621b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStampBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStampBounds.lean @@ -1,520 +1,520 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInaccessibleOrdinalClosure - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def compressionStamp (base : ZFSet.{u}) : Nat → ZFSet.{u} - | 0 => insert base base - | n + 1 => insert (compressionStamp base n) (compressionStamp base n) - -theorem compressionStamp_zero (base : ZFSet.{u}) : - compressionStamp base 0 = insert base base := rfl - -theorem compressionStamp_succ (base : ZFSet.{u}) (n : Nat) : - compressionStamp base (n + 1) = insert (compressionStamp base n) (compressionStamp base n) := rfl - -theorem compressionStamp_subset (base : ZFSet.{u}) {n m : Nat} (before : n ≤ m) : - compressionStamp base n ⊆ compressionStamp base m := by - induction m, before using Nat.le_induction with - | base => exact fun _ hx => hx - | succ m _ ih => exact fun _ hx => ZFSet.mem_insert_of_mem _ (ih hx) - -theorem compressionStamp_mem_iff (base : ZFSet.{u}) (n m : Nat) : - compressionStamp base n ∈ compressionStamp base m ↔ n < m := by - constructor - · intro member - by_contra notBefore - exact ZFSet.mem_irrefl _ (compressionStamp_subset base (Nat.le_of_not_gt notBefore) member) - · intro before - exact compressionStamp_subset base before (ZFSet.mem_insert _ _) - -theorem compressionStamp_ordinal {base : ZFSet.{u}} (ordinal : ordinalSetProperty base) (n : Nat) : - ordinalSetProperty (compressionStamp base n) := by - induction n with - | zero => exact ordinalSetProperty_succ ordinal - | succ n ih => exact ordinalSetProperty_succ ih - -theorem compressionStamp_base_mem (base : ZFSet.{u}) (n : Nat) : base ∈ compressionStamp base n := - compressionStamp_subset base (Nat.zero_le n) (ZFSet.mem_insert _ _) - -theorem compressionStamp_old_mem {base t : ZFSet.{u}} (old : t ∈ base ∨ t = base) (n : Nat) : - t ∈ compressionStamp base n := by - apply compressionStamp_subset base (Nat.zero_le n) - exact ZFSet.mem_insert_iff.2 old.symm - -theorem compressionStamp_union_ordinal {base limit : ZFSet.{u}} - (ordinal : ordinalSetProperty base) (union : NatUnionCode (compressionStamp base) limit) : - ordinalSetProperty limit := by - constructor - · intro y hy z hz - obtain ⟨n, yn⟩ := (union y).1 hy - exact union.subset n ((compressionStamp_ordinal ordinal n).1 y yn z hz) - · intro y hy - obtain ⟨n, yn⟩ := (union y).1 hy - exact (compressionStamp_ordinal ordinal n).2 y yn - -structure CompressionStampCode (base stamps limit : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc ZFSet.omega limit stamps - entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ stamps ↔ y = compressionStamp base n - union : NatUnionCode (compressionStamp base) limit - ordinal : ordinalSetProperty limit - -namespace CompressionStampCode -variable {base stamps limit : ZFSet.{u}} (code : CompressionStampCode base stamps limit) -include code - -theorem stamp_mem_limit (n : Nat) : compressionStamp base n ∈ limit := - code.union.subset (n + 1) ((compressionStamp_mem_iff base n (n + 1)).2 (Nat.lt_succ_self n)) - -theorem stamp_ne_limit (n : Nat) : compressionStamp base n ≠ limit := by - intro equal - exact ZFSet.mem_irrefl limit (equal ▸ code.stamp_mem_limit n) - -theorem base_mem_limit : base ∈ limit := code.union.subset 0 (compressionStamp_base_mem base 0) - -theorem value_ordinal (n : Nat) : ordinalSetProperty (compressionStamp base n) := - ordinalSetProperty_member code.ordinal (code.stamp_mem_limit n) - -theorem entry_below_limit {n : Nat} {value : ZFSet.{u}} - (entry : ZFSet.pair (natSetCode n) value ∈ stamps) : value ∈ limit ∧ value ≠ limit := by - rw [(code.entries n value).1 entry] - exact ⟨code.stamp_mem_limit n, code.stamp_ne_limit n⟩ - -end CompressionStampCode - - - - - -theorem mem_compressionStamp_iff (base s : ZFSet.{u}) (n : Nat) : - s ∈ compressionStamp base n ↔ - s ∈ base ∨ s = base ∨ ∃ m, m < n ∧ s = compressionStamp base m := by - induction n with - | zero => - rw [compressionStamp_zero, ZFSet.mem_insert_iff] - simp only [Nat.not_lt_zero, false_and, exists_false, or_false] - exact or_comm - | succ n ih => - rw [compressionStamp_succ, ZFSet.mem_insert_iff, ih] - constructor - · rintro (equal | old | equal | ⟨m, before, equal⟩) - · exact Or.inr (Or.inr ⟨n, Nat.lt_succ_self n, equal⟩) - · exact Or.inl old - · exact Or.inr (Or.inl equal) - · exact Or.inr (Or.inr ⟨m, before.trans (Nat.lt_succ_self n), equal⟩) - · rintro (old | equal | ⟨m, before, equal⟩) - · exact Or.inr (Or.inl old) - · exact Or.inr (Or.inr (Or.inl equal)) - · rcases lt_or_eq_of_le (Nat.le_of_lt_succ before) with lower | same - · exact Or.inr (Or.inr (Or.inr ⟨m, lower, equal⟩)) - · exact Or.inl (same ▸ equal) - -theorem compressionStamp_not_old (base : ZFSet.{u}) (n : Nat) : - compressionStamp base n ∉ base ∧ compressionStamp base n ≠ base := by - constructor - · exact fun member => ZFSet.mem_asymm member (compressionStamp_base_mem base n) - · intro equal - have member := compressionStamp_base_mem base n - rw [equal] at member - exact ZFSet.mem_irrefl base member - -theorem old_ne_compressionStamp {base s : ZFSet.{u}} (old : s ∈ base ∨ s = base) (n : Nat) : - s ≠ compressionStamp base n := by - intro equal - rcases old with member | same - · exact (compressionStamp_not_old base n).1 (equal ▸ member) - · exact (compressionStamp_not_old base n).2 (equal.symm.trans same) - -theorem compressionStamp_injective (base : ZFSet.{u}) : Function.Injective (compressionStamp base) := by - intro n m equal - rcases lt_trichotomy n m with before | same | after - · have member := (compressionStamp_mem_iff base n m).2 before - exact False.elim (ZFSet.mem_irrefl _ (equal ▸ member)) - · exact same - · have member := (compressionStamp_mem_iff base m n).2 after - exact False.elim (ZFSet.mem_irrefl _ (equal ▸ member)) - -namespace CompressionStampCode -variable {base stamps limit : ZFSet.{u}} (code : CompressionStampCode base stamps limit) -include code - -theorem mem_limit_iff (s : ZFSet.{u}) : - s ∈ limit ↔ s ∈ base ∨ s = base ∨ ∃ n, s = compressionStamp base n := by - constructor - · intro member - obtain ⟨n, before⟩ := (code.union s).1 member - rcases (mem_compressionStamp_iff base s n).1 before with old | same | ⟨m, _, equal⟩ - · exact Or.inl old - · exact Or.inr (Or.inl same) - · exact Or.inr (Or.inr ⟨m, equal⟩) - · rintro (old | same | ⟨n, equal⟩) - · exact code.union.subset 0 (compressionStamp_old_mem (Or.inl old) 0) - · exact same ▸ code.base_mem_limit - · exact equal ▸ code.stamp_mem_limit n - -end CompressionStampCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open scoped ZFSet -universe u - -namespace FunctionGraphOn -variable {family : ZFSet.{u}} - -noncomputable def natValue (function : FunctionGraphOn ZFSet.omega family) (n : Nat) : ZFSet.{u} := - function.value ⟨natSetCode n, natSetCode_mem_omega n⟩ - -theorem natValue_entry (function : FunctionGraphOn ZFSet.omega family) (n : Nat) : - ZFSet.pair (natSetCode n) (function.natValue n) ∈ family := - function.value_entry ⟨natSetCode n, natSetCode_mem_omega n⟩ - -theorem natValue_entry_iff (function : FunctionGraphOn ZFSet.omega family) (n : Nat) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode n) y ∈ family ↔ y = function.natValue n := by - constructor - · exact fun entry => function.unique entry (function.natValue_entry n) - · exact fun equal => equal.symm ▸ function.natValue_entry n - -end FunctionGraphOn - -noncomputable def naturalFamilyUnion (family : ZFSet.{u}) : ZFSet.{u} := - ⋃₀ relationImage ZFSet.omega (⋃₀ ⋃₀ family) family - -theorem naturalFamilyUnion_code {family : ZFSet.{u}} - (function : FunctionGraphOn ZFSet.omega family) : - NatUnionCode function.natValue (naturalFamilyUnion family) := by - intro x - rw [naturalFamilyUnion, ZFSet.mem_sUnion] - constructor - · rintro ⟨value, member, hx⟩ - obtain ⟨_, index, hi, entry⟩ := (mem_relationImage _ _ _ value).1 member - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode index).1 hi - exact ⟨n, ((function.natValue_entry_iff n value).1 entry) ▸ hx⟩ - · rintro ⟨n, hx⟩ - have entry := function.natValue_entry n - exact ⟨function.natValue n, (mem_relationImage _ _ _ _).2 - ⟨pair_second_mem_doubleUnion entry, natSetCode n, natSetCode_mem_omega n, entry⟩, hx⟩ - -namespace TransitiveGround -open SetFormula - -theorem naturalFamilyUnion_mem (M : TransitiveGround.{u}) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) {family : ZFSet.{u}} (hFamily : family ∈ M.sets) : - naturalFamilyUnion family ∈ M.sets := - M.union_mem unions (M.relationImage_mem separation hω - (M.union_mem unions (M.union_mem unions hFamily)) hFamily) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_naturalStep_zero {k : Nat} (φ : SetFormula (k + 2)) - (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) - {p y base : ZFSet.{u}} (hzero : natSetCode 0 ∈ M.sets) - (hp : p ∈ M.sets) (hy : y ∈ M.sets) (hb : base ∈ M.sets) : - Realize M.sets (naturalStepFormula φ) - (extend (natSetCode 0) (extend p (extend y (extend base params)))) ↔ y = base := by - rw [M.realize_naturalStepFormula φ params members hzero hp hy hb] - constructor - · rintro (⟨_, equal⟩ | ⟨m, _, x, _, equal, _⟩) - · exact equal - · have impossible : m ∈ natSetCode 0 := equal.symm ▸ ZFSet.mem_insert m m - exact False.elim (ZFSet.notMem_empty m impossible) - · intro equal - exact Or.inl ⟨rfl, equal⟩ - -theorem realize_naturalStep_succ {k : Nat} (φ : SetFormula (k + 2)) - (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) - (n : Nat) {p y base : ZFSet.{u}} (hn : natSetCode n ∈ M.sets) - (hnext : natSetCode (n + 1) ∈ M.sets) - (hp : p ∈ M.sets) (hy : y ∈ M.sets) (hb : base ∈ M.sets) : - Realize M.sets (naturalStepFormula φ) - (extend (natSetCode (n + 1)) (extend p (extend y (extend base params)))) ↔ - ∃ x ∈ M.sets, ZFSet.pair (natSetCode n) x ∈ p ∧ - Realize M.sets φ (extend x (extend y params)) := by - rw [M.realize_naturalStepFormula φ params members hnext hp hy hb] - constructor - · rintro (⟨empty, _⟩ | ⟨m, _, x, hx, equal, entry, next⟩) - · exact False.elim (ZFSet.notMem_empty (natSetCode n) - (empty ▸ ZFSet.mem_insert (natSetCode n) (natSetCode n))) - · have same := (natSetCode_succ_eq_insert_iff n m).1 equal - exact ⟨x, hx, same ▸ entry, next⟩ - · rintro ⟨x, hx, entry, next⟩ - exact Or.inr ⟨natSetCode n, hn, x, hx, rfl, entry, next⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable {k : Nat} (φ : SetFormula (k + 2)) (params : Fin k → ZFSet.{u}) -variable (members : ∀ i, params i ∈ M.sets) -variable (value : Nat → ZFSet.{u}) (values : ∀ n, value n ∈ M.sets) -variable (nextValue : ∀ n y, y ∈ M.sets → - (Realize M.sets φ (extend (value n) (extend y params)) ↔ y = value (n + 1))) - -include members values nextValue - -theorem definableNaturalTrace_value {N t : ZFSet.{u}} (hN : N ∈ M.sets) - (ordinal : ordinalSetProperty N) - (trace : OrdinalRecursionTrace - (groundRecursionStep M (naturalStepFormula φ) (extend (value 0) params)) N t) : - ∀ n, natSetCode n ∈ N → ∀ y, ZFSet.pair (natSetCode n) y ∈ t → y = value n := by - intro n - induction n with - | zero => - intro hn y entry - obtain ⟨hp, hy, relation⟩ := trace.2 _ hn y entry - exact (M.realize_naturalStep_zero φ params members (M.transitive hN hn) - hp hy (values 0)).1 relation - | succ n ih => - intro hn y entry - have previous : natSetCode n ∈ natSetCode (n + 1) := - (natSetCode_mem_iff n (n + 1)).2 (Nat.lt_succ_self n) - have hnN := ordinal.1 _ hn _ previous - obtain ⟨hp, hy, relation⟩ := trace.2 _ hn y entry - obtain ⟨x, _, oldEntry, next⟩ := (M.realize_naturalStep_succ φ params members n - (M.transitive hN hnN) (M.transitive hN hn) hp hy (values 0)).1 relation - have equal := ih hnN x (pair_mem_graphRestriction.1 oldEntry).1 - rw [equal] at next - exact (nextValue n y hy).1 next - -theorem definableNaturalStepClosure (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) : - GroundOrdinalStepClosure M ZFSet.omega (naturalStepFormula φ) (extend (value 0) params) := by - intro a ha p hp trace - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha - have hn (j : Nat) : natSetCode j ∈ M.sets := M.transitive hω (natSetCode_mem_omega j) - cases n with - | zero => - refine ⟨value 0, values 0, - (M.realize_naturalStep_zero φ params members (hn 0) hp (values 0) (values 0)).2 rfl, ?_⟩ - intro y hy relation - exact (M.realize_naturalStep_zero φ params members (hn 0) hp hy (values 0)).1 relation - | succ n => - have previous : natSetCode n ∈ natSetCode (n + 1) := - (natSetCode_mem_iff n (n + 1)).2 (Nat.lt_succ_self n) - have ordinal : ordinalSetProperty (natSetCode (n + 1) : ZFSet.{u}) := by - rw [← ordinalCode_nat] - exact ordinalSetProperty_ordinalCode _ - have entryValue := M.definableNaturalTrace_value φ params members value values nextValue - (hn (n + 1)) ordinal trace - obtain ⟨x, entry⟩ := trace.1.total previous - have equal := entryValue n previous x entry - have canonical : ZFSet.pair (natSetCode n) (value n) ∈ p := equal ▸ entry - refine ⟨value (n + 1), values (n + 1), ?_, ?_⟩ - · exact (M.realize_naturalStep_succ φ params members n (hn n) (hn (n + 1)) - hp (values (n + 1)) (values 0)).2 - ⟨value n, values n, canonical, (nextValue n _ (values (n + 1))).2 rfl⟩ - · intro y hy relation - obtain ⟨x, _, oldEntry, next⟩ := (M.realize_naturalStep_succ φ params members n - (hn n) (hn (n + 1)) hp hy (values 0)).1 relation - have same := entryValue n previous x oldEntry - rw [same] at next - exact (nextValue n y hy).1 next - -theorem exists_definableNaturalHistory - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : - ∃ history ∈ M.sets, - OrdinalRecursionTrace - (groundRecursionStep M (naturalStepFormula φ) (extend (value 0) params)) - ZFSet.omega history ∧ - (∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = value n) ∧ - (∀ other, OrdinalRecursionTrace - (groundRecursionStep M (naturalStepFormula φ) (extend (value 0) params)) - ZFSet.omega other → other = history) := by - have hω := M.omega_mem separation infinite - have ordinal : ordinalSetProperty (ZFSet.omega : ZFSet.{u}) := by - rw [← ordinalCode_omega] - exact ordinalSetProperty_ordinalCode Ordinal.omega0 - obtain ⟨history, hh, trace, unique, _⟩ := M.exists_unique_ordinalRecursionTrace pairing unions - separation collection hω ordinal (naturalStepFormula φ) (extend (value 0) params) - (Fin.cases (values 0) members) - (M.definableNaturalStepClosure φ params members value values nextValue hω) - refine ⟨history, hh, trace, ?_, unique⟩ - intro n y - have hn := natSetCode_mem_omega n - have entryValue := M.definableNaturalTrace_value φ params members value values nextValue - hω ordinal trace - constructor - · exact entryValue n hn y - · intro equal - obtain ⟨z, entry⟩ := trace.1.total hn - exact equal.symm ▸ (entryValue n hn z entry ▸ entry) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem compressionStamp_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {base : ZFSet.{u}} (hBase : base ∈ M.sets) (n : Nat) : - compressionStamp base n ∈ M.sets := by - induction n with - | zero => exact M.insert_mem pairing unions hBase hBase - | succ n ih => exact M.insert_mem pairing unions ih ih - -theorem exists_groundCompressionStamps - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {base : ZFSet.{u}} (hBase : base ∈ M.sets) (ordinal : ordinalSetProperty base) : - ∃ stamps ∈ M.sets, ∃ limit ∈ M.sets, - limit = naturalFamilyUnion stamps ∧ CompressionStampCode base stamps limit := by - let formula : SetFormula 2 := (BoundedFormula.successorFormula 1 0).toFormula - have values : ∀ n, compressionStamp base n ∈ M.sets := M.compressionStamp_mem pairing unions hBase - have nextValue : ∀ n y, y ∈ M.sets → - (Realize M.sets formula (extend (compressionStamp base n) (extend y Fin.elim0)) ↔ - y = compressionStamp base (n + 1)) := by - intro n y hy - exact (BoundedFormula.realize_toFormula M (BoundedFormula.successorFormula 1 0) - (extend (compressionStamp base n) (extend y Fin.elim0)) - (Fin.cases (values n) (Fin.cases hy (fun i => Fin.elim0 i)))).trans - (BoundedFormula.truth_successorFormula 1 0 _) - obtain ⟨stamps, hStamps, trace, entries, _⟩ := - M.exists_definableNaturalHistory formula Fin.elim0 (fun i => Fin.elim0 i) - (compressionStamp base) values nextValue pairing unions separation collection infinite - have valueEq (n : Nat) : trace.1.natValue n = compressionStamp base n := - (entries n _).1 (trace.1.natValue_entry n) - have unionCode : NatUnionCode (compressionStamp base) (naturalFamilyUnion stamps) := by - intro x - simpa only [valueEq] using (naturalFamilyUnion_code trace.1 x) - have stampBelow (n : Nat) : compressionStamp base n ∈ naturalFamilyUnion stamps := - unionCode.subset (n + 1) (ZFSet.mem_insert _ _) - refine ⟨stamps, hStamps, naturalFamilyUnion stamps, - M.naturalFamilyUnion_mem unions separation (M.omega_mem separation infinite) hStamps, rfl, - ⟨⟨?_, ?_⟩, entries, unionCode, compressionStamp_union_ordinal ordinal unionCode⟩⟩ - · intro z hz - obtain ⟨i, hi, y, rfl⟩ := trace.1.shape z hz - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 hi - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, (entries n y).1 hz ▸ stampBelow n⟩ - · obtain ⟨_, function⟩ := trace.1 - exact function.2 - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -namespace CompressionStampCode -variable {base stamps limit K : ZFSet.{u}} (code : CompressionStampCode base stamps limit) -include code - -theorem function_into_bound (values : ∀ n, compressionStamp base n ∈ K) : - ZFSet.IsFunc ZFSet.omega K stamps := by - refine ⟨?_, code.function.2⟩ - intro z hz - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, (code.entries n y).1 hz ▸ values n⟩ - -theorem successor_mem_limit {a : ZFSet.{u}} (ha : a ∈ limit) : insert a a ∈ limit := by - obtain ⟨n, member⟩ := (code.union a).1 ha - rw [ordinalSetProperty_eq_code_rank a (ordinalSetProperty_member code.ordinal ha), - ← ordinalCode_succ, ordinalSetProperty_eq_code_rank limit code.ordinal, mem_ordinalCode_iff] - exact (Order.succ_le_iff.2 (ZFSet.rank_lt_of_mem member)).trans_lt - (ZFSet.rank_lt_of_mem (code.stamp_mem_limit n)) - -theorem rank_isLimit : Order.IsSuccLimit (ZFSet.rank limit) := by - apply Order.isSuccLimit_iff_of_orderBot.2 - refine ⟨ne_of_gt (bot_le.trans_lt (ZFSet.rank_lt_of_mem code.base_mem_limit)), ?_⟩ - rw [Order.isSuccPrelimit_iff_succ_lt] - intro a ha - have member : ordinalCode a ∈ limit := by - rw [ordinalSetProperty_eq_code_rank limit code.ordinal, mem_ordinalCode_iff] - exact ha - have bound := ZFSet.rank_lt_of_mem (code.successor_mem_limit member) - rw [← ordinalCode_succ, rank_ordinalCode] at bound - exact bound - -end CompressionStampCode - -namespace GroundInaccessibleConditions -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) -include conditions pairing unions powers separation infinite hK - -theorem compressionStamp_mem {base : ZFSet.{u}} (hBase : base ∈ K) (n : Nat) : - compressionStamp base n ∈ K := by - induction n with - | zero => exact conditions.successor_mem pairing unions powers separation infinite hK hBase - | succ n ih => exact conditions.successor_mem pairing unions powers separation infinite hK ih - -theorem compressionStamp_limit_mem {base stamps limit : ZFSet.{u}} - (code : CompressionStampCode base stamps limit) (hBase : base ∈ K) - (hStamps : stamps ∈ M.sets) : limit ∈ K := by - have values := conditions.compressionStamp_mem pairing unions powers separation infinite hK hBase - obtain ⟨δ, hδ, bounded⟩ := conditions.2.2.1 ZFSet.omega conditions.2.1 stamps hStamps - (code.function_into_bound values) - have subset : limit ⊆ δ := by - intro x hx - obtain ⟨n, member⟩ := (code.union x).1 hx - exact (ordinalSetProperty_member conditions.1 hδ).1 (compressionStamp base n) - (bounded _ _ ((code.entries n _).2 rfl)) x member - obtain ⟨l, eqLimit⟩ := (ordinalSetProperty_iff limit).1 code.ordinal - obtain ⟨d, eqDelta⟩ := (ordinalSetProperty_iff δ).1 (ordinalSetProperty_member conditions.1 hδ) - obtain ⟨k, eqK⟩ := (ordinalSetProperty_iff K).1 conditions.1 - rw [eqLimit, eqDelta, ordinalCode_subset_iff] at subset - rw [eqDelta, eqK, mem_ordinalCode_iff] at hδ - rw [eqLimit, eqK, mem_ordinalCode_iff] - exact subset.trans_lt hδ - -end GroundInaccessibleConditions - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundCompressionStamps_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K base : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (hBase : base ∈ K) : - ∃ stamps ∈ M.sets, ∃ limit ∈ M.sets, - limit = naturalFamilyUnion stamps ∧ CompressionStampCode base stamps limit ∧ - limit ∈ K ∧ Order.IsSuccLimit (ZFSet.rank limit) ∧ base ∈ limit := by - obtain ⟨stamps, hStamps, limit, hLimit, equal, code⟩ := - M.exists_groundCompressionStamps pairing unions separation collection infinite - (M.transitive hK hBase) (ordinalSetProperty_member conditions.1 hBase) - exact ⟨stamps, hStamps, limit, hLimit, equal, code, - conditions.compressionStamp_limit_mem pairing unions powers separation infinite hK code hBase hStamps, - code.rank_isLimit, code.base_mem_limit⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInaccessibleOrdinalClosure + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def compressionStamp (base : ZFSet.{u}) : Nat → ZFSet.{u} + | 0 => insert base base + | n + 1 => insert (compressionStamp base n) (compressionStamp base n) + +theorem compressionStamp_zero (base : ZFSet.{u}) : + compressionStamp base 0 = insert base base := rfl + +theorem compressionStamp_succ (base : ZFSet.{u}) (n : Nat) : + compressionStamp base (n + 1) = insert (compressionStamp base n) (compressionStamp base n) := rfl + +theorem compressionStamp_subset (base : ZFSet.{u}) {n m : Nat} (before : n ≤ m) : + compressionStamp base n ⊆ compressionStamp base m := by + induction m, before using Nat.le_induction with + | base => exact fun _ hx => hx + | succ m _ ih => exact fun _ hx => ZFSet.mem_insert_of_mem _ (ih hx) + +theorem compressionStamp_mem_iff (base : ZFSet.{u}) (n m : Nat) : + compressionStamp base n ∈ compressionStamp base m ↔ n < m := by + constructor + · intro member + by_contra notBefore + exact ZFSet.mem_irrefl _ (compressionStamp_subset base (Nat.le_of_not_gt notBefore) member) + · intro before + exact compressionStamp_subset base before (ZFSet.mem_insert _ _) + +theorem compressionStamp_ordinal {base : ZFSet.{u}} (ordinal : ordinalSetProperty base) (n : Nat) : + ordinalSetProperty (compressionStamp base n) := by + induction n with + | zero => exact ordinalSetProperty_succ ordinal + | succ n ih => exact ordinalSetProperty_succ ih + +theorem compressionStamp_base_mem (base : ZFSet.{u}) (n : Nat) : base ∈ compressionStamp base n := + compressionStamp_subset base (Nat.zero_le n) (ZFSet.mem_insert _ _) + +theorem compressionStamp_old_mem {base t : ZFSet.{u}} (old : t ∈ base ∨ t = base) (n : Nat) : + t ∈ compressionStamp base n := by + apply compressionStamp_subset base (Nat.zero_le n) + exact ZFSet.mem_insert_iff.2 old.symm + +theorem compressionStamp_union_ordinal {base limit : ZFSet.{u}} + (ordinal : ordinalSetProperty base) (union : NatUnionCode (compressionStamp base) limit) : + ordinalSetProperty limit := by + constructor + · intro y hy z hz + obtain ⟨n, yn⟩ := (union y).1 hy + exact union.subset n ((compressionStamp_ordinal ordinal n).1 y yn z hz) + · intro y hy + obtain ⟨n, yn⟩ := (union y).1 hy + exact (compressionStamp_ordinal ordinal n).2 y yn + +structure CompressionStampCode (base stamps limit : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc ZFSet.omega limit stamps + entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ stamps ↔ y = compressionStamp base n + union : NatUnionCode (compressionStamp base) limit + ordinal : ordinalSetProperty limit + +namespace CompressionStampCode +variable {base stamps limit : ZFSet.{u}} (code : CompressionStampCode base stamps limit) +include code + +theorem stamp_mem_limit (n : Nat) : compressionStamp base n ∈ limit := + code.union.subset (n + 1) ((compressionStamp_mem_iff base n (n + 1)).2 (Nat.lt_succ_self n)) + +theorem stamp_ne_limit (n : Nat) : compressionStamp base n ≠ limit := by + intro equal + exact ZFSet.mem_irrefl limit (equal ▸ code.stamp_mem_limit n) + +theorem base_mem_limit : base ∈ limit := code.union.subset 0 (compressionStamp_base_mem base 0) + +theorem value_ordinal (n : Nat) : ordinalSetProperty (compressionStamp base n) := + ordinalSetProperty_member code.ordinal (code.stamp_mem_limit n) + +theorem entry_below_limit {n : Nat} {value : ZFSet.{u}} + (entry : ZFSet.pair (natSetCode n) value ∈ stamps) : value ∈ limit ∧ value ≠ limit := by + rw [(code.entries n value).1 entry] + exact ⟨code.stamp_mem_limit n, code.stamp_ne_limit n⟩ + +end CompressionStampCode + + + + + +theorem mem_compressionStamp_iff (base s : ZFSet.{u}) (n : Nat) : + s ∈ compressionStamp base n ↔ + s ∈ base ∨ s = base ∨ ∃ m, m < n ∧ s = compressionStamp base m := by + induction n with + | zero => + rw [compressionStamp_zero, ZFSet.mem_insert_iff] + simp only [Nat.not_lt_zero, false_and, exists_false, or_false] + exact or_comm + | succ n ih => + rw [compressionStamp_succ, ZFSet.mem_insert_iff, ih] + constructor + · rintro (equal | old | equal | ⟨m, before, equal⟩) + · exact Or.inr (Or.inr ⟨n, Nat.lt_succ_self n, equal⟩) + · exact Or.inl old + · exact Or.inr (Or.inl equal) + · exact Or.inr (Or.inr ⟨m, before.trans (Nat.lt_succ_self n), equal⟩) + · rintro (old | equal | ⟨m, before, equal⟩) + · exact Or.inr (Or.inl old) + · exact Or.inr (Or.inr (Or.inl equal)) + · rcases lt_or_eq_of_le (Nat.le_of_lt_succ before) with lower | same + · exact Or.inr (Or.inr (Or.inr ⟨m, lower, equal⟩)) + · exact Or.inl (same ▸ equal) + +theorem compressionStamp_not_old (base : ZFSet.{u}) (n : Nat) : + compressionStamp base n ∉ base ∧ compressionStamp base n ≠ base := by + constructor + · exact fun member => ZFSet.mem_asymm member (compressionStamp_base_mem base n) + · intro equal + have member := compressionStamp_base_mem base n + rw [equal] at member + exact ZFSet.mem_irrefl base member + +theorem old_ne_compressionStamp {base s : ZFSet.{u}} (old : s ∈ base ∨ s = base) (n : Nat) : + s ≠ compressionStamp base n := by + intro equal + rcases old with member | same + · exact (compressionStamp_not_old base n).1 (equal ▸ member) + · exact (compressionStamp_not_old base n).2 (equal.symm.trans same) + +theorem compressionStamp_injective (base : ZFSet.{u}) : Function.Injective (compressionStamp base) := by + intro n m equal + rcases lt_trichotomy n m with before | same | after + · have member := (compressionStamp_mem_iff base n m).2 before + exact False.elim (ZFSet.mem_irrefl _ (equal ▸ member)) + · exact same + · have member := (compressionStamp_mem_iff base m n).2 after + exact False.elim (ZFSet.mem_irrefl _ (equal ▸ member)) + +namespace CompressionStampCode +variable {base stamps limit : ZFSet.{u}} (code : CompressionStampCode base stamps limit) +include code + +theorem mem_limit_iff (s : ZFSet.{u}) : + s ∈ limit ↔ s ∈ base ∨ s = base ∨ ∃ n, s = compressionStamp base n := by + constructor + · intro member + obtain ⟨n, before⟩ := (code.union s).1 member + rcases (mem_compressionStamp_iff base s n).1 before with old | same | ⟨m, _, equal⟩ + · exact Or.inl old + · exact Or.inr (Or.inl same) + · exact Or.inr (Or.inr ⟨m, equal⟩) + · rintro (old | same | ⟨n, equal⟩) + · exact code.union.subset 0 (compressionStamp_old_mem (Or.inl old) 0) + · exact same ▸ code.base_mem_limit + · exact equal ▸ code.stamp_mem_limit n + +end CompressionStampCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open scoped ZFSet +universe u + +namespace FunctionGraphOn +variable {family : ZFSet.{u}} + +noncomputable def natValue (function : FunctionGraphOn ZFSet.omega family) (n : Nat) : ZFSet.{u} := + function.value ⟨natSetCode n, natSetCode_mem_omega n⟩ + +theorem natValue_entry (function : FunctionGraphOn ZFSet.omega family) (n : Nat) : + ZFSet.pair (natSetCode n) (function.natValue n) ∈ family := + function.value_entry ⟨natSetCode n, natSetCode_mem_omega n⟩ + +theorem natValue_entry_iff (function : FunctionGraphOn ZFSet.omega family) (n : Nat) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode n) y ∈ family ↔ y = function.natValue n := by + constructor + · exact fun entry => function.unique entry (function.natValue_entry n) + · exact fun equal => equal.symm ▸ function.natValue_entry n + +end FunctionGraphOn + +noncomputable def naturalFamilyUnion (family : ZFSet.{u}) : ZFSet.{u} := + ⋃₀ relationImage ZFSet.omega (⋃₀ ⋃₀ family) family + +theorem naturalFamilyUnion_code {family : ZFSet.{u}} + (function : FunctionGraphOn ZFSet.omega family) : + NatUnionCode function.natValue (naturalFamilyUnion family) := by + intro x + rw [naturalFamilyUnion, ZFSet.mem_sUnion] + constructor + · rintro ⟨value, member, hx⟩ + obtain ⟨_, index, hi, entry⟩ := (mem_relationImage _ _ _ value).1 member + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode index).1 hi + exact ⟨n, ((function.natValue_entry_iff n value).1 entry) ▸ hx⟩ + · rintro ⟨n, hx⟩ + have entry := function.natValue_entry n + exact ⟨function.natValue n, (mem_relationImage _ _ _ _).2 + ⟨pair_second_mem_doubleUnion entry, natSetCode n, natSetCode_mem_omega n, entry⟩, hx⟩ + +namespace TransitiveGround +open SetFormula + +theorem naturalFamilyUnion_mem (M : TransitiveGround.{u}) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) {family : ZFSet.{u}} (hFamily : family ∈ M.sets) : + naturalFamilyUnion family ∈ M.sets := + M.union_mem unions (M.relationImage_mem separation hω + (M.union_mem unions (M.union_mem unions hFamily)) hFamily) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_naturalStep_zero {k : Nat} (φ : SetFormula (k + 2)) + (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) + {p y base : ZFSet.{u}} (hzero : natSetCode 0 ∈ M.sets) + (hp : p ∈ M.sets) (hy : y ∈ M.sets) (hb : base ∈ M.sets) : + Realize M.sets (naturalStepFormula φ) + (extend (natSetCode 0) (extend p (extend y (extend base params)))) ↔ y = base := by + rw [M.realize_naturalStepFormula φ params members hzero hp hy hb] + constructor + · rintro (⟨_, equal⟩ | ⟨m, _, x, _, equal, _⟩) + · exact equal + · have impossible : m ∈ natSetCode 0 := equal.symm ▸ ZFSet.mem_insert m m + exact False.elim (ZFSet.notMem_empty m impossible) + · intro equal + exact Or.inl ⟨rfl, equal⟩ + +theorem realize_naturalStep_succ {k : Nat} (φ : SetFormula (k + 2)) + (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) + (n : Nat) {p y base : ZFSet.{u}} (hn : natSetCode n ∈ M.sets) + (hnext : natSetCode (n + 1) ∈ M.sets) + (hp : p ∈ M.sets) (hy : y ∈ M.sets) (hb : base ∈ M.sets) : + Realize M.sets (naturalStepFormula φ) + (extend (natSetCode (n + 1)) (extend p (extend y (extend base params)))) ↔ + ∃ x ∈ M.sets, ZFSet.pair (natSetCode n) x ∈ p ∧ + Realize M.sets φ (extend x (extend y params)) := by + rw [M.realize_naturalStepFormula φ params members hnext hp hy hb] + constructor + · rintro (⟨empty, _⟩ | ⟨m, _, x, hx, equal, entry, next⟩) + · exact False.elim (ZFSet.notMem_empty (natSetCode n) + (empty ▸ ZFSet.mem_insert (natSetCode n) (natSetCode n))) + · have same := (natSetCode_succ_eq_insert_iff n m).1 equal + exact ⟨x, hx, same ▸ entry, next⟩ + · rintro ⟨x, hx, entry, next⟩ + exact Or.inr ⟨natSetCode n, hn, x, hx, rfl, entry, next⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable {k : Nat} (φ : SetFormula (k + 2)) (params : Fin k → ZFSet.{u}) +variable (members : ∀ i, params i ∈ M.sets) +variable (value : Nat → ZFSet.{u}) (values : ∀ n, value n ∈ M.sets) +variable (nextValue : ∀ n y, y ∈ M.sets → + (Realize M.sets φ (extend (value n) (extend y params)) ↔ y = value (n + 1))) + +include members values nextValue + +theorem definableNaturalTrace_value {N t : ZFSet.{u}} (hN : N ∈ M.sets) + (ordinal : ordinalSetProperty N) + (trace : OrdinalRecursionTrace + (groundRecursionStep M (naturalStepFormula φ) (extend (value 0) params)) N t) : + ∀ n, natSetCode n ∈ N → ∀ y, ZFSet.pair (natSetCode n) y ∈ t → y = value n := by + intro n + induction n with + | zero => + intro hn y entry + obtain ⟨hp, hy, relation⟩ := trace.2 _ hn y entry + exact (M.realize_naturalStep_zero φ params members (M.transitive hN hn) + hp hy (values 0)).1 relation + | succ n ih => + intro hn y entry + have previous : natSetCode n ∈ natSetCode (n + 1) := + (natSetCode_mem_iff n (n + 1)).2 (Nat.lt_succ_self n) + have hnN := ordinal.1 _ hn _ previous + obtain ⟨hp, hy, relation⟩ := trace.2 _ hn y entry + obtain ⟨x, _, oldEntry, next⟩ := (M.realize_naturalStep_succ φ params members n + (M.transitive hN hnN) (M.transitive hN hn) hp hy (values 0)).1 relation + have equal := ih hnN x (pair_mem_graphRestriction.1 oldEntry).1 + rw [equal] at next + exact (nextValue n y hy).1 next + +theorem definableNaturalStepClosure (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) : + GroundOrdinalStepClosure M ZFSet.omega (naturalStepFormula φ) (extend (value 0) params) := by + intro a ha p hp trace + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha + have hn (j : Nat) : natSetCode j ∈ M.sets := M.transitive hω (natSetCode_mem_omega j) + cases n with + | zero => + refine ⟨value 0, values 0, + (M.realize_naturalStep_zero φ params members (hn 0) hp (values 0) (values 0)).2 rfl, ?_⟩ + intro y hy relation + exact (M.realize_naturalStep_zero φ params members (hn 0) hp hy (values 0)).1 relation + | succ n => + have previous : natSetCode n ∈ natSetCode (n + 1) := + (natSetCode_mem_iff n (n + 1)).2 (Nat.lt_succ_self n) + have ordinal : ordinalSetProperty (natSetCode (n + 1) : ZFSet.{u}) := by + rw [← ordinalCode_nat] + exact ordinalSetProperty_ordinalCode _ + have entryValue := M.definableNaturalTrace_value φ params members value values nextValue + (hn (n + 1)) ordinal trace + obtain ⟨x, entry⟩ := trace.1.total previous + have equal := entryValue n previous x entry + have canonical : ZFSet.pair (natSetCode n) (value n) ∈ p := equal ▸ entry + refine ⟨value (n + 1), values (n + 1), ?_, ?_⟩ + · exact (M.realize_naturalStep_succ φ params members n (hn n) (hn (n + 1)) + hp (values (n + 1)) (values 0)).2 + ⟨value n, values n, canonical, (nextValue n _ (values (n + 1))).2 rfl⟩ + · intro y hy relation + obtain ⟨x, _, oldEntry, next⟩ := (M.realize_naturalStep_succ φ params members n + (hn n) (hn (n + 1)) hp hy (values 0)).1 relation + have same := entryValue n previous x oldEntry + rw [same] at next + exact (nextValue n y hy).1 next + +theorem exists_definableNaturalHistory + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : + ∃ history ∈ M.sets, + OrdinalRecursionTrace + (groundRecursionStep M (naturalStepFormula φ) (extend (value 0) params)) + ZFSet.omega history ∧ + (∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = value n) ∧ + (∀ other, OrdinalRecursionTrace + (groundRecursionStep M (naturalStepFormula φ) (extend (value 0) params)) + ZFSet.omega other → other = history) := by + have hω := M.omega_mem separation infinite + have ordinal : ordinalSetProperty (ZFSet.omega : ZFSet.{u}) := by + rw [← ordinalCode_omega] + exact ordinalSetProperty_ordinalCode Ordinal.omega0 + obtain ⟨history, hh, trace, unique, _⟩ := M.exists_unique_ordinalRecursionTrace pairing unions + separation collection hω ordinal (naturalStepFormula φ) (extend (value 0) params) + (Fin.cases (values 0) members) + (M.definableNaturalStepClosure φ params members value values nextValue hω) + refine ⟨history, hh, trace, ?_, unique⟩ + intro n y + have hn := natSetCode_mem_omega n + have entryValue := M.definableNaturalTrace_value φ params members value values nextValue + hω ordinal trace + constructor + · exact entryValue n hn y + · intro equal + obtain ⟨z, entry⟩ := trace.1.total hn + exact equal.symm ▸ (entryValue n hn z entry ▸ entry) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem compressionStamp_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {base : ZFSet.{u}} (hBase : base ∈ M.sets) (n : Nat) : + compressionStamp base n ∈ M.sets := by + induction n with + | zero => exact M.insert_mem pairing unions hBase hBase + | succ n ih => exact M.insert_mem pairing unions ih ih + +theorem exists_groundCompressionStamps + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {base : ZFSet.{u}} (hBase : base ∈ M.sets) (ordinal : ordinalSetProperty base) : + ∃ stamps ∈ M.sets, ∃ limit ∈ M.sets, + limit = naturalFamilyUnion stamps ∧ CompressionStampCode base stamps limit := by + let formula : SetFormula 2 := (BoundedFormula.successorFormula 1 0).toFormula + have values : ∀ n, compressionStamp base n ∈ M.sets := M.compressionStamp_mem pairing unions hBase + have nextValue : ∀ n y, y ∈ M.sets → + (Realize M.sets formula (extend (compressionStamp base n) (extend y Fin.elim0)) ↔ + y = compressionStamp base (n + 1)) := by + intro n y hy + exact (BoundedFormula.realize_toFormula M (BoundedFormula.successorFormula 1 0) + (extend (compressionStamp base n) (extend y Fin.elim0)) + (Fin.cases (values n) (Fin.cases hy (fun i => Fin.elim0 i)))).trans + (BoundedFormula.truth_successorFormula 1 0 _) + obtain ⟨stamps, hStamps, trace, entries, _⟩ := + M.exists_definableNaturalHistory formula Fin.elim0 (fun i => Fin.elim0 i) + (compressionStamp base) values nextValue pairing unions separation collection infinite + have valueEq (n : Nat) : trace.1.natValue n = compressionStamp base n := + (entries n _).1 (trace.1.natValue_entry n) + have unionCode : NatUnionCode (compressionStamp base) (naturalFamilyUnion stamps) := by + intro x + simpa only [valueEq] using (naturalFamilyUnion_code trace.1 x) + have stampBelow (n : Nat) : compressionStamp base n ∈ naturalFamilyUnion stamps := + unionCode.subset (n + 1) (ZFSet.mem_insert _ _) + refine ⟨stamps, hStamps, naturalFamilyUnion stamps, + M.naturalFamilyUnion_mem unions separation (M.omega_mem separation infinite) hStamps, rfl, + ⟨⟨?_, ?_⟩, entries, unionCode, compressionStamp_union_ordinal ordinal unionCode⟩⟩ + · intro z hz + obtain ⟨i, hi, y, rfl⟩ := trace.1.shape z hz + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 hi + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, (entries n y).1 hz ▸ stampBelow n⟩ + · obtain ⟨_, function⟩ := trace.1 + exact function.2 + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +namespace CompressionStampCode +variable {base stamps limit K : ZFSet.{u}} (code : CompressionStampCode base stamps limit) +include code + +theorem function_into_bound (values : ∀ n, compressionStamp base n ∈ K) : + ZFSet.IsFunc ZFSet.omega K stamps := by + refine ⟨?_, code.function.2⟩ + intro z hz + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, (code.entries n y).1 hz ▸ values n⟩ + +theorem successor_mem_limit {a : ZFSet.{u}} (ha : a ∈ limit) : insert a a ∈ limit := by + obtain ⟨n, member⟩ := (code.union a).1 ha + rw [ordinalSetProperty_eq_code_rank a (ordinalSetProperty_member code.ordinal ha), + ← ordinalCode_succ, ordinalSetProperty_eq_code_rank limit code.ordinal, mem_ordinalCode_iff] + exact (Order.succ_le_iff.2 (ZFSet.rank_lt_of_mem member)).trans_lt + (ZFSet.rank_lt_of_mem (code.stamp_mem_limit n)) + +theorem rank_isLimit : Order.IsSuccLimit (ZFSet.rank limit) := by + apply Order.isSuccLimit_iff_of_orderBot.2 + refine ⟨ne_of_gt (bot_le.trans_lt (ZFSet.rank_lt_of_mem code.base_mem_limit)), ?_⟩ + rw [Order.isSuccPrelimit_iff_succ_lt] + intro a ha + have member : ordinalCode a ∈ limit := by + rw [ordinalSetProperty_eq_code_rank limit code.ordinal, mem_ordinalCode_iff] + exact ha + have bound := ZFSet.rank_lt_of_mem (code.successor_mem_limit member) + rw [← ordinalCode_succ, rank_ordinalCode] at bound + exact bound + +end CompressionStampCode + +namespace GroundInaccessibleConditions +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) +include conditions pairing unions powers separation infinite hK + +theorem compressionStamp_mem {base : ZFSet.{u}} (hBase : base ∈ K) (n : Nat) : + compressionStamp base n ∈ K := by + induction n with + | zero => exact conditions.successor_mem pairing unions powers separation infinite hK hBase + | succ n ih => exact conditions.successor_mem pairing unions powers separation infinite hK ih + +theorem compressionStamp_limit_mem {base stamps limit : ZFSet.{u}} + (code : CompressionStampCode base stamps limit) (hBase : base ∈ K) + (hStamps : stamps ∈ M.sets) : limit ∈ K := by + have values := conditions.compressionStamp_mem pairing unions powers separation infinite hK hBase + obtain ⟨δ, hδ, bounded⟩ := conditions.2.2.1 ZFSet.omega conditions.2.1 stamps hStamps + (code.function_into_bound values) + have subset : limit ⊆ δ := by + intro x hx + obtain ⟨n, member⟩ := (code.union x).1 hx + exact (ordinalSetProperty_member conditions.1 hδ).1 (compressionStamp base n) + (bounded _ _ ((code.entries n _).2 rfl)) x member + obtain ⟨l, eqLimit⟩ := (ordinalSetProperty_iff limit).1 code.ordinal + obtain ⟨d, eqDelta⟩ := (ordinalSetProperty_iff δ).1 (ordinalSetProperty_member conditions.1 hδ) + obtain ⟨k, eqK⟩ := (ordinalSetProperty_iff K).1 conditions.1 + rw [eqLimit, eqDelta, ordinalCode_subset_iff] at subset + rw [eqDelta, eqK, mem_ordinalCode_iff] at hδ + rw [eqLimit, eqK, mem_ordinalCode_iff] + exact subset.trans_lt hδ + +end GroundInaccessibleConditions + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundCompressionStamps_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K base : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (hBase : base ∈ K) : + ∃ stamps ∈ M.sets, ∃ limit ∈ M.sets, + limit = naturalFamilyUnion stamps ∧ CompressionStampCode base stamps limit ∧ + limit ∈ K ∧ Order.IsSuccLimit (ZFSet.rank limit) ∧ base ∈ limit := by + obtain ⟨stamps, hStamps, limit, hLimit, equal, code⟩ := + M.exists_groundCompressionStamps pairing unions separation collection infinite + (M.transitive hK hBase) (ordinalSetProperty_member conditions.1 hBase) + exact ⟨stamps, hStamps, limit, hLimit, equal, code, + conditions.compressionStamp_limit_mem pairing unions powers separation infinite hK code hBase hStamps, + code.rank_isLimit, code.base_mem_limit⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStarIncidence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStarIncidence.lean index a1bf616d1121675a2211153563ce3f3919dac2c7..dcd722f21c9d45d99db4e86c62e8e68a0aa70122 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStarIncidence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCompressionStarIncidence.lean @@ -1,806 +1,806 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TileStarIncidenceRealization -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialExternalGroup - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def externalCosetRelation (E G inclusion multiplication : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ w ∈ E, ∃ v ∈ E, z = ZFSet.pair w v ∧ - ∃ j ∈ G, ∃ k ∈ E, ZFSet.pair j k ∈ inclusion ∧ - ZFSet.pair (ZFSet.pair w k) v ∈ multiplication) (ZFSet.prod E E) - -theorem externalCosetRelation_subset (E G inclusion multiplication : ZFSet.{u}) : - externalCosetRelation E G inclusion multiplication ⊆ ZFSet.prod E E := - fun _ h => (ZFSet.mem_sep.1 h).1 - -theorem pair_mem_externalCosetRelation (E G inclusion multiplication w v : ZFSet.{u}) : - ZFSet.pair w v ∈ externalCosetRelation E G inclusion multiplication ↔ - w ∈ E ∧ v ∈ E ∧ ∃ j ∈ G, ∃ k ∈ E, ZFSet.pair j k ∈ inclusion ∧ - ZFSet.pair (ZFSet.pair w k) v ∈ multiplication := by - rw [externalCosetRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, w', hw, v', hv, equal, witnesses⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hw, hv, witnesses⟩ - · rintro ⟨hw, hv, witnesses⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hw, hv⟩, w, hw, v, hv, rfl, witnesses⟩ - -namespace BoundedFormula - -def externalCosetEntryFormula {n} (z E G inclusion multiplication : Fin n) : BoundedFormula n := - exMem E (exMem E.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (exMem G.succ.succ (exMem E.succ.succ.succ - (.conj (pairMembershipFormula 1 0 inclusion.succ.succ.succ.succ) - (tripleMembershipFormula 3 0 2 multiplication.succ.succ.succ.succ)))))) - -theorem truth_externalCosetEntryFormula {n} (z E G inclusion multiplication : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (externalCosetEntryFormula z E G inclusion multiplication) env ↔ - ∃ w ∈ env E, ∃ v ∈ env E, env z = ZFSet.pair w v ∧ - ∃ j ∈ env G, ∃ k ∈ env E, ZFSet.pair j k ∈ env inclusion ∧ - ZFSet.pair (ZFSet.pair w k) v ∈ env multiplication := by - simp only [externalCosetEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem externalCosetRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {E G inclusion multiplication : ZFSet.{u}} - (hE : E ∈ M.sets) (hG : G ∈ M.sets) (hInclusion : inclusion ∈ M.sets) - (hMultiplication : multiplication ∈ M.sets) : - externalCosetRelation E G inclusion multiplication ∈ M.sets := by - let params := extend E (extend G (extend inclusion (extend multiplication Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalCosetEntryFormula 0 1 2 3 4) params - (Fin.cases hE (Fin.cases hG (Fin.cases hInclusion (Fin.cases hMultiplication (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation hE hE) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.externalCosetEntryFormula 0 1 2 3 4) (extend z params)) (ZFSet.prod E E) = - externalCosetRelation E G inclusion multiplication := by - apply ZFSet.ext - intro z - rw [externalCosetRelation, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_externalCosetEntryFormula 0 1 2 3 4 _) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps.CosetGeometry -universe u -variable {J S : Type u} [Group J] -variable (s : Presentation (External J S)) (g : Presentation J) -variable {inclusion multiplication : ZFSet.{u}} -variable (oldEntries : ∀ j k, ZFSet.pair (g.encode j) (s.encode k) ∈ inclusion ↔ old J S j = k) -variable (mulEntries : ∀ w k v, - ZFSet.pair (ZFSet.pair (s.encode w) (s.encode k)) (s.encode v) ∈ multiplication ↔ w * k = v) - -include oldEntries mulEntries in -theorem externalCosetRelation_iff (w v : External J S) : - ZFSet.pair (s.encode w) (s.encode v) ∈ externalCosetRelation s.carrier g.carrier inclusion multiplication ↔ - point J S w = point J S v := by - rw [pair_mem_externalCosetRelation, point_eq] - constructor - · rintro ⟨_, _, j, hj, k, hk, oldEntry, mulEntry⟩ - obtain ⟨j, rfl⟩ := (g.mem_carrier j).1 hj - obtain ⟨k, rfl⟩ := (s.mem_carrier k).1 hk - exact ⟨j, (oldEntries j k).1 oldEntry ▸ (mulEntries w k v).1 mulEntry⟩ - · rintro ⟨j, equal⟩ - exact ⟨s.encode_mem w, s.encode_mem v, g.encode j, g.encode_mem j, - s.encode (old J S j), s.encode_mem _, (oldEntries j _).2 rfl, - (mulEntries w _ v).2 equal⟩ - -include oldEntries mulEntries in -theorem externalCosetRelation_equivalence : - EquivalenceRelationCode s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) := by - have entries := externalCosetRelation_iff s g oldEntries mulEntries - refine ⟨externalCosetRelation_subset _ _ _ _, ?_, ?_, ?_⟩ - · intro w hw - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - exact (entries w w).2 rfl - · intro w v related - obtain ⟨hw, hv, _⟩ := (pair_mem_externalCosetRelation _ _ _ _ _ _).1 related - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv - exact (entries v w).2 ((entries w v).1 related).symm - · intro w v z first second - obtain ⟨hw, hv, _⟩ := (pair_mem_externalCosetRelation _ _ _ _ _ _).1 first - obtain ⟨_, hz, _⟩ := (pair_mem_externalCosetRelation _ _ _ _ _ _).1 second - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz - exact (entries w z).2 (((entries w v).1 first).trans ((entries v z).1 second)) - -include oldEntries mulEntries in -theorem externalCosetRelation_related (w v : External J S) : - ZFSet.pair (s.encode w) (s.encode v) ∈ externalCosetRelation s.carrier g.carrier inclusion multiplication ↔ - (cosetSetoid J S).r w v := - (externalCosetRelation_iff s g oldEntries mulEntries w v).trans (point_eq J S w v) - -noncomputable def externalCosetPresentation : Presentation (Vertex J S) := - s.quotientPresentation (cosetSetoid J S) - (externalCosetRelation_equivalence s g oldEntries mulEntries) - (externalCosetRelation_related s g oldEntries mulEntries) - -theorem externalCosetPresentation_carrier : - (externalCosetPresentation s g oldEntries mulEntries).carrier = - equivalenceClasses s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) := rfl - -theorem externalCosetPresentation_encode_point (w : External J S) : - (externalCosetPresentation s g oldEntries mulEntries).encode (point J S w) = - equivalenceClass s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) (s.encode w) := rfl - -theorem externalCosetClassifier_entry_iff (w : External J S) (q : Vertex J S) : - ZFSet.pair (s.encode w) ((externalCosetPresentation s g oldEntries mulEntries).encode q) ∈ - equivalenceClassifier s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) ↔ - point J S w = q := - s.quotientPresentation_classifier_entry_iff (cosetSetoid J S) - (externalCosetRelation_equivalence s g oldEntries mulEntries) - (externalCosetRelation_related s g oldEntries mulEntries) w q - -theorem externalCosetClassifier_eq_graph : - equivalenceClassifier s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) = - s.graph (externalCosetPresentation s g oldEntries mulEntries) (point J S) := - s.quotientClassifier_eq_graph (cosetSetoid J S) - (externalCosetRelation_equivalence s g oldEntries mulEntries) - (externalCosetRelation_related s g oldEntries mulEntries) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionCompletion -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (compression : CompressionOriginalData P0 r0 μ0 A0 G - (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hG : G ∈ M.sets) (hLetters : externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) ∈ M.sets) - -noncomputable def externalFamilyGroupPresentation : - letI := group.toGroup - Presentation (External (SetMembers G) (completion.externalFamily group oldAction compression).Letters) := by - letI := group.toGroup - exact M.externalGroupPresentation pairing unions powers separation infinite (SetMembers.presentation G) - (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters - -theorem externalFamilyGroupPresentation_carrier : - letI := group.toGroup - (completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters).carrier = - M.externalGroupCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one := by - let := group.toGroup - change M.externalGroupCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) - (((SetMembers.presentation G).product (SetMembers.presentation G)).graph (SetMembers.presentation G) (fun p => p.1 * p.2)) - ((SetMembers.presentation G).encode 1) = _ - rw [group.multiplication_graph_eq, group.identity_code_eq] - -theorem externalFamilyGroupPresentation_multiplication : - letI := group.toGroup - let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters - M.externalGroupMultiplication G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = - (s.product s).graph s (fun p => p.1 * p.2) := by - let := group.toGroup - have equal := M.externalGroupMultiplication_eq_graph pairing unions powers separation infinite - (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters - rw [group.multiplication_graph_eq, group.identity_code_eq] at equal - exact equal - -theorem externalFamilyGroupPresentation_old : - letI := group.toGroup - let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters - M.externalOldInclusion G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = - (SetMembers.presentation G).graph s (old (SetMembers G) (completion.externalFamily group oldAction compression).Letters) := by - let := group.toGroup - have equal := M.externalOldInclusion_eq_graph pairing unions powers separation infinite - (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters - rw [group.multiplication_graph_eq, group.identity_code_eq] at equal - exact equal - -theorem externalFamilyGroupPresentation_generators : - letI := group.toGroup - let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters - M.externalChildGenerators G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = - (completion.externalFamilyLetterPresentation group oldAction compression).graph s - (generator (SetMembers G) (completion.externalFamily group oldAction compression).Letters) := by - let := group.toGroup - have equal := M.externalChildGenerators_eq_graph pairing unions powers separation infinite - (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters - rw [group.multiplication_graph_eq, group.identity_code_eq] at equal - exact equal - -theorem externalFamilyGroupPresentation_identity : - letI := group.toGroup - let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters - M.externalGroupIdentity G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = s.encode 1 := by - let := group.toGroup - have equal := M.externalGroupIdentity_eq_encode pairing unions powers separation infinite - (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters - rw [group.multiplication_graph_eq, group.identity_code_eq] at equal - exact equal - -end PartitionPilot.Forcing.GroundCompressionCompletion - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure GroundExternalGeometryInputs (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}) - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : Prop where - words : GroundExternalWordData M initial I Sources Reps G m one T τ P r μ A completion - group : GroundExternalGroupData M G (externalChildLetters I P (externalRectangles P G r μ A)) m inv one - old_inclusion_ground : M.externalOldInclusion G - (externalChildLetters I P (externalRectangles P G r μ A)) m one ∈ M.sets - old_inclusion_injection : InjectionCode G - (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - (M.externalOldInclusion G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - generators_ground : M.externalChildGenerators G - (externalChildLetters I P (externalRectangles P G r μ A)) m one ∈ M.sets - generators_injection : InjectionCode (externalChildLetters I P (externalRectangles P G r μ A)) - (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - (M.externalChildGenerators G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - original : CompressionOriginalData P r μ A G (completion.algebra.union.fields 0) - (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) (completion.algebra.union.fields 12) - -namespace GroundCompressionOrigin -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P r μ A τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable (origin : GroundCompressionOrigin M initial P r μ A τ I Sources Reps G m inv one T Filters) - -include origin in -theorem externalGeometryInputs - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) - (group : GroupCode G m inv one) (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) : - GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion := by - have words := completion.externalWordData pairing unions powers separation infinite hI hP hG hr hμ hA - have generators := M.externalGeneratorGraphs_ground_injections pairing unions powers separation infinite - group hG words.letters_ground hm - exact ⟨words, M.externalGroupData pairing unions powers separation infinite group hG words.letters_ground hm hInv, - generators.1, generators.2.1, generators.2.2.1, generators.2.2.2, - origin.union_original_data completion.algebra.union pairing unions powers separation hI hSources hReps hG hT⟩ - -end GroundCompressionOrigin - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -noncomputable def externalCosetEquivalence (G S m one : ZFSet.{u}) : ZFSet.{u} := - externalCosetRelation (M.externalGroupCarrier G S m one) G - (M.externalOldInclusion G S m one) (M.externalGroupMultiplication G S m one) -noncomputable def externalCosetCarrier (G S m one : ZFSet.{u}) : ZFSet.{u} := - equivalenceClasses (M.externalGroupCarrier G S m one) (M.externalCosetEquivalence G S m one) -noncomputable def externalCosetClassifier (G S m one : ZFSet.{u}) : ZFSet.{u} := - equivalenceClassifier (M.externalGroupCarrier G S m one) (M.externalCosetEquivalence G S m one) - -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - -theorem externalCoset_old_entries : - letI := group.toGroup - ∀ j k, ZFSet.pair ((SetMembers.presentation G).encode j) ((sGroup).encode k) ∈ - M.externalOldInclusion G letters m one ↔ old (SetMembers G) (family).Letters j = k := by - let := group.toGroup - intro j k - rw [completion.externalFamilyGroupPresentation_old group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground] - exact Presentation.pair_mem_graph _ _ _ _ _ - -theorem externalCoset_mul_entries : - letI := group.toGroup - ∀ (w k v : External (SetMembers G) (family).Letters), ZFSet.pair (ZFSet.pair ((sGroup).encode w) ((sGroup).encode k)) ((sGroup).encode v) ∈ - M.externalGroupMultiplication G letters m one ↔ w * k = v := by - let := group.toGroup - intro w k v - rw [completion.externalFamilyGroupPresentation_multiplication group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground] - exact Presentation.pair_mem_graph ((sGroup).product (sGroup)) (sGroup) (fun p => p.1 * p.2) (w, k) v - -noncomputable def externalCosetPresentation : - letI := group.toGroup - Presentation (Vertex (SetMembers G) (family).Letters) := by - letI := group.toGroup - exact Forcing.externalCosetPresentation (sGroup) (SetMembers.presentation G) - (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) - -theorem externalCosetPresentation_carrier : - letI := group.toGroup - (data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG).carrier = - M.externalCosetCarrier G letters m one := by - let := group.toGroup - change equivalenceClasses (sGroup).carrier (externalCosetRelation (sGroup).carrier G - (M.externalOldInclusion G letters m one) (M.externalGroupMultiplication G letters m one)) = _ - rw [completion.externalFamilyGroupPresentation_carrier] - rfl - -theorem externalCosetEquivalence_iff : - letI := group.toGroup - ∀ w v, ZFSet.pair ((sGroup).encode w) ((sGroup).encode v) ∈ M.externalCosetEquivalence G letters m one ↔ - point (SetMembers G) (family).Letters w = point (SetMembers G) (family).Letters v := by - let := group.toGroup - have entries := Forcing.externalCosetRelation_iff (sGroup) (SetMembers.presentation G) - (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) - rw [completion.externalFamilyGroupPresentation_carrier] at entries - exact entries - -theorem externalCosetClassifier_entry_iff : - letI := group.toGroup - let q := data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG - ∀ w v, ZFSet.pair ((sGroup).encode w) (q.encode v) ∈ M.externalCosetClassifier G letters m one ↔ - point (SetMembers G) (family).Letters w = v := by - let := group.toGroup - dsimp only - have entries := Forcing.externalCosetClassifier_entry_iff (sGroup) (SetMembers.presentation G) - (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) - rw [completion.externalFamilyGroupPresentation_carrier] at entries - exact entries - -theorem externalCosetClassifier_graph : - letI := group.toGroup - M.externalCosetClassifier G letters m one = (sGroup).graph - (data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG) - (point (SetMembers G) (family).Letters) := by - let := group.toGroup - have equal := Forcing.externalCosetClassifier_eq_graph (sGroup) (SetMembers.presentation G) - (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) - rw [completion.externalFamilyGroupPresentation_carrier] at equal - exact equal - -include data pairing unions powers separation hG in -theorem externalCosets_ground : - M.externalCosetEquivalence G letters m one ∈ M.sets ∧ - M.externalCosetCarrier G letters m one ∈ M.sets ∧ M.externalCosetClassifier G letters m one ∈ M.sets := by - have relation := M.externalCosetRelation_mem pairing unions powers separation data.group.carrier_mem hG - data.old_inclusion_ground data.group.multiplication_mem - exact ⟨relation, M.equivalenceClasses_mem powers separation data.group.carrier_mem relation, - M.equivalenceClassifier_mem pairing unions powers separation data.group.carrier_mem relation⟩ - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalCosets_spec : - let E := M.externalGroupCarrier G letters m one - let Q := M.externalCosetCarrier G letters m one - let C := M.externalCosetClassifier G letters m one - EquivalenceRelationCode E (M.externalCosetEquivalence G letters m one) ∧ ZFSet.IsFunc E Q C ∧ - (∀ q ∈ Q, ∃ w ∈ E, ZFSet.pair w q ∈ C) ∧ - (∀ w v q t, ZFSet.pair w q ∈ C → ZFSet.pair v t ∈ C → - (q = t ↔ ZFSet.pair w v ∈ M.externalCosetEquivalence G letters m one)) := by - let := group.toGroup - have code := Forcing.externalCosetRelation_equivalence (sGroup) (SetMembers.presentation G) - (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) - rw [completion.externalFamilyGroupPresentation_carrier] at code - exact ⟨code, equivalenceClassifier_function _ _, fun _ hq => equivalenceClassifier_onto hq, - fun _ _ _ _ first second => code.classifier_kernel first second⟩ - -end GroundExternalGeometryInputs - - - - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -noncomputable def externalStarVertices (G S R m one : ZFSet.{u}) : ZFSet.{u} := - tileStarVertexCarrier (M.externalCosetCarrier G S m one) (M.externalGroupCarrier G S m one) R -noncomputable def externalStarEdges (G S R m one : ZFSet.{u}) : ZFSet.{u} := - tileStarEdgeCarrier (M.externalGroupCarrier G S m one) R S -noncomputable def externalStarDarts (G S R m one : ZFSet.{u}) : ZFSet.{u} := - tileStarDartCarrier (M.externalGroupCarrier G S m one) R S - -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original -local notation "sRequest" => externalRequestPresentation I P0 rectangles -local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG - -noncomputable def externalStarVertexPresentation : - letI := group.toGroup - Presentation (TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by - letI := group.toGroup - exact tileStarVertexPresentation (sGroup) (sRequest) (sCoset) - -noncomputable def externalStarEdgePresentation : - letI := group.toGroup - Presentation (TileStars.Edge (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by - letI := group.toGroup - exact tileStarEdgePresentation (sGroup) (sLetter) (sRequest) - -noncomputable def externalStarDartPresentation : - letI := group.toGroup - Presentation (TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by - letI := group.toGroup - exact tileStarDartPresentation (sGroup) (sLetter) (sRequest) - -theorem externalStarPresentations_carriers : - letI := group.toGroup - (data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG).carrier = - M.externalStarVertices G letters requests m one ∧ - (data.externalStarEdgePresentation group oldAction pairing unions powers separation infinite hG).carrier = - M.externalStarEdges G letters requests m one ∧ - (data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG).carrier = - M.externalStarDarts G letters requests m one := by - let := group.toGroup - change tileStarVertexCarrier (sCoset).carrier (sGroup).carrier requests = _ ∧ - tileStarEdgeCarrier (sGroup).carrier requests (sLetter).carrier = _ ∧ - tileStarDartCarrier (sGroup).carrier requests (sLetter).carrier = _ - rw [data.externalCosetPresentation_carrier, completion.externalFamilyGroupPresentation_carrier, - completion.externalFamilyLetterPresentation_carrier] - exact ⟨rfl, rfl, rfl⟩ - -include data pairing unions powers separation hG in -theorem externalStarCarriers_ground : - M.externalStarVertices G letters requests m one ∈ M.sets ∧ - M.externalStarEdges G letters requests m one ∈ M.sets ∧ - M.externalStarDarts G letters requests m one ∈ M.sets := by - exact M.tileStarCarriers_mem pairing unions powers separation - (data.externalCosets_ground pairing unions powers separation hG).2.1 - data.group.carrier_mem data.words.requests_ground data.words.letters_ground - -end GroundExternalGeometryInputs -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -noncomputable def tileStarRequestGraph (R S : ZFSet.{u}) : ZFSet.{u} := - graphRestriction S (productFirst R (natSetCode 2)) - -theorem pair_mem_tileStarRequestGraph {R S a c b : ZFSet.{u}} - (ha : a ∈ R) (hc : c ∈ natSetCode 2) (hs : ZFSet.pair a c ∈ S) : - ZFSet.pair (ZFSet.pair a c) b ∈ tileStarRequestGraph R S ↔ a = b := by - rw [tileStarRequestGraph, pair_mem_graphRestriction, mem_productFirst] - constructor - · rintro ⟨⟨x, _, y, _, equal⟩, _⟩ - have eq := ZFSet.pair_inj.1 equal - exact ((ZFSet.pair_inj.1 eq.1).1).trans eq.2.symm - · rintro rfl - exact ⟨⟨a, ha, c, hc, rfl⟩, hs⟩ - -theorem externalRequestChildCode_mem {I P R : ZFSet.{u}} - (r : ExternalRequestIndex I P R) (c : ExternalRequestChild r) : - externalRequestChildCode r c ∈ natSetCode 2 := by - rcases r with i | (x | r) - · exact (mem_natTwo_iff_externalSignCode _).2 ⟨false, rfl⟩ - · exact (mem_natTwo_iff_externalSignCode _).2 ⟨false, rfl⟩ - · exact (mem_natTwo_iff_externalSignCode _).2 ⟨c.down, rfl⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem tileStarRequestGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {R S : ZFSet.{u}} (hR : R ∈ M.sets) (hS : S ∈ M.sets) : tileStarRequestGraph R S ∈ M.sets := by - have hz : natSetCode 0 ∈ M.sets := M.empty_mem ⟨R, hR⟩ - have ho : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hz hz - have ht : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions ho ho - exact M.graphRestriction_mem unions separation hS (M.productFirst_mem pairing unions powers separation hR ht) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialExternalGeometryInputs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ I Sources Reps G m inv one T Filters, - ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, - GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion := by - dsimp only - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, ⟨compression⟩⟩ := - M.exists_groundInitialCompressionOrigin pairing unions powers separation collection infinite choice - hP hG hr hμ hA hLabels group action meet hτ top hC hD hrD hc hOriginal - originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember - priorSpace priorOrder priorMeet priorBirth priorHeight - exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, - origin.externalGeometryInputs compression.born.profiled.heighted.completion - pairing unions powers separation infinite hI hSources hReps hG hT hP hr hμ hA group hm hInv⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -noncomputable def externalStarSource (G S R m one : ZFSet.{u}) : ZFSet.{u} := - tileStarSourceGraph (M.externalGroupCarrier G S m one) R S (M.externalCosetCarrier G S m one) - (M.externalCosetClassifier G S m one) (tileStarRequestGraph R S) - (M.externalChildGenerators G S m one) (M.externalGroupMultiplication G S m one) -noncomputable def externalStarTarget (G S R m one : ZFSet.{u}) : ZFSet.{u} := - tileStarTargetGraph (M.externalGroupCarrier G S m one) R S (M.externalCosetCarrier G S m one) - (M.externalCosetClassifier G S m one) (tileStarRequestGraph R S) - (M.externalChildGenerators G S m one) (M.externalGroupMultiplication G S m one) -noncomputable def externalStarReverse (G S R m one : ZFSet.{u}) : ZFSet.{u} := - tileStarReverseGraph (M.externalGroupCarrier G S m one) R S -noncomputable def externalStarIncidence (G S R m one : ZFSet.{u}) : ZFSet.{u} := - dartIncidenceGraph (M.externalStarSource G S R m one) (M.externalStarTarget G S R m one) -noncomputable def externalStarAdjacency (G S R m one : ZFSet.{u}) : ZFSet.{u} := - dartAdjacencyGraph (M.externalStarDarts G S R m one) (M.externalStarVertices G S R m one) - (M.externalStarSource G S R m one) (M.externalStarTarget G S R m one) - -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original -local notation "sRequest" => externalRequestPresentation I P0 rectangles -local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG - -theorem externalStar_request_entries : - ∀ (a : (family).Letters) b, ZFSet.pair ((sLetter).encode a) ((sRequest).encode b) ∈ - tileStarRequestGraph requests letters ↔ a.1 = b := by - intro a b - let child := externalRequestChildCode a.1 (cast (completion.externalFamily_child group oldAction data.original a.1) a.2) - have shape : (sLetter).encode a = ZFSet.pair ((sRequest).encode a.1) child := rfl - have member := (sLetter).encode_mem a - rw [shape] at member ⊢ - exact (pair_mem_tileStarRequestGraph ((sRequest).encode_mem a.1) - (externalRequestChildCode_mem _ _) member).trans - ⟨fun h => (sRequest).injective h, congrArg (sRequest).encode⟩ - -theorem externalStar_generator_entries : - letI := group.toGroup - ∀ a b, ZFSet.pair ((sLetter).encode a) ((sGroup).encode b) ∈ M.externalChildGenerators G letters m one ↔ - generator (SetMembers G) (family).Letters a = b := by - let := group.toGroup - intro a b - rw [completion.externalFamilyGroupPresentation_generators group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground] - exact Presentation.pair_mem_graph (sLetter) (sGroup) _ a b - -theorem externalStarSource_iff : - letI := group.toGroup - ∀ (d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) - (v : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), - ZFSet.pair ((sDart).encode d) ((sVertex).encode v) ∈ M.externalStarSource G letters requests m one ↔ - TileStars.source (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v := by - let := group.toGroup - intro d v - have entries := tileStar_source_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) - (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStar_request_entries group oldAction) - (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) d v - rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, - data.externalCosetPresentation_carrier] at entries - exact entries - -theorem externalStarTarget_iff : - letI := group.toGroup - ∀ (d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) - (v : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), - ZFSet.pair ((sDart).encode d) ((sVertex).encode v) ∈ M.externalStarTarget G letters requests m one ↔ - TileStars.target (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v := by - let := group.toGroup - intro d v - have entries := tileStar_target_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) - (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStar_request_entries group oldAction) - (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) d v - rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, - data.externalCosetPresentation_carrier] at entries - exact entries - -theorem externalStarReverse_iff : - letI := group.toGroup - ∀ (d v : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), - ZFSet.pair ((sDart).encode d) ((sDart).encode v) ∈ M.externalStarReverse G letters requests m one ↔ - TileStars.reverse (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) d = v := by - let := group.toGroup - intro d v - have entries := tileStar_reverse_iff (sGroup) (sLetter) (sRequest) d v - rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier] at entries - exact entries - -theorem externalStarIncidence_iff : - letI := group.toGroup - ∀ (d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) - (v : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), ZFSet.pair ((sDart).encode d) ((sVertex).encode v) ∈ M.externalStarIncidence G letters requests m one ↔ - TileStars.source (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v ∨ - TileStars.target (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v := by - let := group.toGroup - intro d v - have entries := tileStar_incidence_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) - (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStar_request_entries group oldAction) - (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) d v - rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, - data.externalCosetPresentation_carrier] at entries - exact entries - -theorem externalStarAdjacency_iff : - letI := group.toGroup - ∀ (x y : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), ZFSet.pair ((sVertex).encode x) ((sVertex).encode y) ∈ M.externalStarAdjacency G letters requests m one ↔ - ∃ d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles), - TileStars.source (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = x ∧ - TileStars.target (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = y := by - let := group.toGroup - intro x y - have entries := tileStar_adjacency_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) - (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStar_request_entries group oldAction) - (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) x y - rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, - data.externalCosetPresentation_carrier] at entries - exact entries - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarEndpoint_functions : - ZFSet.IsFunc (M.externalStarDarts G letters requests m one) (M.externalStarVertices G letters requests m one) - (M.externalStarSource G letters requests m one) ∧ - ZFSet.IsFunc (M.externalStarDarts G letters requests m one) (M.externalStarVertices G letters requests m one) - (M.externalStarTarget G letters requests m one) ∧ - ZFSet.IsFunc (M.externalStarDarts G letters requests m one) (M.externalStarDarts G letters requests m one) - (M.externalStarReverse G letters requests m one) := by - let := group.toGroup - have functions := tileStar_endpoint_functions (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) - (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStar_request_entries group oldAction) - (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) - (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) - rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, - data.externalCosetPresentation_carrier] at functions - exact functions - -include data pairing unions powers separation hG in -theorem externalStarIncidence_ground : - tileStarRequestGraph requests letters ∈ M.sets ∧ - M.externalStarSource G letters requests m one ∈ M.sets ∧ - M.externalStarTarget G letters requests m one ∈ M.sets ∧ - M.externalStarReverse G letters requests m one ∈ M.sets ∧ - M.externalStarIncidence G letters requests m one ∈ M.sets ∧ - M.externalStarAdjacency G letters requests m one ∈ M.sets := by - have req := M.tileStarRequestGraph_mem pairing unions powers separation data.words.requests_ground data.words.letters_ground - have cosets := data.externalCosets_ground pairing unions powers separation hG - have carriers := data.externalStarCarriers_ground pairing unions powers separation hG - have src := M.tileStarSourceGraph_mem pairing unions powers separation data.group.carrier_mem - data.words.requests_ground data.words.letters_ground cosets.2.1 cosets.2.2 req - data.generators_ground data.group.multiplication_mem - have tgt := M.tileStarTargetGraph_mem pairing unions powers separation data.group.carrier_mem - data.words.requests_ground data.words.letters_ground cosets.2.1 cosets.2.2 req - data.generators_ground data.group.multiplication_mem - have rev := M.tileStarReverseGraph_mem pairing unions powers separation data.group.carrier_mem - data.words.requests_ground data.words.letters_ground - exact ⟨req, src, tgt, rev, M.dartIncidenceGraph_mem pairing unions src tgt, - M.dartAdjacencyGraph_mem pairing unions powers separation carriers.2.2 carriers.1 src tgt⟩ - -end GroundExternalGeometryInputs -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TileStarIncidenceRealization +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialExternalGroup + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def externalCosetRelation (E G inclusion multiplication : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ w ∈ E, ∃ v ∈ E, z = ZFSet.pair w v ∧ + ∃ j ∈ G, ∃ k ∈ E, ZFSet.pair j k ∈ inclusion ∧ + ZFSet.pair (ZFSet.pair w k) v ∈ multiplication) (ZFSet.prod E E) + +theorem externalCosetRelation_subset (E G inclusion multiplication : ZFSet.{u}) : + externalCosetRelation E G inclusion multiplication ⊆ ZFSet.prod E E := + fun _ h => (ZFSet.mem_sep.1 h).1 + +theorem pair_mem_externalCosetRelation (E G inclusion multiplication w v : ZFSet.{u}) : + ZFSet.pair w v ∈ externalCosetRelation E G inclusion multiplication ↔ + w ∈ E ∧ v ∈ E ∧ ∃ j ∈ G, ∃ k ∈ E, ZFSet.pair j k ∈ inclusion ∧ + ZFSet.pair (ZFSet.pair w k) v ∈ multiplication := by + rw [externalCosetRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, w', hw, v', hv, equal, witnesses⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hw, hv, witnesses⟩ + · rintro ⟨hw, hv, witnesses⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hw, hv⟩, w, hw, v, hv, rfl, witnesses⟩ + +namespace BoundedFormula + +def externalCosetEntryFormula {n} (z E G inclusion multiplication : Fin n) : BoundedFormula n := + exMem E (exMem E.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (exMem G.succ.succ (exMem E.succ.succ.succ + (.conj (pairMembershipFormula 1 0 inclusion.succ.succ.succ.succ) + (tripleMembershipFormula 3 0 2 multiplication.succ.succ.succ.succ)))))) + +theorem truth_externalCosetEntryFormula {n} (z E G inclusion multiplication : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (externalCosetEntryFormula z E G inclusion multiplication) env ↔ + ∃ w ∈ env E, ∃ v ∈ env E, env z = ZFSet.pair w v ∧ + ∃ j ∈ env G, ∃ k ∈ env E, ZFSet.pair j k ∈ env inclusion ∧ + ZFSet.pair (ZFSet.pair w k) v ∈ env multiplication := by + simp only [externalCosetEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem externalCosetRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {E G inclusion multiplication : ZFSet.{u}} + (hE : E ∈ M.sets) (hG : G ∈ M.sets) (hInclusion : inclusion ∈ M.sets) + (hMultiplication : multiplication ∈ M.sets) : + externalCosetRelation E G inclusion multiplication ∈ M.sets := by + let params := extend E (extend G (extend inclusion (extend multiplication Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalCosetEntryFormula 0 1 2 3 4) params + (Fin.cases hE (Fin.cases hG (Fin.cases hInclusion (Fin.cases hMultiplication (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation hE hE) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.externalCosetEntryFormula 0 1 2 3 4) (extend z params)) (ZFSet.prod E E) = + externalCosetRelation E G inclusion multiplication := by + apply ZFSet.ext + intro z + rw [externalCosetRelation, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_externalCosetEntryFormula 0 1 2 3 4 _) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps.CosetGeometry +universe u +variable {J S : Type u} [Group J] +variable (s : Presentation (External J S)) (g : Presentation J) +variable {inclusion multiplication : ZFSet.{u}} +variable (oldEntries : ∀ j k, ZFSet.pair (g.encode j) (s.encode k) ∈ inclusion ↔ old J S j = k) +variable (mulEntries : ∀ w k v, + ZFSet.pair (ZFSet.pair (s.encode w) (s.encode k)) (s.encode v) ∈ multiplication ↔ w * k = v) + +include oldEntries mulEntries in +theorem externalCosetRelation_iff (w v : External J S) : + ZFSet.pair (s.encode w) (s.encode v) ∈ externalCosetRelation s.carrier g.carrier inclusion multiplication ↔ + point J S w = point J S v := by + rw [pair_mem_externalCosetRelation, point_eq] + constructor + · rintro ⟨_, _, j, hj, k, hk, oldEntry, mulEntry⟩ + obtain ⟨j, rfl⟩ := (g.mem_carrier j).1 hj + obtain ⟨k, rfl⟩ := (s.mem_carrier k).1 hk + exact ⟨j, (oldEntries j k).1 oldEntry ▸ (mulEntries w k v).1 mulEntry⟩ + · rintro ⟨j, equal⟩ + exact ⟨s.encode_mem w, s.encode_mem v, g.encode j, g.encode_mem j, + s.encode (old J S j), s.encode_mem _, (oldEntries j _).2 rfl, + (mulEntries w _ v).2 equal⟩ + +include oldEntries mulEntries in +theorem externalCosetRelation_equivalence : + EquivalenceRelationCode s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) := by + have entries := externalCosetRelation_iff s g oldEntries mulEntries + refine ⟨externalCosetRelation_subset _ _ _ _, ?_, ?_, ?_⟩ + · intro w hw + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + exact (entries w w).2 rfl + · intro w v related + obtain ⟨hw, hv, _⟩ := (pair_mem_externalCosetRelation _ _ _ _ _ _).1 related + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv + exact (entries v w).2 ((entries w v).1 related).symm + · intro w v z first second + obtain ⟨hw, hv, _⟩ := (pair_mem_externalCosetRelation _ _ _ _ _ _).1 first + obtain ⟨_, hz, _⟩ := (pair_mem_externalCosetRelation _ _ _ _ _ _).1 second + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz + exact (entries w z).2 (((entries w v).1 first).trans ((entries v z).1 second)) + +include oldEntries mulEntries in +theorem externalCosetRelation_related (w v : External J S) : + ZFSet.pair (s.encode w) (s.encode v) ∈ externalCosetRelation s.carrier g.carrier inclusion multiplication ↔ + (cosetSetoid J S).r w v := + (externalCosetRelation_iff s g oldEntries mulEntries w v).trans (point_eq J S w v) + +noncomputable def externalCosetPresentation : Presentation (Vertex J S) := + s.quotientPresentation (cosetSetoid J S) + (externalCosetRelation_equivalence s g oldEntries mulEntries) + (externalCosetRelation_related s g oldEntries mulEntries) + +theorem externalCosetPresentation_carrier : + (externalCosetPresentation s g oldEntries mulEntries).carrier = + equivalenceClasses s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) := rfl + +theorem externalCosetPresentation_encode_point (w : External J S) : + (externalCosetPresentation s g oldEntries mulEntries).encode (point J S w) = + equivalenceClass s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) (s.encode w) := rfl + +theorem externalCosetClassifier_entry_iff (w : External J S) (q : Vertex J S) : + ZFSet.pair (s.encode w) ((externalCosetPresentation s g oldEntries mulEntries).encode q) ∈ + equivalenceClassifier s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) ↔ + point J S w = q := + s.quotientPresentation_classifier_entry_iff (cosetSetoid J S) + (externalCosetRelation_equivalence s g oldEntries mulEntries) + (externalCosetRelation_related s g oldEntries mulEntries) w q + +theorem externalCosetClassifier_eq_graph : + equivalenceClassifier s.carrier (externalCosetRelation s.carrier g.carrier inclusion multiplication) = + s.graph (externalCosetPresentation s g oldEntries mulEntries) (point J S) := + s.quotientClassifier_eq_graph (cosetSetoid J S) + (externalCosetRelation_equivalence s g oldEntries mulEntries) + (externalCosetRelation_related s g oldEntries mulEntries) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionCompletion +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (compression : CompressionOriginalData P0 r0 μ0 A0 G + (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 12)) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hG : G ∈ M.sets) (hLetters : externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) ∈ M.sets) + +noncomputable def externalFamilyGroupPresentation : + letI := group.toGroup + Presentation (External (SetMembers G) (completion.externalFamily group oldAction compression).Letters) := by + letI := group.toGroup + exact M.externalGroupPresentation pairing unions powers separation infinite (SetMembers.presentation G) + (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters + +theorem externalFamilyGroupPresentation_carrier : + letI := group.toGroup + (completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters).carrier = + M.externalGroupCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one := by + let := group.toGroup + change M.externalGroupCarrier G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) + (((SetMembers.presentation G).product (SetMembers.presentation G)).graph (SetMembers.presentation G) (fun p => p.1 * p.2)) + ((SetMembers.presentation G).encode 1) = _ + rw [group.multiplication_graph_eq, group.identity_code_eq] + +theorem externalFamilyGroupPresentation_multiplication : + letI := group.toGroup + let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters + M.externalGroupMultiplication G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = + (s.product s).graph s (fun p => p.1 * p.2) := by + let := group.toGroup + have equal := M.externalGroupMultiplication_eq_graph pairing unions powers separation infinite + (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters + rw [group.multiplication_graph_eq, group.identity_code_eq] at equal + exact equal + +theorem externalFamilyGroupPresentation_old : + letI := group.toGroup + let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters + M.externalOldInclusion G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = + (SetMembers.presentation G).graph s (old (SetMembers G) (completion.externalFamily group oldAction compression).Letters) := by + let := group.toGroup + have equal := M.externalOldInclusion_eq_graph pairing unions powers separation infinite + (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters + rw [group.multiplication_graph_eq, group.identity_code_eq] at equal + exact equal + +theorem externalFamilyGroupPresentation_generators : + letI := group.toGroup + let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters + M.externalChildGenerators G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = + (completion.externalFamilyLetterPresentation group oldAction compression).graph s + (generator (SetMembers G) (completion.externalFamily group oldAction compression).Letters) := by + let := group.toGroup + have equal := M.externalChildGenerators_eq_graph pairing unions powers separation infinite + (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters + rw [group.multiplication_graph_eq, group.identity_code_eq] at equal + exact equal + +theorem externalFamilyGroupPresentation_identity : + letI := group.toGroup + let s := completion.externalFamilyGroupPresentation group oldAction compression pairing unions powers separation infinite hG hLetters + M.externalGroupIdentity G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = s.encode 1 := by + let := group.toGroup + have equal := M.externalGroupIdentity_eq_encode pairing unions powers separation infinite + (SetMembers.presentation G) (completion.externalFamilyLetterPresentation group oldAction compression) hG hLetters + rw [group.multiplication_graph_eq, group.identity_code_eq] at equal + exact equal + +end PartitionPilot.Forcing.GroundCompressionCompletion + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure GroundExternalGeometryInputs (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}) + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : Prop where + words : GroundExternalWordData M initial I Sources Reps G m one T τ P r μ A completion + group : GroundExternalGroupData M G (externalChildLetters I P (externalRectangles P G r μ A)) m inv one + old_inclusion_ground : M.externalOldInclusion G + (externalChildLetters I P (externalRectangles P G r μ A)) m one ∈ M.sets + old_inclusion_injection : InjectionCode G + (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + (M.externalOldInclusion G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + generators_ground : M.externalChildGenerators G + (externalChildLetters I P (externalRectangles P G r μ A)) m one ∈ M.sets + generators_injection : InjectionCode (externalChildLetters I P (externalRectangles P G r μ A)) + (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + (M.externalChildGenerators G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + original : CompressionOriginalData P r μ A G (completion.algebra.union.fields 0) + (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) (completion.algebra.union.fields 12) + +namespace GroundCompressionOrigin +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P r μ A τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable (origin : GroundCompressionOrigin M initial P r μ A τ I Sources Reps G m inv one T Filters) + +include origin in +theorem externalGeometryInputs + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) + (group : GroupCode G m inv one) (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) : + GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion := by + have words := completion.externalWordData pairing unions powers separation infinite hI hP hG hr hμ hA + have generators := M.externalGeneratorGraphs_ground_injections pairing unions powers separation infinite + group hG words.letters_ground hm + exact ⟨words, M.externalGroupData pairing unions powers separation infinite group hG words.letters_ground hm hInv, + generators.1, generators.2.1, generators.2.2.1, generators.2.2.2, + origin.union_original_data completion.algebra.union pairing unions powers separation hI hSources hReps hG hT⟩ + +end GroundCompressionOrigin + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +noncomputable def externalCosetEquivalence (G S m one : ZFSet.{u}) : ZFSet.{u} := + externalCosetRelation (M.externalGroupCarrier G S m one) G + (M.externalOldInclusion G S m one) (M.externalGroupMultiplication G S m one) +noncomputable def externalCosetCarrier (G S m one : ZFSet.{u}) : ZFSet.{u} := + equivalenceClasses (M.externalGroupCarrier G S m one) (M.externalCosetEquivalence G S m one) +noncomputable def externalCosetClassifier (G S m one : ZFSet.{u}) : ZFSet.{u} := + equivalenceClassifier (M.externalGroupCarrier G S m one) (M.externalCosetEquivalence G S m one) + +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + +theorem externalCoset_old_entries : + letI := group.toGroup + ∀ j k, ZFSet.pair ((SetMembers.presentation G).encode j) ((sGroup).encode k) ∈ + M.externalOldInclusion G letters m one ↔ old (SetMembers G) (family).Letters j = k := by + let := group.toGroup + intro j k + rw [completion.externalFamilyGroupPresentation_old group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground] + exact Presentation.pair_mem_graph _ _ _ _ _ + +theorem externalCoset_mul_entries : + letI := group.toGroup + ∀ (w k v : External (SetMembers G) (family).Letters), ZFSet.pair (ZFSet.pair ((sGroup).encode w) ((sGroup).encode k)) ((sGroup).encode v) ∈ + M.externalGroupMultiplication G letters m one ↔ w * k = v := by + let := group.toGroup + intro w k v + rw [completion.externalFamilyGroupPresentation_multiplication group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground] + exact Presentation.pair_mem_graph ((sGroup).product (sGroup)) (sGroup) (fun p => p.1 * p.2) (w, k) v + +noncomputable def externalCosetPresentation : + letI := group.toGroup + Presentation (Vertex (SetMembers G) (family).Letters) := by + letI := group.toGroup + exact Forcing.externalCosetPresentation (sGroup) (SetMembers.presentation G) + (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) + +theorem externalCosetPresentation_carrier : + letI := group.toGroup + (data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG).carrier = + M.externalCosetCarrier G letters m one := by + let := group.toGroup + change equivalenceClasses (sGroup).carrier (externalCosetRelation (sGroup).carrier G + (M.externalOldInclusion G letters m one) (M.externalGroupMultiplication G letters m one)) = _ + rw [completion.externalFamilyGroupPresentation_carrier] + rfl + +theorem externalCosetEquivalence_iff : + letI := group.toGroup + ∀ w v, ZFSet.pair ((sGroup).encode w) ((sGroup).encode v) ∈ M.externalCosetEquivalence G letters m one ↔ + point (SetMembers G) (family).Letters w = point (SetMembers G) (family).Letters v := by + let := group.toGroup + have entries := Forcing.externalCosetRelation_iff (sGroup) (SetMembers.presentation G) + (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) + rw [completion.externalFamilyGroupPresentation_carrier] at entries + exact entries + +theorem externalCosetClassifier_entry_iff : + letI := group.toGroup + let q := data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG + ∀ w v, ZFSet.pair ((sGroup).encode w) (q.encode v) ∈ M.externalCosetClassifier G letters m one ↔ + point (SetMembers G) (family).Letters w = v := by + let := group.toGroup + dsimp only + have entries := Forcing.externalCosetClassifier_entry_iff (sGroup) (SetMembers.presentation G) + (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) + rw [completion.externalFamilyGroupPresentation_carrier] at entries + exact entries + +theorem externalCosetClassifier_graph : + letI := group.toGroup + M.externalCosetClassifier G letters m one = (sGroup).graph + (data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG) + (point (SetMembers G) (family).Letters) := by + let := group.toGroup + have equal := Forcing.externalCosetClassifier_eq_graph (sGroup) (SetMembers.presentation G) + (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) + rw [completion.externalFamilyGroupPresentation_carrier] at equal + exact equal + +include data pairing unions powers separation hG in +theorem externalCosets_ground : + M.externalCosetEquivalence G letters m one ∈ M.sets ∧ + M.externalCosetCarrier G letters m one ∈ M.sets ∧ M.externalCosetClassifier G letters m one ∈ M.sets := by + have relation := M.externalCosetRelation_mem pairing unions powers separation data.group.carrier_mem hG + data.old_inclusion_ground data.group.multiplication_mem + exact ⟨relation, M.equivalenceClasses_mem powers separation data.group.carrier_mem relation, + M.equivalenceClassifier_mem pairing unions powers separation data.group.carrier_mem relation⟩ + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalCosets_spec : + let E := M.externalGroupCarrier G letters m one + let Q := M.externalCosetCarrier G letters m one + let C := M.externalCosetClassifier G letters m one + EquivalenceRelationCode E (M.externalCosetEquivalence G letters m one) ∧ ZFSet.IsFunc E Q C ∧ + (∀ q ∈ Q, ∃ w ∈ E, ZFSet.pair w q ∈ C) ∧ + (∀ w v q t, ZFSet.pair w q ∈ C → ZFSet.pair v t ∈ C → + (q = t ↔ ZFSet.pair w v ∈ M.externalCosetEquivalence G letters m one)) := by + let := group.toGroup + have code := Forcing.externalCosetRelation_equivalence (sGroup) (SetMembers.presentation G) + (data.externalCoset_old_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) + rw [completion.externalFamilyGroupPresentation_carrier] at code + exact ⟨code, equivalenceClassifier_function _ _, fun _ hq => equivalenceClassifier_onto hq, + fun _ _ _ _ first second => code.classifier_kernel first second⟩ + +end GroundExternalGeometryInputs + + + + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +noncomputable def externalStarVertices (G S R m one : ZFSet.{u}) : ZFSet.{u} := + tileStarVertexCarrier (M.externalCosetCarrier G S m one) (M.externalGroupCarrier G S m one) R +noncomputable def externalStarEdges (G S R m one : ZFSet.{u}) : ZFSet.{u} := + tileStarEdgeCarrier (M.externalGroupCarrier G S m one) R S +noncomputable def externalStarDarts (G S R m one : ZFSet.{u}) : ZFSet.{u} := + tileStarDartCarrier (M.externalGroupCarrier G S m one) R S + +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original +local notation "sRequest" => externalRequestPresentation I P0 rectangles +local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG + +noncomputable def externalStarVertexPresentation : + letI := group.toGroup + Presentation (TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by + letI := group.toGroup + exact tileStarVertexPresentation (sGroup) (sRequest) (sCoset) + +noncomputable def externalStarEdgePresentation : + letI := group.toGroup + Presentation (TileStars.Edge (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by + letI := group.toGroup + exact tileStarEdgePresentation (sGroup) (sLetter) (sRequest) + +noncomputable def externalStarDartPresentation : + letI := group.toGroup + Presentation (TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by + letI := group.toGroup + exact tileStarDartPresentation (sGroup) (sLetter) (sRequest) + +theorem externalStarPresentations_carriers : + letI := group.toGroup + (data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG).carrier = + M.externalStarVertices G letters requests m one ∧ + (data.externalStarEdgePresentation group oldAction pairing unions powers separation infinite hG).carrier = + M.externalStarEdges G letters requests m one ∧ + (data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG).carrier = + M.externalStarDarts G letters requests m one := by + let := group.toGroup + change tileStarVertexCarrier (sCoset).carrier (sGroup).carrier requests = _ ∧ + tileStarEdgeCarrier (sGroup).carrier requests (sLetter).carrier = _ ∧ + tileStarDartCarrier (sGroup).carrier requests (sLetter).carrier = _ + rw [data.externalCosetPresentation_carrier, completion.externalFamilyGroupPresentation_carrier, + completion.externalFamilyLetterPresentation_carrier] + exact ⟨rfl, rfl, rfl⟩ + +include data pairing unions powers separation hG in +theorem externalStarCarriers_ground : + M.externalStarVertices G letters requests m one ∈ M.sets ∧ + M.externalStarEdges G letters requests m one ∈ M.sets ∧ + M.externalStarDarts G letters requests m one ∈ M.sets := by + exact M.tileStarCarriers_mem pairing unions powers separation + (data.externalCosets_ground pairing unions powers separation hG).2.1 + data.group.carrier_mem data.words.requests_ground data.words.letters_ground + +end GroundExternalGeometryInputs +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +noncomputable def tileStarRequestGraph (R S : ZFSet.{u}) : ZFSet.{u} := + graphRestriction S (productFirst R (natSetCode 2)) + +theorem pair_mem_tileStarRequestGraph {R S a c b : ZFSet.{u}} + (ha : a ∈ R) (hc : c ∈ natSetCode 2) (hs : ZFSet.pair a c ∈ S) : + ZFSet.pair (ZFSet.pair a c) b ∈ tileStarRequestGraph R S ↔ a = b := by + rw [tileStarRequestGraph, pair_mem_graphRestriction, mem_productFirst] + constructor + · rintro ⟨⟨x, _, y, _, equal⟩, _⟩ + have eq := ZFSet.pair_inj.1 equal + exact ((ZFSet.pair_inj.1 eq.1).1).trans eq.2.symm + · rintro rfl + exact ⟨⟨a, ha, c, hc, rfl⟩, hs⟩ + +theorem externalRequestChildCode_mem {I P R : ZFSet.{u}} + (r : ExternalRequestIndex I P R) (c : ExternalRequestChild r) : + externalRequestChildCode r c ∈ natSetCode 2 := by + rcases r with i | (x | r) + · exact (mem_natTwo_iff_externalSignCode _).2 ⟨false, rfl⟩ + · exact (mem_natTwo_iff_externalSignCode _).2 ⟨false, rfl⟩ + · exact (mem_natTwo_iff_externalSignCode _).2 ⟨c.down, rfl⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem tileStarRequestGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {R S : ZFSet.{u}} (hR : R ∈ M.sets) (hS : S ∈ M.sets) : tileStarRequestGraph R S ∈ M.sets := by + have hz : natSetCode 0 ∈ M.sets := M.empty_mem ⟨R, hR⟩ + have ho : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hz hz + have ht : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions ho ho + exact M.graphRestriction_mem unions separation hS (M.productFirst_mem pairing unions powers separation hR ht) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialExternalGeometryInputs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ I Sources Reps G m inv one T Filters, + ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, + GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion := by + dsimp only + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, ⟨compression⟩⟩ := + M.exists_groundInitialCompressionOrigin pairing unions powers separation collection infinite choice + hP hG hr hμ hA hLabels group action meet hτ top hC hD hrD hc hOriginal + originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember + priorSpace priorOrder priorMeet priorBirth priorHeight + exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, + origin.externalGeometryInputs compression.born.profiled.heighted.completion + pairing unions powers separation infinite hI hSources hReps hG hT hP hr hμ hA group hm hInv⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +noncomputable def externalStarSource (G S R m one : ZFSet.{u}) : ZFSet.{u} := + tileStarSourceGraph (M.externalGroupCarrier G S m one) R S (M.externalCosetCarrier G S m one) + (M.externalCosetClassifier G S m one) (tileStarRequestGraph R S) + (M.externalChildGenerators G S m one) (M.externalGroupMultiplication G S m one) +noncomputable def externalStarTarget (G S R m one : ZFSet.{u}) : ZFSet.{u} := + tileStarTargetGraph (M.externalGroupCarrier G S m one) R S (M.externalCosetCarrier G S m one) + (M.externalCosetClassifier G S m one) (tileStarRequestGraph R S) + (M.externalChildGenerators G S m one) (M.externalGroupMultiplication G S m one) +noncomputable def externalStarReverse (G S R m one : ZFSet.{u}) : ZFSet.{u} := + tileStarReverseGraph (M.externalGroupCarrier G S m one) R S +noncomputable def externalStarIncidence (G S R m one : ZFSet.{u}) : ZFSet.{u} := + dartIncidenceGraph (M.externalStarSource G S R m one) (M.externalStarTarget G S R m one) +noncomputable def externalStarAdjacency (G S R m one : ZFSet.{u}) : ZFSet.{u} := + dartAdjacencyGraph (M.externalStarDarts G S R m one) (M.externalStarVertices G S R m one) + (M.externalStarSource G S R m one) (M.externalStarTarget G S R m one) + +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original +local notation "sRequest" => externalRequestPresentation I P0 rectangles +local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG + +theorem externalStar_request_entries : + ∀ (a : (family).Letters) b, ZFSet.pair ((sLetter).encode a) ((sRequest).encode b) ∈ + tileStarRequestGraph requests letters ↔ a.1 = b := by + intro a b + let child := externalRequestChildCode a.1 (cast (completion.externalFamily_child group oldAction data.original a.1) a.2) + have shape : (sLetter).encode a = ZFSet.pair ((sRequest).encode a.1) child := rfl + have member := (sLetter).encode_mem a + rw [shape] at member ⊢ + exact (pair_mem_tileStarRequestGraph ((sRequest).encode_mem a.1) + (externalRequestChildCode_mem _ _) member).trans + ⟨fun h => (sRequest).injective h, congrArg (sRequest).encode⟩ + +theorem externalStar_generator_entries : + letI := group.toGroup + ∀ a b, ZFSet.pair ((sLetter).encode a) ((sGroup).encode b) ∈ M.externalChildGenerators G letters m one ↔ + generator (SetMembers G) (family).Letters a = b := by + let := group.toGroup + intro a b + rw [completion.externalFamilyGroupPresentation_generators group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground] + exact Presentation.pair_mem_graph (sLetter) (sGroup) _ a b + +theorem externalStarSource_iff : + letI := group.toGroup + ∀ (d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) + (v : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), + ZFSet.pair ((sDart).encode d) ((sVertex).encode v) ∈ M.externalStarSource G letters requests m one ↔ + TileStars.source (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v := by + let := group.toGroup + intro d v + have entries := tileStar_source_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) + (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStar_request_entries group oldAction) + (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) d v + rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, + data.externalCosetPresentation_carrier] at entries + exact entries + +theorem externalStarTarget_iff : + letI := group.toGroup + ∀ (d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) + (v : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), + ZFSet.pair ((sDart).encode d) ((sVertex).encode v) ∈ M.externalStarTarget G letters requests m one ↔ + TileStars.target (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v := by + let := group.toGroup + intro d v + have entries := tileStar_target_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) + (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStar_request_entries group oldAction) + (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) d v + rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, + data.externalCosetPresentation_carrier] at entries + exact entries + +theorem externalStarReverse_iff : + letI := group.toGroup + ∀ (d v : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), + ZFSet.pair ((sDart).encode d) ((sDart).encode v) ∈ M.externalStarReverse G letters requests m one ↔ + TileStars.reverse (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) d = v := by + let := group.toGroup + intro d v + have entries := tileStar_reverse_iff (sGroup) (sLetter) (sRequest) d v + rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier] at entries + exact entries + +theorem externalStarIncidence_iff : + letI := group.toGroup + ∀ (d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) + (v : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), ZFSet.pair ((sDart).encode d) ((sVertex).encode v) ∈ M.externalStarIncidence G letters requests m one ↔ + TileStars.source (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v ∨ + TileStars.target (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = v := by + let := group.toGroup + intro d v + have entries := tileStar_incidence_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) + (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStar_request_entries group oldAction) + (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) d v + rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, + data.externalCosetPresentation_carrier] at entries + exact entries + +theorem externalStarAdjacency_iff : + letI := group.toGroup + ∀ (x y : TileStars.Vertex (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)), ZFSet.pair ((sVertex).encode x) ((sVertex).encode y) ∈ M.externalStarAdjacency G letters requests m one ↔ + ∃ d : TileStars.Dart (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles), + TileStars.source (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = x ∧ + TileStars.target (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) d = y := by + let := group.toGroup + intro x y + have entries := tileStar_adjacency_iff (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) + (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStar_request_entries group oldAction) + (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) x y + rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, + data.externalCosetPresentation_carrier] at entries + exact entries + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarEndpoint_functions : + ZFSet.IsFunc (M.externalStarDarts G letters requests m one) (M.externalStarVertices G letters requests m one) + (M.externalStarSource G letters requests m one) ∧ + ZFSet.IsFunc (M.externalStarDarts G letters requests m one) (M.externalStarVertices G letters requests m one) + (M.externalStarTarget G letters requests m one) ∧ + ZFSet.IsFunc (M.externalStarDarts G letters requests m one) (M.externalStarDarts G letters requests m one) + (M.externalStarReverse G letters requests m one) := by + let := group.toGroup + have functions := tileStar_endpoint_functions (sGroup) (sLetter) (sRequest) (sCoset) (fun a => a.1) + (data.externalCosetClassifier_entry_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStar_request_entries group oldAction) + (data.externalStar_generator_entries group oldAction pairing unions powers separation infinite hG) + (data.externalCoset_mul_entries group oldAction pairing unions powers separation infinite hG) + rw [completion.externalFamilyGroupPresentation_carrier, completion.externalFamilyLetterPresentation_carrier, + data.externalCosetPresentation_carrier] at functions + exact functions + +include data pairing unions powers separation hG in +theorem externalStarIncidence_ground : + tileStarRequestGraph requests letters ∈ M.sets ∧ + M.externalStarSource G letters requests m one ∈ M.sets ∧ + M.externalStarTarget G letters requests m one ∈ M.sets ∧ + M.externalStarReverse G letters requests m one ∈ M.sets ∧ + M.externalStarIncidence G letters requests m one ∈ M.sets ∧ + M.externalStarAdjacency G letters requests m one ∈ M.sets := by + have req := M.tileStarRequestGraph_mem pairing unions powers separation data.words.requests_ground data.words.letters_ground + have cosets := data.externalCosets_ground pairing unions powers separation hG + have carriers := data.externalStarCarriers_ground pairing unions powers separation hG + have src := M.tileStarSourceGraph_mem pairing unions powers separation data.group.carrier_mem + data.words.requests_ground data.words.letters_ground cosets.2.1 cosets.2.2 req + data.generators_ground data.group.multiplication_mem + have tgt := M.tileStarTargetGraph_mem pairing unions powers separation data.group.carrier_mem + data.words.requests_ground data.words.letters_ground cosets.2.1 cosets.2.2 req + data.generators_ground data.group.multiplication_mem + have rev := M.tileStarReverseGraph_mem pairing unions powers separation data.group.carrier_mem + data.words.requests_ground data.words.letters_ground + exact ⟨req, src, tgt, rev, M.dartIncidenceGraph_mem pairing unions src tgt, + M.dartAdjacencyGraph_mem pairing unions powers separation carriers.2.2 carriers.1 src tgt⟩ + +end GroundExternalGeometryInputs +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundConstantBatchLayers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundConstantBatchLayers.lean index d17293dfe3741b29603130d10b0ae1e4cbdb2f1c..11e5237d25b8374896b98f67c332dc91c018086b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundConstantBatchLayers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundConstantBatchLayers.lean @@ -1,224 +1,224 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundTaggedComponentGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBatchBirths - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem batchTemplateGraph_eq_section (I P Qs rs As Es i : ZFSet.{u}) : - batchTemplateGraph I P Qs rs As Es i = - indexedRelationSection (familyPointBound Qs) - (taggedExtension P (indexedAttachmentFresh I Qs rs As)) - (batchAttachmentTemplateGraph I P Qs rs As Es) i := by - apply ZFSet.ext - intro z - rw [batchTemplateGraph, ZFSet.mem_sep, mem_indexedRelationSection] - constructor - · exact fun h => h.2 - · rintro ⟨q, hq, y, hy, rfl, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hq, hy⟩, q, hq, y, hy, rfl, entry⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def batchTemplateFamily (I P Qs rs As Es : ZFSet.{u}) : ZFSet.{u} := - M.indexedRelationSections I (familyPointBound Qs) - (taggedExtension P (indexedAttachmentFresh I Qs rs As)) - (batchAttachmentTemplateGraph I P Qs rs As Es) - -noncomputable def batchTemplateFamilyBound (I P Qs rs As : ZFSet.{u}) : ZFSet.{u} := - M.groundRelations (familyPointBound Qs) - (taggedExtension P (indexedAttachmentFresh I Qs rs As)) - -theorem batchTemplateFamily_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I P Qs rs As Es : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) : - M.batchTemplateFamilyBound I P Qs rs As ∈ M.sets ∧ - M.batchTemplateFamily I P Qs rs As Es ∈ M.sets ∧ - ZFSet.IsFunc I (M.batchTemplateFamilyBound I P Qs rs As) - (M.batchTemplateFamily I P Qs rs As Es) ∧ - ∀ i e, ZFSet.pair i e ∈ M.batchTemplateFamily I P Qs rs As Es ↔ - i ∈ I ∧ e = batchTemplateGraph I P Qs rs As Es i := by - have hPoints := M.familyPointBound_mem unions hQs - have hL := M.taggedExtension_mem pairing unions powers separation hP - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) - have hGraph := M.batchAttachmentTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs - have spec := M.indexedRelationSections_spec pairing unions powers separation hI hPoints hL hGraph - refine ⟨M.groundRelations_mem pairing unions powers separation hPoints hL, spec.1, spec.2.1, ?_⟩ - intro i e - exact (spec.2.2 i e).trans (and_congr Iff.rfl (by rw [batchTemplateGraph_eq_section])) - -end TransitiveGround - -namespace AttachmentBatchInputs -variable {M : TransitiveGround.{u}} -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) - -noncomputable abbrev batchIncomingFiber (_d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) := ZFSet.prod {P} (indexedAttachmentFresh I Qs rs As) -noncomputable abbrev batchIncomingComponents (_d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) := - taggedComponentGraph P I (familyPointBound Qs) (indexedAttachmentFresh I Qs rs As) - -theorem batchIncomingFiber_eq {birth stamp : ZFSet.{u}} - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) : - d.batchIncomingFiber = layerBirthFiber d.batchCarrier (d.batchBirth birth stamp) stamp := by - apply ZFSet.ext - intro x - rw [mem_layerBirthFiber] - constructor - · intro hx - exact ⟨ZFSet.mem_union.2 (Or.inr hx), (taggedBirth_stamp_iff earlier).2 hx⟩ - · exact fun hx => (taggedBirth_stamp_iff earlier).1 hx.2 - -theorem batchIncomingComponents_function : - ZFSet.IsFunc d.batchIncomingFiber I d.batchIncomingComponents := - taggedComponentGraph_function (fun _ hn => indexedAttachmentDomain_subset I Qs - (indexedAttachmentFresh_subset I Qs rs As hn)) - -theorem batchIncomingComponents_encode (q : d.templates.Fresh) {i : ZFSet.{u}} - (entry : ZFSet.pair (d.coding.encode (.inr q)) i ∈ d.batchIncomingComponents) : - q.1.val = i := by - obtain ⟨_, z, _, _, equal⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 entry - change ZFSet.pair P (ZFSet.pair q.1.val q.2.val.val) = ZFSet.pair P (ZFSet.pair i z) at equal - exact (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).2).1 - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) -variable (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) - -include pairing unions powers separation hP hI hQs hrs hAs in -theorem batchIncomingComponents_ground : - d.batchIncomingFiber ∈ M.sets ∧ d.batchIncomingComponents ∈ M.sets := by - have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs - have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - exact ⟨M.prod_mem pairing unions powers separation hSingle hN, - M.taggedComponentGraph_mem pairing unions powers separation hP hI - (M.familyPointBound_mem unions hQs) hN⟩ - -include pairing unions powers separation hP hI hQs hrs hAs hEs in -theorem batchSeparatedLayerCode - {HQs Hrs Hμs HTime T birth stamp Indices : ZFSet.{u}} - (historySpaces : FunctionGraphOn HTime HQs) - (historyOrders : FunctionGraphOn HTime Hrs) - (historyMeets : FunctionGraphOn HTime Hμs) - (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (indices : ZFSet.IsFunc I stamp Indices) - (sourceMatches : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ s, - ZFSet.pair i.val s ∈ Indices → - ZFSet.pair s (d.space i) ∈ HQs ∧ ZFSet.pair s (d.rel i) ∈ Hrs ∧ - ZFSet.pair s (d.meet i) ∈ Hμs) : - SeparatedLayerCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph - (d.batchBirth birth stamp) stamp I Indices (M.batchTemplateFamily I P Qs rs As Es) - (M.batchTemplateFamilyBound I P Qs rs As) d.batchIncomingComponents d.batchIncomingFiber := by - have maps := M.batchTemplateFamily_spec pairing unions powers separation hI hP hQs hrs hAs hEs - refine ⟨indices, maps.2.2.1, d.batchIncomingFiber_eq earlier, - d.batchIncomingComponents_function, ?_, ?_, ?_⟩ - · intro i hi s _ e Q R V indexEntry mapEntry spaceEntry orderEntry meetEntry - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have matching := sourceMatches j s indexEntry - have qeq := historySpaces.unique spaceEntry matching.1 - have req := historyOrders.unique orderEntry matching.2.1 - have veq := historyMeets.unique meetEntry matching.2.2 - have eeq := ((maps.2.2.2 i e).1 mapEntry).2 - subst Q R V e - exact d.batch_template_embedding_code j - · intro i hi s _ e Q x hx indexEntry mapEntry spaceEntry componentEntry - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have qeq := historySpaces.unique spaceEntry (sourceMatches j s indexEntry).1 - have eeq := ((maps.2.2.2 i e).1 mapEntry).2 - subst Q e - obtain ⟨_, q, _, fresh, rfl⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 componentEntry - have qFresh := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors - (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh - exact (mem_relationImage _ _ _ _).2 ⟨hx, q, (mem_freshPart _ _ _ _).1 qFresh |>.1, - (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 - ((d.batch_template_entry_iff j q _).2 (Or.inr ⟨qFresh, rfl⟩))⟩ - · intro x hx y hy i _ j _ componentX componentY different - obtain ⟨qx, eqx⟩ := d.batchBirth_fresh_cases earlier ((taggedBirth_stamp_iff earlier).2 hx) - obtain ⟨qy, eqy⟩ := d.batchBirth_fresh_cases earlier ((taggedBirth_stamp_iff earlier).2 hy) - have first := d.batchIncomingComponents_encode qx (eqx.symm ▸ componentX) - have second := d.batchIncomingComponents_encode qy (eqy.symm ▸ componentY) - have neq : qx.1 ≠ qy.1 := fun equal => different - (first.symm.trans ((congrArg Subtype.val equal).trans second)) - exact eqx ▸ eqy ▸ d.batchBirth_different_components_bridge born earlier qx qy neq - -include pairing unions powers separation hP hI hQs hrs hAs hEs in -theorem batchSeparatedWitness - {HQs Hrs Hμs HTime T birth stamp Indices N : ZFSet.{u}} - (historySpaces : FunctionGraphOn HTime HQs) - (historyOrders : FunctionGraphOn HTime Hrs) - (historyMeets : FunctionGraphOn HTime Hμs) - (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (hIndices : Indices ∈ M.sets) (indices : ZFSet.IsFunc I stamp Indices) - (sourceMatches : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ s, - ZFSet.pair i.val s ∈ Indices → - ZFSet.pair s (d.space i) ∈ HQs ∧ ZFSet.pair s (d.rel i) ∈ Hrs ∧ - ZFSet.pair s (d.meet i) ∈ Hμs) : - let z := separatedLayerWitness I Indices (M.batchTemplateFamily I P Qs rs As Es) - (M.batchTemplateFamilyBound I P Qs rs As) d.batchIncomingComponents d.batchIncomingFiber - z ∈ M.sets ∧ GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph - (d.batchBirth birth stamp) stamp N z := by - have maps := M.batchTemplateFamily_spec pairing unions powers separation hI hP hQs hrs hAs hEs - have components := d.batchIncomingComponents_ground pairing unions powers separation hP hI hQs hrs hAs - exact ⟨M.separatedLayerWitness_mem pairing unions hI hIndices maps.2.1 maps.1 components.2 components.1, - Or.inr (Or.inr ⟨I, Indices, _, _, _, _, rfl, - d.batchSeparatedLayerCode pairing unions powers separation hP hI hQs hrs hAs hEs - historySpaces historyOrders historyMeets born earlier indices sourceMatches⟩)⟩ - -end AttachmentBatchInputs - -namespace AttachmentBatchInputs -variable {M : TransitiveGround.{u}} -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) - -noncomputable def constantBatchLayerWitness (M : TransitiveGround.{u}) (τ : ZFSet.{u}) : ZFSet.{u} := - separatedLayerWitness I (constantFamilyGraph I τ) (M.batchTemplateFamily I P Qs rs As Es) - (M.batchTemplateFamilyBound I P Qs rs As) d.batchIncomingComponents d.batchIncomingFiber - -theorem constantBatchLayerWitness_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) - (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) - {HQs Hrs Hμs HTime T birth stamp τ P0 r0 μ0 N : ZFSet.{u}} - (historySpaces : FunctionGraphOn HTime HQs) - (historyOrders : FunctionGraphOn HTime Hrs) - (historyMeets : FunctionGraphOn HTime Hμs) - (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (hStamp : stamp ∈ M.sets) (before : τ ∈ stamp) - (constant : ∀ i, d.space i = P0 ∧ d.rel i = r0 ∧ d.meet i = μ0) - (source : ZFSet.pair τ P0 ∈ HQs ∧ ZFSet.pair τ r0 ∈ Hrs ∧ ZFSet.pair τ μ0 ∈ Hμs) : - d.constantBatchLayerWitness M τ ∈ M.sets ∧ - GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph - (d.batchBirth birth stamp) stamp N (d.constantBatchLayerWitness M τ) := by - have indices : ZFSet.IsFunc I stamp (constantFamilyGraph I τ) := by - refine ⟨?_, (constantFamilyGraph_function I τ).2⟩ - intro z hz - obtain ⟨i, hi, s, hs, rfl⟩ := ZFSet.mem_prod.1 ((constantFamilyGraph_function I τ).1 hz) - obtain rfl := ZFSet.mem_singleton.1 hs - exact ZFSet.pair_mem_prod.2 ⟨hi, before⟩ - apply d.batchSeparatedWitness pairing unions powers separation hP hI hQs hrs hAs hEs - historySpaces historyOrders historyMeets born earlier - (M.constantFamilyGraph_mem pairing unions powers separation hI (M.transitive hStamp before)) indices - intro i s entry - obtain rfl := ((pair_mem_constantFamilyGraph I τ i.val s).1 entry).2 - simpa only [(constant i).1, (constant i).2.1, (constant i).2.2] using source - -end AttachmentBatchInputs -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundTaggedComponentGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBatchBirths + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem batchTemplateGraph_eq_section (I P Qs rs As Es i : ZFSet.{u}) : + batchTemplateGraph I P Qs rs As Es i = + indexedRelationSection (familyPointBound Qs) + (taggedExtension P (indexedAttachmentFresh I Qs rs As)) + (batchAttachmentTemplateGraph I P Qs rs As Es) i := by + apply ZFSet.ext + intro z + rw [batchTemplateGraph, ZFSet.mem_sep, mem_indexedRelationSection] + constructor + · exact fun h => h.2 + · rintro ⟨q, hq, y, hy, rfl, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hq, hy⟩, q, hq, y, hy, rfl, entry⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def batchTemplateFamily (I P Qs rs As Es : ZFSet.{u}) : ZFSet.{u} := + M.indexedRelationSections I (familyPointBound Qs) + (taggedExtension P (indexedAttachmentFresh I Qs rs As)) + (batchAttachmentTemplateGraph I P Qs rs As Es) + +noncomputable def batchTemplateFamilyBound (I P Qs rs As : ZFSet.{u}) : ZFSet.{u} := + M.groundRelations (familyPointBound Qs) + (taggedExtension P (indexedAttachmentFresh I Qs rs As)) + +theorem batchTemplateFamily_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I P Qs rs As Es : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) : + M.batchTemplateFamilyBound I P Qs rs As ∈ M.sets ∧ + M.batchTemplateFamily I P Qs rs As Es ∈ M.sets ∧ + ZFSet.IsFunc I (M.batchTemplateFamilyBound I P Qs rs As) + (M.batchTemplateFamily I P Qs rs As Es) ∧ + ∀ i e, ZFSet.pair i e ∈ M.batchTemplateFamily I P Qs rs As Es ↔ + i ∈ I ∧ e = batchTemplateGraph I P Qs rs As Es i := by + have hPoints := M.familyPointBound_mem unions hQs + have hL := M.taggedExtension_mem pairing unions powers separation hP + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) + have hGraph := M.batchAttachmentTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs + have spec := M.indexedRelationSections_spec pairing unions powers separation hI hPoints hL hGraph + refine ⟨M.groundRelations_mem pairing unions powers separation hPoints hL, spec.1, spec.2.1, ?_⟩ + intro i e + exact (spec.2.2 i e).trans (and_congr Iff.rfl (by rw [batchTemplateGraph_eq_section])) + +end TransitiveGround + +namespace AttachmentBatchInputs +variable {M : TransitiveGround.{u}} +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) + +noncomputable abbrev batchIncomingFiber (_d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) := ZFSet.prod {P} (indexedAttachmentFresh I Qs rs As) +noncomputable abbrev batchIncomingComponents (_d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) := + taggedComponentGraph P I (familyPointBound Qs) (indexedAttachmentFresh I Qs rs As) + +theorem batchIncomingFiber_eq {birth stamp : ZFSet.{u}} + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) : + d.batchIncomingFiber = layerBirthFiber d.batchCarrier (d.batchBirth birth stamp) stamp := by + apply ZFSet.ext + intro x + rw [mem_layerBirthFiber] + constructor + · intro hx + exact ⟨ZFSet.mem_union.2 (Or.inr hx), (taggedBirth_stamp_iff earlier).2 hx⟩ + · exact fun hx => (taggedBirth_stamp_iff earlier).1 hx.2 + +theorem batchIncomingComponents_function : + ZFSet.IsFunc d.batchIncomingFiber I d.batchIncomingComponents := + taggedComponentGraph_function (fun _ hn => indexedAttachmentDomain_subset I Qs + (indexedAttachmentFresh_subset I Qs rs As hn)) + +theorem batchIncomingComponents_encode (q : d.templates.Fresh) {i : ZFSet.{u}} + (entry : ZFSet.pair (d.coding.encode (.inr q)) i ∈ d.batchIncomingComponents) : + q.1.val = i := by + obtain ⟨_, z, _, _, equal⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 entry + change ZFSet.pair P (ZFSet.pair q.1.val q.2.val.val) = ZFSet.pair P (ZFSet.pair i z) at equal + exact (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).2).1 + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) +variable (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) + +include pairing unions powers separation hP hI hQs hrs hAs in +theorem batchIncomingComponents_ground : + d.batchIncomingFiber ∈ M.sets ∧ d.batchIncomingComponents ∈ M.sets := by + have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs + have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + exact ⟨M.prod_mem pairing unions powers separation hSingle hN, + M.taggedComponentGraph_mem pairing unions powers separation hP hI + (M.familyPointBound_mem unions hQs) hN⟩ + +include pairing unions powers separation hP hI hQs hrs hAs hEs in +theorem batchSeparatedLayerCode + {HQs Hrs Hμs HTime T birth stamp Indices : ZFSet.{u}} + (historySpaces : FunctionGraphOn HTime HQs) + (historyOrders : FunctionGraphOn HTime Hrs) + (historyMeets : FunctionGraphOn HTime Hμs) + (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (indices : ZFSet.IsFunc I stamp Indices) + (sourceMatches : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ s, + ZFSet.pair i.val s ∈ Indices → + ZFSet.pair s (d.space i) ∈ HQs ∧ ZFSet.pair s (d.rel i) ∈ Hrs ∧ + ZFSet.pair s (d.meet i) ∈ Hμs) : + SeparatedLayerCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph + (d.batchBirth birth stamp) stamp I Indices (M.batchTemplateFamily I P Qs rs As Es) + (M.batchTemplateFamilyBound I P Qs rs As) d.batchIncomingComponents d.batchIncomingFiber := by + have maps := M.batchTemplateFamily_spec pairing unions powers separation hI hP hQs hrs hAs hEs + refine ⟨indices, maps.2.2.1, d.batchIncomingFiber_eq earlier, + d.batchIncomingComponents_function, ?_, ?_, ?_⟩ + · intro i hi s _ e Q R V indexEntry mapEntry spaceEntry orderEntry meetEntry + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have matching := sourceMatches j s indexEntry + have qeq := historySpaces.unique spaceEntry matching.1 + have req := historyOrders.unique orderEntry matching.2.1 + have veq := historyMeets.unique meetEntry matching.2.2 + have eeq := ((maps.2.2.2 i e).1 mapEntry).2 + subst Q R V e + exact d.batch_template_embedding_code j + · intro i hi s _ e Q x hx indexEntry mapEntry spaceEntry componentEntry + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have qeq := historySpaces.unique spaceEntry (sourceMatches j s indexEntry).1 + have eeq := ((maps.2.2.2 i e).1 mapEntry).2 + subst Q e + obtain ⟨_, q, _, fresh, rfl⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 componentEntry + have qFresh := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors + (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh + exact (mem_relationImage _ _ _ _).2 ⟨hx, q, (mem_freshPart _ _ _ _).1 qFresh |>.1, + (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 + ((d.batch_template_entry_iff j q _).2 (Or.inr ⟨qFresh, rfl⟩))⟩ + · intro x hx y hy i _ j _ componentX componentY different + obtain ⟨qx, eqx⟩ := d.batchBirth_fresh_cases earlier ((taggedBirth_stamp_iff earlier).2 hx) + obtain ⟨qy, eqy⟩ := d.batchBirth_fresh_cases earlier ((taggedBirth_stamp_iff earlier).2 hy) + have first := d.batchIncomingComponents_encode qx (eqx.symm ▸ componentX) + have second := d.batchIncomingComponents_encode qy (eqy.symm ▸ componentY) + have neq : qx.1 ≠ qy.1 := fun equal => different + (first.symm.trans ((congrArg Subtype.val equal).trans second)) + exact eqx ▸ eqy ▸ d.batchBirth_different_components_bridge born earlier qx qy neq + +include pairing unions powers separation hP hI hQs hrs hAs hEs in +theorem batchSeparatedWitness + {HQs Hrs Hμs HTime T birth stamp Indices N : ZFSet.{u}} + (historySpaces : FunctionGraphOn HTime HQs) + (historyOrders : FunctionGraphOn HTime Hrs) + (historyMeets : FunctionGraphOn HTime Hμs) + (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (hIndices : Indices ∈ M.sets) (indices : ZFSet.IsFunc I stamp Indices) + (sourceMatches : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ s, + ZFSet.pair i.val s ∈ Indices → + ZFSet.pair s (d.space i) ∈ HQs ∧ ZFSet.pair s (d.rel i) ∈ Hrs ∧ + ZFSet.pair s (d.meet i) ∈ Hμs) : + let z := separatedLayerWitness I Indices (M.batchTemplateFamily I P Qs rs As Es) + (M.batchTemplateFamilyBound I P Qs rs As) d.batchIncomingComponents d.batchIncomingFiber + z ∈ M.sets ∧ GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph + (d.batchBirth birth stamp) stamp N z := by + have maps := M.batchTemplateFamily_spec pairing unions powers separation hI hP hQs hrs hAs hEs + have components := d.batchIncomingComponents_ground pairing unions powers separation hP hI hQs hrs hAs + exact ⟨M.separatedLayerWitness_mem pairing unions hI hIndices maps.2.1 maps.1 components.2 components.1, + Or.inr (Or.inr ⟨I, Indices, _, _, _, _, rfl, + d.batchSeparatedLayerCode pairing unions powers separation hP hI hQs hrs hAs hEs + historySpaces historyOrders historyMeets born earlier indices sourceMatches⟩)⟩ + +end AttachmentBatchInputs + +namespace AttachmentBatchInputs +variable {M : TransitiveGround.{u}} +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) + +noncomputable def constantBatchLayerWitness (M : TransitiveGround.{u}) (τ : ZFSet.{u}) : ZFSet.{u} := + separatedLayerWitness I (constantFamilyGraph I τ) (M.batchTemplateFamily I P Qs rs As Es) + (M.batchTemplateFamilyBound I P Qs rs As) d.batchIncomingComponents d.batchIncomingFiber + +theorem constantBatchLayerWitness_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) + (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) + {HQs Hrs Hμs HTime T birth stamp τ P0 r0 μ0 N : ZFSet.{u}} + (historySpaces : FunctionGraphOn HTime HQs) + (historyOrders : FunctionGraphOn HTime Hrs) + (historyMeets : FunctionGraphOn HTime Hμs) + (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (hStamp : stamp ∈ M.sets) (before : τ ∈ stamp) + (constant : ∀ i, d.space i = P0 ∧ d.rel i = r0 ∧ d.meet i = μ0) + (source : ZFSet.pair τ P0 ∈ HQs ∧ ZFSet.pair τ r0 ∈ Hrs ∧ ZFSet.pair τ μ0 ∈ Hμs) : + d.constantBatchLayerWitness M τ ∈ M.sets ∧ + GrowthLayerWitnessCode HQs Hrs Hμs d.batchCarrier d.batchOrder d.batchMeetGraph + (d.batchBirth birth stamp) stamp N (d.constantBatchLayerWitness M τ) := by + have indices : ZFSet.IsFunc I stamp (constantFamilyGraph I τ) := by + refine ⟨?_, (constantFamilyGraph_function I τ).2⟩ + intro z hz + obtain ⟨i, hi, s, hs, rfl⟩ := ZFSet.mem_prod.1 ((constantFamilyGraph_function I τ).1 hz) + obtain rfl := ZFSet.mem_singleton.1 hs + exact ZFSet.pair_mem_prod.2 ⟨hi, before⟩ + apply d.batchSeparatedWitness pairing unions powers separation hP hI hQs hrs hAs hEs + historySpaces historyOrders historyMeets born earlier + (M.constantFamilyGraph_mem pairing unions powers separation hI (M.transitive hStamp before)) indices + intro i s entry + obtain rfl := ((pair_mem_constantFamilyGraph I τ i.val s).1 entry).2 + simpa only [(constant i).1, (constant i).2.1, (constant i).2.2] using source + +end AttachmentBatchInputs +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundContainmentOrders.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundContainmentOrders.lean index d41f0690263672f460a5101be452e654c74cb57e..b2e9b3f47e5aa23e6e51a42ef6337a690059f644 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundContainmentOrders.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundContainmentOrders.lean @@ -1,188 +1,188 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionGenericity - -namespace OAI - -section - -namespace PartitionPilot.Forcing.PartialOrderCode - -open SetRealization -universe u -variable {Q R : ZFSet.{u}} (h : PartialOrderCode Q R) - -@[instance_reducible] -noncomputable def toPartialOrder : PartialOrder (SetMembers Q) where - le x y := ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ R - le_refl x := h.refl _ (SetMembers.raw_mem x) - le_trans x y z xy yz := h.trans _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) - _ (SetMembers.raw_mem z) xy yz - le_antisymm x y xy yx := SetMembers.raw_injective Q - (h.antisymm _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) xy yx) - -theorem conditionOrder_eq : - letI _decodedOrder := h.toPartialOrder - (SetMembers.presentation Q).conditionOrder = R := by - let decodedOrder := h.toPartialOrder - apply ZFSet.ext - intro z - rw [Presentation.conditionOrder, Presentation.mem_subset] - constructor - · rintro ⟨⟨x, y⟩, le, eq⟩ - change ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) = z at eq - exact eq ▸ le - · intro hz - obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (h.relation hz) - refine ⟨(SetMembers.ofMem x hx, SetMembers.ofMem y hy), ?_, ?_⟩ - · change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x hx)) - (SetMembers.raw (SetMembers.ofMem y hy)) ∈ R - rw [SetMembers.raw_ofMem, SetMembers.raw_ofMem, ← eq] - exact hz - · change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x hx)) - (SetMembers.raw (SetMembers.ofMem y hy)) = z - rw [SetMembers.raw_ofMem, SetMembers.raw_ofMem] - exact eq.symm - -@[instance_reducible] -noncomputable def toOrderTop (one : ZFSet.{u}) (hone : one ∈ Q) - (greatest : ∀ x ∈ Q, ZFSet.pair x one ∈ R) : - letI _decodedOrder := h.toPartialOrder - OrderTop (SetMembers Q) := by - letI decodedOrder := h.toPartialOrder - refine { top := SetMembers.ofMem one hone, le_top := ?_ } - intro x - change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem one hone)) ∈ R - rw [SetMembers.raw_ofMem] - exact greatest _ (SetMembers.raw_mem x) - -end PartitionPilot.Forcing.PartialOrderCode - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem decoded_order_mem {Q R : ZFSet.{u}} (h : PartialOrderCode Q R) (hR : R ∈ M.sets) : - letI _decodedOrder := h.toPartialOrder - (SetMembers.presentation Q).conditionOrder ∈ M.sets := by - let decodedOrder := h.toPartialOrder - rw [h.conditionOrder_eq] - exact hR - -theorem exists_decoded_generic (small : M.sets.Countable) - {Q R : ZFSet.{u}} (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) - (laws : Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula - (extend Q (extend R Fin.elim0))) (p : SetMembers Q) : - letI _decodedOrder := ((M.realize_partialOrderCode hQ hR).1 laws).toPartialOrder - ∃ H : ConditionFilter (SetMembers Q), H.mem p ∧ - H.GenericFor (M.codedFamily (SetMembers.presentation Q)) ∧ - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) := by - let h := (M.realize_partialOrderCode hQ hR).1 laws - let decodedOrder := h.toPartialOrder - let decodedCountable := M.setMembers_countable small hQ - let s := SetMembers.presentation Q - have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) - obtain ⟨H, hp, generic⟩ := exists_generic_for_countable_family p - (M.codedFamily s ∪ formulaFamily (M.nameDomain s)) ((M.codedFamily_countable s small).union ordinary) - exact ⟨H, hp, (fun E hE => generic E (Or.inl hE)), fun E hE => generic E (Or.inr hE)⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def reverseInclusionCode (Q : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ p ∈ Q, ∃ q ∈ Q, z = ZFSet.pair p q ∧ q ⊆ p) (ZFSet.prod Q Q) - -theorem mem_reverseInclusionCode (Q z : ZFSet.{u}) : - z ∈ reverseInclusionCode Q ↔ ∃ p ∈ Q, ∃ q ∈ Q, z = ZFSet.pair p q ∧ q ⊆ p := by - rw [reverseInclusionCode, ZFSet.mem_sep] - exact ⟨And.right, fun ⟨p, hp, q, hq, eq, subset⟩ => - ⟨ZFSet.mem_prod.2 ⟨p, hp, q, hq, eq⟩, p, hp, q, hq, eq, subset⟩⟩ - -theorem pair_mem_reverseInclusionCode (Q p q : ZFSet.{u}) : - ZFSet.pair p q ∈ reverseInclusionCode Q ↔ p ∈ Q ∧ q ∈ Q ∧ q ⊆ p := by - rw [mem_reverseInclusionCode] - constructor - · rintro ⟨a, ha, b, hb, eq, subset⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨ha, hb, subset⟩ - · rintro ⟨hp, hq, subset⟩ - exact ⟨p, hp, q, hq, rfl, subset⟩ - -theorem reverseInclusion_partialOrder (Q : ZFSet.{u}) : PartialOrderCode Q (reverseInclusionCode Q) where - relation := fun _ hz => (ZFSet.mem_sep.1 hz).1 - refl p hp := (pair_mem_reverseInclusionCode Q p p).2 ⟨hp, hp, fun _ hx => hx⟩ - antisymm p _ q _ pq qp := ZFSet.ext (fun _ => - ⟨fun hz => ((pair_mem_reverseInclusionCode Q q p).1 qp).2.2 hz, - fun hz => ((pair_mem_reverseInclusionCode Q p q).1 pq).2.2 hz⟩) - trans p hp q _ r hr pq qr := (pair_mem_reverseInclusionCode Q p r).2 ⟨hp, hr, - fun _ hx => ((pair_mem_reverseInclusionCode Q p q).1 pq).2.2 - (((pair_mem_reverseInclusionCode Q q r).1 qr).2.2 hx)⟩ - -theorem reverseInclusion_empty_top {Q : ZFSet.{u}} (empty : (∅ : ZFSet.{u}) ∈ Q) : - ∀ p ∈ Q, ZFSet.pair p ∅ ∈ reverseInclusionCode Q := - fun p hp => (pair_mem_reverseInclusionCode Q p ∅).2 ⟨hp, empty, ZFSet.empty_subset p⟩ - -namespace BoundedFormula - -open SetFormula - -def subsetFormula {n} (a b : Fin n) : BoundedFormula n := .allMem a (.mem 0 b.succ) - -def reverseInclusionEntryFormula {n} (z q : Fin n) : BoundedFormula n := - exMem q (exMem q.succ (.conj (orderedPairFormula z.succ.succ 1 0) (subsetFormula 0 1))) - -theorem truth_subsetFormula {n} (a b : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (subsetFormula a b) env ↔ env a ⊆ env b := Iff.rfl - -theorem truth_reverseInclusionEntryFormula {n} (z q : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (reverseInclusionEntryFormula z q) env ↔ env z ∈ reverseInclusionCode (env q) := by - simp only [reverseInclusionEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_subsetFormula] - exact (mem_reverseInclusionCode (env q) (env z)).symm - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem reverseInclusionCode_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) : reverseInclusionCode Q ∈ M.sets := by - have pairs := M.prod_mem pairing unions powers separation hQ hQ - let params := extend Q Fin.elim0 - have selected := M.separation_mem separation (BoundedFormula.reverseInclusionEntryFormula 0 1).toFormula - params (Fin.cases hQ (fun j => Fin.elim0 j)) pairs - have correct (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets (BoundedFormula.reverseInclusionEntryFormula 0 1).toFormula (extend z params) ↔ - z ∈ reverseInclusionCode Q := - (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz (Fin.cases hQ (fun j => Fin.elim0 j)))).trans - (BoundedFormula.truth_reverseInclusionEntryFormula 0 1 _) - have eq : ZFSet.sep (fun z => Realize M.sets - (BoundedFormula.reverseInclusionEntryFormula 0 1).toFormula (extend z params)) (ZFSet.prod Q Q) = - reverseInclusionCode Q := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact (correct z (M.transitive pairs hz)).1 rel - · intro hz - have hzP := (reverseInclusion_partialOrder Q).relation hz - exact ⟨hzP, (correct z (M.transitive pairs hzP)).2 hz⟩ - exact eq ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionGenericity + +namespace OAI + +section + +namespace PartitionPilot.Forcing.PartialOrderCode + +open SetRealization +universe u +variable {Q R : ZFSet.{u}} (h : PartialOrderCode Q R) + +@[instance_reducible] +noncomputable def toPartialOrder : PartialOrder (SetMembers Q) where + le x y := ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ R + le_refl x := h.refl _ (SetMembers.raw_mem x) + le_trans x y z xy yz := h.trans _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) + _ (SetMembers.raw_mem z) xy yz + le_antisymm x y xy yx := SetMembers.raw_injective Q + (h.antisymm _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) xy yx) + +theorem conditionOrder_eq : + letI _decodedOrder := h.toPartialOrder + (SetMembers.presentation Q).conditionOrder = R := by + let decodedOrder := h.toPartialOrder + apply ZFSet.ext + intro z + rw [Presentation.conditionOrder, Presentation.mem_subset] + constructor + · rintro ⟨⟨x, y⟩, le, eq⟩ + change ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) = z at eq + exact eq ▸ le + · intro hz + obtain ⟨x, hx, y, hy, eq⟩ := ZFSet.mem_prod.1 (h.relation hz) + refine ⟨(SetMembers.ofMem x hx, SetMembers.ofMem y hy), ?_, ?_⟩ + · change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x hx)) + (SetMembers.raw (SetMembers.ofMem y hy)) ∈ R + rw [SetMembers.raw_ofMem, SetMembers.raw_ofMem, ← eq] + exact hz + · change ZFSet.pair (SetMembers.raw (SetMembers.ofMem x hx)) + (SetMembers.raw (SetMembers.ofMem y hy)) = z + rw [SetMembers.raw_ofMem, SetMembers.raw_ofMem] + exact eq.symm + +@[instance_reducible] +noncomputable def toOrderTop (one : ZFSet.{u}) (hone : one ∈ Q) + (greatest : ∀ x ∈ Q, ZFSet.pair x one ∈ R) : + letI _decodedOrder := h.toPartialOrder + OrderTop (SetMembers Q) := by + letI decodedOrder := h.toPartialOrder + refine { top := SetMembers.ofMem one hone, le_top := ?_ } + intro x + change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem one hone)) ∈ R + rw [SetMembers.raw_ofMem] + exact greatest _ (SetMembers.raw_mem x) + +end PartitionPilot.Forcing.PartialOrderCode + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem decoded_order_mem {Q R : ZFSet.{u}} (h : PartialOrderCode Q R) (hR : R ∈ M.sets) : + letI _decodedOrder := h.toPartialOrder + (SetMembers.presentation Q).conditionOrder ∈ M.sets := by + let decodedOrder := h.toPartialOrder + rw [h.conditionOrder_eq] + exact hR + +theorem exists_decoded_generic (small : M.sets.Countable) + {Q R : ZFSet.{u}} (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) + (laws : Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula + (extend Q (extend R Fin.elim0))) (p : SetMembers Q) : + letI _decodedOrder := ((M.realize_partialOrderCode hQ hR).1 laws).toPartialOrder + ∃ H : ConditionFilter (SetMembers Q), H.mem p ∧ + H.GenericFor (M.codedFamily (SetMembers.presentation Q)) ∧ + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) := by + let h := (M.realize_partialOrderCode hQ hR).1 laws + let decodedOrder := h.toPartialOrder + let decodedCountable := M.setMembers_countable small hQ + let s := SetMembers.presentation Q + have ordinary := formulaFamily_countable (M.nameDomain s) (M.nameDomain_countable s small) + obtain ⟨H, hp, generic⟩ := exists_generic_for_countable_family p + (M.codedFamily s ∪ formulaFamily (M.nameDomain s)) ((M.codedFamily_countable s small).union ordinary) + exact ⟨H, hp, (fun E hE => generic E (Or.inl hE)), fun E hE => generic E (Or.inr hE)⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def reverseInclusionCode (Q : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ p ∈ Q, ∃ q ∈ Q, z = ZFSet.pair p q ∧ q ⊆ p) (ZFSet.prod Q Q) + +theorem mem_reverseInclusionCode (Q z : ZFSet.{u}) : + z ∈ reverseInclusionCode Q ↔ ∃ p ∈ Q, ∃ q ∈ Q, z = ZFSet.pair p q ∧ q ⊆ p := by + rw [reverseInclusionCode, ZFSet.mem_sep] + exact ⟨And.right, fun ⟨p, hp, q, hq, eq, subset⟩ => + ⟨ZFSet.mem_prod.2 ⟨p, hp, q, hq, eq⟩, p, hp, q, hq, eq, subset⟩⟩ + +theorem pair_mem_reverseInclusionCode (Q p q : ZFSet.{u}) : + ZFSet.pair p q ∈ reverseInclusionCode Q ↔ p ∈ Q ∧ q ∈ Q ∧ q ⊆ p := by + rw [mem_reverseInclusionCode] + constructor + · rintro ⟨a, ha, b, hb, eq, subset⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨ha, hb, subset⟩ + · rintro ⟨hp, hq, subset⟩ + exact ⟨p, hp, q, hq, rfl, subset⟩ + +theorem reverseInclusion_partialOrder (Q : ZFSet.{u}) : PartialOrderCode Q (reverseInclusionCode Q) where + relation := fun _ hz => (ZFSet.mem_sep.1 hz).1 + refl p hp := (pair_mem_reverseInclusionCode Q p p).2 ⟨hp, hp, fun _ hx => hx⟩ + antisymm p _ q _ pq qp := ZFSet.ext (fun _ => + ⟨fun hz => ((pair_mem_reverseInclusionCode Q q p).1 qp).2.2 hz, + fun hz => ((pair_mem_reverseInclusionCode Q p q).1 pq).2.2 hz⟩) + trans p hp q _ r hr pq qr := (pair_mem_reverseInclusionCode Q p r).2 ⟨hp, hr, + fun _ hx => ((pair_mem_reverseInclusionCode Q p q).1 pq).2.2 + (((pair_mem_reverseInclusionCode Q q r).1 qr).2.2 hx)⟩ + +theorem reverseInclusion_empty_top {Q : ZFSet.{u}} (empty : (∅ : ZFSet.{u}) ∈ Q) : + ∀ p ∈ Q, ZFSet.pair p ∅ ∈ reverseInclusionCode Q := + fun p hp => (pair_mem_reverseInclusionCode Q p ∅).2 ⟨hp, empty, ZFSet.empty_subset p⟩ + +namespace BoundedFormula + +open SetFormula + +def subsetFormula {n} (a b : Fin n) : BoundedFormula n := .allMem a (.mem 0 b.succ) + +def reverseInclusionEntryFormula {n} (z q : Fin n) : BoundedFormula n := + exMem q (exMem q.succ (.conj (orderedPairFormula z.succ.succ 1 0) (subsetFormula 0 1))) + +theorem truth_subsetFormula {n} (a b : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (subsetFormula a b) env ↔ env a ⊆ env b := Iff.rfl + +theorem truth_reverseInclusionEntryFormula {n} (z q : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (reverseInclusionEntryFormula z q) env ↔ env z ∈ reverseInclusionCode (env q) := by + simp only [reverseInclusionEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_subsetFormula] + exact (mem_reverseInclusionCode (env q) (env z)).symm + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem reverseInclusionCode_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) : reverseInclusionCode Q ∈ M.sets := by + have pairs := M.prod_mem pairing unions powers separation hQ hQ + let params := extend Q Fin.elim0 + have selected := M.separation_mem separation (BoundedFormula.reverseInclusionEntryFormula 0 1).toFormula + params (Fin.cases hQ (fun j => Fin.elim0 j)) pairs + have correct (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets (BoundedFormula.reverseInclusionEntryFormula 0 1).toFormula (extend z params) ↔ + z ∈ reverseInclusionCode Q := + (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz (Fin.cases hQ (fun j => Fin.elim0 j)))).trans + (BoundedFormula.truth_reverseInclusionEntryFormula 0 1 _) + have eq : ZFSet.sep (fun z => Realize M.sets + (BoundedFormula.reverseInclusionEntryFormula 0 1).toFormula (extend z params)) (ZFSet.prod Q Q) = + reverseInclusionCode Q := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact (correct z (M.transitive pairs hz)).1 rel + · intro hz + have hzP := (reverseInclusion_partialOrder Q).relation hz + exact ⟨hzP, (correct z (M.transitive pairs hzP)).2 hz⟩ + exact eq ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCumulativeHierarchyLevels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCumulativeHierarchyLevels.lean index 5d4167ff40b841c201c4ac221b640d83eff4be72..151b83d13154413e766f1b75b5260b7155d6d6df 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCumulativeHierarchyLevels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundCumulativeHierarchyLevels.lean @@ -1,368 +1,368 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundStrongLimitFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundIntervalRecursion - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -open scoped ZFSet -universe u - -namespace SetFormula - -def cumulativeMemberFormula {n} (x a p : Fin n) : SetFormula n := - ex (.conj (.mem 0 a.succ) (ex (.conj - (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula - (BoundedFormula.subsetFormula x.succ.succ 0).toFormula))) - -def cumulativeStepFormula : SetFormula 3 := - .all (.conj - (imp (.mem 0 3) (cumulativeMemberFormula 0 1 2)) - (imp (cumulativeMemberFormula 0 1 2) (.mem 0 3))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def cumulativeNext (a p : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun x => ∃ b ∈ a, ∃ v, ZFSet.pair b v ∈ p ∧ x ⊆ v) - (M.groundPower (⋃₀ ⋃₀ ⋃₀ p)) - -theorem mem_cumulativeNext (a p x : ZFSet.{u}) : - x ∈ M.cumulativeNext a p ↔ - x ∈ M.sets ∧ ∃ b ∈ a, ∃ v, ZFSet.pair b v ∈ p ∧ x ⊆ v := by - rw [cumulativeNext, ZFSet.mem_sep, M.mem_groundPower] - constructor - · exact fun h => ⟨h.1.1, h.2⟩ - · rintro ⟨hx, b, hb, v, entry, subset⟩ - exact ⟨⟨hx, fun z hz => ZFSet.mem_sUnion.2 - ⟨v, pair_second_mem_doubleUnion entry, subset hz⟩⟩, b, hb, v, entry, subset⟩ - -theorem realize_cumulativeMemberFormula {n} (x a p : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (cumulativeMemberFormula x a p) env ↔ - ∃ b ∈ env a, ∃ v, ZFSet.pair b v ∈ env p ∧ env x ⊆ v := by - simp only [cumulativeMemberFormula, realize_ex, Realize] - constructor - · rintro ⟨b, hbM, hb, v, hvM, pairCode, subsetCode⟩ - have mem2 : ∀ i, extend v (extend b env) i ∈ M.sets := - Fin.cases hvM (Fin.cases hbM members) - exact ⟨b, hb, v, - (BoundedFormula.truth_pairMembershipFormula 1 0 p.succ.succ _).1 - ((BoundedFormula.realize_toFormula M _ _ mem2).1 pairCode), - (BoundedFormula.truth_subsetFormula x.succ.succ 0 _).1 - ((BoundedFormula.realize_toFormula M _ _ mem2).1 subsetCode)⟩ - · rintro ⟨b, hb, v, entry, subset⟩ - have hbM := M.transitive (members a) hb - have hvM : v ∈ M.sets := M.transitive - (M.transitive (M.transitive (members p) entry) - (ZFSet.mem_pair.2 (Or.inr rfl))) (ZFSet.mem_pair.2 (Or.inr rfl)) - have mem2 : ∀ i, extend v (extend b env) i ∈ M.sets := - Fin.cases hvM (Fin.cases hbM members) - exact ⟨b, hbM, hb, v, hvM, - (BoundedFormula.realize_toFormula M _ _ mem2).2 - ((BoundedFormula.truth_pairMembershipFormula 1 0 p.succ.succ _).2 entry), - (BoundedFormula.realize_toFormula M _ _ mem2).2 - ((BoundedFormula.truth_subsetFormula x.succ.succ 0 _).2 subset)⟩ - -theorem cumulativeNext_mem - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) - {a p : ZFSet.{u}} (ha : a ∈ M.sets) (hp : p ∈ M.sets) : - M.cumulativeNext a p ∈ M.sets := by - let params := extend a (extend p Fin.elim0) - have members : ∀ i, params i ∈ M.sets := Fin.cases ha (Fin.cases hp (fun i => Fin.elim0 i)) - have hBound := M.groundPower_mem powers - (M.union_mem unions (M.union_mem unions (M.union_mem unions hp))) - have selected := M.separation_mem separation (cumulativeMemberFormula 0 1 2) - params members hBound - have equal : ZFSet.sep (fun x => Realize M.sets (cumulativeMemberFormula 0 1 2) - (extend x params)) (M.groundPower (⋃₀ ⋃₀ ⋃₀ p)) = M.cumulativeNext a p := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, cumulativeNext, ZFSet.mem_sep] - constructor - · rintro ⟨hx, code⟩ - exact ⟨hx, (M.realize_cumulativeMemberFormula 0 1 2 _ - (Fin.cases (M.transitive hBound hx) members)).1 code⟩ - · rintro ⟨hx, witness⟩ - exact ⟨hx, (M.realize_cumulativeMemberFormula 0 1 2 _ - (Fin.cases (M.transitive hBound hx) members)).2 witness⟩ - exact equal ▸ selected - -theorem realize_cumulativeStepFormula {a p y : ZFSet.{u}} - (ha : a ∈ M.sets) (hp : p ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets cumulativeStepFormula (extend a (extend p (extend y Fin.elim0))) ↔ - y = M.cumulativeNext a p := by - simp only [cumulativeStepFormula, realize_imp, Realize] - have decode (x : ZFSet.{u}) (hx : x ∈ M.sets) := - M.realize_cumulativeMemberFormula 0 1 2 - (extend x (extend a (extend p (extend y Fin.elim0)))) - (Fin.cases hx (Fin.cases ha (Fin.cases hp (Fin.cases hy (fun i => Fin.elim0 i))))) - constructor - · intro property - apply ZFSet.ext - intro x - rw [M.mem_cumulativeNext] - constructor - · intro hx - have hxM := M.transitive hy hx - exact ⟨hxM, (decode x hxM).1 ((property x hxM).1 hx)⟩ - · rintro ⟨hx, witness⟩ - exact (property x hx).2 ((decode x hx).2 witness) - · intro equal x hx - constructor - · intro member - exact (decode x hx).2 ((M.mem_cumulativeNext a p x).1 (equal ▸ member)).2 - · intro witness - exact equal ▸ (M.mem_cumulativeNext a p x).2 ⟨hx, (decode x hx).1 witness⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def GroundCumulativeHierarchyCode (M : TransitiveGround.{u}) (T H : ZFSet.{u}) : Prop := - OrdinalRecursionTrace (fun a p y => y = M.cumulativeNext a p) T H - -namespace GroundCumulativeHierarchyCode -variable {M : TransitiveGround.{u}} {T H : ZFSet.{u}} - -theorem function (code : GroundCumulativeHierarchyCode M T H) : FunctionGraphOn T H := code.1 - -theorem entry_iff (code : GroundCumulativeHierarchyCode M T H) - {a v : ZFSet.{u}} (ha : a ∈ T) (entry : ZFSet.pair a v ∈ H) (x : ZFSet.{u}) : - x ∈ v ↔ x ∈ M.sets ∧ ∃ b ∈ a, ∃ w, ZFSet.pair b w ∈ H ∧ x ⊆ w := by - rw [code.2 a ha v entry, M.mem_cumulativeNext] - constructor - · rintro ⟨hx, b, hb, w, edge, subset⟩ - exact ⟨hx, b, hb, w, (pair_mem_graphRestriction.1 edge).1, subset⟩ - · rintro ⟨hx, b, hb, w, edge, subset⟩ - exact ⟨hx, b, hb, w, pair_mem_graphRestriction.2 ⟨edge, hb⟩, subset⟩ - -theorem unique (code : GroundCumulativeHierarchyCode M T H) - {J : ZFSet.{u}} (other : GroundCumulativeHierarchyCode M T J) - (ordinal : ordinalSetProperty T) : H = J := - OrdinalRecursionTrace.unique code other ordinal (fun _ hx => hx) - (fun _ _ _ _ _ _ first second => first.trans second.symm) - -theorem restrict (code : GroundCumulativeHierarchyCode M T H) - {a : ZFSet.{u}} (ordinal : ordinalSetProperty a) (subset : a ⊆ T) : - GroundCumulativeHierarchyCode M a (graphRestriction a H) := - OrdinalRecursionTrace.restrict code ordinal subset - -end GroundCumulativeHierarchyCode - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundCumulativeHierarchy - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) : - ∃ H ∈ M.sets, GroundCumulativeHierarchyCode M T H ∧ - ∀ J, GroundCumulativeHierarchyCode M T J → J = H := by - have closure : GroundOrdinalStepClosure M T cumulativeStepFormula Fin.elim0 := by - intro a ha p hp _ - have haM := M.transitive hT ha - have hy := M.cumulativeNext_mem unions powers separation haM hp - refine ⟨M.cumulativeNext a p, hy, - (M.realize_cumulativeStepFormula haM hp hy).2 rfl, ?_⟩ - intro z hz relation - exact (M.realize_cumulativeStepFormula haM hp hz).1 relation - obtain ⟨H, hH, trace, _, _⟩ := M.exists_unique_ordinalRecursionTrace - pairing unions separation collection hT ordinal cumulativeStepFormula Fin.elim0 - (fun i => Fin.elim0 i) closure - have code : GroundCumulativeHierarchyCode M T H := by - refine ⟨trace.1, ?_⟩ - intro a ha v entry - have step := trace.2 a ha v entry - exact (M.realize_cumulativeStepFormula (M.transitive hT ha) step.1 step.2.1).1 step.2.2 - exact ⟨H, hH, code, fun J other => other.unique code ordinal⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundCumulativeHierarchyCode -open SetRealization -open scoped ZFSet -universe u -variable {M : TransitiveGround.{u}} {T H : ZFSet.{u}} -variable (code : GroundCumulativeHierarchyCode M T H) (ordinal : ordinalSetProperty T) -include code ordinal - -theorem mem_iff_rank_lt {a v : ZFSet.{u}} (ha : a ∈ T) - (entry : ZFSet.pair a v ∈ H) (x : ZFSet.{u}) : - x ∈ v ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank a := by - have all : ∀ a ∈ T, ∀ v, ZFSet.pair a v ∈ H → ∀ x, - x ∈ v ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank a := by - intro a - induction a using ZFSet.inductionOn with - | h a ih => - intro ha v entry x - rw [code.entry_iff ha entry x] - constructor - · rintro ⟨hx, b, hb, w, edge, subset⟩ - have hbT := ordinal.1 a ha b hb - have rankLe : ZFSet.rank x ≤ ZFSet.rank b := ZFSet.rank_le_iff.2 - (fun z hz => ((ih b hb hbT w edge z).1 (subset hz)).2) - exact ⟨hx, rankLe.trans_lt (ZFSet.rank_lt_of_mem hb)⟩ - · rintro ⟨hx, rankLt⟩ - let b := ordinalCode (ZFSet.rank x) - have hb : b ∈ a := by - rw [ordinalSetProperty_eq_code_rank a (ordinalSetProperty_member ordinal ha)] - exact (mem_ordinalCode_iff _ _).2 rankLt - have hbT := ordinal.1 a ha b hb - obtain ⟨w, edge⟩ := code.function.total hbT - refine ⟨hx, b, hb, w, edge, ?_⟩ - intro z hz - apply (ih b hb hbT w edge z).2 - refine ⟨M.transitive hx hz, ?_⟩ - simpa only [b, rank_ordinalCode] using ZFSet.rank_lt_of_mem hz - exact all a ha v entry x - -theorem value_transitive {a v : ZFSet.{u}} (ha : a ∈ T) - (entry : ZFSet.pair a v ∈ H) : setTransitive v := by - intro x hx z hz - obtain ⟨hxM, rankX⟩ := (code.mem_iff_rank_lt ordinal ha entry x).1 hx - exact (code.mem_iff_rank_lt ordinal ha entry z).2 - ⟨M.transitive hxM hz, (ZFSet.rank_lt_of_mem hz).trans rankX⟩ - -theorem value_mono {a b v w : ZFSet.{u}} (ha : a ∈ T) (hb : b ∈ T) - (first : ZFSet.pair a v ∈ H) (second : ZFSet.pair b w ∈ H) - (subset : a ⊆ b) : v ⊆ w := by - intro x hx - obtain ⟨hxM, rankX⟩ := (code.mem_iff_rank_lt ordinal ha first x).1 hx - exact (code.mem_iff_rank_lt ordinal hb second x).2 - ⟨hxM, rankX.trans_le (ZFSet.rank_mono subset)⟩ - -theorem value_rank {a v : ZFSet.{u}} (ha : a ∈ T) - (entry : ZFSet.pair a v ∈ H) (haM : a ∈ M.sets) : ZFSet.rank v = ZFSet.rank a := by - apply le_antisymm - · exact ZFSet.rank_le_iff.2 (fun x hx => ((code.mem_iff_rank_lt ordinal ha entry x).1 hx).2) - · apply ZFSet.rank_le_iff.2 - intro b hb - exact ZFSet.rank_lt_of_mem ((code.mem_iff_rank_lt ordinal ha entry b).2 - ⟨M.transitive haM hb, ZFSet.rank_lt_of_mem hb⟩) - -theorem zero_value {v : ZFSet.{u}} (zero : (∅ : ZFSet.{u}) ∈ T) - (entry : ZFSet.pair ∅ v ∈ H) : v = ∅ := by - apply ZFSet.ext - intro x - rw [code.mem_iff_rank_lt ordinal zero entry x, ZFSet.rank_empty] - exact ⟨fun h => False.elim (not_lt_zero h.2), - fun h => False.elim (ZFSet.notMem_empty x h)⟩ - -theorem successor_value {a v w : ZFSet.{u}} (ha : a ∈ T) - (hs : insert a a ∈ T) (first : ZFSet.pair a v ∈ H) - (second : ZFSet.pair (insert a a) w ∈ H) : w = M.groundPower v := by - have rankSucc : ZFSet.rank (insert a a) = Order.succ (ZFSet.rank a) := by - rw [ZFSet.rank_insert, max_eq_left (Order.le_succ _)] - apply ZFSet.ext - intro x - rw [code.mem_iff_rank_lt ordinal hs second x, rankSucc, Order.lt_succ_iff, - M.mem_groundPower] - constructor - · rintro ⟨hxM, bound⟩ - refine ⟨hxM, ?_⟩ - intro z hz - exact (code.mem_iff_rank_lt ordinal ha first z).2 - ⟨M.transitive hxM hz, (ZFSet.rank_lt_of_mem hz).trans_le bound⟩ - · rintro ⟨hxM, subset⟩ - exact ⟨hxM, ZFSet.rank_le_iff.2 - (fun z hz => ((code.mem_iff_rank_lt ordinal ha first z).1 (subset hz)).2)⟩ - -theorem limit_value {a v : ZFSet.{u}} (ha : a ∈ T) - (entry : ZFSet.pair a v ∈ H) (limit : Order.IsSuccLimit (ZFSet.rank a)) : - v = ⋃₀ relationImage a (⋃₀ ⋃₀ H) H := by - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨hxM, bound⟩ := (code.mem_iff_rank_lt ordinal ha entry x).1 hx - let b := ordinalCode (Order.succ (ZFSet.rank x)) - have hb : b ∈ a := by - rw [ordinalSetProperty_eq_code_rank a (ordinalSetProperty_member ordinal ha)] - apply (mem_ordinalCode_iff _ _).2 - exact limit.succ_lt bound - obtain ⟨w, edge⟩ := code.function.total (ordinal.1 a ha b hb) - refine ZFSet.mem_sUnion.2 ⟨w, (mem_relationImage _ _ _ _).2 - ⟨pair_second_mem_doubleUnion edge, b, hb, edge⟩, ?_⟩ - apply (code.mem_iff_rank_lt ordinal (ordinal.1 a ha b hb) edge x).2 - exact ⟨hxM, by simpa only [b, rank_ordinalCode] using Order.lt_succ (ZFSet.rank x)⟩ - · intro hx - obtain ⟨w, hw, xw⟩ := ZFSet.mem_sUnion.1 hx - obtain ⟨_, b, hb, edge⟩ := (mem_relationImage _ _ _ _).1 hw - obtain ⟨hxM, bound⟩ := (code.mem_iff_rank_lt ordinal (ordinal.1 a ha b hb) edge x).1 xw - exact (code.mem_iff_rank_lt ordinal ha entry x).2 - ⟨hxM, bound.trans (ZFSet.rank_lt_of_mem hb)⟩ - -end PartitionPilot.Forcing.GroundCumulativeHierarchyCode - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace GroundCumulativeHierarchyCode -variable {M : TransitiveGround.{u}} {T H : ZFSet.{u}} - -theorem value_mem (_code : GroundCumulativeHierarchyCode M T H) - (hH : H ∈ M.sets) {a v : ZFSet.{u}} (entry : ZFSet.pair a v ∈ H) : v ∈ M.sets := - M.pair_right (M.transitive hH entry) - -theorem ground_trace_iff - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (hT : T ∈ M.sets) (hH : H ∈ M.sets) : - OrdinalRecursionTrace (groundRecursionStep M cumulativeStepFormula Fin.elim0) T H ↔ - GroundCumulativeHierarchyCode M T H := by - constructor - · intro trace - refine ⟨trace.1, ?_⟩ - intro a ha v entry - have step := trace.2 a ha v entry - exact (M.realize_cumulativeStepFormula (M.transitive hT ha) step.1 step.2.1).1 step.2.2 - · intro code - refine ⟨code.1, ?_⟩ - intro a ha v entry - have haM := M.transitive hT ha - have hp := M.graphRestriction_mem unions separation haM hH - have hv := code.value_mem hH entry - exact ⟨hp, hv, (M.realize_cumulativeStepFormula haM hp hv).2 (code.2 a ha v entry)⟩ - -end GroundCumulativeHierarchyCode - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundCumulativeLevel - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {a : ZFSet.{u}} (ha : a ∈ M.sets) (ordinal : ordinalSetProperty a) : - ∃ H ∈ M.sets, ∃ V ∈ M.sets, - GroundCumulativeHierarchyCode M (insert a a) H ∧ ZFSet.pair a V ∈ H ∧ - (∀ x, x ∈ V ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank a) ∧ - setTransitive V ∧ ZFSet.rank V = ZFSet.rank a := by - have hs := M.insert_mem pairing unions ha ha - have ordinalS := ordinalSetProperty_succ ordinal - obtain ⟨H, hH, code, _⟩ := M.exists_groundCumulativeHierarchy pairing unions powers - separation collection hs ordinalS - obtain ⟨V, entry⟩ := code.function.total (ZFSet.mem_insert a a) - exact ⟨H, hH, V, code.value_mem hH entry, code, entry, - code.mem_iff_rank_lt ordinalS (ZFSet.mem_insert a a) entry, - code.value_transitive ordinalS (ZFSet.mem_insert a a) entry, - code.value_rank ordinalS (ZFSet.mem_insert a a) entry ha⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundStrongLimitFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundIntervalRecursion + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +open scoped ZFSet +universe u + +namespace SetFormula + +def cumulativeMemberFormula {n} (x a p : Fin n) : SetFormula n := + ex (.conj (.mem 0 a.succ) (ex (.conj + (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula + (BoundedFormula.subsetFormula x.succ.succ 0).toFormula))) + +def cumulativeStepFormula : SetFormula 3 := + .all (.conj + (imp (.mem 0 3) (cumulativeMemberFormula 0 1 2)) + (imp (cumulativeMemberFormula 0 1 2) (.mem 0 3))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def cumulativeNext (a p : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun x => ∃ b ∈ a, ∃ v, ZFSet.pair b v ∈ p ∧ x ⊆ v) + (M.groundPower (⋃₀ ⋃₀ ⋃₀ p)) + +theorem mem_cumulativeNext (a p x : ZFSet.{u}) : + x ∈ M.cumulativeNext a p ↔ + x ∈ M.sets ∧ ∃ b ∈ a, ∃ v, ZFSet.pair b v ∈ p ∧ x ⊆ v := by + rw [cumulativeNext, ZFSet.mem_sep, M.mem_groundPower] + constructor + · exact fun h => ⟨h.1.1, h.2⟩ + · rintro ⟨hx, b, hb, v, entry, subset⟩ + exact ⟨⟨hx, fun z hz => ZFSet.mem_sUnion.2 + ⟨v, pair_second_mem_doubleUnion entry, subset hz⟩⟩, b, hb, v, entry, subset⟩ + +theorem realize_cumulativeMemberFormula {n} (x a p : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (cumulativeMemberFormula x a p) env ↔ + ∃ b ∈ env a, ∃ v, ZFSet.pair b v ∈ env p ∧ env x ⊆ v := by + simp only [cumulativeMemberFormula, realize_ex, Realize] + constructor + · rintro ⟨b, hbM, hb, v, hvM, pairCode, subsetCode⟩ + have mem2 : ∀ i, extend v (extend b env) i ∈ M.sets := + Fin.cases hvM (Fin.cases hbM members) + exact ⟨b, hb, v, + (BoundedFormula.truth_pairMembershipFormula 1 0 p.succ.succ _).1 + ((BoundedFormula.realize_toFormula M _ _ mem2).1 pairCode), + (BoundedFormula.truth_subsetFormula x.succ.succ 0 _).1 + ((BoundedFormula.realize_toFormula M _ _ mem2).1 subsetCode)⟩ + · rintro ⟨b, hb, v, entry, subset⟩ + have hbM := M.transitive (members a) hb + have hvM : v ∈ M.sets := M.transitive + (M.transitive (M.transitive (members p) entry) + (ZFSet.mem_pair.2 (Or.inr rfl))) (ZFSet.mem_pair.2 (Or.inr rfl)) + have mem2 : ∀ i, extend v (extend b env) i ∈ M.sets := + Fin.cases hvM (Fin.cases hbM members) + exact ⟨b, hbM, hb, v, hvM, + (BoundedFormula.realize_toFormula M _ _ mem2).2 + ((BoundedFormula.truth_pairMembershipFormula 1 0 p.succ.succ _).2 entry), + (BoundedFormula.realize_toFormula M _ _ mem2).2 + ((BoundedFormula.truth_subsetFormula x.succ.succ 0 _).2 subset)⟩ + +theorem cumulativeNext_mem + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) + {a p : ZFSet.{u}} (ha : a ∈ M.sets) (hp : p ∈ M.sets) : + M.cumulativeNext a p ∈ M.sets := by + let params := extend a (extend p Fin.elim0) + have members : ∀ i, params i ∈ M.sets := Fin.cases ha (Fin.cases hp (fun i => Fin.elim0 i)) + have hBound := M.groundPower_mem powers + (M.union_mem unions (M.union_mem unions (M.union_mem unions hp))) + have selected := M.separation_mem separation (cumulativeMemberFormula 0 1 2) + params members hBound + have equal : ZFSet.sep (fun x => Realize M.sets (cumulativeMemberFormula 0 1 2) + (extend x params)) (M.groundPower (⋃₀ ⋃₀ ⋃₀ p)) = M.cumulativeNext a p := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, cumulativeNext, ZFSet.mem_sep] + constructor + · rintro ⟨hx, code⟩ + exact ⟨hx, (M.realize_cumulativeMemberFormula 0 1 2 _ + (Fin.cases (M.transitive hBound hx) members)).1 code⟩ + · rintro ⟨hx, witness⟩ + exact ⟨hx, (M.realize_cumulativeMemberFormula 0 1 2 _ + (Fin.cases (M.transitive hBound hx) members)).2 witness⟩ + exact equal ▸ selected + +theorem realize_cumulativeStepFormula {a p y : ZFSet.{u}} + (ha : a ∈ M.sets) (hp : p ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets cumulativeStepFormula (extend a (extend p (extend y Fin.elim0))) ↔ + y = M.cumulativeNext a p := by + simp only [cumulativeStepFormula, realize_imp, Realize] + have decode (x : ZFSet.{u}) (hx : x ∈ M.sets) := + M.realize_cumulativeMemberFormula 0 1 2 + (extend x (extend a (extend p (extend y Fin.elim0)))) + (Fin.cases hx (Fin.cases ha (Fin.cases hp (Fin.cases hy (fun i => Fin.elim0 i))))) + constructor + · intro property + apply ZFSet.ext + intro x + rw [M.mem_cumulativeNext] + constructor + · intro hx + have hxM := M.transitive hy hx + exact ⟨hxM, (decode x hxM).1 ((property x hxM).1 hx)⟩ + · rintro ⟨hx, witness⟩ + exact (property x hx).2 ((decode x hx).2 witness) + · intro equal x hx + constructor + · intro member + exact (decode x hx).2 ((M.mem_cumulativeNext a p x).1 (equal ▸ member)).2 + · intro witness + exact equal ▸ (M.mem_cumulativeNext a p x).2 ⟨hx, (decode x hx).1 witness⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def GroundCumulativeHierarchyCode (M : TransitiveGround.{u}) (T H : ZFSet.{u}) : Prop := + OrdinalRecursionTrace (fun a p y => y = M.cumulativeNext a p) T H + +namespace GroundCumulativeHierarchyCode +variable {M : TransitiveGround.{u}} {T H : ZFSet.{u}} + +theorem function (code : GroundCumulativeHierarchyCode M T H) : FunctionGraphOn T H := code.1 + +theorem entry_iff (code : GroundCumulativeHierarchyCode M T H) + {a v : ZFSet.{u}} (ha : a ∈ T) (entry : ZFSet.pair a v ∈ H) (x : ZFSet.{u}) : + x ∈ v ↔ x ∈ M.sets ∧ ∃ b ∈ a, ∃ w, ZFSet.pair b w ∈ H ∧ x ⊆ w := by + rw [code.2 a ha v entry, M.mem_cumulativeNext] + constructor + · rintro ⟨hx, b, hb, w, edge, subset⟩ + exact ⟨hx, b, hb, w, (pair_mem_graphRestriction.1 edge).1, subset⟩ + · rintro ⟨hx, b, hb, w, edge, subset⟩ + exact ⟨hx, b, hb, w, pair_mem_graphRestriction.2 ⟨edge, hb⟩, subset⟩ + +theorem unique (code : GroundCumulativeHierarchyCode M T H) + {J : ZFSet.{u}} (other : GroundCumulativeHierarchyCode M T J) + (ordinal : ordinalSetProperty T) : H = J := + OrdinalRecursionTrace.unique code other ordinal (fun _ hx => hx) + (fun _ _ _ _ _ _ first second => first.trans second.symm) + +theorem restrict (code : GroundCumulativeHierarchyCode M T H) + {a : ZFSet.{u}} (ordinal : ordinalSetProperty a) (subset : a ⊆ T) : + GroundCumulativeHierarchyCode M a (graphRestriction a H) := + OrdinalRecursionTrace.restrict code ordinal subset + +end GroundCumulativeHierarchyCode + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundCumulativeHierarchy + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) : + ∃ H ∈ M.sets, GroundCumulativeHierarchyCode M T H ∧ + ∀ J, GroundCumulativeHierarchyCode M T J → J = H := by + have closure : GroundOrdinalStepClosure M T cumulativeStepFormula Fin.elim0 := by + intro a ha p hp _ + have haM := M.transitive hT ha + have hy := M.cumulativeNext_mem unions powers separation haM hp + refine ⟨M.cumulativeNext a p, hy, + (M.realize_cumulativeStepFormula haM hp hy).2 rfl, ?_⟩ + intro z hz relation + exact (M.realize_cumulativeStepFormula haM hp hz).1 relation + obtain ⟨H, hH, trace, _, _⟩ := M.exists_unique_ordinalRecursionTrace + pairing unions separation collection hT ordinal cumulativeStepFormula Fin.elim0 + (fun i => Fin.elim0 i) closure + have code : GroundCumulativeHierarchyCode M T H := by + refine ⟨trace.1, ?_⟩ + intro a ha v entry + have step := trace.2 a ha v entry + exact (M.realize_cumulativeStepFormula (M.transitive hT ha) step.1 step.2.1).1 step.2.2 + exact ⟨H, hH, code, fun J other => other.unique code ordinal⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundCumulativeHierarchyCode +open SetRealization +open scoped ZFSet +universe u +variable {M : TransitiveGround.{u}} {T H : ZFSet.{u}} +variable (code : GroundCumulativeHierarchyCode M T H) (ordinal : ordinalSetProperty T) +include code ordinal + +theorem mem_iff_rank_lt {a v : ZFSet.{u}} (ha : a ∈ T) + (entry : ZFSet.pair a v ∈ H) (x : ZFSet.{u}) : + x ∈ v ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank a := by + have all : ∀ a ∈ T, ∀ v, ZFSet.pair a v ∈ H → ∀ x, + x ∈ v ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank a := by + intro a + induction a using ZFSet.inductionOn with + | h a ih => + intro ha v entry x + rw [code.entry_iff ha entry x] + constructor + · rintro ⟨hx, b, hb, w, edge, subset⟩ + have hbT := ordinal.1 a ha b hb + have rankLe : ZFSet.rank x ≤ ZFSet.rank b := ZFSet.rank_le_iff.2 + (fun z hz => ((ih b hb hbT w edge z).1 (subset hz)).2) + exact ⟨hx, rankLe.trans_lt (ZFSet.rank_lt_of_mem hb)⟩ + · rintro ⟨hx, rankLt⟩ + let b := ordinalCode (ZFSet.rank x) + have hb : b ∈ a := by + rw [ordinalSetProperty_eq_code_rank a (ordinalSetProperty_member ordinal ha)] + exact (mem_ordinalCode_iff _ _).2 rankLt + have hbT := ordinal.1 a ha b hb + obtain ⟨w, edge⟩ := code.function.total hbT + refine ⟨hx, b, hb, w, edge, ?_⟩ + intro z hz + apply (ih b hb hbT w edge z).2 + refine ⟨M.transitive hx hz, ?_⟩ + simpa only [b, rank_ordinalCode] using ZFSet.rank_lt_of_mem hz + exact all a ha v entry x + +theorem value_transitive {a v : ZFSet.{u}} (ha : a ∈ T) + (entry : ZFSet.pair a v ∈ H) : setTransitive v := by + intro x hx z hz + obtain ⟨hxM, rankX⟩ := (code.mem_iff_rank_lt ordinal ha entry x).1 hx + exact (code.mem_iff_rank_lt ordinal ha entry z).2 + ⟨M.transitive hxM hz, (ZFSet.rank_lt_of_mem hz).trans rankX⟩ + +theorem value_mono {a b v w : ZFSet.{u}} (ha : a ∈ T) (hb : b ∈ T) + (first : ZFSet.pair a v ∈ H) (second : ZFSet.pair b w ∈ H) + (subset : a ⊆ b) : v ⊆ w := by + intro x hx + obtain ⟨hxM, rankX⟩ := (code.mem_iff_rank_lt ordinal ha first x).1 hx + exact (code.mem_iff_rank_lt ordinal hb second x).2 + ⟨hxM, rankX.trans_le (ZFSet.rank_mono subset)⟩ + +theorem value_rank {a v : ZFSet.{u}} (ha : a ∈ T) + (entry : ZFSet.pair a v ∈ H) (haM : a ∈ M.sets) : ZFSet.rank v = ZFSet.rank a := by + apply le_antisymm + · exact ZFSet.rank_le_iff.2 (fun x hx => ((code.mem_iff_rank_lt ordinal ha entry x).1 hx).2) + · apply ZFSet.rank_le_iff.2 + intro b hb + exact ZFSet.rank_lt_of_mem ((code.mem_iff_rank_lt ordinal ha entry b).2 + ⟨M.transitive haM hb, ZFSet.rank_lt_of_mem hb⟩) + +theorem zero_value {v : ZFSet.{u}} (zero : (∅ : ZFSet.{u}) ∈ T) + (entry : ZFSet.pair ∅ v ∈ H) : v = ∅ := by + apply ZFSet.ext + intro x + rw [code.mem_iff_rank_lt ordinal zero entry x, ZFSet.rank_empty] + exact ⟨fun h => False.elim (not_lt_zero h.2), + fun h => False.elim (ZFSet.notMem_empty x h)⟩ + +theorem successor_value {a v w : ZFSet.{u}} (ha : a ∈ T) + (hs : insert a a ∈ T) (first : ZFSet.pair a v ∈ H) + (second : ZFSet.pair (insert a a) w ∈ H) : w = M.groundPower v := by + have rankSucc : ZFSet.rank (insert a a) = Order.succ (ZFSet.rank a) := by + rw [ZFSet.rank_insert, max_eq_left (Order.le_succ _)] + apply ZFSet.ext + intro x + rw [code.mem_iff_rank_lt ordinal hs second x, rankSucc, Order.lt_succ_iff, + M.mem_groundPower] + constructor + · rintro ⟨hxM, bound⟩ + refine ⟨hxM, ?_⟩ + intro z hz + exact (code.mem_iff_rank_lt ordinal ha first z).2 + ⟨M.transitive hxM hz, (ZFSet.rank_lt_of_mem hz).trans_le bound⟩ + · rintro ⟨hxM, subset⟩ + exact ⟨hxM, ZFSet.rank_le_iff.2 + (fun z hz => ((code.mem_iff_rank_lt ordinal ha first z).1 (subset hz)).2)⟩ + +theorem limit_value {a v : ZFSet.{u}} (ha : a ∈ T) + (entry : ZFSet.pair a v ∈ H) (limit : Order.IsSuccLimit (ZFSet.rank a)) : + v = ⋃₀ relationImage a (⋃₀ ⋃₀ H) H := by + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨hxM, bound⟩ := (code.mem_iff_rank_lt ordinal ha entry x).1 hx + let b := ordinalCode (Order.succ (ZFSet.rank x)) + have hb : b ∈ a := by + rw [ordinalSetProperty_eq_code_rank a (ordinalSetProperty_member ordinal ha)] + apply (mem_ordinalCode_iff _ _).2 + exact limit.succ_lt bound + obtain ⟨w, edge⟩ := code.function.total (ordinal.1 a ha b hb) + refine ZFSet.mem_sUnion.2 ⟨w, (mem_relationImage _ _ _ _).2 + ⟨pair_second_mem_doubleUnion edge, b, hb, edge⟩, ?_⟩ + apply (code.mem_iff_rank_lt ordinal (ordinal.1 a ha b hb) edge x).2 + exact ⟨hxM, by simpa only [b, rank_ordinalCode] using Order.lt_succ (ZFSet.rank x)⟩ + · intro hx + obtain ⟨w, hw, xw⟩ := ZFSet.mem_sUnion.1 hx + obtain ⟨_, b, hb, edge⟩ := (mem_relationImage _ _ _ _).1 hw + obtain ⟨hxM, bound⟩ := (code.mem_iff_rank_lt ordinal (ordinal.1 a ha b hb) edge x).1 xw + exact (code.mem_iff_rank_lt ordinal ha entry x).2 + ⟨hxM, bound.trans (ZFSet.rank_lt_of_mem hb)⟩ + +end PartitionPilot.Forcing.GroundCumulativeHierarchyCode + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace GroundCumulativeHierarchyCode +variable {M : TransitiveGround.{u}} {T H : ZFSet.{u}} + +theorem value_mem (_code : GroundCumulativeHierarchyCode M T H) + (hH : H ∈ M.sets) {a v : ZFSet.{u}} (entry : ZFSet.pair a v ∈ H) : v ∈ M.sets := + M.pair_right (M.transitive hH entry) + +theorem ground_trace_iff + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (hT : T ∈ M.sets) (hH : H ∈ M.sets) : + OrdinalRecursionTrace (groundRecursionStep M cumulativeStepFormula Fin.elim0) T H ↔ + GroundCumulativeHierarchyCode M T H := by + constructor + · intro trace + refine ⟨trace.1, ?_⟩ + intro a ha v entry + have step := trace.2 a ha v entry + exact (M.realize_cumulativeStepFormula (M.transitive hT ha) step.1 step.2.1).1 step.2.2 + · intro code + refine ⟨code.1, ?_⟩ + intro a ha v entry + have haM := M.transitive hT ha + have hp := M.graphRestriction_mem unions separation haM hH + have hv := code.value_mem hH entry + exact ⟨hp, hv, (M.realize_cumulativeStepFormula haM hp hv).2 (code.2 a ha v entry)⟩ + +end GroundCumulativeHierarchyCode + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundCumulativeLevel + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {a : ZFSet.{u}} (ha : a ∈ M.sets) (ordinal : ordinalSetProperty a) : + ∃ H ∈ M.sets, ∃ V ∈ M.sets, + GroundCumulativeHierarchyCode M (insert a a) H ∧ ZFSet.pair a V ∈ H ∧ + (∀ x, x ∈ V ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank a) ∧ + setTransitive V ∧ ZFSet.rank V = ZFSet.rank a := by + have hs := M.insert_mem pairing unions ha ha + have ordinalS := ordinalSetProperty_succ ordinal + obtain ⟨H, hH, code, _⟩ := M.exists_groundCumulativeHierarchy pairing unions powers + separation collection hs ordinalS + obtain ⟨V, entry⟩ := code.function.total (ZFSet.mem_insert a a) + exact ⟨H, hH, V, code.value_mem hH entry, code, entry, + code.mem_iff_rank_lt ordinalS (ZFSet.mem_insert a a) entry, + code.value_transitive ordinalS (ZFSet.mem_insert a a) entry, + code.value_rank ordinalS (ZFSet.mem_insert a a) entry ha⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableIndexBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableIndexBounds.lean index 6fbed22edf6d628a079b4acaf08b536469579586..f713b7d0c05b507feb89773d0b5660be8e6450b6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableIndexBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableIndexBounds.lean @@ -1,66 +1,66 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_singleton : - GroundDefinableFunction M (fun env : Fin 1 → ZFSet.{u} => {env 0}) where - formula := exactSetFormula 0 (.equal 0 2) - closed := fun _ members => by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing (members 0) (members 0) - correct := by - intro env members z hz - apply M.realize_exactSetFormula 0 _ (extend z env) hz - · intro w hw - exact (ZFSet.mem_singleton.1 hw).symm ▸ members 0 - · intro w _ - exact ZFSet.mem_singleton.symm - -noncomputable def definable_binaryUnion : - GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => env 0 ∪ env 1) where - formula := exactSetFormula 0 (disj (.mem 0 2) (.mem 0 3)) - closed := fun _ members => M.binary_union_mem pairing unions (members 0) (members 1) - correct := by - intro env members z hz - apply M.realize_exactSetFormula 0 _ (extend z env) hz - (fun _ h => M.transitive (M.binary_union_mem pairing unions (members 0) (members 1)) h) - intro w _ - rw [realize_disj] - exact ZFSet.mem_union.symm - -noncomputable def definable_orderedPairNameFamily : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => orderedPairNameFamily (env 0) (env 1) (env 2)) where - formula := exactSetFormula 0 (orderedPairNameFamilyMemberFormula 0 2 3 4) - closed := fun _ members => M.orderedPairNameFamily_mem pairing unions powers separation - (members 0) (members 1) (members 2) - correct := by - intro env members z hz - apply M.realize_exactSetFormula 0 _ (extend z env) hz - (fun _ h => M.transitive (M.orderedPairNameFamily_mem pairing unions powers separation - (members 0) (members 1) (members 2)) h) - intro w hw - exact M.realize_orderedPairNameFamilyMemberFormula pairing 0 2 3 4 _ - (Fin.cases hw (Fin.cases hz members)) - -noncomputable def definable_refinementIndexBound : - GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => - refinementIndexBound (env 0) (env 1) (env 2) (env 3)) := by - let v := GroundSetTerm.var M (n := 4) - let prod (x y : GroundSetTerm M 4) := - GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x, y] - exact (prod (v 0) (prod (v 1) (prod (v 1) (prod (v 2) (prod (v 3) (v 3)))))).definition - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundDefinableRelationProducts + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_singleton : + GroundDefinableFunction M (fun env : Fin 1 → ZFSet.{u} => {env 0}) where + formula := exactSetFormula 0 (.equal 0 2) + closed := fun _ members => by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing (members 0) (members 0) + correct := by + intro env members z hz + apply M.realize_exactSetFormula 0 _ (extend z env) hz + · intro w hw + exact (ZFSet.mem_singleton.1 hw).symm ▸ members 0 + · intro w _ + exact ZFSet.mem_singleton.symm + +noncomputable def definable_binaryUnion : + GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => env 0 ∪ env 1) where + formula := exactSetFormula 0 (disj (.mem 0 2) (.mem 0 3)) + closed := fun _ members => M.binary_union_mem pairing unions (members 0) (members 1) + correct := by + intro env members z hz + apply M.realize_exactSetFormula 0 _ (extend z env) hz + (fun _ h => M.transitive (M.binary_union_mem pairing unions (members 0) (members 1)) h) + intro w _ + rw [realize_disj] + exact ZFSet.mem_union.symm + +noncomputable def definable_orderedPairNameFamily : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => orderedPairNameFamily (env 0) (env 1) (env 2)) where + formula := exactSetFormula 0 (orderedPairNameFamilyMemberFormula 0 2 3 4) + closed := fun _ members => M.orderedPairNameFamily_mem pairing unions powers separation + (members 0) (members 1) (members 2) + correct := by + intro env members z hz + apply M.realize_exactSetFormula 0 _ (extend z env) hz + (fun _ h => M.transitive (M.orderedPairNameFamily_mem pairing unions powers separation + (members 0) (members 1) (members 2)) h) + intro w hw + exact M.realize_orderedPairNameFamilyMemberFormula pairing 0 2 3 4 _ + (Fin.cases hw (Fin.cases hz members)) + +noncomputable def definable_refinementIndexBound : + GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => + refinementIndexBound (env 0) (env 1) (env 2) (env 3)) := by + let v := GroundSetTerm.var M (n := 4) + let prod (x y : GroundSetTerm M 4) := + GroundSetTerm.app (M.definable_product pairing unions powers separation) ![x, y] + exact (prod (v 0) (prod (v 1) (prod (v 1) (prod (v 2) (prod (v 3) (v 3)))))).definition + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableRowAssignmentOrders.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableRowAssignmentOrders.lean index 5ab055c176e4a5a2b9727e22b65a891044f357b4..a339185ffd74f333b7161c14f646e712c4407671 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableRowAssignmentOrders.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableRowAssignmentOrders.lean @@ -1,119 +1,119 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundForcingHistoryOrders - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -noncomputable def rawRowAssignmentOrder (Q rowOrder : ZFSet.{u}) : ZFSet.{u} := - rowAssignmentOrder Q Q.sUnion.sUnion Q.sUnion.sUnion rowOrder - -theorem pair_mem_rawRowAssignmentOrder (Q rowOrder q A p D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ rawRowAssignmentOrder Q rowOrder ↔ - ZFSet.pair q A ∈ Q ∧ ZFSet.pair p D ∈ Q ∧ ZFSet.pair q p ∈ rowOrder ∧ D ⊆ A := by - rw [rawRowAssignmentOrder, pair_mem_rowAssignmentOrder] - constructor - · rintro ⟨hq, hp, _, _, _, _, below, data⟩ - exact ⟨hq, hp, below, data⟩ - · rintro ⟨hq, hp, below, data⟩ - exact ⟨hq, hp, pair_first_mem_doubleUnion hq, pair_second_mem_doubleUnion hq, - pair_first_mem_doubleUnion hp, pair_second_mem_doubleUnion hp, below, data⟩ - -theorem rawRowAssignmentOrder_eq {Q C B rowOrder : ZFSet.{u}} (shape : Q ⊆ ZFSet.prod C B) : - rawRowAssignmentOrder Q rowOrder = rowAssignmentOrder Q C B rowOrder := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((mem_rowAssignmentOrder _ _ _ _ z).1 member).1 - obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hx) - obtain ⟨p, hp, D, hD, rfl⟩ := ZFSet.mem_prod.1 (shape hy) - obtain ⟨_, _, below, data⟩ := (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).1 member - exact (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).2 ⟨hx, hy, hq, hA, hp, hD, below, data⟩ - · intro member - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((mem_rowAssignmentOrder _ _ _ _ z).1 member).1 - obtain ⟨q, _, A, _, rfl⟩ := ZFSet.mem_prod.1 (shape hx) - obtain ⟨p, _, D, _, rfl⟩ := ZFSet.mem_prod.1 (shape hy) - obtain ⟨_, _, _, _, _, _, below, data⟩ := (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).1 member - exact (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).2 ⟨hx, hy, below, data⟩ - -theorem TransitiveGround.refinementHistoryOrder_raw (M : TransitiveGround.{u}) - (rows rowOrder T stages history : ZFSet.{u}) : - M.refinementHistoryOrder rows rowOrder T stages history = - rawRowAssignmentOrder (M.refinementHistoryForcing rows T stages history) rowOrder := - (rawRowAssignmentOrder_eq (M.refinementHistoryForcing_shape rows T stages history)).symm - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_rowAssignmentOrder : - GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => - rowAssignmentOrder (env 0) (env 1) (env 2) (env 3)) := by - let v := GroundSetTerm.var M (n := 4) - let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, v 0] - let formula : SetFormula 4 := (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3).toFormula - let term := GroundSetTerm.app (M.definable_separation separation formula) ![bound, v 1, v 2, v 3] - refine { formula := term.definition.formula - closed := fun env members => M.rowAssignmentOrder_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) - correct := ?_ } - intro env members z hz - rw [term.definition.correct env members z hz] - have args : (fun j : Fin 3 => (![bound, v 1, v 2, v 3] j.succ).eval env) = - ![env 1, env 2, env 3] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j - have equal : term.eval env = rowAssignmentOrder (env 0) (env 1) (env 2) (env 3) := by - change ZFSet.sep (fun w => Realize M.sets formula (extend w _)) (bound.eval env) = _ - rw [args] - apply ZFSet.ext - intro w - rw [ZFSet.mem_sep, mem_rowAssignmentOrder] - apply and_congr_right - intro hw - change Realize M.sets (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3).toFormula - (extend w ![env 1, env 2, env 3]) ↔ _ - rw [BoundedFormula.realize_toFormula M _ (extend w ![env 1, env 2, env 3]) - (Fin.cases (M.transitive (bound.ground env members) hw) - (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) (fun j => Fin.elim0 j))))), - BoundedFormula.truth_rowAssignmentOrderFormula] - rfl - rw [equal] - -noncomputable def definable_rawRowAssignmentOrder : - GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => rawRowAssignmentOrder (env 0) (env 1)) := by - let v := GroundSetTerm.var M (n := 2) - let fields := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 0] - exact (GroundSetTerm.app (M.definable_rowAssignmentOrder pairing unions powers separation) - ![v 0, fields, fields, v 1]).definition - -noncomputable def rawRowAssignmentOrderOutputFormula {n : Nat} - (output Q rowOrder : Fin n) : SetFormula n := - reindex (extend output ![Q, rowOrder]) - (M.definable_rawRowAssignmentOrder pairing unions powers separation).formula - -theorem realize_rawRowAssignmentOrderOutputFormula {n : Nat} - (output Q rowOrder : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output Q rowOrder) env ↔ - env output = rawRowAssignmentOrder (env Q) (env rowOrder) := by - unfold rawRowAssignmentOrderOutputFormula - rw [realize_reindex, map_extend] - exact (M.definable_rawRowAssignmentOrder pairing unions powers separation).correct - (fun j => env (![Q, rowOrder] j)) (fun j => members _) (env output) (members output) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundForcingHistoryOrders + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +noncomputable def rawRowAssignmentOrder (Q rowOrder : ZFSet.{u}) : ZFSet.{u} := + rowAssignmentOrder Q Q.sUnion.sUnion Q.sUnion.sUnion rowOrder + +theorem pair_mem_rawRowAssignmentOrder (Q rowOrder q A p D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ rawRowAssignmentOrder Q rowOrder ↔ + ZFSet.pair q A ∈ Q ∧ ZFSet.pair p D ∈ Q ∧ ZFSet.pair q p ∈ rowOrder ∧ D ⊆ A := by + rw [rawRowAssignmentOrder, pair_mem_rowAssignmentOrder] + constructor + · rintro ⟨hq, hp, _, _, _, _, below, data⟩ + exact ⟨hq, hp, below, data⟩ + · rintro ⟨hq, hp, below, data⟩ + exact ⟨hq, hp, pair_first_mem_doubleUnion hq, pair_second_mem_doubleUnion hq, + pair_first_mem_doubleUnion hp, pair_second_mem_doubleUnion hp, below, data⟩ + +theorem rawRowAssignmentOrder_eq {Q C B rowOrder : ZFSet.{u}} (shape : Q ⊆ ZFSet.prod C B) : + rawRowAssignmentOrder Q rowOrder = rowAssignmentOrder Q C B rowOrder := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((mem_rowAssignmentOrder _ _ _ _ z).1 member).1 + obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hx) + obtain ⟨p, hp, D, hD, rfl⟩ := ZFSet.mem_prod.1 (shape hy) + obtain ⟨_, _, below, data⟩ := (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).1 member + exact (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).2 ⟨hx, hy, hq, hA, hp, hD, below, data⟩ + · intro member + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((mem_rowAssignmentOrder _ _ _ _ z).1 member).1 + obtain ⟨q, _, A, _, rfl⟩ := ZFSet.mem_prod.1 (shape hx) + obtain ⟨p, _, D, _, rfl⟩ := ZFSet.mem_prod.1 (shape hy) + obtain ⟨_, _, _, _, _, _, below, data⟩ := (pair_mem_rowAssignmentOrder _ _ _ _ _ _ _ _).1 member + exact (pair_mem_rawRowAssignmentOrder _ _ _ _ _ _).2 ⟨hx, hy, below, data⟩ + +theorem TransitiveGround.refinementHistoryOrder_raw (M : TransitiveGround.{u}) + (rows rowOrder T stages history : ZFSet.{u}) : + M.refinementHistoryOrder rows rowOrder T stages history = + rawRowAssignmentOrder (M.refinementHistoryForcing rows T stages history) rowOrder := + (rawRowAssignmentOrder_eq (M.refinementHistoryForcing_shape rows T stages history)).symm + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_rowAssignmentOrder : + GroundDefinableFunction M (fun env : Fin 4 → ZFSet.{u} => + rowAssignmentOrder (env 0) (env 1) (env 2) (env 3)) := by + let v := GroundSetTerm.var M (n := 4) + let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, v 0] + let formula : SetFormula 4 := (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3).toFormula + let term := GroundSetTerm.app (M.definable_separation separation formula) ![bound, v 1, v 2, v 3] + refine { formula := term.definition.formula + closed := fun env members => M.rowAssignmentOrder_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) + correct := ?_ } + intro env members z hz + rw [term.definition.correct env members z hz] + have args : (fun j : Fin 3 => (![bound, v 1, v 2, v 3] j.succ).eval env) = + ![env 1, env 2, env 3] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j + have equal : term.eval env = rowAssignmentOrder (env 0) (env 1) (env 2) (env 3) := by + change ZFSet.sep (fun w => Realize M.sets formula (extend w _)) (bound.eval env) = _ + rw [args] + apply ZFSet.ext + intro w + rw [ZFSet.mem_sep, mem_rowAssignmentOrder] + apply and_congr_right + intro hw + change Realize M.sets (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3).toFormula + (extend w ![env 1, env 2, env 3]) ↔ _ + rw [BoundedFormula.realize_toFormula M _ (extend w ![env 1, env 2, env 3]) + (Fin.cases (M.transitive (bound.ground env members) hw) + (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) (fun j => Fin.elim0 j))))), + BoundedFormula.truth_rowAssignmentOrderFormula] + rfl + rw [equal] + +noncomputable def definable_rawRowAssignmentOrder : + GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => rawRowAssignmentOrder (env 0) (env 1)) := by + let v := GroundSetTerm.var M (n := 2) + let fields := GroundSetTerm.app (M.definable_doubleUnion unions) ![v 0] + exact (GroundSetTerm.app (M.definable_rowAssignmentOrder pairing unions powers separation) + ![v 0, fields, fields, v 1]).definition + +noncomputable def rawRowAssignmentOrderOutputFormula {n : Nat} + (output Q rowOrder : Fin n) : SetFormula n := + reindex (extend output ![Q, rowOrder]) + (M.definable_rawRowAssignmentOrder pairing unions powers separation).formula + +theorem realize_rawRowAssignmentOrderOutputFormula {n : Nat} + (output Q rowOrder : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output Q rowOrder) env ↔ + env output = rawRowAssignmentOrder (env Q) (env rowOrder) := by + unfold rawRowAssignmentOrderOutputFormula + rw [realize_reindex, map_extend] + exact (M.definable_rawRowAssignmentOrder pairing unions powers separation).correct + (fun j => env (![Q, rowOrder] j)) (fun j => members _) (env output) (members output) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableSelections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableSelections.lean index ab4e01f3bcbf557c24489a5464d23e066f045692..d687d74ee45f991a000bb8f27e73ce8d8dfa6e3e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableSelections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundDefinableSelections.lean @@ -1,129 +1,129 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -def partialCollectionFormula {n : Nat} (φ : SetFormula (n + 2)) : SetFormula (n + 2) := - imp (ex (binaryApplication φ (fun j => j.succ.succ.succ) 1 0)) φ - -def relationImageFormula {n : Nat} (φ : SetFormula (n + 2)) : SetFormula (n + 2) := - ex (.conj (.mem 0 2) (binaryApplication φ (fun j => j.succ.succ.succ) 0 1)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_partialCollectionFormula {n : Nat} (φ : SetFormula (n + 2)) - (params : Fin n → ZFSet.{u}) (x y : ZFSet.{u}) : - Realize M.sets (partialCollectionFormula φ) (extend x (extend y params)) ↔ - ((∃ z ∈ M.sets, Realize M.sets φ (extend x (extend z params))) → - Realize M.sets φ (extend x (extend y params))) := by - simp only [partialCollectionFormula, realize_imp, realize_ex, realize_binaryApplication] - rfl - -theorem realize_relationImageFormula {n : Nat} (φ : SetFormula (n + 2)) - (params : Fin n → ZFSet.{u}) (A y : ZFSet.{u}) (hA : A ∈ M.sets) : - Realize M.sets (relationImageFormula φ) (extend y (extend A params)) ↔ - ∃ x ∈ A, Realize M.sets φ (extend x (extend y params)) := by - rw [relationImageFormula, realize_ex] - constructor - · rintro ⟨x, _, member, rel⟩ - exact ⟨x, member, (realize_binaryApplication M.sets φ _ _ _ _).1 rel⟩ - · rintro ⟨x, hx, rel⟩ - exact ⟨x, M.transitive hA hx, hx, (realize_binaryApplication M.sets φ _ _ _ _).2 rel⟩ - -theorem partialCollection_witness (collection : CollectionSchema M.sets) - {n : Nat} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {A : ZFSet.{u}} (hA : A ∈ M.sets) : - ∃ W ∈ M.sets, ∀ x ∈ A, - (∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params))) → - ∃ y ∈ W, Realize M.sets φ (extend x (extend y params)) := by - classical - have witnesses : ∀ x ∈ A, ∃ y ∈ M.sets, - Realize M.sets (partialCollectionFormula φ) (extend x (extend y params)) := by - intro x _ - by_cases possible : ∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params)) - · obtain ⟨y, hy, rel⟩ := possible - exact ⟨y, hy, (M.realize_partialCollectionFormula φ params x y).2 (fun _ => rel)⟩ - · exact ⟨A, hA, (M.realize_partialCollectionFormula φ params x A).2 (fun h => False.elim (possible h))⟩ - obtain ⟨W, hW, bounds⟩ := M.collection_witness collection (partialCollectionFormula φ) params members hA witnesses - refine ⟨W, hW, ?_⟩ - intro x hx possible - obtain ⟨y, hy, rel⟩ := bounds x hx - exact ⟨y, hy, (M.realize_partialCollectionFormula φ params x y).1 rel possible⟩ - -theorem definable_image_mem (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {n : Nat} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {A C : ZFSet.{u}} (hA : A ∈ M.sets) - (ground : ∀ y ∈ C, y ∈ M.sets) - (correct : ∀ y ∈ M.sets, y ∈ C ↔ ∃ x ∈ A, Realize M.sets φ (extend x (extend y params))) - (functional : ∀ x ∈ A, ∀ y ∈ M.sets, ∀ z ∈ M.sets, - Realize M.sets φ (extend x (extend y params)) → - Realize M.sets φ (extend x (extend z params)) → y = z) : C ∈ M.sets := by - obtain ⟨W, hW, bounds⟩ := M.partialCollection_witness collection φ params members hA - have bound : C ⊆ W := by - intro y hy - have hyM := ground y hy - obtain ⟨x, hx, rel⟩ := (correct y hyM).1 hy - obtain ⟨z, hz, relz⟩ := bounds x hx ⟨y, hyM, rel⟩ - exact (functional x hx y hyM z (M.transitive hW hz) rel relz).symm ▸ hz - have selected := M.separation_mem separation (relationImageFormula φ) (extend A params) - (Fin.cases hA members) hW - have eq : ZFSet.sep (fun y => Realize M.sets (relationImageFormula φ) (extend y (extend A params))) W = C := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep, M.realize_relationImageFormula φ params A y hA] - constructor - · rintro ⟨hy, rel⟩ - exact (correct y (M.transitive hW hy)).2 rel - · intro hy - exact ⟨bound hy, (correct y (ground y hy)).1 hy⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.SetFormula - -def separationCodeFormula {n : Nat} (φ : SetFormula (n + 1)) : SetFormula (n + 2) := - exactSetFormula 0 (.conj (.mem 0 2) - (reindex (extend 0 (fun j : Fin n => j.succ.succ.succ)) φ)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -def definable_separation (separation : SeparationSchema M.sets) - {n : Nat} (φ : SetFormula (n + 1)) : - GroundDefinableFunction M (fun env : Fin (n + 1) → ZFSet.{u} => - ZFSet.sep (fun z => Realize M.sets φ (extend z (fun j => env j.succ))) (env 0)) where - formula := separationCodeFormula φ - closed := by - intro env members - exact M.separation_mem separation φ (fun j => env j.succ) (fun j => members j.succ) (members 0) - correct := by - intro env members z hz - apply M.realize_exactSetFormula 0 _ (extend z env) hz - · intro w hw - exact M.transitive (members 0) (ZFSet.mem_sep.1 hw).1 - · intro w _ - rw [ZFSet.mem_sep] - change (w ∈ env 0 ∧ Realize M.sets (reindex _ φ) _) ↔ _ - rw [realize_reindex, map_extend] - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.IndexedTupleNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +def partialCollectionFormula {n : Nat} (φ : SetFormula (n + 2)) : SetFormula (n + 2) := + imp (ex (binaryApplication φ (fun j => j.succ.succ.succ) 1 0)) φ + +def relationImageFormula {n : Nat} (φ : SetFormula (n + 2)) : SetFormula (n + 2) := + ex (.conj (.mem 0 2) (binaryApplication φ (fun j => j.succ.succ.succ) 0 1)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_partialCollectionFormula {n : Nat} (φ : SetFormula (n + 2)) + (params : Fin n → ZFSet.{u}) (x y : ZFSet.{u}) : + Realize M.sets (partialCollectionFormula φ) (extend x (extend y params)) ↔ + ((∃ z ∈ M.sets, Realize M.sets φ (extend x (extend z params))) → + Realize M.sets φ (extend x (extend y params))) := by + simp only [partialCollectionFormula, realize_imp, realize_ex, realize_binaryApplication] + rfl + +theorem realize_relationImageFormula {n : Nat} (φ : SetFormula (n + 2)) + (params : Fin n → ZFSet.{u}) (A y : ZFSet.{u}) (hA : A ∈ M.sets) : + Realize M.sets (relationImageFormula φ) (extend y (extend A params)) ↔ + ∃ x ∈ A, Realize M.sets φ (extend x (extend y params)) := by + rw [relationImageFormula, realize_ex] + constructor + · rintro ⟨x, _, member, rel⟩ + exact ⟨x, member, (realize_binaryApplication M.sets φ _ _ _ _).1 rel⟩ + · rintro ⟨x, hx, rel⟩ + exact ⟨x, M.transitive hA hx, hx, (realize_binaryApplication M.sets φ _ _ _ _).2 rel⟩ + +theorem partialCollection_witness (collection : CollectionSchema M.sets) + {n : Nat} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {A : ZFSet.{u}} (hA : A ∈ M.sets) : + ∃ W ∈ M.sets, ∀ x ∈ A, + (∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params))) → + ∃ y ∈ W, Realize M.sets φ (extend x (extend y params)) := by + classical + have witnesses : ∀ x ∈ A, ∃ y ∈ M.sets, + Realize M.sets (partialCollectionFormula φ) (extend x (extend y params)) := by + intro x _ + by_cases possible : ∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params)) + · obtain ⟨y, hy, rel⟩ := possible + exact ⟨y, hy, (M.realize_partialCollectionFormula φ params x y).2 (fun _ => rel)⟩ + · exact ⟨A, hA, (M.realize_partialCollectionFormula φ params x A).2 (fun h => False.elim (possible h))⟩ + obtain ⟨W, hW, bounds⟩ := M.collection_witness collection (partialCollectionFormula φ) params members hA witnesses + refine ⟨W, hW, ?_⟩ + intro x hx possible + obtain ⟨y, hy, rel⟩ := bounds x hx + exact ⟨y, hy, (M.realize_partialCollectionFormula φ params x y).1 rel possible⟩ + +theorem definable_image_mem (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {n : Nat} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {A C : ZFSet.{u}} (hA : A ∈ M.sets) + (ground : ∀ y ∈ C, y ∈ M.sets) + (correct : ∀ y ∈ M.sets, y ∈ C ↔ ∃ x ∈ A, Realize M.sets φ (extend x (extend y params))) + (functional : ∀ x ∈ A, ∀ y ∈ M.sets, ∀ z ∈ M.sets, + Realize M.sets φ (extend x (extend y params)) → + Realize M.sets φ (extend x (extend z params)) → y = z) : C ∈ M.sets := by + obtain ⟨W, hW, bounds⟩ := M.partialCollection_witness collection φ params members hA + have bound : C ⊆ W := by + intro y hy + have hyM := ground y hy + obtain ⟨x, hx, rel⟩ := (correct y hyM).1 hy + obtain ⟨z, hz, relz⟩ := bounds x hx ⟨y, hyM, rel⟩ + exact (functional x hx y hyM z (M.transitive hW hz) rel relz).symm ▸ hz + have selected := M.separation_mem separation (relationImageFormula φ) (extend A params) + (Fin.cases hA members) hW + have eq : ZFSet.sep (fun y => Realize M.sets (relationImageFormula φ) (extend y (extend A params))) W = C := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep, M.realize_relationImageFormula φ params A y hA] + constructor + · rintro ⟨hy, rel⟩ + exact (correct y (M.transitive hW hy)).2 rel + · intro hy + exact ⟨bound hy, (correct y (ground y hy)).1 hy⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.SetFormula + +def separationCodeFormula {n : Nat} (φ : SetFormula (n + 1)) : SetFormula (n + 2) := + exactSetFormula 0 (.conj (.mem 0 2) + (reindex (extend 0 (fun j : Fin n => j.succ.succ.succ)) φ)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +def definable_separation (separation : SeparationSchema M.sets) + {n : Nat} (φ : SetFormula (n + 1)) : + GroundDefinableFunction M (fun env : Fin (n + 1) → ZFSet.{u} => + ZFSet.sep (fun z => Realize M.sets φ (extend z (fun j => env j.succ))) (env 0)) where + formula := separationCodeFormula φ + closed := by + intro env members + exact M.separation_mem separation φ (fun j => env j.succ) (fun j => members j.succ) (members 0) + correct := by + intro env members z hz + apply M.realize_exactSetFormula 0 _ (extend z env) hz + · intro w hw + exact M.transitive (members 0) (ZFSet.mem_sep.1 hw).1 + · intro w _ + rw [ZFSet.mem_sep] + change (w ∈ env 0 ∧ Realize M.sets (reindex _ φ) _) ↔ _ + rw [realize_reindex, map_extend] + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEligibleCaps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEligibleCaps.lean index e46806a7acf9f67cea42286793666d58b3235d13..95ed9b546896e921af94ed68d08e1a5467703e7a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEligibleCaps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEligibleCaps.lean @@ -1,666 +1,666 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowRelationSpaces -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundTestedMeetFilters -import OAI.SetTheory.PartitionPrinciple.Geometry.EligibleTaskCovariance -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchAttachment - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -theorem PosetActionCode.raw_fixes_top {G P m inv e r A g T : ZFSet.{u}} - (action : PosetActionCode G P m e r A) (group : GroupCode G m inv e) - (order : PartialOrderCode P r) (hg : g ∈ G) (hT : T ∈ P) - (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) : - ZFSet.pair (ZFSet.pair g T) T ∈ A := by - obtain ⟨y, entry, _⟩ := action.function.2 (ZFSet.pair g T) - (ZFSet.pair_mem_prod.2 ⟨hg, hT⟩) - have hy := (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2 - obtain ⟨x, hx, preimage⟩ := action.raw_preimage group hg hT - have lower := (action.raw_order_iff group order hg preimage entry).2 (greatest x hx) - have equal : y = T := order.antisymm y hy T hT (greatest y hy) lower - exact equal ▸ entry - -theorem EligibleTaskCode.source_proper - {G P m inv e r μ A source target base separator F T : ZFSet.{u}} - (code : EligibleTaskCode P G r μ A source target base separator F) - (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) - (meet : MeetOrderCode P r μ) (hT : T ∈ P) - (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) : - ZFSet.pair source T ∈ r ∧ ZFSet.pair T source ∉ r := by - refine ⟨greatest source code.source_mem, ?_⟩ - intro lower - have sourceEq : source = T := meet.order.antisymm source code.source_mem T hT - (greatest source code.source_mem) lower - obtain ⟨g, hg, restriction⟩ := code.representative - have topEntry := action.raw_fixes_top group meet.order hg hT greatest - have targetEntry : ZFSet.pair (ZFSet.pair g T) target ∈ A := sourceEq ▸ restriction.target_entry - obtain ⟨y, _, unique⟩ := action.function.2 (ZFSet.pair g T) - (ZFSet.pair_mem_prod.2 ⟨hg, hT⟩) - have targetEq : target = T := (unique target targetEntry).trans (unique T topEntry).symm - exact code.strict (targetEq.symm ▸ greatest separator code.separator_mem) - - - - - - -theorem eligibleTaskBatchInputs - {P G r μ A R U Labels m inv one : ZFSet.{u}} - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := eligibleTaskSet P G r μ A R U Labels - AttachmentBatchInputs P r μ I - (constantFamilyGraph I P) (constantFamilyGraph I r) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) - (literalTaskFilterGraph I P R U Labels) (literalTaskSeparatorGraph I P R U Labels) := by - let I := eligibleTaskSet P G r μ A R U Labels - have subset : I ⊆ literalTaskBound P R U Labels := eligibleTaskSet_subset P G r μ A R U Labels - refine ⟨meet, ⟨_, constantFamilyGraph_function I P⟩, - ⟨_, constantFamilyGraph_function I r⟩, ⟨_, constantFamilyGraph_function I μ⟩, - ⟨_, literalTaskFieldGraph_function subset 0⟩, ⟨_, literalTaskFieldGraph_function subset 2⟩, - ⟨_, literalTaskFieldGraph_function subset 4⟩, ⟨_, literalTaskFieldGraph_function subset 3⟩, ?_⟩ - intro i hi Q r' μ' a' base' F' e' hQ hr hμ ha' hBase' hF' he' - obtain ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ := - (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi - obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 hQ).2 - obtain rfl := ((pair_mem_constantFamilyGraph I r _ r').1 hr).2 - obtain rfl := ((pair_mem_constantFamilyGraph I μ _ μ').1 hμ).2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 0).1 ha').2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 2).1 hBase').2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 4).1 hF').2 - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 3).1 he').2 - obtain ⟨g, hg, represented⟩ := code.representative - exact represented.singleAttachmentInputs group action meet hg ha hc code.filter he - code.lower code.strict code.upper - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def groundEligibleTasks (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := - eligibleTaskSet P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - -theorem groundEligibleTasks_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (meet : MeetOrderCode P r μ) : M.groundEligibleTasks P G r μ A Labels ∈ M.sets := by - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - have hR : R ∈ M.sets := M.groundRelations_mem pairing unions powers separation hP hP - have hU : U ∈ M.sets := M.groundMeetFilters_mem powers separation hP hr hμ meet - let params := extend P (extend G (extend r (extend μ (extend A - (extend R (extend U (extend Labels Fin.elim0))))))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hP (Fin.cases hG (Fin.cases hr (Fin.cases hμ (Fin.cases hA - (Fin.cases hR (Fin.cases hU (Fin.cases hLabels (fun i => Fin.elim0 i)))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.eligibleTaskEntryFormula 0 1 2 3 4 5 6 7 8) params members - (M.literalTaskBound_mem pairing unions powers separation hP hR hU hLabels) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.eligibleTaskEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) - (literalTaskBound P R U Labels) = M.groundEligibleTasks P G r μ A Labels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_eligibleTaskEntryFormula _ _ _ _ _ _ _ _ _ _ meet] - exact ⟨And.right, fun hz => ⟨eligibleTaskSet_subset P G r μ A R U Labels hz, hz⟩⟩ - exact equal ▸ selected - -theorem literalTaskCode_mem_groundEligibleTasks - (P G r μ A Labels a c base e F label : ZFSet.{u}) : - literalTaskCode a c base e F label ∈ M.groundEligibleTasks P G r μ A Labels ↔ - label ∈ Labels ∧ base ∈ M.sets ∧ F ∈ M.sets ∧ EligibleTaskCode P G r μ A a c base e F := by - rw [groundEligibleTasks, literalTaskCode_mem_eligibleTaskSet, - M.mem_groundRelations, M.mem_groundMeetFilters] - constructor - · rintro ⟨_, _, ⟨hBase, _⟩, _, ⟨hF, _⟩, hLabel, code⟩ - exact ⟨hLabel, hBase, hF, code⟩ - · rintro ⟨hLabel, hBase, hF, code⟩ - obtain ⟨g, _, represented⟩ := code.representative - exact ⟨code.source_mem, code.target_mem, ⟨hBase, represented.shape⟩, - code.separator_mem, ⟨hF, code.filter⟩, hLabel, code⟩ - - - - - - -theorem groundEligibleTaskFields - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - I ∈ M.sets ∧ constantFamilyGraph I P ∈ M.sets ∧ - constantFamilyGraph I r ∈ M.sets ∧ constantFamilyGraph I μ ∈ M.sets ∧ - ∀ j : Fin 6, literalTaskFieldGraph I P R U Labels j ∈ M.sets ∧ - ZFSet.IsFunc I (literalTaskFieldBound P R U Labels j) (literalTaskFieldGraph I P R U Labels j) := by - have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet - have hR := M.groundRelations_mem pairing unions powers separation hP hP - have hU := M.groundMeetFilters_mem powers separation hP hr hμ meet - exact ⟨hI, M.constantFamilyGraph_mem pairing unions powers separation hI hP, - M.constantFamilyGraph_mem pairing unions powers separation hI hr, - M.constantFamilyGraph_mem pairing unions powers separation hI hμ, - M.literalTaskFieldFamilies pairing unions powers separation hI hP hR hU hLabels - (eligibleTaskSet_subset P G r μ A _ _ Labels)⟩ - -theorem groundEligibleTaskBatchInputs - {P G r μ A Labels m inv one : ZFSet.{u}} - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - AttachmentBatchInputs P r μ I - (constantFamilyGraph I P) (constantFamilyGraph I r) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) - (literalTaskFilterGraph I P R U Labels) (literalTaskSeparatorGraph I P R U Labels) := - eligibleTaskBatchInputs group action meet - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -theorem literalTaskBound_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {P R U Labels : ZFSet.{u}} (points : ZFSet.rank P < o) (relations : ZFSet.rank R < o) - (filters : ZFSet.rank U < o) (labels : ZFSet.rank Labels < o) : - ZFSet.rank (literalTaskBound P R U Labels) < o := - rank_product_lt limit points (rank_product_lt limit points - (rank_product_lt limit relations (rank_product_lt limit points (rank_product_lt limit filters labels)))) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem groundPower_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {A : ZFSet.{u}} (bound : ZFSet.rank A < o) : ZFSet.rank (M.groundPower A) < o := by - have subset : M.groundPower A ⊆ ZFSet.powerset A := fun _ hz => (ZFSet.mem_sep.1 hz).1 - have rankBound := ZFSet.rank_mono subset - rw [ZFSet.rank_powerset] at rankBound - exact rankBound.trans_lt (limit.succ_lt bound) - -theorem groundRelations_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {A B : ZFSet.{u}} (source : ZFSet.rank A < o) (target : ZFSet.rank B < o) : - ZFSet.rank (M.groundRelations A B) < o := - M.groundPower_rank_lt limit (rank_product_lt limit source target) - -theorem groundMeetFilters_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {P : ZFSet.{u}} (r μ : ZFSet.{u}) (points : ZFSet.rank P < o) : - ZFSet.rank (M.groundMeetFilters P r μ) < o := - (ZFSet.rank_mono (show M.groundMeetFilters P r μ ⊆ M.groundPower P - from fun _ hz => (ZFSet.mem_sep.1 hz).1)).trans_lt (M.groundPower_rank_lt limit points) - -theorem groundEligibleTasks_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {P Labels : ZFSet.{u}} (G r μ A : ZFSet.{u}) - (points : ZFSet.rank P < o) (labels : ZFSet.rank Labels < o) : - ZFSet.rank (M.groundEligibleTasks P G r μ A Labels) < o := - (ZFSet.rank_mono (eligibleTaskSet_subset P G r μ A (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels)).trans_lt - (literalTaskBound_rank_lt limit points (M.groundRelations_rank_lt limit points points) - (M.groundMeetFilters_rank_lt limit r μ points) labels) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem taskRepresentativeRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I P G r A R U Labels : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) - (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hA : A ∈ M.sets) - (hR : R ∈ M.sets) (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) : - taskRepresentativeRelation I P G r A R U Labels ∈ M.sets := by - let params := extend I (extend P (extend G (extend r (extend A - (extend R (extend U (extend Labels Fin.elim0))))))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hI (Fin.cases hP (Fin.cases hG (Fin.cases hr (Fin.cases hA - (Fin.cases hR (Fin.cases hU (Fin.cases hLabels (fun i => Fin.elim0 i)))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.taskRepresentativeEntryFormula 0 1 2 3 4 5 6 7 8) params members - (M.prod_mem pairing unions powers separation hI hG) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.taskRepresentativeEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) - (ZFSet.prod I G) = taskRepresentativeRelation I P G r A R U Labels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, taskRepresentativeRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_taskRepresentativeEntryFormula _ _ _ _ _ _ _ _ _ _) - exact equal ▸ selected - -theorem exists_groundTaskRepresentatives - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - ∃ representatives ∈ M.sets, ZFSet.IsFunc I G representatives ∧ - (∀ task g, ZFSet.pair task g ∈ representatives → - TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels task g) ∧ - (∀ a c base e F label g, ZFSet.pair (literalTaskCode a c base e F label) g ∈ representatives → - RestrictedActionCode P r A g a c base) := by - have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet - have hR := M.groundRelations_mem pairing unions powers separation hP hP - have hU := M.groundMeetFilters_mem powers separation hP hr hμ meet - obtain ⟨representatives, ground, function, subset⟩ := M.uniformize_relation - pairing unions powers separation choice hI hG - (M.taskRepresentativeRelation_mem pairing unions powers separation hI hP hG hr hA hR hU hLabels) - (eligibleTask_representative_total P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - have represents : ∀ task g, ZFSet.pair task g ∈ representatives → - TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels task g := - fun _ _ entry => ((pair_mem_taskRepresentativeRelation _ _ _ _ _ _ _ _ _ _).1 (subset entry)).2.2 - exact ⟨representatives, ground, function, represents, - fun _ _ _ _ _ _ _ entry => (represents _ _ entry).restriction⟩ - - - - - - -theorem groundEligibleTaskAttachment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Qs := constantFamilyGraph I P - let rs := constantFamilyGraph I r - let μs := constantFamilyGraph I μ - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Fs := literalTaskFilterGraph I P R U Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ - batchAttachmentShadowGraph I P Qs μs As Es ∈ M.sets ∧ - batchAttachmentTemplateGraph I P Qs rs As Es ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets ∧ - MeetOrderCode d.batchCarrier d.batchOrder d.batchMeetGraph ∧ - ZFSet.IsFunc (indexedAttachmentDomain I Qs) P (batchAttachmentShadowGraph I P Qs μs As Es) ∧ - ZFSet.IsFunc (indexedAttachmentDomain I Qs) d.batchCarrier - (batchAttachmentTemplateGraph I P Qs rs As Es) ∧ - MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph (attachmentOldEmbeddingGraph P) ∧ - (∀ p ∈ P, ZFSet.pair p p ∈ attachmentOldEmbeddingGraph P) ∧ - d.batchOrder = codedAttachmentOrder P (indexedAttachmentFresh I Qs rs As) r - (batchAttachmentInsideGraph I Qs rs) (batchAttachmentShadowGraph I P Qs μs As Es) - (batchAttachmentUpperGraph I P Qs Fs) ∧ - (∀ i : {i : ZFSet.{u} // i ∈ I}, - batchTemplateGraph I P Qs rs As Es i.val ∈ M.sets ∧ - MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph - (batchTemplateGraph I P Qs rs As Es i.val)) := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨hL, hrL, hμL, hShadow, hRepresentation, hOld⟩ := M.batchAttachment_ground_codes - pairing unions powers separation d hP hr hI hQs hrs hμs - (fields 0).1 (fields 2).1 (fields 4).1 - refine ⟨hL, hrL, hμL, hShadow, hRepresentation, hOld, - d.batch_meetOrder, d.batch_shadow_function, d.batch_template_function, - d.coding.old_embedding_code, - (fun p hp => (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨hp, rfl⟩), rfl, ?_⟩ - intro i - have hSpace : d.space i = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry i)).2 - have hRel : d.rel i = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry i)).2 - have hMeet : d.meet i = μ := ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry i)).2 - refine ⟨M.batchTemplateGraph_mem pairing unions powers separation hI hP hQs hrs - (fields 0).1 (fields 2).1 (M.transitive hI i.property), ?_⟩ - simpa only [hSpace, hRel, hMeet] using d.batch_template_embedding_code i - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace GroundBelow -variable {M : TransitiveGround.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem meetFilters {P r μ K : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hK : K ∈ M.sets) - (meet : MeetOrderCode P r μ) (strong : GroundStrongLimit M K) (small : GroundBelow M P K) : - GroundBelow M (M.groundMeetFilters P r μ) K := - (strong.power_closed pairing unions powers separation hP hK small).restrict separation - (M.groundMeetFilters_mem powers separation hP hr hμ meet) hK - (fun _ member => (ZFSet.mem_sep.1 member).1) - -theorem literalTaskBound {P R U Labels K : ZFSet.{u}} - (hP : P ∈ M.sets) (hR : R ∈ M.sets) (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (points : GroundBelow M P K) (relations : GroundBelow M R K) - (filters : GroundBelow M U K) (labels : GroundBelow M Labels K) : - GroundBelow M (Forcing.literalTaskBound P R U Labels) K := by - have combine {X Y : ZFSet.{u}} (first : X ∈ M.sets ∧ GroundBelow M X K) - (second : Y ∈ M.sets ∧ GroundBelow M Y K) : - ZFSet.prod X Y ∈ M.sets ∧ GroundBelow M (ZFSet.prod X Y) K := - ⟨M.prod_mem pairing unions powers separation first.1 second.1, - GroundBelow.product pairing unions powers separation first.1 second.1 hK ordinal strong first.2 second.2⟩ - exact (combine ⟨hP, points⟩ (combine ⟨hP, points⟩ (combine ⟨hR, relations⟩ - (combine ⟨hP, points⟩ (combine ⟨hU, filters⟩ ⟨hLabels, labels⟩))))).2 - -end GroundBelow - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem groundEligibleTasks_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels K : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) - (meet : MeetOrderCode P r μ) (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (points : GroundBelow M P K) (labels : GroundBelow M Labels K) : - GroundBelow M (M.groundEligibleTasks P G r μ A Labels) K := by - have hR := M.groundRelations_mem pairing unions powers separation hP hP - have hU := M.groundMeetFilters_mem powers separation hP hr hμ meet - have relations := GroundBelow.relations pairing unions powers separation hP hP hK ordinal strong points points - have filters := GroundBelow.meetFilters pairing unions powers separation hP hr hμ hK meet strong points - have bound := GroundBelow.literalTaskBound pairing unions powers separation hP hR hU hLabels hK - ordinal strong points relations filters labels - exact bound.restrict separation - (M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) hK - (eligibleTaskSet_subset P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -universe u - -def eligibleTaskCap (P T i : ZFSet.{u}) : ZFSet.{u} := - ZFSet.pair P (ZFSet.pair i T) - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) -variable {P G r μ A Labels m inv one T : ZFSet.{u}} -variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hT : T ∈ P) - (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) -include group action meet hT greatest - -theorem groundEligibleTask_cap_fresh {i : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) : - ZFSet.pair i T ∈ indexedAttachmentFresh (M.groundEligibleTasks P G r μ A Labels) - (constantFamilyGraph (M.groundEligibleTasks P G r μ A Labels) P) - (constantFamilyGraph (M.groundEligibleTasks P G r μ A Labels) r) - (literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) := by - obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, rfl, code⟩ := - (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi - exact (literalTask_fresh_iff ha hc hb hs hF hl).2 - ⟨hi, hT, (code.source_proper group action meet hT greatest).2⟩ - -theorem groundEligibleTask_cap_entry {i : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - ZFSet.pair (ZFSet.pair i T) (eligibleTaskCap P T i) ∈ - batchAttachmentTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by - have fresh := M.groundEligibleTask_cap_fresh group action meet hT greatest hi - exact (pair_mem_batchAttachmentTemplateGraph _ _ _ _ _ _ _ _ _).2 - ⟨indexedAttachmentFresh_subset _ _ _ _ fresh, pair_mem_taggedExtension.2 fresh, - Or.inr ⟨fresh, rfl⟩⟩ - -theorem groundEligibleTask_cap_mem {i : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) : - eligibleTaskCap P T i ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchCarrier := - pair_mem_taggedExtension.2 (M.groundEligibleTask_cap_fresh group action meet hT greatest hi) - -omit group action in -theorem groundEligibleTask_cap_shadow {i c : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) - (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - ZFSet.pair (ZFSet.pair i T) c ∈ batchAttachmentShadowGraph I P - (constantFamilyGraph I P) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by - obtain ⟨a, ha, b, hb, base, hbase, s, hs, F, hF, label, hl, rfl, code⟩ := - (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi - obtain rfl := ((literalTaskFieldGraph_entry_iff ha hb hbase hs hF hl 1).1 target).2 - have topMeet : ZFSet.pair (ZFSet.pair T a) a ∈ μ := meet.pair_iff.2 - ⟨hT, ha, ha, greatest a ha, meet.order.refl a ha, - fun _ _ _ lower => lower⟩ - obtain ⟨g, _, represented⟩ := code.representative - have baseEntry := (represented.entries a ha c hb).2 - ⟨meet.order.refl a ha, represented.target_entry⟩ - exact (literalTask_shadow_iff ha hb hbase hs hF hl).2 - ⟨hi, (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2 - ⟨hT, hb, a, ha, topMeet, baseEntry⟩⟩ - -theorem groundEligibleTask_negative_cap {i c F v w : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) - (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (hv : v ∈ P) (negative : v ∉ F) - (entry : ZFSet.pair (ZFSet.pair (eligibleTaskCap P T i) v) w ∈ - (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchMeetGraph) : - ZFSet.pair (ZFSet.pair c v) w ∈ μ ∧ ZFSet.pair w c ∈ r ∧ - ZFSet.pair w c ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchOrder := by - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let j : {i : ZFSet.{u} // i ∈ M.groundEligibleTasks P G r μ A Labels} := ⟨i, hi⟩ - have fresh := M.groundEligibleTask_cap_fresh group action meet hT greatest hi - have freshT : T ∈ freshPart (d.space j) (d.rel j) (d.anchor j) := - (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors - (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh - have shadow := M.groundEligibleTask_cap_shadow meet hT greatest hi target - have hc := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 shadow)).2 - have filterEq : d.filter j = F := (d.filters.unique filter (d.filter_entry j)).symm - have notAbove : ZFSet.pair (eligibleTaskCap P T i) v ∉ d.batchOrder := by - intro lower - have positive := (d.batch_old_upper_iff j freshT hv).1 lower - exact negative (filterEq ▸ positive) - obtain ⟨z, oldMeet, _⟩ := meet.operation.2 (ZFSet.pair c v) - (ZFSet.pair_mem_prod.2 ⟨hc, hv⟩) - have newMeet := d.batch_shadow_meet_code j freshT hv shadow oldMeet notAbove - obtain ⟨_, _, unique⟩ := d.batch_meetOrder.operation.2 - (ZFSet.pair (eligibleTaskCap P T i) v) - (ZFSet.pair_mem_prod.2 ⟨M.groundEligibleTask_cap_mem group action meet hT greatest hi, - old_mem_taggedExtension hv⟩) - have equal : w = z := (unique w entry).trans (unique z newMeet).symm - have oldW : ZFSet.pair (ZFSet.pair c v) w ∈ μ := equal.symm ▸ oldMeet - have lower := meet.lower_left c v w oldW - have hw := (ZFSet.pair_mem_prod.1 (meet.operation.1 oldW)).2 - exact ⟨oldW, lower, (d.coding.le_encode (.inl ⟨w, hw⟩) (.inl ⟨c, hc⟩)).2 lower⟩ - -end TransitiveGround - - - - - - -noncomputable def initialCapGraph (I L T representation : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ k ∈ L, z = ZFSet.pair i k ∧ - ZFSet.pair (ZFSet.pair i T) k ∈ representation) (ZFSet.prod I L) - -theorem mem_initialCapGraph (I L T representation z : ZFSet.{u}) : - z ∈ initialCapGraph I L T representation ↔ - ∃ i ∈ I, ∃ k ∈ L, z = ZFSet.pair i k ∧ - ZFSet.pair (ZFSet.pair i T) k ∈ representation := by - constructor - · exact fun hz => (ZFSet.mem_sep.1 hz).2 - · rintro ⟨i, hi, k, hk, rfl, entry⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hk⟩, i, hi, k, hk, rfl, entry⟩ - -theorem pair_mem_initialCapGraph (I L T representation i k : ZFSet.{u}) : - ZFSet.pair i k ∈ initialCapGraph I L T representation ↔ - i ∈ I ∧ k ∈ L ∧ ZFSet.pair (ZFSet.pair i T) k ∈ representation := by - rw [mem_initialCapGraph] - constructor - · rintro ⟨j, hj, z, hz, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, hz, entry⟩ - · rintro ⟨hi, hk, entry⟩ - exact ⟨i, hi, k, hk, rfl, entry⟩ - -theorem initialCapGraph_function {I L T representation domain : ZFSet.{u}} - (function : ZFSet.IsFunc domain L representation) - (covers : ∀ i ∈ I, ZFSet.pair i T ∈ domain) : - ZFSet.IsFunc I L (initialCapGraph I L T representation) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro i hi - obtain ⟨k, entry, unique⟩ := function.2 (ZFSet.pair i T) (covers i hi) - have hk := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - refine ⟨k, (pair_mem_initialCapGraph _ _ _ _ _ _).2 ⟨hi, hk, entry⟩, ?_⟩ - intro z hz - exact unique z ((pair_mem_initialCapGraph _ _ _ _ _ _).1 hz).2.2 - -namespace BoundedFormula - -open SetFormula - -def initialCapEntryFormula {n} (z I L T representation : Fin n) : BoundedFormula n := - exMem I (exMem L.succ - (.conj (orderedPairFormula z.succ.succ 1 0) - (tripleMembershipFormula 1 T.succ.succ 0 representation.succ.succ))) - -theorem truth_initialCapEntryFormula {n} (z I L T representation : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (initialCapEntryFormula z I L T representation) env ↔ - env z ∈ initialCapGraph (env I) (env L) (env T) (env representation) := by - simp only [initialCapEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_tripleMembershipFormula, mem_initialCapGraph] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem initialCapGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I L T representation : ZFSet.{u}} - (hI : I ∈ M.sets) (hL : L ∈ M.sets) (hT : T ∈ M.sets) - (hRepresentation : representation ∈ M.sets) : - initialCapGraph I L T representation ∈ M.sets := by - let params := extend I (extend L (extend T (extend representation Fin.elim0))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hI (Fin.cases hL (Fin.cases hT (Fin.cases hRepresentation (fun i => Fin.elim0 i)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.initialCapEntryFormula 0 1 2 3 4) params members - (M.prod_mem pairing unions powers separation hI hL) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.initialCapEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod I L) = initialCapGraph I L T representation := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_initialCapEntryFormula] - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact equal ▸ selected - -noncomputable def groundEligibleTaskCaps (P G r μ A Labels T : ZFSet.{u}) : ZFSet.{u} := - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Qs := constantFamilyGraph I P - let rs := constantFamilyGraph I r - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - initialCapGraph I (taggedExtension P (indexedAttachmentFresh I Qs rs As)) T - (batchAttachmentTemplateGraph I P Qs rs As Es) - -theorem groundEligibleTaskCaps_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one T : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hT : T ∈ P) - (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - M.groundEligibleTaskCaps P G r μ A Labels T ∈ M.sets ∧ - ZFSet.IsFunc I d.batchCarrier (M.groundEligibleTaskCaps P G r μ A Labels T) ∧ - (∀ i k, ZFSet.pair i k ∈ M.groundEligibleTaskCaps P G r μ A Labels T ↔ - i ∈ I ∧ k = eligibleTaskCap P T i) := by - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨hL, _, _, _, hRepresentation, _⟩ := M.groundEligibleTaskAttachment - pairing unions powers separation hP hG hr hμ hA hLabels group action meet - have graphMem := M.initialCapGraph_mem pairing unions powers separation - hI hL (M.transitive hP hT) hRepresentation - have function : ZFSet.IsFunc I d.batchCarrier (M.groundEligibleTaskCaps P G r μ A Labels T) := by - apply initialCapGraph_function d.batch_template_function - intro i hi - exact indexedAttachmentFresh_subset _ _ _ _ - (M.groundEligibleTask_cap_fresh group action meet hT greatest hi) - refine ⟨graphMem, function, ?_⟩ - intro i k - change ZFSet.pair i k ∈ initialCapGraph _ _ _ _ ↔ _ - rw [pair_mem_initialCapGraph] - constructor - · rintro ⟨hi, _, entry⟩ - have capEntry := M.groundEligibleTask_cap_entry group action meet hT greatest hi - have domain := (ZFSet.pair_mem_prod.1 (d.batch_template_function.1 entry)).1 - obtain ⟨_, _, unique⟩ := d.batch_template_function.2 (ZFSet.pair i T) domain - exact ⟨hi, (unique k entry).trans (unique _ capEntry).symm⟩ - · rintro ⟨hi, rfl⟩ - exact ⟨hi, M.groundEligibleTask_cap_mem group action meet hT greatest hi, - M.groundEligibleTask_cap_entry group action meet hT greatest hi⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowRelationSpaces +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundTestedMeetFilters +import OAI.SetTheory.PartitionPrinciple.Geometry.EligibleTaskCovariance +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchAttachment + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +theorem PosetActionCode.raw_fixes_top {G P m inv e r A g T : ZFSet.{u}} + (action : PosetActionCode G P m e r A) (group : GroupCode G m inv e) + (order : PartialOrderCode P r) (hg : g ∈ G) (hT : T ∈ P) + (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) : + ZFSet.pair (ZFSet.pair g T) T ∈ A := by + obtain ⟨y, entry, _⟩ := action.function.2 (ZFSet.pair g T) + (ZFSet.pair_mem_prod.2 ⟨hg, hT⟩) + have hy := (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2 + obtain ⟨x, hx, preimage⟩ := action.raw_preimage group hg hT + have lower := (action.raw_order_iff group order hg preimage entry).2 (greatest x hx) + have equal : y = T := order.antisymm y hy T hT (greatest y hy) lower + exact equal ▸ entry + +theorem EligibleTaskCode.source_proper + {G P m inv e r μ A source target base separator F T : ZFSet.{u}} + (code : EligibleTaskCode P G r μ A source target base separator F) + (group : GroupCode G m inv e) (action : PosetActionCode G P m e r A) + (meet : MeetOrderCode P r μ) (hT : T ∈ P) + (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) : + ZFSet.pair source T ∈ r ∧ ZFSet.pair T source ∉ r := by + refine ⟨greatest source code.source_mem, ?_⟩ + intro lower + have sourceEq : source = T := meet.order.antisymm source code.source_mem T hT + (greatest source code.source_mem) lower + obtain ⟨g, hg, restriction⟩ := code.representative + have topEntry := action.raw_fixes_top group meet.order hg hT greatest + have targetEntry : ZFSet.pair (ZFSet.pair g T) target ∈ A := sourceEq ▸ restriction.target_entry + obtain ⟨y, _, unique⟩ := action.function.2 (ZFSet.pair g T) + (ZFSet.pair_mem_prod.2 ⟨hg, hT⟩) + have targetEq : target = T := (unique target targetEntry).trans (unique T topEntry).symm + exact code.strict (targetEq.symm ▸ greatest separator code.separator_mem) + + + + + + +theorem eligibleTaskBatchInputs + {P G r μ A R U Labels m inv one : ZFSet.{u}} + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := eligibleTaskSet P G r μ A R U Labels + AttachmentBatchInputs P r μ I + (constantFamilyGraph I P) (constantFamilyGraph I r) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) + (literalTaskFilterGraph I P R U Labels) (literalTaskSeparatorGraph I P R U Labels) := by + let I := eligibleTaskSet P G r μ A R U Labels + have subset : I ⊆ literalTaskBound P R U Labels := eligibleTaskSet_subset P G r μ A R U Labels + refine ⟨meet, ⟨_, constantFamilyGraph_function I P⟩, + ⟨_, constantFamilyGraph_function I r⟩, ⟨_, constantFamilyGraph_function I μ⟩, + ⟨_, literalTaskFieldGraph_function subset 0⟩, ⟨_, literalTaskFieldGraph_function subset 2⟩, + ⟨_, literalTaskFieldGraph_function subset 4⟩, ⟨_, literalTaskFieldGraph_function subset 3⟩, ?_⟩ + intro i hi Q r' μ' a' base' F' e' hQ hr hμ ha' hBase' hF' he' + obtain ⟨a, ha, c, hc, base, hBase, e, he, F, hF, label, hLabel, rfl, code⟩ := + (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi + obtain rfl := ((pair_mem_constantFamilyGraph I P _ Q).1 hQ).2 + obtain rfl := ((pair_mem_constantFamilyGraph I r _ r').1 hr).2 + obtain rfl := ((pair_mem_constantFamilyGraph I μ _ μ').1 hμ).2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 0).1 ha').2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 2).1 hBase').2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 4).1 hF').2 + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hc hBase he hF hLabel 3).1 he').2 + obtain ⟨g, hg, represented⟩ := code.representative + exact represented.singleAttachmentInputs group action meet hg ha hc code.filter he + code.lower code.strict code.upper + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def groundEligibleTasks (P G r μ A Labels : ZFSet.{u}) : ZFSet.{u} := + eligibleTaskSet P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + +theorem groundEligibleTasks_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (meet : MeetOrderCode P r μ) : M.groundEligibleTasks P G r μ A Labels ∈ M.sets := by + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + have hR : R ∈ M.sets := M.groundRelations_mem pairing unions powers separation hP hP + have hU : U ∈ M.sets := M.groundMeetFilters_mem powers separation hP hr hμ meet + let params := extend P (extend G (extend r (extend μ (extend A + (extend R (extend U (extend Labels Fin.elim0))))))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hP (Fin.cases hG (Fin.cases hr (Fin.cases hμ (Fin.cases hA + (Fin.cases hR (Fin.cases hU (Fin.cases hLabels (fun i => Fin.elim0 i)))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.eligibleTaskEntryFormula 0 1 2 3 4 5 6 7 8) params members + (M.literalTaskBound_mem pairing unions powers separation hP hR hU hLabels) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.eligibleTaskEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) + (literalTaskBound P R U Labels) = M.groundEligibleTasks P G r μ A Labels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_eligibleTaskEntryFormula _ _ _ _ _ _ _ _ _ _ meet] + exact ⟨And.right, fun hz => ⟨eligibleTaskSet_subset P G r μ A R U Labels hz, hz⟩⟩ + exact equal ▸ selected + +theorem literalTaskCode_mem_groundEligibleTasks + (P G r μ A Labels a c base e F label : ZFSet.{u}) : + literalTaskCode a c base e F label ∈ M.groundEligibleTasks P G r μ A Labels ↔ + label ∈ Labels ∧ base ∈ M.sets ∧ F ∈ M.sets ∧ EligibleTaskCode P G r μ A a c base e F := by + rw [groundEligibleTasks, literalTaskCode_mem_eligibleTaskSet, + M.mem_groundRelations, M.mem_groundMeetFilters] + constructor + · rintro ⟨_, _, ⟨hBase, _⟩, _, ⟨hF, _⟩, hLabel, code⟩ + exact ⟨hLabel, hBase, hF, code⟩ + · rintro ⟨hLabel, hBase, hF, code⟩ + obtain ⟨g, _, represented⟩ := code.representative + exact ⟨code.source_mem, code.target_mem, ⟨hBase, represented.shape⟩, + code.separator_mem, ⟨hF, code.filter⟩, hLabel, code⟩ + + + + + + +theorem groundEligibleTaskFields + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + I ∈ M.sets ∧ constantFamilyGraph I P ∈ M.sets ∧ + constantFamilyGraph I r ∈ M.sets ∧ constantFamilyGraph I μ ∈ M.sets ∧ + ∀ j : Fin 6, literalTaskFieldGraph I P R U Labels j ∈ M.sets ∧ + ZFSet.IsFunc I (literalTaskFieldBound P R U Labels j) (literalTaskFieldGraph I P R U Labels j) := by + have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet + have hR := M.groundRelations_mem pairing unions powers separation hP hP + have hU := M.groundMeetFilters_mem powers separation hP hr hμ meet + exact ⟨hI, M.constantFamilyGraph_mem pairing unions powers separation hI hP, + M.constantFamilyGraph_mem pairing unions powers separation hI hr, + M.constantFamilyGraph_mem pairing unions powers separation hI hμ, + M.literalTaskFieldFamilies pairing unions powers separation hI hP hR hU hLabels + (eligibleTaskSet_subset P G r μ A _ _ Labels)⟩ + +theorem groundEligibleTaskBatchInputs + {P G r μ A Labels m inv one : ZFSet.{u}} + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + AttachmentBatchInputs P r μ I + (constantFamilyGraph I P) (constantFamilyGraph I r) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) + (literalTaskFilterGraph I P R U Labels) (literalTaskSeparatorGraph I P R U Labels) := + eligibleTaskBatchInputs group action meet + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +theorem literalTaskBound_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {P R U Labels : ZFSet.{u}} (points : ZFSet.rank P < o) (relations : ZFSet.rank R < o) + (filters : ZFSet.rank U < o) (labels : ZFSet.rank Labels < o) : + ZFSet.rank (literalTaskBound P R U Labels) < o := + rank_product_lt limit points (rank_product_lt limit points + (rank_product_lt limit relations (rank_product_lt limit points (rank_product_lt limit filters labels)))) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem groundPower_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {A : ZFSet.{u}} (bound : ZFSet.rank A < o) : ZFSet.rank (M.groundPower A) < o := by + have subset : M.groundPower A ⊆ ZFSet.powerset A := fun _ hz => (ZFSet.mem_sep.1 hz).1 + have rankBound := ZFSet.rank_mono subset + rw [ZFSet.rank_powerset] at rankBound + exact rankBound.trans_lt (limit.succ_lt bound) + +theorem groundRelations_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {A B : ZFSet.{u}} (source : ZFSet.rank A < o) (target : ZFSet.rank B < o) : + ZFSet.rank (M.groundRelations A B) < o := + M.groundPower_rank_lt limit (rank_product_lt limit source target) + +theorem groundMeetFilters_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {P : ZFSet.{u}} (r μ : ZFSet.{u}) (points : ZFSet.rank P < o) : + ZFSet.rank (M.groundMeetFilters P r μ) < o := + (ZFSet.rank_mono (show M.groundMeetFilters P r μ ⊆ M.groundPower P + from fun _ hz => (ZFSet.mem_sep.1 hz).1)).trans_lt (M.groundPower_rank_lt limit points) + +theorem groundEligibleTasks_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {P Labels : ZFSet.{u}} (G r μ A : ZFSet.{u}) + (points : ZFSet.rank P < o) (labels : ZFSet.rank Labels < o) : + ZFSet.rank (M.groundEligibleTasks P G r μ A Labels) < o := + (ZFSet.rank_mono (eligibleTaskSet_subset P G r μ A (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels)).trans_lt + (literalTaskBound_rank_lt limit points (M.groundRelations_rank_lt limit points points) + (M.groundMeetFilters_rank_lt limit r μ points) labels) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem taskRepresentativeRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I P G r A R U Labels : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) + (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hA : A ∈ M.sets) + (hR : R ∈ M.sets) (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) : + taskRepresentativeRelation I P G r A R U Labels ∈ M.sets := by + let params := extend I (extend P (extend G (extend r (extend A + (extend R (extend U (extend Labels Fin.elim0))))))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hI (Fin.cases hP (Fin.cases hG (Fin.cases hr (Fin.cases hA + (Fin.cases hR (Fin.cases hU (Fin.cases hLabels (fun i => Fin.elim0 i)))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.taskRepresentativeEntryFormula 0 1 2 3 4 5 6 7 8) params members + (M.prod_mem pairing unions powers separation hI hG) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.taskRepresentativeEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) + (ZFSet.prod I G) = taskRepresentativeRelation I P G r A R U Labels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, taskRepresentativeRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_taskRepresentativeEntryFormula _ _ _ _ _ _ _ _ _ _) + exact equal ▸ selected + +theorem exists_groundTaskRepresentatives + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + ∃ representatives ∈ M.sets, ZFSet.IsFunc I G representatives ∧ + (∀ task g, ZFSet.pair task g ∈ representatives → + TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels task g) ∧ + (∀ a c base e F label g, ZFSet.pair (literalTaskCode a c base e F label) g ∈ representatives → + RestrictedActionCode P r A g a c base) := by + have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet + have hR := M.groundRelations_mem pairing unions powers separation hP hP + have hU := M.groundMeetFilters_mem powers separation hP hr hμ meet + obtain ⟨representatives, ground, function, subset⟩ := M.uniformize_relation + pairing unions powers separation choice hI hG + (M.taskRepresentativeRelation_mem pairing unions powers separation hI hP hG hr hA hR hU hLabels) + (eligibleTask_representative_total P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + have represents : ∀ task g, ZFSet.pair task g ∈ representatives → + TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels task g := + fun _ _ entry => ((pair_mem_taskRepresentativeRelation _ _ _ _ _ _ _ _ _ _).1 (subset entry)).2.2 + exact ⟨representatives, ground, function, represents, + fun _ _ _ _ _ _ _ entry => (represents _ _ entry).restriction⟩ + + + + + + +theorem groundEligibleTaskAttachment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Qs := constantFamilyGraph I P + let rs := constantFamilyGraph I r + let μs := constantFamilyGraph I μ + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Fs := literalTaskFilterGraph I P R U Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ d.batchMeetGraph ∈ M.sets ∧ + batchAttachmentShadowGraph I P Qs μs As Es ∈ M.sets ∧ + batchAttachmentTemplateGraph I P Qs rs As Es ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets ∧ + MeetOrderCode d.batchCarrier d.batchOrder d.batchMeetGraph ∧ + ZFSet.IsFunc (indexedAttachmentDomain I Qs) P (batchAttachmentShadowGraph I P Qs μs As Es) ∧ + ZFSet.IsFunc (indexedAttachmentDomain I Qs) d.batchCarrier + (batchAttachmentTemplateGraph I P Qs rs As Es) ∧ + MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph (attachmentOldEmbeddingGraph P) ∧ + (∀ p ∈ P, ZFSet.pair p p ∈ attachmentOldEmbeddingGraph P) ∧ + d.batchOrder = codedAttachmentOrder P (indexedAttachmentFresh I Qs rs As) r + (batchAttachmentInsideGraph I Qs rs) (batchAttachmentShadowGraph I P Qs μs As Es) + (batchAttachmentUpperGraph I P Qs Fs) ∧ + (∀ i : {i : ZFSet.{u} // i ∈ I}, + batchTemplateGraph I P Qs rs As Es i.val ∈ M.sets ∧ + MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph + (batchTemplateGraph I P Qs rs As Es i.val)) := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨hL, hrL, hμL, hShadow, hRepresentation, hOld⟩ := M.batchAttachment_ground_codes + pairing unions powers separation d hP hr hI hQs hrs hμs + (fields 0).1 (fields 2).1 (fields 4).1 + refine ⟨hL, hrL, hμL, hShadow, hRepresentation, hOld, + d.batch_meetOrder, d.batch_shadow_function, d.batch_template_function, + d.coding.old_embedding_code, + (fun p hp => (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨hp, rfl⟩), rfl, ?_⟩ + intro i + have hSpace : d.space i = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry i)).2 + have hRel : d.rel i = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry i)).2 + have hMeet : d.meet i = μ := ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry i)).2 + refine ⟨M.batchTemplateGraph_mem pairing unions powers separation hI hP hQs hrs + (fields 0).1 (fields 2).1 (M.transitive hI i.property), ?_⟩ + simpa only [hSpace, hRel, hMeet] using d.batch_template_embedding_code i + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace GroundBelow +variable {M : TransitiveGround.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem meetFilters {P r μ K : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hK : K ∈ M.sets) + (meet : MeetOrderCode P r μ) (strong : GroundStrongLimit M K) (small : GroundBelow M P K) : + GroundBelow M (M.groundMeetFilters P r μ) K := + (strong.power_closed pairing unions powers separation hP hK small).restrict separation + (M.groundMeetFilters_mem powers separation hP hr hμ meet) hK + (fun _ member => (ZFSet.mem_sep.1 member).1) + +theorem literalTaskBound {P R U Labels K : ZFSet.{u}} + (hP : P ∈ M.sets) (hR : R ∈ M.sets) (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (points : GroundBelow M P K) (relations : GroundBelow M R K) + (filters : GroundBelow M U K) (labels : GroundBelow M Labels K) : + GroundBelow M (Forcing.literalTaskBound P R U Labels) K := by + have combine {X Y : ZFSet.{u}} (first : X ∈ M.sets ∧ GroundBelow M X K) + (second : Y ∈ M.sets ∧ GroundBelow M Y K) : + ZFSet.prod X Y ∈ M.sets ∧ GroundBelow M (ZFSet.prod X Y) K := + ⟨M.prod_mem pairing unions powers separation first.1 second.1, + GroundBelow.product pairing unions powers separation first.1 second.1 hK ordinal strong first.2 second.2⟩ + exact (combine ⟨hP, points⟩ (combine ⟨hP, points⟩ (combine ⟨hR, relations⟩ + (combine ⟨hP, points⟩ (combine ⟨hU, filters⟩ ⟨hLabels, labels⟩))))).2 + +end GroundBelow + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem groundEligibleTasks_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels K : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) + (meet : MeetOrderCode P r μ) (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (points : GroundBelow M P K) (labels : GroundBelow M Labels K) : + GroundBelow M (M.groundEligibleTasks P G r μ A Labels) K := by + have hR := M.groundRelations_mem pairing unions powers separation hP hP + have hU := M.groundMeetFilters_mem powers separation hP hr hμ meet + have relations := GroundBelow.relations pairing unions powers separation hP hP hK ordinal strong points points + have filters := GroundBelow.meetFilters pairing unions powers separation hP hr hμ hK meet strong points + have bound := GroundBelow.literalTaskBound pairing unions powers separation hP hR hU hLabels hK + ordinal strong points relations filters labels + exact bound.restrict separation + (M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet) hK + (eligibleTaskSet_subset P G r μ A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +universe u + +def eligibleTaskCap (P T i : ZFSet.{u}) : ZFSet.{u} := + ZFSet.pair P (ZFSet.pair i T) + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) +variable {P G r μ A Labels m inv one T : ZFSet.{u}} +variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hT : T ∈ P) + (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) +include group action meet hT greatest + +theorem groundEligibleTask_cap_fresh {i : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) : + ZFSet.pair i T ∈ indexedAttachmentFresh (M.groundEligibleTasks P G r μ A Labels) + (constantFamilyGraph (M.groundEligibleTasks P G r μ A Labels) P) + (constantFamilyGraph (M.groundEligibleTasks P G r μ A Labels) r) + (literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) := by + obtain ⟨a, ha, c, hc, base, hb, s, hs, F, hF, label, hl, rfl, code⟩ := + (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi + exact (literalTask_fresh_iff ha hc hb hs hF hl).2 + ⟨hi, hT, (code.source_proper group action meet hT greatest).2⟩ + +theorem groundEligibleTask_cap_entry {i : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + ZFSet.pair (ZFSet.pair i T) (eligibleTaskCap P T i) ∈ + batchAttachmentTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by + have fresh := M.groundEligibleTask_cap_fresh group action meet hT greatest hi + exact (pair_mem_batchAttachmentTemplateGraph _ _ _ _ _ _ _ _ _).2 + ⟨indexedAttachmentFresh_subset _ _ _ _ fresh, pair_mem_taggedExtension.2 fresh, + Or.inr ⟨fresh, rfl⟩⟩ + +theorem groundEligibleTask_cap_mem {i : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) : + eligibleTaskCap P T i ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchCarrier := + pair_mem_taggedExtension.2 (M.groundEligibleTask_cap_fresh group action meet hT greatest hi) + +omit group action in +theorem groundEligibleTask_cap_shadow {i c : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) + (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + ZFSet.pair (ZFSet.pair i T) c ∈ batchAttachmentShadowGraph I P + (constantFamilyGraph I P) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by + obtain ⟨a, ha, b, hb, base, hbase, s, hs, F, hF, label, hl, rfl, code⟩ := + (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi + obtain rfl := ((literalTaskFieldGraph_entry_iff ha hb hbase hs hF hl 1).1 target).2 + have topMeet : ZFSet.pair (ZFSet.pair T a) a ∈ μ := meet.pair_iff.2 + ⟨hT, ha, ha, greatest a ha, meet.order.refl a ha, + fun _ _ _ lower => lower⟩ + obtain ⟨g, _, represented⟩ := code.representative + have baseEntry := (represented.entries a ha c hb).2 + ⟨meet.order.refl a ha, represented.target_entry⟩ + exact (literalTask_shadow_iff ha hb hbase hs hF hl).2 + ⟨hi, (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2 + ⟨hT, hb, a, ha, topMeet, baseEntry⟩⟩ + +theorem groundEligibleTask_negative_cap {i c F v w : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) + (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (hv : v ∈ P) (negative : v ∉ F) + (entry : ZFSet.pair (ZFSet.pair (eligibleTaskCap P T i) v) w ∈ + (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchMeetGraph) : + ZFSet.pair (ZFSet.pair c v) w ∈ μ ∧ ZFSet.pair w c ∈ r ∧ + ZFSet.pair w c ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchOrder := by + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let j : {i : ZFSet.{u} // i ∈ M.groundEligibleTasks P G r μ A Labels} := ⟨i, hi⟩ + have fresh := M.groundEligibleTask_cap_fresh group action meet hT greatest hi + have freshT : T ∈ freshPart (d.space j) (d.rel j) (d.anchor j) := + (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors + (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh + have shadow := M.groundEligibleTask_cap_shadow meet hT greatest hi target + have hc := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 shadow)).2 + have filterEq : d.filter j = F := (d.filters.unique filter (d.filter_entry j)).symm + have notAbove : ZFSet.pair (eligibleTaskCap P T i) v ∉ d.batchOrder := by + intro lower + have positive := (d.batch_old_upper_iff j freshT hv).1 lower + exact negative (filterEq ▸ positive) + obtain ⟨z, oldMeet, _⟩ := meet.operation.2 (ZFSet.pair c v) + (ZFSet.pair_mem_prod.2 ⟨hc, hv⟩) + have newMeet := d.batch_shadow_meet_code j freshT hv shadow oldMeet notAbove + obtain ⟨_, _, unique⟩ := d.batch_meetOrder.operation.2 + (ZFSet.pair (eligibleTaskCap P T i) v) + (ZFSet.pair_mem_prod.2 ⟨M.groundEligibleTask_cap_mem group action meet hT greatest hi, + old_mem_taggedExtension hv⟩) + have equal : w = z := (unique w entry).trans (unique z newMeet).symm + have oldW : ZFSet.pair (ZFSet.pair c v) w ∈ μ := equal.symm ▸ oldMeet + have lower := meet.lower_left c v w oldW + have hw := (ZFSet.pair_mem_prod.1 (meet.operation.1 oldW)).2 + exact ⟨oldW, lower, (d.coding.le_encode (.inl ⟨w, hw⟩) (.inl ⟨c, hc⟩)).2 lower⟩ + +end TransitiveGround + + + + + + +noncomputable def initialCapGraph (I L T representation : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ k ∈ L, z = ZFSet.pair i k ∧ + ZFSet.pair (ZFSet.pair i T) k ∈ representation) (ZFSet.prod I L) + +theorem mem_initialCapGraph (I L T representation z : ZFSet.{u}) : + z ∈ initialCapGraph I L T representation ↔ + ∃ i ∈ I, ∃ k ∈ L, z = ZFSet.pair i k ∧ + ZFSet.pair (ZFSet.pair i T) k ∈ representation := by + constructor + · exact fun hz => (ZFSet.mem_sep.1 hz).2 + · rintro ⟨i, hi, k, hk, rfl, entry⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hk⟩, i, hi, k, hk, rfl, entry⟩ + +theorem pair_mem_initialCapGraph (I L T representation i k : ZFSet.{u}) : + ZFSet.pair i k ∈ initialCapGraph I L T representation ↔ + i ∈ I ∧ k ∈ L ∧ ZFSet.pair (ZFSet.pair i T) k ∈ representation := by + rw [mem_initialCapGraph] + constructor + · rintro ⟨j, hj, z, hz, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, hz, entry⟩ + · rintro ⟨hi, hk, entry⟩ + exact ⟨i, hi, k, hk, rfl, entry⟩ + +theorem initialCapGraph_function {I L T representation domain : ZFSet.{u}} + (function : ZFSet.IsFunc domain L representation) + (covers : ∀ i ∈ I, ZFSet.pair i T ∈ domain) : + ZFSet.IsFunc I L (initialCapGraph I L T representation) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro i hi + obtain ⟨k, entry, unique⟩ := function.2 (ZFSet.pair i T) (covers i hi) + have hk := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + refine ⟨k, (pair_mem_initialCapGraph _ _ _ _ _ _).2 ⟨hi, hk, entry⟩, ?_⟩ + intro z hz + exact unique z ((pair_mem_initialCapGraph _ _ _ _ _ _).1 hz).2.2 + +namespace BoundedFormula + +open SetFormula + +def initialCapEntryFormula {n} (z I L T representation : Fin n) : BoundedFormula n := + exMem I (exMem L.succ + (.conj (orderedPairFormula z.succ.succ 1 0) + (tripleMembershipFormula 1 T.succ.succ 0 representation.succ.succ))) + +theorem truth_initialCapEntryFormula {n} (z I L T representation : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (initialCapEntryFormula z I L T representation) env ↔ + env z ∈ initialCapGraph (env I) (env L) (env T) (env representation) := by + simp only [initialCapEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_tripleMembershipFormula, mem_initialCapGraph] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem initialCapGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I L T representation : ZFSet.{u}} + (hI : I ∈ M.sets) (hL : L ∈ M.sets) (hT : T ∈ M.sets) + (hRepresentation : representation ∈ M.sets) : + initialCapGraph I L T representation ∈ M.sets := by + let params := extend I (extend L (extend T (extend representation Fin.elim0))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hI (Fin.cases hL (Fin.cases hT (Fin.cases hRepresentation (fun i => Fin.elim0 i)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.initialCapEntryFormula 0 1 2 3 4) params members + (M.prod_mem pairing unions powers separation hI hL) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.initialCapEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod I L) = initialCapGraph I L T representation := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_initialCapEntryFormula] + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact equal ▸ selected + +noncomputable def groundEligibleTaskCaps (P G r μ A Labels T : ZFSet.{u}) : ZFSet.{u} := + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Qs := constantFamilyGraph I P + let rs := constantFamilyGraph I r + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + initialCapGraph I (taggedExtension P (indexedAttachmentFresh I Qs rs As)) T + (batchAttachmentTemplateGraph I P Qs rs As Es) + +theorem groundEligibleTaskCaps_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one T : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hT : T ∈ P) + (greatest : ∀ x ∈ P, ZFSet.pair x T ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + M.groundEligibleTaskCaps P G r μ A Labels T ∈ M.sets ∧ + ZFSet.IsFunc I d.batchCarrier (M.groundEligibleTaskCaps P G r μ A Labels T) ∧ + (∀ i k, ZFSet.pair i k ∈ M.groundEligibleTaskCaps P G r μ A Labels T ↔ + i ∈ I ∧ k = eligibleTaskCap P T i) := by + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨hL, _, _, _, hRepresentation, _⟩ := M.groundEligibleTaskAttachment + pairing unions powers separation hP hG hr hμ hA hLabels group action meet + have graphMem := M.initialCapGraph_mem pairing unions powers separation + hI hL (M.transitive hP hT) hRepresentation + have function : ZFSet.IsFunc I d.batchCarrier (M.groundEligibleTaskCaps P G r μ A Labels T) := by + apply initialCapGraph_function d.batch_template_function + intro i hi + exact indexedAttachmentFresh_subset _ _ _ _ + (M.groundEligibleTask_cap_fresh group action meet hT greatest hi) + refine ⟨graphMem, function, ?_⟩ + intro i k + change ZFSet.pair i k ∈ initialCapGraph _ _ _ _ ↔ _ + rw [pair_mem_initialCapGraph] + constructor + · rintro ⟨hi, _, entry⟩ + have capEntry := M.groundEligibleTask_cap_entry group action meet hT greatest hi + have domain := (ZFSet.pair_mem_prod.1 (d.batch_template_function.1 entry)).1 + obtain ⟨_, _, unique⟩ := d.batch_template_function.2 (ZFSet.pair i T) domain + exact ⟨hi, (unique k entry).trans (unique _ capEntry).symm⟩ + · rintro ⟨hi, rfl⟩ + exact ⟨hi, M.groundEligibleTask_cap_mem group action meet hT greatest hi, + M.groundEligibleTask_cap_entry group action meet hT greatest hi⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEqualityStep.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEqualityStep.lean index f9ca0bfcefe30e9acc45eb2d6d9c10c1acd5c193..b1b6257138e42e14d174a144bbd98be14e07d467 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEqualityStep.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundEqualityStep.lean @@ -1,101 +1,101 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.EqualityStepSyntax - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_matchingDirection (D : Name.NameDomain s) - (R : P → Name s → Name s → Prop) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) - (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (meaning : M.RelationMeaning s D R E (fun j => env (params j))) - (p : P) (σ τ : D.names) (hp : env pi = s.encode p) - (hσ : env si = σ.val.val) (hτ : env ti = τ.val.val) : - Realize M.sets (matchingDirectionFormula E c o params pi si ti) env ↔ - ∀ ρ r, Name.Entry ρ σ.val r → ∀ q, q ≤ p → q ≤ r → - Name.RelationMembership R q ρ τ.val := by - have hσM : env si ∈ M.sets := hσ ▸ ground σ.val σ.property - change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ - constructor - · intro h ρ r entry q qp qr - have hρ := D.children σ.property entry - have first := (M.realize_allConditions s (params c).succ _ - (extend ρ.val env) carrier hc).1 (h ρ.val (ground ρ hρ)) r - have raw : ZFSet.pair ρ.val (s.encode r) ∈ env si := hσ ▸ entry - have guard := (M.realize_pairMembershipFormula pairing 1 0 si.succ.succ - (extend (s.encode r) (extend ρ.val env)) - (ground ρ hρ) (M.transitive carrier (s.encode_mem r)) hσM).2 raw - have second := (realize_imp M.sets _ _ _).1 first guard - have third := (M.realize_allConditions s (params c).succ.succ _ - (extend (s.encode r) (extend ρ.val env)) carrier hc).1 second q - let e := extend (s.encode q) (extend (s.encode r) (extend ρ.val env)) - have body := (realize_imp M.sets _ _ e).1 third - ⟨(M.realize_conditionLE s pairing carrier order 0 pi.succ.succ.succ - (params o).succ.succ.succ e q p rfl hp ho).2 qp, - (M.realize_conditionLE s pairing carrier order 0 1 - (params o).succ.succ.succ e q r rfl rfl ho).2 qr⟩ - exact (M.realize_relationMembership s D R ground pairing carrier order E c o - (fun j => (params j).succ.succ.succ) 0 2 ti.succ.succ.succ e hc ho meaning - q ⟨ρ, hρ⟩ τ rfl rfl hτ).1 body - · intro h v hv - apply (M.realize_allConditions s (params c).succ _ (extend v env) carrier hc).2 - intro r - apply (realize_imp M.sets _ _ _).2 - intro guard - have raw := (M.realize_pairMembershipFormula pairing 1 0 si.succ.succ - (extend (s.encode r) (extend v env)) hv (M.transitive carrier (s.encode_mem r)) hσM).1 guard - change ZFSet.pair v (s.encode r) ∈ env si at raw - rw [hσ] at raw - let ρ : Name s := ⟨v, Name.isName_of_pair_mem σ.val v r raw⟩ - have hρ : ρ ∈ D.names := D.children σ.property raw - apply (M.realize_allConditions s (params c).succ.succ _ - (extend (s.encode r) (extend v env)) carrier hc).2 - intro q - let e := extend (s.encode q) (extend (s.encode r) (extend v env)) - apply (realize_imp M.sets _ _ e).2 - rintro ⟨qp, qr⟩ - apply (M.realize_relationMembership s D R ground pairing carrier order E c o - (fun j => (params j).succ.succ.succ) 0 2 ti.succ.succ.succ e hc ho meaning - q ⟨ρ, hρ⟩ τ rfl rfl hτ).2 - exact h ρ r raw q - ((M.realize_conditionLE s pairing carrier order 0 pi.succ.succ.succ - (params o).succ.succ.succ e q p rfl hp ho).1 qp) - ((M.realize_conditionLE s pairing carrier order 0 1 - (params o).succ.succ.succ e q r rfl rfl ho).1 qr) - -theorem realize_equalityStep (D : Name.NameDomain s) - (R : P → Name s → Name s → Prop) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) - (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (meaning : M.RelationMeaning s D R E (fun j => env (params j))) - (p : P) (σ τ : D.names) (hp : env pi = s.encode p) - (hσ : env si = σ.val.val) (hτ : env ti = τ.val.val) : - Realize M.sets (equalityStepFormula E c o params pi si ti) env ↔ - Name.EqualityStep R p σ.val τ.val := by - change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ - rw [M.realize_matchingDirection s D R ground pairing carrier order E c o params pi si ti - env hc ho meaning p σ τ hp hσ hτ, - M.realize_matchingDirection s D (fun t ρ ν => R t ν ρ) ground pairing carrier order - (swapEquality E) c o params pi ti si env hc ho - (M.relationMeaning_swap s D R E _ meaning) p τ σ hp hτ hσ] - exact (Name.equalityStep_dense R p σ.val τ.val).symm - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.EqualityStepSyntax + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_matchingDirection (D : Name.NameDomain s) + (R : P → Name s → Name s → Prop) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) + (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (meaning : M.RelationMeaning s D R E (fun j => env (params j))) + (p : P) (σ τ : D.names) (hp : env pi = s.encode p) + (hσ : env si = σ.val.val) (hτ : env ti = τ.val.val) : + Realize M.sets (matchingDirectionFormula E c o params pi si ti) env ↔ + ∀ ρ r, Name.Entry ρ σ.val r → ∀ q, q ≤ p → q ≤ r → + Name.RelationMembership R q ρ τ.val := by + have hσM : env si ∈ M.sets := hσ ▸ ground σ.val σ.property + change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ + constructor + · intro h ρ r entry q qp qr + have hρ := D.children σ.property entry + have first := (M.realize_allConditions s (params c).succ _ + (extend ρ.val env) carrier hc).1 (h ρ.val (ground ρ hρ)) r + have raw : ZFSet.pair ρ.val (s.encode r) ∈ env si := hσ ▸ entry + have guard := (M.realize_pairMembershipFormula pairing 1 0 si.succ.succ + (extend (s.encode r) (extend ρ.val env)) + (ground ρ hρ) (M.transitive carrier (s.encode_mem r)) hσM).2 raw + have second := (realize_imp M.sets _ _ _).1 first guard + have third := (M.realize_allConditions s (params c).succ.succ _ + (extend (s.encode r) (extend ρ.val env)) carrier hc).1 second q + let e := extend (s.encode q) (extend (s.encode r) (extend ρ.val env)) + have body := (realize_imp M.sets _ _ e).1 third + ⟨(M.realize_conditionLE s pairing carrier order 0 pi.succ.succ.succ + (params o).succ.succ.succ e q p rfl hp ho).2 qp, + (M.realize_conditionLE s pairing carrier order 0 1 + (params o).succ.succ.succ e q r rfl rfl ho).2 qr⟩ + exact (M.realize_relationMembership s D R ground pairing carrier order E c o + (fun j => (params j).succ.succ.succ) 0 2 ti.succ.succ.succ e hc ho meaning + q ⟨ρ, hρ⟩ τ rfl rfl hτ).1 body + · intro h v hv + apply (M.realize_allConditions s (params c).succ _ (extend v env) carrier hc).2 + intro r + apply (realize_imp M.sets _ _ _).2 + intro guard + have raw := (M.realize_pairMembershipFormula pairing 1 0 si.succ.succ + (extend (s.encode r) (extend v env)) hv (M.transitive carrier (s.encode_mem r)) hσM).1 guard + change ZFSet.pair v (s.encode r) ∈ env si at raw + rw [hσ] at raw + let ρ : Name s := ⟨v, Name.isName_of_pair_mem σ.val v r raw⟩ + have hρ : ρ ∈ D.names := D.children σ.property raw + apply (M.realize_allConditions s (params c).succ.succ _ + (extend (s.encode r) (extend v env)) carrier hc).2 + intro q + let e := extend (s.encode q) (extend (s.encode r) (extend v env)) + apply (realize_imp M.sets _ _ e).2 + rintro ⟨qp, qr⟩ + apply (M.realize_relationMembership s D R ground pairing carrier order E c o + (fun j => (params j).succ.succ.succ) 0 2 ti.succ.succ.succ e hc ho meaning + q ⟨ρ, hρ⟩ τ rfl rfl hτ).2 + exact h ρ r raw q + ((M.realize_conditionLE s pairing carrier order 0 pi.succ.succ.succ + (params o).succ.succ.succ e q p rfl hp ho).1 qp) + ((M.realize_conditionLE s pairing carrier order 0 1 + (params o).succ.succ.succ e q r rfl rfl ho).1 qr) + +theorem realize_equalityStep (D : Name.NameDomain s) + (R : P → Name s → Name s → Prop) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) + (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (meaning : M.RelationMeaning s D R E (fun j => env (params j))) + (p : P) (σ τ : D.names) (hp : env pi = s.encode p) + (hσ : env si = σ.val.val) (hτ : env ti = τ.val.val) : + Realize M.sets (equalityStepFormula E c o params pi si ti) env ↔ + Name.EqualityStep R p σ.val τ.val := by + change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ + rw [M.realize_matchingDirection s D R ground pairing carrier order E c o params pi si ti + env hc ho meaning p σ τ hp hσ hτ, + M.realize_matchingDirection s D (fun t ρ ν => R t ν ρ) ground pairing carrier order + (swapEquality E) c o params pi ti si env hc ho + (M.relationMeaning_swap s D R E _ meaning) p τ σ hp hτ hσ] + exact (Name.equalityStep_dense R p σ.val τ.val).symm + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalAlphabetInversion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalAlphabetInversion.lean index c26a38594245a9a42345085572b13a3586e05fd6..20981d7b4c644b0c42c3ce40b0f8bc18622620fe 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalAlphabetInversion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalAlphabetInversion.lean @@ -1,208 +1,208 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -def externalSymbolInverse {J L : Type u} [Inv J] : J ⊕ (L × Bool) → J ⊕ (L × Bool) - | .inl g => .inl g⁻¹ - | .inr p => .inr (p.1, !p.2) - -theorem externalSymbolInverse_involutive {J L : Type u} [InvolutiveInv J] : - Function.Involutive (externalSymbolInverse : J ⊕ (L × Bool) → J ⊕ (L × Bool)) := by - intro x - cases x with - | inl g => simp only [externalSymbolInverse, inv_inv] - | inr p => simp only [externalSymbolInverse, Bool.not_not] - -def ExternalSymbolInverseEntry (G S inv x y : ZFSet.{u}) : Prop := - (∃ g ∈ G, ∃ h ∈ G, x = externalActorSymbol g ∧ y = externalActorSymbol h ∧ - ZFSet.pair g h ∈ inv) ∨ - ∃ s ∈ S, ∃ b : Bool, x = externalLetterSymbol s b ∧ y = externalLetterSymbol s (!b) - -noncomputable def externalSymbolInverseGraph (G S inv : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ externalGeneratorAlphabet G S, - ∃ y ∈ externalGeneratorAlphabet G S, z = ZFSet.pair x y ∧ - ExternalSymbolInverseEntry G S inv x y) - (ZFSet.prod (externalGeneratorAlphabet G S) (externalGeneratorAlphabet G S)) - -theorem pair_mem_externalSymbolInverseGraph (G S inv x y : ZFSet.{u}) : - ZFSet.pair x y ∈ externalSymbolInverseGraph G S inv ↔ - ExternalSymbolInverseEntry G S inv x y := by - constructor - · intro h - obtain ⟨_, x', _, y', _, eq, entry⟩ := ZFSet.mem_sep.1 h - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact entry - · intro entry - have bounds : x ∈ externalGeneratorAlphabet G S ∧ y ∈ externalGeneratorAlphabet G S := by - rcases entry with ⟨g, hg, h, hh, rfl, rfl, _⟩ | ⟨s, hs, b, rfl, rfl⟩ - · exact ⟨(externalActorSymbol_mem G S g).2 hg, (externalActorSymbol_mem G S h).2 hh⟩ - · exact ⟨(externalLetterSymbol_mem G S s b).2 hs, - (externalLetterSymbol_mem G S s (!b)).2 hs⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 bounds, - x, bounds.1, y, bounds.2, rfl, entry⟩ - -theorem externalSymbolInverseGraph_eq_graph {J L : Type u} [Inv J] - (s : Presentation J) (t : Presentation L) : - externalSymbolInverseGraph s.carrier t.carrier (s.graph s Inv.inv) = - (externalGeneratorAlphabetPresentation s t).graph - (externalGeneratorAlphabetPresentation s t) externalSymbolInverse := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro hz - obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - rcases (pair_mem_externalSymbolInverseGraph _ _ _ x y).1 hz with - ⟨g, hg, h, hh, rfl, rfl, entry⟩ | ⟨a, ha, b, rfl, rfl⟩ - · obtain ⟨g, rfl⟩ := (s.mem_carrier g).1 hg - obtain ⟨h, rfl⟩ := (s.mem_carrier h).1 hh - have eq := (s.pair_mem_graph s Inv.inv g h).1 entry - subst h - exact ⟨.inl g, rfl⟩ - · obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha - exact ⟨.inr (a, b), rfl⟩ - · rintro ⟨x, rfl⟩ - apply (pair_mem_externalSymbolInverseGraph _ _ _ _ _).2 - cases x with - | inl g => - exact Or.inl ⟨s.encode g, s.encode_mem g, s.encode g⁻¹, s.encode_mem g⁻¹, - rfl, rfl, (s.pair_mem_graph s Inv.inv g g⁻¹).2 rfl⟩ - | inr p => exact Or.inr ⟨t.encode p.1, t.encode_mem p.1, p.2, rfl, rfl⟩ - -theorem externalSymbolInverseGraph_entry_iff {J L : Type u} [Inv J] - (s : Presentation J) (t : Presentation L) (x y : J ⊕ (L × Bool)) : - ZFSet.pair (externalAlphabetEncode s t x) (externalAlphabetEncode s t y) ∈ - externalSymbolInverseGraph s.carrier t.carrier (s.graph s Inv.inv) ↔ - externalSymbolInverse x = y := by - rw [externalSymbolInverseGraph_eq_graph] - exact (externalGeneratorAlphabetPresentation s t).pair_mem_graph _ _ x y - -theorem externalSymbolInverseGraph_function {J L : Type u} [Inv J] - (s : Presentation J) (t : Presentation L) : - ZFSet.IsFunc (externalGeneratorAlphabet s.carrier t.carrier) - (externalGeneratorAlphabet s.carrier t.carrier) - (externalSymbolInverseGraph s.carrier t.carrier (s.graph s Inv.inv)) := by - rw [externalSymbolInverseGraph_eq_graph] - exact (externalGeneratorAlphabetPresentation s t).graph_isFunc _ _ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -open SetFormula -universe u - -namespace BoundedFormula - -def externalSymbolInverseFormula {n} (x y G S inv zero one : Fin n) : BoundedFormula n := - disj - (exMem G (exMem G.succ - (.conj (orderedPairFormula x.succ.succ zero.succ.succ 1) - (.conj (orderedPairFormula y.succ.succ zero.succ.succ 0) - (pairMembershipFormula 1 0 inv.succ.succ))))) - (exMem S (disj - (.conj (orderedRightTripleFormula x.succ one.succ 0 zero.succ) - (orderedRightTripleFormula y.succ one.succ 0 one.succ)) - (.conj (orderedRightTripleFormula x.succ one.succ 0 one.succ) - (orderedRightTripleFormula y.succ one.succ 0 zero.succ)))) - -theorem truth_externalSymbolInverseFormula {n} (x y G S inv zero one : Fin n) - (env : Fin n → ZFSet.{u}) (hZero : env zero = natSetCode 0) - (hOne : env one = natSetCode 1) : - Truth (externalSymbolInverseFormula x y G S inv zero one) env ↔ - ExternalSymbolInverseEntry (env G) (env S) (env inv) (env x) (env y) := by - simp only [externalSymbolInverseFormula, truth_disj, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, truth_orderedRightTripleFormula] - change ((∃ g ∈ env G, ∃ h ∈ env G, - env x = ZFSet.pair (env zero) g ∧ env y = ZFSet.pair (env zero) h ∧ - ZFSet.pair g h ∈ env inv) ∨ ∃ s ∈ env S, - (env x = ZFSet.pair (env one) (ZFSet.pair s (env zero)) ∧ - env y = ZFSet.pair (env one) (ZFSet.pair s (env one))) ∨ - (env x = ZFSet.pair (env one) (ZFSet.pair s (env one)) ∧ - env y = ZFSet.pair (env one) (ZFSet.pair s (env zero)))) ↔ _ - rw [hZero, hOne] - apply or_congr Iff.rfl - constructor - · rintro ⟨s, hs, h | h⟩ - · exact ⟨s, hs, false, h⟩ - · exact ⟨s, hs, true, h⟩ - · rintro ⟨s, hs, b, h⟩ - cases b with - | false => exact ⟨s, hs, Or.inl h⟩ - | true => exact ⟨s, hs, Or.inr h⟩ - -def externalSymbolInverseEntryFormula {n} (z alphabet G S inv zero one : Fin n) : - BoundedFormula n := - exMem alphabet (exMem alphabet.succ - (.conj (orderedPairFormula z.succ.succ 1 0) - (externalSymbolInverseFormula 1 0 G.succ.succ S.succ.succ inv.succ.succ - zero.succ.succ one.succ.succ))) - -theorem truth_externalSymbolInverseEntryFormula {n} - (z alphabet G S inv zero one : Fin n) (env : Fin n → ZFSet.{u}) - (hZero : env zero = natSetCode 0) (hOne : env one = natSetCode 1) : - Truth (externalSymbolInverseEntryFormula z alphabet G S inv zero one) env ↔ - ∃ x ∈ env alphabet, ∃ y ∈ env alphabet, - env z = ZFSet.pair x y ∧ ExternalSymbolInverseEntry (env G) (env S) (env inv) x y := by - simp only [externalSymbolInverseEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - apply exists_congr - intro x - apply and_congr_right - intro _ - apply exists_congr - intro y - apply and_congr_right - intro _ - exact and_congr Iff.rfl - (truth_externalSymbolInverseFormula 1 0 G.succ.succ S.succ.succ inv.succ.succ - zero.succ.succ one.succ.succ _ hZero hOne) - -end BoundedFormula - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem externalSymbolInverseGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G S inv : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hInv : inv ∈ M.sets) : - externalSymbolInverseGraph G S inv ∈ M.sets := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ - have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero - let params := extend (externalGeneratorAlphabet G S) (extend G (extend S (extend inv - (extend (natSetCode 0) (extend (natSetCode 1) Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalSymbolInverseEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hAlphabet (Fin.cases hG (Fin.cases hS (Fin.cases hInv - (Fin.cases hZero (Fin.cases hOne (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hAlphabet hAlphabet) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.externalSymbolInverseEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod (externalGeneratorAlphabet G S) (externalGeneratorAlphabet G S)) = - externalSymbolInverseGraph G S inv := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, externalSymbolInverseGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_externalSymbolInverseEntryFormula 0 1 2 3 4 5 6 _ rfl rfl) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +def externalSymbolInverse {J L : Type u} [Inv J] : J ⊕ (L × Bool) → J ⊕ (L × Bool) + | .inl g => .inl g⁻¹ + | .inr p => .inr (p.1, !p.2) + +theorem externalSymbolInverse_involutive {J L : Type u} [InvolutiveInv J] : + Function.Involutive (externalSymbolInverse : J ⊕ (L × Bool) → J ⊕ (L × Bool)) := by + intro x + cases x with + | inl g => simp only [externalSymbolInverse, inv_inv] + | inr p => simp only [externalSymbolInverse, Bool.not_not] + +def ExternalSymbolInverseEntry (G S inv x y : ZFSet.{u}) : Prop := + (∃ g ∈ G, ∃ h ∈ G, x = externalActorSymbol g ∧ y = externalActorSymbol h ∧ + ZFSet.pair g h ∈ inv) ∨ + ∃ s ∈ S, ∃ b : Bool, x = externalLetterSymbol s b ∧ y = externalLetterSymbol s (!b) + +noncomputable def externalSymbolInverseGraph (G S inv : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ externalGeneratorAlphabet G S, + ∃ y ∈ externalGeneratorAlphabet G S, z = ZFSet.pair x y ∧ + ExternalSymbolInverseEntry G S inv x y) + (ZFSet.prod (externalGeneratorAlphabet G S) (externalGeneratorAlphabet G S)) + +theorem pair_mem_externalSymbolInverseGraph (G S inv x y : ZFSet.{u}) : + ZFSet.pair x y ∈ externalSymbolInverseGraph G S inv ↔ + ExternalSymbolInverseEntry G S inv x y := by + constructor + · intro h + obtain ⟨_, x', _, y', _, eq, entry⟩ := ZFSet.mem_sep.1 h + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact entry + · intro entry + have bounds : x ∈ externalGeneratorAlphabet G S ∧ y ∈ externalGeneratorAlphabet G S := by + rcases entry with ⟨g, hg, h, hh, rfl, rfl, _⟩ | ⟨s, hs, b, rfl, rfl⟩ + · exact ⟨(externalActorSymbol_mem G S g).2 hg, (externalActorSymbol_mem G S h).2 hh⟩ + · exact ⟨(externalLetterSymbol_mem G S s b).2 hs, + (externalLetterSymbol_mem G S s (!b)).2 hs⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 bounds, + x, bounds.1, y, bounds.2, rfl, entry⟩ + +theorem externalSymbolInverseGraph_eq_graph {J L : Type u} [Inv J] + (s : Presentation J) (t : Presentation L) : + externalSymbolInverseGraph s.carrier t.carrier (s.graph s Inv.inv) = + (externalGeneratorAlphabetPresentation s t).graph + (externalGeneratorAlphabetPresentation s t) externalSymbolInverse := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro hz + obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + rcases (pair_mem_externalSymbolInverseGraph _ _ _ x y).1 hz with + ⟨g, hg, h, hh, rfl, rfl, entry⟩ | ⟨a, ha, b, rfl, rfl⟩ + · obtain ⟨g, rfl⟩ := (s.mem_carrier g).1 hg + obtain ⟨h, rfl⟩ := (s.mem_carrier h).1 hh + have eq := (s.pair_mem_graph s Inv.inv g h).1 entry + subst h + exact ⟨.inl g, rfl⟩ + · obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha + exact ⟨.inr (a, b), rfl⟩ + · rintro ⟨x, rfl⟩ + apply (pair_mem_externalSymbolInverseGraph _ _ _ _ _).2 + cases x with + | inl g => + exact Or.inl ⟨s.encode g, s.encode_mem g, s.encode g⁻¹, s.encode_mem g⁻¹, + rfl, rfl, (s.pair_mem_graph s Inv.inv g g⁻¹).2 rfl⟩ + | inr p => exact Or.inr ⟨t.encode p.1, t.encode_mem p.1, p.2, rfl, rfl⟩ + +theorem externalSymbolInverseGraph_entry_iff {J L : Type u} [Inv J] + (s : Presentation J) (t : Presentation L) (x y : J ⊕ (L × Bool)) : + ZFSet.pair (externalAlphabetEncode s t x) (externalAlphabetEncode s t y) ∈ + externalSymbolInverseGraph s.carrier t.carrier (s.graph s Inv.inv) ↔ + externalSymbolInverse x = y := by + rw [externalSymbolInverseGraph_eq_graph] + exact (externalGeneratorAlphabetPresentation s t).pair_mem_graph _ _ x y + +theorem externalSymbolInverseGraph_function {J L : Type u} [Inv J] + (s : Presentation J) (t : Presentation L) : + ZFSet.IsFunc (externalGeneratorAlphabet s.carrier t.carrier) + (externalGeneratorAlphabet s.carrier t.carrier) + (externalSymbolInverseGraph s.carrier t.carrier (s.graph s Inv.inv)) := by + rw [externalSymbolInverseGraph_eq_graph] + exact (externalGeneratorAlphabetPresentation s t).graph_isFunc _ _ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +open SetFormula +universe u + +namespace BoundedFormula + +def externalSymbolInverseFormula {n} (x y G S inv zero one : Fin n) : BoundedFormula n := + disj + (exMem G (exMem G.succ + (.conj (orderedPairFormula x.succ.succ zero.succ.succ 1) + (.conj (orderedPairFormula y.succ.succ zero.succ.succ 0) + (pairMembershipFormula 1 0 inv.succ.succ))))) + (exMem S (disj + (.conj (orderedRightTripleFormula x.succ one.succ 0 zero.succ) + (orderedRightTripleFormula y.succ one.succ 0 one.succ)) + (.conj (orderedRightTripleFormula x.succ one.succ 0 one.succ) + (orderedRightTripleFormula y.succ one.succ 0 zero.succ)))) + +theorem truth_externalSymbolInverseFormula {n} (x y G S inv zero one : Fin n) + (env : Fin n → ZFSet.{u}) (hZero : env zero = natSetCode 0) + (hOne : env one = natSetCode 1) : + Truth (externalSymbolInverseFormula x y G S inv zero one) env ↔ + ExternalSymbolInverseEntry (env G) (env S) (env inv) (env x) (env y) := by + simp only [externalSymbolInverseFormula, truth_disj, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, truth_orderedRightTripleFormula] + change ((∃ g ∈ env G, ∃ h ∈ env G, + env x = ZFSet.pair (env zero) g ∧ env y = ZFSet.pair (env zero) h ∧ + ZFSet.pair g h ∈ env inv) ∨ ∃ s ∈ env S, + (env x = ZFSet.pair (env one) (ZFSet.pair s (env zero)) ∧ + env y = ZFSet.pair (env one) (ZFSet.pair s (env one))) ∨ + (env x = ZFSet.pair (env one) (ZFSet.pair s (env one)) ∧ + env y = ZFSet.pair (env one) (ZFSet.pair s (env zero)))) ↔ _ + rw [hZero, hOne] + apply or_congr Iff.rfl + constructor + · rintro ⟨s, hs, h | h⟩ + · exact ⟨s, hs, false, h⟩ + · exact ⟨s, hs, true, h⟩ + · rintro ⟨s, hs, b, h⟩ + cases b with + | false => exact ⟨s, hs, Or.inl h⟩ + | true => exact ⟨s, hs, Or.inr h⟩ + +def externalSymbolInverseEntryFormula {n} (z alphabet G S inv zero one : Fin n) : + BoundedFormula n := + exMem alphabet (exMem alphabet.succ + (.conj (orderedPairFormula z.succ.succ 1 0) + (externalSymbolInverseFormula 1 0 G.succ.succ S.succ.succ inv.succ.succ + zero.succ.succ one.succ.succ))) + +theorem truth_externalSymbolInverseEntryFormula {n} + (z alphabet G S inv zero one : Fin n) (env : Fin n → ZFSet.{u}) + (hZero : env zero = natSetCode 0) (hOne : env one = natSetCode 1) : + Truth (externalSymbolInverseEntryFormula z alphabet G S inv zero one) env ↔ + ∃ x ∈ env alphabet, ∃ y ∈ env alphabet, + env z = ZFSet.pair x y ∧ ExternalSymbolInverseEntry (env G) (env S) (env inv) x y := by + simp only [externalSymbolInverseEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + apply exists_congr + intro x + apply and_congr_right + intro _ + apply exists_congr + intro y + apply and_congr_right + intro _ + exact and_congr Iff.rfl + (truth_externalSymbolInverseFormula 1 0 G.succ.succ S.succ.succ inv.succ.succ + zero.succ.succ one.succ.succ _ hZero hOne) + +end BoundedFormula + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem externalSymbolInverseGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G S inv : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hInv : inv ∈ M.sets) : + externalSymbolInverseGraph G S inv ∈ M.sets := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ + have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero + let params := extend (externalGeneratorAlphabet G S) (extend G (extend S (extend inv + (extend (natSetCode 0) (extend (natSetCode 1) Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalSymbolInverseEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hAlphabet (Fin.cases hG (Fin.cases hS (Fin.cases hInv + (Fin.cases hZero (Fin.cases hOne (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hAlphabet hAlphabet) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.externalSymbolInverseEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod (externalGeneratorAlphabet G S) (externalGeneratorAlphabet G S)) = + externalSymbolInverseGraph G S inv := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, externalSymbolInverseGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_externalSymbolInverseEntryFormula 0 1 2 3 4 5 6 _ rfl rfl) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCompressionFieldRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCompressionFieldRecognition.lean index 1a4213ecb65aaaefa52806572b03b1ca4bb4efb2..aeb8fbfd56f34959bae9e3351bcb0de2911270de 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCompressionFieldRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCompressionFieldRecognition.lean @@ -1,99 +1,99 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem mem_externalCompressionField (I V F z : ZFSet.{u}) : - z ∈ externalCompressionField I V F ↔ - ∃ i ∈ I, ∃ y ∈ V, z = ZFSet.pair (ZFSet.pair (natSetCode 0) i) y ∧ - ZFSet.pair i y ∈ F := by - rw [externalCompressionField, mem_relationCompose] - constructor - · rintro ⟨x, _, i, hi, y, hy, equal, projection, entry⟩ - obtain ⟨t, ht, j, _, projected⟩ := (mem_productSecond _ _ _).1 projection - have values := ZFSet.pair_inj.1 projected - have zero : t = natSetCode 0 := ZFSet.mem_singleton.1 ht - exact ⟨i, hi, y, hy, by simpa only [values.1, zero, ← values.2] using equal, entry⟩ - · rintro ⟨i, hi, y, hy, equal, entry⟩ - exact ⟨ZFSet.pair (natSetCode 0) i, - ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hi⟩, i, hi, y, hy, equal, - (mem_productSecond _ _ _).2 ⟨natSetCode 0, ZFSet.mem_singleton.2 rfl, i, hi, rfl⟩, entry⟩ - -namespace BoundedFormula - -def externalCompressionFieldEntryFormula {n} (z I V F zero : Fin n) : BoundedFormula n := - exMem I (exMem V.succ (.conj (orderedTripleFormula z.succ.succ zero.succ.succ 1 0) - (pairMembershipFormula 1 0 F.succ.succ))) - -theorem truth_externalCompressionFieldEntryFormula {n} (z I V F zero : Fin n) - (env : Fin n → ZFSet.{u}) (empty : env zero = natSetCode 0) : - Truth (externalCompressionFieldEntryFormula z I V F zero) env ↔ - env z ∈ externalCompressionField (env I) (env V) (env F) := by - simp only [externalCompressionFieldEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_pairMembershipFormula] - change (∃ i ∈ env I, ∃ y ∈ env V, - env z = ZFSet.pair (ZFSet.pair (env zero) i) y ∧ ZFSet.pair i y ∈ env F) ↔ _ - rw [empty, mem_externalCompressionField] - -end BoundedFormula - -namespace SetFormula - -def externalCompressionFieldFormula {n} (output I V F : Fin n) : SetFormula n := - ex (.conj (BoundedFormula.emptyFormula 0).toFormula - (exactSetFormula output.succ - (BoundedFormula.externalCompressionFieldEntryFormula 0 I.succ.succ V.succ.succ F.succ.succ 1).toFormula)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_externalCompressionFieldFormula {n} (output I V F : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (externalCompressionFieldFormula output I V F) env ↔ - env output = externalCompressionField (env I) (env V) (env F) := by - have meaning (zero : ZFSet.{u}) (hzero : zero ∈ M.sets) (empty : zero = natSetCode 0) : - Realize M.sets (exactSetFormula output.succ - (BoundedFormula.externalCompressionFieldEntryFormula 0 I.succ.succ V.succ.succ F.succ.succ 1).toFormula) - (extend zero env) ↔ env output = externalCompressionField (env I) (env V) (env F) := by - apply M.realize_exactBoundedSetFormula output.succ _ (extend zero env) (Fin.cases hzero members) - (M.externalCompressionField_mem pairing unions powers separation (members I) (members V) (members F)) - intro z - exact BoundedFormula.truth_externalCompressionFieldEntryFormula _ _ _ _ _ _ empty - rw [externalCompressionFieldFormula, realize_ex] - constructor - · rintro ⟨zero, hzero, empty, correct⟩ - have zeroEq : zero = natSetCode 0 := (BoundedFormula.truth_emptyFormula 0 _).1 - ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hzero members)).1 empty) - exact (meaning zero hzero zeroEq).1 correct - · intro equal - have hzero : (natSetCode 0 : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env I, members I⟩ - refine ⟨natSetCode 0, hzero, ?_, (meaning _ hzero rfl).2 equal⟩ - exact (BoundedFormula.realize_toFormula M _ _ (Fin.cases hzero members)).2 - ((BoundedFormula.truth_emptyFormula 0 _).2 rfl) - -noncomputable def definable_externalCompressionField : GroundDefinableFunction M - (fun env : Fin 3 → ZFSet.{u} => externalCompressionField (env 0) (env 1) (env 2)) where - formula := externalCompressionFieldFormula 0 1 2 3 - closed := fun _ members => M.externalCompressionField_mem pairing unions powers separation - (members 0) (members 1) (members 2) - correct := fun env members z hz => M.realize_externalCompressionFieldFormula - pairing unions powers separation 0 1 2 3 (extend z env) (Fin.cases hz members) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem mem_externalCompressionField (I V F z : ZFSet.{u}) : + z ∈ externalCompressionField I V F ↔ + ∃ i ∈ I, ∃ y ∈ V, z = ZFSet.pair (ZFSet.pair (natSetCode 0) i) y ∧ + ZFSet.pair i y ∈ F := by + rw [externalCompressionField, mem_relationCompose] + constructor + · rintro ⟨x, _, i, hi, y, hy, equal, projection, entry⟩ + obtain ⟨t, ht, j, _, projected⟩ := (mem_productSecond _ _ _).1 projection + have values := ZFSet.pair_inj.1 projected + have zero : t = natSetCode 0 := ZFSet.mem_singleton.1 ht + exact ⟨i, hi, y, hy, by simpa only [values.1, zero, ← values.2] using equal, entry⟩ + · rintro ⟨i, hi, y, hy, equal, entry⟩ + exact ⟨ZFSet.pair (natSetCode 0) i, + ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hi⟩, i, hi, y, hy, equal, + (mem_productSecond _ _ _).2 ⟨natSetCode 0, ZFSet.mem_singleton.2 rfl, i, hi, rfl⟩, entry⟩ + +namespace BoundedFormula + +def externalCompressionFieldEntryFormula {n} (z I V F zero : Fin n) : BoundedFormula n := + exMem I (exMem V.succ (.conj (orderedTripleFormula z.succ.succ zero.succ.succ 1 0) + (pairMembershipFormula 1 0 F.succ.succ))) + +theorem truth_externalCompressionFieldEntryFormula {n} (z I V F zero : Fin n) + (env : Fin n → ZFSet.{u}) (empty : env zero = natSetCode 0) : + Truth (externalCompressionFieldEntryFormula z I V F zero) env ↔ + env z ∈ externalCompressionField (env I) (env V) (env F) := by + simp only [externalCompressionFieldEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_pairMembershipFormula] + change (∃ i ∈ env I, ∃ y ∈ env V, + env z = ZFSet.pair (ZFSet.pair (env zero) i) y ∧ ZFSet.pair i y ∈ env F) ↔ _ + rw [empty, mem_externalCompressionField] + +end BoundedFormula + +namespace SetFormula + +def externalCompressionFieldFormula {n} (output I V F : Fin n) : SetFormula n := + ex (.conj (BoundedFormula.emptyFormula 0).toFormula + (exactSetFormula output.succ + (BoundedFormula.externalCompressionFieldEntryFormula 0 I.succ.succ V.succ.succ F.succ.succ 1).toFormula)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_externalCompressionFieldFormula {n} (output I V F : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (externalCompressionFieldFormula output I V F) env ↔ + env output = externalCompressionField (env I) (env V) (env F) := by + have meaning (zero : ZFSet.{u}) (hzero : zero ∈ M.sets) (empty : zero = natSetCode 0) : + Realize M.sets (exactSetFormula output.succ + (BoundedFormula.externalCompressionFieldEntryFormula 0 I.succ.succ V.succ.succ F.succ.succ 1).toFormula) + (extend zero env) ↔ env output = externalCompressionField (env I) (env V) (env F) := by + apply M.realize_exactBoundedSetFormula output.succ _ (extend zero env) (Fin.cases hzero members) + (M.externalCompressionField_mem pairing unions powers separation (members I) (members V) (members F)) + intro z + exact BoundedFormula.truth_externalCompressionFieldEntryFormula _ _ _ _ _ _ empty + rw [externalCompressionFieldFormula, realize_ex] + constructor + · rintro ⟨zero, hzero, empty, correct⟩ + have zeroEq : zero = natSetCode 0 := (BoundedFormula.truth_emptyFormula 0 _).1 + ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hzero members)).1 empty) + exact (meaning zero hzero zeroEq).1 correct + · intro equal + have hzero : (natSetCode 0 : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env I, members I⟩ + refine ⟨natSetCode 0, hzero, ?_, (meaning _ hzero rfl).2 equal⟩ + exact (BoundedFormula.realize_toFormula M _ _ (Fin.cases hzero members)).2 + ((BoundedFormula.truth_emptyFormula 0 _).2 rfl) + +noncomputable def definable_externalCompressionField : GroundDefinableFunction M + (fun env : Fin 3 → ZFSet.{u} => externalCompressionField (env 0) (env 1) (env 2)) where + formula := externalCompressionFieldFormula 0 1 2 3 + closed := fun _ members => M.externalCompressionField_mem pairing unions powers separation + (members 0) (members 1) (members 2) + correct := fun env members z hz => M.realize_externalCompressionFieldFormula + pairing unions powers separation 0 1 2 3 (extend z env) (Fin.cases hz members) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffCoherence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffCoherence.lean index 159e3744d7d8ff1454315dadf99ef036673f4994..3eb6aee7b9c0db62675611bc93701447e88ddf69 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffCoherence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffCoherence.lean @@ -1,123 +1,123 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem heightOrderRestriction_restrict {Q L r : ZFSet.{u}} (subset : Q ⊆ L) : - heightOrderRestriction Q (heightOrderRestriction L r) = heightOrderRestriction Q r := by - apply ZFSet.ext - intro z - simp only [heightOrderRestriction, ZFSet.mem_sep] - constructor - · rintro ⟨⟨entry, _⟩, small⟩ - exact ⟨entry, small⟩ - · rintro ⟨entry, small⟩ - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 small - exact ⟨⟨entry, ZFSet.pair_mem_prod.2 ⟨subset hx, subset hy⟩⟩, - ZFSet.pair_mem_prod.2 ⟨hx, hy⟩⟩ - -namespace GroundExternalBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "r" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 - -theorem cutoff_order_restriction {n k : Nat} (before : n ≤ k) : - heightOrderRestriction (births.cutoff n) (births.cutoffOrder k) = births.cutoffOrder n := - heightOrderRestriction_restrict (births.cutoff_mono before) - -theorem cutoff_meet_restriction {n k : Nat} (before : n ≤ k) : - graphRestriction (ZFSet.prod (births.cutoff n) (births.cutoff n)) (births.cutoffMeet k) = - births.cutoffMeet n := by - apply graphRestriction_restrict - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - exact ZFSet.pair_mem_prod.2 ⟨births.cutoff_mono before hx, births.cutoff_mono before hy⟩ - -theorem cutoff_birth_restriction {n k : Nat} (before : n ≤ k) : - graphRestriction (births.cutoff n) (births.cutoffBirth k) = births.cutoffBirth n := - graphRestriction_restrict (births.cutoff_mono before) - -theorem cutoff_height_restriction (height : ZFSet.{u}) {n k : Nat} (before : n ≤ k) : - graphRestriction (births.cutoff n) (births.cutoffHeight height k) = births.cutoffHeight height n := - graphRestriction_restrict (births.cutoff_mono before) - -variable {inv : ZFSet.{u}} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -include data group oldAction pairing unions powers separation infinite hG hP0 - -theorem pair_mem_order_iff_cutoff (x y : ZFSet.{u}) : - ZFSet.pair x y ∈ r ↔ ∃ n : Nat, ZFSet.pair x y ∈ births.cutoffOrder n := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - constructor - · intro entry - have bounds := ZFSet.pair_mem_prod.1 (geometry.meet.order.relation entry) - obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 bounds.1 - obtain ⟨k, hy⟩ := (births.cutoff_union levels y).1 bounds.2 - exact ⟨max n k, (pair_mem_heightOrderRestriction _ _ _ _).2 - ⟨entry, births.cutoff_mono (le_max_left n k) hx, births.cutoff_mono (le_max_right n k) hy⟩⟩ - · rintro ⟨n, entry⟩ - exact ((pair_mem_heightOrderRestriction _ _ _ _).1 entry).1 - -theorem pair_mem_meet_iff_cutoff (x y z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair x y) z ∈ μ ↔ - ∃ n : Nat, ZFSet.pair (ZFSet.pair x y) z ∈ births.cutoffMeet n := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - constructor - · intro entry - have bounds := ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 entry)).1 - obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 bounds.1 - obtain ⟨k, hy⟩ := (births.cutoff_union levels y).1 bounds.2 - exact ⟨max n k, pair_mem_graphRestriction.2 ⟨entry, - ZFSet.pair_mem_prod.2 ⟨births.cutoff_mono (le_max_left n k) hx, - births.cutoff_mono (le_max_right n k) hy⟩⟩⟩ - · rintro ⟨n, entry⟩ - exact (pair_mem_graphRestriction.1 entry).1 - -theorem pair_mem_birth_iff_cutoff (x t : ZFSet.{u}) : - ZFSet.pair x t ∈ births.birth ↔ ∃ n : Nat, ZFSet.pair x t ∈ births.cutoffBirth n := by - have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - constructor - · intro entry - obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 (ZFSet.pair_mem_prod.1 (births.function.1 entry)).1 - exact ⟨n, pair_mem_graphRestriction.2 ⟨entry, hx⟩⟩ - · rintro ⟨n, entry⟩ - exact (pair_mem_graphRestriction.1 entry).1 - -theorem pair_mem_height_iff_cutoff {C D rD lo hi seed : ZFSet.{u}} - (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) (x y : ZFSet.{u}) : - ZFSet.pair x y ∈ heights.height ↔ - ∃ n : Nat, ZFSet.pair x y ∈ births.cutoffHeight heights.height n := by - have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - constructor - · intro entry - obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 (ZFSet.pair_mem_prod.1 (heights.code.function.1 entry)).1 - exact ⟨n, pair_mem_graphRestriction.2 ⟨entry, hx⟩⟩ - · rintro ⟨n, entry⟩ - exact (pair_mem_graphRestriction.1 entry).1 - -end GroundExternalBirthData - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem heightOrderRestriction_restrict {Q L r : ZFSet.{u}} (subset : Q ⊆ L) : + heightOrderRestriction Q (heightOrderRestriction L r) = heightOrderRestriction Q r := by + apply ZFSet.ext + intro z + simp only [heightOrderRestriction, ZFSet.mem_sep] + constructor + · rintro ⟨⟨entry, _⟩, small⟩ + exact ⟨entry, small⟩ + · rintro ⟨entry, small⟩ + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 small + exact ⟨⟨entry, ZFSet.pair_mem_prod.2 ⟨subset hx, subset hy⟩⟩, + ZFSet.pair_mem_prod.2 ⟨hx, hy⟩⟩ + +namespace GroundExternalBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "r" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 + +theorem cutoff_order_restriction {n k : Nat} (before : n ≤ k) : + heightOrderRestriction (births.cutoff n) (births.cutoffOrder k) = births.cutoffOrder n := + heightOrderRestriction_restrict (births.cutoff_mono before) + +theorem cutoff_meet_restriction {n k : Nat} (before : n ≤ k) : + graphRestriction (ZFSet.prod (births.cutoff n) (births.cutoff n)) (births.cutoffMeet k) = + births.cutoffMeet n := by + apply graphRestriction_restrict + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + exact ZFSet.pair_mem_prod.2 ⟨births.cutoff_mono before hx, births.cutoff_mono before hy⟩ + +theorem cutoff_birth_restriction {n k : Nat} (before : n ≤ k) : + graphRestriction (births.cutoff n) (births.cutoffBirth k) = births.cutoffBirth n := + graphRestriction_restrict (births.cutoff_mono before) + +theorem cutoff_height_restriction (height : ZFSet.{u}) {n k : Nat} (before : n ≤ k) : + graphRestriction (births.cutoff n) (births.cutoffHeight height k) = births.cutoffHeight height n := + graphRestriction_restrict (births.cutoff_mono before) + +variable {inv : ZFSet.{u}} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +include data group oldAction pairing unions powers separation infinite hG hP0 + +theorem pair_mem_order_iff_cutoff (x y : ZFSet.{u}) : + ZFSet.pair x y ∈ r ↔ ∃ n : Nat, ZFSet.pair x y ∈ births.cutoffOrder n := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + constructor + · intro entry + have bounds := ZFSet.pair_mem_prod.1 (geometry.meet.order.relation entry) + obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 bounds.1 + obtain ⟨k, hy⟩ := (births.cutoff_union levels y).1 bounds.2 + exact ⟨max n k, (pair_mem_heightOrderRestriction _ _ _ _).2 + ⟨entry, births.cutoff_mono (le_max_left n k) hx, births.cutoff_mono (le_max_right n k) hy⟩⟩ + · rintro ⟨n, entry⟩ + exact ((pair_mem_heightOrderRestriction _ _ _ _).1 entry).1 + +theorem pair_mem_meet_iff_cutoff (x y z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair x y) z ∈ μ ↔ + ∃ n : Nat, ZFSet.pair (ZFSet.pair x y) z ∈ births.cutoffMeet n := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + constructor + · intro entry + have bounds := ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 entry)).1 + obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 bounds.1 + obtain ⟨k, hy⟩ := (births.cutoff_union levels y).1 bounds.2 + exact ⟨max n k, pair_mem_graphRestriction.2 ⟨entry, + ZFSet.pair_mem_prod.2 ⟨births.cutoff_mono (le_max_left n k) hx, + births.cutoff_mono (le_max_right n k) hy⟩⟩⟩ + · rintro ⟨n, entry⟩ + exact (pair_mem_graphRestriction.1 entry).1 + +theorem pair_mem_birth_iff_cutoff (x t : ZFSet.{u}) : + ZFSet.pair x t ∈ births.birth ↔ ∃ n : Nat, ZFSet.pair x t ∈ births.cutoffBirth n := by + have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + constructor + · intro entry + obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 (ZFSet.pair_mem_prod.1 (births.function.1 entry)).1 + exact ⟨n, pair_mem_graphRestriction.2 ⟨entry, hx⟩⟩ + · rintro ⟨n, entry⟩ + exact (pair_mem_graphRestriction.1 entry).1 + +theorem pair_mem_height_iff_cutoff {C D rD lo hi seed : ZFSet.{u}} + (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) (x y : ZFSet.{u}) : + ZFSet.pair x y ∈ heights.height ↔ + ∃ n : Nat, ZFSet.pair x y ∈ births.cutoffHeight heights.height n := by + have levels := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + constructor + · intro entry + obtain ⟨n, hx⟩ := (births.cutoff_union levels x).1 (ZFSet.pair_mem_prod.1 (heights.code.function.1 entry)).1 + exact ⟨n, pair_mem_graphRestriction.2 ⟨entry, hx⟩⟩ + · rintro ⟨n, entry⟩ + exact (pair_mem_graphRestriction.1 entry).1 + +end GroundExternalBirthData + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffLayers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffLayers.lean index 7004aa4c8298eb362e91f2183573e9ed42a9f792..e1e82fef31f327b6aeea4e5d0c9681395b6e96a1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffLayers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalCutoffLayers.lean @@ -1,111 +1,111 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerRestrictions -import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG hP0 births - -noncomputable def externalBirth_cutoff_fresh_layer - (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) - (atSpace : Space oldTimes = U) - (atOrder : sourceOrder oldTimes = completion.algebra.union.fields 1) - (atMeet : sourceMeet oldTimes = completion.algebra.union.fields 2) - (k n : Nat) (before : k ≤ n) : - CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) (births.cutoffOrder n) - (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) := by - classical - letI := group.toGroup - let Copies := External (SetMembers G) (family).Letters × Index - let Slice := {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode k) ∈ levels} - let Active := {v : Copies // ∃ x : Slice, ZFSet.pair x.val ((vpres).encode (.inr v)) ∈ owner} - let e (v : Active) := completion.externalCopyGraph P0 r0 μ0 A0 - ((s).encode ((family).flatWord v.val.1 v.val.2 (data.externalBirthCopyVertex group oldAction k v.val.2))) - have witnesses (x : Slice) : ∃ v : Active, - ZFSet.pair x.val ((vpres).encode (.inr v.val)) ∈ owner ∧ x.val ∈ relationImage U B (e v) := by - obtain ⟨w, r, owned, covered⟩ := - data.externalBirthCopy_witness group oldAction pairing unions powers separation infinite hG hP0 k x.property.2 - exact ⟨⟨(w, r), x, owned⟩, owned, covered⟩ - let pick (x : Slice) : Active := Classical.choose (witnesses x) - have selected (x : Slice) : - ZFSet.pair x.val ((vpres).encode (.inr (pick x).val)) ∈ owner ∧ - x.val ∈ relationImage U B (e (pick x)) := Classical.choose_spec (witnesses x) - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have levelCode := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have values (v : Active) : ∀ x y, ZFSet.pair x y ∈ e v → y ∈ births.cutoff n := by - intro x y entry - obtain ⟨active, owned⟩ := v.property - rcases data.externalBirthCopy_level_bound group oldAction pairing unions powers separation infinite hG hP0 - v.val.1 v.val.2 k owned active.property.2 entry with old | ⟨l, bound, level⟩ - · exact births.cutoff_old n old - · have fresh := (mem_ownerFresh P B y).1 (ZFSet.pair_mem_prod.1 (levelCode.1 level)).1 - apply (mem_ownerLevelPrefix _ _ _ _ _).2 - refine Or.inr ⟨fresh.1, fresh.2, natSetCode l, natSetCode_mem_omega l, level, ?_⟩ - rcases Nat.lt_or_eq_of_le (Nat.le_trans bound before) with less | same - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - have cutoffMeet := geometry.meet.restrict_lower (births.cutoff_subset n) - (births.cutoff_lower data group oldAction pairing unions powers separation infinite hG hP0 n) - have oldSubset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 - have times : oldTimes ⊆ births.limit := fun _ ht => - births.times.union.subset 0 (compressionStamp_old_mem (Or.inl ht) 0) - have oldBefore : ∀ x a j t, ZFSet.pair x a ∈ completion.externalSeedBirth P0 r0 μ0 A0 oldTimes oldBirth → - ZFSet.pair (natSetCode j) t ∈ births.stamps → a ∈ t := by - intro x a j t entry stamp - rw [(births.times.entries j t).1 stamp] - exact births.old_before entry j - have layer : CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) (births.cutoffOrder n) - (births.cutoffMeet n) births.birth (compressionStamp oldTimes k) := by - refine ownerBirthGraph_separated births.seed_function oldSubset times levelCode births.times.ownerStampCode - oldBefore ((births.times.entries k _).2 rfl) Active (fun _ => oldTimes) e - (fun _ => compressionStamp_base_mem oldTimes k) ?_ ?_ pick ?_ ?_ - · intro v - exact geometry.copies_ground _ (sc ▸ (s).encode_mem _) - · intro v - rw [atSpace, atOrder, atMeet] - exact (geometry.copies _ (sc ▸ (s).encode_mem _)).restrictTarget (values v) - · intro x hx - rw [atSpace] - obtain ⟨_, u, hu, entry⟩ := (mem_relationImage _ _ _ _).1 (selected x).2 - exact (mem_relationImage _ _ _ _).2 ⟨hx, u, hu, entry⟩ - · intro x y hx hy different - have differentOwners : (vpres).encode (.inr (pick x).val) ≠ (vpres).encode (.inr (pick y).val) := by - intro equal - exact different (Subtype.ext (Sum.inr.inj ((vpres).injective equal))) - obtain ⟨z, meetEntry, _⟩ := geometry.meet.operation.2 (ZFSet.pair x.val y.val) - (ZFSet.pair_mem_prod.2 ⟨births.cutoff_subset n hx, births.cutoff_subset n hy⟩) - refine ⟨z, (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2, - pair_mem_graphRestriction.2 ⟨meetEntry, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩⟩, ?_⟩ - exact data.externalOwnerLevels_meet_old_or_lower group oldAction pairing unions powers separation infinite hG hP0 - (selected x).1 (selected y).1 differentOwners x.property.2 y.property.2 meetEntry - exact layer.restrictBirth cutoffMeet - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerRestrictions +import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG hP0 births + +noncomputable def externalBirth_cutoff_fresh_layer + (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) + (atSpace : Space oldTimes = U) + (atOrder : sourceOrder oldTimes = completion.algebra.union.fields 1) + (atMeet : sourceMeet oldTimes = completion.algebra.union.fields 2) + (k n : Nat) (before : k ≤ n) : + CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) (births.cutoffOrder n) + (births.cutoffMeet n) (births.cutoffBirth n) (compressionStamp oldTimes k) := by + classical + letI := group.toGroup + let Copies := External (SetMembers G) (family).Letters × Index + let Slice := {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode k) ∈ levels} + let Active := {v : Copies // ∃ x : Slice, ZFSet.pair x.val ((vpres).encode (.inr v)) ∈ owner} + let e (v : Active) := completion.externalCopyGraph P0 r0 μ0 A0 + ((s).encode ((family).flatWord v.val.1 v.val.2 (data.externalBirthCopyVertex group oldAction k v.val.2))) + have witnesses (x : Slice) : ∃ v : Active, + ZFSet.pair x.val ((vpres).encode (.inr v.val)) ∈ owner ∧ x.val ∈ relationImage U B (e v) := by + obtain ⟨w, r, owned, covered⟩ := + data.externalBirthCopy_witness group oldAction pairing unions powers separation infinite hG hP0 k x.property.2 + exact ⟨⟨(w, r), x, owned⟩, owned, covered⟩ + let pick (x : Slice) : Active := Classical.choose (witnesses x) + have selected (x : Slice) : + ZFSet.pair x.val ((vpres).encode (.inr (pick x).val)) ∈ owner ∧ + x.val ∈ relationImage U B (e (pick x)) := Classical.choose_spec (witnesses x) + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have levelCode := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have values (v : Active) : ∀ x y, ZFSet.pair x y ∈ e v → y ∈ births.cutoff n := by + intro x y entry + obtain ⟨active, owned⟩ := v.property + rcases data.externalBirthCopy_level_bound group oldAction pairing unions powers separation infinite hG hP0 + v.val.1 v.val.2 k owned active.property.2 entry with old | ⟨l, bound, level⟩ + · exact births.cutoff_old n old + · have fresh := (mem_ownerFresh P B y).1 (ZFSet.pair_mem_prod.1 (levelCode.1 level)).1 + apply (mem_ownerLevelPrefix _ _ _ _ _).2 + refine Or.inr ⟨fresh.1, fresh.2, natSetCode l, natSetCode_mem_omega l, level, ?_⟩ + rcases Nat.lt_or_eq_of_le (Nat.le_trans bound before) with less | same + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + have cutoffMeet := geometry.meet.restrict_lower (births.cutoff_subset n) + (births.cutoff_lower data group oldAction pairing unions powers separation infinite hG hP0 n) + have oldSubset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 + have times : oldTimes ⊆ births.limit := fun _ ht => + births.times.union.subset 0 (compressionStamp_old_mem (Or.inl ht) 0) + have oldBefore : ∀ x a j t, ZFSet.pair x a ∈ completion.externalSeedBirth P0 r0 μ0 A0 oldTimes oldBirth → + ZFSet.pair (natSetCode j) t ∈ births.stamps → a ∈ t := by + intro x a j t entry stamp + rw [(births.times.entries j t).1 stamp] + exact births.old_before entry j + have layer : CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) (births.cutoffOrder n) + (births.cutoffMeet n) births.birth (compressionStamp oldTimes k) := by + refine ownerBirthGraph_separated births.seed_function oldSubset times levelCode births.times.ownerStampCode + oldBefore ((births.times.entries k _).2 rfl) Active (fun _ => oldTimes) e + (fun _ => compressionStamp_base_mem oldTimes k) ?_ ?_ pick ?_ ?_ + · intro v + exact geometry.copies_ground _ (sc ▸ (s).encode_mem _) + · intro v + rw [atSpace, atOrder, atMeet] + exact (geometry.copies _ (sc ▸ (s).encode_mem _)).restrictTarget (values v) + · intro x hx + rw [atSpace] + obtain ⟨_, u, hu, entry⟩ := (mem_relationImage _ _ _ _).1 (selected x).2 + exact (mem_relationImage _ _ _ _).2 ⟨hx, u, hu, entry⟩ + · intro x y hx hy different + have differentOwners : (vpres).encode (.inr (pick x).val) ≠ (vpres).encode (.inr (pick y).val) := by + intro equal + exact different (Subtype.ext (Sum.inr.inj ((vpres).injective equal))) + obtain ⟨z, meetEntry, _⟩ := geometry.meet.operation.2 (ZFSet.pair x.val y.val) + (ZFSet.pair_mem_prod.2 ⟨births.cutoff_subset n hx, births.cutoff_subset n hy⟩) + refine ⟨z, (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2, + pair_mem_graphRestriction.2 ⟨meetEntry, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩⟩, ?_⟩ + exact data.externalOwnerLevels_meet_old_or_lower group oldAction pairing unions powers separation infinite hG hP0 + (selected x).1 (selected y).1 differentOwners x.property.2 y.property.2 meetEntry + exact layer.restrictBirth cutoffMeet + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGenerators.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGenerators.lean index 8ff95f539c5271e75e42b08d27b75c524b2c400c..0374e3dcadbd7c4c331f85284fab9b8af760d7fd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGenerators.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGenerators.lean @@ -1,510 +1,510 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalGroupOperationGraphs - -namespace OAI - -namespace PartitionPilot.Forcing - -open SetRealization SetFormula -universe u - -noncomputable def externalActorSymbolGraph (G S : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ g ∈ G, ∃ a ∈ externalGeneratorAlphabet G S, - z = ZFSet.pair g a ∧ a = externalActorSymbol g) - (ZFSet.prod G (externalGeneratorAlphabet G S)) - -noncomputable def externalGeneratorSymbolGraph (G S : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ s ∈ S, ∃ a ∈ externalGeneratorAlphabet G S, - z = ZFSet.pair s a ∧ a = externalLetterSymbol s true) - (ZFSet.prod S (externalGeneratorAlphabet G S)) - -theorem pair_mem_externalActorSymbolGraph (G S g a : ZFSet.{u}) : - ZFSet.pair g a ∈ externalActorSymbolGraph G S ↔ g ∈ G ∧ a = externalActorSymbol g := by - constructor - · intro h - obtain ⟨_, g', hg, a', _, eq, value⟩ := ZFSet.mem_sep.1 h - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hg, value⟩ - · rintro ⟨hg, rfl⟩ - have ha := (externalActorSymbol_mem G S g).2 hg - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, ha⟩, g, hg, _, ha, rfl, rfl⟩ - -theorem pair_mem_externalGeneratorSymbolGraph (G S s a : ZFSet.{u}) : - ZFSet.pair s a ∈ externalGeneratorSymbolGraph G S ↔ s ∈ S ∧ a = externalLetterSymbol s true := by - constructor - · intro h - obtain ⟨_, s', hs, a', _, eq, value⟩ := ZFSet.mem_sep.1 h - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hs, value⟩ - · rintro ⟨hs, rfl⟩ - have ha := (externalLetterSymbol_mem G S s true).2 hs - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hs, ha⟩, s, hs, _, ha, rfl, rfl⟩ - -theorem externalActorSymbolGraph_eq_graph {J L : Type u} (s : Presentation J) (t : Presentation L) : - externalActorSymbolGraph s.carrier t.carrier = s.graph - (externalGeneratorAlphabetPresentation s t) Sum.inl := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro hz - obtain ⟨g, hg, a, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - have value := ((pair_mem_externalActorSymbolGraph _ _ g a).1 hz).2 - obtain ⟨g, rfl⟩ := (s.mem_carrier g).1 hg - exact ⟨g, congrArg (ZFSet.pair (s.encode g)) value.symm⟩ - · rintro ⟨g, rfl⟩ - exact (pair_mem_externalActorSymbolGraph _ _ _ _).2 ⟨s.encode_mem g, rfl⟩ - -theorem externalGeneratorSymbolGraph_eq_graph {J L : Type u} - (s : Presentation J) (t : Presentation L) : - externalGeneratorSymbolGraph s.carrier t.carrier = t.graph - (externalGeneratorAlphabetPresentation s t) (fun a => Sum.inr (a, true)) := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro hz - obtain ⟨l, hl, a, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - have value := ((pair_mem_externalGeneratorSymbolGraph _ _ l a).1 hz).2 - obtain ⟨l, rfl⟩ := (t.mem_carrier l).1 hl - exact ⟨l, congrArg (ZFSet.pair (t.encode l)) value.symm⟩ - · rintro ⟨l, rfl⟩ - exact (pair_mem_externalGeneratorSymbolGraph _ _ _ _).2 ⟨t.encode_mem l, rfl⟩ - -namespace BoundedFormula - -def externalActorSymbolEntryFormula {n} (z G alphabet zero : Fin n) : BoundedFormula n := - exMem G (exMem alphabet.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (orderedPairFormula 0 zero.succ.succ 1))) - -theorem truth_externalActorSymbolEntryFormula {n} (z G alphabet zero : Fin n) - (env : Fin n → ZFSet.{u}) (hZero : env zero = natSetCode 0) : - Truth (externalActorSymbolEntryFormula z G alphabet zero) env ↔ - ∃ g ∈ env G, ∃ a ∈ env alphabet, env z = ZFSet.pair g a ∧ a = externalActorSymbol g := by - simp only [externalActorSymbolEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - change (∃ g ∈ env G, ∃ a ∈ env alphabet, env z = ZFSet.pair g a ∧ - a = ZFSet.pair (env zero) g) ↔ _ - rw [hZero] - rfl - -def externalGeneratorSymbolEntryFormula {n} (z S alphabet one : Fin n) : BoundedFormula n := - exMem S (exMem alphabet.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (orderedRightTripleFormula 0 one.succ.succ 1 one.succ.succ))) - -theorem truth_externalGeneratorSymbolEntryFormula {n} (z S alphabet one : Fin n) - (env : Fin n → ZFSet.{u}) (hOne : env one = natSetCode 1) : - Truth (externalGeneratorSymbolEntryFormula z S alphabet one) env ↔ - ∃ s ∈ env S, ∃ a ∈ env alphabet, env z = ZFSet.pair s a ∧ a = externalLetterSymbol s true := by - simp only [externalGeneratorSymbolEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_orderedRightTripleFormula] - change (∃ s ∈ env S, ∃ a ∈ env alphabet, env z = ZFSet.pair s a ∧ - a = ZFSet.pair (env one) (ZFSet.pair s (env one))) ↔ _ - rw [hOne] - rfl - -end BoundedFormula - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem externalActorSymbolGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G S : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) : - externalActorSymbolGraph G S ∈ M.sets := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ - let params := extend G (extend (externalGeneratorAlphabet G S) (extend (natSetCode 0) Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalActorSymbolEntryFormula 0 1 2 3) params - (Fin.cases hG (Fin.cases hAlphabet (Fin.cases hZero (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hG hAlphabet) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.externalActorSymbolEntryFormula 0 1 2 3) (extend z params)) - (ZFSet.prod G (externalGeneratorAlphabet G S)) = externalActorSymbolGraph G S := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, externalActorSymbolGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_externalActorSymbolEntryFormula 0 1 2 3 _ rfl) - exact equal ▸ selected - -theorem externalGeneratorSymbolGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G S : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) : - externalGeneratorSymbolGraph G S ∈ M.sets := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ - have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero - let params := extend S (extend (externalGeneratorAlphabet G S) (extend (natSetCode 1) Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalGeneratorSymbolEntryFormula 0 1 2 3) params - (Fin.cases hS (Fin.cases hAlphabet (Fin.cases hOne (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hS hAlphabet) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.externalGeneratorSymbolEntryFormula 0 1 2 3) (extend z params)) - (ZFSet.prod S (externalGeneratorAlphabet G S)) = externalGeneratorSymbolGraph G S := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, externalGeneratorSymbolGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_externalGeneratorSymbolEntryFormula 0 1 2 3 _ rfl) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -section - -namespace PartitionPilot.Forcing - -open SetRealization SetFormula -universe u - -noncomputable def singletonWordGraph (A W : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ A, ∃ w ∈ W, z = ZFSet.pair x w ∧ w = wordSingleton x) - (ZFSet.prod A W) - -theorem pair_mem_singletonWordGraph (A W x w : ZFSet.{u}) : - ZFSet.pair x w ∈ singletonWordGraph A W ↔ x ∈ A ∧ w ∈ W ∧ w = wordSingleton x := by - constructor - · intro h - obtain ⟨_, y, hy, v, hv, eq, value⟩ := ZFSet.mem_sep.1 h - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hy, hv, value⟩ - · rintro ⟨hx, hw, value⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hw⟩, x, hx, w, hw, rfl, value⟩ - -namespace BoundedFormula - -def singletonWordFormula {n} (w zero x : Fin n) : BoundedFormula n := - exMem w (.conj (orderedPairFormula 0 zero.succ x.succ) (singletonFormula w.succ 0)) - -theorem truth_singletonWordFormula {n} (w zero x : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (singletonWordFormula w zero x) env ↔ env w = {ZFSet.pair (env zero) (env x)} := by - simp only [singletonWordFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_singletonFormula] - change (∃ z ∈ env w, z = ZFSet.pair (env zero) (env x) ∧ env w = {z}) ↔ _ - constructor - · rintro ⟨z, _, rfl, eq⟩ - exact eq - · intro eq - exact ⟨_, eq.symm ▸ ZFSet.mem_singleton.2 rfl, rfl, eq⟩ - -def singletonWordEntryFormula {n} (z A W zero : Fin n) : BoundedFormula n := - exMem A (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (singletonWordFormula 0 zero.succ.succ 1))) - -theorem truth_singletonWordEntryFormula {n} (z A W zero : Fin n) - (env : Fin n → ZFSet.{u}) (hZero : env zero = natSetCode 0) : - Truth (singletonWordEntryFormula z A W zero) env ↔ - ∃ x ∈ env A, ∃ w ∈ env W, env z = ZFSet.pair x w ∧ w = wordSingleton x := by - simp only [singletonWordEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_singletonWordFormula] - change (∃ x ∈ env A, ∃ w ∈ env W, env z = ZFSet.pair x w ∧ - w = {ZFSet.pair (env zero) x}) ↔ _ - rw [hZero] - rfl - -end BoundedFormula - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem singletonWordGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A W : ZFSet.{u}} (hA : A ∈ M.sets) (hW : W ∈ M.sets) : - singletonWordGraph A W ∈ M.sets := by - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨A, hA⟩ - let params := extend A (extend W (extend (natSetCode 0) Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.singletonWordEntryFormula 0 1 2 3) params - (Fin.cases hA (Fin.cases hW (Fin.cases hZero (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hA hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.singletonWordEntryFormula 0 1 2 3) (extend z params)) (ZFSet.prod A W) = - singletonWordGraph A W := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, singletonWordGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_singletonWordEntryFormula 0 1 2 3 _ rfl) - exact equal ▸ selected - -theorem singletonWordGraph_eq_graph - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {B : Type u} (s : Presentation B) (hA : s.carrier ∈ M.sets) : - singletonWordGraph s.carrier (M.finiteWords s.carrier) = - s.graph (finiteWordPresentation s M pairing unions separation infinite hA) (fun x => [x]) := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro hz - obtain ⟨x, hx, w, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - have value := ((pair_mem_singletonWordGraph _ _ x w).1 hz).2.2 - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - exact ⟨x, congrArg (ZFSet.pair (s.encode x)) ((finiteWordGraph_singleton s x).trans value.symm)⟩ - · rintro ⟨x, rfl⟩ - exact (pair_mem_singletonWordGraph _ _ _ _).2 ⟨s.encode_mem x, - finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hA [x], - finiteWordGraph_singleton s x⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.SetRealization.Presentation - -open Forcing -universe u - -theorem relationCompose_graph {A B C : Type u} - (s : Presentation A) (t : Presentation B) (v : Presentation C) (f : A → B) (g : B → C) : - relationCompose s.carrier t.carrier v.carrier (s.graph t f) (t.graph v g) = - s.graph v (fun x => g (f x)) := by - apply ZFSet.ext - intro z - rw [mem_relationCompose, mem_graph] - constructor - · rintro ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy - obtain ⟨c, rfl⟩ := (v.mem_carrier w).1 hw - have ab := (s.pair_mem_graph t f a b).1 first - have bc := (t.pair_mem_graph v g b c).1 second - subst b c - exact ⟨a, rfl⟩ - · rintro ⟨a, rfl⟩ - exact ⟨s.encode a, s.encode_mem a, t.encode (f a), t.encode_mem (f a), - v.encode (g (f a)), v.encode_mem (g (f a)), rfl, - (s.pair_mem_graph t f a (f a)).2 rfl, - (t.pair_mem_graph v g (f a) (g (f a))).2 rfl⟩ - -end PartitionPilot.SetRealization.Presentation - -end - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -structure GroundExternalGroupData (M : TransitiveGround.{u}) (G S m inv one : ZFSet.{u}) : Prop where - carrier_mem : M.externalGroupCarrier G S m one ∈ M.sets - multiplication_mem : M.externalGroupMultiplication G S m one ∈ M.sets - inverse_mem : M.externalGroupInverse G S m inv one ∈ M.sets - identity_mem : M.externalGroupIdentity G S m one ∈ M.sets - projection_mem : M.externalGroupProjection G S m one ∈ M.sets - group_code : GroupCode (M.externalGroupCarrier G S m one) - (M.externalGroupMultiplication G S m one) (M.externalGroupInverse G S m inv one) - (M.externalGroupIdentity G S m one) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) - -include pairing unions powers separation infinite in -theorem externalGroup_code_of_presentation {J L : Type u} [Group J] - (s : Presentation J) (t : Presentation L) - (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) : - GroupCode - (M.externalGroupCarrier s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) - (M.externalGroupMultiplication s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) - (M.externalGroupInverse s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) - (s.graph s Inv.inv) (s.encode 1)) - (M.externalGroupIdentity s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) := by - rw [M.externalGroupMultiplication_eq_graph pairing unions powers separation infinite s t hG hS, - M.externalGroupInverse_eq_graph pairing unions powers separation infinite s t hG hS, - M.externalGroupIdentity_eq_encode pairing unions powers separation infinite s t hG hS] - exact (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS).groupCode - -include pairing unions powers separation infinite in -theorem externalGroup_code {G S m inv one : ZFSet.{u}} (group : GroupCode G m inv one) - (hG : G ∈ M.sets) (hS : S ∈ M.sets) : - GroupCode (M.externalGroupCarrier G S m one) (M.externalGroupMultiplication G S m one) - (M.externalGroupInverse G S m inv one) (M.externalGroupIdentity G S m one) := by - let := group.toGroup - have code := M.externalGroup_code_of_presentation pairing unions powers separation infinite - (SetMembers.presentation G) (SetMembers.presentation S) hG hS - rw [group.multiplication_graph_eq, group.inverse_graph_eq, group.identity_code_eq] at code - exact code - -include pairing unions powers separation infinite in -theorem externalGroupData {G S m inv one : ZFSet.{u}} (group : GroupCode G m inv one) - (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) : - GroundExternalGroupData M G S m inv one := by - have ground := M.externalGroupOperations_ground pairing unions powers separation infinite hG hS hm hInv - (M.transitive hG group.identity_mem) - exact ⟨ground.1, ground.2.1, ground.2.2.1, ground.2.2.2.1, ground.2.2.2.2, - M.externalGroup_code pairing unions powers separation infinite group hG hS⟩ - -theorem GroundExternalGroupData.realize_group {G S m inv one : ZFSet.{u}} - (data : GroundExternalGroupData M G S m inv one) : - Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula - (extend (M.externalGroupCarrier G S m one) - (extend (M.externalGroupMultiplication G S m one) - (extend (M.externalGroupInverse G S m inv one) - (extend (M.externalGroupIdentity G S m one) Fin.elim0)))) := - (M.realize_groupCode data.carrier_mem data.multiplication_mem data.inverse_mem data.identity_mem).2 data.group_code - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -open Compression.RecursiveMaps.CosetGeometry -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def externalSymbolClasses (G S m one : ZFSet.{u}) : ZFSet.{u} := - let alphabet := externalGeneratorAlphabet G S - let words := M.finiteWords alphabet - relationCompose alphabet words (M.externalGroupCarrier G S m one) - (singletonWordGraph alphabet words) (M.externalGroupProjection G S m one) - -noncomputable def externalOldInclusion (G S m one : ZFSet.{u}) : ZFSet.{u} := - relationCompose G (externalGeneratorAlphabet G S) (M.externalGroupCarrier G S m one) - (externalActorSymbolGraph G S) (M.externalSymbolClasses G S m one) - -noncomputable def externalChildGenerators (G S m one : ZFSet.{u}) : ZFSet.{u} := - relationCompose S (externalGeneratorAlphabet G S) (M.externalGroupCarrier G S m one) - (externalGeneratorSymbolGraph G S) (M.externalSymbolClasses G S m one) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) - -include pairing unions powers separation infinite in -theorem externalSymbolClasses_mem {G S m one : ZFSet.{u}} - (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : - M.externalSymbolClasses G S m one ∈ M.sets := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet - have hE := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm hOne - have hQ := M.equivalenceClasses_mem powers separation hWords hE - have hProjection := M.equivalenceClassifier_mem pairing unions powers separation hWords hE - exact M.relationCompose_mem pairing unions powers separation hAlphabet hWords hQ - (M.singletonWordGraph_mem pairing unions powers separation hAlphabet hWords) hProjection - -include pairing unions powers separation infinite in -theorem externalGeneratorGraphs_mem {G S m one : ZFSet.{u}} - (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : - M.externalOldInclusion G S m one ∈ M.sets ∧ - M.externalChildGenerators G S m one ∈ M.sets := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet - have hE := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm hOne - have hQ := M.equivalenceClasses_mem powers separation hWords hE - have hClasses := M.externalSymbolClasses_mem pairing unions powers separation infinite hG hS hm hOne - exact ⟨M.relationCompose_mem pairing unions powers separation hG hAlphabet hQ - (M.externalActorSymbolGraph_mem pairing unions powers separation hG hS) hClasses, - M.relationCompose_mem pairing unions powers separation hS hAlphabet hQ - (M.externalGeneratorSymbolGraph_mem pairing unions powers separation hG hS) hClasses⟩ - -variable {J L : Type u} [Group J] (s : Presentation J) (t : Presentation L) -variable (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) - -theorem externalSymbolClasses_eq_graph : - M.externalSymbolClasses s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) - (s.encode 1) = (externalGeneratorAlphabetPresentation s t).graph - (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) - (ExternalWordRewrite.symbolValue J L) := by - let a := externalGeneratorAlphabetPresentation s t - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - let w := finiteWordPresentation a M pairing unions separation infinite hAlphabet - let q := M.externalGroupPresentation pairing unions powers separation infinite s t hG hS - unfold externalSymbolClasses externalGroupProjection - dsimp only - have singleton := M.singletonWordGraph_eq_graph pairing unions separation infinite a hAlphabet - change singletonWordGraph (externalGeneratorAlphabet s.carrier t.carrier) - (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) = _ at singleton - rw [singleton, M.externalGroupClassifier_eq_graph pairing unions powers separation infinite s t hG hS] - have composed := a.relationCompose_graph w q (fun x => [x]) (ExternalWordRewrite.evalWord J L) - have single : (fun x : J ⊕ (L × Bool) => ExternalWordRewrite.evalWord J L [x]) = - ExternalWordRewrite.symbolValue J L := by - rfl - rw [single] at composed - exact composed - -theorem externalOldInclusion_eq_graph : - M.externalOldInclusion s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) - (s.encode 1) = s.graph - (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) (old J L) := by - unfold externalOldInclusion - rw [externalActorSymbolGraph_eq_graph, - M.externalSymbolClasses_eq_graph pairing unions powers separation infinite s t hG hS] - exact s.relationCompose_graph (externalGeneratorAlphabetPresentation s t) - (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) - Sum.inl (ExternalWordRewrite.symbolValue J L) - -theorem externalChildGenerators_eq_graph : - M.externalChildGenerators s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) - (s.encode 1) = t.graph - (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) (generator J L) := by - unfold externalChildGenerators - rw [externalGeneratorSymbolGraph_eq_graph, - M.externalSymbolClasses_eq_graph pairing unions powers separation infinite s t hG hS] - exact t.relationCompose_graph (externalGeneratorAlphabetPresentation s t) - (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) - (fun x => Sum.inr (x, true)) (ExternalWordRewrite.symbolValue J L) - -theorem externalOldInclusion_entry_iff (g : J) (x : External J L) : - ZFSet.pair (s.encode g) - ((M.externalGroupPresentation pairing unions powers separation infinite s t hG hS).encode x) ∈ - M.externalOldInclusion s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ - old J L g = x := by - rw [M.externalOldInclusion_eq_graph pairing unions powers separation infinite s t hG hS] - exact s.pair_mem_graph _ _ g x - -theorem externalChildGenerators_entry_iff (l : L) (x : External J L) : - ZFSet.pair (t.encode l) - ((M.externalGroupPresentation pairing unions powers separation infinite s t hG hS).encode x) ∈ - M.externalChildGenerators s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ - generator J L l = x := by - rw [M.externalChildGenerators_eq_graph pairing unions powers separation infinite s t hG hS] - exact t.pair_mem_graph _ _ l x - -include pairing unions powers separation infinite hG hS in -theorem externalGeneratorGraphs_injections : - InjectionCode s.carrier - (M.externalGroupCarrier s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) - (M.externalOldInclusion s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) ∧ - InjectionCode t.carrier - (M.externalGroupCarrier s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) - (M.externalChildGenerators s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) := by - rw [M.externalOldInclusion_eq_graph pairing unions powers separation infinite s t hG hS, - M.externalChildGenerators_eq_graph pairing unions powers separation infinite s t hG hS] - have generatorInj : Function.Injective (generator J L) := - (Monoid.CoprodI.of_injective (M := Factor J L) true).comp FreeGroup.of_injective - let q := M.externalGroupPresentation pairing unions powers separation infinite s t hG hS - exact ⟨s.graph_injection q _ (old_injective J L), t.graph_injection q _ generatorInj⟩ - -include pairing unions powers separation infinite in -theorem externalGeneratorGraphs_ground_injections {G S m inv one : ZFSet.{u}} - (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) : - M.externalOldInclusion G S m one ∈ M.sets ∧ - InjectionCode G (M.externalGroupCarrier G S m one) (M.externalOldInclusion G S m one) ∧ - M.externalChildGenerators G S m one ∈ M.sets ∧ - InjectionCode S (M.externalGroupCarrier G S m one) (M.externalChildGenerators G S m one) := by - let := group.toGroup - have maps := M.externalGeneratorGraphs_injections pairing unions powers separation infinite - (SetMembers.presentation G) (SetMembers.presentation S) hG hS - rw [group.multiplication_graph_eq, group.identity_code_eq] at maps - have ground := M.externalGeneratorGraphs_mem pairing unions powers separation infinite hG hS hm - (M.transitive hG group.identity_mem) - exact ⟨ground.1, maps.1, ground.2, maps.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalGroupOperationGraphs + +namespace OAI + +namespace PartitionPilot.Forcing + +open SetRealization SetFormula +universe u + +noncomputable def externalActorSymbolGraph (G S : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ g ∈ G, ∃ a ∈ externalGeneratorAlphabet G S, + z = ZFSet.pair g a ∧ a = externalActorSymbol g) + (ZFSet.prod G (externalGeneratorAlphabet G S)) + +noncomputable def externalGeneratorSymbolGraph (G S : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ s ∈ S, ∃ a ∈ externalGeneratorAlphabet G S, + z = ZFSet.pair s a ∧ a = externalLetterSymbol s true) + (ZFSet.prod S (externalGeneratorAlphabet G S)) + +theorem pair_mem_externalActorSymbolGraph (G S g a : ZFSet.{u}) : + ZFSet.pair g a ∈ externalActorSymbolGraph G S ↔ g ∈ G ∧ a = externalActorSymbol g := by + constructor + · intro h + obtain ⟨_, g', hg, a', _, eq, value⟩ := ZFSet.mem_sep.1 h + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hg, value⟩ + · rintro ⟨hg, rfl⟩ + have ha := (externalActorSymbol_mem G S g).2 hg + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, ha⟩, g, hg, _, ha, rfl, rfl⟩ + +theorem pair_mem_externalGeneratorSymbolGraph (G S s a : ZFSet.{u}) : + ZFSet.pair s a ∈ externalGeneratorSymbolGraph G S ↔ s ∈ S ∧ a = externalLetterSymbol s true := by + constructor + · intro h + obtain ⟨_, s', hs, a', _, eq, value⟩ := ZFSet.mem_sep.1 h + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hs, value⟩ + · rintro ⟨hs, rfl⟩ + have ha := (externalLetterSymbol_mem G S s true).2 hs + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hs, ha⟩, s, hs, _, ha, rfl, rfl⟩ + +theorem externalActorSymbolGraph_eq_graph {J L : Type u} (s : Presentation J) (t : Presentation L) : + externalActorSymbolGraph s.carrier t.carrier = s.graph + (externalGeneratorAlphabetPresentation s t) Sum.inl := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro hz + obtain ⟨g, hg, a, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + have value := ((pair_mem_externalActorSymbolGraph _ _ g a).1 hz).2 + obtain ⟨g, rfl⟩ := (s.mem_carrier g).1 hg + exact ⟨g, congrArg (ZFSet.pair (s.encode g)) value.symm⟩ + · rintro ⟨g, rfl⟩ + exact (pair_mem_externalActorSymbolGraph _ _ _ _).2 ⟨s.encode_mem g, rfl⟩ + +theorem externalGeneratorSymbolGraph_eq_graph {J L : Type u} + (s : Presentation J) (t : Presentation L) : + externalGeneratorSymbolGraph s.carrier t.carrier = t.graph + (externalGeneratorAlphabetPresentation s t) (fun a => Sum.inr (a, true)) := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro hz + obtain ⟨l, hl, a, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + have value := ((pair_mem_externalGeneratorSymbolGraph _ _ l a).1 hz).2 + obtain ⟨l, rfl⟩ := (t.mem_carrier l).1 hl + exact ⟨l, congrArg (ZFSet.pair (t.encode l)) value.symm⟩ + · rintro ⟨l, rfl⟩ + exact (pair_mem_externalGeneratorSymbolGraph _ _ _ _).2 ⟨t.encode_mem l, rfl⟩ + +namespace BoundedFormula + +def externalActorSymbolEntryFormula {n} (z G alphabet zero : Fin n) : BoundedFormula n := + exMem G (exMem alphabet.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (orderedPairFormula 0 zero.succ.succ 1))) + +theorem truth_externalActorSymbolEntryFormula {n} (z G alphabet zero : Fin n) + (env : Fin n → ZFSet.{u}) (hZero : env zero = natSetCode 0) : + Truth (externalActorSymbolEntryFormula z G alphabet zero) env ↔ + ∃ g ∈ env G, ∃ a ∈ env alphabet, env z = ZFSet.pair g a ∧ a = externalActorSymbol g := by + simp only [externalActorSymbolEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + change (∃ g ∈ env G, ∃ a ∈ env alphabet, env z = ZFSet.pair g a ∧ + a = ZFSet.pair (env zero) g) ↔ _ + rw [hZero] + rfl + +def externalGeneratorSymbolEntryFormula {n} (z S alphabet one : Fin n) : BoundedFormula n := + exMem S (exMem alphabet.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (orderedRightTripleFormula 0 one.succ.succ 1 one.succ.succ))) + +theorem truth_externalGeneratorSymbolEntryFormula {n} (z S alphabet one : Fin n) + (env : Fin n → ZFSet.{u}) (hOne : env one = natSetCode 1) : + Truth (externalGeneratorSymbolEntryFormula z S alphabet one) env ↔ + ∃ s ∈ env S, ∃ a ∈ env alphabet, env z = ZFSet.pair s a ∧ a = externalLetterSymbol s true := by + simp only [externalGeneratorSymbolEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_orderedRightTripleFormula] + change (∃ s ∈ env S, ∃ a ∈ env alphabet, env z = ZFSet.pair s a ∧ + a = ZFSet.pair (env one) (ZFSet.pair s (env one))) ↔ _ + rw [hOne] + rfl + +end BoundedFormula + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem externalActorSymbolGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G S : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) : + externalActorSymbolGraph G S ∈ M.sets := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ + let params := extend G (extend (externalGeneratorAlphabet G S) (extend (natSetCode 0) Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalActorSymbolEntryFormula 0 1 2 3) params + (Fin.cases hG (Fin.cases hAlphabet (Fin.cases hZero (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hG hAlphabet) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.externalActorSymbolEntryFormula 0 1 2 3) (extend z params)) + (ZFSet.prod G (externalGeneratorAlphabet G S)) = externalActorSymbolGraph G S := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, externalActorSymbolGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_externalActorSymbolEntryFormula 0 1 2 3 _ rfl) + exact equal ▸ selected + +theorem externalGeneratorSymbolGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G S : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) : + externalGeneratorSymbolGraph G S ∈ M.sets := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨G, hG⟩ + have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero + let params := extend S (extend (externalGeneratorAlphabet G S) (extend (natSetCode 1) Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalGeneratorSymbolEntryFormula 0 1 2 3) params + (Fin.cases hS (Fin.cases hAlphabet (Fin.cases hOne (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hS hAlphabet) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.externalGeneratorSymbolEntryFormula 0 1 2 3) (extend z params)) + (ZFSet.prod S (externalGeneratorAlphabet G S)) = externalGeneratorSymbolGraph G S := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, externalGeneratorSymbolGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_externalGeneratorSymbolEntryFormula 0 1 2 3 _ rfl) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +section + +namespace PartitionPilot.Forcing + +open SetRealization SetFormula +universe u + +noncomputable def singletonWordGraph (A W : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ A, ∃ w ∈ W, z = ZFSet.pair x w ∧ w = wordSingleton x) + (ZFSet.prod A W) + +theorem pair_mem_singletonWordGraph (A W x w : ZFSet.{u}) : + ZFSet.pair x w ∈ singletonWordGraph A W ↔ x ∈ A ∧ w ∈ W ∧ w = wordSingleton x := by + constructor + · intro h + obtain ⟨_, y, hy, v, hv, eq, value⟩ := ZFSet.mem_sep.1 h + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hy, hv, value⟩ + · rintro ⟨hx, hw, value⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hw⟩, x, hx, w, hw, rfl, value⟩ + +namespace BoundedFormula + +def singletonWordFormula {n} (w zero x : Fin n) : BoundedFormula n := + exMem w (.conj (orderedPairFormula 0 zero.succ x.succ) (singletonFormula w.succ 0)) + +theorem truth_singletonWordFormula {n} (w zero x : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (singletonWordFormula w zero x) env ↔ env w = {ZFSet.pair (env zero) (env x)} := by + simp only [singletonWordFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_singletonFormula] + change (∃ z ∈ env w, z = ZFSet.pair (env zero) (env x) ∧ env w = {z}) ↔ _ + constructor + · rintro ⟨z, _, rfl, eq⟩ + exact eq + · intro eq + exact ⟨_, eq.symm ▸ ZFSet.mem_singleton.2 rfl, rfl, eq⟩ + +def singletonWordEntryFormula {n} (z A W zero : Fin n) : BoundedFormula n := + exMem A (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (singletonWordFormula 0 zero.succ.succ 1))) + +theorem truth_singletonWordEntryFormula {n} (z A W zero : Fin n) + (env : Fin n → ZFSet.{u}) (hZero : env zero = natSetCode 0) : + Truth (singletonWordEntryFormula z A W zero) env ↔ + ∃ x ∈ env A, ∃ w ∈ env W, env z = ZFSet.pair x w ∧ w = wordSingleton x := by + simp only [singletonWordEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_singletonWordFormula] + change (∃ x ∈ env A, ∃ w ∈ env W, env z = ZFSet.pair x w ∧ + w = {ZFSet.pair (env zero) x}) ↔ _ + rw [hZero] + rfl + +end BoundedFormula + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem singletonWordGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A W : ZFSet.{u}} (hA : A ∈ M.sets) (hW : W ∈ M.sets) : + singletonWordGraph A W ∈ M.sets := by + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨A, hA⟩ + let params := extend A (extend W (extend (natSetCode 0) Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.singletonWordEntryFormula 0 1 2 3) params + (Fin.cases hA (Fin.cases hW (Fin.cases hZero (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hA hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.singletonWordEntryFormula 0 1 2 3) (extend z params)) (ZFSet.prod A W) = + singletonWordGraph A W := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, singletonWordGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_singletonWordEntryFormula 0 1 2 3 _ rfl) + exact equal ▸ selected + +theorem singletonWordGraph_eq_graph + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {B : Type u} (s : Presentation B) (hA : s.carrier ∈ M.sets) : + singletonWordGraph s.carrier (M.finiteWords s.carrier) = + s.graph (finiteWordPresentation s M pairing unions separation infinite hA) (fun x => [x]) := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro hz + obtain ⟨x, hx, w, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + have value := ((pair_mem_singletonWordGraph _ _ x w).1 hz).2.2 + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + exact ⟨x, congrArg (ZFSet.pair (s.encode x)) ((finiteWordGraph_singleton s x).trans value.symm)⟩ + · rintro ⟨x, rfl⟩ + exact (pair_mem_singletonWordGraph _ _ _ _).2 ⟨s.encode_mem x, + finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hA [x], + finiteWordGraph_singleton s x⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.SetRealization.Presentation + +open Forcing +universe u + +theorem relationCompose_graph {A B C : Type u} + (s : Presentation A) (t : Presentation B) (v : Presentation C) (f : A → B) (g : B → C) : + relationCompose s.carrier t.carrier v.carrier (s.graph t f) (t.graph v g) = + s.graph v (fun x => g (f x)) := by + apply ZFSet.ext + intro z + rw [mem_relationCompose, mem_graph] + constructor + · rintro ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy + obtain ⟨c, rfl⟩ := (v.mem_carrier w).1 hw + have ab := (s.pair_mem_graph t f a b).1 first + have bc := (t.pair_mem_graph v g b c).1 second + subst b c + exact ⟨a, rfl⟩ + · rintro ⟨a, rfl⟩ + exact ⟨s.encode a, s.encode_mem a, t.encode (f a), t.encode_mem (f a), + v.encode (g (f a)), v.encode_mem (g (f a)), rfl, + (s.pair_mem_graph t f a (f a)).2 rfl, + (t.pair_mem_graph v g (f a) (g (f a))).2 rfl⟩ + +end PartitionPilot.SetRealization.Presentation + +end + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +structure GroundExternalGroupData (M : TransitiveGround.{u}) (G S m inv one : ZFSet.{u}) : Prop where + carrier_mem : M.externalGroupCarrier G S m one ∈ M.sets + multiplication_mem : M.externalGroupMultiplication G S m one ∈ M.sets + inverse_mem : M.externalGroupInverse G S m inv one ∈ M.sets + identity_mem : M.externalGroupIdentity G S m one ∈ M.sets + projection_mem : M.externalGroupProjection G S m one ∈ M.sets + group_code : GroupCode (M.externalGroupCarrier G S m one) + (M.externalGroupMultiplication G S m one) (M.externalGroupInverse G S m inv one) + (M.externalGroupIdentity G S m one) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) + +include pairing unions powers separation infinite in +theorem externalGroup_code_of_presentation {J L : Type u} [Group J] + (s : Presentation J) (t : Presentation L) + (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) : + GroupCode + (M.externalGroupCarrier s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) + (M.externalGroupMultiplication s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) + (M.externalGroupInverse s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) + (s.graph s Inv.inv) (s.encode 1)) + (M.externalGroupIdentity s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) := by + rw [M.externalGroupMultiplication_eq_graph pairing unions powers separation infinite s t hG hS, + M.externalGroupInverse_eq_graph pairing unions powers separation infinite s t hG hS, + M.externalGroupIdentity_eq_encode pairing unions powers separation infinite s t hG hS] + exact (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS).groupCode + +include pairing unions powers separation infinite in +theorem externalGroup_code {G S m inv one : ZFSet.{u}} (group : GroupCode G m inv one) + (hG : G ∈ M.sets) (hS : S ∈ M.sets) : + GroupCode (M.externalGroupCarrier G S m one) (M.externalGroupMultiplication G S m one) + (M.externalGroupInverse G S m inv one) (M.externalGroupIdentity G S m one) := by + let := group.toGroup + have code := M.externalGroup_code_of_presentation pairing unions powers separation infinite + (SetMembers.presentation G) (SetMembers.presentation S) hG hS + rw [group.multiplication_graph_eq, group.inverse_graph_eq, group.identity_code_eq] at code + exact code + +include pairing unions powers separation infinite in +theorem externalGroupData {G S m inv one : ZFSet.{u}} (group : GroupCode G m inv one) + (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) : + GroundExternalGroupData M G S m inv one := by + have ground := M.externalGroupOperations_ground pairing unions powers separation infinite hG hS hm hInv + (M.transitive hG group.identity_mem) + exact ⟨ground.1, ground.2.1, ground.2.2.1, ground.2.2.2.1, ground.2.2.2.2, + M.externalGroup_code pairing unions powers separation infinite group hG hS⟩ + +theorem GroundExternalGroupData.realize_group {G S m inv one : ZFSet.{u}} + (data : GroundExternalGroupData M G S m inv one) : + Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula + (extend (M.externalGroupCarrier G S m one) + (extend (M.externalGroupMultiplication G S m one) + (extend (M.externalGroupInverse G S m inv one) + (extend (M.externalGroupIdentity G S m one) Fin.elim0)))) := + (M.realize_groupCode data.carrier_mem data.multiplication_mem data.inverse_mem data.identity_mem).2 data.group_code + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +open Compression.RecursiveMaps.CosetGeometry +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def externalSymbolClasses (G S m one : ZFSet.{u}) : ZFSet.{u} := + let alphabet := externalGeneratorAlphabet G S + let words := M.finiteWords alphabet + relationCompose alphabet words (M.externalGroupCarrier G S m one) + (singletonWordGraph alphabet words) (M.externalGroupProjection G S m one) + +noncomputable def externalOldInclusion (G S m one : ZFSet.{u}) : ZFSet.{u} := + relationCompose G (externalGeneratorAlphabet G S) (M.externalGroupCarrier G S m one) + (externalActorSymbolGraph G S) (M.externalSymbolClasses G S m one) + +noncomputable def externalChildGenerators (G S m one : ZFSet.{u}) : ZFSet.{u} := + relationCompose S (externalGeneratorAlphabet G S) (M.externalGroupCarrier G S m one) + (externalGeneratorSymbolGraph G S) (M.externalSymbolClasses G S m one) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) + +include pairing unions powers separation infinite in +theorem externalSymbolClasses_mem {G S m one : ZFSet.{u}} + (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : + M.externalSymbolClasses G S m one ∈ M.sets := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet + have hE := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm hOne + have hQ := M.equivalenceClasses_mem powers separation hWords hE + have hProjection := M.equivalenceClassifier_mem pairing unions powers separation hWords hE + exact M.relationCompose_mem pairing unions powers separation hAlphabet hWords hQ + (M.singletonWordGraph_mem pairing unions powers separation hAlphabet hWords) hProjection + +include pairing unions powers separation infinite in +theorem externalGeneratorGraphs_mem {G S m one : ZFSet.{u}} + (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : + M.externalOldInclusion G S m one ∈ M.sets ∧ + M.externalChildGenerators G S m one ∈ M.sets := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet + have hE := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm hOne + have hQ := M.equivalenceClasses_mem powers separation hWords hE + have hClasses := M.externalSymbolClasses_mem pairing unions powers separation infinite hG hS hm hOne + exact ⟨M.relationCompose_mem pairing unions powers separation hG hAlphabet hQ + (M.externalActorSymbolGraph_mem pairing unions powers separation hG hS) hClasses, + M.relationCompose_mem pairing unions powers separation hS hAlphabet hQ + (M.externalGeneratorSymbolGraph_mem pairing unions powers separation hG hS) hClasses⟩ + +variable {J L : Type u} [Group J] (s : Presentation J) (t : Presentation L) +variable (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) + +theorem externalSymbolClasses_eq_graph : + M.externalSymbolClasses s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) + (s.encode 1) = (externalGeneratorAlphabetPresentation s t).graph + (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) + (ExternalWordRewrite.symbolValue J L) := by + let a := externalGeneratorAlphabetPresentation s t + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + let w := finiteWordPresentation a M pairing unions separation infinite hAlphabet + let q := M.externalGroupPresentation pairing unions powers separation infinite s t hG hS + unfold externalSymbolClasses externalGroupProjection + dsimp only + have singleton := M.singletonWordGraph_eq_graph pairing unions separation infinite a hAlphabet + change singletonWordGraph (externalGeneratorAlphabet s.carrier t.carrier) + (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) = _ at singleton + rw [singleton, M.externalGroupClassifier_eq_graph pairing unions powers separation infinite s t hG hS] + have composed := a.relationCompose_graph w q (fun x => [x]) (ExternalWordRewrite.evalWord J L) + have single : (fun x : J ⊕ (L × Bool) => ExternalWordRewrite.evalWord J L [x]) = + ExternalWordRewrite.symbolValue J L := by + rfl + rw [single] at composed + exact composed + +theorem externalOldInclusion_eq_graph : + M.externalOldInclusion s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) + (s.encode 1) = s.graph + (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) (old J L) := by + unfold externalOldInclusion + rw [externalActorSymbolGraph_eq_graph, + M.externalSymbolClasses_eq_graph pairing unions powers separation infinite s t hG hS] + exact s.relationCompose_graph (externalGeneratorAlphabetPresentation s t) + (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) + Sum.inl (ExternalWordRewrite.symbolValue J L) + +theorem externalChildGenerators_eq_graph : + M.externalChildGenerators s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) + (s.encode 1) = t.graph + (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) (generator J L) := by + unfold externalChildGenerators + rw [externalGeneratorSymbolGraph_eq_graph, + M.externalSymbolClasses_eq_graph pairing unions powers separation infinite s t hG hS] + exact t.relationCompose_graph (externalGeneratorAlphabetPresentation s t) + (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) + (fun x => Sum.inr (x, true)) (ExternalWordRewrite.symbolValue J L) + +theorem externalOldInclusion_entry_iff (g : J) (x : External J L) : + ZFSet.pair (s.encode g) + ((M.externalGroupPresentation pairing unions powers separation infinite s t hG hS).encode x) ∈ + M.externalOldInclusion s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ + old J L g = x := by + rw [M.externalOldInclusion_eq_graph pairing unions powers separation infinite s t hG hS] + exact s.pair_mem_graph _ _ g x + +theorem externalChildGenerators_entry_iff (l : L) (x : External J L) : + ZFSet.pair (t.encode l) + ((M.externalGroupPresentation pairing unions powers separation infinite s t hG hS).encode x) ∈ + M.externalChildGenerators s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ + generator J L l = x := by + rw [M.externalChildGenerators_eq_graph pairing unions powers separation infinite s t hG hS] + exact t.pair_mem_graph _ _ l x + +include pairing unions powers separation infinite hG hS in +theorem externalGeneratorGraphs_injections : + InjectionCode s.carrier + (M.externalGroupCarrier s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) + (M.externalOldInclusion s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) ∧ + InjectionCode t.carrier + (M.externalGroupCarrier s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) + (M.externalChildGenerators s.carrier t.carrier ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) := by + rw [M.externalOldInclusion_eq_graph pairing unions powers separation infinite s t hG hS, + M.externalChildGenerators_eq_graph pairing unions powers separation infinite s t hG hS] + have generatorInj : Function.Injective (generator J L) := + (Monoid.CoprodI.of_injective (M := Factor J L) true).comp FreeGroup.of_injective + let q := M.externalGroupPresentation pairing unions powers separation infinite s t hG hS + exact ⟨s.graph_injection q _ (old_injective J L), t.graph_injection q _ generatorInj⟩ + +include pairing unions powers separation infinite in +theorem externalGeneratorGraphs_ground_injections {G S m inv one : ZFSet.{u}} + (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) : + M.externalOldInclusion G S m one ∈ M.sets ∧ + InjectionCode G (M.externalGroupCarrier G S m one) (M.externalOldInclusion G S m one) ∧ + M.externalChildGenerators G S m one ∈ M.sets ∧ + InjectionCode S (M.externalGroupCarrier G S m one) (M.externalChildGenerators G S m one) := by + let := group.toGroup + have maps := M.externalGeneratorGraphs_injections pairing unions powers separation infinite + (SetMembers.presentation G) (SetMembers.presentation S) hG hS + rw [group.multiplication_graph_eq, group.identity_code_eq] at maps + have ground := M.externalGeneratorGraphs_mem pairing unions powers separation infinite hG hS hm + (M.transitive hG group.identity_mem) + exact ⟨ground.1, maps.1, ground.2, maps.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGroupEmbeddings.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGroupEmbeddings.lean index 70d8b887ff95cceb8e6f3f76557a5e5d70cf731b..1163caced866078a11d97eca4415532f4b3f9369 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGroupEmbeddings.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalGroupEmbeddings.lean @@ -1,157 +1,157 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalGenerators - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -structure GroupEmbeddingCode (G H mG mH oneG oneH e : ZFSet.{u}) : Prop where - injection : InjectionCode G H e - one : ZFSet.pair oneG oneH ∈ e - mul : ∀ a b c a' b' c', ZFSet.pair (ZFSet.pair a b) c ∈ mG → - ZFSet.pair a a' ∈ e → ZFSet.pair b b' ∈ e → ZFSet.pair c c' ∈ e → - ZFSet.pair (ZFSet.pair a' b') c' ∈ mH - -namespace GroupEmbeddingCode - -theorem identity {G m inv one : ZFSet.{u}} (group : GroupCode G m inv one) : - GroupEmbeddingCode G G m m one one (identityFunctionGraph G) := by - refine ⟨identityFunctionGraph_injection G, - (pair_mem_identityFunctionGraph G one one).2 ⟨rfl, group.identity_mem⟩, ?_⟩ - intro a b c a' b' c' product first second third - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph G a a').1 first - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph G b b').1 second - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph G c c').1 third - exact product - -theorem compose {G H K mG mH mK oneG oneH oneK e f : ZFSet.{u}} - (first : GroupEmbeddingCode G H mG mH oneG oneH e) - (second : GroupEmbeddingCode H K mH mK oneH oneK f) : - GroupEmbeddingCode G K mG mK oneG oneK (relationCompose G H K e f) := by - refine ⟨first.injection.compose second.injection, ?_, ?_⟩ - · have oneG := (ZFSet.pair_mem_prod.1 (first.injection.function.1 first.one)).1 - have oneH := (ZFSet.pair_mem_prod.1 (first.injection.function.1 first.one)).2 - have oneK := (ZFSet.pair_mem_prod.1 (second.injection.function.1 second.one)).2 - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨oneG, oneK, _, oneH, first.one, second.one⟩ - · intro a b c a' b' c' product aa bb cc - obtain ⟨_, _, x, _, ax, xa⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 aa - obtain ⟨_, _, y, _, by', yb⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 bb - obtain ⟨_, _, z, _, cz, zc⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 cc - exact second.mul x y z a' b' c' (first.mul a b c x y z product ax by' cz) xa yb zc - -theorem map_inv {G H mG mH invG invH oneG oneH e a b a' b' : ZFSet.{u}} - (embedding : GroupEmbeddingCode G H mG mH oneG oneH e) - (source : GroupCode G mG invG oneG) (target : GroupCode H mH invH oneH) - (inverse : ZFSet.pair a b ∈ invG) (first : ZFSet.pair a a' ∈ e) (second : ZFSet.pair b b' ∈ e) : - ZFSet.pair a' b' ∈ invH := by - let := target.toGroup - have bounds := ZFSet.pair_mem_prod.1 (source.inv_function.1 inverse) - have product := embedding.mul b a oneG b' a' oneH - (source.inv_mul a bounds.1 b bounds.2 inverse) second first embedding.one - let x := SetMembers.ofMem a' (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 first)).2 - let y := SetMembers.ofMem b' (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 second)).2 - have product' : y * x = (1 : SetMembers H) := by - apply (target.mul_eq_iff y x target.one).2 - simpa only [target.raw_one, x, y, SetMembers.raw_ofMem] using product - have equal : x⁻¹ = y := inv_eq_of_mul_eq_one_left product' - have entry := target.inv_mem x - change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (x⁻¹)) ∈ invH at entry - rw [equal] at entry - simpa only [x, y, SetMembers.raw_ofMem] using entry - -end GroupEmbeddingCode -end PartitionPilot.Forcing - -namespace PartitionPilot.SetRealization.Presentation -open Forcing -universe u -variable {G H : Type u} [Group G] [Group H] - -theorem groupEmbeddingCode (s : Presentation G) (t : Presentation H) - (f : G →* H) (injective : Function.Injective f) : - GroupEmbeddingCode s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) - ((t.product t).graph t (fun p => p.1 * p.2)) (s.encode 1) (t.encode 1) (s.graph t f) := by - refine ⟨s.graph_injection t f injective, (s.pair_mem_graph t f 1 1).2 f.map_one, ?_⟩ - intro a b c a' b' c' product first second third - obtain ⟨a, aa⟩ := (s.mem_graph t f _).1 first - obtain ⟨b, bb⟩ := (s.mem_graph t f _).1 second - obtain ⟨c, cc⟩ := (s.mem_graph t f _).1 third - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 aa - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 bb - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 cc - have mul := ((s.product s).pair_mem_graph s _ (a, b) c).1 product - exact ((t.product t).pair_mem_graph t _ (f a, f b) (f c)).2 (by rw [← mul, f.map_mul]) - -end PartitionPilot.SetRealization.Presentation - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -open Compression.RecursiveMaps.CosetGeometry -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) - -include pairing unions powers separation infinite in -theorem externalOldInclusion_groupEmbedding_of_presentation - {J L : Type u} [Group J] (s : Presentation J) (t : Presentation L) - (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) : - let m := (s.product s).graph s (fun p => p.1 * p.2) - GroupEmbeddingCode s.carrier (M.externalGroupCarrier s.carrier t.carrier m (s.encode 1)) - m (M.externalGroupMultiplication s.carrier t.carrier m (s.encode 1)) - (s.encode 1) (M.externalGroupIdentity s.carrier t.carrier m (s.encode 1)) - (M.externalOldInclusion s.carrier t.carrier m (s.encode 1)) := by - dsimp only - rw [M.externalOldInclusion_eq_graph pairing unions powers separation infinite s t hG hS, - M.externalGroupMultiplication_eq_graph pairing unions powers separation infinite s t hG hS, - M.externalGroupIdentity_eq_encode pairing unions powers separation infinite s t hG hS] - exact s.groupEmbeddingCode - (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) - (old J L) (old_injective J L) - -include pairing unions powers separation infinite in -theorem externalOldInclusion_groupEmbedding {G S m inv one : ZFSet.{u}} - (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) : - GroupEmbeddingCode G (M.externalGroupCarrier G S m one) - m (M.externalGroupMultiplication G S m one) one (M.externalGroupIdentity G S m one) - (M.externalOldInclusion G S m one) := by - let := group.toGroup - have code := M.externalOldInclusion_groupEmbedding_of_presentation pairing unions powers separation infinite - (SetMembers.presentation G) (SetMembers.presentation S) hG hS - dsimp only at code - rw [group.multiplication_graph_eq, group.identity_code_eq] at code - exact code - -include pairing unions powers separation infinite in -theorem externalOldInclusion_ground_groupEmbedding {G S m inv one : ZFSet.{u}} - (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) : - M.externalOldInclusion G S m one ∈ M.sets ∧ - GroupEmbeddingCode G (M.externalGroupCarrier G S m one) - m (M.externalGroupMultiplication G S m one) one (M.externalGroupIdentity G S m one) - (M.externalOldInclusion G S m one) := - ⟨(M.externalGeneratorGraphs_ground_injections pairing unions powers separation infinite group hG hS hm).1, - M.externalOldInclusion_groupEmbedding pairing unions powers separation infinite group hG hS⟩ - -include pairing unions powers separation infinite in -theorem externalOldInclusion_preserves_inverse {G S m inv one a b a' b' : ZFSet.{u}} - (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) - (inverse : ZFSet.pair a b ∈ inv) - (first : ZFSet.pair a a' ∈ M.externalOldInclusion G S m one) - (second : ZFSet.pair b b' ∈ M.externalOldInclusion G S m one) : - ZFSet.pair a' b' ∈ M.externalGroupInverse G S m inv one := - (M.externalOldInclusion_groupEmbedding pairing unions powers separation infinite group hG hS).map_inv - group (M.externalGroup_code pairing unions powers separation infinite group hG hS) inverse first second - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalGenerators + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +structure GroupEmbeddingCode (G H mG mH oneG oneH e : ZFSet.{u}) : Prop where + injection : InjectionCode G H e + one : ZFSet.pair oneG oneH ∈ e + mul : ∀ a b c a' b' c', ZFSet.pair (ZFSet.pair a b) c ∈ mG → + ZFSet.pair a a' ∈ e → ZFSet.pair b b' ∈ e → ZFSet.pair c c' ∈ e → + ZFSet.pair (ZFSet.pair a' b') c' ∈ mH + +namespace GroupEmbeddingCode + +theorem identity {G m inv one : ZFSet.{u}} (group : GroupCode G m inv one) : + GroupEmbeddingCode G G m m one one (identityFunctionGraph G) := by + refine ⟨identityFunctionGraph_injection G, + (pair_mem_identityFunctionGraph G one one).2 ⟨rfl, group.identity_mem⟩, ?_⟩ + intro a b c a' b' c' product first second third + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph G a a').1 first + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph G b b').1 second + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph G c c').1 third + exact product + +theorem compose {G H K mG mH mK oneG oneH oneK e f : ZFSet.{u}} + (first : GroupEmbeddingCode G H mG mH oneG oneH e) + (second : GroupEmbeddingCode H K mH mK oneH oneK f) : + GroupEmbeddingCode G K mG mK oneG oneK (relationCompose G H K e f) := by + refine ⟨first.injection.compose second.injection, ?_, ?_⟩ + · have oneG := (ZFSet.pair_mem_prod.1 (first.injection.function.1 first.one)).1 + have oneH := (ZFSet.pair_mem_prod.1 (first.injection.function.1 first.one)).2 + have oneK := (ZFSet.pair_mem_prod.1 (second.injection.function.1 second.one)).2 + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨oneG, oneK, _, oneH, first.one, second.one⟩ + · intro a b c a' b' c' product aa bb cc + obtain ⟨_, _, x, _, ax, xa⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 aa + obtain ⟨_, _, y, _, by', yb⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 bb + obtain ⟨_, _, z, _, cz, zc⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 cc + exact second.mul x y z a' b' c' (first.mul a b c x y z product ax by' cz) xa yb zc + +theorem map_inv {G H mG mH invG invH oneG oneH e a b a' b' : ZFSet.{u}} + (embedding : GroupEmbeddingCode G H mG mH oneG oneH e) + (source : GroupCode G mG invG oneG) (target : GroupCode H mH invH oneH) + (inverse : ZFSet.pair a b ∈ invG) (first : ZFSet.pair a a' ∈ e) (second : ZFSet.pair b b' ∈ e) : + ZFSet.pair a' b' ∈ invH := by + let := target.toGroup + have bounds := ZFSet.pair_mem_prod.1 (source.inv_function.1 inverse) + have product := embedding.mul b a oneG b' a' oneH + (source.inv_mul a bounds.1 b bounds.2 inverse) second first embedding.one + let x := SetMembers.ofMem a' (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 first)).2 + let y := SetMembers.ofMem b' (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 second)).2 + have product' : y * x = (1 : SetMembers H) := by + apply (target.mul_eq_iff y x target.one).2 + simpa only [target.raw_one, x, y, SetMembers.raw_ofMem] using product + have equal : x⁻¹ = y := inv_eq_of_mul_eq_one_left product' + have entry := target.inv_mem x + change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (x⁻¹)) ∈ invH at entry + rw [equal] at entry + simpa only [x, y, SetMembers.raw_ofMem] using entry + +end GroupEmbeddingCode +end PartitionPilot.Forcing + +namespace PartitionPilot.SetRealization.Presentation +open Forcing +universe u +variable {G H : Type u} [Group G] [Group H] + +theorem groupEmbeddingCode (s : Presentation G) (t : Presentation H) + (f : G →* H) (injective : Function.Injective f) : + GroupEmbeddingCode s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) + ((t.product t).graph t (fun p => p.1 * p.2)) (s.encode 1) (t.encode 1) (s.graph t f) := by + refine ⟨s.graph_injection t f injective, (s.pair_mem_graph t f 1 1).2 f.map_one, ?_⟩ + intro a b c a' b' c' product first second third + obtain ⟨a, aa⟩ := (s.mem_graph t f _).1 first + obtain ⟨b, bb⟩ := (s.mem_graph t f _).1 second + obtain ⟨c, cc⟩ := (s.mem_graph t f _).1 third + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 aa + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 bb + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 cc + have mul := ((s.product s).pair_mem_graph s _ (a, b) c).1 product + exact ((t.product t).pair_mem_graph t _ (f a, f b) (f c)).2 (by rw [← mul, f.map_mul]) + +end PartitionPilot.SetRealization.Presentation + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +open Compression.RecursiveMaps.CosetGeometry +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) + +include pairing unions powers separation infinite in +theorem externalOldInclusion_groupEmbedding_of_presentation + {J L : Type u} [Group J] (s : Presentation J) (t : Presentation L) + (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) : + let m := (s.product s).graph s (fun p => p.1 * p.2) + GroupEmbeddingCode s.carrier (M.externalGroupCarrier s.carrier t.carrier m (s.encode 1)) + m (M.externalGroupMultiplication s.carrier t.carrier m (s.encode 1)) + (s.encode 1) (M.externalGroupIdentity s.carrier t.carrier m (s.encode 1)) + (M.externalOldInclusion s.carrier t.carrier m (s.encode 1)) := by + dsimp only + rw [M.externalOldInclusion_eq_graph pairing unions powers separation infinite s t hG hS, + M.externalGroupMultiplication_eq_graph pairing unions powers separation infinite s t hG hS, + M.externalGroupIdentity_eq_encode pairing unions powers separation infinite s t hG hS] + exact s.groupEmbeddingCode + (M.externalGroupPresentation pairing unions powers separation infinite s t hG hS) + (old J L) (old_injective J L) + +include pairing unions powers separation infinite in +theorem externalOldInclusion_groupEmbedding {G S m inv one : ZFSet.{u}} + (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) : + GroupEmbeddingCode G (M.externalGroupCarrier G S m one) + m (M.externalGroupMultiplication G S m one) one (M.externalGroupIdentity G S m one) + (M.externalOldInclusion G S m one) := by + let := group.toGroup + have code := M.externalOldInclusion_groupEmbedding_of_presentation pairing unions powers separation infinite + (SetMembers.presentation G) (SetMembers.presentation S) hG hS + dsimp only at code + rw [group.multiplication_graph_eq, group.identity_code_eq] at code + exact code + +include pairing unions powers separation infinite in +theorem externalOldInclusion_ground_groupEmbedding {G S m inv one : ZFSet.{u}} + (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) : + M.externalOldInclusion G S m one ∈ M.sets ∧ + GroupEmbeddingCode G (M.externalGroupCarrier G S m one) + m (M.externalGroupMultiplication G S m one) one (M.externalGroupIdentity G S m one) + (M.externalOldInclusion G S m one) := + ⟨(M.externalGeneratorGraphs_ground_injections pairing unions powers separation infinite group hG hS hm).1, + M.externalOldInclusion_groupEmbedding pairing unions powers separation infinite group hG hS⟩ + +include pairing unions powers separation infinite in +theorem externalOldInclusion_preserves_inverse {G S m inv one a b a' b' : ZFSet.{u}} + (group : GroupCode G m inv one) (hG : G ∈ M.sets) (hS : S ∈ M.sets) + (inverse : ZFSet.pair a b ∈ inv) + (first : ZFSet.pair a a' ∈ M.externalOldInclusion G S m one) + (second : ZFSet.pair b b' ∈ M.externalOldInclusion G S m one) : + ZFSet.pair a' b' ∈ M.externalGroupInverse G S m inv one := + (M.externalOldInclusion_groupEmbedding pairing unions powers separation infinite group hG hS).map_inv + group (M.externalGroup_code pairing unions powers separation infinite group hG hS) inverse first second + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightFamilies.lean index 1181fe2c3950772cc6fde2340f41d0c62c2ed675..c6cf860ccc6fd55464a1af9d3c7bd5ec70fe7eb1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightFamilies.lean @@ -1,445 +1,445 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "vertices" => completion.externalFamilyTileVertexPresentation group oldAction data.original -local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original -include data group oldAction pairing unions powers separation infinite hG - -theorem localTileVertexImages_entry_iff : - letI := group.toGroup - ∀ (r : Index) (i : Option ((family).Child r)) (x : SetMembers U) (y : (family).Node (action)), - ZFSet.pair ((vertices).encode ⟨r, i, x⟩) ((q).encode y) ∈ - completion.localTileVertexImages P0 r0 μ0 A0 ↔ - ((family).copy (action) ((family).flatWord 1 r i)).toFun x = y := by - let := group.toGroup - intro r i x y - have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have placements := completion.externalPlacements_entry_iff group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG - rw [GroundCompressionCompletion.localTileVertexImages, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, z, hz, placed, classified⟩ - have hz' : z ∈ ((s).product (SetMembers.presentation U)).carrier := by - change z ∈ ZFSet.prod (s).carrier U - rw [sc] - exact hz - obtain ⟨⟨w, a⟩, rfl⟩ := (((s).product (SetMembers.presentation U)).mem_carrier z).1 hz' - have placed' := ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 placed).2.2 - rw [identity] at placed' - have same := (placements 1 ⟨r, i, x⟩ (w, a)).1 placed' - obtain ⟨rfl, rfl⟩ := Prod.mk.inj same - exact (classed _ _ _).1 classified - · intro equal - let z := (((s).product (SetMembers.presentation U)).encode ((family).flatWord 1 r i, x)) - have hz : z ∈ ZFSet.prod (M.externalGroupCarrier G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one) U := by - rw [← sc] - exact ((s).product (SetMembers.presentation U)).encode_mem _ - refine ⟨(vertices).encode_mem _, qc ▸ (q).encode_mem _, z, hz, ?_, (classed _ _ _).2 equal⟩ - apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 - refine ⟨(vertices).encode_mem _, hz, ?_⟩ - rw [identity] - exact (placements 1 ⟨r, i, x⟩ _).2 rfl - -theorem localTileCarrier_image : - letI := group.toGroup - ∀ (r : Index) (z : ZFSet.{u}), - z ∈ completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r) ↔ - ∃ x : ((family).tile r).Space, (q).encode (((family).placedTile (action) 1 r).toFun x) = z := by - let := group.toGroup - intro r z - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have vertexEntries := data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG - constructor - · intro hz - obtain ⟨hzQ, domain⟩ := (mem_relationFiber _ _ _ _).1 hz - obtain ⟨z, rfl⟩ := ((q).mem_carrier z).1 (qc.symm ▸ hzQ) - obtain ⟨_, _, j, _, x, hx, vertex, image⟩ := - (pair_mem_vertexImageDomains _ _ _ _ _ _ _ _).1 domain - have shape := (triple_mem_externalTileVertices _ _ _ _ _ _).1 vertex - have range : j = natSetCode 0 ∨ j = natSetCode 1 ∨ - (externalRequestIndexCode r ∈ ZFSet.prod {natSetCode 2} (externalRectangles P0 G r0 μ0 A0) ∧ - j = natSetCode 2) := by tauto - obtain ⟨i, rfl⟩ := (completion.externalFamilyVertexCode_range group oldAction data.original r j).1 range - let x' := SetMembers.ofMem x hx - have copied : ((family).copy (action) ((family).flatWord 1 r i)).toFun x' = z := - (vertexEntries r i x' z).1 (by simpa only [GroundCompressionCompletion.externalFamilyTileVertexPresentation_encode, x', SetMembers.raw_ofMem] using image) - refine ⟨((family).flatVertex r i).toFun x', ?_⟩ - rw [(family).flatVertex_copy, copied] - · rintro ⟨z, rfl⟩ - obtain ⟨i, x, rfl⟩ := (family).flatVertex_cover r z - apply (mem_relationFiber _ _ _ _).2 - refine ⟨qc ▸ (q).encode_mem _, ?_⟩ - apply (pair_mem_vertexImageDomains _ _ _ _ _ _ _ _).2 - have range := (completion.externalFamilyVertexCode_range group oldAction data.original r _).2 ⟨i, rfl⟩ - have hj : vcode r i ∈ natSetCode 3 := by - rcases range with equal | equal | ⟨_, equal⟩ - all_goals rw [equal]; exact (natSetCode_mem_iff _ 3).2 (by decide) - refine ⟨(externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r, - qc ▸ (q).encode_mem _, vcode r i, hj, SetMembers.raw x, SetMembers.raw_mem x, - (vertices).encode_mem ⟨r, i, x⟩, ?_⟩ - apply (vertexEntries r i x _).2 - exact ((family).flatVertex_copy (action) 1 r i x).symm - -noncomputable def localTilePresentation (r : Index) : - letI := group.toGroup - Presentation (((family).tile r).Space) := by - letI := group.toGroup - exact { - carrier := completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r) - encode := fun x => (q).encode (((family).placedTile (action) 1 r).toFun x) - injective := fun _ _ equal => embedding_injective ((family).placedTile (action) 1 r).toMeetEmbedding ((q).injective equal) - mem_carrier := data.localTileCarrier_image group oldAction pairing unions powers separation infinite hG r } - -theorem localTilePresentation_carrier (r : Index) : - letI := group.toGroup - (data.localTilePresentation group oldAction pairing unions powers separation infinite hG r).carrier = - completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r) := by - let := group.toGroup - rfl - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "p" => data.localTilePresentation group oldAction pairing unions powers separation infinite hG -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requestPresentation" => externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original -include data group oldAction pairing unions powers separation infinite hG - -theorem localTileOrder_iff : - letI := group.toGroup - ∀ (r : Index) (x y : ((family).tile r).Space), - ZFSet.pair ((p r).encode x) ((p r).encode y) ∈ - completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r) ↔ - ((family).tile r).order.le x y := by - let := group.toGroup - intro r x y - have hx := (p r).encode_mem x - have hy := (p r).encode_mem y - have hi : externalRequestIndexCode r ∈ externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) := - (requestPresentation).encode_mem r - rw [GroundCompressionCompletion.localTileOrder, suborderFiber_pair_iff hi] - change (_ ∧ (p r).encode x ∈ (p r).carrier ∧ (p r).encode y ∈ (p r).carrier) ↔ _ - simp only [hx, hy, and_true] - exact ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 _ _).trans - (((family).placedTile (action) 1 r).le_iff x y) - -theorem localTileMeet_iff : - letI := group.toGroup - ∀ (r : Index) (x y z : ((family).tile r).Space), - ZFSet.pair (ZFSet.pair ((p r).encode x) ((p r).encode y)) ((p r).encode z) ∈ - completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r) ↔ - ((family).tile r).order.meet x y = z := by - let := group.toGroup - intro r x y z - have hx := (p r).encode_mem x - have hy := (p r).encode_mem y - have hz := (p r).encode_mem z - have hi : externalRequestIndexCode r ∈ externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) := - (requestPresentation).encode_mem r - rw [GroundCompressionCompletion.localTileMeet, submeetFiber_triple_iff hi] - change (_ ∧ (p r).encode x ∈ (p r).carrier ∧ (p r).encode y ∈ (p r).carrier ∧ - (p r).encode z ∈ (p r).carrier) ↔ _ - simp only [hx, hy, hz, and_true] - refine ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 _ _ _).trans ?_ - rw [← ((family).placedTile (action) 1 r).map_meet] - exact ⟨fun equal => embedding_injective ((family).placedTile (action) 1 r).toMeetEmbedding equal, - fun equal => congrArg _ equal⟩ - -omit data group oldAction pairing unions powers separation infinite hG in -theorem localTileOrder_shape (r : Index) : - completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r) ⊆ - ZFSet.prod (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) - (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) := by - intro z hz - have entry := (mem_relationFiber _ _ _ _).1 hz |>.2 - obtain ⟨_, _, x, hx, y, hy, rfl⟩ := (pair_mem_indexedSuborderGraph _ _ _ _ _ _).1 entry - exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ - -theorem localTileMeet_eq_canonical (r : Index) : - completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r) = - canonicalMeetGraph (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) - (completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r)) := by - let := group.toGroup - have related := data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r - have meet := data.localTileMeet_iff group oldAction pairing unions powers separation infinite hG r - apply ZFSet.ext - intro v - constructor - · intro hv - have entry := (mem_relationFiber _ _ _ _).1 hv |>.2 - obtain ⟨_, _, x, hx, y, hy, z, hz, rfl⟩ := (pair_mem_indexedSubmeetGraph _ _ _ _ _ _).1 entry - obtain ⟨x, rfl⟩ := ((p r).mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := ((p r).mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := ((p r).mem_carrier z).1 hz - exact ((p r).canonicalMeetGraph_iff ((family).tile r).order related x y z).2 ((meet x y z).1 hv) - · intro hv - obtain ⟨x, hx, y, hy, z, hz, rfl, _⟩ := (mem_canonicalMeetGraph _ _ _).1 hv - obtain ⟨x, rfl⟩ := ((p r).mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := ((p r).mem_carrier y).1 hy - obtain ⟨z, rfl⟩ := ((p r).mem_carrier z).1 hz - exact (meet x y z).2 (((p r).canonicalMeetGraph_iff ((family).tile r).order related x y z).1 hv) - -theorem localTileMeet_code (r : Index) : - MeetOrderCode (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) - (completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r)) - (completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r)) := by - let := group.toGroup - rw [data.localTileMeet_eq_canonical group oldAction pairing unions powers separation infinite hG] - exact (p r).canonicalMeetOrderCode ((family).tile r).order - (localTileOrder_shape (completion := completion) r) - (data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r) - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "p" => data.localTilePresentation group oldAction pairing unions powers separation infinite hG -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original -local notation "vertexGraph(" r "," i ")" => indexedRelationSection U Q (completion.localTileVertexImages P0 r0 μ0 A0) - (ZFSet.pair (externalRequestIndexCode r) (vcode r i)) -include data group oldAction pairing unions powers separation infinite hG - -theorem localTileVertexGraph_iff : - letI := group.toGroup - ∀ (r : Index) (i : Option ((family).Child r)) (x : SetMembers U) (y : ((family).tile r).Space), - ZFSet.pair (SetMembers.raw x) ((p r).encode y) ∈ vertexGraph(r, i) ↔ - ((family).flatVertex r i).toFun x = y := by - let := group.toGroup - intro r i x y - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - rw [pair_mem_indexedRelationSection] - have hy : (p r).encode y ∈ Q := qc ▸ (q).encode_mem _ - simp only [SetMembers.raw_mem, hy, true_and] - change ZFSet.pair - ((completion.externalFamilyTileVertexPresentation group oldAction data.original).encode ⟨r, i, x⟩) - ((q).encode (((family).placedTile (action) 1 r).toFun y)) ∈ _ ↔ _ - rw [data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG] - rw [← (family).flatVertex_copy] - exact ⟨fun equal => embedding_injective ((family).placedTile (action) 1 r).toMeetEmbedding equal, - fun equal => congrArg _ equal⟩ - -theorem localTileVertexGraph_eq : - letI := group.toGroup - ∀ (r : Index) (i : Option ((family).Child r)), - vertexGraph(r, i) = (SetMembers.presentation U).graph (p r) ((family).flatVertex r i).toFun := by - let := group.toGroup - intro r i - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - apply ZFSet.ext - intro v - constructor - · intro hv - obtain ⟨x, hx, y, hy, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ _).1 hv - obtain ⟨y, rfl⟩ := ((q).mem_carrier y).1 (qc.symm ▸ hy) - let x' := SetMembers.ofMem x hx - have copied := (data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG - r i x' y).1 (by simpa only [GroundCompressionCompletion.externalFamilyTileVertexPresentation_encode, - x', SetMembers.raw_ofMem] using entry) - have equal : (q).encode y = (p r).encode (((family).flatVertex r i).toFun x') := by - change (q).encode y = (q).encode (((family).placedTile (action) 1 r).toFun _) - rw [(family).flatVertex_copy, copied] - rw [equal] - exact ((SetMembers.presentation U).mem_graph (p r) _ _).2 - ⟨x', by change ZFSet.pair (SetMembers.raw x') _ = _; simp only [x', SetMembers.raw_ofMem]⟩ - · intro hv - obtain ⟨x, rfl⟩ := ((SetMembers.presentation U).mem_graph (p r) _ _).1 hv - exact (data.localTileVertexGraph_iff group oldAction pairing unions powers separation infinite hG r i x _).2 rfl - -omit pairing unions powers separation infinite hG in -theorem localTileVertexCode_mem (r : Index) (i : Option ((family).Child r)) : vcode r i ∈ natSetCode 3 := by - have range := (completion.externalFamilyVertexCode_range group oldAction data.original r _).2 ⟨i, rfl⟩ - rcases range with equal | equal | ⟨_, equal⟩ - all_goals rw [equal]; exact (natSetCode_mem_iff _ 3).2 (by decide) - -theorem localTileVertexGraph_mem (hP0 : P0 ∈ M.sets) (r : Index) (i : Option ((family).Child r)) : - vertexGraph(r, i) ∈ M.sets := by - have grounds := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 - have requestGround := M.transitive data.words.requests_ground - ((externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r) - have indexGround := M.transitive (M.natSetCode_mem separation infinite 3) - (data.localTileVertexCode_mem group oldAction r i) - exact M.indexedRelationSection_mem pairing unions powers separation (completion.algebra.union.ground 0) - grounds.1 grounds.2.2.2.1 (M.orderedPair_mem pairing requestGround indexGround) - -theorem localTileVertexGraph_family (hP0 : P0 ∈ M.sets) (r : Index) (i : Option ((family).Child r)) : - ZFSet.pair (ZFSet.pair (externalRequestIndexCode r) (vcode r i)) (vertexGraph(r, i)) ∈ - completion.localTileVertexGraphs P0 r0 μ0 A0 := by - apply ((data.localTileVertexGraphs_spec group oldAction pairing unions powers separation infinite hG hP0).2.2 _ _).2 - exact ⟨ZFSet.pair_mem_prod.2 - ⟨(externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r, - data.localTileVertexCode_mem group oldAction r i⟩, rfl⟩ - -theorem localTileVertexGraph_code (r : Index) (i : Option ((family).Child r)) : - IdealEmbeddingCode U (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) - (completion.algebra.union.fields 1) (completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r)) - (completion.algebra.union.fields 2) (completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r)) - (vertexGraph(r, i)) := by - let := group.toGroup - rw [data.localTileVertexGraph_eq group oldAction pairing unions powers separation infinite hG] - exact (SetMembers.presentation U).idealEmbeddingCode (p r) ((family).flatVertex r i) - (fun _ _ => Iff.rfl) - (data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r) - (fun x y z => (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff x y z).symm) - (data.localTileMeet_iff group oldAction pairing unions powers separation infinite hG r) - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 C Q rQ original D rD c lo hi : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (heights : GroundCompressionHeightData M initial I Sources Reps G m one T - completion.algebra.union P0 C Q rQ original) -variable (columns : ordinalSetProperty C) (heightOrder : StrictLinearOrderCode Q rQ) -variable (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hrQ : rQ ∈ M.sets) -variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) -variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) -variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) -local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "family" => completion.externalFamily group oldAction data.original -include data group oldAction pairing unions powers separation collection infinite hG hP0 - heights columns heightOrder hC hQ hrQ target injection hD hrD hc hlo hhi gap - -theorem exists_localTileHeight (i : ZFSet.{u}) (hIndex : i ∈ Requests) : - ∃ height ∈ M.sets, - IntervalHeightCode (completion.localTileCarrier P0 r0 μ0 A0 i) - (completion.localTileOrder P0 r0 μ0 A0 i) D rD lo hi height := by - let := group.toGroup - let requests := externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0) - obtain ⟨r, rfl⟩ := (requests.mem_carrier i).1 hIndex - let p := data.localTilePresentation group oldAction pairing unions powers separation infinite hG r - let source := SetMembers.presentation U - let values := SetMembers.presentation (ZFSet.prod C Q) - let linear := lexHeightOrder_code columns heightOrder - let seed := heights.code.strictHeightGraph.smallHeight completion.algebra.union.meet linear - have seedGround : source.graph values seed.value ∈ M.sets := by - rw [StrictHeightGraphCode.smallHeight_graph] - exact heights.height_ground - have seedSmall : M.groundEmbeddable (relationImage U (ZFSet.prod C Q) - (source.graph values seed.value)) ZFSet.omega := by - rw [StrictHeightGraphCode.smallHeight_graph] - exact heights.range_countable - have carriers := data.localTileCarriers_spec group oldAction pairing unions powers separation infinite hG hP0 - have meets := data.localTileMeets_spec group oldAction pairing unions powers separation infinite hG hP0 - have indexMember := requests.encode_mem r - have carrierGround : p.carrier ∈ M.sets := - M.pair_right (M.transitive carriers.1 ((carriers.2.2 _ _).2 ⟨indexMember, rfl⟩)) - have meetGround : completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r) ∈ M.sets := - M.pair_right (M.transitive meets.1 ((meets.2.2 _ _).2 ⟨indexMember, rfl⟩)) - have tileMeet := data.localTileMeet_code group oldAction pairing unions powers separation infinite hG r - have rootGround : source.graph p (((family).tile r).root.toFun) ∈ M.sets := by - change source.graph p (((family).flatVertex r none).toFun) ∈ M.sets - rw [← data.localTileVertexGraph_eq group oldAction pairing unions powers separation infinite hG] - exact data.localTileVertexGraph_mem group oldAction pairing unions powers separation infinite hG hP0 r none - have childrenGround : ∀ j, source.graph p ((((family).tile r).child j).toFun) ∈ M.sets := by - intro j - change source.graph p (((family).flatVertex r (some j)).toFun) ∈ M.sets - rw [← data.localTileVertexGraph_eq group oldAction pairing unions powers separation infinite hG] - exact data.localTileVertexGraph_mem group oldAction pairing unions powers separation infinite hG hP0 r (some j) - obtain ⟨height, ground, code, _, _⟩ := M.exists_requestTileIntervalHeight - pairing unions powers separation collection infinite source values - ((family).top) ((family).greatest) linear.smallOrder seed - (fun _ _ => Iff.rfl) linear target injection (completion.algebra.union.ground 0) - (M.prod_mem pairing unions powers separation hC hQ) seedGround - (M.lexHeightOrder_mem pairing unions powers separation hC hQ hrQ) - hD hrD hc seedSmall hlo hhi gap ((family).request r) p carrierGround meetGround - (data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r) - tileMeet.operation - (fun x y => (data.localTileMeet_iff group oldAction pairing unions powers separation infinite hG r x y _).2 rfl) - rootGround childrenGround - exact ⟨height, ground, code⟩ - -theorem exists_localHeightFamily (choice : Realize M.sets SetFormula.choice Fin.elim0) : - Nonempty (GroundExternalLocalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 D rD lo hi completion) := by - apply data.localHeightFamily_of_witnesses group oldAction pairing unions powers separation infinite choice hG hP0 - hD hrD hc (M.transitive hD hlo) (M.transitive hD hhi) injection - exact data.exists_localTileHeight group oldAction pairing unions powers separation collection infinite hG hP0 - heights columns heightOrder hC hQ hrQ target injection hD hrD hc hlo hhi gap - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "vertices" => completion.externalFamilyTileVertexPresentation group oldAction data.original +local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original +include data group oldAction pairing unions powers separation infinite hG + +theorem localTileVertexImages_entry_iff : + letI := group.toGroup + ∀ (r : Index) (i : Option ((family).Child r)) (x : SetMembers U) (y : (family).Node (action)), + ZFSet.pair ((vertices).encode ⟨r, i, x⟩) ((q).encode y) ∈ + completion.localTileVertexImages P0 r0 μ0 A0 ↔ + ((family).copy (action) ((family).flatWord 1 r i)).toFun x = y := by + let := group.toGroup + intro r i x y + have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have placements := completion.externalPlacements_entry_iff group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG + rw [GroundCompressionCompletion.localTileVertexImages, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, z, hz, placed, classified⟩ + have hz' : z ∈ ((s).product (SetMembers.presentation U)).carrier := by + change z ∈ ZFSet.prod (s).carrier U + rw [sc] + exact hz + obtain ⟨⟨w, a⟩, rfl⟩ := (((s).product (SetMembers.presentation U)).mem_carrier z).1 hz' + have placed' := ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 placed).2.2 + rw [identity] at placed' + have same := (placements 1 ⟨r, i, x⟩ (w, a)).1 placed' + obtain ⟨rfl, rfl⟩ := Prod.mk.inj same + exact (classed _ _ _).1 classified + · intro equal + let z := (((s).product (SetMembers.presentation U)).encode ((family).flatWord 1 r i, x)) + have hz : z ∈ ZFSet.prod (M.externalGroupCarrier G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one) U := by + rw [← sc] + exact ((s).product (SetMembers.presentation U)).encode_mem _ + refine ⟨(vertices).encode_mem _, qc ▸ (q).encode_mem _, z, hz, ?_, (classed _ _ _).2 equal⟩ + apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 + refine ⟨(vertices).encode_mem _, hz, ?_⟩ + rw [identity] + exact (placements 1 ⟨r, i, x⟩ _).2 rfl + +theorem localTileCarrier_image : + letI := group.toGroup + ∀ (r : Index) (z : ZFSet.{u}), + z ∈ completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r) ↔ + ∃ x : ((family).tile r).Space, (q).encode (((family).placedTile (action) 1 r).toFun x) = z := by + let := group.toGroup + intro r z + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have vertexEntries := data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG + constructor + · intro hz + obtain ⟨hzQ, domain⟩ := (mem_relationFiber _ _ _ _).1 hz + obtain ⟨z, rfl⟩ := ((q).mem_carrier z).1 (qc.symm ▸ hzQ) + obtain ⟨_, _, j, _, x, hx, vertex, image⟩ := + (pair_mem_vertexImageDomains _ _ _ _ _ _ _ _).1 domain + have shape := (triple_mem_externalTileVertices _ _ _ _ _ _).1 vertex + have range : j = natSetCode 0 ∨ j = natSetCode 1 ∨ + (externalRequestIndexCode r ∈ ZFSet.prod {natSetCode 2} (externalRectangles P0 G r0 μ0 A0) ∧ + j = natSetCode 2) := by tauto + obtain ⟨i, rfl⟩ := (completion.externalFamilyVertexCode_range group oldAction data.original r j).1 range + let x' := SetMembers.ofMem x hx + have copied : ((family).copy (action) ((family).flatWord 1 r i)).toFun x' = z := + (vertexEntries r i x' z).1 (by simpa only [GroundCompressionCompletion.externalFamilyTileVertexPresentation_encode, x', SetMembers.raw_ofMem] using image) + refine ⟨((family).flatVertex r i).toFun x', ?_⟩ + rw [(family).flatVertex_copy, copied] + · rintro ⟨z, rfl⟩ + obtain ⟨i, x, rfl⟩ := (family).flatVertex_cover r z + apply (mem_relationFiber _ _ _ _).2 + refine ⟨qc ▸ (q).encode_mem _, ?_⟩ + apply (pair_mem_vertexImageDomains _ _ _ _ _ _ _ _).2 + have range := (completion.externalFamilyVertexCode_range group oldAction data.original r _).2 ⟨i, rfl⟩ + have hj : vcode r i ∈ natSetCode 3 := by + rcases range with equal | equal | ⟨_, equal⟩ + all_goals rw [equal]; exact (natSetCode_mem_iff _ 3).2 (by decide) + refine ⟨(externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r, + qc ▸ (q).encode_mem _, vcode r i, hj, SetMembers.raw x, SetMembers.raw_mem x, + (vertices).encode_mem ⟨r, i, x⟩, ?_⟩ + apply (vertexEntries r i x _).2 + exact ((family).flatVertex_copy (action) 1 r i x).symm + +noncomputable def localTilePresentation (r : Index) : + letI := group.toGroup + Presentation (((family).tile r).Space) := by + letI := group.toGroup + exact { + carrier := completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r) + encode := fun x => (q).encode (((family).placedTile (action) 1 r).toFun x) + injective := fun _ _ equal => embedding_injective ((family).placedTile (action) 1 r).toMeetEmbedding ((q).injective equal) + mem_carrier := data.localTileCarrier_image group oldAction pairing unions powers separation infinite hG r } + +theorem localTilePresentation_carrier (r : Index) : + letI := group.toGroup + (data.localTilePresentation group oldAction pairing unions powers separation infinite hG r).carrier = + completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r) := by + let := group.toGroup + rfl + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "p" => data.localTilePresentation group oldAction pairing unions powers separation infinite hG +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requestPresentation" => externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original +include data group oldAction pairing unions powers separation infinite hG + +theorem localTileOrder_iff : + letI := group.toGroup + ∀ (r : Index) (x y : ((family).tile r).Space), + ZFSet.pair ((p r).encode x) ((p r).encode y) ∈ + completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r) ↔ + ((family).tile r).order.le x y := by + let := group.toGroup + intro r x y + have hx := (p r).encode_mem x + have hy := (p r).encode_mem y + have hi : externalRequestIndexCode r ∈ externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) := + (requestPresentation).encode_mem r + rw [GroundCompressionCompletion.localTileOrder, suborderFiber_pair_iff hi] + change (_ ∧ (p r).encode x ∈ (p r).carrier ∧ (p r).encode y ∈ (p r).carrier) ↔ _ + simp only [hx, hy, and_true] + exact ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 _ _).trans + (((family).placedTile (action) 1 r).le_iff x y) + +theorem localTileMeet_iff : + letI := group.toGroup + ∀ (r : Index) (x y z : ((family).tile r).Space), + ZFSet.pair (ZFSet.pair ((p r).encode x) ((p r).encode y)) ((p r).encode z) ∈ + completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r) ↔ + ((family).tile r).order.meet x y = z := by + let := group.toGroup + intro r x y z + have hx := (p r).encode_mem x + have hy := (p r).encode_mem y + have hz := (p r).encode_mem z + have hi : externalRequestIndexCode r ∈ externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) := + (requestPresentation).encode_mem r + rw [GroundCompressionCompletion.localTileMeet, submeetFiber_triple_iff hi] + change (_ ∧ (p r).encode x ∈ (p r).carrier ∧ (p r).encode y ∈ (p r).carrier ∧ + (p r).encode z ∈ (p r).carrier) ↔ _ + simp only [hx, hy, hz, and_true] + refine ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 _ _ _).trans ?_ + rw [← ((family).placedTile (action) 1 r).map_meet] + exact ⟨fun equal => embedding_injective ((family).placedTile (action) 1 r).toMeetEmbedding equal, + fun equal => congrArg _ equal⟩ + +omit data group oldAction pairing unions powers separation infinite hG in +theorem localTileOrder_shape (r : Index) : + completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r) ⊆ + ZFSet.prod (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) + (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) := by + intro z hz + have entry := (mem_relationFiber _ _ _ _).1 hz |>.2 + obtain ⟨_, _, x, hx, y, hy, rfl⟩ := (pair_mem_indexedSuborderGraph _ _ _ _ _ _).1 entry + exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩ + +theorem localTileMeet_eq_canonical (r : Index) : + completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r) = + canonicalMeetGraph (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) + (completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r)) := by + let := group.toGroup + have related := data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r + have meet := data.localTileMeet_iff group oldAction pairing unions powers separation infinite hG r + apply ZFSet.ext + intro v + constructor + · intro hv + have entry := (mem_relationFiber _ _ _ _).1 hv |>.2 + obtain ⟨_, _, x, hx, y, hy, z, hz, rfl⟩ := (pair_mem_indexedSubmeetGraph _ _ _ _ _ _).1 entry + obtain ⟨x, rfl⟩ := ((p r).mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := ((p r).mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := ((p r).mem_carrier z).1 hz + exact ((p r).canonicalMeetGraph_iff ((family).tile r).order related x y z).2 ((meet x y z).1 hv) + · intro hv + obtain ⟨x, hx, y, hy, z, hz, rfl, _⟩ := (mem_canonicalMeetGraph _ _ _).1 hv + obtain ⟨x, rfl⟩ := ((p r).mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := ((p r).mem_carrier y).1 hy + obtain ⟨z, rfl⟩ := ((p r).mem_carrier z).1 hz + exact (meet x y z).2 (((p r).canonicalMeetGraph_iff ((family).tile r).order related x y z).1 hv) + +theorem localTileMeet_code (r : Index) : + MeetOrderCode (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) + (completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r)) + (completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r)) := by + let := group.toGroup + rw [data.localTileMeet_eq_canonical group oldAction pairing unions powers separation infinite hG] + exact (p r).canonicalMeetOrderCode ((family).tile r).order + (localTileOrder_shape (completion := completion) r) + (data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r) + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "p" => data.localTilePresentation group oldAction pairing unions powers separation infinite hG +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original +local notation "vertexGraph(" r "," i ")" => indexedRelationSection U Q (completion.localTileVertexImages P0 r0 μ0 A0) + (ZFSet.pair (externalRequestIndexCode r) (vcode r i)) +include data group oldAction pairing unions powers separation infinite hG + +theorem localTileVertexGraph_iff : + letI := group.toGroup + ∀ (r : Index) (i : Option ((family).Child r)) (x : SetMembers U) (y : ((family).tile r).Space), + ZFSet.pair (SetMembers.raw x) ((p r).encode y) ∈ vertexGraph(r, i) ↔ + ((family).flatVertex r i).toFun x = y := by + let := group.toGroup + intro r i x y + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + rw [pair_mem_indexedRelationSection] + have hy : (p r).encode y ∈ Q := qc ▸ (q).encode_mem _ + simp only [SetMembers.raw_mem, hy, true_and] + change ZFSet.pair + ((completion.externalFamilyTileVertexPresentation group oldAction data.original).encode ⟨r, i, x⟩) + ((q).encode (((family).placedTile (action) 1 r).toFun y)) ∈ _ ↔ _ + rw [data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG] + rw [← (family).flatVertex_copy] + exact ⟨fun equal => embedding_injective ((family).placedTile (action) 1 r).toMeetEmbedding equal, + fun equal => congrArg _ equal⟩ + +theorem localTileVertexGraph_eq : + letI := group.toGroup + ∀ (r : Index) (i : Option ((family).Child r)), + vertexGraph(r, i) = (SetMembers.presentation U).graph (p r) ((family).flatVertex r i).toFun := by + let := group.toGroup + intro r i + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + apply ZFSet.ext + intro v + constructor + · intro hv + obtain ⟨x, hx, y, hy, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ _).1 hv + obtain ⟨y, rfl⟩ := ((q).mem_carrier y).1 (qc.symm ▸ hy) + let x' := SetMembers.ofMem x hx + have copied := (data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG + r i x' y).1 (by simpa only [GroundCompressionCompletion.externalFamilyTileVertexPresentation_encode, + x', SetMembers.raw_ofMem] using entry) + have equal : (q).encode y = (p r).encode (((family).flatVertex r i).toFun x') := by + change (q).encode y = (q).encode (((family).placedTile (action) 1 r).toFun _) + rw [(family).flatVertex_copy, copied] + rw [equal] + exact ((SetMembers.presentation U).mem_graph (p r) _ _).2 + ⟨x', by change ZFSet.pair (SetMembers.raw x') _ = _; simp only [x', SetMembers.raw_ofMem]⟩ + · intro hv + obtain ⟨x, rfl⟩ := ((SetMembers.presentation U).mem_graph (p r) _ _).1 hv + exact (data.localTileVertexGraph_iff group oldAction pairing unions powers separation infinite hG r i x _).2 rfl + +omit pairing unions powers separation infinite hG in +theorem localTileVertexCode_mem (r : Index) (i : Option ((family).Child r)) : vcode r i ∈ natSetCode 3 := by + have range := (completion.externalFamilyVertexCode_range group oldAction data.original r _).2 ⟨i, rfl⟩ + rcases range with equal | equal | ⟨_, equal⟩ + all_goals rw [equal]; exact (natSetCode_mem_iff _ 3).2 (by decide) + +theorem localTileVertexGraph_mem (hP0 : P0 ∈ M.sets) (r : Index) (i : Option ((family).Child r)) : + vertexGraph(r, i) ∈ M.sets := by + have grounds := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 + have requestGround := M.transitive data.words.requests_ground + ((externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r) + have indexGround := M.transitive (M.natSetCode_mem separation infinite 3) + (data.localTileVertexCode_mem group oldAction r i) + exact M.indexedRelationSection_mem pairing unions powers separation (completion.algebra.union.ground 0) + grounds.1 grounds.2.2.2.1 (M.orderedPair_mem pairing requestGround indexGround) + +theorem localTileVertexGraph_family (hP0 : P0 ∈ M.sets) (r : Index) (i : Option ((family).Child r)) : + ZFSet.pair (ZFSet.pair (externalRequestIndexCode r) (vcode r i)) (vertexGraph(r, i)) ∈ + completion.localTileVertexGraphs P0 r0 μ0 A0 := by + apply ((data.localTileVertexGraphs_spec group oldAction pairing unions powers separation infinite hG hP0).2.2 _ _).2 + exact ⟨ZFSet.pair_mem_prod.2 + ⟨(externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem r, + data.localTileVertexCode_mem group oldAction r i⟩, rfl⟩ + +theorem localTileVertexGraph_code (r : Index) (i : Option ((family).Child r)) : + IdealEmbeddingCode U (completion.localTileCarrier P0 r0 μ0 A0 (externalRequestIndexCode r)) + (completion.algebra.union.fields 1) (completion.localTileOrder P0 r0 μ0 A0 (externalRequestIndexCode r)) + (completion.algebra.union.fields 2) (completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r)) + (vertexGraph(r, i)) := by + let := group.toGroup + rw [data.localTileVertexGraph_eq group oldAction pairing unions powers separation infinite hG] + exact (SetMembers.presentation U).idealEmbeddingCode (p r) ((family).flatVertex r i) + (fun _ _ => Iff.rfl) + (data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r) + (fun x y z => (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff x y z).symm) + (data.localTileMeet_iff group oldAction pairing unions powers separation infinite hG r) + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 C Q rQ original D rD c lo hi : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (heights : GroundCompressionHeightData M initial I Sources Reps G m one T + completion.algebra.union P0 C Q rQ original) +variable (columns : ordinalSetProperty C) (heightOrder : StrictLinearOrderCode Q rQ) +variable (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hrQ : rQ ∈ M.sets) +variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) +variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) +variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) +local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "family" => completion.externalFamily group oldAction data.original +include data group oldAction pairing unions powers separation collection infinite hG hP0 + heights columns heightOrder hC hQ hrQ target injection hD hrD hc hlo hhi gap + +theorem exists_localTileHeight (i : ZFSet.{u}) (hIndex : i ∈ Requests) : + ∃ height ∈ M.sets, + IntervalHeightCode (completion.localTileCarrier P0 r0 μ0 A0 i) + (completion.localTileOrder P0 r0 μ0 A0 i) D rD lo hi height := by + let := group.toGroup + let requests := externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0) + obtain ⟨r, rfl⟩ := (requests.mem_carrier i).1 hIndex + let p := data.localTilePresentation group oldAction pairing unions powers separation infinite hG r + let source := SetMembers.presentation U + let values := SetMembers.presentation (ZFSet.prod C Q) + let linear := lexHeightOrder_code columns heightOrder + let seed := heights.code.strictHeightGraph.smallHeight completion.algebra.union.meet linear + have seedGround : source.graph values seed.value ∈ M.sets := by + rw [StrictHeightGraphCode.smallHeight_graph] + exact heights.height_ground + have seedSmall : M.groundEmbeddable (relationImage U (ZFSet.prod C Q) + (source.graph values seed.value)) ZFSet.omega := by + rw [StrictHeightGraphCode.smallHeight_graph] + exact heights.range_countable + have carriers := data.localTileCarriers_spec group oldAction pairing unions powers separation infinite hG hP0 + have meets := data.localTileMeets_spec group oldAction pairing unions powers separation infinite hG hP0 + have indexMember := requests.encode_mem r + have carrierGround : p.carrier ∈ M.sets := + M.pair_right (M.transitive carriers.1 ((carriers.2.2 _ _).2 ⟨indexMember, rfl⟩)) + have meetGround : completion.localTileMeet P0 r0 μ0 A0 (externalRequestIndexCode r) ∈ M.sets := + M.pair_right (M.transitive meets.1 ((meets.2.2 _ _).2 ⟨indexMember, rfl⟩)) + have tileMeet := data.localTileMeet_code group oldAction pairing unions powers separation infinite hG r + have rootGround : source.graph p (((family).tile r).root.toFun) ∈ M.sets := by + change source.graph p (((family).flatVertex r none).toFun) ∈ M.sets + rw [← data.localTileVertexGraph_eq group oldAction pairing unions powers separation infinite hG] + exact data.localTileVertexGraph_mem group oldAction pairing unions powers separation infinite hG hP0 r none + have childrenGround : ∀ j, source.graph p ((((family).tile r).child j).toFun) ∈ M.sets := by + intro j + change source.graph p (((family).flatVertex r (some j)).toFun) ∈ M.sets + rw [← data.localTileVertexGraph_eq group oldAction pairing unions powers separation infinite hG] + exact data.localTileVertexGraph_mem group oldAction pairing unions powers separation infinite hG hP0 r (some j) + obtain ⟨height, ground, code, _, _⟩ := M.exists_requestTileIntervalHeight + pairing unions powers separation collection infinite source values + ((family).top) ((family).greatest) linear.smallOrder seed + (fun _ _ => Iff.rfl) linear target injection (completion.algebra.union.ground 0) + (M.prod_mem pairing unions powers separation hC hQ) seedGround + (M.lexHeightOrder_mem pairing unions powers separation hC hQ hrQ) + hD hrD hc seedSmall hlo hhi gap ((family).request r) p carrierGround meetGround + (data.localTileOrder_iff group oldAction pairing unions powers separation infinite hG r) + tileMeet.operation + (fun x y => (data.localTileMeet_iff group oldAction pairing unions powers separation infinite hG r x y _).2 rfl) + rootGround childrenGround + exact ⟨height, ground, code⟩ + +theorem exists_localHeightFamily (choice : Realize M.sets SetFormula.choice Fin.elim0) : + Nonempty (GroundExternalLocalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 D rD lo hi completion) := by + apply data.localHeightFamily_of_witnesses group oldAction pairing unions powers separation infinite choice hG hP0 + hD hrD hc (M.transitive hD hlo) (M.transitive hD hhi) injection + exact data.exists_localTileHeight group oldAction pairing unions powers separation collection infinite hG hP0 + heights columns heightOrder hC hQ hrQ target injection hD hrD hc hlo hhi gap + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightSelection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightSelection.lean index 430e4a6ed2df0eff64a24ab6834e0c1f158d43bf..76819447f5e2888ac89b8cfc90b5dd17829fcacb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightSelection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalLocalHeightSelection.lean @@ -1,731 +1,731 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CompressionExternalStepRealization -import OAI.SetTheory.PartitionPrinciple.Definability.IntervalHeightFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedSubstructures - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -universe u -namespace BoundedFormula -open SetFormula - -def intervalHeightCandidateFormula {n} - (Ps rs D rD lo hi i f boundPs boundRs : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ - exMem boundPs (exMem boundRs.succ - (.conj (pairMembershipFormula (lift i) 1 (lift Ps)) - (.conj (pairMembershipFormula (lift i) 0 (lift rs)) - (intervalHeightFormula 1 0 (lift D) (lift rD) (lift lo) (lift hi) (lift f))))) - -theorem truth_intervalHeightCandidateFormula {n} - (Ps rs D rD lo hi i f boundPs boundRs : Fin n) (env : Fin n → ZFSet.{u}) - (sourceBound : env boundPs = ⋃₀ ⋃₀ env Ps) - (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : - Truth (intervalHeightCandidateFormula Ps rs D rD lo hi i f boundPs boundRs) env ↔ - intervalHeightCandidate (env Ps) (env rs) (env D) (env rD) - (env lo) (env hi) (env i) (env f) := by - simp only [intervalHeightCandidateFormula, truth_exMem, Truth, - truth_pairMembershipFormula, truth_intervalHeightFormula] - change (∃ P ∈ env boundPs, ∃ r ∈ env boundRs, - ZFSet.pair (env i) P ∈ env Ps ∧ ZFSet.pair (env i) r ∈ env rs ∧ - IntervalHeightCode P r (env D) (env rD) (env lo) (env hi) (env f)) ↔ _ - rw [sourceBound, orderBound] - rfl - -def intervalHeightRelationEntryFormula {n} - (z I W Ps rs D rD lo hi boundPs boundRs : Fin n) : BoundedFormula n := - exMem I (exMem W.succ - (.conj (orderedPairFormula z.succ.succ 1 0) - (intervalHeightCandidateFormula Ps.succ.succ rs.succ.succ D.succ.succ - rD.succ.succ lo.succ.succ hi.succ.succ 1 0 boundPs.succ.succ boundRs.succ.succ))) - -theorem truth_intervalHeightRelationEntryFormula {n} - (z I W Ps rs D rD lo hi boundPs boundRs : Fin n) (env : Fin n → ZFSet.{u}) - (sourceBound : env boundPs = ⋃₀ ⋃₀ env Ps) - (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : - Truth (intervalHeightRelationEntryFormula z I W Ps rs D rD lo hi boundPs boundRs) env ↔ - ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧ - intervalHeightCandidate (env Ps) (env rs) (env D) (env rD) (env lo) (env hi) i f := by - simp only [intervalHeightRelationEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - apply exists_congr - intro i - apply and_congr_right - intro _ - apply exists_congr - intro f - apply and_congr_right - intro _ - exact and_congr Iff.rfl (truth_intervalHeightCandidateFormula Ps.succ.succ rs.succ.succ - D.succ.succ rD.succ.succ lo.succ.succ hi.succ.succ 1 0 boundPs.succ.succ boundRs.succ.succ - (extend f (extend i env)) sourceBound orderBound) - -end BoundedFormula - -namespace TransitiveGround -open SetFormula - -theorem intervalHeightRelation_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I W Ps rs D rD lo hi : ZFSet.{u}} - (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hPs : Ps ∈ M.sets) (hrs : rs ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hlo : lo ∈ M.sets) (hhi : hi ∈ M.sets) : - intervalHeightRelation I W Ps rs D rD lo hi ∈ M.sets := by - have sourceBound := M.union_mem unions (M.union_mem unions hPs) - have orderBound := M.union_mem unions (M.union_mem unions hrs) - let params := extend I (extend W (extend Ps (extend rs (extend D (extend rD - (extend lo (extend hi (extend (⋃₀ ⋃₀ Ps) (extend (⋃₀ ⋃₀ rs) Fin.elim0))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.intervalHeightRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params - (Fin.cases hI (Fin.cases hW (Fin.cases hPs (Fin.cases hrs (Fin.cases hD - (Fin.cases hrD (Fin.cases hlo (Fin.cases hhi (Fin.cases sourceBound - (Fin.cases orderBound (fun j => Fin.elim0 j))))))))))) - (M.prod_mem pairing unions powers separation hI hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.intervalHeightRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) - (extend z params)) (ZFSet.prod I W) = intervalHeightRelation I W Ps rs D rD lo hi := by - apply ZFSet.ext - intro z - rw [intervalHeightRelation, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_intervalHeightRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10 - (extend z params) rfl rfl) - exact equal ▸ selected - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u - -theorem exists_intervalHeight_family (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I B Ps rs D rD c lo hi : ZFSet.{u}} - (sources : FunctionGraphOn I Ps) (orders : FunctionGraphOn I rs) - (sourceBound : ∀ i, sources.value i ⊆ B) - (hI : I ∈ M.sets) (hB : B ∈ M.sets) (hPs : Ps ∈ M.sets) (hrs : rs ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (hlo : lo ∈ M.sets) (hhi : hi ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) - (injection : InjectionCode D ZFSet.omega c) - (witnesses : ∀ i, ∃ f ∈ M.sets, IntervalHeightCode (sources.value i) (orders.value i) D rD lo hi f) : - ∃ family ∈ M.sets, ZFSet.IsFunc I (M.groundRelations B D) family ∧ - ∀ (i : {i : ZFSet.{u} // i ∈ I}) f, ZFSet.pair i.val f ∈ family → - f ∈ M.sets ∧ IntervalHeightCode (sources.value i) (orders.value i) D rD lo hi f ∧ - relationImage (sources.value i) D f ∈ M.sets ∧ - M.groundEmbeddable (relationImage (sources.value i) D f) ZFSet.omega := by - let W := M.groundRelations B D - have hW : W ∈ M.sets := M.groundRelations_mem pairing unions powers separation hB hD - have hRelation := M.intervalHeightRelation_mem pairing unions powers separation - hI hW hPs hrs hD hrD hlo hhi - have total : ∀ i ∈ I, ∃ f ∈ W, - ZFSet.pair i f ∈ intervalHeightRelation I W Ps rs D rD lo hi := by - intro i memI - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, memI⟩ - obtain ⟨f, ground, code⟩ := witnesses j - have bound : f ⊆ ZFSet.prod B D := by - intro z hz - obtain ⟨x, hx, a, ha, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨sourceBound j hx, ha⟩ - have fW : f ∈ W := (M.mem_groundRelations B D f).2 ⟨ground, bound⟩ - exact ⟨f, fW, (pair_mem_intervalHeightRelation I W Ps rs D rD lo hi i f).2 - ⟨memI, fW, (intervalHeightCandidate_iff sources orders j f).2 code⟩⟩ - obtain ⟨family, ground, function, selected⟩ := M.uniformize_relation - pairing unions powers separation choice hI hW hRelation total - refine ⟨family, ground, function, ?_⟩ - intro i f entry - have candidate := (pair_mem_intervalHeightRelation I W Ps rs D rD lo hi i.val f).1 (selected entry) - have fGround := ((M.mem_groundRelations B D f).1 candidate.2.1).1 - have code := (intervalHeightCandidate_iff sources orders i f).1 candidate.2.2 - have rangeGround := M.relationImage_mem separation (sources.value_mem M hPs i) hD fGround - exact ⟨fGround, code, rangeGround, M.groundEmbeddable_restrict separation rangeGround hOmega - (fun _ hz => ((mem_relationImage _ _ _ _).1 hz).1) ⟨c, hc, injection⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -universe u -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -noncomputable def externalPointOrder (P r μ A : ZFSet.{u}) : ZFSet.{u} := - flatCopyOrderGraph (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) - (completion.externalPointClassifier P r μ A) (completion.algebra.union.fields 1) - -noncomputable def externalPointMeet (P r μ A : ZFSet.{u}) : ZFSet.{u} := - canonicalMeetGraph (completion.externalPointCarrier P r μ A) (completion.externalPointOrder P r μ A) - -noncomputable def externalPointAction (P r μ A : ZFSet.{u}) : ZFSet.{u} := - let S := externalChildLetters I P (externalRectangles P G r μ A) - flatCopyActionGraph (M.externalGroupCarrier G S m one) (completion.algebra.union.fields 0) - (completion.externalPointCarrier P r μ A) (completion.externalPointClassifier P r μ A) - (M.externalGroupMultiplication G S m one) - -noncomputable def externalCopyGraph (P r μ A w : ZFSet.{u}) : ZFSet.{u} := - flatCopyEmbeddingGraph (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) - (completion.externalPointClassifier P r μ A) w - -end GroundCompressionCompletion - -structure GroundExternalGeometryData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P r μ A : ZFSet.{u}) - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : Prop where - carrier_ground : completion.externalPointCarrier P r μ A ∈ M.sets - classifier_ground : completion.externalPointClassifier P r μ A ∈ M.sets - order_ground : completion.externalPointOrder P r μ A ∈ M.sets - meet_ground : completion.externalPointMeet P r μ A ∈ M.sets - action_ground : completion.externalPointAction P r μ A ∈ M.sets - meet : MeetOrderCode (completion.externalPointCarrier P r μ A) - (completion.externalPointOrder P r μ A) (completion.externalPointMeet P r μ A) - action : PosetActionCode - (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - (completion.externalPointCarrier P r μ A) - (M.externalGroupMultiplication G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - (completion.externalPointOrder P r μ A) (completion.externalPointAction P r μ A) - copies_ground : ∀ w ∈ M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one, - completion.externalCopyGraph P r μ A w ∈ M.sets - copies : ∀ w ∈ M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one, - MeetEmbeddingCode (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) - (completion.algebra.union.fields 1) (completion.externalPointOrder P r μ A) - (completion.algebra.union.fields 2) (completion.externalPointMeet P r μ A) - (completion.externalCopyGraph P r μ A w) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "U" => completion.algebra.union.fields 0 -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - -noncomputable def externalPointPresentation : - letI := group.toGroup - Presentation ((family).Node (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet)) := by - letI := group.toGroup - have hE : (sGroup).carrier ∈ M.sets := by - rw [completion.externalFamilyGroupPresentation_carrier] - exact data.group.carrier_mem - exact M.flatCopyPresentation pairing unions powers separation infinite (family) - (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) - (sGroup) (SetMembers.presentation U) - (completion.externalFlatSteps_iff group oldAction data.original pairing unions powers separation infinite - hG data.words.letters_ground) hE (completion.algebra.union.ground 0) - -theorem externalPointPresentation_carrier : - letI := group.toGroup - (data.externalPointPresentation group oldAction pairing unions powers separation infinite hG).carrier = - completion.externalPointCarrier P0 r0 μ0 A0 := by - let := group.toGroup - change equivalenceClasses (ZFSet.prod (sGroup).carrier U) - (M.finitePathClosure (ZFSet.prod (sGroup).carrier U) (completion.externalFlatSteps P0 r0 μ0 A0)) = _ - rw [completion.externalFamilyGroupPresentation_carrier] - rfl - -theorem externalPointClassifier_entry_iff : - letI := group.toGroup - let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet - let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG - ∀ (w : External (SetMembers G) (family).Letters) (x : SetMembers U) (z : (family).Node a), - ZFSet.pair (ZFSet.pair ((sGroup).encode w) (SetMembers.raw x)) (q.encode z) ∈ - completion.externalPointClassifier P0 r0 μ0 A0 ↔ ((family).copy a w).toFun x = z := by - let := group.toGroup - dsimp only - have hE : (sGroup).carrier ∈ M.sets := by - rw [completion.externalFamilyGroupPresentation_carrier] - exact data.group.carrier_mem - have entries := M.flatCopyClassifier_entry_iff pairing unions powers separation infinite (family) - (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) - (sGroup) (SetMembers.presentation U) - (completion.externalFlatSteps_iff group oldAction data.original pairing unions powers separation infinite - hG data.words.letters_ground) hE (completion.algebra.union.ground 0) - intro w x z - have entry := entries w x z - change ZFSet.pair (ZFSet.pair ((sGroup).encode w) (SetMembers.raw x)) - ((data.externalPointPresentation group oldAction pairing unions powers separation infinite hG).encode z) ∈ - equivalenceClassifier (ZFSet.prod (sGroup).carrier U) - (M.finitePathClosure (ZFSet.prod (sGroup).carrier U) (completion.externalFlatSteps P0 r0 μ0 A0)) ↔ _ at entry - rw [completion.externalFamilyGroupPresentation_carrier] at entry - exact entry - -theorem externalGeometry_entries : - letI := group.toGroup - let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet - let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG - (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ completion.externalPointOrder P0 r0 μ0 A0 ↔ - ((family).gluedOrder a).le x y) ∧ - (∀ x y z, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) (q.encode z) ∈ - completion.externalPointMeet P0 r0 μ0 A0 ↔ ((family).gluedOrder a).meet x y = z) ∧ - (∀ w x y, ZFSet.pair (ZFSet.pair ((sGroup).encode w) (q.encode x)) (q.encode y) ∈ - completion.externalPointAction P0 r0 μ0 A0 ↔ (family).translate a w x = y) ∧ - (∀ w x y, ZFSet.pair (SetMembers.raw x) (q.encode y) ∈ - completion.externalCopyGraph P0 r0 μ0 A0 ((sGroup).encode w) ↔ ((family).copy a w).toFun x = y) := by - let := group.toGroup - dsimp only - let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet - let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG - let s := sGroup - let t := SetMembers.presentation U - have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG - have sCarrier := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have qCarrier := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have multiplication := completion.externalFamilyGroupPresentation_multiplication group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - change s.carrier = M.externalGroupCarrier G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one at sCarrier - change q.carrier = completion.externalPointCarrier P0 r0 μ0 A0 at qCarrier - change M.externalGroupMultiplication G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = - (s.product s).graph s (fun p => p.1 * p.2) at multiplication - have tCarrier : t.carrier = U := rfl - have related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ completion.algebra.union.fields 1 ↔ - completion.algebra.union.meet.toSmallMeetOrder.le x y := fun _ _ => Iff.rfl - have order := flatCopy_order_iff (family) a s t q classed related - have meet := q.canonicalMeetGraph_iff ((family).gluedOrder a) order - have action := flatCopy_action_iff (family) a s t q classed - refine ⟨?_, ?_, ?_, ?_⟩ - · simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder] using order - · simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder, - GroundCompressionCompletion.externalPointMeet] using meet - · simpa only [sCarrier, tCarrier, qCarrier, ← multiplication, - GroundCompressionCompletion.externalPointAction] using action - · intro w x y - change ZFSet.pair (t.encode x) (q.encode y) ∈ flatCopyEmbeddingGraph U - (completion.externalPointCarrier P0 r0 μ0 A0) (completion.externalPointClassifier P0 r0 μ0 A0) (s.encode w) ↔ _ - rw [pair_mem_flatCopyEmbeddingGraph] - exact ⟨fun entry => (classed w x y).1 entry.2.2, - fun equal => ⟨SetMembers.raw_mem x, qCarrier ▸ q.encode_mem y, (classed w x y).2 equal⟩⟩ - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalGeometryData (hP : P0 ∈ M.sets) : - GroundExternalGeometryData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 completion := by - let := group.toGroup - let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet - let s := sGroup - let t := SetMembers.presentation U - let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG - have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG - have sCarrier := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have qCarrier := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have multiplication := completion.externalFamilyGroupPresentation_multiplication group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - change s.carrier = M.externalGroupCarrier G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one at sCarrier - change q.carrier = completion.externalPointCarrier P0 r0 μ0 A0 at qCarrier - change M.externalGroupMultiplication G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = - (s.product s).graph s (fun p => p.1 * p.2) at multiplication - have tCarrier : t.carrier = U := rfl - have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - change M.externalGroupIdentity G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = s.encode 1 at identity - have quot := data.point_quotient_ground pairing unions powers separation infinite hP hG - have hQ := quot.2.2.1 - have hClassifier := quot.2.2.2.1 - have hOrder := M.flatCopyOrderGraph_mem pairing unions powers separation data.group.carrier_mem - (completion.algebra.union.ground 0) hQ hClassifier (completion.algebra.union.ground 1) - have related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ completion.algebra.union.fields 1 ↔ - completion.algebra.union.meet.toSmallMeetOrder.le x y := fun _ _ => Iff.rfl - refine ⟨hQ, hClassifier, hOrder, M.canonicalMeetGraph_mem pairing unions powers separation hQ hOrder, - M.flatCopyActionGraph_mem pairing unions powers separation data.group.carrier_mem - (completion.algebra.union.ground 0) hQ hClassifier data.group.multiplication_mem, ?_, ?_, ?_, ?_⟩ - · have code := flatCopy_meetOrder (family) a s t q classed related - simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder, - GroundCompressionCompletion.externalPointMeet] using code - · have code := flatCopy_actionCode (family) a s t q classed related - simpa only [sCarrier, tCarrier, qCarrier, ← multiplication, ← identity, - GroundCompressionCompletion.externalPointOrder, GroundCompressionCompletion.externalPointAction] using code - · intro w hw - exact M.flatCopyEmbeddingGraph_mem pairing unions powers separation (completion.algebra.union.ground 0) - hQ hClassifier (M.transitive data.group.carrier_mem hw) - · intro w hw - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 (sCarrier.symm ▸ hw) - have code := flatCopyEmbeddingGraph_code (family) a s t q classed related - (fun x y z => (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff x y z).symm) w - simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder, - GroundCompressionCompletion.externalPointMeet, GroundCompressionCompletion.externalCopyGraph] using code - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialExternalGeometry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ I Sources Reps G m inv one T Filters, - ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, - GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion := by - dsimp only - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data⟩ := - M.exists_groundInitialExternalGeometryInputs pairing unions powers separation collection infinite choice - hP hG hr hμ hA hLabels hm hInv group action meet hτ top hC hD hrD hc hOriginal - originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember - priorSpace priorOrder priorMeet priorBirth priorHeight - exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, - data.externalGeometryData group action pairing unions powers separation infinite hG hP⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def vertexImageDomains (Requests N U Q V images : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ r ∈ Requests, ∃ y ∈ Q, ∃ j ∈ N, ∃ x ∈ U, ∃ v ∈ V, - z = ZFSet.pair r y ∧ v = ZFSet.pair (ZFSet.pair r j) x ∧ ZFSet.pair v y ∈ images) - (ZFSet.prod Requests Q) - -theorem pair_mem_vertexImageDomains (Requests N U Q V images r y : ZFSet.{u}) : - ZFSet.pair r y ∈ vertexImageDomains Requests N U Q V images ↔ - r ∈ Requests ∧ y ∈ Q ∧ ∃ j ∈ N, ∃ x ∈ U, - ZFSet.pair (ZFSet.pair r j) x ∈ V ∧ - ZFSet.pair (ZFSet.pair (ZFSet.pair r j) x) y ∈ images := by - rw [vertexImageDomains, ZFSet.mem_sep] - constructor - · rintro ⟨_, r', hr, y', hy, j, hj, x, hx, v, hv, equal, rfl, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hr, hy, j, hj, x, hx, hv, entry⟩ - · rintro ⟨hr, hy, j, hj, x, hx, hv, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hr, hy⟩, r, hr, y, hy, j, hj, x, hx, - ZFSet.pair (ZFSet.pair r j) x, hv, rfl, rfl, entry⟩ - -namespace BoundedFormula -def vertexImageDomainsEntryFormula {n} (z Requests N U Q V images : Fin n) : BoundedFormula n := - exMem Requests (exMem Q.succ (exMem N.succ.succ (exMem U.succ.succ.succ (exMem V.succ.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 3) - (.conj (orderedTripleFormula 0 4 2 1) - (pairMembershipFormula 0 3 images.succ.succ.succ.succ.succ))))))) - -theorem truth_vertexImageDomainsEntryFormula {n} (z Requests N U Q V images : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (vertexImageDomainsEntryFormula z Requests N U Q V images) env ↔ - env z ∈ vertexImageDomains (env Requests) (env N) (env U) (env Q) (env V) (env images) := by - simp only [vertexImageDomainsEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_orderedTripleFormula, truth_pairMembershipFormula, vertexImageDomains, ZFSet.mem_sep] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨r, hr, y, hy, _, _, _, _, _, _, equal, _⟩ := h - change env z = ZFSet.pair r y at equal - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hr, hy⟩ -end BoundedFormula - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (P r μ A : ZFSet.{u}) -local notation "Requests" => externalRequestCarrier I P (externalRectangles P G r μ A) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P r μ A -local notation "V" => completion.externalVertices P r μ A -local notation "E" => M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one - -noncomputable def localTileVertexImages : ZFSet.{u} := - relationCompose V (ZFSet.prod E U) Q - (indexedRelationSection V (ZFSet.prod E U) (completion.externalPlacements P r μ A) - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) - (completion.externalPointClassifier P r μ A) - -noncomputable def localTilePoints : ZFSet.{u} := - vertexImageDomains Requests (natSetCode 3) U Q V (completion.localTileVertexImages P r μ A) - -noncomputable def localTileCarrier (request : ZFSet.{u}) : ZFSet.{u} := - relationFiber Q (completion.localTilePoints P r μ A) request - -noncomputable def localTileOrder (request : ZFSet.{u}) : ZFSet.{u} := - relationFiber (completion.externalPointOrder P r μ A) - (indexedSuborderGraph Requests Q (completion.externalPointOrder P r μ A) - (completion.localTilePoints P r μ A)) request - -noncomputable def localTileMeet (request : ZFSet.{u}) : ZFSet.{u} := - relationFiber (completion.externalPointMeet P r μ A) - (indexedSubmeetGraph Requests Q (completion.externalPointMeet P r μ A) - (completion.localTilePoints P r μ A)) request - -noncomputable def localTileCarriers : ZFSet.{u} := - M.relationFiberFamily Requests Q (completion.localTilePoints P r μ A) - -noncomputable def localTileOrders : ZFSet.{u} := - M.relationFiberFamily Requests (completion.externalPointOrder P r μ A) - (indexedSuborderGraph Requests Q (completion.externalPointOrder P r μ A) - (completion.localTilePoints P r μ A)) - -noncomputable def localTileMeets : ZFSet.{u} := - M.relationFiberFamily Requests (completion.externalPointMeet P r μ A) - (indexedSubmeetGraph Requests Q (completion.externalPointMeet P r μ A) - (completion.localTilePoints P r μ A)) - -noncomputable def localTileVertexGraphs : ZFSet.{u} := - M.indexedRelationSections (ZFSet.prod Requests (natSetCode 3)) U Q - (completion.localTileVertexImages P r μ A) - -theorem localTileCarrier_subset (request : ZFSet.{u}) : completion.localTileCarrier P r μ A request ⊆ Q := - fun _ hz => (mem_relationFiber _ _ _ _).1 hz |>.1 - -end GroundCompressionCompletion - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -structure GroundExternalLocalHeightData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi : ZFSet.{u}) - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) where - family : ZFSet.{u} - family_ground : family ∈ M.sets - function : ZFSet.IsFunc (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) - (M.groundRelations (completion.externalPointCarrier P0 r0 μ0 A0) D) family - values : ∀ i h, ZFSet.pair i h ∈ family → h ∈ M.sets ∧ - IntervalHeightCode (completion.localTileCarrier P0 r0 μ0 A0 i) - (completion.localTileOrder P0 r0 μ0 A0 i) D rD lo hi h ∧ - relationImage (completion.localTileCarrier P0 r0 μ0 A0 i) D h ∈ M.sets ∧ - M.groundEmbeddable (relationImage (completion.localTileCarrier P0 r0 μ0 A0 i) D h) ZFSet.omega - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace TransitiveGround -theorem vertexImageDomains_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Requests N U Q V images : ZFSet.{u}} - (hRequests : Requests ∈ M.sets) (hN : N ∈ M.sets) (hU : U ∈ M.sets) - (hQ : Q ∈ M.sets) (hV : V ∈ M.sets) (hImages : images ∈ M.sets) : - vertexImageDomains Requests N U Q V images ∈ M.sets := by - let params := extend Requests (extend N (extend U (extend Q (extend V (extend images Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.vertexImageDomainsEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hRequests (Fin.cases hN (Fin.cases hU (Fin.cases hQ - (Fin.cases hV (Fin.cases hImages (fun j => Fin.elim0 j))))))) - (M.prod_mem pairing unions powers separation hRequests hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.vertexImageDomainsEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod Requests Q) = vertexImageDomains Requests N U Q V images := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_vertexImageDomainsEntryFormula] - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact equal ▸ selected -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "R" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 -local notation "V" => completion.externalVertices P0 r0 μ0 A0 -local notation "U" => completion.algebra.union.fields 0 -local notation "images" => completion.localTileVertexImages P0 r0 μ0 A0 -local notation "domains" => completion.localTilePoints P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG hP0 - -theorem localTileGroundInputs : - Q ∈ M.sets ∧ R ∈ M.sets ∧ μ ∈ M.sets ∧ images ∈ M.sets ∧ domains ∈ M.sets := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have flat := data.flat_relations_ground pairing unions powers separation hP0 hG - have product := M.prod_mem pairing unions powers separation data.group.carrier_mem (completion.algebra.union.ground 0) - have sectionGround := M.indexedRelationSection_mem pairing unions powers separation flat.1 product - flat.2.2.1 data.group.identity_mem - have imageGround : images ∈ M.sets := M.relationCompose_mem pairing unions powers separation - flat.1 product geometry.carrier_ground sectionGround geometry.classifier_ground - have domainGround : domains ∈ M.sets := M.vertexImageDomains_mem pairing unions powers separation - data.words.requests_ground (M.natSetCode_mem separation infinite 3) (completion.algebra.union.ground 0) - geometry.carrier_ground flat.1 imageGround - exact ⟨geometry.carrier_ground, geometry.order_ground, geometry.meet_ground, imageGround, domainGround⟩ - -theorem localTileCarriers_spec : - completion.localTileCarriers P0 r0 μ0 A0 ∈ M.sets ∧ - FunctionGraphOn Requests (completion.localTileCarriers P0 r0 μ0 A0) ∧ - ∀ i f, ZFSet.pair i f ∈ completion.localTileCarriers P0 r0 μ0 A0 ↔ - i ∈ Requests ∧ f = completion.localTileCarrier P0 r0 μ0 A0 i := by - have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 - exact ⟨M.relationFiberFamily_mem pairing unions powers separation data.words.requests_ground ground.1 ground.2.2.2.2, - ⟨_, M.relationFiberFamily_function separation data.words.requests_ground ground.1 ground.2.2.2.2⟩, - M.relationFiberFamily_entries separation data.words.requests_ground ground.1 ground.2.2.2.2⟩ - -theorem localTileOrders_spec : - completion.localTileOrders P0 r0 μ0 A0 ∈ M.sets ∧ - FunctionGraphOn Requests (completion.localTileOrders P0 r0 μ0 A0) ∧ - ∀ i f, ZFSet.pair i f ∈ completion.localTileOrders P0 r0 μ0 A0 ↔ - i ∈ Requests ∧ f = completion.localTileOrder P0 r0 μ0 A0 i := by - have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 - have indexed := M.indexedSuborderGraph_mem pairing unions powers separation data.words.requests_ground - ground.1 ground.2.1 ground.2.2.2.2 - exact ⟨M.relationFiberFamily_mem pairing unions powers separation data.words.requests_ground ground.2.1 indexed, - ⟨_, M.relationFiberFamily_function separation data.words.requests_ground ground.2.1 indexed⟩, - M.relationFiberFamily_entries separation data.words.requests_ground ground.2.1 indexed⟩ - -theorem localTileMeets_spec : - completion.localTileMeets P0 r0 μ0 A0 ∈ M.sets ∧ - FunctionGraphOn Requests (completion.localTileMeets P0 r0 μ0 A0) ∧ - ∀ i f, ZFSet.pair i f ∈ completion.localTileMeets P0 r0 μ0 A0 ↔ - i ∈ Requests ∧ f = completion.localTileMeet P0 r0 μ0 A0 i := by - have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 - have indexed := M.indexedSubmeetGraph_mem pairing unions powers separation data.words.requests_ground - ground.1 ground.2.2.1 ground.2.2.2.2 - exact ⟨M.relationFiberFamily_mem pairing unions powers separation data.words.requests_ground ground.2.2.1 indexed, - ⟨_, M.relationFiberFamily_function separation data.words.requests_ground ground.2.2.1 indexed⟩, - M.relationFiberFamily_entries separation data.words.requests_ground ground.2.2.1 indexed⟩ - -theorem localTileVertexGraphs_spec : - completion.localTileVertexGraphs P0 r0 μ0 A0 ∈ M.sets ∧ - FunctionGraphOn (ZFSet.prod Requests (natSetCode 3)) (completion.localTileVertexGraphs P0 r0 μ0 A0) ∧ - ∀ i f, ZFSet.pair i f ∈ completion.localTileVertexGraphs P0 r0 μ0 A0 ↔ - i ∈ ZFSet.prod Requests (natSetCode 3) ∧ f = indexedRelationSection U Q images i := by - have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 - have spec := M.indexedRelationSections_spec pairing unions powers separation - (M.prod_mem pairing unions powers separation data.words.requests_ground (M.natSetCode_mem separation infinite 3)) - (completion.algebra.union.ground 0) ground.1 ground.2.2.2.1 - exact ⟨spec.1, ⟨_, spec.2.1⟩, spec.2.2⟩ - -end GroundExternalGeometryInputs - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 D rD c lo hi : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite choice hG hP0 - -theorem localHeightFamily_of_witnesses - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (hlo : lo ∈ M.sets) (hhi : hi ∈ M.sets) (injection : InjectionCode D ZFSet.omega c) - (witnesses : ∀ i ∈ Requests, ∃ h ∈ M.sets, - IntervalHeightCode (completion.localTileCarrier P0 r0 μ0 A0 i) - (completion.localTileOrder P0 r0 μ0 A0 i) D rD lo hi h) : - Nonempty (GroundExternalLocalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 D rD lo hi completion) := by - have carriers := data.localTileCarriers_spec group oldAction pairing unions powers separation infinite hG hP0 - have orders := data.localTileOrders_spec group oldAction pairing unions powers separation infinite hG hP0 - have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 - have carrierValue (i : {i : ZFSet.{u} // i ∈ Requests}) : - carriers.2.1.value i = completion.localTileCarrier P0 r0 μ0 A0 i.val := - ((carriers.2.2 _ _).1 (carriers.2.1.value_entry i)).2 - have orderValue (i : {i : ZFSet.{u} // i ∈ Requests}) : - orders.2.1.value i = completion.localTileOrder P0 r0 μ0 A0 i.val := - ((orders.2.2 _ _).1 (orders.2.1.value_entry i)).2 - have bound (i : {i : ZFSet.{u} // i ∈ Requests}) : carriers.2.1.value i ⊆ Q := by - rw [carrierValue] - exact completion.localTileCarrier_subset P0 r0 μ0 A0 i.val - have localExists (i : {i : ZFSet.{u} // i ∈ Requests}) : - ∃ h ∈ M.sets, IntervalHeightCode (carriers.2.1.value i) (orders.2.1.value i) D rD lo hi h := by - rw [carrierValue, orderValue] - exact witnesses i.val i.property - obtain ⟨family, member, function, values⟩ := M.exists_intervalHeight_family - pairing unions powers separation choice carriers.2.1 orders.2.1 bound data.words.requests_ground ground.1 - carriers.1 orders.1 hD hrD hc hlo hhi (M.omega_mem separation infinite) injection localExists - refine ⟨⟨family, member, function, ?_⟩⟩ - intro i h entry - have hi := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 - have value := values ⟨i, hi⟩ h entry - rw [carrierValue, orderValue] at value - exact value - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CompressionExternalStepRealization +import OAI.SetTheory.PartitionPrinciple.Definability.IntervalHeightFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedSubstructures + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +universe u +namespace BoundedFormula +open SetFormula + +def intervalHeightCandidateFormula {n} + (Ps rs D rD lo hi i f boundPs boundRs : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ + exMem boundPs (exMem boundRs.succ + (.conj (pairMembershipFormula (lift i) 1 (lift Ps)) + (.conj (pairMembershipFormula (lift i) 0 (lift rs)) + (intervalHeightFormula 1 0 (lift D) (lift rD) (lift lo) (lift hi) (lift f))))) + +theorem truth_intervalHeightCandidateFormula {n} + (Ps rs D rD lo hi i f boundPs boundRs : Fin n) (env : Fin n → ZFSet.{u}) + (sourceBound : env boundPs = ⋃₀ ⋃₀ env Ps) + (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : + Truth (intervalHeightCandidateFormula Ps rs D rD lo hi i f boundPs boundRs) env ↔ + intervalHeightCandidate (env Ps) (env rs) (env D) (env rD) + (env lo) (env hi) (env i) (env f) := by + simp only [intervalHeightCandidateFormula, truth_exMem, Truth, + truth_pairMembershipFormula, truth_intervalHeightFormula] + change (∃ P ∈ env boundPs, ∃ r ∈ env boundRs, + ZFSet.pair (env i) P ∈ env Ps ∧ ZFSet.pair (env i) r ∈ env rs ∧ + IntervalHeightCode P r (env D) (env rD) (env lo) (env hi) (env f)) ↔ _ + rw [sourceBound, orderBound] + rfl + +def intervalHeightRelationEntryFormula {n} + (z I W Ps rs D rD lo hi boundPs boundRs : Fin n) : BoundedFormula n := + exMem I (exMem W.succ + (.conj (orderedPairFormula z.succ.succ 1 0) + (intervalHeightCandidateFormula Ps.succ.succ rs.succ.succ D.succ.succ + rD.succ.succ lo.succ.succ hi.succ.succ 1 0 boundPs.succ.succ boundRs.succ.succ))) + +theorem truth_intervalHeightRelationEntryFormula {n} + (z I W Ps rs D rD lo hi boundPs boundRs : Fin n) (env : Fin n → ZFSet.{u}) + (sourceBound : env boundPs = ⋃₀ ⋃₀ env Ps) + (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : + Truth (intervalHeightRelationEntryFormula z I W Ps rs D rD lo hi boundPs boundRs) env ↔ + ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧ + intervalHeightCandidate (env Ps) (env rs) (env D) (env rD) (env lo) (env hi) i f := by + simp only [intervalHeightRelationEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + apply exists_congr + intro i + apply and_congr_right + intro _ + apply exists_congr + intro f + apply and_congr_right + intro _ + exact and_congr Iff.rfl (truth_intervalHeightCandidateFormula Ps.succ.succ rs.succ.succ + D.succ.succ rD.succ.succ lo.succ.succ hi.succ.succ 1 0 boundPs.succ.succ boundRs.succ.succ + (extend f (extend i env)) sourceBound orderBound) + +end BoundedFormula + +namespace TransitiveGround +open SetFormula + +theorem intervalHeightRelation_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I W Ps rs D rD lo hi : ZFSet.{u}} + (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hPs : Ps ∈ M.sets) (hrs : rs ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hlo : lo ∈ M.sets) (hhi : hi ∈ M.sets) : + intervalHeightRelation I W Ps rs D rD lo hi ∈ M.sets := by + have sourceBound := M.union_mem unions (M.union_mem unions hPs) + have orderBound := M.union_mem unions (M.union_mem unions hrs) + let params := extend I (extend W (extend Ps (extend rs (extend D (extend rD + (extend lo (extend hi (extend (⋃₀ ⋃₀ Ps) (extend (⋃₀ ⋃₀ rs) Fin.elim0))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.intervalHeightRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params + (Fin.cases hI (Fin.cases hW (Fin.cases hPs (Fin.cases hrs (Fin.cases hD + (Fin.cases hrD (Fin.cases hlo (Fin.cases hhi (Fin.cases sourceBound + (Fin.cases orderBound (fun j => Fin.elim0 j))))))))))) + (M.prod_mem pairing unions powers separation hI hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.intervalHeightRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) + (extend z params)) (ZFSet.prod I W) = intervalHeightRelation I W Ps rs D rD lo hi := by + apply ZFSet.ext + intro z + rw [intervalHeightRelation, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_intervalHeightRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10 + (extend z params) rfl rfl) + exact equal ▸ selected + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u + +theorem exists_intervalHeight_family (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I B Ps rs D rD c lo hi : ZFSet.{u}} + (sources : FunctionGraphOn I Ps) (orders : FunctionGraphOn I rs) + (sourceBound : ∀ i, sources.value i ⊆ B) + (hI : I ∈ M.sets) (hB : B ∈ M.sets) (hPs : Ps ∈ M.sets) (hrs : rs ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (hlo : lo ∈ M.sets) (hhi : hi ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) + (injection : InjectionCode D ZFSet.omega c) + (witnesses : ∀ i, ∃ f ∈ M.sets, IntervalHeightCode (sources.value i) (orders.value i) D rD lo hi f) : + ∃ family ∈ M.sets, ZFSet.IsFunc I (M.groundRelations B D) family ∧ + ∀ (i : {i : ZFSet.{u} // i ∈ I}) f, ZFSet.pair i.val f ∈ family → + f ∈ M.sets ∧ IntervalHeightCode (sources.value i) (orders.value i) D rD lo hi f ∧ + relationImage (sources.value i) D f ∈ M.sets ∧ + M.groundEmbeddable (relationImage (sources.value i) D f) ZFSet.omega := by + let W := M.groundRelations B D + have hW : W ∈ M.sets := M.groundRelations_mem pairing unions powers separation hB hD + have hRelation := M.intervalHeightRelation_mem pairing unions powers separation + hI hW hPs hrs hD hrD hlo hhi + have total : ∀ i ∈ I, ∃ f ∈ W, + ZFSet.pair i f ∈ intervalHeightRelation I W Ps rs D rD lo hi := by + intro i memI + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, memI⟩ + obtain ⟨f, ground, code⟩ := witnesses j + have bound : f ⊆ ZFSet.prod B D := by + intro z hz + obtain ⟨x, hx, a, ha, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨sourceBound j hx, ha⟩ + have fW : f ∈ W := (M.mem_groundRelations B D f).2 ⟨ground, bound⟩ + exact ⟨f, fW, (pair_mem_intervalHeightRelation I W Ps rs D rD lo hi i f).2 + ⟨memI, fW, (intervalHeightCandidate_iff sources orders j f).2 code⟩⟩ + obtain ⟨family, ground, function, selected⟩ := M.uniformize_relation + pairing unions powers separation choice hI hW hRelation total + refine ⟨family, ground, function, ?_⟩ + intro i f entry + have candidate := (pair_mem_intervalHeightRelation I W Ps rs D rD lo hi i.val f).1 (selected entry) + have fGround := ((M.mem_groundRelations B D f).1 candidate.2.1).1 + have code := (intervalHeightCandidate_iff sources orders i f).1 candidate.2.2 + have rangeGround := M.relationImage_mem separation (sources.value_mem M hPs i) hD fGround + exact ⟨fGround, code, rangeGround, M.groundEmbeddable_restrict separation rangeGround hOmega + (fun _ hz => ((mem_relationImage _ _ _ _).1 hz).1) ⟨c, hc, injection⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +universe u +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +noncomputable def externalPointOrder (P r μ A : ZFSet.{u}) : ZFSet.{u} := + flatCopyOrderGraph (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) + (completion.externalPointClassifier P r μ A) (completion.algebra.union.fields 1) + +noncomputable def externalPointMeet (P r μ A : ZFSet.{u}) : ZFSet.{u} := + canonicalMeetGraph (completion.externalPointCarrier P r μ A) (completion.externalPointOrder P r μ A) + +noncomputable def externalPointAction (P r μ A : ZFSet.{u}) : ZFSet.{u} := + let S := externalChildLetters I P (externalRectangles P G r μ A) + flatCopyActionGraph (M.externalGroupCarrier G S m one) (completion.algebra.union.fields 0) + (completion.externalPointCarrier P r μ A) (completion.externalPointClassifier P r μ A) + (M.externalGroupMultiplication G S m one) + +noncomputable def externalCopyGraph (P r μ A w : ZFSet.{u}) : ZFSet.{u} := + flatCopyEmbeddingGraph (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) + (completion.externalPointClassifier P r μ A) w + +end GroundCompressionCompletion + +structure GroundExternalGeometryData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P r μ A : ZFSet.{u}) + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : Prop where + carrier_ground : completion.externalPointCarrier P r μ A ∈ M.sets + classifier_ground : completion.externalPointClassifier P r μ A ∈ M.sets + order_ground : completion.externalPointOrder P r μ A ∈ M.sets + meet_ground : completion.externalPointMeet P r μ A ∈ M.sets + action_ground : completion.externalPointAction P r μ A ∈ M.sets + meet : MeetOrderCode (completion.externalPointCarrier P r μ A) + (completion.externalPointOrder P r μ A) (completion.externalPointMeet P r μ A) + action : PosetActionCode + (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + (completion.externalPointCarrier P r μ A) + (M.externalGroupMultiplication G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + (completion.externalPointOrder P r μ A) (completion.externalPointAction P r μ A) + copies_ground : ∀ w ∈ M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one, + completion.externalCopyGraph P r μ A w ∈ M.sets + copies : ∀ w ∈ M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one, + MeetEmbeddingCode (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) + (completion.algebra.union.fields 1) (completion.externalPointOrder P r μ A) + (completion.algebra.union.fields 2) (completion.externalPointMeet P r μ A) + (completion.externalCopyGraph P r μ A w) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "U" => completion.algebra.union.fields 0 +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + +noncomputable def externalPointPresentation : + letI := group.toGroup + Presentation ((family).Node (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet)) := by + letI := group.toGroup + have hE : (sGroup).carrier ∈ M.sets := by + rw [completion.externalFamilyGroupPresentation_carrier] + exact data.group.carrier_mem + exact M.flatCopyPresentation pairing unions powers separation infinite (family) + (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) + (sGroup) (SetMembers.presentation U) + (completion.externalFlatSteps_iff group oldAction data.original pairing unions powers separation infinite + hG data.words.letters_ground) hE (completion.algebra.union.ground 0) + +theorem externalPointPresentation_carrier : + letI := group.toGroup + (data.externalPointPresentation group oldAction pairing unions powers separation infinite hG).carrier = + completion.externalPointCarrier P0 r0 μ0 A0 := by + let := group.toGroup + change equivalenceClasses (ZFSet.prod (sGroup).carrier U) + (M.finitePathClosure (ZFSet.prod (sGroup).carrier U) (completion.externalFlatSteps P0 r0 μ0 A0)) = _ + rw [completion.externalFamilyGroupPresentation_carrier] + rfl + +theorem externalPointClassifier_entry_iff : + letI := group.toGroup + let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet + let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG + ∀ (w : External (SetMembers G) (family).Letters) (x : SetMembers U) (z : (family).Node a), + ZFSet.pair (ZFSet.pair ((sGroup).encode w) (SetMembers.raw x)) (q.encode z) ∈ + completion.externalPointClassifier P0 r0 μ0 A0 ↔ ((family).copy a w).toFun x = z := by + let := group.toGroup + dsimp only + have hE : (sGroup).carrier ∈ M.sets := by + rw [completion.externalFamilyGroupPresentation_carrier] + exact data.group.carrier_mem + have entries := M.flatCopyClassifier_entry_iff pairing unions powers separation infinite (family) + (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) + (sGroup) (SetMembers.presentation U) + (completion.externalFlatSteps_iff group oldAction data.original pairing unions powers separation infinite + hG data.words.letters_ground) hE (completion.algebra.union.ground 0) + intro w x z + have entry := entries w x z + change ZFSet.pair (ZFSet.pair ((sGroup).encode w) (SetMembers.raw x)) + ((data.externalPointPresentation group oldAction pairing unions powers separation infinite hG).encode z) ∈ + equivalenceClassifier (ZFSet.prod (sGroup).carrier U) + (M.finitePathClosure (ZFSet.prod (sGroup).carrier U) (completion.externalFlatSteps P0 r0 μ0 A0)) ↔ _ at entry + rw [completion.externalFamilyGroupPresentation_carrier] at entry + exact entry + +theorem externalGeometry_entries : + letI := group.toGroup + let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet + let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG + (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ completion.externalPointOrder P0 r0 μ0 A0 ↔ + ((family).gluedOrder a).le x y) ∧ + (∀ x y z, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) (q.encode z) ∈ + completion.externalPointMeet P0 r0 μ0 A0 ↔ ((family).gluedOrder a).meet x y = z) ∧ + (∀ w x y, ZFSet.pair (ZFSet.pair ((sGroup).encode w) (q.encode x)) (q.encode y) ∈ + completion.externalPointAction P0 r0 μ0 A0 ↔ (family).translate a w x = y) ∧ + (∀ w x y, ZFSet.pair (SetMembers.raw x) (q.encode y) ∈ + completion.externalCopyGraph P0 r0 μ0 A0 ((sGroup).encode w) ↔ ((family).copy a w).toFun x = y) := by + let := group.toGroup + dsimp only + let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet + let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG + let s := sGroup + let t := SetMembers.presentation U + have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG + have sCarrier := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have qCarrier := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have multiplication := completion.externalFamilyGroupPresentation_multiplication group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + change s.carrier = M.externalGroupCarrier G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one at sCarrier + change q.carrier = completion.externalPointCarrier P0 r0 μ0 A0 at qCarrier + change M.externalGroupMultiplication G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = + (s.product s).graph s (fun p => p.1 * p.2) at multiplication + have tCarrier : t.carrier = U := rfl + have related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ completion.algebra.union.fields 1 ↔ + completion.algebra.union.meet.toSmallMeetOrder.le x y := fun _ _ => Iff.rfl + have order := flatCopy_order_iff (family) a s t q classed related + have meet := q.canonicalMeetGraph_iff ((family).gluedOrder a) order + have action := flatCopy_action_iff (family) a s t q classed + refine ⟨?_, ?_, ?_, ?_⟩ + · simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder] using order + · simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder, + GroundCompressionCompletion.externalPointMeet] using meet + · simpa only [sCarrier, tCarrier, qCarrier, ← multiplication, + GroundCompressionCompletion.externalPointAction] using action + · intro w x y + change ZFSet.pair (t.encode x) (q.encode y) ∈ flatCopyEmbeddingGraph U + (completion.externalPointCarrier P0 r0 μ0 A0) (completion.externalPointClassifier P0 r0 μ0 A0) (s.encode w) ↔ _ + rw [pair_mem_flatCopyEmbeddingGraph] + exact ⟨fun entry => (classed w x y).1 entry.2.2, + fun equal => ⟨SetMembers.raw_mem x, qCarrier ▸ q.encode_mem y, (classed w x y).2 equal⟩⟩ + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalGeometryData (hP : P0 ∈ M.sets) : + GroundExternalGeometryData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 completion := by + let := group.toGroup + let a := completion.algebra.union.action.toOrderAction group completion.algebra.union.meet + let s := sGroup + let t := SetMembers.presentation U + let q := data.externalPointPresentation group oldAction pairing unions powers separation infinite hG + have classed := data.externalPointClassifier_entry_iff group oldAction pairing unions powers separation infinite hG + have sCarrier := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have qCarrier := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have multiplication := completion.externalFamilyGroupPresentation_multiplication group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + change s.carrier = M.externalGroupCarrier G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one at sCarrier + change q.carrier = completion.externalPointCarrier P0 r0 μ0 A0 at qCarrier + change M.externalGroupMultiplication G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = + (s.product s).graph s (fun p => p.1 * p.2) at multiplication + have tCarrier : t.carrier = U := rfl + have identity := completion.externalFamilyGroupPresentation_identity group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + change M.externalGroupIdentity G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one = s.encode 1 at identity + have quot := data.point_quotient_ground pairing unions powers separation infinite hP hG + have hQ := quot.2.2.1 + have hClassifier := quot.2.2.2.1 + have hOrder := M.flatCopyOrderGraph_mem pairing unions powers separation data.group.carrier_mem + (completion.algebra.union.ground 0) hQ hClassifier (completion.algebra.union.ground 1) + have related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ completion.algebra.union.fields 1 ↔ + completion.algebra.union.meet.toSmallMeetOrder.le x y := fun _ _ => Iff.rfl + refine ⟨hQ, hClassifier, hOrder, M.canonicalMeetGraph_mem pairing unions powers separation hQ hOrder, + M.flatCopyActionGraph_mem pairing unions powers separation data.group.carrier_mem + (completion.algebra.union.ground 0) hQ hClassifier data.group.multiplication_mem, ?_, ?_, ?_, ?_⟩ + · have code := flatCopy_meetOrder (family) a s t q classed related + simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder, + GroundCompressionCompletion.externalPointMeet] using code + · have code := flatCopy_actionCode (family) a s t q classed related + simpa only [sCarrier, tCarrier, qCarrier, ← multiplication, ← identity, + GroundCompressionCompletion.externalPointOrder, GroundCompressionCompletion.externalPointAction] using code + · intro w hw + exact M.flatCopyEmbeddingGraph_mem pairing unions powers separation (completion.algebra.union.ground 0) + hQ hClassifier (M.transitive data.group.carrier_mem hw) + · intro w hw + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 (sCarrier.symm ▸ hw) + have code := flatCopyEmbeddingGraph_code (family) a s t q classed related + (fun x y z => (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff x y z).symm) w + simpa only [sCarrier, tCarrier, qCarrier, GroundCompressionCompletion.externalPointOrder, + GroundCompressionCompletion.externalPointMeet, GroundCompressionCompletion.externalCopyGraph] using code + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialExternalGeometry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ I Sources Reps G m inv one T Filters, + ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, + GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion := by + dsimp only + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data⟩ := + M.exists_groundInitialExternalGeometryInputs pairing unions powers separation collection infinite choice + hP hG hr hμ hA hLabels hm hInv group action meet hτ top hC hD hrD hc hOriginal + originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember + priorSpace priorOrder priorMeet priorBirth priorHeight + exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, + data.externalGeometryData group action pairing unions powers separation infinite hG hP⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def vertexImageDomains (Requests N U Q V images : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ r ∈ Requests, ∃ y ∈ Q, ∃ j ∈ N, ∃ x ∈ U, ∃ v ∈ V, + z = ZFSet.pair r y ∧ v = ZFSet.pair (ZFSet.pair r j) x ∧ ZFSet.pair v y ∈ images) + (ZFSet.prod Requests Q) + +theorem pair_mem_vertexImageDomains (Requests N U Q V images r y : ZFSet.{u}) : + ZFSet.pair r y ∈ vertexImageDomains Requests N U Q V images ↔ + r ∈ Requests ∧ y ∈ Q ∧ ∃ j ∈ N, ∃ x ∈ U, + ZFSet.pair (ZFSet.pair r j) x ∈ V ∧ + ZFSet.pair (ZFSet.pair (ZFSet.pair r j) x) y ∈ images := by + rw [vertexImageDomains, ZFSet.mem_sep] + constructor + · rintro ⟨_, r', hr, y', hy, j, hj, x, hx, v, hv, equal, rfl, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hr, hy, j, hj, x, hx, hv, entry⟩ + · rintro ⟨hr, hy, j, hj, x, hx, hv, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hr, hy⟩, r, hr, y, hy, j, hj, x, hx, + ZFSet.pair (ZFSet.pair r j) x, hv, rfl, rfl, entry⟩ + +namespace BoundedFormula +def vertexImageDomainsEntryFormula {n} (z Requests N U Q V images : Fin n) : BoundedFormula n := + exMem Requests (exMem Q.succ (exMem N.succ.succ (exMem U.succ.succ.succ (exMem V.succ.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 3) + (.conj (orderedTripleFormula 0 4 2 1) + (pairMembershipFormula 0 3 images.succ.succ.succ.succ.succ))))))) + +theorem truth_vertexImageDomainsEntryFormula {n} (z Requests N U Q V images : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (vertexImageDomainsEntryFormula z Requests N U Q V images) env ↔ + env z ∈ vertexImageDomains (env Requests) (env N) (env U) (env Q) (env V) (env images) := by + simp only [vertexImageDomainsEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_orderedTripleFormula, truth_pairMembershipFormula, vertexImageDomains, ZFSet.mem_sep] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨r, hr, y, hy, _, _, _, _, _, _, equal, _⟩ := h + change env z = ZFSet.pair r y at equal + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hr, hy⟩ +end BoundedFormula + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (P r μ A : ZFSet.{u}) +local notation "Requests" => externalRequestCarrier I P (externalRectangles P G r μ A) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P r μ A +local notation "V" => completion.externalVertices P r μ A +local notation "E" => M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one + +noncomputable def localTileVertexImages : ZFSet.{u} := + relationCompose V (ZFSet.prod E U) Q + (indexedRelationSection V (ZFSet.prod E U) (completion.externalPlacements P r μ A) + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) + (completion.externalPointClassifier P r μ A) + +noncomputable def localTilePoints : ZFSet.{u} := + vertexImageDomains Requests (natSetCode 3) U Q V (completion.localTileVertexImages P r μ A) + +noncomputable def localTileCarrier (request : ZFSet.{u}) : ZFSet.{u} := + relationFiber Q (completion.localTilePoints P r μ A) request + +noncomputable def localTileOrder (request : ZFSet.{u}) : ZFSet.{u} := + relationFiber (completion.externalPointOrder P r μ A) + (indexedSuborderGraph Requests Q (completion.externalPointOrder P r μ A) + (completion.localTilePoints P r μ A)) request + +noncomputable def localTileMeet (request : ZFSet.{u}) : ZFSet.{u} := + relationFiber (completion.externalPointMeet P r μ A) + (indexedSubmeetGraph Requests Q (completion.externalPointMeet P r μ A) + (completion.localTilePoints P r μ A)) request + +noncomputable def localTileCarriers : ZFSet.{u} := + M.relationFiberFamily Requests Q (completion.localTilePoints P r μ A) + +noncomputable def localTileOrders : ZFSet.{u} := + M.relationFiberFamily Requests (completion.externalPointOrder P r μ A) + (indexedSuborderGraph Requests Q (completion.externalPointOrder P r μ A) + (completion.localTilePoints P r μ A)) + +noncomputable def localTileMeets : ZFSet.{u} := + M.relationFiberFamily Requests (completion.externalPointMeet P r μ A) + (indexedSubmeetGraph Requests Q (completion.externalPointMeet P r μ A) + (completion.localTilePoints P r μ A)) + +noncomputable def localTileVertexGraphs : ZFSet.{u} := + M.indexedRelationSections (ZFSet.prod Requests (natSetCode 3)) U Q + (completion.localTileVertexImages P r μ A) + +theorem localTileCarrier_subset (request : ZFSet.{u}) : completion.localTileCarrier P r μ A request ⊆ Q := + fun _ hz => (mem_relationFiber _ _ _ _).1 hz |>.1 + +end GroundCompressionCompletion + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +structure GroundExternalLocalHeightData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi : ZFSet.{u}) + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) where + family : ZFSet.{u} + family_ground : family ∈ M.sets + function : ZFSet.IsFunc (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) + (M.groundRelations (completion.externalPointCarrier P0 r0 μ0 A0) D) family + values : ∀ i h, ZFSet.pair i h ∈ family → h ∈ M.sets ∧ + IntervalHeightCode (completion.localTileCarrier P0 r0 μ0 A0 i) + (completion.localTileOrder P0 r0 μ0 A0 i) D rD lo hi h ∧ + relationImage (completion.localTileCarrier P0 r0 μ0 A0 i) D h ∈ M.sets ∧ + M.groundEmbeddable (relationImage (completion.localTileCarrier P0 r0 μ0 A0 i) D h) ZFSet.omega + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace TransitiveGround +theorem vertexImageDomains_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Requests N U Q V images : ZFSet.{u}} + (hRequests : Requests ∈ M.sets) (hN : N ∈ M.sets) (hU : U ∈ M.sets) + (hQ : Q ∈ M.sets) (hV : V ∈ M.sets) (hImages : images ∈ M.sets) : + vertexImageDomains Requests N U Q V images ∈ M.sets := by + let params := extend Requests (extend N (extend U (extend Q (extend V (extend images Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.vertexImageDomainsEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hRequests (Fin.cases hN (Fin.cases hU (Fin.cases hQ + (Fin.cases hV (Fin.cases hImages (fun j => Fin.elim0 j))))))) + (M.prod_mem pairing unions powers separation hRequests hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.vertexImageDomainsEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod Requests Q) = vertexImageDomains Requests N U Q V images := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_vertexImageDomainsEntryFormula] + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact equal ▸ selected +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "R" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 +local notation "V" => completion.externalVertices P0 r0 μ0 A0 +local notation "U" => completion.algebra.union.fields 0 +local notation "images" => completion.localTileVertexImages P0 r0 μ0 A0 +local notation "domains" => completion.localTilePoints P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG hP0 + +theorem localTileGroundInputs : + Q ∈ M.sets ∧ R ∈ M.sets ∧ μ ∈ M.sets ∧ images ∈ M.sets ∧ domains ∈ M.sets := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have flat := data.flat_relations_ground pairing unions powers separation hP0 hG + have product := M.prod_mem pairing unions powers separation data.group.carrier_mem (completion.algebra.union.ground 0) + have sectionGround := M.indexedRelationSection_mem pairing unions powers separation flat.1 product + flat.2.2.1 data.group.identity_mem + have imageGround : images ∈ M.sets := M.relationCompose_mem pairing unions powers separation + flat.1 product geometry.carrier_ground sectionGround geometry.classifier_ground + have domainGround : domains ∈ M.sets := M.vertexImageDomains_mem pairing unions powers separation + data.words.requests_ground (M.natSetCode_mem separation infinite 3) (completion.algebra.union.ground 0) + geometry.carrier_ground flat.1 imageGround + exact ⟨geometry.carrier_ground, geometry.order_ground, geometry.meet_ground, imageGround, domainGround⟩ + +theorem localTileCarriers_spec : + completion.localTileCarriers P0 r0 μ0 A0 ∈ M.sets ∧ + FunctionGraphOn Requests (completion.localTileCarriers P0 r0 μ0 A0) ∧ + ∀ i f, ZFSet.pair i f ∈ completion.localTileCarriers P0 r0 μ0 A0 ↔ + i ∈ Requests ∧ f = completion.localTileCarrier P0 r0 μ0 A0 i := by + have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 + exact ⟨M.relationFiberFamily_mem pairing unions powers separation data.words.requests_ground ground.1 ground.2.2.2.2, + ⟨_, M.relationFiberFamily_function separation data.words.requests_ground ground.1 ground.2.2.2.2⟩, + M.relationFiberFamily_entries separation data.words.requests_ground ground.1 ground.2.2.2.2⟩ + +theorem localTileOrders_spec : + completion.localTileOrders P0 r0 μ0 A0 ∈ M.sets ∧ + FunctionGraphOn Requests (completion.localTileOrders P0 r0 μ0 A0) ∧ + ∀ i f, ZFSet.pair i f ∈ completion.localTileOrders P0 r0 μ0 A0 ↔ + i ∈ Requests ∧ f = completion.localTileOrder P0 r0 μ0 A0 i := by + have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 + have indexed := M.indexedSuborderGraph_mem pairing unions powers separation data.words.requests_ground + ground.1 ground.2.1 ground.2.2.2.2 + exact ⟨M.relationFiberFamily_mem pairing unions powers separation data.words.requests_ground ground.2.1 indexed, + ⟨_, M.relationFiberFamily_function separation data.words.requests_ground ground.2.1 indexed⟩, + M.relationFiberFamily_entries separation data.words.requests_ground ground.2.1 indexed⟩ + +theorem localTileMeets_spec : + completion.localTileMeets P0 r0 μ0 A0 ∈ M.sets ∧ + FunctionGraphOn Requests (completion.localTileMeets P0 r0 μ0 A0) ∧ + ∀ i f, ZFSet.pair i f ∈ completion.localTileMeets P0 r0 μ0 A0 ↔ + i ∈ Requests ∧ f = completion.localTileMeet P0 r0 μ0 A0 i := by + have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 + have indexed := M.indexedSubmeetGraph_mem pairing unions powers separation data.words.requests_ground + ground.1 ground.2.2.1 ground.2.2.2.2 + exact ⟨M.relationFiberFamily_mem pairing unions powers separation data.words.requests_ground ground.2.2.1 indexed, + ⟨_, M.relationFiberFamily_function separation data.words.requests_ground ground.2.2.1 indexed⟩, + M.relationFiberFamily_entries separation data.words.requests_ground ground.2.2.1 indexed⟩ + +theorem localTileVertexGraphs_spec : + completion.localTileVertexGraphs P0 r0 μ0 A0 ∈ M.sets ∧ + FunctionGraphOn (ZFSet.prod Requests (natSetCode 3)) (completion.localTileVertexGraphs P0 r0 μ0 A0) ∧ + ∀ i f, ZFSet.pair i f ∈ completion.localTileVertexGraphs P0 r0 μ0 A0 ↔ + i ∈ ZFSet.prod Requests (natSetCode 3) ∧ f = indexedRelationSection U Q images i := by + have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 + have spec := M.indexedRelationSections_spec pairing unions powers separation + (M.prod_mem pairing unions powers separation data.words.requests_ground (M.natSetCode_mem separation infinite 3)) + (completion.algebra.union.ground 0) ground.1 ground.2.2.2.1 + exact ⟨spec.1, ⟨_, spec.2.1⟩, spec.2.2⟩ + +end GroundExternalGeometryInputs + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 D rD c lo hi : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "Requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite choice hG hP0 + +theorem localHeightFamily_of_witnesses + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (hlo : lo ∈ M.sets) (hhi : hi ∈ M.sets) (injection : InjectionCode D ZFSet.omega c) + (witnesses : ∀ i ∈ Requests, ∃ h ∈ M.sets, + IntervalHeightCode (completion.localTileCarrier P0 r0 μ0 A0 i) + (completion.localTileOrder P0 r0 μ0 A0 i) D rD lo hi h) : + Nonempty (GroundExternalLocalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 D rD lo hi completion) := by + have carriers := data.localTileCarriers_spec group oldAction pairing unions powers separation infinite hG hP0 + have orders := data.localTileOrders_spec group oldAction pairing unions powers separation infinite hG hP0 + have ground := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 + have carrierValue (i : {i : ZFSet.{u} // i ∈ Requests}) : + carriers.2.1.value i = completion.localTileCarrier P0 r0 μ0 A0 i.val := + ((carriers.2.2 _ _).1 (carriers.2.1.value_entry i)).2 + have orderValue (i : {i : ZFSet.{u} // i ∈ Requests}) : + orders.2.1.value i = completion.localTileOrder P0 r0 μ0 A0 i.val := + ((orders.2.2 _ _).1 (orders.2.1.value_entry i)).2 + have bound (i : {i : ZFSet.{u} // i ∈ Requests}) : carriers.2.1.value i ⊆ Q := by + rw [carrierValue] + exact completion.localTileCarrier_subset P0 r0 μ0 A0 i.val + have localExists (i : {i : ZFSet.{u} // i ∈ Requests}) : + ∃ h ∈ M.sets, IntervalHeightCode (carriers.2.1.value i) (orders.2.1.value i) D rD lo hi h := by + rw [carrierValue, orderValue] + exact witnesses i.val i.property + obtain ⟨family, member, function, values⟩ := M.exists_intervalHeight_family + pairing unions powers separation choice carriers.2.1 orders.2.1 bound data.words.requests_ground ground.1 + carriers.1 orders.1 hD hrD hc hlo hhi (M.omega_mem separation infinite) injection localExists + refine ⟨⟨family, member, function, ?_⟩⟩ + intro i h entry + have hi := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 + have value := values ⟨i, hi⟩ h entry + rw [carrierValue, orderValue] at value + exact value + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalMainTransition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalMainTransition.lean index 708adcb0a8caa80d1321ec241a3bb68aaed87145..0cee06666646ed7cd04ca15288bbb75f4dc08d89 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalMainTransition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalMainTransition.lean @@ -1,156 +1,156 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialExternalChronology - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -namespace GroundCompressionBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T base old : ZFSet.{u}} -variable {union : GroundCompressionUnionData M initial I Sources Reps G m one T} - -theorem original_entry_iff (births : GroundCompressionBirthData M initial I Sources Reps G m one T union base old) - {x t : ZFSet.{u}} (hx : x ∈ initial.D) : - ZFSet.pair x t ∈ births.birth ↔ ZFSet.pair x t ∈ old := by - have restriction : ZFSet.pair x t ∈ births.birth ↔ - ZFSet.pair x t ∈ graphRestriction initial.D births.birth := by - rw [pair_mem_graphRestriction] - exact ⟨fun entry => ⟨entry, hx⟩, And.left⟩ - exact restriction.trans (congrArg (fun f => ZFSet.pair x t ∈ f) births.original).to_iff - -end GroundCompressionBirthData - -namespace GroundExternalHeightData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi original : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (compressionHeights : GroundCompressionHeightData M initial I Sources Reps G m one T - completion.algebra.union P0 C D rD original) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi compressionHeights.height completion) - -theorem preserves_original {x y z : ZFSet.{u}} - (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : - ZFSet.pair y z ∈ heights.height ↔ ZFSet.pair x z ∈ original := by - obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image - exact (heights.preserves_seed x y z copied).trans (compressionHeights.original_entries x hx z) - -theorem bounded_preserves_original - (bounded : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi compressionHeights.height completion heights) - {x y z : ZFSet.{u}} - (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : - ZFSet.pair y z ∈ heights.boundedHeight ↔ ZFSet.pair x z ∈ original := by - obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image - exact (bounded.preserves_seed x y z copied).trans (compressionHeights.original_entries x hx z) - -end GroundExternalHeightData - -namespace GroundExternalBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 base old : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (compressionBirths : GroundCompressionBirthData M initial I Sources Reps G m one T - completion.algebra.union base old) -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 compressionBirths.limit compressionBirths.birth completion) - -theorem preserves_original (initialDomain : initial.D = P0) {x y t : ZFSet.{u}} - (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : - ZFSet.pair y t ∈ births.birth ↔ ZFSet.pair x t ∈ old := by - obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image - rw [← initialDomain] at hx - exact (births.preserves_seed x y t copied).trans (compressionBirths.original_entry_iff hx) - -theorem bounded_preserves_original - (bounded : GroundBoundedExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 compressionBirths.limit compressionBirths.birth completion births) - (initialDomain : initial.D = P0) {x y t : ZFSet.{u}} - (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : - ZFSet.pair y t ∈ births.boundedBirth ↔ ZFSet.pair x t ∈ old := by - obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image - rw [← initialDomain] at hx - exact (bounded.preserves_seed x y t copied).trans (compressionBirths.original_entry_iff hx) - -end GroundExternalBirthData -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (source : GroundMainStage M C D rD) -variable {initial : RecursiveStateData.{u}} {I Sources Reps T Filters lo hi : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps source.actors - source.multiplication source.identity T source.top} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps source.actors - source.multiplication source.inverse source.identity T source.top source.carrier source.order - source.meetGraph source.action completion) -variable (origin : GroundCompressionOrigin M initial source.carrier source.order source.meetGraph source.action - source.top I Sources Reps source.actors source.multiplication source.inverse source.identity T Filters) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) -variable (initialDomain : initial.D = source.carrier) (initialOrder : initial.rD = source.order) -variable (compressionHeights : GroundCompressionHeightData M initial I Sources Reps source.actors - source.multiplication source.identity T completion.algebra.union source.carrier C D rD source.height) -variable (heights : GroundExternalHeightData M initial I Sources Reps source.actors source.multiplication - source.identity T source.top source.carrier source.order source.meetGraph source.action - C D rD lo hi compressionHeights.height completion) -variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps source.actors - source.multiplication source.identity T source.top source.carrier source.order source.meetGraph source.action - C D rD lo hi compressionHeights.height completion heights) -variable {b' : ZFSet.{u}} (image : ZFSet.pair source.bottom b' ∈ - completion.externalOriginalEmbedding source.carrier source.order source.meetGraph source.action) - -noncomputable def externalTransition : - GroundMainTransition source - (data.externalMainStage origin source.group_code source.action_code pairing unions powers separation infinite - hI hSources hReps source.actors_ground hT source.carrier_ground initialDomain initialOrder - heights boundedHeights source.columns_ground source.coordinates_ground source.coordinate_order_ground - source.least image) where - points := completion.externalOriginalEmbedding source.carrier source.order source.meetGraph source.action - actors := M.externalOldInclusion source.actors - (externalChildLetters I source.carrier - (externalRectangles source.carrier source.actors source.order source.meetGraph source.action)) - source.multiplication source.identity - points_ground := data.externalOriginalEmbedding_mem source.group_code source.action_code - pairing unions powers separation infinite source.actors_ground source.carrier_ground - actors_ground := data.old_inclusion_ground - point_embedding := data.externalOriginalEmbedding_code source.group_code source.action_code - pairing unions powers separation infinite source.actors_ground source.carrier_ground - order_iff := fun _ _ _ _ first second => data.externalOriginalEmbedding_order_iff - source.group_code source.action_code pairing unions powers separation infinite - source.actors_ground source.carrier_ground first second - group_embedding := M.externalOldInclusion_groupEmbedding pairing unions powers separation infinite - source.group_code source.actors_ground data.words.letters_ground - equivariant := fun _ _ _ _ _ _ actor first second acted => data.externalOriginalEmbedding_equivariant - source.group_code source.action_code pairing unions powers separation infinite - source.actors_ground source.carrier_ground actor first second acted - bottom := image - height := fun _ _ _ entry => heights.bounded_preserves_original compressionHeights boundedHeights entry - agreement := fun _ _ _ _ _ _ first second point agree => data.externalOriginalEmbedding_agreement - source.group_code source.action_code pairing unions powers separation infinite - source.actors_ground source.carrier_ground first second point agree - -theorem externalTransition_graphs : - let transition := source.externalTransition data origin pairing unions powers separation infinite - hI hSources hReps hT initialDomain initialOrder compressionHeights heights boundedHeights image - transition.points = completion.externalOriginalEmbedding source.carrier source.order source.meetGraph source.action ∧ - transition.actors = M.externalOldInclusion source.actors - (externalChildLetters I source.carrier - (externalRectangles source.carrier source.actors source.order source.meetGraph source.action)) - source.multiplication source.identity := ⟨rfl, rfl⟩ - -end PartitionPilot.Forcing.GroundMainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialExternalChronology + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +namespace GroundCompressionBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T base old : ZFSet.{u}} +variable {union : GroundCompressionUnionData M initial I Sources Reps G m one T} + +theorem original_entry_iff (births : GroundCompressionBirthData M initial I Sources Reps G m one T union base old) + {x t : ZFSet.{u}} (hx : x ∈ initial.D) : + ZFSet.pair x t ∈ births.birth ↔ ZFSet.pair x t ∈ old := by + have restriction : ZFSet.pair x t ∈ births.birth ↔ + ZFSet.pair x t ∈ graphRestriction initial.D births.birth := by + rw [pair_mem_graphRestriction] + exact ⟨fun entry => ⟨entry, hx⟩, And.left⟩ + exact restriction.trans (congrArg (fun f => ZFSet.pair x t ∈ f) births.original).to_iff + +end GroundCompressionBirthData + +namespace GroundExternalHeightData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi original : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (compressionHeights : GroundCompressionHeightData M initial I Sources Reps G m one T + completion.algebra.union P0 C D rD original) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi compressionHeights.height completion) + +theorem preserves_original {x y z : ZFSet.{u}} + (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : + ZFSet.pair y z ∈ heights.height ↔ ZFSet.pair x z ∈ original := by + obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image + exact (heights.preserves_seed x y z copied).trans (compressionHeights.original_entries x hx z) + +theorem bounded_preserves_original + (bounded : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi compressionHeights.height completion heights) + {x y z : ZFSet.{u}} + (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : + ZFSet.pair y z ∈ heights.boundedHeight ↔ ZFSet.pair x z ∈ original := by + obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image + exact (bounded.preserves_seed x y z copied).trans (compressionHeights.original_entries x hx z) + +end GroundExternalHeightData + +namespace GroundExternalBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 base old : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (compressionBirths : GroundCompressionBirthData M initial I Sources Reps G m one T + completion.algebra.union base old) +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 compressionBirths.limit compressionBirths.birth completion) + +theorem preserves_original (initialDomain : initial.D = P0) {x y t : ZFSet.{u}} + (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : + ZFSet.pair y t ∈ births.birth ↔ ZFSet.pair x t ∈ old := by + obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image + rw [← initialDomain] at hx + exact (births.preserves_seed x y t copied).trans (compressionBirths.original_entry_iff hx) + +theorem bounded_preserves_original + (bounded : GroundBoundedExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 compressionBirths.limit compressionBirths.birth completion births) + (initialDomain : initial.D = P0) {x y t : ZFSet.{u}} + (image : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) : + ZFSet.pair y t ∈ births.boundedBirth ↔ ZFSet.pair x t ∈ old := by + obtain ⟨copied, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).1 image + rw [← initialDomain] at hx + exact (bounded.preserves_seed x y t copied).trans (compressionBirths.original_entry_iff hx) + +end GroundExternalBirthData +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (source : GroundMainStage M C D rD) +variable {initial : RecursiveStateData.{u}} {I Sources Reps T Filters lo hi : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps source.actors + source.multiplication source.identity T source.top} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps source.actors + source.multiplication source.inverse source.identity T source.top source.carrier source.order + source.meetGraph source.action completion) +variable (origin : GroundCompressionOrigin M initial source.carrier source.order source.meetGraph source.action + source.top I Sources Reps source.actors source.multiplication source.inverse source.identity T Filters) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) +variable (initialDomain : initial.D = source.carrier) (initialOrder : initial.rD = source.order) +variable (compressionHeights : GroundCompressionHeightData M initial I Sources Reps source.actors + source.multiplication source.identity T completion.algebra.union source.carrier C D rD source.height) +variable (heights : GroundExternalHeightData M initial I Sources Reps source.actors source.multiplication + source.identity T source.top source.carrier source.order source.meetGraph source.action + C D rD lo hi compressionHeights.height completion) +variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps source.actors + source.multiplication source.identity T source.top source.carrier source.order source.meetGraph source.action + C D rD lo hi compressionHeights.height completion heights) +variable {b' : ZFSet.{u}} (image : ZFSet.pair source.bottom b' ∈ + completion.externalOriginalEmbedding source.carrier source.order source.meetGraph source.action) + +noncomputable def externalTransition : + GroundMainTransition source + (data.externalMainStage origin source.group_code source.action_code pairing unions powers separation infinite + hI hSources hReps source.actors_ground hT source.carrier_ground initialDomain initialOrder + heights boundedHeights source.columns_ground source.coordinates_ground source.coordinate_order_ground + source.least image) where + points := completion.externalOriginalEmbedding source.carrier source.order source.meetGraph source.action + actors := M.externalOldInclusion source.actors + (externalChildLetters I source.carrier + (externalRectangles source.carrier source.actors source.order source.meetGraph source.action)) + source.multiplication source.identity + points_ground := data.externalOriginalEmbedding_mem source.group_code source.action_code + pairing unions powers separation infinite source.actors_ground source.carrier_ground + actors_ground := data.old_inclusion_ground + point_embedding := data.externalOriginalEmbedding_code source.group_code source.action_code + pairing unions powers separation infinite source.actors_ground source.carrier_ground + order_iff := fun _ _ _ _ first second => data.externalOriginalEmbedding_order_iff + source.group_code source.action_code pairing unions powers separation infinite + source.actors_ground source.carrier_ground first second + group_embedding := M.externalOldInclusion_groupEmbedding pairing unions powers separation infinite + source.group_code source.actors_ground data.words.letters_ground + equivariant := fun _ _ _ _ _ _ actor first second acted => data.externalOriginalEmbedding_equivariant + source.group_code source.action_code pairing unions powers separation infinite + source.actors_ground source.carrier_ground actor first second acted + bottom := image + height := fun _ _ _ entry => heights.bounded_preserves_original compressionHeights boundedHeights entry + agreement := fun _ _ _ _ _ _ first second point agree => data.externalOriginalEmbedding_agreement + source.group_code source.action_code pairing unions powers separation infinite + source.actors_ground source.carrier_ground first second point agree + +theorem externalTransition_graphs : + let transition := source.externalTransition data origin pairing unions powers separation infinite + hI hSources hReps hT initialDomain initialOrder compressionHeights heights boundedHeights image + transition.points = completion.externalOriginalEmbedding source.carrier source.order source.meetGraph source.action ∧ + transition.actors = M.externalOldInclusion source.actors + (externalChildLetters I source.carrier + (externalRectangles source.carrier source.actors source.order source.meetGraph source.action)) + source.multiplication source.identity := ⟨rfl, rfl⟩ + +end PartitionPilot.Forcing.GroundMainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalProfilePreservation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalProfilePreservation.lean index d22f224f382f85186e9f618d4155e46019ed8ba5..7730799fc1d997dd5b099944b4a3e7ee9188834e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalProfilePreservation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalProfilePreservation.lean @@ -1,358 +1,358 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedExternalBirths - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace MeetEmbeddingCode -universe u -variable {P U Q rP rU rQ μP μU μQ e : ZFSet.{u}} -variable (code : MeetEmbeddingCode U Q rU rQ μU μQ e) -include code - -theorem restrictSource (subset : P ⊆ U) - (order : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ rP → ZFSet.pair x y ∈ rU) - (meet : ∀ x ∈ P, ∀ y ∈ P, ∀ z, ZFSet.pair (ZFSet.pair x y) z ∈ μP → - ZFSet.pair (ZFSet.pair x y) z ∈ μU) : - MeetEmbeddingCode P Q rP rQ μP μQ (graphRestriction P e) := by - refine ⟨?_, ?_, ?_⟩ - · rw [graphRestriction_eq_sep code.injection.function] - exact code.injection.restrict subset - · intro x y x' y' lower first second - obtain ⟨first, hx⟩ := pair_mem_graphRestriction.1 first - obtain ⟨second, hy⟩ := pair_mem_graphRestriction.1 second - exact code.monotone x y x' y' (order x hx y hy lower) first second - · intro x y z x' y' z' entry first second third - obtain ⟨first, hx⟩ := pair_mem_graphRestriction.1 first - obtain ⟨second, hy⟩ := pair_mem_graphRestriction.1 second - have third := (pair_mem_graphRestriction.1 third).1 - exact code.map_meet x y z x' y' z' (meet x hx y hy z entry) first second third - -end MeetEmbeddingCode - -section -open SetFormula -universe u - -namespace AttachmentBatchInputs -variable {P r μ J Qs rs μs As Es Fs Ss : ZFSet.{u}} - -theorem batch_bottom (d : AttachmentBatchInputs P r μ J Qs rs μs As Es Fs Ss) - {b : ZFSet.{u}} (hb : b ∈ P) (least : ∀ x ∈ P, ZFSet.pair b x ∈ r) : - b ∈ d.batchCarrier ∧ ∀ x ∈ d.batchCarrier, ZFSet.pair b x ∈ d.batchOrder := - ⟨old_mem_taggedExtension hb, d.coding.least_preserved hb least⟩ - -end AttachmentBatchInputs - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem canonical_iterate_bottom {b : ZFSet.{u}} (hb : b ∈ state.data.D) - (least : ∀ x ∈ state.data.D, ZFSet.pair b x ∈ state.data.rD) (n : Nat) : - let current := state.data.iterate M I Sources Reps G T n - b ∈ current.D ∧ ∀ x ∈ current.D, ZFSet.pair b x ∈ current.rD := by - induction n with - | zero => exact ⟨hb, least⟩ - | succ n ih => - change b ∈ (state.data.iterate M I Sources Reps G T n).currentCarrier ∧ - ∀ x ∈ (state.data.iterate M I Sources Reps G T n).currentCarrier, - ZFSet.pair b x ∈ (state.data.iterate M I Sources Reps G T n).currentOrder - obtain ⟨current, equal⟩ := state.canonical_iterate_valid - pairing unions powers separation hI hSources hReps hG hT n - rw [← equal] at ih ⊢ - exact current.batch.batch_bottom ih.1 ih.2 - -theorem union_bottom - (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) - {b : ZFSet.{u}} (hb : b ∈ state.data.D) - (least : ∀ x ∈ state.data.D, ZFSet.pair b x ∈ state.data.rD) : - b ∈ data.fields 0 ∧ ∀ x ∈ data.fields 0, ZFSet.pair b x ∈ data.fields 1 := by - have carrier : NatUnionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) (data.fields 0) := - data.fieldUnion 0 - have order : NatUnionCode (fun n => (state.data.iterate M I Sources Reps G T n).rD) (data.fields 1) := - data.fieldUnion 1 - refine ⟨carrier.subset 0 hb, ?_⟩ - intro x hx - obtain ⟨n, hn⟩ := (carrier x).1 hx - exact order.subset n ((state.canonical_iterate_bottom pairing unions powers separation - hI hSources hReps hG hT hb least n).2 x hn) - -end GroundCompressionState - -namespace GroundCompressionOrigin -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) - -include origin in -theorem union_bottom - (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) - {b : ZFSet.{u}} (hb : b ∈ P0) (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) : - b ∈ data.fields 0 ∧ ∀ x ∈ data.fields 0, ZFSet.pair b x ∈ data.fields 1 := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - apply state.union_bottom pairing unions powers separation hI hSources hReps hG hT data - · simpa only [initialDomain] using hb - · simpa only [initialDomain, initialOrder] using least - -theorem initial_union_bottom {Labels : ZFSet.{u}} - (origin : GroundCompressionOrigin M (M.initialCompressionData P0 G r0 μ0 A0 Labels) - P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) - (data : GroundCompressionUnionData M (M.initialCompressionData P0 G r0 μ0 A0 Labels) - I Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {b : ZFSet.{u}} (hb : b ∈ P0) (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) : - b ∈ data.fields 0 ∧ ∀ x ∈ data.fields 0, ZFSet.pair b x ∈ data.fields 1 := - origin.union_bottom data pairing unions powers separation hI hSources hReps hG hT rfl rfl hb least - -end GroundCompressionOrigin -end - -section -universe u -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -noncomputable def externalOriginalEmbedding (P r μ A : ZFSet.{u}) : ZFSet.{u} := - graphRestriction P (completion.externalCopyGraph P r μ A - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) - -theorem externalOriginalEmbedding_entry_iff (P r μ A x y : ZFSet.{u}) : - ZFSet.pair x y ∈ completion.externalOriginalEmbedding P r μ A ↔ - ZFSet.pair x y ∈ completion.externalCopyGraph P r μ A - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) ∧ x ∈ P := - pair_mem_graphRestriction - -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -open SetFormula -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P0 ∈ M.sets) -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "originalGraph" => completion.externalOriginalEmbedding P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG hP - -theorem externalOriginalEmbedding_mem : originalGraph ∈ M.sets := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - exact M.graphRestriction_mem unions separation hP (geometry.copies_ground _ data.group.group_code.identity_mem) - -theorem externalOriginalEmbedding_code : - MeetEmbeddingCode P0 (completion.externalBoundedCarrier P0 r0 μ0 A0) - r0 (completion.externalBoundedOrder P0 r0 μ0 A0) μ0 (completion.externalBoundedMeet P0 r0 μ0 A0) - originalGraph := by - have geometry := data.externalBoundedGeometryData group oldAction pairing unions powers separation infinite hG hP - exact (geometry.copies _ data.group.group_code.identity_mem).toMeetEmbeddingCode.restrictSource - data.original.subset (fun x hx y hy => (data.original.order x hx y hy).2) - (fun x hx y hy z => (data.original.meet x hx y hy z).2) - -theorem externalOriginalEmbedding_order_iff {x y x' y' : ZFSet.{u}} - (first : ZFSet.pair x x' ∈ originalGraph) (second : ZFSet.pair y y' ∈ originalGraph) : - ZFSet.pair x' y' ∈ completion.externalBoundedOrder P0 r0 μ0 A0 ↔ ZFSet.pair x y ∈ r0 := by - obtain ⟨first, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x x').1 first - obtain ⟨second, hy⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 y y').1 second - have geometry := data.externalBoundedGeometryData group oldAction pairing unions powers separation infinite hG hP - exact ((geometry.copies _ data.group.group_code.identity_mem).order_iff first second).trans - (data.original.order x hx y hy) - -theorem externalOriginalEmbedding_equivariant {g g' x y x' y' : ZFSet.{u}} - (actor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) - (first : ZFSet.pair x x' ∈ originalGraph) (second : ZFSet.pair y y' ∈ originalGraph) - (acted : ZFSet.pair (ZFSet.pair g x) y ∈ A0) : - ZFSet.pair (ZFSet.pair g' x') y' ∈ completion.externalBoundedAction P0 r0 μ0 A0 := by - obtain ⟨first, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x x').1 first - have second := ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 y y').1 second).1 - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - have hx' := (ZFSet.pair_mem_prod.1 - ((geometry.copies _ data.group.group_code.identity_mem).injection.function.1 first)).2 - exact (fixedTopAction_old_iff hx').2 (data.externalIdentityCopy_equivariant group oldAction - pairing unions powers separation infinite hG actor first second ((data.original.action g x hx y).2 acted)) - -theorem externalOriginalEmbedding_agreement {g h g' h' v v' : ZFSet.{u}} - (firstActor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) - (secondActor : ZFSet.pair h h' ∈ M.externalOldInclusion G letters m one) - (image : ZFSet.pair v v' ∈ originalGraph) (agree : ActionAgreementBelow P0 r0 A0 g h v) : - ActionAgreementBelow (completion.externalBoundedCarrier P0 r0 μ0 A0) - (completion.externalBoundedOrder P0 r0 μ0 A0) (completion.externalBoundedAction P0 r0 μ0 A0) g' h' v' := by - obtain ⟨image, hv⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 v v').1 image - exact data.externalBoundedOriginal_agreement group oldAction pairing unions powers separation infinite hG hP - firstActor secondActor hv image agree - -end GroundExternalGeometryInputs -end - -namespace GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 Filters : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) -local notation "B" => completion.externalBoundedCarrier P0 r0 μ0 A0 -local notation "rB" => completion.externalBoundedOrder P0 r0 μ0 A0 -local notation "embedding" => completion.externalOriginalEmbedding P0 r0 μ0 A0 -include data origin group action pairing unions powers separation infinite hI hSources hReps hG hT hP0 initialDomain initialOrder - -theorem externalOriginalEmbedding_bottom {b b' : ZFSet.{u}} - (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) - (image : ZFSet.pair b b' ∈ embedding) : - b' ∈ B ∧ ∀ y ∈ B, ZFSet.pair b' y ∈ rB := by - obtain ⟨copied, hb⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 b b').1 image - have bottom := origin.union_bottom completion.algebra.union pairing unions powers separation - hI hSources hReps hG hT initialDomain initialOrder hb least - have code := data.externalOriginalEmbedding_code group action pairing unions powers separation infinite hG hP0 - exact ⟨(ZFSet.pair_mem_prod.1 (code.injection.function.1 image)).2, - data.externalBoundedCopy_bottom group action pairing unions powers separation infinite hG hP0 - data.group.group_code.identity_mem bottom.2 copied⟩ - -theorem exists_externalOriginal_bottom {b : ZFSet.{u}} (hb : b ∈ P0) - (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) : - ∃ b' ∈ M.sets, ZFSet.pair b b' ∈ embedding ∧ b' ∈ B ∧ - ∀ y ∈ B, ZFSet.pair b' y ∈ rB := by - have code := data.externalOriginalEmbedding_code group action pairing unions powers separation infinite hG hP0 - obtain ⟨b', image, _⟩ := code.injection.function.2 b hb - have bottom := data.externalOriginalEmbedding_bottom origin group action pairing unions powers separation infinite - hI hSources hReps hG hT hP0 initialDomain initialOrder least image - have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP0 - exact ⟨b', M.transitive geometry.carrier_ground bottom.1, image, bottom⟩ - -end GroundExternalGeometryInputs - -namespace GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) -include data group action pairing unions powers separation infinite hG hP - -theorem externalOriginal_image_mem {x y : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P r μ A) : - y ∈ completion.externalPointCarrier P r μ A := by - have copied := ((completion.externalOriginalEmbedding_entry_iff P r μ A x y).1 entry).1 - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP - exact (ZFSet.pair_mem_prod.1 - ((geometry.copies _ data.group.group_code.identity_mem).injection.function.1 copied)).2 - -theorem externalOriginal_top_strict {x y : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P r μ A) : - ZFSet.pair y (completion.externalPointCarrier P r μ A) ∈ completion.externalBoundedOrder P r μ A ∧ - ZFSet.pair (completion.externalPointCarrier P r μ A) y ∉ completion.externalBoundedOrder P r μ A := by - have hy := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP entry - have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP - exact ⟨geometry.greatest y (ZFSet.mem_insert_of_mem _ hy), geometry.strict_top y hy⟩ - -theorem externalOriginal_top_not_image (x : ZFSet.{u}) : - ZFSet.pair x (completion.externalPointCarrier P r μ A) ∉ completion.externalOriginalEmbedding P r μ A := by - intro entry - exact ZFSet.mem_irrefl _ (data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP entry) - -end GroundExternalGeometryInputs - -open SetFormula -universe u - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -theorem externalOriginal_filterImage_eq (P r μ A B : ZFSet.{u}) {F : ZFSet.{u}} - (subset : F ⊆ P) : - relationImage F B (completion.externalOriginalEmbedding P r μ A) = - relationImage F B (completion.externalCopyGraph P r μ A - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) := by - apply ZFSet.ext - intro y - rw [mem_relationImage, mem_relationImage] - constructor - · rintro ⟨hy, x, hx, entry⟩ - exact ⟨hy, x, hx, ((completion.externalOriginalEmbedding_entry_iff P r μ A x y).1 entry).1⟩ - · rintro ⟨hy, x, hx, entry⟩ - exact ⟨hy, x, hx, (completion.externalOriginalEmbedding_entry_iff P r μ A x y).2 ⟨entry, subset hx⟩⟩ - -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P0 ∈ M.sets) -include data group oldAction pairing unions powers separation infinite hG hP -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalBoundedCarrier P0 r0 μ0 A0 -local notation "originalGraph" => completion.externalOriginalEmbedding P0 r0 μ0 A0 - -theorem externalBounded_original_capProfile - {c e K F c' e' K' : ZFSet.{u}} - (profile : CodedCapProfile U (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) c e K F) - (subset : F ⊆ P0) - (imageC : ZFSet.pair c c' ∈ originalGraph) - (imageE : ZFSet.pair e e' ∈ originalGraph) - (imageK : ZFSet.pair K K' ∈ originalGraph) : - CodedCapProfile B (completion.externalBoundedOrder P0 r0 μ0 A0) - (completion.externalBoundedMeet P0 r0 μ0 A0) c' e' K' - (relationImage F B originalGraph) := by - have geometry := data.externalBoundedGeometryData group oldAction - pairing unions powers separation infinite hG hP - rw [completion.externalOriginal_filterImage_eq P0 r0 μ0 A0 B subset] - exact (geometry.copies _ data.group.group_code.identity_mem).capProfile - completion.algebra.union.meet geometry.meet completion.top_mem completion.top profile - ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 c c').1 imageC).1 - ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 e e').1 imageE).1 - ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 K K').1 imageK).1 - -end GroundExternalGeometryInputs - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedExternalBirths + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace MeetEmbeddingCode +universe u +variable {P U Q rP rU rQ μP μU μQ e : ZFSet.{u}} +variable (code : MeetEmbeddingCode U Q rU rQ μU μQ e) +include code + +theorem restrictSource (subset : P ⊆ U) + (order : ∀ x ∈ P, ∀ y ∈ P, ZFSet.pair x y ∈ rP → ZFSet.pair x y ∈ rU) + (meet : ∀ x ∈ P, ∀ y ∈ P, ∀ z, ZFSet.pair (ZFSet.pair x y) z ∈ μP → + ZFSet.pair (ZFSet.pair x y) z ∈ μU) : + MeetEmbeddingCode P Q rP rQ μP μQ (graphRestriction P e) := by + refine ⟨?_, ?_, ?_⟩ + · rw [graphRestriction_eq_sep code.injection.function] + exact code.injection.restrict subset + · intro x y x' y' lower first second + obtain ⟨first, hx⟩ := pair_mem_graphRestriction.1 first + obtain ⟨second, hy⟩ := pair_mem_graphRestriction.1 second + exact code.monotone x y x' y' (order x hx y hy lower) first second + · intro x y z x' y' z' entry first second third + obtain ⟨first, hx⟩ := pair_mem_graphRestriction.1 first + obtain ⟨second, hy⟩ := pair_mem_graphRestriction.1 second + have third := (pair_mem_graphRestriction.1 third).1 + exact code.map_meet x y z x' y' z' (meet x hx y hy z entry) first second third + +end MeetEmbeddingCode + +section +open SetFormula +universe u + +namespace AttachmentBatchInputs +variable {P r μ J Qs rs μs As Es Fs Ss : ZFSet.{u}} + +theorem batch_bottom (d : AttachmentBatchInputs P r μ J Qs rs μs As Es Fs Ss) + {b : ZFSet.{u}} (hb : b ∈ P) (least : ∀ x ∈ P, ZFSet.pair b x ∈ r) : + b ∈ d.batchCarrier ∧ ∀ x ∈ d.batchCarrier, ZFSet.pair b x ∈ d.batchOrder := + ⟨old_mem_taggedExtension hb, d.coding.least_preserved hb least⟩ + +end AttachmentBatchInputs + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem canonical_iterate_bottom {b : ZFSet.{u}} (hb : b ∈ state.data.D) + (least : ∀ x ∈ state.data.D, ZFSet.pair b x ∈ state.data.rD) (n : Nat) : + let current := state.data.iterate M I Sources Reps G T n + b ∈ current.D ∧ ∀ x ∈ current.D, ZFSet.pair b x ∈ current.rD := by + induction n with + | zero => exact ⟨hb, least⟩ + | succ n ih => + change b ∈ (state.data.iterate M I Sources Reps G T n).currentCarrier ∧ + ∀ x ∈ (state.data.iterate M I Sources Reps G T n).currentCarrier, + ZFSet.pair b x ∈ (state.data.iterate M I Sources Reps G T n).currentOrder + obtain ⟨current, equal⟩ := state.canonical_iterate_valid + pairing unions powers separation hI hSources hReps hG hT n + rw [← equal] at ih ⊢ + exact current.batch.batch_bottom ih.1 ih.2 + +theorem union_bottom + (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) + {b : ZFSet.{u}} (hb : b ∈ state.data.D) + (least : ∀ x ∈ state.data.D, ZFSet.pair b x ∈ state.data.rD) : + b ∈ data.fields 0 ∧ ∀ x ∈ data.fields 0, ZFSet.pair b x ∈ data.fields 1 := by + have carrier : NatUnionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) (data.fields 0) := + data.fieldUnion 0 + have order : NatUnionCode (fun n => (state.data.iterate M I Sources Reps G T n).rD) (data.fields 1) := + data.fieldUnion 1 + refine ⟨carrier.subset 0 hb, ?_⟩ + intro x hx + obtain ⟨n, hn⟩ := (carrier x).1 hx + exact order.subset n ((state.canonical_iterate_bottom pairing unions powers separation + hI hSources hReps hG hT hb least n).2 x hn) + +end GroundCompressionState + +namespace GroundCompressionOrigin +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) + +include origin in +theorem union_bottom + (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) + {b : ZFSet.{u}} (hb : b ∈ P0) (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) : + b ∈ data.fields 0 ∧ ∀ x ∈ data.fields 0, ZFSet.pair b x ∈ data.fields 1 := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + apply state.union_bottom pairing unions powers separation hI hSources hReps hG hT data + · simpa only [initialDomain] using hb + · simpa only [initialDomain, initialOrder] using least + +theorem initial_union_bottom {Labels : ZFSet.{u}} + (origin : GroundCompressionOrigin M (M.initialCompressionData P0 G r0 μ0 A0 Labels) + P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) + (data : GroundCompressionUnionData M (M.initialCompressionData P0 G r0 μ0 A0 Labels) + I Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {b : ZFSet.{u}} (hb : b ∈ P0) (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) : + b ∈ data.fields 0 ∧ ∀ x ∈ data.fields 0, ZFSet.pair b x ∈ data.fields 1 := + origin.union_bottom data pairing unions powers separation hI hSources hReps hG hT rfl rfl hb least + +end GroundCompressionOrigin +end + +section +universe u +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +noncomputable def externalOriginalEmbedding (P r μ A : ZFSet.{u}) : ZFSet.{u} := + graphRestriction P (completion.externalCopyGraph P r μ A + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) + +theorem externalOriginalEmbedding_entry_iff (P r μ A x y : ZFSet.{u}) : + ZFSet.pair x y ∈ completion.externalOriginalEmbedding P r μ A ↔ + ZFSet.pair x y ∈ completion.externalCopyGraph P r μ A + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) ∧ x ∈ P := + pair_mem_graphRestriction + +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +open SetFormula +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P0 ∈ M.sets) +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "originalGraph" => completion.externalOriginalEmbedding P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG hP + +theorem externalOriginalEmbedding_mem : originalGraph ∈ M.sets := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + exact M.graphRestriction_mem unions separation hP (geometry.copies_ground _ data.group.group_code.identity_mem) + +theorem externalOriginalEmbedding_code : + MeetEmbeddingCode P0 (completion.externalBoundedCarrier P0 r0 μ0 A0) + r0 (completion.externalBoundedOrder P0 r0 μ0 A0) μ0 (completion.externalBoundedMeet P0 r0 μ0 A0) + originalGraph := by + have geometry := data.externalBoundedGeometryData group oldAction pairing unions powers separation infinite hG hP + exact (geometry.copies _ data.group.group_code.identity_mem).toMeetEmbeddingCode.restrictSource + data.original.subset (fun x hx y hy => (data.original.order x hx y hy).2) + (fun x hx y hy z => (data.original.meet x hx y hy z).2) + +theorem externalOriginalEmbedding_order_iff {x y x' y' : ZFSet.{u}} + (first : ZFSet.pair x x' ∈ originalGraph) (second : ZFSet.pair y y' ∈ originalGraph) : + ZFSet.pair x' y' ∈ completion.externalBoundedOrder P0 r0 μ0 A0 ↔ ZFSet.pair x y ∈ r0 := by + obtain ⟨first, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x x').1 first + obtain ⟨second, hy⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 y y').1 second + have geometry := data.externalBoundedGeometryData group oldAction pairing unions powers separation infinite hG hP + exact ((geometry.copies _ data.group.group_code.identity_mem).order_iff first second).trans + (data.original.order x hx y hy) + +theorem externalOriginalEmbedding_equivariant {g g' x y x' y' : ZFSet.{u}} + (actor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) + (first : ZFSet.pair x x' ∈ originalGraph) (second : ZFSet.pair y y' ∈ originalGraph) + (acted : ZFSet.pair (ZFSet.pair g x) y ∈ A0) : + ZFSet.pair (ZFSet.pair g' x') y' ∈ completion.externalBoundedAction P0 r0 μ0 A0 := by + obtain ⟨first, hx⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x x').1 first + have second := ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 y y').1 second).1 + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + have hx' := (ZFSet.pair_mem_prod.1 + ((geometry.copies _ data.group.group_code.identity_mem).injection.function.1 first)).2 + exact (fixedTopAction_old_iff hx').2 (data.externalIdentityCopy_equivariant group oldAction + pairing unions powers separation infinite hG actor first second ((data.original.action g x hx y).2 acted)) + +theorem externalOriginalEmbedding_agreement {g h g' h' v v' : ZFSet.{u}} + (firstActor : ZFSet.pair g g' ∈ M.externalOldInclusion G letters m one) + (secondActor : ZFSet.pair h h' ∈ M.externalOldInclusion G letters m one) + (image : ZFSet.pair v v' ∈ originalGraph) (agree : ActionAgreementBelow P0 r0 A0 g h v) : + ActionAgreementBelow (completion.externalBoundedCarrier P0 r0 μ0 A0) + (completion.externalBoundedOrder P0 r0 μ0 A0) (completion.externalBoundedAction P0 r0 μ0 A0) g' h' v' := by + obtain ⟨image, hv⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 v v').1 image + exact data.externalBoundedOriginal_agreement group oldAction pairing unions powers separation infinite hG hP + firstActor secondActor hv image agree + +end GroundExternalGeometryInputs +end + +namespace GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 Filters : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) +local notation "B" => completion.externalBoundedCarrier P0 r0 μ0 A0 +local notation "rB" => completion.externalBoundedOrder P0 r0 μ0 A0 +local notation "embedding" => completion.externalOriginalEmbedding P0 r0 μ0 A0 +include data origin group action pairing unions powers separation infinite hI hSources hReps hG hT hP0 initialDomain initialOrder + +theorem externalOriginalEmbedding_bottom {b b' : ZFSet.{u}} + (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) + (image : ZFSet.pair b b' ∈ embedding) : + b' ∈ B ∧ ∀ y ∈ B, ZFSet.pair b' y ∈ rB := by + obtain ⟨copied, hb⟩ := (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 b b').1 image + have bottom := origin.union_bottom completion.algebra.union pairing unions powers separation + hI hSources hReps hG hT initialDomain initialOrder hb least + have code := data.externalOriginalEmbedding_code group action pairing unions powers separation infinite hG hP0 + exact ⟨(ZFSet.pair_mem_prod.1 (code.injection.function.1 image)).2, + data.externalBoundedCopy_bottom group action pairing unions powers separation infinite hG hP0 + data.group.group_code.identity_mem bottom.2 copied⟩ + +theorem exists_externalOriginal_bottom {b : ZFSet.{u}} (hb : b ∈ P0) + (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) : + ∃ b' ∈ M.sets, ZFSet.pair b b' ∈ embedding ∧ b' ∈ B ∧ + ∀ y ∈ B, ZFSet.pair b' y ∈ rB := by + have code := data.externalOriginalEmbedding_code group action pairing unions powers separation infinite hG hP0 + obtain ⟨b', image, _⟩ := code.injection.function.2 b hb + have bottom := data.externalOriginalEmbedding_bottom origin group action pairing unions powers separation infinite + hI hSources hReps hG hT hP0 initialDomain initialOrder least image + have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP0 + exact ⟨b', M.transitive geometry.carrier_ground bottom.1, image, bottom⟩ + +end GroundExternalGeometryInputs + +namespace GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) +include data group action pairing unions powers separation infinite hG hP + +theorem externalOriginal_image_mem {x y : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P r μ A) : + y ∈ completion.externalPointCarrier P r μ A := by + have copied := ((completion.externalOriginalEmbedding_entry_iff P r μ A x y).1 entry).1 + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP + exact (ZFSet.pair_mem_prod.1 + ((geometry.copies _ data.group.group_code.identity_mem).injection.function.1 copied)).2 + +theorem externalOriginal_top_strict {x y : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ completion.externalOriginalEmbedding P r μ A) : + ZFSet.pair y (completion.externalPointCarrier P r μ A) ∈ completion.externalBoundedOrder P r μ A ∧ + ZFSet.pair (completion.externalPointCarrier P r μ A) y ∉ completion.externalBoundedOrder P r μ A := by + have hy := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP entry + have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP + exact ⟨geometry.greatest y (ZFSet.mem_insert_of_mem _ hy), geometry.strict_top y hy⟩ + +theorem externalOriginal_top_not_image (x : ZFSet.{u}) : + ZFSet.pair x (completion.externalPointCarrier P r μ A) ∉ completion.externalOriginalEmbedding P r μ A := by + intro entry + exact ZFSet.mem_irrefl _ (data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP entry) + +end GroundExternalGeometryInputs + +open SetFormula +universe u + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +theorem externalOriginal_filterImage_eq (P r μ A B : ZFSet.{u}) {F : ZFSet.{u}} + (subset : F ⊆ P) : + relationImage F B (completion.externalOriginalEmbedding P r μ A) = + relationImage F B (completion.externalCopyGraph P r μ A + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) := by + apply ZFSet.ext + intro y + rw [mem_relationImage, mem_relationImage] + constructor + · rintro ⟨hy, x, hx, entry⟩ + exact ⟨hy, x, hx, ((completion.externalOriginalEmbedding_entry_iff P r μ A x y).1 entry).1⟩ + · rintro ⟨hy, x, hx, entry⟩ + exact ⟨hy, x, hx, (completion.externalOriginalEmbedding_entry_iff P r μ A x y).2 ⟨entry, subset hx⟩⟩ + +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P0 ∈ M.sets) +include data group oldAction pairing unions powers separation infinite hG hP +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalBoundedCarrier P0 r0 μ0 A0 +local notation "originalGraph" => completion.externalOriginalEmbedding P0 r0 μ0 A0 + +theorem externalBounded_original_capProfile + {c e K F c' e' K' : ZFSet.{u}} + (profile : CodedCapProfile U (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) c e K F) + (subset : F ⊆ P0) + (imageC : ZFSet.pair c c' ∈ originalGraph) + (imageE : ZFSet.pair e e' ∈ originalGraph) + (imageK : ZFSet.pair K K' ∈ originalGraph) : + CodedCapProfile B (completion.externalBoundedOrder P0 r0 μ0 A0) + (completion.externalBoundedMeet P0 r0 μ0 A0) c' e' K' + (relationImage F B originalGraph) := by + have geometry := data.externalBoundedGeometryData group oldAction + pairing unions powers separation infinite hG hP + rw [completion.externalOriginal_filterImage_eq P0 r0 μ0 A0 B subset] + exact (geometry.copies _ data.group.group_code.identity_mem).capProfile + completion.algebra.union.meet geometry.meet completion.top_mem completion.top profile + ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 c c').1 imageC).1 + ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 e e').1 imageE).1 + ((completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 K K').1 imageK).1 + +end GroundExternalGeometryInputs + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRawPriorLayers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRawPriorLayers.lean index 81f4cfbd28ec948ab888d4fd8cf228a641215a99..b2e4eca2db4eab60e5eea9fd48df129308fedf28 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRawPriorLayers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRawPriorLayers.lean @@ -1,91 +1,91 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerRestrictions -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundLayerWitnessPushforward -import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) - -local notation "U" => completion.algebra.union.fields 0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 - -include births in -theorem priorFiber_image {t y : ZFSet.{u}} - (oldTime : t ∈ oldTimes ∨ t = oldTimes) (born : ZFSet.pair y t ∈ births.birth) : - ∃ x ∈ U, ZFSet.pair x y ∈ E := by - rcases (pair_mem_ownerBirthGraph _ _ _ _ _ _ _ _).1 born with oldEntry | freshEntry - · exact (mem_relationImage U B E y).1 - (ZFSet.pair_mem_prod.1 (births.seed_function.1 oldEntry)).1 |>.2 - · obtain ⟨_, _, _, n, hn, _, stamp⟩ := freshEntry - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have later := compressionStamp_old_mem oldTime n - rw [← (births.times.entries n t).1 stamp] at later - exact (ZFSet.mem_irrefl t later).elim - -include births data group action pairing unions powers separation infinite hG hP0 - -theorem rawPriorWitness {Qs rs μs t N z : ZFSet.{u}} - (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) oldBirth t N z) - (oldTime : t ∈ oldTimes ∨ t = oldTimes) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) - births.birth t N z' := by - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG - apply code.ground_pushforward pairing unions powers separation (completion.algebra.union.ground 0) - geometry.carrier_ground (geometry.copies_ground _ data.group.group_code.identity_mem) - hQs hN hz completion.algebra.union.meet embedding.toMeetEmbeddingCode - · exact fun x y a copied => births.preserves_seed x y a copied - · exact fun _ _ entry => births.priorFiber_image oldTime entry - -theorem rawCutoffPriorWitness {Qs rs μs t N z : ZFSet.{u}} - (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) - (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) oldBirth t N z) - (oldTime : t ∈ oldTimes ∨ t = oldTimes) (n : Nat) : - ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs (births.cutoff n) - (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t N z' := by - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG - have contained : ∀ x y, ZFSet.pair x y ∈ E → y ∈ births.cutoff n := by - intro x y copied - have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) - exact births.cutoff_old n ((mem_relationImage U B E y).2 ⟨bounds.2, x, bounds.1, copied⟩) - have restricted := embedding.toMeetEmbeddingCode.restrictTarget (Q := births.cutoff n) contained - have family := births.cutoffFamily_spec data group action pairing unions powers separation infinite hG hP0 - have hCut := M.pair_right (M.transitive family.1 ((family.2.2 n _).2 rfl)) - apply code.ground_pushforward pairing unions powers separation (completion.algebra.union.ground 0) - hCut - (geometry.copies_ground _ data.group.group_code.identity_mem) hQs hN hz - completion.algebra.union.meet restricted - · intro x y a copied - change ZFSet.pair y a ∈ graphRestriction (births.cutoff n) births.birth ↔ _ - rw [pair_mem_graphRestriction] - exact (and_iff_left (contained x y copied)).trans (births.preserves_seed x y a copied) - · intro y _ entry - exact births.priorFiber_image oldTime (pair_mem_graphRestriction.1 entry).1 - -end PartitionPilot.Forcing.GroundExternalBirthData - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerRestrictions +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundLayerWitnessPushforward +import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) + +local notation "U" => completion.algebra.union.fields 0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 + +include births in +theorem priorFiber_image {t y : ZFSet.{u}} + (oldTime : t ∈ oldTimes ∨ t = oldTimes) (born : ZFSet.pair y t ∈ births.birth) : + ∃ x ∈ U, ZFSet.pair x y ∈ E := by + rcases (pair_mem_ownerBirthGraph _ _ _ _ _ _ _ _).1 born with oldEntry | freshEntry + · exact (mem_relationImage U B E y).1 + (ZFSet.pair_mem_prod.1 (births.seed_function.1 oldEntry)).1 |>.2 + · obtain ⟨_, _, _, n, hn, _, stamp⟩ := freshEntry + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have later := compressionStamp_old_mem oldTime n + rw [← (births.times.entries n t).1 stamp] at later + exact (ZFSet.mem_irrefl t later).elim + +include births data group action pairing unions powers separation infinite hG hP0 + +theorem rawPriorWitness {Qs rs μs t N z : ZFSet.{u}} + (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) oldBirth t N z) + (oldTime : t ∈ oldTimes ∨ t = oldTimes) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs B + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) + births.birth t N z' := by + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG + apply code.ground_pushforward pairing unions powers separation (completion.algebra.union.ground 0) + geometry.carrier_ground (geometry.copies_ground _ data.group.group_code.identity_mem) + hQs hN hz completion.algebra.union.meet embedding.toMeetEmbeddingCode + · exact fun x y a copied => births.preserves_seed x y a copied + · exact fun _ _ entry => births.priorFiber_image oldTime entry + +theorem rawCutoffPriorWitness {Qs rs μs t N z : ZFSet.{u}} + (hQs : Qs ∈ M.sets) (hN : N ∈ M.sets) (hz : z ∈ M.sets) + (code : GrowthLayerWitnessCode Qs rs μs U (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) oldBirth t N z) + (oldTime : t ∈ oldTimes ∨ t = oldTimes) (n : Nat) : + ∃ z' ∈ M.sets, GrowthLayerWitnessCode Qs rs μs (births.cutoff n) + (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t N z' := by + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + have embedding := data.externalIdentityCopy_ideal group action pairing unions powers separation infinite hG + have contained : ∀ x y, ZFSet.pair x y ∈ E → y ∈ births.cutoff n := by + intro x y copied + have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) + exact births.cutoff_old n ((mem_relationImage U B E y).2 ⟨bounds.2, x, bounds.1, copied⟩) + have restricted := embedding.toMeetEmbeddingCode.restrictTarget (Q := births.cutoff n) contained + have family := births.cutoffFamily_spec data group action pairing unions powers separation infinite hG hP0 + have hCut := M.pair_right (M.transitive family.1 ((family.2.2 n _).2 rfl)) + apply code.ground_pushforward pairing unions powers separation (completion.algebra.union.ground 0) + hCut + (geometry.copies_ground _ data.group.group_code.identity_mem) hQs hN hz + completion.algebra.union.meet restricted + · intro x y a copied + change ZFSet.pair y a ∈ graphRestriction (births.cutoff n) births.birth ↔ _ + rw [pair_mem_graphRestriction] + exact (and_iff_left (contained x y copied)).trans (births.preserves_seed x y a copied) + · intro y _ entry + exact births.priorFiber_image oldTime (pair_mem_graphRestriction.1 entry).1 + +end PartitionPilot.Forcing.GroundExternalBirthData + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRectangleFulfillment.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRectangleFulfillment.lean index bb2e7f959516a69dcf966c890955d714580ba4b2..35903b3326164a73fe11f510d74c8a645091b793 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRectangleFulfillment.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRectangleFulfillment.lean @@ -1,151 +1,151 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorSeparation - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P m one r A) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P r μ A -local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) -local notation "generators" => M.externalChildGenerators G letters m one -local notation "oldActors" => M.externalOldInclusion G letters m one -local notation "copyGraph" => completion.externalCopyGraph P r μ A (M.externalGroupIdentity G letters m one) -local notation "e" => completion.externalOriginalEmbedding P r μ A -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy - (completion.externalFamily group oldAction data.original) action 1 -local notation "newAction" => completion.externalPointAction P r μ A -local notation "newOrder" => completion.externalPointOrder P r μ A -local notation "newMeet" => completion.externalPointMeet P r μ A -local notation "up" => completion.algebra.union.meet.toSmallMeetOrder -include data group oldAction pairing unions powers separation infinite hG hP - -theorem external_rectangle_actor_pair {c b d g h k l : ZFSet.{u}} - (eligible : ExternalRectangleCode P G r μ A c b d g h) - (gen1 : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (externalRectangleCode c b d g h)) (natSetCode 0)) k ∈ generators) - (gen2 : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (externalRectangleCode c b d g h)) (natSetCode 1)) l ∈ generators) : - RectangleActorPairCode P μ A Q (M.externalGroupCarrier G letters m one) - newOrder newMeet newAction e oldActors c b d g h k l := by - let := group.toGroup - let z := SetMembers.ofMem (externalRectangleCode c b d g h) - ((externalRectangleCode_mem P G r μ A c b d g h).2 eligible) - let rect := completion.externalRectangle group oldAction data.original z - have tuple : externalRectangleCode (SetMembers.raw rect.C) (SetMembers.raw rect.B) (SetMembers.raw rect.D) - (SetMembers.raw rect.first) (SetMembers.raw rect.second) = externalRectangleCode c b d g h := by - simpa only [z, SetMembers.raw_ofMem] using (completion.externalRectangle_fields group oldAction data.original z) - have fields := externalRectangleCode_inj.1 tuple - have gen1' : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators := by - simpa only [z, SetMembers.raw_ofMem] using gen1 - have gen2' : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators := by - simpa only [z, SetMembers.raw_ofMem] using gen2 - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen1)).2 - have hl := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen2)).2 - have copied {x x' : ZFSet.{u}} (image : ZFSet.pair x x' ∈ e) : ZFSet.pair x x' ∈ copyGraph := - ((completion.externalOriginalEmbedding_entry_iff P r μ A x x').1 image).1 - have value (u : SetMembers U) {x x' : ZFSet.{u}} (same : SetMembers.raw u = x) - (image : ZFSet.pair x x' ∈ e) : x' = (q).encode ((root).toFun u) := - (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG u x').1 - (same.symm ▸ copied image) - refine ⟨⟨?_, ?_⟩, ?_, ?_, ?_⟩ - · intro c' _ g' _ h' _ ec ag ah - obtain ⟨b', eb, _⟩ := ideal.injection.function.2 _ (SetMembers.raw_mem rect.B) - have laws := data.rectangle_generators_full_ideals group oldAction pairing unions powers separation infinite hG hP - z k l gen1' gen2' g' h' c' b' - (fields.2.2.2.1.symm ▸ ag) (fields.2.2.2.2.symm ▸ ah) (fields.1.symm ▸ copied ec) eb - exact ⟨laws.1, laws.2.1⟩ - · intro b' _ eb - obtain ⟨c', ec, _⟩ := ideal.injection.function.2 _ (SetMembers.raw_mem rect.C) - obtain ⟨g', ag, _⟩ := data.old_inclusion_injection.function.2 _ (SetMembers.raw_mem rect.first) - obtain ⟨h', ah, _⟩ := data.old_inclusion_injection.function.2 _ (SetMembers.raw_mem rect.second) - exact (data.rectangle_generators_full_ideals group oldAction pairing unions powers separation infinite hG hP - z k l gen1' gen2' g' h' c' b' ag ah ec (fields.2.1.symm ▸ copied eb)).2.2 - · intro x hx v hv w hw d' hd' x' _ w' _ y _ acted met ed ex ew acted' - let xu := SetMembers.ofMem x (data.original.subset hx) - let vu := SetMembers.ofMem v (data.original.subset hv) - let wu := SetMembers.ofMem w (data.original.subset hw) - have eqD := value rect.D fields.2.2.1 ed - have eqX := value xu (by simp only [xu, SetMembers.raw_ofMem]) ex - have eqW := value wu (by simp only [wu, SetMembers.raw_ofMem]) ew - have actEq : (((action).iso rect.first).toFun rect.C) = vu := - (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet rect.first rect.C vu).2 - (by simpa only [fields.2.2.2.1, fields.1, vu, SetMembers.raw_ofMem] using - (data.original.action g c eligible.1 v).2 acted) - have meetEq : (up).meet vu xu = wu := - (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff vu xu wu).2 - (by simpa only [vu, xu, wu, SetMembers.raw_ofMem] using (data.original.meet v hv x hx w).2 met) - obtain ⟨other, otherAct, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hl, hd'⟩) - rw [eqD] at acted' otherAct - have laws := data.rectangle_generators_root_meets group oldAction pairing unions powers separation infinite hG - z xu k l gen1' gen2' y other acted' otherAct - dsimp only [rect] at actEq - simpa only [actEq, meetEq, ← eqX, ← eqW] using laws.1 - · intro x hx v hv w hw d' hd' x' _ w' _ y _ acted met ed ex ew acted' - let xu := SetMembers.ofMem x (data.original.subset hx) - let vu := SetMembers.ofMem v (data.original.subset hv) - let wu := SetMembers.ofMem w (data.original.subset hw) - have eqD := value rect.D fields.2.2.1 ed - have eqX := value xu (by simp only [xu, SetMembers.raw_ofMem]) ex - have eqW := value wu (by simp only [wu, SetMembers.raw_ofMem]) ew - have actEq : (((action).iso rect.second).toFun rect.C) = vu := - (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet rect.second rect.C vu).2 - (by simpa only [fields.2.2.2.2, fields.1, vu, SetMembers.raw_ofMem] using - (data.original.action h c eligible.1 v).2 acted) - have meetEq : (up).meet vu xu = wu := - (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff vu xu wu).2 - (by simpa only [vu, xu, wu, SetMembers.raw_ofMem] using (data.original.meet v hv x hx w).2 met) - obtain ⟨other, otherAct, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hk, hd'⟩) - rw [eqD] at acted' otherAct - have laws := data.rectangle_generators_root_meets group oldAction pairing unions powers separation infinite hG - z xu k l gen1' gen2' other y otherAct acted' - dsimp only [rect] at actEq - simpa only [actEq, meetEq, ← eqX, ← eqW] using laws.2 - · intro b' _ d' _ y _ v _ w _ eb ed act1 act2 actB - have eqB := value rect.B fields.2.1 eb - have eqD := value rect.D fields.2.2.1 ed - rw [eqD] at act1 act2 - rw [eqB] at actB - have laws := data.rectangle_generators_meet group oldAction pairing unions powers separation infinite hG - z k l gen1' gen2' y v w act1 act2 actB - dsimp only [rect] at eqB - simpa only [← eqB] using laws - -theorem externalBounded_rectangle_fulfillment : - RectangleFulfillmentCode P G r μ A (completion.externalBoundedCarrier P r μ A) - (M.externalGroupCarrier G letters m one) (completion.externalBoundedOrder P r μ A) - (completion.externalBoundedMeet P r μ A) (completion.externalBoundedAction P r μ A) e oldActors := by - intro c _ b _ d _ g _ h _ eligible - have hz := (externalRectangleCode_mem P G r μ A c b d g h).2 eligible - have letter1 := (rectangle_child_iff I P (externalRectangles P G r μ A) - (externalRectangleCode c b d g h) (natSetCode 0)).2 ⟨hz, Or.inl rfl⟩ - have letter2 := (rectangle_child_iff I P (externalRectangles P G r μ A) - (externalRectangleCode c b d g h) (natSetCode 1)).2 ⟨hz, Or.inr rfl⟩ - obtain ⟨k, gen1, _⟩ := data.generators_injection.function.2 _ letter1 - obtain ⟨l, gen2, _⟩ := data.generators_injection.function.2 _ letter2 - have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen1)).2 - have hl := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen2)).2 - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - refine ⟨k, hk, l, hl, ?_⟩ - exact (data.external_rectangle_actor_pair group oldAction pairing unions powers separation infinite hG hP - eligible gen1 gen2).fixedTop geometry.meet geometry.action.function - (fun _ _ image => data.externalOriginal_image_mem group oldAction pairing unions powers separation infinite hG hP image) - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorSeparation + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P m one r A) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P r μ A +local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) +local notation "generators" => M.externalChildGenerators G letters m one +local notation "oldActors" => M.externalOldInclusion G letters m one +local notation "copyGraph" => completion.externalCopyGraph P r μ A (M.externalGroupIdentity G letters m one) +local notation "e" => completion.externalOriginalEmbedding P r μ A +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy + (completion.externalFamily group oldAction data.original) action 1 +local notation "newAction" => completion.externalPointAction P r μ A +local notation "newOrder" => completion.externalPointOrder P r μ A +local notation "newMeet" => completion.externalPointMeet P r μ A +local notation "up" => completion.algebra.union.meet.toSmallMeetOrder +include data group oldAction pairing unions powers separation infinite hG hP + +theorem external_rectangle_actor_pair {c b d g h k l : ZFSet.{u}} + (eligible : ExternalRectangleCode P G r μ A c b d g h) + (gen1 : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (externalRectangleCode c b d g h)) (natSetCode 0)) k ∈ generators) + (gen2 : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (externalRectangleCode c b d g h)) (natSetCode 1)) l ∈ generators) : + RectangleActorPairCode P μ A Q (M.externalGroupCarrier G letters m one) + newOrder newMeet newAction e oldActors c b d g h k l := by + let := group.toGroup + let z := SetMembers.ofMem (externalRectangleCode c b d g h) + ((externalRectangleCode_mem P G r μ A c b d g h).2 eligible) + let rect := completion.externalRectangle group oldAction data.original z + have tuple : externalRectangleCode (SetMembers.raw rect.C) (SetMembers.raw rect.B) (SetMembers.raw rect.D) + (SetMembers.raw rect.first) (SetMembers.raw rect.second) = externalRectangleCode c b d g h := by + simpa only [z, SetMembers.raw_ofMem] using (completion.externalRectangle_fields group oldAction data.original z) + have fields := externalRectangleCode_inj.1 tuple + have gen1' : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators := by + simpa only [z, SetMembers.raw_ofMem] using gen1 + have gen2' : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators := by + simpa only [z, SetMembers.raw_ofMem] using gen2 + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen1)).2 + have hl := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen2)).2 + have copied {x x' : ZFSet.{u}} (image : ZFSet.pair x x' ∈ e) : ZFSet.pair x x' ∈ copyGraph := + ((completion.externalOriginalEmbedding_entry_iff P r μ A x x').1 image).1 + have value (u : SetMembers U) {x x' : ZFSet.{u}} (same : SetMembers.raw u = x) + (image : ZFSet.pair x x' ∈ e) : x' = (q).encode ((root).toFun u) := + (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG u x').1 + (same.symm ▸ copied image) + refine ⟨⟨?_, ?_⟩, ?_, ?_, ?_⟩ + · intro c' _ g' _ h' _ ec ag ah + obtain ⟨b', eb, _⟩ := ideal.injection.function.2 _ (SetMembers.raw_mem rect.B) + have laws := data.rectangle_generators_full_ideals group oldAction pairing unions powers separation infinite hG hP + z k l gen1' gen2' g' h' c' b' + (fields.2.2.2.1.symm ▸ ag) (fields.2.2.2.2.symm ▸ ah) (fields.1.symm ▸ copied ec) eb + exact ⟨laws.1, laws.2.1⟩ + · intro b' _ eb + obtain ⟨c', ec, _⟩ := ideal.injection.function.2 _ (SetMembers.raw_mem rect.C) + obtain ⟨g', ag, _⟩ := data.old_inclusion_injection.function.2 _ (SetMembers.raw_mem rect.first) + obtain ⟨h', ah, _⟩ := data.old_inclusion_injection.function.2 _ (SetMembers.raw_mem rect.second) + exact (data.rectangle_generators_full_ideals group oldAction pairing unions powers separation infinite hG hP + z k l gen1' gen2' g' h' c' b' ag ah ec (fields.2.1.symm ▸ copied eb)).2.2 + · intro x hx v hv w hw d' hd' x' _ w' _ y _ acted met ed ex ew acted' + let xu := SetMembers.ofMem x (data.original.subset hx) + let vu := SetMembers.ofMem v (data.original.subset hv) + let wu := SetMembers.ofMem w (data.original.subset hw) + have eqD := value rect.D fields.2.2.1 ed + have eqX := value xu (by simp only [xu, SetMembers.raw_ofMem]) ex + have eqW := value wu (by simp only [wu, SetMembers.raw_ofMem]) ew + have actEq : (((action).iso rect.first).toFun rect.C) = vu := + (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet rect.first rect.C vu).2 + (by simpa only [fields.2.2.2.1, fields.1, vu, SetMembers.raw_ofMem] using + (data.original.action g c eligible.1 v).2 acted) + have meetEq : (up).meet vu xu = wu := + (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff vu xu wu).2 + (by simpa only [vu, xu, wu, SetMembers.raw_ofMem] using (data.original.meet v hv x hx w).2 met) + obtain ⟨other, otherAct, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hl, hd'⟩) + rw [eqD] at acted' otherAct + have laws := data.rectangle_generators_root_meets group oldAction pairing unions powers separation infinite hG + z xu k l gen1' gen2' y other acted' otherAct + dsimp only [rect] at actEq + simpa only [actEq, meetEq, ← eqX, ← eqW] using laws.1 + · intro x hx v hv w hw d' hd' x' _ w' _ y _ acted met ed ex ew acted' + let xu := SetMembers.ofMem x (data.original.subset hx) + let vu := SetMembers.ofMem v (data.original.subset hv) + let wu := SetMembers.ofMem w (data.original.subset hw) + have eqD := value rect.D fields.2.2.1 ed + have eqX := value xu (by simp only [xu, SetMembers.raw_ofMem]) ex + have eqW := value wu (by simp only [wu, SetMembers.raw_ofMem]) ew + have actEq : (((action).iso rect.second).toFun rect.C) = vu := + (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet rect.second rect.C vu).2 + (by simpa only [fields.2.2.2.2, fields.1, vu, SetMembers.raw_ofMem] using + (data.original.action h c eligible.1 v).2 acted) + have meetEq : (up).meet vu xu = wu := + (completion.algebra.union.meet.toSmallMeetOrder_meet_eq_iff vu xu wu).2 + (by simpa only [vu, xu, wu, SetMembers.raw_ofMem] using (data.original.meet v hv x hx w).2 met) + obtain ⟨other, otherAct, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hk, hd'⟩) + rw [eqD] at acted' otherAct + have laws := data.rectangle_generators_root_meets group oldAction pairing unions powers separation infinite hG + z xu k l gen1' gen2' other y otherAct acted' + dsimp only [rect] at actEq + simpa only [actEq, meetEq, ← eqX, ← eqW] using laws.2 + · intro b' _ d' _ y _ v _ w _ eb ed act1 act2 actB + have eqB := value rect.B fields.2.1 eb + have eqD := value rect.D fields.2.2.1 ed + rw [eqD] at act1 act2 + rw [eqB] at actB + have laws := data.rectangle_generators_meet group oldAction pairing unions powers separation infinite hG + z k l gen1' gen2' y v w act1 act2 actB + dsimp only [rect] at eqB + simpa only [← eqB] using laws + +theorem externalBounded_rectangle_fulfillment : + RectangleFulfillmentCode P G r μ A (completion.externalBoundedCarrier P r μ A) + (M.externalGroupCarrier G letters m one) (completion.externalBoundedOrder P r μ A) + (completion.externalBoundedMeet P r μ A) (completion.externalBoundedAction P r μ A) e oldActors := by + intro c _ b _ d _ g _ h _ eligible + have hz := (externalRectangleCode_mem P G r μ A c b d g h).2 eligible + have letter1 := (rectangle_child_iff I P (externalRectangles P G r μ A) + (externalRectangleCode c b d g h) (natSetCode 0)).2 ⟨hz, Or.inl rfl⟩ + have letter2 := (rectangle_child_iff I P (externalRectangles P G r μ A) + (externalRectangleCode c b d g h) (natSetCode 1)).2 ⟨hz, Or.inr rfl⟩ + obtain ⟨k, gen1, _⟩ := data.generators_injection.function.2 _ letter1 + obtain ⟨l, gen2, _⟩ := data.generators_injection.function.2 _ letter2 + have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen1)).2 + have hl := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen2)).2 + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + refine ⟨k, hk, l, hl, ?_⟩ + exact (data.external_rectangle_actor_pair group oldAction pairing unions powers separation infinite hG hP + eligible gen1 gen2).fixedTop geometry.meet geometry.action.function + (fun _ _ image => data.externalOriginal_image_mem group oldAction pairing unions powers separation infinite hG hP image) + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestFieldRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestFieldRecognition.lean index 69968e39bf1066f239b084e427e6f1f911190ede..7b08c95ed1d42ffc1574c84da7150d274282d4a4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestFieldRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestFieldRecognition.lean @@ -1,248 +1,248 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundExternalRequestSetRecognition - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def ExternalRequestDataCode (I P G r μ A Rectangles Requests Letters : ZFSet.{u}) : Prop := - Rectangles = externalRectangles P G r μ A ∧ - Requests = externalRequestCarrier I P Rectangles ∧ - Letters = externalChildLetters I P Rectangles - -namespace SetFormula - -def externalRequestDataFormula {n} (Rectangles Requests Letters I P G r μ A : Fin n) : SetFormula n := - let old (i : Fin n) := i.succ.succ.succ - ex (ex (ex (.conj (BoundedFormula.emptyFormula 2).toFormula - (.conj (BoundedFormula.successorFormula 1 2).toFormula - (.conj (BoundedFormula.successorFormula 0 1).toFormula - (.conj (externalRectanglesSetFormula (old Rectangles) (old P) (old G) (old r) (old μ) (old A)) - (.conj (externalRequestSetFormula (old Requests) (old I) (old P) (old Rectangles) 2 1 0) - (externalChildSetFormula (old Letters) (old Requests) (old Rectangles) 2 1 0)))))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_externalRequestDataFormula {n} (Rectangles Requests Letters I P G r μ A : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (externalRequestDataFormula Rectangles Requests Letters I P G r μ A) env ↔ - ExternalRequestDataCode (env I) (env P) (env G) (env r) (env μ) (env A) - (env Rectangles) (env Requests) (env Letters) := by - simp only [externalRequestDataFormula, realize_ex, Realize] - constructor - · rintro ⟨zero, hzero, first, hfirst, second, hsecond, empty, succ1, succ2, rectangles, requests, letters⟩ - have bounds : ∀ i, (extend second (extend first (extend zero env))) i ∈ M.sets := - Fin.cases hsecond (Fin.cases hfirst (Fin.cases hzero members)) - have eq0 : zero = natSetCode 0 := (BoundedFormula.truth_emptyFormula 2 _).1 - ((BoundedFormula.realize_toFormula M _ _ bounds).1 empty) - have eq1 : first = natSetCode 1 := by - have eq := (BoundedFormula.truth_successorFormula 1 2 _).1 - ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ1) - change first = insert zero zero at eq - rw [eq0] at eq - exact eq - have eq2 : second = natSetCode 2 := by - have eq := (BoundedFormula.truth_successorFormula 0 1 _).1 - ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ2) - change second = insert first first at eq - rw [eq1] at eq - exact eq - have rect := (M.realize_externalRectanglesSetFormula pairing unions powers separation - Rectangles.succ.succ.succ P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ - μ.succ.succ.succ A.succ.succ.succ _ bounds).1 rectangles - have req := (M.realize_externalRequestSetFormula pairing unions powers separation - Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ Rectangles.succ.succ.succ - 2 1 0 _ bounds eq0 eq1 eq2).1 requests - have children := (M.realize_externalChildSetFormula pairing unions powers separation - Letters.succ.succ.succ Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ - Rectangles.succ.succ.succ 2 1 0 _ bounds req eq0 eq1 eq2).1 letters - exact ⟨rect, req, children⟩ - · rintro ⟨rect, req, children⟩ - have hzero : (natSetCode 0 : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env I, members I⟩ - have hfirst : (natSetCode 1 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions hzero hzero - have hsecond : (natSetCode 2 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions hfirst hfirst - let values := extend (natSetCode 2) (extend (natSetCode 1) (extend (natSetCode 0) env)) - have bounds : ∀ i, values i ∈ M.sets := - Fin.cases hsecond (Fin.cases hfirst (Fin.cases hzero members)) - refine ⟨natSetCode 0, hzero, natSetCode 1, hfirst, natSetCode 2, hsecond, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact (BoundedFormula.realize_toFormula M _ values bounds).2 - ((BoundedFormula.truth_emptyFormula 2 values).2 rfl) - · exact (BoundedFormula.realize_toFormula M _ values bounds).2 - ((BoundedFormula.truth_successorFormula 1 2 values).2 rfl) - · exact (BoundedFormula.realize_toFormula M _ values bounds).2 - ((BoundedFormula.truth_successorFormula 0 1 values).2 rfl) - · exact (M.realize_externalRectanglesSetFormula pairing unions powers separation - Rectangles.succ.succ.succ P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ - μ.succ.succ.succ A.succ.succ.succ values bounds).2 rect - · exact (M.realize_externalRequestSetFormula pairing unions powers separation - Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ Rectangles.succ.succ.succ - 2 1 0 values bounds rfl rfl rfl).2 req - · exact (M.realize_externalChildSetFormula pairing unions powers separation - Letters.succ.succ.succ Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ - Rectangles.succ.succ.succ 2 1 0 values bounds req rfl rfl rfl).2 children - -end TransitiveGround - -theorem mem_externalRequestField (kind : Bool) (I P R z : ZFSet.{u}) : - z ∈ (if kind then externalRequestKinds I P R else externalRequestPayloads I P R) ↔ - ∃ t x, ZFSet.pair t x ∈ externalRequestCarrier I P R ∧ - z = ZFSet.pair (ZFSet.pair t x) (if kind then t else x) := by - cases kind - · simp only [Bool.false_eq_true, ↓reduceIte] - rw [externalRequestPayloads, mem_graphRestriction] - constructor - · rintro ⟨q, hq, y, rfl, projection⟩ - obtain ⟨t, _, x, _, equal⟩ := (mem_productSecond _ _ _).1 projection - have same := ZFSet.pair_inj.1 equal - exact ⟨t, x, same.1 ▸ hq, equal⟩ - · rintro ⟨t, x, member, rfl⟩ - exact mem_graphRestriction.1 (externalRequest_fields_entry member).2 - · simp only [↓reduceIte] - rw [externalRequestKinds, mem_graphRestriction] - constructor - · rintro ⟨q, hq, y, rfl, projection⟩ - obtain ⟨t, _, x, _, equal⟩ := (mem_productFirst _ _ _).1 projection - have same := ZFSet.pair_inj.1 equal - exact ⟨t, x, same.1 ▸ hq, equal⟩ - · rintro ⟨t, x, member, rfl⟩ - exact mem_graphRestriction.1 (externalRequest_fields_entry member).1 - -namespace BoundedFormula - -def externalRequestFieldEntryFormula {n} (kind : Bool) (z I P R zero one two : Fin n) : BoundedFormula n := - disj (exMem I (orderedTripleFormula z.succ zero.succ 0 (if kind then zero.succ else 0))) - (disj (exMem P (orderedTripleFormula z.succ one.succ 0 (if kind then one.succ else 0))) - (exMem R (orderedTripleFormula z.succ two.succ 0 (if kind then two.succ else 0)))) - -theorem truth_externalRequestFieldEntryFormula {n} (kind : Bool) (z I P R zero one two : Fin n) - (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) - (ho : env one = natSetCode 1) (ht : env two = natSetCode 2) : - Truth (externalRequestFieldEntryFormula kind z I P R zero one two) env ↔ - env z ∈ (if kind then externalRequestKinds (env I) (env P) (env R) - else externalRequestPayloads (env I) (env P) (env R)) := by - simp only [externalRequestFieldEntryFormula, truth_disj, truth_exMem, truth_orderedTripleFormula] - have chosen (tag : Fin n) (x : ZFSet.{u}) : - extend x env (if kind then tag.succ else 0) = (if kind then env tag else x) := by - cases kind <;> rfl - simp only [chosen] - change ((∃ x ∈ env I, env z = ZFSet.pair (ZFSet.pair (env zero) x) (if kind then env zero else x)) ∨ - (∃ x ∈ env P, env z = ZFSet.pair (ZFSet.pair (env one) x) (if kind then env one else x)) ∨ - (∃ x ∈ env R, env z = ZFSet.pair (ZFSet.pair (env two) x) (if kind then env two else x))) ↔ _ - rw [hz, ho, ht, mem_externalRequestField] - constructor - · intro member - rcases member with ⟨x, hx, equal⟩ | ⟨x, hx, equal⟩ | ⟨x, hx, equal⟩ - · exact ⟨natSetCode 0, x, (compression_mem_externalRequestCarrier _ _ _ _).2 hx, equal⟩ - · exact ⟨natSetCode 1, x, (separation_mem_externalRequestCarrier _ _ _ _).2 hx, equal⟩ - · exact ⟨natSetCode 2, x, (rectangle_mem_externalRequestCarrier _ _ _ _).2 hx, equal⟩ - · rintro ⟨t, x, request, equal⟩ - rcases (pair_mem_externalRequestCarrier _ _ _ _ _).1 request with - ⟨rfl, hx⟩ | ⟨rfl, hx⟩ | ⟨rfl, hx⟩ - · exact Or.inl ⟨x, hx, equal⟩ - · exact Or.inr (Or.inl ⟨x, hx, equal⟩) - · exact Or.inr (Or.inr ⟨x, hx, equal⟩) - -end BoundedFormula - -namespace SetFormula - -def externalRequestFieldFormula {n} (kind : Bool) (output I P R : Fin n) : SetFormula n := - let old (i : Fin n) := i.succ.succ.succ - ex (ex (ex (.conj (BoundedFormula.emptyFormula 2).toFormula - (.conj (BoundedFormula.successorFormula 1 2).toFormula - (.conj (BoundedFormula.successorFormula 0 1).toFormula - (exactSetFormula (old output) - (BoundedFormula.externalRequestFieldEntryFormula kind 0 - (old I).succ (old P).succ (old R).succ 3 2 1).toFormula)))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_externalRequestFieldFormula {n} (kind : Bool) (output I P R : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (externalRequestFieldFormula kind output I P R) env ↔ - env output = (if kind then externalRequestKinds (env I) (env P) (env R) - else externalRequestPayloads (env I) (env P) (env R)) := by - have fieldGround : (if kind then externalRequestKinds (env I) (env P) (env R) - else externalRequestPayloads (env I) (env P) (env R)) ∈ M.sets := by - cases kind - · exact M.externalRequestPayloads_mem pairing unions powers separation (members I) (members P) (members R) - · exact M.externalRequestKinds_mem pairing unions powers separation (members I) (members P) (members R) - have meaning (zero one two : ZFSet.{u}) - (bounds : ∀ j, extend two (extend one (extend zero env)) j ∈ M.sets) - (hz : zero = natSetCode 0) (ho : one = natSetCode 1) (ht : two = natSetCode 2) : - Realize M.sets (exactSetFormula output.succ.succ.succ - (BoundedFormula.externalRequestFieldEntryFormula kind 0 - I.succ.succ.succ.succ P.succ.succ.succ.succ R.succ.succ.succ.succ 3 2 1).toFormula) - (extend two (extend one (extend zero env))) ↔ - env output = (if kind then externalRequestKinds (env I) (env P) (env R) - else externalRequestPayloads (env I) (env P) (env R)) := by - apply M.realize_exactBoundedSetFormula output.succ.succ.succ _ _ bounds fieldGround - intro z - exact BoundedFormula.truth_externalRequestFieldEntryFormula kind _ _ _ _ _ _ _ _ hz ho ht - simp only [externalRequestFieldFormula, realize_ex, Realize] - constructor - · rintro ⟨zero, hzero, one, hone, two, htwo, empty, succ1, succ2, field⟩ - have bounds : ∀ j, extend two (extend one (extend zero env)) j ∈ M.sets := - Fin.cases htwo (Fin.cases hone (Fin.cases hzero members)) - have hz : zero = natSetCode 0 := (BoundedFormula.truth_emptyFormula 2 _).1 - ((BoundedFormula.realize_toFormula M _ _ bounds).1 empty) - have ho : one = natSetCode 1 := by - have equal := (BoundedFormula.truth_successorFormula 1 2 _).1 - ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ1) - change one = insert zero zero at equal - rw [hz] at equal - exact equal - have ht : two = natSetCode 2 := by - have equal := (BoundedFormula.truth_successorFormula 0 1 _).1 - ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ2) - change two = insert one one at equal - rw [ho] at equal - exact equal - exact (meaning zero one two bounds hz ho ht).1 field - · intro equal - have hz : (natSetCode 0 : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env I, members I⟩ - have ho : (natSetCode 1 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions hz hz - have ht : (natSetCode 2 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions ho ho - have bounds : ∀ j, extend (natSetCode 2) (extend (natSetCode 1) (extend (natSetCode 0) env)) j ∈ M.sets := - Fin.cases ht (Fin.cases ho (Fin.cases hz members)) - refine ⟨natSetCode 0, hz, natSetCode 1, ho, natSetCode 2, ht, ?_, ?_, ?_, - (meaning _ _ _ bounds rfl rfl rfl).2 equal⟩ - · exact (BoundedFormula.realize_toFormula M _ _ bounds).2 - ((BoundedFormula.truth_emptyFormula 2 _).2 rfl) - · exact (BoundedFormula.realize_toFormula M _ _ bounds).2 - ((BoundedFormula.truth_successorFormula 1 2 _).2 rfl) - · exact (BoundedFormula.realize_toFormula M _ _ bounds).2 - ((BoundedFormula.truth_successorFormula 0 1 _).2 rfl) - -noncomputable def definable_externalRequestField (kind : Bool) : GroundDefinableFunction M - (fun env : Fin 3 → ZFSet.{u} => if kind then externalRequestKinds (env 0) (env 1) (env 2) - else externalRequestPayloads (env 0) (env 1) (env 2)) where - formula := externalRequestFieldFormula kind 0 1 2 3 - closed := by - intro env members - cases kind - · exact M.externalRequestPayloads_mem pairing unions powers separation (members 0) (members 1) (members 2) - · exact M.externalRequestKinds_mem pairing unions powers separation (members 0) (members 1) (members 2) - correct := fun env members z hz => M.realize_externalRequestFieldFormula pairing unions powers separation - kind 0 1 2 3 (extend z env) (Fin.cases hz members) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundExternalRequestSetRecognition + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def ExternalRequestDataCode (I P G r μ A Rectangles Requests Letters : ZFSet.{u}) : Prop := + Rectangles = externalRectangles P G r μ A ∧ + Requests = externalRequestCarrier I P Rectangles ∧ + Letters = externalChildLetters I P Rectangles + +namespace SetFormula + +def externalRequestDataFormula {n} (Rectangles Requests Letters I P G r μ A : Fin n) : SetFormula n := + let old (i : Fin n) := i.succ.succ.succ + ex (ex (ex (.conj (BoundedFormula.emptyFormula 2).toFormula + (.conj (BoundedFormula.successorFormula 1 2).toFormula + (.conj (BoundedFormula.successorFormula 0 1).toFormula + (.conj (externalRectanglesSetFormula (old Rectangles) (old P) (old G) (old r) (old μ) (old A)) + (.conj (externalRequestSetFormula (old Requests) (old I) (old P) (old Rectangles) 2 1 0) + (externalChildSetFormula (old Letters) (old Requests) (old Rectangles) 2 1 0)))))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_externalRequestDataFormula {n} (Rectangles Requests Letters I P G r μ A : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (externalRequestDataFormula Rectangles Requests Letters I P G r μ A) env ↔ + ExternalRequestDataCode (env I) (env P) (env G) (env r) (env μ) (env A) + (env Rectangles) (env Requests) (env Letters) := by + simp only [externalRequestDataFormula, realize_ex, Realize] + constructor + · rintro ⟨zero, hzero, first, hfirst, second, hsecond, empty, succ1, succ2, rectangles, requests, letters⟩ + have bounds : ∀ i, (extend second (extend first (extend zero env))) i ∈ M.sets := + Fin.cases hsecond (Fin.cases hfirst (Fin.cases hzero members)) + have eq0 : zero = natSetCode 0 := (BoundedFormula.truth_emptyFormula 2 _).1 + ((BoundedFormula.realize_toFormula M _ _ bounds).1 empty) + have eq1 : first = natSetCode 1 := by + have eq := (BoundedFormula.truth_successorFormula 1 2 _).1 + ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ1) + change first = insert zero zero at eq + rw [eq0] at eq + exact eq + have eq2 : second = natSetCode 2 := by + have eq := (BoundedFormula.truth_successorFormula 0 1 _).1 + ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ2) + change second = insert first first at eq + rw [eq1] at eq + exact eq + have rect := (M.realize_externalRectanglesSetFormula pairing unions powers separation + Rectangles.succ.succ.succ P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ + μ.succ.succ.succ A.succ.succ.succ _ bounds).1 rectangles + have req := (M.realize_externalRequestSetFormula pairing unions powers separation + Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ Rectangles.succ.succ.succ + 2 1 0 _ bounds eq0 eq1 eq2).1 requests + have children := (M.realize_externalChildSetFormula pairing unions powers separation + Letters.succ.succ.succ Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ + Rectangles.succ.succ.succ 2 1 0 _ bounds req eq0 eq1 eq2).1 letters + exact ⟨rect, req, children⟩ + · rintro ⟨rect, req, children⟩ + have hzero : (natSetCode 0 : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env I, members I⟩ + have hfirst : (natSetCode 1 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions hzero hzero + have hsecond : (natSetCode 2 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions hfirst hfirst + let values := extend (natSetCode 2) (extend (natSetCode 1) (extend (natSetCode 0) env)) + have bounds : ∀ i, values i ∈ M.sets := + Fin.cases hsecond (Fin.cases hfirst (Fin.cases hzero members)) + refine ⟨natSetCode 0, hzero, natSetCode 1, hfirst, natSetCode 2, hsecond, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact (BoundedFormula.realize_toFormula M _ values bounds).2 + ((BoundedFormula.truth_emptyFormula 2 values).2 rfl) + · exact (BoundedFormula.realize_toFormula M _ values bounds).2 + ((BoundedFormula.truth_successorFormula 1 2 values).2 rfl) + · exact (BoundedFormula.realize_toFormula M _ values bounds).2 + ((BoundedFormula.truth_successorFormula 0 1 values).2 rfl) + · exact (M.realize_externalRectanglesSetFormula pairing unions powers separation + Rectangles.succ.succ.succ P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ + μ.succ.succ.succ A.succ.succ.succ values bounds).2 rect + · exact (M.realize_externalRequestSetFormula pairing unions powers separation + Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ Rectangles.succ.succ.succ + 2 1 0 values bounds rfl rfl rfl).2 req + · exact (M.realize_externalChildSetFormula pairing unions powers separation + Letters.succ.succ.succ Requests.succ.succ.succ I.succ.succ.succ P.succ.succ.succ + Rectangles.succ.succ.succ 2 1 0 values bounds req rfl rfl rfl).2 children + +end TransitiveGround + +theorem mem_externalRequestField (kind : Bool) (I P R z : ZFSet.{u}) : + z ∈ (if kind then externalRequestKinds I P R else externalRequestPayloads I P R) ↔ + ∃ t x, ZFSet.pair t x ∈ externalRequestCarrier I P R ∧ + z = ZFSet.pair (ZFSet.pair t x) (if kind then t else x) := by + cases kind + · simp only [Bool.false_eq_true, ↓reduceIte] + rw [externalRequestPayloads, mem_graphRestriction] + constructor + · rintro ⟨q, hq, y, rfl, projection⟩ + obtain ⟨t, _, x, _, equal⟩ := (mem_productSecond _ _ _).1 projection + have same := ZFSet.pair_inj.1 equal + exact ⟨t, x, same.1 ▸ hq, equal⟩ + · rintro ⟨t, x, member, rfl⟩ + exact mem_graphRestriction.1 (externalRequest_fields_entry member).2 + · simp only [↓reduceIte] + rw [externalRequestKinds, mem_graphRestriction] + constructor + · rintro ⟨q, hq, y, rfl, projection⟩ + obtain ⟨t, _, x, _, equal⟩ := (mem_productFirst _ _ _).1 projection + have same := ZFSet.pair_inj.1 equal + exact ⟨t, x, same.1 ▸ hq, equal⟩ + · rintro ⟨t, x, member, rfl⟩ + exact mem_graphRestriction.1 (externalRequest_fields_entry member).1 + +namespace BoundedFormula + +def externalRequestFieldEntryFormula {n} (kind : Bool) (z I P R zero one two : Fin n) : BoundedFormula n := + disj (exMem I (orderedTripleFormula z.succ zero.succ 0 (if kind then zero.succ else 0))) + (disj (exMem P (orderedTripleFormula z.succ one.succ 0 (if kind then one.succ else 0))) + (exMem R (orderedTripleFormula z.succ two.succ 0 (if kind then two.succ else 0)))) + +theorem truth_externalRequestFieldEntryFormula {n} (kind : Bool) (z I P R zero one two : Fin n) + (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) + (ho : env one = natSetCode 1) (ht : env two = natSetCode 2) : + Truth (externalRequestFieldEntryFormula kind z I P R zero one two) env ↔ + env z ∈ (if kind then externalRequestKinds (env I) (env P) (env R) + else externalRequestPayloads (env I) (env P) (env R)) := by + simp only [externalRequestFieldEntryFormula, truth_disj, truth_exMem, truth_orderedTripleFormula] + have chosen (tag : Fin n) (x : ZFSet.{u}) : + extend x env (if kind then tag.succ else 0) = (if kind then env tag else x) := by + cases kind <;> rfl + simp only [chosen] + change ((∃ x ∈ env I, env z = ZFSet.pair (ZFSet.pair (env zero) x) (if kind then env zero else x)) ∨ + (∃ x ∈ env P, env z = ZFSet.pair (ZFSet.pair (env one) x) (if kind then env one else x)) ∨ + (∃ x ∈ env R, env z = ZFSet.pair (ZFSet.pair (env two) x) (if kind then env two else x))) ↔ _ + rw [hz, ho, ht, mem_externalRequestField] + constructor + · intro member + rcases member with ⟨x, hx, equal⟩ | ⟨x, hx, equal⟩ | ⟨x, hx, equal⟩ + · exact ⟨natSetCode 0, x, (compression_mem_externalRequestCarrier _ _ _ _).2 hx, equal⟩ + · exact ⟨natSetCode 1, x, (separation_mem_externalRequestCarrier _ _ _ _).2 hx, equal⟩ + · exact ⟨natSetCode 2, x, (rectangle_mem_externalRequestCarrier _ _ _ _).2 hx, equal⟩ + · rintro ⟨t, x, request, equal⟩ + rcases (pair_mem_externalRequestCarrier _ _ _ _ _).1 request with + ⟨rfl, hx⟩ | ⟨rfl, hx⟩ | ⟨rfl, hx⟩ + · exact Or.inl ⟨x, hx, equal⟩ + · exact Or.inr (Or.inl ⟨x, hx, equal⟩) + · exact Or.inr (Or.inr ⟨x, hx, equal⟩) + +end BoundedFormula + +namespace SetFormula + +def externalRequestFieldFormula {n} (kind : Bool) (output I P R : Fin n) : SetFormula n := + let old (i : Fin n) := i.succ.succ.succ + ex (ex (ex (.conj (BoundedFormula.emptyFormula 2).toFormula + (.conj (BoundedFormula.successorFormula 1 2).toFormula + (.conj (BoundedFormula.successorFormula 0 1).toFormula + (exactSetFormula (old output) + (BoundedFormula.externalRequestFieldEntryFormula kind 0 + (old I).succ (old P).succ (old R).succ 3 2 1).toFormula)))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_externalRequestFieldFormula {n} (kind : Bool) (output I P R : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (externalRequestFieldFormula kind output I P R) env ↔ + env output = (if kind then externalRequestKinds (env I) (env P) (env R) + else externalRequestPayloads (env I) (env P) (env R)) := by + have fieldGround : (if kind then externalRequestKinds (env I) (env P) (env R) + else externalRequestPayloads (env I) (env P) (env R)) ∈ M.sets := by + cases kind + · exact M.externalRequestPayloads_mem pairing unions powers separation (members I) (members P) (members R) + · exact M.externalRequestKinds_mem pairing unions powers separation (members I) (members P) (members R) + have meaning (zero one two : ZFSet.{u}) + (bounds : ∀ j, extend two (extend one (extend zero env)) j ∈ M.sets) + (hz : zero = natSetCode 0) (ho : one = natSetCode 1) (ht : two = natSetCode 2) : + Realize M.sets (exactSetFormula output.succ.succ.succ + (BoundedFormula.externalRequestFieldEntryFormula kind 0 + I.succ.succ.succ.succ P.succ.succ.succ.succ R.succ.succ.succ.succ 3 2 1).toFormula) + (extend two (extend one (extend zero env))) ↔ + env output = (if kind then externalRequestKinds (env I) (env P) (env R) + else externalRequestPayloads (env I) (env P) (env R)) := by + apply M.realize_exactBoundedSetFormula output.succ.succ.succ _ _ bounds fieldGround + intro z + exact BoundedFormula.truth_externalRequestFieldEntryFormula kind _ _ _ _ _ _ _ _ hz ho ht + simp only [externalRequestFieldFormula, realize_ex, Realize] + constructor + · rintro ⟨zero, hzero, one, hone, two, htwo, empty, succ1, succ2, field⟩ + have bounds : ∀ j, extend two (extend one (extend zero env)) j ∈ M.sets := + Fin.cases htwo (Fin.cases hone (Fin.cases hzero members)) + have hz : zero = natSetCode 0 := (BoundedFormula.truth_emptyFormula 2 _).1 + ((BoundedFormula.realize_toFormula M _ _ bounds).1 empty) + have ho : one = natSetCode 1 := by + have equal := (BoundedFormula.truth_successorFormula 1 2 _).1 + ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ1) + change one = insert zero zero at equal + rw [hz] at equal + exact equal + have ht : two = natSetCode 2 := by + have equal := (BoundedFormula.truth_successorFormula 0 1 _).1 + ((BoundedFormula.realize_toFormula M _ _ bounds).1 succ2) + change two = insert one one at equal + rw [ho] at equal + exact equal + exact (meaning zero one two bounds hz ho ht).1 field + · intro equal + have hz : (natSetCode 0 : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨env I, members I⟩ + have ho : (natSetCode 1 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions hz hz + have ht : (natSetCode 2 : ZFSet.{u}) ∈ M.sets := M.insert_mem pairing unions ho ho + have bounds : ∀ j, extend (natSetCode 2) (extend (natSetCode 1) (extend (natSetCode 0) env)) j ∈ M.sets := + Fin.cases ht (Fin.cases ho (Fin.cases hz members)) + refine ⟨natSetCode 0, hz, natSetCode 1, ho, natSetCode 2, ht, ?_, ?_, ?_, + (meaning _ _ _ bounds rfl rfl rfl).2 equal⟩ + · exact (BoundedFormula.realize_toFormula M _ _ bounds).2 + ((BoundedFormula.truth_emptyFormula 2 _).2 rfl) + · exact (BoundedFormula.realize_toFormula M _ _ bounds).2 + ((BoundedFormula.truth_successorFormula 1 2 _).2 rfl) + · exact (BoundedFormula.realize_toFormula M _ _ bounds).2 + ((BoundedFormula.truth_successorFormula 0 1 _).2 rfl) + +noncomputable def definable_externalRequestField (kind : Bool) : GroundDefinableFunction M + (fun env : Fin 3 → ZFSet.{u} => if kind then externalRequestKinds (env 0) (env 1) (env 2) + else externalRequestPayloads (env 0) (env 1) (env 2)) where + formula := externalRequestFieldFormula kind 0 1 2 3 + closed := by + intro env members + cases kind + · exact M.externalRequestPayloads_mem pairing unions powers separation (members 0) (members 1) (members 2) + · exact M.externalRequestKinds_mem pairing unions powers separation (members 0) (members 1) (members 2) + correct := fun env members z hz => M.realize_externalRequestFieldFormula pairing unions powers separation + kind 0 1 2 3 (extend z env) (Fin.cases hz members) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestOverlaps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestOverlaps.lean index db6830a11ba42c1f1c0ea0a748a2e0b48f272047..3be44e75c5ddecb81c8e873d2c69f696428e6cc7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestOverlaps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRequestOverlaps.lean @@ -1,151 +1,151 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundExternalRequestSetRecognition - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def externalRequestOverlapGraph - (Requests P G Rectangles Maps U r A : ZFSet.{u}) : ZFSet.{u} := - let V := externalTileVertices Requests Rectangles U - ZFSet.sep (fun z => ∃ a ∈ V, ∃ b ∈ V, ∃ q ∈ Requests, - ∃ i ∈ externalRequestTags, ∃ x ∈ U, ∃ j ∈ externalRequestTags, ∃ y ∈ U, - z = ZFSet.pair a b ∧ a = ZFSet.pair (ZFSet.pair q i) x ∧ - b = ZFSet.pair (ZFSet.pair q j) y ∧ - ExternalRequestOverlapCode P G Rectangles Maps (ZFSet.sUnion (ZFSet.sUnion Maps)) r A - (natSetCode 0) (natSetCode 1) (natSetCode 2) q i x j y) (ZFSet.prod V V) - -theorem pair_mem_externalRequestOverlapGraph (Requests P G Rectangles Maps U r A a b : ZFSet.{u}) : - ZFSet.pair a b ∈ externalRequestOverlapGraph Requests P G Rectangles Maps U r A ↔ - a ∈ externalTileVertices Requests Rectangles U ∧ b ∈ externalTileVertices Requests Rectangles U ∧ - ∃ q ∈ Requests, ∃ i ∈ externalRequestTags, ∃ x ∈ U, ∃ j ∈ externalRequestTags, ∃ y ∈ U, - a = ZFSet.pair (ZFSet.pair q i) x ∧ b = ZFSet.pair (ZFSet.pair q j) y ∧ - ExternalRequestOverlapCode P G Rectangles Maps (ZFSet.sUnion (ZFSet.sUnion Maps)) r A - (natSetCode 0) (natSetCode 1) (natSetCode 2) q i x j y := by - rw [externalRequestOverlapGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, a', ha, b', hb, q, hq, i, hi, x, hx, j, hj, y, hy, equal, left, right, overlap⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨ha, hb, q, hq, i, hi, x, hx, j, hj, y, hy, left, right, overlap⟩ - · rintro ⟨ha, hb, q, hq, i, hi, x, hx, j, hj, y, hy, left, right, overlap⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, a, ha, b, hb, q, hq, i, hi, x, hx, j, hj, y, hy, - rfl, left, right, overlap⟩ - -theorem externalRequestOverlapGraph_subset (Requests P G Rectangles Maps U r A : ZFSet.{u}) : - externalRequestOverlapGraph Requests P G Rectangles Maps U r A ⊆ - ZFSet.prod (externalTileVertices Requests Rectangles U) (externalTileVertices Requests Rectangles U) := by - intro z member - unfold externalRequestOverlapGraph at member - exact (ZFSet.mem_sep.1 member).1 - -theorem externalRequestOverlapGraph_symmetric {Requests P G Rectangles Maps U r A a b : ZFSet.{u}} - (entry : ZFSet.pair a b ∈ externalRequestOverlapGraph Requests P G Rectangles Maps U r A) : - ZFSet.pair b a ∈ externalRequestOverlapGraph Requests P G Rectangles Maps U r A := by - obtain ⟨ha, hb, q, hq, i, hi, x, hx, j, hj, y, hy, left, right, overlap⟩ := - (pair_mem_externalRequestOverlapGraph _ _ _ _ _ _ _ _ _ _).1 entry - exact (pair_mem_externalRequestOverlapGraph _ _ _ _ _ _ _ _ _ _).2 - ⟨hb, ha, q, hq, j, hj, y, hy, i, hi, x, hx, right, left, overlap.symm⟩ - -namespace BoundedFormula - -def externalRequestOverlapEntryFormula {n} - (z V Requests Tags U P G Rectangles Maps F r A zero first second : Fin n) : BoundedFormula n := - exMem V (exMem V.succ (exMem Requests.succ.succ (exMem Tags.succ.succ.succ - (exMem U.succ.succ.succ.succ (exMem Tags.succ.succ.succ.succ.succ - (exMem U.succ.succ.succ.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ.succ.succ.succ 6 5) - (.conj (orderedTripleFormula 6 4 3 2) - (.conj (orderedTripleFormula 5 4 1 0) - (externalRequestOverlapFormula P.succ.succ.succ.succ.succ.succ.succ - G.succ.succ.succ.succ.succ.succ.succ Rectangles.succ.succ.succ.succ.succ.succ.succ - Maps.succ.succ.succ.succ.succ.succ.succ F.succ.succ.succ.succ.succ.succ.succ - r.succ.succ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ.succ.succ - zero.succ.succ.succ.succ.succ.succ.succ first.succ.succ.succ.succ.succ.succ.succ - second.succ.succ.succ.succ.succ.succ.succ 4 3 2 1 0)))))))))) - -theorem truth_externalRequestOverlapEntryFormula {n} - (z V Requests Tags U P G Rectangles Maps F r A zero first second : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (externalRequestOverlapEntryFormula z V Requests Tags U P G Rectangles Maps F r A zero first second) env ↔ - ∃ a ∈ env V, ∃ b ∈ env V, ∃ q ∈ env Requests, - ∃ i ∈ env Tags, ∃ x ∈ env U, ∃ j ∈ env Tags, ∃ y ∈ env U, - env z = ZFSet.pair a b ∧ a = ZFSet.pair (ZFSet.pair q i) x ∧ - b = ZFSet.pair (ZFSet.pair q j) y ∧ - ExternalRequestOverlapCode (env P) (env G) (env Rectangles) (env Maps) (env F) (env r) (env A) - (env zero) (env first) (env second) q i x j y := by - simp only [externalRequestOverlapEntryFormula, Truth, truth_exMem, truth_orderedPairFormula, - truth_orderedTripleFormula, truth_externalRequestOverlapFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem externalTileVertices_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Requests Rectangles U : ZFSet.{u}} (hRequests : Requests ∈ M.sets) - (hRectangles : Rectangles ∈ M.sets) (hU : U ∈ M.sets) : - externalTileVertices Requests Rectangles U ∈ M.sets := by - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨U, hU⟩ - have hFirst : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero - have hSecond : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions hFirst hFirst - have single : ({natSetCode 2} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hSecond hSecond - exact M.binary_union_mem pairing unions - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hRequests (M.unorderedPair_mem pairing hZero hFirst)) hU) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation single hRectangles) single) hU) - -theorem externalRequestOverlapGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Requests P G Rectangles Maps U r A : ZFSet.{u}} - (hRequests : Requests ∈ M.sets) (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (hRectangles : Rectangles ∈ M.sets) (hMaps : Maps ∈ M.sets) (hU : U ∈ M.sets) - (hr : r ∈ M.sets) (hA : A ∈ M.sets) : - externalRequestOverlapGraph Requests P G Rectangles Maps U r A ∈ M.sets := by - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨U, hU⟩ - have hFirst : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero - have hSecond : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions hFirst hFirst - have single : ({natSetCode 2} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hSecond hSecond - have hTags : externalRequestTags ∈ M.sets := - M.insert_mem pairing unions hZero (M.insert_mem pairing unions hFirst single) - have hV := M.externalTileVertices_mem pairing unions powers separation hRequests hRectangles hU - have hF := M.union_mem unions (M.union_mem unions hMaps) - let params := extend (externalTileVertices Requests Rectangles U) (extend Requests - (extend externalRequestTags (extend U (extend P (extend G (extend Rectangles - (extend Maps (extend (ZFSet.sUnion (ZFSet.sUnion Maps)) (extend r (extend A (extend (natSetCode 0) - (extend (natSetCode 1) (extend (natSetCode 2) Fin.elim0))))))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalRequestOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) params - (Fin.cases hV (Fin.cases hRequests (Fin.cases hTags (Fin.cases hU (Fin.cases hP (Fin.cases hG - (Fin.cases hRectangles (Fin.cases hMaps (Fin.cases hF (Fin.cases hr (Fin.cases hA - (Fin.cases hZero (Fin.cases hFirst (Fin.cases hSecond (fun i => Fin.elim0 i))))))))))))))) - (M.prod_mem pairing unions powers separation hV hV) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.externalRequestOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) - (extend z params)) (ZFSet.prod (externalTileVertices Requests Rectangles U) - (externalTileVertices Requests Rectangles U)) = externalRequestOverlapGraph Requests P G Rectangles Maps U r A := by - apply ZFSet.ext - intro z - rw [externalRequestOverlapGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_externalRequestOverlapEntryFormula - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 _) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundExternalRequestSetRecognition + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def externalRequestOverlapGraph + (Requests P G Rectangles Maps U r A : ZFSet.{u}) : ZFSet.{u} := + let V := externalTileVertices Requests Rectangles U + ZFSet.sep (fun z => ∃ a ∈ V, ∃ b ∈ V, ∃ q ∈ Requests, + ∃ i ∈ externalRequestTags, ∃ x ∈ U, ∃ j ∈ externalRequestTags, ∃ y ∈ U, + z = ZFSet.pair a b ∧ a = ZFSet.pair (ZFSet.pair q i) x ∧ + b = ZFSet.pair (ZFSet.pair q j) y ∧ + ExternalRequestOverlapCode P G Rectangles Maps (ZFSet.sUnion (ZFSet.sUnion Maps)) r A + (natSetCode 0) (natSetCode 1) (natSetCode 2) q i x j y) (ZFSet.prod V V) + +theorem pair_mem_externalRequestOverlapGraph (Requests P G Rectangles Maps U r A a b : ZFSet.{u}) : + ZFSet.pair a b ∈ externalRequestOverlapGraph Requests P G Rectangles Maps U r A ↔ + a ∈ externalTileVertices Requests Rectangles U ∧ b ∈ externalTileVertices Requests Rectangles U ∧ + ∃ q ∈ Requests, ∃ i ∈ externalRequestTags, ∃ x ∈ U, ∃ j ∈ externalRequestTags, ∃ y ∈ U, + a = ZFSet.pair (ZFSet.pair q i) x ∧ b = ZFSet.pair (ZFSet.pair q j) y ∧ + ExternalRequestOverlapCode P G Rectangles Maps (ZFSet.sUnion (ZFSet.sUnion Maps)) r A + (natSetCode 0) (natSetCode 1) (natSetCode 2) q i x j y := by + rw [externalRequestOverlapGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, a', ha, b', hb, q, hq, i, hi, x, hx, j, hj, y, hy, equal, left, right, overlap⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨ha, hb, q, hq, i, hi, x, hx, j, hj, y, hy, left, right, overlap⟩ + · rintro ⟨ha, hb, q, hq, i, hi, x, hx, j, hj, y, hy, left, right, overlap⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, a, ha, b, hb, q, hq, i, hi, x, hx, j, hj, y, hy, + rfl, left, right, overlap⟩ + +theorem externalRequestOverlapGraph_subset (Requests P G Rectangles Maps U r A : ZFSet.{u}) : + externalRequestOverlapGraph Requests P G Rectangles Maps U r A ⊆ + ZFSet.prod (externalTileVertices Requests Rectangles U) (externalTileVertices Requests Rectangles U) := by + intro z member + unfold externalRequestOverlapGraph at member + exact (ZFSet.mem_sep.1 member).1 + +theorem externalRequestOverlapGraph_symmetric {Requests P G Rectangles Maps U r A a b : ZFSet.{u}} + (entry : ZFSet.pair a b ∈ externalRequestOverlapGraph Requests P G Rectangles Maps U r A) : + ZFSet.pair b a ∈ externalRequestOverlapGraph Requests P G Rectangles Maps U r A := by + obtain ⟨ha, hb, q, hq, i, hi, x, hx, j, hj, y, hy, left, right, overlap⟩ := + (pair_mem_externalRequestOverlapGraph _ _ _ _ _ _ _ _ _ _).1 entry + exact (pair_mem_externalRequestOverlapGraph _ _ _ _ _ _ _ _ _ _).2 + ⟨hb, ha, q, hq, j, hj, y, hy, i, hi, x, hx, right, left, overlap.symm⟩ + +namespace BoundedFormula + +def externalRequestOverlapEntryFormula {n} + (z V Requests Tags U P G Rectangles Maps F r A zero first second : Fin n) : BoundedFormula n := + exMem V (exMem V.succ (exMem Requests.succ.succ (exMem Tags.succ.succ.succ + (exMem U.succ.succ.succ.succ (exMem Tags.succ.succ.succ.succ.succ + (exMem U.succ.succ.succ.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ.succ.succ.succ 6 5) + (.conj (orderedTripleFormula 6 4 3 2) + (.conj (orderedTripleFormula 5 4 1 0) + (externalRequestOverlapFormula P.succ.succ.succ.succ.succ.succ.succ + G.succ.succ.succ.succ.succ.succ.succ Rectangles.succ.succ.succ.succ.succ.succ.succ + Maps.succ.succ.succ.succ.succ.succ.succ F.succ.succ.succ.succ.succ.succ.succ + r.succ.succ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ.succ.succ + zero.succ.succ.succ.succ.succ.succ.succ first.succ.succ.succ.succ.succ.succ.succ + second.succ.succ.succ.succ.succ.succ.succ 4 3 2 1 0)))))))))) + +theorem truth_externalRequestOverlapEntryFormula {n} + (z V Requests Tags U P G Rectangles Maps F r A zero first second : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (externalRequestOverlapEntryFormula z V Requests Tags U P G Rectangles Maps F r A zero first second) env ↔ + ∃ a ∈ env V, ∃ b ∈ env V, ∃ q ∈ env Requests, + ∃ i ∈ env Tags, ∃ x ∈ env U, ∃ j ∈ env Tags, ∃ y ∈ env U, + env z = ZFSet.pair a b ∧ a = ZFSet.pair (ZFSet.pair q i) x ∧ + b = ZFSet.pair (ZFSet.pair q j) y ∧ + ExternalRequestOverlapCode (env P) (env G) (env Rectangles) (env Maps) (env F) (env r) (env A) + (env zero) (env first) (env second) q i x j y := by + simp only [externalRequestOverlapEntryFormula, Truth, truth_exMem, truth_orderedPairFormula, + truth_orderedTripleFormula, truth_externalRequestOverlapFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem externalTileVertices_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Requests Rectangles U : ZFSet.{u}} (hRequests : Requests ∈ M.sets) + (hRectangles : Rectangles ∈ M.sets) (hU : U ∈ M.sets) : + externalTileVertices Requests Rectangles U ∈ M.sets := by + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨U, hU⟩ + have hFirst : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero + have hSecond : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions hFirst hFirst + have single : ({natSetCode 2} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hSecond hSecond + exact M.binary_union_mem pairing unions + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hRequests (M.unorderedPair_mem pairing hZero hFirst)) hU) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation single hRectangles) single) hU) + +theorem externalRequestOverlapGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Requests P G Rectangles Maps U r A : ZFSet.{u}} + (hRequests : Requests ∈ M.sets) (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (hRectangles : Rectangles ∈ M.sets) (hMaps : Maps ∈ M.sets) (hU : U ∈ M.sets) + (hr : r ∈ M.sets) (hA : A ∈ M.sets) : + externalRequestOverlapGraph Requests P G Rectangles Maps U r A ∈ M.sets := by + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨U, hU⟩ + have hFirst : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero + have hSecond : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions hFirst hFirst + have single : ({natSetCode 2} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hSecond hSecond + have hTags : externalRequestTags ∈ M.sets := + M.insert_mem pairing unions hZero (M.insert_mem pairing unions hFirst single) + have hV := M.externalTileVertices_mem pairing unions powers separation hRequests hRectangles hU + have hF := M.union_mem unions (M.union_mem unions hMaps) + let params := extend (externalTileVertices Requests Rectangles U) (extend Requests + (extend externalRequestTags (extend U (extend P (extend G (extend Rectangles + (extend Maps (extend (ZFSet.sUnion (ZFSet.sUnion Maps)) (extend r (extend A (extend (natSetCode 0) + (extend (natSetCode 1) (extend (natSetCode 2) Fin.elim0))))))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalRequestOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) params + (Fin.cases hV (Fin.cases hRequests (Fin.cases hTags (Fin.cases hU (Fin.cases hP (Fin.cases hG + (Fin.cases hRectangles (Fin.cases hMaps (Fin.cases hF (Fin.cases hr (Fin.cases hA + (Fin.cases hZero (Fin.cases hFirst (Fin.cases hSecond (fun i => Fin.elim0 i))))))))))))))) + (M.prod_mem pairing unions powers separation hV hV) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.externalRequestOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) + (extend z params)) (ZFSet.prod (externalTileVertices Requests Rectangles U) + (externalTileVertices Requests Rectangles U)) = externalRequestOverlapGraph Requests P G Rectangles Maps U r A := by + apply ZFSet.ext + intro z + rw [externalRequestOverlapGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_externalRequestOverlapEntryFormula + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 _) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRewriteSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRewriteSteps.lean index c34ed0a7578e4c38e671c4ea7aa2409fae3dc622..fe58a0e444d4dc3d3a1b518ece779f5ea31daa3e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRewriteSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalRewriteSteps.lean @@ -1,114 +1,114 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalWordRewriteFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def externalWordStepGraph (W append G S m one : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ f ∈ W, ∃ g ∈ W, z = ZFSet.pair f g ∧ - ExternalWordStepCode W append G S m one f g) (ZFSet.prod W W) - -theorem pair_mem_externalWordStepGraph (W append G S m one f g : ZFSet.{u}) : - ZFSet.pair f g ∈ externalWordStepGraph W append G S m one ↔ - f ∈ W ∧ g ∈ W ∧ ExternalWordStepCode W append G S m one f g := by - rw [externalWordStepGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, f', hf, g', hg, equal, step⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hf, hg, step⟩ - · rintro ⟨hf, hg, step⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hg⟩, f, hf, g, hg, rfl, step⟩ - -theorem externalWordStepGraph_subset (W append G S m one : ZFSet.{u}) : - externalWordStepGraph W append G S m one ⊆ ZFSet.prod W W := - fun _ member => (ZFSet.mem_sep.1 member).1 - -theorem externalWordStepGraph_symmetric {W append G S m one f g : ZFSet.{u}} - (entry : ZFSet.pair f g ∈ externalWordStepGraph W append G S m one) : - ZFSet.pair g f ∈ externalWordStepGraph W append G S m one := by - obtain ⟨hf, hg, step⟩ := (pair_mem_externalWordStepGraph _ _ _ _ _ _ _ _).1 entry - exact (pair_mem_externalWordStepGraph _ _ _ _ _ _ _ _).2 ⟨hg, hf, step.symm⟩ - -namespace BoundedFormula - -def externalWordStepEntryFormula {n} (z W append zero unit G S m one : Fin n) : BoundedFormula n := - exMem W (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (externalWordStepFormula W.succ.succ append.succ.succ zero.succ.succ unit.succ.succ - G.succ.succ S.succ.succ m.succ.succ one.succ.succ 1 0))) - -theorem truth_externalWordStepEntryFormula {n} (z W append zero unit G S m one : Fin n) - (env : Fin n → ZFSet.{u}) (zeroValue : env zero = natSetCode 0) - (unitValue : env unit = natSetCode 1) : - Truth (externalWordStepEntryFormula z W append zero unit G S m one) env ↔ - ∃ f ∈ env W, ∃ g ∈ env W, env z = ZFSet.pair f g ∧ - ExternalWordStepCode (env W) (env append) (env G) (env S) (env m) (env one) f g := by - simp only [externalWordStepEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - constructor - · rintro ⟨f, hf, g, hg, equal, step⟩ - exact ⟨f, hf, g, hg, equal, - (truth_externalWordStepFormula W.succ.succ append.succ.succ zero.succ.succ unit.succ.succ - G.succ.succ S.succ.succ m.succ.succ one.succ.succ 1 0 (extend g (extend f env)) zeroValue unitValue).1 step⟩ - · rintro ⟨f, hf, g, hg, equal, step⟩ - exact ⟨f, hf, g, hg, equal, - (truth_externalWordStepFormula W.succ.succ append.succ.succ zero.succ.succ unit.succ.succ - G.succ.succ S.succ.succ m.succ.succ one.succ.succ 1 0 (extend g (extend f env)) zeroValue unitValue).2 step⟩ - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem externalWordStepGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {W append G S m one : ZFSet.{u}} - (hW : W ∈ M.sets) (hAppend : append ∈ M.sets) (hG : G ∈ M.sets) - (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : - externalWordStepGraph W append G S m one ∈ M.sets := by - have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨W, hW⟩ - have hUnit : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero - let params := extend W (extend append (extend (natSetCode 0) (extend (natSetCode 1) - (extend G (extend S (extend m (extend one Fin.elim0))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalWordStepEntryFormula 0 1 2 3 4 5 6 7 8) params - (Fin.cases hW (Fin.cases hAppend (Fin.cases hZero (Fin.cases hUnit - (Fin.cases hG (Fin.cases hS (Fin.cases hm (Fin.cases hOne (fun j => Fin.elim0 j))))))))) - (M.prod_mem pairing unions powers separation hW hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.externalWordStepEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) - (ZFSet.prod W W) = externalWordStepGraph W append G S m one := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, externalWordStepGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_externalWordStepEntryFormula - 0 1 2 3 4 5 6 7 8 _ rfl rfl) - exact equal ▸ selected - -noncomputable def externalWordSteps (G S m one : ZFSet.{u}) : ZFSet.{u} := - externalWordStepGraph (M.finiteWords (externalGeneratorAlphabet G S)) - (M.finiteWordAppendGraph (externalGeneratorAlphabet G S)) G S m one - -theorem externalWordSteps_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {G S m one : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) - (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : M.externalWordSteps G S m one ∈ M.sets := by - have alphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - exact M.externalWordStepGraph_mem pairing unions powers separation - (M.finiteWords_mem pairing unions powers separation infinite alphabet) - (M.finiteWordAppendGraph_mem pairing unions powers separation infinite alphabet) hG hS hm hOne - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalWordRewriteFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def externalWordStepGraph (W append G S m one : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ f ∈ W, ∃ g ∈ W, z = ZFSet.pair f g ∧ + ExternalWordStepCode W append G S m one f g) (ZFSet.prod W W) + +theorem pair_mem_externalWordStepGraph (W append G S m one f g : ZFSet.{u}) : + ZFSet.pair f g ∈ externalWordStepGraph W append G S m one ↔ + f ∈ W ∧ g ∈ W ∧ ExternalWordStepCode W append G S m one f g := by + rw [externalWordStepGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, f', hf, g', hg, equal, step⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hf, hg, step⟩ + · rintro ⟨hf, hg, step⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hg⟩, f, hf, g, hg, rfl, step⟩ + +theorem externalWordStepGraph_subset (W append G S m one : ZFSet.{u}) : + externalWordStepGraph W append G S m one ⊆ ZFSet.prod W W := + fun _ member => (ZFSet.mem_sep.1 member).1 + +theorem externalWordStepGraph_symmetric {W append G S m one f g : ZFSet.{u}} + (entry : ZFSet.pair f g ∈ externalWordStepGraph W append G S m one) : + ZFSet.pair g f ∈ externalWordStepGraph W append G S m one := by + obtain ⟨hf, hg, step⟩ := (pair_mem_externalWordStepGraph _ _ _ _ _ _ _ _).1 entry + exact (pair_mem_externalWordStepGraph _ _ _ _ _ _ _ _).2 ⟨hg, hf, step.symm⟩ + +namespace BoundedFormula + +def externalWordStepEntryFormula {n} (z W append zero unit G S m one : Fin n) : BoundedFormula n := + exMem W (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (externalWordStepFormula W.succ.succ append.succ.succ zero.succ.succ unit.succ.succ + G.succ.succ S.succ.succ m.succ.succ one.succ.succ 1 0))) + +theorem truth_externalWordStepEntryFormula {n} (z W append zero unit G S m one : Fin n) + (env : Fin n → ZFSet.{u}) (zeroValue : env zero = natSetCode 0) + (unitValue : env unit = natSetCode 1) : + Truth (externalWordStepEntryFormula z W append zero unit G S m one) env ↔ + ∃ f ∈ env W, ∃ g ∈ env W, env z = ZFSet.pair f g ∧ + ExternalWordStepCode (env W) (env append) (env G) (env S) (env m) (env one) f g := by + simp only [externalWordStepEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + constructor + · rintro ⟨f, hf, g, hg, equal, step⟩ + exact ⟨f, hf, g, hg, equal, + (truth_externalWordStepFormula W.succ.succ append.succ.succ zero.succ.succ unit.succ.succ + G.succ.succ S.succ.succ m.succ.succ one.succ.succ 1 0 (extend g (extend f env)) zeroValue unitValue).1 step⟩ + · rintro ⟨f, hf, g, hg, equal, step⟩ + exact ⟨f, hf, g, hg, equal, + (truth_externalWordStepFormula W.succ.succ append.succ.succ zero.succ.succ unit.succ.succ + G.succ.succ S.succ.succ m.succ.succ one.succ.succ 1 0 (extend g (extend f env)) zeroValue unitValue).2 step⟩ + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem externalWordStepGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {W append G S m one : ZFSet.{u}} + (hW : W ∈ M.sets) (hAppend : append ∈ M.sets) (hG : G ∈ M.sets) + (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : + externalWordStepGraph W append G S m one ∈ M.sets := by + have hZero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨W, hW⟩ + have hUnit : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero + let params := extend W (extend append (extend (natSetCode 0) (extend (natSetCode 1) + (extend G (extend S (extend m (extend one Fin.elim0))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalWordStepEntryFormula 0 1 2 3 4 5 6 7 8) params + (Fin.cases hW (Fin.cases hAppend (Fin.cases hZero (Fin.cases hUnit + (Fin.cases hG (Fin.cases hS (Fin.cases hm (Fin.cases hOne (fun j => Fin.elim0 j))))))))) + (M.prod_mem pairing unions powers separation hW hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.externalWordStepEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) + (ZFSet.prod W W) = externalWordStepGraph W append G S m one := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, externalWordStepGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_externalWordStepEntryFormula + 0 1 2 3 4 5 6 7 8 _ rfl rfl) + exact equal ▸ selected + +noncomputable def externalWordSteps (G S m one : ZFSet.{u}) : ZFSet.{u} := + externalWordStepGraph (M.finiteWords (externalGeneratorAlphabet G S)) + (M.finiteWordAppendGraph (externalGeneratorAlphabet G S)) G S m one + +theorem externalWordSteps_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {G S m one : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) + (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : M.externalWordSteps G S m one ∈ M.sets := by + have alphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + exact M.externalWordStepGraph_mem pairing unions powers separation + (M.finiteWords_mem pairing unions powers separation infinite alphabet) + (M.finiteWordAppendGraph_mem pairing unions powers separation infinite alphabet) hG hS hm hOne + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSerializedCore.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSerializedCore.lean index a1db0575dcd5b21f579530bbc45134fe3cf98c12..ffc549ef350413b91d547f7889e5aef1e123916f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSerializedCore.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSerializedCore.lean @@ -1,105 +1,105 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -open scoped ZFSet -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundSerializedChronology M T0 C D rD) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (hOld : oldTimes ∈ T0) - -noncomputable abbrev serializedFields : GroundChronologyFields M (insert births.limit births.limit) := - births.groundChronologyFields heights prior.fields data group action - pairing unions powers separation infinite hG hP0 prior.ordinal hOld - -local notation "fields" => births.serializedFields heights prior data group action - pairing unions powers separation infinite hG hP0 hOld - -include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld - -theorem serializedFields_value (j : Fin 5) {s : ZFSet.{u}} - (hs : s ∈ insert births.limit births.limit) : - (fields).value j s = (births.chronologyFields heights prior.toHistory).fieldValue j s := by - apply births.groundChronologyFields_values heights prior.fields data group action - pairing unions powers separation infinite hG hP0 prior.ordinal hOld prior.toHistory ?_ j hs - intro k a _ - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) k - -theorem serializedFields_core : - ChronologyCoreCode (insert births.limit births.limit) (fields).bound C D rD (fields).graph := by - refine ⟨(fields).function, ?_⟩ - intro s hs L r μ birth height eL er eμ eb eh - have v (j : Fin 5) := births.serializedFields_value heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j hs - have laws := births.chronologyFields_stage_laws heights prior.toHistory data group action - pairing unions powers separation infinite hG hP0 prior.ordinal hOld hs - rw [← (fields).value_eq_of_entry 0 eL, ← (fields).value_eq_of_entry 1 er, - ← (fields).value_eq_of_entry 2 eμ, ← (fields).value_eq_of_entry 3 eb, - ← (fields).value_eq_of_entry 4 eh, v 0, v 1, v 2, v 3, v 4] - exact ⟨laws.1, laws.2.1, laws.2.2.1, laws.2.2.2.1, laws.2.2.2.2⟩ - -theorem serializedFields_old (j : Fin 5) {s : ZFSet.{u}} - (before : s ∈ oldTimes ∨ s = oldTimes) : - (fields).value j s = prior.fields.value j s := by - have hs : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ - ((births.times.mem_limit_iff s).2 (before.elim Or.inl (fun h => Or.inr (Or.inl h)))) - rw [births.serializedFields_value heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j hs] - have values := births.chronologyFields_old heights prior.toHistory before - exact Fin.cases values.1 (Fin.cases values.2.1 (Fin.cases values.2.2.1 - (Fin.cases values.2.2.2.1 (Fin.cases values.2.2.2.2 (fun i => Fin.elim0 i))))) j - -theorem serializedFields_stamp (j : Fin 5) (n : Nat) : - (fields).value j (compressionStamp oldTimes n) = births.cutoffField heights j n := by - rw [births.serializedFields_value heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j - (ZFSet.mem_insert_of_mem _ (births.times.stamp_mem_limit n))] - have values := births.chronologyFields_stamp heights prior.toHistory n - exact Fin.cases values.1 (Fin.cases values.2.1 (Fin.cases values.2.2.1 - (Fin.cases values.2.2.2.1 (Fin.cases values.2.2.2.2 (fun i => Fin.elim0 i))))) j - -theorem serializedFields_limit (j : Fin 5) : - (fields).value j births.limit = births.terminalField heights j := by - rw [births.serializedFields_value heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j (ZFSet.mem_insert _ _)] - have values := births.chronologyFields_limit heights prior.toHistory - exact Fin.cases values.1 (Fin.cases values.2.1 (Fin.cases values.2.2.1 - (Fin.cases values.2.2.2.1 (Fin.cases values.2.2.2.2 (fun i => Fin.elim0 i))))) j - -theorem serializedFields_old_entries (j : Fin 5) {s : ZFSet.{u}} - (before : s ∈ oldTimes ∨ s = oldTimes) (y : ZFSet.{u}) : - ZFSet.pair s y ∈ (fields).graph j ↔ ZFSet.pair s y ∈ prior.fields.graph j := by - have oldValue := births.serializedFields_old heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j before - have hs : s ∈ T0 := before.elim (fun h => prior.ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) - have hs' : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ - ((births.times.mem_limit_iff s).2 (before.elim Or.inl (fun h => Or.inr (Or.inl h)))) - constructor - · intro entry - have equal := oldValue.symm.trans ((fields).value_eq_of_entry j entry) - exact equal ▸ prior.fields.value_entry j hs - · intro entry - have equal := oldValue.trans (prior.fields.value_eq_of_entry j entry) - exact equal ▸ (fields).value_entry j hs' - -end PartitionPilot.Forcing.GroundExternalBirthData - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +open scoped ZFSet +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundSerializedChronology M T0 C D rD) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (hOld : oldTimes ∈ T0) + +noncomputable abbrev serializedFields : GroundChronologyFields M (insert births.limit births.limit) := + births.groundChronologyFields heights prior.fields data group action + pairing unions powers separation infinite hG hP0 prior.ordinal hOld + +local notation "fields" => births.serializedFields heights prior data group action + pairing unions powers separation infinite hG hP0 hOld + +include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld + +theorem serializedFields_value (j : Fin 5) {s : ZFSet.{u}} + (hs : s ∈ insert births.limit births.limit) : + (fields).value j s = (births.chronologyFields heights prior.toHistory).fieldValue j s := by + apply births.groundChronologyFields_values heights prior.fields data group action + pairing unions powers separation infinite hG hP0 prior.ordinal hOld prior.toHistory ?_ j hs + intro k a _ + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) k + +theorem serializedFields_core : + ChronologyCoreCode (insert births.limit births.limit) (fields).bound C D rD (fields).graph := by + refine ⟨(fields).function, ?_⟩ + intro s hs L r μ birth height eL er eμ eb eh + have v (j : Fin 5) := births.serializedFields_value heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j hs + have laws := births.chronologyFields_stage_laws heights prior.toHistory data group action + pairing unions powers separation infinite hG hP0 prior.ordinal hOld hs + rw [← (fields).value_eq_of_entry 0 eL, ← (fields).value_eq_of_entry 1 er, + ← (fields).value_eq_of_entry 2 eμ, ← (fields).value_eq_of_entry 3 eb, + ← (fields).value_eq_of_entry 4 eh, v 0, v 1, v 2, v 3, v 4] + exact ⟨laws.1, laws.2.1, laws.2.2.1, laws.2.2.2.1, laws.2.2.2.2⟩ + +theorem serializedFields_old (j : Fin 5) {s : ZFSet.{u}} + (before : s ∈ oldTimes ∨ s = oldTimes) : + (fields).value j s = prior.fields.value j s := by + have hs : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ + ((births.times.mem_limit_iff s).2 (before.elim Or.inl (fun h => Or.inr (Or.inl h)))) + rw [births.serializedFields_value heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j hs] + have values := births.chronologyFields_old heights prior.toHistory before + exact Fin.cases values.1 (Fin.cases values.2.1 (Fin.cases values.2.2.1 + (Fin.cases values.2.2.2.1 (Fin.cases values.2.2.2.2 (fun i => Fin.elim0 i))))) j + +theorem serializedFields_stamp (j : Fin 5) (n : Nat) : + (fields).value j (compressionStamp oldTimes n) = births.cutoffField heights j n := by + rw [births.serializedFields_value heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j + (ZFSet.mem_insert_of_mem _ (births.times.stamp_mem_limit n))] + have values := births.chronologyFields_stamp heights prior.toHistory n + exact Fin.cases values.1 (Fin.cases values.2.1 (Fin.cases values.2.2.1 + (Fin.cases values.2.2.2.1 (Fin.cases values.2.2.2.2 (fun i => Fin.elim0 i))))) j + +theorem serializedFields_limit (j : Fin 5) : + (fields).value j births.limit = births.terminalField heights j := by + rw [births.serializedFields_value heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j (ZFSet.mem_insert _ _)] + have values := births.chronologyFields_limit heights prior.toHistory + exact Fin.cases values.1 (Fin.cases values.2.1 (Fin.cases values.2.2.1 + (Fin.cases values.2.2.2.1 (Fin.cases values.2.2.2.2 (fun i => Fin.elim0 i))))) j + +theorem serializedFields_old_entries (j : Fin 5) {s : ZFSet.{u}} + (before : s ∈ oldTimes ∨ s = oldTimes) (y : ZFSet.{u}) : + ZFSet.pair s y ∈ (fields).graph j ↔ ZFSet.pair s y ∈ prior.fields.graph j := by + have oldValue := births.serializedFields_old heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j before + have hs : s ∈ T0 := before.elim (fun h => prior.ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) + have hs' : s ∈ insert births.limit births.limit := ZFSet.mem_insert_of_mem _ + ((births.times.mem_limit_iff s).2 (before.elim Or.inl (fun h => Or.inr (Or.inl h)))) + constructor + · intro entry + have equal := oldValue.symm.trans ((fields).value_eq_of_entry j entry) + exact equal ▸ prior.fields.value_entry j hs + · intro entry + have equal := oldValue.trans (prior.fields.value_eq_of_entry j entry) + exact equal ▸ (fields).value_entry j hs' + +end PartitionPilot.Forcing.GroundExternalBirthData + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSlotCopies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSlotCopies.lean index 7b025db702ee16212006e46b76562de9d224cb3d..a71d2c2c83cb14a04e40bd6361f2a2909281191e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSlotCopies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalSlotCopies.lean @@ -1,143 +1,143 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalSlotCopyGraphs -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExternalBirthLayers - -namespace OAI - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry -universe u - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -noncomputable def externalSlotCopyRelation (P r μ A j : ZFSet.{u}) : ZFSet.{u} := - externalSlotCopyGraph - (M.externalStarVertices G (externalChildLetters I P (externalRectangles P G r μ A)) - (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) - (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - (externalRequestCarrier I P (externalRectangles P G r μ A)) - (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) - (completion.externalPointAction P r μ A) (completion.localTileVertexImages P r μ A) j - -noncomputable def externalSlotCopyMaps (P r μ A Active j : ZFSet.{u}) : ZFSet.{u} := - M.indexedRelationSections Active (completion.algebra.union.fields 0) - (completion.externalPointCarrier P r μ A) (completion.externalSlotCopyRelation P r μ A j) -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original -local notation "R(" j ")" => completion.externalSlotCopyRelation P0 r0 μ0 A0 j -include data group oldAction pairing unions powers separation infinite hG - -theorem externalSlotCopyRelation_ground (hP0 : P0 ∈ M.sets) {j : ZFSet.{u}} (hj : j ∈ M.sets) : - R(j) ∈ M.sets := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have localGround := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 - exact M.externalSlotCopyGraph_mem pairing unions powers separation - (data.externalStarCarriers_ground pairing unions powers separation hG).1 data.group.carrier_mem - data.words.requests_ground (completion.algebra.union.ground 0) geometry.carrier_ground - geometry.action_ground localGround.2.2.2.1 hj - -theorem externalSlotCopyRelation_entry : - letI := group.toGroup - ∀ (w : External (SetMembers G) (family).Letters) (r : Index) - (i : Option ((family).Child r)) (x : SetMembers U) (y : (family).Node (action)), - ZFSet.pair (ZFSet.pair ((vpres).encode (.inr (w, r))) (SetMembers.raw x)) ((q).encode y) ∈ R(vcode r i) ↔ - ((family).placedTile (action) w r).toFun (((family).flatVertex r i).toFun x) = y := by - let := group.toGroup - intro w r i x y - have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - have vc := (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 - have acted := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.2.1 - rw [GroundCompressionCompletion.externalSlotCopyRelation, triple_mem_externalSlotCopyGraph] - constructor - · rintro ⟨_, _, _, w', _, r', _, z, hz, equal, copied, moved⟩ - change ZFSet.pair (natSetCode 1) (ZFSet.pair ((s).encode w) (externalRequestIndexCode r)) = - ZFSet.pair (natSetCode 1) (ZFSet.pair w' r') at equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).2 - obtain ⟨z, rfl⟩ := ((q).mem_carrier z).1 (qc.symm ▸ hz) - have copied' := (data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG - r i x z).1 copied - have moved' := (acted w z y).1 moved - rw [← copied', ← (family).flatVertex_copy, (family).translate_tile, mul_one] at moved' - exact moved' - · intro equal - refine ⟨vc ▸ (vpres).encode_mem _, SetMembers.raw_mem x, qc ▸ (q).encode_mem _, - (s).encode w, sc ▸ (s).encode_mem _, externalRequestIndexCode r, - (externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem _, - (q).encode (((family).placedTile (action) 1 r).toFun (((family).flatVertex r i).toFun x)), - qc ▸ (q).encode_mem _, rfl, ?_, ?_⟩ - · apply (data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG r i x _).2 - exact ((family).flatVertex_copy (action) 1 r i x).symm - · apply (acted w _ _).2 - rw [(family).translate_tile, mul_one] - exact equal - -theorem externalSlotCopySection_eq : - letI := group.toGroup - ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (i : Option ((family).Child r)), - indexedRelationSection U B R(vcode r i) ((vpres).encode (.inr (w, r))) = - completion.externalCopyGraph P0 r0 μ0 A0 ((s).encode ((family).flatWord w r i)) := by - let := group.toGroup - intro w r i - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - rw [data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨x, hx, y, hy, rfl, copied⟩ := (mem_indexedRelationSection _ _ _ _ _).1 entry - obtain ⟨y, rfl⟩ := ((q).mem_carrier y).1 (qc.symm ▸ hy) - let x' := SetMembers.ofMem x hx - have image := (data.externalSlotCopyRelation_entry group oldAction pairing unions powers separation infinite hG - w r i x' y).1 (by simpa only [x', SetMembers.raw_ofMem] using copied) - rw [(family).flatVertex_copy] at image - have result := ((SetMembers.presentation U).pair_mem_graph (q) _ x' y).2 image - simpa only [SetMembers.presentation, x', SetMembers.raw_ofMem] using result - · intro entry - obtain ⟨x, rfl⟩ := ((SetMembers.presentation U).mem_graph (q) _ z).1 entry - apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 - refine ⟨SetMembers.raw_mem x, qc ▸ (q).encode_mem _, ?_⟩ - exact (data.externalSlotCopyRelation_entry group oldAction pairing unions powers separation infinite hG - w r i x _).2 ((family).flatVertex_copy (action) w r i x) - -theorem externalSlotCopyMaps_spec (hP0 : P0 ∈ M.sets) {Active j : ZFSet.{u}} - (hActive : Active ∈ M.sets) (hj : j ∈ M.sets) : - completion.externalSlotCopyMaps P0 r0 μ0 A0 Active j ∈ M.sets ∧ - ZFSet.IsFunc Active (M.groundRelations U B) (completion.externalSlotCopyMaps P0 r0 μ0 A0 Active j) ∧ - ∀ v e, ZFSet.pair v e ∈ completion.externalSlotCopyMaps P0 r0 μ0 A0 Active j ↔ - v ∈ Active ∧ e = indexedRelationSection U B R(j) v := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - exact M.indexedRelationSections_spec pairing unions powers separation hActive - (completion.algebra.union.ground 0) geometry.carrier_ground - (data.externalSlotCopyRelation_ground group oldAction pairing unions powers separation infinite hG hP0 hj) - -end GroundExternalGeometryInputs - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalSlotCopyGraphs +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExternalBirthLayers + +namespace OAI + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry +universe u + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +noncomputable def externalSlotCopyRelation (P r μ A j : ZFSet.{u}) : ZFSet.{u} := + externalSlotCopyGraph + (M.externalStarVertices G (externalChildLetters I P (externalRectangles P G r μ A)) + (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) + (M.externalGroupCarrier G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + (externalRequestCarrier I P (externalRectangles P G r μ A)) + (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) + (completion.externalPointAction P r μ A) (completion.localTileVertexImages P r μ A) j + +noncomputable def externalSlotCopyMaps (P r μ A Active j : ZFSet.{u}) : ZFSet.{u} := + M.indexedRelationSections Active (completion.algebra.union.fields 0) + (completion.externalPointCarrier P r μ A) (completion.externalSlotCopyRelation P r μ A j) +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original +local notation "R(" j ")" => completion.externalSlotCopyRelation P0 r0 μ0 A0 j +include data group oldAction pairing unions powers separation infinite hG + +theorem externalSlotCopyRelation_ground (hP0 : P0 ∈ M.sets) {j : ZFSet.{u}} (hj : j ∈ M.sets) : + R(j) ∈ M.sets := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have localGround := data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0 + exact M.externalSlotCopyGraph_mem pairing unions powers separation + (data.externalStarCarriers_ground pairing unions powers separation hG).1 data.group.carrier_mem + data.words.requests_ground (completion.algebra.union.ground 0) geometry.carrier_ground + geometry.action_ground localGround.2.2.2.1 hj + +theorem externalSlotCopyRelation_entry : + letI := group.toGroup + ∀ (w : External (SetMembers G) (family).Letters) (r : Index) + (i : Option ((family).Child r)) (x : SetMembers U) (y : (family).Node (action)), + ZFSet.pair (ZFSet.pair ((vpres).encode (.inr (w, r))) (SetMembers.raw x)) ((q).encode y) ∈ R(vcode r i) ↔ + ((family).placedTile (action) w r).toFun (((family).flatVertex r i).toFun x) = y := by + let := group.toGroup + intro w r i x y + have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + have vc := (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 + have acted := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.2.1 + rw [GroundCompressionCompletion.externalSlotCopyRelation, triple_mem_externalSlotCopyGraph] + constructor + · rintro ⟨_, _, _, w', _, r', _, z, hz, equal, copied, moved⟩ + change ZFSet.pair (natSetCode 1) (ZFSet.pair ((s).encode w) (externalRequestIndexCode r)) = + ZFSet.pair (natSetCode 1) (ZFSet.pair w' r') at equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).2 + obtain ⟨z, rfl⟩ := ((q).mem_carrier z).1 (qc.symm ▸ hz) + have copied' := (data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG + r i x z).1 copied + have moved' := (acted w z y).1 moved + rw [← copied', ← (family).flatVertex_copy, (family).translate_tile, mul_one] at moved' + exact moved' + · intro equal + refine ⟨vc ▸ (vpres).encode_mem _, SetMembers.raw_mem x, qc ▸ (q).encode_mem _, + (s).encode w, sc ▸ (s).encode_mem _, externalRequestIndexCode r, + (externalRequestPresentation I P0 (externalRectangles P0 G r0 μ0 A0)).encode_mem _, + (q).encode (((family).placedTile (action) 1 r).toFun (((family).flatVertex r i).toFun x)), + qc ▸ (q).encode_mem _, rfl, ?_, ?_⟩ + · apply (data.localTileVertexImages_entry_iff group oldAction pairing unions powers separation infinite hG r i x _).2 + exact ((family).flatVertex_copy (action) 1 r i x).symm + · apply (acted w _ _).2 + rw [(family).translate_tile, mul_one] + exact equal + +theorem externalSlotCopySection_eq : + letI := group.toGroup + ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (i : Option ((family).Child r)), + indexedRelationSection U B R(vcode r i) ((vpres).encode (.inr (w, r))) = + completion.externalCopyGraph P0 r0 μ0 A0 ((s).encode ((family).flatWord w r i)) := by + let := group.toGroup + intro w r i + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + rw [data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨x, hx, y, hy, rfl, copied⟩ := (mem_indexedRelationSection _ _ _ _ _).1 entry + obtain ⟨y, rfl⟩ := ((q).mem_carrier y).1 (qc.symm ▸ hy) + let x' := SetMembers.ofMem x hx + have image := (data.externalSlotCopyRelation_entry group oldAction pairing unions powers separation infinite hG + w r i x' y).1 (by simpa only [x', SetMembers.raw_ofMem] using copied) + rw [(family).flatVertex_copy] at image + have result := ((SetMembers.presentation U).pair_mem_graph (q) _ x' y).2 image + simpa only [SetMembers.presentation, x', SetMembers.raw_ofMem] using result + · intro entry + obtain ⟨x, rfl⟩ := ((SetMembers.presentation U).mem_graph (q) _ z).1 entry + apply (pair_mem_indexedRelationSection _ _ _ _ _ _).2 + refine ⟨SetMembers.raw_mem x, qc ▸ (q).encode_mem _, ?_⟩ + exact (data.externalSlotCopyRelation_entry group oldAction pairing unions powers separation infinite hG + w r i x _).2 ((family).flatVertex_copy (action) w r i x) + +theorem externalSlotCopyMaps_spec (hP0 : P0 ∈ M.sets) {Active j : ZFSet.{u}} + (hActive : Active ∈ M.sets) (hj : j ∈ M.sets) : + completion.externalSlotCopyMaps P0 r0 μ0 A0 Active j ∈ M.sets ∧ + ZFSet.IsFunc Active (M.groundRelations U B) (completion.externalSlotCopyMaps P0 r0 μ0 A0 Active j) ∧ + ∀ v e, ZFSet.pair v e ∈ completion.externalSlotCopyMaps P0 r0 μ0 A0 Active j ↔ + v ∈ Active ∧ e = indexedRelationSection U B R(j) v := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + exact M.indexedRelationSections_spec pairing unions powers separation hActive + (completion.algebra.union.ground 0) geometry.carrier_ground + (data.externalSlotCopyRelation_ground group oldAction pairing unions powers separation infinite hG hP0 hj) + +end GroundExternalGeometryInputs + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalStarOverlaps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalStarOverlaps.lean index 7c9d8c0d66edd11aac93c5e8c0e1e791a75c03d6..ca562b5e9c81444395e254371ec887c8a57d055f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalStarOverlaps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalStarOverlaps.lean @@ -1,464 +1,464 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalStarSupports - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -theorem lowerDepthEdgeCode_iff {B : Type u} (s : Presentation B) (depth : B → Nat) - {depths adjacency : ZFSet.{u}} - (entries : ∀ x n, ZFSet.pair (s.encode x) (natSetCode n) ∈ depths ↔ n = depth x) - (p v : B) : - LowerDepthEdgeCode ZFSet.omega depths adjacency (s.encode p) (s.encode v) ↔ - ZFSet.pair (s.encode p) (s.encode v) ∈ adjacency ∧ depth p + 1 = depth v := by - constructor - · rintro ⟨edge, n, hn, m, hm, en, em, successor⟩ - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - rw [(entries v n).1 en, (entries p m).1 em, ← natSetCode_succ] at successor - exact ⟨edge, (natSetCode_injective successor).symm⟩ - · rintro ⟨edge, lower⟩ - exact ⟨edge, natSetCode (depth v), natSetCode_mem_omega _, - natSetCode (depth p), natSetCode_mem_omega _, (entries v _).2 rfl, - (entries p _).2 rfl, by rw [← lower, natSetCode_succ]⟩ - -end PartitionPilot.Forcing - -namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars -open Forcing SetRealization SetFormula -universe u -variable (J S R : Type u) [Group J] (request : S → R) -variable (s : Presentation (Vertex J S R)) {depths adjacency : ZFSet.{u}} -variable (depthEntries : ∀ x n, ZFSet.pair (s.encode x) (natSetCode n) ∈ depths ↔ - n = depth J S R request x) -variable (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ adjacency ↔ - ∃ d : Dart J S R, TileStars.source J S R request d = x ∧ TileStars.target J S R request d = y) - -include depthEntries edges -theorem parentGraph_entry (v p : Vertex J S R) : - ZFSet.pair (s.encode v) (s.encode p) ∈ - treeParentGraph s.carrier depths adjacency (s.encode (root J S R)) ↔ - parent J S R request v = p := by - rw [pair_mem_treeParentGraph, lowerDepthEdgeCode_iff s (depth J S R request) depthEntries, - edges, s.injective.eq_iff, s.injective.eq_iff] - exact ⟨fun h => (parent_iff J S R request v p).2 h.2.2, - fun h => ⟨s.encode_mem v, s.encode_mem p, (parent_iff J S R request v p).1 h⟩⟩ - -theorem parentGraph_eq_graph : - treeParentGraph s.carrier depths adjacency (s.encode (root J S R)) = - s.graph s (parent J S R request) := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨v, hv, p, hp, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 - obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv - obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 hp - exact (s.pair_mem_graph s _ v p).2 - ((parentGraph_entry J S R request s depthEntries edges v p).1 entry) - · intro entry - obtain ⟨v, rfl⟩ := (s.mem_graph s (parent J S R request) z).1 entry - exact (parentGraph_entry J S R request s depthEntries edges v _).2 rfl - -theorem parentGraph_spec (M : Forcing.TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hV : s.carrier ∈ M.sets) (hDepths : depths ∈ M.sets) (hAdjacency : adjacency ∈ M.sets) : - treeParentGraph s.carrier depths adjacency (s.encode (root J S R)) ∈ M.sets ∧ - ZFSet.IsFunc s.carrier s.carrier - (treeParentGraph s.carrier depths adjacency (s.encode (root J S R))) := by - refine ⟨M.treeParentGraph_mem pairing unions powers separation infinite hV hDepths hAdjacency - (M.transitive hV (s.encode_mem _)), ?_⟩ - rw [parentGraph_eq_graph J S R request s depthEntries edges] - exact s.graph_isFunc s _ - -end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars - -end - -namespace PartitionPilot.Forcing -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -noncomputable def externalStarRoot (G S m one : ZFSet.{u}) : ZFSet.{u} := - ZFSet.pair (natSetCode 0) (equivalenceClass (M.externalGroupCarrier G S m one) - (M.externalCosetEquivalence G S m one) (M.externalGroupIdentity G S m one)) -noncomputable def externalStarDepth (G S R m one : ZFSet.{u}) : ZFSet.{u} := - M.relationDepthGraph (M.externalStarVertices G S R m one) (M.externalStarAdjacency G S R m one) - (M.externalStarRoot G S m one) - -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original -local notation "sRequest" => externalRequestPresentation I P0 rectangles -local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG - -theorem externalStarRoot_eq_encode : - letI := group.toGroup - M.externalStarRoot G letters m one = - (sVertex).encode (TileStars.root (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by - let instRootEncodeGroup := group.toGroup - change ZFSet.pair (natSetCode 0) (equivalenceClass (M.externalGroupCarrier G letters m one) - (M.externalCosetEquivalence G letters m one) (M.externalGroupIdentity G letters m one)) = - ZFSet.pair (natSetCode 0) (equivalenceClass (sGroup).carrier - (externalCosetRelation (sGroup).carrier G (M.externalOldInclusion G letters m one) - (M.externalGroupMultiplication G letters m one)) ((sGroup).encode 1)) - rw [completion.externalFamilyGroupPresentation_carrier, - completion.externalFamilyGroupPresentation_identity group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground] - rfl - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarRoot_mem : M.externalStarRoot G letters m one ∈ M.sets := by - let instRootMembershipGroup := group.toGroup - rw [data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] - have members := data.externalStarCarriers_ground pairing unions powers separation hG - have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG - exact M.transitive (carriers.1.symm ▸ members.1) ((sVertex).encode_mem _) - -theorem externalStarDepth_eq_graph : - letI := group.toGroup - M.externalStarDepth G letters requests m one = (sVertex).graph natPresentation - (fun x => ⟨TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x⟩) := by - let instDepthGraphGroup := group.toGroup - have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG - have members := data.externalStarCarriers_ground pairing unions powers separation hG - have eq := TileStars.depthGraph_eq_graph (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) - (fun a => a.1) M pairing unions separation infinite (sVertex) - (data.externalStarAdjacency_iff group oldAction pairing unions powers separation infinite hG) - (carriers.1.symm ▸ members.1) - rw [carriers.1, ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at eq - exact eq - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarDepth_ground_function : - M.externalStarDepth G letters requests m one ∈ M.sets ∧ - ZFSet.IsFunc (M.externalStarVertices G letters requests m one) ZFSet.omega - (M.externalStarDepth G letters requests m one) := by - let instDepthFunctionGroup := group.toGroup - have members := data.externalStarCarriers_ground pairing unions powers separation hG - have adjacency := (data.externalStarIncidence_ground pairing unions powers separation hG).2.2.2.2.2 - refine ⟨M.relationDepthGraph_mem pairing unions powers separation infinite members.1 adjacency - (data.externalStarRoot_mem group oldAction pairing unions powers separation infinite hG), ?_⟩ - rw [data.externalStarDepth_eq_graph group oldAction pairing unions powers separation infinite hG] - have function := (sVertex).graph_isFunc natPresentation - (fun x => ⟨TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x⟩) - rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1] at function - exact function - -theorem externalStarDepth_iff : - letI := group.toGroup - ∀ x n, ZFSet.pair ((sVertex).encode x) (natSetCode n) ∈ M.externalStarDepth G letters requests m one ↔ - n = TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x := by - let instDepthEntryGroup := group.toGroup - intro x n - rw [data.externalStarDepth_eq_graph group oldAction pairing unions powers separation infinite hG] - have entry := (sVertex).pair_mem_graph natPresentation - (fun x => ⟨TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x⟩) x ⟨n⟩ - exact entry.trans ⟨fun equal => (congrArg ULift.down equal).symm, fun equal => congrArg ULift.up equal.symm⟩ - -end GroundExternalGeometryInputs - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -noncomputable def externalStarLayer (G S R m one n : ZFSet.{u}) : ZFSet.{u} := - relationFiber (M.externalStarVertices G S R m one) - (relationConverse (M.externalStarVertices G S R m one) ZFSet.omega (M.externalStarDepth G S R m one)) n -noncomputable def externalStarLayers (G S R m one : ZFSet.{u}) : ZFSet.{u} := - M.relationFiberFamily ZFSet.omega (M.externalStarVertices G S R m one) - (relationConverse (M.externalStarVertices G S R m one) ZFSet.omega (M.externalStarDepth G S R m one)) - -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original -local notation "sRequest" => externalRequestPresentation I P0 rectangles -local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarLayers_spec : - M.externalStarLayers G letters requests m one ∈ M.sets ∧ - ZFSet.IsFunc ZFSet.omega (M.groundPower (M.externalStarVertices G letters requests m one)) - (M.externalStarLayers G letters requests m one) ∧ - ∀ n L, ZFSet.pair n L ∈ M.externalStarLayers G letters requests m one ↔ - n ∈ ZFSet.omega ∧ L = M.externalStarLayer G letters requests m one n := by - have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have depth := (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).1 - have omega := M.omega_mem separation infinite - have converse := M.relationConverse_mem pairing unions powers separation vertices omega depth - exact ⟨M.relationFiberFamily_mem pairing unions powers separation omega vertices converse, - M.relationFiberFamily_function separation omega vertices converse, - M.relationFiberFamily_entries separation omega vertices converse⟩ - -theorem externalStarLayer_iff : - letI := group.toGroup - ∀ x n, (sVertex).encode x ∈ M.externalStarLayer G letters requests m one (natSetCode n) ↔ - n = TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x := by - let instLayerEntryGroup := group.toGroup - intro x n - rw [TransitiveGround.externalStarLayer, mem_relationFiber, pair_mem_relationConverse] - have hx : (sVertex).encode x ∈ M.externalStarVertices G letters requests m one := - (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 ▸ - (sVertex).encode_mem x - exact ⟨fun h => (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG x n).1 h.2.2.2, - fun h => ⟨hx, hx, natSetCode_mem_omega n, - (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG x n).2 h⟩⟩ - -end GroundExternalGeometryInputs - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -noncomputable def externalStarParent (G S R m one : ZFSet.{u}) : ZFSet.{u} := - treeParentGraph (M.externalStarVertices G S R m one) (M.externalStarDepth G S R m one) - (M.externalStarAdjacency G S R m one) (M.externalStarRoot G S m one) - -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG - -theorem externalStarParent_eq_graph : - letI := group.toGroup - M.externalStarParent G letters requests m one = (sVertex).graph (sVertex) - (TileStars.parent (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1)) := by - let instParentGraphGroup := group.toGroup - have equal := TileStars.parentGraph_eq_graph (SetMembers G) (family).Letters - (ExternalRequestIndex I P0 rectangles) (fun a => a.1) (sVertex) - (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStarAdjacency_iff group oldAction pairing unions powers separation infinite hG) - rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1, - ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at equal - exact equal - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarParent_ground_function : - M.externalStarParent G letters requests m one ∈ M.sets ∧ - ZFSet.IsFunc (M.externalStarVertices G letters requests m one) - (M.externalStarVertices G letters requests m one) (M.externalStarParent G letters requests m one) := by - let instParentFunctionGroup := group.toGroup - have members := data.externalStarCarriers_ground pairing unions powers separation hG - have depths := data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG - have adjacency := (data.externalStarIncidence_ground pairing unions powers separation hG).2.2.2.2.2 - refine ⟨M.treeParentGraph_mem pairing unions powers separation infinite members.1 depths.1 adjacency - (data.externalStarRoot_mem group oldAction pairing unions powers separation infinite hG), ?_⟩ - rw [data.externalStarParent_eq_graph group oldAction pairing unions powers separation infinite hG] - have function := (sVertex).graph_isFunc (sVertex) - (TileStars.parent (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1)) - rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1] at function - exact function - -theorem externalStarParent_iff : - letI := group.toGroup - ∀ v p, ZFSet.pair ((sVertex).encode v) ((sVertex).encode p) ∈ M.externalStarParent G letters requests m one ↔ - TileStars.parent (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) v = p := by - let instParentEntryGroup := group.toGroup - intro v p - rw [data.externalStarParent_eq_graph group oldAction pairing unions powers separation infinite hG] - exact (sVertex).pair_mem_graph (sVertex) _ v p - -end GroundExternalGeometryInputs - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -noncomputable def externalStarNonroots (G S R m one : ZFSet.{u}) : ZFSet.{u} := - treeNonrootCarrier (M.externalStarVertices G S R m one) (M.externalStarRoot G S m one) -noncomputable def externalStarIncoming (G S R m one : ZFSet.{u}) : ZFSet.{u} := - treeIncomingGraph (M.externalStarVertices G S R m one) (M.externalStarDarts G S R m one) - (M.externalStarParent G S R m one) (M.externalStarSource G S R m one) - (M.externalStarTarget G S R m one) (M.externalStarRoot G S m one) - -end TransitiveGround - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 rectangles -local notation "requests" => externalRequestCarrier I P0 rectangles -local notation "family" => completion.externalFamily group oldAction data.original -local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG - -include data group oldAction pairing unions powers separation infinite hG in -theorem externalStarIncoming_ground_function : - M.externalStarNonroots G letters requests m one ∈ M.sets ∧ - M.externalStarIncoming G letters requests m one ∈ M.sets ∧ - ZFSet.IsFunc (M.externalStarNonroots G letters requests m one) - (M.externalStarDarts G letters requests m one) (M.externalStarIncoming G letters requests m one) := by - let instIncomingFunctionGroup := group.toGroup - have members := data.externalStarCarriers_ground pairing unions powers separation hG - have parents := data.externalStarParent_ground_function group oldAction pairing unions powers separation infinite hG - have incidence := data.externalStarIncidence_ground pairing unions powers separation hG - have root := data.externalStarRoot_mem group oldAction pairing unions powers separation infinite hG - refine ⟨M.treeNonrootCarrier_mem separation members.1 root, - M.treeIncomingGraph_mem pairing unions powers separation members.1 members.2.2 parents.1 incidence.2.1 incidence.2.2.1 root, ?_⟩ - have function := TileStars.incomingGraph_function (SetMembers G) (family).Letters - (ExternalRequestIndex I P0 rectangles) (fun a => a.1) (sVertex) (sDart) - (data.externalStarParent_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStarSource_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStarTarget_iff group oldAction pairing unions powers separation infinite hG) - have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG - rw [carriers.1, carriers.2.2, - ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at function - exact function - -theorem externalStarIncoming_iff : - letI := group.toGroup - ∀ v (nonroot : v ≠ TileStars.root (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) d, - ZFSet.pair ((sVertex).encode v) ((sDart).encode d) ∈ M.externalStarIncoming G letters requests m one ↔ - TileStars.incoming (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) v nonroot = d := by - let instIncomingEntryGroup := group.toGroup - intro v nonroot d - have entry := TileStars.incomingGraph_entry (SetMembers G) (family).Letters - (ExternalRequestIndex I P0 rectangles) (fun a => a.1) (sVertex) (sDart) - (data.externalStarParent_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStarSource_iff group oldAction pairing unions powers separation infinite hG) - (data.externalStarTarget_iff group oldAction pairing unions powers separation infinite hG) v nonroot d - have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG - rw [carriers.1, carriers.2.2, - ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at entry - exact entry - -end GroundExternalGeometryInputs -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -variable (P r μ A : ZFSet.{u}) -local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) -local notation "requests" => externalRequestCarrier I P (externalRectangles P G r μ A) -local notation "Q" => completion.externalPointCarrier P r μ A -local notation "vertices" => M.externalStarVertices G letters requests m one -local notation "parents" => M.externalStarParent G letters requests m one - -noncomputable def externalStarOverlaps : ZFSet.{u} := - parentSupportGraph vertices Q (completion.externalStarSupports P r μ A) parents -noncomputable def externalStarFresh : ZFSet.{u} := - freshSupportGraph vertices Q (completion.externalStarSupports P r μ A) parents -noncomputable def externalStarOverlapFamily : ZFSet.{u} := - M.relationFiberFamily vertices Q (completion.externalStarOverlaps P r μ A) -noncomputable def externalStarFreshFamily : ZFSet.{u} := - M.relationFiberFamily vertices Q (completion.externalStarFresh P r μ A) - -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "vertices" => M.externalStarVertices G letters requests m one -include data group oldAction pairing unions powers separation infinite hG hP0 - -theorem externalStarOverlapFresh_ground : - completion.externalStarOverlaps P0 r0 μ0 A0 ∈ M.sets ∧ - completion.externalStarFresh P0 r0 μ0 A0 ∈ M.sets := by - have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 - have hs := data.externalStarSupports_ground group oldAction pairing unions powers separation infinite hG hP0 - have hp := (data.externalStarParent_ground_function group oldAction pairing unions powers separation infinite hG).1 - exact ⟨M.parentSupportGraph_mem pairing unions powers separation hv hq hs hp, - M.freshSupportGraph_mem pairing unions powers separation hv hq hs hp⟩ - -theorem externalStarOverlapFamily_spec : - completion.externalStarOverlapFamily P0 r0 μ0 A0 ∈ M.sets ∧ - ZFSet.IsFunc vertices (M.groundPower Q) (completion.externalStarOverlapFamily P0 r0 μ0 A0) ∧ - ∀ v f, ZFSet.pair v f ∈ completion.externalStarOverlapFamily P0 r0 μ0 A0 ↔ - v ∈ vertices ∧ f = relationFiber Q (completion.externalStarOverlaps P0 r0 μ0 A0) v := by - have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 - have hs := (data.externalStarOverlapFresh_ground group oldAction pairing unions powers separation infinite hG hP0).1 - exact ⟨M.relationFiberFamily_mem pairing unions powers separation hv hq hs, - M.relationFiberFamily_function separation hv hq hs, - M.relationFiberFamily_entries separation hv hq hs⟩ - -theorem externalStarFreshFamily_spec : - completion.externalStarFreshFamily P0 r0 μ0 A0 ∈ M.sets ∧ - ZFSet.IsFunc vertices (M.groundPower Q) (completion.externalStarFreshFamily P0 r0 μ0 A0) ∧ - ∀ v f, ZFSet.pair v f ∈ completion.externalStarFreshFamily P0 r0 μ0 A0 ↔ - v ∈ vertices ∧ f = relationFiber Q (completion.externalStarFresh P0 r0 μ0 A0) v := by - have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 - have hs := (data.externalStarOverlapFresh_ground group oldAction pairing unions powers separation infinite hG hP0).2 - exact ⟨M.relationFiberFamily_mem pairing unions powers separation hv hq hs, - M.relationFiberFamily_function separation hv hq hs, - M.relationFiberFamily_entries separation hv hq hs⟩ - -end GroundExternalGeometryInputs -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalStarSupports + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +theorem lowerDepthEdgeCode_iff {B : Type u} (s : Presentation B) (depth : B → Nat) + {depths adjacency : ZFSet.{u}} + (entries : ∀ x n, ZFSet.pair (s.encode x) (natSetCode n) ∈ depths ↔ n = depth x) + (p v : B) : + LowerDepthEdgeCode ZFSet.omega depths adjacency (s.encode p) (s.encode v) ↔ + ZFSet.pair (s.encode p) (s.encode v) ∈ adjacency ∧ depth p + 1 = depth v := by + constructor + · rintro ⟨edge, n, hn, m, hm, en, em, successor⟩ + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + rw [(entries v n).1 en, (entries p m).1 em, ← natSetCode_succ] at successor + exact ⟨edge, (natSetCode_injective successor).symm⟩ + · rintro ⟨edge, lower⟩ + exact ⟨edge, natSetCode (depth v), natSetCode_mem_omega _, + natSetCode (depth p), natSetCode_mem_omega _, (entries v _).2 rfl, + (entries p _).2 rfl, by rw [← lower, natSetCode_succ]⟩ + +end PartitionPilot.Forcing + +namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars +open Forcing SetRealization SetFormula +universe u +variable (J S R : Type u) [Group J] (request : S → R) +variable (s : Presentation (Vertex J S R)) {depths adjacency : ZFSet.{u}} +variable (depthEntries : ∀ x n, ZFSet.pair (s.encode x) (natSetCode n) ∈ depths ↔ + n = depth J S R request x) +variable (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ adjacency ↔ + ∃ d : Dart J S R, TileStars.source J S R request d = x ∧ TileStars.target J S R request d = y) + +include depthEntries edges +theorem parentGraph_entry (v p : Vertex J S R) : + ZFSet.pair (s.encode v) (s.encode p) ∈ + treeParentGraph s.carrier depths adjacency (s.encode (root J S R)) ↔ + parent J S R request v = p := by + rw [pair_mem_treeParentGraph, lowerDepthEdgeCode_iff s (depth J S R request) depthEntries, + edges, s.injective.eq_iff, s.injective.eq_iff] + exact ⟨fun h => (parent_iff J S R request v p).2 h.2.2, + fun h => ⟨s.encode_mem v, s.encode_mem p, (parent_iff J S R request v p).1 h⟩⟩ + +theorem parentGraph_eq_graph : + treeParentGraph s.carrier depths adjacency (s.encode (root J S R)) = + s.graph s (parent J S R request) := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨v, hv, p, hp, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 + obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv + obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 hp + exact (s.pair_mem_graph s _ v p).2 + ((parentGraph_entry J S R request s depthEntries edges v p).1 entry) + · intro entry + obtain ⟨v, rfl⟩ := (s.mem_graph s (parent J S R request) z).1 entry + exact (parentGraph_entry J S R request s depthEntries edges v _).2 rfl + +theorem parentGraph_spec (M : Forcing.TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hV : s.carrier ∈ M.sets) (hDepths : depths ∈ M.sets) (hAdjacency : adjacency ∈ M.sets) : + treeParentGraph s.carrier depths adjacency (s.encode (root J S R)) ∈ M.sets ∧ + ZFSet.IsFunc s.carrier s.carrier + (treeParentGraph s.carrier depths adjacency (s.encode (root J S R))) := by + refine ⟨M.treeParentGraph_mem pairing unions powers separation infinite hV hDepths hAdjacency + (M.transitive hV (s.encode_mem _)), ?_⟩ + rw [parentGraph_eq_graph J S R request s depthEntries edges] + exact s.graph_isFunc s _ + +end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars + +end + +namespace PartitionPilot.Forcing +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +noncomputable def externalStarRoot (G S m one : ZFSet.{u}) : ZFSet.{u} := + ZFSet.pair (natSetCode 0) (equivalenceClass (M.externalGroupCarrier G S m one) + (M.externalCosetEquivalence G S m one) (M.externalGroupIdentity G S m one)) +noncomputable def externalStarDepth (G S R m one : ZFSet.{u}) : ZFSet.{u} := + M.relationDepthGraph (M.externalStarVertices G S R m one) (M.externalStarAdjacency G S R m one) + (M.externalStarRoot G S m one) + +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original +local notation "sRequest" => externalRequestPresentation I P0 rectangles +local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG + +theorem externalStarRoot_eq_encode : + letI := group.toGroup + M.externalStarRoot G letters m one = + (sVertex).encode (TileStars.root (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) := by + let instRootEncodeGroup := group.toGroup + change ZFSet.pair (natSetCode 0) (equivalenceClass (M.externalGroupCarrier G letters m one) + (M.externalCosetEquivalence G letters m one) (M.externalGroupIdentity G letters m one)) = + ZFSet.pair (natSetCode 0) (equivalenceClass (sGroup).carrier + (externalCosetRelation (sGroup).carrier G (M.externalOldInclusion G letters m one) + (M.externalGroupMultiplication G letters m one)) ((sGroup).encode 1)) + rw [completion.externalFamilyGroupPresentation_carrier, + completion.externalFamilyGroupPresentation_identity group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground] + rfl + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarRoot_mem : M.externalStarRoot G letters m one ∈ M.sets := by + let instRootMembershipGroup := group.toGroup + rw [data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] + have members := data.externalStarCarriers_ground pairing unions powers separation hG + have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG + exact M.transitive (carriers.1.symm ▸ members.1) ((sVertex).encode_mem _) + +theorem externalStarDepth_eq_graph : + letI := group.toGroup + M.externalStarDepth G letters requests m one = (sVertex).graph natPresentation + (fun x => ⟨TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x⟩) := by + let instDepthGraphGroup := group.toGroup + have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG + have members := data.externalStarCarriers_ground pairing unions powers separation hG + have eq := TileStars.depthGraph_eq_graph (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) + (fun a => a.1) M pairing unions separation infinite (sVertex) + (data.externalStarAdjacency_iff group oldAction pairing unions powers separation infinite hG) + (carriers.1.symm ▸ members.1) + rw [carriers.1, ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at eq + exact eq + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarDepth_ground_function : + M.externalStarDepth G letters requests m one ∈ M.sets ∧ + ZFSet.IsFunc (M.externalStarVertices G letters requests m one) ZFSet.omega + (M.externalStarDepth G letters requests m one) := by + let instDepthFunctionGroup := group.toGroup + have members := data.externalStarCarriers_ground pairing unions powers separation hG + have adjacency := (data.externalStarIncidence_ground pairing unions powers separation hG).2.2.2.2.2 + refine ⟨M.relationDepthGraph_mem pairing unions powers separation infinite members.1 adjacency + (data.externalStarRoot_mem group oldAction pairing unions powers separation infinite hG), ?_⟩ + rw [data.externalStarDepth_eq_graph group oldAction pairing unions powers separation infinite hG] + have function := (sVertex).graph_isFunc natPresentation + (fun x => ⟨TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x⟩) + rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1] at function + exact function + +theorem externalStarDepth_iff : + letI := group.toGroup + ∀ x n, ZFSet.pair ((sVertex).encode x) (natSetCode n) ∈ M.externalStarDepth G letters requests m one ↔ + n = TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x := by + let instDepthEntryGroup := group.toGroup + intro x n + rw [data.externalStarDepth_eq_graph group oldAction pairing unions powers separation infinite hG] + have entry := (sVertex).pair_mem_graph natPresentation + (fun x => ⟨TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x⟩) x ⟨n⟩ + exact entry.trans ⟨fun equal => (congrArg ULift.down equal).symm, fun equal => congrArg ULift.up equal.symm⟩ + +end GroundExternalGeometryInputs + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +noncomputable def externalStarLayer (G S R m one n : ZFSet.{u}) : ZFSet.{u} := + relationFiber (M.externalStarVertices G S R m one) + (relationConverse (M.externalStarVertices G S R m one) ZFSet.omega (M.externalStarDepth G S R m one)) n +noncomputable def externalStarLayers (G S R m one : ZFSet.{u}) : ZFSet.{u} := + M.relationFiberFamily ZFSet.omega (M.externalStarVertices G S R m one) + (relationConverse (M.externalStarVertices G S R m one) ZFSet.omega (M.externalStarDepth G S R m one)) + +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "sGroup" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "sLetter" => completion.externalFamilyLetterPresentation group oldAction data.original +local notation "sRequest" => externalRequestPresentation I P0 rectangles +local notation "sCoset" => data.externalCosetPresentation group oldAction pairing unions powers separation infinite hG +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarLayers_spec : + M.externalStarLayers G letters requests m one ∈ M.sets ∧ + ZFSet.IsFunc ZFSet.omega (M.groundPower (M.externalStarVertices G letters requests m one)) + (M.externalStarLayers G letters requests m one) ∧ + ∀ n L, ZFSet.pair n L ∈ M.externalStarLayers G letters requests m one ↔ + n ∈ ZFSet.omega ∧ L = M.externalStarLayer G letters requests m one n := by + have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have depth := (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).1 + have omega := M.omega_mem separation infinite + have converse := M.relationConverse_mem pairing unions powers separation vertices omega depth + exact ⟨M.relationFiberFamily_mem pairing unions powers separation omega vertices converse, + M.relationFiberFamily_function separation omega vertices converse, + M.relationFiberFamily_entries separation omega vertices converse⟩ + +theorem externalStarLayer_iff : + letI := group.toGroup + ∀ x n, (sVertex).encode x ∈ M.externalStarLayer G letters requests m one (natSetCode n) ↔ + n = TileStars.depth (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) x := by + let instLayerEntryGroup := group.toGroup + intro x n + rw [TransitiveGround.externalStarLayer, mem_relationFiber, pair_mem_relationConverse] + have hx : (sVertex).encode x ∈ M.externalStarVertices G letters requests m one := + (data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1 ▸ + (sVertex).encode_mem x + exact ⟨fun h => (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG x n).1 h.2.2.2, + fun h => ⟨hx, hx, natSetCode_mem_omega n, + (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG x n).2 h⟩⟩ + +end GroundExternalGeometryInputs + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +noncomputable def externalStarParent (G S R m one : ZFSet.{u}) : ZFSet.{u} := + treeParentGraph (M.externalStarVertices G S R m one) (M.externalStarDepth G S R m one) + (M.externalStarAdjacency G S R m one) (M.externalStarRoot G S m one) + +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG + +theorem externalStarParent_eq_graph : + letI := group.toGroup + M.externalStarParent G letters requests m one = (sVertex).graph (sVertex) + (TileStars.parent (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1)) := by + let instParentGraphGroup := group.toGroup + have equal := TileStars.parentGraph_eq_graph (SetMembers G) (family).Letters + (ExternalRequestIndex I P0 rectangles) (fun a => a.1) (sVertex) + (data.externalStarDepth_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStarAdjacency_iff group oldAction pairing unions powers separation infinite hG) + rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1, + ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at equal + exact equal + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarParent_ground_function : + M.externalStarParent G letters requests m one ∈ M.sets ∧ + ZFSet.IsFunc (M.externalStarVertices G letters requests m one) + (M.externalStarVertices G letters requests m one) (M.externalStarParent G letters requests m one) := by + let instParentFunctionGroup := group.toGroup + have members := data.externalStarCarriers_ground pairing unions powers separation hG + have depths := data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG + have adjacency := (data.externalStarIncidence_ground pairing unions powers separation hG).2.2.2.2.2 + refine ⟨M.treeParentGraph_mem pairing unions powers separation infinite members.1 depths.1 adjacency + (data.externalStarRoot_mem group oldAction pairing unions powers separation infinite hG), ?_⟩ + rw [data.externalStarParent_eq_graph group oldAction pairing unions powers separation infinite hG] + have function := (sVertex).graph_isFunc (sVertex) + (TileStars.parent (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1)) + rw [(data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG).1] at function + exact function + +theorem externalStarParent_iff : + letI := group.toGroup + ∀ v p, ZFSet.pair ((sVertex).encode v) ((sVertex).encode p) ∈ M.externalStarParent G letters requests m one ↔ + TileStars.parent (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) v = p := by + let instParentEntryGroup := group.toGroup + intro v p + rw [data.externalStarParent_eq_graph group oldAction pairing unions powers separation infinite hG] + exact (sVertex).pair_mem_graph (sVertex) _ v p + +end GroundExternalGeometryInputs + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +noncomputable def externalStarNonroots (G S R m one : ZFSet.{u}) : ZFSet.{u} := + treeNonrootCarrier (M.externalStarVertices G S R m one) (M.externalStarRoot G S m one) +noncomputable def externalStarIncoming (G S R m one : ZFSet.{u}) : ZFSet.{u} := + treeIncomingGraph (M.externalStarVertices G S R m one) (M.externalStarDarts G S R m one) + (M.externalStarParent G S R m one) (M.externalStarSource G S R m one) + (M.externalStarTarget G S R m one) (M.externalStarRoot G S m one) + +end TransitiveGround + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "rectangles" => externalRectangles P0 G r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 rectangles +local notation "requests" => externalRequestCarrier I P0 rectangles +local notation "family" => completion.externalFamily group oldAction data.original +local notation "sVertex" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "sDart" => data.externalStarDartPresentation group oldAction pairing unions powers separation infinite hG + +include data group oldAction pairing unions powers separation infinite hG in +theorem externalStarIncoming_ground_function : + M.externalStarNonroots G letters requests m one ∈ M.sets ∧ + M.externalStarIncoming G letters requests m one ∈ M.sets ∧ + ZFSet.IsFunc (M.externalStarNonroots G letters requests m one) + (M.externalStarDarts G letters requests m one) (M.externalStarIncoming G letters requests m one) := by + let instIncomingFunctionGroup := group.toGroup + have members := data.externalStarCarriers_ground pairing unions powers separation hG + have parents := data.externalStarParent_ground_function group oldAction pairing unions powers separation infinite hG + have incidence := data.externalStarIncidence_ground pairing unions powers separation hG + have root := data.externalStarRoot_mem group oldAction pairing unions powers separation infinite hG + refine ⟨M.treeNonrootCarrier_mem separation members.1 root, + M.treeIncomingGraph_mem pairing unions powers separation members.1 members.2.2 parents.1 incidence.2.1 incidence.2.2.1 root, ?_⟩ + have function := TileStars.incomingGraph_function (SetMembers G) (family).Letters + (ExternalRequestIndex I P0 rectangles) (fun a => a.1) (sVertex) (sDart) + (data.externalStarParent_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStarSource_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStarTarget_iff group oldAction pairing unions powers separation infinite hG) + have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG + rw [carriers.1, carriers.2.2, + ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at function + exact function + +theorem externalStarIncoming_iff : + letI := group.toGroup + ∀ v (nonroot : v ≠ TileStars.root (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles)) d, + ZFSet.pair ((sVertex).encode v) ((sDart).encode d) ∈ M.externalStarIncoming G letters requests m one ↔ + TileStars.incoming (SetMembers G) (family).Letters (ExternalRequestIndex I P0 rectangles) (fun a => a.1) v nonroot = d := by + let instIncomingEntryGroup := group.toGroup + intro v nonroot d + have entry := TileStars.incomingGraph_entry (SetMembers G) (family).Letters + (ExternalRequestIndex I P0 rectangles) (fun a => a.1) (sVertex) (sDart) + (data.externalStarParent_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStarSource_iff group oldAction pairing unions powers separation infinite hG) + (data.externalStarTarget_iff group oldAction pairing unions powers separation infinite hG) v nonroot d + have carriers := data.externalStarPresentations_carriers group oldAction pairing unions powers separation infinite hG + rw [carriers.1, carriers.2.2, + ← data.externalStarRoot_eq_encode group oldAction pairing unions powers separation infinite hG] at entry + exact entry + +end GroundExternalGeometryInputs +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +variable (P r μ A : ZFSet.{u}) +local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) +local notation "requests" => externalRequestCarrier I P (externalRectangles P G r μ A) +local notation "Q" => completion.externalPointCarrier P r μ A +local notation "vertices" => M.externalStarVertices G letters requests m one +local notation "parents" => M.externalStarParent G letters requests m one + +noncomputable def externalStarOverlaps : ZFSet.{u} := + parentSupportGraph vertices Q (completion.externalStarSupports P r μ A) parents +noncomputable def externalStarFresh : ZFSet.{u} := + freshSupportGraph vertices Q (completion.externalStarSupports P r μ A) parents +noncomputable def externalStarOverlapFamily : ZFSet.{u} := + M.relationFiberFamily vertices Q (completion.externalStarOverlaps P r μ A) +noncomputable def externalStarFreshFamily : ZFSet.{u} := + M.relationFiberFamily vertices Q (completion.externalStarFresh P r μ A) + +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "vertices" => M.externalStarVertices G letters requests m one +include data group oldAction pairing unions powers separation infinite hG hP0 + +theorem externalStarOverlapFresh_ground : + completion.externalStarOverlaps P0 r0 μ0 A0 ∈ M.sets ∧ + completion.externalStarFresh P0 r0 μ0 A0 ∈ M.sets := by + have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 + have hs := data.externalStarSupports_ground group oldAction pairing unions powers separation infinite hG hP0 + have hp := (data.externalStarParent_ground_function group oldAction pairing unions powers separation infinite hG).1 + exact ⟨M.parentSupportGraph_mem pairing unions powers separation hv hq hs hp, + M.freshSupportGraph_mem pairing unions powers separation hv hq hs hp⟩ + +theorem externalStarOverlapFamily_spec : + completion.externalStarOverlapFamily P0 r0 μ0 A0 ∈ M.sets ∧ + ZFSet.IsFunc vertices (M.groundPower Q) (completion.externalStarOverlapFamily P0 r0 μ0 A0) ∧ + ∀ v f, ZFSet.pair v f ∈ completion.externalStarOverlapFamily P0 r0 μ0 A0 ↔ + v ∈ vertices ∧ f = relationFiber Q (completion.externalStarOverlaps P0 r0 μ0 A0) v := by + have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 + have hs := (data.externalStarOverlapFresh_ground group oldAction pairing unions powers separation infinite hG hP0).1 + exact ⟨M.relationFiberFamily_mem pairing unions powers separation hv hq hs, + M.relationFiberFamily_function separation hv hq hs, + M.relationFiberFamily_entries separation hv hq hs⟩ + +theorem externalStarFreshFamily_spec : + completion.externalStarFreshFamily P0 r0 μ0 A0 ∈ M.sets ∧ + ZFSet.IsFunc vertices (M.groundPower Q) (completion.externalStarFreshFamily P0 r0 μ0 A0) ∧ + ∀ v f, ZFSet.pair v f ∈ completion.externalStarFreshFamily P0 r0 μ0 A0 ↔ + v ∈ vertices ∧ f = relationFiber Q (completion.externalStarFresh P0 r0 μ0 A0) v := by + have hv := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have hq := (data.localTileGroundInputs group oldAction pairing unions powers separation infinite hG hP0).1 + have hs := (data.externalStarOverlapFresh_ground group oldAction pairing unions powers separation infinite hG hP0).2 + exact ⟨M.relationFiberFamily_mem pairing unions powers separation hv hq hs, + M.relationFiberFamily_function separation hv hq hs, + M.relationFiberFamily_entries separation hv hq hs⟩ + +end GroundExternalGeometryInputs +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalTileSlotSupports.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalTileSlotSupports.lean index 62b93f0886d7b1cab12e8b1a825d1727e220d277..7d1ae0525aea278bc72e85dc96ebe9b9108cac7d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalTileSlotSupports.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundExternalTileSlotSupports.lean @@ -1,504 +1,504 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalColumnCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u - -noncomputable def transportedTileCoordinates (V E I B D action heights : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ v ∈ V, ∃ w ∈ E, ∃ i ∈ I, ∃ x ∈ B, ∃ q ∈ D, - ∃ y ∈ B, ∃ h ∈ ZFSet.sUnion (ZFSet.sUnion heights), z = ZFSet.pair (ZFSet.pair v x) q ∧ - v = ZFSet.pair (natSetCode 1) (ZFSet.pair w i) ∧ ZFSet.pair i h ∈ heights ∧ - ZFSet.pair (ZFSet.pair w y) x ∈ action ∧ ZFSet.pair y q ∈ h) - (ZFSet.prod (ZFSet.prod V B) D) - -theorem pair_mem_transportedTileCoordinates (V E I B D action heights v x q : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair v x) q ∈ transportedTileCoordinates V E I B D action heights ↔ - v ∈ V ∧ x ∈ B ∧ q ∈ D ∧ ∃ w ∈ E, ∃ i ∈ I, ∃ y ∈ B, ∃ h ∈ ZFSet.sUnion (ZFSet.sUnion heights), - v = ZFSet.pair (natSetCode 1) (ZFSet.pair w i) ∧ ZFSet.pair i h ∈ heights ∧ - ZFSet.pair (ZFSet.pair w y) x ∈ action ∧ ZFSet.pair y q ∈ h := by - rw [transportedTileCoordinates, ZFSet.mem_sep] - constructor - · rintro ⟨_, v', hv, w, hw, i, hi, x', hx, q', hq, y, hy, h, hh, equal, body⟩ - obtain ⟨left, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left - exact ⟨hv, hx, hq, w, hw, i, hi, y, hy, h, hh, body⟩ - · rintro ⟨hv, hx, hq, w, hw, i, hi, y, hy, h, hh, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hx⟩, hq⟩, - v, hv, w, hw, i, hi, x, hx, q, hq, y, hy, h, hh, rfl, body⟩ - -theorem transportedTileCoordinates_partial {V E I B D action heights : ZFSet.{u}} - (family : FunctionGraphOn I heights) - (localUnique : ∀ i h y a b, ZFSet.pair i h ∈ heights → - ZFSet.pair y a ∈ h → ZFSet.pair y b ∈ h → a = b) - (actionInjective : ∀ w ∈ E, ∀ y ∈ B, ∀ z ∈ B, ∀ x, - ZFSet.pair (ZFSet.pair w y) x ∈ action → - ZFSet.pair (ZFSet.pair w z) x ∈ action → y = z) : - PartialFunctionCode (ZFSet.prod V B) D (transportedTileCoordinates V E I B D action heights) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro p a b first second - have hp := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 first).1).1 - obtain ⟨v, _, x, _, rfl⟩ := ZFSet.mem_prod.1 hp - obtain ⟨_, _, _, w, hw, i, hi, y, hy, h, _, shape, field, acting, value⟩ := - (pair_mem_transportedTileCoordinates _ _ _ _ _ _ _ _ _ _).1 first - obtain ⟨_, _, _, w', _, i', _, y', hy', h', _, shape', field', acting', value'⟩ := - (pair_mem_transportedTileCoordinates _ _ _ _ _ _ _ _ _ _).1 second - have wi := ZFSet.pair_inj.1 ((ZFSet.pair_inj.1 (shape.symm.trans shape')).2) - obtain ⟨rfl, rfl⟩ := wi - have sameH : h = h' := (family.value_eq_of_entry ⟨i, hi⟩ field).symm.trans - (family.value_eq_of_entry ⟨i, hi⟩ field') - subst h' - have sameY := actionInjective w hw y hy y' hy' x acting acting' - subst y' - exact localUnique i h y a b field value value' - -noncomputable def externalOwnerHeightGraph (P B V C D old owner depths columns coordinates : ZFSet.{u}) : ZFSet.{u} := - old ∪ ZFSet.sep (fun z => ∃ x ∈ B, ∃ v ∈ V, ∃ n ∈ ZFSet.omega, ∃ a ∈ C, ∃ q ∈ D, - z = ZFSet.pair x (ZFSet.pair a q) ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ - ZFSet.pair v n ∈ depths ∧ ZFSet.pair n a ∈ columns ∧ - ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) (ZFSet.prod B (ZFSet.prod C D)) - -theorem pair_mem_externalOwnerHeightGraph (P B V C D old owner depths columns coordinates x y : ZFSet.{u}) : - ZFSet.pair x y ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates ↔ - ZFSet.pair x y ∈ old ∨ (x ∈ B ∧ x ∉ P ∧ ∃ v ∈ V, ∃ n ∈ ZFSet.omega, ∃ a ∈ C, ∃ q ∈ D, - y = ZFSet.pair a q ∧ ZFSet.pair x v ∈ owner ∧ ZFSet.pair v n ∈ depths ∧ - ZFSet.pair n a ∈ columns ∧ ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) := by - rw [externalOwnerHeightGraph, ZFSet.mem_union] - apply or_congr Iff.rfl - rw [ZFSet.mem_sep] - constructor - · rintro ⟨_, x', hx, v, hv, n, hn, a, ha, q, hq, equal, fresh, body⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, fresh, v, hv, n, hn, a, ha, q, hq, rfl, body⟩ - · rintro ⟨hx, fresh, v, hv, n, hn, a, ha, q, hq, rfl, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.pair_mem_prod.2 ⟨ha, hq⟩⟩, - x, hx, v, hv, n, hn, a, ha, q, hq, rfl, fresh, body⟩ - -theorem externalOwnerHeightGraph_old {P B V C D old owner depths columns coordinates x y : ZFSet.{u}} - (hx : x ∈ P) : - ZFSet.pair x y ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates ↔ - ZFSet.pair x y ∈ old := by - rw [pair_mem_externalOwnerHeightGraph] - exact ⟨fun h => h.elim id (fun h => False.elim (h.2.1 hx)), Or.inl⟩ - -theorem externalOwnerHeightGraph_function {P B V C D old owner depths columns coordinates : ZFSet.{u}} - (subset : P ⊆ B) (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) - (ownerFunction : ZFSet.IsFunc B V owner) (depthFunction : ZFSet.IsFunc V ZFSet.omega depths) - (columnFunction : ZFSet.IsFunc ZFSet.omega C columns) - (coordinatePartial : PartialFunctionCode (ZFSet.prod V B) D coordinates) - (coordinateTotal : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner → - ∃ q ∈ D, ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) : - ZFSet.IsFunc B (ZFSet.prod C D) (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) := by - have oldUnique := functionCode_partial oldFunction - have ownerUnique := functionCode_partial ownerFunction - have depthUnique := functionCode_partial depthFunction - have columnUnique := functionCode_partial columnFunction - refine ⟨?_, ?_⟩ - · intro z hz - rcases (ZFSet.mem_union.1 hz) with oldEntry | freshEntry - · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 oldEntry) - exact ZFSet.pair_mem_prod.2 ⟨subset hx, hy⟩ - · exact (ZFSet.mem_sep.1 freshEntry).1 - · intro x hx - by_cases oldX : x ∈ P - · obtain ⟨y, entry, unique⟩ := oldFunction.2 x oldX - exact ⟨y, (externalOwnerHeightGraph_old oldX).2 entry, - fun z hz => unique z ((externalOwnerHeightGraph_old oldX).1 hz)⟩ - · obtain ⟨v, owned, _⟩ := ownerFunction.2 x hx - have hv := (ZFSet.pair_mem_prod.1 (ownerFunction.1 owned)).2 - obtain ⟨n, atDepth, _⟩ := depthFunction.2 v hv - have hn := (ZFSet.pair_mem_prod.1 (depthFunction.1 atDepth)).2 - obtain ⟨a, atColumn, _⟩ := columnFunction.2 n hn - have ha := (ZFSet.pair_mem_prod.1 (columnFunction.1 atColumn)).2 - obtain ⟨q, hq, coord⟩ := coordinateTotal x hx oldX v owned - refine ⟨ZFSet.pair a q, (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).2 - (Or.inr ⟨hx, oldX, v, hv, n, hn, a, ha, q, hq, rfl, owned, atDepth, atColumn, coord⟩), ?_⟩ - intro y entry - rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with oldEntry | fresh - · exact False.elim (oldX (ZFSet.pair_mem_prod.1 (oldFunction.1 oldEntry)).1) - · obtain ⟨_, _, v', _, n', _, a', _, q', _, rfl, owned', depth', column', coord'⟩ := fresh - have sameV := ownerUnique.unique x v' v owned' owned - subst v' - have sameN := depthUnique.unique v n' n depth' atDepth - subst n' - have sameA := columnUnique.unique n a' a column' atColumn - have sameQ := coordinatePartial.unique (ZFSet.pair v x) q' q coord' coord - exact congrArg₂ ZFSet.pair sameA sameQ - -end - -section -open SetFormula -universe u -namespace BoundedFormula - -def transportedTileCoordinateFormula {n} (z V E I B D action heights bound one : Fin n) : BoundedFormula n := - exMem V (exMem E.succ (exMem I.succ.succ (exMem B.succ.succ.succ - (exMem D.succ.succ.succ.succ (exMem B.succ.succ.succ.succ.succ - (exMem bound.succ.succ.succ.succ.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ.succ.succ 6 3 2) - (.conj (orderedRightTripleFormula 6 one.succ.succ.succ.succ.succ.succ.succ 5 4) - (.conj (pairMembershipFormula 4 0 heights.succ.succ.succ.succ.succ.succ.succ) - (.conj (tripleMembershipFormula 5 1 3 action.succ.succ.succ.succ.succ.succ.succ) - (pairMembershipFormula 1 2 0))))))))))) - -theorem truth_transportedTileCoordinateFormula {n} (z V E I B D action heights bound one : Fin n) - (env : Fin n → ZFSet.{u}) (boundEq : env bound = ZFSet.sUnion (ZFSet.sUnion (env heights))) - (oneEq : env one = natSetCode 1) : - Truth (transportedTileCoordinateFormula z V E I B D action heights bound one) env ↔ - env z ∈ transportedTileCoordinates (env V) (env E) (env I) (env B) (env D) (env action) (env heights) := by - simp only [transportedTileCoordinateFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_orderedRightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [boundEq, oneEq, transportedTileCoordinates, ZFSet.mem_sep] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨v, hv, _, _, _, _, x, hx, q, hq, _, _, _, _, equal, _⟩ := h - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hx⟩, hq⟩ - -def ownerHeightFreshFormula {n} (z P B V C D owner depths columns coordinates omega : Fin n) : BoundedFormula n := - exMem B (exMem V.succ (exMem omega.succ.succ (exMem C.succ.succ.succ - (exMem D.succ.succ.succ.succ - (.conj (orderedRightTripleFormula z.succ.succ.succ.succ.succ 4 1 0) - (.conj (.neg (.mem 4 P.succ.succ.succ.succ.succ)) - (.conj (pairMembershipFormula 4 3 owner.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 3 2 depths.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 2 1 columns.succ.succ.succ.succ.succ) - (tripleMembershipFormula 3 4 0 coordinates.succ.succ.succ.succ.succ)))))))))) - -theorem truth_ownerHeightFreshFormula {n} (z P B V C D owner depths columns coordinates omega : Fin n) - (env : Fin n → ZFSet.{u}) (omegaEq : env omega = ZFSet.omega) : - Truth (ownerHeightFreshFormula z P B V C D owner depths columns coordinates omega) env ↔ - ∃ x ∈ env B, ∃ v ∈ env V, ∃ n ∈ ZFSet.omega, ∃ a ∈ env C, ∃ q ∈ env D, - env z = ZFSet.pair x (ZFSet.pair a q) ∧ x ∉ env P ∧ ZFSet.pair x v ∈ env owner ∧ - ZFSet.pair v n ∈ env depths ∧ ZFSet.pair n a ∈ env columns ∧ - ZFSet.pair (ZFSet.pair v x) q ∈ env coordinates := by - simp only [ownerHeightFreshFormula, truth_exMem, Truth, truth_orderedRightTripleFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [omegaEq] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem transportedTileCoordinates_mem {V E I B D action heights : ZFSet.{u}} - (hV : V ∈ M.sets) (hE : E ∈ M.sets) (hI : I ∈ M.sets) (hB : B ∈ M.sets) - (hD : D ∈ M.sets) (hAction : action ∈ M.sets) (hHeights : heights ∈ M.sets) : - transportedTileCoordinates V E I B D action heights ∈ M.sets := by - have hBound := M.union_mem unions (M.union_mem unions hHeights) - have hZero := M.empty_mem ⟨B, hB⟩ - have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero - let params := extend V (extend E (extend I (extend B (extend D (extend action - (extend heights (extend (ZFSet.sUnion (ZFSet.sUnion heights)) (extend (natSetCode 1) Fin.elim0)))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.transportedTileCoordinateFormula 0 1 2 3 4 5 6 7 8 9) params - (Fin.cases hV (Fin.cases hE (Fin.cases hI (Fin.cases hB (Fin.cases hD - (Fin.cases hAction (Fin.cases hHeights (Fin.cases hBound (Fin.cases hOne (fun i => Fin.elim0 i)))))))))) - (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hV hB) hD) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.transportedTileCoordinateFormula 0 1 2 3 4 5 6 7 8 9) (extend z params)) - (ZFSet.prod (ZFSet.prod V B) D) = transportedTileCoordinates V E I B D action heights := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_transportedTileCoordinateFormula _ _ _ _ _ _ _ _ _ _ _ rfl rfl] - exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ - exact equal ▸ selected - -theorem externalOwnerHeightGraph_mem {P B V C D old owner depths columns coordinates : ZFSet.{u}} - (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hV : V ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hOld : old ∈ M.sets) (hOwner : owner ∈ M.sets) (hDepths : depths ∈ M.sets) - (hColumns : columns ∈ M.sets) (hCoordinates : coordinates ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) : - externalOwnerHeightGraph P B V C D old owner depths columns coordinates ∈ M.sets := by - let params := extend P (extend B (extend V (extend C (extend D (extend owner (extend depths - (extend columns (extend coordinates (extend ZFSet.omega Fin.elim0))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.ownerHeightFreshFormula 0 1 2 3 4 5 6 7 8 9 10) params - (Fin.cases hP (Fin.cases hB (Fin.cases hV (Fin.cases hC (Fin.cases hD (Fin.cases hOwner - (Fin.cases hDepths (Fin.cases hColumns (Fin.cases hCoordinates (Fin.cases hOmega (fun i => Fin.elim0 i))))))))))) - (M.prod_mem pairing unions powers separation hB (M.prod_mem pairing unions powers separation hC hD)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.ownerHeightFreshFormula 0 1 2 3 4 5 6 7 8 9 10) (extend z params)) - (ZFSet.prod B (ZFSet.prod C D)) = - ZFSet.sep (fun z => ∃ x ∈ B, ∃ v ∈ V, ∃ n ∈ ZFSet.omega, ∃ a ∈ C, ∃ q ∈ D, - z = ZFSet.pair x (ZFSet.pair a q) ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ - ZFSet.pair v n ∈ depths ∧ ZFSet.pair n a ∈ columns ∧ - ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) (ZFSet.prod B (ZFSet.prod C D)) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_ownerHeightFreshFormula _ _ _ _ _ _ _ _ _ _ _ _ rfl) - exact M.binary_union_mem pairing unions hOld (equal ▸ selected) - -end TransitiveGround -end - -section -universe u - -theorem externalOwnerHeightGraph_range_subset {P B V C D old owner depths columns coordinates : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) : - relationImage B (ZFSet.prod C D) (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) ⊆ - relationImage P (ZFSet.prod C D) old ∪ ZFSet.prod (relationImage ZFSet.omega C columns) D := by - intro y hy - obtain ⟨hy, x, _, entry⟩ := (mem_relationImage _ _ _ _).1 hy - rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with retained | fresh - · exact ZFSet.mem_union.2 (Or.inl ((mem_relationImage _ _ _ _).2 - ⟨hy, x, (ZFSet.pair_mem_prod.1 (oldFunction.1 retained)).1, retained⟩)) - · obtain ⟨_, _, _, _, n, hn, a, ha, q, hq, rfl, _, _, column, _⟩ := fresh - exact ZFSet.mem_union.2 (Or.inr (ZFSet.pair_mem_prod.2 - ⟨(mem_relationImage _ _ _ _).2 ⟨ha, n, hn, column⟩, hq⟩)) - -theorem externalOwnerHeightGraph_below_cap {P B V C D old owner depths columns coordinates base cap rD q0 : ZFSet.{u}} - (ordinal : ordinalSetProperty C) (hq0 : q0 ∈ D) - (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) - (code : ExternalColumnCode C (heightColumns P C D old) base columns cap) - {x y : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates) : - ZFSet.pair y (ZFSet.pair cap q0) ∈ lexHeightOrder C D rD := by - rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with retained | fresh - · obtain ⟨a, ha, q, hq, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (oldFunction.1 retained)).2 - have below := code.old_below (mem_heightColumns_of_entry oldFunction retained) 0 - exact (pair_mem_lexHeightOrder _ _ _ _ _ _ _).2 - ⟨ha, hq, code.cap_mem, hq0, Or.inl (ordinal.2 cap code.cap_mem - (compressionStamp base 0) (code.cap_bound 0) a below)⟩ - · obtain ⟨_, _, _, _, n, hn, a, ha, q, hq, rfl, _, _, column, _⟩ := fresh - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have below : a ∈ cap := (code.entries n a).1 column ▸ code.cap_bound n - exact (pair_mem_lexHeightOrder _ _ _ _ _ _ _).2 ⟨ha, hq, code.cap_mem, hq0, Or.inl below⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem externalOwnerHeightGraph_range_small - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P B V C D old owner depths columns coordinates : ZFSet.{u}} - (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hOld : old ∈ M.sets) (hColumns : columns ∈ M.sets) - (hHeight : externalOwnerHeightGraph P B V C D old owner depths columns coordinates ∈ M.sets) - (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) - (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) - (columnSmall : M.groundEmbeddable (relationImage ZFSet.omega C columns) ZFSet.omega) - (coordinateSmall : M.groundEmbeddable D ZFSet.omega) : - relationImage B (ZFSet.prod C D) (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) ∈ M.sets ∧ - M.groundEmbeddable (relationImage B (ZFSet.prod C D) - (externalOwnerHeightGraph P B V C D old owner depths columns coordinates)) ZFSet.omega := by - have omega := M.omega_mem separation infinite - have rangeGround := M.relationImage_mem separation hB (M.prod_mem pairing unions powers separation hC hD) hHeight - have oldGround := M.relationImage_mem separation hP (M.prod_mem pairing unions powers separation hC hD) hOld - have columnsGround := M.relationImage_mem separation omega hC hColumns - have productGround := M.prod_mem pairing unions powers separation columnsGround hD - have productSmall := M.groundEmbeddable_product pairing unions powers separation infinite columnsGround hD columnSmall coordinateSmall - have totalSmall := M.groundCountable_binary_union pairing unions powers separation infinite choice - oldGround productGround oldSmall productSmall - exact ⟨rangeGround, M.groundEmbeddable_restrict separation rangeGround omega - (externalOwnerHeightGraph_range_subset oldFunction) totalSmall⟩ - -end TransitiveGround - -end - -section -open SetFormula -universe u - -noncomputable def externalTileSlotSupports (V E I U B action vertexImages : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun y => ∃ v ∈ V, ∃ j ∈ natSetCode 3, ∃ x ∈ B, ∃ w ∈ E, - ∃ r ∈ I, ∃ u ∈ U, ∃ z ∈ B, - y = ZFSet.pair (ZFSet.pair v j) x ∧ v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r) ∧ - ZFSet.pair (ZFSet.pair (ZFSet.pair r j) u) z ∈ vertexImages ∧ - ZFSet.pair (ZFSet.pair w z) x ∈ action) - (ZFSet.prod (ZFSet.prod V (natSetCode 3)) B) - -theorem pair_mem_externalTileSlotSupports (V E I U B action vertexImages v j x : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair v j) x ∈ externalTileSlotSupports V E I U B action vertexImages ↔ - v ∈ V ∧ j ∈ natSetCode 3 ∧ x ∈ B ∧ ∃ w ∈ E, ∃ r ∈ I, ∃ u ∈ U, ∃ z ∈ B, - v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r) ∧ - ZFSet.pair (ZFSet.pair (ZFSet.pair r j) u) z ∈ vertexImages ∧ - ZFSet.pair (ZFSet.pair w z) x ∈ action := by - rw [externalTileSlotSupports, ZFSet.mem_sep] - constructor - · rintro ⟨_, v', hv, j', hj, x', hx, w, hw, r, hr, u, hu, z, hz, equal, body⟩ - obtain ⟨left, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left - exact ⟨hv, hj, hx, w, hw, r, hr, u, hu, z, hz, body⟩ - · rintro ⟨hv, hj, hx, w, hw, r, hr, u, hu, z, hz, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hj⟩, hx⟩, - v, hv, j, hj, x, hx, w, hw, r, hr, u, hu, z, hz, rfl, body⟩ - -namespace BoundedFormula - -def slotImageMembershipFormula {n} (r j u z images : Fin n) : BoundedFormula n := - exMem images (exMem 0 (exMem 0 - (.conj (orderedTripleFormula 0 r.succ.succ.succ j.succ.succ.succ u.succ.succ.succ) - (orderedPairFormula 2 0 z.succ.succ.succ)))) - -theorem truth_slotImageMembershipFormula {n} (r j u z images : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (slotImageMembershipFormula r j u z images) env ↔ - ZFSet.pair (ZFSet.pair (ZFSet.pair (env r) (env j)) (env u)) (env z) ∈ env images := by - simp only [slotImageMembershipFormula, truth_exMem, Truth, truth_orderedTripleFormula, truth_orderedPairFormula] - change (∃ a ∈ env images, ∃ b ∈ a, ∃ c ∈ b, - c = ZFSet.pair (ZFSet.pair (env r) (env j)) (env u) ∧ a = ZFSet.pair c (env z)) ↔ _ - constructor - · rintro ⟨a, ha, _, _, c, _, rfl, rfl⟩ - exact ha - · intro entry - let c := ZFSet.pair (ZFSet.pair (env r) (env j)) (env u) - exact ⟨ZFSet.pair c (env z), entry, {c}, ZFSet.mem_pair.2 (Or.inl rfl), - c, ZFSet.mem_singleton.2 rfl, rfl, rfl⟩ - -def externalTileSlotSupportFormula {n} (y V E I U B action images one three : Fin n) : BoundedFormula n := - exMem V (exMem three.succ (exMem B.succ.succ (exMem E.succ.succ.succ - (exMem I.succ.succ.succ.succ (exMem U.succ.succ.succ.succ.succ - (exMem B.succ.succ.succ.succ.succ.succ - (.conj (orderedTripleFormula y.succ.succ.succ.succ.succ.succ.succ 6 5 4) - (.conj (orderedRightTripleFormula 6 one.succ.succ.succ.succ.succ.succ.succ 3 2) - (.conj (slotImageMembershipFormula 2 5 1 0 images.succ.succ.succ.succ.succ.succ.succ) - (tripleMembershipFormula 3 0 4 action.succ.succ.succ.succ.succ.succ.succ)))))))))) - -theorem truth_externalTileSlotSupportFormula {n} (y V E I U B action images one three : Fin n) - (env : Fin n → ZFSet.{u}) (oneEq : env one = natSetCode 1) (threeEq : env three = natSetCode 3) : - Truth (externalTileSlotSupportFormula y V E I U B action images one three) env ↔ - env y ∈ externalTileSlotSupports (env V) (env E) (env I) (env U) (env B) (env action) (env images) := by - simp only [externalTileSlotSupportFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_orderedRightTripleFormula, truth_slotImageMembershipFormula, truth_tripleMembershipFormula] - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [oneEq, threeEq, externalTileSlotSupports, ZFSet.mem_sep] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨v, hv, j, hj, x, hx, _, _, _, _, _, _, _, _, equal, _⟩ := h - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hj⟩, hx⟩ - -end BoundedFormula - -end - -section -universe u - -theorem externalOwnerHeightGraph_fresh {P B V C D old owner depths columns coordinates x a q : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) (fresh : x ∉ P) : - ZFSet.pair x (ZFSet.pair a q) ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates ↔ - x ∈ B ∧ a ∈ C ∧ q ∈ D ∧ ∃ v ∈ V, ∃ n ∈ ZFSet.omega, - ZFSet.pair x v ∈ owner ∧ ZFSet.pair v n ∈ depths ∧ ZFSet.pair n a ∈ columns ∧ - ZFSet.pair (ZFSet.pair v x) q ∈ coordinates := by - rw [pair_mem_externalOwnerHeightGraph] - constructor - · intro entry - rcases entry with retained | new - · exact False.elim (fresh (ZFSet.pair_mem_prod.1 (oldFunction.1 retained)).1) - · obtain ⟨hx, _, v, hv, n, hn, a', ha, q', hq, equal, body⟩ := new - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, ha, hq, v, hv, n, hn, body⟩ - · rintro ⟨hx, ha, hq, v, hv, n, hn, body⟩ - exact Or.inr ⟨hx, fresh, v, hv, n, hn, a, ha, q, hq, rfl, body⟩ - -theorem ExternalColumnCode.entries_increasing {C K base columns cap n m a b : ZFSet.{u}} - (code : ExternalColumnCode C K base columns cap) - (hn : n ∈ ZFSet.omega) (hm : m ∈ ZFSet.omega) (before : n ∈ m) - (first : ZFSet.pair n a ∈ columns) (second : ZFSet.pair m b ∈ columns) : a ∈ b := by - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - rw [(code.entries n a).1 first, (code.entries m b).1 second] - exact (compressionStamp_mem_iff base n m).2 ((natSetCode_mem_iff n m).1 before) - -theorem externalOwnerHeightGraph_strictLex {P B V C D r old owner depths columns coordinates base cap rD : ZFSet.{u}} - (subset : P ⊆ B) (seed : StrictLexHeightCode P C D r old rD) - (ownerFunction : ZFSet.IsFunc B V owner) (depthFunction : ZFSet.IsFunc V ZFSet.omega depths) - (columnCode : ExternalColumnCode C (heightColumns P C D old) base columns cap) - (coordinatePartial : PartialFunctionCode (ZFSet.prod V B) D coordinates) - (coordinateTotal : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner → - ∃ q ∈ D, ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) - (noFreshBelowOld : ∀ x ∈ B, x ∉ P → ∀ y ∈ P, ZFSet.pair x y ∉ r) - (depthMonotone : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ v w n m, - ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → ZFSet.pair v n ∈ depths → - ZFSet.pair w m ∈ depths → ZFSet.pair x y ∈ r → n = m ∨ n ∈ m) - (sameDepthOwner : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ v w n, - ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → ZFSet.pair v n ∈ depths → - ZFSet.pair w n ∈ depths → ZFSet.pair x y ∈ r → v = w) - (coordinateStrict : ∀ v x y a b, ZFSet.pair x y ∈ r → x ≠ y → - ZFSet.pair (ZFSet.pair v x) a ∈ coordinates → - ZFSet.pair (ZFSet.pair v y) b ∈ coordinates → ZFSet.pair a b ∈ rD) : - StrictLexHeightCode B C D r - (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) rD := by - refine ⟨externalOwnerHeightGraph_function subset seed.function ownerFunction depthFunction - columnCode.function coordinatePartial coordinateTotal, ?_⟩ - intro x hx y hy a q b s lower different first second - by_cases oldX : x ∈ P - · have oldFirst := (externalOwnerHeightGraph_old oldX).1 first - by_cases oldY : y ∈ P - · exact seed.strict x oldX y oldY a q b s lower different oldFirst - ((externalOwnerHeightGraph_old oldY).1 second) - · obtain ⟨_, _, _, _, _, n, hn, _, _, column, _⟩ := - (externalOwnerHeightGraph_fresh seed.function oldY).1 second - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - refine Or.inl ?_ - rw [(columnCode.entries n b).1 column] - exact columnCode.old_below (mem_heightColumns_of_entry seed.function oldFirst) n - · have oldY : y ∉ P := fun hyP => noFreshBelowOld x hx oldX y hyP lower - obtain ⟨_, _, _, v, _, n, hn, ownedX, depthX, colX, coordX⟩ := - (externalOwnerHeightGraph_fresh seed.function oldX).1 first - obtain ⟨_, _, _, w, _, m, hm, ownedY, depthY, colY, coordY⟩ := - (externalOwnerHeightGraph_fresh seed.function oldY).1 second - rcases depthMonotone x hx oldX y hy oldY v w n m ownedX ownedY depthX depthY lower with same | before - · subst m - have sameOwner := sameDepthOwner x hx oldX y hy oldY v w n ownedX ownedY depthX depthY lower - subst w - exact Or.inr ⟨(functionCode_partial columnCode.function).unique n a b colX colY, - coordinateStrict v x y q s lower different coordX coordY⟩ - · exact Or.inl (columnCode.entries_increasing hn hm before colX colY) - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem externalTileSlotSupports_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {V E I U B action vertexImages : ZFSet.{u}} - (hV : V ∈ M.sets) (hE : E ∈ M.sets) (hI : I ∈ M.sets) (hU : U ∈ M.sets) - (hB : B ∈ M.sets) (hAction : action ∈ M.sets) (hImages : vertexImages ∈ M.sets) : - externalTileSlotSupports V E I U B action vertexImages ∈ M.sets := by - have hOne := M.natSetCode_mem separation infinite 1 - have hThree := M.natSetCode_mem separation infinite 3 - let params := extend V (extend E (extend I (extend U (extend B (extend action - (extend vertexImages (extend (natSetCode 1) (extend (natSetCode 3) Fin.elim0)))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.externalTileSlotSupportFormula 0 1 2 3 4 5 6 7 8 9) params - (Fin.cases hV (Fin.cases hE (Fin.cases hI (Fin.cases hU (Fin.cases hB - (Fin.cases hAction (Fin.cases hImages (Fin.cases hOne (Fin.cases hThree (fun i => Fin.elim0 i)))))))))) - (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hV hThree) hB) - have equal : ZFSet.sep (fun y => BoundedFormula.Truth - (BoundedFormula.externalTileSlotSupportFormula 0 1 2 3 4 5 6 7 8 9) (extend y params)) - (ZFSet.prod (ZFSet.prod V (natSetCode 3)) B) = - externalTileSlotSupports V E I U B action vertexImages := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep, BoundedFormula.truth_externalTileSlotSupportFormula _ _ _ _ _ _ _ _ _ _ _ rfl rfl] - exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalColumnCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalLocalHeightSelection + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u + +noncomputable def transportedTileCoordinates (V E I B D action heights : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ v ∈ V, ∃ w ∈ E, ∃ i ∈ I, ∃ x ∈ B, ∃ q ∈ D, + ∃ y ∈ B, ∃ h ∈ ZFSet.sUnion (ZFSet.sUnion heights), z = ZFSet.pair (ZFSet.pair v x) q ∧ + v = ZFSet.pair (natSetCode 1) (ZFSet.pair w i) ∧ ZFSet.pair i h ∈ heights ∧ + ZFSet.pair (ZFSet.pair w y) x ∈ action ∧ ZFSet.pair y q ∈ h) + (ZFSet.prod (ZFSet.prod V B) D) + +theorem pair_mem_transportedTileCoordinates (V E I B D action heights v x q : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair v x) q ∈ transportedTileCoordinates V E I B D action heights ↔ + v ∈ V ∧ x ∈ B ∧ q ∈ D ∧ ∃ w ∈ E, ∃ i ∈ I, ∃ y ∈ B, ∃ h ∈ ZFSet.sUnion (ZFSet.sUnion heights), + v = ZFSet.pair (natSetCode 1) (ZFSet.pair w i) ∧ ZFSet.pair i h ∈ heights ∧ + ZFSet.pair (ZFSet.pair w y) x ∈ action ∧ ZFSet.pair y q ∈ h := by + rw [transportedTileCoordinates, ZFSet.mem_sep] + constructor + · rintro ⟨_, v', hv, w, hw, i, hi, x', hx, q', hq, y, hy, h, hh, equal, body⟩ + obtain ⟨left, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left + exact ⟨hv, hx, hq, w, hw, i, hi, y, hy, h, hh, body⟩ + · rintro ⟨hv, hx, hq, w, hw, i, hi, y, hy, h, hh, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hx⟩, hq⟩, + v, hv, w, hw, i, hi, x, hx, q, hq, y, hy, h, hh, rfl, body⟩ + +theorem transportedTileCoordinates_partial {V E I B D action heights : ZFSet.{u}} + (family : FunctionGraphOn I heights) + (localUnique : ∀ i h y a b, ZFSet.pair i h ∈ heights → + ZFSet.pair y a ∈ h → ZFSet.pair y b ∈ h → a = b) + (actionInjective : ∀ w ∈ E, ∀ y ∈ B, ∀ z ∈ B, ∀ x, + ZFSet.pair (ZFSet.pair w y) x ∈ action → + ZFSet.pair (ZFSet.pair w z) x ∈ action → y = z) : + PartialFunctionCode (ZFSet.prod V B) D (transportedTileCoordinates V E I B D action heights) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro p a b first second + have hp := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 first).1).1 + obtain ⟨v, _, x, _, rfl⟩ := ZFSet.mem_prod.1 hp + obtain ⟨_, _, _, w, hw, i, hi, y, hy, h, _, shape, field, acting, value⟩ := + (pair_mem_transportedTileCoordinates _ _ _ _ _ _ _ _ _ _).1 first + obtain ⟨_, _, _, w', _, i', _, y', hy', h', _, shape', field', acting', value'⟩ := + (pair_mem_transportedTileCoordinates _ _ _ _ _ _ _ _ _ _).1 second + have wi := ZFSet.pair_inj.1 ((ZFSet.pair_inj.1 (shape.symm.trans shape')).2) + obtain ⟨rfl, rfl⟩ := wi + have sameH : h = h' := (family.value_eq_of_entry ⟨i, hi⟩ field).symm.trans + (family.value_eq_of_entry ⟨i, hi⟩ field') + subst h' + have sameY := actionInjective w hw y hy y' hy' x acting acting' + subst y' + exact localUnique i h y a b field value value' + +noncomputable def externalOwnerHeightGraph (P B V C D old owner depths columns coordinates : ZFSet.{u}) : ZFSet.{u} := + old ∪ ZFSet.sep (fun z => ∃ x ∈ B, ∃ v ∈ V, ∃ n ∈ ZFSet.omega, ∃ a ∈ C, ∃ q ∈ D, + z = ZFSet.pair x (ZFSet.pair a q) ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ + ZFSet.pair v n ∈ depths ∧ ZFSet.pair n a ∈ columns ∧ + ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) (ZFSet.prod B (ZFSet.prod C D)) + +theorem pair_mem_externalOwnerHeightGraph (P B V C D old owner depths columns coordinates x y : ZFSet.{u}) : + ZFSet.pair x y ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates ↔ + ZFSet.pair x y ∈ old ∨ (x ∈ B ∧ x ∉ P ∧ ∃ v ∈ V, ∃ n ∈ ZFSet.omega, ∃ a ∈ C, ∃ q ∈ D, + y = ZFSet.pair a q ∧ ZFSet.pair x v ∈ owner ∧ ZFSet.pair v n ∈ depths ∧ + ZFSet.pair n a ∈ columns ∧ ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) := by + rw [externalOwnerHeightGraph, ZFSet.mem_union] + apply or_congr Iff.rfl + rw [ZFSet.mem_sep] + constructor + · rintro ⟨_, x', hx, v, hv, n, hn, a, ha, q, hq, equal, fresh, body⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, fresh, v, hv, n, hn, a, ha, q, hq, rfl, body⟩ + · rintro ⟨hx, fresh, v, hv, n, hn, a, ha, q, hq, rfl, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.pair_mem_prod.2 ⟨ha, hq⟩⟩, + x, hx, v, hv, n, hn, a, ha, q, hq, rfl, fresh, body⟩ + +theorem externalOwnerHeightGraph_old {P B V C D old owner depths columns coordinates x y : ZFSet.{u}} + (hx : x ∈ P) : + ZFSet.pair x y ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates ↔ + ZFSet.pair x y ∈ old := by + rw [pair_mem_externalOwnerHeightGraph] + exact ⟨fun h => h.elim id (fun h => False.elim (h.2.1 hx)), Or.inl⟩ + +theorem externalOwnerHeightGraph_function {P B V C D old owner depths columns coordinates : ZFSet.{u}} + (subset : P ⊆ B) (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) + (ownerFunction : ZFSet.IsFunc B V owner) (depthFunction : ZFSet.IsFunc V ZFSet.omega depths) + (columnFunction : ZFSet.IsFunc ZFSet.omega C columns) + (coordinatePartial : PartialFunctionCode (ZFSet.prod V B) D coordinates) + (coordinateTotal : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner → + ∃ q ∈ D, ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) : + ZFSet.IsFunc B (ZFSet.prod C D) (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) := by + have oldUnique := functionCode_partial oldFunction + have ownerUnique := functionCode_partial ownerFunction + have depthUnique := functionCode_partial depthFunction + have columnUnique := functionCode_partial columnFunction + refine ⟨?_, ?_⟩ + · intro z hz + rcases (ZFSet.mem_union.1 hz) with oldEntry | freshEntry + · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 oldEntry) + exact ZFSet.pair_mem_prod.2 ⟨subset hx, hy⟩ + · exact (ZFSet.mem_sep.1 freshEntry).1 + · intro x hx + by_cases oldX : x ∈ P + · obtain ⟨y, entry, unique⟩ := oldFunction.2 x oldX + exact ⟨y, (externalOwnerHeightGraph_old oldX).2 entry, + fun z hz => unique z ((externalOwnerHeightGraph_old oldX).1 hz)⟩ + · obtain ⟨v, owned, _⟩ := ownerFunction.2 x hx + have hv := (ZFSet.pair_mem_prod.1 (ownerFunction.1 owned)).2 + obtain ⟨n, atDepth, _⟩ := depthFunction.2 v hv + have hn := (ZFSet.pair_mem_prod.1 (depthFunction.1 atDepth)).2 + obtain ⟨a, atColumn, _⟩ := columnFunction.2 n hn + have ha := (ZFSet.pair_mem_prod.1 (columnFunction.1 atColumn)).2 + obtain ⟨q, hq, coord⟩ := coordinateTotal x hx oldX v owned + refine ⟨ZFSet.pair a q, (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).2 + (Or.inr ⟨hx, oldX, v, hv, n, hn, a, ha, q, hq, rfl, owned, atDepth, atColumn, coord⟩), ?_⟩ + intro y entry + rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with oldEntry | fresh + · exact False.elim (oldX (ZFSet.pair_mem_prod.1 (oldFunction.1 oldEntry)).1) + · obtain ⟨_, _, v', _, n', _, a', _, q', _, rfl, owned', depth', column', coord'⟩ := fresh + have sameV := ownerUnique.unique x v' v owned' owned + subst v' + have sameN := depthUnique.unique v n' n depth' atDepth + subst n' + have sameA := columnUnique.unique n a' a column' atColumn + have sameQ := coordinatePartial.unique (ZFSet.pair v x) q' q coord' coord + exact congrArg₂ ZFSet.pair sameA sameQ + +end + +section +open SetFormula +universe u +namespace BoundedFormula + +def transportedTileCoordinateFormula {n} (z V E I B D action heights bound one : Fin n) : BoundedFormula n := + exMem V (exMem E.succ (exMem I.succ.succ (exMem B.succ.succ.succ + (exMem D.succ.succ.succ.succ (exMem B.succ.succ.succ.succ.succ + (exMem bound.succ.succ.succ.succ.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ.succ.succ 6 3 2) + (.conj (orderedRightTripleFormula 6 one.succ.succ.succ.succ.succ.succ.succ 5 4) + (.conj (pairMembershipFormula 4 0 heights.succ.succ.succ.succ.succ.succ.succ) + (.conj (tripleMembershipFormula 5 1 3 action.succ.succ.succ.succ.succ.succ.succ) + (pairMembershipFormula 1 2 0))))))))))) + +theorem truth_transportedTileCoordinateFormula {n} (z V E I B D action heights bound one : Fin n) + (env : Fin n → ZFSet.{u}) (boundEq : env bound = ZFSet.sUnion (ZFSet.sUnion (env heights))) + (oneEq : env one = natSetCode 1) : + Truth (transportedTileCoordinateFormula z V E I B D action heights bound one) env ↔ + env z ∈ transportedTileCoordinates (env V) (env E) (env I) (env B) (env D) (env action) (env heights) := by + simp only [transportedTileCoordinateFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_orderedRightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [boundEq, oneEq, transportedTileCoordinates, ZFSet.mem_sep] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨v, hv, _, _, _, _, x, hx, q, hq, _, _, _, _, equal, _⟩ := h + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hx⟩, hq⟩ + +def ownerHeightFreshFormula {n} (z P B V C D owner depths columns coordinates omega : Fin n) : BoundedFormula n := + exMem B (exMem V.succ (exMem omega.succ.succ (exMem C.succ.succ.succ + (exMem D.succ.succ.succ.succ + (.conj (orderedRightTripleFormula z.succ.succ.succ.succ.succ 4 1 0) + (.conj (.neg (.mem 4 P.succ.succ.succ.succ.succ)) + (.conj (pairMembershipFormula 4 3 owner.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 3 2 depths.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 2 1 columns.succ.succ.succ.succ.succ) + (tripleMembershipFormula 3 4 0 coordinates.succ.succ.succ.succ.succ)))))))))) + +theorem truth_ownerHeightFreshFormula {n} (z P B V C D owner depths columns coordinates omega : Fin n) + (env : Fin n → ZFSet.{u}) (omegaEq : env omega = ZFSet.omega) : + Truth (ownerHeightFreshFormula z P B V C D owner depths columns coordinates omega) env ↔ + ∃ x ∈ env B, ∃ v ∈ env V, ∃ n ∈ ZFSet.omega, ∃ a ∈ env C, ∃ q ∈ env D, + env z = ZFSet.pair x (ZFSet.pair a q) ∧ x ∉ env P ∧ ZFSet.pair x v ∈ env owner ∧ + ZFSet.pair v n ∈ env depths ∧ ZFSet.pair n a ∈ env columns ∧ + ZFSet.pair (ZFSet.pair v x) q ∈ env coordinates := by + simp only [ownerHeightFreshFormula, truth_exMem, Truth, truth_orderedRightTripleFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [omegaEq] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem transportedTileCoordinates_mem {V E I B D action heights : ZFSet.{u}} + (hV : V ∈ M.sets) (hE : E ∈ M.sets) (hI : I ∈ M.sets) (hB : B ∈ M.sets) + (hD : D ∈ M.sets) (hAction : action ∈ M.sets) (hHeights : heights ∈ M.sets) : + transportedTileCoordinates V E I B D action heights ∈ M.sets := by + have hBound := M.union_mem unions (M.union_mem unions hHeights) + have hZero := M.empty_mem ⟨B, hB⟩ + have hOne : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hZero hZero + let params := extend V (extend E (extend I (extend B (extend D (extend action + (extend heights (extend (ZFSet.sUnion (ZFSet.sUnion heights)) (extend (natSetCode 1) Fin.elim0)))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.transportedTileCoordinateFormula 0 1 2 3 4 5 6 7 8 9) params + (Fin.cases hV (Fin.cases hE (Fin.cases hI (Fin.cases hB (Fin.cases hD + (Fin.cases hAction (Fin.cases hHeights (Fin.cases hBound (Fin.cases hOne (fun i => Fin.elim0 i)))))))))) + (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hV hB) hD) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.transportedTileCoordinateFormula 0 1 2 3 4 5 6 7 8 9) (extend z params)) + (ZFSet.prod (ZFSet.prod V B) D) = transportedTileCoordinates V E I B D action heights := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_transportedTileCoordinateFormula _ _ _ _ _ _ _ _ _ _ _ rfl rfl] + exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ + exact equal ▸ selected + +theorem externalOwnerHeightGraph_mem {P B V C D old owner depths columns coordinates : ZFSet.{u}} + (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hV : V ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hOld : old ∈ M.sets) (hOwner : owner ∈ M.sets) (hDepths : depths ∈ M.sets) + (hColumns : columns ∈ M.sets) (hCoordinates : coordinates ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) : + externalOwnerHeightGraph P B V C D old owner depths columns coordinates ∈ M.sets := by + let params := extend P (extend B (extend V (extend C (extend D (extend owner (extend depths + (extend columns (extend coordinates (extend ZFSet.omega Fin.elim0))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.ownerHeightFreshFormula 0 1 2 3 4 5 6 7 8 9 10) params + (Fin.cases hP (Fin.cases hB (Fin.cases hV (Fin.cases hC (Fin.cases hD (Fin.cases hOwner + (Fin.cases hDepths (Fin.cases hColumns (Fin.cases hCoordinates (Fin.cases hOmega (fun i => Fin.elim0 i))))))))))) + (M.prod_mem pairing unions powers separation hB (M.prod_mem pairing unions powers separation hC hD)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.ownerHeightFreshFormula 0 1 2 3 4 5 6 7 8 9 10) (extend z params)) + (ZFSet.prod B (ZFSet.prod C D)) = + ZFSet.sep (fun z => ∃ x ∈ B, ∃ v ∈ V, ∃ n ∈ ZFSet.omega, ∃ a ∈ C, ∃ q ∈ D, + z = ZFSet.pair x (ZFSet.pair a q) ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ + ZFSet.pair v n ∈ depths ∧ ZFSet.pair n a ∈ columns ∧ + ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) (ZFSet.prod B (ZFSet.prod C D)) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_ownerHeightFreshFormula _ _ _ _ _ _ _ _ _ _ _ _ rfl) + exact M.binary_union_mem pairing unions hOld (equal ▸ selected) + +end TransitiveGround +end + +section +universe u + +theorem externalOwnerHeightGraph_range_subset {P B V C D old owner depths columns coordinates : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) : + relationImage B (ZFSet.prod C D) (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) ⊆ + relationImage P (ZFSet.prod C D) old ∪ ZFSet.prod (relationImage ZFSet.omega C columns) D := by + intro y hy + obtain ⟨hy, x, _, entry⟩ := (mem_relationImage _ _ _ _).1 hy + rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with retained | fresh + · exact ZFSet.mem_union.2 (Or.inl ((mem_relationImage _ _ _ _).2 + ⟨hy, x, (ZFSet.pair_mem_prod.1 (oldFunction.1 retained)).1, retained⟩)) + · obtain ⟨_, _, _, _, n, hn, a, ha, q, hq, rfl, _, _, column, _⟩ := fresh + exact ZFSet.mem_union.2 (Or.inr (ZFSet.pair_mem_prod.2 + ⟨(mem_relationImage _ _ _ _).2 ⟨ha, n, hn, column⟩, hq⟩)) + +theorem externalOwnerHeightGraph_below_cap {P B V C D old owner depths columns coordinates base cap rD q0 : ZFSet.{u}} + (ordinal : ordinalSetProperty C) (hq0 : q0 ∈ D) + (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) + (code : ExternalColumnCode C (heightColumns P C D old) base columns cap) + {x y : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates) : + ZFSet.pair y (ZFSet.pair cap q0) ∈ lexHeightOrder C D rD := by + rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with retained | fresh + · obtain ⟨a, ha, q, hq, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (oldFunction.1 retained)).2 + have below := code.old_below (mem_heightColumns_of_entry oldFunction retained) 0 + exact (pair_mem_lexHeightOrder _ _ _ _ _ _ _).2 + ⟨ha, hq, code.cap_mem, hq0, Or.inl (ordinal.2 cap code.cap_mem + (compressionStamp base 0) (code.cap_bound 0) a below)⟩ + · obtain ⟨_, _, _, _, n, hn, a, ha, q, hq, rfl, _, _, column, _⟩ := fresh + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have below : a ∈ cap := (code.entries n a).1 column ▸ code.cap_bound n + exact (pair_mem_lexHeightOrder _ _ _ _ _ _ _).2 ⟨ha, hq, code.cap_mem, hq0, Or.inl below⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem externalOwnerHeightGraph_range_small + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P B V C D old owner depths columns coordinates : ZFSet.{u}} + (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hOld : old ∈ M.sets) (hColumns : columns ∈ M.sets) + (hHeight : externalOwnerHeightGraph P B V C D old owner depths columns coordinates ∈ M.sets) + (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) + (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) + (columnSmall : M.groundEmbeddable (relationImage ZFSet.omega C columns) ZFSet.omega) + (coordinateSmall : M.groundEmbeddable D ZFSet.omega) : + relationImage B (ZFSet.prod C D) (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) ∈ M.sets ∧ + M.groundEmbeddable (relationImage B (ZFSet.prod C D) + (externalOwnerHeightGraph P B V C D old owner depths columns coordinates)) ZFSet.omega := by + have omega := M.omega_mem separation infinite + have rangeGround := M.relationImage_mem separation hB (M.prod_mem pairing unions powers separation hC hD) hHeight + have oldGround := M.relationImage_mem separation hP (M.prod_mem pairing unions powers separation hC hD) hOld + have columnsGround := M.relationImage_mem separation omega hC hColumns + have productGround := M.prod_mem pairing unions powers separation columnsGround hD + have productSmall := M.groundEmbeddable_product pairing unions powers separation infinite columnsGround hD columnSmall coordinateSmall + have totalSmall := M.groundCountable_binary_union pairing unions powers separation infinite choice + oldGround productGround oldSmall productSmall + exact ⟨rangeGround, M.groundEmbeddable_restrict separation rangeGround omega + (externalOwnerHeightGraph_range_subset oldFunction) totalSmall⟩ + +end TransitiveGround + +end + +section +open SetFormula +universe u + +noncomputable def externalTileSlotSupports (V E I U B action vertexImages : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun y => ∃ v ∈ V, ∃ j ∈ natSetCode 3, ∃ x ∈ B, ∃ w ∈ E, + ∃ r ∈ I, ∃ u ∈ U, ∃ z ∈ B, + y = ZFSet.pair (ZFSet.pair v j) x ∧ v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r) ∧ + ZFSet.pair (ZFSet.pair (ZFSet.pair r j) u) z ∈ vertexImages ∧ + ZFSet.pair (ZFSet.pair w z) x ∈ action) + (ZFSet.prod (ZFSet.prod V (natSetCode 3)) B) + +theorem pair_mem_externalTileSlotSupports (V E I U B action vertexImages v j x : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair v j) x ∈ externalTileSlotSupports V E I U B action vertexImages ↔ + v ∈ V ∧ j ∈ natSetCode 3 ∧ x ∈ B ∧ ∃ w ∈ E, ∃ r ∈ I, ∃ u ∈ U, ∃ z ∈ B, + v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r) ∧ + ZFSet.pair (ZFSet.pair (ZFSet.pair r j) u) z ∈ vertexImages ∧ + ZFSet.pair (ZFSet.pair w z) x ∈ action := by + rw [externalTileSlotSupports, ZFSet.mem_sep] + constructor + · rintro ⟨_, v', hv, j', hj, x', hx, w, hw, r, hr, u, hu, z, hz, equal, body⟩ + obtain ⟨left, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left + exact ⟨hv, hj, hx, w, hw, r, hr, u, hu, z, hz, body⟩ + · rintro ⟨hv, hj, hx, w, hw, r, hr, u, hu, z, hz, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hj⟩, hx⟩, + v, hv, j, hj, x, hx, w, hw, r, hr, u, hu, z, hz, rfl, body⟩ + +namespace BoundedFormula + +def slotImageMembershipFormula {n} (r j u z images : Fin n) : BoundedFormula n := + exMem images (exMem 0 (exMem 0 + (.conj (orderedTripleFormula 0 r.succ.succ.succ j.succ.succ.succ u.succ.succ.succ) + (orderedPairFormula 2 0 z.succ.succ.succ)))) + +theorem truth_slotImageMembershipFormula {n} (r j u z images : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (slotImageMembershipFormula r j u z images) env ↔ + ZFSet.pair (ZFSet.pair (ZFSet.pair (env r) (env j)) (env u)) (env z) ∈ env images := by + simp only [slotImageMembershipFormula, truth_exMem, Truth, truth_orderedTripleFormula, truth_orderedPairFormula] + change (∃ a ∈ env images, ∃ b ∈ a, ∃ c ∈ b, + c = ZFSet.pair (ZFSet.pair (env r) (env j)) (env u) ∧ a = ZFSet.pair c (env z)) ↔ _ + constructor + · rintro ⟨a, ha, _, _, c, _, rfl, rfl⟩ + exact ha + · intro entry + let c := ZFSet.pair (ZFSet.pair (env r) (env j)) (env u) + exact ⟨ZFSet.pair c (env z), entry, {c}, ZFSet.mem_pair.2 (Or.inl rfl), + c, ZFSet.mem_singleton.2 rfl, rfl, rfl⟩ + +def externalTileSlotSupportFormula {n} (y V E I U B action images one three : Fin n) : BoundedFormula n := + exMem V (exMem three.succ (exMem B.succ.succ (exMem E.succ.succ.succ + (exMem I.succ.succ.succ.succ (exMem U.succ.succ.succ.succ.succ + (exMem B.succ.succ.succ.succ.succ.succ + (.conj (orderedTripleFormula y.succ.succ.succ.succ.succ.succ.succ 6 5 4) + (.conj (orderedRightTripleFormula 6 one.succ.succ.succ.succ.succ.succ.succ 3 2) + (.conj (slotImageMembershipFormula 2 5 1 0 images.succ.succ.succ.succ.succ.succ.succ) + (tripleMembershipFormula 3 0 4 action.succ.succ.succ.succ.succ.succ.succ)))))))))) + +theorem truth_externalTileSlotSupportFormula {n} (y V E I U B action images one three : Fin n) + (env : Fin n → ZFSet.{u}) (oneEq : env one = natSetCode 1) (threeEq : env three = natSetCode 3) : + Truth (externalTileSlotSupportFormula y V E I U B action images one three) env ↔ + env y ∈ externalTileSlotSupports (env V) (env E) (env I) (env U) (env B) (env action) (env images) := by + simp only [externalTileSlotSupportFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_orderedRightTripleFormula, truth_slotImageMembershipFormula, truth_tripleMembershipFormula] + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [oneEq, threeEq, externalTileSlotSupports, ZFSet.mem_sep] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨v, hv, j, hj, x, hx, _, _, _, _, _, _, _, _, equal, _⟩ := h + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hv, hj⟩, hx⟩ + +end BoundedFormula + +end + +section +universe u + +theorem externalOwnerHeightGraph_fresh {P B V C D old owner depths columns coordinates x a q : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P (ZFSet.prod C D) old) (fresh : x ∉ P) : + ZFSet.pair x (ZFSet.pair a q) ∈ externalOwnerHeightGraph P B V C D old owner depths columns coordinates ↔ + x ∈ B ∧ a ∈ C ∧ q ∈ D ∧ ∃ v ∈ V, ∃ n ∈ ZFSet.omega, + ZFSet.pair x v ∈ owner ∧ ZFSet.pair v n ∈ depths ∧ ZFSet.pair n a ∈ columns ∧ + ZFSet.pair (ZFSet.pair v x) q ∈ coordinates := by + rw [pair_mem_externalOwnerHeightGraph] + constructor + · intro entry + rcases entry with retained | new + · exact False.elim (fresh (ZFSet.pair_mem_prod.1 (oldFunction.1 retained)).1) + · obtain ⟨hx, _, v, hv, n, hn, a', ha, q', hq, equal, body⟩ := new + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, ha, hq, v, hv, n, hn, body⟩ + · rintro ⟨hx, ha, hq, v, hv, n, hn, body⟩ + exact Or.inr ⟨hx, fresh, v, hv, n, hn, a, ha, q, hq, rfl, body⟩ + +theorem ExternalColumnCode.entries_increasing {C K base columns cap n m a b : ZFSet.{u}} + (code : ExternalColumnCode C K base columns cap) + (hn : n ∈ ZFSet.omega) (hm : m ∈ ZFSet.omega) (before : n ∈ m) + (first : ZFSet.pair n a ∈ columns) (second : ZFSet.pair m b ∈ columns) : a ∈ b := by + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + rw [(code.entries n a).1 first, (code.entries m b).1 second] + exact (compressionStamp_mem_iff base n m).2 ((natSetCode_mem_iff n m).1 before) + +theorem externalOwnerHeightGraph_strictLex {P B V C D r old owner depths columns coordinates base cap rD : ZFSet.{u}} + (subset : P ⊆ B) (seed : StrictLexHeightCode P C D r old rD) + (ownerFunction : ZFSet.IsFunc B V owner) (depthFunction : ZFSet.IsFunc V ZFSet.omega depths) + (columnCode : ExternalColumnCode C (heightColumns P C D old) base columns cap) + (coordinatePartial : PartialFunctionCode (ZFSet.prod V B) D coordinates) + (coordinateTotal : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner → + ∃ q ∈ D, ZFSet.pair (ZFSet.pair v x) q ∈ coordinates) + (noFreshBelowOld : ∀ x ∈ B, x ∉ P → ∀ y ∈ P, ZFSet.pair x y ∉ r) + (depthMonotone : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ v w n m, + ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → ZFSet.pair v n ∈ depths → + ZFSet.pair w m ∈ depths → ZFSet.pair x y ∈ r → n = m ∨ n ∈ m) + (sameDepthOwner : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ v w n, + ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → ZFSet.pair v n ∈ depths → + ZFSet.pair w n ∈ depths → ZFSet.pair x y ∈ r → v = w) + (coordinateStrict : ∀ v x y a b, ZFSet.pair x y ∈ r → x ≠ y → + ZFSet.pair (ZFSet.pair v x) a ∈ coordinates → + ZFSet.pair (ZFSet.pair v y) b ∈ coordinates → ZFSet.pair a b ∈ rD) : + StrictLexHeightCode B C D r + (externalOwnerHeightGraph P B V C D old owner depths columns coordinates) rD := by + refine ⟨externalOwnerHeightGraph_function subset seed.function ownerFunction depthFunction + columnCode.function coordinatePartial coordinateTotal, ?_⟩ + intro x hx y hy a q b s lower different first second + by_cases oldX : x ∈ P + · have oldFirst := (externalOwnerHeightGraph_old oldX).1 first + by_cases oldY : y ∈ P + · exact seed.strict x oldX y oldY a q b s lower different oldFirst + ((externalOwnerHeightGraph_old oldY).1 second) + · obtain ⟨_, _, _, _, _, n, hn, _, _, column, _⟩ := + (externalOwnerHeightGraph_fresh seed.function oldY).1 second + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + refine Or.inl ?_ + rw [(columnCode.entries n b).1 column] + exact columnCode.old_below (mem_heightColumns_of_entry seed.function oldFirst) n + · have oldY : y ∉ P := fun hyP => noFreshBelowOld x hx oldX y hyP lower + obtain ⟨_, _, _, v, _, n, hn, ownedX, depthX, colX, coordX⟩ := + (externalOwnerHeightGraph_fresh seed.function oldX).1 first + obtain ⟨_, _, _, w, _, m, hm, ownedY, depthY, colY, coordY⟩ := + (externalOwnerHeightGraph_fresh seed.function oldY).1 second + rcases depthMonotone x hx oldX y hy oldY v w n m ownedX ownedY depthX depthY lower with same | before + · subst m + have sameOwner := sameDepthOwner x hx oldX y hy oldY v w n ownedX ownedY depthX depthY lower + subst w + exact Or.inr ⟨(functionCode_partial columnCode.function).unique n a b colX colY, + coordinateStrict v x y q s lower different coordX coordY⟩ + · exact Or.inl (columnCode.entries_increasing hn hm before colX colY) + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem externalTileSlotSupports_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {V E I U B action vertexImages : ZFSet.{u}} + (hV : V ∈ M.sets) (hE : E ∈ M.sets) (hI : I ∈ M.sets) (hU : U ∈ M.sets) + (hB : B ∈ M.sets) (hAction : action ∈ M.sets) (hImages : vertexImages ∈ M.sets) : + externalTileSlotSupports V E I U B action vertexImages ∈ M.sets := by + have hOne := M.natSetCode_mem separation infinite 1 + have hThree := M.natSetCode_mem separation infinite 3 + let params := extend V (extend E (extend I (extend U (extend B (extend action + (extend vertexImages (extend (natSetCode 1) (extend (natSetCode 3) Fin.elim0)))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.externalTileSlotSupportFormula 0 1 2 3 4 5 6 7 8 9) params + (Fin.cases hV (Fin.cases hE (Fin.cases hI (Fin.cases hU (Fin.cases hB + (Fin.cases hAction (Fin.cases hImages (Fin.cases hOne (Fin.cases hThree (fun i => Fin.elim0 i)))))))))) + (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hV hThree) hB) + have equal : ZFSet.sep (fun y => BoundedFormula.Truth + (BoundedFormula.externalTileSlotSupportFormula 0 1 2 3 4 5 6 7 8 9) (extend y params)) + (ZFSet.prod (ZFSet.prod V (natSetCode 3)) B) = + externalTileSlotSupports V E I U B action vertexImages := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep, BoundedFormula.truth_externalTileSlotSupportFormula _ _ _ _ _ _ _ _ _ _ _ rfl rfl] + exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationEventOrigins.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationEventOrigins.lean index 81f9e94dc3b8b7134432596ffd1aff0876ab79e9..2f8de2c803818be725cfb2efbc0c5fe1d557ec6e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationEventOrigins.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationEventOrigins.lean @@ -1,87 +1,87 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticFairPreparationRecordedLimits - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) - -theorem fairPreparationStep_event_origin - {omega E0 stages U enumSelector prepSelector grid packed Q order nodes T : ZFSet.{u}} - (selected : prepSelector ⊆ M.varyingPreparationRelation stages packed Q order nodes T) - (clock p births last nextClock q nextBirths event : ZFSet.{u}) - (step : FairPreparationStepCode omega E0 stages U enumSelector prepSelector grid - (ZFSet.pair clock (ZFSet.pair p (ZFSet.pair births last))) - (ZFSet.pair nextClock (ZFSet.pair q (ZFSet.pair nextBirths event)))) : - event = ∅ ∨ ∃ alpha ∈ stages, ∃ y ∈ U, - (∃ payload, y = ZFSet.pair q payload) ∧ - ZFSet.pair (ZFSet.pair alpha p) y ∈ - M.varyingPreparationRelation stages packed Q order nodes T ∧ - event = ZFSet.pair alpha y := by - obtain ⟨n, p', b, last', m, q', nextBirths', event', source, target, _next, - i, _hi, j, _hj, e, _he, newE, _hNew, _grid, _old, _selected, _append, branch⟩ := step - obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 source - obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 target - obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - rcases branch with idle | active - · exact Or.inl idle.2.2 - · obtain ⟨alpha, hAlpha, y, hy, shape, _entry, edge, equal⟩ := active - exact Or.inr ⟨alpha, hAlpha, y, hy, shape, selected edge, equal⟩ - -theorem fairPreparationEvents_origins - {Q stages U E0 enumSelector prepSelector grid packed order nodes T orbit : ZFSet.{u}} - (function : ZFSet.IsFunc ZFSet.omega - (M.fairPreparationStates Q stages U E0 enumSelector) orbit) - (selected : prepSelector ⊆ M.varyingPreparationRelation stages packed Q order nodes T) - (clocks conditions births events : Nat → ZFSet.{u}) - (initialEvent : events 0 = ∅) - (entries : ∀ k, ZFSet.pair (natSetCode k) - (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) - (ZFSet.pair (births k) (events k)))) ∈ orbit) - (steps : ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U - enumSelector prepSelector grid - (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) (ZFSet.pair (births k) (events k)))) - (ZFSet.pair (clocks (k + 1)) - (ZFSet.pair (conditions (k + 1)) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) - (i event : ZFSet.{u}) - (edge : ZFSet.pair i event ∈ familyCodeGraph natSetCode events) : - event = ∅ ∨ ∃ k : Nat, ∃ alpha ∈ stages, ∃ y ∈ U, - i = natSetCode (k + 1) ∧ conditions k ∈ Q ∧ conditions (k + 1) ∈ Q ∧ - (∃ payload, y = ZFSet.pair (conditions (k + 1)) payload) ∧ - ZFSet.pair (ZFSet.pair alpha (conditions k)) y ∈ - M.varyingPreparationRelation stages packed Q order nodes T ∧ - event = ZFSet.pair alpha y ∧ - ZFSet.pair (natSetCode k) - (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) - (ZFSet.pair (births k) (events k)))) ∈ orbit ∧ - ZFSet.pair (natSetCode (k + 1)) - (ZFSet.pair (clocks (k + 1)) (ZFSet.pair (conditions (k + 1)) - (ZFSet.pair (births (k + 1)) (events (k + 1))))) ∈ orbit := by - have condition_mem (k : Nat) : conditions k ∈ Q := by - have state := (ZFSet.pair_mem_prod.1 (function.1 (entries k))).2 - have bound := ((M.mem_fairPreparationStates Q stages U E0 enumSelector _).1 state).1 - exact (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 bound).2).1 - obtain ⟨n, equal⟩ := (mem_familyCodeGraph natSetCode events _).1 edge - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - cases n with - | zero => exact Or.inl initialEvent - | succ k => - rcases M.fairPreparationStep_event_origin selected - (clocks k) (conditions k) (births k) (events k) - (clocks (k + 1)) (conditions (k + 1)) (births (k + 1)) (events (k + 1)) - (steps k) with idle | active - · exact Or.inl idle - · obtain ⟨alpha, hAlpha, y, hy, shape, relation, eventEq⟩ := active - exact Or.inr ⟨k, alpha, hAlpha, y, hy, rfl, condition_mem k, condition_mem (k + 1), - shape, relation, eventEq, entries k, entries (k + 1)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticFairPreparationRecordedLimits + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) + +theorem fairPreparationStep_event_origin + {omega E0 stages U enumSelector prepSelector grid packed Q order nodes T : ZFSet.{u}} + (selected : prepSelector ⊆ M.varyingPreparationRelation stages packed Q order nodes T) + (clock p births last nextClock q nextBirths event : ZFSet.{u}) + (step : FairPreparationStepCode omega E0 stages U enumSelector prepSelector grid + (ZFSet.pair clock (ZFSet.pair p (ZFSet.pair births last))) + (ZFSet.pair nextClock (ZFSet.pair q (ZFSet.pair nextBirths event)))) : + event = ∅ ∨ ∃ alpha ∈ stages, ∃ y ∈ U, + (∃ payload, y = ZFSet.pair q payload) ∧ + ZFSet.pair (ZFSet.pair alpha p) y ∈ + M.varyingPreparationRelation stages packed Q order nodes T ∧ + event = ZFSet.pair alpha y := by + obtain ⟨n, p', b, last', m, q', nextBirths', event', source, target, _next, + i, _hi, j, _hj, e, _he, newE, _hNew, _grid, _old, _selected, _append, branch⟩ := step + obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 source + obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 target + obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + rcases branch with idle | active + · exact Or.inl idle.2.2 + · obtain ⟨alpha, hAlpha, y, hy, shape, _entry, edge, equal⟩ := active + exact Or.inr ⟨alpha, hAlpha, y, hy, shape, selected edge, equal⟩ + +theorem fairPreparationEvents_origins + {Q stages U E0 enumSelector prepSelector grid packed order nodes T orbit : ZFSet.{u}} + (function : ZFSet.IsFunc ZFSet.omega + (M.fairPreparationStates Q stages U E0 enumSelector) orbit) + (selected : prepSelector ⊆ M.varyingPreparationRelation stages packed Q order nodes T) + (clocks conditions births events : Nat → ZFSet.{u}) + (initialEvent : events 0 = ∅) + (entries : ∀ k, ZFSet.pair (natSetCode k) + (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) + (ZFSet.pair (births k) (events k)))) ∈ orbit) + (steps : ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U + enumSelector prepSelector grid + (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) (ZFSet.pair (births k) (events k)))) + (ZFSet.pair (clocks (k + 1)) + (ZFSet.pair (conditions (k + 1)) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) + (i event : ZFSet.{u}) + (edge : ZFSet.pair i event ∈ familyCodeGraph natSetCode events) : + event = ∅ ∨ ∃ k : Nat, ∃ alpha ∈ stages, ∃ y ∈ U, + i = natSetCode (k + 1) ∧ conditions k ∈ Q ∧ conditions (k + 1) ∈ Q ∧ + (∃ payload, y = ZFSet.pair (conditions (k + 1)) payload) ∧ + ZFSet.pair (ZFSet.pair alpha (conditions k)) y ∈ + M.varyingPreparationRelation stages packed Q order nodes T ∧ + event = ZFSet.pair alpha y ∧ + ZFSet.pair (natSetCode k) + (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) + (ZFSet.pair (births k) (events k)))) ∈ orbit ∧ + ZFSet.pair (natSetCode (k + 1)) + (ZFSet.pair (clocks (k + 1)) (ZFSet.pair (conditions (k + 1)) + (ZFSet.pair (births (k + 1)) (events (k + 1))))) ∈ orbit := by + have condition_mem (k : Nat) : conditions k ∈ Q := by + have state := (ZFSet.pair_mem_prod.1 (function.1 (entries k))).2 + have bound := ((M.mem_fairPreparationStates Q stages U E0 enumSelector _).1 state).1 + exact (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 bound).2).1 + obtain ⟨n, equal⟩ := (mem_familyCodeGraph natSetCode events _).1 edge + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + cases n with + | zero => exact Or.inl initialEvent + | succ k => + rcases M.fairPreparationStep_event_origin selected + (clocks k) (conditions k) (births k) (events k) + (clocks (k + 1)) (conditions (k + 1)) (births (k + 1)) (events (k + 1)) + (steps k) with idle | active + · exact Or.inl idle + · obtain ⟨alpha, hAlpha, y, hy, shape, relation, eventEq⟩ := active + exact Or.inr ⟨k, alpha, hAlpha, y, hy, rfl, condition_mem k, condition_mem (k + 1), + shape, relation, eventEq, entries k, entries (k + 1)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationMonotonicity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationMonotonicity.lean index 814fc6a7d43a15994a04cca33ff7a21d8a002e32..2514b8dc03ab3fe63263be1a090cd103eaa010c9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationMonotonicity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairPreparationMonotonicity.lean @@ -1,496 +1,496 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundVaryingPreparationRelations -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFiniteBirthHistories -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementBirthEnumerationFairness - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -def FairPreparationStateCode (omega E0 enumSelector state : ZFSet.{u}) : Prop := - ∃ n p births last, state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ - n ∈ omega ∧ insert n n ∈ omega ∧ ZFSet.IsFunc (insert n n) E0 births ∧ - ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ ZFSet.pair n e ∈ births - -namespace BoundedFormula -open SetFormula - -def exFairStateFields {n} (state : Fin n) (body : BoundedFormula (n + 4)) : BoundedFormula n := - exPairFields state (exPairFields 0 (exPairFields 0 - (reindex (Fin.cases 0 (Fin.cases 1 (Fin.cases 3 (Fin.cases 5 - (fun j => j.succ.succ.succ.succ.succ.succ))))) body))) - -theorem truth_exFairStateFields {n} (state : Fin n) (body : BoundedFormula (n + 4)) - (env : Fin n → ZFSet.{u}) : - Truth (exFairStateFields state body) env ↔ - ∃ n p births last, env state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ - Truth body (extend last (extend births (extend p (extend n env)))) := by - simp only [exFairStateFields, truth_exPairFields, truth_reindex] - have rearrange (n tail p inner births last : ZFSet.{u}) : - (fun i => extend last (extend births (extend inner (extend p (extend tail (extend n env))))) - (Fin.cases 0 (Fin.cases 1 (Fin.cases 3 (Fin.cases 5 - (fun j => j.succ.succ.succ.succ.succ.succ)))) i)) = - extend last (extend births (extend p (extend n env))) := by - funext i - refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => Fin.cases ?_ - (fun l => Fin.cases ?_ (fun m => ?_) l) k) j) i <;> rfl - simp only [rearrange] - constructor - · rintro ⟨n, tail, eq, p, inner, rfl, births, last, rfl, holds⟩ - exact ⟨n, p, births, last, eq, holds⟩ - · rintro ⟨n, p, births, last, eq, holds⟩ - exact ⟨n, _, eq, p, _, rfl, births, last, rfl, holds⟩ - -def fairPreparationStateFormula {n} (omega E0 enumSelector state : Fin n) : BoundedFormula n := - let old := fun j : Fin n => j.succ.succ.succ.succ - exFairStateFields state (.conj (.mem 3 (old omega)) - (exMem (old omega) (.conj (successorFormula 0 4) - (.conj (functionFormula 0 (old E0).succ 2) - (exMem (old E0).succ (.conj - (pairMembershipFormula 4 0 (old enumSelector).succ.succ) - (pairMembershipFormula 5 0 3))))))) - -theorem truth_fairPreparationStateFormula {n} (omega E0 enumSelector state : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (fairPreparationStateFormula omega E0 enumSelector state) env ↔ - FairPreparationStateCode (env omega) (env E0) (env enumSelector) (env state) := by - simp only [fairPreparationStateFormula, truth_exFairStateFields, Truth, truth_exMem, - truth_successorFormula, truth_functionFormula, truth_pairMembershipFormula] - change (∃ n p births last, env state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ - n ∈ env omega ∧ ∃ next ∈ env omega, next = insert n n ∧ - ZFSet.IsFunc next (env E0) births ∧ ∃ e ∈ env E0, - ZFSet.pair p e ∈ env enumSelector ∧ ZFSet.pair n e ∈ births) ↔ _ - constructor - · rintro ⟨n, p, births, last, shape, hn, next, hm, rfl, function, witness⟩ - exact ⟨n, p, births, last, shape, hn, hm, function, witness⟩ - · rintro ⟨n, p, births, last, shape, hn, hm, function, witness⟩ - exact ⟨n, p, births, last, shape, hn, insert n n, hm, rfl, function, witness⟩ - -end BoundedFormula - - - - - - -def FairPreparationStepCode - (omega E0 stages U enumSelector prepSelector gridGraph state next : ZFSet.{u}) : Prop := - ∃ n p births last m q nextBirths event, - state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ - next = ZFSet.pair m (ZFSet.pair q (ZFSet.pair nextBirths event)) ∧ - m = insert n n ∧ - ∃ i ∈ omega, ∃ j ∈ omega, ∃ e ∈ E0, ∃ newE ∈ E0, - ZFSet.pair n (ZFSet.pair i j) ∈ gridGraph ∧ - ZFSet.pair i e ∈ births ∧ ZFSet.pair q newE ∈ enumSelector ∧ - nextBirths = insert (ZFSet.pair m newE) births ∧ - ((e = ∅ ∧ q = p ∧ event = ∅) ∨ - (∃ alpha ∈ stages, ∃ y ∈ U, (∃ payload, y = ZFSet.pair q payload) ∧ - ZFSet.pair j alpha ∈ e ∧ ZFSet.pair (ZFSet.pair alpha p) y ∈ prepSelector ∧ - event = ZFSet.pair alpha y)) - -namespace BoundedFormula -open SetFormula - -private def insertPairFormula {n} (output graph x y : Fin n) : BoundedFormula n := - .conj (.allMem output (disj (.mem 0 graph.succ) (orderedPairFormula 0 x.succ y.succ))) - (.conj (subsetFormula graph output) (pairMembershipFormula x y output)) - -private theorem truth_insertPairFormula {n} (output graph x y : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (insertPairFormula output graph x y) env ↔ - env output = insert (ZFSet.pair (env x) (env y)) (env graph) := by - simp only [insertPairFormula, Truth, truth_disj, truth_orderedPairFormula, - truth_subsetFormula, truth_pairMembershipFormula] - constructor - · rintro ⟨inside, includes, entry⟩ - apply ZFSet.ext - intro z - rw [ZFSet.mem_insert_iff] - exact ⟨fun hz => (inside z hz).symm, - fun hz => hz.elim (fun eq => eq ▸ entry) (fun hz => includes hz)⟩ - · intro eq - rw [eq] - exact ⟨fun z hz => (ZFSet.mem_insert_iff.1 hz).symm, - fun _ hz => ZFSet.mem_insert_of_mem _ hz, ZFSet.mem_insert _ _⟩ - -private def activePreparationFormula {n} - (stages U e j p q event prepSelector : Fin n) : BoundedFormula n := - let old := fun i : Fin n => i.succ.succ.succ.succ - exMem stages (exMem U.succ (exPairFields 0 - (.conj (.equal 1 (old q)) - (.conj (pairMembershipFormula (old j) 3 (old e)) - (.conj (tripleMembershipFormula 3 (old p) 2 (old prepSelector)) - (orderedPairFormula (old event) 3 2)))))) - -private theorem truth_activePreparationFormula {n} - (stages U e j p q event prepSelector : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (activePreparationFormula stages U e j p q event prepSelector) env ↔ - ∃ alpha ∈ env stages, ∃ y ∈ env U, (∃ payload, y = ZFSet.pair (env q) payload) ∧ - ZFSet.pair (env j) alpha ∈ env e ∧ - ZFSet.pair (ZFSet.pair alpha (env p)) y ∈ env prepSelector ∧ - env event = ZFSet.pair alpha y := by - simp only [activePreparationFormula, truth_exMem, truth_exPairFields, Truth, - truth_pairMembershipFormula, truth_tripleMembershipFormula, truth_orderedPairFormula] - constructor - · rintro ⟨alpha, ha, y, hy, q', payload, shape, equal, entry, selected, eventEq⟩ - change q' = env q at equal - exact ⟨alpha, ha, y, hy, ⟨payload, equal ▸ shape⟩, entry, selected, eventEq⟩ - · rintro ⟨alpha, ha, y, hy, ⟨payload, shape⟩, entry, selected, eventEq⟩ - exact ⟨alpha, ha, y, hy, env q, payload, shape, rfl, entry, selected, eventEq⟩ - -private def fairStepFieldsFormula {arity} - (omega E0 stages U enumSelector prepSelector gridGraph n p births m q nextBirths event : Fin arity) : - BoundedFormula arity := - let old := fun i : Fin arity => i.succ.succ.succ.succ - .conj (successorFormula m n) - (exMem omega (exMem omega.succ (exMem E0.succ.succ (exMem E0.succ.succ.succ - (.conj (rightTripleMembershipFormula (old n) 3 2 (old gridGraph)) - (.conj (pairMembershipFormula 3 1 (old births)) - (.conj (pairMembershipFormula (old q) 0 (old enumSelector)) - (.conj (insertPairFormula (old nextBirths) (old births) (old m) 0) - (disj (.conj (emptyFormula 1) (.conj (.equal (old q) (old p)) (emptyFormula (old event)))) - (activePreparationFormula (old stages) (old U) 1 2 (old p) (old q) - (old event) (old prepSelector))))))))))) - -private theorem truth_fairStepFieldsFormula {arity} - (omega E0 stages U enumSelector prepSelector gridGraph n p births m q nextBirths event : Fin arity) - (env : Fin arity → ZFSet.{u}) : - Truth (fairStepFieldsFormula omega E0 stages U enumSelector prepSelector gridGraph - n p births m q nextBirths event) env ↔ - env m = insert (env n) (env n) ∧ - ∃ i ∈ env omega, ∃ j ∈ env omega, ∃ e ∈ env E0, ∃ newE ∈ env E0, - ZFSet.pair (env n) (ZFSet.pair i j) ∈ env gridGraph ∧ - ZFSet.pair i e ∈ env births ∧ ZFSet.pair (env q) newE ∈ env enumSelector ∧ - env nextBirths = insert (ZFSet.pair (env m) newE) (env births) ∧ - ((e = ∅ ∧ env q = env p ∧ env event = ∅) ∨ - (∃ alpha ∈ env stages, ∃ y ∈ env U, (∃ payload, y = ZFSet.pair (env q) payload) ∧ - ZFSet.pair j alpha ∈ e ∧ ZFSet.pair (ZFSet.pair alpha (env p)) y ∈ env prepSelector ∧ - env event = ZFSet.pair alpha y)) := by - simp only [fairStepFieldsFormula, Truth, truth_successorFormula, truth_exMem, - truth_rightTripleMembershipFormula, truth_pairMembershipFormula, truth_insertPairFormula, - truth_disj, truth_emptyFormula, truth_activePreparationFormula] - rfl - -def fairPreparationStepFormula {n} - (omega E0 stages U enumSelector prepSelector gridGraph state next : Fin n) : BoundedFormula n := - let old := fun i : Fin n => i.succ.succ.succ.succ.succ.succ.succ.succ - exFairStateFields state (exFairStateFields next.succ.succ.succ.succ - (fairStepFieldsFormula (old omega) (old E0) (old stages) (old U) (old enumSelector) - (old prepSelector) (old gridGraph) 7 6 5 3 2 1 0)) - -theorem truth_fairPreparationStepFormula {n} - (omega E0 stages U enumSelector prepSelector gridGraph state next : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (fairPreparationStepFormula omega E0 stages U enumSelector prepSelector gridGraph state next) env ↔ - FairPreparationStepCode (env omega) (env E0) (env stages) (env U) (env enumSelector) - (env prepSelector) (env gridGraph) (env state) (env next) := by - simp only [fairPreparationStepFormula, truth_exFairStateFields, truth_fairStepFieldsFormula] - constructor - · rintro ⟨n, p, births, last, shape, m, q, nextBirths, event, nextShape, rest⟩ - exact ⟨n, p, births, last, m, q, nextBirths, event, shape, nextShape, rest⟩ - · rintro ⟨n, p, births, last, m, q, nextBirths, event, shape, nextShape, rest⟩ - exact ⟨n, p, births, last, shape, m, q, nextBirths, event, nextShape, rest⟩ - -end BoundedFormula - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def fairPreparationStates (Q stages U E0 enumSelector : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (FairPreparationStateCode ZFSet.omega E0 enumSelector) - (ZFSet.prod ZFSet.omega (ZFSet.prod Q - (ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U))))) - -theorem mem_fairPreparationStates (Q stages U E0 enumSelector state : ZFSet.{u}) : - state ∈ M.fairPreparationStates Q stages U E0 enumSelector ↔ - state ∈ ZFSet.prod ZFSet.omega (ZFSet.prod Q - (ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U)))) ∧ - FairPreparationStateCode ZFSet.omega E0 enumSelector state := ZFSet.mem_sep - -noncomputable def fairPreparationTransition - (Q stages U E0 enumSelector prepSelector gridGraph : ZFSet.{u}) : ZFSet.{u} := - let states := M.fairPreparationStates Q stages U E0 enumSelector - ZFSet.sep (fun z => ∃ state next, z = ZFSet.pair state next ∧ - FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector gridGraph state next) - (ZFSet.prod states states) - -theorem pair_mem_fairPreparationTransition - (Q stages U E0 enumSelector prepSelector gridGraph state next : ZFSet.{u}) : - ZFSet.pair state next ∈ M.fairPreparationTransition Q stages U E0 enumSelector prepSelector gridGraph ↔ - state ∈ M.fairPreparationStates Q stages U E0 enumSelector ∧ - next ∈ M.fairPreparationStates Q stages U E0 enumSelector ∧ - FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector gridGraph state next := by - rw [fairPreparationTransition, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hs, hn⟩, state', next', eq, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hs, hn, code⟩ - · rintro ⟨hs, hn, code⟩ - exact ⟨⟨hs, hn⟩, state, next, rfl, code⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -include pairing unions powers separation in -theorem fairPreparationStates_mem - {Q stages U E0 enumSelector : ZFSet.{u}} - (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) - (hE0 : E0 ∈ M.sets) (hEnum : enumSelector ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.fairPreparationStates Q stages U E0 enumSelector ∈ M.sets := by - have history := M.groundRelations_mem pairing unions powers separation omega hE0 - have events := M.insert_mem pairing unions (M.empty_mem ⟨Q, hQ⟩) - (M.prod_mem pairing unions powers separation hStages hU) - have bound := M.prod_mem pairing unions powers separation omega - (M.prod_mem pairing unions powers separation hQ - (M.prod_mem pairing unions powers separation history events)) - let params : Fin 3 → ZFSet.{u} := ![ZFSet.omega, E0, enumSelector] - have ground : ∀ j, params j ∈ M.sets := Fin.cases omega - (Fin.cases hE0 (Fin.cases hEnum (fun j => Fin.elim0 j))) - let formula : BoundedFormula 4 := BoundedFormula.fairPreparationStateFormula 1 2 3 0 - have selected := M.bounded_separation_mem separation formula params ground bound - have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) - (ZFSet.prod ZFSet.omega (ZFSet.prod Q - (ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U))))) = - M.fairPreparationStates Q stages U E0 enumSelector := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, fairPreparationStates, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_fairPreparationStateFormula 1 2 3 0 _) - exact equal ▸ selected - -include pairing unions powers separation in -theorem fairPreparationTransition_mem - {Q stages U E0 enumSelector prepSelector gridGraph : ZFSet.{u}} - (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) - (hE0 : E0 ∈ M.sets) (hEnum : enumSelector ∈ M.sets) - (hPrep : prepSelector ∈ M.sets) (hGrid : gridGraph ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.fairPreparationTransition Q stages U E0 enumSelector prepSelector gridGraph ∈ M.sets := by - have states := M.fairPreparationStates_mem pairing unions powers separation hQ hStages hU hE0 hEnum omega - let params : Fin 7 → ZFSet.{u} := ![ZFSet.omega, E0, stages, U, enumSelector, prepSelector, gridGraph] - have ground : ∀ j, params j ∈ M.sets := Fin.cases omega (Fin.cases hE0 - (Fin.cases hStages (Fin.cases hU (Fin.cases hEnum (Fin.cases hPrep - (Fin.cases hGrid (fun j => Fin.elim0 j))))))) - let formula : BoundedFormula 8 := BoundedFormula.exPairFields 0 - (BoundedFormula.fairPreparationStepFormula 3 4 5 6 7 8 9 1 0) - have selected := M.bounded_separation_mem separation formula params ground - (M.prod_mem pairing unions powers separation states states) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) - (ZFSet.prod (M.fairPreparationStates Q stages U E0 enumSelector) - (M.fairPreparationStates Q stages U E0 enumSelector)) = - M.fairPreparationTransition Q stages U E0 enumSelector prepSelector gridGraph := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, fairPreparationTransition, ZFSet.mem_sep] - apply and_congr Iff.rfl - simp only [formula, BoundedFormula.truth_exPairFields, BoundedFormula.truth_fairPreparationStepFormula] - rfl - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -private theorem finiteHistory_bound (k : Nat) {E history : ZFSet.{u}} - (ground : history ∈ M.sets) (function : ZFSet.IsFunc (natSetCode k) E history) : - history ∈ M.groundRelations ZFSet.omega E := by - refine (M.mem_groundRelations _ _ _).2 ⟨ground, ?_⟩ - intro z member - obtain ⟨i, hi, e, he, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - obtain ⟨n, _, rfl⟩ := (mem_natSetCode i k).1 hi - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, he⟩ - -theorem exists_fairPreparation_initial - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (stages U : ZFSet.{u}) {Q E0 enumSelector p : ZFSet.{u}} - (hE0 : E0 ∈ M.sets) (enumerated : ZFSet.IsFunc Q E0 enumSelector) (member : p ∈ Q) : - ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ - ZFSet.pair ∅ (ZFSet.pair p (ZFSet.pair {ZFSet.pair ∅ e} ∅)) ∈ - M.fairPreparationStates Q stages U E0 enumSelector := by - obtain ⟨e, selected, _⟩ := enumerated.2 p member - have he := (ZFSet.pair_mem_prod.1 (enumerated.1 selected)).2 - have initial := finiteBirthHistory_initial he - have historyBound := M.finiteHistory_bound 1 - (M.finiteBirthHistory_initial_mem pairing (M.transitive hE0 he)) initial.1 - refine ⟨e, he, selected, (M.mem_fairPreparationStates _ _ _ _ _ _).2 ⟨?_, ?_⟩⟩ - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.omega_zero, ZFSet.pair_mem_prod.2 - ⟨member, ZFSet.pair_mem_prod.2 ⟨historyBound, ZFSet.mem_insert _ _⟩⟩⟩ - · exact ⟨∅, p, {ZFSet.pair ∅ e}, ∅, rfl, ZFSet.omega_zero, - ZFSet.omega_succ ZFSet.omega_zero, initial.1, e, he, selected, (initial.2 e).2 rfl⟩ - -theorem fairPreparationTransition_serial - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {Q stages U E0 enumSelector prepSelector : ZFSet.{u}} - (hE0 : E0 ∈ M.sets) - (enumerated : ZFSet.IsFunc Q E0 enumSelector) - (enumerationCases : ∀ e ∈ E0, e = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages e) - (prepared : ZFSet.IsFunc (ZFSet.prod stages Q) U prepSelector) - (outputs : ∀ y ∈ U, ∃ p ∈ Q, ∃ payload, y = ZFSet.pair p payload) : - let grid := natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv - ∀ state ∈ M.fairPreparationStates Q stages U E0 enumSelector, - ∃ next ∈ M.fairPreparationStates Q stages U E0 enumSelector, - ZFSet.pair state next ∈ - M.fairPreparationTransition Q stages U E0 enumSelector prepSelector grid := by - let grid : ZFSet.{u} := natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv - dsimp only - intro state member - obtain ⟨bound, n, p, births, last, rfl, hn, _hSucc, birthFunction, _current⟩ := - (M.mem_fairPreparationStates _ _ _ _ _ _).1 member - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have upperParts := (ZFSet.pair_mem_prod.1 bound).2 - have hp := (ZFSet.pair_mem_prod.1 upperParts).1 - have historyBound := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 upperParts).2).1 - have birthGround := ((M.mem_groundRelations _ _ _).1 historyBound).1 - change ZFSet.IsFunc (natSetCode (k + 1)) E0 births at birthFunction - obtain ⟨e, he, lookup, _⟩ := birthHistory_scheduled_lookup k birthFunction - have gridEntry : ZFSet.pair (natSetCode k) - (ZFSet.pair (natSetCode (Nat.unpair k).1) (natSetCode (Nat.unpair k).2)) ∈ grid := - (natPresentation.pair_mem_graph (natPresentation.product natPresentation) - omegaGridEquiv ⟨k⟩ (omegaGridEquiv ⟨k⟩)).2 rfl - have chooseNext : ∃ q ∈ Q, ∃ event ∈ insert ∅ (ZFSet.prod stages U), - ((e = ∅ ∧ q = p ∧ event = ∅) ∨ - (∃ alpha ∈ stages, ∃ y ∈ U, (∃ payload, y = ZFSet.pair q payload) ∧ - ZFSet.pair (natSetCode (Nat.unpair k).2) alpha ∈ e ∧ - ZFSet.pair (ZFSet.pair alpha p) y ∈ prepSelector ∧ event = ZFSet.pair alpha y)) := by - rcases enumerationCases e he with idle | active - · exact ⟨p, hp, ∅, ZFSet.mem_insert _ _, Or.inl ⟨idle, rfl, rfl⟩⟩ - · obtain ⟨alpha, level, _⟩ := active.2 _ (natSetCode_mem_omega (Nat.unpair k).2) - have hAlpha := (ZFSet.pair_mem_prod.1 (active.1 level)).2 - obtain ⟨y, selected, _⟩ := prepared.2 _ (ZFSet.pair_mem_prod.2 ⟨hAlpha, hp⟩) - have hy := (ZFSet.pair_mem_prod.1 (prepared.1 selected)).2 - obtain ⟨q, hq, payload, equal⟩ := outputs y hy - exact ⟨q, hq, ZFSet.pair alpha y, - ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.2 ⟨hAlpha, hy⟩), - Or.inr ⟨alpha, hAlpha, y, hy, ⟨payload, equal⟩, level, selected, rfl⟩⟩ - obtain ⟨q, hq, event, hEvent, branch⟩ := chooseNext - obtain ⟨newE, selected, _⟩ := enumerated.2 q hq - have hNewE := (ZFSet.pair_mem_prod.1 (enumerated.1 selected)).2 - let nextBirths := insert (ZFSet.pair (natSetCode (k + 1)) newE) births - have nextFunction := finiteBirthHistory_extend (k + 1) birthFunction hNewE - have nextGround := M.finiteBirthHistory_extend_mem pairing unions separation infinite - (k + 1) birthGround (M.transitive hE0 hNewE) - have nextBound := M.finiteHistory_bound (k + 1 + 1) nextGround nextFunction.1 - let next := ZFSet.pair (natSetCode (k + 1)) (ZFSet.pair q (ZFSet.pair nextBirths event)) - have nextMember : next ∈ M.fairPreparationStates Q stages U E0 enumSelector := by - apply (M.mem_fairPreparationStates _ _ _ _ _ _).2 - refine ⟨ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, - ZFSet.pair_mem_prod.2 ⟨hq, ZFSet.pair_mem_prod.2 ⟨nextBound, hEvent⟩⟩⟩, ?_⟩ - exact ⟨natSetCode (k + 1), q, nextBirths, event, rfl, natSetCode_mem_omega _, - ZFSet.omega_succ (natSetCode_mem_omega _), nextFunction.1, - newE, hNewE, selected, (nextFunction.2.2.2 newE).2 rfl⟩ - refine ⟨next, nextMember, (M.pair_mem_fairPreparationTransition _ _ _ _ _ _ _ _ _).2 - ⟨member, nextMember, ?_⟩⟩ - exact ⟨natSetCode k, p, births, last, natSetCode (k + 1), q, nextBirths, event, - rfl, rfl, rfl, natSetCode (Nat.unpair k).1, natSetCode_mem_omega _, - natSetCode (Nat.unpair k).2, natSetCode_mem_omega _, e, he, newE, hNewE, - gridEntry, lookup, selected, rfl, branch⟩ - - - - - -theorem exists_groundFairPreparationOrbit - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Q stages U E0 enumSelector prepSelector p : ZFSet.{u}} - (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) - (hE0 : E0 ∈ M.sets) (hEnum : enumSelector ∈ M.sets) (hPrep : prepSelector ∈ M.sets) - (enumerated : ZFSet.IsFunc Q E0 enumSelector) - (enumerationCases : ∀ e ∈ E0, e = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages e) - (prepared : ZFSet.IsFunc (ZFSet.prod stages Q) U prepSelector) - (outputs : ∀ y ∈ U, ∃ q ∈ Q, ∃ payload, y = ZFSet.pair q payload) - (member : p ∈ Q) : - let grid := natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv - let states := M.fairPreparationStates Q stages U E0 enumSelector - let transition := M.fairPreparationTransition Q stages U E0 enumSelector prepSelector grid - states ∈ M.sets ∧ transition ∈ M.sets ∧ - ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ ∃ orbit ∈ M.sets, - ZFSet.IsFunc ZFSet.omega states orbit ∧ - (∀ state, ZFSet.pair ∅ state ∈ orbit ↔ - state = ZFSet.pair ∅ (ZFSet.pair p (ZFSet.pair {ZFSet.pair ∅ e} ∅))) ∧ - ∀ n ∈ ZFSet.omega, ∀ state next, - ZFSet.pair n state ∈ orbit → ZFSet.pair (insert n n) next ∈ orbit → - ZFSet.pair state next ∈ transition ∧ - FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector grid state next := by - dsimp only - have omega := M.omega_mem separation infinite - have gridGround := M.omega_grid_equiv_graph_mem pairing unions powers separation infinite - have statesGround := M.fairPreparationStates_mem pairing unions powers separation - hQ hStages hU hE0 hEnum omega - have transitionGround := M.fairPreparationTransition_mem pairing unions powers separation - hQ hStages hU hE0 hEnum hPrep gridGround omega - obtain ⟨e, he, selected, initial⟩ := - M.exists_fairPreparation_initial pairing stages U hE0 enumerated member - have serial := M.fairPreparationTransition_serial pairing unions separation infinite - hE0 enumerated enumerationCases prepared outputs - obtain ⟨orbit, ground, function, start, steps⟩ := - M.exists_groundSerialOrbit pairing unions powers separation infinite choice - statesGround transitionGround initial serial - refine ⟨statesGround, transitionGround, e, he, selected, orbit, ground, function, start, ?_⟩ - intro n hn state next first second - have edge := steps n hn state next first second - exact ⟨edge, ((M.pair_mem_fairPreparationTransition _ _ _ _ _ _ _ _ _).1 edge).2.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) - -theorem varyingPreparationRelation_strengthens - (stages packed Q upperOrder nodes T alpha p r payload : ZFSet.{u}) - (entry : ZFSet.pair (ZFSet.pair alpha p) (ZFSet.pair r payload) ∈ - M.varyingPreparationRelation stages packed Q upperOrder nodes T) : - ZFSet.pair r p ∈ upperOrder := by - obtain ⟨_, _, _, fields, _, _, _, _, code⟩ := - (M.pair_mem_varyingPreparationRelation stages packed Q upperOrder nodes T - alpha p (ZFSet.pair r payload)).1 entry - obtain ⟨_row, _A, r', _k, _enumerations, _q, _input, output, below, _rest⟩ := code - obtain ⟨rfl, _⟩ := ZFSet.pair_inj.1 output - exact below - -theorem fairPreparationStep_strengthens - (omega E0 stages U enumSelector prepSelector gridGraph packed Q upperOrder nodes T : ZFSet.{u}) - (selected : prepSelector ⊆ M.varyingPreparationRelation stages packed Q upperOrder nodes T) - (n p births last m q nextBirths event : ZFSet.{u}) - (reflexive : ZFSet.pair p p ∈ upperOrder) - (step : FairPreparationStepCode omega E0 stages U enumSelector prepSelector gridGraph - (ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last))) - (ZFSet.pair m (ZFSet.pair q (ZFSet.pair nextBirths event)))) : - ZFSet.pair q p ∈ upperOrder := by - obtain ⟨n', p', births', last', m', q', nextBirths', event', first, second, - _clock, _i, _hi, _j, _hj, _e, _he, _newE, _hNewE, _grid, _lookup, - _newLookup, _append, action⟩ := step - have oldCondition : p = p' := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 first).2).1 - have newCondition : q = q' := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 second).2).1 - rw [oldCondition, newCondition] - rcases action with idle | ⟨alpha, _, y, _, ⟨payload, equal⟩, _, chosen, _⟩ - · rw [idle.2.1, ← oldCondition] - exact reflexive - · exact M.varyingPreparationRelation_strengthens stages packed Q upperOrder nodes T - alpha p' q' payload (equal ▸ selected chosen) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundVaryingPreparationRelations +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFiniteBirthHistories +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementBirthEnumerationFairness + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +def FairPreparationStateCode (omega E0 enumSelector state : ZFSet.{u}) : Prop := + ∃ n p births last, state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ + n ∈ omega ∧ insert n n ∈ omega ∧ ZFSet.IsFunc (insert n n) E0 births ∧ + ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ ZFSet.pair n e ∈ births + +namespace BoundedFormula +open SetFormula + +def exFairStateFields {n} (state : Fin n) (body : BoundedFormula (n + 4)) : BoundedFormula n := + exPairFields state (exPairFields 0 (exPairFields 0 + (reindex (Fin.cases 0 (Fin.cases 1 (Fin.cases 3 (Fin.cases 5 + (fun j => j.succ.succ.succ.succ.succ.succ))))) body))) + +theorem truth_exFairStateFields {n} (state : Fin n) (body : BoundedFormula (n + 4)) + (env : Fin n → ZFSet.{u}) : + Truth (exFairStateFields state body) env ↔ + ∃ n p births last, env state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ + Truth body (extend last (extend births (extend p (extend n env)))) := by + simp only [exFairStateFields, truth_exPairFields, truth_reindex] + have rearrange (n tail p inner births last : ZFSet.{u}) : + (fun i => extend last (extend births (extend inner (extend p (extend tail (extend n env))))) + (Fin.cases 0 (Fin.cases 1 (Fin.cases 3 (Fin.cases 5 + (fun j => j.succ.succ.succ.succ.succ.succ)))) i)) = + extend last (extend births (extend p (extend n env))) := by + funext i + refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => Fin.cases ?_ + (fun l => Fin.cases ?_ (fun m => ?_) l) k) j) i <;> rfl + simp only [rearrange] + constructor + · rintro ⟨n, tail, eq, p, inner, rfl, births, last, rfl, holds⟩ + exact ⟨n, p, births, last, eq, holds⟩ + · rintro ⟨n, p, births, last, eq, holds⟩ + exact ⟨n, _, eq, p, _, rfl, births, last, rfl, holds⟩ + +def fairPreparationStateFormula {n} (omega E0 enumSelector state : Fin n) : BoundedFormula n := + let old := fun j : Fin n => j.succ.succ.succ.succ + exFairStateFields state (.conj (.mem 3 (old omega)) + (exMem (old omega) (.conj (successorFormula 0 4) + (.conj (functionFormula 0 (old E0).succ 2) + (exMem (old E0).succ (.conj + (pairMembershipFormula 4 0 (old enumSelector).succ.succ) + (pairMembershipFormula 5 0 3))))))) + +theorem truth_fairPreparationStateFormula {n} (omega E0 enumSelector state : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (fairPreparationStateFormula omega E0 enumSelector state) env ↔ + FairPreparationStateCode (env omega) (env E0) (env enumSelector) (env state) := by + simp only [fairPreparationStateFormula, truth_exFairStateFields, Truth, truth_exMem, + truth_successorFormula, truth_functionFormula, truth_pairMembershipFormula] + change (∃ n p births last, env state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ + n ∈ env omega ∧ ∃ next ∈ env omega, next = insert n n ∧ + ZFSet.IsFunc next (env E0) births ∧ ∃ e ∈ env E0, + ZFSet.pair p e ∈ env enumSelector ∧ ZFSet.pair n e ∈ births) ↔ _ + constructor + · rintro ⟨n, p, births, last, shape, hn, next, hm, rfl, function, witness⟩ + exact ⟨n, p, births, last, shape, hn, hm, function, witness⟩ + · rintro ⟨n, p, births, last, shape, hn, hm, function, witness⟩ + exact ⟨n, p, births, last, shape, hn, insert n n, hm, rfl, function, witness⟩ + +end BoundedFormula + + + + + + +def FairPreparationStepCode + (omega E0 stages U enumSelector prepSelector gridGraph state next : ZFSet.{u}) : Prop := + ∃ n p births last m q nextBirths event, + state = ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last)) ∧ + next = ZFSet.pair m (ZFSet.pair q (ZFSet.pair nextBirths event)) ∧ + m = insert n n ∧ + ∃ i ∈ omega, ∃ j ∈ omega, ∃ e ∈ E0, ∃ newE ∈ E0, + ZFSet.pair n (ZFSet.pair i j) ∈ gridGraph ∧ + ZFSet.pair i e ∈ births ∧ ZFSet.pair q newE ∈ enumSelector ∧ + nextBirths = insert (ZFSet.pair m newE) births ∧ + ((e = ∅ ∧ q = p ∧ event = ∅) ∨ + (∃ alpha ∈ stages, ∃ y ∈ U, (∃ payload, y = ZFSet.pair q payload) ∧ + ZFSet.pair j alpha ∈ e ∧ ZFSet.pair (ZFSet.pair alpha p) y ∈ prepSelector ∧ + event = ZFSet.pair alpha y)) + +namespace BoundedFormula +open SetFormula + +private def insertPairFormula {n} (output graph x y : Fin n) : BoundedFormula n := + .conj (.allMem output (disj (.mem 0 graph.succ) (orderedPairFormula 0 x.succ y.succ))) + (.conj (subsetFormula graph output) (pairMembershipFormula x y output)) + +private theorem truth_insertPairFormula {n} (output graph x y : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (insertPairFormula output graph x y) env ↔ + env output = insert (ZFSet.pair (env x) (env y)) (env graph) := by + simp only [insertPairFormula, Truth, truth_disj, truth_orderedPairFormula, + truth_subsetFormula, truth_pairMembershipFormula] + constructor + · rintro ⟨inside, includes, entry⟩ + apply ZFSet.ext + intro z + rw [ZFSet.mem_insert_iff] + exact ⟨fun hz => (inside z hz).symm, + fun hz => hz.elim (fun eq => eq ▸ entry) (fun hz => includes hz)⟩ + · intro eq + rw [eq] + exact ⟨fun z hz => (ZFSet.mem_insert_iff.1 hz).symm, + fun _ hz => ZFSet.mem_insert_of_mem _ hz, ZFSet.mem_insert _ _⟩ + +private def activePreparationFormula {n} + (stages U e j p q event prepSelector : Fin n) : BoundedFormula n := + let old := fun i : Fin n => i.succ.succ.succ.succ + exMem stages (exMem U.succ (exPairFields 0 + (.conj (.equal 1 (old q)) + (.conj (pairMembershipFormula (old j) 3 (old e)) + (.conj (tripleMembershipFormula 3 (old p) 2 (old prepSelector)) + (orderedPairFormula (old event) 3 2)))))) + +private theorem truth_activePreparationFormula {n} + (stages U e j p q event prepSelector : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (activePreparationFormula stages U e j p q event prepSelector) env ↔ + ∃ alpha ∈ env stages, ∃ y ∈ env U, (∃ payload, y = ZFSet.pair (env q) payload) ∧ + ZFSet.pair (env j) alpha ∈ env e ∧ + ZFSet.pair (ZFSet.pair alpha (env p)) y ∈ env prepSelector ∧ + env event = ZFSet.pair alpha y := by + simp only [activePreparationFormula, truth_exMem, truth_exPairFields, Truth, + truth_pairMembershipFormula, truth_tripleMembershipFormula, truth_orderedPairFormula] + constructor + · rintro ⟨alpha, ha, y, hy, q', payload, shape, equal, entry, selected, eventEq⟩ + change q' = env q at equal + exact ⟨alpha, ha, y, hy, ⟨payload, equal ▸ shape⟩, entry, selected, eventEq⟩ + · rintro ⟨alpha, ha, y, hy, ⟨payload, shape⟩, entry, selected, eventEq⟩ + exact ⟨alpha, ha, y, hy, env q, payload, shape, rfl, entry, selected, eventEq⟩ + +private def fairStepFieldsFormula {arity} + (omega E0 stages U enumSelector prepSelector gridGraph n p births m q nextBirths event : Fin arity) : + BoundedFormula arity := + let old := fun i : Fin arity => i.succ.succ.succ.succ + .conj (successorFormula m n) + (exMem omega (exMem omega.succ (exMem E0.succ.succ (exMem E0.succ.succ.succ + (.conj (rightTripleMembershipFormula (old n) 3 2 (old gridGraph)) + (.conj (pairMembershipFormula 3 1 (old births)) + (.conj (pairMembershipFormula (old q) 0 (old enumSelector)) + (.conj (insertPairFormula (old nextBirths) (old births) (old m) 0) + (disj (.conj (emptyFormula 1) (.conj (.equal (old q) (old p)) (emptyFormula (old event)))) + (activePreparationFormula (old stages) (old U) 1 2 (old p) (old q) + (old event) (old prepSelector))))))))))) + +private theorem truth_fairStepFieldsFormula {arity} + (omega E0 stages U enumSelector prepSelector gridGraph n p births m q nextBirths event : Fin arity) + (env : Fin arity → ZFSet.{u}) : + Truth (fairStepFieldsFormula omega E0 stages U enumSelector prepSelector gridGraph + n p births m q nextBirths event) env ↔ + env m = insert (env n) (env n) ∧ + ∃ i ∈ env omega, ∃ j ∈ env omega, ∃ e ∈ env E0, ∃ newE ∈ env E0, + ZFSet.pair (env n) (ZFSet.pair i j) ∈ env gridGraph ∧ + ZFSet.pair i e ∈ env births ∧ ZFSet.pair (env q) newE ∈ env enumSelector ∧ + env nextBirths = insert (ZFSet.pair (env m) newE) (env births) ∧ + ((e = ∅ ∧ env q = env p ∧ env event = ∅) ∨ + (∃ alpha ∈ env stages, ∃ y ∈ env U, (∃ payload, y = ZFSet.pair (env q) payload) ∧ + ZFSet.pair j alpha ∈ e ∧ ZFSet.pair (ZFSet.pair alpha (env p)) y ∈ env prepSelector ∧ + env event = ZFSet.pair alpha y)) := by + simp only [fairStepFieldsFormula, Truth, truth_successorFormula, truth_exMem, + truth_rightTripleMembershipFormula, truth_pairMembershipFormula, truth_insertPairFormula, + truth_disj, truth_emptyFormula, truth_activePreparationFormula] + rfl + +def fairPreparationStepFormula {n} + (omega E0 stages U enumSelector prepSelector gridGraph state next : Fin n) : BoundedFormula n := + let old := fun i : Fin n => i.succ.succ.succ.succ.succ.succ.succ.succ + exFairStateFields state (exFairStateFields next.succ.succ.succ.succ + (fairStepFieldsFormula (old omega) (old E0) (old stages) (old U) (old enumSelector) + (old prepSelector) (old gridGraph) 7 6 5 3 2 1 0)) + +theorem truth_fairPreparationStepFormula {n} + (omega E0 stages U enumSelector prepSelector gridGraph state next : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (fairPreparationStepFormula omega E0 stages U enumSelector prepSelector gridGraph state next) env ↔ + FairPreparationStepCode (env omega) (env E0) (env stages) (env U) (env enumSelector) + (env prepSelector) (env gridGraph) (env state) (env next) := by + simp only [fairPreparationStepFormula, truth_exFairStateFields, truth_fairStepFieldsFormula] + constructor + · rintro ⟨n, p, births, last, shape, m, q, nextBirths, event, nextShape, rest⟩ + exact ⟨n, p, births, last, m, q, nextBirths, event, shape, nextShape, rest⟩ + · rintro ⟨n, p, births, last, m, q, nextBirths, event, shape, nextShape, rest⟩ + exact ⟨n, p, births, last, shape, m, q, nextBirths, event, nextShape, rest⟩ + +end BoundedFormula + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def fairPreparationStates (Q stages U E0 enumSelector : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (FairPreparationStateCode ZFSet.omega E0 enumSelector) + (ZFSet.prod ZFSet.omega (ZFSet.prod Q + (ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U))))) + +theorem mem_fairPreparationStates (Q stages U E0 enumSelector state : ZFSet.{u}) : + state ∈ M.fairPreparationStates Q stages U E0 enumSelector ↔ + state ∈ ZFSet.prod ZFSet.omega (ZFSet.prod Q + (ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U)))) ∧ + FairPreparationStateCode ZFSet.omega E0 enumSelector state := ZFSet.mem_sep + +noncomputable def fairPreparationTransition + (Q stages U E0 enumSelector prepSelector gridGraph : ZFSet.{u}) : ZFSet.{u} := + let states := M.fairPreparationStates Q stages U E0 enumSelector + ZFSet.sep (fun z => ∃ state next, z = ZFSet.pair state next ∧ + FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector gridGraph state next) + (ZFSet.prod states states) + +theorem pair_mem_fairPreparationTransition + (Q stages U E0 enumSelector prepSelector gridGraph state next : ZFSet.{u}) : + ZFSet.pair state next ∈ M.fairPreparationTransition Q stages U E0 enumSelector prepSelector gridGraph ↔ + state ∈ M.fairPreparationStates Q stages U E0 enumSelector ∧ + next ∈ M.fairPreparationStates Q stages U E0 enumSelector ∧ + FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector gridGraph state next := by + rw [fairPreparationTransition, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hs, hn⟩, state', next', eq, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hs, hn, code⟩ + · rintro ⟨hs, hn, code⟩ + exact ⟨⟨hs, hn⟩, state, next, rfl, code⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +include pairing unions powers separation in +theorem fairPreparationStates_mem + {Q stages U E0 enumSelector : ZFSet.{u}} + (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) + (hE0 : E0 ∈ M.sets) (hEnum : enumSelector ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.fairPreparationStates Q stages U E0 enumSelector ∈ M.sets := by + have history := M.groundRelations_mem pairing unions powers separation omega hE0 + have events := M.insert_mem pairing unions (M.empty_mem ⟨Q, hQ⟩) + (M.prod_mem pairing unions powers separation hStages hU) + have bound := M.prod_mem pairing unions powers separation omega + (M.prod_mem pairing unions powers separation hQ + (M.prod_mem pairing unions powers separation history events)) + let params : Fin 3 → ZFSet.{u} := ![ZFSet.omega, E0, enumSelector] + have ground : ∀ j, params j ∈ M.sets := Fin.cases omega + (Fin.cases hE0 (Fin.cases hEnum (fun j => Fin.elim0 j))) + let formula : BoundedFormula 4 := BoundedFormula.fairPreparationStateFormula 1 2 3 0 + have selected := M.bounded_separation_mem separation formula params ground bound + have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) + (ZFSet.prod ZFSet.omega (ZFSet.prod Q + (ZFSet.prod (M.groundRelations ZFSet.omega E0) (insert ∅ (ZFSet.prod stages U))))) = + M.fairPreparationStates Q stages U E0 enumSelector := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, fairPreparationStates, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_fairPreparationStateFormula 1 2 3 0 _) + exact equal ▸ selected + +include pairing unions powers separation in +theorem fairPreparationTransition_mem + {Q stages U E0 enumSelector prepSelector gridGraph : ZFSet.{u}} + (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) + (hE0 : E0 ∈ M.sets) (hEnum : enumSelector ∈ M.sets) + (hPrep : prepSelector ∈ M.sets) (hGrid : gridGraph ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.fairPreparationTransition Q stages U E0 enumSelector prepSelector gridGraph ∈ M.sets := by + have states := M.fairPreparationStates_mem pairing unions powers separation hQ hStages hU hE0 hEnum omega + let params : Fin 7 → ZFSet.{u} := ![ZFSet.omega, E0, stages, U, enumSelector, prepSelector, gridGraph] + have ground : ∀ j, params j ∈ M.sets := Fin.cases omega (Fin.cases hE0 + (Fin.cases hStages (Fin.cases hU (Fin.cases hEnum (Fin.cases hPrep + (Fin.cases hGrid (fun j => Fin.elim0 j))))))) + let formula : BoundedFormula 8 := BoundedFormula.exPairFields 0 + (BoundedFormula.fairPreparationStepFormula 3 4 5 6 7 8 9 1 0) + have selected := M.bounded_separation_mem separation formula params ground + (M.prod_mem pairing unions powers separation states states) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth formula (extend z params)) + (ZFSet.prod (M.fairPreparationStates Q stages U E0 enumSelector) + (M.fairPreparationStates Q stages U E0 enumSelector)) = + M.fairPreparationTransition Q stages U E0 enumSelector prepSelector gridGraph := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, fairPreparationTransition, ZFSet.mem_sep] + apply and_congr Iff.rfl + simp only [formula, BoundedFormula.truth_exPairFields, BoundedFormula.truth_fairPreparationStepFormula] + rfl + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +private theorem finiteHistory_bound (k : Nat) {E history : ZFSet.{u}} + (ground : history ∈ M.sets) (function : ZFSet.IsFunc (natSetCode k) E history) : + history ∈ M.groundRelations ZFSet.omega E := by + refine (M.mem_groundRelations _ _ _).2 ⟨ground, ?_⟩ + intro z member + obtain ⟨i, hi, e, he, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + obtain ⟨n, _, rfl⟩ := (mem_natSetCode i k).1 hi + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, he⟩ + +theorem exists_fairPreparation_initial + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (stages U : ZFSet.{u}) {Q E0 enumSelector p : ZFSet.{u}} + (hE0 : E0 ∈ M.sets) (enumerated : ZFSet.IsFunc Q E0 enumSelector) (member : p ∈ Q) : + ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ + ZFSet.pair ∅ (ZFSet.pair p (ZFSet.pair {ZFSet.pair ∅ e} ∅)) ∈ + M.fairPreparationStates Q stages U E0 enumSelector := by + obtain ⟨e, selected, _⟩ := enumerated.2 p member + have he := (ZFSet.pair_mem_prod.1 (enumerated.1 selected)).2 + have initial := finiteBirthHistory_initial he + have historyBound := M.finiteHistory_bound 1 + (M.finiteBirthHistory_initial_mem pairing (M.transitive hE0 he)) initial.1 + refine ⟨e, he, selected, (M.mem_fairPreparationStates _ _ _ _ _ _).2 ⟨?_, ?_⟩⟩ + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.omega_zero, ZFSet.pair_mem_prod.2 + ⟨member, ZFSet.pair_mem_prod.2 ⟨historyBound, ZFSet.mem_insert _ _⟩⟩⟩ + · exact ⟨∅, p, {ZFSet.pair ∅ e}, ∅, rfl, ZFSet.omega_zero, + ZFSet.omega_succ ZFSet.omega_zero, initial.1, e, he, selected, (initial.2 e).2 rfl⟩ + +theorem fairPreparationTransition_serial + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {Q stages U E0 enumSelector prepSelector : ZFSet.{u}} + (hE0 : E0 ∈ M.sets) + (enumerated : ZFSet.IsFunc Q E0 enumSelector) + (enumerationCases : ∀ e ∈ E0, e = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages e) + (prepared : ZFSet.IsFunc (ZFSet.prod stages Q) U prepSelector) + (outputs : ∀ y ∈ U, ∃ p ∈ Q, ∃ payload, y = ZFSet.pair p payload) : + let grid := natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv + ∀ state ∈ M.fairPreparationStates Q stages U E0 enumSelector, + ∃ next ∈ M.fairPreparationStates Q stages U E0 enumSelector, + ZFSet.pair state next ∈ + M.fairPreparationTransition Q stages U E0 enumSelector prepSelector grid := by + let grid : ZFSet.{u} := natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv + dsimp only + intro state member + obtain ⟨bound, n, p, births, last, rfl, hn, _hSucc, birthFunction, _current⟩ := + (M.mem_fairPreparationStates _ _ _ _ _ _).1 member + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have upperParts := (ZFSet.pair_mem_prod.1 bound).2 + have hp := (ZFSet.pair_mem_prod.1 upperParts).1 + have historyBound := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 upperParts).2).1 + have birthGround := ((M.mem_groundRelations _ _ _).1 historyBound).1 + change ZFSet.IsFunc (natSetCode (k + 1)) E0 births at birthFunction + obtain ⟨e, he, lookup, _⟩ := birthHistory_scheduled_lookup k birthFunction + have gridEntry : ZFSet.pair (natSetCode k) + (ZFSet.pair (natSetCode (Nat.unpair k).1) (natSetCode (Nat.unpair k).2)) ∈ grid := + (natPresentation.pair_mem_graph (natPresentation.product natPresentation) + omegaGridEquiv ⟨k⟩ (omegaGridEquiv ⟨k⟩)).2 rfl + have chooseNext : ∃ q ∈ Q, ∃ event ∈ insert ∅ (ZFSet.prod stages U), + ((e = ∅ ∧ q = p ∧ event = ∅) ∨ + (∃ alpha ∈ stages, ∃ y ∈ U, (∃ payload, y = ZFSet.pair q payload) ∧ + ZFSet.pair (natSetCode (Nat.unpair k).2) alpha ∈ e ∧ + ZFSet.pair (ZFSet.pair alpha p) y ∈ prepSelector ∧ event = ZFSet.pair alpha y)) := by + rcases enumerationCases e he with idle | active + · exact ⟨p, hp, ∅, ZFSet.mem_insert _ _, Or.inl ⟨idle, rfl, rfl⟩⟩ + · obtain ⟨alpha, level, _⟩ := active.2 _ (natSetCode_mem_omega (Nat.unpair k).2) + have hAlpha := (ZFSet.pair_mem_prod.1 (active.1 level)).2 + obtain ⟨y, selected, _⟩ := prepared.2 _ (ZFSet.pair_mem_prod.2 ⟨hAlpha, hp⟩) + have hy := (ZFSet.pair_mem_prod.1 (prepared.1 selected)).2 + obtain ⟨q, hq, payload, equal⟩ := outputs y hy + exact ⟨q, hq, ZFSet.pair alpha y, + ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.2 ⟨hAlpha, hy⟩), + Or.inr ⟨alpha, hAlpha, y, hy, ⟨payload, equal⟩, level, selected, rfl⟩⟩ + obtain ⟨q, hq, event, hEvent, branch⟩ := chooseNext + obtain ⟨newE, selected, _⟩ := enumerated.2 q hq + have hNewE := (ZFSet.pair_mem_prod.1 (enumerated.1 selected)).2 + let nextBirths := insert (ZFSet.pair (natSetCode (k + 1)) newE) births + have nextFunction := finiteBirthHistory_extend (k + 1) birthFunction hNewE + have nextGround := M.finiteBirthHistory_extend_mem pairing unions separation infinite + (k + 1) birthGround (M.transitive hE0 hNewE) + have nextBound := M.finiteHistory_bound (k + 1 + 1) nextGround nextFunction.1 + let next := ZFSet.pair (natSetCode (k + 1)) (ZFSet.pair q (ZFSet.pair nextBirths event)) + have nextMember : next ∈ M.fairPreparationStates Q stages U E0 enumSelector := by + apply (M.mem_fairPreparationStates _ _ _ _ _ _).2 + refine ⟨ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega _, + ZFSet.pair_mem_prod.2 ⟨hq, ZFSet.pair_mem_prod.2 ⟨nextBound, hEvent⟩⟩⟩, ?_⟩ + exact ⟨natSetCode (k + 1), q, nextBirths, event, rfl, natSetCode_mem_omega _, + ZFSet.omega_succ (natSetCode_mem_omega _), nextFunction.1, + newE, hNewE, selected, (nextFunction.2.2.2 newE).2 rfl⟩ + refine ⟨next, nextMember, (M.pair_mem_fairPreparationTransition _ _ _ _ _ _ _ _ _).2 + ⟨member, nextMember, ?_⟩⟩ + exact ⟨natSetCode k, p, births, last, natSetCode (k + 1), q, nextBirths, event, + rfl, rfl, rfl, natSetCode (Nat.unpair k).1, natSetCode_mem_omega _, + natSetCode (Nat.unpair k).2, natSetCode_mem_omega _, e, he, newE, hNewE, + gridEntry, lookup, selected, rfl, branch⟩ + + + + + +theorem exists_groundFairPreparationOrbit + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Q stages U E0 enumSelector prepSelector p : ZFSet.{u}} + (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) (hU : U ∈ M.sets) + (hE0 : E0 ∈ M.sets) (hEnum : enumSelector ∈ M.sets) (hPrep : prepSelector ∈ M.sets) + (enumerated : ZFSet.IsFunc Q E0 enumSelector) + (enumerationCases : ∀ e ∈ E0, e = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages e) + (prepared : ZFSet.IsFunc (ZFSet.prod stages Q) U prepSelector) + (outputs : ∀ y ∈ U, ∃ q ∈ Q, ∃ payload, y = ZFSet.pair q payload) + (member : p ∈ Q) : + let grid := natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv + let states := M.fairPreparationStates Q stages U E0 enumSelector + let transition := M.fairPreparationTransition Q stages U E0 enumSelector prepSelector grid + states ∈ M.sets ∧ transition ∈ M.sets ∧ + ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ ∃ orbit ∈ M.sets, + ZFSet.IsFunc ZFSet.omega states orbit ∧ + (∀ state, ZFSet.pair ∅ state ∈ orbit ↔ + state = ZFSet.pair ∅ (ZFSet.pair p (ZFSet.pair {ZFSet.pair ∅ e} ∅))) ∧ + ∀ n ∈ ZFSet.omega, ∀ state next, + ZFSet.pair n state ∈ orbit → ZFSet.pair (insert n n) next ∈ orbit → + ZFSet.pair state next ∈ transition ∧ + FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector grid state next := by + dsimp only + have omega := M.omega_mem separation infinite + have gridGround := M.omega_grid_equiv_graph_mem pairing unions powers separation infinite + have statesGround := M.fairPreparationStates_mem pairing unions powers separation + hQ hStages hU hE0 hEnum omega + have transitionGround := M.fairPreparationTransition_mem pairing unions powers separation + hQ hStages hU hE0 hEnum hPrep gridGround omega + obtain ⟨e, he, selected, initial⟩ := + M.exists_fairPreparation_initial pairing stages U hE0 enumerated member + have serial := M.fairPreparationTransition_serial pairing unions separation infinite + hE0 enumerated enumerationCases prepared outputs + obtain ⟨orbit, ground, function, start, steps⟩ := + M.exists_groundSerialOrbit pairing unions powers separation infinite choice + statesGround transitionGround initial serial + refine ⟨statesGround, transitionGround, e, he, selected, orbit, ground, function, start, ?_⟩ + intro n hn state next first second + have edge := steps n hn state next first second + exact ⟨edge, ((M.pair_mem_fairPreparationTransition _ _ _ _ _ _ _ _ _).1 edge).2.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) + +theorem varyingPreparationRelation_strengthens + (stages packed Q upperOrder nodes T alpha p r payload : ZFSet.{u}) + (entry : ZFSet.pair (ZFSet.pair alpha p) (ZFSet.pair r payload) ∈ + M.varyingPreparationRelation stages packed Q upperOrder nodes T) : + ZFSet.pair r p ∈ upperOrder := by + obtain ⟨_, _, _, fields, _, _, _, _, code⟩ := + (M.pair_mem_varyingPreparationRelation stages packed Q upperOrder nodes T + alpha p (ZFSet.pair r payload)).1 entry + obtain ⟨_row, _A, r', _k, _enumerations, _q, _input, output, below, _rest⟩ := code + obtain ⟨rfl, _⟩ := ZFSet.pair_inj.1 output + exact below + +theorem fairPreparationStep_strengthens + (omega E0 stages U enumSelector prepSelector gridGraph packed Q upperOrder nodes T : ZFSet.{u}) + (selected : prepSelector ⊆ M.varyingPreparationRelation stages packed Q upperOrder nodes T) + (n p births last m q nextBirths event : ZFSet.{u}) + (reflexive : ZFSet.pair p p ∈ upperOrder) + (step : FairPreparationStepCode omega E0 stages U enumSelector prepSelector gridGraph + (ZFSet.pair n (ZFSet.pair p (ZFSet.pair births last))) + (ZFSet.pair m (ZFSet.pair q (ZFSet.pair nextBirths event)))) : + ZFSet.pair q p ∈ upperOrder := by + obtain ⟨n', p', births', last', m', q', nextBirths', event', first, second, + _clock, _i, _hi, _j, _hj, _e, _he, _newE, _hNewE, _grid, _lookup, + _newLookup, _append, action⟩ := step + have oldCondition : p = p' := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 first).2).1 + have newCondition : q = q' := (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 second).2).1 + rw [oldCondition, newCondition] + rcases action with idle | ⟨alpha, _, y, _, ⟨payload, equal⟩, _, chosen, _⟩ + · rw [idle.2.1, ← oldCondition] + exact reflexive + · exact M.varyingPreparationRelation_strengthens stages packed Q upperOrder nodes T + alpha p' q' payload (equal ▸ selected chosen) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairRefinementAssignmentVisits.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairRefinementAssignmentVisits.lean index 09e89dc5d852865d0cbf161df75ac2a3b0e201a9..3b9dc79e7f084ee4887cc4e2c435078fb97d9fb0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairRefinementAssignmentVisits.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFairRefinementAssignmentVisits.lean @@ -1,196 +1,196 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCarrierSequences -import OAI.SetTheory.PartitionPrinciple.Transfinite.FairPreparationBirthPersistence -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection - -namespace OAI - -namespace PartitionPilot.Forcing -universe u - -theorem fairPreparation_scheduledActiveEvent - {Q E0 stages U enumSelector prepSelector : ZFSet.{u}} - (function : ZFSet.IsFunc Q E0 enumSelector) - (clocks conditions births events enumerations : Nat → ZFSet.{u}) - (enumerationCases : ∀ k, enumerations k = ∅ ∨ - ZFSet.IsFunc ZFSet.omega stages (enumerations k)) - (chosen : ∀ k, ZFSet.pair (conditions k) (enumerations k) ∈ enumSelector) - (initialClock : clocks 0 = ∅) - (initialBirths : births 0 = {ZFSet.pair ∅ (enumerations 0)}) - (steps : ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U - enumSelector prepSelector - (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) - (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) (ZFSet.pair (births k) (events k)))) - (ZFSet.pair (clocks (k + 1)) - (ZFSet.pair (conditions (k + 1)) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) - (i j : Nat) (alpha : ZFSet.{u}) - (entry : ZFSet.pair (natSetCode j) alpha ∈ enumerations i) : - ∃ y ∈ U, - (∃ payload, y = ZFSet.pair (conditions (Nat.pair i j + 1)) payload) ∧ - ZFSet.pair (ZFSet.pair alpha (conditions (Nat.pair i j))) y ∈ prepSelector ∧ - events (Nat.pair i j + 1) = ZFSet.pair alpha y := by - have persistent := fairPreparation_birthPersistence function clocks conditions births events - enumerations chosen initialClock initialBirths steps (Nat.pair i j) - obtain ⟨n, p, b, last, m, q, nextBirths, event, source, target, _next, - oldI, _hi, oldJ, _hj, e, _he, newE, _hNew, grid, old, _selected, _append, branch⟩ := - steps (Nat.pair i j) - obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 source - obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 target - obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - rw [persistent.1] at grid - have exactGrid : ZFSet.pair (natSetCode (Nat.pair i j)) - (ZFSet.pair (natSetCode i) (natSetCode j)) ∈ - natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv := by - have edge : ZFSet.pair (natSetCode (Nat.pair i j)) - (ZFSet.pair (natSetCode (Nat.unpair (Nat.pair i j)).1) - (natSetCode (Nat.unpair (Nat.pair i j)).2)) ∈ - natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv := - (natPresentation.pair_mem_graph (natPresentation.product natPresentation) - omegaGridEquiv ⟨Nat.pair i j⟩ (omegaGridEquiv ⟨Nat.pair i j⟩)).2 rfl - simpa only [Nat.unpair_pair] using edge - have gridFunction := natPresentation.graph_isFunc - (natPresentation.product natPresentation) omegaGridEquiv - obtain ⟨_, _, gridUnique⟩ := gridFunction.2 _ (natSetCode_mem_omega (Nat.pair i j)) - have sameGrid := (gridUnique _ grid).trans (gridUnique _ exactGrid).symm - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 sameGrid - have sameEnumeration := ((persistent.2.2.1 i e).1 old).2 - subst e - have nonempty : enumerations i ≠ ∅ := by - intro empty - exact ZFSet.notMem_empty _ (empty ▸ entry) - rcases branch with idle | active - · exact False.elim (nonempty idle.1) - · obtain ⟨level, _hLevel, y, hy, shape, levelEntry, prepared, recorded⟩ := active - have enumFunction := (enumerationCases i).resolve_left nonempty - obtain ⟨_, _, unique⟩ := enumFunction.2 _ (natSetCode_mem_omega j) - have sameLevel := (unique _ levelEntry).trans (unique _ entry).symm - subst level - exact ⟨y, hy, shape, prepared, recorded⟩ - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] -variable (c : Presentation R) (T stages history : ZFSet.{u}) -local notation "Q" => M.refinementHistoryForcing c.carrier T stages history -local notation "B" => M.groundSmallSubsets - (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega -local notation "shape" => M.refinementHistoryForcing_shape c.carrier T stages history -local notation "data" => flatCarrierData c Q B shape - -theorem refinementHistorySequence_assignment_mono : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - ∀ seq : Nat → SetMembers Q, Antitone seq → - ∀ i k, i ≤ k → SetMembers.raw (data (seq i)) ⊆ SetMembers.raw (data (seq k)) := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - intro seq decreasing i k before - have below := decreasing before - change ZFSet.pair (SetMembers.raw (seq k)) (SetMembers.raw (seq i)) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder T stages history at below - rw [flatCarrier_coordinates c Q B shape (seq k), flatCarrier_coordinates c Q B shape (seq i)] at below - exact ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages history - _ _ _ _).1 below).2.2.2 - -theorem refinementHistorySequence_assignment_visit - (valid : RefinementDataHistory stages history T) : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - ∀ seq : Nat → SetMembers Q, Antitone seq → ∀ enumerations : Nat → ZFSet.{u}, - (∀ i, BirthLevelEnumerationCode ZFSet.omega stages (SetMembers.raw (data (seq i))) - (refinementDataHistoryLevels stages history T) (enumerations i)) → - ∀ x ∈ stageOneAssignmentUnion (fun i => SetMembers.raw (data (seq i))), - ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ - x ∈ SetMembers.raw (data (seq i)) ∧ - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ - ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ - alpha ∈ relationImage (SetMembers.raw (data (seq i))) stages - (refinementDataHistoryLevels stages history T) ∧ - ZFSet.pair (natSetCode j) alpha ∈ enumerations i ∧ - ∀ k, Nat.pair i j ≤ k → - x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k))) := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - intro seq decreasing enumerations coded x member - have bounded : ∀ i, SetMembers.raw (data (seq i)) ⊆ - stageOneAssignments (refinementDataHistoryIndices stages history) T := by - intro i - exact ((M.mem_groundSmallSubsets _ _ _).1 (SetMembers.raw_mem (data (seq i)))).2.1 - exact valid.birthEnumeration_assignment_visit (fun i => SetMembers.raw (data (seq i))) enumerations - bounded (M.refinementHistorySequence_assignment_mono c T stages history seq decreasing) coded member - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] -variable (c : Presentation R) (T stages history : ZFSet.{u}) -local notation "Q" => M.refinementHistoryForcing c.carrier T stages history -local notation "B" => M.groundSmallSubsets - (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega -local notation "shape" => M.refinementHistoryForcing_shape c.carrier T stages history -local notation "data" => flatCarrierData c Q B shape - -theorem fairRefinementSequence_assignment_prepared - (valid : RefinementDataHistory stages history T) - {E0 U enumSelector prepSelector : ZFSet.{u}} - (function : ZFSet.IsFunc Q E0 enumSelector) - (selected : enumSelector ⊆ M.birthLevelEnumerationRelation Q stages - (refinementDataHistoryLevels stages history T)) : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - ∀ (seq : Nat → SetMembers Q), Antitone seq → - ∀ (clocks births events : Nat → ZFSet.{u}) (initialE : ZFSet.{u}), - ZFSet.pair (SetMembers.raw (seq 0)) initialE ∈ enumSelector → - clocks 0 = ∅ → births 0 = {ZFSet.pair ∅ initialE} → - (∀ k, FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector - (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) - (ZFSet.pair (clocks k) (ZFSet.pair (SetMembers.raw (seq k)) - (ZFSet.pair (births k) (events k)))) - (ZFSet.pair (clocks (k + 1)) (ZFSet.pair (SetMembers.raw (seq (k + 1))) - (ZFSet.pair (births (k + 1)) (events (k + 1)))))) → - ∀ x ∈ stageOneAssignmentUnion (fun i => SetMembers.raw (data (seq i))), - ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ - x ∈ SetMembers.raw (data (seq i)) ∧ - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ - ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ - (∀ k, Nat.pair i j ≤ k → - x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k)))) ∧ - ∃ y ∈ U, ∃ payload, - y = ZFSet.pair (SetMembers.raw (seq (Nat.pair i j + 1))) payload ∧ - ZFSet.pair (ZFSet.pair alpha (SetMembers.raw (seq (Nat.pair i j)))) y ∈ prepSelector ∧ - events (Nat.pair i j + 1) = ZFSet.pair alpha y := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - intro seq decreasing clocks births events initialE initialChosen initialClock initialBirths steps x member - have available (k : Nat) : ∃ e, ZFSet.pair (SetMembers.raw (seq k)) e ∈ enumSelector := by - obtain ⟨e, edge, _⟩ := function.2 _ (SetMembers.raw_mem (seq k)) - exact ⟨e, edge⟩ - choose enumerations chosen using available - have codes (k : Nat) : BirthLevelEnumerationCode ZFSet.omega stages - (SetMembers.raw (data (seq k))) (refinementDataHistoryLevels stages history T) (enumerations k) := by - have entry := selected (chosen k) - rw [flatCarrier_coordinates c Q B shape (seq k)] at entry - exact ((M.pair_mem_birthLevelEnumerationRelation _ _ _ _ _ _).1 entry).2.2 - have enumerationCases (k : Nat) : enumerations k = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages (enumerations k) := - (codes k).elim (fun idle => Or.inl idle.2) (fun active => Or.inr active.1) - have initialSame : initialE = enumerations 0 := by - obtain ⟨_, _, unique⟩ := function.2 _ (SetMembers.raw_mem (seq 0)) - exact (unique _ initialChosen).trans (unique _ (chosen 0)).symm - have initialTable : births 0 = {ZFSet.pair ∅ (enumerations 0)} := by - rw [← initialSame] - exact initialBirths - obtain ⟨i, j, alpha, hAlpha, fields, grid, before, born, stored, level, _attained, enumerated, retained⟩ := - M.refinementHistorySequence_assignment_visit c T stages history valid seq decreasing - enumerations codes x member - obtain ⟨y, hy, ⟨payload, output⟩, edge, event⟩ := - fairPreparation_scheduledActiveEvent function clocks (fun k => SetMembers.raw (seq k)) births events - enumerations enumerationCases chosen initialClock initialTable steps i j alpha enumerated - exact ⟨i, j, alpha, hAlpha, fields, grid, before, born, stored, level, retained, - y, hy, payload, output, edge, event⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCarrierSequences +import OAI.SetTheory.PartitionPrinciple.Transfinite.FairPreparationBirthPersistence +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection + +namespace OAI + +namespace PartitionPilot.Forcing +universe u + +theorem fairPreparation_scheduledActiveEvent + {Q E0 stages U enumSelector prepSelector : ZFSet.{u}} + (function : ZFSet.IsFunc Q E0 enumSelector) + (clocks conditions births events enumerations : Nat → ZFSet.{u}) + (enumerationCases : ∀ k, enumerations k = ∅ ∨ + ZFSet.IsFunc ZFSet.omega stages (enumerations k)) + (chosen : ∀ k, ZFSet.pair (conditions k) (enumerations k) ∈ enumSelector) + (initialClock : clocks 0 = ∅) + (initialBirths : births 0 = {ZFSet.pair ∅ (enumerations 0)}) + (steps : ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U + enumSelector prepSelector + (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) + (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) (ZFSet.pair (births k) (events k)))) + (ZFSet.pair (clocks (k + 1)) + (ZFSet.pair (conditions (k + 1)) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) + (i j : Nat) (alpha : ZFSet.{u}) + (entry : ZFSet.pair (natSetCode j) alpha ∈ enumerations i) : + ∃ y ∈ U, + (∃ payload, y = ZFSet.pair (conditions (Nat.pair i j + 1)) payload) ∧ + ZFSet.pair (ZFSet.pair alpha (conditions (Nat.pair i j))) y ∈ prepSelector ∧ + events (Nat.pair i j + 1) = ZFSet.pair alpha y := by + have persistent := fairPreparation_birthPersistence function clocks conditions births events + enumerations chosen initialClock initialBirths steps (Nat.pair i j) + obtain ⟨n, p, b, last, m, q, nextBirths, event, source, target, _next, + oldI, _hi, oldJ, _hj, e, _he, newE, _hNew, grid, old, _selected, _append, branch⟩ := + steps (Nat.pair i j) + obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 source + obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 target + obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + rw [persistent.1] at grid + have exactGrid : ZFSet.pair (natSetCode (Nat.pair i j)) + (ZFSet.pair (natSetCode i) (natSetCode j)) ∈ + natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv := by + have edge : ZFSet.pair (natSetCode (Nat.pair i j)) + (ZFSet.pair (natSetCode (Nat.unpair (Nat.pair i j)).1) + (natSetCode (Nat.unpair (Nat.pair i j)).2)) ∈ + natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv := + (natPresentation.pair_mem_graph (natPresentation.product natPresentation) + omegaGridEquiv ⟨Nat.pair i j⟩ (omegaGridEquiv ⟨Nat.pair i j⟩)).2 rfl + simpa only [Nat.unpair_pair] using edge + have gridFunction := natPresentation.graph_isFunc + (natPresentation.product natPresentation) omegaGridEquiv + obtain ⟨_, _, gridUnique⟩ := gridFunction.2 _ (natSetCode_mem_omega (Nat.pair i j)) + have sameGrid := (gridUnique _ grid).trans (gridUnique _ exactGrid).symm + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 sameGrid + have sameEnumeration := ((persistent.2.2.1 i e).1 old).2 + subst e + have nonempty : enumerations i ≠ ∅ := by + intro empty + exact ZFSet.notMem_empty _ (empty ▸ entry) + rcases branch with idle | active + · exact False.elim (nonempty idle.1) + · obtain ⟨level, _hLevel, y, hy, shape, levelEntry, prepared, recorded⟩ := active + have enumFunction := (enumerationCases i).resolve_left nonempty + obtain ⟨_, _, unique⟩ := enumFunction.2 _ (natSetCode_mem_omega j) + have sameLevel := (unique _ levelEntry).trans (unique _ entry).symm + subst level + exact ⟨y, hy, shape, prepared, recorded⟩ + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] +variable (c : Presentation R) (T stages history : ZFSet.{u}) +local notation "Q" => M.refinementHistoryForcing c.carrier T stages history +local notation "B" => M.groundSmallSubsets + (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega +local notation "shape" => M.refinementHistoryForcing_shape c.carrier T stages history +local notation "data" => flatCarrierData c Q B shape + +theorem refinementHistorySequence_assignment_mono : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + ∀ seq : Nat → SetMembers Q, Antitone seq → + ∀ i k, i ≤ k → SetMembers.raw (data (seq i)) ⊆ SetMembers.raw (data (seq k)) := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + intro seq decreasing i k before + have below := decreasing before + change ZFSet.pair (SetMembers.raw (seq k)) (SetMembers.raw (seq i)) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder T stages history at below + rw [flatCarrier_coordinates c Q B shape (seq k), flatCarrier_coordinates c Q B shape (seq i)] at below + exact ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages history + _ _ _ _).1 below).2.2.2 + +theorem refinementHistorySequence_assignment_visit + (valid : RefinementDataHistory stages history T) : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + ∀ seq : Nat → SetMembers Q, Antitone seq → ∀ enumerations : Nat → ZFSet.{u}, + (∀ i, BirthLevelEnumerationCode ZFSet.omega stages (SetMembers.raw (data (seq i))) + (refinementDataHistoryLevels stages history T) (enumerations i)) → + ∀ x ∈ stageOneAssignmentUnion (fun i => SetMembers.raw (data (seq i))), + ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ + x ∈ SetMembers.raw (data (seq i)) ∧ + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ + ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ + alpha ∈ relationImage (SetMembers.raw (data (seq i))) stages + (refinementDataHistoryLevels stages history T) ∧ + ZFSet.pair (natSetCode j) alpha ∈ enumerations i ∧ + ∀ k, Nat.pair i j ≤ k → + x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k))) := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + intro seq decreasing enumerations coded x member + have bounded : ∀ i, SetMembers.raw (data (seq i)) ⊆ + stageOneAssignments (refinementDataHistoryIndices stages history) T := by + intro i + exact ((M.mem_groundSmallSubsets _ _ _).1 (SetMembers.raw_mem (data (seq i)))).2.1 + exact valid.birthEnumeration_assignment_visit (fun i => SetMembers.raw (data (seq i))) enumerations + bounded (M.refinementHistorySequence_assignment_mono c T stages history seq decreasing) coded member + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] +variable (c : Presentation R) (T stages history : ZFSet.{u}) +local notation "Q" => M.refinementHistoryForcing c.carrier T stages history +local notation "B" => M.groundSmallSubsets + (stageOneAssignments (refinementDataHistoryIndices stages history) T) ZFSet.omega +local notation "shape" => M.refinementHistoryForcing_shape c.carrier T stages history +local notation "data" => flatCarrierData c Q B shape + +theorem fairRefinementSequence_assignment_prepared + (valid : RefinementDataHistory stages history T) + {E0 U enumSelector prepSelector : ZFSet.{u}} + (function : ZFSet.IsFunc Q E0 enumSelector) + (selected : enumSelector ⊆ M.birthLevelEnumerationRelation Q stages + (refinementDataHistoryLevels stages history T)) : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + ∀ (seq : Nat → SetMembers Q), Antitone seq → + ∀ (clocks births events : Nat → ZFSet.{u}) (initialE : ZFSet.{u}), + ZFSet.pair (SetMembers.raw (seq 0)) initialE ∈ enumSelector → + clocks 0 = ∅ → births 0 = {ZFSet.pair ∅ initialE} → + (∀ k, FairPreparationStepCode ZFSet.omega E0 stages U enumSelector prepSelector + (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) + (ZFSet.pair (clocks k) (ZFSet.pair (SetMembers.raw (seq k)) + (ZFSet.pair (births k) (events k)))) + (ZFSet.pair (clocks (k + 1)) (ZFSet.pair (SetMembers.raw (seq (k + 1))) + (ZFSet.pair (births (k + 1)) (events (k + 1)))))) → + ∀ x ∈ stageOneAssignmentUnion (fun i => SetMembers.raw (data (seq i))), + ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ + x ∈ SetMembers.raw (data (seq i)) ∧ + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ + ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ + (∀ k, Nat.pair i j ≤ k → + x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k)))) ∧ + ∃ y ∈ U, ∃ payload, + y = ZFSet.pair (SetMembers.raw (seq (Nat.pair i j + 1))) payload ∧ + ZFSet.pair (ZFSet.pair alpha (SetMembers.raw (seq (Nat.pair i j)))) y ∈ prepSelector ∧ + events (Nat.pair i j + 1) = ZFSet.pair alpha y := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + intro seq decreasing clocks births events initialE initialChosen initialClock initialBirths steps x member + have available (k : Nat) : ∃ e, ZFSet.pair (SetMembers.raw (seq k)) e ∈ enumSelector := by + obtain ⟨e, edge, _⟩ := function.2 _ (SetMembers.raw_mem (seq k)) + exact ⟨e, edge⟩ + choose enumerations chosen using available + have codes (k : Nat) : BirthLevelEnumerationCode ZFSet.omega stages + (SetMembers.raw (data (seq k))) (refinementDataHistoryLevels stages history T) (enumerations k) := by + have entry := selected (chosen k) + rw [flatCarrier_coordinates c Q B shape (seq k)] at entry + exact ((M.pair_mem_birthLevelEnumerationRelation _ _ _ _ _ _).1 entry).2.2 + have enumerationCases (k : Nat) : enumerations k = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages (enumerations k) := + (codes k).elim (fun idle => Or.inl idle.2) (fun active => Or.inr active.1) + have initialSame : initialE = enumerations 0 := by + obtain ⟨_, _, unique⟩ := function.2 _ (SetMembers.raw_mem (seq 0)) + exact (unique _ initialChosen).trans (unique _ (chosen 0)).symm + have initialTable : births 0 = {ZFSet.pair ∅ (enumerations 0)} := by + rw [← initialSame] + exact initialBirths + obtain ⟨i, j, alpha, hAlpha, fields, grid, before, born, stored, level, _attained, enumerated, retained⟩ := + M.refinementHistorySequence_assignment_visit c T stages history valid seq decreasing + enumerations codes x member + obtain ⟨y, hy, ⟨payload, output⟩, edge, event⟩ := + fairPreparation_scheduledActiveEvent function clocks (fun k => SetMembers.raw (seq k)) births events + enumerations enumerationCases chosen initialClock initialTable steps i j alpha enumerated + exact ⟨i, j, alpha, hAlpha, fields, grid, before, born, stored, level, retained, + y, hy, payload, output, edge, event⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFamilyValueUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFamilyValueUnions.lean index 809bddd90596722c2c89699914f857c34b18d1cf..a5fab8ebc0367c9fb0b3191ee86e138a39802de8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFamilyValueUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFamilyValueUnions.lean @@ -1,63 +1,63 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u v -variable {I : Type v} [Small.{u} I] - -theorem familyCodeGraph_valueRange_eq (key value : I → ZFSet.{u}) : - ZFSet.range value = relationImage (ZFSet.range key) - (ZFSet.sUnion (ZFSet.sUnion (familyCodeGraph key value))) (familyCodeGraph key value) := by - apply ZFSet.ext - intro y - rw [ZFSet.mem_range, mem_relationImage] - constructor - · rintro ⟨i, rfl⟩ - have entry := (mem_familyCodeGraph key value _).2 ⟨i, rfl⟩ - exact ⟨pair_second_mem_doubleUnion entry, key i, ZFSet.mem_range.2 ⟨i, rfl⟩, entry⟩ - · rintro ⟨_, x, _, entry⟩ - obtain ⟨i, equal⟩ := (mem_familyCodeGraph key value _).1 entry - exact ⟨i, (ZFSet.pair_inj.1 equal).2⟩ - -theorem TransitiveGround.familyCodeGraph_valueRange_mem (M : TransitiveGround.{u}) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (key value : I → ZFSet.{u}) (domain : ZFSet.range key ∈ M.sets) - (whole : familyCodeGraph key value ∈ M.sets) : ZFSet.range value ∈ M.sets := by - rw [familyCodeGraph_valueRange_eq key value] - exact M.relationImage_mem separation domain (M.union_mem unions (M.union_mem unions whole)) whole - -theorem familyCodeGraph_valueRange_rank_le (key value : I → ZFSet.{u}) : - ZFSet.rank (ZFSet.range value) ≤ ZFSet.rank (familyCodeGraph key value) := by - have subset : ZFSet.range value ⊆ ZFSet.sUnion (ZFSet.sUnion (familyCodeGraph key value)) := by - intro y hy - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hy - exact pair_second_mem_doubleUnion ((mem_familyCodeGraph key value _).2 ⟨i, rfl⟩) - exact (ZFSet.rank_mono subset).trans ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) - -theorem familyCodeGraph_valueUnion_rank_le (key value : I → ZFSet.{u}) : - ZFSet.rank (ZFSet.sUnion (ZFSet.range value)) ≤ ZFSet.rank (familyCodeGraph key value) := - (ZFSet.rank_sUnion_le _).trans (familyCodeGraph_valueRange_rank_le key value) - -theorem familyCodeGraph_valueUnion_mem_iff (value : I → ZFSet.{u}) (x : ZFSet.{u}) : - x ∈ ZFSet.sUnion (ZFSet.range value) ↔ ∃ i, x ∈ value i := by - rw [ZFSet.mem_sUnion] - exact ⟨fun ⟨_, hy, hx⟩ => by obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hy; exact ⟨i, hx⟩, - fun ⟨i, hx⟩ => ⟨value i, ZFSet.mem_range.2 ⟨i, rfl⟩, hx⟩⟩ - -theorem familyCodeGraph_value_subset_union (key value : I → ZFSet.{u}) - {i X : ZFSet.{u}} (entry : ZFSet.pair i X ∈ familyCodeGraph key value) : - X ⊆ ZFSet.sUnion (ZFSet.range value) := by - obtain ⟨j, equal⟩ := (mem_familyCodeGraph key value _).1 entry - have values := (ZFSet.pair_inj.1 equal).2 - intro x hx - exact (familyCodeGraph_valueUnion_mem_iff value x).2 ⟨j, values.symm ▸ hx⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u v +variable {I : Type v} [Small.{u} I] + +theorem familyCodeGraph_valueRange_eq (key value : I → ZFSet.{u}) : + ZFSet.range value = relationImage (ZFSet.range key) + (ZFSet.sUnion (ZFSet.sUnion (familyCodeGraph key value))) (familyCodeGraph key value) := by + apply ZFSet.ext + intro y + rw [ZFSet.mem_range, mem_relationImage] + constructor + · rintro ⟨i, rfl⟩ + have entry := (mem_familyCodeGraph key value _).2 ⟨i, rfl⟩ + exact ⟨pair_second_mem_doubleUnion entry, key i, ZFSet.mem_range.2 ⟨i, rfl⟩, entry⟩ + · rintro ⟨_, x, _, entry⟩ + obtain ⟨i, equal⟩ := (mem_familyCodeGraph key value _).1 entry + exact ⟨i, (ZFSet.pair_inj.1 equal).2⟩ + +theorem TransitiveGround.familyCodeGraph_valueRange_mem (M : TransitiveGround.{u}) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (key value : I → ZFSet.{u}) (domain : ZFSet.range key ∈ M.sets) + (whole : familyCodeGraph key value ∈ M.sets) : ZFSet.range value ∈ M.sets := by + rw [familyCodeGraph_valueRange_eq key value] + exact M.relationImage_mem separation domain (M.union_mem unions (M.union_mem unions whole)) whole + +theorem familyCodeGraph_valueRange_rank_le (key value : I → ZFSet.{u}) : + ZFSet.rank (ZFSet.range value) ≤ ZFSet.rank (familyCodeGraph key value) := by + have subset : ZFSet.range value ⊆ ZFSet.sUnion (ZFSet.sUnion (familyCodeGraph key value)) := by + intro y hy + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hy + exact pair_second_mem_doubleUnion ((mem_familyCodeGraph key value _).2 ⟨i, rfl⟩) + exact (ZFSet.rank_mono subset).trans ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)) + +theorem familyCodeGraph_valueUnion_rank_le (key value : I → ZFSet.{u}) : + ZFSet.rank (ZFSet.sUnion (ZFSet.range value)) ≤ ZFSet.rank (familyCodeGraph key value) := + (ZFSet.rank_sUnion_le _).trans (familyCodeGraph_valueRange_rank_le key value) + +theorem familyCodeGraph_valueUnion_mem_iff (value : I → ZFSet.{u}) (x : ZFSet.{u}) : + x ∈ ZFSet.sUnion (ZFSet.range value) ↔ ∃ i, x ∈ value i := by + rw [ZFSet.mem_sUnion] + exact ⟨fun ⟨_, hy, hx⟩ => by obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hy; exact ⟨i, hx⟩, + fun ⟨i, hx⟩ => ⟨value i, ZFSet.mem_range.2 ⟨i, rfl⟩, hx⟩⟩ + +theorem familyCodeGraph_value_subset_union (key value : I → ZFSet.{u}) + {i X : ZFSet.{u}} (entry : ZFSet.pair i X ∈ familyCodeGraph key value) : + X ⊆ ZFSet.sUnion (ZFSet.range value) := by + obtain ⟨j, equal⟩ := (mem_familyCodeGraph key value _).1 entry + have values := (ZFSet.pair_inj.1 equal).2 + intro x hx + exact (familyCodeGraph_valueUnion_mem_iff value x).2 ⟨j, values.symm ▸ hx⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFinalInsertionExceptions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFinalInsertionExceptions.lean index b805522d5826ae3ddffcb6a5a81536a8befd7292..2511ac087e3eddd165c00a3fc95b1b9fff45d4c9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFinalInsertionExceptions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFinalInsertionExceptions.lean @@ -1,597 +1,597 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.AttachmentOldCodeLaws -import OAI.SetTheory.PartitionPrinciple.Forcing.SmallCodedMeetActions -import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalInsertionStages - -namespace OAI - - -namespace PartitionPilot.Forcing.NatUnionCode -universe u - -theorem partialOrder {P r : Nat → ZFSet.{u}} {L R : ZFSet.{u}} - (carrier : NatUnionCode P L) (relation : NatUnionCode r R) - (orders : ∀ n, PartialOrderCode (P n) (r n)) - (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) : PartialOrderCode L R := by - constructor - · intro z hz - obtain ⟨n, hn⟩ := (relation z).1 hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((orders n).relation hn) - exact ZFSet.pair_mem_prod.2 ⟨carrier.subset n hx, carrier.subset n hy⟩ - · intro x hx - obtain ⟨n, hn⟩ := (carrier x).1 hx - exact relation.subset n ((orders n).refl x hn) - · intro x _ y _ xy yx - obtain ⟨n, hn⟩ := (relation _).1 xy - obtain ⟨m, hm⟩ := (relation _).1 yx - have first := relationMono n (max n m) (le_max_left n m) hn - have second := relationMono m (max n m) (le_max_right n m) hm - have shape := ZFSet.pair_mem_prod.1 ((orders (max n m)).relation first) - exact (orders (max n m)).antisymm x shape.1 y shape.2 first second - · intro x _ y _ z _ xy yz - obtain ⟨n, hn⟩ := (relation _).1 xy - obtain ⟨m, hm⟩ := (relation _).1 yz - have first := relationMono n (max n m) (le_max_left n m) hn - have second := relationMono m (max n m) (le_max_right n m) hm - have xyShape := ZFSet.pair_mem_prod.1 ((orders (max n m)).relation first) - have yzShape := ZFSet.pair_mem_prod.1 ((orders (max n m)).relation second) - exact relation.subset (max n m) - ((orders (max n m)).trans x xyShape.1 y xyShape.2 z yzShape.2 first second) - -theorem order_entry_iff {P r : Nat → ZFSet.{u}} {R : ZFSet.{u}} - (relation : NatUnionCode r R) - (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) - (oldOrder : ∀ n m, n ≤ m → ∀ x ∈ P n, ∀ y ∈ P n, - ZFSet.pair x y ∈ r m ↔ ZFSet.pair x y ∈ r n) - (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ P n) (hy : y ∈ P n) : - ZFSet.pair x y ∈ R ↔ ZFSet.pair x y ∈ r n := by - constructor - · intro entry - obtain ⟨m, hm⟩ := (relation _).1 entry - exact (oldOrder n (max n m) (le_max_left n m) x hx y hy).1 - (relationMono m _ (le_max_right n m) hm) - · exact fun entry => relation.subset n entry - -theorem meetOrder {P r μ : Nat → ZFSet.{u}} {L R M : ZFSet.{u}} - (carrier : NatUnionCode P L) (relation : NatUnionCode r R) (operation : NatUnionCode μ M) - (codes : ∀ n, MeetOrderCode (P n) (r n) (μ n)) - (carrierMono : ∀ n m, n ≤ m → P n ⊆ P m) - (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) - (operationMono : ∀ n m, n ≤ m → μ n ⊆ μ m) : MeetOrderCode L R M := by - refine ⟨carrier.partialOrder relation (fun n => (codes n).order) relationMono, - (carrier.prod carrier carrierMono carrierMono).isFunc carrier operation - (fun n => (codes n).operation) operationMono, ?_, ?_, ?_⟩ - · intro x y z entry - obtain ⟨n, hn⟩ := (operation _).1 entry - exact relation.subset n ((codes n).lower_left x y z hn) - · intro x y z entry - obtain ⟨n, hn⟩ := (operation _).1 entry - exact relation.subset n ((codes n).lower_right x y z hn) - · intro x y z w _ meet wx wy - obtain ⟨n, hn⟩ := (operation _).1 meet - obtain ⟨i, hi⟩ := (relation _).1 wx - obtain ⟨j, hj⟩ := (relation _).1 wy - let k := max n (max i j) - have nk : n ≤ k := le_max_left n (max i j) - have ik : i ≤ k := (le_max_left i j).trans (le_max_right n (max i j)) - have jk : j ≤ k := (le_max_right i j).trans (le_max_right n (max i j)) - have meetK := operationMono n k nk hn - have wxK := relationMono i k ik hi - have wyK := relationMono j k jk hj - have wK := (ZFSet.pair_mem_prod.1 ((codes k).order.relation wxK)).1 - exact relation.subset k ((codes k).greatest x y z w wK meetK wxK wyK) - -theorem meet_entry_iff {P r μ : Nat → ZFSet.{u}} {L R M : ZFSet.{u}} - (operation : NatUnionCode μ M) (unionCode : MeetOrderCode L R M) - (codes : ∀ n, MeetOrderCode (P n) (r n) (μ n)) - (n : Nat) {x y z : ZFSet.{u}} (hx : x ∈ P n) (hy : y ∈ P n) : - ZFSet.pair (ZFSet.pair x y) z ∈ M ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ n := - operation.function_entry_iff unionCode.operation (fun n => (codes n).operation) n - (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - -end PartitionPilot.Forcing.NatUnionCode - - - -namespace PartitionPilot.Forcing -universe u v w - -def CodedInsertionProfile (L r μ c e K F : ZFSet.{u}) : Prop := - ∀ x ∈ L, ZFSet.pair e x ∈ r → - ((∃ f ∈ F, ZFSet.pair f x ∈ r) → ZFSet.pair K x ∈ r) ∧ - (¬ (∃ f ∈ F, ZFSet.pair f x ∈ r) → ZFSet.pair (ZFSet.pair K x) c ∈ μ) - -theorem CodedInsertionProfile.iff_profile {L r μ c e K F : ZFSet.{u}} - (meet : MeetOrderCode L r μ) (hc : c ∈ L) (he : e ∈ L) (hK : K ∈ L) - (subset : F ⊆ L) : - CodedInsertionProfile L r μ c e K F ↔ - Profile meet.toMeetOrder ⟨c, hc⟩ ⟨e, he⟩ ⟨K, hK⟩ (fun f => f.val ∈ F) := by - have positive (x : {x : ZFSet.{u} // x ∈ L}) : - Positive meet.toMeetOrder (fun f => f.val ∈ F) x ↔ - ∃ f ∈ F, ZFSet.pair f x.val ∈ r := by - constructor - · rintro ⟨f, hf, lower⟩ - exact ⟨f.val, hf, lower⟩ - · rintro ⟨f, hf, lower⟩ - exact ⟨⟨f, subset hf⟩, hf, lower⟩ - constructor - · intro profile x above - have inherited := profile x.val x.property above - refine ⟨fun hx => inherited.1 ((positive x).1 hx), ?_⟩ - intro negative - have entry := inherited.2 (fun hx => negative ((positive x).2 hx)) - apply Subtype.ext - exact (show FunctionGraphOn (ZFSet.prod L L) μ from ⟨L, meet.operation⟩).unique - (meet.toMeetOrder_meet_entry ⟨K, hK⟩ x) entry - · intro profile x hx above - have inherited := profile ⟨x, hx⟩ above - refine ⟨fun positiveRaw => inherited.1 ((positive ⟨x, hx⟩).2 positiveRaw), ?_⟩ - intro negative - have equal := inherited.2 (fun hp => negative ((positive ⟨x, hx⟩).1 hp)) - have entry := meet.toMeetOrder_meet_entry ⟨K, hK⟩ ⟨x, hx⟩ - rw [equal] at entry - exact entry - -namespace CodedTemplateAttachment -variable {J : Type v} {P r μ N inside shadow upper c e K F : ZFSet.{u}} -variable {old : MeetOrderCode P r μ} {b : Attachment.Templates.{u+1,w,v} old.toMeetOrder J} -variable (d : CodedTemplateAttachment old b N inside shadow upper) - -theorem insertion_profile_persists (hc : c ∈ P) (he : e ∈ P) (hK : K ∈ P) - (subset : F ⊆ P) (nonempty : ∃ f, f ∈ F) - (profile : CodedInsertionProfile P r μ c e K F) - (separated : ZFSet.pair e K ∉ r) : - CodedInsertionProfile d.carrier d.order d.meetGraph c e K F := by - have nonemptyTyped : ∃ f : {f : ZFSet.{u} // f ∈ P}, f.val ∈ F := by - obtain ⟨f, hf⟩ := nonempty - exact ⟨⟨f, subset hf⟩, hf⟩ - have inherited := b.persistence ⟨c, hc⟩ ⟨e, he⟩ ⟨K, hK⟩ (fun f => f.val ∈ F) - nonemptyTyped ((CodedInsertionProfile.iff_profile old hc he hK subset).1 profile) separated - intro x hx above - obtain ⟨q, rfl⟩ := d.encode_surjective x hx - have positive : (∃ f ∈ F, ZFSet.pair f (d.encode q) ∈ d.order) ↔ - PositiveOver b.oldEmbedding (fun f => f.val ∈ F) q := by - constructor - · rintro ⟨f, hf, lower⟩ - exact ⟨⟨f, subset hf⟩, hf, (d.le_encode (.inl ⟨f, subset hf⟩) q).1 lower⟩ - · rintro ⟨f, hf, lower⟩ - exact ⟨f.val, hf, (d.le_encode (.inl f) q).2 lower⟩ - have atPoint := inherited q ((d.le_encode (.inl ⟨e, he⟩) q).1 above) - refine ⟨fun hp => (d.le_encode (.inl ⟨K, hK⟩) q).2 (atPoint.1 (positive.1 hp)), ?_⟩ - intro negative - have equal := atPoint.2 (fun hp => negative (positive.2 hp)) - have entry := d.encoded_meet_entry (.inl ⟨K, hK⟩) q - change b.extension.meet (.inl ⟨K, hK⟩) q = .inl ⟨c, hc⟩ at equal - rw [equal] at entry - exact entry - -end CodedTemplateAttachment - -theorem AttachmentBatchInputs.insertion_profile_persists - {P r μ J Qs rs μs As Es Fs Ss c e K F : ZFSet.{u}} - (d : AttachmentBatchInputs P r μ J Qs rs μs As Es Fs Ss) - (hc : c ∈ P) (he : e ∈ P) (hK : K ∈ P) - (subset : F ⊆ P) (nonempty : ∃ f, f ∈ F) - (profile : CodedInsertionProfile P r μ c e K F) - (separated : ZFSet.pair e K ∉ r) : - CodedInsertionProfile d.batchCarrier d.batchOrder d.batchMeetGraph c e K F := - d.coding.insertion_profile_persists hc he hK subset nonempty profile separated - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -structure CodedCapProfile (L r μ c e K F : ZFSet.{u}) : Prop where - target_mem : c ∈ L - separator_mem : e ∈ L - cap_mem : K ∈ L - filter_subset : F ⊆ L - nonempty : ∃ f, f ∈ F - profile : CodedInsertionProfile L r μ c e K F - target_below_cap : ZFSet.pair c K ∈ r - cap_not_below_target : ZFSet.pair K c ∉ r - separator_not_below_cap : ZFSet.pair e K ∉ r - -def CodedCompressionProfiles (L r μ Caps Targets Separators Filters : ZFSet.{u}) : Prop := - ∀ i c e K F, ZFSet.pair i K ∈ Caps → ZFSet.pair i c ∈ Targets → - ZFSet.pair i e ∈ Separators → ZFSet.pair i F ∈ Filters → - CodedCapProfile L r μ c e K F - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.NatUnionCode -universe u - -theorem insertionProfile {P r μ : Nat → ZFSet.{u}} {L R M c e K F : ZFSet.{u}} - (relation : NatUnionCode r R) (operation : NatUnionCode μ M) - (orders : ∀ n, PartialOrderCode (P n) (r n)) - (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) - (profiles : ∀ n, CodedInsertionProfile (P n) (r n) (μ n) c e K F) : - CodedInsertionProfile L R M c e K F := by - intro v _ above - obtain ⟨n, aboveN⟩ := (relation _).1 above - constructor - · rintro ⟨f, hf, below⟩ - obtain ⟨m, belowM⟩ := (relation _).1 below - have aboveCommon := relationMono n (max n m) (le_max_left n m) aboveN - have belowCommon := relationMono m (max n m) (le_max_right n m) belowM - have hv := (ZFSet.pair_mem_prod.1 ((orders (max n m)).relation aboveCommon)).2 - exact relation.subset (max n m) - ((profiles (max n m) v hv aboveCommon).1 ⟨f, hf, belowCommon⟩) - · intro negative - have hv := (ZFSet.pair_mem_prod.1 ((orders n).relation aboveN)).2 - apply operation.subset n - apply (profiles n v hv aboveN).2 - rintro ⟨f, hf, below⟩ - exact negative ⟨f, hf, relation.subset n below⟩ - -end PartitionPilot.Forcing.NatUnionCode - - -section - -namespace PartitionPilot.Forcing.CodedInsertionProfile -universe u -variable {L r μ c e K F : ZFSet.{u}} - -theorem cap_iff_positive (meet : MeetOrderCode L r μ) - (profile : CodedInsertionProfile L r μ c e K F) (different : K ≠ c) - {x : ZFSet.{u}} (hx : x ∈ L) (above : ZFSet.pair e x ∈ r) : - ZFSet.pair K x ∈ r ↔ ∃ f ∈ F, ZFSet.pair f x ∈ r := by - classical - have cases := profile x hx above - constructor - · intro lower - by_contra negative - have entry := cases.2 negative - have hK := (ZFSet.pair_mem_prod.1 (meet.order.relation lower)).1 - have hc := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 - have capBelowBase := meet.greatest K x c K hK entry (meet.order.refl K hK) lower - exact different (meet.order.antisymm K hK c hc capBelowBase (meet.lower_left K x c entry)) - · exact cases.1 - -theorem negative_incomparable (meet : MeetOrderCode L r μ) - (profile : CodedInsertionProfile L r μ c e K F) (different : K ≠ c) - (separated : ZFSet.pair e K ∉ r) - {x : ZFSet.{u}} (hx : x ∈ L) (above : ZFSet.pair e x ∈ r) - (negative : ¬ (∃ f ∈ F, ZFSet.pair f x ∈ r)) : - ZFSet.pair K x ∉ r ∧ ZFSet.pair x K ∉ r ∧ ZFSet.pair (ZFSet.pair K x) c ∈ μ := by - refine ⟨fun lower => negative ((cap_iff_positive meet profile different hx above).1 lower), - ?_, (profile x hx above).2 negative⟩ - intro lower - have he := (ZFSet.pair_mem_prod.1 (meet.order.relation above)).1 - have hK := (ZFSet.pair_mem_prod.1 (meet.order.relation lower)).2 - exact separated (meet.order.trans e he x hx K hK above lower) - -end PartitionPilot.Forcing.CodedInsertionProfile - -namespace PartitionPilot.Forcing.CodedCapProfile -universe u -variable {L r μ c e K F : ZFSet.{u}} - -theorem cap_iff_positive (profile : CodedCapProfile L r μ c e K F) - (meet : MeetOrderCode L r μ) {x : ZFSet.{u}} (hx : x ∈ L) - (above : ZFSet.pair e x ∈ r) : - ZFSet.pair K x ∈ r ↔ ∃ f ∈ F, ZFSet.pair f x ∈ r := by - apply CodedInsertionProfile.cap_iff_positive meet profile.profile ?_ hx above - intro equal - apply profile.cap_not_below_target - rw [equal] - exact meet.order.refl c profile.target_mem - -theorem negative_incomparable (profile : CodedCapProfile L r μ c e K F) - (meet : MeetOrderCode L r μ) {x : ZFSet.{u}} (hx : x ∈ L) - (above : ZFSet.pair e x ∈ r) (negative : ¬ (∃ f ∈ F, ZFSet.pair f x ∈ r)) : - ZFSet.pair K x ∉ r ∧ ZFSet.pair x K ∉ r ∧ ZFSet.pair (ZFSet.pair K x) c ∈ μ := by - apply CodedInsertionProfile.negative_incomparable meet profile.profile ?_ - profile.separator_not_below_cap hx above negative - intro equal - apply profile.cap_not_below_target - rw [equal] - exact meet.order.refl c profile.target_mem - -end PartitionPilot.Forcing.CodedCapProfile - -end - - -namespace PartitionPilot.Forcing -universe u - -structure FinalInsertionFamiliesCode - (Labels P G r μ A c e d F caps actors : ZFSet.{u}) : Prop where - cap_injection : InjectionCode Labels P caps - actor_injection : InjectionCode Labels G actors - fixes : ∀ label k, ZFSet.pair label k ∈ actors → - ∀ z ∈ P, ZFSet.pair z c ∈ r → ZFSet.pair (ZFSet.pair k z) z ∈ A - dominates : ∀ label k cap, ZFSet.pair label k ∈ actors → ZFSet.pair label cap ∈ caps → - ∀ y ∈ P, ZFSet.pair (ZFSet.pair k d) y ∈ A → ZFSet.pair y cap ∈ r - profiles : ∀ label cap, ZFSet.pair label cap ∈ caps → CodedCapProfile P r μ c e cap F - meets : ∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ caps → - ZFSet.pair second cap₂ ∈ caps → first ≠ second → ZFSet.pair (ZFSet.pair cap₁ cap₂) c ∈ μ - -namespace FinalInsertionFamiliesCode -variable {Labels P G r μ A c e d F caps actors : ZFSet.{u}} -variable (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) -include family - -theorem tests (order : PartialOrderCode P r) (filter : MeetFilterCode P r μ F) - {label cap v : ZFSet.{u}} (entry : ZFSet.pair label cap ∈ caps) - (hv : v ∈ P) (above : ZFSet.pair e v ∈ r) : - (v ∈ F → ZFSet.pair cap v ∈ r) ∧ - (v ∉ F → ZFSet.pair (ZFSet.pair cap v) c ∈ μ) := by - have profile := (family.profiles label cap entry).profile v hv above - refine ⟨fun member => profile.1 ⟨v, member, order.refl v hv⟩, ?_⟩ - intro negative - apply profile.2 - rintro ⟨f, hf, lower⟩ - exact negative (filter.upward f hf v hv lower) - -end FinalInsertionFamiliesCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.FinalInsertionFamiliesCode -open SetRealization -universe u -variable {Labels P G r μ A c e d F caps actors : ZFSet.{u}} - -noncomputable def decodedCaps - (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) : - SetMembers Labels → SetMembers P := - (SetMembers.presentation Labels).decodeFunction (SetMembers.presentation P) - caps family.cap_injection.function - -noncomputable def decodedActors - (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) : - SetMembers Labels → SetMembers G := - (SetMembers.presentation Labels).decodeFunction (SetMembers.presentation G) - actors family.actor_injection.function - -theorem decodedCaps_entry - (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) - (label : SetMembers Labels) : - ZFSet.pair (SetMembers.raw label) (SetMembers.raw (family.decodedCaps label)) ∈ caps := - (SetMembers.presentation Labels).decodeFunction_mem (SetMembers.presentation P) - caps family.cap_injection.function label - -theorem decodedActors_entry - (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) - (label : SetMembers Labels) : - ZFSet.pair (SetMembers.raw label) (SetMembers.raw (family.decodedActors label)) ∈ actors := - (SetMembers.presentation Labels).decodeFunction_mem (SetMembers.presentation G) - actors family.actor_injection.function label - -theorem hasInsertionFamily {m inv one : ZFSet.{u}} {c e d : SetMembers P} - (family : FinalInsertionFamiliesCode Labels P G r μ A - (SetMembers.raw c) (SetMembers.raw e) (SetMembers.raw d) F caps actors) - (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) - (action : PosetActionCode G P m one r A) (filter : MeetFilterCode P r μ F) : - letI := group.toGroup - Compression.RecursiveMaps.HasInsertionFamily (action.toOrderAction group meet) - (SetMembers Labels) c e d (fun x => SetMembers.raw x ∈ F) := by - let := group.toGroup - refine ⟨family.decodedCaps, family.decodedActors, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · intro label z lower - apply (action.toOrderAction_eq_iff group meet (family.decodedActors label) z z).2 - exact family.fixes _ _ (family.decodedActors_entry label) _ (SetMembers.raw_mem z) lower - · intro label - exact family.dominates _ _ _ (family.decodedActors_entry label) (family.decodedCaps_entry label) - _ (SetMembers.raw_mem _) (action.toOrderAction_entry group meet (family.decodedActors label) d) - · intro label - have profile := family.profiles _ _ (family.decodedCaps_entry label) - exact ⟨profile.target_below_cap, profile.cap_not_below_target⟩ - · intro label - exact (family.profiles _ _ (family.decodedCaps_entry label)).separator_not_below_cap - · intro first second different - apply (meet.toSmallMeetOrder_meet_eq_iff _ _ _).2 - exact family.meets _ _ _ _ (family.decodedCaps_entry first) (family.decodedCaps_entry second) - (fun equal => different ((SetMembers.raw_injective Labels) equal)) - · intro label x above - have tests := family.tests meet.order filter (family.decodedCaps_entry label) - (SetMembers.raw_mem x) above - exact ⟨tests.1, fun negative => (meet.toSmallMeetOrder_meet_eq_iff _ _ _).2 (tests.2 negative)⟩ - -end PartitionPilot.Forcing.FinalInsertionFamiliesCode - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -private def capExceptionTest (profiles : Bool) (r c x cap : ZFSet.{u}) : Prop := - if profiles then c ∉ x ∧ cap ∈ x - else ZFSet.pair x c ∉ r ∧ ZFSet.pair x cap ∈ r - -private noncomputable def capExceptionRelation - (profiles : Bool) (S Labels P r c caps : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ S, ∃ label ∈ Labels, ∃ cap ∈ P, - z = ZFSet.pair x label ∧ ZFSet.pair label cap ∈ caps ∧ - capExceptionTest profiles r c x cap) (ZFSet.prod S Labels) - -private theorem pair_mem_capExceptionRelation - (profiles : Bool) (S Labels P r c caps x label : ZFSet.{u}) : - ZFSet.pair x label ∈ capExceptionRelation profiles S Labels P r c caps ↔ - x ∈ S ∧ label ∈ Labels ∧ ∃ cap ∈ P, ZFSet.pair label cap ∈ caps ∧ - capExceptionTest profiles r c x cap := by - rw [capExceptionRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, y, hy, l, hl, cap, hcap, eq, entry, test⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hy, hl, cap, hcap, entry, test⟩ - · rintro ⟨hx, hl, cap, hcap, entry, test⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hl⟩, x, hx, label, hl, cap, hcap, - rfl, entry, test⟩ - -private def capExceptionEntryFormula {n} - (profiles : Bool) (z s labels p r c caps : Fin n) : BoundedFormula n := - BoundedFormula.exMem s (BoundedFormula.exMem labels.succ - (BoundedFormula.exMem p.succ.succ - (.conj (BoundedFormula.orderedPairFormula z.succ.succ.succ 2 1) - (.conj (BoundedFormula.pairMembershipFormula 1 0 caps.succ.succ.succ) - (if profiles then .conj (.neg (.mem c.succ.succ.succ 2)) (.mem 0 2) - else .conj (.neg (BoundedFormula.pairMembershipFormula 2 c.succ.succ.succ r.succ.succ.succ)) - (BoundedFormula.pairMembershipFormula 2 0 r.succ.succ.succ)))))) - -private theorem truth_capExceptionEntryFormula {n} - (profiles : Bool) (z s labels p r c caps : Fin n) (env : Fin n → ZFSet.{u}) : - BoundedFormula.Truth (capExceptionEntryFormula profiles z s labels p r c caps) env ↔ - ∃ x ∈ env s, ∃ label ∈ env labels, ∃ cap ∈ env p, - env z = ZFSet.pair x label ∧ ZFSet.pair label cap ∈ env caps ∧ - capExceptionTest profiles (env r) (env c) x cap := by - cases profiles <;> - simp only [capExceptionEntryFormula, capExceptionTest, Bool.false_eq_true, ↓reduceIte, - BoundedFormula.truth_exMem, BoundedFormula.Truth, - BoundedFormula.truth_orderedPairFormula, BoundedFormula.truth_pairMembershipFormula] <;> rfl - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -private theorem capExceptionRelation_mem - (profiles : Bool) {S Labels P r c caps : ZFSet.{u}} - (hS : S ∈ M.sets) (hLabels : Labels ∈ M.sets) (hP : P ∈ M.sets) - (hr : r ∈ M.sets) (hc : c ∈ M.sets) (hCaps : caps ∈ M.sets) : - capExceptionRelation profiles S Labels P r c caps ∈ M.sets := by - let params := extend S (extend Labels (extend P (extend r (extend c (extend caps Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (capExceptionEntryFormula profiles 0 1 2 3 4 5 6) params - (Fin.cases hS (Fin.cases hLabels (Fin.cases hP (Fin.cases hr - (Fin.cases hc (Fin.cases hCaps (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hS hLabels) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (capExceptionEntryFormula profiles 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod S Labels) = capExceptionRelation profiles S Labels P r c caps := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, capExceptionRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (truth_capExceptionEntryFormula profiles 0 1 2 3 4 5 6 _) - exact eq ▸ selected - -private theorem partial_image_countable - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {S Labels rel : ZFSet.{u}} (hS : S ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hRel : rel ∈ M.sets) (code : PartialFunctionCode S Labels rel) - (smallS : M.groundEmbeddable S ZFSet.omega) : - M.groundEmbeddable (relationImage S Labels rel) ZFSet.omega := by - have hImage := M.relationImage_mem separation hS hLabels hRel - have restricted : PartialFunctionCode S (relationImage S Labels rel) rel := by - refine ⟨?_, code.unique⟩ - intro z hz - obtain ⟨x, hx, label, hl, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, (mem_relationImage _ _ _ _).2 ⟨hl, x, hx, hz⟩⟩ - obtain ⟨f, hf, injection⟩ := M.groundEmbeddable_of_partial_surjection - pairing unions powers separation choice hS hImage hRel restricted - (fun label member => ((mem_relationImage _ _ _ label).1 member).2) - obtain ⟨g, hg, count⟩ := smallS - exact ⟨relationCompose (relationImage S Labels rel) S ZFSet.omega f g, - M.relationCompose_mem pairing unions powers separation hImage hS - (M.omega_mem separation infinite) hf hg, injection.compose count⟩ -end TransitiveGround - -namespace FinalInsertionFamiliesCode - -theorem exists_ground_countable_exceptions - {Labels P G r μ A c e d F caps actors Used Profiles extra : ZFSet.{u}} - (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) - (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hLabels : Labels ∈ M.sets) (hP : P ∈ M.sets) (hr : r ∈ M.sets) - (hc : c ∈ M.sets) (hCaps : caps ∈ M.sets) - (hUsed : Used ∈ M.sets) (hProfiles : Profiles ∈ M.sets) (hExtra : extra ∈ M.sets) - (meet : MeetOrderCode P r μ) (usedSubset : Used ⊆ P) - (filters : ∀ profile ∈ Profiles, MeetFilterCode P r μ profile) - (smallUsed : M.groundEmbeddable Used ZFSet.omega) - (smallProfiles : M.groundEmbeddable Profiles ZFSet.omega) - (smallExtra : M.groundEmbeddable extra ZFSet.omega) (extraSubset : extra ⊆ Labels) : - ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ - ∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → - (∀ node ∈ Used, ZFSet.pair node cap ∈ r → ZFSet.pair node c ∈ r) ∧ - (∀ profile ∈ Profiles, c ∉ profile → cap ∉ profile) := by - classical - let nodes := capExceptionRelation false Used Labels P r c caps - let profiles := capExceptionRelation true Profiles Labels P r c caps - have hNodes : nodes ∈ M.sets := M.capExceptionRelation_mem pairing unions powers separation - false hUsed hLabels hP hr hc hCaps - have hProfilesRel : profiles ∈ M.sets := M.capExceptionRelation_mem pairing unions powers separation - true hProfiles hLabels hP hr hc hCaps - have nodesPartial : PartialFunctionCode Used Labels nodes := by - refine ⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩ - intro node first second one two - obtain ⟨used, _, cap₁, _, entry₁, negative, below₁⟩ := - (pair_mem_capExceptionRelation false Used Labels P r c caps node first).1 one - obtain ⟨_, _, cap₂, _, entry₂, _, below₂⟩ := - (pair_mem_capExceptionRelation false Used Labels P r c caps node second).1 two - by_contra different - exact negative (meet.greatest cap₁ cap₂ c node (usedSubset used) - (family.meets first second cap₁ cap₂ entry₁ entry₂ different) below₁ below₂) - have profilesPartial : PartialFunctionCode Profiles Labels profiles := by - refine ⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩ - intro profile first second one two - obtain ⟨used, _, cap₁, _, entry₁, negative, positive₁⟩ := - (pair_mem_capExceptionRelation true Profiles Labels P r c caps profile first).1 one - obtain ⟨_, _, cap₂, _, entry₂, _, positive₂⟩ := - (pair_mem_capExceptionRelation true Profiles Labels P r c caps profile second).1 two - by_contra different - exact negative ((filters profile used).closed_meet cap₁ positive₁ cap₂ positive₂ c - (family.meets first second cap₁ cap₂ entry₁ entry₂ different)) - let nodeBad := relationImage Used Labels nodes - let profileBad := relationImage Profiles Labels profiles - have hNodeBad : nodeBad ∈ M.sets := M.relationImage_mem separation hUsed hLabels hNodes - have hProfileBad : profileBad ∈ M.sets := M.relationImage_mem separation hProfiles hLabels hProfilesRel - have nodeSmall := M.partial_image_countable pairing unions powers separation infinite choice - hUsed hLabels hNodes nodesPartial smallUsed - have profileSmall := M.partial_image_countable pairing unions powers separation infinite choice - hProfiles hLabels hProfilesRel profilesPartial smallProfiles - have hBoth := M.binary_union_mem pairing unions hNodeBad hProfileBad - have smallBoth := M.groundCountable_binary_union pairing unions powers separation infinite choice - hNodeBad hProfileBad nodeSmall profileSmall - refine ⟨(nodeBad ∪ profileBad) ∪ extra, M.binary_union_mem pairing unions hBoth hExtra, ?_, - M.groundCountable_binary_union pairing unions powers separation infinite choice - hBoth hExtra smallBoth smallExtra, ?_, ?_⟩ - · intro label member - rcases ZFSet.mem_union.1 member with both | more - · rcases ZFSet.mem_union.1 both with node | profile - · exact ((mem_relationImage _ _ _ _).1 node).1 - · exact ((mem_relationImage _ _ _ _).1 profile).1 - · exact extraSubset more - · intro label member - exact ZFSet.mem_union.2 (Or.inr member) - · intro label cap entry good - have bounds := ZFSet.pair_mem_prod.1 (family.cap_injection.function.1 entry) - constructor - · intro node used below - by_contra negative - apply good - apply ZFSet.mem_union.2 ∘ Or.inl - apply ZFSet.mem_union.2 ∘ Or.inl - exact (mem_relationImage _ _ _ _).2 ⟨bounds.1, node, used, - (pair_mem_capExceptionRelation false Used Labels P r c caps node label).2 - ⟨used, bounds.1, cap, bounds.2, entry, negative, below⟩⟩ - · intro profile used negative positive - apply good - apply ZFSet.mem_union.2 ∘ Or.inl - apply ZFSet.mem_union.2 ∘ Or.inr - exact (mem_relationImage _ _ _ _).2 ⟨bounds.1, profile, used, - (pair_mem_capExceptionRelation true Profiles Labels P r c caps profile label).2 - ⟨used, bounds.1, cap, bounds.2, entry, negative, positive⟩⟩ - -end FinalInsertionFamiliesCode -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.AttachmentOldCodeLaws +import OAI.SetTheory.PartitionPrinciple.Forcing.SmallCodedMeetActions +import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalInsertionStages + +namespace OAI + + +namespace PartitionPilot.Forcing.NatUnionCode +universe u + +theorem partialOrder {P r : Nat → ZFSet.{u}} {L R : ZFSet.{u}} + (carrier : NatUnionCode P L) (relation : NatUnionCode r R) + (orders : ∀ n, PartialOrderCode (P n) (r n)) + (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) : PartialOrderCode L R := by + constructor + · intro z hz + obtain ⟨n, hn⟩ := (relation z).1 hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((orders n).relation hn) + exact ZFSet.pair_mem_prod.2 ⟨carrier.subset n hx, carrier.subset n hy⟩ + · intro x hx + obtain ⟨n, hn⟩ := (carrier x).1 hx + exact relation.subset n ((orders n).refl x hn) + · intro x _ y _ xy yx + obtain ⟨n, hn⟩ := (relation _).1 xy + obtain ⟨m, hm⟩ := (relation _).1 yx + have first := relationMono n (max n m) (le_max_left n m) hn + have second := relationMono m (max n m) (le_max_right n m) hm + have shape := ZFSet.pair_mem_prod.1 ((orders (max n m)).relation first) + exact (orders (max n m)).antisymm x shape.1 y shape.2 first second + · intro x _ y _ z _ xy yz + obtain ⟨n, hn⟩ := (relation _).1 xy + obtain ⟨m, hm⟩ := (relation _).1 yz + have first := relationMono n (max n m) (le_max_left n m) hn + have second := relationMono m (max n m) (le_max_right n m) hm + have xyShape := ZFSet.pair_mem_prod.1 ((orders (max n m)).relation first) + have yzShape := ZFSet.pair_mem_prod.1 ((orders (max n m)).relation second) + exact relation.subset (max n m) + ((orders (max n m)).trans x xyShape.1 y xyShape.2 z yzShape.2 first second) + +theorem order_entry_iff {P r : Nat → ZFSet.{u}} {R : ZFSet.{u}} + (relation : NatUnionCode r R) + (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) + (oldOrder : ∀ n m, n ≤ m → ∀ x ∈ P n, ∀ y ∈ P n, + ZFSet.pair x y ∈ r m ↔ ZFSet.pair x y ∈ r n) + (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ P n) (hy : y ∈ P n) : + ZFSet.pair x y ∈ R ↔ ZFSet.pair x y ∈ r n := by + constructor + · intro entry + obtain ⟨m, hm⟩ := (relation _).1 entry + exact (oldOrder n (max n m) (le_max_left n m) x hx y hy).1 + (relationMono m _ (le_max_right n m) hm) + · exact fun entry => relation.subset n entry + +theorem meetOrder {P r μ : Nat → ZFSet.{u}} {L R M : ZFSet.{u}} + (carrier : NatUnionCode P L) (relation : NatUnionCode r R) (operation : NatUnionCode μ M) + (codes : ∀ n, MeetOrderCode (P n) (r n) (μ n)) + (carrierMono : ∀ n m, n ≤ m → P n ⊆ P m) + (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) + (operationMono : ∀ n m, n ≤ m → μ n ⊆ μ m) : MeetOrderCode L R M := by + refine ⟨carrier.partialOrder relation (fun n => (codes n).order) relationMono, + (carrier.prod carrier carrierMono carrierMono).isFunc carrier operation + (fun n => (codes n).operation) operationMono, ?_, ?_, ?_⟩ + · intro x y z entry + obtain ⟨n, hn⟩ := (operation _).1 entry + exact relation.subset n ((codes n).lower_left x y z hn) + · intro x y z entry + obtain ⟨n, hn⟩ := (operation _).1 entry + exact relation.subset n ((codes n).lower_right x y z hn) + · intro x y z w _ meet wx wy + obtain ⟨n, hn⟩ := (operation _).1 meet + obtain ⟨i, hi⟩ := (relation _).1 wx + obtain ⟨j, hj⟩ := (relation _).1 wy + let k := max n (max i j) + have nk : n ≤ k := le_max_left n (max i j) + have ik : i ≤ k := (le_max_left i j).trans (le_max_right n (max i j)) + have jk : j ≤ k := (le_max_right i j).trans (le_max_right n (max i j)) + have meetK := operationMono n k nk hn + have wxK := relationMono i k ik hi + have wyK := relationMono j k jk hj + have wK := (ZFSet.pair_mem_prod.1 ((codes k).order.relation wxK)).1 + exact relation.subset k ((codes k).greatest x y z w wK meetK wxK wyK) + +theorem meet_entry_iff {P r μ : Nat → ZFSet.{u}} {L R M : ZFSet.{u}} + (operation : NatUnionCode μ M) (unionCode : MeetOrderCode L R M) + (codes : ∀ n, MeetOrderCode (P n) (r n) (μ n)) + (n : Nat) {x y z : ZFSet.{u}} (hx : x ∈ P n) (hy : y ∈ P n) : + ZFSet.pair (ZFSet.pair x y) z ∈ M ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ n := + operation.function_entry_iff unionCode.operation (fun n => (codes n).operation) n + (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + +end PartitionPilot.Forcing.NatUnionCode + + + +namespace PartitionPilot.Forcing +universe u v w + +def CodedInsertionProfile (L r μ c e K F : ZFSet.{u}) : Prop := + ∀ x ∈ L, ZFSet.pair e x ∈ r → + ((∃ f ∈ F, ZFSet.pair f x ∈ r) → ZFSet.pair K x ∈ r) ∧ + (¬ (∃ f ∈ F, ZFSet.pair f x ∈ r) → ZFSet.pair (ZFSet.pair K x) c ∈ μ) + +theorem CodedInsertionProfile.iff_profile {L r μ c e K F : ZFSet.{u}} + (meet : MeetOrderCode L r μ) (hc : c ∈ L) (he : e ∈ L) (hK : K ∈ L) + (subset : F ⊆ L) : + CodedInsertionProfile L r μ c e K F ↔ + Profile meet.toMeetOrder ⟨c, hc⟩ ⟨e, he⟩ ⟨K, hK⟩ (fun f => f.val ∈ F) := by + have positive (x : {x : ZFSet.{u} // x ∈ L}) : + Positive meet.toMeetOrder (fun f => f.val ∈ F) x ↔ + ∃ f ∈ F, ZFSet.pair f x.val ∈ r := by + constructor + · rintro ⟨f, hf, lower⟩ + exact ⟨f.val, hf, lower⟩ + · rintro ⟨f, hf, lower⟩ + exact ⟨⟨f, subset hf⟩, hf, lower⟩ + constructor + · intro profile x above + have inherited := profile x.val x.property above + refine ⟨fun hx => inherited.1 ((positive x).1 hx), ?_⟩ + intro negative + have entry := inherited.2 (fun hx => negative ((positive x).2 hx)) + apply Subtype.ext + exact (show FunctionGraphOn (ZFSet.prod L L) μ from ⟨L, meet.operation⟩).unique + (meet.toMeetOrder_meet_entry ⟨K, hK⟩ x) entry + · intro profile x hx above + have inherited := profile ⟨x, hx⟩ above + refine ⟨fun positiveRaw => inherited.1 ((positive ⟨x, hx⟩).2 positiveRaw), ?_⟩ + intro negative + have equal := inherited.2 (fun hp => negative ((positive ⟨x, hx⟩).1 hp)) + have entry := meet.toMeetOrder_meet_entry ⟨K, hK⟩ ⟨x, hx⟩ + rw [equal] at entry + exact entry + +namespace CodedTemplateAttachment +variable {J : Type v} {P r μ N inside shadow upper c e K F : ZFSet.{u}} +variable {old : MeetOrderCode P r μ} {b : Attachment.Templates.{u+1,w,v} old.toMeetOrder J} +variable (d : CodedTemplateAttachment old b N inside shadow upper) + +theorem insertion_profile_persists (hc : c ∈ P) (he : e ∈ P) (hK : K ∈ P) + (subset : F ⊆ P) (nonempty : ∃ f, f ∈ F) + (profile : CodedInsertionProfile P r μ c e K F) + (separated : ZFSet.pair e K ∉ r) : + CodedInsertionProfile d.carrier d.order d.meetGraph c e K F := by + have nonemptyTyped : ∃ f : {f : ZFSet.{u} // f ∈ P}, f.val ∈ F := by + obtain ⟨f, hf⟩ := nonempty + exact ⟨⟨f, subset hf⟩, hf⟩ + have inherited := b.persistence ⟨c, hc⟩ ⟨e, he⟩ ⟨K, hK⟩ (fun f => f.val ∈ F) + nonemptyTyped ((CodedInsertionProfile.iff_profile old hc he hK subset).1 profile) separated + intro x hx above + obtain ⟨q, rfl⟩ := d.encode_surjective x hx + have positive : (∃ f ∈ F, ZFSet.pair f (d.encode q) ∈ d.order) ↔ + PositiveOver b.oldEmbedding (fun f => f.val ∈ F) q := by + constructor + · rintro ⟨f, hf, lower⟩ + exact ⟨⟨f, subset hf⟩, hf, (d.le_encode (.inl ⟨f, subset hf⟩) q).1 lower⟩ + · rintro ⟨f, hf, lower⟩ + exact ⟨f.val, hf, (d.le_encode (.inl f) q).2 lower⟩ + have atPoint := inherited q ((d.le_encode (.inl ⟨e, he⟩) q).1 above) + refine ⟨fun hp => (d.le_encode (.inl ⟨K, hK⟩) q).2 (atPoint.1 (positive.1 hp)), ?_⟩ + intro negative + have equal := atPoint.2 (fun hp => negative (positive.2 hp)) + have entry := d.encoded_meet_entry (.inl ⟨K, hK⟩) q + change b.extension.meet (.inl ⟨K, hK⟩) q = .inl ⟨c, hc⟩ at equal + rw [equal] at entry + exact entry + +end CodedTemplateAttachment + +theorem AttachmentBatchInputs.insertion_profile_persists + {P r μ J Qs rs μs As Es Fs Ss c e K F : ZFSet.{u}} + (d : AttachmentBatchInputs P r μ J Qs rs μs As Es Fs Ss) + (hc : c ∈ P) (he : e ∈ P) (hK : K ∈ P) + (subset : F ⊆ P) (nonempty : ∃ f, f ∈ F) + (profile : CodedInsertionProfile P r μ c e K F) + (separated : ZFSet.pair e K ∉ r) : + CodedInsertionProfile d.batchCarrier d.batchOrder d.batchMeetGraph c e K F := + d.coding.insertion_profile_persists hc he hK subset nonempty profile separated + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +structure CodedCapProfile (L r μ c e K F : ZFSet.{u}) : Prop where + target_mem : c ∈ L + separator_mem : e ∈ L + cap_mem : K ∈ L + filter_subset : F ⊆ L + nonempty : ∃ f, f ∈ F + profile : CodedInsertionProfile L r μ c e K F + target_below_cap : ZFSet.pair c K ∈ r + cap_not_below_target : ZFSet.pair K c ∉ r + separator_not_below_cap : ZFSet.pair e K ∉ r + +def CodedCompressionProfiles (L r μ Caps Targets Separators Filters : ZFSet.{u}) : Prop := + ∀ i c e K F, ZFSet.pair i K ∈ Caps → ZFSet.pair i c ∈ Targets → + ZFSet.pair i e ∈ Separators → ZFSet.pair i F ∈ Filters → + CodedCapProfile L r μ c e K F + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.NatUnionCode +universe u + +theorem insertionProfile {P r μ : Nat → ZFSet.{u}} {L R M c e K F : ZFSet.{u}} + (relation : NatUnionCode r R) (operation : NatUnionCode μ M) + (orders : ∀ n, PartialOrderCode (P n) (r n)) + (relationMono : ∀ n m, n ≤ m → r n ⊆ r m) + (profiles : ∀ n, CodedInsertionProfile (P n) (r n) (μ n) c e K F) : + CodedInsertionProfile L R M c e K F := by + intro v _ above + obtain ⟨n, aboveN⟩ := (relation _).1 above + constructor + · rintro ⟨f, hf, below⟩ + obtain ⟨m, belowM⟩ := (relation _).1 below + have aboveCommon := relationMono n (max n m) (le_max_left n m) aboveN + have belowCommon := relationMono m (max n m) (le_max_right n m) belowM + have hv := (ZFSet.pair_mem_prod.1 ((orders (max n m)).relation aboveCommon)).2 + exact relation.subset (max n m) + ((profiles (max n m) v hv aboveCommon).1 ⟨f, hf, belowCommon⟩) + · intro negative + have hv := (ZFSet.pair_mem_prod.1 ((orders n).relation aboveN)).2 + apply operation.subset n + apply (profiles n v hv aboveN).2 + rintro ⟨f, hf, below⟩ + exact negative ⟨f, hf, relation.subset n below⟩ + +end PartitionPilot.Forcing.NatUnionCode + + +section + +namespace PartitionPilot.Forcing.CodedInsertionProfile +universe u +variable {L r μ c e K F : ZFSet.{u}} + +theorem cap_iff_positive (meet : MeetOrderCode L r μ) + (profile : CodedInsertionProfile L r μ c e K F) (different : K ≠ c) + {x : ZFSet.{u}} (hx : x ∈ L) (above : ZFSet.pair e x ∈ r) : + ZFSet.pair K x ∈ r ↔ ∃ f ∈ F, ZFSet.pair f x ∈ r := by + classical + have cases := profile x hx above + constructor + · intro lower + by_contra negative + have entry := cases.2 negative + have hK := (ZFSet.pair_mem_prod.1 (meet.order.relation lower)).1 + have hc := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 + have capBelowBase := meet.greatest K x c K hK entry (meet.order.refl K hK) lower + exact different (meet.order.antisymm K hK c hc capBelowBase (meet.lower_left K x c entry)) + · exact cases.1 + +theorem negative_incomparable (meet : MeetOrderCode L r μ) + (profile : CodedInsertionProfile L r μ c e K F) (different : K ≠ c) + (separated : ZFSet.pair e K ∉ r) + {x : ZFSet.{u}} (hx : x ∈ L) (above : ZFSet.pair e x ∈ r) + (negative : ¬ (∃ f ∈ F, ZFSet.pair f x ∈ r)) : + ZFSet.pair K x ∉ r ∧ ZFSet.pair x K ∉ r ∧ ZFSet.pair (ZFSet.pair K x) c ∈ μ := by + refine ⟨fun lower => negative ((cap_iff_positive meet profile different hx above).1 lower), + ?_, (profile x hx above).2 negative⟩ + intro lower + have he := (ZFSet.pair_mem_prod.1 (meet.order.relation above)).1 + have hK := (ZFSet.pair_mem_prod.1 (meet.order.relation lower)).2 + exact separated (meet.order.trans e he x hx K hK above lower) + +end PartitionPilot.Forcing.CodedInsertionProfile + +namespace PartitionPilot.Forcing.CodedCapProfile +universe u +variable {L r μ c e K F : ZFSet.{u}} + +theorem cap_iff_positive (profile : CodedCapProfile L r μ c e K F) + (meet : MeetOrderCode L r μ) {x : ZFSet.{u}} (hx : x ∈ L) + (above : ZFSet.pair e x ∈ r) : + ZFSet.pair K x ∈ r ↔ ∃ f ∈ F, ZFSet.pair f x ∈ r := by + apply CodedInsertionProfile.cap_iff_positive meet profile.profile ?_ hx above + intro equal + apply profile.cap_not_below_target + rw [equal] + exact meet.order.refl c profile.target_mem + +theorem negative_incomparable (profile : CodedCapProfile L r μ c e K F) + (meet : MeetOrderCode L r μ) {x : ZFSet.{u}} (hx : x ∈ L) + (above : ZFSet.pair e x ∈ r) (negative : ¬ (∃ f ∈ F, ZFSet.pair f x ∈ r)) : + ZFSet.pair K x ∉ r ∧ ZFSet.pair x K ∉ r ∧ ZFSet.pair (ZFSet.pair K x) c ∈ μ := by + apply CodedInsertionProfile.negative_incomparable meet profile.profile ?_ + profile.separator_not_below_cap hx above negative + intro equal + apply profile.cap_not_below_target + rw [equal] + exact meet.order.refl c profile.target_mem + +end PartitionPilot.Forcing.CodedCapProfile + +end + + +namespace PartitionPilot.Forcing +universe u + +structure FinalInsertionFamiliesCode + (Labels P G r μ A c e d F caps actors : ZFSet.{u}) : Prop where + cap_injection : InjectionCode Labels P caps + actor_injection : InjectionCode Labels G actors + fixes : ∀ label k, ZFSet.pair label k ∈ actors → + ∀ z ∈ P, ZFSet.pair z c ∈ r → ZFSet.pair (ZFSet.pair k z) z ∈ A + dominates : ∀ label k cap, ZFSet.pair label k ∈ actors → ZFSet.pair label cap ∈ caps → + ∀ y ∈ P, ZFSet.pair (ZFSet.pair k d) y ∈ A → ZFSet.pair y cap ∈ r + profiles : ∀ label cap, ZFSet.pair label cap ∈ caps → CodedCapProfile P r μ c e cap F + meets : ∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ caps → + ZFSet.pair second cap₂ ∈ caps → first ≠ second → ZFSet.pair (ZFSet.pair cap₁ cap₂) c ∈ μ + +namespace FinalInsertionFamiliesCode +variable {Labels P G r μ A c e d F caps actors : ZFSet.{u}} +variable (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) +include family + +theorem tests (order : PartialOrderCode P r) (filter : MeetFilterCode P r μ F) + {label cap v : ZFSet.{u}} (entry : ZFSet.pair label cap ∈ caps) + (hv : v ∈ P) (above : ZFSet.pair e v ∈ r) : + (v ∈ F → ZFSet.pair cap v ∈ r) ∧ + (v ∉ F → ZFSet.pair (ZFSet.pair cap v) c ∈ μ) := by + have profile := (family.profiles label cap entry).profile v hv above + refine ⟨fun member => profile.1 ⟨v, member, order.refl v hv⟩, ?_⟩ + intro negative + apply profile.2 + rintro ⟨f, hf, lower⟩ + exact negative (filter.upward f hf v hv lower) + +end FinalInsertionFamiliesCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.FinalInsertionFamiliesCode +open SetRealization +universe u +variable {Labels P G r μ A c e d F caps actors : ZFSet.{u}} + +noncomputable def decodedCaps + (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) : + SetMembers Labels → SetMembers P := + (SetMembers.presentation Labels).decodeFunction (SetMembers.presentation P) + caps family.cap_injection.function + +noncomputable def decodedActors + (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) : + SetMembers Labels → SetMembers G := + (SetMembers.presentation Labels).decodeFunction (SetMembers.presentation G) + actors family.actor_injection.function + +theorem decodedCaps_entry + (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) + (label : SetMembers Labels) : + ZFSet.pair (SetMembers.raw label) (SetMembers.raw (family.decodedCaps label)) ∈ caps := + (SetMembers.presentation Labels).decodeFunction_mem (SetMembers.presentation P) + caps family.cap_injection.function label + +theorem decodedActors_entry + (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) + (label : SetMembers Labels) : + ZFSet.pair (SetMembers.raw label) (SetMembers.raw (family.decodedActors label)) ∈ actors := + (SetMembers.presentation Labels).decodeFunction_mem (SetMembers.presentation G) + actors family.actor_injection.function label + +theorem hasInsertionFamily {m inv one : ZFSet.{u}} {c e d : SetMembers P} + (family : FinalInsertionFamiliesCode Labels P G r μ A + (SetMembers.raw c) (SetMembers.raw e) (SetMembers.raw d) F caps actors) + (group : GroupCode G m inv one) (meet : MeetOrderCode P r μ) + (action : PosetActionCode G P m one r A) (filter : MeetFilterCode P r μ F) : + letI := group.toGroup + Compression.RecursiveMaps.HasInsertionFamily (action.toOrderAction group meet) + (SetMembers Labels) c e d (fun x => SetMembers.raw x ∈ F) := by + let := group.toGroup + refine ⟨family.decodedCaps, family.decodedActors, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro label z lower + apply (action.toOrderAction_eq_iff group meet (family.decodedActors label) z z).2 + exact family.fixes _ _ (family.decodedActors_entry label) _ (SetMembers.raw_mem z) lower + · intro label + exact family.dominates _ _ _ (family.decodedActors_entry label) (family.decodedCaps_entry label) + _ (SetMembers.raw_mem _) (action.toOrderAction_entry group meet (family.decodedActors label) d) + · intro label + have profile := family.profiles _ _ (family.decodedCaps_entry label) + exact ⟨profile.target_below_cap, profile.cap_not_below_target⟩ + · intro label + exact (family.profiles _ _ (family.decodedCaps_entry label)).separator_not_below_cap + · intro first second different + apply (meet.toSmallMeetOrder_meet_eq_iff _ _ _).2 + exact family.meets _ _ _ _ (family.decodedCaps_entry first) (family.decodedCaps_entry second) + (fun equal => different ((SetMembers.raw_injective Labels) equal)) + · intro label x above + have tests := family.tests meet.order filter (family.decodedCaps_entry label) + (SetMembers.raw_mem x) above + exact ⟨tests.1, fun negative => (meet.toSmallMeetOrder_meet_eq_iff _ _ _).2 (tests.2 negative)⟩ + +end PartitionPilot.Forcing.FinalInsertionFamiliesCode + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +private def capExceptionTest (profiles : Bool) (r c x cap : ZFSet.{u}) : Prop := + if profiles then c ∉ x ∧ cap ∈ x + else ZFSet.pair x c ∉ r ∧ ZFSet.pair x cap ∈ r + +private noncomputable def capExceptionRelation + (profiles : Bool) (S Labels P r c caps : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ S, ∃ label ∈ Labels, ∃ cap ∈ P, + z = ZFSet.pair x label ∧ ZFSet.pair label cap ∈ caps ∧ + capExceptionTest profiles r c x cap) (ZFSet.prod S Labels) + +private theorem pair_mem_capExceptionRelation + (profiles : Bool) (S Labels P r c caps x label : ZFSet.{u}) : + ZFSet.pair x label ∈ capExceptionRelation profiles S Labels P r c caps ↔ + x ∈ S ∧ label ∈ Labels ∧ ∃ cap ∈ P, ZFSet.pair label cap ∈ caps ∧ + capExceptionTest profiles r c x cap := by + rw [capExceptionRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, y, hy, l, hl, cap, hcap, eq, entry, test⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hy, hl, cap, hcap, entry, test⟩ + · rintro ⟨hx, hl, cap, hcap, entry, test⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hl⟩, x, hx, label, hl, cap, hcap, + rfl, entry, test⟩ + +private def capExceptionEntryFormula {n} + (profiles : Bool) (z s labels p r c caps : Fin n) : BoundedFormula n := + BoundedFormula.exMem s (BoundedFormula.exMem labels.succ + (BoundedFormula.exMem p.succ.succ + (.conj (BoundedFormula.orderedPairFormula z.succ.succ.succ 2 1) + (.conj (BoundedFormula.pairMembershipFormula 1 0 caps.succ.succ.succ) + (if profiles then .conj (.neg (.mem c.succ.succ.succ 2)) (.mem 0 2) + else .conj (.neg (BoundedFormula.pairMembershipFormula 2 c.succ.succ.succ r.succ.succ.succ)) + (BoundedFormula.pairMembershipFormula 2 0 r.succ.succ.succ)))))) + +private theorem truth_capExceptionEntryFormula {n} + (profiles : Bool) (z s labels p r c caps : Fin n) (env : Fin n → ZFSet.{u}) : + BoundedFormula.Truth (capExceptionEntryFormula profiles z s labels p r c caps) env ↔ + ∃ x ∈ env s, ∃ label ∈ env labels, ∃ cap ∈ env p, + env z = ZFSet.pair x label ∧ ZFSet.pair label cap ∈ env caps ∧ + capExceptionTest profiles (env r) (env c) x cap := by + cases profiles <;> + simp only [capExceptionEntryFormula, capExceptionTest, Bool.false_eq_true, ↓reduceIte, + BoundedFormula.truth_exMem, BoundedFormula.Truth, + BoundedFormula.truth_orderedPairFormula, BoundedFormula.truth_pairMembershipFormula] <;> rfl + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +private theorem capExceptionRelation_mem + (profiles : Bool) {S Labels P r c caps : ZFSet.{u}} + (hS : S ∈ M.sets) (hLabels : Labels ∈ M.sets) (hP : P ∈ M.sets) + (hr : r ∈ M.sets) (hc : c ∈ M.sets) (hCaps : caps ∈ M.sets) : + capExceptionRelation profiles S Labels P r c caps ∈ M.sets := by + let params := extend S (extend Labels (extend P (extend r (extend c (extend caps Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (capExceptionEntryFormula profiles 0 1 2 3 4 5 6) params + (Fin.cases hS (Fin.cases hLabels (Fin.cases hP (Fin.cases hr + (Fin.cases hc (Fin.cases hCaps (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hS hLabels) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (capExceptionEntryFormula profiles 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod S Labels) = capExceptionRelation profiles S Labels P r c caps := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, capExceptionRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (truth_capExceptionEntryFormula profiles 0 1 2 3 4 5 6 _) + exact eq ▸ selected + +private theorem partial_image_countable + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {S Labels rel : ZFSet.{u}} (hS : S ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hRel : rel ∈ M.sets) (code : PartialFunctionCode S Labels rel) + (smallS : M.groundEmbeddable S ZFSet.omega) : + M.groundEmbeddable (relationImage S Labels rel) ZFSet.omega := by + have hImage := M.relationImage_mem separation hS hLabels hRel + have restricted : PartialFunctionCode S (relationImage S Labels rel) rel := by + refine ⟨?_, code.unique⟩ + intro z hz + obtain ⟨x, hx, label, hl, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, (mem_relationImage _ _ _ _).2 ⟨hl, x, hx, hz⟩⟩ + obtain ⟨f, hf, injection⟩ := M.groundEmbeddable_of_partial_surjection + pairing unions powers separation choice hS hImage hRel restricted + (fun label member => ((mem_relationImage _ _ _ label).1 member).2) + obtain ⟨g, hg, count⟩ := smallS + exact ⟨relationCompose (relationImage S Labels rel) S ZFSet.omega f g, + M.relationCompose_mem pairing unions powers separation hImage hS + (M.omega_mem separation infinite) hf hg, injection.compose count⟩ +end TransitiveGround + +namespace FinalInsertionFamiliesCode + +theorem exists_ground_countable_exceptions + {Labels P G r μ A c e d F caps actors Used Profiles extra : ZFSet.{u}} + (family : FinalInsertionFamiliesCode Labels P G r μ A c e d F caps actors) + (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hLabels : Labels ∈ M.sets) (hP : P ∈ M.sets) (hr : r ∈ M.sets) + (hc : c ∈ M.sets) (hCaps : caps ∈ M.sets) + (hUsed : Used ∈ M.sets) (hProfiles : Profiles ∈ M.sets) (hExtra : extra ∈ M.sets) + (meet : MeetOrderCode P r μ) (usedSubset : Used ⊆ P) + (filters : ∀ profile ∈ Profiles, MeetFilterCode P r μ profile) + (smallUsed : M.groundEmbeddable Used ZFSet.omega) + (smallProfiles : M.groundEmbeddable Profiles ZFSet.omega) + (smallExtra : M.groundEmbeddable extra ZFSet.omega) (extraSubset : extra ⊆ Labels) : + ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ + ∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → + (∀ node ∈ Used, ZFSet.pair node cap ∈ r → ZFSet.pair node c ∈ r) ∧ + (∀ profile ∈ Profiles, c ∉ profile → cap ∉ profile) := by + classical + let nodes := capExceptionRelation false Used Labels P r c caps + let profiles := capExceptionRelation true Profiles Labels P r c caps + have hNodes : nodes ∈ M.sets := M.capExceptionRelation_mem pairing unions powers separation + false hUsed hLabels hP hr hc hCaps + have hProfilesRel : profiles ∈ M.sets := M.capExceptionRelation_mem pairing unions powers separation + true hProfiles hLabels hP hr hc hCaps + have nodesPartial : PartialFunctionCode Used Labels nodes := by + refine ⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩ + intro node first second one two + obtain ⟨used, _, cap₁, _, entry₁, negative, below₁⟩ := + (pair_mem_capExceptionRelation false Used Labels P r c caps node first).1 one + obtain ⟨_, _, cap₂, _, entry₂, _, below₂⟩ := + (pair_mem_capExceptionRelation false Used Labels P r c caps node second).1 two + by_contra different + exact negative (meet.greatest cap₁ cap₂ c node (usedSubset used) + (family.meets first second cap₁ cap₂ entry₁ entry₂ different) below₁ below₂) + have profilesPartial : PartialFunctionCode Profiles Labels profiles := by + refine ⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩ + intro profile first second one two + obtain ⟨used, _, cap₁, _, entry₁, negative, positive₁⟩ := + (pair_mem_capExceptionRelation true Profiles Labels P r c caps profile first).1 one + obtain ⟨_, _, cap₂, _, entry₂, _, positive₂⟩ := + (pair_mem_capExceptionRelation true Profiles Labels P r c caps profile second).1 two + by_contra different + exact negative ((filters profile used).closed_meet cap₁ positive₁ cap₂ positive₂ c + (family.meets first second cap₁ cap₂ entry₁ entry₂ different)) + let nodeBad := relationImage Used Labels nodes + let profileBad := relationImage Profiles Labels profiles + have hNodeBad : nodeBad ∈ M.sets := M.relationImage_mem separation hUsed hLabels hNodes + have hProfileBad : profileBad ∈ M.sets := M.relationImage_mem separation hProfiles hLabels hProfilesRel + have nodeSmall := M.partial_image_countable pairing unions powers separation infinite choice + hUsed hLabels hNodes nodesPartial smallUsed + have profileSmall := M.partial_image_countable pairing unions powers separation infinite choice + hProfiles hLabels hProfilesRel profilesPartial smallProfiles + have hBoth := M.binary_union_mem pairing unions hNodeBad hProfileBad + have smallBoth := M.groundCountable_binary_union pairing unions powers separation infinite choice + hNodeBad hProfileBad nodeSmall profileSmall + refine ⟨(nodeBad ∪ profileBad) ∪ extra, M.binary_union_mem pairing unions hBoth hExtra, ?_, + M.groundCountable_binary_union pairing unions powers separation infinite choice + hBoth hExtra smallBoth smallExtra, ?_, ?_⟩ + · intro label member + rcases ZFSet.mem_union.1 member with both | more + · rcases ZFSet.mem_union.1 both with node | profile + · exact ((mem_relationImage _ _ _ _).1 node).1 + · exact ((mem_relationImage _ _ _ _).1 profile).1 + · exact extraSubset more + · intro label member + exact ZFSet.mem_union.2 (Or.inr member) + · intro label cap entry good + have bounds := ZFSet.pair_mem_prod.1 (family.cap_injection.function.1 entry) + constructor + · intro node used below + by_contra negative + apply good + apply ZFSet.mem_union.2 ∘ Or.inl + apply ZFSet.mem_union.2 ∘ Or.inl + exact (mem_relationImage _ _ _ _).2 ⟨bounds.1, node, used, + (pair_mem_capExceptionRelation false Used Labels P r c caps node label).2 + ⟨used, bounds.1, cap, bounds.2, entry, negative, below⟩⟩ + · intro profile used negative positive + apply good + apply ZFSet.mem_union.2 ∘ Or.inl + apply ZFSet.mem_union.2 ∘ Or.inr + exact (mem_relationImage _ _ _ _).2 ⟨bounds.1, profile, used, + (pair_mem_capExceptionRelation true Profiles Labels P r c caps profile label).2 + ⟨used, bounds.1, cap, bounds.2, entry, negative, positive⟩⟩ + +end FinalInsertionFamiliesCode +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteAccounting.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteAccounting.lean index a26f10c2cbd93c0fb162f8c9e8dd738f48ba5391..427f5864d4d39c1be34607edabd4c61f1883fa7a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteAccounting.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteAccounting.lean @@ -1,101 +1,101 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionHistory - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem successor_coherent : RecursiveStateCoherence I state.data - (state.data.successor M I Sources Reps G T) := by - obtain ⟨next, _, _, _, _, _, _, _, _, _, entries, inputs, _⟩ := - state.task.exists_groundSuccessor M pairing unions powers separation - (state.invariant.compatible state.task) hI state.ground.indices state.ground.carrier - state.ground.order state.ground.spaces state.ground.relations state.ground.meets - state.ground.anchors state.ground.embeddings state.ground.filters state.ground.separators - state.ground.maps hSources hReps hG state.ground.action hT - have result := state.inputs.next_coherent M next entries inputs - rw [state.inputs.toState_successor M next inputs, state.inputs_toState] at result - exact result - -theorem canonical_iterate_coherent {n k : Nat} (before : n ≤ k) : - RecursiveStateCoherence I (state.data.iterate M I Sources Reps G T n) - (state.data.iterate M I Sources Reps G T k) := by - induction k, before using Nat.le_induction with - | base => - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - rw [← equal] - exact RecursiveStateCoherence.refl current.inputs.maps - | succ k _ ih => - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT k - have step := current.successor_coherent pairing unions powers separation hI hSources hReps hG hT - rw [equal, ← RecursiveStateData.iterate_succ] at step - apply ih.trans step - rw [← equal] - exact current.inputs.maps - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem successor_accounting (accounted : FiniteCompressionAccounting P0 I Sources τ state.data) : - FiniteCompressionAccounting P0 I Sources τ (state.data.successor M I Sources Reps G T) := by - obtain ⟨next, _, _, _, _, _, _, _, _, _, entries, inputs, _⟩ := - state.task.exists_groundSuccessor M pairing unions powers separation - (state.invariant.compatible state.task) hI state.ground.indices state.ground.carrier - state.ground.order state.ground.spaces state.ground.relations state.ground.meets - state.ground.anchors state.ground.embeddings state.ground.filters state.ground.separators - state.ground.maps hSources hReps hG state.ground.action hT - have old : FiniteCompressionAccounting P0 I Sources τ state.inputs.toState := - state.inputs_toState.symm ▸ accounted - have result := state.inputs.accounting_next M next entries inputs - (state.invariant.originalSubset seed.top_mem) state.invariant.top old - rw [state.inputs.toState_successor M next inputs, state.inputs_toState] at result - exact result - -theorem canonical_iterate_accounting - (initial : FiniteCompressionAccounting P0 I Sources τ state.data) (n : Nat) : - FiniteCompressionAccounting P0 I Sources τ (state.data.iterate M I Sources Reps G T n) := by - induction n with - | zero => exact initial - | succ n ih => - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have step := current.successor_accounting pairing unions powers separation hI hSources hReps hG hT - (equal.symm ▸ ih) - rw [equal, ← RecursiveStateData.iterate_succ] at step - exact step - -end PartitionPilot.Forcing.GroundCompressionState - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionHistory + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem successor_coherent : RecursiveStateCoherence I state.data + (state.data.successor M I Sources Reps G T) := by + obtain ⟨next, _, _, _, _, _, _, _, _, _, entries, inputs, _⟩ := + state.task.exists_groundSuccessor M pairing unions powers separation + (state.invariant.compatible state.task) hI state.ground.indices state.ground.carrier + state.ground.order state.ground.spaces state.ground.relations state.ground.meets + state.ground.anchors state.ground.embeddings state.ground.filters state.ground.separators + state.ground.maps hSources hReps hG state.ground.action hT + have result := state.inputs.next_coherent M next entries inputs + rw [state.inputs.toState_successor M next inputs, state.inputs_toState] at result + exact result + +theorem canonical_iterate_coherent {n k : Nat} (before : n ≤ k) : + RecursiveStateCoherence I (state.data.iterate M I Sources Reps G T n) + (state.data.iterate M I Sources Reps G T k) := by + induction k, before using Nat.le_induction with + | base => + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + rw [← equal] + exact RecursiveStateCoherence.refl current.inputs.maps + | succ k _ ih => + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT k + have step := current.successor_coherent pairing unions powers separation hI hSources hReps hG hT + rw [equal, ← RecursiveStateData.iterate_succ] at step + apply ih.trans step + rw [← equal] + exact current.inputs.maps + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem successor_accounting (accounted : FiniteCompressionAccounting P0 I Sources τ state.data) : + FiniteCompressionAccounting P0 I Sources τ (state.data.successor M I Sources Reps G T) := by + obtain ⟨next, _, _, _, _, _, _, _, _, _, entries, inputs, _⟩ := + state.task.exists_groundSuccessor M pairing unions powers separation + (state.invariant.compatible state.task) hI state.ground.indices state.ground.carrier + state.ground.order state.ground.spaces state.ground.relations state.ground.meets + state.ground.anchors state.ground.embeddings state.ground.filters state.ground.separators + state.ground.maps hSources hReps hG state.ground.action hT + have old : FiniteCompressionAccounting P0 I Sources τ state.inputs.toState := + state.inputs_toState.symm ▸ accounted + have result := state.inputs.accounting_next M next entries inputs + (state.invariant.originalSubset seed.top_mem) state.invariant.top old + rw [state.inputs.toState_successor M next inputs, state.inputs_toState] at result + exact result + +theorem canonical_iterate_accounting + (initial : FiniteCompressionAccounting P0 I Sources τ state.data) (n : Nat) : + FiniteCompressionAccounting P0 I Sources τ (state.data.iterate M I Sources Reps G T n) := by + induction n with + | zero => exact initial + | succ n ih => + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have step := current.successor_accounting pairing unions powers separation hI hSources hReps hG hT + (equal.symm ▸ ih) + rw [equal, ← RecursiveStateData.iterate_succ] at step + exact step + +end PartitionPilot.Forcing.GroundCompressionState + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteSeedBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteSeedBounds.lean index cd5becc3edf7e1c701aecdc04d95df67d4d90c2c..c98f5028c12db3b04b0af9102950fb8a839ce903 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteSeedBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteSeedBounds.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundHistoryUnionBounds - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem natSetCode_identity_injection_omega (n : Nat) : - InjectionCode (natSetCode n) ZFSet.omega (identityFunctionGraph (natSetCode n) : ZFSet.{u}) := by - apply (identityFunctionGraph_injection (natSetCode n)).retarget - intro x hx - obtain ⟨k, _, rfl⟩ := (mem_natSetCode x n).1 hx - exact natSetCode_mem_omega k - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem natSetCode_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (n : Nat) : - M.groundEmbeddable (natSetCode n) ZFSet.omega := - ⟨identityFunctionGraph (natSetCode n), - M.identityFunctionGraph_mem pairing unions powers separation - (M.natSetCode_mem separation infinite n), natSetCode_identity_injection_omega n⟩ - -end TransitiveGround - -namespace GroundInaccessibleConditions -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} - -theorem finite_seed_bounds (conditions : GroundInaccessibleConditions M K) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) (n : Nat) : - natSetCode n ∈ M.sets ∧ M.groundEmbeddable (natSetCode n) ZFSet.omega ∧ - GroundBelow M (natSetCode n) K ∧ ZFSet.rank (natSetCode n) < ZFSet.rank K := by - have bounds := conditions.natural pairing unions powers separation infinite hK n - exact ⟨bounds.1, M.natSetCode_countable pairing unions powers separation infinite n, - bounds.2, rank_natSetCode_lt - (conditions.rank_isLimit pairing unions powers separation infinite hK) n⟩ - -end GroundInaccessibleConditions - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundHistoryUnionBounds + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem natSetCode_identity_injection_omega (n : Nat) : + InjectionCode (natSetCode n) ZFSet.omega (identityFunctionGraph (natSetCode n) : ZFSet.{u}) := by + apply (identityFunctionGraph_injection (natSetCode n)).retarget + intro x hx + obtain ⟨k, _, rfl⟩ := (mem_natSetCode x n).1 hx + exact natSetCode_mem_omega k + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem natSetCode_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (n : Nat) : + M.groundEmbeddable (natSetCode n) ZFSet.omega := + ⟨identityFunctionGraph (natSetCode n), + M.identityFunctionGraph_mem pairing unions powers separation + (M.natSetCode_mem separation infinite n), natSetCode_identity_injection_omega n⟩ + +end TransitiveGround + +namespace GroundInaccessibleConditions +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} + +theorem finite_seed_bounds (conditions : GroundInaccessibleConditions M K) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) (n : Nat) : + natSetCode n ∈ M.sets ∧ M.groundEmbeddable (natSetCode n) ZFSet.omega ∧ + GroundBelow M (natSetCode n) K ∧ ZFSet.rank (natSetCode n) < ZFSet.rank K := by + have bounds := conditions.natural pairing unions powers separation infinite hK n + exact ⟨bounds.1, M.natSetCode_countable pairing unions powers separation infinite n, + bounds.2, rank_natSetCode_lt + (conditions.rank_isLimit pairing unions powers separation infinite hK) n⟩ + +end GroundInaccessibleConditions + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLaws.lean index 31516f1e922dc67dc47a00c22f7825936378f44e..2e03e47b439cd9401b9ddc669a6e6a9a6d007cc2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLaws.lean @@ -1,874 +1,874 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordOperationFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalAlphabetInversion -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteWordLength -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundNaturalRecursion - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def natSuccessorEntryFormula {k} (z w : Fin k) : BoundedFormula k := - exMem w (exMem w.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (successorFormula 0 1))) - -theorem truth_natSuccessorEntryFormula {k} (z w : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (natSuccessorEntryFormula z w) env ↔ - ∃ a ∈ env w, ∃ b ∈ env w, env z = ZFSet.pair a b ∧ b = insert a a := by - simp only [natSuccessorEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_successorFormula] - rfl - -def natAddEntryFormula {k} (z w step traces zero : Fin k) : BoundedFormula k := - exMem w (exMem w.succ (exMem w.succ.succ (exMem w.succ.succ.succ - (exMem traces.succ.succ.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ 4 3 2) - (.conj (successorFormula 1 3) - (.conj (iterationTraceFormula 3 1 w.succ.succ.succ.succ.succ - step.succ.succ.succ.succ.succ 4 0 zero.succ.succ.succ.succ.succ) - (pairMembershipFormula 3 2 0)))))))) - -theorem truth_natAddEntryFormula {k} (z w step traces zero : Fin k) - (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : - Truth (natAddEntryFormula z w step traces zero) env ↔ - ∃ a ∈ env w, ∃ b ∈ env w, ∃ c ∈ env w, ∃ d ∈ env w, ∃ t ∈ env traces, - env z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ - IterationTraceCode b d (env w) (env step) a t ∧ ZFSet.pair b c ∈ t := by - simp only [natAddEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_successorFormula, truth_pairMembershipFormula] - apply exists_congr - intro a - apply and_congr_right - intro _ - apply exists_congr - intro b - apply and_congr_right - intro _ - apply exists_congr - intro c - apply and_congr_right - intro _ - apply exists_congr - intro d - apply and_congr_right - intro _ - apply exists_congr - intro t - apply and_congr_right - intro _ - exact and_congr Iff.rfl (and_congr Iff.rfl (and_congr - (truth_iterationTraceFormula _ _ _ _ _ _ _ _ (by exact hzero)) Iff.rfl)) - -def natMulEntryFormula {k} (z w family traces zero : Fin k) : BoundedFormula k := - exMem w (exMem w.succ (exMem w.succ.succ (exMem w.succ.succ.succ - (exMem traces.succ.succ.succ.succ (exMem traces.succ.succ.succ.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ.succ 5 4 3) - (.conj (successorFormula 2 4) - (.conj (pairMembershipFormula 5 0 family.succ.succ.succ.succ.succ.succ) - (.conj (iterationTraceFormula 4 2 w.succ.succ.succ.succ.succ.succ - 0 zero.succ.succ.succ.succ.succ.succ 1 zero.succ.succ.succ.succ.succ.succ) - (pairMembershipFormula 4 3 1)))))))))) - -theorem truth_natMulEntryFormula {k} (z w family traces zero : Fin k) - (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : - Truth (natMulEntryFormula z w family traces zero) env ↔ - ∃ a ∈ env w, ∃ b ∈ env w, ∃ c ∈ env w, ∃ d ∈ env w, - ∃ t ∈ env traces, ∃ step ∈ env traces, - env z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ - ZFSet.pair a step ∈ env family ∧ - IterationTraceCode b d (env w) step ∅ t ∧ ZFSet.pair b c ∈ t := by - simp only [natMulEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_successorFormula, truth_pairMembershipFormula] - apply exists_congr - intro a - apply and_congr_right - intro _ - apply exists_congr - intro b - apply and_congr_right - intro _ - apply exists_congr - intro c - apply and_congr_right - intro _ - apply exists_congr - intro d - apply and_congr_right - intro _ - apply exists_congr - intro t - apply and_congr_right - intro _ - apply exists_congr - intro step - apply and_congr_right - intro _ - apply and_congr_right - intro _ - apply and_congr_right - intro _ - apply and_congr_right - intro _ - have correct := truth_iterationTraceFormula 4 2 w.succ.succ.succ.succ.succ.succ - 0 zero.succ.succ.succ.succ.succ.succ 1 zero.succ.succ.succ.succ.succ.succ - (extend step (extend t (extend d (extend c (extend b (extend a env)))))) (by exact hzero) - constructor - · rintro ⟨h, entry⟩ - have trace := correct.1 h - change IterationTraceCode b d (env w) step (env zero) t at trace - exact ⟨by simpa only [hzero] using trace, entry⟩ - · rintro ⟨trace, entry⟩ - refine ⟨correct.2 ?_, entry⟩ - change IterationTraceCode b d (env w) step (env zero) t - simpa only [hzero] using trace - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem natSuccessorGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : natSuccessorGraph ∈ M.sets := by - have hw := M.omega_mem separation infinite - have bound := M.prod_mem pairing unions powers separation hw hw - let params := extend ZFSet.omega Fin.elim0 - have selected := M.bounded_separation_mem separation - (BoundedFormula.natSuccessorEntryFormula 0 1) params - (Fin.cases hw (fun i => Fin.elim0 i)) bound - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.natSuccessorEntryFormula 0 1) (extend z params)) - (ZFSet.prod ZFSet.omega ZFSet.omega) = natSuccessorGraph := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_natSuccessorEntryFormula] - change (z ∈ ZFSet.prod ZFSet.omega ZFSet.omega ∧ ∃ a ∈ ZFSet.omega, - ∃ b ∈ ZFSet.omega, z = ZFSet.pair a b ∧ b = insert a a) ↔ _ - constructor - · rintro ⟨_, a, ha, b, _, rfl, rfl⟩ - obtain ⟨a, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha - exact (pair_mem_natSuccessorGraph a (a + 1)).2 rfl - · intro hz - have shape := natSuccessorGraph_isFunc.1 hz - obtain ⟨a, rfl⟩ := (natPresentation.mem_graph natPresentation - (fun n => ⟨n.down + 1⟩) z).1 hz - exact ⟨shape, natSetCode a.down, natPresentation.encode_mem a, - natSetCode (a.down + 1), natPresentation.encode_mem ⟨a.down + 1⟩, rfl, rfl⟩ - exact equal ▸ selected - -theorem naturalFiniteTrace_mem_relations - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (f : ULift.{u} Nat → ULift.{u} Nat) (a n : Nat) : - finiteIterationTrace natPresentation f ⟨a⟩ n ∈ M.groundRelations ZFSet.omega ZFSet.omega := by - refine (M.mem_groundRelations _ _ _).2 - ⟨M.finiteIterationTrace_mem pairing unions separation infinite natPresentation f ⟨a⟩ n - (M.omega_mem separation infinite), ?_⟩ - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 - ((finiteIterationTrace_code natPresentation f ⟨a⟩ n).function.1 hz) - obtain ⟨k, _, rfl⟩ := (mem_natSetCode x (n + 1)).1 hx - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega k, hy⟩ - -theorem natAddGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : natAddGraph ∈ M.sets := by - have hw := M.omega_mem separation infinite - have hs := M.natSuccessorGraph_mem pairing unions powers separation infinite - have hz := M.empty_mem ⟨ZFSet.omega, hw⟩ - let T := M.groundRelations ZFSet.omega ZFSet.omega - have ht := M.groundRelations_mem pairing unions powers separation hw hw - let P := ZFSet.prod (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega - have hp := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hw hw) hw - let params := extend ZFSet.omega (extend natSuccessorGraph (extend T (extend ∅ Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.natAddEntryFormula 0 1 2 3 4) params - (Fin.cases hw (Fin.cases hs (Fin.cases ht (Fin.cases hz (fun i => Fin.elim0 i))))) hp - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.natAddEntryFormula 0 1 2 3 4) (extend z params)) P = natAddGraph := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_natAddEntryFormula _ _ _ _ _ _ rfl] - change (z ∈ P ∧ ∃ a ∈ ZFSet.omega, ∃ b ∈ ZFSet.omega, ∃ c ∈ ZFSet.omega, - ∃ d ∈ ZFSet.omega, ∃ t ∈ T, z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ - IterationTraceCode b d ZFSet.omega natSuccessorGraph a t ∧ ZFSet.pair b c ∈ t) ↔ _ - constructor - · rintro ⟨_, a, ha, b, hb, c, hc, d, _, t, _, rfl, rfl, trace, entry⟩ - obtain ⟨a, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha - obtain ⟨b, rfl⟩ := (mem_omega_iff_natSetCode b).1 hb - obtain ⟨c, rfl⟩ := (mem_omega_iff_natSetCode c).1 hc - have value := trace.output natPresentation (fun n => ⟨n.down + 1⟩) ⟨a⟩ entry - have eq : natSetCode c = natSetCode (a + b) := by - simpa only [natIterate_successor, natPresentation] using value - exact (pair_mem_natAddGraph a b c).2 (natSetCode_injective eq) - · intro h - have shape := natAddGraph_isFunc.1 h - obtain ⟨⟨a, b⟩, rfl⟩ := ((natPresentation.product natPresentation).mem_graph - natPresentation (fun n => ⟨n.1.down + n.2.down⟩) z).1 h - let f := fun n : ULift.{u} Nat => (⟨n.down + 1⟩ : ULift.{u} Nat) - let t := finiteIterationTrace natPresentation f a b.down - have code := finiteIterationTrace_code natPresentation f a b.down - refine ⟨shape, natSetCode a.down, natPresentation.encode_mem a, - natSetCode b.down, natPresentation.encode_mem b, natSetCode (a.down + b.down), - natSetCode_mem_omega _, natSetCode (b.down + 1), natSetCode_mem_omega _, t, - M.naturalFiniteTrace_mem_relations pairing unions separation infinite f a.down b.down, - rfl, rfl, code, ?_⟩ - have iterate : natIterate f a b.down = ⟨a.down + b.down⟩ := - natIterate_successor a.down b.down - have output := code.value natPresentation f a b.down (Nat.le_refl _) - rw [iterate] at output - exact output - exact equal ▸ selected - -theorem natMulGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : natMulGraph ∈ M.sets := by - have hw := M.omega_mem separation infinite - have hadd := M.natAddGraph_mem pairing unions powers separation infinite - have hz := M.empty_mem ⟨ZFSet.omega, hw⟩ - let T := M.groundRelations ZFSet.omega ZFSet.omega - have ht := M.groundRelations_mem pairing unions powers separation hw hw - let family := M.indexedRelationSections ZFSet.omega ZFSet.omega ZFSet.omega natAddGraph - have spec := M.indexedRelationSections_spec pairing unions powers separation hw hw hw hadd - let P := ZFSet.prod (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega - have hp := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hw hw) hw - let params := extend ZFSet.omega (extend family (extend T (extend ∅ Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.natMulEntryFormula 0 1 2 3 4) params - (Fin.cases hw (Fin.cases spec.1 (Fin.cases ht (Fin.cases hz (fun i => Fin.elim0 i))))) hp - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.natMulEntryFormula 0 1 2 3 4) (extend z params)) P = natMulGraph := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_natMulEntryFormula _ _ _ _ _ _ rfl] - change (z ∈ P ∧ ∃ a ∈ ZFSet.omega, ∃ b ∈ ZFSet.omega, ∃ c ∈ ZFSet.omega, - ∃ d ∈ ZFSet.omega, ∃ t ∈ T, ∃ step ∈ T, - z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ ZFSet.pair a step ∈ family ∧ - IterationTraceCode b d ZFSet.omega step ∅ t ∧ ZFSet.pair b c ∈ t) ↔ _ - constructor - · rintro ⟨_, a, ha, b, hb, c, hc, d, _, t, _, step, _, rfl, rfl, member, trace, entry⟩ - obtain ⟨a, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha - obtain ⟨b, rfl⟩ := (mem_omega_iff_natSetCode b).1 hb - obtain ⟨c, rfl⟩ := (mem_omega_iff_natSetCode c).1 hc - have eqStep : step = natAddSection a := - ((spec.2.2 _ _).1 member).2.trans (natAddSection_eq a).symm - rw [eqStep] at trace - have value := trace.output natPresentation (fun n => ⟨a + n.down⟩) ⟨0⟩ entry - have eq : natSetCode c = natSetCode (a * b) := by - simpa only [natIterate_add, natPresentation] using value - exact (pair_mem_natMulGraph a b c).2 (natSetCode_injective eq) - · intro h - have shape := natMulGraph_isFunc.1 h - obtain ⟨⟨a, b⟩, rfl⟩ := ((natPresentation.product natPresentation).mem_graph - natPresentation (fun n => ⟨n.1.down * n.2.down⟩) z).1 h - let f := fun n : ULift.{u} Nat => (⟨a.down + n.down⟩ : ULift.{u} Nat) - let t := finiteIterationTrace natPresentation f ⟨0⟩ b.down - have code := finiteIterationTrace_code natPresentation f ⟨0⟩ b.down - have member : ZFSet.pair (natSetCode a.down) (natAddSection a.down) ∈ family := - (spec.2.2 _ _).2 ⟨natPresentation.encode_mem a, natAddSection_eq a.down⟩ - have stepBound : natAddSection a.down ∈ T := (ZFSet.pair_mem_prod.1 (spec.2.1.1 member)).2 - refine ⟨shape, natSetCode a.down, natPresentation.encode_mem a, - natSetCode b.down, natPresentation.encode_mem b, natSetCode (a.down * b.down), - natSetCode_mem_omega _, natSetCode (b.down + 1), natSetCode_mem_omega _, t, - M.naturalFiniteTrace_mem_relations pairing unions separation infinite f 0 b.down, - natAddSection a.down, stepBound, rfl, rfl, member, code, ?_⟩ - simpa only [t, f, natIterate_add, natPresentation] using code.value natPresentation f ⟨0⟩ b.down (Nat.le_refl _) - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace BoundedFormula - -def finiteWordMapEntryFormula {k} (z wordsA wordsB omega a b e : Fin k) : BoundedFormula k := - exMem wordsA (exMem wordsB.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (finiteWordMapFormula omega.succ.succ a.succ.succ b.succ.succ e.succ.succ 1 0))) - -theorem truth_finiteWordMapEntryFormula {k} (z wordsA wordsB omega a b e : Fin k) - (env : Fin k → ZFSet.{u}) : - Truth (finiteWordMapEntryFormula z wordsA wordsB omega a b e) env ↔ - ∃ f ∈ env wordsA, ∃ g ∈ env wordsB, env z = ZFSet.pair f g ∧ - FiniteWordMapCode (env omega) (env a) (env b) (env e) f g := by - simp only [finiteWordMapEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_finiteWordMapFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def finiteWordMapGraph (A B e : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ g ∈ M.finiteWords B, - z = ZFSet.pair f g ∧ FiniteWordMapCode ZFSet.omega A B e f g) - (ZFSet.prod (M.finiteWords A) (M.finiteWords B)) - -theorem pair_mem_finiteWordMapGraph (A B e f g : ZFSet.{u}) : - ZFSet.pair f g ∈ M.finiteWordMapGraph A B e ↔ - f ∈ M.finiteWords A ∧ g ∈ M.finiteWords B ∧ - FiniteWordMapCode ZFSet.omega A B e f g := by - rw [finiteWordMapGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, x, hx, y, hy, eq, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hx, hy, code⟩ - · rintro ⟨hf, hg, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hg⟩, f, hf, g, hg, rfl, code⟩ - -theorem finiteWordMapGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A B e : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) : - M.finiteWordMapGraph A B e ∈ M.sets := by - have hw := M.omega_mem separation infinite - have hWA := M.finiteWords_mem pairing unions powers separation infinite hA - have hWB := M.finiteWords_mem pairing unions powers separation infinite hB - let params := extend ZFSet.omega (extend A (extend B (extend e - (extend (M.finiteWords A) (extend (M.finiteWords B) Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.finiteWordMapEntryFormula 0 5 6 1 2 3 4) params - (Fin.cases hw (Fin.cases hA (Fin.cases hB (Fin.cases he - (Fin.cases hWA (Fin.cases hWB (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hWA hWB) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.finiteWordMapEntryFormula 0 5 6 1 2 3 4) (extend z params)) - (ZFSet.prod (M.finiteWords A) (M.finiteWords B)) = M.finiteWordMapGraph A B e := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, finiteWordMapGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_finiteWordMapEntryFormula 0 5 6 1 2 3 4 _) - exact eq ▸ selected - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable {B D : Type u} (s : Presentation B) (t : Presentation D) (e : B → D) -variable (hB : s.carrier ∈ M.sets) (hD : t.carrier ∈ M.sets) - -theorem finiteWordMapGraph_eq_graph : - M.finiteWordMapGraph s.carrier t.carrier (s.graph t e) = - (finiteWordPresentation s M pairing unions separation infinite hB).graph - (finiteWordPresentation t M pairing unions separation infinite hD) (List.map e) := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - change z ∈ M.finiteWordMapGraph s.carrier t.carrier (s.graph t e) ↔ - ∃ xs, ZFSet.pair (finiteWordGraph s xs) (finiteWordGraph t (xs.map e)) = z - constructor - · intro hz - obtain ⟨f, hf, g, hg, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - obtain ⟨xs, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB f).1 hf - obtain ⟨ys, rfl⟩ := (finiteWords_exact_lists t M pairing unions separation infinite hD g).1 hg - have code := ((M.pair_mem_finiteWordMapGraph _ _ _ _ _).1 hz).2.2 - have eq := (finiteWordMapCode_iff s t e xs ys).1 code - subst ys - exact ⟨xs, rfl⟩ - · rintro ⟨xs, rfl⟩ - exact (M.pair_mem_finiteWordMapGraph _ _ _ _ _).2 - ⟨finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, - finiteWordGraph_mem_finiteWords t M pairing unions separation infinite hD (xs.map e), - (finiteWordMapCode_iff s t e xs (xs.map e)).2 rfl⟩ - -include pairing unions separation infinite hB hD in -theorem finiteWordMapGraph_function : - ZFSet.IsFunc (M.finiteWords s.carrier) (M.finiteWords t.carrier) - (M.finiteWordMapGraph s.carrier t.carrier (s.graph t e)) := by - rw [M.finiteWordMapGraph_eq_graph pairing unions separation infinite s t e hB hD] - exact (finiteWordPresentation s M pairing unions separation infinite hB).graph_isFunc - (finiteWordPresentation t M pairing unions separation infinite hD) _ - -end TransitiveGround - - - - - -namespace BoundedFormula - -def finiteWordAppendEntryFormula {n} (z words alphabet omega add : Fin n) : BoundedFormula n := - exMem words (exMem words.succ (exMem words.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) - (finiteWordAppendFormula alphabet.succ.succ.succ omega.succ.succ.succ - add.succ.succ.succ 2 1 0)))) - -theorem truth_finiteWordAppendEntryFormula {n} (z words alphabet omega add : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (finiteWordAppendEntryFormula z words alphabet omega add) env ↔ - ∃ f ∈ env words, ∃ g ∈ env words, ∃ h ∈ env words, - env z = ZFSet.pair (ZFSet.pair f g) h ∧ - FiniteWordAppendCode (env alphabet) (env omega) (env add) f g h := by - simp only [finiteWordAppendEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_finiteWordAppendFormula] - rfl - -def finiteWordReverseEntryFormula {n} (z words alphabet omega add : Fin n) : BoundedFormula n := - exMem words (exMem words.succ - (.conj (orderedPairFormula z.succ.succ 1 0) - (finiteWordReverseFormula alphabet.succ.succ omega.succ.succ add.succ.succ 1 0))) - -theorem truth_finiteWordReverseEntryFormula {n} (z words alphabet omega add : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (finiteWordReverseEntryFormula z words alphabet omega add) env ↔ - ∃ f ∈ env words, ∃ h ∈ env words, env z = ZFSet.pair f h ∧ - FiniteWordReverseCode (env alphabet) (env omega) (env add) f h := by - simp only [finiteWordReverseEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_finiteWordReverseFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def finiteWordAppendGraph (A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ g ∈ M.finiteWords A, - ∃ h ∈ M.finiteWords A, z = ZFSet.pair (ZFSet.pair f g) h ∧ - FiniteWordAppendCode A ZFSet.omega natAddGraph f g h) - (ZFSet.prod (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) (M.finiteWords A)) - -noncomputable def finiteWordReverseGraph (A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ h ∈ M.finiteWords A, - z = ZFSet.pair f h ∧ FiniteWordReverseCode A ZFSet.omega natAddGraph f h) - (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) - -theorem pair_mem_finiteWordAppendGraph (A f g h : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair f g) h ∈ M.finiteWordAppendGraph A ↔ - f ∈ M.finiteWords A ∧ g ∈ M.finiteWords A ∧ h ∈ M.finiteWords A ∧ - FiniteWordAppendCode A ZFSet.omega natAddGraph f g h := by - rw [finiteWordAppendGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, f', hf, g', hg, h', hh, eq, code⟩ - obtain ⟨fg, rfl⟩ := ZFSet.pair_inj.1 eq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 fg - exact ⟨hf, hg, hh, code⟩ - · rintro ⟨hf, hg, hh, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hf, hg⟩, hh⟩, - f, hf, g, hg, h, hh, rfl, code⟩ - -theorem pair_mem_finiteWordReverseGraph (A f h : ZFSet.{u}) : - ZFSet.pair f h ∈ M.finiteWordReverseGraph A ↔ - f ∈ M.finiteWords A ∧ h ∈ M.finiteWords A ∧ - FiniteWordReverseCode A ZFSet.omega natAddGraph f h := by - rw [finiteWordReverseGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, f', hf, h', hh, eq, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hf, hh, code⟩ - · rintro ⟨hf, hh, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hh⟩, f, hf, h, hh, rfl, code⟩ - -theorem finiteWordAppendGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWordAppendGraph A ∈ M.sets := by - have hWords := M.finiteWords_mem pairing unions powers separation infinite hA - have hOmega := M.omega_mem separation infinite - have hAdd := M.natAddGraph_mem pairing unions powers separation infinite - have domain := M.prod_mem pairing unions powers separation hWords hWords - have bound := M.prod_mem pairing unions powers separation domain hWords - let params := extend (M.finiteWords A) (extend A (extend ZFSet.omega (extend natAddGraph Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.finiteWordAppendEntryFormula 0 1 2 3 4) params - (Fin.cases hWords (Fin.cases hA (Fin.cases hOmega (Fin.cases hAdd (fun j => Fin.elim0 j))))) bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.finiteWordAppendEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) (M.finiteWords A)) = - M.finiteWordAppendGraph A := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, finiteWordAppendGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_finiteWordAppendEntryFormula 0 1 2 3 4 _) - exact eq ▸ selected - -theorem finiteWordReverseGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWordReverseGraph A ∈ M.sets := by - have hWords := M.finiteWords_mem pairing unions powers separation infinite hA - have hOmega := M.omega_mem separation infinite - have hAdd := M.natAddGraph_mem pairing unions powers separation infinite - have bound := M.prod_mem pairing unions powers separation hWords hWords - let params := extend (M.finiteWords A) (extend A (extend ZFSet.omega (extend natAddGraph Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.finiteWordReverseEntryFormula 0 1 2 3 4) params - (Fin.cases hWords (Fin.cases hA (Fin.cases hOmega (Fin.cases hAdd (fun j => Fin.elim0 j))))) bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.finiteWordReverseEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) = M.finiteWordReverseGraph A := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, finiteWordReverseGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_finiteWordReverseEntryFormula 0 1 2 3 4 _) - exact eq ▸ selected - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) - -theorem finiteWordAppendGraph_eq_graph {B : Type u} (s : Presentation B) - (hB : s.carrier ∈ M.sets) : - M.finiteWordAppendGraph s.carrier = - ((finiteWordPresentation s M pairing unions separation infinite hB).product - (finiteWordPresentation s M pairing unions separation infinite hB)).graph - (finiteWordPresentation s M pairing unions separation infinite hB) - (fun p => p.1 ++ p.2) := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - change z ∈ M.finiteWordAppendGraph s.carrier ↔ - ∃ p : List B × List B, ZFSet.pair - (ZFSet.pair (finiteWordGraph s p.1) (finiteWordGraph s p.2)) - (finiteWordGraph s (p.1 ++ p.2)) = z - constructor - · intro hz - obtain ⟨fg, hfg, h, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - obtain ⟨f, hf, g, hg, rfl⟩ := ZFSet.mem_prod.1 hfg - obtain ⟨xs, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB f).1 hf - obtain ⟨ys, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB g).1 hg - have code := ((M.pair_mem_finiteWordAppendGraph _ _ _ _).1 hz).2.2.2 - have eq := (finiteWordAppendCode_iff s xs ys h).1 code - subst h - exact ⟨(xs, ys), rfl⟩ - · rintro ⟨⟨xs, ys⟩, rfl⟩ - exact (M.pair_mem_finiteWordAppendGraph _ _ _ _).2 - ⟨finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, - finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB ys, - finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB (xs ++ ys), - finiteWordGraph_append_code s xs ys⟩ - -theorem finiteWordReverseGraph_eq_graph {B : Type u} (s : Presentation B) - (hB : s.carrier ∈ M.sets) : - M.finiteWordReverseGraph s.carrier = - (finiteWordPresentation s M pairing unions separation infinite hB).graph - (finiteWordPresentation s M pairing unions separation infinite hB) List.reverse := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - change z ∈ M.finiteWordReverseGraph s.carrier ↔ - ∃ xs : List B, ZFSet.pair (finiteWordGraph s xs) (finiteWordGraph s xs.reverse) = z - constructor - · intro hz - obtain ⟨f, hf, h, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - obtain ⟨xs, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB f).1 hf - have code := ((M.pair_mem_finiteWordReverseGraph _ _ _).1 hz).2.2 - have eq := (finiteWordReverseCode_iff s xs h).1 code - subst h - exact ⟨xs, rfl⟩ - · rintro ⟨xs, rfl⟩ - exact (M.pair_mem_finiteWordReverseGraph _ _ _).2 - ⟨finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, - finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs.reverse, - finiteWordGraph_reverse_code s xs⟩ - -include pairing unions separation infinite in -theorem finiteWordAppendGraph_function {A : ZFSet.{u}} (hA : A ∈ M.sets) : - ZFSet.IsFunc (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) (M.finiteWords A) - (M.finiteWordAppendGraph A) := by - let s := SetMembers.presentation A - change ZFSet.IsFunc (ZFSet.prod (M.finiteWords s.carrier) (M.finiteWords s.carrier)) - (M.finiteWords s.carrier) (M.finiteWordAppendGraph s.carrier) - rw [M.finiteWordAppendGraph_eq_graph pairing unions separation infinite s hA] - exact ((finiteWordPresentation s M pairing unions separation infinite hA).product - (finiteWordPresentation s M pairing unions separation infinite hA)).graph_isFunc - (finiteWordPresentation s M pairing unions separation infinite hA) _ - -include pairing unions separation infinite in -theorem finiteWordReverseGraph_function {A : ZFSet.{u}} (hA : A ∈ M.sets) : - ZFSet.IsFunc (M.finiteWords A) (M.finiteWords A) (M.finiteWordReverseGraph A) := by - let s := SetMembers.presentation A - change ZFSet.IsFunc (M.finiteWords s.carrier) (M.finiteWords s.carrier) - (M.finiteWordReverseGraph s.carrier) - rw [M.finiteWordReverseGraph_eq_graph pairing unions separation infinite s hA] - exact (finiteWordPresentation s M pairing unions separation infinite hA).graph_isFunc - (finiteWordPresentation s M pairing unions separation infinite hA) _ - -end TransitiveGround - - - - - - -def externalWordInverse {J L : Type u} [Inv J] (xs : List (J ⊕ (L × Bool))) : - List (J ⊕ (L × Bool)) := (xs.map externalSymbolInverse).reverse - -theorem externalWordInverse_involutive {J L : Type u} [InvolutiveInv J] : - Function.Involutive (externalWordInverse : List (J ⊕ (L × Bool)) → List (J ⊕ (L × Bool))) := by - intro xs - simp only [externalWordInverse, List.map_reverse, List.reverse_reverse, List.map_map] - have eq : (externalSymbolInverse : J ⊕ (L × Bool) → J ⊕ (L × Bool)) ∘ - externalSymbolInverse = id := by - funext x - exact externalSymbolInverse_involutive x - rw [eq, List.map_id] - -theorem externalWordInverse_append {J L : Type u} [Inv J] - (xs ys : List (J ⊕ (L × Bool))) : - externalWordInverse (xs ++ ys) = externalWordInverse ys ++ externalWordInverse xs := by - simp only [externalWordInverse, List.map_append, List.reverse_append] - -private theorem compose_presentation_graphs {A B C : Type u} - (s : Presentation A) (t : Presentation B) (v : Presentation C) (f : A → B) (g : B → C) : - relationCompose s.carrier t.carrier v.carrier (s.graph t f) (t.graph v g) = - s.graph v (fun x => g (f x)) := by - apply ZFSet.ext - intro z - rw [mem_relationCompose, Presentation.mem_graph] - constructor - · rintro ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy - obtain ⟨c, rfl⟩ := (v.mem_carrier w).1 hw - have ab := (s.pair_mem_graph t f a b).1 first - have bc := (t.pair_mem_graph v g b c).1 second - subst b - subst c - exact ⟨a, rfl⟩ - · rintro ⟨a, rfl⟩ - exact ⟨s.encode a, s.encode_mem a, t.encode (f a), t.encode_mem (f a), - v.encode (g (f a)), v.encode_mem (g (f a)), rfl, - (s.pair_mem_graph t f a (f a)).2 rfl, - (t.pair_mem_graph v g (f a) (g (f a))).2 rfl⟩ - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -noncomputable def externalInverseWordGraph (G S inv : ZFSet.{u}) : ZFSet.{u} := - let alphabet := externalGeneratorAlphabet G S - let words := M.finiteWords alphabet - relationCompose words words words - (M.finiteWordMapGraph alphabet alphabet (externalSymbolInverseGraph G S inv)) - (M.finiteWordReverseGraph alphabet) - -theorem externalInverseWordGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {G S inv : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hInv : inv ∈ M.sets) : - M.externalInverseWordGraph G S inv ∈ M.sets := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet - have hSymbols := M.externalSymbolInverseGraph_mem pairing unions powers separation hG hS hInv - exact M.relationCompose_mem pairing unions powers separation hWords hWords hWords - (M.finiteWordMapGraph_mem pairing unions powers separation infinite hAlphabet hAlphabet hSymbols) - (M.finiteWordReverseGraph_mem pairing unions powers separation infinite hAlphabet) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable {J L : Type u} [Inv J] (s : Presentation J) (t : Presentation L) -variable (hAlphabet : externalGeneratorAlphabet s.carrier t.carrier ∈ M.sets) - -theorem externalInverseWordGraph_eq_graph : - M.externalInverseWordGraph s.carrier t.carrier (s.graph s Inv.inv) = - (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) - M pairing unions separation infinite hAlphabet).graph - (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) - M pairing unions separation infinite hAlphabet) externalWordInverse := by - unfold externalInverseWordGraph - dsimp only - rw [externalSymbolInverseGraph_eq_graph] - have mapEq := M.finiteWordMapGraph_eq_graph pairing unions separation infinite - (externalGeneratorAlphabetPresentation s t) (externalGeneratorAlphabetPresentation s t) - externalSymbolInverse hAlphabet hAlphabet - change M.finiteWordMapGraph (externalGeneratorAlphabet s.carrier t.carrier) - (externalGeneratorAlphabet s.carrier t.carrier) - ((externalGeneratorAlphabetPresentation s t).graph - (externalGeneratorAlphabetPresentation s t) externalSymbolInverse) = _ at mapEq - rw [mapEq] - have reverseEq := M.finiteWordReverseGraph_eq_graph pairing unions separation infinite - (externalGeneratorAlphabetPresentation s t) hAlphabet - change M.finiteWordReverseGraph (externalGeneratorAlphabet s.carrier t.carrier) = _ at reverseEq - rw [reverseEq] - let p := finiteWordPresentation (externalGeneratorAlphabetPresentation s t) - M pairing unions separation infinite hAlphabet - exact compose_presentation_graphs p p p (List.map externalSymbolInverse) List.reverse - -include pairing unions separation infinite hAlphabet in -theorem externalInverseWordGraph_entry_iff (xs ys : List (J ⊕ (L × Bool))) : - ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) - (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ - M.externalInverseWordGraph s.carrier t.carrier (s.graph s Inv.inv) ↔ - externalWordInverse xs = ys := by - rw [M.externalInverseWordGraph_eq_graph pairing unions separation infinite s t hAlphabet] - exact (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) - M pairing unions separation infinite hAlphabet).pair_mem_graph _ _ xs ys - -include pairing unions separation infinite hAlphabet in -theorem externalInverseWordGraph_function : - ZFSet.IsFunc (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) - (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) - (M.externalInverseWordGraph s.carrier t.carrier (s.graph s Inv.inv)) := by - rw [M.externalInverseWordGraph_eq_graph pairing unions separation infinite s t hAlphabet] - exact (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) - M pairing unions separation infinite hAlphabet).graph_isFunc _ _ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) - -private theorem decodeWord {A f : ZFSet.{u}} (word : f ∈ M.finiteWords A) : - ∃ xs : List (SetMembers A), finiteWordGraph (SetMembers.presentation A) xs = f := by - obtain ⟨_, n, function⟩ := (M.mem_finiteWords A f).1 word - obtain ⟨xs, _, equal⟩ := exists_finiteWordGraph (SetMembers.presentation A) function - exact ⟨xs, equal⟩ - -theorem finiteWordAppend_empty {A f : ZFSet.{u}} (word : f ∈ M.finiteWords A) : - ZFSet.pair (ZFSet.pair ∅ f) f ∈ M.finiteWordAppendGraph A ∧ - ZFSet.pair (ZFSet.pair f ∅) f ∈ M.finiteWordAppendGraph A := by - obtain ⟨xs, rfl⟩ := M.decodeWord word - let s := SetMembers.presentation A - have emptyWord : (∅ : ZFSet.{u}) ∈ M.finiteWords A := by - apply (M.mem_finiteWords A ∅).2 - refine ⟨M.empty_mem ⟨_, ((M.mem_finiteWords A _).1 word).1⟩, 0, ?_⟩ - simpa only [s, SetMembers.presentation, finiteWordGraph_nil, List.length_nil] using - finiteWordGraph_function s ([] : List (SetMembers A)) - constructor - · apply (M.pair_mem_finiteWordAppendGraph A _ _ _).2 - refine ⟨emptyWord, word, word, ?_⟩ - simpa only [s, SetMembers.presentation, finiteWordGraph_nil, List.nil_append] using - finiteWordGraph_append_code s [] xs - · apply (M.pair_mem_finiteWordAppendGraph A _ _ _).2 - refine ⟨word, emptyWord, word, ?_⟩ - simpa only [s, SetMembers.presentation, finiteWordGraph_nil, List.append_nil] using - finiteWordGraph_append_code s xs [] - -theorem finiteWordAppend_assoc {A f g h fg gh left right : ZFSet.{u}} - (first : ZFSet.pair (ZFSet.pair f g) fg ∈ M.finiteWordAppendGraph A) - (second : ZFSet.pair (ZFSet.pair g h) gh ∈ M.finiteWordAppendGraph A) - (leftEntry : ZFSet.pair (ZFSet.pair fg h) left ∈ M.finiteWordAppendGraph A) - (rightEntry : ZFSet.pair (ZFSet.pair f gh) right ∈ M.finiteWordAppendGraph A) : - left = right := by - obtain ⟨xs, rfl⟩ := M.decodeWord ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 first).1 - obtain ⟨ys, rfl⟩ := M.decodeWord ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 first).2.1 - obtain ⟨zs, rfl⟩ := M.decodeWord ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 second).2.1 - let s := SetMembers.presentation A - have eqFirst := (finiteWordAppendCode_iff s xs ys fg).1 - ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 first).2.2.2 - have eqSecond := (finiteWordAppendCode_iff s ys zs gh).1 - ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 second).2.2.2 - subst fg gh - have eqLeft := (finiteWordAppendCode_iff s (xs ++ ys) zs left).1 - ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 leftEntry).2.2.2 - have eqRight := (finiteWordAppendCode_iff s xs (ys ++ zs) right).1 - ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 rightEntry).2.2.2 - rw [List.append_assoc] at eqLeft - exact eqLeft.trans eqRight.symm - -theorem finiteWordReverse_involution {A f g : ZFSet.{u}} - (entry : ZFSet.pair f g ∈ M.finiteWordReverseGraph A) : - ZFSet.pair g f ∈ M.finiteWordReverseGraph A := by - have members := (M.pair_mem_finiteWordReverseGraph A _ _).1 entry - obtain ⟨xs, rfl⟩ := M.decodeWord members.1 - let s := SetMembers.presentation A - have equal := (finiteWordReverseCode_iff s xs g).1 members.2.2 - subst g - apply (M.pair_mem_finiteWordReverseGraph A _ _).2 - refine ⟨members.2.1, members.1, ?_⟩ - simpa only [s, SetMembers.presentation, List.reverse_reverse] using - finiteWordGraph_reverse_code s xs.reverse - -theorem finiteWordReverse_append {A f g fg rf rg result : ZFSet.{u}} - (append : ZFSet.pair (ZFSet.pair f g) fg ∈ M.finiteWordAppendGraph A) - (first : ZFSet.pair f rf ∈ M.finiteWordReverseGraph A) - (second : ZFSet.pair g rg ∈ M.finiteWordReverseGraph A) - (swapped : ZFSet.pair (ZFSet.pair rg rf) result ∈ M.finiteWordAppendGraph A) : - ZFSet.pair fg result ∈ M.finiteWordReverseGraph A := by - have members := (M.pair_mem_finiteWordAppendGraph A _ _ _).1 append - have resultMember := ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 swapped).2.2.1 - obtain ⟨xs, rfl⟩ := M.decodeWord members.1 - obtain ⟨ys, rfl⟩ := M.decodeWord members.2.1 - let s := SetMembers.presentation A - have eqAppend := (finiteWordAppendCode_iff s xs ys fg).1 members.2.2.2 - have eqFirst := (finiteWordReverseCode_iff s xs rf).1 - ((M.pair_mem_finiteWordReverseGraph A _ _).1 first).2.2 - have eqSecond := (finiteWordReverseCode_iff s ys rg).1 - ((M.pair_mem_finiteWordReverseGraph A _ _).1 second).2.2 - subst fg rf rg - have eqResult := (finiteWordAppendCode_iff s ys.reverse xs.reverse result).1 - ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 swapped).2.2.2 - subst result - apply (M.pair_mem_finiteWordReverseGraph A _ _).2 - refine ⟨members.2.2.1, resultMember, ?_⟩ - simpa only [s, SetMembers.presentation, List.reverse_append] using - finiteWordGraph_reverse_code s (xs ++ ys) - -theorem finiteWordLength_append {A f g h n k l : ZFSet.{u}} - (append : ZFSet.pair (ZFSet.pair f g) h ∈ M.finiteWordAppendGraph A) - (first : ZFSet.pair f n ∈ M.finiteWordLengthGraph A) - (second : ZFSet.pair g k ∈ M.finiteWordLengthGraph A) - (result : ZFSet.pair h l ∈ M.finiteWordLengthGraph A) : - ZFSet.pair (ZFSet.pair n k) l ∈ natAddGraph := by - have members := (M.pair_mem_finiteWordAppendGraph A _ _ _).1 append - obtain ⟨xs, rfl⟩ := M.decodeWord members.1 - obtain ⟨ys, rfl⟩ := M.decodeWord members.2.1 - let s := SetMembers.presentation A - have eqAppend := (finiteWordAppendCode_iff s xs ys h).1 members.2.2.2 - subst h - have eqFirst := (M.pair_mem_finiteWordLengthGraph_word s xs - ((M.mem_finiteWords A _).1 members.1).1 n).1 first - have eqSecond := (M.pair_mem_finiteWordLengthGraph_word s ys - ((M.mem_finiteWords A _).1 members.2.1).1 k).1 second - have eqResult := (M.pair_mem_finiteWordLengthGraph_word s (xs ++ ys) - ((M.mem_finiteWords A _).1 members.2.2.1).1 l).1 result - rw [eqFirst, eqSecond, eqResult] - exact (pair_mem_natAddGraph xs.length ys.length (xs ++ ys).length).2 List.length_append - -theorem finiteWordLength_reverse {A f g n : ZFSet.{u}} - (reverse : ZFSet.pair f g ∈ M.finiteWordReverseGraph A) - (length : ZFSet.pair f n ∈ M.finiteWordLengthGraph A) : - ZFSet.pair g n ∈ M.finiteWordLengthGraph A := by - have members := (M.pair_mem_finiteWordReverseGraph A _ _).1 reverse - obtain ⟨xs, rfl⟩ := M.decodeWord members.1 - let s := SetMembers.presentation A - have eqReverse := (finiteWordReverseCode_iff s xs g).1 members.2.2 - subst g - have eqLength := (M.pair_mem_finiteWordLengthGraph_word s xs - ((M.mem_finiteWords A _).1 members.1).1 n).1 length - apply (M.pair_mem_finiteWordLengthGraph_word s xs.reverse - ((M.mem_finiteWords A _).1 members.2.1).1 n).2 - simpa only [List.length_reverse] using eqLength - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordOperationFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalAlphabetInversion +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteWordLength +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundNaturalRecursion + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def natSuccessorEntryFormula {k} (z w : Fin k) : BoundedFormula k := + exMem w (exMem w.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (successorFormula 0 1))) + +theorem truth_natSuccessorEntryFormula {k} (z w : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (natSuccessorEntryFormula z w) env ↔ + ∃ a ∈ env w, ∃ b ∈ env w, env z = ZFSet.pair a b ∧ b = insert a a := by + simp only [natSuccessorEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_successorFormula] + rfl + +def natAddEntryFormula {k} (z w step traces zero : Fin k) : BoundedFormula k := + exMem w (exMem w.succ (exMem w.succ.succ (exMem w.succ.succ.succ + (exMem traces.succ.succ.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ 4 3 2) + (.conj (successorFormula 1 3) + (.conj (iterationTraceFormula 3 1 w.succ.succ.succ.succ.succ + step.succ.succ.succ.succ.succ 4 0 zero.succ.succ.succ.succ.succ) + (pairMembershipFormula 3 2 0)))))))) + +theorem truth_natAddEntryFormula {k} (z w step traces zero : Fin k) + (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : + Truth (natAddEntryFormula z w step traces zero) env ↔ + ∃ a ∈ env w, ∃ b ∈ env w, ∃ c ∈ env w, ∃ d ∈ env w, ∃ t ∈ env traces, + env z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ + IterationTraceCode b d (env w) (env step) a t ∧ ZFSet.pair b c ∈ t := by + simp only [natAddEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_successorFormula, truth_pairMembershipFormula] + apply exists_congr + intro a + apply and_congr_right + intro _ + apply exists_congr + intro b + apply and_congr_right + intro _ + apply exists_congr + intro c + apply and_congr_right + intro _ + apply exists_congr + intro d + apply and_congr_right + intro _ + apply exists_congr + intro t + apply and_congr_right + intro _ + exact and_congr Iff.rfl (and_congr Iff.rfl (and_congr + (truth_iterationTraceFormula _ _ _ _ _ _ _ _ (by exact hzero)) Iff.rfl)) + +def natMulEntryFormula {k} (z w family traces zero : Fin k) : BoundedFormula k := + exMem w (exMem w.succ (exMem w.succ.succ (exMem w.succ.succ.succ + (exMem traces.succ.succ.succ.succ (exMem traces.succ.succ.succ.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ.succ 5 4 3) + (.conj (successorFormula 2 4) + (.conj (pairMembershipFormula 5 0 family.succ.succ.succ.succ.succ.succ) + (.conj (iterationTraceFormula 4 2 w.succ.succ.succ.succ.succ.succ + 0 zero.succ.succ.succ.succ.succ.succ 1 zero.succ.succ.succ.succ.succ.succ) + (pairMembershipFormula 4 3 1)))))))))) + +theorem truth_natMulEntryFormula {k} (z w family traces zero : Fin k) + (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : + Truth (natMulEntryFormula z w family traces zero) env ↔ + ∃ a ∈ env w, ∃ b ∈ env w, ∃ c ∈ env w, ∃ d ∈ env w, + ∃ t ∈ env traces, ∃ step ∈ env traces, + env z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ + ZFSet.pair a step ∈ env family ∧ + IterationTraceCode b d (env w) step ∅ t ∧ ZFSet.pair b c ∈ t := by + simp only [natMulEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_successorFormula, truth_pairMembershipFormula] + apply exists_congr + intro a + apply and_congr_right + intro _ + apply exists_congr + intro b + apply and_congr_right + intro _ + apply exists_congr + intro c + apply and_congr_right + intro _ + apply exists_congr + intro d + apply and_congr_right + intro _ + apply exists_congr + intro t + apply and_congr_right + intro _ + apply exists_congr + intro step + apply and_congr_right + intro _ + apply and_congr_right + intro _ + apply and_congr_right + intro _ + apply and_congr_right + intro _ + have correct := truth_iterationTraceFormula 4 2 w.succ.succ.succ.succ.succ.succ + 0 zero.succ.succ.succ.succ.succ.succ 1 zero.succ.succ.succ.succ.succ.succ + (extend step (extend t (extend d (extend c (extend b (extend a env)))))) (by exact hzero) + constructor + · rintro ⟨h, entry⟩ + have trace := correct.1 h + change IterationTraceCode b d (env w) step (env zero) t at trace + exact ⟨by simpa only [hzero] using trace, entry⟩ + · rintro ⟨trace, entry⟩ + refine ⟨correct.2 ?_, entry⟩ + change IterationTraceCode b d (env w) step (env zero) t + simpa only [hzero] using trace + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem natSuccessorGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : natSuccessorGraph ∈ M.sets := by + have hw := M.omega_mem separation infinite + have bound := M.prod_mem pairing unions powers separation hw hw + let params := extend ZFSet.omega Fin.elim0 + have selected := M.bounded_separation_mem separation + (BoundedFormula.natSuccessorEntryFormula 0 1) params + (Fin.cases hw (fun i => Fin.elim0 i)) bound + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.natSuccessorEntryFormula 0 1) (extend z params)) + (ZFSet.prod ZFSet.omega ZFSet.omega) = natSuccessorGraph := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_natSuccessorEntryFormula] + change (z ∈ ZFSet.prod ZFSet.omega ZFSet.omega ∧ ∃ a ∈ ZFSet.omega, + ∃ b ∈ ZFSet.omega, z = ZFSet.pair a b ∧ b = insert a a) ↔ _ + constructor + · rintro ⟨_, a, ha, b, _, rfl, rfl⟩ + obtain ⟨a, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha + exact (pair_mem_natSuccessorGraph a (a + 1)).2 rfl + · intro hz + have shape := natSuccessorGraph_isFunc.1 hz + obtain ⟨a, rfl⟩ := (natPresentation.mem_graph natPresentation + (fun n => ⟨n.down + 1⟩) z).1 hz + exact ⟨shape, natSetCode a.down, natPresentation.encode_mem a, + natSetCode (a.down + 1), natPresentation.encode_mem ⟨a.down + 1⟩, rfl, rfl⟩ + exact equal ▸ selected + +theorem naturalFiniteTrace_mem_relations + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (f : ULift.{u} Nat → ULift.{u} Nat) (a n : Nat) : + finiteIterationTrace natPresentation f ⟨a⟩ n ∈ M.groundRelations ZFSet.omega ZFSet.omega := by + refine (M.mem_groundRelations _ _ _).2 + ⟨M.finiteIterationTrace_mem pairing unions separation infinite natPresentation f ⟨a⟩ n + (M.omega_mem separation infinite), ?_⟩ + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 + ((finiteIterationTrace_code natPresentation f ⟨a⟩ n).function.1 hz) + obtain ⟨k, _, rfl⟩ := (mem_natSetCode x (n + 1)).1 hx + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega k, hy⟩ + +theorem natAddGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : natAddGraph ∈ M.sets := by + have hw := M.omega_mem separation infinite + have hs := M.natSuccessorGraph_mem pairing unions powers separation infinite + have hz := M.empty_mem ⟨ZFSet.omega, hw⟩ + let T := M.groundRelations ZFSet.omega ZFSet.omega + have ht := M.groundRelations_mem pairing unions powers separation hw hw + let P := ZFSet.prod (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega + have hp := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hw hw) hw + let params := extend ZFSet.omega (extend natSuccessorGraph (extend T (extend ∅ Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.natAddEntryFormula 0 1 2 3 4) params + (Fin.cases hw (Fin.cases hs (Fin.cases ht (Fin.cases hz (fun i => Fin.elim0 i))))) hp + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.natAddEntryFormula 0 1 2 3 4) (extend z params)) P = natAddGraph := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_natAddEntryFormula _ _ _ _ _ _ rfl] + change (z ∈ P ∧ ∃ a ∈ ZFSet.omega, ∃ b ∈ ZFSet.omega, ∃ c ∈ ZFSet.omega, + ∃ d ∈ ZFSet.omega, ∃ t ∈ T, z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ + IterationTraceCode b d ZFSet.omega natSuccessorGraph a t ∧ ZFSet.pair b c ∈ t) ↔ _ + constructor + · rintro ⟨_, a, ha, b, hb, c, hc, d, _, t, _, rfl, rfl, trace, entry⟩ + obtain ⟨a, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha + obtain ⟨b, rfl⟩ := (mem_omega_iff_natSetCode b).1 hb + obtain ⟨c, rfl⟩ := (mem_omega_iff_natSetCode c).1 hc + have value := trace.output natPresentation (fun n => ⟨n.down + 1⟩) ⟨a⟩ entry + have eq : natSetCode c = natSetCode (a + b) := by + simpa only [natIterate_successor, natPresentation] using value + exact (pair_mem_natAddGraph a b c).2 (natSetCode_injective eq) + · intro h + have shape := natAddGraph_isFunc.1 h + obtain ⟨⟨a, b⟩, rfl⟩ := ((natPresentation.product natPresentation).mem_graph + natPresentation (fun n => ⟨n.1.down + n.2.down⟩) z).1 h + let f := fun n : ULift.{u} Nat => (⟨n.down + 1⟩ : ULift.{u} Nat) + let t := finiteIterationTrace natPresentation f a b.down + have code := finiteIterationTrace_code natPresentation f a b.down + refine ⟨shape, natSetCode a.down, natPresentation.encode_mem a, + natSetCode b.down, natPresentation.encode_mem b, natSetCode (a.down + b.down), + natSetCode_mem_omega _, natSetCode (b.down + 1), natSetCode_mem_omega _, t, + M.naturalFiniteTrace_mem_relations pairing unions separation infinite f a.down b.down, + rfl, rfl, code, ?_⟩ + have iterate : natIterate f a b.down = ⟨a.down + b.down⟩ := + natIterate_successor a.down b.down + have output := code.value natPresentation f a b.down (Nat.le_refl _) + rw [iterate] at output + exact output + exact equal ▸ selected + +theorem natMulGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : natMulGraph ∈ M.sets := by + have hw := M.omega_mem separation infinite + have hadd := M.natAddGraph_mem pairing unions powers separation infinite + have hz := M.empty_mem ⟨ZFSet.omega, hw⟩ + let T := M.groundRelations ZFSet.omega ZFSet.omega + have ht := M.groundRelations_mem pairing unions powers separation hw hw + let family := M.indexedRelationSections ZFSet.omega ZFSet.omega ZFSet.omega natAddGraph + have spec := M.indexedRelationSections_spec pairing unions powers separation hw hw hw hadd + let P := ZFSet.prod (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega + have hp := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hw hw) hw + let params := extend ZFSet.omega (extend family (extend T (extend ∅ Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.natMulEntryFormula 0 1 2 3 4) params + (Fin.cases hw (Fin.cases spec.1 (Fin.cases ht (Fin.cases hz (fun i => Fin.elim0 i))))) hp + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.natMulEntryFormula 0 1 2 3 4) (extend z params)) P = natMulGraph := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_natMulEntryFormula _ _ _ _ _ _ rfl] + change (z ∈ P ∧ ∃ a ∈ ZFSet.omega, ∃ b ∈ ZFSet.omega, ∃ c ∈ ZFSet.omega, + ∃ d ∈ ZFSet.omega, ∃ t ∈ T, ∃ step ∈ T, + z = ZFSet.pair (ZFSet.pair a b) c ∧ d = insert b b ∧ ZFSet.pair a step ∈ family ∧ + IterationTraceCode b d ZFSet.omega step ∅ t ∧ ZFSet.pair b c ∈ t) ↔ _ + constructor + · rintro ⟨_, a, ha, b, hb, c, hc, d, _, t, _, step, _, rfl, rfl, member, trace, entry⟩ + obtain ⟨a, rfl⟩ := (mem_omega_iff_natSetCode a).1 ha + obtain ⟨b, rfl⟩ := (mem_omega_iff_natSetCode b).1 hb + obtain ⟨c, rfl⟩ := (mem_omega_iff_natSetCode c).1 hc + have eqStep : step = natAddSection a := + ((spec.2.2 _ _).1 member).2.trans (natAddSection_eq a).symm + rw [eqStep] at trace + have value := trace.output natPresentation (fun n => ⟨a + n.down⟩) ⟨0⟩ entry + have eq : natSetCode c = natSetCode (a * b) := by + simpa only [natIterate_add, natPresentation] using value + exact (pair_mem_natMulGraph a b c).2 (natSetCode_injective eq) + · intro h + have shape := natMulGraph_isFunc.1 h + obtain ⟨⟨a, b⟩, rfl⟩ := ((natPresentation.product natPresentation).mem_graph + natPresentation (fun n => ⟨n.1.down * n.2.down⟩) z).1 h + let f := fun n : ULift.{u} Nat => (⟨a.down + n.down⟩ : ULift.{u} Nat) + let t := finiteIterationTrace natPresentation f ⟨0⟩ b.down + have code := finiteIterationTrace_code natPresentation f ⟨0⟩ b.down + have member : ZFSet.pair (natSetCode a.down) (natAddSection a.down) ∈ family := + (spec.2.2 _ _).2 ⟨natPresentation.encode_mem a, natAddSection_eq a.down⟩ + have stepBound : natAddSection a.down ∈ T := (ZFSet.pair_mem_prod.1 (spec.2.1.1 member)).2 + refine ⟨shape, natSetCode a.down, natPresentation.encode_mem a, + natSetCode b.down, natPresentation.encode_mem b, natSetCode (a.down * b.down), + natSetCode_mem_omega _, natSetCode (b.down + 1), natSetCode_mem_omega _, t, + M.naturalFiniteTrace_mem_relations pairing unions separation infinite f 0 b.down, + natAddSection a.down, stepBound, rfl, rfl, member, code, ?_⟩ + simpa only [t, f, natIterate_add, natPresentation] using code.value natPresentation f ⟨0⟩ b.down (Nat.le_refl _) + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace BoundedFormula + +def finiteWordMapEntryFormula {k} (z wordsA wordsB omega a b e : Fin k) : BoundedFormula k := + exMem wordsA (exMem wordsB.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (finiteWordMapFormula omega.succ.succ a.succ.succ b.succ.succ e.succ.succ 1 0))) + +theorem truth_finiteWordMapEntryFormula {k} (z wordsA wordsB omega a b e : Fin k) + (env : Fin k → ZFSet.{u}) : + Truth (finiteWordMapEntryFormula z wordsA wordsB omega a b e) env ↔ + ∃ f ∈ env wordsA, ∃ g ∈ env wordsB, env z = ZFSet.pair f g ∧ + FiniteWordMapCode (env omega) (env a) (env b) (env e) f g := by + simp only [finiteWordMapEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_finiteWordMapFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def finiteWordMapGraph (A B e : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ g ∈ M.finiteWords B, + z = ZFSet.pair f g ∧ FiniteWordMapCode ZFSet.omega A B e f g) + (ZFSet.prod (M.finiteWords A) (M.finiteWords B)) + +theorem pair_mem_finiteWordMapGraph (A B e f g : ZFSet.{u}) : + ZFSet.pair f g ∈ M.finiteWordMapGraph A B e ↔ + f ∈ M.finiteWords A ∧ g ∈ M.finiteWords B ∧ + FiniteWordMapCode ZFSet.omega A B e f g := by + rw [finiteWordMapGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, x, hx, y, hy, eq, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hx, hy, code⟩ + · rintro ⟨hf, hg, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hg⟩, f, hf, g, hg, rfl, code⟩ + +theorem finiteWordMapGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A B e : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) : + M.finiteWordMapGraph A B e ∈ M.sets := by + have hw := M.omega_mem separation infinite + have hWA := M.finiteWords_mem pairing unions powers separation infinite hA + have hWB := M.finiteWords_mem pairing unions powers separation infinite hB + let params := extend ZFSet.omega (extend A (extend B (extend e + (extend (M.finiteWords A) (extend (M.finiteWords B) Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.finiteWordMapEntryFormula 0 5 6 1 2 3 4) params + (Fin.cases hw (Fin.cases hA (Fin.cases hB (Fin.cases he + (Fin.cases hWA (Fin.cases hWB (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hWA hWB) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.finiteWordMapEntryFormula 0 5 6 1 2 3 4) (extend z params)) + (ZFSet.prod (M.finiteWords A) (M.finiteWords B)) = M.finiteWordMapGraph A B e := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, finiteWordMapGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_finiteWordMapEntryFormula 0 5 6 1 2 3 4 _) + exact eq ▸ selected + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable {B D : Type u} (s : Presentation B) (t : Presentation D) (e : B → D) +variable (hB : s.carrier ∈ M.sets) (hD : t.carrier ∈ M.sets) + +theorem finiteWordMapGraph_eq_graph : + M.finiteWordMapGraph s.carrier t.carrier (s.graph t e) = + (finiteWordPresentation s M pairing unions separation infinite hB).graph + (finiteWordPresentation t M pairing unions separation infinite hD) (List.map e) := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + change z ∈ M.finiteWordMapGraph s.carrier t.carrier (s.graph t e) ↔ + ∃ xs, ZFSet.pair (finiteWordGraph s xs) (finiteWordGraph t (xs.map e)) = z + constructor + · intro hz + obtain ⟨f, hf, g, hg, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + obtain ⟨xs, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB f).1 hf + obtain ⟨ys, rfl⟩ := (finiteWords_exact_lists t M pairing unions separation infinite hD g).1 hg + have code := ((M.pair_mem_finiteWordMapGraph _ _ _ _ _).1 hz).2.2 + have eq := (finiteWordMapCode_iff s t e xs ys).1 code + subst ys + exact ⟨xs, rfl⟩ + · rintro ⟨xs, rfl⟩ + exact (M.pair_mem_finiteWordMapGraph _ _ _ _ _).2 + ⟨finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, + finiteWordGraph_mem_finiteWords t M pairing unions separation infinite hD (xs.map e), + (finiteWordMapCode_iff s t e xs (xs.map e)).2 rfl⟩ + +include pairing unions separation infinite hB hD in +theorem finiteWordMapGraph_function : + ZFSet.IsFunc (M.finiteWords s.carrier) (M.finiteWords t.carrier) + (M.finiteWordMapGraph s.carrier t.carrier (s.graph t e)) := by + rw [M.finiteWordMapGraph_eq_graph pairing unions separation infinite s t e hB hD] + exact (finiteWordPresentation s M pairing unions separation infinite hB).graph_isFunc + (finiteWordPresentation t M pairing unions separation infinite hD) _ + +end TransitiveGround + + + + + +namespace BoundedFormula + +def finiteWordAppendEntryFormula {n} (z words alphabet omega add : Fin n) : BoundedFormula n := + exMem words (exMem words.succ (exMem words.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) + (finiteWordAppendFormula alphabet.succ.succ.succ omega.succ.succ.succ + add.succ.succ.succ 2 1 0)))) + +theorem truth_finiteWordAppendEntryFormula {n} (z words alphabet omega add : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (finiteWordAppendEntryFormula z words alphabet omega add) env ↔ + ∃ f ∈ env words, ∃ g ∈ env words, ∃ h ∈ env words, + env z = ZFSet.pair (ZFSet.pair f g) h ∧ + FiniteWordAppendCode (env alphabet) (env omega) (env add) f g h := by + simp only [finiteWordAppendEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_finiteWordAppendFormula] + rfl + +def finiteWordReverseEntryFormula {n} (z words alphabet omega add : Fin n) : BoundedFormula n := + exMem words (exMem words.succ + (.conj (orderedPairFormula z.succ.succ 1 0) + (finiteWordReverseFormula alphabet.succ.succ omega.succ.succ add.succ.succ 1 0))) + +theorem truth_finiteWordReverseEntryFormula {n} (z words alphabet omega add : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (finiteWordReverseEntryFormula z words alphabet omega add) env ↔ + ∃ f ∈ env words, ∃ h ∈ env words, env z = ZFSet.pair f h ∧ + FiniteWordReverseCode (env alphabet) (env omega) (env add) f h := by + simp only [finiteWordReverseEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_finiteWordReverseFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def finiteWordAppendGraph (A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ g ∈ M.finiteWords A, + ∃ h ∈ M.finiteWords A, z = ZFSet.pair (ZFSet.pair f g) h ∧ + FiniteWordAppendCode A ZFSet.omega natAddGraph f g h) + (ZFSet.prod (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) (M.finiteWords A)) + +noncomputable def finiteWordReverseGraph (A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ h ∈ M.finiteWords A, + z = ZFSet.pair f h ∧ FiniteWordReverseCode A ZFSet.omega natAddGraph f h) + (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) + +theorem pair_mem_finiteWordAppendGraph (A f g h : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair f g) h ∈ M.finiteWordAppendGraph A ↔ + f ∈ M.finiteWords A ∧ g ∈ M.finiteWords A ∧ h ∈ M.finiteWords A ∧ + FiniteWordAppendCode A ZFSet.omega natAddGraph f g h := by + rw [finiteWordAppendGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, f', hf, g', hg, h', hh, eq, code⟩ + obtain ⟨fg, rfl⟩ := ZFSet.pair_inj.1 eq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 fg + exact ⟨hf, hg, hh, code⟩ + · rintro ⟨hf, hg, hh, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hf, hg⟩, hh⟩, + f, hf, g, hg, h, hh, rfl, code⟩ + +theorem pair_mem_finiteWordReverseGraph (A f h : ZFSet.{u}) : + ZFSet.pair f h ∈ M.finiteWordReverseGraph A ↔ + f ∈ M.finiteWords A ∧ h ∈ M.finiteWords A ∧ + FiniteWordReverseCode A ZFSet.omega natAddGraph f h := by + rw [finiteWordReverseGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, f', hf, h', hh, eq, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hf, hh, code⟩ + · rintro ⟨hf, hh, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hh⟩, f, hf, h, hh, rfl, code⟩ + +theorem finiteWordAppendGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWordAppendGraph A ∈ M.sets := by + have hWords := M.finiteWords_mem pairing unions powers separation infinite hA + have hOmega := M.omega_mem separation infinite + have hAdd := M.natAddGraph_mem pairing unions powers separation infinite + have domain := M.prod_mem pairing unions powers separation hWords hWords + have bound := M.prod_mem pairing unions powers separation domain hWords + let params := extend (M.finiteWords A) (extend A (extend ZFSet.omega (extend natAddGraph Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.finiteWordAppendEntryFormula 0 1 2 3 4) params + (Fin.cases hWords (Fin.cases hA (Fin.cases hOmega (Fin.cases hAdd (fun j => Fin.elim0 j))))) bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.finiteWordAppendEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) (M.finiteWords A)) = + M.finiteWordAppendGraph A := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, finiteWordAppendGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_finiteWordAppendEntryFormula 0 1 2 3 4 _) + exact eq ▸ selected + +theorem finiteWordReverseGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWordReverseGraph A ∈ M.sets := by + have hWords := M.finiteWords_mem pairing unions powers separation infinite hA + have hOmega := M.omega_mem separation infinite + have hAdd := M.natAddGraph_mem pairing unions powers separation infinite + have bound := M.prod_mem pairing unions powers separation hWords hWords + let params := extend (M.finiteWords A) (extend A (extend ZFSet.omega (extend natAddGraph Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.finiteWordReverseEntryFormula 0 1 2 3 4) params + (Fin.cases hWords (Fin.cases hA (Fin.cases hOmega (Fin.cases hAdd (fun j => Fin.elim0 j))))) bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.finiteWordReverseEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) = M.finiteWordReverseGraph A := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, finiteWordReverseGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_finiteWordReverseEntryFormula 0 1 2 3 4 _) + exact eq ▸ selected + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) + +theorem finiteWordAppendGraph_eq_graph {B : Type u} (s : Presentation B) + (hB : s.carrier ∈ M.sets) : + M.finiteWordAppendGraph s.carrier = + ((finiteWordPresentation s M pairing unions separation infinite hB).product + (finiteWordPresentation s M pairing unions separation infinite hB)).graph + (finiteWordPresentation s M pairing unions separation infinite hB) + (fun p => p.1 ++ p.2) := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + change z ∈ M.finiteWordAppendGraph s.carrier ↔ + ∃ p : List B × List B, ZFSet.pair + (ZFSet.pair (finiteWordGraph s p.1) (finiteWordGraph s p.2)) + (finiteWordGraph s (p.1 ++ p.2)) = z + constructor + · intro hz + obtain ⟨fg, hfg, h, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + obtain ⟨f, hf, g, hg, rfl⟩ := ZFSet.mem_prod.1 hfg + obtain ⟨xs, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB f).1 hf + obtain ⟨ys, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB g).1 hg + have code := ((M.pair_mem_finiteWordAppendGraph _ _ _ _).1 hz).2.2.2 + have eq := (finiteWordAppendCode_iff s xs ys h).1 code + subst h + exact ⟨(xs, ys), rfl⟩ + · rintro ⟨⟨xs, ys⟩, rfl⟩ + exact (M.pair_mem_finiteWordAppendGraph _ _ _ _).2 + ⟨finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, + finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB ys, + finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB (xs ++ ys), + finiteWordGraph_append_code s xs ys⟩ + +theorem finiteWordReverseGraph_eq_graph {B : Type u} (s : Presentation B) + (hB : s.carrier ∈ M.sets) : + M.finiteWordReverseGraph s.carrier = + (finiteWordPresentation s M pairing unions separation infinite hB).graph + (finiteWordPresentation s M pairing unions separation infinite hB) List.reverse := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + change z ∈ M.finiteWordReverseGraph s.carrier ↔ + ∃ xs : List B, ZFSet.pair (finiteWordGraph s xs) (finiteWordGraph s xs.reverse) = z + constructor + · intro hz + obtain ⟨f, hf, h, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + obtain ⟨xs, rfl⟩ := (finiteWords_exact_lists s M pairing unions separation infinite hB f).1 hf + have code := ((M.pair_mem_finiteWordReverseGraph _ _ _).1 hz).2.2 + have eq := (finiteWordReverseCode_iff s xs h).1 code + subst h + exact ⟨xs, rfl⟩ + · rintro ⟨xs, rfl⟩ + exact (M.pair_mem_finiteWordReverseGraph _ _ _).2 + ⟨finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, + finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs.reverse, + finiteWordGraph_reverse_code s xs⟩ + +include pairing unions separation infinite in +theorem finiteWordAppendGraph_function {A : ZFSet.{u}} (hA : A ∈ M.sets) : + ZFSet.IsFunc (ZFSet.prod (M.finiteWords A) (M.finiteWords A)) (M.finiteWords A) + (M.finiteWordAppendGraph A) := by + let s := SetMembers.presentation A + change ZFSet.IsFunc (ZFSet.prod (M.finiteWords s.carrier) (M.finiteWords s.carrier)) + (M.finiteWords s.carrier) (M.finiteWordAppendGraph s.carrier) + rw [M.finiteWordAppendGraph_eq_graph pairing unions separation infinite s hA] + exact ((finiteWordPresentation s M pairing unions separation infinite hA).product + (finiteWordPresentation s M pairing unions separation infinite hA)).graph_isFunc + (finiteWordPresentation s M pairing unions separation infinite hA) _ + +include pairing unions separation infinite in +theorem finiteWordReverseGraph_function {A : ZFSet.{u}} (hA : A ∈ M.sets) : + ZFSet.IsFunc (M.finiteWords A) (M.finiteWords A) (M.finiteWordReverseGraph A) := by + let s := SetMembers.presentation A + change ZFSet.IsFunc (M.finiteWords s.carrier) (M.finiteWords s.carrier) + (M.finiteWordReverseGraph s.carrier) + rw [M.finiteWordReverseGraph_eq_graph pairing unions separation infinite s hA] + exact (finiteWordPresentation s M pairing unions separation infinite hA).graph_isFunc + (finiteWordPresentation s M pairing unions separation infinite hA) _ + +end TransitiveGround + + + + + + +def externalWordInverse {J L : Type u} [Inv J] (xs : List (J ⊕ (L × Bool))) : + List (J ⊕ (L × Bool)) := (xs.map externalSymbolInverse).reverse + +theorem externalWordInverse_involutive {J L : Type u} [InvolutiveInv J] : + Function.Involutive (externalWordInverse : List (J ⊕ (L × Bool)) → List (J ⊕ (L × Bool))) := by + intro xs + simp only [externalWordInverse, List.map_reverse, List.reverse_reverse, List.map_map] + have eq : (externalSymbolInverse : J ⊕ (L × Bool) → J ⊕ (L × Bool)) ∘ + externalSymbolInverse = id := by + funext x + exact externalSymbolInverse_involutive x + rw [eq, List.map_id] + +theorem externalWordInverse_append {J L : Type u} [Inv J] + (xs ys : List (J ⊕ (L × Bool))) : + externalWordInverse (xs ++ ys) = externalWordInverse ys ++ externalWordInverse xs := by + simp only [externalWordInverse, List.map_append, List.reverse_append] + +private theorem compose_presentation_graphs {A B C : Type u} + (s : Presentation A) (t : Presentation B) (v : Presentation C) (f : A → B) (g : B → C) : + relationCompose s.carrier t.carrier v.carrier (s.graph t f) (t.graph v g) = + s.graph v (fun x => g (f x)) := by + apply ZFSet.ext + intro z + rw [mem_relationCompose, Presentation.mem_graph] + constructor + · rintro ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (t.mem_carrier y).1 hy + obtain ⟨c, rfl⟩ := (v.mem_carrier w).1 hw + have ab := (s.pair_mem_graph t f a b).1 first + have bc := (t.pair_mem_graph v g b c).1 second + subst b + subst c + exact ⟨a, rfl⟩ + · rintro ⟨a, rfl⟩ + exact ⟨s.encode a, s.encode_mem a, t.encode (f a), t.encode_mem (f a), + v.encode (g (f a)), v.encode_mem (g (f a)), rfl, + (s.pair_mem_graph t f a (f a)).2 rfl, + (t.pair_mem_graph v g (f a) (g (f a))).2 rfl⟩ + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +noncomputable def externalInverseWordGraph (G S inv : ZFSet.{u}) : ZFSet.{u} := + let alphabet := externalGeneratorAlphabet G S + let words := M.finiteWords alphabet + relationCompose words words words + (M.finiteWordMapGraph alphabet alphabet (externalSymbolInverseGraph G S inv)) + (M.finiteWordReverseGraph alphabet) + +theorem externalInverseWordGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {G S inv : ZFSet.{u}} (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hInv : inv ∈ M.sets) : + M.externalInverseWordGraph G S inv ∈ M.sets := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet + have hSymbols := M.externalSymbolInverseGraph_mem pairing unions powers separation hG hS hInv + exact M.relationCompose_mem pairing unions powers separation hWords hWords hWords + (M.finiteWordMapGraph_mem pairing unions powers separation infinite hAlphabet hAlphabet hSymbols) + (M.finiteWordReverseGraph_mem pairing unions powers separation infinite hAlphabet) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable {J L : Type u} [Inv J] (s : Presentation J) (t : Presentation L) +variable (hAlphabet : externalGeneratorAlphabet s.carrier t.carrier ∈ M.sets) + +theorem externalInverseWordGraph_eq_graph : + M.externalInverseWordGraph s.carrier t.carrier (s.graph s Inv.inv) = + (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) + M pairing unions separation infinite hAlphabet).graph + (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) + M pairing unions separation infinite hAlphabet) externalWordInverse := by + unfold externalInverseWordGraph + dsimp only + rw [externalSymbolInverseGraph_eq_graph] + have mapEq := M.finiteWordMapGraph_eq_graph pairing unions separation infinite + (externalGeneratorAlphabetPresentation s t) (externalGeneratorAlphabetPresentation s t) + externalSymbolInverse hAlphabet hAlphabet + change M.finiteWordMapGraph (externalGeneratorAlphabet s.carrier t.carrier) + (externalGeneratorAlphabet s.carrier t.carrier) + ((externalGeneratorAlphabetPresentation s t).graph + (externalGeneratorAlphabetPresentation s t) externalSymbolInverse) = _ at mapEq + rw [mapEq] + have reverseEq := M.finiteWordReverseGraph_eq_graph pairing unions separation infinite + (externalGeneratorAlphabetPresentation s t) hAlphabet + change M.finiteWordReverseGraph (externalGeneratorAlphabet s.carrier t.carrier) = _ at reverseEq + rw [reverseEq] + let p := finiteWordPresentation (externalGeneratorAlphabetPresentation s t) + M pairing unions separation infinite hAlphabet + exact compose_presentation_graphs p p p (List.map externalSymbolInverse) List.reverse + +include pairing unions separation infinite hAlphabet in +theorem externalInverseWordGraph_entry_iff (xs ys : List (J ⊕ (L × Bool))) : + ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) + (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ + M.externalInverseWordGraph s.carrier t.carrier (s.graph s Inv.inv) ↔ + externalWordInverse xs = ys := by + rw [M.externalInverseWordGraph_eq_graph pairing unions separation infinite s t hAlphabet] + exact (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) + M pairing unions separation infinite hAlphabet).pair_mem_graph _ _ xs ys + +include pairing unions separation infinite hAlphabet in +theorem externalInverseWordGraph_function : + ZFSet.IsFunc (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) + (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) + (M.externalInverseWordGraph s.carrier t.carrier (s.graph s Inv.inv)) := by + rw [M.externalInverseWordGraph_eq_graph pairing unions separation infinite s t hAlphabet] + exact (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) + M pairing unions separation infinite hAlphabet).graph_isFunc _ _ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) + +private theorem decodeWord {A f : ZFSet.{u}} (word : f ∈ M.finiteWords A) : + ∃ xs : List (SetMembers A), finiteWordGraph (SetMembers.presentation A) xs = f := by + obtain ⟨_, n, function⟩ := (M.mem_finiteWords A f).1 word + obtain ⟨xs, _, equal⟩ := exists_finiteWordGraph (SetMembers.presentation A) function + exact ⟨xs, equal⟩ + +theorem finiteWordAppend_empty {A f : ZFSet.{u}} (word : f ∈ M.finiteWords A) : + ZFSet.pair (ZFSet.pair ∅ f) f ∈ M.finiteWordAppendGraph A ∧ + ZFSet.pair (ZFSet.pair f ∅) f ∈ M.finiteWordAppendGraph A := by + obtain ⟨xs, rfl⟩ := M.decodeWord word + let s := SetMembers.presentation A + have emptyWord : (∅ : ZFSet.{u}) ∈ M.finiteWords A := by + apply (M.mem_finiteWords A ∅).2 + refine ⟨M.empty_mem ⟨_, ((M.mem_finiteWords A _).1 word).1⟩, 0, ?_⟩ + simpa only [s, SetMembers.presentation, finiteWordGraph_nil, List.length_nil] using + finiteWordGraph_function s ([] : List (SetMembers A)) + constructor + · apply (M.pair_mem_finiteWordAppendGraph A _ _ _).2 + refine ⟨emptyWord, word, word, ?_⟩ + simpa only [s, SetMembers.presentation, finiteWordGraph_nil, List.nil_append] using + finiteWordGraph_append_code s [] xs + · apply (M.pair_mem_finiteWordAppendGraph A _ _ _).2 + refine ⟨word, emptyWord, word, ?_⟩ + simpa only [s, SetMembers.presentation, finiteWordGraph_nil, List.append_nil] using + finiteWordGraph_append_code s xs [] + +theorem finiteWordAppend_assoc {A f g h fg gh left right : ZFSet.{u}} + (first : ZFSet.pair (ZFSet.pair f g) fg ∈ M.finiteWordAppendGraph A) + (second : ZFSet.pair (ZFSet.pair g h) gh ∈ M.finiteWordAppendGraph A) + (leftEntry : ZFSet.pair (ZFSet.pair fg h) left ∈ M.finiteWordAppendGraph A) + (rightEntry : ZFSet.pair (ZFSet.pair f gh) right ∈ M.finiteWordAppendGraph A) : + left = right := by + obtain ⟨xs, rfl⟩ := M.decodeWord ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 first).1 + obtain ⟨ys, rfl⟩ := M.decodeWord ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 first).2.1 + obtain ⟨zs, rfl⟩ := M.decodeWord ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 second).2.1 + let s := SetMembers.presentation A + have eqFirst := (finiteWordAppendCode_iff s xs ys fg).1 + ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 first).2.2.2 + have eqSecond := (finiteWordAppendCode_iff s ys zs gh).1 + ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 second).2.2.2 + subst fg gh + have eqLeft := (finiteWordAppendCode_iff s (xs ++ ys) zs left).1 + ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 leftEntry).2.2.2 + have eqRight := (finiteWordAppendCode_iff s xs (ys ++ zs) right).1 + ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 rightEntry).2.2.2 + rw [List.append_assoc] at eqLeft + exact eqLeft.trans eqRight.symm + +theorem finiteWordReverse_involution {A f g : ZFSet.{u}} + (entry : ZFSet.pair f g ∈ M.finiteWordReverseGraph A) : + ZFSet.pair g f ∈ M.finiteWordReverseGraph A := by + have members := (M.pair_mem_finiteWordReverseGraph A _ _).1 entry + obtain ⟨xs, rfl⟩ := M.decodeWord members.1 + let s := SetMembers.presentation A + have equal := (finiteWordReverseCode_iff s xs g).1 members.2.2 + subst g + apply (M.pair_mem_finiteWordReverseGraph A _ _).2 + refine ⟨members.2.1, members.1, ?_⟩ + simpa only [s, SetMembers.presentation, List.reverse_reverse] using + finiteWordGraph_reverse_code s xs.reverse + +theorem finiteWordReverse_append {A f g fg rf rg result : ZFSet.{u}} + (append : ZFSet.pair (ZFSet.pair f g) fg ∈ M.finiteWordAppendGraph A) + (first : ZFSet.pair f rf ∈ M.finiteWordReverseGraph A) + (second : ZFSet.pair g rg ∈ M.finiteWordReverseGraph A) + (swapped : ZFSet.pair (ZFSet.pair rg rf) result ∈ M.finiteWordAppendGraph A) : + ZFSet.pair fg result ∈ M.finiteWordReverseGraph A := by + have members := (M.pair_mem_finiteWordAppendGraph A _ _ _).1 append + have resultMember := ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 swapped).2.2.1 + obtain ⟨xs, rfl⟩ := M.decodeWord members.1 + obtain ⟨ys, rfl⟩ := M.decodeWord members.2.1 + let s := SetMembers.presentation A + have eqAppend := (finiteWordAppendCode_iff s xs ys fg).1 members.2.2.2 + have eqFirst := (finiteWordReverseCode_iff s xs rf).1 + ((M.pair_mem_finiteWordReverseGraph A _ _).1 first).2.2 + have eqSecond := (finiteWordReverseCode_iff s ys rg).1 + ((M.pair_mem_finiteWordReverseGraph A _ _).1 second).2.2 + subst fg rf rg + have eqResult := (finiteWordAppendCode_iff s ys.reverse xs.reverse result).1 + ((M.pair_mem_finiteWordAppendGraph A _ _ _).1 swapped).2.2.2 + subst result + apply (M.pair_mem_finiteWordReverseGraph A _ _).2 + refine ⟨members.2.2.1, resultMember, ?_⟩ + simpa only [s, SetMembers.presentation, List.reverse_append] using + finiteWordGraph_reverse_code s (xs ++ ys) + +theorem finiteWordLength_append {A f g h n k l : ZFSet.{u}} + (append : ZFSet.pair (ZFSet.pair f g) h ∈ M.finiteWordAppendGraph A) + (first : ZFSet.pair f n ∈ M.finiteWordLengthGraph A) + (second : ZFSet.pair g k ∈ M.finiteWordLengthGraph A) + (result : ZFSet.pair h l ∈ M.finiteWordLengthGraph A) : + ZFSet.pair (ZFSet.pair n k) l ∈ natAddGraph := by + have members := (M.pair_mem_finiteWordAppendGraph A _ _ _).1 append + obtain ⟨xs, rfl⟩ := M.decodeWord members.1 + obtain ⟨ys, rfl⟩ := M.decodeWord members.2.1 + let s := SetMembers.presentation A + have eqAppend := (finiteWordAppendCode_iff s xs ys h).1 members.2.2.2 + subst h + have eqFirst := (M.pair_mem_finiteWordLengthGraph_word s xs + ((M.mem_finiteWords A _).1 members.1).1 n).1 first + have eqSecond := (M.pair_mem_finiteWordLengthGraph_word s ys + ((M.mem_finiteWords A _).1 members.2.1).1 k).1 second + have eqResult := (M.pair_mem_finiteWordLengthGraph_word s (xs ++ ys) + ((M.mem_finiteWords A _).1 members.2.2.1).1 l).1 result + rw [eqFirst, eqSecond, eqResult] + exact (pair_mem_natAddGraph xs.length ys.length (xs ++ ys).length).2 List.length_append + +theorem finiteWordLength_reverse {A f g n : ZFSet.{u}} + (reverse : ZFSet.pair f g ∈ M.finiteWordReverseGraph A) + (length : ZFSet.pair f n ∈ M.finiteWordLengthGraph A) : + ZFSet.pair g n ∈ M.finiteWordLengthGraph A := by + have members := (M.pair_mem_finiteWordReverseGraph A _ _).1 reverse + obtain ⟨xs, rfl⟩ := M.decodeWord members.1 + let s := SetMembers.presentation A + have eqReverse := (finiteWordReverseCode_iff s xs g).1 members.2.2 + subst g + have eqLength := (M.pair_mem_finiteWordLengthGraph_word s xs + ((M.mem_finiteWords A _).1 members.1).1 n).1 length + apply (M.pair_mem_finiteWordLengthGraph_word s xs.reverse + ((M.mem_finiteWords A _).1 members.2.1).1 n).2 + simpa only [List.length_reverse] using eqLength + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLength.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLength.lean index b2247dc1832be9b67f514e2dbd8e6db06c63be4e..bdc9e71c066b280a13639d40ed696189073c1ea8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLength.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFiniteWordLength.lean @@ -1,112 +1,112 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordMapCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -open SetRealization SetFormula -universe u - -namespace BoundedFormula - -def finiteWordLengthEntryFormula {n} (z omega alphabet words : Fin n) : BoundedFormula n := - exMem words (exMem omega.succ - (.conj (orderedPairFormula z.succ.succ 1 0) (functionFormula 0 alphabet.succ.succ 1))) - -theorem truth_finiteWordLengthEntryFormula {n} (z omega alphabet words : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (finiteWordLengthEntryFormula z omega alphabet words) env ↔ - ∃ f ∈ env words, ∃ N ∈ env omega, - env z = ZFSet.pair f N ∧ ZFSet.IsFunc N (env alphabet) f := by - simp only [finiteWordLengthEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_functionFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -noncomputable def finiteWordLengthGraph (A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ N ∈ ZFSet.omega, - z = ZFSet.pair f N ∧ ZFSet.IsFunc N A f) - (ZFSet.prod (M.finiteWords A) ZFSet.omega) - -theorem pair_mem_finiteWordLengthGraph (A f N : ZFSet.{u}) : - ZFSet.pair f N ∈ M.finiteWordLengthGraph A ↔ - f ∈ M.finiteWords A ∧ N ∈ ZFSet.omega ∧ ZFSet.IsFunc N A f := by - rw [finiteWordLengthGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, g, hg, K, hK, eq, function⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hg, hK, function⟩ - · rintro ⟨hf, hN, function⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hN⟩, f, hf, N, hN, rfl, function⟩ - -theorem finiteWordLengthGraph_function (A : ZFSet.{u}) : - ZFSet.IsFunc (M.finiteWords A) ZFSet.omega (M.finiteWordLengthGraph A) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro f hf - obtain ⟨_, n, function⟩ := (M.mem_finiteWords A f).1 hf - refine ⟨natSetCode n, (M.pair_mem_finiteWordLengthGraph A f _).2 - ⟨hf, natSetCode_mem_omega n, function⟩, ?_⟩ - intro N entry - obtain ⟨_, hN, other⟩ := (M.pair_mem_finiteWordLengthGraph A f N).1 entry - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode N).1 hN - exact congrArg natSetCode (finiteWord_domain_unique other function) - -theorem pair_mem_finiteWordLengthGraph_word {B : Type u} (s : Presentation B) - (xs : List B) (hWord : finiteWordGraph s xs ∈ M.sets) (N : ZFSet.{u}) : - ZFSet.pair (finiteWordGraph s xs) N ∈ M.finiteWordLengthGraph s.carrier ↔ - N = natSetCode xs.length := by - rw [M.pair_mem_finiteWordLengthGraph] - constructor - · rintro ⟨_, hN, function⟩ - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode N).1 hN - exact congrArg natSetCode (finiteWord_domain_unique function (finiteWordGraph_function s xs)) - · intro eq - subst N - exact ⟨(M.mem_finiteWords _ _).2 ⟨hWord, xs.length, finiteWordGraph_function s xs⟩, - natSetCode_mem_omega _, finiteWordGraph_function s xs⟩ - -theorem finiteWordLengthGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWordLengthGraph A ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - have hWords := M.finiteWords_mem pairing unions powers separation infinite hA - have space := M.prod_mem pairing unions powers separation hWords hOmega - let params := extend ZFSet.omega (extend A (extend (M.finiteWords A) Fin.elim0)) - have selected := M.separation_mem separation - (BoundedFormula.finiteWordLengthEntryFormula 0 1 2 3).toFormula params - (Fin.cases hOmega (Fin.cases hA (Fin.cases hWords (fun j => Fin.elim0 j)))) space - have correct (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets (BoundedFormula.finiteWordLengthEntryFormula 0 1 2 3).toFormula - (extend z params) ↔ - ∃ f ∈ M.finiteWords A, ∃ N ∈ ZFSet.omega, - z = ZFSet.pair f N ∧ ZFSet.IsFunc N A f := - (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hz (Fin.cases hOmega (Fin.cases hA (Fin.cases hWords - (fun j => Fin.elim0 j)))))).trans - (BoundedFormula.truth_finiteWordLengthEntryFormula 0 1 2 3 _) - have eq : ZFSet.sep (fun z => Realize M.sets - (BoundedFormula.finiteWordLengthEntryFormula 0 1 2 3).toFormula (extend z params)) - (ZFSet.prod (M.finiteWords A) ZFSet.omega) = M.finiteWordLengthGraph A := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, finiteWordLengthGraph, ZFSet.mem_sep] - exact and_congr_right (fun hz => correct z (M.transitive space hz)) - exact eq ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordMapCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +open SetRealization SetFormula +universe u + +namespace BoundedFormula + +def finiteWordLengthEntryFormula {n} (z omega alphabet words : Fin n) : BoundedFormula n := + exMem words (exMem omega.succ + (.conj (orderedPairFormula z.succ.succ 1 0) (functionFormula 0 alphabet.succ.succ 1))) + +theorem truth_finiteWordLengthEntryFormula {n} (z omega alphabet words : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (finiteWordLengthEntryFormula z omega alphabet words) env ↔ + ∃ f ∈ env words, ∃ N ∈ env omega, + env z = ZFSet.pair f N ∧ ZFSet.IsFunc N (env alphabet) f := by + simp only [finiteWordLengthEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_functionFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +noncomputable def finiteWordLengthGraph (A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ f ∈ M.finiteWords A, ∃ N ∈ ZFSet.omega, + z = ZFSet.pair f N ∧ ZFSet.IsFunc N A f) + (ZFSet.prod (M.finiteWords A) ZFSet.omega) + +theorem pair_mem_finiteWordLengthGraph (A f N : ZFSet.{u}) : + ZFSet.pair f N ∈ M.finiteWordLengthGraph A ↔ + f ∈ M.finiteWords A ∧ N ∈ ZFSet.omega ∧ ZFSet.IsFunc N A f := by + rw [finiteWordLengthGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, g, hg, K, hK, eq, function⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hg, hK, function⟩ + · rintro ⟨hf, hN, function⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hf, hN⟩, f, hf, N, hN, rfl, function⟩ + +theorem finiteWordLengthGraph_function (A : ZFSet.{u}) : + ZFSet.IsFunc (M.finiteWords A) ZFSet.omega (M.finiteWordLengthGraph A) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro f hf + obtain ⟨_, n, function⟩ := (M.mem_finiteWords A f).1 hf + refine ⟨natSetCode n, (M.pair_mem_finiteWordLengthGraph A f _).2 + ⟨hf, natSetCode_mem_omega n, function⟩, ?_⟩ + intro N entry + obtain ⟨_, hN, other⟩ := (M.pair_mem_finiteWordLengthGraph A f N).1 entry + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode N).1 hN + exact congrArg natSetCode (finiteWord_domain_unique other function) + +theorem pair_mem_finiteWordLengthGraph_word {B : Type u} (s : Presentation B) + (xs : List B) (hWord : finiteWordGraph s xs ∈ M.sets) (N : ZFSet.{u}) : + ZFSet.pair (finiteWordGraph s xs) N ∈ M.finiteWordLengthGraph s.carrier ↔ + N = natSetCode xs.length := by + rw [M.pair_mem_finiteWordLengthGraph] + constructor + · rintro ⟨_, hN, function⟩ + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode N).1 hN + exact congrArg natSetCode (finiteWord_domain_unique function (finiteWordGraph_function s xs)) + · intro eq + subst N + exact ⟨(M.mem_finiteWords _ _).2 ⟨hWord, xs.length, finiteWordGraph_function s xs⟩, + natSetCode_mem_omega _, finiteWordGraph_function s xs⟩ + +theorem finiteWordLengthGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) : M.finiteWordLengthGraph A ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + have hWords := M.finiteWords_mem pairing unions powers separation infinite hA + have space := M.prod_mem pairing unions powers separation hWords hOmega + let params := extend ZFSet.omega (extend A (extend (M.finiteWords A) Fin.elim0)) + have selected := M.separation_mem separation + (BoundedFormula.finiteWordLengthEntryFormula 0 1 2 3).toFormula params + (Fin.cases hOmega (Fin.cases hA (Fin.cases hWords (fun j => Fin.elim0 j)))) space + have correct (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets (BoundedFormula.finiteWordLengthEntryFormula 0 1 2 3).toFormula + (extend z params) ↔ + ∃ f ∈ M.finiteWords A, ∃ N ∈ ZFSet.omega, + z = ZFSet.pair f N ∧ ZFSet.IsFunc N A f := + (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hz (Fin.cases hOmega (Fin.cases hA (Fin.cases hWords + (fun j => Fin.elim0 j)))))).trans + (BoundedFormula.truth_finiteWordLengthEntryFormula 0 1 2 3 _) + have eq : ZFSet.sep (fun z => Realize M.sets + (BoundedFormula.finiteWordLengthEntryFormula 0 1 2 3).toFormula (extend z params)) + (ZFSet.prod (M.finiteWords A) ZFSet.omega) = M.finiteWordLengthGraph A := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, finiteWordLengthGraph, ZFSet.mem_sep] + exact and_congr_right (fun hz => correct z (M.transitive space hz)) + exact eq ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFixedTopOrders.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFixedTopOrders.lean index e83023910e3e73d52dcb3da2eb4554ca5a169475..30ddbd1d6e43b257bc291ad0372a5e3a43f1047a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFixedTopOrders.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundFixedTopOrders.lean @@ -1,80 +1,80 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem fixedTopCarrier_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {P : ZFSet.{u}} (hP : P ∈ M.sets) : fixedTopCarrier P ∈ M.sets := - M.insert_mem pairing unions hP hP - -theorem fixedTopOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) : fixedTopOrder P r ∈ M.sets := by - have singleton : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - exact M.binary_union_mem pairing unions hr (M.prod_mem pairing unions powers separation - (M.fixedTopCarrier_mem pairing unions hP) singleton) - -theorem fixedTopMeet_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) : fixedTopMeet P r ∈ M.sets := - M.canonicalMeetGraph_mem pairing unions powers separation - (M.fixedTopCarrier_mem pairing unions hP) (M.fixedTopOrder_mem pairing unions powers separation hP hr) - -theorem fixedTop_ground_codes - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) : - fixedTopCarrier P ∈ M.sets ∧ fixedTopOrder P r ∈ M.sets ∧ fixedTopMeet P r ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets := - ⟨M.fixedTopCarrier_mem pairing unions hP, M.fixedTopOrder_mem pairing unions powers separation hP hr, - M.fixedTopMeet_mem pairing unions powers separation hP hr, - M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP⟩ - -theorem exists_fixedTopOrder - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r μ : ZFSet.{u}} (old : MeetOrderCode P r μ) - (hP : P ∈ M.sets) (hr : r ∈ M.sets) : - ∃ L ∈ M.sets, ∃ s ∈ M.sets, ∃ ν ∈ M.sets, ∃ e ∈ M.sets, - L = fixedTopCarrier P ∧ s = fixedTopOrder P r ∧ ν = fixedTopMeet P r ∧ - e = attachmentOldEmbeddingGraph P ∧ MeetOrderCode L s ν ∧ - MeetEmbeddingCode P L r s μ ν e ∧ P ∈ L ∧ P ∉ P ∧ - P ⊆ L ∧ r ⊆ s ∧ μ ⊆ ν ∧ - (∀ x ∈ L, ZFSet.pair x P ∈ s) ∧ - (∀ x ∈ P, ZFSet.pair P x ∉ s) ∧ - (∀ x y, y ∈ P → (ZFSet.pair x y ∈ s ↔ ZFSet.pair x y ∈ r)) ∧ - (∀ x ∈ P, ∀ y ∈ P, ∀ z, ZFSet.pair (ZFSet.pair x y) z ∈ ν ↔ - ZFSet.pair (ZFSet.pair x y) z ∈ μ) ∧ - (∀ x y, y ∈ P → ZFSet.pair x y ∈ s → x ∈ P) := by - obtain ⟨hL, hs, hν, he⟩ := M.fixedTop_ground_codes pairing unions powers separation hP hr - exact ⟨fixedTopCarrier P, hL, fixedTopOrder P r, hs, fixedTopMeet P r, hν, - attachmentOldEmbeddingGraph P, he, rfl, rfl, rfl, rfl, fixedTopMeet_code old, - fixedTopOldEmbedding_code old, fixedTopCarrier_top P, ZFSet.mem_irrefl P, - fixedTopCarrier_subset P, fixedTopOrder_subset P r, fixedTopMeet_subset old, - fun _ hx => fixedTopOrder_greatest hx, - fun _ hx => (fixedTopOrder_strict_top old.order hx).2, - fun _ _ hy => fixedTopOrder_old_iff hy, - fun _ hx _ hy _ => fixedTopMeet_old_iff old hx hy, - fun _ _ hy entry => fixedTopOrder_no_new_below old.order hy entry⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem fixedTopCarrier_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {P : ZFSet.{u}} (hP : P ∈ M.sets) : fixedTopCarrier P ∈ M.sets := + M.insert_mem pairing unions hP hP + +theorem fixedTopOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) : fixedTopOrder P r ∈ M.sets := by + have singleton : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + exact M.binary_union_mem pairing unions hr (M.prod_mem pairing unions powers separation + (M.fixedTopCarrier_mem pairing unions hP) singleton) + +theorem fixedTopMeet_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) : fixedTopMeet P r ∈ M.sets := + M.canonicalMeetGraph_mem pairing unions powers separation + (M.fixedTopCarrier_mem pairing unions hP) (M.fixedTopOrder_mem pairing unions powers separation hP hr) + +theorem fixedTop_ground_codes + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r : ZFSet.{u}} (hP : P ∈ M.sets) (hr : r ∈ M.sets) : + fixedTopCarrier P ∈ M.sets ∧ fixedTopOrder P r ∈ M.sets ∧ fixedTopMeet P r ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets := + ⟨M.fixedTopCarrier_mem pairing unions hP, M.fixedTopOrder_mem pairing unions powers separation hP hr, + M.fixedTopMeet_mem pairing unions powers separation hP hr, + M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP⟩ + +theorem exists_fixedTopOrder + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r μ : ZFSet.{u}} (old : MeetOrderCode P r μ) + (hP : P ∈ M.sets) (hr : r ∈ M.sets) : + ∃ L ∈ M.sets, ∃ s ∈ M.sets, ∃ ν ∈ M.sets, ∃ e ∈ M.sets, + L = fixedTopCarrier P ∧ s = fixedTopOrder P r ∧ ν = fixedTopMeet P r ∧ + e = attachmentOldEmbeddingGraph P ∧ MeetOrderCode L s ν ∧ + MeetEmbeddingCode P L r s μ ν e ∧ P ∈ L ∧ P ∉ P ∧ + P ⊆ L ∧ r ⊆ s ∧ μ ⊆ ν ∧ + (∀ x ∈ L, ZFSet.pair x P ∈ s) ∧ + (∀ x ∈ P, ZFSet.pair P x ∉ s) ∧ + (∀ x y, y ∈ P → (ZFSet.pair x y ∈ s ↔ ZFSet.pair x y ∈ r)) ∧ + (∀ x ∈ P, ∀ y ∈ P, ∀ z, ZFSet.pair (ZFSet.pair x y) z ∈ ν ↔ + ZFSet.pair (ZFSet.pair x y) z ∈ μ) ∧ + (∀ x y, y ∈ P → ZFSet.pair x y ∈ s → x ∈ P) := by + obtain ⟨hL, hs, hν, he⟩ := M.fixedTop_ground_codes pairing unions powers separation hP hr + exact ⟨fixedTopCarrier P, hL, fixedTopOrder P r, hs, fixedTopMeet P r, hν, + attachmentOldEmbeddingGraph P, he, rfl, rfl, rfl, rfl, fixedTopMeet_code old, + fixedTopOldEmbedding_code old, fixedTopCarrier_top P, ZFSet.mem_irrefl P, + fixedTopCarrier_subset P, fixedTopOrder_subset P r, fixedTopMeet_subset old, + fun _ hx => fixedTopOrder_greatest hx, + fun _ hx => (fixedTopOrder_strict_top old.order hx).2, + fun _ _ hy => fixedTopOrder_old_iff hy, + fun _ hx _ hy _ => fixedTopMeet_old_iff old hx hy, + fun _ _ hy entry => fixedTopOrder_no_new_below old.order hy entry⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundForcedSequenceReadings.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundForcedSequenceReadings.lean index 3f9e5709e72d696ec19490627655f67c3c1e74d2..52ad7bc9734cf24952a4f43397bd285a42942314 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundForcedSequenceReadings.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundForcedSequenceReadings.lean @@ -1,91 +1,91 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNameSequenceValues - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include order choice in -theorem forcedSequence_groundReadings_dense (small : M.sets.Countable) - {U : ZFSet.{u}} (hU : U ∈ M.sets) (closed : InternallyCountablyClosed M s) - (tau : (M.nameDomain s).names) {base : P} - (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula - (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier - (M.omega_mem separation infinite) hU tau) base) : - let D := Name.sequenceDecisionRelation s ⊤ tau.val ZFSet.omega U - D ∈ M.sets ∧ DenseBelow base {q | ∃ f ∈ M.sets, - ZFSet.IsFunc ZFSet.omega U f ∧ f = decisionValues U D (s.encode q) ∧ - Name.ForcesEq q tau.val (Name.check s ⊤ f)} := by - let D := Name.sequenceDecisionRelation s ⊤ tau.val ZFSet.omega U - have hN := M.omega_mem separation infinite - have hD : D ∈ M.sets := M.sequenceDecisionRelation_mem s ⊤ pairing unions powers - separation collection carrier order tau hN hU - have persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D := by - intro p q before n hn a ha entry - exact (Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U q n a).2 - ⟨hn, ha, Name.sequenceDecision_mono s ⊤ tau.val before - ((Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U p n a).1 entry).2.2⟩ - have unique : ∀ p : P, p ≤ base → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, - ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → - ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D → a = b := by - intro p before n hn a ha b hb first second - exact M.sequenceDecision_unique_below s pairing unions powers separation collection carrier - small hN hU tau forced before hn ha hb - ((Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U p n a).1 first).2.2 - ((Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U p n b).1 second).2.2 - have dense : ∀ n ∈ ZFSet.omega, DenseBelow base - {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D} := by - intro n hn p before - obtain ⟨q, qp, a, ha, decision⟩ := M.sequenceDecision_dense_below s pairing unions powers - separation collection carrier small hN hU tau forced hn p before - exact ⟨q, qp, a, ha, - (Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U q n a).2 ⟨hn, ha, decision⟩⟩ - have common := M.internally_commonDecisions_denseBelow s pairing unions powers separation - infinite choice carrier order hU hD closed base persistent dense - refine ⟨hD, ?_⟩ - intro p before - obtain ⟨q, qp, qbase, total⟩ := common p before - let f := decisionValues U D (s.encode q) - have hf : f ∈ M.sets := M.decisionValues_mem pairing unions powers separation infinite - hU hD (M.transitive carrier (s.encode_mem q)) - have function : ZFSet.IsFunc ZFSet.omega U f := - decisionValues_function total (unique q qbase) - have hcheck := M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) f hf - have equal : Name.ForcesEq q tau.val (Name.check s ⊤ f) := by - change Forces (M.nameDomain s) (.equal 0 1 : SetFormula 2) ![tau, ⟨_, hcheck⟩] q - apply (M.ordinaryForces_iff_all_generics s small carrier - (.equal 0 1 : SetFormula 2) ![tau, ⟨_, hcheck⟩] q).2 - intro H hq generic - have actual := M.sequenceFunction_eval s pairing unions powers separation collection carrier - hN hU tau H generic (H.upward hq qbase) forced - have reading := decisionValues_eq_reading s base persistent unique H hq qbase total actual - (fun n hn a ha entry => by - obtain ⟨r, hr, decision⟩ := (M.sequenceDecision_reading s pairing unions powers separation - collection carrier tau n a (M.transitive hN hn) (M.transitive hU ha) H generic).1 entry - exact ⟨r, hr, (Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U r n a).2 - ⟨hn, ha, decision⟩⟩) - change Name.eval {r | H.mem r} tau.val = Name.eval {r | H.mem r} (Name.check s ⊤ f) - rw [Name.eval_check (s := s) {r | H.mem r} ⊤ H.top_mem] - exact reading.symm - exact ⟨q, qp, f, hf, function, rfl, equal⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNameSequenceValues + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include order choice in +theorem forcedSequence_groundReadings_dense (small : M.sets.Countable) + {U : ZFSet.{u}} (hU : U ∈ M.sets) (closed : InternallyCountablyClosed M s) + (tau : (M.nameDomain s).names) {base : P} + (forced : Forces (M.nameDomain s) (BoundedFormula.functionFormula 0 1 2).toFormula + (M.sequenceFunctionNameEnv s pairing unions powers separation collection carrier + (M.omega_mem separation infinite) hU tau) base) : + let D := Name.sequenceDecisionRelation s ⊤ tau.val ZFSet.omega U + D ∈ M.sets ∧ DenseBelow base {q | ∃ f ∈ M.sets, + ZFSet.IsFunc ZFSet.omega U f ∧ f = decisionValues U D (s.encode q) ∧ + Name.ForcesEq q tau.val (Name.check s ⊤ f)} := by + let D := Name.sequenceDecisionRelation s ⊤ tau.val ZFSet.omega U + have hN := M.omega_mem separation infinite + have hD : D ∈ M.sets := M.sequenceDecisionRelation_mem s ⊤ pairing unions powers + separation collection carrier order tau hN hU + have persistent : ∀ p q : P, q ≤ p → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D := by + intro p q before n hn a ha entry + exact (Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U q n a).2 + ⟨hn, ha, Name.sequenceDecision_mono s ⊤ tau.val before + ((Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U p n a).1 entry).2.2⟩ + have unique : ∀ p : P, p ≤ base → ∀ n ∈ ZFSet.omega, ∀ a ∈ U, ∀ b ∈ U, + ZFSet.pair (ZFSet.pair (s.encode p) n) a ∈ D → + ZFSet.pair (ZFSet.pair (s.encode p) n) b ∈ D → a = b := by + intro p before n hn a ha b hb first second + exact M.sequenceDecision_unique_below s pairing unions powers separation collection carrier + small hN hU tau forced before hn ha hb + ((Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U p n a).1 first).2.2 + ((Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U p n b).1 second).2.2 + have dense : ∀ n ∈ ZFSet.omega, DenseBelow base + {q | ∃ a ∈ U, ZFSet.pair (ZFSet.pair (s.encode q) n) a ∈ D} := by + intro n hn p before + obtain ⟨q, qp, a, ha, decision⟩ := M.sequenceDecision_dense_below s pairing unions powers + separation collection carrier small hN hU tau forced hn p before + exact ⟨q, qp, a, ha, + (Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U q n a).2 ⟨hn, ha, decision⟩⟩ + have common := M.internally_commonDecisions_denseBelow s pairing unions powers separation + infinite choice carrier order hU hD closed base persistent dense + refine ⟨hD, ?_⟩ + intro p before + obtain ⟨q, qp, qbase, total⟩ := common p before + let f := decisionValues U D (s.encode q) + have hf : f ∈ M.sets := M.decisionValues_mem pairing unions powers separation infinite + hU hD (M.transitive carrier (s.encode_mem q)) + have function : ZFSet.IsFunc ZFSet.omega U f := + decisionValues_function total (unique q qbase) + have hcheck := M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) f hf + have equal : Name.ForcesEq q tau.val (Name.check s ⊤ f) := by + change Forces (M.nameDomain s) (.equal 0 1 : SetFormula 2) ![tau, ⟨_, hcheck⟩] q + apply (M.ordinaryForces_iff_all_generics s small carrier + (.equal 0 1 : SetFormula 2) ![tau, ⟨_, hcheck⟩] q).2 + intro H hq generic + have actual := M.sequenceFunction_eval s pairing unions powers separation collection carrier + hN hU tau H generic (H.upward hq qbase) forced + have reading := decisionValues_eq_reading s base persistent unique H hq qbase total actual + (fun n hn a ha entry => by + obtain ⟨r, hr, decision⟩ := (M.sequenceDecision_reading s pairing unions powers separation + collection carrier tau n a (M.transitive hN hn) (M.transitive hU ha) H generic).1 entry + exact ⟨r, hr, (Name.sequenceDecisionRelation_entry s ⊤ tau.val ZFSet.omega U r n a).2 + ⟨hn, ha, decision⟩⟩) + change Name.eval {r | H.mem r} tau.val = Name.eval {r | H.mem r} (Name.check s ⊤ f) + rw [Name.eval_check (s := s) {r | H.mem r} ⊤ H.top_mem] + exact reading.symm + exact ⟨q, qp, f, hf, function, rfl, equal⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGeometry.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGeometry.lean index 70c6eaf0a91a8192846b915447bc0dd82462985f..0d980ca06ceec8bfca1ff9c7c1fe536d22b02e9c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGeometry.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGeometry.lean @@ -1,151 +1,151 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.InitialRowForcing -import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalInsertionStages - -namespace OAI - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open CountableColumns -variable (Label : Type 1) - -theorem final_insertion_data (C E D : FinalPoint Label) (F : MeetFilter (finalOrder Label)) : - ∃ (a : Column) (c e d : (stage Label a).Point) (H : MeetFilter (stage Label a).order), - (finalInclusion Label a).toFun c = C ∧ (finalInclusion Label a).toFun e = E ∧ - (finalInclusion Label a).toFun d = D ∧ pushFilter (finalInclusion Label a) H = F := by - rcases final_filters_localized Label F with ⟨a, localized⟩ - rcases (diagram Label).orders.system.triple_cover (diagram Label).orders.system - (diagram Label).orders.system C E D with ⟨b, c, e, d, hc, he, hd⟩ - let inc := finalInclusion Label (max a b) - have localize : ∀ x, F.mem x → ∃ y, F.mem (inc.toFun y) ∧ (finalOrder Label).le (inc.toFun y) x := by - intro x hx - rcases localized x hx with ⟨y, hy, lower⟩ - refine ⟨(transition Label (le_max_left a b)).points.toFun y, ?_, ?_⟩ - · change F.mem ((finalInclusion Label (max a b)).toFun _) - rw [final_points_coherent] - exact hy - · change (finalOrder Label).le ((finalInclusion Label (max a b)).toFun _) x - rw [final_points_coherent] - exact lower - let H : MeetFilter (stage Label (max a b)).order := { - mem := fun y => F.mem (inc.toFun y) - nonempty := by - rcases F.nonempty with ⟨x, hx⟩ - rcases localize x hx with ⟨y, hy, _⟩ - exact ⟨y, hy⟩ - upward := fun hx lower => F.upward hx ((inc.le_iff _ _).mpr lower) - closed_meet := by - intro x y hx hy - rw [inc.map_meet] - exact F.closed_meet hx hy } - refine ⟨max a b, (transition Label (le_max_right a b)).points.toFun c, - (transition Label (le_max_right a b)).points.toFun e, - (transition Label (le_max_right a b)).points.toFun d, H, - (final_points_coherent Label (le_max_right a b) c).trans hc, - (final_points_coherent Label (le_max_right a b) e).trans he, - (final_points_coherent Label (le_max_right a b) d).trans hd, ?_⟩ - apply meetFilter_ext - intro x - constructor - · rintro ⟨y, hy, lower⟩ - exact F.upward hy lower - · intro hx - exact localize x hx - -theorem final_insertion (C E D : FinalPoint Label) (F : MeetFilter (finalOrder Label)) - (ce : (finalOrder Label).le C E) (strict : ¬ (finalOrder Label).le E C) - (above : ∀ x, F.mem x → (finalOrder Label).le E x) : - HasInsertionFamily (finalAction Label) Label C E D F.mem := by - rcases final_insertion_data Label C E D F with ⟨a, c, e, d, H, hc, he, hd, hF⟩ - have ce' : (stage Label a).order.le c e := by - apply ((finalInclusion Label a).le_iff _ _).mp - rw [hc, he] - exact ce - have strict' : ¬ (stage Label a).order.le e c := by - intro lower - apply strict - rw [← he, ← hc] - exact ((finalInclusion Label a).le_iff _ _).mpr lower - have above' : ∀ x, H.mem x → (stage Label a).order.le e x := by - intro x hx - apply ((finalInclusion Label a).le_iff _ _).mp - rw [he] - apply above - rw [← hF] - exact ⟨x, hx, (finalOrder Label).refl _⟩ - have result := final_inserts_at Label a c e d H ce' strict' above' - rw [hc, he, hd, hF] at result - exact result - -theorem countableOrdinalLabels_final_insertion (C E D : FinalPoint Column) - (F : MeetFilter (finalOrder Column)) - (ce : (finalOrder Column).le C E) (strict : ¬ (finalOrder Column).le E C) - (above : ∀ x, F.mem x → (finalOrder Column).le E x) : - HasInsertionFamily (finalAction Column) Column C E D F.mem := - final_insertion Column C E D F ce strict above - -theorem final_insertion_distinct_caps (C E D : FinalPoint Label) - (F : MeetFilter (finalOrder Label)) - (ce : (finalOrder Label).le C E) (strict : ¬ (finalOrder Label).le E C) - (above : ∀ x, F.mem x → (finalOrder Label).le E x) : - ∃ caps : Label → FinalPoint Label, Function.Injective caps ∧ - ∀ l, (finalOrder Label).le C (caps l) ∧ ¬ (finalOrder Label).le (caps l) C := by - classical - rcases final_insertion Label C E D F ce strict above with - ⟨caps, _, _, _, strictCaps, _, pairs, _⟩ - refine ⟨caps, ?_, strictCaps⟩ - intro i j eq - by_cases same : i = j - · exact same - · have meet := pairs i j same - rw [eq, meet_eq_left_of_le (finalOrder Label) ((finalOrder Label).refl (caps j))] at meet - exact False.elim ((strictCaps j).2 (meet ▸ (finalOrder Label).refl (caps j))) - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -namespace PartitionPilot.Compression.RecursiveMaps - -open Cardinal CosetGeometry Chronological -open scoped Cardinal - -structure GroundGeometryLaws {A G : Type 1} [Group G] (P : MeetOrder A) - (a : OrderAction G P) (κ : Cardinal.{1}) : Prop where - nodes_small : #A < κ - actors_small : #G < κ - bottom : ∃ b, ∀ x, P.le b x - countable_upper : ∀ B : Set A, B.Countable → ∃ top, ∀ x ∈ B, P.le x top - strict_extension : ∀ x, ∃ y, P.le x y ∧ ¬ P.le y x - filter_basis : AllFiltersCountable P - separation : ∀ W D X, P.le W D → P.le W X → - ∃ g, (∀ z, P.le z W → (a.iso g).toFun z = z) ∧ P.meet ((a.iso g).toFun D) X = W - rectangles : ∀ (r : ActionRectangle P a.iso) X, - P.le ((a.iso r.first).toFun r.D) X → P.le ((a.iso r.second).toFun r.D) X → - ∃ h1 h2, - (∀ z, P.le z r.C → (a.iso h1).toFun z = (a.iso r.first).toFun z) ∧ - (∀ z, P.le z r.C → (a.iso h2).toFun z = (a.iso r.second).toFun z) ∧ - (∀ z, P.le z r.B → (a.iso h1).toFun z = (a.iso h2).toFun z) ∧ - P.meet ((a.iso h1).toFun r.D) X = (a.iso r.first).toFun r.C ∧ - P.meet ((a.iso h2).toFun r.D) X = (a.iso r.second).toFun r.C ∧ - P.meet ((a.iso h1).toFun r.D) ((a.iso h2).toFun r.D) = (a.iso h1).toFun r.B - insertion : ∀ C E D (F : MeetFilter P), P.le C E → ¬ P.le E C → - (∀ x, F.mem x → P.le E x) → HasInsertionFamily a CountableColumns.Column C E D F.mem - -namespace MainStage.OrdinalRun -open CountableColumns - -theorem countableOrdinalLabels_ground_geometry (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : - GroundGeometryLaws (finalOrder Column) (finalAction Column) κ where - nodes_small := (countableOrdinalLabels_final_cardinal_bounds κ inaccessible).1 - actors_small := (countableOrdinalLabels_final_cardinal_bounds κ inaccessible).2 - bottom := ⟨finalBottom Column, finalBottom_least Column⟩ - countable_upper := final_countable_upper_bound Column - strict_extension := final_no_maximal Column - filter_basis := final_all_filters_countable Column - separation := final_separation Column - rectangles := final_rectangles Column - insertion := countableOrdinalLabels_final_insertion - -end MainStage.OrdinalRun - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.InitialRowForcing +import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalInsertionStages + +namespace OAI + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open CountableColumns +variable (Label : Type 1) + +theorem final_insertion_data (C E D : FinalPoint Label) (F : MeetFilter (finalOrder Label)) : + ∃ (a : Column) (c e d : (stage Label a).Point) (H : MeetFilter (stage Label a).order), + (finalInclusion Label a).toFun c = C ∧ (finalInclusion Label a).toFun e = E ∧ + (finalInclusion Label a).toFun d = D ∧ pushFilter (finalInclusion Label a) H = F := by + rcases final_filters_localized Label F with ⟨a, localized⟩ + rcases (diagram Label).orders.system.triple_cover (diagram Label).orders.system + (diagram Label).orders.system C E D with ⟨b, c, e, d, hc, he, hd⟩ + let inc := finalInclusion Label (max a b) + have localize : ∀ x, F.mem x → ∃ y, F.mem (inc.toFun y) ∧ (finalOrder Label).le (inc.toFun y) x := by + intro x hx + rcases localized x hx with ⟨y, hy, lower⟩ + refine ⟨(transition Label (le_max_left a b)).points.toFun y, ?_, ?_⟩ + · change F.mem ((finalInclusion Label (max a b)).toFun _) + rw [final_points_coherent] + exact hy + · change (finalOrder Label).le ((finalInclusion Label (max a b)).toFun _) x + rw [final_points_coherent] + exact lower + let H : MeetFilter (stage Label (max a b)).order := { + mem := fun y => F.mem (inc.toFun y) + nonempty := by + rcases F.nonempty with ⟨x, hx⟩ + rcases localize x hx with ⟨y, hy, _⟩ + exact ⟨y, hy⟩ + upward := fun hx lower => F.upward hx ((inc.le_iff _ _).mpr lower) + closed_meet := by + intro x y hx hy + rw [inc.map_meet] + exact F.closed_meet hx hy } + refine ⟨max a b, (transition Label (le_max_right a b)).points.toFun c, + (transition Label (le_max_right a b)).points.toFun e, + (transition Label (le_max_right a b)).points.toFun d, H, + (final_points_coherent Label (le_max_right a b) c).trans hc, + (final_points_coherent Label (le_max_right a b) e).trans he, + (final_points_coherent Label (le_max_right a b) d).trans hd, ?_⟩ + apply meetFilter_ext + intro x + constructor + · rintro ⟨y, hy, lower⟩ + exact F.upward hy lower + · intro hx + exact localize x hx + +theorem final_insertion (C E D : FinalPoint Label) (F : MeetFilter (finalOrder Label)) + (ce : (finalOrder Label).le C E) (strict : ¬ (finalOrder Label).le E C) + (above : ∀ x, F.mem x → (finalOrder Label).le E x) : + HasInsertionFamily (finalAction Label) Label C E D F.mem := by + rcases final_insertion_data Label C E D F with ⟨a, c, e, d, H, hc, he, hd, hF⟩ + have ce' : (stage Label a).order.le c e := by + apply ((finalInclusion Label a).le_iff _ _).mp + rw [hc, he] + exact ce + have strict' : ¬ (stage Label a).order.le e c := by + intro lower + apply strict + rw [← he, ← hc] + exact ((finalInclusion Label a).le_iff _ _).mpr lower + have above' : ∀ x, H.mem x → (stage Label a).order.le e x := by + intro x hx + apply ((finalInclusion Label a).le_iff _ _).mp + rw [he] + apply above + rw [← hF] + exact ⟨x, hx, (finalOrder Label).refl _⟩ + have result := final_inserts_at Label a c e d H ce' strict' above' + rw [hc, he, hd, hF] at result + exact result + +theorem countableOrdinalLabels_final_insertion (C E D : FinalPoint Column) + (F : MeetFilter (finalOrder Column)) + (ce : (finalOrder Column).le C E) (strict : ¬ (finalOrder Column).le E C) + (above : ∀ x, F.mem x → (finalOrder Column).le E x) : + HasInsertionFamily (finalAction Column) Column C E D F.mem := + final_insertion Column C E D F ce strict above + +theorem final_insertion_distinct_caps (C E D : FinalPoint Label) + (F : MeetFilter (finalOrder Label)) + (ce : (finalOrder Label).le C E) (strict : ¬ (finalOrder Label).le E C) + (above : ∀ x, F.mem x → (finalOrder Label).le E x) : + ∃ caps : Label → FinalPoint Label, Function.Injective caps ∧ + ∀ l, (finalOrder Label).le C (caps l) ∧ ¬ (finalOrder Label).le (caps l) C := by + classical + rcases final_insertion Label C E D F ce strict above with + ⟨caps, _, _, _, strictCaps, _, pairs, _⟩ + refine ⟨caps, ?_, strictCaps⟩ + intro i j eq + by_cases same : i = j + · exact same + · have meet := pairs i j same + rw [eq, meet_eq_left_of_le (finalOrder Label) ((finalOrder Label).refl (caps j))] at meet + exact False.elim ((strictCaps j).2 (meet ▸ (finalOrder Label).refl (caps j))) + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +namespace PartitionPilot.Compression.RecursiveMaps + +open Cardinal CosetGeometry Chronological +open scoped Cardinal + +structure GroundGeometryLaws {A G : Type 1} [Group G] (P : MeetOrder A) + (a : OrderAction G P) (κ : Cardinal.{1}) : Prop where + nodes_small : #A < κ + actors_small : #G < κ + bottom : ∃ b, ∀ x, P.le b x + countable_upper : ∀ B : Set A, B.Countable → ∃ top, ∀ x ∈ B, P.le x top + strict_extension : ∀ x, ∃ y, P.le x y ∧ ¬ P.le y x + filter_basis : AllFiltersCountable P + separation : ∀ W D X, P.le W D → P.le W X → + ∃ g, (∀ z, P.le z W → (a.iso g).toFun z = z) ∧ P.meet ((a.iso g).toFun D) X = W + rectangles : ∀ (r : ActionRectangle P a.iso) X, + P.le ((a.iso r.first).toFun r.D) X → P.le ((a.iso r.second).toFun r.D) X → + ∃ h1 h2, + (∀ z, P.le z r.C → (a.iso h1).toFun z = (a.iso r.first).toFun z) ∧ + (∀ z, P.le z r.C → (a.iso h2).toFun z = (a.iso r.second).toFun z) ∧ + (∀ z, P.le z r.B → (a.iso h1).toFun z = (a.iso h2).toFun z) ∧ + P.meet ((a.iso h1).toFun r.D) X = (a.iso r.first).toFun r.C ∧ + P.meet ((a.iso h2).toFun r.D) X = (a.iso r.second).toFun r.C ∧ + P.meet ((a.iso h1).toFun r.D) ((a.iso h2).toFun r.D) = (a.iso h1).toFun r.B + insertion : ∀ C E D (F : MeetFilter P), P.le C E → ¬ P.le E C → + (∀ x, F.mem x → P.le E x) → HasInsertionFamily a CountableColumns.Column C E D F.mem + +namespace MainStage.OrdinalRun +open CountableColumns + +theorem countableOrdinalLabels_ground_geometry (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : + GroundGeometryLaws (finalOrder Column) (finalAction Column) κ where + nodes_small := (countableOrdinalLabels_final_cardinal_bounds κ inaccessible).1 + actors_small := (countableOrdinalLabels_final_cardinal_bounds κ inaccessible).2 + bottom := ⟨finalBottom Column, finalBottom_least Column⟩ + countable_upper := final_countable_upper_bound Column + strict_extension := final_no_maximal Column + filter_basis := final_all_filters_countable Column + separation := final_separation Column + rectangles := final_rectangles Column + insertion := countableOrdinalLabels_final_insertion + +end MainStage.OrdinalRun + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGrowthLayerRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGrowthLayerRecognition.lean index 273dffc354805eb2e57632940d2ebdada2071ec3..741607b061d16cf09468848baf8ae824ddde8ad8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGrowthLayerRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundGrowthLayerRecognition.lean @@ -1,206 +1,206 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula - -def countableGrowthWitnessFormula {n} (z L birth t N : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let field := prefixIndex n 3 - exBlock 3 (BoundedFormula.countableTaggedLayerFormula - (old z) (field 0) (field 1) (field 2) (old L) (old birth) (old t) (old N)).toFormula - -def copyGrowthWitnessFormula {n} (z Qs rs μs L r μ birth t N : Fin n) : SetFormula n := - let old := suffixIndex n 10 - let field := prefixIndex n 10 - exBlock 10 (BoundedFormula.copyTaggedLayerFormula (old z) - (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6) - (old Qs) (old rs) (old μs) (old L) (old r) (old μ) (old birth) (old t) (old N) - (field 7) (field 8) (field 9)).toFormula - -def separatedGrowthWitnessFormula {n} (z Qs rs μs L r μ birth t : Fin n) : SetFormula n := - let old := suffixIndex n 10 - let field := prefixIndex n 10 - exBlock 10 (BoundedFormula.separatedTaggedLayerFormula (old z) - (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6) - (old Qs) (old rs) (old μs) (old L) (old r) (old μ) (old birth) (old t) - (field 7) (field 8) (field 9)).toFormula - -def growthLayerWitnessFormula {n} (z Qs rs μs L r μ birth t N : Fin n) : SetFormula n := - disj (countableGrowthWitnessFormula z L birth t N) - (disj (copyGrowthWitnessFormula z Qs rs μs L r μ birth t N) - (separatedGrowthWitnessFormula z Qs rs μs L r μ birth t)) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -private theorem realize_boundedExBlock {n} (k : Nat) (φ : BoundedFormula (n + k)) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (exBlock k φ.toFormula) env ↔ - ∃ fields : Fin k → ZFSet.{u}, (∀ i, fields i ∈ M.sets) ∧ - BoundedFormula.Truth φ (extendMany k fields env) := by - rw [realize_exBlock] - constructor - · rintro ⟨fields, ground, recognized⟩ - exact ⟨fields, ground, (BoundedFormula.realize_toFormula M φ _ - (extendMany_members k fields env ground members)).1 recognized⟩ - · rintro ⟨fields, ground, recognized⟩ - exact ⟨fields, ground, (BoundedFormula.realize_toFormula M φ _ - (extendMany_members k fields env ground members)).2 recognized⟩ - -theorem realize_countableGrowthWitnessFormula {n} (z L birth t N : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (countableGrowthWitnessFormula z L birth t N) env ↔ - ∃ D injection, env z = countableLayerWitness D injection ∧ - CountableLayerCode (env L) (env birth) (env t) D (env N) injection := by - rw [countableGrowthWitnessFormula, M.realize_boundedExBlock _ _ env members] - constructor - · rintro ⟨fields, _, recognized⟩ - have meaning := (BoundedFormula.truth_countableTaggedLayerFormula - (suffixIndex n 3 z) (prefixIndex n 3 0) (prefixIndex n 3 1) (prefixIndex n 3 2) - (suffixIndex n 3 L) (suffixIndex n 3 birth) (suffixIndex n 3 t) (suffixIndex n 3 N) - (extendMany 3 fields env)).1 recognized - simp only [extendMany_prefix, extendMany_suffix] at meaning - exact ⟨fields 1, fields 2, meaning.2⟩ - · rintro ⟨D, injection, equal, code⟩ - let fields : Fin 3 → ZFSet.{u} := Fin.cases (natSetCode 0) (Fin.cases D (fun _ => injection)) - have hWitness : countableLayerWitness D injection ∈ M.sets := equal ▸ members z - have ground : ∀ i, fields i ∈ M.sets := - M.nonemptyTupleCode_field_mem 2 fields hWitness - refine ⟨fields, ground, ?_⟩ - apply (BoundedFormula.truth_countableTaggedLayerFormula - (suffixIndex n 3 z) (prefixIndex n 3 0) (prefixIndex n 3 1) (prefixIndex n 3 2) - (suffixIndex n 3 L) (suffixIndex n 3 birth) (suffixIndex n 3 t) (suffixIndex n 3 N) - (extendMany 3 fields env)).2 - simp only [extendMany_prefix, extendMany_suffix] - exact ⟨rfl, equal, code⟩ - -theorem realize_copyGrowthWitnessFormula - (unions : Realize M.sets SetFormula.union Fin.elim0) {n} - (z Qs rs μs L r μ birth t N : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (copyGrowthWitnessFormula z Qs rs μs L r μ birth t N) env ↔ - ∃ I parts Indices Maps W injection, - env z = copyLayerWitness I parts Indices Maps W injection ∧ - CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) - (env t) I parts Indices Maps W (env N) injection := by - rw [copyGrowthWitnessFormula, M.realize_boundedExBlock _ _ env members] - constructor - · rintro ⟨fields, _, recognized⟩ - have meaning := (BoundedFormula.truth_copyTaggedLayerFormula - (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) - (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) - (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) - (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) - (suffixIndex n 10 N) (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) - (extendMany 10 fields env)).1 recognized - simp only [extendMany_prefix, extendMany_suffix] at meaning - exact ⟨fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, - meaning.2.1, meaning.2.2.2.2.2⟩ - · rintro ⟨I, parts, Indices, Maps, W, injection, equal, code⟩ - let stored : Fin 7 → ZFSet.{u} := Fin.cases (natSetCode 1) (Fin.cases I (Fin.cases parts - (Fin.cases Indices (Fin.cases Maps (Fin.cases W (fun _ => injection)))))) - have hWitness : nonemptyTupleCode 6 stored ∈ M.sets := by - change copyLayerWitness I parts Indices Maps W injection ∈ M.sets - exact equal ▸ members z - have storedGround := M.nonemptyTupleCode_field_mem 6 stored hWitness - let fields : Fin 10 → ZFSet.{u} := Fin.cases (natSetCode 1) (Fin.cases I (Fin.cases parts - (Fin.cases Indices (Fin.cases Maps (Fin.cases W (Fin.cases injection - (Fin.cases (⋃₀ ⋃₀ env Qs) (Fin.cases (⋃₀ ⋃₀ env rs) (fun _ => ⋃₀ ⋃₀ env μs))))))))) - have ground : ∀ i, fields i ∈ M.sets := - (Fin.cases (storedGround 0) (Fin.cases (storedGround 1) (Fin.cases (storedGround 2) (Fin.cases (storedGround 3) (Fin.cases (storedGround 4) (Fin.cases (storedGround 5) (Fin.cases (storedGround 6) (Fin.cases (M.union_mem unions (M.union_mem unions (members Qs))) (Fin.cases (M.union_mem unions (M.union_mem unions (members rs))) (fun _ => (M.union_mem unions (M.union_mem unions (members μs))))))))))))) - refine ⟨fields, ground, ?_⟩ - apply (BoundedFormula.truth_copyTaggedLayerFormula - (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) - (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) - (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) - (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) - (suffixIndex n 10 N) (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) - (extendMany 10 fields env)).2 - simp only [extendMany_prefix, extendMany_suffix] - exact ⟨rfl, equal, rfl, rfl, rfl, code⟩ - -theorem realize_separatedGrowthWitnessFormula - (unions : Realize M.sets SetFormula.union Fin.elim0) {n} - (z Qs rs μs L r μ birth t : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env L) (env r) (env μ)) : - Realize M.sets (separatedGrowthWitnessFormula z Qs rs μs L r μ birth t) env ↔ - ∃ I Indices Maps W Components F, - env z = separatedLayerWitness I Indices Maps W Components F ∧ - SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) - (env t) I Indices Maps W Components F := by - rw [separatedGrowthWitnessFormula, M.realize_boundedExBlock _ _ env members] - constructor - · rintro ⟨fields, _, recognized⟩ - have liftedMeet : MeetOrderCode - (extendMany 10 fields env (suffixIndex n 10 L)) - (extendMany 10 fields env (suffixIndex n 10 r)) - (extendMany 10 fields env (suffixIndex n 10 μ)) := by - simpa only [extendMany_suffix] using meet - have meaning := (BoundedFormula.truth_separatedTaggedLayerFormula - (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) - (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) - (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) - (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) - (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) - (extendMany 10 fields env) liftedMeet).1 recognized - simp only [extendMany_prefix, extendMany_suffix] at meaning - exact ⟨fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, - meaning.2.1, meaning.2.2.2.2.2⟩ - · rintro ⟨I, Indices, Maps, W, Components, F, equal, code⟩ - let stored : Fin 7 → ZFSet.{u} := Fin.cases (natSetCode 2) (Fin.cases I (Fin.cases Indices - (Fin.cases Maps (Fin.cases W (Fin.cases Components (fun _ => F)))))) - have hWitness : nonemptyTupleCode 6 stored ∈ M.sets := by - change separatedLayerWitness I Indices Maps W Components F ∈ M.sets - exact equal ▸ members z - have storedGround := M.nonemptyTupleCode_field_mem 6 stored hWitness - let fields : Fin 10 → ZFSet.{u} := Fin.cases (natSetCode 2) (Fin.cases I (Fin.cases Indices - (Fin.cases Maps (Fin.cases W (Fin.cases Components (Fin.cases F - (Fin.cases (⋃₀ ⋃₀ env Qs) (Fin.cases (⋃₀ ⋃₀ env rs) (fun _ => ⋃₀ ⋃₀ env μs))))))))) - have ground : ∀ i, fields i ∈ M.sets := - (Fin.cases (storedGround 0) (Fin.cases (storedGround 1) (Fin.cases (storedGround 2) (Fin.cases (storedGround 3) (Fin.cases (storedGround 4) (Fin.cases (storedGround 5) (Fin.cases (storedGround 6) (Fin.cases (M.union_mem unions (M.union_mem unions (members Qs))) (Fin.cases (M.union_mem unions (M.union_mem unions (members rs))) (fun _ => (M.union_mem unions (M.union_mem unions (members μs))))))))))))) - refine ⟨fields, ground, ?_⟩ - have liftedMeet : MeetOrderCode - (extendMany 10 fields env (suffixIndex n 10 L)) - (extendMany 10 fields env (suffixIndex n 10 r)) - (extendMany 10 fields env (suffixIndex n 10 μ)) := by - simpa only [extendMany_suffix] using meet - apply (BoundedFormula.truth_separatedTaggedLayerFormula - (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) - (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) - (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) - (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) - (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) - (extendMany 10 fields env) liftedMeet).2 - simp only [extendMany_prefix, extendMany_suffix] - exact ⟨rfl, equal, rfl, rfl, rfl, code⟩ - -theorem realize_growthLayerWitnessFormula - (unions : Realize M.sets SetFormula.union Fin.elim0) {n} - (z Qs rs μs L r μ birth t N : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env L) (env r) (env μ)) : - Realize M.sets (growthLayerWitnessFormula z Qs rs μs L r μ birth t N) env ↔ - GrowthLayerWitnessCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) - (env birth) (env t) (env N) (env z) := by - rw [growthLayerWitnessFormula, realize_disj, realize_disj, - M.realize_countableGrowthWitnessFormula z L birth t N env members, - M.realize_copyGrowthWitnessFormula unions z Qs rs μs L r μ birth t N env members, - M.realize_separatedGrowthWitnessFormula unions z Qs rs μs L r μ birth t env members meet] - rfl - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula + +def countableGrowthWitnessFormula {n} (z L birth t N : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let field := prefixIndex n 3 + exBlock 3 (BoundedFormula.countableTaggedLayerFormula + (old z) (field 0) (field 1) (field 2) (old L) (old birth) (old t) (old N)).toFormula + +def copyGrowthWitnessFormula {n} (z Qs rs μs L r μ birth t N : Fin n) : SetFormula n := + let old := suffixIndex n 10 + let field := prefixIndex n 10 + exBlock 10 (BoundedFormula.copyTaggedLayerFormula (old z) + (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6) + (old Qs) (old rs) (old μs) (old L) (old r) (old μ) (old birth) (old t) (old N) + (field 7) (field 8) (field 9)).toFormula + +def separatedGrowthWitnessFormula {n} (z Qs rs μs L r μ birth t : Fin n) : SetFormula n := + let old := suffixIndex n 10 + let field := prefixIndex n 10 + exBlock 10 (BoundedFormula.separatedTaggedLayerFormula (old z) + (field 0) (field 1) (field 2) (field 3) (field 4) (field 5) (field 6) + (old Qs) (old rs) (old μs) (old L) (old r) (old μ) (old birth) (old t) + (field 7) (field 8) (field 9)).toFormula + +def growthLayerWitnessFormula {n} (z Qs rs μs L r μ birth t N : Fin n) : SetFormula n := + disj (countableGrowthWitnessFormula z L birth t N) + (disj (copyGrowthWitnessFormula z Qs rs μs L r μ birth t N) + (separatedGrowthWitnessFormula z Qs rs μs L r μ birth t)) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +private theorem realize_boundedExBlock {n} (k : Nat) (φ : BoundedFormula (n + k)) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (exBlock k φ.toFormula) env ↔ + ∃ fields : Fin k → ZFSet.{u}, (∀ i, fields i ∈ M.sets) ∧ + BoundedFormula.Truth φ (extendMany k fields env) := by + rw [realize_exBlock] + constructor + · rintro ⟨fields, ground, recognized⟩ + exact ⟨fields, ground, (BoundedFormula.realize_toFormula M φ _ + (extendMany_members k fields env ground members)).1 recognized⟩ + · rintro ⟨fields, ground, recognized⟩ + exact ⟨fields, ground, (BoundedFormula.realize_toFormula M φ _ + (extendMany_members k fields env ground members)).2 recognized⟩ + +theorem realize_countableGrowthWitnessFormula {n} (z L birth t N : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (countableGrowthWitnessFormula z L birth t N) env ↔ + ∃ D injection, env z = countableLayerWitness D injection ∧ + CountableLayerCode (env L) (env birth) (env t) D (env N) injection := by + rw [countableGrowthWitnessFormula, M.realize_boundedExBlock _ _ env members] + constructor + · rintro ⟨fields, _, recognized⟩ + have meaning := (BoundedFormula.truth_countableTaggedLayerFormula + (suffixIndex n 3 z) (prefixIndex n 3 0) (prefixIndex n 3 1) (prefixIndex n 3 2) + (suffixIndex n 3 L) (suffixIndex n 3 birth) (suffixIndex n 3 t) (suffixIndex n 3 N) + (extendMany 3 fields env)).1 recognized + simp only [extendMany_prefix, extendMany_suffix] at meaning + exact ⟨fields 1, fields 2, meaning.2⟩ + · rintro ⟨D, injection, equal, code⟩ + let fields : Fin 3 → ZFSet.{u} := Fin.cases (natSetCode 0) (Fin.cases D (fun _ => injection)) + have hWitness : countableLayerWitness D injection ∈ M.sets := equal ▸ members z + have ground : ∀ i, fields i ∈ M.sets := + M.nonemptyTupleCode_field_mem 2 fields hWitness + refine ⟨fields, ground, ?_⟩ + apply (BoundedFormula.truth_countableTaggedLayerFormula + (suffixIndex n 3 z) (prefixIndex n 3 0) (prefixIndex n 3 1) (prefixIndex n 3 2) + (suffixIndex n 3 L) (suffixIndex n 3 birth) (suffixIndex n 3 t) (suffixIndex n 3 N) + (extendMany 3 fields env)).2 + simp only [extendMany_prefix, extendMany_suffix] + exact ⟨rfl, equal, code⟩ + +theorem realize_copyGrowthWitnessFormula + (unions : Realize M.sets SetFormula.union Fin.elim0) {n} + (z Qs rs μs L r μ birth t N : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (copyGrowthWitnessFormula z Qs rs μs L r μ birth t N) env ↔ + ∃ I parts Indices Maps W injection, + env z = copyLayerWitness I parts Indices Maps W injection ∧ + CopyLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) + (env t) I parts Indices Maps W (env N) injection := by + rw [copyGrowthWitnessFormula, M.realize_boundedExBlock _ _ env members] + constructor + · rintro ⟨fields, _, recognized⟩ + have meaning := (BoundedFormula.truth_copyTaggedLayerFormula + (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) + (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) + (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) + (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) + (suffixIndex n 10 N) (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) + (extendMany 10 fields env)).1 recognized + simp only [extendMany_prefix, extendMany_suffix] at meaning + exact ⟨fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, + meaning.2.1, meaning.2.2.2.2.2⟩ + · rintro ⟨I, parts, Indices, Maps, W, injection, equal, code⟩ + let stored : Fin 7 → ZFSet.{u} := Fin.cases (natSetCode 1) (Fin.cases I (Fin.cases parts + (Fin.cases Indices (Fin.cases Maps (Fin.cases W (fun _ => injection)))))) + have hWitness : nonemptyTupleCode 6 stored ∈ M.sets := by + change copyLayerWitness I parts Indices Maps W injection ∈ M.sets + exact equal ▸ members z + have storedGround := M.nonemptyTupleCode_field_mem 6 stored hWitness + let fields : Fin 10 → ZFSet.{u} := Fin.cases (natSetCode 1) (Fin.cases I (Fin.cases parts + (Fin.cases Indices (Fin.cases Maps (Fin.cases W (Fin.cases injection + (Fin.cases (⋃₀ ⋃₀ env Qs) (Fin.cases (⋃₀ ⋃₀ env rs) (fun _ => ⋃₀ ⋃₀ env μs))))))))) + have ground : ∀ i, fields i ∈ M.sets := + (Fin.cases (storedGround 0) (Fin.cases (storedGround 1) (Fin.cases (storedGround 2) (Fin.cases (storedGround 3) (Fin.cases (storedGround 4) (Fin.cases (storedGround 5) (Fin.cases (storedGround 6) (Fin.cases (M.union_mem unions (M.union_mem unions (members Qs))) (Fin.cases (M.union_mem unions (M.union_mem unions (members rs))) (fun _ => (M.union_mem unions (M.union_mem unions (members μs))))))))))))) + refine ⟨fields, ground, ?_⟩ + apply (BoundedFormula.truth_copyTaggedLayerFormula + (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) + (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) + (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) + (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) + (suffixIndex n 10 N) (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) + (extendMany 10 fields env)).2 + simp only [extendMany_prefix, extendMany_suffix] + exact ⟨rfl, equal, rfl, rfl, rfl, code⟩ + +theorem realize_separatedGrowthWitnessFormula + (unions : Realize M.sets SetFormula.union Fin.elim0) {n} + (z Qs rs μs L r μ birth t : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env L) (env r) (env μ)) : + Realize M.sets (separatedGrowthWitnessFormula z Qs rs μs L r μ birth t) env ↔ + ∃ I Indices Maps W Components F, + env z = separatedLayerWitness I Indices Maps W Components F ∧ + SeparatedLayerCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) (env birth) + (env t) I Indices Maps W Components F := by + rw [separatedGrowthWitnessFormula, M.realize_boundedExBlock _ _ env members] + constructor + · rintro ⟨fields, _, recognized⟩ + have liftedMeet : MeetOrderCode + (extendMany 10 fields env (suffixIndex n 10 L)) + (extendMany 10 fields env (suffixIndex n 10 r)) + (extendMany 10 fields env (suffixIndex n 10 μ)) := by + simpa only [extendMany_suffix] using meet + have meaning := (BoundedFormula.truth_separatedTaggedLayerFormula + (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) + (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) + (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) + (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) + (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) + (extendMany 10 fields env) liftedMeet).1 recognized + simp only [extendMany_prefix, extendMany_suffix] at meaning + exact ⟨fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, + meaning.2.1, meaning.2.2.2.2.2⟩ + · rintro ⟨I, Indices, Maps, W, Components, F, equal, code⟩ + let stored : Fin 7 → ZFSet.{u} := Fin.cases (natSetCode 2) (Fin.cases I (Fin.cases Indices + (Fin.cases Maps (Fin.cases W (Fin.cases Components (fun _ => F)))))) + have hWitness : nonemptyTupleCode 6 stored ∈ M.sets := by + change separatedLayerWitness I Indices Maps W Components F ∈ M.sets + exact equal ▸ members z + have storedGround := M.nonemptyTupleCode_field_mem 6 stored hWitness + let fields : Fin 10 → ZFSet.{u} := Fin.cases (natSetCode 2) (Fin.cases I (Fin.cases Indices + (Fin.cases Maps (Fin.cases W (Fin.cases Components (Fin.cases F + (Fin.cases (⋃₀ ⋃₀ env Qs) (Fin.cases (⋃₀ ⋃₀ env rs) (fun _ => ⋃₀ ⋃₀ env μs))))))))) + have ground : ∀ i, fields i ∈ M.sets := + (Fin.cases (storedGround 0) (Fin.cases (storedGround 1) (Fin.cases (storedGround 2) (Fin.cases (storedGround 3) (Fin.cases (storedGround 4) (Fin.cases (storedGround 5) (Fin.cases (storedGround 6) (Fin.cases (M.union_mem unions (M.union_mem unions (members Qs))) (Fin.cases (M.union_mem unions (M.union_mem unions (members rs))) (fun _ => (M.union_mem unions (M.union_mem unions (members μs))))))))))))) + refine ⟨fields, ground, ?_⟩ + have liftedMeet : MeetOrderCode + (extendMany 10 fields env (suffixIndex n 10 L)) + (extendMany 10 fields env (suffixIndex n 10 r)) + (extendMany 10 fields env (suffixIndex n 10 μ)) := by + simpa only [extendMany_suffix] using meet + apply (BoundedFormula.truth_separatedTaggedLayerFormula + (suffixIndex n 10 z) (prefixIndex n 10 0) (prefixIndex n 10 1) (prefixIndex n 10 2) + (prefixIndex n 10 3) (prefixIndex n 10 4) (prefixIndex n 10 5) (prefixIndex n 10 6) + (suffixIndex n 10 Qs) (suffixIndex n 10 rs) (suffixIndex n 10 μs) (suffixIndex n 10 L) + (suffixIndex n 10 r) (suffixIndex n 10 μ) (suffixIndex n 10 birth) (suffixIndex n 10 t) + (prefixIndex n 10 7) (prefixIndex n 10 8) (prefixIndex n 10 9) + (extendMany 10 fields env) liftedMeet).2 + simp only [extendMany_prefix, extendMany_suffix] + exact ⟨rfl, equal, rfl, rfl, rfl, code⟩ + +theorem realize_growthLayerWitnessFormula + (unions : Realize M.sets SetFormula.union Fin.elim0) {n} + (z Qs rs μs L r μ birth t N : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env L) (env r) (env μ)) : + Realize M.sets (growthLayerWitnessFormula z Qs rs μs L r μ birth t N) env ↔ + GrowthLayerWitnessCode (env Qs) (env rs) (env μs) (env L) (env r) (env μ) + (env birth) (env t) (env N) (env z) := by + rw [growthLayerWitnessFormula, realize_disj, realize_disj, + M.realize_countableGrowthWitnessFormula z L birth t N env members, + M.realize_copyGrowthWitnessFormula unions z Qs rs μs L r μ birth t N env members, + M.realize_separatedGrowthWitnessFormula unions z Qs rs μs L r μ birth t env members meet] + rfl + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHartogs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHartogs.lean index 72db472152d5597f35d20f39df829393b4f382c0..a4d188303126a7251b36674bc89c1fc6c91022bb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHartogs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHartogs.lean @@ -1,162 +1,162 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSymmetricCollection -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalOrderCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.SetFormula - -universe u - -theorem realize_relationImage (U : Set ZFSet.{u}) {n : Nat} (φ : SetFormula (n + 2)) - (params : Fin n → ZFSet.{u}) (A y : ZFSet.{u}) : - Realize U (relationImageFormula φ) (extend y (extend A params)) ↔ - ∃ x ∈ U, x ∈ A ∧ Realize U φ (extend x (extend y params)) := by - simp only [relationImageFormula, realize_ex, Realize, realize_binaryApplication] - rfl - -theorem replacement_of_collection_separation (U : Set ZFSet.{u}) - (collection : CollectionSchema U) (separation : SeparationSchema U) : ReplacementSchema U := by - intro n φ params members A hA total - have existsWitness : ∀ x ∈ U, x ∈ A → ∃ y ∈ U, Realize U φ (extend x (extend y params)) := by - intro x hx xA - obtain ⟨y, hy, rel, _⟩ := total x hx xA - exact ⟨y, hy, rel⟩ - obtain ⟨B, hB, bounds⟩ := collection φ params members A hA existsWitness - obtain ⟨C, hC, selected⟩ := separation (relationImageFormula φ) (extend A params) (Fin.cases hA members) B hB - refine ⟨C, hC, ?_⟩ - intro y hy - rw [selected y hy, realize_relationImage] - constructor - · exact And.right - · intro image - obtain ⟨x, hx, xA, rel⟩ := image - obtain ⟨z, hz, zB, relz⟩ := bounds x hx xA - obtain ⟨w, _, _, unique⟩ := total x hx xA - have eq : y = z := (unique y hy rel).trans (unique z hz relz).symm - exact ⟨eq.symm ▸ zB, x, hx, xA, rel⟩ - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) - -theorem symmetric_replacement (F : NormalSubgroupFamily G) (K : I → Subgroup G) - (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (H : ConditionFilter P) - (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : - ReplacementSchema ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := - replacement_of_collection_separation _ - (M.symmetric_collection a s t b F K basis pairing unions powers separation collection carrier order - group indices supports maps H generic) - (M.symmetric_separation a s t b F K basis pairing unions powers separation collection carrier order - group indices supports maps H generic) - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.SetFormula - -def representedOrdinalRelationFormula : SetFormula 2 := - ex (reindex (extend 1 (extend 0 (extend 2 Fin.elim0))) ordinalImageWitnessFormula) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_representedOrdinalRelationFormula {r N : ZFSet.{u}} - (hr : r ∈ M.sets) (hN : N ∈ M.sets) : - Realize M.sets representedOrdinalRelationFormula (extend r (extend N Fin.elim0)) ↔ - ∃ A ∈ M.sets, ordinalSetProperty A ∧ - ∃ f ∈ M.sets, InjectionCode A N f ∧ r = ordinalImageOrder A N f := by - have swapped (A : ZFSet.{u}) : - (fun i => extend A (extend r (extend N Fin.elim0)) - (extend (1 : Fin 3) (extend 0 (extend 2 Fin.elim0)) i)) = - extend r (extend A (extend N Fin.elim0)) := by - funext i - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j))) i - rw [representedOrdinalRelationFormula, realize_ex] - constructor - · rintro ⟨A, hA, rel⟩ - have witness := (realize_reindex M.sets _ ordinalImageWitnessFormula _).1 rel - rw [swapped A] at witness - exact ⟨A, hA, (M.realize_ordinalImageWitnessFormula hr hA hN).1 witness⟩ - · rintro ⟨A, hA, witness⟩ - have rel := (M.realize_ordinalImageWitnessFormula hr hA hN).2 witness - rw [← swapped A] at rel - exact ⟨A, hA, (realize_reindex M.sets _ ordinalImageWitnessFormula _).2 rel⟩ - -theorem exists_groundHartogs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {N : ZFSet.{u}} (hN : N ∈ M.sets) : - ∃ C ∈ M.sets, ordinalSetProperty C ∧ - (∀ A : ZFSet.{u}, A ∈ C ↔ A ∈ M.sets ∧ ordinalSetProperty A ∧ M.groundEmbeddable A N) ∧ - ¬ M.groundEmbeddable C N := by - let params := extend N Fin.elim0 - let D := ZFSet.sep (fun r => Realize M.sets representedOrdinalRelationFormula - (extend r params)) (M.groundRelations N N) - have hD : D ∈ M.sets := M.separation_mem separation representedOrdinalRelationFormula params - (Fin.cases hN (fun i => Fin.elim0 i)) - (M.groundRelations_mem pairing unions powers separation hN hN) - have total : ∀ r ∈ M.sets, r ∈ D → ∃ A ∈ M.sets, - Realize M.sets ordinalImageWitnessFormula (extend r (extend A params)) ∧ - ∀ B ∈ M.sets, Realize M.sets ordinalImageWitnessFormula (extend r (extend B params)) → B = A := by - intro r hr rD - obtain ⟨A, hA, ordA, f, hf, injF, eqF⟩ := - (M.realize_representedOrdinalRelationFormula hr hN).1 (ZFSet.mem_sep.1 rD).2 - refine ⟨A, hA, (M.realize_ordinalImageWitnessFormula hr hA hN).2 ⟨ordA, f, hf, injF, eqF⟩, ?_⟩ - intro B hB relB - obtain ⟨ordB, g, _, injG, eqG⟩ := (M.realize_ordinalImageWitnessFormula hr hB hN).1 relB - exact ordinalImageOrder_domain_unique ordB ordA injG injF (eqG.symm.trans eqF) - obtain ⟨C, hC, represented⟩ := replacement_of_collection_separation M.sets collection separation - ordinalImageWitnessFormula params (Fin.cases hN (fun i => Fin.elim0 i)) D hD total - have exactMembers (A : ZFSet.{u}) : - A ∈ C ↔ A ∈ M.sets ∧ ordinalSetProperty A ∧ M.groundEmbeddable A N := by - constructor - · intro hAC - have hA := M.transitive hC hAC - obtain ⟨r, hr, _, rel⟩ := (represented A hA).1 hAC - obtain ⟨ordA, f, hf, inj, _⟩ := (M.realize_ordinalImageWitnessFormula hr hA hN).1 rel - exact ⟨hA, ordA, f, hf, inj⟩ - · rintro ⟨hA, ordA, f, hf, inj⟩ - let r := ordinalImageOrder A N f - have hr : r ∈ M.sets := M.ordinalImageOrder_mem pairing unions powers separation hA hN hf - have witness := (M.realize_ordinalImageWitnessFormula hr hA hN).2 ⟨ordA, f, hf, inj, rfl⟩ - have rD : r ∈ D := ZFSet.mem_sep.2 - ⟨(M.mem_groundRelations N N r).2 ⟨hr, ordinalImageOrder_subset A N f⟩, - (M.realize_representedOrdinalRelationFormula hr hN).2 ⟨A, hA, ordA, f, hf, inj, rfl⟩⟩ - exact (represented A hA).2 ⟨r, hr, rD, witness⟩ - have ordinal : ordinalSetProperty C := by - refine ⟨?_, fun A hA => ((exactMembers A).1 hA).2.1.1⟩ - intro A hAC B hBA - obtain ⟨hA, ordA, smallA⟩ := (exactMembers A).1 hAC - have hB := M.transitive hA hBA - exact (exactMembers B).2 ⟨hB, ordinalSetProperty_member ordA hBA, - M.groundEmbeddable_restrict separation hB hN (fun z hz => ordA.1 B hBA z hz) smallA⟩ - exact ⟨C, hC, ordinal, exactMembers, - fun small => ZFSet.mem_irrefl C ((exactMembers C).2 ⟨hC, ordinal, small⟩)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSymmetricCollection +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalOrderCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.SetFormula + +universe u + +theorem realize_relationImage (U : Set ZFSet.{u}) {n : Nat} (φ : SetFormula (n + 2)) + (params : Fin n → ZFSet.{u}) (A y : ZFSet.{u}) : + Realize U (relationImageFormula φ) (extend y (extend A params)) ↔ + ∃ x ∈ U, x ∈ A ∧ Realize U φ (extend x (extend y params)) := by + simp only [relationImageFormula, realize_ex, Realize, realize_binaryApplication] + rfl + +theorem replacement_of_collection_separation (U : Set ZFSet.{u}) + (collection : CollectionSchema U) (separation : SeparationSchema U) : ReplacementSchema U := by + intro n φ params members A hA total + have existsWitness : ∀ x ∈ U, x ∈ A → ∃ y ∈ U, Realize U φ (extend x (extend y params)) := by + intro x hx xA + obtain ⟨y, hy, rel, _⟩ := total x hx xA + exact ⟨y, hy, rel⟩ + obtain ⟨B, hB, bounds⟩ := collection φ params members A hA existsWitness + obtain ⟨C, hC, selected⟩ := separation (relationImageFormula φ) (extend A params) (Fin.cases hA members) B hB + refine ⟨C, hC, ?_⟩ + intro y hy + rw [selected y hy, realize_relationImage] + constructor + · exact And.right + · intro image + obtain ⟨x, hx, xA, rel⟩ := image + obtain ⟨z, hz, zB, relz⟩ := bounds x hx xA + obtain ⟨w, _, _, unique⟩ := total x hx xA + have eq : y = z := (unique y hy rel).trans (unique z hz relz).symm + exact ⟨eq.symm ▸ zB, x, hx, xA, rel⟩ + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I) + +theorem symmetric_replacement (F : NormalSubgroupFamily G) (K : I → Subgroup G) + (basis : ∀ H, F.mem H ↔ ∃ i, K i ≤ H) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (H : ConditionFilter P) + (generic : H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F))) : + ReplacementSchema ((a.symmetricDomain s (M.nameDomain s) F).values {p | H.mem p}) := + replacement_of_collection_separation _ + (M.symmetric_collection a s t b F K basis pairing unions powers separation collection carrier order + group indices supports maps H generic) + (M.symmetric_separation a s t b F K basis pairing unions powers separation collection carrier order + group indices supports maps H generic) + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.SetFormula + +def representedOrdinalRelationFormula : SetFormula 2 := + ex (reindex (extend 1 (extend 0 (extend 2 Fin.elim0))) ordinalImageWitnessFormula) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_representedOrdinalRelationFormula {r N : ZFSet.{u}} + (hr : r ∈ M.sets) (hN : N ∈ M.sets) : + Realize M.sets representedOrdinalRelationFormula (extend r (extend N Fin.elim0)) ↔ + ∃ A ∈ M.sets, ordinalSetProperty A ∧ + ∃ f ∈ M.sets, InjectionCode A N f ∧ r = ordinalImageOrder A N f := by + have swapped (A : ZFSet.{u}) : + (fun i => extend A (extend r (extend N Fin.elim0)) + (extend (1 : Fin 3) (extend 0 (extend 2 Fin.elim0)) i)) = + extend r (extend A (extend N Fin.elim0)) := by + funext i + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j))) i + rw [representedOrdinalRelationFormula, realize_ex] + constructor + · rintro ⟨A, hA, rel⟩ + have witness := (realize_reindex M.sets _ ordinalImageWitnessFormula _).1 rel + rw [swapped A] at witness + exact ⟨A, hA, (M.realize_ordinalImageWitnessFormula hr hA hN).1 witness⟩ + · rintro ⟨A, hA, witness⟩ + have rel := (M.realize_ordinalImageWitnessFormula hr hA hN).2 witness + rw [← swapped A] at rel + exact ⟨A, hA, (realize_reindex M.sets _ ordinalImageWitnessFormula _).2 rel⟩ + +theorem exists_groundHartogs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {N : ZFSet.{u}} (hN : N ∈ M.sets) : + ∃ C ∈ M.sets, ordinalSetProperty C ∧ + (∀ A : ZFSet.{u}, A ∈ C ↔ A ∈ M.sets ∧ ordinalSetProperty A ∧ M.groundEmbeddable A N) ∧ + ¬ M.groundEmbeddable C N := by + let params := extend N Fin.elim0 + let D := ZFSet.sep (fun r => Realize M.sets representedOrdinalRelationFormula + (extend r params)) (M.groundRelations N N) + have hD : D ∈ M.sets := M.separation_mem separation representedOrdinalRelationFormula params + (Fin.cases hN (fun i => Fin.elim0 i)) + (M.groundRelations_mem pairing unions powers separation hN hN) + have total : ∀ r ∈ M.sets, r ∈ D → ∃ A ∈ M.sets, + Realize M.sets ordinalImageWitnessFormula (extend r (extend A params)) ∧ + ∀ B ∈ M.sets, Realize M.sets ordinalImageWitnessFormula (extend r (extend B params)) → B = A := by + intro r hr rD + obtain ⟨A, hA, ordA, f, hf, injF, eqF⟩ := + (M.realize_representedOrdinalRelationFormula hr hN).1 (ZFSet.mem_sep.1 rD).2 + refine ⟨A, hA, (M.realize_ordinalImageWitnessFormula hr hA hN).2 ⟨ordA, f, hf, injF, eqF⟩, ?_⟩ + intro B hB relB + obtain ⟨ordB, g, _, injG, eqG⟩ := (M.realize_ordinalImageWitnessFormula hr hB hN).1 relB + exact ordinalImageOrder_domain_unique ordB ordA injG injF (eqG.symm.trans eqF) + obtain ⟨C, hC, represented⟩ := replacement_of_collection_separation M.sets collection separation + ordinalImageWitnessFormula params (Fin.cases hN (fun i => Fin.elim0 i)) D hD total + have exactMembers (A : ZFSet.{u}) : + A ∈ C ↔ A ∈ M.sets ∧ ordinalSetProperty A ∧ M.groundEmbeddable A N := by + constructor + · intro hAC + have hA := M.transitive hC hAC + obtain ⟨r, hr, _, rel⟩ := (represented A hA).1 hAC + obtain ⟨ordA, f, hf, inj, _⟩ := (M.realize_ordinalImageWitnessFormula hr hA hN).1 rel + exact ⟨hA, ordA, f, hf, inj⟩ + · rintro ⟨hA, ordA, f, hf, inj⟩ + let r := ordinalImageOrder A N f + have hr : r ∈ M.sets := M.ordinalImageOrder_mem pairing unions powers separation hA hN hf + have witness := (M.realize_ordinalImageWitnessFormula hr hA hN).2 ⟨ordA, f, hf, inj, rfl⟩ + have rD : r ∈ D := ZFSet.mem_sep.2 + ⟨(M.mem_groundRelations N N r).2 ⟨hr, ordinalImageOrder_subset A N f⟩, + (M.realize_representedOrdinalRelationFormula hr hN).2 ⟨A, hA, ordA, f, hf, inj, rfl⟩⟩ + exact (represented A hA).2 ⟨r, hr, rD, witness⟩ + have ordinal : ordinalSetProperty C := by + refine ⟨?_, fun A hA => ((exactMembers A).1 hA).2.1.1⟩ + intro A hAC B hBA + obtain ⟨hA, ordA, smallA⟩ := (exactMembers A).1 hAC + have hB := M.transitive hA hBA + exact (exactMembers B).2 ⟨hB, ordinalSetProperty_member ordA hBA, + M.groundEmbeddable_restrict separation hB hN (fun z hz => ordA.1 B hBA z hz) smallA⟩ + exact ⟨C, hC, ordinal, exactMembers, + fun small => ZFSet.mem_irrefl C ((exactMembers C).2 ⟨hC, ordinal, small⟩)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHeightPushforward.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHeightPushforward.lean index 91416f10a27d472820de57bbf0957756b5e067df..575b87094dc5291e095278eeb6506a763c514b09 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHeightPushforward.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundHeightPushforward.lean @@ -1,378 +1,378 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FlatCopyGraphRealization -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyPresentation -import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes - -namespace OAI - -namespace PartitionPilot.SetRealization.Presentation -open Forcing -universe u -variable {A B : Type u} (s : Presentation A) (t : Presentation B) -variable {P : MeetOrder A} {Q : MeetOrder B} (embedding : MeetEmbedding P Q) -variable {r μ v ν : ZFSet.{u}} -variable (source : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) -variable (target : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ v ↔ Q.le x y) -variable (sourceMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode z) ∈ μ ↔ P.meet x y = z) -variable (targetMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) (t.encode z) ∈ ν ↔ Q.meet x y = z) - -include source target sourceMeet targetMeet in -theorem meetEmbeddingCode : MeetEmbeddingCode s.carrier t.carrier r v μ ν (s.graph t embedding.toFun) := by - have injective : Function.Injective embedding.toFun := by - intro x y equal - apply P.antisymm - · apply (embedding.le_iff x y).1 - rw [equal] - exact Q.refl _ - · apply (embedding.le_iff y x).1 - rw [equal] - exact Q.refl _ - refine ⟨s.graph_injection t _ injective, ?_, ?_⟩ - · intro x y a b lower first second - have hx := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 first)).1 - have hy := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 second)).1 - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - have ha := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 first)).2 - have hb := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 second)).2 - obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha - obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb - have ea := (s.pair_mem_graph t embedding.toFun x a).1 first - have eb := (s.pair_mem_graph t embedding.toFun y b).1 second - apply (target a b).2 - rw [← ea, ← eb] - exact (embedding.le_iff x y).2 ((source x y).1 lower) - · intro x y z a b c meet first second third - have graph := s.graph_isFunc t embedding.toFun - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (graph.1 first)).1 - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 (ZFSet.pair_mem_prod.1 (graph.1 second)).1 - obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 (ZFSet.pair_mem_prod.1 (graph.1 third)).1 - obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 (ZFSet.pair_mem_prod.1 (graph.1 first)).2 - obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 (ZFSet.pair_mem_prod.1 (graph.1 second)).2 - obtain ⟨c, rfl⟩ := (t.mem_carrier c).1 (ZFSet.pair_mem_prod.1 (graph.1 third)).2 - have ea := (s.pair_mem_graph t embedding.toFun x a).1 first - have eb := (s.pair_mem_graph t embedding.toFun y b).1 second - have ec := (s.pair_mem_graph t embedding.toFun z c).1 third - apply (targetMeet a b c).2 - rw [← ea, ← eb, ← ec, ← (sourceMeet x y z).1 meet] - exact (embedding.map_meet x y).symm - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -open Compression.RecursiveMaps Attachment CosetGeometry -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : TileRequests.Family P R) (a : OrderAction J P) -variable (s : Presentation (External J f.Letters)) (t : Presentation A) {steps : ZFSet.{u}} -variable (edges : ∀ x y, ZFSet.pair ((s.product t).encode x) ((s.product t).encode y) ∈ steps ↔ f.FlatStep a x y) -variable (hE : s.carrier ∈ M.sets) (hU : t.carrier ∈ M.sets) - -theorem flatCopyClassifier_entry_iff (w : External J f.Letters) (x : A) (z : f.Node a) : - ZFSet.pair (ZFSet.pair (s.encode w) (t.encode x)) - ((M.flatCopyPresentation pairing unions powers separation infinite f a s t edges hE hU).encode z) ∈ - equivalenceClassifier (ZFSet.prod s.carrier t.carrier) - (M.finitePathClosure (ZFSet.prod s.carrier t.carrier) steps) ↔ (f.copy a w).toFun x = z := by - rw [M.flatCopyClassifier_eq_graph pairing unions powers separation infinite f a s t edges hE hU] - exact (s.product t).pair_mem_graph _ _ (w, x) z - -theorem flatCopyGeometry_spec {r : ZFSet.{u}} - (related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ r ↔ P.le x y) - (hSteps : steps ∈ M.sets) (hr : r ∈ M.sets) - (hm : (s.product s).graph s (fun gh => gh.1 * gh.2) ∈ M.sets) : - let q := M.flatCopyPresentation pairing unions powers separation infinite f a s t edges hE hU - let classifier := equivalenceClassifier (ZFSet.prod s.carrier t.carrier) - (M.finitePathClosure (ZFSet.prod s.carrier t.carrier) steps) - let order := flatCopyOrderGraph s.carrier t.carrier q.carrier classifier r - let meet := canonicalMeetGraph q.carrier order - let action := flatCopyActionGraph s.carrier t.carrier q.carrier classifier - ((s.product s).graph s (fun gh => gh.1 * gh.2)) - q.carrier ∈ M.sets ∧ classifier ∈ M.sets ∧ order ∈ M.sets ∧ meet ∈ M.sets ∧ action ∈ M.sets ∧ - MeetOrderCode q.carrier order meet ∧ - PosetActionCode s.carrier q.carrier ((s.product s).graph s (fun gh => gh.1 * gh.2)) - (s.encode 1) order action ∧ - (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ order ↔ (f.gluedOrder a).le x y) ∧ - (∀ x y z, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) (q.encode z) ∈ meet ↔ - (f.gluedOrder a).meet x y = z) ∧ - (∀ g x y, ZFSet.pair (ZFSet.pair (s.encode g) (q.encode x)) (q.encode y) ∈ action ↔ - f.translate a g x = y) := by - dsimp only - let q := M.flatCopyPresentation pairing unions powers separation infinite f a s t edges hE hU - have ground := M.flatCopyPresentation_ground pairing unions powers separation infinite f a s t edges hE hU hSteps - have classed := M.flatCopyClassifier_entry_iff pairing unions powers separation infinite f a s t edges hE hU - have order := flatCopy_order_iff f a s t q classed related - have hOrder := M.flatCopyOrderGraph_mem pairing unions powers separation hE hU ground.1 ground.2 hr - exact ⟨ground.1, ground.2, hOrder, - M.canonicalMeetGraph_mem pairing unions powers separation ground.1 hOrder, - M.flatCopyActionGraph_mem pairing unions powers separation hE hU ground.1 ground.2 hm, - flatCopy_meetOrder f a s t q classed related, - flatCopy_actionCode f a s t q classed related, - order, q.canonicalMeetGraph_iff (f.gluedOrder a) order, - flatCopy_action_iff f a s t q classed⟩ - -end PartitionPilot.Forcing.TransitiveGround - -section - -namespace PartitionPilot.Forcing -universe u - -structure IdealEmbeddingCode (P Q rP rQ μP μQ e : ZFSet.{u}) : Prop - extends MeetEmbeddingCode P Q rP rQ μP μQ e where - reflect : ∀ x y x' y', ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → - ZFSet.pair x' y' ∈ rQ → ZFSet.pair x y ∈ rP - ideal : ∀ v v' z, ZFSet.pair v v' ∈ e → z ∈ Q → ZFSet.pair z v' ∈ rQ → - ∃ x ∈ P, ZFSet.pair x v ∈ rP ∧ ZFSet.pair x z ∈ e - -namespace IdealEmbeddingCode -variable {P Q rP rQ μP μQ e : ZFSet.{u}} -variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) -include code - -theorem order_iff {x y x' y' : ZFSet.{u}} - (first : ZFSet.pair x x' ∈ e) (second : ZFSet.pair y y' ∈ e) : - ZFSet.pair x' y' ∈ rQ ↔ ZFSet.pair x y ∈ rP := - ⟨code.reflect x y x' y' first second, - fun lower => code.monotone x y x' y' lower first second⟩ - -theorem principal_iff {v v' z : ZFSet.{u}} - (image : ZFSet.pair v v' ∈ e) (hz : z ∈ Q) : - ZFSet.pair z v' ∈ rQ ↔ ∃ x ∈ P, ZFSet.pair x v ∈ rP ∧ ZFSet.pair x z ∈ e := by - constructor - · exact code.ideal v v' z image hz - · rintro ⟨x, _, lower, entry⟩ - exact code.monotone x v z v' lower entry image - -theorem principal_range {top top' z : ZFSet.{u}} - (greatest : ∀ x ∈ P, ZFSet.pair x top ∈ rP) - (image : ZFSet.pair top top' ∈ e) (hz : z ∈ Q) : - ZFSet.pair z top' ∈ rQ ↔ ∃ x ∈ P, ZFSet.pair x z ∈ e := by - rw [code.principal_iff image hz] - exact ⟨fun ⟨x, hx, _, entry⟩ => ⟨x, hx, entry⟩, - fun ⟨x, hx, entry⟩ => ⟨x, hx, greatest x hx, entry⟩⟩ - -end IdealEmbeddingCode -end PartitionPilot.Forcing - -namespace PartitionPilot.SetRealization.Presentation -open Forcing Compression.RecursiveMaps -universe u -variable {A B : Type u} (s : Presentation A) (t : Presentation B) -variable {P : MeetOrder A} {Q : MeetOrder B} (embedding : IdealEmbedding P Q) -variable {r μ v ν : ZFSet.{u}} -variable (source : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) -variable (target : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ v ↔ Q.le x y) -variable (sourceMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode z) ∈ μ ↔ P.meet x y = z) -variable (targetMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) (t.encode z) ∈ ν ↔ Q.meet x y = z) - -include source target sourceMeet targetMeet in -theorem idealEmbeddingCode : IdealEmbeddingCode s.carrier t.carrier r v μ ν (s.graph t embedding.toFun) := by - have function := s.graph_isFunc t embedding.toFun - refine ⟨s.meetEmbeddingCode t embedding.toMeetEmbedding source target sourceMeet targetMeet, ?_, ?_⟩ - · intro x y x' y' first second lower - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (function.1 first)).1 - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 (ZFSet.pair_mem_prod.1 (function.1 second)).1 - obtain ⟨x', rfl⟩ := (t.mem_carrier x').1 (ZFSet.pair_mem_prod.1 (function.1 first)).2 - obtain ⟨y', rfl⟩ := (t.mem_carrier y').1 (ZFSet.pair_mem_prod.1 (function.1 second)).2 - have firstEq := (s.pair_mem_graph t embedding.toFun x x').1 first - have secondEq := (s.pair_mem_graph t embedding.toFun y y').1 second - apply (source x y).2 - apply (embedding.le_iff x y).1 - rw [firstEq, secondEq] - exact (target x' y').1 lower - · intro x x' z image hz lower - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (function.1 image)).1 - obtain ⟨x', rfl⟩ := (t.mem_carrier x').1 (ZFSet.pair_mem_prod.1 (function.1 image)).2 - obtain ⟨z, rfl⟩ := (t.mem_carrier z).1 hz - have imageEq := (s.pair_mem_graph t embedding.toFun x x').1 image - have below : Q.le z (embedding.toFun x) := imageEq.symm ▸ (target z x').1 lower - obtain ⟨y, rfl⟩ := embedding.ideal x z below - exact ⟨s.encode y, s.encode_mem y, (source y x).2 ((embedding.le_iff y x).1 below), - (s.pair_mem_graph t embedding.toFun y _).2 rfl⟩ - -end PartitionPilot.SetRealization.Presentation - -end - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -open Compression.RecursiveMaps Attachment CosetGeometry -universe u - -noncomputable def flatCopyEmbeddingGraph (U Q classifier w : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ U, ∃ y ∈ Q, z = ZFSet.pair x y ∧ - ZFSet.pair (ZFSet.pair w x) y ∈ classifier) (ZFSet.prod U Q) - -theorem pair_mem_flatCopyEmbeddingGraph (U Q classifier w x y : ZFSet.{u}) : - ZFSet.pair x y ∈ flatCopyEmbeddingGraph U Q classifier w ↔ - x ∈ U ∧ y ∈ Q ∧ ZFSet.pair (ZFSet.pair w x) y ∈ classifier := by - rw [flatCopyEmbeddingGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, x', hx, y', hy, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, hy, entry⟩ - · rintro ⟨hx, hy, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, entry⟩ - -namespace BoundedFormula - -def flatCopyEmbeddingEntryFormula {n} (z U Q classifier w : Fin n) : BoundedFormula n := - exMem U (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (tripleMembershipFormula w.succ.succ 1 0 classifier.succ.succ))) - -theorem truth_flatCopyEmbeddingEntryFormula {n} - (z U Q classifier w : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (flatCopyEmbeddingEntryFormula z U Q classifier w) env ↔ - ∃ x ∈ env U, ∃ y ∈ env Q, env z = ZFSet.pair x y ∧ - ZFSet.pair (ZFSet.pair (env w) x) y ∈ env classifier := by - simp only [flatCopyEmbeddingEntryFormula, Truth, truth_exMem, truth_orderedPairFormula, - truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -theorem flatCopyEmbeddingGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U Q classifier w : ZFSet.{u}} - (hU : U ∈ M.sets) (hQ : Q ∈ M.sets) (hClassifier : classifier ∈ M.sets) (hw : w ∈ M.sets) : - flatCopyEmbeddingGraph U Q classifier w ∈ M.sets := by - let params := extend U (extend Q (extend classifier (extend w Fin.elim0))) - have selected := M.bounded_separation_mem separation (BoundedFormula.flatCopyEmbeddingEntryFormula 0 1 2 3 4) - params (Fin.cases hU (Fin.cases hQ (Fin.cases hClassifier (Fin.cases hw (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation hU hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.flatCopyEmbeddingEntryFormula 0 1 2 3 4) - (extend z params)) (ZFSet.prod U Q) = flatCopyEmbeddingGraph U Q classifier w := by - apply ZFSet.ext - intro z - rw [flatCopyEmbeddingGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_flatCopyEmbeddingEntryFormula 0 1 2 3 4 _) - exact equal ▸ selected - -end TransitiveGround - -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : TileRequests.Family P R) (a : OrderAction J P) -variable (s : Presentation (External J f.Letters)) (t : Presentation A) (q : Presentation (f.Node a)) -variable {classifier r μ : ZFSet.{u}} -variable (classed : ∀ w x z, ZFSet.pair (ZFSet.pair (s.encode w) (t.encode x)) (q.encode z) ∈ classifier ↔ - (f.copy a w).toFun x = z) - -include classed in -theorem flatCopyEmbeddingGraph_eq_graph (w : External J f.Letters) : - flatCopyEmbeddingGraph t.carrier q.carrier classifier (s.encode w) = t.graph q (f.copy a w).toFun := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 - obtain ⟨x, rfl⟩ := (t.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (q.mem_carrier y).1 hy - exact (t.pair_mem_graph q _ x y).2 ((classed w x y).1 - ((pair_mem_flatCopyEmbeddingGraph _ _ _ _ _ _).1 entry).2.2) - · intro entry - obtain ⟨x, equal⟩ := (t.mem_graph q (f.copy a w).toFun z).1 entry - rw [← equal] - exact (pair_mem_flatCopyEmbeddingGraph _ _ _ _ _ _).2 - ⟨t.encode_mem _, q.encode_mem _, (classed w x _).2 rfl⟩ - -include classed in -theorem flatCopyEmbeddingGraph_code - (related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ r ↔ P.le x y) - (sourceMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) (t.encode z) ∈ μ ↔ P.meet x y = z) - (w : External J f.Letters) : - let order := flatCopyOrderGraph s.carrier t.carrier q.carrier classifier r - MeetEmbeddingCode t.carrier q.carrier r order μ (canonicalMeetGraph q.carrier order) - (flatCopyEmbeddingGraph t.carrier q.carrier classifier (s.encode w)) := by - dsimp only - rw [flatCopyEmbeddingGraph_eq_graph f a s t q classed w] - have order := flatCopy_order_iff f a s t q classed related - exact t.meetEmbeddingCode q (f.copy a w).toMeetEmbedding related order sourceMeet - (q.canonicalMeetGraph_iff (f.gluedOrder a) order) - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def pushedHeightGraph (A B H e h : ZFSet.{u}) : ZFSet.{u} := - relationCompose (relationImage A B e) A H (relationConverse A B e) h - -theorem pushedHeightGraph_entry {A B H e h x y z : ZFSet.{u}} - (embedding : InjectionCode A B e) (height : ZFSet.IsFunc A H h) - (copy : ZFSet.pair x y ∈ e) : - ZFSet.pair y z ∈ pushedHeightGraph A B H e h ↔ ZFSet.pair x z ∈ h := by - have bounds := ZFSet.pair_mem_prod.1 (embedding.function.1 copy) - rw [pushedHeightGraph, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, a, _, inverse, entry⟩ - have copied := (pair_mem_relationConverse _ _ _ _ _).1 inverse - have same := embedding.injective a x y copied.2.2 copy - exact same ▸ entry - · intro entry - exact ⟨(mem_relationImage A B e y).2 ⟨bounds.2, x, bounds.1, copy⟩, - (ZFSet.pair_mem_prod.1 (height.1 entry)).2, x, bounds.1, - (pair_mem_relationConverse A B e x y).2 ⟨bounds.1, bounds.2, copy⟩, entry⟩ - -theorem pushedHeightGraph_function {A B H e h : ZFSet.{u}} - (embedding : InjectionCode A B e) (height : ZFSet.IsFunc A H h) : - ZFSet.IsFunc (relationImage A B e) H (pushedHeightGraph A B H e h) := - relationCompose_function_of_subset embedding.converse_image.function height (fun _ hx => hx) - -theorem pushedHeightGraph_range {A B H e h : ZFSet.{u}} - (embedding : InjectionCode A B e) (height : ZFSet.IsFunc A H h) : - relationImage (relationImage A B e) H (pushedHeightGraph A B H e h) = relationImage A H h := by - apply ZFSet.ext - intro z - rw [mem_relationImage, mem_relationImage] - constructor - · rintro ⟨hz, y, hy, entry⟩ - obtain ⟨_, x, hx, copy⟩ := (mem_relationImage A B e y).1 hy - exact ⟨hz, x, hx, (pushedHeightGraph_entry embedding height copy).1 entry⟩ - · rintro ⟨hz, x, hx, entry⟩ - obtain ⟨y, copy, _⟩ := embedding.function.2 x hx - have hy := (ZFSet.pair_mem_prod.1 (embedding.function.1 copy)).2 - exact ⟨hz, y, (mem_relationImage A B e y).2 ⟨hy, x, hx, copy⟩, - (pushedHeightGraph_entry embedding height copy).2 entry⟩ - -theorem pushedHeightGraph_strictLex {A B C D rA rB μA μB e h rD : ZFSet.{u}} - (embedding : IdealEmbeddingCode A B rA rB μA μB e) - (height : StrictLexHeightCode A C D rA h rD) : - StrictLexHeightCode (relationImage A B e) C D rB (pushedHeightGraph A B (ZFSet.prod C D) e h) rD := by - refine ⟨pushedHeightGraph_function embedding.injection height.function, ?_⟩ - intro x hx y hy c q d v lower different first second - obtain ⟨_, a, ha, ax⟩ := (mem_relationImage A B e x).1 hx - obtain ⟨_, b, hb, by'⟩ := (mem_relationImage A B e y).1 hy - have distinct : a ≠ b := by - intro same - subst b - obtain ⟨_, _, unique⟩ := embedding.injection.function.2 a ha - exact different ((unique x ax).trans (unique y by').symm) - exact height.strict a ha b hb c q d v (embedding.reflect a b x y ax by' lower) distinct - ((pushedHeightGraph_entry embedding.injection height.function ax).1 first) - ((pushedHeightGraph_entry embedding.injection height.function by').1 second) - -namespace TransitiveGround -theorem pushedHeightGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A B H e h : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hH : H ∈ M.sets) - (he : e ∈ M.sets) (hh : h ∈ M.sets) : pushedHeightGraph A B H e h ∈ M.sets := - M.relationCompose_mem pairing unions powers separation - (M.relationImage_mem separation hA hB he) hA hH - (M.relationConverse_mem pairing unions powers separation hA hB he) hh -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FlatCopyGraphRealization +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyPresentation +import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes + +namespace OAI + +namespace PartitionPilot.SetRealization.Presentation +open Forcing +universe u +variable {A B : Type u} (s : Presentation A) (t : Presentation B) +variable {P : MeetOrder A} {Q : MeetOrder B} (embedding : MeetEmbedding P Q) +variable {r μ v ν : ZFSet.{u}} +variable (source : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) +variable (target : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ v ↔ Q.le x y) +variable (sourceMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode z) ∈ μ ↔ P.meet x y = z) +variable (targetMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) (t.encode z) ∈ ν ↔ Q.meet x y = z) + +include source target sourceMeet targetMeet in +theorem meetEmbeddingCode : MeetEmbeddingCode s.carrier t.carrier r v μ ν (s.graph t embedding.toFun) := by + have injective : Function.Injective embedding.toFun := by + intro x y equal + apply P.antisymm + · apply (embedding.le_iff x y).1 + rw [equal] + exact Q.refl _ + · apply (embedding.le_iff y x).1 + rw [equal] + exact Q.refl _ + refine ⟨s.graph_injection t _ injective, ?_, ?_⟩ + · intro x y a b lower first second + have hx := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 first)).1 + have hy := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 second)).1 + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + have ha := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 first)).2 + have hb := (ZFSet.pair_mem_prod.1 ((s.graph_isFunc t embedding.toFun).1 second)).2 + obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha + obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb + have ea := (s.pair_mem_graph t embedding.toFun x a).1 first + have eb := (s.pair_mem_graph t embedding.toFun y b).1 second + apply (target a b).2 + rw [← ea, ← eb] + exact (embedding.le_iff x y).2 ((source x y).1 lower) + · intro x y z a b c meet first second third + have graph := s.graph_isFunc t embedding.toFun + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (graph.1 first)).1 + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 (ZFSet.pair_mem_prod.1 (graph.1 second)).1 + obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 (ZFSet.pair_mem_prod.1 (graph.1 third)).1 + obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 (ZFSet.pair_mem_prod.1 (graph.1 first)).2 + obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 (ZFSet.pair_mem_prod.1 (graph.1 second)).2 + obtain ⟨c, rfl⟩ := (t.mem_carrier c).1 (ZFSet.pair_mem_prod.1 (graph.1 third)).2 + have ea := (s.pair_mem_graph t embedding.toFun x a).1 first + have eb := (s.pair_mem_graph t embedding.toFun y b).1 second + have ec := (s.pair_mem_graph t embedding.toFun z c).1 third + apply (targetMeet a b c).2 + rw [← ea, ← eb, ← ec, ← (sourceMeet x y z).1 meet] + exact (embedding.map_meet x y).symm + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +open Compression.RecursiveMaps Attachment CosetGeometry +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : TileRequests.Family P R) (a : OrderAction J P) +variable (s : Presentation (External J f.Letters)) (t : Presentation A) {steps : ZFSet.{u}} +variable (edges : ∀ x y, ZFSet.pair ((s.product t).encode x) ((s.product t).encode y) ∈ steps ↔ f.FlatStep a x y) +variable (hE : s.carrier ∈ M.sets) (hU : t.carrier ∈ M.sets) + +theorem flatCopyClassifier_entry_iff (w : External J f.Letters) (x : A) (z : f.Node a) : + ZFSet.pair (ZFSet.pair (s.encode w) (t.encode x)) + ((M.flatCopyPresentation pairing unions powers separation infinite f a s t edges hE hU).encode z) ∈ + equivalenceClassifier (ZFSet.prod s.carrier t.carrier) + (M.finitePathClosure (ZFSet.prod s.carrier t.carrier) steps) ↔ (f.copy a w).toFun x = z := by + rw [M.flatCopyClassifier_eq_graph pairing unions powers separation infinite f a s t edges hE hU] + exact (s.product t).pair_mem_graph _ _ (w, x) z + +theorem flatCopyGeometry_spec {r : ZFSet.{u}} + (related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ r ↔ P.le x y) + (hSteps : steps ∈ M.sets) (hr : r ∈ M.sets) + (hm : (s.product s).graph s (fun gh => gh.1 * gh.2) ∈ M.sets) : + let q := M.flatCopyPresentation pairing unions powers separation infinite f a s t edges hE hU + let classifier := equivalenceClassifier (ZFSet.prod s.carrier t.carrier) + (M.finitePathClosure (ZFSet.prod s.carrier t.carrier) steps) + let order := flatCopyOrderGraph s.carrier t.carrier q.carrier classifier r + let meet := canonicalMeetGraph q.carrier order + let action := flatCopyActionGraph s.carrier t.carrier q.carrier classifier + ((s.product s).graph s (fun gh => gh.1 * gh.2)) + q.carrier ∈ M.sets ∧ classifier ∈ M.sets ∧ order ∈ M.sets ∧ meet ∈ M.sets ∧ action ∈ M.sets ∧ + MeetOrderCode q.carrier order meet ∧ + PosetActionCode s.carrier q.carrier ((s.product s).graph s (fun gh => gh.1 * gh.2)) + (s.encode 1) order action ∧ + (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ order ↔ (f.gluedOrder a).le x y) ∧ + (∀ x y z, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) (q.encode z) ∈ meet ↔ + (f.gluedOrder a).meet x y = z) ∧ + (∀ g x y, ZFSet.pair (ZFSet.pair (s.encode g) (q.encode x)) (q.encode y) ∈ action ↔ + f.translate a g x = y) := by + dsimp only + let q := M.flatCopyPresentation pairing unions powers separation infinite f a s t edges hE hU + have ground := M.flatCopyPresentation_ground pairing unions powers separation infinite f a s t edges hE hU hSteps + have classed := M.flatCopyClassifier_entry_iff pairing unions powers separation infinite f a s t edges hE hU + have order := flatCopy_order_iff f a s t q classed related + have hOrder := M.flatCopyOrderGraph_mem pairing unions powers separation hE hU ground.1 ground.2 hr + exact ⟨ground.1, ground.2, hOrder, + M.canonicalMeetGraph_mem pairing unions powers separation ground.1 hOrder, + M.flatCopyActionGraph_mem pairing unions powers separation hE hU ground.1 ground.2 hm, + flatCopy_meetOrder f a s t q classed related, + flatCopy_actionCode f a s t q classed related, + order, q.canonicalMeetGraph_iff (f.gluedOrder a) order, + flatCopy_action_iff f a s t q classed⟩ + +end PartitionPilot.Forcing.TransitiveGround + +section + +namespace PartitionPilot.Forcing +universe u + +structure IdealEmbeddingCode (P Q rP rQ μP μQ e : ZFSet.{u}) : Prop + extends MeetEmbeddingCode P Q rP rQ μP μQ e where + reflect : ∀ x y x' y', ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → + ZFSet.pair x' y' ∈ rQ → ZFSet.pair x y ∈ rP + ideal : ∀ v v' z, ZFSet.pair v v' ∈ e → z ∈ Q → ZFSet.pair z v' ∈ rQ → + ∃ x ∈ P, ZFSet.pair x v ∈ rP ∧ ZFSet.pair x z ∈ e + +namespace IdealEmbeddingCode +variable {P Q rP rQ μP μQ e : ZFSet.{u}} +variable (code : IdealEmbeddingCode P Q rP rQ μP μQ e) +include code + +theorem order_iff {x y x' y' : ZFSet.{u}} + (first : ZFSet.pair x x' ∈ e) (second : ZFSet.pair y y' ∈ e) : + ZFSet.pair x' y' ∈ rQ ↔ ZFSet.pair x y ∈ rP := + ⟨code.reflect x y x' y' first second, + fun lower => code.monotone x y x' y' lower first second⟩ + +theorem principal_iff {v v' z : ZFSet.{u}} + (image : ZFSet.pair v v' ∈ e) (hz : z ∈ Q) : + ZFSet.pair z v' ∈ rQ ↔ ∃ x ∈ P, ZFSet.pair x v ∈ rP ∧ ZFSet.pair x z ∈ e := by + constructor + · exact code.ideal v v' z image hz + · rintro ⟨x, _, lower, entry⟩ + exact code.monotone x v z v' lower entry image + +theorem principal_range {top top' z : ZFSet.{u}} + (greatest : ∀ x ∈ P, ZFSet.pair x top ∈ rP) + (image : ZFSet.pair top top' ∈ e) (hz : z ∈ Q) : + ZFSet.pair z top' ∈ rQ ↔ ∃ x ∈ P, ZFSet.pair x z ∈ e := by + rw [code.principal_iff image hz] + exact ⟨fun ⟨x, hx, _, entry⟩ => ⟨x, hx, entry⟩, + fun ⟨x, hx, entry⟩ => ⟨x, hx, greatest x hx, entry⟩⟩ + +end IdealEmbeddingCode +end PartitionPilot.Forcing + +namespace PartitionPilot.SetRealization.Presentation +open Forcing Compression.RecursiveMaps +universe u +variable {A B : Type u} (s : Presentation A) (t : Presentation B) +variable {P : MeetOrder A} {Q : MeetOrder B} (embedding : IdealEmbedding P Q) +variable {r μ v ν : ZFSet.{u}} +variable (source : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ P.le x y) +variable (target : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ v ↔ Q.le x y) +variable (sourceMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode z) ∈ μ ↔ P.meet x y = z) +variable (targetMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) (t.encode z) ∈ ν ↔ Q.meet x y = z) + +include source target sourceMeet targetMeet in +theorem idealEmbeddingCode : IdealEmbeddingCode s.carrier t.carrier r v μ ν (s.graph t embedding.toFun) := by + have function := s.graph_isFunc t embedding.toFun + refine ⟨s.meetEmbeddingCode t embedding.toMeetEmbedding source target sourceMeet targetMeet, ?_, ?_⟩ + · intro x y x' y' first second lower + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (function.1 first)).1 + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 (ZFSet.pair_mem_prod.1 (function.1 second)).1 + obtain ⟨x', rfl⟩ := (t.mem_carrier x').1 (ZFSet.pair_mem_prod.1 (function.1 first)).2 + obtain ⟨y', rfl⟩ := (t.mem_carrier y').1 (ZFSet.pair_mem_prod.1 (function.1 second)).2 + have firstEq := (s.pair_mem_graph t embedding.toFun x x').1 first + have secondEq := (s.pair_mem_graph t embedding.toFun y y').1 second + apply (source x y).2 + apply (embedding.le_iff x y).1 + rw [firstEq, secondEq] + exact (target x' y').1 lower + · intro x x' z image hz lower + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 (ZFSet.pair_mem_prod.1 (function.1 image)).1 + obtain ⟨x', rfl⟩ := (t.mem_carrier x').1 (ZFSet.pair_mem_prod.1 (function.1 image)).2 + obtain ⟨z, rfl⟩ := (t.mem_carrier z).1 hz + have imageEq := (s.pair_mem_graph t embedding.toFun x x').1 image + have below : Q.le z (embedding.toFun x) := imageEq.symm ▸ (target z x').1 lower + obtain ⟨y, rfl⟩ := embedding.ideal x z below + exact ⟨s.encode y, s.encode_mem y, (source y x).2 ((embedding.le_iff y x).1 below), + (s.pair_mem_graph t embedding.toFun y _).2 rfl⟩ + +end PartitionPilot.SetRealization.Presentation + +end + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +open Compression.RecursiveMaps Attachment CosetGeometry +universe u + +noncomputable def flatCopyEmbeddingGraph (U Q classifier w : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ U, ∃ y ∈ Q, z = ZFSet.pair x y ∧ + ZFSet.pair (ZFSet.pair w x) y ∈ classifier) (ZFSet.prod U Q) + +theorem pair_mem_flatCopyEmbeddingGraph (U Q classifier w x y : ZFSet.{u}) : + ZFSet.pair x y ∈ flatCopyEmbeddingGraph U Q classifier w ↔ + x ∈ U ∧ y ∈ Q ∧ ZFSet.pair (ZFSet.pair w x) y ∈ classifier := by + rw [flatCopyEmbeddingGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, x', hx, y', hy, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, hy, entry⟩ + · rintro ⟨hx, hy, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, entry⟩ + +namespace BoundedFormula + +def flatCopyEmbeddingEntryFormula {n} (z U Q classifier w : Fin n) : BoundedFormula n := + exMem U (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (tripleMembershipFormula w.succ.succ 1 0 classifier.succ.succ))) + +theorem truth_flatCopyEmbeddingEntryFormula {n} + (z U Q classifier w : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (flatCopyEmbeddingEntryFormula z U Q classifier w) env ↔ + ∃ x ∈ env U, ∃ y ∈ env Q, env z = ZFSet.pair x y ∧ + ZFSet.pair (ZFSet.pair (env w) x) y ∈ env classifier := by + simp only [flatCopyEmbeddingEntryFormula, Truth, truth_exMem, truth_orderedPairFormula, + truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +theorem flatCopyEmbeddingGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U Q classifier w : ZFSet.{u}} + (hU : U ∈ M.sets) (hQ : Q ∈ M.sets) (hClassifier : classifier ∈ M.sets) (hw : w ∈ M.sets) : + flatCopyEmbeddingGraph U Q classifier w ∈ M.sets := by + let params := extend U (extend Q (extend classifier (extend w Fin.elim0))) + have selected := M.bounded_separation_mem separation (BoundedFormula.flatCopyEmbeddingEntryFormula 0 1 2 3 4) + params (Fin.cases hU (Fin.cases hQ (Fin.cases hClassifier (Fin.cases hw (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation hU hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.flatCopyEmbeddingEntryFormula 0 1 2 3 4) + (extend z params)) (ZFSet.prod U Q) = flatCopyEmbeddingGraph U Q classifier w := by + apply ZFSet.ext + intro z + rw [flatCopyEmbeddingGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_flatCopyEmbeddingEntryFormula 0 1 2 3 4 _) + exact equal ▸ selected + +end TransitiveGround + +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : TileRequests.Family P R) (a : OrderAction J P) +variable (s : Presentation (External J f.Letters)) (t : Presentation A) (q : Presentation (f.Node a)) +variable {classifier r μ : ZFSet.{u}} +variable (classed : ∀ w x z, ZFSet.pair (ZFSet.pair (s.encode w) (t.encode x)) (q.encode z) ∈ classifier ↔ + (f.copy a w).toFun x = z) + +include classed in +theorem flatCopyEmbeddingGraph_eq_graph (w : External J f.Letters) : + flatCopyEmbeddingGraph t.carrier q.carrier classifier (s.encode w) = t.graph q (f.copy a w).toFun := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 + obtain ⟨x, rfl⟩ := (t.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (q.mem_carrier y).1 hy + exact (t.pair_mem_graph q _ x y).2 ((classed w x y).1 + ((pair_mem_flatCopyEmbeddingGraph _ _ _ _ _ _).1 entry).2.2) + · intro entry + obtain ⟨x, equal⟩ := (t.mem_graph q (f.copy a w).toFun z).1 entry + rw [← equal] + exact (pair_mem_flatCopyEmbeddingGraph _ _ _ _ _ _).2 + ⟨t.encode_mem _, q.encode_mem _, (classed w x _).2 rfl⟩ + +include classed in +theorem flatCopyEmbeddingGraph_code + (related : ∀ x y, ZFSet.pair (t.encode x) (t.encode y) ∈ r ↔ P.le x y) + (sourceMeet : ∀ x y z, ZFSet.pair (ZFSet.pair (t.encode x) (t.encode y)) (t.encode z) ∈ μ ↔ P.meet x y = z) + (w : External J f.Letters) : + let order := flatCopyOrderGraph s.carrier t.carrier q.carrier classifier r + MeetEmbeddingCode t.carrier q.carrier r order μ (canonicalMeetGraph q.carrier order) + (flatCopyEmbeddingGraph t.carrier q.carrier classifier (s.encode w)) := by + dsimp only + rw [flatCopyEmbeddingGraph_eq_graph f a s t q classed w] + have order := flatCopy_order_iff f a s t q classed related + exact t.meetEmbeddingCode q (f.copy a w).toMeetEmbedding related order sourceMeet + (q.canonicalMeetGraph_iff (f.gluedOrder a) order) + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def pushedHeightGraph (A B H e h : ZFSet.{u}) : ZFSet.{u} := + relationCompose (relationImage A B e) A H (relationConverse A B e) h + +theorem pushedHeightGraph_entry {A B H e h x y z : ZFSet.{u}} + (embedding : InjectionCode A B e) (height : ZFSet.IsFunc A H h) + (copy : ZFSet.pair x y ∈ e) : + ZFSet.pair y z ∈ pushedHeightGraph A B H e h ↔ ZFSet.pair x z ∈ h := by + have bounds := ZFSet.pair_mem_prod.1 (embedding.function.1 copy) + rw [pushedHeightGraph, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, a, _, inverse, entry⟩ + have copied := (pair_mem_relationConverse _ _ _ _ _).1 inverse + have same := embedding.injective a x y copied.2.2 copy + exact same ▸ entry + · intro entry + exact ⟨(mem_relationImage A B e y).2 ⟨bounds.2, x, bounds.1, copy⟩, + (ZFSet.pair_mem_prod.1 (height.1 entry)).2, x, bounds.1, + (pair_mem_relationConverse A B e x y).2 ⟨bounds.1, bounds.2, copy⟩, entry⟩ + +theorem pushedHeightGraph_function {A B H e h : ZFSet.{u}} + (embedding : InjectionCode A B e) (height : ZFSet.IsFunc A H h) : + ZFSet.IsFunc (relationImage A B e) H (pushedHeightGraph A B H e h) := + relationCompose_function_of_subset embedding.converse_image.function height (fun _ hx => hx) + +theorem pushedHeightGraph_range {A B H e h : ZFSet.{u}} + (embedding : InjectionCode A B e) (height : ZFSet.IsFunc A H h) : + relationImage (relationImage A B e) H (pushedHeightGraph A B H e h) = relationImage A H h := by + apply ZFSet.ext + intro z + rw [mem_relationImage, mem_relationImage] + constructor + · rintro ⟨hz, y, hy, entry⟩ + obtain ⟨_, x, hx, copy⟩ := (mem_relationImage A B e y).1 hy + exact ⟨hz, x, hx, (pushedHeightGraph_entry embedding height copy).1 entry⟩ + · rintro ⟨hz, x, hx, entry⟩ + obtain ⟨y, copy, _⟩ := embedding.function.2 x hx + have hy := (ZFSet.pair_mem_prod.1 (embedding.function.1 copy)).2 + exact ⟨hz, y, (mem_relationImage A B e y).2 ⟨hy, x, hx, copy⟩, + (pushedHeightGraph_entry embedding height copy).2 entry⟩ + +theorem pushedHeightGraph_strictLex {A B C D rA rB μA μB e h rD : ZFSet.{u}} + (embedding : IdealEmbeddingCode A B rA rB μA μB e) + (height : StrictLexHeightCode A C D rA h rD) : + StrictLexHeightCode (relationImage A B e) C D rB (pushedHeightGraph A B (ZFSet.prod C D) e h) rD := by + refine ⟨pushedHeightGraph_function embedding.injection height.function, ?_⟩ + intro x hx y hy c q d v lower different first second + obtain ⟨_, a, ha, ax⟩ := (mem_relationImage A B e x).1 hx + obtain ⟨_, b, hb, by'⟩ := (mem_relationImage A B e y).1 hy + have distinct : a ≠ b := by + intro same + subst b + obtain ⟨_, _, unique⟩ := embedding.injection.function.2 a ha + exact different ((unique x ax).trans (unique y by').symm) + exact height.strict a ha b hb c q d v (embedding.reflect a b x y ax by' lower) distinct + ((pushedHeightGraph_entry embedding.injection height.function ax).1 first) + ((pushedHeightGraph_entry embedding.injection height.function by').1 second) + +namespace TransitiveGround +theorem pushedHeightGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A B H e h : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hH : H ∈ M.sets) + (he : e ∈ M.sets) (hh : h ∈ M.sets) : pushedHeightGraph A B H e h ∈ M.sets := + M.relationCompose_mem pairing unions powers separation + (M.relationImage_mem separation hA hB he) hA hH + (M.relationConverse_mem pairing unions powers separation hA hB he) hh +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIdentityInsertionTasks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIdentityInsertionTasks.lean index ee7c131076f21faf20dd780e60d9ceeb8f5f61f4..02b453d5dbd2d152c5b90414754aaa49f755a0da 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIdentityInsertionTasks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIdentityInsertionTasks.lean @@ -1,186 +1,186 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -noncomputable def identityIdealGraph (P r C : ZFSet.{u}) : ZFSet.{u} := - identityFunctionGraph (attachmentIdeal P r C) - -theorem pair_mem_identityIdealGraph (P r C x y : ZFSet.{u}) : - ZFSet.pair x y ∈ identityIdealGraph P r C ↔ - x = y ∧ x ∈ P ∧ ZFSet.pair x C ∈ r := by - rw [identityIdealGraph, pair_mem_identityFunctionGraph, mem_attachmentIdeal] - -theorem identityIdealGraph_restrictedAction {P G r A m one C : ZFSet.{u}} - (action : PosetActionCode G P m one r A) (hC : C ∈ P) : - RestrictedActionCode P r A one C C (identityIdealGraph P r C) where - shape := by - intro z hz - obtain ⟨x, hx, rfl⟩ := (mem_identityFunctionGraph (attachmentIdeal P r C) z).1 hz - have member := ((mem_attachmentIdeal P r C x).1 hx).1 - exact ZFSet.pair_mem_prod.2 ⟨member, member⟩ - target_entry := action.one C hC - entries x hx y hy := by - rw [pair_mem_identityIdealGraph] - constructor - · rintro ⟨rfl, _, lower⟩ - exact ⟨lower, action.one x hx⟩ - · rintro ⟨lower, entry⟩ - have equal := (show FunctionGraphOn (ZFSet.prod G P) A from ⟨P, action.function⟩).unique - entry (action.one x hx) - exact ⟨equal.symm, hx, lower⟩ - -theorem identityInsertion_eligible {P G r μ A m one C E F : ZFSet.{u}} - (action : PosetActionCode G P m one r A) (hOne : one ∈ G) - (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) - (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) - (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) : - EligibleTaskCode P G r μ A C C (identityIdealGraph P r C) E F := - ⟨hC, hC, hE, filter, lower, strict, above, - one, hOne, identityIdealGraph_restrictedAction action hC⟩ - -noncomputable def identityInsertionTask (P r C E F label : ZFSet.{u}) : ZFSet.{u} := - literalTaskCode C C (identityIdealGraph P r C) E F label - -theorem identityInsertionTask_injective (P r C E F : ZFSet.{u}) : - Function.Injective (identityInsertionTask P r C E F) := by - intro first second equal - exact (literalTaskCode_inj.1 equal).2.2.2.2.2 - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def identityInsertionTaskGraph (Labels I P r C E F : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ label ∈ Labels, ∃ task ∈ I, - z = ZFSet.pair label task ∧ task = identityInsertionTask P r C E F label) - (ZFSet.prod Labels I) - -theorem pair_mem_identityInsertionTaskGraph (Labels I P r C E F label task : ZFSet.{u}) : - ZFSet.pair label task ∈ identityInsertionTaskGraph Labels I P r C E F ↔ - label ∈ Labels ∧ task ∈ I ∧ task = identityInsertionTask P r C E F label := by - rw [identityInsertionTaskGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, a, ha, b, hb, equal, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨ha, hb, code⟩ - · rintro ⟨ha, hb, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, label, ha, task, hb, rfl, code⟩ - -namespace BoundedFormula - -def identityInsertionGraphEntryFormula {n} (z Labels I C base E F : Fin n) : BoundedFormula n := - .exMem Labels (.exMem I.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (literalTaskFormula 0 C.succ.succ C.succ.succ base.succ.succ E.succ.succ F.succ.succ 1))) - -theorem truth_identityInsertionGraphEntryFormula {n} (z Labels I C base E F : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (identityInsertionGraphEntryFormula z Labels I C base E F) env ↔ - ∃ label ∈ env Labels, ∃ task ∈ env I, env z = ZFSet.pair label task ∧ - task = literalTaskCode (env C) (env C) (env base) (env E) (env F) label := by - simp only [identityInsertionGraphEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_literalTaskFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem identityIdealGraph_mem {P r C : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hC : C ∈ P) : identityIdealGraph P r C ∈ M.sets := - M.identityFunctionGraph_mem pairing unions powers separation - (M.attachmentIdeal_mem separation hP hr (M.transitive hP hC)) - -theorem identityInsertionTask_mem {P G r μ A m one Labels C E F label : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hF : F ∈ M.sets) - (action : PosetActionCode G P m one r A) (hOne : one ∈ G) - (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) - (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) - (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) (hlabel : label ∈ Labels) : - identityInsertionTask P r C E F label ∈ M.groundEligibleTasks P G r μ A Labels := - (M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels C C (identityIdealGraph P r C) - E F label).2 ⟨hlabel, M.identityIdealGraph_mem pairing unions powers separation hP hr hC, - hF, identityInsertion_eligible action hOne hC hE filter lower strict above⟩ - -theorem identityInsertionTaskGraph_mem {Labels I P r C E F : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hr : r ∈ M.sets) - (hC : C ∈ P) (hE : E ∈ P) (hF : F ∈ M.sets) : - identityInsertionTaskGraph Labels I P r C E F ∈ M.sets := by - let params := extend Labels (extend I (extend C (extend (identityIdealGraph P r C) - (extend E (extend F Fin.elim0))))) - have members : ∀ j, params j ∈ M.sets := Fin.cases hLabels (Fin.cases hI - (Fin.cases (M.transitive hP hC) (Fin.cases (M.identityIdealGraph_mem pairing unions powers separation hP hr hC) - (Fin.cases (M.transitive hP hE) (Fin.cases hF (fun j => Fin.elim0 j)))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.identityInsertionGraphEntryFormula 0 1 2 3 4 5 6) params members - (M.prod_mem pairing unions powers separation hLabels hI) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.identityInsertionGraphEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod Labels I) = identityInsertionTaskGraph Labels I P r C E F := by - apply ZFSet.ext - intro z - rw [identityInsertionTaskGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_identityInsertionGraphEntryFormula 0 1 2 3 4 5 6 _) - exact equal ▸ selected - -theorem identityInsertionTaskGraph_injection {P G r μ A m one Labels C E F : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hF : F ∈ M.sets) - (action : PosetActionCode G P m one r A) (hOne : one ∈ G) - (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) - (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) - (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) : - InjectionCode Labels (M.groundEligibleTasks P G r μ A Labels) - (identityInsertionTaskGraph Labels (M.groundEligibleTasks P G r μ A Labels) P r C E F) := by - let I := M.groundEligibleTasks P G r μ A Labels - have every (label : ZFSet.{u}) (hlabel : label ∈ Labels) : identityInsertionTask P r C E F label ∈ I := - M.identityInsertionTask_mem pairing unions powers separation hP hr hF action hOne hC hE - filter lower strict above hlabel - refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ - · intro label hlabel - refine ⟨identityInsertionTask P r C E F label, - (pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).2 ⟨hlabel, every label hlabel, rfl⟩, ?_⟩ - intro task entry - exact ((pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).1 entry).2.2 - · intro first second task oneEntry twoEntry - have firstEq := ((pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).1 oneEntry).2.2 - have secondEq := ((pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).1 twoEntry).2.2 - exact identityInsertionTask_injective P r C E F (firstEq.symm.trans secondEq) - -theorem identityInsertionTask_fields {P G r μ A m one Labels C E F label : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hF : F ∈ M.sets) - (action : PosetActionCode G P m one r A) (hOne : one ∈ G) - (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) - (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) - (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) (hlabel : label ∈ Labels) (j : Fin 6) : - ZFSet.pair (identityInsertionTask P r C E F label) - (literalTaskField C C (identityIdealGraph P r C) E F label j) ∈ - literalTaskFieldGraph (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels j := by - have base := identityIdealGraph_restrictedAction action hC - have hBase := (M.mem_groundRelations P P _).2 - ⟨M.identityIdealGraph_mem pairing unions powers separation hP hr hC, base.shape⟩ - exact (literalTaskFieldGraph_entry_iff hC hC hBase hE - ((M.mem_groundMeetFilters P r μ F).2 ⟨hF, filter⟩) hlabel j).2 - ⟨M.identityInsertionTask_mem pairing unions powers separation hP hr hF action hOne hC hE - filter lower strict above hlabel, rfl⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +noncomputable def identityIdealGraph (P r C : ZFSet.{u}) : ZFSet.{u} := + identityFunctionGraph (attachmentIdeal P r C) + +theorem pair_mem_identityIdealGraph (P r C x y : ZFSet.{u}) : + ZFSet.pair x y ∈ identityIdealGraph P r C ↔ + x = y ∧ x ∈ P ∧ ZFSet.pair x C ∈ r := by + rw [identityIdealGraph, pair_mem_identityFunctionGraph, mem_attachmentIdeal] + +theorem identityIdealGraph_restrictedAction {P G r A m one C : ZFSet.{u}} + (action : PosetActionCode G P m one r A) (hC : C ∈ P) : + RestrictedActionCode P r A one C C (identityIdealGraph P r C) where + shape := by + intro z hz + obtain ⟨x, hx, rfl⟩ := (mem_identityFunctionGraph (attachmentIdeal P r C) z).1 hz + have member := ((mem_attachmentIdeal P r C x).1 hx).1 + exact ZFSet.pair_mem_prod.2 ⟨member, member⟩ + target_entry := action.one C hC + entries x hx y hy := by + rw [pair_mem_identityIdealGraph] + constructor + · rintro ⟨rfl, _, lower⟩ + exact ⟨lower, action.one x hx⟩ + · rintro ⟨lower, entry⟩ + have equal := (show FunctionGraphOn (ZFSet.prod G P) A from ⟨P, action.function⟩).unique + entry (action.one x hx) + exact ⟨equal.symm, hx, lower⟩ + +theorem identityInsertion_eligible {P G r μ A m one C E F : ZFSet.{u}} + (action : PosetActionCode G P m one r A) (hOne : one ∈ G) + (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) + (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) + (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) : + EligibleTaskCode P G r μ A C C (identityIdealGraph P r C) E F := + ⟨hC, hC, hE, filter, lower, strict, above, + one, hOne, identityIdealGraph_restrictedAction action hC⟩ + +noncomputable def identityInsertionTask (P r C E F label : ZFSet.{u}) : ZFSet.{u} := + literalTaskCode C C (identityIdealGraph P r C) E F label + +theorem identityInsertionTask_injective (P r C E F : ZFSet.{u}) : + Function.Injective (identityInsertionTask P r C E F) := by + intro first second equal + exact (literalTaskCode_inj.1 equal).2.2.2.2.2 + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def identityInsertionTaskGraph (Labels I P r C E F : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ label ∈ Labels, ∃ task ∈ I, + z = ZFSet.pair label task ∧ task = identityInsertionTask P r C E F label) + (ZFSet.prod Labels I) + +theorem pair_mem_identityInsertionTaskGraph (Labels I P r C E F label task : ZFSet.{u}) : + ZFSet.pair label task ∈ identityInsertionTaskGraph Labels I P r C E F ↔ + label ∈ Labels ∧ task ∈ I ∧ task = identityInsertionTask P r C E F label := by + rw [identityInsertionTaskGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, a, ha, b, hb, equal, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨ha, hb, code⟩ + · rintro ⟨ha, hb, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, label, ha, task, hb, rfl, code⟩ + +namespace BoundedFormula + +def identityInsertionGraphEntryFormula {n} (z Labels I C base E F : Fin n) : BoundedFormula n := + .exMem Labels (.exMem I.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (literalTaskFormula 0 C.succ.succ C.succ.succ base.succ.succ E.succ.succ F.succ.succ 1))) + +theorem truth_identityInsertionGraphEntryFormula {n} (z Labels I C base E F : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (identityInsertionGraphEntryFormula z Labels I C base E F) env ↔ + ∃ label ∈ env Labels, ∃ task ∈ env I, env z = ZFSet.pair label task ∧ + task = literalTaskCode (env C) (env C) (env base) (env E) (env F) label := by + simp only [identityInsertionGraphEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_literalTaskFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem identityIdealGraph_mem {P r C : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hC : C ∈ P) : identityIdealGraph P r C ∈ M.sets := + M.identityFunctionGraph_mem pairing unions powers separation + (M.attachmentIdeal_mem separation hP hr (M.transitive hP hC)) + +theorem identityInsertionTask_mem {P G r μ A m one Labels C E F label : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hF : F ∈ M.sets) + (action : PosetActionCode G P m one r A) (hOne : one ∈ G) + (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) + (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) + (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) (hlabel : label ∈ Labels) : + identityInsertionTask P r C E F label ∈ M.groundEligibleTasks P G r μ A Labels := + (M.literalTaskCode_mem_groundEligibleTasks P G r μ A Labels C C (identityIdealGraph P r C) + E F label).2 ⟨hlabel, M.identityIdealGraph_mem pairing unions powers separation hP hr hC, + hF, identityInsertion_eligible action hOne hC hE filter lower strict above⟩ + +theorem identityInsertionTaskGraph_mem {Labels I P r C E F : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hr : r ∈ M.sets) + (hC : C ∈ P) (hE : E ∈ P) (hF : F ∈ M.sets) : + identityInsertionTaskGraph Labels I P r C E F ∈ M.sets := by + let params := extend Labels (extend I (extend C (extend (identityIdealGraph P r C) + (extend E (extend F Fin.elim0))))) + have members : ∀ j, params j ∈ M.sets := Fin.cases hLabels (Fin.cases hI + (Fin.cases (M.transitive hP hC) (Fin.cases (M.identityIdealGraph_mem pairing unions powers separation hP hr hC) + (Fin.cases (M.transitive hP hE) (Fin.cases hF (fun j => Fin.elim0 j)))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.identityInsertionGraphEntryFormula 0 1 2 3 4 5 6) params members + (M.prod_mem pairing unions powers separation hLabels hI) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.identityInsertionGraphEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod Labels I) = identityInsertionTaskGraph Labels I P r C E F := by + apply ZFSet.ext + intro z + rw [identityInsertionTaskGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_identityInsertionGraphEntryFormula 0 1 2 3 4 5 6 _) + exact equal ▸ selected + +theorem identityInsertionTaskGraph_injection {P G r μ A m one Labels C E F : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hF : F ∈ M.sets) + (action : PosetActionCode G P m one r A) (hOne : one ∈ G) + (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) + (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) + (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) : + InjectionCode Labels (M.groundEligibleTasks P G r μ A Labels) + (identityInsertionTaskGraph Labels (M.groundEligibleTasks P G r μ A Labels) P r C E F) := by + let I := M.groundEligibleTasks P G r μ A Labels + have every (label : ZFSet.{u}) (hlabel : label ∈ Labels) : identityInsertionTask P r C E F label ∈ I := + M.identityInsertionTask_mem pairing unions powers separation hP hr hF action hOne hC hE + filter lower strict above hlabel + refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ + · intro label hlabel + refine ⟨identityInsertionTask P r C E F label, + (pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).2 ⟨hlabel, every label hlabel, rfl⟩, ?_⟩ + intro task entry + exact ((pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).1 entry).2.2 + · intro first second task oneEntry twoEntry + have firstEq := ((pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).1 oneEntry).2.2 + have secondEq := ((pair_mem_identityInsertionTaskGraph Labels I P r C E F _ _).1 twoEntry).2.2 + exact identityInsertionTask_injective P r C E F (firstEq.symm.trans secondEq) + +theorem identityInsertionTask_fields {P G r μ A m one Labels C E F label : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hF : F ∈ M.sets) + (action : PosetActionCode G P m one r A) (hOne : one ∈ G) + (hC : C ∈ P) (hE : E ∈ P) (filter : MeetFilterCode P r μ F) + (lower : ZFSet.pair C E ∈ r) (strict : ZFSet.pair E C ∉ r) + (above : ∀ x ∈ F, ZFSet.pair E x ∈ r) (hlabel : label ∈ Labels) (j : Fin 6) : + ZFSet.pair (identityInsertionTask P r C E F label) + (literalTaskField C C (identityIdealGraph P r C) E F label j) ∈ + literalTaskFieldGraph (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels j := by + have base := identityIdealGraph_restrictedAction action hC + have hBase := (M.mem_groundRelations P P _).2 + ⟨M.identityIdealGraph_mem pairing unions powers separation hP hr hC, base.shape⟩ + exact (literalTaskFieldGraph_entry_iff hC hC hBase hE + ((M.mem_groundMeetFilters P r μ F).2 ⟨hF, filter⟩) hlabel j).2 + ⟨M.identityInsertionTask_mem pairing unions powers separation hP hr hF action hOne hC hE + filter lower strict above hlabel, rfl⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedClassInclusions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedClassInclusions.lean index cd5c6d17d8048360267190edfd30d7291cb812be..c8dc3c7410935721befc7b051a6ba3764879e389 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedClassInclusions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedClassInclusions.lean @@ -1,270 +1,270 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.EquivalenceClassCodes - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -namespace BoundedFormula - -open SetFormula - -def equivalenceClassFormula {n} (C A E y : Fin n) : BoundedFormula n := - .conj (.allMem C (.mem 0 A.succ)) - (.allMem A (.conj - (imp (.mem 0 C.succ) (pairMembershipFormula 0 y.succ E.succ)) - (imp (pairMembershipFormula 0 y.succ E.succ) (.mem 0 C.succ)))) - -theorem truth_equivalenceClassFormula {n} (C A E y : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (equivalenceClassFormula C A E y) env ↔ - env C = equivalenceClass (env A) (env E) (env y) := by - simp only [equivalenceClassFormula, Truth, truth_imp, truth_pairMembershipFormula] - change ((∀ x ∈ env C, x ∈ env A) ∧ ∀ x ∈ env A, - (x ∈ env C → ZFSet.pair x (env y) ∈ env E) ∧ - (ZFSet.pair x (env y) ∈ env E → x ∈ env C)) ↔ _ - constructor - · rintro ⟨subset, complete⟩ - apply ZFSet.ext - intro x - rw [mem_equivalenceClass] - exact ⟨fun hx => ⟨subset x hx, (complete x (subset x hx)).1 hx⟩, - fun hx => (complete x hx.1).2 hx.2⟩ - · intro equal - rw [equal] - exact ⟨fun _ hx => (mem_equivalenceClass _ _ _ _).1 hx |>.1, - fun x hx => ⟨fun h => (mem_equivalenceClass _ _ _ x).1 h |>.2, - fun h => (mem_equivalenceClass _ _ _ x).2 ⟨hx, h⟩⟩⟩ - -def equivalenceClassesFormula {n} (C A E : Fin n) : BoundedFormula n := - exMem A (equivalenceClassFormula C.succ A.succ E.succ 0) - -theorem truth_equivalenceClassesFormula {n} (C A E : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (equivalenceClassesFormula C A E) env ↔ - env C ∈ equivalenceClasses (env A) (env E) := by - simp only [equivalenceClassesFormula, truth_exMem, truth_equivalenceClassFormula, - mem_equivalenceClasses] - rfl - -def equivalenceClassifierEntryFormula {n} (z A E Q : Fin n) : BoundedFormula n := - exMem A (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (equivalenceClassFormula 0 A.succ.succ E.succ.succ 1))) - -theorem truth_equivalenceClassifierEntryFormula {n} (z A E Q : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (equivalenceClassifierEntryFormula z A E Q) env ↔ - ∃ y ∈ env A, ∃ C ∈ env Q, - env z = ZFSet.pair y C ∧ C = equivalenceClass (env A) (env E) y := by - simp only [equivalenceClassifierEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_equivalenceClassFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem equivalenceClass_mem (separation : SeparationSchema M.sets) - {A E y : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) (hy : y ∈ M.sets) : - equivalenceClass A E y ∈ M.sets := by - let params := extend y (extend E Fin.elim0) - have selected := M.bounded_separation_mem separation - (BoundedFormula.pairMembershipFormula 0 1 2) params - (Fin.cases hy (Fin.cases hE (fun i => Fin.elim0 i))) hA - have equal : ZFSet.sep (fun x => BoundedFormula.Truth - (BoundedFormula.pairMembershipFormula 0 1 2) (extend x params)) A = - equivalenceClass A E y := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, mem_equivalenceClass] - exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 0 1 2 _) - exact equal ▸ selected - -theorem equivalenceClasses_eq_sep_groundPower (separation : SeparationSchema M.sets) - {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) : - equivalenceClasses A E = ZFSet.sep - (fun C => ∃ y ∈ A, C = equivalenceClass A E y) (M.groundPower A) := by - apply ZFSet.ext - intro C - rw [mem_equivalenceClasses, ZFSet.mem_sep, M.mem_groundPower] - refine ⟨?_, And.right⟩ - rintro ⟨y, hy, rfl⟩ - exact ⟨⟨M.equivalenceClass_mem separation hA hE (M.transitive hA hy), - equivalenceClass_subset A E y⟩, y, hy, rfl⟩ - -theorem equivalenceClasses_mem (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) - {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) : - equivalenceClasses A E ∈ M.sets := by - let params := extend A (extend E Fin.elim0) - have selected := M.bounded_separation_mem separation - (BoundedFormula.equivalenceClassesFormula 0 1 2) params - (Fin.cases hA (Fin.cases hE (fun i => Fin.elim0 i))) (M.groundPower_mem powers hA) - have equal : ZFSet.sep (fun C => BoundedFormula.Truth - (BoundedFormula.equivalenceClassesFormula 0 1 2) (extend C params)) - (M.groundPower A) = equivalenceClasses A E := by - rw [M.equivalenceClasses_eq_sep_groundPower separation hA hE] - apply ZFSet.ext - intro C - rw [ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl - ((BoundedFormula.truth_equivalenceClassesFormula 0 1 2 _).trans - (mem_equivalenceClasses A E C)) - exact equal ▸ selected - -theorem equivalenceClassifier_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) : - equivalenceClassifier A E ∈ M.sets := by - have hQ := M.equivalenceClasses_mem powers separation hA hE - let params := extend A (extend E (extend (equivalenceClasses A E) Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.equivalenceClassifierEntryFormula 0 1 2 3) params - (Fin.cases hA (Fin.cases hE (Fin.cases hQ (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hA hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.equivalenceClassifierEntryFormula 0 1 2 3) (extend z params)) - (ZFSet.prod A (equivalenceClasses A E)) = equivalenceClassifier A E := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_equivalenceClassifierEntryFormula, - mem_equivalenceClassifier] - constructor - · rintro ⟨_, y, hy, C, _, equal, rfl⟩ - exact ⟨y, hy, equal⟩ - · rintro ⟨y, hy, rfl⟩ - have hyQ := Forcing.equivalenceClass_mem (E := E) hy - exact ⟨ZFSet.pair_mem_prod.2 ⟨hy, hyQ⟩, y, hy, - equivalenceClass A E y, hyQ, rfl, rfl⟩ - exact equal ▸ selected - -theorem equivalenceClasses_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) - (equivalence : EquivalenceRelationCode A E) : - equivalenceClasses A E ∈ M.sets ∧ equivalenceClassifier A E ∈ M.sets ∧ - ZFSet.IsFunc A (equivalenceClasses A E) (equivalenceClassifier A E) ∧ - (∀ C ∈ equivalenceClasses A E, ∃ y ∈ A, - ZFSet.pair y C ∈ equivalenceClassifier A E) ∧ - (∀ x y C D, ZFSet.pair x C ∈ equivalenceClassifier A E → - ZFSet.pair y D ∈ equivalenceClassifier A E → (C = D ↔ ZFSet.pair x y ∈ E)) := - ⟨M.equivalenceClasses_mem powers separation hA hE, - M.equivalenceClassifier_mem pairing unions powers separation hA hE, - equivalenceClassifier_function A E, fun _ hC => equivalenceClassifier_onto hC, - fun _ _ _ _ first second => equivalence.classifier_kernel first second⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def indexedClassInclusion (U L E i : ZFSet.{u}) : ZFSet.{u} := - indexedRelationSection U (equivalenceClasses L E) (equivalenceClassifier L E) i - -theorem pair_mem_indexedClassInclusion (U L E i x y : ZFSet.{u}) : - ZFSet.pair x y ∈ indexedClassInclusion U L E i ↔ - x ∈ U ∧ ZFSet.pair i x ∈ L ∧ y = equivalenceClass L E (ZFSet.pair i x) := by - rw [indexedClassInclusion, pair_mem_indexedRelationSection, pair_mem_equivalenceClassifier] - constructor - · rintro ⟨hu, _, label, equal⟩ - exact ⟨hu, label, equal⟩ - · rintro ⟨hu, label, rfl⟩ - exact ⟨hu, equivalenceClass_mem label, label, rfl⟩ - -theorem pair_mem_indexedClassInclusion_of_entry {T U A E i X x y : ZFSet.{u}} - (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) : - ZFSet.pair x y ∈ indexedClassInclusion U (indexedCarrierLabels T U A) E i ↔ - x ∈ X ∧ y = equivalenceClass (indexedCarrierLabels T U A) E (ZFSet.pair i x) := by - rw [pair_mem_indexedClassInclusion, pair_mem_indexedCarrierLabels_of_entry family entry bound] - exact ⟨fun h => h.2, fun h => ⟨bound h.1, h⟩⟩ - -theorem indexedClassInclusion_function {T U A E i X : ZFSet.{u}} - (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) : - ZFSet.IsFunc X (equivalenceClasses (indexedCarrierLabels T U A) E) - (indexedClassInclusion U (indexedCarrierLabels T U A) E i) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, _, y, hy, rfl, _⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz - exact ZFSet.pair_mem_prod.2 - ⟨((pair_mem_indexedClassInclusion_of_entry family entry bound).1 hz).1, hy⟩ - · intro x hx - exact ⟨equivalenceClass (indexedCarrierLabels T U A) E (ZFSet.pair i x), - (pair_mem_indexedClassInclusion_of_entry family entry bound).2 ⟨hx, rfl⟩, - fun y hy => ((pair_mem_indexedClassInclusion_of_entry family entry bound).1 hy).2⟩ - -theorem indexedClassInclusion_kernel {U L E i j x y p q : ZFSet.{u}} - (equivalence : EquivalenceRelationCode L E) - (first : ZFSet.pair x p ∈ indexedClassInclusion U L E i) - (second : ZFSet.pair y q ∈ indexedClassInclusion U L E j) : - p = q ↔ ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∈ E := by - obtain ⟨_, hx, rfl⟩ := (pair_mem_indexedClassInclusion U L E i x p).1 first - obtain ⟨_, hy, rfl⟩ := (pair_mem_indexedClassInclusion U L E j y q).1 second - exact equivalence.class_eq_iff hx hy - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem indexedClassInclusion_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U L E i : ZFSet.{u}} (hU : U ∈ M.sets) (hL : L ∈ M.sets) - (hE : E ∈ M.sets) (hi : i ∈ M.sets) : indexedClassInclusion U L E i ∈ M.sets := - M.indexedRelationSection_mem pairing unions powers separation hU - (M.equivalenceClasses_mem powers separation hL hE) - (M.equivalenceClassifier_mem pairing unions powers separation hL hE) hi - -noncomputable def indexedClassInclusions (T U L E : ZFSet.{u}) : ZFSet.{u} := - M.indexedRelationSections T U (equivalenceClasses L E) (equivalenceClassifier L E) - -theorem pair_mem_indexedClassInclusions (T U L E i f : ZFSet.{u}) : - ZFSet.pair i f ∈ M.indexedClassInclusions T U L E ↔ - i ∈ T ∧ f ∈ M.groundRelations U (equivalenceClasses L E) ∧ - f = indexedClassInclusion U L E i := - M.pair_mem_indexedRelationSections T U (equivalenceClasses L E) (equivalenceClassifier L E) i f - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {T U L E : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) -variable (hL : L ∈ M.sets) (hE : E ∈ M.sets) -include pairing unions powers separation hT hU hL hE - -theorem indexedClassInclusions_mem : M.indexedClassInclusions T U L E ∈ M.sets := - M.indexedRelationSections_mem pairing unions powers separation hT hU - (M.equivalenceClasses_mem powers separation hL hE) - (M.equivalenceClassifier_mem pairing unions powers separation hL hE) - -theorem indexedClassInclusions_function : - ZFSet.IsFunc T (M.groundRelations U (equivalenceClasses L E)) - (M.indexedClassInclusions T U L E) := - M.indexedRelationSections_function pairing unions powers separation hT hU - (M.equivalenceClasses_mem powers separation hL hE) - (M.equivalenceClassifier_mem pairing unions powers separation hL hE) - -theorem indexedClassInclusions_entries (i f : ZFSet.{u}) : - ZFSet.pair i f ∈ M.indexedClassInclusions T U L E ↔ - i ∈ T ∧ f = indexedClassInclusion U L E i := - (M.indexedRelationSections_spec pairing unions powers separation hT hU - (M.equivalenceClasses_mem powers separation hL hE) - (M.equivalenceClassifier_mem pairing unions powers separation hL hE)).2.2 i f - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.EquivalenceClassCodes + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +namespace BoundedFormula + +open SetFormula + +def equivalenceClassFormula {n} (C A E y : Fin n) : BoundedFormula n := + .conj (.allMem C (.mem 0 A.succ)) + (.allMem A (.conj + (imp (.mem 0 C.succ) (pairMembershipFormula 0 y.succ E.succ)) + (imp (pairMembershipFormula 0 y.succ E.succ) (.mem 0 C.succ)))) + +theorem truth_equivalenceClassFormula {n} (C A E y : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (equivalenceClassFormula C A E y) env ↔ + env C = equivalenceClass (env A) (env E) (env y) := by + simp only [equivalenceClassFormula, Truth, truth_imp, truth_pairMembershipFormula] + change ((∀ x ∈ env C, x ∈ env A) ∧ ∀ x ∈ env A, + (x ∈ env C → ZFSet.pair x (env y) ∈ env E) ∧ + (ZFSet.pair x (env y) ∈ env E → x ∈ env C)) ↔ _ + constructor + · rintro ⟨subset, complete⟩ + apply ZFSet.ext + intro x + rw [mem_equivalenceClass] + exact ⟨fun hx => ⟨subset x hx, (complete x (subset x hx)).1 hx⟩, + fun hx => (complete x hx.1).2 hx.2⟩ + · intro equal + rw [equal] + exact ⟨fun _ hx => (mem_equivalenceClass _ _ _ _).1 hx |>.1, + fun x hx => ⟨fun h => (mem_equivalenceClass _ _ _ x).1 h |>.2, + fun h => (mem_equivalenceClass _ _ _ x).2 ⟨hx, h⟩⟩⟩ + +def equivalenceClassesFormula {n} (C A E : Fin n) : BoundedFormula n := + exMem A (equivalenceClassFormula C.succ A.succ E.succ 0) + +theorem truth_equivalenceClassesFormula {n} (C A E : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (equivalenceClassesFormula C A E) env ↔ + env C ∈ equivalenceClasses (env A) (env E) := by + simp only [equivalenceClassesFormula, truth_exMem, truth_equivalenceClassFormula, + mem_equivalenceClasses] + rfl + +def equivalenceClassifierEntryFormula {n} (z A E Q : Fin n) : BoundedFormula n := + exMem A (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (equivalenceClassFormula 0 A.succ.succ E.succ.succ 1))) + +theorem truth_equivalenceClassifierEntryFormula {n} (z A E Q : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (equivalenceClassifierEntryFormula z A E Q) env ↔ + ∃ y ∈ env A, ∃ C ∈ env Q, + env z = ZFSet.pair y C ∧ C = equivalenceClass (env A) (env E) y := by + simp only [equivalenceClassifierEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_equivalenceClassFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem equivalenceClass_mem (separation : SeparationSchema M.sets) + {A E y : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) (hy : y ∈ M.sets) : + equivalenceClass A E y ∈ M.sets := by + let params := extend y (extend E Fin.elim0) + have selected := M.bounded_separation_mem separation + (BoundedFormula.pairMembershipFormula 0 1 2) params + (Fin.cases hy (Fin.cases hE (fun i => Fin.elim0 i))) hA + have equal : ZFSet.sep (fun x => BoundedFormula.Truth + (BoundedFormula.pairMembershipFormula 0 1 2) (extend x params)) A = + equivalenceClass A E y := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, mem_equivalenceClass] + exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 0 1 2 _) + exact equal ▸ selected + +theorem equivalenceClasses_eq_sep_groundPower (separation : SeparationSchema M.sets) + {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) : + equivalenceClasses A E = ZFSet.sep + (fun C => ∃ y ∈ A, C = equivalenceClass A E y) (M.groundPower A) := by + apply ZFSet.ext + intro C + rw [mem_equivalenceClasses, ZFSet.mem_sep, M.mem_groundPower] + refine ⟨?_, And.right⟩ + rintro ⟨y, hy, rfl⟩ + exact ⟨⟨M.equivalenceClass_mem separation hA hE (M.transitive hA hy), + equivalenceClass_subset A E y⟩, y, hy, rfl⟩ + +theorem equivalenceClasses_mem (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) + {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) : + equivalenceClasses A E ∈ M.sets := by + let params := extend A (extend E Fin.elim0) + have selected := M.bounded_separation_mem separation + (BoundedFormula.equivalenceClassesFormula 0 1 2) params + (Fin.cases hA (Fin.cases hE (fun i => Fin.elim0 i))) (M.groundPower_mem powers hA) + have equal : ZFSet.sep (fun C => BoundedFormula.Truth + (BoundedFormula.equivalenceClassesFormula 0 1 2) (extend C params)) + (M.groundPower A) = equivalenceClasses A E := by + rw [M.equivalenceClasses_eq_sep_groundPower separation hA hE] + apply ZFSet.ext + intro C + rw [ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl + ((BoundedFormula.truth_equivalenceClassesFormula 0 1 2 _).trans + (mem_equivalenceClasses A E C)) + exact equal ▸ selected + +theorem equivalenceClassifier_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) : + equivalenceClassifier A E ∈ M.sets := by + have hQ := M.equivalenceClasses_mem powers separation hA hE + let params := extend A (extend E (extend (equivalenceClasses A E) Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.equivalenceClassifierEntryFormula 0 1 2 3) params + (Fin.cases hA (Fin.cases hE (Fin.cases hQ (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hA hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.equivalenceClassifierEntryFormula 0 1 2 3) (extend z params)) + (ZFSet.prod A (equivalenceClasses A E)) = equivalenceClassifier A E := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_equivalenceClassifierEntryFormula, + mem_equivalenceClassifier] + constructor + · rintro ⟨_, y, hy, C, _, equal, rfl⟩ + exact ⟨y, hy, equal⟩ + · rintro ⟨y, hy, rfl⟩ + have hyQ := Forcing.equivalenceClass_mem (E := E) hy + exact ⟨ZFSet.pair_mem_prod.2 ⟨hy, hyQ⟩, y, hy, + equivalenceClass A E y, hyQ, rfl, rfl⟩ + exact equal ▸ selected + +theorem equivalenceClasses_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A E : ZFSet.{u}} (hA : A ∈ M.sets) (hE : E ∈ M.sets) + (equivalence : EquivalenceRelationCode A E) : + equivalenceClasses A E ∈ M.sets ∧ equivalenceClassifier A E ∈ M.sets ∧ + ZFSet.IsFunc A (equivalenceClasses A E) (equivalenceClassifier A E) ∧ + (∀ C ∈ equivalenceClasses A E, ∃ y ∈ A, + ZFSet.pair y C ∈ equivalenceClassifier A E) ∧ + (∀ x y C D, ZFSet.pair x C ∈ equivalenceClassifier A E → + ZFSet.pair y D ∈ equivalenceClassifier A E → (C = D ↔ ZFSet.pair x y ∈ E)) := + ⟨M.equivalenceClasses_mem powers separation hA hE, + M.equivalenceClassifier_mem pairing unions powers separation hA hE, + equivalenceClassifier_function A E, fun _ hC => equivalenceClassifier_onto hC, + fun _ _ _ _ first second => equivalence.classifier_kernel first second⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def indexedClassInclusion (U L E i : ZFSet.{u}) : ZFSet.{u} := + indexedRelationSection U (equivalenceClasses L E) (equivalenceClassifier L E) i + +theorem pair_mem_indexedClassInclusion (U L E i x y : ZFSet.{u}) : + ZFSet.pair x y ∈ indexedClassInclusion U L E i ↔ + x ∈ U ∧ ZFSet.pair i x ∈ L ∧ y = equivalenceClass L E (ZFSet.pair i x) := by + rw [indexedClassInclusion, pair_mem_indexedRelationSection, pair_mem_equivalenceClassifier] + constructor + · rintro ⟨hu, _, label, equal⟩ + exact ⟨hu, label, equal⟩ + · rintro ⟨hu, label, rfl⟩ + exact ⟨hu, equivalenceClass_mem label, label, rfl⟩ + +theorem pair_mem_indexedClassInclusion_of_entry {T U A E i X x y : ZFSet.{u}} + (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) : + ZFSet.pair x y ∈ indexedClassInclusion U (indexedCarrierLabels T U A) E i ↔ + x ∈ X ∧ y = equivalenceClass (indexedCarrierLabels T U A) E (ZFSet.pair i x) := by + rw [pair_mem_indexedClassInclusion, pair_mem_indexedCarrierLabels_of_entry family entry bound] + exact ⟨fun h => h.2, fun h => ⟨bound h.1, h⟩⟩ + +theorem indexedClassInclusion_function {T U A E i X : ZFSet.{u}} + (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) : + ZFSet.IsFunc X (equivalenceClasses (indexedCarrierLabels T U A) E) + (indexedClassInclusion U (indexedCarrierLabels T U A) E i) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, _, y, hy, rfl, _⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz + exact ZFSet.pair_mem_prod.2 + ⟨((pair_mem_indexedClassInclusion_of_entry family entry bound).1 hz).1, hy⟩ + · intro x hx + exact ⟨equivalenceClass (indexedCarrierLabels T U A) E (ZFSet.pair i x), + (pair_mem_indexedClassInclusion_of_entry family entry bound).2 ⟨hx, rfl⟩, + fun y hy => ((pair_mem_indexedClassInclusion_of_entry family entry bound).1 hy).2⟩ + +theorem indexedClassInclusion_kernel {U L E i j x y p q : ZFSet.{u}} + (equivalence : EquivalenceRelationCode L E) + (first : ZFSet.pair x p ∈ indexedClassInclusion U L E i) + (second : ZFSet.pair y q ∈ indexedClassInclusion U L E j) : + p = q ↔ ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∈ E := by + obtain ⟨_, hx, rfl⟩ := (pair_mem_indexedClassInclusion U L E i x p).1 first + obtain ⟨_, hy, rfl⟩ := (pair_mem_indexedClassInclusion U L E j y q).1 second + exact equivalence.class_eq_iff hx hy + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem indexedClassInclusion_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U L E i : ZFSet.{u}} (hU : U ∈ M.sets) (hL : L ∈ M.sets) + (hE : E ∈ M.sets) (hi : i ∈ M.sets) : indexedClassInclusion U L E i ∈ M.sets := + M.indexedRelationSection_mem pairing unions powers separation hU + (M.equivalenceClasses_mem powers separation hL hE) + (M.equivalenceClassifier_mem pairing unions powers separation hL hE) hi + +noncomputable def indexedClassInclusions (T U L E : ZFSet.{u}) : ZFSet.{u} := + M.indexedRelationSections T U (equivalenceClasses L E) (equivalenceClassifier L E) + +theorem pair_mem_indexedClassInclusions (T U L E i f : ZFSet.{u}) : + ZFSet.pair i f ∈ M.indexedClassInclusions T U L E ↔ + i ∈ T ∧ f ∈ M.groundRelations U (equivalenceClasses L E) ∧ + f = indexedClassInclusion U L E i := + M.pair_mem_indexedRelationSections T U (equivalenceClasses L E) (equivalenceClassifier L E) i f + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {T U L E : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) +variable (hL : L ∈ M.sets) (hE : E ∈ M.sets) +include pairing unions powers separation hT hU hL hE + +theorem indexedClassInclusions_mem : M.indexedClassInclusions T U L E ∈ M.sets := + M.indexedRelationSections_mem pairing unions powers separation hT hU + (M.equivalenceClasses_mem powers separation hL hE) + (M.equivalenceClassifier_mem pairing unions powers separation hL hE) + +theorem indexedClassInclusions_function : + ZFSet.IsFunc T (M.groundRelations U (equivalenceClasses L E)) + (M.indexedClassInclusions T U L E) := + M.indexedRelationSections_function pairing unions powers separation hT hU + (M.equivalenceClasses_mem powers separation hL hE) + (M.equivalenceClassifier_mem pairing unions powers separation hL hE) + +theorem indexedClassInclusions_entries (i f : ZFSet.{u}) : + ZFSet.pair i f ∈ M.indexedClassInclusions T U L E ↔ + i ∈ T ∧ f = indexedClassInclusion U L E i := + (M.indexedRelationSections_spec pairing unions powers separation hT hU + (M.equivalenceClasses_mem powers separation hL hE) + (M.equivalenceClassifier_mem pairing unions powers separation hL hE)).2.2 i f + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedImageCovers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedImageCovers.lean index 80d54c68c9644bcf8ef29bd6bb10836fcc52fe4e..06e2eb0bc4f6e3c4bbb0020408eadf582a9c5565 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedImageCovers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedImageCovers.lean @@ -1,60 +1,60 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions -import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def indexedImageCover (I U V maps : ZFSet.{u}) : ZFSet.{u} := - relationCompose V (ZFSet.prod I U) I - (relationConverse (ZFSet.prod I U) V (mapFamilyApplicationGraph I U V maps)) - (productFirst I U) - -theorem pair_mem_indexedImageCover (I U V maps y i : ZFSet.{u}) : - ZFSet.pair y i ∈ indexedImageCover I U V maps ↔ - y ∈ V ∧ i ∈ I ∧ ∃ x ∈ U, ∃ f, - ZFSet.pair i f ∈ maps ∧ ZFSet.pair x y ∈ f := by - rw [indexedImageCover, pair_mem_relationCompose] - constructor - · rintro ⟨hy, hi, z, _, converse, projection⟩ - obtain ⟨j, hj, x, hx, equal⟩ := (mem_productFirst I U _).1 projection - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have flattened := (pair_mem_relationConverse _ _ _ _ _).1 converse - obtain ⟨_, _, _, f, indexed, entry⟩ := - (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).1 flattened.2.2 - exact ⟨hy, hi, x, hx, f, indexed, entry⟩ - · rintro ⟨hy, hi, x, hx, f, indexed, entry⟩ - refine ⟨hy, hi, ZFSet.pair i x, ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, ?_, ?_⟩ - · exact (pair_mem_relationConverse _ _ _ _ _).2 - ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy, - (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).2 - ⟨hi, hx, hy, f, indexed, entry⟩⟩ - · exact (mem_productFirst I U _).2 ⟨i, hi, x, hx, rfl⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem indexedImageCover_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I U V maps : ZFSet.{u}} (hI : I ∈ M.sets) (hU : U ∈ M.sets) - (hV : V ∈ M.sets) (hMaps : maps ∈ M.sets) : - indexedImageCover I U V maps ∈ M.sets := by - have product := M.prod_mem pairing unions powers separation hI hU - exact M.relationCompose_mem pairing unions powers separation hV product hI - (M.relationConverse_mem pairing unions powers separation product hV - (M.mapFamilyApplicationGraph_mem pairing unions powers separation hI hU hV hMaps)) - (M.productFirst_mem pairing unions powers separation hI hU) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions +import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def indexedImageCover (I U V maps : ZFSet.{u}) : ZFSet.{u} := + relationCompose V (ZFSet.prod I U) I + (relationConverse (ZFSet.prod I U) V (mapFamilyApplicationGraph I U V maps)) + (productFirst I U) + +theorem pair_mem_indexedImageCover (I U V maps y i : ZFSet.{u}) : + ZFSet.pair y i ∈ indexedImageCover I U V maps ↔ + y ∈ V ∧ i ∈ I ∧ ∃ x ∈ U, ∃ f, + ZFSet.pair i f ∈ maps ∧ ZFSet.pair x y ∈ f := by + rw [indexedImageCover, pair_mem_relationCompose] + constructor + · rintro ⟨hy, hi, z, _, converse, projection⟩ + obtain ⟨j, hj, x, hx, equal⟩ := (mem_productFirst I U _).1 projection + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have flattened := (pair_mem_relationConverse _ _ _ _ _).1 converse + obtain ⟨_, _, _, f, indexed, entry⟩ := + (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).1 flattened.2.2 + exact ⟨hy, hi, x, hx, f, indexed, entry⟩ + · rintro ⟨hy, hi, x, hx, f, indexed, entry⟩ + refine ⟨hy, hi, ZFSet.pair i x, ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, ?_, ?_⟩ + · exact (pair_mem_relationConverse _ _ _ _ _).2 + ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy, + (pair_mem_mapFamilyApplicationGraph _ _ _ _ _ _ _).2 + ⟨hi, hx, hy, f, indexed, entry⟩⟩ + · exact (mem_productFirst I U _).2 ⟨i, hi, x, hx, rfl⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem indexedImageCover_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I U V maps : ZFSet.{u}} (hI : I ∈ M.sets) (hU : U ∈ M.sets) + (hV : V ∈ M.sets) (hMaps : maps ∈ M.sets) : + indexedImageCover I U V maps ∈ M.sets := by + have product := M.prod_mem pairing unions powers separation hI hU + exact M.relationCompose_mem pairing unions powers separation hV product hI + (M.relationConverse_mem pairing unions powers separation product hV + (M.mapFamilyApplicationGraph_mem pairing unions powers separation hI hU hV hMaps)) + (M.productFirst_mem pairing unions powers separation hI hU) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedMixedOperationLifts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedMixedOperationLifts.lean index 4fc7745735db331aaa9b1faf0e1f79b50f3a7a9c..206a4525fdbd0ed5190b105f3ed153548fa2c39c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedMixedOperationLifts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedMixedOperationLifts.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.IndexedMixedOperationLiftCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u -namespace BoundedFormula -open SetFormula - -def indexedMixedBinaryLiftEntryFormula : BoundedFormula 12 := - exMem 4 <| exMem 6 <| exMem 7 <| exMem 4 <| exMem 13 <| - exMem 15 <| exMem 17 <| exMem 9 <| exMem 11 <| exMem 12 <| - .conj (orderedTripleFormula 10 9 8 7) <| - .conj (pairMembershipFormula 6 5 16) <| - .conj (pairMembershipFormula 6 4 17) <| - .conj (pairMembershipFormula 6 3 18) <| - .conj (pairMembershipFormula 2 9 4) <| - .conj (pairMembershipFormula 1 8 3) <| - .conj (pairMembershipFormula 0 7 3) (tripleMembershipFormula 2 1 0 5) - -theorem truth_indexedMixedBinaryLiftEntryFormula (env : Fin 12 → ZFSet.{u}) : - Truth indexedMixedBinaryLiftEntryFormula env ↔ - ∃ g ∈ env 4, ∃ p ∈ env 5, ∃ q ∈ env 5, ∃ i ∈ env 1, - ∃ a ∈ env 9, ∃ eG ∈ env 10, ∃ eP ∈ env 11, - ∃ u ∈ env 2, ∃ x ∈ env 3, ∃ y ∈ env 3, - env 0 = ZFSet.pair (ZFSet.pair g p) q ∧ - ZFSet.pair i a ∈ env 6 ∧ ZFSet.pair i eG ∈ env 7 ∧ ZFSet.pair i eP ∈ env 8 ∧ - ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧ - ZFSet.pair (ZFSet.pair u x) y ∈ a := by - simp only [indexedMixedBinaryLiftEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem indexedMixedBinaryLift_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T UG UP G P A JG JP : ZFSet.{u}} (hT : T ∈ M.sets) (hUG : UG ∈ M.sets) - (hUP : UP ∈ M.sets) (hG : G ∈ M.sets) (hP : P ∈ M.sets) - (hA : A ∈ M.sets) (hJG : JG ∈ M.sets) (hJP : JP ∈ M.sets) : - indexedMixedBinaryLift T UG UP G P A JG JP ∈ M.sets := by - have hBA := M.union_mem unions (M.union_mem unions hA) - have hBJG := M.union_mem unions (M.union_mem unions hJG) - have hBJP := M.union_mem unions (M.union_mem unions hJP) - let params := extend T (extend UG (extend UP (extend G (extend P (extend A (extend JG - (extend JP (extend A.sUnion.sUnion (extend JG.sUnion.sUnion - (extend JP.sUnion.sUnion Fin.elim0)))))))))) - have selected := M.bounded_separation_mem separation BoundedFormula.indexedMixedBinaryLiftEntryFormula - params (Fin.cases hT (Fin.cases hUG (Fin.cases hUP (Fin.cases hG (Fin.cases hP - (Fin.cases hA (Fin.cases hJG (Fin.cases hJP (Fin.cases hBA (Fin.cases hBJG - (Fin.cases hBJP (fun i => Fin.elim0 i)))))))))))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hG hP) hP) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedMixedBinaryLiftEntryFormula - (extend z params)) (ZFSet.prod (ZFSet.prod G P) P) = indexedMixedBinaryLift T UG UP G P A JG JP := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedMixedBinaryLift, ZFSet.mem_sep, - BoundedFormula.truth_indexedMixedBinaryLiftEntryFormula] - rfl - exact equal ▸ selected - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.IndexedMixedOperationLiftCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u +namespace BoundedFormula +open SetFormula + +def indexedMixedBinaryLiftEntryFormula : BoundedFormula 12 := + exMem 4 <| exMem 6 <| exMem 7 <| exMem 4 <| exMem 13 <| + exMem 15 <| exMem 17 <| exMem 9 <| exMem 11 <| exMem 12 <| + .conj (orderedTripleFormula 10 9 8 7) <| + .conj (pairMembershipFormula 6 5 16) <| + .conj (pairMembershipFormula 6 4 17) <| + .conj (pairMembershipFormula 6 3 18) <| + .conj (pairMembershipFormula 2 9 4) <| + .conj (pairMembershipFormula 1 8 3) <| + .conj (pairMembershipFormula 0 7 3) (tripleMembershipFormula 2 1 0 5) + +theorem truth_indexedMixedBinaryLiftEntryFormula (env : Fin 12 → ZFSet.{u}) : + Truth indexedMixedBinaryLiftEntryFormula env ↔ + ∃ g ∈ env 4, ∃ p ∈ env 5, ∃ q ∈ env 5, ∃ i ∈ env 1, + ∃ a ∈ env 9, ∃ eG ∈ env 10, ∃ eP ∈ env 11, + ∃ u ∈ env 2, ∃ x ∈ env 3, ∃ y ∈ env 3, + env 0 = ZFSet.pair (ZFSet.pair g p) q ∧ + ZFSet.pair i a ∈ env 6 ∧ ZFSet.pair i eG ∈ env 7 ∧ ZFSet.pair i eP ∈ env 8 ∧ + ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧ + ZFSet.pair (ZFSet.pair u x) y ∈ a := by + simp only [indexedMixedBinaryLiftEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem indexedMixedBinaryLift_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T UG UP G P A JG JP : ZFSet.{u}} (hT : T ∈ M.sets) (hUG : UG ∈ M.sets) + (hUP : UP ∈ M.sets) (hG : G ∈ M.sets) (hP : P ∈ M.sets) + (hA : A ∈ M.sets) (hJG : JG ∈ M.sets) (hJP : JP ∈ M.sets) : + indexedMixedBinaryLift T UG UP G P A JG JP ∈ M.sets := by + have hBA := M.union_mem unions (M.union_mem unions hA) + have hBJG := M.union_mem unions (M.union_mem unions hJG) + have hBJP := M.union_mem unions (M.union_mem unions hJP) + let params := extend T (extend UG (extend UP (extend G (extend P (extend A (extend JG + (extend JP (extend A.sUnion.sUnion (extend JG.sUnion.sUnion + (extend JP.sUnion.sUnion Fin.elim0)))))))))) + have selected := M.bounded_separation_mem separation BoundedFormula.indexedMixedBinaryLiftEntryFormula + params (Fin.cases hT (Fin.cases hUG (Fin.cases hUP (Fin.cases hG (Fin.cases hP + (Fin.cases hA (Fin.cases hJG (Fin.cases hJP (Fin.cases hBA (Fin.cases hBJG + (Fin.cases hBJP (fun i => Fin.elim0 i)))))))))))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hG hP) hP) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedMixedBinaryLiftEntryFormula + (extend z params)) (ZFSet.prod (ZFSet.prod G P) P) = indexedMixedBinaryLift T UG UP G P A JG JP := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedMixedBinaryLift, ZFSet.mem_sep, + BoundedFormula.truth_indexedMixedBinaryLiftEntryFormula] + rfl + exact equal ▸ selected + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedOperationLifts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedOperationLifts.lean index e35c8a52c9e11b904c8aab6598e239a7f532507c..9c97dae99b327061c65fba5210f080f108fe83dc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedOperationLifts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedOperationLifts.lean @@ -1,116 +1,116 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.IndexedOperationLiftCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u -namespace BoundedFormula -open SetFormula - -def indexedRelationLiftEntryFormula : BoundedFormula 8 := - exMem 3 (exMem 4 (exMem 3 (exMem 9 (exMem 11 (exMem 7 (exMem 8 - (.conj (orderedPairFormula 7 6 5) - (.conj (pairMembershipFormula 4 3 11) - (.conj (pairMembershipFormula 4 2 12) - (.conj (pairMembershipFormula 1 6 2) - (.conj (pairMembershipFormula 0 5 2) - (pairMembershipFormula 1 0 3)))))))))))) - -theorem truth_indexedRelationLiftEntryFormula (env : Fin 8 → ZFSet.{u}) : - Truth indexedRelationLiftEntryFormula env ↔ - ∃ p ∈ env 3, ∃ q ∈ env 3, ∃ i ∈ env 1, - ∃ r ∈ env 6, ∃ e ∈ env 7, ∃ x ∈ env 2, ∃ y ∈ env 2, - env 0 = ZFSet.pair p q ∧ ZFSet.pair i r ∈ env 4 ∧ - ZFSet.pair i e ∈ env 5 ∧ ZFSet.pair x p ∈ e ∧ - ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r := by - simp only [indexedRelationLiftEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl - -def indexedBinaryLiftEntryFormula : BoundedFormula 8 := - exMem 3 (exMem 4 (exMem 5 (exMem 4 (exMem 10 (exMem 12 (exMem 8 (exMem 9 (exMem 10 - (.conj (orderedTripleFormula 9 8 7 6) - (.conj (pairMembershipFormula 5 4 13) - (.conj (pairMembershipFormula 5 3 14) - (.conj (pairMembershipFormula 2 8 3) - (.conj (pairMembershipFormula 1 7 3) - (.conj (pairMembershipFormula 0 6 3) - (tripleMembershipFormula 2 1 0 4))))))))))))))) - -theorem truth_indexedBinaryLiftEntryFormula (env : Fin 8 → ZFSet.{u}) : - Truth indexedBinaryLiftEntryFormula env ↔ - ∃ p ∈ env 3, ∃ q ∈ env 3, ∃ v ∈ env 3, ∃ i ∈ env 1, - ∃ b ∈ env 6, ∃ e ∈ env 7, ∃ x ∈ env 2, ∃ y ∈ env 2, ∃ z ∈ env 2, - env 0 = ZFSet.pair (ZFSet.pair p q) v ∧ ZFSet.pair i b ∈ env 4 ∧ - ZFSet.pair i e ∈ env 5 ∧ ZFSet.pair x p ∈ e ∧ - ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧ - ZFSet.pair (ZFSet.pair x y) z ∈ b := by - simp only [indexedBinaryLiftEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -open SetFormula -open scoped ZFSet -variable (M : TransitiveGround.{u}) - -theorem indexedRelationLift_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T U Q R J : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) - (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) (hJ : J ∈ M.sets) : - indexedRelationLift T U Q R J ∈ M.sets := by - have hBR := M.union_mem unions (M.union_mem unions hR) - have hBJ := M.union_mem unions (M.union_mem unions hJ) - let params := extend T (extend U (extend Q (extend R (extend J - (extend (⋃₀ ⋃₀ R) (extend (⋃₀ ⋃₀ J) Fin.elim0)))))) - have selected := M.bounded_separation_mem separation BoundedFormula.indexedRelationLiftEntryFormula - params (Fin.cases hT (Fin.cases hU (Fin.cases hQ (Fin.cases hR (Fin.cases hJ - (Fin.cases hBR (Fin.cases hBJ (fun i => Fin.elim0 i)))))))) - (M.prod_mem pairing unions powers separation hQ hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedRelationLiftEntryFormula - (extend z params)) (ZFSet.prod Q Q) = indexedRelationLift T U Q R J := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedRelationLift, ZFSet.mem_sep, - BoundedFormula.truth_indexedRelationLiftEntryFormula] - rfl - exact equal ▸ selected - -theorem indexedBinaryLift_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T U Q B J : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) - (hQ : Q ∈ M.sets) (hB : B ∈ M.sets) (hJ : J ∈ M.sets) : - indexedBinaryLift T U Q B J ∈ M.sets := by - have hBB := M.union_mem unions (M.union_mem unions hB) - have hBJ := M.union_mem unions (M.union_mem unions hJ) - let params := extend T (extend U (extend Q (extend B (extend J - (extend (⋃₀ ⋃₀ B) (extend (⋃₀ ⋃₀ J) Fin.elim0)))))) - have selected := M.bounded_separation_mem separation BoundedFormula.indexedBinaryLiftEntryFormula - params (Fin.cases hT (Fin.cases hU (Fin.cases hQ (Fin.cases hB (Fin.cases hJ - (Fin.cases hBB (Fin.cases hBJ (fun i => Fin.elim0 i)))))))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hQ hQ) hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedBinaryLiftEntryFormula - (extend z params)) (ZFSet.prod (ZFSet.prod Q Q) Q) = indexedBinaryLift T U Q B J := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedBinaryLift, ZFSet.mem_sep, - BoundedFormula.truth_indexedBinaryLiftEntryFormula] - rfl - exact equal ▸ selected - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.IndexedOperationLiftCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u +namespace BoundedFormula +open SetFormula + +def indexedRelationLiftEntryFormula : BoundedFormula 8 := + exMem 3 (exMem 4 (exMem 3 (exMem 9 (exMem 11 (exMem 7 (exMem 8 + (.conj (orderedPairFormula 7 6 5) + (.conj (pairMembershipFormula 4 3 11) + (.conj (pairMembershipFormula 4 2 12) + (.conj (pairMembershipFormula 1 6 2) + (.conj (pairMembershipFormula 0 5 2) + (pairMembershipFormula 1 0 3)))))))))))) + +theorem truth_indexedRelationLiftEntryFormula (env : Fin 8 → ZFSet.{u}) : + Truth indexedRelationLiftEntryFormula env ↔ + ∃ p ∈ env 3, ∃ q ∈ env 3, ∃ i ∈ env 1, + ∃ r ∈ env 6, ∃ e ∈ env 7, ∃ x ∈ env 2, ∃ y ∈ env 2, + env 0 = ZFSet.pair p q ∧ ZFSet.pair i r ∈ env 4 ∧ + ZFSet.pair i e ∈ env 5 ∧ ZFSet.pair x p ∈ e ∧ + ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r := by + simp only [indexedRelationLiftEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl + +def indexedBinaryLiftEntryFormula : BoundedFormula 8 := + exMem 3 (exMem 4 (exMem 5 (exMem 4 (exMem 10 (exMem 12 (exMem 8 (exMem 9 (exMem 10 + (.conj (orderedTripleFormula 9 8 7 6) + (.conj (pairMembershipFormula 5 4 13) + (.conj (pairMembershipFormula 5 3 14) + (.conj (pairMembershipFormula 2 8 3) + (.conj (pairMembershipFormula 1 7 3) + (.conj (pairMembershipFormula 0 6 3) + (tripleMembershipFormula 2 1 0 4))))))))))))))) + +theorem truth_indexedBinaryLiftEntryFormula (env : Fin 8 → ZFSet.{u}) : + Truth indexedBinaryLiftEntryFormula env ↔ + ∃ p ∈ env 3, ∃ q ∈ env 3, ∃ v ∈ env 3, ∃ i ∈ env 1, + ∃ b ∈ env 6, ∃ e ∈ env 7, ∃ x ∈ env 2, ∃ y ∈ env 2, ∃ z ∈ env 2, + env 0 = ZFSet.pair (ZFSet.pair p q) v ∧ ZFSet.pair i b ∈ env 4 ∧ + ZFSet.pair i e ∈ env 5 ∧ ZFSet.pair x p ∈ e ∧ + ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧ + ZFSet.pair (ZFSet.pair x y) z ∈ b := by + simp only [indexedBinaryLiftEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +open SetFormula +open scoped ZFSet +variable (M : TransitiveGround.{u}) + +theorem indexedRelationLift_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T U Q R J : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) + (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) (hJ : J ∈ M.sets) : + indexedRelationLift T U Q R J ∈ M.sets := by + have hBR := M.union_mem unions (M.union_mem unions hR) + have hBJ := M.union_mem unions (M.union_mem unions hJ) + let params := extend T (extend U (extend Q (extend R (extend J + (extend (⋃₀ ⋃₀ R) (extend (⋃₀ ⋃₀ J) Fin.elim0)))))) + have selected := M.bounded_separation_mem separation BoundedFormula.indexedRelationLiftEntryFormula + params (Fin.cases hT (Fin.cases hU (Fin.cases hQ (Fin.cases hR (Fin.cases hJ + (Fin.cases hBR (Fin.cases hBJ (fun i => Fin.elim0 i)))))))) + (M.prod_mem pairing unions powers separation hQ hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedRelationLiftEntryFormula + (extend z params)) (ZFSet.prod Q Q) = indexedRelationLift T U Q R J := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedRelationLift, ZFSet.mem_sep, + BoundedFormula.truth_indexedRelationLiftEntryFormula] + rfl + exact equal ▸ selected + +theorem indexedBinaryLift_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T U Q B J : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) + (hQ : Q ∈ M.sets) (hB : B ∈ M.sets) (hJ : J ∈ M.sets) : + indexedBinaryLift T U Q B J ∈ M.sets := by + have hBB := M.union_mem unions (M.union_mem unions hB) + have hBJ := M.union_mem unions (M.union_mem unions hJ) + let params := extend T (extend U (extend Q (extend B (extend J + (extend (⋃₀ ⋃₀ B) (extend (⋃₀ ⋃₀ J) Fin.elim0)))))) + have selected := M.bounded_separation_mem separation BoundedFormula.indexedBinaryLiftEntryFormula + params (Fin.cases hT (Fin.cases hU (Fin.cases hQ (Fin.cases hB (Fin.cases hJ + (Fin.cases hBB (Fin.cases hBJ (fun i => Fin.elim0 i)))))))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hQ hQ) hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedBinaryLiftEntryFormula + (extend z params)) (ZFSet.prod (ZFSet.prod Q Q) Q) = indexedBinaryLift T U Q B J := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedBinaryLift, ZFSet.mem_sep, + BoundedFormula.truth_indexedBinaryLiftEntryFormula] + rfl + exact equal ▸ selected + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedSubstructures.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedSubstructures.lean index 498512e12eef722e1d88cd9bd45fb8024b848a4a..1f200b61cf8148e812e9ddd5ee2a023bd87d1d60 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedSubstructures.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedSubstructures.lean @@ -1,52 +1,52 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IndexedSubstructureCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {I B R domains : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) -variable (hR : R ∈ M.sets) (hDomains : domains ∈ M.sets) -include pairing unions powers separation hI hB hR hDomains - -theorem indexedSuborderGraph_mem : indexedSuborderGraph I B R domains ∈ M.sets := by - let params := extend I (extend B (extend R (extend domains Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedSuborderEntryFormula 0 1 2 3 4) params - (Fin.cases hI (Fin.cases hB (Fin.cases hR (Fin.cases hDomains (fun j => Fin.elim0 j))))) - (M.prod_mem pairing unions powers separation hI hR) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedSuborderEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod I R) = indexedSuborderGraph I B R domains := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_indexedSuborderEntryFormula] - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact equal ▸ selected - -theorem indexedSubmeetGraph_mem : indexedSubmeetGraph I B R domains ∈ M.sets := by - let params := extend I (extend B (extend R (extend domains Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedSubmeetEntryFormula 0 1 2 3 4) params - (Fin.cases hI (Fin.cases hB (Fin.cases hR (Fin.cases hDomains (fun j => Fin.elim0 j))))) - (M.prod_mem pairing unions powers separation hI hR) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedSubmeetEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod I R) = indexedSubmeetGraph I B R domains := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_indexedSubmeetEntryFormula] - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IndexedSubstructureCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {I B R domains : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) +variable (hR : R ∈ M.sets) (hDomains : domains ∈ M.sets) +include pairing unions powers separation hI hB hR hDomains + +theorem indexedSuborderGraph_mem : indexedSuborderGraph I B R domains ∈ M.sets := by + let params := extend I (extend B (extend R (extend domains Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedSuborderEntryFormula 0 1 2 3 4) params + (Fin.cases hI (Fin.cases hB (Fin.cases hR (Fin.cases hDomains (fun j => Fin.elim0 j))))) + (M.prod_mem pairing unions powers separation hI hR) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedSuborderEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod I R) = indexedSuborderGraph I B R domains := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_indexedSuborderEntryFormula] + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact equal ▸ selected + +theorem indexedSubmeetGraph_mem : indexedSubmeetGraph I B R domains ∈ M.sets := by + let params := extend I (extend B (extend R (extend domains Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedSubmeetEntryFormula 0 1 2 3 4) params + (Fin.cases hI (Fin.cases hB (Fin.cases hR (Fin.cases hDomains (fun j => Fin.elim0 j))))) + (M.prod_mem pairing unions powers separation hI hR) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedSubmeetEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod I R) = indexedSubmeetGraph I B R domains := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_indexedSubmeetEntryFormula] + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedValueLifts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedValueLifts.lean index 4099dc35d1f94e7ec9ad96d0f1de8d57b48dc61e..c00628c71c2f20ceea104a95a649237be3f09171 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedValueLifts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIndexedValueLifts.lean @@ -1,50 +1,50 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IndexedValueLiftCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem indexedValueLift_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T U Q V F J : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) - (hQ : Q ∈ M.sets) (hV : V ∈ M.sets) (hF : F ∈ M.sets) (hJ : J ∈ M.sets) : - indexedValueLift T U Q V F J ∈ M.sets := by - have hBF := M.union_mem unions (M.union_mem unions hF) - have hBJ := M.union_mem unions (M.union_mem unions hJ) - let params := extend T (extend U (extend Q (extend V (extend F (extend J - (extend (ZFSet.sUnion (ZFSet.sUnion F)) - (extend (ZFSet.sUnion (ZFSet.sUnion J)) Fin.elim0))))))) - have selected := M.bounded_separation_mem separation BoundedFormula.indexedValueLiftEntryFormula params - (Fin.cases hT (Fin.cases hU (Fin.cases hQ (Fin.cases hV (Fin.cases hF - (Fin.cases hJ (Fin.cases hBF (Fin.cases hBJ (fun i => Fin.elim0 i))))))))) - (M.prod_mem pairing unions powers separation hQ hV) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedValueLiftEntryFormula - (extend z params)) (ZFSet.prod Q V) = indexedValueLift T U Q V F J := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedValueLift, ZFSet.mem_sep, - BoundedFormula.truth_indexedValueLiftEntryFormula] - rfl - exact equal ▸ selected - -end TransitiveGround - -theorem indexedValueLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (T U F J : ZFSet.{u}) {Q V : ZFSet.{u}} - (hq : ZFSet.rank Q < o) (hv : ZFSet.rank V < o) : - ZFSet.rank (indexedValueLift T U Q V F J) < o := - (ZFSet.rank_mono (indexedValueLift_subset T U Q V F J)).trans_lt (rank_product_lt limit hq hv) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IndexedValueLiftCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem indexedValueLift_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T U Q V F J : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) + (hQ : Q ∈ M.sets) (hV : V ∈ M.sets) (hF : F ∈ M.sets) (hJ : J ∈ M.sets) : + indexedValueLift T U Q V F J ∈ M.sets := by + have hBF := M.union_mem unions (M.union_mem unions hF) + have hBJ := M.union_mem unions (M.union_mem unions hJ) + let params := extend T (extend U (extend Q (extend V (extend F (extend J + (extend (ZFSet.sUnion (ZFSet.sUnion F)) + (extend (ZFSet.sUnion (ZFSet.sUnion J)) Fin.elim0))))))) + have selected := M.bounded_separation_mem separation BoundedFormula.indexedValueLiftEntryFormula params + (Fin.cases hT (Fin.cases hU (Fin.cases hQ (Fin.cases hV (Fin.cases hF + (Fin.cases hJ (Fin.cases hBF (Fin.cases hBJ (fun i => Fin.elim0 i))))))))) + (M.prod_mem pairing unions powers separation hQ hV) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.indexedValueLiftEntryFormula + (extend z params)) (ZFSet.prod Q V) = indexedValueLift T U Q V F J := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedValueLift, ZFSet.mem_sep, + BoundedFormula.truth_indexedValueLiftEntryFormula] + rfl + exact equal ▸ selected + +end TransitiveGround + +theorem indexedValueLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (T U F J : ZFSet.{u}) {Q V : ZFSet.{u}} + (hq : ZFSet.rank Q < o) (hv : ZFSet.rank V < o) : + ZFSet.rank (indexedValueLift T U Q V F J) < o := + (ZFSet.rank_mono (indexedValueLift_subset T U Q V F J)).trans_lt (rank_product_lt limit hq hv) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompletedCompressionCertificates.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompletedCompressionCertificates.lean index b84a2301a87c16410ff6716bffca2f13d4f68fd4..fd12b24f3c806bebfd56a17f69ccd354a1e6bfe4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompletedCompressionCertificates.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompletedCompressionCertificates.lean @@ -1,563 +1,563 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionCompletion -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRecognizedInitialOrigin -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCanonicalCompressionHistory -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainStageTaskCodes - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula - -def historyFieldUnionElementFormula {n} (x N history : Fin n) (j : Fin 13) : SetFormula n := - ex (.conj (.mem 0 N.succ) - (ex (.conj (historyFieldValueFormula 1 0 history.succ.succ j) - (.mem x.succ.succ 0)))) - -def historyFieldUnionFormula {n} (output N history : Fin n) (j : Fin 13) : SetFormula n := - exactSetFormula output (historyFieldUnionElementFormula 0 N.succ history.succ j) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_historyFieldUnionElementFormula {k} (x N history : Fin k) (j : Fin 13) - (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (states : Nat → RecursiveStateData.{u}) (naturals : env N = ZFSet.omega) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) : - Realize M.sets (historyFieldUnionElementFormula x N history j) env ↔ - ∃ n, env x ∈ (states n).field j := by - rw [historyFieldUnionElementFormula, realize_ex] - simp only [Realize, realize_ex] - constructor - · rintro ⟨index, hIndex, indexMember, value, hValue, specified, member⟩ - change index ∈ env N at indexMember - rw [naturals] at indexMember - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode index).1 indexMember - have bounds : ∀ i, extend value (extend (natSetCode n) env) i ∈ M.sets := - Fin.cases hValue (Fin.cases hIndex members) - have equal := (M.realize_historyFieldValueFormula 1 0 history.succ.succ j - (extend value (extend (natSetCode n) env)) bounds states entries n rfl).1 specified - change env x ∈ value at member - exact ⟨n, equal ▸ member⟩ - · rintro ⟨n, member⟩ - have hIndex : natSetCode n ∈ M.sets := - M.transitive (naturals ▸ members N) (natSetCode_mem_omega n) - have hCode := M.pair_right (M.transitive (members history) ((entries n _).2 rfl)) - have hValue := M.recursiveStateData_field_mem (states n) hCode j - have bounds : ∀ i, extend ((states n).field j) (extend (natSetCode n) env) i ∈ M.sets := - Fin.cases hValue (Fin.cases hIndex members) - refine ⟨natSetCode n, hIndex, ?_, (states n).field j, hValue, ?_, member⟩ - · change natSetCode n ∈ env N - exact naturals.symm ▸ natSetCode_mem_omega n - · exact (M.realize_historyFieldValueFormula 1 0 history.succ.succ j - (extend ((states n).field j) (extend (natSetCode n) env)) bounds - states entries n rfl).2 rfl - -theorem realize_historyFieldUnionFormula {k} (output N history : Fin k) (j : Fin 13) - (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (states : Nat → RecursiveStateData.{u}) (naturals : env N = ZFSet.omega) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) - {target : ZFSet.{u}} (unionCode : NatUnionCode (fun n => (states n).field j) target) : - Realize M.sets (historyFieldUnionFormula output N history j) env ↔ env output = target := by - apply M.realize_exactSetFormula output _ env (members output) - · intro z hz - obtain ⟨n, member⟩ := (unionCode z).1 hz - have hCode := M.pair_right (M.transitive (members history) ((entries n _).2 rfl)) - exact M.transitive (M.recursiveStateData_field_mem (states n) hCode j) member - · intro z hz - exact (M.realize_historyFieldUnionElementFormula 0 N.succ history.succ j - (extend z env) (Fin.cases hz members) states naturals entries).trans (unionCode z).symm - -end TransitiveGround - -namespace GroundCompressionUnionData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T : ZFSet.{u}} -variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - -theorem realize_canonicalFieldUnionFormula {k} (output N history : Fin k) (j : Fin 13) - (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (naturals : env N = ZFSet.omega) - (canonical : env history = initial.canonicalHistory M I Sources Reps G T) : - Realize M.sets (historyFieldUnionFormula output N history j) env ↔ - env output = data.fields j := by - apply M.realize_historyFieldUnionFormula output N history j env members - (initial.iterate M I Sources Reps G T) naturals _ (data.fieldUnion j) - intro n y - rw [canonical] - exact initial.pair_mem_canonicalHistory M I Sources Reps G T n y - -end GroundCompressionUnionData - - - - -namespace SetFormula - -def historyFieldUnionTupleFormula {n} (output N history : Fin n) : SetFormula n := - exBlock 13 (.conj - (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 output) (prefixIndex n 13)).toFormula - (conjBlock 13 (fun j => historyFieldUnionFormula (prefixIndex n 13 j) - (suffixIndex n 13 N) (suffixIndex n 13 history) j))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_historyFieldUnionTupleFormula {k} (output N history : Fin k) - (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (states : Nat → RecursiveStateData.{u}) (naturals : env N = ZFSet.omega) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) - (fields : Fin 13 → ZFSet.{u}) - (unions : ∀ j, NatUnionCode (fun n => (states n).field j) (fields j)) : - Realize M.sets (historyFieldUnionTupleFormula output N history) env ↔ - env output = nonemptyTupleCode 12 fields := by - rw [historyFieldUnionTupleFormula, realize_exBlock] - constructor - · rintro ⟨stored, storedMembers, tuple, clauses⟩ - have bounds := extendMany_members 13 stored env storedMembers members - have tupleEq := (BoundedFormula.truth_nonemptyTupleFormula 12 - (suffixIndex k 13 output) (prefixIndex k 13) _).1 - ((BoundedFormula.realize_toFormula M _ _ bounds).1 tuple) - have each := (realize_conjBlock M.sets 13 _ _).1 clauses - have fieldsEq : stored = fields := by - funext j - have equal := (M.realize_historyFieldUnionFormula - (prefixIndex k 13 j) (suffixIndex k 13 N) (suffixIndex k 13 history) j - _ bounds states (by simpa only [extendMany_suffix] using naturals) - (by simpa only [extendMany_suffix] using entries) (unions j)).1 (each j) - simpa only [extendMany_prefix] using equal - simp only [extendMany_prefix, extendMany_suffix] at tupleEq - exact tupleEq.trans (congrArg (nonemptyTupleCode 12) fieldsEq) - · intro equal - have fieldMembers := M.nonemptyTupleCode_field_mem 12 fields (equal ▸ members output) - have bounds := extendMany_members 13 fields env fieldMembers members - refine ⟨fields, fieldMembers, ?_, ?_⟩ - · apply (BoundedFormula.realize_toFormula M _ _ bounds).2 - apply (BoundedFormula.truth_nonemptyTupleFormula 12 - (suffixIndex k 13 output) (prefixIndex k 13) _).2 - simpa only [extendMany_prefix, extendMany_suffix] using equal - · apply (realize_conjBlock M.sets 13 _ _).2 - intro j - apply (M.realize_historyFieldUnionFormula - (prefixIndex k 13 j) (suffixIndex k 13 N) (suffixIndex k 13 history) j - _ bounds states (by simpa only [extendMany_suffix] using naturals) - (by simpa only [extendMany_suffix] using entries) (unions j)).2 - exact extendMany_prefix 13 fields env j - -end TransitiveGround - -namespace GroundCompressionUnionData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T : ZFSet.{u}} -variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - -noncomputable def code : ZFSet.{u} := nonemptyTupleCode 12 data.fields - -theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - data.code ∈ M.sets := M.nonemptyTupleCode_mem pairing 12 data.fields data.ground - -theorem realize_canonicalUnionTupleFormula {k} (output N history : Fin k) - (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (naturals : env N = ZFSet.omega) - (canonical : env history = initial.canonicalHistory M I Sources Reps G T) : - Realize M.sets (historyFieldUnionTupleFormula output N history) env ↔ - env output = data.code := by - apply M.realize_historyFieldUnionTupleFormula output N history env members - (initial.iterate M I Sources Reps G T) naturals _ data.fields data.fieldUnion - intro n y - rw [canonical] - exact initial.pair_mem_canonicalHistory M I Sources Reps G T n y - -end GroundCompressionUnionData - - - - -structure GroundInitialCompressionCertificate {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} - (stage : GroundMainStage M C D rD) (Labels : ZFSet.{u}) where - Reps : ZFSet.{u} - representatives_ground : Reps ∈ M.sets - representatives : TaskRepresentativesCode Reps (stage.compressionTasks Labels) - stage.carrier stage.actors stage.order stage.action - (M.groundRelations stage.carrier stage.carrier) - (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels - origin : GroundCompressionOrigin M (stage.compressionInitial Labels) - stage.carrier stage.order stage.meetGraph stage.action stage.top - (stage.compressionTasks Labels) (stage.compressionSources Labels) Reps - stage.actors stage.multiplication stage.inverse stage.identity - (stage.compressionTaskAction Labels) (stage.compressionFilters Labels) - unionData : GroundCompressionUnionData M (stage.compressionInitial Labels) - (stage.compressionTasks Labels) (stage.compressionSources Labels) Reps - stage.actors stage.multiplication stage.identity (stage.compressionTaskAction Labels) - -namespace GroundInitialCompressionCertificate -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {stage : GroundMainStage M C D rD} -variable (certificate : GroundInitialCompressionCertificate stage Labels) - -noncomputable def history : ZFSet.{u} := - (stage.compressionInitial Labels).canonicalHistory M (stage.compressionTasks Labels) - (stage.compressionSources Labels) certificate.Reps stage.actors (stage.compressionTaskAction Labels) - -noncomputable def code : ZFSet.{u} := - nonemptyTupleCode 2 (Fin.cases certificate.Reps - (Fin.cases certificate.history (fun _ => certificate.unionData.code))) - -theorem history_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hLabels : Labels ∈ M.sets) : certificate.history ∈ M.sets := by - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have hT := M.groundTaskTransport_mem pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have ground := certificate.origin.state.canonicalHistory_mem pairing unions powers separation - collection infinite hI (fields 0).1 certificate.representatives_ground stage.actors_ground hT - simpa only [certificate.origin.initial_data, history] using ground - -theorem code_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hLabels : Labels ∈ M.sets) : certificate.code ∈ M.sets := - M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases certificate.representatives_ground - (Fin.cases (certificate.history_ground pairing unions powers separation collection infinite hLabels) - (fun _ => certificate.unionData.code_ground pairing))) - -end GroundInitialCompressionCertificate - -namespace GroundMainStage -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -include pairing unions powers separation collection infinite - -theorem compressionCertificate_of_representatives {Labels Reps : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hReps : Reps ∈ M.sets) - (represented : TaskRepresentativesCode Reps (stage.compressionTasks Labels) - stage.carrier stage.actors stage.order stage.action - (M.groundRelations stage.carrier stage.carrier) - (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels) : - ∃ certificate : GroundInitialCompressionCertificate stage Labels, certificate.Reps = Reps := by - obtain ⟨origin⟩ := M.initialCompressionOrigin_of_representatives pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground stage.action_ground - hLabels stage.group_code stage.action_code stage.meet stage.top_mem stage.greatest - represented.1 represented.2 - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have hT := M.groundTaskTransport_mem pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - obtain ⟨data⟩ := origin.state.exists_groundUnion pairing unions powers separation collection infinite - hI (fields 0).1 hReps stage.actors_ground hT - have data' : GroundCompressionUnionData M (stage.compressionInitial Labels) - (stage.compressionTasks Labels) (stage.compressionSources Labels) Reps - stage.actors stage.multiplication stage.identity (stage.compressionTaskAction Labels) := by - rw [origin.initial_data] at data - exact data - exact ⟨⟨Reps, hReps, represented, origin, data'⟩, rfl⟩ - -theorem exists_compressionCertificate - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Labels : ZFSet.{u}} (hLabels : Labels ∈ M.sets) : - Nonempty (GroundInitialCompressionCertificate stage Labels) := by - obtain ⟨Reps, hReps, function, represented, _⟩ := M.exists_groundTaskRepresentatives - pairing unions powers separation choice stage.carrier_ground stage.actors_ground - stage.order_ground stage.meet_ground stage.action_ground hLabels stage.meet - obtain ⟨certificate, _⟩ := stage.compressionCertificate_of_representatives - pairing unions powers separation collection infinite hLabels hReps ⟨function, represented⟩ - exact ⟨certificate⟩ - -end GroundMainStage - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundInitialCompressionCertificate -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {stage : GroundMainStage M C D rD} -variable (certificate : GroundInitialCompressionCertificate stage Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (hLabels : Labels ∈ M.sets) -include pairing unions powers separation collection infinite hLabels - -theorem realize_history_iff {H : ZFSet.{u}} (hH : H ∈ M.sets) : - Realize M.sets (M.compressionHistoryFormula pairing unions powers separation) - (extend ZFSet.omega (extend H (extend (stage.compressionInitial Labels).code - (extend (stage.compressionTasks Labels) (extend (stage.compressionSources Labels) - (extend certificate.Reps (extend stage.actors - (extend (stage.compressionTaskAction Labels) Fin.elim0)))))))) ↔ - H = certificate.history := by - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have hT := M.groundTaskTransport_mem pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have recognized := certificate.origin.state.realize_compressionHistory_iff - pairing unions powers separation collection infinite hI (fields 0).1 - certificate.representatives_ground stage.actors_ground hT hH - simpa only [certificate.origin.initial_data, history] using recognized - -omit pairing unions powers collection hLabels in -theorem realize_union_iff {U H : ZFSet.{u}} (hU : U ∈ M.sets) (hH : H ∈ M.sets) - (canonical : H = certificate.history) : - Realize M.sets (historyFieldUnionTupleFormula 0 1 2) - (extend U (extend ZFSet.omega (extend H Fin.elim0))) ↔ U = certificate.unionData.code := by - exact certificate.unionData.realize_canonicalUnionTupleFormula 0 1 2 - (extend U (extend ZFSet.omega (extend H Fin.elim0))) - (Fin.cases hU (Fin.cases (M.omega_mem separation infinite) - (Fin.cases hH (fun i => Fin.elim0 i)))) rfl canonical - -end PartitionPilot.Forcing.GroundInitialCompressionCertificate - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} -variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) - -theorem initial_union_range_accounting - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - (initialIndices : I = M.groundEligibleTasks P G r μ A Labels) - (initialSources : Sources = literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : - CompressionRangeAccounting P I (algebra.union.fields 0) - (algebra.union.fields 1) (algebra.union.fields 2) algebra.maps algebra.bases (algebra.caps τ) := by - have sourceLiteral {i a : ZFSet.{u}} (source : ZFSet.pair i a ∈ Sources) : - ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels := initialSources ▸ source - refine { - original_subset := state.union_original_subset algebra.union - base_filled := ?_ - old_shadow := ?_ - cap_separation := ?_ - fresh_accounting := ?_ - } - · intro i hi f b indexed based x hx below - obtain ⟨a, source, _⟩ := seed.sources.2 i hi - obtain ⟨g, representative, _⟩ := state.inputs.representatives.2 i hi - exact state.union_map_base_filling algebra pairing unions powers separation hI hSources hReps hG hT - indexed source representative ((state.union_base_entry_iff algebra indexed source).1 based) hx below - · intro i hi b k based capped x hx below - obtain ⟨f, indexed⟩ := algebra.function.total hi - obtain ⟨a, source, _⟩ := seed.sources.2 i hi - exact state.union_initial_old_shadow algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData indexed (sourceLiteral source) - ((state.union_cap_entry_iff algebra indexed).1 capped) - ((state.union_base_entry_iff algebra indexed source).1 based) hx below - · intro i hi j hj different b c k l basedI basedJ cappedI cappedJ - obtain ⟨f, indexedI⟩ := algebra.function.total hi - obtain ⟨g, indexedJ⟩ := algebra.function.total hj - obtain ⟨a, sourceI, _⟩ := seed.sources.2 i hi - obtain ⟨d, sourceJ, _⟩ := seed.sources.2 j hj - exact state.union_initial_cap_separation algebra pairing unions powers separation - hP hG hr hμ hA hLabels initialData indexedI indexedJ (sourceLiteral sourceI) (sourceLiteral sourceJ) - ((state.union_cap_entry_iff algebra indexedI).1 cappedI) - ((state.union_cap_entry_iff algebra indexedJ).1 cappedJ) - ((state.union_base_entry_iff algebra indexedI sourceI).1 basedI) - ((state.union_base_entry_iff algebra indexedJ sourceJ).1 basedJ) different - · have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by - simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top - have initialAccounting : FiniteCompressionAccounting P I Sources τ state.data := by - simpa only [initialData, initialIndices, initialSources] using - (M.initialCompressionData_accounting pairing unions powers separation - hP hG hr hμ hA hLabels state.inputs.group seed.originalAction seed.originalOrder seed.top_mem top) - intro x hx - rcases state.union_fresh_accounting algebra pairing unions powers separation - hI hSources hReps hG hT initialAccounting x hx with original | fresh - · exact Or.inl original - · obtain ⟨i, hi, f, a, k, b, y, hy, indexed, source, cap, base, image, below, outside⟩ := fresh - exact Or.inr ⟨i, hi, f, k, b, y, hy, indexed, - (state.union_cap_entry_iff algebra indexed).2 cap, - (state.union_base_entry_iff algebra indexed source).2 base, image, below, outside⟩ - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundInitialCompressionCertificate -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {stage : GroundMainStage M C D rD} -variable (certificate : GroundInitialCompressionCertificate stage Labels) - -abbrev Completion := GroundCompressionCompletion M (stage.compressionInitial Labels) - (stage.compressionTasks Labels) (stage.compressionSources Labels) certificate.Reps - stage.actors stage.multiplication stage.identity (stage.compressionTaskAction Labels) stage.top - -theorem completion_union (completion : certificate.Completion) : - completion.algebra.union = certificate.unionData := - completion.algebra.union.unique certificate.unionData - -theorem exists_completion - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hLabels : Labels ∈ M.sets) : - Nonempty certificate.Completion := by - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have hT := M.groundTaskTransport_mem pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - obtain ⟨algebra⟩ := certificate.origin.state.exists_groundAlgebra - pairing unions powers separation collection infinite hI (fields 0).1 - certificate.representatives_ground stage.actors_ground hT - have accounting := certificate.origin.state.initial_union_range_accounting algebra - pairing unions powers separation stage.carrier_ground stage.actors_ground - stage.order_ground stage.meet_ground stage.action_ground hLabels hI (fields 0).1 - certificate.representatives_ground hT certificate.origin.initial_data rfl rfl - obtain ⟨completion⟩ := certificate.origin.state.completion_of_accounting algebra - pairing unions powers separation hI (fields 0).1 certificate.representatives_ground - stage.actors_ground hT accounting - exact ⟨by simpa only [certificate.origin.initial_data] using completion⟩ - -theorem completion_profiles (completion : certificate.Completion) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hLabels : Labels ∈ M.sets) : - CodedCompressionProfiles (completion.algebra.union.fields 0) - (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) - (completion.algebra.caps stage.top) (stage.compressionTargets Labels) - (stage.compressionSeparators Labels) (stage.compressionFilters Labels) := by - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have hT := M.groundTaskTransport_mem pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have transfer (initial : RecursiveStateData.{u}) - (origin : GroundCompressionOrigin M initial stage.carrier stage.order stage.meetGraph - stage.action stage.top (stage.compressionTasks Labels) (stage.compressionSources Labels) - certificate.Reps stage.actors stage.multiplication stage.inverse stage.identity - (stage.compressionTaskAction Labels) (stage.compressionFilters Labels)) - (algebra : GroundCompressionAlgebra M initial (stage.compressionTasks Labels) - (stage.compressionSources Labels) certificate.Reps stage.actors stage.multiplication - stage.identity (stage.compressionTaskAction Labels)) - (initialData : initial = stage.compressionInitial Labels) : - CodedCompressionProfiles (algebra.union.fields 0) (algebra.union.fields 1) - (algebra.union.fields 2) (algebra.caps stage.top) (stage.compressionTargets Labels) - (stage.compressionSeparators Labels) (stage.compressionFilters Labels) := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - exact state.initial_union_profiles algebra pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels hI (fields 0).1 certificate.representatives_ground hT initialData rfl - exact transfer _ certificate.origin completion.algebra rfl - -theorem completion_original_data (completion : certificate.Completion) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hLabels : Labels ∈ M.sets) : - CompressionOriginalData stage.carrier stage.order stage.meetGraph stage.action stage.actors - (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 12) := by - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - have hT := M.groundTaskTransport_mem pairing unions powers separation - stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground - stage.action_ground hLabels stage.meet - exact certificate.origin.union_original_data completion.algebra.union - pairing unions powers separation hI (fields 0).1 certificate.representatives_ground - stage.actors_ground hT - -end PartitionPilot.Forcing.GroundInitialCompressionCertificate - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure GroundInitialCompletedCompressionCertificate - {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} - (stage : GroundMainStage M C D rD) (Labels : ZFSet.{u}) where - certificate : GroundInitialCompressionCertificate stage Labels - completion : certificate.Completion - -namespace GroundInitialCompletedCompressionCertificate -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {stage : GroundMainStage M C D rD} -variable (completed : GroundInitialCompletedCompressionCertificate stage Labels) - -noncomputable def code : ZFSet.{u} := nonemptyTupleCode 3 - (Fin.cases completed.certificate.code - (Fin.cases completed.completion.algebra.maps - (Fin.cases completed.completion.algebra.bases - (fun _ => completed.completion.algebra.caps stage.top)))) - -theorem code_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hLabels : Labels ∈ M.sets) : completed.code ∈ M.sets := - M.nonemptyTupleCode_mem pairing 3 _ - (Fin.cases (completed.certificate.code_ground pairing unions powers separation - collection infinite hLabels) (Fin.cases completed.completion.algebra.ground - (Fin.cases completed.completion.bases_ground (fun _ => completed.completion.caps_ground)))) - -end GroundInitialCompletedCompressionCertificate - -namespace GroundInitialCompressionCertificate -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {stage : GroundMainStage M C D rD} -variable (certificate : GroundInitialCompressionCertificate stage Labels) - -theorem exists_completedCertificate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hLabels : Labels ∈ M.sets) : - ∃ completed : GroundInitialCompletedCompressionCertificate stage Labels, - completed.certificate = certificate := by - obtain ⟨completion⟩ := certificate.exists_completion - pairing unions powers separation collection infinite hLabels - exact ⟨⟨certificate, completion⟩, rfl⟩ - -end GroundInitialCompressionCertificate - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionCompletion +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRecognizedInitialOrigin +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCanonicalCompressionHistory +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainStageTaskCodes + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula + +def historyFieldUnionElementFormula {n} (x N history : Fin n) (j : Fin 13) : SetFormula n := + ex (.conj (.mem 0 N.succ) + (ex (.conj (historyFieldValueFormula 1 0 history.succ.succ j) + (.mem x.succ.succ 0)))) + +def historyFieldUnionFormula {n} (output N history : Fin n) (j : Fin 13) : SetFormula n := + exactSetFormula output (historyFieldUnionElementFormula 0 N.succ history.succ j) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_historyFieldUnionElementFormula {k} (x N history : Fin k) (j : Fin 13) + (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (states : Nat → RecursiveStateData.{u}) (naturals : env N = ZFSet.omega) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) : + Realize M.sets (historyFieldUnionElementFormula x N history j) env ↔ + ∃ n, env x ∈ (states n).field j := by + rw [historyFieldUnionElementFormula, realize_ex] + simp only [Realize, realize_ex] + constructor + · rintro ⟨index, hIndex, indexMember, value, hValue, specified, member⟩ + change index ∈ env N at indexMember + rw [naturals] at indexMember + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode index).1 indexMember + have bounds : ∀ i, extend value (extend (natSetCode n) env) i ∈ M.sets := + Fin.cases hValue (Fin.cases hIndex members) + have equal := (M.realize_historyFieldValueFormula 1 0 history.succ.succ j + (extend value (extend (natSetCode n) env)) bounds states entries n rfl).1 specified + change env x ∈ value at member + exact ⟨n, equal ▸ member⟩ + · rintro ⟨n, member⟩ + have hIndex : natSetCode n ∈ M.sets := + M.transitive (naturals ▸ members N) (natSetCode_mem_omega n) + have hCode := M.pair_right (M.transitive (members history) ((entries n _).2 rfl)) + have hValue := M.recursiveStateData_field_mem (states n) hCode j + have bounds : ∀ i, extend ((states n).field j) (extend (natSetCode n) env) i ∈ M.sets := + Fin.cases hValue (Fin.cases hIndex members) + refine ⟨natSetCode n, hIndex, ?_, (states n).field j, hValue, ?_, member⟩ + · change natSetCode n ∈ env N + exact naturals.symm ▸ natSetCode_mem_omega n + · exact (M.realize_historyFieldValueFormula 1 0 history.succ.succ j + (extend ((states n).field j) (extend (natSetCode n) env)) bounds + states entries n rfl).2 rfl + +theorem realize_historyFieldUnionFormula {k} (output N history : Fin k) (j : Fin 13) + (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (states : Nat → RecursiveStateData.{u}) (naturals : env N = ZFSet.omega) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) + {target : ZFSet.{u}} (unionCode : NatUnionCode (fun n => (states n).field j) target) : + Realize M.sets (historyFieldUnionFormula output N history j) env ↔ env output = target := by + apply M.realize_exactSetFormula output _ env (members output) + · intro z hz + obtain ⟨n, member⟩ := (unionCode z).1 hz + have hCode := M.pair_right (M.transitive (members history) ((entries n _).2 rfl)) + exact M.transitive (M.recursiveStateData_field_mem (states n) hCode j) member + · intro z hz + exact (M.realize_historyFieldUnionElementFormula 0 N.succ history.succ j + (extend z env) (Fin.cases hz members) states naturals entries).trans (unionCode z).symm + +end TransitiveGround + +namespace GroundCompressionUnionData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T : ZFSet.{u}} +variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + +theorem realize_canonicalFieldUnionFormula {k} (output N history : Fin k) (j : Fin 13) + (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (naturals : env N = ZFSet.omega) + (canonical : env history = initial.canonicalHistory M I Sources Reps G T) : + Realize M.sets (historyFieldUnionFormula output N history j) env ↔ + env output = data.fields j := by + apply M.realize_historyFieldUnionFormula output N history j env members + (initial.iterate M I Sources Reps G T) naturals _ (data.fieldUnion j) + intro n y + rw [canonical] + exact initial.pair_mem_canonicalHistory M I Sources Reps G T n y + +end GroundCompressionUnionData + + + + +namespace SetFormula + +def historyFieldUnionTupleFormula {n} (output N history : Fin n) : SetFormula n := + exBlock 13 (.conj + (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 output) (prefixIndex n 13)).toFormula + (conjBlock 13 (fun j => historyFieldUnionFormula (prefixIndex n 13 j) + (suffixIndex n 13 N) (suffixIndex n 13 history) j))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_historyFieldUnionTupleFormula {k} (output N history : Fin k) + (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (states : Nat → RecursiveStateData.{u}) (naturals : env N = ZFSet.omega) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code) + (fields : Fin 13 → ZFSet.{u}) + (unions : ∀ j, NatUnionCode (fun n => (states n).field j) (fields j)) : + Realize M.sets (historyFieldUnionTupleFormula output N history) env ↔ + env output = nonemptyTupleCode 12 fields := by + rw [historyFieldUnionTupleFormula, realize_exBlock] + constructor + · rintro ⟨stored, storedMembers, tuple, clauses⟩ + have bounds := extendMany_members 13 stored env storedMembers members + have tupleEq := (BoundedFormula.truth_nonemptyTupleFormula 12 + (suffixIndex k 13 output) (prefixIndex k 13) _).1 + ((BoundedFormula.realize_toFormula M _ _ bounds).1 tuple) + have each := (realize_conjBlock M.sets 13 _ _).1 clauses + have fieldsEq : stored = fields := by + funext j + have equal := (M.realize_historyFieldUnionFormula + (prefixIndex k 13 j) (suffixIndex k 13 N) (suffixIndex k 13 history) j + _ bounds states (by simpa only [extendMany_suffix] using naturals) + (by simpa only [extendMany_suffix] using entries) (unions j)).1 (each j) + simpa only [extendMany_prefix] using equal + simp only [extendMany_prefix, extendMany_suffix] at tupleEq + exact tupleEq.trans (congrArg (nonemptyTupleCode 12) fieldsEq) + · intro equal + have fieldMembers := M.nonemptyTupleCode_field_mem 12 fields (equal ▸ members output) + have bounds := extendMany_members 13 fields env fieldMembers members + refine ⟨fields, fieldMembers, ?_, ?_⟩ + · apply (BoundedFormula.realize_toFormula M _ _ bounds).2 + apply (BoundedFormula.truth_nonemptyTupleFormula 12 + (suffixIndex k 13 output) (prefixIndex k 13) _).2 + simpa only [extendMany_prefix, extendMany_suffix] using equal + · apply (realize_conjBlock M.sets 13 _ _).2 + intro j + apply (M.realize_historyFieldUnionFormula + (prefixIndex k 13 j) (suffixIndex k 13 N) (suffixIndex k 13 history) j + _ bounds states (by simpa only [extendMany_suffix] using naturals) + (by simpa only [extendMany_suffix] using entries) (unions j)).2 + exact extendMany_prefix 13 fields env j + +end TransitiveGround + +namespace GroundCompressionUnionData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T : ZFSet.{u}} +variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + +noncomputable def code : ZFSet.{u} := nonemptyTupleCode 12 data.fields + +theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + data.code ∈ M.sets := M.nonemptyTupleCode_mem pairing 12 data.fields data.ground + +theorem realize_canonicalUnionTupleFormula {k} (output N history : Fin k) + (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (naturals : env N = ZFSet.omega) + (canonical : env history = initial.canonicalHistory M I Sources Reps G T) : + Realize M.sets (historyFieldUnionTupleFormula output N history) env ↔ + env output = data.code := by + apply M.realize_historyFieldUnionTupleFormula output N history env members + (initial.iterate M I Sources Reps G T) naturals _ data.fields data.fieldUnion + intro n y + rw [canonical] + exact initial.pair_mem_canonicalHistory M I Sources Reps G T n y + +end GroundCompressionUnionData + + + + +structure GroundInitialCompressionCertificate {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} + (stage : GroundMainStage M C D rD) (Labels : ZFSet.{u}) where + Reps : ZFSet.{u} + representatives_ground : Reps ∈ M.sets + representatives : TaskRepresentativesCode Reps (stage.compressionTasks Labels) + stage.carrier stage.actors stage.order stage.action + (M.groundRelations stage.carrier stage.carrier) + (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels + origin : GroundCompressionOrigin M (stage.compressionInitial Labels) + stage.carrier stage.order stage.meetGraph stage.action stage.top + (stage.compressionTasks Labels) (stage.compressionSources Labels) Reps + stage.actors stage.multiplication stage.inverse stage.identity + (stage.compressionTaskAction Labels) (stage.compressionFilters Labels) + unionData : GroundCompressionUnionData M (stage.compressionInitial Labels) + (stage.compressionTasks Labels) (stage.compressionSources Labels) Reps + stage.actors stage.multiplication stage.identity (stage.compressionTaskAction Labels) + +namespace GroundInitialCompressionCertificate +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {stage : GroundMainStage M C D rD} +variable (certificate : GroundInitialCompressionCertificate stage Labels) + +noncomputable def history : ZFSet.{u} := + (stage.compressionInitial Labels).canonicalHistory M (stage.compressionTasks Labels) + (stage.compressionSources Labels) certificate.Reps stage.actors (stage.compressionTaskAction Labels) + +noncomputable def code : ZFSet.{u} := + nonemptyTupleCode 2 (Fin.cases certificate.Reps + (Fin.cases certificate.history (fun _ => certificate.unionData.code))) + +theorem history_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hLabels : Labels ∈ M.sets) : certificate.history ∈ M.sets := by + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have hT := M.groundTaskTransport_mem pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have ground := certificate.origin.state.canonicalHistory_mem pairing unions powers separation + collection infinite hI (fields 0).1 certificate.representatives_ground stage.actors_ground hT + simpa only [certificate.origin.initial_data, history] using ground + +theorem code_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hLabels : Labels ∈ M.sets) : certificate.code ∈ M.sets := + M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases certificate.representatives_ground + (Fin.cases (certificate.history_ground pairing unions powers separation collection infinite hLabels) + (fun _ => certificate.unionData.code_ground pairing))) + +end GroundInitialCompressionCertificate + +namespace GroundMainStage +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +include pairing unions powers separation collection infinite + +theorem compressionCertificate_of_representatives {Labels Reps : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hReps : Reps ∈ M.sets) + (represented : TaskRepresentativesCode Reps (stage.compressionTasks Labels) + stage.carrier stage.actors stage.order stage.action + (M.groundRelations stage.carrier stage.carrier) + (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels) : + ∃ certificate : GroundInitialCompressionCertificate stage Labels, certificate.Reps = Reps := by + obtain ⟨origin⟩ := M.initialCompressionOrigin_of_representatives pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground stage.action_ground + hLabels stage.group_code stage.action_code stage.meet stage.top_mem stage.greatest + represented.1 represented.2 + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have hT := M.groundTaskTransport_mem pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + obtain ⟨data⟩ := origin.state.exists_groundUnion pairing unions powers separation collection infinite + hI (fields 0).1 hReps stage.actors_ground hT + have data' : GroundCompressionUnionData M (stage.compressionInitial Labels) + (stage.compressionTasks Labels) (stage.compressionSources Labels) Reps + stage.actors stage.multiplication stage.identity (stage.compressionTaskAction Labels) := by + rw [origin.initial_data] at data + exact data + exact ⟨⟨Reps, hReps, represented, origin, data'⟩, rfl⟩ + +theorem exists_compressionCertificate + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Labels : ZFSet.{u}} (hLabels : Labels ∈ M.sets) : + Nonempty (GroundInitialCompressionCertificate stage Labels) := by + obtain ⟨Reps, hReps, function, represented, _⟩ := M.exists_groundTaskRepresentatives + pairing unions powers separation choice stage.carrier_ground stage.actors_ground + stage.order_ground stage.meet_ground stage.action_ground hLabels stage.meet + obtain ⟨certificate, _⟩ := stage.compressionCertificate_of_representatives + pairing unions powers separation collection infinite hLabels hReps ⟨function, represented⟩ + exact ⟨certificate⟩ + +end GroundMainStage + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundInitialCompressionCertificate +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {stage : GroundMainStage M C D rD} +variable (certificate : GroundInitialCompressionCertificate stage Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (hLabels : Labels ∈ M.sets) +include pairing unions powers separation collection infinite hLabels + +theorem realize_history_iff {H : ZFSet.{u}} (hH : H ∈ M.sets) : + Realize M.sets (M.compressionHistoryFormula pairing unions powers separation) + (extend ZFSet.omega (extend H (extend (stage.compressionInitial Labels).code + (extend (stage.compressionTasks Labels) (extend (stage.compressionSources Labels) + (extend certificate.Reps (extend stage.actors + (extend (stage.compressionTaskAction Labels) Fin.elim0)))))))) ↔ + H = certificate.history := by + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have hT := M.groundTaskTransport_mem pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have recognized := certificate.origin.state.realize_compressionHistory_iff + pairing unions powers separation collection infinite hI (fields 0).1 + certificate.representatives_ground stage.actors_ground hT hH + simpa only [certificate.origin.initial_data, history] using recognized + +omit pairing unions powers collection hLabels in +theorem realize_union_iff {U H : ZFSet.{u}} (hU : U ∈ M.sets) (hH : H ∈ M.sets) + (canonical : H = certificate.history) : + Realize M.sets (historyFieldUnionTupleFormula 0 1 2) + (extend U (extend ZFSet.omega (extend H Fin.elim0))) ↔ U = certificate.unionData.code := by + exact certificate.unionData.realize_canonicalUnionTupleFormula 0 1 2 + (extend U (extend ZFSet.omega (extend H Fin.elim0))) + (Fin.cases hU (Fin.cases (M.omega_mem separation infinite) + (Fin.cases hH (fun i => Fin.elim0 i)))) rfl canonical + +end PartitionPilot.Forcing.GroundInitialCompressionCertificate + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} +variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) + +theorem initial_union_range_accounting + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + (initialIndices : I = M.groundEligibleTasks P G r μ A Labels) + (initialSources : Sources = literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : + CompressionRangeAccounting P I (algebra.union.fields 0) + (algebra.union.fields 1) (algebra.union.fields 2) algebra.maps algebra.bases (algebra.caps τ) := by + have sourceLiteral {i a : ZFSet.{u}} (source : ZFSet.pair i a ∈ Sources) : + ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels := initialSources ▸ source + refine { + original_subset := state.union_original_subset algebra.union + base_filled := ?_ + old_shadow := ?_ + cap_separation := ?_ + fresh_accounting := ?_ + } + · intro i hi f b indexed based x hx below + obtain ⟨a, source, _⟩ := seed.sources.2 i hi + obtain ⟨g, representative, _⟩ := state.inputs.representatives.2 i hi + exact state.union_map_base_filling algebra pairing unions powers separation hI hSources hReps hG hT + indexed source representative ((state.union_base_entry_iff algebra indexed source).1 based) hx below + · intro i hi b k based capped x hx below + obtain ⟨f, indexed⟩ := algebra.function.total hi + obtain ⟨a, source, _⟩ := seed.sources.2 i hi + exact state.union_initial_old_shadow algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData indexed (sourceLiteral source) + ((state.union_cap_entry_iff algebra indexed).1 capped) + ((state.union_base_entry_iff algebra indexed source).1 based) hx below + · intro i hi j hj different b c k l basedI basedJ cappedI cappedJ + obtain ⟨f, indexedI⟩ := algebra.function.total hi + obtain ⟨g, indexedJ⟩ := algebra.function.total hj + obtain ⟨a, sourceI, _⟩ := seed.sources.2 i hi + obtain ⟨d, sourceJ, _⟩ := seed.sources.2 j hj + exact state.union_initial_cap_separation algebra pairing unions powers separation + hP hG hr hμ hA hLabels initialData indexedI indexedJ (sourceLiteral sourceI) (sourceLiteral sourceJ) + ((state.union_cap_entry_iff algebra indexedI).1 cappedI) + ((state.union_cap_entry_iff algebra indexedJ).1 cappedJ) + ((state.union_base_entry_iff algebra indexedI sourceI).1 basedI) + ((state.union_base_entry_iff algebra indexedJ sourceJ).1 basedJ) different + · have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by + simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top + have initialAccounting : FiniteCompressionAccounting P I Sources τ state.data := by + simpa only [initialData, initialIndices, initialSources] using + (M.initialCompressionData_accounting pairing unions powers separation + hP hG hr hμ hA hLabels state.inputs.group seed.originalAction seed.originalOrder seed.top_mem top) + intro x hx + rcases state.union_fresh_accounting algebra pairing unions powers separation + hI hSources hReps hG hT initialAccounting x hx with original | fresh + · exact Or.inl original + · obtain ⟨i, hi, f, a, k, b, y, hy, indexed, source, cap, base, image, below, outside⟩ := fresh + exact Or.inr ⟨i, hi, f, k, b, y, hy, indexed, + (state.union_cap_entry_iff algebra indexed).2 cap, + (state.union_base_entry_iff algebra indexed source).2 base, image, below, outside⟩ + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundInitialCompressionCertificate +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {stage : GroundMainStage M C D rD} +variable (certificate : GroundInitialCompressionCertificate stage Labels) + +abbrev Completion := GroundCompressionCompletion M (stage.compressionInitial Labels) + (stage.compressionTasks Labels) (stage.compressionSources Labels) certificate.Reps + stage.actors stage.multiplication stage.identity (stage.compressionTaskAction Labels) stage.top + +theorem completion_union (completion : certificate.Completion) : + completion.algebra.union = certificate.unionData := + completion.algebra.union.unique certificate.unionData + +theorem exists_completion + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hLabels : Labels ∈ M.sets) : + Nonempty certificate.Completion := by + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have hT := M.groundTaskTransport_mem pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + obtain ⟨algebra⟩ := certificate.origin.state.exists_groundAlgebra + pairing unions powers separation collection infinite hI (fields 0).1 + certificate.representatives_ground stage.actors_ground hT + have accounting := certificate.origin.state.initial_union_range_accounting algebra + pairing unions powers separation stage.carrier_ground stage.actors_ground + stage.order_ground stage.meet_ground stage.action_ground hLabels hI (fields 0).1 + certificate.representatives_ground hT certificate.origin.initial_data rfl rfl + obtain ⟨completion⟩ := certificate.origin.state.completion_of_accounting algebra + pairing unions powers separation hI (fields 0).1 certificate.representatives_ground + stage.actors_ground hT accounting + exact ⟨by simpa only [certificate.origin.initial_data] using completion⟩ + +theorem completion_profiles (completion : certificate.Completion) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hLabels : Labels ∈ M.sets) : + CodedCompressionProfiles (completion.algebra.union.fields 0) + (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) + (completion.algebra.caps stage.top) (stage.compressionTargets Labels) + (stage.compressionSeparators Labels) (stage.compressionFilters Labels) := by + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have hT := M.groundTaskTransport_mem pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have transfer (initial : RecursiveStateData.{u}) + (origin : GroundCompressionOrigin M initial stage.carrier stage.order stage.meetGraph + stage.action stage.top (stage.compressionTasks Labels) (stage.compressionSources Labels) + certificate.Reps stage.actors stage.multiplication stage.inverse stage.identity + (stage.compressionTaskAction Labels) (stage.compressionFilters Labels)) + (algebra : GroundCompressionAlgebra M initial (stage.compressionTasks Labels) + (stage.compressionSources Labels) certificate.Reps stage.actors stage.multiplication + stage.identity (stage.compressionTaskAction Labels)) + (initialData : initial = stage.compressionInitial Labels) : + CodedCompressionProfiles (algebra.union.fields 0) (algebra.union.fields 1) + (algebra.union.fields 2) (algebra.caps stage.top) (stage.compressionTargets Labels) + (stage.compressionSeparators Labels) (stage.compressionFilters Labels) := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + exact state.initial_union_profiles algebra pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels hI (fields 0).1 certificate.representatives_ground hT initialData rfl + exact transfer _ certificate.origin completion.algebra rfl + +theorem completion_original_data (completion : certificate.Completion) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hLabels : Labels ∈ M.sets) : + CompressionOriginalData stage.carrier stage.order stage.meetGraph stage.action stage.actors + (completion.algebra.union.fields 0) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 12) := by + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + have hT := M.groundTaskTransport_mem pairing unions powers separation + stage.carrier_ground stage.actors_ground stage.order_ground stage.meet_ground + stage.action_ground hLabels stage.meet + exact certificate.origin.union_original_data completion.algebra.union + pairing unions powers separation hI (fields 0).1 certificate.representatives_ground + stage.actors_ground hT + +end PartitionPilot.Forcing.GroundInitialCompressionCertificate + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure GroundInitialCompletedCompressionCertificate + {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} + (stage : GroundMainStage M C D rD) (Labels : ZFSet.{u}) where + certificate : GroundInitialCompressionCertificate stage Labels + completion : certificate.Completion + +namespace GroundInitialCompletedCompressionCertificate +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {stage : GroundMainStage M C D rD} +variable (completed : GroundInitialCompletedCompressionCertificate stage Labels) + +noncomputable def code : ZFSet.{u} := nonemptyTupleCode 3 + (Fin.cases completed.certificate.code + (Fin.cases completed.completion.algebra.maps + (Fin.cases completed.completion.algebra.bases + (fun _ => completed.completion.algebra.caps stage.top)))) + +theorem code_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hLabels : Labels ∈ M.sets) : completed.code ∈ M.sets := + M.nonemptyTupleCode_mem pairing 3 _ + (Fin.cases (completed.certificate.code_ground pairing unions powers separation + collection infinite hLabels) (Fin.cases completed.completion.algebra.ground + (Fin.cases completed.completion.bases_ground (fun _ => completed.completion.caps_ground)))) + +end GroundInitialCompletedCompressionCertificate + +namespace GroundInitialCompressionCertificate +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {stage : GroundMainStage M C D rD} +variable (certificate : GroundInitialCompressionCertificate stage Labels) + +theorem exists_completedCertificate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hLabels : Labels ∈ M.sets) : + ∃ completed : GroundInitialCompletedCompressionCertificate stage Labels, + completed.certificate = certificate := by + obtain ⟨completion⟩ := certificate.exists_completion + pairing unions powers separation collection infinite hLabels + exact ⟨⟨certificate, completion⟩, rfl⟩ + +end GroundInitialCompressionCertificate + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionCompletion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionCompletion.lean index 2cff798d552e5c0bbddf5cec8c70b879186e5d28..24621aae6d0a0b83785f676739a8a593afaa421e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionCompletion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionCompletion.lean @@ -1,326 +1,326 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps -import OAI.SetTheory.PartitionPrinciple.Geometry.InitialCompressionUnionProfiles - -namespace OAI - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} -variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) -variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - -include pairing unions powers separation hP hG hr hμ hA hLabels in -theorem initial_map_marks - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - {i f a k b : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (cap : ZFSet.pair τ k ∈ f) (base : ZFSet.pair a b ∈ f) : - ∃ old c, ZFSet.pair i old ∈ (M.initialCompressionData P G r μ A Labels).Maps ∧ - ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels ∧ - ZFSet.pair τ k ∈ old ∧ ZFSet.pair a b ∈ old := by - have ha : a ∈ P := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).2 - have hi : i ∈ M.groundEligibleTasks P G r μ A Labels := - (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 - obtain ⟨old, oldEntry⟩ := state.inputs.maps.total (algebra.function.pair_source indexed) - have hτD : τ ∈ state.data.D := by - simp only [initialData] - exact seed.top_mem - have haD : a ∈ state.data.D := by - simp only [initialData] - exact ha - have capOld := (algebra.restrict i f indexed 0 old oldEntry τ hτD k).1 cap - have baseOld := (algebra.restrict i f indexed 0 old oldEntry a haD b).1 base - obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels seed.originalOrder - obtain ⟨c, target, _⟩ := (fields 1).2.2 i hi - refine ⟨old, c, ?_, target, capOld, baseOld⟩ - simpa only [initialData] using oldEntry - -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hP hG hr hμ hA hLabels hI hSources hReps hT - -theorem union_initial_old_shadow - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - {i f a k b x : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (cap : ZFSet.pair τ k ∈ f) (base : ZFSet.pair a b ∈ f) (hx : x ∈ P) - (below : ZFSet.pair x k ∈ algebra.union.fields 1) : ZFSet.pair x b ∈ algebra.union.fields 1 := by - obtain ⟨old, c, indexedOld, target, capOld, baseOld⟩ := state.initial_map_marks algebra - pairing unions powers separation hP hG hr hμ hA hLabels initialData indexed source cap base - have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by - simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top - obtain ⟨function, _, _⟩ := M.groundInitialMap_cap_base - pairing unions powers separation hP hG hr hμ hA hLabels - state.inputs.group seed.originalAction seed.originalOrder seed.top_mem top indexedOld source target - have hxCurrent : x ∈ state.data.currentCarrier := old_mem_taggedExtension (by - simp only [initialData] - exact hx) - have hkCurrent : k ∈ state.data.currentCarrier := by - simp only [initialData] - exact (ZFSet.pair_mem_prod.1 (function.1 capOld)).2 - have finiteBelow : ZFSet.pair x k ∈ state.data.currentOrder := - (state.union_order_iff algebra.union pairing unions powers separation hI hSources hReps hG hT - 1 hxCurrent hkCurrent).1 below - have initialBelow : ZFSet.pair x k ∈ (M.initialCompressionData P G r μ A Labels).currentOrder := by - simpa only [initialData] using finiteBelow - have result := (M.groundInitialMap_old_below_cap_iff state.inputs.group seed.originalAction - seed.originalOrder seed.top_mem top pairing unions powers separation hP hG hr hμ hA hLabels - indexedOld source target capOld baseOld hx).1 initialBelow - apply algebra.union.currentOrder.subset 0 - simp only [initialData] - exact result - -omit hI hSources hReps hT in -theorem union_initial_cap_separation - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - {i j f g a c k l b d : ZFSet.{u}} - (firstMap : ZFSet.pair i f ∈ algebra.maps) (secondMap : ZFSet.pair j g ∈ algebra.maps) - (firstSource : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (secondSource : ZFSet.pair j c ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (firstCap : ZFSet.pair τ k ∈ f) (secondCap : ZFSet.pair τ l ∈ g) - (firstBase : ZFSet.pair a b ∈ f) (secondBase : ZFSet.pair c d ∈ g) (different : i ≠ j) : - ZFSet.pair k d ∈ algebra.union.fields 1 ∨ ZFSet.pair l b ∈ algebra.union.fields 1 ∨ - ∃ z, ZFSet.pair (ZFSet.pair k l) z ∈ algebra.union.fields 2 ∧ - ZFSet.pair (ZFSet.pair b d) z ∈ algebra.union.fields 2 := by - obtain ⟨old, target, indexedOld, targetEntry, capOld, baseOld⟩ := state.initial_map_marks algebra - pairing unions powers separation hP hG hr hμ hA hLabels initialData firstMap firstSource firstCap firstBase - obtain ⟨old', target', indexedOld', targetEntry', capOld', baseOld'⟩ := state.initial_map_marks algebra - pairing unions powers separation hP hG hr hμ hA hLabels initialData secondMap secondSource secondCap secondBase - have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by - simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top - have result := M.groundInitialMap_cap_separation state.inputs.group seed.originalAction - seed.originalOrder seed.top_mem top pairing unions powers separation hP hG hr hμ hA hLabels - indexedOld indexedOld' firstSource secondSource targetEntry targetEntry' capOld capOld' baseOld baseOld' different - rcases result with first | second | common - · apply Or.inl - apply algebra.union.currentOrder.subset 0 - simp only [initialData] - exact first - · apply Or.inr ∘ Or.inl - apply algebra.union.currentOrder.subset 0 - simp only [initialData] - exact second - · obtain ⟨z, capsMeet, basesMeet⟩ := common - refine Or.inr (Or.inr ⟨z, ?_, ?_⟩) - · apply algebra.union.currentMeet.subset 0 - simp only [initialData] - exact capsMeet - · apply algebra.union.currentMeet.subset 0 - simp only [initialData] - exact basesMeet - -end PartitionPilot.Forcing.GroundCompressionState - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} -variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) -variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) -include pairing unions powers separation hP hG hr hμ hA hLabels - -theorem union_map_target - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - {i f a c : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : - ZFSet.pair a c ∈ f := by - obtain ⟨old, oldEntry⟩ := state.inputs.maps.total (algebra.function.pair_source indexed) - have indexedOld : ZFSet.pair i old ∈ (M.initialCompressionData P G r μ A Labels).Maps := by - simpa only [initialData] using oldEntry - have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by - simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top - have base := (M.groundInitialMap_cap_base pairing unions powers separation - hP hG hr hμ hA hLabels state.inputs.group seed.originalAction seed.originalOrder - seed.top_mem top indexedOld source target).2.2 - have ha : a ∈ P := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).2 - have haD : a ∈ state.data.D := by - simp only [initialData] - exact ha - exact (algebra.restrict i f indexed 0 old oldEntry a haD c).2 base - -theorem union_caps_common_target_meet - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - {i j f g a a' c K L : ZFSet.{u}} - (firstMap : ZFSet.pair i f ∈ algebra.maps) (secondMap : ZFSet.pair j g ∈ algebra.maps) - (sourceI : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (sourceJ : ZFSet.pair j a' ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (targetI : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (targetJ : ZFSet.pair j c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (capI : ZFSet.pair τ K ∈ f) (capJ : ZFSet.pair τ L ∈ g) (different : i ≠ j) - (firstStrict : ZFSet.pair K c ∉ algebra.union.fields 1) - (secondStrict : ZFSet.pair L c ∉ algebra.union.fields 1) : - ZFSet.pair (ZFSet.pair K L) c ∈ algebra.union.fields 2 := by - have firstBase := state.union_map_target algebra pairing unions powers separation - hP hG hr hμ hA hLabels initialData firstMap sourceI targetI - have secondBase := state.union_map_target algebra pairing unions powers separation - hP hG hr hμ hA hLabels initialData secondMap sourceJ targetJ - have apart := state.union_initial_cap_separation algebra pairing unions powers separation - hP hG hr hμ hA hLabels initialData firstMap secondMap sourceI sourceJ capI capJ - firstBase secondBase different - rcases apart with first | second | common - · exact False.elim (firstStrict first) - · exact False.elim (secondStrict second) - · obtain ⟨z, capsMeet, basesMeet⟩ := common - have hc := (ZFSet.pair_mem_prod.1 - ((algebra.embedding i f firstMap).injection.function.1 firstBase)).2 - have hz := (ZFSet.pair_mem_prod.1 (algebra.union.meet.operation.1 basesMeet)).2 - have equal := algebra.union.meet.order.antisymm z hz c hc - (algebra.union.meet.lower_left c c z basesMeet) - (algebra.union.meet.greatest c c z c hc basesMeet - (algebra.union.meet.order.refl c hc) (algebra.union.meet.order.refl c hc)) - exact equal ▸ capsMeet - -end PartitionPilot.Forcing.GroundCompressionState - -namespace PartitionPilot.Forcing.GroundCompressionOrigin -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} -variable (origin : GroundCompressionOrigin M initial P r μ A τ I Sources Reps G m inv one T Filters) -variable (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) - -include origin in -theorem union_caps_common_target_meet - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (initialData : initial = M.initialCompressionData P G r μ A Labels) - (initialSources : Sources = literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - {i j c K L : ZFSet.{u}} - (capI : ZFSet.pair i K ∈ algebra.caps τ) (capJ : ZFSet.pair j L ∈ algebra.caps τ) - (targetI : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (targetJ : ZFSet.pair j c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (different : i ≠ j) (firstStrict : ZFSet.pair K c ∉ algebra.union.fields 1) - (secondStrict : ZFSet.pair L c ∉ algebra.union.fields 1) : - ZFSet.pair (ZFSet.pair K L) c ∈ algebra.union.fields 2 := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - have hi := (ZFSet.pair_mem_prod.1 ((state.union_caps_function algebra).1 capI)).1 - have hj := (ZFSet.pair_mem_prod.1 ((state.union_caps_function algebra).1 capJ)).1 - obtain ⟨f, indexedI⟩ := algebra.function.total hi - obtain ⟨g, indexedJ⟩ := algebra.function.total hj - obtain ⟨a, sourceI, _⟩ := seed.sources.2 i hi - obtain ⟨a', sourceJ, _⟩ := seed.sources.2 j hj - exact state.union_caps_common_target_meet algebra pairing unions powers separation - hP hG hr hμ hA hLabels initialData indexedI indexedJ - (initialSources ▸ sourceI) (initialSources ▸ sourceJ) targetI targetJ - ((state.union_cap_entry_iff algebra indexedI).1 capI) - ((state.union_cap_entry_iff algebra indexedJ).1 capJ) different firstStrict secondStrict - -end PartitionPilot.Forcing.GroundCompressionOrigin - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialCompressionCompletion - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - Nonempty (GroundCompressionCompletion M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ) := by - dsimp only - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ - rw [← initialData] - obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite - hI hSources hReps hG hT - apply state.completion_of_accounting algebra pairing unions powers separation hI hSources hReps hG hT - refine { - original_subset := state.union_original_subset algebra.union - base_filled := ?_ - old_shadow := ?_ - cap_separation := ?_ - fresh_accounting := ?_ - } - · intro i hi f b indexed based x hx below - obtain ⟨a, source, _⟩ := seed.sources.2 i hi - obtain ⟨g, representative, _⟩ := state.inputs.representatives.2 i hi - exact state.union_map_base_filling algebra pairing unions powers separation hI hSources hReps hG hT - indexed source representative ((state.union_base_entry_iff algebra indexed source).1 based) hx below - · intro i hi b k based capped x hx below - obtain ⟨f, indexed⟩ := algebra.function.total hi - obtain ⟨a, source, _⟩ := seed.sources.2 i hi - exact state.union_initial_old_shadow algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData indexed source - ((state.union_cap_entry_iff algebra indexed).1 capped) - ((state.union_base_entry_iff algebra indexed source).1 based) hx below - · intro i hi j hj different b c k l basedI basedJ cappedI cappedJ - obtain ⟨f, indexedI⟩ := algebra.function.total hi - obtain ⟨g, indexedJ⟩ := algebra.function.total hj - obtain ⟨a, sourceI, _⟩ := seed.sources.2 i hi - obtain ⟨d, sourceJ, _⟩ := seed.sources.2 j hj - exact state.union_initial_cap_separation algebra pairing unions powers separation - hP hG hr hμ hA hLabels initialData indexedI indexedJ sourceI sourceJ - ((state.union_cap_entry_iff algebra indexedI).1 cappedI) - ((state.union_cap_entry_iff algebra indexedJ).1 cappedJ) - ((state.union_base_entry_iff algebra indexedI sourceI).1 basedI) - ((state.union_base_entry_iff algebra indexedJ sourceJ).1 basedJ) different - · have initialAccounting := M.initialCompressionData_accounting pairing unions powers separation - hP hG hr hμ hA hLabels group action meet hτ top - rw [← initialData] at initialAccounting - intro x hx - rcases state.union_fresh_accounting algebra pairing unions powers separation - hI hSources hReps hG hT initialAccounting x hx with original | fresh - · exact Or.inl original - · obtain ⟨i, hi, f, a, k, b, y, hy, indexed, source, cap, base, image, below, outside⟩ := fresh - exact Or.inr ⟨i, hi, f, k, b, y, hy, indexed, - (state.union_cap_entry_iff algebra indexed).2 cap, - (state.union_base_entry_iff algebra indexed source).2 base, image, below, outside⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps +import OAI.SetTheory.PartitionPrinciple.Geometry.InitialCompressionUnionProfiles + +namespace OAI + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} +variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) +variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + +include pairing unions powers separation hP hG hr hμ hA hLabels in +theorem initial_map_marks + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + {i f a k b : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (cap : ZFSet.pair τ k ∈ f) (base : ZFSet.pair a b ∈ f) : + ∃ old c, ZFSet.pair i old ∈ (M.initialCompressionData P G r μ A Labels).Maps ∧ + ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels ∧ + ZFSet.pair τ k ∈ old ∧ ZFSet.pair a b ∈ old := by + have ha : a ∈ P := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).2 + have hi : i ∈ M.groundEligibleTasks P G r μ A Labels := + (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 + obtain ⟨old, oldEntry⟩ := state.inputs.maps.total (algebra.function.pair_source indexed) + have hτD : τ ∈ state.data.D := by + simp only [initialData] + exact seed.top_mem + have haD : a ∈ state.data.D := by + simp only [initialData] + exact ha + have capOld := (algebra.restrict i f indexed 0 old oldEntry τ hτD k).1 cap + have baseOld := (algebra.restrict i f indexed 0 old oldEntry a haD b).1 base + obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels seed.originalOrder + obtain ⟨c, target, _⟩ := (fields 1).2.2 i hi + refine ⟨old, c, ?_, target, capOld, baseOld⟩ + simpa only [initialData] using oldEntry + +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hP hG hr hμ hA hLabels hI hSources hReps hT + +theorem union_initial_old_shadow + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + {i f a k b x : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (cap : ZFSet.pair τ k ∈ f) (base : ZFSet.pair a b ∈ f) (hx : x ∈ P) + (below : ZFSet.pair x k ∈ algebra.union.fields 1) : ZFSet.pair x b ∈ algebra.union.fields 1 := by + obtain ⟨old, c, indexedOld, target, capOld, baseOld⟩ := state.initial_map_marks algebra + pairing unions powers separation hP hG hr hμ hA hLabels initialData indexed source cap base + have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by + simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top + obtain ⟨function, _, _⟩ := M.groundInitialMap_cap_base + pairing unions powers separation hP hG hr hμ hA hLabels + state.inputs.group seed.originalAction seed.originalOrder seed.top_mem top indexedOld source target + have hxCurrent : x ∈ state.data.currentCarrier := old_mem_taggedExtension (by + simp only [initialData] + exact hx) + have hkCurrent : k ∈ state.data.currentCarrier := by + simp only [initialData] + exact (ZFSet.pair_mem_prod.1 (function.1 capOld)).2 + have finiteBelow : ZFSet.pair x k ∈ state.data.currentOrder := + (state.union_order_iff algebra.union pairing unions powers separation hI hSources hReps hG hT + 1 hxCurrent hkCurrent).1 below + have initialBelow : ZFSet.pair x k ∈ (M.initialCompressionData P G r μ A Labels).currentOrder := by + simpa only [initialData] using finiteBelow + have result := (M.groundInitialMap_old_below_cap_iff state.inputs.group seed.originalAction + seed.originalOrder seed.top_mem top pairing unions powers separation hP hG hr hμ hA hLabels + indexedOld source target capOld baseOld hx).1 initialBelow + apply algebra.union.currentOrder.subset 0 + simp only [initialData] + exact result + +omit hI hSources hReps hT in +theorem union_initial_cap_separation + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + {i j f g a c k l b d : ZFSet.{u}} + (firstMap : ZFSet.pair i f ∈ algebra.maps) (secondMap : ZFSet.pair j g ∈ algebra.maps) + (firstSource : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (secondSource : ZFSet.pair j c ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (firstCap : ZFSet.pair τ k ∈ f) (secondCap : ZFSet.pair τ l ∈ g) + (firstBase : ZFSet.pair a b ∈ f) (secondBase : ZFSet.pair c d ∈ g) (different : i ≠ j) : + ZFSet.pair k d ∈ algebra.union.fields 1 ∨ ZFSet.pair l b ∈ algebra.union.fields 1 ∨ + ∃ z, ZFSet.pair (ZFSet.pair k l) z ∈ algebra.union.fields 2 ∧ + ZFSet.pair (ZFSet.pair b d) z ∈ algebra.union.fields 2 := by + obtain ⟨old, target, indexedOld, targetEntry, capOld, baseOld⟩ := state.initial_map_marks algebra + pairing unions powers separation hP hG hr hμ hA hLabels initialData firstMap firstSource firstCap firstBase + obtain ⟨old', target', indexedOld', targetEntry', capOld', baseOld'⟩ := state.initial_map_marks algebra + pairing unions powers separation hP hG hr hμ hA hLabels initialData secondMap secondSource secondCap secondBase + have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by + simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top + have result := M.groundInitialMap_cap_separation state.inputs.group seed.originalAction + seed.originalOrder seed.top_mem top pairing unions powers separation hP hG hr hμ hA hLabels + indexedOld indexedOld' firstSource secondSource targetEntry targetEntry' capOld capOld' baseOld baseOld' different + rcases result with first | second | common + · apply Or.inl + apply algebra.union.currentOrder.subset 0 + simp only [initialData] + exact first + · apply Or.inr ∘ Or.inl + apply algebra.union.currentOrder.subset 0 + simp only [initialData] + exact second + · obtain ⟨z, capsMeet, basesMeet⟩ := common + refine Or.inr (Or.inr ⟨z, ?_, ?_⟩) + · apply algebra.union.currentMeet.subset 0 + simp only [initialData] + exact capsMeet + · apply algebra.union.currentMeet.subset 0 + simp only [initialData] + exact basesMeet + +end PartitionPilot.Forcing.GroundCompressionState + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} +variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) +variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) +include pairing unions powers separation hP hG hr hμ hA hLabels + +theorem union_map_target + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + {i f a c : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : + ZFSet.pair a c ∈ f := by + obtain ⟨old, oldEntry⟩ := state.inputs.maps.total (algebra.function.pair_source indexed) + have indexedOld : ZFSet.pair i old ∈ (M.initialCompressionData P G r μ A Labels).Maps := by + simpa only [initialData] using oldEntry + have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by + simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top + have base := (M.groundInitialMap_cap_base pairing unions powers separation + hP hG hr hμ hA hLabels state.inputs.group seed.originalAction seed.originalOrder + seed.top_mem top indexedOld source target).2.2 + have ha : a ∈ P := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).2 + have haD : a ∈ state.data.D := by + simp only [initialData] + exact ha + exact (algebra.restrict i f indexed 0 old oldEntry a haD c).2 base + +theorem union_caps_common_target_meet + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + {i j f g a a' c K L : ZFSet.{u}} + (firstMap : ZFSet.pair i f ∈ algebra.maps) (secondMap : ZFSet.pair j g ∈ algebra.maps) + (sourceI : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (sourceJ : ZFSet.pair j a' ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (targetI : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (targetJ : ZFSet.pair j c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (capI : ZFSet.pair τ K ∈ f) (capJ : ZFSet.pair τ L ∈ g) (different : i ≠ j) + (firstStrict : ZFSet.pair K c ∉ algebra.union.fields 1) + (secondStrict : ZFSet.pair L c ∉ algebra.union.fields 1) : + ZFSet.pair (ZFSet.pair K L) c ∈ algebra.union.fields 2 := by + have firstBase := state.union_map_target algebra pairing unions powers separation + hP hG hr hμ hA hLabels initialData firstMap sourceI targetI + have secondBase := state.union_map_target algebra pairing unions powers separation + hP hG hr hμ hA hLabels initialData secondMap sourceJ targetJ + have apart := state.union_initial_cap_separation algebra pairing unions powers separation + hP hG hr hμ hA hLabels initialData firstMap secondMap sourceI sourceJ capI capJ + firstBase secondBase different + rcases apart with first | second | common + · exact False.elim (firstStrict first) + · exact False.elim (secondStrict second) + · obtain ⟨z, capsMeet, basesMeet⟩ := common + have hc := (ZFSet.pair_mem_prod.1 + ((algebra.embedding i f firstMap).injection.function.1 firstBase)).2 + have hz := (ZFSet.pair_mem_prod.1 (algebra.union.meet.operation.1 basesMeet)).2 + have equal := algebra.union.meet.order.antisymm z hz c hc + (algebra.union.meet.lower_left c c z basesMeet) + (algebra.union.meet.greatest c c z c hc basesMeet + (algebra.union.meet.order.refl c hc) (algebra.union.meet.order.refl c hc)) + exact equal ▸ capsMeet + +end PartitionPilot.Forcing.GroundCompressionState + +namespace PartitionPilot.Forcing.GroundCompressionOrigin +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} +variable (origin : GroundCompressionOrigin M initial P r μ A τ I Sources Reps G m inv one T Filters) +variable (algebra : GroundCompressionAlgebra M initial I Sources Reps G m one T) + +include origin in +theorem union_caps_common_target_meet + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (initialData : initial = M.initialCompressionData P G r μ A Labels) + (initialSources : Sources = literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + {i j c K L : ZFSet.{u}} + (capI : ZFSet.pair i K ∈ algebra.caps τ) (capJ : ZFSet.pair j L ∈ algebra.caps τ) + (targetI : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (targetJ : ZFSet.pair j c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (different : i ≠ j) (firstStrict : ZFSet.pair K c ∉ algebra.union.fields 1) + (secondStrict : ZFSet.pair L c ∉ algebra.union.fields 1) : + ZFSet.pair (ZFSet.pair K L) c ∈ algebra.union.fields 2 := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + have hi := (ZFSet.pair_mem_prod.1 ((state.union_caps_function algebra).1 capI)).1 + have hj := (ZFSet.pair_mem_prod.1 ((state.union_caps_function algebra).1 capJ)).1 + obtain ⟨f, indexedI⟩ := algebra.function.total hi + obtain ⟨g, indexedJ⟩ := algebra.function.total hj + obtain ⟨a, sourceI, _⟩ := seed.sources.2 i hi + obtain ⟨a', sourceJ, _⟩ := seed.sources.2 j hj + exact state.union_caps_common_target_meet algebra pairing unions powers separation + hP hG hr hμ hA hLabels initialData indexedI indexedJ + (initialSources ▸ sourceI) (initialSources ▸ sourceJ) targetI targetJ + ((state.union_cap_entry_iff algebra indexedI).1 capI) + ((state.union_cap_entry_iff algebra indexedJ).1 capJ) different firstStrict secondStrict + +end PartitionPilot.Forcing.GroundCompressionOrigin + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialCompressionCompletion + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + Nonempty (GroundCompressionCompletion M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ) := by + dsimp only + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ + rw [← initialData] + obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite + hI hSources hReps hG hT + apply state.completion_of_accounting algebra pairing unions powers separation hI hSources hReps hG hT + refine { + original_subset := state.union_original_subset algebra.union + base_filled := ?_ + old_shadow := ?_ + cap_separation := ?_ + fresh_accounting := ?_ + } + · intro i hi f b indexed based x hx below + obtain ⟨a, source, _⟩ := seed.sources.2 i hi + obtain ⟨g, representative, _⟩ := state.inputs.representatives.2 i hi + exact state.union_map_base_filling algebra pairing unions powers separation hI hSources hReps hG hT + indexed source representative ((state.union_base_entry_iff algebra indexed source).1 based) hx below + · intro i hi b k based capped x hx below + obtain ⟨f, indexed⟩ := algebra.function.total hi + obtain ⟨a, source, _⟩ := seed.sources.2 i hi + exact state.union_initial_old_shadow algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData indexed source + ((state.union_cap_entry_iff algebra indexed).1 capped) + ((state.union_base_entry_iff algebra indexed source).1 based) hx below + · intro i hi j hj different b c k l basedI basedJ cappedI cappedJ + obtain ⟨f, indexedI⟩ := algebra.function.total hi + obtain ⟨g, indexedJ⟩ := algebra.function.total hj + obtain ⟨a, sourceI, _⟩ := seed.sources.2 i hi + obtain ⟨d, sourceJ, _⟩ := seed.sources.2 j hj + exact state.union_initial_cap_separation algebra pairing unions powers separation + hP hG hr hμ hA hLabels initialData indexedI indexedJ sourceI sourceJ + ((state.union_cap_entry_iff algebra indexedI).1 cappedI) + ((state.union_cap_entry_iff algebra indexedJ).1 cappedJ) + ((state.union_base_entry_iff algebra indexedI sourceI).1 basedI) + ((state.union_base_entry_iff algebra indexedJ sourceJ).1 basedJ) different + · have initialAccounting := M.initialCompressionData_accounting pairing unions powers separation + hP hG hr hμ hA hLabels group action meet hτ top + rw [← initialData] at initialAccounting + intro x hx + rcases state.union_fresh_accounting algebra pairing unions powers separation + hI hSources hReps hG hT initialAccounting x hx with original | fresh + · exact Or.inl original + · obtain ⟨i, hi, f, a, k, b, y, hy, indexed, source, cap, base, image, below, outside⟩ := fresh + exact Or.inr ⟨i, hi, f, k, b, y, hy, indexed, + (state.union_cap_entry_iff algebra indexed).2 cap, + (state.union_base_entry_iff algebra indexed source).2 base, image, below, outside⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionIterates.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionIterates.lean index 8e4193d02838e147db16060eec41016c7f191b2f..9a901871a84419dfb09604b2011854d75240f18a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionIterates.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionIterates.lean @@ -1,51 +1,51 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionHistory - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialCompressionIterates - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ G ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, - ∀ n : Nat, - ((M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n).code ∈ M.sets ∧ - ∃ current : GroundCompressionState M seed, - current.data = (M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n := by - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, initial, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, ?_⟩ - intro n - rw [← initialData] - exact ⟨initial.canonical_iterate_code_mem pairing unions powers separation - hI hSources hReps hG hT n, - initial.canonical_iterate_valid pairing unions powers separation hI hSources hReps hG hT n⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionHistory + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialCompressionIterates + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ G ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, + ∀ n : Nat, + ((M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n).code ∈ M.sets ∧ + ∃ current : GroundCompressionState M seed, + current.data = (M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n := by + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, initial, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, ?_⟩ + intro n + rw [← initialData] + exact ⟨initial.canonical_iterate_code_mem pairing unions powers separation + hI hSources hReps hG hT n, + initial.canonical_iterate_valid pairing unions powers separation hI hSources hReps hG hT n⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionOrigin.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionOrigin.lean index 5772affa8446c0eaf3ecc8af83540611a5c87ce5..5a5dbfd46d2c64f10ff822b8fba87992c8c4d41e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionOrigin.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialCompressionOrigin.lean @@ -1,632 +1,632 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedCompressionHeights -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompletedCompressionCertificates -import OAI.SetTheory.PartitionPrinciple.Models.GroundCoherentHeightChoices -import OAI.SetTheory.PartitionPrinciple.Transfinite.CompressionPrefixCoinitiality -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologicalCompressionCoinitiality -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirths - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def heightCandidateStates - (B Ps Rs C D rD original K : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ h ∈ B, - ∃ P ∈ Ps.sUnion.sUnion, ∃ r ∈ Rs.sUnion.sUnion, - z = ZFSet.pair n h ∧ ZFSet.pair n P ∈ Ps ∧ ZFSet.pair n r ∈ Rs ∧ - StrictLexHeightCode P C D r h rD ∧ original ⊆ h ∧ - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ K) - (ZFSet.prod ZFSet.omega B) - -theorem heightCandidateStates_subset (B Ps Rs C D rD original K : ZFSet.{u}) : - heightCandidateStates B Ps Rs C D rD original K ⊆ ZFSet.prod ZFSet.omega B := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_heightCandidateStates (B Ps Rs C D rD original K z : ZFSet.{u}) : - z ∈ heightCandidateStates B Ps Rs C D rD original K ↔ - ∃ n ∈ ZFSet.omega, ∃ h ∈ B, ∃ P ∈ Ps.sUnion.sUnion, ∃ r ∈ Rs.sUnion.sUnion, - z = ZFSet.pair n h ∧ ZFSet.pair n P ∈ Ps ∧ ZFSet.pair n r ∈ Rs ∧ - StrictLexHeightCode P C D r h rD ∧ original ⊆ h ∧ - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ K := by - rw [heightCandidateStates, ZFSet.mem_sep] - constructor - · exact fun member => member.2 - · intro witness - refine ⟨?_, witness⟩ - obtain ⟨n, hn, h, hh, _, _, _, _, heq, _⟩ := witness - rw [heq] - exact ZFSet.pair_mem_prod.2 ⟨hn, hh⟩ - -theorem pair_mem_heightCandidateStates {B Ps Rs C D rD original K n h P r : ZFSet.{u}} - (domains : FunctionGraphOn ZFSet.omega Ps) (orders : FunctionGraphOn ZFSet.omega Rs) - (domainEntry : ZFSet.pair n P ∈ Ps) (orderEntry : ZFSet.pair n r ∈ Rs) : - ZFSet.pair n h ∈ heightCandidateStates B Ps Rs C D rD original K ↔ - h ∈ B ∧ StrictLexHeightCode P C D r h rD ∧ original ⊆ h ∧ - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ K := by - rw [mem_heightCandidateStates] - constructor - · rintro ⟨m, _, f, hf, Q, _, s, _, equal, first, second, code, old, columns⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have domainEq := domains.unique first domainEntry - have orderEq := orders.unique second orderEntry - subst Q - subst s - exact ⟨hf, code, old, columns⟩ - · rintro ⟨hh, code, old, columns⟩ - exact ⟨n, domains.pair_source domainEntry, h, hh, - P, pair_second_mem_doubleUnion domainEntry, r, pair_second_mem_doubleUnion orderEntry, - rfl, domainEntry, orderEntry, code, old, columns⟩ - - - - - -namespace BoundedFormula -open SetFormula - -def heightCandidateEntryFormula {n} - (z omega B Ps Rs C D rD original K boundPs boundRs : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ - exMem omega (exMem B.succ (exMem boundPs.succ.succ (exMem boundRs.succ.succ.succ - (.conj (orderedPairFormula (lift z) 3 2) - (.conj (pairMembershipFormula 3 1 (lift Ps)) - (.conj (pairMembershipFormula 3 0 (lift Rs)) - (.conj (strictLexHeightFormula 1 (lift C) (lift D) 0 2 (lift rD)) - (.conj (subsetFormula (lift original) 2) - (heightColumnsBoundFormula 1 (lift C) (lift D) 2 (lift K)))))))))) - -theorem truth_heightCandidateEntryFormula {n} - (z omega B Ps Rs C D rD original K boundPs boundRs : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (heightCandidateEntryFormula z omega B Ps Rs C D rD original K boundPs boundRs) env ↔ - ∃ a ∈ env omega, ∃ h ∈ env B, ∃ P ∈ env boundPs, ∃ r ∈ env boundRs, - env z = ZFSet.pair a h ∧ ZFSet.pair a P ∈ env Ps ∧ ZFSet.pair a r ∈ env Rs ∧ - StrictLexHeightCode P (env C) (env D) r h (env rD) ∧ env original ⊆ h ∧ - ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ env K := by - simp only [heightCandidateEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_pairMembershipFormula, truth_strictLexHeightFormula, truth_subsetFormula, - truth_heightColumnsBoundFormula] - constructor - · rintro ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, columns⟩ - refine ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, ?_⟩ - intro x c q entry - have shape := ZFSet.pair_mem_prod.1 (code.function.1 entry) - have coordinates := ZFSet.pair_mem_prod.1 shape.2 - exact columns x shape.1 c coordinates.1 q coordinates.2 entry - · rintro ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, columns⟩ - exact ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, - fun x _ c _ q _ entry => columns x c q entry⟩ - -end BoundedFormula - -namespace TransitiveGround -open SetFormula - -theorem heightCandidateStates_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hOmega : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - {B Ps Rs C D rD original K : ZFSet.{u}} - (hB : B ∈ M.sets) (hPs : Ps ∈ M.sets) (hRs : Rs ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hOriginal : original ∈ M.sets) (hK : K ∈ M.sets) : - heightCandidateStates B Ps Rs C D rD original K ∈ M.sets := by - have boundPs := M.union_mem unions (M.union_mem unions hPs) - have boundRs := M.union_mem unions (M.union_mem unions hRs) - let params := extend ZFSet.omega (extend B (extend Ps (extend Rs (extend C - (extend D (extend rD (extend original (extend K - (extend Ps.sUnion.sUnion (extend Rs.sUnion.sUnion Fin.elim0)))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.heightCandidateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) params - (Fin.cases hOmega (Fin.cases hB (Fin.cases hPs (Fin.cases hRs (Fin.cases hC - (Fin.cases hD (Fin.cases hrD (Fin.cases hOriginal (Fin.cases hK - (Fin.cases boundPs (Fin.cases boundRs (fun i => Fin.elim0 i)))))))))))) - (M.prod_mem pairing unions powers separation hOmega hB) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.heightCandidateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) (extend z params)) - (ZFSet.prod ZFSet.omega B) = heightCandidateStates B Ps Rs C D rD original K := by - apply ZFSet.ext - intro z - rw [heightCandidateStates, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_heightCandidateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 _) - exact equal ▸ selected - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) - -theorem initialCompressionData_template_constancy (P G r μ A Labels : ZFSet.{u}) : - RecursiveTemplateConstancy P r μ (M.initialCompressionData P G r μ A Labels) := - ⟨rfl, rfl, rfl⟩ - -theorem initialCompressionData_iterate_template_constancy - (P G r μ A Labels Reps : ZFSet.{u}) (n : Nat) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - RecursiveTemplateConstancy P r μ - ((M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n) := - (M.initialCompressionData_template_constancy P G r μ A Labels).iterate M _ _ Reps G _ n - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (union : GroundCompressionUnionData M state.data I Sources Reps G m one T) -include union - -theorem exists_groundHeightFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {Ps Rs C D rD c original : ZFSet.{u}} - (hPs : Ps ∈ M.sets) (hRs : Rs ∈ M.sets) - (domains : FunctionGraphOn ZFSet.omega Ps) (orders : FunctionGraphOn ZFSet.omega Rs) - (domainEntries : ∀ n P, ZFSet.pair (natSetCode n) P ∈ Ps ↔ - P = (state.data.iterate M I Sources Reps G T n).D) - (orderEntries : ∀ n r, ZFSet.pair (natSetCode n) r ∈ Rs ↔ - r = (state.data.iterate M I Sources Reps G T n).rD) - (hP0 : P0 ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P0 C D r0 original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P0 (ZFSet.prod C D) original) ZFSet.omega) : - ∃ family ∈ M.sets, FunctionGraphOn ZFSet.omega family ∧ - (∀ h, ZFSet.pair (natSetCode 0) h ∈ family ↔ h = original) ∧ - (∀ n h, ZFSet.pair (natSetCode n) h ∈ family → - StrictLexHeightCode (state.data.iterate M I Sources Reps G T n).D C D - (state.data.iterate M I Sources Reps G T n).rD h rD ∧ original ⊆ h ∧ - ∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ h → a ∈ heightColumns P0 C D original) ∧ - ∀ n h k, ZFSet.pair (natSetCode n) h ∈ family → - ZFSet.pair (natSetCode (n + 1)) k ∈ family → h ⊆ k := by - let stages := state.data.iterate M I Sources Reps G T - let B := M.groundRelations (union.fields 0) (ZFSet.prod C D) - let K := heightColumns P0 C D original - let W := heightCandidateStates B Ps Rs C D rD original K - have hOmega := M.omega_mem separation infinite - have hB : B ∈ M.sets := M.groundRelations_mem pairing unions powers separation - (union.ground 0) (M.prod_mem pairing unions powers separation hC hD) - have hK : K ∈ M.sets := M.heightColumns_mem pairing unions powers separation hP0 hC hD hOriginal - have hW : W ∈ M.sets := M.heightCandidateStates_mem pairing unions powers separation - hOmega hB hPs hRs hC hD hrD hOriginal hK - have graphBound {P height : ZFSet.{u}} (ground : height ∈ M.sets) - (function : ZFSet.IsFunc P (ZFSet.prod C D) height) - (subset : P ⊆ union.fields 0) : height ∈ B := by - apply (M.mem_groundRelations _ _ _).2 - refine ⟨ground, ?_⟩ - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨subset hx, hy⟩ - have candidate (n : Nat) (height : ZFSet.{u}) : - ZFSet.pair (natSetCode n) height ∈ W ↔ height ∈ B ∧ - StrictLexHeightCode (stages n).D C D (stages n).rD height rD ∧ original ⊆ height ∧ - ∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ height → a ∈ K := - pair_mem_heightCandidateStates domains orders - ((domainEntries n _).2 rfl) ((orderEntries n _).2 rfl) - have originalAtZero : StrictLexHeightCode (stages 0).D C D (stages 0).rD original rD := by - simpa only [stages, RecursiveStateData.iterate_zero, initialDomain, initialOrder] using originalCode - have start : ZFSet.pair ∅ original ∈ W := by - apply (candidate 0 original).2 - exact ⟨graphBound hOriginal originalAtZero.function ((union.fieldUnion 0).subset 0), - originalAtZero, fun _ hx => hx, fun _ _ _ entry => mem_heightColumns_of_entry originalCode.function entry⟩ - have extendable : ∀ n ∈ ZFSet.omega, ∀ old, ZFSet.pair n old ∈ W → - ∃ height, ZFSet.pair (insert n n) height ∈ W ∧ old ⊆ height := by - intro index hIndex old member - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode index).1 hIndex - obtain ⟨oldBound, oldCode, extension, bounded⟩ := (candidate n old).1 member - have hOld := ((M.mem_groundRelations _ _ _).1 oldBound).1 - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by - rw [equal] - exact constant.iterate M I Sources Reps G T n - have currentCode : StrictLexHeightCode current.data.D C D current.data.rD old rD := by - simpa only [equal] using oldCode - obtain ⟨height, hHeight, heightCode, inclusion, originalInclusion, columnBound⟩ := - current.exists_column_bounded_height_step pairing unions powers separation collection infinite choice - currentConstant hP0 hC hD hrD hc hOriginal hOld originalCode currentCode columns target above - coordinateInjection originalSmall extension bounded - have nextCode : StrictLexHeightCode (stages (n + 1)).D C D (stages (n + 1)).rD height rD := by - change StrictLexHeightCode (stages n).currentCarrier C D (stages n).currentOrder height rD - simpa only [equal] using heightCode - refine ⟨height, ?_, inclusion⟩ - exact (candidate (n + 1) height).2 - ⟨graphBound hHeight nextCode.function ((union.fieldUnion 0).subset (n + 1)), - nextCode, originalInclusion, columnBound⟩ - obtain ⟨family, hFamily, function, zero, selected, adjacent⟩ := M.exists_groundCoherentChoices - pairing unions powers separation infinite choice hW hB - (heightCandidateStates_subset _ _ _ _ _ _ _ _) start extendable - refine ⟨family, hFamily, ⟨B, function⟩, zero, ?_, ?_⟩ - · intro n height entry - exact ((candidate n height).1 (selected _ (natSetCode_mem_omega n) height entry)).2 - · intro n height next first second - exact adjacent (natSetCode n) (natSetCode_mem_omega n) height next first second - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (union : GroundCompressionUnionData M state.data I Sources Reps G m one T) - -theorem exists_groundHeightData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {C D rD c original : ZFSet.{u}} - (hP0 : P0 ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P0 C D r0 original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P0 (ZFSet.prod C D) original) ZFSet.omega) : - Nonempty (GroundCompressionHeightData M state.data I Sources Reps G m one T union P0 C D rD original) := by - have hOmega := M.omega_mem separation infinite - obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT - obtain ⟨Ps, hPs, domains, domainEntries⟩ := M.exists_groundStateFieldFamily pairing separation collection - hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 0 - obtain ⟨Rs, hRs, orders, orderEntries⟩ := M.exists_groundStateFieldFamily pairing separation collection - hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 1 - obtain ⟨family, hFamily, function, zero, finite, adjacent⟩ := state.exists_groundHeightFamily union - pairing unions powers separation collection infinite choice hI hSources hReps hG hT - initialDomain initialOrder constant hPs hRs domains orders domainEntries orderEntries - hP0 hC hD hrD hc hOriginal originalCode columns target above coordinateInjection originalSmall - have zeroEq : function.natValue 0 = original := (zero _).1 (function.natValue_entry 0) - have codes := fun n => (finite n _ (function.natValue_entry n)).1 - have mono := fun n => adjacent n _ _ (function.natValue_entry n) (function.natValue_entry (n + 1)) - have columnBounds := fun n => (finite n _ (function.natValue_entry n)).2.2 - obtain ⟨height, hHeight, exactUnion, code, exactEntries, bound⟩ := M.exists_groundCoherentHeightUnion - unions separation hOmega hFamily function (union.fieldUnion 0) (union.fieldUnion 1) - (fun n => (state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n).1.order) - codes mono columnBounds - obtain ⟨rangeGround, rangeCountable⟩ := M.countable_height_range_of_old_columns - pairing unions powers separation infinite choice hP0 (union.ground 0) hC hD hOriginal hHeight - originalSmall ⟨c, hc, coordinateInjection⟩ bound - refine ⟨{ - family := family - family_ground := hFamily - function := function - zero := zeroEq - finite := codes - adjacent := mono - height := height - height_ground := hHeight - exact_union := exactUnion - code := code - finite_entries := exactEntries - original_entries := ?_ - range_ground := rangeGround - range_countable := rangeCountable - columns := bound - }⟩ - intro x hx y - have hxZero : x ∈ (state.data.iterate M I Sources Reps G T 0).D := by - simpa only [RecursiveStateData.iterate_zero, initialDomain] using hx - simpa only [zeroEq] using exactEntries 0 x hxZero y - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialHeightedCompression - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - Nonempty (GroundHeightedCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original) := by - dsimp only - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ - rw [← initialData] - obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite - hI hSources hReps hG hT - have accounting := state.initial_union_range_accounting algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl - obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation - hI hSources hReps hG hT accounting - have initialDomain : state.data.D = P := by rw [initialData]; rfl - have initialOrder : state.data.rD = r := by rw [initialData]; rfl - have constant : RecursiveTemplateConstancy P r μ state.data := by - rw [initialData] - exact M.initialCompressionData_template_constancy P G r μ A Labels - obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union - pairing unions powers separation collection infinite choice hI hSources hReps hG hT - initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above - coordinateInjection originalSmall - exact ⟨⟨completion, heights⟩⟩ - - - - - -theorem exists_groundInitialProfiledCompression - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - Nonempty (GroundProfiledCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters) := by - dsimp only - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ - rw [← initialData] - obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite - hI hSources hReps hG hT - have accounting := state.initial_union_range_accounting algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl - obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation - hI hSources hReps hG hT accounting - have initialDomain : state.data.D = P := by rw [initialData]; rfl - have initialOrder : state.data.rD = r := by rw [initialData]; rfl - have constant : RecursiveTemplateConstancy P r μ state.data := by - rw [initialData] - exact M.initialCompressionData_template_constancy P G r μ A Labels - obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union - pairing unions powers separation collection infinite choice hI hSources hReps hG hT - initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above - coordinateInjection originalSmall - have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl - exact ⟨⟨⟨completion, heights⟩, profiles⟩⟩ - - - - - -theorem exists_groundInitialBornCompression - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original base old : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (hOld : old ∈ M.sets) (ordinal : ordinalSetProperty base) - (oldFunction : FunctionGraphOn P old) - (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) - (oldMeet : OldMeetCode r μ old) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - Nonempty (GroundBornCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old) := by - dsimp only - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ - rw [← initialData] - obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite - hI hSources hReps hG hT - have accounting := state.initial_union_range_accounting algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl - obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation - hI hSources hReps hG hT accounting - have initialDomain : state.data.D = P := by rw [initialData]; rfl - have initialOrder : state.data.rD = r := by rw [initialData]; rfl - have constant : RecursiveTemplateConstancy P r μ state.data := by - rw [initialData] - exact M.initialCompressionData_template_constancy P G r μ A Labels - obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union - pairing unions powers separation collection infinite choice hI hSources hReps hG hT - initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above - coordinateInjection originalSmall - have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl - have initialBirthFunction : FunctionGraphOn state.data.D old := initialDomain.symm ▸ oldFunction - have initialOldMeet : OldMeetCode state.data.rD state.data.μD old := by - rw [initialData] - exact oldMeet - obtain ⟨births⟩ := state.exists_groundBirthData completion.algebra.union - pairing unions powers separation collection infinite hI hSources hReps hG hT - hBase hOld ordinal initialBirthFunction oldBound initialOldMeet - exact ⟨⟨⟨⟨completion, heights⟩, profiles⟩, births⟩⟩ - - - - - -theorem exists_groundInitialCompressionOrigin - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ I Sources Reps G m inv one T Filters, - Nonempty (GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior) := by - dsimp only - have hOld : old ∈ M.sets := priorBirth ▸ prior.birth_mem base baseMember - have oldFunction : FunctionGraphOn P old := by - rw [← priorSpace, ← priorBirth] - exact ⟨T0, prior.birth_function base baseMember⟩ - have oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base := by - intro x t entry - have priorEntry : ZFSet.pair x t ∈ prior.birth base := priorBirth.symm ▸ entry - have hx := (ZFSet.pair_mem_prod.1 ((prior.birth_function base baseMember).1 priorEntry)).1 - exact (prior.birth_bound base baseMember x hx t priorEntry).symm - have oldMeet : OldMeetCode r μ old := by - rw [← priorOrder, ← priorMeet, ← priorBirth] - exact prior.old_meet base baseMember - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ⟨seed, state, initialData⟩, ?_⟩ - rw [← initialData] - obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite - hI hSources hReps hG hT - have accounting := state.initial_union_range_accounting algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl - obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation - hI hSources hReps hG hT accounting - have initialDomain : state.data.D = P := by rw [initialData]; rfl - have initialOrder : state.data.rD = r := by rw [initialData]; rfl - have constant : RecursiveTemplateConstancy P r μ state.data := by - rw [initialData] - exact M.initialCompressionData_template_constancy P G r μ A Labels - obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union - pairing unions powers separation collection infinite choice hI hSources hReps hG hT - initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above - coordinateInjection originalSmall - have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl - have initialBirthFunction : FunctionGraphOn state.data.D old := initialDomain.symm ▸ oldFunction - have initialOldMeet : OldMeetCode state.data.rD state.data.μD old := by - rw [initialData] - exact oldMeet - obtain ⟨births⟩ := state.exists_groundBirthData completion.algebra.union - pairing unions powers separation collection infinite hI hSources hReps hG hT - hBase hOld (ordinalSetProperty_member ordinal baseMember) initialBirthFunction oldBound initialOldMeet - have initialMeet : state.data.μD = μ := by rw [initialData]; rfl - let history := state.prefixHistory completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth - refine ⟨⟨⟨⟨⟨completion, heights⟩, profiles⟩, births⟩, history, priorHeight, ?_, ?_, ?_⟩⟩ - · intro s before - exact state.prefixHistory_old completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth before - · intro n - exact state.prefixHistory_stamp completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth n - · exact state.prefixHistory_limit completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedCompressionHeights +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompletedCompressionCertificates +import OAI.SetTheory.PartitionPrinciple.Models.GroundCoherentHeightChoices +import OAI.SetTheory.PartitionPrinciple.Transfinite.CompressionPrefixCoinitiality +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologicalCompressionCoinitiality +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirths + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def heightCandidateStates + (B Ps Rs C D rD original K : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ h ∈ B, + ∃ P ∈ Ps.sUnion.sUnion, ∃ r ∈ Rs.sUnion.sUnion, + z = ZFSet.pair n h ∧ ZFSet.pair n P ∈ Ps ∧ ZFSet.pair n r ∈ Rs ∧ + StrictLexHeightCode P C D r h rD ∧ original ⊆ h ∧ + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ K) + (ZFSet.prod ZFSet.omega B) + +theorem heightCandidateStates_subset (B Ps Rs C D rD original K : ZFSet.{u}) : + heightCandidateStates B Ps Rs C D rD original K ⊆ ZFSet.prod ZFSet.omega B := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_heightCandidateStates (B Ps Rs C D rD original K z : ZFSet.{u}) : + z ∈ heightCandidateStates B Ps Rs C D rD original K ↔ + ∃ n ∈ ZFSet.omega, ∃ h ∈ B, ∃ P ∈ Ps.sUnion.sUnion, ∃ r ∈ Rs.sUnion.sUnion, + z = ZFSet.pair n h ∧ ZFSet.pair n P ∈ Ps ∧ ZFSet.pair n r ∈ Rs ∧ + StrictLexHeightCode P C D r h rD ∧ original ⊆ h ∧ + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ K := by + rw [heightCandidateStates, ZFSet.mem_sep] + constructor + · exact fun member => member.2 + · intro witness + refine ⟨?_, witness⟩ + obtain ⟨n, hn, h, hh, _, _, _, _, heq, _⟩ := witness + rw [heq] + exact ZFSet.pair_mem_prod.2 ⟨hn, hh⟩ + +theorem pair_mem_heightCandidateStates {B Ps Rs C D rD original K n h P r : ZFSet.{u}} + (domains : FunctionGraphOn ZFSet.omega Ps) (orders : FunctionGraphOn ZFSet.omega Rs) + (domainEntry : ZFSet.pair n P ∈ Ps) (orderEntry : ZFSet.pair n r ∈ Rs) : + ZFSet.pair n h ∈ heightCandidateStates B Ps Rs C D rD original K ↔ + h ∈ B ∧ StrictLexHeightCode P C D r h rD ∧ original ⊆ h ∧ + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ K := by + rw [mem_heightCandidateStates] + constructor + · rintro ⟨m, _, f, hf, Q, _, s, _, equal, first, second, code, old, columns⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have domainEq := domains.unique first domainEntry + have orderEq := orders.unique second orderEntry + subst Q + subst s + exact ⟨hf, code, old, columns⟩ + · rintro ⟨hh, code, old, columns⟩ + exact ⟨n, domains.pair_source domainEntry, h, hh, + P, pair_second_mem_doubleUnion domainEntry, r, pair_second_mem_doubleUnion orderEntry, + rfl, domainEntry, orderEntry, code, old, columns⟩ + + + + + +namespace BoundedFormula +open SetFormula + +def heightCandidateEntryFormula {n} + (z omega B Ps Rs C D rD original K boundPs boundRs : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ + exMem omega (exMem B.succ (exMem boundPs.succ.succ (exMem boundRs.succ.succ.succ + (.conj (orderedPairFormula (lift z) 3 2) + (.conj (pairMembershipFormula 3 1 (lift Ps)) + (.conj (pairMembershipFormula 3 0 (lift Rs)) + (.conj (strictLexHeightFormula 1 (lift C) (lift D) 0 2 (lift rD)) + (.conj (subsetFormula (lift original) 2) + (heightColumnsBoundFormula 1 (lift C) (lift D) 2 (lift K)))))))))) + +theorem truth_heightCandidateEntryFormula {n} + (z omega B Ps Rs C D rD original K boundPs boundRs : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (heightCandidateEntryFormula z omega B Ps Rs C D rD original K boundPs boundRs) env ↔ + ∃ a ∈ env omega, ∃ h ∈ env B, ∃ P ∈ env boundPs, ∃ r ∈ env boundRs, + env z = ZFSet.pair a h ∧ ZFSet.pair a P ∈ env Ps ∧ ZFSet.pair a r ∈ env Rs ∧ + StrictLexHeightCode P (env C) (env D) r h (env rD) ∧ env original ⊆ h ∧ + ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ h → c ∈ env K := by + simp only [heightCandidateEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_pairMembershipFormula, truth_strictLexHeightFormula, truth_subsetFormula, + truth_heightColumnsBoundFormula] + constructor + · rintro ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, columns⟩ + refine ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, ?_⟩ + intro x c q entry + have shape := ZFSet.pair_mem_prod.1 (code.function.1 entry) + have coordinates := ZFSet.pair_mem_prod.1 shape.2 + exact columns x shape.1 c coordinates.1 q coordinates.2 entry + · rintro ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, columns⟩ + exact ⟨a, ha, h, hh, P, hP, r, hr, heq, domain, order, code, old, + fun x _ c _ q _ entry => columns x c q entry⟩ + +end BoundedFormula + +namespace TransitiveGround +open SetFormula + +theorem heightCandidateStates_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hOmega : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + {B Ps Rs C D rD original K : ZFSet.{u}} + (hB : B ∈ M.sets) (hPs : Ps ∈ M.sets) (hRs : Rs ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hOriginal : original ∈ M.sets) (hK : K ∈ M.sets) : + heightCandidateStates B Ps Rs C D rD original K ∈ M.sets := by + have boundPs := M.union_mem unions (M.union_mem unions hPs) + have boundRs := M.union_mem unions (M.union_mem unions hRs) + let params := extend ZFSet.omega (extend B (extend Ps (extend Rs (extend C + (extend D (extend rD (extend original (extend K + (extend Ps.sUnion.sUnion (extend Rs.sUnion.sUnion Fin.elim0)))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.heightCandidateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) params + (Fin.cases hOmega (Fin.cases hB (Fin.cases hPs (Fin.cases hRs (Fin.cases hC + (Fin.cases hD (Fin.cases hrD (Fin.cases hOriginal (Fin.cases hK + (Fin.cases boundPs (Fin.cases boundRs (fun i => Fin.elim0 i)))))))))))) + (M.prod_mem pairing unions powers separation hOmega hB) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.heightCandidateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11) (extend z params)) + (ZFSet.prod ZFSet.omega B) = heightCandidateStates B Ps Rs C D rD original K := by + apply ZFSet.ext + intro z + rw [heightCandidateStates, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_heightCandidateEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 _) + exact equal ▸ selected + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) + +theorem initialCompressionData_template_constancy (P G r μ A Labels : ZFSet.{u}) : + RecursiveTemplateConstancy P r μ (M.initialCompressionData P G r μ A Labels) := + ⟨rfl, rfl, rfl⟩ + +theorem initialCompressionData_iterate_template_constancy + (P G r μ A Labels Reps : ZFSet.{u}) (n : Nat) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + RecursiveTemplateConstancy P r μ + ((M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n) := + (M.initialCompressionData_template_constancy P G r μ A Labels).iterate M _ _ Reps G _ n + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (union : GroundCompressionUnionData M state.data I Sources Reps G m one T) +include union + +theorem exists_groundHeightFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {Ps Rs C D rD c original : ZFSet.{u}} + (hPs : Ps ∈ M.sets) (hRs : Rs ∈ M.sets) + (domains : FunctionGraphOn ZFSet.omega Ps) (orders : FunctionGraphOn ZFSet.omega Rs) + (domainEntries : ∀ n P, ZFSet.pair (natSetCode n) P ∈ Ps ↔ + P = (state.data.iterate M I Sources Reps G T n).D) + (orderEntries : ∀ n r, ZFSet.pair (natSetCode n) r ∈ Rs ↔ + r = (state.data.iterate M I Sources Reps G T n).rD) + (hP0 : P0 ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P0 C D r0 original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P0 (ZFSet.prod C D) original) ZFSet.omega) : + ∃ family ∈ M.sets, FunctionGraphOn ZFSet.omega family ∧ + (∀ h, ZFSet.pair (natSetCode 0) h ∈ family ↔ h = original) ∧ + (∀ n h, ZFSet.pair (natSetCode n) h ∈ family → + StrictLexHeightCode (state.data.iterate M I Sources Reps G T n).D C D + (state.data.iterate M I Sources Reps G T n).rD h rD ∧ original ⊆ h ∧ + ∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ h → a ∈ heightColumns P0 C D original) ∧ + ∀ n h k, ZFSet.pair (natSetCode n) h ∈ family → + ZFSet.pair (natSetCode (n + 1)) k ∈ family → h ⊆ k := by + let stages := state.data.iterate M I Sources Reps G T + let B := M.groundRelations (union.fields 0) (ZFSet.prod C D) + let K := heightColumns P0 C D original + let W := heightCandidateStates B Ps Rs C D rD original K + have hOmega := M.omega_mem separation infinite + have hB : B ∈ M.sets := M.groundRelations_mem pairing unions powers separation + (union.ground 0) (M.prod_mem pairing unions powers separation hC hD) + have hK : K ∈ M.sets := M.heightColumns_mem pairing unions powers separation hP0 hC hD hOriginal + have hW : W ∈ M.sets := M.heightCandidateStates_mem pairing unions powers separation + hOmega hB hPs hRs hC hD hrD hOriginal hK + have graphBound {P height : ZFSet.{u}} (ground : height ∈ M.sets) + (function : ZFSet.IsFunc P (ZFSet.prod C D) height) + (subset : P ⊆ union.fields 0) : height ∈ B := by + apply (M.mem_groundRelations _ _ _).2 + refine ⟨ground, ?_⟩ + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨subset hx, hy⟩ + have candidate (n : Nat) (height : ZFSet.{u}) : + ZFSet.pair (natSetCode n) height ∈ W ↔ height ∈ B ∧ + StrictLexHeightCode (stages n).D C D (stages n).rD height rD ∧ original ⊆ height ∧ + ∀ x a q, ZFSet.pair x (ZFSet.pair a q) ∈ height → a ∈ K := + pair_mem_heightCandidateStates domains orders + ((domainEntries n _).2 rfl) ((orderEntries n _).2 rfl) + have originalAtZero : StrictLexHeightCode (stages 0).D C D (stages 0).rD original rD := by + simpa only [stages, RecursiveStateData.iterate_zero, initialDomain, initialOrder] using originalCode + have start : ZFSet.pair ∅ original ∈ W := by + apply (candidate 0 original).2 + exact ⟨graphBound hOriginal originalAtZero.function ((union.fieldUnion 0).subset 0), + originalAtZero, fun _ hx => hx, fun _ _ _ entry => mem_heightColumns_of_entry originalCode.function entry⟩ + have extendable : ∀ n ∈ ZFSet.omega, ∀ old, ZFSet.pair n old ∈ W → + ∃ height, ZFSet.pair (insert n n) height ∈ W ∧ old ⊆ height := by + intro index hIndex old member + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode index).1 hIndex + obtain ⟨oldBound, oldCode, extension, bounded⟩ := (candidate n old).1 member + have hOld := ((M.mem_groundRelations _ _ _).1 oldBound).1 + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by + rw [equal] + exact constant.iterate M I Sources Reps G T n + have currentCode : StrictLexHeightCode current.data.D C D current.data.rD old rD := by + simpa only [equal] using oldCode + obtain ⟨height, hHeight, heightCode, inclusion, originalInclusion, columnBound⟩ := + current.exists_column_bounded_height_step pairing unions powers separation collection infinite choice + currentConstant hP0 hC hD hrD hc hOriginal hOld originalCode currentCode columns target above + coordinateInjection originalSmall extension bounded + have nextCode : StrictLexHeightCode (stages (n + 1)).D C D (stages (n + 1)).rD height rD := by + change StrictLexHeightCode (stages n).currentCarrier C D (stages n).currentOrder height rD + simpa only [equal] using heightCode + refine ⟨height, ?_, inclusion⟩ + exact (candidate (n + 1) height).2 + ⟨graphBound hHeight nextCode.function ((union.fieldUnion 0).subset (n + 1)), + nextCode, originalInclusion, columnBound⟩ + obtain ⟨family, hFamily, function, zero, selected, adjacent⟩ := M.exists_groundCoherentChoices + pairing unions powers separation infinite choice hW hB + (heightCandidateStates_subset _ _ _ _ _ _ _ _) start extendable + refine ⟨family, hFamily, ⟨B, function⟩, zero, ?_, ?_⟩ + · intro n height entry + exact ((candidate n height).1 (selected _ (natSetCode_mem_omega n) height entry)).2 + · intro n height next first second + exact adjacent (natSetCode n) (natSetCode_mem_omega n) height next first second + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (union : GroundCompressionUnionData M state.data I Sources Reps G m one T) + +theorem exists_groundHeightData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {C D rD c original : ZFSet.{u}} + (hP0 : P0 ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P0 C D r0 original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P0 (ZFSet.prod C D) original) ZFSet.omega) : + Nonempty (GroundCompressionHeightData M state.data I Sources Reps G m one T union P0 C D rD original) := by + have hOmega := M.omega_mem separation infinite + obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT + obtain ⟨Ps, hPs, domains, domainEntries⟩ := M.exists_groundStateFieldFamily pairing separation collection + hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 0 + obtain ⟨Rs, hRs, orders, orderEntries⟩ := M.exists_groundStateFieldFamily pairing separation collection + hOmega hHistory (state.data.iterate M I Sources Reps G T) entries 1 + obtain ⟨family, hFamily, function, zero, finite, adjacent⟩ := state.exists_groundHeightFamily union + pairing unions powers separation collection infinite choice hI hSources hReps hG hT + initialDomain initialOrder constant hPs hRs domains orders domainEntries orderEntries + hP0 hC hD hrD hc hOriginal originalCode columns target above coordinateInjection originalSmall + have zeroEq : function.natValue 0 = original := (zero _).1 (function.natValue_entry 0) + have codes := fun n => (finite n _ (function.natValue_entry n)).1 + have mono := fun n => adjacent n _ _ (function.natValue_entry n) (function.natValue_entry (n + 1)) + have columnBounds := fun n => (finite n _ (function.natValue_entry n)).2.2 + obtain ⟨height, hHeight, exactUnion, code, exactEntries, bound⟩ := M.exists_groundCoherentHeightUnion + unions separation hOmega hFamily function (union.fieldUnion 0) (union.fieldUnion 1) + (fun n => (state.canonical_iterate_codes pairing unions powers separation hI hSources hReps hG hT n).1.order) + codes mono columnBounds + obtain ⟨rangeGround, rangeCountable⟩ := M.countable_height_range_of_old_columns + pairing unions powers separation infinite choice hP0 (union.ground 0) hC hD hOriginal hHeight + originalSmall ⟨c, hc, coordinateInjection⟩ bound + refine ⟨{ + family := family + family_ground := hFamily + function := function + zero := zeroEq + finite := codes + adjacent := mono + height := height + height_ground := hHeight + exact_union := exactUnion + code := code + finite_entries := exactEntries + original_entries := ?_ + range_ground := rangeGround + range_countable := rangeCountable + columns := bound + }⟩ + intro x hx y + have hxZero : x ∈ (state.data.iterate M I Sources Reps G T 0).D := by + simpa only [RecursiveStateData.iterate_zero, initialDomain] using hx + simpa only [zeroEq] using exactEntries 0 x hxZero y + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialHeightedCompression + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + Nonempty (GroundHeightedCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original) := by + dsimp only + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ + rw [← initialData] + obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite + hI hSources hReps hG hT + have accounting := state.initial_union_range_accounting algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl + obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation + hI hSources hReps hG hT accounting + have initialDomain : state.data.D = P := by rw [initialData]; rfl + have initialOrder : state.data.rD = r := by rw [initialData]; rfl + have constant : RecursiveTemplateConstancy P r μ state.data := by + rw [initialData] + exact M.initialCompressionData_template_constancy P G r μ A Labels + obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union + pairing unions powers separation collection infinite choice hI hSources hReps hG hT + initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above + coordinateInjection originalSmall + exact ⟨⟨completion, heights⟩⟩ + + + + + +theorem exists_groundInitialProfiledCompression + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + Nonempty (GroundProfiledCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters) := by + dsimp only + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ + rw [← initialData] + obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite + hI hSources hReps hG hT + have accounting := state.initial_union_range_accounting algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl + obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation + hI hSources hReps hG hT accounting + have initialDomain : state.data.D = P := by rw [initialData]; rfl + have initialOrder : state.data.rD = r := by rw [initialData]; rfl + have constant : RecursiveTemplateConstancy P r μ state.data := by + rw [initialData] + exact M.initialCompressionData_template_constancy P G r μ A Labels + obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union + pairing unions powers separation collection infinite choice hI hSources hReps hG hT + initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above + coordinateInjection originalSmall + have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl + exact ⟨⟨⟨completion, heights⟩, profiles⟩⟩ + + + + + +theorem exists_groundInitialBornCompression + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original base old : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (hOld : old ∈ M.sets) (ordinal : ordinalSetProperty base) + (oldFunction : FunctionGraphOn P old) + (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) + (oldMeet : OldMeetCode r μ old) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + Nonempty (GroundBornCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old) := by + dsimp only + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ + rw [← initialData] + obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite + hI hSources hReps hG hT + have accounting := state.initial_union_range_accounting algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl + obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation + hI hSources hReps hG hT accounting + have initialDomain : state.data.D = P := by rw [initialData]; rfl + have initialOrder : state.data.rD = r := by rw [initialData]; rfl + have constant : RecursiveTemplateConstancy P r μ state.data := by + rw [initialData] + exact M.initialCompressionData_template_constancy P G r μ A Labels + obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union + pairing unions powers separation collection infinite choice hI hSources hReps hG hT + initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above + coordinateInjection originalSmall + have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl + have initialBirthFunction : FunctionGraphOn state.data.D old := initialDomain.symm ▸ oldFunction + have initialOldMeet : OldMeetCode state.data.rD state.data.μD old := by + rw [initialData] + exact oldMeet + obtain ⟨births⟩ := state.exists_groundBirthData completion.algebra.union + pairing unions powers separation collection infinite hI hSources hReps hG hT + hBase hOld ordinal initialBirthFunction oldBound initialOldMeet + exact ⟨⟨⟨⟨completion, heights⟩, profiles⟩, births⟩⟩ + + + + + +theorem exists_groundInitialCompressionOrigin + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ I Sources Reps G m inv one T Filters, + Nonempty (GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior) := by + dsimp only + have hOld : old ∈ M.sets := priorBirth ▸ prior.birth_mem base baseMember + have oldFunction : FunctionGraphOn P old := by + rw [← priorSpace, ← priorBirth] + exact ⟨T0, prior.birth_function base baseMember⟩ + have oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base := by + intro x t entry + have priorEntry : ZFSet.pair x t ∈ prior.birth base := priorBirth.symm ▸ entry + have hx := (ZFSet.pair_mem_prod.1 ((prior.birth_function base baseMember).1 priorEntry)).1 + exact (prior.birth_bound base baseMember x hx t priorEntry).symm + have oldMeet : OldMeetCode r μ old := by + rw [← priorOrder, ← priorMeet, ← priorBirth] + exact prior.old_meet base baseMember + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ⟨seed, state, initialData⟩, ?_⟩ + rw [← initialData] + obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite + hI hSources hReps hG hT + have accounting := state.initial_union_range_accounting algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl + obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation + hI hSources hReps hG hT accounting + have initialDomain : state.data.D = P := by rw [initialData]; rfl + have initialOrder : state.data.rD = r := by rw [initialData]; rfl + have constant : RecursiveTemplateConstancy P r μ state.data := by + rw [initialData] + exact M.initialCompressionData_template_constancy P G r μ A Labels + obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union + pairing unions powers separation collection infinite choice hI hSources hReps hG hT + initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above + coordinateInjection originalSmall + have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl + have initialBirthFunction : FunctionGraphOn state.data.D old := initialDomain.symm ▸ oldFunction + have initialOldMeet : OldMeetCode state.data.rD state.data.μD old := by + rw [initialData] + exact oldMeet + obtain ⟨births⟩ := state.exists_groundBirthData completion.algebra.union + pairing unions powers separation collection infinite hI hSources hReps hG hT + hBase hOld (ordinalSetProperty_member ordinal baseMember) initialBirthFunction oldBound initialOldMeet + have initialMeet : state.data.μD = μ := by rw [initialData]; rfl + let history := state.prefixHistory completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth + refine ⟨⟨⟨⟨⟨completion, heights⟩, profiles⟩, births⟩, history, priorHeight, ?_, ?_, ?_⟩⟩ + · intro s before + exact state.prefixHistory_old completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth before + · intro n + exact state.prefixHistory_stamp completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth n + · exact state.prefixHistory_limit completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalGroup.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalGroup.lean index 34fb3aae97be1eb674ba81fb7efac83959f0a732..e5eaa12d9d02b21bb3d5bd4fb0958528f7ea6846 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalGroup.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalGroup.lean @@ -1,219 +1,219 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionPrefix - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround - -open SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem finiteWords_subset_powerset (A : ZFSet.{u}) : - M.finiteWords A ⊆ ZFSet.powerset (ZFSet.prod ZFSet.omega A) := by - intro f hf - have relation := (ZFSet.mem_sep.1 hf).1 - exact ZFSet.mem_powerset.2 ((M.mem_groundRelations ZFSet.omega A f).1 relation).2 - -theorem finiteWords_rank_le (A : ZFSet.{u}) : - ZFSet.rank (M.finiteWords A) ≤ Order.succ (ZFSet.rank (ZFSet.prod ZFSet.omega A)) := by - have bound := ZFSet.rank_mono (M.finiteWords_subset_powerset A) - rwa [ZFSet.rank_powerset] at bound - -theorem finiteWords_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) {A : ZFSet.{u}} - (omega : ZFSet.rank ZFSet.omega < o) (alphabet : ZFSet.rank A < o) : - ZFSet.rank (M.finiteWords A) < o := - (M.finiteWords_rank_le A).trans_lt (limit.succ_lt (rank_product_lt limit omega alphabet)) - -end TransitiveGround - -section -open SetFormula -universe u - -noncomputable def externalRequestAlphabet (I P G r μ A : ZFSet.{u}) : ZFSet.{u} := - externalGeneratorAlphabet G (externalChildLetters I P (externalRectangles P G r μ A)) - -structure GroundExternalWordData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P r μ A : ZFSet.{u}) - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : Prop where - rectangles_ground : externalRectangles P G r μ A ∈ M.sets - requests_ground : externalRequestCarrier I P (externalRectangles P G r μ A) ∈ M.sets - letters_ground : externalChildLetters I P (externalRectangles P G r μ A) ∈ M.sets - kinds_ground : externalRequestKinds I P (externalRectangles P G r μ A) ∈ M.sets - payloads_ground : externalRequestPayloads I P (externalRectangles P G r μ A) ∈ M.sets - kinds_function : FunctionGraphOn (externalRequestCarrier I P (externalRectangles P G r μ A)) - (externalRequestKinds I P (externalRectangles P G r μ A)) - payloads_function : FunctionGraphOn (externalRequestCarrier I P (externalRectangles P G r μ A)) - (externalRequestPayloads I P (externalRectangles P G r μ A)) - maps_ground : completion.externalMaps ∈ M.sets - caps_ground : completion.externalCaps ∈ M.sets - maps_function : FunctionGraphOn (ZFSet.prod {natSetCode 0} I) completion.externalMaps - caps_function : ZFSet.IsFunc (ZFSet.prod {natSetCode 0} I) - (completion.algebra.union.fields 0) completion.externalCaps - alphabet_ground : externalRequestAlphabet I P G r μ A ∈ M.sets - words_ground : M.finiteWords (externalRequestAlphabet I P G r μ A) ∈ M.sets - append_ground : M.finiteWordAppendGraph (externalRequestAlphabet I P G r μ A) ∈ M.sets - reverse_ground : M.finiteWordReverseGraph (externalRequestAlphabet I P G r μ A) ∈ M.sets - length_ground : M.finiteWordLengthGraph (externalRequestAlphabet I P G r μ A) ∈ M.sets - append_function : ZFSet.IsFunc - (ZFSet.prod (M.finiteWords (externalRequestAlphabet I P G r μ A)) - (M.finiteWords (externalRequestAlphabet I P G r μ A))) - (M.finiteWords (externalRequestAlphabet I P G r μ A)) - (M.finiteWordAppendGraph (externalRequestAlphabet I P G r μ A)) - reverse_function : ZFSet.IsFunc (M.finiteWords (externalRequestAlphabet I P G r μ A)) - (M.finiteWords (externalRequestAlphabet I P G r μ A)) - (M.finiteWordReverseGraph (externalRequestAlphabet I P G r μ A)) - length_function : ZFSet.IsFunc (M.finiteWords (externalRequestAlphabet I P G r μ A)) ZFSet.omega - (M.finiteWordLengthGraph (externalRequestAlphabet I P G r μ A)) - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P r μ A : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -theorem externalWordData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hG : G ∈ M.sets) - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) : - GroundExternalWordData M initial I Sources Reps G m one T τ P r μ A completion := by - obtain ⟨rectangles, requests, letters, kinds, payloads, kindFunction, payloadFunction⟩ := - M.groundExternalRequestData pairing unions powers separation hI hP hG hr hμ hA - obtain ⟨maps, caps, mapFunction, capFunction⟩ := - completion.external_fields_ground pairing unions powers separation hI - have alphabet : externalRequestAlphabet I P G r μ A ∈ M.sets := - M.externalGeneratorAlphabet_mem pairing unions powers separation hG letters - exact { - rectangles_ground := rectangles - requests_ground := requests - letters_ground := letters - kinds_ground := kinds - payloads_ground := payloads - kinds_function := kindFunction - payloads_function := payloadFunction - maps_ground := maps - caps_ground := caps - maps_function := mapFunction - caps_function := capFunction - alphabet_ground := alphabet - words_ground := M.finiteWords_mem pairing unions powers separation infinite alphabet - append_ground := M.finiteWordAppendGraph_mem pairing unions powers separation infinite alphabet - reverse_ground := M.finiteWordReverseGraph_mem pairing unions powers separation infinite alphabet - length_ground := M.finiteWordLengthGraph_mem pairing unions powers separation infinite alphabet - append_function := M.finiteWordAppendGraph_function pairing unions separation infinite alphabet - reverse_function := M.finiteWordReverseGraph_function pairing unions separation infinite alphabet - length_function := M.finiteWordLengthGraph_function _ } - -end GroundCompressionCompletion - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialExternalWordData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, - GroundExternalWordData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion := by - dsimp only - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, compression⟩ := - M.exists_groundInitialCompressionPrefix pairing unions powers separation collection infinite choice - hP hG hr hμ hA hLabels group action meet hτ top hC hD hrD hc hOriginal - originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember - priorSpace priorOrder priorMeet priorBirth priorHeight - obtain ⟨compression⟩ := compression - exact ⟨hI, hSources, hFilters, hT, Reps, hReps, compression, - compression.born.profiled.heighted.completion.externalWordData - pairing unions powers separation infinite hI hP hG hr hμ hA⟩ - -theorem exists_groundInitialExternalGroup - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, - GroundExternalWordData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalGroupData M G (externalChildLetters I P (externalRectangles P G r μ A)) - m inv one := by - dsimp only - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, compression, words⟩ := - M.exists_groundInitialExternalWordData pairing unions powers separation collection infinite choice - hP hG hr hμ hA hLabels group action meet hτ top hC hD hrD hc hOriginal - originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember - priorSpace priorOrder priorMeet priorBirth priorHeight - exact ⟨hI, hSources, hFilters, hT, Reps, hReps, compression, words, - M.externalGroupData pairing unions powers separation infinite group hG words.letters_ground hm hInv⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialCompressionPrefix + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround + +open SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem finiteWords_subset_powerset (A : ZFSet.{u}) : + M.finiteWords A ⊆ ZFSet.powerset (ZFSet.prod ZFSet.omega A) := by + intro f hf + have relation := (ZFSet.mem_sep.1 hf).1 + exact ZFSet.mem_powerset.2 ((M.mem_groundRelations ZFSet.omega A f).1 relation).2 + +theorem finiteWords_rank_le (A : ZFSet.{u}) : + ZFSet.rank (M.finiteWords A) ≤ Order.succ (ZFSet.rank (ZFSet.prod ZFSet.omega A)) := by + have bound := ZFSet.rank_mono (M.finiteWords_subset_powerset A) + rwa [ZFSet.rank_powerset] at bound + +theorem finiteWords_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) {A : ZFSet.{u}} + (omega : ZFSet.rank ZFSet.omega < o) (alphabet : ZFSet.rank A < o) : + ZFSet.rank (M.finiteWords A) < o := + (M.finiteWords_rank_le A).trans_lt (limit.succ_lt (rank_product_lt limit omega alphabet)) + +end TransitiveGround + +section +open SetFormula +universe u + +noncomputable def externalRequestAlphabet (I P G r μ A : ZFSet.{u}) : ZFSet.{u} := + externalGeneratorAlphabet G (externalChildLetters I P (externalRectangles P G r μ A)) + +structure GroundExternalWordData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P r μ A : ZFSet.{u}) + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) : Prop where + rectangles_ground : externalRectangles P G r μ A ∈ M.sets + requests_ground : externalRequestCarrier I P (externalRectangles P G r μ A) ∈ M.sets + letters_ground : externalChildLetters I P (externalRectangles P G r μ A) ∈ M.sets + kinds_ground : externalRequestKinds I P (externalRectangles P G r μ A) ∈ M.sets + payloads_ground : externalRequestPayloads I P (externalRectangles P G r μ A) ∈ M.sets + kinds_function : FunctionGraphOn (externalRequestCarrier I P (externalRectangles P G r μ A)) + (externalRequestKinds I P (externalRectangles P G r μ A)) + payloads_function : FunctionGraphOn (externalRequestCarrier I P (externalRectangles P G r μ A)) + (externalRequestPayloads I P (externalRectangles P G r μ A)) + maps_ground : completion.externalMaps ∈ M.sets + caps_ground : completion.externalCaps ∈ M.sets + maps_function : FunctionGraphOn (ZFSet.prod {natSetCode 0} I) completion.externalMaps + caps_function : ZFSet.IsFunc (ZFSet.prod {natSetCode 0} I) + (completion.algebra.union.fields 0) completion.externalCaps + alphabet_ground : externalRequestAlphabet I P G r μ A ∈ M.sets + words_ground : M.finiteWords (externalRequestAlphabet I P G r μ A) ∈ M.sets + append_ground : M.finiteWordAppendGraph (externalRequestAlphabet I P G r μ A) ∈ M.sets + reverse_ground : M.finiteWordReverseGraph (externalRequestAlphabet I P G r μ A) ∈ M.sets + length_ground : M.finiteWordLengthGraph (externalRequestAlphabet I P G r μ A) ∈ M.sets + append_function : ZFSet.IsFunc + (ZFSet.prod (M.finiteWords (externalRequestAlphabet I P G r μ A)) + (M.finiteWords (externalRequestAlphabet I P G r μ A))) + (M.finiteWords (externalRequestAlphabet I P G r μ A)) + (M.finiteWordAppendGraph (externalRequestAlphabet I P G r μ A)) + reverse_function : ZFSet.IsFunc (M.finiteWords (externalRequestAlphabet I P G r μ A)) + (M.finiteWords (externalRequestAlphabet I P G r μ A)) + (M.finiteWordReverseGraph (externalRequestAlphabet I P G r μ A)) + length_function : ZFSet.IsFunc (M.finiteWords (externalRequestAlphabet I P G r μ A)) ZFSet.omega + (M.finiteWordLengthGraph (externalRequestAlphabet I P G r μ A)) + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P r μ A : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +theorem externalWordData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hG : G ∈ M.sets) + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) : + GroundExternalWordData M initial I Sources Reps G m one T τ P r μ A completion := by + obtain ⟨rectangles, requests, letters, kinds, payloads, kindFunction, payloadFunction⟩ := + M.groundExternalRequestData pairing unions powers separation hI hP hG hr hμ hA + obtain ⟨maps, caps, mapFunction, capFunction⟩ := + completion.external_fields_ground pairing unions powers separation hI + have alphabet : externalRequestAlphabet I P G r μ A ∈ M.sets := + M.externalGeneratorAlphabet_mem pairing unions powers separation hG letters + exact { + rectangles_ground := rectangles + requests_ground := requests + letters_ground := letters + kinds_ground := kinds + payloads_ground := payloads + kinds_function := kindFunction + payloads_function := payloadFunction + maps_ground := maps + caps_ground := caps + maps_function := mapFunction + caps_function := capFunction + alphabet_ground := alphabet + words_ground := M.finiteWords_mem pairing unions powers separation infinite alphabet + append_ground := M.finiteWordAppendGraph_mem pairing unions powers separation infinite alphabet + reverse_ground := M.finiteWordReverseGraph_mem pairing unions powers separation infinite alphabet + length_ground := M.finiteWordLengthGraph_mem pairing unions powers separation infinite alphabet + append_function := M.finiteWordAppendGraph_function pairing unions separation infinite alphabet + reverse_function := M.finiteWordReverseGraph_function pairing unions separation infinite alphabet + length_function := M.finiteWordLengthGraph_function _ } + +end GroundCompressionCompletion + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialExternalWordData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, + GroundExternalWordData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion := by + dsimp only + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, compression⟩ := + M.exists_groundInitialCompressionPrefix pairing unions powers separation collection infinite choice + hP hG hr hμ hA hLabels group action meet hτ top hC hD hrD hc hOriginal + originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember + priorSpace priorOrder priorMeet priorBirth priorHeight + obtain ⟨compression⟩ := compression + exact ⟨hI, hSources, hFilters, hT, Reps, hReps, compression, + compression.born.profiled.heighted.completion.externalWordData + pairing unions powers separation infinite hI hP hG hr hμ hA⟩ + +theorem exists_groundInitialExternalGroup + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, + GroundExternalWordData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalGroupData M G (externalChildLetters I P (externalRectangles P G r μ A)) + m inv one := by + dsimp only + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, compression, words⟩ := + M.exists_groundInitialExternalWordData pairing unions powers separation collection infinite choice + hP hG hr hμ hA hLabels group action meet hτ top hC hD hrD hc hOriginal + originalCode columns target above coordinateInjection originalSmall hBase prior ordinal baseMember + priorSpace priorOrder priorMeet priorBirth priorHeight + exact ⟨hI, hSources, hFilters, hT, Reps, hReps, compression, words, + M.externalGroupData pairing unions powers separation infinite group hG words.letters_ground hm hInv⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalHeights.lean index cdea6b21f39af0ce0b3d3c40bad665ea0e1d544e..796ef65994c32fc112328ef3c30fbee6b1910643 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialExternalHeights.lean @@ -1,264 +1,264 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedExternalBirths - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite -include pairing unions powers separation collection infinite choice - -theorem exists_externalColumns {K : ZFSet.{u}} (hK : K ∈ M.sets) - (subset : K ⊆ C) (small : M.groundEmbeddable K ZFSet.omega) : - Nonempty (GroundExternalColumnData M C K) := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have omega := M.omega_mem separation infinite - obtain ⟨base, hBase, above⟩ := M.groundOmegaOne_countable_bound - pairing unions powers separation collection infinite choice hK subset small - obtain ⟨sequence, hSequence, _, _, _, stamps⟩ := M.exists_groundCompressionStamps - pairing unions separation collection infinite (M.transitive spec.1 hBase) ((spec.2.2.1 base).1 hBase).2.1 - have valueMember (n : Nat) : compressionStamp base n ∈ C := by - induction n with - | zero => exact M.groundOmegaOne_successor pairing unions powers separation collection infinite hBase - | succ n ih => exact M.groundOmegaOne_successor pairing unions powers separation collection infinite ih - have function : ZFSet.IsFunc ZFSet.omega C sequence := by - refine ⟨?_, stamps.function.2⟩ - intro z hz - obtain ⟨n, hn, a, _, rfl⟩ := ZFSet.mem_prod.1 (stamps.function.1 hz) - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, (stamps.entries n a).1 hz ▸ valueMember n⟩ - have injection := successorColumnGraph_injection function stamps.entries - have rangeGround := M.relationImage_mem separation omega spec.1 hSequence - have inverseGround := M.relationConverse_mem pairing unions powers separation omega spec.1 hSequence - have rangeSmall : M.groundEmbeddable (relationImage ZFSet.omega C sequence) ZFSet.omega := - ⟨relationConverse ZFSet.omega C sequence, inverseGround, injection.converse_image⟩ - obtain ⟨cap, hCap, bounded⟩ := M.groundOmegaOne_countable_bound - pairing unions powers separation collection infinite choice rangeGround - (fun _ hz => ((mem_relationImage _ _ _ _).1 hz).1) rangeSmall - refine ⟨⟨base, sequence, cap, hSequence, - ⟨function, stamps.entries, hBase, hCap, above, ?_⟩, - rangeGround, inverseGround, injection.converse_image⟩⟩ - intro n - exact bounded _ ((mem_relationImage _ _ _ _).2 - ⟨valueMember n, natSetCode n, natSetCode_mem_omega n, (stamps.entries n _).2 rfl⟩) - -theorem exists_externalHeightColumns {P D old : ZFSet.{u}} - (hP : P ∈ M.sets) (hD : D ∈ M.sets) (hOld : old ∈ M.sets) - (small : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) : - Nonempty (GroundExternalColumnData M C (heightColumns P C D old)) := by - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - exact M.exists_externalColumns pairing unions powers separation collection infinite choice - (M.heightColumns_mem pairing unions powers separation hP hC hD hOld) - (fun _ hz => ((mem_relationImage _ _ _ _).1 hz).1) - (M.heightColumns_countable pairing unions powers separation infinite choice hP hC hD hOld small) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 C D rD lo hi original : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) -variable (ordinal : ordinalSetProperty C) -variable (heights : GroundCompressionHeightData M initial I Sources Reps G m one T completion.algebra.union P0 C D rD original) -variable (localHeights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi completion) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "old" => completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height -local notation "V" => M.externalStarVertices G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) - (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one -variable (columns : GroundExternalColumnData M C - (heightColumns (completion.externalSeedCarrier P0 r0 μ0 A0) C D - (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height))) -include data group oldAction pairing unions powers separation infinite choice hG hP0 hC hD ordinal heights localHeights columns - -theorem externalHeightData_of_families (coordinateSmall : M.groundEmbeddable D ZFSet.omega) : - Nonempty (GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi heights.height completion) := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have seed := data.externalSeedHeights_spec group oldAction pairing unions powers separation infinite hG hP0 heights hC hD - have owner := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 - have depth := data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG - have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have coordGround := data.externalTileCoordinates_ground group oldAction pairing unions powers separation infinite hG localHeights hP0 hD - have coordPartial := data.externalTileCoordinates_partial group oldAction pairing unions powers separation infinite hG localHeights hP0 - have coordTotal := data.externalTileCoordinates_owner_total group oldAction pairing unions powers separation infinite hG localHeights - have coordStrict := data.externalTileCoordinates_raw_strict group oldAction pairing unions powers separation infinite hG localHeights - have seedCode := seed.2.2.1 - have subset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 - have heightGround : localHeights.externalHeightGraph C heights.height columns.sequence ∈ M.sets := - M.externalOwnerHeightGraph_mem pairing unions powers separation seed.1 geometry.carrier_ground vertices hC hD - seed.2.1 owner.1 depth.1 columns.sequence_ground coordGround (M.omega_mem separation infinite) - have strict : StrictLexHeightCode B C D (completion.externalPointOrder P0 r0 μ0 A0) - (localHeights.externalHeightGraph C heights.height columns.sequence) rD := by - apply externalOwnerHeightGraph_strictLex subset seedCode owner.2 depth.2 columns.code coordPartial coordTotal - · intro x hx fresh y hy - exact data.externalSeedCarrier_no_new_below group oldAction pairing unions powers separation infinite hG hx fresh hy - · intro x _ _ y _ _ v w n m first second firstDepth secondDepth lower - exact (data.externalStarOwner_order group oldAction pairing unions powers separation infinite hG - lower first second firstDepth secondDepth).1 - · intro x _ _ y _ _ v w n first second firstDepth secondDepth lower - exact (data.externalStarOwner_order group oldAction pairing unions powers separation infinite hG - lower first second firstDepth secondDepth).2 rfl - · exact coordStrict - have rangeSmall := M.externalOwnerHeightGraph_range_small pairing unions powers separation infinite choice - seed.1 geometry.carrier_ground hC hD seed.2.1 columns.sequence_ground heightGround seedCode.function - seed.2.2.2.2 ⟨_, columns.inverse_ground, columns.inverse_code⟩ coordinateSmall - refine ⟨{ - localHeights := localHeights - columns := columns - height_ground := heightGround - code := strict - range_ground := rangeSmall.1 - range_countable := rangeSmall.2 - preserves_seed := ?_ - below_cap := ?_ }⟩ - · intro x y z copied - have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) - have hy : y ∈ P := (mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, copied⟩ - exact (externalOwnerHeightGraph_old hy).trans (pushedHeightGraph_entry embedding.injection heights.code.function copied) - · intro x a d entry - rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with retained | fresh - · have below := columns.code.old_below (mem_heightColumns_of_entry seedCode.function retained) 0 - exact ordinal.2 columns.cap columns.code.cap_mem (compressionStamp columns.base 0) - (columns.code.cap_bound 0) a below - · obtain ⟨_, _, _, _, n, hn, a', _, d', _, equal, _, _, column, _⟩ := fresh - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact (columns.code.entries n a).1 column ▸ columns.code.cap_bound n - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 D rD lo hi original c : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (heights : GroundCompressionHeightData M initial I Sources Reps G m one T - completion.algebra.union P0 (M.groundOmegaOne pairing unions powers separation collection infinite) D rD original) -variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) -variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) -variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) -include data group oldAction pairing unions powers separation collection infinite choice hG hP0 - heights target injection hD hrD hc hlo hhi gap - -theorem exists_externalHeight : - Nonempty (GroundExternalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 - (M.groundOmegaOne pairing unions powers separation collection infinite) D rD lo hi - heights.height completion) := by - have omegaOne := M.groundOmegaOne_spec pairing unions powers separation collection infinite - obtain ⟨localHeights⟩ := data.exists_localHeightFamily group oldAction pairing unions powers - separation collection infinite hG hP0 heights omegaOne.2.1 target.toStrictLinearOrderCode - omegaOne.1 hD hrD target injection hD hrD hc hlo hhi gap choice - have seed := data.externalSeedHeights_spec group oldAction pairing unions powers separation infinite - hG hP0 heights omegaOne.1 hD - obtain ⟨columns⟩ := M.exists_externalHeightColumns pairing unions powers separation collection infinite - choice seed.1 hD seed.2.1 seed.2.2.2.2 - exact data.externalHeightData_of_families group oldAction pairing unions powers separation infinite - choice hG hP0 omegaOne.1 hD omegaOne.2.1 heights localHeights columns ⟨c, hc, injection⟩ - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite - -include choice in -theorem exists_groundInitialExternalHeights - {P G r μ A Labels m inv one τ D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ I Sources Reps G m inv one T Filters, - ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, - GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalBoundedGeometryData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ - ∃ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD ∧ - ∃ heights : GroundExternalHeightData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion, - GroundBoundedExternalHeightData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights := by - have omegaOne := M.groundOmegaOne_spec pairing unions powers separation collection infinite - obtain ⟨z, originalEntry, _⟩ := originalCode.function.2 τ hτ - have hz := (ZFSet.pair_mem_prod.1 (originalCode.function.1 originalEntry)).2 - obtain ⟨a, _, lo, hlo, rfl⟩ := ZFSet.mem_prod.1 hz - obtain ⟨hi, hhi, gap⟩ := above lo hlo - dsimp only - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, bounded⟩ := - M.exists_groundInitialExternalBoundedGeometry pairing unions powers separation collection infinite choice - hP hG hr hμ hA hLabels hm hInv group action meet hτ top omegaOne.1 hD hrD hc hOriginal - originalCode omegaOne.2.1 target above coordinateInjection originalSmall hBase prior ordinal baseMember - priorSpace priorOrder priorMeet priorBirth priorHeight - obtain ⟨heights⟩ := data.exists_externalHeight group action pairing unions powers separation collection infinite choice - hG hP compression.born.profiled.heighted.heights target coordinateInjection hD hrD hc hlo hhi gap - exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, bounded, - lo, hlo, hi, hhi, gap, heights, - heights.boundedData pairing unions powers separation infinite geometry omegaOne.1 hD hlo⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBoundedExternalBirths + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite +include pairing unions powers separation collection infinite choice + +theorem exists_externalColumns {K : ZFSet.{u}} (hK : K ∈ M.sets) + (subset : K ⊆ C) (small : M.groundEmbeddable K ZFSet.omega) : + Nonempty (GroundExternalColumnData M C K) := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have omega := M.omega_mem separation infinite + obtain ⟨base, hBase, above⟩ := M.groundOmegaOne_countable_bound + pairing unions powers separation collection infinite choice hK subset small + obtain ⟨sequence, hSequence, _, _, _, stamps⟩ := M.exists_groundCompressionStamps + pairing unions separation collection infinite (M.transitive spec.1 hBase) ((spec.2.2.1 base).1 hBase).2.1 + have valueMember (n : Nat) : compressionStamp base n ∈ C := by + induction n with + | zero => exact M.groundOmegaOne_successor pairing unions powers separation collection infinite hBase + | succ n ih => exact M.groundOmegaOne_successor pairing unions powers separation collection infinite ih + have function : ZFSet.IsFunc ZFSet.omega C sequence := by + refine ⟨?_, stamps.function.2⟩ + intro z hz + obtain ⟨n, hn, a, _, rfl⟩ := ZFSet.mem_prod.1 (stamps.function.1 hz) + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, (stamps.entries n a).1 hz ▸ valueMember n⟩ + have injection := successorColumnGraph_injection function stamps.entries + have rangeGround := M.relationImage_mem separation omega spec.1 hSequence + have inverseGround := M.relationConverse_mem pairing unions powers separation omega spec.1 hSequence + have rangeSmall : M.groundEmbeddable (relationImage ZFSet.omega C sequence) ZFSet.omega := + ⟨relationConverse ZFSet.omega C sequence, inverseGround, injection.converse_image⟩ + obtain ⟨cap, hCap, bounded⟩ := M.groundOmegaOne_countable_bound + pairing unions powers separation collection infinite choice rangeGround + (fun _ hz => ((mem_relationImage _ _ _ _).1 hz).1) rangeSmall + refine ⟨⟨base, sequence, cap, hSequence, + ⟨function, stamps.entries, hBase, hCap, above, ?_⟩, + rangeGround, inverseGround, injection.converse_image⟩⟩ + intro n + exact bounded _ ((mem_relationImage _ _ _ _).2 + ⟨valueMember n, natSetCode n, natSetCode_mem_omega n, (stamps.entries n _).2 rfl⟩) + +theorem exists_externalHeightColumns {P D old : ZFSet.{u}} + (hP : P ∈ M.sets) (hD : D ∈ M.sets) (hOld : old ∈ M.sets) + (small : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) : + Nonempty (GroundExternalColumnData M C (heightColumns P C D old)) := by + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + exact M.exists_externalColumns pairing unions powers separation collection infinite choice + (M.heightColumns_mem pairing unions powers separation hP hC hD hOld) + (fun _ hz => ((mem_relationImage _ _ _ _).1 hz).1) + (M.heightColumns_countable pairing unions powers separation infinite choice hP hC hD hOld small) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 C D rD lo hi original : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) +variable (ordinal : ordinalSetProperty C) +variable (heights : GroundCompressionHeightData M initial I Sources Reps G m one T completion.algebra.union P0 C D rD original) +variable (localHeights : GroundExternalLocalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 D rD lo hi completion) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "old" => completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height +local notation "V" => M.externalStarVertices G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) + (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one +variable (columns : GroundExternalColumnData M C + (heightColumns (completion.externalSeedCarrier P0 r0 μ0 A0) C D + (completion.externalSeedHeight P0 r0 μ0 A0 C D heights.height))) +include data group oldAction pairing unions powers separation infinite choice hG hP0 hC hD ordinal heights localHeights columns + +theorem externalHeightData_of_families (coordinateSmall : M.groundEmbeddable D ZFSet.omega) : + Nonempty (GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi heights.height completion) := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have seed := data.externalSeedHeights_spec group oldAction pairing unions powers separation infinite hG hP0 heights hC hD + have owner := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 + have depth := data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG + have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have coordGround := data.externalTileCoordinates_ground group oldAction pairing unions powers separation infinite hG localHeights hP0 hD + have coordPartial := data.externalTileCoordinates_partial group oldAction pairing unions powers separation infinite hG localHeights hP0 + have coordTotal := data.externalTileCoordinates_owner_total group oldAction pairing unions powers separation infinite hG localHeights + have coordStrict := data.externalTileCoordinates_raw_strict group oldAction pairing unions powers separation infinite hG localHeights + have seedCode := seed.2.2.1 + have subset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 + have heightGround : localHeights.externalHeightGraph C heights.height columns.sequence ∈ M.sets := + M.externalOwnerHeightGraph_mem pairing unions powers separation seed.1 geometry.carrier_ground vertices hC hD + seed.2.1 owner.1 depth.1 columns.sequence_ground coordGround (M.omega_mem separation infinite) + have strict : StrictLexHeightCode B C D (completion.externalPointOrder P0 r0 μ0 A0) + (localHeights.externalHeightGraph C heights.height columns.sequence) rD := by + apply externalOwnerHeightGraph_strictLex subset seedCode owner.2 depth.2 columns.code coordPartial coordTotal + · intro x hx fresh y hy + exact data.externalSeedCarrier_no_new_below group oldAction pairing unions powers separation infinite hG hx fresh hy + · intro x _ _ y _ _ v w n m first second firstDepth secondDepth lower + exact (data.externalStarOwner_order group oldAction pairing unions powers separation infinite hG + lower first second firstDepth secondDepth).1 + · intro x _ _ y _ _ v w n first second firstDepth secondDepth lower + exact (data.externalStarOwner_order group oldAction pairing unions powers separation infinite hG + lower first second firstDepth secondDepth).2 rfl + · exact coordStrict + have rangeSmall := M.externalOwnerHeightGraph_range_small pairing unions powers separation infinite choice + seed.1 geometry.carrier_ground hC hD seed.2.1 columns.sequence_ground heightGround seedCode.function + seed.2.2.2.2 ⟨_, columns.inverse_ground, columns.inverse_code⟩ coordinateSmall + refine ⟨{ + localHeights := localHeights + columns := columns + height_ground := heightGround + code := strict + range_ground := rangeSmall.1 + range_countable := rangeSmall.2 + preserves_seed := ?_ + below_cap := ?_ }⟩ + · intro x y z copied + have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) + have hy : y ∈ P := (mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, copied⟩ + exact (externalOwnerHeightGraph_old hy).trans (pushedHeightGraph_entry embedding.injection heights.code.function copied) + · intro x a d entry + rcases (pair_mem_externalOwnerHeightGraph _ _ _ _ _ _ _ _ _ _ _ _).1 entry with retained | fresh + · have below := columns.code.old_below (mem_heightColumns_of_entry seedCode.function retained) 0 + exact ordinal.2 columns.cap columns.code.cap_mem (compressionStamp columns.base 0) + (columns.code.cap_bound 0) a below + · obtain ⟨_, _, _, _, n, hn, a', _, d', _, equal, _, _, column, _⟩ := fresh + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact (columns.code.entries n a).1 column ▸ columns.code.cap_bound n + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 D rD lo hi original c : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (heights : GroundCompressionHeightData M initial I Sources Reps G m one T + completion.algebra.union P0 (M.groundOmegaOne pairing unions powers separation collection infinite) D rD original) +variable (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) +variable (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) +variable (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) +include data group oldAction pairing unions powers separation collection infinite choice hG hP0 + heights target injection hD hrD hc hlo hhi gap + +theorem exists_externalHeight : + Nonempty (GroundExternalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 + (M.groundOmegaOne pairing unions powers separation collection infinite) D rD lo hi + heights.height completion) := by + have omegaOne := M.groundOmegaOne_spec pairing unions powers separation collection infinite + obtain ⟨localHeights⟩ := data.exists_localHeightFamily group oldAction pairing unions powers + separation collection infinite hG hP0 heights omegaOne.2.1 target.toStrictLinearOrderCode + omegaOne.1 hD hrD target injection hD hrD hc hlo hhi gap choice + have seed := data.externalSeedHeights_spec group oldAction pairing unions powers separation infinite + hG hP0 heights omegaOne.1 hD + obtain ⟨columns⟩ := M.exists_externalHeightColumns pairing unions powers separation collection infinite + choice seed.1 hD seed.2.1 seed.2.2.2.2 + exact data.externalHeightData_of_families group oldAction pairing unions powers separation infinite + choice hG hP0 omegaOne.1 hD omegaOne.2.1 heights localHeights columns ⟨c, hc, injection⟩ + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite + +include choice in +theorem exists_groundInitialExternalHeights + {P G r μ A Labels m inv one τ D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ I Sources Reps G m inv one T Filters, + ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, + GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalBoundedGeometryData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ + ∃ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD ∧ + ∃ heights : GroundExternalHeightData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion, + GroundBoundedExternalHeightData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights := by + have omegaOne := M.groundOmegaOne_spec pairing unions powers separation collection infinite + obtain ⟨z, originalEntry, _⟩ := originalCode.function.2 τ hτ + have hz := (ZFSet.pair_mem_prod.1 (originalCode.function.1 originalEntry)).2 + obtain ⟨a, _, lo, hlo, rfl⟩ := ZFSet.mem_prod.1 hz + obtain ⟨hi, hhi, gap⟩ := above lo hlo + dsimp only + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, bounded⟩ := + M.exists_groundInitialExternalBoundedGeometry pairing unions powers separation collection infinite choice + hP hG hr hμ hA hLabels hm hInv group action meet hτ top omegaOne.1 hD hrD hc hOriginal + originalCode omegaOne.2.1 target above coordinateInjection originalSmall hBase prior ordinal baseMember + priorSpace priorOrder priorMeet priorBirth priorHeight + obtain ⟨heights⟩ := data.exists_externalHeight group action pairing unions powers separation collection infinite choice + hG hP compression.born.profiled.heighted.heights target coordinateInjection hD hrD hc hlo hhi gap + exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, bounded, + lo, hlo, hi, hhi, gap, heights, + heights.boundedData pairing unions powers separation infinite geometry omegaOne.1 hD hlo⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialLiftEmbeddings.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialLiftEmbeddings.lean index 7522a36ccad7c1520238c022ac44aad423dc99f6..52b412c53fd754ab17e02736b90e2882440df1d5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialLiftEmbeddings.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialLiftEmbeddings.lean @@ -1,58 +1,58 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.InitialRecursiveTaskLaws -import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveNextMapInputs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialLiftEmbeddings - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - ∃ Reps ∈ M.sets, ∃ h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B, - ∃ next : h.NextInputs M, - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ - h.liftGraph M next ∈ M.sets ∧ - ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ - h.groundLiftFamily M next ∈ M.sets ∧ FunctionGraphOn I (h.groundLiftFamily M next) ∧ - (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ - ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → - MeetEmbeddingCode d.batchCarrier next.batchCarrier d.batchOrder next.batchOrder - d.batchMeetGraph next.batchMeetGraph f ∧ - ∀ a g x y, ZFSet.pair i a ∈ As → ZFSet.pair i g ∈ Reps → - x ∈ d.batchCarrier → ZFSet.pair x a ∈ d.batchOrder → - (ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ B) := by - obtain ⟨hI, hSources, hMaps, hB, Reps, hReps, inputs⟩ := M.exists_groundInitialRecursiveInputs - pairing unions powers separation choice hP hG hr hμ hA hLabels group action meet - obtain ⟨_, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - exact ⟨Reps, hReps, inputs, inputs.exists_groundLiftEmbeddings M pairing unions powers separation - hI hI hP hr hQs hrs hμs (fields 0).1 (fields 2).1 (fields 4).1 (fields 3).1 - hMaps hSources hReps hG hB⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.InitialRecursiveTaskLaws +import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveNextMapInputs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialLiftEmbeddings + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + ∃ Reps ∈ M.sets, ∃ h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B, + ∃ next : h.NextInputs M, + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ + h.liftGraph M next ∈ M.sets ∧ + ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ + h.groundLiftFamily M next ∈ M.sets ∧ FunctionGraphOn I (h.groundLiftFamily M next) ∧ + (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ + ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → + MeetEmbeddingCode d.batchCarrier next.batchCarrier d.batchOrder next.batchOrder + d.batchMeetGraph next.batchMeetGraph f ∧ + ∀ a g x y, ZFSet.pair i a ∈ As → ZFSet.pair i g ∈ Reps → + x ∈ d.batchCarrier → ZFSet.pair x a ∈ d.batchOrder → + (ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ B) := by + obtain ⟨hI, hSources, hMaps, hB, Reps, hReps, inputs⟩ := M.exists_groundInitialRecursiveInputs + pairing unions powers separation choice hP hG hr hμ hA hLabels group action meet + obtain ⟨_, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + exact ⟨Reps, hReps, inputs, inputs.exists_groundLiftEmbeddings M pairing unions powers separation + hI hI hP hr hQs hrs hμs (fields 0).1 (fields 2).1 (fields 4).1 (fields 3).1 + hMaps hSources hReps hG hB⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialMainAlgebra.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialMainAlgebra.lean index 45f0b7775a19192b4cce708b36fe5be75ab63424..2a5f62ff8adf0d55f072bd3ce7fd6aa02c8ce645 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialMainAlgebra.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialMainAlgebra.lean @@ -1,44 +1,44 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.InitialMainAlgebraCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula InitialMainAlgebra -universe u -variable (M : TransitiveGround.{u}) - -theorem initialMainAlgebra_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) : - carrier ∈ M.sets ∧ actors ∈ M.sets ∧ order ∈ M.sets ∧ meetGraph ∈ M.sets ∧ - multiplication ∈ M.sets ∧ inverse ∈ M.sets ∧ action ∈ M.sets := by - have h0 := M.natSetCode_mem separation infinite 0 - have h1 := M.natSetCode_mem separation infinite 1 - have h2 := M.natSetCode_mem separation infinite 2 - have p00 := M.orderedPair_mem pairing h0 h0 - have p01 := M.orderedPair_mem pairing h0 h1 - have p10 := M.orderedPair_mem pairing h1 h0 - have p11 := M.orderedPair_mem pairing h1 h1 - have m000 := M.orderedPair_mem pairing p00 h0 - have m010 := M.orderedPair_mem pairing p01 h0 - have m100 := M.orderedPair_mem pairing p10 h0 - have m111 := M.orderedPair_mem pairing p11 h1 - have a011 := M.orderedPair_mem pairing p01 h1 - refine ⟨h2, h1, ?_, ?_, ?_, ?_, ?_⟩ - · exact M.insert_mem pairing unions p00 (M.unorderedPair_mem pairing p01 p11) - · exact M.insert_mem pairing unions m000 - (M.insert_mem pairing unions m010 (M.unorderedPair_mem pairing m100 m111)) - · simpa only [multiplication, identity, bottom, ZFSet.pair_eq_singleton] using - M.unorderedPair_mem pairing m000 m000 - · simpa only [inverse, identity, bottom, ZFSet.pair_eq_singleton] using - M.unorderedPair_mem pairing p00 p00 - · exact M.unorderedPair_mem pairing m000 a011 - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.InitialMainAlgebraCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula InitialMainAlgebra +universe u +variable (M : TransitiveGround.{u}) + +theorem initialMainAlgebra_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) : + carrier ∈ M.sets ∧ actors ∈ M.sets ∧ order ∈ M.sets ∧ meetGraph ∈ M.sets ∧ + multiplication ∈ M.sets ∧ inverse ∈ M.sets ∧ action ∈ M.sets := by + have h0 := M.natSetCode_mem separation infinite 0 + have h1 := M.natSetCode_mem separation infinite 1 + have h2 := M.natSetCode_mem separation infinite 2 + have p00 := M.orderedPair_mem pairing h0 h0 + have p01 := M.orderedPair_mem pairing h0 h1 + have p10 := M.orderedPair_mem pairing h1 h0 + have p11 := M.orderedPair_mem pairing h1 h1 + have m000 := M.orderedPair_mem pairing p00 h0 + have m010 := M.orderedPair_mem pairing p01 h0 + have m100 := M.orderedPair_mem pairing p10 h0 + have m111 := M.orderedPair_mem pairing p11 h1 + have a011 := M.orderedPair_mem pairing p01 h1 + refine ⟨h2, h1, ?_, ?_, ?_, ?_, ?_⟩ + · exact M.insert_mem pairing unions p00 (M.unorderedPair_mem pairing p01 p11) + · exact M.insert_mem pairing unions m000 + (M.insert_mem pairing unions m010 (M.unorderedPair_mem pairing m100 m111)) + · simpa only [multiplication, identity, bottom, ZFSet.pair_eq_singleton] using + M.unorderedPair_mem pairing m000 m000 + · simpa only [inverse, identity, bottom, ZFSet.pair_eq_singleton] using + M.unorderedPair_mem pairing p00 p00 + · exact M.unorderedPair_mem pairing m000 a011 + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedMatchedSerialization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedMatchedSerialization.lean index 37cb215fdf5a87760a803c0030b33993aa08e467..46dabce9c589fb0696eb0795d7d411ba8e869f60 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedMatchedSerialization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedMatchedSerialization.lean @@ -1,42 +1,42 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundInitialMainSeedData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} -variable (seed : GroundInitialMainSeedData M K C) - -theorem exists_matchedInitialSerialization - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : - ∃ serial : GroundSerializedChronology M (insert seed.source.cutoff seed.source.cutoff) - C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), - serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ - ∀ j t, t ∈ insert seed.source.cutoff seed.source.cutoff → - serial.fields.value j t = seed.source.history.fieldValue j t := by - obtain ⟨injection, _, injected, hInjection, ground, rank, _⟩ := - seed.exists_rankedInitialSerialization pairing unions powers separation infinite hK conditions - let original := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected - have timeEq : (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u}) = insert seed.source.cutoff seed.source.cutoff := - congrArg (fun t => insert t t) seed.cutoff_zero.symm - let serial := original.castTime timeEq - refine ⟨serial, ?_, ?_, ?_⟩ - · exact (original.castTime_code timeEq).symm ▸ ground - · exact (congrArg ZFSet.rank (original.castTime_code timeEq)).symm ▸ rank - · intro j t ht - have zeroDomain : t ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u}) := timeEq.symm ▸ ht - exact (original.castTime_value timeEq j t).trans - (seed.initialSerialization_agreement pairing unions powers separation hInjection injected j t zeroDomain) - -end PartitionPilot.Forcing.GroundInitialMainSeedData - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundInitialMainSeedData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} +variable (seed : GroundInitialMainSeedData M K C) + +theorem exists_matchedInitialSerialization + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : + ∃ serial : GroundSerializedChronology M (insert seed.source.cutoff seed.source.cutoff) + C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), + serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ + ∀ j t, t ∈ insert seed.source.cutoff seed.source.cutoff → + serial.fields.value j t = seed.source.history.fieldValue j t := by + obtain ⟨injection, _, injected, hInjection, ground, rank, _⟩ := + seed.exists_rankedInitialSerialization pairing unions powers separation infinite hK conditions + let original := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected + have timeEq : (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u}) = insert seed.source.cutoff seed.source.cutoff := + congrArg (fun t => insert t t) seed.cutoff_zero.symm + let serial := original.castTime timeEq + refine ⟨serial, ?_, ?_, ?_⟩ + · exact (original.castTime_code timeEq).symm ▸ ground + · exact (congrArg ZFSet.rank (original.castTime_code timeEq)).symm ▸ rank + · intro j t ht + have zeroDomain : t ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u}) := timeEq.symm ▸ ht + exact (original.castTime_value timeEq j t).trans + (seed.initialSerialization_agreement pairing unions powers separation hInjection injected j t zeroDomain) + +end PartitionPilot.Forcing.GroundInitialMainSeedData + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedSerializationRanks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedSerializationRanks.lean index 5c991451d2ad317b85a5335f23ade4a609fccacb..bc7f36f0ab560725fb247b28a605826aee297c82 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedSerializationRanks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInitialSeedSerializationRanks.lean @@ -1,278 +1,278 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialMainStage -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageInvariant - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -open scoped ZFSet -universe u - -theorem fractionCarrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (omega : ZFSet.rank ZFSet.omega < o) : ZFSet.rank (fractionCarrier.{u}) < o := by - have subset : fractionCarrier.{u} ⊆ ZFSet.prod ZFSet.omega ZFSet.omega := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.mem_sep.1 hy).1⟩ - exact (ZFSet.rank_mono subset).trans_lt (rank_product_lt limit omega omega) - -theorem rationalCarrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (c : ZFSet.{u}) (omega : ZFSet.rank ZFSet.omega < o) : - ZFSet.rank (rationalCarrier c) < o := - (ZFSet.rank_mono (rationalCarrier_subset c)).trans_lt (fractionCarrier_rank_lt limit omega) - -theorem rationalLtGraph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (c : ZFSet.{u}) (omega : ZFSet.rank ZFSet.omega < o) : - ZFSet.rank (rationalLtGraph c) < o := - (ZFSet.rank_mono (rationalLtGraph_subset c)).trans_lt - (rank_product_lt limit (rationalCarrier_rank_lt limit c omega) - (rationalCarrier_rank_lt limit c omega)) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem rational_seed_pair {c : ZFSet.{u}} - (carrier : rationalCarrier c ∈ M.sets) (code : InjectionCode fractionCarrier ZFSet.omega c) : - ∃ d0 ∈ M.sets, ∃ d1 ∈ M.sets, - d0 ∈ rationalCarrier c ∧ d1 ∈ rationalCarrier c ∧ ZFSet.pair d0 d1 ∈ rationalLtGraph c := by - obtain ⟨d0, h0⟩ := rationalCarrier_nonempty code - obtain ⟨d1, h1, gap⟩ := (rational_no_endpoints code d0 h0).2 - exact ⟨d0, M.transitive carrier h0, d1, M.transitive carrier h1, h0, h1, gap⟩ - -theorem exists_groundRationalSeed - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : - ∃ c ∈ M.sets, InjectionCode fractionCarrier ZFSet.omega c ∧ - rationalCarrier c ∈ M.sets ∧ rationalLtGraph c ∈ M.sets ∧ - ∃ f ∈ M.sets, InjectionCode (rationalCarrier c) ZFSet.omega f ∧ - DenseOrderCode (rationalCarrier c) (rationalLtGraph c) ∧ - ZFSet.rank (rationalCarrier c) < ZFSet.rank K ∧ - ZFSet.rank (rationalLtGraph c) < ZFSet.rank K ∧ - (∀ x ∈ rationalCarrier c, - (∃ y ∈ rationalCarrier c, ZFSet.pair y x ∈ rationalLtGraph c) ∧ - (∃ y ∈ rationalCarrier c, ZFSet.pair x y ∈ rationalLtGraph c)) ∧ - ∃ d0 ∈ M.sets, ∃ d1 ∈ M.sets, - d0 ∈ rationalCarrier c ∧ d1 ∈ rationalCarrier c ∧ ZFSet.pair d0 d1 ∈ rationalLtGraph c := by - obtain ⟨c, hc, code⟩ := M.fractionCarrier_countable pairing unions powers separation infinite - have carrier := M.rationalCarrier_mem pairing unions powers separation infinite hc - have relation := M.rationalLtGraph_mem pairing unions powers separation infinite hc - have injection := M.canonicalRepresentativesInjection_mem separation - (M.fractionCarrier_mem pairing unions powers separation infinite) - (M.fractionEquivGraph_mem pairing unions powers separation infinite) hc - (M.omega_mem separation infinite) - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - have omega := ZFSet.rank_lt_of_mem conditions.2.1 - exact ⟨c, hc, code, carrier, relation, - canonicalRepresentativesInjection fractionCarrier fractionEquivGraph c, injection, - canonicalRepresentativesInjection_code code, rational_denseOrderCode code, - rationalCarrier_rank_lt limit c omega, rationalLtGraph_rank_lt limit c omega, - rational_no_endpoints code, M.rational_seed_pair carrier code⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing -open SetFormula -open scoped ZFSet -universe u - -structure GroundInitialMainSeedData (M : TransitiveGround.{u}) (K C : ZFSet.{u}) where - fractionCode : ZFSet.{u} - fraction_ground : fractionCode ∈ M.sets - fraction_injection : InjectionCode fractionCarrier ZFSet.omega fractionCode - coordinateInjection : ZFSet.{u} - injection_ground : coordinateInjection ∈ M.sets - injection_code : InjectionCode (rationalCarrier fractionCode) ZFSet.omega coordinateInjection - dense : DenseOrderCode (rationalCarrier fractionCode) (rationalLtGraph fractionCode) - no_endpoints : ∀ x ∈ rationalCarrier fractionCode, - (∃ y ∈ rationalCarrier fractionCode, ZFSet.pair y x ∈ rationalLtGraph fractionCode) ∧ - (∃ y ∈ rationalCarrier fractionCode, ZFSet.pair x y ∈ rationalLtGraph fractionCode) - lo : ZFSet.{u} - hi : ZFSet.{u} - lo_mem : lo ∈ rationalCarrier fractionCode - hi_mem : hi ∈ rationalCarrier fractionCode - gap : ZFSet.pair lo hi ∈ rationalLtGraph fractionCode - source : GroundChronologicalMainStage M C (rationalCarrier fractionCode) (rationalLtGraph fractionCode) - points_eq : source.stage.carrier = natSetCode 2 - actors_eq : source.stage.actors = natSetCode 1 - bottom_eq : source.stage.bottom = natSetCode 0 - top_eq : source.stage.top = natSetCode 1 - stage_code : source.stage.code = mainStageCode InitialMainAlgebra.carrier InitialMainAlgebra.order - InitialMainAlgebra.meetGraph InitialMainAlgebra.actors InitialMainAlgebra.multiplication - InitialMainAlgebra.inverse InitialMainAlgebra.identity InitialMainAlgebra.action - InitialMainAlgebra.bottom InitialMainAlgebra.top - (twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top ∅ lo hi) - cutoff_zero : source.cutoff = ∅ - birth_eq : source.birth = constantFamilyGraph (natSetCode 2) ∅ - invariant : source.Invariant K C - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) - -theorem initialMainChronological_invariant {K C D rD c d0 d1 Labels : ZFSet.{u}} - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) (gap : ZFSet.pair d0 d1 ∈ rD) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (labels : GroundBelow M Labels K) (labelRank : ZFSet.rank Labels < ZFSet.rank K) - (columnRank : ZFSet.rank C < ZFSet.rank K) (coordinateRank : ZFSet.rank D < ZFSet.rank K) : - (M.initialMainChronological pairing unions powers separation infinite hC hD hrD hc h0 h1 gap).Invariant K Labels := by - have points := conditions.finite_seed_bounds pairing unions powers separation infinite hK 2 - have actors := conditions.finite_seed_bounds pairing unions powers separation infinite hK 1 - have zero : (∅ : ZFSet.{u}) ∈ K := - conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega 0) - exact ⟨points.2.2.1, actors.2.2.1, labels, points.2.2.2, actors.2.2.2, - labelRank, zero, columnRank, coordinateRank⟩ - -theorem exists_groundInitialMainSeed (collection : CollectionSchema M.sets) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : - Nonempty (GroundInitialMainSeedData M K - (M.groundOmegaOne pairing unions powers separation collection infinite)) := by - obtain ⟨c, hc, fraction, hD, hrD, f, hf, injection, dense, rankD, _rankR, endpoints, - lo, _hlo, hi, _hhi, loMem, hiMem, gap⟩ := - M.exists_groundRationalSeed pairing unions powers separation infinite hK conditions - let C := M.groundOmegaOne pairing unions powers separation collection infinite - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have column : (∅ : ZFSet.{u}) ∈ C := (spec.2.2.1 ∅).2 - ⟨M.empty_mem ⟨C, spec.1⟩, ordinalSetProperty_empty, - M.empty_groundEmbeddable ZFSet.omega ⟨C, spec.1⟩⟩ - have labelSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have columnRank := ZFSet.rank_lt_of_mem - (conditions.groundOmegaOne_mem pairing unions powers separation collection infinite hK) - let source := M.initialMainChronological pairing unions powers separation infinite - spec.1 hD hrD column loMem hiMem gap - exact ⟨{ - fractionCode := c - fraction_ground := hc - fraction_injection := fraction - coordinateInjection := f - injection_ground := hf - injection_code := injection - dense := dense - no_endpoints := endpoints - lo := lo - hi := hi - lo_mem := loMem - hi_mem := hiMem - gap := gap - source := source - points_eq := rfl - actors_eq := rfl - bottom_eq := rfl - top_eq := rfl - stage_code := rfl - cutoff_zero := rfl - birth_eq := rfl - invariant := M.initialMainChronological_invariant pairing unions powers separation infinite - spec.1 hD hrD column loMem hiMem gap hK conditions labelSize columnRank columnRank rankD }⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -open scoped ZFSet -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialMainSeedSerialized - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ seed : GroundInitialMainSeedData M K C, - ∃ serial : GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) - C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), - serial.code ∈ M.sets ∧ serial.fields.graph = seed.source.stage.initialChronologyGraph ∧ - serial.toHistory.space ∅ = seed.source.stage.carrier ∧ - serial.toHistory.order ∅ = seed.source.stage.order ∧ - serial.toHistory.meetGraph ∅ = seed.source.stage.meetGraph ∧ - serial.toHistory.birth ∅ = seed.source.birth ∧ - serial.toHistory.height ∅ = seed.source.stage.height := by - dsimp only - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite - collection hK conditions - have small : M.groundEmbeddable seed.source.stage.carrier ZFSet.omega := by - rw [seed.points_eq] - exact M.natSetCode_countable pairing unions powers separation infinite 2 - obtain ⟨serial, ground, graph, carrier, order, meet, birth, height⟩ := - seed.source.stage.exists_initialSerializedChronology pairing unions powers separation small - have birthEq : seed.source.stage.initialBirth = seed.source.birth := by - rw [GroundMainStage.initialBirth, seed.points_eq, seed.birth_eq] - exact ⟨seed, serial, ground, graph, carrier, order, meet, birth.trans birthEq, height⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -open scoped ZFSet -universe u -namespace GroundInitialMainSeedData -variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} -variable (seed : GroundInitialMainSeedData M K C) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -include infinite hK conditions - -theorem initialSerializedChronology_code_rank_lt {injection : ZFSet.{u}} - (hInjection : injection ∈ M.sets) - (injected : InjectionCode seed.source.stage.carrier ZFSet.omega injection) : - ZFSet.rank (seed.source.stage.initialSerializedChronology pairing unions powers separation - hInjection injected).code < ZFSet.rank K := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - have height := rank_functionGraph_lt limit seed.source.stage.height_code.function - seed.invariant.points_rank (rank_product_lt limit seed.invariant.columns_rank seed.invariant.coordinates_rank) - exact seed.source.stage.initialSerializedChronology_code_rank_lt_inaccessible - pairing unions powers separation hInjection injected infinite hK conditions seed.invariant.points_rank height - -theorem exists_rankedInitialSerialization : - ∃ injection ∈ M.sets, ∃ injected : InjectionCode seed.source.stage.carrier ZFSet.omega injection, - ∃ hInjection : injection ∈ M.sets, - let serial := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected - serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ - serial.fields.graph = seed.source.stage.initialChronologyGraph ∧ - serial.toHistory.space ∅ = seed.source.stage.carrier ∧ - serial.toHistory.order ∅ = seed.source.stage.order ∧ - serial.toHistory.meetGraph ∅ = seed.source.stage.meetGraph ∧ - serial.toHistory.birth ∅ = seed.source.birth ∧ - serial.toHistory.height ∅ = seed.source.stage.height := by - have small : M.groundEmbeddable seed.source.stage.carrier ZFSet.omega := by - rw [seed.points_eq] - exact M.natSetCode_countable pairing unions powers separation infinite 2 - obtain ⟨injection, hInjection, injected⟩ := small - have values := seed.source.stage.initialSerializedChronology_values pairing unions powers separation - hInjection injected (ZFSet.mem_insert _ _) - have birth : seed.source.stage.initialBirth = seed.source.birth := by - rw [GroundMainStage.initialBirth, seed.points_eq, seed.birth_eq] - exact ⟨injection, hInjection, injected, hInjection, - seed.source.stage.initialSerializedChronology_code_ground pairing unions powers separation hInjection injected, - seed.initialSerializedChronology_code_rank_lt pairing unions powers separation infinite hK conditions hInjection injected, - rfl, values.1, values.2.1, values.2.2.1, values.2.2.2.1.trans birth, values.2.2.2.2⟩ - -end GroundInitialMainSeedData -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialMainStage +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageInvariant + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +open scoped ZFSet +universe u + +theorem fractionCarrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (omega : ZFSet.rank ZFSet.omega < o) : ZFSet.rank (fractionCarrier.{u}) < o := by + have subset : fractionCarrier.{u} ⊆ ZFSet.prod ZFSet.omega ZFSet.omega := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.mem_sep.1 hy).1⟩ + exact (ZFSet.rank_mono subset).trans_lt (rank_product_lt limit omega omega) + +theorem rationalCarrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (c : ZFSet.{u}) (omega : ZFSet.rank ZFSet.omega < o) : + ZFSet.rank (rationalCarrier c) < o := + (ZFSet.rank_mono (rationalCarrier_subset c)).trans_lt (fractionCarrier_rank_lt limit omega) + +theorem rationalLtGraph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (c : ZFSet.{u}) (omega : ZFSet.rank ZFSet.omega < o) : + ZFSet.rank (rationalLtGraph c) < o := + (ZFSet.rank_mono (rationalLtGraph_subset c)).trans_lt + (rank_product_lt limit (rationalCarrier_rank_lt limit c omega) + (rationalCarrier_rank_lt limit c omega)) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem rational_seed_pair {c : ZFSet.{u}} + (carrier : rationalCarrier c ∈ M.sets) (code : InjectionCode fractionCarrier ZFSet.omega c) : + ∃ d0 ∈ M.sets, ∃ d1 ∈ M.sets, + d0 ∈ rationalCarrier c ∧ d1 ∈ rationalCarrier c ∧ ZFSet.pair d0 d1 ∈ rationalLtGraph c := by + obtain ⟨d0, h0⟩ := rationalCarrier_nonempty code + obtain ⟨d1, h1, gap⟩ := (rational_no_endpoints code d0 h0).2 + exact ⟨d0, M.transitive carrier h0, d1, M.transitive carrier h1, h0, h1, gap⟩ + +theorem exists_groundRationalSeed + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : + ∃ c ∈ M.sets, InjectionCode fractionCarrier ZFSet.omega c ∧ + rationalCarrier c ∈ M.sets ∧ rationalLtGraph c ∈ M.sets ∧ + ∃ f ∈ M.sets, InjectionCode (rationalCarrier c) ZFSet.omega f ∧ + DenseOrderCode (rationalCarrier c) (rationalLtGraph c) ∧ + ZFSet.rank (rationalCarrier c) < ZFSet.rank K ∧ + ZFSet.rank (rationalLtGraph c) < ZFSet.rank K ∧ + (∀ x ∈ rationalCarrier c, + (∃ y ∈ rationalCarrier c, ZFSet.pair y x ∈ rationalLtGraph c) ∧ + (∃ y ∈ rationalCarrier c, ZFSet.pair x y ∈ rationalLtGraph c)) ∧ + ∃ d0 ∈ M.sets, ∃ d1 ∈ M.sets, + d0 ∈ rationalCarrier c ∧ d1 ∈ rationalCarrier c ∧ ZFSet.pair d0 d1 ∈ rationalLtGraph c := by + obtain ⟨c, hc, code⟩ := M.fractionCarrier_countable pairing unions powers separation infinite + have carrier := M.rationalCarrier_mem pairing unions powers separation infinite hc + have relation := M.rationalLtGraph_mem pairing unions powers separation infinite hc + have injection := M.canonicalRepresentativesInjection_mem separation + (M.fractionCarrier_mem pairing unions powers separation infinite) + (M.fractionEquivGraph_mem pairing unions powers separation infinite) hc + (M.omega_mem separation infinite) + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + have omega := ZFSet.rank_lt_of_mem conditions.2.1 + exact ⟨c, hc, code, carrier, relation, + canonicalRepresentativesInjection fractionCarrier fractionEquivGraph c, injection, + canonicalRepresentativesInjection_code code, rational_denseOrderCode code, + rationalCarrier_rank_lt limit c omega, rationalLtGraph_rank_lt limit c omega, + rational_no_endpoints code, M.rational_seed_pair carrier code⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing +open SetFormula +open scoped ZFSet +universe u + +structure GroundInitialMainSeedData (M : TransitiveGround.{u}) (K C : ZFSet.{u}) where + fractionCode : ZFSet.{u} + fraction_ground : fractionCode ∈ M.sets + fraction_injection : InjectionCode fractionCarrier ZFSet.omega fractionCode + coordinateInjection : ZFSet.{u} + injection_ground : coordinateInjection ∈ M.sets + injection_code : InjectionCode (rationalCarrier fractionCode) ZFSet.omega coordinateInjection + dense : DenseOrderCode (rationalCarrier fractionCode) (rationalLtGraph fractionCode) + no_endpoints : ∀ x ∈ rationalCarrier fractionCode, + (∃ y ∈ rationalCarrier fractionCode, ZFSet.pair y x ∈ rationalLtGraph fractionCode) ∧ + (∃ y ∈ rationalCarrier fractionCode, ZFSet.pair x y ∈ rationalLtGraph fractionCode) + lo : ZFSet.{u} + hi : ZFSet.{u} + lo_mem : lo ∈ rationalCarrier fractionCode + hi_mem : hi ∈ rationalCarrier fractionCode + gap : ZFSet.pair lo hi ∈ rationalLtGraph fractionCode + source : GroundChronologicalMainStage M C (rationalCarrier fractionCode) (rationalLtGraph fractionCode) + points_eq : source.stage.carrier = natSetCode 2 + actors_eq : source.stage.actors = natSetCode 1 + bottom_eq : source.stage.bottom = natSetCode 0 + top_eq : source.stage.top = natSetCode 1 + stage_code : source.stage.code = mainStageCode InitialMainAlgebra.carrier InitialMainAlgebra.order + InitialMainAlgebra.meetGraph InitialMainAlgebra.actors InitialMainAlgebra.multiplication + InitialMainAlgebra.inverse InitialMainAlgebra.identity InitialMainAlgebra.action + InitialMainAlgebra.bottom InitialMainAlgebra.top + (twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top ∅ lo hi) + cutoff_zero : source.cutoff = ∅ + birth_eq : source.birth = constantFamilyGraph (natSetCode 2) ∅ + invariant : source.Invariant K C + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) + +theorem initialMainChronological_invariant {K C D rD c d0 d1 Labels : ZFSet.{u}} + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) (gap : ZFSet.pair d0 d1 ∈ rD) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (labels : GroundBelow M Labels K) (labelRank : ZFSet.rank Labels < ZFSet.rank K) + (columnRank : ZFSet.rank C < ZFSet.rank K) (coordinateRank : ZFSet.rank D < ZFSet.rank K) : + (M.initialMainChronological pairing unions powers separation infinite hC hD hrD hc h0 h1 gap).Invariant K Labels := by + have points := conditions.finite_seed_bounds pairing unions powers separation infinite hK 2 + have actors := conditions.finite_seed_bounds pairing unions powers separation infinite hK 1 + have zero : (∅ : ZFSet.{u}) ∈ K := + conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega 0) + exact ⟨points.2.2.1, actors.2.2.1, labels, points.2.2.2, actors.2.2.2, + labelRank, zero, columnRank, coordinateRank⟩ + +theorem exists_groundInitialMainSeed (collection : CollectionSchema M.sets) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : + Nonempty (GroundInitialMainSeedData M K + (M.groundOmegaOne pairing unions powers separation collection infinite)) := by + obtain ⟨c, hc, fraction, hD, hrD, f, hf, injection, dense, rankD, _rankR, endpoints, + lo, _hlo, hi, _hhi, loMem, hiMem, gap⟩ := + M.exists_groundRationalSeed pairing unions powers separation infinite hK conditions + let C := M.groundOmegaOne pairing unions powers separation collection infinite + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have column : (∅ : ZFSet.{u}) ∈ C := (spec.2.2.1 ∅).2 + ⟨M.empty_mem ⟨C, spec.1⟩, ordinalSetProperty_empty, + M.empty_groundEmbeddable ZFSet.omega ⟨C, spec.1⟩⟩ + have labelSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have columnRank := ZFSet.rank_lt_of_mem + (conditions.groundOmegaOne_mem pairing unions powers separation collection infinite hK) + let source := M.initialMainChronological pairing unions powers separation infinite + spec.1 hD hrD column loMem hiMem gap + exact ⟨{ + fractionCode := c + fraction_ground := hc + fraction_injection := fraction + coordinateInjection := f + injection_ground := hf + injection_code := injection + dense := dense + no_endpoints := endpoints + lo := lo + hi := hi + lo_mem := loMem + hi_mem := hiMem + gap := gap + source := source + points_eq := rfl + actors_eq := rfl + bottom_eq := rfl + top_eq := rfl + stage_code := rfl + cutoff_zero := rfl + birth_eq := rfl + invariant := M.initialMainChronological_invariant pairing unions powers separation infinite + spec.1 hD hrD column loMem hiMem gap hK conditions labelSize columnRank columnRank rankD }⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +open scoped ZFSet +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialMainSeedSerialized + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ seed : GroundInitialMainSeedData M K C, + ∃ serial : GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) + C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), + serial.code ∈ M.sets ∧ serial.fields.graph = seed.source.stage.initialChronologyGraph ∧ + serial.toHistory.space ∅ = seed.source.stage.carrier ∧ + serial.toHistory.order ∅ = seed.source.stage.order ∧ + serial.toHistory.meetGraph ∅ = seed.source.stage.meetGraph ∧ + serial.toHistory.birth ∅ = seed.source.birth ∧ + serial.toHistory.height ∅ = seed.source.stage.height := by + dsimp only + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite + collection hK conditions + have small : M.groundEmbeddable seed.source.stage.carrier ZFSet.omega := by + rw [seed.points_eq] + exact M.natSetCode_countable pairing unions powers separation infinite 2 + obtain ⟨serial, ground, graph, carrier, order, meet, birth, height⟩ := + seed.source.stage.exists_initialSerializedChronology pairing unions powers separation small + have birthEq : seed.source.stage.initialBirth = seed.source.birth := by + rw [GroundMainStage.initialBirth, seed.points_eq, seed.birth_eq] + exact ⟨seed, serial, ground, graph, carrier, order, meet, birth.trans birthEq, height⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +open scoped ZFSet +universe u +namespace GroundInitialMainSeedData +variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} +variable (seed : GroundInitialMainSeedData M K C) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +include infinite hK conditions + +theorem initialSerializedChronology_code_rank_lt {injection : ZFSet.{u}} + (hInjection : injection ∈ M.sets) + (injected : InjectionCode seed.source.stage.carrier ZFSet.omega injection) : + ZFSet.rank (seed.source.stage.initialSerializedChronology pairing unions powers separation + hInjection injected).code < ZFSet.rank K := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + have height := rank_functionGraph_lt limit seed.source.stage.height_code.function + seed.invariant.points_rank (rank_product_lt limit seed.invariant.columns_rank seed.invariant.coordinates_rank) + exact seed.source.stage.initialSerializedChronology_code_rank_lt_inaccessible + pairing unions powers separation hInjection injected infinite hK conditions seed.invariant.points_rank height + +theorem exists_rankedInitialSerialization : + ∃ injection ∈ M.sets, ∃ injected : InjectionCode seed.source.stage.carrier ZFSet.omega injection, + ∃ hInjection : injection ∈ M.sets, + let serial := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected + serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ + serial.fields.graph = seed.source.stage.initialChronologyGraph ∧ + serial.toHistory.space ∅ = seed.source.stage.carrier ∧ + serial.toHistory.order ∅ = seed.source.stage.order ∧ + serial.toHistory.meetGraph ∅ = seed.source.stage.meetGraph ∧ + serial.toHistory.birth ∅ = seed.source.birth ∧ + serial.toHistory.height ∅ = seed.source.stage.height := by + have small : M.groundEmbeddable seed.source.stage.carrier ZFSet.omega := by + rw [seed.points_eq] + exact M.natSetCode_countable pairing unions powers separation infinite 2 + obtain ⟨injection, hInjection, injected⟩ := small + have values := seed.source.stage.initialSerializedChronology_values pairing unions powers separation + hInjection injected (ZFSet.mem_insert _ _) + have birth : seed.source.stage.initialBirth = seed.source.birth := by + rw [GroundMainStage.initialBirth, seed.points_eq, seed.birth_eq] + exact ⟨injection, hInjection, injected, hInjection, + seed.source.stage.initialSerializedChronology_code_ground pairing unions powers separation hInjection injected, + seed.initialSerializedChronology_code_rank_lt pairing unions powers separation infinite hK conditions hInjection injected, + rfl, values.1, values.2.1, values.2.2.1, values.2.2.2.1.trans birth, values.2.2.2.2⟩ + +end GroundInitialMainSeedData +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalNoChooserConsequences.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalNoChooserConsequences.lean index bfd3b2ebe2c36190f9ecfa02b60407c9141fa96b..7185fff5cc4c08b3271c836aff09faced6b49715 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalNoChooserConsequences.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalNoChooserConsequences.lean @@ -1,63 +1,63 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundInternalRowChoice -import OAI.SetTheory.PartitionPrinciple.Models.GroundSupportedEqualityChoices - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (N : TransitiveGround.{u}) - -theorem ordinalSurjection_chooses_subsets - (pairing : Realize N.sets SetFormula.pairing Fin.elim0) - (unions : Realize N.sets SetFormula.union Fin.elim0) - (powers : Realize N.sets powerSet Fin.elim0) - (separation : SeparationSchema N.sets) - {X T e : ZFSet.{u}} (hX : X ∈ N.sets) (hT : T ∈ N.sets) - (he : e ∈ N.sets) (ordinal : ordinalSetProperty T) - (function : ZFSet.IsFunc T X e) - (covers : ∀ x ∈ X, ∃ i ∈ T, ZFSet.pair i x ∈ e) : - ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ X → S.Nonempty → - ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ - ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x := by - let A := N.nonemptyGroundSubsets X - have hA : A ∈ N.sets := N.nonemptyGroundSubsets_mem powers separation hX - have meets : ∀ S ∈ A, ∃ i ∈ T, ∃ x ∈ S, ZFSet.pair i x ∈ e := by - intro S member - obtain ⟨_ground, subset, x, hx⟩ := (N.mem_nonemptyGroundSubsets X S).1 member - obtain ⟨i, hi, edge⟩ := covers x (subset hx) - exact ⟨i, hi, x, hx, edge⟩ - have code := ordinalIndexedChoiceGraph_choice ordinal ⟨X, function⟩ meets - refine ⟨ordinalIndexedChoiceGraph A T e, - N.ordinalIndexedChoiceGraph_mem pairing unions powers separation hA hT he, ?_⟩ - intro S hS subset nonempty - have member : S ∈ A := (N.mem_nonemptyGroundSubsets X S).2 ⟨hS, subset, nonempty⟩ - obtain ⟨x, edge, unique⟩ := code.function.2 S member - exact ⟨x, code.chosen S x edge, edge, fun z _ hz => unique z hz⟩ - -theorem noChooser_no_ordinal_surjection_not_choice - (zf : ZFRealization N.sets) {X : ZFSet.{u}} (hX : X ∈ N.sets) - (noChooser : ¬ ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ X → S.Nonempty → - ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ - ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x) : - (¬ ∃ T ∈ N.sets, ordinalSetProperty T ∧ - ∃ e ∈ N.sets, ZFSet.IsFunc T X e ∧ - ∀ x ∈ X, ∃ i ∈ T, ZFSet.pair i x ∈ e) ∧ - ¬ Realize N.sets SetFormula.choice Fin.elim0 := by - have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 - have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 - have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 - constructor - · rintro ⟨T, hT, ordinal, e, he, function, covers⟩ - exact noChooser (N.ordinalSurjection_chooses_subsets pairing unions powers zf.2.1 - hX hT he ordinal function covers) - · intro choice - exact noChooser (N.exists_function_choosing_subsets powers zf.2.1 choice hX) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundInternalRowChoice +import OAI.SetTheory.PartitionPrinciple.Models.GroundSupportedEqualityChoices + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (N : TransitiveGround.{u}) + +theorem ordinalSurjection_chooses_subsets + (pairing : Realize N.sets SetFormula.pairing Fin.elim0) + (unions : Realize N.sets SetFormula.union Fin.elim0) + (powers : Realize N.sets powerSet Fin.elim0) + (separation : SeparationSchema N.sets) + {X T e : ZFSet.{u}} (hX : X ∈ N.sets) (hT : T ∈ N.sets) + (he : e ∈ N.sets) (ordinal : ordinalSetProperty T) + (function : ZFSet.IsFunc T X e) + (covers : ∀ x ∈ X, ∃ i ∈ T, ZFSet.pair i x ∈ e) : + ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ X → S.Nonempty → + ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ + ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x := by + let A := N.nonemptyGroundSubsets X + have hA : A ∈ N.sets := N.nonemptyGroundSubsets_mem powers separation hX + have meets : ∀ S ∈ A, ∃ i ∈ T, ∃ x ∈ S, ZFSet.pair i x ∈ e := by + intro S member + obtain ⟨_ground, subset, x, hx⟩ := (N.mem_nonemptyGroundSubsets X S).1 member + obtain ⟨i, hi, edge⟩ := covers x (subset hx) + exact ⟨i, hi, x, hx, edge⟩ + have code := ordinalIndexedChoiceGraph_choice ordinal ⟨X, function⟩ meets + refine ⟨ordinalIndexedChoiceGraph A T e, + N.ordinalIndexedChoiceGraph_mem pairing unions powers separation hA hT he, ?_⟩ + intro S hS subset nonempty + have member : S ∈ A := (N.mem_nonemptyGroundSubsets X S).2 ⟨hS, subset, nonempty⟩ + obtain ⟨x, edge, unique⟩ := code.function.2 S member + exact ⟨x, code.chosen S x edge, edge, fun z _ hz => unique z hz⟩ + +theorem noChooser_no_ordinal_surjection_not_choice + (zf : ZFRealization N.sets) {X : ZFSet.{u}} (hX : X ∈ N.sets) + (noChooser : ¬ ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ X → S.Nonempty → + ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ + ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x) : + (¬ ∃ T ∈ N.sets, ordinalSetProperty T ∧ + ∃ e ∈ N.sets, ZFSet.IsFunc T X e ∧ + ∀ x ∈ X, ∃ i ∈ T, ZFSet.pair i x ∈ e) ∧ + ¬ Realize N.sets SetFormula.choice Fin.elim0 := by + have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 + have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 + have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 + constructor + · rintro ⟨T, hT, ordinal, e, he, function, covers⟩ + exact noChooser (N.ordinalSurjection_chooses_subsets pairing unions powers zf.2.1 + hX hT he ordinal function covers) + · intro choice + exact noChooser (N.exists_function_choosing_subsets powers zf.2.1 choice hX) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalRowsInZF.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalRowsInZF.lean index 8f82ddfc885c89c98340835d9e562360a13ac0da..50e61a97d6bd4bc990f5f08f7f8f0e213baef8a8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalRowsInZF.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundInternalRowsInZF.lean @@ -1,117 +1,117 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowNameCodes -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionZF - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] - -theorem exists_internalRow_ZF_with_distinct_rows - (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) - (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) - (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) - (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : L) directed - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ZFSet.IsFunc (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) - (M.countableGenericGraph (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) H) ∧ - Function.Injective (fun i : SetMembers s.nonbottom.carrier => - M.binaryGenericRow s.nonbottom.carrier C H (SetMembers.raw i)) := by - let := columnOrder C - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - have hRows := M.nonbottom_carrier_mem s separation hL - have hCoordinates := M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC - have hAction := M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph - have values : (natSetCode 2 : ZFSet.{u}).Nonempty := - ⟨natSetCode 0, (mem_two_iff _).2 (Or.inl rfl)⟩ - obtain ⟨H, hp, ground, ordinary, symmetric, includes, zf, total⟩ := - M.exists_countableFunction_ZF (a.rowCoordinates C) a - (s.nonbottom.product (SetMembers.presentation C)) (natInitialPresentation 2) b s - (⊥ : L) directed small pairing unions powers separation collection infinite - hCoordinates (M.natSetCode_mem separation infinite 2) values hG hL hAction order graph p - exact ⟨H, hp, ground, ordinary, symmetric, includes, zf, total, - M.binaryGenericRows_injective pairing unions powers separation infinite choice - hRows hC uncountable H ground⟩ - -theorem internalRowName_mem (s : Presentation L) (C : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) - (i : {i : L // i ≠ ⊥}) : (M.internalRowName s C hL i).val ∈ M.sets := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - exact M.binaryRowName_mem pairing unions powers separation collection infinite - (M.nonbottom_carrier_mem s separation hL) hC ⊤ (s.encode i.val) - (M.transitive hL (s.encode_mem i.val)) - -theorem eval_internalRowName (s : Presentation L) (C : ZFSet.{u}) - (hL : s.carrier ∈ M.sets) (i : {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - Name.eval {p | H.mem p} (M.internalRowName s C hL i) = - M.binaryGenericRow s.nonbottom.carrier C H (s.encode i.val) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro H - exact M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem (s.encode i.val) - -theorem internalRow_mem_symmetric_values - (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) - (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) - (graph : a.actionGraph s b ∈ M.sets) (i : {i : L // i ≠ ⊥}) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), - M.binaryGenericRow s.nonbottom.carrier C H (s.encode i.val) ∈ - (act.symmetricDomain c (M.nameDomain c) (a.principalSupportFamily ⊥ directed)).values - {p | H.mem p} := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act c H - exact (act.mem_symmetric_values c (M.nameDomain c) (a.principalSupportFamily ⊥ directed) - {p | H.mem p} _).2 ⟨M.internalRowName s C hL i, - M.internalRowName_mem s C pairing unions powers separation collection infinite hL hC i, - M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i, - M.eval_internalRowName s C hL i H⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowNameCodes +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionZF + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] + +theorem exists_internalRow_ZF_with_distinct_rows + (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) + (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) + (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) + (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : L) directed + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ZFSet.IsFunc (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) + (M.countableGenericGraph (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) H) ∧ + Function.Injective (fun i : SetMembers s.nonbottom.carrier => + M.binaryGenericRow s.nonbottom.carrier C H (SetMembers.raw i)) := by + let := columnOrder C + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + have hRows := M.nonbottom_carrier_mem s separation hL + have hCoordinates := M.rowCoordinate_carrier_mem s C pairing unions powers separation hL hC + have hAction := M.rowCoordinate_graph_mem a s b C pairing unions powers separation hL hC hG graph + have values : (natSetCode 2 : ZFSet.{u}).Nonempty := + ⟨natSetCode 0, (mem_two_iff _).2 (Or.inl rfl)⟩ + obtain ⟨H, hp, ground, ordinary, symmetric, includes, zf, total⟩ := + M.exists_countableFunction_ZF (a.rowCoordinates C) a + (s.nonbottom.product (SetMembers.presentation C)) (natInitialPresentation 2) b s + (⊥ : L) directed small pairing unions powers separation collection infinite + hCoordinates (M.natSetCode_mem separation infinite 2) values hG hL hAction order graph p + exact ⟨H, hp, ground, ordinary, symmetric, includes, zf, total, + M.binaryGenericRows_injective pairing unions powers separation infinite choice + hRows hC uncountable H ground⟩ + +theorem internalRowName_mem (s : Presentation L) (C : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) + (i : {i : L // i ≠ ⊥}) : (M.internalRowName s C hL i).val ∈ M.sets := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + exact M.binaryRowName_mem pairing unions powers separation collection infinite + (M.nonbottom_carrier_mem s separation hL) hC ⊤ (s.encode i.val) + (M.transitive hL (s.encode_mem i.val)) + +theorem eval_internalRowName (s : Presentation L) (C : ZFSet.{u}) + (hL : s.carrier ∈ M.sets) (i : {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + Name.eval {p | H.mem p} (M.internalRowName s C hL i) = + M.binaryGenericRow s.nonbottom.carrier C H (s.encode i.val) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro H + exact M.eval_binaryRowName s.nonbottom.carrier C ⊤ H H.top_mem (s.encode i.val) + +theorem internalRow_mem_symmetric_values + (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) + (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) + (graph : a.actionGraph s b ∈ M.sets) (i : {i : L // i ≠ ⊥}) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)), + M.binaryGenericRow s.nonbottom.carrier C H (s.encode i.val) ∈ + (act.symmetricDomain c (M.nameDomain c) (a.principalSupportFamily ⊥ directed)).values + {p | H.mem p} := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act c H + exact (act.mem_symmetric_values c (M.nameDomain c) (a.principalSupportFamily ⊥ directed) + {p | H.mem p} _).2 ⟨M.internalRowName s C hL i, + M.internalRowName_mem s C pairing unions powers separation collection infinite hL hC i, + M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i, + M.eval_internalRowName s C hL i H⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalEmbeddingRelation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalEmbeddingRelation.lean index 6cfe5c423dbf08bcc49495c161f09fa79a2039f5..1e9681d522c637012fa369be12911838c75989fe 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalEmbeddingRelation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalEmbeddingRelation.lean @@ -1,116 +1,116 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IntervalEmbeddingFormulas - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace BoundedFormula - -open SetFormula - -def intervalEmbeddingCandidateFormula {n} - (As rs los his D rD i f boundAs boundRs : Fin n) : BoundedFormula n := - let lift (j : Fin n) : Fin (n + 4) := j.succ.succ.succ.succ - exMem boundAs (exMem boundRs.succ (exMem D.succ.succ (exMem D.succ.succ.succ - (.conj (pairMembershipFormula (lift i) 3 (lift As)) - (.conj (pairMembershipFormula (lift i) 2 (lift rs)) - (.conj (pairMembershipFormula (lift i) 1 (lift los)) - (.conj (pairMembershipFormula (lift i) 0 (lift his)) - (intervalEmbeddingFormula 3 (lift D) 2 (lift rD) 1 0 (lift f))))))))) - -theorem truth_intervalEmbeddingCandidateFormula {n} - (As rs los his D rD i f boundAs boundRs : Fin n) (env : Fin n → ZFSet.{u}) - (sourceBound : env boundAs = ⋃₀ ⋃₀ env As) - (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : - Truth (intervalEmbeddingCandidateFormula As rs los his D rD i f boundAs boundRs) env ↔ - intervalEmbeddingCandidate (env As) (env rs) (env los) (env his) - (env D) (env rD) (env i) (env f) := by - simp only [intervalEmbeddingCandidateFormula, truth_exMem, Truth, - truth_pairMembershipFormula, truth_intervalEmbeddingFormula] - change (∃ A ∈ env boundAs, ∃ rA ∈ env boundRs, ∃ lo ∈ env D, ∃ hi ∈ env D, - ZFSet.pair (env i) A ∈ env As ∧ ZFSet.pair (env i) rA ∈ env rs ∧ - ZFSet.pair (env i) lo ∈ env los ∧ ZFSet.pair (env i) hi ∈ env his ∧ - IntervalEmbeddingCode A (env D) rA (env rD) lo hi (env f)) ↔ _ - rw [sourceBound, orderBound] - rfl - -def intervalEmbeddingRelationEntryFormula {n} - (z I W As rs los his D rD boundAs boundRs : Fin n) : BoundedFormula n := - exMem I (exMem W.succ - (.conj (orderedPairFormula z.succ.succ 1 0) - (intervalEmbeddingCandidateFormula As.succ.succ rs.succ.succ - los.succ.succ his.succ.succ D.succ.succ rD.succ.succ 1 0 - boundAs.succ.succ boundRs.succ.succ))) - -theorem truth_intervalEmbeddingRelationEntryFormula {n} - (z I W As rs los his D rD boundAs boundRs : Fin n) (env : Fin n → ZFSet.{u}) - (sourceBound : env boundAs = ⋃₀ ⋃₀ env As) - (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : - Truth (intervalEmbeddingRelationEntryFormula z I W As rs los his D rD boundAs boundRs) env ↔ - ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧ - intervalEmbeddingCandidate (env As) (env rs) (env los) (env his) - (env D) (env rD) i f := by - simp only [intervalEmbeddingRelationEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula] - apply exists_congr - intro i - apply and_congr_right - intro _ - apply exists_congr - intro f - apply and_congr_right - intro _ - exact and_congr Iff.rfl (truth_intervalEmbeddingCandidateFormula - As.succ.succ rs.succ.succ los.succ.succ his.succ.succ D.succ.succ - rD.succ.succ 1 0 boundAs.succ.succ boundRs.succ.succ - (extend f (extend i env)) sourceBound orderBound) - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem intervalEmbeddingRelation_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I W As rs los his D rD : ZFSet.{u}} - (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hAs : As ∈ M.sets) (hrs : rs ∈ M.sets) - (hlos : los ∈ M.sets) (hhis : his ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - intervalEmbeddingRelation I W As rs los his D rD ∈ M.sets := by - have sourceBound := M.union_mem unions (M.union_mem unions hAs) - have orderBound := M.union_mem unions (M.union_mem unions hrs) - let params := extend I (extend W (extend As (extend rs (extend los (extend his - (extend D (extend rD (extend (⋃₀ ⋃₀ As) (extend (⋃₀ ⋃₀ rs) Fin.elim0))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.intervalEmbeddingRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params - (Fin.cases hI (Fin.cases hW (Fin.cases hAs (Fin.cases hrs (Fin.cases hlos - (Fin.cases hhis (Fin.cases hD (Fin.cases hrD (Fin.cases sourceBound - (Fin.cases orderBound (fun j => Fin.elim0 j))))))))))) - (M.prod_mem pairing unions powers separation hI hW) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.intervalEmbeddingRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) - (extend z params)) (ZFSet.prod I W) = - intervalEmbeddingRelation I W As rs los his D rD := by - apply ZFSet.ext - intro z - rw [intervalEmbeddingRelation, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_intervalEmbeddingRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10 - (extend z params) rfl rfl) - exact eq ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IntervalEmbeddingFormulas + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace BoundedFormula + +open SetFormula + +def intervalEmbeddingCandidateFormula {n} + (As rs los his D rD i f boundAs boundRs : Fin n) : BoundedFormula n := + let lift (j : Fin n) : Fin (n + 4) := j.succ.succ.succ.succ + exMem boundAs (exMem boundRs.succ (exMem D.succ.succ (exMem D.succ.succ.succ + (.conj (pairMembershipFormula (lift i) 3 (lift As)) + (.conj (pairMembershipFormula (lift i) 2 (lift rs)) + (.conj (pairMembershipFormula (lift i) 1 (lift los)) + (.conj (pairMembershipFormula (lift i) 0 (lift his)) + (intervalEmbeddingFormula 3 (lift D) 2 (lift rD) 1 0 (lift f))))))))) + +theorem truth_intervalEmbeddingCandidateFormula {n} + (As rs los his D rD i f boundAs boundRs : Fin n) (env : Fin n → ZFSet.{u}) + (sourceBound : env boundAs = ⋃₀ ⋃₀ env As) + (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : + Truth (intervalEmbeddingCandidateFormula As rs los his D rD i f boundAs boundRs) env ↔ + intervalEmbeddingCandidate (env As) (env rs) (env los) (env his) + (env D) (env rD) (env i) (env f) := by + simp only [intervalEmbeddingCandidateFormula, truth_exMem, Truth, + truth_pairMembershipFormula, truth_intervalEmbeddingFormula] + change (∃ A ∈ env boundAs, ∃ rA ∈ env boundRs, ∃ lo ∈ env D, ∃ hi ∈ env D, + ZFSet.pair (env i) A ∈ env As ∧ ZFSet.pair (env i) rA ∈ env rs ∧ + ZFSet.pair (env i) lo ∈ env los ∧ ZFSet.pair (env i) hi ∈ env his ∧ + IntervalEmbeddingCode A (env D) rA (env rD) lo hi (env f)) ↔ _ + rw [sourceBound, orderBound] + rfl + +def intervalEmbeddingRelationEntryFormula {n} + (z I W As rs los his D rD boundAs boundRs : Fin n) : BoundedFormula n := + exMem I (exMem W.succ + (.conj (orderedPairFormula z.succ.succ 1 0) + (intervalEmbeddingCandidateFormula As.succ.succ rs.succ.succ + los.succ.succ his.succ.succ D.succ.succ rD.succ.succ 1 0 + boundAs.succ.succ boundRs.succ.succ))) + +theorem truth_intervalEmbeddingRelationEntryFormula {n} + (z I W As rs los his D rD boundAs boundRs : Fin n) (env : Fin n → ZFSet.{u}) + (sourceBound : env boundAs = ⋃₀ ⋃₀ env As) + (orderBound : env boundRs = ⋃₀ ⋃₀ env rs) : + Truth (intervalEmbeddingRelationEntryFormula z I W As rs los his D rD boundAs boundRs) env ↔ + ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧ + intervalEmbeddingCandidate (env As) (env rs) (env los) (env his) + (env D) (env rD) i f := by + simp only [intervalEmbeddingRelationEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula] + apply exists_congr + intro i + apply and_congr_right + intro _ + apply exists_congr + intro f + apply and_congr_right + intro _ + exact and_congr Iff.rfl (truth_intervalEmbeddingCandidateFormula + As.succ.succ rs.succ.succ los.succ.succ his.succ.succ D.succ.succ + rD.succ.succ 1 0 boundAs.succ.succ boundRs.succ.succ + (extend f (extend i env)) sourceBound orderBound) + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem intervalEmbeddingRelation_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I W As rs los his D rD : ZFSet.{u}} + (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hAs : As ∈ M.sets) (hrs : rs ∈ M.sets) + (hlos : los ∈ M.sets) (hhis : his ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + intervalEmbeddingRelation I W As rs los his D rD ∈ M.sets := by + have sourceBound := M.union_mem unions (M.union_mem unions hAs) + have orderBound := M.union_mem unions (M.union_mem unions hrs) + let params := extend I (extend W (extend As (extend rs (extend los (extend his + (extend D (extend rD (extend (⋃₀ ⋃₀ As) (extend (⋃₀ ⋃₀ rs) Fin.elim0))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.intervalEmbeddingRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params + (Fin.cases hI (Fin.cases hW (Fin.cases hAs (Fin.cases hrs (Fin.cases hlos + (Fin.cases hhis (Fin.cases hD (Fin.cases hrD (Fin.cases sourceBound + (Fin.cases orderBound (fun j => Fin.elim0 j))))))))))) + (M.prod_mem pairing unions powers separation hI hW) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.intervalEmbeddingRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10) + (extend z params)) (ZFSet.prod I W) = + intervalEmbeddingRelation I W As rs los his D rD := by + apply ZFSet.ext + intro z + rw [intervalEmbeddingRelation, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_intervalEmbeddingRelationEntryFormula 0 1 2 3 4 5 6 7 8 9 10 + (extend z params) rfl rfl) + exact eq ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalSelection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalSelection.lean index 920f60a37208aab7dc9eaf0fc60a029de888ccc5..c83a2fc01ce38ceadb34a48bcc8030e5ecbbee90 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalSelection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundIntervalSelection.lean @@ -1,137 +1,137 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.CodedDenseOrders - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -def leastIntervalCandidate (D r c lower upper lo hi x : ZFSet.{u}) : Prop := - intervalCandidate D r lower upper lo hi x ∧ - ∃ n ∈ ZFSet.omega, ZFSet.pair x n ∈ c ∧ - ∀ y ∈ D, intervalCandidate D r lower upper lo hi y → - ∀ m ∈ n, ZFSet.pair y m ∉ c - -theorem leastIntervalCandidate_unique {D r c lower upper lo hi x y : ZFSet.{u}} - (injection : InjectionCode D ZFSet.omega c) - (hx : leastIntervalCandidate D r c lower upper lo hi x) - (hy : leastIntervalCandidate D r c lower upper lo hi y) : x = y := by - obtain ⟨xValid, n, hn, xn, leastX⟩ := hx - obtain ⟨yValid, m, hm, ym, leastY⟩ := hy - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - rcases lt_trichotomy k l with smaller | equal | larger - · exact False.elim (leastY x xValid.1 xValid (natSetCode k) - ((natSetCode_mem_iff k l).2 smaller) xn) - · subst l - exact injection.injective x y (natSetCode k) xn ym - · exact False.elim (leastX y yValid.1 yValid (natSetCode l) - ((natSetCode_mem_iff l k).2 larger) ym) - -theorem leastIntervalCandidate_exists_unique {D r c lower upper lo hi : ZFSet.{u}} - (injection : InjectionCode D ZFSet.omega c) - (candidate : ∃ x, intervalCandidate D r lower upper lo hi x) : - ∃! x, leastIntervalCandidate D r c lower upper lo hi x := by - classical - let valid : Nat → Prop := fun n => ∃ x, intervalCandidate D r lower upper lo hi x ∧ - ZFSet.pair x (natSetCode n) ∈ c - have existsValid : ∃ n, valid n := by - obtain ⟨x, hx⟩ := candidate - obtain ⟨a, entry, _⟩ := injection.function.2 x hx.1 - have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat - exact ⟨n, x, hx, entry⟩ - obtain ⟨x, hx, entry⟩ := Nat.find_spec existsValid - have selected : leastIntervalCandidate D r c lower upper lo hi x := by - refine ⟨hx, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩ - intro y _ hy m hm smaller - obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm - have validK : valid k := ⟨y, hy, equal ▸ smaller⟩ - exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower - exact ⟨x, selected, fun y hy => leastIntervalCandidate_unique injection hy selected⟩ - -theorem DenseOrderCode.least_interval_exists_unique {D r c lower upper lo hi : ZFSet.{u}} - (code : DenseOrderCode D r) (injection : InjectionCode D ZFSet.omega c) - (loD : lo ∈ D) (hiD : hi ∈ D) (lowerD : lower ⊆ D) (upperD : upper ⊆ D) - (finiteLower : lower.toSet.Finite) (finiteUpper : upper.toSet.Finite) - (gap : ZFSet.pair lo hi ∈ r) - (lowerHi : ∀ x ∈ lower, ZFSet.pair x hi ∈ r) - (loUpper : ∀ y ∈ upper, ZFSet.pair lo y ∈ r) - (separated : ∀ x ∈ lower, ∀ y ∈ upper, ZFSet.pair x y ∈ r) : - ∃! x, leastIntervalCandidate D r c lower upper lo hi x := - leastIntervalCandidate_exists_unique injection - (code.finite_interval_candidate loD hiD lowerD upperD finiteLower finiteUpper gap lowerHi loUpper separated) - -namespace BoundedFormula - -open SetFormula - -def intervalCandidateFormula {n} (x d r lower upper lo hi : Fin n) : BoundedFormula n := - .conj (.mem x d) (.conj (pairMembershipFormula lo x r) - (.conj (pairMembershipFormula x hi r) - (.conj (.allMem lower (pairMembershipFormula 0 x.succ r.succ)) - (.allMem upper (pairMembershipFormula x.succ 0 r.succ))))) - -theorem truth_intervalCandidateFormula {n} (x d r lower upper lo hi : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (intervalCandidateFormula x d r lower upper lo hi) env ↔ - intervalCandidate (env d) (env r) (env lower) (env upper) (env lo) (env hi) (env x) := by - simp only [intervalCandidateFormula, Truth, truth_pairMembershipFormula, intervalCandidate] - rfl - -def leastIntervalCandidateFormula {n} (x d r c lower upper lo hi omega : Fin n) : BoundedFormula n := - .conj (intervalCandidateFormula x d r lower upper lo hi) - (exMem omega (.conj (pairMembershipFormula x.succ 0 c.succ) - (.allMem d.succ (imp - (intervalCandidateFormula 0 d.succ.succ r.succ.succ lower.succ.succ - upper.succ.succ lo.succ.succ hi.succ.succ) - (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ))))))) - -theorem truth_leastIntervalCandidateFormula {n} (x d r c lower upper lo hi omega : Fin n) - (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) : - Truth (leastIntervalCandidateFormula x d r c lower upper lo hi omega) env ↔ - leastIntervalCandidate (env d) (env r) (env c) (env lower) (env upper) (env lo) (env hi) (env x) := by - simp only [leastIntervalCandidateFormula, Truth, truth_exMem, truth_imp, - truth_pairMembershipFormula, truth_intervalCandidateFormula] - change (intervalCandidate (env d) (env r) (env lower) (env upper) (env lo) (env hi) (env x) ∧ - ∃ n ∈ env omega, ZFSet.pair (env x) n ∈ env c ∧ - ∀ y ∈ env d, intervalCandidate (env d) (env r) (env lower) (env upper) (env lo) (env hi) y → - ∀ m ∈ n, ZFSet.pair y m ∉ env c) ↔ _ - rw [hOmega] - rfl - -theorem realize_leastIntervalCandidateFormula (M : TransitiveGround.{u}) {n} - (x d r c lower upper lo hi omega : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (hOmega : env omega = ZFSet.omega) : - Realize M.sets (leastIntervalCandidateFormula x d r c lower upper lo hi omega).toFormula env ↔ - leastIntervalCandidate (env d) (env r) (env c) (env lower) (env upper) (env lo) (env hi) (env x) := - (realize_toFormula M _ env members).trans - (truth_leastIntervalCandidateFormula x d r c lower upper lo hi omega env hOmega) - -end BoundedFormula - -namespace TransitiveGround - -theorem exists_unique_ground_intervalSelection (M : TransitiveGround.{u}) - {D r c lower upper lo hi : ZFSet.{u}} (hD : D ∈ M.sets) - (code : DenseOrderCode D r) (injection : InjectionCode D ZFSet.omega c) - (loD : lo ∈ D) (hiD : hi ∈ D) (lowerD : lower ⊆ D) (upperD : upper ⊆ D) - (finiteLower : lower.toSet.Finite) (finiteUpper : upper.toSet.Finite) - (gap : ZFSet.pair lo hi ∈ r) - (lowerHi : ∀ x ∈ lower, ZFSet.pair x hi ∈ r) - (loUpper : ∀ y ∈ upper, ZFSet.pair lo y ∈ r) - (separated : ∀ x ∈ lower, ∀ y ∈ upper, ZFSet.pair x y ∈ r) : - ∃! x, x ∈ M.sets ∧ leastIntervalCandidate D r c lower upper lo hi x := by - obtain ⟨x, selected, unique⟩ := code.least_interval_exists_unique injection loD hiD lowerD upperD - finiteLower finiteUpper gap lowerHi loUpper separated - exact ⟨x, ⟨M.transitive hD selected.1.1, selected⟩, fun y hy => unique y hy.2⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.CodedDenseOrders + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +def leastIntervalCandidate (D r c lower upper lo hi x : ZFSet.{u}) : Prop := + intervalCandidate D r lower upper lo hi x ∧ + ∃ n ∈ ZFSet.omega, ZFSet.pair x n ∈ c ∧ + ∀ y ∈ D, intervalCandidate D r lower upper lo hi y → + ∀ m ∈ n, ZFSet.pair y m ∉ c + +theorem leastIntervalCandidate_unique {D r c lower upper lo hi x y : ZFSet.{u}} + (injection : InjectionCode D ZFSet.omega c) + (hx : leastIntervalCandidate D r c lower upper lo hi x) + (hy : leastIntervalCandidate D r c lower upper lo hi y) : x = y := by + obtain ⟨xValid, n, hn, xn, leastX⟩ := hx + obtain ⟨yValid, m, hm, ym, leastY⟩ := hy + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + rcases lt_trichotomy k l with smaller | equal | larger + · exact False.elim (leastY x xValid.1 xValid (natSetCode k) + ((natSetCode_mem_iff k l).2 smaller) xn) + · subst l + exact injection.injective x y (natSetCode k) xn ym + · exact False.elim (leastX y yValid.1 yValid (natSetCode l) + ((natSetCode_mem_iff l k).2 larger) ym) + +theorem leastIntervalCandidate_exists_unique {D r c lower upper lo hi : ZFSet.{u}} + (injection : InjectionCode D ZFSet.omega c) + (candidate : ∃ x, intervalCandidate D r lower upper lo hi x) : + ∃! x, leastIntervalCandidate D r c lower upper lo hi x := by + classical + let valid : Nat → Prop := fun n => ∃ x, intervalCandidate D r lower upper lo hi x ∧ + ZFSet.pair x (natSetCode n) ∈ c + have existsValid : ∃ n, valid n := by + obtain ⟨x, hx⟩ := candidate + obtain ⟨a, entry, _⟩ := injection.function.2 x hx.1 + have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat + exact ⟨n, x, hx, entry⟩ + obtain ⟨x, hx, entry⟩ := Nat.find_spec existsValid + have selected : leastIntervalCandidate D r c lower upper lo hi x := by + refine ⟨hx, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩ + intro y _ hy m hm smaller + obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm + have validK : valid k := ⟨y, hy, equal ▸ smaller⟩ + exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower + exact ⟨x, selected, fun y hy => leastIntervalCandidate_unique injection hy selected⟩ + +theorem DenseOrderCode.least_interval_exists_unique {D r c lower upper lo hi : ZFSet.{u}} + (code : DenseOrderCode D r) (injection : InjectionCode D ZFSet.omega c) + (loD : lo ∈ D) (hiD : hi ∈ D) (lowerD : lower ⊆ D) (upperD : upper ⊆ D) + (finiteLower : lower.toSet.Finite) (finiteUpper : upper.toSet.Finite) + (gap : ZFSet.pair lo hi ∈ r) + (lowerHi : ∀ x ∈ lower, ZFSet.pair x hi ∈ r) + (loUpper : ∀ y ∈ upper, ZFSet.pair lo y ∈ r) + (separated : ∀ x ∈ lower, ∀ y ∈ upper, ZFSet.pair x y ∈ r) : + ∃! x, leastIntervalCandidate D r c lower upper lo hi x := + leastIntervalCandidate_exists_unique injection + (code.finite_interval_candidate loD hiD lowerD upperD finiteLower finiteUpper gap lowerHi loUpper separated) + +namespace BoundedFormula + +open SetFormula + +def intervalCandidateFormula {n} (x d r lower upper lo hi : Fin n) : BoundedFormula n := + .conj (.mem x d) (.conj (pairMembershipFormula lo x r) + (.conj (pairMembershipFormula x hi r) + (.conj (.allMem lower (pairMembershipFormula 0 x.succ r.succ)) + (.allMem upper (pairMembershipFormula x.succ 0 r.succ))))) + +theorem truth_intervalCandidateFormula {n} (x d r lower upper lo hi : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (intervalCandidateFormula x d r lower upper lo hi) env ↔ + intervalCandidate (env d) (env r) (env lower) (env upper) (env lo) (env hi) (env x) := by + simp only [intervalCandidateFormula, Truth, truth_pairMembershipFormula, intervalCandidate] + rfl + +def leastIntervalCandidateFormula {n} (x d r c lower upper lo hi omega : Fin n) : BoundedFormula n := + .conj (intervalCandidateFormula x d r lower upper lo hi) + (exMem omega (.conj (pairMembershipFormula x.succ 0 c.succ) + (.allMem d.succ (imp + (intervalCandidateFormula 0 d.succ.succ r.succ.succ lower.succ.succ + upper.succ.succ lo.succ.succ hi.succ.succ) + (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ))))))) + +theorem truth_leastIntervalCandidateFormula {n} (x d r c lower upper lo hi omega : Fin n) + (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) : + Truth (leastIntervalCandidateFormula x d r c lower upper lo hi omega) env ↔ + leastIntervalCandidate (env d) (env r) (env c) (env lower) (env upper) (env lo) (env hi) (env x) := by + simp only [leastIntervalCandidateFormula, Truth, truth_exMem, truth_imp, + truth_pairMembershipFormula, truth_intervalCandidateFormula] + change (intervalCandidate (env d) (env r) (env lower) (env upper) (env lo) (env hi) (env x) ∧ + ∃ n ∈ env omega, ZFSet.pair (env x) n ∈ env c ∧ + ∀ y ∈ env d, intervalCandidate (env d) (env r) (env lower) (env upper) (env lo) (env hi) y → + ∀ m ∈ n, ZFSet.pair y m ∉ env c) ↔ _ + rw [hOmega] + rfl + +theorem realize_leastIntervalCandidateFormula (M : TransitiveGround.{u}) {n} + (x d r c lower upper lo hi omega : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (hOmega : env omega = ZFSet.omega) : + Realize M.sets (leastIntervalCandidateFormula x d r c lower upper lo hi omega).toFormula env ↔ + leastIntervalCandidate (env d) (env r) (env c) (env lower) (env upper) (env lo) (env hi) (env x) := + (realize_toFormula M _ env members).trans + (truth_leastIntervalCandidateFormula x d r c lower upper lo hi omega env hOmega) + +end BoundedFormula + +namespace TransitiveGround + +theorem exists_unique_ground_intervalSelection (M : TransitiveGround.{u}) + {D r c lower upper lo hi : ZFSet.{u}} (hD : D ∈ M.sets) + (code : DenseOrderCode D r) (injection : InjectionCode D ZFSet.omega c) + (loD : lo ∈ D) (hiD : hi ∈ D) (lowerD : lower ⊆ D) (upperD : upper ⊆ D) + (finiteLower : lower.toSet.Finite) (finiteUpper : upper.toSet.Finite) + (gap : ZFSet.pair lo hi ∈ r) + (lowerHi : ∀ x ∈ lower, ZFSet.pair x hi ∈ r) + (loUpper : ∀ y ∈ upper, ZFSet.pair lo y ∈ r) + (separated : ∀ x ∈ lower, ∀ y ∈ upper, ZFSet.pair x y ∈ r) : + ∃! x, x ∈ M.sets ∧ leastIntervalCandidate D r c lower upper lo hi x := by + obtain ⟨x, selected, unique⟩ := code.least_interval_exists_unique injection loD hiD lowerD upperD + finiteLower finiteUpper gap lowerHi loUpper separated + exact ⟨x, ⟨M.transitive hD selected.1.1, selected⟩, fun y hy => unique y hy.2⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLayerSourceCongruence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLayerSourceCongruence.lean index 38dcc193835ab95a7ca3de92b0985f7d320ab723..5eaaf42f6a2f02c32642f98f10070081fcc31452 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLayerSourceCongruence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLayerSourceCongruence.lean @@ -1,61 +1,61 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GrowthLayerWitnessRestrictions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem graphRestriction_eq_of_entries {S f g : ZFSet.{u}} - (entries : ∀ s ∈ S, ∀ y, ZFSet.pair s y ∈ f ↔ ZFSet.pair s y ∈ g) : - graphRestriction S f = graphRestriction S g := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨s, hs, y, rfl, entry⟩ := mem_graphRestriction.1 member - exact pair_mem_graphRestriction.2 ⟨(entries s hs y).1 entry, hs⟩ - · intro member - obtain ⟨s, hs, y, rfl, entry⟩ := mem_graphRestriction.1 member - exact pair_mem_graphRestriction.2 ⟨(entries s hs y).2 entry, hs⟩ - -namespace GrowthLayerWitnessCode - -theorem congr_sources_below_iff - {Qs rs μs Qs' rs' μs' L r μ birth t N z : ZFSet.{u}} - (spaces : graphRestriction t Qs = graphRestriction t Qs') - (orders : graphRestriction t rs = graphRestriction t rs') - (meets : graphRestriction t μs = graphRestriction t μs') : - GrowthLayerWitnessCode Qs rs μs L r μ birth t N z ↔ - GrowthLayerWitnessCode Qs' rs' μs' L r μ birth t N z := by - have self : t ⊆ t := fun _ h => h - rw [← restrict_sources_iff self, ← restrict_sources_iff (Qs := Qs') self] - rw [spaces, orders, meets] - -theorem congr_sources_below - {Qs rs μs Qs' rs' μs' L r μ birth t N z : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) - (spaces : graphRestriction t Qs = graphRestriction t Qs') - (orders : graphRestriction t rs = graphRestriction t rs') - (meets : graphRestriction t μs = graphRestriction t μs') : - GrowthLayerWitnessCode Qs' rs' μs' L r μ birth t N z := - (congr_sources_below_iff spaces orders meets).1 code - -theorem congr_source_entries - {Qs rs μs Qs' rs' μs' L r μ birth t N z : ZFSet.{u}} - (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) - (spaces : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ Qs ↔ ZFSet.pair s y ∈ Qs') - (orders : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ rs ↔ ZFSet.pair s y ∈ rs') - (meets : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ μs ↔ ZFSet.pair s y ∈ μs') : - GrowthLayerWitnessCode Qs' rs' μs' L r μ birth t N z := - code.congr_sources_below (graphRestriction_eq_of_entries spaces) - (graphRestriction_eq_of_entries orders) (graphRestriction_eq_of_entries meets) - -end GrowthLayerWitnessCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GrowthLayerWitnessRestrictions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem graphRestriction_eq_of_entries {S f g : ZFSet.{u}} + (entries : ∀ s ∈ S, ∀ y, ZFSet.pair s y ∈ f ↔ ZFSet.pair s y ∈ g) : + graphRestriction S f = graphRestriction S g := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨s, hs, y, rfl, entry⟩ := mem_graphRestriction.1 member + exact pair_mem_graphRestriction.2 ⟨(entries s hs y).1 entry, hs⟩ + · intro member + obtain ⟨s, hs, y, rfl, entry⟩ := mem_graphRestriction.1 member + exact pair_mem_graphRestriction.2 ⟨(entries s hs y).2 entry, hs⟩ + +namespace GrowthLayerWitnessCode + +theorem congr_sources_below_iff + {Qs rs μs Qs' rs' μs' L r μ birth t N z : ZFSet.{u}} + (spaces : graphRestriction t Qs = graphRestriction t Qs') + (orders : graphRestriction t rs = graphRestriction t rs') + (meets : graphRestriction t μs = graphRestriction t μs') : + GrowthLayerWitnessCode Qs rs μs L r μ birth t N z ↔ + GrowthLayerWitnessCode Qs' rs' μs' L r μ birth t N z := by + have self : t ⊆ t := fun _ h => h + rw [← restrict_sources_iff self, ← restrict_sources_iff (Qs := Qs') self] + rw [spaces, orders, meets] + +theorem congr_sources_below + {Qs rs μs Qs' rs' μs' L r μ birth t N z : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) + (spaces : graphRestriction t Qs = graphRestriction t Qs') + (orders : graphRestriction t rs = graphRestriction t rs') + (meets : graphRestriction t μs = graphRestriction t μs') : + GrowthLayerWitnessCode Qs' rs' μs' L r μ birth t N z := + (congr_sources_below_iff spaces orders meets).1 code + +theorem congr_source_entries + {Qs rs μs Qs' rs' μs' L r μ birth t N z : ZFSet.{u}} + (code : GrowthLayerWitnessCode Qs rs μs L r μ birth t N z) + (spaces : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ Qs ↔ ZFSet.pair s y ∈ Qs') + (orders : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ rs ↔ ZFSet.pair s y ∈ rs') + (meets : ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ μs ↔ ZFSet.pair s y ∈ μs') : + GrowthLayerWitnessCode Qs' rs' μs' L r μ birth t N z := + code.congr_sources_below (graphRestriction_eq_of_entries spaces) + (graphRestriction_eq_of_entries orders) (graphRestriction_eq_of_entries meets) + +end GrowthLayerWitnessCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiftedCompressionGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiftedCompressionGraphs.lean index b9102d2d05bc21c893b63188bc935c45d9838eaa..8c291ce0ef13f5cc073a820191acda31dc1c5802 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiftedCompressionGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiftedCompressionGraphs.lean @@ -1,71 +1,71 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.LiftedCompressionFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem liftedCompressionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}} - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hL : L ∈ M.sets) (hC : C ∈ M.sets) (hN : N ∈ M.sets) (hB : B ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) - (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : - liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ∈ M.sets := by - have hV := M.union_mem unions (M.union_mem unions hMaps) - have hW := M.union_mem unions (M.union_mem unions hFs) - let params := extend (I) (extend (J) (extend (D) (extend (L) (extend (C) (extend (N) (extend (B) (extend (Maps) (extend (Sources) (extend (Fs) (extend (Reps) (extend (G) (extend (A) (extend (ZFSet.sUnion (ZFSet.sUnion Maps)) (extend (ZFSet.sUnion (ZFSet.sUnion Fs)) (Fin.elim0))))))))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.liftedCompressionEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) params - (Fin.cases hI (Fin.cases hJ (Fin.cases hD (Fin.cases hL (Fin.cases hC (Fin.cases hN (Fin.cases hB (Fin.cases hMaps (Fin.cases hSources (Fin.cases hFs (Fin.cases hReps (Fin.cases hG (Fin.cases hA (Fin.cases hV (Fin.cases hW (fun i => Fin.elim0 i)))))))))))))))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hI hL) hC) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.liftedCompressionEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) - (extend z params)) (ZFSet.prod (ZFSet.prod I L) C) = - liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, liftedCompressionGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_liftedCompressionEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - (extend z params) rfl rfl) - exact equal ▸ selected - -noncomputable def groundLiftedCompressionFamily - (I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}) : ZFSet.{u} := - M.indexedRelationSections I L C (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) - -theorem groundLiftedCompressionFamily_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}} - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hL : L ∈ M.sets) (hC : C ∈ M.sets) (hN : N ∈ M.sets) (hB : B ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) - (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : - M.groundLiftedCompressionFamily I J D L C N B Maps Sources Fs Reps G A ∈ M.sets ∧ - FunctionGraphOn I (M.groundLiftedCompressionFamily I J D L C N B Maps Sources Fs Reps G A) ∧ - ∀ i f, ZFSet.pair i f ∈ M.groundLiftedCompressionFamily I J D L C N B Maps Sources Fs Reps G A ↔ - i ∈ I ∧ f = indexedRelationSection L C - (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) i := by - have graph := M.liftedCompressionGraph_mem pairing unions powers separation - hI hJ hD hL hC hN hB hMaps hSources hFs hReps hG hA - obtain ⟨member, function, entries⟩ := M.indexedRelationSections_spec - pairing unions powers separation hI hL hC graph - exact ⟨member, ⟨_, function⟩, entries⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.LiftedCompressionFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem liftedCompressionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}} + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hL : L ∈ M.sets) (hC : C ∈ M.sets) (hN : N ∈ M.sets) (hB : B ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) + (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : + liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ∈ M.sets := by + have hV := M.union_mem unions (M.union_mem unions hMaps) + have hW := M.union_mem unions (M.union_mem unions hFs) + let params := extend (I) (extend (J) (extend (D) (extend (L) (extend (C) (extend (N) (extend (B) (extend (Maps) (extend (Sources) (extend (Fs) (extend (Reps) (extend (G) (extend (A) (extend (ZFSet.sUnion (ZFSet.sUnion Maps)) (extend (ZFSet.sUnion (ZFSet.sUnion Fs)) (Fin.elim0))))))))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.liftedCompressionEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) params + (Fin.cases hI (Fin.cases hJ (Fin.cases hD (Fin.cases hL (Fin.cases hC (Fin.cases hN (Fin.cases hB (Fin.cases hMaps (Fin.cases hSources (Fin.cases hFs (Fin.cases hReps (Fin.cases hG (Fin.cases hA (Fin.cases hV (Fin.cases hW (fun i => Fin.elim0 i)))))))))))))))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hI hL) hC) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.liftedCompressionEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) + (extend z params)) (ZFSet.prod (ZFSet.prod I L) C) = + liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, liftedCompressionGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_liftedCompressionEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + (extend z params) rfl rfl) + exact equal ▸ selected + +noncomputable def groundLiftedCompressionFamily + (I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}) : ZFSet.{u} := + M.indexedRelationSections I L C (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) + +theorem groundLiftedCompressionFamily_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}} + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hL : L ∈ M.sets) (hC : C ∈ M.sets) (hN : N ∈ M.sets) (hB : B ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) + (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : + M.groundLiftedCompressionFamily I J D L C N B Maps Sources Fs Reps G A ∈ M.sets ∧ + FunctionGraphOn I (M.groundLiftedCompressionFamily I J D L C N B Maps Sources Fs Reps G A) ∧ + ∀ i f, ZFSet.pair i f ∈ M.groundLiftedCompressionFamily I J D L C N B Maps Sources Fs Reps G A ↔ + i ∈ I ∧ f = indexedRelationSection L C + (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) i := by + have graph := M.liftedCompressionGraph_mem pairing unions powers separation + hI hJ hD hL hC hN hB hMaps hSources hFs hReps hG hA + obtain ⟨member, function, entries⟩ := M.indexedRelationSections_spec + pairing unions powers separation hI hL hC graph + exact ⟨member, ⟨_, function⟩, entries⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfilePreservation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfilePreservation.lean index fdaa112b4740ad4d04b4df70861ab7aa8334ade1..068da70e69b035f560715b741873ce0ad7af67c5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfilePreservation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfilePreservation.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixPreservedSeeds - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -namespace GroundChronologicalMainTransition -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target chosenSource chosenTarget : GroundLinkedMainStage M K Labels C D rD} - -theorem retargetLinked_preservesOldProfiles_iff - (transition : GroundChronologicalMainTransition source.main target.main) - (sourceCode : source.code = chosenSource.code) (targetCode : target.code = chosenTarget.code) : - (transition.retargetLinked sourceCode targetCode).PreservesOldProfiles ↔ - transition.PreservesOldProfiles := by - have first := source.same_code chosenSource sourceCode - have second := target.same_code chosenTarget targetCode - change OldProfilePreservationCode chosenSource.main.stage.carrier chosenSource.main.stage.order - chosenSource.main.stage.meetGraph chosenTarget.main.stage.carrier chosenTarget.main.stage.order - chosenTarget.main.stage.meetGraph transition.map.points (M.groundPower chosenSource.main.stage.carrier) ↔ _ - rw [← first.stage, ← second.stage] - rfl - -theorem preservesOldProfiles_iff_of_map_code - (first second : GroundChronologicalMainTransition source.main target.main) - (equal : first.map.code = second.map.code) : - first.PreservesOldProfiles ↔ second.PreservesOldProfiles := by - have points : first.map.points = second.map.points := (ZFSet.pair_inj.1 equal).1 - unfold PreservesOldProfiles - rw [points] - -end GroundChronologicalMainTransition - -def LinkedProfilePreservingTransitionCode (M : TransitiveGround.{u}) - (K Labels C D rD a b z : ZFSet.{u}) : Prop := - ∃ source target : GroundLinkedMainStage M K Labels C D rD, - source.code = a ∧ target.code = b ∧ - ∃ transition : GroundChronologicalMainTransition source.main target.main, - transition.map.code = z ∧ transition.CoversOldBirths ∧ transition.PreservesOldProfiles - -namespace LinkedProfilePreservingTransitionCode -variable {M : TransitiveGround.{u}} {K Labels C D rD a b z : ZFSet.{u}} - -theorem linked_transition (code : LinkedProfilePreservingTransitionCode M K Labels C D rD a b z) : - LinkedMainTransitionCode M K Labels C D rD a b z := by - obtain ⟨source, target, first, second, transition, equal, covered, _⟩ := code - exact ⟨source, target, first, second, transition, equal, covered⟩ - -theorem exists_at (source target : GroundLinkedMainStage M K Labels C D rD) - (code : LinkedProfilePreservingTransitionCode M K Labels C D rD source.code target.code z) : - ∃ transition : GroundChronologicalMainTransition source.main target.main, - transition.map.code = z ∧ transition.CoversOldBirths ∧ transition.PreservesOldProfiles := by - obtain ⟨first, second, sourceCode, targetCode, transition, equal, covered, preserved⟩ := code - exact ⟨transition.retargetLinked sourceCode targetCode, - (transition.retargetLinked_code sourceCode targetCode).trans equal, - transition.retargetLinked_coversOldBirths sourceCode targetCode covered, - (transition.retargetLinked_preservesOldProfiles_iff sourceCode targetCode).2 preserved⟩ - -theorem preserves_at {source target : GroundLinkedMainStage M K Labels C D rD} - (transition : GroundChronologicalMainTransition source.main target.main) - (code : LinkedProfilePreservingTransitionCode M K Labels C D rD - source.code target.code transition.map.code) : transition.PreservesOldProfiles := by - obtain ⟨chosen, equal, _, preserved⟩ := code.exists_at source target - exact (chosen.preservesOldProfiles_iff_of_map_code transition equal).1 preserved - -end LinkedProfilePreservingTransitionCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixPreservedSeeds + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +namespace GroundChronologicalMainTransition +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target chosenSource chosenTarget : GroundLinkedMainStage M K Labels C D rD} + +theorem retargetLinked_preservesOldProfiles_iff + (transition : GroundChronologicalMainTransition source.main target.main) + (sourceCode : source.code = chosenSource.code) (targetCode : target.code = chosenTarget.code) : + (transition.retargetLinked sourceCode targetCode).PreservesOldProfiles ↔ + transition.PreservesOldProfiles := by + have first := source.same_code chosenSource sourceCode + have second := target.same_code chosenTarget targetCode + change OldProfilePreservationCode chosenSource.main.stage.carrier chosenSource.main.stage.order + chosenSource.main.stage.meetGraph chosenTarget.main.stage.carrier chosenTarget.main.stage.order + chosenTarget.main.stage.meetGraph transition.map.points (M.groundPower chosenSource.main.stage.carrier) ↔ _ + rw [← first.stage, ← second.stage] + rfl + +theorem preservesOldProfiles_iff_of_map_code + (first second : GroundChronologicalMainTransition source.main target.main) + (equal : first.map.code = second.map.code) : + first.PreservesOldProfiles ↔ second.PreservesOldProfiles := by + have points : first.map.points = second.map.points := (ZFSet.pair_inj.1 equal).1 + unfold PreservesOldProfiles + rw [points] + +end GroundChronologicalMainTransition + +def LinkedProfilePreservingTransitionCode (M : TransitiveGround.{u}) + (K Labels C D rD a b z : ZFSet.{u}) : Prop := + ∃ source target : GroundLinkedMainStage M K Labels C D rD, + source.code = a ∧ target.code = b ∧ + ∃ transition : GroundChronologicalMainTransition source.main target.main, + transition.map.code = z ∧ transition.CoversOldBirths ∧ transition.PreservesOldProfiles + +namespace LinkedProfilePreservingTransitionCode +variable {M : TransitiveGround.{u}} {K Labels C D rD a b z : ZFSet.{u}} + +theorem linked_transition (code : LinkedProfilePreservingTransitionCode M K Labels C D rD a b z) : + LinkedMainTransitionCode M K Labels C D rD a b z := by + obtain ⟨source, target, first, second, transition, equal, covered, _⟩ := code + exact ⟨source, target, first, second, transition, equal, covered⟩ + +theorem exists_at (source target : GroundLinkedMainStage M K Labels C D rD) + (code : LinkedProfilePreservingTransitionCode M K Labels C D rD source.code target.code z) : + ∃ transition : GroundChronologicalMainTransition source.main target.main, + transition.map.code = z ∧ transition.CoversOldBirths ∧ transition.PreservesOldProfiles := by + obtain ⟨first, second, sourceCode, targetCode, transition, equal, covered, preserved⟩ := code + exact ⟨transition.retargetLinked sourceCode targetCode, + (transition.retargetLinked_code sourceCode targetCode).trans equal, + transition.retargetLinked_coversOldBirths sourceCode targetCode covered, + (transition.retargetLinked_preservesOldProfiles_iff sourceCode targetCode).2 preserved⟩ + +theorem preserves_at {source target : GroundLinkedMainStage M K Labels C D rD} + (transition : GroundChronologicalMainTransition source.main target.main) + (code : LinkedProfilePreservingTransitionCode M K Labels C D rD + source.code target.code transition.map.code) : transition.PreservesOldProfiles := by + obtain ⟨chosen, equal, _, preserved⟩ := code.exists_at source target + exact (chosen.preservesOldProfiles_iff_of_map_code transition equal).1 preserved + +end LinkedProfilePreservingTransitionCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfileTransitionRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfileTransitionRecognition.lean index c5eddf7476b723c4e4b399756708f6c242c336b3..3f89c43608e1c3dcee5c3f240ffda6db310ce4e6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfileTransitionRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedProfileTransitionRecognition.lean @@ -1,109 +1,109 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.LinkedProfileTransitionRawCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula - -def linkedProfilePreservingTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) : SetFormula n := - let old := suffixIndex n 53 - let fresh := prefixIndex n 53 - exBlock 53 (linkedProfilePreservingTransitionRawFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (old sourceCode) (old targetCode) (old z) (fresh 48) (fresh 49) (fresh 50) (fresh 51) (fresh 52) - (fun j => fresh (j.castAdd 29)) (fun j => fresh (Fin.natAdd 24 (j.castAdd 5)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem realize_linkedProfilePreservingTransitionFormula_raw {n} (K Labels C D rD N sourceCode targetCode z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedProfilePreservingTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ - ∃ fields : Fin 53 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ - LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env sourceCode) (env targetCode) (env z) (fields 48) (fields 49) (fields 50) (fields 51) (fields 52) - (fun j => fields (j.castAdd 29)) (fun j => fields (Fin.natAdd 24 (j.castAdd 5))) := by - rw [linkedProfilePreservingTransitionFormula, realize_exBlock] - have actual (fields : Fin 53 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := - M.realize_linkedProfilePreservingTransitionRawFormula pairing unions powers separation collection - (suffixIndex n 53 K) (suffixIndex n 53 Labels) (suffixIndex n 53 C) (suffixIndex n 53 D) - (suffixIndex n 53 rD) (suffixIndex n 53 N) (suffixIndex n 53 sourceCode) - (suffixIndex n 53 targetCode) (suffixIndex n 53 z) - (prefixIndex n 53 48) (prefixIndex n 53 49) (prefixIndex n 53 50) (prefixIndex n 53 51) (prefixIndex n 53 52) - (fun j => prefixIndex n 53 (j.castAdd 29)) (fun j => prefixIndex n 53 (Fin.natAdd 24 (j.castAdd 5))) - (extendMany 53 fields env) (extendMany_members 53 fields env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal) - simp only [extendMany_prefix, extendMany_suffix] at actual - constructor - · rintro ⟨fields, ground, recognized⟩ - exact ⟨fields, ground, (actual fields ground).1 recognized⟩ - · rintro ⟨fields, ground, raw⟩ - exact ⟨fields, ground, (actual fields ground).2 raw⟩ - -theorem realize_linkedProfilePreservingTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedProfilePreservingTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ - LinkedProfilePreservingTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) - (env sourceCode) (env targetCode) (env z) := by - rw [M.realize_linkedProfilePreservingTransitionFormula_raw pairing unions powers separation collection - K Labels C D rD N sourceCode targetCode z env members omega ordinal] - constructor - · rintro ⟨fields, ground, raw⟩ - exact raw.exists_transition pairing unions powers separation - (fun j => ground (j.castAdd 29)) (fun j => ground (Fin.natAdd 24 (j.castAdd 5))) - (ground 48) (ground 49) (members C) (members D) (members rD) omega - · rintro ⟨source, target, sourceEq, targetEq, transition, codeEq, coverage, preserved⟩ - let extra : Fin 5 → ZFSet.{u} := Fin.cases transition.map.points (Fin.cases transition.map.actors - (Fin.cases source.main.birth (Fin.cases target.main.birth - (fun _ => M.groundPower source.main.stage.carrier)))) - let fields : Fin 53 → ZFSet.{u} := Fin.addCases (m := 24) (n := 29) source.rawFields (Fin.addCases (m := 24) (n := 5) target.rawFields extra) - have extraGround : ∀ j, extra j ∈ M.sets := - Fin.cases transition.map.points_ground (Fin.cases transition.map.actors_ground - (Fin.cases source.main.birth_ground (Fin.cases target.main.birth_ground - (fun _ => M.groundPower_mem powers source.main.stage.carrier_ground)))) - have grounded : ∀ j, fields j ∈ M.sets := by - intro j - refine Fin.addCases (m := 24) (n := 29) ?_ ?_ j - · intro k - simpa only [fields, Fin.addCases_left] using source.rawFields_ground pairing k - · intro k - refine Fin.addCases (m := 24) (n := 5) ?_ ?_ k - · intro a - simpa only [fields, Fin.addCases_right, Fin.addCases_left] using target.rawFields_ground pairing a - · intro a - simpa only [fields, Fin.addCases_right] using extraGround a - refine ⟨fields, grounded, ?_⟩ - have smap : (fun j : Fin 24 => fields (j.castAdd 29)) = source.rawFields := by - funext j - simp only [fields, Fin.addCases_left] - have tmap : (fun j : Fin 24 => fields (Fin.natAdd 24 (j.castAdd 5))) = target.rawFields := by - funext j - simp only [fields, Fin.addCases_right, Fin.addCases_left] - rw [smap, tmap, omega] - change LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) ZFSet.omega - (env sourceCode) (env targetCode) (env z) transition.map.points transition.map.actors - (source.main.birth) (target.main.birth) - (M.groundPower source.main.stage.carrier) source.rawFields target.rawFields - rw [← sourceEq, ← targetEq, ← codeEq] - exact source.profileTransition_rawFields target transition coverage preserved - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.LinkedProfileTransitionRawCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula + +def linkedProfilePreservingTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) : SetFormula n := + let old := suffixIndex n 53 + let fresh := prefixIndex n 53 + exBlock 53 (linkedProfilePreservingTransitionRawFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (old sourceCode) (old targetCode) (old z) (fresh 48) (fresh 49) (fresh 50) (fresh 51) (fresh 52) + (fun j => fresh (j.castAdd 29)) (fun j => fresh (Fin.natAdd 24 (j.castAdd 5)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem realize_linkedProfilePreservingTransitionFormula_raw {n} (K Labels C D rD N sourceCode targetCode z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedProfilePreservingTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ + ∃ fields : Fin 53 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ + LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env sourceCode) (env targetCode) (env z) (fields 48) (fields 49) (fields 50) (fields 51) (fields 52) + (fun j => fields (j.castAdd 29)) (fun j => fields (Fin.natAdd 24 (j.castAdd 5))) := by + rw [linkedProfilePreservingTransitionFormula, realize_exBlock] + have actual (fields : Fin 53 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := + M.realize_linkedProfilePreservingTransitionRawFormula pairing unions powers separation collection + (suffixIndex n 53 K) (suffixIndex n 53 Labels) (suffixIndex n 53 C) (suffixIndex n 53 D) + (suffixIndex n 53 rD) (suffixIndex n 53 N) (suffixIndex n 53 sourceCode) + (suffixIndex n 53 targetCode) (suffixIndex n 53 z) + (prefixIndex n 53 48) (prefixIndex n 53 49) (prefixIndex n 53 50) (prefixIndex n 53 51) (prefixIndex n 53 52) + (fun j => prefixIndex n 53 (j.castAdd 29)) (fun j => prefixIndex n 53 (Fin.natAdd 24 (j.castAdd 5))) + (extendMany 53 fields env) (extendMany_members 53 fields env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal) + simp only [extendMany_prefix, extendMany_suffix] at actual + constructor + · rintro ⟨fields, ground, recognized⟩ + exact ⟨fields, ground, (actual fields ground).1 recognized⟩ + · rintro ⟨fields, ground, raw⟩ + exact ⟨fields, ground, (actual fields ground).2 raw⟩ + +theorem realize_linkedProfilePreservingTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedProfilePreservingTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ + LinkedProfilePreservingTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) + (env sourceCode) (env targetCode) (env z) := by + rw [M.realize_linkedProfilePreservingTransitionFormula_raw pairing unions powers separation collection + K Labels C D rD N sourceCode targetCode z env members omega ordinal] + constructor + · rintro ⟨fields, ground, raw⟩ + exact raw.exists_transition pairing unions powers separation + (fun j => ground (j.castAdd 29)) (fun j => ground (Fin.natAdd 24 (j.castAdd 5))) + (ground 48) (ground 49) (members C) (members D) (members rD) omega + · rintro ⟨source, target, sourceEq, targetEq, transition, codeEq, coverage, preserved⟩ + let extra : Fin 5 → ZFSet.{u} := Fin.cases transition.map.points (Fin.cases transition.map.actors + (Fin.cases source.main.birth (Fin.cases target.main.birth + (fun _ => M.groundPower source.main.stage.carrier)))) + let fields : Fin 53 → ZFSet.{u} := Fin.addCases (m := 24) (n := 29) source.rawFields (Fin.addCases (m := 24) (n := 5) target.rawFields extra) + have extraGround : ∀ j, extra j ∈ M.sets := + Fin.cases transition.map.points_ground (Fin.cases transition.map.actors_ground + (Fin.cases source.main.birth_ground (Fin.cases target.main.birth_ground + (fun _ => M.groundPower_mem powers source.main.stage.carrier_ground)))) + have grounded : ∀ j, fields j ∈ M.sets := by + intro j + refine Fin.addCases (m := 24) (n := 29) ?_ ?_ j + · intro k + simpa only [fields, Fin.addCases_left] using source.rawFields_ground pairing k + · intro k + refine Fin.addCases (m := 24) (n := 5) ?_ ?_ k + · intro a + simpa only [fields, Fin.addCases_right, Fin.addCases_left] using target.rawFields_ground pairing a + · intro a + simpa only [fields, Fin.addCases_right] using extraGround a + refine ⟨fields, grounded, ?_⟩ + have smap : (fun j : Fin 24 => fields (j.castAdd 29)) = source.rawFields := by + funext j + simp only [fields, Fin.addCases_left] + have tmap : (fun j : Fin 24 => fields (Fin.natAdd 24 (j.castAdd 5))) = target.rawFields := by + funext j + simp only [fields, Fin.addCases_right, Fin.addCases_left] + rw [smap, tmap, omega] + change LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) ZFSet.omega + (env sourceCode) (env targetCode) (env z) transition.map.points transition.map.actors + (source.main.birth) (target.main.birth) + (M.groundPower source.main.stage.carrier) source.rawFields target.rawFields + rw [← sourceEq, ← targetEq, ← codeEq] + exact source.profileTransition_rawFields target transition coverage preserved + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedTransitionRetarget.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedTransitionRetarget.lean index 7c70699bda5cacce0f0a6daf75c75c8685f21b34..9a9b1dd706c17f4e6f62b945925a0f1fca66dc08 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedTransitionRetarget.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLinkedTransitionRetarget.lean @@ -1,250 +1,250 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.LinkedMainTransitionRawCodes - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -def LinkedMainTransitionCode (M : TransitiveGround.{u}) - (K Labels C D rD sourceCode targetCode z : ZFSet.{u}) : Prop := - ∃ source target : GroundLinkedMainStage M K Labels C D rD, - source.code = sourceCode ∧ target.code = targetCode ∧ - ∃ transition : GroundChronologicalMainTransition source.main target.main, - transition.map.code = z ∧ transition.CoversOldBirths - -namespace LinkedMainTransitionRawCode -variable {M : TransitiveGround.{u}} -variable {K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u}} -variable {source target : Fin 24 → ZFSet.{u}} - -theorem exists_transition - (raw : LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors - sourceBirth targetBirth source target) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (sourceGround : ∀ j, source j ∈ M.sets) (targetGround : ∀ j, target j ∈ M.sets) - (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) : - LinkedMainTransitionCode M K Labels C D rD sourceCode targetCode z := by - obtain ⟨s, hs, sf⟩ := raw.1.exists_linked_fields pairing unions powers separation sourceGround hC hD hrD omega - obtain ⟨t, ht, tf⟩ := raw.2.1.exists_linked_fields pairing unions powers separation targetGround hC hD hrD omega - obtain ⟨sb, tb, ⟨encoded, ordinary, chronological⟩, coverage⟩ := raw.2.2 - rw [← sf] at sb coverage - rw [← tf] at tb - rw [← sf, ← tf] at ordinary chronological - change ZFSet.pair s.main.cutoff sourceBirth ∈ s.serial.fields.graph 3 at sb - change ZFSet.pair t.main.cutoff targetBirth ∈ t.serial.fields.graph 3 at tb - have sourceEq : sourceBirth = s.main.birth := - (s.serial.fields.value_eq_of_entry 3 sb).symm.trans s.terminal_values.2.2.2.1 - have targetEq : targetBirth = t.main.birth := - (t.serial.fields.value_eq_of_entry 3 tb).symm.trans t.terminal_values.2.2.2.1 - rw [s.rawFields_graphs, t.rawFields_graphs, sourceEq, targetEq] at chronological - rw [targetEq] at coverage - let map : GroundMainTransition s.main.stage t.main.stage := - GroundMainTransition.ofLaws hPoints hActors ordinary - let transition := GroundChronologicalMainTransition.ofFieldLaws s.serial.fields t.serial.fields - s.agreement t.agreement map chronological - exact ⟨s, t, hs, ht, transition, encoded.symm, coverage⟩ - -end LinkedMainTransitionRawCode - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (source target : GroundLinkedMainStage M K Labels C D rD) - -theorem transition_rawFields - (transition : GroundChronologicalMainTransition source.main target.main) - (coverage : transition.CoversOldBirths) : - LinkedMainTransitionRawCode M K Labels C D rD ZFSet.omega source.code target.code - transition.map.code transition.map.points transition.map.actors source.main.birth target.main.birth - source.rawFields target.rawFields := by - refine ⟨source.rawFields_code, target.rawFields_code, ?_, ?_, ⟨rfl, transition.map.laws, ?_⟩, coverage⟩ - · change ZFSet.pair source.main.cutoff source.main.birth ∈ source.serial.fields.graph 3 - rw [← source.terminal_values.2.2.2.1] - exact source.serial.fields.value_entry 3 (ZFSet.mem_insert _ _) - · change ZFSet.pair target.main.cutoff target.main.birth ∈ target.serial.fields.graph 3 - rw [← target.terminal_values.2.2.2.1] - exact target.serial.fields.value_entry 3 (ZFSet.mem_insert _ _) - · rw [source.rawFields_graphs, target.rawFields_graphs] - exact transition.field_laws source.serial.fields target.serial.fields source.agreement target.agreement - -end GroundLinkedMainStage - -namespace SetFormula - -def linkedMainTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) : SetFormula n := - let old := suffixIndex n 52 - let fresh := prefixIndex n 52 - exBlock 52 (linkedMainTransitionRawFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (old sourceCode) (old targetCode) (old z) (fresh 48) (fresh 49) (fresh 50) (fresh 51) - (fun j => fresh (j.castAdd 28)) (fun j => fresh (Fin.natAdd 24 (j.castAdd 4)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem realize_linkedMainTransitionFormula_raw {n} (K Labels C D rD N sourceCode targetCode z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedMainTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ - ∃ fields : Fin 52 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ - LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env sourceCode) (env targetCode) (env z) (fields 48) (fields 49) (fields 50) (fields 51) - (fun j => fields (j.castAdd 28)) (fun j => fields (Fin.natAdd 24 (j.castAdd 4))) := by - rw [linkedMainTransitionFormula, realize_exBlock] - have actual (fields : Fin 52 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := - M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection - (suffixIndex n 52 K) (suffixIndex n 52 Labels) (suffixIndex n 52 C) (suffixIndex n 52 D) - (suffixIndex n 52 rD) (suffixIndex n 52 N) (suffixIndex n 52 sourceCode) - (suffixIndex n 52 targetCode) (suffixIndex n 52 z) - (prefixIndex n 52 48) (prefixIndex n 52 49) (prefixIndex n 52 50) (prefixIndex n 52 51) - (fun j => prefixIndex n 52 (j.castAdd 28)) (fun j => prefixIndex n 52 (Fin.natAdd 24 (j.castAdd 4))) - (extendMany 52 fields env) (extendMany_members 52 fields env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal) - simp only [extendMany_prefix, extendMany_suffix] at actual - constructor - · rintro ⟨fields, ground, recognized⟩ - exact ⟨fields, ground, (actual fields ground).1 recognized⟩ - · rintro ⟨fields, ground, raw⟩ - exact ⟨fields, ground, (actual fields ground).2 raw⟩ - -theorem realize_linkedMainTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedMainTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ - LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) - (env sourceCode) (env targetCode) (env z) := by - rw [M.realize_linkedMainTransitionFormula_raw pairing unions powers separation collection - K Labels C D rD N sourceCode targetCode z env members omega ordinal] - constructor - · rintro ⟨fields, ground, raw⟩ - exact raw.exists_transition pairing unions powers separation - (fun j => ground (j.castAdd 28)) (fun j => ground (Fin.natAdd 24 (j.castAdd 4))) - (ground 48) (ground 49) (members C) (members D) (members rD) omega - · rintro ⟨source, target, sourceEq, targetEq, transition, codeEq, coverage⟩ - let extra : Fin 4 → ZFSet.{u} := Fin.cases transition.map.points (Fin.cases transition.map.actors - (Fin.cases source.main.birth (fun _ => target.main.birth))) - let fields : Fin 52 → ZFSet.{u} := Fin.addCases (m := 24) (n := 28) source.rawFields (Fin.addCases (m := 24) (n := 4) target.rawFields extra) - have extraGround : ∀ j, extra j ∈ M.sets := - Fin.cases transition.map.points_ground (Fin.cases transition.map.actors_ground - (Fin.cases source.main.birth_ground (fun _ => target.main.birth_ground))) - have grounded : ∀ j, fields j ∈ M.sets := by - intro j - refine Fin.addCases (m := 24) (n := 28) ?_ ?_ j - · intro k - simpa only [fields, Fin.addCases_left] using source.rawFields_ground pairing k - · intro k - refine Fin.addCases (m := 24) (n := 4) ?_ ?_ k - · intro a - simpa only [fields, Fin.addCases_right, Fin.addCases_left] using target.rawFields_ground pairing a - · intro a - simpa only [fields, Fin.addCases_right] using extraGround a - refine ⟨fields, grounded, ?_⟩ - have smap : (fun j : Fin 24 => fields (j.castAdd 28)) = source.rawFields := by - funext j - simp only [fields, Fin.addCases_left] - have tmap : (fun j : Fin 24 => fields (Fin.natAdd 24 (j.castAdd 4))) = target.rawFields := by - funext j - simp only [fields, Fin.addCases_right, Fin.addCases_left] - rw [smap, tmap, omega] - change LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) ZFSet.omega - (env sourceCode) (env targetCode) (env z) transition.map.points transition.map.actors - source.main.birth target.main.birth source.rawFields target.rawFields - rw [← sourceEq, ← targetEq, ← codeEq] - exact source.transition_rawFields target transition coverage - -end TransitiveGround -end - -universe u - -namespace GroundChronologicalMainTransition -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target chosenSource chosenTarget : GroundLinkedMainStage M K Labels C D rD} -def retargetLinked (transition : GroundChronologicalMainTransition source.main target.main) - (sourceCode : source.code = chosenSource.code) (targetCode : target.code = chosenTarget.code) : GroundChronologicalMainTransition chosenSource.main chosenTarget.main := by - have first := source.same_code chosenSource sourceCode - have second := target.same_code chosenTarget targetCode - let points := transition.map.points - let actors := transition.map.actors - have ordinary : MainTransitionLaws source.main.stage.carrier target.main.stage.carrier - source.main.stage.order target.main.stage.order source.main.stage.meetGraph target.main.stage.meetGraph - source.main.stage.actors target.main.stage.actors source.main.stage.multiplication target.main.stage.multiplication - source.main.stage.identity target.main.stage.identity source.main.stage.action target.main.stage.action - source.main.stage.bottom target.main.stage.bottom source.main.stage.height target.main.stage.height points actors := - transition.map.laws - rw [first.stage, second.stage] at ordinary - let map : GroundMainTransition chosenSource.main.stage chosenTarget.main.stage := - GroundMainTransition.ofLaws transition.map.points_ground transition.map.actors_ground ordinary - refine { map := map, cutoff_le := ?_, birth := ?_, history_prefix := ?_ } - · simpa only [first.cutoff, second.cutoff] using transition.cutoff_le - · intro x y t entry - rw [← first.birth, ← second.birth] - exact transition.birth x y t entry - · intro s before - have oldBefore : s = source.main.cutoff ∨ s ∈ source.main.cutoff := by - simpa only [first.cutoff] using before - have original := transition.history_prefix s oldBefore - have lower := first.history_five s oldBefore - have upper := second.history_five s (transition.prefix_bound oldBefore) - exact ⟨upper.1.symm.trans (original.1.trans lower.1), - upper.2.1.symm.trans (original.2.1.trans lower.2.1), - upper.2.2.1.symm.trans (original.2.2.1.trans lower.2.2.1), - upper.2.2.2.1.symm.trans (original.2.2.2.1.trans lower.2.2.2.1), - upper.2.2.2.2.symm.trans (original.2.2.2.2.trans lower.2.2.2.2)⟩ - -variable (transition : GroundChronologicalMainTransition source.main target.main) -variable (sourceCode : source.code = chosenSource.code) (targetCode : target.code = chosenTarget.code) - -theorem retargetLinked_points : - (transition.retargetLinked sourceCode targetCode).map.points = transition.map.points := rfl - -theorem retargetLinked_actors : - (transition.retargetLinked sourceCode targetCode).map.actors = transition.map.actors := rfl - -theorem retargetLinked_code : - (transition.retargetLinked sourceCode targetCode).map.code = transition.map.code := rfl - -theorem retargetLinked_coversOldBirths_iff : - (transition.retargetLinked sourceCode targetCode).CoversOldBirths ↔ transition.CoversOldBirths := by - have first := source.same_code chosenSource sourceCode - have second := target.same_code chosenTarget targetCode - change OldBirthFiberCoverageCode chosenSource.main.stage.carrier transition.map.points - chosenTarget.main.birth chosenSource.main.cutoff ↔ _ - rw [← first.stage, ← second.birth, ← first.cutoff] - rfl - -theorem retargetLinked_coversOldBirths (coverage : transition.CoversOldBirths) : - (transition.retargetLinked sourceCode targetCode).CoversOldBirths := - (transition.retargetLinked_coversOldBirths_iff sourceCode targetCode).2 coverage - -end GroundChronologicalMainTransition - -namespace LinkedMainTransitionCode -variable {M : TransitiveGround.{u}} {K Labels C D rD z : ZFSet.{u}} - -theorem exists_at (source target : GroundLinkedMainStage M K Labels C D rD) - (code : LinkedMainTransitionCode M K Labels C D rD source.code target.code z) : - ∃ transition : GroundChronologicalMainTransition source.main target.main, - transition.map.code = z ∧ transition.CoversOldBirths := by - obtain ⟨first, second, sourceCode, targetCode, transition, equal, coverage⟩ := code - exact ⟨transition.retargetLinked sourceCode targetCode, - (transition.retargetLinked_code sourceCode targetCode).trans equal, - transition.retargetLinked_coversOldBirths sourceCode targetCode coverage⟩ - -end LinkedMainTransitionCode - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.LinkedMainTransitionRawCodes + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +def LinkedMainTransitionCode (M : TransitiveGround.{u}) + (K Labels C D rD sourceCode targetCode z : ZFSet.{u}) : Prop := + ∃ source target : GroundLinkedMainStage M K Labels C D rD, + source.code = sourceCode ∧ target.code = targetCode ∧ + ∃ transition : GroundChronologicalMainTransition source.main target.main, + transition.map.code = z ∧ transition.CoversOldBirths + +namespace LinkedMainTransitionRawCode +variable {M : TransitiveGround.{u}} +variable {K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u}} +variable {source target : Fin 24 → ZFSet.{u}} + +theorem exists_transition + (raw : LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors + sourceBirth targetBirth source target) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (sourceGround : ∀ j, source j ∈ M.sets) (targetGround : ∀ j, target j ∈ M.sets) + (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) : + LinkedMainTransitionCode M K Labels C D rD sourceCode targetCode z := by + obtain ⟨s, hs, sf⟩ := raw.1.exists_linked_fields pairing unions powers separation sourceGround hC hD hrD omega + obtain ⟨t, ht, tf⟩ := raw.2.1.exists_linked_fields pairing unions powers separation targetGround hC hD hrD omega + obtain ⟨sb, tb, ⟨encoded, ordinary, chronological⟩, coverage⟩ := raw.2.2 + rw [← sf] at sb coverage + rw [← tf] at tb + rw [← sf, ← tf] at ordinary chronological + change ZFSet.pair s.main.cutoff sourceBirth ∈ s.serial.fields.graph 3 at sb + change ZFSet.pair t.main.cutoff targetBirth ∈ t.serial.fields.graph 3 at tb + have sourceEq : sourceBirth = s.main.birth := + (s.serial.fields.value_eq_of_entry 3 sb).symm.trans s.terminal_values.2.2.2.1 + have targetEq : targetBirth = t.main.birth := + (t.serial.fields.value_eq_of_entry 3 tb).symm.trans t.terminal_values.2.2.2.1 + rw [s.rawFields_graphs, t.rawFields_graphs, sourceEq, targetEq] at chronological + rw [targetEq] at coverage + let map : GroundMainTransition s.main.stage t.main.stage := + GroundMainTransition.ofLaws hPoints hActors ordinary + let transition := GroundChronologicalMainTransition.ofFieldLaws s.serial.fields t.serial.fields + s.agreement t.agreement map chronological + exact ⟨s, t, hs, ht, transition, encoded.symm, coverage⟩ + +end LinkedMainTransitionRawCode + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (source target : GroundLinkedMainStage M K Labels C D rD) + +theorem transition_rawFields + (transition : GroundChronologicalMainTransition source.main target.main) + (coverage : transition.CoversOldBirths) : + LinkedMainTransitionRawCode M K Labels C D rD ZFSet.omega source.code target.code + transition.map.code transition.map.points transition.map.actors source.main.birth target.main.birth + source.rawFields target.rawFields := by + refine ⟨source.rawFields_code, target.rawFields_code, ?_, ?_, ⟨rfl, transition.map.laws, ?_⟩, coverage⟩ + · change ZFSet.pair source.main.cutoff source.main.birth ∈ source.serial.fields.graph 3 + rw [← source.terminal_values.2.2.2.1] + exact source.serial.fields.value_entry 3 (ZFSet.mem_insert _ _) + · change ZFSet.pair target.main.cutoff target.main.birth ∈ target.serial.fields.graph 3 + rw [← target.terminal_values.2.2.2.1] + exact target.serial.fields.value_entry 3 (ZFSet.mem_insert _ _) + · rw [source.rawFields_graphs, target.rawFields_graphs] + exact transition.field_laws source.serial.fields target.serial.fields source.agreement target.agreement + +end GroundLinkedMainStage + +namespace SetFormula + +def linkedMainTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) : SetFormula n := + let old := suffixIndex n 52 + let fresh := prefixIndex n 52 + exBlock 52 (linkedMainTransitionRawFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (old sourceCode) (old targetCode) (old z) (fresh 48) (fresh 49) (fresh 50) (fresh 51) + (fun j => fresh (j.castAdd 28)) (fun j => fresh (Fin.natAdd 24 (j.castAdd 4)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem realize_linkedMainTransitionFormula_raw {n} (K Labels C D rD N sourceCode targetCode z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedMainTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ + ∃ fields : Fin 52 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ + LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env sourceCode) (env targetCode) (env z) (fields 48) (fields 49) (fields 50) (fields 51) + (fun j => fields (j.castAdd 28)) (fun j => fields (Fin.natAdd 24 (j.castAdd 4))) := by + rw [linkedMainTransitionFormula, realize_exBlock] + have actual (fields : Fin 52 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := + M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection + (suffixIndex n 52 K) (suffixIndex n 52 Labels) (suffixIndex n 52 C) (suffixIndex n 52 D) + (suffixIndex n 52 rD) (suffixIndex n 52 N) (suffixIndex n 52 sourceCode) + (suffixIndex n 52 targetCode) (suffixIndex n 52 z) + (prefixIndex n 52 48) (prefixIndex n 52 49) (prefixIndex n 52 50) (prefixIndex n 52 51) + (fun j => prefixIndex n 52 (j.castAdd 28)) (fun j => prefixIndex n 52 (Fin.natAdd 24 (j.castAdd 4))) + (extendMany 52 fields env) (extendMany_members 52 fields env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal) + simp only [extendMany_prefix, extendMany_suffix] at actual + constructor + · rintro ⟨fields, ground, recognized⟩ + exact ⟨fields, ground, (actual fields ground).1 recognized⟩ + · rintro ⟨fields, ground, raw⟩ + exact ⟨fields, ground, (actual fields ground).2 raw⟩ + +theorem realize_linkedMainTransitionFormula {n} (K Labels C D rD N sourceCode targetCode z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedMainTransitionFormula K Labels C D rD N sourceCode targetCode z) env ↔ + LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) + (env sourceCode) (env targetCode) (env z) := by + rw [M.realize_linkedMainTransitionFormula_raw pairing unions powers separation collection + K Labels C D rD N sourceCode targetCode z env members omega ordinal] + constructor + · rintro ⟨fields, ground, raw⟩ + exact raw.exists_transition pairing unions powers separation + (fun j => ground (j.castAdd 28)) (fun j => ground (Fin.natAdd 24 (j.castAdd 4))) + (ground 48) (ground 49) (members C) (members D) (members rD) omega + · rintro ⟨source, target, sourceEq, targetEq, transition, codeEq, coverage⟩ + let extra : Fin 4 → ZFSet.{u} := Fin.cases transition.map.points (Fin.cases transition.map.actors + (Fin.cases source.main.birth (fun _ => target.main.birth))) + let fields : Fin 52 → ZFSet.{u} := Fin.addCases (m := 24) (n := 28) source.rawFields (Fin.addCases (m := 24) (n := 4) target.rawFields extra) + have extraGround : ∀ j, extra j ∈ M.sets := + Fin.cases transition.map.points_ground (Fin.cases transition.map.actors_ground + (Fin.cases source.main.birth_ground (fun _ => target.main.birth_ground))) + have grounded : ∀ j, fields j ∈ M.sets := by + intro j + refine Fin.addCases (m := 24) (n := 28) ?_ ?_ j + · intro k + simpa only [fields, Fin.addCases_left] using source.rawFields_ground pairing k + · intro k + refine Fin.addCases (m := 24) (n := 4) ?_ ?_ k + · intro a + simpa only [fields, Fin.addCases_right, Fin.addCases_left] using target.rawFields_ground pairing a + · intro a + simpa only [fields, Fin.addCases_right] using extraGround a + refine ⟨fields, grounded, ?_⟩ + have smap : (fun j : Fin 24 => fields (j.castAdd 28)) = source.rawFields := by + funext j + simp only [fields, Fin.addCases_left] + have tmap : (fun j : Fin 24 => fields (Fin.natAdd 24 (j.castAdd 4))) = target.rawFields := by + funext j + simp only [fields, Fin.addCases_right, Fin.addCases_left] + rw [smap, tmap, omega] + change LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) ZFSet.omega + (env sourceCode) (env targetCode) (env z) transition.map.points transition.map.actors + source.main.birth target.main.birth source.rawFields target.rawFields + rw [← sourceEq, ← targetEq, ← codeEq] + exact source.transition_rawFields target transition coverage + +end TransitiveGround +end + +universe u + +namespace GroundChronologicalMainTransition +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target chosenSource chosenTarget : GroundLinkedMainStage M K Labels C D rD} +def retargetLinked (transition : GroundChronologicalMainTransition source.main target.main) + (sourceCode : source.code = chosenSource.code) (targetCode : target.code = chosenTarget.code) : GroundChronologicalMainTransition chosenSource.main chosenTarget.main := by + have first := source.same_code chosenSource sourceCode + have second := target.same_code chosenTarget targetCode + let points := transition.map.points + let actors := transition.map.actors + have ordinary : MainTransitionLaws source.main.stage.carrier target.main.stage.carrier + source.main.stage.order target.main.stage.order source.main.stage.meetGraph target.main.stage.meetGraph + source.main.stage.actors target.main.stage.actors source.main.stage.multiplication target.main.stage.multiplication + source.main.stage.identity target.main.stage.identity source.main.stage.action target.main.stage.action + source.main.stage.bottom target.main.stage.bottom source.main.stage.height target.main.stage.height points actors := + transition.map.laws + rw [first.stage, second.stage] at ordinary + let map : GroundMainTransition chosenSource.main.stage chosenTarget.main.stage := + GroundMainTransition.ofLaws transition.map.points_ground transition.map.actors_ground ordinary + refine { map := map, cutoff_le := ?_, birth := ?_, history_prefix := ?_ } + · simpa only [first.cutoff, second.cutoff] using transition.cutoff_le + · intro x y t entry + rw [← first.birth, ← second.birth] + exact transition.birth x y t entry + · intro s before + have oldBefore : s = source.main.cutoff ∨ s ∈ source.main.cutoff := by + simpa only [first.cutoff] using before + have original := transition.history_prefix s oldBefore + have lower := first.history_five s oldBefore + have upper := second.history_five s (transition.prefix_bound oldBefore) + exact ⟨upper.1.symm.trans (original.1.trans lower.1), + upper.2.1.symm.trans (original.2.1.trans lower.2.1), + upper.2.2.1.symm.trans (original.2.2.1.trans lower.2.2.1), + upper.2.2.2.1.symm.trans (original.2.2.2.1.trans lower.2.2.2.1), + upper.2.2.2.2.symm.trans (original.2.2.2.2.trans lower.2.2.2.2)⟩ + +variable (transition : GroundChronologicalMainTransition source.main target.main) +variable (sourceCode : source.code = chosenSource.code) (targetCode : target.code = chosenTarget.code) + +theorem retargetLinked_points : + (transition.retargetLinked sourceCode targetCode).map.points = transition.map.points := rfl + +theorem retargetLinked_actors : + (transition.retargetLinked sourceCode targetCode).map.actors = transition.map.actors := rfl + +theorem retargetLinked_code : + (transition.retargetLinked sourceCode targetCode).map.code = transition.map.code := rfl + +theorem retargetLinked_coversOldBirths_iff : + (transition.retargetLinked sourceCode targetCode).CoversOldBirths ↔ transition.CoversOldBirths := by + have first := source.same_code chosenSource sourceCode + have second := target.same_code chosenTarget targetCode + change OldBirthFiberCoverageCode chosenSource.main.stage.carrier transition.map.points + chosenTarget.main.birth chosenSource.main.cutoff ↔ _ + rw [← first.stage, ← second.birth, ← first.cutoff] + rfl + +theorem retargetLinked_coversOldBirths (coverage : transition.CoversOldBirths) : + (transition.retargetLinked sourceCode targetCode).CoversOldBirths := + (transition.retargetLinked_coversOldBirths_iff sourceCode targetCode).2 coverage + +end GroundChronologicalMainTransition + +namespace LinkedMainTransitionCode +variable {M : TransitiveGround.{u}} {K Labels C D rD z : ZFSet.{u}} + +theorem exists_at (source target : GroundLinkedMainStage M K Labels C D rD) + (code : LinkedMainTransitionCode M K Labels C D rD source.code target.code z) : + ∃ transition : GroundChronologicalMainTransition source.main target.main, + transition.map.code = z ∧ transition.CoversOldBirths := by + obtain ⟨first, second, sourceCode, targetCode, transition, equal, coverage⟩ := code + exact ⟨transition.retargetLinked sourceCode targetCode, + (transition.retargetLinked_code sourceCode targetCode).trans equal, + transition.retargetLinked_coversOldBirths sourceCode targetCode coverage⟩ + +end LinkedMainTransitionCode + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiteralTaskFieldRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiteralTaskFieldRecognition.lean index 0f9719b46a7b46c98a3fce37e9c3904c3820da69..6a15509e5b1240868d58f1e9d999845783130484 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiteralTaskFieldRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundLiteralTaskFieldRecognition.lean @@ -1,152 +1,152 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem literalTaskBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P R U Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hR : R ∈ M.sets) - (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) : literalTaskBound P R U Labels ∈ M.sets := - M.prod_mem pairing unions powers separation hP - (M.prod_mem pairing unions powers separation hP - (M.prod_mem pairing unions powers separation hR - (M.prod_mem pairing unions powers separation hP - (M.prod_mem pairing unions powers separation hU hLabels)))) - -theorem literalTaskFieldBound_mem - {P R U Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hR : R ∈ M.sets) - (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) (j : Fin 6) : - literalTaskFieldBound P R U Labels j ∈ M.sets := - Fin.cases hP (Fin.cases hP (Fin.cases hR (Fin.cases hP - (Fin.cases hU (Fin.cases hLabels (fun i => Fin.elim0 i)))))) j - -theorem literalTaskFieldGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I P R U Labels : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hR : R ∈ M.sets) - (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) (j : Fin 6) : - literalTaskFieldGraph I P R U Labels j ∈ M.sets := by - let params := extend I (extend P (extend R (extend U (extend Labels Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.literalTaskFieldEntryFormula j 0 1 2 3 4 5) params - (Fin.cases hI (Fin.cases hP (Fin.cases hR (Fin.cases hU (Fin.cases hLabels - (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hI - (M.literalTaskFieldBound_mem hP hR hU hLabels j)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.literalTaskFieldEntryFormula j 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod I (literalTaskFieldBound P R U Labels j)) = - literalTaskFieldGraph I P R U Labels j := by - apply ZFSet.ext - intro z - rw [literalTaskFieldGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_literalTaskFieldEntryFormula j 0 1 2 3 4 5 _) - exact equal ▸ selected - -theorem literalTaskFieldFamilies - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I P R U Labels : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hR : R ∈ M.sets) - (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) - (subset : I ⊆ literalTaskBound P R U Labels) : - ∀ j : Fin 6, literalTaskFieldGraph I P R U Labels j ∈ M.sets ∧ - ZFSet.IsFunc I (literalTaskFieldBound P R U Labels j) (literalTaskFieldGraph I P R U Labels j) := - fun j => ⟨M.literalTaskFieldGraph_mem pairing unions powers separation hI hP hR hU hLabels j, - literalTaskFieldGraph_function subset j⟩ - -theorem constantFamilyGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I x : ZFSet.{u}} (hI : I ∈ M.sets) (hx : x ∈ M.sets) : constantFamilyGraph I x ∈ M.sets := by - have single : ({x} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hx hx - exact M.prod_mem pairing unions powers separation hI single - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace SetFormula - -def literalTaskFieldSetFormula {n} (j : Fin 6) (output I P R U Labels : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.literalTaskFieldEntryFormula j 0 I.succ P.succ R.succ U.succ Labels.succ).toFormula - -def constantFamilySetFormula {n} (output I x : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.exMem I.succ (BoundedFormula.orderedPairFormula 1 0 x.succ.succ)).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_literalTaskFieldSetFormula {n} (j : Fin 6) (output I P R U Labels : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (literalTaskFieldSetFormula j output I P R U Labels) env ↔ - env output = literalTaskFieldGraph (env I) (env P) (env R) (env U) (env Labels) j := by - apply M.realize_exactSetFormula output _ env (members output) - (fun z hz => M.transitive (M.literalTaskFieldGraph_mem pairing unions powers separation - (members I) (members P) (members R) (members U) (members Labels) j) hz) - intro z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_literalTaskFieldEntryFormula] - exact (mem_literalTaskFieldGraph _ _ _ _ _ _ j).symm - -theorem realize_constantFamilySetFormula {n} (output I x : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (constantFamilySetFormula output I x) env ↔ - env output = constantFamilyGraph (env I) (env x) := by - apply M.realize_exactSetFormula output _ env (members output) - (fun z hz => M.transitive (M.constantFamilyGraph_mem pairing unions powers separation - (members I) (members x)) hz) - intro z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_exMem] - simp only [BoundedFormula.truth_orderedPairFormula] - change (∃ i ∈ env I, z = ZFSet.pair i (env x)) ↔ z ∈ constantFamilyGraph (env I) (env x) - constructor - · rintro ⟨i, hi, rfl⟩ - exact ZFSet.pair_mem_prod.2 ⟨hi, ZFSet.mem_singleton.2 rfl⟩ - · intro entry - obtain ⟨i, hi, y, hy, equal⟩ := ZFSet.mem_prod.1 entry - have same := ZFSet.mem_singleton.1 hy - exact ⟨i, hi, same ▸ equal⟩ - -noncomputable def definable_literalTaskField (j : Fin 6) : GroundDefinableFunction M - (fun env : Fin 5 → ZFSet.{u} => literalTaskFieldGraph (env 0) (env 1) (env 2) (env 3) (env 4) j) where - formula := literalTaskFieldSetFormula j 0 1 2 3 4 5 - closed := fun _ members => M.literalTaskFieldGraph_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) j - correct := fun env members z hz => M.realize_literalTaskFieldSetFormula pairing unions powers separation - j 0 1 2 3 4 5 (extend z env) (Fin.cases hz members) - -noncomputable def definable_constantFamily : GroundDefinableFunction M - (fun env : Fin 2 → ZFSet.{u} => constantFamilyGraph (env 0) (env 1)) where - formula := constantFamilySetFormula 0 1 2 - closed := fun _ members => M.constantFamilyGraph_mem pairing unions powers separation (members 0) (members 1) - correct := fun env members z hz => M.realize_constantFamilySetFormula pairing unions powers separation - 0 1 2 (extend z env) (Fin.cases hz members) - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem literalTaskBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P R U Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hR : R ∈ M.sets) + (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) : literalTaskBound P R U Labels ∈ M.sets := + M.prod_mem pairing unions powers separation hP + (M.prod_mem pairing unions powers separation hP + (M.prod_mem pairing unions powers separation hR + (M.prod_mem pairing unions powers separation hP + (M.prod_mem pairing unions powers separation hU hLabels)))) + +theorem literalTaskFieldBound_mem + {P R U Labels : ZFSet.{u}} (hP : P ∈ M.sets) (hR : R ∈ M.sets) + (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) (j : Fin 6) : + literalTaskFieldBound P R U Labels j ∈ M.sets := + Fin.cases hP (Fin.cases hP (Fin.cases hR (Fin.cases hP + (Fin.cases hU (Fin.cases hLabels (fun i => Fin.elim0 i)))))) j + +theorem literalTaskFieldGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I P R U Labels : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hR : R ∈ M.sets) + (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) (j : Fin 6) : + literalTaskFieldGraph I P R U Labels j ∈ M.sets := by + let params := extend I (extend P (extend R (extend U (extend Labels Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.literalTaskFieldEntryFormula j 0 1 2 3 4 5) params + (Fin.cases hI (Fin.cases hP (Fin.cases hR (Fin.cases hU (Fin.cases hLabels + (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hI + (M.literalTaskFieldBound_mem hP hR hU hLabels j)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.literalTaskFieldEntryFormula j 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod I (literalTaskFieldBound P R U Labels j)) = + literalTaskFieldGraph I P R U Labels j := by + apply ZFSet.ext + intro z + rw [literalTaskFieldGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_literalTaskFieldEntryFormula j 0 1 2 3 4 5 _) + exact equal ▸ selected + +theorem literalTaskFieldFamilies + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I P R U Labels : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hR : R ∈ M.sets) + (hU : U ∈ M.sets) (hLabels : Labels ∈ M.sets) + (subset : I ⊆ literalTaskBound P R U Labels) : + ∀ j : Fin 6, literalTaskFieldGraph I P R U Labels j ∈ M.sets ∧ + ZFSet.IsFunc I (literalTaskFieldBound P R U Labels j) (literalTaskFieldGraph I P R U Labels j) := + fun j => ⟨M.literalTaskFieldGraph_mem pairing unions powers separation hI hP hR hU hLabels j, + literalTaskFieldGraph_function subset j⟩ + +theorem constantFamilyGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I x : ZFSet.{u}} (hI : I ∈ M.sets) (hx : x ∈ M.sets) : constantFamilyGraph I x ∈ M.sets := by + have single : ({x} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hx hx + exact M.prod_mem pairing unions powers separation hI single + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace SetFormula + +def literalTaskFieldSetFormula {n} (j : Fin 6) (output I P R U Labels : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.literalTaskFieldEntryFormula j 0 I.succ P.succ R.succ U.succ Labels.succ).toFormula + +def constantFamilySetFormula {n} (output I x : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.exMem I.succ (BoundedFormula.orderedPairFormula 1 0 x.succ.succ)).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_literalTaskFieldSetFormula {n} (j : Fin 6) (output I P R U Labels : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (literalTaskFieldSetFormula j output I P R U Labels) env ↔ + env output = literalTaskFieldGraph (env I) (env P) (env R) (env U) (env Labels) j := by + apply M.realize_exactSetFormula output _ env (members output) + (fun z hz => M.transitive (M.literalTaskFieldGraph_mem pairing unions powers separation + (members I) (members P) (members R) (members U) (members Labels) j) hz) + intro z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_literalTaskFieldEntryFormula] + exact (mem_literalTaskFieldGraph _ _ _ _ _ _ j).symm + +theorem realize_constantFamilySetFormula {n} (output I x : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (constantFamilySetFormula output I x) env ↔ + env output = constantFamilyGraph (env I) (env x) := by + apply M.realize_exactSetFormula output _ env (members output) + (fun z hz => M.transitive (M.constantFamilyGraph_mem pairing unions powers separation + (members I) (members x)) hz) + intro z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_exMem] + simp only [BoundedFormula.truth_orderedPairFormula] + change (∃ i ∈ env I, z = ZFSet.pair i (env x)) ↔ z ∈ constantFamilyGraph (env I) (env x) + constructor + · rintro ⟨i, hi, rfl⟩ + exact ZFSet.pair_mem_prod.2 ⟨hi, ZFSet.mem_singleton.2 rfl⟩ + · intro entry + obtain ⟨i, hi, y, hy, equal⟩ := ZFSet.mem_prod.1 entry + have same := ZFSet.mem_singleton.1 hy + exact ⟨i, hi, same ▸ equal⟩ + +noncomputable def definable_literalTaskField (j : Fin 6) : GroundDefinableFunction M + (fun env : Fin 5 → ZFSet.{u} => literalTaskFieldGraph (env 0) (env 1) (env 2) (env 3) (env 4) j) where + formula := literalTaskFieldSetFormula j 0 1 2 3 4 5 + closed := fun _ members => M.literalTaskFieldGraph_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) j + correct := fun env members z hz => M.realize_literalTaskFieldSetFormula pairing unions powers separation + j 0 1 2 3 4 5 (extend z env) (Fin.cases hz members) + +noncomputable def definable_constantFamily : GroundDefinableFunction M + (fun env : Fin 2 → ZFSet.{u} => constantFamilyGraph (env 0) (env 1)) where + formula := constantFamilySetFormula 0 1 2 + closed := fun _ members => M.constantFamilyGraph_mem pairing unions powers separation (members 0) (members 1) + correct := fun env members z hz => M.realize_constantFamilySetFormula pairing unions powers separation + 0 1 2 (extend z env) (Fin.cases hz members) + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainBoundTaskOutput.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainBoundTaskOutput.lean index f2b74aeb5491e1347aeeb6ae00c4919d388c95c3..d3bb2b69c0c337b1f4d96c5eeeac1162d0c58c36 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainBoundTaskOutput.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainBoundTaskOutput.lean @@ -1,551 +1,551 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTaskBearingSuccessorDecoding - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -noncomputable def compressionActorFamily (I H generators : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ k ∈ H, z = ZFSet.pair i k ∧ - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators) - (ZFSet.prod I H) - -theorem pair_mem_compressionActorFamily (I H generators i k : ZFSet.{u}) : - ZFSet.pair i k ∈ compressionActorFamily I H generators ↔ - i ∈ I ∧ k ∈ H ∧ - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators := by - rw [compressionActorFamily, ZFSet.mem_sep] - constructor - · rintro ⟨_, a, ha, b, hb, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨ha, hb, entry⟩ - · rintro ⟨hi, hk, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hk⟩, i, hi, k, hk, rfl, entry⟩ - -namespace BoundedFormula - -def compressionActorEntryFormula {n} (z I H generators zero requests : Fin n) : BoundedFormula n := - .exMem I (.exMem H.succ (.exMem requests.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 1) - (.conj (orderedPairFormula 0 zero.succ.succ.succ 2) - (tripleMembershipFormula 0 zero.succ.succ.succ 1 generators.succ.succ.succ))))) - -theorem truth_compressionActorEntryFormula {n} (z I H generators zero requests : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (compressionActorEntryFormula z I H generators zero requests) env ↔ - ∃ i ∈ env I, ∃ k ∈ env H, ∃ request ∈ env requests, - env z = ZFSet.pair i k ∧ request = ZFSet.pair (env zero) i ∧ - ZFSet.pair (ZFSet.pair request (env zero)) k ∈ env generators := by - simp only [compressionActorEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem compressionActorFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I H generators : ZFSet.{u}} (hI : I ∈ M.sets) (hH : H ∈ M.sets) (hGenerators : generators ∈ M.sets) : - compressionActorFamily I H generators ∈ M.sets := by - have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I, hI⟩ - have singleton : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing zero zero - let requests := ZFSet.prod {natSetCode 0} I - have hRequests : requests ∈ M.sets := M.prod_mem pairing unions powers separation singleton hI - let env := extend I (extend H (extend generators (extend (natSetCode 0) (extend requests Fin.elim0)))) - have members : ∀ j, env j ∈ M.sets := - Fin.cases hI (Fin.cases hH (Fin.cases hGenerators (Fin.cases zero (Fin.cases hRequests (fun j => Fin.elim0 j))))) - have ground := M.bounded_separation_mem separation - (BoundedFormula.compressionActorEntryFormula 0 1 2 3 4 5) env members - (M.prod_mem pairing unions powers separation hI hH) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.compressionActorEntryFormula 0 1 2 3 4 5) (extend z env)) - (ZFSet.prod I H) = compressionActorFamily I H generators := by - apply ZFSet.ext - intro z - rw [compressionActorFamily, ZFSet.mem_sep, ZFSet.mem_sep] - apply and_congr Iff.rfl - rw [BoundedFormula.truth_compressionActorEntryFormula] - change (∃ i ∈ I, ∃ k ∈ H, ∃ request ∈ requests, - z = ZFSet.pair i k ∧ request = ZFSet.pair (natSetCode 0) i ∧ - ZFSet.pair (ZFSet.pair request (natSetCode 0)) k ∈ generators) ↔ _ - constructor - · rintro ⟨i, hi, k, hk, request, _, eq, rfl, entry⟩ - exact ⟨i, hi, k, hk, eq, entry⟩ - · rintro ⟨i, hi, k, hk, eq, entry⟩ - exact ⟨i, hi, k, hk, _, ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hi⟩, eq, rfl, entry⟩ - exact equal ▸ ground - -end TransitiveGround - -theorem compressionActorFamily_injection {I P Rectangles H generators : ZFSet.{u}} - (injection : InjectionCode (externalChildLetters I P Rectangles) H generators) : - InjectionCode I H (compressionActorFamily I H generators) := by - refine ⟨⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩, ?_⟩ - · intro i hi - have child := (compression_child_iff I P Rectangles i (natSetCode 0)).2 ⟨hi, rfl⟩ - obtain ⟨k, entry, unique⟩ := injection.function.2 _ child - have hk := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 - refine ⟨k, (pair_mem_compressionActorFamily I H generators i k).2 ⟨hi, hk, entry⟩, ?_⟩ - intro l candidate - exact unique l ((pair_mem_compressionActorFamily I H generators i l).1 candidate).2.2 - · intro i j k first second - have equal := injection.injective _ _ _ - ((pair_mem_compressionActorFamily I H generators i k).1 first).2.2 - ((pair_mem_compressionActorFamily I H generators j k).1 second).2.2 - exact (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).1).2 - -end - -namespace GroundCompressionOrigin -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {P G r μ A Labels m inv one τ Reps : ZFSet.{u}} -local notation "I" => M.groundEligibleTasks P G r μ A Labels -local notation "R" => M.groundRelations P P -local notation "U" => M.groundMeetFilters P r μ -variable (origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ (M.groundEligibleTasks P G r μ A Labels) - (literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) Reps G m inv one - (M.groundTaskTransport P G r μ A Labels) - (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include origin pairing unions powers separation - -theorem initial_representatives : TaskRepresentativesCode Reps I P G r A R U Labels := by - refine ⟨origin.state.inputs.representatives, ?_⟩ - intro i g representative - have hi := (ZFSet.pair_mem_prod.1 (origin.state.inputs.representatives.1 representative)).1 - obtain ⟨S, mapEntry⟩ := origin.state.inputs.maps.total hi - have hI : I ∈ M.sets := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.indices - have hP : P ∈ M.sets := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.carrier - have hQs : constantFamilyGraph I P ∈ M.sets := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.spaces - have hrs : constantFamilyGraph I r ∈ M.sets := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.relations - have hAs : literalTaskSourceGraph I P R U Labels ∈ M.sets := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.anchors - have hEs : literalTaskBaseGraph I P R U Labels ∈ M.sets := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.embeddings - have actualMap : ZFSet.pair i S ∈ M.batchEmbeddingFamily I P - (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using mapEntry - have mapEq := (((M.batchEmbeddingFamily_spec pairing unions powers separation - hI hP hQs hrs hAs hEs).2.2 i S).1 actualMap).2 - obtain ⟨a, ha, c, hc, base, hb, e, he, F, hF, label, hl, equal, eligible⟩ := - (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi - obtain ⟨g₀, _, restriction⟩ := eligible.representative - have represented : TaskRepresentative P r A R U Labels i g₀ := - ⟨a, ha, c, hc, base, hb, e, he, F, hF, label, hl, equal, restriction⟩ - have source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels := by - rw [equal] - exact (literalTaskFieldGraph_entry_iff ha hc hb he hF hl 0).2 ⟨equal ▸ hi, rfl⟩ - have agree : ActionAgreementBelow P r A g₀ g a := by - intro x hx y _ below - have stored : ZFSet.pair x y ∈ S ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by - have hx' : x ∈ origin.state.data.D := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using hx - have below' : ZFSet.pair x a ∈ origin.state.data.rD := by - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using below - simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using - origin.state.inputs.agreement i a g S x y source representative mapEntry hx' below' - have canonical := M.groundEligibleTask_representative_base_iff (y := y) - origin.state.inputs.group origin.seed.originalAction origin.seed.originalOrder - hi represented source hx below - dsimp only at canonical - rw [← mapEq] at canonical - exact ((M.groundEligibleBatchAction_old_iff hx).symm.trans canonical.symm).trans - (stored.trans (M.groundEligibleBatchAction_old_iff hx)) - refine ⟨a, ha, c, hc, base, hb, e, he, F, hF, label, hl, equal, - restriction.shape, ?_, ?_⟩ - · exact (agree a ha c hc (origin.seed.originalOrder.order.refl a ha)).1 restriction.target_entry - · intro x hx y hy - constructor - · intro entry - obtain ⟨lower, action⟩ := (restriction.entries x hx y hy).1 entry - exact ⟨lower, (agree x hx y hy lower).1 action⟩ - · rintro ⟨lower, action⟩ - exact (restriction.entries x hx y hy).2 ⟨lower, (agree x hx y hy lower).2 action⟩ - -theorem identityTask_representative_agreement {c e F label g : ZFSet.{u}} - (representative : ZFSet.pair (identityInsertionTask P r c e F label) g ∈ Reps) : - ActionAgreementBelow P r A g one c := by - have restriction := ((origin.initial_representatives pairing unions powers separation).2 - _ _ representative).restriction - change RestrictedActionCode P r A g c c (identityIdealGraph P r c) at restriction - intro x hx y hy lower - have fixed : ZFSet.pair (ZFSet.pair g x) x ∈ A := restriction.entry_action - ((pair_mem_identityIdealGraph P r c x x).2 ⟨rfl, hx, lower⟩) - have oneEntry := origin.seed.originalAction.one x hx - constructor - · intro entry - have equal := (show FunctionGraphOn (ZFSet.prod G P) A from - ⟨P, origin.seed.originalAction.function⟩).unique entry fixed - exact equal.symm ▸ oneEntry - · intro entry - have equal := (show FunctionGraphOn (ZFSet.prod G P) A from - ⟨P, origin.seed.originalAction.function⟩).unique entry oneEntry - exact equal.symm ▸ fixed - -end GroundCompressionOrigin - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -local notation "P" => source.stage.carrier -local notation "r" => source.stage.order -local notation "I" => source.stage.compressionTasks Labels -local notation "Q" => certificate.target.stage.carrier -local notation "rectangles" => externalRectangles P source.stage.actors r source.stage.meetGraph source.stage.action -local notation "letters" => externalChildLetters I P rectangles -local notation "generators" => M.externalChildGenerators source.stage.actors letters source.stage.multiplication source.stage.identity - -omit certificate in -theorem identityInsertion_source_entry {c e F label : ZFSet.{u}} - (hi : identityInsertionTask P r c e F label ∈ I) : - ZFSet.pair (identityInsertionTask P r c e F label) c ∈ source.stage.compressionSources Labels := by - obtain ⟨hc, hc', hb, he, hF, hl, _⟩ := (literalTaskCode_mem_eligibleTaskSet P source.stage.actors r - source.stage.meetGraph source.stage.action (M.groundRelations P P) - (M.groundMeetFilters P r source.stage.meetGraph) Labels c c (identityIdealGraph P r c) e F label).1 hi - exact (literalTaskFieldGraph_entry_iff hc hc' hb he hF hl 0).2 ⟨hi, rfl⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem identityInsertion_representative_image_agreement {c e F label g g' c' : ZFSet.{u}} - (representative : ZFSet.pair (identityInsertionTask P r c e F label) g ∈ certificate.Reps) - (actor : ZFSet.pair g g' ∈ certificate.transition.map.actors) - (image : ZFSet.pair c c' ∈ certificate.transition.map.points) : - ActionAgreementBelow Q certificate.target.stage.order certificate.target.stage.action - g' certificate.target.stage.identity c' := - certificate.transition.map.agreement g source.stage.identity g' certificate.target.stage.identity c c' - actor certificate.transition.map.group_embedding.one image - (certificate.origin.identityTask_representative_agreement pairing unions powers separation representative) - -variable (infinite : Realize M.sets infinity Fin.elim0) -include infinite - -theorem identityInsertion_generator_fixes {c e F label k c' : ZFSet.{u}} - (hi : identityInsertionTask P r c e F label ∈ I) - (generator : ZFSet.pair - (ZFSet.pair (ZFSet.pair (natSetCode 0) (identityInsertionTask P r c e F label)) (natSetCode 0)) k ∈ generators) - (image : ZFSet.pair c c' ∈ certificate.transition.map.points) : - ∀ z ∈ Q, ZFSet.pair z c' ∈ certificate.target.stage.order → - ZFSet.pair (ZFSet.pair k z) z ∈ certificate.target.stage.action := by - obtain ⟨g, representative, _⟩ := certificate.origin.state.inputs.representatives.2 _ hi - have hg := (ZFSet.pair_mem_prod.1 (certificate.origin.state.inputs.representatives.1 representative)).2 - obtain ⟨g', actor, _⟩ := certificate.transition.map.group_embedding.injection.function.2 g hg - have first := certificate.compression_generator_full_agreement pairing unions powers separation infinite hi - (identityInsertion_source_entry hi) representative generator actor image - have second := certificate.identityInsertion_representative_image_agreement pairing unions powers separation - representative actor image - intro z hz lower - exact (first z hz z hz lower).2 ((second z hz z hz lower).2 (certificate.target.stage.action_code.one z hz)) - -theorem exists_identityInsertion_actor {c e F label : ZFSet.{u}} - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) - (filter : MeetFilterCode P r source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) (hlabel : label ∈ Labels) : - ∃ k ∈ certificate.target.stage.actors, - (∀ c', ZFSet.pair c c' ∈ certificate.transition.map.points → - ∀ z ∈ Q, ZFSet.pair z c' ∈ certificate.target.stage.order → - ZFSet.pair (ZFSet.pair k z) z ∈ certificate.target.stage.action) ∧ - ∀ τ' v, ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points → - (ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ - ZFSet.pair label v ∈ certificate.insertionCapImages c e F) := by - have hi := M.identityInsertionTask_mem pairing unions powers separation source.stage.carrier_ground - source.stage.order_ground hF source.stage.action_code source.stage.group_code.identity_mem - hc he filter lower strict above hlabel - obtain ⟨k, hk, agreement, top⟩ := certificate.exists_compression_actor pairing unions powers separation infinite hi - obtain ⟨g, representative, _⟩ := certificate.origin.state.inputs.representatives.2 _ hi - have hg := (ZFSet.pair_mem_prod.1 (certificate.origin.state.inputs.representatives.1 representative)).2 - obtain ⟨g', actor, _⟩ := certificate.transition.map.group_embedding.injection.function.2 g hg - refine ⟨k, hk, ?_, ?_⟩ - · intro c' image z hz below - have first := agreement c g g' c' (identityInsertion_source_entry hi) representative actor image - have second := certificate.identityInsertion_representative_image_agreement pairing unions powers separation - representative actor image - exact (first z hz z hz below).2 ((second z hz z hz below).2 (certificate.target.stage.action_code.one z hz)) - · intro τ' v image - rw [certificate.insertionCapImages_entry_iff pairing unions powers separation infinite] - exact (top τ' v image).trans ⟨fun entry => ⟨hlabel, entry⟩, fun entry => entry.2⟩ - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -local notation "P" => source.stage.carrier -local notation "r" => source.stage.order -local notation "I" => source.stage.compressionTasks Labels -local notation "H" => certificate.target.stage.actors -local notation "rectangles" => externalRectangles P source.stage.actors r source.stage.meetGraph source.stage.action -local notation "letters" => externalChildLetters I P rectangles -local notation "generators" => M.externalChildGenerators source.stage.actors letters source.stage.multiplication source.stage.identity - -noncomputable def insertionActorImages (c e F : ZFSet.{u}) : ZFSet.{u} := - relationCompose Labels I H (identityInsertionTaskGraph Labels I P r c e F) - (compressionActorFamily I H generators) - -theorem insertionActorImages_entry_iff {c e F label k : ZFSet.{u}} : - ZFSet.pair label k ∈ certificate.insertionActorImages c e F ↔ - label ∈ Labels ∧ ZFSet.pair - (ZFSet.pair (ZFSet.pair (natSetCode 0) (identityInsertionTask P r c e F label)) (natSetCode 0)) k ∈ generators := by - have generatorCode : InjectionCode letters H generators := by - rw [certificate.target_fields.2.2.2.1] - exact certificate.external.inputs.generators_injection - rw [insertionActorImages, pair_mem_relationCompose] - constructor - · rintro ⟨hlabel, _, task, _, entry, actor⟩ - have equal := ((pair_mem_identityInsertionTaskGraph Labels I P r c e F label task).1 entry).2.2 - exact ⟨hlabel, equal ▸ ((pair_mem_compressionActorFamily I H generators task k).1 actor).2.2⟩ - · rintro ⟨hlabel, generator⟩ - have bounds := ZFSet.pair_mem_prod.1 (generatorCode.function.1 generator) - have hi := ((compression_child_iff I P rectangles - (identityInsertionTask P r c e F label) (natSetCode 0)).1 bounds.1).1 - exact ⟨hlabel, bounds.2, _, hi, - (pair_mem_identityInsertionTaskGraph Labels I P r c e F _ _).2 ⟨hlabel, hi, rfl⟩, - (pair_mem_compressionActorFamily I H generators _ k).2 ⟨hi, bounds.2, generator⟩⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem insertionActorImages_ground {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) : - certificate.insertionActorImages c e F ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hLabels certificate.indices_ground - certificate.target.stage.actors_ground - (M.identityInsertionTaskGraph_mem pairing unions powers separation hLabels certificate.indices_ground - source.stage.carrier_ground source.stage.order_ground hc he hF) - (M.compressionActorFamily_mem pairing unions powers separation certificate.indices_ground - certificate.target.stage.actors_ground certificate.external.inputs.generators_ground) - -variable {c e F : ZFSet.{u}} - -theorem insertionActorImages_injection - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) - (filter : MeetFilterCode P r source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : - InjectionCode Labels H (certificate.insertionActorImages c e F) := by - have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) - source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code - source.stage.group_code.identity_mem hc he filter lower strict above - have generatorCode : InjectionCode letters H generators := by - rw [certificate.target_fields.2.2.2.1] - exact certificate.external.inputs.generators_injection - exact tasks.compose (compressionActorFamily_injection generatorCode) - -theorem insertionActorImages_function - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) - (filter : MeetFilterCode P r source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : - ZFSet.IsFunc Labels H (certificate.insertionActorImages c e F) := - (certificate.insertionActorImages_injection pairing unions powers separation hc he hF filter lower strict above).function - -theorem insertionActorImages_cap_iff - (infinite : Realize M.sets infinity Fin.elim0) {label k τ' v : ZFSet.{u}} - (actor : ZFSet.pair label k ∈ certificate.insertionActorImages c e F) - (imageTop : ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points) : - ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ - ZFSet.pair label v ∈ certificate.insertionCapImages c e F := by - obtain ⟨hlabel, generator⟩ := certificate.insertionActorImages_entry_iff.1 actor - have child := (ZFSet.pair_mem_prod.1 - (certificate.external.inputs.generators_injection.function.1 generator)).1 - have hi := ((compression_child_iff I P rectangles - (identityInsertionTask P r c e F label) (natSetCode 0)).1 child).1 - rw [certificate.insertionCapImages_entry_iff pairing unions powers separation infinite] - exact (certificate.compression_generator_cap_iff pairing unions powers separation infinite hi generator imageTop).trans - ⟨fun entry => ⟨hlabel, entry⟩, fun entry => entry.2⟩ - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -local notation "P" => source.stage.carrier -local notation "r" => source.stage.order -local notation "I" => source.stage.compressionTasks Labels -local notation "rectangles" => externalRectangles P source.stage.actors r source.stage.meetGraph source.stage.action -include certificate pairing unions powers separation infinite - -theorem insertionActorImages_fixes {c e F label k c' : ZFSet.{u}} - (actor : ZFSet.pair label k ∈ certificate.insertionActorImages c e F) - (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) : - ∀ z ∈ certificate.target.stage.carrier, ZFSet.pair z c' ∈ certificate.target.stage.order → - ZFSet.pair (ZFSet.pair k z) z ∈ certificate.target.stage.action := by - obtain ⟨_, generator⟩ := certificate.insertionActorImages_entry_iff.1 actor - have child := (ZFSet.pair_mem_prod.1 - (certificate.external.inputs.generators_injection.function.1 generator)).1 - have hi := ((compression_child_iff I P rectangles - (identityInsertionTask P r c e F label) (natSetCode 0)).1 child).1 - exact certificate.identityInsertion_generator_fixes pairing unions powers separation infinite hi generator imageC - -theorem insertionActorImages_below_cap {c e F label k K x x' y : ZFSet.{u}} - (actor : ZFSet.pair label k ∈ certificate.insertionActorImages c e F) - (cap : ZFSet.pair label K ∈ certificate.insertionCapImages c e F) - (image : ZFSet.pair x x' ∈ certificate.transition.map.points) - (acted : ZFSet.pair (ZFSet.pair k x') y ∈ certificate.target.stage.action) : - ZFSet.pair y K ∈ certificate.target.stage.order := by - obtain ⟨_, generator⟩ := certificate.insertionActorImages_entry_iff.1 actor - have hk : k ∈ certificate.target.stage.actors := by - rw [certificate.target_fields.2.2.2.1] - exact (ZFSet.pair_mem_prod.1 (certificate.external.inputs.generators_injection.function.1 generator)).2 - have shape := ZFSet.pair_mem_prod.1 (certificate.transition.map.point_embedding.injection.function.1 image) - obtain ⟨top', imageTop, _⟩ := certificate.transition.map.point_embedding.injection.function.2 - source.stage.top source.stage.top_mem - have hTop' := (ZFSet.pair_mem_prod.1 - (certificate.transition.map.point_embedding.injection.function.1 imageTop)).2 - have topAction := (certificate.insertionActorImages_cap_iff pairing unions powers separation infinite actor imageTop).2 cap - have hy := (ZFSet.pair_mem_prod.1 (certificate.target.stage.action_code.function.1 acted)).2 - have hK := (ZFSet.pair_mem_prod.1 (certificate.target.stage.action_code.function.1 topAction)).2 - have below := certificate.transition.map.point_embedding.monotone x source.stage.top x' top' - (source.stage.greatest x shape.1) image imageTop - exact certificate.target.stage.action_code.monotone k hk x' shape.2 top' hTop' y hy K hK acted topAction below - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem successorTaskBindings : - MainSuccessorTaskBindingsCode M Labels certificate.successorOutputValues := - ⟨rfl, rfl, rfl, rfl, rfl, rfl, - certificate.origin.initial_representatives pairing unions powers separation⟩ - -variable (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) -include infinite hLabels - -theorem boundSuccessorOutput : - MainSuccessorOutputCode certificate.successorOutputValues ∧ - MainSuccessorTaskBindingsCode M Labels certificate.successorOutputValues := - ⟨certificate.successorOutput pairing unions powers separation infinite hLabels, - certificate.successorTaskBindings pairing unions powers separation⟩ - -theorem realize_boundSuccessorOutput : - Realize M.sets - (.conj (BoundedFormula.mainSuccessorOutputFormula Fin.succ).toFormula - (mainSuccessorTaskBindingsFormula 0 Fin.succ)) - (extend Labels certificate.successorOutputValues) := by - have members : ∀ j, extend Labels certificate.successorOutputValues j ∈ M.sets := - Fin.cases hLabels - (certificate.successorOutputValues_ground pairing unions powers separation infinite hLabels) - exact ⟨(BoundedFormula.realize_mainSuccessorOutputFormula M Fin.succ - (extend Labels certificate.successorOutputValues) members).2 - (certificate.successorOutput pairing unions powers separation infinite hLabels), - (M.realize_mainSuccessorTaskBindingsFormula pairing unions powers separation 0 Fin.succ - (extend Labels certificate.successorOutputValues) members source.stage.meet).2 - (certificate.successorTaskBindings pairing unions powers separation)⟩ - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -local notation "P" => source.stage.carrier -local notation "r" => source.stage.order -local notation "Q" => certificate.target.stage.carrier -local notation "R" => certificate.target.stage.order -local notation "μ" => certificate.target.stage.meetGraph -local notation "H" => certificate.target.stage.actors -local notation "A" => certificate.target.stage.action -local notation "points" => certificate.transition.map.points -include pairing unions powers separation infinite - -theorem insertionFulfillment {c e F : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) - (filter : MeetFilterCode P r source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : - certificate.insertionCapImages c e F ∈ M.sets ∧ - certificate.insertionActorImages c e F ∈ M.sets ∧ - InjectionCode Labels Q (certificate.insertionCapImages c e F) ∧ - InjectionCode Labels H (certificate.insertionActorImages c e F) ∧ - ∀ c' e', ZFSet.pair c c' ∈ points → ZFSet.pair e e' ∈ points → - (∀ label k, ZFSet.pair label k ∈ certificate.insertionActorImages c e F → - ∀ z ∈ Q, ZFSet.pair z c' ∈ R → ZFSet.pair (ZFSet.pair k z) z ∈ A) ∧ - (∀ label k K, ZFSet.pair label k ∈ certificate.insertionActorImages c e F → - ZFSet.pair label K ∈ certificate.insertionCapImages c e F → - ∀ x x' y, ZFSet.pair x x' ∈ points → ZFSet.pair (ZFSet.pair k x') y ∈ A → - ZFSet.pair y K ∈ R) ∧ - (∀ label K, ZFSet.pair label K ∈ certificate.insertionCapImages c e F → - ZFSet.pair c' K ∈ R ∧ ZFSet.pair K c' ∉ R ∧ ZFSet.pair e' K ∉ R ∧ - CodedInsertionProfile Q R μ c' e' K (relationImage F Q points)) ∧ - (∀ first second K L, ZFSet.pair first K ∈ certificate.insertionCapImages c e F → - ZFSet.pair second L ∈ certificate.insertionCapImages c e F → first ≠ second → - ZFSet.pair (ZFSet.pair K L) c' ∈ μ) := by - refine ⟨certificate.insertionCapImages_ground pairing unions powers separation infinite hLabels hc he hF, - certificate.insertionActorImages_ground pairing unions powers separation hLabels hc he hF, - certificate.insertionCapImages_injection pairing unions powers separation infinite - hc he hF filter lower strict above hLabels, - certificate.insertionActorImages_injection pairing unions powers separation - hc he hF filter lower strict above, ?_⟩ - intro c' e' imageC imageE - refine ⟨?_, ?_, ?_, ?_⟩ - · intro label k actor - exact certificate.insertionActorImages_fixes pairing unions powers separation infinite actor imageC - · intro label k K actor cap x x' y image acted - exact certificate.insertionActorImages_below_cap pairing unions powers separation infinite actor cap image acted - · intro label K cap - have profile := certificate.insertionCapImages_profile pairing unions powers separation infinite - hc he hF filter lower strict above cap imageC imageE - exact ⟨profile.target_below_cap, profile.cap_not_below_target, - profile.separator_not_below_cap, profile.profile⟩ - · intro first second K L firstCap secondCap different - exact certificate.insertionCapImages_meet pairing unions powers separation infinite - hc he hF filter lower strict above hLabels firstCap secondCap different imageC - -end GroundInitialMainSuccessorData - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTaskBearingSuccessorDecoding + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +noncomputable def compressionActorFamily (I H generators : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ k ∈ H, z = ZFSet.pair i k ∧ + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators) + (ZFSet.prod I H) + +theorem pair_mem_compressionActorFamily (I H generators i k : ZFSet.{u}) : + ZFSet.pair i k ∈ compressionActorFamily I H generators ↔ + i ∈ I ∧ k ∈ H ∧ + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators := by + rw [compressionActorFamily, ZFSet.mem_sep] + constructor + · rintro ⟨_, a, ha, b, hb, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨ha, hb, entry⟩ + · rintro ⟨hi, hk, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hk⟩, i, hi, k, hk, rfl, entry⟩ + +namespace BoundedFormula + +def compressionActorEntryFormula {n} (z I H generators zero requests : Fin n) : BoundedFormula n := + .exMem I (.exMem H.succ (.exMem requests.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 1) + (.conj (orderedPairFormula 0 zero.succ.succ.succ 2) + (tripleMembershipFormula 0 zero.succ.succ.succ 1 generators.succ.succ.succ))))) + +theorem truth_compressionActorEntryFormula {n} (z I H generators zero requests : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (compressionActorEntryFormula z I H generators zero requests) env ↔ + ∃ i ∈ env I, ∃ k ∈ env H, ∃ request ∈ env requests, + env z = ZFSet.pair i k ∧ request = ZFSet.pair (env zero) i ∧ + ZFSet.pair (ZFSet.pair request (env zero)) k ∈ env generators := by + simp only [compressionActorEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem compressionActorFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I H generators : ZFSet.{u}} (hI : I ∈ M.sets) (hH : H ∈ M.sets) (hGenerators : generators ∈ M.sets) : + compressionActorFamily I H generators ∈ M.sets := by + have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I, hI⟩ + have singleton : ({natSetCode 0} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing zero zero + let requests := ZFSet.prod {natSetCode 0} I + have hRequests : requests ∈ M.sets := M.prod_mem pairing unions powers separation singleton hI + let env := extend I (extend H (extend generators (extend (natSetCode 0) (extend requests Fin.elim0)))) + have members : ∀ j, env j ∈ M.sets := + Fin.cases hI (Fin.cases hH (Fin.cases hGenerators (Fin.cases zero (Fin.cases hRequests (fun j => Fin.elim0 j))))) + have ground := M.bounded_separation_mem separation + (BoundedFormula.compressionActorEntryFormula 0 1 2 3 4 5) env members + (M.prod_mem pairing unions powers separation hI hH) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.compressionActorEntryFormula 0 1 2 3 4 5) (extend z env)) + (ZFSet.prod I H) = compressionActorFamily I H generators := by + apply ZFSet.ext + intro z + rw [compressionActorFamily, ZFSet.mem_sep, ZFSet.mem_sep] + apply and_congr Iff.rfl + rw [BoundedFormula.truth_compressionActorEntryFormula] + change (∃ i ∈ I, ∃ k ∈ H, ∃ request ∈ requests, + z = ZFSet.pair i k ∧ request = ZFSet.pair (natSetCode 0) i ∧ + ZFSet.pair (ZFSet.pair request (natSetCode 0)) k ∈ generators) ↔ _ + constructor + · rintro ⟨i, hi, k, hk, request, _, eq, rfl, entry⟩ + exact ⟨i, hi, k, hk, eq, entry⟩ + · rintro ⟨i, hi, k, hk, eq, entry⟩ + exact ⟨i, hi, k, hk, _, ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hi⟩, eq, rfl, entry⟩ + exact equal ▸ ground + +end TransitiveGround + +theorem compressionActorFamily_injection {I P Rectangles H generators : ZFSet.{u}} + (injection : InjectionCode (externalChildLetters I P Rectangles) H generators) : + InjectionCode I H (compressionActorFamily I H generators) := by + refine ⟨⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩, ?_⟩ + · intro i hi + have child := (compression_child_iff I P Rectangles i (natSetCode 0)).2 ⟨hi, rfl⟩ + obtain ⟨k, entry, unique⟩ := injection.function.2 _ child + have hk := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 + refine ⟨k, (pair_mem_compressionActorFamily I H generators i k).2 ⟨hi, hk, entry⟩, ?_⟩ + intro l candidate + exact unique l ((pair_mem_compressionActorFamily I H generators i l).1 candidate).2.2 + · intro i j k first second + have equal := injection.injective _ _ _ + ((pair_mem_compressionActorFamily I H generators i k).1 first).2.2 + ((pair_mem_compressionActorFamily I H generators j k).1 second).2.2 + exact (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 equal).1).2 + +end + +namespace GroundCompressionOrigin +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {P G r μ A Labels m inv one τ Reps : ZFSet.{u}} +local notation "I" => M.groundEligibleTasks P G r μ A Labels +local notation "R" => M.groundRelations P P +local notation "U" => M.groundMeetFilters P r μ +variable (origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ (M.groundEligibleTasks P G r μ A Labels) + (literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) Reps G m inv one + (M.groundTaskTransport P G r μ A Labels) + (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include origin pairing unions powers separation + +theorem initial_representatives : TaskRepresentativesCode Reps I P G r A R U Labels := by + refine ⟨origin.state.inputs.representatives, ?_⟩ + intro i g representative + have hi := (ZFSet.pair_mem_prod.1 (origin.state.inputs.representatives.1 representative)).1 + obtain ⟨S, mapEntry⟩ := origin.state.inputs.maps.total hi + have hI : I ∈ M.sets := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.indices + have hP : P ∈ M.sets := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.carrier + have hQs : constantFamilyGraph I P ∈ M.sets := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.spaces + have hrs : constantFamilyGraph I r ∈ M.sets := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.relations + have hAs : literalTaskSourceGraph I P R U Labels ∈ M.sets := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.anchors + have hEs : literalTaskBaseGraph I P R U Labels ∈ M.sets := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using origin.state.ground.embeddings + have actualMap : ZFSet.pair i S ∈ M.batchEmbeddingFamily I P + (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using mapEntry + have mapEq := (((M.batchEmbeddingFamily_spec pairing unions powers separation + hI hP hQs hrs hAs hEs).2.2 i S).1 actualMap).2 + obtain ⟨a, ha, c, hc, base, hb, e, he, F, hF, label, hl, equal, eligible⟩ := + (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi + obtain ⟨g₀, _, restriction⟩ := eligible.representative + have represented : TaskRepresentative P r A R U Labels i g₀ := + ⟨a, ha, c, hc, base, hb, e, he, F, hF, label, hl, equal, restriction⟩ + have source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels := by + rw [equal] + exact (literalTaskFieldGraph_entry_iff ha hc hb he hF hl 0).2 ⟨equal ▸ hi, rfl⟩ + have agree : ActionAgreementBelow P r A g₀ g a := by + intro x hx y _ below + have stored : ZFSet.pair x y ∈ S ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by + have hx' : x ∈ origin.state.data.D := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using hx + have below' : ZFSet.pair x a ∈ origin.state.data.rD := by + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using below + simpa only [origin.initial_data, TransitiveGround.initialCompressionData] using + origin.state.inputs.agreement i a g S x y source representative mapEntry hx' below' + have canonical := M.groundEligibleTask_representative_base_iff (y := y) + origin.state.inputs.group origin.seed.originalAction origin.seed.originalOrder + hi represented source hx below + dsimp only at canonical + rw [← mapEq] at canonical + exact ((M.groundEligibleBatchAction_old_iff hx).symm.trans canonical.symm).trans + (stored.trans (M.groundEligibleBatchAction_old_iff hx)) + refine ⟨a, ha, c, hc, base, hb, e, he, F, hF, label, hl, equal, + restriction.shape, ?_, ?_⟩ + · exact (agree a ha c hc (origin.seed.originalOrder.order.refl a ha)).1 restriction.target_entry + · intro x hx y hy + constructor + · intro entry + obtain ⟨lower, action⟩ := (restriction.entries x hx y hy).1 entry + exact ⟨lower, (agree x hx y hy lower).1 action⟩ + · rintro ⟨lower, action⟩ + exact (restriction.entries x hx y hy).2 ⟨lower, (agree x hx y hy lower).2 action⟩ + +theorem identityTask_representative_agreement {c e F label g : ZFSet.{u}} + (representative : ZFSet.pair (identityInsertionTask P r c e F label) g ∈ Reps) : + ActionAgreementBelow P r A g one c := by + have restriction := ((origin.initial_representatives pairing unions powers separation).2 + _ _ representative).restriction + change RestrictedActionCode P r A g c c (identityIdealGraph P r c) at restriction + intro x hx y hy lower + have fixed : ZFSet.pair (ZFSet.pair g x) x ∈ A := restriction.entry_action + ((pair_mem_identityIdealGraph P r c x x).2 ⟨rfl, hx, lower⟩) + have oneEntry := origin.seed.originalAction.one x hx + constructor + · intro entry + have equal := (show FunctionGraphOn (ZFSet.prod G P) A from + ⟨P, origin.seed.originalAction.function⟩).unique entry fixed + exact equal.symm ▸ oneEntry + · intro entry + have equal := (show FunctionGraphOn (ZFSet.prod G P) A from + ⟨P, origin.seed.originalAction.function⟩).unique entry oneEntry + exact equal.symm ▸ fixed + +end GroundCompressionOrigin + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +local notation "P" => source.stage.carrier +local notation "r" => source.stage.order +local notation "I" => source.stage.compressionTasks Labels +local notation "Q" => certificate.target.stage.carrier +local notation "rectangles" => externalRectangles P source.stage.actors r source.stage.meetGraph source.stage.action +local notation "letters" => externalChildLetters I P rectangles +local notation "generators" => M.externalChildGenerators source.stage.actors letters source.stage.multiplication source.stage.identity + +omit certificate in +theorem identityInsertion_source_entry {c e F label : ZFSet.{u}} + (hi : identityInsertionTask P r c e F label ∈ I) : + ZFSet.pair (identityInsertionTask P r c e F label) c ∈ source.stage.compressionSources Labels := by + obtain ⟨hc, hc', hb, he, hF, hl, _⟩ := (literalTaskCode_mem_eligibleTaskSet P source.stage.actors r + source.stage.meetGraph source.stage.action (M.groundRelations P P) + (M.groundMeetFilters P r source.stage.meetGraph) Labels c c (identityIdealGraph P r c) e F label).1 hi + exact (literalTaskFieldGraph_entry_iff hc hc' hb he hF hl 0).2 ⟨hi, rfl⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem identityInsertion_representative_image_agreement {c e F label g g' c' : ZFSet.{u}} + (representative : ZFSet.pair (identityInsertionTask P r c e F label) g ∈ certificate.Reps) + (actor : ZFSet.pair g g' ∈ certificate.transition.map.actors) + (image : ZFSet.pair c c' ∈ certificate.transition.map.points) : + ActionAgreementBelow Q certificate.target.stage.order certificate.target.stage.action + g' certificate.target.stage.identity c' := + certificate.transition.map.agreement g source.stage.identity g' certificate.target.stage.identity c c' + actor certificate.transition.map.group_embedding.one image + (certificate.origin.identityTask_representative_agreement pairing unions powers separation representative) + +variable (infinite : Realize M.sets infinity Fin.elim0) +include infinite + +theorem identityInsertion_generator_fixes {c e F label k c' : ZFSet.{u}} + (hi : identityInsertionTask P r c e F label ∈ I) + (generator : ZFSet.pair + (ZFSet.pair (ZFSet.pair (natSetCode 0) (identityInsertionTask P r c e F label)) (natSetCode 0)) k ∈ generators) + (image : ZFSet.pair c c' ∈ certificate.transition.map.points) : + ∀ z ∈ Q, ZFSet.pair z c' ∈ certificate.target.stage.order → + ZFSet.pair (ZFSet.pair k z) z ∈ certificate.target.stage.action := by + obtain ⟨g, representative, _⟩ := certificate.origin.state.inputs.representatives.2 _ hi + have hg := (ZFSet.pair_mem_prod.1 (certificate.origin.state.inputs.representatives.1 representative)).2 + obtain ⟨g', actor, _⟩ := certificate.transition.map.group_embedding.injection.function.2 g hg + have first := certificate.compression_generator_full_agreement pairing unions powers separation infinite hi + (identityInsertion_source_entry hi) representative generator actor image + have second := certificate.identityInsertion_representative_image_agreement pairing unions powers separation + representative actor image + intro z hz lower + exact (first z hz z hz lower).2 ((second z hz z hz lower).2 (certificate.target.stage.action_code.one z hz)) + +theorem exists_identityInsertion_actor {c e F label : ZFSet.{u}} + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) + (filter : MeetFilterCode P r source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) (hlabel : label ∈ Labels) : + ∃ k ∈ certificate.target.stage.actors, + (∀ c', ZFSet.pair c c' ∈ certificate.transition.map.points → + ∀ z ∈ Q, ZFSet.pair z c' ∈ certificate.target.stage.order → + ZFSet.pair (ZFSet.pair k z) z ∈ certificate.target.stage.action) ∧ + ∀ τ' v, ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points → + (ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ + ZFSet.pair label v ∈ certificate.insertionCapImages c e F) := by + have hi := M.identityInsertionTask_mem pairing unions powers separation source.stage.carrier_ground + source.stage.order_ground hF source.stage.action_code source.stage.group_code.identity_mem + hc he filter lower strict above hlabel + obtain ⟨k, hk, agreement, top⟩ := certificate.exists_compression_actor pairing unions powers separation infinite hi + obtain ⟨g, representative, _⟩ := certificate.origin.state.inputs.representatives.2 _ hi + have hg := (ZFSet.pair_mem_prod.1 (certificate.origin.state.inputs.representatives.1 representative)).2 + obtain ⟨g', actor, _⟩ := certificate.transition.map.group_embedding.injection.function.2 g hg + refine ⟨k, hk, ?_, ?_⟩ + · intro c' image z hz below + have first := agreement c g g' c' (identityInsertion_source_entry hi) representative actor image + have second := certificate.identityInsertion_representative_image_agreement pairing unions powers separation + representative actor image + exact (first z hz z hz below).2 ((second z hz z hz below).2 (certificate.target.stage.action_code.one z hz)) + · intro τ' v image + rw [certificate.insertionCapImages_entry_iff pairing unions powers separation infinite] + exact (top τ' v image).trans ⟨fun entry => ⟨hlabel, entry⟩, fun entry => entry.2⟩ + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +local notation "P" => source.stage.carrier +local notation "r" => source.stage.order +local notation "I" => source.stage.compressionTasks Labels +local notation "H" => certificate.target.stage.actors +local notation "rectangles" => externalRectangles P source.stage.actors r source.stage.meetGraph source.stage.action +local notation "letters" => externalChildLetters I P rectangles +local notation "generators" => M.externalChildGenerators source.stage.actors letters source.stage.multiplication source.stage.identity + +noncomputable def insertionActorImages (c e F : ZFSet.{u}) : ZFSet.{u} := + relationCompose Labels I H (identityInsertionTaskGraph Labels I P r c e F) + (compressionActorFamily I H generators) + +theorem insertionActorImages_entry_iff {c e F label k : ZFSet.{u}} : + ZFSet.pair label k ∈ certificate.insertionActorImages c e F ↔ + label ∈ Labels ∧ ZFSet.pair + (ZFSet.pair (ZFSet.pair (natSetCode 0) (identityInsertionTask P r c e F label)) (natSetCode 0)) k ∈ generators := by + have generatorCode : InjectionCode letters H generators := by + rw [certificate.target_fields.2.2.2.1] + exact certificate.external.inputs.generators_injection + rw [insertionActorImages, pair_mem_relationCompose] + constructor + · rintro ⟨hlabel, _, task, _, entry, actor⟩ + have equal := ((pair_mem_identityInsertionTaskGraph Labels I P r c e F label task).1 entry).2.2 + exact ⟨hlabel, equal ▸ ((pair_mem_compressionActorFamily I H generators task k).1 actor).2.2⟩ + · rintro ⟨hlabel, generator⟩ + have bounds := ZFSet.pair_mem_prod.1 (generatorCode.function.1 generator) + have hi := ((compression_child_iff I P rectangles + (identityInsertionTask P r c e F label) (natSetCode 0)).1 bounds.1).1 + exact ⟨hlabel, bounds.2, _, hi, + (pair_mem_identityInsertionTaskGraph Labels I P r c e F _ _).2 ⟨hlabel, hi, rfl⟩, + (pair_mem_compressionActorFamily I H generators _ k).2 ⟨hi, bounds.2, generator⟩⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem insertionActorImages_ground {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) : + certificate.insertionActorImages c e F ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hLabels certificate.indices_ground + certificate.target.stage.actors_ground + (M.identityInsertionTaskGraph_mem pairing unions powers separation hLabels certificate.indices_ground + source.stage.carrier_ground source.stage.order_ground hc he hF) + (M.compressionActorFamily_mem pairing unions powers separation certificate.indices_ground + certificate.target.stage.actors_ground certificate.external.inputs.generators_ground) + +variable {c e F : ZFSet.{u}} + +theorem insertionActorImages_injection + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) + (filter : MeetFilterCode P r source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : + InjectionCode Labels H (certificate.insertionActorImages c e F) := by + have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) + source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code + source.stage.group_code.identity_mem hc he filter lower strict above + have generatorCode : InjectionCode letters H generators := by + rw [certificate.target_fields.2.2.2.1] + exact certificate.external.inputs.generators_injection + exact tasks.compose (compressionActorFamily_injection generatorCode) + +theorem insertionActorImages_function + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) + (filter : MeetFilterCode P r source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : + ZFSet.IsFunc Labels H (certificate.insertionActorImages c e F) := + (certificate.insertionActorImages_injection pairing unions powers separation hc he hF filter lower strict above).function + +theorem insertionActorImages_cap_iff + (infinite : Realize M.sets infinity Fin.elim0) {label k τ' v : ZFSet.{u}} + (actor : ZFSet.pair label k ∈ certificate.insertionActorImages c e F) + (imageTop : ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points) : + ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ + ZFSet.pair label v ∈ certificate.insertionCapImages c e F := by + obtain ⟨hlabel, generator⟩ := certificate.insertionActorImages_entry_iff.1 actor + have child := (ZFSet.pair_mem_prod.1 + (certificate.external.inputs.generators_injection.function.1 generator)).1 + have hi := ((compression_child_iff I P rectangles + (identityInsertionTask P r c e F label) (natSetCode 0)).1 child).1 + rw [certificate.insertionCapImages_entry_iff pairing unions powers separation infinite] + exact (certificate.compression_generator_cap_iff pairing unions powers separation infinite hi generator imageTop).trans + ⟨fun entry => ⟨hlabel, entry⟩, fun entry => entry.2⟩ + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +local notation "P" => source.stage.carrier +local notation "r" => source.stage.order +local notation "I" => source.stage.compressionTasks Labels +local notation "rectangles" => externalRectangles P source.stage.actors r source.stage.meetGraph source.stage.action +include certificate pairing unions powers separation infinite + +theorem insertionActorImages_fixes {c e F label k c' : ZFSet.{u}} + (actor : ZFSet.pair label k ∈ certificate.insertionActorImages c e F) + (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) : + ∀ z ∈ certificate.target.stage.carrier, ZFSet.pair z c' ∈ certificate.target.stage.order → + ZFSet.pair (ZFSet.pair k z) z ∈ certificate.target.stage.action := by + obtain ⟨_, generator⟩ := certificate.insertionActorImages_entry_iff.1 actor + have child := (ZFSet.pair_mem_prod.1 + (certificate.external.inputs.generators_injection.function.1 generator)).1 + have hi := ((compression_child_iff I P rectangles + (identityInsertionTask P r c e F label) (natSetCode 0)).1 child).1 + exact certificate.identityInsertion_generator_fixes pairing unions powers separation infinite hi generator imageC + +theorem insertionActorImages_below_cap {c e F label k K x x' y : ZFSet.{u}} + (actor : ZFSet.pair label k ∈ certificate.insertionActorImages c e F) + (cap : ZFSet.pair label K ∈ certificate.insertionCapImages c e F) + (image : ZFSet.pair x x' ∈ certificate.transition.map.points) + (acted : ZFSet.pair (ZFSet.pair k x') y ∈ certificate.target.stage.action) : + ZFSet.pair y K ∈ certificate.target.stage.order := by + obtain ⟨_, generator⟩ := certificate.insertionActorImages_entry_iff.1 actor + have hk : k ∈ certificate.target.stage.actors := by + rw [certificate.target_fields.2.2.2.1] + exact (ZFSet.pair_mem_prod.1 (certificate.external.inputs.generators_injection.function.1 generator)).2 + have shape := ZFSet.pair_mem_prod.1 (certificate.transition.map.point_embedding.injection.function.1 image) + obtain ⟨top', imageTop, _⟩ := certificate.transition.map.point_embedding.injection.function.2 + source.stage.top source.stage.top_mem + have hTop' := (ZFSet.pair_mem_prod.1 + (certificate.transition.map.point_embedding.injection.function.1 imageTop)).2 + have topAction := (certificate.insertionActorImages_cap_iff pairing unions powers separation infinite actor imageTop).2 cap + have hy := (ZFSet.pair_mem_prod.1 (certificate.target.stage.action_code.function.1 acted)).2 + have hK := (ZFSet.pair_mem_prod.1 (certificate.target.stage.action_code.function.1 topAction)).2 + have below := certificate.transition.map.point_embedding.monotone x source.stage.top x' top' + (source.stage.greatest x shape.1) image imageTop + exact certificate.target.stage.action_code.monotone k hk x' shape.2 top' hTop' y hy K hK acted topAction below + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem successorTaskBindings : + MainSuccessorTaskBindingsCode M Labels certificate.successorOutputValues := + ⟨rfl, rfl, rfl, rfl, rfl, rfl, + certificate.origin.initial_representatives pairing unions powers separation⟩ + +variable (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) +include infinite hLabels + +theorem boundSuccessorOutput : + MainSuccessorOutputCode certificate.successorOutputValues ∧ + MainSuccessorTaskBindingsCode M Labels certificate.successorOutputValues := + ⟨certificate.successorOutput pairing unions powers separation infinite hLabels, + certificate.successorTaskBindings pairing unions powers separation⟩ + +theorem realize_boundSuccessorOutput : + Realize M.sets + (.conj (BoundedFormula.mainSuccessorOutputFormula Fin.succ).toFormula + (mainSuccessorTaskBindingsFormula 0 Fin.succ)) + (extend Labels certificate.successorOutputValues) := by + have members : ∀ j, extend Labels certificate.successorOutputValues j ∈ M.sets := + Fin.cases hLabels + (certificate.successorOutputValues_ground pairing unions powers separation infinite hLabels) + exact ⟨(BoundedFormula.realize_mainSuccessorOutputFormula M Fin.succ + (extend Labels certificate.successorOutputValues) members).2 + (certificate.successorOutput pairing unions powers separation infinite hLabels), + (M.realize_mainSuccessorTaskBindingsFormula pairing unions powers separation 0 Fin.succ + (extend Labels certificate.successorOutputValues) members source.stage.meet).2 + (certificate.successorTaskBindings pairing unions powers separation)⟩ + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +local notation "P" => source.stage.carrier +local notation "r" => source.stage.order +local notation "Q" => certificate.target.stage.carrier +local notation "R" => certificate.target.stage.order +local notation "μ" => certificate.target.stage.meetGraph +local notation "H" => certificate.target.stage.actors +local notation "A" => certificate.target.stage.action +local notation "points" => certificate.transition.map.points +include pairing unions powers separation infinite + +theorem insertionFulfillment {c e F : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) + (filter : MeetFilterCode P r source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : + certificate.insertionCapImages c e F ∈ M.sets ∧ + certificate.insertionActorImages c e F ∈ M.sets ∧ + InjectionCode Labels Q (certificate.insertionCapImages c e F) ∧ + InjectionCode Labels H (certificate.insertionActorImages c e F) ∧ + ∀ c' e', ZFSet.pair c c' ∈ points → ZFSet.pair e e' ∈ points → + (∀ label k, ZFSet.pair label k ∈ certificate.insertionActorImages c e F → + ∀ z ∈ Q, ZFSet.pair z c' ∈ R → ZFSet.pair (ZFSet.pair k z) z ∈ A) ∧ + (∀ label k K, ZFSet.pair label k ∈ certificate.insertionActorImages c e F → + ZFSet.pair label K ∈ certificate.insertionCapImages c e F → + ∀ x x' y, ZFSet.pair x x' ∈ points → ZFSet.pair (ZFSet.pair k x') y ∈ A → + ZFSet.pair y K ∈ R) ∧ + (∀ label K, ZFSet.pair label K ∈ certificate.insertionCapImages c e F → + ZFSet.pair c' K ∈ R ∧ ZFSet.pair K c' ∉ R ∧ ZFSet.pair e' K ∉ R ∧ + CodedInsertionProfile Q R μ c' e' K (relationImage F Q points)) ∧ + (∀ first second K L, ZFSet.pair first K ∈ certificate.insertionCapImages c e F → + ZFSet.pair second L ∈ certificate.insertionCapImages c e F → first ≠ second → + ZFSet.pair (ZFSet.pair K L) c' ∈ μ) := by + refine ⟨certificate.insertionCapImages_ground pairing unions powers separation infinite hLabels hc he hF, + certificate.insertionActorImages_ground pairing unions powers separation hLabels hc he hF, + certificate.insertionCapImages_injection pairing unions powers separation infinite + hc he hF filter lower strict above hLabels, + certificate.insertionActorImages_injection pairing unions powers separation + hc he hF filter lower strict above, ?_⟩ + intro c' e' imageC imageE + refine ⟨?_, ?_, ?_, ?_⟩ + · intro label k actor + exact certificate.insertionActorImages_fixes pairing unions powers separation infinite actor imageC + · intro label k K actor cap x x' y image acted + exact certificate.insertionActorImages_below_cap pairing unions powers separation infinite actor cap image acted + · intro label K cap + have profile := certificate.insertionCapImages_profile pairing unions powers separation infinite + hc he hF filter lower strict above cap imageC imageE + exact ⟨profile.target_below_cap, profile.cap_not_below_target, + profile.separator_not_below_cap, profile.profile⟩ + · intro first second K L firstCap secondCap different + exact certificate.insertionCapImages_meet pairing unions powers separation infinite + hc he hF filter lower strict above hLabels firstCap secondCap different imageC + +end GroundInitialMainSuccessorData + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainCompressionActorCode.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainCompressionActorCode.lean index 6c07a71793c4baaaa3249bf849b9e2d57e50d3c9..2ec339f69f9e8c665be54823621f231a38200797 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainCompressionActorCode.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainCompressionActorCode.lean @@ -1,55 +1,55 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorCompressionActors - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -noncomputable def compressionActorValues : Fin 13 → ZFSet.{u} := - Fin.cases (source.stage.compressionTasks Labels) (Fin.cases (source.stage.carrier) (Fin.cases (source.stage.actors) (Fin.cases (certificate.target.stage.carrier) (Fin.cases (certificate.target.stage.actors) (Fin.cases (certificate.target.stage.order) (Fin.cases (certificate.target.stage.action) (Fin.cases (certificate.transition.map.points) (Fin.cases (certificate.transition.map.actors) (Fin.cases (source.stage.compressionSources Labels) (Fin.cases (certificate.Reps) (Fin.cases (source.stage.top) (fun _ => certificate.compressionCapImages)))))))))))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -include pairing unions powers separation infinite - -theorem compressionActorValues_ground : ∀ j, certificate.compressionActorValues j ∈ M.sets := - Fin.cases (certificate.indices_ground) (Fin.cases (source.stage.carrier_ground) (Fin.cases (source.stage.actors_ground) (Fin.cases (certificate.target.stage.carrier_ground) (Fin.cases (certificate.target.stage.actors_ground) (Fin.cases (certificate.target.stage.order_ground) (Fin.cases (certificate.target.stage.action_ground) (Fin.cases (certificate.transition.map.points_ground) (Fin.cases (certificate.transition.map.actors_ground) (Fin.cases (certificate.sources_ground) (Fin.cases (certificate.representatives_ground) (Fin.cases (source.stage.top_ground) (fun _ => certificate.compressionCapImages_ground pairing unions powers separation infinite)))))))))))) - -theorem compressionActorFulfillment : - CompressionActorFulfillmentCode (source.stage.compressionTasks Labels) - source.stage.carrier source.stage.actors certificate.target.stage.carrier - certificate.target.stage.actors certificate.target.stage.order certificate.target.stage.action - certificate.transition.map.points certificate.transition.map.actors - (source.stage.compressionSources Labels) certificate.Reps source.stage.top - certificate.compressionCapImages := by - intro i hi - obtain ⟨k, hk, agreement, top⟩ := - certificate.exists_compression_actor pairing unions powers separation infinite hi - refine ⟨k, hk, ?_, ?_⟩ - · intro s _ g _ g' _ s' _ hs hg actor point - exact agreement s g g' s' hs hg actor point - · intro top' _ v _ image - exact top top' v image - -theorem realize_compressionActorFulfillment : - Realize M.sets - (BoundedFormula.compressionActorFulfillmentFormula 0 1 2 3 4 5 6 7 8 9 10 11 12).toFormula - certificate.compressionActorValues := - (BoundedFormula.realize_compressionActorFulfillmentFormula M 0 1 2 3 4 5 6 7 8 9 10 11 12 - certificate.compressionActorValues - (certificate.compressionActorValues_ground pairing unions powers separation infinite)).2 - (certificate.compressionActorFulfillment pairing unions powers separation infinite) - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorCompressionActors + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +noncomputable def compressionActorValues : Fin 13 → ZFSet.{u} := + Fin.cases (source.stage.compressionTasks Labels) (Fin.cases (source.stage.carrier) (Fin.cases (source.stage.actors) (Fin.cases (certificate.target.stage.carrier) (Fin.cases (certificate.target.stage.actors) (Fin.cases (certificate.target.stage.order) (Fin.cases (certificate.target.stage.action) (Fin.cases (certificate.transition.map.points) (Fin.cases (certificate.transition.map.actors) (Fin.cases (source.stage.compressionSources Labels) (Fin.cases (certificate.Reps) (Fin.cases (source.stage.top) (fun _ => certificate.compressionCapImages)))))))))))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +include pairing unions powers separation infinite + +theorem compressionActorValues_ground : ∀ j, certificate.compressionActorValues j ∈ M.sets := + Fin.cases (certificate.indices_ground) (Fin.cases (source.stage.carrier_ground) (Fin.cases (source.stage.actors_ground) (Fin.cases (certificate.target.stage.carrier_ground) (Fin.cases (certificate.target.stage.actors_ground) (Fin.cases (certificate.target.stage.order_ground) (Fin.cases (certificate.target.stage.action_ground) (Fin.cases (certificate.transition.map.points_ground) (Fin.cases (certificate.transition.map.actors_ground) (Fin.cases (certificate.sources_ground) (Fin.cases (certificate.representatives_ground) (Fin.cases (source.stage.top_ground) (fun _ => certificate.compressionCapImages_ground pairing unions powers separation infinite)))))))))))) + +theorem compressionActorFulfillment : + CompressionActorFulfillmentCode (source.stage.compressionTasks Labels) + source.stage.carrier source.stage.actors certificate.target.stage.carrier + certificate.target.stage.actors certificate.target.stage.order certificate.target.stage.action + certificate.transition.map.points certificate.transition.map.actors + (source.stage.compressionSources Labels) certificate.Reps source.stage.top + certificate.compressionCapImages := by + intro i hi + obtain ⟨k, hk, agreement, top⟩ := + certificate.exists_compression_actor pairing unions powers separation infinite hi + refine ⟨k, hk, ?_, ?_⟩ + · intro s _ g _ g' _ s' _ hs hg actor point + exact agreement s g g' s' hs hg actor point + · intro top' _ v _ image + exact top top' v image + +theorem realize_compressionActorFulfillment : + Realize M.sets + (BoundedFormula.compressionActorFulfillmentFormula 0 1 2 3 4 5 6 7 8 9 10 11 12).toFormula + certificate.compressionActorValues := + (BoundedFormula.realize_compressionActorFulfillmentFormula M 0 1 2 3 4 5 6 7 8 9 10 11 12 + certificate.compressionActorValues + (certificate.compressionActorValues_ground pairing unions powers separation infinite)).2 + (certificate.compressionActorFulfillment pairing unions powers separation infinite) + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainDiagramAppend.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainDiagramAppend.lean index e2e4b768e6c11b3d6f27b59a1e9915a043f5cd36..85a43dc5d21ad2c209e5c7ee9f6318570a9f79cd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainDiagramAppend.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainDiagramAppend.lean @@ -1,138 +1,138 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundChronologicalMainDiagram -open SetFormula -universe u v w -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Preorder I] {J : Type w} [Preorder J] -variable (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) -variable (f : J → I) (mono : Monotone f) - -def reindex : GroundChronologicalMainDiagram M C D rD pairing unions powers separation J where - stage j := diagram.stage (f j) - transition before := diagram.transition (mono before) - self j := diagram.self (f j) - comp first second := diagram.comp (mono first) (mono second) - -theorem CoversOldBirths.reindex (coverage : diagram.CoversOldBirths) : - (diagram.reindex f mono).CoversOldBirths := - fun before => coverage (mono before) - -end PartitionPilot.Forcing.GroundChronologicalMainDiagram - - - -namespace PartitionPilot.Forcing.GroundChronologicalMainDiagram -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Preorder I] -variable (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) - -structure Cone (target : GroundChronologicalMainStage M C D rD) where - leg : ∀ i, GroundChronologicalMainTransition (diagram.stage i) target - coherent : ∀ {i j} (before : i ≤ j), - (diagram.transition before).comp pairing unions powers separation (leg j) = leg i - -noncomputable def coneOfLast (last : I) (greatest : ∀ i, i ≤ last) - {target : GroundChronologicalMainStage M C D rD} - (step : GroundChronologicalMainTransition (diagram.stage last) target) : diagram.Cone target where - leg i := (diagram.transition (greatest i)).comp pairing unions powers separation step - coherent := by - intro i j before - rw [← GroundChronologicalMainTransition.comp_assoc, ← diagram.comp] - -namespace Cone -variable {diagram} {target : GroundChronologicalMainStage M C D rD} (cone : diagram.Cone target) - -def appendStage (_cone : diagram.Cone target) : WithTop I → GroundChronologicalMainStage M C D rD - | none => target - | some i => diagram.stage i - -noncomputable def appendTransition {i j : WithTop I} (before : i ≤ j) : - GroundChronologicalMainTransition (cone.appendStage i) (cone.appendStage j) := by - cases i with - | top => - cases j with - | top => exact GroundChronologicalMainTransition.identity pairing unions powers separation target - | coe j => exact False.elim (WithTop.not_top_le_coe j before) - | coe i => - cases j with - | top => exact cone.leg i - | coe j => exact diagram.transition (WithTop.coe_le_coe.mp before) - -theorem appendTransition_self (i : WithTop I) : - cone.appendTransition (le_refl i) = - GroundChronologicalMainTransition.identity pairing unions powers separation (cone.appendStage i) := by - cases i with - | top => rfl - | coe i => exact diagram.self i - -theorem appendTransition_comp {i j k : WithTop I} (hij : i ≤ j) (hjk : j ≤ k) : - cone.appendTransition (le_trans hij hjk) = - (cone.appendTransition hij).comp pairing unions powers separation (cone.appendTransition hjk) := by - cases i with - | top => - cases j with - | coe j => exact False.elim (WithTop.not_top_le_coe j hij) - | top => - cases k with - | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) - | top => exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation _).symm - | coe i => - cases j with - | top => - cases k with - | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) - | top => exact (GroundChronologicalMainTransition.comp_identity pairing unions powers separation _).symm - | coe j => - cases k with - | top => exact (cone.coherent (WithTop.coe_le_coe.mp hij)).symm - | coe k => exact diagram.comp (WithTop.coe_le_coe.mp hij) (WithTop.coe_le_coe.mp hjk) - -noncomputable def append : - GroundChronologicalMainDiagram M C D rD pairing unions powers separation (WithTop I) where - stage := cone.appendStage - transition := cone.appendTransition - self := cone.appendTransition_self - comp := cone.appendTransition_comp - -theorem append_reindex : cone.append.reindex (fun i : I => (i : WithTop I)) WithTop.coe_mono = diagram := rfl - -theorem append_coverage (old : diagram.CoversOldBirths) - (legs : ∀ i, (cone.leg i).CoversOldBirths) : cone.append.CoversOldBirths := by - intro i j before - cases i with - | top => - cases j with - | top => exact GroundChronologicalMainTransition.identity_coversOldBirths pairing unions powers separation target - | coe j => exact False.elim (WithTop.not_top_le_coe j before) - | coe i => - cases j with - | top => exact legs i - | coe j => exact old (WithTop.coe_le_coe.mp before) - -end Cone - -theorem coneOfLast_coverage (last : I) (greatest : ∀ i, i ≤ last) - {target : GroundChronologicalMainStage M C D rD} - (step : GroundChronologicalMainTransition (diagram.stage last) target) - (old : diagram.CoversOldBirths) (covered : step.CoversOldBirths) : - (diagram.coneOfLast last greatest step).append.CoversOldBirths := - Cone.append_coverage _ old (fun i => (old (greatest i)).comp pairing unions powers separation covered) - -end PartitionPilot.Forcing.GroundChronologicalMainDiagram - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundChronologicalMainDiagram +open SetFormula +universe u v w +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Preorder I] {J : Type w} [Preorder J] +variable (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) +variable (f : J → I) (mono : Monotone f) + +def reindex : GroundChronologicalMainDiagram M C D rD pairing unions powers separation J where + stage j := diagram.stage (f j) + transition before := diagram.transition (mono before) + self j := diagram.self (f j) + comp first second := diagram.comp (mono first) (mono second) + +theorem CoversOldBirths.reindex (coverage : diagram.CoversOldBirths) : + (diagram.reindex f mono).CoversOldBirths := + fun before => coverage (mono before) + +end PartitionPilot.Forcing.GroundChronologicalMainDiagram + + + +namespace PartitionPilot.Forcing.GroundChronologicalMainDiagram +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Preorder I] +variable (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) + +structure Cone (target : GroundChronologicalMainStage M C D rD) where + leg : ∀ i, GroundChronologicalMainTransition (diagram.stage i) target + coherent : ∀ {i j} (before : i ≤ j), + (diagram.transition before).comp pairing unions powers separation (leg j) = leg i + +noncomputable def coneOfLast (last : I) (greatest : ∀ i, i ≤ last) + {target : GroundChronologicalMainStage M C D rD} + (step : GroundChronologicalMainTransition (diagram.stage last) target) : diagram.Cone target where + leg i := (diagram.transition (greatest i)).comp pairing unions powers separation step + coherent := by + intro i j before + rw [← GroundChronologicalMainTransition.comp_assoc, ← diagram.comp] + +namespace Cone +variable {diagram} {target : GroundChronologicalMainStage M C D rD} (cone : diagram.Cone target) + +def appendStage (_cone : diagram.Cone target) : WithTop I → GroundChronologicalMainStage M C D rD + | none => target + | some i => diagram.stage i + +noncomputable def appendTransition {i j : WithTop I} (before : i ≤ j) : + GroundChronologicalMainTransition (cone.appendStage i) (cone.appendStage j) := by + cases i with + | top => + cases j with + | top => exact GroundChronologicalMainTransition.identity pairing unions powers separation target + | coe j => exact False.elim (WithTop.not_top_le_coe j before) + | coe i => + cases j with + | top => exact cone.leg i + | coe j => exact diagram.transition (WithTop.coe_le_coe.mp before) + +theorem appendTransition_self (i : WithTop I) : + cone.appendTransition (le_refl i) = + GroundChronologicalMainTransition.identity pairing unions powers separation (cone.appendStage i) := by + cases i with + | top => rfl + | coe i => exact diagram.self i + +theorem appendTransition_comp {i j k : WithTop I} (hij : i ≤ j) (hjk : j ≤ k) : + cone.appendTransition (le_trans hij hjk) = + (cone.appendTransition hij).comp pairing unions powers separation (cone.appendTransition hjk) := by + cases i with + | top => + cases j with + | coe j => exact False.elim (WithTop.not_top_le_coe j hij) + | top => + cases k with + | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) + | top => exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation _).symm + | coe i => + cases j with + | top => + cases k with + | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) + | top => exact (GroundChronologicalMainTransition.comp_identity pairing unions powers separation _).symm + | coe j => + cases k with + | top => exact (cone.coherent (WithTop.coe_le_coe.mp hij)).symm + | coe k => exact diagram.comp (WithTop.coe_le_coe.mp hij) (WithTop.coe_le_coe.mp hjk) + +noncomputable def append : + GroundChronologicalMainDiagram M C D rD pairing unions powers separation (WithTop I) where + stage := cone.appendStage + transition := cone.appendTransition + self := cone.appendTransition_self + comp := cone.appendTransition_comp + +theorem append_reindex : cone.append.reindex (fun i : I => (i : WithTop I)) WithTop.coe_mono = diagram := rfl + +theorem append_coverage (old : diagram.CoversOldBirths) + (legs : ∀ i, (cone.leg i).CoversOldBirths) : cone.append.CoversOldBirths := by + intro i j before + cases i with + | top => + cases j with + | top => exact GroundChronologicalMainTransition.identity_coversOldBirths pairing unions powers separation target + | coe j => exact False.elim (WithTop.not_top_le_coe j before) + | coe i => + cases j with + | top => exact legs i + | coe j => exact old (WithTop.coe_le_coe.mp before) + +end Cone + +theorem coneOfLast_coverage (last : I) (greatest : ∀ i, i ≤ last) + {target : GroundChronologicalMainStage M C D rD} + (step : GroundChronologicalMainTransition (diagram.stage last) target) + (old : diagram.CoversOldBirths) (covered : step.CoversOldBirths) : + (diagram.coneOfLast last greatest step).append.CoversOldBirths := + Cone.append_coverage _ old (fun i => (old (greatest i)).comp pairing unions powers separation covered) + +end PartitionPilot.Forcing.GroundChronologicalMainDiagram + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalDecidedVisibility.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalDecidedVisibility.lean index 58ee27582b2a8bdd2241e2978894125e5ecb5f8d..e7ca521d59dfc9391ffb093c9cfec5fc19ddc86b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalDecidedVisibility.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalDecidedVisibility.lean @@ -1,115 +1,115 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalRowSupport - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) - -theorem exists_decided_visibilityProfile - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) Q) - (maps : a.conditionMapFamily s t ∈ M.sets) - (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (_children : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) - (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - (z : (M.nameDomain s).names) - (_hs : HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z.val) - (_subset : Name.eval {p | H.mem p} z.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (p : Q) (_hp : H.mem p), - let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) - ∃ ground : F ∈ M.sets, - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - ∃ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega ∧ B ⊆ F ∧ - (∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ geometry.order) ∧ - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain s) visibilityProfileFormula - (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection - carrier geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid F ground z) q ∧ - M.DecidesVisibilityProfile a s b d.principalFix T F z.val q := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a maps T hT valid terms children H genericCoded genericFormula descent z hs subset p hp - let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) - have supports := geometry.decoded_supportBasis_ground pairing unions powers separation - have system := M.niceNameSystem a s t pairing unions powers separation collection carrier order - maps hT valid terms b d ⊥ directed geometry.actors_ground geometry.carrier_ground supports children - have filter : MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F := by - have coded := M.visibleSupportProfile_filter a s b d ⊥ directed T H valid system genericFormula - z hs subset geometry.meet.smallMeet descent - have meetGraph : (b.product b).graph b (fun vw => geometry.meet.smallMeet vw.1 vw.2) = - geometry.meetGraph := geometry.meet.smallMeet_graph_eq - have orderGraph : b.conditionOrder = geometry.order := geometry.decoded_order_eq - rw [meetGraph, orderGraph] at coded - exact coded - have inExtension := M.visibleSupportProfile_mem_ordinary a s t b d pairing unions powers separation - collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid order - infinite H genericFormula z - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order - infinite H genericFormula - have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite - choice carrier order H genericFormula - have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation collection - infinite choice carrier order small geometry.carrier_ground closed H genericCoded genericFormula - obtain ⟨B, hB, _, countable, contained, coinitial, _, ground⟩ := - fulfilled.reflected_extension_basis reflection infinite choice - (M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H) - zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 zf.2.1 zf.1.2.2.2.2.2.2 choiceN - smallD irreflexive inExtension filter - refine ⟨ground, filter, B, hB, countable, contained, coinitial, ?_⟩ - exact M.exists_forced_visibleSupportProfile a s t b d pairing unions powers separation collection - carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid small H - genericFormula z ground p hp - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalRowSupport + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) + +theorem exists_decided_visibilityProfile + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) Q) + (maps : a.conditionMapFamily s t ∈ M.sets) + (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (_children : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) + (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + (z : (M.nameDomain s).names) + (_hs : HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z.val) + (_subset : Name.eval {p | H.mem p} z.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (p : Q) (_hp : H.mem p), + let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) + ∃ ground : F ∈ M.sets, + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + ∃ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega ∧ B ⊆ F ∧ + (∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ geometry.order) ∧ + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain s) visibilityProfileFormula + (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection + carrier geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid F ground z) q ∧ + M.DecidesVisibilityProfile a s b d.principalFix T F z.val q := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a maps T hT valid terms children H genericCoded genericFormula descent z hs subset p hp + let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) + have supports := geometry.decoded_supportBasis_ground pairing unions powers separation + have system := M.niceNameSystem a s t pairing unions powers separation collection carrier order + maps hT valid terms b d ⊥ directed geometry.actors_ground geometry.carrier_ground supports children + have filter : MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F := by + have coded := M.visibleSupportProfile_filter a s b d ⊥ directed T H valid system genericFormula + z hs subset geometry.meet.smallMeet descent + have meetGraph : (b.product b).graph b (fun vw => geometry.meet.smallMeet vw.1 vw.2) = + geometry.meetGraph := geometry.meet.smallMeet_graph_eq + have orderGraph : b.conditionOrder = geometry.order := geometry.decoded_order_eq + rw [meetGraph, orderGraph] at coded + exact coded + have inExtension := M.visibleSupportProfile_mem_ordinary a s t b d pairing unions powers separation + collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid order + infinite H genericFormula z + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order + infinite H genericFormula + have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite + choice carrier order H genericFormula + have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation collection + infinite choice carrier order small geometry.carrier_ground closed H genericCoded genericFormula + obtain ⟨B, hB, _, countable, contained, coinitial, _, ground⟩ := + fulfilled.reflected_extension_basis reflection infinite choice + (M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H) + zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 zf.2.1 zf.1.2.2.2.2.2.2 choiceN + smallD irreflexive inExtension filter + refine ⟨ground, filter, B, hB, countable, contained, coinitial, ?_⟩ + exact M.exists_forced_visibleSupportProfile a s t b d pairing unions powers separation collection + carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid small H + genericFormula z ground p hp + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalEnumeratedCertificateFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalEnumeratedCertificateFamilies.lean index 44a238523e3b06a618082d18b0e5ef7492005b70..65960b7c6a95b23568f1bccc1fe8d37fdc7d835c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalEnumeratedCertificateFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalEnumeratedCertificateFamilies.lean @@ -1,255 +1,255 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSupportedCertificateFamilyDecisions -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSupportedCertificateProfiles -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) - -theorem exists_forcedSupportedCertificateFamily - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) Q) - (_maps : a.conditionMapFamily s t ∈ M.sets) - (T : ZFSet.{u}) (_hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (_children : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) - (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - (J : ZFSet.{u}) (_hJ : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) - (_smallJ : M.groundEmbeddable J ZFSet.omega) - (_hs : ∀ z : Name s, z.val ∈ J → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z) - (_subset : ∀ z : Name s, z.val ∈ J → Name.eval {p | H.mem p} z ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (p : Q) (_hp : H.mem p), - ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), - ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes a s T d.principalFix)) k ∧ - k ⊆ M.supportedCertificateFamilyRelation a s b T d.principalFix - geometry.order J validJ H ∧ - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain s) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv a s t b T d.principalFix pairing unions powers - separation collection carrier geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - _maps _hT valid (M.omega_mem separation infinite) geometry.order J k - geometry.order_ground _hJ hk validJ) q ∧ - ∀ (z : (M.nameDomain s).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F = M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∧ - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - B.Nonempty ∧ M.DecidesVisibilityProfile a s b d.principalFix T F z.val q ∧ - (∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) ∧ - ∃ e ∈ M.sets, ∃ names ∈ M.sets, - ZFSet.IsFunc ZFSet.omega B e ∧ - ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes a s T d.principalFix) names ∧ - (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a maps T hT valid terms children H genericCoded genericFormula descent - J hJ validJ smallJ hs subsets p hp - have supports := geometry.decoded_supportBasis_ground pairing unions powers separation - have omega := M.omega_mem separation infinite - have codesGround := M.niceSupportNameCodes_mem a s b T d.principalFix t pairing unions powers - separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid - obtain ⟨k, hk, function, selected⟩ := fulfilled.exists_supportedCertificateFamily s collection - infinite choice carrier order small closed smallD irreflexive a maps T hT valid terms children - H genericCoded genericFormula descent J hJ validJ smallJ hs subsets - obtain ⟨q, hq, qp, forced⟩ := M.exists_forced_supportedCertificateFamily a s t b T d.principalFix - pairing unions powers separation collection carrier geometry.actors_ground geometry.carrier_ground - supports maps hT valid omega geometry.order J k geometry.order_ground hJ hk validJ H - genericFormula selected p hp - refine ⟨k, hk, function, selected, q, hq, qp, forced, ?_⟩ - intro z F B f entry - have bound := ZFSet.pair_mem_prod.1 (function.1 entry) - have fields := (M.mem_supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes a s T d.principalFix) F B f).1 bound.2 - obtain ⟨_, _, _, _, value, evaluated, certificate⟩ := - (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 (selected entry) - have valueEqual := (Name.inputEvaluationName_entry s J validJ z.val H value).1 evaluated - have actual : SupportedEqualityCertificate b.carrier - (M.niceSupportNameCodes a s T d.principalFix) geometry.order - (M.niceSupportRelation a s b T d.principalFix) - (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T d.principalFix)) - (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T d.principalFix)) - (Name.eval {p | H.mem p} z.val) F B f := valueEqual.2.symm ▸ certificate - have profileEqual := M.supportedCertificate_profile_eq a s b d T H actual - obtain ⟨_, profileFilter, _⟩ := fulfilled.exists_decided_visibilityProfile s collection infinite - choice carrier order small closed smallD irreflexive a maps T hT valid terms children - H genericCoded genericFormula descent z (hs z.val bound.1) (subsets z.val bound.1) p hp - have filter : MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F := - profileEqual.symm ▸ profileFilter - have nonempty := actual.basis_nonempty filter.nonempty - have decisions := M.forces_supportedCertificateFamily_profile a s t b T d.principalFix - pairing unions powers separation collection carrier geometry.actors_ground geometry.carrier_ground - supports maps hT valid omega geometry.order J k geometry.order_ground hJ hk validJ small - z F B f q forced entry fields.1.1 - refine ⟨profileEqual, filter, nonempty, decisions, ?_, ?_⟩ - · intro v hv tau ht selectedEntry - exact M.forces_supportedCertificateFamily_equality a s t b T d.principalFix pairing unions powers - separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid - omega geometry.order J k geometry.order_ground hJ hk validJ small z F B f q forced entry - v hv tau ht selectedEntry - · exact M.groundFunction_enumeration pairing unions powers separation infinite fields.2.1.1 - codesGround fields.2.2.1 nonempty fields.2.1.2.2 actual.2.2.2.1 - -theorem exists_enumeratedSupportedCertificateFamily - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) Q) - (_maps : a.conditionMapFamily s t ∈ M.sets) - (T : ZFSet.{u}) (_hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (_children : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) - (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - (J : ZFSet.{u}) (_hJ : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) - (_smallJ : M.groundEmbeddable J ZFSet.omega) - (_hs : ∀ z : Name s, z.val ∈ J → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z) - (_subset : ∀ z : Name s, z.val ∈ J → Name.eval {p | H.mem p} z ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (p : Q) (_hp : H.mem p), - ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), - ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes a s T d.principalFix)) k ∧ - k ⊆ M.supportedCertificateFamilyRelation a s b T d.principalFix - geometry.order J validJ H ∧ - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain s) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv a s t b T d.principalFix pairing unions powers - separation collection carrier geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - _maps _hT valid (M.omega_mem separation infinite) geometry.order J k - geometry.order_ground _hJ hk validJ) q ∧ - ∃ enumerations ∈ M.sets, - ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier - (M.niceSupportNameCodes a s T d.principalFix)) enumerations ∧ - enumerations ⊆ M.certificateEnumerationRelation J b.carrier - (M.niceSupportNameCodes a s T d.principalFix) k ∧ - (∀ j F B f e names, - ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → - SynchronizedEnumerationCode ZFSet.omega - (M.niceSupportNameCodes a s T d.principalFix) B f e names) ∧ - ∀ (z : (M.nameDomain s).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F = M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∧ - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - B.Nonempty ∧ M.DecidesVisibilityProfile a s b d.principalFix T F z.val q ∧ - (∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) ∧ - ∃ e ∈ M.sets, ∃ names ∈ M.sets, - ZFSet.IsFunc ZFSet.omega B e ∧ - ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes a s T d.principalFix) names ∧ - (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a maps T hT valid terms children H genericCoded genericFormula descent - J hJ validJ smallJ hs subsets p hp - obtain ⟨k, hk, function, selected, q, hq, qp, forced, entries⟩ := - fulfilled.exists_forcedSupportedCertificateFamily s collection infinite choice carrier order - small closed smallD irreflexive a maps T hT valid terms children H genericCoded - genericFormula descent J hJ validJ smallJ hs subsets p hp - have supports := geometry.decoded_supportBasis_ground pairing unions powers separation - have codesGround := M.niceSupportNameCodes_mem a s b T d.principalFix t pairing unions powers - separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid - have certificates : ∀ j F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - B.Nonempty ∧ ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f := by - intro j F B f stored - have hj := (ZFSet.pair_mem_prod.1 (function.1 stored)).1 - let z : (M.nameDomain s).names := ⟨⟨j, validJ j hj⟩, M.transitive hJ hj⟩ - have chosen := entries z F B f stored - obtain ⟨_, _, _, _, _, _, certificate⟩ := - (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 (selected stored) - exact ⟨chosen.2.2.1, certificate.2.2.2.1⟩ - obtain ⟨enumerations, ground, enumerationFunction, enumerationRelation, synchronized⟩ := - M.exists_supportedCertificateEnumerations pairing unions powers separation infinite choice - hJ geometry.carrier_ground codesGround hk function certificates - exact ⟨k, hk, function, selected, q, hq, qp, forced, enumerations, ground, - enumerationFunction, enumerationRelation, synchronized, entries⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSupportedCertificateFamilyDecisions +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSupportedCertificateProfiles +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCertificateProfileImageFamilies + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [PartialOrder Q] [OrderTop Q] (s : Presentation Q) + +theorem exists_forcedSupportedCertificateFamily + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) Q) + (_maps : a.conditionMapFamily s t ∈ M.sets) + (T : ZFSet.{u}) (_hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (_children : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) + (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + (J : ZFSet.{u}) (_hJ : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) + (_smallJ : M.groundEmbeddable J ZFSet.omega) + (_hs : ∀ z : Name s, z.val ∈ J → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z) + (_subset : ∀ z : Name s, z.val ∈ J → Name.eval {p | H.mem p} z ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (p : Q) (_hp : H.mem p), + ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), + ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes a s T d.principalFix)) k ∧ + k ⊆ M.supportedCertificateFamilyRelation a s b T d.principalFix + geometry.order J validJ H ∧ + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain s) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv a s t b T d.principalFix pairing unions powers + separation collection carrier geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + _maps _hT valid (M.omega_mem separation infinite) geometry.order J k + geometry.order_ground _hJ hk validJ) q ∧ + ∀ (z : (M.nameDomain s).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F = M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∧ + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + B.Nonempty ∧ M.DecidesVisibilityProfile a s b d.principalFix T F z.val q ∧ + (∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) ∧ + ∃ e ∈ M.sets, ∃ names ∈ M.sets, + ZFSet.IsFunc ZFSet.omega B e ∧ + ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes a s T d.principalFix) names ∧ + (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a maps T hT valid terms children H genericCoded genericFormula descent + J hJ validJ smallJ hs subsets p hp + have supports := geometry.decoded_supportBasis_ground pairing unions powers separation + have omega := M.omega_mem separation infinite + have codesGround := M.niceSupportNameCodes_mem a s b T d.principalFix t pairing unions powers + separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid + obtain ⟨k, hk, function, selected⟩ := fulfilled.exists_supportedCertificateFamily s collection + infinite choice carrier order small closed smallD irreflexive a maps T hT valid terms children + H genericCoded genericFormula descent J hJ validJ smallJ hs subsets + obtain ⟨q, hq, qp, forced⟩ := M.exists_forced_supportedCertificateFamily a s t b T d.principalFix + pairing unions powers separation collection carrier geometry.actors_ground geometry.carrier_ground + supports maps hT valid omega geometry.order J k geometry.order_ground hJ hk validJ H + genericFormula selected p hp + refine ⟨k, hk, function, selected, q, hq, qp, forced, ?_⟩ + intro z F B f entry + have bound := ZFSet.pair_mem_prod.1 (function.1 entry) + have fields := (M.mem_supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes a s T d.principalFix) F B f).1 bound.2 + obtain ⟨_, _, _, _, value, evaluated, certificate⟩ := + (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 (selected entry) + have valueEqual := (Name.inputEvaluationName_entry s J validJ z.val H value).1 evaluated + have actual : SupportedEqualityCertificate b.carrier + (M.niceSupportNameCodes a s T d.principalFix) geometry.order + (M.niceSupportRelation a s b T d.principalFix) + (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T d.principalFix)) + (Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T d.principalFix)) + (Name.eval {p | H.mem p} z.val) F B f := valueEqual.2.symm ▸ certificate + have profileEqual := M.supportedCertificate_profile_eq a s b d T H actual + obtain ⟨_, profileFilter, _⟩ := fulfilled.exists_decided_visibilityProfile s collection infinite + choice carrier order small closed smallD irreflexive a maps T hT valid terms children + H genericCoded genericFormula descent z (hs z.val bound.1) (subsets z.val bound.1) p hp + have filter : MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F := + profileEqual.symm ▸ profileFilter + have nonempty := actual.basis_nonempty filter.nonempty + have decisions := M.forces_supportedCertificateFamily_profile a s t b T d.principalFix + pairing unions powers separation collection carrier geometry.actors_ground geometry.carrier_ground + supports maps hT valid omega geometry.order J k geometry.order_ground hJ hk validJ small + z F B f q forced entry fields.1.1 + refine ⟨profileEqual, filter, nonempty, decisions, ?_, ?_⟩ + · intro v hv tau ht selectedEntry + exact M.forces_supportedCertificateFamily_equality a s t b T d.principalFix pairing unions powers + separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid + omega geometry.order J k geometry.order_ground hJ hk validJ small z F B f q forced entry + v hv tau ht selectedEntry + · exact M.groundFunction_enumeration pairing unions powers separation infinite fields.2.1.1 + codesGround fields.2.2.1 nonempty fields.2.1.2.2 actual.2.2.2.1 + +theorem exists_enumeratedSupportedCertificateFamily + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) Q) + (_maps : a.conditionMapFamily s t ∈ M.sets) + (T : ZFSet.{u}) (_hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (_terms : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (_children : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ) + (H : ConditionFilter Q) (_genericCoded : H.GenericFor (M.codedFamily s)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ a.stabilizer s τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + (J : ZFSet.{u}) (_hJ : J ∈ M.sets) (validJ : ∀ z ∈ J, IsName s z) + (_smallJ : M.groundEmbeddable J ZFSet.omega) + (_hs : ∀ z : Name s, z.val ∈ J → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) z) + (_subset : ∀ z : Name s, z.val ∈ J → Name.eval {p | H.mem p} z ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (p : Q) (_hp : H.mem p), + ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), + ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes a s T d.principalFix)) k ∧ + k ⊆ M.supportedCertificateFamilyRelation a s b T d.principalFix + geometry.order J validJ H ∧ + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain s) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv a s t b T d.principalFix pairing unions powers + separation collection carrier geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + _maps _hT valid (M.omega_mem separation infinite) geometry.order J k + geometry.order_ground _hJ hk validJ) q ∧ + ∃ enumerations ∈ M.sets, + ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier + (M.niceSupportNameCodes a s T d.principalFix)) enumerations ∧ + enumerations ⊆ M.certificateEnumerationRelation J b.carrier + (M.niceSupportNameCodes a s T d.principalFix) k ∧ + (∀ j F B f e names, + ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → + SynchronizedEnumerationCode ZFSet.omega + (M.niceSupportNameCodes a s T d.principalFix) B f e names) ∧ + ∀ (z : (M.nameDomain s).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F = M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∧ + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + B.Nonempty ∧ M.DecidesVisibilityProfile a s b d.principalFix T F z.val q ∧ + (∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) ∧ + ∃ e ∈ M.sets, ∃ names ∈ M.sets, + ZFSet.IsFunc ZFSet.omega B e ∧ + ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes a s T d.principalFix) names ∧ + (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a maps T hT valid terms children H genericCoded genericFormula descent + J hJ validJ smallJ hs subsets p hp + obtain ⟨k, hk, function, selected, q, hq, qp, forced, entries⟩ := + fulfilled.exists_forcedSupportedCertificateFamily s collection infinite choice carrier order + small closed smallD irreflexive a maps T hT valid terms children H genericCoded + genericFormula descent J hJ validJ smallJ hs subsets p hp + have supports := geometry.decoded_supportBasis_ground pairing unions powers separation + have codesGround := M.niceSupportNameCodes_mem a s b T d.principalFix t pairing unions powers + separation collection carrier geometry.actors_ground geometry.carrier_ground supports maps hT valid + have certificates : ∀ j F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + B.Nonempty ∧ ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f := by + intro j F B f stored + have hj := (ZFSet.pair_mem_prod.1 (function.1 stored)).1 + let z : (M.nameDomain s).names := ⟨⟨j, validJ j hj⟩, M.transitive hJ hj⟩ + have chosen := entries z F B f stored + obtain ⟨_, _, _, _, _, _, certificate⟩ := + (pair_mem_supportedCertificateRelation _ _ _ _ _ _ _ _ _ _ _ _ _ _ _).1 (selected stored) + exact ⟨chosen.2.2.1, certificate.2.2.2.1⟩ + obtain ⟨enumerations, ground, enumerationFunction, enumerationRelation, synchronized⟩ := + M.exists_supportedCertificateEnumerations pairing unions powers separation infinite choice + hJ geometry.carrier_ground codesGround hk function certificates + exact ⟨k, hk, function, selected, q, hq, qp, forced, enumerations, ground, + enumerationFunction, enumerationRelation, synchronized, entries⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalExtensionBases.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalExtensionBases.lean index 444b4e8c3d71f54a7372b6187e09ebec927e8f9e..3f965a711d0dbe5b38447891dc1cb938f0986673 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalExtensionBases.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalExtensionBases.lean @@ -1,51 +1,51 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalChronology - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalChronology -open SetFormula -universe u v -variable {M N : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} -variable (chronology : run.FinalChronology level) -include chronology - -theorem exists_extension_basis (i₀ : I) - (includes : M.sets ⊆ N.sets) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets infinity Fin.elim0) - (choiceN : Realize N.sets SetFormula.choice Fin.elim0) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {F : ZFSet.{u}} (hF : F ∈ N.sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) : - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ (run.finalGeometry i₀).order := by - have terminal := chronology.terminal_values i₀ - have atTerminal : MeetFilterCode (chronology.serial.toHistory.space run.cutoffLimit) - (chronology.serial.toHistory.order run.cutoffLimit) - (chronology.serial.toHistory.meetGraph run.cutoffLimit) F := by - simpa only [terminal.1, terminal.2.1, terminal.2.2.1] using filter - have basis := chronology.serial.toHistory.exists_extension_basis includes pairingN unionsN powersN - separationN infiniteN choiceN - (M.insert_mem pairing unions run.cutoffLimit_ground run.cutoffLimit_ground) - (run.finalGeometry i₀).columns_ground (run.finalGeometry i₀).coordinates_ground - chronology.serial.ordinal smallD irreflexive (ZFSet.mem_insert run.cutoffLimit run.cutoffLimit) - hF atTerminal - simpa only [terminal.2.1] using basis - -end PartitionPilot.Forcing.GroundMainPrefix.FinalChronology - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalChronology + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalChronology +open SetFormula +universe u v +variable {M N : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} +variable (chronology : run.FinalChronology level) +include chronology + +theorem exists_extension_basis (i₀ : I) + (includes : M.sets ⊆ N.sets) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets infinity Fin.elim0) + (choiceN : Realize N.sets SetFormula.choice Fin.elim0) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {F : ZFSet.{u}} (hF : F ∈ N.sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) : + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ (run.finalGeometry i₀).order := by + have terminal := chronology.terminal_values i₀ + have atTerminal : MeetFilterCode (chronology.serial.toHistory.space run.cutoffLimit) + (chronology.serial.toHistory.order run.cutoffLimit) + (chronology.serial.toHistory.meetGraph run.cutoffLimit) F := by + simpa only [terminal.1, terminal.2.1, terminal.2.2.1] using filter + have basis := chronology.serial.toHistory.exists_extension_basis includes pairingN unionsN powersN + separationN infiniteN choiceN + (M.insert_mem pairing unions run.cutoffLimit_ground run.cutoffLimit_ground) + (run.finalGeometry i₀).columns_ground (run.finalGeometry i₀).coordinates_ground + chronology.serial.ordinal smallD irreflexive (ZFSet.mem_insert run.cutoffLimit run.cutoffLimit) + hF atTerminal + simpa only [terminal.2.1] using basis + +end PartitionPilot.Forcing.GroundMainPrefix.FinalChronology + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFairPreparationOrbits.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFairPreparationOrbits.lean index 4f370077ccf6e6c1b7225a99c8f27f6a89d96788..b5f716b5eb3455a229abe1eaddc0a480a89067d8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFairPreparationOrbits.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFairPreparationOrbits.lean @@ -1,840 +1,840 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticPreparedWitnessSelections -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedAlignedReferenceCollisions -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPrefixPreparationBatches -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralBirthLevelSelectors - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {R : Type u} [PartialOrder R] (c : Presentation R) - -theorem exists_preparationTransition - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history) - (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice rowClosed - let lowerGround := inputs.1 - let maps := inputs.2.2.1 - let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code - ∀ (pUpper : SetMembers upperQ) (row A : ZFSet.{u}) - (_code : SetMembers.raw pUpper = ZFSet.pair row A), - let selected := assignmentOnIndices indices T A - let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected - let bound := M.groundRelations T lower.carrier - let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) - ∀ (_descent : ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) → - H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val), - ∃ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) ∧ - H.GenericFor (formulaFamily (M.nameDomain lower)) ∧ H.mem (restriction pUpper) ∧ - ∃ (validJ : ∀ z ∈ J, IsName lower z) (hJ : J ∈ M.sets), - M.groundEmbeddable J ZFSet.omega ∧ - (∀ z : Name lower, z.val ∈ J → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) z ∧ - Name.eval {q | H.mem q} z ⊆ Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) ∧ - ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), - ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix)) k ∧ - (∀ j F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - j ∈ J ∧ F ∈ M.sets ∧ B ∈ M.sets ∧ f ∈ M.sets ∧ - M.groundEmbeddable B ZFSet.omega ∧ F ⊆ b.carrier ∧ B ⊆ F ∧ - (∀ v ∈ F, ∃ w ∈ B, ZFSet.pair w v ∈ geometry.order) ∧ - ZFSet.IsFunc B (M.niceSupportNameCodes lowerAct lower T d.principalFix) f ∧ - ∀ v ∈ B, ∀ tau ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix, - ZFSet.pair v tau ∈ f → - ZFSet.pair v tau ∈ M.niceSupportRelation lowerAct lower b T d.principalFix) ∧ - k ⊆ M.supportedCertificateFamilyRelation lowerAct lower b T d.principalFix - geometry.order J validJ H ∧ - ∃ q, H.mem q ∧ q ≤ restriction pUpper ∧ - Forces (M.nameDomain lower) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers - separation collection lowerGround geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid (M.omega_mem separation infinite) geometry.order J k - geometry.order_ground hJ hk validJ) q ∧ - ∃ (r : SetMembers upperQ) (newRow newA : ZFSet.{u}), - r ≤ pUpper ∧ restriction r = q ∧ - SetMembers.raw r = ZFSet.pair newRow newA ∧ - ZFSet.pair newRow row ∈ c.conditionOrder ∧ A ⊆ newA ∧ - SetMembers.raw (restriction r) = ZFSet.pair newRow - (assignmentCut (refinementDataHistoryLevels stages packed T) alpha newA) ∧ - H.mem (restriction r) ∧ - Forces (M.nameDomain lower) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers - separation collection lowerGround geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid (M.omega_mem separation infinite) geometry.order J k - geometry.order_ground hJ hk validJ) (restriction r) ∧ - ∃ enumerations ∈ M.sets, - ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix)) enumerations ∧ - enumerations ⊆ M.certificateEnumerationRelation J b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix) k ∧ - (∀ j F B f e names, - ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → - SynchronizedEnumerationCode ZFSet.omega - (M.niceSupportNameCodes lowerAct lower T d.principalFix) B f e names) ∧ - ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F = M.visibleSupportProfile lowerAct lower b d T H (Name.eval {p | H.mem p} z.val) ∧ - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - B.Nonempty ∧ M.DecidesVisibilityProfile lowerAct lower b d.principalFix T F z.val (restriction r) ∧ - (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq (restriction r) z.val tau) ∧ - ∃ e ∈ M.sets, ∃ names ∈ M.sets, - ZFSet.IsFunc ZFSet.omega B e ∧ - ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes lowerAct lower T d.principalFix) names ∧ - (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by - let geometry := run.finalGeometry i₀ - let instGeometryGroup := geometry.group_code.toGroup - let instGeometryOrder := geometry.meet.order.toPartialOrder - let instGeometryBottom := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history alpha hs hh ordinal trace member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - let instLowerHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - let instLowerHistoryTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice rowClosed - let lowerGround := inputs.1 - let maps := inputs.2.2.1 - let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let instUpperHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code - let projection := M.semanticStructuralTrace_completeProjection c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset - infinite choice - intro pUpper row A code descent - obtain ⟨H, hp, genericCoded, genericFormula⟩ := - M.exists_coded_ordinary_generic lower small lowerGround (restriction pUpper) - let selected := assignmentOnIndices indices T A - let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected - let bound := M.groundRelations T lower.carrier - let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) - have condition : ZFSet.pair row A ∈ upperQ := code ▸ SetMembers.raw_mem pUpper - obtain ⟨validJ, hJ, smallJ, facts, k, hk, function, selectedCertificates, - q, hq, qp, forced, enumerations, hEnumerations, enumerationFunction, - enumerationRelation, synchronized, entries⟩ := - fulfilled.exists_prefixPreparationBatch c collection infinite choice small smallD irreflexive rowClosed - a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history alpha hs hh ordinal trace member row A condition - H genericCoded genericFormula (descent H genericCoded genericFormula) (restriction pUpper) hp - obtain ⟨r, rp, rq⟩ := projection.lift pUpper q qp - obtain ⟨newRow, _, newA, _, rCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape c.carrier T stages packed (SetMembers.raw_mem r)) - have belowRaw : ZFSet.pair (SetMembers.raw r) (SetMembers.raw pUpper) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed := rp - rw [rCode, code] at belowRaw - have fields := (M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages packed - newRow newA row A).1 belowRaw - have cut := historyRun.restrictionFunction_raw ordinal cutOrdinal subset r newRow newA rCode - refine ⟨H, genericCoded, genericFormula, hp, validJ, hJ, smallJ, facts, k, hk, function, ?_, - selectedCertificates, q, hq, qp, forced, r, newRow, newA, rp, rq, rCode, - fields.2.2.1, fields.2.2.2, cut, rq.symm ▸ hq, rq.symm ▸ forced, - enumerations, hEnumerations, enumerationFunction, enumerationRelation, synchronized, ?_⟩ - · intro j F B f entry - exact M.supportedCertificateFamily_groundData lowerAct lower b T d.principalFix - geometry.order J validJ H j F B f (selectedCertificates entry) - · intro z F B f stored - exact rq.symm ▸ entries z F B f stored - - - - - - -theorem exists_groundPreparationSteps - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history) - (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let fields := M.refinementLevelFormulaData lowerAct lower b d alpha T T2 valid - let levels := refinementDataHistoryLevels stages packed T - let relation := M.storedPreparationRelation upperQ - (M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed) - b.carrier T levels alpha geometry.meetGraph fields - ∀ (_descent : ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) → - H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val), - relation ∈ M.sets ∧ ∃ step ∈ M.sets, - ZFSet.IsFunc upperQ (M.preparationWitnessBound b.carrier T upperQ) step ∧ - step ⊆ relation := by - let geometry := run.finalGeometry i₀ - let instGeometryGroup := geometry.group_code.toGroup - let instGeometryOrder := geometry.meet.order.toPartialOrder - let instGeometryBottom := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history alpha hs hh ordinal trace member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - let instLowerHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - let instLowerHistoryTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice rowClosed - let lowerGround := inputs.1 - let lowerOrder := inputs.2.1 - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let instUpperHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code - intro descent - let fields := M.refinementLevelFormulaData lowerAct lower b d alpha T T2 valid - let levels := refinementDataHistoryLevels stages packed T - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.storedPreparationRelation upperQ upperOrder b.carrier T levels alpha geometry.meetGraph fields - have packedGround := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrder - (Fin.cases supports (Fin.cases hT (Fin.cases hT2 - (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have stored := M.semanticStructuralPrefix_refinementData_entry c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - have fieldGround : ∀ j, fields j ∈ M.sets := - M.refinementFormulaDataCode_fields_mem fields (M.pair_right (M.transitive packedGround stored)) - have bounds := M.semanticStructuralPreparationWitness_bounds c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace hAlpha cutOrdinal subset - infinite choice - have upperOrderGround := M.refinementHistoryOrder_mem pairing unions powers separation - carrier rowOrder hT hs packedGround omega - have levelsGround := M.refinementDataHistoryLevels_mem pairing unions powers separation hs packedGround hT - have meetCode : MeetOrderCode (fields 10) (fields 11) geometry.meetGraph := by - change MeetOrderCode b.carrier b.conditionOrder geometry.meetGraph - rw [geometry.decoded_order_eq] - exact geometry.meet - have relationGround : relation ∈ M.sets := M.storedPreparationRelation_mem - pairing unions powers separation bounds.1 upperOrderGround geometry.carrier_ground hT - levelsGround hAlpha geometry.meet_ground omega fields fieldGround meetCode - have total : ∀ input ∈ upperQ, ∃ output ∈ M.preparationWitnessBound b.carrier T upperQ, - ZFSet.pair input output ∈ relation := by - intro input hInput - obtain ⟨row, _, A, _, rfl⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape c.carrier T stages packed hInput) - let pUpper := SetMembers.ofMem (ZFSet.pair row A) hInput - have pCode : SetMembers.raw pUpper = ZFSet.pair row A := SetMembers.raw_ofMem _ _ - let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid - let selected := assignmentOnIndices indices T A - let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected - let bound := M.groundRelations T lower.carrier - let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) - obtain ⟨H, _genericCoded, _genericFormula, _hp, validJ, hJ, _smallJ, _facts, - k, hk, function, _groundData, selectedCertificates, q, _hq, _qp, _forced, - r, newRow, newA, rp, _rq, rCode, _rowBelow, _retained, cut, _hr, _forcedr, - enumerations, hEnumerations, enumerationFunction, _enumerationRelation, synchronized, entries⟩ := - fulfilled.exists_preparationTransition c collection infinite choice small smallD irreflexive rowClosed - a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history alpha hs hh ordinal trace member pUpper row A pCode descent - have prepared := M.preparedCertificateFamilyCode_of_selected lowerAct lower b T d.principalFix - pairing unions powers separation collection lowerGround lowerOrder hT valid (fieldGround 13) - geometry.order geometry.meetGraph J hJ validJ H (restriction r) k enumerations - function selectedCertificates enumerationFunction synchronized (by - intro z F B f entry - have data := entries z F B f entry - exact ⟨data.2.1, data.2.2.1, data.2.2.2.1, data.2.2.2.2.1⟩) - have enlarged := prepared.bounds_mono - (M.supportedEqualityCertificateBound_mono bounds.2.2.2) - (M.synchronizedEnumerationBound_mono bounds.2.2.2) - have witnessBound := M.semanticStructuralPreparationWitness_mem c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace hAlpha cutOrdinal subset - infinite choice A (SetMembers.raw r) k enumerations (SetMembers.raw_mem r) hk hEnumerations - function enumerationFunction - refine ⟨ZFSet.pair (SetMembers.raw r) (ZFSet.pair k enumerations), witnessBound, ?_⟩ - apply (M.pair_mem_storedPreparationRelation upperQ upperOrder b.carrier T levels alpha - geometry.meetGraph fields _ _).2 - refine ⟨hInput, witnessBound, row, A, SetMembers.raw r, k, enumerations, - SetMembers.raw (restriction r), rfl, rfl, ?_, ?_, ?_⟩ - · change ZFSet.pair (SetMembers.raw r) (SetMembers.raw pUpper) ∈ upperOrder at rp - exact pCode ▸ rp - · change ZFSet.pair (SetMembers.raw r) (SetMembers.raw (restriction r)) ∈ - rowAssignmentCutGraph upperQ Q levels alpha - rw [rCode] - exact (pair_mem_rowAssignmentCutGraph upperQ Q levels alpha newRow newA _).2 - ⟨rCode ▸ SetMembers.raw_mem r, SetMembers.raw_mem (restriction r), cut⟩ - · change PreparedCertificateFamilyCode M lower.carrier lower.conditionOrder - (lower.encode (restriction r)) b.carrier b.conditionOrder geometry.meetGraph - (M.groundRelations T lower.carrier) (M.niceVisibilityGraph lowerAct lower b T d.principalFix) - (lower.encode ⊤) ZFSet.omega J - (M.supportedEqualityCertificateBound b.carrier (M.groundRelations T upperQ)) - (M.synchronizedEnumerationBound b.carrier (M.groundRelations T upperQ)) k enumerations - let codeAtOrder := fun orderCode : ZFSet.{u} => - PreparedCertificateFamilyCode M lower.carrier lower.conditionOrder - (lower.encode (restriction r)) b.carrier orderCode geometry.meetGraph - (M.groundRelations T lower.carrier) (M.niceVisibilityGraph lowerAct lower b T d.principalFix) - (lower.encode ⊤) ZFSet.omega J - (M.supportedEqualityCertificateBound b.carrier (M.groundRelations T upperQ)) - (M.synchronizedEnumerationBound b.carrier (M.groundRelations T upperQ)) k enumerations - exact Eq.mpr (congrArg codeAtOrder geometry.decoded_order_eq) enlarged - obtain ⟨step, ground, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice - bounds.1 bounds.2.1 relationGround total - exact ⟨relationGround, step, ground, function, selected⟩ - - - - - - -theorem exists_varyingGroundPreparationSteps - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history), - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T - ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) → - H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val - ), - relation ∈ M.sets ∧ ∃ step ∈ M.sets, - ZFSet.IsFunc (ZFSet.prod stages upperQ) (M.preparationWitnessBound b.carrier T upperQ) step ∧ - step ⊆ relation := by - let geometry := run.finalGeometry i₀ - let instGeometryGroup := geometry.group_code.toGroup - let instGeometryOrder := geometry.meet.order.toPartialOrder - let instGeometryBottom := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history hs hh ordinal trace - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T - intro descent - have packedGround := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrder - (Fin.cases supports (Fin.cases hT (Fin.cases hT2 - (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have upperGround := M.refinementHistoryForcing_mem pairing unions powers separation - carrier hT hs packedGround omega - have upperOrderGround := M.refinementHistoryOrder_mem pairing unions powers separation - carrier rowOrder hT hs packedGround omega - have boundGround := M.preparationWitnessBound_mem pairing unions powers separation - geometry.carrier_ground hT upperGround omega - have inputGround := M.prod_mem pairing unions powers separation hs upperGround - have relationGround : relation ∈ M.sets := M.varyingPreparationRelation_mem - pairing unions powers separation hs packedGround upperGround upperOrderGround - geometry.carrier_ground hT omega - have total : ∀ input ∈ ZFSet.prod stages upperQ, - ∃ output ∈ M.preparationWitnessBound b.carrier T upperQ, - ZFSet.pair input output ∈ relation := by - intro input hInput - obtain ⟨alpha, member, p, hp, rfl⟩ := ZFSet.mem_prod.1 hInput - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - let instLowerHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - let instLowerHistoryTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let fields := M.refinementLevelFormulaData lowerAct lower b d alpha T T2 valid - obtain ⟨_fixedGround, fixedStep, _stepGround, function, selected⟩ := - fulfilled.exists_groundPreparationSteps c collection infinite choice small smallD irreflexive rowClosed - a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history alpha hs hh ordinal trace member (descent alpha member) - obtain ⟨y, entry, _unique⟩ := function.2 p hp - have hy := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - have stored := M.semanticStructuralPrefix_refinementData_entry c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground - geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - have meetCode : MeetOrderCode (fields 10) (fields 11) geometry.meetGraph := by - change MeetOrderCode b.carrier b.conditionOrder geometry.meetGraph - rw [geometry.decoded_order_eq] - exact geometry.meet - exact ⟨y, hy, M.varyingPreparationRelation_of_stored stages packed upperQ upperOrder b.carrier T - alpha p y geometry.meetGraph fields member stored rfl rfl meetCode (selected entry)⟩ - obtain ⟨step, ground, function, selected⟩ := M.uniformize_relation pairing unions powers separation - choice inputGround boundGround relationGround total - exact ⟨relationGround, step, ground, function, selected⟩ - - - - - - -theorem exists_groundFairPreparationOrbit - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history), - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T - ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) → - H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val - ), - ∀ p ∈ upperQ, - ∃ enumSelector ∈ M.sets, - ZFSet.IsFunc upperQ (M.groundRelations ZFSet.omega stages) enumSelector ∧ - enumSelector ⊆ M.birthLevelEnumerationRelation upperQ stages - (refinementDataHistoryLevels stages packed T) ∧ - ∃ E0 ∈ M.sets, ZFSet.IsFunc upperQ E0 enumSelector ∧ - ∃ prepSelector ∈ M.sets, - ZFSet.IsFunc (ZFSet.prod stages upperQ) - (M.preparationWitnessBound b.carrier T upperQ) prepSelector ∧ - prepSelector ⊆ relation ∧ - ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ ∃ orbit ∈ M.sets, - ZFSet.IsFunc ZFSet.omega - (M.fairPreparationStates upperQ stages (M.preparationWitnessBound b.carrier T upperQ) - E0 enumSelector) orbit ∧ - (∀ state, ZFSet.pair ∅ state ∈ orbit ↔ - state = ZFSet.pair ∅ (ZFSet.pair p (ZFSet.pair {ZFSet.pair ∅ e} ∅))) ∧ - ∀ n ∈ ZFSet.omega, ∀ state next, - ZFSet.pair n state ∈ orbit → ZFSet.pair (insert n n) next ∈ orbit → - FairPreparationStepCode ZFSet.omega E0 stages (M.preparationWitnessBound b.carrier T upperQ) - enumSelector prepSelector - (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) - state next := by - let geometry := run.finalGeometry i₀ - let instGeometryGroup := geometry.group_code.toGroup - let instGeometryOrder := geometry.meet.order.toPartialOrder - let instGeometryBottom := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history hs hh ordinal trace - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T - intro descent p hp - obtain ⟨_relationGround, prepSelector, hPrep, prepFunction, prepSelected⟩ := - fulfilled.exists_varyingGroundPreparationSteps c collection infinite choice small smallD - irreflexive rowClosed a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 - closed1 closed2 children1 children2 topMem topRows stages history hs hh ordinal trace descent - obtain ⟨hQ, _enumBoundGround, _birthRelationGround, enumSelector, hEnum, - enumFunction, enumSelected, _birthCodes⟩ := - M.structuralForcingTrace_birthLevelEnumerations c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 pairing unions powers separation collection - infinite choice carrier geometry.actors_ground geometry.carrier_ground nodeOrder supports - hT hT2 hs hh ordinal trace - let E0 := relationImage upperQ (M.groundRelations ZFSet.omega stages) enumSelector - obtain ⟨hE0, _rangeBound, enumCases, _rangeEntries⟩ := - M.birthEnumerationRange_spec pairing unions powers separation hQ hs omega - hEnum enumFunction enumSelected - have rangeFunction : ZFSet.IsFunc upperQ E0 enumSelector := by - refine ⟨?_, enumFunction.2⟩ - intro z member - obtain ⟨q, hq, e, he, rfl⟩ := ZFSet.mem_prod.1 (enumFunction.1 member) - exact ZFSet.pair_mem_prod.2 ⟨hq, (mem_relationImage _ _ _ e).2 ⟨he, q, hq, member⟩⟩ - have hU := M.preparationWitnessBound_mem pairing unions powers separation - geometry.carrier_ground hT hQ omega - have outputShape : ∀ y ∈ M.preparationWitnessBound b.carrier T upperQ, - ∃ q ∈ upperQ, ∃ payload, y = ZFSet.pair q payload := by - intro y hy - obtain ⟨q, hq, payload, _, equal⟩ := ZFSet.mem_prod.1 hy - exact ⟨q, hq, payload, equal⟩ - obtain ⟨_statesGround, _transitionGround, e, he, chosen, orbit, hOrbit, - orbitFunction, initial, steps⟩ := - M.exists_groundFairPreparationOrbit pairing unions powers separation infinite choice - hQ hs hU hE0 hEnum hPrep rangeFunction enumCases prepFunction outputShape hp - refine ⟨enumSelector, hEnum, enumFunction, enumSelected, E0, hE0, rangeFunction, - prepSelector, hPrep, prepFunction, prepSelected, e, he, chosen, - orbit, hOrbit, orbitFunction, initial, ?_⟩ - intro n hn state next first second - exact (steps n hn state next first second).2 - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticPreparedWitnessSelections +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedAlignedReferenceCollisions +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPrefixPreparationBatches +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralBirthLevelSelectors + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {R : Type u} [PartialOrder R] (c : Presentation R) + +theorem exists_preparationTransition + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history) + (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice rowClosed + let lowerGround := inputs.1 + let maps := inputs.2.2.1 + let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code + ∀ (pUpper : SetMembers upperQ) (row A : ZFSet.{u}) + (_code : SetMembers.raw pUpper = ZFSet.pair row A), + let selected := assignmentOnIndices indices T A + let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected + let bound := M.groundRelations T lower.carrier + let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) + ∀ (_descent : ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) → + H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val), + ∃ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) ∧ + H.GenericFor (formulaFamily (M.nameDomain lower)) ∧ H.mem (restriction pUpper) ∧ + ∃ (validJ : ∀ z ∈ J, IsName lower z) (hJ : J ∈ M.sets), + M.groundEmbeddable J ZFSet.omega ∧ + (∀ z : Name lower, z.val ∈ J → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) z ∧ + Name.eval {q | H.mem q} z ⊆ Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) ∧ + ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), + ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix)) k ∧ + (∀ j F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + j ∈ J ∧ F ∈ M.sets ∧ B ∈ M.sets ∧ f ∈ M.sets ∧ + M.groundEmbeddable B ZFSet.omega ∧ F ⊆ b.carrier ∧ B ⊆ F ∧ + (∀ v ∈ F, ∃ w ∈ B, ZFSet.pair w v ∈ geometry.order) ∧ + ZFSet.IsFunc B (M.niceSupportNameCodes lowerAct lower T d.principalFix) f ∧ + ∀ v ∈ B, ∀ tau ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix, + ZFSet.pair v tau ∈ f → + ZFSet.pair v tau ∈ M.niceSupportRelation lowerAct lower b T d.principalFix) ∧ + k ⊆ M.supportedCertificateFamilyRelation lowerAct lower b T d.principalFix + geometry.order J validJ H ∧ + ∃ q, H.mem q ∧ q ≤ restriction pUpper ∧ + Forces (M.nameDomain lower) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers + separation collection lowerGround geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid (M.omega_mem separation infinite) geometry.order J k + geometry.order_ground hJ hk validJ) q ∧ + ∃ (r : SetMembers upperQ) (newRow newA : ZFSet.{u}), + r ≤ pUpper ∧ restriction r = q ∧ + SetMembers.raw r = ZFSet.pair newRow newA ∧ + ZFSet.pair newRow row ∈ c.conditionOrder ∧ A ⊆ newA ∧ + SetMembers.raw (restriction r) = ZFSet.pair newRow + (assignmentCut (refinementDataHistoryLevels stages packed T) alpha newA) ∧ + H.mem (restriction r) ∧ + Forces (M.nameDomain lower) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers + separation collection lowerGround geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid (M.omega_mem separation infinite) geometry.order J k + geometry.order_ground hJ hk validJ) (restriction r) ∧ + ∃ enumerations ∈ M.sets, + ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix)) enumerations ∧ + enumerations ⊆ M.certificateEnumerationRelation J b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix) k ∧ + (∀ j F B f e names, + ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → + SynchronizedEnumerationCode ZFSet.omega + (M.niceSupportNameCodes lowerAct lower T d.principalFix) B f e names) ∧ + ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F = M.visibleSupportProfile lowerAct lower b d T H (Name.eval {p | H.mem p} z.val) ∧ + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + B.Nonempty ∧ M.DecidesVisibilityProfile lowerAct lower b d.principalFix T F z.val (restriction r) ∧ + (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq (restriction r) z.val tau) ∧ + ∃ e ∈ M.sets, ∃ names ∈ M.sets, + ZFSet.IsFunc ZFSet.omega B e ∧ + ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes lowerAct lower T d.principalFix) names ∧ + (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by + let geometry := run.finalGeometry i₀ + let instGeometryGroup := geometry.group_code.toGroup + let instGeometryOrder := geometry.meet.order.toPartialOrder + let instGeometryBottom := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history alpha hs hh ordinal trace member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + let instLowerHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + let instLowerHistoryTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice rowClosed + let lowerGround := inputs.1 + let maps := inputs.2.2.1 + let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let instUpperHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code + let projection := M.semanticStructuralTrace_completeProjection c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace alpha hAlpha cutOrdinal subset + infinite choice + intro pUpper row A code descent + obtain ⟨H, hp, genericCoded, genericFormula⟩ := + M.exists_coded_ordinary_generic lower small lowerGround (restriction pUpper) + let selected := assignmentOnIndices indices T A + let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected + let bound := M.groundRelations T lower.carrier + let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) + have condition : ZFSet.pair row A ∈ upperQ := code ▸ SetMembers.raw_mem pUpper + obtain ⟨validJ, hJ, smallJ, facts, k, hk, function, selectedCertificates, + q, hq, qp, forced, enumerations, hEnumerations, enumerationFunction, + enumerationRelation, synchronized, entries⟩ := + fulfilled.exists_prefixPreparationBatch c collection infinite choice small smallD irreflexive rowClosed + a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history alpha hs hh ordinal trace member row A condition + H genericCoded genericFormula (descent H genericCoded genericFormula) (restriction pUpper) hp + obtain ⟨r, rp, rq⟩ := projection.lift pUpper q qp + obtain ⟨newRow, _, newA, _, rCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape c.carrier T stages packed (SetMembers.raw_mem r)) + have belowRaw : ZFSet.pair (SetMembers.raw r) (SetMembers.raw pUpper) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed := rp + rw [rCode, code] at belowRaw + have fields := (M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages packed + newRow newA row A).1 belowRaw + have cut := historyRun.restrictionFunction_raw ordinal cutOrdinal subset r newRow newA rCode + refine ⟨H, genericCoded, genericFormula, hp, validJ, hJ, smallJ, facts, k, hk, function, ?_, + selectedCertificates, q, hq, qp, forced, r, newRow, newA, rp, rq, rCode, + fields.2.2.1, fields.2.2.2, cut, rq.symm ▸ hq, rq.symm ▸ forced, + enumerations, hEnumerations, enumerationFunction, enumerationRelation, synchronized, ?_⟩ + · intro j F B f entry + exact M.supportedCertificateFamily_groundData lowerAct lower b T d.principalFix + geometry.order J validJ H j F B f (selectedCertificates entry) + · intro z F B f stored + exact rq.symm ▸ entries z F B f stored + + + + + + +theorem exists_groundPreparationSteps + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history) + (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let fields := M.refinementLevelFormulaData lowerAct lower b d alpha T T2 valid + let levels := refinementDataHistoryLevels stages packed T + let relation := M.storedPreparationRelation upperQ + (M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed) + b.carrier T levels alpha geometry.meetGraph fields + ∀ (_descent : ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) → + H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val), + relation ∈ M.sets ∧ ∃ step ∈ M.sets, + ZFSet.IsFunc upperQ (M.preparationWitnessBound b.carrier T upperQ) step ∧ + step ⊆ relation := by + let geometry := run.finalGeometry i₀ + let instGeometryGroup := geometry.group_code.toGroup + let instGeometryOrder := geometry.meet.order.toPartialOrder + let instGeometryBottom := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history alpha hs hh ordinal trace member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + let instLowerHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + let instLowerHistoryTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice rowClosed + let lowerGround := inputs.1 + let lowerOrder := inputs.2.1 + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let instUpperHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let restriction := historyRun.restriction ordinal cutOrdinal subset c.conditionOrder_code + intro descent + let fields := M.refinementLevelFormulaData lowerAct lower b d alpha T T2 valid + let levels := refinementDataHistoryLevels stages packed T + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.storedPreparationRelation upperQ upperOrder b.carrier T levels alpha geometry.meetGraph fields + have packedGround := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrder + (Fin.cases supports (Fin.cases hT (Fin.cases hT2 + (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have stored := M.semanticStructuralPrefix_refinementData_entry c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + have fieldGround : ∀ j, fields j ∈ M.sets := + M.refinementFormulaDataCode_fields_mem fields (M.pair_right (M.transitive packedGround stored)) + have bounds := M.semanticStructuralPreparationWitness_bounds c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace hAlpha cutOrdinal subset + infinite choice + have upperOrderGround := M.refinementHistoryOrder_mem pairing unions powers separation + carrier rowOrder hT hs packedGround omega + have levelsGround := M.refinementDataHistoryLevels_mem pairing unions powers separation hs packedGround hT + have meetCode : MeetOrderCode (fields 10) (fields 11) geometry.meetGraph := by + change MeetOrderCode b.carrier b.conditionOrder geometry.meetGraph + rw [geometry.decoded_order_eq] + exact geometry.meet + have relationGround : relation ∈ M.sets := M.storedPreparationRelation_mem + pairing unions powers separation bounds.1 upperOrderGround geometry.carrier_ground hT + levelsGround hAlpha geometry.meet_ground omega fields fieldGround meetCode + have total : ∀ input ∈ upperQ, ∃ output ∈ M.preparationWitnessBound b.carrier T upperQ, + ZFSet.pair input output ∈ relation := by + intro input hInput + obtain ⟨row, _, A, _, rfl⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape c.carrier T stages packed hInput) + let pUpper := SetMembers.ofMem (ZFSet.pair row A) hInput + have pCode : SetMembers.raw pUpper = ZFSet.pair row A := SetMembers.raw_ofMem _ _ + let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid + let selected := assignmentOnIndices indices T A + let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected + let bound := M.groundRelations T lower.carrier + let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) + obtain ⟨H, _genericCoded, _genericFormula, _hp, validJ, hJ, _smallJ, _facts, + k, hk, function, _groundData, selectedCertificates, q, _hq, _qp, _forced, + r, newRow, newA, rp, _rq, rCode, _rowBelow, _retained, cut, _hr, _forcedr, + enumerations, hEnumerations, enumerationFunction, _enumerationRelation, synchronized, entries⟩ := + fulfilled.exists_preparationTransition c collection infinite choice small smallD irreflexive rowClosed + a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history alpha hs hh ordinal trace member pUpper row A pCode descent + have prepared := M.preparedCertificateFamilyCode_of_selected lowerAct lower b T d.principalFix + pairing unions powers separation collection lowerGround lowerOrder hT valid (fieldGround 13) + geometry.order geometry.meetGraph J hJ validJ H (restriction r) k enumerations + function selectedCertificates enumerationFunction synchronized (by + intro z F B f entry + have data := entries z F B f entry + exact ⟨data.2.1, data.2.2.1, data.2.2.2.1, data.2.2.2.2.1⟩) + have enlarged := prepared.bounds_mono + (M.supportedEqualityCertificateBound_mono bounds.2.2.2) + (M.synchronizedEnumerationBound_mono bounds.2.2.2) + have witnessBound := M.semanticStructuralPreparationWitness_mem c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace hAlpha cutOrdinal subset + infinite choice A (SetMembers.raw r) k enumerations (SetMembers.raw_mem r) hk hEnumerations + function enumerationFunction + refine ⟨ZFSet.pair (SetMembers.raw r) (ZFSet.pair k enumerations), witnessBound, ?_⟩ + apply (M.pair_mem_storedPreparationRelation upperQ upperOrder b.carrier T levels alpha + geometry.meetGraph fields _ _).2 + refine ⟨hInput, witnessBound, row, A, SetMembers.raw r, k, enumerations, + SetMembers.raw (restriction r), rfl, rfl, ?_, ?_, ?_⟩ + · change ZFSet.pair (SetMembers.raw r) (SetMembers.raw pUpper) ∈ upperOrder at rp + exact pCode ▸ rp + · change ZFSet.pair (SetMembers.raw r) (SetMembers.raw (restriction r)) ∈ + rowAssignmentCutGraph upperQ Q levels alpha + rw [rCode] + exact (pair_mem_rowAssignmentCutGraph upperQ Q levels alpha newRow newA _).2 + ⟨rCode ▸ SetMembers.raw_mem r, SetMembers.raw_mem (restriction r), cut⟩ + · change PreparedCertificateFamilyCode M lower.carrier lower.conditionOrder + (lower.encode (restriction r)) b.carrier b.conditionOrder geometry.meetGraph + (M.groundRelations T lower.carrier) (M.niceVisibilityGraph lowerAct lower b T d.principalFix) + (lower.encode ⊤) ZFSet.omega J + (M.supportedEqualityCertificateBound b.carrier (M.groundRelations T upperQ)) + (M.synchronizedEnumerationBound b.carrier (M.groundRelations T upperQ)) k enumerations + let codeAtOrder := fun orderCode : ZFSet.{u} => + PreparedCertificateFamilyCode M lower.carrier lower.conditionOrder + (lower.encode (restriction r)) b.carrier orderCode geometry.meetGraph + (M.groundRelations T lower.carrier) (M.niceVisibilityGraph lowerAct lower b T d.principalFix) + (lower.encode ⊤) ZFSet.omega J + (M.supportedEqualityCertificateBound b.carrier (M.groundRelations T upperQ)) + (M.synchronizedEnumerationBound b.carrier (M.groundRelations T upperQ)) k enumerations + exact Eq.mpr (congrArg codeAtOrder geometry.decoded_order_eq) enlarged + obtain ⟨step, ground, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice + bounds.1 bounds.2.1 relationGround total + exact ⟨relationGround, step, ground, function, selected⟩ + + + + + + +theorem exists_varyingGroundPreparationSteps + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history), + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T + ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) → + H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val + ), + relation ∈ M.sets ∧ ∃ step ∈ M.sets, + ZFSet.IsFunc (ZFSet.prod stages upperQ) (M.preparationWitnessBound b.carrier T upperQ) step ∧ + step ⊆ relation := by + let geometry := run.finalGeometry i₀ + let instGeometryGroup := geometry.group_code.toGroup + let instGeometryOrder := geometry.meet.order.toPartialOrder + let instGeometryBottom := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history hs hh ordinal trace + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T + intro descent + have packedGround := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrder + (Fin.cases supports (Fin.cases hT (Fin.cases hT2 + (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have upperGround := M.refinementHistoryForcing_mem pairing unions powers separation + carrier hT hs packedGround omega + have upperOrderGround := M.refinementHistoryOrder_mem pairing unions powers separation + carrier rowOrder hT hs packedGround omega + have boundGround := M.preparationWitnessBound_mem pairing unions powers separation + geometry.carrier_ground hT upperGround omega + have inputGround := M.prod_mem pairing unions powers separation hs upperGround + have relationGround : relation ∈ M.sets := M.varyingPreparationRelation_mem + pairing unions powers separation hs packedGround upperGround upperOrderGround + geometry.carrier_ground hT omega + have total : ∀ input ∈ ZFSet.prod stages upperQ, + ∃ output ∈ M.preparationWitnessBound b.carrier T upperQ, + ZFSet.pair input output ∈ relation := by + intro input hInput + obtain ⟨alpha, member, p, hp, rfl⟩ := ZFSet.mem_prod.1 hInput + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + let instLowerHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + let instLowerHistoryTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let fields := M.refinementLevelFormulaData lowerAct lower b d alpha T T2 valid + obtain ⟨_fixedGround, fixedStep, _stepGround, function, selected⟩ := + fulfilled.exists_groundPreparationSteps c collection infinite choice small smallD irreflexive rowClosed + a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history alpha hs hh ordinal trace member (descent alpha member) + obtain ⟨y, entry, _unique⟩ := function.2 p hp + have hy := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + have stored := M.semanticStructuralPrefix_refinementData_entry c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction geometry.actors_ground + geometry.carrier_ground nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + have meetCode : MeetOrderCode (fields 10) (fields 11) geometry.meetGraph := by + change MeetOrderCode b.carrier b.conditionOrder geometry.meetGraph + rw [geometry.decoded_order_eq] + exact geometry.meet + exact ⟨y, hy, M.varyingPreparationRelation_of_stored stages packed upperQ upperOrder b.carrier T + alpha p y geometry.meetGraph fields member stored rfl rfl meetCode (selected entry)⟩ + obtain ⟨step, ground, function, selected⟩ := M.uniformize_relation pairing unions powers separation + choice inputGround boundGround relationGround total + exact ⟨relationGround, step, ground, function, selected⟩ + + + + + + +theorem exists_groundFairPreparationOrbit + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history), + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T + ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) → + H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val + ), + ∀ p ∈ upperQ, + ∃ enumSelector ∈ M.sets, + ZFSet.IsFunc upperQ (M.groundRelations ZFSet.omega stages) enumSelector ∧ + enumSelector ⊆ M.birthLevelEnumerationRelation upperQ stages + (refinementDataHistoryLevels stages packed T) ∧ + ∃ E0 ∈ M.sets, ZFSet.IsFunc upperQ E0 enumSelector ∧ + ∃ prepSelector ∈ M.sets, + ZFSet.IsFunc (ZFSet.prod stages upperQ) + (M.preparationWitnessBound b.carrier T upperQ) prepSelector ∧ + prepSelector ⊆ relation ∧ + ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ ∃ orbit ∈ M.sets, + ZFSet.IsFunc ZFSet.omega + (M.fairPreparationStates upperQ stages (M.preparationWitnessBound b.carrier T upperQ) + E0 enumSelector) orbit ∧ + (∀ state, ZFSet.pair ∅ state ∈ orbit ↔ + state = ZFSet.pair ∅ (ZFSet.pair p (ZFSet.pair {ZFSet.pair ∅ e} ∅))) ∧ + ∀ n ∈ ZFSet.omega, ∀ state next, + ZFSet.pair n state ∈ orbit → ZFSet.pair (insert n n) next ∈ orbit → + FairPreparationStepCode ZFSet.omega E0 stages (M.preparationWitnessBound b.carrier T upperQ) + enumSelector prepSelector + (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) + state next := by + let geometry := run.finalGeometry i₀ + let instGeometryGroup := geometry.group_code.toGroup + let instGeometryOrder := geometry.meet.order.toPartialOrder + let instGeometryBottom := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history hs hh ordinal trace + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T + intro descent p hp + obtain ⟨_relationGround, prepSelector, hPrep, prepFunction, prepSelected⟩ := + fulfilled.exists_varyingGroundPreparationSteps c collection infinite choice small smallD + irreflexive rowClosed a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 + closed1 closed2 children1 children2 topMem topRows stages history hs hh ordinal trace descent + obtain ⟨hQ, _enumBoundGround, _birthRelationGround, enumSelector, hEnum, + enumFunction, enumSelected, _birthCodes⟩ := + M.structuralForcingTrace_birthLevelEnumerations c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 pairing unions powers separation collection + infinite choice carrier geometry.actors_ground geometry.carrier_ground nodeOrder supports + hT hT2 hs hh ordinal trace + let E0 := relationImage upperQ (M.groundRelations ZFSet.omega stages) enumSelector + obtain ⟨hE0, _rangeBound, enumCases, _rangeEntries⟩ := + M.birthEnumerationRange_spec pairing unions powers separation hQ hs omega + hEnum enumFunction enumSelected + have rangeFunction : ZFSet.IsFunc upperQ E0 enumSelector := by + refine ⟨?_, enumFunction.2⟩ + intro z member + obtain ⟨q, hq, e, he, rfl⟩ := ZFSet.mem_prod.1 (enumFunction.1 member) + exact ZFSet.pair_mem_prod.2 ⟨hq, (mem_relationImage _ _ _ e).2 ⟨he, q, hq, member⟩⟩ + have hU := M.preparationWitnessBound_mem pairing unions powers separation + geometry.carrier_ground hT hQ omega + have outputShape : ∀ y ∈ M.preparationWitnessBound b.carrier T upperQ, + ∃ q ∈ upperQ, ∃ payload, y = ZFSet.pair q payload := by + intro y hy + obtain ⟨q, hq, payload, _, equal⟩ := ZFSet.mem_prod.1 hy + exact ⟨q, hq, payload, equal⟩ + obtain ⟨_statesGround, _transitionGround, e, he, chosen, orbit, hOrbit, + orbitFunction, initial, steps⟩ := + M.exists_groundFairPreparationOrbit pairing unions powers separation infinite choice + hQ hs hU hE0 hEnum hPrep rangeFunction enumCases prepFunction outputShape hp + refine ⟨enumSelector, hEnum, enumFunction, enumSelected, E0, hE0, rangeFunction, + prepSelector, hPrep, prepFunction, prepSelected, e, he, chosen, + orbit, hOrbit, orbitFunction, initial, ?_⟩ + intro n hn state next first second + exact (steps n hn state next first second).2 + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFulfillmentConstruction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFulfillmentConstruction.lean index f8f74ce7f1e619f7f716fc68edb9df42dfb4a063..2c96d78c1c8ab8bc2f7a8d6d48a06750214082b5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFulfillmentConstruction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalFulfillmentConstruction.lean @@ -1,256 +1,256 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainOrdinalConstructionData -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFinalDirectedness -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFinalInsertion - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] - -structure FinalFulfillment - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (level : GroundMainCandidateLevel M K) (i₀ : I) where - chronology : run.FinalChronology level - countable_localization : ∀ X ∈ M.sets, X ⊆ (run.finalGeometry i₀).carrier → - M.groundEmbeddable X ZFSet.omega → - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ - ∃ b ∈ (run.finalGeometry i₀).carrier, - ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order - growth : ∀ x ∈ (run.finalGeometry i₀).carrier, ∃ y ∈ (run.finalGeometry i₀).carrier, - ZFSet.pair x y ∈ (run.finalGeometry i₀).order ∧ - ¬ ZFSet.pair y x ∈ (run.finalGeometry i₀).order - directed : ∀ x ∈ (run.finalGeometry i₀).carrier, ∀ y ∈ (run.finalGeometry i₀).carrier, - ∃ z ∈ (run.finalGeometry i₀).carrier, ZFSet.pair x z ∈ (run.finalGeometry i₀).order ∧ - ZFSet.pair y z ∈ (run.finalGeometry i₀).order - separates : ∀ W ∈ (run.finalGeometry i₀).carrier, ∀ d ∈ (run.finalGeometry i₀).carrier, - ∀ x ∈ (run.finalGeometry i₀).carrier, - ZFSet.pair W d ∈ (run.finalGeometry i₀).order → - ZFSet.pair W x ∈ (run.finalGeometry i₀).order → - ∃ k ∈ (run.finalGeometry i₀).actors, - (∀ z ∈ (run.finalGeometry i₀).carrier, ZFSet.pair z W ∈ (run.finalGeometry i₀).order → - ZFSet.pair (ZFSet.pair k z) z ∈ (run.finalGeometry i₀).action) ∧ - ∃ y ∈ (run.finalGeometry i₀).carrier, - ZFSet.pair (ZFSet.pair k d) y ∈ (run.finalGeometry i₀).action ∧ - ZFSet.pair (ZFSet.pair y x) W ∈ (run.finalGeometry i₀).meetGraph - rectangles : ∀ c b d g h X, - ExternalRectangleCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c b d g h → X ∈ (run.finalGeometry i₀).carrier → - (∀ y ∈ (run.finalGeometry i₀).carrier, - ZFSet.pair (ZFSet.pair g d) y ∈ (run.finalGeometry i₀).action → - ZFSet.pair y X ∈ (run.finalGeometry i₀).order) → - (∀ y ∈ (run.finalGeometry i₀).carrier, - ZFSet.pair (ZFSet.pair h d) y ∈ (run.finalGeometry i₀).action → - ZFSet.pair y X ∈ (run.finalGeometry i₀).order) → - ∃ k ∈ (run.finalGeometry i₀).actors, ∃ l ∈ (run.finalGeometry i₀).actors, - RectangleAtBoundCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action c b d g h X k l - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainOrdinalConstructionData -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable (data : GroundMainOrdinalConstructionData M K C pairing unions powers separation) - -theorem exists_rankedTerminal - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (columns : C = M.groundOmegaOne pairing unions powers separation collection infinite) : - ∃ ordinalC : ordinalSetProperty C, - letI := ordinalMainIndexPreorder ordinalC - ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) - (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), - run.indices = C ∧ run.PreservesOldProfiles ∧ - MainPrefixHistoryUnionCode data.history run.code ∧ - MainPrefixHistoryExtends data.history run.code ∧ - (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ - GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ - run.code ∈ data.level.preservedMainPrefixes C C (rationalCarrier data.seed.fractionCode) - (rationalLtGraph data.seed.fractionCode) ∧ - ∃ i₀ : SetMembers C, run.key i₀ = ∅ := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have hC : C ∈ M.sets := columns.symm ▸ spec.1 - have ordinal : ordinalSetProperty C := columns.symm ▸ spec.2.1 - have candidates : ∀ q ∈ data.domain, PreservedMainPrefixCode M K C C - (rationalCarrier data.seed.fractionCode) (rationalLtGraph data.seed.fractionCode) q := by - intro q member - rw [data.domain_eq] at member - exact (data.level.mem_preservedMainPrefixes.1 (data.level.mem_recursionPrefixes.1 member).1).2 - obtain ⟨ordinalC, run, indices, profiles, terminal, extension, unique⟩ := - data.trace.exists_groundTerminalPrefix pairing unions powers separation hC ordinal data.history_ground candidates - let := ordinalMainIndexPreorder ordinalC - obtain ⟨small, _, rank, candidate⟩ := - data.trace.groundOmegaOne_terminalCode_ranked_candidate pairing unions powers separation collection infinite - hK standard columns data.history_ground data.level data.domain_eq terminal - have zero : ∅ ∈ C := by - rw [columns] - exact (spec.2.2.1 ∅).2 - ⟨M.empty_mem ⟨_, spec.1⟩, ordinalSetProperty_empty, - M.empty_groundEmbeddable ZFSet.omega ⟨_, spec.1⟩⟩ - have zeroIndex : ∅ ∈ run.indices := indices.symm ▸ zero - obtain ⟨i₀, key⟩ := ZFSet.mem_range.1 zeroIndex - exact ⟨ordinalC, run, indices, profiles, terminal, extension, unique, - indices.symm ▸ small, rank, candidate, i₀, key⟩ - -end PartitionPilot.Forcing.GroundMainOrdinalConstructionData - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundMainFinalGeometry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ data : GroundMainOrdinalConstructionData M K C pairing unions powers separation, - ∃ ordinalC : ordinalSetProperty C, - letI := ordinalMainIndexPreorder ordinalC - ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) - (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), - run.indices = C ∧ run.PreservesOldProfiles ∧ - MainPrefixHistoryUnionCode data.history run.code ∧ - MainPrefixHistoryExtends data.history run.code ∧ - (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ - GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ - ∃ i₀ : SetMembers C, run.key i₀ = ∅ ∧ - let geometry := run.finalGeometry i₀ - let inclusions := run.finalInclusions i₀ - geometry.code ∈ M.sets ∧ ZFSet.rank geometry.code < ZFSet.rank K ∧ - GroundBelow M geometry.carrier K ∧ GroundBelow M geometry.actors K ∧ - inclusions.pointFamily ∈ M.sets ∧ inclusions.actorFamily ∈ M.sets ∧ - ZFSet.rank inclusions.pointFamily < ZFSet.rank K ∧ - ZFSet.rank inclusions.actorFamily < ZFSet.rank K ∧ - (∀ X ∈ M.sets, X ⊆ geometry.carrier → M.groundEmbeddable X ZFSet.omega → - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ inclusions.pointMap j) ∧ - ∃ b ∈ geometry.carrier, ∀ x ∈ X, ZFSet.pair x b ∈ geometry.order) ∧ - ∀ x ∈ geometry.carrier, ∃ y ∈ geometry.carrier, - ZFSet.pair x y ∈ geometry.order ∧ ¬ ZFSet.pair y x ∈ geometry.order := by - dsimp only - obtain ⟨data⟩ := M.exists_groundMainOrdinalData pairing unions powers separation - collection infinite choice hK standard - obtain ⟨ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, _, i₀, zero⟩ := - data.exists_rankedTerminal collection infinite hK standard rfl - let := ordinalMainIndexPreorder ordinalC - have limit := (standard.to_conditions pairing unions powers separation hK).rank_isLimit - pairing unions powers separation infinite hK - have sizes := run.finalGeometry_below i₀ choice hK standard small - have maps := run.finalInclusions_rank_lt i₀ limit rank - refine ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, - i₀, zero, (run.finalGeometry i₀).code_ground pairing, - run.finalGeometry_code_rank_lt i₀ limit rank, sizes.1, sizes.2, - (run.finalInclusions i₀).pointFamily_ground, (run.finalInclusions i₀).actorFamily_ground, - maps.1, maps.2.1, ?_, ?_⟩ - · intro X hX subset countable - have localized := run.exists_countablePointLocalization collection infinite choice indices hX subset countable - obtain ⟨_, b, _, hb, _, bound⟩ := - run.exists_countablePointUpperBound collection infinite choice indices hX subset countable - exact ⟨localized, b, hb, bound⟩ - · intro x member - exact run.limitPoints_strict_extension_of_trace collection infinite data.trace - (fun old next entry => (data.steps_entries old next entry).2) - (fun source target z entry => (data.successors_entries source target z entry).2.2) - indices extension member - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundMainFinalFulfillment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ data : GroundMainOrdinalConstructionData M K C pairing unions powers separation, - ∃ ordinalC : ordinalSetProperty C, - letI := ordinalMainIndexPreorder ordinalC - ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) - (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), - run.indices = C ∧ run.PreservesOldProfiles ∧ - MainPrefixHistoryUnionCode data.history run.code ∧ - MainPrefixHistoryExtends data.history run.code ∧ - (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ - GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ - ∃ i₀ : SetMembers C, run.key i₀ = ∅ ∧ - ∃ fulfilled : run.FinalFulfillment data.level i₀, - let geometry := run.finalGeometry i₀ - let inclusions := run.finalInclusions i₀ - geometry.code ∈ M.sets ∧ ZFSet.rank geometry.code < ZFSet.rank K ∧ - GroundBelow M geometry.carrier K ∧ GroundBelow M geometry.actors K ∧ - inclusions.pointFamily ∈ M.sets ∧ inclusions.actorFamily ∈ M.sets ∧ - ZFSet.rank inclusions.pointFamily < ZFSet.rank K ∧ - ZFSet.rank inclusions.actorFamily < ZFSet.rank K ∧ - fulfilled.chronology.serial.code ∈ M.sets ∧ - ∀ N : TransitiveGround.{u}, M.sets ⊆ N.sets → - Realize N.sets SetFormula.pairing Fin.elim0 → - Realize N.sets SetFormula.union Fin.elim0 → - Realize N.sets powerSet Fin.elim0 → SeparationSchema N.sets → - Realize N.sets infinity Fin.elim0 → Realize N.sets SetFormula.choice Fin.elim0 → - ∀ F ∈ N.sets, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F → - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ geometry.order := by - dsimp only - obtain ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, - i₀, zero, codeGround, codeRank, pointSmall, actorSmall, pointMaps, actorMaps, - pointRank, actorRank, localized, growth⟩ := - M.exists_groundMainFinalGeometry pairing unions powers separation collection infinite choice hK standard - let := ordinalMainIndexPreorder ordinalC - obtain ⟨chronology⟩ := run.exists_finalChronology collection infinite choice hK standard - small rank data.level - have chosen := fun old next entry => (data.steps_entries old next entry).2 - have tasks := fun source target z entry => (data.successors_entries source target z entry).2.2 - let fulfilled : run.FinalFulfillment data.level i₀ := { - chronology := chronology - countable_localization := localized - growth := growth - directed := fun _ hx _ hy => run.limitPoints_directed hx hy - separates := fun _ hW _ hd _ hx wd wx => - run.limitPoints_separation_of_trace collection infinite data.trace chosen tasks - indices extension hW hd hx wd wx - rectangles := fun _ _ _ _ _ _ rectangle hX firstUpper secondUpper => - run.final_rectangle_at_bound_of_trace collection infinite data.trace chosen tasks - indices extension rectangle hX firstUpper secondUpper } - refine ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, - i₀, zero, fulfilled, codeGround, codeRank, pointSmall, actorSmall, pointMaps, - actorMaps, pointRank, actorRank, chronology.code_ground, ?_⟩ - intro N includes pairingN unionsN powersN separationN infiniteN choiceN F hF filter - exact chronology.exists_extension_basis i₀ includes pairingN unionsN powersN separationN infiniteN - choiceN ⟨data.seed.coordinateInjection, data.seed.injection_ground, data.seed.injection_code⟩ - data.seed.dense.irrefl hF filter - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainOrdinalConstructionData +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFinalDirectedness +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFinalInsertion + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] + +structure FinalFulfillment + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (level : GroundMainCandidateLevel M K) (i₀ : I) where + chronology : run.FinalChronology level + countable_localization : ∀ X ∈ M.sets, X ⊆ (run.finalGeometry i₀).carrier → + M.groundEmbeddable X ZFSet.omega → + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ + ∃ b ∈ (run.finalGeometry i₀).carrier, + ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order + growth : ∀ x ∈ (run.finalGeometry i₀).carrier, ∃ y ∈ (run.finalGeometry i₀).carrier, + ZFSet.pair x y ∈ (run.finalGeometry i₀).order ∧ + ¬ ZFSet.pair y x ∈ (run.finalGeometry i₀).order + directed : ∀ x ∈ (run.finalGeometry i₀).carrier, ∀ y ∈ (run.finalGeometry i₀).carrier, + ∃ z ∈ (run.finalGeometry i₀).carrier, ZFSet.pair x z ∈ (run.finalGeometry i₀).order ∧ + ZFSet.pair y z ∈ (run.finalGeometry i₀).order + separates : ∀ W ∈ (run.finalGeometry i₀).carrier, ∀ d ∈ (run.finalGeometry i₀).carrier, + ∀ x ∈ (run.finalGeometry i₀).carrier, + ZFSet.pair W d ∈ (run.finalGeometry i₀).order → + ZFSet.pair W x ∈ (run.finalGeometry i₀).order → + ∃ k ∈ (run.finalGeometry i₀).actors, + (∀ z ∈ (run.finalGeometry i₀).carrier, ZFSet.pair z W ∈ (run.finalGeometry i₀).order → + ZFSet.pair (ZFSet.pair k z) z ∈ (run.finalGeometry i₀).action) ∧ + ∃ y ∈ (run.finalGeometry i₀).carrier, + ZFSet.pair (ZFSet.pair k d) y ∈ (run.finalGeometry i₀).action ∧ + ZFSet.pair (ZFSet.pair y x) W ∈ (run.finalGeometry i₀).meetGraph + rectangles : ∀ c b d g h X, + ExternalRectangleCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c b d g h → X ∈ (run.finalGeometry i₀).carrier → + (∀ y ∈ (run.finalGeometry i₀).carrier, + ZFSet.pair (ZFSet.pair g d) y ∈ (run.finalGeometry i₀).action → + ZFSet.pair y X ∈ (run.finalGeometry i₀).order) → + (∀ y ∈ (run.finalGeometry i₀).carrier, + ZFSet.pair (ZFSet.pair h d) y ∈ (run.finalGeometry i₀).action → + ZFSet.pair y X ∈ (run.finalGeometry i₀).order) → + ∃ k ∈ (run.finalGeometry i₀).actors, ∃ l ∈ (run.finalGeometry i₀).actors, + RectangleAtBoundCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action c b d g h X k l + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainOrdinalConstructionData +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable (data : GroundMainOrdinalConstructionData M K C pairing unions powers separation) + +theorem exists_rankedTerminal + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (columns : C = M.groundOmegaOne pairing unions powers separation collection infinite) : + ∃ ordinalC : ordinalSetProperty C, + letI := ordinalMainIndexPreorder ordinalC + ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) + (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), + run.indices = C ∧ run.PreservesOldProfiles ∧ + MainPrefixHistoryUnionCode data.history run.code ∧ + MainPrefixHistoryExtends data.history run.code ∧ + (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ + GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ + run.code ∈ data.level.preservedMainPrefixes C C (rationalCarrier data.seed.fractionCode) + (rationalLtGraph data.seed.fractionCode) ∧ + ∃ i₀ : SetMembers C, run.key i₀ = ∅ := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have hC : C ∈ M.sets := columns.symm ▸ spec.1 + have ordinal : ordinalSetProperty C := columns.symm ▸ spec.2.1 + have candidates : ∀ q ∈ data.domain, PreservedMainPrefixCode M K C C + (rationalCarrier data.seed.fractionCode) (rationalLtGraph data.seed.fractionCode) q := by + intro q member + rw [data.domain_eq] at member + exact (data.level.mem_preservedMainPrefixes.1 (data.level.mem_recursionPrefixes.1 member).1).2 + obtain ⟨ordinalC, run, indices, profiles, terminal, extension, unique⟩ := + data.trace.exists_groundTerminalPrefix pairing unions powers separation hC ordinal data.history_ground candidates + let := ordinalMainIndexPreorder ordinalC + obtain ⟨small, _, rank, candidate⟩ := + data.trace.groundOmegaOne_terminalCode_ranked_candidate pairing unions powers separation collection infinite + hK standard columns data.history_ground data.level data.domain_eq terminal + have zero : ∅ ∈ C := by + rw [columns] + exact (spec.2.2.1 ∅).2 + ⟨M.empty_mem ⟨_, spec.1⟩, ordinalSetProperty_empty, + M.empty_groundEmbeddable ZFSet.omega ⟨_, spec.1⟩⟩ + have zeroIndex : ∅ ∈ run.indices := indices.symm ▸ zero + obtain ⟨i₀, key⟩ := ZFSet.mem_range.1 zeroIndex + exact ⟨ordinalC, run, indices, profiles, terminal, extension, unique, + indices.symm ▸ small, rank, candidate, i₀, key⟩ + +end PartitionPilot.Forcing.GroundMainOrdinalConstructionData + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundMainFinalGeometry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ data : GroundMainOrdinalConstructionData M K C pairing unions powers separation, + ∃ ordinalC : ordinalSetProperty C, + letI := ordinalMainIndexPreorder ordinalC + ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) + (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), + run.indices = C ∧ run.PreservesOldProfiles ∧ + MainPrefixHistoryUnionCode data.history run.code ∧ + MainPrefixHistoryExtends data.history run.code ∧ + (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ + GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ + ∃ i₀ : SetMembers C, run.key i₀ = ∅ ∧ + let geometry := run.finalGeometry i₀ + let inclusions := run.finalInclusions i₀ + geometry.code ∈ M.sets ∧ ZFSet.rank geometry.code < ZFSet.rank K ∧ + GroundBelow M geometry.carrier K ∧ GroundBelow M geometry.actors K ∧ + inclusions.pointFamily ∈ M.sets ∧ inclusions.actorFamily ∈ M.sets ∧ + ZFSet.rank inclusions.pointFamily < ZFSet.rank K ∧ + ZFSet.rank inclusions.actorFamily < ZFSet.rank K ∧ + (∀ X ∈ M.sets, X ⊆ geometry.carrier → M.groundEmbeddable X ZFSet.omega → + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ inclusions.pointMap j) ∧ + ∃ b ∈ geometry.carrier, ∀ x ∈ X, ZFSet.pair x b ∈ geometry.order) ∧ + ∀ x ∈ geometry.carrier, ∃ y ∈ geometry.carrier, + ZFSet.pair x y ∈ geometry.order ∧ ¬ ZFSet.pair y x ∈ geometry.order := by + dsimp only + obtain ⟨data⟩ := M.exists_groundMainOrdinalData pairing unions powers separation + collection infinite choice hK standard + obtain ⟨ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, _, i₀, zero⟩ := + data.exists_rankedTerminal collection infinite hK standard rfl + let := ordinalMainIndexPreorder ordinalC + have limit := (standard.to_conditions pairing unions powers separation hK).rank_isLimit + pairing unions powers separation infinite hK + have sizes := run.finalGeometry_below i₀ choice hK standard small + have maps := run.finalInclusions_rank_lt i₀ limit rank + refine ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, + i₀, zero, (run.finalGeometry i₀).code_ground pairing, + run.finalGeometry_code_rank_lt i₀ limit rank, sizes.1, sizes.2, + (run.finalInclusions i₀).pointFamily_ground, (run.finalInclusions i₀).actorFamily_ground, + maps.1, maps.2.1, ?_, ?_⟩ + · intro X hX subset countable + have localized := run.exists_countablePointLocalization collection infinite choice indices hX subset countable + obtain ⟨_, b, _, hb, _, bound⟩ := + run.exists_countablePointUpperBound collection infinite choice indices hX subset countable + exact ⟨localized, b, hb, bound⟩ + · intro x member + exact run.limitPoints_strict_extension_of_trace collection infinite data.trace + (fun old next entry => (data.steps_entries old next entry).2) + (fun source target z entry => (data.successors_entries source target z entry).2.2) + indices extension member + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundMainFinalFulfillment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ data : GroundMainOrdinalConstructionData M K C pairing unions powers separation, + ∃ ordinalC : ordinalSetProperty C, + letI := ordinalMainIndexPreorder ordinalC + ∃ run : GroundMainPrefix M K C C (rationalCarrier data.seed.fractionCode) + (rationalLtGraph data.seed.fractionCode) pairing unions powers separation (SetMembers C), + run.indices = C ∧ run.PreservesOldProfiles ∧ + MainPrefixHistoryUnionCode data.history run.code ∧ + MainPrefixHistoryExtends data.history run.code ∧ + (∀ q, MainPrefixHistoryUnionCode data.history q → q = run.code) ∧ + GroundBelow M run.indices K ∧ ZFSet.rank run.code < ZFSet.rank K ∧ + ∃ i₀ : SetMembers C, run.key i₀ = ∅ ∧ + ∃ fulfilled : run.FinalFulfillment data.level i₀, + let geometry := run.finalGeometry i₀ + let inclusions := run.finalInclusions i₀ + geometry.code ∈ M.sets ∧ ZFSet.rank geometry.code < ZFSet.rank K ∧ + GroundBelow M geometry.carrier K ∧ GroundBelow M geometry.actors K ∧ + inclusions.pointFamily ∈ M.sets ∧ inclusions.actorFamily ∈ M.sets ∧ + ZFSet.rank inclusions.pointFamily < ZFSet.rank K ∧ + ZFSet.rank inclusions.actorFamily < ZFSet.rank K ∧ + fulfilled.chronology.serial.code ∈ M.sets ∧ + ∀ N : TransitiveGround.{u}, M.sets ⊆ N.sets → + Realize N.sets SetFormula.pairing Fin.elim0 → + Realize N.sets SetFormula.union Fin.elim0 → + Realize N.sets powerSet Fin.elim0 → SeparationSchema N.sets → + Realize N.sets infinity Fin.elim0 → Realize N.sets SetFormula.choice Fin.elim0 → + ∀ F ∈ N.sets, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F → + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ geometry.order := by + dsimp only + obtain ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, + i₀, zero, codeGround, codeRank, pointSmall, actorSmall, pointMaps, actorMaps, + pointRank, actorRank, localized, growth⟩ := + M.exists_groundMainFinalGeometry pairing unions powers separation collection infinite choice hK standard + let := ordinalMainIndexPreorder ordinalC + obtain ⟨chronology⟩ := run.exists_finalChronology collection infinite choice hK standard + small rank data.level + have chosen := fun old next entry => (data.steps_entries old next entry).2 + have tasks := fun source target z entry => (data.successors_entries source target z entry).2.2 + let fulfilled : run.FinalFulfillment data.level i₀ := { + chronology := chronology + countable_localization := localized + growth := growth + directed := fun _ hx _ hy => run.limitPoints_directed hx hy + separates := fun _ hW _ hd _ hx wd wx => + run.limitPoints_separation_of_trace collection infinite data.trace chosen tasks + indices extension hW hd hx wd wx + rectangles := fun _ _ _ _ _ _ rectangle hX firstUpper secondUpper => + run.final_rectangle_at_bound_of_trace collection infinite data.trace chosen tasks + indices extension rectangle hX firstUpper secondUpper } + refine ⟨data, ordinalC, run, indices, profiles, terminal, extension, unique, small, rank, + i₀, zero, fulfilled, codeGround, codeRank, pointSmall, actorSmall, pointMaps, + actorMaps, pointRank, actorRank, chronology.code_ground, ?_⟩ + intro N includes pairingN unionsN powersN separationN infiniteN choiceN F hF filter + exact chronology.exists_extension_basis i₀ includes pairingN unionsN powersN separationN infiniteN + choiceN ⟨data.seed.coordinateInjection, data.seed.injection_ground, data.seed.injection_code⟩ + data.seed.dense.irrefl hF filter + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalOrdinaryInsertion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalOrdinaryInsertion.lean index c695c615bd1bd77deb4701b06df7efc84ab2060c..20d5f3d2a260f592cca8e0a9b52a4ed1de4666cd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalOrdinaryInsertion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalOrdinaryInsertion.lean @@ -1,183 +1,183 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSupportConstruction - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula -universe u v -variable {M N : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable (reflection : GroundSequenceReflection M N (run.finalGeometry i₀).carrier) -include fulfilled reflection - -theorem reflected_extension_basis - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (includes : M.sets ⊆ N.sets) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets infinity Fin.elim0) - (choiceN : Realize N.sets SetFormula.choice Fin.elim0) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {F : ZFSet.{u}} (hF : F ∈ N.sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) : - ∃ B ∈ M.sets, B ∈ N.sets ∧ M.groundEmbeddable B ZFSet.omega ∧ B ⊆ F ∧ - (∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ (run.finalGeometry i₀).order) ∧ - M.generatedMeetFilter (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph B = F ∧ F ∈ M.sets := by - obtain ⟨B, hB, f, hf, injection, subset, coinitial⟩ := - fulfilled.chronology.exists_extension_basis i₀ includes pairingN unionsN powersN separationN - infiniteN choiceN smallD irreflexive hF filter - obtain ⟨ground, countable, equal, filterGround⟩ := reflection.coinitial_filter - pairing unions powers separation infinite choice pairingN unionsN powersN separationN infiniteN - (run.finalGeometry i₀).carrier_ground (run.finalGeometry i₀).order_ground - (run.finalGeometry i₀).meet_ground (run.finalGeometry i₀).meet hB ⟨f, hf, injection⟩ - filter subset coinitial - exact ⟨B, ground, hB, countable, subset, coinitial, equal, filterGround⟩ - -theorem extension_insertion - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (includes : M.sets ⊆ N.sets) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets infinity Fin.elim0) - (choiceN : Realize N.sets SetFormula.choice Fin.elim0) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {c e d F : ZFSet.{u}} - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ N.sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : - F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - caps ∈ N.sets ∧ actors ∈ N.sets ∧ - FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c e d F caps actors := by - obtain ⟨_, _, _, _, _, _, _, ground⟩ := fulfilled.reflected_extension_basis reflection - infinite choice includes pairingN unionsN powersN separationN infiniteN choiceN smallD irreflexive hF filter - obtain ⟨caps, hCaps, actors, hActors, family⟩ := - fulfilled.insertion c hc e he d hd F ground filter lower strict bound above - exact ⟨ground, caps, hCaps, actors, hActors, includes hCaps, includes hActors, family⟩ - -theorem extension_countable_localization - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets infinity Fin.elim0) - {X : ZFSet.{u}} (hX : X ∈ N.sets) (subset : X ⊆ (run.finalGeometry i₀).carrier) - (small : N.groundEmbeddable X ZFSet.omega) : - X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ - ∃ b ∈ (run.finalGeometry i₀).carrier, - ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by - obtain ⟨ground, countable⟩ := reflection.countable_subset pairing unions powers separation infinite choice - pairingN unionsN powersN separationN infiniteN (run.finalGeometry i₀).carrier_ground hX subset small - have localized := fulfilled.countable_localization X ground subset countable - exact ⟨ground, countable, localized.1, localized.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {Q : Type u} [Preorder Q] [OrderTop Q] (s : Presentation Q) -include fulfilled - -theorem ordinary_extension_insertion - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (pairingN : Realize (M.ordinaryExtension s H).sets SetFormula.pairing Fin.elim0) - (unionsN : Realize (M.ordinaryExtension s H).sets SetFormula.union Fin.elim0) - (powersN : Realize (M.ordinaryExtension s H).sets powerSet Fin.elim0) - (separationN : SeparationSchema (M.ordinaryExtension s H).sets) - (infiniteN : Realize (M.ordinaryExtension s H).sets infinity Fin.elim0) - (choiceN : Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {c e d F : ZFSet.{u}} - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.ordinaryExtension s H).sets) - (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order - (run.finalGeometry i₀).meetGraph F) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : - F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - caps ∈ (M.ordinaryExtension s H).sets ∧ actors ∈ (M.ordinaryExtension s H).sets ∧ - FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action - c e d F caps actors := by - have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation - collection infinite choice carrier order small (run.finalGeometry i₀).carrier_ground - closed H genericCoded genericFormula - have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H - exact fulfilled.extension_insertion reflection infinite choice includes pairingN unionsN powersN - separationN infiniteN choiceN smallD irreflexive hc he hd hF filter lower strict bound above - -theorem ordinary_extension_countable_localization - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (pairingN : Realize (M.ordinaryExtension s H).sets SetFormula.pairing Fin.elim0) - (unionsN : Realize (M.ordinaryExtension s H).sets SetFormula.union Fin.elim0) - (powersN : Realize (M.ordinaryExtension s H).sets powerSet Fin.elim0) - (separationN : SeparationSchema (M.ordinaryExtension s H).sets) - (infiniteN : Realize (M.ordinaryExtension s H).sets infinity Fin.elim0) - {X : ZFSet.{u}} (hX : X ∈ (M.ordinaryExtension s H).sets) - (subset : X ⊆ (run.finalGeometry i₀).carrier) - (countable : (M.ordinaryExtension s H).groundEmbeddable X ZFSet.omega) : - X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ - (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ - ∃ b ∈ (run.finalGeometry i₀).carrier, - ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by - have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation - collection infinite choice carrier order small (run.finalGeometry i₀).carrier_ground - closed H genericCoded genericFormula - exact fulfilled.extension_countable_localization reflection infinite choice - pairingN unionsN powersN separationN infiniteN hX subset countable - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSupportConstruction + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula +universe u v +variable {M N : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable (reflection : GroundSequenceReflection M N (run.finalGeometry i₀).carrier) +include fulfilled reflection + +theorem reflected_extension_basis + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (includes : M.sets ⊆ N.sets) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets infinity Fin.elim0) + (choiceN : Realize N.sets SetFormula.choice Fin.elim0) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {F : ZFSet.{u}} (hF : F ∈ N.sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) : + ∃ B ∈ M.sets, B ∈ N.sets ∧ M.groundEmbeddable B ZFSet.omega ∧ B ⊆ F ∧ + (∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ (run.finalGeometry i₀).order) ∧ + M.generatedMeetFilter (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph B = F ∧ F ∈ M.sets := by + obtain ⟨B, hB, f, hf, injection, subset, coinitial⟩ := + fulfilled.chronology.exists_extension_basis i₀ includes pairingN unionsN powersN separationN + infiniteN choiceN smallD irreflexive hF filter + obtain ⟨ground, countable, equal, filterGround⟩ := reflection.coinitial_filter + pairing unions powers separation infinite choice pairingN unionsN powersN separationN infiniteN + (run.finalGeometry i₀).carrier_ground (run.finalGeometry i₀).order_ground + (run.finalGeometry i₀).meet_ground (run.finalGeometry i₀).meet hB ⟨f, hf, injection⟩ + filter subset coinitial + exact ⟨B, ground, hB, countable, subset, coinitial, equal, filterGround⟩ + +theorem extension_insertion + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (includes : M.sets ⊆ N.sets) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets infinity Fin.elim0) + (choiceN : Realize N.sets SetFormula.choice Fin.elim0) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {c e d F : ZFSet.{u}} + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ N.sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : + F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + caps ∈ N.sets ∧ actors ∈ N.sets ∧ + FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c e d F caps actors := by + obtain ⟨_, _, _, _, _, _, _, ground⟩ := fulfilled.reflected_extension_basis reflection + infinite choice includes pairingN unionsN powersN separationN infiniteN choiceN smallD irreflexive hF filter + obtain ⟨caps, hCaps, actors, hActors, family⟩ := + fulfilled.insertion c hc e he d hd F ground filter lower strict bound above + exact ⟨ground, caps, hCaps, actors, hActors, includes hCaps, includes hActors, family⟩ + +theorem extension_countable_localization + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets infinity Fin.elim0) + {X : ZFSet.{u}} (hX : X ∈ N.sets) (subset : X ⊆ (run.finalGeometry i₀).carrier) + (small : N.groundEmbeddable X ZFSet.omega) : + X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ + ∃ b ∈ (run.finalGeometry i₀).carrier, + ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by + obtain ⟨ground, countable⟩ := reflection.countable_subset pairing unions powers separation infinite choice + pairingN unionsN powersN separationN infiniteN (run.finalGeometry i₀).carrier_ground hX subset small + have localized := fulfilled.countable_localization X ground subset countable + exact ⟨ground, countable, localized.1, localized.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {Q : Type u} [Preorder Q] [OrderTop Q] (s : Presentation Q) +include fulfilled + +theorem ordinary_extension_insertion + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (pairingN : Realize (M.ordinaryExtension s H).sets SetFormula.pairing Fin.elim0) + (unionsN : Realize (M.ordinaryExtension s H).sets SetFormula.union Fin.elim0) + (powersN : Realize (M.ordinaryExtension s H).sets powerSet Fin.elim0) + (separationN : SeparationSchema (M.ordinaryExtension s H).sets) + (infiniteN : Realize (M.ordinaryExtension s H).sets infinity Fin.elim0) + (choiceN : Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {c e d F : ZFSet.{u}} + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) (hF : F ∈ (M.ordinaryExtension s H).sets) + (filter : MeetFilterCode (run.finalGeometry i₀).carrier (run.finalGeometry i₀).order + (run.finalGeometry i₀).meetGraph F) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.finalGeometry i₀).order) : + F ∈ M.sets ∧ ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + caps ∈ (M.ordinaryExtension s H).sets ∧ actors ∈ (M.ordinaryExtension s H).sets ∧ + FinalInsertionFamiliesCode Labels (run.finalGeometry i₀).carrier (run.finalGeometry i₀).actors + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph (run.finalGeometry i₀).action + c e d F caps actors := by + have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation + collection infinite choice carrier order small (run.finalGeometry i₀).carrier_ground + closed H genericCoded genericFormula + have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H + exact fulfilled.extension_insertion reflection infinite choice includes pairingN unionsN powersN + separationN infiniteN choiceN smallD irreflexive hc he hd hF filter lower strict bound above + +theorem ordinary_extension_countable_localization + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter Q) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (pairingN : Realize (M.ordinaryExtension s H).sets SetFormula.pairing Fin.elim0) + (unionsN : Realize (M.ordinaryExtension s H).sets SetFormula.union Fin.elim0) + (powersN : Realize (M.ordinaryExtension s H).sets powerSet Fin.elim0) + (separationN : SeparationSchema (M.ordinaryExtension s H).sets) + (infiniteN : Realize (M.ordinaryExtension s H).sets infinity Fin.elim0) + {X : ZFSet.{u}} (hX : X ∈ (M.ordinaryExtension s H).sets) + (subset : X ⊆ (run.finalGeometry i₀).carrier) + (countable : (M.ordinaryExtension s H).groundEmbeddable X ZFSet.omega) : + X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega ∧ + (∃ j, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ (run.finalInclusions i₀).pointMap j) ∧ + ∃ b ∈ (run.finalGeometry i₀).carrier, + ∀ x ∈ X, ZFSet.pair x b ∈ (run.finalGeometry i₀).order := by + have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation + collection infinite choice carrier order small (run.finalGeometry i₀).carrier_ground + closed H genericCoded genericFormula + exact fulfilled.extension_countable_localization reflection infinite choice + pairingN unionsN powersN separationN infiniteN hX subset countable + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPersistentAssignmentLabels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPersistentAssignmentLabels.lean index a1f062d3699eff6ac3a54247c5d6c9e79e1ac6fa..e5165223b59db750fc7d05f37f9e439e61a27e7a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPersistentAssignmentLabels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPersistentAssignmentLabels.lean @@ -1,926 +1,926 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAbsentLiftActors -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAssignmentLabelInjectionPackages -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticRepresentedDomainLiftDecisions -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticRepresentedDomainPersistence -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPrefixCompatibleCaps -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalSuccessorPreparedProfiles - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_successor_represented_of_nonvisible - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) → - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → - ∀ pCut r0 : SetMembers Q, - let next := graphRestriction (insert alpha alpha) packed - let upper := M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) next - let levels := refinementDataHistoryLevels (insert alpha alpha) next lifted - lower.encode pCut = ZFSet.pair row (assignmentCut levels alpha A) → r0 ≤ pCut → - Name.ForcesMem r0 u.val U.val → - (∀ v z : (M.nameDomain lower).names, v.val.val ∈ lifted → z.val.val ∈ lifted → - stageOneAssignment idx v.val.val z.val.val ∈ A → - ∀ q, q ≤ r0 → ¬ Name.ForcesEq q - (Name.refinementClass lifted localValid Rc.val u.val) - (Name.refinementClass lifted localValid Rc.val v.val)) → - (∀ q, q ≤ r0 → ¬ Name.ForcesMem q - (Name.refinementClass lifted localValid Rf.val u.val) - (M.niceVisibilityName localAct lower lifted (a.principalFix V))) → - ∃ newRow newA : ZFSet.{u}, - ZFSet.pair newRow newA ∈ - M.representedDomainConditions lower upper levels alpha lifted localValid idx U Rc u ∧ - ZFSet.pair (ZFSet.pair newRow newA) (ZFSet.pair row A) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted (insert alpha alpha) next ∧ - A ⊆ newA := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - intro row A condition V E U Rf Rc u inI hu pCut r0 cutCode r0p active fresh absent - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val - let N := M.niceSupportNameCodes localAct lower lifted a.principalFix - obtain ⟨_hJ, _smallJ, k, _hk, _function, profilesGround, profilesSmall, profileFilters, - Pb, _basis, _representatives, _coarseEntry, pbMember, - generators, hGenerators, _smallGenerators, generatorsNonempty, generatorsSubset, generatedEq, - r, rr0, rowR, lowerA, rCode, prepared, - D0, eD0, uSupport, rowsBound, dataBound, coarseDecisions, _allDecisions, oldProfiles⟩ := - fulfilled.successor_prepared_insertion_profiles collection infinite choice small smallD irreflexive - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace alpha member - row A condition V E U Rf Rc u inI hu r0 - let system := M.semanticStructuralPrefix_refinementSystem c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member - have strict := ((system.indices.typed_entries V E U Rf Rc).1 inI).1 - have vD0 := strict.le.trans eD0 - obtain ⟨g, cap, q, qr, qgr, fixed, _above, _notAbove, movedBound, - capPositive, capNegative, avoidProfiles, _unionCoordinates⟩ := - fulfilled.structural_prefix_compatible_caps collection infinite choice labels small - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace alpha member - r rowR lowerA rCode prepared V E D0 generators Pb (M.certificateProfileImage J s.carrier N k) - strict vD0 (profileFilters Pb pbMember) hGenerators generatorsNonempty generatorsSubset - generatedEq profilesGround profilesSmall profileFilters rowsBound dataBound - have descent := fulfilled.structural_prefix_descent collection infinite choice small smallD irreflexive - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace alpha member - obtain ⟨w, _acted, _hw, _activeW, _groundD, newRow, newLowerA, _qCode, - _upperMember, edge, retained, _newAssignment, _cut, _self, inD⟩ := - M.semanticStructuralSuccessor_represented_absentLift_actor c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega - valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace member - infinite choice small condition geometry.meet.smallMeet descent - V E D0 cap U Rf Rc u Pb inI hu vD0 uSupport g fixed movedBound - pCut r q cutCode (rr0.trans r0p) qr qgr (Name.forcesMem_mono active rr0) - capPositive capNegative coarseDecisions - (fun p pr => absent p (pr.trans rr0)) - (by - intro v z hv hz old - obtain ⟨F, _B, _f, _entry, memberF, decisions⟩ := oldProfiles v z hv hz old - exact ⟨fun p pr => fresh v z hv hz old p (pr.trans rr0), - F, decisions, avoidProfiles F memberF⟩) - exact ⟨newRow, _, inD, edge, retained⟩ - - - - - - -theorem structural_represented_domain_dense - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → - let next := graphRestriction (insert alpha alpha) packed - let upper := M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) next - let levels := refinementDataHistoryLevels (insert alpha alpha) next lifted - let Dt := M.representedDomainConditions lower upper levels alpha lifted localValid idx U Rc u - Dt ∈ M.sets ∧ Dt ⊆ upper ∧ - (∀ p q, ZFSet.pair q p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder lifted - (insert alpha alpha) next → p ∈ Dt → q ∈ Dt) ∧ - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted (insert alpha alpha) next - Dense {p : SetMembers upper | SetMembers.raw p ∈ Dt} := by - intro geometry - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - intro s b a directed hL hG hC order graph nodeMaps supports - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 - closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - coordinates two carrier forcingOrder forcingAction omega topMem topRows packed - alpha member hAlpha cutOrdinal subset lowerPacked Q - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - intro historyRun - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - intro lower localAct localValid - let gamma := insert alpha alpha - have hGamma : gamma ∈ M.sets := M.insert_mem pairing unions hAlpha hAlpha - have gammaOrdinal : ordinalSetProperty gamma := ordinalSetProperty_succ cutOrdinal - have alphaGamma : alpha ⊆ gamma := fun _ hx => ZFSet.mem_insert_of_mem _ hx - have gammaSubset : gamma ⊆ stages := by - intro x hx - rcases ZFSet.mem_insert_iff.1 hx with rfl | old - · exact member - · exact subset _ old - let historyGamma := graphRestriction gamma history - have hhGamma : historyGamma ∈ M.sets := M.graphRestriction_mem unions separation hGamma hh - have traceGamma := trace.restrict gammaOrdinal gammaSubset - let packedGamma := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared gamma historyGamma - have packedGammaEq : packedGamma = graphRestriction gamma packed := - (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared gamma history).trans - (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared gammaSubset) - let next := graphRestriction gamma packed - let upper := M.refinementHistoryForcing c.carrier lifted gamma next - let levels := refinementDataHistoryLevels gamma next lifted - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted gamma next - let Property : ∀ (domainSet : ZFSet.{u}) (orderQ : PartialOrder (SetMembers domainSet)), - @PosetAction (SetMembers geometry.actors) _ (SetMembers domainSet) orderQ → Prop := - fun domainSet orderQ actionQ => - letI := orderQ - ∀ topQ : OrderTop (SetMembers domainSet), - letI := topQ - let lower := SetMembers.presentation domainSet - ∀ localValid : ∀ z ∈ lifted, IsName lower z, - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices actionQ lower s a alpha lifted squared localValid → u.val.val ∈ lifted → - let Dt := M.representedDomainConditions lower upper levels alpha lifted localValid idx U Rc u - Dt ∈ M.sets ∧ Dt ⊆ upper ∧ - (∀ p q, ZFSet.pair q p ∈ upperOrder → p ∈ Dt → q ∈ Dt) ∧ - ∀ p ∈ upper, ∃ q ∈ Dt, ZFSet.pair q p ∈ upperOrder - let QGamma := M.refinementHistoryForcing c.carrier lifted alpha (graphRestriction alpha packedGamma) - let gammaOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha - (graphRestriction alpha packedGamma) - let runGamma := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared gammaOrdinal traceGamma - let topGamma := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha - (graphRestriction alpha packedGamma) (runGamma.carriers.restrict cutOrdinal alphaGamma) - cutOrdinal carrier (c.encode ⊤) topMem topRows - let validGamma := M.refinementHistoryRowNameFamily_valid c - (runGamma.carriers.restrict cutOrdinal alphaGamma) cutOrdinal carrier lifted valid1 - let actionGamma := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hhGamma traceGamma hAlpha cutOrdinal alphaGamma - have inside : Property QGamma gammaOrder actionGamma := by - intro topQ - have topEq : topQ = topGamma := Subsingleton.elim _ _ - subst topQ - dsimp only - intro validQ - have validEq : validQ = validGamma := Subsingleton.elim _ _ - subst validQ - intro V E U Rf Rc u inI hu - let lowerGamma := SetMembers.presentation QGamma - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - let upperGamma := M.refinementHistoryForcing c.carrier lifted gamma packedGamma - let levelsGamma := refinementDataHistoryLevels gamma packedGamma lifted - let orderGamma := M.refinementHistoryOrder c.carrier c.conditionOrder lifted gamma packedGamma - have upperEq : upperGamma = upper := by dsimp only [upperGamma, upper, next]; rw [packedGammaEq] - have levelsEq : levelsGamma = levels := by dsimp only [levelsGamma, levels, next]; rw [packedGammaEq] - have orderEq : orderGamma = upperOrder := by dsimp only [orderGamma, upperOrder, next]; rw [packedGammaEq] - let DtGamma := M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u - let DtOuter := M.representedDomainConditions lowerGamma upper levels alpha lifted validGamma idx U Rc u - have domainEq : DtGamma = DtOuter := by - dsimp only [DtGamma, DtOuter] - rw [upperEq, levelsEq] - have moveMember {z : ZFSet.{u}} (h : z ∈ DtGamma) : z ∈ DtOuter := - Eq.mp (congrArg (fun bound : ZFSet.{u} => z ∈ bound) domainEq) h - have moveOrder {z p : ZFSet.{u}} (h : ZFSet.pair z p ∈ orderGamma) : - ZFSet.pair z p ∈ upperOrder := - Eq.mp (congrArg (fun relation : ZFSet.{u} => ZFSet.pair z p ∈ relation) orderEq) h - have selfRestrict : graphRestriction gamma packedGamma = packedGamma := - (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared (fun _ h => h : gamma ⊆ gamma)).symm - have hIdx := M.refinementIndexCode_mem pairing hAlpha - (M.transitive hL (s.encode_mem V)) (M.transitive hL (s.encode_mem E)) - U.property Rf.property Rc.property - obtain ⟨groundD, subsetD, downwardD⟩ := - M.semanticStructuralPrefix_representedDomain_ground_downward c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hGamma hhGamma gammaOrdinal traceGamma - (ZFSet.mem_insert alpha alpha) idx hIdx U Rc u - change M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u ∈ M.sets at groundD - change M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u ⊆ upperGamma at subsetD - change ∀ p q, ZFSet.pair q p ∈ orderGamma → - p ∈ M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u → - q ∈ M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u at downwardD - rw [upperEq, levelsEq] at groundD subsetD - rw [upperEq, levelsEq, orderEq] at downwardD - refine ⟨groundD, subsetD, downwardD, ?_⟩ - intro p hp - have hpGamma : p ∈ upperGamma := upperEq.symm ▸ hp - obtain ⟨row, _rowMem, A, _assignmentsMem, pCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape c.carrier lifted gamma packedGamma hpGamma) - subst p - obtain ⟨pCut, r, cutCode, below, lowerRow, lowerA, _rCode, - _liftedCondition, liftedBelow, _retained, _exactCut, represented | fresh⟩ := - M.semanticStructuralSuccessor_represented_or_fresh b s a ⊥ directed - pairing unions powers separation collection infinite choice - (ZFSet.prod s.nonbottom.carrier columns) coordinates act lifted squared (c.encode ⊤) - forcingAction hG hL order graph nodeMaps supports hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 topMem topRows - gamma historyGamma hGamma hhGamma gammaOrdinal traceGamma alpha (ZFSet.mem_insert alpha alpha) - hpGamma V E U Rf Rc inI u.val hu - · exact ⟨ZFSet.pair lowerRow (assignmentSplice levelsGamma alpha lowerA A), - moveMember represented, moveOrder liftedBelow⟩ - · obtain ⟨active, coarseFresh⟩ := fresh - have successorCondition : ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted - (insert alpha alpha) (graphRestriction (insert alpha alpha) packedGamma) := by - change ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted gamma (graphRestriction gamma packedGamma) - rw [selfRestrict] - exact hpGamma - have successorCut : lowerGamma.encode pCut = ZFSet.pair row - (assignmentCut (refinementDataHistoryLevels (insert alpha alpha) - (graphRestriction (insert alpha alpha) packedGamma) lifted) alpha A) := by - change lowerGamma.encode pCut = ZFSet.pair row - (assignmentCut (refinementDataHistoryLevels gamma (graphRestriction gamma packedGamma) lifted) alpha A) - rw [selfRestrict] - exact cutCode - obtain ⟨q, qr, activeQ, freshQ, positive | negative⟩ := - M.semanticStructuralSuccessor_decide_represented_visibleLift c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hGamma hhGamma gammaOrdinal traceGamma - (ZFSet.mem_insert alpha alpha) infinite choice small successorCondition - V E U Rf Rc u inI hu pCut r successorCut below active - (fun v z hv hz old k kr => coarseFresh v.val z.val hv hz old k kr) - · obtain ⟨_existsLift, _w, _hw, _activeU, _activeW, newRow, newA, _qCode, - _newCondition, newBelow, _retained, _literal, _exactCut, _selfEqual, inD⟩ := positive - rw [selfRestrict] at inD newBelow - exact ⟨_, moveMember inD, moveOrder newBelow⟩ - · obtain ⟨_absentLift, _fineMember, _mapEdge, nonvisible⟩ := negative - obtain ⟨newRow, newA, inD, newBelow, _retained⟩ := - fulfilled.structural_successor_represented_of_nonvisible collection infinite choice labels - small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 - gamma historyGamma hGamma hhGamma gammaOrdinal traceGamma alpha (ZFSet.mem_insert alpha alpha) - row A successorCondition V E U Rf Rc u inI hu pCut q successorCut (qr.trans below) - activeQ freshQ nonvisible - rw [selfRestrict] at inD newBelow - exact ⟨ZFSet.pair newRow newA, moveMember inD, moveOrder newBelow⟩ - have outside := (M.semanticStructuralPrefixAction_subhistory_property c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order - graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset hGamma gammaOrdinal alphaGamma gammaSubset Property).1 inside - intro V E U Rf Rc u indexCode inI hu nextOuter upperOuter levelsOuter domainOuter - obtain ⟨groundD, subsetD, downwardD, denseD⟩ := outside inferInstance localValid V E U Rf Rc u inI hu - refine ⟨groundD, subsetD, downwardD, ?_⟩ - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted gamma next - intro p - obtain ⟨q, hq, below⟩ := denseD (SetMembers.raw p) (SetMembers.raw_mem p) - let qTyped : SetMembers upper := SetMembers.ofMem q (subsetD hq) - have qCode : SetMembers.raw qTyped = q := SetMembers.raw_ofMem _ _ - refine ⟨qTyped, ?_, ?_⟩ - · change ZFSet.pair (SetMembers.raw qTyped) (SetMembers.raw p) ∈ upperOrder - rwa [qCode] - · change SetMembers.raw qTyped ∈ M.representedDomainConditions lower upper levels alpha lifted - localValid (refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val) U Rc u - rw [qCode] - exact hq - - - - - - -theorem structural_successor_assignment_label_total - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset - pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) - topMem topRows mono - ∀ (_successor : insert alpha alpha = stages) - (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → - ∀ (H : ConditionFilter (SetMembers upperSet)), H.GenericFor (formulaFamily (M.nameDomain upper)) → - ∀ z ∈ Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val), - ∃ y : ZFSet.{u}, ZFSet.pair z y ∈ Name.eval {p | H.mem p} - (Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val) := by - intro geometry - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - intro s b a directed hL hG hC order graph nodeMaps supports - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 - closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - coordinates two carrier forcingOrder forcingAction omega topMem topRows packed - alpha member hAlpha cutOrdinal subset lowerPacked Q - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - intro historyRun - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - intro lower localAct localValid upperSet - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - intro upper hPacked witnesses mono inc successor V E U Rf Rc indexCode index H ordinary - apply M.semanticStructuralAssignmentLabel_domain_total c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary - intro u hu - have result := fulfilled.structural_represented_domain_dense collection infinite choice labels - small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace alpha member V E U Rf Rc u index hu - have selfRestrict : graphRestriction stages packed = packed := - (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared (fun _ h => h : stages ⊆ stages)).symm - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - change M.representedDomainConditions lower - (M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed)) - (refinementDataHistoryLevels (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) lifted) - alpha lifted localValid idx U Rc u ∈ M.sets ∧ _ at result - let Property : ZFSet.{u} → ZFSet.{u} → Prop := fun nextStage nextPacked => - let nextCarrier := M.refinementHistoryForcing c.carrier lifted nextStage nextPacked - let nextLevels := refinementDataHistoryLevels nextStage nextPacked lifted - let domain := M.representedDomainConditions lower nextCarrier nextLevels - alpha lifted localValid idx U Rc u - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted nextStage nextPacked - domain ∈ M.sets ∧ Dense {p : SetMembers nextCarrier | SetMembers.raw p ∈ domain} - have packedNext : graphRestriction (insert alpha alpha) packed = packed := - (congrArg (fun nextStage => graphRestriction nextStage packed) successor).trans selfRestrict - exact (congrArg₂ Property successor packedNext).mp ⟨result.1, result.2.2.2⟩ - - - - - - -theorem structural_assignment_label_injection - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset - pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) - topMem topRows mono - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → - ∀ (H : ConditionFilter (SetMembers upperSet)), H.GenericFor (formulaFamily (M.nameDomain upper)) → - let label := Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val - let J := Name.eval {p | H.mem p} label - let coarse := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val) - let fine := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rf.val) - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - InjectionCode coarse fine J ∧ - J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset - pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) - topMem topRows mono - intro V E U Rf Rc index H ordinary - have density := M.semanticStructuralPrefix_representedDomain_persistent_dense c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder - forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace member - infinite choice V E U Rf Rc index (by - intro u hu - have successorDensity := fulfilled.structural_represented_domain_dense collection infinite choice labels - small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace alpha member V E U Rf Rc u index hu - exact ⟨successorDensity.1, successorDensity.2.2.2⟩) - have total := M.semanticStructuralAssignmentLabel_domain_total c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary density - exact M.semanticStructuralAssignmentLabel_injection_package c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary total - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAbsentLiftActors +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAssignmentLabelInjectionPackages +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticRepresentedDomainLiftDecisions +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticRepresentedDomainPersistence +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPrefixCompatibleCaps +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalSuccessorPreparedProfiles + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_successor_represented_of_nonvisible + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) → + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → + ∀ pCut r0 : SetMembers Q, + let next := graphRestriction (insert alpha alpha) packed + let upper := M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) next + let levels := refinementDataHistoryLevels (insert alpha alpha) next lifted + lower.encode pCut = ZFSet.pair row (assignmentCut levels alpha A) → r0 ≤ pCut → + Name.ForcesMem r0 u.val U.val → + (∀ v z : (M.nameDomain lower).names, v.val.val ∈ lifted → z.val.val ∈ lifted → + stageOneAssignment idx v.val.val z.val.val ∈ A → + ∀ q, q ≤ r0 → ¬ Name.ForcesEq q + (Name.refinementClass lifted localValid Rc.val u.val) + (Name.refinementClass lifted localValid Rc.val v.val)) → + (∀ q, q ≤ r0 → ¬ Name.ForcesMem q + (Name.refinementClass lifted localValid Rf.val u.val) + (M.niceVisibilityName localAct lower lifted (a.principalFix V))) → + ∃ newRow newA : ZFSet.{u}, + ZFSet.pair newRow newA ∈ + M.representedDomainConditions lower upper levels alpha lifted localValid idx U Rc u ∧ + ZFSet.pair (ZFSet.pair newRow newA) (ZFSet.pair row A) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted (insert alpha alpha) next ∧ + A ⊆ newA := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + intro row A condition V E U Rf Rc u inI hu pCut r0 cutCode r0p active fresh absent + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val + let N := M.niceSupportNameCodes localAct lower lifted a.principalFix + obtain ⟨_hJ, _smallJ, k, _hk, _function, profilesGround, profilesSmall, profileFilters, + Pb, _basis, _representatives, _coarseEntry, pbMember, + generators, hGenerators, _smallGenerators, generatorsNonempty, generatorsSubset, generatedEq, + r, rr0, rowR, lowerA, rCode, prepared, + D0, eD0, uSupport, rowsBound, dataBound, coarseDecisions, _allDecisions, oldProfiles⟩ := + fulfilled.successor_prepared_insertion_profiles collection infinite choice small smallD irreflexive + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace alpha member + row A condition V E U Rf Rc u inI hu r0 + let system := M.semanticStructuralPrefix_refinementSystem c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member + have strict := ((system.indices.typed_entries V E U Rf Rc).1 inI).1 + have vD0 := strict.le.trans eD0 + obtain ⟨g, cap, q, qr, qgr, fixed, _above, _notAbove, movedBound, + capPositive, capNegative, avoidProfiles, _unionCoordinates⟩ := + fulfilled.structural_prefix_compatible_caps collection infinite choice labels small + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace alpha member + r rowR lowerA rCode prepared V E D0 generators Pb (M.certificateProfileImage J s.carrier N k) + strict vD0 (profileFilters Pb pbMember) hGenerators generatorsNonempty generatorsSubset + generatedEq profilesGround profilesSmall profileFilters rowsBound dataBound + have descent := fulfilled.structural_prefix_descent collection infinite choice small smallD irreflexive + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace alpha member + obtain ⟨w, _acted, _hw, _activeW, _groundD, newRow, newLowerA, _qCode, + _upperMember, edge, retained, _newAssignment, _cut, _self, inD⟩ := + M.semanticStructuralSuccessor_represented_absentLift_actor c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega + valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace member + infinite choice small condition geometry.meet.smallMeet descent + V E D0 cap U Rf Rc u Pb inI hu vD0 uSupport g fixed movedBound + pCut r q cutCode (rr0.trans r0p) qr qgr (Name.forcesMem_mono active rr0) + capPositive capNegative coarseDecisions + (fun p pr => absent p (pr.trans rr0)) + (by + intro v z hv hz old + obtain ⟨F, _B, _f, _entry, memberF, decisions⟩ := oldProfiles v z hv hz old + exact ⟨fun p pr => fresh v z hv hz old p (pr.trans rr0), + F, decisions, avoidProfiles F memberF⟩) + exact ⟨newRow, _, inD, edge, retained⟩ + + + + + + +theorem structural_represented_domain_dense + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → + let next := graphRestriction (insert alpha alpha) packed + let upper := M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) next + let levels := refinementDataHistoryLevels (insert alpha alpha) next lifted + let Dt := M.representedDomainConditions lower upper levels alpha lifted localValid idx U Rc u + Dt ∈ M.sets ∧ Dt ⊆ upper ∧ + (∀ p q, ZFSet.pair q p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder lifted + (insert alpha alpha) next → p ∈ Dt → q ∈ Dt) ∧ + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted (insert alpha alpha) next + Dense {p : SetMembers upper | SetMembers.raw p ∈ Dt} := by + intro geometry + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + intro s b a directed hL hG hC order graph nodeMaps supports + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 + closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + coordinates two carrier forcingOrder forcingAction omega topMem topRows packed + alpha member hAlpha cutOrdinal subset lowerPacked Q + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + intro historyRun + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + intro lower localAct localValid + let gamma := insert alpha alpha + have hGamma : gamma ∈ M.sets := M.insert_mem pairing unions hAlpha hAlpha + have gammaOrdinal : ordinalSetProperty gamma := ordinalSetProperty_succ cutOrdinal + have alphaGamma : alpha ⊆ gamma := fun _ hx => ZFSet.mem_insert_of_mem _ hx + have gammaSubset : gamma ⊆ stages := by + intro x hx + rcases ZFSet.mem_insert_iff.1 hx with rfl | old + · exact member + · exact subset _ old + let historyGamma := graphRestriction gamma history + have hhGamma : historyGamma ∈ M.sets := M.graphRestriction_mem unions separation hGamma hh + have traceGamma := trace.restrict gammaOrdinal gammaSubset + let packedGamma := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared gamma historyGamma + have packedGammaEq : packedGamma = graphRestriction gamma packed := + (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared gamma history).trans + (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared gammaSubset) + let next := graphRestriction gamma packed + let upper := M.refinementHistoryForcing c.carrier lifted gamma next + let levels := refinementDataHistoryLevels gamma next lifted + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted gamma next + let Property : ∀ (domainSet : ZFSet.{u}) (orderQ : PartialOrder (SetMembers domainSet)), + @PosetAction (SetMembers geometry.actors) _ (SetMembers domainSet) orderQ → Prop := + fun domainSet orderQ actionQ => + letI := orderQ + ∀ topQ : OrderTop (SetMembers domainSet), + letI := topQ + let lower := SetMembers.presentation domainSet + ∀ localValid : ∀ z ∈ lifted, IsName lower z, + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices actionQ lower s a alpha lifted squared localValid → u.val.val ∈ lifted → + let Dt := M.representedDomainConditions lower upper levels alpha lifted localValid idx U Rc u + Dt ∈ M.sets ∧ Dt ⊆ upper ∧ + (∀ p q, ZFSet.pair q p ∈ upperOrder → p ∈ Dt → q ∈ Dt) ∧ + ∀ p ∈ upper, ∃ q ∈ Dt, ZFSet.pair q p ∈ upperOrder + let QGamma := M.refinementHistoryForcing c.carrier lifted alpha (graphRestriction alpha packedGamma) + let gammaOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha + (graphRestriction alpha packedGamma) + let runGamma := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared gammaOrdinal traceGamma + let topGamma := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha + (graphRestriction alpha packedGamma) (runGamma.carriers.restrict cutOrdinal alphaGamma) + cutOrdinal carrier (c.encode ⊤) topMem topRows + let validGamma := M.refinementHistoryRowNameFamily_valid c + (runGamma.carriers.restrict cutOrdinal alphaGamma) cutOrdinal carrier lifted valid1 + let actionGamma := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hhGamma traceGamma hAlpha cutOrdinal alphaGamma + have inside : Property QGamma gammaOrder actionGamma := by + intro topQ + have topEq : topQ = topGamma := Subsingleton.elim _ _ + subst topQ + dsimp only + intro validQ + have validEq : validQ = validGamma := Subsingleton.elim _ _ + subst validQ + intro V E U Rf Rc u inI hu + let lowerGamma := SetMembers.presentation QGamma + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + let upperGamma := M.refinementHistoryForcing c.carrier lifted gamma packedGamma + let levelsGamma := refinementDataHistoryLevels gamma packedGamma lifted + let orderGamma := M.refinementHistoryOrder c.carrier c.conditionOrder lifted gamma packedGamma + have upperEq : upperGamma = upper := by dsimp only [upperGamma, upper, next]; rw [packedGammaEq] + have levelsEq : levelsGamma = levels := by dsimp only [levelsGamma, levels, next]; rw [packedGammaEq] + have orderEq : orderGamma = upperOrder := by dsimp only [orderGamma, upperOrder, next]; rw [packedGammaEq] + let DtGamma := M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u + let DtOuter := M.representedDomainConditions lowerGamma upper levels alpha lifted validGamma idx U Rc u + have domainEq : DtGamma = DtOuter := by + dsimp only [DtGamma, DtOuter] + rw [upperEq, levelsEq] + have moveMember {z : ZFSet.{u}} (h : z ∈ DtGamma) : z ∈ DtOuter := + Eq.mp (congrArg (fun bound : ZFSet.{u} => z ∈ bound) domainEq) h + have moveOrder {z p : ZFSet.{u}} (h : ZFSet.pair z p ∈ orderGamma) : + ZFSet.pair z p ∈ upperOrder := + Eq.mp (congrArg (fun relation : ZFSet.{u} => ZFSet.pair z p ∈ relation) orderEq) h + have selfRestrict : graphRestriction gamma packedGamma = packedGamma := + (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared (fun _ h => h : gamma ⊆ gamma)).symm + have hIdx := M.refinementIndexCode_mem pairing hAlpha + (M.transitive hL (s.encode_mem V)) (M.transitive hL (s.encode_mem E)) + U.property Rf.property Rc.property + obtain ⟨groundD, subsetD, downwardD⟩ := + M.semanticStructuralPrefix_representedDomain_ground_downward c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hGamma hhGamma gammaOrdinal traceGamma + (ZFSet.mem_insert alpha alpha) idx hIdx U Rc u + change M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u ∈ M.sets at groundD + change M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u ⊆ upperGamma at subsetD + change ∀ p q, ZFSet.pair q p ∈ orderGamma → + p ∈ M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u → + q ∈ M.representedDomainConditions lowerGamma upperGamma levelsGamma alpha lifted validGamma idx U Rc u at downwardD + rw [upperEq, levelsEq] at groundD subsetD + rw [upperEq, levelsEq, orderEq] at downwardD + refine ⟨groundD, subsetD, downwardD, ?_⟩ + intro p hp + have hpGamma : p ∈ upperGamma := upperEq.symm ▸ hp + obtain ⟨row, _rowMem, A, _assignmentsMem, pCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape c.carrier lifted gamma packedGamma hpGamma) + subst p + obtain ⟨pCut, r, cutCode, below, lowerRow, lowerA, _rCode, + _liftedCondition, liftedBelow, _retained, _exactCut, represented | fresh⟩ := + M.semanticStructuralSuccessor_represented_or_fresh b s a ⊥ directed + pairing unions powers separation collection infinite choice + (ZFSet.prod s.nonbottom.carrier columns) coordinates act lifted squared (c.encode ⊤) + forcingAction hG hL order graph nodeMaps supports hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 topMem topRows + gamma historyGamma hGamma hhGamma gammaOrdinal traceGamma alpha (ZFSet.mem_insert alpha alpha) + hpGamma V E U Rf Rc inI u.val hu + · exact ⟨ZFSet.pair lowerRow (assignmentSplice levelsGamma alpha lowerA A), + moveMember represented, moveOrder liftedBelow⟩ + · obtain ⟨active, coarseFresh⟩ := fresh + have successorCondition : ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted + (insert alpha alpha) (graphRestriction (insert alpha alpha) packedGamma) := by + change ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted gamma (graphRestriction gamma packedGamma) + rw [selfRestrict] + exact hpGamma + have successorCut : lowerGamma.encode pCut = ZFSet.pair row + (assignmentCut (refinementDataHistoryLevels (insert alpha alpha) + (graphRestriction (insert alpha alpha) packedGamma) lifted) alpha A) := by + change lowerGamma.encode pCut = ZFSet.pair row + (assignmentCut (refinementDataHistoryLevels gamma (graphRestriction gamma packedGamma) lifted) alpha A) + rw [selfRestrict] + exact cutCode + obtain ⟨q, qr, activeQ, freshQ, positive | negative⟩ := + M.semanticStructuralSuccessor_decide_represented_visibleLift c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hGamma hhGamma gammaOrdinal traceGamma + (ZFSet.mem_insert alpha alpha) infinite choice small successorCondition + V E U Rf Rc u inI hu pCut r successorCut below active + (fun v z hv hz old k kr => coarseFresh v.val z.val hv hz old k kr) + · obtain ⟨_existsLift, _w, _hw, _activeU, _activeW, newRow, newA, _qCode, + _newCondition, newBelow, _retained, _literal, _exactCut, _selfEqual, inD⟩ := positive + rw [selfRestrict] at inD newBelow + exact ⟨_, moveMember inD, moveOrder newBelow⟩ + · obtain ⟨_absentLift, _fineMember, _mapEdge, nonvisible⟩ := negative + obtain ⟨newRow, newA, inD, newBelow, _retained⟩ := + fulfilled.structural_successor_represented_of_nonvisible collection infinite choice labels + small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 + gamma historyGamma hGamma hhGamma gammaOrdinal traceGamma alpha (ZFSet.mem_insert alpha alpha) + row A successorCondition V E U Rf Rc u inI hu pCut q successorCut (qr.trans below) + activeQ freshQ nonvisible + rw [selfRestrict] at inD newBelow + exact ⟨ZFSet.pair newRow newA, moveMember inD, moveOrder newBelow⟩ + have outside := (M.semanticStructuralPrefixAction_subhistory_property c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order + graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset hGamma gammaOrdinal alphaGamma gammaSubset Property).1 inside + intro V E U Rf Rc u indexCode inI hu nextOuter upperOuter levelsOuter domainOuter + obtain ⟨groundD, subsetD, downwardD, denseD⟩ := outside inferInstance localValid V E U Rf Rc u inI hu + refine ⟨groundD, subsetD, downwardD, ?_⟩ + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted gamma next + intro p + obtain ⟨q, hq, below⟩ := denseD (SetMembers.raw p) (SetMembers.raw_mem p) + let qTyped : SetMembers upper := SetMembers.ofMem q (subsetD hq) + have qCode : SetMembers.raw qTyped = q := SetMembers.raw_ofMem _ _ + refine ⟨qTyped, ?_, ?_⟩ + · change ZFSet.pair (SetMembers.raw qTyped) (SetMembers.raw p) ∈ upperOrder + rwa [qCode] + · change SetMembers.raw qTyped ∈ M.representedDomainConditions lower upper levels alpha lifted + localValid (refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val) U Rc u + rw [qCode] + exact hq + + + + + + +theorem structural_successor_assignment_label_total + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset + pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) + topMem topRows mono + ∀ (_successor : insert alpha alpha = stages) + (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → + ∀ (H : ConditionFilter (SetMembers upperSet)), H.GenericFor (formulaFamily (M.nameDomain upper)) → + ∀ z ∈ Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val), + ∃ y : ZFSet.{u}, ZFSet.pair z y ∈ Name.eval {p | H.mem p} + (Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val) := by + intro geometry + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + intro s b a directed hL hG hC order graph nodeMaps supports + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 + closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + coordinates two carrier forcingOrder forcingAction omega topMem topRows packed + alpha member hAlpha cutOrdinal subset lowerPacked Q + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + intro historyRun + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + intro lower localAct localValid upperSet + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + intro upper hPacked witnesses mono inc successor V E U Rf Rc indexCode index H ordinary + apply M.semanticStructuralAssignmentLabel_domain_total c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary + intro u hu + have result := fulfilled.structural_represented_domain_dense collection infinite choice labels + small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace alpha member V E U Rf Rc u index hu + have selfRestrict : graphRestriction stages packed = packed := + (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared (fun _ h => h : stages ⊆ stages)).symm + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + change M.representedDomainConditions lower + (M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed)) + (refinementDataHistoryLevels (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) lifted) + alpha lifted localValid idx U Rc u ∈ M.sets ∧ _ at result + let Property : ZFSet.{u} → ZFSet.{u} → Prop := fun nextStage nextPacked => + let nextCarrier := M.refinementHistoryForcing c.carrier lifted nextStage nextPacked + let nextLevels := refinementDataHistoryLevels nextStage nextPacked lifted + let domain := M.representedDomainConditions lower nextCarrier nextLevels + alpha lifted localValid idx U Rc u + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted nextStage nextPacked + domain ∈ M.sets ∧ Dense {p : SetMembers nextCarrier | SetMembers.raw p ∈ domain} + have packedNext : graphRestriction (insert alpha alpha) packed = packed := + (congrArg (fun nextStage => graphRestriction nextStage packed) successor).trans selfRestrict + exact (congrArg₂ Property successor packedNext).mp ⟨result.1, result.2.2.2⟩ + + + + + + +theorem structural_assignment_label_injection + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset + pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) + topMem topRows mono + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → + ∀ (H : ConditionFilter (SetMembers upperSet)), H.GenericFor (formulaFamily (M.nameDomain upper)) → + let label := Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val + let J := Name.eval {p | H.mem p} label + let coarse := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val) + let fine := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rf.val) + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + InjectionCode coarse fine J ∧ + J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset + pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) + topMem topRows mono + intro V E U Rf Rc index H ordinary + have density := M.semanticStructuralPrefix_representedDomain_persistent_dense c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder + forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace member + infinite choice V E U Rf Rc index (by + intro u hu + have successorDensity := fulfilled.structural_represented_domain_dense collection infinite choice labels + small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace alpha member V E U Rf Rc u index hu + exact ⟨successorDensity.1, successorDensity.2.2.2⟩) + have total := M.semanticStructuralAssignmentLabel_domain_total c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary density + exact M.semanticStructuralAssignmentLabel_injection_package c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary total + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPreparedInsertionProfiles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPreparedInsertionProfiles.lean index 760598a3906c21d731948dc960e14aecbeec09d6..06a29bdfdb2a6324835362478a845e8b66178b0e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPreparedInsertionProfiles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalPreparedInsertionProfiles.lean @@ -1,388 +1,388 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPreparedPrefixBounds - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem augmented_profile_family - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted stages packed → - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → - ∀ p : SetMembers Q, - let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val - let N := M.niceSupportNameCodes localAct lower lifted a.principalFix - J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ - ∃ (validJ : ∀ z ∈ J, IsName lower z) (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) ∧ H.GenericFor (formulaFamily (M.nameDomain lower)) ∧ - ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ - k ⊆ M.supportedCertificateFamilyRelation localAct lower s lifted a.principalFix - geometry.order J validJ H ∧ - ∃ q, H.mem q ∧ q ≤ p ∧ - let Profiles := M.certificateProfileImage J s.carrier N k - Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ - (∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ - ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F ∈ Profiles ∧ B.Nonempty ∧ - M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val q ∧ - (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ N → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) := by - intro geometry - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - intro s b a directed hL hG hC order graph nodeMaps supports - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 - closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - coordinates two carrier forcingOrder forcingAction omega topMem topRows packed - alpha member hAlpha cutOrdinal subset lowerPacked Q - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - intro historyRun - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - intro lower localAct localValid row A condition V E U Rf Rc u idx inI hu p J N - have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice - coordinates two - obtain ⟨lowerGround, lowerOrder, maps, lowerClosed, terms, children⟩ := - M.semanticStructuralPrefix_preparation_inputs c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice rowClosed - obtain ⟨_, _, hJ, smallJ, validJ, _, facts, _, _⟩ := - M.semanticStructuralPrefix_augmentedClassRequests c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice condition V E U Rf Rc u inI hu - obtain ⟨H, hp, coded, ordinary, _symmetric⟩ := M.exists_joint_generic lower localAct - (a.principalSupportFamily ⊥ directed) small lowerGround p - have descent := fulfilled.structural_prefix_descent collection infinite choice small smallD irreflexive - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace alpha member H coded ordinary - obtain ⟨k, hk, function, selected, q, hq, qp, _forced, decisions⟩ := - fulfilled.exists_forcedSupportedCertificateFamily lower collection infinite choice lowerGround lowerOrder - small lowerClosed smallD irreflexive localAct maps lifted hLifted localValid terms children - H coded ordinary descent J hJ validJ smallJ (fun z hz => (facts z hz).1) - (fun z hz => (facts z hz).2.2.2 H) p hp - have codesGround : N ∈ M.sets := M.niceSupportNameCodes_mem localAct lower s lifted a.principalFix b - pairing unions powers separation collection lowerGround hG hL supports maps hLifted localValid - obtain ⟨profilesGround, profilesSmall⟩ := M.certificateProfileImage_mem_small pairing unions powers - separation choice hJ hL codesGround hk omega function smallJ - refine ⟨hJ, smallJ, validJ, H, coded, ordinary, k, hk, function, selected, q, hq, qp, - profilesGround, profilesSmall, ?_, ?_⟩ - · intro F memberF - obtain ⟨z, B, f, entry⟩ := (M.mem_certificateProfileImage function F).1 memberF - have hz := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 - let name : (M.nameDomain lower).names := ⟨⟨z, validJ z hz⟩, M.transitive hJ hz⟩ - exact (decisions name F B f entry).2.1 - · intro z F B f entry - have chosen := decisions z F B f entry - exact ⟨(M.mem_certificateProfileImage function F).2 ⟨z.val.val, B, f, entry⟩, - chosen.2.2.1, chosen.2.2.2.1, chosen.2.2.2.2.1⟩ - - - - - - -theorem prepared_augmented_profiles - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted stages packed → - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → - ∀ r0 : SetMembers Q, - let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val - let N := M.niceSupportNameCodes localAct lower lifted a.principalFix - let Profiles (k : ZFSet.{u}) := M.certificateProfileImage J s.carrier N k - let prefixIndices := refinementDataHistoryIndices alpha lowerPacked - let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid - J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ - ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ - Profiles k ∈ M.sets ∧ M.groundEmbeddable (Profiles k) ZFSet.omega ∧ - (∀ F ∈ Profiles k, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ - ∃ Pb basis representatives, - ZFSet.pair (Name.refinementClass lifted localValid Rc.val u.val).val - (ZFSet.pair Pb (ZFSet.pair basis representatives)) ∈ k ∧ Pb ∈ Profiles k ∧ - ∃ generators ∈ M.sets, M.groundEmbeddable generators ZFSet.omega ∧ generators.Nonempty ∧ - generators ⊆ testedMeetFilter Pb geometry.order (s.encode E) ∧ - M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators = - testedMeetFilter Pb geometry.order (s.encode E) ∧ - ∃ r : SetMembers Q, r ≤ r0 ∧ - ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), - lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ - StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ - ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ - a.principalFix D0 ≤ localAct.stabilizer lower u.val ∧ - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ - (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ - stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier - s.conditionOrder prefixAnchors tuples) ∧ - M.DecidesVisibilityProfile localAct lower s a.principalFix lifted Pb - (Name.refinementClass lifted localValid Rc.val u.val) r ∧ - (∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F ∈ Profiles k ∧ M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val r) ∧ - ∀ v w : (M.nameDomain lower).names, v.val.val ∈ lifted → w.val.val ∈ lifted → - stageOneAssignment idx v.val.val w.val.val ∈ A → - ∃ F B f, ZFSet.pair (Name.refinementClass lifted localValid Rf.val w.val).val - (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ F ∈ Profiles k ∧ - M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F - (Name.refinementClass lifted localValid Rf.val w.val) r := by - intro geometry - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - intro s b a directed hL hG hC order graph nodeMaps supports - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 - closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - coordinates two carrier forcingOrder forcingAction omega topMem topRows packed - alpha member hAlpha cutOrdinal subset lowerPacked Q - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - intro historyRun - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - intro lower localAct localValid row A condition V E U Rf Rc u idx inI hu r0 J N - Profiles prefixIndices prefixAnchors tuples - obtain ⟨hJ, smallJ, validJ, H, _coded, _ordinary, k, hk, function, _selected, - q0, _hq0, q0Below, profilesGround, profilesSmall, profileFilters, decisions⟩ := - fulfilled.augmented_profile_family collection infinite choice small smallD irreflexive - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace alpha member - row A condition V E U Rf Rc u inI hu r0 - have coarseMember : (Name.refinementClass lifted localValid Rc.val u.val).val ∈ J := - ZFSet.mem_insert _ _ - let coarse : (M.nameDomain lower).names := - ⟨Name.refinementClass lifted localValid Rc.val u.val, M.transitive hJ coarseMember⟩ - obtain ⟨coarseValue, coarseEdge, _coarseUnique⟩ := function.2 coarse.val.val coarseMember - have coarseBound := (ZFSet.pair_mem_prod.1 (function.1 coarseEdge)).2 - obtain ⟨Pb, _hPb, tail, hTail, rfl⟩ := ZFSet.mem_prod.1 coarseBound - obtain ⟨basis, _hBasis, representatives, _hRepresentatives, rfl⟩ := ZFSet.mem_prod.1 hTail - have coarseChosen := decisions coarse Pb basis representatives coarseEdge - have PbGround := M.transitive profilesGround coarseChosen.1 - obtain ⟨_testedGround, _testedFilter, _testedAbove, generators, hGenerators, - smallGenerators, nonemptyGenerators, generatorsSubset, _coinitial, generated⟩ := - fulfilled.tested_filter_generators infinite choice smallD irreflexive PbGround - (profileFilters Pb coarseChosen.1) (s.encode_mem E) - obtain ⟨r, rBelowQ0, rowR, lowerA, rCode, preparedAt, D0, eBelow, nameSupport, rowBound, dataBound⟩ := - fulfilled.prepared_prefix_term_bound collection infinite choice small smallD irreflexive - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace alpha member E u hu q0 - have decisionsAt : ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F ∈ M.certificateProfileImage J s.carrier N k ∧ - M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val r := by - intro z F B f edge - have chosen := decisions z F B f edge - refine ⟨chosen.1, fun v => ⟨?_, ?_⟩⟩ - · intro yes - exact Name.forcesMem_mono ((chosen.2.2.1 v).1 yes) rBelowQ0 - · intro no p pr - exact (chosen.2.2.1 v).2 no p (pr.trans rBelowQ0) - refine ⟨hJ, smallJ, k, hk, function, profilesGround, profilesSmall, profileFilters, - Pb, basis, representatives, coarseEdge, coarseChosen.1, generators, hGenerators, - smallGenerators, nonemptyGenerators, generatorsSubset, generated, r, rBelowQ0.trans q0Below, - rowR, lowerA, rCode, preparedAt, D0, eBelow, nameSupport, rowBound, dataBound, - (decisionsAt coarse Pb basis representatives coarseEdge).2, decisionsAt, ?_⟩ - intro v w hv hw old - obtain ⟨_, _, _, _, _, _, _, _, exactJ⟩ := - M.semanticStructuralPrefix_augmentedClassRequests c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice condition V E U Rf Rc u inI hu - have fineMember : (Name.refinementClass lifted localValid Rf.val w.val).val ∈ J := - (exactJ _).2 (Or.inr ⟨v.val, w.val, hv, hw, old, rfl⟩) - let fine : (M.nameDomain lower).names := - ⟨Name.refinementClass lifted localValid Rf.val w.val, M.transitive hJ fineMember⟩ - obtain ⟨value, edge, _unique⟩ := function.2 fine.val.val fineMember - have bound := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 - obtain ⟨F, _hF, tail, hTail, rfl⟩ := ZFSet.mem_prod.1 bound - obtain ⟨B, _hB, f, _hf, rfl⟩ := ZFSet.mem_prod.1 hTail - exact ⟨F, B, f, edge, decisionsAt fine F B f edge⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPreparedPrefixBounds + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem augmented_profile_family + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted stages packed → + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → + ∀ p : SetMembers Q, + let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val + let N := M.niceSupportNameCodes localAct lower lifted a.principalFix + J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ + ∃ (validJ : ∀ z ∈ J, IsName lower z) (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) ∧ H.GenericFor (formulaFamily (M.nameDomain lower)) ∧ + ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ + k ⊆ M.supportedCertificateFamilyRelation localAct lower s lifted a.principalFix + geometry.order J validJ H ∧ + ∃ q, H.mem q ∧ q ≤ p ∧ + let Profiles := M.certificateProfileImage J s.carrier N k + Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ + (∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ + ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F ∈ Profiles ∧ B.Nonempty ∧ + M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val q ∧ + (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ N → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) := by + intro geometry + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + intro s b a directed hL hG hC order graph nodeMaps supports + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 + closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + coordinates two carrier forcingOrder forcingAction omega topMem topRows packed + alpha member hAlpha cutOrdinal subset lowerPacked Q + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + intro historyRun + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + intro lower localAct localValid row A condition V E U Rf Rc u idx inI hu p J N + have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice + coordinates two + obtain ⟨lowerGround, lowerOrder, maps, lowerClosed, terms, children⟩ := + M.semanticStructuralPrefix_preparation_inputs c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice rowClosed + obtain ⟨_, _, hJ, smallJ, validJ, _, facts, _, _⟩ := + M.semanticStructuralPrefix_augmentedClassRequests c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice condition V E U Rf Rc u inI hu + obtain ⟨H, hp, coded, ordinary, _symmetric⟩ := M.exists_joint_generic lower localAct + (a.principalSupportFamily ⊥ directed) small lowerGround p + have descent := fulfilled.structural_prefix_descent collection infinite choice small smallD irreflexive + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace alpha member H coded ordinary + obtain ⟨k, hk, function, selected, q, hq, qp, _forced, decisions⟩ := + fulfilled.exists_forcedSupportedCertificateFamily lower collection infinite choice lowerGround lowerOrder + small lowerClosed smallD irreflexive localAct maps lifted hLifted localValid terms children + H coded ordinary descent J hJ validJ smallJ (fun z hz => (facts z hz).1) + (fun z hz => (facts z hz).2.2.2 H) p hp + have codesGround : N ∈ M.sets := M.niceSupportNameCodes_mem localAct lower s lifted a.principalFix b + pairing unions powers separation collection lowerGround hG hL supports maps hLifted localValid + obtain ⟨profilesGround, profilesSmall⟩ := M.certificateProfileImage_mem_small pairing unions powers + separation choice hJ hL codesGround hk omega function smallJ + refine ⟨hJ, smallJ, validJ, H, coded, ordinary, k, hk, function, selected, q, hq, qp, + profilesGround, profilesSmall, ?_, ?_⟩ + · intro F memberF + obtain ⟨z, B, f, entry⟩ := (M.mem_certificateProfileImage function F).1 memberF + have hz := (ZFSet.pair_mem_prod.1 (function.1 entry)).1 + let name : (M.nameDomain lower).names := ⟨⟨z, validJ z hz⟩, M.transitive hJ hz⟩ + exact (decisions name F B f entry).2.1 + · intro z F B f entry + have chosen := decisions z F B f entry + exact ⟨(M.mem_certificateProfileImage function F).2 ⟨z.val.val, B, f, entry⟩, + chosen.2.2.1, chosen.2.2.2.1, chosen.2.2.2.2.1⟩ + + + + + + +theorem prepared_augmented_profiles + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted stages packed → + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → + ∀ r0 : SetMembers Q, + let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val + let N := M.niceSupportNameCodes localAct lower lifted a.principalFix + let Profiles (k : ZFSet.{u}) := M.certificateProfileImage J s.carrier N k + let prefixIndices := refinementDataHistoryIndices alpha lowerPacked + let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid + J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ + ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ + Profiles k ∈ M.sets ∧ M.groundEmbeddable (Profiles k) ZFSet.omega ∧ + (∀ F ∈ Profiles k, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ + ∃ Pb basis representatives, + ZFSet.pair (Name.refinementClass lifted localValid Rc.val u.val).val + (ZFSet.pair Pb (ZFSet.pair basis representatives)) ∈ k ∧ Pb ∈ Profiles k ∧ + ∃ generators ∈ M.sets, M.groundEmbeddable generators ZFSet.omega ∧ generators.Nonempty ∧ + generators ⊆ testedMeetFilter Pb geometry.order (s.encode E) ∧ + M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators = + testedMeetFilter Pb geometry.order (s.encode E) ∧ + ∃ r : SetMembers Q, r ≤ r0 ∧ + ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), + lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ + StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ + ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ + a.principalFix D0 ≤ localAct.stabilizer lower u.val ∧ + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ + (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ + stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier + s.conditionOrder prefixAnchors tuples) ∧ + M.DecidesVisibilityProfile localAct lower s a.principalFix lifted Pb + (Name.refinementClass lifted localValid Rc.val u.val) r ∧ + (∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F ∈ Profiles k ∧ M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val r) ∧ + ∀ v w : (M.nameDomain lower).names, v.val.val ∈ lifted → w.val.val ∈ lifted → + stageOneAssignment idx v.val.val w.val.val ∈ A → + ∃ F B f, ZFSet.pair (Name.refinementClass lifted localValid Rf.val w.val).val + (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ F ∈ Profiles k ∧ + M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F + (Name.refinementClass lifted localValid Rf.val w.val) r := by + intro geometry + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + intro s b a directed hL hG hC order graph nodeMaps supports + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 + closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + coordinates two carrier forcingOrder forcingAction omega topMem topRows packed + alpha member hAlpha cutOrdinal subset lowerPacked Q + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + intro historyRun + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + intro lower localAct localValid row A condition V E U Rf Rc u idx inI hu r0 J N + Profiles prefixIndices prefixAnchors tuples + obtain ⟨hJ, smallJ, validJ, H, _coded, _ordinary, k, hk, function, _selected, + q0, _hq0, q0Below, profilesGround, profilesSmall, profileFilters, decisions⟩ := + fulfilled.augmented_profile_family collection infinite choice small smallD irreflexive + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace alpha member + row A condition V E U Rf Rc u inI hu r0 + have coarseMember : (Name.refinementClass lifted localValid Rc.val u.val).val ∈ J := + ZFSet.mem_insert _ _ + let coarse : (M.nameDomain lower).names := + ⟨Name.refinementClass lifted localValid Rc.val u.val, M.transitive hJ coarseMember⟩ + obtain ⟨coarseValue, coarseEdge, _coarseUnique⟩ := function.2 coarse.val.val coarseMember + have coarseBound := (ZFSet.pair_mem_prod.1 (function.1 coarseEdge)).2 + obtain ⟨Pb, _hPb, tail, hTail, rfl⟩ := ZFSet.mem_prod.1 coarseBound + obtain ⟨basis, _hBasis, representatives, _hRepresentatives, rfl⟩ := ZFSet.mem_prod.1 hTail + have coarseChosen := decisions coarse Pb basis representatives coarseEdge + have PbGround := M.transitive profilesGround coarseChosen.1 + obtain ⟨_testedGround, _testedFilter, _testedAbove, generators, hGenerators, + smallGenerators, nonemptyGenerators, generatorsSubset, _coinitial, generated⟩ := + fulfilled.tested_filter_generators infinite choice smallD irreflexive PbGround + (profileFilters Pb coarseChosen.1) (s.encode_mem E) + obtain ⟨r, rBelowQ0, rowR, lowerA, rCode, preparedAt, D0, eBelow, nameSupport, rowBound, dataBound⟩ := + fulfilled.prepared_prefix_term_bound collection infinite choice small smallD irreflexive + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace alpha member E u hu q0 + have decisionsAt : ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F ∈ M.certificateProfileImage J s.carrier N k ∧ + M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val r := by + intro z F B f edge + have chosen := decisions z F B f edge + refine ⟨chosen.1, fun v => ⟨?_, ?_⟩⟩ + · intro yes + exact Name.forcesMem_mono ((chosen.2.2.1 v).1 yes) rBelowQ0 + · intro no p pr + exact (chosen.2.2.1 v).2 no p (pr.trans rBelowQ0) + refine ⟨hJ, smallJ, k, hk, function, profilesGround, profilesSmall, profileFilters, + Pb, basis, representatives, coarseEdge, coarseChosen.1, generators, hGenerators, + smallGenerators, nonemptyGenerators, generatorsSubset, generated, r, rBelowQ0.trans q0Below, + rowR, lowerA, rCode, preparedAt, D0, eBelow, nameSupport, rowBound, dataBound, + (decisionsAt coarse Pb basis representatives coarseEdge).2, decisionsAt, ?_⟩ + intro v w hv hw old + obtain ⟨_, _, _, _, _, _, _, _, exactJ⟩ := + M.semanticStructuralPrefix_augmentedClassRequests c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice condition V E U Rf Rc u inI hu + have fineMember : (Name.refinementClass lifted localValid Rf.val w.val).val ∈ J := + (exactJ _).2 (Or.inr ⟨v.val, w.val, hv, hw, old, rfl⟩) + let fine : (M.nameDomain lower).names := + ⟨Name.refinementClass lifted localValid Rf.val w.val, M.transitive hJ fineMember⟩ + obtain ⟨value, edge, _unique⟩ := function.2 fine.val.val fineMember + have bound := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 + obtain ⟨F, _hF, tail, hTail, rfl⟩ := ZFSet.mem_prod.1 bound + obtain ⟨B, _hB, f, _hf, rfl⟩ := ZFSet.mem_prod.1 hTail + exact ⟨F, B, f, edge, decisionsAt fine F B f edge⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRefinementSystem.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRefinementSystem.lean index ac91cedeb15c04549683e0f9578ec7eceae122d5..ce1ad87c6658c2662302e28970a338a4cc83f4bb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRefinementSystem.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRefinementSystem.lean @@ -1,111 +1,111 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairEmptyRefinementSystem -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZF - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowRefinementSystem - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1 ∧ - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2 ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground order action - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, _, _, _, _, _, _, _, stageTerms⟩ := - fulfilled.exists_rowTermSystem collection infinite choice hK standard indices - obtain ⟨ground, below, valid, children, _⟩ := stageTerms 0 - have closed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, ?_⟩ - exact M.pairEmpty_refinementSystem act c b s a ⊥ directed pairing unions powers separation collection - carrier forcingOrder geometry.actors_ground geometry.carrier_ground order supports forcingAction - _ ground valid closed children - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairEmptyRefinementSystem +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZF + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowRefinementSystem + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1 ∧ + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2 ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground order action + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, _, _, _, _, _, _, _, stageTerms⟩ := + fulfilled.exists_rowTermSystem collection infinite choice hK standard indices + obtain ⟨ground, below, valid, children, _⟩ := stageTerms 0 + have closed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, ?_⟩ + exact M.pairEmpty_refinementSystem act c b s a ⊥ directed pairing unions powers separation collection + carrier forcingOrder geometry.actors_ground geometry.carrier_ground order supports forcingAction + _ ground valid closed children + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowModelDescent.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowModelDescent.lean index 18e00536a32d76043a232bd8e53a4b5177fa5218..6a9a3383cddef2c8376279460aac0a51811d9072 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowModelDescent.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowModelDescent.lean @@ -1,318 +1,318 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralCommonSupportInduction - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) -include fulfilled - -theorem internalRow_rectangle_refinement - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) - (V W d : SetMembers geometry.carrier) (x y : Name c), - (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d) → - V ≤ d → W ≤ d → - a.principalFix V ≤ act.stabilizer c x → a.principalFix W ≤ act.stabilizer c y → - ∀ (g₁ g₂ : SetMembers geometry.actors), - g₁ ∈ a.principalFix (geometry.meet.smallMeet V W) → - g₂ ∈ a.principalFix (geometry.meet.smallMeet V W) → - geometry.meet.smallMeet (a.iso g₁ d) (a.iso g₂ d) = geometry.meet.smallMeet V W → - ∀ r, r ≤ act.iso g₁ p → r ≤ act.iso g₂ p → - DenseBelow r (act.RectangleWitness c p x y g₁ g₂) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - dsimp only - intro p V W d x y bp vd wd sx sy g₁ g₂ fixed₁ fixed₂ separated r ref₁ ref₂ q qr - obtain ⟨X, upper₁, upper₂, bq⟩ := fulfilled.internalRow_bounds_with infinite choice columns hColumns - q (a.iso g₁ d) (a.iso g₂ d) - have request := geometry.decoded_rectangle_request V W d g₁ g₂ vd wd fixed₁ fixed₂ separated - obtain ⟨h₁, h₂, rectangle, t, _, tq, th₁, th₂⟩ := fulfilled.internalRow_rectangle_union - infinite choice columns hColumns p q d X V W g₁ g₂ request upper₁ upper₂ bp bq - (le_trans qr ref₁) (le_trans qr ref₂) - have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) - (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action - (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : - ∀ i, i ≤ v → a.iso g i = a.iso h i := by - intro i lower - apply SetMembers.raw_injective - exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) - lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) - let geom := geometry.action_code.toOrderAction geometry.group_code geometry.meet - exact ⟨t, tq, h₁, h₂, th₁, th₂, - act.act_eq_of_support_agreement geom c sx (agree h₁ g₁ V rectangle.first_agreement), - act.act_eq_of_support_agreement geom c sx (agree h₂ g₂ V rectangle.second_agreement), - act.act_eq_of_support_agreement geom c sy (agree h₁ h₂ W rectangle.common_agreement)⟩ - -theorem internalRow_separation_refinement - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) - (W d : SetMembers geometry.carrier), - (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d) → - W ≤ d → ∀ (g₁ g₂ : SetMembers geometry.actors), - g₁ ∈ a.principalFix W → g₂ ∈ a.principalFix W → - ∀ r, r ≤ act.iso g₁ p → - DenseBelow r (act.SeparationWitness (a.principalFix W) - (fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = W) p g₁ g₂) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - dsimp only - intro p W d bp wd g₁ g₂ fixed₁ fixed₂ r ref₁ q qr - obtain ⟨X, upper₁, upper₂, bq⟩ := fulfilled.internalRow_bounds_with infinite choice columns hColumns - q (a.iso g₁ d) (a.iso g₂ d) - have fixedLower (g : SetMembers geometry.actors) (fixed : g ∈ a.principalFix W) : - W ≤ a.iso g d := by - have lower := (a.iso g).monotone wd - rw [fixed W le_rfl] at lower - exact lower - have lower₁ := fixedLower g₁ fixed₁ - have lower₂ := fixedLower g₂ fixed₂ - obtain ⟨h, fixed, overlap⟩ := fulfilled.decoded_separate_at W d X wd (le_trans lower₁ upper₁) - have overlap' : ∀ i, i ≤ a.iso h d → i ≤ X → i ≤ a.iso h W := by - intro i ih ix - rw [fixed W le_rfl, ← overlap] - exact geometry.meet.toSmallMeetOrder.le_meet ih ix - obtain ⟨t, _, tq, th⟩ := M.internalRowAction_one_copy_union a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) choice p q d X W g₁ h - bp bq (le_trans qr ref₁) overlap' (fun z hz => (fixed z hz).trans (fixed₁ z hz).symm) - have sep (Y : SetMembers geometry.carrier) (wy : W ≤ Y) (yx : Y ≤ X) : - geometry.meet.smallMeet (a.iso h d) Y = W := by - apply le_antisymm - · rw [← overlap] - exact geometry.meet.toSmallMeetOrder.le_meet - (geometry.meet.toSmallMeetOrder.meet_le_left _ _) - (le_trans (geometry.meet.toSmallMeetOrder.meet_le_right _ _) yx) - · exact geometry.meet.toSmallMeetOrder.le_meet (fixedLower h fixed) wy - exact ⟨t, tq, h, fixed, th, sep _ lower₁ upper₁, sep _ lower₂ upper₂⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem internalRow_common_support - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega))) - (_genericCoded : H.GenericFor (M.codedFamily c)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain c))) - (V W : SetMembers geometry.carrier) (x y : Name c) - (_hx : x.val ∈ M.sets) (_hy : y.val ∈ M.sets) - (_sx : a.principalFix V ≤ act.stabilizer c x) - (_sy : a.principalFix W ≤ act.stabilizer c y) - (_hs : HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) x) - (_values : Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} y), - ∃ z : Name c, z.val ∈ M.sets ∧ - HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) z ∧ - a.principalFix (geometry.meet.smallMeet V W) ≤ act.stabilizer c z ∧ - Name.nameRank z ≤ Name.nameRank x ∧ - Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - dsimp only - intro H genericCoded genericFormula V W x y hx hy sx sy hs values - have coordinateGround := M.rowCoordinate_carrier_mem s columns pairing unions powers separation - geometry.carrier_ground hColumns - have bits := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround bits - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround bits - have actionGraph := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - have maps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation collection - carrier geometry.actors_ground actionGraph - have atoms : H.GenericFor (Name.atomicFamily (M.nameDomain c)) := - fun E hE dense => genericFormula E (Or.inl hE) dense - obtain ⟨p, hp, forced⟩ := (Name.eval_eq_iff_forcesEq (M.nameDomain c) H atoms hx hy).1 values - obtain ⟨d, vd, wd, bounds⟩ := fulfilled.internalRow_bounds_with infinite choice columns hColumns p V W - let meet := geometry.meet.smallMeet V W - let subgroup := a.principalFix meet - let apart := fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = meet - have meetBelow : meet ≤ d := - le_trans (geometry.meet.toSmallMeetOrder.meet_le_left V W) vd - have copies : H.GenericFor (act.copyWitnessFamily c subgroup apart p x y) := by - exact geometry.internalRow_copyWitness_generic pairing unions powers separation collection - infinite columns hColumns p x y hx hy meet d H genericCoded - have translated : ∀ g, H.mem (act.iso g p) → - Name.eval {q | H.mem q} (act.act c g x) = Name.eval {q | H.mem q} (act.act c g y) := by - intro g active - exact Name.forcesEq_sound (M.nameDomain c) H atoms _ - (M.act_mem c act b pairing unions powers separation collection carrier maps g x hx) _ - (M.act_mem c act b pairing unions powers separation collection carrier maps g y hy) - _ active (act.forcesEq_act c g forced) - have captured := act.mix_capture_from_refinements c subgroup apart p x y H copies hp translated - (by - intro g₁ hg₁ g₂ hg₂ separated r ref₁ ref₂ - exact fulfilled.internalRow_rectangle_refinement infinite choice columns hColumns p V W d x y - bounds vd wd sx sy g₁ g₂ hg₁ hg₂ separated r ref₁ ref₂) - (by - intro g₁ hg₁ g₂ hg₂ r ref₁ _ - exact fulfilled.internalRow_separation_refinement infinite choice columns hColumns p meet d - bounds meetBelow g₁ g₂ hg₁ hg₂ r ref₁) - refine ⟨act.mix c subgroup p x, - M.basis_mix_mem b s a.principalFix act c pairing unions powers separation collection carrier order - geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) maps meet p x hx, - act.mix_hs c (a.principalSupportFamily ⊥ directed) subgroup ⟨meet, le_rfl⟩ p hs, - ?_, act.nameRank_mix_le c subgroup p x, captured⟩ - intro g hg - exact act.mix_fixed c subgroup p x hg - -theorem exists_rowModel_with_descent - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∀ p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 ∧ - ∀ (V W : SetMembers geometry.carrier) (x y : (M.nameDomain c).names), - a.principalFix V ≤ act.stabilizer c x.val → - a.principalFix W ≤ act.stabilizer c y.val → - HereditarilySymmetric act c F x.val → - Name.eval {q | H.mem q} x.val = Name.eval {q | H.mem q} y.val → - ∃ z : (M.nameDomain c).names, HereditarilySymmetric act c F z.val ∧ - a.principalFix (geometry.meet.smallMeet V W) ≤ act.stabilizer c z.val ∧ - Name.nameRank z.val ≤ Name.nameRank x.val ∧ - Name.eval {q | H.mem q} z.val = Name.eval {q | H.mem q} x.val := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - dsimp only - intro p - obtain ⟨H, hp, coded, ordinary, symmetric, included, zf, notChoice⟩ := - fulfilled.exists_rowModel collection infinite groundChoice small p - refine ⟨H, hp, coded, ordinary, symmetric, included, zf, notChoice, ?_⟩ - intro V W x y sx sy hs values - obtain ⟨z, hz, symmetricZ, support, rank, equal⟩ := fulfilled.internalRow_common_support - collection infinite groundChoice columns hColumns H coded ordinary V W x.val y.val - x.property y.property sx sy hs values - exact ⟨⟨z, hz⟩, symmetricZ, support, rank, equal⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralCommonSupportInduction + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) +include fulfilled + +theorem internalRow_rectangle_refinement + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) + (V W d : SetMembers geometry.carrier) (x y : Name c), + (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d) → + V ≤ d → W ≤ d → + a.principalFix V ≤ act.stabilizer c x → a.principalFix W ≤ act.stabilizer c y → + ∀ (g₁ g₂ : SetMembers geometry.actors), + g₁ ∈ a.principalFix (geometry.meet.smallMeet V W) → + g₂ ∈ a.principalFix (geometry.meet.smallMeet V W) → + geometry.meet.smallMeet (a.iso g₁ d) (a.iso g₂ d) = geometry.meet.smallMeet V W → + ∀ r, r ≤ act.iso g₁ p → r ≤ act.iso g₂ p → + DenseBelow r (act.RectangleWitness c p x y g₁ g₂) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + dsimp only + intro p V W d x y bp vd wd sx sy g₁ g₂ fixed₁ fixed₂ separated r ref₁ ref₂ q qr + obtain ⟨X, upper₁, upper₂, bq⟩ := fulfilled.internalRow_bounds_with infinite choice columns hColumns + q (a.iso g₁ d) (a.iso g₂ d) + have request := geometry.decoded_rectangle_request V W d g₁ g₂ vd wd fixed₁ fixed₂ separated + obtain ⟨h₁, h₂, rectangle, t, _, tq, th₁, th₂⟩ := fulfilled.internalRow_rectangle_union + infinite choice columns hColumns p q d X V W g₁ g₂ request upper₁ upper₂ bp bq + (le_trans qr ref₁) (le_trans qr ref₂) + have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) + (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action + (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : + ∀ i, i ≤ v → a.iso g i = a.iso h i := by + intro i lower + apply SetMembers.raw_injective + exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) + lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) + let geom := geometry.action_code.toOrderAction geometry.group_code geometry.meet + exact ⟨t, tq, h₁, h₂, th₁, th₂, + act.act_eq_of_support_agreement geom c sx (agree h₁ g₁ V rectangle.first_agreement), + act.act_eq_of_support_agreement geom c sx (agree h₂ g₂ V rectangle.second_agreement), + act.act_eq_of_support_agreement geom c sy (agree h₁ h₂ W rectangle.common_agreement)⟩ + +theorem internalRow_separation_refinement + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) + (W d : SetMembers geometry.carrier), + (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d) → + W ≤ d → ∀ (g₁ g₂ : SetMembers geometry.actors), + g₁ ∈ a.principalFix W → g₂ ∈ a.principalFix W → + ∀ r, r ≤ act.iso g₁ p → + DenseBelow r (act.SeparationWitness (a.principalFix W) + (fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = W) p g₁ g₂) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + dsimp only + intro p W d bp wd g₁ g₂ fixed₁ fixed₂ r ref₁ q qr + obtain ⟨X, upper₁, upper₂, bq⟩ := fulfilled.internalRow_bounds_with infinite choice columns hColumns + q (a.iso g₁ d) (a.iso g₂ d) + have fixedLower (g : SetMembers geometry.actors) (fixed : g ∈ a.principalFix W) : + W ≤ a.iso g d := by + have lower := (a.iso g).monotone wd + rw [fixed W le_rfl] at lower + exact lower + have lower₁ := fixedLower g₁ fixed₁ + have lower₂ := fixedLower g₂ fixed₂ + obtain ⟨h, fixed, overlap⟩ := fulfilled.decoded_separate_at W d X wd (le_trans lower₁ upper₁) + have overlap' : ∀ i, i ≤ a.iso h d → i ≤ X → i ≤ a.iso h W := by + intro i ih ix + rw [fixed W le_rfl, ← overlap] + exact geometry.meet.toSmallMeetOrder.le_meet ih ix + obtain ⟨t, _, tq, th⟩ := M.internalRowAction_one_copy_union a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) choice p q d X W g₁ h + bp bq (le_trans qr ref₁) overlap' (fun z hz => (fixed z hz).trans (fixed₁ z hz).symm) + have sep (Y : SetMembers geometry.carrier) (wy : W ≤ Y) (yx : Y ≤ X) : + geometry.meet.smallMeet (a.iso h d) Y = W := by + apply le_antisymm + · rw [← overlap] + exact geometry.meet.toSmallMeetOrder.le_meet + (geometry.meet.toSmallMeetOrder.meet_le_left _ _) + (le_trans (geometry.meet.toSmallMeetOrder.meet_le_right _ _) yx) + · exact geometry.meet.toSmallMeetOrder.le_meet (fixedLower h fixed) wy + exact ⟨t, tq, h, fixed, th, sep _ lower₁ upper₁, sep _ lower₂ upper₂⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem internalRow_common_support + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + ∀ (H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega))) + (_genericCoded : H.GenericFor (M.codedFamily c)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain c))) + (V W : SetMembers geometry.carrier) (x y : Name c) + (_hx : x.val ∈ M.sets) (_hy : y.val ∈ M.sets) + (_sx : a.principalFix V ≤ act.stabilizer c x) + (_sy : a.principalFix W ≤ act.stabilizer c y) + (_hs : HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) x) + (_values : Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} y), + ∃ z : Name c, z.val ∈ M.sets ∧ + HereditarilySymmetric act c (a.principalSupportFamily ⊥ directed) z ∧ + a.principalFix (geometry.meet.smallMeet V W) ≤ act.stabilizer c z ∧ + Name.nameRank z ≤ Name.nameRank x ∧ + Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + dsimp only + intro H genericCoded genericFormula V W x y hx hy sx sy hs values + have coordinateGround := M.rowCoordinate_carrier_mem s columns pairing unions powers separation + geometry.carrier_ground hColumns + have bits := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround bits + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround bits + have actionGraph := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + have maps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation collection + carrier geometry.actors_ground actionGraph + have atoms : H.GenericFor (Name.atomicFamily (M.nameDomain c)) := + fun E hE dense => genericFormula E (Or.inl hE) dense + obtain ⟨p, hp, forced⟩ := (Name.eval_eq_iff_forcesEq (M.nameDomain c) H atoms hx hy).1 values + obtain ⟨d, vd, wd, bounds⟩ := fulfilled.internalRow_bounds_with infinite choice columns hColumns p V W + let meet := geometry.meet.smallMeet V W + let subgroup := a.principalFix meet + let apart := fun g h => geometry.meet.smallMeet (a.iso g d) (a.iso h d) = meet + have meetBelow : meet ≤ d := + le_trans (geometry.meet.toSmallMeetOrder.meet_le_left V W) vd + have copies : H.GenericFor (act.copyWitnessFamily c subgroup apart p x y) := by + exact geometry.internalRow_copyWitness_generic pairing unions powers separation collection + infinite columns hColumns p x y hx hy meet d H genericCoded + have translated : ∀ g, H.mem (act.iso g p) → + Name.eval {q | H.mem q} (act.act c g x) = Name.eval {q | H.mem q} (act.act c g y) := by + intro g active + exact Name.forcesEq_sound (M.nameDomain c) H atoms _ + (M.act_mem c act b pairing unions powers separation collection carrier maps g x hx) _ + (M.act_mem c act b pairing unions powers separation collection carrier maps g y hy) + _ active (act.forcesEq_act c g forced) + have captured := act.mix_capture_from_refinements c subgroup apart p x y H copies hp translated + (by + intro g₁ hg₁ g₂ hg₂ separated r ref₁ ref₂ + exact fulfilled.internalRow_rectangle_refinement infinite choice columns hColumns p V W d x y + bounds vd wd sx sy g₁ g₂ hg₁ hg₂ separated r ref₁ ref₂) + (by + intro g₁ hg₁ g₂ hg₂ r ref₁ _ + exact fulfilled.internalRow_separation_refinement infinite choice columns hColumns p meet d + bounds meetBelow g₁ g₂ hg₁ hg₂ r ref₁) + refine ⟨act.mix c subgroup p x, + M.basis_mix_mem b s a.principalFix act c pairing unions powers separation collection carrier order + geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) maps meet p x hx, + act.mix_hs c (a.principalSupportFamily ⊥ directed) subgroup ⟨meet, le_rfl⟩ p hs, + ?_, act.nameRank_mix_le c subgroup p x, captured⟩ + intro g hg + exact act.mix_fixed c subgroup p x hg + +theorem exists_rowModel_with_descent + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∀ p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 ∧ + ∀ (V W : SetMembers geometry.carrier) (x y : (M.nameDomain c).names), + a.principalFix V ≤ act.stabilizer c x.val → + a.principalFix W ≤ act.stabilizer c y.val → + HereditarilySymmetric act c F x.val → + Name.eval {q | H.mem q} x.val = Name.eval {q | H.mem q} y.val → + ∃ z : (M.nameDomain c).names, HereditarilySymmetric act c F z.val ∧ + a.principalFix (geometry.meet.smallMeet V W) ≤ act.stabilizer c z.val ∧ + Name.nameRank z.val ≤ Name.nameRank x.val ∧ + Name.eval {q | H.mem q} z.val = Name.eval {q | H.mem q} x.val := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + dsimp only + intro p + obtain ⟨H, hp, coded, ordinary, symmetric, included, zf, notChoice⟩ := + fulfilled.exists_rowModel collection infinite groundChoice small p + refine ⟨H, hp, coded, ordinary, symmetric, included, zf, notChoice, ?_⟩ + intro V W x y sx sy hs values + obtain ⟨z, hz, symmetricZ, support, rank, equal⟩ := fulfilled.internalRow_common_support + collection infinite groundChoice columns hColumns H coded ordinary V W x.val y.val + x.property y.property sx sy hs values + exact ⟨⟨z, hz⟩, symmetricZ, support, rank, equal⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZF.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZF.lean index b65432a39558a09fb10b6061eb723284382c4bd8..190df795cf191775c3ceaedaa3741cea4d1940f5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZF.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZF.lean @@ -1,449 +1,449 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundInvariantNamePowers -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowTermSetNames -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFulfillmentConstruction -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionOrdinaryZFC -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionSequences - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundMainFinalGeometry -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -theorem decoded_directed - (directed : ∀ x ∈ geometry.carrier, ∀ y ∈ geometry.carrier, - ∃ z ∈ geometry.carrier, ZFSet.pair x z ∈ geometry.order ∧ - ZFSet.pair y z ∈ geometry.order) : - letI := geometry.meet.order.toPartialOrder - ∀ x y : SetMembers geometry.carrier, ∃ z, x ≤ z ∧ y ≤ z := by - let := geometry.meet.order.toPartialOrder - intro x y - obtain ⟨z, hz, xz, yz⟩ := directed _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) - refine ⟨SetMembers.ofMem z hz, ?_, ?_⟩ - · change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem z hz)) ∈ geometry.order - simpa only [SetMembers.raw_ofMem] using xz - · change ZFSet.pair (SetMembers.raw y) (SetMembers.raw (SetMembers.ofMem z hz)) ∈ geometry.order - simpa only [SetMembers.raw_ofMem] using yz - -theorem decoded_separating - (separate : ∀ B ∈ geometry.carrier, ∀ d ∈ geometry.carrier, - ZFSet.pair B d ∈ geometry.order → - ∃ k ∈ geometry.actors, - (∀ z ∈ geometry.carrier, ZFSet.pair z B ∈ geometry.order → - ZFSet.pair (ZFSet.pair k z) z ∈ geometry.action) ∧ - ∃ y ∈ geometry.carrier, ZFSet.pair (ZFSet.pair k d) y ∈ geometry.action ∧ - ZFSet.pair (ZFSet.pair y d) B ∈ geometry.meetGraph) : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - ∀ B d : SetMembers geometry.carrier, B ≤ d → - ∃ k : SetMembers geometry.actors, k ∈ geometry.decodedAction.principalFix B ∧ - ∀ x, x ≤ d → x ≤ geometry.decodedAction.iso k d → x ≤ B := by - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - intro B d bd - obtain ⟨k, hk, fixes, y, hy, action, meet⟩ := - separate _ (SetMembers.raw_mem B) _ (SetMembers.raw_mem d) bd - let actor := SetMembers.ofMem k hk - have acted : geometry.action_code.act actor d = SetMembers.ofMem y hy := by - apply (geometry.action_code.act_eq_iff _ _ _).2 - simpa only [actor, SetMembers.raw_ofMem] using action - refine ⟨actor, ?_, ?_⟩ - · intro z lower - change geometry.action_code.act actor z = z - apply (geometry.action_code.act_eq_iff _ _ _).2 - simpa only [actor, SetMembers.raw_ofMem] using fixes _ (SetMembers.raw_mem z) lower - · intro x xd xacted - change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (geometry.action_code.act actor d)) - ∈ geometry.order at xacted - rw [acted, SetMembers.raw_ofMem] at xacted - exact geometry.meet.greatest y (SetMembers.raw d) (SetMembers.raw B) - (SetMembers.raw x) (SetMembers.raw_mem x) meet xacted xd - -end GroundMainFinalGeometry - -namespace GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) -include fulfilled - -theorem internalRow_bounds_with - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : - let geometry := run.finalGeometry i₀ - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) - (X₁ X₂ : SetMembers geometry.carrier), - ∃ d : SetMembers geometry.carrier, X₁ ≤ d ∧ X₂ ≤ d ∧ - ∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d := by - let geometry := run.finalGeometry i₀ - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - dsimp only - intro p X₁ X₂ - have rows := M.countablePartialFunctions_rowSupport pairing unions powers separation infinite choice - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - (M.natSetCode_mem separation infinite 2) (SetMembers.raw_mem p) - have subset : rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) ⊆ - geometry.carrier := by - intro z hz - exact ((s.mem_nonbottom_carrier z).1 - (rowUsedRows_subset s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) hz)).1 - obtain ⟨d, hd, bound⟩ := (fulfilled.countable_localization _ rows.1 subset rows.2).2 - let first := SetMembers.ofMem d hd - obtain ⟨e, de, xe⟩ := geometry.decoded_directed fulfilled.directed first X₁ - obtain ⟨f, ef, yf⟩ := geometry.decoded_directed fulfilled.directed e X₂ - refine ⟨f, le_trans xe ef, yf, ?_⟩ - intro i hi - have lower : i.val ≤ first := by - change ZFSet.pair (SetMembers.raw i.val) (SetMembers.raw first) ∈ geometry.order - simpa only [s, SetMembers.presentation, first, SetMembers.raw_ofMem] using - bound (s.encode i.val) hi - exact le_trans lower (le_trans de ef) - -end GroundMainPrefix.FinalFulfillment - -namespace GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowModel - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∀ p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - dsimp only - intro p - have order : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - have graph : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - exact M.exists_internalRow_ZF_not_choice_groundOmegaOne a s b - (geometry.decoded_directed fulfilled.directed) - (geometry.decoded_unbounded fulfilled.growth) - (geometry.decoded_countable_bound - (fun X hX subset countable => (fulfilled.countable_localization X hX subset countable).2)) - (geometry.decoded_separating - (fun B hB d hd lower => fulfilled.separates B hB d hd d hd lower lower)) - small pairing unions powers separation collection infinite groundChoice - geometry.carrier_ground geometry.actors_ground order graph p - -theorem exists_rowTermSystem - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let family := rowTupleFamily (c.encode ⊤) mu s.nonbottom.carrier - (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier - (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - S ∈ M.sets ∧ GroundBelow M S K ∧ (∅ : ZFSet.{u}) ∈ S ∧ - family ∈ M.sets ∧ ZFSet.IsFunc S T family ∧ T ∈ M.sets ∧ GroundBelow M T K ∧ - ∀ n : Nat, let terms := iteratedPairNameFamily (c.encode ⊤) T n - terms ∈ M.sets ∧ GroundBelow M terms K ∧ - (∀ z ∈ terms, IsName c z) ∧ - (∀ σ : Name c, σ.val ∈ terms → HereditarilySymmetric act c supports σ) ∧ - ∃ τ : Name c, τ.val ∈ M.sets ∧ τ.val = ZFSet.prod terms {c.encode ⊤} ∧ - HereditarilySymmetric act c supports τ ∧ (∀ g, act.act c g τ = τ) ∧ - ∀ H : Set (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), ⊤ ∈ H → ∀ x, - x ∈ Name.eval H τ ↔ ∃ σ : Name c, σ.val ∈ terms ∧ Name.eval H σ = x := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) directed - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, hS, smallS, empty⟩ := - run.exists_finalRowPositionSequences i₀ collection infinite choice hK standard indices - have sequenceEqual := congrArg - (fun r => M.rowPositionSequences s.carrier r s.nonbottom.carrier mu) geometry.decoded_order_eq - have groundS := (congrArg (fun A => A ∈ M.sets) sequenceEqual).mpr hS - have belowS := (congrArg (fun A => GroundBelow M A K) sequenceEqual).mpr smallS - have emptyS := (congrArg (fun A => (∅ : ZFSet.{u}) ∈ A) sequenceEqual).mpr empty - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, groundS, belowS, emptyS, ?_⟩ - have hI := M.nonbottom_carrier_mem s separation geometry.carrier_ground - obtain ⟨family, _, function, smallT⟩ := - M.binaryRowTupleTerms_mem_below pairing unions powers separation collection infinite choice - geometry.carrier_ground order hI hColumns hmu hK belowS ⊤ - have base := M.binaryRowTermSetName_exists a s b columns pairing unions powers separation collection infinite - geometry.carrier_ground hColumns geometry.actors_ground action order directed hmu cardinal.1 - have hT := base.1 - have each := M.binaryRowTupleTerms_hs a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action directed hmu cardinal.1 - have closed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 - have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hColumns) (M.natSetCode_mem separation infinite 2) - refine ⟨family, function, hT, smallT, ?_⟩ - apply M.invariantNamePowers act c supports pairing unions powers separation infinite choice - (M.transitive hQ (c.encode_mem ⊤)) hT hK standard smallT - · intro z hz - obtain ⟨τ, equal, _⟩ := each z hz - exact equal ▸ τ.property - · exact closed - · intro σ hσ - obtain ⟨τ, equal, hs⟩ := each σ.val hσ - have same : τ = σ := Subtype.ext equal - exact same ▸ hs - -include fulfilled - -theorem decoded_strict_growth : - let geometry := run.finalGeometry i₀ - letI := geometry.meet.order.toPartialOrder - ∀ x : SetMembers geometry.carrier, ∃ y : SetMembers geometry.carrier, x < y := by - let geometry := run.finalGeometry i₀ - let := geometry.meet.order.toPartialOrder - dsimp only - intro x - obtain ⟨y, hy, lower, strict⟩ := fulfilled.growth _ (SetMembers.raw_mem x) - refine ⟨SetMembers.ofMem y hy, lt_iff_le_not_ge.2 ⟨?_, ?_⟩⟩ - · change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem y hy)) - ∈ geometry.order - simpa only [SetMembers.raw_ofMem] using lower - · change ¬ ZFSet.pair (SetMembers.raw (SetMembers.ofMem y hy)) (SetMembers.raw x) - ∈ geometry.order - simpa only [SetMembers.raw_ofMem] using strict - -theorem exists_commonPrincipalSupport_strict_extension : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let directed := geometry.decoded_directed fulfilled.directed - ∀ {P : Type u} [PartialOrder P] (a : PosetAction (SetMembers geometry.actors) P) - (s : Presentation P) {n : Nat} (tau : Fin n → Name s), - (∀ i, HereditarilySymmetric a s - (geometry.decodedAction.principalSupportFamily ⊥ directed) (tau i)) → - ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ - ∀ i, geometry.decodedAction.principalFix C ≤ a.stabilizer s (tau i) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro P inst a s n tau symmetric - obtain ⟨C, hC, fixed⟩ := Name.exists_commonPrincipalNameSupport a s geometry.decodedAction - ⊥ directed tau (fun i => (symmetric i).symmetric) - obtain ⟨E, strict⟩ := fulfilled.decoded_strict_growth C - exact ⟨C, E, hC, strict, fixed⟩ - -end GroundMainPrefix.FinalFulfillment - -namespace GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowModel_sequenceReflection - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∀ p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 ∧ - ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension c H) U := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - dsimp only - intro p - obtain ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice⟩ := - fulfilled.exists_rowModel collection infinite groundChoice small p - refine ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, ?_⟩ - intro U hU - exact M.countableFunction_sequenceReflection pairing unions powers separation collection infinite - groundChoice small - (M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns) - (M.natSetCode_mem separation infinite 2) hU H coded ordinary - -theorem exists_rowModel_ordinaryZF - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∀ p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 ∧ - ZFRealization (M.ordinaryExtension c H).sets ∧ - CollectionSchema (M.ordinaryExtension c H).sets ∧ - ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension c H) U := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - dsimp only - intro p - obtain ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, reflection⟩ := - fulfilled.exists_rowModel_sequenceReflection collection infinite groundChoice small p - have axioms := M.countableFunction_ordinaryZF pairing unions powers separation collection infinite - (M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns) - (M.natSetCode_mem separation infinite 2) H ordinary - exact ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, axioms.1, axioms.2, reflection⟩ - -end GroundMainPrefix.FinalFulfillment - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundInvariantNamePowers +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowTermSetNames +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFulfillmentConstruction +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionOrdinaryZFC +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionSequences + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundMainFinalGeometry +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +theorem decoded_directed + (directed : ∀ x ∈ geometry.carrier, ∀ y ∈ geometry.carrier, + ∃ z ∈ geometry.carrier, ZFSet.pair x z ∈ geometry.order ∧ + ZFSet.pair y z ∈ geometry.order) : + letI := geometry.meet.order.toPartialOrder + ∀ x y : SetMembers geometry.carrier, ∃ z, x ≤ z ∧ y ≤ z := by + let := geometry.meet.order.toPartialOrder + intro x y + obtain ⟨z, hz, xz, yz⟩ := directed _ (SetMembers.raw_mem x) _ (SetMembers.raw_mem y) + refine ⟨SetMembers.ofMem z hz, ?_, ?_⟩ + · change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem z hz)) ∈ geometry.order + simpa only [SetMembers.raw_ofMem] using xz + · change ZFSet.pair (SetMembers.raw y) (SetMembers.raw (SetMembers.ofMem z hz)) ∈ geometry.order + simpa only [SetMembers.raw_ofMem] using yz + +theorem decoded_separating + (separate : ∀ B ∈ geometry.carrier, ∀ d ∈ geometry.carrier, + ZFSet.pair B d ∈ geometry.order → + ∃ k ∈ geometry.actors, + (∀ z ∈ geometry.carrier, ZFSet.pair z B ∈ geometry.order → + ZFSet.pair (ZFSet.pair k z) z ∈ geometry.action) ∧ + ∃ y ∈ geometry.carrier, ZFSet.pair (ZFSet.pair k d) y ∈ geometry.action ∧ + ZFSet.pair (ZFSet.pair y d) B ∈ geometry.meetGraph) : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + ∀ B d : SetMembers geometry.carrier, B ≤ d → + ∃ k : SetMembers geometry.actors, k ∈ geometry.decodedAction.principalFix B ∧ + ∀ x, x ≤ d → x ≤ geometry.decodedAction.iso k d → x ≤ B := by + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + intro B d bd + obtain ⟨k, hk, fixes, y, hy, action, meet⟩ := + separate _ (SetMembers.raw_mem B) _ (SetMembers.raw_mem d) bd + let actor := SetMembers.ofMem k hk + have acted : geometry.action_code.act actor d = SetMembers.ofMem y hy := by + apply (geometry.action_code.act_eq_iff _ _ _).2 + simpa only [actor, SetMembers.raw_ofMem] using action + refine ⟨actor, ?_, ?_⟩ + · intro z lower + change geometry.action_code.act actor z = z + apply (geometry.action_code.act_eq_iff _ _ _).2 + simpa only [actor, SetMembers.raw_ofMem] using fixes _ (SetMembers.raw_mem z) lower + · intro x xd xacted + change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (geometry.action_code.act actor d)) + ∈ geometry.order at xacted + rw [acted, SetMembers.raw_ofMem] at xacted + exact geometry.meet.greatest y (SetMembers.raw d) (SetMembers.raw B) + (SetMembers.raw x) (SetMembers.raw_mem x) meet xacted xd + +end GroundMainFinalGeometry + +namespace GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) +include fulfilled + +theorem internalRow_bounds_with + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : + let geometry := run.finalGeometry i₀ + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) + (X₁ X₂ : SetMembers geometry.carrier), + ∃ d : SetMembers geometry.carrier, X₁ ≤ d ∧ X₂ ≤ d ∧ + ∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d := by + let geometry := run.finalGeometry i₀ + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + dsimp only + intro p X₁ X₂ + have rows := M.countablePartialFunctions_rowSupport pairing unions powers separation infinite choice + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + (M.natSetCode_mem separation infinite 2) (SetMembers.raw_mem p) + have subset : rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) ⊆ + geometry.carrier := by + intro z hz + exact ((s.mem_nonbottom_carrier z).1 + (rowUsedRows_subset s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) hz)).1 + obtain ⟨d, hd, bound⟩ := (fulfilled.countable_localization _ rows.1 subset rows.2).2 + let first := SetMembers.ofMem d hd + obtain ⟨e, de, xe⟩ := geometry.decoded_directed fulfilled.directed first X₁ + obtain ⟨f, ef, yf⟩ := geometry.decoded_directed fulfilled.directed e X₂ + refine ⟨f, le_trans xe ef, yf, ?_⟩ + intro i hi + have lower : i.val ≤ first := by + change ZFSet.pair (SetMembers.raw i.val) (SetMembers.raw first) ∈ geometry.order + simpa only [s, SetMembers.presentation, first, SetMembers.raw_ofMem] using + bound (s.encode i.val) hi + exact le_trans lower (le_trans de ef) + +end GroundMainPrefix.FinalFulfillment + +namespace GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowModel + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∀ p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + dsimp only + intro p + have order : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + have graph : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + exact M.exists_internalRow_ZF_not_choice_groundOmegaOne a s b + (geometry.decoded_directed fulfilled.directed) + (geometry.decoded_unbounded fulfilled.growth) + (geometry.decoded_countable_bound + (fun X hX subset countable => (fulfilled.countable_localization X hX subset countable).2)) + (geometry.decoded_separating + (fun B hB d hd lower => fulfilled.separates B hB d hd d hd lower lower)) + small pairing unions powers separation collection infinite groundChoice + geometry.carrier_ground geometry.actors_ground order graph p + +theorem exists_rowTermSystem + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let family := rowTupleFamily (c.encode ⊤) mu s.nonbottom.carrier + (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier + (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + S ∈ M.sets ∧ GroundBelow M S K ∧ (∅ : ZFSet.{u}) ∈ S ∧ + family ∈ M.sets ∧ ZFSet.IsFunc S T family ∧ T ∈ M.sets ∧ GroundBelow M T K ∧ + ∀ n : Nat, let terms := iteratedPairNameFamily (c.encode ⊤) T n + terms ∈ M.sets ∧ GroundBelow M terms K ∧ + (∀ z ∈ terms, IsName c z) ∧ + (∀ σ : Name c, σ.val ∈ terms → HereditarilySymmetric act c supports σ) ∧ + ∃ τ : Name c, τ.val ∈ M.sets ∧ τ.val = ZFSet.prod terms {c.encode ⊤} ∧ + HereditarilySymmetric act c supports τ ∧ (∀ g, act.act c g τ = τ) ∧ + ∀ H : Set (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), ⊤ ∈ H → ∀ x, + x ∈ Name.eval H τ ↔ ∃ σ : Name c, σ.val ∈ terms ∧ Name.eval H σ = x := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + let supports := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) directed + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, hS, smallS, empty⟩ := + run.exists_finalRowPositionSequences i₀ collection infinite choice hK standard indices + have sequenceEqual := congrArg + (fun r => M.rowPositionSequences s.carrier r s.nonbottom.carrier mu) geometry.decoded_order_eq + have groundS := (congrArg (fun A => A ∈ M.sets) sequenceEqual).mpr hS + have belowS := (congrArg (fun A => GroundBelow M A K) sequenceEqual).mpr smallS + have emptyS := (congrArg (fun A => (∅ : ZFSet.{u}) ∈ A) sequenceEqual).mpr empty + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, groundS, belowS, emptyS, ?_⟩ + have hI := M.nonbottom_carrier_mem s separation geometry.carrier_ground + obtain ⟨family, _, function, smallT⟩ := + M.binaryRowTupleTerms_mem_below pairing unions powers separation collection infinite choice + geometry.carrier_ground order hI hColumns hmu hK belowS ⊤ + have base := M.binaryRowTermSetName_exists a s b columns pairing unions powers separation collection infinite + geometry.carrier_ground hColumns geometry.actors_ground action order directed hmu cardinal.1 + have hT := base.1 + have each := M.binaryRowTupleTerms_hs a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action directed hmu cardinal.1 + have closed := M.binaryRowTupleTerms_action a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 + have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hColumns) (M.natSetCode_mem separation infinite 2) + refine ⟨family, function, hT, smallT, ?_⟩ + apply M.invariantNamePowers act c supports pairing unions powers separation infinite choice + (M.transitive hQ (c.encode_mem ⊤)) hT hK standard smallT + · intro z hz + obtain ⟨τ, equal, _⟩ := each z hz + exact equal ▸ τ.property + · exact closed + · intro σ hσ + obtain ⟨τ, equal, hs⟩ := each σ.val hσ + have same : τ = σ := Subtype.ext equal + exact same ▸ hs + +include fulfilled + +theorem decoded_strict_growth : + let geometry := run.finalGeometry i₀ + letI := geometry.meet.order.toPartialOrder + ∀ x : SetMembers geometry.carrier, ∃ y : SetMembers geometry.carrier, x < y := by + let geometry := run.finalGeometry i₀ + let := geometry.meet.order.toPartialOrder + dsimp only + intro x + obtain ⟨y, hy, lower, strict⟩ := fulfilled.growth _ (SetMembers.raw_mem x) + refine ⟨SetMembers.ofMem y hy, lt_iff_le_not_ge.2 ⟨?_, ?_⟩⟩ + · change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem y hy)) + ∈ geometry.order + simpa only [SetMembers.raw_ofMem] using lower + · change ¬ ZFSet.pair (SetMembers.raw (SetMembers.ofMem y hy)) (SetMembers.raw x) + ∈ geometry.order + simpa only [SetMembers.raw_ofMem] using strict + +theorem exists_commonPrincipalSupport_strict_extension : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let directed := geometry.decoded_directed fulfilled.directed + ∀ {P : Type u} [PartialOrder P] (a : PosetAction (SetMembers geometry.actors) P) + (s : Presentation P) {n : Nat} (tau : Fin n → Name s), + (∀ i, HereditarilySymmetric a s + (geometry.decodedAction.principalSupportFamily ⊥ directed) (tau i)) → + ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ + ∀ i, geometry.decodedAction.principalFix C ≤ a.stabilizer s (tau i) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro P inst a s n tau symmetric + obtain ⟨C, hC, fixed⟩ := Name.exists_commonPrincipalNameSupport a s geometry.decodedAction + ⊥ directed tau (fun i => (symmetric i).symmetric) + obtain ⟨E, strict⟩ := fulfilled.decoded_strict_growth C + exact ⟨C, E, hC, strict, fixed⟩ + +end GroundMainPrefix.FinalFulfillment + +namespace GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowModel_sequenceReflection + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∀ p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 ∧ + ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension c H) U := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + dsimp only + intro p + obtain ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice⟩ := + fulfilled.exists_rowModel collection infinite groundChoice small p + refine ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, ?_⟩ + intro U hU + exact M.countableFunction_sequenceReflection pairing unions powers separation collection infinite + groundChoice small + (M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns) + (M.natSetCode_mem separation infinite 2) hU H coded ordinary + +theorem exists_rowModel_ordinaryZF + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∀ p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 ∧ + ZFRealization (M.ordinaryExtension c H).sets ∧ + CollectionSchema (M.ordinaryExtension c H).sets ∧ + ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension c H) U := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + dsimp only + intro p + obtain ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, reflection⟩ := + fulfilled.exists_rowModel_sequenceReflection collection infinite groundChoice small p + have axioms := M.countableFunction_ordinaryZF pairing unions powers separation collection infinite + (M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns) + (M.natSetCode_mem separation infinite 2) H ordinary + exact ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, axioms.1, axioms.2, reflection⟩ + +end GroundMainPrefix.FinalFulfillment + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZFC.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZFC.lean index c86254868914dc3a71d851b84283ec69c9a050ac..0acfc9c16d2eed7806940ca6740982eeaa9a1899 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZFC.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowOrdinaryZFC.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZF - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowModel_ordinaryZFC - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) - (geometry.decoded_directed fulfilled.directed) - ∀ p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 ∧ - ZFRealization (M.ordinaryExtension c H).sets ∧ - CollectionSchema (M.ordinaryExtension c H).sets ∧ - Realize (M.ordinaryExtension c H).sets SetFormula.choice Fin.elim0 ∧ - ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension c H) U := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - dsimp only - intro p - obtain ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, reflection⟩ := - fulfilled.exists_rowModel_sequenceReflection collection infinite groundChoice small p - have axioms := M.countableFunction_ordinaryZFC pairing unions powers separation collection infinite - groundChoice - (M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns) - (M.natSetCode_mem separation infinite 2) H ordinary - exact ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, - axioms.1, axioms.2.1, axioms.2.2, reflection⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowOrdinaryZF + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowModel_ordinaryZFC + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : SetMembers geometry.carrier) + (geometry.decoded_directed fulfilled.directed) + ∀ p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 ∧ + ZFRealization (M.ordinaryExtension c H).sets ∧ + CollectionSchema (M.ordinaryExtension c H).sets ∧ + Realize (M.ordinaryExtension c H).sets SetFormula.choice Fin.elim0 ∧ + ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension c H) U := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + dsimp only + intro p + obtain ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, reflection⟩ := + fulfilled.exists_rowModel_sequenceReflection collection infinite groundChoice small p + have axioms := M.countableFunction_ordinaryZFC pairing unions powers separation collection infinite + groundChoice + (M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns) + (M.natSetCode_mem separation infinite 2) H ordinary + exact ⟨H, hp, coded, ordinary, symmetric, includes, zf, noChoice, + axioms.1, axioms.2.1, axioms.2.2, reflection⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowRectangles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowRectangles.lean index 327e132c609abd2e59e3285ff1f079d34477479c..8660f6d70d1ff59794a257ed0e777091a3b2d70b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowRectangles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowRectangles.lean @@ -1,782 +1,782 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAlignedCopyUnions -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralOrderCoordinates -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowStructuralDataBoundActions - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -local notation "Q" => SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - -theorem internalRowAction_aligned_agrees : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - ∀ (p r : Q) (D X V : L) (g h : G), - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → - r ≤ act.iso g p → - (∀ i, i ≤ a.iso h D → i ≤ X → i ≤ a.iso h V) → - (∀ i, i ≤ V → a.iso h i = a.iso g i) → - ∀ x y z, ZFSet.pair x y ∈ SetMembers.raw r → - ZFSet.pair x z ∈ SetMembers.raw (act.iso h p) → y = z := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act p r D X V g h bp br reference overlap agree x y z left right - have rc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega r).2.1 - have hc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega (act.iso h p)).2.1 - have coords := (ZFSet.pair_mem_prod.1 (rc.shape left)).1 - have hz := (ZFSet.pair_mem_prod.1 (hc.shape right)).2 - obtain ⟨row, hrow, c, hcol, rfl⟩ := ZFSet.mem_prod.1 coords - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier row).1 hrow - have ri := br i (row_mem_rowUsedRows rc left) - have hi := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation - infinite hL hC hG graph h p D bp i (row_mem_rowUsedRows hc right) - have below := overlap i.val hi ri - let j := (a.nonbottom.iso h).symm i - have image : a.iso h j.val = i.val := - congrArg Subtype.val ((a.nonbottom.iso h).apply_symm_apply i) - have oldV : j.val ≤ V := by - have moved : a.iso h j.val ≤ a.iso h V := by rw [image]; exact below - simpa only [OrderIso.symm_apply_apply] using (a.iso h).symm.monotone moved - have same : a.iso g j.val = i.val := (agree j.val oldV).symm.trans image - have old := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph h p j c z hcol hz).1 (by rw [image]; exact right) - have copied := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph g p j c z hcol hz).2 old - rw [same] at copied - have inherited := (M.smallFunction_le_iff (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega r (act.iso g p)).1 reference copied - exact rc.unique _ y z left inherited - -theorem internalRowAction_one_copy_union - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - ∀ (p r : Q) (D X V : L) (g h : G), - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → - r ≤ act.iso g p → - (∀ i, i ≤ a.iso h D → i ≤ X → i ≤ a.iso h V) → - (∀ i, i ≤ V → a.iso h i = a.iso g i) → - ∃ t : Q, SetMembers.raw t = SetMembers.raw r ∪ SetMembers.raw (act.iso h p) ∧ - t ≤ r ∧ t ≤ act.iso h p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act p r D X V g h bp br reference overlap agree - exact M.countableFunction_common_extension pairing unions powers separation infinite choice - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) r (act.iso h p) - (M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite - hL hC hG graph p r D X V g h bp br reference overlap agree) - -theorem internalRowAction_rectangle_union - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - ∀ (p r : Q) (D X V W : L) (g₁ g₂ h₁ h₂ : G), - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → - r ≤ act.iso g₁ p → r ≤ act.iso g₂ p → - (∀ i, i ≤ V → a.iso h₁ i = a.iso g₁ i) → - (∀ i, i ≤ V → a.iso h₂ i = a.iso g₂ i) → - (∀ i, i ≤ W → a.iso h₁ i = a.iso h₂ i) → - (∀ i, i ≤ a.iso h₁ D → i ≤ X → i ≤ a.iso h₁ V) → - (∀ i, i ≤ a.iso h₂ D → i ≤ X → i ≤ a.iso h₂ V) → - (∀ i, i ≤ a.iso h₁ D → i ≤ a.iso h₂ D → i ≤ a.iso h₁ W) → - ∃ t : Q, SetMembers.raw t = - (SetMembers.raw r ∪ SetMembers.raw (act.iso h₁ p)) ∪ SetMembers.raw (act.iso h₂ p) ∧ - t ≤ r ∧ t ≤ act.iso h₁ p ∧ t ≤ act.iso h₂ p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act p r D X V W g₁ g₂ h₁ h₂ bp br ref₁ ref₂ agree₁ agree₂ agreeW overlap₁ overlap₂ overlapW - have one := M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite - hL hC hG graph p r D X V g₁ h₁ bp br ref₁ overlap₁ agree₁ - have two := M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite - hL hC hG graph p r D X V g₂ h₂ bp br ref₂ overlap₂ agree₂ - have movedBound := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation - infinite hL hC hG graph h₂ p D bp - have pair := M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite - hL hC hG graph p (act.iso h₂ p) D (a.iso h₂ D) W h₂ h₁ bp movedBound - le_rfl overlapW agreeW - obtain ⟨q, rawq, qr, qh₁⟩ := M.countableFunction_common_extension pairing unions powers separation - infinite choice (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) r (act.iso h₁ p) one - have compatible : ∀ x y z, ZFSet.pair x y ∈ SetMembers.raw q → - ZFSet.pair x z ∈ SetMembers.raw (act.iso h₂ p) → y = z := by - intro x y z left right - rw [rawq] at left - rcases ZFSet.mem_union.1 left with left | left - · exact two x y z left right - · exact (pair x z y right left).symm - obtain ⟨t, rawt, tq, th₂⟩ := M.countableFunction_common_extension pairing unions powers separation - infinite choice (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) q (act.iso h₂ p) compatible - refine ⟨t, ?_, le_trans tq qr, le_trans tq qh₁, th₂⟩ - exact rawt.trans (congrArg (fun z => z ∪ SetMembers.raw (act.iso h₂ p)) rawq) - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.GroundMainFinalGeometry -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -theorem decoded_rectangle_request : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - let a := geometry.decodedAction - ∀ (V W d : SetMembers geometry.carrier) (g h : SetMembers geometry.actors), - V ≤ d → W ≤ d → - g ∈ a.principalFix (geometry.meet.smallMeet V W) → - h ∈ a.principalFix (geometry.meet.smallMeet V W) → - geometry.meet.smallMeet (a.iso g d) (a.iso h d) = geometry.meet.smallMeet V W → - ExternalRectangleCode geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action (SetMembers.raw V) (SetMembers.raw W) - (SetMembers.raw d) (SetMembers.raw g) (SetMembers.raw h) := by - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - intro a V W d g h vd wd fixesG fixesH separated - let meet := geometry.meet.smallMeet V W - refine ⟨SetMembers.raw_mem V, SetMembers.raw_mem W, SetMembers.raw_mem d, - SetMembers.raw_mem g, SetMembers.raw_mem h, vd, wd, - SetMembers.raw meet, SetMembers.raw_mem meet, geometry.meet.smallMeet_entry V W, ?_, ?_⟩ - · intro x hx y hy lower - let z := SetMembers.ofMem x hx - let value := SetMembers.ofMem y hy - have below : z ≤ meet := by - change ZFSet.pair (SetMembers.raw z) (SetMembers.raw meet) ∈ geometry.order - simpa only [z, SetMembers.raw_ofMem] using lower - have agree : a.iso g z = a.iso h z := (fixesG z below).trans (fixesH z below).symm - change geometry.action_code.act g z = geometry.action_code.act h z at agree - have iff : ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw z)) (SetMembers.raw value) - ∈ geometry.action ↔ - ZFSet.pair (ZFSet.pair (SetMembers.raw h) (SetMembers.raw z)) (SetMembers.raw value) - ∈ geometry.action := by - rw [← geometry.action_code.act_eq_iff, ← geometry.action_code.act_eq_iff, agree] - simpa only [z, value, SetMembers.raw_ofMem] using iff - · intro y hy z hz v hv entries - have first := (geometry.action_code.act_eq_iff g d (SetMembers.ofMem y hy)).2 - (by simpa only [SetMembers.raw_ofMem] using entries.1) - have second := (geometry.action_code.act_eq_iff h d (SetMembers.ofMem z hz)).2 - (by simpa only [SetMembers.raw_ofMem] using entries.2.1) - have last := (geometry.action_code.act_eq_iff g meet (SetMembers.ofMem v hv)).2 - (by simpa only [SetMembers.raw_ofMem] using entries.2.2) - have same : geometry.meet.smallMeet (SetMembers.ofMem y hy) (SetMembers.ofMem z hz) = - SetMembers.ofMem v hv := by - rw [← first, ← second] - exact separated.trans ((fixesG meet le_rfl).symm.trans last) - simpa only [SetMembers.raw_ofMem] using (geometry.meet.smallMeet_eq_iff _ _ _).1 same - -end PartitionPilot.Forcing.GroundMainFinalGeometry - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) -include fulfilled - -theorem decoded_separate_at : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - ∀ W d X : SetMembers geometry.carrier, W ≤ d → W ≤ X → - ∃ h : SetMembers geometry.actors, - h ∈ geometry.decodedAction.principalFix W ∧ - geometry.meet.smallMeet (geometry.decodedAction.iso h d) X = W := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - dsimp only - intro W d X wd wx - obtain ⟨k, hk, fixed, y, hy, action, meet⟩ := fulfilled.separates - _ (SetMembers.raw_mem W) _ (SetMembers.raw_mem d) _ (SetMembers.raw_mem X) wd wx - let h := SetMembers.ofMem k hk - have acted : geometry.action_code.act h d = SetMembers.ofMem y hy := - (geometry.action_code.act_eq_iff _ _ _).2 - (by simpa only [h, SetMembers.raw_ofMem] using action) - refine ⟨h, ?_, ?_⟩ - · intro z lower - apply (geometry.action_code.act_eq_iff _ _ _).2 - simpa only [h, SetMembers.raw_ofMem] using fixed _ (SetMembers.raw_mem z) lower - · apply (geometry.meet.smallMeet_eq_iff _ _ _).2 - change ZFSet.pair (ZFSet.pair (SetMembers.raw (geometry.action_code.act h d)) - (SetMembers.raw X)) (SetMembers.raw W) ∈ geometry.meetGraph - simpa only [acted, SetMembers.raw_ofMem] using meet - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) -include fulfilled - -theorem internalRow_rectangle_union - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - ∀ (p r : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) - (d X V W : SetMembers geometry.carrier) (g₁ g₂ : SetMembers geometry.actors), - ExternalRectangleCode geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action (SetMembers.raw V) (SetMembers.raw W) - (SetMembers.raw d) (SetMembers.raw g₁) (SetMembers.raw g₂) → - a.iso g₁ d ≤ X → a.iso g₂ d ≤ X → - (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d) → - (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → - r ≤ act.iso g₁ p → r ≤ act.iso g₂ p → - ∃ h₁ h₂ : SetMembers geometry.actors, - RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph geometry.action - (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) - (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) - (SetMembers.raw h₁) (SetMembers.raw h₂) ∧ - ∃ t : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), - SetMembers.raw t = (SetMembers.raw r ∪ SetMembers.raw (act.iso h₁ p)) ∪ - SetMembers.raw (act.iso h₂ p) ∧ - t ≤ r ∧ t ≤ act.iso h₁ p ∧ t ≤ act.iso h₂ p := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - dsimp only - intro p r d X V W g₁ g₂ request bound₁ bound₂ bp br reference₁ reference₂ - have upper (g : SetMembers geometry.actors) (bound : a.iso g d ≤ X) : - ∀ y ∈ geometry.carrier, - ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw d)) y ∈ geometry.action → - ZFSet.pair y (SetMembers.raw X) ∈ geometry.order := by - intro y hy entry - have acted := (geometry.action_code.act_eq_iff g d (SetMembers.ofMem y hy)).2 - (by simpa only [SetMembers.raw_ofMem] using entry) - change ZFSet.pair (SetMembers.raw (geometry.action_code.act g d)) (SetMembers.raw X) - ∈ geometry.order at bound - simpa only [acted, SetMembers.raw_ofMem] using bound - obtain ⟨k, hk, l, hl, rectangle⟩ := fulfilled.rectangles - _ _ _ _ _ _ request (SetMembers.raw_mem X) (upper g₁ bound₁) (upper g₂ bound₂) - let h₁ := SetMembers.ofMem k hk - let h₂ := SetMembers.ofMem l hl - have code : RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph - geometry.action (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) - (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) - (SetMembers.raw h₁) (SetMembers.raw h₂) := by - simpa only [h₁, h₂, SetMembers.raw_ofMem] using rectangle - have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) - (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action - (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : - ∀ i, i ≤ v → a.iso g i = a.iso h i := by - intro i lower - apply SetMembers.raw_injective - exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) - lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) - have agree₁ := agree h₁ g₁ V code.first_agreement - have agree₂ := agree h₂ g₂ V code.second_agreement - have agreeW := agree h₁ h₂ W code.common_agreement - obtain ⟨v, hv, w, hw, y, hy, z, hz, t, ht, - gv, hwv, ky, lz, kt, _, meet₁, meet₂, meetW⟩ := code.values - have value (g : SetMembers geometry.actors) (x : SetMembers geometry.carrier) - (y : ZFSet.{u}) (hy : y ∈ geometry.carrier) - (entry : ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) y ∈ geometry.action) : - SetMembers.raw (a.iso g x) = y := by - have acted := (geometry.action_code.act_eq_iff g x (SetMembers.ofMem y hy)).2 - (by simpa only [SetMembers.raw_ofMem] using entry) - exact (congrArg SetMembers.raw acted).trans (SetMembers.raw_ofMem y hy) - have eqv := value g₁ V v hv gv - have eqw := value g₂ V w hw hwv - have eqy := value h₁ d y hy ky - have eqz := value h₂ d z hz lz - have eqt := value h₁ W t ht kt - have overlap₁ : ∀ i, i ≤ a.iso h₁ d → i ≤ X → i ≤ a.iso h₁ V := by - intro i iy ix - rw [agree₁ V le_rfl] - change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso g₁ V)) ∈ geometry.order - rw [eqv] - change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₁ d)) ∈ geometry.order at iy - rw [eqy] at iy - exact geometry.meet.greatest y (SetMembers.raw X) v (SetMembers.raw i) - (SetMembers.raw_mem i) meet₁ iy ix - have overlap₂ : ∀ i, i ≤ a.iso h₂ d → i ≤ X → i ≤ a.iso h₂ V := by - intro i iz ix - rw [agree₂ V le_rfl] - change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso g₂ V)) ∈ geometry.order - rw [eqw] - change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₂ d)) ∈ geometry.order at iz - rw [eqz] at iz - exact geometry.meet.greatest z (SetMembers.raw X) w (SetMembers.raw i) - (SetMembers.raw_mem i) meet₂ iz ix - have overlapW : ∀ i, i ≤ a.iso h₁ d → i ≤ a.iso h₂ d → i ≤ a.iso h₁ W := by - intro i iy iz - change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₁ W)) ∈ geometry.order - rw [eqt] - change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₁ d)) ∈ geometry.order at iy - change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₂ d)) ∈ geometry.order at iz - rw [eqy] at iy - rw [eqz] at iz - exact geometry.meet.greatest y z t (SetMembers.raw i) (SetMembers.raw_mem i) meetW iy iz - refine ⟨h₁, h₂, code, ?_⟩ - exact M.internalRowAction_rectangle_union a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) choice p r d X V W - g₁ g₂ h₁ h₂ bp br reference₁ reference₂ agree₁ agree₂ agreeW overlap₁ overlap₂ overlapW - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) -variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -include collection order nodeMaps supports - -theorem binaryRowStructural_aligned_copy_union - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (meet : L → L → L) {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (muOrdinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) - (g h : G) (D X V : L), - SetMembers.raw p = ZFSet.pair (c.encode r) A → - SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → - q ≤ upperAct.iso g p → - (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i ≤ D) → - (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ - stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - g⁻¹ * h ∈ a.principalFix V → - meet (a.iso h D) X = a.iso h V → - meet (a.iso h D) X ≤ a.iso h D → - meet (a.iso h D) X ≤ X → - (∀ z : L, z ≤ a.iso h D → z ≤ X → z ≤ meet (a.iso h D) X) → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : L) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (meet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A - ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, - SetMembers.raw row = SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h r) ∧ - SetMembers.raw result = ZFSet.pair (c.encode row) (movedA ∪ oldA) ∧ - result ≤ upperAct.iso h p ∧ result ≤ q := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder - forcingAction omega topMem topRows packed I anchors upperQ - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - intro upperAct p q r oldRow A oldA g h D X V pCode qCode prepared below usedD usedX dataD dataX - relative overlap meetLeft meetRight meetGreatest descent movedA - have source : ZFSet.pair (c.encode r) A ∈ upperQ := pCode ▸ SetMembers.raw_mem p - have oldSource : ZFSet.pair (c.encode oldRow) oldA ∈ upperQ := qCode ▸ SetMembers.raw_mem q - have reference := M.semanticStructuralOrder_action_coordinates c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hs hh stagesOrdinal trace g p q r oldRow A oldA pCode qCode below - have agree (i : L) (hi : i ≤ V) : a.iso h i = a.iso g i := by - have fixed := relative i hi - have moved := congrArg (a.iso g) fixed - simpa only [a.mul, a.point_inv_right] using moved - obtain ⟨row, rowCode, rowBelowOld, rowBelowH⟩ := - M.internalRowAction_one_copy_union a s b C pairing unions powers separation infinite hL hC hG graph - choice r oldRow D X V g h (fun i hi => usedD i.val hi) (fun i hi => usedX i.val hi) - reference.1 (fun i hi hx => overlap ▸ meetGreatest i hi hx) agree - have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages packed - (ZFSet.pair (c.encode r) A)).1 source |>.1 - have hA : A ∈ M.sets := ((M.mem_groundSmallSubsets _ _ A).1 (ZFSet.pair_mem_prod.1 candidate).2).1 - have transported := M.binaryRowStructuralAssignmentImage_dataBound a s b C pairing unions powers - separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh - stagesOrdinal trace h D A hA dataD - have unionFacts := M.semanticStructuralTrace_aligned_copy_union c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order - graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace infinite choice small meet I S mu s.nonbottom.carrier tuples - (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) - (fun D f _ tau entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation - infinite hL hC hG graph hmu muOrdinal valid f tau D entry bound.2) - r oldRow row A oldA g h D X V source oldSource (pCode ▸ prepared) - rowBelowOld reference.1 rowBelowH reference.2 relative overlap meetLeft meetRight meetGreatest - transported.2.2 dataX descent - let result : SetMembers upperQ := SetMembers.ofMem _ unionFacts.1 - have resultCode : SetMembers.raw result = ZFSet.pair (c.encode row) (movedA ∪ oldA) := - SetMembers.raw_ofMem _ _ - have movedCode := M.semanticStructuralAction_coordinates c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order - graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace h p r A pCode - refine ⟨row, result, rowCode, resultCode, ?_, ?_⟩ - · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw (upperAct.iso h p)) ∈ _ - rw [resultCode, movedCode] - exact unionFacts.2.1 - · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw q) ∈ _ - rw [resultCode, qCode] - exact unionFacts.2.2 - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem structural_separating_copy_union - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) - (g1 g2 : SetMembers geometry.actors) (dBound X W : SetMembers geometry.carrier), - SetMembers.raw p = ZFSet.pair (c.encode r) A → - SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → - q ≤ upperAct.iso g1 p → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw r) → i ≤ dBound) → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → - (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ - stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - W ≤ dBound → g1 ∈ a.principalFix W → g2 ∈ a.principalFix W → - a.iso g1 dBound ≤ X → a.iso g2 dBound ≤ X → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - ∃ h : SetMembers geometry.actors, - h ∈ a.principalFix W ∧ - geometry.meet.smallMeet (a.iso h dBound) X = W ∧ - geometry.meet.smallMeet (a.iso h dBound) (a.iso g1 dBound) = W ∧ - geometry.meet.smallMeet (a.iso h dBound) (a.iso g2 dBound) = W ∧ - (let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A; - ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, - SetMembers.raw row = SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h r) ∧ - SetMembers.raw result = ZFSet.pair (c.encode row) (movedA ∪ oldA) ∧ - result ≤ q ∧ result ≤ upperAct.iso h p) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - intro p q r oldRow A oldA g1 g2 dBound X W pCode qCode prepared below - usedD usedX dataD dataX wd fixed1 fixed2 bound1 bound2 descent - have fixedLower (g : SetMembers geometry.actors) (fixed : g ∈ a.principalFix W) : - W ≤ a.iso g dBound := by - have lower := (a.iso g).monotone wd - rw [fixed W le_rfl] at lower - exact lower - obtain ⟨h, fixed, overlap⟩ := fulfilled.decoded_separate_at W dBound X wd - ((fixedLower g1 fixed1).trans bound1) - have relative : g1⁻¹ * h ∈ a.principalFix W := - (a.principalFix W).mul_mem ((a.principalFix W).inv_mem fixed1) fixed - have overlapMoved : geometry.meet.smallMeet (a.iso h dBound) X = a.iso h W := - overlap.trans (fixed W le_rfl).symm - obtain ⟨row, result, rowCode, resultCode, toH, toOld⟩ := - M.binaryRowStructural_aligned_copy_union a s b columns pairing unions powers separation - collection infinite hL order hC hG graph nodeMaps supports directed choice small geometry.meet.smallMeet - hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace p q r oldRow A oldA g1 h dBound X W - pCode qCode prepared below usedD usedX dataD dataX relative overlapMoved - (geometry.meet.toSmallMeetOrder.meet_le_left _ _) - (geometry.meet.toSmallMeetOrder.meet_le_right _ _) - (fun _ left right => geometry.meet.toSmallMeetOrder.le_meet left right) descent - have apart (Y : SetMembers geometry.carrier) (wy : W ≤ Y) (yx : Y ≤ X) : - geometry.meet.smallMeet (a.iso h dBound) Y = W := by - apply le_antisymm - · rw [← overlap] - exact geometry.meet.toSmallMeetOrder.le_meet - (geometry.meet.toSmallMeetOrder.meet_le_left _ _) - (le_trans (geometry.meet.toSmallMeetOrder.meet_le_right _ _) yx) - · exact geometry.meet.toSmallMeetOrder.le_meet (fixedLower h fixed) wy - exact ⟨h, fixed, overlap, apart _ (fixedLower g1 fixed1) bound1, - apart _ (fixedLower g2 fixed2) bound2, row, result, rowCode, resultCode, toOld, toH⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAlignedCopyUnions +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralOrderCoordinates +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowStructuralDataBoundActions + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +local notation "Q" => SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + +theorem internalRowAction_aligned_agrees : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + ∀ (p r : Q) (D X V : L) (g h : G), + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → + r ≤ act.iso g p → + (∀ i, i ≤ a.iso h D → i ≤ X → i ≤ a.iso h V) → + (∀ i, i ≤ V → a.iso h i = a.iso g i) → + ∀ x y z, ZFSet.pair x y ∈ SetMembers.raw r → + ZFSet.pair x z ∈ SetMembers.raw (act.iso h p) → y = z := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act p r D X V g h bp br reference overlap agree x y z left right + have rc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega r).2.1 + have hc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega (act.iso h p)).2.1 + have coords := (ZFSet.pair_mem_prod.1 (rc.shape left)).1 + have hz := (ZFSet.pair_mem_prod.1 (hc.shape right)).2 + obtain ⟨row, hrow, c, hcol, rfl⟩ := ZFSet.mem_prod.1 coords + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier row).1 hrow + have ri := br i (row_mem_rowUsedRows rc left) + have hi := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation + infinite hL hC hG graph h p D bp i (row_mem_rowUsedRows hc right) + have below := overlap i.val hi ri + let j := (a.nonbottom.iso h).symm i + have image : a.iso h j.val = i.val := + congrArg Subtype.val ((a.nonbottom.iso h).apply_symm_apply i) + have oldV : j.val ≤ V := by + have moved : a.iso h j.val ≤ a.iso h V := by rw [image]; exact below + simpa only [OrderIso.symm_apply_apply] using (a.iso h).symm.monotone moved + have same : a.iso g j.val = i.val := (agree j.val oldV).symm.trans image + have old := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph h p j c z hcol hz).1 (by rw [image]; exact right) + have copied := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph g p j c z hcol hz).2 old + rw [same] at copied + have inherited := (M.smallFunction_le_iff (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega r (act.iso g p)).1 reference copied + exact rc.unique _ y z left inherited + +theorem internalRowAction_one_copy_union + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + ∀ (p r : Q) (D X V : L) (g h : G), + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → + r ≤ act.iso g p → + (∀ i, i ≤ a.iso h D → i ≤ X → i ≤ a.iso h V) → + (∀ i, i ≤ V → a.iso h i = a.iso g i) → + ∃ t : Q, SetMembers.raw t = SetMembers.raw r ∪ SetMembers.raw (act.iso h p) ∧ + t ≤ r ∧ t ≤ act.iso h p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act p r D X V g h bp br reference overlap agree + exact M.countableFunction_common_extension pairing unions powers separation infinite choice + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) r (act.iso h p) + (M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite + hL hC hG graph p r D X V g h bp br reference overlap agree) + +theorem internalRowAction_rectangle_union + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + ∀ (p r : Q) (D X V W : L) (g₁ g₂ h₁ h₂ : G), + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → + r ≤ act.iso g₁ p → r ≤ act.iso g₂ p → + (∀ i, i ≤ V → a.iso h₁ i = a.iso g₁ i) → + (∀ i, i ≤ V → a.iso h₂ i = a.iso g₂ i) → + (∀ i, i ≤ W → a.iso h₁ i = a.iso h₂ i) → + (∀ i, i ≤ a.iso h₁ D → i ≤ X → i ≤ a.iso h₁ V) → + (∀ i, i ≤ a.iso h₂ D → i ≤ X → i ≤ a.iso h₂ V) → + (∀ i, i ≤ a.iso h₁ D → i ≤ a.iso h₂ D → i ≤ a.iso h₁ W) → + ∃ t : Q, SetMembers.raw t = + (SetMembers.raw r ∪ SetMembers.raw (act.iso h₁ p)) ∪ SetMembers.raw (act.iso h₂ p) ∧ + t ≤ r ∧ t ≤ act.iso h₁ p ∧ t ≤ act.iso h₂ p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act p r D X V W g₁ g₂ h₁ h₂ bp br ref₁ ref₂ agree₁ agree₂ agreeW overlap₁ overlap₂ overlapW + have one := M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite + hL hC hG graph p r D X V g₁ h₁ bp br ref₁ overlap₁ agree₁ + have two := M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite + hL hC hG graph p r D X V g₂ h₂ bp br ref₂ overlap₂ agree₂ + have movedBound := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation + infinite hL hC hG graph h₂ p D bp + have pair := M.internalRowAction_aligned_agrees a s b C pairing unions powers separation infinite + hL hC hG graph p (act.iso h₂ p) D (a.iso h₂ D) W h₂ h₁ bp movedBound + le_rfl overlapW agreeW + obtain ⟨q, rawq, qr, qh₁⟩ := M.countableFunction_common_extension pairing unions powers separation + infinite choice (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) r (act.iso h₁ p) one + have compatible : ∀ x y z, ZFSet.pair x y ∈ SetMembers.raw q → + ZFSet.pair x z ∈ SetMembers.raw (act.iso h₂ p) → y = z := by + intro x y z left right + rw [rawq] at left + rcases ZFSet.mem_union.1 left with left | left + · exact two x y z left right + · exact (pair x z y right left).symm + obtain ⟨t, rawt, tq, th₂⟩ := M.countableFunction_common_extension pairing unions powers separation + infinite choice (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) q (act.iso h₂ p) compatible + refine ⟨t, ?_, le_trans tq qr, le_trans tq qh₁, th₂⟩ + exact rawt.trans (congrArg (fun z => z ∪ SetMembers.raw (act.iso h₂ p)) rawq) + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.GroundMainFinalGeometry +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +theorem decoded_rectangle_request : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + let a := geometry.decodedAction + ∀ (V W d : SetMembers geometry.carrier) (g h : SetMembers geometry.actors), + V ≤ d → W ≤ d → + g ∈ a.principalFix (geometry.meet.smallMeet V W) → + h ∈ a.principalFix (geometry.meet.smallMeet V W) → + geometry.meet.smallMeet (a.iso g d) (a.iso h d) = geometry.meet.smallMeet V W → + ExternalRectangleCode geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action (SetMembers.raw V) (SetMembers.raw W) + (SetMembers.raw d) (SetMembers.raw g) (SetMembers.raw h) := by + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + intro a V W d g h vd wd fixesG fixesH separated + let meet := geometry.meet.smallMeet V W + refine ⟨SetMembers.raw_mem V, SetMembers.raw_mem W, SetMembers.raw_mem d, + SetMembers.raw_mem g, SetMembers.raw_mem h, vd, wd, + SetMembers.raw meet, SetMembers.raw_mem meet, geometry.meet.smallMeet_entry V W, ?_, ?_⟩ + · intro x hx y hy lower + let z := SetMembers.ofMem x hx + let value := SetMembers.ofMem y hy + have below : z ≤ meet := by + change ZFSet.pair (SetMembers.raw z) (SetMembers.raw meet) ∈ geometry.order + simpa only [z, SetMembers.raw_ofMem] using lower + have agree : a.iso g z = a.iso h z := (fixesG z below).trans (fixesH z below).symm + change geometry.action_code.act g z = geometry.action_code.act h z at agree + have iff : ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw z)) (SetMembers.raw value) + ∈ geometry.action ↔ + ZFSet.pair (ZFSet.pair (SetMembers.raw h) (SetMembers.raw z)) (SetMembers.raw value) + ∈ geometry.action := by + rw [← geometry.action_code.act_eq_iff, ← geometry.action_code.act_eq_iff, agree] + simpa only [z, value, SetMembers.raw_ofMem] using iff + · intro y hy z hz v hv entries + have first := (geometry.action_code.act_eq_iff g d (SetMembers.ofMem y hy)).2 + (by simpa only [SetMembers.raw_ofMem] using entries.1) + have second := (geometry.action_code.act_eq_iff h d (SetMembers.ofMem z hz)).2 + (by simpa only [SetMembers.raw_ofMem] using entries.2.1) + have last := (geometry.action_code.act_eq_iff g meet (SetMembers.ofMem v hv)).2 + (by simpa only [SetMembers.raw_ofMem] using entries.2.2) + have same : geometry.meet.smallMeet (SetMembers.ofMem y hy) (SetMembers.ofMem z hz) = + SetMembers.ofMem v hv := by + rw [← first, ← second] + exact separated.trans ((fixesG meet le_rfl).symm.trans last) + simpa only [SetMembers.raw_ofMem] using (geometry.meet.smallMeet_eq_iff _ _ _).1 same + +end PartitionPilot.Forcing.GroundMainFinalGeometry + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) +include fulfilled + +theorem decoded_separate_at : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + ∀ W d X : SetMembers geometry.carrier, W ≤ d → W ≤ X → + ∃ h : SetMembers geometry.actors, + h ∈ geometry.decodedAction.principalFix W ∧ + geometry.meet.smallMeet (geometry.decodedAction.iso h d) X = W := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + dsimp only + intro W d X wd wx + obtain ⟨k, hk, fixed, y, hy, action, meet⟩ := fulfilled.separates + _ (SetMembers.raw_mem W) _ (SetMembers.raw_mem d) _ (SetMembers.raw_mem X) wd wx + let h := SetMembers.ofMem k hk + have acted : geometry.action_code.act h d = SetMembers.ofMem y hy := + (geometry.action_code.act_eq_iff _ _ _).2 + (by simpa only [h, SetMembers.raw_ofMem] using action) + refine ⟨h, ?_, ?_⟩ + · intro z lower + apply (geometry.action_code.act_eq_iff _ _ _).2 + simpa only [h, SetMembers.raw_ofMem] using fixed _ (SetMembers.raw_mem z) lower + · apply (geometry.meet.smallMeet_eq_iff _ _ _).2 + change ZFSet.pair (ZFSet.pair (SetMembers.raw (geometry.action_code.act h d)) + (SetMembers.raw X)) (SetMembers.raw W) ∈ geometry.meetGraph + simpa only [acted, SetMembers.raw_ofMem] using meet + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) +include fulfilled + +theorem internalRow_rectangle_union + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + ∀ (p r : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega)) + (d X V W : SetMembers geometry.carrier) (g₁ g₂ : SetMembers geometry.actors), + ExternalRectangleCode geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action (SetMembers.raw V) (SetMembers.raw W) + (SetMembers.raw d) (SetMembers.raw g₁) (SetMembers.raw g₂) → + a.iso g₁ d ≤ X → a.iso g₂ d ≤ X → + (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p) → i.val ≤ d) → + (∀ i : {i : SetMembers geometry.carrier // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw r) → i.val ≤ X) → + r ≤ act.iso g₁ p → r ≤ act.iso g₂ p → + ∃ h₁ h₂ : SetMembers geometry.actors, + RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph geometry.action + (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) + (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) + (SetMembers.raw h₁) (SetMembers.raw h₂) ∧ + ∃ t : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega), + SetMembers.raw t = (SetMembers.raw r ∪ SetMembers.raw (act.iso h₁ p)) ∪ + SetMembers.raw (act.iso h₂ p) ∧ + t ≤ r ∧ t ≤ act.iso h₁ p ∧ t ≤ act.iso h₂ p := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + dsimp only + intro p r d X V W g₁ g₂ request bound₁ bound₂ bp br reference₁ reference₂ + have upper (g : SetMembers geometry.actors) (bound : a.iso g d ≤ X) : + ∀ y ∈ geometry.carrier, + ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw d)) y ∈ geometry.action → + ZFSet.pair y (SetMembers.raw X) ∈ geometry.order := by + intro y hy entry + have acted := (geometry.action_code.act_eq_iff g d (SetMembers.ofMem y hy)).2 + (by simpa only [SetMembers.raw_ofMem] using entry) + change ZFSet.pair (SetMembers.raw (geometry.action_code.act g d)) (SetMembers.raw X) + ∈ geometry.order at bound + simpa only [acted, SetMembers.raw_ofMem] using bound + obtain ⟨k, hk, l, hl, rectangle⟩ := fulfilled.rectangles + _ _ _ _ _ _ request (SetMembers.raw_mem X) (upper g₁ bound₁) (upper g₂ bound₂) + let h₁ := SetMembers.ofMem k hk + let h₂ := SetMembers.ofMem l hl + have code : RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph + geometry.action (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw d) + (SetMembers.raw g₁) (SetMembers.raw g₂) (SetMembers.raw X) + (SetMembers.raw h₁) (SetMembers.raw h₂) := by + simpa only [h₁, h₂, SetMembers.raw_ofMem] using rectangle + have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) + (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action + (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : + ∀ i, i ≤ v → a.iso g i = a.iso h i := by + intro i lower + apply SetMembers.raw_injective + exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) + lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) + have agree₁ := agree h₁ g₁ V code.first_agreement + have agree₂ := agree h₂ g₂ V code.second_agreement + have agreeW := agree h₁ h₂ W code.common_agreement + obtain ⟨v, hv, w, hw, y, hy, z, hz, t, ht, + gv, hwv, ky, lz, kt, _, meet₁, meet₂, meetW⟩ := code.values + have value (g : SetMembers geometry.actors) (x : SetMembers geometry.carrier) + (y : ZFSet.{u}) (hy : y ∈ geometry.carrier) + (entry : ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw x)) y ∈ geometry.action) : + SetMembers.raw (a.iso g x) = y := by + have acted := (geometry.action_code.act_eq_iff g x (SetMembers.ofMem y hy)).2 + (by simpa only [SetMembers.raw_ofMem] using entry) + exact (congrArg SetMembers.raw acted).trans (SetMembers.raw_ofMem y hy) + have eqv := value g₁ V v hv gv + have eqw := value g₂ V w hw hwv + have eqy := value h₁ d y hy ky + have eqz := value h₂ d z hz lz + have eqt := value h₁ W t ht kt + have overlap₁ : ∀ i, i ≤ a.iso h₁ d → i ≤ X → i ≤ a.iso h₁ V := by + intro i iy ix + rw [agree₁ V le_rfl] + change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso g₁ V)) ∈ geometry.order + rw [eqv] + change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₁ d)) ∈ geometry.order at iy + rw [eqy] at iy + exact geometry.meet.greatest y (SetMembers.raw X) v (SetMembers.raw i) + (SetMembers.raw_mem i) meet₁ iy ix + have overlap₂ : ∀ i, i ≤ a.iso h₂ d → i ≤ X → i ≤ a.iso h₂ V := by + intro i iz ix + rw [agree₂ V le_rfl] + change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso g₂ V)) ∈ geometry.order + rw [eqw] + change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₂ d)) ∈ geometry.order at iz + rw [eqz] at iz + exact geometry.meet.greatest z (SetMembers.raw X) w (SetMembers.raw i) + (SetMembers.raw_mem i) meet₂ iz ix + have overlapW : ∀ i, i ≤ a.iso h₁ d → i ≤ a.iso h₂ d → i ≤ a.iso h₁ W := by + intro i iy iz + change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₁ W)) ∈ geometry.order + rw [eqt] + change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₁ d)) ∈ geometry.order at iy + change ZFSet.pair (SetMembers.raw i) (SetMembers.raw (a.iso h₂ d)) ∈ geometry.order at iz + rw [eqy] at iy + rw [eqz] at iz + exact geometry.meet.greatest y z t (SetMembers.raw i) (SetMembers.raw_mem i) meetW iy iz + refine ⟨h₁, h₂, code, ?_⟩ + exact M.internalRowAction_rectangle_union a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) choice p r d X V W + g₁ g₂ h₁ h₂ bp br reference₁ reference₂ agree₁ agree₂ agreeW overlap₁ overlap₂ overlapW + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) +variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +include collection order nodeMaps supports + +theorem binaryRowStructural_aligned_copy_union + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (meet : L → L → L) {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (muOrdinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) + (g h : G) (D X V : L), + SetMembers.raw p = ZFSet.pair (c.encode r) A → + SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → + q ≤ upperAct.iso g p → + (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i ≤ D) → + (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ + stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + g⁻¹ * h ∈ a.principalFix V → + meet (a.iso h D) X = a.iso h V → + meet (a.iso h D) X ≤ a.iso h D → + meet (a.iso h D) X ≤ X → + (∀ z : L, z ≤ a.iso h D → z ≤ X → z ≤ meet (a.iso h D) X) → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : L) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (meet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A + ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, + SetMembers.raw row = SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h r) ∧ + SetMembers.raw result = ZFSet.pair (c.encode row) (movedA ∪ oldA) ∧ + result ≤ upperAct.iso h p ∧ result ≤ q := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder + forcingAction omega topMem topRows packed I anchors upperQ + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + intro upperAct p q r oldRow A oldA g h D X V pCode qCode prepared below usedD usedX dataD dataX + relative overlap meetLeft meetRight meetGreatest descent movedA + have source : ZFSet.pair (c.encode r) A ∈ upperQ := pCode ▸ SetMembers.raw_mem p + have oldSource : ZFSet.pair (c.encode oldRow) oldA ∈ upperQ := qCode ▸ SetMembers.raw_mem q + have reference := M.semanticStructuralOrder_action_coordinates c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hs hh stagesOrdinal trace g p q r oldRow A oldA pCode qCode below + have agree (i : L) (hi : i ≤ V) : a.iso h i = a.iso g i := by + have fixed := relative i hi + have moved := congrArg (a.iso g) fixed + simpa only [a.mul, a.point_inv_right] using moved + obtain ⟨row, rowCode, rowBelowOld, rowBelowH⟩ := + M.internalRowAction_one_copy_union a s b C pairing unions powers separation infinite hL hC hG graph + choice r oldRow D X V g h (fun i hi => usedD i.val hi) (fun i hi => usedX i.val hi) + reference.1 (fun i hi hx => overlap ▸ meetGreatest i hi hx) agree + have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages packed + (ZFSet.pair (c.encode r) A)).1 source |>.1 + have hA : A ∈ M.sets := ((M.mem_groundSmallSubsets _ _ A).1 (ZFSet.pair_mem_prod.1 candidate).2).1 + have transported := M.binaryRowStructuralAssignmentImage_dataBound a s b C pairing unions powers + separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh + stagesOrdinal trace h D A hA dataD + have unionFacts := M.semanticStructuralTrace_aligned_copy_union c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order + graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace infinite choice small meet I S mu s.nonbottom.carrier tuples + (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) + (fun D f _ tau entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation + infinite hL hC hG graph hmu muOrdinal valid f tau D entry bound.2) + r oldRow row A oldA g h D X V source oldSource (pCode ▸ prepared) + rowBelowOld reference.1 rowBelowH reference.2 relative overlap meetLeft meetRight meetGreatest + transported.2.2 dataX descent + let result : SetMembers upperQ := SetMembers.ofMem _ unionFacts.1 + have resultCode : SetMembers.raw result = ZFSet.pair (c.encode row) (movedA ∪ oldA) := + SetMembers.raw_ofMem _ _ + have movedCode := M.semanticStructuralAction_coordinates c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order + graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace h p r A pCode + refine ⟨row, result, rowCode, resultCode, ?_, ?_⟩ + · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw (upperAct.iso h p)) ∈ _ + rw [resultCode, movedCode] + exact unionFacts.2.1 + · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw q) ∈ _ + rw [resultCode, qCode] + exact unionFacts.2.2 + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem structural_separating_copy_union + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) + (g1 g2 : SetMembers geometry.actors) (dBound X W : SetMembers geometry.carrier), + SetMembers.raw p = ZFSet.pair (c.encode r) A → + SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → + q ≤ upperAct.iso g1 p → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw r) → i ≤ dBound) → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → + (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ + stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + W ≤ dBound → g1 ∈ a.principalFix W → g2 ∈ a.principalFix W → + a.iso g1 dBound ≤ X → a.iso g2 dBound ≤ X → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + ∃ h : SetMembers geometry.actors, + h ∈ a.principalFix W ∧ + geometry.meet.smallMeet (a.iso h dBound) X = W ∧ + geometry.meet.smallMeet (a.iso h dBound) (a.iso g1 dBound) = W ∧ + geometry.meet.smallMeet (a.iso h dBound) (a.iso g2 dBound) = W ∧ + (let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A; + ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, + SetMembers.raw row = SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h r) ∧ + SetMembers.raw result = ZFSet.pair (c.encode row) (movedA ∪ oldA) ∧ + result ≤ q ∧ result ≤ upperAct.iso h p) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + intro p q r oldRow A oldA g1 g2 dBound X W pCode qCode prepared below + usedD usedX dataD dataX wd fixed1 fixed2 bound1 bound2 descent + have fixedLower (g : SetMembers geometry.actors) (fixed : g ∈ a.principalFix W) : + W ≤ a.iso g dBound := by + have lower := (a.iso g).monotone wd + rw [fixed W le_rfl] at lower + exact lower + obtain ⟨h, fixed, overlap⟩ := fulfilled.decoded_separate_at W dBound X wd + ((fixedLower g1 fixed1).trans bound1) + have relative : g1⁻¹ * h ∈ a.principalFix W := + (a.principalFix W).mul_mem ((a.principalFix W).inv_mem fixed1) fixed + have overlapMoved : geometry.meet.smallMeet (a.iso h dBound) X = a.iso h W := + overlap.trans (fixed W le_rfl).symm + obtain ⟨row, result, rowCode, resultCode, toH, toOld⟩ := + M.binaryRowStructural_aligned_copy_union a s b columns pairing unions powers separation + collection infinite hL order hC hG graph nodeMaps supports directed choice small geometry.meet.smallMeet + hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace p q r oldRow A oldA g1 h dBound X W + pCode qCode prepared below usedD usedX dataD dataX relative overlapMoved + (geometry.meet.toSmallMeetOrder.meet_le_left _ _) + (geometry.meet.toSmallMeetOrder.meet_le_right _ _) + (fun _ left right => geometry.meet.toSmallMeetOrder.le_meet left right) descent + have apart (Y : SetMembers geometry.carrier) (wy : W ≤ Y) (yx : Y ≤ X) : + geometry.meet.smallMeet (a.iso h dBound) Y = W := by + apply le_antisymm + · rw [← overlap] + exact geometry.meet.toSmallMeetOrder.le_meet + (geometry.meet.toSmallMeetOrder.meet_le_left _ _) + (le_trans (geometry.meet.toSmallMeetOrder.meet_le_right _ _) yx) + · exact geometry.meet.toSmallMeetOrder.le_meet (fixedLower h fixed) wy + exact ⟨h, fixed, overlap, apart _ (fixedLower g1 fixed1) bound1, + apart _ (fixedLower g2 fixed2) bound2, row, result, rowCode, resultCode, toOld, toH⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowTerms.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowTerms.lean index 3a55a83691b95b2a146aae84e7349c50222eb66c..4e88071bd25b15e3add315b55d225f0f5f300f18 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowTerms.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalRowTerms.lean @@ -1,376 +1,376 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalChronology - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) - -namespace TransitiveGround -variable (M) - -theorem groundOmegaOne_member_countable {A : ZFSet.{u}} - (member : A ∈ M.groundOmegaOne pairing unions powers separation collection infinite) : - M.groundEmbeddable A ZFSet.omega := - ((M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.2.1 A).1 member |>.2.2 - -end TransitiveGround - -namespace GroundStandardInaccessible -variable {K : ZFSet.{u}} (standard : GroundStandardInaccessible M K) -include standard - -theorem groundOmegaOne_mem (hK : K ∈ M.sets) : - M.groundOmegaOne pairing unions powers separation collection infinite ∈ K := - (standard.to_conditions pairing unions powers separation hK).groundOmegaOne_mem - pairing unions powers separation collection infinite hK - -theorem groundOmegaOne_rank_lt (hK : K ∈ M.sets) : - ZFSet.rank (M.groundOmegaOne pairing unions powers separation collection infinite) < ZFSet.rank K := - ZFSet.rank_lt_of_mem (standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK) - -end GroundStandardInaccessible -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem rowPositionSequences_below {L r I mu K : ZFSet.{u}} - (hL : L ∈ M.sets) (hr : r ∈ M.sets) (hI : I ∈ M.sets) - (hmu : mu ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (muSmall : GroundBelow M mu K) (positionsSmall : GroundBelow M I K) : - GroundBelow M (M.rowPositionSequences L r I mu) K := - (GroundBelow.relations pairing unions powers separation hmu hI hK ordinal strong - muSmall positionsSmall).restrict separation - (M.rowPositionSequences_mem pairing unions powers separation hL hr hI hmu) hK - (fun _ member => (ZFSet.mem_sep.1 member).1) - -theorem exists_infiniteGroundCardinal_bound - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {I K : ZFSet.{u}} (hI : I ∈ M.sets) (hK : K ∈ M.sets) - (standard : GroundStandardInaccessible M K) (small : GroundBelow M I K) : - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable I mu := by - let Omega := M.groundOmegaOne pairing unions powers separation collection infinite - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have hOmega : Omega ∈ M.sets := spec.1 - have omegaBelow : GroundBelow M Omega K := GroundBelow.of_member pairing unions powers - separation hK (standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK) - obtain ⟨gamma, hgammaK, first, second⟩ := small.common_bound omegaBelow standard.1.1 - have hgamma := M.transitive hK hgammaK - obtain ⟨mu, hmu, cardinal, bound, f, hf, forward, _, _⟩ := - M.exists_groundCardinalRepresentative pairing unions powers separation hgamma - (ordinalSetProperty_member standard.1.1 hgammaK) - have hmuK : mu ∈ K := bound.elim (fun equal => equal ▸ hgammaK) - (fun member => standard.1.1.1 gamma hgammaK mu member) - obtain ⟨g, hg, intoGamma⟩ := first - have positions : M.groundEmbeddable I mu := - ⟨relationCompose I gamma mu g f, - M.relationCompose_mem pairing unions powers separation hI hgamma hmu hg hf, - intoGamma.compose forward⟩ - obtain ⟨e, he, omegaIntoGamma⟩ := second - have omegaIntoMu : M.groundEmbeddable Omega mu := - ⟨relationCompose Omega gamma mu e f, - M.relationCompose_mem pairing unions powers separation hOmega hgamma hmu he hf, - omegaIntoGamma.compose forward⟩ - have uncountable : ¬ M.groundEmbeddable mu ZFSet.omega := by - rintro ⟨b, hb, intoOmega⟩ - obtain ⟨a, ha, intoMu⟩ := omegaIntoMu - exact spec.2.2.2 ⟨relationCompose Omega mu ZFSet.omega a b, - M.relationCompose_mem pairing unions powers separation hOmega hmu - (M.omega_mem separation infinite) ha hb, intoMu.compose intoOmega⟩ - have infiniteBound : ZFSet.omega ⊆ mu := by - obtain ⟨o, equal⟩ := (ordinalSetProperty_iff mu).1 cardinal.1 - by_cases lower : Ordinal.omega0 ≤ o - · rw [equal, ← ordinalCode_omega, ordinalCode_subset_iff] - exact lower - · have subset : mu ⊆ ZFSet.omega := by - rw [equal, ← ordinalCode_omega, ordinalCode_subset_iff] - exact le_of_lt (lt_of_not_ge lower) - exact False.elim (uncountable ⟨identityFunctionGraph mu, - M.identityFunctionGraph_mem pairing unions powers separation hmu, - (identityFunctionGraph_injection mu).retarget subset⟩) - exact ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions⟩ - -theorem exists_smallRowPositionSequences - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {L r I K : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) - (hI : I ∈ M.sets) (hK : K ∈ M.sets) - (standard : GroundStandardInaccessible M K) (small : GroundBelow M I K) : - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable I mu ∧ M.rowPositionSequences L r I mu ∈ M.sets ∧ - GroundBelow M (M.rowPositionSequences L r I mu) K := by - obtain ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions⟩ := - M.exists_infiniteGroundCardinal_bound pairing unions powers separation collection infinite - hI hK standard small - have conditions := standard.to_conditions pairing unions powers separation hK - exact ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, - M.rowPositionSequences_mem pairing unions powers separation hL hr hI hmu, - M.rowPositionSequences_below pairing unions powers separation hL hr hI hmu hK - conditions.1 conditions.2.2.2 - (GroundBelow.of_member pairing unions powers separation hK hmuK) small⟩ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] - -structure GroundMainFinalInclusions - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (geometry : GroundMainFinalGeometry M C D rD) where - pointMap : I → ZFSet.{u} - actorMap : I → ZFSet.{u} - pointFamily : ZFSet.{u} - actorFamily : ZFSet.{u} - pointMap_ground : ∀ i, pointMap i ∈ M.sets - actorMap_ground : ∀ i, actorMap i ∈ M.sets - pointFamily_ground : pointFamily ∈ M.sets - actorFamily_ground : actorFamily ∈ M.sets - pointFamily_function : FunctionGraphOn run.indices pointFamily - actorFamily_function : FunctionGraphOn run.indices actorFamily - pointFamily_entry : ∀ i f, ZFSet.pair (run.key i) f ∈ pointFamily ↔ f = pointMap i - actorFamily_entry : ∀ i f, ZFSet.pair (run.key i) f ∈ actorFamily ↔ f = actorMap i - point_embedding : ∀ i, MeetEmbeddingCode (run.diagram.stage i).stage.carrier geometry.carrier - (run.diagram.stage i).stage.order geometry.order (run.diagram.stage i).stage.meetGraph - geometry.meetGraph (pointMap i) - order_iff : ∀ i x y p q, ZFSet.pair x p ∈ pointMap i → ZFSet.pair y q ∈ pointMap i → - (ZFSet.pair p q ∈ geometry.order ↔ ZFSet.pair x y ∈ (run.diagram.stage i).stage.order) - actor_embedding : ∀ i, GroupEmbeddingCode (run.diagram.stage i).stage.actors geometry.actors - (run.diagram.stage i).stage.multiplication geometry.multiplication - (run.diagram.stage i).stage.identity geometry.identity (actorMap i) - inverse_iff : ∀ i a b g h, ZFSet.pair a g ∈ actorMap i → ZFSet.pair b h ∈ actorMap i → - (ZFSet.pair g h ∈ geometry.inverse ↔ ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse) - action_iff : ∀ i a g x y p q, ZFSet.pair a g ∈ actorMap i → - ZFSet.pair x p ∈ pointMap i → ZFSet.pair y q ∈ pointMap i → - (ZFSet.pair (ZFSet.pair g p) q ∈ geometry.action ↔ - ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action) - bottom : ∀ i, ZFSet.pair (run.diagram.stage i).stage.bottom geometry.bottom ∈ pointMap i - height : ∀ i x p, ZFSet.pair x p ∈ pointMap i → ∀ t, - (ZFSet.pair p t ∈ geometry.height ↔ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height) - birth : ∀ i x p t, ZFSet.pair x p ∈ pointMap i → - (ZFSet.pair p t ∈ geometry.birth ↔ ZFSet.pair x t ∈ (run.diagram.stage i).birth) - old_fiber : ∀ i p t, (t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) → - (ZFSet.pair p t ∈ geometry.birth ↔ ∃ x ∈ (run.diagram.stage i).stage.carrier, - ZFSet.pair x t ∈ (run.diagram.stage i).birth ∧ ZFSet.pair x p ∈ pointMap i) - point_comp : ∀ {i j} (before : i ≤ j), relationCompose (run.diagram.stage i).stage.carrier - (run.diagram.stage j).stage.carrier geometry.carrier (run.diagram.transition before).map.points - (pointMap j) = pointMap i - actor_comp : ∀ {i j} (before : i ≤ j), relationCompose (run.diagram.stage i).stage.actors - (run.diagram.stage j).stage.actors geometry.actors (run.diagram.transition before).map.actors - (actorMap j) = actorMap i - point_coverage : ∀ p ∈ geometry.carrier, ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ - ZFSet.pair x p ∈ pointMap i - actor_coverage : ∀ g ∈ geometry.actors, ∃ i a, a ∈ (run.diagram.stage i).stage.actors ∧ - ZFSet.pair a g ∈ actorMap i - agreement : ∀ i g h g' h' x x', ZFSet.pair g g' ∈ actorMap i → - ZFSet.pair h h' ∈ actorMap i → ZFSet.pair x x' ∈ pointMap i → - ActionAgreementBelow (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order - (run.diagram.stage i).stage.action g h x → - ActionAgreementBelow geometry.carrier geometry.order geometry.action g' h' x' - -namespace GroundMainPrefix -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def finalInclusions (i₀ : I) : GroundMainFinalInclusions run (run.finalGeometry i₀) where - pointMap := run.limitPointMap - actorMap := run.limitActorMap - pointFamily := run.limitPointInclusions - actorFamily := run.limitActorInclusions - pointMap_ground := run.limitPointMap_ground - actorMap_ground := run.limitActorMap_ground - pointFamily_ground := run.limitPointInclusions_ground - actorFamily_ground := run.limitActorInclusions_ground - pointFamily_function := run.limitPointInclusions_function - actorFamily_function := run.limitActorInclusions_function - pointFamily_entry := run.limitPointInclusions_entry - actorFamily_entry := run.limitActorInclusions_entry - point_embedding := run.limitPointMap_meetEmbedding - order_iff := run.limitPointMap_order_iff - actor_embedding := run.limitActorMap_groupEmbedding i₀ - inverse_iff := run.limitActorMap_inverse_iff - action_iff := run.limitMaps_action_iff - bottom := run.limitPointMap_bottom i₀ - height := fun i _ _ image t => run.limitPointMap_height i image t - birth := run.limitPointMap_birth_iff - old_fiber := run.limitBirth_old_fiber - point_comp := run.limitPointMap_comp - actor_comp := run.limitActorMap_comp - point_coverage := by - intro p hp - obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage hp - exact ⟨i, x, hx, (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩⟩ - actor_coverage := by - intro g hg - obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg - exact ⟨i, a, ha, (run.actorPresentation.inclusion_entry i a _).2 ⟨ha, rfl⟩⟩ - agreement := run.limitMaps_agreement - -end GroundMainPrefix - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem finalGeometry_fields_rank_lt (i₀ : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ∀ j, ZFSet.rank ((run.finalGeometry i₀).fields j) < o := - Fin.cases (run.limitPoints_rank_lt limit rank) (Fin.cases (run.limitOrder_rank_lt limit rank) - (Fin.cases (run.limitMeetGraph_rank_lt limit rank) (Fin.cases (run.limitActors_rank_lt limit rank) - (Fin.cases (run.limitMultiplication_rank_lt limit rank) (Fin.cases (run.limitInverse_rank_lt limit rank) - (Fin.cases (run.limitIdentity_rank_lt i₀ limit rank) (Fin.cases (run.limitAction_rank_lt limit rank) - (Fin.cases (run.limitBottom_rank_lt limit rank i₀) (Fin.cases (run.limitHeight_rank_lt limit rank) - (Fin.cases (run.limitBirth_rank_lt limit rank) (fun _ => run.cutoffLimit_rank_le_code.trans_lt rank))))))))))) - -theorem finalGeometry_code_rank_lt (i₀ : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank (run.finalGeometry i₀).code < o := - rank_nonemptyTupleCode_lt limit 11 _ (run.finalGeometry_fields_rank_lt i₀ limit rank) - -theorem finalInclusions_rank_lt (i₀ : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : - ZFSet.rank (run.finalInclusions i₀).pointFamily < o ∧ - ZFSet.rank (run.finalInclusions i₀).actorFamily < o ∧ - ∀ i, ZFSet.rank ((run.finalInclusions i₀).pointMap i) < o ∧ - ZFSet.rank ((run.finalInclusions i₀).actorMap i) < o := - ⟨run.limitPointInclusions_rank_lt limit rank, run.limitActorInclusions_rank_lt limit rank, - fun i => ⟨run.limitPointMap_rank_lt limit rank i, run.limitActorMap_rank_lt limit rank i⟩⟩ - -theorem finalGeometry_below (i₀ : I) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - GroundBelow M (run.finalGeometry i₀).carrier K ∧ GroundBelow M (run.finalGeometry i₀).actors K := - ⟨run.limitPoints_below choice hK standard indices, run.limitActors_below choice hK standard indices⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u v - -namespace GroundMainFinalGeometry -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -theorem exists_rowPositionSequences - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (small : GroundBelow M geometry.carrier K) : - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let positions := (SetMembers.presentation geometry.carrier).nonbottom.carrier - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable positions mu ∧ - M.rowPositionSequences geometry.carrier geometry.order positions mu ∈ M.sets ∧ - GroundBelow M (M.rowPositionSequences geometry.carrier geometry.order positions mu) K ∧ - (∅ : ZFSet.{u}) ∈ M.rowPositionSequences geometry.carrier geometry.order positions mu := by - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionsSmall : GroundBelow M s.nonbottom.carrier K := - small.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - obtain ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, ground, below⟩ := - M.exists_smallRowPositionSequences pairing unions powers separation collection infinite - geometry.carrier_ground geometry.order_ground hPositions hK standard positionsSmall - exact ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, ground, below, - M.empty_mem_rowPositionSequences hmu cardinal.1 ⟨geometry.bottom, geometry.bottom_mem⟩⟩ - -end GroundMainFinalGeometry - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_finalRowPositionSequences (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let positions := (SetMembers.presentation geometry.carrier).nonbottom.carrier - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable positions mu ∧ - M.rowPositionSequences geometry.carrier geometry.order positions mu ∈ M.sets ∧ - GroundBelow M (M.rowPositionSequences geometry.carrier geometry.order positions mu) K ∧ - (∅ : ZFSet.{u}) ∈ M.rowPositionSequences geometry.carrier geometry.order positions mu := - (run.finalGeometry i₀).exists_rowPositionSequences pairing unions powers separation - collection infinite hK standard (run.finalGeometry_below i₀ choice hK standard indices).1 - -end GroundMainPrefix -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundMainFinalGeometry -open SetFormula SetRealization -open scoped ZFSet -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -theorem exists_smallRowTupleTerms - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (small : GroundBelow M geometry.carrier K) : - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let positions := (SetMembers.presentation geometry.carrier).nonbottom.carrier - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable positions mu ∧ - let S := M.rowPositionSequences geometry.carrier geometry.order positions mu - S ∈ M.sets ∧ GroundBelow M S K ∧ (∅ : ZFSet.{u}) ∈ S ∧ - ∀ one : SetMembers (M.smallPartialFunctions (ZFSet.prod positions C) (natSetCode 2) ZFSet.omega), - let rows := M.binaryRowNameGraph positions C one - let family := rowTupleFamily (SetMembers.raw one) mu positions (⋃₀ ⋃₀ rows) rows S - let T := rowTupleTerms (SetMembers.raw one) mu positions (⋃₀ ⋃₀ rows) rows S - family ∈ M.sets ∧ T ∈ M.sets ∧ ZFSet.IsFunc S T family ∧ GroundBelow M T K := by - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - obtain ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, hS, smallS, empty⟩ := - geometry.exists_rowPositionSequences pairing unions powers separation collection infinite hK standard small - refine ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, hS, smallS, empty, ?_⟩ - intro one - exact M.binaryRowTupleTerms_mem_below pairing unions powers separation collection infinite choice - geometry.carrier_ground geometry.order_ground - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) geometry.columns_ground hmu hK smallS one - -end PartitionPilot.Forcing.GroundMainFinalGeometry - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalChronology + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) + +namespace TransitiveGround +variable (M) + +theorem groundOmegaOne_member_countable {A : ZFSet.{u}} + (member : A ∈ M.groundOmegaOne pairing unions powers separation collection infinite) : + M.groundEmbeddable A ZFSet.omega := + ((M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.2.1 A).1 member |>.2.2 + +end TransitiveGround + +namespace GroundStandardInaccessible +variable {K : ZFSet.{u}} (standard : GroundStandardInaccessible M K) +include standard + +theorem groundOmegaOne_mem (hK : K ∈ M.sets) : + M.groundOmegaOne pairing unions powers separation collection infinite ∈ K := + (standard.to_conditions pairing unions powers separation hK).groundOmegaOne_mem + pairing unions powers separation collection infinite hK + +theorem groundOmegaOne_rank_lt (hK : K ∈ M.sets) : + ZFSet.rank (M.groundOmegaOne pairing unions powers separation collection infinite) < ZFSet.rank K := + ZFSet.rank_lt_of_mem (standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK) + +end GroundStandardInaccessible +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem rowPositionSequences_below {L r I mu K : ZFSet.{u}} + (hL : L ∈ M.sets) (hr : r ∈ M.sets) (hI : I ∈ M.sets) + (hmu : mu ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (muSmall : GroundBelow M mu K) (positionsSmall : GroundBelow M I K) : + GroundBelow M (M.rowPositionSequences L r I mu) K := + (GroundBelow.relations pairing unions powers separation hmu hI hK ordinal strong + muSmall positionsSmall).restrict separation + (M.rowPositionSequences_mem pairing unions powers separation hL hr hI hmu) hK + (fun _ member => (ZFSet.mem_sep.1 member).1) + +theorem exists_infiniteGroundCardinal_bound + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {I K : ZFSet.{u}} (hI : I ∈ M.sets) (hK : K ∈ M.sets) + (standard : GroundStandardInaccessible M K) (small : GroundBelow M I K) : + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable I mu := by + let Omega := M.groundOmegaOne pairing unions powers separation collection infinite + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have hOmega : Omega ∈ M.sets := spec.1 + have omegaBelow : GroundBelow M Omega K := GroundBelow.of_member pairing unions powers + separation hK (standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK) + obtain ⟨gamma, hgammaK, first, second⟩ := small.common_bound omegaBelow standard.1.1 + have hgamma := M.transitive hK hgammaK + obtain ⟨mu, hmu, cardinal, bound, f, hf, forward, _, _⟩ := + M.exists_groundCardinalRepresentative pairing unions powers separation hgamma + (ordinalSetProperty_member standard.1.1 hgammaK) + have hmuK : mu ∈ K := bound.elim (fun equal => equal ▸ hgammaK) + (fun member => standard.1.1.1 gamma hgammaK mu member) + obtain ⟨g, hg, intoGamma⟩ := first + have positions : M.groundEmbeddable I mu := + ⟨relationCompose I gamma mu g f, + M.relationCompose_mem pairing unions powers separation hI hgamma hmu hg hf, + intoGamma.compose forward⟩ + obtain ⟨e, he, omegaIntoGamma⟩ := second + have omegaIntoMu : M.groundEmbeddable Omega mu := + ⟨relationCompose Omega gamma mu e f, + M.relationCompose_mem pairing unions powers separation hOmega hgamma hmu he hf, + omegaIntoGamma.compose forward⟩ + have uncountable : ¬ M.groundEmbeddable mu ZFSet.omega := by + rintro ⟨b, hb, intoOmega⟩ + obtain ⟨a, ha, intoMu⟩ := omegaIntoMu + exact spec.2.2.2 ⟨relationCompose Omega mu ZFSet.omega a b, + M.relationCompose_mem pairing unions powers separation hOmega hmu + (M.omega_mem separation infinite) ha hb, intoMu.compose intoOmega⟩ + have infiniteBound : ZFSet.omega ⊆ mu := by + obtain ⟨o, equal⟩ := (ordinalSetProperty_iff mu).1 cardinal.1 + by_cases lower : Ordinal.omega0 ≤ o + · rw [equal, ← ordinalCode_omega, ordinalCode_subset_iff] + exact lower + · have subset : mu ⊆ ZFSet.omega := by + rw [equal, ← ordinalCode_omega, ordinalCode_subset_iff] + exact le_of_lt (lt_of_not_ge lower) + exact False.elim (uncountable ⟨identityFunctionGraph mu, + M.identityFunctionGraph_mem pairing unions powers separation hmu, + (identityFunctionGraph_injection mu).retarget subset⟩) + exact ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions⟩ + +theorem exists_smallRowPositionSequences + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {L r I K : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) + (hI : I ∈ M.sets) (hK : K ∈ M.sets) + (standard : GroundStandardInaccessible M K) (small : GroundBelow M I K) : + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable I mu ∧ M.rowPositionSequences L r I mu ∈ M.sets ∧ + GroundBelow M (M.rowPositionSequences L r I mu) K := by + obtain ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions⟩ := + M.exists_infiniteGroundCardinal_bound pairing unions powers separation collection infinite + hI hK standard small + have conditions := standard.to_conditions pairing unions powers separation hK + exact ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, + M.rowPositionSequences_mem pairing unions powers separation hL hr hI hmu, + M.rowPositionSequences_below pairing unions powers separation hL hr hI hmu hK + conditions.1 conditions.2.2.2 + (GroundBelow.of_member pairing unions powers separation hK hmuK) small⟩ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] + +structure GroundMainFinalInclusions + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (geometry : GroundMainFinalGeometry M C D rD) where + pointMap : I → ZFSet.{u} + actorMap : I → ZFSet.{u} + pointFamily : ZFSet.{u} + actorFamily : ZFSet.{u} + pointMap_ground : ∀ i, pointMap i ∈ M.sets + actorMap_ground : ∀ i, actorMap i ∈ M.sets + pointFamily_ground : pointFamily ∈ M.sets + actorFamily_ground : actorFamily ∈ M.sets + pointFamily_function : FunctionGraphOn run.indices pointFamily + actorFamily_function : FunctionGraphOn run.indices actorFamily + pointFamily_entry : ∀ i f, ZFSet.pair (run.key i) f ∈ pointFamily ↔ f = pointMap i + actorFamily_entry : ∀ i f, ZFSet.pair (run.key i) f ∈ actorFamily ↔ f = actorMap i + point_embedding : ∀ i, MeetEmbeddingCode (run.diagram.stage i).stage.carrier geometry.carrier + (run.diagram.stage i).stage.order geometry.order (run.diagram.stage i).stage.meetGraph + geometry.meetGraph (pointMap i) + order_iff : ∀ i x y p q, ZFSet.pair x p ∈ pointMap i → ZFSet.pair y q ∈ pointMap i → + (ZFSet.pair p q ∈ geometry.order ↔ ZFSet.pair x y ∈ (run.diagram.stage i).stage.order) + actor_embedding : ∀ i, GroupEmbeddingCode (run.diagram.stage i).stage.actors geometry.actors + (run.diagram.stage i).stage.multiplication geometry.multiplication + (run.diagram.stage i).stage.identity geometry.identity (actorMap i) + inverse_iff : ∀ i a b g h, ZFSet.pair a g ∈ actorMap i → ZFSet.pair b h ∈ actorMap i → + (ZFSet.pair g h ∈ geometry.inverse ↔ ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse) + action_iff : ∀ i a g x y p q, ZFSet.pair a g ∈ actorMap i → + ZFSet.pair x p ∈ pointMap i → ZFSet.pair y q ∈ pointMap i → + (ZFSet.pair (ZFSet.pair g p) q ∈ geometry.action ↔ + ZFSet.pair (ZFSet.pair a x) y ∈ (run.diagram.stage i).stage.action) + bottom : ∀ i, ZFSet.pair (run.diagram.stage i).stage.bottom geometry.bottom ∈ pointMap i + height : ∀ i x p, ZFSet.pair x p ∈ pointMap i → ∀ t, + (ZFSet.pair p t ∈ geometry.height ↔ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height) + birth : ∀ i x p t, ZFSet.pair x p ∈ pointMap i → + (ZFSet.pair p t ∈ geometry.birth ↔ ZFSet.pair x t ∈ (run.diagram.stage i).birth) + old_fiber : ∀ i p t, (t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) → + (ZFSet.pair p t ∈ geometry.birth ↔ ∃ x ∈ (run.diagram.stage i).stage.carrier, + ZFSet.pair x t ∈ (run.diagram.stage i).birth ∧ ZFSet.pair x p ∈ pointMap i) + point_comp : ∀ {i j} (before : i ≤ j), relationCompose (run.diagram.stage i).stage.carrier + (run.diagram.stage j).stage.carrier geometry.carrier (run.diagram.transition before).map.points + (pointMap j) = pointMap i + actor_comp : ∀ {i j} (before : i ≤ j), relationCompose (run.diagram.stage i).stage.actors + (run.diagram.stage j).stage.actors geometry.actors (run.diagram.transition before).map.actors + (actorMap j) = actorMap i + point_coverage : ∀ p ∈ geometry.carrier, ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ + ZFSet.pair x p ∈ pointMap i + actor_coverage : ∀ g ∈ geometry.actors, ∃ i a, a ∈ (run.diagram.stage i).stage.actors ∧ + ZFSet.pair a g ∈ actorMap i + agreement : ∀ i g h g' h' x x', ZFSet.pair g g' ∈ actorMap i → + ZFSet.pair h h' ∈ actorMap i → ZFSet.pair x x' ∈ pointMap i → + ActionAgreementBelow (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order + (run.diagram.stage i).stage.action g h x → + ActionAgreementBelow geometry.carrier geometry.order geometry.action g' h' x' + +namespace GroundMainPrefix +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def finalInclusions (i₀ : I) : GroundMainFinalInclusions run (run.finalGeometry i₀) where + pointMap := run.limitPointMap + actorMap := run.limitActorMap + pointFamily := run.limitPointInclusions + actorFamily := run.limitActorInclusions + pointMap_ground := run.limitPointMap_ground + actorMap_ground := run.limitActorMap_ground + pointFamily_ground := run.limitPointInclusions_ground + actorFamily_ground := run.limitActorInclusions_ground + pointFamily_function := run.limitPointInclusions_function + actorFamily_function := run.limitActorInclusions_function + pointFamily_entry := run.limitPointInclusions_entry + actorFamily_entry := run.limitActorInclusions_entry + point_embedding := run.limitPointMap_meetEmbedding + order_iff := run.limitPointMap_order_iff + actor_embedding := run.limitActorMap_groupEmbedding i₀ + inverse_iff := run.limitActorMap_inverse_iff + action_iff := run.limitMaps_action_iff + bottom := run.limitPointMap_bottom i₀ + height := fun i _ _ image t => run.limitPointMap_height i image t + birth := run.limitPointMap_birth_iff + old_fiber := run.limitBirth_old_fiber + point_comp := run.limitPointMap_comp + actor_comp := run.limitActorMap_comp + point_coverage := by + intro p hp + obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage hp + exact ⟨i, x, hx, (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩⟩ + actor_coverage := by + intro g hg + obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg + exact ⟨i, a, ha, (run.actorPresentation.inclusion_entry i a _).2 ⟨ha, rfl⟩⟩ + agreement := run.limitMaps_agreement + +end GroundMainPrefix + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem finalGeometry_fields_rank_lt (i₀ : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ∀ j, ZFSet.rank ((run.finalGeometry i₀).fields j) < o := + Fin.cases (run.limitPoints_rank_lt limit rank) (Fin.cases (run.limitOrder_rank_lt limit rank) + (Fin.cases (run.limitMeetGraph_rank_lt limit rank) (Fin.cases (run.limitActors_rank_lt limit rank) + (Fin.cases (run.limitMultiplication_rank_lt limit rank) (Fin.cases (run.limitInverse_rank_lt limit rank) + (Fin.cases (run.limitIdentity_rank_lt i₀ limit rank) (Fin.cases (run.limitAction_rank_lt limit rank) + (Fin.cases (run.limitBottom_rank_lt limit rank i₀) (Fin.cases (run.limitHeight_rank_lt limit rank) + (Fin.cases (run.limitBirth_rank_lt limit rank) (fun _ => run.cutoffLimit_rank_le_code.trans_lt rank))))))))))) + +theorem finalGeometry_code_rank_lt (i₀ : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank (run.finalGeometry i₀).code < o := + rank_nonemptyTupleCode_lt limit 11 _ (run.finalGeometry_fields_rank_lt i₀ limit rank) + +theorem finalInclusions_rank_lt (i₀ : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : + ZFSet.rank (run.finalInclusions i₀).pointFamily < o ∧ + ZFSet.rank (run.finalInclusions i₀).actorFamily < o ∧ + ∀ i, ZFSet.rank ((run.finalInclusions i₀).pointMap i) < o ∧ + ZFSet.rank ((run.finalInclusions i₀).actorMap i) < o := + ⟨run.limitPointInclusions_rank_lt limit rank, run.limitActorInclusions_rank_lt limit rank, + fun i => ⟨run.limitPointMap_rank_lt limit rank i, run.limitActorMap_rank_lt limit rank i⟩⟩ + +theorem finalGeometry_below (i₀ : I) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + GroundBelow M (run.finalGeometry i₀).carrier K ∧ GroundBelow M (run.finalGeometry i₀).actors K := + ⟨run.limitPoints_below choice hK standard indices, run.limitActors_below choice hK standard indices⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u v + +namespace GroundMainFinalGeometry +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +theorem exists_rowPositionSequences + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (small : GroundBelow M geometry.carrier K) : + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let positions := (SetMembers.presentation geometry.carrier).nonbottom.carrier + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable positions mu ∧ + M.rowPositionSequences geometry.carrier geometry.order positions mu ∈ M.sets ∧ + GroundBelow M (M.rowPositionSequences geometry.carrier geometry.order positions mu) K ∧ + (∅ : ZFSet.{u}) ∈ M.rowPositionSequences geometry.carrier geometry.order positions mu := by + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionsSmall : GroundBelow M s.nonbottom.carrier K := + small.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + obtain ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, ground, below⟩ := + M.exists_smallRowPositionSequences pairing unions powers separation collection infinite + geometry.carrier_ground geometry.order_ground hPositions hK standard positionsSmall + exact ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, ground, below, + M.empty_mem_rowPositionSequences hmu cardinal.1 ⟨geometry.bottom, geometry.bottom_mem⟩⟩ + +end GroundMainFinalGeometry + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_finalRowPositionSequences (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let positions := (SetMembers.presentation geometry.carrier).nonbottom.carrier + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable positions mu ∧ + M.rowPositionSequences geometry.carrier geometry.order positions mu ∈ M.sets ∧ + GroundBelow M (M.rowPositionSequences geometry.carrier geometry.order positions mu) K ∧ + (∅ : ZFSet.{u}) ∈ M.rowPositionSequences geometry.carrier geometry.order positions mu := + (run.finalGeometry i₀).exists_rowPositionSequences pairing unions powers separation + collection infinite hK standard (run.finalGeometry_below i₀ choice hK standard indices).1 + +end GroundMainPrefix +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundMainFinalGeometry +open SetFormula SetRealization +open scoped ZFSet +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +theorem exists_smallRowTupleTerms + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (small : GroundBelow M geometry.carrier K) : + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let positions := (SetMembers.presentation geometry.carrier).nonbottom.carrier + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable positions mu ∧ + let S := M.rowPositionSequences geometry.carrier geometry.order positions mu + S ∈ M.sets ∧ GroundBelow M S K ∧ (∅ : ZFSet.{u}) ∈ S ∧ + ∀ one : SetMembers (M.smallPartialFunctions (ZFSet.prod positions C) (natSetCode 2) ZFSet.omega), + let rows := M.binaryRowNameGraph positions C one + let family := rowTupleFamily (SetMembers.raw one) mu positions (⋃₀ ⋃₀ rows) rows S + let T := rowTupleTerms (SetMembers.raw one) mu positions (⋃₀ ⋃₀ rows) rows S + family ∈ M.sets ∧ T ∈ M.sets ∧ ZFSet.IsFunc S T family ∧ GroundBelow M T K := by + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + obtain ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, hS, smallS, empty⟩ := + geometry.exists_rowPositionSequences pairing unions powers separation collection infinite hK standard small + refine ⟨mu, hmu, hmuK, cardinal, infiniteBound, positions, hS, smallS, empty, ?_⟩ + intro one + exact M.binaryRowTupleTerms_mem_below pairing unions powers separation collection infinite choice + geometry.carrier_ground geometry.order_ground + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) geometry.columns_ground hmu hK smallS one + +end PartitionPilot.Forcing.GroundMainFinalGeometry + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalSeparatedActors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalSeparatedActors.lean index 4420707ef62dbbf8438d8897ecb7131beecbdb21..235a92b1969bb649439b0b8ed2608cc4ca6a1c65 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalSeparatedActors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalSeparatedActors.lean @@ -1,304 +1,304 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BoundedDirectedOrders -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPrincipalSupportZF -import OAI.SetTheory.PartitionPrinciple.Forcing.MeetOrderPosetActions -import OAI.SetTheory.PartitionPrinciple.Forcing.SmallCodedMeetActions - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable (M : TransitiveGround.{u}) - -theorem geometry_supportBasis_mem {I G : Type u} [Group G] - (s : GeometryPresentation I G) (P : MeetOrder I) (a : OrderAction G P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (nodes : s.points.carrier ∈ M.sets) (group : s.actors.carrier ∈ M.sets) - (order : s.orderRelation P ∈ M.sets) (graph : s.actionGraph P a ∈ M.sets) : - supportBasisCode s.points s.actors a.fixSubgroup ∈ M.sets := by - let := P.toPartialOrder - exact M.principalSupportBasis_mem a.toPosetAction s.points s.actors pairing unions powers separation - nodes group order graph - -theorem decoded_supportBasis_mem {G L m i e R A : ZFSet.{u}} - (group : GroupCode G m i e) (order : PartialOrderCode L R) - (action : PosetActionCode G L m e R A) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hL : L ∈ M.sets) (hG : G ∈ M.sets) (hR : R ∈ M.sets) (hA : A ∈ M.sets) : - letI := group.toGroup - letI := order.toPartialOrder - supportBasisCode (SetMembers.presentation L) (SetMembers.presentation G) - (action.toPosetAction group order).principalFix ∈ M.sets := by - let := group.toGroup - let := order.toPartialOrder - have order_mem : (SetMembers.presentation L).conditionOrder ∈ M.sets := by - rw [order.conditionOrder_eq] - exact hR - have action_mem : (action.toPosetAction group order).actionGraph - (SetMembers.presentation L) (SetMembers.presentation G) ∈ M.sets := by - rw [action.actionGraph_eq group order] - exact hA - exact M.principalSupportBasis_mem (action.toPosetAction group order) - (SetMembers.presentation L) (SetMembers.presentation G) pairing unions powers separation hL hG order_mem action_mem - -noncomputable def decoded_supportFamily {G L m i e R A : ZFSet.{u}} - (group : GroupCode G m i e) (order : PartialOrderCode L R) - (action : PosetActionCode G L m e R A) - (hL : L ∈ M.sets) (hR : R ∈ M.sets) - (directed : Realize M.sets (BoundedFormula.upwardDirectedFormula 0 1).toFormula - (extend L (extend R Fin.elim0))) (C : SetMembers L) : - letI := group.toGroup - Compression.RecursiveMaps.NormalSubgroupFamily (SetMembers G) := by - letI := group.toGroup - letI := order.toPartialOrder - exact (action.toPosetAction group order).principalSupportFamily C - (M.decoded_upward_directed order hL hR directed) - -end TransitiveGround - -section -open SetFormula -universe u - -structure GroundMainFinalGeometry (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) where - carrier : ZFSet.{u} - order : ZFSet.{u} - meetGraph : ZFSet.{u} - actors : ZFSet.{u} - multiplication : ZFSet.{u} - inverse : ZFSet.{u} - identity : ZFSet.{u} - action : ZFSet.{u} - bottom : ZFSet.{u} - height : ZFSet.{u} - birth : ZFSet.{u} - times : ZFSet.{u} - carrier_ground : carrier ∈ M.sets - order_ground : order ∈ M.sets - meet_ground : meetGraph ∈ M.sets - actors_ground : actors ∈ M.sets - multiplication_ground : multiplication ∈ M.sets - inverse_ground : inverse ∈ M.sets - action_ground : action ∈ M.sets - height_ground : height ∈ M.sets - birth_ground : birth ∈ M.sets - times_ground : times ∈ M.sets - columns_ground : C ∈ M.sets - coordinates_ground : D ∈ M.sets - coordinate_order_ground : rD ∈ M.sets - meet : MeetOrderCode carrier order meetGraph - group_code : GroupCode actors multiplication inverse identity - action_code : PosetActionCode actors carrier multiplication identity order action - bottom_mem : bottom ∈ carrier - least : ∀ x ∈ carrier, ZFSet.pair bottom x ∈ order - height_code : StrictLexHeightCode carrier C D order height rD - birth_function : ZFSet.IsFunc carrier times birth - times_ordinal : ordinalSetProperty times - old_meet : OldMeetCode order meetGraph birth - -namespace GroundMainFinalGeometry -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -theorem identity_ground : geometry.identity ∈ M.sets := - M.transitive geometry.actors_ground geometry.group_code.identity_mem - -theorem bottom_ground : geometry.bottom ∈ M.sets := - M.transitive geometry.carrier_ground geometry.bottom_mem - -noncomputable def fields : Fin 12 → ZFSet.{u} := - Fin.cases geometry.carrier (Fin.cases geometry.order (Fin.cases geometry.meetGraph - (Fin.cases geometry.actors (Fin.cases geometry.multiplication (Fin.cases geometry.inverse - (Fin.cases geometry.identity (Fin.cases geometry.action (Fin.cases geometry.bottom - (Fin.cases geometry.height (Fin.cases geometry.birth (fun _ => geometry.times))))))))))) - -theorem fields_ground : ∀ j, geometry.fields j ∈ M.sets := - Fin.cases geometry.carrier_ground (Fin.cases geometry.order_ground (Fin.cases geometry.meet_ground - (Fin.cases geometry.actors_ground (Fin.cases geometry.multiplication_ground (Fin.cases geometry.inverse_ground - (Fin.cases geometry.identity_ground (Fin.cases geometry.action_ground (Fin.cases geometry.bottom_ground - (Fin.cases geometry.height_ground (Fin.cases geometry.birth_ground (fun _ => geometry.times_ground))))))))))) - -noncomputable def code : ZFSet.{u} := nonemptyTupleCode 11 geometry.fields - -theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - geometry.code ∈ M.sets := M.nonemptyTupleCode_mem pairing 11 geometry.fields geometry.fields_ground - -end GroundMainFinalGeometry - -end - -namespace GroundMainFinalGeometry -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -@[instance_reducible] noncomputable def decodedBottom : - letI := geometry.meet.order.toPartialOrder - OrderBot (SetMembers geometry.carrier) := by - letI := geometry.meet.order.toPartialOrder - refine { bot := SetMembers.ofMem geometry.bottom geometry.bottom_mem, bot_le := ?_ } - intro x - change ZFSet.pair (SetMembers.raw (SetMembers.ofMem geometry.bottom geometry.bottom_mem)) - (SetMembers.raw x) ∈ geometry.order - rw [SetMembers.raw_ofMem] - exact geometry.least _ (SetMembers.raw_mem x) - -noncomputable def decodedAction : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - PosetAction (SetMembers geometry.actors) (SetMembers geometry.carrier) := - geometry.action_code.toPosetAction geometry.group_code geometry.meet.order - -theorem decoded_order_eq : - letI := geometry.meet.order.toPartialOrder - (SetMembers.presentation geometry.carrier).conditionOrder = geometry.order := - geometry.meet.order.conditionOrder_eq - -theorem decoded_action_eq : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - geometry.decodedAction.actionGraph (SetMembers.presentation geometry.carrier) - (SetMembers.presentation geometry.actors) = geometry.action := - geometry.action_code.actionGraph_eq geometry.group_code geometry.meet.order - -theorem decoded_supportBasis_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - supportBasisCode (SetMembers.presentation geometry.carrier) (SetMembers.presentation geometry.actors) - geometry.decodedAction.principalFix ∈ M.sets := - M.decoded_supportBasis_mem geometry.group_code geometry.meet.order geometry.action_code - pairing unions powers separation geometry.carrier_ground geometry.actors_ground - geometry.order_ground geometry.action_ground - -theorem decoded_unbounded - (growth : ∀ x ∈ geometry.carrier, ∃ y ∈ geometry.carrier, - ZFSet.pair x y ∈ geometry.order ∧ ¬ ZFSet.pair y x ∈ geometry.order) : - letI := geometry.meet.order.toPartialOrder - ∀ x : SetMembers geometry.carrier, ∃ y : SetMembers geometry.carrier, ¬ y ≤ x := by - let := geometry.meet.order.toPartialOrder - intro x - obtain ⟨y, hy, _, strict⟩ := growth _ (SetMembers.raw_mem x) - refine ⟨SetMembers.ofMem y hy, ?_⟩ - change ¬ ZFSet.pair (SetMembers.raw (SetMembers.ofMem y hy)) (SetMembers.raw x) ∈ geometry.order - simpa only [SetMembers.raw_ofMem] using strict - -theorem decoded_countable_bound - (bounds : ∀ X ∈ M.sets, X ⊆ geometry.carrier → M.groundEmbeddable X ZFSet.omega → - ∃ b ∈ geometry.carrier, ∀ x ∈ X, ZFSet.pair x b ∈ geometry.order) : - letI := geometry.meet.order.toPartialOrder - ∀ X ∈ M.sets, X ⊆ (SetMembers.presentation geometry.carrier).carrier → - M.groundEmbeddable X ZFSet.omega → - ∃ b : SetMembers geometry.carrier, ∀ x : SetMembers geometry.carrier, - (SetMembers.presentation geometry.carrier).encode x ∈ X → x ≤ b := by - let := geometry.meet.order.toPartialOrder - intro X hX subset countable - obtain ⟨b, hb, bound⟩ := bounds X hX subset countable - refine ⟨SetMembers.ofMem b hb, ?_⟩ - intro x hx - change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem b hb)) ∈ geometry.order - rw [SetMembers.raw_ofMem] - exact bound _ hx - -end GroundMainFinalGeometry - -namespace BoundedFormula -open SetFormula - -def separatedActorsFormula : BoundedFormula 7 := - exMem 4 (exMem 5 (exMem 5 (exMem 6 - (.conj (orderedPairFormula 4 3 2) - (.conj (tripleMembershipFormula 3 5 1 9) - (.conj (tripleMembershipFormula 2 5 0 9) (tripleMembershipFormula 1 0 6 10))))))) - -end BoundedFormula - -namespace GroundMainFinalGeometry -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) - -theorem separatedActorPairs_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - let a := geometry.decodedAction - let t := SetMembers.presentation geometry.actors - ∀ (d W : SetMembers geometry.carrier), - (t.product t).subset (fun gh => geometry.meet.smallMeet (a.iso gh.1 d) (a.iso gh.2 d) = W) ∈ M.sets := by - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let a := geometry.decodedAction - let s := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - dsimp only - intro d W - let params := extend (SetMembers.raw d) (extend (SetMembers.raw W) - (extend geometry.carrier (extend geometry.actors (extend geometry.action (extend geometry.meetGraph Fin.elim0))))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases (M.transitive geometry.carrier_ground (SetMembers.raw_mem d)) - (Fin.cases (M.transitive geometry.carrier_ground (SetMembers.raw_mem W)) - (Fin.cases geometry.carrier_ground (Fin.cases geometry.actors_ground - (Fin.cases geometry.action_ground (Fin.cases geometry.meet_ground (fun i => Fin.elim0 i)))))) - have selected := M.bounded_separation_mem separation BoundedFormula.separatedActorsFormula params members - (M.prod_mem pairing unions powers separation geometry.actors_ground geometry.actors_ground) - have correct (z : ZFSet.{u}) : BoundedFormula.Truth BoundedFormula.separatedActorsFormula - (extend z params) ↔ z ∈ (t.product t).subset - (fun gh => geometry.meet.smallMeet (a.iso gh.1 d) (a.iso gh.2 d) = W) := by - simp only [BoundedFormula.separatedActorsFormula, BoundedFormula.truth_exMem, BoundedFormula.Truth, - BoundedFormula.truth_orderedPairFormula, BoundedFormula.truth_tripleMembershipFormula] - change (∃ h₁ ∈ geometry.actors, ∃ h₂ ∈ geometry.actors, - ∃ x ∈ geometry.carrier, ∃ y ∈ geometry.carrier, - z = ZFSet.pair h₁ h₂ ∧ ZFSet.pair (ZFSet.pair h₁ (SetMembers.raw d)) x ∈ geometry.action ∧ - ZFSet.pair (ZFSet.pair h₂ (SetMembers.raw d)) y ∈ geometry.action ∧ - ZFSet.pair (ZFSet.pair x y) (SetMembers.raw W) ∈ geometry.meetGraph) ↔ _ - have action (g : SetMembers geometry.actors) (x : SetMembers geometry.carrier) : - ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw d)) (SetMembers.raw x) ∈ geometry.action ↔ - a.iso g d = x := by - rw [← geometry.decoded_action_eq] - exact a.triple_mem_actionGraph s t g d x - constructor - · rintro ⟨h₁,hh₁,h₂,hh₂,x,hx,y,hy,shape,first,second,meet⟩ - obtain ⟨g₁,rfl⟩ := (t.mem_carrier h₁).1 hh₁ - obtain ⟨g₂,rfl⟩ := (t.mem_carrier h₂).1 hh₂ - obtain ⟨x,rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y,rfl⟩ := (s.mem_carrier y).1 hy - have first' := (action g₁ x).1 first - have second' := (action g₂ y).1 second - apply ((t.product t).mem_subset _ z).2 - refine ⟨(g₁,g₂),?_,shape.symm⟩ - rw [first',second'] - exact (geometry.meet.smallMeet_eq_iff x y W).2 meet - · intro hz - obtain ⟨⟨g₁,g₂⟩,meet,shape⟩ := ((t.product t).mem_subset _ z).1 hz - exact ⟨t.encode g₁,t.encode_mem g₁,t.encode g₂,t.encode_mem g₂, - s.encode (a.iso g₁ d),s.encode_mem _,s.encode (a.iso g₂ d),s.encode_mem _, - shape.symm,(action g₁ _).2 rfl,(action g₂ _).2 rfl, - (geometry.meet.smallMeet_eq_iff _ _ W).1 meet⟩ - have eq : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.separatedActorsFormula - (extend z params)) (ZFSet.prod geometry.actors geometry.actors) = - (t.product t).subset (fun gh => geometry.meet.smallMeet (a.iso gh.1 d) (a.iso gh.2 d) = W) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep,correct] - exact ⟨And.right,fun hz => ⟨(t.product t).subset_carrier _ hz,hz⟩⟩ - exact eq ▸ selected - -end GroundMainFinalGeometry - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BoundedDirectedOrders +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPrincipalSupportZF +import OAI.SetTheory.PartitionPrinciple.Forcing.MeetOrderPosetActions +import OAI.SetTheory.PartitionPrinciple.Forcing.SmallCodedMeetActions + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable (M : TransitiveGround.{u}) + +theorem geometry_supportBasis_mem {I G : Type u} [Group G] + (s : GeometryPresentation I G) (P : MeetOrder I) (a : OrderAction G P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (nodes : s.points.carrier ∈ M.sets) (group : s.actors.carrier ∈ M.sets) + (order : s.orderRelation P ∈ M.sets) (graph : s.actionGraph P a ∈ M.sets) : + supportBasisCode s.points s.actors a.fixSubgroup ∈ M.sets := by + let := P.toPartialOrder + exact M.principalSupportBasis_mem a.toPosetAction s.points s.actors pairing unions powers separation + nodes group order graph + +theorem decoded_supportBasis_mem {G L m i e R A : ZFSet.{u}} + (group : GroupCode G m i e) (order : PartialOrderCode L R) + (action : PosetActionCode G L m e R A) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hL : L ∈ M.sets) (hG : G ∈ M.sets) (hR : R ∈ M.sets) (hA : A ∈ M.sets) : + letI := group.toGroup + letI := order.toPartialOrder + supportBasisCode (SetMembers.presentation L) (SetMembers.presentation G) + (action.toPosetAction group order).principalFix ∈ M.sets := by + let := group.toGroup + let := order.toPartialOrder + have order_mem : (SetMembers.presentation L).conditionOrder ∈ M.sets := by + rw [order.conditionOrder_eq] + exact hR + have action_mem : (action.toPosetAction group order).actionGraph + (SetMembers.presentation L) (SetMembers.presentation G) ∈ M.sets := by + rw [action.actionGraph_eq group order] + exact hA + exact M.principalSupportBasis_mem (action.toPosetAction group order) + (SetMembers.presentation L) (SetMembers.presentation G) pairing unions powers separation hL hG order_mem action_mem + +noncomputable def decoded_supportFamily {G L m i e R A : ZFSet.{u}} + (group : GroupCode G m i e) (order : PartialOrderCode L R) + (action : PosetActionCode G L m e R A) + (hL : L ∈ M.sets) (hR : R ∈ M.sets) + (directed : Realize M.sets (BoundedFormula.upwardDirectedFormula 0 1).toFormula + (extend L (extend R Fin.elim0))) (C : SetMembers L) : + letI := group.toGroup + Compression.RecursiveMaps.NormalSubgroupFamily (SetMembers G) := by + letI := group.toGroup + letI := order.toPartialOrder + exact (action.toPosetAction group order).principalSupportFamily C + (M.decoded_upward_directed order hL hR directed) + +end TransitiveGround + +section +open SetFormula +universe u + +structure GroundMainFinalGeometry (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) where + carrier : ZFSet.{u} + order : ZFSet.{u} + meetGraph : ZFSet.{u} + actors : ZFSet.{u} + multiplication : ZFSet.{u} + inverse : ZFSet.{u} + identity : ZFSet.{u} + action : ZFSet.{u} + bottom : ZFSet.{u} + height : ZFSet.{u} + birth : ZFSet.{u} + times : ZFSet.{u} + carrier_ground : carrier ∈ M.sets + order_ground : order ∈ M.sets + meet_ground : meetGraph ∈ M.sets + actors_ground : actors ∈ M.sets + multiplication_ground : multiplication ∈ M.sets + inverse_ground : inverse ∈ M.sets + action_ground : action ∈ M.sets + height_ground : height ∈ M.sets + birth_ground : birth ∈ M.sets + times_ground : times ∈ M.sets + columns_ground : C ∈ M.sets + coordinates_ground : D ∈ M.sets + coordinate_order_ground : rD ∈ M.sets + meet : MeetOrderCode carrier order meetGraph + group_code : GroupCode actors multiplication inverse identity + action_code : PosetActionCode actors carrier multiplication identity order action + bottom_mem : bottom ∈ carrier + least : ∀ x ∈ carrier, ZFSet.pair bottom x ∈ order + height_code : StrictLexHeightCode carrier C D order height rD + birth_function : ZFSet.IsFunc carrier times birth + times_ordinal : ordinalSetProperty times + old_meet : OldMeetCode order meetGraph birth + +namespace GroundMainFinalGeometry +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +theorem identity_ground : geometry.identity ∈ M.sets := + M.transitive geometry.actors_ground geometry.group_code.identity_mem + +theorem bottom_ground : geometry.bottom ∈ M.sets := + M.transitive geometry.carrier_ground geometry.bottom_mem + +noncomputable def fields : Fin 12 → ZFSet.{u} := + Fin.cases geometry.carrier (Fin.cases geometry.order (Fin.cases geometry.meetGraph + (Fin.cases geometry.actors (Fin.cases geometry.multiplication (Fin.cases geometry.inverse + (Fin.cases geometry.identity (Fin.cases geometry.action (Fin.cases geometry.bottom + (Fin.cases geometry.height (Fin.cases geometry.birth (fun _ => geometry.times))))))))))) + +theorem fields_ground : ∀ j, geometry.fields j ∈ M.sets := + Fin.cases geometry.carrier_ground (Fin.cases geometry.order_ground (Fin.cases geometry.meet_ground + (Fin.cases geometry.actors_ground (Fin.cases geometry.multiplication_ground (Fin.cases geometry.inverse_ground + (Fin.cases geometry.identity_ground (Fin.cases geometry.action_ground (Fin.cases geometry.bottom_ground + (Fin.cases geometry.height_ground (Fin.cases geometry.birth_ground (fun _ => geometry.times_ground))))))))))) + +noncomputable def code : ZFSet.{u} := nonemptyTupleCode 11 geometry.fields + +theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + geometry.code ∈ M.sets := M.nonemptyTupleCode_mem pairing 11 geometry.fields geometry.fields_ground + +end GroundMainFinalGeometry + +end + +namespace GroundMainFinalGeometry +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +@[instance_reducible] noncomputable def decodedBottom : + letI := geometry.meet.order.toPartialOrder + OrderBot (SetMembers geometry.carrier) := by + letI := geometry.meet.order.toPartialOrder + refine { bot := SetMembers.ofMem geometry.bottom geometry.bottom_mem, bot_le := ?_ } + intro x + change ZFSet.pair (SetMembers.raw (SetMembers.ofMem geometry.bottom geometry.bottom_mem)) + (SetMembers.raw x) ∈ geometry.order + rw [SetMembers.raw_ofMem] + exact geometry.least _ (SetMembers.raw_mem x) + +noncomputable def decodedAction : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + PosetAction (SetMembers geometry.actors) (SetMembers geometry.carrier) := + geometry.action_code.toPosetAction geometry.group_code geometry.meet.order + +theorem decoded_order_eq : + letI := geometry.meet.order.toPartialOrder + (SetMembers.presentation geometry.carrier).conditionOrder = geometry.order := + geometry.meet.order.conditionOrder_eq + +theorem decoded_action_eq : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + geometry.decodedAction.actionGraph (SetMembers.presentation geometry.carrier) + (SetMembers.presentation geometry.actors) = geometry.action := + geometry.action_code.actionGraph_eq geometry.group_code geometry.meet.order + +theorem decoded_supportBasis_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + supportBasisCode (SetMembers.presentation geometry.carrier) (SetMembers.presentation geometry.actors) + geometry.decodedAction.principalFix ∈ M.sets := + M.decoded_supportBasis_mem geometry.group_code geometry.meet.order geometry.action_code + pairing unions powers separation geometry.carrier_ground geometry.actors_ground + geometry.order_ground geometry.action_ground + +theorem decoded_unbounded + (growth : ∀ x ∈ geometry.carrier, ∃ y ∈ geometry.carrier, + ZFSet.pair x y ∈ geometry.order ∧ ¬ ZFSet.pair y x ∈ geometry.order) : + letI := geometry.meet.order.toPartialOrder + ∀ x : SetMembers geometry.carrier, ∃ y : SetMembers geometry.carrier, ¬ y ≤ x := by + let := geometry.meet.order.toPartialOrder + intro x + obtain ⟨y, hy, _, strict⟩ := growth _ (SetMembers.raw_mem x) + refine ⟨SetMembers.ofMem y hy, ?_⟩ + change ¬ ZFSet.pair (SetMembers.raw (SetMembers.ofMem y hy)) (SetMembers.raw x) ∈ geometry.order + simpa only [SetMembers.raw_ofMem] using strict + +theorem decoded_countable_bound + (bounds : ∀ X ∈ M.sets, X ⊆ geometry.carrier → M.groundEmbeddable X ZFSet.omega → + ∃ b ∈ geometry.carrier, ∀ x ∈ X, ZFSet.pair x b ∈ geometry.order) : + letI := geometry.meet.order.toPartialOrder + ∀ X ∈ M.sets, X ⊆ (SetMembers.presentation geometry.carrier).carrier → + M.groundEmbeddable X ZFSet.omega → + ∃ b : SetMembers geometry.carrier, ∀ x : SetMembers geometry.carrier, + (SetMembers.presentation geometry.carrier).encode x ∈ X → x ≤ b := by + let := geometry.meet.order.toPartialOrder + intro X hX subset countable + obtain ⟨b, hb, bound⟩ := bounds X hX subset countable + refine ⟨SetMembers.ofMem b hb, ?_⟩ + intro x hx + change ZFSet.pair (SetMembers.raw x) (SetMembers.raw (SetMembers.ofMem b hb)) ∈ geometry.order + rw [SetMembers.raw_ofMem] + exact bound _ hx + +end GroundMainFinalGeometry + +namespace BoundedFormula +open SetFormula + +def separatedActorsFormula : BoundedFormula 7 := + exMem 4 (exMem 5 (exMem 5 (exMem 6 + (.conj (orderedPairFormula 4 3 2) + (.conj (tripleMembershipFormula 3 5 1 9) + (.conj (tripleMembershipFormula 2 5 0 9) (tripleMembershipFormula 1 0 6 10))))))) + +end BoundedFormula + +namespace GroundMainFinalGeometry +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) + +theorem separatedActorPairs_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + let a := geometry.decodedAction + let t := SetMembers.presentation geometry.actors + ∀ (d W : SetMembers geometry.carrier), + (t.product t).subset (fun gh => geometry.meet.smallMeet (a.iso gh.1 d) (a.iso gh.2 d) = W) ∈ M.sets := by + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let a := geometry.decodedAction + let s := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + dsimp only + intro d W + let params := extend (SetMembers.raw d) (extend (SetMembers.raw W) + (extend geometry.carrier (extend geometry.actors (extend geometry.action (extend geometry.meetGraph Fin.elim0))))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases (M.transitive geometry.carrier_ground (SetMembers.raw_mem d)) + (Fin.cases (M.transitive geometry.carrier_ground (SetMembers.raw_mem W)) + (Fin.cases geometry.carrier_ground (Fin.cases geometry.actors_ground + (Fin.cases geometry.action_ground (Fin.cases geometry.meet_ground (fun i => Fin.elim0 i)))))) + have selected := M.bounded_separation_mem separation BoundedFormula.separatedActorsFormula params members + (M.prod_mem pairing unions powers separation geometry.actors_ground geometry.actors_ground) + have correct (z : ZFSet.{u}) : BoundedFormula.Truth BoundedFormula.separatedActorsFormula + (extend z params) ↔ z ∈ (t.product t).subset + (fun gh => geometry.meet.smallMeet (a.iso gh.1 d) (a.iso gh.2 d) = W) := by + simp only [BoundedFormula.separatedActorsFormula, BoundedFormula.truth_exMem, BoundedFormula.Truth, + BoundedFormula.truth_orderedPairFormula, BoundedFormula.truth_tripleMembershipFormula] + change (∃ h₁ ∈ geometry.actors, ∃ h₂ ∈ geometry.actors, + ∃ x ∈ geometry.carrier, ∃ y ∈ geometry.carrier, + z = ZFSet.pair h₁ h₂ ∧ ZFSet.pair (ZFSet.pair h₁ (SetMembers.raw d)) x ∈ geometry.action ∧ + ZFSet.pair (ZFSet.pair h₂ (SetMembers.raw d)) y ∈ geometry.action ∧ + ZFSet.pair (ZFSet.pair x y) (SetMembers.raw W) ∈ geometry.meetGraph) ↔ _ + have action (g : SetMembers geometry.actors) (x : SetMembers geometry.carrier) : + ZFSet.pair (ZFSet.pair (SetMembers.raw g) (SetMembers.raw d)) (SetMembers.raw x) ∈ geometry.action ↔ + a.iso g d = x := by + rw [← geometry.decoded_action_eq] + exact a.triple_mem_actionGraph s t g d x + constructor + · rintro ⟨h₁,hh₁,h₂,hh₂,x,hx,y,hy,shape,first,second,meet⟩ + obtain ⟨g₁,rfl⟩ := (t.mem_carrier h₁).1 hh₁ + obtain ⟨g₂,rfl⟩ := (t.mem_carrier h₂).1 hh₂ + obtain ⟨x,rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y,rfl⟩ := (s.mem_carrier y).1 hy + have first' := (action g₁ x).1 first + have second' := (action g₂ y).1 second + apply ((t.product t).mem_subset _ z).2 + refine ⟨(g₁,g₂),?_,shape.symm⟩ + rw [first',second'] + exact (geometry.meet.smallMeet_eq_iff x y W).2 meet + · intro hz + obtain ⟨⟨g₁,g₂⟩,meet,shape⟩ := ((t.product t).mem_subset _ z).1 hz + exact ⟨t.encode g₁,t.encode_mem g₁,t.encode g₂,t.encode_mem g₂, + s.encode (a.iso g₁ d),s.encode_mem _,s.encode (a.iso g₂ d),s.encode_mem _, + shape.symm,(action g₁ _).2 rfl,(action g₂ _).2 rfl, + (geometry.meet.smallMeet_eq_iff _ _ W).1 meet⟩ + have eq : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.separatedActorsFormula + (extend z params)) (ZFSet.prod geometry.actors geometry.actors) = + (t.product t).subset (fun gh => geometry.meet.smallMeet (a.iso gh.1 d) (a.iso gh.2 d) = W) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep,correct] + exact ⟨And.right,fun hz => ⟨(t.product t).subset_carrier _ hz,hz⟩⟩ + exact eq ▸ selected + +end GroundMainFinalGeometry + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStoredPreparedDensity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStoredPreparedDensity.lean index 4c71ac940755442e2fe986bb5325a40b3b3bd396..92bb815d3f5aa8718cc3a28c96ba7f47822705e5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStoredPreparedDensity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStoredPreparedDensity.lean @@ -1,140 +1,140 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAlignedCopyCollisions -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFairPreparationLimitCertificates - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {R : Type u} [PartialOrder R] (c : Presentation R) - -theorem exists_groundStoredPreparedStrengthening - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history), - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) → - H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val - ), - ∀ p ∈ upperQ, ∃ q ∈ upperQ, - ZFSet.pair q p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed ∧ - StoredPreparedConditionCode M c.carrier T stages packed b.carrier q := by - let geometry := run.finalGeometry i₀ - let instGeometryGroup := geometry.group_code.toGroup - let instGeometryOrder := geometry.meet.order.toPartialOrder - let instGeometryBottom := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history hs hh ordinal trace - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - intro descent p hp - have fair := fulfilled.exists_groundFairPreparationLowerBound c collection infinite choice small smallD - irreflexive rowClosed a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows stages history hs hh ordinal trace descent p hp - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - apply FairPreparationLowerBoundResult.exists_storedPreparedLimit c pairing unions powers separation - collection historyRun _ fair - intro alpha fields stored - have member := historyRun.carriers.data.function.pair_source stored - exact M.semanticStructuralPrefix_preparationEnvironment c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hs hh ordinal trace member fields stored - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAlignedCopyCollisions +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFairPreparationLimitCertificates + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {R : Type u} [PartialOrder R] (c : Presentation R) + +theorem exists_groundStoredPreparedStrengthening + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history), + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) → + H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val + ), + ∀ p ∈ upperQ, ∃ q ∈ upperQ, + ZFSet.pair q p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed ∧ + StoredPreparedConditionCode M c.carrier T stages packed b.carrier q := by + let geometry := run.finalGeometry i₀ + let instGeometryGroup := geometry.group_code.toGroup + let instGeometryOrder := geometry.meet.order.toPartialOrder + let instGeometryBottom := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history hs hh ordinal trace + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + intro descent p hp + have fair := fulfilled.exists_groundFairPreparationLowerBound c collection infinite choice small smallD + irreflexive rowClosed a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows stages history hs hh ordinal trace descent p hp + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + apply FairPreparationLowerBoundResult.exists_storedPreparedLimit c pairing unions powers separation + collection historyRun _ fair + intro alpha fields stored + have member := historyRun.carriers.data.function.pair_source stored + exact M.semanticStructuralPrefix_preparationEnvironment c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hs hh ordinal trace member fields stored + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralCompression.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralCompression.lean index f7d9df965c10eefa042afff105f0cb3b33dc0d15..0bcf5bdd18863e9a14e014a452380e9afaea6c67 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralCompression.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralCompression.lean @@ -1,921 +1,921 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticPreparedProfileSelections -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralSupportPreparation - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -noncomputable def insertionUsedNodes - (rowNodes columns row I T A nodes anchors : ZFSet.{u}) : ZFSet.{u} := - rowUsedRows rowNodes columns (natSetCode 2) row ∪ - relationImage (assignmentIndices I T A) nodes anchors - -theorem mem_insertionUsedNodes - (rowNodes columns row I T A nodes anchors v : ZFSet.{u}) : - v ∈ insertionUsedNodes rowNodes columns row I T A nodes anchors ↔ - v ∈ rowUsedRows rowNodes columns (natSetCode 2) row ∨ - (v ∈ nodes ∧ ∃ idx ∈ I, ∃ u ∈ T, ∃ w ∈ T, - stageOneAssignment idx u w ∈ A ∧ ZFSet.pair idx v ∈ anchors) := by - rw [insertionUsedNodes, ZFSet.mem_union, mem_relationImage] - apply or_congr Iff.rfl - constructor - · rintro ⟨hv, idx, hi, edge⟩ - obtain ⟨hi, u, hu, w, hw, stored⟩ := (mem_assignmentIndices I T A idx).1 hi - exact ⟨hv, idx, hi, u, hu, w, hw, stored, edge⟩ - · rintro ⟨hv, idx, hi, u, hu, w, hw, stored, edge⟩ - exact ⟨hv, idx, (mem_assignmentIndices I T A idx).2 ⟨hi, u, hu, w, hw, stored⟩, edge⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem insertionUsedNodes_mem_small - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rowNodes columns row I T A nodes anchors : ZFSet.{u}} - (hRowNodes : rowNodes ∈ M.sets) (hColumns : columns ∈ M.sets) - (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) - (hNodes : nodes ∈ M.sets) (hAnchors : anchors ∈ M.sets) - (rowCondition : row ∈ M.smallPartialFunctions (ZFSet.prod rowNodes columns) (natSetCode 2) ZFSet.omega) - (rowSubset : rowNodes ⊆ nodes) (anchorFunction : ZFSet.IsFunc I nodes anchors) - (smallA : M.groundEmbeddable A ZFSet.omega) : - insertionUsedNodes rowNodes columns row I T A nodes anchors ∈ M.sets ∧ - M.groundEmbeddable (insertionUsedNodes rowNodes columns row I T A nodes anchors) ZFSet.omega ∧ - insertionUsedNodes rowNodes columns row I T A nodes anchors ⊆ nodes := by - obtain ⟨hRows, smallRows⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation - infinite choice hRowNodes hColumns (M.natSetCode_mem separation infinite 2) rowCondition - have omega := M.omega_mem separation infinite - have hIndices := M.assignmentIndices_mem pairing unions powers separation hI hT hA - have smallIndices := M.assignmentIndices_small pairing unions powers separation choice hI hT hA omega smallA - have hUsedAnchors := M.relationImage_mem separation hIndices hNodes hAnchors - have smallAnchors := M.groundEmbeddable_function_image pairing unions powers separation choice - hIndices hNodes omega hAnchors anchorFunction smallIndices - refine ⟨M.binary_union_mem pairing unions hRows hUsedAnchors, - M.groundCountable_binary_union pairing unions powers separation infinite choice - hRows hUsedAnchors smallRows smallAnchors, ?_⟩ - intro v member - rcases ZFSet.mem_union.1 member with usedRow | usedAnchor - · exact rowSubset (rowUsedRows_subset _ _ _ _ usedRow) - · exact ((mem_relationImage _ _ _ _).1 usedAnchor).1 - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) - -theorem internalRowAction_insertion_union - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (h : G) (D K V : L), - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → - a.iso h D ≤ K → h ∈ a.principalFix V → - (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ - rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → - i.val ≤ K → i.val ≤ V) → - ∃ q : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega), - SetMembers.raw q = SetMembers.raw p ∪ SetMembers.raw (act.iso h p) ∧ - q ≤ p ∧ q ≤ act.iso h p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act p h D K V bound cap fixed avoid - apply M.countableFunction_common_extension pairing unions powers separation infinite choice - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) p (act.iso h p) - intro x y z left right - have pc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega p).2.1 - have hc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega (act.iso h p)).2.1 - have coords := (ZFSet.pair_mem_prod.1 (pc.shape left)).1 - have hz := (ZFSet.pair_mem_prod.1 (hc.shape right)).2 - obtain ⟨row, hrow, col, hcol, rfl⟩ := ZFSet.mem_prod.1 coords - obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier row).1 hrow - have oldUsed := row_mem_rowUsedRows pc left - have movedBound := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation - infinite hL hC hG graph h p D bound i (row_mem_rowUsedRows hc right) - have same := fixed i.val (avoid i oldUsed (le_trans movedBound cap)) - have old := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite - hL hC hG graph h p i col z hcol hz).1 (by rw [same]; exact right) - exact pc.unique _ y z left old - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -include fulfilled - -theorem generated_insertion (infinite : Realize M.sets infinity Fin.elim0) - {A c e d : ZFSet.{u}} (hA : A ∈ M.sets) - (subset : A ⊆ (run.finalGeometry i₀).carrier) (nonempty : A.Nonempty) - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ a ∈ A, ZFSet.pair e a ∈ (run.finalGeometry i₀).order) : - let geometry := run.finalGeometry i₀ - let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph A - F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - A ⊆ F ∧ - (∀ T, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph T → A ⊆ T → F ⊆ T) ∧ - (∀ x ∈ F, ZFSet.pair e x ∈ geometry.order) ∧ - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action c e d F caps actors := by - let geometry := run.finalGeometry i₀ - let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph A - have ground : F ∈ M.sets := M.generatedMeetFilter_mem pairing unions powers separation infinite - geometry.carrier_ground geometry.order_ground geometry.meet_ground hA - have filter := M.generatedMeetFilter_filter pairing unions separation infinite - geometry.carrier_ground geometry.meet subset nonempty - have contains := M.generatedMeetFilter_contains pairing unions separation infinite - geometry.carrier_ground geometry.meet subset - have allAbove := M.generatedMeetFilter_lower_bound pairing unions separation infinite - geometry.carrier_ground geometry.meet subset he above - exact ⟨ground, filter, contains, - fun _ code includes => M.generatedMeetFilter_least pairing unions separation infinite - geometry.carrier_ground geometry.meet subset code includes, - allAbove, fulfilled.insertion c hc e he d hd F ground filter lower strict bound allAbove⟩ - -theorem decoded_generated_insertion (infinite : Realize M.sets infinity Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) - (subset : A ⊆ (run.finalGeometry i₀).carrier) (nonempty : A.Nonempty) - (c e d : SetMembers (run.finalGeometry i₀).carrier) - (lower : ZFSet.pair (SetMembers.raw c) (SetMembers.raw e) ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair (SetMembers.raw e) (SetMembers.raw c) ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair (SetMembers.raw c) (SetMembers.raw d) ∈ (run.finalGeometry i₀).order) - (above : ∀ a ∈ A, ZFSet.pair (SetMembers.raw e) a ∈ (run.finalGeometry i₀).order) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph A - Compression.RecursiveMaps.HasInsertionFamily - (geometry.action_code.toOrderAction geometry.group_code geometry.meet) - (SetMembers Labels) c e d (fun x => SetMembers.raw x ∈ F) := by - obtain ⟨_, filter, _, _, _, caps, _, actors, _, family⟩ := - fulfilled.generated_insertion infinite hA subset nonempty - (SetMembers.raw_mem c) (SetMembers.raw_mem e) (SetMembers.raw_mem d) lower strict bound above - exact family.hasInsertionFamily (run.finalGeometry i₀).group_code - (run.finalGeometry i₀).meet (run.finalGeometry i₀).action_code filter - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -include fulfilled - -theorem generated_insertion_exceptions - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) (hLabels : Labels ∈ M.sets) - {generators c e d Used Profiles extra : ZFSet.{u}} - (hGenerators : generators ∈ M.sets) - (subset : generators ⊆ (run.finalGeometry i₀).carrier) (nonempty : generators.Nonempty) - (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) - (hd : d ∈ (run.finalGeometry i₀).carrier) - (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) - (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) - (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) - (above : ∀ a ∈ generators, ZFSet.pair e a ∈ (run.finalGeometry i₀).order) - (hUsed : Used ∈ M.sets) (hProfiles : Profiles ∈ M.sets) (hExtra : extra ∈ M.sets) - (usedSubset : Used ⊆ (run.finalGeometry i₀).carrier) - (filters : ∀ profile ∈ Profiles, MeetFilterCode (run.finalGeometry i₀).carrier - (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph profile) - (smallUsed : M.groundEmbeddable Used ZFSet.omega) - (smallProfiles : M.groundEmbeddable Profiles ZFSet.omega) - (smallExtra : M.groundEmbeddable extra ZFSet.omega) (extraSubset : extra ⊆ Labels) : - let geometry := run.finalGeometry i₀ - let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators - F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - generators ⊆ F ∧ - (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → - generators ⊆ filter → F ⊆ filter) ∧ - (∀ x ∈ F, ZFSet.pair e x ∈ geometry.order) ∧ - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action c e d F caps actors ∧ - ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ - ∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → - (∀ node ∈ Used, ZFSet.pair node cap ∈ geometry.order → - ZFSet.pair node c ∈ geometry.order) ∧ - (∀ profile ∈ Profiles, c ∉ profile → cap ∉ profile) := by - let geometry := run.finalGeometry i₀ - obtain ⟨groundF, filter, contains, least, allAbove, caps, hCaps, actors, hActors, family⟩ := - fulfilled.generated_insertion infinite hGenerators subset nonempty hc he hd lower strict bound above - exact ⟨groundF, filter, contains, least, allAbove, caps, hCaps, actors, hActors, family, - family.exists_ground_countable_exceptions M pairing unions powers separation infinite choice - hLabels geometry.carrier_ground geometry.order_ground (M.transitive geometry.carrier_ground hc) - hCaps hUsed hProfiles hExtra geometry.meet usedSubset filters smallUsed smallProfiles - smallExtra extraSubset⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_insertion_exceptions - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (_hmu : mu ∈ M.sets) (_muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) - (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) - (_stagesOrdinal : ordinalSetProperty stages) - (_trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), - ZFSet.pair (c.encode row) A ∈ upperQ → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → - ∀ (generators c0 e0 d0 extra : ZFSet.{u}), Labels ∈ M.sets → - generators ∈ M.sets → generators ⊆ geometry.carrier → generators.Nonempty → - c0 ∈ geometry.carrier → e0 ∈ geometry.carrier → d0 ∈ geometry.carrier → - ZFSet.pair c0 e0 ∈ geometry.order → ZFSet.pair e0 c0 ∉ geometry.order → - ZFSet.pair c0 d0 ∈ geometry.order → - (∀ generator ∈ generators, ZFSet.pair e0 generator ∈ geometry.order) → - extra ∈ M.sets → M.groundEmbeddable extra ZFSet.omega → extra ⊆ Labels → - let L := ZFSet.prod stages (M.preparationWitnessBound s.carrier lifted upperQ) - let Used := insertionUsedNodes s.nonbottom.carrier columns (SetMembers.raw row) - indices lifted A s.carrier anchors - ∃ selections ∈ M.sets, ZFSet.IsFunc A L selections ∧ - selections ⊆ M.preparedWitnessSelections c.carrier lifted stages packed s.carrier - (ZFSet.pair (c.encode row) A) A ∧ - relationImage A L selections ∈ M.sets ∧ - M.groundEmbeddable (relationImage A L selections) ZFSet.omega ∧ - let Profiles := M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections - Used ∈ M.sets ∧ M.groundEmbeddable Used ZFSet.omega ∧ Used ⊆ geometry.carrier ∧ - Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ - (∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ - (∀ x alpha sourceRow sourceA k enumerations z F B f, - ZFSet.pair x (ZFSet.pair alpha - (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ selections → - ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → F ∈ Profiles) ∧ - let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators - F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - generators ⊆ F ∧ - (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → - generators ⊆ filter → F ⊆ filter) ∧ - (∀ x ∈ F, ZFSet.pair e0 x ∈ geometry.order) ∧ - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action c0 e0 d0 F caps actors ∧ - ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ - ∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → - (∀ node ∈ Used, ZFSet.pair node cap ∈ geometry.order → ZFSet.pair node c0 ∈ geometry.order) ∧ - (∀ profile ∈ Profiles, c0 ∉ profile → cap ∉ profile) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - intro row A condition prepared generators c0 e0 d0 extra hLabels hGenerators generatorSubset - generatorNonempty hc he hd lower strict bound above hExtra smallExtra extraSubset - have profileSelection := M.semanticStructuralTrace_preparedProfileSelection c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder - forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 - closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace infinite choice - condition prepared - obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, - profilesGround, profilesSmall, profileFilters, coverage⟩ := profileSelection - let Profiles := M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections - have meetEq : canonicalMeetGraph s.carrier s.conditionOrder = geometry.meetGraph := by - rw [geometry.decoded_order_eq] - exact geometry.meet.eq_canonicalMeetGraph.symm - have filters : ∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F := by - intro F member - have filter := profileFilters F member - rw [meetEq, geometry.decoded_order_eq] at filter - exact filter - have candidate := ((M.mem_refinementHistoryForcing c.carrier lifted stages packed _).1 condition).1 - have Adata := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate - obtain ⟨indicesGround, anchorsGround, anchorFunction⟩ := M.structuralIndexAnchorData - b.carrier s.carrier s.conditionOrder (supportBasisCode s b a.principalFix) lifted squared - stages history pairing unions powers separation collection hG hL order supports hLifted hSquared hs hh - have used := M.insertionUsedNodes_mem_small pairing unions powers separation infinite choice - (M.nonbottom_carrier_mem s separation hL) hColumns indicesGround hLifted Adata.2.1 hL - anchorsGround (SetMembers.raw_mem row) (fun _ h => (s.mem_nonbottom_carrier _).1 h |>.1) - anchorFunction Adata.2.2.2 - refine ⟨selections, whole, function, selected, rangeGround, rangeSmall, - used.1, used.2.1, used.2.2, profilesGround, profilesSmall, filters, coverage, ?_⟩ - exact fulfilled.generated_insertion_exceptions infinite choice hLabels hGenerators generatorSubset - generatorNonempty hc he hd lower strict bound above used.1 profilesGround hExtra used.2.2 - filters used.2.1 profilesSmall smallExtra extraSubset - - - - - - -theorem structural_compatible_insertion_unions - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) - (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) - (_stagesOrdinal : ordinalSetProperty stages) - (_trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), - ZFSet.pair (c.encode row) A ∈ upperQ → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → - ∀ (generators c0 e0 d0 extra : ZFSet.{u}), Labels ∈ M.sets → - generators ∈ M.sets → generators ⊆ geometry.carrier → generators.Nonempty → - c0 ∈ geometry.carrier → e0 ∈ geometry.carrier → d0 ∈ geometry.carrier → - ZFSet.pair c0 e0 ∈ geometry.order → ZFSet.pair e0 c0 ∉ geometry.order → - ZFSet.pair c0 d0 ∈ geometry.order → - (∀ generator ∈ generators, ZFSet.pair e0 generator ∈ geometry.order) → - extra ∈ M.sets → M.groundEmbeddable extra ZFSet.omega → extra ⊆ Labels → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → - ZFSet.pair (s.encode i) d0 ∈ geometry.order) → - (∀ z ∈ A, ZFSet.pair z d0 ∈ stageOneDataBounds A indices lifted S s.carrier mu - s.nonbottom.carrier s.conditionOrder anchors tuples) → - let L := ZFSet.prod stages (M.preparationWitnessBound s.carrier lifted upperQ) - let Used := insertionUsedNodes s.nonbottom.carrier columns (SetMembers.raw row) - indices lifted A s.carrier anchors - ∃ selections ∈ M.sets, ZFSet.IsFunc A L selections ∧ - selections ⊆ M.preparedWitnessSelections c.carrier lifted stages packed s.carrier - (ZFSet.pair (c.encode row) A) A ∧ - relationImage A L selections ∈ M.sets ∧ - M.groundEmbeddable (relationImage A L selections) ZFSet.omega ∧ - let Profiles := M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections - Used ∈ M.sets ∧ M.groundEmbeddable Used ZFSet.omega ∧ Used ⊆ geometry.carrier ∧ - Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ - (∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ - (∀ x alpha sourceRow sourceA k enumerations z F B f, - ZFSet.pair x (ZFSet.pair alpha - (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ selections → - ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → F ∈ Profiles) ∧ - let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators - F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - generators ⊆ F ∧ - (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → - generators ⊆ filter → F ⊆ filter) ∧ - (∀ x ∈ F, ZFSet.pair e0 x ∈ geometry.order) ∧ - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - ∃ family : FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action c0 e0 d0 F caps actors, - ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ - (∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → - (∀ node ∈ Used, ZFSet.pair node cap ∈ geometry.order → ZFSet.pair node c0 ∈ geometry.order) ∧ - (∀ profile ∈ Profiles, c0 ∉ profile → cap ∉ profile)) ∧ - (¬ M.groundEmbeddable Labels ZFSet.omega → ∃ label ∈ Labels, label ∉ bad) ∧ - ∀ label : SetMembers Labels, SetMembers.raw label ∉ bad → - let h := family.decodedActors label - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A - ∃ commonRow : SetMembers c.carrier, - SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso h row) ∧ - ZFSet.pair (c.encode commonRow) (A ∪ movedA) ∈ upperQ ∧ - ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) (ZFSet.pair (c.encode row) A) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed ∧ - ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) - (ZFSet.pair (c.encode (act.iso h row)) movedA) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - intro row A condition prepared generators c0 e0 d0 extra hLabels hGenerators generatorSubset - generatorNonempty hc he hd lower strict bound above hExtra smallExtra extraSubset rowD dataD - obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, - usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, profileFilters, coverage, - filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, - family, bad, hBad, badSubset, badSmall, containsExtra, good⟩ := - fulfilled.structural_insertion_exceptions collection infinite choice columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace row A condition prepared generators c0 e0 d0 extra - hLabels hGenerators generatorSubset generatorNonempty hc he hd lower strict bound above - hExtra smallExtra extraSubset - have available : ¬ M.groundEmbeddable Labels ZFSet.omega → ∃ label ∈ Labels, label ∉ bad := by - classical - intro notSmall - by_contra none - apply notSmall - have equal : bad = Labels := by - apply ZFSet.ext - intro label - exact ⟨fun member => badSubset member, fun member => by - by_contra outside - exact none ⟨label, member, outside⟩⟩ - rwa [equal] at badSmall - refine ⟨selections, whole, function, selected, rangeGround, rangeSmall, - usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, profileFilters, coverage, - filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, - family, bad, hBad, badSubset, badSmall, containsExtra, good, available, ?_⟩ - intro label goodLabel - let h := family.decodedActors label - let cap := family.decodedCaps label - let V : SetMembers geometry.carrier := SetMembers.ofMem c0 hc - let D0 : SetMembers geometry.carrier := SetMembers.ofMem d0 hd - have actorEdge := family.decodedActors_entry label - have capEdge := family.decodedCaps_entry label - have goodLaws := good _ _ capEdge goodLabel - have fixed : h ∈ a.principalFix V := by - intro v hv - apply (geometry.action_code.act_eq_iff h v v).2 - apply family.fixes _ _ actorEdge _ (SetMembers.raw_mem v) - change ZFSet.pair (SetMembers.raw v) (SetMembers.raw V) ∈ geometry.order at hv - simpa only [V, SetMembers.raw_ofMem] using hv - have belowCap : a.iso h D0 ≤ cap := by - change ZFSet.pair (SetMembers.raw (a.iso h D0)) (SetMembers.raw cap) ∈ geometry.order - apply family.dominates _ _ _ actorEdge capEdge _ (SetMembers.raw_mem _) - have entry : ZFSet.pair (ZFSet.pair (SetMembers.raw h) (SetMembers.raw D0)) - (SetMembers.raw (a.iso h D0)) ∈ geometry.action := geometry.action_code.act_mem h D0 - change ZFSet.pair (ZFSet.pair (SetMembers.raw h) d0) - (SetMembers.raw (a.iso h D0)) ∈ geometry.action - simpa only [D0, SetMembers.raw_ofMem] using entry - have usedD (i : {i : SetMembers geometry.carrier // i ≠ ⊥}) - (used : s.encode i.val ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row)) : - i.val ≤ D0 := by - change ZFSet.pair (SetMembers.raw i.val) (SetMembers.raw D0) ∈ geometry.order - have bound : ZFSet.pair (SetMembers.raw i.val) d0 ∈ geometry.order := rowD i.val used - simpa only [D0, SetMembers.raw_ofMem] using bound - have avoidRows (i : {i : SetMembers geometry.carrier // i ≠ ⊥}) - (used : s.encode i.val ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row)) - (below : i.val ≤ cap) : i.val ≤ V := by - change ZFSet.pair (SetMembers.raw i.val) (SetMembers.raw V) ∈ geometry.order - rw [SetMembers.raw_ofMem] - exact goodLaws.1 _ (ZFSet.mem_union.2 (Or.inl used)) below - obtain ⟨commonRow, rowCode, below, belowH⟩ := M.internalRowAction_insertion_union a s b columns - pairing unions powers separation infinite hL hC hG graph choice row h D0 cap V usedD belowCap fixed avoidRows - have candidate := ((M.mem_refinementHistoryForcing c.carrier lifted stages packed _).1 condition).1 - have Adata := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate - have originalData : ∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ - stageOneDataBounds A indices lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples := by - have code : s.encode D0 = d0 := SetMembers.raw_ofMem d0 hd - rw [code] - exact dataD - have transported := M.binaryRowStructuralAssignmentImage_dataBound a s b columns pairing unions powers - separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh - stagesOrdinal trace h D0 A Adata.2.1 originalData - have anchorGood : ∀ idx u w E, - stageOneAssignment idx u w ∈ A → ZFSet.pair idx E ∈ anchors → - ZFSet.pair E (s.encode cap) ∈ s.conditionOrder → ZFSet.pair E (s.encode V) ∈ s.conditionOrder := by - intro idx u w E assignment anchor lowerCap - have fields := (stageOneAssignment_mem_assignments indices lifted idx u w).1 (Adata.2.2.1 assignment) - have Ebound : E ∈ s.carrier := (ZFSet.pair_mem_prod.1 - ((M.structuralIndexAnchors_function b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history).1 anchor)).2 - have used := (mem_insertionUsedNodes s.nonbottom.carrier columns (SetMembers.raw row) - indices lifted A s.carrier anchors E).2 (Or.inr - ⟨Ebound, idx, fields.1, u, fields.2.1, w, fields.2.2, assignment, anchor⟩) - rw [geometry.decoded_order_eq] at lowerCap ⊢ - change ZFSet.pair E (SetMembers.raw V) ∈ geometry.order - rw [SetMembers.raw_ofMem] - exact goodLaws.1 E used lowerCap - have profileGood : ∀ F ∈ M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections, - s.encode V ∉ F → s.encode cap ∉ F := by - have code : s.encode V = c0 := SetMembers.raw_ofMem c0 hc - rw [code] - exact goodLaws.2 - have unionFacts := M.semanticStructuralTrace_insertion_union c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order - graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace infinite choice small indices S mu s.nonbottom.carrier tuples - (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) - (fun D f _ tau entry bound => M.liftedRowTuple_supported a s b columns pairing unions powers separation - infinite hL hC hG graph hmu muOrdinal valid f tau D entry bound.2) - row commonRow A selections h D0 cap V condition function selected rangeGround rangeSmall - below belowH fixed belowCap anchorGood profileGood transported.2.2 - exact ⟨commonRow, rowCode, unionFacts⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - - - - -namespace PartitionPilot.Forcing.PosetAction -open SetRealization -universe u -variable {G P L : Type u} [Group G] [PartialOrder P] [PartialOrder L] - -theorem compressed_name_support (a : PosetAction G P) (s : Presentation P) - (d : PosetAction G L) (g : G) (D E : L) (tau : Name s) - (support : d.principalFix D ≤ a.stabilizer s tau) - (below : d.iso g D ≤ E) : - d.principalFix E ≤ a.stabilizer s (a.act s g tau) := by - rw [a.stabilizer_conjugation] - have moved : d.principalFix (d.iso g D) ≤ - (a.stabilizer s tau).map (Compression.RecursiveMaps.CosetGeometry.OrderAction.conjugateHom g) := by - rw [← principalFix_map_conjugate] - exact Subgroup.map_mono support - exact le_trans (d.principalFix_antitone below) moved - -end PartitionPilot.Forcing.PosetAction - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_compression - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) - (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) - (_stagesOrdinal : ordinalSetProperty stages) - (_trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), - ZFSet.pair (c.encode row) A ∈ upperQ → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → - ∀ (V E D0 : SetMembers geometry.carrier), V < E → V ≤ D0 → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ D0) → - (∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A indices lifted S s.carrier mu - s.nonbottom.carrier s.conditionOrder anchors tuples) → - ∃ (h : SetMembers geometry.actors) (cap : SetMembers geometry.carrier), - h ∈ a.principalFix V ∧ V < cap ∧ cap ≤ E ∧ a.iso h D0 ≤ cap ∧ - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A - ∃ commonRow : SetMembers c.carrier, - SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso h row) ∧ - ZFSet.pair (c.encode commonRow) (A ∪ movedA) ∈ upperQ ∧ - ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) (ZFSet.pair (c.encode row) A) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed ∧ - ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) - (ZFSet.pair (c.encode (act.iso h row)) movedA) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - intro row A condition prepared V E D0 lower bound rowD dataD - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have labelGround : Labels ∈ M.sets := labels.symm ▸ spec.1 - have labelLarge : ¬ M.groundEmbeddable Labels ZFSet.omega := labels.symm ▸ spec.2.2.2 - have generatorGround : ({s.encode E} : ZFSet.{u}) ∈ M.sets := - M.insert_mem pairing unions (M.transitive hL (s.encode_mem E)) (M.empty_mem ⟨s.carrier, hL⟩) - have generatorSubset : ({s.encode E} : ZFSet.{u}) ⊆ geometry.carrier := by - intro z hz - have same := ZFSet.mem_singleton.1 hz - subst z - exact s.encode_mem E - have generatorNonempty : ({s.encode E} : ZFSet.{u}).Nonempty := - ⟨s.encode E, ZFSet.mem_singleton.2 rfl⟩ - have above : ∀ z ∈ ({s.encode E} : ZFSet.{u}), ZFSet.pair (s.encode E) z ∈ geometry.order := by - intro z hz - have same := ZFSet.mem_singleton.1 hz - subst z - exact geometry.meet.order.refl _ (s.encode_mem E) - have rawRowD : ∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → - ZFSet.pair (s.encode i) (s.encode D0) ∈ geometry.order := fun i hi => rowD i hi - obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, - usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, profileFilters, coverage, - filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, - family, bad, hBad, badSubset, badSmall, containsExtra, good, available, unionsFor⟩ := - fulfilled.structural_compatible_insertion_unions collection infinite choice small columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace row A condition prepared - {s.encode E} (s.encode V) (s.encode E) (s.encode D0) ∅ - labelGround generatorGround generatorSubset generatorNonempty (s.encode_mem V) - (s.encode_mem E) (s.encode_mem D0) (le_of_lt lower) (not_le_of_gt lower) bound above - (M.empty_mem ⟨s.carrier, hL⟩) (M.empty_groundEmbeddable ZFSet.omega ⟨s.carrier, hL⟩) - (fun _ member => (ZFSet.notMem_empty _ member).elim) rawRowD dataD - obtain ⟨label, labelMember, goodLabel⟩ := available labelLarge - let chosen : SetMembers Labels := SetMembers.ofMem label labelMember - have chosenGood : SetMembers.raw chosen ∉ bad := by - simpa only [chosen, SetMembers.raw_ofMem] using goodLabel - let h := family.decodedActors chosen - let cap := family.decodedCaps chosen - have actorEdge := family.decodedActors_entry chosen - have capEdge := family.decodedCaps_entry chosen - have fixed : h ∈ a.principalFix V := by - intro v hv - exact (geometry.action_code.act_eq_iff h v v).2 - (family.fixes _ _ actorEdge _ (s.encode_mem v) hv) - have profile := family.profiles _ _ capEdge - have strictCap : V < cap := lt_iff_le_not_ge.2 ⟨profile.target_below_cap, profile.cap_not_below_target⟩ - have capBelow : cap ≤ E := - ((family.tests geometry.meet.order filterCode capEdge (s.encode_mem E) - (geometry.meet.order.refl _ (s.encode_mem E))).1 - (contains (ZFSet.mem_singleton.2 rfl))) - have movedBound : a.iso h D0 ≤ cap := - family.dominates _ _ _ actorEdge capEdge _ (s.encode_mem _) (geometry.action_code.act_mem h D0) - exact ⟨h, cap, fixed, strictCap, capBelow, movedBound, unionsFor chosen chosenGood⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticPreparedProfileSelections +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralSupportPreparation + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +noncomputable def insertionUsedNodes + (rowNodes columns row I T A nodes anchors : ZFSet.{u}) : ZFSet.{u} := + rowUsedRows rowNodes columns (natSetCode 2) row ∪ + relationImage (assignmentIndices I T A) nodes anchors + +theorem mem_insertionUsedNodes + (rowNodes columns row I T A nodes anchors v : ZFSet.{u}) : + v ∈ insertionUsedNodes rowNodes columns row I T A nodes anchors ↔ + v ∈ rowUsedRows rowNodes columns (natSetCode 2) row ∨ + (v ∈ nodes ∧ ∃ idx ∈ I, ∃ u ∈ T, ∃ w ∈ T, + stageOneAssignment idx u w ∈ A ∧ ZFSet.pair idx v ∈ anchors) := by + rw [insertionUsedNodes, ZFSet.mem_union, mem_relationImage] + apply or_congr Iff.rfl + constructor + · rintro ⟨hv, idx, hi, edge⟩ + obtain ⟨hi, u, hu, w, hw, stored⟩ := (mem_assignmentIndices I T A idx).1 hi + exact ⟨hv, idx, hi, u, hu, w, hw, stored, edge⟩ + · rintro ⟨hv, idx, hi, u, hu, w, hw, stored, edge⟩ + exact ⟨hv, idx, (mem_assignmentIndices I T A idx).2 ⟨hi, u, hu, w, hw, stored⟩, edge⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem insertionUsedNodes_mem_small + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rowNodes columns row I T A nodes anchors : ZFSet.{u}} + (hRowNodes : rowNodes ∈ M.sets) (hColumns : columns ∈ M.sets) + (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) + (hNodes : nodes ∈ M.sets) (hAnchors : anchors ∈ M.sets) + (rowCondition : row ∈ M.smallPartialFunctions (ZFSet.prod rowNodes columns) (natSetCode 2) ZFSet.omega) + (rowSubset : rowNodes ⊆ nodes) (anchorFunction : ZFSet.IsFunc I nodes anchors) + (smallA : M.groundEmbeddable A ZFSet.omega) : + insertionUsedNodes rowNodes columns row I T A nodes anchors ∈ M.sets ∧ + M.groundEmbeddable (insertionUsedNodes rowNodes columns row I T A nodes anchors) ZFSet.omega ∧ + insertionUsedNodes rowNodes columns row I T A nodes anchors ⊆ nodes := by + obtain ⟨hRows, smallRows⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation + infinite choice hRowNodes hColumns (M.natSetCode_mem separation infinite 2) rowCondition + have omega := M.omega_mem separation infinite + have hIndices := M.assignmentIndices_mem pairing unions powers separation hI hT hA + have smallIndices := M.assignmentIndices_small pairing unions powers separation choice hI hT hA omega smallA + have hUsedAnchors := M.relationImage_mem separation hIndices hNodes hAnchors + have smallAnchors := M.groundEmbeddable_function_image pairing unions powers separation choice + hIndices hNodes omega hAnchors anchorFunction smallIndices + refine ⟨M.binary_union_mem pairing unions hRows hUsedAnchors, + M.groundCountable_binary_union pairing unions powers separation infinite choice + hRows hUsedAnchors smallRows smallAnchors, ?_⟩ + intro v member + rcases ZFSet.mem_union.1 member with usedRow | usedAnchor + · exact rowSubset (rowUsedRows_subset _ _ _ _ usedRow) + · exact ((mem_relationImage _ _ _ _).1 usedAnchor).1 + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) + +theorem internalRowAction_insertion_union + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (h : G) (D K V : L), + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → i.val ≤ D) → + a.iso h D ≤ K → h ∈ a.principalFix V → + (∀ i : {i : L // i ≠ ⊥}, s.encode i.val ∈ + rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → + i.val ≤ K → i.val ≤ V) → + ∃ q : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega), + SetMembers.raw q = SetMembers.raw p ∪ SetMembers.raw (act.iso h p) ∧ + q ≤ p ∧ q ≤ act.iso h p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act p h D K V bound cap fixed avoid + apply M.countableFunction_common_extension pairing unions powers separation infinite choice + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) p (act.iso h p) + intro x y z left right + have pc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega p).2.1 + have hc := (M.smallFunction_raw_properties (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega (act.iso h p)).2.1 + have coords := (ZFSet.pair_mem_prod.1 (pc.shape left)).1 + have hz := (ZFSet.pair_mem_prod.1 (hc.shape right)).2 + obtain ⟨row, hrow, col, hcol, rfl⟩ := ZFSet.mem_prod.1 coords + obtain ⟨i, rfl⟩ := (s.nonbottom.mem_carrier row).1 hrow + have oldUsed := row_mem_rowUsedRows pc left + have movedBound := M.internalRowAction_usedRows_bounded a s b C pairing unions powers separation + infinite hL hC hG graph h p D bound i (row_mem_rowUsedRows hc right) + have same := fixed i.val (avoid i oldUsed (le_trans movedBound cap)) + have old := (M.internalRowAction_raw_entry a s b C pairing unions powers separation infinite + hL hC hG graph h p i col z hcol hz).1 (by rw [same]; exact right) + exact pc.unique _ y z left old + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +include fulfilled + +theorem generated_insertion (infinite : Realize M.sets infinity Fin.elim0) + {A c e d : ZFSet.{u}} (hA : A ∈ M.sets) + (subset : A ⊆ (run.finalGeometry i₀).carrier) (nonempty : A.Nonempty) + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ a ∈ A, ZFSet.pair e a ∈ (run.finalGeometry i₀).order) : + let geometry := run.finalGeometry i₀ + let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph A + F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + A ⊆ F ∧ + (∀ T, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph T → A ⊆ T → F ⊆ T) ∧ + (∀ x ∈ F, ZFSet.pair e x ∈ geometry.order) ∧ + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action c e d F caps actors := by + let geometry := run.finalGeometry i₀ + let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph A + have ground : F ∈ M.sets := M.generatedMeetFilter_mem pairing unions powers separation infinite + geometry.carrier_ground geometry.order_ground geometry.meet_ground hA + have filter := M.generatedMeetFilter_filter pairing unions separation infinite + geometry.carrier_ground geometry.meet subset nonempty + have contains := M.generatedMeetFilter_contains pairing unions separation infinite + geometry.carrier_ground geometry.meet subset + have allAbove := M.generatedMeetFilter_lower_bound pairing unions separation infinite + geometry.carrier_ground geometry.meet subset he above + exact ⟨ground, filter, contains, + fun _ code includes => M.generatedMeetFilter_least pairing unions separation infinite + geometry.carrier_ground geometry.meet subset code includes, + allAbove, fulfilled.insertion c hc e he d hd F ground filter lower strict bound allAbove⟩ + +theorem decoded_generated_insertion (infinite : Realize M.sets infinity Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) + (subset : A ⊆ (run.finalGeometry i₀).carrier) (nonempty : A.Nonempty) + (c e d : SetMembers (run.finalGeometry i₀).carrier) + (lower : ZFSet.pair (SetMembers.raw c) (SetMembers.raw e) ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair (SetMembers.raw e) (SetMembers.raw c) ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair (SetMembers.raw c) (SetMembers.raw d) ∈ (run.finalGeometry i₀).order) + (above : ∀ a ∈ A, ZFSet.pair (SetMembers.raw e) a ∈ (run.finalGeometry i₀).order) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph A + Compression.RecursiveMaps.HasInsertionFamily + (geometry.action_code.toOrderAction geometry.group_code geometry.meet) + (SetMembers Labels) c e d (fun x => SetMembers.raw x ∈ F) := by + obtain ⟨_, filter, _, _, _, caps, _, actors, _, family⟩ := + fulfilled.generated_insertion infinite hA subset nonempty + (SetMembers.raw_mem c) (SetMembers.raw_mem e) (SetMembers.raw_mem d) lower strict bound above + exact family.hasInsertionFamily (run.finalGeometry i₀).group_code + (run.finalGeometry i₀).meet (run.finalGeometry i₀).action_code filter + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +include fulfilled + +theorem generated_insertion_exceptions + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) (hLabels : Labels ∈ M.sets) + {generators c e d Used Profiles extra : ZFSet.{u}} + (hGenerators : generators ∈ M.sets) + (subset : generators ⊆ (run.finalGeometry i₀).carrier) (nonempty : generators.Nonempty) + (hc : c ∈ (run.finalGeometry i₀).carrier) (he : e ∈ (run.finalGeometry i₀).carrier) + (hd : d ∈ (run.finalGeometry i₀).carrier) + (lower : ZFSet.pair c e ∈ (run.finalGeometry i₀).order) + (strict : ZFSet.pair e c ∉ (run.finalGeometry i₀).order) + (bound : ZFSet.pair c d ∈ (run.finalGeometry i₀).order) + (above : ∀ a ∈ generators, ZFSet.pair e a ∈ (run.finalGeometry i₀).order) + (hUsed : Used ∈ M.sets) (hProfiles : Profiles ∈ M.sets) (hExtra : extra ∈ M.sets) + (usedSubset : Used ⊆ (run.finalGeometry i₀).carrier) + (filters : ∀ profile ∈ Profiles, MeetFilterCode (run.finalGeometry i₀).carrier + (run.finalGeometry i₀).order (run.finalGeometry i₀).meetGraph profile) + (smallUsed : M.groundEmbeddable Used ZFSet.omega) + (smallProfiles : M.groundEmbeddable Profiles ZFSet.omega) + (smallExtra : M.groundEmbeddable extra ZFSet.omega) (extraSubset : extra ⊆ Labels) : + let geometry := run.finalGeometry i₀ + let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators + F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + generators ⊆ F ∧ + (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → + generators ⊆ filter → F ⊆ filter) ∧ + (∀ x ∈ F, ZFSet.pair e x ∈ geometry.order) ∧ + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action c e d F caps actors ∧ + ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ + ∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → + (∀ node ∈ Used, ZFSet.pair node cap ∈ geometry.order → + ZFSet.pair node c ∈ geometry.order) ∧ + (∀ profile ∈ Profiles, c ∉ profile → cap ∉ profile) := by + let geometry := run.finalGeometry i₀ + obtain ⟨groundF, filter, contains, least, allAbove, caps, hCaps, actors, hActors, family⟩ := + fulfilled.generated_insertion infinite hGenerators subset nonempty hc he hd lower strict bound above + exact ⟨groundF, filter, contains, least, allAbove, caps, hCaps, actors, hActors, family, + family.exists_ground_countable_exceptions M pairing unions powers separation infinite choice + hLabels geometry.carrier_ground geometry.order_ground (M.transitive geometry.carrier_ground hc) + hCaps hUsed hProfiles hExtra geometry.meet usedSubset filters smallUsed smallProfiles + smallExtra extraSubset⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_insertion_exceptions + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (_hmu : mu ∈ M.sets) (_muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) + (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) + (_stagesOrdinal : ordinalSetProperty stages) + (_trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), + ZFSet.pair (c.encode row) A ∈ upperQ → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → + ∀ (generators c0 e0 d0 extra : ZFSet.{u}), Labels ∈ M.sets → + generators ∈ M.sets → generators ⊆ geometry.carrier → generators.Nonempty → + c0 ∈ geometry.carrier → e0 ∈ geometry.carrier → d0 ∈ geometry.carrier → + ZFSet.pair c0 e0 ∈ geometry.order → ZFSet.pair e0 c0 ∉ geometry.order → + ZFSet.pair c0 d0 ∈ geometry.order → + (∀ generator ∈ generators, ZFSet.pair e0 generator ∈ geometry.order) → + extra ∈ M.sets → M.groundEmbeddable extra ZFSet.omega → extra ⊆ Labels → + let L := ZFSet.prod stages (M.preparationWitnessBound s.carrier lifted upperQ) + let Used := insertionUsedNodes s.nonbottom.carrier columns (SetMembers.raw row) + indices lifted A s.carrier anchors + ∃ selections ∈ M.sets, ZFSet.IsFunc A L selections ∧ + selections ⊆ M.preparedWitnessSelections c.carrier lifted stages packed s.carrier + (ZFSet.pair (c.encode row) A) A ∧ + relationImage A L selections ∈ M.sets ∧ + M.groundEmbeddable (relationImage A L selections) ZFSet.omega ∧ + let Profiles := M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections + Used ∈ M.sets ∧ M.groundEmbeddable Used ZFSet.omega ∧ Used ⊆ geometry.carrier ∧ + Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ + (∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ + (∀ x alpha sourceRow sourceA k enumerations z F B f, + ZFSet.pair x (ZFSet.pair alpha + (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ selections → + ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → F ∈ Profiles) ∧ + let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators + F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + generators ⊆ F ∧ + (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → + generators ⊆ filter → F ⊆ filter) ∧ + (∀ x ∈ F, ZFSet.pair e0 x ∈ geometry.order) ∧ + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action c0 e0 d0 F caps actors ∧ + ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ + ∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → + (∀ node ∈ Used, ZFSet.pair node cap ∈ geometry.order → ZFSet.pair node c0 ∈ geometry.order) ∧ + (∀ profile ∈ Profiles, c0 ∉ profile → cap ∉ profile) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + intro row A condition prepared generators c0 e0 d0 extra hLabels hGenerators generatorSubset + generatorNonempty hc he hd lower strict bound above hExtra smallExtra extraSubset + have profileSelection := M.semanticStructuralTrace_preparedProfileSelection c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder + forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 + closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace infinite choice + condition prepared + obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, + profilesGround, profilesSmall, profileFilters, coverage⟩ := profileSelection + let Profiles := M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections + have meetEq : canonicalMeetGraph s.carrier s.conditionOrder = geometry.meetGraph := by + rw [geometry.decoded_order_eq] + exact geometry.meet.eq_canonicalMeetGraph.symm + have filters : ∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F := by + intro F member + have filter := profileFilters F member + rw [meetEq, geometry.decoded_order_eq] at filter + exact filter + have candidate := ((M.mem_refinementHistoryForcing c.carrier lifted stages packed _).1 condition).1 + have Adata := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate + obtain ⟨indicesGround, anchorsGround, anchorFunction⟩ := M.structuralIndexAnchorData + b.carrier s.carrier s.conditionOrder (supportBasisCode s b a.principalFix) lifted squared + stages history pairing unions powers separation collection hG hL order supports hLifted hSquared hs hh + have used := M.insertionUsedNodes_mem_small pairing unions powers separation infinite choice + (M.nonbottom_carrier_mem s separation hL) hColumns indicesGround hLifted Adata.2.1 hL + anchorsGround (SetMembers.raw_mem row) (fun _ h => (s.mem_nonbottom_carrier _).1 h |>.1) + anchorFunction Adata.2.2.2 + refine ⟨selections, whole, function, selected, rangeGround, rangeSmall, + used.1, used.2.1, used.2.2, profilesGround, profilesSmall, filters, coverage, ?_⟩ + exact fulfilled.generated_insertion_exceptions infinite choice hLabels hGenerators generatorSubset + generatorNonempty hc he hd lower strict bound above used.1 profilesGround hExtra used.2.2 + filters used.2.1 profilesSmall smallExtra extraSubset + + + + + + +theorem structural_compatible_insertion_unions + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) + (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) + (_stagesOrdinal : ordinalSetProperty stages) + (_trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), + ZFSet.pair (c.encode row) A ∈ upperQ → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → + ∀ (generators c0 e0 d0 extra : ZFSet.{u}), Labels ∈ M.sets → + generators ∈ M.sets → generators ⊆ geometry.carrier → generators.Nonempty → + c0 ∈ geometry.carrier → e0 ∈ geometry.carrier → d0 ∈ geometry.carrier → + ZFSet.pair c0 e0 ∈ geometry.order → ZFSet.pair e0 c0 ∉ geometry.order → + ZFSet.pair c0 d0 ∈ geometry.order → + (∀ generator ∈ generators, ZFSet.pair e0 generator ∈ geometry.order) → + extra ∈ M.sets → M.groundEmbeddable extra ZFSet.omega → extra ⊆ Labels → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → + ZFSet.pair (s.encode i) d0 ∈ geometry.order) → + (∀ z ∈ A, ZFSet.pair z d0 ∈ stageOneDataBounds A indices lifted S s.carrier mu + s.nonbottom.carrier s.conditionOrder anchors tuples) → + let L := ZFSet.prod stages (M.preparationWitnessBound s.carrier lifted upperQ) + let Used := insertionUsedNodes s.nonbottom.carrier columns (SetMembers.raw row) + indices lifted A s.carrier anchors + ∃ selections ∈ M.sets, ZFSet.IsFunc A L selections ∧ + selections ⊆ M.preparedWitnessSelections c.carrier lifted stages packed s.carrier + (ZFSet.pair (c.encode row) A) A ∧ + relationImage A L selections ∈ M.sets ∧ + M.groundEmbeddable (relationImage A L selections) ZFSet.omega ∧ + let Profiles := M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections + Used ∈ M.sets ∧ M.groundEmbeddable Used ZFSet.omega ∧ Used ⊆ geometry.carrier ∧ + Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ + (∀ F ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ + (∀ x alpha sourceRow sourceA k enumerations z F B f, + ZFSet.pair x (ZFSet.pair alpha + (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ selections → + ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → F ∈ Profiles) ∧ + let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators + F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + generators ⊆ F ∧ + (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → + generators ⊆ filter → F ⊆ filter) ∧ + (∀ x ∈ F, ZFSet.pair e0 x ∈ geometry.order) ∧ + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + ∃ family : FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action c0 e0 d0 F caps actors, + ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ extra ⊆ bad ∧ + (∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → + (∀ node ∈ Used, ZFSet.pair node cap ∈ geometry.order → ZFSet.pair node c0 ∈ geometry.order) ∧ + (∀ profile ∈ Profiles, c0 ∉ profile → cap ∉ profile)) ∧ + (¬ M.groundEmbeddable Labels ZFSet.omega → ∃ label ∈ Labels, label ∉ bad) ∧ + ∀ label : SetMembers Labels, SetMembers.raw label ∉ bad → + let h := family.decodedActors label + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A + ∃ commonRow : SetMembers c.carrier, + SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso h row) ∧ + ZFSet.pair (c.encode commonRow) (A ∪ movedA) ∈ upperQ ∧ + ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) (ZFSet.pair (c.encode row) A) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed ∧ + ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) + (ZFSet.pair (c.encode (act.iso h row)) movedA) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + intro row A condition prepared generators c0 e0 d0 extra hLabels hGenerators generatorSubset + generatorNonempty hc he hd lower strict bound above hExtra smallExtra extraSubset rowD dataD + obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, + usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, profileFilters, coverage, + filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, + family, bad, hBad, badSubset, badSmall, containsExtra, good⟩ := + fulfilled.structural_insertion_exceptions collection infinite choice columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace row A condition prepared generators c0 e0 d0 extra + hLabels hGenerators generatorSubset generatorNonempty hc he hd lower strict bound above + hExtra smallExtra extraSubset + have available : ¬ M.groundEmbeddable Labels ZFSet.omega → ∃ label ∈ Labels, label ∉ bad := by + classical + intro notSmall + by_contra none + apply notSmall + have equal : bad = Labels := by + apply ZFSet.ext + intro label + exact ⟨fun member => badSubset member, fun member => by + by_contra outside + exact none ⟨label, member, outside⟩⟩ + rwa [equal] at badSmall + refine ⟨selections, whole, function, selected, rangeGround, rangeSmall, + usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, profileFilters, coverage, + filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, + family, bad, hBad, badSubset, badSmall, containsExtra, good, available, ?_⟩ + intro label goodLabel + let h := family.decodedActors label + let cap := family.decodedCaps label + let V : SetMembers geometry.carrier := SetMembers.ofMem c0 hc + let D0 : SetMembers geometry.carrier := SetMembers.ofMem d0 hd + have actorEdge := family.decodedActors_entry label + have capEdge := family.decodedCaps_entry label + have goodLaws := good _ _ capEdge goodLabel + have fixed : h ∈ a.principalFix V := by + intro v hv + apply (geometry.action_code.act_eq_iff h v v).2 + apply family.fixes _ _ actorEdge _ (SetMembers.raw_mem v) + change ZFSet.pair (SetMembers.raw v) (SetMembers.raw V) ∈ geometry.order at hv + simpa only [V, SetMembers.raw_ofMem] using hv + have belowCap : a.iso h D0 ≤ cap := by + change ZFSet.pair (SetMembers.raw (a.iso h D0)) (SetMembers.raw cap) ∈ geometry.order + apply family.dominates _ _ _ actorEdge capEdge _ (SetMembers.raw_mem _) + have entry : ZFSet.pair (ZFSet.pair (SetMembers.raw h) (SetMembers.raw D0)) + (SetMembers.raw (a.iso h D0)) ∈ geometry.action := geometry.action_code.act_mem h D0 + change ZFSet.pair (ZFSet.pair (SetMembers.raw h) d0) + (SetMembers.raw (a.iso h D0)) ∈ geometry.action + simpa only [D0, SetMembers.raw_ofMem] using entry + have usedD (i : {i : SetMembers geometry.carrier // i ≠ ⊥}) + (used : s.encode i.val ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row)) : + i.val ≤ D0 := by + change ZFSet.pair (SetMembers.raw i.val) (SetMembers.raw D0) ∈ geometry.order + have bound : ZFSet.pair (SetMembers.raw i.val) d0 ∈ geometry.order := rowD i.val used + simpa only [D0, SetMembers.raw_ofMem] using bound + have avoidRows (i : {i : SetMembers geometry.carrier // i ≠ ⊥}) + (used : s.encode i.val ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row)) + (below : i.val ≤ cap) : i.val ≤ V := by + change ZFSet.pair (SetMembers.raw i.val) (SetMembers.raw V) ∈ geometry.order + rw [SetMembers.raw_ofMem] + exact goodLaws.1 _ (ZFSet.mem_union.2 (Or.inl used)) below + obtain ⟨commonRow, rowCode, below, belowH⟩ := M.internalRowAction_insertion_union a s b columns + pairing unions powers separation infinite hL hC hG graph choice row h D0 cap V usedD belowCap fixed avoidRows + have candidate := ((M.mem_refinementHistoryForcing c.carrier lifted stages packed _).1 condition).1 + have Adata := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate + have originalData : ∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ + stageOneDataBounds A indices lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples := by + have code : s.encode D0 = d0 := SetMembers.raw_ofMem d0 hd + rw [code] + exact dataD + have transported := M.binaryRowStructuralAssignmentImage_dataBound a s b columns pairing unions powers + separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh + stagesOrdinal trace h D0 A Adata.2.1 originalData + have anchorGood : ∀ idx u w E, + stageOneAssignment idx u w ∈ A → ZFSet.pair idx E ∈ anchors → + ZFSet.pair E (s.encode cap) ∈ s.conditionOrder → ZFSet.pair E (s.encode V) ∈ s.conditionOrder := by + intro idx u w E assignment anchor lowerCap + have fields := (stageOneAssignment_mem_assignments indices lifted idx u w).1 (Adata.2.2.1 assignment) + have Ebound : E ∈ s.carrier := (ZFSet.pair_mem_prod.1 + ((M.structuralIndexAnchors_function b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history).1 anchor)).2 + have used := (mem_insertionUsedNodes s.nonbottom.carrier columns (SetMembers.raw row) + indices lifted A s.carrier anchors E).2 (Or.inr + ⟨Ebound, idx, fields.1, u, fields.2.1, w, fields.2.2, assignment, anchor⟩) + rw [geometry.decoded_order_eq] at lowerCap ⊢ + change ZFSet.pair E (SetMembers.raw V) ∈ geometry.order + rw [SetMembers.raw_ofMem] + exact goodLaws.1 E used lowerCap + have profileGood : ∀ F ∈ M.preparedSelectionProfiles A stages upperQ s.carrier lifted selections, + s.encode V ∉ F → s.encode cap ∉ F := by + have code : s.encode V = c0 := SetMembers.raw_ofMem c0 hc + rw [code] + exact goodLaws.2 + have unionFacts := M.semanticStructuralTrace_insertion_union c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order + graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace infinite choice small indices S mu s.nonbottom.carrier tuples + (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) + (fun D f _ tau entry bound => M.liftedRowTuple_supported a s b columns pairing unions powers separation + infinite hL hC hG graph hmu muOrdinal valid f tau D entry bound.2) + row commonRow A selections h D0 cap V condition function selected rangeGround rangeSmall + below belowH fixed belowCap anchorGood profileGood transported.2.2 + exact ⟨commonRow, rowCode, unionFacts⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + + + + +namespace PartitionPilot.Forcing.PosetAction +open SetRealization +universe u +variable {G P L : Type u} [Group G] [PartialOrder P] [PartialOrder L] + +theorem compressed_name_support (a : PosetAction G P) (s : Presentation P) + (d : PosetAction G L) (g : G) (D E : L) (tau : Name s) + (support : d.principalFix D ≤ a.stabilizer s tau) + (below : d.iso g D ≤ E) : + d.principalFix E ≤ a.stabilizer s (a.act s g tau) := by + rw [a.stabilizer_conjugation] + have moved : d.principalFix (d.iso g D) ≤ + (a.stabilizer s tau).map (Compression.RecursiveMaps.CosetGeometry.OrderAction.conjugateHom g) := by + rw [← principalFix_map_conjugate] + exact Subgroup.map_mono support + exact le_trans (d.principalFix_antitone below) moved + +end PartitionPilot.Forcing.PosetAction + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_compression + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) + (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) + (_stagesOrdinal : ordinalSetProperty stages) + (_trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), + ZFSet.pair (c.encode row) A ∈ upperQ → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → + ∀ (V E D0 : SetMembers geometry.carrier), V < E → V ≤ D0 → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ D0) → + (∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A indices lifted S s.carrier mu + s.nonbottom.carrier s.conditionOrder anchors tuples) → + ∃ (h : SetMembers geometry.actors) (cap : SetMembers geometry.carrier), + h ∈ a.principalFix V ∧ V < cap ∧ cap ≤ E ∧ a.iso h D0 ≤ cap ∧ + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A + ∃ commonRow : SetMembers c.carrier, + SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso h row) ∧ + ZFSet.pair (c.encode commonRow) (A ∪ movedA) ∈ upperQ ∧ + ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) (ZFSet.pair (c.encode row) A) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed ∧ + ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) + (ZFSet.pair (c.encode (act.iso h row)) movedA) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + intro row A condition prepared V E D0 lower bound rowD dataD + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have labelGround : Labels ∈ M.sets := labels.symm ▸ spec.1 + have labelLarge : ¬ M.groundEmbeddable Labels ZFSet.omega := labels.symm ▸ spec.2.2.2 + have generatorGround : ({s.encode E} : ZFSet.{u}) ∈ M.sets := + M.insert_mem pairing unions (M.transitive hL (s.encode_mem E)) (M.empty_mem ⟨s.carrier, hL⟩) + have generatorSubset : ({s.encode E} : ZFSet.{u}) ⊆ geometry.carrier := by + intro z hz + have same := ZFSet.mem_singleton.1 hz + subst z + exact s.encode_mem E + have generatorNonempty : ({s.encode E} : ZFSet.{u}).Nonempty := + ⟨s.encode E, ZFSet.mem_singleton.2 rfl⟩ + have above : ∀ z ∈ ({s.encode E} : ZFSet.{u}), ZFSet.pair (s.encode E) z ∈ geometry.order := by + intro z hz + have same := ZFSet.mem_singleton.1 hz + subst z + exact geometry.meet.order.refl _ (s.encode_mem E) + have rawRowD : ∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → + ZFSet.pair (s.encode i) (s.encode D0) ∈ geometry.order := fun i hi => rowD i hi + obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, + usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, profileFilters, coverage, + filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, + family, bad, hBad, badSubset, badSmall, containsExtra, good, available, unionsFor⟩ := + fulfilled.structural_compatible_insertion_unions collection infinite choice small columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace row A condition prepared + {s.encode E} (s.encode V) (s.encode E) (s.encode D0) ∅ + labelGround generatorGround generatorSubset generatorNonempty (s.encode_mem V) + (s.encode_mem E) (s.encode_mem D0) (le_of_lt lower) (not_le_of_gt lower) bound above + (M.empty_mem ⟨s.carrier, hL⟩) (M.empty_groundEmbeddable ZFSet.omega ⟨s.carrier, hL⟩) + (fun _ member => (ZFSet.notMem_empty _ member).elim) rawRowD dataD + obtain ⟨label, labelMember, goodLabel⟩ := available labelLarge + let chosen : SetMembers Labels := SetMembers.ofMem label labelMember + have chosenGood : SetMembers.raw chosen ∉ bad := by + simpa only [chosen, SetMembers.raw_ofMem] using goodLabel + let h := family.decodedActors chosen + let cap := family.decodedCaps chosen + have actorEdge := family.decodedActors_entry chosen + have capEdge := family.decodedCaps_entry chosen + have fixed : h ∈ a.principalFix V := by + intro v hv + exact (geometry.action_code.act_eq_iff h v v).2 + (family.fixes _ _ actorEdge _ (s.encode_mem v) hv) + have profile := family.profiles _ _ capEdge + have strictCap : V < cap := lt_iff_le_not_ge.2 ⟨profile.target_below_cap, profile.cap_not_below_target⟩ + have capBelow : cap ≤ E := + ((family.tests geometry.meet.order filterCode capEdge (s.encode_mem E) + (geometry.meet.order.refl _ (s.encode_mem E))).1 + (contains (ZFSet.mem_singleton.2 rfl))) + have movedBound : a.iso h D0 ≤ cap := + family.dominates _ _ _ actorEdge capEdge _ (s.encode_mem _) (geometry.action_code.act_mem h D0) + exact ⟨h, cap, fixed, strictCap, capBelow, movedBound, unionsFor chosen chosenGood⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralLateProfileExclusions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralLateProfileExclusions.lean index cb66c2f27ea91576adfb53052906ceedba9a4f7f..705c8919b34a0853d9749960131e7a7dfbf5814f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralLateProfileExclusions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralLateProfileExclusions.lean @@ -1,213 +1,213 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralCompression - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_compatible_insertion_with_late_profiles - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) - (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) - (_stagesOrdinal : ordinalSetProperty stages) - (_trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), - ZFSet.pair (c.encode row) A ∈ upperQ → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → - ∀ (V E D0 : SetMembers geometry.carrier) (generators lateProfiles : ZFSet.{u}), - V < E → V ≤ D0 → generators ∈ M.sets → generators ⊆ geometry.carrier → - generators.Nonempty → (∀ z ∈ generators, ZFSet.pair (s.encode E) z ∈ geometry.order) → - lateProfiles ∈ M.sets → M.groundEmbeddable lateProfiles ZFSet.omega → - (∀ profile ∈ lateProfiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph profile) → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ D0) → - (∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A indices lifted S s.carrier mu - s.nonbottom.carrier s.conditionOrder anchors tuples) → - let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators - F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - generators ⊆ F ∧ - (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → - generators ⊆ filter → F ⊆ filter) ∧ - (∀ x ∈ F, ZFSet.pair (s.encode E) x ∈ geometry.order) ∧ - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - ∃ family : FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order - geometry.meetGraph geometry.action (s.encode V) (s.encode E) (s.encode D0) F caps actors, - ∃ badComp ∈ M.sets, badComp ⊆ Labels ∧ M.groundEmbeddable badComp ZFSet.omega ∧ - ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ badComp ⊆ bad ∧ - (∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → - ∀ profile ∈ lateProfiles, s.encode V ∉ profile → cap ∉ profile) ∧ - (∃ label : SetMembers Labels, SetMembers.raw label ∉ bad) ∧ - ∀ label : SetMembers Labels, SetMembers.raw label ∉ bad → - let h := family.decodedActors label - let cap := family.decodedCaps label - h ∈ a.principalFix V ∧ V < cap ∧ ¬ E ≤ cap ∧ a.iso h D0 ≤ cap ∧ - (∀ v : SetMembers geometry.carrier, E ≤ v → - (s.encode v ∈ F → cap ≤ v) ∧ - (s.encode v ∉ F → ZFSet.pair (ZFSet.pair (s.encode cap) (s.encode v)) - (s.encode V) ∈ geometry.meetGraph)) ∧ - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A - ∃ commonRow : SetMembers c.carrier, - SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso h row) ∧ - ZFSet.pair (c.encode commonRow) (A ∪ movedA) ∈ upperQ ∧ - ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) (ZFSet.pair (c.encode row) A) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed ∧ - ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) - (ZFSet.pair (c.encode (act.iso h row)) movedA) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let indices := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph indices s.carrier 2 - intro row A condition prepared V E D0 generators lateProfiles lower bound - hGenerators generatorSubset generatorNonempty above hProfiles smallProfiles profileFilters rowD dataD - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have labelGround : Labels ∈ M.sets := labels.symm ▸ spec.1 - have labelLarge : ¬ M.groundEmbeddable Labels ZFSet.omega := labels.symm ▸ spec.2.2.2 - have emptyGround := M.empty_mem ⟨s.carrier, hL⟩ - have emptySmall := M.empty_groundEmbeddable ZFSet.omega ⟨s.carrier, hL⟩ - have rawRowD : ∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → - ZFSet.pair (s.encode i) (s.encode D0) ∈ geometry.order := fun i hi => rowD i hi - obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, - usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, preparedProfileFilters, coverage, - filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, - family, badComp, hBadComp, badCompSubset, badCompSmall, containsExtra, good, available, unionsFor⟩ := - fulfilled.structural_compatible_insertion_unions collection infinite choice small columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace row A condition prepared - generators (s.encode V) (s.encode E) (s.encode D0) ∅ - labelGround hGenerators generatorSubset generatorNonempty (s.encode_mem V) - (s.encode_mem E) (s.encode_mem D0) (le_of_lt lower) (not_le_of_gt lower) bound above - emptyGround emptySmall (fun _ member => (ZFSet.notMem_empty _ member).elim) rawRowD dataD - obtain ⟨bad, hBad, badSubset, badSmall, containsComp, lateGood⟩ := - family.exists_ground_countable_exceptions M pairing unions powers separation infinite choice - labelGround hL geometry.order_ground (M.transitive hL (s.encode_mem V)) hCaps - emptyGround hProfiles hBadComp geometry.meet - (fun _ member => (ZFSet.notMem_empty _ member).elim) - profileFilters emptySmall smallProfiles badCompSmall badCompSubset - have survivor : ∃ label : SetMembers Labels, SetMembers.raw label ∉ bad := by - classical - by_contra none - apply labelLarge - have equal : bad = Labels := by - apply ZFSet.ext - intro label - refine ⟨fun member => badSubset member, ?_⟩ - intro member - by_contra outside - exact none ⟨SetMembers.ofMem label member, by simpa only [SetMembers.raw_ofMem] using outside⟩ - rwa [equal] at badSmall - refine ⟨filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, - family, badComp, hBadComp, badCompSubset, badCompSmall, bad, hBad, badSubset, badSmall, - containsComp, fun label cap entry outside => (lateGood label cap entry outside).2, survivor, ?_⟩ - intro label outside - have compGood : SetMembers.raw label ∉ badComp := fun member => outside (containsComp member) - let h := family.decodedActors label - let cap := family.decodedCaps label - have actorEdge := family.decodedActors_entry label - have capEdge := family.decodedCaps_entry label - have fixed : h ∈ a.principalFix V := by - intro v hv - exact (geometry.action_code.act_eq_iff h v v).2 - (family.fixes _ _ actorEdge _ (s.encode_mem v) hv) - have profile := family.profiles _ _ capEdge - have strictCap : V < cap := lt_iff_le_not_ge.2 ⟨profile.target_below_cap, profile.cap_not_below_target⟩ - have movedBound : a.iso h D0 ≤ cap := - family.dominates _ _ _ actorEdge capEdge _ (s.encode_mem _) (geometry.action_code.act_mem h D0) - exact ⟨fixed, strictCap, profile.separator_not_below_cap, movedBound, - fun v aboveV => family.tests geometry.meet.order filterCode capEdge (s.encode_mem v) aboveV, - unionsFor label compGood⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralCompression + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_compatible_insertion_with_late_profiles + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) + (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) + (_stagesOrdinal : ordinalSetProperty stages) + (_trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + ∀ (row : SetMembers c.carrier) (A : ZFSet.{u}), + ZFSet.pair (c.encode row) A ∈ upperQ → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (ZFSet.pair (c.encode row) A) → + ∀ (V E D0 : SetMembers geometry.carrier) (generators lateProfiles : ZFSet.{u}), + V < E → V ≤ D0 → generators ∈ M.sets → generators ⊆ geometry.carrier → + generators.Nonempty → (∀ z ∈ generators, ZFSet.pair (s.encode E) z ∈ geometry.order) → + lateProfiles ∈ M.sets → M.groundEmbeddable lateProfiles ZFSet.omega → + (∀ profile ∈ lateProfiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph profile) → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ D0) → + (∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A indices lifted S s.carrier mu + s.nonbottom.carrier s.conditionOrder anchors tuples) → + let F := M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators + F ∈ M.sets ∧ MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + generators ⊆ F ∧ + (∀ filter, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph filter → + generators ⊆ filter → F ⊆ filter) ∧ + (∀ x ∈ F, ZFSet.pair (s.encode E) x ∈ geometry.order) ∧ + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + ∃ family : FinalInsertionFamiliesCode Labels geometry.carrier geometry.actors geometry.order + geometry.meetGraph geometry.action (s.encode V) (s.encode E) (s.encode D0) F caps actors, + ∃ badComp ∈ M.sets, badComp ⊆ Labels ∧ M.groundEmbeddable badComp ZFSet.omega ∧ + ∃ bad ∈ M.sets, bad ⊆ Labels ∧ M.groundEmbeddable bad ZFSet.omega ∧ badComp ⊆ bad ∧ + (∀ label cap, ZFSet.pair label cap ∈ caps → label ∉ bad → + ∀ profile ∈ lateProfiles, s.encode V ∉ profile → cap ∉ profile) ∧ + (∃ label : SetMembers Labels, SetMembers.raw label ∉ bad) ∧ + ∀ label : SetMembers Labels, SetMembers.raw label ∉ bad → + let h := family.decodedActors label + let cap := family.decodedCaps label + h ∈ a.principalFix V ∧ V < cap ∧ ¬ E ≤ cap ∧ a.iso h D0 ≤ cap ∧ + (∀ v : SetMembers geometry.carrier, E ≤ v → + (s.encode v ∈ F → cap ≤ v) ∧ + (s.encode v ∉ F → ZFSet.pair (ZFSet.pair (s.encode cap) (s.encode v)) + (s.encode V) ∈ geometry.meetGraph)) ∧ + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h) A + ∃ commonRow : SetMembers c.carrier, + SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso h row) ∧ + ZFSet.pair (c.encode commonRow) (A ∪ movedA) ∈ upperQ ∧ + ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) (ZFSet.pair (c.encode row) A) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed ∧ + ZFSet.pair (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) + (ZFSet.pair (c.encode (act.iso h row)) movedA) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted stages packed := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let indices := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph indices s.carrier 2 + intro row A condition prepared V E D0 generators lateProfiles lower bound + hGenerators generatorSubset generatorNonempty above hProfiles smallProfiles profileFilters rowD dataD + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have labelGround : Labels ∈ M.sets := labels.symm ▸ spec.1 + have labelLarge : ¬ M.groundEmbeddable Labels ZFSet.omega := labels.symm ▸ spec.2.2.2 + have emptyGround := M.empty_mem ⟨s.carrier, hL⟩ + have emptySmall := M.empty_groundEmbeddable ZFSet.omega ⟨s.carrier, hL⟩ + have rawRowD : ∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → + ZFSet.pair (s.encode i) (s.encode D0) ∈ geometry.order := fun i hi => rowD i hi + obtain ⟨selections, whole, function, selected, rangeGround, rangeSmall, + usedGround, usedSmall, usedSubset, profilesGround, profilesSmall, preparedProfileFilters, coverage, + filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, + family, badComp, hBadComp, badCompSubset, badCompSmall, containsExtra, good, available, unionsFor⟩ := + fulfilled.structural_compatible_insertion_unions collection infinite choice small columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace row A condition prepared + generators (s.encode V) (s.encode E) (s.encode D0) ∅ + labelGround hGenerators generatorSubset generatorNonempty (s.encode_mem V) + (s.encode_mem E) (s.encode_mem D0) (le_of_lt lower) (not_le_of_gt lower) bound above + emptyGround emptySmall (fun _ member => (ZFSet.notMem_empty _ member).elim) rawRowD dataD + obtain ⟨bad, hBad, badSubset, badSmall, containsComp, lateGood⟩ := + family.exists_ground_countable_exceptions M pairing unions powers separation infinite choice + labelGround hL geometry.order_ground (M.transitive hL (s.encode_mem V)) hCaps + emptyGround hProfiles hBadComp geometry.meet + (fun _ member => (ZFSet.notMem_empty _ member).elim) + profileFilters emptySmall smallProfiles badCompSmall badCompSubset + have survivor : ∃ label : SetMembers Labels, SetMembers.raw label ∉ bad := by + classical + by_contra none + apply labelLarge + have equal : bad = Labels := by + apply ZFSet.ext + intro label + refine ⟨fun member => badSubset member, ?_⟩ + intro member + by_contra outside + exact none ⟨SetMembers.ofMem label member, by simpa only [SetMembers.raw_ofMem] using outside⟩ + rwa [equal] at badSmall + refine ⟨filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, + family, badComp, hBadComp, badCompSubset, badCompSmall, bad, hBad, badSubset, badSmall, + containsComp, fun label cap entry outside => (lateGood label cap entry outside).2, survivor, ?_⟩ + intro label outside + have compGood : SetMembers.raw label ∉ badComp := fun member => outside (containsComp member) + let h := family.decodedActors label + let cap := family.decodedCaps label + have actorEdge := family.decodedActors_entry label + have capEdge := family.decodedCaps_entry label + have fixed : h ∈ a.principalFix V := by + intro v hv + exact (geometry.action_code.act_eq_iff h v v).2 + (family.fixes _ _ actorEdge _ (s.encode_mem v) hv) + have profile := family.profiles _ _ capEdge + have strictCap : V < cap := lt_iff_le_not_ge.2 ⟨profile.target_below_cap, profile.cap_not_below_target⟩ + have movedBound : a.iso h D0 ≤ cap := + family.dominates _ _ _ actorEdge capEdge _ (s.encode_mem _) (geometry.action_code.act_mem h D0) + exact ⟨fixed, strictCap, profile.separator_not_below_cap, movedBound, + fun v aboveV => family.tests geometry.meet.order filterCode capEdge (s.encode_mem v) aboveV, + unionsFor label compGood⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRectangleRefinements.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRectangleRefinements.lean index 0e2acb59fff0e965acf7d5ae85c483864faa44c8..867787e25da5514bb0731cac1bae99fd1259bce1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRectangleRefinements.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRectangleRefinements.lean @@ -1,777 +1,777 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAlignedRectangleUnions -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalRectangleActionData -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralPositionSupport -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowRectangles - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem structural_bounds_with - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) - (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) - (_stagesOrdinal : ordinalSetProperty stages) - (_trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - ∀ (q : SetMembers upperQ) (row : SetMembers c.carrier) (A : ZFSet.{u}) - (U V : SetMembers geometry.carrier), - SetMembers.raw q = ZFSet.pair (c.encode row) A → - ∃ X : SetMembers geometry.carrier, U ≤ X ∧ V ≤ X ∧ - (∀ i : SetMembers geometry.carrier, - s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ X) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode X) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - intro q row A U V code - have countableBound : ∀ Z ∈ M.sets, Z ⊆ s.carrier → M.groundEmbeddable Z ZFSet.omega → - ∃ X : SetMembers geometry.carrier, ∀ z : SetMembers geometry.carrier, s.encode z ∈ Z → z ≤ X := - geometry.decoded_countable_bound - (fun Z hZ subset countable => (fulfilled.countable_localization Z hZ subset countable).2) - let extra : ZFSet.{u} := {s.encode U, s.encode V} - have groundU := M.transitive hL (s.encode_mem U) - have groundV := M.transitive hL (s.encode_mem V) - have extraGround : extra ∈ M.sets := M.unorderedPair_mem pairing groundU groundV - have extraSubset : extra ⊆ s.carrier := by - intro z member - rcases ZFSet.mem_pair.1 member with rfl | rfl - · exact s.encode_mem U - · exact s.encode_mem V - have emptyGround := M.empty_mem ⟨s.carrier, hL⟩ - have firstSmall := M.groundEmbeddable_insert pairing unions powers separation infinite emptyGround groundV - (M.empty_groundEmbeddable ZFSet.omega ⟨s.carrier, hL⟩) - have firstGround := M.insert_mem pairing unions groundV emptyGround - have extraSmall : M.groundEmbeddable extra ZFSet.omega := by - exact M.groundEmbeddable_insert pairing unions powers separation infinite - firstGround groundU firstSmall - obtain ⟨X, _f, _hf, _W, _hW, _function, _selected, _equal, _subset, _small, - _bounded, dataBound, rowBound, extraBound, _fixed⟩ := - M.binaryRowStructuralPositionSupport a s b columns pairing unions powers separation collection infinite - choice hL order hC hG graph nodeMaps supports directed countableBound hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace q row A code extra extraGround extraSubset extraSmall - exact ⟨X, extraBound U (ZFSet.mem_pair.2 (Or.inl rfl)), - extraBound V (ZFSet.mem_pair.2 (Or.inr rfl)), rowBound, dataBound⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) -variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -include collection order nodeMaps supports - -theorem binaryRowStructural_aligned_rectangle_union - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (meet : L → L → L) - (meetComm : ∀ x y : L, meet x y = meet y x) - (meetLeft : ∀ x y : L, meet x y ≤ x) - (meetRight : ∀ x y : L, meet x y ≤ y) - (meetGreatest : ∀ x y z : L, z ≤ x → z ≤ y → z ≤ meet x y) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (muOrdinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) - (g1 g2 h1 h2 : G) (D X V W : L), - SetMembers.raw p = ZFSet.pair (c.encode r) A → - SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → - q ≤ upperAct.iso g1 p → q ≤ upperAct.iso g2 p → - (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i ≤ D) → - (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ - stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - g1⁻¹ * h1 ∈ a.principalFix V → g2⁻¹ * h2 ∈ a.principalFix V → - h1⁻¹ * h2 ∈ a.principalFix W → - meet (a.iso h1 D) X = a.iso h1 V → - meet (a.iso h2 D) X = a.iso h2 V → - meet (a.iso h1 D) (a.iso h2 D) = a.iso h1 W → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : L) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (meet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - let movedA1 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h1) A - let movedA2 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h2) A - ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, - SetMembers.raw row = (SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h1 r)) ∪ - SetMembers.raw (act.iso h2 r) ∧ - SetMembers.raw result = ZFSet.pair (c.encode row) (movedA2 ∪ (movedA1 ∪ oldA)) ∧ - result ≤ q ∧ result ≤ upperAct.iso h1 p ∧ result ≤ upperAct.iso h2 p := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder - forcingAction omega topMem topRows packed I anchors upperQ - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - intro upperAct p q r oldRow A oldA g1 g2 h1 h2 D X V W pCode qCode prepared below1 below2 - usedD usedX dataD dataX relative1 relative2 between overlap1 overlap2 overlap12 descent movedA1 movedA2 - have source : ZFSet.pair (c.encode r) A ∈ upperQ := pCode ▸ SetMembers.raw_mem p - have oldSource : ZFSet.pair (c.encode oldRow) oldA ∈ upperQ := qCode ▸ SetMembers.raw_mem q - have reference1 := M.semanticStructuralOrder_action_coordinates c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hs hh stagesOrdinal trace g1 p q r oldRow A oldA pCode qCode below1 - have reference2 := M.semanticStructuralOrder_action_coordinates c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hs hh stagesOrdinal trace g2 p q r oldRow A oldA pCode qCode below2 - have agree (g h : G) (B : L) (relative : g⁻¹ * h ∈ a.principalFix B) - (i : L) (hi : i ≤ B) : a.iso h i = a.iso g i := by - have moved := congrArg (a.iso g) (relative i hi) - simpa only [a.mul, a.point_inv_right] using moved - obtain ⟨row, rowCode, rowBelowOld, rowBelowH1, rowBelowH2⟩ := - M.internalRowAction_rectangle_union a s b C pairing unions powers separation infinite hL hC hG graph - choice r oldRow D X V W g1 g2 h1 h2 - (fun i hi => usedD i.val hi) (fun i hi => usedX i.val hi) reference1.1 reference2.1 - (agree g1 h1 V relative1) (agree g2 h2 V relative2) - (fun i hi => (agree h1 h2 W between i hi).symm) - (fun i hi hx => overlap1 ▸ meetGreatest _ _ i hi hx) - (fun i hi hx => overlap2 ▸ meetGreatest _ _ i hi hx) - (fun i hi hj => overlap12 ▸ meetGreatest _ _ i hi hj) - have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages packed - (ZFSet.pair (c.encode r) A)).1 source |>.1 - have hA : A ∈ M.sets := ((M.mem_groundSmallSubsets _ _ A).1 (ZFSet.pair_mem_prod.1 candidate).2).1 - have transported1 := M.binaryRowStructuralAssignmentImage_dataBound a s b C pairing unions powers - separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh - stagesOrdinal trace h1 D A hA dataD - have transported2 := M.binaryRowStructuralAssignmentImage_dataBound a s b C pairing unions powers - separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh - stagesOrdinal trace h2 D A hA dataD - have unionFacts := M.semanticStructuralTrace_aligned_rectangle_union c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order - graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace infinite choice small meet I S mu s.nonbottom.carrier tuples - (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) - (fun D f _ tau entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation - infinite hL hC hG graph hmu muOrdinal valid f tau D entry bound.2) - r oldRow row A oldA g1 g2 h1 h2 D X V W source oldSource (pCode ▸ prepared) - rowBelowOld reference1.1 reference2.1 rowBelowH1 rowBelowH2 reference1.2 reference2.2 - relative1 relative2 between overlap1 overlap2 overlap12 meetComm meetLeft meetRight meetGreatest - transported1.2.2 transported2.2.2 dataX descent - let result : SetMembers upperQ := SetMembers.ofMem _ unionFacts.1 - have resultCode : SetMembers.raw result = ZFSet.pair (c.encode row) (movedA2 ∪ (movedA1 ∪ oldA)) := - SetMembers.raw_ofMem _ _ - have movedCode (h : G) := M.semanticStructuralAction_coordinates c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order - graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace h p r A pCode - refine ⟨row, result, rowCode, resultCode, ?_, ?_, ?_⟩ - · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw q) ∈ _ - rw [resultCode, qCode] - exact unionFacts.2.1 - · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw (upperAct.iso h1 p)) ∈ _ - rw [resultCode, movedCode h1] - exact unionFacts.2.2.1 - · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw (upperAct.iso h2 p)) ∈ _ - rw [resultCode, movedCode h2] - exact unionFacts.2.2.2 - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem structural_rectangle_union - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) - (g1 g2 : SetMembers geometry.actors) (dBound X V W : SetMembers geometry.carrier), - SetMembers.raw p = ZFSet.pair (c.encode r) A → - SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → - q ≤ upperAct.iso g1 p → q ≤ upperAct.iso g2 p → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw r) → i ≤ dBound) → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → - (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ - stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - ExternalRectangleCode geometry.carrier geometry.actors geometry.order geometry.meetGraph geometry.action - (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw dBound) - (SetMembers.raw g1) (SetMembers.raw g2) → - a.iso g1 dBound ≤ X → a.iso g2 dBound ≤ X → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - ∃ h1 h2 : SetMembers geometry.actors, - RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph geometry.action - (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw dBound) - (SetMembers.raw g1) (SetMembers.raw g2) (SetMembers.raw X) - (SetMembers.raw h1) (SetMembers.raw h2) ∧ - (let movedA1 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h1) A; - let movedA2 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h2) A; - ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, - SetMembers.raw row = (SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h1 r)) ∪ - SetMembers.raw (act.iso h2 r) ∧ - SetMembers.raw result = ZFSet.pair (c.encode row) (movedA2 ∪ (movedA1 ∪ oldA)) ∧ - result ≤ q ∧ result ≤ upperAct.iso h1 p ∧ result ≤ upperAct.iso h2 p) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - intro p q r oldRow A oldA g1 g2 dBound X V W pCode qCode prepared below1 below2 - usedD usedX dataD dataX request bound1 bound2 descent - have meetComm (x y : SetMembers geometry.carrier) : - geometry.meet.smallMeet x y = geometry.meet.smallMeet y x := by - apply le_antisymm - · exact geometry.meet.toSmallMeetOrder.le_meet - (geometry.meet.toSmallMeetOrder.meet_le_right _ _) (geometry.meet.toSmallMeetOrder.meet_le_left _ _) - · exact geometry.meet.toSmallMeetOrder.le_meet - (geometry.meet.toSmallMeetOrder.meet_le_right _ _) (geometry.meet.toSmallMeetOrder.meet_le_left _ _) - obtain ⟨h1, h2, rectangle, relative1, relative2, between, overlap1, overlap2, overlap12⟩ := - fulfilled.decoded_rectangle_action_data V W dBound X g1 g2 request bound1 bound2 - refine ⟨h1, h2, rectangle, ?_⟩ - exact M.binaryRowStructural_aligned_rectangle_union a s b columns pairing unions powers separation - collection infinite hL order hC hG graph nodeMaps supports directed choice small geometry.meet.smallMeet - meetComm geometry.meet.toSmallMeetOrder.meet_le_left geometry.meet.toSmallMeetOrder.meet_le_right - (fun _ _ _ left right => geometry.meet.toSmallMeetOrder.le_meet left right) hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh - stagesOrdinal trace p q r oldRow A oldA g1 g2 h1 h2 dBound X V W pCode qCode prepared below1 below2 - usedD usedX dataD dataX relative1 relative2 between overlap1 overlap2 overlap12 descent - - - - - - -theorem structural_rectangle_refinement - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - ∀ (p : SetMembers upperQ) (sourceRow : SetMembers c.carrier) (A : ZFSet.{u}) - (dBound V W : SetMembers geometry.carrier) (x y : Name upper), - SetMembers.raw p = ZFSet.pair (c.encode sourceRow) A → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw sourceRow) → i ≤ dBound) → - (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - V ≤ dBound → W ≤ dBound → - a.principalFix V ≤ upperAct.stabilizer upper x → - a.principalFix W ≤ upperAct.stabilizer upper y → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - ∀ (g1 g2 : SetMembers geometry.actors), - g1 ∈ a.principalFix (geometry.meet.smallMeet V W) → - g2 ∈ a.principalFix (geometry.meet.smallMeet V W) → - geometry.meet.smallMeet (a.iso g1 dBound) (a.iso g2 dBound) = geometry.meet.smallMeet V W → - ∀ r, r ≤ upperAct.iso g1 p → r ≤ upperAct.iso g2 p → - DenseBelow r (upperAct.RectangleWitness upper p x y g1 g2) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - intro p sourceRow A dBound V W x y pCode prepared usedD dataD vd wd sx sy descent - g1 g2 fixed1 fixed2 separated r ref1 ref2 q qr - obtain ⟨rawRow, rowMem, oldA, _, qCodeRaw⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape c.carrier lifted stages packed (SetMembers.raw_mem q)) - let oldRow := SetMembers.ofMem rawRow rowMem - have qCode : SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA := by - exact qCodeRaw.trans (congrArg (fun z => ZFSet.pair z oldA) - (SetMembers.raw_ofMem rawRow rowMem).symm) - obtain ⟨X, upper1, upper2, usedX, dataX⟩ := fulfilled.structural_bounds_with - collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - q oldRow oldA (a.iso g1 dBound) (a.iso g2 dBound) qCode - have request := geometry.decoded_rectangle_request V W dBound g1 g2 vd wd fixed1 fixed2 separated - obtain ⟨h1, h2, rectangle, _row, result, _rowCode, _resultCode, belowQ, below1, below2⟩ := - fulfilled.structural_rectangle_union collection infinite choice small columns hColumns - hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace p q sourceRow oldRow A oldA g1 g2 dBound X V W - pCode qCode prepared (le_trans qr ref1) (le_trans qr ref2) usedD usedX dataD dataX - request upper1 upper2 descent - have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) - (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action - (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : - ∀ i, i ≤ v → a.iso g i = a.iso h i := by - intro i lower - apply SetMembers.raw_injective - exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) - lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) - let geom := geometry.action_code.toOrderAction geometry.group_code geometry.meet - exact ⟨result, belowQ, h1, h2, below1, below2, - upperAct.act_eq_of_support_agreement geom upper sx (agree h1 g1 V rectangle.first_agreement), - upperAct.act_eq_of_support_agreement geom upper sx (agree h2 g2 V rectangle.second_agreement), - upperAct.act_eq_of_support_agreement geom upper sy (agree h1 h2 W rectangle.common_agreement)⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticAlignedRectangleUnions +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalRectangleActionData +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralPositionSupport +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowRectangles + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem structural_bounds_with + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (_hSquared : squared ∈ M.sets) + (_valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (_valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (_closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (_children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (_children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (_hs : stages ∈ M.sets) (_hh : history ∈ M.sets) + (_stagesOrdinal : ordinalSetProperty stages) + (_trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + ∀ (q : SetMembers upperQ) (row : SetMembers c.carrier) (A : ZFSet.{u}) + (U V : SetMembers geometry.carrier), + SetMembers.raw q = ZFSet.pair (c.encode row) A → + ∃ X : SetMembers geometry.carrier, U ≤ X ∧ V ≤ X ∧ + (∀ i : SetMembers geometry.carrier, + s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ X) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode X) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + intro q row A U V code + have countableBound : ∀ Z ∈ M.sets, Z ⊆ s.carrier → M.groundEmbeddable Z ZFSet.omega → + ∃ X : SetMembers geometry.carrier, ∀ z : SetMembers geometry.carrier, s.encode z ∈ Z → z ≤ X := + geometry.decoded_countable_bound + (fun Z hZ subset countable => (fulfilled.countable_localization Z hZ subset countable).2) + let extra : ZFSet.{u} := {s.encode U, s.encode V} + have groundU := M.transitive hL (s.encode_mem U) + have groundV := M.transitive hL (s.encode_mem V) + have extraGround : extra ∈ M.sets := M.unorderedPair_mem pairing groundU groundV + have extraSubset : extra ⊆ s.carrier := by + intro z member + rcases ZFSet.mem_pair.1 member with rfl | rfl + · exact s.encode_mem U + · exact s.encode_mem V + have emptyGround := M.empty_mem ⟨s.carrier, hL⟩ + have firstSmall := M.groundEmbeddable_insert pairing unions powers separation infinite emptyGround groundV + (M.empty_groundEmbeddable ZFSet.omega ⟨s.carrier, hL⟩) + have firstGround := M.insert_mem pairing unions groundV emptyGround + have extraSmall : M.groundEmbeddable extra ZFSet.omega := by + exact M.groundEmbeddable_insert pairing unions powers separation infinite + firstGround groundU firstSmall + obtain ⟨X, _f, _hf, _W, _hW, _function, _selected, _equal, _subset, _small, + _bounded, dataBound, rowBound, extraBound, _fixed⟩ := + M.binaryRowStructuralPositionSupport a s b columns pairing unions powers separation collection infinite + choice hL order hC hG graph nodeMaps supports directed countableBound hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace q row A code extra extraGround extraSubset extraSmall + exact ⟨X, extraBound U (ZFSet.mem_pair.2 (Or.inl rfl)), + extraBound V (ZFSet.mem_pair.2 (Or.inr rfl)), rowBound, dataBound⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (nodeMaps : a.conditionMapFamily s b ∈ M.sets) +variable (supports : supportBasisCode s b a.principalFix ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +include collection order nodeMaps supports + +theorem binaryRowStructural_aligned_rectangle_union + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (meet : L → L → L) + (meetComm : ∀ x y : L, meet x y = meet y x) + (meetLeft : ∀ x y : L, meet x y ≤ x) + (meetRight : ∀ x y : L, meet x y ≤ y) + (meetGreatest : ∀ x y z : L, z ≤ x → z ≤ y → z ≤ meet x y) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (muOrdinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b C pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) + (g1 g2 h1 h2 : G) (D X V W : L), + SetMembers.raw p = ZFSet.pair (c.encode r) A → + SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → + q ≤ upperAct.iso g1 p → q ≤ upperAct.iso g2 p → + (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw r) → i ≤ D) → + (∀ i : L, s.encode i ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ + stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + g1⁻¹ * h1 ∈ a.principalFix V → g2⁻¹ * h2 ∈ a.principalFix V → + h1⁻¹ * h2 ∈ a.principalFix W → + meet (a.iso h1 D) X = a.iso h1 V → + meet (a.iso h2 D) X = a.iso h2 V → + meet (a.iso h1 D) (a.iso h2 D) = a.iso h1 W → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : L) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (meet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + let movedA1 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h1) A + let movedA2 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h2) A + ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, + SetMembers.raw row = (SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h1 r)) ∪ + SetMembers.raw (act.iso h2 r) ∧ + SetMembers.raw result = ZFSet.pair (c.encode row) (movedA2 ∪ (movedA1 ∪ oldA)) ∧ + result ≤ q ∧ result ≤ upperAct.iso h1 p ∧ result ≤ upperAct.iso h2 p := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared tuples hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace coordinates two carrier forcingOrder + forcingAction omega topMem topRows packed I anchors upperQ + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + intro upperAct p q r oldRow A oldA g1 g2 h1 h2 D X V W pCode qCode prepared below1 below2 + usedD usedX dataD dataX relative1 relative2 between overlap1 overlap2 overlap12 descent movedA1 movedA2 + have source : ZFSet.pair (c.encode r) A ∈ upperQ := pCode ▸ SetMembers.raw_mem p + have oldSource : ZFSet.pair (c.encode oldRow) oldA ∈ upperQ := qCode ▸ SetMembers.raw_mem q + have reference1 := M.semanticStructuralOrder_action_coordinates c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hs hh stagesOrdinal trace g1 p q r oldRow A oldA pCode qCode below1 + have reference2 := M.semanticStructuralOrder_action_coordinates c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hs hh stagesOrdinal trace g2 p q r oldRow A oldA pCode qCode below2 + have agree (g h : G) (B : L) (relative : g⁻¹ * h ∈ a.principalFix B) + (i : L) (hi : i ≤ B) : a.iso h i = a.iso g i := by + have moved := congrArg (a.iso g) (relative i hi) + simpa only [a.mul, a.point_inv_right] using moved + obtain ⟨row, rowCode, rowBelowOld, rowBelowH1, rowBelowH2⟩ := + M.internalRowAction_rectangle_union a s b C pairing unions powers separation infinite hL hC hG graph + choice r oldRow D X V W g1 g2 h1 h2 + (fun i hi => usedD i.val hi) (fun i hi => usedX i.val hi) reference1.1 reference2.1 + (agree g1 h1 V relative1) (agree g2 h2 V relative2) + (fun i hi => (agree h1 h2 W between i hi).symm) + (fun i hi hx => overlap1 ▸ meetGreatest _ _ i hi hx) + (fun i hi hx => overlap2 ▸ meetGreatest _ _ i hi hx) + (fun i hi hj => overlap12 ▸ meetGreatest _ _ i hi hj) + have candidate := (M.mem_refinementHistoryForcing c.carrier lifted stages packed + (ZFSet.pair (c.encode r) A)).1 source |>.1 + have hA : A ∈ M.sets := ((M.mem_groundSmallSubsets _ _ A).1 (ZFSet.pair_mem_prod.1 candidate).2).1 + have transported1 := M.binaryRowStructuralAssignmentImage_dataBound a s b C pairing unions powers + separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh + stagesOrdinal trace h1 D A hA dataD + have transported2 := M.binaryRowStructuralAssignmentImage_dataBound a s b C pairing unions powers + separation collection infinite hL order hC hG graph nodeMaps supports directed hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh + stagesOrdinal trace h2 D A hA dataD + have unionFacts := M.semanticStructuralTrace_aligned_rectangle_union c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order + graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace infinite choice small meet I S mu s.nonbottom.carrier tuples + (fun f z entry => ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1) + (fun D f _ tau entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation + infinite hL hC hG graph hmu muOrdinal valid f tau D entry bound.2) + r oldRow row A oldA g1 g2 h1 h2 D X V W source oldSource (pCode ▸ prepared) + rowBelowOld reference1.1 reference2.1 rowBelowH1 rowBelowH2 reference1.2 reference2.2 + relative1 relative2 between overlap1 overlap2 overlap12 meetComm meetLeft meetRight meetGreatest + transported1.2.2 transported2.2.2 dataX descent + let result : SetMembers upperQ := SetMembers.ofMem _ unionFacts.1 + have resultCode : SetMembers.raw result = ZFSet.pair (c.encode row) (movedA2 ∪ (movedA1 ∪ oldA)) := + SetMembers.raw_ofMem _ _ + have movedCode (h : G) := M.semanticStructuralAction_coordinates c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order + graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace h p r A pCode + refine ⟨row, result, rowCode, resultCode, ?_, ?_, ?_⟩ + · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw q) ∈ _ + rw [resultCode, qCode] + exact unionFacts.2.1 + · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw (upperAct.iso h1 p)) ∈ _ + rw [resultCode, movedCode h1] + exact unionFacts.2.2.1 + · change ZFSet.pair (SetMembers.raw result) (SetMembers.raw (upperAct.iso h2 p)) ∈ _ + rw [resultCode, movedCode h2] + exact unionFacts.2.2.2 + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem structural_rectangle_union + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + ∀ (p q : SetMembers upperQ) (r oldRow : SetMembers c.carrier) (A oldA : ZFSet.{u}) + (g1 g2 : SetMembers geometry.actors) (dBound X V W : SetMembers geometry.carrier), + SetMembers.raw p = ZFSet.pair (c.encode r) A → + SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → + q ≤ upperAct.iso g1 p → q ≤ upperAct.iso g2 p → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw r) → i ≤ dBound) → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw oldRow) → i ≤ X) → + (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + (∀ z ∈ oldA, ZFSet.pair z (s.encode X) ∈ + stageOneDataBounds oldA I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + ExternalRectangleCode geometry.carrier geometry.actors geometry.order geometry.meetGraph geometry.action + (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw dBound) + (SetMembers.raw g1) (SetMembers.raw g2) → + a.iso g1 dBound ≤ X → a.iso g2 dBound ≤ X → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + ∃ h1 h2 : SetMembers geometry.actors, + RectangleAtBoundCode geometry.carrier geometry.order geometry.meetGraph geometry.action + (SetMembers.raw V) (SetMembers.raw W) (SetMembers.raw dBound) + (SetMembers.raw g1) (SetMembers.raw g2) (SetMembers.raw X) + (SetMembers.raw h1) (SetMembers.raw h2) ∧ + (let movedA1 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h1) A; + let movedA2 := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stages history (b.encode h2) A; + ∃ row : SetMembers c.carrier, ∃ result : SetMembers upperQ, + SetMembers.raw row = (SetMembers.raw oldRow ∪ SetMembers.raw (act.iso h1 r)) ∪ + SetMembers.raw (act.iso h2 r) ∧ + SetMembers.raw result = ZFSet.pair (c.encode row) (movedA2 ∪ (movedA1 ∪ oldA)) ∧ + result ≤ q ∧ result ≤ upperAct.iso h1 p ∧ result ≤ upperAct.iso h2 p) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + intro p q r oldRow A oldA g1 g2 dBound X V W pCode qCode prepared below1 below2 + usedD usedX dataD dataX request bound1 bound2 descent + have meetComm (x y : SetMembers geometry.carrier) : + geometry.meet.smallMeet x y = geometry.meet.smallMeet y x := by + apply le_antisymm + · exact geometry.meet.toSmallMeetOrder.le_meet + (geometry.meet.toSmallMeetOrder.meet_le_right _ _) (geometry.meet.toSmallMeetOrder.meet_le_left _ _) + · exact geometry.meet.toSmallMeetOrder.le_meet + (geometry.meet.toSmallMeetOrder.meet_le_right _ _) (geometry.meet.toSmallMeetOrder.meet_le_left _ _) + obtain ⟨h1, h2, rectangle, relative1, relative2, between, overlap1, overlap2, overlap12⟩ := + fulfilled.decoded_rectangle_action_data V W dBound X g1 g2 request bound1 bound2 + refine ⟨h1, h2, rectangle, ?_⟩ + exact M.binaryRowStructural_aligned_rectangle_union a s b columns pairing unions powers separation + collection infinite hL order hC hG graph nodeMaps supports directed choice small geometry.meet.smallMeet + meetComm geometry.meet.toSmallMeetOrder.meet_le_left geometry.meet.toSmallMeetOrder.meet_le_right + (fun _ _ _ left right => geometry.meet.toSmallMeetOrder.le_meet left right) hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 stages history hs hh + stagesOrdinal trace p q r oldRow A oldA g1 g2 h1 h2 dBound X V W pCode qCode prepared below1 below2 + usedD usedX dataD dataX relative1 relative2 between overlap1 overlap2 overlap12 descent + + + + + + +theorem structural_rectangle_refinement + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + ∀ (p : SetMembers upperQ) (sourceRow : SetMembers c.carrier) (A : ZFSet.{u}) + (dBound V W : SetMembers geometry.carrier) (x y : Name upper), + SetMembers.raw p = ZFSet.pair (c.encode sourceRow) A → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw sourceRow) → i ≤ dBound) → + (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + V ≤ dBound → W ≤ dBound → + a.principalFix V ≤ upperAct.stabilizer upper x → + a.principalFix W ≤ upperAct.stabilizer upper y → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + ∀ (g1 g2 : SetMembers geometry.actors), + g1 ∈ a.principalFix (geometry.meet.smallMeet V W) → + g2 ∈ a.principalFix (geometry.meet.smallMeet V W) → + geometry.meet.smallMeet (a.iso g1 dBound) (a.iso g2 dBound) = geometry.meet.smallMeet V W → + ∀ r, r ≤ upperAct.iso g1 p → r ≤ upperAct.iso g2 p → + DenseBelow r (upperAct.RectangleWitness upper p x y g1 g2) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + intro p sourceRow A dBound V W x y pCode prepared usedD dataD vd wd sx sy descent + g1 g2 fixed1 fixed2 separated r ref1 ref2 q qr + obtain ⟨rawRow, rowMem, oldA, _, qCodeRaw⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape c.carrier lifted stages packed (SetMembers.raw_mem q)) + let oldRow := SetMembers.ofMem rawRow rowMem + have qCode : SetMembers.raw q = ZFSet.pair (c.encode oldRow) oldA := by + exact qCodeRaw.trans (congrArg (fun z => ZFSet.pair z oldA) + (SetMembers.raw_ofMem rawRow rowMem).symm) + obtain ⟨X, upper1, upper2, usedX, dataX⟩ := fulfilled.structural_bounds_with + collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + q oldRow oldA (a.iso g1 dBound) (a.iso g2 dBound) qCode + have request := geometry.decoded_rectangle_request V W dBound g1 g2 vd wd fixed1 fixed2 separated + obtain ⟨h1, h2, rectangle, _row, result, _rowCode, _resultCode, belowQ, below1, below2⟩ := + fulfilled.structural_rectangle_union collection infinite choice small columns hColumns + hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace p q sourceRow oldRow A oldA g1 g2 dBound X V W + pCode qCode prepared (le_trans qr ref1) (le_trans qr ref2) usedD usedX dataD dataX + request upper1 upper2 descent + have agree (g h : SetMembers geometry.actors) (v : SetMembers geometry.carrier) + (rawAgree : ActionAgreementBelow geometry.carrier geometry.order geometry.action + (SetMembers.raw g) (SetMembers.raw h) (SetMembers.raw v)) : + ∀ i, i ≤ v → a.iso g i = a.iso h i := by + intro i lower + apply SetMembers.raw_injective + exact rawAgree.entry_eq geometry.action_code (SetMembers.raw_mem h) (SetMembers.raw_mem i) + lower (geometry.action_code.act_mem g i) (geometry.action_code.act_mem h i) + let geom := geometry.action_code.toOrderAction geometry.group_code geometry.meet + exact ⟨result, belowQ, h1, h2, below1, below2, + upperAct.act_eq_of_support_agreement geom upper sx (agree h1 g1 V rectangle.first_agreement), + upperAct.act_eq_of_support_agreement geom upper sx (agree h2 g2 V rectangle.second_agreement), + upperAct.act_eq_of_support_agreement geom upper sy (agree h1 h2 W rectangle.common_agreement)⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRefinementOutputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRefinementOutputs.lean index 9ebda8ba7a59004b3cafc8ddd1d549cdaee941e1..d02560df9e3777933bd527512e97694b9b03fec8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRefinementOutputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRefinementOutputs.lean @@ -1,928 +1,928 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralSymmetricRefinementOutputs -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralRefinementNames - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowSemanticStructuralRefinementIndexHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed - ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → - ∀ tau : (M.nameDomain upperPres).names, - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode Q finalOrder - (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ - let U := ZFSet.sUnion (relationImage J (M.groundPower Q) f) - (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ - ∃ beta ∈ K, - (∀ row B, ZFSet.pair row B ∈ U → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ - ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ - ∀ sigma A, ZFSet.pair sigma A ∈ f → - let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) - let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta - (graphRestriction beta packed) - A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, - ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ - (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} tau.val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} tau.val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ - (∀ count (degrees : Fin count → Nat) - (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - ∀ i, - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} (tau i).val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} (tau i).val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) - (a.principalSupportFamily ⊥ directed) (tau i).val) → - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ - (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ - ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ - refinementDataHistoryField K packed 0 ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - refinementDataHistoryIndices K packed ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralRefinementNameHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have indexed := M.semanticStructuralTrace_storedRefinementIndices c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory standard trace infinite choice rowSize liftedSize small rfl fulfilled.decoded_strict_growth - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.1, indexed, final.2.2.2.2.2.2.2.2.2⟩ - - - - - - -theorem exists_rowSemanticStructuralRefinementOutputHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - (∀ E ∈ M.sets, OrderAntichainCode Q - (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → - GroundBelow M E K) ∧ - (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed - ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → - ∀ tau : (M.nameDomain upperPres).names, - ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ - (∀ sigma A, ZFSet.pair sigma A ∈ f → - RelativeMaximalAntichainCode Q finalOrder - (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ - ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, - ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ - let U := ZFSet.sUnion (relationImage J (M.groundPower Q) f) - (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ - ∃ beta ∈ K, - (∀ row B, ZFSet.pair row B ∈ U → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ - ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ - ∀ sigma A, ZFSet.pair sigma A ∈ f → - let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) - let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta - (graphRestriction beta packed) - A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, - ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ - (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} tau.val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} tau.val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ - (∀ count (degrees : Fin count → Nat) - (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - ∀ i, - let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset - let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val - N.val ∈ M.sets ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → - NiceNameCode lowerAct lower J C N.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - Name.eval {p | (projection.projectedFilter H).mem p} N = - Name.eval {p | H.mem p} (tau i).val ∩ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ - (Name.eval {p | H.mem p} (tau i).val ⊆ - Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → - Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) - (a.principalSupportFamily ⊥ directed) (tau i).val) → - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ - (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ - ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ - refinementDataHistoryField K packed 0 ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - refinementDataHistoryIndices K packed ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers - (And.left (And.left standard)) carrier lifted valid1 - ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, - (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) - (a.principalSupportFamily ⊥ directed) (tau i).val) → - ∃ beta, ∃ hBeta : beta ∈ K, - let hAlpha := M.transitive hK hBeta - let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta - let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) - ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation Q - let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) - let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset - pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace - beta hAlpha cutOrdinal subset infinite choice - let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset - let degrees : Fin 3 → Nat := ![0, 1, 1] - let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) - let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset - let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset - ∃ env : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (env i.castSucc).val = - Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ - (env 3).val = Name.familySet ⊤ lifted validT ∧ - ∃ normalized : Assignment (M.nameDomain lower) 4, - (∀ i : Fin 3, (normalized i.castSucc).val = - Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ - normalized 3 = env 3 ∧ - Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ - (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → - (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, - NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ - HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) - (normalized i.castSucc).val) ∧ - ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ - (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ - ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ - refinementDataHistoryField K packed 0 ∧ - refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - refinementDataHistoryIndices K packed ∧ - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ - (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val - (normalized 2).val).val ∈ M.sets ∧ - ∃ outputGraphs : Fin 3 → ZFSet, - (∀ kind, outputGraphs kind ∈ M.sets) ∧ - ZFSet.pair beta (outputGraphs 2) ∈ refinementDataHistoryField K packed 12 ∧ - (∀ kind y, ZFSet.pair - (refinementIndexCode beta (s.encode C) (s.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val) y ∈ - outputGraphs kind ↔ - y = (Name.refinementOutput kind lifted validT - (normalized 0).val (normalized 1).val (normalized 2).val).val) ∧ - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (projection.projectedFilter H).GenericFor (M.codedFamily lower) → - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - (∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = - Name.eval {p | H.mem p} (tau i).val) ∧ - RefinementObjectValues {p | (projection.projectedFilter H).mem p} lifted validT - (normalized 0).val (normalized 1).val (normalized 2).val ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 2).val) ∧ - Name.eval {p | (projection.projectedFilter H).mem p} - (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val (normalized 2).val) = - refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val)) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralRefinementIndexHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - let directed := geometry.decoded_directed fulfilled.directed - have forcingOrderGround : c.conditionOrder ∈ M.sets := - M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates - (M.natSetCode_mem separation infinite 2) - have forcingActionGround : act.actionGraph c b ∈ M.sets := - M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b - pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have indexed := M.semanticStructuralTrace_storedRefinementOutputs c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground - nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared - (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hK hHistory standard trace infinite choice rowSize liftedSize small rfl fulfilled.decoded_strict_growth - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.2.1, indexed, final.2.2.2.2.2.2.2.2.2.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralSymmetricRefinementOutputs +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralRefinementNames + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowSemanticStructuralRefinementIndexHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed + ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → + ∀ tau : (M.nameDomain upperPres).names, + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode Q finalOrder + (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ + let U := ZFSet.sUnion (relationImage J (M.groundPower Q) f) + (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ + ∃ beta ∈ K, + (∀ row B, ZFSet.pair row B ∈ U → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ + ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ + ∀ sigma A, ZFSet.pair sigma A ∈ f → + let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) + let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta + (graphRestriction beta packed) + A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, + ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ + (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} tau.val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} tau.val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ + (∀ count (degrees : Fin count → Nat) + (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + ∀ i, + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} (tau i).val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} (tau i).val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) + (a.principalSupportFamily ⊥ directed) (tau i).val) → + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ + (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ + ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ + refinementDataHistoryField K packed 0 ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + refinementDataHistoryIndices K packed ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralRefinementNameHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have indexed := M.semanticStructuralTrace_storedRefinementIndices c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory standard trace infinite choice rowSize liftedSize small rfl fulfilled.decoded_strict_growth + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.1, indexed, final.2.2.2.2.2.2.2.2.2⟩ + + + + + + +theorem exists_rowSemanticStructuralRefinementOutputHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + (∀ E ∈ M.sets, OrderAntichainCode Q + (M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed) E → + GroundBelow M E K) ∧ + (let finalOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted K packed + ∀ J ∈ M.sets, GroundBelow M J K → (∀ sigma ∈ J, IsName upperPres sigma) → + ∀ tau : (M.nameDomain upperPres).names, + ∃ f ∈ M.sets, ZFSet.IsFunc J (M.groundPower Q) f ∧ + (∀ sigma A, ZFSet.pair sigma A ∈ f → + RelativeMaximalAntichainCode Q finalOrder + (M.ordinaryMembershipDecisions Q finalOrder sigma tau.val.val) A ∧ + ∀ q ∈ Q, ∃ p ∈ A, ∃ r ∈ Q, + ZFSet.pair r q ∈ finalOrder ∧ ZFSet.pair r p ∈ finalOrder) ∧ + let U := ZFSet.sUnion (relationImage J (M.groundPower Q) f) + (U ∈ M.sets ∧ GroundBelow M U K ∧ U ⊆ Q) ∧ + ∃ beta ∈ K, + (∀ row B, ZFSet.pair row B ∈ U → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta B = B ∧ + ZFSet.pair row B ∈ M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) ∧ + ∀ sigma A, ZFSet.pair sigma A ∈ f → + let lower := M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed) + let lowerOrder := M.refinementHistoryOrder c.carrier c.conditionOrder lifted beta + (graphRestriction beta packed) + A ⊆ lower ∧ ∀ q ∈ lower, ∃ p ∈ A, ∃ r ∈ lower, + ZFSet.pair r q ∈ lowerOrder ∧ ZFSet.pair r p ∈ lowerOrder) ∧ + (∀ n : Nat, ∀ tau : (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted n + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace n).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid tau.val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) tau.val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} tau.val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} tau.val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} tau.val)) ∧ + (∀ count (degrees : Fin count → Nat) + (tau : Fin count → (M.nameDomain (SetMembers.presentation Q)).names), + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + ∀ i, + let J := iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := (M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace (degrees i)).2 beta cutOrdinal subset + let N := Name.crossStageMembershipName (SetMembers.presentation Q) lower inc J valid (tau i).val + N.val ∈ M.sets ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + C ≤ (upperAction).stabilizer (SetMembers.presentation Q) (tau i).val → + NiceNameCode lowerAct lower J C N.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) N) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain (SetMembers.presentation Q))) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + Name.eval {p | (projection.projectedFilter H).mem p} N = + Name.eval {p | H.mem p} (tau i).val ∩ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) ∧ + (Name.eval {p | H.mem p} (tau i).val ⊆ + Name.eval {p | (projection.projectedFilter H).mem p} (Name.familySet ⊤ J valid) → + Name.eval {p | (projection.projectedFilter H).mem p} N = Name.eval {p | H.mem p} (tau i).val)) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) + (a.principalSupportFamily ⊥ directed) (tau i).val) → + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ + (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ + ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ + refinementDataHistoryField K packed 0 ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + refinementDataHistoryIndices K packed ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + (letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + (run).carriers (And.left (And.left standard)) carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c (run).carriers + (And.left (And.left standard)) carrier lifted valid1 + ∀ tau : Fin 3 → (M.nameDomain (SetMembers.presentation Q)).names, + (∀ i, HereditarilySymmetric upperAction (SetMembers.presentation Q) + (a.principalSupportFamily ⊥ directed) (tau i).val) → + ∃ beta, ∃ hBeta : beta ∈ K, + let hAlpha := M.transitive hK hBeta + let cutOrdinal := ordinalSetProperty_member (And.left (And.left standard)) hBeta + let subset : beta ⊆ K := (And.left (And.left standard)).1 beta hBeta + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta (graphRestriction beta packed) + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta (graphRestriction beta packed) + ((run).carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation Q + let lower := SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted beta (graphRestriction beta packed)) + let inc := RecursiveRefinementOrderHistory.inclusionFunction run (And.left (And.left standard)) cutOrdinal subset + pairing unions powers separation infinite choice hK hPacked hLifted hAlpha carrier (c.encode ⊤) topMem topRows mono + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory (And.left (And.left standard)) trace + beta hAlpha cutOrdinal subset infinite choice + let lowerAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hHistory trace hAlpha cutOrdinal subset + let degrees : Fin 3 → Nat := ![0, 1, 1] + let J := fun i => iteratedPairNameFamily (ZFSet.pair (c.encode ⊤) ∅) lifted (degrees i) + let valid := fun i => ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) (degrees i)).2 beta cutOrdinal subset + let validT := ((M.structuralTrace_finitePowerTerms c c.conditionOrder (c.encode ⊤) (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation carrier hLifted valid1 topMem (And.left (And.left standard)) trace) 0).2 beta cutOrdinal subset + ∃ env : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (env i.castSucc).val = + Name.crossStageMembershipName upper lower inc (J i) (valid i) (tau i).val) ∧ + (env 3).val = Name.familySet ⊤ lifted validT ∧ + ∃ normalized : Assignment (M.nameDomain lower) 4, + (∀ i : Fin 3, (normalized i.castSucc).val = + Name.refinementConditionNames (M.nameDomain lower) env J valid i) ∧ + normalized 3 = env 3 ∧ + Forces (M.nameDomain lower) BoundedFormula.refinementValidityFormula.toFormula normalized ⊤ ∧ + (∀ C : Subgroup (SetMembers geometry.actors), (a.principalSupportFamily ⊥ directed).mem C → + (∀ i, C ≤ (upperAction).stabilizer upper (tau i).val) → ∀ i : Fin 3, + NiceNameCode lowerAct lower (J i) C (normalized i.castSucc).val.val ∧ + HereditarilySymmetric lowerAct lower (a.principalSupportFamily ⊥ directed) + (normalized i.castSucc).val) ∧ + ∃ C E : SetMembers geometry.carrier, ⊥ ≤ C ∧ C < E ∧ + (∀ i, a.principalFix C ≤ (upperAction).stabilizer upper (tau i).val) ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + M.niceRefinementIndices lowerAct lower s a beta lifted squared validT ∧ + ZFSet.pair beta (M.niceRefinementIndices lowerAct lower s a beta lifted squared validT) ∈ + refinementDataHistoryField K packed 0 ∧ + refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + refinementDataHistoryIndices K packed ∧ + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ + (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val + (normalized 2).val).val ∈ M.sets ∧ + ∃ outputGraphs : Fin 3 → ZFSet, + (∀ kind, outputGraphs kind ∈ M.sets) ∧ + ZFSet.pair beta (outputGraphs 2) ∈ refinementDataHistoryField K packed 12 ∧ + (∀ kind y, ZFSet.pair + (refinementIndexCode beta (s.encode C) (s.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val) y ∈ + outputGraphs kind ↔ + y = (Name.refinementOutput kind lifted validT + (normalized 0).val (normalized 1).val (normalized 2).val).val) ∧ + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (projection.projectedFilter H).GenericFor (M.codedFamily lower) → + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower)) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + (∀ i : Fin 3, Name.eval {p | (projection.projectedFilter H).mem p} (normalized i.castSucc).val = + Name.eval {p | H.mem p} (tau i).val) ∧ + RefinementObjectValues {p | (projection.projectedFilter H).mem p} lifted validT + (normalized 0).val (normalized 1).val (normalized 2).val ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 1).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementQuotient lifted validT (normalized 0).val (normalized 2).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 2).val) ∧ + Name.eval {p | (projection.projectedFilter H).mem p} + (Name.refinementNaturalMap lifted validT (normalized 0).val (normalized 1).val (normalized 2).val) = + refinementQuotientMap (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) (Name.eval {p | H.mem p} (tau 2).val)) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralRefinementIndexHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + let directed := geometry.decoded_directed fulfilled.directed + have forcingOrderGround : c.conditionOrder ∈ M.sets := + M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates + (M.natSetCode_mem separation infinite 2) + have forcingActionGround : act.actionGraph c b ∈ M.sets := + M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b + pairing unions powers separation collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have indexed := M.semanticStructuralTrace_storedRefinementOutputs c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground + nodeOrderGround nodeActionGround nodeMapsGround supports hLifted hSquared + (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hK hHistory standard trace infinite choice rowSize liftedSize small rfl fulfilled.decoded_strict_growth + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + final.2.2.1, final.2.2.2.1, final.2.2.2.2.1, final.2.2.2.2.2.1, final.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.1, final.2.2.2.2.2.2.2.2.2.1, indexed, final.2.2.2.2.2.2.2.2.2.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRowNoChooser.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRowNoChooser.lean index a30b6879fa9251c4a812c6598f0154f703885220..9c17ad188563ff1b11b2bc24770077a43c56601b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRowNoChooser.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralRowNoChooser.lean @@ -1,250 +1,250 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticOrdinalRowOrbitCovers -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralSupportPreparation - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_lifted_rows_no_chooser - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable columns ZFSet.omega) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier - ∀ (H : ConditionFilter (SetMembers upperQ)), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - let N := M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H - let rowSet := Name.eval {p | H.mem p} - (Name.rename upper inclusion (M.internalRowSetName s columns hL)) - rowSet ∈ N.sets ∧ - ¬ ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ rowSet → S.Nonempty → - ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier - intro H ordinary - have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers - separation carrier hLifted hs hPacked omega - have hAssignments := (M.definable_structuralAssignments pairing unions powers separation collection).closed - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hAssignmentAction := M.structuralAssignmentActionGraph_mem pairing unions powers separation - collection hG hL order graph supports hLifted hSquared hs hh - have hGraph : upperAct.actionGraph upper b ∈ M.sets := by - erw [M.semanticStructuralAction_graph] - exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection hG hQ - carrier (M.union_mem unions (M.union_mem unions hQ)) hAssignments forcingAction hAssignmentAction - have maps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b pairing unions powers separation - collection hQ hG hGraph - have projectionData := M.semanticStructuralTrace_rowProjection c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder - forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega - valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace - infinite choice - have rowSetGround := M.liftedInternalRowSet_mem a s b columns directed pairing unions powers - separation collection infinite hL hC hG graph upper upperAct hQ inclusion - projectionData.2.2.1 projectionData.2.2.2.2.2.2 H - refine ⟨rowSetGround, ?_⟩ - rintro ⟨f, hf, selection⟩ - obtain ⟨B, i, sn, xn, fn, outside, snCode, xnCode, fixedS, fixedF, p0, _hp0, forced0⟩ := - M.liftedInternalRows_chooser_witness a s b columns directed pairing unions powers separation - collection infinite hL hC hG graph upper upperAct hQ order - (geometry.decoded_unbounded fulfilled.growth) - (M.refinementHistoryRowRestriction c lifted stages packed) inclusion projectionData.1 - projectionData.2.2.1 projectionData.2.2.2.2.2.2 H ordinary f hf selection - obtain ⟨rawP, memberP, belowRaw, support, _hSupport, _subsetSupport, _smallSupport, prepared⟩ := - fulfilled.structural_support_prepared_strengthening collection infinite choice small smallD - irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace (SetMembers.raw p0) (SetMembers.raw_mem p0) - let p : SetMembers upperQ := SetMembers.ofMem rawP memberP - have pRaw : SetMembers.raw p = rawP := SetMembers.raw_ofMem _ _ - have below : p ≤ p0 := by - change ZFSet.pair (SetMembers.raw p) (SetMembers.raw p0) ∈ _ - rw [pRaw] - exact belowRaw - have forced := forces_mono (M.nameDomain upper) (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula - (extend sn (extend xn (extend fn Fin.elim0))) forced0 below - have preparedP : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier - (SetMembers.raw p) := by - rw [pRaw] - exact prepared.forget - let sourceRow := M.refinementHistoryRowFunction c lifted stages packed p - obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c lifted stages packed p - obtain ⟨dBound, bd, id, usedD, dataD⟩ := fulfilled.toFinalFulfillment.structural_bounds_with - collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - p sourceRow A B i.val pCode - have descent := fulfilled.structural_prefix_descent collection infinite choice small smallD - irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace - obtain ⟨g, fixed, overlap, _overlap1, _overlap2, row, result, _rowCode, _resultCode, toP, toMoved⟩ := - fulfilled.toFinalFulfillment.structural_separating_copy_union collection infinite choice small - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace - p p sourceRow sourceRow A A 1 1 dBound dBound B pCode pCode preparedP - (by change p ≤ upperAct.iso 1 p; rw [upperAct.one]) usedD usedD dataD dataD bd - (a.principalFix B).one_mem (a.principalFix B).one_mem - (by change a.iso 1 dBound ≤ dBound; rw [a.one]) (by change a.iso 1 dBound ≤ dBound; rw [a.one]) descent - have distinctNode : a.iso g i.val ≠ i.val := a.moved_ne_of_separated g B dBound i.val - (fun x xd xg => by - rw [← overlap] - exact geometry.meet.toSmallMeetOrder.le_meet xg xd) id outside - have movedCode : upperAct.act upper g xn.val = - Name.rename upper inclusion (M.internalRowName s columns hL (a.nonbottom.iso g i)) := by - rw [xnCode, act.act_rename_of_equivariant upperAct c upper inclusion - projectionData.2.2.2.2.2.2, - M.internalRowName_action a s b columns pairing unions powers separation infinite hL hC hG graph] - exact M.projectedBinaryRows_uniqueFiber_incompatible upper b upperAct - (a.principalSupportFamily ⊥ directed) pairing unions powers separation collection infinite choice - small (M.nonbottom_carrier_mem s separation hL) hC uncountable hQ maps - (M.refinementHistoryRowRestriction c lifted stages packed) inclusion projectionData.1 - projectionData.2.1 ⊤ (fun _ => le_top) sn xn fn g (fixedS fixed) (fixedF fixed) - (s.encode i.val) (s.nonbottom.encode_mem i) - (s.encode (a.iso g i.val)) (s.nonbottom.encode_mem (a.nonbottom.iso g i)) - (fun equal => distinctNode (s.injective equal).symm) xnCode movedCode p forced - ⟨result, toP, toMoved⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticOrdinalRowOrbitCovers +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralSupportPreparation + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_lifted_rows_no_chooser + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable columns ZFSet.omega) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier + ∀ (H : ConditionFilter (SetMembers upperQ)), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + let N := M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H + let rowSet := Name.eval {p | H.mem p} + (Name.rename upper inclusion (M.internalRowSetName s columns hL)) + rowSet ∈ N.sets ∧ + ¬ ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ rowSet → S.Nonempty → + ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier + intro H ordinary + have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers + separation carrier hLifted hs hPacked omega + have hAssignments := (M.definable_structuralAssignments pairing unions powers separation collection).closed + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hAssignmentAction := M.structuralAssignmentActionGraph_mem pairing unions powers separation + collection hG hL order graph supports hLifted hSquared hs hh + have hGraph : upperAct.actionGraph upper b ∈ M.sets := by + erw [M.semanticStructuralAction_graph] + exact M.rawRowAssignmentActionGraph_mem pairing unions powers separation collection hG hQ + carrier (M.union_mem unions (M.union_mem unions hQ)) hAssignments forcingAction hAssignmentAction + have maps := M.conditionMapFamily_mem_of_actionGraph upperAct upper b pairing unions powers separation + collection hQ hG hGraph + have projectionData := M.semanticStructuralTrace_rowProjection c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder + forcingAction hG hL order graph nodeMaps supports hLifted hSquared omega + valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh stagesOrdinal trace + infinite choice + have rowSetGround := M.liftedInternalRowSet_mem a s b columns directed pairing unions powers + separation collection infinite hL hC hG graph upper upperAct hQ inclusion + projectionData.2.2.1 projectionData.2.2.2.2.2.2 H + refine ⟨rowSetGround, ?_⟩ + rintro ⟨f, hf, selection⟩ + obtain ⟨B, i, sn, xn, fn, outside, snCode, xnCode, fixedS, fixedF, p0, _hp0, forced0⟩ := + M.liftedInternalRows_chooser_witness a s b columns directed pairing unions powers separation + collection infinite hL hC hG graph upper upperAct hQ order + (geometry.decoded_unbounded fulfilled.growth) + (M.refinementHistoryRowRestriction c lifted stages packed) inclusion projectionData.1 + projectionData.2.2.1 projectionData.2.2.2.2.2.2 H ordinary f hf selection + obtain ⟨rawP, memberP, belowRaw, support, _hSupport, _subsetSupport, _smallSupport, prepared⟩ := + fulfilled.structural_support_prepared_strengthening collection infinite choice small smallD + irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace (SetMembers.raw p0) (SetMembers.raw_mem p0) + let p : SetMembers upperQ := SetMembers.ofMem rawP memberP + have pRaw : SetMembers.raw p = rawP := SetMembers.raw_ofMem _ _ + have below : p ≤ p0 := by + change ZFSet.pair (SetMembers.raw p) (SetMembers.raw p0) ∈ _ + rw [pRaw] + exact belowRaw + have forced := forces_mono (M.nameDomain upper) (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula + (extend sn (extend xn (extend fn Fin.elim0))) forced0 below + have preparedP : StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier + (SetMembers.raw p) := by + rw [pRaw] + exact prepared.forget + let sourceRow := M.refinementHistoryRowFunction c lifted stages packed p + obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c lifted stages packed p + obtain ⟨dBound, bd, id, usedD, dataD⟩ := fulfilled.toFinalFulfillment.structural_bounds_with + collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + p sourceRow A B i.val pCode + have descent := fulfilled.structural_prefix_descent collection infinite choice small smallD + irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace + obtain ⟨g, fixed, overlap, _overlap1, _overlap2, row, result, _rowCode, _resultCode, toP, toMoved⟩ := + fulfilled.toFinalFulfillment.structural_separating_copy_union collection infinite choice small + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace + p p sourceRow sourceRow A A 1 1 dBound dBound B pCode pCode preparedP + (by change p ≤ upperAct.iso 1 p; rw [upperAct.one]) usedD usedD dataD dataD bd + (a.principalFix B).one_mem (a.principalFix B).one_mem + (by change a.iso 1 dBound ≤ dBound; rw [a.one]) (by change a.iso 1 dBound ≤ dBound; rw [a.one]) descent + have distinctNode : a.iso g i.val ≠ i.val := a.moved_ne_of_separated g B dBound i.val + (fun x xd xg => by + rw [← overlap] + exact geometry.meet.toSmallMeetOrder.le_meet xg xd) id outside + have movedCode : upperAct.act upper g xn.val = + Name.rename upper inclusion (M.internalRowName s columns hL (a.nonbottom.iso g i)) := by + rw [xnCode, act.act_rename_of_equivariant upperAct c upper inclusion + projectionData.2.2.2.2.2.2, + M.internalRowName_action a s b columns pairing unions powers separation infinite hL hC hG graph] + exact M.projectedBinaryRows_uniqueFiber_incompatible upper b upperAct + (a.principalSupportFamily ⊥ directed) pairing unions powers separation collection infinite choice + small (M.nonbottom_carrier_mem s separation hL) hC uncountable hQ maps + (M.refinementHistoryRowRestriction c lifted stages packed) inclusion projectionData.1 + projectionData.2.1 ⊤ (fun _ => le_top) sn xn fn g (fixedS fixed) (fixedF fixed) + (s.encode i.val) (s.nonbottom.encode_mem i) + (s.encode (a.iso g i.val)) (s.nonbottom.encode_mem (a.nonbottom.iso g i)) + (fun equal => distinctNode (s.injective equal).symm) xnCode movedCode p forced + ⟨result, toP, toMoved⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralSeparationRefinements.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralSeparationRefinements.lean index 81000e91bfd8b8ed1f1435e497cce614e7ae5fa9..5ac0210b10d14594ddc5e5c9d1f0f339f6e7de6a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralSeparationRefinements.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainFinalStructuralSeparationRefinements.lean @@ -1,199 +1,199 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralRectangleRefinements - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -open scoped ZFSet -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem structural_separation_refinement - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - ∀ (p : SetMembers upperQ) (sourceRow : SetMembers c.carrier) (A : ZFSet.{u}) - (W dBound : SetMembers geometry.carrier), - SetMembers.raw p = ZFSet.pair (c.encode sourceRow) A → - StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw sourceRow) → i ≤ dBound) → - (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → - W ≤ dBound → - (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → - ∀ (g1 g2 : SetMembers geometry.actors), - g1 ∈ a.principalFix W → g2 ∈ a.principalFix W → - ∀ r, r ≤ upperAct.iso g1 p → - DenseBelow r (upperAct.SeparationWitness (a.principalFix W) - (fun g h => geometry.meet.smallMeet (a.iso g dBound) (a.iso h dBound) = W) p g1 g2) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let I := refinementDataHistoryIndices stages packed - let anchors := refinementIndexFieldGraph I s.carrier 2 - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - intro p sourceRow A W dBound pCode prepared usedD dataD wd descent - g1 g2 fixed1 fixed2 r ref1 q qr - obtain ⟨oldRow, oldA, _, qCode⟩ := exists_presentedRowAssignmentCoordinates c - (M.refinementHistoryForcing_shape c.carrier lifted stages packed) (SetMembers.raw_mem q) - obtain ⟨X, bound1, bound2, usedX, dataX⟩ := fulfilled.structural_bounds_with - collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - q oldRow oldA (a.iso g1 dBound) (a.iso g2 dBound) qCode - obtain ⟨h, fixed, _, apart1, apart2, _, result, _, _, toOld, toCopy⟩ := - fulfilled.structural_separating_copy_union collection infinite choice small columns hColumns - hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace p q sourceRow oldRow A oldA g1 g2 dBound X W - pCode qCode prepared (le_trans qr ref1) usedD usedX dataD dataX wd fixed1 fixed2 - bound1 bound2 descent - exact ⟨result, toOld, h, fixed, toCopy, apart1, apart2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralRectangleRefinements + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +open scoped ZFSet +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem structural_separation_refinement + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + ∀ (p : SetMembers upperQ) (sourceRow : SetMembers c.carrier) (A : ZFSet.{u}) + (W dBound : SetMembers geometry.carrier), + SetMembers.raw p = ZFSet.pair (c.encode sourceRow) A → + StoredPreparedConditionCode M c.carrier lifted stages packed s.carrier (SetMembers.raw p) → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw sourceRow) → i ≤ dBound) → + (∀ z ∈ A, ZFSet.pair z (s.encode dBound) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) → + W ≤ dBound → + (∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) → + ∀ (g1 g2 : SetMembers geometry.actors), + g1 ∈ a.principalFix W → g2 ∈ a.principalFix W → + ∀ r, r ≤ upperAct.iso g1 p → + DenseBelow r (upperAct.SeparationWitness (a.principalFix W) + (fun g h => geometry.meet.smallMeet (a.iso g dBound) (a.iso h dBound) = W) p g1 g2) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let I := refinementDataHistoryIndices stages packed + let anchors := refinementIndexFieldGraph I s.carrier 2 + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + intro p sourceRow A W dBound pCode prepared usedD dataD wd descent + g1 g2 fixed1 fixed2 r ref1 q qr + obtain ⟨oldRow, oldA, _, qCode⟩ := exists_presentedRowAssignmentCoordinates c + (M.refinementHistoryForcing_shape c.carrier lifted stages packed) (SetMembers.raw_mem q) + obtain ⟨X, bound1, bound2, usedX, dataX⟩ := fulfilled.structural_bounds_with + collection infinite choice columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + q oldRow oldA (a.iso g1 dBound) (a.iso g2 dBound) qCode + obtain ⟨h, fixed, _, apart1, apart2, _, result, _, _, toOld, toCopy⟩ := + fulfilled.structural_separating_copy_union collection infinite choice small columns hColumns + hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace p q sourceRow oldRow A oldA g1 g2 dBound X W + pCode qCode prepared (le_trans qr ref1) usedD usedX dataD dataX wd fixed1 fixed2 + bound1 bound2 descent + exact ⟨result, toOld, h, fixed, toCopy, apart1, apart2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTaskCapFulfillment.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTaskCapFulfillment.lean index 55229d96f33cc7ed3c587fad7236278418ed145b..20a449ee30d65998d9575af35179e34dd1b840a3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTaskCapFulfillment.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTaskCapFulfillment.lean @@ -1,458 +1,458 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaskCapFamilyCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIdentityInsertionTasks -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorProfilePreservation - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -noncomputable def boundedCapImages (P r μ A : ZFSet.{u}) : ZFSet.{u} := - relationCompose I (completion.algebra.union.fields 0) (completion.externalBoundedCarrier P r μ A) - (completion.algebra.caps τ) (completion.externalCopyGraph P r μ A - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) - -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) -include data group action pairing unions powers separation infinite hG hP -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalBoundedCarrier P r μ A -local notation "copyGraph" => completion.externalCopyGraph P r μ A - (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) - -theorem boundedCapImages_ground (hI : I ∈ M.sets) : - completion.boundedCapImages P r μ A ∈ M.sets := by - have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP - exact M.relationCompose_mem pairing unions powers separation hI (completion.algebra.union.ground 0) - geometry.carrier_ground completion.caps_ground - (geometry.copies_ground _ data.group.group_code.identity_mem) - -theorem boundedCapImages_function : - ZFSet.IsFunc I Q (completion.boundedCapImages P r μ A) := by - have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP - exact relationCompose_function_of_subset completion.caps_function - (geometry.copies _ data.group.group_code.identity_mem).injection.function (fun _ h => h) - -theorem boundedCapImages_entry_iff {i k' : ZFSet.{u}} : - ZFSet.pair i k' ∈ completion.boundedCapImages P r μ A ↔ - ∃ k, ZFSet.pair i k ∈ completion.algebra.caps τ ∧ ZFSet.pair k k' ∈ copyGraph := by - have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP - rw [GroundCompressionCompletion.boundedCapImages, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, k, _, cap, image⟩ - exact ⟨k, cap, image⟩ - · rintro ⟨k, cap, image⟩ - have bounds := ZFSet.pair_mem_prod.1 (completion.caps_function.1 cap) - have target := ZFSet.pair_mem_prod.1 - ((geometry.copies _ data.group.group_code.identity_mem).injection.function.1 image) - exact ⟨bounds.1, target.2, k, bounds.2, cap, image⟩ - -end GroundExternalGeometryInputs -end - -namespace GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P m one r A) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P r μ A -local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) -local notation "generators" => M.externalChildGenerators G letters m one -local notation "oldActors" => M.externalOldInclusion G letters m one -local notation "copyGraph" => completion.externalCopyGraph P r μ A (M.externalGroupIdentity G letters m one) -local notation "e" => completion.externalOriginalEmbedding P r μ A -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy - (completion.externalFamily group oldAction data.original) - (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 -local notation "newAction" => completion.externalPointAction P r μ A -local notation "newOrder" => completion.externalPointOrder P r μ A -include data group oldAction pairing unions powers separation infinite hG hP - -theorem bounded_compression_generator_agreement (i : SetMembers I) {a g k g' a' : ZFSet.{u}} - (source : ZFSet.pair (SetMembers.raw i) a ∈ Sources) - (representative : ZFSet.pair (SetMembers.raw i) g ∈ Reps) - (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators) - (actor : ZFSet.pair g g' ∈ oldActors) (image : ZFSet.pair a a' ∈ e) : - ActionAgreementBelow (completion.externalBoundedCarrier P r μ A) - (completion.externalBoundedOrder P r μ A) (completion.externalBoundedAction P r μ A) k g' a' := by - let := group.toGroup - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have imageA := ((completion.externalOriginalEmbedding_entry_iff P r μ A a a').1 image).1 - have ha' := (ZFSet.pair_mem_prod.1 (ideal.injection.function.1 imageA)).2 - have hg := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 actor)).1 - have agree : ActionAgreementBelow Q newOrder newAction k g' a' := by - intro x' hx' z _ lower - obtain ⟨x, hx, below, imageX⟩ := ideal.ideal _ _ _ imageA hx' lower - obtain ⟨y, acted, _⟩ := completion.algebra.union.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) - have hy := (ZFSet.pair_mem_prod.1 (completion.algebra.union.action.function.1 acted)).2 - let xu := SetMembers.ofMem x hx - let yu := SetMembers.ofMem y hy - have eqX := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG xu x').1 - (by simpa only [xu, SetMembers.raw_ofMem] using imageX) - have imageY := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG yu - ((q).encode ((root).toFun yu))).2 rfl - have first := data.compression_generator_agreement group oldAction pairing unions powers separation infinite hG - i source representative xu yu - (by simpa only [xu, SetMembers.raw_ofMem] using below) - (by simpa only [xu, yu, SetMembers.raw_ofMem] using acted) k generator - rw [← eqX] at first - have second := data.externalIdentityCopy_equivariant group oldAction pairing unions powers separation infinite hG - actor imageX imageY (by simpa only [yu, SetMembers.raw_ofMem] using acted) - have function : FunctionGraphOn (ZFSet.prod (M.externalGroupCarrier G letters m one) Q) newAction := - ⟨Q, geometry.action.function⟩ - exact ⟨fun entry => (function.unique entry first).symm ▸ second, - fun entry => (function.unique entry second).symm ▸ first⟩ - exact agree.fixedTop geometry.meet.order geometry.action ha' - -theorem bounded_compression_generator_top_iff (i : SetMembers I) {k τ' v : ZFSet.{u}} - (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators) - (imageTop : ZFSet.pair τ τ' ∈ e) : - ZFSet.pair (ZFSet.pair k τ') v ∈ completion.externalBoundedAction P r μ A ↔ - ZFSet.pair (SetMembers.raw i) v ∈ completion.boundedCapImages P r μ A := by - let := group.toGroup - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have copiedTop := ((completion.externalOriginalEmbedding_entry_iff P r μ A τ τ').1 imageTop).1 - have hτ' := (ZFSet.pair_mem_prod.1 (ideal.injection.function.1 copiedTop)).2 - have eqTop := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG - (SetMembers.ofMem τ completion.top_mem) τ').1 - (by simpa only [SetMembers.raw_ofMem] using copiedTop) - have canonical := data.compression_generator_top group oldAction pairing unions powers separation infinite hG i k generator - rw [← eqTop] at canonical - have imageCap := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG - (completion.externalCap i) _).2 rfl - have cap := (data.boundedCapImages_entry_iff group oldAction pairing unions powers separation infinite hG hP).2 - ⟨_, completion.externalCap_entry i, imageCap⟩ - have actionFunction : FunctionGraphOn (ZFSet.prod (M.externalGroupCarrier G letters m one) Q) newAction := - ⟨Q, geometry.action.function⟩ - have capFunction : FunctionGraphOn I (completion.boundedCapImages P r μ A) := - ⟨_, data.boundedCapImages_function group oldAction pairing unions powers separation infinite hG hP⟩ - change ZFSet.pair (ZFSet.pair k τ') v ∈ fixedTopAction (M.externalGroupCarrier G letters m one) Q newAction ↔ _ - rw [fixedTopAction_old_iff hτ'] - exact ⟨fun entry => (actionFunction.unique entry canonical).symm ▸ cap, - fun entry => (capFunction.unique entry cap).symm ▸ canonical⟩ - -end GroundExternalGeometryInputs - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -noncomputable def compressionCapImages : ZFSet.{u} := - certificate.compression.born.profiled.heighted.completion.boundedCapImages - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -include pairing unions powers separation infinite - -theorem compressionCapImages_ground : certificate.compressionCapImages ∈ M.sets := - certificate.external.inputs.boundedCapImages_ground source.stage.group_code source.stage.action_code - pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground - certificate.indices_ground - -theorem compressionCapImages_function : - ZFSet.IsFunc (source.stage.compressionTasks Labels) certificate.target.stage.carrier - certificate.compressionCapImages := by - rw [certificate.target_fields.1] - exact certificate.external.inputs.boundedCapImages_function source.stage.group_code source.stage.action_code - pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground - -theorem compressionCapImages_profile {i c v F K' c' v' : ZFSet.{u}} - (cap : ZFSet.pair i K' ∈ certificate.compressionCapImages) - (target : ZFSet.pair i c ∈ source.stage.compressionTargets Labels) - (separator : ZFSet.pair i v ∈ source.stage.compressionSeparators Labels) - (filter : ZFSet.pair i F ∈ source.stage.compressionFilters Labels) - (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) - (imageV : ZFSet.pair v v' ∈ certificate.transition.map.points) : - CodedCapProfile certificate.target.stage.carrier certificate.target.stage.order - certificate.target.stage.meetGraph c' v' K' - (relationImage F certificate.target.stage.carrier certificate.transition.map.points) := by - let completion := certificate.compression.born.profiled.heighted.completion - have geometry := certificate.external.inputs.externalBoundedGeometryData - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground - obtain ⟨K, oldCap, capCopy⟩ := (certificate.external.inputs.boundedCapImages_entry_iff - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground).1 cap - have profile := certificate.compression.born.profiled.profiles i c v K F oldCap target separator filter - have filterBound := (ZFSet.mem_sep.1 (show ZFSet.pair i F ∈ literalTaskFieldGraph - (source.stage.compressionTasks Labels) source.stage.carrier - (M.groundRelations source.stage.carrier source.stage.carrier) - (M.groundMeetFilters source.stage.carrier source.stage.order source.stage.meetGraph) Labels 4 from filter)).1 - have hF : F ∈ M.groundMeetFilters source.stage.carrier source.stage.order source.stage.meetGraph := - (ZFSet.pair_mem_prod.1 filterBound).2 - have subset := ((M.mem_groundMeetFilters _ _ _ F).1 hF).2.subset - obtain ⟨carrierEq, orderEq, meetEq, _⟩ := certificate.target_fields - rw [carrierEq, orderEq, meetEq, certificate.point_graph] - rw [certificate.point_graph] at imageC imageV - rw [completion.externalOriginal_filterImage_eq source.stage.carrier source.stage.order - source.stage.meetGraph source.stage.action _ subset] - exact (geometry.copies _ certificate.external.inputs.group.group_code.identity_mem).capProfile - completion.algebra.union.meet geometry.meet completion.top_mem completion.top profile - ((completion.externalOriginalEmbedding_entry_iff _ _ _ _ c c').1 imageC).1 - ((completion.externalOriginalEmbedding_entry_iff _ _ _ _ v v').1 imageV).1 capCopy - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -theorem compressionCapImages_common_target_meet - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) - {i j c K' L' c' : ZFSet.{u}} - (capI : ZFSet.pair i K' ∈ certificate.compressionCapImages) - (capJ : ZFSet.pair j L' ∈ certificate.compressionCapImages) - (targetI : ZFSet.pair i c ∈ source.stage.compressionTargets Labels) - (targetJ : ZFSet.pair j c ∈ source.stage.compressionTargets Labels) - (different : i ≠ j) (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) : - ZFSet.pair (ZFSet.pair K' L') c' ∈ certificate.target.stage.meetGraph := by - let completion := certificate.compression.born.profiled.heighted.completion - have geometry := certificate.external.inputs.externalBoundedGeometryData - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground - obtain ⟨K, oldI, copyI⟩ := (certificate.external.inputs.boundedCapImages_entry_iff - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground).1 capI - obtain ⟨L, oldJ, copyJ⟩ := (certificate.external.inputs.boundedCapImages_entry_iff - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground).1 capJ - have hi := (ZFSet.pair_mem_prod.1 (completion.caps_function.1 oldI)).1 - have hj := (ZFSet.pair_mem_prod.1 (completion.caps_function.1 oldJ)).1 - obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground - source.stage.meet_ground source.stage.action_ground hLabels source.stage.meet - obtain ⟨v, sepI, _⟩ := (fields 3).2.2 i hi - obtain ⟨w, sepJ, _⟩ := (fields 3).2.2 j hj - obtain ⟨F, filterI, _⟩ := (fields 4).2.2 i hi - obtain ⟨H, filterJ, _⟩ := (fields 4).2.2 j hj - have first := certificate.compression.born.profiled.profiles i c v K F oldI targetI sepI filterI - have second := certificate.compression.born.profiled.profiles j c w L H oldJ targetJ sepJ filterJ - have inherited := certificate.origin.union_caps_common_target_meet completion.algebra - pairing unions powers separation source.stage.carrier_ground source.stage.actors_ground - source.stage.order_ground source.stage.meet_ground source.stage.action_ground hLabels - rfl rfl oldI oldJ targetI targetJ different first.cap_not_below_target second.cap_not_below_target - rw [certificate.point_graph] at imageC - rw [certificate.target_fields.2.2.1] - exact (geometry.copies _ certificate.external.inputs.group.group_code.identity_mem).map_meet - K L c K' L' c' inherited copyI copyJ - ((completion.externalOriginalEmbedding_entry_iff _ _ _ _ c c').1 imageC).1 - -local notation "P" => source.stage.carrier -local notation "r" => source.stage.order -local notation "I" => source.stage.compressionTasks Labels -local notation "Q" => certificate.target.stage.carrier - -noncomputable def insertionCapImages (c e F : ZFSet.{u}) : ZFSet.{u} := - relationCompose Labels I Q (identityInsertionTaskGraph Labels I P r c e F) - certificate.compressionCapImages - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -include pairing unions powers separation infinite - -theorem insertionCapImages_ground {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) : - certificate.insertionCapImages c e F ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hLabels certificate.indices_ground - certificate.target.stage.carrier_ground - (M.identityInsertionTaskGraph_mem pairing unions powers separation hLabels certificate.indices_ground - source.stage.carrier_ground source.stage.order_ground hc he hF) - (certificate.compressionCapImages_ground pairing unions powers separation infinite) - -theorem insertionCapImages_entry_iff {c e F label K : ZFSet.{u}} : - ZFSet.pair label K ∈ certificate.insertionCapImages c e F ↔ - label ∈ Labels ∧ ZFSet.pair (identityInsertionTask P r c e F label) K ∈ certificate.compressionCapImages := by - rw [insertionCapImages, pair_mem_relationCompose] - constructor - · rintro ⟨hlabel, _, task, _, entry, cap⟩ - have equal := ((pair_mem_identityInsertionTaskGraph Labels I P r c e F label task).1 entry).2.2 - exact ⟨hlabel, equal ▸ cap⟩ - · rintro ⟨hlabel, cap⟩ - have bounds := ZFSet.pair_mem_prod.1 - ((certificate.compressionCapImages_function pairing unions powers separation infinite).1 cap) - exact ⟨hlabel, bounds.2, _, bounds.1, - (pair_mem_identityInsertionTaskGraph Labels I P r c e F _ _).2 ⟨hlabel, bounds.1, rfl⟩, cap⟩ - -variable {c e F : ZFSet.{u}} - -theorem insertionCapImages_function - (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) - (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) : - ZFSet.IsFunc Labels Q (certificate.insertionCapImages c e F) := by - have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) - source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code - source.stage.group_code.identity_mem hc he filter lower strict above - exact relationCompose_function_of_subset tasks.function - (certificate.compressionCapImages_function pairing unions powers separation infinite) (fun _ h => h) - -theorem insertionCapImages_profile - (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) - (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) {label K c' e' : ZFSet.{u}} - (cap : ZFSet.pair label K ∈ certificate.insertionCapImages c e F) - (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) - (imageE : ZFSet.pair e e' ∈ certificate.transition.map.points) : - CodedCapProfile Q certificate.target.stage.order certificate.target.stage.meetGraph c' e' K - (relationImage F Q certificate.transition.map.points) := by - obtain ⟨hlabel, entry⟩ := (certificate.insertionCapImages_entry_iff - pairing unions powers separation infinite).1 cap - have fields := M.identityInsertionTask_fields pairing unions powers separation - source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code - source.stage.group_code.identity_mem hc he filter lower strict above hlabel - exact certificate.compressionCapImages_profile pairing unions powers separation infinite entry - (fields 1) (fields 3) (fields 4) imageC imageE - -theorem insertionCapImages_meet - (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) - (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) (hLabels : Labels ∈ M.sets) {first second K L c' : ZFSet.{u}} - (firstCap : ZFSet.pair first K ∈ certificate.insertionCapImages c e F) - (secondCap : ZFSet.pair second L ∈ certificate.insertionCapImages c e F) - (different : first ≠ second) (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) : - ZFSet.pair (ZFSet.pair K L) c' ∈ certificate.target.stage.meetGraph := by - obtain ⟨hfirst, firstEntry⟩ := (certificate.insertionCapImages_entry_iff - pairing unions powers separation infinite).1 firstCap - obtain ⟨hsecond, secondEntry⟩ := (certificate.insertionCapImages_entry_iff - pairing unions powers separation infinite).1 secondCap - have fieldsFirst := M.identityInsertionTask_fields pairing unions powers separation - source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code - source.stage.group_code.identity_mem hc he filter lower strict above hfirst - have fieldsSecond := M.identityInsertionTask_fields pairing unions powers separation - source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code - source.stage.group_code.identity_mem hc he filter lower strict above hsecond - exact certificate.compressionCapImages_common_target_meet pairing unions powers separation infinite hLabels - firstEntry secondEntry (fieldsFirst 1) (fieldsSecond 1) - (fun equal => different (identityInsertionTask_injective P r c e F equal)) imageC - -theorem insertionCapImages_injection - (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) - (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) (hLabels : Labels ∈ M.sets) : - InjectionCode Labels Q (certificate.insertionCapImages c e F) := by - refine ⟨certificate.insertionCapImages_function pairing unions powers separation infinite - hc he hF filter lower strict above, ?_⟩ - intro first second K firstCap secondCap - by_cases equal : first = second - · exact equal - · obtain ⟨c', imageC, _⟩ := certificate.transition.map.point_embedding.injection.function.2 c hc - obtain ⟨e', imageE, _⟩ := certificate.transition.map.point_embedding.injection.function.2 e he - have profile := certificate.insertionCapImages_profile pairing unions powers separation infinite - hc he hF filter lower strict above firstCap imageC imageE - have meet := certificate.insertionCapImages_meet pairing unions powers separation infinite - hc he hF filter lower strict above hLabels firstCap secondCap equal imageC - exact (profile.cap_not_below_target - (certificate.target.stage.meet.greatest K K c' K profile.cap_mem meet - (certificate.target.stage.meet.order.refl K profile.cap_mem) - (certificate.target.stage.meet.order.refl K profile.cap_mem))).elim - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -noncomputable def taskCapValues : Fin 11 → ZFSet.{u} := - Fin.cases (source.stage.compressionTasks Labels) (Fin.cases source.stage.carrier - (Fin.cases certificate.target.stage.carrier (Fin.cases certificate.target.stage.order - (Fin.cases certificate.target.stage.meetGraph (Fin.cases certificate.transition.map.points - (Fin.cases (source.stage.compressionTargets Labels) - (Fin.cases (source.stage.compressionSeparators Labels) - (Fin.cases (source.stage.compressionFilters Labels) - (Fin.cases (M.groundPower source.stage.carrier) - (fun _ => certificate.compressionCapImages)))))))))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) -include pairing unions powers separation infinite hLabels - -theorem taskCapValues_ground : ∀ j, certificate.taskCapValues j ∈ M.sets := by - obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground - source.stage.meet_ground source.stage.action_ground hLabels source.stage.meet - exact Fin.cases certificate.indices_ground (Fin.cases source.stage.carrier_ground - (Fin.cases certificate.target.stage.carrier_ground (Fin.cases certificate.target.stage.order_ground - (Fin.cases certificate.target.stage.meet_ground (Fin.cases certificate.transition.map.points_ground - (Fin.cases (fields 1).1 (Fin.cases (fields 3).1 - (Fin.cases certificate.filters_ground (Fin.cases (M.groundPower_mem powers source.stage.carrier_ground) - (fun _ => certificate.compressionCapImages_ground pairing unions powers separation infinite)))))))))) - -theorem taskCapFamily : - TaskCapFamilyCode (source.stage.compressionTasks Labels) source.stage.carrier - certificate.target.stage.carrier certificate.target.stage.order certificate.target.stage.meetGraph - certificate.transition.map.points (source.stage.compressionTargets Labels) - (source.stage.compressionSeparators Labels) (source.stage.compressionFilters Labels) - (M.groundPower source.stage.carrier) certificate.compressionCapImages := by - refine ⟨certificate.compressionCapImages_function pairing unions powers separation infinite, ?_, ?_⟩ - · intro i _ c _ v _ F _ K _ c' _ v' _ target separator filter cap imageC imageV - exact certificate.compressionCapImages_profile pairing unions powers separation infinite - cap target separator filter imageC imageV - · intro i _ j _ c _ K _ L _ c' _ different targetI targetJ capI capJ imageC - exact certificate.compressionCapImages_common_target_meet pairing unions powers separation infinite - hLabels capI capJ targetI targetJ different imageC - -theorem realize_taskCapFamily : - Realize M.sets (BoundedFormula.taskCapFamilyFormula 0 1 2 3 4 5 6 7 8 9 10).toFormula - certificate.taskCapValues := - (BoundedFormula.realize_taskCapFamilyFormula M 0 1 2 3 4 5 6 7 8 9 10 - certificate.taskCapValues - (certificate.taskCapValues_ground pairing unions powers separation infinite hLabels)).2 - (certificate.taskCapFamily pairing unions powers separation infinite hLabels) - -end GroundInitialMainSuccessorData - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaskCapFamilyCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIdentityInsertionTasks +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorProfilePreservation + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +noncomputable def boundedCapImages (P r μ A : ZFSet.{u}) : ZFSet.{u} := + relationCompose I (completion.algebra.union.fields 0) (completion.externalBoundedCarrier P r μ A) + (completion.algebra.caps τ) (completion.externalCopyGraph P r μ A + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one)) + +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) +include data group action pairing unions powers separation infinite hG hP +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalBoundedCarrier P r μ A +local notation "copyGraph" => completion.externalCopyGraph P r μ A + (M.externalGroupIdentity G (externalChildLetters I P (externalRectangles P G r μ A)) m one) + +theorem boundedCapImages_ground (hI : I ∈ M.sets) : + completion.boundedCapImages P r μ A ∈ M.sets := by + have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP + exact M.relationCompose_mem pairing unions powers separation hI (completion.algebra.union.ground 0) + geometry.carrier_ground completion.caps_ground + (geometry.copies_ground _ data.group.group_code.identity_mem) + +theorem boundedCapImages_function : + ZFSet.IsFunc I Q (completion.boundedCapImages P r μ A) := by + have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP + exact relationCompose_function_of_subset completion.caps_function + (geometry.copies _ data.group.group_code.identity_mem).injection.function (fun _ h => h) + +theorem boundedCapImages_entry_iff {i k' : ZFSet.{u}} : + ZFSet.pair i k' ∈ completion.boundedCapImages P r μ A ↔ + ∃ k, ZFSet.pair i k ∈ completion.algebra.caps τ ∧ ZFSet.pair k k' ∈ copyGraph := by + have geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP + rw [GroundCompressionCompletion.boundedCapImages, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, k, _, cap, image⟩ + exact ⟨k, cap, image⟩ + · rintro ⟨k, cap, image⟩ + have bounds := ZFSet.pair_mem_prod.1 (completion.caps_function.1 cap) + have target := ZFSet.pair_mem_prod.1 + ((geometry.copies _ data.group.group_code.identity_mem).injection.function.1 image) + exact ⟨bounds.1, target.2, k, bounds.2, cap, image⟩ + +end GroundExternalGeometryInputs +end + +namespace GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P m one r A) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P r μ A +local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) +local notation "generators" => M.externalChildGenerators G letters m one +local notation "oldActors" => M.externalOldInclusion G letters m one +local notation "copyGraph" => completion.externalCopyGraph P r μ A (M.externalGroupIdentity G letters m one) +local notation "e" => completion.externalOriginalEmbedding P r μ A +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy + (completion.externalFamily group oldAction data.original) + (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 +local notation "newAction" => completion.externalPointAction P r μ A +local notation "newOrder" => completion.externalPointOrder P r μ A +include data group oldAction pairing unions powers separation infinite hG hP + +theorem bounded_compression_generator_agreement (i : SetMembers I) {a g k g' a' : ZFSet.{u}} + (source : ZFSet.pair (SetMembers.raw i) a ∈ Sources) + (representative : ZFSet.pair (SetMembers.raw i) g ∈ Reps) + (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators) + (actor : ZFSet.pair g g' ∈ oldActors) (image : ZFSet.pair a a' ∈ e) : + ActionAgreementBelow (completion.externalBoundedCarrier P r μ A) + (completion.externalBoundedOrder P r μ A) (completion.externalBoundedAction P r μ A) k g' a' := by + let := group.toGroup + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have imageA := ((completion.externalOriginalEmbedding_entry_iff P r μ A a a').1 image).1 + have ha' := (ZFSet.pair_mem_prod.1 (ideal.injection.function.1 imageA)).2 + have hg := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 actor)).1 + have agree : ActionAgreementBelow Q newOrder newAction k g' a' := by + intro x' hx' z _ lower + obtain ⟨x, hx, below, imageX⟩ := ideal.ideal _ _ _ imageA hx' lower + obtain ⟨y, acted, _⟩ := completion.algebra.union.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hg, hx⟩) + have hy := (ZFSet.pair_mem_prod.1 (completion.algebra.union.action.function.1 acted)).2 + let xu := SetMembers.ofMem x hx + let yu := SetMembers.ofMem y hy + have eqX := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG xu x').1 + (by simpa only [xu, SetMembers.raw_ofMem] using imageX) + have imageY := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG yu + ((q).encode ((root).toFun yu))).2 rfl + have first := data.compression_generator_agreement group oldAction pairing unions powers separation infinite hG + i source representative xu yu + (by simpa only [xu, SetMembers.raw_ofMem] using below) + (by simpa only [xu, yu, SetMembers.raw_ofMem] using acted) k generator + rw [← eqX] at first + have second := data.externalIdentityCopy_equivariant group oldAction pairing unions powers separation infinite hG + actor imageX imageY (by simpa only [yu, SetMembers.raw_ofMem] using acted) + have function : FunctionGraphOn (ZFSet.prod (M.externalGroupCarrier G letters m one) Q) newAction := + ⟨Q, geometry.action.function⟩ + exact ⟨fun entry => (function.unique entry first).symm ▸ second, + fun entry => (function.unique entry second).symm ▸ first⟩ + exact agree.fixedTop geometry.meet.order geometry.action ha' + +theorem bounded_compression_generator_top_iff (i : SetMembers I) {k τ' v : ZFSet.{u}} + (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators) + (imageTop : ZFSet.pair τ τ' ∈ e) : + ZFSet.pair (ZFSet.pair k τ') v ∈ completion.externalBoundedAction P r μ A ↔ + ZFSet.pair (SetMembers.raw i) v ∈ completion.boundedCapImages P r μ A := by + let := group.toGroup + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have copiedTop := ((completion.externalOriginalEmbedding_entry_iff P r μ A τ τ').1 imageTop).1 + have hτ' := (ZFSet.pair_mem_prod.1 (ideal.injection.function.1 copiedTop)).2 + have eqTop := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG + (SetMembers.ofMem τ completion.top_mem) τ').1 + (by simpa only [SetMembers.raw_ofMem] using copiedTop) + have canonical := data.compression_generator_top group oldAction pairing unions powers separation infinite hG i k generator + rw [← eqTop] at canonical + have imageCap := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG + (completion.externalCap i) _).2 rfl + have cap := (data.boundedCapImages_entry_iff group oldAction pairing unions powers separation infinite hG hP).2 + ⟨_, completion.externalCap_entry i, imageCap⟩ + have actionFunction : FunctionGraphOn (ZFSet.prod (M.externalGroupCarrier G letters m one) Q) newAction := + ⟨Q, geometry.action.function⟩ + have capFunction : FunctionGraphOn I (completion.boundedCapImages P r μ A) := + ⟨_, data.boundedCapImages_function group oldAction pairing unions powers separation infinite hG hP⟩ + change ZFSet.pair (ZFSet.pair k τ') v ∈ fixedTopAction (M.externalGroupCarrier G letters m one) Q newAction ↔ _ + rw [fixedTopAction_old_iff hτ'] + exact ⟨fun entry => (actionFunction.unique entry canonical).symm ▸ cap, + fun entry => (capFunction.unique entry cap).symm ▸ canonical⟩ + +end GroundExternalGeometryInputs + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +noncomputable def compressionCapImages : ZFSet.{u} := + certificate.compression.born.profiled.heighted.completion.boundedCapImages + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +include pairing unions powers separation infinite + +theorem compressionCapImages_ground : certificate.compressionCapImages ∈ M.sets := + certificate.external.inputs.boundedCapImages_ground source.stage.group_code source.stage.action_code + pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground + certificate.indices_ground + +theorem compressionCapImages_function : + ZFSet.IsFunc (source.stage.compressionTasks Labels) certificate.target.stage.carrier + certificate.compressionCapImages := by + rw [certificate.target_fields.1] + exact certificate.external.inputs.boundedCapImages_function source.stage.group_code source.stage.action_code + pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground + +theorem compressionCapImages_profile {i c v F K' c' v' : ZFSet.{u}} + (cap : ZFSet.pair i K' ∈ certificate.compressionCapImages) + (target : ZFSet.pair i c ∈ source.stage.compressionTargets Labels) + (separator : ZFSet.pair i v ∈ source.stage.compressionSeparators Labels) + (filter : ZFSet.pair i F ∈ source.stage.compressionFilters Labels) + (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) + (imageV : ZFSet.pair v v' ∈ certificate.transition.map.points) : + CodedCapProfile certificate.target.stage.carrier certificate.target.stage.order + certificate.target.stage.meetGraph c' v' K' + (relationImage F certificate.target.stage.carrier certificate.transition.map.points) := by + let completion := certificate.compression.born.profiled.heighted.completion + have geometry := certificate.external.inputs.externalBoundedGeometryData + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground + obtain ⟨K, oldCap, capCopy⟩ := (certificate.external.inputs.boundedCapImages_entry_iff + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground).1 cap + have profile := certificate.compression.born.profiled.profiles i c v K F oldCap target separator filter + have filterBound := (ZFSet.mem_sep.1 (show ZFSet.pair i F ∈ literalTaskFieldGraph + (source.stage.compressionTasks Labels) source.stage.carrier + (M.groundRelations source.stage.carrier source.stage.carrier) + (M.groundMeetFilters source.stage.carrier source.stage.order source.stage.meetGraph) Labels 4 from filter)).1 + have hF : F ∈ M.groundMeetFilters source.stage.carrier source.stage.order source.stage.meetGraph := + (ZFSet.pair_mem_prod.1 filterBound).2 + have subset := ((M.mem_groundMeetFilters _ _ _ F).1 hF).2.subset + obtain ⟨carrierEq, orderEq, meetEq, _⟩ := certificate.target_fields + rw [carrierEq, orderEq, meetEq, certificate.point_graph] + rw [certificate.point_graph] at imageC imageV + rw [completion.externalOriginal_filterImage_eq source.stage.carrier source.stage.order + source.stage.meetGraph source.stage.action _ subset] + exact (geometry.copies _ certificate.external.inputs.group.group_code.identity_mem).capProfile + completion.algebra.union.meet geometry.meet completion.top_mem completion.top profile + ((completion.externalOriginalEmbedding_entry_iff _ _ _ _ c c').1 imageC).1 + ((completion.externalOriginalEmbedding_entry_iff _ _ _ _ v v').1 imageV).1 capCopy + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +theorem compressionCapImages_common_target_meet + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) + {i j c K' L' c' : ZFSet.{u}} + (capI : ZFSet.pair i K' ∈ certificate.compressionCapImages) + (capJ : ZFSet.pair j L' ∈ certificate.compressionCapImages) + (targetI : ZFSet.pair i c ∈ source.stage.compressionTargets Labels) + (targetJ : ZFSet.pair j c ∈ source.stage.compressionTargets Labels) + (different : i ≠ j) (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) : + ZFSet.pair (ZFSet.pair K' L') c' ∈ certificate.target.stage.meetGraph := by + let completion := certificate.compression.born.profiled.heighted.completion + have geometry := certificate.external.inputs.externalBoundedGeometryData + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground + obtain ⟨K, oldI, copyI⟩ := (certificate.external.inputs.boundedCapImages_entry_iff + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground).1 capI + obtain ⟨L, oldJ, copyJ⟩ := (certificate.external.inputs.boundedCapImages_entry_iff + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground).1 capJ + have hi := (ZFSet.pair_mem_prod.1 (completion.caps_function.1 oldI)).1 + have hj := (ZFSet.pair_mem_prod.1 (completion.caps_function.1 oldJ)).1 + obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground + source.stage.meet_ground source.stage.action_ground hLabels source.stage.meet + obtain ⟨v, sepI, _⟩ := (fields 3).2.2 i hi + obtain ⟨w, sepJ, _⟩ := (fields 3).2.2 j hj + obtain ⟨F, filterI, _⟩ := (fields 4).2.2 i hi + obtain ⟨H, filterJ, _⟩ := (fields 4).2.2 j hj + have first := certificate.compression.born.profiled.profiles i c v K F oldI targetI sepI filterI + have second := certificate.compression.born.profiled.profiles j c w L H oldJ targetJ sepJ filterJ + have inherited := certificate.origin.union_caps_common_target_meet completion.algebra + pairing unions powers separation source.stage.carrier_ground source.stage.actors_ground + source.stage.order_ground source.stage.meet_ground source.stage.action_ground hLabels + rfl rfl oldI oldJ targetI targetJ different first.cap_not_below_target second.cap_not_below_target + rw [certificate.point_graph] at imageC + rw [certificate.target_fields.2.2.1] + exact (geometry.copies _ certificate.external.inputs.group.group_code.identity_mem).map_meet + K L c K' L' c' inherited copyI copyJ + ((completion.externalOriginalEmbedding_entry_iff _ _ _ _ c c').1 imageC).1 + +local notation "P" => source.stage.carrier +local notation "r" => source.stage.order +local notation "I" => source.stage.compressionTasks Labels +local notation "Q" => certificate.target.stage.carrier + +noncomputable def insertionCapImages (c e F : ZFSet.{u}) : ZFSet.{u} := + relationCompose Labels I Q (identityInsertionTaskGraph Labels I P r c e F) + certificate.compressionCapImages + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +include pairing unions powers separation infinite + +theorem insertionCapImages_ground {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) : + certificate.insertionCapImages c e F ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hLabels certificate.indices_ground + certificate.target.stage.carrier_ground + (M.identityInsertionTaskGraph_mem pairing unions powers separation hLabels certificate.indices_ground + source.stage.carrier_ground source.stage.order_ground hc he hF) + (certificate.compressionCapImages_ground pairing unions powers separation infinite) + +theorem insertionCapImages_entry_iff {c e F label K : ZFSet.{u}} : + ZFSet.pair label K ∈ certificate.insertionCapImages c e F ↔ + label ∈ Labels ∧ ZFSet.pair (identityInsertionTask P r c e F label) K ∈ certificate.compressionCapImages := by + rw [insertionCapImages, pair_mem_relationCompose] + constructor + · rintro ⟨hlabel, _, task, _, entry, cap⟩ + have equal := ((pair_mem_identityInsertionTaskGraph Labels I P r c e F label task).1 entry).2.2 + exact ⟨hlabel, equal ▸ cap⟩ + · rintro ⟨hlabel, cap⟩ + have bounds := ZFSet.pair_mem_prod.1 + ((certificate.compressionCapImages_function pairing unions powers separation infinite).1 cap) + exact ⟨hlabel, bounds.2, _, bounds.1, + (pair_mem_identityInsertionTaskGraph Labels I P r c e F _ _).2 ⟨hlabel, bounds.1, rfl⟩, cap⟩ + +variable {c e F : ZFSet.{u}} + +theorem insertionCapImages_function + (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) + (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) : + ZFSet.IsFunc Labels Q (certificate.insertionCapImages c e F) := by + have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) + source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code + source.stage.group_code.identity_mem hc he filter lower strict above + exact relationCompose_function_of_subset tasks.function + (certificate.compressionCapImages_function pairing unions powers separation infinite) (fun _ h => h) + +theorem insertionCapImages_profile + (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) + (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) {label K c' e' : ZFSet.{u}} + (cap : ZFSet.pair label K ∈ certificate.insertionCapImages c e F) + (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) + (imageE : ZFSet.pair e e' ∈ certificate.transition.map.points) : + CodedCapProfile Q certificate.target.stage.order certificate.target.stage.meetGraph c' e' K + (relationImage F Q certificate.transition.map.points) := by + obtain ⟨hlabel, entry⟩ := (certificate.insertionCapImages_entry_iff + pairing unions powers separation infinite).1 cap + have fields := M.identityInsertionTask_fields pairing unions powers separation + source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code + source.stage.group_code.identity_mem hc he filter lower strict above hlabel + exact certificate.compressionCapImages_profile pairing unions powers separation infinite entry + (fields 1) (fields 3) (fields 4) imageC imageE + +theorem insertionCapImages_meet + (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) + (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) (hLabels : Labels ∈ M.sets) {first second K L c' : ZFSet.{u}} + (firstCap : ZFSet.pair first K ∈ certificate.insertionCapImages c e F) + (secondCap : ZFSet.pair second L ∈ certificate.insertionCapImages c e F) + (different : first ≠ second) (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) : + ZFSet.pair (ZFSet.pair K L) c' ∈ certificate.target.stage.meetGraph := by + obtain ⟨hfirst, firstEntry⟩ := (certificate.insertionCapImages_entry_iff + pairing unions powers separation infinite).1 firstCap + obtain ⟨hsecond, secondEntry⟩ := (certificate.insertionCapImages_entry_iff + pairing unions powers separation infinite).1 secondCap + have fieldsFirst := M.identityInsertionTask_fields pairing unions powers separation + source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code + source.stage.group_code.identity_mem hc he filter lower strict above hfirst + have fieldsSecond := M.identityInsertionTask_fields pairing unions powers separation + source.stage.carrier_ground source.stage.order_ground hF source.stage.action_code + source.stage.group_code.identity_mem hc he filter lower strict above hsecond + exact certificate.compressionCapImages_common_target_meet pairing unions powers separation infinite hLabels + firstEntry secondEntry (fieldsFirst 1) (fieldsSecond 1) + (fun equal => different (identityInsertionTask_injective P r c e F equal)) imageC + +theorem insertionCapImages_injection + (hc : c ∈ source.stage.carrier) (he : e ∈ source.stage.carrier) (hF : F ∈ M.sets) + (filter : MeetFilterCode source.stage.carrier source.stage.order source.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ source.stage.order) (strict : ZFSet.pair e c ∉ source.stage.order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ source.stage.order) (hLabels : Labels ∈ M.sets) : + InjectionCode Labels Q (certificate.insertionCapImages c e F) := by + refine ⟨certificate.insertionCapImages_function pairing unions powers separation infinite + hc he hF filter lower strict above, ?_⟩ + intro first second K firstCap secondCap + by_cases equal : first = second + · exact equal + · obtain ⟨c', imageC, _⟩ := certificate.transition.map.point_embedding.injection.function.2 c hc + obtain ⟨e', imageE, _⟩ := certificate.transition.map.point_embedding.injection.function.2 e he + have profile := certificate.insertionCapImages_profile pairing unions powers separation infinite + hc he hF filter lower strict above firstCap imageC imageE + have meet := certificate.insertionCapImages_meet pairing unions powers separation infinite + hc he hF filter lower strict above hLabels firstCap secondCap equal imageC + exact (profile.cap_not_below_target + (certificate.target.stage.meet.greatest K K c' K profile.cap_mem meet + (certificate.target.stage.meet.order.refl K profile.cap_mem) + (certificate.target.stage.meet.order.refl K profile.cap_mem))).elim + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +noncomputable def taskCapValues : Fin 11 → ZFSet.{u} := + Fin.cases (source.stage.compressionTasks Labels) (Fin.cases source.stage.carrier + (Fin.cases certificate.target.stage.carrier (Fin.cases certificate.target.stage.order + (Fin.cases certificate.target.stage.meetGraph (Fin.cases certificate.transition.map.points + (Fin.cases (source.stage.compressionTargets Labels) + (Fin.cases (source.stage.compressionSeparators Labels) + (Fin.cases (source.stage.compressionFilters Labels) + (Fin.cases (M.groundPower source.stage.carrier) + (fun _ => certificate.compressionCapImages)))))))))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) +include pairing unions powers separation infinite hLabels + +theorem taskCapValues_ground : ∀ j, certificate.taskCapValues j ∈ M.sets := by + obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground + source.stage.meet_ground source.stage.action_ground hLabels source.stage.meet + exact Fin.cases certificate.indices_ground (Fin.cases source.stage.carrier_ground + (Fin.cases certificate.target.stage.carrier_ground (Fin.cases certificate.target.stage.order_ground + (Fin.cases certificate.target.stage.meet_ground (Fin.cases certificate.transition.map.points_ground + (Fin.cases (fields 1).1 (Fin.cases (fields 3).1 + (Fin.cases certificate.filters_ground (Fin.cases (M.groundPower_mem powers source.stage.carrier_ground) + (fun _ => certificate.compressionCapImages_ground pairing unions powers separation infinite)))))))))) + +theorem taskCapFamily : + TaskCapFamilyCode (source.stage.compressionTasks Labels) source.stage.carrier + certificate.target.stage.carrier certificate.target.stage.order certificate.target.stage.meetGraph + certificate.transition.map.points (source.stage.compressionTargets Labels) + (source.stage.compressionSeparators Labels) (source.stage.compressionFilters Labels) + (M.groundPower source.stage.carrier) certificate.compressionCapImages := by + refine ⟨certificate.compressionCapImages_function pairing unions powers separation infinite, ?_, ?_⟩ + · intro i _ c _ v _ F _ K _ c' _ v' _ target separator filter cap imageC imageV + exact certificate.compressionCapImages_profile pairing unions powers separation infinite + cap target separator filter imageC imageV + · intro i _ j _ c _ K _ L _ c' _ different targetI targetJ capI capJ imageC + exact certificate.compressionCapImages_common_target_meet pairing unions powers separation infinite + hLabels capI capJ targetI targetJ different imageC + +theorem realize_taskCapFamily : + Realize M.sets (BoundedFormula.taskCapFamilyFormula 0 1 2 3 4 5 6 7 8 9 10).toFormula + certificate.taskCapValues := + (BoundedFormula.realize_taskCapFamilyFormula M 0 1 2 3 4 5 6 7 8 9 10 + certificate.taskCapValues + (certificate.taskCapValues_ground pairing unions powers separation infinite hLabels)).2 + (certificate.taskCapFamily pairing unions powers separation infinite hLabels) + +end GroundInitialMainSuccessorData + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionLaws.lean index 912213ca7e271c4a406330071261b311e5669bcc..eeea751e49577e69c509fad6c63d6871693be114 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionLaws.lean @@ -1,173 +1,173 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainTransitionCodes - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainTransition -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def identity (stage : GroundMainStage M C D rD) : GroundMainTransition stage stage where - points := identityFunctionGraph stage.carrier - actors := identityFunctionGraph stage.actors - points_ground := M.identityFunctionGraph_mem pairing unions powers separation stage.carrier_ground - actors_ground := M.identityFunctionGraph_mem pairing unions powers separation stage.actors_ground - point_embedding := by - refine ⟨identityFunctionGraph_injection _, ?_, ?_⟩ - · intro x y x' y' lower first second - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second - exact lower - · intro x y z x' y' z' meet first second third - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 third - exact meet - order_iff := by - intro x y x' y' first second - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second - exact Iff.rfl - group_embedding := GroupEmbeddingCode.identity stage.group_code - equivariant := by - intro g g' x y x' y' actor first second acted - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 actor - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second - exact acted - bottom := (pair_mem_identityFunctionGraph _ _ _).2 ⟨rfl, stage.bottom_mem⟩ - height := by - intro x y z entry - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 entry - exact Iff.rfl - agreement := by - intro g h g' h' v v' first second image agree - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 image - exact agree - -noncomputable def comp {source middle target : GroundMainStage M C D rD} - (first : GroundMainTransition source middle) (second : GroundMainTransition middle target) : - GroundMainTransition source target where - points := relationCompose source.carrier middle.carrier target.carrier first.points second.points - actors := relationCompose source.actors middle.actors target.actors first.actors second.actors - points_ground := M.relationCompose_mem pairing unions powers separation source.carrier_ground - middle.carrier_ground target.carrier_ground first.points_ground second.points_ground - actors_ground := M.relationCompose_mem pairing unions powers separation source.actors_ground - middle.actors_ground target.actors_ground first.actors_ground second.actors_ground - point_embedding := first.point_embedding.compose second.point_embedding - order_iff := by - intro x y x' y' xx yy - obtain ⟨_, _, a, _, xa, ax⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx - obtain ⟨_, _, b, _, yb, by'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy - exact (second.order_iff a b x' y' ax by').trans (first.order_iff x y a b xa yb) - group_embedding := first.group_embedding.compose second.group_embedding - equivariant := by - intro g g' x y x' y' actor xx yy acted - obtain ⟨_, _, a, _, ga, ag⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 actor - obtain ⟨_, _, b, _, xb, bx⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx - obtain ⟨_, _, c, _, yc, cy⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy - exact second.equivariant a g' b c x' y' ag bx cy (first.equivariant g a x y b c ga xb yc acted) - bottom := (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨source.bottom_mem, target.bottom_mem, middle.bottom, middle.bottom_mem, first.bottom, second.bottom⟩ - height := by - intro x y z entry - obtain ⟨_, _, a, _, xa, ay⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - exact (second.height a y z ay).trans (first.height x a z xa) - agreement := by - intro g h g' h' v v' gg hh vv agree - obtain ⟨_, _, a, _, ga, ag⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 gg - obtain ⟨_, _, b, _, hb, bh⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 hh - obtain ⟨_, _, w, _, vw, wv⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 vv - exact second.agreement a b g' h' w v' ag bh wv (first.agreement g h a b v w ga hb vw agree) - -@[ext] theorem ext {source target : GroundMainStage M C D rD} - {first second : GroundMainTransition source target} - (points : first.points = second.points) (actors : first.actors = second.actors) : first = second := by - cases first - cases second - cases points - cases actors - rfl - -end PartitionPilot.Forcing.GroundMainTransition - -namespace PartitionPilot.Forcing -universe u -namespace GroundMainTransition -open SetFormula -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {source target : GroundMainStage M C D rD} - -noncomputable def code (transition : GroundMainTransition source target) : ZFSet.{u} := - ZFSet.pair transition.points transition.actors - -theorem code_injective : Function.Injective (code (source := source) (target := target)) := by - intro first second equal - obtain ⟨points, actors⟩ := ZFSet.pair_inj.1 equal - exact ext points actors - -theorem code_mem (transition : GroundMainTransition source target) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : transition.code ∈ M.sets := - M.orderedPair_mem pairing transition.points_ground transition.actors_ground - -end GroundMainTransition - -namespace BoundedFormula -open SetFormula - -def mainTransitionFormula {n} (z points actors : Fin n) : BoundedFormula n := - orderedPairFormula z points actors - -theorem truth_mainTransitionFormula {n} (z points actors : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (mainTransitionFormula z points actors) env ↔ - env z = ZFSet.pair (env points) (env actors) := - truth_orderedPairFormula z points actors env - -theorem realize_mainTransitionFormula (M : TransitiveGround.{u}) {n} - (z points actors : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (mainTransitionFormula z points actors).toFormula env ↔ - env z = ZFSet.pair (env points) (env actors) := - (realize_toFormula M _ env members).trans (truth_mainTransitionFormula z points actors env) - -end BoundedFormula -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundMainTransition -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -@[simp] theorem identity_comp {source target : GroundMainStage M C D rD} - (f : GroundMainTransition source target) : - comp pairing unions powers separation (identity pairing unions powers separation source) f = f := by - apply ext - · exact relationCompose_identity_left f.point_embedding.injection.function.1 - · exact relationCompose_identity_left f.group_embedding.injection.function.1 - -@[simp] theorem comp_identity {source target : GroundMainStage M C D rD} - (f : GroundMainTransition source target) : - comp pairing unions powers separation f (identity pairing unions powers separation target) = f := by - apply ext - · exact relationCompose_identity_right f.point_embedding.injection.function.1 - · exact relationCompose_identity_right f.group_embedding.injection.function.1 - -theorem comp_assoc {source first second target : GroundMainStage M C D rD} - (f : GroundMainTransition source first) (g : GroundMainTransition first second) - (h : GroundMainTransition second target) : - comp pairing unions powers separation (comp pairing unions powers separation f g) h = - comp pairing unions powers separation f (comp pairing unions powers separation g h) := by - apply ext - · exact relationCompose_assoc source.carrier first.carrier second.carrier target.carrier f.points g.points h.points - · exact relationCompose_assoc source.actors first.actors second.actors target.actors f.actors g.actors h.actors - -end PartitionPilot.Forcing.GroundMainTransition - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainTransitionCodes + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainTransition +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def identity (stage : GroundMainStage M C D rD) : GroundMainTransition stage stage where + points := identityFunctionGraph stage.carrier + actors := identityFunctionGraph stage.actors + points_ground := M.identityFunctionGraph_mem pairing unions powers separation stage.carrier_ground + actors_ground := M.identityFunctionGraph_mem pairing unions powers separation stage.actors_ground + point_embedding := by + refine ⟨identityFunctionGraph_injection _, ?_, ?_⟩ + · intro x y x' y' lower first second + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second + exact lower + · intro x y z x' y' z' meet first second third + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 third + exact meet + order_iff := by + intro x y x' y' first second + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second + exact Iff.rfl + group_embedding := GroupEmbeddingCode.identity stage.group_code + equivariant := by + intro g g' x y x' y' actor first second acted + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 actor + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second + exact acted + bottom := (pair_mem_identityFunctionGraph _ _ _).2 ⟨rfl, stage.bottom_mem⟩ + height := by + intro x y z entry + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 entry + exact Iff.rfl + agreement := by + intro g h g' h' v v' first second image agree + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 first + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 second + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 image + exact agree + +noncomputable def comp {source middle target : GroundMainStage M C D rD} + (first : GroundMainTransition source middle) (second : GroundMainTransition middle target) : + GroundMainTransition source target where + points := relationCompose source.carrier middle.carrier target.carrier first.points second.points + actors := relationCompose source.actors middle.actors target.actors first.actors second.actors + points_ground := M.relationCompose_mem pairing unions powers separation source.carrier_ground + middle.carrier_ground target.carrier_ground first.points_ground second.points_ground + actors_ground := M.relationCompose_mem pairing unions powers separation source.actors_ground + middle.actors_ground target.actors_ground first.actors_ground second.actors_ground + point_embedding := first.point_embedding.compose second.point_embedding + order_iff := by + intro x y x' y' xx yy + obtain ⟨_, _, a, _, xa, ax⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx + obtain ⟨_, _, b, _, yb, by'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy + exact (second.order_iff a b x' y' ax by').trans (first.order_iff x y a b xa yb) + group_embedding := first.group_embedding.compose second.group_embedding + equivariant := by + intro g g' x y x' y' actor xx yy acted + obtain ⟨_, _, a, _, ga, ag⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 actor + obtain ⟨_, _, b, _, xb, bx⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xx + obtain ⟨_, _, c, _, yc, cy⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 yy + exact second.equivariant a g' b c x' y' ag bx cy (first.equivariant g a x y b c ga xb yc acted) + bottom := (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨source.bottom_mem, target.bottom_mem, middle.bottom, middle.bottom_mem, first.bottom, second.bottom⟩ + height := by + intro x y z entry + obtain ⟨_, _, a, _, xa, ay⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + exact (second.height a y z ay).trans (first.height x a z xa) + agreement := by + intro g h g' h' v v' gg hh vv agree + obtain ⟨_, _, a, _, ga, ag⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 gg + obtain ⟨_, _, b, _, hb, bh⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 hh + obtain ⟨_, _, w, _, vw, wv⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 vv + exact second.agreement a b g' h' w v' ag bh wv (first.agreement g h a b v w ga hb vw agree) + +@[ext] theorem ext {source target : GroundMainStage M C D rD} + {first second : GroundMainTransition source target} + (points : first.points = second.points) (actors : first.actors = second.actors) : first = second := by + cases first + cases second + cases points + cases actors + rfl + +end PartitionPilot.Forcing.GroundMainTransition + +namespace PartitionPilot.Forcing +universe u +namespace GroundMainTransition +open SetFormula +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {source target : GroundMainStage M C D rD} + +noncomputable def code (transition : GroundMainTransition source target) : ZFSet.{u} := + ZFSet.pair transition.points transition.actors + +theorem code_injective : Function.Injective (code (source := source) (target := target)) := by + intro first second equal + obtain ⟨points, actors⟩ := ZFSet.pair_inj.1 equal + exact ext points actors + +theorem code_mem (transition : GroundMainTransition source target) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : transition.code ∈ M.sets := + M.orderedPair_mem pairing transition.points_ground transition.actors_ground + +end GroundMainTransition + +namespace BoundedFormula +open SetFormula + +def mainTransitionFormula {n} (z points actors : Fin n) : BoundedFormula n := + orderedPairFormula z points actors + +theorem truth_mainTransitionFormula {n} (z points actors : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (mainTransitionFormula z points actors) env ↔ + env z = ZFSet.pair (env points) (env actors) := + truth_orderedPairFormula z points actors env + +theorem realize_mainTransitionFormula (M : TransitiveGround.{u}) {n} + (z points actors : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (mainTransitionFormula z points actors).toFormula env ↔ + env z = ZFSet.pair (env points) (env actors) := + (realize_toFormula M _ env members).trans (truth_mainTransitionFormula z points actors env) + +end BoundedFormula +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundMainTransition +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +@[simp] theorem identity_comp {source target : GroundMainStage M C D rD} + (f : GroundMainTransition source target) : + comp pairing unions powers separation (identity pairing unions powers separation source) f = f := by + apply ext + · exact relationCompose_identity_left f.point_embedding.injection.function.1 + · exact relationCompose_identity_left f.group_embedding.injection.function.1 + +@[simp] theorem comp_identity {source target : GroundMainStage M C D rD} + (f : GroundMainTransition source target) : + comp pairing unions powers separation f (identity pairing unions powers separation target) = f := by + apply ext + · exact relationCompose_identity_right f.point_embedding.injection.function.1 + · exact relationCompose_identity_right f.group_embedding.injection.function.1 + +theorem comp_assoc {source first second target : GroundMainStage M C D rD} + (f : GroundMainTransition source first) (g : GroundMainTransition first second) + (h : GroundMainTransition second target) : + comp pairing unions powers separation (comp pairing unions powers separation f g) h = + comp pairing unions powers separation f (comp pairing unions powers separation g h) := by + apply ext + · exact relationCompose_assoc source.carrier first.carrier second.carrier target.carrier f.points g.points h.points + · exact relationCompose_assoc source.actors first.actors second.actors target.actors f.actors g.actors h.actors + +end PartitionPilot.Forcing.GroundMainTransition + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionValidity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionValidity.lean index 66186d2f4af0236bd53ef52656d7e3790dfb4eea..ddd3308bcd4f19689c876a9c2275809f9ff6489d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionValidity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMainTransitionValidity.lean @@ -1,107 +1,107 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.MainTransitionValidityCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace GroundMainTransition -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {source target : GroundMainStage M C D rD} - -theorem laws (transition : GroundMainTransition source target) : - MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph - target.meetGraph source.actors target.actors source.multiplication target.multiplication - source.identity target.identity source.action target.action source.bottom target.bottom - source.height target.height transition.points transition.actors := - ⟨transition.point_embedding, transition.order_iff, transition.group_embedding, - transition.equivariant, transition.bottom, transition.height, transition.agreement⟩ - -def ofLaws {points actors : ZFSet.{u}} - (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) - (valid : MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph - target.meetGraph source.actors target.actors source.multiplication target.multiplication - source.identity target.identity source.action target.action source.bottom target.bottom - source.height target.height points actors) : GroundMainTransition source target where - points := points - actors := actors - points_ground := hPoints - actors_ground := hActors - point_embedding := valid.point_embedding - order_iff := valid.order_iff - group_embedding := valid.group_embedding - equivariant := valid.equivariant - bottom := valid.bottom - height := valid.height - agreement := valid.agreement - -theorem ofLaws_code {points actors : ZFSet.{u}} - (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) - (valid : MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph - target.meetGraph source.actors target.actors source.multiplication target.multiplication - source.identity target.identity source.action target.action source.bottom target.bottom - source.height target.height points actors) : - (ofLaws hPoints hActors valid).code = ZFSet.pair points actors := rfl - -theorem ofLaws_self (transition : GroundMainTransition source target) : - ofLaws transition.points_ground transition.actors_ground transition.laws = transition := - ext rfl rfl - -theorem exists_code_iff (z : ZFSet.{u}) : - (∃ transition : GroundMainTransition source target, transition.code = z) ↔ - ∃ points ∈ M.sets, ∃ actors ∈ M.sets, z = ZFSet.pair points actors ∧ - MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph - target.meetGraph source.actors target.actors source.multiplication target.multiplication - source.identity target.identity source.action target.action source.bottom target.bottom - source.height target.height points actors := by - constructor - · rintro ⟨transition, equal⟩ - exact ⟨transition.points, transition.points_ground, transition.actors, transition.actors_ground, - equal.symm, transition.laws⟩ - · rintro ⟨points, hp, actors, ha, equal, valid⟩ - exact ⟨ofLaws hp ha valid, equal.symm⟩ - -end GroundMainTransition - -namespace BoundedFormula - -def validMainTransitionCodeFormula {n} - (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) : - BoundedFormula n := - .conj (orderedPairFormula z points actors) - (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ - heightP heightQ points actors) - -theorem truth_validMainTransitionCodeFormula {n} - (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ - heightP heightQ points actors) env ↔ - env z = ZFSet.pair (env points) (env actors) ∧ - 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) := by - simp only [validMainTransitionCodeFormula, Truth, truth_orderedPairFormula, - truth_mainTransitionLawsFormula] - -theorem realize_validMainTransitionCodeFormula (M : TransitiveGround.{u}) {n} - (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ - heightP heightQ points actors).toFormula env ↔ - env z = ZFSet.pair (env points) (env actors) ∧ - 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) := - (realize_toFormula M _ env members).trans - (truth_validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ - heightP heightQ points actors env) - -end BoundedFormula -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.MainTransitionValidityCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace GroundMainTransition +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {source target : GroundMainStage M C D rD} + +theorem laws (transition : GroundMainTransition source target) : + MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph + target.meetGraph source.actors target.actors source.multiplication target.multiplication + source.identity target.identity source.action target.action source.bottom target.bottom + source.height target.height transition.points transition.actors := + ⟨transition.point_embedding, transition.order_iff, transition.group_embedding, + transition.equivariant, transition.bottom, transition.height, transition.agreement⟩ + +def ofLaws {points actors : ZFSet.{u}} + (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) + (valid : MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph + target.meetGraph source.actors target.actors source.multiplication target.multiplication + source.identity target.identity source.action target.action source.bottom target.bottom + source.height target.height points actors) : GroundMainTransition source target where + points := points + actors := actors + points_ground := hPoints + actors_ground := hActors + point_embedding := valid.point_embedding + order_iff := valid.order_iff + group_embedding := valid.group_embedding + equivariant := valid.equivariant + bottom := valid.bottom + height := valid.height + agreement := valid.agreement + +theorem ofLaws_code {points actors : ZFSet.{u}} + (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets) + (valid : MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph + target.meetGraph source.actors target.actors source.multiplication target.multiplication + source.identity target.identity source.action target.action source.bottom target.bottom + source.height target.height points actors) : + (ofLaws hPoints hActors valid).code = ZFSet.pair points actors := rfl + +theorem ofLaws_self (transition : GroundMainTransition source target) : + ofLaws transition.points_ground transition.actors_ground transition.laws = transition := + ext rfl rfl + +theorem exists_code_iff (z : ZFSet.{u}) : + (∃ transition : GroundMainTransition source target, transition.code = z) ↔ + ∃ points ∈ M.sets, ∃ actors ∈ M.sets, z = ZFSet.pair points actors ∧ + MainTransitionLaws source.carrier target.carrier source.order target.order source.meetGraph + target.meetGraph source.actors target.actors source.multiplication target.multiplication + source.identity target.identity source.action target.action source.bottom target.bottom + source.height target.height points actors := by + constructor + · rintro ⟨transition, equal⟩ + exact ⟨transition.points, transition.points_ground, transition.actors, transition.actors_ground, + equal.symm, transition.laws⟩ + · rintro ⟨points, hp, actors, ha, equal, valid⟩ + exact ⟨ofLaws hp ha valid, equal.symm⟩ + +end GroundMainTransition + +namespace BoundedFormula + +def validMainTransitionCodeFormula {n} + (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) : + BoundedFormula n := + .conj (orderedPairFormula z points actors) + (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ + heightP heightQ points actors) + +theorem truth_validMainTransitionCodeFormula {n} + (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ + heightP heightQ points actors) env ↔ + env z = ZFSet.pair (env points) (env actors) ∧ + 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) := by + simp only [validMainTransitionCodeFormula, Truth, truth_orderedPairFormula, + truth_mainTransitionLawsFormula] + +theorem realize_validMainTransitionCodeFormula (M : TransitiveGround.{u}) {n} + (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ + heightP heightQ points actors).toFormula env ↔ + env z = ZFSet.pair (env points) (env actors) ∧ + 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) := + (realize_toFormula M _ env members).trans + (truth_validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ + heightP heightQ points actors env) + +end BoundedFormula +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMeetGeneratorSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMeetGeneratorSteps.lean index 608ea4e55e176bf57172947f9873faae143e228a..1cf462808ee6308b10ea375f2d96ffd75514f975 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMeetGeneratorSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMeetGeneratorSteps.lean @@ -1,85 +1,85 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GeneratedMeetFilters -import OAI.SetTheory.PartitionPrinciple.Forcing.SmallCodedMeetActions -import OAI.SetTheory.PartitionPrinciple.Geometry.TileStarIncomingCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -noncomputable def meetGeneratorSteps (P μ A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ P, ∃ y ∈ P, ∃ a ∈ A, - z = ZFSet.pair x y ∧ ZFSet.pair (ZFSet.pair x a) y ∈ μ) (ZFSet.prod P P) - -theorem pair_mem_meetGeneratorSteps (P μ A x y : ZFSet.{u}) : - ZFSet.pair x y ∈ meetGeneratorSteps P μ A ↔ - x ∈ P ∧ y ∈ P ∧ ∃ a ∈ A, ZFSet.pair (ZFSet.pair x a) y ∈ μ := by - rw [meetGeneratorSteps, ZFSet.mem_sep] - constructor - · rintro ⟨_, x', hx, y', hy, a, ha, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, hy, a, ha, entry⟩ - · rintro ⟨hx, hy, a, ha, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, a, ha, rfl, entry⟩ - -namespace BoundedFormula - -def meetGeneratorStepFormula {n} (z P μ A : Fin n) : BoundedFormula n := - .exMem P (.exMem P.succ (.exMem A.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 1) - (tripleMembershipFormula 2 0 1 μ.succ.succ.succ)))) - -theorem truth_meetGeneratorStepFormula {n} (z P μ A : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (meetGeneratorStepFormula z P μ A) env ↔ - ∃ x ∈ env P, ∃ y ∈ env P, ∃ a ∈ env A, - env z = ZFSet.pair x y ∧ ZFSet.pair (ZFSet.pair x a) y ∈ env μ := by - simp only [meetGeneratorStepFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_tripleMembershipFormula] - rfl - -end BoundedFormula - -theorem TransitiveGround.meetGeneratorSteps_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P μ A : ZFSet.{u}} (hP : P ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) : - meetGeneratorSteps P μ A ∈ M.sets := by - let params := extend P (extend μ (extend A Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.meetGeneratorStepFormula 0 1 2 3) params - (Fin.cases hP (Fin.cases hμ (Fin.cases hA (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hP hP) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.meetGeneratorStepFormula 0 1 2 3) (extend z params)) - (ZFSet.prod P P) = meetGeneratorSteps P μ A := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, meetGeneratorSteps, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_meetGeneratorStepFormula _ _ _ _ _) - exact equal ▸ selected - -theorem MeetOrderCode.meetGeneratorSteps_iff {P r μ A : ZFSet.{u}} - (code : MeetOrderCode P r μ) (subset : A ⊆ P) (x y : SetMembers P) : - ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ meetGeneratorSteps P μ A ↔ - meetGeneratorStep code.toSmallMeetOrder (fun a => SetMembers.raw a ∈ A) x y := by - rw [pair_mem_meetGeneratorSteps] - constructor - · rintro ⟨_, _, a, ha, entry⟩ - refine ⟨SetMembers.ofMem a (subset ha), ?_, ?_⟩ - · simpa only [SetMembers.raw_ofMem] using ha - · apply Eq.symm - apply (code.toSmallMeetOrder_meet_eq_iff _ _ _).2 - simpa only [SetMembers.raw_ofMem] using entry - · rintro ⟨a, ha, equal⟩ - exact ⟨SetMembers.raw_mem x, SetMembers.raw_mem y, SetMembers.raw a, ha, - (code.toSmallMeetOrder_meet_eq_iff _ _ _).1 equal.symm⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GeneratedMeetFilters +import OAI.SetTheory.PartitionPrinciple.Forcing.SmallCodedMeetActions +import OAI.SetTheory.PartitionPrinciple.Geometry.TileStarIncomingCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +noncomputable def meetGeneratorSteps (P μ A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ P, ∃ y ∈ P, ∃ a ∈ A, + z = ZFSet.pair x y ∧ ZFSet.pair (ZFSet.pair x a) y ∈ μ) (ZFSet.prod P P) + +theorem pair_mem_meetGeneratorSteps (P μ A x y : ZFSet.{u}) : + ZFSet.pair x y ∈ meetGeneratorSteps P μ A ↔ + x ∈ P ∧ y ∈ P ∧ ∃ a ∈ A, ZFSet.pair (ZFSet.pair x a) y ∈ μ := by + rw [meetGeneratorSteps, ZFSet.mem_sep] + constructor + · rintro ⟨_, x', hx, y', hy, a, ha, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, hy, a, ha, entry⟩ + · rintro ⟨hx, hy, a, ha, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, a, ha, rfl, entry⟩ + +namespace BoundedFormula + +def meetGeneratorStepFormula {n} (z P μ A : Fin n) : BoundedFormula n := + .exMem P (.exMem P.succ (.exMem A.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 1) + (tripleMembershipFormula 2 0 1 μ.succ.succ.succ)))) + +theorem truth_meetGeneratorStepFormula {n} (z P μ A : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (meetGeneratorStepFormula z P μ A) env ↔ + ∃ x ∈ env P, ∃ y ∈ env P, ∃ a ∈ env A, + env z = ZFSet.pair x y ∧ ZFSet.pair (ZFSet.pair x a) y ∈ env μ := by + simp only [meetGeneratorStepFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_tripleMembershipFormula] + rfl + +end BoundedFormula + +theorem TransitiveGround.meetGeneratorSteps_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P μ A : ZFSet.{u}} (hP : P ∈ M.sets) (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) : + meetGeneratorSteps P μ A ∈ M.sets := by + let params := extend P (extend μ (extend A Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.meetGeneratorStepFormula 0 1 2 3) params + (Fin.cases hP (Fin.cases hμ (Fin.cases hA (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hP hP) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.meetGeneratorStepFormula 0 1 2 3) (extend z params)) + (ZFSet.prod P P) = meetGeneratorSteps P μ A := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, meetGeneratorSteps, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_meetGeneratorStepFormula _ _ _ _ _) + exact equal ▸ selected + +theorem MeetOrderCode.meetGeneratorSteps_iff {P r μ A : ZFSet.{u}} + (code : MeetOrderCode P r μ) (subset : A ⊆ P) (x y : SetMembers P) : + ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ meetGeneratorSteps P μ A ↔ + meetGeneratorStep code.toSmallMeetOrder (fun a => SetMembers.raw a ∈ A) x y := by + rw [pair_mem_meetGeneratorSteps] + constructor + · rintro ⟨_, _, a, ha, entry⟩ + refine ⟨SetMembers.ofMem a (subset ha), ?_, ?_⟩ + · simpa only [SetMembers.raw_ofMem] using ha + · apply Eq.symm + apply (code.toSmallMeetOrder_meet_eq_iff _ _ _).2 + simpa only [SetMembers.raw_ofMem] using entry + · rintro ⟨a, ha, equal⟩ + exact ⟨SetMembers.raw_mem x, SetMembers.raw_mem y, SetMembers.raw a, ha, + (code.toSmallMeetOrder_meet_eq_iff _ _ _).1 equal.symm⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureDensityRecovery.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureDensityRecovery.lean index a682355658ea25265a7c444ca5af7b5568b31150..2bc028a37e3f5a2182ab855640e552331387bcbc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureDensityRecovery.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureDensityRecovery.lean @@ -1,216 +1,216 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPrincipalSupportZF -import OAI.SetTheory.PartitionPrinciple.Forcing.NameFamilySetTransport - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem niceNameCandidates_valid (T : ZFSet.{u}) (K : Subgroup G) : - ∀ z ∈ M.niceNameCandidates a s T K, IsName s z := by - intro z hz - exact niceNameCode_isName a s ((M.mem_niceNameCandidates a s T K z).1 hz).2 - -variable [OrderTop P] - -noncomputable def niceVisibilityName (T : ZFSet.{u}) (K : Subgroup G) : Name s := - Name.familySet ⊤ (M.niceNameCandidates a s T K) (M.niceNameCandidates_valid a s T K) - -theorem niceVisibilityName_code (T : ZFSet.{u}) (K : Subgroup G) : - (M.niceVisibilityName a s T K).val = - ZFSet.prod (M.niceNameCandidates a s T K) {s.encode ⊤} := - Name.familySet_code ⊤ _ _ - -theorem entry_niceVisibilityName (T : ZFSet.{u}) (K : Subgroup G) - (τ : Name s) (p : P) : - Name.Entry τ (M.niceVisibilityName a s T K) p ↔ - τ.val ∈ M.niceNameCandidates a s T K ∧ p = ⊤ := - Name.entry_familySet ⊤ _ _ τ p - -theorem mem_eval_niceVisibilityName (T : ZFSet.{u}) (K : Subgroup G) - (H : Set P) (top : ⊤ ∈ H) (x : ZFSet.{u}) : - x ∈ Name.eval H (M.niceVisibilityName a s T K) ↔ - ∃ τ : Name s, τ.val ∈ M.niceNameCandidates a s T K ∧ Name.eval H τ = x := - Name.mem_eval_familySet H ⊤ top _ _ x - -theorem niceVisibilityName_mem {I : Type u} (t : Presentation G) (b : Presentation I) - (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (i : I) (hi : b.encode i ∈ M.sets) : - (M.niceVisibilityName a s T (K i)).val ∈ M.sets := - M.familySet_mem s ⊤ pairing unions powers separation - (M.niceNameCandidates_mem a s t b K pairing unions powers separation collection - carrier group supports maps hT valid i hi) - (M.transitive carrier (s.encode_mem ⊤)) _ - -theorem niceVisibilityName_support (T : ZFSet.{u}) (K : Subgroup G) : - K ≤ a.stabilizer s (M.niceVisibilityName a s T K) := by - apply Name.familySet_support a _ _ K - intro τ hτ - exact ((M.name_mem_niceNameCandidates a s T K τ).1 hτ).2.2 - -theorem niceVisibilityName_hs (F : NormalSubgroupFamily G) - (T : ZFSet.{u}) (K : Subgroup G) (member : F.mem K) - (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (M.niceVisibilityName a s T K) := by - refine HereditarilySymmetric.mk (F.upward member (M.niceVisibilityName_support a s T K)) ?_ - intro τ p entry - have candidate := ((M.mem_niceNameCandidates a s T K τ.val).1 - ((M.entry_niceVisibilityName a s T K τ p).1 entry).1).2 - exact niceNameCode_hs a s F member children candidate - -theorem niceVisibilityName_principal_hs {L : Type u} [PartialOrder L] - (d : PosetAction G L) (base v : L) - (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) (T : ZFSet.{u}) - (children : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) : - HereditarilySymmetric a s (d.principalSupportFamily base directed) - (M.niceVisibilityName a s T (d.principalFix v)) := - M.niceVisibilityName_hs a s (d.principalSupportFamily base directed) - T (d.principalFix v) ⟨v, le_refl _⟩ children - -theorem act_niceVisibilityName {L : Type u} [PartialOrder L] - (t : Presentation G) (d : PosetAction G L) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - {T : ZFSet.{u}} - (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (g : G) (v : L) : - a.act s g (M.niceVisibilityName a s T (d.principalFix v)) = - M.niceVisibilityName a s T (d.principalFix (d.iso g v)) := by - apply Name.act_familySet_transport a - exact M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation collection - carrier maps closed d g v - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -theorem mix_mem_mixtureCandidates (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) - (τ : Name s) (ground : τ.val ∈ M.sets) (p : P) : - (a.mix s K p τ).val ∈ M.niceNameCandidates a s (M.mixtureTermCodes a s τ) K := by - apply (M.name_mem_niceNameCandidates a s _ K _).2 - exact ⟨M.mix_mem a s t pairing unions powers separation collection carrier order group maps K hK p τ ground, - M.mix_subset_mixtureTermCodes a s τ ground K p, fun _ hg => a.mix_fixed s K p τ hg⟩ - -theorem mixture_candidate_data (F : NormalSubgroupFamily G) (K : Subgroup G) - (member : F.mem K) (τ : Name s) (hs : HereditarilySymmetric a s F τ) - (σ : Name s) (candidate : σ.val ∈ M.niceNameCandidates a s (M.mixtureTermCodes a s τ) K) : - σ.val ∈ M.sets ∧ K ≤ a.stabilizer s σ ∧ HereditarilySymmetric a s F σ ∧ - Name.nameRank σ ≤ Name.nameRank τ := by - have data := (M.name_mem_niceNameCandidates a s _ K σ).1 candidate - refine ⟨data.1, data.2.2, - niceNameCode_hs a s F member (M.mixtureTermCodes_hs a s F τ hs) - ((niceNameCode_iff a s σ).2 data.2), ?_⟩ - change ZFSet.rank (Name.eval Set.univ σ) ≤ Name.nameRank τ - rw [ZFSet.rank_le_iff] - intro value memValue - obtain ⟨ν, p, entry, _, rfl⟩ := (Name.mem_eval Set.univ σ value).1 memValue - exact (Name.rank_eval_le Set.univ ν).trans_lt - (M.mixtureTermCodes_rank a s τ ν (Name.entry_term_of_subset data.2.1 entry)) - -variable [OrderTop P] - -theorem mixture_visibility_mem {I : Type u} (t : Presentation G) (b : Presentation I) - (K : I → Subgroup G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (τ : Name s) (ground : τ.val ∈ M.sets) (i : I) (hi : b.encode i ∈ M.sets) : - (M.niceVisibilityName a s (M.mixtureTermCodes a s τ) (K i)).val ∈ M.sets := - M.niceVisibilityName_mem a s t b K pairing unions powers separation collection carrier group supports maps - (M.mixtureTermCodes_mem a s t pairing unions powers separation collection carrier group maps τ ground) - (M.mixtureTermCodes_valid a s τ) i hi - -theorem mixture_visibility_hs (F : NormalSubgroupFamily G) (K : Subgroup G) - (member : F.mem K) (τ : Name s) (hs : HereditarilySymmetric a s F τ) : - HereditarilySymmetric a s F (M.niceVisibilityName a s (M.mixtureTermCodes a s τ) K) := - M.niceVisibilityName_hs a s F _ K member (M.mixtureTermCodes_hs a s F τ hs) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P I : Type u} [Group G] -variable [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation I) (K : I → Subgroup G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t K ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) - -include pairing unions powers separation collection carrier order group indices supports maps in -theorem forcesMem_mixtureVisibility_of_dense - (i : I) (x : Name s) (ground : x.val ∈ M.sets) (p₀ : P) - (dense : DenseBelow p₀ {p | Name.ForcesEq p x (a.mix s (K i) p x)}) : - Name.ForcesMem p₀ x (M.niceVisibilityName a s (M.mixtureTermCodes a s x) (K i)) := by - have subgroup := M.supportBasis_fiber_mem t b K pairing separation group indices supports i - intro q below - obtain ⟨p, pq, equal⟩ := dense q below - refine ⟨p, pq, a.mix s (K i) p x, ⊤, ?_, le_top, equal⟩ - apply (M.entry_niceVisibilityName a s (M.mixtureTermCodes a s x) (K i) _ ⊤).2 - exact ⟨M.mix_mem_mixtureCandidates a s t pairing unions powers separation collection - carrier order group maps (K i) subgroup x ground p, rfl⟩ - -include pairing unions powers separation collection carrier order group indices supports maps in -theorem exists_mixtureCandidate_of_dense - (F : NormalSubgroupFamily G) (i : I) (member : F.mem (K i)) - (x : Name s) (ground : x.val ∈ M.sets) (symmetric : HereditarilySymmetric a s F x) - (p₀ : P) (dense : DenseBelow p₀ {p | Name.ForcesEq p x (a.mix s (K i) p x)}) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (active : H.mem p₀) : - ∃ z : Name s, - z.val ∈ M.niceNameCandidates a s (M.mixtureTermCodes a s x) (K i) ∧ - z.val ∈ M.sets ∧ HereditarilySymmetric a s F z ∧ - K i ≤ a.stabilizer s z ∧ Name.nameRank z ≤ Name.nameRank x ∧ - Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by - have visibility := M.mixture_visibility_mem a s t b K pairing unions powers separation - collection carrier group supports maps x ground i (M.transitive indices (b.encode_mem i)) - have forced := M.forcesMem_mixtureVisibility_of_dense a s t b K pairing unions powers - separation collection carrier order group indices supports maps i x ground p₀ dense - have atomic : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := - fun E hE => generic E (Or.inl hE) - have value := Name.forcesMem_sound (M.nameDomain s) H atomic ground visibility active forced - obtain ⟨z, candidate, equal⟩ := - (M.mem_eval_niceVisibilityName a s (M.mixtureTermCodes a s x) (K i) - {q | H.mem q} H.top_mem (Name.eval {q | H.mem q} x)).1 value - obtain ⟨groundZ, support, hs, rank⟩ := - M.mixture_candidate_data a s F (K i) member x symmetric z candidate - exact ⟨z, candidate, groundZ, hs, support, rank, equal⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPrincipalSupportZF +import OAI.SetTheory.PartitionPrinciple.Forcing.NameFamilySetTransport + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem niceNameCandidates_valid (T : ZFSet.{u}) (K : Subgroup G) : + ∀ z ∈ M.niceNameCandidates a s T K, IsName s z := by + intro z hz + exact niceNameCode_isName a s ((M.mem_niceNameCandidates a s T K z).1 hz).2 + +variable [OrderTop P] + +noncomputable def niceVisibilityName (T : ZFSet.{u}) (K : Subgroup G) : Name s := + Name.familySet ⊤ (M.niceNameCandidates a s T K) (M.niceNameCandidates_valid a s T K) + +theorem niceVisibilityName_code (T : ZFSet.{u}) (K : Subgroup G) : + (M.niceVisibilityName a s T K).val = + ZFSet.prod (M.niceNameCandidates a s T K) {s.encode ⊤} := + Name.familySet_code ⊤ _ _ + +theorem entry_niceVisibilityName (T : ZFSet.{u}) (K : Subgroup G) + (τ : Name s) (p : P) : + Name.Entry τ (M.niceVisibilityName a s T K) p ↔ + τ.val ∈ M.niceNameCandidates a s T K ∧ p = ⊤ := + Name.entry_familySet ⊤ _ _ τ p + +theorem mem_eval_niceVisibilityName (T : ZFSet.{u}) (K : Subgroup G) + (H : Set P) (top : ⊤ ∈ H) (x : ZFSet.{u}) : + x ∈ Name.eval H (M.niceVisibilityName a s T K) ↔ + ∃ τ : Name s, τ.val ∈ M.niceNameCandidates a s T K ∧ Name.eval H τ = x := + Name.mem_eval_familySet H ⊤ top _ _ x + +theorem niceVisibilityName_mem {I : Type u} (t : Presentation G) (b : Presentation I) + (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (i : I) (hi : b.encode i ∈ M.sets) : + (M.niceVisibilityName a s T (K i)).val ∈ M.sets := + M.familySet_mem s ⊤ pairing unions powers separation + (M.niceNameCandidates_mem a s t b K pairing unions powers separation collection + carrier group supports maps hT valid i hi) + (M.transitive carrier (s.encode_mem ⊤)) _ + +theorem niceVisibilityName_support (T : ZFSet.{u}) (K : Subgroup G) : + K ≤ a.stabilizer s (M.niceVisibilityName a s T K) := by + apply Name.familySet_support a _ _ K + intro τ hτ + exact ((M.name_mem_niceNameCandidates a s T K τ).1 hτ).2.2 + +theorem niceVisibilityName_hs (F : NormalSubgroupFamily G) + (T : ZFSet.{u}) (K : Subgroup G) (member : F.mem K) + (children : ∀ τ : Name s, τ.val ∈ T → HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (M.niceVisibilityName a s T K) := by + refine HereditarilySymmetric.mk (F.upward member (M.niceVisibilityName_support a s T K)) ?_ + intro τ p entry + have candidate := ((M.mem_niceNameCandidates a s T K τ.val).1 + ((M.entry_niceVisibilityName a s T K τ p).1 entry).1).2 + exact niceNameCode_hs a s F member children candidate + +theorem niceVisibilityName_principal_hs {L : Type u} [PartialOrder L] + (d : PosetAction G L) (base v : L) + (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) (T : ZFSet.{u}) + (children : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) : + HereditarilySymmetric a s (d.principalSupportFamily base directed) + (M.niceVisibilityName a s T (d.principalFix v)) := + M.niceVisibilityName_hs a s (d.principalSupportFamily base directed) + T (d.principalFix v) ⟨v, le_refl _⟩ children + +theorem act_niceVisibilityName {L : Type u} [PartialOrder L] + (t : Presentation G) (d : PosetAction G L) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + {T : ZFSet.{u}} + (closed : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (g : G) (v : L) : + a.act s g (M.niceVisibilityName a s T (d.principalFix v)) = + M.niceVisibilityName a s T (d.principalFix (d.iso g v)) := by + apply Name.act_familySet_transport a + exact M.niceNameCandidates_principal_act_iff a s t pairing unions powers separation collection + carrier maps closed d g v + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +theorem mix_mem_mixtureCandidates (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (K : Subgroup G) (hK : t.subset (fun g => g ∈ K) ∈ M.sets) + (τ : Name s) (ground : τ.val ∈ M.sets) (p : P) : + (a.mix s K p τ).val ∈ M.niceNameCandidates a s (M.mixtureTermCodes a s τ) K := by + apply (M.name_mem_niceNameCandidates a s _ K _).2 + exact ⟨M.mix_mem a s t pairing unions powers separation collection carrier order group maps K hK p τ ground, + M.mix_subset_mixtureTermCodes a s τ ground K p, fun _ hg => a.mix_fixed s K p τ hg⟩ + +theorem mixture_candidate_data (F : NormalSubgroupFamily G) (K : Subgroup G) + (member : F.mem K) (τ : Name s) (hs : HereditarilySymmetric a s F τ) + (σ : Name s) (candidate : σ.val ∈ M.niceNameCandidates a s (M.mixtureTermCodes a s τ) K) : + σ.val ∈ M.sets ∧ K ≤ a.stabilizer s σ ∧ HereditarilySymmetric a s F σ ∧ + Name.nameRank σ ≤ Name.nameRank τ := by + have data := (M.name_mem_niceNameCandidates a s _ K σ).1 candidate + refine ⟨data.1, data.2.2, + niceNameCode_hs a s F member (M.mixtureTermCodes_hs a s F τ hs) + ((niceNameCode_iff a s σ).2 data.2), ?_⟩ + change ZFSet.rank (Name.eval Set.univ σ) ≤ Name.nameRank τ + rw [ZFSet.rank_le_iff] + intro value memValue + obtain ⟨ν, p, entry, _, rfl⟩ := (Name.mem_eval Set.univ σ value).1 memValue + exact (Name.rank_eval_le Set.univ ν).trans_lt + (M.mixtureTermCodes_rank a s τ ν (Name.entry_term_of_subset data.2.1 entry)) + +variable [OrderTop P] + +theorem mixture_visibility_mem {I : Type u} (t : Presentation G) (b : Presentation I) + (K : I → Subgroup G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (τ : Name s) (ground : τ.val ∈ M.sets) (i : I) (hi : b.encode i ∈ M.sets) : + (M.niceVisibilityName a s (M.mixtureTermCodes a s τ) (K i)).val ∈ M.sets := + M.niceVisibilityName_mem a s t b K pairing unions powers separation collection carrier group supports maps + (M.mixtureTermCodes_mem a s t pairing unions powers separation collection carrier group maps τ ground) + (M.mixtureTermCodes_valid a s τ) i hi + +theorem mixture_visibility_hs (F : NormalSubgroupFamily G) (K : Subgroup G) + (member : F.mem K) (τ : Name s) (hs : HereditarilySymmetric a s F τ) : + HereditarilySymmetric a s F (M.niceVisibilityName a s (M.mixtureTermCodes a s τ) K) := + M.niceVisibilityName_hs a s F _ K member (M.mixtureTermCodes_hs a s F τ hs) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P I : Type u} [Group G] +variable [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation I) (K : I → Subgroup G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (indices : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t K ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) + +include pairing unions powers separation collection carrier order group indices supports maps in +theorem forcesMem_mixtureVisibility_of_dense + (i : I) (x : Name s) (ground : x.val ∈ M.sets) (p₀ : P) + (dense : DenseBelow p₀ {p | Name.ForcesEq p x (a.mix s (K i) p x)}) : + Name.ForcesMem p₀ x (M.niceVisibilityName a s (M.mixtureTermCodes a s x) (K i)) := by + have subgroup := M.supportBasis_fiber_mem t b K pairing separation group indices supports i + intro q below + obtain ⟨p, pq, equal⟩ := dense q below + refine ⟨p, pq, a.mix s (K i) p x, ⊤, ?_, le_top, equal⟩ + apply (M.entry_niceVisibilityName a s (M.mixtureTermCodes a s x) (K i) _ ⊤).2 + exact ⟨M.mix_mem_mixtureCandidates a s t pairing unions powers separation collection + carrier order group maps (K i) subgroup x ground p, rfl⟩ + +include pairing unions powers separation collection carrier order group indices supports maps in +theorem exists_mixtureCandidate_of_dense + (F : NormalSubgroupFamily G) (i : I) (member : F.mem (K i)) + (x : Name s) (ground : x.val ∈ M.sets) (symmetric : HereditarilySymmetric a s F x) + (p₀ : P) (dense : DenseBelow p₀ {p | Name.ForcesEq p x (a.mix s (K i) p x)}) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (active : H.mem p₀) : + ∃ z : Name s, + z.val ∈ M.niceNameCandidates a s (M.mixtureTermCodes a s x) (K i) ∧ + z.val ∈ M.sets ∧ HereditarilySymmetric a s F z ∧ + K i ≤ a.stabilizer s z ∧ Name.nameRank z ≤ Name.nameRank x ∧ + Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by + have visibility := M.mixture_visibility_mem a s t b K pairing unions powers separation + collection carrier group supports maps x ground i (M.transitive indices (b.encode_mem i)) + have forced := M.forcesMem_mixtureVisibility_of_dense a s t b K pairing unions powers + separation collection carrier order group indices supports maps i x ground p₀ dense + have atomic : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := + fun E hE => generic E (Or.inl hE) + have value := Name.forcesMem_sound (M.nameDomain s) H atomic ground visibility active forced + obtain ⟨z, candidate, equal⟩ := + (M.mem_eval_niceVisibilityName a s (M.mixtureTermCodes a s x) (K i) + {q | H.mem q} H.top_mem (Name.eval {q | H.mem q} x)).1 value + obtain ⟨groundZ, support, hs, rank⟩ := + M.mixture_candidate_data a s F (K i) member x symmetric z candidate + exact ⟨z, candidate, groundZ, hs, support, rank, equal⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureTermBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureTermBounds.lean index 45b74279bc09dad821181717c94c7c2934784adc..f54e5673cc894afad8128a8d2f68d70130c3c8ba 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureTermBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundMixtureTermBounds.lean @@ -1,122 +1,122 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.OrbitImageFormulas - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) - -theorem orbitCodes_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (W : ZFSet.{u}) (hW : W ∈ M.sets) : a.orbitCodes s (M.nameDomain s) W ∈ M.sets := by - obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers group hW - apply M.definable_image_mem separation collection orbitImageFormula (orbitParameters a s t W) - (Fin.cases hW (Fin.cases carrier (Fin.cases group (Fin.cases maps (fun i => Fin.elim0 i))))) hB - · intro y hy - obtain ⟨g, σ, hσ, _, rfl⟩ := (a.mem_orbitCodes s (M.nameDomain s) W y).1 hy - exact M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ - · intro y hy - rw [a.mem_orbitCodes] - constructor - · rintro ⟨g, σ, hσ, hσW, eq⟩ - have hb := pairBound (t.encode g) (t.encode_mem g) σ.val hσW - exact ⟨ZFSet.pair (t.encode g) σ.val, hb, - (M.realize_orbitImageFormula a s t pairing unions powers separation collection carrier group maps W _ y - (M.transitive hB hb) hy).2 ⟨g, ⟨σ, hσ⟩, hσW, rfl, eq⟩⟩ - · rintro ⟨z, hz, rel⟩ - obtain ⟨g, σ, hσW, _, eq⟩ := (M.realize_orbitImageFormula a s t pairing unions powers separation collection - carrier group maps W z y (M.transitive hB hz) hy).1 rel - exact ⟨g, σ.val, σ.property, hσW, eq⟩ - · intro z hz y hy w hw rely relw - obtain ⟨g, σ, _, shape, eqy⟩ := (M.realize_orbitImageFormula a s t pairing unions powers separation collection - carrier group maps W z y (M.transitive hB hz) hy).1 rely - obtain ⟨h, τ, _, shape', eqw⟩ := (M.realize_orbitImageFormula a s t pairing unions powers separation collection - carrier group maps W z w (M.transitive hB hz) hw).1 relw - have parts := ZFSet.pair_inj.1 (shape.symm.trans shape') - have gh := t.injective parts.1 - have names : σ.val = τ.val := Subtype.ext parts.2 - rw [eqy, eqw, gh, names] - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -noncomputable def mixtureTermCodes (τ : Name s) : ZFSet.{u} := - a.orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) - -theorem mixtureTermCodes_mem (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (τ : Name s) (ground : τ.val ∈ M.sets) : - M.mixtureTermCodes a s τ ∈ M.sets := - M.orbitCodes_mem a s t pairing unions powers separation collection carrier group maps _ - (M.immediateChildCodes_mem s pairing unions powers separation carrier τ ground) - -theorem mixtureTermCodes_valid (τ : Name s) : - ∀ y ∈ M.mixtureTermCodes a s τ, IsName s y := by - intro y member - obtain ⟨g, σ, _, _, rfl⟩ := - (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) y).1 member - exact (a.act s g σ).property - -theorem mixtureTermCodes_closed (τ : Name s) (g : G) (σ : Name s) - (member : σ.val ∈ M.mixtureTermCodes a s τ) : - (a.act s g σ).val ∈ M.mixtureTermCodes a s τ := - (a.act_mem_orbitCodes_iff s (M.nameDomain s) (Name.immediateChildCodes τ) g σ).2 member - -theorem mixtureTermCodes_hs (F : NormalSubgroupFamily G) (τ : Name s) - (hs : HereditarilySymmetric a s F τ) (ψ : Name s) - (member : ψ.val ∈ M.mixtureTermCodes a s τ) : HereditarilySymmetric a s F ψ := by - obtain ⟨g, σ, _, child, equal⟩ := - (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) ψ.val).1 member - obtain ⟨ν, p, entry, childEqual⟩ := (Name.mem_immediateChildCodes τ σ.val).1 child - have source : σ = ν := Subtype.ext childEqual - subst σ - have moved : ψ = a.act s g ν := Subtype.ext equal - rw [moved] - exact (hs.member entry).translated g - -theorem mixtureTermCodes_rank (τ ψ : Name s) - (member : ψ.val ∈ M.mixtureTermCodes a s τ) : Name.nameRank ψ < Name.nameRank τ := by - obtain ⟨g, σ, _, child, equal⟩ := - (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) ψ.val).1 member - obtain ⟨ν, p, entry, childEqual⟩ := (Name.mem_immediateChildCodes τ σ.val).1 child - have source : σ = ν := Subtype.ext childEqual - subst σ - have moved : ψ = a.act s g ν := Subtype.ext equal - rw [moved, a.nameRank_act] - exact Name.entry_nameRank_lt entry - -theorem mix_subset_mixtureTermCodes (τ : Name s) (ground : τ.val ∈ M.sets) - (K : Subgroup G) (p : P) : - (a.mix s K p τ).val ⊆ ZFSet.prod (M.mixtureTermCodes a s τ) s.carrier := by - intro z member - obtain ⟨σ, q, rfl⟩ := Name.entries_cover (a.mix s K p τ) member - obtain ⟨g, _, ν, r, entry, rfl, _, _⟩ := (a.entry_mix s K p τ σ q).1 member - refine ZFSet.pair_mem_prod.2 ⟨?_, s.encode_mem q⟩ - exact (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) _).2 - ⟨g, ν, (M.nameDomain s).children ground entry, - (Name.mem_immediateChildCodes τ ν.val).2 ⟨ν, r, entry, rfl⟩, rfl⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.OrbitImageFormulas + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) + +theorem orbitCodes_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (W : ZFSet.{u}) (hW : W ∈ M.sets) : a.orbitCodes s (M.nameDomain s) W ∈ M.sets := by + obtain ⟨B, hB, pairBound⟩ := M.exists_pair_bound pairing unions powers group hW + apply M.definable_image_mem separation collection orbitImageFormula (orbitParameters a s t W) + (Fin.cases hW (Fin.cases carrier (Fin.cases group (Fin.cases maps (fun i => Fin.elim0 i))))) hB + · intro y hy + obtain ⟨g, σ, hσ, _, rfl⟩ := (a.mem_orbitCodes s (M.nameDomain s) W y).1 hy + exact M.act_mem s a t pairing unions powers separation collection carrier maps g σ hσ + · intro y hy + rw [a.mem_orbitCodes] + constructor + · rintro ⟨g, σ, hσ, hσW, eq⟩ + have hb := pairBound (t.encode g) (t.encode_mem g) σ.val hσW + exact ⟨ZFSet.pair (t.encode g) σ.val, hb, + (M.realize_orbitImageFormula a s t pairing unions powers separation collection carrier group maps W _ y + (M.transitive hB hb) hy).2 ⟨g, ⟨σ, hσ⟩, hσW, rfl, eq⟩⟩ + · rintro ⟨z, hz, rel⟩ + obtain ⟨g, σ, hσW, _, eq⟩ := (M.realize_orbitImageFormula a s t pairing unions powers separation collection + carrier group maps W z y (M.transitive hB hz) hy).1 rel + exact ⟨g, σ.val, σ.property, hσW, eq⟩ + · intro z hz y hy w hw rely relw + obtain ⟨g, σ, _, shape, eqy⟩ := (M.realize_orbitImageFormula a s t pairing unions powers separation collection + carrier group maps W z y (M.transitive hB hz) hy).1 rely + obtain ⟨h, τ, _, shape', eqw⟩ := (M.realize_orbitImageFormula a s t pairing unions powers separation collection + carrier group maps W z w (M.transitive hB hz) hw).1 relw + have parts := ZFSet.pair_inj.1 (shape.symm.trans shape') + have gh := t.injective parts.1 + have names : σ.val = τ.val := Subtype.ext parts.2 + rw [eqy, eqw, gh, names] + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +noncomputable def mixtureTermCodes (τ : Name s) : ZFSet.{u} := + a.orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) + +theorem mixtureTermCodes_mem (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (τ : Name s) (ground : τ.val ∈ M.sets) : + M.mixtureTermCodes a s τ ∈ M.sets := + M.orbitCodes_mem a s t pairing unions powers separation collection carrier group maps _ + (M.immediateChildCodes_mem s pairing unions powers separation carrier τ ground) + +theorem mixtureTermCodes_valid (τ : Name s) : + ∀ y ∈ M.mixtureTermCodes a s τ, IsName s y := by + intro y member + obtain ⟨g, σ, _, _, rfl⟩ := + (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) y).1 member + exact (a.act s g σ).property + +theorem mixtureTermCodes_closed (τ : Name s) (g : G) (σ : Name s) + (member : σ.val ∈ M.mixtureTermCodes a s τ) : + (a.act s g σ).val ∈ M.mixtureTermCodes a s τ := + (a.act_mem_orbitCodes_iff s (M.nameDomain s) (Name.immediateChildCodes τ) g σ).2 member + +theorem mixtureTermCodes_hs (F : NormalSubgroupFamily G) (τ : Name s) + (hs : HereditarilySymmetric a s F τ) (ψ : Name s) + (member : ψ.val ∈ M.mixtureTermCodes a s τ) : HereditarilySymmetric a s F ψ := by + obtain ⟨g, σ, _, child, equal⟩ := + (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) ψ.val).1 member + obtain ⟨ν, p, entry, childEqual⟩ := (Name.mem_immediateChildCodes τ σ.val).1 child + have source : σ = ν := Subtype.ext childEqual + subst σ + have moved : ψ = a.act s g ν := Subtype.ext equal + rw [moved] + exact (hs.member entry).translated g + +theorem mixtureTermCodes_rank (τ ψ : Name s) + (member : ψ.val ∈ M.mixtureTermCodes a s τ) : Name.nameRank ψ < Name.nameRank τ := by + obtain ⟨g, σ, _, child, equal⟩ := + (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) ψ.val).1 member + obtain ⟨ν, p, entry, childEqual⟩ := (Name.mem_immediateChildCodes τ σ.val).1 child + have source : σ = ν := Subtype.ext childEqual + subst σ + have moved : ψ = a.act s g ν := Subtype.ext equal + rw [moved, a.nameRank_act] + exact Name.entry_nameRank_lt entry + +theorem mix_subset_mixtureTermCodes (τ : Name s) (ground : τ.val ∈ M.sets) + (K : Subgroup G) (p : P) : + (a.mix s K p τ).val ⊆ ZFSet.prod (M.mixtureTermCodes a s τ) s.carrier := by + intro z member + obtain ⟨σ, q, rfl⟩ := Name.entries_cover (a.mix s K p τ) member + obtain ⟨g, _, ν, r, entry, rfl, _, _⟩ := (a.entry_mix s K p τ σ q).1 member + refine ZFSet.pair_mem_prod.2 ⟨?_, s.encode_mem q⟩ + exact (a.mem_orbitCodes s (M.nameDomain s) (Name.immediateChildCodes τ) _).2 + ⟨g, ν, (M.nameDomain s).children ground entry, + (Name.mem_immediateChildCodes τ ν.val).2 ⟨ν, r, entry, rfl⟩, rfl⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalFamilyShift.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalFamilyShift.lean index d061e3cf51067d691bf46ac7e468c6a52cabe0b1..2d935c37d5f86366db07a618c18e81b2a0b42450 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalFamilyShift.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalFamilyShift.lean @@ -1,447 +1,447 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologicalBasis - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -universe u - -noncomputable def heightColumnFiber (S C Q h c : ZFSet.{u}) : ZFSet.{u} := - relationImage (ZFSet.prod {c} Q) S (relationConverse S (ZFSet.prod C Q) h) - -noncomputable def heightColumnGraph (S C Q h c : ZFSet.{u}) : ZFSet.{u} := - relationCompose S (ZFSet.prod C Q) Q h (productSecond {c} Q) - -theorem mem_heightColumnFiber (S C Q h c i : ZFSet.{u}) : - i ∈ heightColumnFiber S C Q h c ↔ - i ∈ S ∧ c ∈ C ∧ ∃ q ∈ Q, ZFSet.pair i (ZFSet.pair c q) ∈ h := by - rw [heightColumnFiber, mem_relationImage] - constructor - · rintro ⟨hi, v, hv, vi⟩ - obtain ⟨a, ha, q, hq, rfl⟩ := ZFSet.mem_prod.1 hv - have ac := ZFSet.mem_singleton.1 ha - subst a - have rel := (pair_mem_relationConverse S (ZFSet.prod C Q) h i (ZFSet.pair c q)).1 vi - exact ⟨hi, (ZFSet.pair_mem_prod.1 rel.2.1).1, q, hq, rel.2.2⟩ - · rintro ⟨hi, hc, q, hq, iq⟩ - exact ⟨hi, ZFSet.pair c q, ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hq⟩, - (pair_mem_relationConverse S (ZFSet.prod C Q) h i (ZFSet.pair c q)).2 - ⟨hi, ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, iq⟩⟩ - -theorem pair_mem_heightColumnGraph (S C Q h c i q : ZFSet.{u}) : - ZFSet.pair i q ∈ heightColumnGraph S C Q h c ↔ - i ∈ S ∧ c ∈ C ∧ q ∈ Q ∧ ZFSet.pair i (ZFSet.pair c q) ∈ h := by - rw [heightColumnGraph, pair_mem_relationCompose] - constructor - · rintro ⟨hi, hq, v, hv, iv, vq⟩ - obtain ⟨a, ha, b, _, eq⟩ := (mem_productSecond {c} Q (ZFSet.pair v q)).1 vq - have ac := ZFSet.mem_singleton.1 ha - subst a - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hi, (ZFSet.pair_mem_prod.1 hv).1, hq, iv⟩ - · rintro ⟨hi, hc, hq, iq⟩ - exact ⟨hi, hq, ZFSet.pair c q, ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, iq, - (mem_productSecond {c} Q _).2 ⟨c, ZFSet.mem_singleton.2 rfl, q, hq, rfl⟩⟩ - -theorem heightColumnGraph_injection {S C Q h : ZFSet.{u}} - (height : InjectionCode S (ZFSet.prod C Q) h) (c : ZFSet.{u}) : - InjectionCode (heightColumnFiber S C Q h c) Q (heightColumnGraph S C Q h c) := by - refine ⟨⟨?_, ?_⟩, ?_⟩ - · intro z hz - have shape : z ∈ ZFSet.prod S Q := (ZFSet.mem_sep.1 - (show z ∈ relationCompose S (ZFSet.prod C Q) Q h (productSecond {c} Q) from hz)).1 - obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 shape - obtain ⟨_, hc, _, iq⟩ := (pair_mem_heightColumnGraph S C Q h c i q).1 hz - exact ZFSet.pair_mem_prod.2 - ⟨(mem_heightColumnFiber S C Q h c i).2 ⟨hi, hc, q, hq, iq⟩, hq⟩ - · intro i hi - obtain ⟨hiS, hc, q, hq, iq⟩ := (mem_heightColumnFiber S C Q h c i).1 hi - refine ⟨q, (pair_mem_heightColumnGraph S C Q h c i q).2 ⟨hiS, hc, hq, iq⟩, ?_⟩ - intro r ir - have irh := (pair_mem_heightColumnGraph S C Q h c i r).1 ir - obtain ⟨v, _, unique⟩ := height.function.2 i hiS - exact (ZFSet.pair_inj.1 ((unique _ irh.2.2.2).trans (unique _ iq).symm)).2 - · intro i j q iq jq - exact height.injective i j (ZFSet.pair c q) - ((pair_mem_heightColumnGraph S C Q h c i q).1 iq).2.2.2 - ((pair_mem_heightColumnGraph S C Q h c j q).1 jq).2.2.2 - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem heightColumnFiber_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {S C Q h c : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) - (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (hc : c ∈ M.sets) : - heightColumnFiber S C Q h c ∈ M.sets := by - have singleton : ({c} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hc hc - exact M.relationImage_mem separation - (M.prod_mem pairing unions powers separation singleton hQ) hS - (M.relationConverse_mem pairing unions powers separation hS - (M.prod_mem pairing unions powers separation hC hQ) hh) - -theorem heightColumnGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {S C Q h c : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) - (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (hc : c ∈ M.sets) : - heightColumnGraph S C Q h c ∈ M.sets := by - have singleton : ({c} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hc hc - exact M.relationCompose_mem pairing unions powers separation hS - (M.prod_mem pairing unions powers separation hC hQ) hQ hh - (M.productSecond_mem pairing unions powers separation singleton hQ) - -theorem groundEmbeddable_heightColumnFiber - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {S C Q h c N : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) - (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (hc : c ∈ M.sets) (hN : N ∈ M.sets) - (height : InjectionCode S (ZFSet.prod C Q) h) (small : M.groundEmbeddable Q N) : - M.groundEmbeddable (heightColumnFiber S C Q h c) N := by - obtain ⟨f, hf, code⟩ := small - exact ⟨relationCompose (heightColumnFiber S C Q h c) Q N (heightColumnGraph S C Q h c) f, - M.relationCompose_mem pairing unions powers separation - (M.heightColumnFiber_mem pairing unions powers separation hS hC hQ hh hc) hQ hN - (M.heightColumnGraph_mem pairing unions powers separation hS hC hQ hh hc) hf, - (heightColumnGraph_injection height c).compose code⟩ - -end TransitiveGround - -end - - - -section - -open SetRealization -universe u - -theorem ordinalSetProperty_mem_compare {T i j : ZFSet.{u}} - (ordinal : ordinalSetProperty T) (hi : i ∈ T) (hj : j ∈ T) : - i ∈ j ∨ i = j ∨ j ∈ i := by - obtain ⟨a, rfl⟩ := (ordinalSetProperty_iff i).1 (ordinalSetProperty_member ordinal hi) - obtain ⟨b, rfl⟩ := (ordinalSetProperty_iff j).1 (ordinalSetProperty_member ordinal hj) - rcases lt_trichotomy a b with less | eq | greater - · exact Or.inl ((mem_ordinalCode_iff a b).2 less) - · exact Or.inr (Or.inl (congrArg ordinalCode eq)) - · exact Or.inr (Or.inr ((mem_ordinalCode_iff b a).2 greater)) - -theorem ordinalSubset_has_least {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) - {S : Set ZFSet.{u}} (subset : ∀ i ∈ S, i ∈ T) (inhabited : S.Nonempty) : - ∃ i ∈ S, ∀ j ∈ S, i = j ∨ i ∈ j := by - obtain ⟨i, hi, minimal⟩ := ZFSet.mem_wf.has_min S inhabited - refine ⟨i, hi, ?_⟩ - intro j hj - rcases ordinalSetProperty_mem_compare ordinal (subset i hi) (subset j hj) with h | h | h - · exact Or.inr h - · exact Or.inl h - · exact False.elim (minimal j hj h) - -noncomputable def ordinalIndexTail (S i : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun j => i = j ∨ i ∈ j) S - -theorem mem_ordinalIndexTail (S i j : ZFSet.{u}) : - j ∈ ordinalIndexTail S i ↔ j ∈ S ∧ (i = j ∨ i ∈ j) := ZFSet.mem_sep - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem ordinalIndexTail_mem (separation : SeparationSchema M.sets) - {S i : ZFSet.{u}} (hS : S ∈ M.sets) (hi : i ∈ M.sets) : - ordinalIndexTail S i ∈ M.sets := by - have selected := M.bounded_separation_mem separation (.disj (.equal 1 0) (.mem 1 0)) - (extend i Fin.elim0) (Fin.cases hi (fun j => Fin.elim0 j)) hS - simpa only [BoundedFormula.truth_disj, BoundedFormula.Truth, extend, Fin.cases_zero, - show (1 : Fin 2) = Fin.succ 0 from rfl, Fin.cases_succ, ordinalIndexTail] using selected - -theorem groundCountable_descending_heights - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {S T C Q h : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) - (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (subset : S ⊆ T) - (ordinal : ordinalSetProperty T) (height : InjectionCode S (ZFSet.prod C Q) h) - (smallQ : M.groundEmbeddable Q ZFSet.omega) - (antitone : ∀ i ∈ S, ∀ j ∈ S, i ∈ j → ∀ c q d r, - ZFSet.pair i (ZFSet.pair c q) ∈ h → ZFSet.pair j (ZFSet.pair d r) ∈ h → - d = c ∨ d ∈ c) : - M.groundEmbeddable S ZFSet.omega := by - classical - have hOmega := M.omega_mem separation infinite - have tails : ∀ c, ∀ i ∈ S, ∀ q, ZFSet.pair i (ZFSet.pair c q) ∈ h → - M.groundEmbeddable (ordinalIndexTail S i) ZFSet.omega := by - intro c - induction c using ZFSet.inductionOn with - | h c ih => - intro i hi q iq - have hc := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 iq)).2).1 - have groundTail := M.ordinalIndexTail_mem separation hS (M.transitive hS hi) - have groundFiber := M.heightColumnFiber_mem pairing unions powers separation hS hC hQ hh - (M.transitive hC hc) - have smallFiber := M.groundEmbeddable_heightColumnFiber pairing unions powers separation - hS hC hQ hh (M.transitive hC hc) hOmega height smallQ - have columnBelow (k : ZFSet.{u}) (hk : k ∈ S) (later : i = k ∨ i ∈ k) - (d r : ZFSet.{u}) (kr : ZFSet.pair k (ZFSet.pair d r) ∈ h) : d = c ∨ d ∈ c := by - rcases later with rfl | later - · obtain ⟨_, _, unique⟩ := height.function.2 i hi - exact Or.inl (ZFSet.pair_inj.1 ((unique _ kr).trans (unique _ iq).symm)).1 - · exact antitone i hi k hk later c q d r iq kr - let lower : Set ZFSet.{u} := {j | j ∈ S ∧ (i = j ∨ i ∈ j) ∧ - ∃ d r, d ∈ c ∧ ZFSet.pair j (ZFSet.pair d r) ∈ h} - by_cases inhabited : lower.Nonempty - · obtain ⟨j, hj, minimal⟩ := ordinalSubset_has_least ordinal - (fun k hk => subset hk.1) inhabited - obtain ⟨hjS, _, d, r, dc, jr⟩ := hj - have smallLater := ih d dc j hjS r jr - have smallUnion := M.groundCountable_binary_union pairing unions powers separation - infinite choice groundFiber (M.ordinalIndexTail_mem separation hS (M.transitive hS hjS)) - smallFiber smallLater - apply M.groundEmbeddable_restrict separation groundTail hOmega _ smallUnion - intro k hk - obtain ⟨hkS, later⟩ := (mem_ordinalIndexTail S i k).1 hk - obtain ⟨v, kv, _⟩ := height.function.2 k hkS - obtain ⟨e, he, s, hs, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 kv)).2 - rcases columnBelow k hkS later e s kv with eq | less - · subst e - exact ZFSet.mem_union.2 (Or.inl - ((mem_heightColumnFiber S C Q h c k).2 ⟨hkS, he, s, hs, kv⟩)) - · have klower : k ∈ lower := ⟨hkS, later, e, s, less, kv⟩ - exact ZFSet.mem_union.2 (Or.inr - ((mem_ordinalIndexTail S j k).2 ⟨hkS, minimal k klower⟩)) - · apply M.groundEmbeddable_restrict separation groundTail hOmega _ smallFiber - intro k hk - obtain ⟨hkS, later⟩ := (mem_ordinalIndexTail S i k).1 hk - obtain ⟨v, kv, _⟩ := height.function.2 k hkS - obtain ⟨e, he, s, hs, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 kv)).2 - rcases columnBelow k hkS later e s kv with eq | less - · subst e - exact (mem_heightColumnFiber S C Q h c k).2 ⟨hkS, he, s, hs, kv⟩ - · exact False.elim (inhabited ⟨k, hkS, later, e, s, less, kv⟩) - by_cases inhabited : (S.toSet).Nonempty - · obtain ⟨i, hi, minimal⟩ := ordinalSubset_has_least ordinal (fun _ hx => subset hx) inhabited - obtain ⟨v, iv, _⟩ := height.function.2 i hi - obtain ⟨c, _, q, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 iv)).2 - exact M.groundEmbeddable_restrict separation hS hOmega - (fun j hj => (mem_ordinalIndexTail S i j).2 ⟨hj, minimal j hj⟩) (tails c i hi q iv) - · have empty : S = ∅ := by - apply ZFSet.ext - intro x - exact ⟨fun hx => False.elim (inhabited ⟨x, hx⟩), - fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ - rw [empty] - exact M.empty_groundEmbeddable ZFSet.omega ⟨S, hS⟩ - -end TransitiveGround - - - - - - -def EssentialHeightDescent (E birth height qlt : ZFSet.{u}) : Prop := - ∀ x ∈ E, ∀ y ∈ E, ∀ i j c q d v, - ZFSet.pair x i ∈ birth → ZFSet.pair y j ∈ birth → i ∈ j → - ZFSet.pair x (ZFSet.pair c q) ∈ height → ZFSet.pair y (ZFSet.pair d v) ∈ height → - d ∈ c ∨ (d = c ∧ ZFSet.pair v q ∈ qlt) - -theorem relationCompose_function_of_subset {A B D C f g : ZFSet.{u}} - (first : ZFSet.IsFunc A B f) (second : ZFSet.IsFunc D C g) (subset : B ⊆ D) : - ZFSet.IsFunc A C (relationCompose A B C f g) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨y, xy, uniqueY⟩ := first.2 x hx - have hy := (ZFSet.pair_mem_prod.1 (first.1 xy)).2 - obtain ⟨z, yz, uniqueZ⟩ := second.2 y (subset hy) - have hz := (ZFSet.pair_mem_prod.1 (second.1 yz)).2 - refine ⟨z, (pair_mem_relationCompose A B C f g x z).2 ⟨hx, hz, y, hy, xy, yz⟩, ?_⟩ - intro w hw - obtain ⟨_, _, y', _, xy', y'w⟩ := (pair_mem_relationCompose A B C f g x w).1 hw - exact uniqueZ w (uniqueY y' xy' ▸ y'w) - -theorem essentialHeightComposite_strict {S E C Q birth reps height qlt : ZFSet.{u}} - (representatives : reps ⊆ relationConverse E S birth) - (descent : EssentialHeightDescent E birth height qlt) - {i j c q d v : ZFSet.{u}} (earlier : i ∈ j) - (first : ZFSet.pair i (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height) - (second : ZFSet.pair j (ZFSet.pair d v) ∈ relationCompose S E (ZFSet.prod C Q) reps height) : - d ∈ c ∨ (d = c ∧ ZFSet.pair v q ∈ qlt) := by - obtain ⟨_, _, x, hx, ix, xheight⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first - obtain ⟨_, _, y, hy, jy, yheight⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 second - have xi := (pair_mem_relationConverse E S birth x i).1 (representatives ix) - have yj := (pair_mem_relationConverse E S birth y j).1 (representatives jy) - exact descent x hx y hy i j c q d v xi.2.2 yj.2.2 earlier xheight yheight - -theorem essentialHeightComposite_antitone {S E C Q birth reps height qlt : ZFSet.{u}} - (representatives : reps ⊆ relationConverse E S birth) - (descent : EssentialHeightDescent E birth height qlt) : - ∀ i ∈ S, ∀ j ∈ S, i ∈ j → ∀ c q d v, - ZFSet.pair i (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height → - ZFSet.pair j (ZFSet.pair d v) ∈ relationCompose S E (ZFSet.prod C Q) reps height → - d = c ∨ d ∈ c := by - intro i _ j _ earlier c q d v first second - exact (essentialHeightComposite_strict representatives descent earlier first second).elim - Or.inr (fun h => Or.inl h.1) - -theorem essentialHeightComposite_injection {L S T E C Q birth reps height qlt : ZFSet.{u}} - (stages : S ⊆ T) (ordinal : ordinalSetProperty T) - (representatives : ZFSet.IsFunc S E reps) - (chosenBirths : reps ⊆ relationConverse E S birth) - (points : E ⊆ L) (heights : ZFSet.IsFunc L (ZFSet.prod C Q) height) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - (descent : EssentialHeightDescent E birth height qlt) : - InjectionCode S (ZFSet.prod C Q) (relationCompose S E (ZFSet.prod C Q) reps height) := by - have function := relationCompose_function_of_subset representatives heights points - refine ⟨function, ?_⟩ - intro i j z first second - have iShape := ZFSet.pair_mem_prod.1 (function.1 first) - have jShape := ZFSet.pair_mem_prod.1 (function.1 second) - obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 iShape.2 - have notEarlier (a b : ZFSet.{u}) - (aHeight : ZFSet.pair a (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height) - (bHeight : ZFSet.pair b (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height) : a ∉ b := by - intro earlier - rcases essentialHeightComposite_strict chosenBirths descent earlier aHeight bHeight with h | h - · exact ZFSet.mem_irrefl c h - · exact irreflexive q hq h.2 - have eqI := ordinalSetProperty_eq_code_rank i (ordinalSetProperty_member ordinal (stages iShape.1)) - have eqJ := ordinalSetProperty_eq_code_rank j (ordinalSetProperty_member ordinal (stages jShape.1)) - rcases lt_trichotomy (ZFSet.rank i) (ZFSet.rank j) with earlier | equal | later - · have ij : i ∈ j := by rw [eqI, eqJ, mem_ordinalCode_iff]; exact earlier - exact False.elim (notEarlier i j first second ij) - · exact eqI.trans ((congrArg ordinalCode equal).trans eqJ.symm) - · have ji : j ∈ i := by rw [eqJ, eqI, mem_ordinalCode_iff]; exact later - exact False.elim (notEarlier j i second first ji) - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem exists_essentialBirthHeights - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {L F T r birth C Q height qlt : ZFSet.{u}} - (hF : F ∈ M.sets) (hT : T ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) - (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hHeight : height ∈ M.sets) - (positive : F ⊆ L) (ordinal : ordinalSetProperty T) - (heights : ZFSet.IsFunc L (ZFSet.prod C Q) height) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - (descent : EssentialHeightDescent (birthEssentialSet F T r birth) birth height qlt) : - ∃ h ∈ M.sets, - InjectionCode (essentialBirthIndices F T r birth) (ZFSet.prod C Q) h ∧ - (∀ i ∈ essentialBirthIndices F T r birth, ∀ j ∈ essentialBirthIndices F T r birth, - i ∈ j → ∀ c q d v, - ZFSet.pair i (ZFSet.pair c q) ∈ h → ZFSet.pair j (ZFSet.pair d v) ∈ h → - d = c ∨ d ∈ c) ∧ - ∀ i z, ZFSet.pair i z ∈ h → ∃ x ∈ birthEssentialSet F T r birth, - ZFSet.pair x i ∈ birth ∧ ZFSet.pair x z ∈ height := by - let E := birthEssentialSet F T r birth - let S := essentialBirthIndices F T r birth - have hE := M.birthEssentialSet_mem separation hF hT hr hBirth - have hS := M.essentialBirthIndices_mem separation hF hT hr hBirth - obtain ⟨reps, hReps, function, chosen, _⟩ := - M.exists_essentialBirthRepresentatives pairing unions powers separation choice hF hT hr hBirth - let h := relationCompose S E (ZFSet.prod C Q) reps height - have ground : h ∈ M.sets := M.relationCompose_mem pairing unions powers separation hS hE - (M.prod_mem pairing unions powers separation hC hQ) hReps hHeight - have subset : S ⊆ T := fun _ hi => (mem_essentialBirthIndices F T r birth _).1 hi |>.1 - have points : E ⊆ L := fun _ hx => positive (birthEssentialSet_subset F T r birth hx) - refine ⟨h, ground, essentialHeightComposite_injection subset ordinal function chosen points heights - irreflexive descent, essentialHeightComposite_antitone chosen descent, ?_⟩ - intro i z hiz - obtain ⟨_, _, x, hx, ix, xz⟩ := (pair_mem_relationCompose S E (ZFSet.prod C Q) reps height i z).1 hiz - exact ⟨x, hx, ((pair_mem_relationConverse E S birth x i).1 (chosen ix)).2.2, xz⟩ - -theorem essentialBirthIndices_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {L F T r birth C Q height qlt : ZFSet.{u}} - (hF : F ∈ M.sets) (hT : T ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) - (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hHeight : height ∈ M.sets) - (positive : F ⊆ L) (ordinal : ordinalSetProperty T) - (heights : ZFSet.IsFunc L (ZFSet.prod C Q) height) - (smallQ : M.groundEmbeddable Q ZFSet.omega) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - (descent : EssentialHeightDescent (birthEssentialSet F T r birth) birth height qlt) : - M.groundEmbeddable (essentialBirthIndices F T r birth) ZFSet.omega := by - obtain ⟨h, hh, injection, antitone, _⟩ := M.exists_essentialBirthHeights pairing unions powers - separation choice hF hT hr hBirth hC hQ hHeight positive ordinal heights irreflexive descent - exact M.groundCountable_descending_heights pairing unions powers separation infinite choice - (M.essentialBirthIndices_mem separation hF hT hr hBirth) hC hQ hh - (fun _ hi => ((mem_essentialBirthIndices F T r birth _).1 hi).1) - ordinal injection smallQ antitone - -end TransitiveGround - -end - - - -open SetFormula -universe u - -noncomputable def naturalFamilyShift (family : ZFSet.{u}) : ZFSet.{u} := - relationCompose ZFSet.omega ZFSet.omega family.sUnion.sUnion natSuccessorGraph family - -theorem naturalFamilyShift_entries (family : ZFSet.{u}) (n : Nat) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode n) y ∈ naturalFamilyShift family ↔ - ZFSet.pair (natSetCode (n + 1)) y ∈ family := by - rw [naturalFamilyShift, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, k, hk, next, entry⟩ - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - exact (pair_mem_natSuccessorGraph n k).1 next ▸ entry - · intro entry - exact ⟨natSetCode_mem_omega n, pair_second_mem_doubleUnion entry, - natSetCode (n + 1), natSetCode_mem_omega (n + 1), - (pair_mem_natSuccessorGraph n (n + 1)).2 rfl, entry⟩ - -theorem naturalFamilyShift_function {family : ZFSet.{u}} - (function : FunctionGraphOn ZFSet.omega family) : - FunctionGraphOn ZFSet.omega (naturalFamilyShift family) := by - have bounded : ZFSet.IsFunc ZFSet.omega family.sUnion.sUnion family := by - refine ⟨?_, function.to_isFunc.2⟩ - intro z hz - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (function.to_isFunc.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, pair_second_mem_doubleUnion hz⟩ - exact ⟨_, relationCompose_function_of_subset natSuccessorGraph_isFunc bounded (fun _ h => h)⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem naturalFamilyShift_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {family : ZFSet.{u}} (hFamily : family ∈ M.sets) : naturalFamilyShift family ∈ M.sets := - M.relationCompose_mem pairing unions powers separation (M.omega_mem separation infinite) - (M.omega_mem separation infinite) (M.union_mem unions (M.union_mem unions hFamily)) - (M.natSuccessorGraph_mem pairing unions powers separation infinite) hFamily - -end TransitiveGround - - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologicalBasis + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +universe u + +noncomputable def heightColumnFiber (S C Q h c : ZFSet.{u}) : ZFSet.{u} := + relationImage (ZFSet.prod {c} Q) S (relationConverse S (ZFSet.prod C Q) h) + +noncomputable def heightColumnGraph (S C Q h c : ZFSet.{u}) : ZFSet.{u} := + relationCompose S (ZFSet.prod C Q) Q h (productSecond {c} Q) + +theorem mem_heightColumnFiber (S C Q h c i : ZFSet.{u}) : + i ∈ heightColumnFiber S C Q h c ↔ + i ∈ S ∧ c ∈ C ∧ ∃ q ∈ Q, ZFSet.pair i (ZFSet.pair c q) ∈ h := by + rw [heightColumnFiber, mem_relationImage] + constructor + · rintro ⟨hi, v, hv, vi⟩ + obtain ⟨a, ha, q, hq, rfl⟩ := ZFSet.mem_prod.1 hv + have ac := ZFSet.mem_singleton.1 ha + subst a + have rel := (pair_mem_relationConverse S (ZFSet.prod C Q) h i (ZFSet.pair c q)).1 vi + exact ⟨hi, (ZFSet.pair_mem_prod.1 rel.2.1).1, q, hq, rel.2.2⟩ + · rintro ⟨hi, hc, q, hq, iq⟩ + exact ⟨hi, ZFSet.pair c q, ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hq⟩, + (pair_mem_relationConverse S (ZFSet.prod C Q) h i (ZFSet.pair c q)).2 + ⟨hi, ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, iq⟩⟩ + +theorem pair_mem_heightColumnGraph (S C Q h c i q : ZFSet.{u}) : + ZFSet.pair i q ∈ heightColumnGraph S C Q h c ↔ + i ∈ S ∧ c ∈ C ∧ q ∈ Q ∧ ZFSet.pair i (ZFSet.pair c q) ∈ h := by + rw [heightColumnGraph, pair_mem_relationCompose] + constructor + · rintro ⟨hi, hq, v, hv, iv, vq⟩ + obtain ⟨a, ha, b, _, eq⟩ := (mem_productSecond {c} Q (ZFSet.pair v q)).1 vq + have ac := ZFSet.mem_singleton.1 ha + subst a + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hi, (ZFSet.pair_mem_prod.1 hv).1, hq, iv⟩ + · rintro ⟨hi, hc, hq, iq⟩ + exact ⟨hi, hq, ZFSet.pair c q, ZFSet.pair_mem_prod.2 ⟨hc, hq⟩, iq, + (mem_productSecond {c} Q _).2 ⟨c, ZFSet.mem_singleton.2 rfl, q, hq, rfl⟩⟩ + +theorem heightColumnGraph_injection {S C Q h : ZFSet.{u}} + (height : InjectionCode S (ZFSet.prod C Q) h) (c : ZFSet.{u}) : + InjectionCode (heightColumnFiber S C Q h c) Q (heightColumnGraph S C Q h c) := by + refine ⟨⟨?_, ?_⟩, ?_⟩ + · intro z hz + have shape : z ∈ ZFSet.prod S Q := (ZFSet.mem_sep.1 + (show z ∈ relationCompose S (ZFSet.prod C Q) Q h (productSecond {c} Q) from hz)).1 + obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 shape + obtain ⟨_, hc, _, iq⟩ := (pair_mem_heightColumnGraph S C Q h c i q).1 hz + exact ZFSet.pair_mem_prod.2 + ⟨(mem_heightColumnFiber S C Q h c i).2 ⟨hi, hc, q, hq, iq⟩, hq⟩ + · intro i hi + obtain ⟨hiS, hc, q, hq, iq⟩ := (mem_heightColumnFiber S C Q h c i).1 hi + refine ⟨q, (pair_mem_heightColumnGraph S C Q h c i q).2 ⟨hiS, hc, hq, iq⟩, ?_⟩ + intro r ir + have irh := (pair_mem_heightColumnGraph S C Q h c i r).1 ir + obtain ⟨v, _, unique⟩ := height.function.2 i hiS + exact (ZFSet.pair_inj.1 ((unique _ irh.2.2.2).trans (unique _ iq).symm)).2 + · intro i j q iq jq + exact height.injective i j (ZFSet.pair c q) + ((pair_mem_heightColumnGraph S C Q h c i q).1 iq).2.2.2 + ((pair_mem_heightColumnGraph S C Q h c j q).1 jq).2.2.2 + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem heightColumnFiber_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {S C Q h c : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) + (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (hc : c ∈ M.sets) : + heightColumnFiber S C Q h c ∈ M.sets := by + have singleton : ({c} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hc hc + exact M.relationImage_mem separation + (M.prod_mem pairing unions powers separation singleton hQ) hS + (M.relationConverse_mem pairing unions powers separation hS + (M.prod_mem pairing unions powers separation hC hQ) hh) + +theorem heightColumnGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {S C Q h c : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) + (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (hc : c ∈ M.sets) : + heightColumnGraph S C Q h c ∈ M.sets := by + have singleton : ({c} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hc hc + exact M.relationCompose_mem pairing unions powers separation hS + (M.prod_mem pairing unions powers separation hC hQ) hQ hh + (M.productSecond_mem pairing unions powers separation singleton hQ) + +theorem groundEmbeddable_heightColumnFiber + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {S C Q h c N : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) + (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (hc : c ∈ M.sets) (hN : N ∈ M.sets) + (height : InjectionCode S (ZFSet.prod C Q) h) (small : M.groundEmbeddable Q N) : + M.groundEmbeddable (heightColumnFiber S C Q h c) N := by + obtain ⟨f, hf, code⟩ := small + exact ⟨relationCompose (heightColumnFiber S C Q h c) Q N (heightColumnGraph S C Q h c) f, + M.relationCompose_mem pairing unions powers separation + (M.heightColumnFiber_mem pairing unions powers separation hS hC hQ hh hc) hQ hN + (M.heightColumnGraph_mem pairing unions powers separation hS hC hQ hh hc) hf, + (heightColumnGraph_injection height c).compose code⟩ + +end TransitiveGround + +end + + + +section + +open SetRealization +universe u + +theorem ordinalSetProperty_mem_compare {T i j : ZFSet.{u}} + (ordinal : ordinalSetProperty T) (hi : i ∈ T) (hj : j ∈ T) : + i ∈ j ∨ i = j ∨ j ∈ i := by + obtain ⟨a, rfl⟩ := (ordinalSetProperty_iff i).1 (ordinalSetProperty_member ordinal hi) + obtain ⟨b, rfl⟩ := (ordinalSetProperty_iff j).1 (ordinalSetProperty_member ordinal hj) + rcases lt_trichotomy a b with less | eq | greater + · exact Or.inl ((mem_ordinalCode_iff a b).2 less) + · exact Or.inr (Or.inl (congrArg ordinalCode eq)) + · exact Or.inr (Or.inr ((mem_ordinalCode_iff b a).2 greater)) + +theorem ordinalSubset_has_least {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) + {S : Set ZFSet.{u}} (subset : ∀ i ∈ S, i ∈ T) (inhabited : S.Nonempty) : + ∃ i ∈ S, ∀ j ∈ S, i = j ∨ i ∈ j := by + obtain ⟨i, hi, minimal⟩ := ZFSet.mem_wf.has_min S inhabited + refine ⟨i, hi, ?_⟩ + intro j hj + rcases ordinalSetProperty_mem_compare ordinal (subset i hi) (subset j hj) with h | h | h + · exact Or.inr h + · exact Or.inl h + · exact False.elim (minimal j hj h) + +noncomputable def ordinalIndexTail (S i : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun j => i = j ∨ i ∈ j) S + +theorem mem_ordinalIndexTail (S i j : ZFSet.{u}) : + j ∈ ordinalIndexTail S i ↔ j ∈ S ∧ (i = j ∨ i ∈ j) := ZFSet.mem_sep + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem ordinalIndexTail_mem (separation : SeparationSchema M.sets) + {S i : ZFSet.{u}} (hS : S ∈ M.sets) (hi : i ∈ M.sets) : + ordinalIndexTail S i ∈ M.sets := by + have selected := M.bounded_separation_mem separation (.disj (.equal 1 0) (.mem 1 0)) + (extend i Fin.elim0) (Fin.cases hi (fun j => Fin.elim0 j)) hS + simpa only [BoundedFormula.truth_disj, BoundedFormula.Truth, extend, Fin.cases_zero, + show (1 : Fin 2) = Fin.succ 0 from rfl, Fin.cases_succ, ordinalIndexTail] using selected + +theorem groundCountable_descending_heights + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {S T C Q h : ZFSet.{u}} (hS : S ∈ M.sets) (hC : C ∈ M.sets) + (hQ : Q ∈ M.sets) (hh : h ∈ M.sets) (subset : S ⊆ T) + (ordinal : ordinalSetProperty T) (height : InjectionCode S (ZFSet.prod C Q) h) + (smallQ : M.groundEmbeddable Q ZFSet.omega) + (antitone : ∀ i ∈ S, ∀ j ∈ S, i ∈ j → ∀ c q d r, + ZFSet.pair i (ZFSet.pair c q) ∈ h → ZFSet.pair j (ZFSet.pair d r) ∈ h → + d = c ∨ d ∈ c) : + M.groundEmbeddable S ZFSet.omega := by + classical + have hOmega := M.omega_mem separation infinite + have tails : ∀ c, ∀ i ∈ S, ∀ q, ZFSet.pair i (ZFSet.pair c q) ∈ h → + M.groundEmbeddable (ordinalIndexTail S i) ZFSet.omega := by + intro c + induction c using ZFSet.inductionOn with + | h c ih => + intro i hi q iq + have hc := (ZFSet.pair_mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 iq)).2).1 + have groundTail := M.ordinalIndexTail_mem separation hS (M.transitive hS hi) + have groundFiber := M.heightColumnFiber_mem pairing unions powers separation hS hC hQ hh + (M.transitive hC hc) + have smallFiber := M.groundEmbeddable_heightColumnFiber pairing unions powers separation + hS hC hQ hh (M.transitive hC hc) hOmega height smallQ + have columnBelow (k : ZFSet.{u}) (hk : k ∈ S) (later : i = k ∨ i ∈ k) + (d r : ZFSet.{u}) (kr : ZFSet.pair k (ZFSet.pair d r) ∈ h) : d = c ∨ d ∈ c := by + rcases later with rfl | later + · obtain ⟨_, _, unique⟩ := height.function.2 i hi + exact Or.inl (ZFSet.pair_inj.1 ((unique _ kr).trans (unique _ iq).symm)).1 + · exact antitone i hi k hk later c q d r iq kr + let lower : Set ZFSet.{u} := {j | j ∈ S ∧ (i = j ∨ i ∈ j) ∧ + ∃ d r, d ∈ c ∧ ZFSet.pair j (ZFSet.pair d r) ∈ h} + by_cases inhabited : lower.Nonempty + · obtain ⟨j, hj, minimal⟩ := ordinalSubset_has_least ordinal + (fun k hk => subset hk.1) inhabited + obtain ⟨hjS, _, d, r, dc, jr⟩ := hj + have smallLater := ih d dc j hjS r jr + have smallUnion := M.groundCountable_binary_union pairing unions powers separation + infinite choice groundFiber (M.ordinalIndexTail_mem separation hS (M.transitive hS hjS)) + smallFiber smallLater + apply M.groundEmbeddable_restrict separation groundTail hOmega _ smallUnion + intro k hk + obtain ⟨hkS, later⟩ := (mem_ordinalIndexTail S i k).1 hk + obtain ⟨v, kv, _⟩ := height.function.2 k hkS + obtain ⟨e, he, s, hs, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 kv)).2 + rcases columnBelow k hkS later e s kv with eq | less + · subst e + exact ZFSet.mem_union.2 (Or.inl + ((mem_heightColumnFiber S C Q h c k).2 ⟨hkS, he, s, hs, kv⟩)) + · have klower : k ∈ lower := ⟨hkS, later, e, s, less, kv⟩ + exact ZFSet.mem_union.2 (Or.inr + ((mem_ordinalIndexTail S j k).2 ⟨hkS, minimal k klower⟩)) + · apply M.groundEmbeddable_restrict separation groundTail hOmega _ smallFiber + intro k hk + obtain ⟨hkS, later⟩ := (mem_ordinalIndexTail S i k).1 hk + obtain ⟨v, kv, _⟩ := height.function.2 k hkS + obtain ⟨e, he, s, hs, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 kv)).2 + rcases columnBelow k hkS later e s kv with eq | less + · subst e + exact (mem_heightColumnFiber S C Q h c k).2 ⟨hkS, he, s, hs, kv⟩ + · exact False.elim (inhabited ⟨k, hkS, later, e, s, less, kv⟩) + by_cases inhabited : (S.toSet).Nonempty + · obtain ⟨i, hi, minimal⟩ := ordinalSubset_has_least ordinal (fun _ hx => subset hx) inhabited + obtain ⟨v, iv, _⟩ := height.function.2 i hi + obtain ⟨c, _, q, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (height.function.1 iv)).2 + exact M.groundEmbeddable_restrict separation hS hOmega + (fun j hj => (mem_ordinalIndexTail S i j).2 ⟨hj, minimal j hj⟩) (tails c i hi q iv) + · have empty : S = ∅ := by + apply ZFSet.ext + intro x + exact ⟨fun hx => False.elim (inhabited ⟨x, hx⟩), + fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ + rw [empty] + exact M.empty_groundEmbeddable ZFSet.omega ⟨S, hS⟩ + +end TransitiveGround + + + + + + +def EssentialHeightDescent (E birth height qlt : ZFSet.{u}) : Prop := + ∀ x ∈ E, ∀ y ∈ E, ∀ i j c q d v, + ZFSet.pair x i ∈ birth → ZFSet.pair y j ∈ birth → i ∈ j → + ZFSet.pair x (ZFSet.pair c q) ∈ height → ZFSet.pair y (ZFSet.pair d v) ∈ height → + d ∈ c ∨ (d = c ∧ ZFSet.pair v q ∈ qlt) + +theorem relationCompose_function_of_subset {A B D C f g : ZFSet.{u}} + (first : ZFSet.IsFunc A B f) (second : ZFSet.IsFunc D C g) (subset : B ⊆ D) : + ZFSet.IsFunc A C (relationCompose A B C f g) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨y, xy, uniqueY⟩ := first.2 x hx + have hy := (ZFSet.pair_mem_prod.1 (first.1 xy)).2 + obtain ⟨z, yz, uniqueZ⟩ := second.2 y (subset hy) + have hz := (ZFSet.pair_mem_prod.1 (second.1 yz)).2 + refine ⟨z, (pair_mem_relationCompose A B C f g x z).2 ⟨hx, hz, y, hy, xy, yz⟩, ?_⟩ + intro w hw + obtain ⟨_, _, y', _, xy', y'w⟩ := (pair_mem_relationCompose A B C f g x w).1 hw + exact uniqueZ w (uniqueY y' xy' ▸ y'w) + +theorem essentialHeightComposite_strict {S E C Q birth reps height qlt : ZFSet.{u}} + (representatives : reps ⊆ relationConverse E S birth) + (descent : EssentialHeightDescent E birth height qlt) + {i j c q d v : ZFSet.{u}} (earlier : i ∈ j) + (first : ZFSet.pair i (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height) + (second : ZFSet.pair j (ZFSet.pair d v) ∈ relationCompose S E (ZFSet.prod C Q) reps height) : + d ∈ c ∨ (d = c ∧ ZFSet.pair v q ∈ qlt) := by + obtain ⟨_, _, x, hx, ix, xheight⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first + obtain ⟨_, _, y, hy, jy, yheight⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 second + have xi := (pair_mem_relationConverse E S birth x i).1 (representatives ix) + have yj := (pair_mem_relationConverse E S birth y j).1 (representatives jy) + exact descent x hx y hy i j c q d v xi.2.2 yj.2.2 earlier xheight yheight + +theorem essentialHeightComposite_antitone {S E C Q birth reps height qlt : ZFSet.{u}} + (representatives : reps ⊆ relationConverse E S birth) + (descent : EssentialHeightDescent E birth height qlt) : + ∀ i ∈ S, ∀ j ∈ S, i ∈ j → ∀ c q d v, + ZFSet.pair i (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height → + ZFSet.pair j (ZFSet.pair d v) ∈ relationCompose S E (ZFSet.prod C Q) reps height → + d = c ∨ d ∈ c := by + intro i _ j _ earlier c q d v first second + exact (essentialHeightComposite_strict representatives descent earlier first second).elim + Or.inr (fun h => Or.inl h.1) + +theorem essentialHeightComposite_injection {L S T E C Q birth reps height qlt : ZFSet.{u}} + (stages : S ⊆ T) (ordinal : ordinalSetProperty T) + (representatives : ZFSet.IsFunc S E reps) + (chosenBirths : reps ⊆ relationConverse E S birth) + (points : E ⊆ L) (heights : ZFSet.IsFunc L (ZFSet.prod C Q) height) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + (descent : EssentialHeightDescent E birth height qlt) : + InjectionCode S (ZFSet.prod C Q) (relationCompose S E (ZFSet.prod C Q) reps height) := by + have function := relationCompose_function_of_subset representatives heights points + refine ⟨function, ?_⟩ + intro i j z first second + have iShape := ZFSet.pair_mem_prod.1 (function.1 first) + have jShape := ZFSet.pair_mem_prod.1 (function.1 second) + obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 iShape.2 + have notEarlier (a b : ZFSet.{u}) + (aHeight : ZFSet.pair a (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height) + (bHeight : ZFSet.pair b (ZFSet.pair c q) ∈ relationCompose S E (ZFSet.prod C Q) reps height) : a ∉ b := by + intro earlier + rcases essentialHeightComposite_strict chosenBirths descent earlier aHeight bHeight with h | h + · exact ZFSet.mem_irrefl c h + · exact irreflexive q hq h.2 + have eqI := ordinalSetProperty_eq_code_rank i (ordinalSetProperty_member ordinal (stages iShape.1)) + have eqJ := ordinalSetProperty_eq_code_rank j (ordinalSetProperty_member ordinal (stages jShape.1)) + rcases lt_trichotomy (ZFSet.rank i) (ZFSet.rank j) with earlier | equal | later + · have ij : i ∈ j := by rw [eqI, eqJ, mem_ordinalCode_iff]; exact earlier + exact False.elim (notEarlier i j first second ij) + · exact eqI.trans ((congrArg ordinalCode equal).trans eqJ.symm) + · have ji : j ∈ i := by rw [eqJ, eqI, mem_ordinalCode_iff]; exact later + exact False.elim (notEarlier j i second first ji) + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem exists_essentialBirthHeights + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {L F T r birth C Q height qlt : ZFSet.{u}} + (hF : F ∈ M.sets) (hT : T ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) + (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hHeight : height ∈ M.sets) + (positive : F ⊆ L) (ordinal : ordinalSetProperty T) + (heights : ZFSet.IsFunc L (ZFSet.prod C Q) height) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + (descent : EssentialHeightDescent (birthEssentialSet F T r birth) birth height qlt) : + ∃ h ∈ M.sets, + InjectionCode (essentialBirthIndices F T r birth) (ZFSet.prod C Q) h ∧ + (∀ i ∈ essentialBirthIndices F T r birth, ∀ j ∈ essentialBirthIndices F T r birth, + i ∈ j → ∀ c q d v, + ZFSet.pair i (ZFSet.pair c q) ∈ h → ZFSet.pair j (ZFSet.pair d v) ∈ h → + d = c ∨ d ∈ c) ∧ + ∀ i z, ZFSet.pair i z ∈ h → ∃ x ∈ birthEssentialSet F T r birth, + ZFSet.pair x i ∈ birth ∧ ZFSet.pair x z ∈ height := by + let E := birthEssentialSet F T r birth + let S := essentialBirthIndices F T r birth + have hE := M.birthEssentialSet_mem separation hF hT hr hBirth + have hS := M.essentialBirthIndices_mem separation hF hT hr hBirth + obtain ⟨reps, hReps, function, chosen, _⟩ := + M.exists_essentialBirthRepresentatives pairing unions powers separation choice hF hT hr hBirth + let h := relationCompose S E (ZFSet.prod C Q) reps height + have ground : h ∈ M.sets := M.relationCompose_mem pairing unions powers separation hS hE + (M.prod_mem pairing unions powers separation hC hQ) hReps hHeight + have subset : S ⊆ T := fun _ hi => (mem_essentialBirthIndices F T r birth _).1 hi |>.1 + have points : E ⊆ L := fun _ hx => positive (birthEssentialSet_subset F T r birth hx) + refine ⟨h, ground, essentialHeightComposite_injection subset ordinal function chosen points heights + irreflexive descent, essentialHeightComposite_antitone chosen descent, ?_⟩ + intro i z hiz + obtain ⟨_, _, x, hx, ix, xz⟩ := (pair_mem_relationCompose S E (ZFSet.prod C Q) reps height i z).1 hiz + exact ⟨x, hx, ((pair_mem_relationConverse E S birth x i).1 (chosen ix)).2.2, xz⟩ + +theorem essentialBirthIndices_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {L F T r birth C Q height qlt : ZFSet.{u}} + (hF : F ∈ M.sets) (hT : T ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) + (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hHeight : height ∈ M.sets) + (positive : F ⊆ L) (ordinal : ordinalSetProperty T) + (heights : ZFSet.IsFunc L (ZFSet.prod C Q) height) + (smallQ : M.groundEmbeddable Q ZFSet.omega) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + (descent : EssentialHeightDescent (birthEssentialSet F T r birth) birth height qlt) : + M.groundEmbeddable (essentialBirthIndices F T r birth) ZFSet.omega := by + obtain ⟨h, hh, injection, antitone, _⟩ := M.exists_essentialBirthHeights pairing unions powers + separation choice hF hT hr hBirth hC hQ hHeight positive ordinal heights irreflexive descent + exact M.groundCountable_descending_heights pairing unions powers separation infinite choice + (M.essentialBirthIndices_mem separation hF hT hr hBirth) hC hQ hh + (fun _ hi => ((mem_essentialBirthIndices F T r birth _).1 hi).1) + ordinal injection smallQ antitone + +end TransitiveGround + +end + + + +open SetFormula +universe u + +noncomputable def naturalFamilyShift (family : ZFSet.{u}) : ZFSet.{u} := + relationCompose ZFSet.omega ZFSet.omega family.sUnion.sUnion natSuccessorGraph family + +theorem naturalFamilyShift_entries (family : ZFSet.{u}) (n : Nat) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode n) y ∈ naturalFamilyShift family ↔ + ZFSet.pair (natSetCode (n + 1)) y ∈ family := by + rw [naturalFamilyShift, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, k, hk, next, entry⟩ + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + exact (pair_mem_natSuccessorGraph n k).1 next ▸ entry + · intro entry + exact ⟨natSetCode_mem_omega n, pair_second_mem_doubleUnion entry, + natSetCode (n + 1), natSetCode_mem_omega (n + 1), + (pair_mem_natSuccessorGraph n (n + 1)).2 rfl, entry⟩ + +theorem naturalFamilyShift_function {family : ZFSet.{u}} + (function : FunctionGraphOn ZFSet.omega family) : + FunctionGraphOn ZFSet.omega (naturalFamilyShift family) := by + have bounded : ZFSet.IsFunc ZFSet.omega family.sUnion.sUnion family := by + refine ⟨?_, function.to_isFunc.2⟩ + intro z hz + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (function.to_isFunc.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, pair_second_mem_doubleUnion hz⟩ + exact ⟨_, relationCompose_function_of_subset natSuccessorGraph_isFunc bounded (fun _ h => h)⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem naturalFamilyShift_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {family : ZFSet.{u}} (hFamily : family ∈ M.sets) : naturalFamilyShift family ∈ M.sets := + M.relationCompose_mem pairing unions powers separation (M.omega_mem separation infinite) + (M.omega_mem separation infinite) (M.union_mem unions (M.union_mem unions hFamily)) + (M.natSuccessorGraph_mem pairing unions powers separation infinite) hFamily + +end TransitiveGround + + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalNumbers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalNumbers.lean index 274589025d2173e0b77ed07d6a3d07aaf9bde049..717cff561f6f54b759cf7e557d194c8cb747eef7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalNumbers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNaturalNumbers.lean @@ -1,53 +1,53 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMixtureNames - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -theorem omega_subset_inductive (I : ZFSet.{u}) (empty : (∅ : ZFSet.{u}) ∈ I) - (successor : ∀ x ∈ I, insert x x ∈ I) : ZFSet.omega ⊆ I := by - intro x hx - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx - clear hx - induction n with - | zero => exact empty - | succ n ih => exact successor (natSetCode n) ih - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem omega_mem (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) : ZFSet.omega ∈ M.sets := by - obtain ⟨I, hI, empty, successor⟩ := M.infinity_witness infinite - have subset := omega_subset_inductive I empty successor - have selected := M.separation_mem separation (BoundedFormula.naturalFormula 0).toFormula - Fin.elim0 (fun i => Fin.elim0 i) hI - have eq : ZFSet.sep (fun x => Realize M.sets (BoundedFormula.naturalFormula 0).toFormula - (extend x Fin.elim0)) I = ZFSet.omega := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep] - constructor - · rintro ⟨hx, rel⟩ - exact (BoundedFormula.realize_naturalFormula M 0 (extend x Fin.elim0) - (Fin.cases (M.transitive hI hx) (fun i => Fin.elim0 i))).1 rel - · intro hx - have hxI := subset hx - exact ⟨hxI, (BoundedFormula.realize_naturalFormula M 0 (extend x Fin.elim0) - (Fin.cases (M.transitive hI hxI) (fun i => Fin.elim0 i))).2 hx⟩ - exact eq ▸ selected - -theorem natSetCode_mem (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (n : Nat) : natSetCode n ∈ M.sets := - M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega n) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMixtureNames + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +theorem omega_subset_inductive (I : ZFSet.{u}) (empty : (∅ : ZFSet.{u}) ∈ I) + (successor : ∀ x ∈ I, insert x x ∈ I) : ZFSet.omega ⊆ I := by + intro x hx + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx + clear hx + induction n with + | zero => exact empty + | succ n ih => exact successor (natSetCode n) ih + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem omega_mem (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) : ZFSet.omega ∈ M.sets := by + obtain ⟨I, hI, empty, successor⟩ := M.infinity_witness infinite + have subset := omega_subset_inductive I empty successor + have selected := M.separation_mem separation (BoundedFormula.naturalFormula 0).toFormula + Fin.elim0 (fun i => Fin.elim0 i) hI + have eq : ZFSet.sep (fun x => Realize M.sets (BoundedFormula.naturalFormula 0).toFormula + (extend x Fin.elim0)) I = ZFSet.omega := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep] + constructor + · rintro ⟨hx, rel⟩ + exact (BoundedFormula.realize_naturalFormula M 0 (extend x Fin.elim0) + (Fin.cases (M.transitive hI hx) (fun i => Fin.elim0 i))).1 rel + · intro hx + have hxI := subset hx + exact ⟨hxI, (BoundedFormula.realize_naturalFormula M 0 (extend x Fin.elim0) + (Fin.cases (M.transitive hI hxI) (fun i => Fin.elim0 i))).2 hx⟩ + exact eq ▸ selected + +theorem natSetCode_mem (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (n : Nat) : natSetCode n ∈ M.sets := + M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega n) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceAssignmentClassFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceAssignmentClassFamilies.lean index 6a81a6b1111897442c01c742e1f80618224db459..4415ef267e49aec782845e7cf672cbacb4113c8b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceAssignmentClassFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceAssignmentClassFamilies.lean @@ -1,173 +1,173 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "data" => M.refinementLevelFormulaData a s b d level T T2 valid - -noncomputable def niceAssignmentClassGraphs (A : ZFSet.{u}) (side : Fin 2) : ZFSet.{u} := - M.assignmentClassGraph side A (data (Fin.cases 5 (fun _ => 4) side)) - T s.carrier s.conditionOrder (s.encode ⊤) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) -include pairing unions powers separation collection members - -theorem niceAssignmentClassGraphs_entry {A : ZFSet.{u}} (hA : A ∈ M.sets) - (C E : L) (U Rf Rc : (M.nameDomain s).names) - (idx : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (u w : Name s) (hu : u.val ∈ T) (hw : w.val ∈ T) - (member : stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val w.val ∈ A) (side : Fin 2) (y : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val w.val) y ∈ M.niceAssignmentClassGraphs a s b d level T T2 valid A side ↔ - y = (Name.refinementClass T valid - (Fin.cases (motive := fun _ => Name s) Rc.val (fun _ => Rf.val) side) - (Fin.cases (motive := fun _ => Name s) u (fun _ => w) side)).val := by - have hT : T ∈ M.sets := members 6 - have carrier : s.carrier ∈ M.sets := members 7 - have order : s.conditionOrder ∈ M.sets := members 8 - have family := M.familySet_mem s ⊤ pairing unions powers separation hT (members 9) valid - obtain ⟨_, _, hf, hc, _⟩ := (M.niceRefinementIndex_mem_iff a s b d pairing unions powers - separation collection carrier order level T T2 valid family C E U Rf Rc).1 idx - have fine := M.niceNameCandidates_subset a s T2 (d.principalFix C) hf - have coarse := M.niceNameCandidates_subset a s T2 (d.principalFix C) hc - have lookup (j : Fin 6) (R : Name s) (bound : R.val ∈ M.groundRelations T2 s.carrier) - (value : (![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] j) = R.val) : - ∀ z, ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) z ∈ - refinementIndexFieldGraph I (M.groundRelations T2 s.carrier) j ↔ z = R.val := by - intro z - rw [refinementIndexCode, refinementIndexFieldGraph_entry, value] - exact ⟨fun h => h.2.2, fun eq => ⟨idx, eq.symm ▸ bound, eq⟩⟩ - refine Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i)) side - · dsimp only [niceAssignmentClassGraphs, Fin.cases_zero] - exact M.assignmentClassGraph_entry s 0 pairing unions powers separation collection carrier order - hA (members 5) hT valid Rc.val u w Rc.property (M.transitive hT hu) (M.transitive hT hw) - member (lookup 5 Rc.val coarse rfl) y - · dsimp only [niceAssignmentClassGraphs, Fin.cases_succ] - exact M.assignmentClassGraph_entry s 1 pairing unions powers separation collection carrier order - hA (members 4) hT valid Rf.val u w Rf.property (M.transitive hT hu) (M.transitive hT hw) - member (lookup 4 Rf.val fine rfl) y - -theorem niceAssignmentClassRequests - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (valid2 : ∀ z ∈ T2, IsName s z) - (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - (children : ∀ z : Name s, z.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) z) - (secondChildren : ∀ z : Name s, z.val ∈ T2 → - HereditarilySymmetric a s (d.principalSupportFamily base directed) z) - {A : ZFSet.{u}} (hA : A ∈ M.sets) (shape : A ⊆ stageOneAssignments I T) - (small : M.groundEmbeddable A ZFSet.omega) : - let graphs := M.niceAssignmentClassGraphs a s b d level T T2 valid A - let bound := M.groundRelations T s.carrier - let J := relationImage A bound (graphs 0) ∪ relationImage A bound (graphs 1) - (∀ side, graphs side ∈ M.sets ∧ ZFSet.IsFunc A bound (graphs side)) ∧ - J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ - (∀ z ∈ J, IsName s z) ∧ - ∀ z : Name s, z.val ∈ J → - HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ - ∀ H : ConditionFilter P, Name.eval {p | H.mem p} z ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := by - let graphs := M.niceAssignmentClassGraphs a s b d level T T2 valid A - let bound := M.groundRelations T s.carrier - have hT : T ∈ M.sets := members 6 - have carrier : s.carrier ∈ M.sets := members 7 - have order : s.conditionOrder ∈ M.sets := members 8 - have hb := M.groundRelations_mem pairing unions powers separation hT carrier - have hOmega := M.omega_mem separation infinite - have family := M.familySet_mem s ⊤ pairing unions powers separation hT (members 9) valid - have request (side : Fin 2) (x : ZFSet.{u}) (hx : x ∈ A) : - ∃ z : Name s, z.val ∈ bound ∧ - HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ - z.val ⊆ ZFSet.prod T s.carrier ∧ - ∀ y, ZFSet.pair x y ∈ graphs side ↔ y = z.val := by - obtain ⟨i, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 (shape hx) - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi - let u : Name s := ⟨rawU, valid rawU hu⟩ - let w : Name s := ⟨rawW, valid rawW hw⟩ - obtain ⟨_, _, hf, hc, _⟩ := (M.niceRefinementIndex_mem_iff a s b d pairing unions powers - separation collection carrier order level T T2 valid family C E U Rf Rc).1 hi - have fineHS := niceNameCode_principal_hs a s d base C directed secondChildren - ((M.mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val.val).1 hf).2 - have coarseHS := niceNameCode_principal_hs a s d base C directed secondChildren - ((M.mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val.val).1 hc).2 - have result (R : (M.nameDomain s).names) (z : Name s) (hz : z.val ∈ T) - (hs : HereditarilySymmetric a s (d.principalSupportFamily base directed) R.val) : - (Name.refinementClass T valid R.val z).val ∈ bound ∧ - HereditarilySymmetric a s (d.principalSupportFamily base directed) - (Name.refinementClass T valid R.val z) ∧ - (Name.refinementClass T valid R.val z).val ⊆ ZFSet.prod T s.carrier := - ⟨(M.mem_groundRelations T s.carrier _).2 - ⟨M.refinementClass_mem s pairing unions powers separation collection carrier order - hT valid R.val z R.property (M.transitive hT hz), Name.refinementClass_subset T valid R.val z⟩, - Name.refinementClass_hs_of_hs a T valid closed _ children R.val z hs (children z hz), - Name.refinementClass_subset T valid R.val z⟩ - refine Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i)) side - · exact ⟨Name.refinementClass T valid Rc.val u, (result Rc u hu coarseHS).1, - (result Rc u hu coarseHS).2.1, (result Rc u hu coarseHS).2.2, - M.niceAssignmentClassGraphs_entry a s b d level T T2 valid pairing unions powers separation - collection members hA C E U Rf Rc hi u w hu hw hx 0⟩ - · exact ⟨Name.refinementClass T valid Rf.val w, (result Rf w hw fineHS).1, - (result Rf w hw fineHS).2.1, (result Rf w hw fineHS).2.2, - M.niceAssignmentClassGraphs_entry a s b d level T T2 valid pairing unions powers separation - collection members hA C E U Rf Rc hi u w hu hw hx 1⟩ - have grounds (side : Fin 2) : graphs side ∈ M.sets := - M.assignmentClassGraph_mem side pairing unions powers separation hA - (members (Fin.cases 5 (fun _ => 4) side)) hT carrier order (members 9) - have functions (side : Fin 2) : ZFSet.IsFunc A bound (graphs side) := by - refine ⟨?_, ?_⟩ - · intro x h - unfold graphs niceAssignmentClassGraphs assignmentClassGraph at h - exact (ZFSet.mem_sep.1 h).1 - · intro x hx - obtain ⟨z, _, _, _, entries⟩ := request side x hx - exact ⟨z.val, (entries _).2 rfl, fun y h => (entries y).1 h⟩ - have imageGround (side : Fin 2) := M.relationImage_mem separation hA hb (grounds side) - have imageSmall (side : Fin 2) := M.groundEmbeddable_function_image pairing unions powers - separation choice hA hb hOmega (grounds side) (functions side) small - have imageFacts (side : Fin 2) (y : ZFSet.{u}) - (member : y ∈ relationImage A bound (graphs side)) : - ∃ z : Name s, y = z.val ∧ HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ - z.val ⊆ ZFSet.prod T s.carrier := by - obtain ⟨_, x, hx, edge⟩ := (mem_relationImage A bound (graphs side) y).1 member - obtain ⟨z, _, symmetric, subset, entries⟩ := request side x hx - exact ⟨z, (entries y).1 edge, symmetric, subset⟩ - have allFacts (y : ZFSet.{u}) (member : y ∈ relationImage A bound (graphs 0) ∪ - relationImage A bound (graphs 1)) : - ∃ z : Name s, y = z.val ∧ HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ - z.val ⊆ ZFSet.prod T s.carrier := - (ZFSet.mem_union.1 member).elim (imageFacts 0 y) (imageFacts 1 y) - refine ⟨fun side => ⟨grounds side, functions side⟩, - M.binary_union_mem pairing unions (imageGround 0) (imageGround 1), - M.groundCountable_binary_union pairing unions powers separation infinite choice - (imageGround 0) (imageGround 1) (imageSmall 0) (imageSmall 1), ?_, ?_⟩ - · intro y member - obtain ⟨z, rfl, _, _⟩ := allFacts y member - exact z.property - · intro z member - obtain ⟨w, equal, symmetric, subset⟩ := allFacts z.val member - have same : z = w := Subtype.ext equal - subst w - exact ⟨symmetric, fun H => Name.eval_subset_familySet_of_code_subset H T valid z subset⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "data" => M.refinementLevelFormulaData a s b d level T T2 valid + +noncomputable def niceAssignmentClassGraphs (A : ZFSet.{u}) (side : Fin 2) : ZFSet.{u} := + M.assignmentClassGraph side A (data (Fin.cases 5 (fun _ => 4) side)) + T s.carrier s.conditionOrder (s.encode ⊤) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (members : ∀ j : Fin 15, (M.refinementLevelFormulaData a s b d level T T2 valid) j ∈ M.sets) +include pairing unions powers separation collection members + +theorem niceAssignmentClassGraphs_entry {A : ZFSet.{u}} (hA : A ∈ M.sets) + (C E : L) (U Rf Rc : (M.nameDomain s).names) + (idx : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (u w : Name s) (hu : u.val ∈ T) (hw : w.val ∈ T) + (member : stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val w.val ∈ A) (side : Fin 2) (y : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val w.val) y ∈ M.niceAssignmentClassGraphs a s b d level T T2 valid A side ↔ + y = (Name.refinementClass T valid + (Fin.cases (motive := fun _ => Name s) Rc.val (fun _ => Rf.val) side) + (Fin.cases (motive := fun _ => Name s) u (fun _ => w) side)).val := by + have hT : T ∈ M.sets := members 6 + have carrier : s.carrier ∈ M.sets := members 7 + have order : s.conditionOrder ∈ M.sets := members 8 + have family := M.familySet_mem s ⊤ pairing unions powers separation hT (members 9) valid + obtain ⟨_, _, hf, hc, _⟩ := (M.niceRefinementIndex_mem_iff a s b d pairing unions powers + separation collection carrier order level T T2 valid family C E U Rf Rc).1 idx + have fine := M.niceNameCandidates_subset a s T2 (d.principalFix C) hf + have coarse := M.niceNameCandidates_subset a s T2 (d.principalFix C) hc + have lookup (j : Fin 6) (R : Name s) (bound : R.val ∈ M.groundRelations T2 s.carrier) + (value : (![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] j) = R.val) : + ∀ z, ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) z ∈ + refinementIndexFieldGraph I (M.groundRelations T2 s.carrier) j ↔ z = R.val := by + intro z + rw [refinementIndexCode, refinementIndexFieldGraph_entry, value] + exact ⟨fun h => h.2.2, fun eq => ⟨idx, eq.symm ▸ bound, eq⟩⟩ + refine Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i)) side + · dsimp only [niceAssignmentClassGraphs, Fin.cases_zero] + exact M.assignmentClassGraph_entry s 0 pairing unions powers separation collection carrier order + hA (members 5) hT valid Rc.val u w Rc.property (M.transitive hT hu) (M.transitive hT hw) + member (lookup 5 Rc.val coarse rfl) y + · dsimp only [niceAssignmentClassGraphs, Fin.cases_succ] + exact M.assignmentClassGraph_entry s 1 pairing unions powers separation collection carrier order + hA (members 4) hT valid Rf.val u w Rf.property (M.transitive hT hu) (M.transitive hT hw) + member (lookup 4 Rf.val fine rfl) y + +theorem niceAssignmentClassRequests + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (valid2 : ∀ z ∈ T2, IsName s z) + (closed : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + (children : ∀ z : Name s, z.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) z) + (secondChildren : ∀ z : Name s, z.val ∈ T2 → + HereditarilySymmetric a s (d.principalSupportFamily base directed) z) + {A : ZFSet.{u}} (hA : A ∈ M.sets) (shape : A ⊆ stageOneAssignments I T) + (small : M.groundEmbeddable A ZFSet.omega) : + let graphs := M.niceAssignmentClassGraphs a s b d level T T2 valid A + let bound := M.groundRelations T s.carrier + let J := relationImage A bound (graphs 0) ∪ relationImage A bound (graphs 1) + (∀ side, graphs side ∈ M.sets ∧ ZFSet.IsFunc A bound (graphs side)) ∧ + J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ + (∀ z ∈ J, IsName s z) ∧ + ∀ z : Name s, z.val ∈ J → + HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ + ∀ H : ConditionFilter P, Name.eval {p | H.mem p} z ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := by + let graphs := M.niceAssignmentClassGraphs a s b d level T T2 valid A + let bound := M.groundRelations T s.carrier + have hT : T ∈ M.sets := members 6 + have carrier : s.carrier ∈ M.sets := members 7 + have order : s.conditionOrder ∈ M.sets := members 8 + have hb := M.groundRelations_mem pairing unions powers separation hT carrier + have hOmega := M.omega_mem separation infinite + have family := M.familySet_mem s ⊤ pairing unions powers separation hT (members 9) valid + have request (side : Fin 2) (x : ZFSet.{u}) (hx : x ∈ A) : + ∃ z : Name s, z.val ∈ bound ∧ + HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ + z.val ⊆ ZFSet.prod T s.carrier ∧ + ∀ y, ZFSet.pair x y ∈ graphs side ↔ y = z.val := by + obtain ⟨i, hi, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments I T x).1 (shape hx) + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := M.exists_niceRefinementIndex_fields a s b d level T T2 valid valid2 hi + let u : Name s := ⟨rawU, valid rawU hu⟩ + let w : Name s := ⟨rawW, valid rawW hw⟩ + obtain ⟨_, _, hf, hc, _⟩ := (M.niceRefinementIndex_mem_iff a s b d pairing unions powers + separation collection carrier order level T T2 valid family C E U Rf Rc).1 hi + have fineHS := niceNameCode_principal_hs a s d base C directed secondChildren + ((M.mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val.val).1 hf).2 + have coarseHS := niceNameCode_principal_hs a s d base C directed secondChildren + ((M.mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val.val).1 hc).2 + have result (R : (M.nameDomain s).names) (z : Name s) (hz : z.val ∈ T) + (hs : HereditarilySymmetric a s (d.principalSupportFamily base directed) R.val) : + (Name.refinementClass T valid R.val z).val ∈ bound ∧ + HereditarilySymmetric a s (d.principalSupportFamily base directed) + (Name.refinementClass T valid R.val z) ∧ + (Name.refinementClass T valid R.val z).val ⊆ ZFSet.prod T s.carrier := + ⟨(M.mem_groundRelations T s.carrier _).2 + ⟨M.refinementClass_mem s pairing unions powers separation collection carrier order + hT valid R.val z R.property (M.transitive hT hz), Name.refinementClass_subset T valid R.val z⟩, + Name.refinementClass_hs_of_hs a T valid closed _ children R.val z hs (children z hz), + Name.refinementClass_subset T valid R.val z⟩ + refine Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i)) side + · exact ⟨Name.refinementClass T valid Rc.val u, (result Rc u hu coarseHS).1, + (result Rc u hu coarseHS).2.1, (result Rc u hu coarseHS).2.2, + M.niceAssignmentClassGraphs_entry a s b d level T T2 valid pairing unions powers separation + collection members hA C E U Rf Rc hi u w hu hw hx 0⟩ + · exact ⟨Name.refinementClass T valid Rf.val w, (result Rf w hw fineHS).1, + (result Rf w hw fineHS).2.1, (result Rf w hw fineHS).2.2, + M.niceAssignmentClassGraphs_entry a s b d level T T2 valid pairing unions powers separation + collection members hA C E U Rf Rc hi u w hu hw hx 1⟩ + have grounds (side : Fin 2) : graphs side ∈ M.sets := + M.assignmentClassGraph_mem side pairing unions powers separation hA + (members (Fin.cases 5 (fun _ => 4) side)) hT carrier order (members 9) + have functions (side : Fin 2) : ZFSet.IsFunc A bound (graphs side) := by + refine ⟨?_, ?_⟩ + · intro x h + unfold graphs niceAssignmentClassGraphs assignmentClassGraph at h + exact (ZFSet.mem_sep.1 h).1 + · intro x hx + obtain ⟨z, _, _, _, entries⟩ := request side x hx + exact ⟨z.val, (entries _).2 rfl, fun y h => (entries y).1 h⟩ + have imageGround (side : Fin 2) := M.relationImage_mem separation hA hb (grounds side) + have imageSmall (side : Fin 2) := M.groundEmbeddable_function_image pairing unions powers + separation choice hA hb hOmega (grounds side) (functions side) small + have imageFacts (side : Fin 2) (y : ZFSet.{u}) + (member : y ∈ relationImage A bound (graphs side)) : + ∃ z : Name s, y = z.val ∧ HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ + z.val ⊆ ZFSet.prod T s.carrier := by + obtain ⟨_, x, hx, edge⟩ := (mem_relationImage A bound (graphs side) y).1 member + obtain ⟨z, _, symmetric, subset, entries⟩ := request side x hx + exact ⟨z, (entries y).1 edge, symmetric, subset⟩ + have allFacts (y : ZFSet.{u}) (member : y ∈ relationImage A bound (graphs 0) ∪ + relationImage A bound (graphs 1)) : + ∃ z : Name s, y = z.val ∧ HereditarilySymmetric a s (d.principalSupportFamily base directed) z ∧ + z.val ⊆ ZFSet.prod T s.carrier := + (ZFSet.mem_union.1 member).elim (imageFacts 0 y) (imageFacts 1 y) + refine ⟨fun side => ⟨grounds side, functions side⟩, + M.binary_union_mem pairing unions (imageGround 0) (imageGround 1), + M.groundCountable_binary_union pairing unions powers separation infinite choice + (imageGround 0) (imageGround 1) (imageSmall 0) (imageSmall 1), ?_, ?_⟩ + · intro y member + obtain ⟨z, rfl, _, _⟩ := allFacts y member + exact z.property + · intro z member + obtain ⟨w, equal, symmetric, subset⟩ := allFacts z.val member + have same : z = w := Subtype.ext equal + subst w + exact ⟨symmetric, fun H => Name.eval_subset_familySet_of_code_subset H T valid z subset⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceRefinementVisibility.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceRefinementVisibility.lean index d44ed1d0365859d935cb68f3d1b8f1066533377f..83bc6d5521c5c2191ecb041d1525923a3f217eb7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceRefinementVisibility.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNiceRefinementVisibility.lean @@ -1,736 +1,736 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNormalizedRefinementOutputs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementCoarseVisibility - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -def RefinementIndexLevelCode (I level : ZFSet.{u}) : Prop := - ∀ z ∈ I, ∃ fields : Fin 6 → ZFSet.{u}, - z = nonemptyTupleCode 5 fields ∧ fields 0 = level - -namespace RefinementIndexLevelCode -variable {I J level next : ZFSet.{u}} - -theorem disjoint (first : RefinementIndexLevelCode I level) - (second : RefinementIndexLevelCode J next) (different : level ≠ next) : - ∀ z, ¬ (z ∈ I ∧ z ∈ J) := by - rintro z ⟨hi, hj⟩ - obtain ⟨v, eqv, hv⟩ := first z hi - obtain ⟨w, eqw, hw⟩ := second z hj - have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) - exact different (hv.symm.trans ((congrFun equal 0).trans hw)) - -theorem union_level_graph (first : RefinementIndexLevelCode I level) - (second : RefinementIndexLevelCode J next) : - refinementIndexFieldGraph (I ∪ J) {level, next} 0 = - ZFSet.prod I {level} ∪ ZFSet.prod J {next} := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hz).1) - obtain ⟨hx, _, v, eqv, hy⟩ := - (pair_mem_refinementIndexFieldGraph (I ∪ J) {level, next} x y 0).1 hz - rcases ZFSet.mem_union.1 hx with hi | hj - · obtain ⟨w, eqw, hw⟩ := first x hi - have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) - exact ZFSet.mem_union.2 (Or.inl (ZFSet.pair_mem_prod.2 - ⟨hi, ZFSet.mem_singleton.2 (hy.trans ((congrFun equal 0).trans hw))⟩)) - · obtain ⟨w, eqw, hw⟩ := second x hj - have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) - exact ZFSet.mem_union.2 (Or.inr (ZFSet.pair_mem_prod.2 - ⟨hj, ZFSet.mem_singleton.2 (hy.trans ((congrFun equal 0).trans hw))⟩)) - · intro hz - rcases ZFSet.mem_union.1 hz with hi | hj - · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hi - obtain ⟨v, eqv, hv⟩ := first x hx - have yl := ZFSet.mem_singleton.1 hy - have bound : y ∈ ({level, next} : ZFSet.{u}) := by - simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton] - exact Or.inl yl - exact (pair_mem_refinementIndexFieldGraph (I ∪ J) {level, next} x y 0).2 - ⟨ZFSet.mem_union.2 (Or.inl hx), bound, v, eqv, yl.trans hv.symm⟩ - · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hj - obtain ⟨v, eqv, hv⟩ := second x hx - have yn := ZFSet.mem_singleton.1 hy - have bound : y ∈ ({level, next} : ZFSet.{u}) := by - simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton] - exact Or.inr yn - exact (pair_mem_refinementIndexFieldGraph (I ∪ J) {level, next} x y 0).2 - ⟨ZFSet.mem_union.2 (Or.inr hx), bound, v, eqv, yn.trans hv.symm⟩ - -theorem union_level_function (first : RefinementIndexLevelCode I level) - (second : RefinementIndexLevelCode J next) : - ZFSet.IsFunc (I ∪ J) {level, next} - (refinementIndexFieldGraph (I ∪ J) {level, next} 0) := by - apply refinementIndexFieldGraph_function - intro z hz - rcases ZFSet.mem_union.1 hz with hi | hj - · obtain ⟨v, eqv, hv⟩ := first z hi - exact ⟨v, eqv, by simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton]; exact Or.inl hv⟩ - · obtain ⟨v, eqv, hv⟩ := second z hj - exact ⟨v, eqv, by simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton]; exact Or.inr hv⟩ - -theorem union_level_entry (first : RefinementIndexLevelCode I level) - (second : RefinementIndexLevelCode J next) (x y : ZFSet.{u}) : - ZFSet.pair x y ∈ refinementIndexFieldGraph (I ∪ J) {level, next} 0 ↔ - (x ∈ I ∧ y = level) ∨ (x ∈ J ∧ y = next) := by - rw [first.union_level_graph second] - simp only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton] - -end RefinementIndexLevelCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def RefinementIndexSelectionCode (M : TransitiveGround.{u}) - (level r candidates relations T P order top z : ZFSet.{u}) : Prop := - ∃ C E U Rf Rc N V, - z = refinementIndexCode level C E U Rf Rc ∧ ZFSet.pair C E ∈ r ∧ C ≠ E ∧ - ZFSet.pair C N ∈ candidates ∧ U ∈ N ∧ ZFSet.pair C V ∈ relations ∧ - Rf ∈ V ∧ Rc ∈ V ∧ - Realize M.sets (refinementValidityForcingFormula 0 1 2 3 4 5 6) - ![U, Rf, Rc, T, P, order, top] - -namespace SetFormula - -def refinementIndexSelectionRawFormula {n} (z level r candidates relations T P order top : Fin n) - (w : Fin 7 → Fin n) : SetFormula n := - .conj (BoundedFormula.refinementIndexFormula z level (w 0) (w 1) (w 2) (w 3) (w 4)).toFormula - (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 1) r).toFormula - (.conj (.neg (.equal (w 0) (w 1))) - (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 5) candidates).toFormula - (.conj (.mem (w 2) (w 5)) - (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 6) relations).toFormula - (.conj (.mem (w 3) (w 6)) (.conj (.mem (w 4) (w 6)) - (reindex ![w 2, w 3, w 4, T, P, order, top] - (refinementValidityForcingFormula 0 1 2 3 4 5 6))))))))) - -def refinementIndexSelectionFormula {n} (z level r candidates relations T P order top : Fin n) : SetFormula n := - let old := suffixIndex n 7 - exBlock 7 (refinementIndexSelectionRawFormula (old z) (old level) (old r) - (old candidates) (old relations) (old T) (old P) (old order) (old top) (prefixIndex n 7)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_refinementIndexSelectionRawFormula {n} - (z level r candidates relations T P order top : Fin n) (w : Fin 7 → Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (refinementIndexSelectionRawFormula z level r candidates relations T P order top w) env ↔ - env z = refinementIndexCode (env level) (env (w 0)) (env (w 1)) (env (w 2)) (env (w 3)) (env (w 4)) ∧ - ZFSet.pair (env (w 0)) (env (w 1)) ∈ env r ∧ env (w 0) ≠ env (w 1) ∧ - ZFSet.pair (env (w 0)) (env (w 5)) ∈ env candidates ∧ env (w 2) ∈ env (w 5) ∧ - ZFSet.pair (env (w 0)) (env (w 6)) ∈ env relations ∧ - env (w 3) ∈ env (w 6) ∧ env (w 4) ∈ env (w 6) ∧ - Realize M.sets (refinementValidityForcingFormula 0 1 2 3 4 5 6) - ![env (w 2), env (w 3), env (w 4), env T, env P, env order, env top] := by - have mapped : (fun j : Fin 7 => env (![w 2, w 3, w 4, T, P, order, top] j)) = - ![env (w 2), env (w 3), env (w 4), env T, env P, env order, env top] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))) j - simp only [refinementIndexSelectionRawFormula, Realize, - BoundedFormula.realize_toFormula M _ env members, - BoundedFormula.truth_refinementIndexFormula, BoundedFormula.truth_pairMembershipFormula, - SetFormula.realize_reindex, mapped] - -theorem realize_refinementIndexSelectionFormula {n} - (z level r candidates relations T P order top : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (refinementIndexSelectionFormula z level r candidates relations T P order top) env ↔ - RefinementIndexSelectionCode M (env level) (env r) (env candidates) (env relations) - (env T) (env P) (env order) (env top) (env z) := by - rw [refinementIndexSelectionFormula, realize_exBlock] - have actual (w : Fin 7 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) := - M.realize_refinementIndexSelectionRawFormula (suffixIndex n 7 z) (suffixIndex n 7 level) - (suffixIndex n 7 r) (suffixIndex n 7 candidates) (suffixIndex n 7 relations) - (suffixIndex n 7 T) (suffixIndex n 7 P) (suffixIndex n 7 order) (suffixIndex n 7 top) - (prefixIndex n 7) (extendMany 7 w env) (extendMany_members 7 w env ground members) - simp only [extendMany_prefix, extendMany_suffix] at actual - constructor - · rintro ⟨w, ground, selected⟩ - exact ⟨w 0, w 1, w 2, w 3, w 4, w 5, w 6, (actual w ground).1 selected⟩ - · rintro ⟨C, E, U, Rf, Rc, N, V, equal, edge, strict, first, hU, second, hf, hc, forced⟩ - have fields := M.refinementIndexCode_fields_mem (equal ▸ members z) - have hN := M.pair_right (M.transitive (members candidates) first) - have hV := M.pair_right (M.transitive (members relations) second) - let w : Fin 7 → ZFSet.{u} := ![C, E, U, Rf, Rc, N, V] - have ground : ∀ j, w j ∈ M.sets := - Fin.cases fields.2.1 (Fin.cases fields.2.2.1 (Fin.cases fields.2.2.2.1 - (Fin.cases fields.2.2.2.2.1 (Fin.cases fields.2.2.2.2.2 - (Fin.cases hN (Fin.cases hV (fun j => Fin.elim0 j))))))) - exact ⟨w, ground, (actual w ground).2 ⟨equal, edge, strict, first, hU, second, hf, hc, forced⟩⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def refinementIndices - (level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (RefinementIndexSelectionCode M level r candidates relations T P order top) - (refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P)) - -theorem mem_refinementIndices - (level nodes r candidates relations T1 T2 T P order top z : ZFSet.{u}) : - z ∈ M.refinementIndices level nodes r candidates relations T1 T2 T P order top ↔ - z ∈ refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P) ∧ - RefinementIndexSelectionCode M level r candidates relations T P order top z := - ZFSet.mem_sep - -theorem refinementIndexCode_mem_indices - (level nodes r candidates relations T1 T2 T P order top C E U Rf Rc : ZFSet.{u}) : - refinementIndexCode level C E U Rf Rc ∈ - M.refinementIndices level nodes r candidates relations T1 T2 T P order top ↔ - C ∈ nodes ∧ E ∈ nodes ∧ U ∈ M.groundRelations T1 P ∧ - Rf ∈ M.groundRelations T2 P ∧ Rc ∈ M.groundRelations T2 P ∧ - ZFSet.pair C E ∈ r ∧ C ≠ E ∧ - ∃ N V, ZFSet.pair C N ∈ candidates ∧ U ∈ N ∧ - ZFSet.pair C V ∈ relations ∧ Rf ∈ V ∧ Rc ∈ V ∧ - Realize M.sets (refinementValidityForcingFormula 0 1 2 3 4 5 6) - ![U, Rf, Rc, T, P, order, top] := by - rw [M.mem_refinementIndices, refinementIndexCode_mem_bound] - constructor - · rintro ⟨⟨_, hC, hE, hU, hf, hc⟩, c, e, a, f, t, N, V, equal, edge, strict, first, ha, second, hff, hcc, forced⟩ - obtain ⟨_, rfl, rfl, rfl, rfl, rfl⟩ := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 equal - exact ⟨hC, hE, hU, hf, hc, edge, strict, N, V, first, ha, second, hff, hcc, forced⟩ - · rintro ⟨hC, hE, hU, hf, hc, edge, strict, N, V, first, ha, second, hff, hcc, forced⟩ - exact ⟨⟨ZFSet.mem_singleton.2 rfl, hC, hE, hU, hf, hc⟩, - C, E, U, Rf, Rc, N, V, rfl, edge, strict, first, ha, second, hff, hcc, forced⟩ - -theorem refinementIndices_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}} - (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) (hr : r ∈ M.sets) - (hc : candidates ∈ M.sets) (hrel : relations ∈ M.sets) - (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hT : T ∈ M.sets) - (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) : - M.refinementIndices level nodes r candidates relations T1 T2 T P order top ∈ M.sets := by - let B := refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P) - have hB := M.refinementIndexBound_mem pairing unions powers separation - (by simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hl hl) hn - (M.groundRelations_mem pairing unions powers separation hT1 hP) - (M.groundRelations_mem pairing unions powers separation hT2 hP) - let params : Fin 8 → ZFSet.{u} := ![level, r, candidates, relations, T, P, order, top] - have members : ∀ j, params j ∈ M.sets := - Fin.cases hl (Fin.cases hr (Fin.cases hc (Fin.cases hrel (Fin.cases hT - (Fin.cases hP (Fin.cases ho (Fin.cases ht (fun j => Fin.elim0 j)))))))) - let φ : SetFormula 9 := refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 - have ground := M.separation_mem separation φ params members hB - have equal : ZFSet.sep (fun z => Realize M.sets φ (extend z params)) B = - M.refinementIndices level nodes r candidates relations T1 T2 T P order top := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_refinementIndices] - apply and_congr_right - intro hz - exact M.realize_refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 - (extend z params) (Fin.cases (M.transitive hB hz) members) - exact equal ▸ ground - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - -noncomputable def niceRefinementIndices (level T1 T2 : ZFSet.{u}) - (valid : ∀ z ∈ T1, IsName s z) : ZFSet.{u} := - M.refinementIndices level b.carrier b.conditionOrder - (M.niceNameCandidateGraph a s b T1 d.principalFix) - (M.niceNameCandidateGraph a s b T2 d.principalFix) T1 T2 - (Name.familySet ⊤ T1 valid).val s.carrier s.conditionOrder (s.encode ⊤) - -theorem niceRefinementIndices_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {level T1 T2 : ZFSet.{u}} (valid : ∀ z ∈ T1, IsName s z) - (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (first : M.niceNameCandidateGraph a s b T1 d.principalFix ∈ M.sets) - (second : M.niceNameCandidateGraph a s b T2 d.principalFix ∈ M.sets) : - M.niceRefinementIndices a s b d level T1 T2 valid ∈ M.sets := by - have top := M.transitive carrier (s.encode_mem ⊤) - exact M.refinementIndices_mem pairing unions powers separation hl nodes nodeOrder first second - hT1 hT2 (M.familySet_mem s ⊤ pairing unions powers separation hT1 top valid) carrier order top - -theorem niceRefinementIndex_mem_iff - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (level T1 T2 : ZFSet.{u}) (valid : ∀ z ∈ T1, IsName s z) - (familyGround : (Name.familySet ⊤ T1 valid).val ∈ M.sets) - (C E : L) (U Rf Rc : (M.nameDomain s).names) : - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid ↔ - C < E ∧ U.val.val ∈ M.niceNameCandidates a s T1 (d.principalFix C) ∧ - Rf.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ - Rc.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ - Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula - (extend U (extend Rf (extend Rc (extend ⟨Name.familySet ⊤ T1 valid, familyGround⟩ Fin.elim0)))) ⊤ := by - let T : (M.nameDomain s).names := ⟨Name.familySet ⊤ T1 valid, familyGround⟩ - let names := extend U (extend Rf (extend Rc (extend T Fin.elim0))) - have forcing := M.realize_refinementValidityForcing s pairing unions powers separation collection carrier order - 0 1 2 3 4 5 6 ![U.val.val, Rf.val.val, Rc.val.val, T.val.val, s.carrier, s.conditionOrder, s.encode ⊤] - names ⊤ rfl rfl rfl rfl rfl rfl rfl - rw [niceRefinementIndices, M.refinementIndexCode_mem_indices] - constructor - · rintro ⟨_, _, _, _, _, edge, strict, N, V, first, hU, second, hf, hc, forced⟩ - have nEq := (M.pair_mem_niceNameCandidateGraph a s b T1 d.principalFix C N).1 first - have vEq := (M.pair_mem_niceNameCandidateGraph a s b T2 d.principalFix C V).1 second - subst N - subst V - have lower := (b.pair_mem_conditionOrder C E).1 edge - have different : C ≠ E := fun eq => strict (congrArg b.encode eq) - exact ⟨lt_of_le_of_ne lower different, hU, hf, hc, forcing.1 forced⟩ - · rintro ⟨strict, hU, hf, hc, forced⟩ - refine ⟨b.encode_mem C, b.encode_mem E, M.niceNameCandidates_subset a s T1 _ hU, - M.niceNameCandidates_subset a s T2 _ hf, M.niceNameCandidates_subset a s T2 _ hc, - (b.pair_mem_conditionOrder C E).2 strict.le, - (fun eq => strict.ne (b.injective eq)), M.niceNameCandidates a s T1 (d.principalFix C), - M.niceNameCandidates a s T2 (d.principalFix C), ?_, hU, ?_, hf, hc, forcing.2 forced⟩ - · exact (M.pair_mem_niceNameCandidateGraph a s b T1 d.principalFix C _).2 rfl - · exact (M.pair_mem_niceNameCandidateGraph a s b T2 d.principalFix C _).2 rfl - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}) -local notation "I" => M.refinementIndices level nodes r candidates relations T1 T2 T P order top -local notation "bounds" => (![Singleton.singleton level, nodes, nodes, M.groundRelations T1 P, - M.groundRelations T2 P, M.groundRelations T2 P]) - -theorem refinementIndices_fields {z : ZFSet.{u}} (hz : z ∈ I) : - ∃ fields : Fin 6 → ZFSet.{u}, z = nonemptyTupleCode 5 fields ∧ ∀ j, fields j ∈ bounds j := by - obtain ⟨l, hl, C, hC, E, hE, U, hU, Rf, hf, Rc, hc, eq⟩ := - (mem_refinementIndexBound _ _ _ _ z).1 ((M.mem_refinementIndices _ _ _ _ _ _ _ _ _ _ _ _).1 hz).1 - refine ⟨![l, C, E, U, Rf, Rc], eq, ?_⟩ - exact Fin.cases hl (Fin.cases hC (Fin.cases hE (Fin.cases hU - (Fin.cases hf (Fin.cases hc (fun j => Fin.elim0 j)))))) - -theorem refinementIndices_field_function (j : Fin 6) : - ZFSet.IsFunc I (bounds j) (refinementIndexFieldGraph I (bounds j) j) := by - apply refinementIndexFieldGraph_function - intro z hz - obtain ⟨v, equal, bound⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hz - exact ⟨v, equal, bound j⟩ - -theorem refinementIndices_fields_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) (hr : r ∈ M.sets) - (hc : candidates ∈ M.sets) (hrel : relations ∈ M.sets) - (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hT : T ∈ M.sets) - (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) : - ∀ j : Fin 6, refinementIndexFieldGraph I (bounds j) j ∈ M.sets := by - have hI := M.refinementIndices_mem pairing unions powers separation - hl hn hr hc hrel hT1 hT2 hT hP ho ht - have hV := M.groundRelations_mem pairing unions powers separation hT1 hP - have hW := M.groundRelations_mem pairing unions powers separation hT2 hP - have hs : ({level} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hl hl - have ground : ∀ j : Fin 6, bounds j ∈ M.sets := - Fin.cases hs (Fin.cases hn (Fin.cases hn (Fin.cases hV - (Fin.cases hW (Fin.cases hW (fun j => Fin.elim0 j)))))) - exact fun j => M.refinementIndexFieldGraph_mem pairing unions powers separation hI (ground j) j - -theorem refinementIndices_level_graph : - refinementIndexFieldGraph I {level} 0 = ZFSet.prod I {level} := by - apply ZFSet.ext - intro z - constructor - · intro hz - exact (ZFSet.mem_sep.1 hz).1 - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - obtain ⟨v, equal, bound⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hx - have same : y = v 0 := (ZFSet.mem_singleton.1 hy).trans (ZFSet.mem_singleton.1 (bound 0)).symm - exact (pair_mem_refinementIndexFieldGraph I {level} x y 0).2 ⟨hx, hy, v, equal, same⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - -theorem exists_niceRefinementIndex_fields (level T1 T2 : ZFSet.{u}) - (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) - {z : ZFSet.{u}} (member : z ∈ M.niceRefinementIndices a s b d level T1 T2 valid1) : - ∃ C E : L, ∃ U Rf Rc : (M.nameDomain s).names, - z = refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val := by - have bound := ((M.mem_refinementIndices _ _ _ _ _ _ _ _ _ _ _ z).1 member).1 - obtain ⟨l, hl, C, hC, E, hE, U, hU, Rf, hf, Rc, hc, equal⟩ := - (mem_refinementIndexBound _ _ _ _ z).1 bound - have same : l = level := ZFSet.mem_singleton.1 hl - subst l - obtain ⟨c, rfl⟩ := (b.mem_carrier C).1 hC - obtain ⟨e, rfl⟩ := (b.mem_carrier E).1 hE - have domain := (M.mem_groundRelations T1 s.carrier U).1 hU - have fine := (M.mem_groundRelations T2 s.carrier Rf).1 hf - have coarse := (M.mem_groundRelations T2 s.carrier Rc).1 hc - exact ⟨c, e, ⟨Name.ofSubset valid1 domain.2, domain.1⟩, - ⟨Name.ofSubset valid2 fine.2, fine.1⟩, ⟨Name.ofSubset valid2 coarse.2, coarse.1⟩, equal⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u - -theorem normalizedRefinementIndex_mem - (M : TransitiveGround.{u}) - {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - (a : PosetAction G P) (s : Presentation P) - (b : Presentation L) (d : PosetAction G L) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (level T1 T2 : ZFSet.{u}) (valid : ∀ z ∈ T1, IsName s z) - (C E : L) (normalized : Assignment (M.nameDomain s) 4) - (last : (normalized 3).val = Name.familySet ⊤ T1 valid) - (strict : C < E) - (niceU : NiceNameCode a s T1 (d.principalFix C) (normalized 0).val.val) - (niceRf : NiceNameCode a s T2 (d.principalFix C) (normalized 1).val.val) - (niceRc : NiceNameCode a s T2 (d.principalFix C) (normalized 2).val.val) - (forced : Forces (M.nameDomain s) - BoundedFormula.refinementValidityFormula.toFormula normalized ⊤) : - refinementIndexCode level (b.encode C) (b.encode E) - (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid := by - have familyGround : (Name.familySet ⊤ T1 valid).val ∈ M.sets := by - rw [← last] - exact (normalized 3).property - have lastName : normalized 3 = ⟨Name.familySet ⊤ T1 valid, familyGround⟩ := - Subtype.ext last - have normalizedEq : normalized = - extend (normalized 0) (extend (normalized 1) (extend (normalized 2) - (extend ⟨Name.familySet ⊤ T1 valid, familyGround⟩ Fin.elim0))) := by - funext i - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases lastName (fun j => Fin.elim0 j)))) i - apply (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation - collection carrier order level T1 T2 valid familyGround C E - (normalized 0) (normalized 1) (normalized 2)).2 - refine ⟨strict, ?_, ?_, ?_, normalizedEq ▸ forced⟩ - · exact (M.mem_niceNameCandidates a s T1 (d.principalFix C) _).2 - ⟨(normalized 0).property, niceU⟩ - · exact (M.mem_niceNameCandidates a s T2 (d.principalFix C) _).2 - ⟨(normalized 1).property, niceRf⟩ - · exact (M.mem_niceNameCandidates a s T2 (d.principalFix C) _).2 - ⟨(normalized 2).property, niceRc⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -namespace TransitiveGround -noncomputable def niceRefinementIndexBounds (M : TransitiveGround.{u}) - (s : Presentation P) (b : Presentation L) (level T1 T2 : ZFSet.{u}) : Fin 6 → ZFSet.{u} := - ![{level}, b.carrier, b.carrier, M.groundRelations T1 s.carrier, - M.groundRelations T2 s.carrier, M.groundRelations T2 s.carrier] - -end TransitiveGround - -structure NiceRefinementIndexSystem (M : TransitiveGround.{u}) - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - (level T1 T2 : ZFSet.{u}) (valid1 : ∀ z ∈ T1, IsName s z) - (valid2 : ∀ z ∈ T2, IsName s z) : Prop where - index_ground : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets - family_ground : (Name.familySet ⊤ T1 valid1).val ∈ M.sets - first_candidates_ground : M.niceNameCandidateGraph a s b T1 d.principalFix ∈ M.sets - second_candidates_ground : M.niceNameCandidateGraph a s b T2 d.principalFix ∈ M.sets - field_ground : ∀ j, refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndexBounds s b level T1 T2 j) j ∈ M.sets - field_function : ∀ j, ZFSet.IsFunc (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndexBounds s b level T1 T2 j) - (refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) - (M.niceRefinementIndexBounds s b level T1 T2 j) j) - level_graph : refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) - {level} 0 = ZFSet.prod (M.niceRefinementIndices a s b d level T1 T2 valid1) {level} - typed_entries : ∀ C E (U Rf Rc : (M.nameDomain s).names), - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid1 ↔ - C < E ∧ U.val.val ∈ M.niceNameCandidates a s T1 (d.principalFix C) ∧ - Rf.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ - Rc.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ - Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula - (extend U (extend Rf (extend Rc (extend ⟨Name.familySet ⊤ T1 valid1, family_ground⟩ Fin.elim0)))) ⊤ - decoded : ∀ z ∈ M.niceRefinementIndices a s b d level T1 T2 valid1, - ∃ C E : L, ∃ U Rf Rc : (M.nameDomain s).names, - z = refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) -variable (b : Presentation L) (d : PosetAction G L) - -theorem niceRefinementIndexSystem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {level T1 T2 : ZFSet.{u}} {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} - (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} - (first : NiceNameSystem M a s b d base directed T1 valid1) - (second : NiceNameSystem M a s b d base directed T2 valid2) : - NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2 := by - have top := M.transitive carrier (s.encode_mem ⊤) - have family := M.familySet_mem s ⊤ pairing unions powers separation hT1 top valid1 - refine ⟨M.niceRefinementIndices_mem a s b d pairing unions powers separation valid1 hl hT1 hT2 - carrier order nodes nodeOrder first.candidate_graph_ground second.candidate_graph_ground, - family, first.candidate_graph_ground, second.candidate_graph_ground, ?_, ?_, ?_, ?_, ?_⟩ - · exact M.refinementIndices_fields_ground _ _ _ _ _ _ _ _ _ _ _ pairing unions powers separation - hl nodes nodeOrder first.candidate_graph_ground second.candidate_graph_ground hT1 hT2 family carrier order top - · exact M.refinementIndices_field_function _ _ _ _ _ _ _ _ _ _ _ - · exact M.refinementIndices_level_graph _ _ _ _ _ _ _ _ _ _ _ - · exact M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order level T1 T2 valid1 family - · exact fun _ hz => M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hz - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.NiceRefinementIndexSystem -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {G P Q L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] -variable [PartialOrder L] -variable {a : PosetAction G P} {e : PosetAction G Q} -variable {s : Presentation P} {t : Presentation Q} {b : Presentation L} {d : PosetAction G L} -variable {level next T T2 U U2 : ZFSet.{u}} -variable {valid : ∀ z ∈ T, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} -variable {upperValid : ∀ z ∈ U, IsName t z} {upperValid2 : ∀ z ∈ U2, IsName t z} -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "J" => M.niceRefinementIndices e t b d next U U2 upperValid - -theorem levelCode (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) : - RefinementIndexLevelCode I level := by - intro z hz - obtain ⟨C, E, X, Rf, Rc, equal⟩ := first.decoded z hz - exact ⟨![level, b.encode C, b.encode E, X.val.val, Rf.val.val, Rc.val.val], equal, rfl⟩ - -theorem different_levels_disjoint - (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - (second : NiceRefinementIndexSystem M e t b d next U U2 upperValid upperValid2) - (different : level ≠ next) : ∀ z, ¬ (z ∈ I ∧ z ∈ J) := - first.levelCode.disjoint second.levelCode different - -theorem union_level_data - (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - (second : NiceRefinementIndexSystem M e t b d next U U2 upperValid upperValid2) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hLevel : level ∈ M.sets) (hNext : next ∈ M.sets) : - I ∪ J ∈ M.sets ∧ - refinementIndexFieldGraph (I ∪ J) {level, next} 0 ∈ M.sets ∧ - ZFSet.IsFunc (I ∪ J) {level, next} (refinementIndexFieldGraph (I ∪ J) {level, next} 0) ∧ - refinementIndexFieldGraph (I ∪ J) {level, next} 0 = - ZFSet.prod I {level} ∪ ZFSet.prod J {next} := by - have ground := M.binary_union_mem pairing unions first.index_ground second.index_ground - exact ⟨ground, M.refinementIndexFieldGraph_mem pairing unions powers separation - ground (M.unorderedPair_mem pairing hLevel hNext) 0, - first.levelCode.union_level_function second.levelCode, - first.levelCode.union_level_graph second.levelCode⟩ - -end PartitionPilot.Forcing.NiceRefinementIndexSystem - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure RefinementObjectSystem (M : TransitiveGround.{u}) (a : PosetAction G P) - (s : Presentation P) (F : NormalSubgroupFamily G) (K : Subgroup G) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) : Prop where - ground : (Name.refinementQuotient T valid U Rf).val ∈ M.sets ∧ - (Name.refinementQuotient T valid U Rc).val ∈ M.sets ∧ - (Name.refinementNaturalMap T valid U Rf Rc).val ∈ M.sets - support : K ≤ a.stabilizer s (Name.refinementQuotient T valid U Rf) ∧ - K ≤ a.stabilizer s (Name.refinementQuotient T valid U Rc) ∧ - K ≤ a.stabilizer s (Name.refinementNaturalMap T valid U Rf Rc) - hs : HereditarilySymmetric a s F (Name.refinementQuotient T valid U Rf) ∧ - HereditarilySymmetric a s F (Name.refinementQuotient T valid U Rc) ∧ - HereditarilySymmetric a s F (Name.refinementNaturalMap T valid U Rf Rc) - classes : ∀ w : Name s, w.val ∈ T → - (Name.refinementClass T valid Rf w).val ∈ M.sets ∧ - (Name.refinementClass T valid Rc w).val ∈ M.sets ∧ - HereditarilySymmetric a s F (Name.refinementClass T valid Rf w) ∧ - HereditarilySymmetric a s F (Name.refinementClass T valid Rc w) - class_graphs : Name.refinementClassGraph T valid Rf T valid ∈ M.sets ∧ - Name.refinementClassGraph T valid Rc T valid ∈ M.sets ∧ - Name.refinementPairClassGraph T valid Rf Rc T valid ∈ M.sets - values : ∀ (H : ConditionFilter P), H.GenericFor (formulaFamily (M.nameDomain s)) → - RefinementObjectValues {p | H.mem p} T valid U Rf Rc - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) -variable (b : Presentation L) (d : PosetAction G L) (base : L) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -theorem niceRefinementObjects - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {level T1 T2 : ZFSet.{u}} {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} - (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (closed : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) - (children : ∀ w : Name s, w.val ∈ T1 → - HereditarilySymmetric a s (d.principalSupportFamily base directed) w) - (first : NiceNameSystem M a s b d base directed T1 valid1) - (second : NiceNameSystem M a s b d base directed T2 valid2) : - NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2 ∧ - ∀ C E (U Rf Rc : (M.nameDomain s).names), - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid1 → - RefinementObjectSystem M a s (d.principalSupportFamily base directed) (d.principalFix C) - T1 valid1 U.val Rf.val Rc.val := by - have indices := M.niceRefinementIndexSystem a s b d pairing unions powers separation collection - hl hT1 hT2 carrier order nodes nodeOrder first second - refine ⟨indices, ?_⟩ - intro C E U Rf Rc entry - obtain ⟨_, hU, hRf, hRc, forced⟩ := (indices.typed_entries C E U Rf Rc).1 entry - have supportedU := ((M.name_mem_niceNameCandidates a s T1 (d.principalFix C) U.val).1 hU).2.2 - have supportedRf := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val).1 hRf).2.2 - have supportedRc := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val).1 hRc).2.2 - have hsU := first.candidate_hs C U.val hU - have hsRf := second.candidate_hs C Rf.val hRf - have hsRc := second.candidate_hs C Rc.val hRc - refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact ⟨M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT1 valid1 U.val Rf.val U.property Rf.property, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT1 valid1 U.val Rc.val U.property Rc.property, - M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order - hT1 valid1 U.val Rf.val Rc.val U.property Rf.property Rc.property⟩ - · exact ⟨Name.refinementQuotient_support a T1 valid1 closed U.val Rf.val _ supportedU supportedRf, - Name.refinementQuotient_support a T1 valid1 closed U.val Rc.val _ supportedU supportedRc, - Name.refinementNaturalMap_support a T1 valid1 closed U.val Rf.val Rc.val _ supportedU supportedRf supportedRc⟩ - · exact ⟨Name.refinementQuotient_hs a T1 valid1 closed _ children U.val Rf.val hsU hsRf, - Name.refinementQuotient_hs a T1 valid1 closed _ children U.val Rc.val hsU hsRc, - Name.refinementNaturalMap_hs a T1 valid1 closed _ children U.val Rf.val Rc.val hsU hsRf hsRc⟩ - · intro w hw - exact ⟨M.refinementClass_mem s pairing unions powers separation collection carrier order - hT1 valid1 Rf.val w Rf.property (M.transitive hT1 hw), - M.refinementClass_mem s pairing unions powers separation collection carrier order - hT1 valid1 Rc.val w Rc.property (M.transitive hT1 hw), - Name.refinementClass_hs_of_hs a T1 valid1 closed _ children Rf.val w hsRf (children w hw), - Name.refinementClass_hs_of_hs a T1 valid1 closed _ children Rc.val w hsRc (children w hw)⟩ - · exact ⟨M.refinementClassGraph_mem s pairing unions powers separation collection carrier order - hT1 hT1 valid1 valid1 Rf.val Rf.property, - M.refinementClassGraph_mem s pairing unions powers separation collection carrier order - hT1 hT1 valid1 valid1 Rc.val Rc.property, - M.refinementPairClassGraph_mem s pairing unions powers separation collection carrier order - hT1 hT1 valid1 valid1 Rf.val Rc.val Rf.property Rc.property⟩ - · intro H generic - exact M.refinementObjects_eval s pairing carrier hT1 valid1 indices.family_ground - U Rf Rc H generic H.top_mem forced - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -theorem niceRefinementIndex_preserves_visibility - (s : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (a : PosetAction G P) (t : Presentation G) (maps : a.conditionMapFamily s t ∈ M.sets) - (b : Presentation L) (d : PosetAction G L) (base : L) - (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - {level T1 T2 : ZFSet.{u}} (hT1 : T1 ∈ M.sets) - {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} - (terms : ∀ g (z : Name s), z.val ∈ T1 → (a.act s g z).val ∈ T1) - (system : NiceNameSystem M a s b d base directed T1 valid1) - (indices : NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2) - (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T1 T2 valid1) - {v : L} (lower : C ≤ v) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {fineClass coarseClass : ZFSet.{u}} - (visible : fineClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T1 (d.principalFix v))) - (entry : ZFSet.pair fineClass coarseClass ∈ - Name.eval {p | H.mem p} (Name.refinementNaturalMap T1 valid1 U.val Rf.val Rc.val)) : - coarseClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T1 (d.principalFix v)) := by - obtain ⟨_, hU, _, hRc, forced⟩ := (indices.typed_entries C E U Rf Rc).1 member - have domain := ((M.name_mem_niceNameCandidates a s T1 (d.principalFix C) U.val).1 hU).2.2 - have relation := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val).1 hRc).2.2 - have values := M.refinementObjects_eval s pairing carrier hT1 valid1 indices.family_ground - U Rf Rc H generic H.top_mem forced - rw [values.natural_map] at entry - exact M.refinementQuotientMap_preserves_visibility s pairing unions powers separation collection - carrier order a t maps b d base directed hT1 valid1 terms system U Rf Rc lower domain relation - H generic values.validity visible entry - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNormalizedRefinementOutputs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementCoarseVisibility + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +def RefinementIndexLevelCode (I level : ZFSet.{u}) : Prop := + ∀ z ∈ I, ∃ fields : Fin 6 → ZFSet.{u}, + z = nonemptyTupleCode 5 fields ∧ fields 0 = level + +namespace RefinementIndexLevelCode +variable {I J level next : ZFSet.{u}} + +theorem disjoint (first : RefinementIndexLevelCode I level) + (second : RefinementIndexLevelCode J next) (different : level ≠ next) : + ∀ z, ¬ (z ∈ I ∧ z ∈ J) := by + rintro z ⟨hi, hj⟩ + obtain ⟨v, eqv, hv⟩ := first z hi + obtain ⟨w, eqw, hw⟩ := second z hj + have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) + exact different (hv.symm.trans ((congrFun equal 0).trans hw)) + +theorem union_level_graph (first : RefinementIndexLevelCode I level) + (second : RefinementIndexLevelCode J next) : + refinementIndexFieldGraph (I ∪ J) {level, next} 0 = + ZFSet.prod I {level} ∪ ZFSet.prod J {next} := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hz).1) + obtain ⟨hx, _, v, eqv, hy⟩ := + (pair_mem_refinementIndexFieldGraph (I ∪ J) {level, next} x y 0).1 hz + rcases ZFSet.mem_union.1 hx with hi | hj + · obtain ⟨w, eqw, hw⟩ := first x hi + have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) + exact ZFSet.mem_union.2 (Or.inl (ZFSet.pair_mem_prod.2 + ⟨hi, ZFSet.mem_singleton.2 (hy.trans ((congrFun equal 0).trans hw))⟩)) + · obtain ⟨w, eqw, hw⟩ := second x hj + have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) + exact ZFSet.mem_union.2 (Or.inr (ZFSet.pair_mem_prod.2 + ⟨hj, ZFSet.mem_singleton.2 (hy.trans ((congrFun equal 0).trans hw))⟩)) + · intro hz + rcases ZFSet.mem_union.1 hz with hi | hj + · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hi + obtain ⟨v, eqv, hv⟩ := first x hx + have yl := ZFSet.mem_singleton.1 hy + have bound : y ∈ ({level, next} : ZFSet.{u}) := by + simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton] + exact Or.inl yl + exact (pair_mem_refinementIndexFieldGraph (I ∪ J) {level, next} x y 0).2 + ⟨ZFSet.mem_union.2 (Or.inl hx), bound, v, eqv, yl.trans hv.symm⟩ + · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hj + obtain ⟨v, eqv, hv⟩ := second x hx + have yn := ZFSet.mem_singleton.1 hy + have bound : y ∈ ({level, next} : ZFSet.{u}) := by + simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton] + exact Or.inr yn + exact (pair_mem_refinementIndexFieldGraph (I ∪ J) {level, next} x y 0).2 + ⟨ZFSet.mem_union.2 (Or.inr hx), bound, v, eqv, yn.trans hv.symm⟩ + +theorem union_level_function (first : RefinementIndexLevelCode I level) + (second : RefinementIndexLevelCode J next) : + ZFSet.IsFunc (I ∪ J) {level, next} + (refinementIndexFieldGraph (I ∪ J) {level, next} 0) := by + apply refinementIndexFieldGraph_function + intro z hz + rcases ZFSet.mem_union.1 hz with hi | hj + · obtain ⟨v, eqv, hv⟩ := first z hi + exact ⟨v, eqv, by simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton]; exact Or.inl hv⟩ + · obtain ⟨v, eqv, hv⟩ := second z hj + exact ⟨v, eqv, by simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton]; exact Or.inr hv⟩ + +theorem union_level_entry (first : RefinementIndexLevelCode I level) + (second : RefinementIndexLevelCode J next) (x y : ZFSet.{u}) : + ZFSet.pair x y ∈ refinementIndexFieldGraph (I ∪ J) {level, next} 0 ↔ + (x ∈ I ∧ y = level) ∨ (x ∈ J ∧ y = next) := by + rw [first.union_level_graph second] + simp only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton] + +end RefinementIndexLevelCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def RefinementIndexSelectionCode (M : TransitiveGround.{u}) + (level r candidates relations T P order top z : ZFSet.{u}) : Prop := + ∃ C E U Rf Rc N V, + z = refinementIndexCode level C E U Rf Rc ∧ ZFSet.pair C E ∈ r ∧ C ≠ E ∧ + ZFSet.pair C N ∈ candidates ∧ U ∈ N ∧ ZFSet.pair C V ∈ relations ∧ + Rf ∈ V ∧ Rc ∈ V ∧ + Realize M.sets (refinementValidityForcingFormula 0 1 2 3 4 5 6) + ![U, Rf, Rc, T, P, order, top] + +namespace SetFormula + +def refinementIndexSelectionRawFormula {n} (z level r candidates relations T P order top : Fin n) + (w : Fin 7 → Fin n) : SetFormula n := + .conj (BoundedFormula.refinementIndexFormula z level (w 0) (w 1) (w 2) (w 3) (w 4)).toFormula + (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 1) r).toFormula + (.conj (.neg (.equal (w 0) (w 1))) + (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 5) candidates).toFormula + (.conj (.mem (w 2) (w 5)) + (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 6) relations).toFormula + (.conj (.mem (w 3) (w 6)) (.conj (.mem (w 4) (w 6)) + (reindex ![w 2, w 3, w 4, T, P, order, top] + (refinementValidityForcingFormula 0 1 2 3 4 5 6))))))))) + +def refinementIndexSelectionFormula {n} (z level r candidates relations T P order top : Fin n) : SetFormula n := + let old := suffixIndex n 7 + exBlock 7 (refinementIndexSelectionRawFormula (old z) (old level) (old r) + (old candidates) (old relations) (old T) (old P) (old order) (old top) (prefixIndex n 7)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_refinementIndexSelectionRawFormula {n} + (z level r candidates relations T P order top : Fin n) (w : Fin 7 → Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (refinementIndexSelectionRawFormula z level r candidates relations T P order top w) env ↔ + env z = refinementIndexCode (env level) (env (w 0)) (env (w 1)) (env (w 2)) (env (w 3)) (env (w 4)) ∧ + ZFSet.pair (env (w 0)) (env (w 1)) ∈ env r ∧ env (w 0) ≠ env (w 1) ∧ + ZFSet.pair (env (w 0)) (env (w 5)) ∈ env candidates ∧ env (w 2) ∈ env (w 5) ∧ + ZFSet.pair (env (w 0)) (env (w 6)) ∈ env relations ∧ + env (w 3) ∈ env (w 6) ∧ env (w 4) ∈ env (w 6) ∧ + Realize M.sets (refinementValidityForcingFormula 0 1 2 3 4 5 6) + ![env (w 2), env (w 3), env (w 4), env T, env P, env order, env top] := by + have mapped : (fun j : Fin 7 => env (![w 2, w 3, w 4, T, P, order, top] j)) = + ![env (w 2), env (w 3), env (w 4), env T, env P, env order, env top] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))) j + simp only [refinementIndexSelectionRawFormula, Realize, + BoundedFormula.realize_toFormula M _ env members, + BoundedFormula.truth_refinementIndexFormula, BoundedFormula.truth_pairMembershipFormula, + SetFormula.realize_reindex, mapped] + +theorem realize_refinementIndexSelectionFormula {n} + (z level r candidates relations T P order top : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (refinementIndexSelectionFormula z level r candidates relations T P order top) env ↔ + RefinementIndexSelectionCode M (env level) (env r) (env candidates) (env relations) + (env T) (env P) (env order) (env top) (env z) := by + rw [refinementIndexSelectionFormula, realize_exBlock] + have actual (w : Fin 7 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) := + M.realize_refinementIndexSelectionRawFormula (suffixIndex n 7 z) (suffixIndex n 7 level) + (suffixIndex n 7 r) (suffixIndex n 7 candidates) (suffixIndex n 7 relations) + (suffixIndex n 7 T) (suffixIndex n 7 P) (suffixIndex n 7 order) (suffixIndex n 7 top) + (prefixIndex n 7) (extendMany 7 w env) (extendMany_members 7 w env ground members) + simp only [extendMany_prefix, extendMany_suffix] at actual + constructor + · rintro ⟨w, ground, selected⟩ + exact ⟨w 0, w 1, w 2, w 3, w 4, w 5, w 6, (actual w ground).1 selected⟩ + · rintro ⟨C, E, U, Rf, Rc, N, V, equal, edge, strict, first, hU, second, hf, hc, forced⟩ + have fields := M.refinementIndexCode_fields_mem (equal ▸ members z) + have hN := M.pair_right (M.transitive (members candidates) first) + have hV := M.pair_right (M.transitive (members relations) second) + let w : Fin 7 → ZFSet.{u} := ![C, E, U, Rf, Rc, N, V] + have ground : ∀ j, w j ∈ M.sets := + Fin.cases fields.2.1 (Fin.cases fields.2.2.1 (Fin.cases fields.2.2.2.1 + (Fin.cases fields.2.2.2.2.1 (Fin.cases fields.2.2.2.2.2 + (Fin.cases hN (Fin.cases hV (fun j => Fin.elim0 j))))))) + exact ⟨w, ground, (actual w ground).2 ⟨equal, edge, strict, first, hU, second, hf, hc, forced⟩⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def refinementIndices + (level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (RefinementIndexSelectionCode M level r candidates relations T P order top) + (refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P)) + +theorem mem_refinementIndices + (level nodes r candidates relations T1 T2 T P order top z : ZFSet.{u}) : + z ∈ M.refinementIndices level nodes r candidates relations T1 T2 T P order top ↔ + z ∈ refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P) ∧ + RefinementIndexSelectionCode M level r candidates relations T P order top z := + ZFSet.mem_sep + +theorem refinementIndexCode_mem_indices + (level nodes r candidates relations T1 T2 T P order top C E U Rf Rc : ZFSet.{u}) : + refinementIndexCode level C E U Rf Rc ∈ + M.refinementIndices level nodes r candidates relations T1 T2 T P order top ↔ + C ∈ nodes ∧ E ∈ nodes ∧ U ∈ M.groundRelations T1 P ∧ + Rf ∈ M.groundRelations T2 P ∧ Rc ∈ M.groundRelations T2 P ∧ + ZFSet.pair C E ∈ r ∧ C ≠ E ∧ + ∃ N V, ZFSet.pair C N ∈ candidates ∧ U ∈ N ∧ + ZFSet.pair C V ∈ relations ∧ Rf ∈ V ∧ Rc ∈ V ∧ + Realize M.sets (refinementValidityForcingFormula 0 1 2 3 4 5 6) + ![U, Rf, Rc, T, P, order, top] := by + rw [M.mem_refinementIndices, refinementIndexCode_mem_bound] + constructor + · rintro ⟨⟨_, hC, hE, hU, hf, hc⟩, c, e, a, f, t, N, V, equal, edge, strict, first, ha, second, hff, hcc, forced⟩ + obtain ⟨_, rfl, rfl, rfl, rfl, rfl⟩ := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 equal + exact ⟨hC, hE, hU, hf, hc, edge, strict, N, V, first, ha, second, hff, hcc, forced⟩ + · rintro ⟨hC, hE, hU, hf, hc, edge, strict, N, V, first, ha, second, hff, hcc, forced⟩ + exact ⟨⟨ZFSet.mem_singleton.2 rfl, hC, hE, hU, hf, hc⟩, + C, E, U, Rf, Rc, N, V, rfl, edge, strict, first, ha, second, hff, hcc, forced⟩ + +theorem refinementIndices_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}} + (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) (hr : r ∈ M.sets) + (hc : candidates ∈ M.sets) (hrel : relations ∈ M.sets) + (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hT : T ∈ M.sets) + (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) : + M.refinementIndices level nodes r candidates relations T1 T2 T P order top ∈ M.sets := by + let B := refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P) + have hB := M.refinementIndexBound_mem pairing unions powers separation + (by simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hl hl) hn + (M.groundRelations_mem pairing unions powers separation hT1 hP) + (M.groundRelations_mem pairing unions powers separation hT2 hP) + let params : Fin 8 → ZFSet.{u} := ![level, r, candidates, relations, T, P, order, top] + have members : ∀ j, params j ∈ M.sets := + Fin.cases hl (Fin.cases hr (Fin.cases hc (Fin.cases hrel (Fin.cases hT + (Fin.cases hP (Fin.cases ho (Fin.cases ht (fun j => Fin.elim0 j)))))))) + let φ : SetFormula 9 := refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 + have ground := M.separation_mem separation φ params members hB + have equal : ZFSet.sep (fun z => Realize M.sets φ (extend z params)) B = + M.refinementIndices level nodes r candidates relations T1 T2 T P order top := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_refinementIndices] + apply and_congr_right + intro hz + exact M.realize_refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 + (extend z params) (Fin.cases (M.transitive hB hz) members) + exact equal ▸ ground + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + +noncomputable def niceRefinementIndices (level T1 T2 : ZFSet.{u}) + (valid : ∀ z ∈ T1, IsName s z) : ZFSet.{u} := + M.refinementIndices level b.carrier b.conditionOrder + (M.niceNameCandidateGraph a s b T1 d.principalFix) + (M.niceNameCandidateGraph a s b T2 d.principalFix) T1 T2 + (Name.familySet ⊤ T1 valid).val s.carrier s.conditionOrder (s.encode ⊤) + +theorem niceRefinementIndices_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {level T1 T2 : ZFSet.{u}} (valid : ∀ z ∈ T1, IsName s z) + (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (first : M.niceNameCandidateGraph a s b T1 d.principalFix ∈ M.sets) + (second : M.niceNameCandidateGraph a s b T2 d.principalFix ∈ M.sets) : + M.niceRefinementIndices a s b d level T1 T2 valid ∈ M.sets := by + have top := M.transitive carrier (s.encode_mem ⊤) + exact M.refinementIndices_mem pairing unions powers separation hl nodes nodeOrder first second + hT1 hT2 (M.familySet_mem s ⊤ pairing unions powers separation hT1 top valid) carrier order top + +theorem niceRefinementIndex_mem_iff + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (level T1 T2 : ZFSet.{u}) (valid : ∀ z ∈ T1, IsName s z) + (familyGround : (Name.familySet ⊤ T1 valid).val ∈ M.sets) + (C E : L) (U Rf Rc : (M.nameDomain s).names) : + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid ↔ + C < E ∧ U.val.val ∈ M.niceNameCandidates a s T1 (d.principalFix C) ∧ + Rf.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ + Rc.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ + Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula + (extend U (extend Rf (extend Rc (extend ⟨Name.familySet ⊤ T1 valid, familyGround⟩ Fin.elim0)))) ⊤ := by + let T : (M.nameDomain s).names := ⟨Name.familySet ⊤ T1 valid, familyGround⟩ + let names := extend U (extend Rf (extend Rc (extend T Fin.elim0))) + have forcing := M.realize_refinementValidityForcing s pairing unions powers separation collection carrier order + 0 1 2 3 4 5 6 ![U.val.val, Rf.val.val, Rc.val.val, T.val.val, s.carrier, s.conditionOrder, s.encode ⊤] + names ⊤ rfl rfl rfl rfl rfl rfl rfl + rw [niceRefinementIndices, M.refinementIndexCode_mem_indices] + constructor + · rintro ⟨_, _, _, _, _, edge, strict, N, V, first, hU, second, hf, hc, forced⟩ + have nEq := (M.pair_mem_niceNameCandidateGraph a s b T1 d.principalFix C N).1 first + have vEq := (M.pair_mem_niceNameCandidateGraph a s b T2 d.principalFix C V).1 second + subst N + subst V + have lower := (b.pair_mem_conditionOrder C E).1 edge + have different : C ≠ E := fun eq => strict (congrArg b.encode eq) + exact ⟨lt_of_le_of_ne lower different, hU, hf, hc, forcing.1 forced⟩ + · rintro ⟨strict, hU, hf, hc, forced⟩ + refine ⟨b.encode_mem C, b.encode_mem E, M.niceNameCandidates_subset a s T1 _ hU, + M.niceNameCandidates_subset a s T2 _ hf, M.niceNameCandidates_subset a s T2 _ hc, + (b.pair_mem_conditionOrder C E).2 strict.le, + (fun eq => strict.ne (b.injective eq)), M.niceNameCandidates a s T1 (d.principalFix C), + M.niceNameCandidates a s T2 (d.principalFix C), ?_, hU, ?_, hf, hc, forcing.2 forced⟩ + · exact (M.pair_mem_niceNameCandidateGraph a s b T1 d.principalFix C _).2 rfl + · exact (M.pair_mem_niceNameCandidateGraph a s b T2 d.principalFix C _).2 rfl + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}) +local notation "I" => M.refinementIndices level nodes r candidates relations T1 T2 T P order top +local notation "bounds" => (![Singleton.singleton level, nodes, nodes, M.groundRelations T1 P, + M.groundRelations T2 P, M.groundRelations T2 P]) + +theorem refinementIndices_fields {z : ZFSet.{u}} (hz : z ∈ I) : + ∃ fields : Fin 6 → ZFSet.{u}, z = nonemptyTupleCode 5 fields ∧ ∀ j, fields j ∈ bounds j := by + obtain ⟨l, hl, C, hC, E, hE, U, hU, Rf, hf, Rc, hc, eq⟩ := + (mem_refinementIndexBound _ _ _ _ z).1 ((M.mem_refinementIndices _ _ _ _ _ _ _ _ _ _ _ _).1 hz).1 + refine ⟨![l, C, E, U, Rf, Rc], eq, ?_⟩ + exact Fin.cases hl (Fin.cases hC (Fin.cases hE (Fin.cases hU + (Fin.cases hf (Fin.cases hc (fun j => Fin.elim0 j)))))) + +theorem refinementIndices_field_function (j : Fin 6) : + ZFSet.IsFunc I (bounds j) (refinementIndexFieldGraph I (bounds j) j) := by + apply refinementIndexFieldGraph_function + intro z hz + obtain ⟨v, equal, bound⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hz + exact ⟨v, equal, bound j⟩ + +theorem refinementIndices_fields_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) (hr : r ∈ M.sets) + (hc : candidates ∈ M.sets) (hrel : relations ∈ M.sets) + (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hT : T ∈ M.sets) + (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) : + ∀ j : Fin 6, refinementIndexFieldGraph I (bounds j) j ∈ M.sets := by + have hI := M.refinementIndices_mem pairing unions powers separation + hl hn hr hc hrel hT1 hT2 hT hP ho ht + have hV := M.groundRelations_mem pairing unions powers separation hT1 hP + have hW := M.groundRelations_mem pairing unions powers separation hT2 hP + have hs : ({level} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hl hl + have ground : ∀ j : Fin 6, bounds j ∈ M.sets := + Fin.cases hs (Fin.cases hn (Fin.cases hn (Fin.cases hV + (Fin.cases hW (Fin.cases hW (fun j => Fin.elim0 j)))))) + exact fun j => M.refinementIndexFieldGraph_mem pairing unions powers separation hI (ground j) j + +theorem refinementIndices_level_graph : + refinementIndexFieldGraph I {level} 0 = ZFSet.prod I {level} := by + apply ZFSet.ext + intro z + constructor + · intro hz + exact (ZFSet.mem_sep.1 hz).1 + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + obtain ⟨v, equal, bound⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hx + have same : y = v 0 := (ZFSet.mem_singleton.1 hy).trans (ZFSet.mem_singleton.1 (bound 0)).symm + exact (pair_mem_refinementIndexFieldGraph I {level} x y 0).2 ⟨hx, hy, v, equal, same⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + +theorem exists_niceRefinementIndex_fields (level T1 T2 : ZFSet.{u}) + (valid1 : ∀ z ∈ T1, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) + {z : ZFSet.{u}} (member : z ∈ M.niceRefinementIndices a s b d level T1 T2 valid1) : + ∃ C E : L, ∃ U Rf Rc : (M.nameDomain s).names, + z = refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val := by + have bound := ((M.mem_refinementIndices _ _ _ _ _ _ _ _ _ _ _ z).1 member).1 + obtain ⟨l, hl, C, hC, E, hE, U, hU, Rf, hf, Rc, hc, equal⟩ := + (mem_refinementIndexBound _ _ _ _ z).1 bound + have same : l = level := ZFSet.mem_singleton.1 hl + subst l + obtain ⟨c, rfl⟩ := (b.mem_carrier C).1 hC + obtain ⟨e, rfl⟩ := (b.mem_carrier E).1 hE + have domain := (M.mem_groundRelations T1 s.carrier U).1 hU + have fine := (M.mem_groundRelations T2 s.carrier Rf).1 hf + have coarse := (M.mem_groundRelations T2 s.carrier Rc).1 hc + exact ⟨c, e, ⟨Name.ofSubset valid1 domain.2, domain.1⟩, + ⟨Name.ofSubset valid2 fine.2, fine.1⟩, ⟨Name.ofSubset valid2 coarse.2, coarse.1⟩, equal⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u + +theorem normalizedRefinementIndex_mem + (M : TransitiveGround.{u}) + {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + (a : PosetAction G P) (s : Presentation P) + (b : Presentation L) (d : PosetAction G L) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (level T1 T2 : ZFSet.{u}) (valid : ∀ z ∈ T1, IsName s z) + (C E : L) (normalized : Assignment (M.nameDomain s) 4) + (last : (normalized 3).val = Name.familySet ⊤ T1 valid) + (strict : C < E) + (niceU : NiceNameCode a s T1 (d.principalFix C) (normalized 0).val.val) + (niceRf : NiceNameCode a s T2 (d.principalFix C) (normalized 1).val.val) + (niceRc : NiceNameCode a s T2 (d.principalFix C) (normalized 2).val.val) + (forced : Forces (M.nameDomain s) + BoundedFormula.refinementValidityFormula.toFormula normalized ⊤) : + refinementIndexCode level (b.encode C) (b.encode E) + (normalized 0).val.val (normalized 1).val.val (normalized 2).val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid := by + have familyGround : (Name.familySet ⊤ T1 valid).val ∈ M.sets := by + rw [← last] + exact (normalized 3).property + have lastName : normalized 3 = ⟨Name.familySet ⊤ T1 valid, familyGround⟩ := + Subtype.ext last + have normalizedEq : normalized = + extend (normalized 0) (extend (normalized 1) (extend (normalized 2) + (extend ⟨Name.familySet ⊤ T1 valid, familyGround⟩ Fin.elim0))) := by + funext i + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases lastName (fun j => Fin.elim0 j)))) i + apply (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation + collection carrier order level T1 T2 valid familyGround C E + (normalized 0) (normalized 1) (normalized 2)).2 + refine ⟨strict, ?_, ?_, ?_, normalizedEq ▸ forced⟩ + · exact (M.mem_niceNameCandidates a s T1 (d.principalFix C) _).2 + ⟨(normalized 0).property, niceU⟩ + · exact (M.mem_niceNameCandidates a s T2 (d.principalFix C) _).2 + ⟨(normalized 1).property, niceRf⟩ + · exact (M.mem_niceNameCandidates a s T2 (d.principalFix C) _).2 + ⟨(normalized 2).property, niceRc⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +namespace TransitiveGround +noncomputable def niceRefinementIndexBounds (M : TransitiveGround.{u}) + (s : Presentation P) (b : Presentation L) (level T1 T2 : ZFSet.{u}) : Fin 6 → ZFSet.{u} := + ![{level}, b.carrier, b.carrier, M.groundRelations T1 s.carrier, + M.groundRelations T2 s.carrier, M.groundRelations T2 s.carrier] + +end TransitiveGround + +structure NiceRefinementIndexSystem (M : TransitiveGround.{u}) + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + (level T1 T2 : ZFSet.{u}) (valid1 : ∀ z ∈ T1, IsName s z) + (valid2 : ∀ z ∈ T2, IsName s z) : Prop where + index_ground : M.niceRefinementIndices a s b d level T1 T2 valid1 ∈ M.sets + family_ground : (Name.familySet ⊤ T1 valid1).val ∈ M.sets + first_candidates_ground : M.niceNameCandidateGraph a s b T1 d.principalFix ∈ M.sets + second_candidates_ground : M.niceNameCandidateGraph a s b T2 d.principalFix ∈ M.sets + field_ground : ∀ j, refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndexBounds s b level T1 T2 j) j ∈ M.sets + field_function : ∀ j, ZFSet.IsFunc (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndexBounds s b level T1 T2 j) + (refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) + (M.niceRefinementIndexBounds s b level T1 T2 j) j) + level_graph : refinementIndexFieldGraph (M.niceRefinementIndices a s b d level T1 T2 valid1) + {level} 0 = ZFSet.prod (M.niceRefinementIndices a s b d level T1 T2 valid1) {level} + typed_entries : ∀ C E (U Rf Rc : (M.nameDomain s).names), + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid1 ↔ + C < E ∧ U.val.val ∈ M.niceNameCandidates a s T1 (d.principalFix C) ∧ + Rf.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ + Rc.val.val ∈ M.niceNameCandidates a s T2 (d.principalFix C) ∧ + Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula + (extend U (extend Rf (extend Rc (extend ⟨Name.familySet ⊤ T1 valid1, family_ground⟩ Fin.elim0)))) ⊤ + decoded : ∀ z ∈ M.niceRefinementIndices a s b d level T1 T2 valid1, + ∃ C E : L, ∃ U Rf Rc : (M.nameDomain s).names, + z = refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) +variable (b : Presentation L) (d : PosetAction G L) + +theorem niceRefinementIndexSystem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {level T1 T2 : ZFSet.{u}} {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} + (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} + (first : NiceNameSystem M a s b d base directed T1 valid1) + (second : NiceNameSystem M a s b d base directed T2 valid2) : + NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2 := by + have top := M.transitive carrier (s.encode_mem ⊤) + have family := M.familySet_mem s ⊤ pairing unions powers separation hT1 top valid1 + refine ⟨M.niceRefinementIndices_mem a s b d pairing unions powers separation valid1 hl hT1 hT2 + carrier order nodes nodeOrder first.candidate_graph_ground second.candidate_graph_ground, + family, first.candidate_graph_ground, second.candidate_graph_ground, ?_, ?_, ?_, ?_, ?_⟩ + · exact M.refinementIndices_fields_ground _ _ _ _ _ _ _ _ _ _ _ pairing unions powers separation + hl nodes nodeOrder first.candidate_graph_ground second.candidate_graph_ground hT1 hT2 family carrier order top + · exact M.refinementIndices_field_function _ _ _ _ _ _ _ _ _ _ _ + · exact M.refinementIndices_level_graph _ _ _ _ _ _ _ _ _ _ _ + · exact M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order level T1 T2 valid1 family + · exact fun _ hz => M.exists_niceRefinementIndex_fields a s b d level T1 T2 valid1 valid2 hz + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.NiceRefinementIndexSystem +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {G P Q L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] +variable [PartialOrder L] +variable {a : PosetAction G P} {e : PosetAction G Q} +variable {s : Presentation P} {t : Presentation Q} {b : Presentation L} {d : PosetAction G L} +variable {level next T T2 U U2 : ZFSet.{u}} +variable {valid : ∀ z ∈ T, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} +variable {upperValid : ∀ z ∈ U, IsName t z} {upperValid2 : ∀ z ∈ U2, IsName t z} +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "J" => M.niceRefinementIndices e t b d next U U2 upperValid + +theorem levelCode (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) : + RefinementIndexLevelCode I level := by + intro z hz + obtain ⟨C, E, X, Rf, Rc, equal⟩ := first.decoded z hz + exact ⟨![level, b.encode C, b.encode E, X.val.val, Rf.val.val, Rc.val.val], equal, rfl⟩ + +theorem different_levels_disjoint + (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + (second : NiceRefinementIndexSystem M e t b d next U U2 upperValid upperValid2) + (different : level ≠ next) : ∀ z, ¬ (z ∈ I ∧ z ∈ J) := + first.levelCode.disjoint second.levelCode different + +theorem union_level_data + (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + (second : NiceRefinementIndexSystem M e t b d next U U2 upperValid upperValid2) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hLevel : level ∈ M.sets) (hNext : next ∈ M.sets) : + I ∪ J ∈ M.sets ∧ + refinementIndexFieldGraph (I ∪ J) {level, next} 0 ∈ M.sets ∧ + ZFSet.IsFunc (I ∪ J) {level, next} (refinementIndexFieldGraph (I ∪ J) {level, next} 0) ∧ + refinementIndexFieldGraph (I ∪ J) {level, next} 0 = + ZFSet.prod I {level} ∪ ZFSet.prod J {next} := by + have ground := M.binary_union_mem pairing unions first.index_ground second.index_ground + exact ⟨ground, M.refinementIndexFieldGraph_mem pairing unions powers separation + ground (M.unorderedPair_mem pairing hLevel hNext) 0, + first.levelCode.union_level_function second.levelCode, + first.levelCode.union_level_graph second.levelCode⟩ + +end PartitionPilot.Forcing.NiceRefinementIndexSystem + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure RefinementObjectSystem (M : TransitiveGround.{u}) (a : PosetAction G P) + (s : Presentation P) (F : NormalSubgroupFamily G) (K : Subgroup G) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) : Prop where + ground : (Name.refinementQuotient T valid U Rf).val ∈ M.sets ∧ + (Name.refinementQuotient T valid U Rc).val ∈ M.sets ∧ + (Name.refinementNaturalMap T valid U Rf Rc).val ∈ M.sets + support : K ≤ a.stabilizer s (Name.refinementQuotient T valid U Rf) ∧ + K ≤ a.stabilizer s (Name.refinementQuotient T valid U Rc) ∧ + K ≤ a.stabilizer s (Name.refinementNaturalMap T valid U Rf Rc) + hs : HereditarilySymmetric a s F (Name.refinementQuotient T valid U Rf) ∧ + HereditarilySymmetric a s F (Name.refinementQuotient T valid U Rc) ∧ + HereditarilySymmetric a s F (Name.refinementNaturalMap T valid U Rf Rc) + classes : ∀ w : Name s, w.val ∈ T → + (Name.refinementClass T valid Rf w).val ∈ M.sets ∧ + (Name.refinementClass T valid Rc w).val ∈ M.sets ∧ + HereditarilySymmetric a s F (Name.refinementClass T valid Rf w) ∧ + HereditarilySymmetric a s F (Name.refinementClass T valid Rc w) + class_graphs : Name.refinementClassGraph T valid Rf T valid ∈ M.sets ∧ + Name.refinementClassGraph T valid Rc T valid ∈ M.sets ∧ + Name.refinementPairClassGraph T valid Rf Rc T valid ∈ M.sets + values : ∀ (H : ConditionFilter P), H.GenericFor (formulaFamily (M.nameDomain s)) → + RefinementObjectValues {p | H.mem p} T valid U Rf Rc + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) +variable (b : Presentation L) (d : PosetAction G L) (base : L) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +theorem niceRefinementObjects + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {level T1 T2 : ZFSet.{u}} {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} + (hl : level ∈ M.sets) (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (closed : ∀ g (w : Name s), w.val ∈ T1 → (a.act s g w).val ∈ T1) + (children : ∀ w : Name s, w.val ∈ T1 → + HereditarilySymmetric a s (d.principalSupportFamily base directed) w) + (first : NiceNameSystem M a s b d base directed T1 valid1) + (second : NiceNameSystem M a s b d base directed T2 valid2) : + NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2 ∧ + ∀ C E (U Rf Rc : (M.nameDomain s).names), + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid1 → + RefinementObjectSystem M a s (d.principalSupportFamily base directed) (d.principalFix C) + T1 valid1 U.val Rf.val Rc.val := by + have indices := M.niceRefinementIndexSystem a s b d pairing unions powers separation collection + hl hT1 hT2 carrier order nodes nodeOrder first second + refine ⟨indices, ?_⟩ + intro C E U Rf Rc entry + obtain ⟨_, hU, hRf, hRc, forced⟩ := (indices.typed_entries C E U Rf Rc).1 entry + have supportedU := ((M.name_mem_niceNameCandidates a s T1 (d.principalFix C) U.val).1 hU).2.2 + have supportedRf := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rf.val).1 hRf).2.2 + have supportedRc := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val).1 hRc).2.2 + have hsU := first.candidate_hs C U.val hU + have hsRf := second.candidate_hs C Rf.val hRf + have hsRc := second.candidate_hs C Rc.val hRc + refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact ⟨M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT1 valid1 U.val Rf.val U.property Rf.property, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT1 valid1 U.val Rc.val U.property Rc.property, + M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order + hT1 valid1 U.val Rf.val Rc.val U.property Rf.property Rc.property⟩ + · exact ⟨Name.refinementQuotient_support a T1 valid1 closed U.val Rf.val _ supportedU supportedRf, + Name.refinementQuotient_support a T1 valid1 closed U.val Rc.val _ supportedU supportedRc, + Name.refinementNaturalMap_support a T1 valid1 closed U.val Rf.val Rc.val _ supportedU supportedRf supportedRc⟩ + · exact ⟨Name.refinementQuotient_hs a T1 valid1 closed _ children U.val Rf.val hsU hsRf, + Name.refinementQuotient_hs a T1 valid1 closed _ children U.val Rc.val hsU hsRc, + Name.refinementNaturalMap_hs a T1 valid1 closed _ children U.val Rf.val Rc.val hsU hsRf hsRc⟩ + · intro w hw + exact ⟨M.refinementClass_mem s pairing unions powers separation collection carrier order + hT1 valid1 Rf.val w Rf.property (M.transitive hT1 hw), + M.refinementClass_mem s pairing unions powers separation collection carrier order + hT1 valid1 Rc.val w Rc.property (M.transitive hT1 hw), + Name.refinementClass_hs_of_hs a T1 valid1 closed _ children Rf.val w hsRf (children w hw), + Name.refinementClass_hs_of_hs a T1 valid1 closed _ children Rc.val w hsRc (children w hw)⟩ + · exact ⟨M.refinementClassGraph_mem s pairing unions powers separation collection carrier order + hT1 hT1 valid1 valid1 Rf.val Rf.property, + M.refinementClassGraph_mem s pairing unions powers separation collection carrier order + hT1 hT1 valid1 valid1 Rc.val Rc.property, + M.refinementPairClassGraph_mem s pairing unions powers separation collection carrier order + hT1 hT1 valid1 valid1 Rf.val Rc.val Rf.property Rc.property⟩ + · intro H generic + exact M.refinementObjects_eval s pairing carrier hT1 valid1 indices.family_ground + U Rf Rc H generic H.top_mem forced + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +theorem niceRefinementIndex_preserves_visibility + (s : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (a : PosetAction G P) (t : Presentation G) (maps : a.conditionMapFamily s t ∈ M.sets) + (b : Presentation L) (d : PosetAction G L) (base : L) + (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + {level T1 T2 : ZFSet.{u}} (hT1 : T1 ∈ M.sets) + {valid1 : ∀ z ∈ T1, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} + (terms : ∀ g (z : Name s), z.val ∈ T1 → (a.act s g z).val ∈ T1) + (system : NiceNameSystem M a s b d base directed T1 valid1) + (indices : NiceRefinementIndexSystem M a s b d level T1 T2 valid1 valid2) + (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T1 T2 valid1) + {v : L} (lower : C ≤ v) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {fineClass coarseClass : ZFSet.{u}} + (visible : fineClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T1 (d.principalFix v))) + (entry : ZFSet.pair fineClass coarseClass ∈ + Name.eval {p | H.mem p} (Name.refinementNaturalMap T1 valid1 U.val Rf.val Rc.val)) : + coarseClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T1 (d.principalFix v)) := by + obtain ⟨_, hU, _, hRc, forced⟩ := (indices.typed_entries C E U Rf Rc).1 member + have domain := ((M.name_mem_niceNameCandidates a s T1 (d.principalFix C) U.val).1 hU).2.2 + have relation := ((M.name_mem_niceNameCandidates a s T2 (d.principalFix C) Rc.val).1 hRc).2.2 + have values := M.refinementObjects_eval s pairing carrier hT1 valid1 indices.family_ground + U Rf Rc H generic H.top_mem forced + rw [values.natural_map] at entry + exact M.refinementQuotientMap_preserves_visibility s pairing unions powers separation collection + carrier order a t maps b d base directed hT1 valid1 terms system U Rf Rc lower domain relation + H generic values.validity visible entry + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNormalizedRefinementOutputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNormalizedRefinementOutputs.lean index 9804c325a200aa1e45512e381bf8b97371ed6bc4..3a7271216e4b8de08ff399d015d2d84a2b90663b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNormalizedRefinementOutputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundNormalizedRefinementOutputs.lean @@ -1,155 +1,155 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementValidityForcing -import OAI.SetTheory.PartitionPrinciple.Models.GroundRefinementQuotientNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -theorem equivalenceClass_empty_of_not_mem {U R x : ZFSet.{u}} - (shape : R ⊆ ZFSet.prod U U) (inactive : x ∉ U) : equivalenceClass U R x = ∅ := by - apply ZFSet.ext - intro y - constructor - · intro hy - exact False.elim (inactive (ZFSet.pair_mem_prod.1 (shape (mem_equivalenceClass U R x y |>.1 hy).2)).2) - · exact False.elim ∘ ZFSet.notMem_empty y - -structure RefinementObjectValues {P : Type u} [PartialOrder P] [OrderTop P] - {s : Presentation P} (H : Set P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U Rf Rc : Name s) : Prop where - validity : RefinementValidityCode (Name.eval H (Name.familySet ⊤ T valid)) - (Name.eval H U) (Name.eval H Rf) (Name.eval H Rc) - fine_class : ∀ w : Name s, w.val ∈ T → - Name.eval H (Name.refinementClass T valid Rf w) = - equivalenceClass (Name.eval H U) (Name.eval H Rf) (Name.eval H w) - coarse_class : ∀ w : Name s, w.val ∈ T → - Name.eval H (Name.refinementClass T valid Rc w) = - equivalenceClass (Name.eval H U) (Name.eval H Rc) (Name.eval H w) - fine_quotient : Name.eval H (Name.refinementQuotient T valid U Rf) = - equivalenceClasses (Name.eval H U) (Name.eval H Rf) - coarse_quotient : Name.eval H (Name.refinementQuotient T valid U Rc) = - equivalenceClasses (Name.eval H U) (Name.eval H Rc) - natural_map : Name.eval H (Name.refinementNaturalMap T valid U Rf Rc) = - refinementQuotientMap (Name.eval H U) (Name.eval H Rf) (Name.eval H Rc) - function : ZFSet.IsFunc (Name.eval H (Name.refinementQuotient T valid U Rf)) - (Name.eval H (Name.refinementQuotient T valid U Rc)) - (Name.eval H (Name.refinementNaturalMap T valid U Rf Rc)) - onto : ∀ C ∈ Name.eval H (Name.refinementQuotient T valid U Rc), - ∃ D ∈ Name.eval H (Name.refinementQuotient T valid U Rf), - ZFSet.pair D C ∈ Name.eval H (Name.refinementNaturalMap T valid U Rf Rc) - inactive : ∀ w : Name s, w.val ∈ T → Name.eval H w ∉ Name.eval H U → - Name.eval H (Name.refinementClass T valid Rf w) = ∅ ∧ - Name.eval H (Name.refinementClass T valid Rc w) = ∅ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) - -noncomputable def refinementNameEnv (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (hFamily : (Name.familySet ⊤ T valid).val ∈ M.sets) - (U Rf Rc : (M.nameDomain s).names) : Assignment (M.nameDomain s) 4 := - extend U (extend Rf (extend Rc (extend ⟨Name.familySet ⊤ T valid, hFamily⟩ Fin.elim0))) - -theorem refinementObjects_eval - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (hFamily : (Name.familySet ⊤ T valid).val ∈ M.sets) - (U Rf Rc : (M.nameDomain s).names) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (forced : Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula - (M.refinementNameEnv s T valid hFamily U Rf Rc) p) : - RefinementObjectValues {q | H.mem q} T valid U.val Rf.val Rc.val := by - have validity : RefinementValidityCode (Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) - (Name.eval {q | H.mem q} U.val) (Name.eval {q | H.mem q} Rf.val) (Name.eval {q | H.mem q} Rc.val) := - M.refinementValidity_eval s (M.refinementNameEnv s T valid hFamily U Rf Rc) H generic hp forced - have atomic : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := - fun E hE dense => generic E (Or.inl hE) dense - have terms (w : Name s) (hw : w.val ∈ T) : w ∈ (M.nameDomain s).names := M.transitive hT hw - have pairs (z w : Name s) (hz : z.val ∈ T) (hw : w.val ∈ T) : - Name.orderedPair ⊤ z w ∈ (M.nameDomain s).names := by - change (Name.orderedPair ⊤ z w).val ∈ M.sets - rw [Name.orderedPair_code] - exact M.orderedPairNameCode_mem pairing (M.transitive carrier (s.encode_mem ⊤)) - (M.transitive hT hz) (M.transitive hT hw) - have fineClass (w : Name s) (hw : w.val ∈ T) := - (M.eval_refinementClass s pairing carrier hT valid Rf.val w Rf.property (M.transitive hT hw) H generic).trans - (equivalenceClass_eq_of_carrier_subset validity.1 validity.2.1.shape (Name.eval {q | H.mem q} w)) - have coarseClass (w : Name s) (hw : w.val ∈ T) := - (M.eval_refinementClass s pairing carrier hT valid Rc.val w Rc.property (M.transitive hT hw) H generic).trans - (equivalenceClass_eq_of_carrier_subset validity.1 validity.2.2.1.shape (Name.eval {q | H.mem q} w)) - have fineQuotient := Name.eval_refinementQuotient (M.nameDomain s) H atomic T valid U.val Rf.val - U.property Rf.property terms pairs validity.1 validity.2.1.shape - have coarseQuotient := Name.eval_refinementQuotient (M.nameDomain s) H atomic T valid U.val Rc.val - U.property Rc.property terms pairs validity.1 validity.2.2.1.shape - have naturalMap := Name.eval_refinementNaturalMap (M.nameDomain s) H atomic T valid U.val Rf.val Rc.val - U.property Rf.property Rc.property terms pairs validity.1 validity.2.1.shape validity.2.2.1.shape - refine ⟨validity, fineClass, coarseClass, fineQuotient, coarseQuotient, naturalMap, ?_, ?_, ?_⟩ - · rw [fineQuotient, coarseQuotient, naturalMap] - exact refinementQuotientMap_function validity.2.1 validity.2.2.1 validity.2.2.2 - · intro C hC - rw [coarseQuotient] at hC - obtain ⟨D, hD, entry⟩ := refinementQuotientMap_onto (Rf := Name.eval {q | H.mem q} Rf.val) hC - exact ⟨D, fineQuotient.symm ▸ hD, naturalMap.symm ▸ entry⟩ - · intro w hw inactive - rw [fineClass w hw, coarseClass w hw] - exact ⟨equivalenceClass_empty_of_not_mem validity.2.1.shape inactive, - equivalenceClass_empty_of_not_mem validity.2.2.1.shape inactive⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u - -theorem normalizedRefinementOutputs - (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] - (s : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (normalized : Assignment (M.nameDomain s) 4) - (last : (normalized 3).val = Name.familySet ⊤ T valid) - (forced : Forces (M.nameDomain s) - BoundedFormula.refinementValidityFormula.toFormula normalized ⊤) : - (Name.refinementQuotient T valid (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ - (Name.refinementQuotient T valid (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ - (Name.refinementNaturalMap T valid (normalized 0).val (normalized 1).val - (normalized 2).val).val ∈ M.sets ∧ - ∀ H : ConditionFilter P, H.GenericFor (formulaFamily (M.nameDomain s)) → - RefinementObjectValues {p | H.mem p} T valid - (normalized 0).val (normalized 1).val (normalized 2).val := by - have familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets := by - rw [← last] - exact (normalized 3).property - have lastName : normalized 3 = ⟨Name.familySet ⊤ T valid, familyGround⟩ := Subtype.ext last - have sameEnv : normalized = M.refinementNameEnv s T valid familyGround - (normalized 0) (normalized 1) (normalized 2) := by - funext i - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases lastName (fun j => Fin.elim0 j)))) i - refine ⟨M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid _ _ (normalized 0).property (normalized 1).property, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid _ _ (normalized 0).property (normalized 2).property, - M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order - hT valid _ _ _ (normalized 0).property (normalized 1).property (normalized 2).property, ?_⟩ - intro H generic - exact M.refinementObjects_eval s pairing carrier hT valid familyGround - (normalized 0) (normalized 1) (normalized 2) H generic H.top_mem (sameEnv ▸ forced) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementValidityForcing +import OAI.SetTheory.PartitionPrinciple.Models.GroundRefinementQuotientNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +theorem equivalenceClass_empty_of_not_mem {U R x : ZFSet.{u}} + (shape : R ⊆ ZFSet.prod U U) (inactive : x ∉ U) : equivalenceClass U R x = ∅ := by + apply ZFSet.ext + intro y + constructor + · intro hy + exact False.elim (inactive (ZFSet.pair_mem_prod.1 (shape (mem_equivalenceClass U R x y |>.1 hy).2)).2) + · exact False.elim ∘ ZFSet.notMem_empty y + +structure RefinementObjectValues {P : Type u} [PartialOrder P] [OrderTop P] + {s : Presentation P} (H : Set P) (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U Rf Rc : Name s) : Prop where + validity : RefinementValidityCode (Name.eval H (Name.familySet ⊤ T valid)) + (Name.eval H U) (Name.eval H Rf) (Name.eval H Rc) + fine_class : ∀ w : Name s, w.val ∈ T → + Name.eval H (Name.refinementClass T valid Rf w) = + equivalenceClass (Name.eval H U) (Name.eval H Rf) (Name.eval H w) + coarse_class : ∀ w : Name s, w.val ∈ T → + Name.eval H (Name.refinementClass T valid Rc w) = + equivalenceClass (Name.eval H U) (Name.eval H Rc) (Name.eval H w) + fine_quotient : Name.eval H (Name.refinementQuotient T valid U Rf) = + equivalenceClasses (Name.eval H U) (Name.eval H Rf) + coarse_quotient : Name.eval H (Name.refinementQuotient T valid U Rc) = + equivalenceClasses (Name.eval H U) (Name.eval H Rc) + natural_map : Name.eval H (Name.refinementNaturalMap T valid U Rf Rc) = + refinementQuotientMap (Name.eval H U) (Name.eval H Rf) (Name.eval H Rc) + function : ZFSet.IsFunc (Name.eval H (Name.refinementQuotient T valid U Rf)) + (Name.eval H (Name.refinementQuotient T valid U Rc)) + (Name.eval H (Name.refinementNaturalMap T valid U Rf Rc)) + onto : ∀ C ∈ Name.eval H (Name.refinementQuotient T valid U Rc), + ∃ D ∈ Name.eval H (Name.refinementQuotient T valid U Rf), + ZFSet.pair D C ∈ Name.eval H (Name.refinementNaturalMap T valid U Rf Rc) + inactive : ∀ w : Name s, w.val ∈ T → Name.eval H w ∉ Name.eval H U → + Name.eval H (Name.refinementClass T valid Rf w) = ∅ ∧ + Name.eval H (Name.refinementClass T valid Rc w) = ∅ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) + +noncomputable def refinementNameEnv (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (hFamily : (Name.familySet ⊤ T valid).val ∈ M.sets) + (U Rf Rc : (M.nameDomain s).names) : Assignment (M.nameDomain s) 4 := + extend U (extend Rf (extend Rc (extend ⟨Name.familySet ⊤ T valid, hFamily⟩ Fin.elim0))) + +theorem refinementObjects_eval + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (carrier : s.carrier ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (hFamily : (Name.familySet ⊤ T valid).val ∈ M.sets) + (U Rf Rc : (M.nameDomain s).names) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (forced : Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula + (M.refinementNameEnv s T valid hFamily U Rf Rc) p) : + RefinementObjectValues {q | H.mem q} T valid U.val Rf.val Rc.val := by + have validity : RefinementValidityCode (Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) + (Name.eval {q | H.mem q} U.val) (Name.eval {q | H.mem q} Rf.val) (Name.eval {q | H.mem q} Rc.val) := + M.refinementValidity_eval s (M.refinementNameEnv s T valid hFamily U Rf Rc) H generic hp forced + have atomic : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := + fun E hE dense => generic E (Or.inl hE) dense + have terms (w : Name s) (hw : w.val ∈ T) : w ∈ (M.nameDomain s).names := M.transitive hT hw + have pairs (z w : Name s) (hz : z.val ∈ T) (hw : w.val ∈ T) : + Name.orderedPair ⊤ z w ∈ (M.nameDomain s).names := by + change (Name.orderedPair ⊤ z w).val ∈ M.sets + rw [Name.orderedPair_code] + exact M.orderedPairNameCode_mem pairing (M.transitive carrier (s.encode_mem ⊤)) + (M.transitive hT hz) (M.transitive hT hw) + have fineClass (w : Name s) (hw : w.val ∈ T) := + (M.eval_refinementClass s pairing carrier hT valid Rf.val w Rf.property (M.transitive hT hw) H generic).trans + (equivalenceClass_eq_of_carrier_subset validity.1 validity.2.1.shape (Name.eval {q | H.mem q} w)) + have coarseClass (w : Name s) (hw : w.val ∈ T) := + (M.eval_refinementClass s pairing carrier hT valid Rc.val w Rc.property (M.transitive hT hw) H generic).trans + (equivalenceClass_eq_of_carrier_subset validity.1 validity.2.2.1.shape (Name.eval {q | H.mem q} w)) + have fineQuotient := Name.eval_refinementQuotient (M.nameDomain s) H atomic T valid U.val Rf.val + U.property Rf.property terms pairs validity.1 validity.2.1.shape + have coarseQuotient := Name.eval_refinementQuotient (M.nameDomain s) H atomic T valid U.val Rc.val + U.property Rc.property terms pairs validity.1 validity.2.2.1.shape + have naturalMap := Name.eval_refinementNaturalMap (M.nameDomain s) H atomic T valid U.val Rf.val Rc.val + U.property Rf.property Rc.property terms pairs validity.1 validity.2.1.shape validity.2.2.1.shape + refine ⟨validity, fineClass, coarseClass, fineQuotient, coarseQuotient, naturalMap, ?_, ?_, ?_⟩ + · rw [fineQuotient, coarseQuotient, naturalMap] + exact refinementQuotientMap_function validity.2.1 validity.2.2.1 validity.2.2.2 + · intro C hC + rw [coarseQuotient] at hC + obtain ⟨D, hD, entry⟩ := refinementQuotientMap_onto (Rf := Name.eval {q | H.mem q} Rf.val) hC + exact ⟨D, fineQuotient.symm ▸ hD, naturalMap.symm ▸ entry⟩ + · intro w hw inactive + rw [fineClass w hw, coarseClass w hw] + exact ⟨equivalenceClass_empty_of_not_mem validity.2.1.shape inactive, + equivalenceClass_empty_of_not_mem validity.2.2.1.shape inactive⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u + +theorem normalizedRefinementOutputs + (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] + (s : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (T : ZFSet.{u}) (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (normalized : Assignment (M.nameDomain s) 4) + (last : (normalized 3).val = Name.familySet ⊤ T valid) + (forced : Forces (M.nameDomain s) + BoundedFormula.refinementValidityFormula.toFormula normalized ⊤) : + (Name.refinementQuotient T valid (normalized 0).val (normalized 1).val).val ∈ M.sets ∧ + (Name.refinementQuotient T valid (normalized 0).val (normalized 2).val).val ∈ M.sets ∧ + (Name.refinementNaturalMap T valid (normalized 0).val (normalized 1).val + (normalized 2).val).val ∈ M.sets ∧ + ∀ H : ConditionFilter P, H.GenericFor (formulaFamily (M.nameDomain s)) → + RefinementObjectValues {p | H.mem p} T valid + (normalized 0).val (normalized 1).val (normalized 2).val := by + have familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets := by + rw [← last] + exact (normalized 3).property + have lastName : normalized 3 = ⟨Name.familySet ⊤ T valid, familyGround⟩ := Subtype.ext last + have sameEnv : normalized = M.refinementNameEnv s T valid familyGround + (normalized 0) (normalized 1) (normalized 2) := by + funext i + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases lastName (fun j => Fin.elim0 j)))) i + refine ⟨M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid _ _ (normalized 0).property (normalized 1).property, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid _ _ (normalized 0).property (normalized 2).property, + M.refinementNaturalMap_mem s pairing unions powers separation collection carrier order + hT valid _ _ _ (normalized 0).property (normalized 1).property (normalized 2).property, ?_⟩ + intro H generic + exact M.refinementObjects_eval s pairing carrier hT valid familyGround + (normalized 0) (normalized 1) (normalized 2) H generic H.top_mem (sameEnv ▸ forced) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOmegaOneRowModel.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOmegaOneRowModel.lean index 9978a66baa2bbcc9d09051830f0339ee8a7f5f3f..0aa75a75d2de10c68c4d026ffef0135930fcc2dc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOmegaOneRowModel.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOmegaOneRowModel.lean @@ -1,137 +1,137 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundInternalRowChoice - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - -noncomputable def groundOmegaOne : ZFSet.{u} := - Classical.choose (M.exists_groundHartogs pairing unions powers separation collection - (M.omega_mem separation infinite)) - -theorem groundOmegaOne_spec : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - C ∈ M.sets ∧ ordinalSetProperty C ∧ - (∀ A : ZFSet.{u}, A ∈ C ↔ A ∈ M.sets ∧ ordinalSetProperty A ∧ - M.groundEmbeddable A ZFSet.omega) ∧ ¬ M.groundEmbeddable C ZFSet.omega := - Classical.choose_spec (M.exists_groundHartogs pairing unions powers separation collection - (M.omega_mem separation infinite)) - -theorem groundOmegaOne_eq_code_rank : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - C = ordinalCode (ZFSet.rank C) := - ordinalSetProperty_eq_code_rank _ - (M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.1 - -theorem groundOmegaOne_nonempty : - (M.groundOmegaOne pairing unions powers separation collection infinite).Nonempty := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - exact ⟨∅, (spec.2.2.1 ∅).2 - ⟨M.empty_mem ⟨ZFSet.omega, M.omega_mem separation infinite⟩, ordinalSetProperty_empty, - M.empty_groundEmbeddable ZFSet.omega ⟨ZFSet.omega, M.omega_mem separation infinite⟩⟩⟩ - -theorem groundOmegaOne_successor {A : ZFSet.{u}} - (hA : A ∈ M.groundOmegaOne pairing unions powers separation collection infinite) : - insert A A ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - obtain ⟨hAM, ordinal, small⟩ := (spec.2.2.1 A).1 hA - exact (spec.2.2.1 _).2 ⟨M.insert_mem pairing unions hAM hAM, - ordinalSetProperty_succ ordinal, - M.groundEmbeddable_insert pairing unions powers separation infinite hAM hAM small⟩ - -theorem groundOmegaOne_countable_bound - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R : ZFSet.{u}} (hR : R ∈ M.sets) - (subset : R ⊆ M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.groundEmbeddable R ZFSet.omega) : - ∃ B ∈ M.groundOmegaOne pairing unions powers separation collection infinite, - ∀ A ∈ R, A ∈ B := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have ordinals : ∀ A ∈ R, ordinalSetProperty A := fun A hA => ((spec.2.2.1 A).1 (subset hA)).2.1 - have membersSmall : ∀ A ∈ R, M.groundEmbeddable A ZFSet.omega := - fun A hA => ((spec.2.2.1 A).1 (subset hA)).2.2 - have hU := M.union_mem unions hR - have ordU := ordinalSetProperty_sUnion ordinals - have smallU := M.groundCountable_family_union pairing unions powers separation infinite choice - hR small membersSmall - have uC := (spec.2.2.1 (⋃₀ R)).2 ⟨hU, ordU, smallU⟩ - refine ⟨insert (⋃₀ R) (⋃₀ R), - M.groundOmegaOne_successor pairing unions powers separation collection infinite uC, ?_⟩ - intro A hA - have included : A ⊆ ⋃₀ R := fun x hx => ZFSet.mem_sUnion.2 ⟨A, hA, hx⟩ - obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff A).1 (ordinals A hA) - obtain ⟨b, eqB⟩ := (ordinalSetProperty_iff (⋃₀ R)).1 ordU - rw [eqA, eqB] at included ⊢ - rw [← ordinalCode_succ, mem_ordinalCode_iff] - exact Order.lt_succ_iff.2 ((ordinalCode_subset_iff a b).1 included) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] - -theorem exists_internalRow_ZF_not_choice_groundOmegaOne - (a : PosetAction G L) (s : Presentation L) (b : Presentation G) - (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) - (countableBound : ∀ A ∈ M.sets, A ⊆ s.carrier → M.groundEmbeddable A ZFSet.omega → - ∃ D : L, ∀ i : L, s.encode i ∈ A → i ≤ D) - (separate : ∀ B D : L, B ≤ D → ∃ g : G, g ∈ a.principalFix B ∧ - ∀ x : L, x ≤ D → x ≤ a.iso g D → x ≤ B) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) - (hL : s.carrier ∈ M.sets) (hG : b.carrier ∈ M.sets) - (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier - (M.groundOmegaOne pairing unions powers separation collection infinite)) - (natSetCode 2) ZFSet.omega)) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - let hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : L) directed - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - exact M.exists_internalRow_ZF_not_choice a s b - (M.groundOmegaOne pairing unions powers separation collection infinite) - directed unbounded countableBound separate small pairing unions powers separation collection infinite - groundChoice hL spec.1 hG order graph spec.2.2.2 p - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundInternalRowChoice + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + +noncomputable def groundOmegaOne : ZFSet.{u} := + Classical.choose (M.exists_groundHartogs pairing unions powers separation collection + (M.omega_mem separation infinite)) + +theorem groundOmegaOne_spec : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + C ∈ M.sets ∧ ordinalSetProperty C ∧ + (∀ A : ZFSet.{u}, A ∈ C ↔ A ∈ M.sets ∧ ordinalSetProperty A ∧ + M.groundEmbeddable A ZFSet.omega) ∧ ¬ M.groundEmbeddable C ZFSet.omega := + Classical.choose_spec (M.exists_groundHartogs pairing unions powers separation collection + (M.omega_mem separation infinite)) + +theorem groundOmegaOne_eq_code_rank : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + C = ordinalCode (ZFSet.rank C) := + ordinalSetProperty_eq_code_rank _ + (M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.1 + +theorem groundOmegaOne_nonempty : + (M.groundOmegaOne pairing unions powers separation collection infinite).Nonempty := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + exact ⟨∅, (spec.2.2.1 ∅).2 + ⟨M.empty_mem ⟨ZFSet.omega, M.omega_mem separation infinite⟩, ordinalSetProperty_empty, + M.empty_groundEmbeddable ZFSet.omega ⟨ZFSet.omega, M.omega_mem separation infinite⟩⟩⟩ + +theorem groundOmegaOne_successor {A : ZFSet.{u}} + (hA : A ∈ M.groundOmegaOne pairing unions powers separation collection infinite) : + insert A A ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + obtain ⟨hAM, ordinal, small⟩ := (spec.2.2.1 A).1 hA + exact (spec.2.2.1 _).2 ⟨M.insert_mem pairing unions hAM hAM, + ordinalSetProperty_succ ordinal, + M.groundEmbeddable_insert pairing unions powers separation infinite hAM hAM small⟩ + +theorem groundOmegaOne_countable_bound + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R : ZFSet.{u}} (hR : R ∈ M.sets) + (subset : R ⊆ M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.groundEmbeddable R ZFSet.omega) : + ∃ B ∈ M.groundOmegaOne pairing unions powers separation collection infinite, + ∀ A ∈ R, A ∈ B := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have ordinals : ∀ A ∈ R, ordinalSetProperty A := fun A hA => ((spec.2.2.1 A).1 (subset hA)).2.1 + have membersSmall : ∀ A ∈ R, M.groundEmbeddable A ZFSet.omega := + fun A hA => ((spec.2.2.1 A).1 (subset hA)).2.2 + have hU := M.union_mem unions hR + have ordU := ordinalSetProperty_sUnion ordinals + have smallU := M.groundCountable_family_union pairing unions powers separation infinite choice + hR small membersSmall + have uC := (spec.2.2.1 (⋃₀ R)).2 ⟨hU, ordU, smallU⟩ + refine ⟨insert (⋃₀ R) (⋃₀ R), + M.groundOmegaOne_successor pairing unions powers separation collection infinite uC, ?_⟩ + intro A hA + have included : A ⊆ ⋃₀ R := fun x hx => ZFSet.mem_sUnion.2 ⟨A, hA, hx⟩ + obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff A).1 (ordinals A hA) + obtain ⟨b, eqB⟩ := (ordinalSetProperty_iff (⋃₀ R)).1 ordU + rw [eqA, eqB] at included ⊢ + rw [← ordinalCode_succ, mem_ordinalCode_iff] + exact Order.lt_succ_iff.2 ((ordinalCode_subset_iff a b).1 included) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] + +theorem exists_internalRow_ZF_not_choice_groundOmegaOne + (a : PosetAction G L) (s : Presentation L) (b : Presentation G) + (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) + (countableBound : ∀ A ∈ M.sets, A ⊆ s.carrier → M.groundEmbeddable A ZFSet.omega → + ∃ D : L, ∀ i : L, s.encode i ∈ A → i ≤ D) + (separate : ∀ B D : L, B ≤ D → ∃ g : G, g ∈ a.principalFix B ∧ + ∀ x : L, x ≤ D → x ≤ a.iso g D → x ≤ B) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) + (hL : s.carrier ∈ M.sets) (hG : b.carrier ∈ M.sets) + (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier + (M.groundOmegaOne pairing unions powers separation collection infinite)) + (natSetCode 2) ZFSet.omega)) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + let hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : L) directed + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + exact M.exists_internalRow_ZF_not_choice a s b + (M.groundOmegaOne pairing unions powers separation collection infinite) + directed unbounded countableBound separate small pairing unions powers separation collection infinite + groundChoice hL spec.1 hG order graph spec.2.2.2 p + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOrdinarySubmodelReflection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOrdinarySubmodelReflection.lean index f11aecf45816d8972b960b5003ce0f27913c7d14..f29190fe4e3292b7460b5790208deb825c790f06 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOrdinarySubmodelReflection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundOrdinarySubmodelReflection.lean @@ -1,332 +1,332 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundAllSupportCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNameSequenceValues -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparationForcing - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] -variable (s : Presentation P) - -def ordinaryExtension (H : ConditionFilter P) : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - -theorem mem_ordinaryExtension (H : ConditionFilter P) (x : ZFSet.{u}) : - x ∈ (M.ordinaryExtension s H).sets ↔ - ∃ τ ∈ (M.nameDomain s).names, Name.eval {q | H.mem q} τ = x := - (M.nameDomain s).mem_values {q | H.mem q} x - -theorem ground_subset_ordinaryExtension [OrderTop P] - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : - M.sets ⊆ (M.ordinaryExtension s H).sets := by - intro x hx - exact (M.mem_ordinaryExtension s H x).2 ⟨Name.check s ⊤ x, - M.check_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) x hx, - Name.eval_check {q | H.mem q} ⊤ H.top_mem x⟩ - -end TransitiveGround - -section -open SetFormula -universe u - -def GroundSequenceReflection (M N : TransitiveGround.{u}) (P : ZFSet.{u}) : Prop := - ∀ f ∈ N.sets, ZFSet.IsFunc ZFSet.omega P f → f ∈ M.sets - -namespace GroundSequenceReflection -variable {M N : TransitiveGround.{u}} {P : ZFSet.{u}} -variable (reflection : GroundSequenceReflection M N P) -include reflection - -theorem enumeration - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets infinity Fin.elim0) - {X : ZFSet.{u}} (hX : X ∈ N.sets) (subset : X ⊆ P) (nonempty : X.Nonempty) - (small : N.groundEmbeddable X ZFSet.omega) : - ∃ f ∈ M.sets, f ∈ N.sets ∧ ZFSet.IsFunc ZFSet.omega X f ∧ - ZFSet.IsFunc ZFSet.omega P f ∧ relationImage ZFSet.omega P f = X := by - obtain ⟨f, hf, function, onto⟩ := - N.groundCountable_enumeration pairingN unionsN powersN separationN infiniteN hX nonempty small - have enlarged : ZFSet.IsFunc ZFSet.omega P f := by - refine ⟨?_, function.2⟩ - intro z hz - obtain ⟨n, hn, x, hx, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hn, subset hx⟩ - refine ⟨f, reflection f hf enlarged, hf, function, enlarged, ?_⟩ - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨_, n, _, entry⟩ := (mem_relationImage _ _ _ x).1 hx - exact (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - · intro hx - obtain ⟨n, hn, entry⟩ := onto x hx - exact (mem_relationImage _ _ _ x).2 ⟨subset hx, n, hn, entry⟩ - -theorem countable_subset - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets infinity Fin.elim0) - (hP : P ∈ M.sets) {X : ZFSet.{u}} (hX : X ∈ N.sets) (subset : X ⊆ P) - (small : N.groundEmbeddable X ZFSet.omega) : - X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega := by - classical - by_cases nonempty : X.Nonempty - · obtain ⟨f, hf, _, _, function, range_eq⟩ := - reflection.enumeration pairingN unionsN powersN separationN infiniteN hX subset nonempty small - have hOmega := M.omega_mem separation infinite - have omegaSmall : M.groundEmbeddable ZFSet.omega ZFSet.omega := - ⟨identityFunctionGraph ZFSet.omega, - M.identityFunctionGraph_mem pairing unions powers separation hOmega, - identityFunctionGraph_injection ZFSet.omega⟩ - have rangeGround := M.relationImage_mem separation hOmega hP hf - have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice - hOmega hP hOmega hf function omegaSmall - rw [range_eq] at rangeGround rangeSmall - exact ⟨rangeGround, rangeSmall⟩ - · have empty : X = ∅ := by - apply ZFSet.ext - intro x - exact ⟨fun hx => False.elim (nonempty ⟨x, hx⟩), - fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ - rw [empty] - exact ⟨M.empty_mem ⟨P, hP⟩, M.empty_groundEmbeddable ZFSet.omega ⟨P, hP⟩⟩ - -end GroundSequenceReflection - -end - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection carrier order in -theorem ordinary_ZF_of_conditionMaps {G : Type u} [Group G] - (a : PosetAction G P) (t : Presentation G) - (infinite : Realize M.sets infinity Fin.elim0) - (group : t.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - ZFRealization (M.ordinaryExtension s H).sets := by - have allGeneric : H.GenericFor - (formulaFamily (a.symmetricDomain s (M.nameDomain s) (allSupportFamily G))) := by - rw [a.symmetricDomain_allSupport] - exact generic - have checked := M.symmetric_ZF a s t (natInitialPresentation 1) (allSupportFamily G) - (allSupportBasis G) (allSupportFamily_basis G) pairing unions powers separation collection infinite - carrier order group (M.allSupportIndices_mem t pairing group) - (M.allSupportBasisCode_mem t pairing group) maps H allGeneric - rw [a.symmetricDomain_allSupport] at checked - exact checked - -include pairing unions powers separation collection carrier order in -theorem ordinary_collection_of_conditionMaps {G : Type u} [Group G] - (a : PosetAction G P) (t : Presentation G) - (group : t.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - CollectionSchema (M.ordinaryExtension s H).sets := by - have allGeneric : H.GenericFor - (formulaFamily (a.symmetricDomain s (M.nameDomain s) (allSupportFamily G))) := by - rw [a.symmetricDomain_allSupport] - exact generic - have checked : CollectionSchema - ((a.symmetricDomain s (M.nameDomain s) (allSupportFamily G)).values {p | H.mem p}) := by - intro n - exact M.symmetric_collection a s t (natInitialPresentation 1) (allSupportFamily G) - (allSupportBasis G) (allSupportFamily_basis G) pairing unions powers separation collection - carrier order group (M.allSupportIndices_mem t pairing group) - (M.allSupportBasisCode_mem t pairing group) maps H allGeneric - rw [a.symmetricDomain_allSupport] at checked - exact @checked - -include pairing unions powers separation collection carrier order in -theorem ordinaryExtension_ZF (infinite : Realize M.sets infinity Fin.elim0) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - ZFRealization (M.ordinaryExtension s H).sets := - M.ordinary_ZF_of_conditionMaps s pairing unions powers separation collection carrier order - (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P) trivialGroupPresentation infinite - (M.trivialGroupPresentation_mem pairing ⟨s.carrier, carrier⟩) - (M.identityPosetAction_conditionMapFamily_mem s pairing unions powers separation carrier) H generic - -include pairing unions powers separation collection carrier order in -theorem ordinaryExtension_collection - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : - CollectionSchema (M.ordinaryExtension s H).sets := - M.ordinary_collection_of_conditionMaps s pairing unions powers separation collection carrier order - (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P) trivialGroupPresentation - (M.trivialGroupPresentation_mem pairing ⟨s.carrier, carrier⟩) - (M.identityPosetAction_conditionMapFamily_mem s pairing unions powers separation carrier) H generic - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -include pairing unions powers separation collection carrier group nodes supports maps hT valid in -theorem visibleSupportProfile_mem_ordinary - (order : s.conditionOrder ∈ M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (z : (M.nameDomain s).names) : - M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∈ - (M.ordinaryExtension s H).sets := by - let N := M.ordinaryExtension s H - let graph := Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T d.principalFix) - have hz : Name.eval {p | H.mem p} z.val ∈ N.sets := ⟨z, rfl⟩ - have hgraph : graph ∈ N.sets := ⟨⟨_, M.niceVisibilityEvaluationName_mem a s b t d.principalFix - pairing unions powers separation collection carrier group nodes supports maps hT valid⟩, rfl⟩ - have hnodes : b.carrier ∈ N.sets := M.ground_subset_ordinaryExtension s pairing unions powers - separation collection carrier H nodes - have hvisibility (v : L) : - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) ∈ N.sets := - ⟨⟨_, M.niceVisibilityName_mem a s t b d.principalFix pairing unions powers separation collection - carrier group supports maps hT valid v (M.transitive nodes (b.encode_mem v))⟩, rfl⟩ - let phi : SetFormula 3 := ex (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula (.mem 2 0)) - let params : Fin 2 → ZFSet.{u} := ![Name.eval {p | H.mem p} z.val, graph] - have members : ∀ i, params i ∈ N.sets := - Fin.cases hz (Fin.cases hgraph (fun i => Fin.elim0 i)) - have meaning (v : L) : Realize N.sets phi (extend (b.encode v) params) ↔ - Name.eval {p | H.mem p} z.val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by - rw [show phi = ex (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula (.mem 2 0)) from rfl, - realize_ex] - constructor - · rintro ⟨V, hV, entry, member⟩ - have coded : ZFSet.pair (b.encode v) V ∈ graph := - (N.realize_stageOnePairLookup 1 0 3 _ - (Fin.cases hV (Fin.cases (N.transitive hnodes (b.encode_mem v)) members))).1 entry - have equal := (M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v V).1 coded - exact equal.symm ▸ member - · intro member - refine ⟨_, hvisibility v, ?_, member⟩ - exact (N.realize_stageOnePairLookup 1 0 3 _ - (Fin.cases (hvisibility v) (Fin.cases (N.transitive hnodes (b.encode_mem v)) members))).2 - ((M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v _).2 rfl) - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic - have selected := N.separation_mem zf.2.1 phi params members hnodes - have equal : ZFSet.sep (fun x => Realize N.sets phi (extend x params)) b.carrier = - M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) := by - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (ZFSet.mem_sep.1 hx).1 - exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).2 - ((meaning v).1 (ZFSet.mem_sep.1 hx).2) - · intro hx - obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ hx) - exact ZFSet.mem_sep.2 ⟨b.encode_mem v, - (meaning v).2 ((M.encode_mem_visibleSupportProfile a s b d T H _ v).1 hx)⟩ - exact equal ▸ selected - -include pairing unions powers separation collection carrier group nodes supports maps hT valid in -theorem exists_forced_visibleSupportProfile (small : M.sets.Countable) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (z : (M.nameDomain s).names) - (ground : M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∈ M.sets) - (p : P) (hp : H.mem p) : - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain s) visibilityProfileFormula - (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid - (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) ground z) q ∧ - M.DecidesVisibilityProfile a s b d.principalFix T - (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) z.val q := by - let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) - let env := M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid F ground z - have truth : Realize ((M.nameDomain s).values {p | H.mem p}) visibilityProfileFormula - (evalAssignment {p | H.mem p} env) := - (M.realize_visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid F ground z H).2 - (fun v => (M.encode_mem_visibleSupportProfile a s b d T H _ v).symm) - obtain ⟨r, hr, forced⟩ := (forcing_truth (M.nameDomain s) H generic visibilityProfileFormula env).1 truth - obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr - have forcedQ := forces_mono (M.nameDomain s) visibilityProfileFormula env forced qr - exact ⟨q, hq, qp, forcedQ, - (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers separation collection - carrier group nodes supports maps hT valid small F ground z q).1 forcedQ⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] -variable (s : Presentation P) - -theorem ordinaryExtension_sequenceReflection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) {U : ZFSet.{u}} (hU : U ∈ M.sets) - (closed : InternallyCountablyClosed M s) - (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) : - GroundSequenceReflection M (M.ordinaryExtension s H) U := by - intro f hf function - obtain ⟨τ, hτ, rfl⟩ := (M.mem_ordinaryExtension s H f).1 hf - exact (M.sequence_value_ground_of_function s pairing unions powers separation collection infinite choice - carrier order small hU closed ⟨τ, hτ⟩ H genericCoded genericFormula function).1 - -theorem ordinaryExtension_submodel_sequenceReflection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) {U : ZFSet.{u}} (hU : U ∈ M.sets) - (closed : InternallyCountablyClosed M s) - (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - (N : TransitiveGround.{u}) (included : N.sets ⊆ (M.ordinaryExtension s H).sets) : - GroundSequenceReflection M N U := by - have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation - collection infinite choice carrier order small hU closed H genericCoded genericFormula - intro f hf function - exact reflection f (included hf) function - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundAllSupportCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNameSequenceValues +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparationForcing + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] +variable (s : Presentation P) + +def ordinaryExtension (H : ConditionFilter P) : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + +theorem mem_ordinaryExtension (H : ConditionFilter P) (x : ZFSet.{u}) : + x ∈ (M.ordinaryExtension s H).sets ↔ + ∃ τ ∈ (M.nameDomain s).names, Name.eval {q | H.mem q} τ = x := + (M.nameDomain s).mem_values {q | H.mem q} x + +theorem ground_subset_ordinaryExtension [OrderTop P] + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (H : ConditionFilter P) : + M.sets ⊆ (M.ordinaryExtension s H).sets := by + intro x hx + exact (M.mem_ordinaryExtension s H x).2 ⟨Name.check s ⊤ x, + M.check_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) x hx, + Name.eval_check {q | H.mem q} ⊤ H.top_mem x⟩ + +end TransitiveGround + +section +open SetFormula +universe u + +def GroundSequenceReflection (M N : TransitiveGround.{u}) (P : ZFSet.{u}) : Prop := + ∀ f ∈ N.sets, ZFSet.IsFunc ZFSet.omega P f → f ∈ M.sets + +namespace GroundSequenceReflection +variable {M N : TransitiveGround.{u}} {P : ZFSet.{u}} +variable (reflection : GroundSequenceReflection M N P) +include reflection + +theorem enumeration + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets infinity Fin.elim0) + {X : ZFSet.{u}} (hX : X ∈ N.sets) (subset : X ⊆ P) (nonempty : X.Nonempty) + (small : N.groundEmbeddable X ZFSet.omega) : + ∃ f ∈ M.sets, f ∈ N.sets ∧ ZFSet.IsFunc ZFSet.omega X f ∧ + ZFSet.IsFunc ZFSet.omega P f ∧ relationImage ZFSet.omega P f = X := by + obtain ⟨f, hf, function, onto⟩ := + N.groundCountable_enumeration pairingN unionsN powersN separationN infiniteN hX nonempty small + have enlarged : ZFSet.IsFunc ZFSet.omega P f := by + refine ⟨?_, function.2⟩ + intro z hz + obtain ⟨n, hn, x, hx, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hn, subset hx⟩ + refine ⟨f, reflection f hf enlarged, hf, function, enlarged, ?_⟩ + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨_, n, _, entry⟩ := (mem_relationImage _ _ _ x).1 hx + exact (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + · intro hx + obtain ⟨n, hn, entry⟩ := onto x hx + exact (mem_relationImage _ _ _ x).2 ⟨subset hx, n, hn, entry⟩ + +theorem countable_subset + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets infinity Fin.elim0) + (hP : P ∈ M.sets) {X : ZFSet.{u}} (hX : X ∈ N.sets) (subset : X ⊆ P) + (small : N.groundEmbeddable X ZFSet.omega) : + X ∈ M.sets ∧ M.groundEmbeddable X ZFSet.omega := by + classical + by_cases nonempty : X.Nonempty + · obtain ⟨f, hf, _, _, function, range_eq⟩ := + reflection.enumeration pairingN unionsN powersN separationN infiniteN hX subset nonempty small + have hOmega := M.omega_mem separation infinite + have omegaSmall : M.groundEmbeddable ZFSet.omega ZFSet.omega := + ⟨identityFunctionGraph ZFSet.omega, + M.identityFunctionGraph_mem pairing unions powers separation hOmega, + identityFunctionGraph_injection ZFSet.omega⟩ + have rangeGround := M.relationImage_mem separation hOmega hP hf + have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice + hOmega hP hOmega hf function omegaSmall + rw [range_eq] at rangeGround rangeSmall + exact ⟨rangeGround, rangeSmall⟩ + · have empty : X = ∅ := by + apply ZFSet.ext + intro x + exact ⟨fun hx => False.elim (nonempty ⟨x, hx⟩), + fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ + rw [empty] + exact ⟨M.empty_mem ⟨P, hP⟩, M.empty_groundEmbeddable ZFSet.omega ⟨P, hP⟩⟩ + +end GroundSequenceReflection + +end + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection carrier order in +theorem ordinary_ZF_of_conditionMaps {G : Type u} [Group G] + (a : PosetAction G P) (t : Presentation G) + (infinite : Realize M.sets infinity Fin.elim0) + (group : t.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + ZFRealization (M.ordinaryExtension s H).sets := by + have allGeneric : H.GenericFor + (formulaFamily (a.symmetricDomain s (M.nameDomain s) (allSupportFamily G))) := by + rw [a.symmetricDomain_allSupport] + exact generic + have checked := M.symmetric_ZF a s t (natInitialPresentation 1) (allSupportFamily G) + (allSupportBasis G) (allSupportFamily_basis G) pairing unions powers separation collection infinite + carrier order group (M.allSupportIndices_mem t pairing group) + (M.allSupportBasisCode_mem t pairing group) maps H allGeneric + rw [a.symmetricDomain_allSupport] at checked + exact checked + +include pairing unions powers separation collection carrier order in +theorem ordinary_collection_of_conditionMaps {G : Type u} [Group G] + (a : PosetAction G P) (t : Presentation G) + (group : t.carrier ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + CollectionSchema (M.ordinaryExtension s H).sets := by + have allGeneric : H.GenericFor + (formulaFamily (a.symmetricDomain s (M.nameDomain s) (allSupportFamily G))) := by + rw [a.symmetricDomain_allSupport] + exact generic + have checked : CollectionSchema + ((a.symmetricDomain s (M.nameDomain s) (allSupportFamily G)).values {p | H.mem p}) := by + intro n + exact M.symmetric_collection a s t (natInitialPresentation 1) (allSupportFamily G) + (allSupportBasis G) (allSupportFamily_basis G) pairing unions powers separation collection + carrier order group (M.allSupportIndices_mem t pairing group) + (M.allSupportBasisCode_mem t pairing group) maps H allGeneric + rw [a.symmetricDomain_allSupport] at checked + exact @checked + +include pairing unions powers separation collection carrier order in +theorem ordinaryExtension_ZF (infinite : Realize M.sets infinity Fin.elim0) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + ZFRealization (M.ordinaryExtension s H).sets := + M.ordinary_ZF_of_conditionMaps s pairing unions powers separation collection carrier order + (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P) trivialGroupPresentation infinite + (M.trivialGroupPresentation_mem pairing ⟨s.carrier, carrier⟩) + (M.identityPosetAction_conditionMapFamily_mem s pairing unions powers separation carrier) H generic + +include pairing unions powers separation collection carrier order in +theorem ordinaryExtension_collection + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) : + CollectionSchema (M.ordinaryExtension s H).sets := + M.ordinary_collection_of_conditionMaps s pairing unions powers separation collection carrier order + (identityPosetAction (Equiv.Perm (ULift.{u} Unit)) P) trivialGroupPresentation + (M.trivialGroupPresentation_mem pairing ⟨s.carrier, carrier⟩) + (M.identityPosetAction_conditionMapFamily_mem s pairing unions powers separation carrier) H generic + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +include pairing unions powers separation collection carrier group nodes supports maps hT valid in +theorem visibleSupportProfile_mem_ordinary + (order : s.conditionOrder ∈ M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (z : (M.nameDomain s).names) : + M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∈ + (M.ordinaryExtension s H).sets := by + let N := M.ordinaryExtension s H + let graph := Name.eval {p | H.mem p} (M.niceVisibilityEvaluationName a s b T d.principalFix) + have hz : Name.eval {p | H.mem p} z.val ∈ N.sets := ⟨z, rfl⟩ + have hgraph : graph ∈ N.sets := ⟨⟨_, M.niceVisibilityEvaluationName_mem a s b t d.principalFix + pairing unions powers separation collection carrier group nodes supports maps hT valid⟩, rfl⟩ + have hnodes : b.carrier ∈ N.sets := M.ground_subset_ordinaryExtension s pairing unions powers + separation collection carrier H nodes + have hvisibility (v : L) : + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) ∈ N.sets := + ⟨⟨_, M.niceVisibilityName_mem a s t b d.principalFix pairing unions powers separation collection + carrier group supports maps hT valid v (M.transitive nodes (b.encode_mem v))⟩, rfl⟩ + let phi : SetFormula 3 := ex (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula (.mem 2 0)) + let params : Fin 2 → ZFSet.{u} := ![Name.eval {p | H.mem p} z.val, graph] + have members : ∀ i, params i ∈ N.sets := + Fin.cases hz (Fin.cases hgraph (fun i => Fin.elim0 i)) + have meaning (v : L) : Realize N.sets phi (extend (b.encode v) params) ↔ + Name.eval {p | H.mem p} z.val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by + rw [show phi = ex (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula (.mem 2 0)) from rfl, + realize_ex] + constructor + · rintro ⟨V, hV, entry, member⟩ + have coded : ZFSet.pair (b.encode v) V ∈ graph := + (N.realize_stageOnePairLookup 1 0 3 _ + (Fin.cases hV (Fin.cases (N.transitive hnodes (b.encode_mem v)) members))).1 entry + have equal := (M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v V).1 coded + exact equal.symm ▸ member + · intro member + refine ⟨_, hvisibility v, ?_, member⟩ + exact (N.realize_stageOnePairLookup 1 0 3 _ + (Fin.cases (hvisibility v) (Fin.cases (N.transitive hnodes (b.encode_mem v)) members))).2 + ((M.niceVisibilityEvaluationName_entry a s b T d.principalFix H v _).2 rfl) + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic + have selected := N.separation_mem zf.2.1 phi params members hnodes + have equal : ZFSet.sep (fun x => Realize N.sets phi (extend x params)) b.carrier = + M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) := by + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (ZFSet.mem_sep.1 hx).1 + exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).2 + ((meaning v).1 (ZFSet.mem_sep.1 hx).2) + · intro hx + obtain ⟨v, rfl⟩ := (b.mem_carrier x).1 (b.subset_carrier _ hx) + exact ZFSet.mem_sep.2 ⟨b.encode_mem v, + (meaning v).2 ((M.encode_mem_visibleSupportProfile a s b d T H _ v).1 hx)⟩ + exact equal ▸ selected + +include pairing unions powers separation collection carrier group nodes supports maps hT valid in +theorem exists_forced_visibleSupportProfile (small : M.sets.Countable) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (z : (M.nameDomain s).names) + (ground : M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) ∈ M.sets) + (p : P) (hp : H.mem p) : + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain s) visibilityProfileFormula + (M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid + (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) ground z) q ∧ + M.DecidesVisibilityProfile a s b d.principalFix T + (M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val)) z.val q := by + let F := M.visibleSupportProfile a s b d T H (Name.eval {p | H.mem p} z.val) + let env := M.visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid F ground z + have truth : Realize ((M.nameDomain s).values {p | H.mem p}) visibilityProfileFormula + (evalAssignment {p | H.mem p} env) := + (M.realize_visibilityProfileEnv a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid F ground z H).2 + (fun v => (M.encode_mem_visibleSupportProfile a s b d T H _ v).symm) + obtain ⟨r, hr, forced⟩ := (forcing_truth (M.nameDomain s) H generic visibilityProfileFormula env).1 truth + obtain ⟨q, hq, qp, qr⟩ := H.directed hp hr + have forcedQ := forces_mono (M.nameDomain s) visibilityProfileFormula env forced qr + exact ⟨q, hq, qp, forcedQ, + (M.forces_visibilityProfile_iff a s t b d.principalFix pairing unions powers separation collection + carrier group nodes supports maps hT valid small F ground z q).1 forcedQ⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] [OrderTop P] +variable (s : Presentation P) + +theorem ordinaryExtension_sequenceReflection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) {U : ZFSet.{u}} (hU : U ∈ M.sets) + (closed : InternallyCountablyClosed M s) + (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) : + GroundSequenceReflection M (M.ordinaryExtension s H) U := by + intro f hf function + obtain ⟨τ, hτ, rfl⟩ := (M.mem_ordinaryExtension s H f).1 hf + exact (M.sequence_value_ground_of_function s pairing unions powers separation collection infinite choice + carrier order small hU closed ⟨τ, hτ⟩ H genericCoded genericFormula function).1 + +theorem ordinaryExtension_submodel_sequenceReflection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) {U : ZFSet.{u}} (hU : U ∈ M.sets) + (closed : InternallyCountablyClosed M s) + (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + (N : TransitiveGround.{u}) (included : N.sets ⊆ (M.ordinaryExtension s H).sets) : + GroundSequenceReflection M N U := by + have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation + collection infinite choice carrier order small hU closed H genericCoded genericFormula + intro f hf function + exact reflection f (included hf) function + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPartialCoverPartitions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPartialCoverPartitions.lean index 3d0f995ea555670de40a6c697e9e8cb18ee234cd..404de1d37ea92e0033186d2e00a8701babf97a52 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPartialCoverPartitions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPartialCoverPartitions.lean @@ -1,160 +1,160 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalImagePartitions - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def partialCoverOccurrence (delta T X h : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ delta, ∃ x ∈ X, ∃ hi ∈ ⋃₀ ⋃₀ h, - z = ZFSet.pair i x ∧ ZFSet.pair i hi ∈ h ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi) - (ZFSet.prod delta X) - -theorem pair_mem_partialCoverOccurrence (delta T X h i x : ZFSet.{u}) : - ZFSet.pair i x ∈ partialCoverOccurrence delta T X h ↔ - i ∈ delta ∧ x ∈ X ∧ ∃ hi, ZFSet.pair i hi ∈ h ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi := by - rw [partialCoverOccurrence, ZFSet.mem_sep] - constructor - · rintro ⟨_, j, hj, y, hy, hi, _, equal, entry, covered⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hj, hy, hi, entry, covered⟩ - · rintro ⟨hi, hx, graph, entry, covered⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, i, hi, x, hx, graph, - pair_second_mem_doubleUnion entry, rfl, entry, covered⟩ - -namespace BoundedFormula -private def partialCoverOccurrenceFormula {n} (z delta T X H h : Fin n) : BoundedFormula n := - exMem delta (exMem X.succ (exMem H.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 1) - (.conj (pairMembershipFormula 2 0 h.succ.succ.succ) - (exMem T.succ.succ.succ (pairMembershipFormula 0 2 1)))))) - -private theorem partialCoverOccurrence_meaning {n} (z delta T X H h : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (partialCoverOccurrenceFormula z delta T X H h) env ↔ - ∃ i ∈ env delta, ∃ x ∈ env X, ∃ hi ∈ env H, - env z = ZFSet.pair i x ∧ ZFSet.pair i hi ∈ env h ∧ ∃ u ∈ env T, ZFSet.pair u x ∈ hi := by - simp only [partialCoverOccurrenceFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -variable (N : TransitiveGround.{u}) - -theorem partialCoverOccurrence_mem - (pairing : Realize N.sets SetFormula.pairing Fin.elim0) - (unions : Realize N.sets SetFormula.union Fin.elim0) - (powers : Realize N.sets powerSet Fin.elim0) (separation : SeparationSchema N.sets) - {delta T X h : ZFSet.{u}} (hDelta : delta ∈ N.sets) (hT : T ∈ N.sets) - (hX : X ∈ N.sets) (hh : h ∈ N.sets) : partialCoverOccurrence delta T X h ∈ N.sets := by - have hH := N.union_mem unions (N.union_mem unions hh) - let params := extend delta (extend T (extend X (extend (⋃₀ ⋃₀ h) (extend h Fin.elim0)))) - have selected := N.bounded_separation_mem separation - (BoundedFormula.partialCoverOccurrenceFormula 0 1 2 3 4 5) params - (Fin.cases hDelta (Fin.cases hT (Fin.cases hX (Fin.cases hH (Fin.cases hh (fun j => Fin.elim0 j)))))) - (N.prod_mem pairing unions powers separation hDelta hX) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.partialCoverOccurrenceFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod delta X) = partialCoverOccurrence delta T X h := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, partialCoverOccurrence, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.partialCoverOccurrence_meaning _ _ _ _ _ _ _) - exact equal ▸ selected - -theorem partialCover_ordinal_partitions - (zf : ZFRealization N.sets) {delta T X Y h f : ZFSet.{u}} - (hDelta : delta ∈ N.sets) (ordinal : ordinalSetProperty delta) - (hT : T ∈ N.sets) (hX : X ∈ N.sets) (hY : Y ∈ N.sets) - (hh : h ∈ N.sets) (hf : f ∈ N.sets) (family : FunctionGraphOn delta h) - (function : ZFSet.IsFunc X Y f) (onto : ∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) - (cover : ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi) : - ∃ full ∈ N.sets, ∃ p ∈ N.sets, ∃ q ∈ N.sets, - FunctionGraphOn delta full ∧ FunctionGraphOn delta p ∧ FunctionGraphOn delta q ∧ - (∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) ∧ - (∀ y ∈ Y, ∃ i ∈ delta, ∃ U, ZFSet.pair i U ∈ p ∧ y ∈ U) ∧ - (∀ i k U V y, ZFSet.pair i U ∈ p → ZFSet.pair k V ∈ p → y ∈ U → y ∈ V → i = k) ∧ - (∀ i k U V x, ZFSet.pair i U ∈ q → ZFSet.pair k V ∈ q → x ∈ U → x ∈ V → i = k) ∧ - ∀ i hi A U V, ZFSet.pair i hi ∈ h → ZFSet.pair i A ∈ full → - ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → - (∀ x, x ∈ A ↔ x ∈ X ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi) ∧ - (∀ y, y ∈ U ↔ y ∈ Y ∧ (∃ x ∈ A, ZFSet.pair x y ∈ f) ∧ - ∀ k ∈ i, ∀ B, ZFSet.pair k B ∈ full → ¬ ∃ x ∈ B, ZFSet.pair x y ∈ f) ∧ - (∀ x, x ∈ V ↔ x ∈ A ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f) ∧ - graphRestriction V f ∈ N.sets ∧ ZFSet.IsFunc V U (graphRestriction V f) ∧ - (∀ y ∈ U, ∃ x ∈ V, ZFSet.pair x y ∈ graphRestriction V f) ∧ - ∀ x ∈ V, ∃ u ∈ T, ZFSet.pair u x ∈ hi := by - have pairing := zf.1.2.2.2.1 - have unions := zf.1.2.2.2.2.1 - have powers := zf.1.2.2.2.2.2.1 - have separation : SeparationSchema N.sets := zf.2.1 - let R := partialCoverOccurrence delta T X h - have hR : R ∈ N.sets := N.partialCoverOccurrence_mem pairing unions powers separation hDelta hT hX hh - have relation : R ⊆ ZFSet.prod delta X := fun _ hz => (ZFSet.mem_sep.1 hz).1 - have covering : ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ R := by - intro x hx - obtain ⟨i, hi, g, entry, covered⟩ := cover x hx - exact ⟨i, hi, (pair_mem_partialCoverOccurrence delta T X h i x).2 ⟨hi, hx, g, entry, covered⟩⟩ - obtain ⟨p, hp, q, hq, pFunction, qFunction, bounds, coverY, disjointY, disjointX, pieces⟩ := - N.ordinal_image_partitions zf hDelta ordinal hX hY hR hf relation function onto covering - let full := N.relationFiberFamily delta X R - have hFull : full ∈ N.sets := N.relationFiberFamily_mem pairing unions powers separation hDelta hX hR - have fullFunction : FunctionGraphOn delta full := - ⟨N.groundPower X, N.relationFiberFamily_function separation hDelta hX hR⟩ - have fullEntries (i A : ZFSet.{u}) (entry : ZFSet.pair i A ∈ full) (x : ZFSet.{u}) : - x ∈ A ↔ x ∈ X ∧ ZFSet.pair i x ∈ R := by - have equal := ((N.pair_mem_relationFiberFamily delta X R i A).1 entry).2.2 - rw [equal, mem_relationFiber] - refine ⟨full, hFull, p, hp, q, hq, fullFunction, pFunction, qFunction, - bounds, coverY, disjointY, disjointX, ?_⟩ - intro i hi A U V inH inFull ip iq - obtain ⟨target, source, hRestrict, restrictFunction, restrictOnto⟩ := pieces i U V ip iq - have original (x : ZFSet.{u}) : x ∈ A ↔ x ∈ X ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi := by - rw [fullEntries i A inFull x] - constructor - · rintro ⟨hx, entry⟩ - obtain ⟨_, _, g, inH', covered⟩ := (pair_mem_partialCoverOccurrence delta T X h i x).1 entry - have equal := family.unique inH' inH - exact ⟨hx, equal ▸ covered⟩ - · rintro ⟨hx, covered⟩ - exact ⟨hx, (pair_mem_partialCoverOccurrence delta T X h i x).2 - ⟨family.pair_source inH, hx, hi, inH, covered⟩⟩ - have selected (x : ZFSet.{u}) : x ∈ V ↔ x ∈ A ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f := by - rw [source x] - constructor - · rintro ⟨entry, image⟩ - exact ⟨(fullEntries i A inFull x).2 ⟨(ZFSet.pair_mem_prod.1 (relation entry)).2, entry⟩, image⟩ - · rintro ⟨member, image⟩ - exact ⟨((fullEntries i A inFull x).1 member).2, image⟩ - refine ⟨original, ?_, selected, hRestrict, restrictFunction, restrictOnto, ?_⟩ - · intro y - rw [target y] - constructor - · rintro ⟨hy, ⟨x, hx, ix, xy⟩, least⟩ - refine ⟨hy, ⟨x, (fullEntries i A inFull x).2 ⟨hx, ix⟩, xy⟩, ?_⟩ - intro k ki B inFullB witness - obtain ⟨v, hv, vy⟩ := witness - have coordinates := (fullEntries k B inFullB v).1 hv - exact least k ki ⟨v, coordinates.1, coordinates.2, vy⟩ - · rintro ⟨hy, ⟨x, hx, xy⟩, least⟩ - have coordinates := (fullEntries i A inFull x).1 hx - refine ⟨hy, ⟨x, coordinates.1, coordinates.2, xy⟩, ?_⟩ - intro k ki witness - obtain ⟨B, inFullB⟩ := fullFunction.total (ordinal.1 i (family.pair_source inH) k ki) - obtain ⟨v, hv, kv, vy⟩ := witness - exact least k ki B inFullB ⟨v, (fullEntries k B inFullB v).2 ⟨hv, kv⟩, vy⟩ - · intro x hx - exact ((original x).1 ((selected x).1 hx).1).2 - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalImagePartitions + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def partialCoverOccurrence (delta T X h : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ delta, ∃ x ∈ X, ∃ hi ∈ ⋃₀ ⋃₀ h, + z = ZFSet.pair i x ∧ ZFSet.pair i hi ∈ h ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi) + (ZFSet.prod delta X) + +theorem pair_mem_partialCoverOccurrence (delta T X h i x : ZFSet.{u}) : + ZFSet.pair i x ∈ partialCoverOccurrence delta T X h ↔ + i ∈ delta ∧ x ∈ X ∧ ∃ hi, ZFSet.pair i hi ∈ h ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi := by + rw [partialCoverOccurrence, ZFSet.mem_sep] + constructor + · rintro ⟨_, j, hj, y, hy, hi, _, equal, entry, covered⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hj, hy, hi, entry, covered⟩ + · rintro ⟨hi, hx, graph, entry, covered⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, i, hi, x, hx, graph, + pair_second_mem_doubleUnion entry, rfl, entry, covered⟩ + +namespace BoundedFormula +private def partialCoverOccurrenceFormula {n} (z delta T X H h : Fin n) : BoundedFormula n := + exMem delta (exMem X.succ (exMem H.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 1) + (.conj (pairMembershipFormula 2 0 h.succ.succ.succ) + (exMem T.succ.succ.succ (pairMembershipFormula 0 2 1)))))) + +private theorem partialCoverOccurrence_meaning {n} (z delta T X H h : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (partialCoverOccurrenceFormula z delta T X H h) env ↔ + ∃ i ∈ env delta, ∃ x ∈ env X, ∃ hi ∈ env H, + env z = ZFSet.pair i x ∧ ZFSet.pair i hi ∈ env h ∧ ∃ u ∈ env T, ZFSet.pair u x ∈ hi := by + simp only [partialCoverOccurrenceFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +variable (N : TransitiveGround.{u}) + +theorem partialCoverOccurrence_mem + (pairing : Realize N.sets SetFormula.pairing Fin.elim0) + (unions : Realize N.sets SetFormula.union Fin.elim0) + (powers : Realize N.sets powerSet Fin.elim0) (separation : SeparationSchema N.sets) + {delta T X h : ZFSet.{u}} (hDelta : delta ∈ N.sets) (hT : T ∈ N.sets) + (hX : X ∈ N.sets) (hh : h ∈ N.sets) : partialCoverOccurrence delta T X h ∈ N.sets := by + have hH := N.union_mem unions (N.union_mem unions hh) + let params := extend delta (extend T (extend X (extend (⋃₀ ⋃₀ h) (extend h Fin.elim0)))) + have selected := N.bounded_separation_mem separation + (BoundedFormula.partialCoverOccurrenceFormula 0 1 2 3 4 5) params + (Fin.cases hDelta (Fin.cases hT (Fin.cases hX (Fin.cases hH (Fin.cases hh (fun j => Fin.elim0 j)))))) + (N.prod_mem pairing unions powers separation hDelta hX) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.partialCoverOccurrenceFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod delta X) = partialCoverOccurrence delta T X h := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, partialCoverOccurrence, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.partialCoverOccurrence_meaning _ _ _ _ _ _ _) + exact equal ▸ selected + +theorem partialCover_ordinal_partitions + (zf : ZFRealization N.sets) {delta T X Y h f : ZFSet.{u}} + (hDelta : delta ∈ N.sets) (ordinal : ordinalSetProperty delta) + (hT : T ∈ N.sets) (hX : X ∈ N.sets) (hY : Y ∈ N.sets) + (hh : h ∈ N.sets) (hf : f ∈ N.sets) (family : FunctionGraphOn delta h) + (function : ZFSet.IsFunc X Y f) (onto : ∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) + (cover : ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi) : + ∃ full ∈ N.sets, ∃ p ∈ N.sets, ∃ q ∈ N.sets, + FunctionGraphOn delta full ∧ FunctionGraphOn delta p ∧ FunctionGraphOn delta q ∧ + (∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) ∧ + (∀ y ∈ Y, ∃ i ∈ delta, ∃ U, ZFSet.pair i U ∈ p ∧ y ∈ U) ∧ + (∀ i k U V y, ZFSet.pair i U ∈ p → ZFSet.pair k V ∈ p → y ∈ U → y ∈ V → i = k) ∧ + (∀ i k U V x, ZFSet.pair i U ∈ q → ZFSet.pair k V ∈ q → x ∈ U → x ∈ V → i = k) ∧ + ∀ i hi A U V, ZFSet.pair i hi ∈ h → ZFSet.pair i A ∈ full → + ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → + (∀ x, x ∈ A ↔ x ∈ X ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi) ∧ + (∀ y, y ∈ U ↔ y ∈ Y ∧ (∃ x ∈ A, ZFSet.pair x y ∈ f) ∧ + ∀ k ∈ i, ∀ B, ZFSet.pair k B ∈ full → ¬ ∃ x ∈ B, ZFSet.pair x y ∈ f) ∧ + (∀ x, x ∈ V ↔ x ∈ A ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f) ∧ + graphRestriction V f ∈ N.sets ∧ ZFSet.IsFunc V U (graphRestriction V f) ∧ + (∀ y ∈ U, ∃ x ∈ V, ZFSet.pair x y ∈ graphRestriction V f) ∧ + ∀ x ∈ V, ∃ u ∈ T, ZFSet.pair u x ∈ hi := by + have pairing := zf.1.2.2.2.1 + have unions := zf.1.2.2.2.2.1 + have powers := zf.1.2.2.2.2.2.1 + have separation : SeparationSchema N.sets := zf.2.1 + let R := partialCoverOccurrence delta T X h + have hR : R ∈ N.sets := N.partialCoverOccurrence_mem pairing unions powers separation hDelta hT hX hh + have relation : R ⊆ ZFSet.prod delta X := fun _ hz => (ZFSet.mem_sep.1 hz).1 + have covering : ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ R := by + intro x hx + obtain ⟨i, hi, g, entry, covered⟩ := cover x hx + exact ⟨i, hi, (pair_mem_partialCoverOccurrence delta T X h i x).2 ⟨hi, hx, g, entry, covered⟩⟩ + obtain ⟨p, hp, q, hq, pFunction, qFunction, bounds, coverY, disjointY, disjointX, pieces⟩ := + N.ordinal_image_partitions zf hDelta ordinal hX hY hR hf relation function onto covering + let full := N.relationFiberFamily delta X R + have hFull : full ∈ N.sets := N.relationFiberFamily_mem pairing unions powers separation hDelta hX hR + have fullFunction : FunctionGraphOn delta full := + ⟨N.groundPower X, N.relationFiberFamily_function separation hDelta hX hR⟩ + have fullEntries (i A : ZFSet.{u}) (entry : ZFSet.pair i A ∈ full) (x : ZFSet.{u}) : + x ∈ A ↔ x ∈ X ∧ ZFSet.pair i x ∈ R := by + have equal := ((N.pair_mem_relationFiberFamily delta X R i A).1 entry).2.2 + rw [equal, mem_relationFiber] + refine ⟨full, hFull, p, hp, q, hq, fullFunction, pFunction, qFunction, + bounds, coverY, disjointY, disjointX, ?_⟩ + intro i hi A U V inH inFull ip iq + obtain ⟨target, source, hRestrict, restrictFunction, restrictOnto⟩ := pieces i U V ip iq + have original (x : ZFSet.{u}) : x ∈ A ↔ x ∈ X ∧ ∃ u ∈ T, ZFSet.pair u x ∈ hi := by + rw [fullEntries i A inFull x] + constructor + · rintro ⟨hx, entry⟩ + obtain ⟨_, _, g, inH', covered⟩ := (pair_mem_partialCoverOccurrence delta T X h i x).1 entry + have equal := family.unique inH' inH + exact ⟨hx, equal ▸ covered⟩ + · rintro ⟨hx, covered⟩ + exact ⟨hx, (pair_mem_partialCoverOccurrence delta T X h i x).2 + ⟨family.pair_source inH, hx, hi, inH, covered⟩⟩ + have selected (x : ZFSet.{u}) : x ∈ V ↔ x ∈ A ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f := by + rw [source x] + constructor + · rintro ⟨entry, image⟩ + exact ⟨(fullEntries i A inFull x).2 ⟨(ZFSet.pair_mem_prod.1 (relation entry)).2, entry⟩, image⟩ + · rintro ⟨member, image⟩ + exact ⟨((fullEntries i A inFull x).1 member).2, image⟩ + refine ⟨original, ?_, selected, hRestrict, restrictFunction, restrictOnto, ?_⟩ + · intro y + rw [target y] + constructor + · rintro ⟨hy, ⟨x, hx, ix, xy⟩, least⟩ + refine ⟨hy, ⟨x, (fullEntries i A inFull x).2 ⟨hx, ix⟩, xy⟩, ?_⟩ + intro k ki B inFullB witness + obtain ⟨v, hv, vy⟩ := witness + have coordinates := (fullEntries k B inFullB v).1 hv + exact least k ki ⟨v, coordinates.1, coordinates.2, vy⟩ + · rintro ⟨hy, ⟨x, hx, xy⟩, least⟩ + have coordinates := (fullEntries i A inFull x).1 hx + refine ⟨hy, ⟨x, coordinates.1, coordinates.2, xy⟩, ?_⟩ + intro k ki witness + obtain ⟨B, inFullB⟩ := fullFunction.total (ordinal.1 i (family.pair_source inH) k ki) + obtain ⟨v, hv, kv, vy⟩ := witness + exact least k ki B inFullB ⟨v, (fullEntries k B inFullB v).2 ⟨hv, kv⟩, vy⟩ + · intro x hx + exact ((original x).1 ((selected x).1 hx).1).2 + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPredenseMeet.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPredenseMeet.lean index b7e79b965a9fdb189d6c9afb6aa77c0c715178c4..0459d479fbaeb37595ff44ac3174066f102ca4b8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPredenseMeet.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPredenseMeet.lean @@ -1,58 +1,58 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionGenericity - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] -variable (s : Presentation P) - -theorem generic_meets_ground_predense (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (H : ConditionFilter P) (generic : H.GenericFor (M.codedFamily s)) - {A : ZFSet.{u}} (hA : A ∈ M.sets) (subset : A ⊆ s.carrier) - (predense : ∀ q ∈ s.carrier, ∃ p ∈ A, ∃ r ∈ s.carrier, - ZFSet.pair r q ∈ s.conditionOrder ∧ ZFSet.pair r p ∈ s.conditionOrder) : - ∃ p : P, H.mem p ∧ s.encode p ∈ A := by - let E : Set P := {r | ∃ p ∈ A, ZFSet.pair (s.encode r) p ∈ s.conditionOrder} - let raw := ZFSet.sep (fun r => ∃ p ∈ A, ZFSet.pair r p ∈ s.conditionOrder) s.carrier - let formula : BoundedFormula 3 := - BoundedFormula.exMem 1 (BoundedFormula.pairMembershipFormula 1 0 3) - let params := extend A (extend s.conditionOrder Fin.elim0) - have selected := M.bounded_separation_mem separation formula params - (Fin.cases hA (Fin.cases order (fun j => Fin.elim0 j))) carrier - have rawGround : raw ∈ M.sets := by - have equal : ZFSet.sep (fun r => BoundedFormula.Truth formula (extend r params)) s.carrier = raw := by - apply ZFSet.ext - intro r - rw [ZFSet.mem_sep, ZFSet.mem_sep] - apply and_congr_right - intro _ - simp only [formula, BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] - rfl - exact equal ▸ selected - have code : s.subset (fun condition => condition ∈ E) = raw := by - apply ZFSet.ext - intro z - rw [s.mem_subset, ZFSet.mem_sep] - constructor - · rintro ⟨r, member, rfl⟩ - exact ⟨s.encode_mem r, member⟩ - · rintro ⟨member, entry⟩ - obtain ⟨r, rfl⟩ := (s.mem_carrier z).1 member - exact ⟨r, entry, rfl⟩ - have dense : Dense E := by - intro q - obtain ⟨p, hp, r, hr, rq, rp⟩ := predense (s.encode q) (s.encode_mem q) - obtain ⟨r, rfl⟩ := (s.mem_carrier r).1 hr - exact ⟨r, (s.pair_mem_conditionOrder r q).1 rq, p, hp, rp⟩ - obtain ⟨r, member, p, hp, below⟩ := - M.generic_meets_coded_dense s H generic (code.symm ▸ rawGround) dense - obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 (subset hp) - exact ⟨p, H.upward member ((s.pair_mem_conditionOrder r p).1 below), hp⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionGenericity + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] +variable (s : Presentation P) + +theorem generic_meets_ground_predense (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (H : ConditionFilter P) (generic : H.GenericFor (M.codedFamily s)) + {A : ZFSet.{u}} (hA : A ∈ M.sets) (subset : A ⊆ s.carrier) + (predense : ∀ q ∈ s.carrier, ∃ p ∈ A, ∃ r ∈ s.carrier, + ZFSet.pair r q ∈ s.conditionOrder ∧ ZFSet.pair r p ∈ s.conditionOrder) : + ∃ p : P, H.mem p ∧ s.encode p ∈ A := by + let E : Set P := {r | ∃ p ∈ A, ZFSet.pair (s.encode r) p ∈ s.conditionOrder} + let raw := ZFSet.sep (fun r => ∃ p ∈ A, ZFSet.pair r p ∈ s.conditionOrder) s.carrier + let formula : BoundedFormula 3 := + BoundedFormula.exMem 1 (BoundedFormula.pairMembershipFormula 1 0 3) + let params := extend A (extend s.conditionOrder Fin.elim0) + have selected := M.bounded_separation_mem separation formula params + (Fin.cases hA (Fin.cases order (fun j => Fin.elim0 j))) carrier + have rawGround : raw ∈ M.sets := by + have equal : ZFSet.sep (fun r => BoundedFormula.Truth formula (extend r params)) s.carrier = raw := by + apply ZFSet.ext + intro r + rw [ZFSet.mem_sep, ZFSet.mem_sep] + apply and_congr_right + intro _ + simp only [formula, BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] + rfl + exact equal ▸ selected + have code : s.subset (fun condition => condition ∈ E) = raw := by + apply ZFSet.ext + intro z + rw [s.mem_subset, ZFSet.mem_sep] + constructor + · rintro ⟨r, member, rfl⟩ + exact ⟨s.encode_mem r, member⟩ + · rintro ⟨member, entry⟩ + obtain ⟨r, rfl⟩ := (s.mem_carrier z).1 member + exact ⟨r, entry, rfl⟩ + have dense : Dense E := by + intro q + obtain ⟨p, hp, r, hr, rq, rp⟩ := predense (s.encode q) (s.encode_mem q) + obtain ⟨r, rfl⟩ := (s.mem_carrier r).1 hr + exact ⟨r, (s.pair_mem_conditionOrder r q).1 rq, p, hp, rp⟩ + obtain ⟨r, member, p, hp, below⟩ := + M.generic_meets_coded_dense s H generic (code.symm ▸ rawGround) dense + obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 (subset hp) + exact ⟨p, H.upward member ((s.pair_mem_conditionOrder r p).1 below), hp⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparationFamilyImages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparationFamilyImages.lean index 7ee0135141accb1deec0e929db0797117f8d9260..14841897c3b5ba6e252e646c6b1fa40b92cd0038 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparationFamilyImages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparationFamilyImages.lean @@ -1,651 +1,651 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalTileSlotSupportRealization -import OAI.SetTheory.PartitionPrinciple.Definability.GroundDepthSlotCodes - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace BoundedFormula - -def leastSlotFormula {n} (supports v x j : Fin n) : BoundedFormula n := - .conj (tripleMembershipFormula v j x supports) - (allMem j (.neg (tripleMembershipFormula v.succ 0 x.succ supports.succ))) - -theorem truth_leastSlotFormula {n} (supports v x j : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (leastSlotFormula supports v x j) env ↔ - LeastSlotCode (env supports) (env v) (env x) (env j) := by - simp only [leastSlotFormula, Truth, truth_tripleMembershipFormula] - rfl - -def leastSlotOwnerEntryFormula {n} (z P B V owner supports three : Fin n) : BoundedFormula n := - exMem B (exMem three.succ (exMem V.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 1) - (.conj (.neg (.mem 2 P.succ.succ.succ)) - (.conj (pairMembershipFormula 2 0 owner.succ.succ.succ) - (leastSlotFormula supports.succ.succ.succ 0 2 1)))))) - -theorem truth_leastSlotOwnerEntryFormula {n} (z P B V owner supports three : Fin n) - (env : Fin n → ZFSet.{u}) (threeEq : env three = natSetCode 3) : - Truth (leastSlotOwnerEntryFormula z P B V owner supports three) env ↔ - env z ∈ leastSlotOwnerGraph (env P) (env B) (env V) (env owner) (env supports) := by - simp only [leastSlotOwnerEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_pairMembershipFormula, truth_leastSlotFormula] - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [threeEq, leastSlotOwnerGraph, ZFSet.mem_sep] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨x, hx, j, hj, _, _, equal, _⟩ := h - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hx, hj⟩ - -end BoundedFormula -namespace TransitiveGround - -theorem leastSlotOwnerGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {P B V owner supports : ZFSet.{u}} (hP : P ∈ M.sets) (hB : B ∈ M.sets) - (hV : V ∈ M.sets) (hOwner : owner ∈ M.sets) (hSupports : supports ∈ M.sets) : - leastSlotOwnerGraph P B V owner supports ∈ M.sets := by - have hThree := M.natSetCode_mem separation infinite 3 - let params := extend P (extend B (extend V (extend owner (extend supports (extend (natSetCode 3) Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.leastSlotOwnerEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hP (Fin.cases hB (Fin.cases hV (Fin.cases hOwner - (Fin.cases hSupports (Fin.cases hThree (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hB hThree) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.leastSlotOwnerEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod B (natSetCode 3)) = leastSlotOwnerGraph P B V owner supports := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_leastSlotOwnerEntryFormula _ _ _ _ _ _ _ _ rfl] - exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ - exact equal ▸ selected - -end TransitiveGround -end PartitionPilot.Forcing - -section - -namespace PartitionPilot.Forcing.GroundCompressionCompletion -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -noncomputable def externalOwnerSlots (P r μ A : ZFSet.{u}) : ZFSet.{u} := - leastSlotOwnerGraph (completion.externalSeedCarrier P r μ A) - (completion.externalPointCarrier P r μ A) - (M.externalStarVertices G (externalChildLetters I P (externalRectangles P G r μ A)) - (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) - (completion.externalStarOwner P r μ A) (completion.externalTileSlotPoints P r μ A) - -end PartitionPilot.Forcing.GroundCompressionCompletion - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG - -theorem externalSeedCarrier_ground (hP0 : P0 ∈ M.sets) : P ∈ M.sets := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - exact M.relationImage_mem separation (completion.algebra.union.ground 0) geometry.carrier_ground - (geometry.copies_ground _ data.group.group_code.identity_mem) - -theorem externalOwnerSlots_ground_function (hP0 : P0 ∈ M.sets) : - slots ∈ M.sets ∧ ZFSet.IsFunc (ownerFresh P B) (natSetCode 3) slots := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have owner := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 - refine ⟨M.leastSlotOwnerGraph_mem pairing unions powers separation infinite - (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) - geometry.carrier_ground (data.externalStarCarriers_ground pairing unions powers separation hG).1 owner.1 - (data.externalTileSlotPoints_ground group oldAction pairing unions powers separation infinite hG hP0), ?_⟩ - apply leastSlotOwnerGraph_function owner.2 - intro x _ fresh v owned - exact data.externalTileSlotPoints_owner_cover group oldAction pairing unions powers separation infinite hG fresh owned - -theorem externalOwnerSlots_monotone (hP0 : P0 ∈ M.sets) {x y v w n j k : ZFSet.{u}} - (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) - (firstOwner : ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0) - (secondOwner : ZFSet.pair y w ∈ completion.externalStarOwner P0 r0 μ0 A0) - (firstDepth : ZFSet.pair v n ∈ M.externalStarDepth G letters requests m one) - (secondDepth : ZFSet.pair w n ∈ M.externalStarDepth G letters requests m one) - (first : ZFSet.pair x j ∈ slots) (second : ZFSet.pair y k ∈ slots) : j = k ∨ j ∈ k := by - apply leastSlotOwnerGraph_monotone first second - · intro v' w' ownedX ownedY - have function := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have unique : FunctionGraphOn B (completion.externalStarOwner P0 r0 μ0 A0) := ⟨_, function⟩ - have vx := unique.unique ownedX firstOwner - have wy := unique.unique ownedY secondOwner - subst v' - subst w' - exact (data.externalStarOwner_order group oldAction pairing unions powers separation infinite hG - lower firstOwner secondOwner firstDepth secondDepth).2 rfl - · intro v _ j _ x hx y _ lower supported - exact data.externalTileSlotPoints_lower group oldAction pairing unions powers separation infinite hG hx lower supported - · exact lower - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem pairedGraph_function_of_subset {A B H K f g : ZFSet.{u}} - (first : ZFSet.IsFunc A H f) (second : ZFSet.IsFunc B K g) (subset : B ⊆ A) : - ZFSet.IsFunc B (ZFSet.prod H K) (pairedGraph B H K f g) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨a, firstEntry, firstUnique⟩ := first.2 x (subset hx) - obtain ⟨b, secondEntry, secondUnique⟩ := second.2 x hx - have ha := (ZFSet.pair_mem_prod.1 (first.1 firstEntry)).2 - have hb := (ZFSet.pair_mem_prod.1 (second.1 secondEntry)).2 - refine ⟨ZFSet.pair a b, (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 - ⟨hx, ha, hb, firstEntry, secondEntry⟩, ?_⟩ - intro y hy - obtain ⟨x', _, a', _, b', _, equal, firstEntry', secondEntry'⟩ := (mem_pairedGraph _ _ _ _ _ _).1 hy - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact congrArg₂ ZFSet.pair (firstUnique a' firstEntry') (secondUnique b' secondEntry') - -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -noncomputable def externalOwnerDepth (P r μ A : ZFSet.{u}) : ZFSet.{u} := - let letters := externalChildLetters I P (externalRectangles P G r μ A) - let requests := externalRequestCarrier I P (externalRectangles P G r μ A) - relationCompose (completion.externalPointCarrier P r μ A) - (M.externalStarVertices G letters requests m one) ZFSet.omega - (completion.externalStarOwner P r μ A) (M.externalStarDepth G letters requests m one) - -noncomputable def externalOwnerLevelPairs (P r μ A : ZFSet.{u}) : ZFSet.{u} := - pairedGraph (ownerFresh (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A)) - ZFSet.omega (natSetCode 3) (completion.externalOwnerDepth P r μ A) (completion.externalOwnerSlots P r μ A) - -noncomputable def externalOwnerLevels (P r μ A : ZFSet.{u}) : ZFSet.{u} := - relationCompose (ownerFresh (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A)) - (ZFSet.prod ZFSet.omega (natSetCode 3)) ZFSet.omega - (completion.externalOwnerLevelPairs P r μ A) depthSlotGraph -end GroundCompressionCompletion - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "F" => ownerFresh P B -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "V" => M.externalStarVertices G letters requests m one -local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 -local notation "depths" => M.externalStarDepth G letters requests m one -local notation "ownerDepth" => completion.externalOwnerDepth P0 r0 μ0 A0 -local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 -local notation "pairs" => completion.externalOwnerLevelPairs P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG - -theorem externalOwnerDepth_ground_function (hP0 : P0 ∈ M.sets) : - ownerDepth ∈ M.sets ∧ ZFSet.IsFunc B ZFSet.omega ownerDepth := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have owner := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 - have depth := data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG - exact ⟨M.relationCompose_mem pairing unions powers separation geometry.carrier_ground - (data.externalStarCarriers_ground pairing unions powers separation hG).1 - (M.omega_mem separation infinite) owner.1 depth.1, - relationCompose_function_of_subset owner.2 depth.2 (fun _ h => h)⟩ - -theorem externalOwnerLevelPairs_ground_function (hP0 : P0 ∈ M.sets) : - pairs ∈ M.sets ∧ ZFSet.IsFunc F (ZFSet.prod ZFSet.omega (natSetCode 3)) pairs := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have depth := data.externalOwnerDepth_ground_function group oldAction pairing unions powers separation infinite hG hP0 - have slot := data.externalOwnerSlots_ground_function group oldAction pairing unions powers separation infinite hG hP0 - exact ⟨M.pairedGraph_mem pairing unions powers separation - (M.ownerFresh_mem separation - (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) geometry.carrier_ground) - (M.omega_mem separation infinite) (M.natSetCode_mem separation infinite 3) depth.1 slot.1, - pairedGraph_function_of_subset depth.2 slot.2 (fun x h => ((mem_ownerFresh P B x).1 h).1)⟩ - -theorem externalOwnerLevels_ground_function (hP0 : P0 ∈ M.sets) : - levels ∈ M.sets ∧ ZFSet.IsFunc F ZFSet.omega levels := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have pairCode := data.externalOwnerLevelPairs_ground_function group oldAction pairing unions powers separation infinite hG hP0 - have hOmega := M.omega_mem separation infinite - exact ⟨M.relationCompose_mem pairing unions powers separation - (M.ownerFresh_mem separation - (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) geometry.carrier_ground) - (M.prod_mem pairing unions powers separation hOmega (M.natSetCode_mem separation infinite 3)) hOmega - pairCode.1 (M.depthSlotGraph_mem pairing unions powers separation infinite), - relationCompose_function_of_subset pairCode.2 depthSlotGraph_function (fun _ h => h)⟩ - -theorem externalOwnerLevels_entry_iff (hP0 : P0 ∈ M.sets) (x : ZFSet.{u}) (k : Nat) : - ZFSet.pair x (natSetCode k) ∈ levels ↔ x ∈ F ∧ - ∃ v, ∃ n j : Nat, j < 3 ∧ ZFSet.pair x v ∈ owners ∧ - ZFSet.pair v (natSetCode n) ∈ depths ∧ ZFSet.pair x (natSetCode j) ∈ slots ∧ - k = depthSlotIndex n j := by - change ZFSet.pair x (natSetCode k) ∈ relationCompose F (ZFSet.prod ZFSet.omega (natSetCode 3)) - ZFSet.omega pairs depthSlotGraph ↔ _ - rw [pair_mem_relationCompose] - constructor - · rintro ⟨hx, _, p, hp, pairEntry, rankEntry⟩ - obtain ⟨n, hn, j, hj, rfl⟩ := ZFSet.mem_prod.1 hp - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨j, bound, rfl⟩ := (mem_natSetCode j 3).1 hj - have pairParts := (pair_mem_pairedGraph _ _ _ _ _ _ _ _).1 pairEntry - obtain ⟨_, _, v, _, owned, depth⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 pairParts.2.2.2.1 - exact ⟨hx, v, n, j, bound, owned, depth, pairParts.2.2.2.2, - ((pair_mem_depthSlotGraph n j k).1 rankEntry).2⟩ - · rintro ⟨hx, v, n, j, bound, owned, depth, slot, rfl⟩ - have owner := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have hv := (ZFSet.pair_mem_prod.1 (owner.1 owned)).2 - have hn := natSetCode_mem_omega n - have hj := (natSetCode_mem_iff j 3).2 bound - refine ⟨hx, natSetCode_mem_omega _, ZFSet.pair (natSetCode n) (natSetCode j), - ZFSet.pair_mem_prod.2 ⟨hn, hj⟩, ?_, (pair_mem_depthSlotGraph n j _).2 ⟨bound, rfl⟩⟩ - apply (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 - refine ⟨hx, hn, hj, ?_, slot⟩ - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨((mem_ownerFresh P B x).1 hx).1, hn, v, hv, owned, depth⟩ - -theorem externalOwnerLevels_monotone (hP0 : P0 ∈ M.sets) {x y : ZFSet.{u}} {k l : Nat} - (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) - (first : ZFSet.pair x (natSetCode k) ∈ levels) - (second : ZFSet.pair y (natSetCode l) ∈ levels) : k ≤ l := by - obtain ⟨_, v, n, j, hj, xv, vn, xj, rfl⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 first - obtain ⟨_, w, m, i, hi, yw, wm, yi, rfl⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 y l).1 second - have depthOrder := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG - lower xv yw vn wm - apply (depthSlotIndex_le_iff hj hi).2 - rcases Nat.lt_or_eq_of_le depthOrder.1 with less | same - · exact Or.inl less - · subst m - have slotOrder := data.externalOwnerSlots_monotone group oldAction pairing unions powers separation infinite hG hP0 - lower xv yw vn wm xj yi - refine Or.inr ⟨rfl, ?_⟩ - rcases slotOrder with equal | less - · exact (natSetCode_injective equal).le - · exact ((natSetCode_mem_iff j i).1 less).le - -end GroundExternalGeometryInputs - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "F" => ownerFresh P B -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "V" => M.externalStarVertices G letters requests m one -local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 -local notation "depths" => M.externalStarDepth G letters requests m one -local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG - -theorem externalOwnerLevels_rank (hP0 : P0 ∈ M.sets) {x v : ZFSet.{u}} {n j k : Nat} - (owned : ZFSet.pair x v ∈ owners) (depth : ZFSet.pair v (natSetCode n) ∈ depths) - (slot : ZFSet.pair x (natSetCode j) ∈ slots) (level : ZFSet.pair x (natSetCode k) ∈ levels) : - j < 3 ∧ k = depthSlotIndex n j := by - obtain ⟨_, v', n', j', bound, owned', depth', slot', equal⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level - have ownerCode : FunctionGraphOn B owners := - ⟨_, (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ - have depthCode : FunctionGraphOn V depths := - ⟨_, (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).2⟩ - have slotCode : FunctionGraphOn F slots := - ⟨_, (data.externalOwnerSlots_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ - have hv := ownerCode.unique owned' owned - subst v' - have hn := natSetCode_injective (depthCode.unique depth' depth) - have hj := natSetCode_injective (slotCode.unique slot' slot) - subst n' - subst j' - exact ⟨bound, equal⟩ - -theorem externalOwnerLevels_equal_components (hP0 : P0 ∈ M.sets) - {x y v w : ZFSet.{u}} {n m j i k : Nat} - (firstOwner : ZFSet.pair x v ∈ owners) (secondOwner : ZFSet.pair y w ∈ owners) - (firstDepth : ZFSet.pair v (natSetCode n) ∈ depths) - (secondDepth : ZFSet.pair w (natSetCode m) ∈ depths) - (firstSlot : ZFSet.pair x (natSetCode j) ∈ slots) - (secondSlot : ZFSet.pair y (natSetCode i) ∈ slots) - (first : ZFSet.pair x (natSetCode k) ∈ levels) - (second : ZFSet.pair y (natSetCode k) ∈ levels) : n = m ∧ j = i := by - have left := data.externalOwnerLevels_rank group oldAction pairing unions powers separation infinite hG hP0 - firstOwner firstDepth firstSlot first - have right := data.externalOwnerLevels_rank group oldAction pairing unions powers separation infinite hG hP0 - secondOwner secondDepth secondSlot second - exact (depthSlotIndex_eq_iff left.1 right.1).1 (left.2.symm.trans right.2) - -theorem externalOwnerLevels_meet_lower (hP0 : P0 ∈ M.sets) - {x y z v w : ZFSet.{u}} {k l : Nat} - (firstOwner : ZFSet.pair x v ∈ owners) (secondOwner : ZFSet.pair y w ∈ owners) - (different : v ≠ w) (first : ZFSet.pair x (natSetCode k) ∈ levels) - (second : ZFSet.pair y (natSetCode k) ∈ levels) - (meetEntry : ZFSet.pair (ZFSet.pair x y) z ∈ completion.externalPointMeet P0 r0 μ0 A0) - (third : ZFSet.pair z (natSetCode l) ∈ levels) : l < k := by - obtain ⟨_, v', n, j, hj, xv, vn, xj, eqK⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 first - obtain ⟨_, w', m, i, hi, yw, wm, yi, eqK'⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 y k).1 second - obtain ⟨_, u, p, q, hq, zu, up, zq, eqL⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 z l).1 third - have ownerCode : FunctionGraphOn B owners := - ⟨_, (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ - have hv := ownerCode.unique xv firstOwner - have hw := ownerCode.unique yw secondOwner - subst v' - subst w' - have same := ((depthSlotIndex_eq_iff hj hi).1 (eqK.symm.trans eqK')).1 - subst m - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have left := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG - (geometry.meet.lower_left x y z meetEntry) zu firstOwner up vn - have right := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG - (geometry.meet.lower_right x y z meetEntry) zu secondOwner up wm - have less : p < n := by - apply Nat.lt_of_le_of_ne left.1 - intro equal - exact different ((left.2 equal).symm.trans (right.2 equal)) - rw [eqL, eqK] - exact (depthSlotIndex_lt_iff hq hj).2 (Or.inl less) - -theorem externalOwnerLevels_meet_old_or_lower (hP0 : P0 ∈ M.sets) - {x y z v w : ZFSet.{u}} {k : Nat} - (firstOwner : ZFSet.pair x v ∈ owners) (secondOwner : ZFSet.pair y w ∈ owners) - (different : v ≠ w) (first : ZFSet.pair x (natSetCode k) ∈ levels) - (second : ZFSet.pair y (natSetCode k) ∈ levels) - (meetEntry : ZFSet.pair (ZFSet.pair x y) z ∈ completion.externalPointMeet P0 r0 μ0 A0) : - z ∈ P ∨ ∃ l < k, ZFSet.pair z (natSetCode l) ∈ levels := by - by_cases old : z ∈ P - · exact Or.inl old - · have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have hz := (ZFSet.pair_mem_prod.1 (geometry.meet.order.relation (geometry.meet.lower_left x y z meetEntry))).1 - have code := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - obtain ⟨l, entry, _⟩ := code.2 z ((mem_ownerFresh P B z).2 ⟨hz, old⟩) - have hl := (ZFSet.pair_mem_prod.1 (code.1 entry)).2 - obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode l).1 hl - exact Or.inr ⟨l, data.externalOwnerLevels_meet_lower group oldAction pairing unions powers separation infinite hG hP0 - firstOwner secondOwner different first second meetEntry entry, entry⟩ - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -noncomputable def preparationFamilyImage (J N C E keyMap tupleMap k enums : ZFSet.{u}) : ZFSet.{u} := - relationCompose N J (ZFSet.prod C E) (relationConverse J N keyMap) - (relationCompose J (ZFSet.prod C E) (ZFSet.prod C E) (pairedGraph J C E k enums) tupleMap) - -noncomputable def preparationFamilyFirst (J N C E keyMap tupleMap k enums : ZFSet.{u}) : ZFSet.{u} := - relationCompose (relationImage J N keyMap) (ZFSet.prod C E) C (preparationFamilyImage J N C E keyMap tupleMap k enums) - (productFirst C E) - -noncomputable def preparationFamilySecond (J N C E keyMap tupleMap k enums : ZFSet.{u}) : ZFSet.{u} := - relationCompose (relationImage J N keyMap) (ZFSet.prod C E) E (preparationFamilyImage J N C E keyMap tupleMap k enums) - (productSecond C E) - -theorem preparationFamilyImage_function {J N C E keyMap tupleMap k enums : ZFSet.{u}} - (keys : InjectionCode N N keyMap) (tuples : ZFSet.IsFunc (ZFSet.prod C E) (ZFSet.prod C E) tupleMap) - (first : ZFSet.IsFunc J C k) (second : ZFSet.IsFunc J E enums) : - ZFSet.IsFunc (relationImage J N keyMap) (ZFSet.prod C E) - (preparationFamilyImage J N C E keyMap tupleMap k enums) := by - have forward := relationCompose_function_of_subset - (pairedGraph_function_of_subset first second (fun _ h => h)) tuples (fun _ h => h) - let inverse := relationConverse J N keyMap - let mapped := relationCompose J (ZFSet.prod C E) (ZFSet.prod C E) (pairedGraph J C E k enums) tupleMap - have uniqueInverse : ∀ x v w, ZFSet.pair x v ∈ inverse → ZFSet.pair x w ∈ inverse → v = w := by - intro x v w hv hw - exact keys.injective v w x ((pair_mem_relationConverse J N keyMap v x).1 hv).2.2 - ((pair_mem_relationConverse J N keyMap w x).1 hw).2.2 - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, v, hv, y, hy, rfl, xv, _⟩ := (mem_relationCompose N J (ZFSet.prod C E) inverse mapped z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨(mem_relationImage J N keyMap x).2 - ⟨hx, v, hv, ((pair_mem_relationConverse J N keyMap v x).1 xv).2.2⟩, hy⟩ - · intro x hx - obtain ⟨hxN, v, hv, vx⟩ := (mem_relationImage J N keyMap x).1 hx - have xv := (pair_mem_relationConverse J N keyMap v x).2 ⟨hv, hxN, vx⟩ - obtain ⟨y, vy, unique⟩ := forward.2 v hv - have hy := (ZFSet.pair_mem_prod.1 (forward.1 vy)).2 - refine ⟨y, (pair_mem_relationCompose N J (ZFSet.prod C E) inverse mapped x y).2 - ⟨hxN, hy, v, hv, xv, vy⟩, ?_⟩ - intro other entry - obtain ⟨_, _, w, _, xw, wy⟩ := (pair_mem_relationCompose N J (ZFSet.prod C E) inverse mapped x other).1 entry - exact unique other (uniqueInverse x w v xw xv ▸ wy) - -theorem preparationFamilyImages_function {J N C E keyMap tupleMap k enums : ZFSet.{u}} - (keys : InjectionCode N N keyMap) (tuples : ZFSet.IsFunc (ZFSet.prod C E) (ZFSet.prod C E) tupleMap) - (first : ZFSet.IsFunc J C k) (second : ZFSet.IsFunc J E enums) : - ZFSet.IsFunc (relationImage J N keyMap) C (preparationFamilyFirst J N C E keyMap tupleMap k enums) ∧ - ZFSet.IsFunc (relationImage J N keyMap) E (preparationFamilySecond J N C E keyMap tupleMap k enums) := by - have joint := preparationFamilyImage_function keys tuples first second - exact ⟨relationCompose_function_of_subset joint (productFirst_function C E) (fun _ h => h), - relationCompose_function_of_subset joint (productSecond_function C E) (fun _ h => h)⟩ - -theorem preparationFamilyImages_entry {J N C E keyMap tupleMap k enums : ZFSet.{u}} - (keys : InjectionCode N N keyMap) (tuples : ZFSet.IsFunc (ZFSet.prod C E) (ZFSet.prod C E) tupleMap) - (first : ZFSet.IsFunc J C k) (second : ZFSet.IsFunc J E enums) (x c e : ZFSet.{u}) : - (ZFSet.pair x c ∈ preparationFamilyFirst J N C E keyMap tupleMap k enums ∧ - ZFSet.pair x e ∈ preparationFamilySecond J N C E keyMap tupleMap k enums) ↔ - ∃ z a b, ZFSet.pair z a ∈ k ∧ ZFSet.pair z b ∈ enums ∧ ZFSet.pair z x ∈ keyMap ∧ - ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c e) ∈ tupleMap := by - let joint := preparationFamilyImage J N C E keyMap tupleMap k enums - have jointFunction := preparationFamilyImage_function keys tuples first second - have paired (x c e : ZFSet.{u}) : - (ZFSet.pair x c ∈ preparationFamilyFirst J N C E keyMap tupleMap k enums ∧ - ZFSet.pair x e ∈ preparationFamilySecond J N C E keyMap tupleMap k enums) ↔ - ZFSet.pair x (ZFSet.pair c e) ∈ joint := by - constructor - · rintro ⟨hc, he⟩ - obtain ⟨_, _, y, _, xy, yc⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 hc - obtain ⟨_, _, y', _, xy', ye⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 he - obtain ⟨a, ha, b, hb, eqc⟩ := (mem_productFirst C E _).1 yc - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eqc - obtain ⟨a', _, b', _, eqe⟩ := (mem_productSecond C E _).1 ye - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eqe - obtain ⟨_, _, unique⟩ := jointFunction.2 x (ZFSet.pair_mem_prod.1 (jointFunction.1 xy)).1 - have same := (unique _ xy).trans (unique _ xy').symm - obtain ⟨_, sameB⟩ := ZFSet.pair_inj.1 same - exact sameB ▸ xy - · intro entry - have bounds := ZFSet.pair_mem_prod.1 (jointFunction.1 entry) - have out := ZFSet.pair_mem_prod.1 bounds.2 - exact ⟨(pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨bounds.1, out.1, ZFSet.pair c e, bounds.2, entry, (mem_productFirst C E _).2 ⟨c, out.1, e, out.2, rfl⟩⟩, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨bounds.1, out.2, ZFSet.pair c e, bounds.2, entry, (mem_productSecond C E _).2 ⟨c, out.1, e, out.2, rfl⟩⟩⟩ - rw [paired] - constructor - · intro entry - obtain ⟨_, _, z, _, inverse, forward⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - obtain ⟨_, _, value, _, old, moved⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 forward - obtain ⟨z', _, a, _, b, _, eq, ka, eb⟩ := (mem_pairedGraph J C E k enums _).1 old - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨z, a, b, ka, eb, ((pair_mem_relationConverse J N keyMap z x).1 inverse).2.2, moved⟩ - · rintro ⟨z, a, b, ka, eb, key, moved⟩ - have kaBounds := ZFSet.pair_mem_prod.1 (first.1 ka) - have ebBounds := ZFSet.pair_mem_prod.1 (second.1 eb) - have hx := (ZFSet.pair_mem_prod.1 (keys.function.1 key)).2 - have out := (ZFSet.pair_mem_prod.1 (tuples.1 moved)).2 - have ab := ZFSet.pair_mem_prod.2 ⟨kaBounds.2, ebBounds.2⟩ - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨hx, out, z, kaBounds.1, (pair_mem_relationConverse J N keyMap z x).2 ⟨kaBounds.1, hx, key⟩, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨kaBounds.1, out, ZFSet.pair a b, ab, - (pair_mem_pairedGraph J C E k enums z a b).2 ⟨kaBounds.1, kaBounds.2, ebBounds.2, ka, eb⟩, moved⟩⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem preparationFamilyImages_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {J N C E keyMap tupleMap k enums : ZFSet.{u}} - (hJ : J ∈ M.sets) (hN : N ∈ M.sets) (hC : C ∈ M.sets) (hE : E ∈ M.sets) - (hKeys : keyMap ∈ M.sets) (hTuples : tupleMap ∈ M.sets) (hk : k ∈ M.sets) (he : enums ∈ M.sets) : - preparationFamilyImage J N C E keyMap tupleMap k enums ∈ M.sets ∧ - preparationFamilyFirst J N C E keyMap tupleMap k enums ∈ M.sets ∧ - preparationFamilySecond J N C E keyMap tupleMap k enums ∈ M.sets := by - have hCE := M.prod_mem pairing unions powers separation hC hE - have joint := M.relationCompose_mem pairing unions powers separation hN hJ hCE - (M.relationConverse_mem pairing unions powers separation hJ hN hKeys) - (M.relationCompose_mem pairing unions powers separation hJ hCE hCE - (M.pairedGraph_mem pairing unions powers separation hJ hC hE hk he) hTuples) - have hImage := M.relationImage_mem separation hJ hN hKeys - exact ⟨joint, M.relationCompose_mem pairing unions powers separation hImage hCE hC joint - (M.productFirst_mem pairing unions powers separation hC hE), - M.relationCompose_mem pairing unions powers separation hImage hCE hE joint - (M.productSecond_mem pairing unions powers separation hC hE)⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula SetRealization Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "F" => ownerFresh P B -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "V" => M.externalStarVertices G letters requests m one -local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 -local notation "depths" => M.externalStarDepth G letters requests m one -local notation "supports" => completion.externalStarSupports P0 r0 μ0 A0 -local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 -local notation "slotPoints" => completion.externalTileSlotPoints P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -include data group oldAction pairing unions powers separation infinite hG - -theorem externalTileSlotPoints_support {v j x : ZFSet.{u}} - (supported : ZFSet.pair (ZFSet.pair v j) x ∈ slotPoints) : ZFSet.pair v x ∈ supports := by - let := group.toGroup - obtain ⟨w, r, i, a, rfl, rfl, rfl⟩ := - data.externalTileSlotPoints_decode group oldAction pairing unions powers separation infinite hG supported - apply (data.externalStarSupports_iff group oldAction pairing unions powers separation infinite hG _ _).2 - exact ⟨((family).flatVertex r i).toFun a, rfl⟩ - -theorem externalOwnerSlots_supported (hP0 : P0 ∈ M.sets) {x v j : ZFSet.{u}} - (owned : ZFSet.pair x v ∈ owners) (slot : ZFSet.pair x j ∈ slots) : - ZFSet.pair (ZFSet.pair v j) x ∈ slotPoints := by - have function := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - exact ((pair_mem_leastSlotOwnerGraph_of_owner function owned).1 slot).2.2.1 - -theorem externalOwnerLevels_slot_support (hP0 : P0 ∈ M.sets) {x : ZFSet.{u}} {k : Nat} - (level : ZFSet.pair x (natSetCode k) ∈ levels) : x ∈ F ∧ - ∃ v, ∃ n j : Nat, j < 3 ∧ ZFSet.pair x v ∈ owners ∧ - ZFSet.pair v (natSetCode n) ∈ depths ∧ ZFSet.pair x (natSetCode j) ∈ slots ∧ - ZFSet.pair (ZFSet.pair v (natSetCode j)) x ∈ slotPoints ∧ k = depthSlotIndex n j := by - obtain ⟨hx, v, n, j, bound, owned, depth, slot, equal⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level - exact ⟨hx, v, n, j, bound, owned, depth, slot, - data.externalOwnerSlots_supported group oldAction pairing unions powers separation infinite hG hP0 owned slot, equal⟩ - -theorem externalOwnerLevels_slot_bound (hP0 : P0 ∈ M.sets) {v x : ZFSet.{u}} {n j k : Nat} - (supported : ZFSet.pair (ZFSet.pair v (natSetCode j)) x ∈ slotPoints) - (depth : ZFSet.pair v (natSetCode n) ∈ depths) - (level : ZFSet.pair x (natSetCode k) ∈ levels) : k ≤ depthSlotIndex n j := by - obtain ⟨hx, u, d, i, hi, owned, ownerDepth, slot, equal⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level - have support := data.externalTileSlotPoints_support group oldAction pairing unions powers separation infinite hG supported - have shape := (pair_mem_externalTileSlotSupports _ _ _ _ _ _ _ _ _ _).1 supported - have hj := shape.2.1 - have ownerFunction := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have depthCode : FunctionGraphOn V depths := - ⟨_, (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).2⟩ - have least := (pair_mem_leastSupportGraph _ _ _ _ _ _).1 owned - obtain ⟨a, _, ua, minimal⟩ := least.2.2.2 - have eqA := depthCode.unique ua ownerDepth - subst a - have before : d ≤ n := Nat.le_of_not_gt (fun less => minimal v shape.1 (natSetCode n) - (natSetCode_mem_omega n) support depth ((natSetCode_mem_iff n d).2 less)) - rw [equal] - apply (depthSlotIndex_le_iff hi ((natSetCode_mem_iff j 3).1 hj)).2 - rcases Nat.lt_or_eq_of_le before with less | same - · exact Or.inl less - · subst d - have tileOwned : ZFSet.pair x v ∈ owners := - (pair_mem_leastSupportGraph _ _ _ _ _ _).2 - ⟨((mem_ownerFresh P B x).1 hx).1, shape.1, support, - natSetCode n, natSetCode_mem_omega n, depth, minimal⟩ - have leastSlot := ((pair_mem_leastSlotOwnerGraph_of_owner ownerFunction tileOwned).1 slot).2.2 - have slotOrder := leastSlot.le ((natSetCode_mem_iff i 3).2 hi) hj supported - refine Or.inr ⟨rfl, ?_⟩ - rcases slotOrder with same | less - · exact (natSetCode_injective same).le - · exact ((natSetCode_mem_iff i j).1 less).le - -theorem externalSlotCopy_old_or_level_bound (hP0 : P0 ∈ M.sets) - {v x : ZFSet.{u}} {n j : Nat} - (supported : ZFSet.pair (ZFSet.pair v (natSetCode j)) x ∈ slotPoints) - (depth : ZFSet.pair v (natSetCode n) ∈ depths) : - x ∈ P ∨ ∃ k ≤ depthSlotIndex n j, ZFSet.pair x (natSetCode k) ∈ levels := by - by_cases old : x ∈ P - · exact Or.inl old - · have shape := (pair_mem_externalTileSlotSupports _ _ _ _ _ _ _ _ _ _).1 supported - have function := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - obtain ⟨k, level, _⟩ := function.2 x ((mem_ownerFresh P B x).2 ⟨shape.2.2.1, old⟩) - have hk := (ZFSet.pair_mem_prod.1 (function.1 level)).2 - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - exact Or.inr ⟨k, data.externalOwnerLevels_slot_bound group oldAction pairing unions powers separation infinite hG hP0 - supported depth level, level⟩ - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalTileSlotSupportRealization +import OAI.SetTheory.PartitionPrinciple.Definability.GroundDepthSlotCodes + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace BoundedFormula + +def leastSlotFormula {n} (supports v x j : Fin n) : BoundedFormula n := + .conj (tripleMembershipFormula v j x supports) + (allMem j (.neg (tripleMembershipFormula v.succ 0 x.succ supports.succ))) + +theorem truth_leastSlotFormula {n} (supports v x j : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (leastSlotFormula supports v x j) env ↔ + LeastSlotCode (env supports) (env v) (env x) (env j) := by + simp only [leastSlotFormula, Truth, truth_tripleMembershipFormula] + rfl + +def leastSlotOwnerEntryFormula {n} (z P B V owner supports three : Fin n) : BoundedFormula n := + exMem B (exMem three.succ (exMem V.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 1) + (.conj (.neg (.mem 2 P.succ.succ.succ)) + (.conj (pairMembershipFormula 2 0 owner.succ.succ.succ) + (leastSlotFormula supports.succ.succ.succ 0 2 1)))))) + +theorem truth_leastSlotOwnerEntryFormula {n} (z P B V owner supports three : Fin n) + (env : Fin n → ZFSet.{u}) (threeEq : env three = natSetCode 3) : + Truth (leastSlotOwnerEntryFormula z P B V owner supports three) env ↔ + env z ∈ leastSlotOwnerGraph (env P) (env B) (env V) (env owner) (env supports) := by + simp only [leastSlotOwnerEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_pairMembershipFormula, truth_leastSlotFormula] + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [threeEq, leastSlotOwnerGraph, ZFSet.mem_sep] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨x, hx, j, hj, _, _, equal, _⟩ := h + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hx, hj⟩ + +end BoundedFormula +namespace TransitiveGround + +theorem leastSlotOwnerGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {P B V owner supports : ZFSet.{u}} (hP : P ∈ M.sets) (hB : B ∈ M.sets) + (hV : V ∈ M.sets) (hOwner : owner ∈ M.sets) (hSupports : supports ∈ M.sets) : + leastSlotOwnerGraph P B V owner supports ∈ M.sets := by + have hThree := M.natSetCode_mem separation infinite 3 + let params := extend P (extend B (extend V (extend owner (extend supports (extend (natSetCode 3) Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.leastSlotOwnerEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hP (Fin.cases hB (Fin.cases hV (Fin.cases hOwner + (Fin.cases hSupports (Fin.cases hThree (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hB hThree) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.leastSlotOwnerEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod B (natSetCode 3)) = leastSlotOwnerGraph P B V owner supports := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_leastSlotOwnerEntryFormula _ _ _ _ _ _ _ _ rfl] + exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ + exact equal ▸ selected + +end TransitiveGround +end PartitionPilot.Forcing + +section + +namespace PartitionPilot.Forcing.GroundCompressionCompletion +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +noncomputable def externalOwnerSlots (P r μ A : ZFSet.{u}) : ZFSet.{u} := + leastSlotOwnerGraph (completion.externalSeedCarrier P r μ A) + (completion.externalPointCarrier P r μ A) + (M.externalStarVertices G (externalChildLetters I P (externalRectangles P G r μ A)) + (externalRequestCarrier I P (externalRectangles P G r μ A)) m one) + (completion.externalStarOwner P r μ A) (completion.externalTileSlotPoints P r μ A) + +end PartitionPilot.Forcing.GroundCompressionCompletion + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG + +theorem externalSeedCarrier_ground (hP0 : P0 ∈ M.sets) : P ∈ M.sets := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + exact M.relationImage_mem separation (completion.algebra.union.ground 0) geometry.carrier_ground + (geometry.copies_ground _ data.group.group_code.identity_mem) + +theorem externalOwnerSlots_ground_function (hP0 : P0 ∈ M.sets) : + slots ∈ M.sets ∧ ZFSet.IsFunc (ownerFresh P B) (natSetCode 3) slots := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have owner := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 + refine ⟨M.leastSlotOwnerGraph_mem pairing unions powers separation infinite + (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) + geometry.carrier_ground (data.externalStarCarriers_ground pairing unions powers separation hG).1 owner.1 + (data.externalTileSlotPoints_ground group oldAction pairing unions powers separation infinite hG hP0), ?_⟩ + apply leastSlotOwnerGraph_function owner.2 + intro x _ fresh v owned + exact data.externalTileSlotPoints_owner_cover group oldAction pairing unions powers separation infinite hG fresh owned + +theorem externalOwnerSlots_monotone (hP0 : P0 ∈ M.sets) {x y v w n j k : ZFSet.{u}} + (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) + (firstOwner : ZFSet.pair x v ∈ completion.externalStarOwner P0 r0 μ0 A0) + (secondOwner : ZFSet.pair y w ∈ completion.externalStarOwner P0 r0 μ0 A0) + (firstDepth : ZFSet.pair v n ∈ M.externalStarDepth G letters requests m one) + (secondDepth : ZFSet.pair w n ∈ M.externalStarDepth G letters requests m one) + (first : ZFSet.pair x j ∈ slots) (second : ZFSet.pair y k ∈ slots) : j = k ∨ j ∈ k := by + apply leastSlotOwnerGraph_monotone first second + · intro v' w' ownedX ownedY + have function := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have unique : FunctionGraphOn B (completion.externalStarOwner P0 r0 μ0 A0) := ⟨_, function⟩ + have vx := unique.unique ownedX firstOwner + have wy := unique.unique ownedY secondOwner + subst v' + subst w' + exact (data.externalStarOwner_order group oldAction pairing unions powers separation infinite hG + lower firstOwner secondOwner firstDepth secondDepth).2 rfl + · intro v _ j _ x hx y _ lower supported + exact data.externalTileSlotPoints_lower group oldAction pairing unions powers separation infinite hG hx lower supported + · exact lower + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem pairedGraph_function_of_subset {A B H K f g : ZFSet.{u}} + (first : ZFSet.IsFunc A H f) (second : ZFSet.IsFunc B K g) (subset : B ⊆ A) : + ZFSet.IsFunc B (ZFSet.prod H K) (pairedGraph B H K f g) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨a, firstEntry, firstUnique⟩ := first.2 x (subset hx) + obtain ⟨b, secondEntry, secondUnique⟩ := second.2 x hx + have ha := (ZFSet.pair_mem_prod.1 (first.1 firstEntry)).2 + have hb := (ZFSet.pair_mem_prod.1 (second.1 secondEntry)).2 + refine ⟨ZFSet.pair a b, (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 + ⟨hx, ha, hb, firstEntry, secondEntry⟩, ?_⟩ + intro y hy + obtain ⟨x', _, a', _, b', _, equal, firstEntry', secondEntry'⟩ := (mem_pairedGraph _ _ _ _ _ _).1 hy + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact congrArg₂ ZFSet.pair (firstUnique a' firstEntry') (secondUnique b' secondEntry') + +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +noncomputable def externalOwnerDepth (P r μ A : ZFSet.{u}) : ZFSet.{u} := + let letters := externalChildLetters I P (externalRectangles P G r μ A) + let requests := externalRequestCarrier I P (externalRectangles P G r μ A) + relationCompose (completion.externalPointCarrier P r μ A) + (M.externalStarVertices G letters requests m one) ZFSet.omega + (completion.externalStarOwner P r μ A) (M.externalStarDepth G letters requests m one) + +noncomputable def externalOwnerLevelPairs (P r μ A : ZFSet.{u}) : ZFSet.{u} := + pairedGraph (ownerFresh (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A)) + ZFSet.omega (natSetCode 3) (completion.externalOwnerDepth P r μ A) (completion.externalOwnerSlots P r μ A) + +noncomputable def externalOwnerLevels (P r μ A : ZFSet.{u}) : ZFSet.{u} := + relationCompose (ownerFresh (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A)) + (ZFSet.prod ZFSet.omega (natSetCode 3)) ZFSet.omega + (completion.externalOwnerLevelPairs P r μ A) depthSlotGraph +end GroundCompressionCompletion + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "F" => ownerFresh P B +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "V" => M.externalStarVertices G letters requests m one +local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 +local notation "depths" => M.externalStarDepth G letters requests m one +local notation "ownerDepth" => completion.externalOwnerDepth P0 r0 μ0 A0 +local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 +local notation "pairs" => completion.externalOwnerLevelPairs P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG + +theorem externalOwnerDepth_ground_function (hP0 : P0 ∈ M.sets) : + ownerDepth ∈ M.sets ∧ ZFSet.IsFunc B ZFSet.omega ownerDepth := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have owner := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 + have depth := data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG + exact ⟨M.relationCompose_mem pairing unions powers separation geometry.carrier_ground + (data.externalStarCarriers_ground pairing unions powers separation hG).1 + (M.omega_mem separation infinite) owner.1 depth.1, + relationCompose_function_of_subset owner.2 depth.2 (fun _ h => h)⟩ + +theorem externalOwnerLevelPairs_ground_function (hP0 : P0 ∈ M.sets) : + pairs ∈ M.sets ∧ ZFSet.IsFunc F (ZFSet.prod ZFSet.omega (natSetCode 3)) pairs := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have depth := data.externalOwnerDepth_ground_function group oldAction pairing unions powers separation infinite hG hP0 + have slot := data.externalOwnerSlots_ground_function group oldAction pairing unions powers separation infinite hG hP0 + exact ⟨M.pairedGraph_mem pairing unions powers separation + (M.ownerFresh_mem separation + (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) geometry.carrier_ground) + (M.omega_mem separation infinite) (M.natSetCode_mem separation infinite 3) depth.1 slot.1, + pairedGraph_function_of_subset depth.2 slot.2 (fun x h => ((mem_ownerFresh P B x).1 h).1)⟩ + +theorem externalOwnerLevels_ground_function (hP0 : P0 ∈ M.sets) : + levels ∈ M.sets ∧ ZFSet.IsFunc F ZFSet.omega levels := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have pairCode := data.externalOwnerLevelPairs_ground_function group oldAction pairing unions powers separation infinite hG hP0 + have hOmega := M.omega_mem separation infinite + exact ⟨M.relationCompose_mem pairing unions powers separation + (M.ownerFresh_mem separation + (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) geometry.carrier_ground) + (M.prod_mem pairing unions powers separation hOmega (M.natSetCode_mem separation infinite 3)) hOmega + pairCode.1 (M.depthSlotGraph_mem pairing unions powers separation infinite), + relationCompose_function_of_subset pairCode.2 depthSlotGraph_function (fun _ h => h)⟩ + +theorem externalOwnerLevels_entry_iff (hP0 : P0 ∈ M.sets) (x : ZFSet.{u}) (k : Nat) : + ZFSet.pair x (natSetCode k) ∈ levels ↔ x ∈ F ∧ + ∃ v, ∃ n j : Nat, j < 3 ∧ ZFSet.pair x v ∈ owners ∧ + ZFSet.pair v (natSetCode n) ∈ depths ∧ ZFSet.pair x (natSetCode j) ∈ slots ∧ + k = depthSlotIndex n j := by + change ZFSet.pair x (natSetCode k) ∈ relationCompose F (ZFSet.prod ZFSet.omega (natSetCode 3)) + ZFSet.omega pairs depthSlotGraph ↔ _ + rw [pair_mem_relationCompose] + constructor + · rintro ⟨hx, _, p, hp, pairEntry, rankEntry⟩ + obtain ⟨n, hn, j, hj, rfl⟩ := ZFSet.mem_prod.1 hp + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨j, bound, rfl⟩ := (mem_natSetCode j 3).1 hj + have pairParts := (pair_mem_pairedGraph _ _ _ _ _ _ _ _).1 pairEntry + obtain ⟨_, _, v, _, owned, depth⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 pairParts.2.2.2.1 + exact ⟨hx, v, n, j, bound, owned, depth, pairParts.2.2.2.2, + ((pair_mem_depthSlotGraph n j k).1 rankEntry).2⟩ + · rintro ⟨hx, v, n, j, bound, owned, depth, slot, rfl⟩ + have owner := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have hv := (ZFSet.pair_mem_prod.1 (owner.1 owned)).2 + have hn := natSetCode_mem_omega n + have hj := (natSetCode_mem_iff j 3).2 bound + refine ⟨hx, natSetCode_mem_omega _, ZFSet.pair (natSetCode n) (natSetCode j), + ZFSet.pair_mem_prod.2 ⟨hn, hj⟩, ?_, (pair_mem_depthSlotGraph n j _).2 ⟨bound, rfl⟩⟩ + apply (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 + refine ⟨hx, hn, hj, ?_, slot⟩ + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨((mem_ownerFresh P B x).1 hx).1, hn, v, hv, owned, depth⟩ + +theorem externalOwnerLevels_monotone (hP0 : P0 ∈ M.sets) {x y : ZFSet.{u}} {k l : Nat} + (lower : ZFSet.pair x y ∈ completion.externalPointOrder P0 r0 μ0 A0) + (first : ZFSet.pair x (natSetCode k) ∈ levels) + (second : ZFSet.pair y (natSetCode l) ∈ levels) : k ≤ l := by + obtain ⟨_, v, n, j, hj, xv, vn, xj, rfl⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 first + obtain ⟨_, w, m, i, hi, yw, wm, yi, rfl⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 y l).1 second + have depthOrder := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG + lower xv yw vn wm + apply (depthSlotIndex_le_iff hj hi).2 + rcases Nat.lt_or_eq_of_le depthOrder.1 with less | same + · exact Or.inl less + · subst m + have slotOrder := data.externalOwnerSlots_monotone group oldAction pairing unions powers separation infinite hG hP0 + lower xv yw vn wm xj yi + refine Or.inr ⟨rfl, ?_⟩ + rcases slotOrder with equal | less + · exact (natSetCode_injective equal).le + · exact ((natSetCode_mem_iff j i).1 less).le + +end GroundExternalGeometryInputs + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "F" => ownerFresh P B +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "V" => M.externalStarVertices G letters requests m one +local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 +local notation "depths" => M.externalStarDepth G letters requests m one +local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG + +theorem externalOwnerLevels_rank (hP0 : P0 ∈ M.sets) {x v : ZFSet.{u}} {n j k : Nat} + (owned : ZFSet.pair x v ∈ owners) (depth : ZFSet.pair v (natSetCode n) ∈ depths) + (slot : ZFSet.pair x (natSetCode j) ∈ slots) (level : ZFSet.pair x (natSetCode k) ∈ levels) : + j < 3 ∧ k = depthSlotIndex n j := by + obtain ⟨_, v', n', j', bound, owned', depth', slot', equal⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level + have ownerCode : FunctionGraphOn B owners := + ⟨_, (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ + have depthCode : FunctionGraphOn V depths := + ⟨_, (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).2⟩ + have slotCode : FunctionGraphOn F slots := + ⟨_, (data.externalOwnerSlots_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ + have hv := ownerCode.unique owned' owned + subst v' + have hn := natSetCode_injective (depthCode.unique depth' depth) + have hj := natSetCode_injective (slotCode.unique slot' slot) + subst n' + subst j' + exact ⟨bound, equal⟩ + +theorem externalOwnerLevels_equal_components (hP0 : P0 ∈ M.sets) + {x y v w : ZFSet.{u}} {n m j i k : Nat} + (firstOwner : ZFSet.pair x v ∈ owners) (secondOwner : ZFSet.pair y w ∈ owners) + (firstDepth : ZFSet.pair v (natSetCode n) ∈ depths) + (secondDepth : ZFSet.pair w (natSetCode m) ∈ depths) + (firstSlot : ZFSet.pair x (natSetCode j) ∈ slots) + (secondSlot : ZFSet.pair y (natSetCode i) ∈ slots) + (first : ZFSet.pair x (natSetCode k) ∈ levels) + (second : ZFSet.pair y (natSetCode k) ∈ levels) : n = m ∧ j = i := by + have left := data.externalOwnerLevels_rank group oldAction pairing unions powers separation infinite hG hP0 + firstOwner firstDepth firstSlot first + have right := data.externalOwnerLevels_rank group oldAction pairing unions powers separation infinite hG hP0 + secondOwner secondDepth secondSlot second + exact (depthSlotIndex_eq_iff left.1 right.1).1 (left.2.symm.trans right.2) + +theorem externalOwnerLevels_meet_lower (hP0 : P0 ∈ M.sets) + {x y z v w : ZFSet.{u}} {k l : Nat} + (firstOwner : ZFSet.pair x v ∈ owners) (secondOwner : ZFSet.pair y w ∈ owners) + (different : v ≠ w) (first : ZFSet.pair x (natSetCode k) ∈ levels) + (second : ZFSet.pair y (natSetCode k) ∈ levels) + (meetEntry : ZFSet.pair (ZFSet.pair x y) z ∈ completion.externalPointMeet P0 r0 μ0 A0) + (third : ZFSet.pair z (natSetCode l) ∈ levels) : l < k := by + obtain ⟨_, v', n, j, hj, xv, vn, xj, eqK⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 first + obtain ⟨_, w', m, i, hi, yw, wm, yi, eqK'⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 y k).1 second + obtain ⟨_, u, p, q, hq, zu, up, zq, eqL⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 z l).1 third + have ownerCode : FunctionGraphOn B owners := + ⟨_, (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ + have hv := ownerCode.unique xv firstOwner + have hw := ownerCode.unique yw secondOwner + subst v' + subst w' + have same := ((depthSlotIndex_eq_iff hj hi).1 (eqK.symm.trans eqK')).1 + subst m + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have left := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG + (geometry.meet.lower_left x y z meetEntry) zu firstOwner up vn + have right := data.externalStarOwner_order_depth group oldAction pairing unions powers separation infinite hG + (geometry.meet.lower_right x y z meetEntry) zu secondOwner up wm + have less : p < n := by + apply Nat.lt_of_le_of_ne left.1 + intro equal + exact different ((left.2 equal).symm.trans (right.2 equal)) + rw [eqL, eqK] + exact (depthSlotIndex_lt_iff hq hj).2 (Or.inl less) + +theorem externalOwnerLevels_meet_old_or_lower (hP0 : P0 ∈ M.sets) + {x y z v w : ZFSet.{u}} {k : Nat} + (firstOwner : ZFSet.pair x v ∈ owners) (secondOwner : ZFSet.pair y w ∈ owners) + (different : v ≠ w) (first : ZFSet.pair x (natSetCode k) ∈ levels) + (second : ZFSet.pair y (natSetCode k) ∈ levels) + (meetEntry : ZFSet.pair (ZFSet.pair x y) z ∈ completion.externalPointMeet P0 r0 μ0 A0) : + z ∈ P ∨ ∃ l < k, ZFSet.pair z (natSetCode l) ∈ levels := by + by_cases old : z ∈ P + · exact Or.inl old + · have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have hz := (ZFSet.pair_mem_prod.1 (geometry.meet.order.relation (geometry.meet.lower_left x y z meetEntry))).1 + have code := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + obtain ⟨l, entry, _⟩ := code.2 z ((mem_ownerFresh P B z).2 ⟨hz, old⟩) + have hl := (ZFSet.pair_mem_prod.1 (code.1 entry)).2 + obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode l).1 hl + exact Or.inr ⟨l, data.externalOwnerLevels_meet_lower group oldAction pairing unions powers separation infinite hG hP0 + firstOwner secondOwner different first second meetEntry entry, entry⟩ + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +noncomputable def preparationFamilyImage (J N C E keyMap tupleMap k enums : ZFSet.{u}) : ZFSet.{u} := + relationCompose N J (ZFSet.prod C E) (relationConverse J N keyMap) + (relationCompose J (ZFSet.prod C E) (ZFSet.prod C E) (pairedGraph J C E k enums) tupleMap) + +noncomputable def preparationFamilyFirst (J N C E keyMap tupleMap k enums : ZFSet.{u}) : ZFSet.{u} := + relationCompose (relationImage J N keyMap) (ZFSet.prod C E) C (preparationFamilyImage J N C E keyMap tupleMap k enums) + (productFirst C E) + +noncomputable def preparationFamilySecond (J N C E keyMap tupleMap k enums : ZFSet.{u}) : ZFSet.{u} := + relationCompose (relationImage J N keyMap) (ZFSet.prod C E) E (preparationFamilyImage J N C E keyMap tupleMap k enums) + (productSecond C E) + +theorem preparationFamilyImage_function {J N C E keyMap tupleMap k enums : ZFSet.{u}} + (keys : InjectionCode N N keyMap) (tuples : ZFSet.IsFunc (ZFSet.prod C E) (ZFSet.prod C E) tupleMap) + (first : ZFSet.IsFunc J C k) (second : ZFSet.IsFunc J E enums) : + ZFSet.IsFunc (relationImage J N keyMap) (ZFSet.prod C E) + (preparationFamilyImage J N C E keyMap tupleMap k enums) := by + have forward := relationCompose_function_of_subset + (pairedGraph_function_of_subset first second (fun _ h => h)) tuples (fun _ h => h) + let inverse := relationConverse J N keyMap + let mapped := relationCompose J (ZFSet.prod C E) (ZFSet.prod C E) (pairedGraph J C E k enums) tupleMap + have uniqueInverse : ∀ x v w, ZFSet.pair x v ∈ inverse → ZFSet.pair x w ∈ inverse → v = w := by + intro x v w hv hw + exact keys.injective v w x ((pair_mem_relationConverse J N keyMap v x).1 hv).2.2 + ((pair_mem_relationConverse J N keyMap w x).1 hw).2.2 + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, v, hv, y, hy, rfl, xv, _⟩ := (mem_relationCompose N J (ZFSet.prod C E) inverse mapped z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨(mem_relationImage J N keyMap x).2 + ⟨hx, v, hv, ((pair_mem_relationConverse J N keyMap v x).1 xv).2.2⟩, hy⟩ + · intro x hx + obtain ⟨hxN, v, hv, vx⟩ := (mem_relationImage J N keyMap x).1 hx + have xv := (pair_mem_relationConverse J N keyMap v x).2 ⟨hv, hxN, vx⟩ + obtain ⟨y, vy, unique⟩ := forward.2 v hv + have hy := (ZFSet.pair_mem_prod.1 (forward.1 vy)).2 + refine ⟨y, (pair_mem_relationCompose N J (ZFSet.prod C E) inverse mapped x y).2 + ⟨hxN, hy, v, hv, xv, vy⟩, ?_⟩ + intro other entry + obtain ⟨_, _, w, _, xw, wy⟩ := (pair_mem_relationCompose N J (ZFSet.prod C E) inverse mapped x other).1 entry + exact unique other (uniqueInverse x w v xw xv ▸ wy) + +theorem preparationFamilyImages_function {J N C E keyMap tupleMap k enums : ZFSet.{u}} + (keys : InjectionCode N N keyMap) (tuples : ZFSet.IsFunc (ZFSet.prod C E) (ZFSet.prod C E) tupleMap) + (first : ZFSet.IsFunc J C k) (second : ZFSet.IsFunc J E enums) : + ZFSet.IsFunc (relationImage J N keyMap) C (preparationFamilyFirst J N C E keyMap tupleMap k enums) ∧ + ZFSet.IsFunc (relationImage J N keyMap) E (preparationFamilySecond J N C E keyMap tupleMap k enums) := by + have joint := preparationFamilyImage_function keys tuples first second + exact ⟨relationCompose_function_of_subset joint (productFirst_function C E) (fun _ h => h), + relationCompose_function_of_subset joint (productSecond_function C E) (fun _ h => h)⟩ + +theorem preparationFamilyImages_entry {J N C E keyMap tupleMap k enums : ZFSet.{u}} + (keys : InjectionCode N N keyMap) (tuples : ZFSet.IsFunc (ZFSet.prod C E) (ZFSet.prod C E) tupleMap) + (first : ZFSet.IsFunc J C k) (second : ZFSet.IsFunc J E enums) (x c e : ZFSet.{u}) : + (ZFSet.pair x c ∈ preparationFamilyFirst J N C E keyMap tupleMap k enums ∧ + ZFSet.pair x e ∈ preparationFamilySecond J N C E keyMap tupleMap k enums) ↔ + ∃ z a b, ZFSet.pair z a ∈ k ∧ ZFSet.pair z b ∈ enums ∧ ZFSet.pair z x ∈ keyMap ∧ + ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c e) ∈ tupleMap := by + let joint := preparationFamilyImage J N C E keyMap tupleMap k enums + have jointFunction := preparationFamilyImage_function keys tuples first second + have paired (x c e : ZFSet.{u}) : + (ZFSet.pair x c ∈ preparationFamilyFirst J N C E keyMap tupleMap k enums ∧ + ZFSet.pair x e ∈ preparationFamilySecond J N C E keyMap tupleMap k enums) ↔ + ZFSet.pair x (ZFSet.pair c e) ∈ joint := by + constructor + · rintro ⟨hc, he⟩ + obtain ⟨_, _, y, _, xy, yc⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 hc + obtain ⟨_, _, y', _, xy', ye⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 he + obtain ⟨a, ha, b, hb, eqc⟩ := (mem_productFirst C E _).1 yc + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eqc + obtain ⟨a', _, b', _, eqe⟩ := (mem_productSecond C E _).1 ye + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eqe + obtain ⟨_, _, unique⟩ := jointFunction.2 x (ZFSet.pair_mem_prod.1 (jointFunction.1 xy)).1 + have same := (unique _ xy).trans (unique _ xy').symm + obtain ⟨_, sameB⟩ := ZFSet.pair_inj.1 same + exact sameB ▸ xy + · intro entry + have bounds := ZFSet.pair_mem_prod.1 (jointFunction.1 entry) + have out := ZFSet.pair_mem_prod.1 bounds.2 + exact ⟨(pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨bounds.1, out.1, ZFSet.pair c e, bounds.2, entry, (mem_productFirst C E _).2 ⟨c, out.1, e, out.2, rfl⟩⟩, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨bounds.1, out.2, ZFSet.pair c e, bounds.2, entry, (mem_productSecond C E _).2 ⟨c, out.1, e, out.2, rfl⟩⟩⟩ + rw [paired] + constructor + · intro entry + obtain ⟨_, _, z, _, inverse, forward⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + obtain ⟨_, _, value, _, old, moved⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 forward + obtain ⟨z', _, a, _, b, _, eq, ka, eb⟩ := (mem_pairedGraph J C E k enums _).1 old + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨z, a, b, ka, eb, ((pair_mem_relationConverse J N keyMap z x).1 inverse).2.2, moved⟩ + · rintro ⟨z, a, b, ka, eb, key, moved⟩ + have kaBounds := ZFSet.pair_mem_prod.1 (first.1 ka) + have ebBounds := ZFSet.pair_mem_prod.1 (second.1 eb) + have hx := (ZFSet.pair_mem_prod.1 (keys.function.1 key)).2 + have out := (ZFSet.pair_mem_prod.1 (tuples.1 moved)).2 + have ab := ZFSet.pair_mem_prod.2 ⟨kaBounds.2, ebBounds.2⟩ + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨hx, out, z, kaBounds.1, (pair_mem_relationConverse J N keyMap z x).2 ⟨kaBounds.1, hx, key⟩, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨kaBounds.1, out, ZFSet.pair a b, ab, + (pair_mem_pairedGraph J C E k enums z a b).2 ⟨kaBounds.1, kaBounds.2, ebBounds.2, ka, eb⟩, moved⟩⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem preparationFamilyImages_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {J N C E keyMap tupleMap k enums : ZFSet.{u}} + (hJ : J ∈ M.sets) (hN : N ∈ M.sets) (hC : C ∈ M.sets) (hE : E ∈ M.sets) + (hKeys : keyMap ∈ M.sets) (hTuples : tupleMap ∈ M.sets) (hk : k ∈ M.sets) (he : enums ∈ M.sets) : + preparationFamilyImage J N C E keyMap tupleMap k enums ∈ M.sets ∧ + preparationFamilyFirst J N C E keyMap tupleMap k enums ∈ M.sets ∧ + preparationFamilySecond J N C E keyMap tupleMap k enums ∈ M.sets := by + have hCE := M.prod_mem pairing unions powers separation hC hE + have joint := M.relationCompose_mem pairing unions powers separation hN hJ hCE + (M.relationConverse_mem pairing unions powers separation hJ hN hKeys) + (M.relationCompose_mem pairing unions powers separation hJ hCE hCE + (M.pairedGraph_mem pairing unions powers separation hJ hC hE hk he) hTuples) + have hImage := M.relationImage_mem separation hJ hN hKeys + exact ⟨joint, M.relationCompose_mem pairing unions powers separation hImage hCE hC joint + (M.productFirst_mem pairing unions powers separation hC hE), + M.relationCompose_mem pairing unions powers separation hImage hCE hE joint + (M.productSecond_mem pairing unions powers separation hC hE)⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula SetRealization Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "F" => ownerFresh P B +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "V" => M.externalStarVertices G letters requests m one +local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 +local notation "depths" => M.externalStarDepth G letters requests m one +local notation "supports" => completion.externalStarSupports P0 r0 μ0 A0 +local notation "slots" => completion.externalOwnerSlots P0 r0 μ0 A0 +local notation "slotPoints" => completion.externalTileSlotPoints P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +include data group oldAction pairing unions powers separation infinite hG + +theorem externalTileSlotPoints_support {v j x : ZFSet.{u}} + (supported : ZFSet.pair (ZFSet.pair v j) x ∈ slotPoints) : ZFSet.pair v x ∈ supports := by + let := group.toGroup + obtain ⟨w, r, i, a, rfl, rfl, rfl⟩ := + data.externalTileSlotPoints_decode group oldAction pairing unions powers separation infinite hG supported + apply (data.externalStarSupports_iff group oldAction pairing unions powers separation infinite hG _ _).2 + exact ⟨((family).flatVertex r i).toFun a, rfl⟩ + +theorem externalOwnerSlots_supported (hP0 : P0 ∈ M.sets) {x v j : ZFSet.{u}} + (owned : ZFSet.pair x v ∈ owners) (slot : ZFSet.pair x j ∈ slots) : + ZFSet.pair (ZFSet.pair v j) x ∈ slotPoints := by + have function := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + exact ((pair_mem_leastSlotOwnerGraph_of_owner function owned).1 slot).2.2.1 + +theorem externalOwnerLevels_slot_support (hP0 : P0 ∈ M.sets) {x : ZFSet.{u}} {k : Nat} + (level : ZFSet.pair x (natSetCode k) ∈ levels) : x ∈ F ∧ + ∃ v, ∃ n j : Nat, j < 3 ∧ ZFSet.pair x v ∈ owners ∧ + ZFSet.pair v (natSetCode n) ∈ depths ∧ ZFSet.pair x (natSetCode j) ∈ slots ∧ + ZFSet.pair (ZFSet.pair v (natSetCode j)) x ∈ slotPoints ∧ k = depthSlotIndex n j := by + obtain ⟨hx, v, n, j, bound, owned, depth, slot, equal⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level + exact ⟨hx, v, n, j, bound, owned, depth, slot, + data.externalOwnerSlots_supported group oldAction pairing unions powers separation infinite hG hP0 owned slot, equal⟩ + +theorem externalOwnerLevels_slot_bound (hP0 : P0 ∈ M.sets) {v x : ZFSet.{u}} {n j k : Nat} + (supported : ZFSet.pair (ZFSet.pair v (natSetCode j)) x ∈ slotPoints) + (depth : ZFSet.pair v (natSetCode n) ∈ depths) + (level : ZFSet.pair x (natSetCode k) ∈ levels) : k ≤ depthSlotIndex n j := by + obtain ⟨hx, u, d, i, hi, owned, ownerDepth, slot, equal⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level + have support := data.externalTileSlotPoints_support group oldAction pairing unions powers separation infinite hG supported + have shape := (pair_mem_externalTileSlotSupports _ _ _ _ _ _ _ _ _ _).1 supported + have hj := shape.2.1 + have ownerFunction := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have depthCode : FunctionGraphOn V depths := + ⟨_, (data.externalStarDepth_ground_function group oldAction pairing unions powers separation infinite hG).2⟩ + have least := (pair_mem_leastSupportGraph _ _ _ _ _ _).1 owned + obtain ⟨a, _, ua, minimal⟩ := least.2.2.2 + have eqA := depthCode.unique ua ownerDepth + subst a + have before : d ≤ n := Nat.le_of_not_gt (fun less => minimal v shape.1 (natSetCode n) + (natSetCode_mem_omega n) support depth ((natSetCode_mem_iff n d).2 less)) + rw [equal] + apply (depthSlotIndex_le_iff hi ((natSetCode_mem_iff j 3).1 hj)).2 + rcases Nat.lt_or_eq_of_le before with less | same + · exact Or.inl less + · subst d + have tileOwned : ZFSet.pair x v ∈ owners := + (pair_mem_leastSupportGraph _ _ _ _ _ _).2 + ⟨((mem_ownerFresh P B x).1 hx).1, shape.1, support, + natSetCode n, natSetCode_mem_omega n, depth, minimal⟩ + have leastSlot := ((pair_mem_leastSlotOwnerGraph_of_owner ownerFunction tileOwned).1 slot).2.2 + have slotOrder := leastSlot.le ((natSetCode_mem_iff i 3).2 hi) hj supported + refine Or.inr ⟨rfl, ?_⟩ + rcases slotOrder with same | less + · exact (natSetCode_injective same).le + · exact ((natSetCode_mem_iff i j).1 less).le + +theorem externalSlotCopy_old_or_level_bound (hP0 : P0 ∈ M.sets) + {v x : ZFSet.{u}} {n j : Nat} + (supported : ZFSet.pair (ZFSet.pair v (natSetCode j)) x ∈ slotPoints) + (depth : ZFSet.pair v (natSetCode n) ∈ depths) : + x ∈ P ∨ ∃ k ≤ depthSlotIndex n j, ZFSet.pair x (natSetCode k) ∈ levels := by + by_cases old : x ∈ P + · exact Or.inl old + · have shape := (pair_mem_externalTileSlotSupports _ _ _ _ _ _ _ _ _ _).1 supported + have function := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + obtain ⟨k, level, _⟩ := function.2 x ((mem_ownerFresh P B x).2 ⟨shape.2.2.1, old⟩) + have hk := (ZFSet.pair_mem_prod.1 (function.1 level)).2 + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + exact Or.inr ⟨k, data.externalOwnerLevels_slot_bound group oldAction pairing unions powers separation infinite hG hP0 + supported depth level, level⟩ + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedAlignedReferenceCollisions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedAlignedReferenceCollisions.lean index 64713b433308d587c21d6fb47bee37dfb881be09..f85083a13fa93ccd554fa505762a97557d58c4a8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedAlignedReferenceCollisions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedAlignedReferenceCollisions.lean @@ -1,525 +1,525 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNicePreparationWitnessBounds -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementCollisionSymmetry -import OAI.SetTheory.PartitionPrinciple.Geometry.StructuralPreparationSourceImages - -namespace OAI - - -namespace PartitionPilot.Forcing.SynchronizedEnumerationCode -universe u - -theorem codomain_mono {omega N N' B f e names : ZFSet.{u}} - (code : SynchronizedEnumerationCode omega N B f e names) (subset : N ⊆ N') : - SynchronizedEnumerationCode omega N' B f e names := by - have widen {A graph : ZFSet.{u}} (function : ZFSet.IsFunc A N graph) : - ZFSet.IsFunc A N' graph := by - refine ⟨?_, function.2⟩ - intro z member - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - exact ZFSet.pair_mem_prod.2 ⟨hx, subset hy⟩ - exact ⟨widen code.1, code.2.1, widen code.2.2.1, code.2.2.2⟩ - -end PartitionPilot.Forcing.SynchronizedEnumerationCode - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) -variable (T : ZFSet.{u}) (K : I → Subgroup G) - -theorem preparedCertificateCode_of_selected - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (hT : T ∈ M.sets) (validT : ∀ tau ∈ T, IsName s tau) - (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) - (nodeOrder meet J : ZFSet.{u}) (validJ : ∀ tau ∈ J, IsName s tau) - (H : ConditionFilter P) (z : (M.nameDomain s).names) - (F B f e names : ZFSet.{u}) (p : P) - (selected : ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ - M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) - (filter : MeetFilterCode b.carrier nodeOrder meet F) (nonempty : B.Nonempty) - (profile : M.DecidesVisibilityProfile a s b K T F z.val p) - (equalities : ∀ v ∈ B, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T K → ZFSet.pair v tau.val ∈ f → - Name.ForcesEq p z.val tau) - (enumerated : SynchronizedEnumerationCode ZFSet.omega - (M.niceSupportNameCodes a s T K) B f e names) : - PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) b.carrier nodeOrder meet - (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T K) (s.encode ⊤) - ZFSet.omega z.val.val F B f e names := by - obtain ⟨_, _, _, _, _, nodes, basis, coinitial, function, supported⟩ := - M.supportedCertificateFamily_groundData a s b T K nodeOrder J validJ H - z.val.val F B f selected - have inside : M.niceSupportNameCodes a s T K ⊆ M.groundRelations T s.carrier := by - intro tau member - obtain ⟨ground, i, code⟩ := (M.mem_niceSupportNameCodes a s T K tau).1 member - exact M.niceNameCandidates_subset a s T (K i) - ((M.mem_niceNameCandidates a s T (K i) tau).2 ⟨ground, code⟩) - have range : f ⊆ ZFSet.prod b.carrier (M.groundRelations T s.carrier) := by - intro entry member - obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - exact ZFSet.pair_mem_prod.2 ⟨nodes (basis hv), inside htau⟩ - have valid : ∀ tau ∈ M.groundRelations T s.carrier, IsName s tau := by - intro tau member - exact Name.isName_of_subset validT ((M.mem_groundRelations T s.carrier tau).1 member).2 - refine ⟨filter, ⟨basis, coinitial⟩, nonempty, enumerated.codomain_mono inside, ?_, ?_⟩ - · intro v tau entry - have bounded := ZFSet.pair_mem_prod.1 (function.1 entry) - rw [M.visibilitySupportIncidence_eq_niceSupportRelation a s b T K] - exact supported v bounded.1 tau bounded.2 entry - · apply (M.preparationForcingCode_iff a s b K pairing unions powers separation collection - carrier order T (M.groundRelations T s.carrier) graphGround - (M.groundRelations_mem pairing unions powers separation hT carrier) valid z F f range p).2 - refine ⟨profile, ?_⟩ - intro v tau _ entry - have bounded := ZFSet.pair_mem_prod.1 (function.1 entry) - exact equalities v bounded.1 tau bounded.2 entry - - - - - -def TypedPreparedCertificate (nodeOrder meet omega : ZFSet.{u}) - (z : Name s) (p : P) (F B f e names : ZFSet.{u}) : Prop := - MeetFilterCode b.carrier nodeOrder meet F ∧ - CoinitialBelowCode nodeOrder F F B ∧ B.Nonempty ∧ - SynchronizedEnumerationCode omega (M.niceSupportNameCodes a s T K) B f e names ∧ - f ⊆ M.niceSupportRelation a s b T K ∧ - M.DecidesVisibilityProfile a s b K T F z p ∧ - ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z tau - -theorem preparedCertificateCode_typed - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (hT : T ∈ M.sets) (validT : ∀ tau ∈ T, IsName s tau) - (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) - (nodeOrder meet omega : ZFSet.{u}) (z : (M.nameDomain s).names) (p : P) - (F B f e names : ZFSet.{u}) - (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) - b.carrier nodeOrder meet (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T K) (s.encode ⊤) omega z.val.val F B f e names) : - M.TypedPreparedCertificate a s b T K nodeOrder meet omega z.val p F B f e names := by - obtain ⟨filter, basis, nonempty, sync, incidence, raw⟩ := code - have supported : f ⊆ M.niceSupportRelation a s b T K := by - intro entry member - obtain ⟨v, _, tau, _, rfl⟩ := ZFSet.mem_prod.1 (sync.1.1 member) - rw [← M.visibilitySupportIncidence_eq_niceSupportRelation a s b T K] - exact incidence v tau member - have niceRange : f ⊆ ZFSet.prod B (M.niceSupportNameCodes a s T K) := by - intro entry member - obtain ⟨v, hv, tau, _, rfl⟩ := ZFSet.mem_prod.1 (sync.1.1 member) - have nice := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 (supported member)).1 - exact ZFSet.pair_mem_prod.2 ⟨hv, nice.2⟩ - have namesRange : names ⊆ ZFSet.prod omega (M.niceSupportNameCodes a s T K) := by - intro entry member - obtain ⟨n, hn, tau, _, rfl⟩ := ZFSet.mem_prod.1 (sync.2.2.1.1 member) - obtain ⟨v, nv, _⟩ := sync.2.1.2 n hn - have vt := sync.2.2.2.2.1 n hn v tau nv member - exact ZFSet.pair_mem_prod.2 ⟨hn, (ZFSet.pair_mem_prod.1 (niceRange vt)).2⟩ - have narrowed : SynchronizedEnumerationCode omega - (M.niceSupportNameCodes a s T K) B f e names := - ⟨⟨niceRange, sync.1.2⟩, sync.2.1, ⟨namesRange, sync.2.2.1.2⟩, - sync.2.2.2.1, sync.2.2.2.2.1, sync.2.2.2.2.2⟩ - have range : f ⊆ ZFSet.prod b.carrier (M.groundRelations T s.carrier) := by - intro entry member - obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (sync.1.1 member) - exact ZFSet.pair_mem_prod.2 ⟨filter.subset (basis.1 hv), htau⟩ - have valid : ∀ tau ∈ M.groundRelations T s.carrier, IsName s tau := by - intro tau member - exact Name.isName_of_subset validT ((M.mem_groundRelations T s.carrier tau).1 member).2 - have forcing := (M.preparationForcingCode_iff a s b K pairing unions powers separation - collection carrier order T (M.groundRelations T s.carrier) graphGround - (M.groundRelations_mem pairing unions powers separation hT carrier) valid z F f range p).1 raw - refine ⟨filter, basis, nonempty, narrowed, supported, forcing.1, ?_⟩ - intro v _ tau _ entry - exact forcing.2 v tau (ZFSet.pair_mem_prod.1 (sync.1.1 entry)).2 entry - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -namespace PreparedCertificateFamilyCode - -theorem bounds_mono {M : TransitiveGround.{u}} - {P order q nodes nodeOrder meet N visibility top omega J C E C' E' k enumerations : ZFSet.{u}} - (code : PreparedCertificateFamilyCode M P order q nodes nodeOrder meet N visibility top omega J C E k enumerations) - (certificates : C ⊆ C') (enumerationBound : E ⊆ E') : - PreparedCertificateFamilyCode M P order q nodes nodeOrder meet N visibility top omega J C' E' k enumerations := by - have widen {A B B' f : ZFSet.{u}} (function : ZFSet.IsFunc A B f) (inside : B ⊆ B') : - ZFSet.IsFunc A B' f := by - refine ⟨?_, function.2⟩ - intro entry member - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - exact ZFSet.pair_mem_prod.2 ⟨hx, inside hy⟩ - exact ⟨widen code.1 certificates, widen code.2.1 enumerationBound, code.2.2⟩ - -end PreparedCertificateFamilyCode -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {I G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) -variable (T : ZFSet.{u}) (K : I → Subgroup G) - -theorem preparedCertificateFamilyCode_of_selected - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (hT : T ∈ M.sets) (validT : ∀ tau ∈ T, IsName s tau) - (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) - (nodeOrder meet J : ZFSet.{u}) (hJ : J ∈ M.sets) (validJ : ∀ tau ∈ J, IsName s tau) - (H : ConditionFilter P) (p : P) (k enumerations : ZFSet.{u}) - (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes a s T K)) k) - (selected : k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) - (enumerated : ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier - (M.niceSupportNameCodes a s T K)) enumerations) - (synchronized : ∀ j F B f e names, - ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → - SynchronizedEnumerationCode ZFSet.omega (M.niceSupportNameCodes a s T K) B f e names) - (certificates : ∀ (z : (M.nameDomain s).names) F B f, - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - MeetFilterCode b.carrier nodeOrder meet F ∧ B.Nonempty ∧ - M.DecidesVisibilityProfile a s b K T F z.val p ∧ - (∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z.val tau)) : - PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) b.carrier nodeOrder meet - (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T K) (s.encode ⊤) ZFSet.omega J - (M.supportedEqualityCertificateBound b.carrier (M.niceSupportNameCodes a s T K)) - (M.synchronizedEnumerationBound b.carrier (M.niceSupportNameCodes a s T K)) k enumerations := by - refine ⟨function, enumerated, ?_⟩ - intro j F B f e names stored enumEntry - have hj := (ZFSet.pair_mem_prod.1 (function.1 stored)).1 - let z : (M.nameDomain s).names := ⟨⟨j, validJ j hj⟩, M.transitive hJ hj⟩ - obtain ⟨filter, nonempty, profile, equalities⟩ := certificates z F B f stored - exact M.preparedCertificateCode_of_selected a s b T K pairing unions powers separation collection - carrier order hT validT graphGround nodeOrder meet J validJ H z F B f e names p - (selected stored) filter nonempty profile equalities (synchronized j F B f e names stored enumEntry) - -end TransitiveGround -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u - -private theorem anchor_of_dataBound {L : Type u} [PartialOrder L] - (b : Presentation L) (I level T S mu X tuples A : ZFSet.{u}) - (C E D : L) (U Rf Rc u w : ZFSet.{u}) - (bound : ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) u w) (b.encode D) ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples) : E ≤ D := by - obtain ⟨_, _, _, _, _, rawE, _, fu, _hfu, fw, _hfw, edge, lower, _rest⟩ := - (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples _ u w (b.encode D)).1 bound - have same : rawE = b.encode E := - ((refinementIndexFieldGraph_entry I b.carrier ![level, b.encode C, b.encode E, U, Rf, Rc] - 2 rawE).1 edge).2.2 - subst rawE - exact (b.pair_mem_conditionOrder E D).1 lower - -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (level T T2 : ZFSet.{u}) -variable (system : RefinementStageSystem M a s t b d base directed level T T2) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -include system pairing unions powers separation collection carrier order group nodes supports hLevel hT - -theorem structuralAssignment_aligned_reference - {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t)) ∈ history) - (I S mu positions tuples sourceA newA oldA : ZFSet.{u}) - (g h : G) (D X V C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 system.valid1) - (hu : u.val ∈ T) (hw : w.val ∈ T) - (source : stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val w.val ∈ sourceA) - (i newU newW oldU oldW : ZFSet.{u}) - (edge : ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val)) - (stageOneAssignment i newU newW) ∈ - M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history) - (newBound : ZFSet.pair (stageOneAssignment i newU newW) (b.encode (d.iso h D)) ∈ - stageOneDataBounds newA I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples) - (oldBound : ZFSet.pair (stageOneAssignment i oldU oldW) (b.encode X) ∈ - stageOneDataBounds oldA I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples) - (overlap : ∀ x : L, x ≤ d.iso h D → x ≤ X → x ≤ d.iso h V) - (relative : g⁻¹ * h ∈ d.principalFix V) - (contains : M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) sourceA ⊆ oldA) : - d.iso h E ≤ d.iso h V ∧ E ≤ V ∧ - i = refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val ∧ - i = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val ∧ - ZFSet.pair (ZFSet.pair (t.encode g) (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val)) - (stageOneAssignment i (a.act s g u).val (a.act s g w).val) ∈ - M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history ∧ - stageOneAssignment i (a.act s g u).val (a.act s g w).val ∈ oldA := by - let z := stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val - have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2 - have branchMember : z ∈ stageOneAssignments - (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by - rw [dataEq] - exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨index, hu, hw⟩ - have graphEq := M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers - separation collection carrier group nodes order system.inputs.condition_maps system.inputs.node_maps - supports level T T2 hLevel hT system.valid1 system.valid2 system.inputs.terms_closed - system.inputs.pairs_closed system.inputs.family_ground system.indices.index_ground - have branch := ((M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored - branchMember (t.encode h) (stageOneAssignment i newU newW)).1 edge).2 - rw [graphEq h] at branch - have moved := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 - system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier - order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground - h C E U Rf Rc u w index hu hw _).1 branch - obtain ⟨indexH, termU, termW⟩ := (stageOneAssignment_eq_iff _ _ _ _ _ _).1 moved - have hBelow := anchor_of_dataBound b I level T S mu positions tuples newA - (d.iso h C) (d.iso h E) (d.iso h D) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val - newU newW (indexH ▸ newBound) - have xBelow := anchor_of_dataBound b I level T S mu positions tuples oldA - (d.iso h C) (d.iso h E) X - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val - oldU oldW (indexH ▸ oldBound) - have overlapAnchor := overlap (d.iso h E) hBelow xBelow - have anchor : E ≤ V := (d.iso h).le_iff_le.mp overlapAnchor - obtain ⟨strict, domain, fine, coarse, _validity⟩ := - (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order level T T2 system.valid1 system.inputs.family_ground C E U Rf Rc).1 index - have nodeAgree (x : L) (below : x ≤ V) : d.iso h x = d.iso g x := by - have fixed := relative x below - calc - d.iso h x = d.iso g (d.iso (g⁻¹ * h) x) := by rw [← d.mul]; simp only [mul_inv_cancel_left] - _ = d.iso g x := congrArg (d.iso g) fixed - have atC : g⁻¹ * h ∈ d.principalFix C := d.principalFix_antitone (strict.le.trans anchor) relative - have nameAgree {K : ZFSet.{u}} (tau : Name s) - (candidate : tau.val ∈ M.niceNameCandidates a s K (d.principalFix C)) : - a.act s h tau = a.act s g tau := by - obtain ⟨_ground, sigma, equal, _subset, support⟩ := - (M.mem_niceNameCandidates a s K (d.principalFix C) tau.val).1 candidate - have same : sigma = tau := Subtype.ext equal - subst sigma - have fixed : a.act s (g⁻¹ * h) tau = tau := support atC - calc - a.act s h tau = a.act s g (a.act s (g⁻¹ * h) tau) := by - rw [← a.act_mul]; simp only [mul_inv_cancel_left] - _ = a.act s g tau := congrArg (a.act s g) fixed - have indexG : i = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by - rw [indexH, nodeAgree C (strict.le.trans anchor), nodeAgree E anchor, - nameAgree U.val domain, nameAgree Rf.val fine, nameAgree Rc.val coarse] - have referenceBranch := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 - system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier - order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground - g C E U Rf Rc u w index hu hw (stageOneAssignment i (a.act s g u).val (a.act s g w).val)).2 - (congrArg (fun idx => stageOneAssignment idx (a.act s g u).val (a.act s g w).val) indexG) - rw [← graphEq g] at referenceBranch - have referenceEdge := (M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored - branchMember (t.encode g) (stageOneAssignment i (a.act s g u).val (a.act s g w).val)).2 - ⟨t.encode_mem g, referenceBranch⟩ - exact ⟨overlapAnchor, anchor, indexH, indexG, referenceEdge, contains - ((M.structuralAssignmentImage_entry t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) sourceA _).2 - ⟨z, source, referenceEdge⟩)⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (level T T2 : ZFSet.{u}) -variable (system : RefinementStageSystem M a s t b d base directed level T T2) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -include system pairing unions powers separation collection carrier order group nodes supports hLevel hT - -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (M.codedFamily s) → - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -include descent in -theorem structuralAssignment_prepared_aligned_collision - (small : M.sets.Countable) - {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t)) ∈ history) - (I S mu positions tuples sourceA newA oldA : ZFSet.{u}) - (positionSupport : ∀ (D : L), ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu positions b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) - (g h : G) (D X V C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 system.valid1) - (hu : u.val.val ∈ T) (hw : w.val.val ∈ T) - (hOldU : oldU.val.val ∈ T) (hOldW : oldW.val.val ∈ T) - (p q : P) (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) - (relative : g⁻¹ * h ∈ d.principalFix V) - (overlap : meet (d.iso h D) X = d.iso h V) - (meetLeft : meet (d.iso h D) X ≤ d.iso h D) - (meetRight : meet (d.iso h D) X ≤ X) - (meetGreatest : ∀ z : L, z ≤ d.iso h D → z ≤ X → z ≤ meet (d.iso h D) X) - (F B f e names : Fin 2 → ZFSet.{u}) : - let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier system.inputs.condition_maps - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 - let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let movedIdx := refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val - stageOneAssignment idx u.val.val w.val.val ∈ sourceA → - ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment idx u.val.val w.val.val)) - (stageOneAssignment movedIdx (moved h u).val.val (moved h w).val.val) ∈ - M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history → - ZFSet.pair (stageOneAssignment movedIdx (moved h u).val.val (moved h w).val.val) - (b.encode (d.iso h D)) ∈ stageOneDataBounds newA I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples → - ZFSet.pair (stageOneAssignment movedIdx oldU.val.val oldW.val.val) (b.encode X) ∈ - stageOneDataBounds oldA I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples → - M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) sourceA ⊆ oldA → - stageOneRawTests M fields sourceA (s.encode p) → stageOneRawTests M fields oldA (s.encode q) → - (∀ i : Fin 2, PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) - b.carrier b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) - (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) - ZFSet.omega ((![cls Rc u, cls Rf w] : Fin 2 → (M.nameDomain s).names) i).val.val - (F i) (B i) (f i) (e i) (names i)) → - stageOneRawCollision M fields movedIdx (moved h u).val.val oldU.val.val - (moved h w).val.val oldW.val.val (s.encode q) ∧ - stageOneRawCollision M fields movedIdx oldU.val.val (moved h u).val.val - oldW.val.val (moved h w).val.val (s.encode q) := by - let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier system.inputs.condition_maps - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 - let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let movedIdx := refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val - dsimp only - intro source edge newBound oldBound contains sourceTests oldTests certificates - have aligned := M.structuralAssignment_aligned_reference a s t b d base directed level T T2 system - pairing unions powers separation collection carrier order group nodes supports hLevel hT function stored - I S mu positions tuples sourceA newA oldA g h D X V C E U Rf Rc u.val w.val index hu hw source - movedIdx (moved h u).val.val (moved h w).val.val oldU.val.val oldW.val.val edge newBound oldBound - (fun z hz hx => overlap ▸ meetGreatest z hz hx) relative contains - have anchor : d.iso h E ≤ meet (d.iso h D) X := overlap.symm ▸ aligned.1 - have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order system.inputs.condition_maps level T T2 system.valid1 system.inputs.terms_closed - system.inputs.pairs_closed system.inputs.family_ground h C E U Rf Rc).2 index - have oldMember : stageOneAssignment movedIdx oldU.val.val oldW.val.val ∈ oldA := - (stageOneDataBounds_assignment_entry oldA I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples movedIdx oldU.val.val oldW.val.val (b.encode X)).1 oldBound |>.1 - have referenceRaw := oldTests.2 movedIdx movedMember - (moved g u).val.val (system.inputs.terms_closed g u.val hu) oldU.val.val hOldU - (moved g w).val.val (system.inputs.terms_closed g w.val hw) oldW.val.val hOldW - aligned.2.2.2.2.2 oldMember - have reference := (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT system.valid1 system.indices (d.iso h C) (d.iso h E) - (moved h U) (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW movedMember q).1 referenceRaw - have single := (M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection - carrier order nodes hT system.valid1 system.indices base directed system.first C E U Rf Rc u w index p).1 - (sourceTests.1 idx index u.val.val hu w.val.val hw source) - have positionsOfBound (A : ZFSet.{u}) (Z : L) (v v' : Name s) - (bound : ZFSet.pair (stageOneAssignment movedIdx v.val v'.val) (b.encode Z) ∈ - stageOneDataBounds A I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples) : - d.principalFix Z ≤ a.stabilizer s v ∧ d.principalFix Z ≤ a.stabilizer s v' := by - obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, _anchor, _below, tu, tw, bu, bw⟩ := - (stageOneDataBounds_assignment_entry A I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples movedIdx v.val v'.val (b.encode Z)).1 bound - exact ⟨positionSupport Z fu hfu v tu bu, positionSupport Z fw hfw v' tw bw⟩ - have newPositions := positionsOfBound newA (d.iso h D) (moved h u).val (moved h w).val newBound - have oldPositions := positionsOfBound oldA X oldU.val oldW.val oldBound - have recognized (i : Fin 2) := M.preparedCertificateCode_typed a s b T d.principalFix pairing unions powers - separation collection carrier order hT system.valid1 system.first.visibility_graph_ground - b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) ZFSet.omega - ((![cls Rc u, cls Rf w] : Fin 2 → (M.nameDomain s).names) i) p - (F i) (B i) (f i) (e i) (names i) (certificates i) - have collision := M.prepared_joint_refinementCollision_of_position_supports a s t b d - pairing unions powers separation collection carrier order group nodes supports system.inputs.condition_maps - hT system.valid1 system.inputs.terms_closed base directed system.first meet descent - system.valid2 system.inputs.pairs_closed level system.indices small system.terms_hs - C E U Rf Rc u w oldU oldW index F B f p q g h V (d.iso h D) X relative qh qg overlap anchor - meetLeft meetRight - (fun i => (recognized i).1.subset) (fun i => (recognized i).2.1.1) - (fun i => (recognized i).2.1.2) (fun i => (recognized i).2.2.2.1.1) - (fun i => (recognized i).2.2.2.2.1) (fun i => (recognized i).2.2.2.2.2.1) - (fun i => (recognized i).2.2.2.2.2.2) - (Fin.cases newPositions.1 (Fin.cases newPositions.2 (fun j => Fin.elim0 j))) - (Fin.cases oldPositions.1 (Fin.cases oldPositions.2 (fun j => Fin.elim0 j))) single reference - exact M.refinementLevelRawCollision_both_orders s pairing unions powers separation collection carrier order - hT system.valid1 a b d level T2 system.indices (d.iso h C) (d.iso h E) - (moved h U) (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW movedMember q collision.1 - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNicePreparationWitnessBounds +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementCollisionSymmetry +import OAI.SetTheory.PartitionPrinciple.Geometry.StructuralPreparationSourceImages + +namespace OAI + + +namespace PartitionPilot.Forcing.SynchronizedEnumerationCode +universe u + +theorem codomain_mono {omega N N' B f e names : ZFSet.{u}} + (code : SynchronizedEnumerationCode omega N B f e names) (subset : N ⊆ N') : + SynchronizedEnumerationCode omega N' B f e names := by + have widen {A graph : ZFSet.{u}} (function : ZFSet.IsFunc A N graph) : + ZFSet.IsFunc A N' graph := by + refine ⟨?_, function.2⟩ + intro z member + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + exact ZFSet.pair_mem_prod.2 ⟨hx, subset hy⟩ + exact ⟨widen code.1, code.2.1, widen code.2.2.1, code.2.2.2⟩ + +end PartitionPilot.Forcing.SynchronizedEnumerationCode + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) +variable (T : ZFSet.{u}) (K : I → Subgroup G) + +theorem preparedCertificateCode_of_selected + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (hT : T ∈ M.sets) (validT : ∀ tau ∈ T, IsName s tau) + (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) + (nodeOrder meet J : ZFSet.{u}) (validJ : ∀ tau ∈ J, IsName s tau) + (H : ConditionFilter P) (z : (M.nameDomain s).names) + (F B f e names : ZFSet.{u}) (p : P) + (selected : ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ + M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) + (filter : MeetFilterCode b.carrier nodeOrder meet F) (nonempty : B.Nonempty) + (profile : M.DecidesVisibilityProfile a s b K T F z.val p) + (equalities : ∀ v ∈ B, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T K → ZFSet.pair v tau.val ∈ f → + Name.ForcesEq p z.val tau) + (enumerated : SynchronizedEnumerationCode ZFSet.omega + (M.niceSupportNameCodes a s T K) B f e names) : + PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) b.carrier nodeOrder meet + (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T K) (s.encode ⊤) + ZFSet.omega z.val.val F B f e names := by + obtain ⟨_, _, _, _, _, nodes, basis, coinitial, function, supported⟩ := + M.supportedCertificateFamily_groundData a s b T K nodeOrder J validJ H + z.val.val F B f selected + have inside : M.niceSupportNameCodes a s T K ⊆ M.groundRelations T s.carrier := by + intro tau member + obtain ⟨ground, i, code⟩ := (M.mem_niceSupportNameCodes a s T K tau).1 member + exact M.niceNameCandidates_subset a s T (K i) + ((M.mem_niceNameCandidates a s T (K i) tau).2 ⟨ground, code⟩) + have range : f ⊆ ZFSet.prod b.carrier (M.groundRelations T s.carrier) := by + intro entry member + obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + exact ZFSet.pair_mem_prod.2 ⟨nodes (basis hv), inside htau⟩ + have valid : ∀ tau ∈ M.groundRelations T s.carrier, IsName s tau := by + intro tau member + exact Name.isName_of_subset validT ((M.mem_groundRelations T s.carrier tau).1 member).2 + refine ⟨filter, ⟨basis, coinitial⟩, nonempty, enumerated.codomain_mono inside, ?_, ?_⟩ + · intro v tau entry + have bounded := ZFSet.pair_mem_prod.1 (function.1 entry) + rw [M.visibilitySupportIncidence_eq_niceSupportRelation a s b T K] + exact supported v bounded.1 tau bounded.2 entry + · apply (M.preparationForcingCode_iff a s b K pairing unions powers separation collection + carrier order T (M.groundRelations T s.carrier) graphGround + (M.groundRelations_mem pairing unions powers separation hT carrier) valid z F f range p).2 + refine ⟨profile, ?_⟩ + intro v tau _ entry + have bounded := ZFSet.pair_mem_prod.1 (function.1 entry) + exact equalities v bounded.1 tau bounded.2 entry + + + + + +def TypedPreparedCertificate (nodeOrder meet omega : ZFSet.{u}) + (z : Name s) (p : P) (F B f e names : ZFSet.{u}) : Prop := + MeetFilterCode b.carrier nodeOrder meet F ∧ + CoinitialBelowCode nodeOrder F F B ∧ B.Nonempty ∧ + SynchronizedEnumerationCode omega (M.niceSupportNameCodes a s T K) B f e names ∧ + f ⊆ M.niceSupportRelation a s b T K ∧ + M.DecidesVisibilityProfile a s b K T F z p ∧ + ∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z tau + +theorem preparedCertificateCode_typed + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (hT : T ∈ M.sets) (validT : ∀ tau ∈ T, IsName s tau) + (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) + (nodeOrder meet omega : ZFSet.{u}) (z : (M.nameDomain s).names) (p : P) + (F B f e names : ZFSet.{u}) + (code : PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) + b.carrier nodeOrder meet (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T K) (s.encode ⊤) omega z.val.val F B f e names) : + M.TypedPreparedCertificate a s b T K nodeOrder meet omega z.val p F B f e names := by + obtain ⟨filter, basis, nonempty, sync, incidence, raw⟩ := code + have supported : f ⊆ M.niceSupportRelation a s b T K := by + intro entry member + obtain ⟨v, _, tau, _, rfl⟩ := ZFSet.mem_prod.1 (sync.1.1 member) + rw [← M.visibilitySupportIncidence_eq_niceSupportRelation a s b T K] + exact incidence v tau member + have niceRange : f ⊆ ZFSet.prod B (M.niceSupportNameCodes a s T K) := by + intro entry member + obtain ⟨v, hv, tau, _, rfl⟩ := ZFSet.mem_prod.1 (sync.1.1 member) + have nice := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 (supported member)).1 + exact ZFSet.pair_mem_prod.2 ⟨hv, nice.2⟩ + have namesRange : names ⊆ ZFSet.prod omega (M.niceSupportNameCodes a s T K) := by + intro entry member + obtain ⟨n, hn, tau, _, rfl⟩ := ZFSet.mem_prod.1 (sync.2.2.1.1 member) + obtain ⟨v, nv, _⟩ := sync.2.1.2 n hn + have vt := sync.2.2.2.2.1 n hn v tau nv member + exact ZFSet.pair_mem_prod.2 ⟨hn, (ZFSet.pair_mem_prod.1 (niceRange vt)).2⟩ + have narrowed : SynchronizedEnumerationCode omega + (M.niceSupportNameCodes a s T K) B f e names := + ⟨⟨niceRange, sync.1.2⟩, sync.2.1, ⟨namesRange, sync.2.2.1.2⟩, + sync.2.2.2.1, sync.2.2.2.2.1, sync.2.2.2.2.2⟩ + have range : f ⊆ ZFSet.prod b.carrier (M.groundRelations T s.carrier) := by + intro entry member + obtain ⟨v, hv, tau, htau, rfl⟩ := ZFSet.mem_prod.1 (sync.1.1 member) + exact ZFSet.pair_mem_prod.2 ⟨filter.subset (basis.1 hv), htau⟩ + have valid : ∀ tau ∈ M.groundRelations T s.carrier, IsName s tau := by + intro tau member + exact Name.isName_of_subset validT ((M.mem_groundRelations T s.carrier tau).1 member).2 + have forcing := (M.preparationForcingCode_iff a s b K pairing unions powers separation + collection carrier order T (M.groundRelations T s.carrier) graphGround + (M.groundRelations_mem pairing unions powers separation hT carrier) valid z F f range p).1 raw + refine ⟨filter, basis, nonempty, narrowed, supported, forcing.1, ?_⟩ + intro v _ tau _ entry + exact forcing.2 v tau (ZFSet.pair_mem_prod.1 (sync.1.1 entry)).2 entry + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +namespace PreparedCertificateFamilyCode + +theorem bounds_mono {M : TransitiveGround.{u}} + {P order q nodes nodeOrder meet N visibility top omega J C E C' E' k enumerations : ZFSet.{u}} + (code : PreparedCertificateFamilyCode M P order q nodes nodeOrder meet N visibility top omega J C E k enumerations) + (certificates : C ⊆ C') (enumerationBound : E ⊆ E') : + PreparedCertificateFamilyCode M P order q nodes nodeOrder meet N visibility top omega J C' E' k enumerations := by + have widen {A B B' f : ZFSet.{u}} (function : ZFSet.IsFunc A B f) (inside : B ⊆ B') : + ZFSet.IsFunc A B' f := by + refine ⟨?_, function.2⟩ + intro entry member + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + exact ZFSet.pair_mem_prod.2 ⟨hx, inside hy⟩ + exact ⟨widen code.1 certificates, widen code.2.1 enumerationBound, code.2.2⟩ + +end PreparedCertificateFamilyCode +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {I G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) +variable (T : ZFSet.{u}) (K : I → Subgroup G) + +theorem preparedCertificateFamilyCode_of_selected + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (hT : T ∈ M.sets) (validT : ∀ tau ∈ T, IsName s tau) + (graphGround : M.niceVisibilityGraph a s b T K ∈ M.sets) + (nodeOrder meet J : ZFSet.{u}) (hJ : J ∈ M.sets) (validJ : ∀ tau ∈ J, IsName s tau) + (H : ConditionFilter P) (p : P) (k enumerations : ZFSet.{u}) + (function : ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes a s T K)) k) + (selected : k ⊆ M.supportedCertificateFamilyRelation a s b T K nodeOrder J validJ H) + (enumerated : ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier + (M.niceSupportNameCodes a s T K)) enumerations) + (synchronized : ∀ j F B f e names, + ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → + SynchronizedEnumerationCode ZFSet.omega (M.niceSupportNameCodes a s T K) B f e names) + (certificates : ∀ (z : (M.nameDomain s).names) F B f, + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + MeetFilterCode b.carrier nodeOrder meet F ∧ B.Nonempty ∧ + M.DecidesVisibilityProfile a s b K T F z.val p ∧ + (∀ v ∈ B, ∀ tau : Name s, tau.val ∈ M.niceSupportNameCodes a s T K → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z.val tau)) : + PreparedCertificateFamilyCode M s.carrier s.conditionOrder (s.encode p) b.carrier nodeOrder meet + (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T K) (s.encode ⊤) ZFSet.omega J + (M.supportedEqualityCertificateBound b.carrier (M.niceSupportNameCodes a s T K)) + (M.synchronizedEnumerationBound b.carrier (M.niceSupportNameCodes a s T K)) k enumerations := by + refine ⟨function, enumerated, ?_⟩ + intro j F B f e names stored enumEntry + have hj := (ZFSet.pair_mem_prod.1 (function.1 stored)).1 + let z : (M.nameDomain s).names := ⟨⟨j, validJ j hj⟩, M.transitive hJ hj⟩ + obtain ⟨filter, nonempty, profile, equalities⟩ := certificates z F B f stored + exact M.preparedCertificateCode_of_selected a s b T K pairing unions powers separation collection + carrier order hT validT graphGround nodeOrder meet J validJ H z F B f e names p + (selected stored) filter nonempty profile equalities (synchronized j F B f e names stored enumEntry) + +end TransitiveGround +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u + +private theorem anchor_of_dataBound {L : Type u} [PartialOrder L] + (b : Presentation L) (I level T S mu X tuples A : ZFSet.{u}) + (C E D : L) (U Rf Rc u w : ZFSet.{u}) + (bound : ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) u w) (b.encode D) ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples) : E ≤ D := by + obtain ⟨_, _, _, _, _, rawE, _, fu, _hfu, fw, _hfw, edge, lower, _rest⟩ := + (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples _ u w (b.encode D)).1 bound + have same : rawE = b.encode E := + ((refinementIndexFieldGraph_entry I b.carrier ![level, b.encode C, b.encode E, U, Rf, Rc] + 2 rawE).1 edge).2.2 + subst rawE + exact (b.pair_mem_conditionOrder E D).1 lower + +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (level T T2 : ZFSet.{u}) +variable (system : RefinementStageSystem M a s t b d base directed level T T2) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +include system pairing unions powers separation collection carrier order group nodes supports hLevel hT + +theorem structuralAssignment_aligned_reference + {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t)) ∈ history) + (I S mu positions tuples sourceA newA oldA : ZFSet.{u}) + (g h : G) (D X V C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 system.valid1) + (hu : u.val ∈ T) (hw : w.val ∈ T) + (source : stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val w.val ∈ sourceA) + (i newU newW oldU oldW : ZFSet.{u}) + (edge : ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val)) + (stageOneAssignment i newU newW) ∈ + M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history) + (newBound : ZFSet.pair (stageOneAssignment i newU newW) (b.encode (d.iso h D)) ∈ + stageOneDataBounds newA I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples) + (oldBound : ZFSet.pair (stageOneAssignment i oldU oldW) (b.encode X) ∈ + stageOneDataBounds oldA I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples) + (overlap : ∀ x : L, x ≤ d.iso h D → x ≤ X → x ≤ d.iso h V) + (relative : g⁻¹ * h ∈ d.principalFix V) + (contains : M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) sourceA ⊆ oldA) : + d.iso h E ≤ d.iso h V ∧ E ≤ V ∧ + i = refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val ∧ + i = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val ∧ + ZFSet.pair (ZFSet.pair (t.encode g) (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val)) + (stageOneAssignment i (a.act s g u).val (a.act s g w).val) ∈ + M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history ∧ + stageOneAssignment i (a.act s g u).val (a.act s g w).val ∈ oldA := by + let z := stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val + have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2 + have branchMember : z ∈ stageOneAssignments + (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by + rw [dataEq] + exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨index, hu, hw⟩ + have graphEq := M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers + separation collection carrier group nodes order system.inputs.condition_maps system.inputs.node_maps + supports level T T2 hLevel hT system.valid1 system.valid2 system.inputs.terms_closed + system.inputs.pairs_closed system.inputs.family_ground system.indices.index_ground + have branch := ((M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored + branchMember (t.encode h) (stageOneAssignment i newU newW)).1 edge).2 + rw [graphEq h] at branch + have moved := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 + system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier + order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground + h C E U Rf Rc u w index hu hw _).1 branch + obtain ⟨indexH, termU, termW⟩ := (stageOneAssignment_eq_iff _ _ _ _ _ _).1 moved + have hBelow := anchor_of_dataBound b I level T S mu positions tuples newA + (d.iso h C) (d.iso h E) (d.iso h D) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val + newU newW (indexH ▸ newBound) + have xBelow := anchor_of_dataBound b I level T S mu positions tuples oldA + (d.iso h C) (d.iso h E) X + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val + oldU oldW (indexH ▸ oldBound) + have overlapAnchor := overlap (d.iso h E) hBelow xBelow + have anchor : E ≤ V := (d.iso h).le_iff_le.mp overlapAnchor + obtain ⟨strict, domain, fine, coarse, _validity⟩ := + (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order level T T2 system.valid1 system.inputs.family_ground C E U Rf Rc).1 index + have nodeAgree (x : L) (below : x ≤ V) : d.iso h x = d.iso g x := by + have fixed := relative x below + calc + d.iso h x = d.iso g (d.iso (g⁻¹ * h) x) := by rw [← d.mul]; simp only [mul_inv_cancel_left] + _ = d.iso g x := congrArg (d.iso g) fixed + have atC : g⁻¹ * h ∈ d.principalFix C := d.principalFix_antitone (strict.le.trans anchor) relative + have nameAgree {K : ZFSet.{u}} (tau : Name s) + (candidate : tau.val ∈ M.niceNameCandidates a s K (d.principalFix C)) : + a.act s h tau = a.act s g tau := by + obtain ⟨_ground, sigma, equal, _subset, support⟩ := + (M.mem_niceNameCandidates a s K (d.principalFix C) tau.val).1 candidate + have same : sigma = tau := Subtype.ext equal + subst sigma + have fixed : a.act s (g⁻¹ * h) tau = tau := support atC + calc + a.act s h tau = a.act s g (a.act s (g⁻¹ * h) tau) := by + rw [← a.act_mul]; simp only [mul_inv_cancel_left] + _ = a.act s g tau := congrArg (a.act s g) fixed + have indexG : i = refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by + rw [indexH, nodeAgree C (strict.le.trans anchor), nodeAgree E anchor, + nameAgree U.val domain, nameAgree Rf.val fine, nameAgree Rc.val coarse] + have referenceBranch := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 + system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier + order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground + g C E U Rf Rc u w index hu hw (stageOneAssignment i (a.act s g u).val (a.act s g w).val)).2 + (congrArg (fun idx => stageOneAssignment idx (a.act s g u).val (a.act s g w).val) indexG) + rw [← graphEq g] at referenceBranch + have referenceEdge := (M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored + branchMember (t.encode g) (stageOneAssignment i (a.act s g u).val (a.act s g w).val)).2 + ⟨t.encode_mem g, referenceBranch⟩ + exact ⟨overlapAnchor, anchor, indexH, indexG, referenceEdge, contains + ((M.structuralAssignmentImage_entry t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) sourceA _).2 + ⟨z, source, referenceEdge⟩)⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (level T T2 : ZFSet.{u}) +variable (system : RefinementStageSystem M a s t b d base directed level T T2) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +include system pairing unions powers separation collection carrier order group nodes supports hLevel hT + +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (M.codedFamily s) → + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +include descent in +theorem structuralAssignment_prepared_aligned_collision + (small : M.sets.Countable) + {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t)) ∈ history) + (I S mu positions tuples sourceA newA oldA : ZFSet.{u}) + (positionSupport : ∀ (D : L), ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu positions b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) + (g h : G) (D X V C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 system.valid1) + (hu : u.val.val ∈ T) (hw : w.val.val ∈ T) + (hOldU : oldU.val.val ∈ T) (hOldW : oldW.val.val ∈ T) + (p q : P) (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) + (relative : g⁻¹ * h ∈ d.principalFix V) + (overlap : meet (d.iso h D) X = d.iso h V) + (meetLeft : meet (d.iso h D) X ≤ d.iso h D) + (meetRight : meet (d.iso h D) X ≤ X) + (meetGreatest : ∀ z : L, z ≤ d.iso h D → z ≤ X → z ≤ meet (d.iso h D) X) + (F B f e names : Fin 2 → ZFSet.{u}) : + let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier system.inputs.condition_maps + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 + let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let movedIdx := refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val + stageOneAssignment idx u.val.val w.val.val ∈ sourceA → + ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment idx u.val.val w.val.val)) + (stageOneAssignment movedIdx (moved h u).val.val (moved h w).val.val) ∈ + M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history → + ZFSet.pair (stageOneAssignment movedIdx (moved h u).val.val (moved h w).val.val) + (b.encode (d.iso h D)) ∈ stageOneDataBounds newA I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples → + ZFSet.pair (stageOneAssignment movedIdx oldU.val.val oldW.val.val) (b.encode X) ∈ + stageOneDataBounds oldA I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples → + M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode g) sourceA ⊆ oldA → + stageOneRawTests M fields sourceA (s.encode p) → stageOneRawTests M fields oldA (s.encode q) → + (∀ i : Fin 2, PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) + b.carrier b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) + (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) + ZFSet.omega ((![cls Rc u, cls Rf w] : Fin 2 → (M.nameDomain s).names) i).val.val + (F i) (B i) (f i) (e i) (names i)) → + stageOneRawCollision M fields movedIdx (moved h u).val.val oldU.val.val + (moved h w).val.val oldW.val.val (s.encode q) ∧ + stageOneRawCollision M fields movedIdx oldU.val.val (moved h u).val.val + oldW.val.val (moved h w).val.val (s.encode q) := by + let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier system.inputs.condition_maps + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 + let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let movedIdx := refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val + dsimp only + intro source edge newBound oldBound contains sourceTests oldTests certificates + have aligned := M.structuralAssignment_aligned_reference a s t b d base directed level T T2 system + pairing unions powers separation collection carrier order group nodes supports hLevel hT function stored + I S mu positions tuples sourceA newA oldA g h D X V C E U Rf Rc u.val w.val index hu hw source + movedIdx (moved h u).val.val (moved h w).val.val oldU.val.val oldW.val.val edge newBound oldBound + (fun z hz hx => overlap ▸ meetGreatest z hz hx) relative contains + have anchor : d.iso h E ≤ meet (d.iso h D) X := overlap.symm ▸ aligned.1 + have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order system.inputs.condition_maps level T T2 system.valid1 system.inputs.terms_closed + system.inputs.pairs_closed system.inputs.family_ground h C E U Rf Rc).2 index + have oldMember : stageOneAssignment movedIdx oldU.val.val oldW.val.val ∈ oldA := + (stageOneDataBounds_assignment_entry oldA I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples movedIdx oldU.val.val oldW.val.val (b.encode X)).1 oldBound |>.1 + have referenceRaw := oldTests.2 movedIdx movedMember + (moved g u).val.val (system.inputs.terms_closed g u.val hu) oldU.val.val hOldU + (moved g w).val.val (system.inputs.terms_closed g w.val hw) oldW.val.val hOldW + aligned.2.2.2.2.2 oldMember + have reference := (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT system.valid1 system.indices (d.iso h C) (d.iso h E) + (moved h U) (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW movedMember q).1 referenceRaw + have single := (M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection + carrier order nodes hT system.valid1 system.indices base directed system.first C E U Rf Rc u w index p).1 + (sourceTests.1 idx index u.val.val hu w.val.val hw source) + have positionsOfBound (A : ZFSet.{u}) (Z : L) (v v' : Name s) + (bound : ZFSet.pair (stageOneAssignment movedIdx v.val v'.val) (b.encode Z) ∈ + stageOneDataBounds A I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples) : + d.principalFix Z ≤ a.stabilizer s v ∧ d.principalFix Z ≤ a.stabilizer s v' := by + obtain ⟨_, _, _, _, _, rawE, _, fu, hfu, fw, hfw, _anchor, _below, tu, tw, bu, bw⟩ := + (stageOneDataBounds_assignment_entry A I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples movedIdx v.val v'.val (b.encode Z)).1 bound + exact ⟨positionSupport Z fu hfu v tu bu, positionSupport Z fw hfw v' tw bw⟩ + have newPositions := positionsOfBound newA (d.iso h D) (moved h u).val (moved h w).val newBound + have oldPositions := positionsOfBound oldA X oldU.val oldW.val oldBound + have recognized (i : Fin 2) := M.preparedCertificateCode_typed a s b T d.principalFix pairing unions powers + separation collection carrier order hT system.valid1 system.first.visibility_graph_ground + b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) ZFSet.omega + ((![cls Rc u, cls Rf w] : Fin 2 → (M.nameDomain s).names) i) p + (F i) (B i) (f i) (e i) (names i) (certificates i) + have collision := M.prepared_joint_refinementCollision_of_position_supports a s t b d + pairing unions powers separation collection carrier order group nodes supports system.inputs.condition_maps + hT system.valid1 system.inputs.terms_closed base directed system.first meet descent + system.valid2 system.inputs.pairs_closed level system.indices small system.terms_hs + C E U Rf Rc u w oldU oldW index F B f p q g h V (d.iso h D) X relative qh qg overlap anchor + meetLeft meetRight + (fun i => (recognized i).1.subset) (fun i => (recognized i).2.1.1) + (fun i => (recognized i).2.1.2) (fun i => (recognized i).2.2.2.1.1) + (fun i => (recognized i).2.2.2.2.1) (fun i => (recognized i).2.2.2.2.2.1) + (fun i => (recognized i).2.2.2.2.2.2) + (Fin.cases newPositions.1 (Fin.cases newPositions.2 (fun j => Fin.elim0 j))) + (Fin.cases oldPositions.1 (Fin.cases oldPositions.2 (fun j => Fin.elim0 j))) single reference + exact M.refinementLevelRawCollision_both_orders s pairing unions powers separation collection carrier order + hT system.valid1 a b d level T2 system.indices (d.iso h C) (d.iso h E) + (moved h U) (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW movedMember q collision.1 + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedMixedCollisions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedMixedCollisions.lean index 331c0bd554a0fe7979e58fc4ae85f9960413a094..dac460944d136ba842d72cacddbe314c1f46d6cf 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedMixedCollisions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedMixedCollisions.lean @@ -1,417 +1,417 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceRefinementIndexActionLaws -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparedCertificateActionPackages - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) -variable (d : PosetAction G L) (base : L) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (H : ConditionFilter P) -variable (generic : H.GenericFor (formulaFamily (M.nameDomain s))) -variable (meet : L → L → L) -variable (descent : ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - -include system generic descent in -theorem common_value_visible (A B : L) (x y : (M.nameDomain s).names) - (sx : d.principalFix A ≤ a.stabilizer s x.val) - (sy : d.principalFix B ≤ a.stabilizer s y.val) - (hx : HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val) - (hy : HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val) - (subset : Name.eval {p | H.mem p} x.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (values : Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val) : - Name.eval {p | H.mem p} x.val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B))) := by - obtain ⟨τ, _, support, equal⟩ := descent A B x y sx sy hx hy values - have bounded : Name.eval {p | H.mem p} τ.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := equal.symm ▸ subset - exact equal ▸ system.normalization_visible (meet A B) τ support H generic bounded - -include generic descent in -theorem mixed_collision_visible_both (A B : L) - (x y : Fin 2 → (M.nameDomain s).names) - (sx : ∀ i, d.principalFix A ≤ a.stabilizer s (x i).val) - (sy : ∀ i, d.principalFix B ≤ a.stabilizer s (y i).val) - (hx : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (x i).val) - (hy : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (y i).val) - (subset : ∀ i, Name.eval {p | H.mem p} (x i).val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (q : P) (hq : H.mem q) - (profile : Forces (M.nameDomain s) refinementProfileFormula - ![x 0, x 1, M.stageOneVisibilityName s valid a b d base directed system (meet A B)] q) - (collision : Name.eval {p | H.mem p} (x 0).val = Name.eval {p | H.mem p} (y 0).val ∨ - Name.eval {p | H.mem p} (x 1).val = Name.eval {p | H.mem p} (y 1).val) : - ∀ i, Name.eval {p | H.mem p} (x i).val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B))) := by - let env : Assignment (M.nameDomain s) 3 := - ![x 0, x 1, M.stageOneVisibilityName s valid a b d base directed system (meet A B)] - let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, - (M.nameDomain s).values_transitive _⟩ - have realized := forces_sound (M.nameDomain s) H generic refinementProfileFormula env hq profile - have paired := (N.realize_refinementProfileFormula (evalAssignment {p | H.mem p} env) - (fun i => ⟨env i, rfl⟩)).1 realized - change (Name.eval {p | H.mem p} (x 0).val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B)))) ↔ - (Name.eval {p | H.mem p} (x 1).val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B)))) at paired - have one (i : Fin 2) - (equal : Name.eval {p | H.mem p} (x i).val = Name.eval {p | H.mem p} (y i).val) := - M.common_value_visible a s b d base directed T valid system H generic meet descent - A B (x i) (y i) (sx i) (sy i) (hx i) (hy i) (subset i) equal - rcases collision with left | right - · have first := one 0 left - exact Fin.cases first (Fin.cases (paired.1 first) (fun i => Fin.elim0 i)) - · have second := one 1 right - exact Fin.cases (paired.2 second) (Fin.cases second (fun i => Fin.elim0 i)) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -include pairing unions powers separation collection carrier group nodes supports maps hT valid closed - -theorem preparedValue_eval_agreement (F B f : ZFSet.{u}) - (z : (M.nameDomain s).names) (p q : P) - (profile : F ⊆ b.carrier) (basis : B ⊆ F) - (coinitial : ∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ b.conditionOrder) - (function : ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f) - (supported : f ⊆ M.niceSupportRelation a s b T d.principalFix) - (decisions : M.DecidesVisibilityProfile a s b d.principalFix T F z.val p) - (equalities : ∀ v ∈ B, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z.val tau) - (g h : G) (V : L) (relative : g⁻¹ * h ∈ d.principalFix V) - (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (hq : H.mem q) - (visible : Name.eval {r | H.mem r} (a.act s h z.val) ∈ - Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso h V)))) : - Name.eval {r | H.mem r} (a.act s h z.val) = - Name.eval {r | H.mem r} (a.act s g z.val) := by - have moved := M.decidesVisibilityProfile_act a s t b d pairing unions powers separation - collection carrier maps closed F z.val p h decisions - have hz := M.act_mem s a t pairing unions powers separation collection carrier maps h z.val z.property - have hVisibility := M.niceVisibilityName_mem a s t b d.principalFix pairing unions powers - separation collection carrier group supports maps hT valid (d.iso h V) - (M.transitive nodes (b.encode_mem _)) - have member : b.encode V ∈ F := by - by_contra absent - have absentImage : b.encode (d.iso h V) ∉ - relationImage F b.carrier (b.graph b (d.iso h)) := - fun yes => absent ((visibilityProfileImage_entry b d F h V).1 yes) - let traveled : (M.nameDomain s).names := ⟨a.act s h z.val, hz⟩ - let vis : (M.nameDomain s).names := ⟨M.niceVisibilityName a s T - (d.principalFix (d.iso h V)), hVisibility⟩ - have negative : Forces (M.nameDomain s) (.neg (.mem 0 1) : SetFormula 2) - ![traveled, vis] (a.iso h p) := (moved (d.iso h V)).2 absentImage - exact (forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1) : SetFormula 2) - ![traveled, vis] (H.upward hq qh) negative) visible - obtain ⟨raw, inBasis, lower⟩ := coinitial (b.encode V) member - obtain ⟨v, rfl⟩ := (b.mem_carrier raw).1 (profile (basis inBasis)) - obtain ⟨code, entry, _⟩ := function.2 (b.encode v) inBasis - have inCodes := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - let tau : Name s := ⟨code, M.niceSupportNameCodes_valid a s T d.principalFix code inCodes⟩ - have certificate := (M.pair_mem_niceSupportRelation a s b T d.principalFix v code).1 - (supported entry) - have fixed : d.principalFix V ≤ a.stabilizer s tau := - le_trans (d.principalFix_antitone ((b.pair_mem_conditionOrder v V).1 lower)) - ((niceNameCode_iff a s tau).1 certificate.2).2 - have same : a.act s h tau = a.act s g tau := by - have fixedName := fixed relative - change a.act s (g⁻¹ * h) tau = tau at fixedName - have translated := congrArg (a.act s g) fixedName - rw [a.act_mul, a.act_inv_right] at translated - exact translated - have equality := equalities (b.encode v) inBasis tau inCodes entry - have atoms : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := - fun E hE dense => generic E (Or.inl hE) dense - have hTau := M.act_mem s a t pairing unions powers separation collection carrier maps h tau certificate.1 - have gTau := M.act_mem s a t pairing unions powers separation collection carrier maps g tau certificate.1 - have gz := M.act_mem s a t pairing unions powers separation collection carrier maps g z.val z.property - have first := Name.forcesEq_sound (M.nameDomain s) H atoms _ hz _ hTau q hq - (Name.forcesEq_mono (a.forcesEq_act s h equality) qh) - have second := Name.forcesEq_sound (M.nameDomain s) H atoms _ gz _ gTau q hq - (Name.forcesEq_mono (a.forcesEq_act s g equality) qg) - exact first.trans ((congrArg (Name.eval {r | H.mem r}) same).trans second.symm) - -theorem preparedValue_forces_agreement (small : M.sets.Countable) - (F B f : ZFSet.{u}) (z : (M.nameDomain s).names) (p q : P) - (profile : F ⊆ b.carrier) (basis : B ⊆ F) - (coinitial : ∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ b.conditionOrder) - (function : ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f) - (supported : f ⊆ M.niceSupportRelation a s b T d.principalFix) - (decisions : M.DecidesVisibilityProfile a s b d.principalFix T F z.val p) - (equalities : ∀ v ∈ B, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z.val tau) - (g h : G) (V : L) (relative : g⁻¹ * h ∈ d.principalFix V) - (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) : - let traveled (k : G) : (M.nameDomain s).names := ⟨a.act s k z.val, - M.act_mem s a t pairing unions powers separation collection carrier maps k z.val z.property⟩ - let vis : (M.nameDomain s).names := ⟨M.niceVisibilityName a s T (d.principalFix (d.iso h V)), - M.niceVisibilityName_mem a s t b d.principalFix pairing unions powers separation collection - carrier group supports maps hT valid (d.iso h V) (M.transitive nodes (b.encode_mem _))⟩ - Forces (M.nameDomain s) (imp (.mem 0 1) (.equal 0 2)) ![traveled h, vis, traveled g] q := by - dsimp only - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ q).2 - intro H hq generic - apply (realize_imp _ _ _ _).2 - exact M.preparedValue_eval_agreement a s t b d pairing unions powers separation collection - carrier group nodes supports maps hT valid closed F B f z p q profile basis coinitial function - supported decisions equalities g h V relative qh qg H generic hq - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (M.codedFamily s) → - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -include group nodes supports hT closed descent in -theorem prepared_joint_mixed_collision_forces (small : M.sets.Countable) - (F B f : Fin 2 → ZFSet.{u}) (z y : Fin 2 → (M.nameDomain s).names) (p q : P) - (profiles : ∀ i, F i ⊆ b.carrier) (bases : ∀ i, B i ⊆ F i) - (coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) - (functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) - (supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) - (decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (z i).val p) - (equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (z i).val tau) - (g h : G) (V A X : L) (relative : g⁻¹ * h ∈ d.principalFix V) - (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) (overlap : meet A X = d.iso h V) : - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - ∀ (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (moved h (z i)).val) - (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (y i).val) - (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) - (moved h (z i)).val) - (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (y i).val) - (_shape : ∀ i, (moved h (z i)).val.val ⊆ ZFSet.prod T s.carrier) - (_profileTest : Forces (M.nameDomain s) refinementProfileFormula - ![moved h (z 0), moved h (z 1), - M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q) - (_referenceTest : Forces (M.nameDomain s) refinementCollisionFormula - ![moved g (z 0), y 0, moved g (z 1), y 1] q), - Forces (M.nameDomain s) refinementCollisionFormula - ![moved h (z 0), y 0, moved h (z 1), y 1] q := by - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - dsimp only - intro newSupport oldSupport newHS oldHS shape profileTest referenceTest - let env : Assignment (M.nameDomain s) 4 := ![moved h (z 0), y 0, moved h (z 1), y 1] - let reference : Assignment (M.nameDomain s) 4 := ![moved g (z 0), y 0, moved g (z 1), y 1] - apply (M.ordinaryForces_iff_all_joint_generics s small carrier refinementCollisionFormula env q).2 - intro H hq coded generic - let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {r | H.mem r}, - (M.nameDomain s).values_transitive _⟩ - have old := (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} reference) - (fun i => ⟨reference i, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic refinementCollisionFormula reference hq referenceTest) - change (Name.eval {r | H.mem r} (moved g (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ - Name.eval {r | H.mem r} (moved g (z 1)).val = Name.eval {r | H.mem r} (y 1).val) at old - have agreement - (collision : Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ∨ - Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) : - ∀ i, Name.eval {r | H.mem r} (moved h (z i)).val = - Name.eval {r | H.mem r} (moved g (z i)).val := by - have bounded (i : Fin 2) := Name.eval_subset_familySet_of_code_subset H T valid - (moved h (z i)).val (shape i) - have overlapProfile : Forces (M.nameDomain s) refinementProfileFormula - ![moved h (z 0), moved h (z 1), - M.stageOneVisibilityName s valid a b d base directed system (meet A X)] q := - overlap.symm ▸ profileTest - have visible := M.mixed_collision_visible_both a s b d base directed T valid system H generic - meet (descent H coded generic) A X (fun i => moved h (z i)) y newSupport oldSupport newHS oldHS - bounded q hq overlapProfile collision - intro i - have atOverlap : Name.eval {r | H.mem r} (a.act s h (z i).val) ∈ - Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso h V))) := - overlap ▸ visible i - exact M.preparedValue_eval_agreement a s t b d pairing unions powers separation collection - carrier group nodes supports maps hT valid closed (F i) (B i) (f i) (z i) p q (profiles i) - (bases i) (coinitial i) (functions i) (supported i) (decisions i) (equalities i) - g h V relative qh qg H generic hq atOverlap - apply (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} env) - (fun i => ⟨env i, rfl⟩)).2 - change (Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ - Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) - constructor - · intro first - have equal := agreement (Or.inl first) - exact (equal 1).trans (old.1 ((equal 0).symm.trans first)) - · intro second - have equal := agreement (Or.inr second) - exact (equal 0).trans (old.2 ((equal 1).symm.trans second)) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -include group nodes supports hT closed descent in -theorem prepared_mixed_collision_forces (small : M.sets.Countable) - (F B f : Fin 2 → ZFSet.{u}) (z y : Fin 2 → (M.nameDomain s).names) (p q : P) - (profiles : ∀ i, F i ⊆ b.carrier) (bases : ∀ i, B i ⊆ F i) - (coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) - (functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) - (supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) - (decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (z i).val p) - (equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (z i).val tau) - (g h : G) (V A X : L) (relative : g⁻¹ * h ∈ d.principalFix V) - (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) (overlap : meet A X = d.iso h V) : - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - ∀ (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (moved h (z i)).val) - (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (y i).val) - (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) - (moved h (z i)).val) - (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (y i).val) - (_shape : ∀ i, (moved h (z i)).val.val ⊆ ZFSet.prod T s.carrier) - (_profileTest : Forces (M.nameDomain s) refinementProfileFormula - ![moved h (z 0), moved h (z 1), - M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q) - (_referenceTest : Forces (M.nameDomain s) refinementCollisionFormula - ![moved g (z 0), y 0, moved g (z 1), y 1] q), - Forces (M.nameDomain s) refinementCollisionFormula - ![moved h (z 0), y 0, moved h (z 1), y 1] q := by - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - dsimp only - intro newSupport oldSupport newHS oldHS shape profileTest referenceTest - let env : Assignment (M.nameDomain s) 4 := ![moved h (z 0), y 0, moved h (z 1), y 1] - let reference : Assignment (M.nameDomain s) 4 := ![moved g (z 0), y 0, moved g (z 1), y 1] - apply (M.ordinaryForces_iff_all_generics s small carrier refinementCollisionFormula env q).2 - intro H hq generic - let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {r | H.mem r}, - (M.nameDomain s).values_transitive _⟩ - have old := (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} reference) - (fun i => ⟨reference i, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic refinementCollisionFormula reference hq referenceTest) - change (Name.eval {r | H.mem r} (moved g (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ - Name.eval {r | H.mem r} (moved g (z 1)).val = Name.eval {r | H.mem r} (y 1).val) at old - have agreement - (collision : Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ∨ - Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) : - ∀ i, Name.eval {r | H.mem r} (moved h (z i)).val = - Name.eval {r | H.mem r} (moved g (z i)).val := by - have bounded (i : Fin 2) := Name.eval_subset_familySet_of_code_subset H T valid - (moved h (z i)).val (shape i) - have overlapProfile : Forces (M.nameDomain s) refinementProfileFormula - ![moved h (z 0), moved h (z 1), - M.stageOneVisibilityName s valid a b d base directed system (meet A X)] q := - overlap.symm ▸ profileTest - have visible := M.mixed_collision_visible_both a s b d base directed T valid system H generic - meet (descent H generic) A X (fun i => moved h (z i)) y newSupport oldSupport newHS oldHS - bounded q hq overlapProfile collision - intro i - have atOverlap : Name.eval {r | H.mem r} (a.act s h (z i).val) ∈ - Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso h V))) := - overlap ▸ visible i - exact M.preparedValue_eval_agreement a s t b d pairing unions powers separation collection - carrier group nodes supports maps hT valid closed (F i) (B i) (f i) (z i) p q (profiles i) - (bases i) (coinitial i) (functions i) (supported i) (decisions i) (equalities i) - g h V relative qh qg H generic hq atOverlap - apply (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} env) - (fun i => ⟨env i, rfl⟩)).2 - change (Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ - Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) - constructor - · intro first - have equal := agreement (Or.inl first) - exact (equal 1).trans (old.1 ((equal 0).symm.trans first)) - · intro second - have equal := agreement (Or.inr second) - exact (equal 0).trans (old.2 ((equal 1).symm.trans second)) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceRefinementIndexActionLaws +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparedCertificateActionPackages + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) +variable (d : PosetAction G L) (base : L) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (H : ConditionFilter P) +variable (generic : H.GenericFor (formulaFamily (M.nameDomain s))) +variable (meet : L → L → L) +variable (descent : ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + +include system generic descent in +theorem common_value_visible (A B : L) (x y : (M.nameDomain s).names) + (sx : d.principalFix A ≤ a.stabilizer s x.val) + (sy : d.principalFix B ≤ a.stabilizer s y.val) + (hx : HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val) + (hy : HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val) + (subset : Name.eval {p | H.mem p} x.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (values : Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val) : + Name.eval {p | H.mem p} x.val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B))) := by + obtain ⟨τ, _, support, equal⟩ := descent A B x y sx sy hx hy values + have bounded : Name.eval {p | H.mem p} τ.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := equal.symm ▸ subset + exact equal ▸ system.normalization_visible (meet A B) τ support H generic bounded + +include generic descent in +theorem mixed_collision_visible_both (A B : L) + (x y : Fin 2 → (M.nameDomain s).names) + (sx : ∀ i, d.principalFix A ≤ a.stabilizer s (x i).val) + (sy : ∀ i, d.principalFix B ≤ a.stabilizer s (y i).val) + (hx : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (x i).val) + (hy : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (y i).val) + (subset : ∀ i, Name.eval {p | H.mem p} (x i).val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (q : P) (hq : H.mem q) + (profile : Forces (M.nameDomain s) refinementProfileFormula + ![x 0, x 1, M.stageOneVisibilityName s valid a b d base directed system (meet A B)] q) + (collision : Name.eval {p | H.mem p} (x 0).val = Name.eval {p | H.mem p} (y 0).val ∨ + Name.eval {p | H.mem p} (x 1).val = Name.eval {p | H.mem p} (y 1).val) : + ∀ i, Name.eval {p | H.mem p} (x i).val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B))) := by + let env : Assignment (M.nameDomain s) 3 := + ![x 0, x 1, M.stageOneVisibilityName s valid a b d base directed system (meet A B)] + let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {p | H.mem p}, + (M.nameDomain s).values_transitive _⟩ + have realized := forces_sound (M.nameDomain s) H generic refinementProfileFormula env hq profile + have paired := (N.realize_refinementProfileFormula (evalAssignment {p | H.mem p} env) + (fun i => ⟨env i, rfl⟩)).1 realized + change (Name.eval {p | H.mem p} (x 0).val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B)))) ↔ + (Name.eval {p | H.mem p} (x 1).val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix (meet A B)))) at paired + have one (i : Fin 2) + (equal : Name.eval {p | H.mem p} (x i).val = Name.eval {p | H.mem p} (y i).val) := + M.common_value_visible a s b d base directed T valid system H generic meet descent + A B (x i) (y i) (sx i) (sy i) (hx i) (hy i) (subset i) equal + rcases collision with left | right + · have first := one 0 left + exact Fin.cases first (Fin.cases (paired.1 first) (fun i => Fin.elim0 i)) + · have second := one 1 right + exact Fin.cases (paired.2 second) (Fin.cases second (fun i => Fin.elim0 i)) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +include pairing unions powers separation collection carrier group nodes supports maps hT valid closed + +theorem preparedValue_eval_agreement (F B f : ZFSet.{u}) + (z : (M.nameDomain s).names) (p q : P) + (profile : F ⊆ b.carrier) (basis : B ⊆ F) + (coinitial : ∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ b.conditionOrder) + (function : ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f) + (supported : f ⊆ M.niceSupportRelation a s b T d.principalFix) + (decisions : M.DecidesVisibilityProfile a s b d.principalFix T F z.val p) + (equalities : ∀ v ∈ B, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z.val tau) + (g h : G) (V : L) (relative : g⁻¹ * h ∈ d.principalFix V) + (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (hq : H.mem q) + (visible : Name.eval {r | H.mem r} (a.act s h z.val) ∈ + Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso h V)))) : + Name.eval {r | H.mem r} (a.act s h z.val) = + Name.eval {r | H.mem r} (a.act s g z.val) := by + have moved := M.decidesVisibilityProfile_act a s t b d pairing unions powers separation + collection carrier maps closed F z.val p h decisions + have hz := M.act_mem s a t pairing unions powers separation collection carrier maps h z.val z.property + have hVisibility := M.niceVisibilityName_mem a s t b d.principalFix pairing unions powers + separation collection carrier group supports maps hT valid (d.iso h V) + (M.transitive nodes (b.encode_mem _)) + have member : b.encode V ∈ F := by + by_contra absent + have absentImage : b.encode (d.iso h V) ∉ + relationImage F b.carrier (b.graph b (d.iso h)) := + fun yes => absent ((visibilityProfileImage_entry b d F h V).1 yes) + let traveled : (M.nameDomain s).names := ⟨a.act s h z.val, hz⟩ + let vis : (M.nameDomain s).names := ⟨M.niceVisibilityName a s T + (d.principalFix (d.iso h V)), hVisibility⟩ + have negative : Forces (M.nameDomain s) (.neg (.mem 0 1) : SetFormula 2) + ![traveled, vis] (a.iso h p) := (moved (d.iso h V)).2 absentImage + exact (forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1) : SetFormula 2) + ![traveled, vis] (H.upward hq qh) negative) visible + obtain ⟨raw, inBasis, lower⟩ := coinitial (b.encode V) member + obtain ⟨v, rfl⟩ := (b.mem_carrier raw).1 (profile (basis inBasis)) + obtain ⟨code, entry, _⟩ := function.2 (b.encode v) inBasis + have inCodes := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + let tau : Name s := ⟨code, M.niceSupportNameCodes_valid a s T d.principalFix code inCodes⟩ + have certificate := (M.pair_mem_niceSupportRelation a s b T d.principalFix v code).1 + (supported entry) + have fixed : d.principalFix V ≤ a.stabilizer s tau := + le_trans (d.principalFix_antitone ((b.pair_mem_conditionOrder v V).1 lower)) + ((niceNameCode_iff a s tau).1 certificate.2).2 + have same : a.act s h tau = a.act s g tau := by + have fixedName := fixed relative + change a.act s (g⁻¹ * h) tau = tau at fixedName + have translated := congrArg (a.act s g) fixedName + rw [a.act_mul, a.act_inv_right] at translated + exact translated + have equality := equalities (b.encode v) inBasis tau inCodes entry + have atoms : H.GenericFor (Name.atomicFamily (M.nameDomain s)) := + fun E hE dense => generic E (Or.inl hE) dense + have hTau := M.act_mem s a t pairing unions powers separation collection carrier maps h tau certificate.1 + have gTau := M.act_mem s a t pairing unions powers separation collection carrier maps g tau certificate.1 + have gz := M.act_mem s a t pairing unions powers separation collection carrier maps g z.val z.property + have first := Name.forcesEq_sound (M.nameDomain s) H atoms _ hz _ hTau q hq + (Name.forcesEq_mono (a.forcesEq_act s h equality) qh) + have second := Name.forcesEq_sound (M.nameDomain s) H atoms _ gz _ gTau q hq + (Name.forcesEq_mono (a.forcesEq_act s g equality) qg) + exact first.trans ((congrArg (Name.eval {r | H.mem r}) same).trans second.symm) + +theorem preparedValue_forces_agreement (small : M.sets.Countable) + (F B f : ZFSet.{u}) (z : (M.nameDomain s).names) (p q : P) + (profile : F ⊆ b.carrier) (basis : B ⊆ F) + (coinitial : ∀ x ∈ F, ∃ v ∈ B, ZFSet.pair v x ∈ b.conditionOrder) + (function : ZFSet.IsFunc B (M.niceSupportNameCodes a s T d.principalFix) f) + (supported : f ⊆ M.niceSupportRelation a s b T d.principalFix) + (decisions : M.DecidesVisibilityProfile a s b d.principalFix T F z.val p) + (equalities : ∀ v ∈ B, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq p z.val tau) + (g h : G) (V : L) (relative : g⁻¹ * h ∈ d.principalFix V) + (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) : + let traveled (k : G) : (M.nameDomain s).names := ⟨a.act s k z.val, + M.act_mem s a t pairing unions powers separation collection carrier maps k z.val z.property⟩ + let vis : (M.nameDomain s).names := ⟨M.niceVisibilityName a s T (d.principalFix (d.iso h V)), + M.niceVisibilityName_mem a s t b d.principalFix pairing unions powers separation collection + carrier group supports maps hT valid (d.iso h V) (M.transitive nodes (b.encode_mem _))⟩ + Forces (M.nameDomain s) (imp (.mem 0 1) (.equal 0 2)) ![traveled h, vis, traveled g] q := by + dsimp only + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ q).2 + intro H hq generic + apply (realize_imp _ _ _ _).2 + exact M.preparedValue_eval_agreement a s t b d pairing unions powers separation collection + carrier group nodes supports maps hT valid closed F B f z p q profile basis coinitial function + supported decisions equalities g h V relative qh qg H generic hq + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (M.codedFamily s) → + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +include group nodes supports hT closed descent in +theorem prepared_joint_mixed_collision_forces (small : M.sets.Countable) + (F B f : Fin 2 → ZFSet.{u}) (z y : Fin 2 → (M.nameDomain s).names) (p q : P) + (profiles : ∀ i, F i ⊆ b.carrier) (bases : ∀ i, B i ⊆ F i) + (coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) + (functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) + (supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) + (decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (z i).val p) + (equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (z i).val tau) + (g h : G) (V A X : L) (relative : g⁻¹ * h ∈ d.principalFix V) + (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) (overlap : meet A X = d.iso h V) : + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + ∀ (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (moved h (z i)).val) + (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (y i).val) + (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) + (moved h (z i)).val) + (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (y i).val) + (_shape : ∀ i, (moved h (z i)).val.val ⊆ ZFSet.prod T s.carrier) + (_profileTest : Forces (M.nameDomain s) refinementProfileFormula + ![moved h (z 0), moved h (z 1), + M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q) + (_referenceTest : Forces (M.nameDomain s) refinementCollisionFormula + ![moved g (z 0), y 0, moved g (z 1), y 1] q), + Forces (M.nameDomain s) refinementCollisionFormula + ![moved h (z 0), y 0, moved h (z 1), y 1] q := by + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + dsimp only + intro newSupport oldSupport newHS oldHS shape profileTest referenceTest + let env : Assignment (M.nameDomain s) 4 := ![moved h (z 0), y 0, moved h (z 1), y 1] + let reference : Assignment (M.nameDomain s) 4 := ![moved g (z 0), y 0, moved g (z 1), y 1] + apply (M.ordinaryForces_iff_all_joint_generics s small carrier refinementCollisionFormula env q).2 + intro H hq coded generic + let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {r | H.mem r}, + (M.nameDomain s).values_transitive _⟩ + have old := (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} reference) + (fun i => ⟨reference i, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic refinementCollisionFormula reference hq referenceTest) + change (Name.eval {r | H.mem r} (moved g (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ + Name.eval {r | H.mem r} (moved g (z 1)).val = Name.eval {r | H.mem r} (y 1).val) at old + have agreement + (collision : Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ∨ + Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) : + ∀ i, Name.eval {r | H.mem r} (moved h (z i)).val = + Name.eval {r | H.mem r} (moved g (z i)).val := by + have bounded (i : Fin 2) := Name.eval_subset_familySet_of_code_subset H T valid + (moved h (z i)).val (shape i) + have overlapProfile : Forces (M.nameDomain s) refinementProfileFormula + ![moved h (z 0), moved h (z 1), + M.stageOneVisibilityName s valid a b d base directed system (meet A X)] q := + overlap.symm ▸ profileTest + have visible := M.mixed_collision_visible_both a s b d base directed T valid system H generic + meet (descent H coded generic) A X (fun i => moved h (z i)) y newSupport oldSupport newHS oldHS + bounded q hq overlapProfile collision + intro i + have atOverlap : Name.eval {r | H.mem r} (a.act s h (z i).val) ∈ + Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso h V))) := + overlap ▸ visible i + exact M.preparedValue_eval_agreement a s t b d pairing unions powers separation collection + carrier group nodes supports maps hT valid closed (F i) (B i) (f i) (z i) p q (profiles i) + (bases i) (coinitial i) (functions i) (supported i) (decisions i) (equalities i) + g h V relative qh qg H generic hq atOverlap + apply (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} env) + (fun i => ⟨env i, rfl⟩)).2 + change (Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ + Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) + constructor + · intro first + have equal := agreement (Or.inl first) + exact (equal 1).trans (old.1 ((equal 0).symm.trans first)) + · intro second + have equal := agreement (Or.inr second) + exact (equal 0).trans (old.2 ((equal 1).symm.trans second)) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +include group nodes supports hT closed descent in +theorem prepared_mixed_collision_forces (small : M.sets.Countable) + (F B f : Fin 2 → ZFSet.{u}) (z y : Fin 2 → (M.nameDomain s).names) (p q : P) + (profiles : ∀ i, F i ⊆ b.carrier) (bases : ∀ i, B i ⊆ F i) + (coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) + (functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) + (supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) + (decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (z i).val p) + (equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (z i).val tau) + (g h : G) (V A X : L) (relative : g⁻¹ * h ∈ d.principalFix V) + (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) (overlap : meet A X = d.iso h V) : + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + ∀ (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (moved h (z i)).val) + (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (y i).val) + (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) + (moved h (z i)).val) + (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (y i).val) + (_shape : ∀ i, (moved h (z i)).val.val ⊆ ZFSet.prod T s.carrier) + (_profileTest : Forces (M.nameDomain s) refinementProfileFormula + ![moved h (z 0), moved h (z 1), + M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q) + (_referenceTest : Forces (M.nameDomain s) refinementCollisionFormula + ![moved g (z 0), y 0, moved g (z 1), y 1] q), + Forces (M.nameDomain s) refinementCollisionFormula + ![moved h (z 0), y 0, moved h (z 1), y 1] q := by + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + dsimp only + intro newSupport oldSupport newHS oldHS shape profileTest referenceTest + let env : Assignment (M.nameDomain s) 4 := ![moved h (z 0), y 0, moved h (z 1), y 1] + let reference : Assignment (M.nameDomain s) 4 := ![moved g (z 0), y 0, moved g (z 1), y 1] + apply (M.ordinaryForces_iff_all_generics s small carrier refinementCollisionFormula env q).2 + intro H hq generic + let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {r | H.mem r}, + (M.nameDomain s).values_transitive _⟩ + have old := (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} reference) + (fun i => ⟨reference i, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic refinementCollisionFormula reference hq referenceTest) + change (Name.eval {r | H.mem r} (moved g (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ + Name.eval {r | H.mem r} (moved g (z 1)).val = Name.eval {r | H.mem r} (y 1).val) at old + have agreement + (collision : Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ∨ + Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) : + ∀ i, Name.eval {r | H.mem r} (moved h (z i)).val = + Name.eval {r | H.mem r} (moved g (z i)).val := by + have bounded (i : Fin 2) := Name.eval_subset_familySet_of_code_subset H T valid + (moved h (z i)).val (shape i) + have overlapProfile : Forces (M.nameDomain s) refinementProfileFormula + ![moved h (z 0), moved h (z 1), + M.stageOneVisibilityName s valid a b d base directed system (meet A X)] q := + overlap.symm ▸ profileTest + have visible := M.mixed_collision_visible_both a s b d base directed T valid system H generic + meet (descent H generic) A X (fun i => moved h (z i)) y newSupport oldSupport newHS oldHS + bounded q hq overlapProfile collision + intro i + have atOverlap : Name.eval {r | H.mem r} (a.act s h (z i).val) ∈ + Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso h V))) := + overlap ▸ visible i + exact M.preparedValue_eval_agreement a s t b d pairing unions powers separation collection + carrier group nodes supports maps hT valid closed (F i) (B i) (f i) (z i) p q (profiles i) + (bases i) (coinitial i) (functions i) (supported i) (decisions i) (equalities i) + g h V relative qh qg H generic hq atOverlap + apply (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} env) + (fun i => ⟨env i, rfl⟩)).2 + change (Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ + Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) + constructor + · intro first + have equal := agreement (Or.inl first) + exact (equal 1).trans (old.1 ((equal 0).symm.trans first)) + · intro second + have equal := agreement (Or.inr second) + exact (equal 0).trans (old.2 ((equal 1).symm.trans second)) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedPositionCollisions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedPositionCollisions.lean index b1952e9353dc502408f18b83231db61c59c50fab..dc4c08cadf1805a6604ecc2b73db9170969f85f3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedPositionCollisions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedPositionCollisions.lean @@ -1,613 +1,613 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceRefinementClassSupports -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneRawNames -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalSeparatedActors -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedMixedCollisions - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (valid2 : ∀ z ∈ T2, IsName s z) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include indices in -theorem niceRefinementIndex_copies_agree (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (g h : G) (V : L) (anchor : E ≤ V) (relative : g⁻¹ * h ∈ d.principalFix V) : - refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = - refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by - obtain ⟨lower, hU, hRf, hRc, _⟩ := (indices.typed_entries C E U Rf Rc).1 member - have point (x : L) (below : x ≤ V) : d.iso h x = d.iso g x := by - have equal := congrArg (d.iso g) (relative x below) - rw [d.mul, d.point_inv_right] at equal - exact equal - have atC : g⁻¹ * h ∈ d.principalFix C := - d.principalFix_antitone (le_trans (le_of_lt lower) anchor) relative - have name {A : ZFSet.{u}} (tau : Name s) - (candidate : tau.val ∈ M.niceNameCandidates a s A (d.principalFix C)) : - a.act s h tau = a.act s g tau := by - have fixed := ((M.name_mem_niceNameCandidates a s A (d.principalFix C) tau).1 candidate).2.2 atC - change a.act s (g⁻¹ * h) tau = tau at fixed - have equal := congrArg (a.act s g) fixed - rw [a.act_mul, a.act_inv_right] at equal - exact equal - rw [point C (le_trans (le_of_lt lower) anchor), point E anchor, - name U.val hU, name Rf.val hRf, name Rc.val hRc] - -include indices in -theorem niceRefinementIndex_copies_agree_of_shared_anchor - (meet : L → L → L) - (greatest : ∀ x v w : L, x ≤ v → x ≤ w → x ≤ meet v w) - (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (g h : G) (V D X : L) (bound : E ≤ D) (shared : d.iso h E ≤ X) - (overlap : meet (d.iso h D) X = d.iso h V) - (relative : g⁻¹ * h ∈ d.principalFix V) : - E ≤ V ∧ - refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = - refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by - have both := greatest (d.iso h E) (d.iso h D) X ((d.iso h).monotone bound) shared - rw [overlap] at both - have anchor : E ≤ V := (d.iso h).le_iff_le.1 both - exact ⟨anchor, M.niceRefinementIndex_copies_agree a s b d level T T2 valid valid2 - indices C E U Rf Rc member g h V anchor relative⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable {T2 : ZFSet.{u}} {valid2 : ∀ z ∈ T2, IsName s z} -variable (level : ZFSet.{u}) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include indices in -theorem refinementLevelFormulaData_fields (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) : - let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let data := M.refinementLevelFormulaData a s b d level T T2 valid - (∀ z, ZFSet.pair idx z ∈ data 1 ↔ z = b.encode C) ∧ - (∀ z, ZFSet.pair idx z ∈ data 2 ↔ z = b.encode E) ∧ - (∀ z, ZFSet.pair idx z ∈ data 3 ↔ z = U.val.val) ∧ - (∀ z, ZFSet.pair idx z ∈ data 4 ↔ z = Rf.val.val) ∧ - (∀ z, ZFSet.pair idx z ∈ data 5 ↔ z = Rc.val.val) := - ⟨M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 1, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 2, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 3, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 4, - M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 5⟩ - -include indices in -theorem refinementLevelFormulaData_map (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) (z : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) z ∈ - M.refinementLevelFormulaData a s b d level T T2 valid 12 ↔ - z = (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc).val.val := - M.niceRefinementNameGraph_entry a s b d indices pairing unions powers separation collection hT carrier order - 2 C E U Rf Rc member z - -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem refinementLevelFormulaData_visibility (v : L) (z : ZFSet.{u}) : - ZFSet.pair (b.encode v) z ∈ M.refinementLevelFormulaData a s b d level T T2 valid 13 ↔ - z = (M.stageOneVisibilityName s valid a b d base directed system v).val.val := - system.visibility_entries v z - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include indices in -theorem refinementLevelRawCollision_iff (C E : L) (U Rf Rc u u' w w' : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) (p : P) : - stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val u'.val.val w.val.val w'.val.val (s.encode p) ↔ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid Rf Rc u u' w w' p := by - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let env : Assignment (M.nameDomain s) 4 := ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] - have codes : (fun j => (env j).val.val) = - ![(cls Rc u).val.val, (cls Rc u').val.val, (cls Rf w).val.val, (cls Rf w').val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j - have forcing := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order - refinementCollisionFormula p env - rw [codes] at forcing - have fields := M.refinementLevelFormulaData_fields s valid a b d level indices C E U Rf Rc member - constructor - · rintro ⟨f, ground, body⟩ - obtain ⟨_, _, _, _, ff, fr, bu, bu', aw, aw', forced⟩ := body - have ef := (fields.2.2.2.1 _).1 ff - have er := (fields.2.2.2.2 _).1 fr - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u.val.val (f 2) at bu - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u'.val.val (f 3) at bu' - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w.val.val (f 4) at aw - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w'.val.val (f 5) at aw' - rw [er] at bu bu' - rw [ef] at aw aw' - have eb := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (ground 2)).1 bu - have eb' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (ground 3)).1 bu' - have ea := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (ground 4)).1 aw - have ea' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (ground 5)).1 aw' - rw [eb, eb', ea, ea'] at forced - exact forcing.1 forced - · intro forced - refine ⟨![Rf.val.val, Rc.val.val, (cls Rc u).val.val, (cls Rc u').val.val, - (cls Rf w).val.val, (cls Rf w').val.val], ?_, ?_⟩ - · exact Fin.cases Rf.property (Fin.cases Rc.property (Fin.cases (cls Rc u).property - (Fin.cases (cls Rc u').property (Fin.cases (cls Rf w).property - (Fin.cases (cls Rf w').property (fun j => Fin.elim0 j)))))) - · refine ⟨M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u, - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u', - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w, - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w', - (fields.2.2.2.1 _).2 rfl, (fields.2.2.2.2 _).2 rfl, ?_, ?_, ?_, ?_, forcing.2 forced⟩ - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (cls Rc u).property).2 rfl - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (cls Rc u').property).2 rfl - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (cls Rf w).property).2 rfl - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (cls Rf w').property).2 rfl - -end TransitiveGround - -namespace GroundMainFinalGeometry -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (geometry : GroundMainFinalGeometry M C D rD) -variable {P : Type u} [PartialOrder P] [OrderTop P] - -theorem copied_refinement_index_shared_anchor (s : Presentation P) : - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - let b := SetMembers.presentation geometry.carrier - let d := geometry.decodedAction - ∀ (a : PosetAction (SetMembers geometry.actors) P) (level T T2 : ZFSet.{u}) - (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) - (_indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - (C E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain s).names) - (_member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (g h : SetMembers geometry.actors) (V B X : SetMembers geometry.carrier) - (_bound : E ≤ B) (_shared : d.iso h E ≤ X) - (_overlap : geometry.meet.smallMeet (d.iso h B) X = d.iso h V) - (_relative : g⁻¹ * h ∈ d.principalFix V), - E ≤ V ∧ - refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = - refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - dsimp only - intro a level T T2 valid valid2 indices C E U Rf Rc member g h V B X bound shared overlap relative - exact M.niceRefinementIndex_copies_agree_of_shared_anchor a s - (SetMembers.presentation geometry.carrier) geometry.decodedAction level T T2 valid valid2 indices - geometry.meet.smallMeet (fun _ _ _ left right => geometry.meet.toSmallMeetOrder.le_meet left right) - C E U Rf Rc member g h V B X bound shared overlap relative - -end GroundMainFinalGeometry - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (M.codedFamily s) → - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -variable {T2 : ZFSet.{u}} (valid2 : ∀ z ∈ T2, IsName s z) -variable (closed2 : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2) -variable (level : ZFSet.{u}) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include group nodes supports closed closed2 descent indices in -theorem prepared_joint_refinementCollision_tests (small : M.sets.Countable) - (C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (F B f : Fin 2 → ZFSet.{u}) (p q : P) (g h : G) (V A X : L) - (relative : g⁻¹ * h ∈ d.principalFix V) - (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) - (overlap : meet A X = d.iso h V) (anchor : d.iso h E ≤ meet A X) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - let original := ![cls Rc u, cls Rf w] - let newPair := ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] - let oldPair := ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] - ∀ (_profiles : ∀ i, F i ⊆ b.carrier) (_bases : ∀ i, B i ⊆ F i) - (_coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) - (_functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) - (_supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) - (_decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (original i).val p) - (_equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (original i).val tau) - (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (newPair i).val) - (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (oldPair i).val) - (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (newPair i).val) - (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (oldPair i).val) - (_single : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p) - (_reference : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW q), - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q ∧ - stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) - (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val) - (moved h u).val.val oldU.val.val (moved h w).val.val oldW.val.val (s.encode q) := by - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - let original : Fin 2 → (M.nameDomain s).names := ![cls Rc u, cls Rf w] - let newPair : Fin 2 → (M.nameDomain s).names := - ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] - let oldPair : Fin 2 → (M.nameDomain s).names := - ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] - dsimp only - intro profiles bases coinitial functions supported decisions equalities newSupport oldSupport newHS oldHS single reference - have above : E ≤ V := (d.iso h).le_iff_le.1 (overlap ▸ anchor) - have indexEq := M.niceRefinementIndex_copies_agree a s b d level T T2 valid valid2 - indices C E U Rf Rc member g h V above relative - have fields := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 indexEq - have fine : moved h Rf = moved g Rf := Subtype.ext (Subtype.ext fields.2.2.2.2.1) - have coarse : moved h Rc = moved g Rc := Subtype.ext (Subtype.ext fields.2.2.2.2.2) - have classLaw (k : G) (R v : (M.nameDomain s).names) : - moved k (cls R v) = cls (moved k R) (moved k v) := - M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps - order hT valid closed k R v - have newLaw (i : Fin 2) : moved h (original i) = newPair i := by - exact Fin.cases (classLaw h Rc u) (Fin.cases (classLaw h Rf w) (fun j => Fin.elim0 j)) i - have shape (i : Fin 2) : (moved h (original i)).val.val ⊆ ZFSet.prod T s.carrier := by - rw [newLaw] - exact Fin.cases (Name.refinementClass_subset T valid (moved h Rc).val (moved h u).val) - (Fin.cases (Name.refinementClass_subset T valid (moved h Rf).val (moved h w).val) - (fun j => Fin.elim0 j)) i - have transported := (M.stageOneProfile_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed b d base directed system h Rc Rf u w V p).2 - (single.2.1 V above) - have profile : Forces (M.nameDomain s) refinementProfileFormula - ![moved h (original 0), moved h (original 1), - M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q := by - rw [newLaw 0, newLaw 1] - exact forces_mono (M.nameDomain s) _ _ transported qh - have referenceFormula : Forces (M.nameDomain s) refinementCollisionFormula - ![moved g (original 0), oldPair 0, moved g (original 1), oldPair 1] q := by - change Forces (M.nameDomain s) refinementCollisionFormula - ![moved g (cls Rc u), cls (moved h Rc) oldU, - moved g (cls Rf w), cls (moved h Rf) oldW] q - rw [classLaw g Rc u, classLaw g Rf w, ← fine, ← coarse] - exact reference - have forced := M.prepared_joint_mixed_collision_forces a s t b d pairing unions powers separation collection - carrier group nodes supports maps hT valid closed base directed system meet descent small F B f - original oldPair p q profiles bases coinitial functions supported decisions equalities g h V A X - relative qh qg overlap (fun i => (newLaw i).symm ▸ newSupport i) oldSupport - (fun i => (newLaw i).symm ▸ newHS i) oldHS shape profile referenceFormula - have typed : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q := by - rw [newLaw 0, newLaw 1] at forced - exact forced - have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps level T T2 valid closed closed2 indices.family_ground h C E U Rf Rc).2 member - refine ⟨typed, ?_⟩ - exact (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices (d.iso h C) (d.iso h E) (moved h U) (moved h Rf) (moved h Rc) - (moved h u) oldU (moved h w) oldW movedMember q).2 typed - -end TransitiveGround - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -variable {T2 : ZFSet.{u}} (valid2 : ∀ z ∈ T2, IsName s z) -variable (closed2 : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2) -variable (level : ZFSet.{u}) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include group nodes supports closed closed2 descent indices in -theorem prepared_refinementCollision_tests (small : M.sets.Countable) - (C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (F B f : Fin 2 → ZFSet.{u}) (p q : P) (g h : G) (V A X : L) - (relative : g⁻¹ * h ∈ d.principalFix V) - (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) - (overlap : meet A X = d.iso h V) (anchor : d.iso h E ≤ meet A X) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - let original := ![cls Rc u, cls Rf w] - let newPair := ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] - let oldPair := ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] - ∀ (_profiles : ∀ i, F i ⊆ b.carrier) (_bases : ∀ i, B i ⊆ F i) - (_coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) - (_functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) - (_supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) - (_decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (original i).val p) - (_equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (original i).val tau) - (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (newPair i).val) - (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (oldPair i).val) - (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (newPair i).val) - (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (oldPair i).val) - (_single : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p) - (_reference : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW q), - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q ∧ - stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) - (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val) - (moved h u).val.val oldU.val.val (moved h w).val.val oldW.val.val (s.encode q) := by - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - let original : Fin 2 → (M.nameDomain s).names := ![cls Rc u, cls Rf w] - let newPair : Fin 2 → (M.nameDomain s).names := - ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] - let oldPair : Fin 2 → (M.nameDomain s).names := - ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] - dsimp only - intro profiles bases coinitial functions supported decisions equalities newSupport oldSupport newHS oldHS single reference - have above : E ≤ V := (d.iso h).le_iff_le.1 (overlap ▸ anchor) - have indexEq := M.niceRefinementIndex_copies_agree a s b d level T T2 valid valid2 - indices C E U Rf Rc member g h V above relative - have fields := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 indexEq - have fine : moved h Rf = moved g Rf := Subtype.ext (Subtype.ext fields.2.2.2.2.1) - have coarse : moved h Rc = moved g Rc := Subtype.ext (Subtype.ext fields.2.2.2.2.2) - have classLaw (k : G) (R v : (M.nameDomain s).names) : - moved k (cls R v) = cls (moved k R) (moved k v) := - M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps - order hT valid closed k R v - have newLaw (i : Fin 2) : moved h (original i) = newPair i := by - exact Fin.cases (classLaw h Rc u) (Fin.cases (classLaw h Rf w) (fun j => Fin.elim0 j)) i - have shape (i : Fin 2) : (moved h (original i)).val.val ⊆ ZFSet.prod T s.carrier := by - rw [newLaw] - exact Fin.cases (Name.refinementClass_subset T valid (moved h Rc).val (moved h u).val) - (Fin.cases (Name.refinementClass_subset T valid (moved h Rf).val (moved h w).val) - (fun j => Fin.elim0 j)) i - have transported := (M.stageOneProfile_act_iff a s t pairing unions powers separation collection - carrier order maps hT valid closed b d base directed system h Rc Rf u w V p).2 - (single.2.1 V above) - have profile : Forces (M.nameDomain s) refinementProfileFormula - ![moved h (original 0), moved h (original 1), - M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q := by - rw [newLaw 0, newLaw 1] - exact forces_mono (M.nameDomain s) _ _ transported qh - have referenceFormula : Forces (M.nameDomain s) refinementCollisionFormula - ![moved g (original 0), oldPair 0, moved g (original 1), oldPair 1] q := by - change Forces (M.nameDomain s) refinementCollisionFormula - ![moved g (cls Rc u), cls (moved h Rc) oldU, - moved g (cls Rf w), cls (moved h Rf) oldW] q - rw [classLaw g Rc u, classLaw g Rf w, ← fine, ← coarse] - exact reference - have forced := M.prepared_mixed_collision_forces a s t b d pairing unions powers separation collection - carrier group nodes supports maps hT valid closed base directed system meet descent small F B f - original oldPair p q profiles bases coinitial functions supported decisions equalities g h V A X - relative qh qg overlap (fun i => (newLaw i).symm ▸ newSupport i) oldSupport - (fun i => (newLaw i).symm ▸ newHS i) oldHS shape profile referenceFormula - have typed : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q := by - rw [newLaw 0, newLaw 1] at forced - exact forced - have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps level T T2 valid closed closed2 indices.family_ground h C E U Rf Rc).2 member - refine ⟨typed, ?_⟩ - exact (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices (d.iso h C) (d.iso h E) (moved h U) (moved h Rf) (moved h Rc) - (moved h u) oldU (moved h w) oldW movedMember q).2 typed - -end TransitiveGround - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (M.codedFamily s) → - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -variable {T2 : ZFSet.{u}} (valid2 : ∀ z ∈ T2, IsName s z) -variable (closed2 : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2) -variable (level : ZFSet.{u}) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include group nodes supports closed closed2 descent indices in -theorem prepared_joint_refinementCollision_of_position_supports (small : M.sets.Countable) - (children : ∀ tau : Name s, tau.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) - (C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (F B f : Fin 2 → ZFSet.{u}) (p q : P) (g h : G) (V A X : L) - (relative : g⁻¹ * h ∈ d.principalFix V) - (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) - (overlap : meet A X = d.iso h V) (anchor : d.iso h E ≤ meet A X) - (meetLeft : meet A X ≤ A) (meetRight : meet A X ≤ X) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - let original := ![cls Rc u, cls Rf w] - ∀ (_profiles : ∀ i, F i ⊆ b.carrier) (_bases : ∀ i, B i ⊆ F i) - (_coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) - (_functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) - (_supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) - (_decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (original i).val p) - (_equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (original i).val tau) - (_newPositions : ∀ i : Fin 2, d.principalFix A ≤ - a.stabilizer s (![ (moved h u).val, (moved h w).val ] i)) - (_oldPositions : ∀ i : Fin 2, d.principalFix X ≤ - a.stabilizer s (![oldU.val, oldW.val] i)) - (_single : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p) - (_reference : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW q), - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q ∧ - stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) - (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val) - (moved h u).val.val oldU.val.val (moved h w).val.val oldW.val.val (s.encode q) := by - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - let newPair : Fin 2 → (M.nameDomain s).names := - ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] - let oldPair : Fin 2 → (M.nameDomain s).names := - ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] - dsimp only - intro profiles bases coinitial functions supported decisions equalities newPositions oldPositions single reference - have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection - carrier order maps level T T2 valid closed closed2 indices.family_ground h C E U Rf Rc).2 member - have newSupports := M.niceRefinementClasses_supported_by_block a s b d level T T2 valid valid2 - indices base directed closed children (d.iso h C) (d.iso h E) A - (moved h U) (moved h Rf) (moved h Rc) movedMember (anchor.trans meetLeft) - ![(moved h u).val, (moved h w).val] newPositions - have oldSupports := M.niceRefinementClasses_supported_by_block a s b d level T T2 valid valid2 - indices base directed closed children (d.iso h C) (d.iso h E) X - (moved h U) (moved h Rf) (moved h Rc) movedMember (anchor.trans meetRight) - ![oldU.val, oldW.val] oldPositions - have newFacts : ∀ i, d.principalFix A ≤ a.stabilizer s (newPair i).val ∧ - HereditarilySymmetric a s (d.principalSupportFamily base directed) (newPair i).val := - Fin.cases (newSupports 0) (Fin.cases (newSupports 1) (fun j => Fin.elim0 j)) - have oldFacts : ∀ i, d.principalFix X ≤ a.stabilizer s (oldPair i).val ∧ - HereditarilySymmetric a s (d.principalSupportFamily base directed) (oldPair i).val := - Fin.cases (oldSupports 0) (Fin.cases (oldSupports 1) (fun j => Fin.elim0 j)) - exact M.prepared_joint_refinementCollision_tests a s t b d pairing unions powers separation collection - carrier order group nodes supports maps hT valid closed base directed system meet descent - valid2 closed2 level indices small C E U Rf Rc u w oldU oldW member F B f p q g h V A X - relative qh qg overlap anchor profiles bases coinitial functions supported decisions equalities - (fun i => (newFacts i).1) (fun i => (oldFacts i).1) - (fun i => (newFacts i).2) (fun i => (oldFacts i).2) single reference - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceRefinementClassSupports +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneRawNames +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalSeparatedActors +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedMixedCollisions + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (valid2 : ∀ z ∈ T2, IsName s z) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include indices in +theorem niceRefinementIndex_copies_agree (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (g h : G) (V : L) (anchor : E ≤ V) (relative : g⁻¹ * h ∈ d.principalFix V) : + refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = + refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by + obtain ⟨lower, hU, hRf, hRc, _⟩ := (indices.typed_entries C E U Rf Rc).1 member + have point (x : L) (below : x ≤ V) : d.iso h x = d.iso g x := by + have equal := congrArg (d.iso g) (relative x below) + rw [d.mul, d.point_inv_right] at equal + exact equal + have atC : g⁻¹ * h ∈ d.principalFix C := + d.principalFix_antitone (le_trans (le_of_lt lower) anchor) relative + have name {A : ZFSet.{u}} (tau : Name s) + (candidate : tau.val ∈ M.niceNameCandidates a s A (d.principalFix C)) : + a.act s h tau = a.act s g tau := by + have fixed := ((M.name_mem_niceNameCandidates a s A (d.principalFix C) tau).1 candidate).2.2 atC + change a.act s (g⁻¹ * h) tau = tau at fixed + have equal := congrArg (a.act s g) fixed + rw [a.act_mul, a.act_inv_right] at equal + exact equal + rw [point C (le_trans (le_of_lt lower) anchor), point E anchor, + name U.val hU, name Rf.val hRf, name Rc.val hRc] + +include indices in +theorem niceRefinementIndex_copies_agree_of_shared_anchor + (meet : L → L → L) + (greatest : ∀ x v w : L, x ≤ v → x ≤ w → x ≤ meet v w) + (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (g h : G) (V D X : L) (bound : E ≤ D) (shared : d.iso h E ≤ X) + (overlap : meet (d.iso h D) X = d.iso h V) + (relative : g⁻¹ * h ∈ d.principalFix V) : + E ≤ V ∧ + refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = + refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by + have both := greatest (d.iso h E) (d.iso h D) X ((d.iso h).monotone bound) shared + rw [overlap] at both + have anchor : E ≤ V := (d.iso h).le_iff_le.1 both + exact ⟨anchor, M.niceRefinementIndex_copies_agree a s b d level T T2 valid valid2 + indices C E U Rf Rc member g h V anchor relative⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable {T2 : ZFSet.{u}} {valid2 : ∀ z ∈ T2, IsName s z} +variable (level : ZFSet.{u}) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include indices in +theorem refinementLevelFormulaData_fields (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) : + let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let data := M.refinementLevelFormulaData a s b d level T T2 valid + (∀ z, ZFSet.pair idx z ∈ data 1 ↔ z = b.encode C) ∧ + (∀ z, ZFSet.pair idx z ∈ data 2 ↔ z = b.encode E) ∧ + (∀ z, ZFSet.pair idx z ∈ data 3 ↔ z = U.val.val) ∧ + (∀ z, ZFSet.pair idx z ∈ data 4 ↔ z = Rf.val.val) ∧ + (∀ z, ZFSet.pair idx z ∈ data 5 ↔ z = Rc.val.val) := + ⟨M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 1, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 2, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 3, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 4, + M.niceRefinementIndex_field_entry a s b d indices C E U Rf Rc member 5⟩ + +include indices in +theorem refinementLevelFormulaData_map (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) (z : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) z ∈ + M.refinementLevelFormulaData a s b d level T T2 valid 12 ↔ + z = (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc).val.val := + M.niceRefinementNameGraph_entry a s b d indices pairing unions powers separation collection hT carrier order + 2 C E U Rf Rc member z + +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem refinementLevelFormulaData_visibility (v : L) (z : ZFSet.{u}) : + ZFSet.pair (b.encode v) z ∈ M.refinementLevelFormulaData a s b d level T T2 valid 13 ↔ + z = (M.stageOneVisibilityName s valid a b d base directed system v).val.val := + system.visibility_entries v z + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include indices in +theorem refinementLevelRawCollision_iff (C E : L) (U Rf Rc u u' w w' : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) (p : P) : + stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val u'.val.val w.val.val w'.val.val (s.encode p) ↔ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid Rf Rc u u' w w' p := by + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let env : Assignment (M.nameDomain s) 4 := ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] + have codes : (fun j => (env j).val.val) = + ![(cls Rc u).val.val, (cls Rc u').val.val, (cls Rf w).val.val, (cls Rf w').val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j + have forcing := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order + refinementCollisionFormula p env + rw [codes] at forcing + have fields := M.refinementLevelFormulaData_fields s valid a b d level indices C E U Rf Rc member + constructor + · rintro ⟨f, ground, body⟩ + obtain ⟨_, _, _, _, ff, fr, bu, bu', aw, aw', forced⟩ := body + have ef := (fields.2.2.2.1 _).1 ff + have er := (fields.2.2.2.2 _).1 fr + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u.val.val (f 2) at bu + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u'.val.val (f 3) at bu' + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w.val.val (f 4) at aw + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w'.val.val (f 5) at aw' + rw [er] at bu bu' + rw [ef] at aw aw' + have eb := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (ground 2)).1 bu + have eb' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (ground 3)).1 bu' + have ea := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (ground 4)).1 aw + have ea' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (ground 5)).1 aw' + rw [eb, eb', ea, ea'] at forced + exact forcing.1 forced + · intro forced + refine ⟨![Rf.val.val, Rc.val.val, (cls Rc u).val.val, (cls Rc u').val.val, + (cls Rf w).val.val, (cls Rf w').val.val], ?_, ?_⟩ + · exact Fin.cases Rf.property (Fin.cases Rc.property (Fin.cases (cls Rc u).property + (Fin.cases (cls Rc u').property (Fin.cases (cls Rf w).property + (Fin.cases (cls Rf w').property (fun j => Fin.elim0 j)))))) + · refine ⟨M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u, + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u', + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w, + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w', + (fields.2.2.2.1 _).2 rfl, (fields.2.2.2.2 _).2 rfl, ?_, ?_, ?_, ?_, forcing.2 forced⟩ + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (cls Rc u).property).2 rfl + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (cls Rc u').property).2 rfl + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (cls Rf w).property).2 rfl + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (cls Rf w').property).2 rfl + +end TransitiveGround + +namespace GroundMainFinalGeometry +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (geometry : GroundMainFinalGeometry M C D rD) +variable {P : Type u} [PartialOrder P] [OrderTop P] + +theorem copied_refinement_index_shared_anchor (s : Presentation P) : + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + let b := SetMembers.presentation geometry.carrier + let d := geometry.decodedAction + ∀ (a : PosetAction (SetMembers geometry.actors) P) (level T T2 : ZFSet.{u}) + (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) + (_indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + (C E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain s).names) + (_member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (g h : SetMembers geometry.actors) (V B X : SetMembers geometry.carrier) + (_bound : E ≤ B) (_shared : d.iso h E ≤ X) + (_overlap : geometry.meet.smallMeet (d.iso h B) X = d.iso h V) + (_relative : g⁻¹ * h ∈ d.principalFix V), + E ≤ V ∧ + refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = + refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val := by + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + dsimp only + intro a level T T2 valid valid2 indices C E U Rf Rc member g h V B X bound shared overlap relative + exact M.niceRefinementIndex_copies_agree_of_shared_anchor a s + (SetMembers.presentation geometry.carrier) geometry.decodedAction level T T2 valid valid2 indices + geometry.meet.smallMeet (fun _ _ _ left right => geometry.meet.toSmallMeetOrder.le_meet left right) + C E U Rf Rc member g h V B X bound shared overlap relative + +end GroundMainFinalGeometry + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (M.codedFamily s) → + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +variable {T2 : ZFSet.{u}} (valid2 : ∀ z ∈ T2, IsName s z) +variable (closed2 : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2) +variable (level : ZFSet.{u}) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include group nodes supports closed closed2 descent indices in +theorem prepared_joint_refinementCollision_tests (small : M.sets.Countable) + (C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (F B f : Fin 2 → ZFSet.{u}) (p q : P) (g h : G) (V A X : L) + (relative : g⁻¹ * h ∈ d.principalFix V) + (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) + (overlap : meet A X = d.iso h V) (anchor : d.iso h E ≤ meet A X) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + let original := ![cls Rc u, cls Rf w] + let newPair := ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] + let oldPair := ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] + ∀ (_profiles : ∀ i, F i ⊆ b.carrier) (_bases : ∀ i, B i ⊆ F i) + (_coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) + (_functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) + (_supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) + (_decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (original i).val p) + (_equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (original i).val tau) + (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (newPair i).val) + (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (oldPair i).val) + (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (newPair i).val) + (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (oldPair i).val) + (_single : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p) + (_reference : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW q), + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q ∧ + stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) + (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val) + (moved h u).val.val oldU.val.val (moved h w).val.val oldW.val.val (s.encode q) := by + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + let original : Fin 2 → (M.nameDomain s).names := ![cls Rc u, cls Rf w] + let newPair : Fin 2 → (M.nameDomain s).names := + ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] + let oldPair : Fin 2 → (M.nameDomain s).names := + ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] + dsimp only + intro profiles bases coinitial functions supported decisions equalities newSupport oldSupport newHS oldHS single reference + have above : E ≤ V := (d.iso h).le_iff_le.1 (overlap ▸ anchor) + have indexEq := M.niceRefinementIndex_copies_agree a s b d level T T2 valid valid2 + indices C E U Rf Rc member g h V above relative + have fields := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 indexEq + have fine : moved h Rf = moved g Rf := Subtype.ext (Subtype.ext fields.2.2.2.2.1) + have coarse : moved h Rc = moved g Rc := Subtype.ext (Subtype.ext fields.2.2.2.2.2) + have classLaw (k : G) (R v : (M.nameDomain s).names) : + moved k (cls R v) = cls (moved k R) (moved k v) := + M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps + order hT valid closed k R v + have newLaw (i : Fin 2) : moved h (original i) = newPair i := by + exact Fin.cases (classLaw h Rc u) (Fin.cases (classLaw h Rf w) (fun j => Fin.elim0 j)) i + have shape (i : Fin 2) : (moved h (original i)).val.val ⊆ ZFSet.prod T s.carrier := by + rw [newLaw] + exact Fin.cases (Name.refinementClass_subset T valid (moved h Rc).val (moved h u).val) + (Fin.cases (Name.refinementClass_subset T valid (moved h Rf).val (moved h w).val) + (fun j => Fin.elim0 j)) i + have transported := (M.stageOneProfile_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed b d base directed system h Rc Rf u w V p).2 + (single.2.1 V above) + have profile : Forces (M.nameDomain s) refinementProfileFormula + ![moved h (original 0), moved h (original 1), + M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q := by + rw [newLaw 0, newLaw 1] + exact forces_mono (M.nameDomain s) _ _ transported qh + have referenceFormula : Forces (M.nameDomain s) refinementCollisionFormula + ![moved g (original 0), oldPair 0, moved g (original 1), oldPair 1] q := by + change Forces (M.nameDomain s) refinementCollisionFormula + ![moved g (cls Rc u), cls (moved h Rc) oldU, + moved g (cls Rf w), cls (moved h Rf) oldW] q + rw [classLaw g Rc u, classLaw g Rf w, ← fine, ← coarse] + exact reference + have forced := M.prepared_joint_mixed_collision_forces a s t b d pairing unions powers separation collection + carrier group nodes supports maps hT valid closed base directed system meet descent small F B f + original oldPair p q profiles bases coinitial functions supported decisions equalities g h V A X + relative qh qg overlap (fun i => (newLaw i).symm ▸ newSupport i) oldSupport + (fun i => (newLaw i).symm ▸ newHS i) oldHS shape profile referenceFormula + have typed : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q := by + rw [newLaw 0, newLaw 1] at forced + exact forced + have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps level T T2 valid closed closed2 indices.family_ground h C E U Rf Rc).2 member + refine ⟨typed, ?_⟩ + exact (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices (d.iso h C) (d.iso h E) (moved h U) (moved h Rf) (moved h Rc) + (moved h u) oldU (moved h w) oldW movedMember q).2 typed + +end TransitiveGround + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +variable {T2 : ZFSet.{u}} (valid2 : ∀ z ∈ T2, IsName s z) +variable (closed2 : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2) +variable (level : ZFSet.{u}) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include group nodes supports closed closed2 descent indices in +theorem prepared_refinementCollision_tests (small : M.sets.Countable) + (C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (F B f : Fin 2 → ZFSet.{u}) (p q : P) (g h : G) (V A X : L) + (relative : g⁻¹ * h ∈ d.principalFix V) + (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) + (overlap : meet A X = d.iso h V) (anchor : d.iso h E ≤ meet A X) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + let original := ![cls Rc u, cls Rf w] + let newPair := ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] + let oldPair := ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] + ∀ (_profiles : ∀ i, F i ⊆ b.carrier) (_bases : ∀ i, B i ⊆ F i) + (_coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) + (_functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) + (_supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) + (_decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (original i).val p) + (_equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (original i).val tau) + (_newSupport : ∀ i, d.principalFix A ≤ a.stabilizer s (newPair i).val) + (_oldSupport : ∀ i, d.principalFix X ≤ a.stabilizer s (oldPair i).val) + (_newHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (newPair i).val) + (_oldHS : ∀ i, HereditarilySymmetric a s (d.principalSupportFamily base directed) (oldPair i).val) + (_single : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p) + (_reference : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW q), + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q ∧ + stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) + (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val) + (moved h u).val.val oldU.val.val (moved h w).val.val oldW.val.val (s.encode q) := by + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + let original : Fin 2 → (M.nameDomain s).names := ![cls Rc u, cls Rf w] + let newPair : Fin 2 → (M.nameDomain s).names := + ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] + let oldPair : Fin 2 → (M.nameDomain s).names := + ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] + dsimp only + intro profiles bases coinitial functions supported decisions equalities newSupport oldSupport newHS oldHS single reference + have above : E ≤ V := (d.iso h).le_iff_le.1 (overlap ▸ anchor) + have indexEq := M.niceRefinementIndex_copies_agree a s b d level T T2 valid valid2 + indices C E U Rf Rc member g h V above relative + have fields := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 indexEq + have fine : moved h Rf = moved g Rf := Subtype.ext (Subtype.ext fields.2.2.2.2.1) + have coarse : moved h Rc = moved g Rc := Subtype.ext (Subtype.ext fields.2.2.2.2.2) + have classLaw (k : G) (R v : (M.nameDomain s).names) : + moved k (cls R v) = cls (moved k R) (moved k v) := + M.stageOneNameAction_class a s t pairing unions powers separation collection carrier maps + order hT valid closed k R v + have newLaw (i : Fin 2) : moved h (original i) = newPair i := by + exact Fin.cases (classLaw h Rc u) (Fin.cases (classLaw h Rf w) (fun j => Fin.elim0 j)) i + have shape (i : Fin 2) : (moved h (original i)).val.val ⊆ ZFSet.prod T s.carrier := by + rw [newLaw] + exact Fin.cases (Name.refinementClass_subset T valid (moved h Rc).val (moved h u).val) + (Fin.cases (Name.refinementClass_subset T valid (moved h Rf).val (moved h w).val) + (fun j => Fin.elim0 j)) i + have transported := (M.stageOneProfile_act_iff a s t pairing unions powers separation collection + carrier order maps hT valid closed b d base directed system h Rc Rf u w V p).2 + (single.2.1 V above) + have profile : Forces (M.nameDomain s) refinementProfileFormula + ![moved h (original 0), moved h (original 1), + M.stageOneVisibilityName s valid a b d base directed system (d.iso h V)] q := by + rw [newLaw 0, newLaw 1] + exact forces_mono (M.nameDomain s) _ _ transported qh + have referenceFormula : Forces (M.nameDomain s) refinementCollisionFormula + ![moved g (original 0), oldPair 0, moved g (original 1), oldPair 1] q := by + change Forces (M.nameDomain s) refinementCollisionFormula + ![moved g (cls Rc u), cls (moved h Rc) oldU, + moved g (cls Rf w), cls (moved h Rf) oldW] q + rw [classLaw g Rc u, classLaw g Rf w, ← fine, ← coarse] + exact reference + have forced := M.prepared_mixed_collision_forces a s t b d pairing unions powers separation collection + carrier group nodes supports maps hT valid closed base directed system meet descent small F B f + original oldPair p q profiles bases coinitial functions supported decisions equalities g h V A X + relative qh qg overlap (fun i => (newLaw i).symm ▸ newSupport i) oldSupport + (fun i => (newLaw i).symm ▸ newHS i) oldHS shape profile referenceFormula + have typed : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q := by + rw [newLaw 0, newLaw 1] at forced + exact forced + have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps level T T2 valid closed closed2 indices.family_ground h C E U Rf Rc).2 member + refine ⟨typed, ?_⟩ + exact (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices (d.iso h C) (d.iso h E) (moved h U) (moved h Rf) (moved h Rc) + (moved h u) oldU (moved h w) oldW movedMember q).2 typed + +end TransitiveGround + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (M.codedFamily s) → + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +variable {T2 : ZFSet.{u}} (valid2 : ∀ z ∈ T2, IsName s z) +variable (closed2 : ∀ g (tau : Name s), tau.val ∈ T2 → (a.act s g tau).val ∈ T2) +variable (level : ZFSet.{u}) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include group nodes supports closed closed2 descent indices in +theorem prepared_joint_refinementCollision_of_position_supports (small : M.sets.Countable) + (children : ∀ tau : Name s, tau.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) + (C E : L) (U Rf Rc u w oldU oldW : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (F B f : Fin 2 → ZFSet.{u}) (p q : P) (g h : G) (V A X : L) + (relative : g⁻¹ * h ∈ d.principalFix V) + (qh : q ≤ a.iso h p) (qg : q ≤ a.iso g p) + (overlap : meet A X = d.iso h V) (anchor : d.iso h E ≤ meet A X) + (meetLeft : meet A X ≤ A) (meetRight : meet A X ≤ X) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + let original := ![cls Rc u, cls Rf w] + ∀ (_profiles : ∀ i, F i ⊆ b.carrier) (_bases : ∀ i, B i ⊆ F i) + (_coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) + (_functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) + (_supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) + (_decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (original i).val p) + (_equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (original i).val tau) + (_newPositions : ∀ i : Fin 2, d.principalFix A ≤ + a.stabilizer s (![ (moved h u).val, (moved h w).val ] i)) + (_oldPositions : ∀ i : Fin 2, d.principalFix X ≤ + a.stabilizer s (![oldU.val, oldW.val] i)) + (_single : M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p) + (_reference : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved g u) oldU (moved g w) oldW q), + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + (moved h Rf) (moved h Rc) (moved h u) oldU (moved h w) oldW q ∧ + stageOneRawCollision M (M.refinementLevelFormulaData a s b d level T T2 valid) + (refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (moved h U).val.val (moved h Rf).val.val (moved h Rc).val.val) + (moved h u).val.val oldU.val.val (moved h w).val.val oldW.val.val (s.encode q) := by + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + let newPair : Fin 2 → (M.nameDomain s).names := + ![cls (moved h Rc) (moved h u), cls (moved h Rf) (moved h w)] + let oldPair : Fin 2 → (M.nameDomain s).names := + ![cls (moved h Rc) oldU, cls (moved h Rf) oldW] + dsimp only + intro profiles bases coinitial functions supported decisions equalities newPositions oldPositions single reference + have movedMember := (M.niceRefinementIndex_act_iff a s t b d pairing unions powers separation collection + carrier order maps level T T2 valid closed closed2 indices.family_ground h C E U Rf Rc).2 member + have newSupports := M.niceRefinementClasses_supported_by_block a s b d level T T2 valid valid2 + indices base directed closed children (d.iso h C) (d.iso h E) A + (moved h U) (moved h Rf) (moved h Rc) movedMember (anchor.trans meetLeft) + ![(moved h u).val, (moved h w).val] newPositions + have oldSupports := M.niceRefinementClasses_supported_by_block a s b d level T T2 valid valid2 + indices base directed closed children (d.iso h C) (d.iso h E) X + (moved h U) (moved h Rf) (moved h Rc) movedMember (anchor.trans meetRight) + ![oldU.val, oldW.val] oldPositions + have newFacts : ∀ i, d.principalFix A ≤ a.stabilizer s (newPair i).val ∧ + HereditarilySymmetric a s (d.principalSupportFamily base directed) (newPair i).val := + Fin.cases (newSupports 0) (Fin.cases (newSupports 1) (fun j => Fin.elim0 j)) + have oldFacts : ∀ i, d.principalFix X ≤ a.stabilizer s (oldPair i).val ∧ + HereditarilySymmetric a s (d.principalSupportFamily base directed) (oldPair i).val := + Fin.cases (oldSupports 0) (Fin.cases (oldSupports 1) (fun j => Fin.elim0 j)) + exact M.prepared_joint_refinementCollision_tests a s t b d pairing unions powers separation collection + carrier order group nodes supports maps hT valid closed base directed system meet descent + valid2 closed2 level indices small C E U Rf Rc u w oldU oldW member F B f p q g h V A X + relative qh qg overlap anchor profiles bases coinitial functions supported decisions equalities + (fun i => (newFacts i).1) (fun i => (oldFacts i).1) + (fun i => (newFacts i).2) (fun i => (oldFacts i).2) single reference + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedSelectionProfiles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedSelectionProfiles.lean index 15e49a50aaabb74312edabf5d5f1d09d3fce91f7..3c3d6274c10c23934951cfda5a8d7a3733098913 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedSelectionProfiles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedSelectionProfiles.lean @@ -1,150 +1,150 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparedWitnessSelections -import OAI.SetTheory.PartitionPrinciple.Forcing.PreparedWitnessCertificateGraphs - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -open scoped ZFSet -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def preparedSelectionProfiles (A stages Q nodes T selections : ZFSet.{u}) : ZFSet.{u} := - let W := M.groundRelations T Q - let K := M.groundRelations W (M.supportedEqualityCertificateBound nodes W) - let E := M.groundRelations W (M.synchronizedEnumerationBound nodes W) - let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) - let witnesses := relationImage A L selections - let certificates := relationImage witnesses K (preparedWitnessCertificateGraph stages Q K E) - ⋃₀ relationImage certificates (M.groundPower (M.groundPower nodes)) - (M.certificateProfileImageFamily nodes W) - -theorem preparedSelectionProfiles_ground_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows T stages packed nodes nodeOrder p A selections : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) (hStages : stages ∈ M.sets) - (hPacked : packed ∈ M.sets) (hNodes : nodes ∈ M.sets) - (data : RefinementDataHistory stages packed T) - (selected : selections ⊆ M.preparedWitnessSelections rows T stages packed nodes p A) - (whole : relationImage A (ZFSet.prod stages - (M.preparationWitnessBound nodes T (M.refinementHistoryForcing rows T stages packed))) selections ∈ M.sets) - (small : M.groundEmbeddable (relationImage A (ZFSet.prod stages - (M.preparationWitnessBound nodes T (M.refinementHistoryForcing rows T stages packed))) selections) ZFSet.omega) - (localData : ∀ alpha (fields : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → - fields 10 = nodes ∧ fields 11 = nodeOrder ∧ - fields 14 ⊆ M.groundRelations T (M.refinementHistoryForcing rows T stages packed) ∧ - ∀ sourceRow sourceA, - ZFSet.pair sourceRow sourceA ∈ M.refinementHistoryForcing rows T stages packed → - M.storedPreparationRequests sourceA fields ∈ M.sets ∧ - M.groundEmbeddable (M.storedPreparationRequests sourceA fields) ZFSet.omega) : - let Q := M.refinementHistoryForcing rows T stages packed - let Profiles := M.preparedSelectionProfiles A stages Q nodes T selections - Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ - (∀ F ∈ Profiles, MeetFilterCode nodes nodeOrder (canonicalMeetGraph nodes nodeOrder) F) ∧ - ∀ x alpha sourceRow sourceA k enumerations z F B f, - ZFSet.pair x (ZFSet.pair alpha - (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ selections → - ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → F ∈ Profiles := by - let Q := M.refinementHistoryForcing rows T stages packed - let W := M.groundRelations T Q - let K := M.groundRelations W (M.supportedEqualityCertificateBound nodes W) - let E := M.groundRelations W (M.synchronizedEnumerationBound nodes W) - let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) - let witnesses := relationImage A L selections - let projection := preparedWitnessCertificateGraph stages Q K E - let certificates := relationImage witnesses K projection - let images := relationImage certificates (M.groundPower (M.groundPower nodes)) - (M.certificateProfileImageFamily nodes W) - have omega := M.omega_mem separation infinite - have hQ := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hPacked omega - have hW := M.groundRelations_mem pairing unions powers separation hT hQ - have hK := M.groundRelations_mem pairing unions powers separation hW - (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega) - have hE := M.groundRelations_mem pairing unions powers separation hW - (M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega) - have hProjection := M.preparedWitnessCertificateGraph_mem pairing unions powers separation hStages hQ hK hE - have hCertificates := M.relationImage_mem separation whole hK hProjection - have smallCertificates := M.groundEmbeddable_function_image pairing unions powers separation choice - whole hK omega hProjection (preparedWitnessCertificateGraph_function stages Q K E) small - have hFamily := M.certificateProfileImageFamily_mem pairing unions powers separation collection hNodes hW omega - have hImageBound := M.groundPower_mem powers (M.groundPower_mem powers hNodes) - have familyFunction := M.certificateProfileImageFamily_function pairing unions powers separation hNodes hW omega - have hImages := M.relationImage_mem separation hCertificates hImageBound hFamily - have smallImages := M.groundEmbeddable_function_image pairing unions powers separation choice - hCertificates hImageBound omega hFamily familyFunction smallCertificates - have certificateData (k : ZFSet.{u}) (member : k ∈ certificates) : - ∃ J, J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ J ⊆ W ∧ - ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k ∧ - ∀ F ∈ M.certificateProfileImage J nodes W k, - MeetFilterCode nodes nodeOrder (canonicalMeetGraph nodes nodeOrder) F := by - obtain ⟨_, y, hy, projected⟩ := (mem_relationImage _ _ _ _).1 member - obtain ⟨_, x, _hx, edge⟩ := (mem_relationImage _ _ _ _).1 hy - obtain ⟨_, alpha, _ha, source, hs, enumerations, _he, rfl⟩ := - (pair_mem_preparedWitnessCertificateGraph stages Q K E y k).1 projected - obtain ⟨sourceRow, _, sourceA, _, rfl⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages packed hs) - obtain ⟨_, sourceCondition, _, _, _, fields, stored, _terms, nodeCarrier, _meet, - _assignment, q, _hq, _cut, family⟩ := M.preparedWitnessSelection_entry data (selected edge) - obtain ⟨_nodes, orderEq, nameBound, requests⟩ := localData alpha fields stored - obtain ⟨hJ, smallJ⟩ := requests sourceRow sourceA sourceCondition - have Jbound : M.storedPreparationRequests sourceA fields ⊆ W := by - intro z hz - apply nameBound - rcases ZFSet.mem_union.1 hz with left | right - · exact (mem_relationImage _ _ _ _).1 left |>.1 - · exact (mem_relationImage _ _ _ _).1 right |>.1 - refine ⟨_, hJ, smallJ, Jbound, family.1, ?_⟩ - intro F hF - have aligned := family - rw [nodeCarrier, orderEq] at aligned - exact M.certificateProfileImage_meetFilter aligned hF - have imagesSmall (image : ZFSet.{u}) (member : image ∈ images) : - M.groundEmbeddable image ZFSet.omega := by - obtain ⟨_, k, hk, edge⟩ := (mem_relationImage _ _ _ _).1 member - obtain ⟨_, rfl⟩ := (M.pair_mem_certificateProfileImageFamily nodes W k image).1 edge - obtain ⟨J, hJ, smallJ, Jbound, function, _filters⟩ := certificateData k hk - rw [M.certificateProfileImage_eq_of_domain_subset function Jbound] - exact (M.certificateProfileImage_mem_small pairing unions powers separation choice hJ hNodes hW - (((M.mem_groundRelations _ _ k).1 ((mem_relationImage _ _ _ _).1 hk).1).1) - omega function smallJ).2 - change (⋃₀ images) ∈ M.sets ∧ M.groundEmbeddable (⋃₀ images) ZFSet.omega ∧ _ - refine ⟨M.union_mem unions hImages, - M.groundCountable_family_union pairing unions powers separation infinite choice hImages smallImages imagesSmall, - ?_, ?_⟩ - · intro F member - obtain ⟨image, hi, hF⟩ := ZFSet.mem_sUnion.1 member - obtain ⟨_, k, hk, edge⟩ := (mem_relationImage _ _ _ _).1 hi - obtain ⟨_, rfl⟩ := (M.pair_mem_certificateProfileImageFamily nodes W k image).1 edge - obtain ⟨J, _, _, Jbound, function, filters⟩ := certificateData k hk - apply filters F - exact M.certificateProfileImage_eq_of_domain_subset function Jbound ▸ hF - · intro x alpha sourceRow sourceA k enumerations z F B f edge certificate - have selectedEdge := selected edge - dsimp only [preparedWitnessSelections, retainedPreparationSelections] at selectedEdge - have bounded := (ZFSet.mem_sep.1 selectedEdge).1 - have pairBounds := ZFSet.pair_mem_prod.1 bounded - have yBound := ZFSet.pair_mem_prod.1 pairBounds.2 - have outputBound := ZFSet.pair_mem_prod.1 yBound.2 - have tailBound := ZFSet.pair_mem_prod.1 outputBound.2 - have hk : k ∈ certificates := (mem_relationImage _ _ _ _).2 ⟨tailBound.1, - _, (mem_relationImage _ _ _ _).2 ⟨pairBounds.2, x, pairBounds.1, edge⟩, - (pair_mem_preparedWitnessCertificateGraph stages Q K E _ k).2 - ⟨tailBound.1, alpha, yBound.1, _, outputBound.1, enumerations, tailBound.2, rfl⟩⟩ - obtain ⟨J, _, _, Jbound, function, _⟩ := certificateData k hk - have familyEdge := (M.pair_mem_certificateProfileImageFamily nodes W k _).2 ⟨tailBound.1, rfl⟩ - have imageBound := (ZFSet.pair_mem_prod.1 (familyFunction.1 familyEdge)).2 - refine ZFSet.mem_sUnion.2 ⟨_, (mem_relationImage _ _ _ _).2 ⟨imageBound, k, hk, familyEdge⟩, ?_⟩ - rw [M.certificateProfileImage_eq_of_domain_subset function Jbound] - exact (M.mem_certificateProfileImage function F).2 ⟨z, B, f, certificate⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparedWitnessSelections +import OAI.SetTheory.PartitionPrinciple.Forcing.PreparedWitnessCertificateGraphs + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +open scoped ZFSet +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def preparedSelectionProfiles (A stages Q nodes T selections : ZFSet.{u}) : ZFSet.{u} := + let W := M.groundRelations T Q + let K := M.groundRelations W (M.supportedEqualityCertificateBound nodes W) + let E := M.groundRelations W (M.synchronizedEnumerationBound nodes W) + let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) + let witnesses := relationImage A L selections + let certificates := relationImage witnesses K (preparedWitnessCertificateGraph stages Q K E) + ⋃₀ relationImage certificates (M.groundPower (M.groundPower nodes)) + (M.certificateProfileImageFamily nodes W) + +theorem preparedSelectionProfiles_ground_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows T stages packed nodes nodeOrder p A selections : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) (hStages : stages ∈ M.sets) + (hPacked : packed ∈ M.sets) (hNodes : nodes ∈ M.sets) + (data : RefinementDataHistory stages packed T) + (selected : selections ⊆ M.preparedWitnessSelections rows T stages packed nodes p A) + (whole : relationImage A (ZFSet.prod stages + (M.preparationWitnessBound nodes T (M.refinementHistoryForcing rows T stages packed))) selections ∈ M.sets) + (small : M.groundEmbeddable (relationImage A (ZFSet.prod stages + (M.preparationWitnessBound nodes T (M.refinementHistoryForcing rows T stages packed))) selections) ZFSet.omega) + (localData : ∀ alpha (fields : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → + fields 10 = nodes ∧ fields 11 = nodeOrder ∧ + fields 14 ⊆ M.groundRelations T (M.refinementHistoryForcing rows T stages packed) ∧ + ∀ sourceRow sourceA, + ZFSet.pair sourceRow sourceA ∈ M.refinementHistoryForcing rows T stages packed → + M.storedPreparationRequests sourceA fields ∈ M.sets ∧ + M.groundEmbeddable (M.storedPreparationRequests sourceA fields) ZFSet.omega) : + let Q := M.refinementHistoryForcing rows T stages packed + let Profiles := M.preparedSelectionProfiles A stages Q nodes T selections + Profiles ∈ M.sets ∧ M.groundEmbeddable Profiles ZFSet.omega ∧ + (∀ F ∈ Profiles, MeetFilterCode nodes nodeOrder (canonicalMeetGraph nodes nodeOrder) F) ∧ + ∀ x alpha sourceRow sourceA k enumerations z F B f, + ZFSet.pair x (ZFSet.pair alpha + (ZFSet.pair (ZFSet.pair sourceRow sourceA) (ZFSet.pair k enumerations))) ∈ selections → + ZFSet.pair z (ZFSet.pair F (ZFSet.pair B f)) ∈ k → F ∈ Profiles := by + let Q := M.refinementHistoryForcing rows T stages packed + let W := M.groundRelations T Q + let K := M.groundRelations W (M.supportedEqualityCertificateBound nodes W) + let E := M.groundRelations W (M.synchronizedEnumerationBound nodes W) + let L := ZFSet.prod stages (M.preparationWitnessBound nodes T Q) + let witnesses := relationImage A L selections + let projection := preparedWitnessCertificateGraph stages Q K E + let certificates := relationImage witnesses K projection + let images := relationImage certificates (M.groundPower (M.groundPower nodes)) + (M.certificateProfileImageFamily nodes W) + have omega := M.omega_mem separation infinite + have hQ := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hPacked omega + have hW := M.groundRelations_mem pairing unions powers separation hT hQ + have hK := M.groundRelations_mem pairing unions powers separation hW + (M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega) + have hE := M.groundRelations_mem pairing unions powers separation hW + (M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega) + have hProjection := M.preparedWitnessCertificateGraph_mem pairing unions powers separation hStages hQ hK hE + have hCertificates := M.relationImage_mem separation whole hK hProjection + have smallCertificates := M.groundEmbeddable_function_image pairing unions powers separation choice + whole hK omega hProjection (preparedWitnessCertificateGraph_function stages Q K E) small + have hFamily := M.certificateProfileImageFamily_mem pairing unions powers separation collection hNodes hW omega + have hImageBound := M.groundPower_mem powers (M.groundPower_mem powers hNodes) + have familyFunction := M.certificateProfileImageFamily_function pairing unions powers separation hNodes hW omega + have hImages := M.relationImage_mem separation hCertificates hImageBound hFamily + have smallImages := M.groundEmbeddable_function_image pairing unions powers separation choice + hCertificates hImageBound omega hFamily familyFunction smallCertificates + have certificateData (k : ZFSet.{u}) (member : k ∈ certificates) : + ∃ J, J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ J ⊆ W ∧ + ZFSet.IsFunc J (M.supportedEqualityCertificateBound nodes W) k ∧ + ∀ F ∈ M.certificateProfileImage J nodes W k, + MeetFilterCode nodes nodeOrder (canonicalMeetGraph nodes nodeOrder) F := by + obtain ⟨_, y, hy, projected⟩ := (mem_relationImage _ _ _ _).1 member + obtain ⟨_, x, _hx, edge⟩ := (mem_relationImage _ _ _ _).1 hy + obtain ⟨_, alpha, _ha, source, hs, enumerations, _he, rfl⟩ := + (pair_mem_preparedWitnessCertificateGraph stages Q K E y k).1 projected + obtain ⟨sourceRow, _, sourceA, _, rfl⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages packed hs) + obtain ⟨_, sourceCondition, _, _, _, fields, stored, _terms, nodeCarrier, _meet, + _assignment, q, _hq, _cut, family⟩ := M.preparedWitnessSelection_entry data (selected edge) + obtain ⟨_nodes, orderEq, nameBound, requests⟩ := localData alpha fields stored + obtain ⟨hJ, smallJ⟩ := requests sourceRow sourceA sourceCondition + have Jbound : M.storedPreparationRequests sourceA fields ⊆ W := by + intro z hz + apply nameBound + rcases ZFSet.mem_union.1 hz with left | right + · exact (mem_relationImage _ _ _ _).1 left |>.1 + · exact (mem_relationImage _ _ _ _).1 right |>.1 + refine ⟨_, hJ, smallJ, Jbound, family.1, ?_⟩ + intro F hF + have aligned := family + rw [nodeCarrier, orderEq] at aligned + exact M.certificateProfileImage_meetFilter aligned hF + have imagesSmall (image : ZFSet.{u}) (member : image ∈ images) : + M.groundEmbeddable image ZFSet.omega := by + obtain ⟨_, k, hk, edge⟩ := (mem_relationImage _ _ _ _).1 member + obtain ⟨_, rfl⟩ := (M.pair_mem_certificateProfileImageFamily nodes W k image).1 edge + obtain ⟨J, hJ, smallJ, Jbound, function, _filters⟩ := certificateData k hk + rw [M.certificateProfileImage_eq_of_domain_subset function Jbound] + exact (M.certificateProfileImage_mem_small pairing unions powers separation choice hJ hNodes hW + (((M.mem_groundRelations _ _ k).1 ((mem_relationImage _ _ _ _).1 hk).1).1) + omega function smallJ).2 + change (⋃₀ images) ∈ M.sets ∧ M.groundEmbeddable (⋃₀ images) ZFSet.omega ∧ _ + refine ⟨M.union_mem unions hImages, + M.groundCountable_family_union pairing unions powers separation infinite choice hImages smallImages imagesSmall, + ?_, ?_⟩ + · intro F member + obtain ⟨image, hi, hF⟩ := ZFSet.mem_sUnion.1 member + obtain ⟨_, k, hk, edge⟩ := (mem_relationImage _ _ _ _).1 hi + obtain ⟨_, rfl⟩ := (M.pair_mem_certificateProfileImageFamily nodes W k image).1 edge + obtain ⟨J, _, _, Jbound, function, filters⟩ := certificateData k hk + apply filters F + exact M.certificateProfileImage_eq_of_domain_subset function Jbound ▸ hF + · intro x alpha sourceRow sourceA k enumerations z F B f edge certificate + have selectedEdge := selected edge + dsimp only [preparedWitnessSelections, retainedPreparationSelections] at selectedEdge + have bounded := (ZFSet.mem_sep.1 selectedEdge).1 + have pairBounds := ZFSet.pair_mem_prod.1 bounded + have yBound := ZFSet.pair_mem_prod.1 pairBounds.2 + have outputBound := ZFSet.pair_mem_prod.1 yBound.2 + have tailBound := ZFSet.pair_mem_prod.1 outputBound.2 + have hk : k ∈ certificates := (mem_relationImage _ _ _ _).2 ⟨tailBound.1, + _, (mem_relationImage _ _ _ _).2 ⟨pairBounds.2, x, pairBounds.1, edge⟩, + (pair_mem_preparedWitnessCertificateGraph stages Q K E _ k).2 + ⟨tailBound.1, alpha, yBound.1, _, outputBound.1, enumerations, tailBound.2, rfl⟩⟩ + obtain ⟨J, _, _, Jbound, function, _⟩ := certificateData k hk + have familyEdge := (M.pair_mem_certificateProfileImageFamily nodes W k _).2 ⟨tailBound.1, rfl⟩ + have imageBound := (ZFSet.pair_mem_prod.1 (familyFunction.1 familyEdge)).2 + refine ZFSet.mem_sUnion.2 ⟨_, (mem_relationImage _ _ _ _).2 ⟨imageBound, k, hk, familyEdge⟩, ?_⟩ + rw [M.certificateProfileImage_eq_of_domain_subset function Jbound] + exact (M.mem_certificateProfileImage function F).2 ⟨z, B, f, certificate⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedStructuralInsertionCollisions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedStructuralInsertionCollisions.lean index f221f8cc42f26c1cd4ae1160cc46c6468d9cceaa..2b22f866b472c382ad7361d386222bbc68324656 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedStructuralInsertionCollisions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPreparedStructuralInsertionCollisions.lean @@ -1,376 +1,376 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedAlignedReferenceCollisions - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -include group nodes supports hT closed in -theorem prepared_insertion_collision_forces (small : M.sets.Countable) - (F B f : Fin 2 → ZFSet.{u}) (z y : Fin 2 → (M.nameDomain s).names) (p q : P) - (profiles : ∀ i, F i ⊆ b.carrier) (bases : ∀ i, B i ⊆ F i) - (coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) - (functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) - (supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) - (decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (z i).val p) - (equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, - tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → - ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (z i).val tau) - (h : G) (C K : L) (fixed : h ∈ d.principalFix C) - (qp : q ≤ p) (qh : q ≤ a.iso h p) - (good : ∀ i, b.encode C ∉ F i → b.encode K ∉ F i) - (translatedSupport : ∀ i, d.principalFix K ≤ a.stabilizer s (y i).val) - (translatedShape : ∀ i, (y i).val.val ⊆ ZFSet.prod T s.carrier) - (profileTest : Forces (M.nameDomain s) refinementProfileFormula - ![z 0, z 1, M.stageOneVisibilityName s valid a b d base directed system C] q) : - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - Forces (M.nameDomain s) refinementCollisionFormula - ![moved h (z 0), y 0, moved h (z 1), y 1] q → - Forces (M.nameDomain s) refinementCollisionFormula ![z 0, y 0, z 1, y 1] q := by - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps - dsimp only - intro referenceTest - let env : Assignment (M.nameDomain s) 4 := ![z 0, y 0, z 1, y 1] - let reference : Assignment (M.nameDomain s) 4 := ![moved h (z 0), y 0, moved h (z 1), y 1] - apply (M.ordinaryForces_iff_all_generics s small carrier refinementCollisionFormula env q).2 - intro H hq generic - let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {r | H.mem r}, - (M.nameDomain s).values_transitive _⟩ - let vis (V : L) : (M.nameDomain s).names := - M.stageOneVisibilityName s valid a b d base directed system V - have profileMeaning (i : Fin 2) (V : L) : - b.encode V ∈ F i ↔ Name.eval {r | H.mem r} (z i).val ∈ - Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix V)) := by - by_cases member : b.encode V ∈ F i - · have positive : Forces (M.nameDomain s) (.mem 0 1 : SetFormula 2) ![z i, vis V] p := - (decisions i V).1 member - have truth := forces_sound (M.nameDomain s) H generic (.mem 0 1 : SetFormula 2) - ![z i, vis V] (H.upward hq qp) positive - exact ⟨fun _ => truth, fun _ => member⟩ - · have negative : Forces (M.nameDomain s) (.neg (.mem 0 1) : SetFormula 2) ![z i, vis V] p := - (decisions i V).2 member - have truth := forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1) : SetFormula 2) - ![z i, vis V] (H.upward hq qp) negative - exact ⟨fun yes => False.elim (member yes), fun yes => False.elim (truth yes)⟩ - have pairProfile := (N.realize_refinementProfileFormula - (evalAssignment {r | H.mem r} ![z 0, z 1, vis C]) - (fun i => ⟨(![z 0, z 1, vis C] : Assignment (M.nameDomain s) 3) i, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic refinementProfileFormula ![z 0, z 1, vis C] - hq profileTest) - change (Name.eval {r | H.mem r} (z 0).val ∈ Name.eval {r | H.mem r} - (M.niceVisibilityName a s T (d.principalFix C)) ↔ - Name.eval {r | H.mem r} (z 1).val ∈ Name.eval {r | H.mem r} - (M.niceVisibilityName a s T (d.principalFix C))) at pairProfile - have pairMembers : b.encode C ∈ F 0 ↔ b.encode C ∈ F 1 := - (profileMeaning 0 C).trans (pairProfile.trans (profileMeaning 1 C).symm) - have referenceCollision := (N.realize_refinementCollisionFormula - (evalAssignment {r | H.mem r} reference) (fun i => ⟨reference i, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic refinementCollisionFormula reference hq referenceTest) - change (Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ - Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) - at referenceCollision - apply (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} env) - (fun i => ⟨env i, rfl⟩)).2 - change (Name.eval {r | H.mem r} (z 0).val = Name.eval {r | H.mem r} (y 0).val ↔ - Name.eval {r | H.mem r} (z 1).val = Name.eval {r | H.mem r} (y 1).val) - by_cases member : b.encode C ∈ F 0 - · have both : ∀ i, b.encode C ∈ F i := - fun i => Fin.cases member (fun j => Fin.cases (pairMembers.1 member) (fun k => Fin.elim0 k) j) i - have same (i : Fin 2) : Name.eval {r | H.mem r} (z i).val = - Name.eval {r | H.mem r} (moved h (z i)).val := by - have relative : h⁻¹ * 1 ∈ d.principalFix C := by - simpa only [mul_one] using (d.principalFix C).inv_mem fixed - have visible : Name.eval {r | H.mem r} (a.act s 1 (z i).val) ∈ - Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso 1 C))) := by - simpa only [a.act_one, d.one] using (profileMeaning i C).1 (both i) - have result := M.preparedValue_eval_agreement a s t b d pairing unions powers separation - collection carrier group nodes supports maps hT valid closed (F i) (B i) (f i) (z i) - p q (profiles i) (bases i) (coinitial i) (functions i) (supported i) (decisions i) - (equalities i) h 1 C relative (by simpa only [a.one] using qp) qh H generic hq visible - simpa only [a.act_one, moved, stageOneNameAction_val] using result - exact ⟨fun first => (same 1).trans (referenceCollision.1 ((same 0).symm.trans first)), - fun second => (same 0).trans (referenceCollision.2 ((same 1).symm.trans second))⟩ - · have absent : ∀ i, b.encode C ∉ F i := - fun i => Fin.cases member (fun j => Fin.cases (fun yes => member (pairMembers.2 yes)) (fun k => Fin.elim0 k) j) i - have different (i : Fin 2) : Name.eval {r | H.mem r} (z i).val ≠ - Name.eval {r | H.mem r} (y i).val := by - intro equal - have visible := system.normalization_visible K (y i) (translatedSupport i) H generic - (Name.eval_subset_familySet_of_code_subset H T valid (y i).val (translatedShape i)) - exact good i (absent i) ((profileMeaning i K).2 (equal.symm ▸ visible)) - exact ⟨fun first => False.elim (different 0 first), fun second => False.elim (different 1 second)⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u - -private theorem anchor_of_dataBound {L : Type u} [PartialOrder L] - (b : Presentation L) (I level T S mu X tuples A : ZFSet.{u}) - (C E D : L) (U Rf Rc u w : ZFSet.{u}) - (bound : ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) u w) (b.encode D) ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples) : E ≤ D := by - obtain ⟨_, _, _, _, _, rawE, _, fu, _hfu, fw, _hfw, edge, lower, _rest⟩ := - (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples _ u w (b.encode D)).1 bound - have same : rawE = b.encode E := - ((refinementIndexFieldGraph_entry I b.carrier ![level, b.encode C, b.encode E, U, Rf, Rc] - 2 rawE).1 edge).2.2 - subst rawE - exact (b.pair_mem_conditionOrder E D).1 lower - -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (level T T2 : ZFSet.{u}) -variable (system : RefinementStageSystem M a s t b d base directed level T T2) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -include system pairing unions powers separation collection carrier order group nodes supports hLevel hT - -theorem structuralAssignment_insertion_reference - {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t)) ∈ history) - (I S mu positions tuples sourceA : ZFSet.{u}) - (h : G) (D K V C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 system.valid1) - (hu : u.val ∈ T) (hw : w.val ∈ T) - (source : stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val w.val ∈ sourceA) - (newU newW : ZFSet.{u}) - (bound : ZFSet.pair (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - newU newW) (b.encode (d.iso h D)) ∈ stageOneDataBounds - (M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA) - I T S b.carrier mu positions b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) - (cap : d.iso h D ≤ K) (avoid : E ≤ K → E ≤ V) (fixed : h ∈ d.principalFix V) : - E ≤ V ∧ - refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∧ - ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val)) - (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - (a.act s h u).val (a.act s h w).val) ∈ - M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history ∧ - stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - (a.act s h u).val (a.act s h w).val ∈ - M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA := by - let image := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA - have below : E ≤ d.iso h D := anchor_of_dataBound b I level T S mu positions tuples image - C E (d.iso h D) U.val.val Rf.val.val Rc.val.val newU newW bound - have anchor := avoid (below.trans cap) - have same := M.niceRefinementIndex_copies_agree a s b d level T T2 system.valid1 system.valid2 - system.indices C E U Rf Rc index 1 h V anchor (by simpa only [inv_one, one_mul] using fixed) - simp only [d.one, a.act_one] at same - let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let z := stageOneAssignment idx u.val w.val - let target := stageOneAssignment idx (a.act s h u).val (a.act s h w).val - have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2 - have branchMember : z ∈ stageOneAssignments - (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by - rw [dataEq] - exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨index, hu, hw⟩ - have graphEq := M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers - separation collection carrier group nodes order system.inputs.condition_maps system.inputs.node_maps - supports level T T2 hLevel hT system.valid1 system.valid2 system.inputs.terms_closed - system.inputs.pairs_closed system.inputs.family_ground system.indices.index_ground - have branch := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 - system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier - order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground - h C E U Rf Rc u w index hu hw target).2 - (congrArg (fun i => stageOneAssignment i (a.act s h u).val (a.act s h w).val) same.symm) - rw [← graphEq h] at branch - have edge := (M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored - branchMember (t.encode h) target).2 ⟨t.encode_mem h, branch⟩ - exact ⟨anchor, same, edge, - (M.structuralAssignmentImage_entry t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA target).2 - ⟨z, source, edge⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (level T T2 : ZFSet.{u}) -variable (system : RefinementStageSystem M a s t b d base directed level T T2) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -include system pairing unions powers separation collection carrier order group nodes supports hLevel hT - -theorem structuralAssignment_prepared_insertion_collision - (small : M.sets.Countable) - {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t)) ∈ history) - (I S mu positions tuples sourceA : ZFSet.{u}) - (positionSupport : ∀ (D : L), ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu positions b.conditionOrder f (b.encode D) → - d.principalFix D ≤ a.stabilizer s u) - (h : G) (D K V C E : L) (U Rf Rc u w newU newW : (M.nameDomain s).names) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 system.valid1) - (hu : u.val.val ∈ T) (hw : w.val.val ∈ T) - (hNewU : newU.val.val ∈ T) (hNewW : newW.val.val ∈ T) - (p q : P) (qp : q ≤ p) (qh : q ≤ a.iso h p) - (fixed : h ∈ d.principalFix V) (cap : d.iso h D ≤ K) - (avoid : E ≤ K → E ≤ V) (F B f e names : Fin 2 → ZFSet.{u}) - (good : ∀ i, b.encode V ∉ F i → b.encode K ∉ F i) : - let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 - let image := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 - let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - stageOneAssignment idx u.val.val w.val.val ∈ sourceA → - ZFSet.pair (stageOneAssignment idx newU.val.val newW.val.val) (b.encode (d.iso h D)) ∈ - stageOneDataBounds image I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples → - stageOneRawTests M fields sourceA (s.encode p) → stageOneRawTests M fields image (s.encode q) → - (∀ i : Fin 2, PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) - b.carrier b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) - (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) - ZFSet.omega ((![cls Rc u, cls Rf w] : Fin 2 → (M.nameDomain s).names) i).val.val - (F i) (B i) (f i) (e i) (names i)) → - E ≤ V ∧ - stageOneRawCollision M fields idx u.val.val newU.val.val w.val.val newW.val.val (s.encode q) ∧ - stageOneRawCollision M fields idx newU.val.val u.val.val newW.val.val w.val.val (s.encode q) := by - let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 - let image := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA - let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier system.inputs.condition_maps - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 - let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let original : Fin 2 → (M.nameDomain s).names := ![cls Rc u, cls Rf w] - let translated : Fin 2 → (M.nameDomain s).names := ![cls Rc newU, cls Rf newW] - dsimp only - intro source bound sourceTests translatedTests certificates - have reference := M.structuralAssignment_insertion_reference a s t b d base directed level T T2 - system pairing unions powers separation collection carrier order group nodes supports hLevel hT - function stored I S mu positions tuples sourceA h D K V C E U Rf Rc u.val w.val index hu hw - source newU.val.val newW.val.val bound cap avoid fixed - have parts := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 reference.2.1 - have fine : moved h Rf = Rf := Subtype.ext (Subtype.ext parts.2.2.2.2.1) - have coarse : moved h Rc = Rc := Subtype.ext (Subtype.ext parts.2.2.2.2.2) - obtain ⟨newMember, _, _, _, _, rawE, _, fu, hfu, fw, hfw, anchorEdge, below, - tu, tw, bu, bw⟩ := - (stageOneDataBounds_assignment_entry image I T S b.carrier mu positions b.conditionOrder - (refinementIndexFieldGraph I b.carrier 2) tuples idx newU.val.val newW.val.val - (b.encode (d.iso h D))).1 bound - have sameAnchor : rawE = b.encode E := - ((refinementIndexFieldGraph_entry I b.carrier - ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] 2 rawE).1 anchorEdge).2.2 - have belowCap : E ≤ K := ((b.pair_mem_conditionOrder E (d.iso h D)).1 (sameAnchor ▸ below)).trans cap - have positions : ∀ i : Fin 2, d.principalFix K ≤ - a.stabilizer s ((![newU, newW] : Fin 2 → (M.nameDomain s).names) i).val := by - have first := le_trans (d.principalFix_antitone cap) - (positionSupport (d.iso h D) fu hfu newU.val tu bu) - have second := le_trans (d.principalFix_antitone cap) - (positionSupport (d.iso h D) fw hfw newW.val tw bw) - exact Fin.cases first (Fin.cases second (fun j => Fin.elim0 j)) - have classes := M.niceRefinementClasses_supported_by_block a s b d level T T2 - system.valid1 system.valid2 system.indices base directed system.inputs.terms_closed system.terms_hs - C E K U Rf Rc index belowCap ![newU.val, newW.val] - (Fin.cases (positions 0) (Fin.cases (positions 1) (fun j => Fin.elim0 j))) - have single := (M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection - carrier order nodes hT system.valid1 system.indices base directed system.first C E U Rf Rc u w index p).1 - (sourceTests.1 idx index u.val.val hu w.val.val hw source) - have profile : Forces (M.nameDomain s) refinementProfileFormula - ![original 0, original 1, M.stageOneVisibilityName s system.valid1 a b d base directed system.first V] q := - forces_mono (M.nameDomain s) _ _ (single.2.1 V reference.1) qp - have referenceRaw := translatedTests.2 idx index - (moved h u).val.val (system.inputs.terms_closed h u.val hu) newU.val.val hNewU - (moved h w).val.val (system.inputs.terms_closed h w.val hw) newW.val.val hNewW - reference.2.2.2 newMember - have referenceTyped := (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation - collection carrier order hT system.valid1 system.indices C E U Rf Rc - (moved h u) newU (moved h w) newW index q).1 referenceRaw - have classLaw (R v : (M.nameDomain s).names) : moved h (cls R v) = cls (moved h R) (moved h v) := - M.stageOneNameAction_class a s t pairing unions powers separation collection carrier - system.inputs.condition_maps order hT system.valid1 system.inputs.terms_closed h R v - have referenceFormula : Forces (M.nameDomain s) refinementCollisionFormula - ![moved h (original 0), translated 0, moved h (original 1), translated 1] q := by - change Forces (M.nameDomain s) refinementCollisionFormula - ![moved h (cls Rc u), cls Rc newU, moved h (cls Rf w), cls Rf newW] q - rw [classLaw Rc u, classLaw Rf w, fine, coarse] - exact referenceTyped - have recognized (i : Fin 2) := M.preparedCertificateCode_typed a s b T d.principalFix pairing unions powers - separation collection carrier order hT system.valid1 system.first.visibility_graph_ground - b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) ZFSet.omega - (original i) p (F i) (B i) (f i) (e i) (names i) (certificates i) - have forced := M.prepared_insertion_collision_forces a s t b d pairing unions powers separation collection - carrier group nodes supports system.inputs.condition_maps hT system.valid1 system.inputs.terms_closed - base directed system.first small F B f original translated p q - (fun i => (recognized i).1.subset) (fun i => (recognized i).2.1.1) - (fun i => (recognized i).2.1.2) (fun i => (recognized i).2.2.2.1.1) - (fun i => (recognized i).2.2.2.2.1) (fun i => (recognized i).2.2.2.2.2.1) - (fun i => (recognized i).2.2.2.2.2.2) h V K fixed qp qh good - (Fin.cases (classes 0).1 (Fin.cases (classes 1).1 (fun j => Fin.elim0 j))) - (Fin.cases (Name.refinementClass_subset T system.valid1 Rc.val newU.val) - (Fin.cases (Name.refinementClass_subset T system.valid1 Rf.val newW.val) (fun j => Fin.elim0 j))) - profile referenceFormula - have typed : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT system.valid1 - Rf Rc u newU w newW q := forced - exact ⟨reference.1, M.refinementLevelRawCollision_both_orders s pairing unions powers separation collection - carrier order hT system.valid1 a b d level T2 system.indices C E U Rf Rc u newU w newW index q typed⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparedAlignedReferenceCollisions + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [Group G] [PartialOrder L] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (tau : Name s), tau.val ∈ T → (a.act s g tau).val ∈ T) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +include group nodes supports hT closed in +theorem prepared_insertion_collision_forces (small : M.sets.Countable) + (F B f : Fin 2 → ZFSet.{u}) (z y : Fin 2 → (M.nameDomain s).names) (p q : P) + (profiles : ∀ i, F i ⊆ b.carrier) (bases : ∀ i, B i ⊆ F i) + (coinitial : ∀ i, ∀ x ∈ F i, ∃ v ∈ B i, ZFSet.pair v x ∈ b.conditionOrder) + (functions : ∀ i, ZFSet.IsFunc (B i) (M.niceSupportNameCodes a s T d.principalFix) (f i)) + (supported : ∀ i, f i ⊆ M.niceSupportRelation a s b T d.principalFix) + (decisions : ∀ i, M.DecidesVisibilityProfile a s b d.principalFix T (F i) (z i).val p) + (equalities : ∀ i, ∀ v ∈ B i, ∀ tau : Name s, + tau.val ∈ M.niceSupportNameCodes a s T d.principalFix → + ZFSet.pair v tau.val ∈ f i → Name.ForcesEq p (z i).val tau) + (h : G) (C K : L) (fixed : h ∈ d.principalFix C) + (qp : q ≤ p) (qh : q ≤ a.iso h p) + (good : ∀ i, b.encode C ∉ F i → b.encode K ∉ F i) + (translatedSupport : ∀ i, d.principalFix K ≤ a.stabilizer s (y i).val) + (translatedShape : ∀ i, (y i).val.val ⊆ ZFSet.prod T s.carrier) + (profileTest : Forces (M.nameDomain s) refinementProfileFormula + ![z 0, z 1, M.stageOneVisibilityName s valid a b d base directed system C] q) : + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + Forces (M.nameDomain s) refinementCollisionFormula + ![moved h (z 0), y 0, moved h (z 1), y 1] q → + Forces (M.nameDomain s) refinementCollisionFormula ![z 0, y 0, z 1, y 1] q := by + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier maps + dsimp only + intro referenceTest + let env : Assignment (M.nameDomain s) 4 := ![z 0, y 0, z 1, y 1] + let reference : Assignment (M.nameDomain s) 4 := ![moved h (z 0), y 0, moved h (z 1), y 1] + apply (M.ordinaryForces_iff_all_generics s small carrier refinementCollisionFormula env q).2 + intro H hq generic + let N : TransitiveGround.{u} := ⟨(M.nameDomain s).values {r | H.mem r}, + (M.nameDomain s).values_transitive _⟩ + let vis (V : L) : (M.nameDomain s).names := + M.stageOneVisibilityName s valid a b d base directed system V + have profileMeaning (i : Fin 2) (V : L) : + b.encode V ∈ F i ↔ Name.eval {r | H.mem r} (z i).val ∈ + Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix V)) := by + by_cases member : b.encode V ∈ F i + · have positive : Forces (M.nameDomain s) (.mem 0 1 : SetFormula 2) ![z i, vis V] p := + (decisions i V).1 member + have truth := forces_sound (M.nameDomain s) H generic (.mem 0 1 : SetFormula 2) + ![z i, vis V] (H.upward hq qp) positive + exact ⟨fun _ => truth, fun _ => member⟩ + · have negative : Forces (M.nameDomain s) (.neg (.mem 0 1) : SetFormula 2) ![z i, vis V] p := + (decisions i V).2 member + have truth := forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1) : SetFormula 2) + ![z i, vis V] (H.upward hq qp) negative + exact ⟨fun yes => False.elim (member yes), fun yes => False.elim (truth yes)⟩ + have pairProfile := (N.realize_refinementProfileFormula + (evalAssignment {r | H.mem r} ![z 0, z 1, vis C]) + (fun i => ⟨(![z 0, z 1, vis C] : Assignment (M.nameDomain s) 3) i, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic refinementProfileFormula ![z 0, z 1, vis C] + hq profileTest) + change (Name.eval {r | H.mem r} (z 0).val ∈ Name.eval {r | H.mem r} + (M.niceVisibilityName a s T (d.principalFix C)) ↔ + Name.eval {r | H.mem r} (z 1).val ∈ Name.eval {r | H.mem r} + (M.niceVisibilityName a s T (d.principalFix C))) at pairProfile + have pairMembers : b.encode C ∈ F 0 ↔ b.encode C ∈ F 1 := + (profileMeaning 0 C).trans (pairProfile.trans (profileMeaning 1 C).symm) + have referenceCollision := (N.realize_refinementCollisionFormula + (evalAssignment {r | H.mem r} reference) (fun i => ⟨reference i, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic refinementCollisionFormula reference hq referenceTest) + change (Name.eval {r | H.mem r} (moved h (z 0)).val = Name.eval {r | H.mem r} (y 0).val ↔ + Name.eval {r | H.mem r} (moved h (z 1)).val = Name.eval {r | H.mem r} (y 1).val) + at referenceCollision + apply (N.realize_refinementCollisionFormula (evalAssignment {r | H.mem r} env) + (fun i => ⟨env i, rfl⟩)).2 + change (Name.eval {r | H.mem r} (z 0).val = Name.eval {r | H.mem r} (y 0).val ↔ + Name.eval {r | H.mem r} (z 1).val = Name.eval {r | H.mem r} (y 1).val) + by_cases member : b.encode C ∈ F 0 + · have both : ∀ i, b.encode C ∈ F i := + fun i => Fin.cases member (fun j => Fin.cases (pairMembers.1 member) (fun k => Fin.elim0 k) j) i + have same (i : Fin 2) : Name.eval {r | H.mem r} (z i).val = + Name.eval {r | H.mem r} (moved h (z i)).val := by + have relative : h⁻¹ * 1 ∈ d.principalFix C := by + simpa only [mul_one] using (d.principalFix C).inv_mem fixed + have visible : Name.eval {r | H.mem r} (a.act s 1 (z i).val) ∈ + Name.eval {r | H.mem r} (M.niceVisibilityName a s T (d.principalFix (d.iso 1 C))) := by + simpa only [a.act_one, d.one] using (profileMeaning i C).1 (both i) + have result := M.preparedValue_eval_agreement a s t b d pairing unions powers separation + collection carrier group nodes supports maps hT valid closed (F i) (B i) (f i) (z i) + p q (profiles i) (bases i) (coinitial i) (functions i) (supported i) (decisions i) + (equalities i) h 1 C relative (by simpa only [a.one] using qp) qh H generic hq visible + simpa only [a.act_one, moved, stageOneNameAction_val] using result + exact ⟨fun first => (same 1).trans (referenceCollision.1 ((same 0).symm.trans first)), + fun second => (same 0).trans (referenceCollision.2 ((same 1).symm.trans second))⟩ + · have absent : ∀ i, b.encode C ∉ F i := + fun i => Fin.cases member (fun j => Fin.cases (fun yes => member (pairMembers.2 yes)) (fun k => Fin.elim0 k) j) i + have different (i : Fin 2) : Name.eval {r | H.mem r} (z i).val ≠ + Name.eval {r | H.mem r} (y i).val := by + intro equal + have visible := system.normalization_visible K (y i) (translatedSupport i) H generic + (Name.eval_subset_familySet_of_code_subset H T valid (y i).val (translatedShape i)) + exact good i (absent i) ((profileMeaning i K).2 (equal.symm ▸ visible)) + exact ⟨fun first => False.elim (different 0 first), fun second => False.elim (different 1 second)⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u + +private theorem anchor_of_dataBound {L : Type u} [PartialOrder L] + (b : Presentation L) (I level T S mu X tuples A : ZFSet.{u}) + (C E D : L) (U Rf Rc u w : ZFSet.{u}) + (bound : ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) u w) (b.encode D) ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples) : E ≤ D := by + obtain ⟨_, _, _, _, _, rawE, _, fu, _hfu, fw, _hfw, edge, lower, _rest⟩ := + (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples _ u w (b.encode D)).1 bound + have same : rawE = b.encode E := + ((refinementIndexFieldGraph_entry I b.carrier ![level, b.encode C, b.encode E, U, Rf, Rc] + 2 rawE).1 edge).2.2 + subst rawE + exact (b.pair_mem_conditionOrder E D).1 lower + +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (level T T2 : ZFSet.{u}) +variable (system : RefinementStageSystem M a s t b d base directed level T T2) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +include system pairing unions powers separation collection carrier order group nodes supports hLevel hT + +theorem structuralAssignment_insertion_reference + {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t)) ∈ history) + (I S mu positions tuples sourceA : ZFSet.{u}) + (h : G) (D K V C E : L) (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 system.valid1) + (hu : u.val ∈ T) (hw : w.val ∈ T) + (source : stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val w.val ∈ sourceA) + (newU newW : ZFSet.{u}) + (bound : ZFSet.pair (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + newU newW) (b.encode (d.iso h D)) ∈ stageOneDataBounds + (M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA) + I T S b.carrier mu positions b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) + (cap : d.iso h D ≤ K) (avoid : E ≤ K → E ≤ V) (fixed : h ∈ d.principalFix V) : + E ≤ V ∧ + refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val = + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∧ + ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) u.val w.val)) + (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + (a.act s h u).val (a.act s h w).val) ∈ + M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history ∧ + stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + (a.act s h u).val (a.act s h w).val ∈ + M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA := by + let image := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA + have below : E ≤ d.iso h D := anchor_of_dataBound b I level T S mu positions tuples image + C E (d.iso h D) U.val.val Rf.val.val Rc.val.val newU newW bound + have anchor := avoid (below.trans cap) + have same := M.niceRefinementIndex_copies_agree a s b d level T T2 system.valid1 system.valid2 + system.indices C E U Rf Rc index 1 h V anchor (by simpa only [inv_one, one_mul] using fixed) + simp only [d.one, a.act_one] at same + let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let z := stageOneAssignment idx u.val w.val + let target := stageOneAssignment idx (a.act s h u).val (a.act s h w).val + have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2 + have branchMember : z ∈ stageOneAssignments + (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by + rw [dataEq] + exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨index, hu, hw⟩ + have graphEq := M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers + separation collection carrier group nodes order system.inputs.condition_maps system.inputs.node_maps + supports level T T2 hLevel hT system.valid1 system.valid2 system.inputs.terms_closed + system.inputs.pairs_closed system.inputs.family_ground system.indices.index_ground + have branch := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 + system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier + order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground + h C E U Rf Rc u w index hu hw target).2 + (congrArg (fun i => stageOneAssignment i (a.act s h u).val (a.act s h w).val) same.symm) + rw [← graphEq h] at branch + have edge := (M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored + branchMember (t.encode h) target).2 ⟨t.encode_mem h, branch⟩ + exact ⟨anchor, same, edge, + (M.structuralAssignmentImage_entry t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA target).2 + ⟨z, source, edge⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (level T T2 : ZFSet.{u}) +variable (system : RefinementStageSystem M a s t b d base directed level T T2) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +include system pairing unions powers separation collection carrier order group nodes supports hLevel hT + +theorem structuralAssignment_prepared_insertion_collision + (small : M.sets.Countable) + {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t)) ∈ history) + (I S mu positions tuples sourceA : ZFSet.{u}) + (positionSupport : ∀ (D : L), ∀ f ∈ S, ∀ u : Name s, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu positions b.conditionOrder f (b.encode D) → + d.principalFix D ≤ a.stabilizer s u) + (h : G) (D K V C E : L) (U Rf Rc u w newU newW : (M.nameDomain s).names) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 system.valid1) + (hu : u.val.val ∈ T) (hw : w.val.val ∈ T) + (hNewU : newU.val.val ∈ T) (hNewW : newW.val.val ∈ T) + (p q : P) (qp : q ≤ p) (qh : q ≤ a.iso h p) + (fixed : h ∈ d.principalFix V) (cap : d.iso h D ≤ K) + (avoid : E ≤ K → E ≤ V) (F B f e names : Fin 2 → ZFSet.{u}) + (good : ∀ i, b.encode V ∉ F i → b.encode K ∉ F i) : + let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 + let image := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 + let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + stageOneAssignment idx u.val.val w.val.val ∈ sourceA → + ZFSet.pair (stageOneAssignment idx newU.val.val newW.val.val) (b.encode (d.iso h D)) ∈ + stageOneDataBounds image I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples → + stageOneRawTests M fields sourceA (s.encode p) → stageOneRawTests M fields image (s.encode q) → + (∀ i : Fin 2, PreparedCertificateCode M s.carrier s.conditionOrder (s.encode p) + b.carrier b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) + (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T d.principalFix) (s.encode ⊤) + ZFSet.omega ((![cls Rc u, cls Rf w] : Fin 2 → (M.nameDomain s).names) i).val.val + (F i) (B i) (f i) (e i) (names i)) → + E ≤ V ∧ + stageOneRawCollision M fields idx u.val.val newU.val.val w.val.val newW.val.val (s.encode q) ∧ + stageOneRawCollision M fields idx newU.val.val u.val.val newW.val.val w.val.val (s.encode q) := by + let fields := M.refinementLevelFormulaData a s b d level T T2 system.valid1 + let image := M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) sourceA + let moved := M.stageOneNameAction a s t pairing unions powers separation collection carrier system.inputs.condition_maps + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT system.valid1 + let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let original : Fin 2 → (M.nameDomain s).names := ![cls Rc u, cls Rf w] + let translated : Fin 2 → (M.nameDomain s).names := ![cls Rc newU, cls Rf newW] + dsimp only + intro source bound sourceTests translatedTests certificates + have reference := M.structuralAssignment_insertion_reference a s t b d base directed level T T2 + system pairing unions powers separation collection carrier order group nodes supports hLevel hT + function stored I S mu positions tuples sourceA h D K V C E U Rf Rc u.val w.val index hu hw + source newU.val.val newW.val.val bound cap avoid fixed + have parts := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 reference.2.1 + have fine : moved h Rf = Rf := Subtype.ext (Subtype.ext parts.2.2.2.2.1) + have coarse : moved h Rc = Rc := Subtype.ext (Subtype.ext parts.2.2.2.2.2) + obtain ⟨newMember, _, _, _, _, rawE, _, fu, hfu, fw, hfw, anchorEdge, below, + tu, tw, bu, bw⟩ := + (stageOneDataBounds_assignment_entry image I T S b.carrier mu positions b.conditionOrder + (refinementIndexFieldGraph I b.carrier 2) tuples idx newU.val.val newW.val.val + (b.encode (d.iso h D))).1 bound + have sameAnchor : rawE = b.encode E := + ((refinementIndexFieldGraph_entry I b.carrier + ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] 2 rawE).1 anchorEdge).2.2 + have belowCap : E ≤ K := ((b.pair_mem_conditionOrder E (d.iso h D)).1 (sameAnchor ▸ below)).trans cap + have positions : ∀ i : Fin 2, d.principalFix K ≤ + a.stabilizer s ((![newU, newW] : Fin 2 → (M.nameDomain s).names) i).val := by + have first := le_trans (d.principalFix_antitone cap) + (positionSupport (d.iso h D) fu hfu newU.val tu bu) + have second := le_trans (d.principalFix_antitone cap) + (positionSupport (d.iso h D) fw hfw newW.val tw bw) + exact Fin.cases first (Fin.cases second (fun j => Fin.elim0 j)) + have classes := M.niceRefinementClasses_supported_by_block a s b d level T T2 + system.valid1 system.valid2 system.indices base directed system.inputs.terms_closed system.terms_hs + C E K U Rf Rc index belowCap ![newU.val, newW.val] + (Fin.cases (positions 0) (Fin.cases (positions 1) (fun j => Fin.elim0 j))) + have single := (M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection + carrier order nodes hT system.valid1 system.indices base directed system.first C E U Rf Rc u w index p).1 + (sourceTests.1 idx index u.val.val hu w.val.val hw source) + have profile : Forces (M.nameDomain s) refinementProfileFormula + ![original 0, original 1, M.stageOneVisibilityName s system.valid1 a b d base directed system.first V] q := + forces_mono (M.nameDomain s) _ _ (single.2.1 V reference.1) qp + have referenceRaw := translatedTests.2 idx index + (moved h u).val.val (system.inputs.terms_closed h u.val hu) newU.val.val hNewU + (moved h w).val.val (system.inputs.terms_closed h w.val hw) newW.val.val hNewW + reference.2.2.2 newMember + have referenceTyped := (M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation + collection carrier order hT system.valid1 system.indices C E U Rf Rc + (moved h u) newU (moved h w) newW index q).1 referenceRaw + have classLaw (R v : (M.nameDomain s).names) : moved h (cls R v) = cls (moved h R) (moved h v) := + M.stageOneNameAction_class a s t pairing unions powers separation collection carrier + system.inputs.condition_maps order hT system.valid1 system.inputs.terms_closed h R v + have referenceFormula : Forces (M.nameDomain s) refinementCollisionFormula + ![moved h (original 0), translated 0, moved h (original 1), translated 1] q := by + change Forces (M.nameDomain s) refinementCollisionFormula + ![moved h (cls Rc u), cls Rc newU, moved h (cls Rf w), cls Rf newW] q + rw [classLaw Rc u, classLaw Rf w, fine, coarse] + exact referenceTyped + have recognized (i : Fin 2) := M.preparedCertificateCode_typed a s b T d.principalFix pairing unions powers + separation collection carrier order hT system.valid1 system.first.visibility_graph_ground + b.conditionOrder (canonicalMeetGraph b.carrier b.conditionOrder) ZFSet.omega + (original i) p (F i) (B i) (f i) (e i) (names i) (certificates i) + have forced := M.prepared_insertion_collision_forces a s t b d pairing unions powers separation collection + carrier group nodes supports system.inputs.condition_maps hT system.valid1 system.inputs.terms_closed + base directed system.first small F B f original translated p q + (fun i => (recognized i).1.subset) (fun i => (recognized i).2.1.1) + (fun i => (recognized i).2.1.2) (fun i => (recognized i).2.2.2.1.1) + (fun i => (recognized i).2.2.2.2.1) (fun i => (recognized i).2.2.2.2.2.1) + (fun i => (recognized i).2.2.2.2.2.2) h V K fixed qp qh good + (Fin.cases (classes 0).1 (Fin.cases (classes 1).1 (fun j => Fin.elim0 j))) + (Fin.cases (Name.refinementClass_subset T system.valid1 Rc.val newU.val) + (Fin.cases (Name.refinementClass_subset T system.valid1 Rf.val newW.val) (fun j => Fin.elim0 j))) + profile referenceFormula + have typed : M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT system.valid1 + Rf Rc u newU w newW q := forced + exact ⟨reference.1, M.refinementLevelRawCollision_both_orders s pairing unions powers separation collection + carrier order hT system.valid1 a b d level T2 system.indices C E U Rf Rc u newU w newW index q typed⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPresentedPreimages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPresentedPreimages.lean index 3b2e9e15716e99b4906981599c45cd3bca17831e..84dece18f8652f1efc9420df6238cbfe2e010d86 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPresentedPreimages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundPresentedPreimages.lean @@ -1,51 +1,51 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs - -namespace OAI - -section - -namespace PartitionPilot.SetRealization.Presentation -open Forcing -universe u -variable {P Q : Type u} (s : Presentation P) (t : Presentation Q) (f : P → Q) - -theorem preimageCode_eq (X : ZFSet.{u}) : - s.subset (fun point => t.encode (f point) ∈ X) = - relationImage X s.carrier (relationConverse s.carrier t.carrier (s.graph t f)) := by - apply ZFSet.ext - intro z - rw [s.mem_subset, mem_relationImage] - constructor - · rintro ⟨p, member, rfl⟩ - exact ⟨s.encode_mem p, t.encode (f p), member, - (pair_mem_relationConverse _ _ _ _ _).2 - ⟨s.encode_mem p, t.encode_mem (f p), (s.pair_mem_graph t f p (f p)).2 rfl⟩⟩ - · rintro ⟨_, y, member, entry⟩ - have raw := (pair_mem_relationConverse _ _ _ _ _).1 entry - obtain ⟨p, equal⟩ := (s.mem_graph t f _).1 raw.2.2 - obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal - exact ⟨p, by rw [right]; exact member, left⟩ - -end PartitionPilot.SetRealization.Presentation - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P Q : Type u} - -theorem presentedPreimage_mem (s : Presentation P) (t : Presentation Q) (f : P → Q) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) (graph : s.graph t f ∈ M.sets) - {X : ZFSet.{u}} (hX : X ∈ M.sets) : - s.subset (fun point => t.encode (f point) ∈ X) ∈ M.sets := by - rw [s.preimageCode_eq t f X] - exact M.relationImage_mem separation hX hs - (M.relationConverse_mem pairing unions powers separation hs ht graph) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs + +namespace OAI + +section + +namespace PartitionPilot.SetRealization.Presentation +open Forcing +universe u +variable {P Q : Type u} (s : Presentation P) (t : Presentation Q) (f : P → Q) + +theorem preimageCode_eq (X : ZFSet.{u}) : + s.subset (fun point => t.encode (f point) ∈ X) = + relationImage X s.carrier (relationConverse s.carrier t.carrier (s.graph t f)) := by + apply ZFSet.ext + intro z + rw [s.mem_subset, mem_relationImage] + constructor + · rintro ⟨p, member, rfl⟩ + exact ⟨s.encode_mem p, t.encode (f p), member, + (pair_mem_relationConverse _ _ _ _ _).2 + ⟨s.encode_mem p, t.encode_mem (f p), (s.pair_mem_graph t f p (f p)).2 rfl⟩⟩ + · rintro ⟨_, y, member, entry⟩ + have raw := (pair_mem_relationConverse _ _ _ _ _).1 entry + obtain ⟨p, equal⟩ := (s.mem_graph t f _).1 raw.2.2 + obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal + exact ⟨p, by rw [right]; exact member, left⟩ + +end PartitionPilot.SetRealization.Presentation + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P Q : Type u} + +theorem presentedPreimage_mem (s : Presentation P) (t : Presentation Q) (f : P → Q) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hs : s.carrier ∈ M.sets) (ht : t.carrier ∈ M.sets) (graph : s.graph t f ∈ M.sets) + {X : ZFSet.{u}} (hX : X ∈ M.sets) : + s.subset (fun point => t.encode (f point) ∈ X) ∈ M.sets := by + rw [s.preimageCode_eq t f X] + exact M.relationImage_mem separation hX hs + (M.relationConverse_mem pairing unions powers separation hs ht graph) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProfiledExternalRequests.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProfiledExternalRequests.lean index ed042bc8ee1d834619dbfb5e0c92a09bbcfc447f..a48e73c5dfc09c8879388ddb580137bd3f77cf5e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProfiledExternalRequests.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProfiledExternalRequests.lean @@ -1,483 +1,483 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CompressionRequestRealization -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalRequestGraphCoordinates -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalOldAction -import OAI.SetTheory.PartitionPrinciple.Forcing.IdealInsertionProfileTransport - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "letters" => completion.externalFamilyLetterPresentation group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "U" => completion.algebra.union.fields 0 -local notation "generators" => M.externalChildGenerators G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one - -local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy - (completion.externalFamily group oldAction data.original) - (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 -local notation "ru" => completion.algebra.union.fields 1 -local notation "au" => completion.algebra.union.fields 12 -local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 -local notation "newMeet" => completion.externalPointMeet P0 r0 μ0 A0 -local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "P" => completion.algebra.union.meet.toSmallMeetOrder - -include data group oldAction pairing unions powers separation infinite hG in -theorem separation_generator_fixes (W : SetMembers P0) : - letI := group.toGroup - ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw W)) (natSetCode 0)) k ∈ generators → - ∀ z ∈ completion.externalPointCarrier P0 r0 μ0 A0, - ZFSet.pair z ((q).encode ((root).toFun - (SetMembers.ofMem (SetMembers.raw W) (data.original.subset (SetMembers.raw_mem W))))) ∈ newOrder → - ZFSet.pair (ZFSet.pair k z) z ∈ newAction := by - let := group.toGroup - intro k gen z hz lower - rw [← data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG] at hz - obtain ⟨z, rfl⟩ := ((q).mem_carrier _).1 hz - apply (data.request_generator_action group oldAction pairing unions powers separation infinite hG - (.inr (.inl W)) ⟨()⟩ k gen z z).2 - exact completion.external_separation_fixes group oldAction data.original W z - (((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 _ _).1 lower) - -include data group oldAction pairing unions powers separation infinite hG in -theorem separation_generator_meet (W : SetMembers P0) (x y : SetMembers U) - (wx : ZFSet.pair (SetMembers.raw W) (SetMembers.raw x) ∈ ru) - (wy : ZFSet.pair (SetMembers.raw W) (SetMembers.raw y) ∈ ru) : - letI := group.toGroup - ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw W)) (natSetCode 0)) k ∈ generators → - ∀ z, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) z ∈ newAction → - ZFSet.pair (ZFSet.pair z ((q).encode ((root).toFun y))) - ((q).encode ((root).toFun (SetMembers.ofMem (SetMembers.raw W) - (data.original.subset (SetMembers.raw_mem W))))) ∈ newMeet := by - let := group.toGroup - intro k gen z acted - rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inl W)) ⟨()⟩ k gen _ z).1 acted] - exact ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 _ _ _).2 - (completion.external_separation_meet group oldAction data.original W x y wx wy) - -include data group oldAction pairing unions powers separation infinite hG in -theorem compression_generator_restriction (i : SetMembers I) (x y : SetMembers U) - (map : ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ completion.externalMap i) : - letI := group.toGroup - ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) ((q).encode ((root).toFun y)) ∈ newAction := by - let := group.toGroup - intro k gen - apply (data.request_generator_action group oldAction pairing unions powers separation infinite hG - (.inl i) ⟨()⟩ k gen _ _).2 - have equal : ((completion.externalCopy i).toFun x).val = y := by - apply SetMembers.raw_injective U - exact (show FunctionGraphOn U (completion.externalMap i) from - ⟨U, (completion.algebra.embedding _ _ (completion.externalMap_entry i)).injection.function⟩).unique - (completion.externalCopy_entry i x) map - rw [completion.external_compression_restriction group oldAction data.original, equal] - -include data group oldAction pairing unions powers separation infinite hG in -theorem compression_generator_top (i : SetMembers I) : - letI := group.toGroup - ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun (SetMembers.ofMem τ completion.top_mem)))) - ((q).encode ((root).toFun (completion.externalCap i))) ∈ newAction := by - let := group.toGroup - intro k gen - exact (data.request_generator_action group oldAction pairing unions powers separation infinite hG - (.inl i) ⟨()⟩ k gen _ _).2 (completion.external_compression_top group oldAction data.original i) - -include data group oldAction pairing unions powers separation infinite hG in -theorem compression_generator_agreement (i : SetMembers I) {a g : ZFSet.{u}} - (source : ZFSet.pair (SetMembers.raw i) a ∈ Sources) - (rep : ZFSet.pair (SetMembers.raw i) g ∈ Reps) - (x y : SetMembers U) (lower : ZFSet.pair (SetMembers.raw x) a ∈ ru) - (acted : ZFSet.pair (ZFSet.pair g (SetMembers.raw x)) (SetMembers.raw y) ∈ au) : - letI := group.toGroup - ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) ((q).encode ((root).toFun y)) ∈ newAction := by - let := group.toGroup - exact data.compression_generator_restriction group oldAction pairing unions powers separation infinite hG i x y - ((completion.source_agreement _ _ _ _ _ _ (completion.externalMap_entry i) source rep lower).2 acted) - -end GroundExternalGeometryInputs - -namespace GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "letters" => completion.externalFamilyLetterPresentation group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "U" => completion.algebra.union.fields 0 -local notation "generators" => M.externalChildGenerators G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one - -local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy - (completion.externalFamily group oldAction data.original) - (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 -local notation "ru" => completion.algebra.union.fields 1 -local notation "au" => completion.algebra.union.fields 12 -local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 -local notation "newMeet" => completion.externalPointMeet P0 r0 μ0 A0 -local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "P" => completion.algebra.union.meet.toSmallMeetOrder - -include data group oldAction pairing unions powers separation infinite hG in -theorem rectangle_generators_roots (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) - (x : SetMembers U) (below : (P).le x (completion.externalRectangle group oldAction data.original z).C) : - letI := group.toGroup - let r := completion.externalRectangle group oldAction data.original z - ∀ k l, - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → - ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) - ((q).encode ((root).toFun (((action).iso r.first).toFun x))) ∈ newAction ∧ - ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun x))) - ((q).encode ((root).toFun (((action).iso r.second).toFun x))) ∈ newAction := by - let := group.toGroup - dsimp only - intro k l gen1 gen2 - have laws := completion.external_rectangle_roots group oldAction data.original z x below - exact ⟨(data.request_generator_action group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨false⟩ k gen1 _ _).2 laws.1, - (data.request_generator_action group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨true⟩ l gen2 _ _).2 laws.2⟩ - -include data group oldAction pairing unions powers separation infinite hG in -theorem rectangle_generators_agree (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) - (x : SetMembers U) (below : (P).le x (completion.externalRectangle group oldAction data.original z).B) : - letI := group.toGroup - ∀ k l, - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → - ∀ y v, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) y ∈ newAction → - ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun x))) v ∈ newAction → y = v := by - let := group.toGroup - intro k l gen1 gen2 y v act1 act2 - rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨false⟩ k gen1 _ y).1 act1, - (data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨true⟩ l gen2 _ v).1 act2] - exact congrArg (q).encode (completion.external_rectangle_children group oldAction data.original z x below) - -include data group oldAction pairing unions powers separation infinite hG in -theorem rectangle_generators_root_meets (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x : SetMembers U) : - letI := group.toGroup - let r := completion.externalRectangle group oldAction data.original z - ∀ k l, - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → - ∀ y v, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun r.D))) y ∈ newAction → - ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun r.D))) v ∈ newAction → - ZFSet.pair (ZFSet.pair y ((q).encode ((root).toFun x))) - ((q).encode ((root).toFun ((P).meet (((action).iso r.first).toFun r.C) x))) ∈ newMeet ∧ - ZFSet.pair (ZFSet.pair v ((q).encode ((root).toFun x))) - ((q).encode ((root).toFun ((P).meet (((action).iso r.second).toFun r.C) x))) ∈ newMeet := by - let := group.toGroup - dsimp only - intro k l gen1 gen2 y v act1 act2 - rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨false⟩ k gen1 _ y).1 act1, - (data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨true⟩ l gen2 _ v).1 act2] - have laws := completion.external_rectangle_root_meets group oldAction data.original z x - have meet := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 - exact ⟨(meet _ _ _).2 laws.1, (meet _ _ _).2 laws.2⟩ - -include data group oldAction pairing unions powers separation infinite hG in -theorem rectangle_generators_meet (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : - letI := group.toGroup - let r := completion.externalRectangle group oldAction data.original z - ∀ k l, - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → - ∀ y v b, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun r.D))) y ∈ newAction → - ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun r.D))) v ∈ newAction → - ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun r.B))) b ∈ newAction → - ZFSet.pair (ZFSet.pair y v) b ∈ newMeet ∧ - ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun r.B))) b ∈ newAction := by - let := group.toGroup - dsimp only - intro k l gen1 gen2 y v b act1 act2 actB - rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨false⟩ k gen1 _ y).1 act1, - (data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨true⟩ l gen2 _ v).1 act2, - (data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨false⟩ k gen1 _ b).1 actB] - refine ⟨((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 _ _ _).2 - (completion.external_rectangle_children_meet group oldAction data.original z), ?_⟩ - apply (data.request_generator_action group oldAction pairing unions powers separation infinite hG - (.inr (.inr z)) ⟨true⟩ l gen2 _ _).2 - exact (completion.external_rectangle_children group oldAction data.original z _ ((P).refl _)).symm - -end GroundExternalGeometryInputs - -namespace GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "letters" => completion.externalFamilyLetterPresentation group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "U" => completion.algebra.union.fields 0 -local notation "generators" => M.externalChildGenerators G - (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one - -local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy - (completion.externalFamily group oldAction data.original) - (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 -local notation "ru" => completion.algebra.union.fields 1 -local notation "au" => completion.algebra.union.fields 12 -local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 -local notation "newMeet" => completion.externalPointMeet P0 r0 μ0 A0 -local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "P" => completion.algebra.union.meet.toSmallMeetOrder - -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "identityCopy" => completion.externalCopyGraph P0 r0 μ0 A0 - (M.externalGroupIdentity G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one) - -include data group oldAction pairing unions powers separation infinite hG in -theorem external_identity_copy_value : - letI := group.toGroup - ∀ (x : SetMembers U) y, ZFSet.pair (SetMembers.raw x) y ∈ identityCopy ↔ - y = (q).encode ((root).toFun x) := by - let := group.toGroup - intro x y - rw [completion.externalFamilyGroupPresentation_identity group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground, - data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] - constructor - · intro entry - obtain ⟨v, equal⟩ := ((SetMembers.presentation U).mem_graph (q) (root).toFun _).1 entry - have parts := ZFSet.pair_inj.1 equal - have same := (SetMembers.presentation U).injective parts.1 - simpa only [same] using parts.2.symm - · rintro rfl - exact ((SetMembers.presentation U).pair_mem_graph (q) _ _ _).2 rfl - -include data group oldAction pairing unions powers separation infinite hG in -theorem external_identity_capProfile (hP0 : P0 ∈ M.sets) - {c v K F c' v' K' : ZFSet.{u}} - (profile : CodedCapProfile U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) c v K F) - (imageC : ZFSet.pair c c' ∈ identityCopy) (imageV : ZFSet.pair v v' ∈ identityCopy) - (imageK : ZFSet.pair K K' ∈ identityCopy) : - CodedCapProfile Q newOrder newMeet c' v' K' (relationImage F Q identityCopy) := - (data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG).capProfile - completion.algebra.union.meet - (data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0).meet - completion.top_mem completion.top profile imageC imageV imageK - -include data group oldAction pairing unions powers separation infinite hG in -theorem external_identity_filter_ground (hP0 : P0 ∈ M.sets) - {F : ZFSet.{u}} (hF : F ∈ M.sets) : relationImage F Q identityCopy ∈ M.sets := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - exact M.relationImage_mem separation hF geometry.carrier_ground - (geometry.copies_ground _ data.group.group_code.identity_mem) - -include data group oldAction pairing unions powers separation infinite hG in -theorem external_compression_generator_profile (hP0 : P0 ∈ M.sets) - (i : SetMembers I) {c v F c' v' τ' : ZFSet.{u}} - (profile : CodedCapProfile U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) - c v (SetMembers.raw (completion.externalCap i)) F) - (imageC : ZFSet.pair c c' ∈ identityCopy) (imageV : ZFSet.pair v v' ∈ identityCopy) - (imageTop : ZFSet.pair τ τ' ∈ identityCopy) : - ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → - ∀ K', ZFSet.pair (ZFSet.pair k τ') K' ∈ newAction → - CodedCapProfile Q newOrder newMeet c' v' K' (relationImage F Q identityCopy) := by - let := group.toGroup - intro k gen K' acted - have topEq := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG - (SetMembers.ofMem τ completion.top_mem) τ').1 (by simpa only [SetMembers.raw_ofMem] using imageTop) - rw [topEq] at acted - have value := (data.request_action_value group oldAction pairing unions powers separation infinite hG - (.inl i) ⟨()⟩ k gen _ K').1 acted - rw [completion.external_compression_top group oldAction data.original] at value - apply data.external_identity_capProfile group oldAction pairing unions powers separation infinite hG hP0 profile imageC imageV - exact (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG - (completion.externalCap i) K').2 value - -end GroundExternalGeometryInputs - -namespace GroundExternalGeometryInputs -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P0 ∈ M.sets) -local notation "U" => completion.algebra.union.fields 0 -local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "generators" => M.externalChildGenerators G letters m one -local notation "copyGraph" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy - (completion.externalFamily group oldAction data.original) action 1 -local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 -local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "P" => completion.algebra.union.meet.toSmallMeetOrder -include data group oldAction pairing unions powers separation infinite hG hP - -theorem rectangle_generators_full_ideals (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : - letI := group.toGroup - let r := completion.externalRectangle group oldAction data.original z - ∀ k l, - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → - ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → - ∀ g' h' c' b', - ZFSet.pair (SetMembers.raw r.first) g' ∈ M.externalOldInclusion G letters m one → - ZFSet.pair (SetMembers.raw r.second) h' ∈ M.externalOldInclusion G letters m one → - ZFSet.pair (SetMembers.raw r.C) c' ∈ copyGraph → - ZFSet.pair (SetMembers.raw r.B) b' ∈ copyGraph → - ActionAgreementBelow Q newOrder newAction k g' c' ∧ - ActionAgreementBelow Q newOrder newAction l h' c' ∧ - ActionAgreementBelow Q newOrder newAction k l b' := by - let := group.toGroup - dsimp only - intro k l gen1 gen2 g' h' c' b' ag ah ec eb - let r := completion.externalRectangle group oldAction data.original z - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP - have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen1)).2 - have hl := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen2)).2 - have hg' := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 ag)).2 - have hh' := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 ah)).2 - have same {a b x v : ZFSet.{u}} (ha : a ∈ M.externalGroupCarrier G letters m one) (hb : b ∈ M.externalGroupCarrier G letters m one) - (hx : x ∈ Q) (first : ZFSet.pair (ZFSet.pair a x) v ∈ newAction) - (second : ZFSet.pair (ZFSet.pair b x) v ∈ newAction) (y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair a x) y ∈ newAction ↔ ZFSet.pair (ZFSet.pair b x) y ∈ newAction := by - obtain ⟨_, _, ua⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) - obtain ⟨_, _, ub⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hb, hx⟩) - exact ⟨fun entry => ((ua y entry).trans (ua v first).symm).symm ▸ second, - fun entry => ((ub y entry).trans (ub v second).symm).symm ▸ first⟩ - have atC (x' : ZFSet.{u}) (hx' : x' ∈ Q) (lower : ZFSet.pair x' c' ∈ newOrder) : - ∀ y, (ZFSet.pair (ZFSet.pair k x') y ∈ newAction ↔ ZFSet.pair (ZFSet.pair g' x') y ∈ newAction) ∧ - (ZFSet.pair (ZFSet.pair l x') y ∈ newAction ↔ ZFSet.pair (ZFSet.pair h' x') y ∈ newAction) := by - obtain ⟨x, hx, below, ex⟩ := ideal.ideal _ _ _ ec hx' lower - let xu := SetMembers.ofMem x hx - have eqX := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG xu x').1 (by simpa only [xu, SetMembers.raw_ofMem] using ex) - have acts := data.rectangle_generators_roots group oldAction pairing unions powers separation infinite hG z xu (by - change ZFSet.pair (SetMembers.raw xu) _ ∈ _ - simpa only [xu, SetMembers.raw_ofMem] using below) k l gen1 gen2 - rw [← eqX] at acts - have old1 := (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet - r.first xu (((action).iso r.first).toFun xu)).1 rfl - have old2 := (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet - r.second xu (((action).iso r.second).toFun xu)).1 rfl - have copy1 := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG - (((action).iso r.first).toFun xu) _).2 rfl - have copy2 := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG - (((action).iso r.second).toFun xu) _).2 rfl - have acts1 := data.externalIdentityCopy_equivariant group oldAction pairing unions powers separation infinite hG ag ex copy1 (by simpa only [xu, SetMembers.raw_ofMem] using old1) - have acts2 := data.externalIdentityCopy_equivariant group oldAction pairing unions powers separation infinite hG ah ex copy2 (by simpa only [xu, SetMembers.raw_ofMem] using old2) - intro y - exact ⟨same hk hg' hx' acts.1 acts1 y, same hl hh' hx' acts.2 acts2 y⟩ - refine ⟨fun x hx y _ lower => (atC x hx lower y).1, - fun x hx y _ lower => (atC x hx lower y).2, ?_⟩ - intro x' hx' y _ lower - obtain ⟨x, hx, below, ex⟩ := ideal.ideal _ _ _ eb hx' lower - let xu := SetMembers.ofMem x hx - have eqX := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG xu x').1 (by simpa only [xu, SetMembers.raw_ofMem] using ex) - obtain ⟨u, act1, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hk, hx'⟩) - obtain ⟨v, act2, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hl, hx'⟩) - have equal := data.rectangle_generators_agree group oldAction pairing unions powers separation infinite hG z xu (by - change ZFSet.pair (SetMembers.raw xu) _ ∈ _ - simpa only [xu, SetMembers.raw_ofMem] using below) - k l gen1 gen2 u v (eqX ▸ act1) (eqX ▸ act2) - exact same hk hl hx' act1 (equal.symm ▸ act2) y - -end GroundExternalGeometryInputs - -namespace GroundProfiledCompression -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 C D rD original Targets Separators Filters : ZFSet.{u}} -variable (profiled : GroundProfiledCompression M initial I Sources Reps G m one T τ P0 C D rD original - Targets Separators Filters) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 - profiled.heighted.completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "Q" => profiled.heighted.completion.externalPointCarrier P0 r0 μ0 A0 -local notation "identityCopy" => profiled.heighted.completion.externalCopyGraph P0 r0 μ0 A0 - (M.externalGroupIdentity G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one) - -include profiled data group oldAction pairing unions powers separation infinite hG in -theorem external_generator_profile (hP0 : P0 ∈ M.sets) (hFilters : Filters ∈ M.sets) - (i : SetMembers I) {c v F c' v' τ' : ZFSet.{u}} - (target : ZFSet.pair (SetMembers.raw i) c ∈ Targets) - (separator : ZFSet.pair (SetMembers.raw i) v ∈ Separators) - (filter : ZFSet.pair (SetMembers.raw i) F ∈ Filters) - (imageC : ZFSet.pair c c' ∈ identityCopy) (imageV : ZFSet.pair v v' ∈ identityCopy) - (imageTop : ZFSet.pair τ τ' ∈ identityCopy) : - relationImage F Q identityCopy ∈ M.sets ∧ - ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ - M.externalChildGenerators G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one → - ∀ K', ZFSet.pair (ZFSet.pair k τ') K' ∈ profiled.heighted.completion.externalPointAction P0 r0 μ0 A0 → - CodedCapProfile Q (profiled.heighted.completion.externalPointOrder P0 r0 μ0 A0) - (profiled.heighted.completion.externalPointMeet P0 r0 μ0 A0) - c' v' K' (relationImage F Q identityCopy) := by - have hPair := M.transitive hFilters filter - have hF := M.transitive (M.transitive hPair (ZFSet.mem_pair.2 (Or.inr rfl))) - (ZFSet.mem_pair.2 (Or.inr rfl)) - have profile := profiled.profiles (SetMembers.raw i) c v - (SetMembers.raw (profiled.heighted.completion.externalCap i)) F - (profiled.heighted.completion.externalCap_entry i) target separator filter - exact ⟨data.external_identity_filter_ground group oldAction pairing unions powers separation infinite hG hP0 hF, - data.external_compression_generator_profile group oldAction pairing unions powers separation infinite hG hP0 - i profile imageC imageV imageTop⟩ - -end GroundProfiledCompression - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CompressionRequestRealization +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalRequestGraphCoordinates +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalOldAction +import OAI.SetTheory.PartitionPrinciple.Forcing.IdealInsertionProfileTransport + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "letters" => completion.externalFamilyLetterPresentation group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "U" => completion.algebra.union.fields 0 +local notation "generators" => M.externalChildGenerators G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one + +local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy + (completion.externalFamily group oldAction data.original) + (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 +local notation "ru" => completion.algebra.union.fields 1 +local notation "au" => completion.algebra.union.fields 12 +local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 +local notation "newMeet" => completion.externalPointMeet P0 r0 μ0 A0 +local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "P" => completion.algebra.union.meet.toSmallMeetOrder + +include data group oldAction pairing unions powers separation infinite hG in +theorem separation_generator_fixes (W : SetMembers P0) : + letI := group.toGroup + ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw W)) (natSetCode 0)) k ∈ generators → + ∀ z ∈ completion.externalPointCarrier P0 r0 μ0 A0, + ZFSet.pair z ((q).encode ((root).toFun + (SetMembers.ofMem (SetMembers.raw W) (data.original.subset (SetMembers.raw_mem W))))) ∈ newOrder → + ZFSet.pair (ZFSet.pair k z) z ∈ newAction := by + let := group.toGroup + intro k gen z hz lower + rw [← data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG] at hz + obtain ⟨z, rfl⟩ := ((q).mem_carrier _).1 hz + apply (data.request_generator_action group oldAction pairing unions powers separation infinite hG + (.inr (.inl W)) ⟨()⟩ k gen z z).2 + exact completion.external_separation_fixes group oldAction data.original W z + (((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).1 _ _).1 lower) + +include data group oldAction pairing unions powers separation infinite hG in +theorem separation_generator_meet (W : SetMembers P0) (x y : SetMembers U) + (wx : ZFSet.pair (SetMembers.raw W) (SetMembers.raw x) ∈ ru) + (wy : ZFSet.pair (SetMembers.raw W) (SetMembers.raw y) ∈ ru) : + letI := group.toGroup + ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 1) (SetMembers.raw W)) (natSetCode 0)) k ∈ generators → + ∀ z, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) z ∈ newAction → + ZFSet.pair (ZFSet.pair z ((q).encode ((root).toFun y))) + ((q).encode ((root).toFun (SetMembers.ofMem (SetMembers.raw W) + (data.original.subset (SetMembers.raw_mem W))))) ∈ newMeet := by + let := group.toGroup + intro k gen z acted + rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inl W)) ⟨()⟩ k gen _ z).1 acted] + exact ((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 _ _ _).2 + (completion.external_separation_meet group oldAction data.original W x y wx wy) + +include data group oldAction pairing unions powers separation infinite hG in +theorem compression_generator_restriction (i : SetMembers I) (x y : SetMembers U) + (map : ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ completion.externalMap i) : + letI := group.toGroup + ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) ((q).encode ((root).toFun y)) ∈ newAction := by + let := group.toGroup + intro k gen + apply (data.request_generator_action group oldAction pairing unions powers separation infinite hG + (.inl i) ⟨()⟩ k gen _ _).2 + have equal : ((completion.externalCopy i).toFun x).val = y := by + apply SetMembers.raw_injective U + exact (show FunctionGraphOn U (completion.externalMap i) from + ⟨U, (completion.algebra.embedding _ _ (completion.externalMap_entry i)).injection.function⟩).unique + (completion.externalCopy_entry i x) map + rw [completion.external_compression_restriction group oldAction data.original, equal] + +include data group oldAction pairing unions powers separation infinite hG in +theorem compression_generator_top (i : SetMembers I) : + letI := group.toGroup + ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun (SetMembers.ofMem τ completion.top_mem)))) + ((q).encode ((root).toFun (completion.externalCap i))) ∈ newAction := by + let := group.toGroup + intro k gen + exact (data.request_generator_action group oldAction pairing unions powers separation infinite hG + (.inl i) ⟨()⟩ k gen _ _).2 (completion.external_compression_top group oldAction data.original i) + +include data group oldAction pairing unions powers separation infinite hG in +theorem compression_generator_agreement (i : SetMembers I) {a g : ZFSet.{u}} + (source : ZFSet.pair (SetMembers.raw i) a ∈ Sources) + (rep : ZFSet.pair (SetMembers.raw i) g ∈ Reps) + (x y : SetMembers U) (lower : ZFSet.pair (SetMembers.raw x) a ∈ ru) + (acted : ZFSet.pair (ZFSet.pair g (SetMembers.raw x)) (SetMembers.raw y) ∈ au) : + letI := group.toGroup + ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) ((q).encode ((root).toFun y)) ∈ newAction := by + let := group.toGroup + exact data.compression_generator_restriction group oldAction pairing unions powers separation infinite hG i x y + ((completion.source_agreement _ _ _ _ _ _ (completion.externalMap_entry i) source rep lower).2 acted) + +end GroundExternalGeometryInputs + +namespace GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "letters" => completion.externalFamilyLetterPresentation group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "U" => completion.algebra.union.fields 0 +local notation "generators" => M.externalChildGenerators G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one + +local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy + (completion.externalFamily group oldAction data.original) + (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 +local notation "ru" => completion.algebra.union.fields 1 +local notation "au" => completion.algebra.union.fields 12 +local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 +local notation "newMeet" => completion.externalPointMeet P0 r0 μ0 A0 +local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "P" => completion.algebra.union.meet.toSmallMeetOrder + +include data group oldAction pairing unions powers separation infinite hG in +theorem rectangle_generators_roots (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) + (x : SetMembers U) (below : (P).le x (completion.externalRectangle group oldAction data.original z).C) : + letI := group.toGroup + let r := completion.externalRectangle group oldAction data.original z + ∀ k l, + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → + ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) + ((q).encode ((root).toFun (((action).iso r.first).toFun x))) ∈ newAction ∧ + ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun x))) + ((q).encode ((root).toFun (((action).iso r.second).toFun x))) ∈ newAction := by + let := group.toGroup + dsimp only + intro k l gen1 gen2 + have laws := completion.external_rectangle_roots group oldAction data.original z x below + exact ⟨(data.request_generator_action group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨false⟩ k gen1 _ _).2 laws.1, + (data.request_generator_action group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨true⟩ l gen2 _ _).2 laws.2⟩ + +include data group oldAction pairing unions powers separation infinite hG in +theorem rectangle_generators_agree (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) + (x : SetMembers U) (below : (P).le x (completion.externalRectangle group oldAction data.original z).B) : + letI := group.toGroup + ∀ k l, + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → + ∀ y v, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun x))) y ∈ newAction → + ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun x))) v ∈ newAction → y = v := by + let := group.toGroup + intro k l gen1 gen2 y v act1 act2 + rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨false⟩ k gen1 _ y).1 act1, + (data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨true⟩ l gen2 _ v).1 act2] + exact congrArg (q).encode (completion.external_rectangle_children group oldAction data.original z x below) + +include data group oldAction pairing unions powers separation infinite hG in +theorem rectangle_generators_root_meets (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) (x : SetMembers U) : + letI := group.toGroup + let r := completion.externalRectangle group oldAction data.original z + ∀ k l, + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → + ∀ y v, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun r.D))) y ∈ newAction → + ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun r.D))) v ∈ newAction → + ZFSet.pair (ZFSet.pair y ((q).encode ((root).toFun x))) + ((q).encode ((root).toFun ((P).meet (((action).iso r.first).toFun r.C) x))) ∈ newMeet ∧ + ZFSet.pair (ZFSet.pair v ((q).encode ((root).toFun x))) + ((q).encode ((root).toFun ((P).meet (((action).iso r.second).toFun r.C) x))) ∈ newMeet := by + let := group.toGroup + dsimp only + intro k l gen1 gen2 y v act1 act2 + rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨false⟩ k gen1 _ y).1 act1, + (data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨true⟩ l gen2 _ v).1 act2] + have laws := completion.external_rectangle_root_meets group oldAction data.original z x + have meet := (data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 + exact ⟨(meet _ _ _).2 laws.1, (meet _ _ _).2 laws.2⟩ + +include data group oldAction pairing unions powers separation infinite hG in +theorem rectangle_generators_meet (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : + letI := group.toGroup + let r := completion.externalRectangle group oldAction data.original z + ∀ k l, + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → + ∀ y v b, ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun r.D))) y ∈ newAction → + ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun r.D))) v ∈ newAction → + ZFSet.pair (ZFSet.pair k ((q).encode ((root).toFun r.B))) b ∈ newAction → + ZFSet.pair (ZFSet.pair y v) b ∈ newMeet ∧ + ZFSet.pair (ZFSet.pair l ((q).encode ((root).toFun r.B))) b ∈ newAction := by + let := group.toGroup + dsimp only + intro k l gen1 gen2 y v b act1 act2 actB + rw [(data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨false⟩ k gen1 _ y).1 act1, + (data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨true⟩ l gen2 _ v).1 act2, + (data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨false⟩ k gen1 _ b).1 actB] + refine ⟨((data.externalGeometry_entries group oldAction pairing unions powers separation infinite hG).2.1 _ _ _).2 + (completion.external_rectangle_children_meet group oldAction data.original z), ?_⟩ + apply (data.request_generator_action group oldAction pairing unions powers separation infinite hG + (.inr (.inr z)) ⟨true⟩ l gen2 _ _).2 + exact (completion.external_rectangle_children group oldAction data.original z _ ((P).refl _)).symm + +end GroundExternalGeometryInputs + +namespace GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "letters" => completion.externalFamilyLetterPresentation group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "U" => completion.algebra.union.fields 0 +local notation "generators" => M.externalChildGenerators G + (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one + +local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy + (completion.externalFamily group oldAction data.original) + (completion.algebra.union.action.toOrderAction group completion.algebra.union.meet) 1 +local notation "ru" => completion.algebra.union.fields 1 +local notation "au" => completion.algebra.union.fields 12 +local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 +local notation "newMeet" => completion.externalPointMeet P0 r0 μ0 A0 +local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "P" => completion.algebra.union.meet.toSmallMeetOrder + +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "identityCopy" => completion.externalCopyGraph P0 r0 μ0 A0 + (M.externalGroupIdentity G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one) + +include data group oldAction pairing unions powers separation infinite hG in +theorem external_identity_copy_value : + letI := group.toGroup + ∀ (x : SetMembers U) y, ZFSet.pair (SetMembers.raw x) y ∈ identityCopy ↔ + y = (q).encode ((root).toFun x) := by + let := group.toGroup + intro x y + rw [completion.externalFamilyGroupPresentation_identity group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground, + data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] + constructor + · intro entry + obtain ⟨v, equal⟩ := ((SetMembers.presentation U).mem_graph (q) (root).toFun _).1 entry + have parts := ZFSet.pair_inj.1 equal + have same := (SetMembers.presentation U).injective parts.1 + simpa only [same] using parts.2.symm + · rintro rfl + exact ((SetMembers.presentation U).pair_mem_graph (q) _ _ _).2 rfl + +include data group oldAction pairing unions powers separation infinite hG in +theorem external_identity_capProfile (hP0 : P0 ∈ M.sets) + {c v K F c' v' K' : ZFSet.{u}} + (profile : CodedCapProfile U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) c v K F) + (imageC : ZFSet.pair c c' ∈ identityCopy) (imageV : ZFSet.pair v v' ∈ identityCopy) + (imageK : ZFSet.pair K K' ∈ identityCopy) : + CodedCapProfile Q newOrder newMeet c' v' K' (relationImage F Q identityCopy) := + (data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG).capProfile + completion.algebra.union.meet + (data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0).meet + completion.top_mem completion.top profile imageC imageV imageK + +include data group oldAction pairing unions powers separation infinite hG in +theorem external_identity_filter_ground (hP0 : P0 ∈ M.sets) + {F : ZFSet.{u}} (hF : F ∈ M.sets) : relationImage F Q identityCopy ∈ M.sets := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + exact M.relationImage_mem separation hF geometry.carrier_ground + (geometry.copies_ground _ data.group.group_code.identity_mem) + +include data group oldAction pairing unions powers separation infinite hG in +theorem external_compression_generator_profile (hP0 : P0 ∈ M.sets) + (i : SetMembers I) {c v F c' v' τ' : ZFSet.{u}} + (profile : CodedCapProfile U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) + c v (SetMembers.raw (completion.externalCap i)) F) + (imageC : ZFSet.pair c c' ∈ identityCopy) (imageV : ZFSet.pair v v' ∈ identityCopy) + (imageTop : ZFSet.pair τ τ' ∈ identityCopy) : + ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ generators → + ∀ K', ZFSet.pair (ZFSet.pair k τ') K' ∈ newAction → + CodedCapProfile Q newOrder newMeet c' v' K' (relationImage F Q identityCopy) := by + let := group.toGroup + intro k gen K' acted + have topEq := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG + (SetMembers.ofMem τ completion.top_mem) τ').1 (by simpa only [SetMembers.raw_ofMem] using imageTop) + rw [topEq] at acted + have value := (data.request_action_value group oldAction pairing unions powers separation infinite hG + (.inl i) ⟨()⟩ k gen _ K').1 acted + rw [completion.external_compression_top group oldAction data.original] at value + apply data.external_identity_capProfile group oldAction pairing unions powers separation infinite hG hP0 profile imageC imageV + exact (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG + (completion.externalCap i) K').2 value + +end GroundExternalGeometryInputs + +namespace GroundExternalGeometryInputs +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P0 ∈ M.sets) +local notation "U" => completion.algebra.union.fields 0 +local notation "Q" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "generators" => M.externalChildGenerators G letters m one +local notation "copyGraph" => completion.externalCopyGraph P0 r0 μ0 A0 (M.externalGroupIdentity G letters m one) +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "root" => Compression.RecursiveMaps.TileRequests.Family.copy + (completion.externalFamily group oldAction data.original) action 1 +local notation "newAction" => completion.externalPointAction P0 r0 μ0 A0 +local notation "newOrder" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "P" => completion.algebra.union.meet.toSmallMeetOrder +include data group oldAction pairing unions powers separation infinite hG hP + +theorem rectangle_generators_full_ideals (z : SetMembers (externalRectangles P0 G r0 μ0 A0)) : + letI := group.toGroup + let r := completion.externalRectangle group oldAction data.original z + ∀ k l, + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 0)) k ∈ generators → + ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 2) (SetMembers.raw z)) (natSetCode 1)) l ∈ generators → + ∀ g' h' c' b', + ZFSet.pair (SetMembers.raw r.first) g' ∈ M.externalOldInclusion G letters m one → + ZFSet.pair (SetMembers.raw r.second) h' ∈ M.externalOldInclusion G letters m one → + ZFSet.pair (SetMembers.raw r.C) c' ∈ copyGraph → + ZFSet.pair (SetMembers.raw r.B) b' ∈ copyGraph → + ActionAgreementBelow Q newOrder newAction k g' c' ∧ + ActionAgreementBelow Q newOrder newAction l h' c' ∧ + ActionAgreementBelow Q newOrder newAction k l b' := by + let := group.toGroup + dsimp only + intro k l gen1 gen2 g' h' c' b' ag ah ec eb + let r := completion.externalRectangle group oldAction data.original z + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP + have ideal := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen1)).2 + have hl := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 gen2)).2 + have hg' := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 ag)).2 + have hh' := (ZFSet.pair_mem_prod.1 (data.old_inclusion_injection.function.1 ah)).2 + have same {a b x v : ZFSet.{u}} (ha : a ∈ M.externalGroupCarrier G letters m one) (hb : b ∈ M.externalGroupCarrier G letters m one) + (hx : x ∈ Q) (first : ZFSet.pair (ZFSet.pair a x) v ∈ newAction) + (second : ZFSet.pair (ZFSet.pair b x) v ∈ newAction) (y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair a x) y ∈ newAction ↔ ZFSet.pair (ZFSet.pair b x) y ∈ newAction := by + obtain ⟨_, _, ua⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨ha, hx⟩) + obtain ⟨_, _, ub⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hb, hx⟩) + exact ⟨fun entry => ((ua y entry).trans (ua v first).symm).symm ▸ second, + fun entry => ((ub y entry).trans (ub v second).symm).symm ▸ first⟩ + have atC (x' : ZFSet.{u}) (hx' : x' ∈ Q) (lower : ZFSet.pair x' c' ∈ newOrder) : + ∀ y, (ZFSet.pair (ZFSet.pair k x') y ∈ newAction ↔ ZFSet.pair (ZFSet.pair g' x') y ∈ newAction) ∧ + (ZFSet.pair (ZFSet.pair l x') y ∈ newAction ↔ ZFSet.pair (ZFSet.pair h' x') y ∈ newAction) := by + obtain ⟨x, hx, below, ex⟩ := ideal.ideal _ _ _ ec hx' lower + let xu := SetMembers.ofMem x hx + have eqX := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG xu x').1 (by simpa only [xu, SetMembers.raw_ofMem] using ex) + have acts := data.rectangle_generators_roots group oldAction pairing unions powers separation infinite hG z xu (by + change ZFSet.pair (SetMembers.raw xu) _ ∈ _ + simpa only [xu, SetMembers.raw_ofMem] using below) k l gen1 gen2 + rw [← eqX] at acts + have old1 := (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet + r.first xu (((action).iso r.first).toFun xu)).1 rfl + have old2 := (completion.algebra.union.action.toOrderAction_eq_iff group completion.algebra.union.meet + r.second xu (((action).iso r.second).toFun xu)).1 rfl + have copy1 := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG + (((action).iso r.first).toFun xu) _).2 rfl + have copy2 := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG + (((action).iso r.second).toFun xu) _).2 rfl + have acts1 := data.externalIdentityCopy_equivariant group oldAction pairing unions powers separation infinite hG ag ex copy1 (by simpa only [xu, SetMembers.raw_ofMem] using old1) + have acts2 := data.externalIdentityCopy_equivariant group oldAction pairing unions powers separation infinite hG ah ex copy2 (by simpa only [xu, SetMembers.raw_ofMem] using old2) + intro y + exact ⟨same hk hg' hx' acts.1 acts1 y, same hl hh' hx' acts.2 acts2 y⟩ + refine ⟨fun x hx y _ lower => (atC x hx lower y).1, + fun x hx y _ lower => (atC x hx lower y).2, ?_⟩ + intro x' hx' y _ lower + obtain ⟨x, hx, below, ex⟩ := ideal.ideal _ _ _ eb hx' lower + let xu := SetMembers.ofMem x hx + have eqX := (data.external_identity_copy_value group oldAction pairing unions powers separation infinite hG xu x').1 (by simpa only [xu, SetMembers.raw_ofMem] using ex) + obtain ⟨u, act1, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hk, hx'⟩) + obtain ⟨v, act2, _⟩ := geometry.action.function.2 _ (ZFSet.pair_mem_prod.2 ⟨hl, hx'⟩) + have equal := data.rectangle_generators_agree group oldAction pairing unions powers separation infinite hG z xu (by + change ZFSet.pair (SetMembers.raw xu) _ ∈ _ + simpa only [xu, SetMembers.raw_ofMem] using below) + k l gen1 gen2 u v (eqX ▸ act1) (eqX ▸ act2) + exact same hk hl hx' act1 (equal.symm ▸ act2) y + +end GroundExternalGeometryInputs + +namespace GroundProfiledCompression +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 C D rD original Targets Separators Filters : ZFSet.{u}} +variable (profiled : GroundProfiledCompression M initial I Sources Reps G m one T τ P0 C D rD original + Targets Separators Filters) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 + profiled.heighted.completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "Q" => profiled.heighted.completion.externalPointCarrier P0 r0 μ0 A0 +local notation "identityCopy" => profiled.heighted.completion.externalCopyGraph P0 r0 μ0 A0 + (M.externalGroupIdentity G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one) + +include profiled data group oldAction pairing unions powers separation infinite hG in +theorem external_generator_profile (hP0 : P0 ∈ M.sets) (hFilters : Filters ∈ M.sets) + (i : SetMembers I) {c v F c' v' τ' : ZFSet.{u}} + (target : ZFSet.pair (SetMembers.raw i) c ∈ Targets) + (separator : ZFSet.pair (SetMembers.raw i) v ∈ Separators) + (filter : ZFSet.pair (SetMembers.raw i) F ∈ Filters) + (imageC : ZFSet.pair c c' ∈ identityCopy) (imageV : ZFSet.pair v v' ∈ identityCopy) + (imageTop : ZFSet.pair τ τ' ∈ identityCopy) : + relationImage F Q identityCopy ∈ M.sets ∧ + ∀ k, ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) (SetMembers.raw i)) (natSetCode 0)) k ∈ + M.externalChildGenerators G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) m one → + ∀ K', ZFSet.pair (ZFSet.pair k τ') K' ∈ profiled.heighted.completion.externalPointAction P0 r0 μ0 A0 → + CodedCapProfile Q (profiled.heighted.completion.externalPointOrder P0 r0 μ0 A0) + (profiled.heighted.completion.externalPointMeet P0 r0 μ0 A0) + c' v' K' (relationImage F Q identityCopy) := by + have hPair := M.transitive hFilters filter + have hF := M.transitive (M.transitive hPair (ZFSet.mem_pair.2 (Or.inr rfl))) + (ZFSet.mem_pair.2 (Or.inr rfl)) + have profile := profiled.profiles (SetMembers.raw i) c v + (SetMembers.raw (profiled.heighted.completion.externalCap i)) F + (profiled.heighted.completion.externalCap_entry i) target separator filter + exact ⟨data.external_identity_filter_ground group oldAction pairing unions powers separation infinite hG hP0 hF, + data.external_compression_generator_profile group oldAction pairing unions powers separation infinite hG hP0 + i profile imageC imageV imageTop⟩ + +end GroundProfiledCompression + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProjectedRowUniqueFibers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProjectedRowUniqueFibers.lean index 9c380c433395abd7f10e558b9b5e952532074c97..c0dcf56badd7dd5088e6282c79b1a3362bccc389 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProjectedRowUniqueFibers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundProjectedRowUniqueFibers.lean @@ -1,143 +1,143 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem completeProjection_codedGeneric_of_ordinary - {Upper Lower : Type u} [PartialOrder Upper] [PartialOrder Lower] - (upper : Presentation Upper) (lower : Presentation Lower) - {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} - (projection : CompleteProjection restriction inclusion) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (upperCarrier : upper.carrier ∈ M.sets) (lowerCarrier : lower.carrier ∈ M.sets) - (restrictionGround : upper.graph lower restriction ∈ M.sets) - (H : ConditionFilter Upper) - (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) : - (projection.projectedFilter H).GenericFor (M.codedFamily lower) := by - intro E member dense - obtain ⟨X, ground, rfl⟩ := member - have preimage := M.presentedPreimage_mem upper lower restriction - pairing unions powers separation upperCarrier lowerCarrier restrictionGround ground - exact (projection.projectedFilter_meets_iff H _).2 - (M.ordinary_generic_meets_coded_dense upper pairing unions powers separation - H ordinary preimage (projection.dense_preimage dense)) - -theorem completeProjection_binaryRowValues_ne - {Upper : Type u} [PartialOrder Upper] (upper : Presentation Upper) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) - (upperCarrier : upper.carrier ∈ M.sets) : - let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let lower := SetMembers.presentation R - ∀ (restriction : Upper →o SetMembers R) (inclusion : SetMembers R ↪o Upper) - (_projection : CompleteProjection restriction inclusion), - upper.graph lower restriction ∈ M.sets → - ∀ (H : ConditionFilter Upper), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - ∀ (one : SetMembers R), H.mem (inclusion one) → - ∀ i ∈ I, ∀ j ∈ I, i ≠ j → - Name.eval {p | H.mem p} - (Name.rename upper inclusion (M.binaryRowName I C one i)) ≠ - Name.eval {p | H.mem p} - (Name.rename upper inclusion (M.binaryRowName I C one j)) := by - let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let lower := SetMembers.presentation R - dsimp only - intro restriction inclusion projection restrictionGround H ordinary one hone i hi j hj distinct - have lowerCarrier : lower.carrier ∈ M.sets := - M.countablePartialFunctions_mem pairing unions powers separation infinite - (M.prod_mem pairing unions powers separation hI hC) - (M.natSetCode_mem separation infinite 2) - have generic := M.completeProjection_codedGeneric_of_ordinary upper lower projection - pairing unions powers separation upperCarrier lowerCarrier restrictionGround H ordinary - have hone' : (projection.projectedFilter H).mem one := hone - intro equal - have same : Name.eval {p | (projection.projectedFilter H).mem p} (M.binaryRowName I C one i) = - Name.eval {p | (projection.projectedFilter H).mem p} (M.binaryRowName I C one j) := by - simpa only [Name.eval_rename, CompleteProjection.projectedFilter, Set.mem_ofPred_eq] using equal - rw [M.eval_binaryRowName I C one (projection.projectedFilter H) hone', - M.eval_binaryRowName I C one (projection.projectedFilter H) hone'] at same - exact M.binaryGenericRow_ne pairing unions powers separation infinite choice - hI hC hi hj distinct uncountable (projection.projectedFilter H) generic same - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) - -theorem projectedBinaryRows_uniqueFiber_incompatible - {Upper G : Type u} [PartialOrder Upper] [Group G] - (upper : Presentation Upper) (t : Presentation G) - (a : PosetAction G Upper) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) - (upperCarrier : (upper).carrier ∈ M.sets) - (maps : a.conditionMapFamily upper t ∈ M.sets) : - let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let lower := SetMembers.presentation R - ∀ (restriction : Upper →o SetMembers R) (inclusion : SetMembers R ↪o Upper) - (_projection : CompleteProjection restriction inclusion), - (upper).graph lower restriction ∈ M.sets → - ∀ (one : SetMembers R), (∀ q : SetMembers R, q ≤ one) → - ∀ (S x f : (M.nameDomain upper).names) (g : G), - a.act upper g S.val = S.val → a.act upper g f.val = f.val → - ∀ i ∈ I, ∀ j ∈ I, i ≠ j → - x.val = Name.rename upper inclusion (M.binaryRowName I C one i) → - a.act upper g x.val = Name.rename upper inclusion (M.binaryRowName I C one j) → - ∀ p : Upper, - Forces (M.nameDomain upper) (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula - (extend S (extend x (extend f Fin.elim0))) p → - ¬ Compatible p (a.iso g p) := by - let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega - let lower := SetMembers.presentation R - dsimp only - intro restriction inclusion projection restrictionGround one greatest S x f g fixedS fixedF - i hi j hj distinct originalRow movedRow p forced compatible - obtain ⟨r, rp, rgp⟩ := compatible - obtain ⟨H, hr, _coded, ordinary, _symmetric⟩ := - M.exists_joint_generic upper a F small upperCarrier r - have closed : ∀ g tau, tau ∈ (M.nameDomain upper).names → - a.act upper g tau ∈ (M.nameDomain upper).names := - M.act_mem upper a t pairing unions powers separation collection upperCarrier maps - have equal := a.uniqueFiber_eq_of_fixed_names upper (M.nameDomain upper) closed - g S x f fixedS fixedF p forced H ordinary (H.upward hr rp) (H.upward hr rgp) - rw [movedRow, originalRow] at equal - have hone : H.mem (inclusion one) := - H.upward hr ((projection.le_include_iff r one).2 (greatest (restriction r))) - exact M.completeProjection_binaryRowValues_ne upper pairing unions powers separation infinite - choice hI hC uncountable upperCarrier restriction inclusion projection restrictionGround - H ordinary one hone i hi j hj distinct equal - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem completeProjection_codedGeneric_of_ordinary + {Upper Lower : Type u} [PartialOrder Upper] [PartialOrder Lower] + (upper : Presentation Upper) (lower : Presentation Lower) + {restriction : Upper →o Lower} {inclusion : Lower ↪o Upper} + (projection : CompleteProjection restriction inclusion) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (upperCarrier : upper.carrier ∈ M.sets) (lowerCarrier : lower.carrier ∈ M.sets) + (restrictionGround : upper.graph lower restriction ∈ M.sets) + (H : ConditionFilter Upper) + (ordinary : H.GenericFor (formulaFamily (M.nameDomain upper))) : + (projection.projectedFilter H).GenericFor (M.codedFamily lower) := by + intro E member dense + obtain ⟨X, ground, rfl⟩ := member + have preimage := M.presentedPreimage_mem upper lower restriction + pairing unions powers separation upperCarrier lowerCarrier restrictionGround ground + exact (projection.projectedFilter_meets_iff H _).2 + (M.ordinary_generic_meets_coded_dense upper pairing unions powers separation + H ordinary preimage (projection.dense_preimage dense)) + +theorem completeProjection_binaryRowValues_ne + {Upper : Type u} [PartialOrder Upper] (upper : Presentation Upper) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) + (upperCarrier : upper.carrier ∈ M.sets) : + let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let lower := SetMembers.presentation R + ∀ (restriction : Upper →o SetMembers R) (inclusion : SetMembers R ↪o Upper) + (_projection : CompleteProjection restriction inclusion), + upper.graph lower restriction ∈ M.sets → + ∀ (H : ConditionFilter Upper), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + ∀ (one : SetMembers R), H.mem (inclusion one) → + ∀ i ∈ I, ∀ j ∈ I, i ≠ j → + Name.eval {p | H.mem p} + (Name.rename upper inclusion (M.binaryRowName I C one i)) ≠ + Name.eval {p | H.mem p} + (Name.rename upper inclusion (M.binaryRowName I C one j)) := by + let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let lower := SetMembers.presentation R + dsimp only + intro restriction inclusion projection restrictionGround H ordinary one hone i hi j hj distinct + have lowerCarrier : lower.carrier ∈ M.sets := + M.countablePartialFunctions_mem pairing unions powers separation infinite + (M.prod_mem pairing unions powers separation hI hC) + (M.natSetCode_mem separation infinite 2) + have generic := M.completeProjection_codedGeneric_of_ordinary upper lower projection + pairing unions powers separation upperCarrier lowerCarrier restrictionGround H ordinary + have hone' : (projection.projectedFilter H).mem one := hone + intro equal + have same : Name.eval {p | (projection.projectedFilter H).mem p} (M.binaryRowName I C one i) = + Name.eval {p | (projection.projectedFilter H).mem p} (M.binaryRowName I C one j) := by + simpa only [Name.eval_rename, CompleteProjection.projectedFilter, Set.mem_ofPred_eq] using equal + rw [M.eval_binaryRowName I C one (projection.projectedFilter H) hone', + M.eval_binaryRowName I C one (projection.projectedFilter H) hone'] at same + exact M.binaryGenericRow_ne pairing unions powers separation infinite choice + hI hC hi hj distinct uncountable (projection.projectedFilter H) generic same + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) + +theorem projectedBinaryRows_uniqueFiber_incompatible + {Upper G : Type u} [PartialOrder Upper] [Group G] + (upper : Presentation Upper) (t : Presentation G) + (a : PosetAction G Upper) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + {I C : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) + (upperCarrier : (upper).carrier ∈ M.sets) + (maps : a.conditionMapFamily upper t ∈ M.sets) : + let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let lower := SetMembers.presentation R + ∀ (restriction : Upper →o SetMembers R) (inclusion : SetMembers R ↪o Upper) + (_projection : CompleteProjection restriction inclusion), + (upper).graph lower restriction ∈ M.sets → + ∀ (one : SetMembers R), (∀ q : SetMembers R, q ≤ one) → + ∀ (S x f : (M.nameDomain upper).names) (g : G), + a.act upper g S.val = S.val → a.act upper g f.val = f.val → + ∀ i ∈ I, ∀ j ∈ I, i ≠ j → + x.val = Name.rename upper inclusion (M.binaryRowName I C one i) → + a.act upper g x.val = Name.rename upper inclusion (M.binaryRowName I C one j) → + ∀ p : Upper, + Forces (M.nameDomain upper) (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula + (extend S (extend x (extend f Fin.elim0))) p → + ¬ Compatible p (a.iso g p) := by + let R := M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionOrder (ZFSet.prod I C) (natSetCode 2) ZFSet.omega + let lower := SetMembers.presentation R + dsimp only + intro restriction inclusion projection restrictionGround one greatest S x f g fixedS fixedF + i hi j hj distinct originalRow movedRow p forced compatible + obtain ⟨r, rp, rgp⟩ := compatible + obtain ⟨H, hr, _coded, ordinary, _symmetric⟩ := + M.exists_joint_generic upper a F small upperCarrier r + have closed : ∀ g tau, tau ∈ (M.nameDomain upper).names → + a.act upper g tau ∈ (M.nameDomain upper).names := + M.act_mem upper a t pairing unions powers separation collection upperCarrier maps + have equal := a.uniqueFiber_eq_of_fixed_names upper (M.nameDomain upper) closed + g S x f fixedS fixedF p forced H ordinary (H.upward hr rp) (H.upward hr rgp) + rw [movedRow, originalRow] at equal + have hone : H.mem (inclusion one) := + H.upward hr ((projection.le_include_iff r one).2 (greatest (restriction r))) + exact M.completeProjection_binaryRowValues_ne upper pairing unions powers separation infinite + choice hI hC uncountable upperCarrier restriction inclusion projection restrictionGround + H ordinary one hone i hi j hj distinct equal + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedCompressionSerialization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedCompressionSerialization.lean index 69b7ea9acc62d2fcd07686d27fd59621976372c1..f60a31939170c20b91ec506621bff463487d5dfc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedCompressionSerialization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedCompressionSerialization.lean @@ -1,57 +1,57 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRankedSerializedChronology - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -local notation "comp" => certificate.compression - -theorem exists_rankedCompressionSerialization - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (invariant : source.Invariant K Labels) (level : GroundMainCandidateLevel M K) - (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) - (priorRank : ZFSet.rank prior.code < ZFSet.rank K) - (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → - prior.fields.value j s = source.history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD, - serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ - serial.code ∈ level.validChronologies C D rD ∧ - (∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → - serial.fields.value j s = (comp).history.fieldValue j s) ∧ - serial.layerBound = functionGraphRange - (chronologyPairs (insert (comp).born.births.limit (comp).born.births.limit)) serial.layers := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - have tasks : ZFSet.rank (source.stage.compressionTasks Labels) < ZFSet.rank K := - M.groundEligibleTasks_rank_lt limit source.stage.actors source.stage.order - source.stage.meetGraph source.stage.action invariant.points_rank invariant.labels_rank - obtain ⟨fields, _, core, values, raw⟩ := certificate.origin.exists_rankedRawCompressionFields comp prior - pairing unions powers separation collection infinite - certificate.indices_ground certificate.sources_ground certificate.representatives_ground - source.stage.actors_ground certificate.task_action_ground (ZFSet.mem_insert _ _) - limit priorRank tasks tasks - (M.initialCompressionData_template_constancy source.stage.carrier source.stage.actors - source.stage.order source.stage.meetGraph source.stage.action Labels) - rfl rfl rfl source.carrier_eq source.order_eq source.meet_eq rfl agreement - have graphs := certificate.compressionFieldGraphs_rank_lt pairing unions powers separation - collection infinite hK conditions invariant prior priorRank agreement fields values - have times := conditions.successor_mem pairing unions powers separation infinite hK - (certificate.compression_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) - obtain ⟨serial, ground, rank, member, _, exactValues, exactRange⟩ := - fields.exists_rankedSerialization pairing unions powers separation collection infinite choice - hK conditions times level (ordinalSetProperty_succ (comp).born.births.times.ordinal) core graphs raw - exact ⟨serial, ground, rank, member, fun j s hs => (exactValues j s).trans (values j s hs), exactRange⟩ - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRankedSerializedChronology + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +local notation "comp" => certificate.compression + +theorem exists_rankedCompressionSerialization + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (invariant : source.Invariant K Labels) (level : GroundMainCandidateLevel M K) + (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) + (priorRank : ZFSet.rank prior.code < ZFSet.rank K) + (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → + prior.fields.value j s = source.history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD, + serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ + serial.code ∈ level.validChronologies C D rD ∧ + (∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → + serial.fields.value j s = (comp).history.fieldValue j s) ∧ + serial.layerBound = functionGraphRange + (chronologyPairs (insert (comp).born.births.limit (comp).born.births.limit)) serial.layers := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + have tasks : ZFSet.rank (source.stage.compressionTasks Labels) < ZFSet.rank K := + M.groundEligibleTasks_rank_lt limit source.stage.actors source.stage.order + source.stage.meetGraph source.stage.action invariant.points_rank invariant.labels_rank + obtain ⟨fields, _, core, values, raw⟩ := certificate.origin.exists_rankedRawCompressionFields comp prior + pairing unions powers separation collection infinite + certificate.indices_ground certificate.sources_ground certificate.representatives_ground + source.stage.actors_ground certificate.task_action_ground (ZFSet.mem_insert _ _) + limit priorRank tasks tasks + (M.initialCompressionData_template_constancy source.stage.carrier source.stage.actors + source.stage.order source.stage.meetGraph source.stage.action Labels) + rfl rfl rfl source.carrier_eq source.order_eq source.meet_eq rfl agreement + have graphs := certificate.compressionFieldGraphs_rank_lt pairing unions powers separation + collection infinite hK conditions invariant prior priorRank agreement fields values + have times := conditions.successor_mem pairing unions powers separation infinite hK + (certificate.compression_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) + obtain ⟨serial, ground, rank, member, _, exactValues, exactRange⟩ := + fields.exists_rankedSerialization pairing unions powers separation collection infinite choice + hK conditions times level (ordinalSetProperty_succ (comp).born.births.times.ordinal) core graphs raw + exact ⟨serial, ground, rank, member, fun j s hs => (exactValues j s).trans (values j s hs), exactRange⟩ + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedExternalSerialization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedExternalSerialization.lean index 7462c17ea53930ffe1ed2d696f1a2c8a1744c0c0..ab2dd0a900c3f5d48f44b21b7c690ff6fa37c648 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedExternalSerialization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedExternalSerialization.lean @@ -1,111 +1,111 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRankedSerializedChronology - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -local notation "comp" => certificate.compression -local notation "completion" => certificate.compression.born.profiled.heighted.completion -local notation "births" => certificate.births -local notation "heights" => certificate.heights -local notation "external" => certificate.external - -theorem exists_rankedExternalSerialization - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (invariant : source.Invariant K Labels) (level : GroundMainCandidateLevel M K) - (original : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) - (originalRank : ZFSet.rank original.code < ZFSet.rank K) - (originalAgreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → - original.fields.value j s = source.history.fieldValue j s) - (prior : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD) - (priorRank : ZFSet.rank prior.code < ZFSet.rank K) - (agreement : ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → - prior.fields.value j s = (comp).history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD, - serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ - serial.code ∈ level.validChronologies C D rD ∧ - (∀ j s, s ∈ insert (births).limit (births).limit → - serial.fields.value j s = (external).history.fieldValue j s) ∧ - serial.layerBound = functionGraphRange - (chronologyPairs (insert (births).limit (births).limit)) serial.layers := by - have atBase (j : Fin 5) := agreement j (comp).born.births.limit (ZFSet.mem_insert _ _) - have sourceValues := (comp).limit_values - have sourceMatch : prior.fields.value 0 (comp).born.births.limit = (completion).algebra.union.fields 0 ∧ - prior.fields.value 1 (comp).born.births.limit = (completion).algebra.union.fields 1 ∧ - prior.fields.value 2 (comp).born.births.limit = (completion).algebra.union.fields 2 ∧ - prior.fields.value 3 (comp).born.births.limit = (comp).born.births.birth := - ⟨(atBase 0).trans sourceValues.1, (atBase 1).trans sourceValues.2.1, - (atBase 2).trans sourceValues.2.2.1, (atBase 3).trans sourceValues.2.2.2.1⟩ - let fields := (births).serializedFields heights prior (external).inputs - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) - have values : ∀ j s, s ∈ insert (births).limit (births).limit → - fields.value j s = (external).history.fieldValue j s := by - intro j s hs - rw [(births).serializedFields_value heights prior (external).inputs - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) j hs] - have oldValue (a : ZFSet.{u}) (before : a ∈ (comp).born.births.limit ∨ a = (comp).born.births.limit) : - ((births).chronologyFields heights prior.toHistory).fieldValue j a = (external).history.fieldValue j a := by - have ha : a ∈ insert (comp).born.births.limit (comp).born.births.limit := before.elim - (fun h => ZFSet.mem_insert_of_mem _ h) (fun h => h.symm ▸ ZFSet.mem_insert _ _) - have left := (births).chronologyFields_old heights prior.toHistory before - have right := (external).old_values a before - have eLeft : ((births).chronologyFields heights prior.toHistory).fieldValue j a = prior.fields.value j a := - Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 - (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j - have eRight : (external).history.fieldValue j a = (comp).history.fieldValue j a := - Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 - (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j - exact eLeft.trans ((agreement j a ha).trans eRight.symm) - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · have left := (births).chronologyFields_limit heights prior.toHistory - have right := (external).limit_values - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - · rcases ((births).times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ - · exact oldValue s (Or.inl before) - · exact oldValue s (Or.inr equal) - · have left := (births).chronologyFields_stamp heights prior.toHistory n - have right := (external).stamp_values n - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - have tasks : ZFSet.rank (source.stage.compressionTasks Labels) < ZFSet.rank K := - M.groundEligibleTasks_rank_lt limit source.stage.actors source.stage.order source.stage.meetGraph - source.stage.action invariant.points_rank invariant.labels_rank - have graphs := certificate.externalFieldGraphs_rank_lt pairing unions powers separation collection - infinite hK conditions invariant original originalRank originalAgreement fields values - have raw := (births).serialized_all_ranked_raw_witnesses heights prior (external).inputs - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) - priorRank sourceMatch limit (ZFSet.rank_lt_of_mem conditions.2.1) - tasks invariant.points_rank invariant.actors_rank - have times := conditions.successor_mem pairing unions powers separation infinite hK - (certificate.external_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) - obtain ⟨serial, ground, rank, member, _, exactValues, exactRange⟩ := - fields.exists_rankedSerialization pairing unions powers separation collection infinite choice - hK conditions times level (ordinalSetProperty_succ (births).times.ordinal) - ((births).serializedFields_core heights prior (external).inputs source.stage.group_code source.stage.action_code - pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground - (ZFSet.mem_insert _ _)) graphs raw - exact ⟨serial, ground, rank, member, fun j s hs => (exactValues j s).trans (values j s hs), exactRange⟩ - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRankedSerializedChronology + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +local notation "comp" => certificate.compression +local notation "completion" => certificate.compression.born.profiled.heighted.completion +local notation "births" => certificate.births +local notation "heights" => certificate.heights +local notation "external" => certificate.external + +theorem exists_rankedExternalSerialization + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (invariant : source.Invariant K Labels) (level : GroundMainCandidateLevel M K) + (original : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) + (originalRank : ZFSet.rank original.code < ZFSet.rank K) + (originalAgreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → + original.fields.value j s = source.history.fieldValue j s) + (prior : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD) + (priorRank : ZFSet.rank prior.code < ZFSet.rank K) + (agreement : ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → + prior.fields.value j s = (comp).history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD, + serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ + serial.code ∈ level.validChronologies C D rD ∧ + (∀ j s, s ∈ insert (births).limit (births).limit → + serial.fields.value j s = (external).history.fieldValue j s) ∧ + serial.layerBound = functionGraphRange + (chronologyPairs (insert (births).limit (births).limit)) serial.layers := by + have atBase (j : Fin 5) := agreement j (comp).born.births.limit (ZFSet.mem_insert _ _) + have sourceValues := (comp).limit_values + have sourceMatch : prior.fields.value 0 (comp).born.births.limit = (completion).algebra.union.fields 0 ∧ + prior.fields.value 1 (comp).born.births.limit = (completion).algebra.union.fields 1 ∧ + prior.fields.value 2 (comp).born.births.limit = (completion).algebra.union.fields 2 ∧ + prior.fields.value 3 (comp).born.births.limit = (comp).born.births.birth := + ⟨(atBase 0).trans sourceValues.1, (atBase 1).trans sourceValues.2.1, + (atBase 2).trans sourceValues.2.2.1, (atBase 3).trans sourceValues.2.2.2.1⟩ + let fields := (births).serializedFields heights prior (external).inputs + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) + have values : ∀ j s, s ∈ insert (births).limit (births).limit → + fields.value j s = (external).history.fieldValue j s := by + intro j s hs + rw [(births).serializedFields_value heights prior (external).inputs + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) j hs] + have oldValue (a : ZFSet.{u}) (before : a ∈ (comp).born.births.limit ∨ a = (comp).born.births.limit) : + ((births).chronologyFields heights prior.toHistory).fieldValue j a = (external).history.fieldValue j a := by + have ha : a ∈ insert (comp).born.births.limit (comp).born.births.limit := before.elim + (fun h => ZFSet.mem_insert_of_mem _ h) (fun h => h.symm ▸ ZFSet.mem_insert _ _) + have left := (births).chronologyFields_old heights prior.toHistory before + have right := (external).old_values a before + have eLeft : ((births).chronologyFields heights prior.toHistory).fieldValue j a = prior.fields.value j a := + Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 + (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j + have eRight : (external).history.fieldValue j a = (comp).history.fieldValue j a := + Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 + (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j + exact eLeft.trans ((agreement j a ha).trans eRight.symm) + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · have left := (births).chronologyFields_limit heights prior.toHistory + have right := (external).limit_values + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + · rcases ((births).times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ + · exact oldValue s (Or.inl before) + · exact oldValue s (Or.inr equal) + · have left := (births).chronologyFields_stamp heights prior.toHistory n + have right := (external).stamp_values n + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + have tasks : ZFSet.rank (source.stage.compressionTasks Labels) < ZFSet.rank K := + M.groundEligibleTasks_rank_lt limit source.stage.actors source.stage.order source.stage.meetGraph + source.stage.action invariant.points_rank invariant.labels_rank + have graphs := certificate.externalFieldGraphs_rank_lt pairing unions powers separation collection + infinite hK conditions invariant original originalRank originalAgreement fields values + have raw := (births).serialized_all_ranked_raw_witnesses heights prior (external).inputs + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) + priorRank sourceMatch limit (ZFSet.rank_lt_of_mem conditions.2.1) + tasks invariant.points_rank invariant.actors_rank + have times := conditions.successor_mem pairing unions powers separation infinite hK + (certificate.external_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) + obtain ⟨serial, ground, rank, member, _, exactValues, exactRange⟩ := + fields.exists_rankedSerialization pairing unions powers separation collection infinite choice + hK conditions times level (ordinalSetProperty_succ (births).times.ordinal) + ((births).serializedFields_core heights prior (external).inputs source.stage.group_code source.stage.action_code + pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground + (ZFSet.mem_insert _ _)) graphs raw + exact ⟨serial, ground, rank, member, fun j s hs => (exactValues j s).trans (values j s hs), exactRange⟩ + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedLayerSelection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedLayerSelection.lean index 0d554af4986cd6fea527c5ef03f1e9a1e9b5a2f6..37e73ba3b23da381bccc2b620cf2c476ee0d50d1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedLayerSelection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRankedLayerSelection.lean @@ -1,92 +1,92 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyLayerRelation -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyPairRanks - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundChronologyFields -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem choose_layerGraph_in - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {V : ZFSet.{u}} (hV : V ∈ M.sets) - (core : ChronologyCoreCode T fields.bound C D rD fields.graph) - (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → - ∃ z ∈ V, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) : - ∃ layers ∈ M.sets, ZFSet.IsFunc (chronologyPairs T) V layers ∧ - ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, - ZFSet.pair (ZFSet.pair s t) z ∈ layers → - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by - have hN := M.omega_mem separation infinite - have hPairs := M.chronologyPairs_mem pairing unions powers separation fields.time_ground - let relation := M.definableRelation chronologyLayerRelationFormula - (fields.layerRelationParams ZFSet.omega) (chronologyPairs T) V - have hRelation : relation ∈ M.sets := M.definableRelation_mem pairing unions powers separation - chronologyLayerRelationFormula (fields.layerRelationParams ZFSet.omega) - (fields.layerRelationParams_ground hN) hPairs hV - have total : ∀ p ∈ chronologyPairs T, ∃ z ∈ V, ZFSet.pair p z ∈ relation := by - intro p hp - obtain ⟨s, hs, t, ht, rfl, earlier⟩ := (mem_chronologyPairs T p).1 hp - obtain ⟨z, hz, code⟩ := rawWitnesses s hs t ht earlier - exact ⟨z, hz, (M.pair_mem_definableRelation chronologyLayerRelationFormula - (fields.layerRelationParams ZFSet.omega) (chronologyPairs T) V _ z).2 - ⟨hp, hz, (fields.realize_chronologyLayerRelation pairing unions core hN - (M.transitive hV hz) hs ht earlier).2 code⟩⟩ - obtain ⟨layers, hLayers, function, subset⟩ := - M.uniformize_relation pairing unions powers separation choice hPairs hV hRelation total - refine ⟨layers, hLayers, function, ?_⟩ - intro s hs t ht earlier z entry - have recognized := (M.pair_mem_definableRelation chronologyLayerRelationFormula - (fields.layerRelationParams ZFSet.omega) (chronologyPairs T) V _ z).1 (subset entry) - exact (fields.realize_chronologyLayerRelation pairing unions core hN - (M.transitive hV recognized.2.1) hs ht earlier).1 recognized.2.2 - -theorem choose_rankedLayerGraph - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K V : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (hT : T ∈ K) (hV : V ∈ M.sets) - (level : ∀ x, x ∈ V ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank K) - (core : ChronologyCoreCode T fields.bound C D rD fields.graph) - (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → - ∃ z ∈ M.sets, ZFSet.rank z < ZFSet.rank K ∧ - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) : - ∃ layers ∈ M.sets, ZFSet.IsFunc (chronologyPairs T) V layers ∧ - ZFSet.rank layers < ZFSet.rank K ∧ - ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, - ZFSet.pair (ZFSet.pair s t) z ∈ layers → - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by - have witnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → - ∃ z ∈ V, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by - intro s hs t ht earlier - obtain ⟨z, hz, rank, code⟩ := rawWitnesses s hs t ht earlier - exact ⟨z, (level z).2 ⟨hz, rank⟩, code⟩ - obtain ⟨layers, hLayers, function, codes⟩ := - fields.choose_layerGraph_in pairing unions powers separation infinite choice hV core witnesses - have rank := conditions.functionGraph_rank_lt_small_cumulative pairing unions powers separation - collection infinite hK (M.chronologyPairs_mem pairing unions powers separation fields.time_ground) - (conditions.chronologyPairs_below pairing unions powers separation hK hT) - (fun _ hp => conditions.chronologyPairs_member_rank_lt pairing unions powers separation hK hT infinite hp) - hLayers function level - exact ⟨layers, hLayers, function, rank, codes⟩ - -end PartitionPilot.Forcing.GroundChronologyFields - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyLayerRelation +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyPairRanks + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundChronologyFields +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem choose_layerGraph_in + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {V : ZFSet.{u}} (hV : V ∈ M.sets) + (core : ChronologyCoreCode T fields.bound C D rD fields.graph) + (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → + ∃ z ∈ V, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) : + ∃ layers ∈ M.sets, ZFSet.IsFunc (chronologyPairs T) V layers ∧ + ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, + ZFSet.pair (ZFSet.pair s t) z ∈ layers → + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by + have hN := M.omega_mem separation infinite + have hPairs := M.chronologyPairs_mem pairing unions powers separation fields.time_ground + let relation := M.definableRelation chronologyLayerRelationFormula + (fields.layerRelationParams ZFSet.omega) (chronologyPairs T) V + have hRelation : relation ∈ M.sets := M.definableRelation_mem pairing unions powers separation + chronologyLayerRelationFormula (fields.layerRelationParams ZFSet.omega) + (fields.layerRelationParams_ground hN) hPairs hV + have total : ∀ p ∈ chronologyPairs T, ∃ z ∈ V, ZFSet.pair p z ∈ relation := by + intro p hp + obtain ⟨s, hs, t, ht, rfl, earlier⟩ := (mem_chronologyPairs T p).1 hp + obtain ⟨z, hz, code⟩ := rawWitnesses s hs t ht earlier + exact ⟨z, hz, (M.pair_mem_definableRelation chronologyLayerRelationFormula + (fields.layerRelationParams ZFSet.omega) (chronologyPairs T) V _ z).2 + ⟨hp, hz, (fields.realize_chronologyLayerRelation pairing unions core hN + (M.transitive hV hz) hs ht earlier).2 code⟩⟩ + obtain ⟨layers, hLayers, function, subset⟩ := + M.uniformize_relation pairing unions powers separation choice hPairs hV hRelation total + refine ⟨layers, hLayers, function, ?_⟩ + intro s hs t ht earlier z entry + have recognized := (M.pair_mem_definableRelation chronologyLayerRelationFormula + (fields.layerRelationParams ZFSet.omega) (chronologyPairs T) V _ z).1 (subset entry) + exact (fields.realize_chronologyLayerRelation pairing unions core hN + (M.transitive hV recognized.2.1) hs ht earlier).1 recognized.2.2 + +theorem choose_rankedLayerGraph + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K V : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (hT : T ∈ K) (hV : V ∈ M.sets) + (level : ∀ x, x ∈ V ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank K) + (core : ChronologyCoreCode T fields.bound C D rD fields.graph) + (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → + ∃ z ∈ M.sets, ZFSet.rank z < ZFSet.rank K ∧ + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) : + ∃ layers ∈ M.sets, ZFSet.IsFunc (chronologyPairs T) V layers ∧ + ZFSet.rank layers < ZFSet.rank K ∧ + ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, + ZFSet.pair (ZFSet.pair s t) z ∈ layers → + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by + have witnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → + ∃ z ∈ V, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z := by + intro s hs t ht earlier + obtain ⟨z, hz, rank, code⟩ := rawWitnesses s hs t ht earlier + exact ⟨z, (level z).2 ⟨hz, rank⟩, code⟩ + obtain ⟨layers, hLayers, function, codes⟩ := + fields.choose_layerGraph_in pairing unions powers separation infinite choice hV core witnesses + have rank := conditions.functionGraph_rank_lt_small_cumulative pairing unions powers separation + collection infinite hK (M.chronologyPairs_mem pairing unions powers separation fields.time_ground) + (conditions.chronologyPairs_below pairing unions powers separation hK hT) + (fun _ hp => conditions.chronologyPairs_member_rank_lt pairing unions powers separation hK hT infinite hp) + hLayers function level + exact ⟨layers, hLayers, function, rank, codes⟩ + +end PartitionPilot.Forcing.GroundChronologyFields + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawCandidateDensity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawCandidateDensity.lean index 6e0b08555135ecb0535f21139d34726d652bb214..7cd946d23c0f4554534e5272352da2243902f00c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawCandidateDensity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawCandidateDensity.lean @@ -1,51 +1,51 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u - -def rawCandidateDensity (M : TransitiveGround.{u}) {n : Nat} - (phi : SetFormula (n + 1)) (Q order W base : ZFSet.{u}) - (env : Fin n → ZFSet.{u}) : Prop := - ∀ p ∈ Q, ZFSet.pair p base ∈ order → - ∃ q ∈ Q, ZFSet.pair q p ∈ order ∧ - Realize M.sets (candidateForcingFormula phi) - (extend q (extend W (extend Q (extend order env)))) - -theorem rawCandidateDensity_iff (M : TransitiveGround.{u}) - {P : Type u} [Preorder P] (s : Presentation P) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {n : Nat} (phi : SetFormula (n + 1)) (env : Assignment (M.nameDomain s) n) - (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) (base : P) : - M.rawCandidateDensity phi s.carrier s.conditionOrder W (s.encode base) - (fun i => (env i).val.val) ↔ - DenseBelow base {q | ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ - Forces (M.nameDomain s) phi (extend tau env) q} := by - constructor - · intro dense p below - obtain ⟨rawQ, member, relation, truth⟩ := dense (s.encode p) (s.encode_mem p) - ((s.pair_mem_conditionOrder p base).2 below) - obtain ⟨q, rfl⟩ := (s.mem_carrier rawQ).1 member - exact ⟨q, (s.pair_mem_conditionOrder q p).1 relation, - (M.realize_candidateForcingFormula s pairing unions powers separation collection - carrier order phi env W valid q).1 truth⟩ - · intro dense rawP member relation - obtain ⟨p, rfl⟩ := (s.mem_carrier rawP).1 member - obtain ⟨q, below, forced⟩ := dense p ((s.pair_mem_conditionOrder p base).1 relation) - exact ⟨s.encode q, s.encode_mem q, (s.pair_mem_conditionOrder q p).2 below, - (M.realize_candidateForcingFormula s pairing unions powers separation collection - carrier order phi env W valid q).2 forced⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u + +def rawCandidateDensity (M : TransitiveGround.{u}) {n : Nat} + (phi : SetFormula (n + 1)) (Q order W base : ZFSet.{u}) + (env : Fin n → ZFSet.{u}) : Prop := + ∀ p ∈ Q, ZFSet.pair p base ∈ order → + ∃ q ∈ Q, ZFSet.pair q p ∈ order ∧ + Realize M.sets (candidateForcingFormula phi) + (extend q (extend W (extend Q (extend order env)))) + +theorem rawCandidateDensity_iff (M : TransitiveGround.{u}) + {P : Type u} [Preorder P] (s : Presentation P) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {n : Nat} (phi : SetFormula (n + 1)) (env : Assignment (M.nameDomain s) n) + (W : ZFSet.{u}) (valid : ∀ z ∈ W, IsName s z) (base : P) : + M.rawCandidateDensity phi s.carrier s.conditionOrder W (s.encode base) + (fun i => (env i).val.val) ↔ + DenseBelow base {q | ∃ tau : (M.nameDomain s).names, tau.val.val ∈ W ∧ + Forces (M.nameDomain s) phi (extend tau env) q} := by + constructor + · intro dense p below + obtain ⟨rawQ, member, relation, truth⟩ := dense (s.encode p) (s.encode_mem p) + ((s.pair_mem_conditionOrder p base).2 below) + obtain ⟨q, rfl⟩ := (s.mem_carrier rawQ).1 member + exact ⟨q, (s.pair_mem_conditionOrder q p).1 relation, + (M.realize_candidateForcingFormula s pairing unions powers separation collection + carrier order phi env W valid q).1 truth⟩ + · intro dense rawP member relation + obtain ⟨p, rfl⟩ := (s.mem_carrier rawP).1 member + obtain ⟨q, below, forced⟩ := dense p ((s.pair_mem_conditionOrder p base).1 relation) + exact ⟨s.encode q, s.encode_mem q, (s.pair_mem_conditionOrder q p).2 below, + (M.realize_candidateForcingFormula s pairing unions powers separation collection + carrier order phi env W valid q).2 forced⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawLayerPushforward.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawLayerPushforward.lean index 6ea61912657d06d0aaa9afd8072f192597c3b154..dd31a6a7d72b0ce5d667a16aa54655e4ff1f36a5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawLayerPushforward.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawLayerPushforward.lean @@ -1,267 +1,267 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleProvenance -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.OwnerBirthLayerTransport - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def mapFamilyDiagonal (I : ZFSet.{u}) : ZFSet.{u} := - pairedGraph I I I (identityFunctionGraph I) (identityFunctionGraph I) - -theorem pair_mem_mapFamilyDiagonal (I i k : ZFSet.{u}) : - ZFSet.pair i k ∈ mapFamilyDiagonal I ↔ i ∈ I ∧ k = ZFSet.pair i i := by - constructor - · intro entry - obtain ⟨j, hj, a, _, b, _, equal, first, second⟩ := (mem_pairedGraph _ _ _ _ _ _).1 entry - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have fa := (pair_mem_identityFunctionGraph I i a).1 first - have fb := (pair_mem_identityFunctionGraph I i b).1 second - exact ⟨hj, congrArg₂ ZFSet.pair fa.1.symm fb.1.symm⟩ - · rintro ⟨hi, rfl⟩ - exact (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 ⟨hi, hi, hi, - (pair_mem_identityFunctionGraph I i i).2 ⟨rfl, hi⟩, - (pair_mem_identityFunctionGraph I i i).2 ⟨rfl, hi⟩⟩ - -theorem mapFamilyDiagonal_function (I : ZFSet.{u}) : - ZFSet.IsFunc I (ZFSet.prod I I) (mapFamilyDiagonal I) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨i, hi, a, ha, b, hb, rfl, _, _⟩ := (mem_pairedGraph _ _ _ _ _ _).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hi, ZFSet.pair_mem_prod.2 ⟨ha, hb⟩⟩ - intro i hi - exact ⟨ZFSet.pair i i, (pair_mem_mapFamilyDiagonal I i _).2 ⟨hi, rfl⟩, - fun k hk => ((pair_mem_mapFamilyDiagonal I i k).1 hk).2⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def mapFamilyPushforward (I U A B Maps e : ZFSet.{u}) : ZFSet.{u} := - relationCompose I (ZFSet.prod I I) (M.groundRelations U B) (mapFamilyDiagonal I) - (M.groundPairCompositions (ZFSet.prod I I) I I U A B Maps (constantFamilyGraph I e)) - -theorem mapFamilyPushforward_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I U A B Maps e : ZFSet.{u}} - (hI : I ∈ M.sets) (hU : U ∈ M.sets) (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (hMaps : Maps ∈ M.sets) (he : e ∈ M.sets) (maps : FunctionGraphOn I Maps) : - M.mapFamilyPushforward I U A B Maps e ∈ M.sets ∧ - ZFSet.IsFunc I (M.groundRelations U B) (M.mapFamilyPushforward I U A B Maps e) ∧ - ∀ i f c, ZFSet.pair i f ∈ Maps → - (ZFSet.pair i c ∈ M.mapFamilyPushforward I U A B Maps e ↔ - c = relationCompose U A B f e) := by - have hII := M.prod_mem pairing unions powers separation hI hI - have hW := M.groundRelations_mem pairing unions powers separation hU hB - have hConst := M.constantFamilyGraph_mem pairing unions powers separation hI he - have composed := M.groundPairCompositions_spec pairing unions powers separation - hII hI hI hU hA hB hMaps hConst maps - ⟨{e}, constantFamilyGraph_function I e⟩ (fun _ hx => hx) - have hId := M.identityFunctionGraph_mem pairing unions powers separation hI - have hDelta := M.pairedGraph_mem pairing unions powers separation hI hI hI hId hId - refine ⟨M.relationCompose_mem pairing unions powers separation hI hII hW hDelta composed.1, - relationCompose_function_of_subset (mapFamilyDiagonal_function I) composed.2.1 (fun _ hx => hx), ?_⟩ - intro i f c entry - have hi := maps.pair_source entry - have constant := (pair_mem_constantFamilyGraph I e i e).2 ⟨hi, rfl⟩ - have atDiagonal := composed.2.2 i i f e c entry constant - constructor - · intro copied - obtain ⟨_, _, k, _, diagonal, output⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 copied - have equal := ((pair_mem_mapFamilyDiagonal I i k).1 diagonal).2 - rw [equal] at output - exact (atDiagonal.1 output).2 - · intro equal - have output := atDiagonal.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hi⟩, equal⟩ - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hi, - (ZFSet.pair_mem_prod.1 (composed.2.1.1 output)).2, - ZFSet.pair i i, ZFSet.pair_mem_prod.2 ⟨hi, hi⟩, - (pair_mem_mapFamilyDiagonal I i _).2 ⟨hi, rfl⟩, output⟩ - -end TransitiveGround - -theorem relationImage_compose_bound {P U A B f e x y : ZFSet.{u}} - (subset : P ⊆ U) (image : x ∈ relationImage P A f) - (hy : y ∈ B) (copied : ZFSet.pair x y ∈ e) : - y ∈ relationImage P B (relationCompose U A B f e) := by - obtain ⟨hx, p, hp, entry⟩ := (mem_relationImage _ _ _ _).1 image - exact (mem_relationImage _ _ _ _).2 ⟨hy, p, hp, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨subset hp, hy, x, hx, entry, copied⟩⟩ - -namespace CopyEmbeddingFamilyCode - -theorem pushforward - {Qs rs μs A B rA rB μA μB t I Indices Maps Maps' U e : ZFSet.{u}} - (code : CopyEmbeddingFamilyCode Qs rs μs A rA μA t I Indices Maps) - (maps : FunctionGraphOn I Maps) - (entries : ∀ i f c, ZFSet.pair i f ∈ Maps → - (ZFSet.pair i c ∈ Maps' ↔ c = relationCompose U A B f e)) - (bound : ∀ s P, ZFSet.pair s P ∈ Qs → P ⊆ U) - (embedding : MeetEmbeddingCode A B rA rB μA μB e) : - CopyEmbeddingFamilyCode Qs rs μs B rB μB t I Indices Maps' := by - intro i hi s hs c P R V index map qField rField mField - obtain ⟨f, oldMap⟩ := maps.total hi - have original := code i hi s hs f P R V index oldMap qField rField mField - rw [(entries i f c oldMap).1 map, - relationCompose_domain_eq (bound s P qField) original.injection.function.1] - exact original.compose embedding -end CopyEmbeddingFamilyCode - -namespace CountableLayerCode - -theorem ground_pushforward - {M : TransitiveGround.{u}} {A B old born t D N injection e : ZFSet.{u}} - (code : CountableLayerCode A old t D N injection) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) (he : e ∈ M.sets) - (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) - (embedding : InjectionCode A B e) - (preserves : ∀ x y a, ZFSet.pair x y ∈ e → - (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) - (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : - ∃ D' ∈ M.sets, ∃ injection' ∈ M.sets, CountableLayerCode B born t D' N injection' := by - let D0 := ZFSet.sep (fun x => x ∈ A) D - let f0 := ZFSet.sep (fun z => z ∈ ZFSet.prod D0 N) injection - let e0 := ZFSet.sep (fun z => z ∈ ZFSet.prod D0 B) e - have hD0 : D0 ∈ M.sets := M.bounded_separation_mem separation (.mem 0 1) - (extend A Fin.elim0) (Fin.cases hA (fun i => Fin.elim0 i)) hD - have hf0 : f0 ∈ M.sets := M.injection_restriction_mem separation hD0 hN hInjection - have he0 : e0 ∈ M.sets := M.injection_restriction_mem separation hD0 hB he - have fcode : InjectionCode D0 N f0 := code.small.restrict (fun _ hx => (ZFSet.mem_sep.1 hx).1) - have ecode : InjectionCode D0 B e0 := embedding.restrict (fun _ hx => (ZFSet.mem_sep.1 hx).2) - refine ⟨relationImage D0 B e0, M.relationImage_mem separation hD0 hB he0, - pushedHeightGraph D0 B N e0 f0, - M.pushedHeightGraph_mem pairing unions powers separation hD0 hB hN he0 hf0, - ecode.converse_image.compose fcode, ?_⟩ - intro y hy yt - obtain ⟨x, hx, copied⟩ := noNew y hy yt - have hD0x : x ∈ D0 := ZFSet.mem_sep.2 ⟨code.cover x hx ((preserves x y t copied).1 yt), hx⟩ - exact (mem_relationImage _ _ _ _).2 ⟨hy, x, hD0x, - ZFSet.mem_sep.2 ⟨copied, ZFSet.pair_mem_prod.2 ⟨hD0x, hy⟩⟩⟩ -end CountableLayerCode - -namespace CopyLayerCode - -theorem ground_pushforward - {M : TransitiveGround.{u}} - {Qs rs μs A B rA rB μA μB old born t I parts Indices Maps W N injection e : ZFSet.{u}} - (code : CopyLayerCode Qs rs μs A rA μA old t I parts Indices Maps W N injection) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) (hQs : Qs ∈ M.sets) - (hI : I ∈ M.sets) (hParts : parts ∈ M.sets) (hMaps : Maps ∈ M.sets) - (embedding : MeetEmbeddingCode A B rA rB μA μB e) - (preserves : ∀ x y a, ZFSet.pair x y ∈ e → - (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) - (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : - let U := familyPointBound Qs - let Maps' := M.mapFamilyPushforward I U A B Maps e - let W' := M.groundRelations U B - let parts' := relationCompose I A B parts e - Maps' ∈ M.sets ∧ W' ∈ M.sets ∧ parts' ∈ M.sets ∧ - CopyLayerCode Qs rs μs B rB μB born t I parts' Indices Maps' W' N injection := by - dsimp only - have hU := M.familyPointBound_mem unions hQs - have maps : FunctionGraphOn I Maps := ⟨W, code.maps⟩ - have pushed := M.mapFamilyPushforward_spec pairing unions powers separation hI hU hA hB hMaps he maps - have bound : ∀ s P, ZFSet.pair s P ∈ Qs → P ⊆ familyPointBound Qs := - fun _ _ entry _ hp => mem_familyPointBound_of_entry entry hp - refine ⟨pushed.1, M.groundRelations_mem pairing unions powers separation hU hB, - M.relationCompose_mem pairing unions powers separation hI hA hB hParts he, - code.small, code.indices, pushed.2.1, - code.embedding.pushforward maps pushed.2.2 bound embedding, ?_, ?_⟩ - · intro y hy yt - obtain ⟨x, hx, copied⟩ := noNew y hy yt - obtain ⟨i, hi, part⟩ := code.cover x hx ((preserves x y t copied).1 yt) - exact ⟨i, hi, (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hi, hy, x, hx, part, copied⟩⟩ - · intro i hi s hs c P y hy index map qField part - obtain ⟨f, oldMap⟩ := maps.total hi - rw [(pushed.2.2 i f c oldMap).1 map] - obtain ⟨_, _, x, hx, original, copied⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 part - exact relationImage_compose_bound (bound s P qField) - (code.inCopy i hi s hs f P x hx index oldMap qField original) hy copied -end CopyLayerCode - -noncomputable def layerFiberEmbedding (F B e : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ ZFSet.prod F B) e - -namespace SeparatedLayerCode - -theorem ground_pushforward - {M : TransitiveGround.{u}} - {Qs rs μs A B rA rB μA μB old born t I Indices Maps W Components F e : ZFSet.{u}} - (code : SeparatedLayerCode Qs rs μs A rA μA old t I Indices Maps W Components F) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) (hQs : Qs ∈ M.sets) - (hI : I ∈ M.sets) (hMaps : Maps ∈ M.sets) (hComponents : Components ∈ M.sets) (hF : F ∈ M.sets) - (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) - (preserves : ∀ x y a, ZFSet.pair x y ∈ e → - (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) - (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : - let U := familyPointBound Qs - let Maps' := M.mapFamilyPushforward I U A B Maps e - let W' := M.groundRelations U B - let eF := layerFiberEmbedding F B e - let F' := relationImage F B eF - let Components' := pushedHeightGraph F B I eF Components - Maps' ∈ M.sets ∧ W' ∈ M.sets ∧ Components' ∈ M.sets ∧ F' ∈ M.sets ∧ - SeparatedLayerCode Qs rs μs B rB μB born t I Indices Maps' W' Components' F' := by - dsimp only - have hU := M.familyPointBound_mem unions hQs - have maps : FunctionGraphOn I Maps := ⟨W, code.maps⟩ - have pushed := M.mapFamilyPushforward_spec pairing unions powers separation hI hU hA hB hMaps he maps - have bound : ∀ s P, ZFSet.pair s P ∈ Qs → P ⊆ familyPointBound Qs := - fun _ _ entry _ hp => mem_familyPointBound_of_entry entry hp - have fiberPoint : ∀ x ∈ F, x ∈ A ∧ ZFSet.pair x t ∈ old := by - intro x hx - exact (mem_layerBirthFiber A old t x).1 (code.fiber ▸ hx) - have ecode : InjectionCode F B (layerFiberEmbedding F B e) := - embedding.injection.restrict (fun x hx => (fiberPoint x hx).1) - have heF : layerFiberEmbedding F B e ∈ M.sets := M.injection_restriction_mem separation hF hB he - have fiberEq : relationImage F B (layerFiberEmbedding F B e) = layerBirthFiber B born t := by - apply ZFSet.ext - intro y - rw [mem_relationImage, mem_layerBirthFiber] - constructor - · rintro ⟨hy, x, hx, copied⟩ - exact ⟨hy, (preserves x y t (ZFSet.mem_sep.1 copied).1).2 (fiberPoint x hx).2⟩ - · rintro ⟨hy, yt⟩ - obtain ⟨x, hx, copied⟩ := noNew y hy yt - have hFx : x ∈ F := code.fiber.symm ▸ - (mem_layerBirthFiber A old t x).2 ⟨hx, (preserves x y t copied).1 yt⟩ - exact ⟨hy, x, hFx, ZFSet.mem_sep.2 ⟨copied, ZFSet.pair_mem_prod.2 ⟨hFx, hy⟩⟩⟩ - refine ⟨pushed.1, M.groundRelations_mem pairing unions powers separation hU hB, - M.pushedHeightGraph_mem pairing unions powers separation hF hB hI heF hComponents, - M.relationImage_mem separation hF hB heF, - code.indices, pushed.2.1, fiberEq, pushedHeightGraph_function ecode code.components, - code.embedding.pushforward maps pushed.2.2 bound embedding, ?_, ?_⟩ - · intro i hi s hs c P y hy index map qField component - obtain ⟨f, oldMap⟩ := maps.total hi - rw [(pushed.2.2 i f c oldMap).1 map] - obtain ⟨_, _, x, hx, inverse, oldComponent⟩ := - (pair_mem_relationCompose _ _ _ _ _ _ _).1 component - have copied := (pair_mem_relationConverse _ _ _ _ _).1 inverse - exact relationImage_compose_bound (bound s P qField) - (code.cover i hi s hs f P x (fiberPoint x hx).1 index oldMap qField oldComponent) - hy (ZFSet.mem_sep.1 copied.2.2).1 - · intro y hy z hz i hi j hj yi zj different - obtain ⟨_, x, hx, xy⟩ := (mem_relationImage _ _ _ _).1 hy - obtain ⟨_, w, hw, wz⟩ := (mem_relationImage _ _ _ _).1 hz - have xi := (pushedHeightGraph_entry ecode code.components xy).1 yi - have wj := (pushedHeightGraph_entry ecode code.components wz).1 zj - exact (code.separated x hx w hw i hi j hj xi wj different).map source embedding - (fun a b s copied born => (preserves a b s copied).2 born) - (ZFSet.mem_sep.1 xy).1 (ZFSet.mem_sep.1 wz).1 -end SeparatedLayerCode - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleProvenance +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.OwnerBirthLayerTransport + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def mapFamilyDiagonal (I : ZFSet.{u}) : ZFSet.{u} := + pairedGraph I I I (identityFunctionGraph I) (identityFunctionGraph I) + +theorem pair_mem_mapFamilyDiagonal (I i k : ZFSet.{u}) : + ZFSet.pair i k ∈ mapFamilyDiagonal I ↔ i ∈ I ∧ k = ZFSet.pair i i := by + constructor + · intro entry + obtain ⟨j, hj, a, _, b, _, equal, first, second⟩ := (mem_pairedGraph _ _ _ _ _ _).1 entry + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have fa := (pair_mem_identityFunctionGraph I i a).1 first + have fb := (pair_mem_identityFunctionGraph I i b).1 second + exact ⟨hj, congrArg₂ ZFSet.pair fa.1.symm fb.1.symm⟩ + · rintro ⟨hi, rfl⟩ + exact (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 ⟨hi, hi, hi, + (pair_mem_identityFunctionGraph I i i).2 ⟨rfl, hi⟩, + (pair_mem_identityFunctionGraph I i i).2 ⟨rfl, hi⟩⟩ + +theorem mapFamilyDiagonal_function (I : ZFSet.{u}) : + ZFSet.IsFunc I (ZFSet.prod I I) (mapFamilyDiagonal I) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨i, hi, a, ha, b, hb, rfl, _, _⟩ := (mem_pairedGraph _ _ _ _ _ _).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hi, ZFSet.pair_mem_prod.2 ⟨ha, hb⟩⟩ + intro i hi + exact ⟨ZFSet.pair i i, (pair_mem_mapFamilyDiagonal I i _).2 ⟨hi, rfl⟩, + fun k hk => ((pair_mem_mapFamilyDiagonal I i k).1 hk).2⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def mapFamilyPushforward (I U A B Maps e : ZFSet.{u}) : ZFSet.{u} := + relationCompose I (ZFSet.prod I I) (M.groundRelations U B) (mapFamilyDiagonal I) + (M.groundPairCompositions (ZFSet.prod I I) I I U A B Maps (constantFamilyGraph I e)) + +theorem mapFamilyPushforward_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I U A B Maps e : ZFSet.{u}} + (hI : I ∈ M.sets) (hU : U ∈ M.sets) (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (hMaps : Maps ∈ M.sets) (he : e ∈ M.sets) (maps : FunctionGraphOn I Maps) : + M.mapFamilyPushforward I U A B Maps e ∈ M.sets ∧ + ZFSet.IsFunc I (M.groundRelations U B) (M.mapFamilyPushforward I U A B Maps e) ∧ + ∀ i f c, ZFSet.pair i f ∈ Maps → + (ZFSet.pair i c ∈ M.mapFamilyPushforward I U A B Maps e ↔ + c = relationCompose U A B f e) := by + have hII := M.prod_mem pairing unions powers separation hI hI + have hW := M.groundRelations_mem pairing unions powers separation hU hB + have hConst := M.constantFamilyGraph_mem pairing unions powers separation hI he + have composed := M.groundPairCompositions_spec pairing unions powers separation + hII hI hI hU hA hB hMaps hConst maps + ⟨{e}, constantFamilyGraph_function I e⟩ (fun _ hx => hx) + have hId := M.identityFunctionGraph_mem pairing unions powers separation hI + have hDelta := M.pairedGraph_mem pairing unions powers separation hI hI hI hId hId + refine ⟨M.relationCompose_mem pairing unions powers separation hI hII hW hDelta composed.1, + relationCompose_function_of_subset (mapFamilyDiagonal_function I) composed.2.1 (fun _ hx => hx), ?_⟩ + intro i f c entry + have hi := maps.pair_source entry + have constant := (pair_mem_constantFamilyGraph I e i e).2 ⟨hi, rfl⟩ + have atDiagonal := composed.2.2 i i f e c entry constant + constructor + · intro copied + obtain ⟨_, _, k, _, diagonal, output⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 copied + have equal := ((pair_mem_mapFamilyDiagonal I i k).1 diagonal).2 + rw [equal] at output + exact (atDiagonal.1 output).2 + · intro equal + have output := atDiagonal.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hi⟩, equal⟩ + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hi, + (ZFSet.pair_mem_prod.1 (composed.2.1.1 output)).2, + ZFSet.pair i i, ZFSet.pair_mem_prod.2 ⟨hi, hi⟩, + (pair_mem_mapFamilyDiagonal I i _).2 ⟨hi, rfl⟩, output⟩ + +end TransitiveGround + +theorem relationImage_compose_bound {P U A B f e x y : ZFSet.{u}} + (subset : P ⊆ U) (image : x ∈ relationImage P A f) + (hy : y ∈ B) (copied : ZFSet.pair x y ∈ e) : + y ∈ relationImage P B (relationCompose U A B f e) := by + obtain ⟨hx, p, hp, entry⟩ := (mem_relationImage _ _ _ _).1 image + exact (mem_relationImage _ _ _ _).2 ⟨hy, p, hp, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨subset hp, hy, x, hx, entry, copied⟩⟩ + +namespace CopyEmbeddingFamilyCode + +theorem pushforward + {Qs rs μs A B rA rB μA μB t I Indices Maps Maps' U e : ZFSet.{u}} + (code : CopyEmbeddingFamilyCode Qs rs μs A rA μA t I Indices Maps) + (maps : FunctionGraphOn I Maps) + (entries : ∀ i f c, ZFSet.pair i f ∈ Maps → + (ZFSet.pair i c ∈ Maps' ↔ c = relationCompose U A B f e)) + (bound : ∀ s P, ZFSet.pair s P ∈ Qs → P ⊆ U) + (embedding : MeetEmbeddingCode A B rA rB μA μB e) : + CopyEmbeddingFamilyCode Qs rs μs B rB μB t I Indices Maps' := by + intro i hi s hs c P R V index map qField rField mField + obtain ⟨f, oldMap⟩ := maps.total hi + have original := code i hi s hs f P R V index oldMap qField rField mField + rw [(entries i f c oldMap).1 map, + relationCompose_domain_eq (bound s P qField) original.injection.function.1] + exact original.compose embedding +end CopyEmbeddingFamilyCode + +namespace CountableLayerCode + +theorem ground_pushforward + {M : TransitiveGround.{u}} {A B old born t D N injection e : ZFSet.{u}} + (code : CountableLayerCode A old t D N injection) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) (he : e ∈ M.sets) + (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) + (embedding : InjectionCode A B e) + (preserves : ∀ x y a, ZFSet.pair x y ∈ e → + (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) + (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : + ∃ D' ∈ M.sets, ∃ injection' ∈ M.sets, CountableLayerCode B born t D' N injection' := by + let D0 := ZFSet.sep (fun x => x ∈ A) D + let f0 := ZFSet.sep (fun z => z ∈ ZFSet.prod D0 N) injection + let e0 := ZFSet.sep (fun z => z ∈ ZFSet.prod D0 B) e + have hD0 : D0 ∈ M.sets := M.bounded_separation_mem separation (.mem 0 1) + (extend A Fin.elim0) (Fin.cases hA (fun i => Fin.elim0 i)) hD + have hf0 : f0 ∈ M.sets := M.injection_restriction_mem separation hD0 hN hInjection + have he0 : e0 ∈ M.sets := M.injection_restriction_mem separation hD0 hB he + have fcode : InjectionCode D0 N f0 := code.small.restrict (fun _ hx => (ZFSet.mem_sep.1 hx).1) + have ecode : InjectionCode D0 B e0 := embedding.restrict (fun _ hx => (ZFSet.mem_sep.1 hx).2) + refine ⟨relationImage D0 B e0, M.relationImage_mem separation hD0 hB he0, + pushedHeightGraph D0 B N e0 f0, + M.pushedHeightGraph_mem pairing unions powers separation hD0 hB hN he0 hf0, + ecode.converse_image.compose fcode, ?_⟩ + intro y hy yt + obtain ⟨x, hx, copied⟩ := noNew y hy yt + have hD0x : x ∈ D0 := ZFSet.mem_sep.2 ⟨code.cover x hx ((preserves x y t copied).1 yt), hx⟩ + exact (mem_relationImage _ _ _ _).2 ⟨hy, x, hD0x, + ZFSet.mem_sep.2 ⟨copied, ZFSet.pair_mem_prod.2 ⟨hD0x, hy⟩⟩⟩ +end CountableLayerCode + +namespace CopyLayerCode + +theorem ground_pushforward + {M : TransitiveGround.{u}} + {Qs rs μs A B rA rB μA μB old born t I parts Indices Maps W N injection e : ZFSet.{u}} + (code : CopyLayerCode Qs rs μs A rA μA old t I parts Indices Maps W N injection) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) (hQs : Qs ∈ M.sets) + (hI : I ∈ M.sets) (hParts : parts ∈ M.sets) (hMaps : Maps ∈ M.sets) + (embedding : MeetEmbeddingCode A B rA rB μA μB e) + (preserves : ∀ x y a, ZFSet.pair x y ∈ e → + (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) + (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : + let U := familyPointBound Qs + let Maps' := M.mapFamilyPushforward I U A B Maps e + let W' := M.groundRelations U B + let parts' := relationCompose I A B parts e + Maps' ∈ M.sets ∧ W' ∈ M.sets ∧ parts' ∈ M.sets ∧ + CopyLayerCode Qs rs μs B rB μB born t I parts' Indices Maps' W' N injection := by + dsimp only + have hU := M.familyPointBound_mem unions hQs + have maps : FunctionGraphOn I Maps := ⟨W, code.maps⟩ + have pushed := M.mapFamilyPushforward_spec pairing unions powers separation hI hU hA hB hMaps he maps + have bound : ∀ s P, ZFSet.pair s P ∈ Qs → P ⊆ familyPointBound Qs := + fun _ _ entry _ hp => mem_familyPointBound_of_entry entry hp + refine ⟨pushed.1, M.groundRelations_mem pairing unions powers separation hU hB, + M.relationCompose_mem pairing unions powers separation hI hA hB hParts he, + code.small, code.indices, pushed.2.1, + code.embedding.pushforward maps pushed.2.2 bound embedding, ?_, ?_⟩ + · intro y hy yt + obtain ⟨x, hx, copied⟩ := noNew y hy yt + obtain ⟨i, hi, part⟩ := code.cover x hx ((preserves x y t copied).1 yt) + exact ⟨i, hi, (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hi, hy, x, hx, part, copied⟩⟩ + · intro i hi s hs c P y hy index map qField part + obtain ⟨f, oldMap⟩ := maps.total hi + rw [(pushed.2.2 i f c oldMap).1 map] + obtain ⟨_, _, x, hx, original, copied⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 part + exact relationImage_compose_bound (bound s P qField) + (code.inCopy i hi s hs f P x hx index oldMap qField original) hy copied +end CopyLayerCode + +noncomputable def layerFiberEmbedding (F B e : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ ZFSet.prod F B) e + +namespace SeparatedLayerCode + +theorem ground_pushforward + {M : TransitiveGround.{u}} + {Qs rs μs A B rA rB μA μB old born t I Indices Maps W Components F e : ZFSet.{u}} + (code : SeparatedLayerCode Qs rs μs A rA μA old t I Indices Maps W Components F) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) (hQs : Qs ∈ M.sets) + (hI : I ∈ M.sets) (hMaps : Maps ∈ M.sets) (hComponents : Components ∈ M.sets) (hF : F ∈ M.sets) + (source : MeetOrderCode A rA μA) (embedding : MeetEmbeddingCode A B rA rB μA μB e) + (preserves : ∀ x y a, ZFSet.pair x y ∈ e → + (ZFSet.pair y a ∈ born ↔ ZFSet.pair x a ∈ old)) + (noNew : ∀ y ∈ B, ZFSet.pair y t ∈ born → ∃ x ∈ A, ZFSet.pair x y ∈ e) : + let U := familyPointBound Qs + let Maps' := M.mapFamilyPushforward I U A B Maps e + let W' := M.groundRelations U B + let eF := layerFiberEmbedding F B e + let F' := relationImage F B eF + let Components' := pushedHeightGraph F B I eF Components + Maps' ∈ M.sets ∧ W' ∈ M.sets ∧ Components' ∈ M.sets ∧ F' ∈ M.sets ∧ + SeparatedLayerCode Qs rs μs B rB μB born t I Indices Maps' W' Components' F' := by + dsimp only + have hU := M.familyPointBound_mem unions hQs + have maps : FunctionGraphOn I Maps := ⟨W, code.maps⟩ + have pushed := M.mapFamilyPushforward_spec pairing unions powers separation hI hU hA hB hMaps he maps + have bound : ∀ s P, ZFSet.pair s P ∈ Qs → P ⊆ familyPointBound Qs := + fun _ _ entry _ hp => mem_familyPointBound_of_entry entry hp + have fiberPoint : ∀ x ∈ F, x ∈ A ∧ ZFSet.pair x t ∈ old := by + intro x hx + exact (mem_layerBirthFiber A old t x).1 (code.fiber ▸ hx) + have ecode : InjectionCode F B (layerFiberEmbedding F B e) := + embedding.injection.restrict (fun x hx => (fiberPoint x hx).1) + have heF : layerFiberEmbedding F B e ∈ M.sets := M.injection_restriction_mem separation hF hB he + have fiberEq : relationImage F B (layerFiberEmbedding F B e) = layerBirthFiber B born t := by + apply ZFSet.ext + intro y + rw [mem_relationImage, mem_layerBirthFiber] + constructor + · rintro ⟨hy, x, hx, copied⟩ + exact ⟨hy, (preserves x y t (ZFSet.mem_sep.1 copied).1).2 (fiberPoint x hx).2⟩ + · rintro ⟨hy, yt⟩ + obtain ⟨x, hx, copied⟩ := noNew y hy yt + have hFx : x ∈ F := code.fiber.symm ▸ + (mem_layerBirthFiber A old t x).2 ⟨hx, (preserves x y t copied).1 yt⟩ + exact ⟨hy, x, hFx, ZFSet.mem_sep.2 ⟨copied, ZFSet.pair_mem_prod.2 ⟨hFx, hy⟩⟩⟩ + refine ⟨pushed.1, M.groundRelations_mem pairing unions powers separation hU hB, + M.pushedHeightGraph_mem pairing unions powers separation hF hB hI heF hComponents, + M.relationImage_mem separation hF hB heF, + code.indices, pushed.2.1, fiberEq, pushedHeightGraph_function ecode code.components, + code.embedding.pushforward maps pushed.2.2 bound embedding, ?_, ?_⟩ + · intro i hi s hs c P y hy index map qField component + obtain ⟨f, oldMap⟩ := maps.total hi + rw [(pushed.2.2 i f c oldMap).1 map] + obtain ⟨_, _, x, hx, inverse, oldComponent⟩ := + (pair_mem_relationCompose _ _ _ _ _ _ _).1 component + have copied := (pair_mem_relationConverse _ _ _ _ _).1 inverse + exact relationImage_compose_bound (bound s P qField) + (code.cover i hi s hs f P x (fiberPoint x hx).1 index oldMap qField oldComponent) + hy (ZFSet.mem_sep.1 copied.2.2).1 + · intro y hy z hz i hi j hj yi zj different + obtain ⟨_, x, hx, xy⟩ := (mem_relationImage _ _ _ _).1 hy + obtain ⟨_, w, hw, wz⟩ := (mem_relationImage _ _ _ _).1 hz + have xi := (pushedHeightGraph_entry ecode code.components xy).1 yi + have wj := (pushedHeightGraph_entry ecode code.components wz).1 zj + exact (code.separated x hx w hw i hi j hj xi wj different).map source embedding + (fun a b s copied born => (preserves a b s copied).2 born) + (ZFSet.mem_sep.1 xy).1 (ZFSet.mem_sep.1 wz).1 +end SeparatedLayerCode + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawRefinementDataIdentification.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawRefinementDataIdentification.lean index bb9ba68f7363338f0218488e54cac78a17d48da5..f5b2928b349dc504c30cf39a5c1c042a7854ad70 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawRefinementDataIdentification.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRawRefinementDataIdentification.lean @@ -1,206 +1,206 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawNiceNameGraphs -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRowAssignmentActions - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_refinementIndices : - GroundDefinableFunction M (fun env : Fin 11 → ZFSet.{u} => - M.refinementIndices (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) - (env 6) (env 7) (env 8) (env 9) (env 10)) := by - let v := GroundSetTerm.var M (n := 11) - let first := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 5, v 8] - let second := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 6, v 8] - let level := GroundSetTerm.app (M.definable_singleton pairing) ![v 0] - let bound := GroundSetTerm.app (M.definable_refinementIndexBound pairing unions powers separation) - ![level, v 1, first, second] - let formula : SetFormula 9 := refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 - let term := GroundSetTerm.app (M.definable_separation separation formula) - ![bound, v 0, v 2, v 3, v 4, v 7, v 8, v 9, v 10] - refine { formula := term.definition.formula - closed := fun env members => M.refinementIndices_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) - (members 6) (members 7) (members 8) (members 9) (members 10) - correct := ?_ } - intro env members z hz - rw [term.definition.correct env members z hz] - have args : (fun j : Fin 8 => (![bound, v 0, v 2, v 3, v 4, v 7, v 8, v 9, v 10] - (j.succ)).eval env) = ![env 0, env 2, env 3, env 4, env 7, env 8, env 9, env 10] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))) j - have equal : term.eval env = M.refinementIndices (env 0) (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) := by - change ZFSet.sep (fun w => Realize M.sets formula (extend w _)) (bound.eval env) = _ - rw [args] - apply ZFSet.ext - intro w - rw [ZFSet.mem_sep, M.mem_refinementIndices] - apply and_congr_right - intro hw - exact M.realize_refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 _ - (Fin.cases (M.transitive (bound.ground env members) hw) - (Fin.cases (members 0) (Fin.cases (members 2) (Fin.cases (members 3) - (Fin.cases (members 4) (Fin.cases (members 7) (Fin.cases (members 8) - (Fin.cases (members 9) (Fin.cases (members 10) (fun j => Fin.elim0 j)))))))))) - rw [equal] - -noncomputable def definable_refinementIndexFieldGraph (j : Fin 6) : - GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => refinementIndexFieldGraph (env 0) (env 1) j) where - formula := exactSetFormula 0 (.conj (BoundedFormula.productElementFormula 0 2 3).toFormula - (refinementIndexFieldFormula 0 2 j)) - closed := fun _ members => M.refinementIndexFieldGraph_mem pairing unions powers separation - (members 0) (members 1) j - correct := by - intro env members z hz - apply M.realize_exactSetFormula 0 _ (extend z env) hz - (fun _ h => M.transitive (M.refinementIndexFieldGraph_mem pairing unions powers separation - (members 0) (members 1) j) h) - intro w hw - have all : ∀ k, (extend w (extend z env)) k ∈ M.sets := Fin.cases hw (Fin.cases hz members) - change (Realize M.sets (BoundedFormula.productElementFormula 0 2 3).toFormula _ ∧ - Realize M.sets (refinementIndexFieldFormula 0 2 j) _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ all, BoundedFormula.truth_productElementFormula, - M.realize_refinementIndexFieldFormula 0 2 j _ all] - rw [refinementIndexFieldGraph, ZFSet.mem_sep] - rfl - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def rawRefinementFormulaData - (P order top actionGraph G nodes nodeOrder basis T T2 level : ZFSet.{u}) : Fin 15 → ZFSet.{u} := - let maps := rawActionMapFamily G actionGraph P - let first := M.rawNiceNameCandidateGraph nodes T P G basis maps - let second := M.rawNiceNameCandidateGraph nodes T2 P G basis maps - let I := M.refinementIndices level nodes nodeOrder first second T T2 (ZFSet.prod T {top}) P order top - let B1 := M.groundRelations T P - let B2 := M.groundRelations T2 P - let F1 := refinementIndexFieldGraph I nodes 1 - let F2 := refinementIndexFieldGraph I nodes 2 - let F3 := refinementIndexFieldGraph I B1 3 - let F4 := refinementIndexFieldGraph I B2 4 - let F5 := refinementIndexFieldGraph I B2 5 - ![I, F1, F2, F3, F4, F5, T, P, order, top, nodes, nodeOrder, - M.refinementIndexNameGraph 2 I F3 F4 F5 T P order top, - M.rawNiceVisibilityGraph nodes T P G basis maps top, B1] - -noncomputable def rawRefinementFormulaDataCode - (P order top actionGraph G nodes nodeOrder basis T T2 level : ZFSet.{u}) : ZFSet.{u} := - refinementFormulaDataCode (M.rawRefinementFormulaData P order top actionGraph G nodes nodeOrder basis T T2 level) - -noncomputable def definable_rawRefinementFormulaDataCode - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 11 → ZFSet.{u} => - M.rawRefinementFormulaDataCode (env 0) (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) (env 10)) := by - let v := GroundSetTerm.var M (n := 11) - let maps := GroundSetTerm.app (M.definable_rawActionMapFamily pairing unions powers separation collection) - ![v 4, v 3, v 0] - let first := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) - ![v 5, v 8, v 0, v 4, v 7, maps] - let second := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) - ![v 5, v 9, v 0, v 4, v 7, maps] - let family := GroundSetTerm.app (M.definable_familySetCode pairing unions powers separation) ![v 8, v 2] - let indices := GroundSetTerm.app (M.definable_refinementIndices pairing unions powers separation) - ![v 10, v 5, v 6, first, second, v 8, v 9, family, v 0, v 1, v 2] - let B1 := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 8, v 0] - let B2 := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 9, v 0] - let field (j : Fin 6) (bound : GroundSetTerm M 11) := - GroundSetTerm.app (M.definable_refinementIndexFieldGraph pairing unions powers separation j) ![indices, bound] - let F1 := field 1 (v 5) - let F2 := field 2 (v 5) - let F3 := field 3 B1 - let F4 := field 4 B2 - let F5 := field 5 B2 - let mapNames := GroundSetTerm.app (M.definable_refinementIndexNameGraph pairing unions powers separation 2) - ![indices, F3, F4, F5, v 8, v 0, v 1, v 2] - let visibility := GroundSetTerm.app (M.definable_rawNiceVisibilityGraph pairing unions powers separation collection) - ![v 5, v 8, v 0, v 4, v 7, maps, v 2] - let term := GroundSetTerm.app (M.definable_nonemptyTuple pairing 14) - ![indices, F1, F2, F3, F4, F5, v 8, v 0, v 1, v 2, v 5, v 6, mapNames, visibility, B1] - refine term.definition.congr ?_ - intro env - change nonemptyTupleCode 14 (fun j => - (![indices, F1, F2, F3, F4, F5, v 8, v 0, v 1, v 2, v 5, v 6, mapNames, visibility, B1] j).eval env) = - nonemptyTupleCode 14 (M.rawRefinementFormulaData (env 0) (env 1) (env 2) (env 3) (env 4) - (env 5) (env 6) (env 7) (env 8) (env 9) (env 10)) - congr 1 - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (fun k => Fin.elim0 k))))))))))))))) j - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -include pairing unions powers separation collection carrier group nodes supports maps valid valid2 - -theorem rawRefinementFormulaData_eq : - M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level = - M.refinementLevelFormulaData a s b d level T T2 valid := by - unfold rawRefinementFormulaData - dsimp only - rw [rawActionMapFamily_eq, - M.rawNiceNameCandidateGraph_eq pairing unions powers separation collection a s t b d.principalFix - carrier group supports maps valid nodes, - M.rawNiceNameCandidateGraph_eq pairing unions powers separation collection a s t b d.principalFix - carrier group supports maps valid2 nodes, - M.rawNiceVisibilityGraph_eq pairing unions powers separation collection a s t b d.principalFix - carrier group supports maps valid nodes] - rw [← Name.familySet_code (s := s) ⊤ T valid] - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (fun k => Fin.elim0 k))))))))))))))) j - -theorem rawRefinementFormulaDataCode_eq : - M.rawRefinementFormulaDataCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level = - M.refinementLevelFormulaDataCode a s b d level T T2 valid := - congrArg refinementFormulaDataCode (M.rawRefinementFormulaData_eq a s t b d - pairing unions powers separation collection carrier group nodes supports maps level T T2 valid valid2) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawNiceNameGraphs +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRowAssignmentActions + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_refinementIndices : + GroundDefinableFunction M (fun env : Fin 11 → ZFSet.{u} => + M.refinementIndices (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) + (env 6) (env 7) (env 8) (env 9) (env 10)) := by + let v := GroundSetTerm.var M (n := 11) + let first := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 5, v 8] + let second := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 6, v 8] + let level := GroundSetTerm.app (M.definable_singleton pairing) ![v 0] + let bound := GroundSetTerm.app (M.definable_refinementIndexBound pairing unions powers separation) + ![level, v 1, first, second] + let formula : SetFormula 9 := refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 + let term := GroundSetTerm.app (M.definable_separation separation formula) + ![bound, v 0, v 2, v 3, v 4, v 7, v 8, v 9, v 10] + refine { formula := term.definition.formula + closed := fun env members => M.refinementIndices_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) + (members 6) (members 7) (members 8) (members 9) (members 10) + correct := ?_ } + intro env members z hz + rw [term.definition.correct env members z hz] + have args : (fun j : Fin 8 => (![bound, v 0, v 2, v 3, v 4, v 7, v 8, v 9, v 10] + (j.succ)).eval env) = ![env 0, env 2, env 3, env 4, env 7, env 8, env 9, env 10] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))))) j + have equal : term.eval env = M.refinementIndices (env 0) (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) (env 10) := by + change ZFSet.sep (fun w => Realize M.sets formula (extend w _)) (bound.eval env) = _ + rw [args] + apply ZFSet.ext + intro w + rw [ZFSet.mem_sep, M.mem_refinementIndices] + apply and_congr_right + intro hw + exact M.realize_refinementIndexSelectionFormula 0 1 2 3 4 5 6 7 8 _ + (Fin.cases (M.transitive (bound.ground env members) hw) + (Fin.cases (members 0) (Fin.cases (members 2) (Fin.cases (members 3) + (Fin.cases (members 4) (Fin.cases (members 7) (Fin.cases (members 8) + (Fin.cases (members 9) (Fin.cases (members 10) (fun j => Fin.elim0 j)))))))))) + rw [equal] + +noncomputable def definable_refinementIndexFieldGraph (j : Fin 6) : + GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => refinementIndexFieldGraph (env 0) (env 1) j) where + formula := exactSetFormula 0 (.conj (BoundedFormula.productElementFormula 0 2 3).toFormula + (refinementIndexFieldFormula 0 2 j)) + closed := fun _ members => M.refinementIndexFieldGraph_mem pairing unions powers separation + (members 0) (members 1) j + correct := by + intro env members z hz + apply M.realize_exactSetFormula 0 _ (extend z env) hz + (fun _ h => M.transitive (M.refinementIndexFieldGraph_mem pairing unions powers separation + (members 0) (members 1) j) h) + intro w hw + have all : ∀ k, (extend w (extend z env)) k ∈ M.sets := Fin.cases hw (Fin.cases hz members) + change (Realize M.sets (BoundedFormula.productElementFormula 0 2 3).toFormula _ ∧ + Realize M.sets (refinementIndexFieldFormula 0 2 j) _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ all, BoundedFormula.truth_productElementFormula, + M.realize_refinementIndexFieldFormula 0 2 j _ all] + rw [refinementIndexFieldGraph, ZFSet.mem_sep] + rfl + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def rawRefinementFormulaData + (P order top actionGraph G nodes nodeOrder basis T T2 level : ZFSet.{u}) : Fin 15 → ZFSet.{u} := + let maps := rawActionMapFamily G actionGraph P + let first := M.rawNiceNameCandidateGraph nodes T P G basis maps + let second := M.rawNiceNameCandidateGraph nodes T2 P G basis maps + let I := M.refinementIndices level nodes nodeOrder first second T T2 (ZFSet.prod T {top}) P order top + let B1 := M.groundRelations T P + let B2 := M.groundRelations T2 P + let F1 := refinementIndexFieldGraph I nodes 1 + let F2 := refinementIndexFieldGraph I nodes 2 + let F3 := refinementIndexFieldGraph I B1 3 + let F4 := refinementIndexFieldGraph I B2 4 + let F5 := refinementIndexFieldGraph I B2 5 + ![I, F1, F2, F3, F4, F5, T, P, order, top, nodes, nodeOrder, + M.refinementIndexNameGraph 2 I F3 F4 F5 T P order top, + M.rawNiceVisibilityGraph nodes T P G basis maps top, B1] + +noncomputable def rawRefinementFormulaDataCode + (P order top actionGraph G nodes nodeOrder basis T T2 level : ZFSet.{u}) : ZFSet.{u} := + refinementFormulaDataCode (M.rawRefinementFormulaData P order top actionGraph G nodes nodeOrder basis T T2 level) + +noncomputable def definable_rawRefinementFormulaDataCode + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 11 → ZFSet.{u} => + M.rawRefinementFormulaDataCode (env 0) (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) (env 10)) := by + let v := GroundSetTerm.var M (n := 11) + let maps := GroundSetTerm.app (M.definable_rawActionMapFamily pairing unions powers separation collection) + ![v 4, v 3, v 0] + let first := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) + ![v 5, v 8, v 0, v 4, v 7, maps] + let second := GroundSetTerm.app (M.definable_rawNiceNameCandidateGraph pairing unions powers separation collection) + ![v 5, v 9, v 0, v 4, v 7, maps] + let family := GroundSetTerm.app (M.definable_familySetCode pairing unions powers separation) ![v 8, v 2] + let indices := GroundSetTerm.app (M.definable_refinementIndices pairing unions powers separation) + ![v 10, v 5, v 6, first, second, v 8, v 9, family, v 0, v 1, v 2] + let B1 := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 8, v 0] + let B2 := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 9, v 0] + let field (j : Fin 6) (bound : GroundSetTerm M 11) := + GroundSetTerm.app (M.definable_refinementIndexFieldGraph pairing unions powers separation j) ![indices, bound] + let F1 := field 1 (v 5) + let F2 := field 2 (v 5) + let F3 := field 3 B1 + let F4 := field 4 B2 + let F5 := field 5 B2 + let mapNames := GroundSetTerm.app (M.definable_refinementIndexNameGraph pairing unions powers separation 2) + ![indices, F3, F4, F5, v 8, v 0, v 1, v 2] + let visibility := GroundSetTerm.app (M.definable_rawNiceVisibilityGraph pairing unions powers separation collection) + ![v 5, v 8, v 0, v 4, v 7, maps, v 2] + let term := GroundSetTerm.app (M.definable_nonemptyTuple pairing 14) + ![indices, F1, F2, F3, F4, F5, v 8, v 0, v 1, v 2, v 5, v 6, mapNames, visibility, B1] + refine term.definition.congr ?_ + intro env + change nonemptyTupleCode 14 (fun j => + (![indices, F1, F2, F3, F4, F5, v 8, v 0, v 1, v 2, v 5, v 6, mapNames, visibility, B1] j).eval env) = + nonemptyTupleCode 14 (M.rawRefinementFormulaData (env 0) (env 1) (env 2) (env 3) (env 4) + (env 5) (env 6) (env 7) (env 8) (env 9) (env 10)) + congr 1 + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (fun k => Fin.elim0 k))))))))))))))) j + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +include pairing unions powers separation collection carrier group nodes supports maps valid valid2 + +theorem rawRefinementFormulaData_eq : + M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level = + M.refinementLevelFormulaData a s b d level T T2 valid := by + unfold rawRefinementFormulaData + dsimp only + rw [rawActionMapFamily_eq, + M.rawNiceNameCandidateGraph_eq pairing unions powers separation collection a s t b d.principalFix + carrier group supports maps valid nodes, + M.rawNiceNameCandidateGraph_eq pairing unions powers separation collection a s t b d.principalFix + carrier group supports maps valid2 nodes, + M.rawNiceVisibilityGraph_eq pairing unions powers separation collection a s t b d.principalFix + carrier group supports maps valid nodes] + rw [← Name.familySet_code (s := s) ⊤ T valid] + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (fun k => Fin.elim0 k))))))))))))))) j + +theorem rawRefinementFormulaDataCode_eq : + M.rawRefinementFormulaDataCode s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level = + M.refinementLevelFormulaDataCode a s b d level T T2 valid := + congrArg refinementFormulaDataCode (M.rawRefinementFormulaData_eq a s t b d + pairing unions powers separation collection carrier group nodes supports maps level T T2 valid valid2) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRecognizedInitialOrigin.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRecognizedInitialOrigin.lean index 3688d20e879ca351513854fddb4dacfd5ab65691..e368b6da13f2f32d7ef65c17f2486f45034826b4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRecognizedInitialOrigin.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRecognizedInitialOrigin.lean @@ -1,161 +1,161 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionOrigins - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem initialCompressionOrigin_of_representatives - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one τ Reps : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps) - (represents : ∀ i g, ZFSet.pair i g ∈ Reps → - TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g) : - Nonempty (GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ (M.groundEligibleTasks P G r μ A Labels) - (literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - Reps G m inv one (M.groundTaskTransport P G r μ A Labels) - (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)) := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) Sources (literalTaskBaseGraph I P R U Labels) - let B := M.groundEligibleBatchAction P G r μ A Labels - let T := M.groundTaskTransport P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨hMaps, maps, entries⟩ := M.batchEmbeddingFamily_spec - pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 - have hB := M.groundEligibleBatchAction_mem pairing unions powers separation - hP hG hr hμ hA hLabels meet - have currentAction : PosetActionCode G d.batchCarrier m one d.batchOrder B := - M.groundEligibleBatchAction_code pairing unions powers separation - hP hG hA group action meet - have valid : ∀ i S, ZFSet.pair i S ∈ Maps → - MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph S := by - intro i S entry - obtain ⟨hi, equal⟩ := (entries i S).1 entry - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 - have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 - have meetEq : d.meet j = μ := ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry j)).2 - rw [equal] - simpa only [spaceEq, relEq, meetEq] using d.batch_template_embedding_code j - have inputs : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one B := by - refine ⟨maps, (fields 0).2, reps, group, currentAction, valid, ?_⟩ - intro i a g S x y source representative mapEntry hx below - obtain ⟨hi, equal⟩ := (entries i S).1 mapEntry - rw [equal] - exact M.groundEligibleTask_representative_base_iff group action meet hi - (represents i g representative) source hx below - have seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters := by - refine ⟨meet, action, hτ, (fields 0).2, ⟨_, (fields 4).2⟩, ?_, ?_⟩ - · intro δ i j g k product a transport source firstRep secondRep productEntry - have transported := (triple_mem_taskTransportGraph G I P R U Labels A δ i j).1 transport - have hg := (ZFSet.pair_mem_prod.1 (reps.1 firstRep)).2 - have hp := (ZFSet.pair_mem_prod.1 (group.mul_function.1 productEntry)).2 - exact transported.2.2.2.representative_product_agreement action transported.1 hg hp - productEntry (represents i g firstRep) (represents j k secondRep) source - · intro g k v i j l F oldAgree filter positive first second - exact M.groundInitialTask_positive_agreement group action meet oldAgree filter positive first second - have invariant : RecursiveCompressionInvariant seed inputs := by - refine ⟨fun _ hx => hx, fun _ _ _ _ => Iff.rfl, fun _ _ _ _ _ => Iff.rfl, - ?_, top, ?_, ?_⟩ - · intro g x hx y - exact M.groundEligibleBatchAction_old_iff hx - · intro g hg k hk v hv oldAgree - exact M.groundEligibleBatchAction_agreement pairing unions powers separation - hP hG hA group action meet hg hk hv oldAgree - · intro i S a F cap base v w mapEntry source filter capEntry baseEntry hv negative entry - have hi := inputs.maps.pair_source mapEntry - obtain ⟨a', ha, c, hc, ell, hell, sep, hsep, F', hF, label, hl, equal, _⟩ := - (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi - have target : ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels := by - rw [equal] - exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 1).2 ⟨equal ▸ hi, rfl⟩ - exact M.groundInitialMap_negative_cap pairing unions powers separation - hP hG hr hμ hA hLabels group action meet hτ top mapEntry source target filter - capEntry baseEntry hv negative entry - have ground : RecursiveGroundFields M inputs := - ⟨hP, hr, hμ, hI, hQs, hrs, hμs, (fields 0).1, (fields 2).1, (fields 4).1, - (fields 3).1, hMaps, hB⟩ - let state : GroundCompressionState M seed := - ⟨inputs.toState, _, inputs, - M.groundInitialTaskAction pairing unions powers separation hP hG hr hμ hA hLabels - group action meet Reps inputs, invariant, ground⟩ - exact ⟨⟨seed, state, rfl⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem initialCompressionOrigin_of_recognized_representatives - {n} (Reps P G r μ A Labels : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) {m inv one τ : ZFSet.{u}} - (group : GroupCode (env G) m inv one) - (action : PosetActionCode (env G) (env P) m one (env r) (env A)) - (meet : MeetOrderCode (env P) (env r) (env μ)) (hτ : τ ∈ env P) - (top : ∀ x ∈ env P, ZFSet.pair x τ ∈ env r) - (recognized : Realize M.sets (groundTaskRepresentativesFormula Reps P G r μ A Labels) env) : - let I := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) - let R := M.groundRelations (env P) (env P) - let U := M.groundMeetFilters (env P) (env r) (env μ) - Nonempty (GroundCompressionOrigin M - (M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels)) - (env P) (env r) (env μ) (env A) τ I (literalTaskSourceGraph I (env P) R U (env Labels)) - (env Reps) (env G) m inv one - (M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels)) - (literalTaskFilterGraph I (env P) R U (env Labels))) := by - have decoded := (M.realize_groundTaskRepresentativesFormula pairing unions powers separation - Reps P G r μ A Labels env members meet).1 recognized - exact M.initialCompressionOrigin_of_representatives pairing unions powers separation - (members P) (members G) (members r) (members μ) (members A) (members Labels) - group action meet hτ top decoded.1 decoded.2 - -theorem exists_groundRecognizedTaskRepresentatives - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {n} (P G r μ A Labels : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) - (meet : MeetOrderCode (env P) (env r) (env μ)) : - ∃ Reps ∈ M.sets, Realize M.sets - (groundTaskRepresentativesFormula 0 P.succ G.succ r.succ μ.succ A.succ Labels.succ) - (extend Reps env) := by - obtain ⟨Reps, hReps, function, represents, _⟩ := M.exists_groundTaskRepresentatives - pairing unions powers separation choice (members P) (members G) (members r) - (members μ) (members A) (members Labels) meet - refine ⟨Reps, hReps, ?_⟩ - exact (M.realize_groundTaskRepresentativesFormula pairing unions powers separation - 0 P.succ G.succ r.succ μ.succ A.succ Labels.succ (extend Reps env) - (Fin.cases hReps members) meet).2 ⟨function, represents⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionOrigins + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem initialCompressionOrigin_of_representatives + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one τ Reps : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps) + (represents : ∀ i g, ZFSet.pair i g ∈ Reps → + TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g) : + Nonempty (GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ (M.groundEligibleTasks P G r μ A Labels) + (literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + Reps G m inv one (M.groundTaskTransport P G r μ A Labels) + (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)) := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) Sources (literalTaskBaseGraph I P R U Labels) + let B := M.groundEligibleBatchAction P G r μ A Labels + let T := M.groundTaskTransport P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨hMaps, maps, entries⟩ := M.batchEmbeddingFamily_spec + pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 + have hB := M.groundEligibleBatchAction_mem pairing unions powers separation + hP hG hr hμ hA hLabels meet + have currentAction : PosetActionCode G d.batchCarrier m one d.batchOrder B := + M.groundEligibleBatchAction_code pairing unions powers separation + hP hG hA group action meet + have valid : ∀ i S, ZFSet.pair i S ∈ Maps → + MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph S := by + intro i S entry + obtain ⟨hi, equal⟩ := (entries i S).1 entry + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 + have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 + have meetEq : d.meet j = μ := ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry j)).2 + rw [equal] + simpa only [spaceEq, relEq, meetEq] using d.batch_template_embedding_code j + have inputs : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one B := by + refine ⟨maps, (fields 0).2, reps, group, currentAction, valid, ?_⟩ + intro i a g S x y source representative mapEntry hx below + obtain ⟨hi, equal⟩ := (entries i S).1 mapEntry + rw [equal] + exact M.groundEligibleTask_representative_base_iff group action meet hi + (represents i g representative) source hx below + have seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters := by + refine ⟨meet, action, hτ, (fields 0).2, ⟨_, (fields 4).2⟩, ?_, ?_⟩ + · intro δ i j g k product a transport source firstRep secondRep productEntry + have transported := (triple_mem_taskTransportGraph G I P R U Labels A δ i j).1 transport + have hg := (ZFSet.pair_mem_prod.1 (reps.1 firstRep)).2 + have hp := (ZFSet.pair_mem_prod.1 (group.mul_function.1 productEntry)).2 + exact transported.2.2.2.representative_product_agreement action transported.1 hg hp + productEntry (represents i g firstRep) (represents j k secondRep) source + · intro g k v i j l F oldAgree filter positive first second + exact M.groundInitialTask_positive_agreement group action meet oldAgree filter positive first second + have invariant : RecursiveCompressionInvariant seed inputs := by + refine ⟨fun _ hx => hx, fun _ _ _ _ => Iff.rfl, fun _ _ _ _ _ => Iff.rfl, + ?_, top, ?_, ?_⟩ + · intro g x hx y + exact M.groundEligibleBatchAction_old_iff hx + · intro g hg k hk v hv oldAgree + exact M.groundEligibleBatchAction_agreement pairing unions powers separation + hP hG hA group action meet hg hk hv oldAgree + · intro i S a F cap base v w mapEntry source filter capEntry baseEntry hv negative entry + have hi := inputs.maps.pair_source mapEntry + obtain ⟨a', ha, c, hc, ell, hell, sep, hsep, F', hF, label, hl, equal, _⟩ := + (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi + have target : ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels := by + rw [equal] + exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 1).2 ⟨equal ▸ hi, rfl⟩ + exact M.groundInitialMap_negative_cap pairing unions powers separation + hP hG hr hμ hA hLabels group action meet hτ top mapEntry source target filter + capEntry baseEntry hv negative entry + have ground : RecursiveGroundFields M inputs := + ⟨hP, hr, hμ, hI, hQs, hrs, hμs, (fields 0).1, (fields 2).1, (fields 4).1, + (fields 3).1, hMaps, hB⟩ + let state : GroundCompressionState M seed := + ⟨inputs.toState, _, inputs, + M.groundInitialTaskAction pairing unions powers separation hP hG hr hμ hA hLabels + group action meet Reps inputs, invariant, ground⟩ + exact ⟨⟨seed, state, rfl⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem initialCompressionOrigin_of_recognized_representatives + {n} (Reps P G r μ A Labels : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) {m inv one τ : ZFSet.{u}} + (group : GroupCode (env G) m inv one) + (action : PosetActionCode (env G) (env P) m one (env r) (env A)) + (meet : MeetOrderCode (env P) (env r) (env μ)) (hτ : τ ∈ env P) + (top : ∀ x ∈ env P, ZFSet.pair x τ ∈ env r) + (recognized : Realize M.sets (groundTaskRepresentativesFormula Reps P G r μ A Labels) env) : + let I := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) + let R := M.groundRelations (env P) (env P) + let U := M.groundMeetFilters (env P) (env r) (env μ) + Nonempty (GroundCompressionOrigin M + (M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels)) + (env P) (env r) (env μ) (env A) τ I (literalTaskSourceGraph I (env P) R U (env Labels)) + (env Reps) (env G) m inv one + (M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels)) + (literalTaskFilterGraph I (env P) R U (env Labels))) := by + have decoded := (M.realize_groundTaskRepresentativesFormula pairing unions powers separation + Reps P G r μ A Labels env members meet).1 recognized + exact M.initialCompressionOrigin_of_representatives pairing unions powers separation + (members P) (members G) (members r) (members μ) (members A) (members Labels) + group action meet hτ top decoded.1 decoded.2 + +theorem exists_groundRecognizedTaskRepresentatives + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {n} (P G r μ A Labels : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) + (meet : MeetOrderCode (env P) (env r) (env μ)) : + ∃ Reps ∈ M.sets, Realize M.sets + (groundTaskRepresentativesFormula 0 P.succ G.succ r.succ μ.succ A.succ Labels.succ) + (extend Reps env) := by + obtain ⟨Reps, hReps, function, represents, _⟩ := M.exists_groundTaskRepresentatives + pairing unions powers separation choice (members P) (members G) (members r) + (members μ) (members A) (members Labels) meet + refine ⟨Reps, hReps, ?_⟩ + exact (M.realize_groundTaskRepresentativesFormula pairing unions powers separation + 0 P.succ G.succ r.succ μ.succ A.succ Labels.succ (extend Reps env) + (Fin.cases hReps members) meet).2 ⟨function, represents⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAbsentLiftInsertions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAbsentLiftInsertions.lean index f58a293468243b12166dbf8e53146014a9e87c9e..d9269befc2621acf9afd50dac041c12e20be4e9a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAbsentLiftInsertions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAbsentLiftInsertions.lean @@ -1,212 +1,212 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementVisibleLiftInsertions - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (M.codedFamily s) → - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -include descent in -theorem stageOneSingleTests_absentLift_caps (small : M.sets.Countable) - (C E K : L) (U Rf Rc u w : (M.nameDomain s).names) (F : ZFSet.{u}) - (p : P) (activeU : Name.ForcesMem p u.val U.val) - (activeW : Name.ForcesMem p w.val U.val) - (capPositive : ∀ v : L, b.encode v ∈ testedMeetFilter F b.conditionOrder (b.encode E) → K ≤ v) - (capNegative : ∀ v : L, E ≤ v → - b.encode v ∉ testedMeetFilter F b.conditionOrder (b.encode E) → meet K v = C) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - M.DecidesVisibilityProfile a s b d.principalFix T F (cls Rc u).val p → - Name.ForcesMem p (cls Rf w).val (vis K).val → - (∀ q, q ≤ p → ¬ Name.ForcesMem q (cls Rf w).val (vis C).val) → - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - intro decisions capVisible nonvisible - have negativeC : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![cls Rf w, vis C] p := nonvisible - refine ⟨⟨activeU, activeW⟩, ?_, ?_⟩ - · intro v above - apply (M.ordinaryForces_iff_all_joint_generics s small carrier _ _ p).2 - intro H hp coded generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementProfileFormula _ (fun j => ⟨_, rfl⟩)).2 - have capSeen := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) - (cls Rf w).property (vis K).property hp capVisible - have notSeen : Name.eval {q | H.mem q} (cls Rf w).val ∉ - Name.eval {q | H.mem q} (vis C).val := - forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) ![cls Rf w, vis C] hp negativeC - by_cases member : b.encode v ∈ F - · have tested := (mem_testedMeetFilter F b.conditionOrder (b.encode E) (b.encode v)).2 - ⟨member, (b.pair_mem_conditionOrder E v).2 above⟩ - have fineSeen := (M.encode_mem_visibleSupportProfile a s b d T H _ v).1 - (M.visibleSupportProfile_upward a s b d T H _ (capPositive v tested) - ((M.encode_mem_visibleSupportProfile a s b d T H _ K).2 capSeen)) - have coarsePositive : Forces (M.nameDomain s) (.mem 0 1) ![cls Rc u, vis v] p := - (decisions v).1 member - have coarseSeen := forces_sound (M.nameDomain s) H generic (.mem 0 1) - ![cls Rc u, vis v] hp coarsePositive - exact ⟨fun _ => fineSeen, fun _ => coarseSeen⟩ - · have notTested : b.encode v ∉ testedMeetFilter F b.conditionOrder (b.encode E) := - fun yes => member ((mem_testedMeetFilter F b.conditionOrder (b.encode E) (b.encode v)).1 yes).1 - have coarseNegative : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![cls Rc u, vis v] p := - (decisions v).2 member - have coarseNotSeen := forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) - ![cls Rc u, vis v] hp coarseNegative - have fineNotSeen : Name.eval {q | H.mem q} (cls Rf w).val ∉ - Name.eval {q | H.mem q} (vis v).val := by - intro fineSeen - have bounded := Name.eval_subset_familySet_of_code_subset H T valid (cls Rf w).val - (Name.refinementClass_subset T valid Rf.val w.val) - have overlap := M.visibleSupportProfile_meet a s b d base directed T H valid system generic - (cls Rf w) bounded meet (descent H coded generic) K v - ((M.encode_mem_visibleSupportProfile a s b d T H _ K).2 capSeen) - ((M.encode_mem_visibleSupportProfile a s b d T H _ v).2 fineSeen) - rw [capNegative v above notTested] at overlap - exact notSeen ((M.encode_mem_visibleSupportProfile a s b d T H _ C).1 overlap) - exact ⟨fun yes => False.elim (coarseNotSeen yes), fun yes => False.elim (fineNotSeen yes)⟩ - · apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementCompatibilityFormula _ (fun j => ⟨_, rfl⟩)).2 - intro seen - exact False.elim ((forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) - ![cls Rf w, vis C] hp negativeC) seen) - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) -variable (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (meet : L → L → L) -variable (descent : ∀ (H : ConditionFilter P), - H.GenericFor (M.codedFamily s) → - H.GenericFor (formulaFamily (M.nameDomain s)) → - ∀ (v w : L) (x y : (M.nameDomain s).names), - d.principalFix v ≤ a.stabilizer s x.val → - d.principalFix w ≤ a.stabilizer s y.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → - HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain s).names, - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ - d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) - -variable (small : M.sets.Countable) -include indices nodes small descent - -theorem refinementLevelRawTests_insert_absentLift - (C E K : L) (U Rf Rc u w : (M.nameDomain s).names) (F : ZFSet.{u}) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) - {A : ZFSet.{u}} (p : P) - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) - (activeU : Name.ForcesMem p u.val U.val) (activeW : Name.ForcesMem p w.val U.val) - (capPositive : ∀ v : L, b.encode v ∈ testedMeetFilter F b.conditionOrder (b.encode E) → K ≤ v) - (capNegative : ∀ v : L, E ≤ v → - b.encode v ∉ testedMeetFilter F b.conditionOrder (b.encode E) → meet K v = C) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - M.DecidesVisibilityProfile a s b d.principalFix T F (cls Rc u).val p → - Name.ForcesMem p (cls Rf w).val (vis K).val → - (∀ q, q ≤ p → ¬ Name.ForcesMem q (cls Rf w).val (vis C).val) → - (∀ (v z : (M.nameDomain s).names), v.val.val ∈ T → z.val.val ∈ T → - stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A → - (∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) ∧ - ∃ profile, M.DecidesVisibilityProfile a s b d.principalFix T profile (cls Rf z).val p ∧ - (b.encode C ∉ profile → b.encode K ∉ profile)) → - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) - (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val.val w.val.val) A) (s.encode p) := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - intro decisions capVisible nonvisible oldProfiles - have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system - have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices - have mixed (v z : (M.nameDomain s).names) (hv : v.val.val ∈ T) (hz : z.val.val ∈ T) - (old : stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A) : - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u v w z p ∧ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc v u z w p := by - obtain ⟨different, profile, profileDecisions, survivor⟩ := oldProfiles v z hv hz old - have facts := M.refinementAbsentLift_profile_collisions s carrier a b d valid base directed system - pairing unions powers separation collection order hT small C K Rf Rc u v w z profile p p le_rfl - profileDecisions survivor capVisible nonvisible different - exact ⟨facts.2.2.1, facts.2.2.2.1⟩ - apply stageOneRawTests_insert M (M.refinementLevelFormulaData a s b d level T T2 valid) tests - · exact (single C E U Rf Rc u w member p).2 - (M.stageOneSingleTests_absentLift_caps s pairing unions powers separation collection carrier order hT valid - a b d base directed system meet descent small C E K U Rf Rc u w F p - activeU activeW capPositive capNegative decisions capVisible nonvisible) - · intro v hv z hz old - let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ - let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ - exact (collision C E U Rf Rc vn u zn w member p).2 (mixed vn zn hv hz old).2 - · intro v hv z hz old - let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ - let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ - exact (collision C E U Rf Rc u vn w zn member p).2 (mixed vn zn hv hz old).1 - · exact (collision C E U Rf Rc u u w w member p).2 - (M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid - small Rf Rc u w p) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementVisibleLiftInsertions + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (M.codedFamily s) → + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +include descent in +theorem stageOneSingleTests_absentLift_caps (small : M.sets.Countable) + (C E K : L) (U Rf Rc u w : (M.nameDomain s).names) (F : ZFSet.{u}) + (p : P) (activeU : Name.ForcesMem p u.val U.val) + (activeW : Name.ForcesMem p w.val U.val) + (capPositive : ∀ v : L, b.encode v ∈ testedMeetFilter F b.conditionOrder (b.encode E) → K ≤ v) + (capNegative : ∀ v : L, E ≤ v → + b.encode v ∉ testedMeetFilter F b.conditionOrder (b.encode E) → meet K v = C) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + M.DecidesVisibilityProfile a s b d.principalFix T F (cls Rc u).val p → + Name.ForcesMem p (cls Rf w).val (vis K).val → + (∀ q, q ≤ p → ¬ Name.ForcesMem q (cls Rf w).val (vis C).val) → + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + intro decisions capVisible nonvisible + have negativeC : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![cls Rf w, vis C] p := nonvisible + refine ⟨⟨activeU, activeW⟩, ?_, ?_⟩ + · intro v above + apply (M.ordinaryForces_iff_all_joint_generics s small carrier _ _ p).2 + intro H hp coded generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementProfileFormula _ (fun j => ⟨_, rfl⟩)).2 + have capSeen := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) + (cls Rf w).property (vis K).property hp capVisible + have notSeen : Name.eval {q | H.mem q} (cls Rf w).val ∉ + Name.eval {q | H.mem q} (vis C).val := + forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) ![cls Rf w, vis C] hp negativeC + by_cases member : b.encode v ∈ F + · have tested := (mem_testedMeetFilter F b.conditionOrder (b.encode E) (b.encode v)).2 + ⟨member, (b.pair_mem_conditionOrder E v).2 above⟩ + have fineSeen := (M.encode_mem_visibleSupportProfile a s b d T H _ v).1 + (M.visibleSupportProfile_upward a s b d T H _ (capPositive v tested) + ((M.encode_mem_visibleSupportProfile a s b d T H _ K).2 capSeen)) + have coarsePositive : Forces (M.nameDomain s) (.mem 0 1) ![cls Rc u, vis v] p := + (decisions v).1 member + have coarseSeen := forces_sound (M.nameDomain s) H generic (.mem 0 1) + ![cls Rc u, vis v] hp coarsePositive + exact ⟨fun _ => fineSeen, fun _ => coarseSeen⟩ + · have notTested : b.encode v ∉ testedMeetFilter F b.conditionOrder (b.encode E) := + fun yes => member ((mem_testedMeetFilter F b.conditionOrder (b.encode E) (b.encode v)).1 yes).1 + have coarseNegative : Forces (M.nameDomain s) (.neg (.mem 0 1)) ![cls Rc u, vis v] p := + (decisions v).2 member + have coarseNotSeen := forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) + ![cls Rc u, vis v] hp coarseNegative + have fineNotSeen : Name.eval {q | H.mem q} (cls Rf w).val ∉ + Name.eval {q | H.mem q} (vis v).val := by + intro fineSeen + have bounded := Name.eval_subset_familySet_of_code_subset H T valid (cls Rf w).val + (Name.refinementClass_subset T valid Rf.val w.val) + have overlap := M.visibleSupportProfile_meet a s b d base directed T H valid system generic + (cls Rf w) bounded meet (descent H coded generic) K v + ((M.encode_mem_visibleSupportProfile a s b d T H _ K).2 capSeen) + ((M.encode_mem_visibleSupportProfile a s b d T H _ v).2 fineSeen) + rw [capNegative v above notTested] at overlap + exact notSeen ((M.encode_mem_visibleSupportProfile a s b d T H _ C).1 overlap) + exact ⟨fun yes => False.elim (coarseNotSeen yes), fun yes => False.elim (fineNotSeen yes)⟩ + · apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementCompatibilityFormula _ (fun j => ⟨_, rfl⟩)).2 + intro seen + exact False.elim ((forces_sound (M.nameDomain s) H generic (.neg (.mem 0 1)) + ![cls Rf w, vis C] hp negativeC) seen) + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) +variable (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (meet : L → L → L) +variable (descent : ∀ (H : ConditionFilter P), + H.GenericFor (M.codedFamily s) → + H.GenericFor (formulaFamily (M.nameDomain s)) → + ∀ (v w : L) (x y : (M.nameDomain s).names), + d.principalFix v ≤ a.stabilizer s x.val → + d.principalFix w ≤ a.stabilizer s y.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) x.val → + HereditarilySymmetric a s (d.principalSupportFamily base directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain s).names, + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau.val ∧ + d.principalFix (meet v w) ≤ a.stabilizer s tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val) + +variable (small : M.sets.Countable) +include indices nodes small descent + +theorem refinementLevelRawTests_insert_absentLift + (C E K : L) (U Rf Rc u w : (M.nameDomain s).names) (F : ZFSet.{u}) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) + {A : ZFSet.{u}} (p : P) + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) + (activeU : Name.ForcesMem p u.val U.val) (activeW : Name.ForcesMem p w.val U.val) + (capPositive : ∀ v : L, b.encode v ∈ testedMeetFilter F b.conditionOrder (b.encode E) → K ≤ v) + (capNegative : ∀ v : L, E ≤ v → + b.encode v ∉ testedMeetFilter F b.conditionOrder (b.encode E) → meet K v = C) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + M.DecidesVisibilityProfile a s b d.principalFix T F (cls Rc u).val p → + Name.ForcesMem p (cls Rf w).val (vis K).val → + (∀ q, q ≤ p → ¬ Name.ForcesMem q (cls Rf w).val (vis C).val) → + (∀ (v z : (M.nameDomain s).names), v.val.val ∈ T → z.val.val ∈ T → + stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A → + (∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) ∧ + ∃ profile, M.DecidesVisibilityProfile a s b d.principalFix T profile (cls Rf z).val p ∧ + (b.encode C ∉ profile → b.encode K ∉ profile)) → + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) + (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val.val w.val.val) A) (s.encode p) := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + intro decisions capVisible nonvisible oldProfiles + have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system + have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices + have mixed (v z : (M.nameDomain s).names) (hv : v.val.val ∈ T) (hz : z.val.val ∈ T) + (old : stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A) : + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u v w z p ∧ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc v u z w p := by + obtain ⟨different, profile, profileDecisions, survivor⟩ := oldProfiles v z hv hz old + have facts := M.refinementAbsentLift_profile_collisions s carrier a b d valid base directed system + pairing unions powers separation collection order hT small C K Rf Rc u v w z profile p p le_rfl + profileDecisions survivor capVisible nonvisible different + exact ⟨facts.2.2.1, facts.2.2.2.1⟩ + apply stageOneRawTests_insert M (M.refinementLevelFormulaData a s b d level T T2 valid) tests + · exact (single C E U Rf Rc u w member p).2 + (M.stageOneSingleTests_absentLift_caps s pairing unions powers separation collection carrier order hT valid + a b d base directed system meet descent small C E K U Rf Rc u w F p + activeU activeW capPositive capNegative decisions capVisible nonvisible) + · intro v hv z hz old + let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ + let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ + exact (collision C E U Rf Rc vn u zn w member p).2 (mixed vn zn hv hz old).2 + · intro v hv z hz old + let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ + let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ + exact (collision C E U Rf Rc u vn w zn member p).2 (mixed vn zn hv hz old).1 + · exact (collision C E U Rf Rc u u w w member p).2 + (M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid + small Rf Rc u w p) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentImages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentImages.lean index 4787d1972aab49be437bb90caab4b3ecb3a3088c..7db8226ae96a8dc9772583ebab4a30255165e294 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentImages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentImages.lean @@ -1,102 +1,102 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentImages - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "J" => stageOneAssignments I T -local notation "graph" => M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 - -noncomputable def refinementAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := - relationImage A J (graph g) - -theorem refinementAssignmentImage_subset (g : G) (A : ZFSet.{u}) : - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ⊆ J := - fun y h => ((mem_relationImage A J (graph g) y).1 h).1 - -theorem refinementAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ⊆ - M.refinementAssignmentImage a s b d level T T2 valid valid2 g B := by - intro y hy - obtain ⟨hy, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy - exact (mem_relationImage B J (graph g) y).2 ⟨hy, x, subset hx, entry⟩ - -theorem refinementAssignmentImage_zero (g : G) (A : ZFSet.{u}) : - M.refinementAssignmentImage a s b d ∅ T T2 valid valid2 g A = - M.stageOneAssignmentImage a s b d T T2 valid valid2 g A := rfl - -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) - -include pairing unions powers separation collection carrier order maps closed closed2 familyGround in -theorem refinementAssignmentActionGraph_injection (g : G) : InjectionCode J J (graph g) := - relationProduct_injection - (M.niceRefinementIndexActionGraph_injection a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g) - (relationProduct_injection (stageOneTermAction_injection a s T valid closed g) - (stageOneTermAction_injection a s T valid closed g)) - -include pairing unions powers separation collection carrier order maps closed closed2 familyGround in -theorem refinementAssignmentImage_entry (g : G) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) (A : ZFSet.{u}) : - stageOneAssignment (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) - (a.act s g u).val (a.act s g w).val ∈ - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ↔ - stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A := by - have entry := (M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround - g C E U Rf Rc u w index hu hw _).2 rfl - have injection := M.refinementAssignmentActionGraph_injection a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g - constructor - · intro hy - obtain ⟨_, x, hx, xy⟩ := (mem_relationImage A J (graph g) _).1 hy - have equal := injection.injective _ _ _ xy entry - exact equal ▸ hx - · intro hx - exact (mem_relationImage A J (graph g) _).2 - ⟨(ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2, _, hx, entry⟩ - -include pairing unions powers separation collection carrier order maps closed closed2 familyGround in -theorem refinementAssignmentImage_small - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} - (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : - M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ∈ M.groundSmallSubsets J ZFSet.omega := by - obtain ⟨hA, subset, small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member - have hJ := M.stageOneAssignments_mem pairing unions powers separation hI hT - have hg := M.refinementAssignmentActionGraph_mem a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier maps nodeMaps hLevel hT hT2 hI g - have injection := M.refinementAssignmentActionGraph_injection a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g - exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 - ⟨M.relationImage_mem separation hA hJ hg, - M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A, - M.groundEmbeddable_image pairing unions powers separation hA hJ omega hg injection subset small⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneAssignmentImages + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "J" => stageOneAssignments I T +local notation "graph" => M.refinementAssignmentActionGraph a s b d level T T2 valid valid2 + +noncomputable def refinementAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := + relationImage A J (graph g) + +theorem refinementAssignmentImage_subset (g : G) (A : ZFSet.{u}) : + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ⊆ J := + fun y h => ((mem_relationImage A J (graph g) y).1 h).1 + +theorem refinementAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ⊆ + M.refinementAssignmentImage a s b d level T T2 valid valid2 g B := by + intro y hy + obtain ⟨hy, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy + exact (mem_relationImage B J (graph g) y).2 ⟨hy, x, subset hx, entry⟩ + +theorem refinementAssignmentImage_zero (g : G) (A : ZFSet.{u}) : + M.refinementAssignmentImage a s b d ∅ T T2 valid valid2 g A = + M.stageOneAssignmentImage a s b d T T2 valid valid2 g A := rfl + +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) + +include pairing unions powers separation collection carrier order maps closed closed2 familyGround in +theorem refinementAssignmentActionGraph_injection (g : G) : InjectionCode J J (graph g) := + relationProduct_injection + (M.niceRefinementIndexActionGraph_injection a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g) + (relationProduct_injection (stageOneTermAction_injection a s T valid closed g) + (stageOneTermAction_injection a s T valid closed g)) + +include pairing unions powers separation collection carrier order maps closed closed2 familyGround in +theorem refinementAssignmentImage_entry (g : G) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) (A : ZFSet.{u}) : + stageOneAssignment (refinementIndexCode level (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) + (a.act s g u).val (a.act s g w).val ∈ + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ↔ + stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A := by + have entry := (M.refinementAssignmentActionGraph_entry a s b d level T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround + g C E U Rf Rc u w index hu hw _).2 rfl + have injection := M.refinementAssignmentActionGraph_injection a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g + constructor + · intro hy + obtain ⟨_, x, hx, xy⟩ := (mem_relationImage A J (graph g) _).1 hy + have equal := injection.injective _ _ _ xy entry + exact equal ▸ hx + · intro hx + exact (mem_relationImage A J (graph g) _).2 + ⟨(ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2, _, hx, entry⟩ + +include pairing unions powers separation collection carrier order maps closed closed2 familyGround in +theorem refinementAssignmentImage_small + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} + (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : + M.refinementAssignmentImage a s b d level T T2 valid valid2 g A ∈ M.groundSmallSubsets J ZFSet.omega := by + obtain ⟨hA, subset, small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member + have hJ := M.stageOneAssignments_mem pairing unions powers separation hI hT + have hg := M.refinementAssignmentActionGraph_mem a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier maps nodeMaps hLevel hT hT2 hI g + have injection := M.refinementAssignmentActionGraph_injection a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g + exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 + ⟨M.relationImage_mem separation hA hJ hg, + M.refinementAssignmentImage_subset a s b d level T T2 valid valid2 g A, + M.groundEmbeddable_image pairing unions powers separation hA hJ omega hg injection subset small⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentLabelEntries.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentLabelEntries.lean index 9f9eafb259383b697da5c28de3f9cba052c8cf87..39b4c67275db2b58cc806b00f08227eed6af6a8a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentLabelEntries.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementAssignmentLabelEntries.lean @@ -1,157 +1,157 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPairNameFamilies -import OAI.SetTheory.PartitionPrinciple.Forcing.RefinementAssignmentLabelNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -private def labelEntryFormula : SetFormula 7 := - exBlock 10 (.conj (.mem 0 11) (.conj (.mem 1 11) (.conj (.mem 2 14) - (.conj (orderedPairFormula 2 3 4) - (.conj (orderedPairFormula 8 0 1) - (.conj (orderedPairFormula 9 15 8) (.conj (.mem 9 4) - (.conj (pairMembershipFormula 0 5 12) - (.conj (pairMembershipFormula 1 6 13) - (.conj (orderedPairNameCodeFormula 7 5 6 16) - (orderedPairFormula 10 7 2))))))))))) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P Q : Type u} [PartialOrder P] [OrderTop P] -variable {s : Presentation P} (upper : Presentation Q) (incl : P → Q) (one : Q) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem refinementAssignmentLabel_mem_of_graphs - (hUpper : upper.carrier ∈ M.sets) (hOne : upper.encode one ∈ M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (idx : ZFSet.{u}) (hIdx : idx ∈ M.sets) (Rf Rc : Name s) - (Gc Gf : ZFSet.{u}) (hGc : Gc ∈ M.sets) (hGf : Gf ∈ M.sets) - (coarse : ∀ (v : Name s) y, ZFSet.pair v.val y ∈ Gc ↔ v.val ∈ T ∧ - y = (Name.rename upper incl (Name.refinementClass T valid Rc v)).val) - (fine : ∀ (w : Name s) y, ZFSet.pair w.val y ∈ Gf ↔ w.val ∈ T ∧ - y = (Name.rename upper incl (Name.refinementClass T valid Rf w)).val) : - (Name.refinementAssignmentLabel upper incl one T valid idx Rf Rc).val ∈ M.sets := by - let cv (v : Name s) := Name.rename upper incl (Name.refinementClass T valid Rc v) - let fw (w : Name s) := Name.rename upper incl (Name.refinementClass T valid Rf w) - let label := Name.refinementAssignmentLabel upper incl one T valid idx Rf Rc - let X := functionGraphRange T Gc - let Y := functionGraphRange T Gf - have hX := M.functionGraphRange_mem unions separation hT hGc - have hY := M.functionGraphRange_mem unions separation hT hGf - have cvX (v : Name s) (hv : v.val ∈ T) : (cv v).val ∈ X := - (mem_functionGraphRange T Gc _).2 ⟨v.val, hv, (coarse v _).2 ⟨hv, rfl⟩⟩ - have fwY (w : Name s) (hw : w.val ∈ T) : (fw w).val ∈ Y := - (mem_functionGraphRange T Gf _).2 ⟨w.val, hw, (fine w _).2 ⟨hw, rfl⟩⟩ - let bound := ZFSet.prod (orderedPairNameFamily (upper.encode one) X Y) upper.carrier - have hBound : bound ∈ M.sets := M.prod_mem pairing unions powers separation - (M.orderedPairNameFamily_mem pairing unions powers separation hOne hX hY) hUpper - have bounded : label.val ⊆ bound := by - intro z hz - obtain ⟨sigma, p, rfl⟩ := Name.entries_cover label hz - obtain ⟨v, w, hv, hw, _, rfl⟩ := - (Name.entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc sigma p).1 hz - apply ZFSet.pair_mem_prod.2 - refine ⟨?_, upper.encode_mem p⟩ - exact (mem_orderedPairNameFamily _ X Y _).2 - ⟨(cv v).val, cvX v hv, (fw w).val, fwY w hw, Name.orderedPair_code one (cv v) (fw w)⟩ - let params : Fin 6 → ZFSet.{u} := ![T, Gc, Gf, upper.carrier, idx, upper.encode one] - have paramsGround : ∀ j, params j ∈ M.sets := - Fin.cases hT (Fin.cases hGc (Fin.cases hGf (Fin.cases hUpper - (Fin.cases hIdx (Fin.cases hOne (fun j => Fin.elim0 j)))))) - have recognized (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets labelEntryFormula (extend z params) ↔ z ∈ label.val := by - let env := extend z params - have envGround : ∀ j, env j ∈ M.sets := Fin.cases hz paramsGround - have body (fields : Fin 10 → ZFSet.{u}) (hg : ∀ j, fields j ∈ M.sets) : - Realize M.sets - (.conj (.mem 0 11) (.conj (.mem 1 11) (.conj (.mem 2 14) - (.conj (orderedPairFormula 2 3 4) (.conj (orderedPairFormula 8 0 1) - (.conj (orderedPairFormula 9 15 8) (.conj (.mem 9 4) - (.conj (pairMembershipFormula 0 5 12) (.conj (pairMembershipFormula 1 6 13) - (.conj (orderedPairNameCodeFormula 7 5 6 16) (orderedPairFormula 10 7 2))))))))))) - (extendMany 10 fields env) ↔ - fields 0 ∈ T ∧ fields 1 ∈ T ∧ fields 2 ∈ upper.carrier ∧ - fields 2 = ZFSet.pair (fields 3) (fields 4) ∧ - fields 8 = ZFSet.pair (fields 0) (fields 1) ∧ - fields 9 = ZFSet.pair idx (fields 8) ∧ fields 9 ∈ fields 4 ∧ - ZFSet.pair (fields 0) (fields 5) ∈ Gc ∧ - ZFSet.pair (fields 1) (fields 6) ∈ Gf ∧ - fields 7 = orderedPairNameCode (upper.encode one) (fields 5) (fields 6) ∧ - z = ZFSet.pair (fields 7) (fields 2) := by - have all := extendMany_members 10 fields env hg envGround - simp only [Realize] - rw [M.realize_orderedPairFormula pairing 2 3 4 _ (all _) (all _) (all _), - M.realize_orderedPairFormula pairing 8 0 1 _ (all _) (all _) (all _), - M.realize_orderedPairFormula pairing 9 15 8 _ (all _) (all _) (all _), - M.realize_pairMembershipFormula pairing 0 5 12 _ (all _) (all _) (all _), - M.realize_pairMembershipFormula pairing 1 6 13 _ (all _) (all _) (all _), - M.realize_orderedPairNameCodeFormula pairing 7 5 6 16 _ all, - M.realize_orderedPairFormula pairing 10 7 2 _ (all _) (all _) (all _)] - rfl - rw [labelEntryFormula, realize_exBlock] - constructor - · rintro ⟨fields, hg, holds⟩ - obtain ⟨hv, hw, hp, pCode, vwCode, tripleCode, old, gc, gf, pairCode, entryCode⟩ := - (body fields hg).1 holds - let v : Name s := ⟨fields 0, valid _ hv⟩ - let w : Name s := ⟨fields 1, valid _ hw⟩ - obtain ⟨p, pEq⟩ := (upper.mem_carrier _).1 hp - have cvEq := ((coarse v _).1 gc).2 - have fwEq := ((fine w _).1 gf).2 - have literal : stageOneAssignment idx v.val w.val ∈ fields 4 := by - rw [tripleCode, vwCode] at old - exact old - have named : fields 7 = (Name.orderedPair one (cv v) (fw w)).val := by - rw [pairCode, cvEq, fwEq] - exact (Name.orderedPair_code one (cv v) (fw w)).symm - rw [entryCode, named, ← pEq] - exact (Name.entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc _ p).2 - ⟨v, w, hv, hw, ⟨fields 3, fields 4, pEq.trans pCode, literal⟩, rfl⟩ - · intro member - obtain ⟨sigma, p, rfl⟩ := Name.entries_cover label member - obtain ⟨v, w, hv, hw, ⟨row, A, pCode, old⟩, rfl⟩ := - (Name.entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc sigma p).1 member - have hp := M.transitive hUpper (upper.encode_mem p) - have hpCode : ZFSet.pair row A ∈ M.sets := pCode ▸ hp - have hrow := M.pair_left hpCode - have hA := M.pair_right hpCode - have hvM := M.transitive hT hv - have hwM := M.transitive hT hw - have hcv := M.transitive hX (cvX v hv) - have hfw := M.transitive hY (fwY w hw) - have hpair : (Name.orderedPair one (cv v) (fw w)).val ∈ M.sets := by - rw [Name.orderedPair_code] - exact M.orderedPairNameCode_mem pairing hOne hcv hfw - let fields : Fin 10 → ZFSet.{u} := ![v.val, w.val, upper.encode p, row, A, - (cv v).val, (fw w).val, (Name.orderedPair one (cv v) (fw w)).val, - ZFSet.pair v.val w.val, stageOneAssignment idx v.val w.val] - have hg : ∀ j, fields j ∈ M.sets := - Fin.cases hvM (Fin.cases hwM (Fin.cases hp (Fin.cases hrow (Fin.cases hA - (Fin.cases hcv (Fin.cases hfw (Fin.cases hpair - (Fin.cases (M.orderedPair_mem pairing hvM hwM) - (Fin.cases (M.transitive hA old) (fun j => Fin.elim0 j)))))))))) - exact ⟨fields, hg, (body fields hg).2 - ⟨hv, hw, upper.encode_mem p, pCode, rfl, rfl, old, - (coarse v _).2 ⟨hv, rfl⟩, (fine w _).2 ⟨hw, rfl⟩, - Name.orderedPair_code one (cv v) (fw w), rfl⟩⟩ - have selected := M.separation_mem separation labelEntryFormula params paramsGround hBound - have equal : ZFSet.sep (fun z => Realize M.sets labelEntryFormula (extend z params)) bound = label.val := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep] - exact ⟨fun h => (recognized z (M.transitive hBound h.1)).1 h.2, - fun h => ⟨bounded h, (recognized z (M.transitive hBound (bounded h))).2 h⟩⟩ - exact equal ▸ selected - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPairNameFamilies +import OAI.SetTheory.PartitionPrinciple.Forcing.RefinementAssignmentLabelNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +private def labelEntryFormula : SetFormula 7 := + exBlock 10 (.conj (.mem 0 11) (.conj (.mem 1 11) (.conj (.mem 2 14) + (.conj (orderedPairFormula 2 3 4) + (.conj (orderedPairFormula 8 0 1) + (.conj (orderedPairFormula 9 15 8) (.conj (.mem 9 4) + (.conj (pairMembershipFormula 0 5 12) + (.conj (pairMembershipFormula 1 6 13) + (.conj (orderedPairNameCodeFormula 7 5 6 16) + (orderedPairFormula 10 7 2))))))))))) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P Q : Type u} [PartialOrder P] [OrderTop P] +variable {s : Presentation P} (upper : Presentation Q) (incl : P → Q) (one : Q) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem refinementAssignmentLabel_mem_of_graphs + (hUpper : upper.carrier ∈ M.sets) (hOne : upper.encode one ∈ M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (idx : ZFSet.{u}) (hIdx : idx ∈ M.sets) (Rf Rc : Name s) + (Gc Gf : ZFSet.{u}) (hGc : Gc ∈ M.sets) (hGf : Gf ∈ M.sets) + (coarse : ∀ (v : Name s) y, ZFSet.pair v.val y ∈ Gc ↔ v.val ∈ T ∧ + y = (Name.rename upper incl (Name.refinementClass T valid Rc v)).val) + (fine : ∀ (w : Name s) y, ZFSet.pair w.val y ∈ Gf ↔ w.val ∈ T ∧ + y = (Name.rename upper incl (Name.refinementClass T valid Rf w)).val) : + (Name.refinementAssignmentLabel upper incl one T valid idx Rf Rc).val ∈ M.sets := by + let cv (v : Name s) := Name.rename upper incl (Name.refinementClass T valid Rc v) + let fw (w : Name s) := Name.rename upper incl (Name.refinementClass T valid Rf w) + let label := Name.refinementAssignmentLabel upper incl one T valid idx Rf Rc + let X := functionGraphRange T Gc + let Y := functionGraphRange T Gf + have hX := M.functionGraphRange_mem unions separation hT hGc + have hY := M.functionGraphRange_mem unions separation hT hGf + have cvX (v : Name s) (hv : v.val ∈ T) : (cv v).val ∈ X := + (mem_functionGraphRange T Gc _).2 ⟨v.val, hv, (coarse v _).2 ⟨hv, rfl⟩⟩ + have fwY (w : Name s) (hw : w.val ∈ T) : (fw w).val ∈ Y := + (mem_functionGraphRange T Gf _).2 ⟨w.val, hw, (fine w _).2 ⟨hw, rfl⟩⟩ + let bound := ZFSet.prod (orderedPairNameFamily (upper.encode one) X Y) upper.carrier + have hBound : bound ∈ M.sets := M.prod_mem pairing unions powers separation + (M.orderedPairNameFamily_mem pairing unions powers separation hOne hX hY) hUpper + have bounded : label.val ⊆ bound := by + intro z hz + obtain ⟨sigma, p, rfl⟩ := Name.entries_cover label hz + obtain ⟨v, w, hv, hw, _, rfl⟩ := + (Name.entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc sigma p).1 hz + apply ZFSet.pair_mem_prod.2 + refine ⟨?_, upper.encode_mem p⟩ + exact (mem_orderedPairNameFamily _ X Y _).2 + ⟨(cv v).val, cvX v hv, (fw w).val, fwY w hw, Name.orderedPair_code one (cv v) (fw w)⟩ + let params : Fin 6 → ZFSet.{u} := ![T, Gc, Gf, upper.carrier, idx, upper.encode one] + have paramsGround : ∀ j, params j ∈ M.sets := + Fin.cases hT (Fin.cases hGc (Fin.cases hGf (Fin.cases hUpper + (Fin.cases hIdx (Fin.cases hOne (fun j => Fin.elim0 j)))))) + have recognized (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets labelEntryFormula (extend z params) ↔ z ∈ label.val := by + let env := extend z params + have envGround : ∀ j, env j ∈ M.sets := Fin.cases hz paramsGround + have body (fields : Fin 10 → ZFSet.{u}) (hg : ∀ j, fields j ∈ M.sets) : + Realize M.sets + (.conj (.mem 0 11) (.conj (.mem 1 11) (.conj (.mem 2 14) + (.conj (orderedPairFormula 2 3 4) (.conj (orderedPairFormula 8 0 1) + (.conj (orderedPairFormula 9 15 8) (.conj (.mem 9 4) + (.conj (pairMembershipFormula 0 5 12) (.conj (pairMembershipFormula 1 6 13) + (.conj (orderedPairNameCodeFormula 7 5 6 16) (orderedPairFormula 10 7 2))))))))))) + (extendMany 10 fields env) ↔ + fields 0 ∈ T ∧ fields 1 ∈ T ∧ fields 2 ∈ upper.carrier ∧ + fields 2 = ZFSet.pair (fields 3) (fields 4) ∧ + fields 8 = ZFSet.pair (fields 0) (fields 1) ∧ + fields 9 = ZFSet.pair idx (fields 8) ∧ fields 9 ∈ fields 4 ∧ + ZFSet.pair (fields 0) (fields 5) ∈ Gc ∧ + ZFSet.pair (fields 1) (fields 6) ∈ Gf ∧ + fields 7 = orderedPairNameCode (upper.encode one) (fields 5) (fields 6) ∧ + z = ZFSet.pair (fields 7) (fields 2) := by + have all := extendMany_members 10 fields env hg envGround + simp only [Realize] + rw [M.realize_orderedPairFormula pairing 2 3 4 _ (all _) (all _) (all _), + M.realize_orderedPairFormula pairing 8 0 1 _ (all _) (all _) (all _), + M.realize_orderedPairFormula pairing 9 15 8 _ (all _) (all _) (all _), + M.realize_pairMembershipFormula pairing 0 5 12 _ (all _) (all _) (all _), + M.realize_pairMembershipFormula pairing 1 6 13 _ (all _) (all _) (all _), + M.realize_orderedPairNameCodeFormula pairing 7 5 6 16 _ all, + M.realize_orderedPairFormula pairing 10 7 2 _ (all _) (all _) (all _)] + rfl + rw [labelEntryFormula, realize_exBlock] + constructor + · rintro ⟨fields, hg, holds⟩ + obtain ⟨hv, hw, hp, pCode, vwCode, tripleCode, old, gc, gf, pairCode, entryCode⟩ := + (body fields hg).1 holds + let v : Name s := ⟨fields 0, valid _ hv⟩ + let w : Name s := ⟨fields 1, valid _ hw⟩ + obtain ⟨p, pEq⟩ := (upper.mem_carrier _).1 hp + have cvEq := ((coarse v _).1 gc).2 + have fwEq := ((fine w _).1 gf).2 + have literal : stageOneAssignment idx v.val w.val ∈ fields 4 := by + rw [tripleCode, vwCode] at old + exact old + have named : fields 7 = (Name.orderedPair one (cv v) (fw w)).val := by + rw [pairCode, cvEq, fwEq] + exact (Name.orderedPair_code one (cv v) (fw w)).symm + rw [entryCode, named, ← pEq] + exact (Name.entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc _ p).2 + ⟨v, w, hv, hw, ⟨fields 3, fields 4, pEq.trans pCode, literal⟩, rfl⟩ + · intro member + obtain ⟨sigma, p, rfl⟩ := Name.entries_cover label member + obtain ⟨v, w, hv, hw, ⟨row, A, pCode, old⟩, rfl⟩ := + (Name.entry_refinementAssignmentLabel upper incl one T valid idx Rf Rc sigma p).1 member + have hp := M.transitive hUpper (upper.encode_mem p) + have hpCode : ZFSet.pair row A ∈ M.sets := pCode ▸ hp + have hrow := M.pair_left hpCode + have hA := M.pair_right hpCode + have hvM := M.transitive hT hv + have hwM := M.transitive hT hw + have hcv := M.transitive hX (cvX v hv) + have hfw := M.transitive hY (fwY w hw) + have hpair : (Name.orderedPair one (cv v) (fw w)).val ∈ M.sets := by + rw [Name.orderedPair_code] + exact M.orderedPairNameCode_mem pairing hOne hcv hfw + let fields : Fin 10 → ZFSet.{u} := ![v.val, w.val, upper.encode p, row, A, + (cv v).val, (fw w).val, (Name.orderedPair one (cv v) (fw w)).val, + ZFSet.pair v.val w.val, stageOneAssignment idx v.val w.val] + have hg : ∀ j, fields j ∈ M.sets := + Fin.cases hvM (Fin.cases hwM (Fin.cases hp (Fin.cases hrow (Fin.cases hA + (Fin.cases hcv (Fin.cases hfw (Fin.cases hpair + (Fin.cases (M.orderedPair_mem pairing hvM hwM) + (Fin.cases (M.transitive hA old) (fun j => Fin.elim0 j)))))))))) + exact ⟨fields, hg, (body fields hg).2 + ⟨hv, hw, upper.encode_mem p, pCode, rfl, rfl, old, + (coarse v _).2 ⟨hv, rfl⟩, (fine w _).2 ⟨hw, rfl⟩, + Name.orderedPair_code one (cv v) (fw w), rfl⟩⟩ + have selected := M.separation_mem separation labelEntryFormula params paramsGround hBound + have equal : ZFSet.sep (fun z => Realize M.sets labelEntryFormula (extend z params)) bound = label.val := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep] + exact ⟨fun h => (recognized z (M.transitive hBound h.1)).1 h.2, + fun h => ⟨bounded h, (recognized z (M.transitive hBound (bounded h))).2 h⟩⟩ + exact equal ▸ selected + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementCoarseVisibility.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementCoarseVisibility.lean index 6b02f4342bf39d59eadede1dd73fbb6fc6b376e2..1b60517a8ed86fd8c931c1660832d718551ee6fe 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementCoarseVisibility.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementCoarseVisibility.lean @@ -1,109 +1,109 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRenamedNameFamilyBounds -import OAI.SetTheory.PartitionPrinciple.Forcing.RefinementCoarseImageNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection carrier order in -theorem refinementCoarseImage_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : (M.nameDomain s).names) : - (Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc).val ∈ M.sets := - M.ordinarySeparationName_mem s pairing unions powers separation collection carrier order - BoundedFormula.coarseClassImageFormula.toFormula (extend U (extend sigma (extend Rc Fin.elim0))) - ⟨Name.familySet ⊤ T valid, M.familySet_mem s ⊤ pairing unions powers separation hT - (M.transitive carrier (s.encode_mem ⊤)) valid⟩ - -variable (a : PosetAction G P) (t : Presentation G) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (b : Presentation L) (d : PosetAction G L) (base : L) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) - -include pairing unions powers separation collection carrier maps terms in -theorem refinementCoarseImage_principal_support (U sigma Rc : (M.nameDomain s).names) - {C v : L} (lower : C ≤ v) - (domain : d.principalFix C ≤ a.stabilizer s U.val) - (witness : d.principalFix v ≤ a.stabilizer s sigma.val) - (relation : d.principalFix C ≤ a.stabilizer s Rc.val) : - d.principalFix v ≤ a.stabilizer s (Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc) := - Name.refinementCoarseImage_support a (M.nameDomain s) - (fun g z hz => M.act_mem s a t pairing unions powers separation collection carrier maps g z hz) - T valid terms U sigma Rc (d.principalFix v) - (le_trans (d.principalFix_antitone lower) domain) witness - (le_trans (d.principalFix_antitone lower) relation) - -include pairing unions powers separation collection carrier order maps hT terms in -theorem coarseClass_visible_of_fineValue - (system : NiceNameSystem M a s b d base directed T valid) - (U sigma Rf Rc : (M.nameDomain s).names) {C v : L} (lower : C ≤ v) - (domain : d.principalFix C ≤ a.stabilizer s U.val) - (witness : d.principalFix v ≤ a.stabilizer s sigma.val) - (relation : d.principalFix C ≤ a.stabilizer s Rc.val) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (validity : RefinementValidityCode (Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) (Name.eval {p | H.mem p} Rc.val)) - {x : ZFSet.{u}} (hx : x ∈ Name.eval {p | H.mem p} U.val) - (fineValue : Name.eval {p | H.mem p} sigma.val = - equivalenceClass (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) x) : - equivalenceClass (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rc.val) x ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by - let image : (M.nameDomain s).names := - ⟨Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc, - M.refinementCoarseImage_mem s pairing unions powers separation collection carrier order hT valid U sigma Rc⟩ - have support := M.refinementCoarseImage_principal_support s pairing unions powers separation collection - carrier a t maps d valid terms U sigma Rc lower domain witness relation - have family := M.familySet_mem s ⊤ pairing unions powers separation hT - (M.transitive carrier (s.encode_mem ⊤)) valid - have value : Name.eval {p | H.mem p} image.val = - equivalenceClass (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rc.val) x := by - change Name.eval {p | H.mem p} (Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc) = _ - rw [Name.eval_refinementCoarseImage_of_subset (M.nameDomain s) T valid U sigma Rc family H generic validity.1, - fineValue, coarseClassImage_of_fineClass validity.2.1 validity.2.2.1 validity.2.2.2 hx] - have subset : Name.eval {p | H.mem p} image.val ⊆ - Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := by - rw [value] - exact fun _ h => validity.1 (equivalenceClass_subset _ _ _ h) - exact value ▸ system.normalization_visible v image support H generic subset - -include pairing unions powers separation collection carrier order maps hT terms in -theorem refinementQuotientMap_preserves_visibility - (system : NiceNameSystem M a s b d base directed T valid) - (U Rf Rc : (M.nameDomain s).names) {C v : L} (lower : C ≤ v) - (domain : d.principalFix C ≤ a.stabilizer s U.val) - (relation : d.principalFix C ≤ a.stabilizer s Rc.val) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - (validity : RefinementValidityCode (Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) - (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) (Name.eval {p | H.mem p} Rc.val)) - {fineClass coarseClass : ZFSet.{u}} - (visible : fineClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v))) - (entry : ZFSet.pair fineClass coarseClass ∈ refinementQuotientMap - (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) (Name.eval {p | H.mem p} Rc.val)) : - coarseClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by - obtain ⟨sigma, candidate, value⟩ := - (M.mem_eval_niceVisibilityName a s T (d.principalFix v) {p | H.mem p} H.top_mem fineClass).1 visible - have hsigma := (M.name_mem_niceNameCandidates a s T (d.principalFix v) sigma).1 candidate - obtain ⟨x, hx, fineValue, coarseValue⟩ := (pair_mem_refinementQuotientMap _ _ _ _ _).1 entry - rw [coarseValue] - exact M.coarseClass_visible_of_fineValue s pairing unions powers separation collection carrier order - a t maps b d base directed hT valid terms system U ⟨sigma, hsigma.1⟩ Rf Rc lower domain hsigma.2.2 - relation H generic validity hx (value.trans fineValue) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRenamedNameFamilyBounds +import OAI.SetTheory.PartitionPrinciple.Forcing.RefinementCoarseImageNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection carrier order in +theorem refinementCoarseImage_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U sigma Rc : (M.nameDomain s).names) : + (Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc).val ∈ M.sets := + M.ordinarySeparationName_mem s pairing unions powers separation collection carrier order + BoundedFormula.coarseClassImageFormula.toFormula (extend U (extend sigma (extend Rc Fin.elim0))) + ⟨Name.familySet ⊤ T valid, M.familySet_mem s ⊤ pairing unions powers separation hT + (M.transitive carrier (s.encode_mem ⊤)) valid⟩ + +variable (a : PosetAction G P) (t : Presentation G) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (b : Presentation L) (d : PosetAction G L) (base : L) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) + +include pairing unions powers separation collection carrier maps terms in +theorem refinementCoarseImage_principal_support (U sigma Rc : (M.nameDomain s).names) + {C v : L} (lower : C ≤ v) + (domain : d.principalFix C ≤ a.stabilizer s U.val) + (witness : d.principalFix v ≤ a.stabilizer s sigma.val) + (relation : d.principalFix C ≤ a.stabilizer s Rc.val) : + d.principalFix v ≤ a.stabilizer s (Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc) := + Name.refinementCoarseImage_support a (M.nameDomain s) + (fun g z hz => M.act_mem s a t pairing unions powers separation collection carrier maps g z hz) + T valid terms U sigma Rc (d.principalFix v) + (le_trans (d.principalFix_antitone lower) domain) witness + (le_trans (d.principalFix_antitone lower) relation) + +include pairing unions powers separation collection carrier order maps hT terms in +theorem coarseClass_visible_of_fineValue + (system : NiceNameSystem M a s b d base directed T valid) + (U sigma Rf Rc : (M.nameDomain s).names) {C v : L} (lower : C ≤ v) + (domain : d.principalFix C ≤ a.stabilizer s U.val) + (witness : d.principalFix v ≤ a.stabilizer s sigma.val) + (relation : d.principalFix C ≤ a.stabilizer s Rc.val) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (validity : RefinementValidityCode (Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) (Name.eval {p | H.mem p} Rc.val)) + {x : ZFSet.{u}} (hx : x ∈ Name.eval {p | H.mem p} U.val) + (fineValue : Name.eval {p | H.mem p} sigma.val = + equivalenceClass (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) x) : + equivalenceClass (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rc.val) x ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by + let image : (M.nameDomain s).names := + ⟨Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc, + M.refinementCoarseImage_mem s pairing unions powers separation collection carrier order hT valid U sigma Rc⟩ + have support := M.refinementCoarseImage_principal_support s pairing unions powers separation collection + carrier a t maps d valid terms U sigma Rc lower domain witness relation + have family := M.familySet_mem s ⊤ pairing unions powers separation hT + (M.transitive carrier (s.encode_mem ⊤)) valid + have value : Name.eval {p | H.mem p} image.val = + equivalenceClass (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rc.val) x := by + change Name.eval {p | H.mem p} (Name.refinementCoarseImage (M.nameDomain s) T valid U sigma Rc) = _ + rw [Name.eval_refinementCoarseImage_of_subset (M.nameDomain s) T valid U sigma Rc family H generic validity.1, + fineValue, coarseClassImage_of_fineClass validity.2.1 validity.2.2.1 validity.2.2.2 hx] + have subset : Name.eval {p | H.mem p} image.val ⊆ + Name.eval {p | H.mem p} (Name.familySet ⊤ T valid) := by + rw [value] + exact fun _ h => validity.1 (equivalenceClass_subset _ _ _ h) + exact value ▸ system.normalization_visible v image support H generic subset + +include pairing unions powers separation collection carrier order maps hT terms in +theorem refinementQuotientMap_preserves_visibility + (system : NiceNameSystem M a s b d base directed T valid) + (U Rf Rc : (M.nameDomain s).names) {C v : L} (lower : C ≤ v) + (domain : d.principalFix C ≤ a.stabilizer s U.val) + (relation : d.principalFix C ≤ a.stabilizer s Rc.val) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + (validity : RefinementValidityCode (Name.eval {p | H.mem p} (Name.familySet ⊤ T valid)) + (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) (Name.eval {p | H.mem p} Rc.val)) + {fineClass coarseClass : ZFSet.{u}} + (visible : fineClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v))) + (entry : ZFSet.pair fineClass coarseClass ∈ refinementQuotientMap + (Name.eval {p | H.mem p} U.val) (Name.eval {p | H.mem p} Rf.val) (Name.eval {p | H.mem p} Rc.val)) : + coarseClass ∈ Name.eval {p | H.mem p} (M.niceVisibilityName a s T (d.principalFix v)) := by + obtain ⟨sigma, candidate, value⟩ := + (M.mem_eval_niceVisibilityName a s T (d.principalFix v) {p | H.mem p} H.top_mem fineClass).1 visible + have hsigma := (M.name_mem_niceNameCandidates a s T (d.principalFix v) sigma).1 candidate + obtain ⟨x, hx, fineValue, coarseValue⟩ := (pair_mem_refinementQuotientMap _ _ _ _ _).1 entry + rw [coarseValue] + exact M.coarseClass_visible_of_fineValue s pairing unions powers separation collection carrier order + a t maps b d base directed hT valid terms system U ⟨sigma, hsigma.1⟩ Rf Rc lower domain hsigma.2.2 + relation H generic validity hx (value.trans fineValue) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementDataOutputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementDataOutputs.lean index 42952fc39b0a9a51f8a4a6f60a105fe920182d8f..1b016322bd510785d08c9dfdb0ee3d1a4a4338a0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementDataOutputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementDataOutputs.lean @@ -1,73 +1,73 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def refinementDataOutputGraph (kind : Fin 3) (data : Fin 15 → ZFSet.{u}) : ZFSet.{u} := - M.refinementIndexNameGraph kind (data 0) (data 3) (data 4) (data 5) - (data 6) (data 7) (data 8) (data 9) - -theorem refinementDataOutputGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (data : Fin 15 → ZFSet.{u}) (members : ∀ j, data j ∈ M.sets) (kind : Fin 3) : - M.refinementDataOutputGraph kind data ∈ M.sets := - M.refinementIndexNameGraph_mem kind pairing unions powers separation - (members 0) (members 3) (members 4) (members 5) - (members 6) (members 7) (members 8) (members 9) - -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - -theorem refinementLevelFormulaData_map_output : - M.refinementLevelFormulaData a s b d level T T2 valid 12 = - M.refinementDataOutputGraph 2 (M.refinementLevelFormulaData a s b d level T T2 valid) := rfl - -theorem refinementLevelFormulaData_output_entry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (members : ∀ j, M.refinementLevelFormulaData a s b d level T T2 valid j ∈ M.sets) - (C E : L) (U Rf Rc : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) (kind : Fin 3) (y : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) y ∈ - M.refinementDataOutputGraph kind (M.refinementLevelFormulaData a s b d level T T2 valid) ↔ - y = (Name.refinementOutput kind T valid U.val Rf.val Rc.val).val := by - let I := M.niceRefinementIndices a s b d level T T2 valid - let bounds := M.niceRefinementIndexBounds s b level T T2 - let fields : Fin 6 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] - have entries (j : Fin 6) (z : ZFSet.{u}) : - ZFSet.pair (nonemptyTupleCode 5 fields) z ∈ refinementIndexFieldGraph I (bounds j) j ↔ - z = fields j := by - have function : ZFSet.IsFunc I (bounds j) (refinementIndexFieldGraph I (bounds j) j) := - M.refinementIndices_field_function level b.carrier b.conditionOrder - (M.niceNameCandidateGraph a s b T d.principalFix) - (M.niceNameCandidateGraph a s b T2 d.principalFix) T T2 - (Name.familySet ⊤ T valid).val s.carrier s.conditionOrder (s.encode ⊤) j - constructor - · intro entry - exact ((refinementIndexFieldGraph_entry I (bounds j) fields j z).1 entry).2.2 - · intro equal - obtain ⟨v, hv, _⟩ := function.2 _ member - have value := ((refinementIndexFieldGraph_entry I (bounds j) fields j v).1 hv).2.2 - exact equal.symm ▸ (value ▸ hv) - exact M.refinementIndexNameGraph_entry s kind pairing unions powers separation collection - (members 7) (members 8) (members 0) (members 3) (members 4) (members 5) (members 6) - valid U.val Rf.val Rc.val U.property Rf.property Rc.property member - (entries 3) (entries 4) (entries 5) y - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def refinementDataOutputGraph (kind : Fin 3) (data : Fin 15 → ZFSet.{u}) : ZFSet.{u} := + M.refinementIndexNameGraph kind (data 0) (data 3) (data 4) (data 5) + (data 6) (data 7) (data 8) (data 9) + +theorem refinementDataOutputGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (data : Fin 15 → ZFSet.{u}) (members : ∀ j, data j ∈ M.sets) (kind : Fin 3) : + M.refinementDataOutputGraph kind data ∈ M.sets := + M.refinementIndexNameGraph_mem kind pairing unions powers separation + (members 0) (members 3) (members 4) (members 5) + (members 6) (members 7) (members 8) (members 9) + +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + +theorem refinementLevelFormulaData_map_output : + M.refinementLevelFormulaData a s b d level T T2 valid 12 = + M.refinementDataOutputGraph 2 (M.refinementLevelFormulaData a s b d level T T2 valid) := rfl + +theorem refinementLevelFormulaData_output_entry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (members : ∀ j, M.refinementLevelFormulaData a s b d level T T2 valid j ∈ M.sets) + (C E : L) (U Rf Rc : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) (kind : Fin 3) (y : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) y ∈ + M.refinementDataOutputGraph kind (M.refinementLevelFormulaData a s b d level T T2 valid) ↔ + y = (Name.refinementOutput kind T valid U.val Rf.val Rc.val).val := by + let I := M.niceRefinementIndices a s b d level T T2 valid + let bounds := M.niceRefinementIndexBounds s b level T T2 + let fields : Fin 6 → ZFSet.{u} := ![level, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val] + have entries (j : Fin 6) (z : ZFSet.{u}) : + ZFSet.pair (nonemptyTupleCode 5 fields) z ∈ refinementIndexFieldGraph I (bounds j) j ↔ + z = fields j := by + have function : ZFSet.IsFunc I (bounds j) (refinementIndexFieldGraph I (bounds j) j) := + M.refinementIndices_field_function level b.carrier b.conditionOrder + (M.niceNameCandidateGraph a s b T d.principalFix) + (M.niceNameCandidateGraph a s b T2 d.principalFix) T T2 + (Name.familySet ⊤ T valid).val s.carrier s.conditionOrder (s.encode ⊤) j + constructor + · intro entry + exact ((refinementIndexFieldGraph_entry I (bounds j) fields j z).1 entry).2.2 + · intro equal + obtain ⟨v, hv, _⟩ := function.2 _ member + have value := ((refinementIndexFieldGraph_entry I (bounds j) fields j v).1 hv).2.2 + exact equal.symm ▸ (value ▸ hv) + exact M.refinementIndexNameGraph_entry s kind pairing unions powers separation collection + (members 7) (members 8) (members 0) (members 3) (members 4) (members 5) (members 6) + valid U.val Rf.val Rc.val U.property Rf.property Rc.property member + (entries 3) (entries 4) (entries 5) y + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementFinitePowerSystems.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementFinitePowerSystems.lean index 90adfd08e1a1a3bb29998777d960ec89ccc38e0f..055d9c4994fcbd375cc5d9603d61eec06ce0bc9e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementFinitePowerSystems.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementFinitePowerSystems.lean @@ -1,46 +1,46 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBinaryRowStageOneRefinement - -namespace OAI - -section - -namespace PartitionPilot.Forcing.RefinementStageSystem -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable {a : PosetAction G P} {s : Presentation P} {t : Presentation G} -variable {b : Presentation L} {d : PosetAction G L} {base : L} -variable {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} -variable {level T T2 : ZFSet.{u}} - -theorem finitePower_system (system : RefinementStageSystem M a s t b d base directed level T T2) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) (hT : T ∈ M.sets) (n : Nat) : - let X := iteratedPairNameFamily (s.encode ⊤) T n - ∃ valid : ∀ z ∈ X, IsName s z, - X ∈ M.sets ∧ - (∀ g (tau : Name s), tau.val ∈ X → (a.act s g tau).val ∈ X) ∧ - (∀ tau : Name s, tau.val ∈ X → - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) ∧ - NiceNameSystem M a s b d base directed X valid := by - let valid := iteratedPairNameFamily_valid ⊤ system.valid1 n - have ground := M.iteratedPairNameFamily_mem pairing unions powers separation - (M.transitive carrier (s.encode_mem ⊤)) hT n - have closed := iteratedPairNameFamily_closed a system.valid1 system.inputs.terms_closed n - have symmetric := iteratedPairNameFamily_hs a (d.principalSupportFamily base directed) - system.valid1 system.terms_hs n - exact ⟨valid, ground, closed, symmetric, - M.niceNameSystem a s t pairing unions powers separation collection carrier order - system.inputs.condition_maps ground valid closed b d base directed group nodes supports symmetric⟩ - -end PartitionPilot.Forcing.RefinementStageSystem - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBinaryRowStageOneRefinement + +namespace OAI + +section + +namespace PartitionPilot.Forcing.RefinementStageSystem +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable {a : PosetAction G P} {s : Presentation P} {t : Presentation G} +variable {b : Presentation L} {d : PosetAction G L} {base : L} +variable {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} +variable {level T T2 : ZFSet.{u}} + +theorem finitePower_system (system : RefinementStageSystem M a s t b d base directed level T T2) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) (hT : T ∈ M.sets) (n : Nat) : + let X := iteratedPairNameFamily (s.encode ⊤) T n + ∃ valid : ∀ z ∈ X, IsName s z, + X ∈ M.sets ∧ + (∀ g (tau : Name s), tau.val ∈ X → (a.act s g tau).val ∈ X) ∧ + (∀ tau : Name s, tau.val ∈ X → + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) ∧ + NiceNameSystem M a s b d base directed X valid := by + let valid := iteratedPairNameFamily_valid ⊤ system.valid1 n + have ground := M.iteratedPairNameFamily_mem pairing unions powers separation + (M.transitive carrier (s.encode_mem ⊤)) hT n + have closed := iteratedPairNameFamily_closed a system.valid1 system.inputs.terms_closed n + have symmetric := iteratedPairNameFamily_hs a (d.principalSupportFamily base directed) + system.valid1 system.terms_hs n + exact ⟨valid, ground, closed, symmetric, + M.niceNameSystem a s t pairing unions powers separation collection carrier order + system.inputs.condition_maps ground valid closed b d base directed group nodes supports symmetric⟩ + +end PartitionPilot.Forcing.RefinementStageSystem + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementRawTestMonotonicity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementRawTestMonotonicity.lean index db144317fec2a8f9b317c73f2c9e759306768d13..650e363c99dd741b37645037a2188e2968268b18 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementRawTestMonotonicity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementRawTestMonotonicity.lean @@ -1,343 +1,343 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementLevelSingleCodes -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneTestEquivalence - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -def refinementLevelTests (level T2 A : ZFSet.{u}) (p : P) : Prop := - ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names), - let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices a s b d level T T2 valid → - (∀ u w : (M.nameDomain s).names, u.val.val ∈ T → w.val.val ∈ T → - stageOneAssignment idx u.val.val w.val.val ∈ A → - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p) ∧ - (∀ u u' w w' : (M.nameDomain s).names, - u.val.val ∈ T → u'.val.val ∈ T → w.val.val ∈ T → w'.val.val ∈ T → - stageOneAssignment idx u.val.val w.val.val ∈ A → - stageOneAssignment idx u'.val.val w'.val.val ∈ A → - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' p) - -theorem refinementLevelTests_zero (T2 A : ZFSet.{u}) (p : P) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system ∅ T2 A p = - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 A p := rfl - -theorem refinementLevelTests_mono (level T2 A : ZFSet.{u}) {p q : P} - (tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A p) (below : q ≤ p) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A q := by - intro C E U Rf Rc - dsimp only - intro member - obtain ⟨single, collision⟩ := tests C E U Rf Rc member - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w (single u w hu hw entry) below - · intro u u' w w' hu hu' hw hw' entry entry' - exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' (collision u u' w w' hu hu' hw hw' entry entry') below - -theorem refinementLevelTests_subset (level T2 : ZFSet.{u}) {A B : ZFSet.{u}} (p : P) - (tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A p) (subset : B ⊆ A) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 B p := by - intro C E U Rf Rc - dsimp only - intro member - obtain ⟨single, collision⟩ := tests C E U Rf Rc member - exact ⟨fun u w hu hw entry => single u w hu hw (subset entry), - fun u u' w w' hu hu' hw hw' entry entry' => - collision u u' w w' hu hu' hw hw' (subset entry) (subset entry')⟩ - -theorem refinementLevelTests_empty (level T2 : ZFSet.{u}) (p : P) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 ∅ p := by - intro C E U Rf Rc - dsimp only - intro member - exact ⟨fun _ _ _ _ entry => False.elim (ZFSet.notMem_empty _ entry), - fun _ _ _ _ _ _ _ _ entry _ => False.elim (ZFSet.notMem_empty _ entry)⟩ - -theorem refinementLevelTests_transfer (level T2 : ZFSet.{u}) {A B : ZFSet.{u}} (p : P) - (tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A p) - (guards : ∀ t ∈ M.niceRefinementIndices a s b d level T T2 valid, - ∀ u ∈ T, ∀ w ∈ T, stageOneAssignment t u w ∈ B → stageOneAssignment t u w ∈ A) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 B p := by - intro C E U Rf Rc - dsimp only - intro member - obtain ⟨single, collision⟩ := tests C E U Rf Rc member - exact ⟨fun u w hu hw entry => single u w hu hw - (guards _ member u.val.val hu w.val.val hw entry), - fun u u' w w' hu hu' hw hw' entry entry' => - collision u u' w w' hu hu' hw hw' - (guards _ member u.val.val hu w.val.val hw entry) - (guards _ member u'.val.val hu' w'.val.val hw' entry')⟩ - -theorem refinementLevelTests_congr (level T2 A B : ZFSet.{u}) (p : P) - (guards : ∀ t ∈ M.niceRefinementIndices a s b d level T T2 valid, - ∀ u ∈ T, ∀ w ∈ T, stageOneAssignment t u w ∈ A ↔ stageOneAssignment t u w ∈ B) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A p ↔ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 B p := by - constructor - · intro tests - exact M.refinementLevelTests_transfer s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 p tests - (fun t ht u hu w hw entry => (guards t ht u hu w hw).2 entry) - · intro tests - exact M.refinementLevelTests_transfer s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 p tests - (fun t ht u hu w hw entry => (guards t ht u hu w hw).1 entry) - -theorem refinementLevelTests_of_no_assignments (level T2 A : ZFSet.{u}) (p : P) - (absent : ∀ t ∈ M.niceRefinementIndices a s b d level T T2 valid, - ∀ u ∈ T, ∀ w ∈ T, stageOneAssignment t u w ∉ A) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A p := - M.refinementLevelTests_transfer s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 p - (M.refinementLevelTests_empty s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 p) - (fun t ht u hu w hw entry => False.elim (absent t ht u hu w hw entry)) - -variable {I0 T2 : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -include first second - -theorem refinementLevelTests_stageTwoSplice (Aq Ap : ZFSet.{u}) (p : P) : - let I1 := M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 - (assignmentSplice (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq Ap) p ↔ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 Ap p := by - apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid - a b d base directed system - intro t ht u _ w _ - exact stageTwoAssignmentSplice_upper_iff first second Aq Ap ht - -theorem refinementLevelTests_stageTwoOld {A : ZFSet.{u}} (p : P) - (subsetOld : A ⊆ stageOneAssignments I0 T) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 A p := by - apply M.refinementLevelTests_of_no_assignments s pairing unions powers separation collection carrier order - hT valid a b d base directed system - intro t ht u _ w _ - exact stageTwoAssignment_old_no_upper first second subsetOld ht - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem refinementLevelTests_union (level T2 : ZFSet.{u}) (family : Nat → ZFSet.{u}) (rows : Nat → P) (p : P) - (increasing : ∀ n m, n ≤ m → family n ⊆ family m) - (below : ∀ n, p ≤ rows n) - (tests : ∀ n, M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 (family n) (rows n)) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 (stageOneAssignmentUnion family) p := by - intro C E U Rf Rc - dsimp only - intro index - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry - exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w ((tests n C E U Rf Rc index).1 u w hu hw hn) (below n) - · intro u u' w w' hu hu' hw hw' entry entry' - obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry - obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion family _).1 entry' - have first := increasing n (max n m) (Nat.le_max_left n m) hn - have second := increasing m (max n m) (Nat.le_max_right n m) hm - exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' ((tests (max n m) C E U Rf Rc index).2 u u' w w' hu hu' hw hw' first second) - (below (max n m)) - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -variable {I0 T2 : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -include first second - -theorem refinementLevelTests_stageTwoUnion (A0 A1 : ZFSet.{u}) (p : P) - (lower : A0 ⊆ stageOneAssignments I0 T) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 (A0 ∪ A1) p ↔ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 A1 p := by - apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid - a b d base directed system - intro t ht u _ w _ - rw [ZFSet.mem_union] - have absent := stageTwoAssignment_old_no_upper first second lower (u := u) (w := w) ht - exact ⟨fun h => h.elim (fun impossible => False.elim (absent impossible)) id, Or.inr⟩ - -end - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -include nodes indices in -theorem refinementLevelRawSingle_iff (C E : L) (U Rf Rc u w : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) (p : P) : - stageOneRawSingle M (M.refinementLevelFormulaData a s b d level T T2 valid) - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val w.val.val (s.encode p) ↔ - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p := by - have meaning := M.refinementLevelRawSingle_codes a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices C E U Rf Rc u w member p - let bu := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u - let aw := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w - have codes : (fun j : Fin 3 => ((![u, w, U] : Assignment (M.nameDomain s) 3) j).val.val) = - ![u.val.val, w.val.val, U.val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j - have activity := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order - refinementActivityFormula p ![u, w, U] - rw [codes] at activity - have profile := M.stageOneRawProfile_iff s pairing unions powers separation collection carrier order - valid a b d (T2 := T2) base directed system E bu aw p - change stageOneRawProfile M s.carrier s.conditionOrder (s.encode p) b.carrier b.conditionOrder - (M.niceVisibilityGraph a s b T d.principalFix) (b.encode E) bu.val.val aw.val.val ↔ _ at profile - have compatible := M.refinementLevelRawCompatibility_iff s pairing unions powers separation collection carrier order - hT valid a b d level base directed system indices C E U Rf Rc bu aw p member - exact meaning.trans (and_congr activity (and_congr profile compatible)) - -include nodes indices in -theorem refinementLevelRawTests_iff (A : ZFSet.{u}) (p : P) : - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p) ↔ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2 A p := by - have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system - have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices - let lift (r : ZFSet.{u}) (hr : r ∈ T) : (M.nameDomain s).names := - ⟨⟨r, valid r hr⟩, M.transitive hT hr⟩ - constructor - · intro raw C E U Rf Rc - dsimp only - intro member - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - exact (single C E U Rf Rc u w member p).1 - (raw.1 _ member u.val.val hu w.val.val hw entry) - · intro u u' w w' hu hu' hw hw' entry entry' - exact (collision C E U Rf Rc u u' w w' member p).1 - (raw.2 _ member u.val.val hu u'.val.val hu' w.val.val hw w'.val.val hw' entry entry') - · intro typed - refine ⟨?_, ?_⟩ - · intro t ht rawU hu rawW hw entry - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht - exact (single C E U Rf Rc (lift rawU hu) (lift rawW hw) ht p).2 - ((typed C E U Rf Rc ht).1 (lift rawU hu) (lift rawW hw) hu hw entry) - · intro t ht rawU hu rawU' hu' rawW hw rawW' hw' entry entry' - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht - exact (collision C E U Rf Rc (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') ht p).2 - ((typed C E U Rf Rc ht).2 (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') - hu hu' hw hw' entry entry') - -include pairing unions powers separation collection carrier order nodes hT indices system - -theorem refinementLevelRawTests_mono (A : ZFSet.{u}) {p q : P} - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) - (below : q ≤ p) : - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode q) := by - have meaning := M.refinementLevelRawTests_iff a s b d level pairing unions powers separation - collection carrier order nodes hT valid indices base directed system - exact (meaning A q).2 (M.refinementLevelTests_mono s pairing unions powers separation collection - carrier order hT valid a b d base directed system level T2 A ((meaning A p).1 tests) below) - -theorem refinementLevelRawTests_order_mono (A : ZFSet.{u}) {p q : ZFSet.{u}} - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A p) - (below : ZFSet.pair q p ∈ s.conditionOrder) : - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A q := by - rw [Presentation.conditionOrder, Presentation.mem_subset] at below - obtain ⟨⟨q', p'⟩, below, equal⟩ := below - change ZFSet.pair (s.encode q') (s.encode p') = ZFSet.pair q p at equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system A tests below - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementLevelSingleCodes +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneTestEquivalence + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +def refinementLevelTests (level T2 A : ZFSet.{u}) (p : P) : Prop := + ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names), + let idx := refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices a s b d level T T2 valid → + (∀ u w : (M.nameDomain s).names, u.val.val ∈ T → w.val.val ∈ T → + stageOneAssignment idx u.val.val w.val.val ∈ A → + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p) ∧ + (∀ u u' w w' : (M.nameDomain s).names, + u.val.val ∈ T → u'.val.val ∈ T → w.val.val ∈ T → w'.val.val ∈ T → + stageOneAssignment idx u.val.val w.val.val ∈ A → + stageOneAssignment idx u'.val.val w'.val.val ∈ A → + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' p) + +theorem refinementLevelTests_zero (T2 A : ZFSet.{u}) (p : P) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system ∅ T2 A p = + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 A p := rfl + +theorem refinementLevelTests_mono (level T2 A : ZFSet.{u}) {p q : P} + (tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A p) (below : q ≤ p) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A q := by + intro C E U Rf Rc + dsimp only + intro member + obtain ⟨single, collision⟩ := tests C E U Rf Rc member + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w (single u w hu hw entry) below + · intro u u' w w' hu hu' hw hw' entry entry' + exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' (collision u u' w w' hu hu' hw hw' entry entry') below + +theorem refinementLevelTests_subset (level T2 : ZFSet.{u}) {A B : ZFSet.{u}} (p : P) + (tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A p) (subset : B ⊆ A) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 B p := by + intro C E U Rf Rc + dsimp only + intro member + obtain ⟨single, collision⟩ := tests C E U Rf Rc member + exact ⟨fun u w hu hw entry => single u w hu hw (subset entry), + fun u u' w w' hu hu' hw hw' entry entry' => + collision u u' w w' hu hu' hw hw' (subset entry) (subset entry')⟩ + +theorem refinementLevelTests_empty (level T2 : ZFSet.{u}) (p : P) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 ∅ p := by + intro C E U Rf Rc + dsimp only + intro member + exact ⟨fun _ _ _ _ entry => False.elim (ZFSet.notMem_empty _ entry), + fun _ _ _ _ _ _ _ _ entry _ => False.elim (ZFSet.notMem_empty _ entry)⟩ + +theorem refinementLevelTests_transfer (level T2 : ZFSet.{u}) {A B : ZFSet.{u}} (p : P) + (tests : M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A p) + (guards : ∀ t ∈ M.niceRefinementIndices a s b d level T T2 valid, + ∀ u ∈ T, ∀ w ∈ T, stageOneAssignment t u w ∈ B → stageOneAssignment t u w ∈ A) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 B p := by + intro C E U Rf Rc + dsimp only + intro member + obtain ⟨single, collision⟩ := tests C E U Rf Rc member + exact ⟨fun u w hu hw entry => single u w hu hw + (guards _ member u.val.val hu w.val.val hw entry), + fun u u' w w' hu hu' hw hw' entry entry' => + collision u u' w w' hu hu' hw hw' + (guards _ member u.val.val hu w.val.val hw entry) + (guards _ member u'.val.val hu' w'.val.val hw' entry')⟩ + +theorem refinementLevelTests_congr (level T2 A B : ZFSet.{u}) (p : P) + (guards : ∀ t ∈ M.niceRefinementIndices a s b d level T T2 valid, + ∀ u ∈ T, ∀ w ∈ T, stageOneAssignment t u w ∈ A ↔ stageOneAssignment t u w ∈ B) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A p ↔ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 B p := by + constructor + · intro tests + exact M.refinementLevelTests_transfer s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 p tests + (fun t ht u hu w hw entry => (guards t ht u hu w hw).2 entry) + · intro tests + exact M.refinementLevelTests_transfer s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 p tests + (fun t ht u hu w hw entry => (guards t ht u hu w hw).1 entry) + +theorem refinementLevelTests_of_no_assignments (level T2 A : ZFSet.{u}) (p : P) + (absent : ∀ t ∈ M.niceRefinementIndices a s b d level T T2 valid, + ∀ u ∈ T, ∀ w ∈ T, stageOneAssignment t u w ∉ A) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A p := + M.refinementLevelTests_transfer s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 p + (M.refinementLevelTests_empty s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 p) + (fun t ht u hu w hw entry => False.elim (absent t ht u hu w hw entry)) + +variable {I0 T2 : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +include first second + +theorem refinementLevelTests_stageTwoSplice (Aq Ap : ZFSet.{u}) (p : P) : + let I1 := M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 + (assignmentSplice (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq Ap) p ↔ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 Ap p := by + apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid + a b d base directed system + intro t ht u _ w _ + exact stageTwoAssignmentSplice_upper_iff first second Aq Ap ht + +theorem refinementLevelTests_stageTwoOld {A : ZFSet.{u}} (p : P) + (subsetOld : A ⊆ stageOneAssignments I0 T) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 A p := by + apply M.refinementLevelTests_of_no_assignments s pairing unions powers separation collection carrier order + hT valid a b d base directed system + intro t ht u _ w _ + exact stageTwoAssignment_old_no_upper first second subsetOld ht + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem refinementLevelTests_union (level T2 : ZFSet.{u}) (family : Nat → ZFSet.{u}) (rows : Nat → P) (p : P) + (increasing : ∀ n m, n ≤ m → family n ⊆ family m) + (below : ∀ n, p ≤ rows n) + (tests : ∀ n, M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 (family n) (rows n)) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 (stageOneAssignmentUnion family) p := by + intro C E U Rf Rc + dsimp only + intro index + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry + exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w ((tests n C E U Rf Rc index).1 u w hu hw hn) (below n) + · intro u u' w w' hu hu' hw hw' entry entry' + obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry + obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion family _).1 entry' + have first := increasing n (max n m) (Nat.le_max_left n m) hn + have second := increasing m (max n m) (Nat.le_max_right n m) hm + exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' ((tests (max n m) C E U Rf Rc index).2 u u' w w' hu hu' hw hw' first second) + (below (max n m)) + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +variable {I0 T2 : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +include first second + +theorem refinementLevelTests_stageTwoUnion (A0 A1 : ZFSet.{u}) (p : P) + (lower : A0 ⊆ stageOneAssignments I0 T) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 (A0 ∪ A1) p ↔ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 A1 p := by + apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid + a b d base directed system + intro t ht u _ w _ + rw [ZFSet.mem_union] + have absent := stageTwoAssignment_old_no_upper first second lower (u := u) (w := w) ht + exact ⟨fun h => h.elim (fun impossible => False.elim (absent impossible)) id, Or.inr⟩ + +end + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +include nodes indices in +theorem refinementLevelRawSingle_iff (C E : L) (U Rf Rc u w : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) (p : P) : + stageOneRawSingle M (M.refinementLevelFormulaData a s b d level T T2 valid) + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val w.val.val (s.encode p) ↔ + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p := by + have meaning := M.refinementLevelRawSingle_codes a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices C E U Rf Rc u w member p + let bu := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u + let aw := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w + have codes : (fun j : Fin 3 => ((![u, w, U] : Assignment (M.nameDomain s) 3) j).val.val) = + ![u.val.val, w.val.val, U.val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j + have activity := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order + refinementActivityFormula p ![u, w, U] + rw [codes] at activity + have profile := M.stageOneRawProfile_iff s pairing unions powers separation collection carrier order + valid a b d (T2 := T2) base directed system E bu aw p + change stageOneRawProfile M s.carrier s.conditionOrder (s.encode p) b.carrier b.conditionOrder + (M.niceVisibilityGraph a s b T d.principalFix) (b.encode E) bu.val.val aw.val.val ↔ _ at profile + have compatible := M.refinementLevelRawCompatibility_iff s pairing unions powers separation collection carrier order + hT valid a b d level base directed system indices C E U Rf Rc bu aw p member + exact meaning.trans (and_congr activity (and_congr profile compatible)) + +include nodes indices in +theorem refinementLevelRawTests_iff (A : ZFSet.{u}) (p : P) : + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p) ↔ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2 A p := by + have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system + have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices + let lift (r : ZFSet.{u}) (hr : r ∈ T) : (M.nameDomain s).names := + ⟨⟨r, valid r hr⟩, M.transitive hT hr⟩ + constructor + · intro raw C E U Rf Rc + dsimp only + intro member + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + exact (single C E U Rf Rc u w member p).1 + (raw.1 _ member u.val.val hu w.val.val hw entry) + · intro u u' w w' hu hu' hw hw' entry entry' + exact (collision C E U Rf Rc u u' w w' member p).1 + (raw.2 _ member u.val.val hu u'.val.val hu' w.val.val hw w'.val.val hw' entry entry') + · intro typed + refine ⟨?_, ?_⟩ + · intro t ht rawU hu rawW hw entry + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht + exact (single C E U Rf Rc (lift rawU hu) (lift rawW hw) ht p).2 + ((typed C E U Rf Rc ht).1 (lift rawU hu) (lift rawW hw) hu hw entry) + · intro t ht rawU hu rawU' hu' rawW hw rawW' hw' entry entry' + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht + exact (collision C E U Rf Rc (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') ht p).2 + ((typed C E U Rf Rc ht).2 (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') + hu hu' hw hw' entry entry') + +include pairing unions powers separation collection carrier order nodes hT indices system + +theorem refinementLevelRawTests_mono (A : ZFSet.{u}) {p q : P} + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) + (below : q ≤ p) : + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode q) := by + have meaning := M.refinementLevelRawTests_iff a s b d level pairing unions powers separation + collection carrier order nodes hT valid indices base directed system + exact (meaning A q).2 (M.refinementLevelTests_mono s pairing unions powers separation collection + carrier order hT valid a b d base directed system level T2 A ((meaning A p).1 tests) below) + +theorem refinementLevelRawTests_order_mono (A : ZFSet.{u}) {p q : ZFSet.{u}} + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A p) + (below : ZFSet.pair q p ∈ s.conditionOrder) : + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A q := by + rw [Presentation.conditionOrder, Presentation.mem_subset] at below + obtain ⟨⟨q', p'⟩, below, equal⟩ := below + change ZFSet.pair (s.encode q') (s.encode p') = ZFSet.pair q p at equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system A tests below + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementVisibleLiftInsertions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementVisibleLiftInsertions.lean index d10f6eccd207394892fe7dd749968f9f358dfe81..06f332ec59f7b07a1fc4d4ef9527898c54f90be7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementVisibleLiftInsertions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRefinementVisibleLiftInsertions.lean @@ -1,465 +1,465 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAbsentLiftRangeCollisions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementRawTestMonotonicity - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (a : PosetAction G P) (t : Presentation G) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (level : ZFSet.{u}) -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - -include carrier in -private theorem visibility_forces_upward (small : M.sets.Countable) - (z : (M.nameDomain s).names) (C v : L) (lower : C ≤ v) (p : P) - (visible : Name.ForcesMem p z.val - (M.stageOneVisibilityName s valid a b d base directed system C).val) : - Name.ForcesMem p z.val - (M.stageOneVisibilityName s valid a b d base directed system v).val := by - let vis := M.stageOneVisibilityName s valid a b d base directed system - change Forces (M.nameDomain s) (.mem 0 1) ![z, vis v] p - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - have seen := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) z.property (vis C).property hp visible - exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).1 - (M.visibleSupportProfile_upward a s b d T H _ lower - ((M.encode_mem_visibleSupportProfile a s b d T H _ C).2 seen)) - -include maps terms indices in -theorem refinementVisibleLift_forces_coarse_visibility (small : M.sets.Countable) - (C E : L) (U Rf Rc fine coarse : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (p : P) : - let vis := M.stageOneVisibilityName s valid a b d base directed system - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - Name.ForcesMem p fine.val (vis C).val → - Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![fine, coarse, map] p → - Name.ForcesMem p coarse.val (vis C).val := by - dsimp only - let vis := M.stageOneVisibilityName s valid a b d base directed system - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - intro visible selected - change Forces (M.nameDomain s) (.mem 0 1) ![coarse, vis C] p - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - have seen := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) fine.property (vis C).property hp visible - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - have selectedTruth := forces_sound (M.nameDomain s) H generic - (BoundedFormula.pairMembershipFormula 0 1 2).toFormula ![fine, coarse, map] hp selected - have entry : ZFSet.pair (Name.eval {q | H.mem q} fine.val) - (Name.eval {q | H.mem q} coarse.val) ∈ Name.eval {q | H.mem q} map.val := - (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).1 - ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).1 selectedTruth) - exact M.niceRefinementIndex_preserves_visibility s pairing unions powers separation collection - carrier order a t maps b d base directed hT terms system indices C E U Rf Rc member - le_rfl H generic seen entry - -include maps terms indices in -theorem stageOneSingleTests_visible_lift (small : M.sets.Countable) - (C E : L) (U Rf Rc u w : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) - (p : P) (activeU : Name.ForcesMem p u.val U.val) - (activeW : Name.ForcesMem p w.val U.val) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - Name.ForcesMem p (cls Rf w).val (vis C).val → - Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![cls Rf w, cls Rc u, map] p → - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - intro visible selected - have coarseVisible := M.refinementVisibleLift_forces_coarse_visibility s pairing unions powers - separation collection carrier order hT valid a t maps b d base directed terms system level indices - small C E U Rf Rc (cls Rf w) (cls Rc u) member p visible selected - have above := ((indices.typed_entries C E U Rf Rc).1 member).1.le - refine ⟨⟨activeU, activeW⟩, ?_, ?_⟩ - · intro v hv - have fineAbove := visibility_forces_upward M s carrier valid a b d base directed system - small (cls Rf w) C v (above.trans hv) p visible - have coarseAbove := visibility_forces_upward M s carrier valid a b d base directed system - small (cls Rc u) C v (above.trans hv) p coarseVisible - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementProfileFormula _ (fun j => ⟨_, rfl⟩)).2 - have fineSeen := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) (cls Rf w).property (vis v).property hp fineAbove - have coarseSeen := Name.forcesMem_sound (M.nameDomain s) H - (fun D hD dense => generic D (Or.inl hD) dense) (cls Rc u).property (vis v).property hp coarseAbove - exact ⟨fun _ => fineSeen, fun _ => coarseSeen⟩ - · apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 - intro H hp generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ - apply (evaluated.realize_refinementCompatibilityFormula _ (fun j => ⟨_, rfl⟩)).2 - intro _ - have selectedTruth := forces_sound (M.nameDomain s) H generic - (BoundedFormula.pairMembershipFormula 0 1 2).toFormula ![cls Rf w, cls Rc u, map] hp selected - exact (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).1 - ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).1 selectedTruth) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -universe u - -variable (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) - -theorem stageOneRawTests_insert {A lower t u w : ZFSet.{u}} - (tests : stageOneRawTests M d A lower) - (single : stageOneRawSingle M d t u w lower) - (old_new : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t v u z w lower) - (new_old : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t u v w z lower) - (self : stageOneRawCollision M d t u u w w lower) : - stageOneRawTests M d (insert (stageOneAssignment t u w) A) lower := by - refine ⟨?_, ?_⟩ - · intro i hi v hv z hz entry - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i v z t u w).1 equal - exact single - · exact tests.1 i hi v hv z hz old - · intro i hi v hv v' hv' z hz z' hz' entry entry' - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i v z t u w).1 equal - rcases ZFSet.mem_insert_iff.1 entry' with equal' | old' - · obtain ⟨_, rfl, rfl⟩ := (stageOneAssignment_eq_iff _ _ _ _ _ _).1 equal' - exact self - · exact new_old v' hv' z' hz' old' - · rcases ZFSet.mem_insert_iff.1 entry' with equal' | old' - · obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i v' z' t u w).1 equal' - exact old_new v hv z hz old - · exact tests.2 i hi v hv v' hv' z hz z' hz' old old' - -theorem stageOneRawTests_insert_iff {A lower t u w : ZFSet.{u}} - (index : t ∈ d 0) (first : u ∈ d 6) (second : w ∈ d 6) : - stageOneRawTests M d (insert (stageOneAssignment t u w) A) lower ↔ - stageOneRawTests M d A lower ∧ - stageOneRawSingle M d t u w lower ∧ - (∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t v u z w lower) ∧ - (∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t u v w z lower) ∧ - stageOneRawCollision M d t u u w w lower := by - constructor - · intro tests - have added : stageOneAssignment t u w ∈ insert (stageOneAssignment t u w) A := - ZFSet.mem_insert _ _ - refine ⟨stageOneRawTests_transfer M d lower tests (fun _ _ _ _ _ _ h => - ZFSet.mem_insert_of_mem _ h), tests.1 t index u first w second added, ?_, ?_, ?_⟩ - · intro v hv z hz old - exact tests.2 t index v hv u first z hz w second - (ZFSet.mem_insert_of_mem _ old) added - · intro v hv z hz old - exact tests.2 t index u first v hv w second z hz added - (ZFSet.mem_insert_of_mem _ old) - · exact tests.2 t index u first u first w second w second added added - · rintro ⟨tests, single, old_new, new_old, self⟩ - exact stageOneRawTests_insert M d tests single old_new new_old self - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -theorem assignmentCut_insert_current {J stages levels alpha z A : ZFSet.{u}} - (function : ZFSet.IsFunc J stages levels) - (level : ZFSet.pair z alpha ∈ levels) : - assignmentCut levels alpha (insert z A) = assignmentCut levels alpha A := by - apply ZFSet.ext - intro x - rw [mem_assignmentCut, mem_assignmentCut] - constructor - · rintro ⟨member, xi, hxi, entry⟩ - rcases ZFSet.mem_insert_iff.1 member with rfl | old - · have hz := (ZFSet.pair_mem_prod.1 (function.1 level)).1 - obtain ⟨value, _, unique⟩ := function.2 _ hz - have equal : xi = alpha := (unique xi entry).trans (unique alpha level).symm - exact False.elim (ZFSet.mem_irrefl alpha (equal ▸ hxi)) - · exact ⟨old, xi, hxi, entry⟩ - · rintro ⟨member, below⟩ - exact ⟨ZFSet.mem_insert_of_mem _ member, below⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem stageTwoConditions_insert - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {rows I levels stages alpha row A t u w : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) - (function : ZFSet.IsFunc (stageOneAssignments I (d 6)) stages levels) - (level : ZFSet.pair (stageOneAssignment t u w) alpha ∈ levels) - (ground : stageOneAssignment t u w ∈ M.sets) - (member : ZFSet.pair row A ∈ M.stageTwoConditions rows I levels alpha d) - (single : stageOneRawSingle M d t u w (ZFSet.pair row (assignmentCut levels alpha A))) - (old_new : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t v u z w (ZFSet.pair row (assignmentCut levels alpha A))) - (new_old : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t u v w z (ZFSet.pair row (assignmentCut levels alpha A))) - (self : stageOneRawCollision M d t u u w w (ZFSet.pair row (assignmentCut levels alpha A))) : - ZFSet.pair row (insert (stageOneAssignment t u w) A) ∈ - M.stageTwoConditions rows I levels alpha d ∧ - assignmentCut levels alpha (insert (stageOneAssignment t u w) A) = - assignmentCut levels alpha A := by - have cut := assignmentCut_insert_current function level (A := A) - obtain ⟨hrow, hA, subset, small, lower, tests⟩ := - (M.pair_mem_stageTwoConditions rows I levels alpha d row A).1 member - refine ⟨(M.pair_mem_stageTwoConditions rows I levels alpha d row _).2 ?_, cut⟩ - refine ⟨hrow, M.insert_mem pairing unions ground hA, ?_, - M.groundEmbeddable_insert pairing unions powers separation infinite hA ground small, ?_, ?_⟩ - · intro x hx - rcases ZFSet.mem_insert_iff.1 hx with rfl | old - · exact (ZFSet.pair_mem_prod.1 (function.1 level)).1 - · exact subset old - · simpa only [cut] using lower - · simpa only [cut] using stageOneRawTests_insert M d tests single old_new new_old self - -end TransitiveGround - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (small : M.sets.Countable) -variable (C E : L) (U R : (M.nameDomain s).names) -variable (member : (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) ∈ M.niceRefinementIndices a s b d level T T2 valid) -include pairing unions powers separation collection carrier order nodes hT indices system small member - -theorem refinementLevelRawTests_insert_diagonal {A : ZFSet.{u}} (p : P) - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) - (diagonal : ∀ v ∈ T, ∀ z ∈ T, stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) v z ∈ A → v = z) - (u : (M.nameDomain s).names) (term : u.val.val ∈ T) - (active : Name.ForcesMem p u.val U.val) : - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) (s.encode p) := by - have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system - have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices - apply stageOneRawTests_insert M (M.refinementLevelFormulaData a s b d level T T2 valid) (A := A) (lower := s.encode p) (t := (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val)) (u := u.val.val) (w := u.val.val) tests - · have typed := M.stageOneSingleTests_diagonal s pairing unions powers separation collection carrier order hT valid - small a b d base directed system C E U R u term p active - have equiv := single C E U R R u u member p - exact equiv.mpr typed - · intro v hv z hz entry - change v ∈ T at hv - change z ∈ T at hz - have equal := diagonal v hv z hz entry - subst z - let vName : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ - exact (collision C E U R R vName u vName u member p).2 - (M.stageOneCollisionTest_diagonal s pairing unions powers separation collection carrier order hT valid - small R vName u p) - · intro v hv z hz entry - change v ∈ T at hv - change z ∈ T at hz - have equal := diagonal v hv z hz entry - subst z - let vName : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ - exact (collision C E U R R u vName u vName member p).2 - (M.stageOneCollisionTest_diagonal s pairing unions powers separation collection carrier order hT valid - small R u vName p) - · exact (collision C E U R R u u u u member p).2 - (M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid - small R R u u p) - -theorem refinementLevelRawTests_dense_diagonal {A : ZFSet.{u}} (p : P) - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) - (diagonal : ∀ v ∈ T, ∀ z ∈ T, stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) v z ∈ A → v = z) - (nonempty : Forces (M.nameDomain s) (ex (.mem 0 1)) ![U] p) : - DenseBelow p {q | ∃ u : (M.nameDomain s).names, u.val.val ∈ T ∧ - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) (s.encode q)} := by - have familyGround := M.familySet_mem s ⊤ pairing unions powers separation hT - (M.transitive carrier (s.encode_mem ⊤)) valid - have recognized := (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection - carrier order level T T2 valid familyGround C E U R R).1 member - have shape := ((M.name_mem_niceNameCandidates a s T (d.principalFix C) U.val).1 recognized.2.1).2.1 - have active := (forces_nonempty_iff_dense_activeTerms (M.nameDomain s) U T shape p).1 nonempty - intro r below - obtain ⟨q, qr, u, term, forced⟩ := active r below - refine ⟨q, qr, u, term, ?_⟩ - exact M.refinementLevelRawTests_insert_diagonal a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system small C E U R member q - (M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system A tests (qr.trans below)) - diagonal u term forced - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (terms : ∀ g (sigma : Name s), sigma.val ∈ T → (a.act s g sigma).val ∈ T) -variable (small : M.sets.Countable) -include maps terms indices nodes small - -theorem refinementLevelRawTests_insert_visibleLift - (C E : L) (U Rf Rc u w : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) - {A : ZFSet.{u}} (p : P) - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) - (activeU : Name.ForcesMem p u.val U.val) (activeW : Name.ForcesMem p w.val U.val) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - Name.ForcesMem p (cls Rf w).val (vis C).val → - Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula - ![cls Rf w, cls Rc u, map] p → - (∀ (v z : (M.nameDomain s).names), v.val.val ∈ T → z.val.val ∈ T → - stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A → - ∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) → - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) - (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val.val w.val.val) A) (s.encode p) := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - intro visible mapped fresh - have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system - have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection - carrier order hT valid indices - have mixed (v z : (M.nameDomain s).names) (hv : v.val.val ∈ T) (hz : z.val.val ∈ T) - (old : stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A) := - M.refinementVisibleLift_collisions s pairing unions powers separation collection carrier order hT valid - a b d level indices small C E U Rf Rc u v w z (vis C) member p visible mapped - ((single C E U Rf Rc v z member p).1 (tests.1 _ member _ hv _ hz old)).2.2 - (fresh v z hv hz old) - apply stageOneRawTests_insert M (M.refinementLevelFormulaData a s b d level T T2 valid) tests - · exact (single C E U Rf Rc u w member p).2 - (M.stageOneSingleTests_visible_lift s pairing unions powers separation collection carrier order hT valid - a t maps b d base directed terms system level indices small C E U Rf Rc u w member p - activeU activeW visible mapped) - · intro v hv z hz old - let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ - let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ - exact (collision C E U Rf Rc vn u zn w member p).2 (mixed vn zn hv hz old).2.2.1 - · intro v hv z hz old - let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ - let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ - exact (collision C E U Rf Rc u vn w zn member p).2 (mixed vn zn hv hz old).2.1 - · exact (collision C E U Rf Rc u u w w member p).2 - (M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid - small Rf Rc u w p) - -theorem refinementLevelRawTests_dense_visibleLift - (C E : L) (U Rf Rc u : (M.nameDomain s).names) - (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 valid) - {A : ZFSet.{u}} (p : P) - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) - (active : Name.ForcesMem p u.val U.val) : - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, - M.refinementQuotient_mem s pairing unions powers separation collection carrier order - hT valid U.val Rf.val U.property Rf.property⟩ - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - (∀ (v z : (M.nameDomain s).names), v.val.val ∈ T → z.val.val ∈ T → - stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A → - ∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) → - Forces (M.nameDomain s) refinementVisibleLiftFormula ![quotient, vis C, cls Rc u, map] p → - DenseBelow p {q | ∃ w : (M.nameDomain s).names, w.val.val ∈ T ∧ - Name.ForcesMem q u.val U.val ∧ Name.ForcesMem q w.val U.val ∧ - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) - (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val.val w.val.val) A) (s.encode q)} := by - dsimp only - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - intro fresh existsLift r rp - obtain ⟨q, qr, w, hw, activeW, visible, mapped⟩ := - M.refinementVisibleLift_groundTerm_dense s pairing unions powers separation collection carrier order - hT valid small U Rf Rc (vis C) (cls Rc u) p existsLift r rp - have qp := qr.trans rp - have activeU := Name.forcesMem_mono active qp - refine ⟨q, qr, w, hw, activeU, activeW, ?_⟩ - exact M.refinementLevelRawTests_insert_visibleLift a s t b d level pairing unions powers separation - collection carrier order nodes hT valid indices base directed system maps terms small C E U Rf Rc u w - member q - (M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection carrier order - nodes hT valid indices base directed system A tests qp) - activeU activeW visible mapped (fun v z hv hz old k kq => fresh v z hv hz old k (kq.trans qp)) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAbsentLiftRangeCollisions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementRawTestMonotonicity + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (a : PosetAction G P) (t : Presentation G) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (terms : ∀ g (z : Name s), z.val ∈ T → (a.act s g z).val ∈ T) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (level : ZFSet.{u}) +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + +include carrier in +private theorem visibility_forces_upward (small : M.sets.Countable) + (z : (M.nameDomain s).names) (C v : L) (lower : C ≤ v) (p : P) + (visible : Name.ForcesMem p z.val + (M.stageOneVisibilityName s valid a b d base directed system C).val) : + Name.ForcesMem p z.val + (M.stageOneVisibilityName s valid a b d base directed system v).val := by + let vis := M.stageOneVisibilityName s valid a b d base directed system + change Forces (M.nameDomain s) (.mem 0 1) ![z, vis v] p + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + have seen := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) z.property (vis C).property hp visible + exact (M.encode_mem_visibleSupportProfile a s b d T H _ v).1 + (M.visibleSupportProfile_upward a s b d T H _ lower + ((M.encode_mem_visibleSupportProfile a s b d T H _ C).2 seen)) + +include maps terms indices in +theorem refinementVisibleLift_forces_coarse_visibility (small : M.sets.Countable) + (C E : L) (U Rf Rc fine coarse : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (p : P) : + let vis := M.stageOneVisibilityName s valid a b d base directed system + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + Name.ForcesMem p fine.val (vis C).val → + Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![fine, coarse, map] p → + Name.ForcesMem p coarse.val (vis C).val := by + dsimp only + let vis := M.stageOneVisibilityName s valid a b d base directed system + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + intro visible selected + change Forces (M.nameDomain s) (.mem 0 1) ![coarse, vis C] p + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + have seen := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) fine.property (vis C).property hp visible + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + have selectedTruth := forces_sound (M.nameDomain s) H generic + (BoundedFormula.pairMembershipFormula 0 1 2).toFormula ![fine, coarse, map] hp selected + have entry : ZFSet.pair (Name.eval {q | H.mem q} fine.val) + (Name.eval {q | H.mem q} coarse.val) ∈ Name.eval {q | H.mem q} map.val := + (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).1 + ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).1 selectedTruth) + exact M.niceRefinementIndex_preserves_visibility s pairing unions powers separation collection + carrier order a t maps b d base directed hT terms system indices C E U Rf Rc member + le_rfl H generic seen entry + +include maps terms indices in +theorem stageOneSingleTests_visible_lift (small : M.sets.Countable) + (C E : L) (U Rf Rc u w : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ M.niceRefinementIndices a s b d level T T2 valid) + (p : P) (activeU : Name.ForcesMem p u.val U.val) + (activeW : Name.ForcesMem p w.val U.val) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + Name.ForcesMem p (cls Rf w).val (vis C).val → + Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![cls Rf w, cls Rc u, map] p → + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + intro visible selected + have coarseVisible := M.refinementVisibleLift_forces_coarse_visibility s pairing unions powers + separation collection carrier order hT valid a t maps b d base directed terms system level indices + small C E U Rf Rc (cls Rf w) (cls Rc u) member p visible selected + have above := ((indices.typed_entries C E U Rf Rc).1 member).1.le + refine ⟨⟨activeU, activeW⟩, ?_, ?_⟩ + · intro v hv + have fineAbove := visibility_forces_upward M s carrier valid a b d base directed system + small (cls Rf w) C v (above.trans hv) p visible + have coarseAbove := visibility_forces_upward M s carrier valid a b d base directed system + small (cls Rc u) C v (above.trans hv) p coarseVisible + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementProfileFormula _ (fun j => ⟨_, rfl⟩)).2 + have fineSeen := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) (cls Rf w).property (vis v).property hp fineAbove + have coarseSeen := Name.forcesMem_sound (M.nameDomain s) H + (fun D hD dense => generic D (Or.inl hD) dense) (cls Rc u).property (vis v).property hp coarseAbove + exact ⟨fun _ => fineSeen, fun _ => coarseSeen⟩ + · apply (M.ordinaryForces_iff_all_generics s small carrier _ _ p).2 + intro H hp generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive _⟩ + apply (evaluated.realize_refinementCompatibilityFormula _ (fun j => ⟨_, rfl⟩)).2 + intro _ + have selectedTruth := forces_sound (M.nameDomain s) H generic + (BoundedFormula.pairMembershipFormula 0 1 2).toFormula ![cls Rf w, cls Rc u, map] hp selected + exact (BoundedFormula.truth_pairMembershipFormula 0 1 2 _).1 + ((BoundedFormula.realize_toFormula evaluated _ _ (fun j => ⟨_, rfl⟩)).1 selectedTruth) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +universe u + +variable (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) + +theorem stageOneRawTests_insert {A lower t u w : ZFSet.{u}} + (tests : stageOneRawTests M d A lower) + (single : stageOneRawSingle M d t u w lower) + (old_new : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t v u z w lower) + (new_old : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t u v w z lower) + (self : stageOneRawCollision M d t u u w w lower) : + stageOneRawTests M d (insert (stageOneAssignment t u w) A) lower := by + refine ⟨?_, ?_⟩ + · intro i hi v hv z hz entry + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i v z t u w).1 equal + exact single + · exact tests.1 i hi v hv z hz old + · intro i hi v hv v' hv' z hz z' hz' entry entry' + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i v z t u w).1 equal + rcases ZFSet.mem_insert_iff.1 entry' with equal' | old' + · obtain ⟨_, rfl, rfl⟩ := (stageOneAssignment_eq_iff _ _ _ _ _ _).1 equal' + exact self + · exact new_old v' hv' z' hz' old' + · rcases ZFSet.mem_insert_iff.1 entry' with equal' | old' + · obtain ⟨rfl, rfl, rfl⟩ := (stageOneAssignment_eq_iff i v' z' t u w).1 equal' + exact old_new v hv z hz old + · exact tests.2 i hi v hv v' hv' z hz z' hz' old old' + +theorem stageOneRawTests_insert_iff {A lower t u w : ZFSet.{u}} + (index : t ∈ d 0) (first : u ∈ d 6) (second : w ∈ d 6) : + stageOneRawTests M d (insert (stageOneAssignment t u w) A) lower ↔ + stageOneRawTests M d A lower ∧ + stageOneRawSingle M d t u w lower ∧ + (∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t v u z w lower) ∧ + (∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t u v w z lower) ∧ + stageOneRawCollision M d t u u w w lower := by + constructor + · intro tests + have added : stageOneAssignment t u w ∈ insert (stageOneAssignment t u w) A := + ZFSet.mem_insert _ _ + refine ⟨stageOneRawTests_transfer M d lower tests (fun _ _ _ _ _ _ h => + ZFSet.mem_insert_of_mem _ h), tests.1 t index u first w second added, ?_, ?_, ?_⟩ + · intro v hv z hz old + exact tests.2 t index v hv u first z hz w second + (ZFSet.mem_insert_of_mem _ old) added + · intro v hv z hz old + exact tests.2 t index u first v hv w second z hz added + (ZFSet.mem_insert_of_mem _ old) + · exact tests.2 t index u first u first w second w second added added + · rintro ⟨tests, single, old_new, new_old, self⟩ + exact stageOneRawTests_insert M d tests single old_new new_old self + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +theorem assignmentCut_insert_current {J stages levels alpha z A : ZFSet.{u}} + (function : ZFSet.IsFunc J stages levels) + (level : ZFSet.pair z alpha ∈ levels) : + assignmentCut levels alpha (insert z A) = assignmentCut levels alpha A := by + apply ZFSet.ext + intro x + rw [mem_assignmentCut, mem_assignmentCut] + constructor + · rintro ⟨member, xi, hxi, entry⟩ + rcases ZFSet.mem_insert_iff.1 member with rfl | old + · have hz := (ZFSet.pair_mem_prod.1 (function.1 level)).1 + obtain ⟨value, _, unique⟩ := function.2 _ hz + have equal : xi = alpha := (unique xi entry).trans (unique alpha level).symm + exact False.elim (ZFSet.mem_irrefl alpha (equal ▸ hxi)) + · exact ⟨old, xi, hxi, entry⟩ + · rintro ⟨member, below⟩ + exact ⟨ZFSet.mem_insert_of_mem _ member, below⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem stageTwoConditions_insert + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {rows I levels stages alpha row A t u w : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) + (function : ZFSet.IsFunc (stageOneAssignments I (d 6)) stages levels) + (level : ZFSet.pair (stageOneAssignment t u w) alpha ∈ levels) + (ground : stageOneAssignment t u w ∈ M.sets) + (member : ZFSet.pair row A ∈ M.stageTwoConditions rows I levels alpha d) + (single : stageOneRawSingle M d t u w (ZFSet.pair row (assignmentCut levels alpha A))) + (old_new : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t v u z w (ZFSet.pair row (assignmentCut levels alpha A))) + (new_old : ∀ v ∈ d 6, ∀ z ∈ d 6, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t u v w z (ZFSet.pair row (assignmentCut levels alpha A))) + (self : stageOneRawCollision M d t u u w w (ZFSet.pair row (assignmentCut levels alpha A))) : + ZFSet.pair row (insert (stageOneAssignment t u w) A) ∈ + M.stageTwoConditions rows I levels alpha d ∧ + assignmentCut levels alpha (insert (stageOneAssignment t u w) A) = + assignmentCut levels alpha A := by + have cut := assignmentCut_insert_current function level (A := A) + obtain ⟨hrow, hA, subset, small, lower, tests⟩ := + (M.pair_mem_stageTwoConditions rows I levels alpha d row A).1 member + refine ⟨(M.pair_mem_stageTwoConditions rows I levels alpha d row _).2 ?_, cut⟩ + refine ⟨hrow, M.insert_mem pairing unions ground hA, ?_, + M.groundEmbeddable_insert pairing unions powers separation infinite hA ground small, ?_, ?_⟩ + · intro x hx + rcases ZFSet.mem_insert_iff.1 hx with rfl | old + · exact (ZFSet.pair_mem_prod.1 (function.1 level)).1 + · exact subset old + · simpa only [cut] using lower + · simpa only [cut] using stageOneRawTests_insert M d tests single old_new new_old self + +end TransitiveGround + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (small : M.sets.Countable) +variable (C E : L) (U R : (M.nameDomain s).names) +variable (member : (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) ∈ M.niceRefinementIndices a s b d level T T2 valid) +include pairing unions powers separation collection carrier order nodes hT indices system small member + +theorem refinementLevelRawTests_insert_diagonal {A : ZFSet.{u}} (p : P) + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) + (diagonal : ∀ v ∈ T, ∀ z ∈ T, stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) v z ∈ A → v = z) + (u : (M.nameDomain s).names) (term : u.val.val ∈ T) + (active : Name.ForcesMem p u.val U.val) : + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) (s.encode p) := by + have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system + have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices + apply stageOneRawTests_insert M (M.refinementLevelFormulaData a s b d level T T2 valid) (A := A) (lower := s.encode p) (t := (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val)) (u := u.val.val) (w := u.val.val) tests + · have typed := M.stageOneSingleTests_diagonal s pairing unions powers separation collection carrier order hT valid + small a b d base directed system C E U R u term p active + have equiv := single C E U R R u u member p + exact equiv.mpr typed + · intro v hv z hz entry + change v ∈ T at hv + change z ∈ T at hz + have equal := diagonal v hv z hz entry + subst z + let vName : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ + exact (collision C E U R R vName u vName u member p).2 + (M.stageOneCollisionTest_diagonal s pairing unions powers separation collection carrier order hT valid + small R vName u p) + · intro v hv z hz entry + change v ∈ T at hv + change z ∈ T at hz + have equal := diagonal v hv z hz entry + subst z + let vName : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ + exact (collision C E U R R u vName u vName member p).2 + (M.stageOneCollisionTest_diagonal s pairing unions powers separation collection carrier order hT valid + small R u vName p) + · exact (collision C E U R R u u u u member p).2 + (M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid + small R R u u p) + +theorem refinementLevelRawTests_dense_diagonal {A : ZFSet.{u}} (p : P) + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) + (diagonal : ∀ v ∈ T, ∀ z ∈ T, stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) v z ∈ A → v = z) + (nonempty : Forces (M.nameDomain s) (ex (.mem 0 1)) ![U] p) : + DenseBelow p {q | ∃ u : (M.nameDomain s).names, u.val.val ∈ T ∧ + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) U.val.val R.val.val R.val.val) u.val.val u.val.val) A) (s.encode q)} := by + have familyGround := M.familySet_mem s ⊤ pairing unions powers separation hT + (M.transitive carrier (s.encode_mem ⊤)) valid + have recognized := (M.niceRefinementIndex_mem_iff a s b d pairing unions powers separation collection + carrier order level T T2 valid familyGround C E U R R).1 member + have shape := ((M.name_mem_niceNameCandidates a s T (d.principalFix C) U.val).1 recognized.2.1).2.1 + have active := (forces_nonempty_iff_dense_activeTerms (M.nameDomain s) U T shape p).1 nonempty + intro r below + obtain ⟨q, qr, u, term, forced⟩ := active r below + refine ⟨q, qr, u, term, ?_⟩ + exact M.refinementLevelRawTests_insert_diagonal a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system small C E U R member q + (M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system A tests (qr.trans below)) + diagonal u term forced + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (terms : ∀ g (sigma : Name s), sigma.val ∈ T → (a.act s g sigma).val ∈ T) +variable (small : M.sets.Countable) +include maps terms indices nodes small + +theorem refinementLevelRawTests_insert_visibleLift + (C E : L) (U Rf Rc u w : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) + {A : ZFSet.{u}} (p : P) + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) + (activeU : Name.ForcesMem p u.val U.val) (activeW : Name.ForcesMem p w.val U.val) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + Name.ForcesMem p (cls Rf w).val (vis C).val → + Forces (M.nameDomain s) (BoundedFormula.pairMembershipFormula 0 1 2).toFormula + ![cls Rf w, cls Rc u, map] p → + (∀ (v z : (M.nameDomain s).names), v.val.val ∈ T → z.val.val ∈ T → + stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A → + ∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) → + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) + (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val.val w.val.val) A) (s.encode p) := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + intro visible mapped fresh + have single := M.refinementLevelRawSingle_iff a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system + have collision := M.refinementLevelRawCollision_iff a s b d level pairing unions powers separation collection + carrier order hT valid indices + have mixed (v z : (M.nameDomain s).names) (hv : v.val.val ∈ T) (hz : z.val.val ∈ T) + (old : stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A) := + M.refinementVisibleLift_collisions s pairing unions powers separation collection carrier order hT valid + a b d level indices small C E U Rf Rc u v w z (vis C) member p visible mapped + ((single C E U Rf Rc v z member p).1 (tests.1 _ member _ hv _ hz old)).2.2 + (fresh v z hv hz old) + apply stageOneRawTests_insert M (M.refinementLevelFormulaData a s b d level T T2 valid) tests + · exact (single C E U Rf Rc u w member p).2 + (M.stageOneSingleTests_visible_lift s pairing unions powers separation collection carrier order hT valid + a t maps b d base directed terms system level indices small C E U Rf Rc u w member p + activeU activeW visible mapped) + · intro v hv z hz old + let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ + let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ + exact (collision C E U Rf Rc vn u zn w member p).2 (mixed vn zn hv hz old).2.2.1 + · intro v hv z hz old + let vn : (M.nameDomain s).names := ⟨⟨v, valid v hv⟩, M.transitive hT hv⟩ + let zn : (M.nameDomain s).names := ⟨⟨z, valid z hz⟩, M.transitive hT hz⟩ + exact (collision C E U Rf Rc u vn w zn member p).2 (mixed vn zn hv hz old).2.1 + · exact (collision C E U Rf Rc u u w w member p).2 + (M.stageOneCollisionTest_self s pairing unions powers separation collection carrier order hT valid + small Rf Rc u w p) + +theorem refinementLevelRawTests_dense_visibleLift + (C E : L) (U Rf Rc u : (M.nameDomain s).names) + (member : refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 valid) + {A : ZFSet.{u}} (p : P) + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) + (active : Name.ForcesMem p u.val U.val) : + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + let quotient : (M.nameDomain s).names := ⟨Name.refinementQuotient T valid U.val Rf.val, + M.refinementQuotient_mem s pairing unions powers separation collection carrier order + hT valid U.val Rf.val U.property Rf.property⟩ + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + (∀ (v z : (M.nameDomain s).names), v.val.val ∈ T → z.val.val ∈ T → + stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) v.val.val z.val.val ∈ A → + ∀ q, q ≤ p → ¬ Name.ForcesEq q (cls Rc u).val (cls Rc v).val) → + Forces (M.nameDomain s) refinementVisibleLiftFormula ![quotient, vis C, cls Rc u, map] p → + DenseBelow p {q | ∃ w : (M.nameDomain s).names, w.val.val ∈ T ∧ + Name.ForcesMem q u.val U.val ∧ Name.ForcesMem q w.val U.val ∧ + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) + (insert (stageOneAssignment (refinementIndexCode level (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val.val w.val.val) A) (s.encode q)} := by + dsimp only + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + intro fresh existsLift r rp + obtain ⟨q, qr, w, hw, activeW, visible, mapped⟩ := + M.refinementVisibleLift_groundTerm_dense s pairing unions powers separation collection carrier order + hT valid small U Rf Rc (vis C) (cls Rc u) p existsLift r rp + have qp := qr.trans rp + have activeU := Name.forcesMem_mono active qp + refine ⟨q, qr, w, hw, activeU, activeW, ?_⟩ + exact M.refinementLevelRawTests_insert_visibleLift a s t b d level pairing unions powers separation + collection carrier order nodes hT valid indices base directed system maps terms small C E U Rf Rc u w + member q + (M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection carrier order + nodes hT valid indices base directed system A tests qp) + activeU activeW visible mapped (fun v z hv hz old k kq => fresh v z hv hz old k (kq.trans qp)) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRepresentativeIndexSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRepresentativeIndexSteps.lean index fc14fe96ec416fa9084693d2d5fa424dcc10c712..b5305b071bd5a7315b71c71fe471bfa05a48a866 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRepresentativeIndexSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRepresentativeIndexSteps.lean @@ -1,74 +1,74 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem assignmentQueriesWithin_mem (separation : SeparationSchema M.sets) - {Q X T : ZFSet.{u}} (hQ : Q ∈ M.sets) (hX : X ∈ M.sets) (hT : T ∈ M.sets) : - assignmentQueriesWithin Q X T ∈ M.sets := by - have selected := M.bounded_separation_mem separation - (BoundedFormula.assignmentQueryWithinFormula 1 2 0) (extend X (extend T Fin.elim0)) - (Fin.cases hX (Fin.cases hT (fun i => Fin.elim0 i))) hQ - simpa only [BoundedFormula.truth_assignmentQueryWithinFormula, assignmentQueriesWithin, extend, - show (1 : Fin 3) = Fin.succ 0 from rfl, - show (2 : Fin 3) = Fin.succ (Fin.succ 0) from rfl, Fin.cases_zero, Fin.cases_succ] using selected - -theorem representativeIndexAdditions_mem (separation : SeparationSchema M.sets) - {I T Q c X : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (hQ : Q ∈ M.sets) (hc : c ∈ M.sets) (hX : X ∈ M.sets) : - representativeIndexAdditions I T Q c X ∈ M.sets := by - let params := extend I (extend T (extend Q (extend c (extend X Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.representativeIndexAdditionsMemberFormula 0 1 2 3 4 5) params - (Fin.cases hI (Fin.cases hT (Fin.cases hQ (Fin.cases hc - (Fin.cases hX (fun i => Fin.elim0 i)))))) hI - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.representativeIndexAdditionsMemberFormula 0 1 2 3 4 5) - (extend z params)) I = representativeIndexAdditions I T Q c X := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_representativeIndexAdditionsMemberFormula] - change (z ∈ I ∧ z ∈ representativeIndexAdditions I T Q c X) ↔ _ - exact ⟨And.right, fun h => - ⟨((mem_representativeIndexAdditions I T Q c X z).1 h).1, h⟩⟩ - exact equal ▸ selected - -theorem representativeIndexStep_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - {I T Q c X : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (hQ : Q ∈ M.sets) (hc : c ∈ M.sets) (hX : X ∈ M.sets) : - representativeIndexStep I T Q c X ∈ M.sets := - M.binary_union_mem pairing unions hX - (M.representativeIndexAdditions_mem separation hI hT hQ hc hX) - -noncomputable def definable_representativeIndexStep - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => - representativeIndexStep (env 1) (env 2) (env 3) (env 4) (env 0)) where - formula := exactSetFormula 0 (disj (.mem 0 2) - (BoundedFormula.representativeIndexAdditionsMemberFormula 0 3 4 5 6 2).toFormula) - closed := fun _ members => M.representativeIndexStep_mem pairing unions separation - (members 1) (members 2) (members 3) (members 4) (members 0) - correct := by - intro env members z hz - apply M.realize_exactSetFormula 0 _ (extend z env) hz - (fun _ h => M.transitive (M.representativeIndexStep_mem pairing unions separation - (members 1) (members 2) (members 3) (members 4) (members 0)) h) - intro w hw - rw [realize_disj, BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz members)), - BoundedFormula.truth_representativeIndexAdditionsMemberFormula] - exact ZFSet.mem_union.symm - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem assignmentQueriesWithin_mem (separation : SeparationSchema M.sets) + {Q X T : ZFSet.{u}} (hQ : Q ∈ M.sets) (hX : X ∈ M.sets) (hT : T ∈ M.sets) : + assignmentQueriesWithin Q X T ∈ M.sets := by + have selected := M.bounded_separation_mem separation + (BoundedFormula.assignmentQueryWithinFormula 1 2 0) (extend X (extend T Fin.elim0)) + (Fin.cases hX (Fin.cases hT (fun i => Fin.elim0 i))) hQ + simpa only [BoundedFormula.truth_assignmentQueryWithinFormula, assignmentQueriesWithin, extend, + show (1 : Fin 3) = Fin.succ 0 from rfl, + show (2 : Fin 3) = Fin.succ (Fin.succ 0) from rfl, Fin.cases_zero, Fin.cases_succ] using selected + +theorem representativeIndexAdditions_mem (separation : SeparationSchema M.sets) + {I T Q c X : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (hQ : Q ∈ M.sets) (hc : c ∈ M.sets) (hX : X ∈ M.sets) : + representativeIndexAdditions I T Q c X ∈ M.sets := by + let params := extend I (extend T (extend Q (extend c (extend X Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.representativeIndexAdditionsMemberFormula 0 1 2 3 4 5) params + (Fin.cases hI (Fin.cases hT (Fin.cases hQ (Fin.cases hc + (Fin.cases hX (fun i => Fin.elim0 i)))))) hI + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.representativeIndexAdditionsMemberFormula 0 1 2 3 4 5) + (extend z params)) I = representativeIndexAdditions I T Q c X := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_representativeIndexAdditionsMemberFormula] + change (z ∈ I ∧ z ∈ representativeIndexAdditions I T Q c X) ↔ _ + exact ⟨And.right, fun h => + ⟨((mem_representativeIndexAdditions I T Q c X z).1 h).1, h⟩⟩ + exact equal ▸ selected + +theorem representativeIndexStep_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + {I T Q c X : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (hQ : Q ∈ M.sets) (hc : c ∈ M.sets) (hX : X ∈ M.sets) : + representativeIndexStep I T Q c X ∈ M.sets := + M.binary_union_mem pairing unions hX + (M.representativeIndexAdditions_mem separation hI hT hQ hc hX) + +noncomputable def definable_representativeIndexStep + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 5 → ZFSet.{u} => + representativeIndexStep (env 1) (env 2) (env 3) (env 4) (env 0)) where + formula := exactSetFormula 0 (disj (.mem 0 2) + (BoundedFormula.representativeIndexAdditionsMemberFormula 0 3 4 5 6 2).toFormula) + closed := fun _ members => M.representativeIndexStep_mem pairing unions separation + (members 1) (members 2) (members 3) (members 4) (members 0) + correct := by + intro env members z hz + apply M.realize_exactSetFormula 0 _ (extend z env) hz + (fun _ h => M.transitive (M.representativeIndexStep_mem pairing unions separation + (members 1) (members 2) (members 3) (members 4) (members 0)) h) + intro w hw + rw [realize_disj, BoundedFormula.realize_toFormula M _ _ (Fin.cases hw (Fin.cases hz members)), + BoundedFormula.truth_representativeIndexAdditionsMemberFormula] + exact ZFSet.mem_union.symm + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedCompressionTiles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedCompressionTiles.lean index 38afbe27e118005a2619917d171e3e99c398c644..589ea306c3309ae33a30c6f0ca97b025a59d7e8c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedCompressionTiles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedCompressionTiles.lean @@ -1,180 +1,180 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open Compression Compression.RecursiveMaps SetFormula -universe u -variable {P r μ f : ZFSet.{u}} - -noncomputable def compressionTileIso (old : MeetOrderCode P r μ) - (embedding : MeetEmbeddingCode P P r r μ μ f) (K : {x : ZFSet.{u} // x ∈ P}) - (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : - MeetIso old.toMeetOrder (Attachment.idealOrder old.toMeetOrder K) := by - apply isoOntoIdeal old.toMeetOrder (embedding.toMeetEmbedding old old) K - · intro x - exact ((range _).1 ⟨x.val, x.property, embedding.value_entry x⟩).2 - · intro z hz - obtain ⟨x, hx, entry⟩ := (range z.val).2 ⟨z.property, hz⟩ - exact ⟨⟨x, hx⟩, (embedding.toMeetEmbedding_eq_iff old old ⟨x, hx⟩ z).2 entry⟩ - -theorem compressionTileCoding (old : MeetOrderCode P r μ) - (embedding : MeetEmbeddingCode P P r r μ μ f) - (T K : {x : ZFSet.{u} // x ∈ P}) (top : ∀ x, old.toMeetOrder.le x T) - (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : - CodedPrincipalTile old old - (BinaryTiles.compression old.toMeetOrder T K top (compressionTileIso old embedding K range)) f where - base_function := by - have ideal : attachmentIdeal P r T.val = P := by - apply ZFSet.ext - intro x - rw [mem_attachmentIdeal] - exact ⟨And.left, fun hx => ⟨hx, top ⟨x, hx⟩⟩⟩ - change ZFSet.IsFunc (attachmentIdeal P r T.val) P f - rw [ideal] - exact embedding.injection.function - base_entry x := embedding.value_entry x.val - -theorem freshPart_of_top {T : ZFSet.{u}} (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) : - freshPart P r T = ∅ := by - apply ZFSet.ext - intro x - rw [mem_freshPart] - exact ⟨fun h => False.elim (h.2 (top x h.1)), fun h => False.elim (ZFSet.notMem_empty x h)⟩ - -theorem singleAttachmentOrder_empty (old : PartialOrderCode P r) (shadow : ZFSet.{u}) : - singleAttachmentOrder P ∅ r r shadow ∅ = r := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (singleAttachmentOrder_shape _ _ _ _ _ _ hz) - have cases := ((pair_mem_singleAttachmentOrder _ _ _ _ _ _ _ _).1 hz).2.2 - rcases cases with h | h | h | h - · exact h.2.2 - · obtain ⟨_, q, hq, _⟩ := h - exact False.elim (ZFSet.notMem_empty q hq) - · exact False.elim (ZFSet.notMem_empty y h.2) - · obtain ⟨q, hq, _⟩ := h - exact False.elim (ZFSet.notMem_empty q hq) - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (old.relation hz) - exact (pair_mem_singleAttachmentOrder _ _ _ _ _ _ _ _).2 - ⟨old_mem_taggedExtension hx, old_mem_taggedExtension hy, Or.inl ⟨hx, hy, hz⟩⟩ - -theorem compressionTile_exact_codes (old : MeetOrderCode P r μ) - (embedding : MeetEmbeddingCode P P r r μ μ f) - (T K : {x : ZFSet.{u} // x ∈ P}) (top : ∀ x, old.toMeetOrder.le x T) - (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : - let d := compressionTileCoding old embedding T K top range - d.carrier = P ∧ d.order = r ∧ d.meetGraph = μ ∧ - attachmentTemplateEmbeddingGraph P P r f T.val = f := by - have empty := freshPart_of_top (fun x hx => top ⟨x, hx⟩) - have carrier : taggedExtension P (freshPart P r T.val) = P := by - rw [empty] - apply ZFSet.ext - intro x - rw [mem_taggedExtension] - exact ⟨fun h => h.elim id (fun ⟨q, hq, _⟩ => False.elim (ZFSet.notMem_empty q hq)), Or.inl⟩ - have order : singleAttachmentOrder P (freshPart P r T.val) r r - (attachmentShadowGraph P P μ f T.val) ∅ = r := by - rw [empty] - exact singleAttachmentOrder_empty old.order _ - refine ⟨carrier, order, ?_, ?_⟩ - · change canonicalMeetGraph (taggedExtension P (freshPart P r T.val)) - (singleAttachmentOrder P (freshPart P r T.val) r r (attachmentShadowGraph P P μ f T.val) ∅) = μ - rw [carrier, order] - exact old.eq_canonicalMeetGraph.symm - · apply ZFSet.ext - intro z - rw [mem_attachmentTemplateEmbeddingGraph, empty] - exact ⟨fun h => h.elim id (fun ⟨q, hq, _⟩ => False.elim (ZFSet.notMem_empty q hq)), Or.inl⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem compressionTile_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (old : MeetOrderCode P r μ) (embedding : MeetEmbeddingCode P P r r μ μ f) - (T K : {x : ZFSet.{u} // x ∈ P}) (top : ∀ x, old.toMeetOrder.le x T) - (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hf : f ∈ M.sets) : - let d := compressionTileCoding old embedding T K top range - d.carrier ∈ M.sets ∧ d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets ∧ - attachmentTemplateEmbeddingGraph P P r f T.val ∈ M.sets := - (compressionTileCoding old embedding T K top range).ground_codes M - pairing unions powers separation hP hP hr hr hμ hf - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionCompletion -open Compression Compression.RecursiveMaps SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - -theorem requested_compression_map {i f k : ZFSet.{u}} - (map : ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps) - (cap : ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps) : - f ∈ M.sets ∧ k ∈ completion.algebra.union.fields 0 ∧ - MeetEmbeddingCode (completion.algebra.union.fields 0) (completion.algebra.union.fields 0) - (completion.algebra.union.fields 1) (completion.algebra.union.fields 1) - (completion.algebra.union.fields 2) (completion.algebra.union.fields 2) f ∧ - ∀ x, (∃ y ∈ completion.algebra.union.fields 0, ZFSet.pair y x ∈ f) ↔ - x ∈ completion.algebra.union.fields 0 ∧ ZFSet.pair x k ∈ completion.algebra.union.fields 1 := by - have entry := ((completion.external_fields_entries i f k).1).1 map - have capEntry := ((completion.external_fields_entries i f k).2).1 cap - have hPair := M.transitive completion.algebra.ground entry - have hf := M.transitive (M.transitive hPair (ZFSet.mem_pair.2 (Or.inr rfl))) - (ZFSet.mem_pair.2 (Or.inr rfl)) - exact ⟨hf, (ZFSet.pair_mem_prod.1 (completion.caps_function.1 capEntry)).2, - completion.external_fields_range map cap⟩ - -theorem requested_compression_tile - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {i f k : ZFSet.{u}} - (map : ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps) - (cap : ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps) : - let U := completion.algebra.union.fields 0 - let order := completion.algebra.union.meet.toMeetOrder - ∃ hk : k ∈ U, ∃ iso : MeetIso order (Attachment.idealOrder order ⟨k, hk⟩), - ∃ d : CodedPrincipalTile completion.algebra.union.meet completion.algebra.union.meet - (BinaryTiles.compression order ⟨τ, completion.top_mem⟩ ⟨k, hk⟩ - (fun x => completion.top x.val x.property) iso) f, - d.carrier = U ∧ d.order = completion.algebra.union.fields 1 ∧ - d.meetGraph = completion.algebra.union.fields 2 ∧ - attachmentTemplateEmbeddingGraph U U (completion.algebra.union.fields 1) f τ = f ∧ - d.carrier ∈ M.sets ∧ d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ - attachmentOldEmbeddingGraph U ∈ M.sets ∧ f ∈ M.sets := by - dsimp only - obtain ⟨hf, hk, embedding, range⟩ := completion.requested_compression_map map cap - let topPoint : {x : ZFSet.{u} // x ∈ completion.algebra.union.fields 0} := ⟨τ, completion.top_mem⟩ - let capPoint : {x : ZFSet.{u} // x ∈ completion.algebra.union.fields 0} := ⟨k, hk⟩ - have top : ∀ x, completion.algebra.union.meet.toMeetOrder.le x topPoint := - fun x => completion.top x.val x.property - let iso := compressionTileIso completion.algebra.union.meet embedding capPoint range - let d := compressionTileCoding completion.algebra.union.meet embedding topPoint capPoint top range - have exactCodes := compressionTile_exact_codes completion.algebra.union.meet embedding topPoint capPoint top range - have grounds := M.compressionTile_ground pairing unions powers separation completion.algebra.union.meet - embedding topPoint capPoint top range (completion.algebra.union.ground 0) - (completion.algebra.union.ground 1) (completion.algebra.union.ground 2) hf - exact ⟨hk, iso, d, exactCodes.1, exactCodes.2.1, exactCodes.2.2.1, exactCodes.2.2.2, - grounds.1, grounds.2.1, grounds.2.2.1, grounds.2.2.2.1, hf⟩ - -end PartitionPilot.Forcing.GroundCompressionCompletion - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open Compression Compression.RecursiveMaps SetFormula +universe u +variable {P r μ f : ZFSet.{u}} + +noncomputable def compressionTileIso (old : MeetOrderCode P r μ) + (embedding : MeetEmbeddingCode P P r r μ μ f) (K : {x : ZFSet.{u} // x ∈ P}) + (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : + MeetIso old.toMeetOrder (Attachment.idealOrder old.toMeetOrder K) := by + apply isoOntoIdeal old.toMeetOrder (embedding.toMeetEmbedding old old) K + · intro x + exact ((range _).1 ⟨x.val, x.property, embedding.value_entry x⟩).2 + · intro z hz + obtain ⟨x, hx, entry⟩ := (range z.val).2 ⟨z.property, hz⟩ + exact ⟨⟨x, hx⟩, (embedding.toMeetEmbedding_eq_iff old old ⟨x, hx⟩ z).2 entry⟩ + +theorem compressionTileCoding (old : MeetOrderCode P r μ) + (embedding : MeetEmbeddingCode P P r r μ μ f) + (T K : {x : ZFSet.{u} // x ∈ P}) (top : ∀ x, old.toMeetOrder.le x T) + (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : + CodedPrincipalTile old old + (BinaryTiles.compression old.toMeetOrder T K top (compressionTileIso old embedding K range)) f where + base_function := by + have ideal : attachmentIdeal P r T.val = P := by + apply ZFSet.ext + intro x + rw [mem_attachmentIdeal] + exact ⟨And.left, fun hx => ⟨hx, top ⟨x, hx⟩⟩⟩ + change ZFSet.IsFunc (attachmentIdeal P r T.val) P f + rw [ideal] + exact embedding.injection.function + base_entry x := embedding.value_entry x.val + +theorem freshPart_of_top {T : ZFSet.{u}} (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) : + freshPart P r T = ∅ := by + apply ZFSet.ext + intro x + rw [mem_freshPart] + exact ⟨fun h => False.elim (h.2 (top x h.1)), fun h => False.elim (ZFSet.notMem_empty x h)⟩ + +theorem singleAttachmentOrder_empty (old : PartialOrderCode P r) (shadow : ZFSet.{u}) : + singleAttachmentOrder P ∅ r r shadow ∅ = r := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (singleAttachmentOrder_shape _ _ _ _ _ _ hz) + have cases := ((pair_mem_singleAttachmentOrder _ _ _ _ _ _ _ _).1 hz).2.2 + rcases cases with h | h | h | h + · exact h.2.2 + · obtain ⟨_, q, hq, _⟩ := h + exact False.elim (ZFSet.notMem_empty q hq) + · exact False.elim (ZFSet.notMem_empty y h.2) + · obtain ⟨q, hq, _⟩ := h + exact False.elim (ZFSet.notMem_empty q hq) + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (old.relation hz) + exact (pair_mem_singleAttachmentOrder _ _ _ _ _ _ _ _).2 + ⟨old_mem_taggedExtension hx, old_mem_taggedExtension hy, Or.inl ⟨hx, hy, hz⟩⟩ + +theorem compressionTile_exact_codes (old : MeetOrderCode P r μ) + (embedding : MeetEmbeddingCode P P r r μ μ f) + (T K : {x : ZFSet.{u} // x ∈ P}) (top : ∀ x, old.toMeetOrder.le x T) + (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) : + let d := compressionTileCoding old embedding T K top range + d.carrier = P ∧ d.order = r ∧ d.meetGraph = μ ∧ + attachmentTemplateEmbeddingGraph P P r f T.val = f := by + have empty := freshPart_of_top (fun x hx => top ⟨x, hx⟩) + have carrier : taggedExtension P (freshPart P r T.val) = P := by + rw [empty] + apply ZFSet.ext + intro x + rw [mem_taggedExtension] + exact ⟨fun h => h.elim id (fun ⟨q, hq, _⟩ => False.elim (ZFSet.notMem_empty q hq)), Or.inl⟩ + have order : singleAttachmentOrder P (freshPart P r T.val) r r + (attachmentShadowGraph P P μ f T.val) ∅ = r := by + rw [empty] + exact singleAttachmentOrder_empty old.order _ + refine ⟨carrier, order, ?_, ?_⟩ + · change canonicalMeetGraph (taggedExtension P (freshPart P r T.val)) + (singleAttachmentOrder P (freshPart P r T.val) r r (attachmentShadowGraph P P μ f T.val) ∅) = μ + rw [carrier, order] + exact old.eq_canonicalMeetGraph.symm + · apply ZFSet.ext + intro z + rw [mem_attachmentTemplateEmbeddingGraph, empty] + exact ⟨fun h => h.elim id (fun ⟨q, hq, _⟩ => False.elim (ZFSet.notMem_empty q hq)), Or.inl⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem compressionTile_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (old : MeetOrderCode P r μ) (embedding : MeetEmbeddingCode P P r r μ μ f) + (T K : {x : ZFSet.{u} // x ∈ P}) (top : ∀ x, old.toMeetOrder.le x T) + (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ z ∈ P ∧ ZFSet.pair z K.val ∈ r) + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hf : f ∈ M.sets) : + let d := compressionTileCoding old embedding T K top range + d.carrier ∈ M.sets ∧ d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets ∧ + attachmentTemplateEmbeddingGraph P P r f T.val ∈ M.sets := + (compressionTileCoding old embedding T K top range).ground_codes M + pairing unions powers separation hP hP hr hr hμ hf + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionCompletion +open Compression Compression.RecursiveMaps SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + +theorem requested_compression_map {i f k : ZFSet.{u}} + (map : ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps) + (cap : ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps) : + f ∈ M.sets ∧ k ∈ completion.algebra.union.fields 0 ∧ + MeetEmbeddingCode (completion.algebra.union.fields 0) (completion.algebra.union.fields 0) + (completion.algebra.union.fields 1) (completion.algebra.union.fields 1) + (completion.algebra.union.fields 2) (completion.algebra.union.fields 2) f ∧ + ∀ x, (∃ y ∈ completion.algebra.union.fields 0, ZFSet.pair y x ∈ f) ↔ + x ∈ completion.algebra.union.fields 0 ∧ ZFSet.pair x k ∈ completion.algebra.union.fields 1 := by + have entry := ((completion.external_fields_entries i f k).1).1 map + have capEntry := ((completion.external_fields_entries i f k).2).1 cap + have hPair := M.transitive completion.algebra.ground entry + have hf := M.transitive (M.transitive hPair (ZFSet.mem_pair.2 (Or.inr rfl))) + (ZFSet.mem_pair.2 (Or.inr rfl)) + exact ⟨hf, (ZFSet.pair_mem_prod.1 (completion.caps_function.1 capEntry)).2, + completion.external_fields_range map cap⟩ + +theorem requested_compression_tile + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {i f k : ZFSet.{u}} + (map : ZFSet.pair (ZFSet.pair (natSetCode 0) i) f ∈ completion.externalMaps) + (cap : ZFSet.pair (ZFSet.pair (natSetCode 0) i) k ∈ completion.externalCaps) : + let U := completion.algebra.union.fields 0 + let order := completion.algebra.union.meet.toMeetOrder + ∃ hk : k ∈ U, ∃ iso : MeetIso order (Attachment.idealOrder order ⟨k, hk⟩), + ∃ d : CodedPrincipalTile completion.algebra.union.meet completion.algebra.union.meet + (BinaryTiles.compression order ⟨τ, completion.top_mem⟩ ⟨k, hk⟩ + (fun x => completion.top x.val x.property) iso) f, + d.carrier = U ∧ d.order = completion.algebra.union.fields 1 ∧ + d.meetGraph = completion.algebra.union.fields 2 ∧ + attachmentTemplateEmbeddingGraph U U (completion.algebra.union.fields 1) f τ = f ∧ + d.carrier ∈ M.sets ∧ d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ + attachmentOldEmbeddingGraph U ∈ M.sets ∧ f ∈ M.sets := by + dsimp only + obtain ⟨hf, hk, embedding, range⟩ := completion.requested_compression_map map cap + let topPoint : {x : ZFSet.{u} // x ∈ completion.algebra.union.fields 0} := ⟨τ, completion.top_mem⟩ + let capPoint : {x : ZFSet.{u} // x ∈ completion.algebra.union.fields 0} := ⟨k, hk⟩ + have top : ∀ x, completion.algebra.union.meet.toMeetOrder.le x topPoint := + fun x => completion.top x.val x.property + let iso := compressionTileIso completion.algebra.union.meet embedding capPoint range + let d := compressionTileCoding completion.algebra.union.meet embedding topPoint capPoint top range + have exactCodes := compressionTile_exact_codes completion.algebra.union.meet embedding topPoint capPoint top range + have grounds := M.compressionTile_ground pairing unions powers separation completion.algebra.union.meet + embedding topPoint capPoint top range (completion.algebra.union.ground 0) + (completion.algebra.union.ground 1) (completion.algebra.union.ground 2) hf + exact ⟨hk, iso, d, exactCodes.1, exactCodes.2.1, exactCodes.2.2.1, exactCodes.2.2.2, + grounds.1, grounds.2.1, grounds.2.2.1, grounds.2.2.2.1, hf⟩ + +end PartitionPilot.Forcing.GroundCompressionCompletion + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedRectangleHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedRectangleHeights.lean index fb89a7d1c0a1472b3e44e95cced7c5838b6a2a50..ddcbaec6ad96085cf7dd499ac07fd207d4a79eb0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedRectangleHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRequestedRectangleHeights.lean @@ -1,763 +1,763 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCodedBinaryHeights - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -noncomputable def rectangleLabelCarrier (P : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod (natSetCode 3) P - -def rectangleOverlapRel (r C B e1 e2 i j x y : ZFSet.{u}) : Prop := - (i = j ∧ x = y) ∨ - (i = natSetCode 1 ∧ j = natSetCode 0 ∧ ZFSet.pair x C ∈ r ∧ ZFSet.pair x y ∈ e1) ∨ - (i = natSetCode 0 ∧ j = natSetCode 1 ∧ ZFSet.pair y C ∈ r ∧ ZFSet.pair y x ∈ e1) ∨ - (i = natSetCode 2 ∧ j = natSetCode 0 ∧ ZFSet.pair x C ∈ r ∧ ZFSet.pair x y ∈ e2) ∨ - (i = natSetCode 0 ∧ j = natSetCode 2 ∧ ZFSet.pair y C ∈ r ∧ ZFSet.pair y x ∈ e2) ∨ - ((i = natSetCode 1 ∧ j = natSetCode 2 ∨ i = natSetCode 2 ∧ j = natSetCode 1) ∧ - ZFSet.pair x B ∈ r ∧ x = y) - -noncomputable def rectangleOverlapGraph (P r C B e1 e2 : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ natSetCode 3, ∃ j ∈ natSetCode 3, ∃ x ∈ P, ∃ y ∈ P, - z = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ rectangleOverlapRel r C B e1 e2 i j x y) - (ZFSet.prod (rectangleLabelCarrier P) (rectangleLabelCarrier P)) - -theorem mem_rectangleOverlapGraph (P r C B e1 e2 z : ZFSet.{u}) : - z ∈ rectangleOverlapGraph P r C B e1 e2 ↔ - ∃ i ∈ natSetCode 3, ∃ j ∈ natSetCode 3, ∃ x ∈ P, ∃ y ∈ P, - z = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ rectangleOverlapRel r C B e1 e2 i j x y := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · rintro ⟨i, hi, j, hj, x, hx, y, hy, rfl, rel⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 - ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, ZFSet.pair_mem_prod.2 ⟨hj, hy⟩⟩, - i, hi, j, hj, x, hx, y, hy, rfl, rel⟩ - -theorem pair_mem_rectangleOverlapGraph (P r C B e1 e2 i j x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∈ rectangleOverlapGraph P r C B e1 e2 ↔ - i ∈ natSetCode 3 ∧ j ∈ natSetCode 3 ∧ x ∈ P ∧ y ∈ P ∧ rectangleOverlapRel r C B e1 e2 i j x y := by - rw [mem_rectangleOverlapGraph] - constructor - · rintro ⟨a, ha, b, hb, c, hc, d, hd, eq, rel⟩ - obtain ⟨first, second⟩ := ZFSet.pair_inj.1 eq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second - exact ⟨ha, hb, hc, hd, rel⟩ - · rintro ⟨hi, hj, hx, hy, rel⟩ - exact ⟨i, hi, j, hj, x, hx, y, hy, rfl, rel⟩ - -theorem rectangleOverlapGraph_subset (P r C B e1 e2 : ZFSet.{u}) : - rectangleOverlapGraph P r C B e1 e2 ⊆ - ZFSet.prod (rectangleLabelCarrier P) (rectangleLabelCarrier P) := - fun _ h => (ZFSet.mem_sep.1 h).1 - -namespace BoundedFormula - -def localRectangleOverlapFormula {n} (r C B e1 e2 i j x y zero one two : Fin n) : BoundedFormula n := - disj (.conj (.equal i j) (.equal x y)) - (disj (.conj (.equal i one) (.conj (.equal j zero) - (.conj (pairMembershipFormula x C r) (pairMembershipFormula x y e1)))) - (disj (.conj (.equal i zero) (.conj (.equal j one) - (.conj (pairMembershipFormula y C r) (pairMembershipFormula y x e1)))) - (disj (.conj (.equal i two) (.conj (.equal j zero) - (.conj (pairMembershipFormula x C r) (pairMembershipFormula x y e2)))) - (disj (.conj (.equal i zero) (.conj (.equal j two) - (.conj (pairMembershipFormula y C r) (pairMembershipFormula y x e2)))) - (.conj (disj (.conj (.equal i one) (.equal j two)) (.conj (.equal i two) (.equal j one))) - (.conj (pairMembershipFormula x B r) (.equal x y))))))) - -theorem truth_localRectangleOverlapFormula {n} (r C B e1 e2 i j x y zero one two : Fin n) - (env : Fin n → ZFSet.{u}) (h0 : env zero = natSetCode 0) - (h1 : env one = natSetCode 1) (h2 : env two = natSetCode 2) : - Truth (localRectangleOverlapFormula r C B e1 e2 i j x y zero one two) env ↔ - rectangleOverlapRel (env r) (env C) (env B) (env e1) (env e2) (env i) (env j) (env x) (env y) := by - simp only [localRectangleOverlapFormula, truth_disj, Truth, truth_pairMembershipFormula, h0, h1, h2] - rfl - -def rectangleOverlapEntryFormula {n} (z P r C B e1 e2 zero one two three : Fin n) : BoundedFormula n := - exMem three (exMem three.succ (exMem P.succ.succ (exMem P.succ.succ.succ - (.conj (pairOfPairsFormula z.succ.succ.succ.succ 3 1 2 0) - (localRectangleOverlapFormula r.succ.succ.succ.succ C.succ.succ.succ.succ B.succ.succ.succ.succ - e1.succ.succ.succ.succ e2.succ.succ.succ.succ 3 2 1 0 - zero.succ.succ.succ.succ one.succ.succ.succ.succ two.succ.succ.succ.succ))))) - -theorem truth_rectangleOverlapEntryFormula {n} (z P r C B e1 e2 zero one two three : Fin n) - (env : Fin n → ZFSet.{u}) (h0 : env zero = natSetCode 0) - (h1 : env one = natSetCode 1) (h2 : env two = natSetCode 2) (h3 : env three = natSetCode 3) : - Truth (rectangleOverlapEntryFormula z P r C B e1 e2 zero one two three) env ↔ - env z ∈ rectangleOverlapGraph (env P) (env r) (env C) (env B) (env e1) (env e2) := by - simp only [rectangleOverlapEntryFormula, truth_exMem, Truth, truth_pairOfPairsFormula, - mem_rectangleOverlapGraph, extend, Fin.cases_succ, Fin.cases_zero, h3] - apply exists_congr - intro i - apply and_congr_right - intro _ - apply exists_congr - intro j - apply and_congr_right - intro _ - apply exists_congr - intro x - apply and_congr_right - intro _ - apply exists_congr - intro y - apply and_congr_right - intro _ - exact and_congr Iff.rfl (truth_localRectangleOverlapFormula _ _ _ _ _ _ _ _ _ _ _ _ _ h0 h1 h2) -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem rectangleOverlapGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r C B e1 e2 : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) - (hE1 : e1 ∈ M.sets) (hE2 : e2 ∈ M.sets) : - rectangleLabelCarrier P ∈ M.sets ∧ rectangleOverlapGraph P r C B e1 e2 ∈ M.sets := by - have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨P, hP⟩ - have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 - have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 - have h3 : natSetCode 3 ∈ M.sets := M.insert_mem pairing unions h2 h2 - have hL := M.prod_mem pairing unions powers separation h3 hP - refine ⟨hL, ?_⟩ - let params := extend P (extend r (extend C (extend B (extend e1 (extend e2 - (extend (natSetCode 0) (extend (natSetCode 1) (extend (natSetCode 2) (extend (natSetCode 3) Fin.elim0))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.rectangleOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params - (Fin.cases hP (Fin.cases hr (Fin.cases hC (Fin.cases hB (Fin.cases hE1 (Fin.cases hE2 - (Fin.cases h0 (Fin.cases h1 (Fin.cases h2 (Fin.cases h3 (fun i => Fin.elim0 i))))))))))) - (M.prod_mem pairing unions powers separation hL hL) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.rectangleOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10) (extend z params)) - (ZFSet.prod (rectangleLabelCarrier P) (rectangleLabelCarrier P)) = - rectangleOverlapGraph P r C B e1 e2 := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_rectangleOverlapEntryFormula _ _ _ _ _ _ _ _ _ _ _ _ rfl rfl rfl rfl] - exact ⟨And.right, fun h => ⟨rectangleOverlapGraph_subset _ _ _ _ _ _ h, h⟩⟩ - exact eq ▸ selected -end TransitiveGround - -end - -section -open SetRealization Compression.RecursiveMaps -universe u - -def rectangleVertexCode : Rectangle.Vertex → ZFSet.{u} - | .root => natSetCode 0 - | .one => natSetCode 1 - | .two => natSetCode 2 - -theorem rectangleVertexCode_injective : Function.Injective (rectangleVertexCode : Rectangle.Vertex → ZFSet.{u}) := by - intro i j equal - cases i <;> cases j <;> simp_all [rectangleVertexCode, natSetCode_injective.eq_iff] - -theorem rectangleVertexCode_mem (i : Rectangle.Vertex) : rectangleVertexCode i ∈ (natSetCode 3 : ZFSet.{u}) := by - cases i <;> exact (natSetCode_mem_iff _ _).2 (by decide) - -theorem mem_three_iff_rectangleVertexCode (x : ZFSet.{u}) : - x ∈ natSetCode 3 ↔ ∃ i, rectangleVertexCode i = x := by - constructor - · intro hx - obtain ⟨n, hn, rfl⟩ := (mem_natSetCode x 3).1 hx - have values : n = 0 ∨ n = 1 ∨ n = 2 := by omega - rcases values with rfl | rfl | rfl - · exact ⟨.root, rfl⟩ - · exact ⟨.one, rfl⟩ - · exact ⟨.two, rfl⟩ - · rintro ⟨i, rfl⟩ - exact rectangleVertexCode_mem i - -noncomputable def rectangleLabelPresentation {A : Type u} (s : Presentation A) : - Presentation (Rectangle.Vertex × A) where - carrier := rectangleLabelCarrier s.carrier - encode ix := ZFSet.pair (rectangleVertexCode ix.1) (s.encode ix.2) - injective := by - intro x y equal - have parts := ZFSet.pair_inj.1 equal - exact Prod.ext (rectangleVertexCode_injective parts.1) (s.injective parts.2) - mem_carrier z := by - rw [rectangleLabelCarrier, ZFSet.mem_prod] - constructor - · rintro ⟨i, hi, x, hx, eq⟩ - obtain ⟨i, rfl⟩ := (mem_three_iff_rectangleVertexCode i).1 hi - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - exact ⟨(i, x), eq.symm⟩ - · rintro ⟨⟨i, x⟩, rfl⟩ - exact ⟨_, rectangleVertexCode_mem i, _, s.encode_mem x, rfl⟩ - -variable {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) -variable {r e1 e2 : ZFSet.{u}} -variable (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) -variable (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) -variable (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) - -include order first second in -theorem rectangleOverlapRel_iff (i j : Rectangle.Vertex) (x y : A) : - rectangleOverlapRel r (s.encode tile.C) (s.encode tile.B) e1 e2 - (rectangleVertexCode i) (rectangleVertexCode j) (s.encode x) (s.encode y) ↔ - tile.copies.Related (i, x) (j, y) := by - have reverse1 : (p.le y tile.C ∧ tile.g1.toFun y = x) ↔ - (p.le x (tile.g1.toFun tile.C) ∧ tile.g1.inverse x = y) := by - constructor - · rintro ⟨below, rfl⟩ - exact ⟨(tile.g1.le_iff _ _).2 below, tile.g1.left_inverse y⟩ - · rintro ⟨below, eq⟩ - rw [← eq] - exact ⟨tile.inverse1_C x below, tile.g1.right_inverse x⟩ - have reverse2 : (p.le y tile.C ∧ tile.g2.toFun y = x) ↔ - (p.le x (tile.g2.toFun tile.C) ∧ tile.g2.inverse x = y) := by - constructor - · rintro ⟨below, rfl⟩ - exact ⟨(tile.g2.le_iff _ _).2 below, tile.g2.left_inverse y⟩ - · rintro ⟨below, eq⟩ - rw [← eq] - exact ⟨tile.inverse2_C x below, tile.g2.right_inverse x⟩ - cases i <;> cases j <;> - simp [rectangleOverlapRel, rectangleVertexCode, natSetCode_injective.eq_iff, - s.injective.eq_iff, order, first, second, CompatibleCopies.Data.Related, - Rectangle.Input.copies, Rectangle.Input.anchor, Rectangle.Input.transition, - inverseIso, identityIso, isoOfOrder, tile.greatest] - · exact reverse1 - · exact reverse2 - -include order first second in -theorem rectangleOverlapGraph_iff (x y : Rectangle.Vertex × A) : - ZFSet.pair ((rectangleLabelPresentation s).encode x) ((rectangleLabelPresentation s).encode y) ∈ - rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2 ↔ - tile.copies.Related x y := by - change ZFSet.pair (ZFSet.pair (rectangleVertexCode x.1) (s.encode x.2)) - (ZFSet.pair (rectangleVertexCode y.1) (s.encode y.2)) ∈ _ ↔ _ - rw [pair_mem_rectangleOverlapGraph] - simp only [rectangleVertexCode_mem, s.encode_mem, true_and] - exact rectangleOverlapRel_iff s tile order first second x.1 y.1 x.2 y.2 - -include order first second in -theorem rectangleOverlap_equivalence : - EquivalenceRelationCode (rectangleLabelCarrier s.carrier) - (rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2) := by - let labels := rectangleLabelPresentation s - have entries := rectangleOverlapGraph_iff s tile order first second - refine ⟨rectangleOverlapGraph_subset _ _ _ _ _ _, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨a, rfl⟩ := (labels.mem_carrier x).1 hx - exact (entries a a).2 (tile.copies.related_refl a) - · intro x y entry - have bounds := ZFSet.pair_mem_prod.1 (rectangleOverlapGraph_subset _ _ _ _ _ _ entry) - obtain ⟨a, rfl⟩ := (labels.mem_carrier x).1 bounds.1 - obtain ⟨b, rfl⟩ := (labels.mem_carrier y).1 bounds.2 - exact (entries b a).2 (tile.copies.related_symm ((entries a b).1 entry)) - · intro x y z xy yz - have bounds := ZFSet.pair_mem_prod.1 (rectangleOverlapGraph_subset _ _ _ _ _ _ xy) - have boundZ := (ZFSet.pair_mem_prod.1 (rectangleOverlapGraph_subset _ _ _ _ _ _ yz)).2 - obtain ⟨a, rfl⟩ := (labels.mem_carrier x).1 bounds.1 - obtain ⟨b, rfl⟩ := (labels.mem_carrier y).1 bounds.2 - obtain ⟨c, rfl⟩ := (labels.mem_carrier z).1 boundZ - exact (entries a c).2 (tile.copies.related_trans ((entries a b).1 xy) ((entries b c).1 yz)) - -noncomputable def rectangleTilePresentation : Presentation tile.copies.Node := - (rectangleLabelPresentation s).quotientPresentation tile.copies.setoid - (rectangleOverlap_equivalence s tile order first second) - (rectangleOverlapGraph_iff s tile order first second) - -end - -section -open SetRealization Compression.RecursiveMaps -universe u - -noncomputable def rectangleQuotientOrder (P Q r classifier : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ Q, ∃ y ∈ Q, z = ZFSet.pair x y ∧ - ∃ i ∈ natSetCode 3, ∃ a ∈ P, ∃ b ∈ P, - ZFSet.pair (ZFSet.pair i a) x ∈ classifier ∧ - ZFSet.pair (ZFSet.pair i b) y ∈ classifier ∧ ZFSet.pair a b ∈ r) - (ZFSet.prod Q Q) - -theorem mem_rectangleQuotientOrder (P Q r classifier z : ZFSet.{u}) : - z ∈ rectangleQuotientOrder P Q r classifier ↔ - ∃ x ∈ Q, ∃ y ∈ Q, z = ZFSet.pair x y ∧ - ∃ i ∈ natSetCode 3, ∃ a ∈ P, ∃ b ∈ P, - ZFSet.pair (ZFSet.pair i a) x ∈ classifier ∧ - ZFSet.pair (ZFSet.pair i b) y ∈ classifier ∧ ZFSet.pair a b ∈ r := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · intro h - obtain ⟨x, hx, y, hy, eq, rest⟩ := h - subst z - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, rest⟩ - -theorem pair_mem_rectangleQuotientOrder (P Q r classifier x y : ZFSet.{u}) : - ZFSet.pair x y ∈ rectangleQuotientOrder P Q r classifier ↔ - x ∈ Q ∧ y ∈ Q ∧ ∃ i ∈ natSetCode 3, ∃ a ∈ P, ∃ b ∈ P, - ZFSet.pair (ZFSet.pair i a) x ∈ classifier ∧ - ZFSet.pair (ZFSet.pair i b) y ∈ classifier ∧ ZFSet.pair a b ∈ r := by - rw [mem_rectangleQuotientOrder] - constructor - · rintro ⟨a, ha, b, hb, eq, rest⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨ha, hb, rest⟩ - · rintro ⟨hx, hy, rest⟩ - exact ⟨x, hx, y, hy, rfl, rest⟩ - -theorem rectangleQuotientOrder_subset (P Q r classifier : ZFSet.{u}) : - rectangleQuotientOrder P Q r classifier ⊆ ZFSet.prod Q Q := - fun _ h => (ZFSet.mem_sep.1 h).1 - -variable {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) -variable {r e1 e2 : ZFSet.{u}} -variable (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) -variable (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) -variable (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) - -noncomputable abbrev rectangleTileOrder := - rectangleQuotientOrder s.carrier (rectangleTilePresentation s tile order first second).carrier r - (equivalenceClassifier (rectangleLabelCarrier s.carrier) - (rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2)) - -include order first second - -theorem rectangleTileOrder_iff (x y : tile.copies.Node) : - ZFSet.pair ((rectangleTilePresentation s tile order first second).encode x) - ((rectangleTilePresentation s tile order first second).encode y) ∈ - rectangleTileOrder s tile order first second ↔ tile.copies.order.le x y := by - have classifier := (rectangleLabelPresentation s).quotientPresentation_classifier_entry_iff - tile.copies.setoid (rectangleOverlap_equivalence s tile order first second) - (rectangleOverlapGraph_iff s tile order first second) - rw [rectangleTileOrder, pair_mem_rectangleQuotientOrder] - simp only [(rectangleTilePresentation s tile order first second).encode_mem, true_and] - constructor - · rintro ⟨i, hi, a, ha, b, hb, ax, byEntry, ab⟩ - obtain ⟨i, rfl⟩ := (mem_three_iff_rectangleVertexCode i).1 hi - obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha - obtain ⟨b, rfl⟩ := (s.mem_carrier b).1 hb - have ex : tile.copies.point i a = x := (classifier (i, a) x).1 ax - have ey : tile.copies.point i b = y := (classifier (i, b) y).1 byEntry - rw [← ex, ← ey] - exact (tile.copies.vertex_le i a b).2 ((order a b).1 ab) - · intro lower - obtain ⟨i, a, b, ex, ey, ab⟩ := tile.copies.comparison_in_vertex x y lower - exact ⟨rectangleVertexCode i, rectangleVertexCode_mem i, s.encode a, s.encode_mem a, - s.encode b, s.encode_mem b, (classifier (i, a) x).2 ex, - (classifier (i, b) y).2 ey, (order a b).2 ab⟩ - -theorem rectangleTile_partialOrder : PartialOrderCode - (rectangleTilePresentation s tile order first second).carrier - (rectangleTileOrder s tile order first second) := by - let q := rectangleTilePresentation s tile order first second - have entries := rectangleTileOrder_iff s tile order first second - refine ⟨rectangleQuotientOrder_subset _ _ _ _, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx - exact (entries a a).2 (tile.copies.order.refl a) - · intro x hx y hy xy yx - obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (q.mem_carrier y).1 hy - exact congrArg q.encode (tile.copies.order.antisymm ((entries a b).1 xy) ((entries b a).1 yx)) - · intro x hx y hy z hz xy yz - obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (q.mem_carrier y).1 hy - obtain ⟨c, rfl⟩ := (q.mem_carrier z).1 hz - exact (entries a c).2 (tile.copies.order.trans ((entries a b).1 xy) ((entries b c).1 yz)) - -theorem rectangleTile_meet_glb (x y : tile.copies.Node) : - GreatestLowerBoundCode (rectangleTilePresentation s tile order first second).carrier - (rectangleTileOrder s tile order first second) - ((rectangleTilePresentation s tile order first second).encode x) - ((rectangleTilePresentation s tile order first second).encode y) - ((rectangleTilePresentation s tile order first second).encode (tile.copies.order.meet x y)) := by - let q := rectangleTilePresentation s tile order first second - have entries := rectangleTileOrder_iff s tile order first second - refine ⟨(entries _ _).2 (tile.copies.order.meet_le_left x y), - (entries _ _).2 (tile.copies.order.meet_le_right x y), ?_⟩ - intro z hz zx zy - obtain ⟨a, rfl⟩ := (q.mem_carrier z).1 hz - exact (entries _ _).2 (tile.copies.order.le_meet ((entries _ _).1 zx) ((entries _ _).1 zy)) - -theorem rectangleTile_meetOrder : MeetOrderCode - (rectangleTilePresentation s tile order first second).carrier - (rectangleTileOrder s tile order first second) - (canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier - (rectangleTileOrder s tile order first second)) := by - apply canonicalMeetGraph_code (rectangleTile_partialOrder s tile order first second) - intro x hx y hy - let q := rectangleTilePresentation s tile order first second - obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (q.mem_carrier y).1 hy - exact ⟨q.encode (tile.copies.order.meet a b), q.encode_mem _, - rectangleTile_meet_glb s tile order first second a b⟩ - -theorem rectangleTile_meet_entry (x y : tile.copies.Node) : - ZFSet.pair (ZFSet.pair ((rectangleTilePresentation s tile order first second).encode x) - ((rectangleTilePresentation s tile order first second).encode y)) - ((rectangleTilePresentation s tile order first second).encode (tile.copies.order.meet x y)) ∈ - canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier - (rectangleTileOrder s tile order first second) := by - apply (pair_mem_canonicalMeetGraph _ _ _ _ _).2 - refine ⟨?_, ?_, ?_, rectangleTile_meet_glb s tile order first second x y⟩ <;> - exact (rectangleTilePresentation s tile order first second).encode_mem _ - -end - -section -open SetFormula SetRealization Compression.RecursiveMaps -universe u - -namespace BoundedFormula - -def rectangleQuotientOrderFormula {n} (z P Q r classifier three : Fin n) : BoundedFormula n := - exMem Q (exMem Q.succ - (.conj (orderedPairFormula z.succ.succ 1 0) - (exMem three.succ.succ (exMem P.succ.succ.succ (exMem P.succ.succ.succ.succ - (.conj (tripleMembershipFormula 2 1 4 classifier.succ.succ.succ.succ.succ) - (.conj (tripleMembershipFormula 2 0 3 classifier.succ.succ.succ.succ.succ) - (pairMembershipFormula 1 0 r.succ.succ.succ.succ.succ)))))))) - -theorem truth_rectangleQuotientOrderFormula {n} (z P Q r classifier three : Fin n) - (env : Fin n → ZFSet.{u}) (hthree : env three = natSetCode 3) : - Truth (rectangleQuotientOrderFormula z P Q r classifier three) env ↔ - env z ∈ rectangleQuotientOrder (env P) (env Q) (env r) (env classifier) := by - simp only [rectangleQuotientOrderFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_tripleMembershipFormula, truth_pairMembershipFormula, mem_rectangleQuotientOrder, - extend, Fin.cases_zero, Fin.cases_succ] - rw [hthree] - rfl - -end BoundedFormula - -namespace TransitiveGround - -theorem rectangleQuotientOrder_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P Q r classifier : ZFSet.{u}} (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) - (hr : r ∈ M.sets) (hc : classifier ∈ M.sets) : - rectangleQuotientOrder P Q r classifier ∈ M.sets := by - have hzero := M.empty_mem ⟨P, hP⟩ - have hone := M.insert_mem pairing unions hzero hzero - have htwo := M.insert_mem pairing unions hone hone - have hthree := M.insert_mem pairing unions htwo htwo - change (natSetCode 3 : ZFSet.{u}) ∈ M.sets at hthree - have bound := M.prod_mem pairing unions powers separation hQ hQ - let params := extend P (extend Q (extend r (extend classifier (extend (natSetCode 3) Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.rectangleQuotientOrderFormula 0 1 2 3 4 5) params - (Fin.cases hP (Fin.cases hQ (Fin.cases hr (Fin.cases hc - (Fin.cases hthree (fun i => Fin.elim0 i)))))) bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.rectangleQuotientOrderFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod Q Q) = rectangleQuotientOrder P Q r classifier := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_rectangleQuotientOrderFormula _ _ _ _ _ _ _ rfl] - change (z ∈ ZFSet.prod Q Q ∧ z ∈ rectangleQuotientOrder P Q r classifier) ↔ _ - exact ⟨And.right, fun hz => ⟨rectangleQuotientOrder_subset _ _ _ _ hz, hz⟩⟩ - exact eq ▸ selected - -theorem rectangleTile_ground (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) - {r e1 e2 : ZFSet.{u}} - (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) - (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) - (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) - (hP : s.carrier ∈ M.sets) (hr : r ∈ M.sets) (he1 : e1 ∈ M.sets) (he2 : e2 ∈ M.sets) : - (rectangleTilePresentation s tile order first second).carrier ∈ M.sets ∧ - rectangleTileOrder s tile order first second ∈ M.sets ∧ - canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier - (rectangleTileOrder s tile order first second) ∈ M.sets := by - have overlap := M.rectangleOverlapGraph_mem pairing unions powers separation hP hr - (M.transitive hP (s.encode_mem tile.C)) (M.transitive hP (s.encode_mem tile.B)) he1 he2 - have carrier := M.equivalenceClasses_mem powers separation overlap.1 overlap.2 - have classifier := M.equivalenceClassifier_mem pairing unions powers separation overlap.1 overlap.2 - have rel := M.rectangleQuotientOrder_mem pairing unions powers separation hP carrier hr classifier - exact ⟨carrier, rel, M.canonicalMeetGraph_mem pairing unions powers separation carrier rel⟩ - -end TransitiveGround - -end - -section -open SetRealization Compression.RecursiveMaps SetFormula -universe u -variable {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) -variable {r e1 e2 : ZFSet.{u}} -variable (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) -variable (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) -variable (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) - -noncomputable def rectangleTileVertexGraph (i : Rectangle.Vertex) := - indexedRelationSection s.carrier (rectangleTilePresentation s tile order first second).carrier - (equivalenceClassifier (rectangleLabelCarrier s.carrier) - (rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2)) - (rectangleVertexCode i) - -include order first second - -theorem rectangleTileVertexGraph_iff (i : Rectangle.Vertex) (x : A) (y : tile.copies.Node) : - ZFSet.pair (s.encode x) ((rectangleTilePresentation s tile order first second).encode y) ∈ - rectangleTileVertexGraph s tile order first second i ↔ tile.copies.point i x = y := by - rw [rectangleTileVertexGraph, pair_mem_indexedRelationSection] - simp only [s.encode_mem, (rectangleTilePresentation s tile order first second).encode_mem, true_and] - exact (rectangleLabelPresentation s).quotientPresentation_classifier_entry_iff - tile.copies.setoid (rectangleOverlap_equivalence s tile order first second) - (rectangleOverlapGraph_iff s tile order first second) (i, x) y - -theorem rectangleTileVertexGraph_eq (i : Rectangle.Vertex) : - rectangleTileVertexGraph s tile order first second i = - s.graph (rectangleTilePresentation s tile order first second) (tile.copies.point i) := by - apply s.relation_ext (rectangleTilePresentation s tile order first second) - (indexedRelationSection_subset _ _ _ _) (s.graph_isFunc _ _).1 - intro x y - change ZFSet.pair (s.encode x) ((rectangleTilePresentation s tile order first second).encode y) ∈ - rectangleTileVertexGraph s tile order first second i ↔ _ - rw [rectangleTileVertexGraph_iff, s.pair_mem_graph] - -theorem rectangleTileVertex_injection (i : Rectangle.Vertex) : - InjectionCode s.carrier (rectangleTilePresentation s tile order first second).carrier - (rectangleTileVertexGraph s tile order first second i) := by - rw [rectangleTileVertexGraph_eq] - exact s.graph_injection _ _ (tile.copies.vertex_injective i) - -theorem rectangleTileVertex_order_iff (i : Rectangle.Vertex) {x y x' y' : ZFSet.{u}} - (hx : ZFSet.pair x x' ∈ rectangleTileVertexGraph s tile order first second i) - (hy : ZFSet.pair y y' ∈ rectangleTileVertexGraph s tile order first second i) : - ZFSet.pair x' y' ∈ rectangleTileOrder s tile order first second ↔ ZFSet.pair x y ∈ r := by - rw [rectangleTileVertexGraph_eq] at hx hy - obtain ⟨a, ha⟩ := (s.mem_graph _ _ _).1 hx - obtain ⟨b, hb⟩ := (s.mem_graph _ _ _).1 hy - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ha - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 hb - exact (rectangleTileOrder_iff s tile order first second _ _).trans - ((tile.copies.vertex_le i a b).trans (order a b).symm) - -theorem rectangleTileVertex_embedding {μ : ZFSet.{u}} (source : MeetOrderCode s.carrier r μ) - (meet : ∀ x y, ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode (p.meet x y)) ∈ μ) - (i : Rectangle.Vertex) : - MeetEmbeddingCode s.carrier (rectangleTilePresentation s tile order first second).carrier - r (rectangleTileOrder s tile order first second) μ - (canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier - (rectangleTileOrder s tile order first second)) - (rectangleTileVertexGraph s tile order first second i) := by - refine ⟨rectangleTileVertex_injection s tile order first second i, ?_, ?_⟩ - · intro x y x' y' lower hx hy - exact (rectangleTileVertex_order_iff s tile order first second i hx hy).2 lower - · intro x y z x' y' z' mxy hx hy hz - rw [rectangleTileVertexGraph_eq] at hx hy hz - obtain ⟨a, ha⟩ := (s.mem_graph _ _ _).1 hx - obtain ⟨b, hb⟩ := (s.mem_graph _ _ _).1 hy - obtain ⟨c, hc⟩ := (s.mem_graph _ _ _).1 hz - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ha - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 hb - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 hc - obtain ⟨w, _, unique⟩ := source.operation.2 - (ZFSet.pair (s.encode a) (s.encode b)) (ZFSet.pair_mem_prod.2 ⟨s.encode_mem a, s.encode_mem b⟩) - have equal : c = p.meet a b := s.injective ((unique _ mxy).trans (unique _ (meet a b)).symm) - subst c - have mapped := (tile.copies.vertex i).map_meet a b - change tile.copies.point i (p.meet a b) = _ at mapped - rw [mapped] - exact rectangleTile_meet_entry s tile order first second _ _ - -theorem rectangleTileVertex_cover (z : ZFSet.{u}) - (hz : z ∈ (rectangleTilePresentation s tile order first second).carrier) : - ∃ i : Rectangle.Vertex, ∃ x ∈ s.carrier, - ZFSet.pair x z ∈ rectangleTileVertexGraph s tile order first second i := by - obtain ⟨a, rfl⟩ := ((rectangleTilePresentation s tile order first second).mem_carrier z).1 hz - obtain ⟨i, x, hx⟩ := tile.copies.cover a - exact ⟨i, s.encode x, s.encode_mem x, (rectangleTileVertexGraph_iff s tile order first second i x a).2 hx⟩ - -theorem rectangleTileVertex_overlap (i j : Rectangle.Vertex) (x y : A) : - (rectangleTilePresentation s tile order first second).encode (tile.copies.point i x) = - (rectangleTilePresentation s tile order first second).encode (tile.copies.point j y) ↔ - tile.copies.Related (i, x) (j, y) := - (rectangleTilePresentation s tile order first second).injective.eq_iff.trans - (tile.copies.mk_eq_mk i j x y) - -theorem rectangleTileVertex_ideal (i : Rectangle.Vertex) (x : A) {z : ZFSet.{u}} - (hz : z ∈ (rectangleTilePresentation s tile order first second).carrier) - (lower : ZFSet.pair z ((rectangleTilePresentation s tile order first second).encode - (tile.copies.point i x)) ∈ rectangleTileOrder s tile order first second) : - ∃ y ∈ s.carrier, ZFSet.pair y z ∈ rectangleTileVertexGraph s tile order first second i := by - obtain ⟨a, rfl⟩ := ((rectangleTilePresentation s tile order first second).mem_carrier z).1 hz - obtain ⟨y, eq⟩ := tile.copies.vertex_ideal i x a ((rectangleTileOrder_iff s tile order first second _ _).1 lower) - exact ⟨s.encode y, s.encode_mem y, (rectangleTileVertexGraph_iff s tile order first second i y a).2 eq⟩ - -theorem TransitiveGround.rectangleTileVertexGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hP : s.carrier ∈ M.sets) (hr : r ∈ M.sets) (he1 : e1 ∈ M.sets) (he2 : e2 ∈ M.sets) - (i : Rectangle.Vertex) : rectangleTileVertexGraph s tile order first second i ∈ M.sets := by - have overlap := M.rectangleOverlapGraph_mem pairing unions powers separation hP hr - (M.transitive hP (s.encode_mem tile.C)) (M.transitive hP (s.encode_mem tile.B)) he1 he2 - have carrier := M.equivalenceClasses_mem powers separation overlap.1 overlap.2 - have classifier := M.equivalenceClassifier_mem pairing unions powers separation overlap.1 overlap.2 - have hzero := M.empty_mem ⟨s.carrier, hP⟩ - have hone := M.insert_mem pairing unions hzero hzero - have htwo := M.insert_mem pairing unions hone hone - have hi : rectangleVertexCode i ∈ M.sets := by - cases i - · exact hzero - · exact hone - · exact htwo - exact M.indexedRelationSection_mem pairing unions powers separation hP carrier classifier hi - -end - -section -open SetRealization Compression.RecursiveMaps SetFormula -universe u - -variable {P G r μ A m inv one c b d g h : ZFSet.{u}} - -theorem PosetActionCode.section_small_iff (action : PosetActionCode G P m one r A) - (actor : SetMembers G) (x y : SetMembers P) : - ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ - indexedRelationSection P P A (SetMembers.raw actor) ↔ action.act actor x = y := by - rw [pair_mem_indexedRelationSection] - simp only [SetMembers.raw_mem, true_and] - exact (action.act_eq_iff actor x y).symm - -theorem ExternalRectangleCode.exists_ground_tile - (code : ExternalRectangleCode P G r μ A c b d g h) - (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (top : SetMembers P) - (greatest : ∀ x, meet.toSmallMeetOrder.le x top) - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hA : A ∈ M.sets) : - let tile := (code.toSmallActionRectangle group action meet).toInput top greatest - ∃ q : Presentation tile.copies.Node, ∃ rel μt : ZFSet.{u}, ∃ vertices : Rectangle.Vertex → ZFSet.{u}, - q.carrier = equivalenceClasses (rectangleLabelCarrier P) - (rectangleOverlapGraph P r c b (indexedRelationSection P P A g) (indexedRelationSection P P A h)) ∧ - q.carrier ∈ M.sets ∧ rel ∈ M.sets ∧ μt ∈ M.sets ∧ - MeetOrderCode q.carrier rel μt ∧ - (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ rel ↔ tile.copies.order.le x y) ∧ - (∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) - (q.encode (tile.copies.order.meet x y)) ∈ μt) ∧ - (∀ i, vertices i ∈ M.sets ∧ MeetEmbeddingCode P q.carrier r rel μ μt (vertices i)) ∧ - (∀ i x y, ZFSet.pair (SetMembers.raw x) (q.encode y) ∈ vertices i ↔ tile.copies.point i x = y) := by - dsimp only - let request := code.toSmallActionRectangle group action meet - let tile := request.toInput top greatest - let s := SetMembers.presentation P - have fields := code.toSmallActionRectangle_fields group action meet - have related : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ meet.toSmallMeetOrder.le x y := - fun _ _ => Iff.rfl - have first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A g ↔ - tile.g1.toFun x = y := by - intro x y - have entry := action.section_small_iff request.first x y - change ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A - (SetMembers.raw request.first) ↔ tile.g1.toFun x = y at entry - rw [show SetMembers.raw request.first = g from fields.2.2.2.1] at entry - exact entry - have second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A h ↔ - tile.g2.toFun x = y := by - intro x y - have entry := action.section_small_iff request.second x y - change ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A - (SetMembers.raw request.second) ↔ tile.g2.toFun x = y at entry - rw [show SetMembers.raw request.second = h from fields.2.2.2.2] at entry - exact entry - have e1 := M.indexedRelationSection_mem pairing unions powers separation hP hP hA - (M.transitive hG code.2.2.2.1) - have e2 := M.indexedRelationSection_mem pairing unions powers separation hP hP hA - (M.transitive hG code.2.2.2.2.1) - let q := rectangleTilePresentation s tile related first second - let rel := rectangleTileOrder s tile related first second - let μt := canonicalMeetGraph q.carrier rel - let vertices := rectangleTileVertexGraph s tile related first second - have ground := M.rectangleTile_ground pairing unions powers separation s tile related first second hP hr e1 e2 - refine ⟨q, rel, μt, vertices, ?_, ground.1, ground.2.1, ground.2.2, - rectangleTile_meetOrder s tile related first second, - rectangleTileOrder_iff s tile related first second, - rectangleTile_meet_entry s tile related first second, ?_, ?_⟩ - · change equivalenceClasses (rectangleLabelCarrier P) - (rectangleOverlapGraph P r (SetMembers.raw request.C) (SetMembers.raw request.B) - (indexedRelationSection P P A g) (indexedRelationSection P P A h)) = _ - rw [fields.1, fields.2.1] - · intro i - exact ⟨TransitiveGround.rectangleTileVertexGraph_mem s tile related first second M - pairing unions powers separation hP hr e1 e2 i, - rectangleTileVertex_embedding s tile related first second meet meet.smallMeet_entry i⟩ - · exact rectangleTileVertexGraph_iff s tile related first second - -end - -open SetRealization Compression.RecursiveMaps SetFormula -universe u -variable {P G r μ A m inv one C B E g k H rH old D rD c lo hi : ZFSet.{u}} - -theorem ExternalRectangleCode.exists_ground_height - (request : ExternalRectangleCode P G r μ A C B E g k) - (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (top : SetMembers P) - (greatest : ∀ x, meet.toSmallMeetOrder.le x top) - (height : StrictHeightGraphCode P H r rH old) (linear : StrictLinearOrderCode H rH) - (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hA : A ∈ M.sets) - (hH : H ∈ M.sets) (hOld : old ∈ M.sets) (hrH : rH ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (small : M.groundEmbeddable (relationImage P H old) ZFSet.omega) - (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : - let tile := (request.toSmallActionRectangle group action meet).toInput top greatest - ∃ q : Presentation tile.copies.Node, ∃ rel ν h : ZFSet.{u}, - q.carrier = equivalenceClasses (rectangleLabelCarrier P) - (rectangleOverlapGraph P r C B (indexedRelationSection P P A g) (indexedRelationSection P P A k)) ∧ - q.carrier ∈ M.sets ∧ rel ∈ M.sets ∧ ν ∈ M.sets ∧ - MeetOrderCode q.carrier rel ν ∧ - (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ rel ↔ tile.copies.order.le x y) ∧ - h ∈ M.sets ∧ IntervalHeightCode q.carrier rel D rD lo hi h ∧ - relationImage q.carrier D h ∈ M.sets ∧ - M.groundEmbeddable (relationImage q.carrier D h) ZFSet.omega := by - dsimp only - let rectangle := (request.toSmallActionRectangle group action meet).toInput top greatest - obtain ⟨q, rel, ν, vertices, carrier, hL, hRel, hν, tileMeet, related, meetEntries, vertexCodes, entries⟩ := - request.exists_ground_tile M pairing unions powers separation group action meet top greatest hP hG hr hA - let tile := TileRequests.Tile.rectangle rectangle - let s := SetMembers.presentation P - have vertexGround (i : Rectangle.Vertex) : s.graph q (rectangle.copies.point i) ∈ M.sets := by - have function := (vertexCodes i).2.injection.function - have equal : s.decodeFunction q (vertices i) function = rectangle.copies.point i := by - funext x - apply (s.decodeFunction_iff q (vertices i) function x _).2 - exact (entries i x _).2 rfl - rw [← equal, s.graph_decodeFunction q (vertices i) function] - exact (vertexCodes i).1 - have seedGround : s.graph (SetMembers.presentation H) (height.smallHeight meet linear).value ∈ M.sets := by - rw [height.smallHeight_graph] - exact hOld - have seedSmall : M.groundEmbeddable (relationImage P H - (s.graph (SetMembers.presentation H) (height.smallHeight meet linear).value)) ZFSet.omega := by - rw [height.smallHeight_graph] - exact small - obtain ⟨h, hground, code, rangeGround, rangeSmall⟩ := - M.exists_rectangleTileIntervalHeight pairing unions powers separation collection infinite - s (SetMembers.presentation H) top greatest linear.smallOrder (height.smallHeight meet linear) - (fun _ _ => Iff.rfl) linear target injection hP hH seedGround hrH hD hrD hc seedSmall hlo hhi gap - tile q hL hν related tileMeet.operation meetEntries - (vertexGround .root) (vertexGround .one) (vertexGround .two) - exact ⟨q, rel, ν, h, carrier, hL, hRel, hν, tileMeet, related, hground, code, rangeGround, rangeSmall⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCodedBinaryHeights + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +noncomputable def rectangleLabelCarrier (P : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod (natSetCode 3) P + +def rectangleOverlapRel (r C B e1 e2 i j x y : ZFSet.{u}) : Prop := + (i = j ∧ x = y) ∨ + (i = natSetCode 1 ∧ j = natSetCode 0 ∧ ZFSet.pair x C ∈ r ∧ ZFSet.pair x y ∈ e1) ∨ + (i = natSetCode 0 ∧ j = natSetCode 1 ∧ ZFSet.pair y C ∈ r ∧ ZFSet.pair y x ∈ e1) ∨ + (i = natSetCode 2 ∧ j = natSetCode 0 ∧ ZFSet.pair x C ∈ r ∧ ZFSet.pair x y ∈ e2) ∨ + (i = natSetCode 0 ∧ j = natSetCode 2 ∧ ZFSet.pair y C ∈ r ∧ ZFSet.pair y x ∈ e2) ∨ + ((i = natSetCode 1 ∧ j = natSetCode 2 ∨ i = natSetCode 2 ∧ j = natSetCode 1) ∧ + ZFSet.pair x B ∈ r ∧ x = y) + +noncomputable def rectangleOverlapGraph (P r C B e1 e2 : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ natSetCode 3, ∃ j ∈ natSetCode 3, ∃ x ∈ P, ∃ y ∈ P, + z = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ rectangleOverlapRel r C B e1 e2 i j x y) + (ZFSet.prod (rectangleLabelCarrier P) (rectangleLabelCarrier P)) + +theorem mem_rectangleOverlapGraph (P r C B e1 e2 z : ZFSet.{u}) : + z ∈ rectangleOverlapGraph P r C B e1 e2 ↔ + ∃ i ∈ natSetCode 3, ∃ j ∈ natSetCode 3, ∃ x ∈ P, ∃ y ∈ P, + z = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ rectangleOverlapRel r C B e1 e2 i j x y := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · rintro ⟨i, hi, j, hj, x, hx, y, hy, rfl, rel⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 + ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, ZFSet.pair_mem_prod.2 ⟨hj, hy⟩⟩, + i, hi, j, hj, x, hx, y, hy, rfl, rel⟩ + +theorem pair_mem_rectangleOverlapGraph (P r C B e1 e2 i j x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∈ rectangleOverlapGraph P r C B e1 e2 ↔ + i ∈ natSetCode 3 ∧ j ∈ natSetCode 3 ∧ x ∈ P ∧ y ∈ P ∧ rectangleOverlapRel r C B e1 e2 i j x y := by + rw [mem_rectangleOverlapGraph] + constructor + · rintro ⟨a, ha, b, hb, c, hc, d, hd, eq, rel⟩ + obtain ⟨first, second⟩ := ZFSet.pair_inj.1 eq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second + exact ⟨ha, hb, hc, hd, rel⟩ + · rintro ⟨hi, hj, hx, hy, rel⟩ + exact ⟨i, hi, j, hj, x, hx, y, hy, rfl, rel⟩ + +theorem rectangleOverlapGraph_subset (P r C B e1 e2 : ZFSet.{u}) : + rectangleOverlapGraph P r C B e1 e2 ⊆ + ZFSet.prod (rectangleLabelCarrier P) (rectangleLabelCarrier P) := + fun _ h => (ZFSet.mem_sep.1 h).1 + +namespace BoundedFormula + +def localRectangleOverlapFormula {n} (r C B e1 e2 i j x y zero one two : Fin n) : BoundedFormula n := + disj (.conj (.equal i j) (.equal x y)) + (disj (.conj (.equal i one) (.conj (.equal j zero) + (.conj (pairMembershipFormula x C r) (pairMembershipFormula x y e1)))) + (disj (.conj (.equal i zero) (.conj (.equal j one) + (.conj (pairMembershipFormula y C r) (pairMembershipFormula y x e1)))) + (disj (.conj (.equal i two) (.conj (.equal j zero) + (.conj (pairMembershipFormula x C r) (pairMembershipFormula x y e2)))) + (disj (.conj (.equal i zero) (.conj (.equal j two) + (.conj (pairMembershipFormula y C r) (pairMembershipFormula y x e2)))) + (.conj (disj (.conj (.equal i one) (.equal j two)) (.conj (.equal i two) (.equal j one))) + (.conj (pairMembershipFormula x B r) (.equal x y))))))) + +theorem truth_localRectangleOverlapFormula {n} (r C B e1 e2 i j x y zero one two : Fin n) + (env : Fin n → ZFSet.{u}) (h0 : env zero = natSetCode 0) + (h1 : env one = natSetCode 1) (h2 : env two = natSetCode 2) : + Truth (localRectangleOverlapFormula r C B e1 e2 i j x y zero one two) env ↔ + rectangleOverlapRel (env r) (env C) (env B) (env e1) (env e2) (env i) (env j) (env x) (env y) := by + simp only [localRectangleOverlapFormula, truth_disj, Truth, truth_pairMembershipFormula, h0, h1, h2] + rfl + +def rectangleOverlapEntryFormula {n} (z P r C B e1 e2 zero one two three : Fin n) : BoundedFormula n := + exMem three (exMem three.succ (exMem P.succ.succ (exMem P.succ.succ.succ + (.conj (pairOfPairsFormula z.succ.succ.succ.succ 3 1 2 0) + (localRectangleOverlapFormula r.succ.succ.succ.succ C.succ.succ.succ.succ B.succ.succ.succ.succ + e1.succ.succ.succ.succ e2.succ.succ.succ.succ 3 2 1 0 + zero.succ.succ.succ.succ one.succ.succ.succ.succ two.succ.succ.succ.succ))))) + +theorem truth_rectangleOverlapEntryFormula {n} (z P r C B e1 e2 zero one two three : Fin n) + (env : Fin n → ZFSet.{u}) (h0 : env zero = natSetCode 0) + (h1 : env one = natSetCode 1) (h2 : env two = natSetCode 2) (h3 : env three = natSetCode 3) : + Truth (rectangleOverlapEntryFormula z P r C B e1 e2 zero one two three) env ↔ + env z ∈ rectangleOverlapGraph (env P) (env r) (env C) (env B) (env e1) (env e2) := by + simp only [rectangleOverlapEntryFormula, truth_exMem, Truth, truth_pairOfPairsFormula, + mem_rectangleOverlapGraph, extend, Fin.cases_succ, Fin.cases_zero, h3] + apply exists_congr + intro i + apply and_congr_right + intro _ + apply exists_congr + intro j + apply and_congr_right + intro _ + apply exists_congr + intro x + apply and_congr_right + intro _ + apply exists_congr + intro y + apply and_congr_right + intro _ + exact and_congr Iff.rfl (truth_localRectangleOverlapFormula _ _ _ _ _ _ _ _ _ _ _ _ _ h0 h1 h2) +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem rectangleOverlapGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r C B e1 e2 : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) + (hE1 : e1 ∈ M.sets) (hE2 : e2 ∈ M.sets) : + rectangleLabelCarrier P ∈ M.sets ∧ rectangleOverlapGraph P r C B e1 e2 ∈ M.sets := by + have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨P, hP⟩ + have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 + have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 + have h3 : natSetCode 3 ∈ M.sets := M.insert_mem pairing unions h2 h2 + have hL := M.prod_mem pairing unions powers separation h3 hP + refine ⟨hL, ?_⟩ + let params := extend P (extend r (extend C (extend B (extend e1 (extend e2 + (extend (natSetCode 0) (extend (natSetCode 1) (extend (natSetCode 2) (extend (natSetCode 3) Fin.elim0))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.rectangleOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params + (Fin.cases hP (Fin.cases hr (Fin.cases hC (Fin.cases hB (Fin.cases hE1 (Fin.cases hE2 + (Fin.cases h0 (Fin.cases h1 (Fin.cases h2 (Fin.cases h3 (fun i => Fin.elim0 i))))))))))) + (M.prod_mem pairing unions powers separation hL hL) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.rectangleOverlapEntryFormula 0 1 2 3 4 5 6 7 8 9 10) (extend z params)) + (ZFSet.prod (rectangleLabelCarrier P) (rectangleLabelCarrier P)) = + rectangleOverlapGraph P r C B e1 e2 := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_rectangleOverlapEntryFormula _ _ _ _ _ _ _ _ _ _ _ _ rfl rfl rfl rfl] + exact ⟨And.right, fun h => ⟨rectangleOverlapGraph_subset _ _ _ _ _ _ h, h⟩⟩ + exact eq ▸ selected +end TransitiveGround + +end + +section +open SetRealization Compression.RecursiveMaps +universe u + +def rectangleVertexCode : Rectangle.Vertex → ZFSet.{u} + | .root => natSetCode 0 + | .one => natSetCode 1 + | .two => natSetCode 2 + +theorem rectangleVertexCode_injective : Function.Injective (rectangleVertexCode : Rectangle.Vertex → ZFSet.{u}) := by + intro i j equal + cases i <;> cases j <;> simp_all [rectangleVertexCode, natSetCode_injective.eq_iff] + +theorem rectangleVertexCode_mem (i : Rectangle.Vertex) : rectangleVertexCode i ∈ (natSetCode 3 : ZFSet.{u}) := by + cases i <;> exact (natSetCode_mem_iff _ _).2 (by decide) + +theorem mem_three_iff_rectangleVertexCode (x : ZFSet.{u}) : + x ∈ natSetCode 3 ↔ ∃ i, rectangleVertexCode i = x := by + constructor + · intro hx + obtain ⟨n, hn, rfl⟩ := (mem_natSetCode x 3).1 hx + have values : n = 0 ∨ n = 1 ∨ n = 2 := by omega + rcases values with rfl | rfl | rfl + · exact ⟨.root, rfl⟩ + · exact ⟨.one, rfl⟩ + · exact ⟨.two, rfl⟩ + · rintro ⟨i, rfl⟩ + exact rectangleVertexCode_mem i + +noncomputable def rectangleLabelPresentation {A : Type u} (s : Presentation A) : + Presentation (Rectangle.Vertex × A) where + carrier := rectangleLabelCarrier s.carrier + encode ix := ZFSet.pair (rectangleVertexCode ix.1) (s.encode ix.2) + injective := by + intro x y equal + have parts := ZFSet.pair_inj.1 equal + exact Prod.ext (rectangleVertexCode_injective parts.1) (s.injective parts.2) + mem_carrier z := by + rw [rectangleLabelCarrier, ZFSet.mem_prod] + constructor + · rintro ⟨i, hi, x, hx, eq⟩ + obtain ⟨i, rfl⟩ := (mem_three_iff_rectangleVertexCode i).1 hi + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + exact ⟨(i, x), eq.symm⟩ + · rintro ⟨⟨i, x⟩, rfl⟩ + exact ⟨_, rectangleVertexCode_mem i, _, s.encode_mem x, rfl⟩ + +variable {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) +variable {r e1 e2 : ZFSet.{u}} +variable (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) +variable (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) +variable (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) + +include order first second in +theorem rectangleOverlapRel_iff (i j : Rectangle.Vertex) (x y : A) : + rectangleOverlapRel r (s.encode tile.C) (s.encode tile.B) e1 e2 + (rectangleVertexCode i) (rectangleVertexCode j) (s.encode x) (s.encode y) ↔ + tile.copies.Related (i, x) (j, y) := by + have reverse1 : (p.le y tile.C ∧ tile.g1.toFun y = x) ↔ + (p.le x (tile.g1.toFun tile.C) ∧ tile.g1.inverse x = y) := by + constructor + · rintro ⟨below, rfl⟩ + exact ⟨(tile.g1.le_iff _ _).2 below, tile.g1.left_inverse y⟩ + · rintro ⟨below, eq⟩ + rw [← eq] + exact ⟨tile.inverse1_C x below, tile.g1.right_inverse x⟩ + have reverse2 : (p.le y tile.C ∧ tile.g2.toFun y = x) ↔ + (p.le x (tile.g2.toFun tile.C) ∧ tile.g2.inverse x = y) := by + constructor + · rintro ⟨below, rfl⟩ + exact ⟨(tile.g2.le_iff _ _).2 below, tile.g2.left_inverse y⟩ + · rintro ⟨below, eq⟩ + rw [← eq] + exact ⟨tile.inverse2_C x below, tile.g2.right_inverse x⟩ + cases i <;> cases j <;> + simp [rectangleOverlapRel, rectangleVertexCode, natSetCode_injective.eq_iff, + s.injective.eq_iff, order, first, second, CompatibleCopies.Data.Related, + Rectangle.Input.copies, Rectangle.Input.anchor, Rectangle.Input.transition, + inverseIso, identityIso, isoOfOrder, tile.greatest] + · exact reverse1 + · exact reverse2 + +include order first second in +theorem rectangleOverlapGraph_iff (x y : Rectangle.Vertex × A) : + ZFSet.pair ((rectangleLabelPresentation s).encode x) ((rectangleLabelPresentation s).encode y) ∈ + rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2 ↔ + tile.copies.Related x y := by + change ZFSet.pair (ZFSet.pair (rectangleVertexCode x.1) (s.encode x.2)) + (ZFSet.pair (rectangleVertexCode y.1) (s.encode y.2)) ∈ _ ↔ _ + rw [pair_mem_rectangleOverlapGraph] + simp only [rectangleVertexCode_mem, s.encode_mem, true_and] + exact rectangleOverlapRel_iff s tile order first second x.1 y.1 x.2 y.2 + +include order first second in +theorem rectangleOverlap_equivalence : + EquivalenceRelationCode (rectangleLabelCarrier s.carrier) + (rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2) := by + let labels := rectangleLabelPresentation s + have entries := rectangleOverlapGraph_iff s tile order first second + refine ⟨rectangleOverlapGraph_subset _ _ _ _ _ _, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨a, rfl⟩ := (labels.mem_carrier x).1 hx + exact (entries a a).2 (tile.copies.related_refl a) + · intro x y entry + have bounds := ZFSet.pair_mem_prod.1 (rectangleOverlapGraph_subset _ _ _ _ _ _ entry) + obtain ⟨a, rfl⟩ := (labels.mem_carrier x).1 bounds.1 + obtain ⟨b, rfl⟩ := (labels.mem_carrier y).1 bounds.2 + exact (entries b a).2 (tile.copies.related_symm ((entries a b).1 entry)) + · intro x y z xy yz + have bounds := ZFSet.pair_mem_prod.1 (rectangleOverlapGraph_subset _ _ _ _ _ _ xy) + have boundZ := (ZFSet.pair_mem_prod.1 (rectangleOverlapGraph_subset _ _ _ _ _ _ yz)).2 + obtain ⟨a, rfl⟩ := (labels.mem_carrier x).1 bounds.1 + obtain ⟨b, rfl⟩ := (labels.mem_carrier y).1 bounds.2 + obtain ⟨c, rfl⟩ := (labels.mem_carrier z).1 boundZ + exact (entries a c).2 (tile.copies.related_trans ((entries a b).1 xy) ((entries b c).1 yz)) + +noncomputable def rectangleTilePresentation : Presentation tile.copies.Node := + (rectangleLabelPresentation s).quotientPresentation tile.copies.setoid + (rectangleOverlap_equivalence s tile order first second) + (rectangleOverlapGraph_iff s tile order first second) + +end + +section +open SetRealization Compression.RecursiveMaps +universe u + +noncomputable def rectangleQuotientOrder (P Q r classifier : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ Q, ∃ y ∈ Q, z = ZFSet.pair x y ∧ + ∃ i ∈ natSetCode 3, ∃ a ∈ P, ∃ b ∈ P, + ZFSet.pair (ZFSet.pair i a) x ∈ classifier ∧ + ZFSet.pair (ZFSet.pair i b) y ∈ classifier ∧ ZFSet.pair a b ∈ r) + (ZFSet.prod Q Q) + +theorem mem_rectangleQuotientOrder (P Q r classifier z : ZFSet.{u}) : + z ∈ rectangleQuotientOrder P Q r classifier ↔ + ∃ x ∈ Q, ∃ y ∈ Q, z = ZFSet.pair x y ∧ + ∃ i ∈ natSetCode 3, ∃ a ∈ P, ∃ b ∈ P, + ZFSet.pair (ZFSet.pair i a) x ∈ classifier ∧ + ZFSet.pair (ZFSet.pair i b) y ∈ classifier ∧ ZFSet.pair a b ∈ r := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · intro h + obtain ⟨x, hx, y, hy, eq, rest⟩ := h + subst z + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, rest⟩ + +theorem pair_mem_rectangleQuotientOrder (P Q r classifier x y : ZFSet.{u}) : + ZFSet.pair x y ∈ rectangleQuotientOrder P Q r classifier ↔ + x ∈ Q ∧ y ∈ Q ∧ ∃ i ∈ natSetCode 3, ∃ a ∈ P, ∃ b ∈ P, + ZFSet.pair (ZFSet.pair i a) x ∈ classifier ∧ + ZFSet.pair (ZFSet.pair i b) y ∈ classifier ∧ ZFSet.pair a b ∈ r := by + rw [mem_rectangleQuotientOrder] + constructor + · rintro ⟨a, ha, b, hb, eq, rest⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨ha, hb, rest⟩ + · rintro ⟨hx, hy, rest⟩ + exact ⟨x, hx, y, hy, rfl, rest⟩ + +theorem rectangleQuotientOrder_subset (P Q r classifier : ZFSet.{u}) : + rectangleQuotientOrder P Q r classifier ⊆ ZFSet.prod Q Q := + fun _ h => (ZFSet.mem_sep.1 h).1 + +variable {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) +variable {r e1 e2 : ZFSet.{u}} +variable (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) +variable (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) +variable (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) + +noncomputable abbrev rectangleTileOrder := + rectangleQuotientOrder s.carrier (rectangleTilePresentation s tile order first second).carrier r + (equivalenceClassifier (rectangleLabelCarrier s.carrier) + (rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2)) + +include order first second + +theorem rectangleTileOrder_iff (x y : tile.copies.Node) : + ZFSet.pair ((rectangleTilePresentation s tile order first second).encode x) + ((rectangleTilePresentation s tile order first second).encode y) ∈ + rectangleTileOrder s tile order first second ↔ tile.copies.order.le x y := by + have classifier := (rectangleLabelPresentation s).quotientPresentation_classifier_entry_iff + tile.copies.setoid (rectangleOverlap_equivalence s tile order first second) + (rectangleOverlapGraph_iff s tile order first second) + rw [rectangleTileOrder, pair_mem_rectangleQuotientOrder] + simp only [(rectangleTilePresentation s tile order first second).encode_mem, true_and] + constructor + · rintro ⟨i, hi, a, ha, b, hb, ax, byEntry, ab⟩ + obtain ⟨i, rfl⟩ := (mem_three_iff_rectangleVertexCode i).1 hi + obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha + obtain ⟨b, rfl⟩ := (s.mem_carrier b).1 hb + have ex : tile.copies.point i a = x := (classifier (i, a) x).1 ax + have ey : tile.copies.point i b = y := (classifier (i, b) y).1 byEntry + rw [← ex, ← ey] + exact (tile.copies.vertex_le i a b).2 ((order a b).1 ab) + · intro lower + obtain ⟨i, a, b, ex, ey, ab⟩ := tile.copies.comparison_in_vertex x y lower + exact ⟨rectangleVertexCode i, rectangleVertexCode_mem i, s.encode a, s.encode_mem a, + s.encode b, s.encode_mem b, (classifier (i, a) x).2 ex, + (classifier (i, b) y).2 ey, (order a b).2 ab⟩ + +theorem rectangleTile_partialOrder : PartialOrderCode + (rectangleTilePresentation s tile order first second).carrier + (rectangleTileOrder s tile order first second) := by + let q := rectangleTilePresentation s tile order first second + have entries := rectangleTileOrder_iff s tile order first second + refine ⟨rectangleQuotientOrder_subset _ _ _ _, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx + exact (entries a a).2 (tile.copies.order.refl a) + · intro x hx y hy xy yx + obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (q.mem_carrier y).1 hy + exact congrArg q.encode (tile.copies.order.antisymm ((entries a b).1 xy) ((entries b a).1 yx)) + · intro x hx y hy z hz xy yz + obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (q.mem_carrier y).1 hy + obtain ⟨c, rfl⟩ := (q.mem_carrier z).1 hz + exact (entries a c).2 (tile.copies.order.trans ((entries a b).1 xy) ((entries b c).1 yz)) + +theorem rectangleTile_meet_glb (x y : tile.copies.Node) : + GreatestLowerBoundCode (rectangleTilePresentation s tile order first second).carrier + (rectangleTileOrder s tile order first second) + ((rectangleTilePresentation s tile order first second).encode x) + ((rectangleTilePresentation s tile order first second).encode y) + ((rectangleTilePresentation s tile order first second).encode (tile.copies.order.meet x y)) := by + let q := rectangleTilePresentation s tile order first second + have entries := rectangleTileOrder_iff s tile order first second + refine ⟨(entries _ _).2 (tile.copies.order.meet_le_left x y), + (entries _ _).2 (tile.copies.order.meet_le_right x y), ?_⟩ + intro z hz zx zy + obtain ⟨a, rfl⟩ := (q.mem_carrier z).1 hz + exact (entries _ _).2 (tile.copies.order.le_meet ((entries _ _).1 zx) ((entries _ _).1 zy)) + +theorem rectangleTile_meetOrder : MeetOrderCode + (rectangleTilePresentation s tile order first second).carrier + (rectangleTileOrder s tile order first second) + (canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier + (rectangleTileOrder s tile order first second)) := by + apply canonicalMeetGraph_code (rectangleTile_partialOrder s tile order first second) + intro x hx y hy + let q := rectangleTilePresentation s tile order first second + obtain ⟨a, rfl⟩ := (q.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (q.mem_carrier y).1 hy + exact ⟨q.encode (tile.copies.order.meet a b), q.encode_mem _, + rectangleTile_meet_glb s tile order first second a b⟩ + +theorem rectangleTile_meet_entry (x y : tile.copies.Node) : + ZFSet.pair (ZFSet.pair ((rectangleTilePresentation s tile order first second).encode x) + ((rectangleTilePresentation s tile order first second).encode y)) + ((rectangleTilePresentation s tile order first second).encode (tile.copies.order.meet x y)) ∈ + canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier + (rectangleTileOrder s tile order first second) := by + apply (pair_mem_canonicalMeetGraph _ _ _ _ _).2 + refine ⟨?_, ?_, ?_, rectangleTile_meet_glb s tile order first second x y⟩ <;> + exact (rectangleTilePresentation s tile order first second).encode_mem _ + +end + +section +open SetFormula SetRealization Compression.RecursiveMaps +universe u + +namespace BoundedFormula + +def rectangleQuotientOrderFormula {n} (z P Q r classifier three : Fin n) : BoundedFormula n := + exMem Q (exMem Q.succ + (.conj (orderedPairFormula z.succ.succ 1 0) + (exMem three.succ.succ (exMem P.succ.succ.succ (exMem P.succ.succ.succ.succ + (.conj (tripleMembershipFormula 2 1 4 classifier.succ.succ.succ.succ.succ) + (.conj (tripleMembershipFormula 2 0 3 classifier.succ.succ.succ.succ.succ) + (pairMembershipFormula 1 0 r.succ.succ.succ.succ.succ)))))))) + +theorem truth_rectangleQuotientOrderFormula {n} (z P Q r classifier three : Fin n) + (env : Fin n → ZFSet.{u}) (hthree : env three = natSetCode 3) : + Truth (rectangleQuotientOrderFormula z P Q r classifier three) env ↔ + env z ∈ rectangleQuotientOrder (env P) (env Q) (env r) (env classifier) := by + simp only [rectangleQuotientOrderFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_tripleMembershipFormula, truth_pairMembershipFormula, mem_rectangleQuotientOrder, + extend, Fin.cases_zero, Fin.cases_succ] + rw [hthree] + rfl + +end BoundedFormula + +namespace TransitiveGround + +theorem rectangleQuotientOrder_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P Q r classifier : ZFSet.{u}} (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) + (hr : r ∈ M.sets) (hc : classifier ∈ M.sets) : + rectangleQuotientOrder P Q r classifier ∈ M.sets := by + have hzero := M.empty_mem ⟨P, hP⟩ + have hone := M.insert_mem pairing unions hzero hzero + have htwo := M.insert_mem pairing unions hone hone + have hthree := M.insert_mem pairing unions htwo htwo + change (natSetCode 3 : ZFSet.{u}) ∈ M.sets at hthree + have bound := M.prod_mem pairing unions powers separation hQ hQ + let params := extend P (extend Q (extend r (extend classifier (extend (natSetCode 3) Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.rectangleQuotientOrderFormula 0 1 2 3 4 5) params + (Fin.cases hP (Fin.cases hQ (Fin.cases hr (Fin.cases hc + (Fin.cases hthree (fun i => Fin.elim0 i)))))) bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.rectangleQuotientOrderFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod Q Q) = rectangleQuotientOrder P Q r classifier := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_rectangleQuotientOrderFormula _ _ _ _ _ _ _ rfl] + change (z ∈ ZFSet.prod Q Q ∧ z ∈ rectangleQuotientOrder P Q r classifier) ↔ _ + exact ⟨And.right, fun hz => ⟨rectangleQuotientOrder_subset _ _ _ _ hz, hz⟩⟩ + exact eq ▸ selected + +theorem rectangleTile_ground (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) + {r e1 e2 : ZFSet.{u}} + (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) + (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) + (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) + (hP : s.carrier ∈ M.sets) (hr : r ∈ M.sets) (he1 : e1 ∈ M.sets) (he2 : e2 ∈ M.sets) : + (rectangleTilePresentation s tile order first second).carrier ∈ M.sets ∧ + rectangleTileOrder s tile order first second ∈ M.sets ∧ + canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier + (rectangleTileOrder s tile order first second) ∈ M.sets := by + have overlap := M.rectangleOverlapGraph_mem pairing unions powers separation hP hr + (M.transitive hP (s.encode_mem tile.C)) (M.transitive hP (s.encode_mem tile.B)) he1 he2 + have carrier := M.equivalenceClasses_mem powers separation overlap.1 overlap.2 + have classifier := M.equivalenceClassifier_mem pairing unions powers separation overlap.1 overlap.2 + have rel := M.rectangleQuotientOrder_mem pairing unions powers separation hP carrier hr classifier + exact ⟨carrier, rel, M.canonicalMeetGraph_mem pairing unions powers separation carrier rel⟩ + +end TransitiveGround + +end + +section +open SetRealization Compression.RecursiveMaps SetFormula +universe u +variable {A : Type u} (s : Presentation A) {p : MeetOrder A} (tile : Rectangle.Input p) +variable {r e1 e2 : ZFSet.{u}} +variable (order : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ p.le x y) +variable (first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e1 ↔ tile.g1.toFun x = y) +variable (second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ e2 ↔ tile.g2.toFun x = y) + +noncomputable def rectangleTileVertexGraph (i : Rectangle.Vertex) := + indexedRelationSection s.carrier (rectangleTilePresentation s tile order first second).carrier + (equivalenceClassifier (rectangleLabelCarrier s.carrier) + (rectangleOverlapGraph s.carrier r (s.encode tile.C) (s.encode tile.B) e1 e2)) + (rectangleVertexCode i) + +include order first second + +theorem rectangleTileVertexGraph_iff (i : Rectangle.Vertex) (x : A) (y : tile.copies.Node) : + ZFSet.pair (s.encode x) ((rectangleTilePresentation s tile order first second).encode y) ∈ + rectangleTileVertexGraph s tile order first second i ↔ tile.copies.point i x = y := by + rw [rectangleTileVertexGraph, pair_mem_indexedRelationSection] + simp only [s.encode_mem, (rectangleTilePresentation s tile order first second).encode_mem, true_and] + exact (rectangleLabelPresentation s).quotientPresentation_classifier_entry_iff + tile.copies.setoid (rectangleOverlap_equivalence s tile order first second) + (rectangleOverlapGraph_iff s tile order first second) (i, x) y + +theorem rectangleTileVertexGraph_eq (i : Rectangle.Vertex) : + rectangleTileVertexGraph s tile order first second i = + s.graph (rectangleTilePresentation s tile order first second) (tile.copies.point i) := by + apply s.relation_ext (rectangleTilePresentation s tile order first second) + (indexedRelationSection_subset _ _ _ _) (s.graph_isFunc _ _).1 + intro x y + change ZFSet.pair (s.encode x) ((rectangleTilePresentation s tile order first second).encode y) ∈ + rectangleTileVertexGraph s tile order first second i ↔ _ + rw [rectangleTileVertexGraph_iff, s.pair_mem_graph] + +theorem rectangleTileVertex_injection (i : Rectangle.Vertex) : + InjectionCode s.carrier (rectangleTilePresentation s tile order first second).carrier + (rectangleTileVertexGraph s tile order first second i) := by + rw [rectangleTileVertexGraph_eq] + exact s.graph_injection _ _ (tile.copies.vertex_injective i) + +theorem rectangleTileVertex_order_iff (i : Rectangle.Vertex) {x y x' y' : ZFSet.{u}} + (hx : ZFSet.pair x x' ∈ rectangleTileVertexGraph s tile order first second i) + (hy : ZFSet.pair y y' ∈ rectangleTileVertexGraph s tile order first second i) : + ZFSet.pair x' y' ∈ rectangleTileOrder s tile order first second ↔ ZFSet.pair x y ∈ r := by + rw [rectangleTileVertexGraph_eq] at hx hy + obtain ⟨a, ha⟩ := (s.mem_graph _ _ _).1 hx + obtain ⟨b, hb⟩ := (s.mem_graph _ _ _).1 hy + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ha + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 hb + exact (rectangleTileOrder_iff s tile order first second _ _).trans + ((tile.copies.vertex_le i a b).trans (order a b).symm) + +theorem rectangleTileVertex_embedding {μ : ZFSet.{u}} (source : MeetOrderCode s.carrier r μ) + (meet : ∀ x y, ZFSet.pair (ZFSet.pair (s.encode x) (s.encode y)) (s.encode (p.meet x y)) ∈ μ) + (i : Rectangle.Vertex) : + MeetEmbeddingCode s.carrier (rectangleTilePresentation s tile order first second).carrier + r (rectangleTileOrder s tile order first second) μ + (canonicalMeetGraph (rectangleTilePresentation s tile order first second).carrier + (rectangleTileOrder s tile order first second)) + (rectangleTileVertexGraph s tile order first second i) := by + refine ⟨rectangleTileVertex_injection s tile order first second i, ?_, ?_⟩ + · intro x y x' y' lower hx hy + exact (rectangleTileVertex_order_iff s tile order first second i hx hy).2 lower + · intro x y z x' y' z' mxy hx hy hz + rw [rectangleTileVertexGraph_eq] at hx hy hz + obtain ⟨a, ha⟩ := (s.mem_graph _ _ _).1 hx + obtain ⟨b, hb⟩ := (s.mem_graph _ _ _).1 hy + obtain ⟨c, hc⟩ := (s.mem_graph _ _ _).1 hz + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ha + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 hb + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 hc + obtain ⟨w, _, unique⟩ := source.operation.2 + (ZFSet.pair (s.encode a) (s.encode b)) (ZFSet.pair_mem_prod.2 ⟨s.encode_mem a, s.encode_mem b⟩) + have equal : c = p.meet a b := s.injective ((unique _ mxy).trans (unique _ (meet a b)).symm) + subst c + have mapped := (tile.copies.vertex i).map_meet a b + change tile.copies.point i (p.meet a b) = _ at mapped + rw [mapped] + exact rectangleTile_meet_entry s tile order first second _ _ + +theorem rectangleTileVertex_cover (z : ZFSet.{u}) + (hz : z ∈ (rectangleTilePresentation s tile order first second).carrier) : + ∃ i : Rectangle.Vertex, ∃ x ∈ s.carrier, + ZFSet.pair x z ∈ rectangleTileVertexGraph s tile order first second i := by + obtain ⟨a, rfl⟩ := ((rectangleTilePresentation s tile order first second).mem_carrier z).1 hz + obtain ⟨i, x, hx⟩ := tile.copies.cover a + exact ⟨i, s.encode x, s.encode_mem x, (rectangleTileVertexGraph_iff s tile order first second i x a).2 hx⟩ + +theorem rectangleTileVertex_overlap (i j : Rectangle.Vertex) (x y : A) : + (rectangleTilePresentation s tile order first second).encode (tile.copies.point i x) = + (rectangleTilePresentation s tile order first second).encode (tile.copies.point j y) ↔ + tile.copies.Related (i, x) (j, y) := + (rectangleTilePresentation s tile order first second).injective.eq_iff.trans + (tile.copies.mk_eq_mk i j x y) + +theorem rectangleTileVertex_ideal (i : Rectangle.Vertex) (x : A) {z : ZFSet.{u}} + (hz : z ∈ (rectangleTilePresentation s tile order first second).carrier) + (lower : ZFSet.pair z ((rectangleTilePresentation s tile order first second).encode + (tile.copies.point i x)) ∈ rectangleTileOrder s tile order first second) : + ∃ y ∈ s.carrier, ZFSet.pair y z ∈ rectangleTileVertexGraph s tile order first second i := by + obtain ⟨a, rfl⟩ := ((rectangleTilePresentation s tile order first second).mem_carrier z).1 hz + obtain ⟨y, eq⟩ := tile.copies.vertex_ideal i x a ((rectangleTileOrder_iff s tile order first second _ _).1 lower) + exact ⟨s.encode y, s.encode_mem y, (rectangleTileVertexGraph_iff s tile order first second i y a).2 eq⟩ + +theorem TransitiveGround.rectangleTileVertexGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hP : s.carrier ∈ M.sets) (hr : r ∈ M.sets) (he1 : e1 ∈ M.sets) (he2 : e2 ∈ M.sets) + (i : Rectangle.Vertex) : rectangleTileVertexGraph s tile order first second i ∈ M.sets := by + have overlap := M.rectangleOverlapGraph_mem pairing unions powers separation hP hr + (M.transitive hP (s.encode_mem tile.C)) (M.transitive hP (s.encode_mem tile.B)) he1 he2 + have carrier := M.equivalenceClasses_mem powers separation overlap.1 overlap.2 + have classifier := M.equivalenceClassifier_mem pairing unions powers separation overlap.1 overlap.2 + have hzero := M.empty_mem ⟨s.carrier, hP⟩ + have hone := M.insert_mem pairing unions hzero hzero + have htwo := M.insert_mem pairing unions hone hone + have hi : rectangleVertexCode i ∈ M.sets := by + cases i + · exact hzero + · exact hone + · exact htwo + exact M.indexedRelationSection_mem pairing unions powers separation hP carrier classifier hi + +end + +section +open SetRealization Compression.RecursiveMaps SetFormula +universe u + +variable {P G r μ A m inv one c b d g h : ZFSet.{u}} + +theorem PosetActionCode.section_small_iff (action : PosetActionCode G P m one r A) + (actor : SetMembers G) (x y : SetMembers P) : + ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ + indexedRelationSection P P A (SetMembers.raw actor) ↔ action.act actor x = y := by + rw [pair_mem_indexedRelationSection] + simp only [SetMembers.raw_mem, true_and] + exact (action.act_eq_iff actor x y).symm + +theorem ExternalRectangleCode.exists_ground_tile + (code : ExternalRectangleCode P G r μ A c b d g h) + (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (top : SetMembers P) + (greatest : ∀ x, meet.toSmallMeetOrder.le x top) + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hA : A ∈ M.sets) : + let tile := (code.toSmallActionRectangle group action meet).toInput top greatest + ∃ q : Presentation tile.copies.Node, ∃ rel μt : ZFSet.{u}, ∃ vertices : Rectangle.Vertex → ZFSet.{u}, + q.carrier = equivalenceClasses (rectangleLabelCarrier P) + (rectangleOverlapGraph P r c b (indexedRelationSection P P A g) (indexedRelationSection P P A h)) ∧ + q.carrier ∈ M.sets ∧ rel ∈ M.sets ∧ μt ∈ M.sets ∧ + MeetOrderCode q.carrier rel μt ∧ + (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ rel ↔ tile.copies.order.le x y) ∧ + (∀ x y, ZFSet.pair (ZFSet.pair (q.encode x) (q.encode y)) + (q.encode (tile.copies.order.meet x y)) ∈ μt) ∧ + (∀ i, vertices i ∈ M.sets ∧ MeetEmbeddingCode P q.carrier r rel μ μt (vertices i)) ∧ + (∀ i x y, ZFSet.pair (SetMembers.raw x) (q.encode y) ∈ vertices i ↔ tile.copies.point i x = y) := by + dsimp only + let request := code.toSmallActionRectangle group action meet + let tile := request.toInput top greatest + let s := SetMembers.presentation P + have fields := code.toSmallActionRectangle_fields group action meet + have related : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ r ↔ meet.toSmallMeetOrder.le x y := + fun _ _ => Iff.rfl + have first : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A g ↔ + tile.g1.toFun x = y := by + intro x y + have entry := action.section_small_iff request.first x y + change ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A + (SetMembers.raw request.first) ↔ tile.g1.toFun x = y at entry + rw [show SetMembers.raw request.first = g from fields.2.2.2.1] at entry + exact entry + have second : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A h ↔ + tile.g2.toFun x = y := by + intro x y + have entry := action.section_small_iff request.second x y + change ZFSet.pair (s.encode x) (s.encode y) ∈ indexedRelationSection P P A + (SetMembers.raw request.second) ↔ tile.g2.toFun x = y at entry + rw [show SetMembers.raw request.second = h from fields.2.2.2.2] at entry + exact entry + have e1 := M.indexedRelationSection_mem pairing unions powers separation hP hP hA + (M.transitive hG code.2.2.2.1) + have e2 := M.indexedRelationSection_mem pairing unions powers separation hP hP hA + (M.transitive hG code.2.2.2.2.1) + let q := rectangleTilePresentation s tile related first second + let rel := rectangleTileOrder s tile related first second + let μt := canonicalMeetGraph q.carrier rel + let vertices := rectangleTileVertexGraph s tile related first second + have ground := M.rectangleTile_ground pairing unions powers separation s tile related first second hP hr e1 e2 + refine ⟨q, rel, μt, vertices, ?_, ground.1, ground.2.1, ground.2.2, + rectangleTile_meetOrder s tile related first second, + rectangleTileOrder_iff s tile related first second, + rectangleTile_meet_entry s tile related first second, ?_, ?_⟩ + · change equivalenceClasses (rectangleLabelCarrier P) + (rectangleOverlapGraph P r (SetMembers.raw request.C) (SetMembers.raw request.B) + (indexedRelationSection P P A g) (indexedRelationSection P P A h)) = _ + rw [fields.1, fields.2.1] + · intro i + exact ⟨TransitiveGround.rectangleTileVertexGraph_mem s tile related first second M + pairing unions powers separation hP hr e1 e2 i, + rectangleTileVertex_embedding s tile related first second meet meet.smallMeet_entry i⟩ + · exact rectangleTileVertexGraph_iff s tile related first second + +end + +open SetRealization Compression.RecursiveMaps SetFormula +universe u +variable {P G r μ A m inv one C B E g k H rH old D rD c lo hi : ZFSet.{u}} + +theorem ExternalRectangleCode.exists_ground_height + (request : ExternalRectangleCode P G r μ A C B E g k) + (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (top : SetMembers P) + (greatest : ∀ x, meet.toSmallMeetOrder.le x top) + (height : StrictHeightGraphCode P H r rH old) (linear : StrictLinearOrderCode H rH) + (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hA : A ∈ M.sets) + (hH : H ∈ M.sets) (hOld : old ∈ M.sets) (hrH : rH ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (small : M.groundEmbeddable (relationImage P H old) ZFSet.omega) + (hlo : lo ∈ D) (hhi : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : + let tile := (request.toSmallActionRectangle group action meet).toInput top greatest + ∃ q : Presentation tile.copies.Node, ∃ rel ν h : ZFSet.{u}, + q.carrier = equivalenceClasses (rectangleLabelCarrier P) + (rectangleOverlapGraph P r C B (indexedRelationSection P P A g) (indexedRelationSection P P A k)) ∧ + q.carrier ∈ M.sets ∧ rel ∈ M.sets ∧ ν ∈ M.sets ∧ + MeetOrderCode q.carrier rel ν ∧ + (∀ x y, ZFSet.pair (q.encode x) (q.encode y) ∈ rel ↔ tile.copies.order.le x y) ∧ + h ∈ M.sets ∧ IntervalHeightCode q.carrier rel D rD lo hi h ∧ + relationImage q.carrier D h ∈ M.sets ∧ + M.groundEmbeddable (relationImage q.carrier D h) ZFSet.omega := by + dsimp only + let rectangle := (request.toSmallActionRectangle group action meet).toInput top greatest + obtain ⟨q, rel, ν, vertices, carrier, hL, hRel, hν, tileMeet, related, meetEntries, vertexCodes, entries⟩ := + request.exists_ground_tile M pairing unions powers separation group action meet top greatest hP hG hr hA + let tile := TileRequests.Tile.rectangle rectangle + let s := SetMembers.presentation P + have vertexGround (i : Rectangle.Vertex) : s.graph q (rectangle.copies.point i) ∈ M.sets := by + have function := (vertexCodes i).2.injection.function + have equal : s.decodeFunction q (vertices i) function = rectangle.copies.point i := by + funext x + apply (s.decodeFunction_iff q (vertices i) function x _).2 + exact (entries i x _).2 rfl + rw [← equal, s.graph_decodeFunction q (vertices i) function] + exact (vertexCodes i).1 + have seedGround : s.graph (SetMembers.presentation H) (height.smallHeight meet linear).value ∈ M.sets := by + rw [height.smallHeight_graph] + exact hOld + have seedSmall : M.groundEmbeddable (relationImage P H + (s.graph (SetMembers.presentation H) (height.smallHeight meet linear).value)) ZFSet.omega := by + rw [height.smallHeight_graph] + exact small + obtain ⟨h, hground, code, rangeGround, rangeSmall⟩ := + M.exists_rectangleTileIntervalHeight pairing unions powers separation collection infinite + s (SetMembers.presentation H) top greatest linear.smallOrder (height.smallHeight meet linear) + (fun _ _ => Iff.rfl) linear target injection hP hH seedGround hrH hD hrD hc seedSmall hlo hhi gap + tile q hL hν related tileMeet.operation meetEntries + (vertexGround .root) (vertexGround .one) (vertexGround .two) + exact ⟨q, rel, ν, h, carrier, hL, hRel, hν, tileMeet, related, hground, code, rangeGround, rangeSmall⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRetainedPreparationSelections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRetainedPreparationSelections.lean index 380583501ca781f447e96e6fcc1d72071de10633..4ccc5d433ec49d3e16ba0162d0f9fd2eb25d169b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRetainedPreparationSelections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRetainedPreparationSelections.lean @@ -1,142 +1,142 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundVaryingPreparationRelations - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def retainedPreparationSelections (_M : TransitiveGround.{u}) - (A L R p levels : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x alpha row sourceA tail, - z = ZFSet.pair x (ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail)) ∧ - ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row sourceA)) (ZFSet.pair p tail) ∈ R ∧ - sourceA ⊆ A ∧ x ∈ sourceA ∧ ZFSet.pair x alpha ∈ levels) (ZFSet.prod A L) - -theorem pair_mem_retainedPreparationSelections (A L R p levels x y : ZFSet.{u}) : - ZFSet.pair x y ∈ M.retainedPreparationSelections A L R p levels ↔ - x ∈ A ∧ y ∈ L ∧ ∃ alpha row sourceA tail, - y = ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail) ∧ - ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row sourceA)) (ZFSet.pair p tail) ∈ R ∧ - sourceA ⊆ A ∧ x ∈ sourceA ∧ ZFSet.pair x alpha ∈ levels := by - rw [retainedPreparationSelections, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hx, hy⟩, x', alpha, row, sourceA, tail, equal, rest⟩ - obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, hy, alpha, row, sourceA, tail, value, rest⟩ - · rintro ⟨hx, hy, alpha, row, sourceA, tail, equal, rest⟩ - exact ⟨⟨hx, hy⟩, x, alpha, row, sourceA, tail, congrArg (ZFSet.pair x) equal, rest⟩ - -private def selectionBody {n} (z A R p levels : Fin n) : BoundedFormula (n + 10) := - let old := suffixIndex n 10 - let v := prefixIndex n 10 - .conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)) - (.conj (BoundedFormula.orderedPairFormula (v 1) (v 2) (v 9)) - (.conj (BoundedFormula.orderedPairFormula (v 9) (v 3) (v 6)) - (.conj (BoundedFormula.orderedPairFormula (v 3) (v 4) (v 5)) - (.conj (BoundedFormula.orderedPairFormula (v 7) (v 2) (v 3)) - (.conj (BoundedFormula.orderedPairFormula (v 8) (old p) (v 6)) - (.conj (BoundedFormula.pairMembershipFormula (v 7) (v 8) (old R)) - (.conj (.allMem (v 5) (.mem 0 (old A).succ)) - (.conj (.mem (v 0) (v 5)) - (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old levels)))))))))) - -private def selectionFormula {n} (z A R p levels : Fin n) : SetFormula n := - exBlock 10 (selectionBody z A R p levels).toFormula - -private theorem realize_selectionFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {n} (z A R p levels : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (selectionFormula z A R p levels) env ↔ - ∃ x alpha row sourceA tail, - env z = ZFSet.pair x (ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail)) ∧ - ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row sourceA)) (ZFSet.pair (env p) tail) ∈ env R ∧ - sourceA ⊆ env A ∧ x ∈ sourceA ∧ ZFSet.pair x alpha ∈ env levels := by - rw [selectionFormula, realize_exBlock] - have actual (w : Fin 10 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : - Realize M.sets (selectionBody z A R p levels).toFormula (extendMany 10 w env) ↔ - env z = ZFSet.pair (w 0) (w 1) ∧ w 1 = ZFSet.pair (w 2) (w 9) ∧ - w 9 = ZFSet.pair (w 3) (w 6) ∧ w 3 = ZFSet.pair (w 4) (w 5) ∧ - w 7 = ZFSet.pair (w 2) (w 3) ∧ w 8 = ZFSet.pair (env p) (w 6) ∧ - ZFSet.pair (w 7) (w 8) ∈ env R ∧ w 5 ⊆ env A ∧ w 0 ∈ w 5 ∧ - ZFSet.pair (w 0) (w 2) ∈ env levels := by - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 10 w env ground members)] - simp only [selectionBody, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, - BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix] - rfl - constructor - · rintro ⟨w, ground, body⟩ - obtain ⟨outer, value, output, source, input, prepared, edge, subset, member, level⟩ := - (actual w ground).1 body - refine ⟨w 0, w 2, w 4, w 5, w 6, ?_, ?_, subset, member, level⟩ - · simpa only [value, output, source] using outer - · simpa only [input, prepared, source] using edge - · rintro ⟨x, alpha, row, sourceA, tail, equal, edge, subset, member, level⟩ - have hz := equal ▸ members z - have hx := M.pair_left hz - have hy := M.pair_right hz - have ha := M.pair_left hy - have hout := M.pair_right hy - have hsource := M.pair_left hout - have htail := M.pair_right hout - have hinput := M.orderedPair_mem pairing ha hsource - have hprepared := M.orderedPair_mem pairing (members p) htail - let w : Fin 10 → ZFSet.{u} := ![x, ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail), - alpha, ZFSet.pair row sourceA, row, sourceA, tail, - ZFSet.pair alpha (ZFSet.pair row sourceA), ZFSet.pair (env p) tail, - ZFSet.pair (ZFSet.pair row sourceA) tail] - have ground : ∀ j, w j ∈ M.sets := Fin.cases hx (Fin.cases hy (Fin.cases ha - (Fin.cases hsource (Fin.cases (M.pair_left hsource) (Fin.cases (M.pair_right hsource) - (Fin.cases htail (Fin.cases hinput (Fin.cases hprepared - (Fin.cases hout (fun j => Fin.elim0 j)))))))))) - exact ⟨w, ground, (actual w ground).2 - ⟨equal, rfl, rfl, rfl, rfl, rfl, edge, subset, member, level⟩⟩ - -theorem retainedPreparationSelections_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A L R p levels : ZFSet.{u}} (hA : A ∈ M.sets) (hL : L ∈ M.sets) - (hR : R ∈ M.sets) (hp : p ∈ M.sets) (hLevels : levels ∈ M.sets) : - M.retainedPreparationSelections A L R p levels ∈ M.sets := by - let params : Fin 4 → ZFSet.{u} := ![A, R, p, levels] - have ground : ∀ j, params j ∈ M.sets := Fin.cases hA (Fin.cases hR - (Fin.cases hp (Fin.cases hLevels (fun j => Fin.elim0 j)))) - have bound := M.prod_mem pairing unions powers separation hA hL - have selected := M.separation_mem separation (selectionFormula 0 1 2 3 4) params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets (selectionFormula 0 1 2 3 4) - (extend z params)) (ZFSet.prod A L) = M.retainedPreparationSelections A L R p levels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, retainedPreparationSelections, ZFSet.mem_sep] - apply and_congr_right - intro hz - exact realize_selectionFormula M pairing 0 1 2 3 4 (extend z params) - (Fin.cases (M.transitive bound hz) ground) - exact equal ▸ selected - -theorem exists_retainedPreparationSelection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A L R p levels : ZFSet.{u}} (hA : A ∈ M.sets) (hL : L ∈ M.sets) - (hR : R ∈ M.sets) (hp : p ∈ M.sets) (hLevels : levels ∈ M.sets) - (smallA : M.groundEmbeddable A ZFSet.omega) - (total : ∀ x ∈ A, ∃ y ∈ L, - ZFSet.pair x y ∈ M.retainedPreparationSelections A L R p levels) : - ∃ f ∈ M.sets, ZFSet.IsFunc A L f ∧ - f ⊆ M.retainedPreparationSelections A L R p levels ∧ - relationImage A L f ∈ M.sets ∧ M.groundEmbeddable (relationImage A L f) ZFSet.omega := - M.exists_countableRelationSelection pairing unions powers separation infinite choice hA hL - (M.retainedPreparationSelections_mem pairing unions powers separation hA hL hR hp hLevels) - smallA total - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundVaryingPreparationRelations + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def retainedPreparationSelections (_M : TransitiveGround.{u}) + (A L R p levels : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x alpha row sourceA tail, + z = ZFSet.pair x (ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail)) ∧ + ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row sourceA)) (ZFSet.pair p tail) ∈ R ∧ + sourceA ⊆ A ∧ x ∈ sourceA ∧ ZFSet.pair x alpha ∈ levels) (ZFSet.prod A L) + +theorem pair_mem_retainedPreparationSelections (A L R p levels x y : ZFSet.{u}) : + ZFSet.pair x y ∈ M.retainedPreparationSelections A L R p levels ↔ + x ∈ A ∧ y ∈ L ∧ ∃ alpha row sourceA tail, + y = ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail) ∧ + ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row sourceA)) (ZFSet.pair p tail) ∈ R ∧ + sourceA ⊆ A ∧ x ∈ sourceA ∧ ZFSet.pair x alpha ∈ levels := by + rw [retainedPreparationSelections, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hx, hy⟩, x', alpha, row, sourceA, tail, equal, rest⟩ + obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, hy, alpha, row, sourceA, tail, value, rest⟩ + · rintro ⟨hx, hy, alpha, row, sourceA, tail, equal, rest⟩ + exact ⟨⟨hx, hy⟩, x, alpha, row, sourceA, tail, congrArg (ZFSet.pair x) equal, rest⟩ + +private def selectionBody {n} (z A R p levels : Fin n) : BoundedFormula (n + 10) := + let old := suffixIndex n 10 + let v := prefixIndex n 10 + .conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)) + (.conj (BoundedFormula.orderedPairFormula (v 1) (v 2) (v 9)) + (.conj (BoundedFormula.orderedPairFormula (v 9) (v 3) (v 6)) + (.conj (BoundedFormula.orderedPairFormula (v 3) (v 4) (v 5)) + (.conj (BoundedFormula.orderedPairFormula (v 7) (v 2) (v 3)) + (.conj (BoundedFormula.orderedPairFormula (v 8) (old p) (v 6)) + (.conj (BoundedFormula.pairMembershipFormula (v 7) (v 8) (old R)) + (.conj (.allMem (v 5) (.mem 0 (old A).succ)) + (.conj (.mem (v 0) (v 5)) + (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old levels)))))))))) + +private def selectionFormula {n} (z A R p levels : Fin n) : SetFormula n := + exBlock 10 (selectionBody z A R p levels).toFormula + +private theorem realize_selectionFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {n} (z A R p levels : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (selectionFormula z A R p levels) env ↔ + ∃ x alpha row sourceA tail, + env z = ZFSet.pair x (ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail)) ∧ + ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row sourceA)) (ZFSet.pair (env p) tail) ∈ env R ∧ + sourceA ⊆ env A ∧ x ∈ sourceA ∧ ZFSet.pair x alpha ∈ env levels := by + rw [selectionFormula, realize_exBlock] + have actual (w : Fin 10 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) : + Realize M.sets (selectionBody z A R p levels).toFormula (extendMany 10 w env) ↔ + env z = ZFSet.pair (w 0) (w 1) ∧ w 1 = ZFSet.pair (w 2) (w 9) ∧ + w 9 = ZFSet.pair (w 3) (w 6) ∧ w 3 = ZFSet.pair (w 4) (w 5) ∧ + w 7 = ZFSet.pair (w 2) (w 3) ∧ w 8 = ZFSet.pair (env p) (w 6) ∧ + ZFSet.pair (w 7) (w 8) ∈ env R ∧ w 5 ⊆ env A ∧ w 0 ∈ w 5 ∧ + ZFSet.pair (w 0) (w 2) ∈ env levels := by + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 10 w env ground members)] + simp only [selectionBody, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula, + BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix] + rfl + constructor + · rintro ⟨w, ground, body⟩ + obtain ⟨outer, value, output, source, input, prepared, edge, subset, member, level⟩ := + (actual w ground).1 body + refine ⟨w 0, w 2, w 4, w 5, w 6, ?_, ?_, subset, member, level⟩ + · simpa only [value, output, source] using outer + · simpa only [input, prepared, source] using edge + · rintro ⟨x, alpha, row, sourceA, tail, equal, edge, subset, member, level⟩ + have hz := equal ▸ members z + have hx := M.pair_left hz + have hy := M.pair_right hz + have ha := M.pair_left hy + have hout := M.pair_right hy + have hsource := M.pair_left hout + have htail := M.pair_right hout + have hinput := M.orderedPair_mem pairing ha hsource + have hprepared := M.orderedPair_mem pairing (members p) htail + let w : Fin 10 → ZFSet.{u} := ![x, ZFSet.pair alpha (ZFSet.pair (ZFSet.pair row sourceA) tail), + alpha, ZFSet.pair row sourceA, row, sourceA, tail, + ZFSet.pair alpha (ZFSet.pair row sourceA), ZFSet.pair (env p) tail, + ZFSet.pair (ZFSet.pair row sourceA) tail] + have ground : ∀ j, w j ∈ M.sets := Fin.cases hx (Fin.cases hy (Fin.cases ha + (Fin.cases hsource (Fin.cases (M.pair_left hsource) (Fin.cases (M.pair_right hsource) + (Fin.cases htail (Fin.cases hinput (Fin.cases hprepared + (Fin.cases hout (fun j => Fin.elim0 j)))))))))) + exact ⟨w, ground, (actual w ground).2 + ⟨equal, rfl, rfl, rfl, rfl, rfl, edge, subset, member, level⟩⟩ + +theorem retainedPreparationSelections_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A L R p levels : ZFSet.{u}} (hA : A ∈ M.sets) (hL : L ∈ M.sets) + (hR : R ∈ M.sets) (hp : p ∈ M.sets) (hLevels : levels ∈ M.sets) : + M.retainedPreparationSelections A L R p levels ∈ M.sets := by + let params : Fin 4 → ZFSet.{u} := ![A, R, p, levels] + have ground : ∀ j, params j ∈ M.sets := Fin.cases hA (Fin.cases hR + (Fin.cases hp (Fin.cases hLevels (fun j => Fin.elim0 j)))) + have bound := M.prod_mem pairing unions powers separation hA hL + have selected := M.separation_mem separation (selectionFormula 0 1 2 3 4) params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets (selectionFormula 0 1 2 3 4) + (extend z params)) (ZFSet.prod A L) = M.retainedPreparationSelections A L R p levels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, retainedPreparationSelections, ZFSet.mem_sep] + apply and_congr_right + intro hz + exact realize_selectionFormula M pairing 0 1 2 3 4 (extend z params) + (Fin.cases (M.transitive bound hz) ground) + exact equal ▸ selected + +theorem exists_retainedPreparationSelection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A L R p levels : ZFSet.{u}} (hA : A ∈ M.sets) (hL : L ∈ M.sets) + (hR : R ∈ M.sets) (hp : p ∈ M.sets) (hLevels : levels ∈ M.sets) + (smallA : M.groundEmbeddable A ZFSet.omega) + (total : ∀ x ∈ A, ∃ y ∈ L, + ZFSet.pair x y ∈ M.retainedPreparationSelections A L R p levels) : + ∃ f ∈ M.sets, ZFSet.IsFunc A L f ∧ + f ⊆ M.retainedPreparationSelections A L R p levels ∧ + relationImage A L f ∈ M.sets ∧ M.groundEmbeddable (relationImage A L f) ZFSet.omega := + M.exists_countableRelationSelection pairing unions powers separation infinite choice hA hL + (M.retainedPreparationSelections_mem pairing unions powers separation hA hL hR hp hLevels) + smallA total + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentCuts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentCuts.lean index 203a2418d7242d294b334e0c23f4c64435465e26..a3f3efecd38803e57dc28fcb405f5c7d1d16bb17 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentCuts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentCuts.lean @@ -1,115 +1,115 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FlatLimitConditionFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -noncomputable def rowAssignmentCutGraph (upper lower levels alpha : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ row A, - z = ZFSet.pair (ZFSet.pair row A) (ZFSet.pair row (assignmentCut levels alpha A))) - (ZFSet.prod upper lower) - -theorem mem_rowAssignmentCutGraph (upper lower levels alpha z : ZFSet.{u}) : - z ∈ rowAssignmentCutGraph upper lower levels alpha ↔ - z ∈ ZFSet.prod upper lower ∧ ∃ row A, - z = ZFSet.pair (ZFSet.pair row A) (ZFSet.pair row (assignmentCut levels alpha A)) := - ZFSet.mem_sep - -theorem pair_mem_rowAssignmentCutGraph (upper lower levels alpha row A target : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair row A) target ∈ rowAssignmentCutGraph upper lower levels alpha ↔ - ZFSet.pair row A ∈ upper ∧ target ∈ lower ∧ - target = ZFSet.pair row (assignmentCut levels alpha A) := by - rw [mem_rowAssignmentCutGraph, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hp, ht⟩, row', A', equal⟩ - obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left - exact ⟨hp, ht, right⟩ - · rintro ⟨hp, ht, rfl⟩ - exact ⟨⟨hp, ht⟩, row, A, rfl⟩ - -namespace SetFormula -private def rowAssignmentCutBody {n : Nat} (z levels alpha : Fin n) : BoundedFormula (n + 5) := - let old := suffixIndex n 5 - let v := prefixIndex n 5 - .conj (BoundedFormula.orderedPairFormula (old z) (v 3) (v 4)) - (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 1)) - (.conj (BoundedFormula.orderedPairFormula (v 4) (v 0) (v 2)) - (BoundedFormula.assignmentCutFormula (v 2) (old levels) (old alpha) (v 1)))) - -def rowAssignmentCutFormula {n : Nat} (z levels alpha : Fin n) : SetFormula n := - exBlock 5 (rowAssignmentCutBody z levels alpha).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_rowAssignmentCutFormula {n : Nat} (z levels alpha : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (rowAssignmentCutFormula z levels alpha) env ↔ - ∃ row A, env z = ZFSet.pair (ZFSet.pair row A) - (ZFSet.pair row (assignmentCut (env levels) (env alpha) A)) := by - rw [rowAssignmentCutFormula, realize_exBlock] - have actual (f : Fin 5 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - Realize M.sets (SetFormula.rowAssignmentCutBody z levels alpha).toFormula - (extendMany 5 f env) ↔ - env z = ZFSet.pair (f 3) (f 4) ∧ f 3 = ZFSet.pair (f 0) (f 1) ∧ - f 4 = ZFSet.pair (f 0) (f 2) ∧ - f 2 = assignmentCut (env levels) (env alpha) (f 1) := by - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members)] - simp only [SetFormula.rowAssignmentCutBody, BoundedFormula.Truth, - BoundedFormula.truth_orderedPairFormula, BoundedFormula.truth_assignmentCutFormula, - extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, body⟩ - obtain ⟨equal, upper, lower, cut⟩ := (actual f ground).1 body - rw [upper, lower, cut] at equal - exact ⟨f 0, f 1, equal⟩ - · rintro ⟨row, A, equal⟩ - have pairGround := equal ▸ members z - have upper := M.pair_left pairGround - have lower := M.pair_right pairGround - let cut := assignmentCut (env levels) (env alpha) A - let f : Fin 5 → ZFSet.{u} := ![row, A, cut, ZFSet.pair row A, ZFSet.pair row cut] - have ground : ∀ j, f j ∈ M.sets := - Fin.cases (M.pair_left upper) (Fin.cases (M.pair_right upper) - (Fin.cases (M.pair_right lower) (Fin.cases upper - (Fin.cases lower (fun j => Fin.elim0 j))))) - exact ⟨f, ground, (actual f ground).2 ⟨equal, rfl, rfl, rfl⟩⟩ - -theorem rowAssignmentCutGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {upper lower levels alpha : ZFSet.{u}} - (hUpper : upper ∈ M.sets) (hLower : lower ∈ M.sets) - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) : - rowAssignmentCutGraph upper lower levels alpha ∈ M.sets := by - let params : Fin 2 → ZFSet.{u} := ![levels, alpha] - have ground : ∀ j, params j ∈ M.sets := - Fin.cases hLevels (Fin.cases hAlpha (fun j => Fin.elim0 j)) - have bound := M.prod_mem pairing unions powers separation hUpper hLower - have selected := M.separation_mem separation (rowAssignmentCutFormula 0 1 2) params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets (rowAssignmentCutFormula 0 1 2) (extend z params)) - (ZFSet.prod upper lower) = rowAssignmentCutGraph upper lower levels alpha := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, mem_rowAssignmentCutGraph] - apply and_congr_right - intro hz - exact M.realize_rowAssignmentCutFormula 0 1 2 (extend z params) - (Fin.cases (M.transitive bound hz) ground) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FlatLimitConditionFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +noncomputable def rowAssignmentCutGraph (upper lower levels alpha : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ row A, + z = ZFSet.pair (ZFSet.pair row A) (ZFSet.pair row (assignmentCut levels alpha A))) + (ZFSet.prod upper lower) + +theorem mem_rowAssignmentCutGraph (upper lower levels alpha z : ZFSet.{u}) : + z ∈ rowAssignmentCutGraph upper lower levels alpha ↔ + z ∈ ZFSet.prod upper lower ∧ ∃ row A, + z = ZFSet.pair (ZFSet.pair row A) (ZFSet.pair row (assignmentCut levels alpha A)) := + ZFSet.mem_sep + +theorem pair_mem_rowAssignmentCutGraph (upper lower levels alpha row A target : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair row A) target ∈ rowAssignmentCutGraph upper lower levels alpha ↔ + ZFSet.pair row A ∈ upper ∧ target ∈ lower ∧ + target = ZFSet.pair row (assignmentCut levels alpha A) := by + rw [mem_rowAssignmentCutGraph, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hp, ht⟩, row', A', equal⟩ + obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left + exact ⟨hp, ht, right⟩ + · rintro ⟨hp, ht, rfl⟩ + exact ⟨⟨hp, ht⟩, row, A, rfl⟩ + +namespace SetFormula +private def rowAssignmentCutBody {n : Nat} (z levels alpha : Fin n) : BoundedFormula (n + 5) := + let old := suffixIndex n 5 + let v := prefixIndex n 5 + .conj (BoundedFormula.orderedPairFormula (old z) (v 3) (v 4)) + (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 1)) + (.conj (BoundedFormula.orderedPairFormula (v 4) (v 0) (v 2)) + (BoundedFormula.assignmentCutFormula (v 2) (old levels) (old alpha) (v 1)))) + +def rowAssignmentCutFormula {n : Nat} (z levels alpha : Fin n) : SetFormula n := + exBlock 5 (rowAssignmentCutBody z levels alpha).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_rowAssignmentCutFormula {n : Nat} (z levels alpha : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (rowAssignmentCutFormula z levels alpha) env ↔ + ∃ row A, env z = ZFSet.pair (ZFSet.pair row A) + (ZFSet.pair row (assignmentCut (env levels) (env alpha) A)) := by + rw [rowAssignmentCutFormula, realize_exBlock] + have actual (f : Fin 5 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + Realize M.sets (SetFormula.rowAssignmentCutBody z levels alpha).toFormula + (extendMany 5 f env) ↔ + env z = ZFSet.pair (f 3) (f 4) ∧ f 3 = ZFSet.pair (f 0) (f 1) ∧ + f 4 = ZFSet.pair (f 0) (f 2) ∧ + f 2 = assignmentCut (env levels) (env alpha) (f 1) := by + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members)] + simp only [SetFormula.rowAssignmentCutBody, BoundedFormula.Truth, + BoundedFormula.truth_orderedPairFormula, BoundedFormula.truth_assignmentCutFormula, + extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, body⟩ + obtain ⟨equal, upper, lower, cut⟩ := (actual f ground).1 body + rw [upper, lower, cut] at equal + exact ⟨f 0, f 1, equal⟩ + · rintro ⟨row, A, equal⟩ + have pairGround := equal ▸ members z + have upper := M.pair_left pairGround + have lower := M.pair_right pairGround + let cut := assignmentCut (env levels) (env alpha) A + let f : Fin 5 → ZFSet.{u} := ![row, A, cut, ZFSet.pair row A, ZFSet.pair row cut] + have ground : ∀ j, f j ∈ M.sets := + Fin.cases (M.pair_left upper) (Fin.cases (M.pair_right upper) + (Fin.cases (M.pair_right lower) (Fin.cases upper + (Fin.cases lower (fun j => Fin.elim0 j))))) + exact ⟨f, ground, (actual f ground).2 ⟨equal, rfl, rfl, rfl⟩⟩ + +theorem rowAssignmentCutGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {upper lower levels alpha : ZFSet.{u}} + (hUpper : upper ∈ M.sets) (hLower : lower ∈ M.sets) + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) : + rowAssignmentCutGraph upper lower levels alpha ∈ M.sets := by + let params : Fin 2 → ZFSet.{u} := ![levels, alpha] + have ground : ∀ j, params j ∈ M.sets := + Fin.cases hLevels (Fin.cases hAlpha (fun j => Fin.elim0 j)) + have bound := M.prod_mem pairing unions powers separation hUpper hLower + have selected := M.separation_mem separation (rowAssignmentCutFormula 0 1 2) params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets (rowAssignmentCutFormula 0 1 2) (extend z params)) + (ZFSet.prod upper lower) = rowAssignmentCutGraph upper lower levels alpha := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, mem_rowAssignmentCutGraph] + apply and_congr_right + intro hz + exact M.realize_rowAssignmentCutFormula 0 1 2 (extend z params) + (Fin.cases (M.transitive bound hz) ground) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentProjections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentProjections.lean index 49aee8a14200570dddf7e6d4502382851d2a89cb..ce4c23a4f42ee1402d35b6c26241ce000af1ca76 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentProjections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentProjections.lean @@ -1,86 +1,86 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def rowAssignmentRows (Q C B : ZFSet.{u}) : ZFSet.{u} := - graphRestriction Q (productFirst C B) - -noncomputable def rowAssignmentData (Q C B : ZFSet.{u}) : ZFSet.{u} := - graphRestriction Q (productSecond C B) - -theorem rowAssignmentRows_entry (Q C B p A x : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair p A) x ∈ rowAssignmentRows Q C B ↔ - ZFSet.pair p A ∈ Q ∧ p ∈ C ∧ A ∈ B ∧ x = p := by - rw [rowAssignmentRows, pair_mem_graphRestriction, mem_productFirst] - constructor - · rintro ⟨⟨q,hq,D,hD,equal⟩,member⟩ - obtain ⟨left,right⟩ := ZFSet.pair_injective equal - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective left - exact ⟨member,hq,hD,right⟩ - · rintro ⟨member,hp,hA,equal⟩ - subst x - exact ⟨⟨p,hp,A,hA,rfl⟩,member⟩ - -theorem rowAssignmentData_entry (Q C B p A x : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair p A) x ∈ rowAssignmentData Q C B ↔ - ZFSet.pair p A ∈ Q ∧ p ∈ C ∧ A ∈ B ∧ x = A := by - rw [rowAssignmentData, pair_mem_graphRestriction, mem_productSecond] - constructor - · rintro ⟨⟨q,hq,D,hD,equal⟩,member⟩ - obtain ⟨left,right⟩ := ZFSet.pair_injective equal - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective left - exact ⟨member,hq,hD,right⟩ - · rintro ⟨member,hp,hA,equal⟩ - subst x - exact ⟨⟨p,hp,A,hA,rfl⟩,member⟩ - -private theorem restrict_function {Q A B f : ZFSet.{u}} - (function : ZFSet.IsFunc A B f) (subset : Q ⊆ A) : - ZFSet.IsFunc Q B (graphRestriction Q f) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x,hx,y,rfl,entry⟩ := mem_graphRestriction.1 hz - exact ZFSet.pair_mem_prod.2 ⟨hx,(ZFSet.pair_mem_prod.1 (function.1 entry)).2⟩ - · intro x hx - obtain ⟨y,entry,unique⟩ := function.2 x (subset hx) - exact ⟨y,pair_mem_graphRestriction.2 ⟨entry,hx⟩, - fun z hz => unique z (pair_mem_graphRestriction.1 hz).1⟩ - -theorem rowAssignmentRows_function {Q C B : ZFSet.{u}} (subset : Q ⊆ ZFSet.prod C B) : - ZFSet.IsFunc Q C (rowAssignmentRows Q C B) := - restrict_function (productFirst_function C B) subset - -theorem rowAssignmentData_function {Q C B : ZFSet.{u}} (subset : Q ⊆ ZFSet.prod C B) : - ZFSet.IsFunc Q B (rowAssignmentData Q C B) := - restrict_function (productSecond_function C B) subset - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem rowAssignmentRows_mem {Q C B : ZFSet.{u}} - (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) : - rowAssignmentRows Q C B ∈ M.sets := - M.graphRestriction_mem unions separation hQ (M.productFirst_mem pairing unions powers separation hC hB) - -theorem rowAssignmentData_mem {Q C B : ZFSet.{u}} - (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) : - rowAssignmentData Q C B ∈ M.sets := - M.graphRestriction_mem unions separation hQ (M.productSecond_mem pairing unions powers separation hC hB) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def rowAssignmentRows (Q C B : ZFSet.{u}) : ZFSet.{u} := + graphRestriction Q (productFirst C B) + +noncomputable def rowAssignmentData (Q C B : ZFSet.{u}) : ZFSet.{u} := + graphRestriction Q (productSecond C B) + +theorem rowAssignmentRows_entry (Q C B p A x : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair p A) x ∈ rowAssignmentRows Q C B ↔ + ZFSet.pair p A ∈ Q ∧ p ∈ C ∧ A ∈ B ∧ x = p := by + rw [rowAssignmentRows, pair_mem_graphRestriction, mem_productFirst] + constructor + · rintro ⟨⟨q,hq,D,hD,equal⟩,member⟩ + obtain ⟨left,right⟩ := ZFSet.pair_injective equal + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective left + exact ⟨member,hq,hD,right⟩ + · rintro ⟨member,hp,hA,equal⟩ + subst x + exact ⟨⟨p,hp,A,hA,rfl⟩,member⟩ + +theorem rowAssignmentData_entry (Q C B p A x : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair p A) x ∈ rowAssignmentData Q C B ↔ + ZFSet.pair p A ∈ Q ∧ p ∈ C ∧ A ∈ B ∧ x = A := by + rw [rowAssignmentData, pair_mem_graphRestriction, mem_productSecond] + constructor + · rintro ⟨⟨q,hq,D,hD,equal⟩,member⟩ + obtain ⟨left,right⟩ := ZFSet.pair_injective equal + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective left + exact ⟨member,hq,hD,right⟩ + · rintro ⟨member,hp,hA,equal⟩ + subst x + exact ⟨⟨p,hp,A,hA,rfl⟩,member⟩ + +private theorem restrict_function {Q A B f : ZFSet.{u}} + (function : ZFSet.IsFunc A B f) (subset : Q ⊆ A) : + ZFSet.IsFunc Q B (graphRestriction Q f) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x,hx,y,rfl,entry⟩ := mem_graphRestriction.1 hz + exact ZFSet.pair_mem_prod.2 ⟨hx,(ZFSet.pair_mem_prod.1 (function.1 entry)).2⟩ + · intro x hx + obtain ⟨y,entry,unique⟩ := function.2 x (subset hx) + exact ⟨y,pair_mem_graphRestriction.2 ⟨entry,hx⟩, + fun z hz => unique z (pair_mem_graphRestriction.1 hz).1⟩ + +theorem rowAssignmentRows_function {Q C B : ZFSet.{u}} (subset : Q ⊆ ZFSet.prod C B) : + ZFSet.IsFunc Q C (rowAssignmentRows Q C B) := + restrict_function (productFirst_function C B) subset + +theorem rowAssignmentData_function {Q C B : ZFSet.{u}} (subset : Q ⊆ ZFSet.prod C B) : + ZFSet.IsFunc Q B (rowAssignmentData Q C B) := + restrict_function (productSecond_function C B) subset + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem rowAssignmentRows_mem {Q C B : ZFSet.{u}} + (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) : + rowAssignmentRows Q C B ∈ M.sets := + M.graphRestriction_mem unions separation hQ (M.productFirst_mem pairing unions powers separation hC hB) + +theorem rowAssignmentData_mem {Q C B : ZFSet.{u}} + (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hB : B ∈ M.sets) : + rowAssignmentData Q C B ∈ M.sets := + M.graphRestriction_mem unions separation hQ (M.productSecond_mem pairing unions powers separation hC hB) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentTransitionFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentTransitionFamilies.lean index eecfc05d35701c49616b23470dc564b7eabc03b4..3c80fe1851e65349224852c3a26ddc08607f120b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentTransitionFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowAssignmentTransitionFamilies.lean @@ -1,88 +1,88 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RowAssignmentTransitionFormulas - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def rowAssignmentTransitionFamily (stages history levels : ZFSet.{u}) : ZFSet.{u} := - Forcing.rowAssignmentTransitionFamily stages history levels - (M.groundRelations (⋃₀ ⋃₀ ⋃₀ history) (⋃₀ ⋃₀ ⋃₀ history)) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {stages history levels : ZFSet.{u}} - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hLevels : levels ∈ M.sets) - -include pairing unions powers separation hStages hHistory hLevels - -private theorem history_cut_bound {i j Qi Qj : ZFSet.{u}} (hj : j ∈ stages) - (first : ZFSet.pair i Qi ∈ history) (second : ZFSet.pair j Qj ∈ history) : - rowAssignmentCutGraph Qi Qj levels j ∈ - M.groundRelations (⋃₀ ⋃₀ ⋃₀ history) (⋃₀ ⋃₀ ⋃₀ history) := by - apply (M.mem_groundRelations _ _ _).2 - refine ⟨M.rowAssignmentCutGraph_mem pairing unions powers separation - (M.pair_right (M.transitive hHistory first)) (M.pair_right (M.transitive hHistory second)) - hLevels (M.transitive hStages hj), ?_⟩ - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (mem_rowAssignmentCutGraph _ _ _ _ z |>.1 hz).1 - exact ZFSet.pair_mem_prod.2 - ⟨ZFSet.mem_sUnion.2 ⟨Qi, pair_second_mem_doubleUnion first, hx⟩, - ZFSet.mem_sUnion.2 ⟨Qj, pair_second_mem_doubleUnion second, hy⟩⟩ - -theorem rowAssignmentTransitionFamily_mem : M.rowAssignmentTransitionFamily stages history levels ∈ M.sets := by - let B := ⋃₀ ⋃₀ ⋃₀ history - let W := M.groundRelations B B - have hB : B ∈ M.sets := M.union_mem unions (M.union_mem unions (M.union_mem unions hHistory)) - have hW : W ∈ M.sets := M.groundRelations_mem pairing unions powers separation hB hB - let params : Fin 4 → ZFSet.{u} := ![stages, history, levels, W] - have ground : ∀ j, params j ∈ M.sets := Fin.cases hStages - (Fin.cases hHistory (Fin.cases hLevels (Fin.cases hW (fun j => Fin.elim0 j)))) - have bound := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hStages hStages) hW - have selected := M.separation_mem separation (rowAssignmentTransitionFormula 0 1 2 3 4) params ground bound - have equal : ZFSet.sep (fun z => Realize M.sets (rowAssignmentTransitionFormula 0 1 2 3 4) - (extend z params)) (ZFSet.prod (ZFSet.prod stages stages) W) = - M.rowAssignmentTransitionFamily stages history levels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, rowAssignmentTransitionFamily, mem_rowAssignmentTransitionFamily] - apply and_congr_right - intro hz - exact M.realize_rowAssignmentTransitionFormula pairing unions powers separation 0 1 2 3 4 - (extend z params) (Fin.cases (M.transitive bound hz) ground) - exact equal ▸ selected - -theorem rowAssignmentTransitionFamily_function (function : FunctionGraphOn stages history) : - ZFSet.IsFunc (ZFSet.prod stages stages) - (M.groundRelations (⋃₀ ⋃₀ ⋃₀ history) (⋃₀ ⋃₀ ⋃₀ history)) - (M.rowAssignmentTransitionFamily stages history levels) := by - apply Forcing.rowAssignmentTransitionFamily_function function - intro i _ j hj Qi Qj first second - exact M.history_cut_bound pairing unions powers separation hStages hHistory hLevels hj first second - -theorem rowAssignmentTransitionFamily_entry (function : FunctionGraphOn stages history) - {i j Qi Qj R : ZFSet.{u}} (first : ZFSet.pair i Qi ∈ history) - (second : ZFSet.pair j Qj ∈ history) : - ZFSet.pair (ZFSet.pair i j) R ∈ M.rowAssignmentTransitionFamily stages history levels ↔ - R = rowAssignmentCutGraph Qi Qj levels j := by - rw [rowAssignmentTransitionFamily, Forcing.rowAssignmentTransitionFamily_entry_iff function first second] - refine ⟨fun h => h.2, ?_⟩ - intro equal - refine ⟨?_, equal⟩ - rw [equal] - exact M.history_cut_bound pairing unions powers separation hStages hHistory hLevels - (function.pair_source second) first second - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RowAssignmentTransitionFormulas + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def rowAssignmentTransitionFamily (stages history levels : ZFSet.{u}) : ZFSet.{u} := + Forcing.rowAssignmentTransitionFamily stages history levels + (M.groundRelations (⋃₀ ⋃₀ ⋃₀ history) (⋃₀ ⋃₀ ⋃₀ history)) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {stages history levels : ZFSet.{u}} + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hLevels : levels ∈ M.sets) + +include pairing unions powers separation hStages hHistory hLevels + +private theorem history_cut_bound {i j Qi Qj : ZFSet.{u}} (hj : j ∈ stages) + (first : ZFSet.pair i Qi ∈ history) (second : ZFSet.pair j Qj ∈ history) : + rowAssignmentCutGraph Qi Qj levels j ∈ + M.groundRelations (⋃₀ ⋃₀ ⋃₀ history) (⋃₀ ⋃₀ ⋃₀ history) := by + apply (M.mem_groundRelations _ _ _).2 + refine ⟨M.rowAssignmentCutGraph_mem pairing unions powers separation + (M.pair_right (M.transitive hHistory first)) (M.pair_right (M.transitive hHistory second)) + hLevels (M.transitive hStages hj), ?_⟩ + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (mem_rowAssignmentCutGraph _ _ _ _ z |>.1 hz).1 + exact ZFSet.pair_mem_prod.2 + ⟨ZFSet.mem_sUnion.2 ⟨Qi, pair_second_mem_doubleUnion first, hx⟩, + ZFSet.mem_sUnion.2 ⟨Qj, pair_second_mem_doubleUnion second, hy⟩⟩ + +theorem rowAssignmentTransitionFamily_mem : M.rowAssignmentTransitionFamily stages history levels ∈ M.sets := by + let B := ⋃₀ ⋃₀ ⋃₀ history + let W := M.groundRelations B B + have hB : B ∈ M.sets := M.union_mem unions (M.union_mem unions (M.union_mem unions hHistory)) + have hW : W ∈ M.sets := M.groundRelations_mem pairing unions powers separation hB hB + let params : Fin 4 → ZFSet.{u} := ![stages, history, levels, W] + have ground : ∀ j, params j ∈ M.sets := Fin.cases hStages + (Fin.cases hHistory (Fin.cases hLevels (Fin.cases hW (fun j => Fin.elim0 j)))) + have bound := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hStages hStages) hW + have selected := M.separation_mem separation (rowAssignmentTransitionFormula 0 1 2 3 4) params ground bound + have equal : ZFSet.sep (fun z => Realize M.sets (rowAssignmentTransitionFormula 0 1 2 3 4) + (extend z params)) (ZFSet.prod (ZFSet.prod stages stages) W) = + M.rowAssignmentTransitionFamily stages history levels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, rowAssignmentTransitionFamily, mem_rowAssignmentTransitionFamily] + apply and_congr_right + intro hz + exact M.realize_rowAssignmentTransitionFormula pairing unions powers separation 0 1 2 3 4 + (extend z params) (Fin.cases (M.transitive bound hz) ground) + exact equal ▸ selected + +theorem rowAssignmentTransitionFamily_function (function : FunctionGraphOn stages history) : + ZFSet.IsFunc (ZFSet.prod stages stages) + (M.groundRelations (⋃₀ ⋃₀ ⋃₀ history) (⋃₀ ⋃₀ ⋃₀ history)) + (M.rowAssignmentTransitionFamily stages history levels) := by + apply Forcing.rowAssignmentTransitionFamily_function function + intro i _ j hj Qi Qj first second + exact M.history_cut_bound pairing unions powers separation hStages hHistory hLevels hj first second + +theorem rowAssignmentTransitionFamily_entry (function : FunctionGraphOn stages history) + {i j Qi Qj R : ZFSet.{u}} (first : ZFSet.pair i Qi ∈ history) + (second : ZFSet.pair j Qj ∈ history) : + ZFSet.pair (ZFSet.pair i j) R ∈ M.rowAssignmentTransitionFamily stages history levels ↔ + R = rowAssignmentCutGraph Qi Qj levels j := by + rw [rowAssignmentTransitionFamily, Forcing.rowAssignmentTransitionFamily_entry_iff function first second] + refine ⟨fun h => h.2, ?_⟩ + intro equal + refine ⟨?_, equal⟩ + rw [equal] + exact M.history_cut_bound pairing unions powers separation hStages hHistory hLevels + (function.pair_source second) first second + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowDistinguishing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowDistinguishing.lean index 7d77f9508738458d6242b0941ca61a83b91c49b3..dac5629cc310c6f08a441d14de86cb35d78ab5ea 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowDistinguishing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundRowDistinguishing.lean @@ -1,244 +1,244 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFunctionCoordinateDensity - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def rowCoordinateDomain (I C Y p : ZFSet.{u}) : ZFSet.{u} := - relationImage p (ZFSet.prod I C) (productFirst (ZFSet.prod I C) Y) - -noncomputable def rowUsedColumns (I C Y p : ZFSet.{u}) : ZFSet.{u} := - relationImage (rowCoordinateDomain I C Y p) C (productSecond I C) - -theorem mem_rowCoordinateDomain (I C Y p x : ZFSet.{u}) : - x ∈ rowCoordinateDomain I C Y p ↔ - x ∈ ZFSet.prod I C ∧ ∃ y ∈ Y, ZFSet.pair x y ∈ p := by - rw [rowCoordinateDomain, mem_relationImage] - constructor - · rintro ⟨hx, z, hz, rel⟩ - obtain ⟨a, _, y, hy, eq⟩ := (mem_productFirst (ZFSet.prod I C) Y _).1 rel - have entries := ZFSet.pair_inj.1 eq - refine ⟨hx, y, hy, ?_⟩ - rw [entries.2] - exact entries.1 ▸ hz - · rintro ⟨hx, y, hy, entry⟩ - exact ⟨hx, ZFSet.pair x y, entry, - (mem_productFirst (ZFSet.prod I C) Y _).2 ⟨x, hx, y, hy, rfl⟩⟩ - -theorem rowCoordinateDomain_subset (I C Y p : ZFSet.{u}) : - rowCoordinateDomain I C Y p ⊆ ZFSet.prod I C := - fun x hx => ((mem_rowCoordinateDomain I C Y p x).1 hx).1 - -theorem mem_rowUsedColumns (I C Y p c : ZFSet.{u}) : - c ∈ rowUsedColumns I C Y p ↔ - c ∈ C ∧ ∃ i ∈ I, ∃ y ∈ Y, ZFSet.pair (ZFSet.pair i c) y ∈ p := by - rw [rowUsedColumns, mem_relationImage] - constructor - · rintro ⟨hc, x, hx, rel⟩ - obtain ⟨i, hi, d, _, eq⟩ := (mem_productSecond I C _).1 rel - have entries := ZFSet.pair_inj.1 eq - obtain ⟨_, y, hy, entry⟩ := (mem_rowCoordinateDomain I C Y p x).1 hx - rw [entries.1, ← entries.2] at entry - exact ⟨hc, i, hi, y, hy, entry⟩ - · rintro ⟨hc, i, hi, y, hy, entry⟩ - exact ⟨hc, ZFSet.pair i c, - (mem_rowCoordinateDomain I C Y p _).2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hc⟩, y, hy, entry⟩, - (mem_productSecond I C _).2 ⟨i, hi, c, hc, rfl⟩⟩ - -theorem rowUsedColumns_subset (I C Y p : ZFSet.{u}) : rowUsedColumns I C Y p ⊆ C := - fun c hc => ((mem_rowUsedColumns I C Y p c).1 hc).1 - -theorem not_mem_rowUsedColumns_iff {I C Y p c : ZFSet.{u}} - (code : PartialFunctionCode (ZFSet.prod I C) Y p) (hc : c ∈ C) : - c ∉ rowUsedColumns I C Y p ↔ - ∀ i y, ZFSet.pair (ZFSet.pair i c) y ∉ p := by - constructor - · intro fresh i y entry - have bound := ZFSet.pair_mem_prod.1 (code.shape entry) - have coordinates := ZFSet.pair_mem_prod.1 bound.1 - exact fresh ((mem_rowUsedColumns I C Y p c).2 ⟨hc, i, coordinates.1, y, bound.2, entry⟩) - · intro fresh used - obtain ⟨_, i, _, y, _, entry⟩ := (mem_rowUsedColumns I C Y p c).1 used - exact fresh i y entry - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem rowCoordinateDomain_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.sets) : rowCoordinateDomain I C Y p ∈ M.sets := by - have coordinates := M.prod_mem pairing unions powers separation hI hC - exact M.relationImage_mem separation hp coordinates - (M.productFirst_mem pairing unions powers separation coordinates hY) - -theorem rowUsedColumns_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.sets) : rowUsedColumns I C Y p ∈ M.sets := - M.relationImage_mem separation - (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hC - (M.productSecond_mem pairing unions powers separation hI hC) - -theorem rowCoordinateDomain_groundEmbeddable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) - (small : M.groundEmbeddable p N) : M.groundEmbeddable (rowCoordinateDomain I C Y p) N := by - have coordinates := M.prod_mem pairing unions powers separation hI hC - exact M.groundEmbeddable_function_image pairing unions powers separation choice hp coordinates hN - (M.productFirst_mem pairing unions powers separation coordinates hY) - (productFirst_function (ZFSet.prod I C) Y) small - -theorem rowUsedColumns_groundEmbeddable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) - (small : M.groundEmbeddable p N) : M.groundEmbeddable (rowUsedColumns I C Y p) N := - M.groundEmbeddable_function_image pairing unions powers separation choice - (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hC hN - (M.productSecond_mem pairing unions powers separation hI hC) (productSecond_function I C) - (M.rowCoordinateDomain_groundEmbeddable pairing unions powers separation choice hI hC hY hp hN small) - -theorem exists_fresh_rowColumn - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) - (small : M.groundEmbeddable p N) (large : ¬ M.groundEmbeddable C N) : - ∃ c ∈ C, c ∉ rowUsedColumns I C Y p := by - classical - have columns := M.rowUsedColumns_groundEmbeddable pairing unions powers separation choice - hI hC hY hp hN small - by_contra! full - have eq : rowUsedColumns I C Y p = C := by - apply ZFSet.ext - intro c - exact ⟨fun hc => rowUsedColumns_subset I C Y p hc, full c⟩ - exact large (eq ▸ columns) - -theorem countablePartialFunctions_fresh_column - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) - (hp : p ∈ M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : - ∃ c ∈ C, ∀ i y, ZFSet.pair (ZFSet.pair i c) y ∉ p := by - obtain ⟨ground, code, small⟩ := (M.mem_smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega p).1 hp - obtain ⟨c, hc, fresh⟩ := M.exists_fresh_rowColumn pairing unions powers separation choice - hI hC hY ground (M.omega_mem separation infinite) small uncountable - exact ⟨c, hc, (not_mem_rowUsedColumns_iff code hc).1 fresh⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem countablePartialFunctions_insert_two_rows - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {I C Y p i j c a b : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hY : Y ∈ M.sets) (hp : p ∈ M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) - (hi : i ∈ I) (hj : j ∈ I) (hc : c ∈ C) (ha : a ∈ Y) (hb : b ∈ Y) - (distinct : i ≠ j) (fresh : ∀ k y, ZFSet.pair (ZFSet.pair k c) y ∉ p) : - insert (ZFSet.pair (ZFSet.pair j c) b) - (insert (ZFSet.pair (ZFSet.pair i c) a) p) ∈ - M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega := by - have coordinates := M.prod_mem pairing unions powers separation hI hC - have first := M.countablePartialFunctions_insert pairing unions powers separation infinite - coordinates hY hp (ZFSet.pair_mem_prod.2 ⟨hi, hc⟩) ha - (fun y entry => False.elim (fresh i y entry)) - apply M.countablePartialFunctions_insert pairing unions powers separation infinite - coordinates hY first (ZFSet.pair_mem_prod.2 ⟨hj, hc⟩) hb - intro y entry - rcases ZFSet.mem_insert_iff.1 entry with eq | old - · exact False.elim (distinct (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 eq).1).1.symm) - · exact False.elim (fresh j y old) - -def rowDistinguishing (I C Y i j : ZFSet.{u}) : - Set (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)) := - {p | ∃ c ∈ C, ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b ∧ - ZFSet.pair (ZFSet.pair i c) a ∈ SetMembers.raw p ∧ - ZFSet.pair (ZFSet.pair j c) b ∈ SetMembers.raw p} - -theorem rowDistinguishing_dense - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) - (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) - (values : ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : - letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - Dense (M.rowDistinguishing I C Y i j) := by - let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - intro p - obtain ⟨c, hc, fresh⟩ := M.countablePartialFunctions_fresh_column - pairing unions powers separation infinite choice hI hC hY (SetMembers.raw_mem p) uncountable - obtain ⟨a, ha, b, hb, ne⟩ := values - have extended := M.countablePartialFunctions_insert_two_rows - pairing unions powers separation infinite hI hC hY (SetMembers.raw_mem p) - hi hj hc ha hb distinct fresh - let q := SetMembers.ofMem - (insert (ZFSet.pair (ZFSet.pair j c) b) - (insert (ZFSet.pair (ZFSet.pair i c) a) (SetMembers.raw p))) extended - have rawq : SetMembers.raw q = insert (ZFSet.pair (ZFSet.pair j c) b) - (insert (ZFSet.pair (ZFSet.pair i c) a) (SetMembers.raw p)) := - SetMembers.raw_ofMem _ _ - refine ⟨q, (M.smallFunction_le_iff (ZFSet.prod I C) Y ZFSet.omega q p).2 ?_, ?_⟩ - · intro z hz - rw [rawq] - exact ZFSet.mem_insert_of_mem _ (ZFSet.mem_insert_of_mem _ hz) - · refine ⟨c, hc, a, ha, b, hb, ne, ?_, ?_⟩ - · rw [rawq] - exact ZFSet.mem_insert_of_mem _ (ZFSet.mem_insert _ _) - · rw [rawq] - exact ZFSet.mem_insert _ _ - -theorem rowDistinguishing_downward (I C Y i j : ZFSet.{u}) : - letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - DownwardClosed (M.rowDistinguishing I C Y i j) := by - let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega - intro p q le hp - obtain ⟨c, hc, a, ha, b, hb, ne, first, second⟩ := hp - have includes := (M.smallFunction_le_iff (ZFSet.prod I C) Y ZFSet.omega q p).1 le - exact ⟨c, hc, a, ha, b, hb, ne, includes first, includes second⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFunctionCoordinateDensity + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def rowCoordinateDomain (I C Y p : ZFSet.{u}) : ZFSet.{u} := + relationImage p (ZFSet.prod I C) (productFirst (ZFSet.prod I C) Y) + +noncomputable def rowUsedColumns (I C Y p : ZFSet.{u}) : ZFSet.{u} := + relationImage (rowCoordinateDomain I C Y p) C (productSecond I C) + +theorem mem_rowCoordinateDomain (I C Y p x : ZFSet.{u}) : + x ∈ rowCoordinateDomain I C Y p ↔ + x ∈ ZFSet.prod I C ∧ ∃ y ∈ Y, ZFSet.pair x y ∈ p := by + rw [rowCoordinateDomain, mem_relationImage] + constructor + · rintro ⟨hx, z, hz, rel⟩ + obtain ⟨a, _, y, hy, eq⟩ := (mem_productFirst (ZFSet.prod I C) Y _).1 rel + have entries := ZFSet.pair_inj.1 eq + refine ⟨hx, y, hy, ?_⟩ + rw [entries.2] + exact entries.1 ▸ hz + · rintro ⟨hx, y, hy, entry⟩ + exact ⟨hx, ZFSet.pair x y, entry, + (mem_productFirst (ZFSet.prod I C) Y _).2 ⟨x, hx, y, hy, rfl⟩⟩ + +theorem rowCoordinateDomain_subset (I C Y p : ZFSet.{u}) : + rowCoordinateDomain I C Y p ⊆ ZFSet.prod I C := + fun x hx => ((mem_rowCoordinateDomain I C Y p x).1 hx).1 + +theorem mem_rowUsedColumns (I C Y p c : ZFSet.{u}) : + c ∈ rowUsedColumns I C Y p ↔ + c ∈ C ∧ ∃ i ∈ I, ∃ y ∈ Y, ZFSet.pair (ZFSet.pair i c) y ∈ p := by + rw [rowUsedColumns, mem_relationImage] + constructor + · rintro ⟨hc, x, hx, rel⟩ + obtain ⟨i, hi, d, _, eq⟩ := (mem_productSecond I C _).1 rel + have entries := ZFSet.pair_inj.1 eq + obtain ⟨_, y, hy, entry⟩ := (mem_rowCoordinateDomain I C Y p x).1 hx + rw [entries.1, ← entries.2] at entry + exact ⟨hc, i, hi, y, hy, entry⟩ + · rintro ⟨hc, i, hi, y, hy, entry⟩ + exact ⟨hc, ZFSet.pair i c, + (mem_rowCoordinateDomain I C Y p _).2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hc⟩, y, hy, entry⟩, + (mem_productSecond I C _).2 ⟨i, hi, c, hc, rfl⟩⟩ + +theorem rowUsedColumns_subset (I C Y p : ZFSet.{u}) : rowUsedColumns I C Y p ⊆ C := + fun c hc => ((mem_rowUsedColumns I C Y p c).1 hc).1 + +theorem not_mem_rowUsedColumns_iff {I C Y p c : ZFSet.{u}} + (code : PartialFunctionCode (ZFSet.prod I C) Y p) (hc : c ∈ C) : + c ∉ rowUsedColumns I C Y p ↔ + ∀ i y, ZFSet.pair (ZFSet.pair i c) y ∉ p := by + constructor + · intro fresh i y entry + have bound := ZFSet.pair_mem_prod.1 (code.shape entry) + have coordinates := ZFSet.pair_mem_prod.1 bound.1 + exact fresh ((mem_rowUsedColumns I C Y p c).2 ⟨hc, i, coordinates.1, y, bound.2, entry⟩) + · intro fresh used + obtain ⟨_, i, _, y, _, entry⟩ := (mem_rowUsedColumns I C Y p c).1 used + exact fresh i y entry + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem rowCoordinateDomain_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.sets) : rowCoordinateDomain I C Y p ∈ M.sets := by + have coordinates := M.prod_mem pairing unions powers separation hI hC + exact M.relationImage_mem separation hp coordinates + (M.productFirst_mem pairing unions powers separation coordinates hY) + +theorem rowUsedColumns_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.sets) : rowUsedColumns I C Y p ∈ M.sets := + M.relationImage_mem separation + (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hC + (M.productSecond_mem pairing unions powers separation hI hC) + +theorem rowCoordinateDomain_groundEmbeddable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) + (small : M.groundEmbeddable p N) : M.groundEmbeddable (rowCoordinateDomain I C Y p) N := by + have coordinates := M.prod_mem pairing unions powers separation hI hC + exact M.groundEmbeddable_function_image pairing unions powers separation choice hp coordinates hN + (M.productFirst_mem pairing unions powers separation coordinates hY) + (productFirst_function (ZFSet.prod I C) Y) small + +theorem rowUsedColumns_groundEmbeddable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) + (small : M.groundEmbeddable p N) : M.groundEmbeddable (rowUsedColumns I C Y p) N := + M.groundEmbeddable_function_image pairing unions powers separation choice + (M.rowCoordinateDomain_mem pairing unions powers separation hI hC hY hp) hC hN + (M.productSecond_mem pairing unions powers separation hI hC) (productSecond_function I C) + (M.rowCoordinateDomain_groundEmbeddable pairing unions powers separation choice hI hC hY hp hN small) + +theorem exists_fresh_rowColumn + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y p N : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.sets) (hN : N ∈ M.sets) + (small : M.groundEmbeddable p N) (large : ¬ M.groundEmbeddable C N) : + ∃ c ∈ C, c ∉ rowUsedColumns I C Y p := by + classical + have columns := M.rowUsedColumns_groundEmbeddable pairing unions powers separation choice + hI hC hY hp hN small + by_contra! full + have eq : rowUsedColumns I C Y p = C := by + apply ZFSet.ext + intro c + exact ⟨fun hc => rowUsedColumns_subset I C Y p hc, full c⟩ + exact large (eq ▸ columns) + +theorem countablePartialFunctions_fresh_column + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y p : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) + (hp : p ∈ M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : + ∃ c ∈ C, ∀ i y, ZFSet.pair (ZFSet.pair i c) y ∉ p := by + obtain ⟨ground, code, small⟩ := (M.mem_smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega p).1 hp + obtain ⟨c, hc, fresh⟩ := M.exists_fresh_rowColumn pairing unions powers separation choice + hI hC hY ground (M.omega_mem separation infinite) small uncountable + exact ⟨c, hc, (not_mem_rowUsedColumns_iff code hc).1 fresh⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem countablePartialFunctions_insert_two_rows + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {I C Y p i j c a b : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hY : Y ∈ M.sets) (hp : p ∈ M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega) + (hi : i ∈ I) (hj : j ∈ I) (hc : c ∈ C) (ha : a ∈ Y) (hb : b ∈ Y) + (distinct : i ≠ j) (fresh : ∀ k y, ZFSet.pair (ZFSet.pair k c) y ∉ p) : + insert (ZFSet.pair (ZFSet.pair j c) b) + (insert (ZFSet.pair (ZFSet.pair i c) a) p) ∈ + M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega := by + have coordinates := M.prod_mem pairing unions powers separation hI hC + have first := M.countablePartialFunctions_insert pairing unions powers separation infinite + coordinates hY hp (ZFSet.pair_mem_prod.2 ⟨hi, hc⟩) ha + (fun y entry => False.elim (fresh i y entry)) + apply M.countablePartialFunctions_insert pairing unions powers separation infinite + coordinates hY first (ZFSet.pair_mem_prod.2 ⟨hj, hc⟩) hb + intro y entry + rcases ZFSet.mem_insert_iff.1 entry with eq | old + · exact False.elim (distinct (ZFSet.pair_inj.1 (ZFSet.pair_inj.1 eq).1).1.symm) + · exact False.elim (fresh j y old) + +def rowDistinguishing (I C Y i j : ZFSet.{u}) : + Set (SetMembers (M.smallPartialFunctions (ZFSet.prod I C) Y ZFSet.omega)) := + {p | ∃ c ∈ C, ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b ∧ + ZFSet.pair (ZFSet.pair i c) a ∈ SetMembers.raw p ∧ + ZFSet.pair (ZFSet.pair j c) b ∈ SetMembers.raw p} + +theorem rowDistinguishing_dense + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I C Y i j : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hY : Y ∈ M.sets) + (hi : i ∈ I) (hj : j ∈ I) (distinct : i ≠ j) + (values : ∃ a ∈ Y, ∃ b ∈ Y, a ≠ b) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : + letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + Dense (M.rowDistinguishing I C Y i j) := by + let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + intro p + obtain ⟨c, hc, fresh⟩ := M.countablePartialFunctions_fresh_column + pairing unions powers separation infinite choice hI hC hY (SetMembers.raw_mem p) uncountable + obtain ⟨a, ha, b, hb, ne⟩ := values + have extended := M.countablePartialFunctions_insert_two_rows + pairing unions powers separation infinite hI hC hY (SetMembers.raw_mem p) + hi hj hc ha hb distinct fresh + let q := SetMembers.ofMem + (insert (ZFSet.pair (ZFSet.pair j c) b) + (insert (ZFSet.pair (ZFSet.pair i c) a) (SetMembers.raw p))) extended + have rawq : SetMembers.raw q = insert (ZFSet.pair (ZFSet.pair j c) b) + (insert (ZFSet.pair (ZFSet.pair i c) a) (SetMembers.raw p)) := + SetMembers.raw_ofMem _ _ + refine ⟨q, (M.smallFunction_le_iff (ZFSet.prod I C) Y ZFSet.omega q p).2 ?_, ?_⟩ + · intro z hz + rw [rawq] + exact ZFSet.mem_insert_of_mem _ (ZFSet.mem_insert_of_mem _ hz) + · refine ⟨c, hc, a, ha, b, hb, ne, ?_, ?_⟩ + · rw [rawq] + exact ZFSet.mem_insert_of_mem _ (ZFSet.mem_insert _ _) + · rw [rawq] + exact ZFSet.mem_insert _ _ + +theorem rowDistinguishing_downward (I C Y i j : ZFSet.{u}) : + letI := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + DownwardClosed (M.rowDistinguishing I C Y i j) := by + let := M.smallFunctionOrder (ZFSet.prod I C) Y ZFSet.omega + intro p q le hp + obtain ⟨c, hc, a, ha, b, hb, ne, first, second⟩ := hp + have includes := (M.smallFunction_le_iff (ZFSet.prod I C) Y ZFSet.omega q p).1 le + exact ⟨c, hc, a, ha, b, hb, ne, includes first, includes second⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerialOrbits.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerialOrbits.lean index dc3bfd1cb566934b547c59d7d52f62a3bc657d39..f34db395b4a513753f7e972d7676ed9d64d3e007 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerialOrbits.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerialOrbits.lean @@ -1,61 +1,61 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundNaturalRecursion - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundSerialOrbit - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {W R initial : ZFSet.{u}} (hW : W ∈ M.sets) (hR : R ∈ M.sets) - (hInitial : initial ∈ W) - (serial : ∀ x ∈ W, ∃ y ∈ W, ZFSet.pair x y ∈ R) : - ∃ history ∈ M.sets, ZFSet.IsFunc ZFSet.omega W history ∧ - (∀ y, ZFSet.pair ∅ y ∈ history ↔ y = initial) ∧ - ∀ n ∈ ZFSet.omega, ∀ x y, - ZFSet.pair n x ∈ history → ZFSet.pair (insert n n) y ∈ history → ZFSet.pair x y ∈ R := by - obtain ⟨step, hStep, function, selected⟩ := - M.uniformize_relation pairing unions powers separation choice hW hW hR serial - let s := SetMembers.presentation W - let f := s.decodeFunction s step function - let b := SetMembers.ofMem initial hInitial - have graphGround : s.graph s f ∈ M.sets := - M.decoded_function_graph_mem s s hStep function - let history := natPresentation.graph s (fun n => natIterate f b n.down) - have historyGround : history ∈ M.sets := - M.natural_recursion_graph_mem pairing unions powers separation infinite s f b hW graphGround - have historyFunction : ZFSet.IsFunc ZFSet.omega W history := natPresentation.graph_isFunc s _ - have canonical (n : Nat) : - ZFSet.pair (natSetCode n) (s.encode (natIterate f b n)) ∈ history := - (natPresentation.pair_mem_graph s (fun n => natIterate f b n.down) ⟨n⟩ _).2 rfl - have entryValue (n : Nat) (y : ZFSet.{u}) - (entry : ZFSet.pair (natSetCode n) y ∈ history) : y = s.encode (natIterate f b n) := by - obtain ⟨_, _, unique⟩ := historyFunction.2 (natSetCode n) (natSetCode_mem_omega n) - exact (unique y entry).trans (unique _ (canonical n)).symm - refine ⟨history, historyGround, historyFunction, ?_, ?_⟩ - · intro y - constructor - · intro entry - exact (entryValue 0 y entry).trans (SetMembers.raw_ofMem initial hInitial) - · intro equal - exact equal.symm ▸ (SetMembers.raw_ofMem initial hInitial ▸ canonical 0) - · intro n hn x y first second - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have firstValue := entryValue k x first - have secondValue := entryValue (k + 1) y second - rw [firstValue, secondValue] - exact selected (s.decodeFunction_mem s step function (natIterate f b k)) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundNaturalRecursion + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundSerialOrbit + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {W R initial : ZFSet.{u}} (hW : W ∈ M.sets) (hR : R ∈ M.sets) + (hInitial : initial ∈ W) + (serial : ∀ x ∈ W, ∃ y ∈ W, ZFSet.pair x y ∈ R) : + ∃ history ∈ M.sets, ZFSet.IsFunc ZFSet.omega W history ∧ + (∀ y, ZFSet.pair ∅ y ∈ history ↔ y = initial) ∧ + ∀ n ∈ ZFSet.omega, ∀ x y, + ZFSet.pair n x ∈ history → ZFSet.pair (insert n n) y ∈ history → ZFSet.pair x y ∈ R := by + obtain ⟨step, hStep, function, selected⟩ := + M.uniformize_relation pairing unions powers separation choice hW hW hR serial + let s := SetMembers.presentation W + let f := s.decodeFunction s step function + let b := SetMembers.ofMem initial hInitial + have graphGround : s.graph s f ∈ M.sets := + M.decoded_function_graph_mem s s hStep function + let history := natPresentation.graph s (fun n => natIterate f b n.down) + have historyGround : history ∈ M.sets := + M.natural_recursion_graph_mem pairing unions powers separation infinite s f b hW graphGround + have historyFunction : ZFSet.IsFunc ZFSet.omega W history := natPresentation.graph_isFunc s _ + have canonical (n : Nat) : + ZFSet.pair (natSetCode n) (s.encode (natIterate f b n)) ∈ history := + (natPresentation.pair_mem_graph s (fun n => natIterate f b n.down) ⟨n⟩ _).2 rfl + have entryValue (n : Nat) (y : ZFSet.{u}) + (entry : ZFSet.pair (natSetCode n) y ∈ history) : y = s.encode (natIterate f b n) := by + obtain ⟨_, _, unique⟩ := historyFunction.2 (natSetCode n) (natSetCode_mem_omega n) + exact (unique y entry).trans (unique _ (canonical n)).symm + refine ⟨history, historyGround, historyFunction, ?_, ?_⟩ + · intro y + constructor + · intro entry + exact (entryValue 0 y entry).trans (SetMembers.raw_ofMem initial hInitial) + · intro equal + exact equal.symm ▸ (SetMembers.raw_ofMem initial hInitial ▸ canonical 0) + · intro n hn x y first second + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have firstValue := entryValue k x first + have secondValue := entryValue (k + 1) y second + rw [firstValue, secondValue] + exact selected (s.decodeFunction_mem s step function (natIterate f b k)) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedBoundNormalization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedBoundNormalization.lean index 221ede8689926771a0d72e21af08525354e774c2..52d1c4ff129e666238725516e104d84ad1c6a54c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedBoundNormalization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedBoundNormalization.lean @@ -1,60 +1,60 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundSerializedChronology -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M T C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) - -noncomputable def normalizeBounds : GroundSerializedChronology M T C D rD where - fields := serial.fields.normalizeBound pairing unions separation - ordinal := serial.ordinal - core := serial.fields.normalizeBound_core pairing unions separation serial.core - layerBound := functionGraphRange (chronologyPairs T) serial.layers - layer_bound_ground := M.functionGraphRange_mem unions separation - (M.chronologyPairs_mem pairing unions powers separation serial.fields.time_ground) - serial.layers_ground - layers := serial.layers - layers_ground := serial.layers_ground - layer_function := functionGraphRange_function ⟨serial.layerBound, serial.layer_function⟩ - layer_code := serial.layer_code - -theorem normalizeBounds_graph : - (serial.normalizeBounds pairing unions powers separation).fields.graph = serial.fields.graph := rfl - -theorem normalizeBounds_value (j : Fin 5) (s : ZFSet.{u}) : - (serial.normalizeBounds pairing unions powers separation).fields.value j s = - serial.fields.value j s := rfl - -theorem normalizeBounds_layers : - (serial.normalizeBounds pairing unions powers separation).layers = serial.layers := rfl - -theorem normalizeBounds_layerWitness (s t : ZFSet.{u}) : - (serial.normalizeBounds pairing unions powers separation).layerWitness s t = - serial.layerWitness s t := rfl - -theorem normalizeBounds_toHistory : - (serial.normalizeBounds pairing unions powers separation).toHistory = serial.toHistory := rfl - -theorem normalizeBounds_code_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (time : ZFSet.rank T < o) (graphs : ∀ j, ZFSet.rank (serial.fields.graph j) < o) - (layers : ZFSet.rank serial.layers < o) : - ZFSet.rank (serial.normalizeBounds pairing unions powers separation).code < o := - rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases (serial.fields.normalizeBound_code_rank_lt pairing unions separation limit time graphs) - (Fin.cases ((functionGraphRange_rank_le (chronologyPairs T) serial.layers).trans_lt layers) - (fun _ => layers))) - -end PartitionPilot.Forcing.GroundSerializedChronology - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundSerializedChronology +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M T C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) + +noncomputable def normalizeBounds : GroundSerializedChronology M T C D rD where + fields := serial.fields.normalizeBound pairing unions separation + ordinal := serial.ordinal + core := serial.fields.normalizeBound_core pairing unions separation serial.core + layerBound := functionGraphRange (chronologyPairs T) serial.layers + layer_bound_ground := M.functionGraphRange_mem unions separation + (M.chronologyPairs_mem pairing unions powers separation serial.fields.time_ground) + serial.layers_ground + layers := serial.layers + layers_ground := serial.layers_ground + layer_function := functionGraphRange_function ⟨serial.layerBound, serial.layer_function⟩ + layer_code := serial.layer_code + +theorem normalizeBounds_graph : + (serial.normalizeBounds pairing unions powers separation).fields.graph = serial.fields.graph := rfl + +theorem normalizeBounds_value (j : Fin 5) (s : ZFSet.{u}) : + (serial.normalizeBounds pairing unions powers separation).fields.value j s = + serial.fields.value j s := rfl + +theorem normalizeBounds_layers : + (serial.normalizeBounds pairing unions powers separation).layers = serial.layers := rfl + +theorem normalizeBounds_layerWitness (s t : ZFSet.{u}) : + (serial.normalizeBounds pairing unions powers separation).layerWitness s t = + serial.layerWitness s t := rfl + +theorem normalizeBounds_toHistory : + (serial.normalizeBounds pairing unions powers separation).toHistory = serial.toHistory := rfl + +theorem normalizeBounds_code_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (time : ZFSet.rank T < o) (graphs : ∀ j, ZFSet.rank (serial.fields.graph j) < o) + (layers : ZFSet.rank serial.layers < o) : + ZFSet.rank (serial.normalizeBounds pairing unions powers separation).code < o := + rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases (serial.fields.normalizeBound_code_rank_lt pairing unions separation limit time graphs) + (Fin.cases ((functionGraphRange_rank_le (chronologyPairs T) serial.layers).trans_lt layers) + (fun _ => layers))) + +end PartitionPilot.Forcing.GroundSerializedChronology + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedCandidateLevels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedCandidateLevels.lean index 441e59c5e0704b58215714eadf8232fe39ec9ca1..bca80061f3ec7e2685216db78c240e65856893d8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedCandidateLevels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSerializedCandidateLevels.lean @@ -1,244 +1,244 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialMainSeedSuccessorSerialization - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure GroundMainCandidateLevel (M : TransitiveGround.{u}) (K : ZFSet.{u}) where - trace : ZFSet.{u} - trace_ground : trace ∈ M.sets - carrier : ZFSet.{u} - carrier_ground : carrier ∈ M.sets - hierarchy : GroundCumulativeHierarchyCode M (insert K K) trace - entry : ZFSet.pair K carrier ∈ trace - membership : ∀ x, x ∈ carrier ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank K - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundMainCandidateLevel - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {K : ZFSet.{u}} - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) : - Nonempty (GroundMainCandidateLevel M K) := by - obtain ⟨H, hH, V, hV, hierarchy, entry, membership, _, _⟩ := - M.exists_groundCumulativeLevel pairing unions powers separation collection hK ordinal - exact ⟨⟨H, hH, V, hV, hierarchy, entry, membership⟩⟩ - -end TransitiveGround - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -include pairing unions powers separation - -include infinite hK conditions in -theorem stage_mem {C D rD Labels : ZFSet.{u}} - (source : GroundChronologicalMainStage M C D rD) (invariant : source.Invariant K Labels) : - source.stage.code ∈ level.carrier := - (level.membership _).2 ⟨source.stage.code_mem pairing, - invariant.code_rank_lt pairing unions powers separation infinite hK conditions⟩ - -include infinite hK conditions in -theorem birth_mem {C D rD Labels : ZFSet.{u}} - (source : GroundChronologicalMainStage M C D rD) (invariant : source.Invariant K Labels) : - source.birth ∈ level.carrier := - (level.membership _).2 ⟨source.birth_ground, - invariant.birth_rank_lt pairing unions powers separation infinite hK conditions⟩ - -include infinite hK conditions in -theorem transition_mem {C D rD Labels : ZFSet.{u}} - {source target : GroundChronologicalMainStage M C D rD} - (transition : GroundMainTransition source.stage target.stage) - (first : source.Invariant K Labels) (second : target.Invariant K Labels) : - transition.code ∈ level.carrier := - (level.membership _).2 ⟨transition.code_mem pairing, - transition.code_rank_lt_inaccessible pairing unions powers separation infinite hK conditions - first.points_rank second.points_rank first.actors_rank second.actors_rank⟩ - -theorem relationSpace_ground {I : ZFSet.{u}} (hI : I ∈ M.sets) : - M.groundRelations I level.carrier ∈ M.sets := - M.groundRelations_mem pairing unions powers separation hI level.carrier_ground - -end GroundMainCandidateLevel - - - - - - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) - -noncomputable def validStages (C D rD : ZFSet.{u}) : ZFSet.{u} := - M.mainStageCandidates level.carrier C D rD - -theorem validStages_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {C D rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - level.validStages C D rD ∈ M.sets := - M.mainStageCandidates_mem pairing unions powers separation infinite level.carrier_ground hC hD hrD - -theorem invariant_mem_validStages - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - {C D rD Labels : ZFSet.{u}} (source : GroundChronologicalMainStage M C D rD) - (invariant : source.Invariant K Labels) : source.stage.code ∈ level.validStages C D rD := - M.mainStage_code_mem_candidates source.stage - (level.stage_mem pairing unions powers separation infinite hK conditions source invariant) - -theorem validStageFamily_rank_lt - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - {I C D rD f : ZFSet.{u}} (hI : I ∈ K) (hf : f ∈ M.sets) - (function : ZFSet.IsFunc I (level.validStages C D rD) f) : - ZFSet.rank f < ZFSet.rank K := by - apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite - hK hI hf ⟨level.validStages C D rD, function⟩ - intro i _ v entry - have hv := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - have inLevel := ((M.mem_mainStageCandidates level.carrier C D rD v).1 hv).1 - exact ((level.membership v).1 inLevel).2 - -end GroundMainCandidateLevel - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundMainSeedCandidates - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - certificate.target.Invariant K C ∧ - level.validStages C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ - seed.source.stage.code ∈ level.validStages C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ - certificate.target.stage.code ∈ level.validStages C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ - seed.source.birth ∈ level.carrier ∧ certificate.target.birth ∈ level.carrier ∧ - certificate.transition.map.code ∈ level.carrier := by - dsimp only - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨level⟩ := M.exists_groundMainCandidateLevel pairing unions powers separation collection hK conditions.1 - obtain ⟨seed, certificate, invariant, _⟩ := M.exists_groundInitialMainSeedSuccessor - pairing unions powers separation collection infinite choice hK standard - exact ⟨level, seed, certificate, invariant, - level.validStages_ground pairing unions powers separation infinite seed.source.stage.columns_ground - seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, - level.invariant_mem_validStages pairing unions powers separation infinite hK conditions seed.source seed.invariant, - level.invariant_mem_validStages pairing unions powers separation infinite hK conditions certificate.target invariant, - level.birth_mem pairing unions powers separation infinite hK conditions seed.source seed.invariant, - level.birth_mem pairing unions powers separation infinite hK conditions certificate.target invariant, - level.transition_mem pairing unions powers separation infinite hK conditions certificate.transition.map seed.invariant invariant⟩ - -end TransitiveGround - - - - - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) - -noncomputable def validChronologies (C D rD : ZFSet.{u}) : ZFSet.{u} := - M.serializedChronologyCandidates level.carrier C D rD - -theorem validChronologies_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {C D rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - level.validChronologies C D rD ∈ M.sets := - M.serializedChronologyCandidates_mem pairing unions powers separation infinite - level.carrier_ground hC hD hrD - -theorem ranked_mem_validChronologies - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {T C D rD : ZFSet.{u}} (serial : GroundSerializedChronology M T C D rD) - (rank : ZFSet.rank serial.code < ZFSet.rank K) : - serial.code ∈ level.validChronologies C D rD := - M.serializedChronology_code_mem_candidates serial - ((level.membership _).2 ⟨serial.code_ground pairing, rank⟩) - -theorem validChronologyFamily_rank_lt - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - {I C D rD f : ZFSet.{u}} (hI : I ∈ K) (hf : f ∈ M.sets) - (function : ZFSet.IsFunc I (level.validChronologies C D rD) f) : - ZFSet.rank f < ZFSet.rank K := by - apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite - hK hI hf ⟨level.validChronologies C D rD, function⟩ - intro i _ v entry - have member := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - have inLevel := ((M.mem_serializedChronologyCandidates level.carrier C D rD v).1 member).1 - exact ((level.membership v).1 inLevel).2 - -end GroundMainCandidateLevel - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialChronologyCandidates - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, ∃ seed : GroundInitialMainSeedData M K C, - ∃ serial : GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) - C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), - level.validChronologies C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ - serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ - serial.fields.graph = seed.source.stage.initialChronologyGraph ∧ - serial.toHistory.space ∅ = seed.source.stage.carrier ∧ - serial.toHistory.order ∅ = seed.source.stage.order ∧ - serial.toHistory.meetGraph ∅ = seed.source.stage.meetGraph ∧ - serial.toHistory.birth ∅ = seed.source.birth ∧ - serial.toHistory.height ∅ = seed.source.stage.height := by - dsimp only - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨level⟩ := M.exists_groundMainCandidateLevel pairing unions powers separation collection hK conditions.1 - obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite collection hK conditions - obtain ⟨injection, _, injected, hInjection, _, rank, fields, values⟩ := - seed.exists_rankedInitialSerialization pairing unions powers separation infinite hK conditions - let serial := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected - exact ⟨level, seed, serial, - level.validChronologies_ground pairing unions powers separation infinite seed.source.stage.columns_ground - seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, - level.ranked_mem_validChronologies pairing serial rank, fields, values⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialMainSeedSuccessorSerialization + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure GroundMainCandidateLevel (M : TransitiveGround.{u}) (K : ZFSet.{u}) where + trace : ZFSet.{u} + trace_ground : trace ∈ M.sets + carrier : ZFSet.{u} + carrier_ground : carrier ∈ M.sets + hierarchy : GroundCumulativeHierarchyCode M (insert K K) trace + entry : ZFSet.pair K carrier ∈ trace + membership : ∀ x, x ∈ carrier ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank K + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundMainCandidateLevel + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {K : ZFSet.{u}} + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) : + Nonempty (GroundMainCandidateLevel M K) := by + obtain ⟨H, hH, V, hV, hierarchy, entry, membership, _, _⟩ := + M.exists_groundCumulativeLevel pairing unions powers separation collection hK ordinal + exact ⟨⟨H, hH, V, hV, hierarchy, entry, membership⟩⟩ + +end TransitiveGround + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +include pairing unions powers separation + +include infinite hK conditions in +theorem stage_mem {C D rD Labels : ZFSet.{u}} + (source : GroundChronologicalMainStage M C D rD) (invariant : source.Invariant K Labels) : + source.stage.code ∈ level.carrier := + (level.membership _).2 ⟨source.stage.code_mem pairing, + invariant.code_rank_lt pairing unions powers separation infinite hK conditions⟩ + +include infinite hK conditions in +theorem birth_mem {C D rD Labels : ZFSet.{u}} + (source : GroundChronologicalMainStage M C D rD) (invariant : source.Invariant K Labels) : + source.birth ∈ level.carrier := + (level.membership _).2 ⟨source.birth_ground, + invariant.birth_rank_lt pairing unions powers separation infinite hK conditions⟩ + +include infinite hK conditions in +theorem transition_mem {C D rD Labels : ZFSet.{u}} + {source target : GroundChronologicalMainStage M C D rD} + (transition : GroundMainTransition source.stage target.stage) + (first : source.Invariant K Labels) (second : target.Invariant K Labels) : + transition.code ∈ level.carrier := + (level.membership _).2 ⟨transition.code_mem pairing, + transition.code_rank_lt_inaccessible pairing unions powers separation infinite hK conditions + first.points_rank second.points_rank first.actors_rank second.actors_rank⟩ + +theorem relationSpace_ground {I : ZFSet.{u}} (hI : I ∈ M.sets) : + M.groundRelations I level.carrier ∈ M.sets := + M.groundRelations_mem pairing unions powers separation hI level.carrier_ground + +end GroundMainCandidateLevel + + + + + + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) + +noncomputable def validStages (C D rD : ZFSet.{u}) : ZFSet.{u} := + M.mainStageCandidates level.carrier C D rD + +theorem validStages_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {C D rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + level.validStages C D rD ∈ M.sets := + M.mainStageCandidates_mem pairing unions powers separation infinite level.carrier_ground hC hD hrD + +theorem invariant_mem_validStages + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + {C D rD Labels : ZFSet.{u}} (source : GroundChronologicalMainStage M C D rD) + (invariant : source.Invariant K Labels) : source.stage.code ∈ level.validStages C D rD := + M.mainStage_code_mem_candidates source.stage + (level.stage_mem pairing unions powers separation infinite hK conditions source invariant) + +theorem validStageFamily_rank_lt + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + {I C D rD f : ZFSet.{u}} (hI : I ∈ K) (hf : f ∈ M.sets) + (function : ZFSet.IsFunc I (level.validStages C D rD) f) : + ZFSet.rank f < ZFSet.rank K := by + apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite + hK hI hf ⟨level.validStages C D rD, function⟩ + intro i _ v entry + have hv := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + have inLevel := ((M.mem_mainStageCandidates level.carrier C D rD v).1 hv).1 + exact ((level.membership v).1 inLevel).2 + +end GroundMainCandidateLevel + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundMainSeedCandidates + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + certificate.target.Invariant K C ∧ + level.validStages C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ + seed.source.stage.code ∈ level.validStages C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ + certificate.target.stage.code ∈ level.validStages C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ + seed.source.birth ∈ level.carrier ∧ certificate.target.birth ∈ level.carrier ∧ + certificate.transition.map.code ∈ level.carrier := by + dsimp only + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨level⟩ := M.exists_groundMainCandidateLevel pairing unions powers separation collection hK conditions.1 + obtain ⟨seed, certificate, invariant, _⟩ := M.exists_groundInitialMainSeedSuccessor + pairing unions powers separation collection infinite choice hK standard + exact ⟨level, seed, certificate, invariant, + level.validStages_ground pairing unions powers separation infinite seed.source.stage.columns_ground + seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, + level.invariant_mem_validStages pairing unions powers separation infinite hK conditions seed.source seed.invariant, + level.invariant_mem_validStages pairing unions powers separation infinite hK conditions certificate.target invariant, + level.birth_mem pairing unions powers separation infinite hK conditions seed.source seed.invariant, + level.birth_mem pairing unions powers separation infinite hK conditions certificate.target invariant, + level.transition_mem pairing unions powers separation infinite hK conditions certificate.transition.map seed.invariant invariant⟩ + +end TransitiveGround + + + + + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) + +noncomputable def validChronologies (C D rD : ZFSet.{u}) : ZFSet.{u} := + M.serializedChronologyCandidates level.carrier C D rD + +theorem validChronologies_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {C D rD : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + level.validChronologies C D rD ∈ M.sets := + M.serializedChronologyCandidates_mem pairing unions powers separation infinite + level.carrier_ground hC hD hrD + +theorem ranked_mem_validChronologies + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {T C D rD : ZFSet.{u}} (serial : GroundSerializedChronology M T C D rD) + (rank : ZFSet.rank serial.code < ZFSet.rank K) : + serial.code ∈ level.validChronologies C D rD := + M.serializedChronology_code_mem_candidates serial + ((level.membership _).2 ⟨serial.code_ground pairing, rank⟩) + +theorem validChronologyFamily_rank_lt + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + {I C D rD f : ZFSet.{u}} (hI : I ∈ K) (hf : f ∈ M.sets) + (function : ZFSet.IsFunc I (level.validChronologies C D rD) f) : + ZFSet.rank f < ZFSet.rank K := by + apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite + hK hI hf ⟨level.validChronologies C D rD, function⟩ + intro i _ v entry + have member := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + have inLevel := ((M.mem_serializedChronologyCandidates level.carrier C D rD v).1 member).1 + exact ((level.membership v).1 inLevel).2 + +end GroundMainCandidateLevel + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialChronologyCandidates + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, ∃ seed : GroundInitialMainSeedData M K C, + ∃ serial : GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) + C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), + level.validChronologies C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ + serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ + serial.fields.graph = seed.source.stage.initialChronologyGraph ∧ + serial.toHistory.space ∅ = seed.source.stage.carrier ∧ + serial.toHistory.order ∅ = seed.source.stage.order ∧ + serial.toHistory.meetGraph ∅ = seed.source.stage.meetGraph ∧ + serial.toHistory.birth ∅ = seed.source.birth ∧ + serial.toHistory.height ∅ = seed.source.stage.height := by + dsimp only + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨level⟩ := M.exists_groundMainCandidateLevel pairing unions powers separation collection hK conditions.1 + obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite collection hK conditions + obtain ⟨injection, _, injected, hInjection, _, rank, fields, values⟩ := + seed.exists_rankedInitialSerialization pairing unions powers separation infinite hK conditions + let serial := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected + exact ⟨level, seed, serial, + level.validChronologies_ground pairing unions powers separation infinite seed.source.stage.columns_ground + seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, + level.ranked_mem_validChronologies pairing serial rank, fields, values⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSharedRefinementValidity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSharedRefinementValidity.lean index 62cabadab61f59117da6239690722d7a749775e0..3a4744e7167bcbdcaf66d90e6db97e54294df3de 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSharedRefinementValidity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSharedRefinementValidity.lean @@ -1,63 +1,63 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSharedConditionalNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (J : Fin 3 → ZFSet.{u}) (hJ : ∀ i, J i ∈ M.sets) -variable (valid : ∀ i, ∀ z ∈ J i, IsName s z) -variable (env : Assignment (M.nameDomain s) 4) - -noncomputable def refinementConditionAssignment : Assignment (M.nameDomain s) 4 := - let names : Fin 3 → (M.nameDomain s).names := fun i => - ⟨Name.refinementConditionNames (M.nameDomain s) env J valid i, - M.sharedConditionName_mem s pairing unions powers separation collection carrier order - BoundedFormula.refinementValidityFormula.toFormula env i.castSucc (hJ i) (valid i)⟩ - ![names 0, names 1, names 2, env 3] - -theorem refinementConditionAssignment_entry (i : Fin 3) : - ((M.refinementConditionAssignment s pairing unions powers separation collection - carrier order J hJ valid env) i.castSucc).val = - Name.refinementConditionNames (M.nameDomain s) env J valid i := by - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j))) i - -theorem refinementConditionAssignment_last : - (M.refinementConditionAssignment s pairing unions powers separation collection - carrier order J hJ valid env) 3 = env 3 := rfl - -include pairing unions powers separation collection carrier order hJ in -theorem sharedRefinementValidity_top (small : M.sets.Countable) - (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (J i) s.carrier) : - Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula - (M.refinementConditionAssignment s pairing unions powers separation collection - carrier order J hJ valid env) ⊤ := by - apply (M.ordinaryForces_iff_all_generics s small carrier _ _ ⊤).2 - intro H _ generic - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {p | H.mem p}, - (M.nameDomain s).values_transitive {p | H.mem p}⟩ - let newEnv := M.refinementConditionAssignment s pairing unions powers separation collection - carrier order J hJ valid env - apply (evaluated.realize_refinementValidityFormula - (evalAssignment {p | H.mem p} newEnv) (fun i => ⟨newEnv i, rfl⟩)).2 - have family : ∀ i, Name.familySet ⊤ (J i) (valid i) ∈ (M.nameDomain s).names := - fun i => M.familySet_mem s ⊤ pairing unions powers separation (hJ i) - (M.transitive carrier (s.encode_mem ⊤)) (valid i) - exact Name.eval_refinementConditionNames_valid (M.nameDomain s) env J valid - family H generic shape - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSharedConditionalNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (J : Fin 3 → ZFSet.{u}) (hJ : ∀ i, J i ∈ M.sets) +variable (valid : ∀ i, ∀ z ∈ J i, IsName s z) +variable (env : Assignment (M.nameDomain s) 4) + +noncomputable def refinementConditionAssignment : Assignment (M.nameDomain s) 4 := + let names : Fin 3 → (M.nameDomain s).names := fun i => + ⟨Name.refinementConditionNames (M.nameDomain s) env J valid i, + M.sharedConditionName_mem s pairing unions powers separation collection carrier order + BoundedFormula.refinementValidityFormula.toFormula env i.castSucc (hJ i) (valid i)⟩ + ![names 0, names 1, names 2, env 3] + +theorem refinementConditionAssignment_entry (i : Fin 3) : + ((M.refinementConditionAssignment s pairing unions powers separation collection + carrier order J hJ valid env) i.castSucc).val = + Name.refinementConditionNames (M.nameDomain s) env J valid i := by + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun j => Fin.elim0 j))) i + +theorem refinementConditionAssignment_last : + (M.refinementConditionAssignment s pairing unions powers separation collection + carrier order J hJ valid env) 3 = env 3 := rfl + +include pairing unions powers separation collection carrier order hJ in +theorem sharedRefinementValidity_top (small : M.sets.Countable) + (shape : ∀ i : Fin 3, (env i.castSucc).val.val ⊆ ZFSet.prod (J i) s.carrier) : + Forces (M.nameDomain s) BoundedFormula.refinementValidityFormula.toFormula + (M.refinementConditionAssignment s pairing unions powers separation collection + carrier order J hJ valid env) ⊤ := by + apply (M.ordinaryForces_iff_all_generics s small carrier _ _ ⊤).2 + intro H _ generic + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {p | H.mem p}, + (M.nameDomain s).values_transitive {p | H.mem p}⟩ + let newEnv := M.refinementConditionAssignment s pairing unions powers separation collection + carrier order J hJ valid env + apply (evaluated.realize_refinementValidityFormula + (evalAssignment {p | H.mem p} newEnv) (fun i => ⟨newEnv i, rfl⟩)).2 + have family : ∀ i, Name.familySet ⊤ (J i) (valid i) ∈ (M.nameDomain s).names := + fun i => M.familySet_mem s ⊤ pairing unions powers separation (hJ i) + (M.transitive carrier (s.encode_mem ⊤)) (valid i) + exact Name.eval_refinementConditionNames_valid (M.nameDomain s) env J valid + family H generic shape + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSingleAttachment.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSingleAttachment.lean index f61a37c5537350a5d6f2abff3e556fddd3bfad45..7cf3bf6a49b43a019da5245cc36357b1682fa2f2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSingleAttachment.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundSingleAttachment.lean @@ -1,711 +1,711 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PairPushFilterFamilies -import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -structure SingleAttachmentInputs (P Q rP rQ μP μQ ell F a e : ZFSet.{u}) : Prop where - oldOrder : MeetOrderCode P rP μP - templateOrder : MeetOrderCode Q rQ μQ - anchor_mem : a ∈ Q - base_function : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell - base_order : ∀ x y x' y', ZFSet.pair x x' ∈ ell → ZFSet.pair y y' ∈ ell → - (ZFSet.pair x' y' ∈ rP ↔ ZFSet.pair x y ∈ rQ) - base_meet : ∀ x y z x' y' z', ZFSet.pair (ZFSet.pair x y) z ∈ μQ → - ZFSet.pair x x' ∈ ell → ZFSet.pair y y' ∈ ell → ZFSet.pair z z' ∈ ell → - ZFSet.pair (ZFSet.pair x' y') z' ∈ μP - filter : MeetFilterCode P rP μP F - separator_mem : e ∈ P - base_le_separator : ∀ b, ZFSet.pair a b ∈ ell → ZFSet.pair b e ∈ rP - separator_not_le_base : ∀ b, ZFSet.pair a b ∈ ell → ZFSet.pair e b ∉ rP - separator_le_upper : ∀ y ∈ F, ZFSet.pair e y ∈ rP - -namespace SingleAttachmentInputs - -variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} -variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) - -abbrev Base := {q : {q : ZFSet.{u} // q ∈ Q} // - d.templateOrder.toMeetOrder.le q ⟨a, d.anchor_mem⟩} - -theorem base_mem (q : d.Base) : q.val.val ∈ attachmentIdeal Q rQ a := - (mem_attachmentIdeal Q rQ a q.val.val).2 ⟨q.val.property, q.property⟩ - -noncomputable def baseMap (q : d.Base) : {p : ZFSet.{u} // p ∈ P} := - ⟨(d.base_function.2 q.val.val (d.base_mem q)).choose, - (ZFSet.pair_mem_prod.1 (d.base_function.1 - (d.base_function.2 q.val.val (d.base_mem q)).choose_spec.1)).2⟩ - -theorem baseMap_entry (q : d.Base) : ZFSet.pair q.val.val (d.baseMap q).val ∈ ell := - (d.base_function.2 q.val.val (d.base_mem q)).choose_spec.1 - -noncomputable def baseEmbedding : - MeetEmbedding (Attachment.idealOrder d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩) - d.oldOrder.toMeetOrder where - toFun := d.baseMap - le_iff x y := d.base_order _ _ _ _ (d.baseMap_entry x) (d.baseMap_entry y) - map_meet x y := by - apply Subtype.ext - have entry := d.base_meet _ _ _ _ _ _ - (d.templateOrder.toMeetOrder_meet_entry x.val y.val) - (d.baseMap_entry x) (d.baseMap_entry y) - (d.baseMap_entry ((Attachment.idealOrder d.templateOrder.toMeetOrder - ⟨a, d.anchor_mem⟩).meet x y)) - obtain ⟨z, _, unique⟩ := d.oldOrder.operation.2 - (ZFSet.pair (d.baseMap x).val (d.baseMap y).val) - (ZFSet.pair_mem_prod.2 ⟨(d.baseMap x).property, (d.baseMap y).property⟩) - exact (unique _ entry).trans - (unique _ (d.oldOrder.toMeetOrder_meet_entry (d.baseMap x) (d.baseMap y))).symm - -noncomputable def templates : Attachment.Templates d.oldOrder.toMeetOrder Unit where - Space _ := {q : ZFSet.{u} // q ∈ Q} - order _ := d.templateOrder.toMeetOrder - anchor _ := ⟨a, d.anchor_mem⟩ - embed _ := d.baseEmbedding - upper _ x := x.val ∈ F - upper_nonempty _ := by - obtain ⟨x, hx⟩ := d.filter.nonempty - exact ⟨⟨x, d.filter.subset hx⟩, hx⟩ - upper_up := by - intro i x y hx lower - exact d.filter.upward x.val hx y.val y.property lower - upper_meet := by - intro i x y hx hy - exact d.filter.closed_meet x.val hx y.val hy _ - (d.oldOrder.toMeetOrder_meet_entry x y) - separator _ := ⟨e, d.separator_mem⟩ - base_le_separator _ := d.base_le_separator _ (d.baseMap_entry _) - separator_not_le_base _ := d.separator_not_le_base _ (d.baseMap_entry _) - separator_le_upper _ _ hy := d.separator_le_upper _ hy - -theorem shadow_entry (q : d.templates.Fresh) : - ZFSet.pair q.2.val.val (d.templates.shadow q).val ∈ - attachmentShadowGraph Q P μQ ell a := by - apply (pair_mem_attachmentShadowGraph Q P μQ ell a _ _).2 - refine ⟨q.2.val.property, (d.templates.shadow q).property, - (d.templateOrder.toMeetOrder.meet q.2.val ⟨a, d.anchor_mem⟩).val, - (d.templateOrder.toMeetOrder.meet q.2.val ⟨a, d.anchor_mem⟩).property, - d.templateOrder.toMeetOrder_meet_entry _ _, ?_⟩ - exact d.baseMap_entry (Attachment.cut d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩ q.2.val) - -end SingleAttachmentInputs - - - - - - -structure AttachmentBatchInputs - (P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}) : Prop where - oldOrder : MeetOrderCode P rP μP - spaces : FunctionGraphOn I Qs - relations : FunctionGraphOn I rs - meets : FunctionGraphOn I μs - anchors : FunctionGraphOn I As - embeddings : FunctionGraphOn I Es - filters : FunctionGraphOn I Fs - separators : FunctionGraphOn I Ss - valid : ∀ i ∈ I, ∀ Q r μ a ell F e, - ZFSet.pair i Q ∈ Qs → ZFSet.pair i r ∈ rs → ZFSet.pair i μ ∈ μs → - ZFSet.pair i a ∈ As → ZFSet.pair i ell ∈ Es → ZFSet.pair i F ∈ Fs → - ZFSet.pair i e ∈ Ss → SingleAttachmentInputs P Q rP r μP μ ell F a e - -namespace AttachmentBatchInputs - -variable {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - -noncomputable abbrev space (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.spaces.value i -noncomputable abbrev rel (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.relations.value i -noncomputable abbrev meet (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.meets.value i -noncomputable abbrev anchor (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.anchors.value i -noncomputable abbrev embed (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.embeddings.value i -noncomputable abbrev filter (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.filters.value i -noncomputable abbrev separator (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.separators.value i - -theorem space_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.space i) ∈ Qs := - d.spaces.value_entry i - -theorem rel_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.rel i) ∈ rs := - d.relations.value_entry i - -theorem meet_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.meet i) ∈ μs := - d.meets.value_entry i - -theorem anchor_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.anchor i) ∈ As := - d.anchors.value_entry i - -theorem embed_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.embed i) ∈ Es := - d.embeddings.value_entry i - -theorem filter_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.filter i) ∈ Fs := - d.filters.value_entry i - -theorem separator_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.separator i) ∈ Ss := - d.separators.value_entry i - -theorem fiber (i : {i : ZFSet.{u} // i ∈ I}) : - SingleAttachmentInputs P (d.space i) rP (d.rel i) μP (d.meet i) - (d.embed i) (d.filter i) (d.anchor i) (d.separator i) := - d.valid i.val i.property _ _ _ _ _ _ _ (d.space_entry i) (d.rel_entry i) - (d.meet_entry i) (d.anchor_entry i) (d.embed_entry i) (d.filter_entry i) (d.separator_entry i) - -noncomputable def templates : - Attachment.Templates d.oldOrder.toMeetOrder {i : ZFSet.{u} // i ∈ I} where - Space i := {q : ZFSet.{u} // q ∈ d.space i} - order i := (d.fiber i).templateOrder.toMeetOrder - anchor i := ⟨d.anchor i, (d.fiber i).anchor_mem⟩ - embed i := (d.fiber i).baseEmbedding - upper i x := x.val ∈ d.filter i - upper_nonempty i := by - obtain ⟨x, hx⟩ := (d.fiber i).filter.nonempty - exact ⟨⟨x, (d.fiber i).filter.subset hx⟩, hx⟩ - upper_up := by - intro i x y hx lower - exact (d.fiber i).filter.upward x.val hx y.val y.property lower - upper_meet := by - intro i x y hx hy - exact (d.fiber i).filter.closed_meet x.val hx y.val hy _ - (d.oldOrder.toMeetOrder_meet_entry x y) - separator i := ⟨d.separator i, (d.fiber i).separator_mem⟩ - base_le_separator i := (d.fiber i).base_le_separator _ ((d.fiber i).baseMap_entry _) - separator_not_le_base i := (d.fiber i).separator_not_le_base _ ((d.fiber i).baseMap_entry _) - separator_le_upper i _ hy := (d.fiber i).separator_le_upper _ hy - -end AttachmentBatchInputs - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.SingleAttachmentInputs - -universe u -variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} -variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) - -abbrev Nodes := {p : ZFSet.{u} // p ∈ P} ⊕ d.templates.Fresh - -def encode : d.Nodes → ZFSet.{u} - | .inl p => p.val - | .inr q => ZFSet.pair P q.2.val.val - -noncomputable abbrev carrier (_d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) := taggedExtension P (freshPart Q rQ a) -noncomputable abbrev order (_d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) := singleAttachmentOrder P (freshPart Q rQ a) rP rQ - (attachmentShadowGraph Q P μQ ell a) F -noncomputable abbrev meetGraph := canonicalMeetGraph d.carrier d.order - -theorem fresh_mem (q : d.templates.Fresh) : q.2.val.val ∈ freshPart Q rQ a := - (mem_freshPart Q rQ a _).2 ⟨q.2.val.property, q.2.property⟩ - -theorem encode_mem (x : d.Nodes) : d.encode x ∈ d.carrier := by - cases x with - | inl p => exact old_mem_taggedExtension p.property - | inr q => exact pair_mem_taggedExtension.2 (d.fresh_mem q) - -theorem encode_injective : Function.Injective d.encode := by - intro x y eq - cases x with - | inl p => - cases y with - | inl s => exact congrArg Sum.inl (Subtype.ext eq) - | inr q => - change p.val = ZFSet.pair P q.2.val.val at eq - exact False.elim (pair_tag_not_mem P q.2.val.val (eq ▸ p.property)) - | inr q => - cases y with - | inl p => - change ZFSet.pair P q.2.val.val = p.val at eq - exact False.elim (pair_tag_not_mem P q.2.val.val (eq.symm ▸ p.property)) - | inr t => - apply congrArg Sum.inr - rcases q with ⟨i, q⟩ - rcases t with ⟨j, t⟩ - cases i - cases j - exact congrArg (Sigma.mk ()) (Subtype.ext (Subtype.ext (ZFSet.pair_inj.1 eq).2)) - -theorem encode_surjective : ∀ z ∈ d.carrier, ∃ x : d.Nodes, d.encode x = z := by - intro z hz - rcases mem_taggedExtension.1 hz with old | ⟨q, hq, eq⟩ - · exact ⟨.inl ⟨z, old⟩, rfl⟩ - · have fresh := (mem_freshPart Q rQ a q).1 hq - exact ⟨.inr ⟨(), ⟨⟨q, fresh.1⟩, fresh.2⟩⟩, eq.symm⟩ - -theorem fresh_lower_iff (q t : d.templates.Fresh) : - d.templates.extension.le (.inr q) (.inr t) ↔ - ZFSet.pair q.2.val.val t.2.val.val ∈ rQ := by - change Attachment.FreshLe d.templates.data q t ↔ _ - rw [Attachment.fresh_same_component d.templates.data (Subsingleton.elim _ _)] - rcases q with ⟨i, q⟩ - rcases t with ⟨j, t⟩ - cases i - cases j - constructor - · rintro ⟨h, lower⟩ - cases h - exact lower - · intro lower - exact ⟨rfl, lower⟩ - -theorem le_encode (x y : d.Nodes) : - ZFSet.pair (d.encode x) (d.encode y) ∈ d.order ↔ d.templates.extension.le x y := by - rw [pair_mem_singleAttachmentOrder] - have bounded : d.encode x ∈ d.carrier ∧ d.encode y ∈ d.carrier := - ⟨d.encode_mem x, d.encode_mem y⟩ - simp only [bounded.1, bounded.2, true_and] - cases x with - | inl p => - cases y with - | inl s => - change singleAttachmentLe P _ rP rQ _ F p.val s.val ↔ ZFSet.pair p.val s.val ∈ rP - constructor - · rintro (h | h | h | h) - · exact h.2.2 - · obtain ⟨_, q, _, t, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P q (eq ▸ s.property)) - · obtain ⟨⟨q, _, eq⟩, _⟩ := h - exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) - · obtain ⟨q, _, t, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) - · intro lower - exact Or.inl ⟨p.property, s.property, lower⟩ - | inr q => - change singleAttachmentLe P _ rP rQ _ F p.val (ZFSet.pair P q.2.val.val) ↔ - ZFSet.pair p.val (d.templates.shadow q).val ∈ rP - constructor - · rintro (h | h | h | h) - · exact False.elim (pair_tag_not_mem P q.2.val.val h.2.1) - · obtain ⟨_, t, _, s, _, eq, image, lower⟩ := h - have same : q.2.val.val = t := (ZFSet.pair_inj.1 eq).2 - subst t - have graph := attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function - obtain ⟨v, _, unique⟩ := graph.2 q.2.val.val q.2.val.property - have sameValue := (unique s image).trans (unique _ (d.shadow_entry q)).symm - exact sameValue ▸ lower - · obtain ⟨⟨t, _, eq⟩, _⟩ := h - exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) - · obtain ⟨t, _, s, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) - · intro lower - exact Or.inr (Or.inl ⟨p.property, q.2.val.val, d.fresh_mem q, - (d.templates.shadow q).val, (d.templates.shadow q).property, rfl, - d.shadow_entry q, lower⟩) - | inr q => - cases y with - | inl p => - change singleAttachmentLe P _ rP rQ _ F (ZFSet.pair P q.2.val.val) p.val ↔ p.val ∈ F - constructor - · rintro (h | h | h | h) - · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) - · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) - · exact h.2 - · obtain ⟨s, _, t, _, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) - · intro upper - exact Or.inr (Or.inr (Or.inl ⟨⟨q.2.val.val, d.fresh_mem q, rfl⟩, upper⟩)) - | inr t => - rw [d.fresh_lower_iff] - change singleAttachmentLe P _ rP rQ _ F - (ZFSet.pair P q.2.val.val) (ZFSet.pair P t.2.val.val) ↔ - ZFSet.pair q.2.val.val t.2.val.val ∈ rQ - constructor - · rintro (h | h | h | h) - · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) - · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) - · exact False.elim (pair_tag_not_mem P t.2.val.val (d.filter.subset h.2)) - · obtain ⟨s, _, v, _, eqQ, eqT, lower⟩ := h - have sameQ := (ZFSet.pair_inj.1 eqQ).2 - have sameT := (ZFSet.pair_inj.1 eqT).2 - exact sameQ.symm ▸ sameT.symm ▸ lower - · intro lower - exact Or.inr (Or.inr (Or.inr ⟨q.2.val.val, d.fresh_mem q, - t.2.val.val, d.fresh_mem t, rfl, rfl, lower⟩)) - -theorem partialOrder : PartialOrderCode d.carrier d.order where - relation := singleAttachmentOrder_shape P _ rP rQ _ F - refl z hz := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - exact (d.le_encode x x).2 (d.templates.extension.refl x) - antisymm z hz w hw zw wz := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - obtain ⟨y, rfl⟩ := d.encode_surjective w hw - exact congrArg d.encode (d.templates.extension.antisymm - ((d.le_encode x y).1 zw) ((d.le_encode y x).1 wz)) - trans z hz w hw v hv zw wv := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - obtain ⟨y, rfl⟩ := d.encode_surjective w hw - obtain ⟨t, rfl⟩ := d.encode_surjective v hv - exact (d.le_encode x t).2 (d.templates.extension.trans - ((d.le_encode x y).1 zw) ((d.le_encode y t).1 wv)) - -theorem encoded_meet_glb (x y : d.Nodes) : - GreatestLowerBoundCode d.carrier d.order (d.encode x) (d.encode y) - (d.encode (d.templates.extension.meet x y)) := by - refine ⟨(d.le_encode _ _).2 (d.templates.extension.meet_le_left x y), - (d.le_encode _ _).2 (d.templates.extension.meet_le_right x y), ?_⟩ - intro w hw wx wy - obtain ⟨z, rfl⟩ := d.encode_surjective w hw - exact (d.le_encode _ _).2 (d.templates.extension.le_meet - ((d.le_encode _ _).1 wx) ((d.le_encode _ _).1 wy)) - -theorem meetOrder : MeetOrderCode d.carrier d.order d.meetGraph := by - apply canonicalMeetGraph_code d.partialOrder - intro x hx y hy - obtain ⟨s, rfl⟩ := d.encode_surjective x hx - obtain ⟨t, rfl⟩ := d.encode_surjective y hy - exact ⟨d.encode (d.templates.extension.meet s t), d.encode_mem _, d.encoded_meet_glb s t⟩ - -theorem encoded_meet_entry (x y : d.Nodes) : - ZFSet.pair (ZFSet.pair (d.encode x) (d.encode y)) - (d.encode (d.templates.extension.meet x y)) ∈ d.meetGraph := - (pair_mem_canonicalMeetGraph _ _ _ _ _).2 - ⟨d.encode_mem x, d.encode_mem y, d.encode_mem _, d.encoded_meet_glb x y⟩ - -end PartitionPilot.Forcing.SingleAttachmentInputs - - - -namespace PartitionPilot.Forcing.SingleAttachmentInputs - -universe u - -theorem pushforward - {P Q L rP rQ rL μP μQ μL ell F a e S e' : ZFSet.{u}} - (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) - (target : MeetOrderCode L rL μL) - (embedding : MeetEmbeddingCode P L rP rL μP μL S) - (separator : ZFSet.pair e e' ∈ S) : - SingleAttachmentInputs L Q rL rQ μL μQ - (relationCompose (attachmentIdeal Q rQ a) P L ell S) - (pushFilterCode L rL S F) a e' where - oldOrder := target - templateOrder := d.templateOrder - anchor_mem := d.anchor_mem - base_function := relationCompose_function_of_subset d.base_function embedding.injection.function - (fun _ hx => hx) - base_order := by - intro x y x' y' first second - obtain ⟨_, _, u, _, xu, ux'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first - obtain ⟨_, _, v, _, yv, vy'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 second - exact (embedding.order_iff d.oldOrder target ux' vy').trans (d.base_order x y u v xu yv) - base_meet := by - intro x y z x' y' z' meetXYZ first second third - obtain ⟨_, _, u, _, xu, ux'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first - obtain ⟨_, _, v, _, yv, vy'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 second - obtain ⟨_, _, w, _, zw, wz'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 third - exact embedding.map_meet u v w x' y' z' - (d.base_meet x y z u v w meetXYZ xu yv zw) ux' vy' wz' - filter := meetFilter_pushFilter d.oldOrder target embedding d.filter - separator_mem := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 separator)).2 - base_le_separator := by - intro b entry - obtain ⟨_, _, c, _, base, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - exact embedding.monotone c e b e' (d.base_le_separator c base) image separator - separator_not_le_base := by - intro b entry lower - obtain ⟨_, _, c, _, base, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - exact d.separator_not_le_base c base ((embedding.order_iff d.oldOrder target separator image).1 lower) - separator_le_upper := by - intro y positive - exact pushFilter_lower_bound target embedding d.separator_le_upper separator positive - -end PartitionPilot.Forcing.SingleAttachmentInputs - - - -namespace PartitionPilot.Forcing.SingleAttachmentInputs - -universe u -variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} -variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) -include d - -theorem base_injection : InjectionCode (attachmentIdeal Q rQ a) P ell := by - refine ⟨d.base_function, ?_⟩ - intro x y z hx hy - have first := ZFSet.pair_mem_prod.1 (d.base_function.1 hx) - have second := ZFSet.pair_mem_prod.1 (d.base_function.1 hy) - have refl := d.oldOrder.order.refl z first.2 - exact d.templateOrder.order.antisymm x ((mem_attachmentIdeal Q rQ a x).1 first.1).1 - y ((mem_attachmentIdeal Q rQ a y).1 second.1).1 - ((d.base_order x y z z hx hy).1 refl) ((d.base_order y x z z hy hx).1 refl) - -theorem template_graph_entry (q : {q : ZFSet.{u} // q ∈ Q}) : - ZFSet.pair q.val (d.encode (d.templates.represent () q)) ∈ - attachmentTemplateEmbeddingGraph P Q rQ ell a := by - classical - by_cases below : d.templateOrder.toMeetOrder.le q ⟨a, d.anchor_mem⟩ - · rw [d.templates.represent_old () q below] - apply (attachmentTemplateEmbeddingGraph_of_ideal - ((mem_attachmentIdeal Q rQ a q.val).2 ⟨q.property, below⟩)).2 - exact d.baseMap_entry ⟨q, below⟩ - · rw [d.templates.represent_new () q below] - exact (attachmentTemplateEmbeddingGraph_of_fresh d.base_function - ((mem_freshPart Q rQ a q.val).2 ⟨q.property, below⟩)).2 rfl - -theorem template_graph_entry_iff (q : {q : ZFSet.{u} // q ∈ Q}) (y : ZFSet.{u}) : - ZFSet.pair q.val y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ - y = d.encode (d.templates.represent () q) := by - constructor - · intro entry - obtain ⟨w, _, unique⟩ := (attachmentTemplateEmbeddingGraph_isFunc d.base_function).2 q.val q.property - exact (unique y entry).trans (unique _ (d.template_graph_entry q)).symm - · intro eq - exact eq.symm ▸ d.template_graph_entry q - -theorem encoded_embedding_order_iff {A r μ graph : ZFSet.{u}} - (source : MeetOrderCode A r μ) - (embedding : MeetEmbedding source.toMeetOrder d.templates.extension) - (injection : InjectionCode A d.carrier graph) - (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, - ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) - {x y x' y' : ZFSet.{u}} (hx : ZFSet.pair x x' ∈ graph) (hy : ZFSet.pair y y' ∈ graph) : - ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ r := by - have hxA := (ZFSet.pair_mem_prod.1 (injection.function.1 hx)).1 - have hyA := (ZFSet.pair_mem_prod.1 (injection.function.1 hy)).1 - obtain ⟨w, _, uniqueX⟩ := injection.function.2 x hxA - obtain ⟨v, _, uniqueY⟩ := injection.function.2 y hyA - have eqX := (uniqueX x' hx).trans (uniqueX _ (entries ⟨x, hxA⟩)).symm - have eqY := (uniqueY y' hy).trans (uniqueY _ (entries ⟨y, hyA⟩)).symm - rw [eqX, eqY, d.le_encode] - exact embedding.le_iff ⟨x, hxA⟩ ⟨y, hyA⟩ - -theorem encoded_embedding_code {A r μ graph : ZFSet.{u}} - (source : MeetOrderCode A r μ) - (embedding : MeetEmbedding source.toMeetOrder d.templates.extension) - (injection : InjectionCode A d.carrier graph) - (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, - ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) : - MeetEmbeddingCode A d.carrier r d.order μ d.meetGraph graph := by - refine ⟨injection, ?_, ?_⟩ - · intro x y x' y' lower hx hy - exact (d.encoded_embedding_order_iff source embedding injection entries hx hy).2 lower - · intro x y z x' y' z' meet hx hy hz - have hxA := (ZFSet.pair_mem_prod.1 (injection.function.1 hx)).1 - have hyA := (ZFSet.pair_mem_prod.1 (injection.function.1 hy)).1 - have hzA := (ZFSet.pair_mem_prod.1 (injection.function.1 hz)).1 - let X : {x : ZFSet.{u} // x ∈ A} := ⟨x, hxA⟩ - let Y : {y : ZFSet.{u} // y ∈ A} := ⟨y, hyA⟩ - let Z : {z : ZFSet.{u} // z ∈ A} := ⟨z, hzA⟩ - have image_eq (t : {t : ZFSet.{u} // t ∈ A}) (v : ZFSet.{u}) - (entry : ZFSet.pair t.val v ∈ graph) : v = d.encode (embedding.toFun t) := by - obtain ⟨w, _, unique⟩ := injection.function.2 t.val t.property - exact (unique v entry).trans (unique _ (entries t)).symm - have meet_eq : source.toMeetOrder.meet X Y = Z := by - apply Subtype.ext - obtain ⟨w, _, unique⟩ := source.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.2 ⟨hxA, hyA⟩) - exact (unique _ (source.toMeetOrder_meet_entry X Y)).trans (unique z meet).symm - have mapped : embedding.toFun Z = - d.templates.extension.meet (embedding.toFun X) (embedding.toFun Y) := by - rw [← meet_eq] - exact embedding.map_meet X Y - rw [image_eq X x' hx, image_eq Y y' hy, image_eq Z z' hz, mapped] - exact d.encoded_meet_entry (embedding.toFun X) (embedding.toFun Y) - -theorem old_embedding_code : - MeetEmbeddingCode P d.carrier rP d.order μP d.meetGraph (attachmentOldEmbeddingGraph P) := by - apply d.encoded_embedding_code d.oldOrder d.templates.oldEmbedding - (attachmentOldEmbeddingGraph_injection P (freshPart Q rQ a)) - intro p - exact (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩ - -theorem template_embedding_code : - MeetEmbeddingCode Q d.carrier rQ d.order μQ d.meetGraph - (attachmentTemplateEmbeddingGraph P Q rQ ell a) := - d.encoded_embedding_code d.templateOrder (d.templates.templateEmbedding ()) - (attachmentTemplateEmbeddingGraph_injection d.base_injection) d.template_graph_entry - -theorem old_order_iff {x y x' y' : ZFSet.{u}} - (hx : ZFSet.pair x x' ∈ attachmentOldEmbeddingGraph P) - (hy : ZFSet.pair y y' ∈ attachmentOldEmbeddingGraph P) : - ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ rP := by - apply d.encoded_embedding_order_iff d.oldOrder d.templates.oldEmbedding - (attachmentOldEmbeddingGraph_injection P (freshPart Q rQ a)) - (fun p => (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩) hx hy - -theorem template_order_iff {x y x' y' : ZFSet.{u}} - (hx : ZFSet.pair x x' ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a) - (hy : ZFSet.pair y y' ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a) : - ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ rQ := - d.encoded_embedding_order_iff d.templateOrder (d.templates.templateEmbedding ()) - (attachmentTemplateEmbeddingGraph_injection d.base_injection) d.template_graph_entry hx hy - -theorem template_old_agreement {q p : ZFSet.{u}} (entry : ZFSet.pair q p ∈ ell) : - ZFSet.pair q p ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ∧ - ZFSet.pair p p ∈ attachmentOldEmbeddingGraph P := by - have shape := ZFSet.pair_mem_prod.1 (d.base_function.1 entry) - exact ⟨(attachmentTemplateEmbeddingGraph_of_ideal shape.1).2 entry, - (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨shape.2, rfl⟩⟩ - -theorem template_shadow_entry (q : {q : ZFSet.{u} // q ∈ Q}) : - ZFSet.pair q.val - (d.baseMap (Attachment.cut d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩ q)).val ∈ - attachmentShadowGraph Q P μQ ell a := by - apply (pair_mem_attachmentShadowGraph Q P μQ ell a _ _).2 - refine ⟨q.property, (d.baseMap _).property, - (d.templateOrder.toMeetOrder.meet q ⟨a, d.anchor_mem⟩).val, - (d.templateOrder.toMeetOrder.meet q ⟨a, d.anchor_mem⟩).property, - d.templateOrder.toMeetOrder_meet_entry _ _, ?_⟩ - exact d.baseMap_entry (Attachment.cut d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩ q) - -theorem old_below_template_iff {q q' s : ZFSet.{u}} - (templateEntry : ZFSet.pair q q' ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a) - (shadowEntry : ZFSet.pair q s ∈ attachmentShadowGraph Q P μQ ell a) : - ∀ p ∈ P, ZFSet.pair p q' ∈ d.order ↔ ZFSet.pair p s ∈ rP := by - intro p hp - have qQ := (ZFSet.pair_mem_prod.1 - ((attachmentTemplateEmbeddingGraph_isFunc d.base_function).1 templateEntry)).1 - let qRaw : {q : ZFSet.{u} // q ∈ Q} := ⟨q, qQ⟩ - have encoded := (d.template_graph_entry_iff qRaw q').1 templateEntry - have shadowFunction := attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function - obtain ⟨v, _, unique⟩ := shadowFunction.2 q qQ - have shadow := (unique s shadowEntry).trans (unique _ (d.template_shadow_entry qRaw)).symm - rw [encoded, shadow] - change ZFSet.pair (d.encode (.inl ⟨p, hp⟩)) (d.encode (d.templates.represent () qRaw)) ∈ d.order ↔ _ - rw [d.le_encode] - exact d.templates.old_below_represent () qRaw ⟨p, hp⟩ - -end PartitionPilot.Forcing.SingleAttachmentInputs - - - -namespace PartitionPilot.Forcing.SingleAttachmentInputs - -universe u -variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} -variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) - -theorem fresh_old_upper_iff {q p : ZFSet.{u}} - (hq : q ∈ freshPart Q rQ a) (hp : p ∈ P) : - ZFSet.pair (ZFSet.pair P q) p ∈ d.order ↔ p ∈ F := by - have qParts := (mem_freshPart Q rQ a q).1 hq - exact d.le_encode (.inr ⟨(), ⟨⟨q, qParts.1⟩, qParts.2⟩⟩) (.inl ⟨p, hp⟩) - -theorem fresh_old_meet_code {q p s v : ZFSet.{u}} - (hq : q ∈ freshPart Q rQ a) (hp : p ∈ P) - (shadow : ZFSet.pair q s ∈ attachmentShadowGraph Q P μQ ell a) - (oldMeet : ZFSet.pair (ZFSet.pair s p) v ∈ μP) - (notAbove : ZFSet.pair (ZFSet.pair P q) p ∉ d.order) : - ZFSet.pair (ZFSet.pair (ZFSet.pair P q) p) v ∈ d.meetGraph := by - have qParts := (mem_freshPart Q rQ a q).1 hq - let x : d.templates.Fresh := ⟨(), ⟨⟨q, qParts.1⟩, qParts.2⟩⟩ - let y : {p : ZFSet.{u} // p ∈ P} := ⟨p, hp⟩ - have graph := attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function - obtain ⟨w, _, unique⟩ := graph.2 q qParts.1 - have sameShadow : s = (d.templates.shadow x).val := - (unique s shadow).trans (unique _ (d.shadow_entry x)).symm - have decoded := d.oldOrder.toMeetOrder_meet_entry (d.templates.shadow x) y - obtain ⟨m, _, uniqueMeet⟩ := d.oldOrder.operation.2 - (ZFSet.pair (d.templates.shadow x).val p) - (ZFSet.pair_mem_prod.2 ⟨(d.templates.shadow x).property, hp⟩) - have sameMeet : v = (d.oldOrder.toMeetOrder.meet (d.templates.shadow x) y).val := - (uniqueMeet v (sameShadow ▸ oldMeet)).trans (uniqueMeet _ decoded).symm - have notUpper : ¬ d.templates.upper x.1 y := by - intro upper - exact notAbove ((d.fresh_old_upper_iff hq hp).2 upper) - have eq := d.templates.shadow_meet_eq x y notUpper - have result := d.encoded_meet_entry (.inr x) (.inl y) - rw [eq] at result - exact sameMeet.symm ▸ result - -theorem greatest_preserved {T : ZFSet.{u}} (hT : T ∈ P) - (greatest : ∀ p ∈ P, ZFSet.pair p T ∈ rP) : - ∀ z ∈ d.carrier, ZFSet.pair z T ∈ d.order := by - intro z hz - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - exact (d.le_encode x (.inl ⟨T, hT⟩)).2 - (d.templates.greatest_preserved ⟨T, hT⟩ (fun p => greatest p.val p.property) x) - -theorem least_preserved {zero : ZFSet.{u}} (hzero : zero ∈ P) - (least : ∀ p ∈ P, ZFSet.pair zero p ∈ rP) : - ∀ z ∈ d.carrier, ZFSet.pair zero z ∈ d.order := by - intro z hz - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - exact (d.le_encode (.inl ⟨zero, hzero⟩) x).2 - (d.templates.least_preserved ⟨zero, hzero⟩ (fun p => least p.val p.property) x) - -end PartitionPilot.Forcing.SingleAttachmentInputs - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem singleAttachment_ground_codes - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} - (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) - (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) - (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) - (hF : F ∈ M.sets) : - d.carrier ∈ M.sets ∧ attachmentShadowGraph Q P μQ ell a ∈ M.sets ∧ - d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets ∧ - attachmentTemplateEmbeddingGraph P Q rQ ell a ∈ M.sets := by - have ha := M.transitive hQ d.anchor_mem - have hN := M.freshPart_mem separation hQ hrQ ha - have hL := M.taggedExtension_mem pairing unions powers separation hP hN - have hs := M.attachmentShadowGraph_mem pairing unions powers separation hQ hP hμQ hell ha - have hr := M.singleAttachmentOrder_mem pairing unions powers separation hP hN hrP hrQ hs hF - exact ⟨hL, hs, hr, M.canonicalMeetGraph_mem pairing unions powers separation hL hr, - M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP, - M.attachmentTemplateEmbeddingGraph_mem pairing unions powers separation hP hQ hrQ hell ha⟩ - -theorem exists_singleAttachment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} - (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) - (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) - (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) - (hF : F ∈ M.sets) : - ∃ L ∈ M.sets, ∃ shadow ∈ M.sets, ∃ r ∈ M.sets, ∃ μ ∈ M.sets, - ∃ oldMap ∈ M.sets, ∃ templateMap ∈ M.sets, - L = taggedExtension P (freshPart Q rQ a) ∧ - shadow = attachmentShadowGraph Q P μQ ell a ∧ - r = singleAttachmentOrder P (freshPart Q rQ a) rP rQ shadow F ∧ - μ = canonicalMeetGraph L r ∧ - oldMap = attachmentOldEmbeddingGraph P ∧ - templateMap = attachmentTemplateEmbeddingGraph P Q rQ ell a ∧ - MeetOrderCode L r μ ∧ - ZFSet.IsFunc Q P shadow ∧ - MeetEmbeddingCode P L rP r μP μ oldMap ∧ - MeetEmbeddingCode Q L rQ r μQ μ templateMap ∧ - (∀ p ∈ P, ZFSet.pair p p ∈ oldMap) ∧ - (∀ q ∈ attachmentIdeal Q rQ a, ∀ p, - ZFSet.pair q p ∈ templateMap ↔ ZFSet.pair q p ∈ ell) ∧ - (∀ q q' s, ZFSet.pair q q' ∈ templateMap → ZFSet.pair q s ∈ shadow → - ∀ p ∈ P, ZFSet.pair p q' ∈ r ↔ ZFSet.pair p s ∈ rP) ∧ - (∀ q ∈ freshPart Q rQ a, ∀ p ∈ P, ∀ s v, - ZFSet.pair q s ∈ shadow → ZFSet.pair (ZFSet.pair s p) v ∈ μP → - ZFSet.pair (ZFSet.pair P q) p ∉ r → - ZFSet.pair (ZFSet.pair (ZFSet.pair P q) p) v ∈ μ) := by - obtain ⟨hL, hs, hr, hμ, hi, hj⟩ := M.singleAttachment_ground_codes - pairing unions powers separation d hP hQ hrP hrQ hμQ hell hF - exact ⟨d.carrier, hL, attachmentShadowGraph Q P μQ ell a, hs, d.order, hr, - d.meetGraph, hμ, attachmentOldEmbeddingGraph P, hi, - attachmentTemplateEmbeddingGraph P Q rQ ell a, hj, - rfl, rfl, rfl, rfl, rfl, rfl, d.meetOrder, - attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function, - d.old_embedding_code, d.template_embedding_code, - fun p hp => (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨hp, rfl⟩, - (fun q hq p => attachmentTemplateEmbeddingGraph_of_ideal hq), - (fun q q' s entry shadow => d.old_below_template_iff entry shadow), - fun q hq p hp s v shadow oldMeet notAbove => - d.fresh_old_meet_code hq hp shadow oldMeet notAbove⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PairPushFilterFamilies +import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +structure SingleAttachmentInputs (P Q rP rQ μP μQ ell F a e : ZFSet.{u}) : Prop where + oldOrder : MeetOrderCode P rP μP + templateOrder : MeetOrderCode Q rQ μQ + anchor_mem : a ∈ Q + base_function : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell + base_order : ∀ x y x' y', ZFSet.pair x x' ∈ ell → ZFSet.pair y y' ∈ ell → + (ZFSet.pair x' y' ∈ rP ↔ ZFSet.pair x y ∈ rQ) + base_meet : ∀ x y z x' y' z', ZFSet.pair (ZFSet.pair x y) z ∈ μQ → + ZFSet.pair x x' ∈ ell → ZFSet.pair y y' ∈ ell → ZFSet.pair z z' ∈ ell → + ZFSet.pair (ZFSet.pair x' y') z' ∈ μP + filter : MeetFilterCode P rP μP F + separator_mem : e ∈ P + base_le_separator : ∀ b, ZFSet.pair a b ∈ ell → ZFSet.pair b e ∈ rP + separator_not_le_base : ∀ b, ZFSet.pair a b ∈ ell → ZFSet.pair e b ∉ rP + separator_le_upper : ∀ y ∈ F, ZFSet.pair e y ∈ rP + +namespace SingleAttachmentInputs + +variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} +variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) + +abbrev Base := {q : {q : ZFSet.{u} // q ∈ Q} // + d.templateOrder.toMeetOrder.le q ⟨a, d.anchor_mem⟩} + +theorem base_mem (q : d.Base) : q.val.val ∈ attachmentIdeal Q rQ a := + (mem_attachmentIdeal Q rQ a q.val.val).2 ⟨q.val.property, q.property⟩ + +noncomputable def baseMap (q : d.Base) : {p : ZFSet.{u} // p ∈ P} := + ⟨(d.base_function.2 q.val.val (d.base_mem q)).choose, + (ZFSet.pair_mem_prod.1 (d.base_function.1 + (d.base_function.2 q.val.val (d.base_mem q)).choose_spec.1)).2⟩ + +theorem baseMap_entry (q : d.Base) : ZFSet.pair q.val.val (d.baseMap q).val ∈ ell := + (d.base_function.2 q.val.val (d.base_mem q)).choose_spec.1 + +noncomputable def baseEmbedding : + MeetEmbedding (Attachment.idealOrder d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩) + d.oldOrder.toMeetOrder where + toFun := d.baseMap + le_iff x y := d.base_order _ _ _ _ (d.baseMap_entry x) (d.baseMap_entry y) + map_meet x y := by + apply Subtype.ext + have entry := d.base_meet _ _ _ _ _ _ + (d.templateOrder.toMeetOrder_meet_entry x.val y.val) + (d.baseMap_entry x) (d.baseMap_entry y) + (d.baseMap_entry ((Attachment.idealOrder d.templateOrder.toMeetOrder + ⟨a, d.anchor_mem⟩).meet x y)) + obtain ⟨z, _, unique⟩ := d.oldOrder.operation.2 + (ZFSet.pair (d.baseMap x).val (d.baseMap y).val) + (ZFSet.pair_mem_prod.2 ⟨(d.baseMap x).property, (d.baseMap y).property⟩) + exact (unique _ entry).trans + (unique _ (d.oldOrder.toMeetOrder_meet_entry (d.baseMap x) (d.baseMap y))).symm + +noncomputable def templates : Attachment.Templates d.oldOrder.toMeetOrder Unit where + Space _ := {q : ZFSet.{u} // q ∈ Q} + order _ := d.templateOrder.toMeetOrder + anchor _ := ⟨a, d.anchor_mem⟩ + embed _ := d.baseEmbedding + upper _ x := x.val ∈ F + upper_nonempty _ := by + obtain ⟨x, hx⟩ := d.filter.nonempty + exact ⟨⟨x, d.filter.subset hx⟩, hx⟩ + upper_up := by + intro i x y hx lower + exact d.filter.upward x.val hx y.val y.property lower + upper_meet := by + intro i x y hx hy + exact d.filter.closed_meet x.val hx y.val hy _ + (d.oldOrder.toMeetOrder_meet_entry x y) + separator _ := ⟨e, d.separator_mem⟩ + base_le_separator _ := d.base_le_separator _ (d.baseMap_entry _) + separator_not_le_base _ := d.separator_not_le_base _ (d.baseMap_entry _) + separator_le_upper _ _ hy := d.separator_le_upper _ hy + +theorem shadow_entry (q : d.templates.Fresh) : + ZFSet.pair q.2.val.val (d.templates.shadow q).val ∈ + attachmentShadowGraph Q P μQ ell a := by + apply (pair_mem_attachmentShadowGraph Q P μQ ell a _ _).2 + refine ⟨q.2.val.property, (d.templates.shadow q).property, + (d.templateOrder.toMeetOrder.meet q.2.val ⟨a, d.anchor_mem⟩).val, + (d.templateOrder.toMeetOrder.meet q.2.val ⟨a, d.anchor_mem⟩).property, + d.templateOrder.toMeetOrder_meet_entry _ _, ?_⟩ + exact d.baseMap_entry (Attachment.cut d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩ q.2.val) + +end SingleAttachmentInputs + + + + + + +structure AttachmentBatchInputs + (P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}) : Prop where + oldOrder : MeetOrderCode P rP μP + spaces : FunctionGraphOn I Qs + relations : FunctionGraphOn I rs + meets : FunctionGraphOn I μs + anchors : FunctionGraphOn I As + embeddings : FunctionGraphOn I Es + filters : FunctionGraphOn I Fs + separators : FunctionGraphOn I Ss + valid : ∀ i ∈ I, ∀ Q r μ a ell F e, + ZFSet.pair i Q ∈ Qs → ZFSet.pair i r ∈ rs → ZFSet.pair i μ ∈ μs → + ZFSet.pair i a ∈ As → ZFSet.pair i ell ∈ Es → ZFSet.pair i F ∈ Fs → + ZFSet.pair i e ∈ Ss → SingleAttachmentInputs P Q rP r μP μ ell F a e + +namespace AttachmentBatchInputs + +variable {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + +noncomputable abbrev space (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.spaces.value i +noncomputable abbrev rel (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.relations.value i +noncomputable abbrev meet (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.meets.value i +noncomputable abbrev anchor (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.anchors.value i +noncomputable abbrev embed (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.embeddings.value i +noncomputable abbrev filter (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.filters.value i +noncomputable abbrev separator (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.{u} := d.separators.value i + +theorem space_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.space i) ∈ Qs := + d.spaces.value_entry i + +theorem rel_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.rel i) ∈ rs := + d.relations.value_entry i + +theorem meet_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.meet i) ∈ μs := + d.meets.value_entry i + +theorem anchor_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.anchor i) ∈ As := + d.anchors.value_entry i + +theorem embed_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.embed i) ∈ Es := + d.embeddings.value_entry i + +theorem filter_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.filter i) ∈ Fs := + d.filters.value_entry i + +theorem separator_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (d.separator i) ∈ Ss := + d.separators.value_entry i + +theorem fiber (i : {i : ZFSet.{u} // i ∈ I}) : + SingleAttachmentInputs P (d.space i) rP (d.rel i) μP (d.meet i) + (d.embed i) (d.filter i) (d.anchor i) (d.separator i) := + d.valid i.val i.property _ _ _ _ _ _ _ (d.space_entry i) (d.rel_entry i) + (d.meet_entry i) (d.anchor_entry i) (d.embed_entry i) (d.filter_entry i) (d.separator_entry i) + +noncomputable def templates : + Attachment.Templates d.oldOrder.toMeetOrder {i : ZFSet.{u} // i ∈ I} where + Space i := {q : ZFSet.{u} // q ∈ d.space i} + order i := (d.fiber i).templateOrder.toMeetOrder + anchor i := ⟨d.anchor i, (d.fiber i).anchor_mem⟩ + embed i := (d.fiber i).baseEmbedding + upper i x := x.val ∈ d.filter i + upper_nonempty i := by + obtain ⟨x, hx⟩ := (d.fiber i).filter.nonempty + exact ⟨⟨x, (d.fiber i).filter.subset hx⟩, hx⟩ + upper_up := by + intro i x y hx lower + exact (d.fiber i).filter.upward x.val hx y.val y.property lower + upper_meet := by + intro i x y hx hy + exact (d.fiber i).filter.closed_meet x.val hx y.val hy _ + (d.oldOrder.toMeetOrder_meet_entry x y) + separator i := ⟨d.separator i, (d.fiber i).separator_mem⟩ + base_le_separator i := (d.fiber i).base_le_separator _ ((d.fiber i).baseMap_entry _) + separator_not_le_base i := (d.fiber i).separator_not_le_base _ ((d.fiber i).baseMap_entry _) + separator_le_upper i _ hy := (d.fiber i).separator_le_upper _ hy + +end AttachmentBatchInputs + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.SingleAttachmentInputs + +universe u +variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} +variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) + +abbrev Nodes := {p : ZFSet.{u} // p ∈ P} ⊕ d.templates.Fresh + +def encode : d.Nodes → ZFSet.{u} + | .inl p => p.val + | .inr q => ZFSet.pair P q.2.val.val + +noncomputable abbrev carrier (_d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) := taggedExtension P (freshPart Q rQ a) +noncomputable abbrev order (_d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) := singleAttachmentOrder P (freshPart Q rQ a) rP rQ + (attachmentShadowGraph Q P μQ ell a) F +noncomputable abbrev meetGraph := canonicalMeetGraph d.carrier d.order + +theorem fresh_mem (q : d.templates.Fresh) : q.2.val.val ∈ freshPart Q rQ a := + (mem_freshPart Q rQ a _).2 ⟨q.2.val.property, q.2.property⟩ + +theorem encode_mem (x : d.Nodes) : d.encode x ∈ d.carrier := by + cases x with + | inl p => exact old_mem_taggedExtension p.property + | inr q => exact pair_mem_taggedExtension.2 (d.fresh_mem q) + +theorem encode_injective : Function.Injective d.encode := by + intro x y eq + cases x with + | inl p => + cases y with + | inl s => exact congrArg Sum.inl (Subtype.ext eq) + | inr q => + change p.val = ZFSet.pair P q.2.val.val at eq + exact False.elim (pair_tag_not_mem P q.2.val.val (eq ▸ p.property)) + | inr q => + cases y with + | inl p => + change ZFSet.pair P q.2.val.val = p.val at eq + exact False.elim (pair_tag_not_mem P q.2.val.val (eq.symm ▸ p.property)) + | inr t => + apply congrArg Sum.inr + rcases q with ⟨i, q⟩ + rcases t with ⟨j, t⟩ + cases i + cases j + exact congrArg (Sigma.mk ()) (Subtype.ext (Subtype.ext (ZFSet.pair_inj.1 eq).2)) + +theorem encode_surjective : ∀ z ∈ d.carrier, ∃ x : d.Nodes, d.encode x = z := by + intro z hz + rcases mem_taggedExtension.1 hz with old | ⟨q, hq, eq⟩ + · exact ⟨.inl ⟨z, old⟩, rfl⟩ + · have fresh := (mem_freshPart Q rQ a q).1 hq + exact ⟨.inr ⟨(), ⟨⟨q, fresh.1⟩, fresh.2⟩⟩, eq.symm⟩ + +theorem fresh_lower_iff (q t : d.templates.Fresh) : + d.templates.extension.le (.inr q) (.inr t) ↔ + ZFSet.pair q.2.val.val t.2.val.val ∈ rQ := by + change Attachment.FreshLe d.templates.data q t ↔ _ + rw [Attachment.fresh_same_component d.templates.data (Subsingleton.elim _ _)] + rcases q with ⟨i, q⟩ + rcases t with ⟨j, t⟩ + cases i + cases j + constructor + · rintro ⟨h, lower⟩ + cases h + exact lower + · intro lower + exact ⟨rfl, lower⟩ + +theorem le_encode (x y : d.Nodes) : + ZFSet.pair (d.encode x) (d.encode y) ∈ d.order ↔ d.templates.extension.le x y := by + rw [pair_mem_singleAttachmentOrder] + have bounded : d.encode x ∈ d.carrier ∧ d.encode y ∈ d.carrier := + ⟨d.encode_mem x, d.encode_mem y⟩ + simp only [bounded.1, bounded.2, true_and] + cases x with + | inl p => + cases y with + | inl s => + change singleAttachmentLe P _ rP rQ _ F p.val s.val ↔ ZFSet.pair p.val s.val ∈ rP + constructor + · rintro (h | h | h | h) + · exact h.2.2 + · obtain ⟨_, q, _, t, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P q (eq ▸ s.property)) + · obtain ⟨⟨q, _, eq⟩, _⟩ := h + exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) + · obtain ⟨q, _, t, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) + · intro lower + exact Or.inl ⟨p.property, s.property, lower⟩ + | inr q => + change singleAttachmentLe P _ rP rQ _ F p.val (ZFSet.pair P q.2.val.val) ↔ + ZFSet.pair p.val (d.templates.shadow q).val ∈ rP + constructor + · rintro (h | h | h | h) + · exact False.elim (pair_tag_not_mem P q.2.val.val h.2.1) + · obtain ⟨_, t, _, s, _, eq, image, lower⟩ := h + have same : q.2.val.val = t := (ZFSet.pair_inj.1 eq).2 + subst t + have graph := attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function + obtain ⟨v, _, unique⟩ := graph.2 q.2.val.val q.2.val.property + have sameValue := (unique s image).trans (unique _ (d.shadow_entry q)).symm + exact sameValue ▸ lower + · obtain ⟨⟨t, _, eq⟩, _⟩ := h + exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) + · obtain ⟨t, _, s, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) + · intro lower + exact Or.inr (Or.inl ⟨p.property, q.2.val.val, d.fresh_mem q, + (d.templates.shadow q).val, (d.templates.shadow q).property, rfl, + d.shadow_entry q, lower⟩) + | inr q => + cases y with + | inl p => + change singleAttachmentLe P _ rP rQ _ F (ZFSet.pair P q.2.val.val) p.val ↔ p.val ∈ F + constructor + · rintro (h | h | h | h) + · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) + · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) + · exact h.2 + · obtain ⟨s, _, t, _, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) + · intro upper + exact Or.inr (Or.inr (Or.inl ⟨⟨q.2.val.val, d.fresh_mem q, rfl⟩, upper⟩)) + | inr t => + rw [d.fresh_lower_iff] + change singleAttachmentLe P _ rP rQ _ F + (ZFSet.pair P q.2.val.val) (ZFSet.pair P t.2.val.val) ↔ + ZFSet.pair q.2.val.val t.2.val.val ∈ rQ + constructor + · rintro (h | h | h | h) + · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) + · exact False.elim (pair_tag_not_mem P q.2.val.val h.1) + · exact False.elim (pair_tag_not_mem P t.2.val.val (d.filter.subset h.2)) + · obtain ⟨s, _, v, _, eqQ, eqT, lower⟩ := h + have sameQ := (ZFSet.pair_inj.1 eqQ).2 + have sameT := (ZFSet.pair_inj.1 eqT).2 + exact sameQ.symm ▸ sameT.symm ▸ lower + · intro lower + exact Or.inr (Or.inr (Or.inr ⟨q.2.val.val, d.fresh_mem q, + t.2.val.val, d.fresh_mem t, rfl, rfl, lower⟩)) + +theorem partialOrder : PartialOrderCode d.carrier d.order where + relation := singleAttachmentOrder_shape P _ rP rQ _ F + refl z hz := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + exact (d.le_encode x x).2 (d.templates.extension.refl x) + antisymm z hz w hw zw wz := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + obtain ⟨y, rfl⟩ := d.encode_surjective w hw + exact congrArg d.encode (d.templates.extension.antisymm + ((d.le_encode x y).1 zw) ((d.le_encode y x).1 wz)) + trans z hz w hw v hv zw wv := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + obtain ⟨y, rfl⟩ := d.encode_surjective w hw + obtain ⟨t, rfl⟩ := d.encode_surjective v hv + exact (d.le_encode x t).2 (d.templates.extension.trans + ((d.le_encode x y).1 zw) ((d.le_encode y t).1 wv)) + +theorem encoded_meet_glb (x y : d.Nodes) : + GreatestLowerBoundCode d.carrier d.order (d.encode x) (d.encode y) + (d.encode (d.templates.extension.meet x y)) := by + refine ⟨(d.le_encode _ _).2 (d.templates.extension.meet_le_left x y), + (d.le_encode _ _).2 (d.templates.extension.meet_le_right x y), ?_⟩ + intro w hw wx wy + obtain ⟨z, rfl⟩ := d.encode_surjective w hw + exact (d.le_encode _ _).2 (d.templates.extension.le_meet + ((d.le_encode _ _).1 wx) ((d.le_encode _ _).1 wy)) + +theorem meetOrder : MeetOrderCode d.carrier d.order d.meetGraph := by + apply canonicalMeetGraph_code d.partialOrder + intro x hx y hy + obtain ⟨s, rfl⟩ := d.encode_surjective x hx + obtain ⟨t, rfl⟩ := d.encode_surjective y hy + exact ⟨d.encode (d.templates.extension.meet s t), d.encode_mem _, d.encoded_meet_glb s t⟩ + +theorem encoded_meet_entry (x y : d.Nodes) : + ZFSet.pair (ZFSet.pair (d.encode x) (d.encode y)) + (d.encode (d.templates.extension.meet x y)) ∈ d.meetGraph := + (pair_mem_canonicalMeetGraph _ _ _ _ _).2 + ⟨d.encode_mem x, d.encode_mem y, d.encode_mem _, d.encoded_meet_glb x y⟩ + +end PartitionPilot.Forcing.SingleAttachmentInputs + + + +namespace PartitionPilot.Forcing.SingleAttachmentInputs + +universe u + +theorem pushforward + {P Q L rP rQ rL μP μQ μL ell F a e S e' : ZFSet.{u}} + (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) + (target : MeetOrderCode L rL μL) + (embedding : MeetEmbeddingCode P L rP rL μP μL S) + (separator : ZFSet.pair e e' ∈ S) : + SingleAttachmentInputs L Q rL rQ μL μQ + (relationCompose (attachmentIdeal Q rQ a) P L ell S) + (pushFilterCode L rL S F) a e' where + oldOrder := target + templateOrder := d.templateOrder + anchor_mem := d.anchor_mem + base_function := relationCompose_function_of_subset d.base_function embedding.injection.function + (fun _ hx => hx) + base_order := by + intro x y x' y' first second + obtain ⟨_, _, u, _, xu, ux'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first + obtain ⟨_, _, v, _, yv, vy'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 second + exact (embedding.order_iff d.oldOrder target ux' vy').trans (d.base_order x y u v xu yv) + base_meet := by + intro x y z x' y' z' meetXYZ first second third + obtain ⟨_, _, u, _, xu, ux'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 first + obtain ⟨_, _, v, _, yv, vy'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 second + obtain ⟨_, _, w, _, zw, wz'⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 third + exact embedding.map_meet u v w x' y' z' + (d.base_meet x y z u v w meetXYZ xu yv zw) ux' vy' wz' + filter := meetFilter_pushFilter d.oldOrder target embedding d.filter + separator_mem := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 separator)).2 + base_le_separator := by + intro b entry + obtain ⟨_, _, c, _, base, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + exact embedding.monotone c e b e' (d.base_le_separator c base) image separator + separator_not_le_base := by + intro b entry lower + obtain ⟨_, _, c, _, base, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + exact d.separator_not_le_base c base ((embedding.order_iff d.oldOrder target separator image).1 lower) + separator_le_upper := by + intro y positive + exact pushFilter_lower_bound target embedding d.separator_le_upper separator positive + +end PartitionPilot.Forcing.SingleAttachmentInputs + + + +namespace PartitionPilot.Forcing.SingleAttachmentInputs + +universe u +variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} +variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) +include d + +theorem base_injection : InjectionCode (attachmentIdeal Q rQ a) P ell := by + refine ⟨d.base_function, ?_⟩ + intro x y z hx hy + have first := ZFSet.pair_mem_prod.1 (d.base_function.1 hx) + have second := ZFSet.pair_mem_prod.1 (d.base_function.1 hy) + have refl := d.oldOrder.order.refl z first.2 + exact d.templateOrder.order.antisymm x ((mem_attachmentIdeal Q rQ a x).1 first.1).1 + y ((mem_attachmentIdeal Q rQ a y).1 second.1).1 + ((d.base_order x y z z hx hy).1 refl) ((d.base_order y x z z hy hx).1 refl) + +theorem template_graph_entry (q : {q : ZFSet.{u} // q ∈ Q}) : + ZFSet.pair q.val (d.encode (d.templates.represent () q)) ∈ + attachmentTemplateEmbeddingGraph P Q rQ ell a := by + classical + by_cases below : d.templateOrder.toMeetOrder.le q ⟨a, d.anchor_mem⟩ + · rw [d.templates.represent_old () q below] + apply (attachmentTemplateEmbeddingGraph_of_ideal + ((mem_attachmentIdeal Q rQ a q.val).2 ⟨q.property, below⟩)).2 + exact d.baseMap_entry ⟨q, below⟩ + · rw [d.templates.represent_new () q below] + exact (attachmentTemplateEmbeddingGraph_of_fresh d.base_function + ((mem_freshPart Q rQ a q.val).2 ⟨q.property, below⟩)).2 rfl + +theorem template_graph_entry_iff (q : {q : ZFSet.{u} // q ∈ Q}) (y : ZFSet.{u}) : + ZFSet.pair q.val y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ↔ + y = d.encode (d.templates.represent () q) := by + constructor + · intro entry + obtain ⟨w, _, unique⟩ := (attachmentTemplateEmbeddingGraph_isFunc d.base_function).2 q.val q.property + exact (unique y entry).trans (unique _ (d.template_graph_entry q)).symm + · intro eq + exact eq.symm ▸ d.template_graph_entry q + +theorem encoded_embedding_order_iff {A r μ graph : ZFSet.{u}} + (source : MeetOrderCode A r μ) + (embedding : MeetEmbedding source.toMeetOrder d.templates.extension) + (injection : InjectionCode A d.carrier graph) + (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, + ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) + {x y x' y' : ZFSet.{u}} (hx : ZFSet.pair x x' ∈ graph) (hy : ZFSet.pair y y' ∈ graph) : + ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ r := by + have hxA := (ZFSet.pair_mem_prod.1 (injection.function.1 hx)).1 + have hyA := (ZFSet.pair_mem_prod.1 (injection.function.1 hy)).1 + obtain ⟨w, _, uniqueX⟩ := injection.function.2 x hxA + obtain ⟨v, _, uniqueY⟩ := injection.function.2 y hyA + have eqX := (uniqueX x' hx).trans (uniqueX _ (entries ⟨x, hxA⟩)).symm + have eqY := (uniqueY y' hy).trans (uniqueY _ (entries ⟨y, hyA⟩)).symm + rw [eqX, eqY, d.le_encode] + exact embedding.le_iff ⟨x, hxA⟩ ⟨y, hyA⟩ + +theorem encoded_embedding_code {A r μ graph : ZFSet.{u}} + (source : MeetOrderCode A r μ) + (embedding : MeetEmbedding source.toMeetOrder d.templates.extension) + (injection : InjectionCode A d.carrier graph) + (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, + ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) : + MeetEmbeddingCode A d.carrier r d.order μ d.meetGraph graph := by + refine ⟨injection, ?_, ?_⟩ + · intro x y x' y' lower hx hy + exact (d.encoded_embedding_order_iff source embedding injection entries hx hy).2 lower + · intro x y z x' y' z' meet hx hy hz + have hxA := (ZFSet.pair_mem_prod.1 (injection.function.1 hx)).1 + have hyA := (ZFSet.pair_mem_prod.1 (injection.function.1 hy)).1 + have hzA := (ZFSet.pair_mem_prod.1 (injection.function.1 hz)).1 + let X : {x : ZFSet.{u} // x ∈ A} := ⟨x, hxA⟩ + let Y : {y : ZFSet.{u} // y ∈ A} := ⟨y, hyA⟩ + let Z : {z : ZFSet.{u} // z ∈ A} := ⟨z, hzA⟩ + have image_eq (t : {t : ZFSet.{u} // t ∈ A}) (v : ZFSet.{u}) + (entry : ZFSet.pair t.val v ∈ graph) : v = d.encode (embedding.toFun t) := by + obtain ⟨w, _, unique⟩ := injection.function.2 t.val t.property + exact (unique v entry).trans (unique _ (entries t)).symm + have meet_eq : source.toMeetOrder.meet X Y = Z := by + apply Subtype.ext + obtain ⟨w, _, unique⟩ := source.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.2 ⟨hxA, hyA⟩) + exact (unique _ (source.toMeetOrder_meet_entry X Y)).trans (unique z meet).symm + have mapped : embedding.toFun Z = + d.templates.extension.meet (embedding.toFun X) (embedding.toFun Y) := by + rw [← meet_eq] + exact embedding.map_meet X Y + rw [image_eq X x' hx, image_eq Y y' hy, image_eq Z z' hz, mapped] + exact d.encoded_meet_entry (embedding.toFun X) (embedding.toFun Y) + +theorem old_embedding_code : + MeetEmbeddingCode P d.carrier rP d.order μP d.meetGraph (attachmentOldEmbeddingGraph P) := by + apply d.encoded_embedding_code d.oldOrder d.templates.oldEmbedding + (attachmentOldEmbeddingGraph_injection P (freshPart Q rQ a)) + intro p + exact (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩ + +theorem template_embedding_code : + MeetEmbeddingCode Q d.carrier rQ d.order μQ d.meetGraph + (attachmentTemplateEmbeddingGraph P Q rQ ell a) := + d.encoded_embedding_code d.templateOrder (d.templates.templateEmbedding ()) + (attachmentTemplateEmbeddingGraph_injection d.base_injection) d.template_graph_entry + +theorem old_order_iff {x y x' y' : ZFSet.{u}} + (hx : ZFSet.pair x x' ∈ attachmentOldEmbeddingGraph P) + (hy : ZFSet.pair y y' ∈ attachmentOldEmbeddingGraph P) : + ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ rP := by + apply d.encoded_embedding_order_iff d.oldOrder d.templates.oldEmbedding + (attachmentOldEmbeddingGraph_injection P (freshPart Q rQ a)) + (fun p => (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩) hx hy + +theorem template_order_iff {x y x' y' : ZFSet.{u}} + (hx : ZFSet.pair x x' ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a) + (hy : ZFSet.pair y y' ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a) : + ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ rQ := + d.encoded_embedding_order_iff d.templateOrder (d.templates.templateEmbedding ()) + (attachmentTemplateEmbeddingGraph_injection d.base_injection) d.template_graph_entry hx hy + +theorem template_old_agreement {q p : ZFSet.{u}} (entry : ZFSet.pair q p ∈ ell) : + ZFSet.pair q p ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a ∧ + ZFSet.pair p p ∈ attachmentOldEmbeddingGraph P := by + have shape := ZFSet.pair_mem_prod.1 (d.base_function.1 entry) + exact ⟨(attachmentTemplateEmbeddingGraph_of_ideal shape.1).2 entry, + (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨shape.2, rfl⟩⟩ + +theorem template_shadow_entry (q : {q : ZFSet.{u} // q ∈ Q}) : + ZFSet.pair q.val + (d.baseMap (Attachment.cut d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩ q)).val ∈ + attachmentShadowGraph Q P μQ ell a := by + apply (pair_mem_attachmentShadowGraph Q P μQ ell a _ _).2 + refine ⟨q.property, (d.baseMap _).property, + (d.templateOrder.toMeetOrder.meet q ⟨a, d.anchor_mem⟩).val, + (d.templateOrder.toMeetOrder.meet q ⟨a, d.anchor_mem⟩).property, + d.templateOrder.toMeetOrder_meet_entry _ _, ?_⟩ + exact d.baseMap_entry (Attachment.cut d.templateOrder.toMeetOrder ⟨a, d.anchor_mem⟩ q) + +theorem old_below_template_iff {q q' s : ZFSet.{u}} + (templateEntry : ZFSet.pair q q' ∈ attachmentTemplateEmbeddingGraph P Q rQ ell a) + (shadowEntry : ZFSet.pair q s ∈ attachmentShadowGraph Q P μQ ell a) : + ∀ p ∈ P, ZFSet.pair p q' ∈ d.order ↔ ZFSet.pair p s ∈ rP := by + intro p hp + have qQ := (ZFSet.pair_mem_prod.1 + ((attachmentTemplateEmbeddingGraph_isFunc d.base_function).1 templateEntry)).1 + let qRaw : {q : ZFSet.{u} // q ∈ Q} := ⟨q, qQ⟩ + have encoded := (d.template_graph_entry_iff qRaw q').1 templateEntry + have shadowFunction := attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function + obtain ⟨v, _, unique⟩ := shadowFunction.2 q qQ + have shadow := (unique s shadowEntry).trans (unique _ (d.template_shadow_entry qRaw)).symm + rw [encoded, shadow] + change ZFSet.pair (d.encode (.inl ⟨p, hp⟩)) (d.encode (d.templates.represent () qRaw)) ∈ d.order ↔ _ + rw [d.le_encode] + exact d.templates.old_below_represent () qRaw ⟨p, hp⟩ + +end PartitionPilot.Forcing.SingleAttachmentInputs + + + +namespace PartitionPilot.Forcing.SingleAttachmentInputs + +universe u +variable {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} +variable (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) + +theorem fresh_old_upper_iff {q p : ZFSet.{u}} + (hq : q ∈ freshPart Q rQ a) (hp : p ∈ P) : + ZFSet.pair (ZFSet.pair P q) p ∈ d.order ↔ p ∈ F := by + have qParts := (mem_freshPart Q rQ a q).1 hq + exact d.le_encode (.inr ⟨(), ⟨⟨q, qParts.1⟩, qParts.2⟩⟩) (.inl ⟨p, hp⟩) + +theorem fresh_old_meet_code {q p s v : ZFSet.{u}} + (hq : q ∈ freshPart Q rQ a) (hp : p ∈ P) + (shadow : ZFSet.pair q s ∈ attachmentShadowGraph Q P μQ ell a) + (oldMeet : ZFSet.pair (ZFSet.pair s p) v ∈ μP) + (notAbove : ZFSet.pair (ZFSet.pair P q) p ∉ d.order) : + ZFSet.pair (ZFSet.pair (ZFSet.pair P q) p) v ∈ d.meetGraph := by + have qParts := (mem_freshPart Q rQ a q).1 hq + let x : d.templates.Fresh := ⟨(), ⟨⟨q, qParts.1⟩, qParts.2⟩⟩ + let y : {p : ZFSet.{u} // p ∈ P} := ⟨p, hp⟩ + have graph := attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function + obtain ⟨w, _, unique⟩ := graph.2 q qParts.1 + have sameShadow : s = (d.templates.shadow x).val := + (unique s shadow).trans (unique _ (d.shadow_entry x)).symm + have decoded := d.oldOrder.toMeetOrder_meet_entry (d.templates.shadow x) y + obtain ⟨m, _, uniqueMeet⟩ := d.oldOrder.operation.2 + (ZFSet.pair (d.templates.shadow x).val p) + (ZFSet.pair_mem_prod.2 ⟨(d.templates.shadow x).property, hp⟩) + have sameMeet : v = (d.oldOrder.toMeetOrder.meet (d.templates.shadow x) y).val := + (uniqueMeet v (sameShadow ▸ oldMeet)).trans (uniqueMeet _ decoded).symm + have notUpper : ¬ d.templates.upper x.1 y := by + intro upper + exact notAbove ((d.fresh_old_upper_iff hq hp).2 upper) + have eq := d.templates.shadow_meet_eq x y notUpper + have result := d.encoded_meet_entry (.inr x) (.inl y) + rw [eq] at result + exact sameMeet.symm ▸ result + +theorem greatest_preserved {T : ZFSet.{u}} (hT : T ∈ P) + (greatest : ∀ p ∈ P, ZFSet.pair p T ∈ rP) : + ∀ z ∈ d.carrier, ZFSet.pair z T ∈ d.order := by + intro z hz + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + exact (d.le_encode x (.inl ⟨T, hT⟩)).2 + (d.templates.greatest_preserved ⟨T, hT⟩ (fun p => greatest p.val p.property) x) + +theorem least_preserved {zero : ZFSet.{u}} (hzero : zero ∈ P) + (least : ∀ p ∈ P, ZFSet.pair zero p ∈ rP) : + ∀ z ∈ d.carrier, ZFSet.pair zero z ∈ d.order := by + intro z hz + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + exact (d.le_encode (.inl ⟨zero, hzero⟩) x).2 + (d.templates.least_preserved ⟨zero, hzero⟩ (fun p => least p.val p.property) x) + +end PartitionPilot.Forcing.SingleAttachmentInputs + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem singleAttachment_ground_codes + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} + (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) + (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) + (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) + (hF : F ∈ M.sets) : + d.carrier ∈ M.sets ∧ attachmentShadowGraph Q P μQ ell a ∈ M.sets ∧ + d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets ∧ + attachmentTemplateEmbeddingGraph P Q rQ ell a ∈ M.sets := by + have ha := M.transitive hQ d.anchor_mem + have hN := M.freshPart_mem separation hQ hrQ ha + have hL := M.taggedExtension_mem pairing unions powers separation hP hN + have hs := M.attachmentShadowGraph_mem pairing unions powers separation hQ hP hμQ hell ha + have hr := M.singleAttachmentOrder_mem pairing unions powers separation hP hN hrP hrQ hs hF + exact ⟨hL, hs, hr, M.canonicalMeetGraph_mem pairing unions powers separation hL hr, + M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP, + M.attachmentTemplateEmbeddingGraph_mem pairing unions powers separation hP hQ hrQ hell ha⟩ + +theorem exists_singleAttachment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P Q rP rQ μP μQ ell F a e : ZFSet.{u}} + (d : SingleAttachmentInputs P Q rP rQ μP μQ ell F a e) + (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) + (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) + (hF : F ∈ M.sets) : + ∃ L ∈ M.sets, ∃ shadow ∈ M.sets, ∃ r ∈ M.sets, ∃ μ ∈ M.sets, + ∃ oldMap ∈ M.sets, ∃ templateMap ∈ M.sets, + L = taggedExtension P (freshPart Q rQ a) ∧ + shadow = attachmentShadowGraph Q P μQ ell a ∧ + r = singleAttachmentOrder P (freshPart Q rQ a) rP rQ shadow F ∧ + μ = canonicalMeetGraph L r ∧ + oldMap = attachmentOldEmbeddingGraph P ∧ + templateMap = attachmentTemplateEmbeddingGraph P Q rQ ell a ∧ + MeetOrderCode L r μ ∧ + ZFSet.IsFunc Q P shadow ∧ + MeetEmbeddingCode P L rP r μP μ oldMap ∧ + MeetEmbeddingCode Q L rQ r μQ μ templateMap ∧ + (∀ p ∈ P, ZFSet.pair p p ∈ oldMap) ∧ + (∀ q ∈ attachmentIdeal Q rQ a, ∀ p, + ZFSet.pair q p ∈ templateMap ↔ ZFSet.pair q p ∈ ell) ∧ + (∀ q q' s, ZFSet.pair q q' ∈ templateMap → ZFSet.pair q s ∈ shadow → + ∀ p ∈ P, ZFSet.pair p q' ∈ r ↔ ZFSet.pair p s ∈ rP) ∧ + (∀ q ∈ freshPart Q rQ a, ∀ p ∈ P, ∀ s v, + ZFSet.pair q s ∈ shadow → ZFSet.pair (ZFSet.pair s p) v ∈ μP → + ZFSet.pair (ZFSet.pair P q) p ∉ r → + ZFSet.pair (ZFSet.pair (ZFSet.pair P q) p) v ∈ μ) := by + obtain ⟨hL, hs, hr, hμ, hi, hj⟩ := M.singleAttachment_ground_codes + pairing unions powers separation d hP hQ hrP hrQ hμQ hell hF + exact ⟨d.carrier, hL, attachmentShadowGraph Q P μQ ell a, hs, d.order, hr, + d.meetGraph, hμ, attachmentOldEmbeddingGraph P, hi, + attachmentTemplateEmbeddingGraph P Q rQ ell a, hj, + rfl, rfl, rfl, rfl, rfl, rfl, d.meetOrder, + attachmentShadowGraph_function d.templateOrder d.anchor_mem d.base_function, + d.old_embedding_code, d.template_embedding_code, + fun p hp => (pair_mem_attachmentOldEmbeddingGraph P p p).2 ⟨hp, rfl⟩, + (fun q hq p => attachmentTemplateEmbeddingGraph_of_ideal hq), + (fun q q' s entry shadow => d.old_below_template_iff entry shadow), + fun q hq p hp s v shadow oldMeet notAbove => + d.fresh_old_meet_code hq hp shadow oldMeet notAbove⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredPreparationFamilyPersistence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredPreparationFamilyPersistence.lean index a88e0826c7ecc64ebbe49a59f470e1a64c9a2d9a..02586fb186c15c77ab924c6f8970531ef5425d86 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredPreparationFamilyPersistence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredPreparationFamilyPersistence.lean @@ -1,105 +1,105 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawPreparedFamilyConditionPersistence -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions - -namespace OAI - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -structure StoredPreparationEnvironment (M : TransitiveGround.{u}) - (fields : Fin 15 → ZFSet.{u}) : Prop where - order : PartialOrderCode (fields 7) (fields 8) - ground : ∀ j, fields j ∈ M.sets - names_valid : ∀ z ∈ fields 14, IsName (SetMembers.presentation (fields 7)) z - visibility_valid : ∀ v V, ZFSet.pair v V ∈ fields 13 → v ∈ fields 10 → - IsName (SetMembers.presentation (fields 7)) V - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -include run - -theorem preparationCut_strengthens - {alpha r p q : ZFSet.{u}} (fields : Fin 15 → ZFSet.{u}) - (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) - (stronger : r ∈ M.refinementHistoryForcing rows T stages history) - (below : ZFSet.pair r p ∈ M.refinementHistoryOrder rows rowOrder T stages history) - (selected : ZFSet.pair p q ∈ rowAssignmentCutGraph - (M.refinementHistoryForcing rows T stages history) (fields 7) - (refinementDataHistoryLevels stages history T) alpha) : - ∃ rCut, rCut ∈ fields 7 ∧ q ∈ fields 7 ∧ - ZFSet.pair r rCut ∈ rowAssignmentCutGraph - (M.refinementHistoryForcing rows T stages history) (fields 7) - (refinementDataHistoryLevels stages history T) alpha ∧ - ZFSet.pair rCut q ∈ fields 8 := by - obtain ⟨_, oldRow, oldA, equal⟩ := (mem_rowAssignmentCutGraph _ _ _ _ _).1 selected - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have oldValid := ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 selected).2.1 - obtain ⟨newRow, _, newA, _, rfl⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages history stronger) - have member := run.carriers.data.function.pair_source stored - have newValid := (run.carriers.carrier alpha fields stored).symm ▸ - run.carriers.cut_mem stronger member - refine ⟨ZFSet.pair newRow - (assignmentCut (refinementDataHistoryLevels stages history T) alpha newA), - newValid, oldValid, ?_, run.lower_order fields stored below⟩ - exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨stronger, newValid, rfl⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem storedPreparationFamily_cut_mono - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {rows rowOrder T stages history alpha r p q A meet C E k enumerations : ZFSet.{u}} - (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) - (fields : Fin 15 → ZFSet.{u}) (environment : StoredPreparationEnvironment M fields) - (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) - (hA : A ∈ M.sets) - (stronger : r ∈ M.refinementHistoryForcing rows T stages history) - (below : ZFSet.pair r p ∈ M.refinementHistoryOrder rows rowOrder T stages history) - (selected : ZFSet.pair p q ∈ rowAssignmentCutGraph - (M.refinementHistoryForcing rows T stages history) (fields 7) - (refinementDataHistoryLevels stages history T) alpha) - (code : PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) - meet (fields 14) (fields 13) (fields 9) ZFSet.omega - (M.storedPreparationRequests A fields) C E k enumerations) : - ∃ rCut, rCut ∈ fields 7 ∧ - ZFSet.pair r rCut ∈ rowAssignmentCutGraph - (M.refinementHistoryForcing rows T stages history) (fields 7) - (refinementDataHistoryLevels stages history T) alpha ∧ - ZFSet.pair rCut q ∈ fields 8 ∧ - PreparedCertificateFamilyCode M (fields 7) (fields 8) rCut (fields 10) (fields 11) - meet (fields 14) (fields 13) (fields 9) ZFSet.omega - (M.storedPreparationRequests A fields) C E k enumerations := by - obtain ⟨rCut, hrCut, hq, cut, lowerBelow⟩ := - run.preparationCut_strengthens fields stored stronger below selected - have requestsGround := M.storedPreparationRequests_mem pairing unions powers separation - hA fields environment.ground - have requestsValid : ∀ z ∈ M.storedPreparationRequests A fields, - IsName (SetMembers.presentation (fields 7)) z := by - intro z hz - rcases ZFSet.mem_union.1 hz with left | right - · exact environment.names_valid z ((mem_relationImage _ _ _ _).1 left).1 - · exact environment.names_valid z ((mem_relationImage _ _ _ _).1 right).1 - refine ⟨rCut, hrCut, cut, lowerBelow, ?_⟩ - exact M.preparedCertificateFamilyCode_raw_condition_mono pairing unions powers separation collection - (fields 7) (fields 8) (fields 10) (fields 11) meet (fields 14) (fields 13) (fields 9) - ZFSet.omega (M.storedPreparationRequests A fields) C E k enumerations environment.order - (environment.ground 7) (environment.ground 8) (environment.ground 13) - environment.visibility_valid (environment.ground 14) environment.names_valid - requestsGround requestsValid q rCut hq hrCut lowerBelow code - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawPreparedFamilyConditionPersistence +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions + +namespace OAI + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +structure StoredPreparationEnvironment (M : TransitiveGround.{u}) + (fields : Fin 15 → ZFSet.{u}) : Prop where + order : PartialOrderCode (fields 7) (fields 8) + ground : ∀ j, fields j ∈ M.sets + names_valid : ∀ z ∈ fields 14, IsName (SetMembers.presentation (fields 7)) z + visibility_valid : ∀ v V, ZFSet.pair v V ∈ fields 13 → v ∈ fields 10 → + IsName (SetMembers.presentation (fields 7)) V + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +include run + +theorem preparationCut_strengthens + {alpha r p q : ZFSet.{u}} (fields : Fin 15 → ZFSet.{u}) + (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) + (stronger : r ∈ M.refinementHistoryForcing rows T stages history) + (below : ZFSet.pair r p ∈ M.refinementHistoryOrder rows rowOrder T stages history) + (selected : ZFSet.pair p q ∈ rowAssignmentCutGraph + (M.refinementHistoryForcing rows T stages history) (fields 7) + (refinementDataHistoryLevels stages history T) alpha) : + ∃ rCut, rCut ∈ fields 7 ∧ q ∈ fields 7 ∧ + ZFSet.pair r rCut ∈ rowAssignmentCutGraph + (M.refinementHistoryForcing rows T stages history) (fields 7) + (refinementDataHistoryLevels stages history T) alpha ∧ + ZFSet.pair rCut q ∈ fields 8 := by + obtain ⟨_, oldRow, oldA, equal⟩ := (mem_rowAssignmentCutGraph _ _ _ _ _).1 selected + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have oldValid := ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 selected).2.1 + obtain ⟨newRow, _, newA, _, rfl⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages history stronger) + have member := run.carriers.data.function.pair_source stored + have newValid := (run.carriers.carrier alpha fields stored).symm ▸ + run.carriers.cut_mem stronger member + refine ⟨ZFSet.pair newRow + (assignmentCut (refinementDataHistoryLevels stages history T) alpha newA), + newValid, oldValid, ?_, run.lower_order fields stored below⟩ + exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨stronger, newValid, rfl⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem storedPreparationFamily_cut_mono + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {rows rowOrder T stages history alpha r p q A meet C E k enumerations : ZFSet.{u}} + (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) + (fields : Fin 15 → ZFSet.{u}) (environment : StoredPreparationEnvironment M fields) + (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) + (hA : A ∈ M.sets) + (stronger : r ∈ M.refinementHistoryForcing rows T stages history) + (below : ZFSet.pair r p ∈ M.refinementHistoryOrder rows rowOrder T stages history) + (selected : ZFSet.pair p q ∈ rowAssignmentCutGraph + (M.refinementHistoryForcing rows T stages history) (fields 7) + (refinementDataHistoryLevels stages history T) alpha) + (code : PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) + meet (fields 14) (fields 13) (fields 9) ZFSet.omega + (M.storedPreparationRequests A fields) C E k enumerations) : + ∃ rCut, rCut ∈ fields 7 ∧ + ZFSet.pair r rCut ∈ rowAssignmentCutGraph + (M.refinementHistoryForcing rows T stages history) (fields 7) + (refinementDataHistoryLevels stages history T) alpha ∧ + ZFSet.pair rCut q ∈ fields 8 ∧ + PreparedCertificateFamilyCode M (fields 7) (fields 8) rCut (fields 10) (fields 11) + meet (fields 14) (fields 13) (fields 9) ZFSet.omega + (M.storedPreparationRequests A fields) C E k enumerations := by + obtain ⟨rCut, hrCut, hq, cut, lowerBelow⟩ := + run.preparationCut_strengthens fields stored stronger below selected + have requestsGround := M.storedPreparationRequests_mem pairing unions powers separation + hA fields environment.ground + have requestsValid : ∀ z ∈ M.storedPreparationRequests A fields, + IsName (SetMembers.presentation (fields 7)) z := by + intro z hz + rcases ZFSet.mem_union.1 hz with left | right + · exact environment.names_valid z ((mem_relationImage _ _ _ _).1 left).1 + · exact environment.names_valid z ((mem_relationImage _ _ _ _).1 right).1 + refine ⟨rCut, hrCut, cut, lowerBelow, ?_⟩ + exact M.preparedCertificateFamilyCode_raw_condition_mono pairing unions powers separation collection + (fields 7) (fields 8) (fields 10) (fields 11) meet (fields 14) (fields 13) (fields 9) + ZFSet.omega (M.storedPreparationRequests A fields) C E k enumerations environment.order + (environment.ground 7) (environment.ground 8) (environment.ground 13) + environment.visibility_valid (environment.ground 14) environment.names_valid + requestsGround requestsValid q rCut hq hrCut lowerBelow code + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredVisitCertificates.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredVisitCertificates.lean index 9d449fab68137459abfa7cc04455d7c8ecf29f2b..764fa1426457a10f6222ec3744955a38bc823ab7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredVisitCertificates.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStoredVisitCertificates.lean @@ -1,93 +1,93 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundVaryingPreparationRelations - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) - -theorem varyingPreparationRelation_of_stored - (stages packed Q upperOrder nodes T alpha p y meet : ZFSet.{u}) - (fields : Fin 15 → ZFSet.{u}) (hAlpha : alpha ∈ stages) - (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed) - (terms : fields 6 = T) (nodeCarrier : fields 10 = nodes) - (meetCode : MeetOrderCode (fields 10) (fields 11) meet) - (entry : ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T - (refinementDataHistoryLevels stages packed T) alpha meet fields) : - ZFSet.pair (ZFSet.pair alpha p) y ∈ - M.varyingPreparationRelation stages packed Q upperOrder nodes T := by - obtain ⟨hp, hy, code⟩ := (M.pair_mem_storedPreparationRelation Q upperOrder nodes T - (refinementDataHistoryLevels stages packed T) alpha meet fields p y).1 entry - have equal := meetCode.eq_canonicalMeetGraph - exact (M.pair_mem_varyingPreparationRelation stages packed Q upperOrder nodes T alpha p y).2 - ⟨hAlpha, hp, hy, fields, stored, terms, nodeCarrier, equal ▸ meetCode, equal ▸ code⟩ - -theorem varyingPreparationRelation_fiber_iff - (stages packed Q upperOrder nodes T alpha p y meet dataBound : ZFSet.{u}) - (fields : Fin 15 → ZFSet.{u}) - (function : ZFSet.IsFunc stages dataBound packed) (hAlpha : alpha ∈ stages) - (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed) - (terms : fields 6 = T) (nodeCarrier : fields 10 = nodes) - (meetCode : MeetOrderCode (fields 10) (fields 11) meet) : - ZFSet.pair (ZFSet.pair alpha p) y ∈ - M.varyingPreparationRelation stages packed Q upperOrder nodes T ↔ - ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T - (refinementDataHistoryLevels stages packed T) alpha meet fields := by - constructor - · intro entry - obtain ⟨_, hp, hy, other, otherStored, _terms, _nodes, _meet, code⟩ := - (M.pair_mem_varyingPreparationRelation stages packed Q upperOrder nodes T alpha p y).1 entry - obtain ⟨_, _, unique⟩ := function.2 alpha hAlpha - have same : other = fields := refinementFormulaDataCode_injective - ((unique _ otherStored).trans (unique _ stored).symm) - subst other - exact (M.pair_mem_storedPreparationRelation Q upperOrder nodes T - (refinementDataHistoryLevels stages packed T) alpha meet fields p y).2 - ⟨hp, hy, meetCode.eq_canonicalMeetGraph.symm ▸ code⟩ - · exact M.varyingPreparationRelation_of_stored stages packed Q upperOrder nodes T alpha p y meet - fields hAlpha stored terms nodeCarrier meetCode - - - - - -theorem varyingPreparation_visit_certificates - (stages packed Q upperOrder nodes T alpha row A r payload meet dataBound : ZFSet.{u}) - (fields : Fin 15 → ZFSet.{u}) - (function : ZFSet.IsFunc stages dataBound packed) (hAlpha : alpha ∈ stages) - (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed) - (terms : fields 6 = T) (nodeCarrier : fields 10 = nodes) - (meetCode : MeetOrderCode (fields 10) (fields 11) meet) - (entry : ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row A)) (ZFSet.pair r payload) ∈ - M.varyingPreparationRelation stages packed Q upperOrder nodes T) : - ∃ k enumerations q, payload = ZFSet.pair k enumerations ∧ - k ∈ M.sets ∧ enumerations ∈ M.sets ∧ r ∈ Q ∧ q ∈ fields 7 ∧ - ZFSet.pair r (ZFSet.pair row A) ∈ upperOrder ∧ - ZFSet.pair r q ∈ rowAssignmentCutGraph Q (fields 7) - (refinementDataHistoryLevels stages packed T) alpha ∧ - PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) - meet (fields 14) (fields 13) (fields 9) ZFSet.omega - (M.storedPreparationRequests A fields) - (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) - (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations := by - have fixed := (M.varyingPreparationRelation_fiber_iff stages packed Q upperOrder nodes T - alpha (ZFSet.pair row A) (ZFSet.pair r payload) meet dataBound fields function hAlpha - stored terms nodeCarrier meetCode).1 entry - obtain ⟨_, bounded, oldRow, oldA, output, k, enumerations, q, input, value, below, cut, family⟩ := - (M.pair_mem_storedPreparationRelation Q upperOrder nodes T - (refinementDataHistoryLevels stages packed T) alpha meet fields - (ZFSet.pair row A) (ZFSet.pair r payload)).1 fixed - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 input - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 value - obtain ⟨hr, hk, he⟩ := (M.mem_preparationWitnessBound nodes T Q r k enumerations).1 bounded - have hq := (ZFSet.pair_mem_prod.1 - ((mem_rowAssignmentCutGraph _ _ _ _ _).1 cut).1).2 - exact ⟨k, enumerations, q, rfl, - ((M.mem_groundRelations _ _ k).1 hk).1, - ((M.mem_groundRelations _ _ enumerations).1 he).1, hr, hq, below, cut, family⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundVaryingPreparationRelations + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) + +theorem varyingPreparationRelation_of_stored + (stages packed Q upperOrder nodes T alpha p y meet : ZFSet.{u}) + (fields : Fin 15 → ZFSet.{u}) (hAlpha : alpha ∈ stages) + (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed) + (terms : fields 6 = T) (nodeCarrier : fields 10 = nodes) + (meetCode : MeetOrderCode (fields 10) (fields 11) meet) + (entry : ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T + (refinementDataHistoryLevels stages packed T) alpha meet fields) : + ZFSet.pair (ZFSet.pair alpha p) y ∈ + M.varyingPreparationRelation stages packed Q upperOrder nodes T := by + obtain ⟨hp, hy, code⟩ := (M.pair_mem_storedPreparationRelation Q upperOrder nodes T + (refinementDataHistoryLevels stages packed T) alpha meet fields p y).1 entry + have equal := meetCode.eq_canonicalMeetGraph + exact (M.pair_mem_varyingPreparationRelation stages packed Q upperOrder nodes T alpha p y).2 + ⟨hAlpha, hp, hy, fields, stored, terms, nodeCarrier, equal ▸ meetCode, equal ▸ code⟩ + +theorem varyingPreparationRelation_fiber_iff + (stages packed Q upperOrder nodes T alpha p y meet dataBound : ZFSet.{u}) + (fields : Fin 15 → ZFSet.{u}) + (function : ZFSet.IsFunc stages dataBound packed) (hAlpha : alpha ∈ stages) + (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed) + (terms : fields 6 = T) (nodeCarrier : fields 10 = nodes) + (meetCode : MeetOrderCode (fields 10) (fields 11) meet) : + ZFSet.pair (ZFSet.pair alpha p) y ∈ + M.varyingPreparationRelation stages packed Q upperOrder nodes T ↔ + ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T + (refinementDataHistoryLevels stages packed T) alpha meet fields := by + constructor + · intro entry + obtain ⟨_, hp, hy, other, otherStored, _terms, _nodes, _meet, code⟩ := + (M.pair_mem_varyingPreparationRelation stages packed Q upperOrder nodes T alpha p y).1 entry + obtain ⟨_, _, unique⟩ := function.2 alpha hAlpha + have same : other = fields := refinementFormulaDataCode_injective + ((unique _ otherStored).trans (unique _ stored).symm) + subst other + exact (M.pair_mem_storedPreparationRelation Q upperOrder nodes T + (refinementDataHistoryLevels stages packed T) alpha meet fields p y).2 + ⟨hp, hy, meetCode.eq_canonicalMeetGraph.symm ▸ code⟩ + · exact M.varyingPreparationRelation_of_stored stages packed Q upperOrder nodes T alpha p y meet + fields hAlpha stored terms nodeCarrier meetCode + + + + + +theorem varyingPreparation_visit_certificates + (stages packed Q upperOrder nodes T alpha row A r payload meet dataBound : ZFSet.{u}) + (fields : Fin 15 → ZFSet.{u}) + (function : ZFSet.IsFunc stages dataBound packed) (hAlpha : alpha ∈ stages) + (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed) + (terms : fields 6 = T) (nodeCarrier : fields 10 = nodes) + (meetCode : MeetOrderCode (fields 10) (fields 11) meet) + (entry : ZFSet.pair (ZFSet.pair alpha (ZFSet.pair row A)) (ZFSet.pair r payload) ∈ + M.varyingPreparationRelation stages packed Q upperOrder nodes T) : + ∃ k enumerations q, payload = ZFSet.pair k enumerations ∧ + k ∈ M.sets ∧ enumerations ∈ M.sets ∧ r ∈ Q ∧ q ∈ fields 7 ∧ + ZFSet.pair r (ZFSet.pair row A) ∈ upperOrder ∧ + ZFSet.pair r q ∈ rowAssignmentCutGraph Q (fields 7) + (refinementDataHistoryLevels stages packed T) alpha ∧ + PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11) + meet (fields 14) (fields 13) (fields 9) ZFSet.omega + (M.storedPreparationRequests A fields) + (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q)) + (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) k enumerations := by + have fixed := (M.varyingPreparationRelation_fiber_iff stages packed Q upperOrder nodes T + alpha (ZFSet.pair row A) (ZFSet.pair r payload) meet dataBound fields function hAlpha + stored terms nodeCarrier meetCode).1 entry + obtain ⟨_, bounded, oldRow, oldA, output, k, enumerations, q, input, value, below, cut, family⟩ := + (M.pair_mem_storedPreparationRelation Q upperOrder nodes T + (refinementDataHistoryLevels stages packed T) alpha meet fields + (ZFSet.pair row A) (ZFSet.pair r payload)).1 fixed + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 input + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 value + obtain ⟨hr, hk, he⟩ := (M.mem_preparationWitnessBound nodes T Q r k enumerations).1 bounded + have hq := (ZFSet.pair_mem_prod.1 + ((mem_rowAssignmentCutGraph _ _ _ _ _).1 cut).1).2 + exact ⟨k, enumerations, q, rfl, + ((M.mem_groundRelations _ _ k).1 hk).1, + ((M.mem_groundRelations _ _ enumerations).1 he).1, hr, hq, below, cut, family⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralCompleteProjections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralCompleteProjections.lean index 2a3c9ba068a49315aa4ff9e25747dad2d5b624d5..1feb07f29e99d750453f5fa2c729c15f592de722 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralCompleteProjections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralCompleteProjections.lean @@ -1,79 +1,79 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] -variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T T2 stages history : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -variable (witnesses : ∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M t b d base directed T T2 level P order top action) -local notation "packed" => M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history -include pairing unions powers separation collection group nodes supports hHistory hT witnesses - -theorem structuralHistory_rawTests_mono : - ∀ level (data : Fin 15 → ZFSet.{u}), ZFSet.pair level (refinementFormulaDataCode data) ∈ packed → - ∀ A lower stronger, stageOneRawTests M data A lower → - ZFSet.pair stronger lower ∈ data 8 → stageOneRawTests M data A stronger := by - intro level data entry A lower stronger tests below - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history data entry - have ground := M.forcingStageCode_fields - (M.transitive (M.union_mem unions (M.union_mem unions hHistory)) - (pair_second_mem_doubleUnion stored)) - exact (witnesses level P order top action stored).rawTests_order_mono - pairing unions powers separation collection ground.1 group nodes ground.2.1 supports hT - A lower stronger tests below - -theorem structuralTrace_completeProjection - (rows rowOrder rowTop rowAction alpha : ZFSet.{u}) - (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (nodeOrder : b.conditionOrder ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hStages : stages ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) - (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) (subset : alpha ⊆ stages) - (trace : OrdinalRecursionTrace (fun level prior stage => - stage = M.structuralForcingStage rows rowOrder rowTop rowAction t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level prior) stages history) - (rowOrderLaw : PartialOrderCode rows rowOrder) (topMem : rowTop ∈ rows) - (topRows : ∀ row ∈ rows, ZFSet.pair row rowTop ∈ rowOrder) : - let run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction t.carrier b.carrier - b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 ordinal trace - let mono := M.structuralHistory_rawTests_mono t b d base directed T T2 stages history - pairing unions powers separation collection group nodes supports hHistory hT witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] - (Fin.cases group (Fin.cases nodes (Fin.cases nodeOrder (Fin.cases supports - (Fin.cases hT (Fin.cases hT2 (Fin.cases hStages (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder rowOrderLaw T stages packed - letI := M.refinementHistoryPartialOrder rowOrderLaw T alpha (graphRestriction alpha packed) - CompleteProjection (run.restriction ordinal cutOrdinal subset rowOrderLaw) - (run.inclusion ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hPacked hT hAlpha hRows rowTop topMem topRows mono rowOrderLaw) := by - dsimp only - exact (M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction t.carrier b.carrier - b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 ordinal trace).completeProjection - ordinal cutOrdinal subset pairing unions powers separation infinite choice hStages _ hT hAlpha hRows - rowTop topMem topRows - (M.structuralHistory_rawTests_mono t b d base directed T T2 stages history - pairing unions powers separation collection group nodes supports hHistory hT witnesses) rowOrderLaw - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] +variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T T2 stages history : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +variable (witnesses : ∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M t b d base directed T T2 level P order top action) +local notation "packed" => M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history +include pairing unions powers separation collection group nodes supports hHistory hT witnesses + +theorem structuralHistory_rawTests_mono : + ∀ level (data : Fin 15 → ZFSet.{u}), ZFSet.pair level (refinementFormulaDataCode data) ∈ packed → + ∀ A lower stronger, stageOneRawTests M data A lower → + ZFSet.pair stronger lower ∈ data 8 → stageOneRawTests M data A stronger := by + intro level data entry A lower stronger tests below + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history data entry + have ground := M.forcingStageCode_fields + (M.transitive (M.union_mem unions (M.union_mem unions hHistory)) + (pair_second_mem_doubleUnion stored)) + exact (witnesses level P order top action stored).rawTests_order_mono + pairing unions powers separation collection ground.1 group nodes ground.2.1 supports hT + A lower stronger tests below + +theorem structuralTrace_completeProjection + (rows rowOrder rowTop rowAction alpha : ZFSet.{u}) + (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (nodeOrder : b.conditionOrder ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hStages : stages ∈ M.sets) (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) + (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) (subset : alpha ⊆ stages) + (trace : OrdinalRecursionTrace (fun level prior stage => + stage = M.structuralForcingStage rows rowOrder rowTop rowAction t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 level prior) stages history) + (rowOrderLaw : PartialOrderCode rows rowOrder) (topMem : rowTop ∈ rows) + (topRows : ∀ row ∈ rows, ZFSet.pair row rowTop ∈ rowOrder) : + let run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction t.carrier b.carrier + b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 ordinal trace + let mono := M.structuralHistory_rawTests_mono t b d base directed T T2 stages history + pairing unions powers separation collection group nodes supports hHistory hT witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] + (Fin.cases group (Fin.cases nodes (Fin.cases nodeOrder (Fin.cases supports + (Fin.cases hT (Fin.cases hT2 (Fin.cases hStages (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder rowOrderLaw T stages packed + letI := M.refinementHistoryPartialOrder rowOrderLaw T alpha (graphRestriction alpha packed) + CompleteProjection (run.restriction ordinal cutOrdinal subset rowOrderLaw) + (run.inclusion ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hPacked hT hAlpha hRows rowTop topMem topRows mono rowOrderLaw) := by + dsimp only + exact (M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction t.carrier b.carrier + b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 ordinal trace).completeProjection + ordinal cutOrdinal subset pairing unions powers separation infinite choice hStages _ hT hAlpha hRows + rowTop topMem topRows + (M.structuralHistory_rawTests_mono t b d base directed T T2 stages history + pairing unions powers separation collection group nodes supports hHistory hT witnesses) rowOrderLaw + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralFinitePowerTerms.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralFinitePowerTerms.lean index 367186416492bf0e1d27b775fa30d0f2e1c39fb9..b84accededc77a87cc4ce53c9af8054f2b756b8e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralFinitePowerTerms.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundStructuralFinitePowerTerms.lean @@ -1,45 +1,45 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) - -theorem structuralTrace_finitePowerTerms - (rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : c.carrier ∈ M.sets) (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName c.pairEmpty z) (topMem : rowTop ∈ c.carrier) - {stages history : ZFSet.{u}} (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier rowOrder rowTop rowAction G nodes nodeOrder nodeAction - basis T T2 level prior) stages history) (n : Nat) : - let packed := M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history - let J := iteratedPairNameFamily (ZFSet.pair rowTop ∅) T n - J ∈ M.sets ∧ ∀ alpha : ZFSet.{u}, ordinalSetProperty alpha → alpha ⊆ stages → - ∀ z ∈ J, IsName (SetMembers.presentation - (M.refinementHistoryForcing c.carrier T alpha (graphRestriction alpha packed))) z := by - have oneGround := M.orderedPair_mem pairing (M.transitive carrier topMem) - (M.empty_mem ⟨c.carrier, carrier⟩) - have ground := M.iteratedPairNameFamily_mem pairing unions powers separation oneGround hT n - have original : ∀ z ∈ iteratedPairNameFamily (ZFSet.pair rowTop ∅) T n, IsName c.pairEmpty z := by - obtain ⟨p, rfl⟩ := (c.mem_carrier rowTop).1 topMem - exact iteratedPairNameFamily_valid p valid n - let run := M.structuralForcingTrace_recursiveOrder c.carrier rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 ordinal trace - refine ⟨ground, ?_⟩ - intro alpha alphaOrdinal subset - exact M.refinementHistoryRowNameFamily_valid c (run.carriers.restrict alphaOrdinal subset) - alphaOrdinal carrier (iteratedPairNameFamily (ZFSet.pair rowTop ∅) T n) original - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) + +theorem structuralTrace_finitePowerTerms + (rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : c.carrier ∈ M.sets) (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName c.pairEmpty z) (topMem : rowTop ∈ c.carrier) + {stages history : ZFSet.{u}} (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier rowOrder rowTop rowAction G nodes nodeOrder nodeAction + basis T T2 level prior) stages history) (n : Nat) : + let packed := M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history + let J := iteratedPairNameFamily (ZFSet.pair rowTop ∅) T n + J ∈ M.sets ∧ ∀ alpha : ZFSet.{u}, ordinalSetProperty alpha → alpha ⊆ stages → + ∀ z ∈ J, IsName (SetMembers.presentation + (M.refinementHistoryForcing c.carrier T alpha (graphRestriction alpha packed))) z := by + have oneGround := M.orderedPair_mem pairing (M.transitive carrier topMem) + (M.empty_mem ⟨c.carrier, carrier⟩) + have ground := M.iteratedPairNameFamily_mem pairing unions powers separation oneGround hT n + have original : ∀ z ∈ iteratedPairNameFamily (ZFSet.pair rowTop ∅) T n, IsName c.pairEmpty z := by + obtain ⟨p, rfl⟩ := (c.mem_carrier rowTop).1 topMem + exact iteratedPairNameFamily_valid p valid n + let run := M.structuralForcingTrace_recursiveOrder c.carrier rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 ordinal trace + refine ⟨ground, ?_⟩ + intro alpha alphaOrdinal subset + exact M.refinementHistoryRowNameFamily_valid c (run.carriers.restrict alphaOrdinal subset) + alphaOrdinal carrier (iteratedPairNameFamily (ZFSet.pair rowTop ∅) T n) original + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingInsertionFulfillment.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingInsertionFulfillment.lean index 9b527ed88b5982841f24e8db68978937fa20b34b..4413b3a5d512d808d70bbd3e33f676795dcd9b77 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingInsertionFulfillment.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingInsertionFulfillment.lean @@ -1,368 +1,368 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTaskBearingSuccessorDecoding - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TaskBearingMainSuccessorCode -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target : GroundLinkedMainStage M K Labels C D rD} -variable {transition : GroundChronologicalMainTransition source.main target.main} - -theorem insertion_data - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) : - ∃ Caps ∈ M.sets, ∃ Reps ∈ M.sets, - source.main.stage.compressionTasks Labels ∈ M.sets ∧ - source.main.stage.compressionSources Labels ∈ M.sets ∧ - TaskCapFamilyCode (source.main.stage.compressionTasks Labels) - source.main.stage.carrier target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph - transition.map.points (source.main.stage.compressionTargets Labels) - (source.main.stage.compressionSeparators Labels) (source.main.stage.compressionFilters Labels) - (M.groundPower source.main.stage.carrier) Caps ∧ - TaskRepresentativesCode Reps (source.main.stage.compressionTasks Labels) - source.main.stage.carrier source.main.stage.actors source.main.stage.order source.main.stage.action - (M.groundRelations source.main.stage.carrier source.main.stage.carrier) - (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels ∧ - CompressionActorFulfillmentCode (source.main.stage.compressionTasks Labels) - source.main.stage.carrier source.main.stage.actors target.main.stage.carrier target.main.stage.actors - target.main.stage.order target.main.stage.action transition.map.points transition.map.actors - (source.main.stage.compressionSources Labels) Reps source.main.stage.top Caps := by - obtain ⟨extra, ground, output, bindings⟩ := code.output_on_linked - obtain ⟨tasks, sources, targets, separators, filters, families, representatives⟩ := bindings - change extra 0 = source.main.stage.compressionTasks Labels at tasks - change extra 1 = literalTaskFieldGraph (extra 0) source.main.stage.carrier - (M.groundRelations source.main.stage.carrier source.main.stage.carrier) - (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 0 at sources - change extra 2 = literalTaskFieldGraph (extra 0) source.main.stage.carrier - (M.groundRelations source.main.stage.carrier source.main.stage.carrier) - (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 1 at targets - change extra 3 = literalTaskFieldGraph (extra 0) source.main.stage.carrier - (M.groundRelations source.main.stage.carrier source.main.stage.carrier) - (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 3 at separators - change extra 4 = literalTaskFieldGraph (extra 0) source.main.stage.carrier - (M.groundRelations source.main.stage.carrier source.main.stage.carrier) - (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 4 at filters - change extra 5 = M.groundPower source.main.stage.carrier at families - rw [tasks] at sources targets separators filters - change extra 1 = source.main.stage.compressionSources Labels at sources - have caps := output.task_caps - have actors := output.compression_actors - change TaskCapFamilyCode (extra 0) source.main.stage.carrier target.main.stage.carrier - target.main.stage.order target.main.stage.meetGraph transition.map.points - (extra 2) (extra 3) (extra 4) (extra 5) (extra 7) at caps - change CompressionActorFulfillmentCode (extra 0) source.main.stage.carrier source.main.stage.actors - target.main.stage.carrier target.main.stage.actors target.main.stage.order target.main.stage.action - transition.map.points transition.map.actors (extra 1) (extra 6) source.main.stage.top (extra 7) at actors - rw [tasks, targets, separators, filters, families] at caps - rw [tasks, sources] at actors - exact ⟨extra 7, ground 7, extra 6, ground 6, tasks ▸ ground 0, - sources ▸ ground 1, caps, representatives, actors⟩ - -end TaskBearingMainSuccessorCode - -section -open SetFormula -universe u - -noncomputable def identityTaskCapFamily (Labels I P Q r Caps c e F : ZFSet.{u}) : ZFSet.{u} := - relationCompose Labels I Q (identityInsertionTaskGraph Labels I P r c e F) Caps - -theorem pair_mem_identityTaskCapFamily {Labels I P Q r Caps c e F label cap : ZFSet.{u}} - (function : ZFSet.IsFunc I Q Caps) : - ZFSet.pair label cap ∈ identityTaskCapFamily Labels I P Q r Caps c e F ↔ - label ∈ Labels ∧ ZFSet.pair (identityInsertionTask P r c e F label) cap ∈ Caps := by - rw [identityTaskCapFamily, pair_mem_relationCompose] - constructor - · rintro ⟨hl, _, i, _, entry, image⟩ - have equal := ((pair_mem_identityInsertionTaskGraph Labels I P r c e F label i).1 entry).2.2 - exact ⟨hl, equal ▸ image⟩ - · rintro ⟨hl, image⟩ - have bounds := ZFSet.pair_mem_prod.1 (function.1 image) - exact ⟨hl, bounds.2, _, bounds.1, - (pair_mem_identityInsertionTaskGraph Labels I P r c e F _ _).2 ⟨hl, bounds.1, rfl⟩, image⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem identityTaskCapFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Labels I P Q r Caps c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) (hI : I ∈ M.sets) - (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hr : r ∈ M.sets) (hCaps : Caps ∈ M.sets) - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) : - identityTaskCapFamily Labels I P Q r Caps c e F ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hLabels hI hQ - (M.identityInsertionTaskGraph_mem pairing unions powers separation hLabels hI hP hr hc he hF) hCaps - -end TransitiveGround - -namespace GroundMainTransition -variable {M : TransitiveGround.{u}} {C D rD Labels Caps : ZFSet.{u}} -variable {source target : GroundMainStage M C D rD} -variable (transition : GroundMainTransition source target) -local notation "P" => source.carrier -local notation "Q" => target.carrier -local notation "I" => source.compressionTasks Labels -local notation "r" => source.order -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (caps : TaskCapFamilyCode (source.compressionTasks Labels) source.carrier target.carrier - target.order target.meetGraph transition.points (source.compressionTargets Labels) - (source.compressionSeparators Labels) (source.compressionFilters Labels) (M.groundPower source.carrier) Caps) -include caps pairing unions powers separation - -theorem identityTaskCapFamily_function {c e F : ZFSet.{u}} - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : - ZFSet.IsFunc Labels Q (identityTaskCapFamily Labels I P Q r Caps c e F) := by - have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) - source.carrier_ground source.order_ground hF source.action_code source.group_code.identity_mem - hc he filter lower strict above - exact relationCompose_function_of_subset tasks.function caps.function (fun _ h => h) - -theorem identityTaskCapFamily_profile {c e F label cap c' e' : ZFSet.{u}} - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) - (entry : ZFSet.pair label cap ∈ identityTaskCapFamily Labels I P Q r Caps c e F) - (imageC : ZFSet.pair c c' ∈ transition.points) (imageE : ZFSet.pair e e' ∈ transition.points) : - CodedCapProfile Q target.order target.meetGraph c' e' cap (relationImage F Q transition.points) := by - obtain ⟨hl, capEntry⟩ := (pair_mem_identityTaskCapFamily caps.function).1 entry - have bounds := ZFSet.pair_mem_prod.1 (caps.function.1 capEntry) - have fields := M.identityInsertionTask_fields pairing unions powers separation source.carrier_ground - source.order_ground hF source.action_code source.group_code.identity_mem hc he filter lower strict above hl - exact caps.profiles _ bounds.1 c hc e he F ((M.mem_groundPower P F).2 ⟨hF, filter.subset⟩) - cap bounds.2 c' (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 - e' (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageE)).2 - (fields 1) (fields 3) (fields 4) capEntry imageC imageE - -theorem identityTaskCapFamily_meet {c e F first second cap₁ cap₂ c' : ZFSet.{u}} - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) - (entry₁ : ZFSet.pair first cap₁ ∈ identityTaskCapFamily Labels I P Q r Caps c e F) - (entry₂ : ZFSet.pair second cap₂ ∈ identityTaskCapFamily Labels I P Q r Caps c e F) - (different : first ≠ second) (imageC : ZFSet.pair c c' ∈ transition.points) : - ZFSet.pair (ZFSet.pair cap₁ cap₂) c' ∈ target.meetGraph := by - obtain ⟨hl₁, capEntry₁⟩ := (pair_mem_identityTaskCapFamily caps.function).1 entry₁ - obtain ⟨hl₂, capEntry₂⟩ := (pair_mem_identityTaskCapFamily caps.function).1 entry₂ - have bounds₁ := ZFSet.pair_mem_prod.1 (caps.function.1 capEntry₁) - have bounds₂ := ZFSet.pair_mem_prod.1 (caps.function.1 capEntry₂) - have fields₁ := M.identityInsertionTask_fields pairing unions powers separation source.carrier_ground - source.order_ground hF source.action_code source.group_code.identity_mem hc he filter lower strict above hl₁ - have fields₂ := M.identityInsertionTask_fields pairing unions powers separation source.carrier_ground - source.order_ground hF source.action_code source.group_code.identity_mem hc he filter lower strict above hl₂ - exact caps.common_target _ bounds₁.1 _ bounds₂.1 c hc cap₁ bounds₁.2 cap₂ bounds₂.2 c' - (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 - (fun equal => different (identityInsertionTask_injective P r c e F equal)) - (fields₁ 1) (fields₂ 1) capEntry₁ capEntry₂ imageC - -theorem identityTaskCapFamily_injection {c e F : ZFSet.{u}} - (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : - InjectionCode Labels Q (identityTaskCapFamily Labels I P Q r Caps c e F) := by - refine ⟨transition.identityTaskCapFamily_function pairing unions powers separation caps - hc he hF filter lower strict above, ?_⟩ - intro first second cap firstEntry secondEntry - by_cases equal : first = second - · exact equal - · obtain ⟨c', imageC, _⟩ := transition.point_embedding.injection.function.2 c hc - obtain ⟨e', imageE, _⟩ := transition.point_embedding.injection.function.2 e he - have profile := transition.identityTaskCapFamily_profile pairing unions powers separation caps - hc he hF filter lower strict above firstEntry imageC imageE - have meet := transition.identityTaskCapFamily_meet pairing unions powers separation caps - hc he hF filter lower strict above firstEntry secondEntry equal imageC - exact (profile.cap_not_below_target (target.meet.greatest cap cap c' cap profile.cap_mem meet - (target.meet.order.refl cap profile.cap_mem) (target.meet.order.refl cap profile.cap_mem))).elim - -end GroundMainTransition - -end - -section -universe u - -namespace TaskRepresentative - -theorem identityInsertion_agreement {P G r A R U Labels m one c e F label g : ZFSet.{u}} - (represented : TaskRepresentative P r A R U Labels (identityInsertionTask P r c e F label) g) - (action : PosetActionCode G P m one r A) : ActionAgreementBelow P r A g one c := by - have restriction := represented.restriction - change RestrictedActionCode P r A g c c (identityIdealGraph P r c) at restriction - intro x hx y _ lower - have fixed : ZFSet.pair (ZFSet.pair g x) x ∈ A := restriction.entry_action - ((pair_mem_identityIdealGraph P r c x x).2 ⟨rfl, hx, lower⟩) - have identity := action.one x hx - have function : FunctionGraphOn (ZFSet.prod G P) A := ⟨P, action.function⟩ - exact ⟨fun entry => (function.unique entry fixed).symm ▸ identity, - fun entry => (function.unique entry identity).symm ▸ fixed⟩ - -end TaskRepresentative - -namespace GroundMainTransition -variable {M : TransitiveGround.{u}} {C D rD Labels Reps Caps : ZFSet.{u}} -variable {source target : GroundMainStage M C D rD} -variable (transition : GroundMainTransition source target) - -theorem identityCompressionActor_fixes {c e F label k c' : ZFSet.{u}} - (representatives : TaskRepresentativesCode Reps (source.compressionTasks Labels) - source.carrier source.actors source.order source.action (M.groundRelations source.carrier source.carrier) - (M.groundMeetFilters source.carrier source.order source.meetGraph) Labels) - (hi : identityInsertionTask source.carrier source.order c e F label ∈ source.compressionTasks Labels) - (actor : CompressionActorCode source.carrier source.actors target.carrier target.actors - target.order target.action transition.points transition.actors (source.compressionSources Labels) - Reps source.top Caps (identityInsertionTask source.carrier source.order c e F label) k) - (imageC : ZFSet.pair c c' ∈ transition.points) : - ∀ z ∈ target.carrier, ZFSet.pair z c' ∈ target.order → - ZFSet.pair (ZFSet.pair k z) z ∈ target.action := by - obtain ⟨hc, hc₂, hb, he, hF, hl, _⟩ := (literalTaskCode_mem_eligibleTaskSet source.carrier source.actors - source.order source.meetGraph source.action (M.groundRelations source.carrier source.carrier) - (M.groundMeetFilters source.carrier source.order source.meetGraph) Labels c c - (identityIdealGraph source.carrier source.order c) e F label).1 hi - have sourceEntry : ZFSet.pair (identityInsertionTask source.carrier source.order c e F label) c ∈ - source.compressionSources Labels := - (literalTaskFieldGraph_entry_iff hc hc₂ hb he hF hl 0).2 ⟨hi, rfl⟩ - obtain ⟨g, repEntry, _⟩ := representatives.1.2 _ hi - have hg := (ZFSet.pair_mem_prod.1 (representatives.1.1 repEntry)).2 - obtain ⟨g', actorEntry, _⟩ := transition.group_embedding.injection.function.2 g hg - have hg' := (ZFSet.pair_mem_prod.1 (transition.group_embedding.injection.function.1 actorEntry)).2 - have hc' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 - have original := (representatives.2 _ _ repEntry).identityInsertion_agreement source.action_code - have imageAgreement := transition.agreement g source.identity g' target.identity c c' - actorEntry transition.group_embedding.one imageC original - have compressionAgreement := actor.1 c hc g hg g' hg' c' hc' sourceEntry repEntry actorEntry imageC - intro z hz lower - exact (compressionAgreement z hz z hz lower).2 - ((imageAgreement z hz z hz lower).2 (target.action_code.one z hz)) - -end GroundMainTransition -end - -namespace TaskBearingMainSuccessorCode -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target : GroundLinkedMainStage M K Labels C D rD} -variable {transition : GroundChronologicalMainTransition source.main target.main} -local notation "P" => source.main.stage.carrier -local notation "r" => source.main.stage.order -local notation "Q" => target.main.stage.carrier -local notation "R" => target.main.stage.order -local notation "ν" => target.main.stage.meetGraph -local notation "H" => target.main.stage.actors -local notation "B" => target.main.stage.action -local notation "points" => transition.map.points - -theorem exists_insertionFamilies - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) (hc : c ∈ P) (he : e ∈ P) - (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.main.stage.meetGraph F) - (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : - ∃ capFamily ∈ M.sets, ∃ actorFamily ∈ M.sets, - InjectionCode Labels Q capFamily ∧ InjectionCode Labels H actorFamily ∧ - (∀ label k top' v, ZFSet.pair label k ∈ actorFamily → - ZFSet.pair source.main.stage.top top' ∈ points → - (ZFSet.pair (ZFSet.pair k top') v ∈ B ↔ ZFSet.pair label v ∈ capFamily)) ∧ - ∀ c' e', ZFSet.pair c c' ∈ points → ZFSet.pair e e' ∈ points → - (∀ label k, ZFSet.pair label k ∈ actorFamily → - ∀ z ∈ Q, ZFSet.pair z c' ∈ R → ZFSet.pair (ZFSet.pair k z) z ∈ B) ∧ - (∀ label k cap, ZFSet.pair label k ∈ actorFamily → ZFSet.pair label cap ∈ capFamily → - ∀ x x' y, ZFSet.pair x x' ∈ points → ZFSet.pair (ZFSet.pair k x') y ∈ B → - ZFSet.pair y cap ∈ R) ∧ - (∀ label cap, ZFSet.pair label cap ∈ capFamily → - CodedCapProfile Q R ν c' e' cap (relationImage F Q points)) ∧ - (∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ capFamily → - ZFSet.pair second cap₂ ∈ capFamily → first ≠ second → - ZFSet.pair (ZFSet.pair cap₁ cap₂) c' ∈ ν) := by - obtain ⟨Caps, hCaps, Reps, hReps, hI, hSources, caps, reps, total⟩ := code.insertion_data - obtain ⟨taskActors, hActors, actorFunction, actorLaws⟩ := M.choose_compressionActorFamily - pairing unions powers separation choice hI source.main.stage.carrier_ground - source.main.stage.actors_ground target.main.stage.carrier_ground target.main.stage.actors_ground - target.main.stage.order_ground target.main.stage.action_ground transition.map.points_ground - transition.map.actors_ground hSources hReps source.main.stage.top_ground hCaps total - let I := source.main.stage.compressionTasks Labels - let capFamily := identityTaskCapFamily Labels I P Q r Caps c e F - let actorFamily := identityTaskCapFamily Labels I P H r taskActors c e F - have capGround : capFamily ∈ M.sets := M.identityTaskCapFamily_mem pairing unions powers separation - hLabels hI source.main.stage.carrier_ground target.main.stage.carrier_ground - source.main.stage.order_ground hCaps hc he hF - have actorGround : actorFamily ∈ M.sets := M.identityTaskCapFamily_mem pairing unions powers separation - hLabels hI source.main.stage.carrier_ground target.main.stage.actors_ground - source.main.stage.order_ground hActors hc he hF - have capInjection : InjectionCode Labels Q capFamily := transition.map.identityTaskCapFamily_injection - pairing unions powers separation caps hc he hF filter lower strict above - have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) - source.main.stage.carrier_ground source.main.stage.order_ground hF source.main.stage.action_code - source.main.stage.group_code.identity_mem hc he filter lower strict above - have function : ZFSet.IsFunc Labels H actorFamily := - relationCompose_function_of_subset tasks.function actorFunction (fun _ h => h) - have topLaw (label k top' v : ZFSet.{u}) (entry : ZFSet.pair label k ∈ actorFamily) - (imageTop : ZFSet.pair source.main.stage.top top' ∈ points) : - ZFSet.pair (ZFSet.pair k top') v ∈ B ↔ ZFSet.pair label v ∈ capFamily := by - obtain ⟨hl, actorEntry⟩ := (pair_mem_identityTaskCapFamily actorFunction).1 entry - have actor := actorLaws _ _ actorEntry - have htop' := (ZFSet.pair_mem_prod.1 (transition.map.point_embedding.injection.function.1 imageTop)).2 - constructor - · intro acted - have hv := (ZFSet.pair_mem_prod.1 (target.main.stage.action_code.function.1 acted)).2 - exact (pair_mem_identityTaskCapFamily caps.function).2 ⟨hl, (actor.2 top' htop' v hv imageTop).1 acted⟩ - · intro capEntry - have rawCap := ((pair_mem_identityTaskCapFamily caps.function).1 capEntry).2 - have hv := (ZFSet.pair_mem_prod.1 (caps.function.1 rawCap)).2 - exact (actor.2 top' htop' v hv imageTop).2 rawCap - have actorInjection : InjectionCode Labels H actorFamily := by - refine ⟨function, ?_⟩ - intro first second k firstEntry secondEntry - have hf := (ZFSet.pair_mem_prod.1 (function.1 firstEntry)).1 - have hs := (ZFSet.pair_mem_prod.1 (function.1 secondEntry)).1 - obtain ⟨cap₁, firstCap, _⟩ := capInjection.function.2 first hf - obtain ⟨cap₂, secondCap, _⟩ := capInjection.function.2 second hs - obtain ⟨top', imageTop, _⟩ := transition.map.point_embedding.injection.function.2 - source.main.stage.top source.main.stage.top_mem - have actionFunction : FunctionGraphOn (ZFSet.prod H Q) B := ⟨Q, target.main.stage.action_code.function⟩ - have equal := actionFunction.unique ((topLaw first k top' cap₁ firstEntry imageTop).2 firstCap) - ((topLaw second k top' cap₂ secondEntry imageTop).2 secondCap) - exact capInjection.injective first second cap₁ firstCap (equal.symm ▸ secondCap) - refine ⟨capFamily, capGround, actorFamily, actorGround, capInjection, actorInjection, topLaw, ?_⟩ - intro c' e' imageC imageE - refine ⟨?_, ?_, ?_, ?_⟩ - · intro label k entry - have actorEntry := ((pair_mem_identityTaskCapFamily actorFunction).1 entry).2 - have hi := (ZFSet.pair_mem_prod.1 (actorFunction.1 actorEntry)).1 - exact transition.map.identityCompressionActor_fixes reps hi (actorLaws _ _ actorEntry) imageC - · intro label k cap actorEntry capEntry x x' y image acted - have hk := (ZFSet.pair_mem_prod.1 (function.1 actorEntry)).2 - have shape := ZFSet.pair_mem_prod.1 (transition.map.point_embedding.injection.function.1 image) - obtain ⟨top', imageTop, _⟩ := transition.map.point_embedding.injection.function.2 - source.main.stage.top source.main.stage.top_mem - have htop' := (ZFSet.pair_mem_prod.1 (transition.map.point_embedding.injection.function.1 imageTop)).2 - have topAction := (topLaw label k top' cap actorEntry imageTop).2 capEntry - have hy := (ZFSet.pair_mem_prod.1 (target.main.stage.action_code.function.1 acted)).2 - have hcap := (ZFSet.pair_mem_prod.1 (target.main.stage.action_code.function.1 topAction)).2 - have below := transition.map.point_embedding.monotone x source.main.stage.top x' top' - (source.main.stage.greatest x shape.1) image imageTop - exact target.main.stage.action_code.monotone k hk x' shape.2 top' htop' y hy cap hcap acted topAction below - · intro label cap entry - exact transition.map.identityTaskCapFamily_profile pairing unions powers separation caps - hc he hF filter lower strict above entry imageC imageE - · intro first second cap₁ cap₂ firstEntry secondEntry different - exact transition.map.identityTaskCapFamily_meet pairing unions powers separation caps - hc he hF filter lower strict above firstEntry secondEntry different imageC - -end TaskBearingMainSuccessorCode - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTaskBearingSuccessorDecoding + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TaskBearingMainSuccessorCode +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target : GroundLinkedMainStage M K Labels C D rD} +variable {transition : GroundChronologicalMainTransition source.main target.main} + +theorem insertion_data + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) : + ∃ Caps ∈ M.sets, ∃ Reps ∈ M.sets, + source.main.stage.compressionTasks Labels ∈ M.sets ∧ + source.main.stage.compressionSources Labels ∈ M.sets ∧ + TaskCapFamilyCode (source.main.stage.compressionTasks Labels) + source.main.stage.carrier target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph + transition.map.points (source.main.stage.compressionTargets Labels) + (source.main.stage.compressionSeparators Labels) (source.main.stage.compressionFilters Labels) + (M.groundPower source.main.stage.carrier) Caps ∧ + TaskRepresentativesCode Reps (source.main.stage.compressionTasks Labels) + source.main.stage.carrier source.main.stage.actors source.main.stage.order source.main.stage.action + (M.groundRelations source.main.stage.carrier source.main.stage.carrier) + (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels ∧ + CompressionActorFulfillmentCode (source.main.stage.compressionTasks Labels) + source.main.stage.carrier source.main.stage.actors target.main.stage.carrier target.main.stage.actors + target.main.stage.order target.main.stage.action transition.map.points transition.map.actors + (source.main.stage.compressionSources Labels) Reps source.main.stage.top Caps := by + obtain ⟨extra, ground, output, bindings⟩ := code.output_on_linked + obtain ⟨tasks, sources, targets, separators, filters, families, representatives⟩ := bindings + change extra 0 = source.main.stage.compressionTasks Labels at tasks + change extra 1 = literalTaskFieldGraph (extra 0) source.main.stage.carrier + (M.groundRelations source.main.stage.carrier source.main.stage.carrier) + (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 0 at sources + change extra 2 = literalTaskFieldGraph (extra 0) source.main.stage.carrier + (M.groundRelations source.main.stage.carrier source.main.stage.carrier) + (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 1 at targets + change extra 3 = literalTaskFieldGraph (extra 0) source.main.stage.carrier + (M.groundRelations source.main.stage.carrier source.main.stage.carrier) + (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 3 at separators + change extra 4 = literalTaskFieldGraph (extra 0) source.main.stage.carrier + (M.groundRelations source.main.stage.carrier source.main.stage.carrier) + (M.groundMeetFilters source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph) Labels 4 at filters + change extra 5 = M.groundPower source.main.stage.carrier at families + rw [tasks] at sources targets separators filters + change extra 1 = source.main.stage.compressionSources Labels at sources + have caps := output.task_caps + have actors := output.compression_actors + change TaskCapFamilyCode (extra 0) source.main.stage.carrier target.main.stage.carrier + target.main.stage.order target.main.stage.meetGraph transition.map.points + (extra 2) (extra 3) (extra 4) (extra 5) (extra 7) at caps + change CompressionActorFulfillmentCode (extra 0) source.main.stage.carrier source.main.stage.actors + target.main.stage.carrier target.main.stage.actors target.main.stage.order target.main.stage.action + transition.map.points transition.map.actors (extra 1) (extra 6) source.main.stage.top (extra 7) at actors + rw [tasks, targets, separators, filters, families] at caps + rw [tasks, sources] at actors + exact ⟨extra 7, ground 7, extra 6, ground 6, tasks ▸ ground 0, + sources ▸ ground 1, caps, representatives, actors⟩ + +end TaskBearingMainSuccessorCode + +section +open SetFormula +universe u + +noncomputable def identityTaskCapFamily (Labels I P Q r Caps c e F : ZFSet.{u}) : ZFSet.{u} := + relationCompose Labels I Q (identityInsertionTaskGraph Labels I P r c e F) Caps + +theorem pair_mem_identityTaskCapFamily {Labels I P Q r Caps c e F label cap : ZFSet.{u}} + (function : ZFSet.IsFunc I Q Caps) : + ZFSet.pair label cap ∈ identityTaskCapFamily Labels I P Q r Caps c e F ↔ + label ∈ Labels ∧ ZFSet.pair (identityInsertionTask P r c e F label) cap ∈ Caps := by + rw [identityTaskCapFamily, pair_mem_relationCompose] + constructor + · rintro ⟨hl, _, i, _, entry, image⟩ + have equal := ((pair_mem_identityInsertionTaskGraph Labels I P r c e F label i).1 entry).2.2 + exact ⟨hl, equal ▸ image⟩ + · rintro ⟨hl, image⟩ + have bounds := ZFSet.pair_mem_prod.1 (function.1 image) + exact ⟨hl, bounds.2, _, bounds.1, + (pair_mem_identityInsertionTaskGraph Labels I P r c e F _ _).2 ⟨hl, bounds.1, rfl⟩, image⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem identityTaskCapFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Labels I P Q r Caps c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) (hI : I ∈ M.sets) + (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hr : r ∈ M.sets) (hCaps : Caps ∈ M.sets) + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) : + identityTaskCapFamily Labels I P Q r Caps c e F ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hLabels hI hQ + (M.identityInsertionTaskGraph_mem pairing unions powers separation hLabels hI hP hr hc he hF) hCaps + +end TransitiveGround + +namespace GroundMainTransition +variable {M : TransitiveGround.{u}} {C D rD Labels Caps : ZFSet.{u}} +variable {source target : GroundMainStage M C D rD} +variable (transition : GroundMainTransition source target) +local notation "P" => source.carrier +local notation "Q" => target.carrier +local notation "I" => source.compressionTasks Labels +local notation "r" => source.order +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (caps : TaskCapFamilyCode (source.compressionTasks Labels) source.carrier target.carrier + target.order target.meetGraph transition.points (source.compressionTargets Labels) + (source.compressionSeparators Labels) (source.compressionFilters Labels) (M.groundPower source.carrier) Caps) +include caps pairing unions powers separation + +theorem identityTaskCapFamily_function {c e F : ZFSet.{u}} + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : + ZFSet.IsFunc Labels Q (identityTaskCapFamily Labels I P Q r Caps c e F) := by + have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) + source.carrier_ground source.order_ground hF source.action_code source.group_code.identity_mem + hc he filter lower strict above + exact relationCompose_function_of_subset tasks.function caps.function (fun _ h => h) + +theorem identityTaskCapFamily_profile {c e F label cap c' e' : ZFSet.{u}} + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) + (entry : ZFSet.pair label cap ∈ identityTaskCapFamily Labels I P Q r Caps c e F) + (imageC : ZFSet.pair c c' ∈ transition.points) (imageE : ZFSet.pair e e' ∈ transition.points) : + CodedCapProfile Q target.order target.meetGraph c' e' cap (relationImage F Q transition.points) := by + obtain ⟨hl, capEntry⟩ := (pair_mem_identityTaskCapFamily caps.function).1 entry + have bounds := ZFSet.pair_mem_prod.1 (caps.function.1 capEntry) + have fields := M.identityInsertionTask_fields pairing unions powers separation source.carrier_ground + source.order_ground hF source.action_code source.group_code.identity_mem hc he filter lower strict above hl + exact caps.profiles _ bounds.1 c hc e he F ((M.mem_groundPower P F).2 ⟨hF, filter.subset⟩) + cap bounds.2 c' (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 + e' (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageE)).2 + (fields 1) (fields 3) (fields 4) capEntry imageC imageE + +theorem identityTaskCapFamily_meet {c e F first second cap₁ cap₂ c' : ZFSet.{u}} + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) + (entry₁ : ZFSet.pair first cap₁ ∈ identityTaskCapFamily Labels I P Q r Caps c e F) + (entry₂ : ZFSet.pair second cap₂ ∈ identityTaskCapFamily Labels I P Q r Caps c e F) + (different : first ≠ second) (imageC : ZFSet.pair c c' ∈ transition.points) : + ZFSet.pair (ZFSet.pair cap₁ cap₂) c' ∈ target.meetGraph := by + obtain ⟨hl₁, capEntry₁⟩ := (pair_mem_identityTaskCapFamily caps.function).1 entry₁ + obtain ⟨hl₂, capEntry₂⟩ := (pair_mem_identityTaskCapFamily caps.function).1 entry₂ + have bounds₁ := ZFSet.pair_mem_prod.1 (caps.function.1 capEntry₁) + have bounds₂ := ZFSet.pair_mem_prod.1 (caps.function.1 capEntry₂) + have fields₁ := M.identityInsertionTask_fields pairing unions powers separation source.carrier_ground + source.order_ground hF source.action_code source.group_code.identity_mem hc he filter lower strict above hl₁ + have fields₂ := M.identityInsertionTask_fields pairing unions powers separation source.carrier_ground + source.order_ground hF source.action_code source.group_code.identity_mem hc he filter lower strict above hl₂ + exact caps.common_target _ bounds₁.1 _ bounds₂.1 c hc cap₁ bounds₁.2 cap₂ bounds₂.2 c' + (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 + (fun equal => different (identityInsertionTask_injective P r c e F equal)) + (fields₁ 1) (fields₂ 1) capEntry₁ capEntry₂ imageC + +theorem identityTaskCapFamily_injection {c e F : ZFSet.{u}} + (hc : c ∈ P) (he : e ∈ P) (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : + InjectionCode Labels Q (identityTaskCapFamily Labels I P Q r Caps c e F) := by + refine ⟨transition.identityTaskCapFamily_function pairing unions powers separation caps + hc he hF filter lower strict above, ?_⟩ + intro first second cap firstEntry secondEntry + by_cases equal : first = second + · exact equal + · obtain ⟨c', imageC, _⟩ := transition.point_embedding.injection.function.2 c hc + obtain ⟨e', imageE, _⟩ := transition.point_embedding.injection.function.2 e he + have profile := transition.identityTaskCapFamily_profile pairing unions powers separation caps + hc he hF filter lower strict above firstEntry imageC imageE + have meet := transition.identityTaskCapFamily_meet pairing unions powers separation caps + hc he hF filter lower strict above firstEntry secondEntry equal imageC + exact (profile.cap_not_below_target (target.meet.greatest cap cap c' cap profile.cap_mem meet + (target.meet.order.refl cap profile.cap_mem) (target.meet.order.refl cap profile.cap_mem))).elim + +end GroundMainTransition + +end + +section +universe u + +namespace TaskRepresentative + +theorem identityInsertion_agreement {P G r A R U Labels m one c e F label g : ZFSet.{u}} + (represented : TaskRepresentative P r A R U Labels (identityInsertionTask P r c e F label) g) + (action : PosetActionCode G P m one r A) : ActionAgreementBelow P r A g one c := by + have restriction := represented.restriction + change RestrictedActionCode P r A g c c (identityIdealGraph P r c) at restriction + intro x hx y _ lower + have fixed : ZFSet.pair (ZFSet.pair g x) x ∈ A := restriction.entry_action + ((pair_mem_identityIdealGraph P r c x x).2 ⟨rfl, hx, lower⟩) + have identity := action.one x hx + have function : FunctionGraphOn (ZFSet.prod G P) A := ⟨P, action.function⟩ + exact ⟨fun entry => (function.unique entry fixed).symm ▸ identity, + fun entry => (function.unique entry identity).symm ▸ fixed⟩ + +end TaskRepresentative + +namespace GroundMainTransition +variable {M : TransitiveGround.{u}} {C D rD Labels Reps Caps : ZFSet.{u}} +variable {source target : GroundMainStage M C D rD} +variable (transition : GroundMainTransition source target) + +theorem identityCompressionActor_fixes {c e F label k c' : ZFSet.{u}} + (representatives : TaskRepresentativesCode Reps (source.compressionTasks Labels) + source.carrier source.actors source.order source.action (M.groundRelations source.carrier source.carrier) + (M.groundMeetFilters source.carrier source.order source.meetGraph) Labels) + (hi : identityInsertionTask source.carrier source.order c e F label ∈ source.compressionTasks Labels) + (actor : CompressionActorCode source.carrier source.actors target.carrier target.actors + target.order target.action transition.points transition.actors (source.compressionSources Labels) + Reps source.top Caps (identityInsertionTask source.carrier source.order c e F label) k) + (imageC : ZFSet.pair c c' ∈ transition.points) : + ∀ z ∈ target.carrier, ZFSet.pair z c' ∈ target.order → + ZFSet.pair (ZFSet.pair k z) z ∈ target.action := by + obtain ⟨hc, hc₂, hb, he, hF, hl, _⟩ := (literalTaskCode_mem_eligibleTaskSet source.carrier source.actors + source.order source.meetGraph source.action (M.groundRelations source.carrier source.carrier) + (M.groundMeetFilters source.carrier source.order source.meetGraph) Labels c c + (identityIdealGraph source.carrier source.order c) e F label).1 hi + have sourceEntry : ZFSet.pair (identityInsertionTask source.carrier source.order c e F label) c ∈ + source.compressionSources Labels := + (literalTaskFieldGraph_entry_iff hc hc₂ hb he hF hl 0).2 ⟨hi, rfl⟩ + obtain ⟨g, repEntry, _⟩ := representatives.1.2 _ hi + have hg := (ZFSet.pair_mem_prod.1 (representatives.1.1 repEntry)).2 + obtain ⟨g', actorEntry, _⟩ := transition.group_embedding.injection.function.2 g hg + have hg' := (ZFSet.pair_mem_prod.1 (transition.group_embedding.injection.function.1 actorEntry)).2 + have hc' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 + have original := (representatives.2 _ _ repEntry).identityInsertion_agreement source.action_code + have imageAgreement := transition.agreement g source.identity g' target.identity c c' + actorEntry transition.group_embedding.one imageC original + have compressionAgreement := actor.1 c hc g hg g' hg' c' hc' sourceEntry repEntry actorEntry imageC + intro z hz lower + exact (compressionAgreement z hz z hz lower).2 + ((imageAgreement z hz z hz lower).2 (target.action_code.one z hz)) + +end GroundMainTransition +end + +namespace TaskBearingMainSuccessorCode +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target : GroundLinkedMainStage M K Labels C D rD} +variable {transition : GroundChronologicalMainTransition source.main target.main} +local notation "P" => source.main.stage.carrier +local notation "r" => source.main.stage.order +local notation "Q" => target.main.stage.carrier +local notation "R" => target.main.stage.order +local notation "ν" => target.main.stage.meetGraph +local notation "H" => target.main.stage.actors +local notation "B" => target.main.stage.action +local notation "points" => transition.map.points + +theorem exists_insertionFamilies + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) (hc : c ∈ P) (he : e ∈ P) + (hF : F ∈ M.sets) (filter : MeetFilterCode P r source.main.stage.meetGraph F) + (lower : ZFSet.pair c e ∈ r) (strict : ZFSet.pair e c ∉ r) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ r) : + ∃ capFamily ∈ M.sets, ∃ actorFamily ∈ M.sets, + InjectionCode Labels Q capFamily ∧ InjectionCode Labels H actorFamily ∧ + (∀ label k top' v, ZFSet.pair label k ∈ actorFamily → + ZFSet.pair source.main.stage.top top' ∈ points → + (ZFSet.pair (ZFSet.pair k top') v ∈ B ↔ ZFSet.pair label v ∈ capFamily)) ∧ + ∀ c' e', ZFSet.pair c c' ∈ points → ZFSet.pair e e' ∈ points → + (∀ label k, ZFSet.pair label k ∈ actorFamily → + ∀ z ∈ Q, ZFSet.pair z c' ∈ R → ZFSet.pair (ZFSet.pair k z) z ∈ B) ∧ + (∀ label k cap, ZFSet.pair label k ∈ actorFamily → ZFSet.pair label cap ∈ capFamily → + ∀ x x' y, ZFSet.pair x x' ∈ points → ZFSet.pair (ZFSet.pair k x') y ∈ B → + ZFSet.pair y cap ∈ R) ∧ + (∀ label cap, ZFSet.pair label cap ∈ capFamily → + CodedCapProfile Q R ν c' e' cap (relationImage F Q points)) ∧ + (∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ capFamily → + ZFSet.pair second cap₂ ∈ capFamily → first ≠ second → + ZFSet.pair (ZFSet.pair cap₁ cap₂) c' ∈ ν) := by + obtain ⟨Caps, hCaps, Reps, hReps, hI, hSources, caps, reps, total⟩ := code.insertion_data + obtain ⟨taskActors, hActors, actorFunction, actorLaws⟩ := M.choose_compressionActorFamily + pairing unions powers separation choice hI source.main.stage.carrier_ground + source.main.stage.actors_ground target.main.stage.carrier_ground target.main.stage.actors_ground + target.main.stage.order_ground target.main.stage.action_ground transition.map.points_ground + transition.map.actors_ground hSources hReps source.main.stage.top_ground hCaps total + let I := source.main.stage.compressionTasks Labels + let capFamily := identityTaskCapFamily Labels I P Q r Caps c e F + let actorFamily := identityTaskCapFamily Labels I P H r taskActors c e F + have capGround : capFamily ∈ M.sets := M.identityTaskCapFamily_mem pairing unions powers separation + hLabels hI source.main.stage.carrier_ground target.main.stage.carrier_ground + source.main.stage.order_ground hCaps hc he hF + have actorGround : actorFamily ∈ M.sets := M.identityTaskCapFamily_mem pairing unions powers separation + hLabels hI source.main.stage.carrier_ground target.main.stage.actors_ground + source.main.stage.order_ground hActors hc he hF + have capInjection : InjectionCode Labels Q capFamily := transition.map.identityTaskCapFamily_injection + pairing unions powers separation caps hc he hF filter lower strict above + have tasks := M.identityInsertionTaskGraph_injection pairing unions powers separation (Labels := Labels) + source.main.stage.carrier_ground source.main.stage.order_ground hF source.main.stage.action_code + source.main.stage.group_code.identity_mem hc he filter lower strict above + have function : ZFSet.IsFunc Labels H actorFamily := + relationCompose_function_of_subset tasks.function actorFunction (fun _ h => h) + have topLaw (label k top' v : ZFSet.{u}) (entry : ZFSet.pair label k ∈ actorFamily) + (imageTop : ZFSet.pair source.main.stage.top top' ∈ points) : + ZFSet.pair (ZFSet.pair k top') v ∈ B ↔ ZFSet.pair label v ∈ capFamily := by + obtain ⟨hl, actorEntry⟩ := (pair_mem_identityTaskCapFamily actorFunction).1 entry + have actor := actorLaws _ _ actorEntry + have htop' := (ZFSet.pair_mem_prod.1 (transition.map.point_embedding.injection.function.1 imageTop)).2 + constructor + · intro acted + have hv := (ZFSet.pair_mem_prod.1 (target.main.stage.action_code.function.1 acted)).2 + exact (pair_mem_identityTaskCapFamily caps.function).2 ⟨hl, (actor.2 top' htop' v hv imageTop).1 acted⟩ + · intro capEntry + have rawCap := ((pair_mem_identityTaskCapFamily caps.function).1 capEntry).2 + have hv := (ZFSet.pair_mem_prod.1 (caps.function.1 rawCap)).2 + exact (actor.2 top' htop' v hv imageTop).2 rawCap + have actorInjection : InjectionCode Labels H actorFamily := by + refine ⟨function, ?_⟩ + intro first second k firstEntry secondEntry + have hf := (ZFSet.pair_mem_prod.1 (function.1 firstEntry)).1 + have hs := (ZFSet.pair_mem_prod.1 (function.1 secondEntry)).1 + obtain ⟨cap₁, firstCap, _⟩ := capInjection.function.2 first hf + obtain ⟨cap₂, secondCap, _⟩ := capInjection.function.2 second hs + obtain ⟨top', imageTop, _⟩ := transition.map.point_embedding.injection.function.2 + source.main.stage.top source.main.stage.top_mem + have actionFunction : FunctionGraphOn (ZFSet.prod H Q) B := ⟨Q, target.main.stage.action_code.function⟩ + have equal := actionFunction.unique ((topLaw first k top' cap₁ firstEntry imageTop).2 firstCap) + ((topLaw second k top' cap₂ secondEntry imageTop).2 secondCap) + exact capInjection.injective first second cap₁ firstCap (equal.symm ▸ secondCap) + refine ⟨capFamily, capGround, actorFamily, actorGround, capInjection, actorInjection, topLaw, ?_⟩ + intro c' e' imageC imageE + refine ⟨?_, ?_, ?_, ?_⟩ + · intro label k entry + have actorEntry := ((pair_mem_identityTaskCapFamily actorFunction).1 entry).2 + have hi := (ZFSet.pair_mem_prod.1 (actorFunction.1 actorEntry)).1 + exact transition.map.identityCompressionActor_fixes reps hi (actorLaws _ _ actorEntry) imageC + · intro label k cap actorEntry capEntry x x' y image acted + have hk := (ZFSet.pair_mem_prod.1 (function.1 actorEntry)).2 + have shape := ZFSet.pair_mem_prod.1 (transition.map.point_embedding.injection.function.1 image) + obtain ⟨top', imageTop, _⟩ := transition.map.point_embedding.injection.function.2 + source.main.stage.top source.main.stage.top_mem + have htop' := (ZFSet.pair_mem_prod.1 (transition.map.point_embedding.injection.function.1 imageTop)).2 + have topAction := (topLaw label k top' cap actorEntry imageTop).2 capEntry + have hy := (ZFSet.pair_mem_prod.1 (target.main.stage.action_code.function.1 acted)).2 + have hcap := (ZFSet.pair_mem_prod.1 (target.main.stage.action_code.function.1 topAction)).2 + have below := transition.map.point_embedding.monotone x source.main.stage.top x' top' + (source.main.stage.greatest x shape.1) image imageTop + exact target.main.stage.action_code.monotone k hk x' shape.2 top' htop' y hy cap hcap acted topAction below + · intro label cap entry + exact transition.map.identityTaskCapFamily_profile pairing unions powers separation caps + hc he hF filter lower strict above entry imageC imageE + · intro first second cap₁ cap₂ firstEntry secondEntry different + exact transition.map.identityTaskCapFamily_meet pairing unions powers separation caps + hc he hF filter lower strict above firstEntry secondEntry different imageC + +end TaskBearingMainSuccessorCode + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingRectangles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingRectangles.lean index f2bcf2b1eab38b3e5c085e6b44b25eb21d688987..a2b913bddec55cfdebbd19c6107c21314fa3c19e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingRectangles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingRectangles.lean @@ -1,61 +1,61 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport -import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u v - -namespace TaskBearingMainSuccessorCode -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target : GroundLinkedMainStage M K Labels C D rD} -variable {transition : GroundChronologicalMainTransition source.main target.main} - -theorem rectangles_on_linked - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) : - RectangleFulfillmentCode source.main.stage.carrier source.main.stage.actors - source.main.stage.order source.main.stage.meetGraph source.main.stage.action - target.main.stage.carrier target.main.stage.actors target.main.stage.order - target.main.stage.meetGraph target.main.stage.action transition.map.points transition.map.actors := by - obtain ⟨extra, _, output, _⟩ := code.output_on_linked - exact output.rectangles - -end TaskBearingMainSuccessorCode - -namespace GroundMainPrefix -open SetFormula -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem rectangles_of_taskBearing {i j : I} (before : i ≤ j) - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) : - RectangleFulfillmentCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.actors - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph - (run.diagram.stage i).stage.action (run.diagram.stage j).stage.carrier - (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.order - (run.diagram.stage j).stage.meetGraph (run.diagram.stage j).stage.action - (run.diagram.transition before).map.points (run.diagram.transition before).map.actors := by - let transition := (run.diagram.transition before).retargetEq - (run.linked_main i).symm (run.linked_main j).symm - have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code transition.map.code := by - simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code - have strict := actual.rectangles_on_linked - simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, - GroundChronologicalMainTransition.retargetEq_actors, - run.linked_main i, run.linked_main j] using strict - -end GroundMainPrefix -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport +import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u v + +namespace TaskBearingMainSuccessorCode +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target : GroundLinkedMainStage M K Labels C D rD} +variable {transition : GroundChronologicalMainTransition source.main target.main} + +theorem rectangles_on_linked + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) : + RectangleFulfillmentCode source.main.stage.carrier source.main.stage.actors + source.main.stage.order source.main.stage.meetGraph source.main.stage.action + target.main.stage.carrier target.main.stage.actors target.main.stage.order + target.main.stage.meetGraph target.main.stage.action transition.map.points transition.map.actors := by + obtain ⟨extra, _, output, _⟩ := code.output_on_linked + exact output.rectangles + +end TaskBearingMainSuccessorCode + +namespace GroundMainPrefix +open SetFormula +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem rectangles_of_taskBearing {i j : I} (before : i ≤ j) + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) : + RectangleFulfillmentCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.actors + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph + (run.diagram.stage i).stage.action (run.diagram.stage j).stage.carrier + (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.order + (run.diagram.stage j).stage.meetGraph (run.diagram.stage j).stage.action + (run.diagram.transition before).map.points (run.diagram.transition before).map.actors := by + let transition := (run.diagram.transition before).retargetEq + (run.linked_main i).symm (run.linked_main j).symm + have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code transition.map.code := by + simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code + have strict := actual.rectangles_on_linked + simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, + GroundChronologicalMainTransition.retargetEq_actors, + run.linked_main i, run.linked_main j] using strict + +end GroundMainPrefix +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingSeparation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingSeparation.lean index 831e908eff6f935f1072d965d5af1d5becb59c97..b1693793daf932cee0607d6cb346dbf2da4acb32 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingSeparation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingSeparation.lean @@ -1,63 +1,63 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport -import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u v - -namespace TaskBearingMainSuccessorCode -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target : GroundLinkedMainStage M K Labels C D rD} -variable {transition : GroundChronologicalMainTransition source.main target.main} - -theorem separation_on_linked - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) : - SeparationFulfillmentCode source.main.stage.carrier source.main.stage.order - target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph - target.main.stage.actors target.main.stage.action transition.map.points := by - obtain ⟨extra, _, output, _⟩ := code.output_on_linked - have separated := output.separation - simp only [linkedSuccessorOutputFields_0, linkedSuccessorOutputFields_2, - linkedSuccessorOutputFields_1, linkedSuccessorOutputFields_3, - linkedSuccessorOutputFields_5, linkedSuccessorOutputFields_7, - linkedSuccessorOutputFields_13, linkedSuccessorOutputFields_18] at separated - exact separated - -end TaskBearingMainSuccessorCode - -namespace GroundMainPrefix -open SetFormula -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem separation_of_taskBearing {i j : I} (before : i ≤ j) - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) : - SeparationFulfillmentCode (run.diagram.stage i).stage.carrier - (run.diagram.stage i).stage.order (run.diagram.stage j).stage.carrier - (run.diagram.stage j).stage.order (run.diagram.stage j).stage.meetGraph - (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.action - (run.diagram.transition before).map.points := by - let transition := (run.diagram.transition before).retargetEq - (run.linked_main i).symm (run.linked_main j).symm - have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code transition.map.code := by - simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code - have separated := actual.separation_on_linked - simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, - run.linked_main i, run.linked_main j] using separated - -end GroundMainPrefix -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport +import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u v + +namespace TaskBearingMainSuccessorCode +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target : GroundLinkedMainStage M K Labels C D rD} +variable {transition : GroundChronologicalMainTransition source.main target.main} + +theorem separation_on_linked + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) : + SeparationFulfillmentCode source.main.stage.carrier source.main.stage.order + target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph + target.main.stage.actors target.main.stage.action transition.map.points := by + obtain ⟨extra, _, output, _⟩ := code.output_on_linked + have separated := output.separation + simp only [linkedSuccessorOutputFields_0, linkedSuccessorOutputFields_2, + linkedSuccessorOutputFields_1, linkedSuccessorOutputFields_3, + linkedSuccessorOutputFields_5, linkedSuccessorOutputFields_7, + linkedSuccessorOutputFields_13, linkedSuccessorOutputFields_18] at separated + exact separated + +end TaskBearingMainSuccessorCode + +namespace GroundMainPrefix +open SetFormula +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem separation_of_taskBearing {i j : I} (before : i ≤ j) + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) : + SeparationFulfillmentCode (run.diagram.stage i).stage.carrier + (run.diagram.stage i).stage.order (run.diagram.stage j).stage.carrier + (run.diagram.stage j).stage.order (run.diagram.stage j).stage.meetGraph + (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.action + (run.diagram.transition before).map.points := by + let transition := (run.diagram.transition before).retargetEq + (run.linked_main i).symm (run.linked_main j).symm + have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code transition.map.code := by + simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code + have separated := actual.separation_on_linked + simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, + run.linked_main i, run.linked_main j] using separated + +end GroundMainPrefix +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingStrictTop.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingStrictTop.lean index 9938e0039ef1b4ab3eefe3f088d7d28c96c5194a..40187e9438997208911d2d50f11d7964ecc2d31d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingStrictTop.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskBearingStrictTop.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport -import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u v - -namespace TaskBearingMainSuccessorCode -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target : GroundLinkedMainStage M K Labels C D rD} -variable {transition : GroundChronologicalMainTransition source.main target.main} - -theorem strict_top_on_linked - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) : - StrictSuccessorTopCode source.main.stage.carrier target.main.stage.carrier - target.main.stage.order transition.map.points target.main.stage.top := by - obtain ⟨extra, _, output, _⟩ := code.output_on_linked - have strict := output.strict_top - rw [linkedSuccessorOutputFields_0, linkedSuccessorOutputFields_1, - linkedSuccessorOutputFields_3, linkedSuccessorOutputFields_18, - linkedSuccessorOutputFields_29] at strict - exact strict - -end TaskBearingMainSuccessorCode - -namespace GroundMainPrefix -open SetFormula -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem strict_top_of_taskBearing {i j : I} (before : i ≤ j) - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) : - StrictSuccessorTopCode (run.diagram.stage i).stage.carrier - (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order - (run.diagram.transition before).map.points (run.diagram.stage j).stage.top := by - let transition := (run.diagram.transition before).retargetEq - (run.linked_main i).symm (run.linked_main j).symm - have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code transition.map.code := by - simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code - have strict := actual.strict_top_on_linked - simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, - run.linked_main i, run.linked_main j] using strict - -end GroundMainPrefix -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport +import OAI.SetTheory.PartitionPrinciple.Transfinite.LinkedSuccessorOutputFieldEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u v + +namespace TaskBearingMainSuccessorCode +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target : GroundLinkedMainStage M K Labels C D rD} +variable {transition : GroundChronologicalMainTransition source.main target.main} + +theorem strict_top_on_linked + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) : + StrictSuccessorTopCode source.main.stage.carrier target.main.stage.carrier + target.main.stage.order transition.map.points target.main.stage.top := by + obtain ⟨extra, _, output, _⟩ := code.output_on_linked + have strict := output.strict_top + rw [linkedSuccessorOutputFields_0, linkedSuccessorOutputFields_1, + linkedSuccessorOutputFields_3, linkedSuccessorOutputFields_18, + linkedSuccessorOutputFields_29] at strict + exact strict + +end TaskBearingMainSuccessorCode + +namespace GroundMainPrefix +open SetFormula +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem strict_top_of_taskBearing {i j : I} (before : i ≤ j) + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) : + StrictSuccessorTopCode (run.diagram.stage i).stage.carrier + (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order + (run.diagram.transition before).map.points (run.diagram.stage j).stage.top := by + let transition := (run.diagram.transition before).retargetEq + (run.linked_main i).symm (run.linked_main j).symm + have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code transition.map.code := by + simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code + have strict := actual.strict_top_on_linked + simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, + run.linked_main i, run.linked_main j] using strict + +end GroundMainPrefix +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskRepresentativeRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskRepresentativeRecognition.lean index 32637128d1c73d797fb582228064255887398c93..5a7fe886aa4152fab954deae98d8c3c07216c768 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskRepresentativeRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTaskRepresentativeRecognition.lean @@ -1,287 +1,287 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundEligibleTaskSetRecognition -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace SetFormula - -def groundRelationsFormula {n} (output P Q : Fin n) : SetFormula n := - exactSetFormula output (BoundedFormula.relationBetweenFormula P.succ Q.succ 0).toFormula - -def groundMeetFiltersFormula {n} (output P r μ : Fin n) : SetFormula n := - exactSetFormula output (BoundedFormula.meetFilterFormula P.succ r.succ μ.succ 0).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_groundRelationsFormula {n} (output P Q : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (groundRelationsFormula output P Q) env ↔ - env output = M.groundRelations (env P) (env Q) := by - apply M.realize_exactSetFormula output _ env (members output) - (fun z hz => ((M.mem_groundRelations _ _ z).1 hz).1) - intro z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_relationBetweenFormula, M.mem_groundRelations] - exact ⟨fun subset => ⟨hz, subset⟩, And.right⟩ - -theorem realize_groundMeetFiltersFormula {n} (output P r μ : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (groundMeetFiltersFormula output P r μ) env ↔ - env output = M.groundMeetFilters (env P) (env r) (env μ) := by - apply M.realize_exactSetFormula output _ env (members output) - (fun z hz => ((M.mem_groundMeetFilters _ _ _ z).1 hz).1) - intro z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_meetFilterFormula P.succ r.succ μ.succ 0 (extend z env) meet, M.mem_groundMeetFilters] - exact ⟨fun filter => ⟨hz, filter⟩, And.right⟩ - -end TransitiveGround - -namespace SetFormula - -def groundLiteralTaskFieldFormula {n} (j : Fin 6) (output I P r μ Labels : Fin n) : SetFormula n := - ex (ex (.conj (groundRelationsFormula 1 P.succ.succ P.succ.succ) - (.conj (groundMeetFiltersFormula 0 P.succ.succ r.succ.succ μ.succ.succ) - (literalTaskFieldSetFormula j output.succ.succ I.succ.succ P.succ.succ 1 0 Labels.succ.succ)))) - -def taskTransportSetFormula {n} (output G I P R U Labels A : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.taskTransportEntryFormula 0 G.succ I.succ P.succ R.succ U.succ Labels.succ A.succ).toFormula - -def groundTaskTransportFormula {n} (output P G r μ A Labels : Fin n) : SetFormula n := - let old (i : Fin n) := i.succ.succ.succ - ex (ex (ex (.conj (groundEligibleTasksFormula 2 (old P) (old G) (old r) (old μ) (old A) (old Labels)) - (.conj (groundRelationsFormula 1 (old P) (old P)) - (.conj (groundMeetFiltersFormula 0 (old P) (old r) (old μ)) - (taskTransportSetFormula (old output) (old G) 2 (old P) 1 0 (old Labels) (old A))))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_groundLiteralTaskFieldFormula {n} (j : Fin 6) (output I P r μ Labels : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (groundLiteralTaskFieldFormula j output I P r μ Labels) env ↔ - env output = literalTaskFieldGraph (env I) (env P) - (M.groundRelations (env P) (env P)) (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) j := by - simp only [groundLiteralTaskFieldFormula, realize_ex, Realize] - constructor - · rintro ⟨R, hR, U, hU, relations, filters, result⟩ - have bounds : ∀ i, (extend U (extend R env)) i ∈ M.sets := Fin.cases hU (Fin.cases hR members) - have eqR := (M.realize_groundRelationsFormula 1 P.succ.succ P.succ.succ _ bounds).1 relations - have eqU := (M.realize_groundMeetFiltersFormula 0 P.succ.succ r.succ.succ μ.succ.succ _ bounds meet).1 filters - have outputEq := (M.realize_literalTaskFieldSetFormula pairing unions powers separation - j output.succ.succ I.succ.succ P.succ.succ 1 0 Labels.succ.succ _ bounds).1 result - change R = M.groundRelations (env P) (env P) at eqR - change U = M.groundMeetFilters (env P) (env r) (env μ) at eqU - change env output = literalTaskFieldGraph (env I) (env P) R U (env Labels) j at outputEq - rwa [eqR, eqU] at outputEq - · intro equal - let R := M.groundRelations (env P) (env P) - let U := M.groundMeetFilters (env P) (env r) (env μ) - have hR : R ∈ M.sets := M.groundRelations_mem pairing unions powers separation (members P) (members P) - have hU : U ∈ M.sets := M.groundMeetFilters_mem powers separation (members P) (members r) (members μ) meet - have bounds : ∀ i, (extend U (extend R env)) i ∈ M.sets := Fin.cases hU (Fin.cases hR members) - exact ⟨R, hR, U, hU, - (M.realize_groundRelationsFormula 1 P.succ.succ P.succ.succ _ bounds).2 rfl, - (M.realize_groundMeetFiltersFormula 0 P.succ.succ r.succ.succ μ.succ.succ _ bounds meet).2 rfl, - (M.realize_literalTaskFieldSetFormula pairing unions powers separation - j output.succ.succ I.succ.succ P.succ.succ 1 0 Labels.succ.succ _ bounds).2 equal⟩ - -theorem realize_taskTransportSetFormula {n} (output G I P R U Labels A : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (taskTransportSetFormula output G I P R U Labels A) env ↔ - env output = taskTransportGraph (env G) (env I) (env P) (env R) (env U) (env Labels) (env A) := by - apply M.realize_exactSetFormula output _ env (members output) - (fun z hz => M.transitive (M.taskTransportGraph_mem pairing unions powers separation - (members G) (members I) (members P) (members R) (members U) (members Labels) (members A)) hz) - intro z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_taskTransportEntryFormula] - rw [taskTransportGraph, ZFSet.mem_sep] - refine ⟨fun entry => ⟨?_, entry⟩, And.right⟩ - obtain ⟨g, hg, t, ht, t', ht', equal, _⟩ := entry - change z = ZFSet.pair (ZFSet.pair g t) t' at equal - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, ht⟩, ht'⟩ - -theorem realize_groundTaskTransportFormula {n} (output P G r μ A Labels : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (groundTaskTransportFormula output P G r μ A Labels) env ↔ - env output = M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels) := by - simp only [groundTaskTransportFormula, realize_ex, Realize] - constructor - · rintro ⟨tasks, hTasks, R, hR, U, hU, eligible, relations, filters, result⟩ - have bounds : ∀ i, (extend U (extend R (extend tasks env))) i ∈ M.sets := - Fin.cases hU (Fin.cases hR (Fin.cases hTasks members)) - have eqI := (M.realize_groundEligibleTasksFormula pairing unions powers separation - 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ - A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 eligible - have eqR := (M.realize_groundRelationsFormula 1 P.succ.succ.succ P.succ.succ.succ _ bounds).1 relations - have eqU := (M.realize_groundMeetFiltersFormula 0 P.succ.succ.succ r.succ.succ.succ - μ.succ.succ.succ _ bounds meet).1 filters - have outputEq := (M.realize_taskTransportSetFormula pairing unions powers separation - output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ 1 0 - Labels.succ.succ.succ A.succ.succ.succ _ bounds).1 result - change tasks = M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) at eqI - change R = M.groundRelations (env P) (env P) at eqR - change U = M.groundMeetFilters (env P) (env r) (env μ) at eqU - change env output = taskTransportGraph (env G) tasks (env P) R U (env Labels) (env A) at outputEq - rw [eqI, eqR, eqU] at outputEq - exact outputEq - · intro equal - let tasks := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) - let R := M.groundRelations (env P) (env P) - let U := M.groundMeetFilters (env P) (env r) (env μ) - have hTasks : tasks ∈ M.sets := M.groundEligibleTasks_mem pairing unions powers separation - (members P) (members G) (members r) (members μ) (members A) (members Labels) meet - have hR : R ∈ M.sets := M.groundRelations_mem pairing unions powers separation (members P) (members P) - have hU : U ∈ M.sets := M.groundMeetFilters_mem powers separation (members P) (members r) (members μ) meet - have bounds : ∀ i, (extend U (extend R (extend tasks env))) i ∈ M.sets := - Fin.cases hU (Fin.cases hR (Fin.cases hTasks members)) - exact ⟨tasks, hTasks, R, hR, U, hU, - (M.realize_groundEligibleTasksFormula pairing unions powers separation - 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ - A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, - (M.realize_groundRelationsFormula 1 P.succ.succ.succ P.succ.succ.succ _ bounds).2 rfl, - (M.realize_groundMeetFiltersFormula 0 P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ _ bounds meet).2 rfl, - (M.realize_taskTransportSetFormula pairing unions powers separation - output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ 1 0 - Labels.succ.succ.succ A.succ.succ.succ _ bounds).2 equal⟩ - -end TransitiveGround - -def TaskRepresentativesCode (Reps I P G r A R U Labels : ZFSet.{u}) : Prop := - ZFSet.IsFunc I G Reps ∧ ∀ i g, ZFSet.pair i g ∈ Reps → - TaskRepresentative P r A R U Labels i g - -namespace BoundedFormula - -def taskRepresentativesFormula {n} (Reps I P G r A R U Labels : Fin n) : BoundedFormula n := - .conj (functionFormula I G Reps) - (.allMem I (.allMem G.succ (imp (pairMembershipFormula 1 0 Reps.succ.succ) - (taskRepresentativeFormula 1 0 P.succ.succ r.succ.succ A.succ.succ - R.succ.succ U.succ.succ Labels.succ.succ)))) - -theorem truth_taskRepresentativesFormula {n} (Reps I P G r A R U Labels : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (taskRepresentativesFormula Reps I P G r A R U Labels) env ↔ - TaskRepresentativesCode (env Reps) (env I) (env P) (env G) (env r) - (env A) (env R) (env U) (env Labels) := by - simp only [taskRepresentativesFormula, Truth, truth_functionFormula, - truth_imp, truth_pairMembershipFormula, truth_taskRepresentativeFormula] - change (_ ∧ ∀ i ∈ env I, ∀ g ∈ env G, ZFSet.pair i g ∈ env Reps → - TaskRepresentative (env P) (env r) (env A) (env R) (env U) (env Labels) i g) ↔ _ - constructor - · rintro ⟨function, valid⟩ - refine ⟨function, ?_⟩ - intro i g entry - obtain ⟨hi, hg⟩ := ZFSet.pair_mem_prod.1 (function.1 entry) - exact valid i hi g hg entry - · rintro ⟨function, valid⟩ - exact ⟨function, fun i _ g _ entry => valid i g entry⟩ - -end BoundedFormula - -namespace SetFormula - -def groundTaskRepresentativesFormula {n} (Reps P G r μ A Labels : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let field := prefixIndex n 3 - exBlock 3 (.conj (groundEligibleTasksFormula (field 0) (old P) (old G) - (old r) (old μ) (old A) (old Labels)) - (.conj (groundRelationsFormula (field 1) (old P) (old P)) - (.conj (groundMeetFiltersFormula (field 2) (old P) (old r) (old μ)) - (BoundedFormula.taskRepresentativesFormula (old Reps) (field 0) (old P) (old G) - (old r) (old A) (field 1) (field 2) (old Labels)).toFormula))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_groundTaskRepresentativesFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {n} (Reps P G r μ A Labels : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (groundTaskRepresentativesFormula Reps P G r μ A Labels) env ↔ - TaskRepresentativesCode (env Reps) - (M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels)) - (env P) (env G) (env r) (env A) (M.groundRelations (env P) (env P)) - (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) := by - rw [groundTaskRepresentativesFormula, realize_exBlock] - constructor - · rintro ⟨fields, fieldMembers, tasks, relations, filters, selected⟩ - have bounds := extendMany_members 3 fields env fieldMembers members - have tasksEq := (M.realize_groundEligibleTasksFormula pairing unions powers separation - (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) (suffixIndex n 3 r) - (suffixIndex n 3 μ) (suffixIndex n 3 A) (suffixIndex n 3 Labels) _ bounds - (by simpa only [extendMany_suffix] using meet)).1 tasks - have relationsEq := (M.realize_groundRelationsFormula (prefixIndex n 3 1) - (suffixIndex n 3 P) (suffixIndex n 3 P) _ bounds).1 relations - have filtersEq := (M.realize_groundMeetFiltersFormula (prefixIndex n 3 2) - (suffixIndex n 3 P) (suffixIndex n 3 r) (suffixIndex n 3 μ) _ bounds - (by simpa only [extendMany_suffix] using meet)).1 filters - have represented := (BoundedFormula.truth_taskRepresentativesFormula - (suffixIndex n 3 Reps) (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) - (suffixIndex n 3 r) (suffixIndex n 3 A) (prefixIndex n 3 1) (prefixIndex n 3 2) - (suffixIndex n 3 Labels) _).1 ((BoundedFormula.realize_toFormula M _ _ bounds).1 selected) - simp only [extendMany_prefix, extendMany_suffix] at tasksEq relationsEq filtersEq represented - rwa [tasksEq, relationsEq, filtersEq] at represented - · intro selected - let I := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) - let R := M.groundRelations (env P) (env P) - let U := M.groundMeetFilters (env P) (env r) (env μ) - let fields : Fin 3 → ZFSet.{u} := Fin.cases I (Fin.cases R (fun _ => U)) - have fieldMembers : ∀ j, fields j ∈ M.sets := - Fin.cases (M.groundEligibleTasks_mem pairing unions powers separation - (members P) (members G) (members r) (members μ) (members A) (members Labels) meet) - (Fin.cases (M.groundRelations_mem pairing unions powers separation (members P) (members P)) - (fun _ => M.groundMeetFilters_mem powers separation (members P) (members r) (members μ) meet)) - have bounds := extendMany_members 3 fields env fieldMembers members - refine ⟨fields, fieldMembers, ?_, ?_, ?_, ?_⟩ - · apply (M.realize_groundEligibleTasksFormula pairing unions powers separation - (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) (suffixIndex n 3 r) - (suffixIndex n 3 μ) (suffixIndex n 3 A) (suffixIndex n 3 Labels) _ bounds - (by simpa only [extendMany_suffix] using meet)).2 - simp only [extendMany_prefix, extendMany_suffix] - rfl - · apply (M.realize_groundRelationsFormula (prefixIndex n 3 1) - (suffixIndex n 3 P) (suffixIndex n 3 P) _ bounds).2 - simp only [extendMany_prefix, extendMany_suffix] - rfl - · apply (M.realize_groundMeetFiltersFormula (prefixIndex n 3 2) - (suffixIndex n 3 P) (suffixIndex n 3 r) (suffixIndex n 3 μ) _ bounds - (by simpa only [extendMany_suffix] using meet)).2 - simp only [extendMany_prefix, extendMany_suffix] - rfl - · apply (BoundedFormula.realize_toFormula M _ _ bounds).2 - apply (BoundedFormula.truth_taskRepresentativesFormula - (suffixIndex n 3 Reps) (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) - (suffixIndex n 3 r) (suffixIndex n 3 A) (prefixIndex n 3 1) (prefixIndex n 3 2) - (suffixIndex n 3 Labels) _).2 - simp only [extendMany_prefix, extendMany_suffix] - exact selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundEligibleTaskSetRecognition +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace SetFormula + +def groundRelationsFormula {n} (output P Q : Fin n) : SetFormula n := + exactSetFormula output (BoundedFormula.relationBetweenFormula P.succ Q.succ 0).toFormula + +def groundMeetFiltersFormula {n} (output P r μ : Fin n) : SetFormula n := + exactSetFormula output (BoundedFormula.meetFilterFormula P.succ r.succ μ.succ 0).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_groundRelationsFormula {n} (output P Q : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (groundRelationsFormula output P Q) env ↔ + env output = M.groundRelations (env P) (env Q) := by + apply M.realize_exactSetFormula output _ env (members output) + (fun z hz => ((M.mem_groundRelations _ _ z).1 hz).1) + intro z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_relationBetweenFormula, M.mem_groundRelations] + exact ⟨fun subset => ⟨hz, subset⟩, And.right⟩ + +theorem realize_groundMeetFiltersFormula {n} (output P r μ : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (groundMeetFiltersFormula output P r μ) env ↔ + env output = M.groundMeetFilters (env P) (env r) (env μ) := by + apply M.realize_exactSetFormula output _ env (members output) + (fun z hz => ((M.mem_groundMeetFilters _ _ _ z).1 hz).1) + intro z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_meetFilterFormula P.succ r.succ μ.succ 0 (extend z env) meet, M.mem_groundMeetFilters] + exact ⟨fun filter => ⟨hz, filter⟩, And.right⟩ + +end TransitiveGround + +namespace SetFormula + +def groundLiteralTaskFieldFormula {n} (j : Fin 6) (output I P r μ Labels : Fin n) : SetFormula n := + ex (ex (.conj (groundRelationsFormula 1 P.succ.succ P.succ.succ) + (.conj (groundMeetFiltersFormula 0 P.succ.succ r.succ.succ μ.succ.succ) + (literalTaskFieldSetFormula j output.succ.succ I.succ.succ P.succ.succ 1 0 Labels.succ.succ)))) + +def taskTransportSetFormula {n} (output G I P R U Labels A : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.taskTransportEntryFormula 0 G.succ I.succ P.succ R.succ U.succ Labels.succ A.succ).toFormula + +def groundTaskTransportFormula {n} (output P G r μ A Labels : Fin n) : SetFormula n := + let old (i : Fin n) := i.succ.succ.succ + ex (ex (ex (.conj (groundEligibleTasksFormula 2 (old P) (old G) (old r) (old μ) (old A) (old Labels)) + (.conj (groundRelationsFormula 1 (old P) (old P)) + (.conj (groundMeetFiltersFormula 0 (old P) (old r) (old μ)) + (taskTransportSetFormula (old output) (old G) 2 (old P) 1 0 (old Labels) (old A))))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_groundLiteralTaskFieldFormula {n} (j : Fin 6) (output I P r μ Labels : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (groundLiteralTaskFieldFormula j output I P r μ Labels) env ↔ + env output = literalTaskFieldGraph (env I) (env P) + (M.groundRelations (env P) (env P)) (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) j := by + simp only [groundLiteralTaskFieldFormula, realize_ex, Realize] + constructor + · rintro ⟨R, hR, U, hU, relations, filters, result⟩ + have bounds : ∀ i, (extend U (extend R env)) i ∈ M.sets := Fin.cases hU (Fin.cases hR members) + have eqR := (M.realize_groundRelationsFormula 1 P.succ.succ P.succ.succ _ bounds).1 relations + have eqU := (M.realize_groundMeetFiltersFormula 0 P.succ.succ r.succ.succ μ.succ.succ _ bounds meet).1 filters + have outputEq := (M.realize_literalTaskFieldSetFormula pairing unions powers separation + j output.succ.succ I.succ.succ P.succ.succ 1 0 Labels.succ.succ _ bounds).1 result + change R = M.groundRelations (env P) (env P) at eqR + change U = M.groundMeetFilters (env P) (env r) (env μ) at eqU + change env output = literalTaskFieldGraph (env I) (env P) R U (env Labels) j at outputEq + rwa [eqR, eqU] at outputEq + · intro equal + let R := M.groundRelations (env P) (env P) + let U := M.groundMeetFilters (env P) (env r) (env μ) + have hR : R ∈ M.sets := M.groundRelations_mem pairing unions powers separation (members P) (members P) + have hU : U ∈ M.sets := M.groundMeetFilters_mem powers separation (members P) (members r) (members μ) meet + have bounds : ∀ i, (extend U (extend R env)) i ∈ M.sets := Fin.cases hU (Fin.cases hR members) + exact ⟨R, hR, U, hU, + (M.realize_groundRelationsFormula 1 P.succ.succ P.succ.succ _ bounds).2 rfl, + (M.realize_groundMeetFiltersFormula 0 P.succ.succ r.succ.succ μ.succ.succ _ bounds meet).2 rfl, + (M.realize_literalTaskFieldSetFormula pairing unions powers separation + j output.succ.succ I.succ.succ P.succ.succ 1 0 Labels.succ.succ _ bounds).2 equal⟩ + +theorem realize_taskTransportSetFormula {n} (output G I P R U Labels A : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (taskTransportSetFormula output G I P R U Labels A) env ↔ + env output = taskTransportGraph (env G) (env I) (env P) (env R) (env U) (env Labels) (env A) := by + apply M.realize_exactSetFormula output _ env (members output) + (fun z hz => M.transitive (M.taskTransportGraph_mem pairing unions powers separation + (members G) (members I) (members P) (members R) (members U) (members Labels) (members A)) hz) + intro z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_taskTransportEntryFormula] + rw [taskTransportGraph, ZFSet.mem_sep] + refine ⟨fun entry => ⟨?_, entry⟩, And.right⟩ + obtain ⟨g, hg, t, ht, t', ht', equal, _⟩ := entry + change z = ZFSet.pair (ZFSet.pair g t) t' at equal + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, ht⟩, ht'⟩ + +theorem realize_groundTaskTransportFormula {n} (output P G r μ A Labels : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (groundTaskTransportFormula output P G r μ A Labels) env ↔ + env output = M.groundTaskTransport (env P) (env G) (env r) (env μ) (env A) (env Labels) := by + simp only [groundTaskTransportFormula, realize_ex, Realize] + constructor + · rintro ⟨tasks, hTasks, R, hR, U, hU, eligible, relations, filters, result⟩ + have bounds : ∀ i, (extend U (extend R (extend tasks env))) i ∈ M.sets := + Fin.cases hU (Fin.cases hR (Fin.cases hTasks members)) + have eqI := (M.realize_groundEligibleTasksFormula pairing unions powers separation + 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ + A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).1 eligible + have eqR := (M.realize_groundRelationsFormula 1 P.succ.succ.succ P.succ.succ.succ _ bounds).1 relations + have eqU := (M.realize_groundMeetFiltersFormula 0 P.succ.succ.succ r.succ.succ.succ + μ.succ.succ.succ _ bounds meet).1 filters + have outputEq := (M.realize_taskTransportSetFormula pairing unions powers separation + output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ 1 0 + Labels.succ.succ.succ A.succ.succ.succ _ bounds).1 result + change tasks = M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) at eqI + change R = M.groundRelations (env P) (env P) at eqR + change U = M.groundMeetFilters (env P) (env r) (env μ) at eqU + change env output = taskTransportGraph (env G) tasks (env P) R U (env Labels) (env A) at outputEq + rw [eqI, eqR, eqU] at outputEq + exact outputEq + · intro equal + let tasks := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) + let R := M.groundRelations (env P) (env P) + let U := M.groundMeetFilters (env P) (env r) (env μ) + have hTasks : tasks ∈ M.sets := M.groundEligibleTasks_mem pairing unions powers separation + (members P) (members G) (members r) (members μ) (members A) (members Labels) meet + have hR : R ∈ M.sets := M.groundRelations_mem pairing unions powers separation (members P) (members P) + have hU : U ∈ M.sets := M.groundMeetFilters_mem powers separation (members P) (members r) (members μ) meet + have bounds : ∀ i, (extend U (extend R (extend tasks env))) i ∈ M.sets := + Fin.cases hU (Fin.cases hR (Fin.cases hTasks members)) + exact ⟨tasks, hTasks, R, hR, U, hU, + (M.realize_groundEligibleTasksFormula pairing unions powers separation + 2 P.succ.succ.succ G.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ + A.succ.succ.succ Labels.succ.succ.succ _ bounds meet).2 rfl, + (M.realize_groundRelationsFormula 1 P.succ.succ.succ P.succ.succ.succ _ bounds).2 rfl, + (M.realize_groundMeetFiltersFormula 0 P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ _ bounds meet).2 rfl, + (M.realize_taskTransportSetFormula pairing unions powers separation + output.succ.succ.succ G.succ.succ.succ 2 P.succ.succ.succ 1 0 + Labels.succ.succ.succ A.succ.succ.succ _ bounds).2 equal⟩ + +end TransitiveGround + +def TaskRepresentativesCode (Reps I P G r A R U Labels : ZFSet.{u}) : Prop := + ZFSet.IsFunc I G Reps ∧ ∀ i g, ZFSet.pair i g ∈ Reps → + TaskRepresentative P r A R U Labels i g + +namespace BoundedFormula + +def taskRepresentativesFormula {n} (Reps I P G r A R U Labels : Fin n) : BoundedFormula n := + .conj (functionFormula I G Reps) + (.allMem I (.allMem G.succ (imp (pairMembershipFormula 1 0 Reps.succ.succ) + (taskRepresentativeFormula 1 0 P.succ.succ r.succ.succ A.succ.succ + R.succ.succ U.succ.succ Labels.succ.succ)))) + +theorem truth_taskRepresentativesFormula {n} (Reps I P G r A R U Labels : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (taskRepresentativesFormula Reps I P G r A R U Labels) env ↔ + TaskRepresentativesCode (env Reps) (env I) (env P) (env G) (env r) + (env A) (env R) (env U) (env Labels) := by + simp only [taskRepresentativesFormula, Truth, truth_functionFormula, + truth_imp, truth_pairMembershipFormula, truth_taskRepresentativeFormula] + change (_ ∧ ∀ i ∈ env I, ∀ g ∈ env G, ZFSet.pair i g ∈ env Reps → + TaskRepresentative (env P) (env r) (env A) (env R) (env U) (env Labels) i g) ↔ _ + constructor + · rintro ⟨function, valid⟩ + refine ⟨function, ?_⟩ + intro i g entry + obtain ⟨hi, hg⟩ := ZFSet.pair_mem_prod.1 (function.1 entry) + exact valid i hi g hg entry + · rintro ⟨function, valid⟩ + exact ⟨function, fun i _ g _ entry => valid i g entry⟩ + +end BoundedFormula + +namespace SetFormula + +def groundTaskRepresentativesFormula {n} (Reps P G r μ A Labels : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let field := prefixIndex n 3 + exBlock 3 (.conj (groundEligibleTasksFormula (field 0) (old P) (old G) + (old r) (old μ) (old A) (old Labels)) + (.conj (groundRelationsFormula (field 1) (old P) (old P)) + (.conj (groundMeetFiltersFormula (field 2) (old P) (old r) (old μ)) + (BoundedFormula.taskRepresentativesFormula (old Reps) (field 0) (old P) (old G) + (old r) (old A) (field 1) (field 2) (old Labels)).toFormula))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_groundTaskRepresentativesFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {n} (Reps P G r μ A Labels : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (groundTaskRepresentativesFormula Reps P G r μ A Labels) env ↔ + TaskRepresentativesCode (env Reps) + (M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels)) + (env P) (env G) (env r) (env A) (M.groundRelations (env P) (env P)) + (M.groundMeetFilters (env P) (env r) (env μ)) (env Labels) := by + rw [groundTaskRepresentativesFormula, realize_exBlock] + constructor + · rintro ⟨fields, fieldMembers, tasks, relations, filters, selected⟩ + have bounds := extendMany_members 3 fields env fieldMembers members + have tasksEq := (M.realize_groundEligibleTasksFormula pairing unions powers separation + (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) (suffixIndex n 3 r) + (suffixIndex n 3 μ) (suffixIndex n 3 A) (suffixIndex n 3 Labels) _ bounds + (by simpa only [extendMany_suffix] using meet)).1 tasks + have relationsEq := (M.realize_groundRelationsFormula (prefixIndex n 3 1) + (suffixIndex n 3 P) (suffixIndex n 3 P) _ bounds).1 relations + have filtersEq := (M.realize_groundMeetFiltersFormula (prefixIndex n 3 2) + (suffixIndex n 3 P) (suffixIndex n 3 r) (suffixIndex n 3 μ) _ bounds + (by simpa only [extendMany_suffix] using meet)).1 filters + have represented := (BoundedFormula.truth_taskRepresentativesFormula + (suffixIndex n 3 Reps) (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) + (suffixIndex n 3 r) (suffixIndex n 3 A) (prefixIndex n 3 1) (prefixIndex n 3 2) + (suffixIndex n 3 Labels) _).1 ((BoundedFormula.realize_toFormula M _ _ bounds).1 selected) + simp only [extendMany_prefix, extendMany_suffix] at tasksEq relationsEq filtersEq represented + rwa [tasksEq, relationsEq, filtersEq] at represented + · intro selected + let I := M.groundEligibleTasks (env P) (env G) (env r) (env μ) (env A) (env Labels) + let R := M.groundRelations (env P) (env P) + let U := M.groundMeetFilters (env P) (env r) (env μ) + let fields : Fin 3 → ZFSet.{u} := Fin.cases I (Fin.cases R (fun _ => U)) + have fieldMembers : ∀ j, fields j ∈ M.sets := + Fin.cases (M.groundEligibleTasks_mem pairing unions powers separation + (members P) (members G) (members r) (members μ) (members A) (members Labels) meet) + (Fin.cases (M.groundRelations_mem pairing unions powers separation (members P) (members P)) + (fun _ => M.groundMeetFilters_mem powers separation (members P) (members r) (members μ) meet)) + have bounds := extendMany_members 3 fields env fieldMembers members + refine ⟨fields, fieldMembers, ?_, ?_, ?_, ?_⟩ + · apply (M.realize_groundEligibleTasksFormula pairing unions powers separation + (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) (suffixIndex n 3 r) + (suffixIndex n 3 μ) (suffixIndex n 3 A) (suffixIndex n 3 Labels) _ bounds + (by simpa only [extendMany_suffix] using meet)).2 + simp only [extendMany_prefix, extendMany_suffix] + rfl + · apply (M.realize_groundRelationsFormula (prefixIndex n 3 1) + (suffixIndex n 3 P) (suffixIndex n 3 P) _ bounds).2 + simp only [extendMany_prefix, extendMany_suffix] + rfl + · apply (M.realize_groundMeetFiltersFormula (prefixIndex n 3 2) + (suffixIndex n 3 P) (suffixIndex n 3 r) (suffixIndex n 3 μ) _ bounds + (by simpa only [extendMany_suffix] using meet)).2 + simp only [extendMany_prefix, extendMany_suffix] + rfl + · apply (BoundedFormula.realize_toFormula M _ _ bounds).2 + apply (BoundedFormula.truth_taskRepresentativesFormula + (suffixIndex n 3 Reps) (prefixIndex n 3 0) (suffixIndex n 3 P) (suffixIndex n 3 G) + (suffixIndex n 3 r) (suffixIndex n 3 A) (prefixIndex n 3 1) (prefixIndex n 3 2) + (suffixIndex n 3 Labels) _).2 + simp only [extendMany_prefix, extendMany_suffix] + exact selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateHeightRanges.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateHeightRanges.lean index d028365effbb85b0ebce96a9d0f661b7bc51aabc..3ee739a28c0757d641c5fb3e726a81e3a15b152b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateHeightRanges.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateHeightRanges.lean @@ -1,204 +1,204 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTemplateIntervalFamilies - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing - -universe u - -namespace TemplateHeightFamilyInputs - -variable {P rP μP I Qs rs μs As Es Fs Ss Bs brs Hs : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (t : TemplateHeightFamilyInputs d Bs brs Hs) - -theorem heightImageCandidate_iff (i : {i : ZFSet.{u} // i ∈ I}) (R : ZFSet.{u}) : - heightImageCandidate Qs Bs Hs i.val R ↔ - R = relationImage (d.space i) (t.ranges.value i) (t.heights.value i) := by - constructor - · rintro ⟨Q, _, B, _, h, _, eQ, eB, eh, equal⟩ - have eqQ := d.spaces.unique eQ (d.space_entry i) - have eqB := t.ranges.unique eB (t.ranges.value_entry i) - have eqh := t.heights.unique eh (t.heights.value_entry i) - exact eqQ ▸ eqB ▸ eqh ▸ equal - · intro equal - exact ⟨d.space i, d.spaces.value_mem_doubleUnion i, - t.ranges.value i, t.ranges.value_mem_doubleUnion i, - t.heights.value i, t.heights.value_mem_doubleUnion i, - d.space_entry i, t.ranges.value_entry i, t.heights.value_entry i, equal⟩ - -end TemplateHeightFamilyInputs - -theorem heightOrderCandidate_iff {I Rs brs : ZFSet.{u}} - (ranges : FunctionGraphOn I Rs) (orders : FunctionGraphOn I brs) - (i : {i : ZFSet.{u} // i ∈ I}) (r : ZFSet.{u}) : - heightOrderCandidate Rs brs i.val r ↔ - r = heightOrderRestriction (ranges.value i) (orders.value i) := by - constructor - · rintro ⟨R, _, s, _, eR, es, equal⟩ - exact ranges.unique eR (ranges.value_entry i) ▸ orders.unique es (orders.value_entry i) ▸ equal - · intro equal - exact ⟨ranges.value i, ranges.value_mem_doubleUnion i, - orders.value i, orders.value_mem_doubleUnion i, - ranges.value_entry i, orders.value_entry i, equal⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem heightImageFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I W Qs Bs Hs : ZFSet.{u}} - (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hQs : Qs ∈ M.sets) - (hBs : Bs ∈ M.sets) (hHs : Hs ∈ M.sets) : heightImageFamily I W Qs Bs Hs ∈ M.sets := by - have qBound := M.union_mem unions (M.union_mem unions hQs) - have bBound := M.union_mem unions (M.union_mem unions hBs) - have hBound := M.union_mem unions (M.union_mem unions hHs) - let params := extend I (extend W (extend Qs (extend Bs (extend Hs - (extend (⋃₀ ⋃₀ Qs) (extend (⋃₀ ⋃₀ Bs) (extend (⋃₀ ⋃₀ Hs) Fin.elim0))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.heightImageFamilyEntryFormula 0 1 2 3 4 5 6 7 8) params - (Fin.cases hI (Fin.cases hW (Fin.cases hQs (Fin.cases hBs (Fin.cases hHs - (Fin.cases qBound (Fin.cases bBound (Fin.cases hBound (fun i => Fin.elim0 i))))))))) - (M.prod_mem pairing unions powers separation hI hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.heightImageFamilyEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) - (ZFSet.prod I W) = heightImageFamily I W Qs Bs Hs := by - apply ZFSet.ext - intro z - rw [heightImageFamily, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_heightImageFamilyEntryFormula 0 1 2 3 4 5 6 7 8 _ rfl rfl rfl) - exact equal ▸ selected - -theorem heightOrderFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I W Rs brs : ZFSet.{u}} - (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hRs : Rs ∈ M.sets) (hbrs : brs ∈ M.sets) : - heightOrderFamily I W Rs brs ∈ M.sets := by - have rBound := M.union_mem unions (M.union_mem unions hRs) - have sBound := M.union_mem unions (M.union_mem unions hbrs) - let params := extend I (extend W (extend Rs (extend brs - (extend (⋃₀ ⋃₀ Rs) (extend (⋃₀ ⋃₀ brs) Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.heightOrderFamilyEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hI (Fin.cases hW (Fin.cases hRs (Fin.cases hbrs - (Fin.cases rBound (Fin.cases sBound (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hI hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.heightOrderFamilyEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod I W) = heightOrderFamily I W Rs brs := by - apply ZFSet.ext - intro z - rw [heightOrderFamily, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_heightOrderFamilyEntryFormula 0 1 2 3 4 5 6 _ rfl rfl) - exact equal ▸ selected - -theorem exists_templateHeightRanges - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P rP μP I Qs rs μs As Es Fs Ss Bs brs Hs : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (t₀ : TemplateHeightFamilyInputs d Bs brs Hs) - (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hBs : Bs ∈ M.sets) - (hbrs : brs ∈ M.sets) (hHs : Hs ∈ M.sets) : - ∃ Rs ∈ M.sets, ∃ ors ∈ M.sets, ∃ t : TemplateHeightFamilyInputs d Rs ors Hs, - (∀ i, t.ranges.value i = relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i)) ∧ - (∀ i, t.orders.value i = heightOrderRestriction (t.ranges.value i) (t₀.orders.value i)) := by - let B := familyPointBound Bs - have hB : B ∈ M.sets := M.familyPointBound_mem unions hBs - let W := M.groundPower B - have hW : W ∈ M.sets := M.groundPower_mem powers hB - let Rs := heightImageFamily I W Qs Bs Hs - have hRs : Rs ∈ M.sets := M.heightImageFamily_mem pairing unions powers separation hI hW hQs hBs hHs - have imageGround (i : {i : ZFSet.{u} // i ∈ I}) : - relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i) ∈ M.sets := - M.relationImage_mem separation (d.spaces.value_mem M hQs i) - (t₀.ranges.value_mem M hBs i) (t₀.heights.value_mem M hHs i) - have imageBound (i : {i : ZFSet.{u} // i ∈ I}) : - relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i) ⊆ B := by - intro a ha - exact mem_familyPointBound_of_entry (t₀.ranges.value_entry i) ((mem_relationImage _ _ _ a).1 ha).1 - have rangesFunction : ZFSet.IsFunc I W Rs := by - refine ⟨fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩ - intro i hi - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - let R := relationImage (d.space j) (t₀.ranges.value j) (t₀.heights.value j) - have hR : R ∈ W := (M.mem_groundPower B R).2 ⟨imageGround j, imageBound j⟩ - exact ⟨R, (pair_mem_heightImageFamily I W Qs Bs Hs i R).2 - ⟨hi, hR, (t₀.heightImageCandidate_iff j R).2 rfl⟩, - fun R' entry => (t₀.heightImageCandidate_iff j R').1 - ((pair_mem_heightImageFamily I W Qs Bs Hs i R').1 entry).2.2⟩ - let ranges : FunctionGraphOn I Rs := ⟨W, rangesFunction⟩ - have rangesEqual (i : {i : ZFSet.{u} // i ∈ I}) : - ranges.value i = relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i) := - (t₀.heightImageCandidate_iff i _).1 - ((pair_mem_heightImageFamily I W Qs Bs Hs i.val _).1 (ranges.value_entry i)).2.2 - have rangesBound (i : {i : ZFSet.{u} // i ∈ I}) : ranges.value i ⊆ B := - rangesEqual i ▸ imageBound i - let U := M.groundRelations B B - have hU : U ∈ M.sets := M.groundRelations_mem pairing unions powers separation hB hB - let ors := heightOrderFamily I U Rs brs - have hors : ors ∈ M.sets := M.heightOrderFamily_mem pairing unions powers separation hI hU hRs hbrs - have ordersFunction : ZFSet.IsFunc I U ors := by - refine ⟨fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩ - intro i hi - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - let r := heightOrderRestriction (ranges.value j) (t₀.orders.value j) - have hr : r ∈ M.sets := M.injection_restriction_mem separation - (ranges.value_mem M hRs j) (ranges.value_mem M hRs j) (t₀.orders.value_mem M hbrs j) - have bound : r ⊆ ZFSet.prod B B := by - intro z hz - obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).2 - exact ZFSet.pair_mem_prod.2 ⟨rangesBound j ha, rangesBound j hb⟩ - exact ⟨r, (pair_mem_heightOrderFamily I U Rs brs i r).2 - ⟨hi, (M.mem_groundRelations B B r).2 ⟨hr, bound⟩, - (heightOrderCandidate_iff ranges t₀.orders j r).2 rfl⟩, - fun s entry => (heightOrderCandidate_iff ranges t₀.orders j s).1 - ((pair_mem_heightOrderFamily I U Rs brs i s).1 entry).2.2⟩ - let orders : FunctionGraphOn I ors := ⟨U, ordersFunction⟩ - have ordersEqual (i : {i : ZFSet.{u} // i ∈ I}) : - orders.value i = heightOrderRestriction (ranges.value i) (t₀.orders.value i) := - (heightOrderCandidate_iff ranges t₀.orders i _).1 - ((pair_mem_heightOrderFamily I U Rs brs i.val _).1 (orders.value_entry i)).2.2 - have functions (i : {i : ZFSet.{u} // i ∈ I}) : - ZFSet.IsFunc (d.space i) (ranges.value i) (t₀.heights.value i) := by - rw [rangesEqual i] - exact function_on_relationImage (t₀.function i) - let t : TemplateHeightFamilyInputs d Rs ors Hs := - { ranges := ranges - orders := orders - heights := t₀.heights - linear := fun i => by - rw [ordersEqual i] - apply heightOrderRestriction_linear (t₀.linear i) - intro a ha - rw [rangesEqual i] at ha - exact ((mem_relationImage _ _ _ a).1 ha).1 - function := functions - strict := fun i x y a b below different first second => by - rw [ordersEqual i] - exact (pair_mem_heightOrderRestriction _ _ a b).2 - ⟨t₀.strict i x y a b below different first second, - (ZFSet.pair_mem_prod.1 ((functions i).1 first)).2, - (ZFSet.pair_mem_prod.1 ((functions i).1 second)).2⟩ } - exact ⟨Rs, hRs, ors, hors, t, rangesEqual, ordersEqual⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTemplateIntervalFamilies + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing + +universe u + +namespace TemplateHeightFamilyInputs + +variable {P rP μP I Qs rs μs As Es Fs Ss Bs brs Hs : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (t : TemplateHeightFamilyInputs d Bs brs Hs) + +theorem heightImageCandidate_iff (i : {i : ZFSet.{u} // i ∈ I}) (R : ZFSet.{u}) : + heightImageCandidate Qs Bs Hs i.val R ↔ + R = relationImage (d.space i) (t.ranges.value i) (t.heights.value i) := by + constructor + · rintro ⟨Q, _, B, _, h, _, eQ, eB, eh, equal⟩ + have eqQ := d.spaces.unique eQ (d.space_entry i) + have eqB := t.ranges.unique eB (t.ranges.value_entry i) + have eqh := t.heights.unique eh (t.heights.value_entry i) + exact eqQ ▸ eqB ▸ eqh ▸ equal + · intro equal + exact ⟨d.space i, d.spaces.value_mem_doubleUnion i, + t.ranges.value i, t.ranges.value_mem_doubleUnion i, + t.heights.value i, t.heights.value_mem_doubleUnion i, + d.space_entry i, t.ranges.value_entry i, t.heights.value_entry i, equal⟩ + +end TemplateHeightFamilyInputs + +theorem heightOrderCandidate_iff {I Rs brs : ZFSet.{u}} + (ranges : FunctionGraphOn I Rs) (orders : FunctionGraphOn I brs) + (i : {i : ZFSet.{u} // i ∈ I}) (r : ZFSet.{u}) : + heightOrderCandidate Rs brs i.val r ↔ + r = heightOrderRestriction (ranges.value i) (orders.value i) := by + constructor + · rintro ⟨R, _, s, _, eR, es, equal⟩ + exact ranges.unique eR (ranges.value_entry i) ▸ orders.unique es (orders.value_entry i) ▸ equal + · intro equal + exact ⟨ranges.value i, ranges.value_mem_doubleUnion i, + orders.value i, orders.value_mem_doubleUnion i, + ranges.value_entry i, orders.value_entry i, equal⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem heightImageFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I W Qs Bs Hs : ZFSet.{u}} + (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hQs : Qs ∈ M.sets) + (hBs : Bs ∈ M.sets) (hHs : Hs ∈ M.sets) : heightImageFamily I W Qs Bs Hs ∈ M.sets := by + have qBound := M.union_mem unions (M.union_mem unions hQs) + have bBound := M.union_mem unions (M.union_mem unions hBs) + have hBound := M.union_mem unions (M.union_mem unions hHs) + let params := extend I (extend W (extend Qs (extend Bs (extend Hs + (extend (⋃₀ ⋃₀ Qs) (extend (⋃₀ ⋃₀ Bs) (extend (⋃₀ ⋃₀ Hs) Fin.elim0))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.heightImageFamilyEntryFormula 0 1 2 3 4 5 6 7 8) params + (Fin.cases hI (Fin.cases hW (Fin.cases hQs (Fin.cases hBs (Fin.cases hHs + (Fin.cases qBound (Fin.cases bBound (Fin.cases hBound (fun i => Fin.elim0 i))))))))) + (M.prod_mem pairing unions powers separation hI hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.heightImageFamilyEntryFormula 0 1 2 3 4 5 6 7 8) (extend z params)) + (ZFSet.prod I W) = heightImageFamily I W Qs Bs Hs := by + apply ZFSet.ext + intro z + rw [heightImageFamily, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_heightImageFamilyEntryFormula 0 1 2 3 4 5 6 7 8 _ rfl rfl rfl) + exact equal ▸ selected + +theorem heightOrderFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I W Rs brs : ZFSet.{u}} + (hI : I ∈ M.sets) (hW : W ∈ M.sets) (hRs : Rs ∈ M.sets) (hbrs : brs ∈ M.sets) : + heightOrderFamily I W Rs brs ∈ M.sets := by + have rBound := M.union_mem unions (M.union_mem unions hRs) + have sBound := M.union_mem unions (M.union_mem unions hbrs) + let params := extend I (extend W (extend Rs (extend brs + (extend (⋃₀ ⋃₀ Rs) (extend (⋃₀ ⋃₀ brs) Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.heightOrderFamilyEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hI (Fin.cases hW (Fin.cases hRs (Fin.cases hbrs + (Fin.cases rBound (Fin.cases sBound (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hI hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.heightOrderFamilyEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod I W) = heightOrderFamily I W Rs brs := by + apply ZFSet.ext + intro z + rw [heightOrderFamily, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_heightOrderFamilyEntryFormula 0 1 2 3 4 5 6 _ rfl rfl) + exact equal ▸ selected + +theorem exists_templateHeightRanges + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P rP μP I Qs rs μs As Es Fs Ss Bs brs Hs : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (t₀ : TemplateHeightFamilyInputs d Bs brs Hs) + (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) (hBs : Bs ∈ M.sets) + (hbrs : brs ∈ M.sets) (hHs : Hs ∈ M.sets) : + ∃ Rs ∈ M.sets, ∃ ors ∈ M.sets, ∃ t : TemplateHeightFamilyInputs d Rs ors Hs, + (∀ i, t.ranges.value i = relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i)) ∧ + (∀ i, t.orders.value i = heightOrderRestriction (t.ranges.value i) (t₀.orders.value i)) := by + let B := familyPointBound Bs + have hB : B ∈ M.sets := M.familyPointBound_mem unions hBs + let W := M.groundPower B + have hW : W ∈ M.sets := M.groundPower_mem powers hB + let Rs := heightImageFamily I W Qs Bs Hs + have hRs : Rs ∈ M.sets := M.heightImageFamily_mem pairing unions powers separation hI hW hQs hBs hHs + have imageGround (i : {i : ZFSet.{u} // i ∈ I}) : + relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i) ∈ M.sets := + M.relationImage_mem separation (d.spaces.value_mem M hQs i) + (t₀.ranges.value_mem M hBs i) (t₀.heights.value_mem M hHs i) + have imageBound (i : {i : ZFSet.{u} // i ∈ I}) : + relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i) ⊆ B := by + intro a ha + exact mem_familyPointBound_of_entry (t₀.ranges.value_entry i) ((mem_relationImage _ _ _ a).1 ha).1 + have rangesFunction : ZFSet.IsFunc I W Rs := by + refine ⟨fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩ + intro i hi + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + let R := relationImage (d.space j) (t₀.ranges.value j) (t₀.heights.value j) + have hR : R ∈ W := (M.mem_groundPower B R).2 ⟨imageGround j, imageBound j⟩ + exact ⟨R, (pair_mem_heightImageFamily I W Qs Bs Hs i R).2 + ⟨hi, hR, (t₀.heightImageCandidate_iff j R).2 rfl⟩, + fun R' entry => (t₀.heightImageCandidate_iff j R').1 + ((pair_mem_heightImageFamily I W Qs Bs Hs i R').1 entry).2.2⟩ + let ranges : FunctionGraphOn I Rs := ⟨W, rangesFunction⟩ + have rangesEqual (i : {i : ZFSet.{u} // i ∈ I}) : + ranges.value i = relationImage (d.space i) (t₀.ranges.value i) (t₀.heights.value i) := + (t₀.heightImageCandidate_iff i _).1 + ((pair_mem_heightImageFamily I W Qs Bs Hs i.val _).1 (ranges.value_entry i)).2.2 + have rangesBound (i : {i : ZFSet.{u} // i ∈ I}) : ranges.value i ⊆ B := + rangesEqual i ▸ imageBound i + let U := M.groundRelations B B + have hU : U ∈ M.sets := M.groundRelations_mem pairing unions powers separation hB hB + let ors := heightOrderFamily I U Rs brs + have hors : ors ∈ M.sets := M.heightOrderFamily_mem pairing unions powers separation hI hU hRs hbrs + have ordersFunction : ZFSet.IsFunc I U ors := by + refine ⟨fun _ h => (ZFSet.mem_sep.1 h).1, ?_⟩ + intro i hi + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + let r := heightOrderRestriction (ranges.value j) (t₀.orders.value j) + have hr : r ∈ M.sets := M.injection_restriction_mem separation + (ranges.value_mem M hRs j) (ranges.value_mem M hRs j) (t₀.orders.value_mem M hbrs j) + have bound : r ⊆ ZFSet.prod B B := by + intro z hz + obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).2 + exact ZFSet.pair_mem_prod.2 ⟨rangesBound j ha, rangesBound j hb⟩ + exact ⟨r, (pair_mem_heightOrderFamily I U Rs brs i r).2 + ⟨hi, (M.mem_groundRelations B B r).2 ⟨hr, bound⟩, + (heightOrderCandidate_iff ranges t₀.orders j r).2 rfl⟩, + fun s entry => (heightOrderCandidate_iff ranges t₀.orders j s).1 + ((pair_mem_heightOrderFamily I U Rs brs i s).1 entry).2.2⟩ + let orders : FunctionGraphOn I ors := ⟨U, ordersFunction⟩ + have ordersEqual (i : {i : ZFSet.{u} // i ∈ I}) : + orders.value i = heightOrderRestriction (ranges.value i) (t₀.orders.value i) := + (heightOrderCandidate_iff ranges t₀.orders i _).1 + ((pair_mem_heightOrderFamily I U Rs brs i.val _).1 (orders.value_entry i)).2.2 + have functions (i : {i : ZFSet.{u} // i ∈ I}) : + ZFSet.IsFunc (d.space i) (ranges.value i) (t₀.heights.value i) := by + rw [rangesEqual i] + exact function_on_relationImage (t₀.function i) + let t : TemplateHeightFamilyInputs d Rs ors Hs := + { ranges := ranges + orders := orders + heights := t₀.heights + linear := fun i => by + rw [ordersEqual i] + apply heightOrderRestriction_linear (t₀.linear i) + intro a ha + rw [rangesEqual i] at ha + exact ((mem_relationImage _ _ _ a).1 ha).1 + function := functions + strict := fun i x y a b below different first second => by + rw [ordersEqual i] + exact (pair_mem_heightOrderRestriction _ _ a b).2 + ⟨t₀.strict i x y a b below different first second, + (ZFSet.pair_mem_prod.1 ((functions i).1 first)).2, + (ZFSet.pair_mem_prod.1 ((functions i).1 second)).2⟩ } + exact ⟨Rs, hRs, ors, hors, t, rangesEqual, ordersEqual⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateIntervalFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateIntervalFamilies.lean index 36128bd1af0cf6bb19b41acf82f6a0c176a9c98d..321bc946720f844ea03db327716798b9b877633b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateIntervalFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTemplateIntervalFamilies.lean @@ -1,635 +1,635 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIntervalEmbeddingRelation -import OAI.SetTheory.PartitionPrinciple.Geometry.TemplateHeightRangeCodes - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -universe u - -namespace BoundedFormula - -open SetFormula - -def indexedAttachmentDomainEntryFormula {n} (z i qs bound : Fin n) : BoundedFormula n := - exMem i (exMem bound.succ (exMem 0 - (.conj (pairMembershipFormula 2 1 qs.succ.succ.succ) - (orderedPairFormula z.succ.succ.succ 2 0)))) - -theorem truth_indexedAttachmentDomainEntryFormula {n} (z i qs bound : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (indexedAttachmentDomainEntryFormula z i qs bound) env ↔ - ∃ j ∈ env i, ∃ Q ∈ env bound, ∃ q ∈ Q, - ZFSet.pair j Q ∈ env qs ∧ env z = ZFSet.pair j q := by - simp only [indexedAttachmentDomainEntryFormula, truth_exMem, Truth, - truth_pairMembershipFormula, truth_orderedPairFormula] - rfl - -def indexedAttachmentFreshEntryFormula {n} - (z i qs rs anchors qBound rBound aBound : Fin n) : BoundedFormula n := - exMem i (exMem qBound.succ (exMem rBound.succ.succ - (exMem aBound.succ.succ.succ (exMem 2 - (.conj (pairMembershipFormula 4 3 qs.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 4 2 rs.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 4 1 anchors.succ.succ.succ.succ.succ) - (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 0) - (.neg (pairMembershipFormula 0 1 2)))))))))) - -theorem truth_indexedAttachmentFreshEntryFormula {n} - (z i qs rs anchors qBound rBound aBound : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (indexedAttachmentFreshEntryFormula z i qs rs anchors qBound rBound aBound) env ↔ - ∃ j ∈ env i, ∃ Q ∈ env qBound, ∃ r ∈ env rBound, ∃ a ∈ env aBound, ∃ q ∈ Q, - ZFSet.pair j Q ∈ env qs ∧ ZFSet.pair j r ∈ env rs ∧ ZFSet.pair j a ∈ env anchors ∧ - env z = ZFSet.pair j q ∧ ZFSet.pair q a ∉ r := by - simp only [indexedAttachmentFreshEntryFormula, truth_exMem, Truth, - truth_pairMembershipFormula, truth_orderedPairFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem familyPointBound_mem (unions : Realize M.sets SetFormula.union Fin.elim0) - {Qs : ZFSet.{u}} (hQs : Qs ∈ M.sets) : familyPointBound Qs ∈ M.sets := - M.union_mem unions (M.union_mem unions (M.union_mem unions hQs)) - -theorem indexedAttachmentDomain_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I Qs : ZFSet.{u}} (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) : - indexedAttachmentDomain I Qs ∈ M.sets := by - have bound := M.union_mem unions (M.union_mem unions hQs) - let params := extend I (extend Qs (extend (ZFSet.sUnion (ZFSet.sUnion Qs)) Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedAttachmentDomainEntryFormula 0 1 2 3) params - (Fin.cases hI (Fin.cases hQs (Fin.cases bound (fun j => Fin.elim0 j)))) - (M.prod_mem pairing unions powers separation hI (M.familyPointBound_mem unions hQs)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedAttachmentDomainEntryFormula 0 1 2 3) (extend z params)) - (ZFSet.prod I (familyPointBound Qs)) = indexedAttachmentDomain I Qs := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedAttachmentDomain, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_indexedAttachmentDomainEntryFormula 0 1 2 3 _) - exact equal ▸ selected - -theorem indexedAttachmentFresh_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I Qs rs anchors : ZFSet.{u}} (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) - (hrs : rs ∈ M.sets) (hAnchors : anchors ∈ M.sets) : - indexedAttachmentFresh I Qs rs anchors ∈ M.sets := by - have qBound := M.union_mem unions (M.union_mem unions hQs) - have rBound := M.union_mem unions (M.union_mem unions hrs) - have aBound := M.union_mem unions (M.union_mem unions hAnchors) - let params := extend I (extend Qs (extend rs (extend anchors - (extend (ZFSet.sUnion (ZFSet.sUnion Qs)) (extend (ZFSet.sUnion (ZFSet.sUnion rs)) - (extend (ZFSet.sUnion (ZFSet.sUnion anchors)) Fin.elim0)))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.indexedAttachmentFreshEntryFormula 0 1 2 3 4 5 6 7) params - (Fin.cases hI (Fin.cases hQs (Fin.cases hrs (Fin.cases hAnchors - (Fin.cases qBound (Fin.cases rBound (Fin.cases aBound (fun j => Fin.elim0 j)))))))) - (M.indexedAttachmentDomain_mem pairing unions powers separation hI hQs) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.indexedAttachmentFreshEntryFormula 0 1 2 3 4 5 6 7) (extend z params)) - (indexedAttachmentDomain I Qs) = indexedAttachmentFresh I Qs rs anchors := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedAttachmentFresh, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_indexedAttachmentFreshEntryFormula 0 1 2 3 4 5 6 7 _) - exact equal ▸ selected - -end TransitiveGround - - - - - - -noncomputable def batchHeightEndpointRelation - (I P C D As Es Ss oldH rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => - ∃ i ∈ I, ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion As), - ∃ ell ∈ ZFSet.sUnion (ZFSet.sUnion Es), ∃ b ∈ P, ∃ e ∈ P, - ∃ c ∈ C, ∃ lo ∈ D, ∃ hi ∈ D, ∃ d ∈ C, ∃ v ∈ D, - z = ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∧ - ZFSet.pair i a ∈ As ∧ ZFSet.pair i ell ∈ Es ∧ ZFSet.pair a b ∈ ell ∧ - ZFSet.pair i e ∈ Ss ∧ ZFSet.pair b (ZFSet.pair c lo) ∈ oldH ∧ - ZFSet.pair e (ZFSet.pair d v) ∈ oldH ∧ ZFSet.pair lo hi ∈ rD ∧ - ((c = d ∧ hi = v) ∨ c ∈ d)) - (ZFSet.prod I (ZFSet.prod C (ZFSet.prod D D))) - -theorem pair_mem_batchHeightEndpointRelation - (I P C D As Es Ss oldH rD i c lo hi : ZFSet.{u}) : - ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∈ - batchHeightEndpointRelation I P C D As Es Ss oldH rD ↔ - i ∈ I ∧ c ∈ C ∧ lo ∈ D ∧ hi ∈ D ∧ - ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion As), ∃ ell ∈ ZFSet.sUnion (ZFSet.sUnion Es), - ∃ b ∈ P, ∃ e ∈ P, ∃ d ∈ C, ∃ v ∈ D, - ZFSet.pair i a ∈ As ∧ ZFSet.pair i ell ∈ Es ∧ ZFSet.pair a b ∈ ell ∧ - ZFSet.pair i e ∈ Ss ∧ ZFSet.pair b (ZFSet.pair c lo) ∈ oldH ∧ - ZFSet.pair e (ZFSet.pair d v) ∈ oldH ∧ ZFSet.pair lo hi ∈ rD ∧ - ((c = d ∧ hi = v) ∨ c ∈ d) := by - rw [batchHeightEndpointRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, j, hj, a, ha, ell, hell, b, hb, e, he, - c', hc, lo', hlo, hi', hhi, d, hd, v, hv, equal, rest⟩ - obtain ⟨ij, restEq⟩ := ZFSet.pair_inj.1 equal - obtain ⟨cc, restEq'⟩ := ZFSet.pair_inj.1 restEq - obtain ⟨ll, hh⟩ := ZFSet.pair_inj.1 restEq' - subst j - subst c' - subst lo' - subst hi' - exact ⟨hj, hc, hlo, hhi, a, ha, ell, hell, b, hb, e, he, d, hd, v, hv, rest⟩ - · rintro ⟨hiI, hc, hlo, hhi, a, ha, ell, hell, b, hb, e, he, d, hd, v, hv, rest⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hiI, ZFSet.pair_mem_prod.2 - ⟨hc, ZFSet.pair_mem_prod.2 ⟨hlo, hhi⟩⟩⟩, - i, hiI, a, ha, ell, hell, b, hb, e, he, c, hc, lo, hlo, hi, hhi, d, hd, v, hv, rfl, rest⟩ - -structure BatchHeightEndpointCode - {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (C D oldH rD Cs los his : ZFSet.{u}) : Prop where - columns : ZFSet.IsFunc I C Cs - lows : ZFSet.IsFunc I D los - highs : ZFSet.IsFunc I D his - base : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ c lo, - ZFSet.pair i.val c ∈ Cs → ZFSet.pair i.val lo ∈ los → - ZFSet.pair (d.templates.base i).val (ZFSet.pair c lo) ∈ oldH - gap : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ lo hi, - ZFSet.pair i.val lo ∈ los → ZFSet.pair i.val hi ∈ his → ZFSet.pair lo hi ∈ rD - upper : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ c hi c' v, - ZFSet.pair i.val c ∈ Cs → ZFSet.pair i.val hi ∈ his → - ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH → - (c = c' ∧ hi = v) ∨ c ∈ c' - -namespace AttachmentBatchInputs - -variable {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - -theorem endpoint_base_entry (i : {i : ZFSet.{u} // i ∈ I}) : - ZFSet.pair (d.anchor i) (d.templates.base i).val ∈ d.embed i := - (d.fiber i).baseMap_entry _ - -include d in -theorem batchHeightEndpointRelation_total - (old : StrictLexHeightCode P C D rP oldH rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) : - ∀ i ∈ I, ∃ t ∈ ZFSet.prod C (ZFSet.prod D D), - ZFSet.pair i t ∈ batchHeightEndpointRelation I P C D As Es Ss oldH rD := by - intro i hi - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - obtain ⟨baseHeight, baseEntry, _⟩ := old.function.2 (d.templates.base j).val (d.templates.base j).property - obtain ⟨c, hc, lo, hlo, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (old.function.1 baseEntry)).2 - obtain ⟨sepHeight, sepEntry, _⟩ := old.function.2 (d.separator j) (d.fiber j).separator_mem - obtain ⟨c', hc', v, hv, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (old.function.1 sepEntry)).2 - have different : (d.templates.base j).val ≠ d.separator j := by - intro equal - have bad := (d.fiber j).separator_not_le_base _ (d.endpoint_base_entry j) - rw [equal] at bad - exact bad (d.oldOrder.order.refl _ (d.fiber j).separator_mem) - have strict := old.strict _ (d.templates.base j).property _ (d.fiber j).separator_mem - c lo c' v ((d.fiber j).base_le_separator _ (d.endpoint_base_entry j)) different baseEntry sepEntry - have construct (upper : ZFSet.{u}) (hupper : upper ∈ D) (gap : ZFSet.pair lo upper ∈ rD) - (rule : (c = c' ∧ upper = v) ∨ c ∈ c') : - ∃ t ∈ ZFSet.prod C (ZFSet.prod D D), - ZFSet.pair i t ∈ batchHeightEndpointRelation I P C D As Es Ss oldH rD := by - refine ⟨ZFSet.pair c (ZFSet.pair lo upper), - ZFSet.pair_mem_prod.2 ⟨hc, ZFSet.pair_mem_prod.2 ⟨hlo, hupper⟩⟩, - (pair_mem_batchHeightEndpointRelation _ _ _ _ _ _ _ _ _ _ _ _ _).2 ?_⟩ - exact ⟨hi, hc, hlo, hupper, d.anchor j, d.anchors.value_mem_doubleUnion j, - d.embed j, d.embeddings.value_mem_doubleUnion j, (d.templates.base j).val, - (d.templates.base j).property, d.separator j, (d.fiber j).separator_mem, c', hc', v, hv, - d.anchor_entry j, d.embed_entry j, d.endpoint_base_entry j, d.separator_entry j, - baseEntry, sepEntry, gap, rule⟩ - rcases strict with smaller | ⟨same, gap⟩ - · obtain ⟨upper, hupper, gap⟩ := above lo hlo - exact construct upper hupper gap (Or.inr smaller) - · exact construct v hv gap (Or.inl ⟨same, rfl⟩) - -theorem batchHeightEndpointRelation_laws - (old : StrictLexHeightCode P C D rP oldH rD) - (i : {i : ZFSet.{u} // i ∈ I}) {c lo hi : ZFSet.{u}} - (entry : ZFSet.pair i.val (ZFSet.pair c (ZFSet.pair lo hi)) ∈ - batchHeightEndpointRelation I P C D As Es Ss oldH rD) : - ZFSet.pair (d.templates.base i).val (ZFSet.pair c lo) ∈ oldH ∧ - ZFSet.pair lo hi ∈ rD ∧ ∀ c' v, - ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH → - (c = c' ∧ hi = v) ∨ c ∈ c' := by - obtain ⟨_, _, _, _, a, _, ell, _, b, _, e, _, c', _, v, _, - ia, iell, ab, ie, bH, eH, gap, rule⟩ := - (pair_mem_batchHeightEndpointRelation _ _ _ _ _ _ _ _ _ _ _ _ _).1 entry - have aeq := d.anchors.value_eq_of_entry i ia - have elleq := d.embeddings.value_eq_of_entry i iell - have eeq := d.separators.value_eq_of_entry i ie - change d.anchor i = a at aeq - change d.embed i = ell at elleq - change d.separator i = e at eeq - subst a - subst ell - subst e - have beq := (functionCode_partial (d.fiber i).base_function).unique _ _ _ ab (d.endpoint_base_entry i) - subst b - refine ⟨bH, gap, ?_⟩ - intro c'' v' entry' - have equal := (functionCode_partial old.function).unique _ _ _ eH entry' - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact rule - -end AttachmentBatchInputs - -namespace BatchHeightEndpointCode - -theorem interval_upper - {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD Cs los his : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (endpoints : BatchHeightEndpointCode d C D oldH rD Cs los his) - (i : {i : ZFSet.{u} // i ∈ I}) {c hi q c' v : ZFSet.{u}} - (column : ZFSet.pair i.val c ∈ Cs) (upper : ZFSet.pair i.val hi ∈ his) - (below : ZFSet.pair q hi ∈ rD) - (separator : ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH) : - c ∈ c' ∨ (c = c' ∧ ZFSet.pair q v ∈ rD) := by - rcases endpoints.upper i c hi c' v column upper separator with ⟨same, rfl⟩ | smaller - · exact Or.inr ⟨same, below⟩ - · exact Or.inl smaller - -end BatchHeightEndpointCode - -end - - - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_intervalEmbedding_family - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I As rs los his D rD c : ZFSet.{u}} - (d : IntervalEmbeddingFamilyInputs I As rs los his D rD) - (hI : I ∈ M.sets) (hAs : As ∈ M.sets) (hrs : rs ∈ M.sets) - (hlos : los ∈ M.sets) (hhis : his ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) - (small : ∀ i, M.groundEmbeddable (d.sources.value i) ZFSet.omega) : - ∃ family ∈ M.sets, - ZFSet.IsFunc I (M.groundRelations (familyPointBound As) D) family ∧ - ∀ (i : {i : ZFSet.{u} // i ∈ I}) f, ZFSet.pair i.val f ∈ family → - IntervalEmbeddingCode (d.sources.value i) D (d.orders.value i) rD - (d.lows.value i) (d.highs.value i) f := by - let W := M.groundRelations (familyPointBound As) D - have hW : W ∈ M.sets := M.groundRelations_mem pairing unions powers separation - (M.familyPointBound_mem unions hAs) hD - have hR := M.intervalEmbeddingRelation_mem pairing unions powers separation - hI hW hAs hrs hlos hhis hD hrD - have total : ∀ i ∈ I, ∃ f ∈ W, - ZFSet.pair i f ∈ intervalEmbeddingRelation I W As rs los his D rD := by - intro i hi - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - obtain ⟨f, hf, code⟩ := M.exists_intervalEmbedding - pairing unions powers separation collection infinite - (d.sources.value_mem M hAs j) hD (d.orders.value_mem M hrs j) hrD hc - (d.source_order j) target injection (small j) (d.lower_mem j) (d.upper_mem j) (d.gap j) - have bound : f ∈ W := (M.mem_groundRelations (familyPointBound As) D f).2 - ⟨hf, d.embedding_subset_bound j code⟩ - exact ⟨f, bound, (pair_mem_intervalEmbeddingRelation I W As rs los his D rD i f).2 - ⟨hi, bound, (d.candidate_iff j f).2 code⟩⟩ - obtain ⟨family, member, function, subset⟩ := M.uniformize_relation - pairing unions powers separation choice hI hW hR total - refine ⟨family, member, function, ?_⟩ - intro i f entry - exact (d.candidate_iff i f).1 - ((pair_mem_intervalEmbeddingRelation I W As rs los his D rD i.val f).1 (subset entry)).2.2 - -end TransitiveGround - - - - -universe u - -namespace BoundedFormula - -open SetFormula - -def endpointRightTripleFormula {n} (z x y w : Fin n) : BoundedFormula n := - exMem z (exMem 0 (.conj (orderedPairFormula 0 y.succ.succ w.succ.succ) - (orderedPairFormula z.succ.succ x.succ.succ 0))) - -theorem truth_endpointRightTripleFormula {n} (z x y w : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (endpointRightTripleFormula z x y w) env ↔ - env z = ZFSet.pair (env x) (ZFSet.pair (env y) (env w)) := by - simp only [endpointRightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] - change (∃ a ∈ env z, ∃ b ∈ a, b = ZFSet.pair (env y) (env w) ∧ env z = ZFSet.pair (env x) b) ↔ _ - constructor - · rintro ⟨a, _, b, _, rfl, equal⟩ - exact equal - · intro equal - refine ⟨{env x, ZFSet.pair (env y) (env w)}, ?_, ZFSet.pair (env y) (env w), - ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ - rw [equal] - exact ZFSet.mem_pair.2 (Or.inr rfl) - -def endpointRightMembershipFormula {n} (x y w f : Fin n) : BoundedFormula n := - exMem f (endpointRightTripleFormula 0 x.succ y.succ w.succ) - -theorem truth_endpointRightMembershipFormula {n} (x y w f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (endpointRightMembershipFormula x y w f) env ↔ - ZFSet.pair (env x) (ZFSet.pair (env y) (env w)) ∈ env f := by - simp only [endpointRightMembershipFormula, truth_exMem, truth_endpointRightTripleFormula] - change (∃ a ∈ env f, a = ZFSet.pair (env x) (ZFSet.pair (env y) (env w))) ↔ _ - constructor - · rintro ⟨a, ha, equal⟩ - exact equal ▸ ha - · intro ha - exact ⟨_, ha, rfl⟩ - -def endpointTupleFormula {n} (z i c lo hi : Fin n) : BoundedFormula n := - exMem z (exMem 0 (.conj (endpointRightTripleFormula 0 c.succ.succ lo.succ.succ hi.succ.succ) - (orderedPairFormula z.succ.succ i.succ.succ 0))) - -theorem truth_endpointTupleFormula {n} (z i c lo hi : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (endpointTupleFormula z i c lo hi) env ↔ - env z = ZFSet.pair (env i) (ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi))) := by - simp only [endpointTupleFormula, truth_exMem, Truth, truth_endpointRightTripleFormula, - truth_orderedPairFormula] - change (∃ a ∈ env z, ∃ b ∈ a, b = ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi)) ∧ - env z = ZFSet.pair (env i) b) ↔ _ - constructor - · rintro ⟨a, _, b, _, rfl, equal⟩ - exact equal - · intro equal - refine ⟨{env i, ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi))}, ?_, - ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi)), ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ - rw [equal] - exact ZFSet.mem_pair.2 (Or.inr rfl) - -def batchHeightEndpointFormula : BoundedFormula 12 := - exMem 1 (exMem 11 (exMem 13 (exMem 5 (exMem 6 (exMem 8 (exMem 10 (exMem 11 (exMem 11 (exMem 13 - (.conj (endpointTupleFormula 10 9 4 3 2) - (.conj (pairMembershipFormula 9 8 15) - (.conj (pairMembershipFormula 9 7 16) - (.conj (pairMembershipFormula 8 6 7) - (.conj (pairMembershipFormula 9 5 17) - (.conj (endpointRightMembershipFormula 6 4 3 18) - (.conj (endpointRightMembershipFormula 5 1 0 18) - (.conj (pairMembershipFormula 3 2 19) - (disj (.conj (.equal 4 1) (.equal 2 0)) (.mem 4 1))))))))))))))))))) - -theorem truth_batchHeightEndpointFormula (env : Fin 12 → ZFSet.{u}) : - Truth batchHeightEndpointFormula env ↔ - ∃ i ∈ env 1, ∃ a ∈ env 10, ∃ ell ∈ env 11, ∃ b ∈ env 2, ∃ e ∈ env 2, - ∃ c ∈ env 3, ∃ lo ∈ env 4, ∃ hi ∈ env 4, ∃ d ∈ env 3, ∃ v ∈ env 4, - env 0 = ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∧ - ZFSet.pair i a ∈ env 5 ∧ ZFSet.pair i ell ∈ env 6 ∧ ZFSet.pair a b ∈ ell ∧ - ZFSet.pair i e ∈ env 7 ∧ ZFSet.pair b (ZFSet.pair c lo) ∈ env 8 ∧ - ZFSet.pair e (ZFSet.pair d v) ∈ env 8 ∧ ZFSet.pair lo hi ∈ env 9 ∧ - ((c = d ∧ hi = v) ∨ c ∈ d) := by - simp only [batchHeightEndpointFormula, truth_exMem, Truth, truth_disj, - truth_endpointTupleFormula, truth_endpointRightMembershipFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -noncomputable def endpointColumns (I C D f : ZFSet.{u}) : ZFSet.{u} := - relationCompose I (ZFSet.prod C (ZFSet.prod D D)) C f (productFirst C (ZFSet.prod D D)) - -noncomputable def endpointPairs (I C D f : ZFSet.{u}) : ZFSet.{u} := - relationCompose I (ZFSet.prod C (ZFSet.prod D D)) (ZFSet.prod D D) f (productSecond C (ZFSet.prod D D)) - -noncomputable def endpointLows (I C D f : ZFSet.{u}) : ZFSet.{u} := - relationCompose I (ZFSet.prod D D) D (endpointPairs I C D f) (productFirst D D) - -noncomputable def endpointHighs (I C D f : ZFSet.{u}) : ZFSet.{u} := - relationCompose I (ZFSet.prod D D) D (endpointPairs I C D f) (productSecond D D) - -theorem endpointProjection_functions {I C D f : ZFSet.{u}} - (func : ZFSet.IsFunc I (ZFSet.prod C (ZFSet.prod D D)) f) : - ZFSet.IsFunc I C (endpointColumns I C D f) ∧ - ZFSet.IsFunc I D (endpointLows I C D f) ∧ ZFSet.IsFunc I D (endpointHighs I C D f) := by - have pairs : ZFSet.IsFunc I (ZFSet.prod D D) (endpointPairs I C D f) := - relationCompose_function_of_subset func (productSecond_function C (ZFSet.prod D D)) (fun _ h => h) - exact ⟨relationCompose_function_of_subset func (productFirst_function C (ZFSet.prod D D)) (fun _ h => h), - relationCompose_function_of_subset pairs (productFirst_function D D) (fun _ h => h), - relationCompose_function_of_subset pairs (productSecond_function D D) (fun _ h => h)⟩ - -theorem endpointProjection_entries {I C D f i c lo hi : ZFSet.{u}} - (hiI : i ∈ I) (hc : c ∈ C) (hlo : lo ∈ D) (hhi : hi ∈ D) - (entry : ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∈ f) : - ZFSet.pair i c ∈ endpointColumns I C D f ∧ - ZFSet.pair i lo ∈ endpointLows I C D f ∧ ZFSet.pair i hi ∈ endpointHighs I C D f := by - have hpair := ZFSet.pair_mem_prod.2 ⟨hlo, hhi⟩ - have htriple := ZFSet.pair_mem_prod.2 ⟨hc, hpair⟩ - have pairs : ZFSet.pair i (ZFSet.pair lo hi) ∈ endpointPairs I C D f := - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hpair, _, htriple, entry, - (mem_productSecond C (ZFSet.prod D D) _).2 ⟨c, hc, _, hpair, rfl⟩⟩ - exact ⟨(pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hc, _, htriple, entry, - (mem_productFirst C (ZFSet.prod D D) _).2 ⟨c, hc, _, hpair, rfl⟩⟩, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hlo, _, hpair, pairs, - (mem_productFirst D D _).2 ⟨lo, hlo, hi, hhi, rfl⟩⟩, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hhi, _, hpair, pairs, - (mem_productSecond D D _).2 ⟨lo, hlo, hi, hhi, rfl⟩⟩⟩ - -theorem batchHeightEndpointCode_of_selection - {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD f : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (old : StrictLexHeightCode P C D rP oldH rD) - (func : ZFSet.IsFunc I (ZFSet.prod C (ZFSet.prod D D)) f) - (selected : f ⊆ batchHeightEndpointRelation I P C D As Es Ss oldH rD) : - BatchHeightEndpointCode d C D oldH rD - (endpointColumns I C D f) (endpointLows I C D f) (endpointHighs I C D f) := by - obtain ⟨columns, lows, highs⟩ := endpointProjection_functions func - have atIndex (i : {i : ZFSet.{u} // i ∈ I}) : - ∃ c lo hi, ZFSet.pair i.val c ∈ endpointColumns I C D f ∧ - ZFSet.pair i.val lo ∈ endpointLows I C D f ∧ ZFSet.pair i.val hi ∈ endpointHighs I C D f ∧ - ZFSet.pair (d.templates.base i).val (ZFSet.pair c lo) ∈ oldH ∧ ZFSet.pair lo hi ∈ rD ∧ - ∀ c' v, ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH → - (c = c' ∧ hi = v) ∨ c ∈ c' := by - obtain ⟨t, entry, _⟩ := func.2 i.val i.property - obtain ⟨c, hc, pair, hpair, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (func.1 entry)).2 - obtain ⟨lo, hlo, hi, hhi, rfl⟩ := ZFSet.mem_prod.1 hpair - obtain ⟨ce, le, he⟩ := endpointProjection_entries i.property hc hlo hhi entry - exact ⟨c, lo, hi, ce, le, he, d.batchHeightEndpointRelation_laws old i (selected entry)⟩ - refine ⟨columns, lows, highs, ?_, ?_, ?_⟩ - · intro i c lo ce le - obtain ⟨c', lo', hi, ce', le', _, base, _⟩ := atIndex i - have ec := (functionCode_partial columns).unique _ _ _ ce' ce - have el := (functionCode_partial lows).unique _ _ _ le' le - exact ec ▸ el ▸ base - · intro i lo hi le he - obtain ⟨c, lo', hi', _, le', he', _, gap, _⟩ := atIndex i - have el := (functionCode_partial lows).unique _ _ _ le' le - have eh := (functionCode_partial highs).unique _ _ _ he' he - exact el ▸ eh ▸ gap - · intro i c hi c' v ce he sep - obtain ⟨c'', lo, hi', ce', _, he', _, _, upper⟩ := atIndex i - have ec := (functionCode_partial columns).unique _ _ _ ce' ce - have eh := (functionCode_partial highs).unique _ _ _ he' he - exact ec ▸ eh ▸ upper c' v sep - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem batchHeightEndpointRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I P C D As Es Ss oldH rD : ZFSet.{u}} - (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) - (hOld : oldH ∈ M.sets) (hrD : rD ∈ M.sets) : - batchHeightEndpointRelation I P C D As Es Ss oldH rD ∈ M.sets := by - have ha := M.union_mem unions (M.union_mem unions hAs) - have he := M.union_mem unions (M.union_mem unions hEs) - let params := extend I (extend P (extend C (extend D (extend As (extend Es (extend Ss - (extend oldH (extend rD (extend (ZFSet.sUnion (ZFSet.sUnion As)) - (extend (ZFSet.sUnion (ZFSet.sUnion Es)) Fin.elim0)))))))))) - have selected := M.bounded_separation_mem separation BoundedFormula.batchHeightEndpointFormula params - (Fin.cases hI (Fin.cases hP (Fin.cases hC (Fin.cases hD (Fin.cases hAs (Fin.cases hEs - (Fin.cases hSs (Fin.cases hOld (Fin.cases hrD (Fin.cases ha (Fin.cases he (fun j => Fin.elim0 j)))))))))))) - (M.prod_mem pairing unions powers separation hI - (M.prod_mem pairing unions powers separation hC (M.prod_mem pairing unions powers separation hD hD))) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.batchHeightEndpointFormula - (extend z params)) (ZFSet.prod I (ZFSet.prod C (ZFSet.prod D D))) = - batchHeightEndpointRelation I P C D As Es Ss oldH rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, batchHeightEndpointRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_batchHeightEndpointFormula _) - exact equal ▸ selected - -theorem endpointProjections_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I C D f : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hf : f ∈ M.sets) : - endpointColumns I C D f ∈ M.sets ∧ endpointLows I C D f ∈ M.sets ∧ - endpointHighs I C D f ∈ M.sets := by - have hDD := M.prod_mem pairing unions powers separation hD hD - have hT := M.prod_mem pairing unions powers separation hC hDD - have hPairs : endpointPairs I C D f ∈ M.sets := M.relationCompose_mem pairing unions powers separation - hI hT hDD hf (M.productSecond_mem pairing unions powers separation hC hDD) - exact ⟨M.relationCompose_mem pairing unions powers separation hI hT hC hf - (M.productFirst_mem pairing unions powers separation hC hDD), - M.relationCompose_mem pairing unions powers separation hI hDD hD hPairs - (M.productFirst_mem pairing unions powers separation hD hD), - M.relationCompose_mem pairing unions powers separation hI hDD hD hPairs - (M.productSecond_mem pairing unions powers separation hD hD)⟩ - -theorem exists_batchHeightEndpoints - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (old : StrictLexHeightCode P C D rP oldH rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) - (hOld : oldH ∈ M.sets) (hrD : rD ∈ M.sets) : - ∃ Cs ∈ M.sets, ∃ los ∈ M.sets, ∃ his ∈ M.sets, - BatchHeightEndpointCode d C D oldH rD Cs los his := by - have hT := M.prod_mem pairing unions powers separation hC (M.prod_mem pairing unions powers separation hD hD) - have hRelation := M.batchHeightEndpointRelation_mem pairing unions powers separation - hI hP hC hD hAs hEs hSs hOld hrD - obtain ⟨f, hf, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice - hI hT hRelation (d.batchHeightEndpointRelation_total old above) - obtain ⟨hc, hl, hh⟩ := M.endpointProjections_mem pairing unions powers separation hI hC hD hf - exact ⟨endpointColumns I C D f, hc, endpointLows I C D f, hl, endpointHighs I C D f, hh, - batchHeightEndpointCode_of_selection d old func selected⟩ - -end TransitiveGround - - - - - - -namespace TemplateHeightFamilyInputs - -variable {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD Cs los his : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (t : TemplateHeightFamilyInputs d Vs vrs Hs) - -include t in -theorem intervalInputs (e : BatchHeightEndpointCode d C D old rD Cs los his) : - IntervalEmbeddingFamilyInputs I Vs vrs los his D rD where - sources := t.ranges - orders := t.orders - lows := ⟨D, e.lows⟩ - highs := ⟨D, e.highs⟩ - source_order := t.linear - lower_mem i := (ZFSet.pair_mem_prod.1 (e.lows.1 - ((show FunctionGraphOn I los from ⟨D, e.lows⟩).value_entry i))).2 - upper_mem i := (ZFSet.pair_mem_prod.1 (e.highs.1 - ((show FunctionGraphOn I his from ⟨D, e.highs⟩).value_entry i))).2 - gap i := e.gap i _ _ - ((show FunctionGraphOn I los from ⟨D, e.lows⟩).value_entry i) - ((show FunctionGraphOn I his from ⟨D, e.highs⟩).value_entry i) - -end TemplateHeightFamilyInputs - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem exists_templateIntervalFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD Cs los his c : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (t : TemplateHeightFamilyInputs d Vs vrs Hs) - (e : BatchHeightEndpointCode d C D old rD Cs los his) - (hI : I ∈ M.sets) (hVs : Vs ∈ M.sets) (hvrs : vrs ∈ M.sets) - (hlos : los ∈ M.sets) (hhis : his ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) - (small : ∀ i, M.groundEmbeddable (t.ranges.value i) ZFSet.omega) : - ∃ family ∈ M.sets, - ZFSet.IsFunc I (M.groundRelations (familyPointBound Vs) D) family ∧ - ∀ (i : {i : ZFSet.{u} // i ∈ I}) lo hi f, - ZFSet.pair i.val lo ∈ los → ZFSet.pair i.val hi ∈ his → - ZFSet.pair i.val f ∈ family → - IntervalEmbeddingCode (t.ranges.value i) D (t.orders.value i) rD lo hi f := by - obtain ⟨family, member, function, valid⟩ := M.exists_intervalEmbedding_family - pairing unions powers separation collection infinite choice (t.intervalInputs e) - hI hVs hvrs hlos hhis hD hrD hc target injection small - refine ⟨family, member, function, ?_⟩ - intro i lo hi f lower upper entry - have code := valid i f entry - have sameLo := (t.intervalInputs e).lows.value_eq_of_entry i lower - have sameHi := (t.intervalInputs e).highs.value_eq_of_entry i upper - rw [sameLo, sameHi] at code - exact code - -end TransitiveGround - - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIntervalEmbeddingRelation +import OAI.SetTheory.PartitionPrinciple.Geometry.TemplateHeightRangeCodes + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +universe u + +namespace BoundedFormula + +open SetFormula + +def indexedAttachmentDomainEntryFormula {n} (z i qs bound : Fin n) : BoundedFormula n := + exMem i (exMem bound.succ (exMem 0 + (.conj (pairMembershipFormula 2 1 qs.succ.succ.succ) + (orderedPairFormula z.succ.succ.succ 2 0)))) + +theorem truth_indexedAttachmentDomainEntryFormula {n} (z i qs bound : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (indexedAttachmentDomainEntryFormula z i qs bound) env ↔ + ∃ j ∈ env i, ∃ Q ∈ env bound, ∃ q ∈ Q, + ZFSet.pair j Q ∈ env qs ∧ env z = ZFSet.pair j q := by + simp only [indexedAttachmentDomainEntryFormula, truth_exMem, Truth, + truth_pairMembershipFormula, truth_orderedPairFormula] + rfl + +def indexedAttachmentFreshEntryFormula {n} + (z i qs rs anchors qBound rBound aBound : Fin n) : BoundedFormula n := + exMem i (exMem qBound.succ (exMem rBound.succ.succ + (exMem aBound.succ.succ.succ (exMem 2 + (.conj (pairMembershipFormula 4 3 qs.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 4 2 rs.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 4 1 anchors.succ.succ.succ.succ.succ) + (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 0) + (.neg (pairMembershipFormula 0 1 2)))))))))) + +theorem truth_indexedAttachmentFreshEntryFormula {n} + (z i qs rs anchors qBound rBound aBound : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (indexedAttachmentFreshEntryFormula z i qs rs anchors qBound rBound aBound) env ↔ + ∃ j ∈ env i, ∃ Q ∈ env qBound, ∃ r ∈ env rBound, ∃ a ∈ env aBound, ∃ q ∈ Q, + ZFSet.pair j Q ∈ env qs ∧ ZFSet.pair j r ∈ env rs ∧ ZFSet.pair j a ∈ env anchors ∧ + env z = ZFSet.pair j q ∧ ZFSet.pair q a ∉ r := by + simp only [indexedAttachmentFreshEntryFormula, truth_exMem, Truth, + truth_pairMembershipFormula, truth_orderedPairFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem familyPointBound_mem (unions : Realize M.sets SetFormula.union Fin.elim0) + {Qs : ZFSet.{u}} (hQs : Qs ∈ M.sets) : familyPointBound Qs ∈ M.sets := + M.union_mem unions (M.union_mem unions (M.union_mem unions hQs)) + +theorem indexedAttachmentDomain_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I Qs : ZFSet.{u}} (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) : + indexedAttachmentDomain I Qs ∈ M.sets := by + have bound := M.union_mem unions (M.union_mem unions hQs) + let params := extend I (extend Qs (extend (ZFSet.sUnion (ZFSet.sUnion Qs)) Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedAttachmentDomainEntryFormula 0 1 2 3) params + (Fin.cases hI (Fin.cases hQs (Fin.cases bound (fun j => Fin.elim0 j)))) + (M.prod_mem pairing unions powers separation hI (M.familyPointBound_mem unions hQs)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedAttachmentDomainEntryFormula 0 1 2 3) (extend z params)) + (ZFSet.prod I (familyPointBound Qs)) = indexedAttachmentDomain I Qs := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedAttachmentDomain, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_indexedAttachmentDomainEntryFormula 0 1 2 3 _) + exact equal ▸ selected + +theorem indexedAttachmentFresh_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I Qs rs anchors : ZFSet.{u}} (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) + (hrs : rs ∈ M.sets) (hAnchors : anchors ∈ M.sets) : + indexedAttachmentFresh I Qs rs anchors ∈ M.sets := by + have qBound := M.union_mem unions (M.union_mem unions hQs) + have rBound := M.union_mem unions (M.union_mem unions hrs) + have aBound := M.union_mem unions (M.union_mem unions hAnchors) + let params := extend I (extend Qs (extend rs (extend anchors + (extend (ZFSet.sUnion (ZFSet.sUnion Qs)) (extend (ZFSet.sUnion (ZFSet.sUnion rs)) + (extend (ZFSet.sUnion (ZFSet.sUnion anchors)) Fin.elim0)))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.indexedAttachmentFreshEntryFormula 0 1 2 3 4 5 6 7) params + (Fin.cases hI (Fin.cases hQs (Fin.cases hrs (Fin.cases hAnchors + (Fin.cases qBound (Fin.cases rBound (Fin.cases aBound (fun j => Fin.elim0 j)))))))) + (M.indexedAttachmentDomain_mem pairing unions powers separation hI hQs) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.indexedAttachmentFreshEntryFormula 0 1 2 3 4 5 6 7) (extend z params)) + (indexedAttachmentDomain I Qs) = indexedAttachmentFresh I Qs rs anchors := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedAttachmentFresh, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_indexedAttachmentFreshEntryFormula 0 1 2 3 4 5 6 7 _) + exact equal ▸ selected + +end TransitiveGround + + + + + + +noncomputable def batchHeightEndpointRelation + (I P C D As Es Ss oldH rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => + ∃ i ∈ I, ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion As), + ∃ ell ∈ ZFSet.sUnion (ZFSet.sUnion Es), ∃ b ∈ P, ∃ e ∈ P, + ∃ c ∈ C, ∃ lo ∈ D, ∃ hi ∈ D, ∃ d ∈ C, ∃ v ∈ D, + z = ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∧ + ZFSet.pair i a ∈ As ∧ ZFSet.pair i ell ∈ Es ∧ ZFSet.pair a b ∈ ell ∧ + ZFSet.pair i e ∈ Ss ∧ ZFSet.pair b (ZFSet.pair c lo) ∈ oldH ∧ + ZFSet.pair e (ZFSet.pair d v) ∈ oldH ∧ ZFSet.pair lo hi ∈ rD ∧ + ((c = d ∧ hi = v) ∨ c ∈ d)) + (ZFSet.prod I (ZFSet.prod C (ZFSet.prod D D))) + +theorem pair_mem_batchHeightEndpointRelation + (I P C D As Es Ss oldH rD i c lo hi : ZFSet.{u}) : + ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∈ + batchHeightEndpointRelation I P C D As Es Ss oldH rD ↔ + i ∈ I ∧ c ∈ C ∧ lo ∈ D ∧ hi ∈ D ∧ + ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion As), ∃ ell ∈ ZFSet.sUnion (ZFSet.sUnion Es), + ∃ b ∈ P, ∃ e ∈ P, ∃ d ∈ C, ∃ v ∈ D, + ZFSet.pair i a ∈ As ∧ ZFSet.pair i ell ∈ Es ∧ ZFSet.pair a b ∈ ell ∧ + ZFSet.pair i e ∈ Ss ∧ ZFSet.pair b (ZFSet.pair c lo) ∈ oldH ∧ + ZFSet.pair e (ZFSet.pair d v) ∈ oldH ∧ ZFSet.pair lo hi ∈ rD ∧ + ((c = d ∧ hi = v) ∨ c ∈ d) := by + rw [batchHeightEndpointRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, j, hj, a, ha, ell, hell, b, hb, e, he, + c', hc, lo', hlo, hi', hhi, d, hd, v, hv, equal, rest⟩ + obtain ⟨ij, restEq⟩ := ZFSet.pair_inj.1 equal + obtain ⟨cc, restEq'⟩ := ZFSet.pair_inj.1 restEq + obtain ⟨ll, hh⟩ := ZFSet.pair_inj.1 restEq' + subst j + subst c' + subst lo' + subst hi' + exact ⟨hj, hc, hlo, hhi, a, ha, ell, hell, b, hb, e, he, d, hd, v, hv, rest⟩ + · rintro ⟨hiI, hc, hlo, hhi, a, ha, ell, hell, b, hb, e, he, d, hd, v, hv, rest⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hiI, ZFSet.pair_mem_prod.2 + ⟨hc, ZFSet.pair_mem_prod.2 ⟨hlo, hhi⟩⟩⟩, + i, hiI, a, ha, ell, hell, b, hb, e, he, c, hc, lo, hlo, hi, hhi, d, hd, v, hv, rfl, rest⟩ + +structure BatchHeightEndpointCode + {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (C D oldH rD Cs los his : ZFSet.{u}) : Prop where + columns : ZFSet.IsFunc I C Cs + lows : ZFSet.IsFunc I D los + highs : ZFSet.IsFunc I D his + base : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ c lo, + ZFSet.pair i.val c ∈ Cs → ZFSet.pair i.val lo ∈ los → + ZFSet.pair (d.templates.base i).val (ZFSet.pair c lo) ∈ oldH + gap : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ lo hi, + ZFSet.pair i.val lo ∈ los → ZFSet.pair i.val hi ∈ his → ZFSet.pair lo hi ∈ rD + upper : ∀ i : {i : ZFSet.{u} // i ∈ I}, ∀ c hi c' v, + ZFSet.pair i.val c ∈ Cs → ZFSet.pair i.val hi ∈ his → + ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH → + (c = c' ∧ hi = v) ∨ c ∈ c' + +namespace AttachmentBatchInputs + +variable {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + +theorem endpoint_base_entry (i : {i : ZFSet.{u} // i ∈ I}) : + ZFSet.pair (d.anchor i) (d.templates.base i).val ∈ d.embed i := + (d.fiber i).baseMap_entry _ + +include d in +theorem batchHeightEndpointRelation_total + (old : StrictLexHeightCode P C D rP oldH rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) : + ∀ i ∈ I, ∃ t ∈ ZFSet.prod C (ZFSet.prod D D), + ZFSet.pair i t ∈ batchHeightEndpointRelation I P C D As Es Ss oldH rD := by + intro i hi + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + obtain ⟨baseHeight, baseEntry, _⟩ := old.function.2 (d.templates.base j).val (d.templates.base j).property + obtain ⟨c, hc, lo, hlo, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (old.function.1 baseEntry)).2 + obtain ⟨sepHeight, sepEntry, _⟩ := old.function.2 (d.separator j) (d.fiber j).separator_mem + obtain ⟨c', hc', v, hv, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (old.function.1 sepEntry)).2 + have different : (d.templates.base j).val ≠ d.separator j := by + intro equal + have bad := (d.fiber j).separator_not_le_base _ (d.endpoint_base_entry j) + rw [equal] at bad + exact bad (d.oldOrder.order.refl _ (d.fiber j).separator_mem) + have strict := old.strict _ (d.templates.base j).property _ (d.fiber j).separator_mem + c lo c' v ((d.fiber j).base_le_separator _ (d.endpoint_base_entry j)) different baseEntry sepEntry + have construct (upper : ZFSet.{u}) (hupper : upper ∈ D) (gap : ZFSet.pair lo upper ∈ rD) + (rule : (c = c' ∧ upper = v) ∨ c ∈ c') : + ∃ t ∈ ZFSet.prod C (ZFSet.prod D D), + ZFSet.pair i t ∈ batchHeightEndpointRelation I P C D As Es Ss oldH rD := by + refine ⟨ZFSet.pair c (ZFSet.pair lo upper), + ZFSet.pair_mem_prod.2 ⟨hc, ZFSet.pair_mem_prod.2 ⟨hlo, hupper⟩⟩, + (pair_mem_batchHeightEndpointRelation _ _ _ _ _ _ _ _ _ _ _ _ _).2 ?_⟩ + exact ⟨hi, hc, hlo, hupper, d.anchor j, d.anchors.value_mem_doubleUnion j, + d.embed j, d.embeddings.value_mem_doubleUnion j, (d.templates.base j).val, + (d.templates.base j).property, d.separator j, (d.fiber j).separator_mem, c', hc', v, hv, + d.anchor_entry j, d.embed_entry j, d.endpoint_base_entry j, d.separator_entry j, + baseEntry, sepEntry, gap, rule⟩ + rcases strict with smaller | ⟨same, gap⟩ + · obtain ⟨upper, hupper, gap⟩ := above lo hlo + exact construct upper hupper gap (Or.inr smaller) + · exact construct v hv gap (Or.inl ⟨same, rfl⟩) + +theorem batchHeightEndpointRelation_laws + (old : StrictLexHeightCode P C D rP oldH rD) + (i : {i : ZFSet.{u} // i ∈ I}) {c lo hi : ZFSet.{u}} + (entry : ZFSet.pair i.val (ZFSet.pair c (ZFSet.pair lo hi)) ∈ + batchHeightEndpointRelation I P C D As Es Ss oldH rD) : + ZFSet.pair (d.templates.base i).val (ZFSet.pair c lo) ∈ oldH ∧ + ZFSet.pair lo hi ∈ rD ∧ ∀ c' v, + ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH → + (c = c' ∧ hi = v) ∨ c ∈ c' := by + obtain ⟨_, _, _, _, a, _, ell, _, b, _, e, _, c', _, v, _, + ia, iell, ab, ie, bH, eH, gap, rule⟩ := + (pair_mem_batchHeightEndpointRelation _ _ _ _ _ _ _ _ _ _ _ _ _).1 entry + have aeq := d.anchors.value_eq_of_entry i ia + have elleq := d.embeddings.value_eq_of_entry i iell + have eeq := d.separators.value_eq_of_entry i ie + change d.anchor i = a at aeq + change d.embed i = ell at elleq + change d.separator i = e at eeq + subst a + subst ell + subst e + have beq := (functionCode_partial (d.fiber i).base_function).unique _ _ _ ab (d.endpoint_base_entry i) + subst b + refine ⟨bH, gap, ?_⟩ + intro c'' v' entry' + have equal := (functionCode_partial old.function).unique _ _ _ eH entry' + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact rule + +end AttachmentBatchInputs + +namespace BatchHeightEndpointCode + +theorem interval_upper + {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD Cs los his : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (endpoints : BatchHeightEndpointCode d C D oldH rD Cs los his) + (i : {i : ZFSet.{u} // i ∈ I}) {c hi q c' v : ZFSet.{u}} + (column : ZFSet.pair i.val c ∈ Cs) (upper : ZFSet.pair i.val hi ∈ his) + (below : ZFSet.pair q hi ∈ rD) + (separator : ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH) : + c ∈ c' ∨ (c = c' ∧ ZFSet.pair q v ∈ rD) := by + rcases endpoints.upper i c hi c' v column upper separator with ⟨same, rfl⟩ | smaller + · exact Or.inr ⟨same, below⟩ + · exact Or.inl smaller + +end BatchHeightEndpointCode + +end + + + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_intervalEmbedding_family + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I As rs los his D rD c : ZFSet.{u}} + (d : IntervalEmbeddingFamilyInputs I As rs los his D rD) + (hI : I ∈ M.sets) (hAs : As ∈ M.sets) (hrs : rs ∈ M.sets) + (hlos : los ∈ M.sets) (hhis : his ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) + (small : ∀ i, M.groundEmbeddable (d.sources.value i) ZFSet.omega) : + ∃ family ∈ M.sets, + ZFSet.IsFunc I (M.groundRelations (familyPointBound As) D) family ∧ + ∀ (i : {i : ZFSet.{u} // i ∈ I}) f, ZFSet.pair i.val f ∈ family → + IntervalEmbeddingCode (d.sources.value i) D (d.orders.value i) rD + (d.lows.value i) (d.highs.value i) f := by + let W := M.groundRelations (familyPointBound As) D + have hW : W ∈ M.sets := M.groundRelations_mem pairing unions powers separation + (M.familyPointBound_mem unions hAs) hD + have hR := M.intervalEmbeddingRelation_mem pairing unions powers separation + hI hW hAs hrs hlos hhis hD hrD + have total : ∀ i ∈ I, ∃ f ∈ W, + ZFSet.pair i f ∈ intervalEmbeddingRelation I W As rs los his D rD := by + intro i hi + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + obtain ⟨f, hf, code⟩ := M.exists_intervalEmbedding + pairing unions powers separation collection infinite + (d.sources.value_mem M hAs j) hD (d.orders.value_mem M hrs j) hrD hc + (d.source_order j) target injection (small j) (d.lower_mem j) (d.upper_mem j) (d.gap j) + have bound : f ∈ W := (M.mem_groundRelations (familyPointBound As) D f).2 + ⟨hf, d.embedding_subset_bound j code⟩ + exact ⟨f, bound, (pair_mem_intervalEmbeddingRelation I W As rs los his D rD i f).2 + ⟨hi, bound, (d.candidate_iff j f).2 code⟩⟩ + obtain ⟨family, member, function, subset⟩ := M.uniformize_relation + pairing unions powers separation choice hI hW hR total + refine ⟨family, member, function, ?_⟩ + intro i f entry + exact (d.candidate_iff i f).1 + ((pair_mem_intervalEmbeddingRelation I W As rs los his D rD i.val f).1 (subset entry)).2.2 + +end TransitiveGround + + + + +universe u + +namespace BoundedFormula + +open SetFormula + +def endpointRightTripleFormula {n} (z x y w : Fin n) : BoundedFormula n := + exMem z (exMem 0 (.conj (orderedPairFormula 0 y.succ.succ w.succ.succ) + (orderedPairFormula z.succ.succ x.succ.succ 0))) + +theorem truth_endpointRightTripleFormula {n} (z x y w : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (endpointRightTripleFormula z x y w) env ↔ + env z = ZFSet.pair (env x) (ZFSet.pair (env y) (env w)) := by + simp only [endpointRightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula] + change (∃ a ∈ env z, ∃ b ∈ a, b = ZFSet.pair (env y) (env w) ∧ env z = ZFSet.pair (env x) b) ↔ _ + constructor + · rintro ⟨a, _, b, _, rfl, equal⟩ + exact equal + · intro equal + refine ⟨{env x, ZFSet.pair (env y) (env w)}, ?_, ZFSet.pair (env y) (env w), + ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ + rw [equal] + exact ZFSet.mem_pair.2 (Or.inr rfl) + +def endpointRightMembershipFormula {n} (x y w f : Fin n) : BoundedFormula n := + exMem f (endpointRightTripleFormula 0 x.succ y.succ w.succ) + +theorem truth_endpointRightMembershipFormula {n} (x y w f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (endpointRightMembershipFormula x y w f) env ↔ + ZFSet.pair (env x) (ZFSet.pair (env y) (env w)) ∈ env f := by + simp only [endpointRightMembershipFormula, truth_exMem, truth_endpointRightTripleFormula] + change (∃ a ∈ env f, a = ZFSet.pair (env x) (ZFSet.pair (env y) (env w))) ↔ _ + constructor + · rintro ⟨a, ha, equal⟩ + exact equal ▸ ha + · intro ha + exact ⟨_, ha, rfl⟩ + +def endpointTupleFormula {n} (z i c lo hi : Fin n) : BoundedFormula n := + exMem z (exMem 0 (.conj (endpointRightTripleFormula 0 c.succ.succ lo.succ.succ hi.succ.succ) + (orderedPairFormula z.succ.succ i.succ.succ 0))) + +theorem truth_endpointTupleFormula {n} (z i c lo hi : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (endpointTupleFormula z i c lo hi) env ↔ + env z = ZFSet.pair (env i) (ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi))) := by + simp only [endpointTupleFormula, truth_exMem, Truth, truth_endpointRightTripleFormula, + truth_orderedPairFormula] + change (∃ a ∈ env z, ∃ b ∈ a, b = ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi)) ∧ + env z = ZFSet.pair (env i) b) ↔ _ + constructor + · rintro ⟨a, _, b, _, rfl, equal⟩ + exact equal + · intro equal + refine ⟨{env i, ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi))}, ?_, + ZFSet.pair (env c) (ZFSet.pair (env lo) (env hi)), ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩ + rw [equal] + exact ZFSet.mem_pair.2 (Or.inr rfl) + +def batchHeightEndpointFormula : BoundedFormula 12 := + exMem 1 (exMem 11 (exMem 13 (exMem 5 (exMem 6 (exMem 8 (exMem 10 (exMem 11 (exMem 11 (exMem 13 + (.conj (endpointTupleFormula 10 9 4 3 2) + (.conj (pairMembershipFormula 9 8 15) + (.conj (pairMembershipFormula 9 7 16) + (.conj (pairMembershipFormula 8 6 7) + (.conj (pairMembershipFormula 9 5 17) + (.conj (endpointRightMembershipFormula 6 4 3 18) + (.conj (endpointRightMembershipFormula 5 1 0 18) + (.conj (pairMembershipFormula 3 2 19) + (disj (.conj (.equal 4 1) (.equal 2 0)) (.mem 4 1))))))))))))))))))) + +theorem truth_batchHeightEndpointFormula (env : Fin 12 → ZFSet.{u}) : + Truth batchHeightEndpointFormula env ↔ + ∃ i ∈ env 1, ∃ a ∈ env 10, ∃ ell ∈ env 11, ∃ b ∈ env 2, ∃ e ∈ env 2, + ∃ c ∈ env 3, ∃ lo ∈ env 4, ∃ hi ∈ env 4, ∃ d ∈ env 3, ∃ v ∈ env 4, + env 0 = ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∧ + ZFSet.pair i a ∈ env 5 ∧ ZFSet.pair i ell ∈ env 6 ∧ ZFSet.pair a b ∈ ell ∧ + ZFSet.pair i e ∈ env 7 ∧ ZFSet.pair b (ZFSet.pair c lo) ∈ env 8 ∧ + ZFSet.pair e (ZFSet.pair d v) ∈ env 8 ∧ ZFSet.pair lo hi ∈ env 9 ∧ + ((c = d ∧ hi = v) ∨ c ∈ d) := by + simp only [batchHeightEndpointFormula, truth_exMem, Truth, truth_disj, + truth_endpointTupleFormula, truth_endpointRightMembershipFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +noncomputable def endpointColumns (I C D f : ZFSet.{u}) : ZFSet.{u} := + relationCompose I (ZFSet.prod C (ZFSet.prod D D)) C f (productFirst C (ZFSet.prod D D)) + +noncomputable def endpointPairs (I C D f : ZFSet.{u}) : ZFSet.{u} := + relationCompose I (ZFSet.prod C (ZFSet.prod D D)) (ZFSet.prod D D) f (productSecond C (ZFSet.prod D D)) + +noncomputable def endpointLows (I C D f : ZFSet.{u}) : ZFSet.{u} := + relationCompose I (ZFSet.prod D D) D (endpointPairs I C D f) (productFirst D D) + +noncomputable def endpointHighs (I C D f : ZFSet.{u}) : ZFSet.{u} := + relationCompose I (ZFSet.prod D D) D (endpointPairs I C D f) (productSecond D D) + +theorem endpointProjection_functions {I C D f : ZFSet.{u}} + (func : ZFSet.IsFunc I (ZFSet.prod C (ZFSet.prod D D)) f) : + ZFSet.IsFunc I C (endpointColumns I C D f) ∧ + ZFSet.IsFunc I D (endpointLows I C D f) ∧ ZFSet.IsFunc I D (endpointHighs I C D f) := by + have pairs : ZFSet.IsFunc I (ZFSet.prod D D) (endpointPairs I C D f) := + relationCompose_function_of_subset func (productSecond_function C (ZFSet.prod D D)) (fun _ h => h) + exact ⟨relationCompose_function_of_subset func (productFirst_function C (ZFSet.prod D D)) (fun _ h => h), + relationCompose_function_of_subset pairs (productFirst_function D D) (fun _ h => h), + relationCompose_function_of_subset pairs (productSecond_function D D) (fun _ h => h)⟩ + +theorem endpointProjection_entries {I C D f i c lo hi : ZFSet.{u}} + (hiI : i ∈ I) (hc : c ∈ C) (hlo : lo ∈ D) (hhi : hi ∈ D) + (entry : ZFSet.pair i (ZFSet.pair c (ZFSet.pair lo hi)) ∈ f) : + ZFSet.pair i c ∈ endpointColumns I C D f ∧ + ZFSet.pair i lo ∈ endpointLows I C D f ∧ ZFSet.pair i hi ∈ endpointHighs I C D f := by + have hpair := ZFSet.pair_mem_prod.2 ⟨hlo, hhi⟩ + have htriple := ZFSet.pair_mem_prod.2 ⟨hc, hpair⟩ + have pairs : ZFSet.pair i (ZFSet.pair lo hi) ∈ endpointPairs I C D f := + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hpair, _, htriple, entry, + (mem_productSecond C (ZFSet.prod D D) _).2 ⟨c, hc, _, hpair, rfl⟩⟩ + exact ⟨(pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hc, _, htriple, entry, + (mem_productFirst C (ZFSet.prod D D) _).2 ⟨c, hc, _, hpair, rfl⟩⟩, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hlo, _, hpair, pairs, + (mem_productFirst D D _).2 ⟨lo, hlo, hi, hhi, rfl⟩⟩, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hiI, hhi, _, hpair, pairs, + (mem_productSecond D D _).2 ⟨lo, hlo, hi, hhi, rfl⟩⟩⟩ + +theorem batchHeightEndpointCode_of_selection + {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD f : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (old : StrictLexHeightCode P C D rP oldH rD) + (func : ZFSet.IsFunc I (ZFSet.prod C (ZFSet.prod D D)) f) + (selected : f ⊆ batchHeightEndpointRelation I P C D As Es Ss oldH rD) : + BatchHeightEndpointCode d C D oldH rD + (endpointColumns I C D f) (endpointLows I C D f) (endpointHighs I C D f) := by + obtain ⟨columns, lows, highs⟩ := endpointProjection_functions func + have atIndex (i : {i : ZFSet.{u} // i ∈ I}) : + ∃ c lo hi, ZFSet.pair i.val c ∈ endpointColumns I C D f ∧ + ZFSet.pair i.val lo ∈ endpointLows I C D f ∧ ZFSet.pair i.val hi ∈ endpointHighs I C D f ∧ + ZFSet.pair (d.templates.base i).val (ZFSet.pair c lo) ∈ oldH ∧ ZFSet.pair lo hi ∈ rD ∧ + ∀ c' v, ZFSet.pair (d.separator i) (ZFSet.pair c' v) ∈ oldH → + (c = c' ∧ hi = v) ∨ c ∈ c' := by + obtain ⟨t, entry, _⟩ := func.2 i.val i.property + obtain ⟨c, hc, pair, hpair, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (func.1 entry)).2 + obtain ⟨lo, hlo, hi, hhi, rfl⟩ := ZFSet.mem_prod.1 hpair + obtain ⟨ce, le, he⟩ := endpointProjection_entries i.property hc hlo hhi entry + exact ⟨c, lo, hi, ce, le, he, d.batchHeightEndpointRelation_laws old i (selected entry)⟩ + refine ⟨columns, lows, highs, ?_, ?_, ?_⟩ + · intro i c lo ce le + obtain ⟨c', lo', hi, ce', le', _, base, _⟩ := atIndex i + have ec := (functionCode_partial columns).unique _ _ _ ce' ce + have el := (functionCode_partial lows).unique _ _ _ le' le + exact ec ▸ el ▸ base + · intro i lo hi le he + obtain ⟨c, lo', hi', _, le', he', _, gap, _⟩ := atIndex i + have el := (functionCode_partial lows).unique _ _ _ le' le + have eh := (functionCode_partial highs).unique _ _ _ he' he + exact el ▸ eh ▸ gap + · intro i c hi c' v ce he sep + obtain ⟨c'', lo, hi', ce', _, he', _, _, upper⟩ := atIndex i + have ec := (functionCode_partial columns).unique _ _ _ ce' ce + have eh := (functionCode_partial highs).unique _ _ _ he' he + exact ec ▸ eh ▸ upper c' v sep + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem batchHeightEndpointRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I P C D As Es Ss oldH rD : ZFSet.{u}} + (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) + (hOld : oldH ∈ M.sets) (hrD : rD ∈ M.sets) : + batchHeightEndpointRelation I P C D As Es Ss oldH rD ∈ M.sets := by + have ha := M.union_mem unions (M.union_mem unions hAs) + have he := M.union_mem unions (M.union_mem unions hEs) + let params := extend I (extend P (extend C (extend D (extend As (extend Es (extend Ss + (extend oldH (extend rD (extend (ZFSet.sUnion (ZFSet.sUnion As)) + (extend (ZFSet.sUnion (ZFSet.sUnion Es)) Fin.elim0)))))))))) + have selected := M.bounded_separation_mem separation BoundedFormula.batchHeightEndpointFormula params + (Fin.cases hI (Fin.cases hP (Fin.cases hC (Fin.cases hD (Fin.cases hAs (Fin.cases hEs + (Fin.cases hSs (Fin.cases hOld (Fin.cases hrD (Fin.cases ha (Fin.cases he (fun j => Fin.elim0 j)))))))))))) + (M.prod_mem pairing unions powers separation hI + (M.prod_mem pairing unions powers separation hC (M.prod_mem pairing unions powers separation hD hD))) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.batchHeightEndpointFormula + (extend z params)) (ZFSet.prod I (ZFSet.prod C (ZFSet.prod D D))) = + batchHeightEndpointRelation I P C D As Es Ss oldH rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, batchHeightEndpointRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_batchHeightEndpointFormula _) + exact equal ▸ selected + +theorem endpointProjections_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I C D f : ZFSet.{u}} (hI : I ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hf : f ∈ M.sets) : + endpointColumns I C D f ∈ M.sets ∧ endpointLows I C D f ∈ M.sets ∧ + endpointHighs I C D f ∈ M.sets := by + have hDD := M.prod_mem pairing unions powers separation hD hD + have hT := M.prod_mem pairing unions powers separation hC hDD + have hPairs : endpointPairs I C D f ∈ M.sets := M.relationCompose_mem pairing unions powers separation + hI hT hDD hf (M.productSecond_mem pairing unions powers separation hC hDD) + exact ⟨M.relationCompose_mem pairing unions powers separation hI hT hC hf + (M.productFirst_mem pairing unions powers separation hC hDD), + M.relationCompose_mem pairing unions powers separation hI hDD hD hPairs + (M.productFirst_mem pairing unions powers separation hD hD), + M.relationCompose_mem pairing unions powers separation hI hDD hD hPairs + (M.productSecond_mem pairing unions powers separation hD hD)⟩ + +theorem exists_batchHeightEndpoints + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P rP μP I Qs rs μs As Es Fs Ss C D oldH rD : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (old : StrictLexHeightCode P C D rP oldH rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hSs : Ss ∈ M.sets) + (hOld : oldH ∈ M.sets) (hrD : rD ∈ M.sets) : + ∃ Cs ∈ M.sets, ∃ los ∈ M.sets, ∃ his ∈ M.sets, + BatchHeightEndpointCode d C D oldH rD Cs los his := by + have hT := M.prod_mem pairing unions powers separation hC (M.prod_mem pairing unions powers separation hD hD) + have hRelation := M.batchHeightEndpointRelation_mem pairing unions powers separation + hI hP hC hD hAs hEs hSs hOld hrD + obtain ⟨f, hf, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice + hI hT hRelation (d.batchHeightEndpointRelation_total old above) + obtain ⟨hc, hl, hh⟩ := M.endpointProjections_mem pairing unions powers separation hI hC hD hf + exact ⟨endpointColumns I C D f, hc, endpointLows I C D f, hl, endpointHighs I C D f, hh, + batchHeightEndpointCode_of_selection d old func selected⟩ + +end TransitiveGround + + + + + + +namespace TemplateHeightFamilyInputs + +variable {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD Cs los his : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (t : TemplateHeightFamilyInputs d Vs vrs Hs) + +include t in +theorem intervalInputs (e : BatchHeightEndpointCode d C D old rD Cs los his) : + IntervalEmbeddingFamilyInputs I Vs vrs los his D rD where + sources := t.ranges + orders := t.orders + lows := ⟨D, e.lows⟩ + highs := ⟨D, e.highs⟩ + source_order := t.linear + lower_mem i := (ZFSet.pair_mem_prod.1 (e.lows.1 + ((show FunctionGraphOn I los from ⟨D, e.lows⟩).value_entry i))).2 + upper_mem i := (ZFSet.pair_mem_prod.1 (e.highs.1 + ((show FunctionGraphOn I his from ⟨D, e.highs⟩).value_entry i))).2 + gap i := e.gap i _ _ + ((show FunctionGraphOn I los from ⟨D, e.lows⟩).value_entry i) + ((show FunctionGraphOn I his from ⟨D, e.highs⟩).value_entry i) + +end TemplateHeightFamilyInputs + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem exists_templateIntervalFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs C D old rD Cs los his c : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (t : TemplateHeightFamilyInputs d Vs vrs Hs) + (e : BatchHeightEndpointCode d C D old rD Cs los his) + (hI : I ∈ M.sets) (hVs : Vs ∈ M.sets) (hvrs : vrs ∈ M.sets) + (hlos : los ∈ M.sets) (hhis : his ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (target : DenseOrderCode D rD) (injection : InjectionCode D ZFSet.omega c) + (small : ∀ i, M.groundEmbeddable (t.ranges.value i) ZFSet.omega) : + ∃ family ∈ M.sets, + ZFSet.IsFunc I (M.groundRelations (familyPointBound Vs) D) family ∧ + ∀ (i : {i : ZFSet.{u} // i ∈ I}) lo hi f, + ZFSet.pair i.val lo ∈ los → ZFSet.pair i.val hi ∈ his → + ZFSet.pair i.val f ∈ family → + IntervalEmbeddingCode (t.ranges.value i) D (t.orders.value i) rD lo hi f := by + obtain ⟨family, member, function, valid⟩ := M.exists_intervalEmbedding_family + pairing unions powers separation collection infinite choice (t.intervalInputs e) + hI hVs hvrs hlos hhis hD hrD hc target injection small + refine ⟨family, member, function, ?_⟩ + intro i lo hi f lower upper entry + have code := valid i f entry + have sameLo := (t.intervalInputs e).lows.value_eq_of_entry i lower + have sameHi := (t.intervalInputs e).highs.value_eq_of_entry i upper + rw [sameLo, sameHi] at code + exact code + +end TransitiveGround + + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTileStarIncidence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTileStarIncidence.lean index 213f0afb0e1e73f196b53874b13216912d2dfda6..8704235c3a9895dced252acb934000a92b7d9a43 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTileStarIncidence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTileStarIncidence.lean @@ -1,290 +1,290 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry -universe u - -def tileStarVertexCarrier (Q E R : ZFSet.{u}) : ZFSet.{u} := taggedSumCarrier Q (ZFSet.prod E R) -def tileStarEdgeCarrier (E R S : ZFSet.{u}) : ZFSet.{u} := taggedSumCarrier (ZFSet.prod E R) (ZFSet.prod E S) -def tileStarDartCarrier (E R S : ZFSet.{u}) : ZFSet.{u} := ZFSet.prod (tileStarEdgeCarrier E R S) (natSetCode 2) - -def signedPresentation {A : Type u} (s : Presentation A) : Presentation (A × Bool) where - carrier := ZFSet.prod s.carrier (natSetCode 2) - encode p := ZFSet.pair (s.encode p.1) (externalSignCode p.2) - injective := by - intro p q equal - have parts := ZFSet.pair_inj.1 equal - exact Prod.ext (s.injective parts.1) (externalSignCode_injective parts.2) - mem_carrier z := by - constructor - · intro hz - obtain ⟨a, ha, b, hb, equal⟩ := ZFSet.mem_prod.1 hz - obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha - obtain ⟨b, rfl⟩ := (mem_natTwo_iff_externalSignCode b).1 hb - exact ⟨(a, b), equal.symm⟩ - · rintro ⟨⟨a, b⟩, rfl⟩ - exact ZFSet.pair_mem_prod.2 ⟨s.encode_mem a, (mem_natTwo_iff_externalSignCode _).2 ⟨b, rfl⟩⟩ - -variable {J S R : Type u} [Group J] -variable (e : Presentation (External J S)) (s : Presentation S) (r : Presentation R) -variable (q : Presentation (Vertex J S)) - -noncomputable def tileStarVertexPresentation : Presentation (TileStars.Vertex J S R) := taggedSumPresentation q (e.product r) -noncomputable def tileStarEdgePresentation : Presentation (TileStars.Edge J S R) := taggedSumPresentation (e.product r) (e.product s) -noncomputable def tileStarDartPresentation : Presentation (TileStars.Dart J S R) := signedPresentation (tileStarEdgePresentation e s r) - -theorem tileStarPresentations_carriers : - (tileStarVertexPresentation e r q).carrier = tileStarVertexCarrier q.carrier e.carrier r.carrier ∧ - (tileStarEdgePresentation e s r).carrier = tileStarEdgeCarrier e.carrier r.carrier s.carrier ∧ - (tileStarDartPresentation e s r).carrier = tileStarDartCarrier e.carrier r.carrier s.carrier := ⟨rfl, rfl, rfl⟩ - -theorem tileStarVertexPresentation_encode (v : TileStars.Vertex J S R) : - (tileStarVertexPresentation e r q).encode v = match v with - | .inl c => ZFSet.pair (natSetCode 0) (q.encode c) - | .inr c => ZFSet.pair (natSetCode 1) (ZFSet.pair (e.encode c.1) (r.encode c.2)) := by - cases v <;> rfl - -theorem tileStarDartPresentation_encode (d : TileStars.Dart J S R) : - (tileStarDartPresentation e s r).encode d = - ZFSet.pair (match d.1 with - | .inl c => ZFSet.pair (natSetCode 0) (ZFSet.pair (e.encode c.1) (r.encode c.2)) - | .inr c => ZFSet.pair (natSetCode 1) (ZFSet.pair (e.encode c.1) (s.encode c.2))) (externalSignCode d.2) := by - rcases d with ⟨edge, b⟩ - cases edge <;> rfl - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem tileStarCarriers_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Q E R S : ZFSet.{u}} (hQ : Q ∈ M.sets) (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) : - tileStarVertexCarrier Q E R ∈ M.sets ∧ tileStarEdgeCarrier E R S ∈ M.sets ∧ tileStarDartCarrier E R S ∈ M.sets := by - have center := M.prod_mem pairing unions powers separation hE hR - have edge := M.taggedSumCarrier_mem pairing unions powers separation center (M.prod_mem pairing unions powers separation hE hS) - have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨E, hE⟩ - have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero - have two : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions one one - exact ⟨M.taggedSumCarrier_mem pairing unions powers separation hQ center, edge, - M.prod_mem pairing unions powers separation edge two⟩ - -end TransitiveGround - -end - -open SetFormula -universe u - -def TileStarSourceEntry (E R S Q Edges C request generators multiplication d v : ZFSet.{u}) : Prop := - ∃ e ∈ Edges, - (∃ w ∈ E, ∃ r ∈ R, e = ZFSet.pair (natSetCode 0) (ZFSet.pair w r) ∧ - ((d = ZFSet.pair e (natSetCode 1) ∧ ∃ q ∈ Q, ZFSet.pair w q ∈ C ∧ v = ZFSet.pair (natSetCode 0) q) ∨ - (d = ZFSet.pair e (natSetCode 0) ∧ v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r)))) ∨ - (∃ w ∈ E, ∃ s ∈ S, e = ZFSet.pair (natSetCode 1) (ZFSet.pair w s) ∧ - ((d = ZFSet.pair e (natSetCode 1) ∧ ∃ r ∈ R, ZFSet.pair s r ∈ request ∧ v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r)) ∨ - (d = ZFSet.pair e (natSetCode 0) ∧ ∃ k ∈ E, ∃ a ∈ E, ∃ q ∈ Q, - ZFSet.pair s k ∈ generators ∧ ZFSet.pair (ZFSet.pair w k) a ∈ multiplication ∧ - ZFSet.pair a q ∈ C ∧ v = ZFSet.pair (natSetCode 0) q))) - -def TileStarReverseEntry (Edges d v : ZFSet.{u}) : Prop := - ∃ e ∈ Edges, - (d = ZFSet.pair e (natSetCode 0) ∧ v = ZFSet.pair e (natSetCode 1)) ∨ - (d = ZFSet.pair e (natSetCode 1) ∧ v = ZFSet.pair e (natSetCode 0)) - -noncomputable def tileStarSourceGraph (E R S Q C request generators multiplication : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ d ∈ tileStarDartCarrier E R S, ∃ v ∈ tileStarVertexCarrier Q E R, - z = ZFSet.pair d v ∧ TileStarSourceEntry E R S Q (tileStarEdgeCarrier E R S) C request generators multiplication d v) - (ZFSet.prod (tileStarDartCarrier E R S) (tileStarVertexCarrier Q E R)) - -noncomputable def tileStarReverseGraph (E R S : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ d ∈ tileStarDartCarrier E R S, ∃ v ∈ tileStarDartCarrier E R S, - z = ZFSet.pair d v ∧ TileStarReverseEntry (tileStarEdgeCarrier E R S) d v) - (ZFSet.prod (tileStarDartCarrier E R S) (tileStarDartCarrier E R S)) - -noncomputable def tileStarTargetGraph (E R S Q C request generators multiplication : ZFSet.{u}) : ZFSet.{u} := - relationCompose (tileStarDartCarrier E R S) (tileStarDartCarrier E R S) (tileStarVertexCarrier Q E R) - (tileStarReverseGraph E R S) (tileStarSourceGraph E R S Q C request generators multiplication) - -noncomputable def dartIncidenceGraph (source target : ZFSet.{u}) : ZFSet.{u} := source ∪ target -noncomputable def dartAdjacencyGraph (D V source target : ZFSet.{u}) : ZFSet.{u} := - relationCompose V D V (relationConverse D V source) target - -theorem pair_mem_tileStarSourceGraph (E R S Q C request generators multiplication d v : ZFSet.{u}) : - ZFSet.pair d v ∈ tileStarSourceGraph E R S Q C request generators multiplication ↔ - d ∈ tileStarDartCarrier E R S ∧ v ∈ tileStarVertexCarrier Q E R ∧ - TileStarSourceEntry E R S Q (tileStarEdgeCarrier E R S) C request generators multiplication d v := by - rw [tileStarSourceGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, d', hd, v', hv, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hd, hv, entry⟩ - · rintro ⟨hd, hv, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, d, hd, v, hv, rfl, entry⟩ - -theorem pair_mem_tileStarReverseGraph (E R S d v : ZFSet.{u}) : - ZFSet.pair d v ∈ tileStarReverseGraph E R S ↔ - d ∈ tileStarDartCarrier E R S ∧ v ∈ tileStarDartCarrier E R S ∧ - TileStarReverseEntry (tileStarEdgeCarrier E R S) d v := by - rw [tileStarReverseGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, d', hd, v', hv, equal, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hd, hv, entry⟩ - · rintro ⟨hd, hv, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, d, hd, v, hv, rfl, entry⟩ - -namespace BoundedFormula - -def tileStarSourceFormula {n} (E R S Q Edges C request generators multiplication d v zero one : Fin n) : BoundedFormula n := - (exMem Edges (disj (exMem E.succ (exMem R.succ.succ (.conj (orderedRightTripleFormula 2 zero.succ.succ.succ 1 0) (disj (.conj (orderedPairFormula d.succ.succ.succ 2 one.succ.succ.succ) (exMem Q.succ.succ.succ (.conj (pairMembershipFormula 2 0 C.succ.succ.succ.succ) (orderedPairFormula v.succ.succ.succ.succ zero.succ.succ.succ.succ 0)))) (.conj (orderedPairFormula d.succ.succ.succ 2 zero.succ.succ.succ) (orderedRightTripleFormula v.succ.succ.succ one.succ.succ.succ 1 0)))))) (exMem E.succ (exMem S.succ.succ (.conj (orderedRightTripleFormula 2 one.succ.succ.succ 1 0) (disj (.conj (orderedPairFormula d.succ.succ.succ 2 one.succ.succ.succ) (exMem R.succ.succ.succ (.conj (pairMembershipFormula 1 0 request.succ.succ.succ.succ) (orderedRightTripleFormula v.succ.succ.succ.succ one.succ.succ.succ.succ 2 0)))) (.conj (orderedPairFormula d.succ.succ.succ 2 zero.succ.succ.succ) (exMem E.succ.succ.succ (exMem E.succ.succ.succ.succ (exMem Q.succ.succ.succ.succ.succ (.conj (pairMembershipFormula 3 2 generators.succ.succ.succ.succ.succ.succ) (.conj (tripleMembershipFormula 4 2 1 multiplication.succ.succ.succ.succ.succ.succ) (.conj (pairMembershipFormula 1 0 C.succ.succ.succ.succ.succ.succ) (orderedPairFormula v.succ.succ.succ.succ.succ.succ zero.succ.succ.succ.succ.succ.succ 0)))))))))))))) - -theorem truth_tileStarSourceFormula {n} (E R S Q Edges C request generators multiplication d v zero one : Fin n) - (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : - Truth (tileStarSourceFormula E R S Q Edges C request generators multiplication d v zero one) env ↔ - TileStarSourceEntry (env E) (env R) (env S) (env Q) (env Edges) (env C) - (env request) (env generators) (env multiplication) (env d) (env v) := by - simp only [tileStarSourceFormula, Truth, truth_disj, truth_exMem, truth_orderedPairFormula, - truth_orderedRightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] - unfold TileStarSourceEntry - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [hz, ho] - rfl - -def tileStarReverseFormula {n} (Edges d v zero one : Fin n) : BoundedFormula n := - (exMem Edges (disj (.conj (orderedPairFormula d.succ 0 zero.succ) (orderedPairFormula v.succ 0 one.succ)) (.conj (orderedPairFormula d.succ 0 one.succ) (orderedPairFormula v.succ 0 zero.succ)))) - -theorem truth_tileStarReverseFormula {n} (Edges d v zero one : Fin n) (env : Fin n → ZFSet.{u}) - (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : - Truth (tileStarReverseFormula Edges d v zero one) env ↔ TileStarReverseEntry (env Edges) (env d) (env v) := by - simp only [tileStarReverseFormula, Truth, truth_disj, truth_exMem, truth_orderedPairFormula] - unfold TileStarReverseEntry - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [hz, ho] - -def tileStarSourceEntryFormula {n} (z D V E R S Q Edges C request generators multiplication zero one : Fin n) : BoundedFormula n := - exMem D (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (tileStarSourceFormula E.succ.succ R.succ.succ S.succ.succ Q.succ.succ Edges.succ.succ C.succ.succ request.succ.succ generators.succ.succ multiplication.succ.succ 1 0 zero.succ.succ one.succ.succ))) - -theorem truth_tileStarSourceEntryFormula {n} (z D V E R S Q Edges C request generators multiplication zero one : Fin n) - (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : - Truth (tileStarSourceEntryFormula z D V E R S Q Edges C request generators multiplication zero one) env ↔ - ∃ d ∈ env D, ∃ v ∈ env V, env z = ZFSet.pair d v ∧ - TileStarSourceEntry (env E) (env R) (env S) (env Q) (env Edges) (env C) (env request) (env generators) (env multiplication) d v := by - simp only [tileStarSourceEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - apply exists_congr - intro d - apply and_congr_right - intro _ - apply exists_congr - intro v - apply and_congr_right - intro _ - exact and_congr Iff.rfl (truth_tileStarSourceFormula E.succ.succ R.succ.succ S.succ.succ Q.succ.succ Edges.succ.succ C.succ.succ request.succ.succ generators.succ.succ multiplication.succ.succ 1 0 - zero.succ.succ one.succ.succ _ hz ho) - -def tileStarReverseEntryFormula {n} (z D V Edges zero one : Fin n) : BoundedFormula n := - exMem D (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (tileStarReverseFormula Edges.succ.succ 1 0 zero.succ.succ one.succ.succ))) - -theorem truth_tileStarReverseEntryFormula {n} (z D V Edges zero one : Fin n) - (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : - Truth (tileStarReverseEntryFormula z D V Edges zero one) env ↔ - ∃ d ∈ env D, ∃ v ∈ env V, env z = ZFSet.pair d v ∧ - TileStarReverseEntry (env Edges) d v := by - simp only [tileStarReverseEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - apply exists_congr - intro d - apply and_congr_right - intro _ - apply exists_congr - intro v - apply and_congr_right - intro _ - exact and_congr Iff.rfl (truth_tileStarReverseFormula Edges.succ.succ 1 0 - zero.succ.succ one.succ.succ _ hz ho) - -end BoundedFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -include pairing unions powers separation in -theorem tileStarSourceGraph_mem {E R S Q C request generators multiplication : ZFSet.{u}} - (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hrequest : request ∈ M.sets) (hgenerators : generators ∈ M.sets) (hmultiplication : multiplication ∈ M.sets) : - tileStarSourceGraph E R S Q C request generators multiplication ∈ M.sets := by - have hzero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨E, hE⟩ - have hone : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hzero hzero - have carriers := M.tileStarCarriers_mem pairing unions powers separation hQ hE hR hS - have hD := carriers.2.2 - have hV := carriers.1 - have hEdges := carriers.2.1 - let params := extend (tileStarDartCarrier E R S) (extend (tileStarVertexCarrier Q E R) (extend (E) (extend (R) (extend (S) (extend (Q) (extend (tileStarEdgeCarrier E R S) (extend (C) (extend (request) (extend (generators) (extend (multiplication) (extend (natSetCode 0) (extend (natSetCode 1) (Fin.elim0))))))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.tileStarSourceEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13) params - (Fin.cases hD (Fin.cases hV (Fin.cases hE (Fin.cases hR (Fin.cases hS (Fin.cases hQ (Fin.cases hEdges (Fin.cases hC (Fin.cases hrequest (Fin.cases hgenerators (Fin.cases hmultiplication (Fin.cases hzero (Fin.cases hone (fun i => Fin.elim0 i)))))))))))))) (M.prod_mem pairing unions powers separation hD hV) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.tileStarSourceEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13) (extend z params)) - (ZFSet.prod (tileStarDartCarrier E R S) (tileStarVertexCarrier Q E R)) = tileStarSourceGraph E R S Q C request generators multiplication := by - apply ZFSet.ext - intro z - rw [tileStarSourceGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_tileStarSourceEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 _ rfl rfl) - exact equal ▸ selected - -include pairing unions powers separation in -theorem tileStarReverseGraph_mem {E R S : ZFSet.{u}} - (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) : - tileStarReverseGraph E R S ∈ M.sets := by - have hzero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨E, hE⟩ - have hone : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hzero hzero - have carriers := M.tileStarCarriers_mem pairing unions powers separation hE hE hR hS - have hD := carriers.2.2 - have hV := carriers.2.2 - have hEdges := carriers.2.1 - let params := extend (tileStarDartCarrier E R S) (extend (tileStarDartCarrier E R S) (extend (tileStarEdgeCarrier E R S) (extend (natSetCode 0) (extend (natSetCode 1) (Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.tileStarReverseEntryFormula 0 1 2 3 4 5) params - (Fin.cases hD (Fin.cases hV (Fin.cases hEdges (Fin.cases hzero (Fin.cases hone (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hD hV) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.tileStarReverseEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod (tileStarDartCarrier E R S) (tileStarDartCarrier E R S)) = tileStarReverseGraph E R S := by - apply ZFSet.ext - intro z - rw [tileStarReverseGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_tileStarReverseEntryFormula 0 1 2 3 4 5 _ rfl rfl) - exact equal ▸ selected - -include pairing unions powers separation in -theorem tileStarTargetGraph_mem {E R S Q C request generators multiplication : ZFSet.{u}} - (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) (hQ : Q ∈ M.sets) - (hC : C ∈ M.sets) (hrequest : request ∈ M.sets) (hgenerators : generators ∈ M.sets) - (hmultiplication : multiplication ∈ M.sets) : - tileStarTargetGraph E R S Q C request generators multiplication ∈ M.sets := by - have carriers := M.tileStarCarriers_mem pairing unions powers separation hQ hE hR hS - exact M.relationCompose_mem pairing unions powers separation carriers.2.2 carriers.2.2 carriers.1 - (M.tileStarReverseGraph_mem pairing unions powers separation hE hR hS) - (M.tileStarSourceGraph_mem pairing unions powers separation hE hR hS hQ hC hrequest hgenerators hmultiplication) - -include pairing unions in -theorem dartIncidenceGraph_mem {source target : ZFSet.{u}} - (hs : source ∈ M.sets) (ht : target ∈ M.sets) : dartIncidenceGraph source target ∈ M.sets := - M.binary_union_mem pairing unions hs ht - -include pairing unions powers separation in -theorem dartAdjacencyGraph_mem {D V source target : ZFSet.{u}} - (hD : D ∈ M.sets) (hV : V ∈ M.sets) (hs : source ∈ M.sets) (ht : target ∈ M.sets) : - dartAdjacencyGraph D V source target ∈ M.sets := - M.relationCompose_mem pairing unions powers separation hV hD hV - (M.relationConverse_mem pairing unions powers separation hD hV hs) ht - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetRealization SetFormula Compression.RecursiveMaps.CosetGeometry +universe u + +def tileStarVertexCarrier (Q E R : ZFSet.{u}) : ZFSet.{u} := taggedSumCarrier Q (ZFSet.prod E R) +def tileStarEdgeCarrier (E R S : ZFSet.{u}) : ZFSet.{u} := taggedSumCarrier (ZFSet.prod E R) (ZFSet.prod E S) +def tileStarDartCarrier (E R S : ZFSet.{u}) : ZFSet.{u} := ZFSet.prod (tileStarEdgeCarrier E R S) (natSetCode 2) + +def signedPresentation {A : Type u} (s : Presentation A) : Presentation (A × Bool) where + carrier := ZFSet.prod s.carrier (natSetCode 2) + encode p := ZFSet.pair (s.encode p.1) (externalSignCode p.2) + injective := by + intro p q equal + have parts := ZFSet.pair_inj.1 equal + exact Prod.ext (s.injective parts.1) (externalSignCode_injective parts.2) + mem_carrier z := by + constructor + · intro hz + obtain ⟨a, ha, b, hb, equal⟩ := ZFSet.mem_prod.1 hz + obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha + obtain ⟨b, rfl⟩ := (mem_natTwo_iff_externalSignCode b).1 hb + exact ⟨(a, b), equal.symm⟩ + · rintro ⟨⟨a, b⟩, rfl⟩ + exact ZFSet.pair_mem_prod.2 ⟨s.encode_mem a, (mem_natTwo_iff_externalSignCode _).2 ⟨b, rfl⟩⟩ + +variable {J S R : Type u} [Group J] +variable (e : Presentation (External J S)) (s : Presentation S) (r : Presentation R) +variable (q : Presentation (Vertex J S)) + +noncomputable def tileStarVertexPresentation : Presentation (TileStars.Vertex J S R) := taggedSumPresentation q (e.product r) +noncomputable def tileStarEdgePresentation : Presentation (TileStars.Edge J S R) := taggedSumPresentation (e.product r) (e.product s) +noncomputable def tileStarDartPresentation : Presentation (TileStars.Dart J S R) := signedPresentation (tileStarEdgePresentation e s r) + +theorem tileStarPresentations_carriers : + (tileStarVertexPresentation e r q).carrier = tileStarVertexCarrier q.carrier e.carrier r.carrier ∧ + (tileStarEdgePresentation e s r).carrier = tileStarEdgeCarrier e.carrier r.carrier s.carrier ∧ + (tileStarDartPresentation e s r).carrier = tileStarDartCarrier e.carrier r.carrier s.carrier := ⟨rfl, rfl, rfl⟩ + +theorem tileStarVertexPresentation_encode (v : TileStars.Vertex J S R) : + (tileStarVertexPresentation e r q).encode v = match v with + | .inl c => ZFSet.pair (natSetCode 0) (q.encode c) + | .inr c => ZFSet.pair (natSetCode 1) (ZFSet.pair (e.encode c.1) (r.encode c.2)) := by + cases v <;> rfl + +theorem tileStarDartPresentation_encode (d : TileStars.Dart J S R) : + (tileStarDartPresentation e s r).encode d = + ZFSet.pair (match d.1 with + | .inl c => ZFSet.pair (natSetCode 0) (ZFSet.pair (e.encode c.1) (r.encode c.2)) + | .inr c => ZFSet.pair (natSetCode 1) (ZFSet.pair (e.encode c.1) (s.encode c.2))) (externalSignCode d.2) := by + rcases d with ⟨edge, b⟩ + cases edge <;> rfl + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem tileStarCarriers_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Q E R S : ZFSet.{u}} (hQ : Q ∈ M.sets) (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) : + tileStarVertexCarrier Q E R ∈ M.sets ∧ tileStarEdgeCarrier E R S ∈ M.sets ∧ tileStarDartCarrier E R S ∈ M.sets := by + have center := M.prod_mem pairing unions powers separation hE hR + have edge := M.taggedSumCarrier_mem pairing unions powers separation center (M.prod_mem pairing unions powers separation hE hS) + have zero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨E, hE⟩ + have one : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions zero zero + have two : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions one one + exact ⟨M.taggedSumCarrier_mem pairing unions powers separation hQ center, edge, + M.prod_mem pairing unions powers separation edge two⟩ + +end TransitiveGround + +end + +open SetFormula +universe u + +def TileStarSourceEntry (E R S Q Edges C request generators multiplication d v : ZFSet.{u}) : Prop := + ∃ e ∈ Edges, + (∃ w ∈ E, ∃ r ∈ R, e = ZFSet.pair (natSetCode 0) (ZFSet.pair w r) ∧ + ((d = ZFSet.pair e (natSetCode 1) ∧ ∃ q ∈ Q, ZFSet.pair w q ∈ C ∧ v = ZFSet.pair (natSetCode 0) q) ∨ + (d = ZFSet.pair e (natSetCode 0) ∧ v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r)))) ∨ + (∃ w ∈ E, ∃ s ∈ S, e = ZFSet.pair (natSetCode 1) (ZFSet.pair w s) ∧ + ((d = ZFSet.pair e (natSetCode 1) ∧ ∃ r ∈ R, ZFSet.pair s r ∈ request ∧ v = ZFSet.pair (natSetCode 1) (ZFSet.pair w r)) ∨ + (d = ZFSet.pair e (natSetCode 0) ∧ ∃ k ∈ E, ∃ a ∈ E, ∃ q ∈ Q, + ZFSet.pair s k ∈ generators ∧ ZFSet.pair (ZFSet.pair w k) a ∈ multiplication ∧ + ZFSet.pair a q ∈ C ∧ v = ZFSet.pair (natSetCode 0) q))) + +def TileStarReverseEntry (Edges d v : ZFSet.{u}) : Prop := + ∃ e ∈ Edges, + (d = ZFSet.pair e (natSetCode 0) ∧ v = ZFSet.pair e (natSetCode 1)) ∨ + (d = ZFSet.pair e (natSetCode 1) ∧ v = ZFSet.pair e (natSetCode 0)) + +noncomputable def tileStarSourceGraph (E R S Q C request generators multiplication : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ d ∈ tileStarDartCarrier E R S, ∃ v ∈ tileStarVertexCarrier Q E R, + z = ZFSet.pair d v ∧ TileStarSourceEntry E R S Q (tileStarEdgeCarrier E R S) C request generators multiplication d v) + (ZFSet.prod (tileStarDartCarrier E R S) (tileStarVertexCarrier Q E R)) + +noncomputable def tileStarReverseGraph (E R S : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ d ∈ tileStarDartCarrier E R S, ∃ v ∈ tileStarDartCarrier E R S, + z = ZFSet.pair d v ∧ TileStarReverseEntry (tileStarEdgeCarrier E R S) d v) + (ZFSet.prod (tileStarDartCarrier E R S) (tileStarDartCarrier E R S)) + +noncomputable def tileStarTargetGraph (E R S Q C request generators multiplication : ZFSet.{u}) : ZFSet.{u} := + relationCompose (tileStarDartCarrier E R S) (tileStarDartCarrier E R S) (tileStarVertexCarrier Q E R) + (tileStarReverseGraph E R S) (tileStarSourceGraph E R S Q C request generators multiplication) + +noncomputable def dartIncidenceGraph (source target : ZFSet.{u}) : ZFSet.{u} := source ∪ target +noncomputable def dartAdjacencyGraph (D V source target : ZFSet.{u}) : ZFSet.{u} := + relationCompose V D V (relationConverse D V source) target + +theorem pair_mem_tileStarSourceGraph (E R S Q C request generators multiplication d v : ZFSet.{u}) : + ZFSet.pair d v ∈ tileStarSourceGraph E R S Q C request generators multiplication ↔ + d ∈ tileStarDartCarrier E R S ∧ v ∈ tileStarVertexCarrier Q E R ∧ + TileStarSourceEntry E R S Q (tileStarEdgeCarrier E R S) C request generators multiplication d v := by + rw [tileStarSourceGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, d', hd, v', hv, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hd, hv, entry⟩ + · rintro ⟨hd, hv, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, d, hd, v, hv, rfl, entry⟩ + +theorem pair_mem_tileStarReverseGraph (E R S d v : ZFSet.{u}) : + ZFSet.pair d v ∈ tileStarReverseGraph E R S ↔ + d ∈ tileStarDartCarrier E R S ∧ v ∈ tileStarDartCarrier E R S ∧ + TileStarReverseEntry (tileStarEdgeCarrier E R S) d v := by + rw [tileStarReverseGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, d', hd, v', hv, equal, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hd, hv, entry⟩ + · rintro ⟨hd, hv, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, d, hd, v, hv, rfl, entry⟩ + +namespace BoundedFormula + +def tileStarSourceFormula {n} (E R S Q Edges C request generators multiplication d v zero one : Fin n) : BoundedFormula n := + (exMem Edges (disj (exMem E.succ (exMem R.succ.succ (.conj (orderedRightTripleFormula 2 zero.succ.succ.succ 1 0) (disj (.conj (orderedPairFormula d.succ.succ.succ 2 one.succ.succ.succ) (exMem Q.succ.succ.succ (.conj (pairMembershipFormula 2 0 C.succ.succ.succ.succ) (orderedPairFormula v.succ.succ.succ.succ zero.succ.succ.succ.succ 0)))) (.conj (orderedPairFormula d.succ.succ.succ 2 zero.succ.succ.succ) (orderedRightTripleFormula v.succ.succ.succ one.succ.succ.succ 1 0)))))) (exMem E.succ (exMem S.succ.succ (.conj (orderedRightTripleFormula 2 one.succ.succ.succ 1 0) (disj (.conj (orderedPairFormula d.succ.succ.succ 2 one.succ.succ.succ) (exMem R.succ.succ.succ (.conj (pairMembershipFormula 1 0 request.succ.succ.succ.succ) (orderedRightTripleFormula v.succ.succ.succ.succ one.succ.succ.succ.succ 2 0)))) (.conj (orderedPairFormula d.succ.succ.succ 2 zero.succ.succ.succ) (exMem E.succ.succ.succ (exMem E.succ.succ.succ.succ (exMem Q.succ.succ.succ.succ.succ (.conj (pairMembershipFormula 3 2 generators.succ.succ.succ.succ.succ.succ) (.conj (tripleMembershipFormula 4 2 1 multiplication.succ.succ.succ.succ.succ.succ) (.conj (pairMembershipFormula 1 0 C.succ.succ.succ.succ.succ.succ) (orderedPairFormula v.succ.succ.succ.succ.succ.succ zero.succ.succ.succ.succ.succ.succ 0)))))))))))))) + +theorem truth_tileStarSourceFormula {n} (E R S Q Edges C request generators multiplication d v zero one : Fin n) + (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : + Truth (tileStarSourceFormula E R S Q Edges C request generators multiplication d v zero one) env ↔ + TileStarSourceEntry (env E) (env R) (env S) (env Q) (env Edges) (env C) + (env request) (env generators) (env multiplication) (env d) (env v) := by + simp only [tileStarSourceFormula, Truth, truth_disj, truth_exMem, truth_orderedPairFormula, + truth_orderedRightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula] + unfold TileStarSourceEntry + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [hz, ho] + rfl + +def tileStarReverseFormula {n} (Edges d v zero one : Fin n) : BoundedFormula n := + (exMem Edges (disj (.conj (orderedPairFormula d.succ 0 zero.succ) (orderedPairFormula v.succ 0 one.succ)) (.conj (orderedPairFormula d.succ 0 one.succ) (orderedPairFormula v.succ 0 zero.succ)))) + +theorem truth_tileStarReverseFormula {n} (Edges d v zero one : Fin n) (env : Fin n → ZFSet.{u}) + (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : + Truth (tileStarReverseFormula Edges d v zero one) env ↔ TileStarReverseEntry (env Edges) (env d) (env v) := by + simp only [tileStarReverseFormula, Truth, truth_disj, truth_exMem, truth_orderedPairFormula] + unfold TileStarReverseEntry + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [hz, ho] + +def tileStarSourceEntryFormula {n} (z D V E R S Q Edges C request generators multiplication zero one : Fin n) : BoundedFormula n := + exMem D (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (tileStarSourceFormula E.succ.succ R.succ.succ S.succ.succ Q.succ.succ Edges.succ.succ C.succ.succ request.succ.succ generators.succ.succ multiplication.succ.succ 1 0 zero.succ.succ one.succ.succ))) + +theorem truth_tileStarSourceEntryFormula {n} (z D V E R S Q Edges C request generators multiplication zero one : Fin n) + (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : + Truth (tileStarSourceEntryFormula z D V E R S Q Edges C request generators multiplication zero one) env ↔ + ∃ d ∈ env D, ∃ v ∈ env V, env z = ZFSet.pair d v ∧ + TileStarSourceEntry (env E) (env R) (env S) (env Q) (env Edges) (env C) (env request) (env generators) (env multiplication) d v := by + simp only [tileStarSourceEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + apply exists_congr + intro d + apply and_congr_right + intro _ + apply exists_congr + intro v + apply and_congr_right + intro _ + exact and_congr Iff.rfl (truth_tileStarSourceFormula E.succ.succ R.succ.succ S.succ.succ Q.succ.succ Edges.succ.succ C.succ.succ request.succ.succ generators.succ.succ multiplication.succ.succ 1 0 + zero.succ.succ one.succ.succ _ hz ho) + +def tileStarReverseEntryFormula {n} (z D V Edges zero one : Fin n) : BoundedFormula n := + exMem D (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (tileStarReverseFormula Edges.succ.succ 1 0 zero.succ.succ one.succ.succ))) + +theorem truth_tileStarReverseEntryFormula {n} (z D V Edges zero one : Fin n) + (env : Fin n → ZFSet.{u}) (hz : env zero = natSetCode 0) (ho : env one = natSetCode 1) : + Truth (tileStarReverseEntryFormula z D V Edges zero one) env ↔ + ∃ d ∈ env D, ∃ v ∈ env V, env z = ZFSet.pair d v ∧ + TileStarReverseEntry (env Edges) d v := by + simp only [tileStarReverseEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + apply exists_congr + intro d + apply and_congr_right + intro _ + apply exists_congr + intro v + apply and_congr_right + intro _ + exact and_congr Iff.rfl (truth_tileStarReverseFormula Edges.succ.succ 1 0 + zero.succ.succ one.succ.succ _ hz ho) + +end BoundedFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +include pairing unions powers separation in +theorem tileStarSourceGraph_mem {E R S Q C request generators multiplication : ZFSet.{u}} + (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) (hrequest : request ∈ M.sets) (hgenerators : generators ∈ M.sets) (hmultiplication : multiplication ∈ M.sets) : + tileStarSourceGraph E R S Q C request generators multiplication ∈ M.sets := by + have hzero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨E, hE⟩ + have hone : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hzero hzero + have carriers := M.tileStarCarriers_mem pairing unions powers separation hQ hE hR hS + have hD := carriers.2.2 + have hV := carriers.1 + have hEdges := carriers.2.1 + let params := extend (tileStarDartCarrier E R S) (extend (tileStarVertexCarrier Q E R) (extend (E) (extend (R) (extend (S) (extend (Q) (extend (tileStarEdgeCarrier E R S) (extend (C) (extend (request) (extend (generators) (extend (multiplication) (extend (natSetCode 0) (extend (natSetCode 1) (Fin.elim0))))))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.tileStarSourceEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13) params + (Fin.cases hD (Fin.cases hV (Fin.cases hE (Fin.cases hR (Fin.cases hS (Fin.cases hQ (Fin.cases hEdges (Fin.cases hC (Fin.cases hrequest (Fin.cases hgenerators (Fin.cases hmultiplication (Fin.cases hzero (Fin.cases hone (fun i => Fin.elim0 i)))))))))))))) (M.prod_mem pairing unions powers separation hD hV) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.tileStarSourceEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13) (extend z params)) + (ZFSet.prod (tileStarDartCarrier E R S) (tileStarVertexCarrier Q E R)) = tileStarSourceGraph E R S Q C request generators multiplication := by + apply ZFSet.ext + intro z + rw [tileStarSourceGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_tileStarSourceEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12 13 _ rfl rfl) + exact equal ▸ selected + +include pairing unions powers separation in +theorem tileStarReverseGraph_mem {E R S : ZFSet.{u}} + (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) : + tileStarReverseGraph E R S ∈ M.sets := by + have hzero : natSetCode 0 ∈ M.sets := M.empty_mem ⟨E, hE⟩ + have hone : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions hzero hzero + have carriers := M.tileStarCarriers_mem pairing unions powers separation hE hE hR hS + have hD := carriers.2.2 + have hV := carriers.2.2 + have hEdges := carriers.2.1 + let params := extend (tileStarDartCarrier E R S) (extend (tileStarDartCarrier E R S) (extend (tileStarEdgeCarrier E R S) (extend (natSetCode 0) (extend (natSetCode 1) (Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.tileStarReverseEntryFormula 0 1 2 3 4 5) params + (Fin.cases hD (Fin.cases hV (Fin.cases hEdges (Fin.cases hzero (Fin.cases hone (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hD hV) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.tileStarReverseEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod (tileStarDartCarrier E R S) (tileStarDartCarrier E R S)) = tileStarReverseGraph E R S := by + apply ZFSet.ext + intro z + rw [tileStarReverseGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_tileStarReverseEntryFormula 0 1 2 3 4 5 _ rfl rfl) + exact equal ▸ selected + +include pairing unions powers separation in +theorem tileStarTargetGraph_mem {E R S Q C request generators multiplication : ZFSet.{u}} + (hE : E ∈ M.sets) (hR : R ∈ M.sets) (hS : S ∈ M.sets) (hQ : Q ∈ M.sets) + (hC : C ∈ M.sets) (hrequest : request ∈ M.sets) (hgenerators : generators ∈ M.sets) + (hmultiplication : multiplication ∈ M.sets) : + tileStarTargetGraph E R S Q C request generators multiplication ∈ M.sets := by + have carriers := M.tileStarCarriers_mem pairing unions powers separation hQ hE hR hS + exact M.relationCompose_mem pairing unions powers separation carriers.2.2 carriers.2.2 carriers.1 + (M.tileStarReverseGraph_mem pairing unions powers separation hE hR hS) + (M.tileStarSourceGraph_mem pairing unions powers separation hE hR hS hQ hC hrequest hgenerators hmultiplication) + +include pairing unions in +theorem dartIncidenceGraph_mem {source target : ZFSet.{u}} + (hs : source ∈ M.sets) (ht : target ∈ M.sets) : dartIncidenceGraph source target ∈ M.sets := + M.binary_union_mem pairing unions hs ht + +include pairing unions powers separation in +theorem dartAdjacencyGraph_mem {D V source target : ZFSet.{u}} + (hD : D ∈ M.sets) (hV : V ∈ M.sets) (hs : source ∈ M.sets) (ht : target ∈ M.sets) : + dartAdjacencyGraph D V source target ∈ M.sets := + M.relationCompose_mem pairing unions powers separation hV hD hV + (M.relationConverse_mem pairing unions powers separation hD hV hs) ht + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTwoPointHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTwoPointHeights.lean index 5a29beccd3e66191ce8c1d146081311133d37dfb..bf76d37b4c200f7c2feb8e67e76978fe9f7d98d4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTwoPointHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundTwoPointHeights.lean @@ -1,131 +1,131 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def twoPointHeight (a b c d0 d1 : ZFSet.{u}) : ZFSet.{u} := - {ZFSet.pair a (ZFSet.pair c d0), ZFSet.pair b (ZFSet.pair c d1)} - -theorem twoPointHeight_entry (a b c d0 d1 x y : ZFSet.{u}) : - ZFSet.pair x y ∈ twoPointHeight a b c d0 d1 ↔ - (x = a ∧ y = ZFSet.pair c d0) ∨ (x = b ∧ y = ZFSet.pair c d1) := by - simp only [twoPointHeight, ZFSet.mem_pair, ZFSet.pair_inj] - -theorem twoPointHeight_function {a b c d0 d1 C D : ZFSet.{u}} - (different : a ≠ b) (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) : - ZFSet.IsFunc {a, b} (ZFSet.prod C D) (twoPointHeight a b c d0 d1) := by - constructor - · intro z hz - rcases ZFSet.mem_pair.1 hz with rfl | rfl - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_pair.2 (Or.inl rfl), ZFSet.pair_mem_prod.2 ⟨hc, h0⟩⟩ - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_pair.2 (Or.inr rfl), ZFSet.pair_mem_prod.2 ⟨hc, h1⟩⟩ - · intro x hx - rcases ZFSet.mem_pair.1 hx with hx | hx - · subst x - refine ⟨ZFSet.pair c d0, ZFSet.mem_pair.2 (Or.inl rfl), ?_⟩ - intro y hy - rcases (twoPointHeight_entry a b c d0 d1 a y).1 hy with ⟨_, equal⟩ | ⟨bad, _⟩ - · exact equal - · exact False.elim (different bad) - · subst x - refine ⟨ZFSet.pair c d1, ZFSet.mem_pair.2 (Or.inr rfl), ?_⟩ - intro y hy - rcases (twoPointHeight_entry a b c d0 d1 b y).1 hy with ⟨bad, _⟩ | ⟨_, equal⟩ - · exact False.elim (different bad.symm) - · exact equal - -theorem twoPointHeight_strict {a b c d0 d1 C D rD : ZFSet.{u}} - (different : a ≠ b) (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) - (gap : ZFSet.pair d0 d1 ∈ rD) : - StrictLexHeightCode {a, b} C D - {ZFSet.pair a a, ZFSet.pair a b, ZFSet.pair b b} (twoPointHeight a b c d0 d1) rD := by - refine ⟨twoPointHeight_function different hc h0 h1, ?_⟩ - intro x _ y _ c' q d' v ordered ne hx hy - have endpoints : x = a ∧ y = b := by - simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj] at ordered - rcases ordered with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ - · exact False.elim (ne rfl) - · exact ⟨rfl, rfl⟩ - · exact False.elim (ne rfl) - obtain ⟨hxEq, hyEq⟩ := endpoints - subst x y - have first : ZFSet.pair c' q = ZFSet.pair c d0 := by - rcases (twoPointHeight_entry a b c d0 d1 a _).1 hx with ⟨_, h⟩ | ⟨bad, _⟩ - · exact h - · exact False.elim (different bad) - have second : ZFSet.pair d' v = ZFSet.pair c d1 := by - rcases (twoPointHeight_entry a b c d0 d1 b _).1 hy with ⟨bad, _⟩ | ⟨_, h⟩ - · exact False.elim (different bad.symm) - · exact h - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second - exact Or.inr ⟨rfl, gap⟩ - -theorem twoPointHeight_image {a b c d0 d1 C D : ZFSet.{u}} - (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) : - relationImage {a, b} (ZFSet.prod C D) (twoPointHeight a b c d0 d1) = - {ZFSet.pair c d0, ZFSet.pair c d1} := by - apply ZFSet.ext - intro y - rw [mem_relationImage, ZFSet.mem_pair] - constructor - · rintro ⟨_, x, _, entry⟩ - exact ((twoPointHeight_entry a b c d0 d1 x y).1 entry).elim - (fun h => Or.inl h.2) (fun h => Or.inr h.2) - · rintro (rfl | rfl) - · exact ⟨ZFSet.pair_mem_prod.2 ⟨hc, h0⟩, a, ZFSet.mem_pair.2 (Or.inl rfl), - ZFSet.mem_pair.2 (Or.inl rfl)⟩ - · exact ⟨ZFSet.pair_mem_prod.2 ⟨hc, h1⟩, b, ZFSet.mem_pair.2 (Or.inr rfl), - ZFSet.mem_pair.2 (Or.inr rfl)⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem twoPointHeight_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {a b c d0 d1 : ZFSet.{u}} (ha : a ∈ M.sets) (hb : b ∈ M.sets) - (hc : c ∈ M.sets) (h0 : d0 ∈ M.sets) (h1 : d1 ∈ M.sets) : - twoPointHeight a b c d0 d1 ∈ M.sets := - M.unorderedPair_mem pairing (M.orderedPair_mem pairing ha (M.orderedPair_mem pairing hc h0)) - (M.orderedPair_mem pairing hb (M.orderedPair_mem pairing hc h1)) - -theorem unorderedPair_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {a b : ZFSet.{u}} (ha : a ∈ M.sets) (hb : b ∈ M.sets) : - M.groundEmbeddable ({a, b} : ZFSet.{u}) ZFSet.omega := by - have nonempty : M.sets.Nonempty := ⟨a, ha⟩ - have zero := M.empty_mem nonempty - have single := M.groundEmbeddable_insert pairing unions powers separation infinite zero hb - (M.empty_groundEmbeddable ZFSet.omega nonempty) - exact M.groundEmbeddable_insert pairing unions powers separation infinite - (M.insert_mem pairing unions hb zero) ha single - -theorem twoPointHeight_range_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {a b c d0 d1 C D : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) : - M.groundEmbeddable (relationImage {a, b} (ZFSet.prod C D) - (twoPointHeight a b c d0 d1)) ZFSet.omega := by - rw [twoPointHeight_image hc h0 h1] - exact M.unorderedPair_countable pairing unions powers separation infinite - (M.orderedPair_mem pairing (M.transitive hC hc) (M.transitive hD h0)) - (M.orderedPair_mem pairing (M.transitive hC hc) (M.transitive hD h1)) - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def twoPointHeight (a b c d0 d1 : ZFSet.{u}) : ZFSet.{u} := + {ZFSet.pair a (ZFSet.pair c d0), ZFSet.pair b (ZFSet.pair c d1)} + +theorem twoPointHeight_entry (a b c d0 d1 x y : ZFSet.{u}) : + ZFSet.pair x y ∈ twoPointHeight a b c d0 d1 ↔ + (x = a ∧ y = ZFSet.pair c d0) ∨ (x = b ∧ y = ZFSet.pair c d1) := by + simp only [twoPointHeight, ZFSet.mem_pair, ZFSet.pair_inj] + +theorem twoPointHeight_function {a b c d0 d1 C D : ZFSet.{u}} + (different : a ≠ b) (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) : + ZFSet.IsFunc {a, b} (ZFSet.prod C D) (twoPointHeight a b c d0 d1) := by + constructor + · intro z hz + rcases ZFSet.mem_pair.1 hz with rfl | rfl + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_pair.2 (Or.inl rfl), ZFSet.pair_mem_prod.2 ⟨hc, h0⟩⟩ + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_pair.2 (Or.inr rfl), ZFSet.pair_mem_prod.2 ⟨hc, h1⟩⟩ + · intro x hx + rcases ZFSet.mem_pair.1 hx with hx | hx + · subst x + refine ⟨ZFSet.pair c d0, ZFSet.mem_pair.2 (Or.inl rfl), ?_⟩ + intro y hy + rcases (twoPointHeight_entry a b c d0 d1 a y).1 hy with ⟨_, equal⟩ | ⟨bad, _⟩ + · exact equal + · exact False.elim (different bad) + · subst x + refine ⟨ZFSet.pair c d1, ZFSet.mem_pair.2 (Or.inr rfl), ?_⟩ + intro y hy + rcases (twoPointHeight_entry a b c d0 d1 b y).1 hy with ⟨bad, _⟩ | ⟨_, equal⟩ + · exact False.elim (different bad.symm) + · exact equal + +theorem twoPointHeight_strict {a b c d0 d1 C D rD : ZFSet.{u}} + (different : a ≠ b) (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) + (gap : ZFSet.pair d0 d1 ∈ rD) : + StrictLexHeightCode {a, b} C D + {ZFSet.pair a a, ZFSet.pair a b, ZFSet.pair b b} (twoPointHeight a b c d0 d1) rD := by + refine ⟨twoPointHeight_function different hc h0 h1, ?_⟩ + intro x _ y _ c' q d' v ordered ne hx hy + have endpoints : x = a ∧ y = b := by + simp only [ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj] at ordered + rcases ordered with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ + · exact False.elim (ne rfl) + · exact ⟨rfl, rfl⟩ + · exact False.elim (ne rfl) + obtain ⟨hxEq, hyEq⟩ := endpoints + subst x y + have first : ZFSet.pair c' q = ZFSet.pair c d0 := by + rcases (twoPointHeight_entry a b c d0 d1 a _).1 hx with ⟨_, h⟩ | ⟨bad, _⟩ + · exact h + · exact False.elim (different bad) + have second : ZFSet.pair d' v = ZFSet.pair c d1 := by + rcases (twoPointHeight_entry a b c d0 d1 b _).1 hy with ⟨bad, _⟩ | ⟨_, h⟩ + · exact False.elim (different bad.symm) + · exact h + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 second + exact Or.inr ⟨rfl, gap⟩ + +theorem twoPointHeight_image {a b c d0 d1 C D : ZFSet.{u}} + (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) : + relationImage {a, b} (ZFSet.prod C D) (twoPointHeight a b c d0 d1) = + {ZFSet.pair c d0, ZFSet.pair c d1} := by + apply ZFSet.ext + intro y + rw [mem_relationImage, ZFSet.mem_pair] + constructor + · rintro ⟨_, x, _, entry⟩ + exact ((twoPointHeight_entry a b c d0 d1 x y).1 entry).elim + (fun h => Or.inl h.2) (fun h => Or.inr h.2) + · rintro (rfl | rfl) + · exact ⟨ZFSet.pair_mem_prod.2 ⟨hc, h0⟩, a, ZFSet.mem_pair.2 (Or.inl rfl), + ZFSet.mem_pair.2 (Or.inl rfl)⟩ + · exact ⟨ZFSet.pair_mem_prod.2 ⟨hc, h1⟩, b, ZFSet.mem_pair.2 (Or.inr rfl), + ZFSet.mem_pair.2 (Or.inr rfl)⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem twoPointHeight_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {a b c d0 d1 : ZFSet.{u}} (ha : a ∈ M.sets) (hb : b ∈ M.sets) + (hc : c ∈ M.sets) (h0 : d0 ∈ M.sets) (h1 : d1 ∈ M.sets) : + twoPointHeight a b c d0 d1 ∈ M.sets := + M.unorderedPair_mem pairing (M.orderedPair_mem pairing ha (M.orderedPair_mem pairing hc h0)) + (M.orderedPair_mem pairing hb (M.orderedPair_mem pairing hc h1)) + +theorem unorderedPair_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {a b : ZFSet.{u}} (ha : a ∈ M.sets) (hb : b ∈ M.sets) : + M.groundEmbeddable ({a, b} : ZFSet.{u}) ZFSet.omega := by + have nonempty : M.sets.Nonempty := ⟨a, ha⟩ + have zero := M.empty_mem nonempty + have single := M.groundEmbeddable_insert pairing unions powers separation infinite zero hb + (M.empty_groundEmbeddable ZFSet.omega nonempty) + exact M.groundEmbeddable_insert pairing unions powers separation infinite + (M.insert_mem pairing unions hb zero) ha single + +theorem twoPointHeight_range_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {a b c d0 d1 C D : ZFSet.{u}} (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) : + M.groundEmbeddable (relationImage {a, b} (ZFSet.prod C D) + (twoPointHeight a b c d0 d1)) ZFSet.omega := by + rw [twoPointHeight_image hc h0 h1] + exact M.unorderedPair_countable pairing unions powers separation infinite + (M.orderedPair_mem pairing (M.transitive hC hc) (M.transitive hD h0)) + (M.orderedPair_mem pairing (M.transitive hC hc) (M.transitive hD h1)) + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundUnionInterpretation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundUnionInterpretation.lean index db5c52d1f6414f79a72a2d7f79cbaab33430e6b7..c6132c03bc261ca30e96bc4de44ed69f41e2d7ac 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundUnionInterpretation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundUnionInterpretation.lean @@ -1,67 +1,67 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionGenericity - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) -variable {G : Type v} [Group G] (a : PosetAction G P) (F : NormalSubgroupFamily G) - -def basicFragment : SetFormula 0 := - .conj extensionality (.conj foundation (.conj emptySet pairing)) - -theorem symmetric_values_countable (small : M.sets.Countable) (H : Set P) : - ((a.symmetricDomain s (M.nameDomain s) F).values H).Countable := by - let : Countable (a.symmetricDomain s (M.nameDomain s) F).names := - M.symmetric_names_countable s a F small - exact Set.countable_range (fun τ : (a.symmetricDomain s (M.nameDomain s) F).names => - Name.eval H τ.val) - -theorem exists_basic_interpretation [OrderTop P] - (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ - Realize ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) - basicFragment Fin.elim0 := by - obtain ⟨H, hp, ground, ordinary, symmetric⟩ := M.exists_joint_generic s a F small carrier p - refine ⟨H, hp, ground, ordinary, symmetric, ?_⟩ - have nonempty := a.symmetricDomain_nonempty s (M.nameDomain s) F - (M.nameDomain_nonempty s ⟨s.carrier, carrier⟩) - exact ⟨realize_extensionality _ _, realize_foundation _ _, - realize_emptySet _ nonempty _, M.symmetric_pairing s a F pairing carrier H⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) {G : Type v} [Group G] -variable (a : PosetAction G P) (F : NormalSubgroupFamily G) - -theorem exists_union_interpretation - (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) (p : P) : - ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ - Realize ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) - (.conj basicFragment SetFormula.union) Fin.elim0 := by - obtain ⟨H, hp, ground, ordinary, symmetric, basic⟩ := - M.exists_basic_interpretation s a F small carrier pairing p - exact ⟨H, hp, ground, ordinary, symmetric, basic, - M.symmetric_union s a F pairing unions powers separation carrier order H⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompleteProjectionGenericity + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] (s : Presentation P) +variable {G : Type v} [Group G] (a : PosetAction G P) (F : NormalSubgroupFamily G) + +def basicFragment : SetFormula 0 := + .conj extensionality (.conj foundation (.conj emptySet pairing)) + +theorem symmetric_values_countable (small : M.sets.Countable) (H : Set P) : + ((a.symmetricDomain s (M.nameDomain s) F).values H).Countable := by + let : Countable (a.symmetricDomain s (M.nameDomain s) F).names := + M.symmetric_names_countable s a F small + exact Set.countable_range (fun τ : (a.symmetricDomain s (M.nameDomain s) F).names => + Name.eval H τ.val) + +theorem exists_basic_interpretation [OrderTop P] + (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ + Realize ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) + basicFragment Fin.elim0 := by + obtain ⟨H, hp, ground, ordinary, symmetric⟩ := M.exists_joint_generic s a F small carrier p + refine ⟨H, hp, ground, ordinary, symmetric, ?_⟩ + have nonempty := a.symmetricDomain_nonempty s (M.nameDomain s) F + (M.nameDomain_nonempty s ⟨s.carrier, carrier⟩) + exact ⟨realize_extensionality _ _, realize_foundation _ _, + realize_emptySet _ nonempty _, M.symmetric_pairing s a F pairing carrier H⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) {G : Type v} [Group G] +variable (a : PosetAction G P) (F : NormalSubgroupFamily G) + +theorem exists_union_interpretation + (small : M.sets.Countable) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) (p : P) : + ∃ H : ConditionFilter P, H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (a.symmetricDomain s (M.nameDomain s) F)) ∧ + Realize ((a.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) + (.conj basicFragment SetFormula.union) Fin.elim0 := by + obtain ⟨H, hp, ground, ordinary, symmetric, basic⟩ := + M.exists_basic_interpretation s a F small carrier pairing p + exact ⟨H, hp, ground, ordinary, symmetric, basic, + M.symmetric_union s a F pairing unions powers separation carrier order H⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundVisibilitySupportIncidence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundVisibilitySupportIncidence.lean index 3395fbfbcac55a0fb93dc75adc97616ff661605f..ccd5c852783896ec276ad2e85c80897bf2ba41d4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundVisibilitySupportIncidence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GroundVisibilitySupportIncidence.lean @@ -1,181 +1,181 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def visibilitySupportIncidence - (nodes names visibility top : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ v tau, z = ZFSet.pair v tau ∧ - ∃ V, ZFSet.pair v V ∈ visibility ∧ ZFSet.pair tau top ∈ V) - (ZFSet.prod nodes names) - -theorem mem_visibilitySupportIncidence - (nodes names visibility top z : ZFSet.{u}) : - z ∈ visibilitySupportIncidence nodes names visibility top ↔ - ∃ v ∈ nodes, ∃ tau ∈ names, z = ZFSet.pair v tau ∧ - ∃ V, ZFSet.pair v V ∈ visibility ∧ ZFSet.pair tau top ∈ V := by - rw [visibilitySupportIncidence, ZFSet.mem_sep] - constructor - · rintro ⟨bound, v, tau, rfl, V, entry, member⟩ - exact ⟨v, (ZFSet.pair_mem_prod.1 bound).1, - tau, (ZFSet.pair_mem_prod.1 bound).2, rfl, V, entry, member⟩ - · rintro ⟨v, hv, tau, htau, rfl, V, entry, member⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, htau⟩, v, tau, rfl, V, entry, member⟩ - -theorem pair_mem_visibilitySupportIncidence - (nodes names visibility top v tau : ZFSet.{u}) : - ZFSet.pair v tau ∈ visibilitySupportIncidence nodes names visibility top ↔ - v ∈ nodes ∧ tau ∈ names ∧ - ∃ V, ZFSet.pair v V ∈ visibility ∧ ZFSet.pair tau top ∈ V := by - rw [mem_visibilitySupportIncidence] - constructor - · rintro ⟨v', hv, tau', htau, equal, witness⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hv, htau, witness⟩ - · rintro ⟨hv, htau, witness⟩ - exact ⟨v, hv, tau, htau, rfl, witness⟩ - -namespace BoundedFormula - -def visibilitySupportIncidenceFormula {n} - (entry nodes names visibility top : Fin n) : BoundedFormula n := - exPairFields entry - (.conj (.mem 1 nodes.succ.succ) - (.conj (.mem 0 names.succ.succ) - (exGraphFields visibility.succ.succ - (.conj (.equal 1 3) - (pairMembershipFormula 2 top.succ.succ.succ.succ 0))))) - -theorem truth_visibilitySupportIncidenceFormula {n} - (entry nodes names visibility top : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (visibilitySupportIncidenceFormula entry nodes names visibility top) env ↔ - env entry ∈ visibilitySupportIncidence (env nodes) (env names) - (env visibility) (env top) := by - simp only [visibilitySupportIncidenceFormula, truth_exPairFields, Truth, - truth_exGraphFields, truth_pairMembershipFormula] - rw [mem_visibilitySupportIncidence] - change (∃ v tau, env entry = ZFSet.pair v tau ∧ v ∈ env nodes ∧ - tau ∈ env names ∧ ∃ v' V, ZFSet.pair v' V ∈ env visibility ∧ - v' = v ∧ ZFSet.pair tau (env top) ∈ V) ↔ _ - constructor - · rintro ⟨v, tau, equal, hv, htau, v', V, edge, rfl, member⟩ - exact ⟨v', hv, tau, htau, equal, V, edge, member⟩ - · rintro ⟨v, hv, tau, htau, equal, V, edge, member⟩ - exact ⟨v, tau, equal, hv, htau, v, V, edge, rfl, member⟩ - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula -open SetFormula -universe u - -def visibilitySupportAt {n} (node tau nodes names visibility top : Fin n) : BoundedFormula n := - .conj (.mem node nodes) (.conj (.mem tau names) - (exGraphFields visibility (.conj (.equal 1 node.succ.succ) - (pairMembershipFormula tau.succ.succ top.succ.succ 0)))) - -theorem truth_visibilitySupportAt {n} (node tau nodes names visibility top : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (visibilitySupportAt node tau nodes names visibility top) env ↔ - ZFSet.pair (env node) (env tau) ∈ visibilitySupportIncidence - (env nodes) (env names) (env visibility) (env top) := by - simp only [visibilitySupportAt, Truth, truth_exGraphFields, truth_pairMembershipFormula] - rw [pair_mem_visibilitySupportIncidence] - change (env node ∈ env nodes ∧ env tau ∈ env names ∧ - ∃ v V, ZFSet.pair v V ∈ env visibility ∧ v = env node ∧ - ZFSet.pair (env tau) (env top) ∈ V) ↔ _ - apply and_congr_right - intro _ - apply and_congr_right - intro _ - constructor - · rintro ⟨v, V, edge, rfl, member⟩ - exact ⟨V, edge, member⟩ - · rintro ⟨V, edge, member⟩ - exact ⟨env node, V, edge, rfl, member⟩ - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem visibilitySupportIncidence_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {nodes names visibility top : ZFSet.{u}} - (hNodes : nodes ∈ M.sets) (hNames : names ∈ M.sets) - (hVisibility : visibility ∈ M.sets) (hTop : top ∈ M.sets) : - visibilitySupportIncidence nodes names visibility top ∈ M.sets := by - let params := extend nodes (extend names (extend visibility (extend top Fin.elim0))) - have ground := M.bounded_separation_mem separation - (BoundedFormula.visibilitySupportIncidenceFormula 0 1 2 3 4) params - (Fin.cases hNodes (Fin.cases hNames (Fin.cases hVisibility - (Fin.cases hTop (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation hNodes hNames) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.visibilitySupportIncidenceFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod nodes names) = visibilitySupportIncidence nodes names visibility top := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_visibilitySupportIncidenceFormula] - exact and_iff_right_of_imp (fun member => (ZFSet.mem_sep.1 member).1) - exact equal ▸ ground - -variable {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) -variable (T : ZFSet.{u}) (K : I → Subgroup G) - -theorem visibilitySupportIncidence_candidates (v : I) (tau : ZFSet.{u}) : - ZFSet.pair (b.encode v) tau ∈ visibilitySupportIncidence b.carrier - (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T K) (s.encode ⊤) ↔ - tau ∈ M.sets ∧ NiceNameCode a s T (K v) tau := by - rw [pair_mem_visibilitySupportIncidence] - constructor - · rintro ⟨_, _, V, entry, member⟩ - have equal := (M.pair_mem_niceVisibilityGraph a s b T K v V).1 entry - rw [equal, M.niceVisibilityName_code] at member - exact (M.mem_niceNameCandidates a s T (K v) tau).1 - (ZFSet.pair_mem_prod.1 member).1 - · intro code - have member := (M.mem_niceNameCandidates a s T (K v) tau).2 code - refine ⟨b.encode_mem v, M.niceNameCandidates_subset a s T (K v) member, - (M.niceVisibilityName a s T (K v)).val, - (M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl, ?_⟩ - rw [M.niceVisibilityName_code] - exact ZFSet.pair_mem_prod.2 ⟨member, ZFSet.mem_singleton.2 rfl⟩ - -theorem visibilitySupportIncidence_eq_niceSupportRelation : - visibilitySupportIncidence b.carrier (M.groundRelations T s.carrier) - (M.niceVisibilityGraph a s b T K) (s.encode ⊤) = - M.niceSupportRelation a s b T K := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨v, hv, tau, _, rfl, _⟩ := - (mem_visibilitySupportIncidence _ _ _ _ z).1 member - obtain ⟨i, rfl⟩ := (b.mem_carrier v).1 hv - exact (M.pair_mem_niceSupportRelation a s b T K i tau).2 - ((M.visibilitySupportIncidence_candidates a s b T K i tau).1 member) - · intro member - obtain ⟨_, i, tau, rfl, _⟩ := ZFSet.mem_sep.1 member - exact (M.visibilitySupportIncidence_candidates a s b T K i tau).2 - ((M.pair_mem_niceSupportRelation a s b T K i tau).1 member) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def visibilitySupportIncidence + (nodes names visibility top : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ v tau, z = ZFSet.pair v tau ∧ + ∃ V, ZFSet.pair v V ∈ visibility ∧ ZFSet.pair tau top ∈ V) + (ZFSet.prod nodes names) + +theorem mem_visibilitySupportIncidence + (nodes names visibility top z : ZFSet.{u}) : + z ∈ visibilitySupportIncidence nodes names visibility top ↔ + ∃ v ∈ nodes, ∃ tau ∈ names, z = ZFSet.pair v tau ∧ + ∃ V, ZFSet.pair v V ∈ visibility ∧ ZFSet.pair tau top ∈ V := by + rw [visibilitySupportIncidence, ZFSet.mem_sep] + constructor + · rintro ⟨bound, v, tau, rfl, V, entry, member⟩ + exact ⟨v, (ZFSet.pair_mem_prod.1 bound).1, + tau, (ZFSet.pair_mem_prod.1 bound).2, rfl, V, entry, member⟩ + · rintro ⟨v, hv, tau, htau, rfl, V, entry, member⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, htau⟩, v, tau, rfl, V, entry, member⟩ + +theorem pair_mem_visibilitySupportIncidence + (nodes names visibility top v tau : ZFSet.{u}) : + ZFSet.pair v tau ∈ visibilitySupportIncidence nodes names visibility top ↔ + v ∈ nodes ∧ tau ∈ names ∧ + ∃ V, ZFSet.pair v V ∈ visibility ∧ ZFSet.pair tau top ∈ V := by + rw [mem_visibilitySupportIncidence] + constructor + · rintro ⟨v', hv, tau', htau, equal, witness⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hv, htau, witness⟩ + · rintro ⟨hv, htau, witness⟩ + exact ⟨v, hv, tau, htau, rfl, witness⟩ + +namespace BoundedFormula + +def visibilitySupportIncidenceFormula {n} + (entry nodes names visibility top : Fin n) : BoundedFormula n := + exPairFields entry + (.conj (.mem 1 nodes.succ.succ) + (.conj (.mem 0 names.succ.succ) + (exGraphFields visibility.succ.succ + (.conj (.equal 1 3) + (pairMembershipFormula 2 top.succ.succ.succ.succ 0))))) + +theorem truth_visibilitySupportIncidenceFormula {n} + (entry nodes names visibility top : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (visibilitySupportIncidenceFormula entry nodes names visibility top) env ↔ + env entry ∈ visibilitySupportIncidence (env nodes) (env names) + (env visibility) (env top) := by + simp only [visibilitySupportIncidenceFormula, truth_exPairFields, Truth, + truth_exGraphFields, truth_pairMembershipFormula] + rw [mem_visibilitySupportIncidence] + change (∃ v tau, env entry = ZFSet.pair v tau ∧ v ∈ env nodes ∧ + tau ∈ env names ∧ ∃ v' V, ZFSet.pair v' V ∈ env visibility ∧ + v' = v ∧ ZFSet.pair tau (env top) ∈ V) ↔ _ + constructor + · rintro ⟨v, tau, equal, hv, htau, v', V, edge, rfl, member⟩ + exact ⟨v', hv, tau, htau, equal, V, edge, member⟩ + · rintro ⟨v, hv, tau, htau, equal, V, edge, member⟩ + exact ⟨v, tau, equal, hv, htau, v, V, edge, rfl, member⟩ + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula +open SetFormula +universe u + +def visibilitySupportAt {n} (node tau nodes names visibility top : Fin n) : BoundedFormula n := + .conj (.mem node nodes) (.conj (.mem tau names) + (exGraphFields visibility (.conj (.equal 1 node.succ.succ) + (pairMembershipFormula tau.succ.succ top.succ.succ 0)))) + +theorem truth_visibilitySupportAt {n} (node tau nodes names visibility top : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (visibilitySupportAt node tau nodes names visibility top) env ↔ + ZFSet.pair (env node) (env tau) ∈ visibilitySupportIncidence + (env nodes) (env names) (env visibility) (env top) := by + simp only [visibilitySupportAt, Truth, truth_exGraphFields, truth_pairMembershipFormula] + rw [pair_mem_visibilitySupportIncidence] + change (env node ∈ env nodes ∧ env tau ∈ env names ∧ + ∃ v V, ZFSet.pair v V ∈ env visibility ∧ v = env node ∧ + ZFSet.pair (env tau) (env top) ∈ V) ↔ _ + apply and_congr_right + intro _ + apply and_congr_right + intro _ + constructor + · rintro ⟨v, V, edge, rfl, member⟩ + exact ⟨V, edge, member⟩ + · rintro ⟨V, edge, member⟩ + exact ⟨env node, V, edge, rfl, member⟩ + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem visibilitySupportIncidence_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {nodes names visibility top : ZFSet.{u}} + (hNodes : nodes ∈ M.sets) (hNames : names ∈ M.sets) + (hVisibility : visibility ∈ M.sets) (hTop : top ∈ M.sets) : + visibilitySupportIncidence nodes names visibility top ∈ M.sets := by + let params := extend nodes (extend names (extend visibility (extend top Fin.elim0))) + have ground := M.bounded_separation_mem separation + (BoundedFormula.visibilitySupportIncidenceFormula 0 1 2 3 4) params + (Fin.cases hNodes (Fin.cases hNames (Fin.cases hVisibility + (Fin.cases hTop (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation hNodes hNames) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.visibilitySupportIncidenceFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod nodes names) = visibilitySupportIncidence nodes names visibility top := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_visibilitySupportIncidenceFormula] + exact and_iff_right_of_imp (fun member => (ZFSet.mem_sep.1 member).1) + exact equal ▸ ground + +variable {I G P : Type u} [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation I) +variable (T : ZFSet.{u}) (K : I → Subgroup G) + +theorem visibilitySupportIncidence_candidates (v : I) (tau : ZFSet.{u}) : + ZFSet.pair (b.encode v) tau ∈ visibilitySupportIncidence b.carrier + (M.groundRelations T s.carrier) (M.niceVisibilityGraph a s b T K) (s.encode ⊤) ↔ + tau ∈ M.sets ∧ NiceNameCode a s T (K v) tau := by + rw [pair_mem_visibilitySupportIncidence] + constructor + · rintro ⟨_, _, V, entry, member⟩ + have equal := (M.pair_mem_niceVisibilityGraph a s b T K v V).1 entry + rw [equal, M.niceVisibilityName_code] at member + exact (M.mem_niceNameCandidates a s T (K v) tau).1 + (ZFSet.pair_mem_prod.1 member).1 + · intro code + have member := (M.mem_niceNameCandidates a s T (K v) tau).2 code + refine ⟨b.encode_mem v, M.niceNameCandidates_subset a s T (K v) member, + (M.niceVisibilityName a s T (K v)).val, + (M.pair_mem_niceVisibilityGraph a s b T K v _).2 rfl, ?_⟩ + rw [M.niceVisibilityName_code] + exact ZFSet.pair_mem_prod.2 ⟨member, ZFSet.mem_singleton.2 rfl⟩ + +theorem visibilitySupportIncidence_eq_niceSupportRelation : + visibilitySupportIncidence b.carrier (M.groundRelations T s.carrier) + (M.niceVisibilityGraph a s b T K) (s.encode ⊤) = + M.niceSupportRelation a s b T K := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨v, hv, tau, _, rfl, _⟩ := + (mem_visibilitySupportIncidence _ _ _ _ z).1 member + obtain ⟨i, rfl⟩ := (b.mem_carrier v).1 hv + exact (M.pair_mem_niceSupportRelation a s b T K i tau).2 + ((M.visibilitySupportIncidence_candidates a s b T K i tau).1 member) + · intro member + obtain ⟨_, i, tau, rfl, _⟩ := ZFSet.mem_sep.1 member + exact (M.visibilitySupportIncidence_candidates a s b T K i tau).2 + ((M.pair_mem_niceSupportRelation a s b T K i tau).1 member) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GrowthLayerSourceCongruence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GrowthLayerSourceCongruence.lean index 0fbcfad9193c92ea7112579d99824cc66641c062..763d02f00f477c7a921bd2bf2710b8788d535f76 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GrowthLayerSourceCongruence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/GrowthLayerSourceCongruence.lean @@ -1,184 +1,184 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterCopies - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround - -universe u -variable (M N : TransitiveGround.{u}) - -theorem groundEmbeddable_of_inclusion (includes : M.sets ⊆ N.sets) - {A B : ZFSet.{u}} (small : M.groundEmbeddable A B) : N.groundEmbeddable A B := by - obtain ⟨f, hf, injection⟩ := small - exact ⟨f, includes hf, injection⟩ - -end TransitiveGround - -section - -universe u - -inductive CodedGrowthLayer (M : TransitiveGround.{u}) - (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) - (L r μ birth t : ZFSet.{u}) : Type (u + 1) where - | countablePoints (D : ZFSet.{u}) (ground : D ∈ M.sets) - (small : M.groundEmbeddable D ZFSet.omega) - (cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → x ∈ D) - | copies (I parts : ZFSet.{u}) (groundI : I ∈ M.sets) - (small : M.groundEmbeddable I ZFSet.omega) (groundParts : parts ∈ M.sets) - (index e : ZFSet.{u} → ZFSet.{u}) (earlier : ∀ i ∈ I, index i ∈ t) - (groundCopy : ∀ i ∈ I, e i ∈ M.sets) - (embedding : ∀ i ∈ I, MeetEmbeddingCode (Space (index i)) L - (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i)) - (cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → ∃ i ∈ I, ZFSet.pair i x ∈ parts) - (inCopy : ∀ i ∈ I, ∀ x ∈ L, ZFSet.pair i x ∈ parts → - x ∈ relationImage (Space (index i)) L (e i)) - | separated (I : Type u) (index e : I → ZFSet.{u}) (earlier : ∀ i, index i ∈ t) - (groundCopy : ∀ i, e i ∈ M.sets) - (embedding : ∀ i, MeetEmbeddingCode (Space (index i)) L - (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i)) - (component : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} → I) - (cover : ∀ x : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth}, - x.val ∈ relationImage (Space (index (component x))) L (e (component x))) - (separation : ∀ x y : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth}, - component x ≠ component y → OldBridgeCode L r μ birth t x.val y.val) - -namespace CodedGrowthLayer - -open SetFormula - -theorem internal_countable_essentials - {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {L F T r μ birth t : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hL : L ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) - (hF : F ∈ M.sets) (hT : T ∈ M.sets) (ht : t ∈ M.sets) - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (born : ZFSet.IsFunc L T birth) - (earlier : ∀ s ∈ t, Space s ∈ M.sets ∧ - MeetOrderCode (Space s) (sourceOrder s) (sourceMeet s) ∧ - ∀ P ∈ M.sets, MeetFilterCode (Space s) (sourceOrder s) (sourceMeet s) P → - M.InternalCountableBelow (sourceOrder s) P P) : - M.InternalCountableBelow r F (essentialBirthFiber F T r birth t) := by - classical - have groundFiber := M.essentialBirthFiber_mem separation hF hT hr hBirth ht - have positive : essentialBirthFiber F T r birth t ⊆ F := - fun _ hx => birthEssentialSet_subset F T r birth - (essentialBirthFiber_subset F T r birth t hx) - have points : essentialBirthFiber F T r birth t ⊆ L := fun _ hx => filter.subset (positive hx) - cases layer with - | countablePoints D _ small cover => - have subset : essentialBirthFiber F T r birth t ⊆ D := by - intro x hx - exact cover x (points hx) ((mem_essentialBirthFiber F T r birth t x).1 hx).2.2 - have countableFiber := M.groundEmbeddable_restrict separation groundFiber - (M.omega_mem separation infinite) subset small - exact M.internalCountableBelow_of_countable groundFiber countableFiber positive - (fun x hx => meet.order.refl x (points hx)) - | copies I parts groundI small groundParts index e previous groundCopy embedding cover inCopy => - apply M.internalCountableBelow_indexed_union pairing unions powers separation infinite choice - groundI hr hF groundFiber groundParts small - · intro x hx - exact cover x (points hx) ((mem_essentialBirthFiber F T r birth t x).1 hx).2.2 - · intro i hi - obtain ⟨groundA, source, sourceBases⟩ := earlier (index i) (previous i hi) - have basis := M.internalCountableBelow_copy_of_all_filters pairing unions powers separation - infinite groundA hL (groundCopy i hi) hF source filter (embedding i hi) sourceBases - apply basis.mono - intro x hx - obtain ⟨hxFiber, part⟩ := (mem_relationFiber (essentialBirthFiber F T r birth t) parts i x).1 hx - exact ZFSet.mem_inter.2 ⟨positive hxFiber, inCopy i hi x (points hxFiber) part⟩ - | separated I index e previous groundCopy embedding component cover separated => - by_cases inhabited : (essentialBirthFiber F T r birth t).Nonempty - · obtain ⟨x, hx⟩ := inhabited - let representative : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} := - ⟨x, points hx, ((mem_essentialBirthFiber F T r birth t x).1 hx).2.2⟩ - let i := component representative - obtain ⟨groundA, source, sourceBases⟩ := earlier (index i) (previous i) - have basis := M.internalCountableBelow_copy_of_all_filters pairing unions powers separation - infinite groundA hL (groundCopy i) hF source filter (embedding i) sourceBases - apply basis.mono - intro y hy - let current : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} := - ⟨y, points hy, ((mem_essentialBirthFiber F T r birth t y).1 hy).2.2⟩ - have same : component current = i := by - by_contra different - exact birthEssentials_no_oldBridge meet filter born - (essentialBirthFiber_subset F T r birth t hy) - (essentialBirthFiber_subset F T r birth t hx) - current.property.2 representative.property.2 (separated current representative different) - have inside := cover current - rw [same] at inside - exact ZFSet.mem_inter.2 ⟨positive hy, inside⟩ - · have empty : essentialBirthFiber F T r birth t = ∅ := by - apply ZFSet.ext - intro x - exact ⟨fun hx => False.elim (inhabited ⟨x, hx⟩), - fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ - rw [empty] - exact M.internalCountableBelow_empty ⟨F, hF⟩ r F - -end CodedGrowthLayer - -end - -namespace CodedGrowthLayer - -universe u - -def of_inclusion {M N : TransitiveGround.{u}} - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {L r μ birth t : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) - (includes : M.sets ⊆ N.sets) : - CodedGrowthLayer N Space sourceOrder sourceMeet L r μ birth t := by - cases layer with - | countablePoints D ground small cover => - exact .countablePoints D (includes ground) - (M.groundEmbeddable_of_inclusion N includes small) cover - | copies I parts groundI small groundParts index e earlier groundCopy embedding cover inCopy => - exact .copies I parts (includes groundI) - (M.groundEmbeddable_of_inclusion N includes small) (includes groundParts) - index e earlier (fun i hi => includes (groundCopy i hi)) embedding cover inCopy - | separated I index e earlier groundCopy embedding component cover separated => - exact .separated I index e earlier (fun i => includes (groundCopy i)) - embedding component cover separated - -def congr_sources_below {M : TransitiveGround.{u}} - {Space sourceOrder sourceMeet Space' sourceOrder' sourceMeet' : ZFSet.{u} → ZFSet.{u}} - {L r μ birth t : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) - (spaces : ∀ s ∈ t, Space s = Space' s) - (orders : ∀ s ∈ t, sourceOrder s = sourceOrder' s) - (meets : ∀ s ∈ t, sourceMeet s = sourceMeet' s) : - CodedGrowthLayer M Space' sourceOrder' sourceMeet' L r μ birth t := by - cases layer with - | countablePoints D ground small cover => - exact .countablePoints D ground small cover - | copies I parts groundI small groundParts index e earlier groundCopy embedding cover inCopy => - refine .copies I parts groundI small groundParts index e earlier groundCopy ?_ cover ?_ - · intro i hi - simpa only [← spaces (index i) (earlier i hi), ← orders (index i) (earlier i hi), - ← meets (index i) (earlier i hi)] using embedding i hi - · intro i hi x hx entry - simpa only [← spaces (index i) (earlier i hi)] using inCopy i hi x hx entry - | separated I index e earlier groundCopy embedding component cover separation => - refine .separated I index e earlier groundCopy ?_ component ?_ separation - · intro i - simpa only [← spaces (index i) (earlier i), ← orders (index i) (earlier i), - ← meets (index i) (earlier i)] using embedding i - · intro x - simpa only [← spaces (index (component x)) (earlier (component x))] using cover x - -end CodedGrowthLayer - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterCopies + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround + +universe u +variable (M N : TransitiveGround.{u}) + +theorem groundEmbeddable_of_inclusion (includes : M.sets ⊆ N.sets) + {A B : ZFSet.{u}} (small : M.groundEmbeddable A B) : N.groundEmbeddable A B := by + obtain ⟨f, hf, injection⟩ := small + exact ⟨f, includes hf, injection⟩ + +end TransitiveGround + +section + +universe u + +inductive CodedGrowthLayer (M : TransitiveGround.{u}) + (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) + (L r μ birth t : ZFSet.{u}) : Type (u + 1) where + | countablePoints (D : ZFSet.{u}) (ground : D ∈ M.sets) + (small : M.groundEmbeddable D ZFSet.omega) + (cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → x ∈ D) + | copies (I parts : ZFSet.{u}) (groundI : I ∈ M.sets) + (small : M.groundEmbeddable I ZFSet.omega) (groundParts : parts ∈ M.sets) + (index e : ZFSet.{u} → ZFSet.{u}) (earlier : ∀ i ∈ I, index i ∈ t) + (groundCopy : ∀ i ∈ I, e i ∈ M.sets) + (embedding : ∀ i ∈ I, MeetEmbeddingCode (Space (index i)) L + (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i)) + (cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → ∃ i ∈ I, ZFSet.pair i x ∈ parts) + (inCopy : ∀ i ∈ I, ∀ x ∈ L, ZFSet.pair i x ∈ parts → + x ∈ relationImage (Space (index i)) L (e i)) + | separated (I : Type u) (index e : I → ZFSet.{u}) (earlier : ∀ i, index i ∈ t) + (groundCopy : ∀ i, e i ∈ M.sets) + (embedding : ∀ i, MeetEmbeddingCode (Space (index i)) L + (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i)) + (component : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} → I) + (cover : ∀ x : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth}, + x.val ∈ relationImage (Space (index (component x))) L (e (component x))) + (separation : ∀ x y : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth}, + component x ≠ component y → OldBridgeCode L r μ birth t x.val y.val) + +namespace CodedGrowthLayer + +open SetFormula + +theorem internal_countable_essentials + {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {L F T r μ birth t : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hL : L ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) + (hF : F ∈ M.sets) (hT : T ∈ M.sets) (ht : t ∈ M.sets) + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (born : ZFSet.IsFunc L T birth) + (earlier : ∀ s ∈ t, Space s ∈ M.sets ∧ + MeetOrderCode (Space s) (sourceOrder s) (sourceMeet s) ∧ + ∀ P ∈ M.sets, MeetFilterCode (Space s) (sourceOrder s) (sourceMeet s) P → + M.InternalCountableBelow (sourceOrder s) P P) : + M.InternalCountableBelow r F (essentialBirthFiber F T r birth t) := by + classical + have groundFiber := M.essentialBirthFiber_mem separation hF hT hr hBirth ht + have positive : essentialBirthFiber F T r birth t ⊆ F := + fun _ hx => birthEssentialSet_subset F T r birth + (essentialBirthFiber_subset F T r birth t hx) + have points : essentialBirthFiber F T r birth t ⊆ L := fun _ hx => filter.subset (positive hx) + cases layer with + | countablePoints D _ small cover => + have subset : essentialBirthFiber F T r birth t ⊆ D := by + intro x hx + exact cover x (points hx) ((mem_essentialBirthFiber F T r birth t x).1 hx).2.2 + have countableFiber := M.groundEmbeddable_restrict separation groundFiber + (M.omega_mem separation infinite) subset small + exact M.internalCountableBelow_of_countable groundFiber countableFiber positive + (fun x hx => meet.order.refl x (points hx)) + | copies I parts groundI small groundParts index e previous groundCopy embedding cover inCopy => + apply M.internalCountableBelow_indexed_union pairing unions powers separation infinite choice + groundI hr hF groundFiber groundParts small + · intro x hx + exact cover x (points hx) ((mem_essentialBirthFiber F T r birth t x).1 hx).2.2 + · intro i hi + obtain ⟨groundA, source, sourceBases⟩ := earlier (index i) (previous i hi) + have basis := M.internalCountableBelow_copy_of_all_filters pairing unions powers separation + infinite groundA hL (groundCopy i hi) hF source filter (embedding i hi) sourceBases + apply basis.mono + intro x hx + obtain ⟨hxFiber, part⟩ := (mem_relationFiber (essentialBirthFiber F T r birth t) parts i x).1 hx + exact ZFSet.mem_inter.2 ⟨positive hxFiber, inCopy i hi x (points hxFiber) part⟩ + | separated I index e previous groundCopy embedding component cover separated => + by_cases inhabited : (essentialBirthFiber F T r birth t).Nonempty + · obtain ⟨x, hx⟩ := inhabited + let representative : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} := + ⟨x, points hx, ((mem_essentialBirthFiber F T r birth t x).1 hx).2.2⟩ + let i := component representative + obtain ⟨groundA, source, sourceBases⟩ := earlier (index i) (previous i) + have basis := M.internalCountableBelow_copy_of_all_filters pairing unions powers separation + infinite groundA hL (groundCopy i) hF source filter (embedding i) sourceBases + apply basis.mono + intro y hy + let current : {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} := + ⟨y, points hy, ((mem_essentialBirthFiber F T r birth t y).1 hy).2.2⟩ + have same : component current = i := by + by_contra different + exact birthEssentials_no_oldBridge meet filter born + (essentialBirthFiber_subset F T r birth t hy) + (essentialBirthFiber_subset F T r birth t hx) + current.property.2 representative.property.2 (separated current representative different) + have inside := cover current + rw [same] at inside + exact ZFSet.mem_inter.2 ⟨positive hy, inside⟩ + · have empty : essentialBirthFiber F T r birth t = ∅ := by + apply ZFSet.ext + intro x + exact ⟨fun hx => False.elim (inhabited ⟨x, hx⟩), + fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ + rw [empty] + exact M.internalCountableBelow_empty ⟨F, hF⟩ r F + +end CodedGrowthLayer + +end + +namespace CodedGrowthLayer + +universe u + +def of_inclusion {M N : TransitiveGround.{u}} + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {L r μ birth t : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) + (includes : M.sets ⊆ N.sets) : + CodedGrowthLayer N Space sourceOrder sourceMeet L r μ birth t := by + cases layer with + | countablePoints D ground small cover => + exact .countablePoints D (includes ground) + (M.groundEmbeddable_of_inclusion N includes small) cover + | copies I parts groundI small groundParts index e earlier groundCopy embedding cover inCopy => + exact .copies I parts (includes groundI) + (M.groundEmbeddable_of_inclusion N includes small) (includes groundParts) + index e earlier (fun i hi => includes (groundCopy i hi)) embedding cover inCopy + | separated I index e earlier groundCopy embedding component cover separated => + exact .separated I index e earlier (fun i => includes (groundCopy i)) + embedding component cover separated + +def congr_sources_below {M : TransitiveGround.{u}} + {Space sourceOrder sourceMeet Space' sourceOrder' sourceMeet' : ZFSet.{u} → ZFSet.{u}} + {L r μ birth t : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) + (spaces : ∀ s ∈ t, Space s = Space' s) + (orders : ∀ s ∈ t, sourceOrder s = sourceOrder' s) + (meets : ∀ s ∈ t, sourceMeet s = sourceMeet' s) : + CodedGrowthLayer M Space' sourceOrder' sourceMeet' L r μ birth t := by + cases layer with + | countablePoints D ground small cover => + exact .countablePoints D ground small cover + | copies I parts groundI small groundParts index e earlier groundCopy embedding cover inCopy => + refine .copies I parts groundI small groundParts index e earlier groundCopy ?_ cover ?_ + · intro i hi + simpa only [← spaces (index i) (earlier i hi), ← orders (index i) (earlier i hi), + ← meets (index i) (earlier i hi)] using embedding i hi + · intro i hi x hx entry + simpa only [← spaces (index i) (earlier i hi)] using inCopy i hi x hx entry + | separated I index e earlier groundCopy embedding component cover separation => + refine .separated I index e earlier groundCopy ?_ component ?_ separation + · intro i + simpa only [← spaces (index i) (earlier i), ← orders (index i) (earlier i), + ← meets (index i) (earlier i)] using embedding i + · intro x + simpa only [← spaces (index (component x)) (earlier (component x))] using cover x + +end CodedGrowthLayer + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightAttachment.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightAttachment.lean index b463915567a5636384a4f9f52d05b790ed4de319..41567e8f2d02d51ce3579ee86dc45cd7223dc5f8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightAttachment.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightAttachment.lean @@ -1,122 +1,122 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.CountableCoding - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Attachment - -universe u v w z - -structure HeightOrder (H : Type v) where - lt : H → H → Prop - irrefl : ∀ x, ¬ lt x x - trans : ∀ {x y z}, lt x y → lt y z → lt x z - -namespace HeightOrder - -variable {H : Type v} (R : HeightOrder H) - -def Weak (x y : H) : Prop := x = y ∨ R.lt x y - -theorem weak_lt {x y z : H} (h : R.Weak x y) (h' : R.lt y z) : R.lt x z := by - rcases h with eq | h - · cases eq - exact h' - · exact R.trans h h' - -theorem lt_weak {x y z : H} (h : R.lt x y) (h' : R.Weak y z) : R.lt x z := by - rcases h' with eq | h' - · cases eq - exact h - · exact R.trans h h' - -end HeightOrder - -structure StrictHeight {A : Type u} {H : Type v} (P : MeetOrder A) (R : HeightOrder H) where - value : A → H - strict : ∀ x y, P.le x y → x ≠ y → R.lt (value x) (value y) - -namespace StrictHeight - -variable {A : Type u} {H : Type v} {P : MeetOrder A} {R : HeightOrder H} - -theorem mono (h : StrictHeight P R) {x y : A} (lower : P.le x y) : R.Weak (h.value x) (h.value y) := by - classical - by_cases eq : x = y - · exact Or.inl (congrArg h.value eq) - · exact Or.inr (h.strict x y lower eq) - -def precompose {B : Type w} {Q : MeetOrder B} (h : StrictHeight P R) - (e : MeetEmbedding Q P) : StrictHeight Q R where - value x := h.value (e.toFun x) - strict _ _ lower different := h.strict _ _ ((e.le_iff _ _).mpr lower) - (fun eq => different (embedding_injective e eq)) - -end StrictHeight - -namespace AttachmentHeight - -variable {O : Type u} {I : Type w} {H : Type z} {P : MeetOrder O} {R : HeightOrder H} - (b : Templates.{u,v,w} P I) (old : StrictHeight P R) - (component : ∀ i, StrictHeight (b.order i) R) - -def value : O ⊕ b.Fresh → H - | .inl x => old.value x - | .inr x => (component x.1).value x.2.val - -theorem strict - (lower : ∀ x : b.Fresh, R.lt (old.value (b.base x.1)) ((component x.1).value x.2.val)) - (upper : ∀ x : b.Fresh, R.lt ((component x.1).value x.2.val) (old.value (b.separator x.1))) - (x y : O ⊕ b.Fresh) (le : b.extension.le x y) (different : x ≠ y) : - R.lt (value b old component x) (value b old component y) := by - cases x with - | inl x => - cases y with - | inl y => exact old.strict x y le (fun eq => different (congrArg Sum.inl eq)) - | inr y => - have below : P.le x (b.base y.1) := P.trans le (b.data.shadow_le_base y) - exact R.weak_lt (old.mono below) (lower y) - | inr x => - cases y with - | inl y => exact R.lt_weak (upper x) (old.mono (b.separator_le_upper x.1 y le)) - | inr y => - rcases le with inside | cross - · rcases x with ⟨i, x, hx⟩ - rcases y with ⟨j, y, hy⟩ - rcases inside with ⟨same, inside⟩ - cases same - apply (component i).strict x y inside - intro eq - cases eq - exact different rfl - · have middle : P.le (b.separator x.1) (b.base y.1) := - P.trans (b.separator_le_upper x.1 (b.shadow y) cross) (b.data.shadow_le_base y) - exact R.trans (upper x) (R.weak_lt (old.mono middle) (lower y)) - -def extend - (lower : ∀ x : b.Fresh, R.lt (old.value (b.base x.1)) ((component x.1).value x.2.val)) - (upper : ∀ x : b.Fresh, R.lt ((component x.1).value x.2.val) (old.value (b.separator x.1))) : - StrictHeight b.extension R where - value := value b old component - strict := strict b old component lower upper - -theorem old_fixed (x : O) : value b old component (.inl x) = old.value x := rfl - -theorem bound_preserved - (upper : ∀ x : b.Fresh, R.lt ((component x.1).value x.2.val) (old.value (b.separator x.1))) - (bound : H) (old_bound : ∀ x, R.Weak (old.value x) bound) : - ∀ x, R.Weak (value b old component x) bound := by - intro x - cases x with - | inl x => exact old_bound x - | inr x => exact Or.inr (R.lt_weak (upper x) (old_bound (b.separator x.1))) - -end AttachmentHeight -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.CountableCoding + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Attachment + +universe u v w z + +structure HeightOrder (H : Type v) where + lt : H → H → Prop + irrefl : ∀ x, ¬ lt x x + trans : ∀ {x y z}, lt x y → lt y z → lt x z + +namespace HeightOrder + +variable {H : Type v} (R : HeightOrder H) + +def Weak (x y : H) : Prop := x = y ∨ R.lt x y + +theorem weak_lt {x y z : H} (h : R.Weak x y) (h' : R.lt y z) : R.lt x z := by + rcases h with eq | h + · cases eq + exact h' + · exact R.trans h h' + +theorem lt_weak {x y z : H} (h : R.lt x y) (h' : R.Weak y z) : R.lt x z := by + rcases h' with eq | h' + · cases eq + exact h + · exact R.trans h h' + +end HeightOrder + +structure StrictHeight {A : Type u} {H : Type v} (P : MeetOrder A) (R : HeightOrder H) where + value : A → H + strict : ∀ x y, P.le x y → x ≠ y → R.lt (value x) (value y) + +namespace StrictHeight + +variable {A : Type u} {H : Type v} {P : MeetOrder A} {R : HeightOrder H} + +theorem mono (h : StrictHeight P R) {x y : A} (lower : P.le x y) : R.Weak (h.value x) (h.value y) := by + classical + by_cases eq : x = y + · exact Or.inl (congrArg h.value eq) + · exact Or.inr (h.strict x y lower eq) + +def precompose {B : Type w} {Q : MeetOrder B} (h : StrictHeight P R) + (e : MeetEmbedding Q P) : StrictHeight Q R where + value x := h.value (e.toFun x) + strict _ _ lower different := h.strict _ _ ((e.le_iff _ _).mpr lower) + (fun eq => different (embedding_injective e eq)) + +end StrictHeight + +namespace AttachmentHeight + +variable {O : Type u} {I : Type w} {H : Type z} {P : MeetOrder O} {R : HeightOrder H} + (b : Templates.{u,v,w} P I) (old : StrictHeight P R) + (component : ∀ i, StrictHeight (b.order i) R) + +def value : O ⊕ b.Fresh → H + | .inl x => old.value x + | .inr x => (component x.1).value x.2.val + +theorem strict + (lower : ∀ x : b.Fresh, R.lt (old.value (b.base x.1)) ((component x.1).value x.2.val)) + (upper : ∀ x : b.Fresh, R.lt ((component x.1).value x.2.val) (old.value (b.separator x.1))) + (x y : O ⊕ b.Fresh) (le : b.extension.le x y) (different : x ≠ y) : + R.lt (value b old component x) (value b old component y) := by + cases x with + | inl x => + cases y with + | inl y => exact old.strict x y le (fun eq => different (congrArg Sum.inl eq)) + | inr y => + have below : P.le x (b.base y.1) := P.trans le (b.data.shadow_le_base y) + exact R.weak_lt (old.mono below) (lower y) + | inr x => + cases y with + | inl y => exact R.lt_weak (upper x) (old.mono (b.separator_le_upper x.1 y le)) + | inr y => + rcases le with inside | cross + · rcases x with ⟨i, x, hx⟩ + rcases y with ⟨j, y, hy⟩ + rcases inside with ⟨same, inside⟩ + cases same + apply (component i).strict x y inside + intro eq + cases eq + exact different rfl + · have middle : P.le (b.separator x.1) (b.base y.1) := + P.trans (b.separator_le_upper x.1 (b.shadow y) cross) (b.data.shadow_le_base y) + exact R.trans (upper x) (R.weak_lt (old.mono middle) (lower y)) + +def extend + (lower : ∀ x : b.Fresh, R.lt (old.value (b.base x.1)) ((component x.1).value x.2.val)) + (upper : ∀ x : b.Fresh, R.lt ((component x.1).value x.2.val) (old.value (b.separator x.1))) : + StrictHeight b.extension R where + value := value b old component + strict := strict b old component lower upper + +theorem old_fixed (x : O) : value b old component (.inl x) = old.value x := rfl + +theorem bound_preserved + (upper : ∀ x : b.Fresh, R.lt ((component x.1).value x.2.val) (old.value (b.separator x.1))) + (bound : H) (old_bound : ∀ x, R.Weak (old.value x) bound) : + ∀ x, R.Weak (value b old component x) bound := by + intro x + cases x with + | inl x => exact old_bound x + | inr x => exact Or.inr (R.lt_weak (upper x) (old_bound (b.separator x.1))) + +end AttachmentHeight +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightColumnBoundLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightColumnBoundLaws.lean index 788bb93d89fe7a2086496f5f0d9614b8ae5b0b8e..efb72b374d2d1502566ff72055bbb636bac2aa54 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightColumnBoundLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/HeightColumnBoundLaws.lean @@ -1,100 +1,100 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableProducts - -namespace OAI - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def heightColumns (P C D old : ZFSet.{u}) : ZFSet.{u} := - relationImage (relationImage P (ZFSet.prod C D) old) C (productFirst C D) - -theorem mem_heightColumns_of_entry {P C D old x c q : ZFSet.{u}} - (function : ZFSet.IsFunc P (ZFSet.prod C D) old) - (entry : ZFSet.pair x (ZFSet.pair c q) ∈ old) : c ∈ heightColumns P C D old := by - have shape := ZFSet.pair_mem_prod.1 (function.1 entry) - have coordinates := ZFSet.pair_mem_prod.1 shape.2 - exact (mem_relationImage _ _ _ c).2 ⟨coordinates.1, ZFSet.pair c q, - (mem_relationImage _ _ _ _).2 ⟨shape.2, x, shape.1, entry⟩, - (mem_productFirst C D _).2 ⟨c, coordinates.1, q, coordinates.2, rfl⟩⟩ - -theorem height_range_subset_columns {P L C D old height : ZFSet.{u}} - (columns : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → - c ∈ heightColumns P C D old) : - relationImage L (ZFSet.prod C D) height ⊆ ZFSet.prod (heightColumns P C D old) D := by - intro y hy - obtain ⟨hy, x, _, entry⟩ := (mem_relationImage L (ZFSet.prod C D) height y).1 hy - obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 hy - exact ZFSet.pair_mem_prod.2 ⟨columns x c q entry, hq⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem heightColumns_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P C D old : ZFSet.{u}} (hP : P ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hOld : old ∈ M.sets) : heightColumns P C D old ∈ M.sets := - M.relationImage_mem separation - (M.relationImage_mem separation hP (M.prod_mem pairing unions powers separation hC hD) hOld) - hC (M.productFirst_mem pairing unions powers separation hC hD) - -theorem heightColumns_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P C D old : ZFSet.{u}} (hP : P ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hOld : old ∈ M.sets) - (small : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) : - M.groundEmbeddable (heightColumns P C D old) ZFSet.omega := - M.groundEmbeddable_function_image pairing unions powers separation choice - (M.relationImage_mem separation hP (M.prod_mem pairing unions powers separation hC hD) hOld) - hC (M.omega_mem separation infinite) - (M.productFirst_mem pairing unions powers separation hC hD) (productFirst_function C D) small - -theorem countable_height_range_of_old_columns - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P L C D old height : ZFSet.{u}} - (hP : P ∈ M.sets) (hL : L ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) - (hOld : old ∈ M.sets) (hHeight : height ∈ M.sets) - (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) - (coordinateSmall : M.groundEmbeddable D ZFSet.omega) - (columns : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → - c ∈ heightColumns P C D old) : - relationImage L (ZFSet.prod C D) height ∈ M.sets ∧ - M.groundEmbeddable (relationImage L (ZFSet.prod C D) height) ZFSet.omega := by - have rangeMember := M.relationImage_mem separation hL - (M.prod_mem pairing unions powers separation hC hD) hHeight - have smallColumns := M.heightColumns_countable pairing unions powers separation infinite choice - hP hC hD hOld oldSmall - have smallProduct := M.groundEmbeddable_product pairing unions powers separation infinite - (M.heightColumns_mem pairing unions powers separation hP hC hD hOld) hD - smallColumns coordinateSmall - exact ⟨rangeMember, M.groundEmbeddable_restrict separation rangeMember - (M.omega_mem separation infinite) (height_range_subset_columns columns) smallProduct⟩ - -end TransitiveGround - -theorem heightColumns_subset_of_bound {P C D height K : ZFSet.{u}} - (bound : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ K) : - heightColumns P C D height ⊆ K := by - intro c hc - obtain ⟨_, y, hy, projected⟩ := - (mem_relationImage (relationImage P (ZFSet.prod C D) height) C (productFirst C D) c).1 hc - obtain ⟨a, ha, q, hq, equal⟩ := (mem_productFirst C D _).1 projected - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨_, x, _, entry⟩ := (mem_relationImage P (ZFSet.prod C D) height _).1 hy - exact bound x c q entry - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableProducts + +namespace OAI + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def heightColumns (P C D old : ZFSet.{u}) : ZFSet.{u} := + relationImage (relationImage P (ZFSet.prod C D) old) C (productFirst C D) + +theorem mem_heightColumns_of_entry {P C D old x c q : ZFSet.{u}} + (function : ZFSet.IsFunc P (ZFSet.prod C D) old) + (entry : ZFSet.pair x (ZFSet.pair c q) ∈ old) : c ∈ heightColumns P C D old := by + have shape := ZFSet.pair_mem_prod.1 (function.1 entry) + have coordinates := ZFSet.pair_mem_prod.1 shape.2 + exact (mem_relationImage _ _ _ c).2 ⟨coordinates.1, ZFSet.pair c q, + (mem_relationImage _ _ _ _).2 ⟨shape.2, x, shape.1, entry⟩, + (mem_productFirst C D _).2 ⟨c, coordinates.1, q, coordinates.2, rfl⟩⟩ + +theorem height_range_subset_columns {P L C D old height : ZFSet.{u}} + (columns : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → + c ∈ heightColumns P C D old) : + relationImage L (ZFSet.prod C D) height ⊆ ZFSet.prod (heightColumns P C D old) D := by + intro y hy + obtain ⟨hy, x, _, entry⟩ := (mem_relationImage L (ZFSet.prod C D) height y).1 hy + obtain ⟨c, _, q, hq, rfl⟩ := ZFSet.mem_prod.1 hy + exact ZFSet.pair_mem_prod.2 ⟨columns x c q entry, hq⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem heightColumns_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P C D old : ZFSet.{u}} (hP : P ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hOld : old ∈ M.sets) : heightColumns P C D old ∈ M.sets := + M.relationImage_mem separation + (M.relationImage_mem separation hP (M.prod_mem pairing unions powers separation hC hD) hOld) + hC (M.productFirst_mem pairing unions powers separation hC hD) + +theorem heightColumns_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P C D old : ZFSet.{u}} (hP : P ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hOld : old ∈ M.sets) + (small : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) : + M.groundEmbeddable (heightColumns P C D old) ZFSet.omega := + M.groundEmbeddable_function_image pairing unions powers separation choice + (M.relationImage_mem separation hP (M.prod_mem pairing unions powers separation hC hD) hOld) + hC (M.omega_mem separation infinite) + (M.productFirst_mem pairing unions powers separation hC hD) (productFirst_function C D) small + +theorem countable_height_range_of_old_columns + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P L C D old height : ZFSet.{u}} + (hP : P ∈ M.sets) (hL : L ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) + (hOld : old ∈ M.sets) (hHeight : height ∈ M.sets) + (oldSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) old) ZFSet.omega) + (coordinateSmall : M.groundEmbeddable D ZFSet.omega) + (columns : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → + c ∈ heightColumns P C D old) : + relationImage L (ZFSet.prod C D) height ∈ M.sets ∧ + M.groundEmbeddable (relationImage L (ZFSet.prod C D) height) ZFSet.omega := by + have rangeMember := M.relationImage_mem separation hL + (M.prod_mem pairing unions powers separation hC hD) hHeight + have smallColumns := M.heightColumns_countable pairing unions powers separation infinite choice + hP hC hD hOld oldSmall + have smallProduct := M.groundEmbeddable_product pairing unions powers separation infinite + (M.heightColumns_mem pairing unions powers separation hP hC hD hOld) hD + smallColumns coordinateSmall + exact ⟨rangeMember, M.groundEmbeddable_restrict separation rangeMember + (M.omega_mem separation infinite) (height_range_subset_columns columns) smallProduct⟩ + +end TransitiveGround + +theorem heightColumns_subset_of_bound {P C D height K : ZFSet.{u}} + (bound : ∀ x c q, ZFSet.pair x (ZFSet.pair c q) ∈ height → c ∈ K) : + heightColumns P C D height ⊆ K := by + intro c hc + obtain ⟨_, y, hy, projected⟩ := + (mem_relationImage (relationImage P (ZFSet.prod C D) height) C (productFirst C D) c).1 hc + obtain ⟨a, ha, q, hq, equal⟩ := (mem_productFirst C D _).1 projected + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨_, x, _, entry⟩ := (mem_relationImage P (ZFSet.prod C D) height _).1 hy + exact bound x c q entry + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionAccounting.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionAccounting.lean index f6d08615651357cbb341ba1ab6b2e04ec80310fa..5a4c4d8e916bf8c9184b0034930956a19934b9d6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionAccounting.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionAccounting.lean @@ -1,461 +1,461 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RepresentativeProductAgreement -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundEligibleBatchActionRecognition - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -structure GroundCompressionState (M : TransitiveGround.{u}) - {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} - (seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) where - data : RecursiveStateData.{u} - batch : AttachmentBatchInputs data.D data.rD data.μD data.J - data.Qs data.rs data.μs data.As data.Es data.Fs data.Ss - inputs : CodedRecursiveMapInputs batch I data.Maps Sources Reps G m inv one data.A - task : CodedRecursiveTaskAction inputs T - invariant : RecursiveCompressionInvariant seed inputs - ground : RecursiveGroundFields M inputs - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem inputs_toState : state.inputs.toState = state.data := by - cases state with - | mk data batch inputs task invariant ground => cases data; rfl - -theorem code_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - state.data.code ∈ M.sets := by - rw [← state.inputs_toState] - exact M.recursiveStateCode_mem pairing state.ground.carrier state.ground.order - state.ground.meet state.ground.indices state.ground.spaces state.ground.relations - state.ground.meets state.ground.anchors state.ground.embeddings state.ground.filters - state.ground.separators state.ground.maps state.ground.action - -theorem exists_successor - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : - ∃ result : GroundCompressionState M seed, - result.data = state.data.successor M I Sources Reps G T := by - obtain ⟨next, inputs, task, invariant, ground⟩ := state.invariant.exists_groundNext state.task M - pairing unions powers separation state.ground hI hSources hReps hG hT - let result : GroundCompressionState M seed := - ⟨inputs.toState, next, inputs, task, invariant, ground⟩ - refine ⟨result, ?_⟩ - change inputs.toState = state.data.successor M I Sources Reps G T - exact (state.inputs.toState_successor M next inputs).trans - (congrArg (fun data => data.successor M I Sources Reps G T) state.inputs_toState) - -theorem successor_unique_data {first second : GroundCompressionState M seed} - (hfirst : first.data = state.data.successor M I Sources Reps G T) - (hsecond : second.data = state.data.successor M I Sources Reps G T) : - first.data = second.data := hfirst.trans hsecond.symm - -end GroundCompressionState - -end - -section -universe u - -def FiniteCompressionAccounting (P0 I Sources τ : ZFSet.{u}) (data : RecursiveStateData.{u}) : Prop := - ∀ x ∈ data.currentCarrier, x ∈ P0 ∨ - ∃ i ∈ I, ∃ S a k b, ∃ y ∈ data.D, - ZFSet.pair i S ∈ data.Maps ∧ ZFSet.pair i a ∈ Sources ∧ - ZFSet.pair τ k ∈ S ∧ ZFSet.pair a b ∈ S ∧ ZFSet.pair y x ∈ S ∧ - ZFSet.pair x k ∈ data.currentOrder ∧ ZFSet.pair x b ∉ data.currentOrder - -namespace CodedRecursiveMapInputs -variable {P0 τ D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -theorem accounting_next - (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) - (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T)) - (hτ : τ ∈ D) (top : ∀ x ∈ D, ZFSet.pair x τ ∈ rD) - (accounted : FiniteCompressionAccounting P0 I Sources τ h.toState) : - FiniteCompressionAccounting P0 I Sources τ inputs.toState := by - intro x hx - change x ∈ next.batchCarrier at hx - obtain ⟨X, rfl⟩ := h.nextEncode_surjective M next x hx - cases X with - | inl X => - rw [h.nextEncode_old] - rcases accounted (d.coding.encode X) (d.coding.encode_mem X) with original | accounted - · exact Or.inl original - · obtain ⟨i, hi, S, a, k, b, y, hy, indexed, source, cap, base, image, lower, outside⟩ := accounted - have function := (h.valid i S indexed).injection.function - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - have hk := (ZFSet.pair_mem_prod.1 (function.1 cap)).2 - have hb := (ZFSet.pair_mem_prod.1 (function.1 base)).2 - refine Or.inr ⟨i, hi, h.liftSection M next i, a, k, b, y, - old_mem_taggedExtension hy, (entries _ _).2 ⟨hi, rfl⟩, source, - (h.liftSection_old_iff M next indexed hτ).2 cap, - (h.liftSection_old_iff M next indexed ha).2 base, - (h.liftSection_old_iff M next indexed hy).2 image, ?_, ?_⟩ - · exact (next.old_order_iff (d.coding.encode_mem X) hk).2 lower - · exact fun nextLower => outside ((next.old_order_iff (d.coding.encode_mem X) hb).1 nextLower) - | inr q => - obtain ⟨i, y, image, below, outside⟩ := h.toInputs.fresh_accounting - ⟨τ, hτ⟩ (fun x => top x.val x.property) q - let S := h.maps.value i - let k := d.coding.encode ((h.toInputs.previous i).toFun ⟨τ, hτ⟩) - let b := d.coding.encode ((h.toInputs.previous i).toFun (h.toInputs.source i)) - have indexed : ZFSet.pair i.val S ∈ Maps := h.maps.value_entry i - have cap : ZFSet.pair τ k ∈ S := h.toInputs_previous_entry i ⟨τ, hτ⟩ - have base : ZFSet.pair (h.source i).val b ∈ S := - h.toInputs_previous_entry i (h.source i) - refine Or.inr ⟨i.val, i.property, h.liftSection M next i.val, (h.source i).val, k, b, - d.coding.encode y, d.coding.encode_mem y, - (entries _ _).2 ⟨i.property, rfl⟩, h.source_entry i, - (h.liftSection_old_iff M next indexed hτ).2 cap, - (h.liftSection_old_iff M next indexed (h.source i).property).2 base, ?_, ?_, ?_⟩ - · have lifted := h.liftSection_entry M next i y - exact image ▸ lifted - · exact (h.next_le_encode M next (.inr q) (.inl ((h.toInputs.previous i).toFun ⟨τ, hτ⟩))).2 below - · exact fun lower => outside ((h.next_le_encode M next (.inr q) - (.inl ((h.toInputs.previous i).toFun (h.toInputs.source i)))).1 lower) - -end CodedRecursiveMapInputs - -end - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialCompressionInvariant - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) Sources (literalTaskBaseGraph I P R U Labels) - let B := M.groundEligibleBatchAction P G r μ A Labels - let T := M.groundTaskTransport P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ Maps ∈ M.sets ∧ - B ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, - ∃ inputs : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one B, - RecursiveCompressionInvariant seed inputs ∧ CodedRecursiveTaskAction inputs T := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) Sources (literalTaskBaseGraph I P R U Labels) - let B := M.groundEligibleBatchAction P G r μ A Labels - let T := M.groundTaskTransport P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨hMaps, maps, valid, hB, currentAction, - Reps, hReps, reps, represents, agreement⟩ := - M.exists_groundInitialRepresentatives pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet - let inputs : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one B := - ⟨maps, (fields 0).2, reps, group, currentAction, valid, agreement⟩ - have seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters := by - refine ⟨meet, action, hτ, (fields 0).2, ⟨_, (fields 4).2⟩, ?_, ?_⟩ - · intro δ i j g k product a transport source firstRep secondRep productEntry - have transported := (triple_mem_taskTransportGraph G I P R U Labels A δ i j).1 transport - have hg := (ZFSet.pair_mem_prod.1 (reps.1 firstRep)).2 - have hp := (ZFSet.pair_mem_prod.1 (group.mul_function.1 productEntry)).2 - exact transported.2.2.2.representative_product_agreement action transported.1 hg hp - productEntry (represents i g firstRep) (represents j k secondRep) source - · intro g k v i j l F oldAgree filter positive first second - exact M.groundInitialTask_positive_agreement group action meet oldAgree filter positive first second - have invariant : RecursiveCompressionInvariant seed inputs := by - refine ⟨fun _ hx => hx, fun _ _ _ _ => Iff.rfl, fun _ _ _ _ _ => Iff.rfl, - ?_, top, ?_, ?_⟩ - · intro g x hx y - exact M.groundEligibleBatchAction_old_iff hx - · intro g hg k hk v hv oldAgree - exact M.groundEligibleBatchAction_agreement pairing unions powers separation - hP hG hA group action meet hg hk hv oldAgree - · intro i S a F cap base v w mapEntry source filter capEntry baseEntry hv negative entry - have hi := inputs.maps.pair_source mapEntry - obtain ⟨a', ha, c, hc, ell, hell, sep, hsep, F', hF, label, hl, equal, _⟩ := - (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi - have target : ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels := by - rw [equal] - exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 1).2 ⟨equal ▸ hi, rfl⟩ - exact M.groundInitialMap_negative_cap pairing unions powers separation - hP hG hr hμ hA hLabels group action meet hτ top mapEntry source target filter - capEntry baseEntry hv negative entry - exact ⟨hI, (fields 0).1, (fields 4).1, hMaps, hB, - M.groundTaskTransport_mem pairing unions powers separation hP hG hr hμ hA hLabels meet, - Reps, hReps, seed, inputs, invariant, - M.groundInitialTaskAction pairing unions powers separation hP hG hr hμ hA hLabels - group action meet Reps inputs⟩ - -noncomputable def initialCompressionData (P G r μ A Labels : ZFSet.{u}) : RecursiveStateData.{u} := - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Base := literalTaskBaseGraph I P R U Labels - { D := P - rD := r - μD := μ - J := I - Qs := constantFamilyGraph I P - rs := constantFamilyGraph I r - μs := constantFamilyGraph I μ - As := Sources - Es := Base - Fs := literalTaskFilterGraph I P R U Labels - Ss := literalTaskSeparatorGraph I P R U Labels - Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) Sources Base - A := M.groundEligibleBatchAction P G r μ A Labels } - -theorem exists_groundInitialCompressionState - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ G ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, - ∃ state : GroundCompressionState M seed, - state.data = M.initialCompressionData P G r μ A Labels := by - obtain ⟨hI, hSources, hFilters, hMaps, hB, hT, Reps, hReps, seed, inputs, invariant, task⟩ := - M.exists_groundInitialCompressionInvariant pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - obtain ⟨_, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - have ground : RecursiveGroundFields M inputs := - ⟨hP, hr, hμ, hI, hQs, hrs, hμs, hSources, (fields 2).1, hFilters, - (fields 3).1, hMaps, hB⟩ - let state : GroundCompressionState M seed := - ⟨inputs.toState, _, inputs, task, invariant, ground⟩ - exact ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, rfl⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -noncomputable def initialCompressionFieldsFormula {n} (fields : Fin 13 → Fin n) - (P G r μ A Labels : Fin n) : SetFormula n := - .conj (.equal (fields 0) P) (.conj (.equal (fields 1) r) (.conj (.equal (fields 2) μ) - (.conj (groundEligibleTasksFormula (fields 3) P G r μ A Labels) - (.conj (constantFamilySetFormula (fields 4) (fields 3) P) - (.conj (constantFamilySetFormula (fields 5) (fields 3) r) - (.conj (constantFamilySetFormula (fields 6) (fields 3) μ) - (.conj (groundLiteralTaskFieldFormula 0 (fields 7) (fields 3) P r μ Labels) - (.conj (groundLiteralTaskFieldFormula 2 (fields 8) (fields 3) P r μ Labels) - (.conj (groundLiteralTaskFieldFormula 4 (fields 9) (fields 3) P r μ Labels) - (.conj (groundLiteralTaskFieldFormula 3 (fields 10) (fields 3) P r μ Labels) - (.conj (M.batchEmbeddingFamilyFormula pairing unions powers separation - (fields 11) (fields 3) P (fields 4) (fields 5) (fields 7) (fields 8)) - (M.groundEligibleBatchActionFormula pairing unions powers separation - (fields 12) P G r μ A Labels)))))))))))) - -theorem realize_initialCompressionFieldsFormula {n} (fields : Fin 13 → Fin n) - (P G r μ A Labels : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (M.initialCompressionFieldsFormula pairing unions powers separation fields P G r μ A Labels) env ↔ - (fun j => env (fields j)) = (M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels)).field := by - simp only [initialCompressionFieldsFormula, Realize] - rw [M.realize_groundEligibleTasksFormula pairing unions powers separation - (fields 3) P G r μ A Labels env members meet, - M.realize_constantFamilySetFormula pairing unions powers separation (fields 4) (fields 3) P env members, - M.realize_constantFamilySetFormula pairing unions powers separation (fields 5) (fields 3) r env members, - M.realize_constantFamilySetFormula pairing unions powers separation (fields 6) (fields 3) μ env members, - M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 0 (fields 7) (fields 3) P r μ Labels env members meet, - M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 2 (fields 8) (fields 3) P r μ Labels env members meet, - M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 4 (fields 9) (fields 3) P r μ Labels env members meet, - M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 3 (fields 10) (fields 3) P r μ Labels env members meet, - M.realize_batchEmbeddingFamilyFormula pairing unions powers separation - (fields 11) (fields 3) P (fields 4) (fields 5) (fields 7) (fields 8) env members, - M.realize_groundEligibleBatchActionFormula pairing unions powers separation - (fields 12) P G r μ A Labels env members meet] - constructor - · rintro ⟨points, order, meets, tasks, spaces, orders, meetGraphs, sources, bases, filters, separators, maps, action⟩ - rw [tasks] at spaces orders meetGraphs sources bases filters separators maps - rw [spaces, orders, sources, bases] at maps - apply funext - exact (Fin.cases points (Fin.cases order (Fin.cases meets (Fin.cases tasks (Fin.cases spaces (Fin.cases orders (Fin.cases meetGraphs (Fin.cases sources (Fin.cases bases (Fin.cases filters (Fin.cases separators (Fin.cases maps (Fin.cases action (fun i => Fin.elim0 i)))))))))))))) - · intro equal - have tasks := congrFun equal (3 : Fin 13) - have spaces := congrFun equal (4 : Fin 13) - have orders := congrFun equal (5 : Fin 13) - have sources := congrFun equal (7 : Fin 13) - have bases := congrFun equal (8 : Fin 13) - refine ⟨congrFun equal 0, congrFun equal 1, congrFun equal 2, tasks, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, congrFun equal 12⟩ - · rw [tasks] - exact spaces - · rw [tasks] - exact orders - · rw [tasks] - exact congrFun equal 6 - · rw [tasks] - exact sources - · rw [tasks] - exact bases - · rw [tasks] - exact congrFun equal 9 - · rw [tasks] - exact congrFun equal 10 - · rw [tasks, spaces, orders, sources, bases] - exact congrFun equal 11 - -noncomputable def initialCompressionDataFormula {n} (output P G r μ A Labels : Fin n) : SetFormula n := - exBlock 13 (.conj - (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 output) (prefixIndex n 13)).toFormula - (M.initialCompressionFieldsFormula pairing unions powers separation (prefixIndex n 13) - (suffixIndex n 13 P) (suffixIndex n 13 G) (suffixIndex n 13 r) (suffixIndex n 13 μ) - (suffixIndex n 13 A) (suffixIndex n 13 Labels))) - -theorem realize_initialCompressionDataFormula {n} (output P G r μ A Labels : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (meet : MeetOrderCode (env P) (env r) (env μ)) : - Realize M.sets (M.initialCompressionDataFormula pairing unions powers separation output P G r μ A Labels) env ↔ - env output = (M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels)).code := by - unfold initialCompressionDataFormula - rw [realize_exBlock] - let initial := M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels) - constructor - · rintro ⟨fields, fieldMembers, tuple, specified⟩ - have bounds := extendMany_members 13 fields env fieldMembers members - have tupleEq := (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 output) - (prefixIndex n 13) _).1 ((BoundedFormula.realize_toFormula M _ _ bounds).1 tuple) - have fieldsEq := (M.realize_initialCompressionFieldsFormula pairing unions powers separation - (prefixIndex n 13) (suffixIndex n 13 P) (suffixIndex n 13 G) (suffixIndex n 13 r) - (suffixIndex n 13 μ) (suffixIndex n 13 A) (suffixIndex n 13 Labels) _ bounds - (by simpa only [extendMany_suffix] using meet)).1 specified - simp only [extendMany_prefix, extendMany_suffix] at tupleEq fieldsEq - rw [fieldsEq] at tupleEq - exact tupleEq - · intro equal - have fieldMembers := M.recursiveStateData_field_mem initial (equal ▸ members output) - have bounds := extendMany_members 13 initial.field env fieldMembers members - refine ⟨initial.field, fieldMembers, ?_, ?_⟩ - · apply (BoundedFormula.realize_toFormula M _ _ bounds).2 - apply (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 output) (prefixIndex n 13) _).2 - simp only [extendMany_prefix, extendMany_suffix] - change env output = initial.code - exact equal - · apply (M.realize_initialCompressionFieldsFormula pairing unions powers separation - (prefixIndex n 13) (suffixIndex n 13 P) (suffixIndex n 13 G) (suffixIndex n 13 r) - (suffixIndex n 13 μ) (suffixIndex n 13 A) (suffixIndex n 13 Labels) _ bounds - (by simpa only [extendMany_suffix] using meet)).2 - simp only [extendMany_prefix, extendMany_suffix] - rfl - -end TransitiveGround - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem initialCompressionData_accounting - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels - FiniteCompressionAccounting P I Sources τ (M.initialCompressionData P G r μ A Labels) := by - dsimp only - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels - let Es := literalTaskBaseGraph I P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨_, _, entries⟩ := M.batchEmbeddingFamily_spec - pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 - intro x hx - change x ∈ d.batchCarrier at hx - obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx - cases X with - | inl p => exact Or.inl p.property - | inr q => - let i := q.1 - let S := batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) Sources Es i.val - have spaceEq : d.space i = P := - ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry i)).2 - have relEq : d.rel i = r := - ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry i)).2 - have function : ZFSet.IsFunc P d.batchCarrier S := by - simpa only [spaceEq] using d.batch_template_fiber_function i - have anchorP : d.anchor i ∈ P := by - simpa only [spaceEq] using (d.fiber i).anchor_mem - obtain ⟨k, cap, _⟩ := function.2 τ hτ - obtain ⟨b, base, _⟩ := function.2 (d.anchor i) anchorP - have image : ZFSet.pair q.2.val.val (d.coding.encode (.inr q)) ∈ S := by - apply (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 - apply (d.batch_template_entry_iff i _ _).2 - exact Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.2.val.property, q.2.property⟩, rfl⟩ - have pointP : q.2.val.val ∈ P := by - have member : q.2.val.val ∈ d.space i := q.2.val.property - simpa only [spaceEq] using member - refine Or.inr ⟨i.val, i.property, S, d.anchor i, k, b, q.2.val.val, pointP, - (entries _ _).2 ⟨i.property, rfl⟩, d.anchor_entry i, cap, base, image, ?_, ?_⟩ - · exact (d.batch_template_order_iff i image cap).2 (relEq.symm ▸ top _ pointP) - · intro lower - exact q.2.property ((d.batch_template_order_iff i image base).1 lower) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RepresentativeProductAgreement +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundEligibleBatchActionRecognition + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +structure GroundCompressionState (M : TransitiveGround.{u}) + {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} + (seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) where + data : RecursiveStateData.{u} + batch : AttachmentBatchInputs data.D data.rD data.μD data.J + data.Qs data.rs data.μs data.As data.Es data.Fs data.Ss + inputs : CodedRecursiveMapInputs batch I data.Maps Sources Reps G m inv one data.A + task : CodedRecursiveTaskAction inputs T + invariant : RecursiveCompressionInvariant seed inputs + ground : RecursiveGroundFields M inputs + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem inputs_toState : state.inputs.toState = state.data := by + cases state with + | mk data batch inputs task invariant ground => cases data; rfl + +theorem code_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + state.data.code ∈ M.sets := by + rw [← state.inputs_toState] + exact M.recursiveStateCode_mem pairing state.ground.carrier state.ground.order + state.ground.meet state.ground.indices state.ground.spaces state.ground.relations + state.ground.meets state.ground.anchors state.ground.embeddings state.ground.filters + state.ground.separators state.ground.maps state.ground.action + +theorem exists_successor + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : + ∃ result : GroundCompressionState M seed, + result.data = state.data.successor M I Sources Reps G T := by + obtain ⟨next, inputs, task, invariant, ground⟩ := state.invariant.exists_groundNext state.task M + pairing unions powers separation state.ground hI hSources hReps hG hT + let result : GroundCompressionState M seed := + ⟨inputs.toState, next, inputs, task, invariant, ground⟩ + refine ⟨result, ?_⟩ + change inputs.toState = state.data.successor M I Sources Reps G T + exact (state.inputs.toState_successor M next inputs).trans + (congrArg (fun data => data.successor M I Sources Reps G T) state.inputs_toState) + +theorem successor_unique_data {first second : GroundCompressionState M seed} + (hfirst : first.data = state.data.successor M I Sources Reps G T) + (hsecond : second.data = state.data.successor M I Sources Reps G T) : + first.data = second.data := hfirst.trans hsecond.symm + +end GroundCompressionState + +end + +section +universe u + +def FiniteCompressionAccounting (P0 I Sources τ : ZFSet.{u}) (data : RecursiveStateData.{u}) : Prop := + ∀ x ∈ data.currentCarrier, x ∈ P0 ∨ + ∃ i ∈ I, ∃ S a k b, ∃ y ∈ data.D, + ZFSet.pair i S ∈ data.Maps ∧ ZFSet.pair i a ∈ Sources ∧ + ZFSet.pair τ k ∈ S ∧ ZFSet.pair a b ∈ S ∧ ZFSet.pair y x ∈ S ∧ + ZFSet.pair x k ∈ data.currentOrder ∧ ZFSet.pair x b ∉ data.currentOrder + +namespace CodedRecursiveMapInputs +variable {P0 τ D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +theorem accounting_next + (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) + (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T)) + (hτ : τ ∈ D) (top : ∀ x ∈ D, ZFSet.pair x τ ∈ rD) + (accounted : FiniteCompressionAccounting P0 I Sources τ h.toState) : + FiniteCompressionAccounting P0 I Sources τ inputs.toState := by + intro x hx + change x ∈ next.batchCarrier at hx + obtain ⟨X, rfl⟩ := h.nextEncode_surjective M next x hx + cases X with + | inl X => + rw [h.nextEncode_old] + rcases accounted (d.coding.encode X) (d.coding.encode_mem X) with original | accounted + · exact Or.inl original + · obtain ⟨i, hi, S, a, k, b, y, hy, indexed, source, cap, base, image, lower, outside⟩ := accounted + have function := (h.valid i S indexed).injection.function + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + have hk := (ZFSet.pair_mem_prod.1 (function.1 cap)).2 + have hb := (ZFSet.pair_mem_prod.1 (function.1 base)).2 + refine Or.inr ⟨i, hi, h.liftSection M next i, a, k, b, y, + old_mem_taggedExtension hy, (entries _ _).2 ⟨hi, rfl⟩, source, + (h.liftSection_old_iff M next indexed hτ).2 cap, + (h.liftSection_old_iff M next indexed ha).2 base, + (h.liftSection_old_iff M next indexed hy).2 image, ?_, ?_⟩ + · exact (next.old_order_iff (d.coding.encode_mem X) hk).2 lower + · exact fun nextLower => outside ((next.old_order_iff (d.coding.encode_mem X) hb).1 nextLower) + | inr q => + obtain ⟨i, y, image, below, outside⟩ := h.toInputs.fresh_accounting + ⟨τ, hτ⟩ (fun x => top x.val x.property) q + let S := h.maps.value i + let k := d.coding.encode ((h.toInputs.previous i).toFun ⟨τ, hτ⟩) + let b := d.coding.encode ((h.toInputs.previous i).toFun (h.toInputs.source i)) + have indexed : ZFSet.pair i.val S ∈ Maps := h.maps.value_entry i + have cap : ZFSet.pair τ k ∈ S := h.toInputs_previous_entry i ⟨τ, hτ⟩ + have base : ZFSet.pair (h.source i).val b ∈ S := + h.toInputs_previous_entry i (h.source i) + refine Or.inr ⟨i.val, i.property, h.liftSection M next i.val, (h.source i).val, k, b, + d.coding.encode y, d.coding.encode_mem y, + (entries _ _).2 ⟨i.property, rfl⟩, h.source_entry i, + (h.liftSection_old_iff M next indexed hτ).2 cap, + (h.liftSection_old_iff M next indexed (h.source i).property).2 base, ?_, ?_, ?_⟩ + · have lifted := h.liftSection_entry M next i y + exact image ▸ lifted + · exact (h.next_le_encode M next (.inr q) (.inl ((h.toInputs.previous i).toFun ⟨τ, hτ⟩))).2 below + · exact fun lower => outside ((h.next_le_encode M next (.inr q) + (.inl ((h.toInputs.previous i).toFun (h.toInputs.source i)))).1 lower) + +end CodedRecursiveMapInputs + +end + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialCompressionInvariant + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) Sources (literalTaskBaseGraph I P R U Labels) + let B := M.groundEligibleBatchAction P G r μ A Labels + let T := M.groundTaskTransport P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ Maps ∈ M.sets ∧ + B ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, + ∃ inputs : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one B, + RecursiveCompressionInvariant seed inputs ∧ CodedRecursiveTaskAction inputs T := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) Sources (literalTaskBaseGraph I P R U Labels) + let B := M.groundEligibleBatchAction P G r μ A Labels + let T := M.groundTaskTransport P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨hMaps, maps, valid, hB, currentAction, + Reps, hReps, reps, represents, agreement⟩ := + M.exists_groundInitialRepresentatives pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet + let inputs : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one B := + ⟨maps, (fields 0).2, reps, group, currentAction, valid, agreement⟩ + have seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters := by + refine ⟨meet, action, hτ, (fields 0).2, ⟨_, (fields 4).2⟩, ?_, ?_⟩ + · intro δ i j g k product a transport source firstRep secondRep productEntry + have transported := (triple_mem_taskTransportGraph G I P R U Labels A δ i j).1 transport + have hg := (ZFSet.pair_mem_prod.1 (reps.1 firstRep)).2 + have hp := (ZFSet.pair_mem_prod.1 (group.mul_function.1 productEntry)).2 + exact transported.2.2.2.representative_product_agreement action transported.1 hg hp + productEntry (represents i g firstRep) (represents j k secondRep) source + · intro g k v i j l F oldAgree filter positive first second + exact M.groundInitialTask_positive_agreement group action meet oldAgree filter positive first second + have invariant : RecursiveCompressionInvariant seed inputs := by + refine ⟨fun _ hx => hx, fun _ _ _ _ => Iff.rfl, fun _ _ _ _ _ => Iff.rfl, + ?_, top, ?_, ?_⟩ + · intro g x hx y + exact M.groundEligibleBatchAction_old_iff hx + · intro g hg k hk v hv oldAgree + exact M.groundEligibleBatchAction_agreement pairing unions powers separation + hP hG hA group action meet hg hk hv oldAgree + · intro i S a F cap base v w mapEntry source filter capEntry baseEntry hv negative entry + have hi := inputs.maps.pair_source mapEntry + obtain ⟨a', ha, c, hc, ell, hell, sep, hsep, F', hF, label, hl, equal, _⟩ := + (mem_eligibleTaskSet P G r μ A R U Labels i).1 hi + have target : ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels := by + rw [equal] + exact (literalTaskFieldGraph_entry_iff ha hc hell hsep hF hl 1).2 ⟨equal ▸ hi, rfl⟩ + exact M.groundInitialMap_negative_cap pairing unions powers separation + hP hG hr hμ hA hLabels group action meet hτ top mapEntry source target filter + capEntry baseEntry hv negative entry + exact ⟨hI, (fields 0).1, (fields 4).1, hMaps, hB, + M.groundTaskTransport_mem pairing unions powers separation hP hG hr hμ hA hLabels meet, + Reps, hReps, seed, inputs, invariant, + M.groundInitialTaskAction pairing unions powers separation hP hG hr hμ hA hLabels + group action meet Reps inputs⟩ + +noncomputable def initialCompressionData (P G r μ A Labels : ZFSet.{u}) : RecursiveStateData.{u} := + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Base := literalTaskBaseGraph I P R U Labels + { D := P + rD := r + μD := μ + J := I + Qs := constantFamilyGraph I P + rs := constantFamilyGraph I r + μs := constantFamilyGraph I μ + As := Sources + Es := Base + Fs := literalTaskFilterGraph I P R U Labels + Ss := literalTaskSeparatorGraph I P R U Labels + Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) Sources Base + A := M.groundEligibleBatchAction P G r μ A Labels } + +theorem exists_groundInitialCompressionState + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ G ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, + ∃ state : GroundCompressionState M seed, + state.data = M.initialCompressionData P G r μ A Labels := by + obtain ⟨hI, hSources, hFilters, hMaps, hB, hT, Reps, hReps, seed, inputs, invariant, task⟩ := + M.exists_groundInitialCompressionInvariant pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + obtain ⟨_, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + have ground : RecursiveGroundFields M inputs := + ⟨hP, hr, hμ, hI, hQs, hrs, hμs, hSources, (fields 2).1, hFilters, + (fields 3).1, hMaps, hB⟩ + let state : GroundCompressionState M seed := + ⟨inputs.toState, _, inputs, task, invariant, ground⟩ + exact ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, rfl⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +noncomputable def initialCompressionFieldsFormula {n} (fields : Fin 13 → Fin n) + (P G r μ A Labels : Fin n) : SetFormula n := + .conj (.equal (fields 0) P) (.conj (.equal (fields 1) r) (.conj (.equal (fields 2) μ) + (.conj (groundEligibleTasksFormula (fields 3) P G r μ A Labels) + (.conj (constantFamilySetFormula (fields 4) (fields 3) P) + (.conj (constantFamilySetFormula (fields 5) (fields 3) r) + (.conj (constantFamilySetFormula (fields 6) (fields 3) μ) + (.conj (groundLiteralTaskFieldFormula 0 (fields 7) (fields 3) P r μ Labels) + (.conj (groundLiteralTaskFieldFormula 2 (fields 8) (fields 3) P r μ Labels) + (.conj (groundLiteralTaskFieldFormula 4 (fields 9) (fields 3) P r μ Labels) + (.conj (groundLiteralTaskFieldFormula 3 (fields 10) (fields 3) P r μ Labels) + (.conj (M.batchEmbeddingFamilyFormula pairing unions powers separation + (fields 11) (fields 3) P (fields 4) (fields 5) (fields 7) (fields 8)) + (M.groundEligibleBatchActionFormula pairing unions powers separation + (fields 12) P G r μ A Labels)))))))))))) + +theorem realize_initialCompressionFieldsFormula {n} (fields : Fin 13 → Fin n) + (P G r μ A Labels : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (M.initialCompressionFieldsFormula pairing unions powers separation fields P G r μ A Labels) env ↔ + (fun j => env (fields j)) = (M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels)).field := by + simp only [initialCompressionFieldsFormula, Realize] + rw [M.realize_groundEligibleTasksFormula pairing unions powers separation + (fields 3) P G r μ A Labels env members meet, + M.realize_constantFamilySetFormula pairing unions powers separation (fields 4) (fields 3) P env members, + M.realize_constantFamilySetFormula pairing unions powers separation (fields 5) (fields 3) r env members, + M.realize_constantFamilySetFormula pairing unions powers separation (fields 6) (fields 3) μ env members, + M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 0 (fields 7) (fields 3) P r μ Labels env members meet, + M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 2 (fields 8) (fields 3) P r μ Labels env members meet, + M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 4 (fields 9) (fields 3) P r μ Labels env members meet, + M.realize_groundLiteralTaskFieldFormula pairing unions powers separation 3 (fields 10) (fields 3) P r μ Labels env members meet, + M.realize_batchEmbeddingFamilyFormula pairing unions powers separation + (fields 11) (fields 3) P (fields 4) (fields 5) (fields 7) (fields 8) env members, + M.realize_groundEligibleBatchActionFormula pairing unions powers separation + (fields 12) P G r μ A Labels env members meet] + constructor + · rintro ⟨points, order, meets, tasks, spaces, orders, meetGraphs, sources, bases, filters, separators, maps, action⟩ + rw [tasks] at spaces orders meetGraphs sources bases filters separators maps + rw [spaces, orders, sources, bases] at maps + apply funext + exact (Fin.cases points (Fin.cases order (Fin.cases meets (Fin.cases tasks (Fin.cases spaces (Fin.cases orders (Fin.cases meetGraphs (Fin.cases sources (Fin.cases bases (Fin.cases filters (Fin.cases separators (Fin.cases maps (Fin.cases action (fun i => Fin.elim0 i)))))))))))))) + · intro equal + have tasks := congrFun equal (3 : Fin 13) + have spaces := congrFun equal (4 : Fin 13) + have orders := congrFun equal (5 : Fin 13) + have sources := congrFun equal (7 : Fin 13) + have bases := congrFun equal (8 : Fin 13) + refine ⟨congrFun equal 0, congrFun equal 1, congrFun equal 2, tasks, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, congrFun equal 12⟩ + · rw [tasks] + exact spaces + · rw [tasks] + exact orders + · rw [tasks] + exact congrFun equal 6 + · rw [tasks] + exact sources + · rw [tasks] + exact bases + · rw [tasks] + exact congrFun equal 9 + · rw [tasks] + exact congrFun equal 10 + · rw [tasks, spaces, orders, sources, bases] + exact congrFun equal 11 + +noncomputable def initialCompressionDataFormula {n} (output P G r μ A Labels : Fin n) : SetFormula n := + exBlock 13 (.conj + (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 output) (prefixIndex n 13)).toFormula + (M.initialCompressionFieldsFormula pairing unions powers separation (prefixIndex n 13) + (suffixIndex n 13 P) (suffixIndex n 13 G) (suffixIndex n 13 r) (suffixIndex n 13 μ) + (suffixIndex n 13 A) (suffixIndex n 13 Labels))) + +theorem realize_initialCompressionDataFormula {n} (output P G r μ A Labels : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (meet : MeetOrderCode (env P) (env r) (env μ)) : + Realize M.sets (M.initialCompressionDataFormula pairing unions powers separation output P G r μ A Labels) env ↔ + env output = (M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels)).code := by + unfold initialCompressionDataFormula + rw [realize_exBlock] + let initial := M.initialCompressionData (env P) (env G) (env r) (env μ) (env A) (env Labels) + constructor + · rintro ⟨fields, fieldMembers, tuple, specified⟩ + have bounds := extendMany_members 13 fields env fieldMembers members + have tupleEq := (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 output) + (prefixIndex n 13) _).1 ((BoundedFormula.realize_toFormula M _ _ bounds).1 tuple) + have fieldsEq := (M.realize_initialCompressionFieldsFormula pairing unions powers separation + (prefixIndex n 13) (suffixIndex n 13 P) (suffixIndex n 13 G) (suffixIndex n 13 r) + (suffixIndex n 13 μ) (suffixIndex n 13 A) (suffixIndex n 13 Labels) _ bounds + (by simpa only [extendMany_suffix] using meet)).1 specified + simp only [extendMany_prefix, extendMany_suffix] at tupleEq fieldsEq + rw [fieldsEq] at tupleEq + exact tupleEq + · intro equal + have fieldMembers := M.recursiveStateData_field_mem initial (equal ▸ members output) + have bounds := extendMany_members 13 initial.field env fieldMembers members + refine ⟨initial.field, fieldMembers, ?_, ?_⟩ + · apply (BoundedFormula.realize_toFormula M _ _ bounds).2 + apply (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 output) (prefixIndex n 13) _).2 + simp only [extendMany_prefix, extendMany_suffix] + change env output = initial.code + exact equal + · apply (M.realize_initialCompressionFieldsFormula pairing unions powers separation + (prefixIndex n 13) (suffixIndex n 13 P) (suffixIndex n 13 G) (suffixIndex n 13 r) + (suffixIndex n 13 μ) (suffixIndex n 13 A) (suffixIndex n 13 Labels) _ bounds + (by simpa only [extendMany_suffix] using meet)).2 + simp only [extendMany_prefix, extendMany_suffix] + rfl + +end TransitiveGround + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem initialCompressionData_accounting + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels + FiniteCompressionAccounting P I Sources τ (M.initialCompressionData P G r μ A Labels) := by + dsimp only + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels + let Es := literalTaskBaseGraph I P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨_, _, entries⟩ := M.batchEmbeddingFamily_spec + pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 + intro x hx + change x ∈ d.batchCarrier at hx + obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx + cases X with + | inl p => exact Or.inl p.property + | inr q => + let i := q.1 + let S := batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) Sources Es i.val + have spaceEq : d.space i = P := + ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry i)).2 + have relEq : d.rel i = r := + ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry i)).2 + have function : ZFSet.IsFunc P d.batchCarrier S := by + simpa only [spaceEq] using d.batch_template_fiber_function i + have anchorP : d.anchor i ∈ P := by + simpa only [spaceEq] using (d.fiber i).anchor_mem + obtain ⟨k, cap, _⟩ := function.2 τ hτ + obtain ⟨b, base, _⟩ := function.2 (d.anchor i) anchorP + have image : ZFSet.pair q.2.val.val (d.coding.encode (.inr q)) ∈ S := by + apply (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 + apply (d.batch_template_entry_iff i _ _).2 + exact Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.2.val.property, q.2.property⟩, rfl⟩ + have pointP : q.2.val.val ∈ P := by + have member : q.2.val.val ∈ d.space i := q.2.val.property + simpa only [spaceEq] using member + refine Or.inr ⟨i.val, i.property, S, d.anchor i, k, b, q.2.val.val, pointP, + (entries _ _).2 ⟨i.property, rfl⟩, d.anchor_entry i, cap, base, image, ?_, ?_⟩ + · exact (d.batch_template_order_iff i image cap).2 (relEq.symm ▸ top _ pointP) + · intro lower + exact q.2.property ((d.batch_template_order_iff i image base).1 lower) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionUnionProfiles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionUnionProfiles.lean index ada753d6742b92f5030718da3e8d2e4b8d50ed19..d0535d533a3c1604cea911e56c6fed2abf6c00bf 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionUnionProfiles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialCompressionUnionProfiles.lean @@ -1,529 +1,529 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace AttachmentBatchInputs -universe u -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) - -theorem original_positive_iff (i : {i : ZFSet.{u} // i ∈ I}) - (x : {p : ZFSet.{u} // p ∈ P} ⊕ d.templates.Fresh) : - (∃ f ∈ d.filter i, ZFSet.pair f (d.coding.encode x) ∈ d.batchOrder) ↔ - Positive d.templates.extension (d.templates.originalFamily i) x := by - constructor - · rintro ⟨f, hf, lower⟩ - let old : {p : ZFSet.{u} // p ∈ P} := ⟨f, (d.fiber i).filter.subset hf⟩ - exact ⟨.inl old, hf, (d.coding.le_encode (.inl old) x).1 lower⟩ - · rintro ⟨f, hf, lower⟩ - cases f with - | inl f => exact ⟨f.val, hf, (d.coding.le_encode (.inl f) x).2 lower⟩ - | inr f => exact False.elim hf - -theorem initial_cap_profile (i : {i : ZFSet.{u} // i ∈ I}) (t : d.templates.Space i) - (top : ∀ y, (d.templates.order i).le y t) - (outside : ¬ (d.templates.order i).le t (d.templates.anchor i)) : - let cap := d.coding.encode (.inr (d.templates.cap i t outside)) - CodedInsertionProfile d.batchCarrier d.batchOrder d.batchMeetGraph - (d.templates.base i).val (d.separator i) cap (d.filter i) ∧ - ZFSet.pair (d.templates.base i).val cap ∈ d.batchOrder ∧ - ZFSet.pair cap (d.templates.base i).val ∉ d.batchOrder ∧ - ZFSet.pair (d.separator i) cap ∉ d.batchOrder := by - dsimp only - have profile := d.templates.initial_profile i t top outside - have strict := d.templates.cap_strict_above_base i t top outside - have separated := d.templates.separator_not_below_cap i t top outside - refine ⟨?_, (d.coding.le_encode _ _).2 strict.1, - fun lower => strict.2 ((d.coding.le_encode _ _).1 lower), - fun lower => separated ((d.coding.le_encode _ _).1 lower)⟩ - intro v hv above - obtain ⟨x, rfl⟩ := d.coding.encode_surjective v hv - have aboveTyped := (d.coding.le_encode (.inl (d.templates.separator i)) x).1 above - have result := profile x aboveTyped - constructor - · intro positive - exact (d.coding.le_encode _ _).2 (result.1 ((d.original_positive_iff i x).1 positive)) - · intro negative - have equal := result.2 (fun positive => negative ((d.original_positive_iff i x).2 positive)) - have entry := d.coding.encoded_meet_entry (.inr (d.templates.cap i t outside)) x - rw [equal] at entry - exact entry - -end AttachmentBatchInputs - -section -universe u - -namespace AttachmentBatchInputs -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} - -theorem fresh_shadow_separation - (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) - (i j : {i : ZFSet.{u} // i ∈ I}) {q t b c : ZFSet.{u}} - (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) - (ht : t ∈ freshPart (d.space j) (d.rel j) (d.anchor j)) - (different : i ≠ j) - (hb : ZFSet.pair (ZFSet.pair i.val q) b ∈ batchAttachmentShadowGraph I P Qs μs As Es) - (hc : ZFSet.pair (ZFSet.pair j.val t) c ∈ batchAttachmentShadowGraph I P Qs μs As Es) : - ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) c ∈ d.batchOrder ∨ - ZFSet.pair (ZFSet.pair P (ZFSet.pair j.val t)) b ∈ d.batchOrder ∨ - ∃ z, ZFSet.pair (ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) - (ZFSet.pair P (ZFSet.pair j.val t))) z ∈ d.batchMeetGraph ∧ - ZFSet.pair (ZFSet.pair b c) z ∈ d.batchMeetGraph := by - classical - have bP := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 hb)).2 - have cP := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 hc)).2 - by_cases first : c ∈ d.filter i - · exact Or.inl ((d.batch_old_upper_iff i hq cP).2 first) - by_cases second : b ∈ d.filter j - · exact Or.inr (Or.inl ((d.batch_old_upper_iff j ht bP).2 second)) - have notIJ := fun lower => first ((d.batch_cross_lower_iff i j hq ht different hc).1 lower) - have notJI := fun lower => second ((d.batch_cross_lower_iff j i ht hq different.symm hb).1 lower) - let x : {p : ZFSet.{u} // p ∈ P} := ⟨b, bP⟩ - let y : {p : ZFSet.{u} // p ∈ P} := ⟨c, cP⟩ - refine Or.inr (Or.inr ⟨(d.oldOrder.toMeetOrder.meet x y).val, ?_, ?_⟩) - · exact d.batch_cross_meet_code i j hq ht different hb hc - (d.oldOrder.toMeetOrder_meet_entry x y) notIJ notJI - · exact d.old_meet_entry (d.oldOrder.toMeetOrder_meet_entry x y) - -end AttachmentBatchInputs - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) -variable {P G r μ A Labels m inv one T : ZFSet.{u}} -variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) -variable (meet : MeetOrderCode P r μ) (hT : T ∈ P) (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) -include group action meet hT top - -theorem groundEligibleTask_old_below_cap_iff {i c v : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) - (target : ZFSet.pair i c ∈ literalTaskTargetGraph - (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels) (hv : v ∈ P) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair v (eligibleTaskCap P T i) ∈ d.batchOrder ↔ ZFSet.pair v c ∈ d.batchOrder := by - dsimp only - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have fresh := M.groundEligibleTask_cap_fresh group action meet hT top hi - have hq := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors - (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh - have shadow := M.groundEligibleTask_cap_shadow meet hT top hi target - have hc := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 shadow)).2 - exact (d.batch_old_lower_iff j hq hv shadow).trans - (d.coding.le_encode (.inl ⟨v, hv⟩) (.inl ⟨c, hc⟩)).symm - -theorem groundEligibleTask_cap_separation {i j b c : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) - (hj : j ∈ M.groundEligibleTasks P G r μ A Labels) (different : i ≠ j) - (targetI : ZFSet.pair i b ∈ literalTaskTargetGraph - (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels) - (targetJ : ZFSet.pair j c ∈ literalTaskTargetGraph - (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair (eligibleTaskCap P T i) c ∈ d.batchOrder ∨ - ZFSet.pair (eligibleTaskCap P T j) b ∈ d.batchOrder ∨ - ∃ z, ZFSet.pair (ZFSet.pair (eligibleTaskCap P T i) (eligibleTaskCap P T j)) z ∈ d.batchMeetGraph ∧ - ZFSet.pair (ZFSet.pair b c) z ∈ d.batchMeetGraph := by - dsimp only - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let k : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - let l : {i : ZFSet.{u} // i ∈ I} := ⟨j, hj⟩ - have freshI := M.groundEligibleTask_cap_fresh group action meet hT top hi - have freshJ := M.groundEligibleTask_cap_fresh group action meet hT top hj - have hq := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors - (d.space_entry k) (d.rel_entry k) (d.anchor_entry k)).1 freshI - have ht := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors - (d.space_entry l) (d.rel_entry l) (d.anchor_entry l)).1 freshJ - exact d.fresh_shadow_separation k l hq ht (fun equal => different (congrArg Subtype.val equal)) - (M.groundEligibleTask_cap_shadow meet hT top hi targetI) - (M.groundEligibleTask_cap_shadow meet hT top hj targetJ) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) -variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) -include pairing unions powers separation hP hG hr hμ hA hLabels - -theorem groundInitialMap_cap_base_values {i S a c K b : ZFSet.{u}} : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es - ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → - ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → - ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → - K = eligibleTaskCap P T i ∧ b = c := by - dsimp only - intro indexed source target cap base - obtain ⟨function, capEntry, baseEntry⟩ := M.groundInitialMap_cap_base - pairing unions powers separation hP hG hr hμ hA hLabels group action meet hT top - indexed source target - let graph : FunctionGraphOn P S := ⟨_, function⟩ - exact ⟨graph.unique cap capEntry, graph.unique base baseEntry⟩ - -theorem groundInitialMap_old_below_cap_iff {i S a c K b v : ZFSet.{u}} : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → - ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → - ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → v ∈ P → - (ZFSet.pair v K ∈ d.batchOrder ↔ ZFSet.pair v b ∈ d.batchOrder) := by - dsimp only - intro indexed source target cap base hv - obtain ⟨capEq, baseEq⟩ := M.groundInitialMap_cap_base_values - group action meet hT top pairing unions powers separation hP hG hr hμ hA hLabels - indexed source target cap base - have hi := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 - rw [capEq, baseEq] - exact M.groundEligibleTask_old_below_cap_iff group action meet hT top hi target hv - -theorem groundInitialMap_cap_separation {i j S V a a' c c' K K' b b' : ZFSet.{u}} : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair i S ∈ Maps → ZFSet.pair j V ∈ Maps → - ZFSet.pair i a ∈ As → ZFSet.pair j a' ∈ As → - ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → - ZFSet.pair j c' ∈ literalTaskTargetGraph I P R U Labels → - ZFSet.pair T K ∈ S → ZFSet.pair T K' ∈ V → - ZFSet.pair a b ∈ S → ZFSet.pair a' b' ∈ V → i ≠ j → - ZFSet.pair K b' ∈ d.batchOrder ∨ ZFSet.pair K' b ∈ d.batchOrder ∨ - ∃ z, ZFSet.pair (ZFSet.pair K K') z ∈ d.batchMeetGraph ∧ - ZFSet.pair (ZFSet.pair b b') z ∈ d.batchMeetGraph := by - dsimp only - intro indexed indexed' source source' target target' cap cap' base base' different - obtain ⟨capEq, baseEq⟩ := M.groundInitialMap_cap_base_values - group action meet hT top pairing unions powers separation hP hG hr hμ hA hLabels - indexed source target cap base - obtain ⟨capEq', baseEq'⟩ := M.groundInitialMap_cap_base_values - group action meet hT top pairing unions powers separation hP hG hr hμ hA hLabels - indexed' source' target' cap' base' - have hi := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 - have hj := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source').1).1 - rw [capEq, capEq', baseEq, baseEq'] - exact M.groundEligibleTask_cap_separation group action meet hT top hi hj different target target' - -end TransitiveGround -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable {P G r μ A Labels m inv one T : ZFSet.{u}} -variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) -variable (meet : MeetOrderCode P r μ) (hT : T ∈ P) (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) -include group action meet hT top - -theorem groundEligibleTask_initial_profile {i c e F : ZFSet.{u}} - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) - (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (separator : ZFSet.pair i e ∈ literalTaskSeparatorGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - c ∈ P ∧ e ∈ P ∧ eligibleTaskCap P T i ∈ d.batchCarrier ∧ F ⊆ P ∧ F.Nonempty ∧ - CodedInsertionProfile d.batchCarrier d.batchOrder d.batchMeetGraph c e (eligibleTaskCap P T i) F ∧ - ZFSet.pair c (eligibleTaskCap P T i) ∈ d.batchOrder ∧ - ZFSet.pair (eligibleTaskCap P T i) c ∉ d.batchOrder ∧ - ZFSet.pair e (eligibleTaskCap P T i) ∉ d.batchOrder := by - dsimp only - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 - have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 - have fresh := M.groundEligibleTask_cap_fresh group action meet hT top hi - have freshT := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors - (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh - have parts := (mem_freshPart _ _ _ T).1 freshT - let t : d.templates.Space j := ⟨T, parts.1⟩ - have outside : ¬ (d.templates.order j).le t (d.templates.anchor j) := parts.2 - have greatest : ∀ y, (d.templates.order j).le y t := by - intro y - change ZFSet.pair y.val T ∈ d.rel j - rw [relEq] - have hy : y.val ∈ d.space j := y.property - exact top y.val (by simpa only [spaceEq] using hy) - let cap := d.templates.cap j t outside - have shadow : ZFSet.pair (d.freshCode cap) c ∈ - batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) - (literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (literalTaskBaseGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) := - M.groundEligibleTask_cap_shadow meet hT top hi target - have baseEq : (d.templates.base j).val = c := by - have equal := d.freshCode_shadow_value cap c shadow - change c = (d.templates.shadow (d.templates.cap j t outside)).val at equal - rw [d.templates.cap_shadow j t greatest outside] at equal - exact equal.symm - have separatorEq : d.separator j = e := d.separators.unique (d.separator_entry j) separator - have filterEq : d.filter j = F := d.filters.unique (d.filter_entry j) filter - have hcP : c ∈ P := baseEq ▸ (d.templates.base j).property - have heP : e ∈ P := separatorEq ▸ (d.fiber j).separator_mem - have filterSubset : F ⊆ P := filterEq ▸ (d.fiber j).filter.subset - have nonempty : F.Nonempty := filterEq ▸ (d.fiber j).filter.nonempty - refine ⟨hcP, heP, M.groundEligibleTask_cap_mem group action meet hT top hi, - filterSubset, nonempty, ?_⟩ - have laws := d.initial_cap_profile j t greatest outside - have capEq : d.coding.encode (.inr (d.templates.cap j t outside)) = eligibleTaskCap P T i := rfl - simpa only [baseEq, separatorEq, filterEq, capEq] using laws - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) -variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) -include pairing unions powers separation hP hG hr hμ hA hLabels - -theorem groundInitialMap_profile {i S a c e F K b : ZFSet.{u}} : - let initial := M.initialCompressionData P G r μ A Labels - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - ZFSet.pair i S ∈ initial.Maps → - ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels → - ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → - ZFSet.pair i e ∈ literalTaskSeparatorGraph I P R U Labels → - ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels → - ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → - b = c ∧ b ∈ initial.currentCarrier ∧ e ∈ initial.currentCarrier ∧ K ∈ initial.currentCarrier ∧ - F ⊆ initial.currentCarrier ∧ F.Nonempty ∧ - CodedInsertionProfile initial.currentCarrier initial.currentOrder initial.currentMeet b e K F ∧ - ZFSet.pair b K ∈ initial.currentOrder ∧ ZFSet.pair K b ∉ initial.currentOrder ∧ - ZFSet.pair e K ∉ initial.currentOrder := by - dsimp only - intro indexed source target separator filter cap base - obtain ⟨capEq, baseEq⟩ := M.groundInitialMap_cap_base_values group action meet hT top - pairing unions powers separation hP hG hr hμ hA hLabels indexed source target cap base - have hi := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 - refine ⟨baseEq, ?_⟩ - rw [capEq, baseEq] - obtain ⟨hcP, heP, hk, subset, nonempty, laws⟩ := - M.groundEligibleTask_initial_profile group action meet hT top hi target separator filter - exact ⟨old_mem_taggedExtension hcP, old_mem_taggedExtension heP, hk, - fun _ hf => old_mem_taggedExtension (subset hf), nonempty, laws⟩ - -end TransitiveGround - -namespace GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -theorem union_profile {c e K F : ZFSet.{u}} - (hc : c ∈ state.data.currentCarrier) (he : e ∈ state.data.currentCarrier) - (hK : K ∈ state.data.currentCarrier) (subset : F ⊆ state.data.currentCarrier) - (nonempty : ∃ f, f ∈ F) - (profile : CodedInsertionProfile state.data.currentCarrier state.data.currentOrder - state.data.currentMeet c e K F) - (separated : ZFSet.pair e K ∉ state.data.currentOrder) : - CodedInsertionProfile (data.fields 0) (data.fields 1) (data.fields 2) c e K F := - data.currentOrder.insertionProfile data.currentMeet - (fun n => (state.canonical_iterate_codes pairing unions powers separation - hI hSources hReps hG hT n).2.1.order) - (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT h).2.2.2.2.1) - (state.canonical_iterate_profile pairing unions powers separation - hI hSources hReps hG hT hc he hK subset nonempty profile separated) - -theorem union_separator_not_below_cap {e K : ZFSet.{u}} - (he : e ∈ state.data.currentCarrier) (hK : K ∈ state.data.currentCarrier) - (separated : ZFSet.pair e K ∉ state.data.currentOrder) : - ZFSet.pair e K ∉ data.fields 1 := by - intro below - exact separated ((state.union_order_iff data pairing unions powers separation - hI hSources hReps hG hT 1 he hK).1 below) - -end GroundCompressionState - -section -open SetFormula -universe u - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) - -theorem union_input_capProfile - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {c e K F : ZFSet.{u}} - (profile : CodedCapProfile state.data.D state.data.rD state.data.μD c e K F) : - CodedCapProfile (data.fields 0) (data.fields 1) (data.fields 2) c e K F := by - have hc : c ∈ state.data.currentCarrier := old_mem_taggedExtension profile.target_mem - have he : e ∈ state.data.currentCarrier := old_mem_taggedExtension profile.separator_mem - have hK : K ∈ state.data.currentCarrier := old_mem_taggedExtension profile.cap_mem - have subset : F ⊆ state.data.currentCarrier := fun _ hf => old_mem_taggedExtension (profile.filter_subset hf) - have first := state.batch.insertion_profile_persists profile.target_mem profile.separator_mem - profile.cap_mem profile.filter_subset profile.nonempty profile.profile profile.separator_not_below_cap - have separated : ZFSet.pair e K ∉ state.data.currentOrder := by - intro lower - exact profile.separator_not_below_cap - ((state.batch.old_order_iff profile.separator_mem profile.cap_mem).1 lower) - refine ⟨(data.fieldUnion 0).subset 0 profile.target_mem, - (data.fieldUnion 0).subset 0 profile.separator_mem, - (data.fieldUnion 0).subset 0 profile.cap_mem, - fun _ hf => (data.fieldUnion 0).subset 0 (profile.filter_subset hf), profile.nonempty, - state.union_profile data pairing unions powers separation hI hSources hReps hG hT - hc he hK subset profile.nonempty first separated, ?_, ?_, ?_⟩ - · exact (state.union_order_iff data pairing unions powers separation hI hSources hReps hG hT - 0 profile.target_mem profile.cap_mem).2 profile.target_below_cap - · intro lower - exact profile.cap_not_below_target ((state.union_order_iff data pairing unions powers separation - hI hSources hReps hG hT 0 profile.cap_mem profile.target_mem).1 lower) - · intro lower - exact profile.separator_not_below_cap ((state.union_order_iff data pairing unions powers separation - hI hSources hReps hG hT 0 profile.separator_mem profile.cap_mem).1 lower) - -end GroundCompressionState - -namespace GroundCompressionOrigin -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) - -include origin in -theorem union_input_capProfile - (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {c e K F : ZFSet.{u}} (profile : CodedCapProfile initial.D initial.rD initial.μD c e K F) : - CodedCapProfile (data.fields 0) (data.fields 1) (data.fields 2) c e K F := by - obtain ⟨seed, state, equal⟩ := origin - cases equal - exact state.union_input_capProfile data pairing unions powers separation - hI hSources hReps hG hT profile - -end GroundCompressionOrigin -end - -namespace GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} -variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) -variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hP hG hr hμ hA hLabels hI hSources hReps hT - -theorem union_initial_profile - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - {i f a c e F K : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (separator : ZFSet.pair i e ∈ literalTaskSeparatorGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (cap : ZFSet.pair τ K ∈ f) : - CodedCapProfile (algebra.union.fields 0) (algebra.union.fields 1) (algebra.union.fields 2) c e K F := by - have ha : a ∈ P := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).2 - have haD : a ∈ state.data.D := by - simpa only [initialData, TransitiveGround.initialCompressionData] using ha - have hτD : τ ∈ state.data.D := by - simpa only [initialData, TransitiveGround.initialCompressionData] using seed.top_mem - obtain ⟨old, oldEntry⟩ := state.inputs.maps.total (algebra.function.pair_source indexed) - obtain ⟨b, base, _⟩ := (state.inputs.valid i old oldEntry).injection.function.2 a haD - have capOld := (algebra.restrict i f indexed 0 old oldEntry τ hτD K).1 cap - have indexedOld : ZFSet.pair i old ∈ (M.initialCompressionData P G r μ A Labels).Maps := by - simpa only [initialData] using oldEntry - have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by - simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top - obtain ⟨baseEq, hc, he, hK, subset, nonempty, profile, lower, reverse, separate⟩ := - M.groundInitialMap_profile state.inputs.group seed.originalAction seed.originalOrder seed.top_mem top - pairing unions powers separation hP hG hr hμ hA hLabels - indexedOld source target separator filter capOld base - subst b - have first : CodedCapProfile state.data.currentCarrier state.data.currentOrder state.data.currentMeet c e K F := by - rw [initialData] - exact ⟨hc, he, hK, subset, nonempty, profile, lower, reverse, separate⟩ - refine ⟨algebra.union.currentCarrier.subset 0 first.target_mem, - algebra.union.currentCarrier.subset 0 first.separator_mem, - algebra.union.currentCarrier.subset 0 first.cap_mem, - fun _ hf => algebra.union.currentCarrier.subset 0 (first.filter_subset hf), first.nonempty, - state.union_profile algebra.union pairing unions powers separation hI hSources hReps hG hT - first.target_mem first.separator_mem first.cap_mem first.filter_subset first.nonempty - first.profile first.separator_not_below_cap, - algebra.union.currentOrder.subset 0 first.target_below_cap, ?_, ?_⟩ - · intro below - exact first.cap_not_below_target ((state.union_order_iff algebra.union pairing unions powers separation - hI hSources hReps hG hT 1 first.cap_mem first.target_mem).1 below) - · exact state.union_separator_not_below_cap algebra.union pairing unions powers separation - hI hSources hReps hG hT first.separator_mem first.cap_mem first.separator_not_below_cap - -theorem initial_union_profiles - (initialData : state.data = M.initialCompressionData P G r μ A Labels) - (initialSources : Sources = literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : - CodedCompressionProfiles (algebra.union.fields 0) (algebra.union.fields 1) (algebra.union.fields 2) - (algebra.caps τ) - (literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (literalTaskSeparatorGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) := by - intro i c e K F cap target separator filter - have hi := (ZFSet.pair_mem_prod.1 ((state.union_caps_function algebra).1 cap)).1 - obtain ⟨f, indexed⟩ := algebra.function.total hi - obtain ⟨a, source, _⟩ := seed.sources.2 i hi - rw [initialSources] at source - exact state.union_initial_profile algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData indexed source target separator filter - ((state.union_cap_entry_iff algebra indexed).1 cap) - -end GroundCompressionState - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionUnionBaseFilling + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace AttachmentBatchInputs +universe u +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) + +theorem original_positive_iff (i : {i : ZFSet.{u} // i ∈ I}) + (x : {p : ZFSet.{u} // p ∈ P} ⊕ d.templates.Fresh) : + (∃ f ∈ d.filter i, ZFSet.pair f (d.coding.encode x) ∈ d.batchOrder) ↔ + Positive d.templates.extension (d.templates.originalFamily i) x := by + constructor + · rintro ⟨f, hf, lower⟩ + let old : {p : ZFSet.{u} // p ∈ P} := ⟨f, (d.fiber i).filter.subset hf⟩ + exact ⟨.inl old, hf, (d.coding.le_encode (.inl old) x).1 lower⟩ + · rintro ⟨f, hf, lower⟩ + cases f with + | inl f => exact ⟨f.val, hf, (d.coding.le_encode (.inl f) x).2 lower⟩ + | inr f => exact False.elim hf + +theorem initial_cap_profile (i : {i : ZFSet.{u} // i ∈ I}) (t : d.templates.Space i) + (top : ∀ y, (d.templates.order i).le y t) + (outside : ¬ (d.templates.order i).le t (d.templates.anchor i)) : + let cap := d.coding.encode (.inr (d.templates.cap i t outside)) + CodedInsertionProfile d.batchCarrier d.batchOrder d.batchMeetGraph + (d.templates.base i).val (d.separator i) cap (d.filter i) ∧ + ZFSet.pair (d.templates.base i).val cap ∈ d.batchOrder ∧ + ZFSet.pair cap (d.templates.base i).val ∉ d.batchOrder ∧ + ZFSet.pair (d.separator i) cap ∉ d.batchOrder := by + dsimp only + have profile := d.templates.initial_profile i t top outside + have strict := d.templates.cap_strict_above_base i t top outside + have separated := d.templates.separator_not_below_cap i t top outside + refine ⟨?_, (d.coding.le_encode _ _).2 strict.1, + fun lower => strict.2 ((d.coding.le_encode _ _).1 lower), + fun lower => separated ((d.coding.le_encode _ _).1 lower)⟩ + intro v hv above + obtain ⟨x, rfl⟩ := d.coding.encode_surjective v hv + have aboveTyped := (d.coding.le_encode (.inl (d.templates.separator i)) x).1 above + have result := profile x aboveTyped + constructor + · intro positive + exact (d.coding.le_encode _ _).2 (result.1 ((d.original_positive_iff i x).1 positive)) + · intro negative + have equal := result.2 (fun positive => negative ((d.original_positive_iff i x).2 positive)) + have entry := d.coding.encoded_meet_entry (.inr (d.templates.cap i t outside)) x + rw [equal] at entry + exact entry + +end AttachmentBatchInputs + +section +universe u + +namespace AttachmentBatchInputs +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} + +theorem fresh_shadow_separation + (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) + (i j : {i : ZFSet.{u} // i ∈ I}) {q t b c : ZFSet.{u}} + (hq : q ∈ freshPart (d.space i) (d.rel i) (d.anchor i)) + (ht : t ∈ freshPart (d.space j) (d.rel j) (d.anchor j)) + (different : i ≠ j) + (hb : ZFSet.pair (ZFSet.pair i.val q) b ∈ batchAttachmentShadowGraph I P Qs μs As Es) + (hc : ZFSet.pair (ZFSet.pair j.val t) c ∈ batchAttachmentShadowGraph I P Qs μs As Es) : + ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) c ∈ d.batchOrder ∨ + ZFSet.pair (ZFSet.pair P (ZFSet.pair j.val t)) b ∈ d.batchOrder ∨ + ∃ z, ZFSet.pair (ZFSet.pair (ZFSet.pair P (ZFSet.pair i.val q)) + (ZFSet.pair P (ZFSet.pair j.val t))) z ∈ d.batchMeetGraph ∧ + ZFSet.pair (ZFSet.pair b c) z ∈ d.batchMeetGraph := by + classical + have bP := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 hb)).2 + have cP := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 hc)).2 + by_cases first : c ∈ d.filter i + · exact Or.inl ((d.batch_old_upper_iff i hq cP).2 first) + by_cases second : b ∈ d.filter j + · exact Or.inr (Or.inl ((d.batch_old_upper_iff j ht bP).2 second)) + have notIJ := fun lower => first ((d.batch_cross_lower_iff i j hq ht different hc).1 lower) + have notJI := fun lower => second ((d.batch_cross_lower_iff j i ht hq different.symm hb).1 lower) + let x : {p : ZFSet.{u} // p ∈ P} := ⟨b, bP⟩ + let y : {p : ZFSet.{u} // p ∈ P} := ⟨c, cP⟩ + refine Or.inr (Or.inr ⟨(d.oldOrder.toMeetOrder.meet x y).val, ?_, ?_⟩) + · exact d.batch_cross_meet_code i j hq ht different hb hc + (d.oldOrder.toMeetOrder_meet_entry x y) notIJ notJI + · exact d.old_meet_entry (d.oldOrder.toMeetOrder_meet_entry x y) + +end AttachmentBatchInputs + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) +variable {P G r μ A Labels m inv one T : ZFSet.{u}} +variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) +variable (meet : MeetOrderCode P r μ) (hT : T ∈ P) (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) +include group action meet hT top + +theorem groundEligibleTask_old_below_cap_iff {i c v : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) + (target : ZFSet.pair i c ∈ literalTaskTargetGraph + (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels) (hv : v ∈ P) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair v (eligibleTaskCap P T i) ∈ d.batchOrder ↔ ZFSet.pair v c ∈ d.batchOrder := by + dsimp only + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have fresh := M.groundEligibleTask_cap_fresh group action meet hT top hi + have hq := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors + (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh + have shadow := M.groundEligibleTask_cap_shadow meet hT top hi target + have hc := (ZFSet.pair_mem_prod.1 (d.batch_shadow_function.1 shadow)).2 + exact (d.batch_old_lower_iff j hq hv shadow).trans + (d.coding.le_encode (.inl ⟨v, hv⟩) (.inl ⟨c, hc⟩)).symm + +theorem groundEligibleTask_cap_separation {i j b c : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) + (hj : j ∈ M.groundEligibleTasks P G r μ A Labels) (different : i ≠ j) + (targetI : ZFSet.pair i b ∈ literalTaskTargetGraph + (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels) + (targetJ : ZFSet.pair j c ∈ literalTaskTargetGraph + (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair (eligibleTaskCap P T i) c ∈ d.batchOrder ∨ + ZFSet.pair (eligibleTaskCap P T j) b ∈ d.batchOrder ∨ + ∃ z, ZFSet.pair (ZFSet.pair (eligibleTaskCap P T i) (eligibleTaskCap P T j)) z ∈ d.batchMeetGraph ∧ + ZFSet.pair (ZFSet.pair b c) z ∈ d.batchMeetGraph := by + dsimp only + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let k : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + let l : {i : ZFSet.{u} // i ∈ I} := ⟨j, hj⟩ + have freshI := M.groundEligibleTask_cap_fresh group action meet hT top hi + have freshJ := M.groundEligibleTask_cap_fresh group action meet hT top hj + have hq := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors + (d.space_entry k) (d.rel_entry k) (d.anchor_entry k)).1 freshI + have ht := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors + (d.space_entry l) (d.rel_entry l) (d.anchor_entry l)).1 freshJ + exact d.fresh_shadow_separation k l hq ht (fun equal => different (congrArg Subtype.val equal)) + (M.groundEligibleTask_cap_shadow meet hT top hi targetI) + (M.groundEligibleTask_cap_shadow meet hT top hj targetJ) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) +variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) +include pairing unions powers separation hP hG hr hμ hA hLabels + +theorem groundInitialMap_cap_base_values {i S a c K b : ZFSet.{u}} : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es + ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → + ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → + ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → + K = eligibleTaskCap P T i ∧ b = c := by + dsimp only + intro indexed source target cap base + obtain ⟨function, capEntry, baseEntry⟩ := M.groundInitialMap_cap_base + pairing unions powers separation hP hG hr hμ hA hLabels group action meet hT top + indexed source target + let graph : FunctionGraphOn P S := ⟨_, function⟩ + exact ⟨graph.unique cap capEntry, graph.unique base baseEntry⟩ + +theorem groundInitialMap_old_below_cap_iff {i S a c K b v : ZFSet.{u}} : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → + ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → + ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → v ∈ P → + (ZFSet.pair v K ∈ d.batchOrder ↔ ZFSet.pair v b ∈ d.batchOrder) := by + dsimp only + intro indexed source target cap base hv + obtain ⟨capEq, baseEq⟩ := M.groundInitialMap_cap_base_values + group action meet hT top pairing unions powers separation hP hG hr hμ hA hLabels + indexed source target cap base + have hi := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 + rw [capEq, baseEq] + exact M.groundEligibleTask_old_below_cap_iff group action meet hT top hi target hv + +theorem groundInitialMap_cap_separation {i j S V a a' c c' K K' b b' : ZFSet.{u}} : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair i S ∈ Maps → ZFSet.pair j V ∈ Maps → + ZFSet.pair i a ∈ As → ZFSet.pair j a' ∈ As → + ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → + ZFSet.pair j c' ∈ literalTaskTargetGraph I P R U Labels → + ZFSet.pair T K ∈ S → ZFSet.pair T K' ∈ V → + ZFSet.pair a b ∈ S → ZFSet.pair a' b' ∈ V → i ≠ j → + ZFSet.pair K b' ∈ d.batchOrder ∨ ZFSet.pair K' b ∈ d.batchOrder ∨ + ∃ z, ZFSet.pair (ZFSet.pair K K') z ∈ d.batchMeetGraph ∧ + ZFSet.pair (ZFSet.pair b b') z ∈ d.batchMeetGraph := by + dsimp only + intro indexed indexed' source source' target target' cap cap' base base' different + obtain ⟨capEq, baseEq⟩ := M.groundInitialMap_cap_base_values + group action meet hT top pairing unions powers separation hP hG hr hμ hA hLabels + indexed source target cap base + obtain ⟨capEq', baseEq'⟩ := M.groundInitialMap_cap_base_values + group action meet hT top pairing unions powers separation hP hG hr hμ hA hLabels + indexed' source' target' cap' base' + have hi := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 + have hj := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source').1).1 + rw [capEq, capEq', baseEq, baseEq'] + exact M.groundEligibleTask_cap_separation group action meet hT top hi hj different target target' + +end TransitiveGround +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable {P G r μ A Labels m inv one T : ZFSet.{u}} +variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) +variable (meet : MeetOrderCode P r μ) (hT : T ∈ P) (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) +include group action meet hT top + +theorem groundEligibleTask_initial_profile {i c e F : ZFSet.{u}} + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) + (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (separator : ZFSet.pair i e ∈ literalTaskSeparatorGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + c ∈ P ∧ e ∈ P ∧ eligibleTaskCap P T i ∈ d.batchCarrier ∧ F ⊆ P ∧ F.Nonempty ∧ + CodedInsertionProfile d.batchCarrier d.batchOrder d.batchMeetGraph c e (eligibleTaskCap P T i) F ∧ + ZFSet.pair c (eligibleTaskCap P T i) ∈ d.batchOrder ∧ + ZFSet.pair (eligibleTaskCap P T i) c ∉ d.batchOrder ∧ + ZFSet.pair e (eligibleTaskCap P T i) ∉ d.batchOrder := by + dsimp only + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 + have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 + have fresh := M.groundEligibleTask_cap_fresh group action meet hT top hi + have freshT := (pair_mem_indexedAttachmentFresh_of_entries d.spaces d.relations d.anchors + (d.space_entry j) (d.rel_entry j) (d.anchor_entry j)).1 fresh + have parts := (mem_freshPart _ _ _ T).1 freshT + let t : d.templates.Space j := ⟨T, parts.1⟩ + have outside : ¬ (d.templates.order j).le t (d.templates.anchor j) := parts.2 + have greatest : ∀ y, (d.templates.order j).le y t := by + intro y + change ZFSet.pair y.val T ∈ d.rel j + rw [relEq] + have hy : y.val ∈ d.space j := y.property + exact top y.val (by simpa only [spaceEq] using hy) + let cap := d.templates.cap j t outside + have shadow : ZFSet.pair (d.freshCode cap) c ∈ + batchAttachmentShadowGraph I P (constantFamilyGraph I P) (constantFamilyGraph I μ) + (literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (literalTaskBaseGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) := + M.groundEligibleTask_cap_shadow meet hT top hi target + have baseEq : (d.templates.base j).val = c := by + have equal := d.freshCode_shadow_value cap c shadow + change c = (d.templates.shadow (d.templates.cap j t outside)).val at equal + rw [d.templates.cap_shadow j t greatest outside] at equal + exact equal.symm + have separatorEq : d.separator j = e := d.separators.unique (d.separator_entry j) separator + have filterEq : d.filter j = F := d.filters.unique (d.filter_entry j) filter + have hcP : c ∈ P := baseEq ▸ (d.templates.base j).property + have heP : e ∈ P := separatorEq ▸ (d.fiber j).separator_mem + have filterSubset : F ⊆ P := filterEq ▸ (d.fiber j).filter.subset + have nonempty : F.Nonempty := filterEq ▸ (d.fiber j).filter.nonempty + refine ⟨hcP, heP, M.groundEligibleTask_cap_mem group action meet hT top hi, + filterSubset, nonempty, ?_⟩ + have laws := d.initial_cap_profile j t greatest outside + have capEq : d.coding.encode (.inr (d.templates.cap j t outside)) = eligibleTaskCap P T i := rfl + simpa only [baseEq, separatorEq, filterEq, capEq] using laws + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) +variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) +include pairing unions powers separation hP hG hr hμ hA hLabels + +theorem groundInitialMap_profile {i S a c e F K b : ZFSet.{u}} : + let initial := M.initialCompressionData P G r μ A Labels + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + ZFSet.pair i S ∈ initial.Maps → + ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels → + ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → + ZFSet.pair i e ∈ literalTaskSeparatorGraph I P R U Labels → + ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels → + ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → + b = c ∧ b ∈ initial.currentCarrier ∧ e ∈ initial.currentCarrier ∧ K ∈ initial.currentCarrier ∧ + F ⊆ initial.currentCarrier ∧ F.Nonempty ∧ + CodedInsertionProfile initial.currentCarrier initial.currentOrder initial.currentMeet b e K F ∧ + ZFSet.pair b K ∈ initial.currentOrder ∧ ZFSet.pair K b ∉ initial.currentOrder ∧ + ZFSet.pair e K ∉ initial.currentOrder := by + dsimp only + intro indexed source target separator filter cap base + obtain ⟨capEq, baseEq⟩ := M.groundInitialMap_cap_base_values group action meet hT top + pairing unions powers separation hP hG hr hμ hA hLabels indexed source target cap base + have hi := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).1 + refine ⟨baseEq, ?_⟩ + rw [capEq, baseEq] + obtain ⟨hcP, heP, hk, subset, nonempty, laws⟩ := + M.groundEligibleTask_initial_profile group action meet hT top hi target separator filter + exact ⟨old_mem_taggedExtension hcP, old_mem_taggedExtension heP, hk, + fun _ hf => old_mem_taggedExtension (subset hf), nonempty, laws⟩ + +end TransitiveGround + +namespace GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +theorem union_profile {c e K F : ZFSet.{u}} + (hc : c ∈ state.data.currentCarrier) (he : e ∈ state.data.currentCarrier) + (hK : K ∈ state.data.currentCarrier) (subset : F ⊆ state.data.currentCarrier) + (nonempty : ∃ f, f ∈ F) + (profile : CodedInsertionProfile state.data.currentCarrier state.data.currentOrder + state.data.currentMeet c e K F) + (separated : ZFSet.pair e K ∉ state.data.currentOrder) : + CodedInsertionProfile (data.fields 0) (data.fields 1) (data.fields 2) c e K F := + data.currentOrder.insertionProfile data.currentMeet + (fun n => (state.canonical_iterate_codes pairing unions powers separation + hI hSources hReps hG hT n).2.1.order) + (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT h).2.2.2.2.1) + (state.canonical_iterate_profile pairing unions powers separation + hI hSources hReps hG hT hc he hK subset nonempty profile separated) + +theorem union_separator_not_below_cap {e K : ZFSet.{u}} + (he : e ∈ state.data.currentCarrier) (hK : K ∈ state.data.currentCarrier) + (separated : ZFSet.pair e K ∉ state.data.currentOrder) : + ZFSet.pair e K ∉ data.fields 1 := by + intro below + exact separated ((state.union_order_iff data pairing unions powers separation + hI hSources hReps hG hT 1 he hK).1 below) + +end GroundCompressionState + +section +open SetFormula +universe u + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) + +theorem union_input_capProfile + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {c e K F : ZFSet.{u}} + (profile : CodedCapProfile state.data.D state.data.rD state.data.μD c e K F) : + CodedCapProfile (data.fields 0) (data.fields 1) (data.fields 2) c e K F := by + have hc : c ∈ state.data.currentCarrier := old_mem_taggedExtension profile.target_mem + have he : e ∈ state.data.currentCarrier := old_mem_taggedExtension profile.separator_mem + have hK : K ∈ state.data.currentCarrier := old_mem_taggedExtension profile.cap_mem + have subset : F ⊆ state.data.currentCarrier := fun _ hf => old_mem_taggedExtension (profile.filter_subset hf) + have first := state.batch.insertion_profile_persists profile.target_mem profile.separator_mem + profile.cap_mem profile.filter_subset profile.nonempty profile.profile profile.separator_not_below_cap + have separated : ZFSet.pair e K ∉ state.data.currentOrder := by + intro lower + exact profile.separator_not_below_cap + ((state.batch.old_order_iff profile.separator_mem profile.cap_mem).1 lower) + refine ⟨(data.fieldUnion 0).subset 0 profile.target_mem, + (data.fieldUnion 0).subset 0 profile.separator_mem, + (data.fieldUnion 0).subset 0 profile.cap_mem, + fun _ hf => (data.fieldUnion 0).subset 0 (profile.filter_subset hf), profile.nonempty, + state.union_profile data pairing unions powers separation hI hSources hReps hG hT + hc he hK subset profile.nonempty first separated, ?_, ?_, ?_⟩ + · exact (state.union_order_iff data pairing unions powers separation hI hSources hReps hG hT + 0 profile.target_mem profile.cap_mem).2 profile.target_below_cap + · intro lower + exact profile.cap_not_below_target ((state.union_order_iff data pairing unions powers separation + hI hSources hReps hG hT 0 profile.cap_mem profile.target_mem).1 lower) + · intro lower + exact profile.separator_not_below_cap ((state.union_order_iff data pairing unions powers separation + hI hSources hReps hG hT 0 profile.separator_mem profile.cap_mem).1 lower) + +end GroundCompressionState + +namespace GroundCompressionOrigin +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) + +include origin in +theorem union_input_capProfile + (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {c e K F : ZFSet.{u}} (profile : CodedCapProfile initial.D initial.rD initial.μD c e K F) : + CodedCapProfile (data.fields 0) (data.fields 1) (data.fields 2) c e K F := by + obtain ⟨seed, state, equal⟩ := origin + cases equal + exact state.union_input_capProfile data pairing unions powers separation + hI hSources hReps hG hT profile + +end GroundCompressionOrigin +end + +namespace GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P r μ A τ I Sources Reps G m inv one T Filters Labels : ZFSet.{u}} +variable {seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (algebra : GroundCompressionAlgebra M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) +variable (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hP hG hr hμ hA hLabels hI hSources hReps hT + +theorem union_initial_profile + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + {i f a c e F K : ZFSet.{u}} (indexed : ZFSet.pair i f ∈ algebra.maps) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (target : ZFSet.pair i c ∈ literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (separator : ZFSet.pair i e ∈ literalTaskSeparatorGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (filter : ZFSet.pair i F ∈ literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (cap : ZFSet.pair τ K ∈ f) : + CodedCapProfile (algebra.union.fields 0) (algebra.union.fields 1) (algebra.union.fields 2) c e K F := by + have ha : a ∈ P := (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 source).1).2 + have haD : a ∈ state.data.D := by + simpa only [initialData, TransitiveGround.initialCompressionData] using ha + have hτD : τ ∈ state.data.D := by + simpa only [initialData, TransitiveGround.initialCompressionData] using seed.top_mem + obtain ⟨old, oldEntry⟩ := state.inputs.maps.total (algebra.function.pair_source indexed) + obtain ⟨b, base, _⟩ := (state.inputs.valid i old oldEntry).injection.function.2 a haD + have capOld := (algebra.restrict i f indexed 0 old oldEntry τ hτD K).1 cap + have indexedOld : ZFSet.pair i old ∈ (M.initialCompressionData P G r μ A Labels).Maps := by + simpa only [initialData] using oldEntry + have top : ∀ x ∈ P, ZFSet.pair x τ ∈ r := by + simpa only [initialData, TransitiveGround.initialCompressionData] using state.invariant.top + obtain ⟨baseEq, hc, he, hK, subset, nonempty, profile, lower, reverse, separate⟩ := + M.groundInitialMap_profile state.inputs.group seed.originalAction seed.originalOrder seed.top_mem top + pairing unions powers separation hP hG hr hμ hA hLabels + indexedOld source target separator filter capOld base + subst b + have first : CodedCapProfile state.data.currentCarrier state.data.currentOrder state.data.currentMeet c e K F := by + rw [initialData] + exact ⟨hc, he, hK, subset, nonempty, profile, lower, reverse, separate⟩ + refine ⟨algebra.union.currentCarrier.subset 0 first.target_mem, + algebra.union.currentCarrier.subset 0 first.separator_mem, + algebra.union.currentCarrier.subset 0 first.cap_mem, + fun _ hf => algebra.union.currentCarrier.subset 0 (first.filter_subset hf), first.nonempty, + state.union_profile algebra.union pairing unions powers separation hI hSources hReps hG hT + first.target_mem first.separator_mem first.cap_mem first.filter_subset first.nonempty + first.profile first.separator_not_below_cap, + algebra.union.currentOrder.subset 0 first.target_below_cap, ?_, ?_⟩ + · intro below + exact first.cap_not_below_target ((state.union_order_iff algebra.union pairing unions powers separation + hI hSources hReps hG hT 1 first.cap_mem first.target_mem).1 below) + · exact state.union_separator_not_below_cap algebra.union pairing unions powers separation + hI hSources hReps hG hT first.separator_mem first.cap_mem first.separator_not_below_cap + +theorem initial_union_profiles + (initialData : state.data = M.initialCompressionData P G r μ A Labels) + (initialSources : Sources = literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) : + CodedCompressionProfiles (algebra.union.fields 0) (algebra.union.fields 1) (algebra.union.fields 2) + (algebra.caps τ) + (literalTaskTargetGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (literalTaskSeparatorGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (literalTaskFilterGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) := by + intro i c e K F cap target separator filter + have hi := (ZFSet.pair_mem_prod.1 ((state.union_caps_function algebra).1 cap)).1 + obtain ⟨f, indexed⟩ := algebra.function.total hi + obtain ⟨a, source, _⟩ := seed.sources.2 i hi + rw [initialSources] at source + exact state.union_initial_profile algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData indexed source target separator filter + ((state.union_cap_entry_iff algebra indexed).1 cap) + +end GroundCompressionState + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialRepresentativeAgreement.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialRepresentativeAgreement.lean index 41cfae512012f9b9859e60ddd341f3608992f048..b574e82162b9a866874a27cd3d8d893a6e4121d5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialRepresentativeAgreement.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/InitialRepresentativeAgreement.lean @@ -1,135 +1,135 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundEligibleActionStep -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchEmbeddingRecognition - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -theorem RestrictedActionCode.base_action_iff - {P G m one r A g source target base x y : ZFSet.{u}} - (code : RestrictedActionCode P r A g source target base) - (action : PosetActionCode G P m one r A) (hx : x ∈ P) - (below : ZFSet.pair x source ∈ r) : - ZFSet.pair x y ∈ base ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A := by - constructor - · intro entry - have hy := (ZFSet.pair_mem_prod.1 (code.shape entry)).2 - exact ((code.entries x hx y hy).1 entry).2 - · intro entry - have hy := (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2 - exact (code.entries x hx y hy).2 ⟨below, entry⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem groundEligibleTask_representative_base_iff - {P G r μ A Labels m inv one i g a x y : ZFSet.{u}} - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) - (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) - (represented : TaskRepresentative P r A (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels i g) - (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) - P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (hx : x ∈ P) (below : ZFSet.pair x a ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - ZFSet.pair x y ∈ batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) i ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by - dsimp only - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, restriction⟩ := represented - have aEq : a = a' := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2 - have anchorEq : d.anchor j = a := d.anchors.unique (d.anchor_entry j) source - have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 - have baseEntry : ZFSet.pair i base ∈ literalTaskBaseGraph I P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels := by - rw [equal] - exact (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).2 ⟨equal ▸ hi, rfl⟩ - have baseEq : d.embed j = base := d.embeddings.unique (d.embed_entry j) baseEntry - have notFresh : x ∉ freshPart (d.space j) (d.rel j) (d.anchor j) := by - intro fresh - exact ((mem_freshPart _ _ _ _).1 fresh).2 (relEq.symm ▸ anchorEq.symm ▸ below) - rw [M.groundEligibleBatchAction_old_iff hx] - rw [pair_mem_batchTemplateGraph] - change (ZFSet.pair (ZFSet.pair j.val x) y ∈ _ ↔ _) - rw [d.batch_template_entry_iff, baseEq] - have onlyBase : (ZFSet.pair x y ∈ base ∨ - x ∈ freshPart (d.space j) (d.rel j) (d.anchor j) ∧ - y = ZFSet.pair P (ZFSet.pair j.val x)) ↔ ZFSet.pair x y ∈ base := - ⟨fun h => h.elim id (fun h => False.elim (notFresh h.1)), Or.inl⟩ - exact onlyBase.trans (restriction.base_action_iff action hx (aEq ▸ below)) - -theorem exists_groundInitialRepresentatives - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Qs := constantFamilyGraph I P - let rs := constantFamilyGraph I r - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P Qs rs As Es - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - Maps ∈ M.sets ∧ FunctionGraphOn I Maps ∧ - (∀ i S, ZFSet.pair i S ∈ Maps → - MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph S) ∧ - B ∈ M.sets ∧ PosetActionCode G d.batchCarrier m one d.batchOrder B ∧ - ∃ representatives ∈ M.sets, ZFSet.IsFunc I G representatives ∧ - (∀ i g, ZFSet.pair i g ∈ representatives → TaskRepresentative P r A R U Labels i g) ∧ - (∀ i a g S x y, ZFSet.pair i a ∈ As → ZFSet.pair i g ∈ representatives → - ZFSet.pair i S ∈ Maps → x ∈ P → ZFSet.pair x a ∈ r → - (ZFSet.pair x y ∈ S ↔ ZFSet.pair (ZFSet.pair g x) y ∈ B)) := by - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨hMaps, maps, entries⟩ := M.batchEmbeddingFamily_spec - pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 - obtain ⟨representatives, ground, function, represents, _⟩ := - M.exists_groundTaskRepresentatives pairing unions powers separation choice - hP hG hr hμ hA hLabels meet - refine ⟨hMaps, maps, ?_, - M.groundEligibleBatchAction_mem pairing unions powers separation hP hG hr hμ hA hLabels meet, - M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet, - representatives, ground, function, represents, ?_⟩ - · intro i S entry - obtain ⟨hi, equal⟩ := (entries i S).1 entry - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 - have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 - have meetEq : d.meet j = μ := ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry j)).2 - rw [equal] - simpa only [spaceEq, relEq, meetEq] using d.batch_template_embedding_code j - · intro i a g S x y source representative mapEntry hx below - obtain ⟨hi, equal⟩ := (entries i S).1 mapEntry - rw [equal] - exact M.groundEligibleTask_representative_base_iff group action meet hi - (represents i g representative) source hx below - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundEligibleActionStep +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchEmbeddingRecognition + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +theorem RestrictedActionCode.base_action_iff + {P G m one r A g source target base x y : ZFSet.{u}} + (code : RestrictedActionCode P r A g source target base) + (action : PosetActionCode G P m one r A) (hx : x ∈ P) + (below : ZFSet.pair x source ∈ r) : + ZFSet.pair x y ∈ base ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A := by + constructor + · intro entry + have hy := (ZFSet.pair_mem_prod.1 (code.shape entry)).2 + exact ((code.entries x hx y hy).1 entry).2 + · intro entry + have hy := (ZFSet.pair_mem_prod.1 (action.function.1 entry)).2 + exact (code.entries x hx y hy).2 ⟨below, entry⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem groundEligibleTask_representative_base_iff + {P G r μ A Labels m inv one i g a x y : ZFSet.{u}} + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) + (hi : i ∈ M.groundEligibleTasks P G r μ A Labels) + (represented : TaskRepresentative P r A (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels i g) + (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels) + P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (hx : x ∈ P) (below : ZFSet.pair x a ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + ZFSet.pair x y ∈ batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P R U Labels) (literalTaskBaseGraph I P R U Labels) i ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by + dsimp only + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, restriction⟩ := represented + have aEq : a = a' := ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2 + have anchorEq : d.anchor j = a := d.anchors.unique (d.anchor_entry j) source + have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 + have baseEntry : ZFSet.pair i base ∈ literalTaskBaseGraph I P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels := by + rw [equal] + exact (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).2 ⟨equal ▸ hi, rfl⟩ + have baseEq : d.embed j = base := d.embeddings.unique (d.embed_entry j) baseEntry + have notFresh : x ∉ freshPart (d.space j) (d.rel j) (d.anchor j) := by + intro fresh + exact ((mem_freshPart _ _ _ _).1 fresh).2 (relEq.symm ▸ anchorEq.symm ▸ below) + rw [M.groundEligibleBatchAction_old_iff hx] + rw [pair_mem_batchTemplateGraph] + change (ZFSet.pair (ZFSet.pair j.val x) y ∈ _ ↔ _) + rw [d.batch_template_entry_iff, baseEq] + have onlyBase : (ZFSet.pair x y ∈ base ∨ + x ∈ freshPart (d.space j) (d.rel j) (d.anchor j) ∧ + y = ZFSet.pair P (ZFSet.pair j.val x)) ↔ ZFSet.pair x y ∈ base := + ⟨fun h => h.elim id (fun h => False.elim (notFresh h.1)), Or.inl⟩ + exact onlyBase.trans (restriction.base_action_iff action hx (aEq ▸ below)) + +theorem exists_groundInitialRepresentatives + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Qs := constantFamilyGraph I P + let rs := constantFamilyGraph I r + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P Qs rs As Es + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + Maps ∈ M.sets ∧ FunctionGraphOn I Maps ∧ + (∀ i S, ZFSet.pair i S ∈ Maps → + MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph S) ∧ + B ∈ M.sets ∧ PosetActionCode G d.batchCarrier m one d.batchOrder B ∧ + ∃ representatives ∈ M.sets, ZFSet.IsFunc I G representatives ∧ + (∀ i g, ZFSet.pair i g ∈ representatives → TaskRepresentative P r A R U Labels i g) ∧ + (∀ i a g S x y, ZFSet.pair i a ∈ As → ZFSet.pair i g ∈ representatives → + ZFSet.pair i S ∈ Maps → x ∈ P → ZFSet.pair x a ∈ r → + (ZFSet.pair x y ∈ S ↔ ZFSet.pair (ZFSet.pair g x) y ∈ B)) := by + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨hMaps, maps, entries⟩ := M.batchEmbeddingFamily_spec + pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 + obtain ⟨representatives, ground, function, represents, _⟩ := + M.exists_groundTaskRepresentatives pairing unions powers separation choice + hP hG hr hμ hA hLabels meet + refine ⟨hMaps, maps, ?_, + M.groundEligibleBatchAction_mem pairing unions powers separation hP hG hr hμ hA hLabels meet, + M.groundEligibleBatchAction_code pairing unions powers separation hP hG hA group action meet, + representatives, ground, function, represents, ?_⟩ + · intro i S entry + obtain ⟨hi, equal⟩ := (entries i S).1 entry + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 + have relEq : d.rel j = r := ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry j)).2 + have meetEq : d.meet j = μ := ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry j)).2 + rw [equal] + simpa only [spaceEq, relEq, meetEq] using d.batch_template_embedding_code j + · intro i a g S x y source representative mapEntry hx below + obtain ⟨hi, equal⟩ := (entries i S).1 mapEntry + rw [equal] + exact M.groundEligibleTask_representative_base_iff group action meet hi + (represents i g representative) source hx below + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalEmbeddingFamilyCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalEmbeddingFamilyCodes.lean index 74faef395a823960a873c4507047fd96c170510f..794b788003d6179545f9fef8c95b67cead3f4797 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalEmbeddingFamilyCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalEmbeddingFamilyCodes.lean @@ -1,483 +1,483 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IndexedAttachmentCodes -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundIntervalRecursion - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing - -universe u - -def leastInjectionMember (A f d : ZFSet.{u}) : Prop := - d ∈ A ∧ ∃ n ∈ ZFSet.omega, ZFSet.pair d n ∈ f ∧ - ∀ x ∈ A, ∀ m ∈ n, ZFSet.pair x m ∉ f - -theorem leastInjectionMember_unique {A f d b : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) - (hd : leastInjectionMember A f d) (hb : leastInjectionMember A f b) : d = b := by - obtain ⟨dA, n, hn, dn, leastD⟩ := hd - obtain ⟨bA, m, hm, bm, leastB⟩ := hb - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - rcases lt_trichotomy k l with smaller | equal | larger - · exact False.elim (leastB d dA (natSetCode k) ((natSetCode_mem_iff k l).2 smaller) dn) - · subst l - exact injection.injective d b (natSetCode k) dn bm - · exact False.elim (leastD b bA (natSetCode l) ((natSetCode_mem_iff l k).2 larger) bm) - -theorem leastInjectionMember_exists_unique {A f : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : - ∃! d, leastInjectionMember A f d := by - classical - let valid : Nat → Prop := fun n => ∃ d ∈ A, ZFSet.pair d (natSetCode n) ∈ f - have existsValid : ∃ n, valid n := by - obtain ⟨d, hd⟩ := nonempty - obtain ⟨n, entry, _⟩ := injection.function.2 d hd - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 - (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 - exact ⟨k, d, hd, entry⟩ - obtain ⟨d, hd, entry⟩ := Nat.find_spec existsValid - have selected : leastInjectionMember A f d := by - refine ⟨hd, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩ - intro x hx m hm smaller - obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm - have validK : valid k := ⟨x, hx, equal ▸ smaller⟩ - exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower - exact ⟨d, selected, fun b hb => leastInjectionMember_unique injection hb selected⟩ - -noncomputable def canonicalEnumerationDefault (A f : ZFSet.{u}) : ZFSet.{u} := by - classical - exact if h : ∃ d, leastInjectionMember A f d then Classical.choose h else ∅ - -theorem canonicalEnumerationDefault_least {A f : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : - leastInjectionMember A f (canonicalEnumerationDefault A f) := by - classical - have existsDefault := (leastInjectionMember_exists_unique injection nonempty).exists - simpa only [canonicalEnumerationDefault, dite_eq_left existsDefault] using Classical.choose_spec existsDefault - -theorem canonicalEnumerationDefault_eq {A f d : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) (hd : leastInjectionMember A f d) : - canonicalEnumerationDefault A f = d := - leastInjectionMember_unique injection (canonicalEnumerationDefault_least injection ⟨d, hd.1⟩) hd - -noncomputable def canonicalEnumeration (A f : ZFSet.{u}) : ZFSet.{u} := - defaultInverse A ZFSet.omega f (canonicalEnumerationDefault A f) - -theorem canonicalEnumeration_eq_of_least {A f d : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) (hd : leastInjectionMember A f d) : - canonicalEnumeration A f = defaultInverse A ZFSet.omega f d := by - rw [canonicalEnumeration, canonicalEnumerationDefault_eq injection hd] - -theorem canonicalEnumeration_isFunc {A f : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : - ZFSet.IsFunc ZFSet.omega A (canonicalEnumeration A f) := - defaultInverse_isFunc injection (canonicalEnumerationDefault_least injection nonempty).1 - -theorem canonicalEnumeration_onto {A f : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) : - ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ canonicalEnumeration A f := - defaultInverse_onto injection (canonicalEnumerationDefault A f) - -theorem canonicalEnumeration_unique {A f d e : ZFSet.{u}} - (injection : InjectionCode A ZFSet.omega f) (hd : leastInjectionMember A f d) - (he : e = defaultInverse A ZFSet.omega f d) : e = canonicalEnumeration A f := - he.trans (canonicalEnumeration_eq_of_least injection hd).symm - -namespace BoundedFormula - -def leastInjectionMemberFormula {n} (d a f omega : Fin n) : BoundedFormula n := - .conj (.mem d a) (exMem omega - (.conj (pairMembershipFormula d.succ 0 f.succ) - (.allMem a.succ (.allMem 1 (.neg (pairMembershipFormula 1 0 f.succ.succ.succ)))))) - -theorem truth_leastInjectionMemberFormula {n} (d a f omega : Fin n) - (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) : - Truth (leastInjectionMemberFormula d a f omega) env ↔ - leastInjectionMember (env a) (env f) (env d) := by - simp only [leastInjectionMemberFormula, Truth, truth_exMem, truth_pairMembershipFormula] - change (env d ∈ env a ∧ ∃ n ∈ env omega, ZFSet.pair (env d) n ∈ env f ∧ - ∀ x ∈ env a, ∀ m ∈ n, ZFSet.pair x m ∉ env f) ↔ _ - rw [hOmega] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem canonicalEnumerationDefault_mem {A f : ZFSet.{u}} (hA : A ∈ M.sets) - (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : - canonicalEnumerationDefault A f ∈ M.sets := - M.transitive hA (canonicalEnumerationDefault_least injection nonempty).1 - -theorem canonicalEnumeration_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) - (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : - canonicalEnumeration A f ∈ M.sets := - M.defaultInverse_mem pairing unions powers separation hA hOmega hf - (M.canonicalEnumerationDefault_mem hA injection nonempty) - -theorem canonicalEnumeration_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) - (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : - canonicalEnumerationDefault A f ∈ M.sets ∧ - leastInjectionMember A f (canonicalEnumerationDefault A f) ∧ - canonicalEnumeration A f ∈ M.sets ∧ - ZFSet.IsFunc ZFSet.omega A (canonicalEnumeration A f) ∧ - (∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ canonicalEnumeration A f) ∧ - ∀ d e, leastInjectionMember A f d → e = defaultInverse A ZFSet.omega f d → - d = canonicalEnumerationDefault A f ∧ e = canonicalEnumeration A f := - ⟨M.canonicalEnumerationDefault_mem hA injection nonempty, - canonicalEnumerationDefault_least injection nonempty, - M.canonicalEnumeration_mem pairing unions powers separation hA hf hOmega injection nonempty, - canonicalEnumeration_isFunc injection nonempty, canonicalEnumeration_onto injection, - fun _ _ hd he => ⟨(canonicalEnumerationDefault_eq injection hd).symm, - canonicalEnumeration_unique injection hd he⟩⟩ - -end TransitiveGround - - - - - - -noncomputable def intervalSequenceGraph (A D e t : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ a ∈ A, ∃ q ∈ D, - z = ZFSet.pair a q ∧ ZFSet.pair n a ∈ e ∧ ZFSet.pair n q ∈ t) - (ZFSet.prod A D) - -theorem intervalSequenceGraph_subset (A D e t : ZFSet.{u}) : - intervalSequenceGraph A D e t ⊆ ZFSet.prod A D := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_intervalSequenceGraph (A D e t z : ZFSet.{u}) : - z ∈ intervalSequenceGraph A D e t ↔ - ∃ n ∈ ZFSet.omega, ∃ a ∈ A, ∃ q ∈ D, - z = ZFSet.pair a q ∧ ZFSet.pair n a ∈ e ∧ ZFSet.pair n q ∈ t := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · rintro ⟨n, hn, a, ha, q, hq, rfl, en, tn⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨ha, hq⟩, n, hn, a, ha, q, hq, rfl, en, tn⟩ - -theorem pair_mem_intervalSequenceGraph (A D e t a q : ZFSet.{u}) : - ZFSet.pair a q ∈ intervalSequenceGraph A D e t ↔ - a ∈ A ∧ q ∈ D ∧ ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e ∧ ZFSet.pair n q ∈ t := by - rw [mem_intervalSequenceGraph] - constructor - · rintro ⟨n, hn, b, hb, z, hz, equal, en, tn⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hb, hz, n, hn, en, tn⟩ - · rintro ⟨ha, hq, n, hn, en, tn⟩ - exact ⟨n, hn, a, ha, q, hq, rfl, en, tn⟩ - -theorem intervalSequenceGraph_isFunc {A D rA rD e lo hi t : ZFSet.{u}} - (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) - (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) : - ZFSet.IsFunc A D (intervalSequenceGraph A D e t) := by - refine ⟨intervalSequenceGraph_subset A D e t, ?_⟩ - intro a ha - obtain ⟨n, hn, en⟩ := onto a ha - obtain ⟨q, tn, _⟩ := code.function.2 n hn - have hq := (ZFSet.pair_mem_prod.1 (code.function.1 tn)).2 - refine ⟨q, (pair_mem_intervalSequenceGraph A D e t a q).2 ⟨ha, hq, n, hn, en, tn⟩, ?_⟩ - intro z hz - obtain ⟨_, _, m, _, em, tm⟩ := (pair_mem_intervalSequenceGraph A D e t a z).1 hz - exact (code.agree m n a a z q em en tm tn).1 rfl - -theorem intervalSequenceGraph_injection {A D rA rD e lo hi t : ZFSet.{u}} - (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) - (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) : - InjectionCode A D (intervalSequenceGraph A D e t) := by - refine ⟨intervalSequenceGraph_isFunc code onto, ?_⟩ - intro a b q ha hb - obtain ⟨_, _, n, _, en, tn⟩ := (pair_mem_intervalSequenceGraph A D e t a q).1 ha - obtain ⟨_, _, m, _, em, tm⟩ := (pair_mem_intervalSequenceGraph A D e t b q).1 hb - exact (code.agree n m a b q q en em tn tm).2 rfl - -theorem intervalSequenceGraph_order_iff {A D rA rD e lo hi t a b q z : ZFSet.{u}} - (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) - (ha : ZFSet.pair a q ∈ intervalSequenceGraph A D e t) - (hb : ZFSet.pair b z ∈ intervalSequenceGraph A D e t) : - ZFSet.pair q z ∈ rD ↔ ZFSet.pair a b ∈ rA := by - obtain ⟨_, _, n, _, en, tn⟩ := (pair_mem_intervalSequenceGraph A D e t a q).1 ha - obtain ⟨_, _, m, _, em, tm⟩ := (pair_mem_intervalSequenceGraph A D e t b z).1 hb - exact (code.order n m a b q z en em tn tm).symm - -theorem intervalSequenceGraph_inside {A D rA rD e lo hi t a q : ZFSet.{u}} - (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) - (entry : ZFSet.pair a q ∈ intervalSequenceGraph A D e t) : - ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD := by - obtain ⟨_, _, n, _, _, tn⟩ := (pair_mem_intervalSequenceGraph A D e t a q).1 entry - exact code.inside n q tn - -theorem intervalSequenceGraph_sequence_entry {A D rA rD e lo hi t n a q : ZFSet.{u}} - (enumeration : ZFSet.IsFunc ZFSet.omega A e) - (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) - (en : ZFSet.pair n a ∈ e) (tn : ZFSet.pair n q ∈ t) : - ZFSet.pair a q ∈ intervalSequenceGraph A D e t := by - have eshape := ZFSet.pair_mem_prod.1 (enumeration.1 en) - have tshape := ZFSet.pair_mem_prod.1 (code.function.1 tn) - exact (pair_mem_intervalSequenceGraph A D e t a q).2 ⟨eshape.2, tshape.2, n, eshape.1, en, tn⟩ - - - - - - -namespace BoundedFormula - -open SetFormula - -def intervalSequenceEntryFormula {n} (z a d e t omega : Fin n) : BoundedFormula n := - exMem omega (exMem a.succ (exMem d.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 1 0) - (.conj (pairMembershipFormula 2 1 e.succ.succ.succ) - (pairMembershipFormula 2 0 t.succ.succ.succ))))) - -theorem truth_intervalSequenceEntryFormula {n} (z a d e t omega : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (intervalSequenceEntryFormula z a d e t omega) env ↔ - ∃ i ∈ env omega, ∃ x ∈ env a, ∃ q ∈ env d, - env z = ZFSet.pair x q ∧ ZFSet.pair i x ∈ env e ∧ ZFSet.pair i q ∈ env t := by - simp only [intervalSequenceEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem intervalSequenceGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A D e t : ZFSet.{u}} (hA : A ∈ M.sets) (hD : D ∈ M.sets) - (he : e ∈ M.sets) (ht : t ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) : - intervalSequenceGraph A D e t ∈ M.sets := by - let params := extend A (extend D (extend e (extend t (extend ZFSet.omega Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.intervalSequenceEntryFormula 0 1 2 3 4 5) params - (Fin.cases hA (Fin.cases hD (Fin.cases he (Fin.cases ht - (Fin.cases hOmega (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hA hD) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.intervalSequenceEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod A D) = intervalSequenceGraph A D e t := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, intervalSequenceGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_intervalSequenceEntryFormula 0 1 2 3 4 5 _) - exact equal ▸ selected - -theorem intervalSequenceDescent_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A D rA rD e lo hi t : ZFSet.{u}} (hA : A ∈ M.sets) (hD : D ∈ M.sets) - (he : e ∈ M.sets) (ht : t ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) - (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) - (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) : - intervalSequenceGraph A D e t ∈ M.sets ∧ - InjectionCode A D (intervalSequenceGraph A D e t) ∧ - (∀ a q, ZFSet.pair a q ∈ intervalSequenceGraph A D e t → - ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD) ∧ - (∀ a b q z, ZFSet.pair a q ∈ intervalSequenceGraph A D e t → - ZFSet.pair b z ∈ intervalSequenceGraph A D e t → - (ZFSet.pair q z ∈ rD ↔ ZFSet.pair a b ∈ rA)) := - ⟨M.intervalSequenceGraph_mem pairing unions powers separation hA hD he ht hOmega, - intervalSequenceGraph_injection code onto, - fun _ _ entry => intervalSequenceGraph_inside code entry, - fun _ _ _ _ left right => intervalSequenceGraph_order_iff code left right⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -open SetFormula SetRealization Compression.RecursiveMaps.RationalHeights -universe u - -structure IntervalEmbeddingCode (A D rA rD lo hi f : ZFSet.{u}) : Prop where - injection : InjectionCode A D f - order : ∀ a b q z, ZFSet.pair a q ∈ f → ZFSet.pair b z ∈ f → - (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD) - inside : ∀ a q, ZFSet.pair a q ∈ f → ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD - -theorem intervalEmbeddingCode_empty (D rA rD lo hi : ZFSet.{u}) : - IntervalEmbeddingCode ∅ D rA rD lo hi ∅ := by - refine ⟨⟨⟨ZFSet.empty_subset _, fun a ha => False.elim (ZFSet.notMem_empty a ha)⟩, ?_⟩, ?_, ?_⟩ - · intro a b q entry _ - exact False.elim (ZFSet.notMem_empty _ entry) - · intro a b q z entry _ - exact False.elim (ZFSet.notMem_empty _ entry) - · intro a q entry - exact False.elim (ZFSet.notMem_empty _ entry) - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem exists_intervalEmbedding_of_enumeration - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A D rA rD e lo hi c : ZFSet.{u}} - (hA : A ∈ M.sets) (hD : D ∈ M.sets) (hrA : rA ∈ M.sets) - (hrD : rD ∈ M.sets) (he : e ∈ M.sets) (hc : c ∈ M.sets) - (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) - (injection : InjectionCode D ZFSet.omega c) - (enumeration : ZFSet.IsFunc ZFSet.omega A e) - (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) - (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : - ∃ f ∈ M.sets, IntervalEmbeddingCode A D rA rD lo hi f := by - obtain ⟨t, ht, sequence, _, _⟩ := M.exists_ground_intervalSequence - pairing unions separation collection infinite hA hD hrA hrD he hc - source target injection enumeration loD hiD gap - obtain ⟨member, inj, inside, order⟩ := M.intervalSequenceDescent_spec - pairing unions powers separation hA hD he ht (M.omega_mem separation infinite) sequence onto - exact ⟨intervalSequenceGraph A D e t, member, inj, - fun a b q z first second => (order a b q z first second).symm, inside⟩ - -theorem exists_intervalEmbedding - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A D rA rD lo hi c : ZFSet.{u}} - (hA : A ∈ M.sets) (hD : D ∈ M.sets) (hrA : rA ∈ M.sets) - (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) - (injection : InjectionCode D ZFSet.omega c) - (small : M.groundEmbeddable A ZFSet.omega) - (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : - ∃ f ∈ M.sets, IntervalEmbeddingCode A D rA rD lo hi f := by - by_cases nonempty : A.Nonempty - · obtain ⟨sourceCode, hSourceCode, sourceInjection⟩ := small - have he := M.canonicalEnumeration_mem pairing unions powers separation - hA hSourceCode (M.omega_mem separation infinite) sourceInjection nonempty - have enumeration := canonicalEnumeration_isFunc sourceInjection nonempty - have onto := canonicalEnumeration_onto sourceInjection - exact M.exists_intervalEmbedding_of_enumeration pairing unions powers separation collection infinite - hA hD hrA hrD he hc source target injection enumeration onto loD hiD gap - · have empty : A = ∅ := by - apply ZFSet.ext - intro a - exact ⟨fun ha => False.elim (nonempty ⟨a, ha⟩), fun ha => False.elim (ZFSet.notMem_empty a ha)⟩ - exact ⟨∅, M.empty_mem ⟨D, hD⟩, empty ▸ intervalEmbeddingCode_empty D rA rD lo hi⟩ - -theorem exists_groundRationalIntervals - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : - ∃ D ∈ M.sets, ∃ r ∈ M.sets, ∃ c ∈ M.sets, - InjectionCode D ZFSet.omega c ∧ DenseOrderCode D r ∧ (∃ x, x ∈ D) ∧ - (∀ x ∈ D, (∃ y ∈ D, ZFSet.pair y x ∈ r) ∧ (∃ y ∈ D, ZFSet.pair x y ∈ r)) ∧ - (∃ s : Presentation (ULift.{u} Rational), s.carrier = D ∧ - ∀ a b, ZFSet.pair (s.encode a) (s.encode b) ∈ r ↔ Rational.lt a.down b.down) ∧ - ∀ A ∈ M.sets, ∀ rA ∈ M.sets, StrictLinearOrderCode A rA → - M.groundEmbeddable A ZFSet.omega → ∀ lo ∈ D, ∀ hi ∈ D, - ZFSet.pair lo hi ∈ r → ∃ f ∈ M.sets, IntervalEmbeddingCode A D rA r lo hi f := by - obtain ⟨D, hD, r, hr, c, hc, injection, target, nonempty, endpoints, s, carrier, order⟩ := - M.exists_groundRationals pairing unions powers separation infinite - refine ⟨D, hD, r, hr, c, hc, injection, target, nonempty, endpoints, ⟨s, carrier, order⟩, ?_⟩ - intro A hA rA hrA source small lo hlo hi hhi gap - exact M.exists_intervalEmbedding pairing unions powers separation collection infinite - hA hD hrA hr hc source target injection small hlo hhi gap - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -universe u - -structure IntervalEmbeddingFamilyInputs (I As rs los his D rD : ZFSet.{u}) : Prop where - sources : FunctionGraphOn I As - orders : FunctionGraphOn I rs - lows : FunctionGraphOn I los - highs : FunctionGraphOn I his - source_order : ∀ i, StrictLinearOrderCode (sources.value i) (orders.value i) - lower_mem : ∀ i, lows.value i ∈ D - upper_mem : ∀ i, highs.value i ∈ D - gap : ∀ i, ZFSet.pair (lows.value i) (highs.value i) ∈ rD - -def intervalEmbeddingCandidate (As rs los his D rD i f : ZFSet.{u}) : Prop := - ∃ A ∈ ⋃₀ ⋃₀ As, ∃ rA ∈ ⋃₀ ⋃₀ rs, ∃ lo ∈ D, ∃ hi ∈ D, - ZFSet.pair i A ∈ As ∧ ZFSet.pair i rA ∈ rs ∧ - ZFSet.pair i lo ∈ los ∧ ZFSet.pair i hi ∈ his ∧ - IntervalEmbeddingCode A D rA rD lo hi f - -noncomputable def intervalEmbeddingRelation (I W As rs los his D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ W, z = ZFSet.pair i f ∧ - intervalEmbeddingCandidate As rs los his D rD i f) (ZFSet.prod I W) - -theorem pair_mem_intervalEmbeddingRelation (I W As rs los his D rD i f : ZFSet.{u}) : - ZFSet.pair i f ∈ intervalEmbeddingRelation I W As rs los his D rD ↔ - i ∈ I ∧ f ∈ W ∧ intervalEmbeddingCandidate As rs los his D rD i f := by - rw [intervalEmbeddingRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, valid⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hi, hf, valid⟩ - · rintro ⟨hi, hf, valid⟩ - exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, valid⟩ - -namespace IntervalEmbeddingFamilyInputs - -variable {I As rs los his D rD : ZFSet.{u}} - (d : IntervalEmbeddingFamilyInputs I As rs los his D rD) - -theorem candidate_iff (i : {i : ZFSet.{u} // i ∈ I}) (f : ZFSet.{u}) : - intervalEmbeddingCandidate As rs los his D rD i.val f ↔ - IntervalEmbeddingCode (d.sources.value i) D (d.orders.value i) rD - (d.lows.value i) (d.highs.value i) f := by - constructor - · rintro ⟨A, _, rA, _, lo, _, hi, _, entryA, entryR, entryLo, entryHi, code⟩ - have eA := d.sources.value_eq_of_entry i entryA - have eR := d.orders.value_eq_of_entry i entryR - have eLo := d.lows.value_eq_of_entry i entryLo - have eHi := d.highs.value_eq_of_entry i entryHi - rw [eA, eR, eLo, eHi] - exact code - · intro code - exact ⟨d.sources.value i, d.sources.value_mem_doubleUnion i, - d.orders.value i, d.orders.value_mem_doubleUnion i, - d.lows.value i, d.lower_mem i, d.highs.value i, d.upper_mem i, - d.sources.value_entry i, d.orders.value_entry i, - d.lows.value_entry i, d.highs.value_entry i, code⟩ - -theorem embedding_subset_bound (i : {i : ZFSet.{u} // i ∈ I}) {f : ZFSet.{u}} - (code : IntervalEmbeddingCode (d.sources.value i) D (d.orders.value i) rD - (d.lows.value i) (d.highs.value i) f) : - f ⊆ ZFSet.prod (familyPointBound As) D := by - intro z hz - obtain ⟨a, ha, q, hq, rfl⟩ := ZFSet.mem_prod.1 (code.injection.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨mem_familyPointBound_of_entry (d.sources.value_entry i) ha, hq⟩ - -end IntervalEmbeddingFamilyInputs - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IndexedAttachmentCodes +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundIntervalRecursion + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing + +universe u + +def leastInjectionMember (A f d : ZFSet.{u}) : Prop := + d ∈ A ∧ ∃ n ∈ ZFSet.omega, ZFSet.pair d n ∈ f ∧ + ∀ x ∈ A, ∀ m ∈ n, ZFSet.pair x m ∉ f + +theorem leastInjectionMember_unique {A f d b : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) + (hd : leastInjectionMember A f d) (hb : leastInjectionMember A f b) : d = b := by + obtain ⟨dA, n, hn, dn, leastD⟩ := hd + obtain ⟨bA, m, hm, bm, leastB⟩ := hb + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + rcases lt_trichotomy k l with smaller | equal | larger + · exact False.elim (leastB d dA (natSetCode k) ((natSetCode_mem_iff k l).2 smaller) dn) + · subst l + exact injection.injective d b (natSetCode k) dn bm + · exact False.elim (leastD b bA (natSetCode l) ((natSetCode_mem_iff l k).2 larger) bm) + +theorem leastInjectionMember_exists_unique {A f : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : + ∃! d, leastInjectionMember A f d := by + classical + let valid : Nat → Prop := fun n => ∃ d ∈ A, ZFSet.pair d (natSetCode n) ∈ f + have existsValid : ∃ n, valid n := by + obtain ⟨d, hd⟩ := nonempty + obtain ⟨n, entry, _⟩ := injection.function.2 d hd + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 + (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 + exact ⟨k, d, hd, entry⟩ + obtain ⟨d, hd, entry⟩ := Nat.find_spec existsValid + have selected : leastInjectionMember A f d := by + refine ⟨hd, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩ + intro x hx m hm smaller + obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm + have validK : valid k := ⟨x, hx, equal ▸ smaller⟩ + exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower + exact ⟨d, selected, fun b hb => leastInjectionMember_unique injection hb selected⟩ + +noncomputable def canonicalEnumerationDefault (A f : ZFSet.{u}) : ZFSet.{u} := by + classical + exact if h : ∃ d, leastInjectionMember A f d then Classical.choose h else ∅ + +theorem canonicalEnumerationDefault_least {A f : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : + leastInjectionMember A f (canonicalEnumerationDefault A f) := by + classical + have existsDefault := (leastInjectionMember_exists_unique injection nonempty).exists + simpa only [canonicalEnumerationDefault, dite_eq_left existsDefault] using Classical.choose_spec existsDefault + +theorem canonicalEnumerationDefault_eq {A f d : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) (hd : leastInjectionMember A f d) : + canonicalEnumerationDefault A f = d := + leastInjectionMember_unique injection (canonicalEnumerationDefault_least injection ⟨d, hd.1⟩) hd + +noncomputable def canonicalEnumeration (A f : ZFSet.{u}) : ZFSet.{u} := + defaultInverse A ZFSet.omega f (canonicalEnumerationDefault A f) + +theorem canonicalEnumeration_eq_of_least {A f d : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) (hd : leastInjectionMember A f d) : + canonicalEnumeration A f = defaultInverse A ZFSet.omega f d := by + rw [canonicalEnumeration, canonicalEnumerationDefault_eq injection hd] + +theorem canonicalEnumeration_isFunc {A f : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : + ZFSet.IsFunc ZFSet.omega A (canonicalEnumeration A f) := + defaultInverse_isFunc injection (canonicalEnumerationDefault_least injection nonempty).1 + +theorem canonicalEnumeration_onto {A f : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) : + ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ canonicalEnumeration A f := + defaultInverse_onto injection (canonicalEnumerationDefault A f) + +theorem canonicalEnumeration_unique {A f d e : ZFSet.{u}} + (injection : InjectionCode A ZFSet.omega f) (hd : leastInjectionMember A f d) + (he : e = defaultInverse A ZFSet.omega f d) : e = canonicalEnumeration A f := + he.trans (canonicalEnumeration_eq_of_least injection hd).symm + +namespace BoundedFormula + +def leastInjectionMemberFormula {n} (d a f omega : Fin n) : BoundedFormula n := + .conj (.mem d a) (exMem omega + (.conj (pairMembershipFormula d.succ 0 f.succ) + (.allMem a.succ (.allMem 1 (.neg (pairMembershipFormula 1 0 f.succ.succ.succ)))))) + +theorem truth_leastInjectionMemberFormula {n} (d a f omega : Fin n) + (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) : + Truth (leastInjectionMemberFormula d a f omega) env ↔ + leastInjectionMember (env a) (env f) (env d) := by + simp only [leastInjectionMemberFormula, Truth, truth_exMem, truth_pairMembershipFormula] + change (env d ∈ env a ∧ ∃ n ∈ env omega, ZFSet.pair (env d) n ∈ env f ∧ + ∀ x ∈ env a, ∀ m ∈ n, ZFSet.pair x m ∉ env f) ↔ _ + rw [hOmega] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem canonicalEnumerationDefault_mem {A f : ZFSet.{u}} (hA : A ∈ M.sets) + (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : + canonicalEnumerationDefault A f ∈ M.sets := + M.transitive hA (canonicalEnumerationDefault_least injection nonempty).1 + +theorem canonicalEnumeration_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) + (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : + canonicalEnumeration A f ∈ M.sets := + M.defaultInverse_mem pairing unions powers separation hA hOmega hf + (M.canonicalEnumerationDefault_mem hA injection nonempty) + +theorem canonicalEnumeration_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) + (injection : InjectionCode A ZFSet.omega f) (nonempty : A.Nonempty) : + canonicalEnumerationDefault A f ∈ M.sets ∧ + leastInjectionMember A f (canonicalEnumerationDefault A f) ∧ + canonicalEnumeration A f ∈ M.sets ∧ + ZFSet.IsFunc ZFSet.omega A (canonicalEnumeration A f) ∧ + (∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ canonicalEnumeration A f) ∧ + ∀ d e, leastInjectionMember A f d → e = defaultInverse A ZFSet.omega f d → + d = canonicalEnumerationDefault A f ∧ e = canonicalEnumeration A f := + ⟨M.canonicalEnumerationDefault_mem hA injection nonempty, + canonicalEnumerationDefault_least injection nonempty, + M.canonicalEnumeration_mem pairing unions powers separation hA hf hOmega injection nonempty, + canonicalEnumeration_isFunc injection nonempty, canonicalEnumeration_onto injection, + fun _ _ hd he => ⟨(canonicalEnumerationDefault_eq injection hd).symm, + canonicalEnumeration_unique injection hd he⟩⟩ + +end TransitiveGround + + + + + + +noncomputable def intervalSequenceGraph (A D e t : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ a ∈ A, ∃ q ∈ D, + z = ZFSet.pair a q ∧ ZFSet.pair n a ∈ e ∧ ZFSet.pair n q ∈ t) + (ZFSet.prod A D) + +theorem intervalSequenceGraph_subset (A D e t : ZFSet.{u}) : + intervalSequenceGraph A D e t ⊆ ZFSet.prod A D := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_intervalSequenceGraph (A D e t z : ZFSet.{u}) : + z ∈ intervalSequenceGraph A D e t ↔ + ∃ n ∈ ZFSet.omega, ∃ a ∈ A, ∃ q ∈ D, + z = ZFSet.pair a q ∧ ZFSet.pair n a ∈ e ∧ ZFSet.pair n q ∈ t := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · rintro ⟨n, hn, a, ha, q, hq, rfl, en, tn⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨ha, hq⟩, n, hn, a, ha, q, hq, rfl, en, tn⟩ + +theorem pair_mem_intervalSequenceGraph (A D e t a q : ZFSet.{u}) : + ZFSet.pair a q ∈ intervalSequenceGraph A D e t ↔ + a ∈ A ∧ q ∈ D ∧ ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e ∧ ZFSet.pair n q ∈ t := by + rw [mem_intervalSequenceGraph] + constructor + · rintro ⟨n, hn, b, hb, z, hz, equal, en, tn⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hb, hz, n, hn, en, tn⟩ + · rintro ⟨ha, hq, n, hn, en, tn⟩ + exact ⟨n, hn, a, ha, q, hq, rfl, en, tn⟩ + +theorem intervalSequenceGraph_isFunc {A D rA rD e lo hi t : ZFSet.{u}} + (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) + (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) : + ZFSet.IsFunc A D (intervalSequenceGraph A D e t) := by + refine ⟨intervalSequenceGraph_subset A D e t, ?_⟩ + intro a ha + obtain ⟨n, hn, en⟩ := onto a ha + obtain ⟨q, tn, _⟩ := code.function.2 n hn + have hq := (ZFSet.pair_mem_prod.1 (code.function.1 tn)).2 + refine ⟨q, (pair_mem_intervalSequenceGraph A D e t a q).2 ⟨ha, hq, n, hn, en, tn⟩, ?_⟩ + intro z hz + obtain ⟨_, _, m, _, em, tm⟩ := (pair_mem_intervalSequenceGraph A D e t a z).1 hz + exact (code.agree m n a a z q em en tm tn).1 rfl + +theorem intervalSequenceGraph_injection {A D rA rD e lo hi t : ZFSet.{u}} + (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) + (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) : + InjectionCode A D (intervalSequenceGraph A D e t) := by + refine ⟨intervalSequenceGraph_isFunc code onto, ?_⟩ + intro a b q ha hb + obtain ⟨_, _, n, _, en, tn⟩ := (pair_mem_intervalSequenceGraph A D e t a q).1 ha + obtain ⟨_, _, m, _, em, tm⟩ := (pair_mem_intervalSequenceGraph A D e t b q).1 hb + exact (code.agree n m a b q q en em tn tm).2 rfl + +theorem intervalSequenceGraph_order_iff {A D rA rD e lo hi t a b q z : ZFSet.{u}} + (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) + (ha : ZFSet.pair a q ∈ intervalSequenceGraph A D e t) + (hb : ZFSet.pair b z ∈ intervalSequenceGraph A D e t) : + ZFSet.pair q z ∈ rD ↔ ZFSet.pair a b ∈ rA := by + obtain ⟨_, _, n, _, en, tn⟩ := (pair_mem_intervalSequenceGraph A D e t a q).1 ha + obtain ⟨_, _, m, _, em, tm⟩ := (pair_mem_intervalSequenceGraph A D e t b z).1 hb + exact (code.order n m a b q z en em tn tm).symm + +theorem intervalSequenceGraph_inside {A D rA rD e lo hi t a q : ZFSet.{u}} + (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) + (entry : ZFSet.pair a q ∈ intervalSequenceGraph A D e t) : + ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD := by + obtain ⟨_, _, n, _, _, tn⟩ := (pair_mem_intervalSequenceGraph A D e t a q).1 entry + exact code.inside n q tn + +theorem intervalSequenceGraph_sequence_entry {A D rA rD e lo hi t n a q : ZFSet.{u}} + (enumeration : ZFSet.IsFunc ZFSet.omega A e) + (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) + (en : ZFSet.pair n a ∈ e) (tn : ZFSet.pair n q ∈ t) : + ZFSet.pair a q ∈ intervalSequenceGraph A D e t := by + have eshape := ZFSet.pair_mem_prod.1 (enumeration.1 en) + have tshape := ZFSet.pair_mem_prod.1 (code.function.1 tn) + exact (pair_mem_intervalSequenceGraph A D e t a q).2 ⟨eshape.2, tshape.2, n, eshape.1, en, tn⟩ + + + + + + +namespace BoundedFormula + +open SetFormula + +def intervalSequenceEntryFormula {n} (z a d e t omega : Fin n) : BoundedFormula n := + exMem omega (exMem a.succ (exMem d.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 1 0) + (.conj (pairMembershipFormula 2 1 e.succ.succ.succ) + (pairMembershipFormula 2 0 t.succ.succ.succ))))) + +theorem truth_intervalSequenceEntryFormula {n} (z a d e t omega : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (intervalSequenceEntryFormula z a d e t omega) env ↔ + ∃ i ∈ env omega, ∃ x ∈ env a, ∃ q ∈ env d, + env z = ZFSet.pair x q ∧ ZFSet.pair i x ∈ env e ∧ ZFSet.pair i q ∈ env t := by + simp only [intervalSequenceEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem intervalSequenceGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A D e t : ZFSet.{u}} (hA : A ∈ M.sets) (hD : D ∈ M.sets) + (he : e ∈ M.sets) (ht : t ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) : + intervalSequenceGraph A D e t ∈ M.sets := by + let params := extend A (extend D (extend e (extend t (extend ZFSet.omega Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.intervalSequenceEntryFormula 0 1 2 3 4 5) params + (Fin.cases hA (Fin.cases hD (Fin.cases he (Fin.cases ht + (Fin.cases hOmega (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hA hD) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.intervalSequenceEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod A D) = intervalSequenceGraph A D e t := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, intervalSequenceGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_intervalSequenceEntryFormula 0 1 2 3 4 5 _) + exact equal ▸ selected + +theorem intervalSequenceDescent_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A D rA rD e lo hi t : ZFSet.{u}} (hA : A ∈ M.sets) (hD : D ∈ M.sets) + (he : e ∈ M.sets) (ht : t ∈ M.sets) (hOmega : ZFSet.omega ∈ M.sets) + (code : IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t) + (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) : + intervalSequenceGraph A D e t ∈ M.sets ∧ + InjectionCode A D (intervalSequenceGraph A D e t) ∧ + (∀ a q, ZFSet.pair a q ∈ intervalSequenceGraph A D e t → + ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD) ∧ + (∀ a b q z, ZFSet.pair a q ∈ intervalSequenceGraph A D e t → + ZFSet.pair b z ∈ intervalSequenceGraph A D e t → + (ZFSet.pair q z ∈ rD ↔ ZFSet.pair a b ∈ rA)) := + ⟨M.intervalSequenceGraph_mem pairing unions powers separation hA hD he ht hOmega, + intervalSequenceGraph_injection code onto, + fun _ _ entry => intervalSequenceGraph_inside code entry, + fun _ _ _ _ left right => intervalSequenceGraph_order_iff code left right⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +open SetFormula SetRealization Compression.RecursiveMaps.RationalHeights +universe u + +structure IntervalEmbeddingCode (A D rA rD lo hi f : ZFSet.{u}) : Prop where + injection : InjectionCode A D f + order : ∀ a b q z, ZFSet.pair a q ∈ f → ZFSet.pair b z ∈ f → + (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD) + inside : ∀ a q, ZFSet.pair a q ∈ f → ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD + +theorem intervalEmbeddingCode_empty (D rA rD lo hi : ZFSet.{u}) : + IntervalEmbeddingCode ∅ D rA rD lo hi ∅ := by + refine ⟨⟨⟨ZFSet.empty_subset _, fun a ha => False.elim (ZFSet.notMem_empty a ha)⟩, ?_⟩, ?_, ?_⟩ + · intro a b q entry _ + exact False.elim (ZFSet.notMem_empty _ entry) + · intro a b q z entry _ + exact False.elim (ZFSet.notMem_empty _ entry) + · intro a q entry + exact False.elim (ZFSet.notMem_empty _ entry) + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem exists_intervalEmbedding_of_enumeration + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A D rA rD e lo hi c : ZFSet.{u}} + (hA : A ∈ M.sets) (hD : D ∈ M.sets) (hrA : rA ∈ M.sets) + (hrD : rD ∈ M.sets) (he : e ∈ M.sets) (hc : c ∈ M.sets) + (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) + (injection : InjectionCode D ZFSet.omega c) + (enumeration : ZFSet.IsFunc ZFSet.omega A e) + (onto : ∀ a ∈ A, ∃ n ∈ ZFSet.omega, ZFSet.pair n a ∈ e) + (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : + ∃ f ∈ M.sets, IntervalEmbeddingCode A D rA rD lo hi f := by + obtain ⟨t, ht, sequence, _, _⟩ := M.exists_ground_intervalSequence + pairing unions separation collection infinite hA hD hrA hrD he hc + source target injection enumeration loD hiD gap + obtain ⟨member, inj, inside, order⟩ := M.intervalSequenceDescent_spec + pairing unions powers separation hA hD he ht (M.omega_mem separation infinite) sequence onto + exact ⟨intervalSequenceGraph A D e t, member, inj, + fun a b q z first second => (order a b q z first second).symm, inside⟩ + +theorem exists_intervalEmbedding + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A D rA rD lo hi c : ZFSet.{u}} + (hA : A ∈ M.sets) (hD : D ∈ M.sets) (hrA : rA ∈ M.sets) + (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) + (injection : InjectionCode D ZFSet.omega c) + (small : M.groundEmbeddable A ZFSet.omega) + (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : + ∃ f ∈ M.sets, IntervalEmbeddingCode A D rA rD lo hi f := by + by_cases nonempty : A.Nonempty + · obtain ⟨sourceCode, hSourceCode, sourceInjection⟩ := small + have he := M.canonicalEnumeration_mem pairing unions powers separation + hA hSourceCode (M.omega_mem separation infinite) sourceInjection nonempty + have enumeration := canonicalEnumeration_isFunc sourceInjection nonempty + have onto := canonicalEnumeration_onto sourceInjection + exact M.exists_intervalEmbedding_of_enumeration pairing unions powers separation collection infinite + hA hD hrA hrD he hc source target injection enumeration onto loD hiD gap + · have empty : A = ∅ := by + apply ZFSet.ext + intro a + exact ⟨fun ha => False.elim (nonempty ⟨a, ha⟩), fun ha => False.elim (ZFSet.notMem_empty a ha)⟩ + exact ⟨∅, M.empty_mem ⟨D, hD⟩, empty ▸ intervalEmbeddingCode_empty D rA rD lo hi⟩ + +theorem exists_groundRationalIntervals + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) : + ∃ D ∈ M.sets, ∃ r ∈ M.sets, ∃ c ∈ M.sets, + InjectionCode D ZFSet.omega c ∧ DenseOrderCode D r ∧ (∃ x, x ∈ D) ∧ + (∀ x ∈ D, (∃ y ∈ D, ZFSet.pair y x ∈ r) ∧ (∃ y ∈ D, ZFSet.pair x y ∈ r)) ∧ + (∃ s : Presentation (ULift.{u} Rational), s.carrier = D ∧ + ∀ a b, ZFSet.pair (s.encode a) (s.encode b) ∈ r ↔ Rational.lt a.down b.down) ∧ + ∀ A ∈ M.sets, ∀ rA ∈ M.sets, StrictLinearOrderCode A rA → + M.groundEmbeddable A ZFSet.omega → ∀ lo ∈ D, ∀ hi ∈ D, + ZFSet.pair lo hi ∈ r → ∃ f ∈ M.sets, IntervalEmbeddingCode A D rA r lo hi f := by + obtain ⟨D, hD, r, hr, c, hc, injection, target, nonempty, endpoints, s, carrier, order⟩ := + M.exists_groundRationals pairing unions powers separation infinite + refine ⟨D, hD, r, hr, c, hc, injection, target, nonempty, endpoints, ⟨s, carrier, order⟩, ?_⟩ + intro A hA rA hrA source small lo hlo hi hhi gap + exact M.exists_intervalEmbedding pairing unions powers separation collection infinite + hA hD hrA hr hc source target injection small hlo hhi gap + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +universe u + +structure IntervalEmbeddingFamilyInputs (I As rs los his D rD : ZFSet.{u}) : Prop where + sources : FunctionGraphOn I As + orders : FunctionGraphOn I rs + lows : FunctionGraphOn I los + highs : FunctionGraphOn I his + source_order : ∀ i, StrictLinearOrderCode (sources.value i) (orders.value i) + lower_mem : ∀ i, lows.value i ∈ D + upper_mem : ∀ i, highs.value i ∈ D + gap : ∀ i, ZFSet.pair (lows.value i) (highs.value i) ∈ rD + +def intervalEmbeddingCandidate (As rs los his D rD i f : ZFSet.{u}) : Prop := + ∃ A ∈ ⋃₀ ⋃₀ As, ∃ rA ∈ ⋃₀ ⋃₀ rs, ∃ lo ∈ D, ∃ hi ∈ D, + ZFSet.pair i A ∈ As ∧ ZFSet.pair i rA ∈ rs ∧ + ZFSet.pair i lo ∈ los ∧ ZFSet.pair i hi ∈ his ∧ + IntervalEmbeddingCode A D rA rD lo hi f + +noncomputable def intervalEmbeddingRelation (I W As rs los his D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ W, z = ZFSet.pair i f ∧ + intervalEmbeddingCandidate As rs los his D rD i f) (ZFSet.prod I W) + +theorem pair_mem_intervalEmbeddingRelation (I W As rs los his D rD i f : ZFSet.{u}) : + ZFSet.pair i f ∈ intervalEmbeddingRelation I W As rs los his D rD ↔ + i ∈ I ∧ f ∈ W ∧ intervalEmbeddingCandidate As rs los his D rD i f := by + rw [intervalEmbeddingRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, valid⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hi, hf, valid⟩ + · rintro ⟨hi, hf, valid⟩ + exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, valid⟩ + +namespace IntervalEmbeddingFamilyInputs + +variable {I As rs los his D rD : ZFSet.{u}} + (d : IntervalEmbeddingFamilyInputs I As rs los his D rD) + +theorem candidate_iff (i : {i : ZFSet.{u} // i ∈ I}) (f : ZFSet.{u}) : + intervalEmbeddingCandidate As rs los his D rD i.val f ↔ + IntervalEmbeddingCode (d.sources.value i) D (d.orders.value i) rD + (d.lows.value i) (d.highs.value i) f := by + constructor + · rintro ⟨A, _, rA, _, lo, _, hi, _, entryA, entryR, entryLo, entryHi, code⟩ + have eA := d.sources.value_eq_of_entry i entryA + have eR := d.orders.value_eq_of_entry i entryR + have eLo := d.lows.value_eq_of_entry i entryLo + have eHi := d.highs.value_eq_of_entry i entryHi + rw [eA, eR, eLo, eHi] + exact code + · intro code + exact ⟨d.sources.value i, d.sources.value_mem_doubleUnion i, + d.orders.value i, d.orders.value_mem_doubleUnion i, + d.lows.value i, d.lower_mem i, d.highs.value i, d.upper_mem i, + d.sources.value_entry i, d.orders.value_entry i, + d.lows.value_entry i, d.highs.value_entry i, code⟩ + +theorem embedding_subset_bound (i : {i : ZFSet.{u} // i ∈ I}) {f : ZFSet.{u}} + (code : IntervalEmbeddingCode (d.sources.value i) D (d.orders.value i) rD + (d.lows.value i) (d.highs.value i) f) : + f ⊆ ZFSet.prod (familyPointBound As) D := by + intro z hz + obtain ⟨a, ha, q, hq, rfl⟩ := ZFSet.mem_prod.1 (code.injection.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨mem_familyPointBound_of_entry (d.sources.value_entry i) ha, hq⟩ + +end IntervalEmbeddingFamilyInputs + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalTraceValidity.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalTraceValidity.lean index 091d8927650afc4c6c6ed342486972452c7523f6..ebfd5dc6c85b03e8ebfcb3d4f1b38021ce316c19 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalTraceValidity.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/IntervalTraceValidity.lean @@ -1,69 +1,69 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IntervalSequenceFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -theorem intervalSequence_of_next - {N A D rA rD e lo hi t : ZFSet.{u}} - (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD) - (enumeration : ZFSet.IsFunc ZFSet.omega A e) - (natural : N ⊆ ZFSet.omega) (function : FunctionGraphOn N t) - (next : ∀ i ∈ N, ∀ y, ZFSet.pair i y ∈ t → - intervalNextCandidate i A D rA rD e lo hi (graphRestriction i t) y) : - IntervalSequenceCode N A D rA rD e lo hi t := by - have functionD : ZFSet.IsFunc N D t := by - refine ⟨?_, function.to_isFunc.2⟩ - intro w hw - obtain ⟨i, hiN, y, rfl⟩ := function.shape w hw - exact ZFSet.pair_mem_prod.2 ⟨hiN, (next i hiN y hw).1⟩ - have pairwise : ∀ i j a b q z, - ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e → - ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → - (a = b ↔ q = z) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD) ∧ - (ZFSet.pair b a ∈ rA ↔ ZFSet.pair z q ∈ rD) := by - intro i j a b q z ia jb iq jz - have iN := function.pair_source iq - have jN := function.pair_source jz - have aA := (ZFSet.pair_mem_prod.1 (enumeration.1 ia)).2 - have bA := (ZFSet.pair_mem_prod.1 (enumeration.1 jb)).2 - have qD := (ZFSet.pair_mem_prod.1 (functionD.1 iq)).2 - have zD := (ZFSet.pair_mem_prod.1 (functionD.1 jz)).2 - obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode i).1 (natural iN) - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode j).1 (natural jN) - rcases lt_trichotomy m n with earlier | same | later - · exact (next (natSetCode n) jN z jz).2.2.2 - (natSetCode m) ((natSetCode_mem_iff m n).2 earlier) - a aA b bA q qD ia jb (pair_mem_graphRestriction.2 ⟨iq, - (natSetCode_mem_iff m n).2 earlier⟩) - · subst n - have equalSource : a = b := (show FunctionGraphOn ZFSet.omega e from ⟨A, enumeration⟩).unique ia jb - have equalTarget : q = z := function.unique iq jz - subst b - subst z - exact ⟨iff_of_true rfl rfl, - iff_of_false (source.irrefl a aA) (target.irrefl q qD), - iff_of_false (source.irrefl a aA) (target.irrefl q qD)⟩ - · have reversed := (next (natSetCode m) iN q iq).2.2.2 - (natSetCode n) ((natSetCode_mem_iff n m).2 later) - b bA a aA z zD jb ia (pair_mem_graphRestriction.2 ⟨jz, - (natSetCode_mem_iff n m).2 later⟩) - exact ⟨by simpa only [eq_comm] using reversed.1, reversed.2.2, reversed.2.1⟩ - refine ⟨functionD, ?_, ?_, ?_⟩ - · intro i y iy - have candidate := next i (function.pair_source iy) y iy - exact ⟨candidate.2.1, candidate.2.2.1⟩ - · intro i j a b q z ia jb iq jz - exact (pairwise i j a b q z ia jb iq jz).1 - · intro i j a b q z ia jb iq jz - exact (pairwise i j a b q z ia jb iq jz).2.1 - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IntervalSequenceFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +theorem intervalSequence_of_next + {N A D rA rD e lo hi t : ZFSet.{u}} + (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD) + (enumeration : ZFSet.IsFunc ZFSet.omega A e) + (natural : N ⊆ ZFSet.omega) (function : FunctionGraphOn N t) + (next : ∀ i ∈ N, ∀ y, ZFSet.pair i y ∈ t → + intervalNextCandidate i A D rA rD e lo hi (graphRestriction i t) y) : + IntervalSequenceCode N A D rA rD e lo hi t := by + have functionD : ZFSet.IsFunc N D t := by + refine ⟨?_, function.to_isFunc.2⟩ + intro w hw + obtain ⟨i, hiN, y, rfl⟩ := function.shape w hw + exact ZFSet.pair_mem_prod.2 ⟨hiN, (next i hiN y hw).1⟩ + have pairwise : ∀ i j a b q z, + ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e → + ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → + (a = b ↔ q = z) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD) ∧ + (ZFSet.pair b a ∈ rA ↔ ZFSet.pair z q ∈ rD) := by + intro i j a b q z ia jb iq jz + have iN := function.pair_source iq + have jN := function.pair_source jz + have aA := (ZFSet.pair_mem_prod.1 (enumeration.1 ia)).2 + have bA := (ZFSet.pair_mem_prod.1 (enumeration.1 jb)).2 + have qD := (ZFSet.pair_mem_prod.1 (functionD.1 iq)).2 + have zD := (ZFSet.pair_mem_prod.1 (functionD.1 jz)).2 + obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode i).1 (natural iN) + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode j).1 (natural jN) + rcases lt_trichotomy m n with earlier | same | later + · exact (next (natSetCode n) jN z jz).2.2.2 + (natSetCode m) ((natSetCode_mem_iff m n).2 earlier) + a aA b bA q qD ia jb (pair_mem_graphRestriction.2 ⟨iq, + (natSetCode_mem_iff m n).2 earlier⟩) + · subst n + have equalSource : a = b := (show FunctionGraphOn ZFSet.omega e from ⟨A, enumeration⟩).unique ia jb + have equalTarget : q = z := function.unique iq jz + subst b + subst z + exact ⟨iff_of_true rfl rfl, + iff_of_false (source.irrefl a aA) (target.irrefl q qD), + iff_of_false (source.irrefl a aA) (target.irrefl q qD)⟩ + · have reversed := (next (natSetCode m) iN q iq).2.2.2 + (natSetCode n) ((natSetCode_mem_iff n m).2 later) + b bA a aA z zD jb ia (pair_mem_graphRestriction.2 ⟨jz, + (natSetCode_mem_iff n m).2 later⟩) + exact ⟨by simpa only [eq_comm] using reversed.1, reversed.2.2, reversed.2.1⟩ + refine ⟨functionD, ?_, ?_, ?_⟩ + · intro i y iy + have candidate := next i (function.pair_source iy) y iy + exact ⟨candidate.2.1, candidate.2.2.1⟩ + · intro i j a b q z ia jb iq jz + exact (pairwise i j a b q z ia jb iq jz).1 + · intro i j a b q z ia jb iq jz + exact (pairwise i j a b q z ia jb iq jz).2.1 + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionEmbeddings.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionEmbeddings.lean index 8b3c9ffb8da2f1028f4d0df11d538ce05b442911..ef6874476de406e007b97c6e99d04410139b3ef1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionEmbeddings.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionEmbeddings.lean @@ -1,124 +1,124 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RecursiveActionRealization - -namespace OAI - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -theorem liftGraph_entry (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - ZFSet.pair (ZFSet.pair i.val (d.coding.encode x)) - (h.nextEncode M next (h.toInputs.lift i x)) ∈ h.liftGraph M next := by - classical - cases x with - | inl x => - rw [h.toInputs.lift_old, h.nextEncode_old] - exact (h.liftGraph_old_iff M next (h.maps.value_entry i) x.property).2 - (h.toInputs_previous_entry i x) - | inr q => - by_cases positive : d.templates.upper q.1 (h.toInputs.source i) - · rw [h.toInputs.lift_new_inside i q positive, h.nextEncode_old] - exact (h.liftGraph_positive_iff M next (h.source_entry i) (d.filter_entry q.1) - (h.actor_entry i) (d.freshCode_mem q) positive).2 - (h.toInputs_representative_entry i (.inr q)) - · rw [h.toInputs.lift_new_outside i q positive, h.nextEncode_fresh] - exact (h.liftGraph_negative_iff M next (h.source_entry i) (d.filter_entry q.1) - (d.freshCode_mem q) positive).2 rfl - -theorem liftGraph_entry_iff (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) (y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i.val (d.coding.encode x)) y ∈ h.liftGraph M next ↔ - y = h.nextEncode M next (h.toInputs.lift i x) := by - constructor - · intro entry - exact (show FunctionGraphOn (ZFSet.prod I d.batchCarrier) (h.liftGraph M next) from - ⟨next.batchCarrier, h.liftGraph_function M next⟩).unique entry (h.liftGraph_entry M next i x) - · intro equal - exact equal.symm ▸ h.liftGraph_entry M next i x - -theorem liftSection_entry (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - ZFSet.pair (d.coding.encode x) (h.nextEncode M next (h.toInputs.lift i x)) ∈ - h.liftSection M next i.val := - (pair_mem_indexedRelationSection _ _ _ _ _ _).2 - ⟨d.coding.encode_mem x, h.nextEncode_mem M next _, h.liftGraph_entry M next i x⟩ - -theorem liftSection_entry_iff (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) (y : ZFSet.{u}) : - ZFSet.pair (d.coding.encode x) y ∈ h.liftSection M next i.val ↔ - y = h.nextEncode M next (h.toInputs.lift i x) := by - constructor - · intro entry - exact (h.liftGraph_entry_iff M next i x y).1 - ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 entry).2.2 - · intro equal - exact equal.symm ▸ h.liftSection_entry M next i x - -theorem liftSection_order_iff (i : {i : ZFSet.{u} // i ∈ I}) - {x y x' y' : ZFSet.{u}} - (first : ZFSet.pair x x' ∈ h.liftSection M next i.val) - (second : ZFSet.pair y y' ∈ h.liftSection M next i.val) : - ZFSet.pair x' y' ∈ next.batchOrder ↔ ZFSet.pair x y ∈ d.batchOrder := by - have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 first)).1 - have hy := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 second)).1 - obtain ⟨a, rfl⟩ := d.coding.encode_surjective x hx - obtain ⟨b, rfl⟩ := d.coding.encode_surjective y hy - rw [(h.liftSection_entry_iff M next i a x').1 first, - (h.liftSection_entry_iff M next i b y').1 second, h.next_le_encode] - exact ((h.toInputs.liftedEmbedding i).le_iff a b).trans (d.coding.le_encode a b).symm - -theorem liftSection_injection (i : {i : ZFSet.{u} // i ∈ I}) : - InjectionCode d.batchCarrier next.batchCarrier (h.liftSection M next i.val) where - function := h.liftSection_function M next i.property - injective := by - intro x y z first second - have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 first)).1 - have hy := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 second)).1 - obtain ⟨a, rfl⟩ := d.coding.encode_surjective x hx - obtain ⟨b, rfl⟩ := d.coding.encode_surjective y hy - have equal := ((h.liftSection_entry_iff M next i a z).1 first).symm.trans - ((h.liftSection_entry_iff M next i b z).1 second) - exact congrArg d.coding.encode (h.toInputs.lift_injective i - (h.nextEncode_injective M next equal)) - -theorem liftSection_map_meet (i : {i : ZFSet.{u} // i ∈ I}) - {x y z x' y' z' : ZFSet.{u}} - (meet : ZFSet.pair (ZFSet.pair x y) z ∈ d.batchMeetGraph) - (first : ZFSet.pair x x' ∈ h.liftSection M next i.val) - (second : ZFSet.pair y y' ∈ h.liftSection M next i.val) - (third : ZFSet.pair z z' ∈ h.liftSection M next i.val) : - ZFSet.pair (ZFSet.pair x' y') z' ∈ next.batchMeetGraph := by - have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 first)).1 - have hy := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 second)).1 - obtain ⟨a, rfl⟩ := d.coding.encode_surjective x hx - obtain ⟨b, rfl⟩ := d.coding.encode_surjective y hy - have same : z = d.coding.encode (d.templates.extension.meet a b) := - (show FunctionGraphOn (ZFSet.prod d.batchCarrier d.batchCarrier) d.batchMeetGraph from - ⟨d.batchCarrier, d.batch_meetOrder.operation⟩).unique meet (d.coding.encoded_meet_entry a b) - subst z - rw [(h.liftSection_entry_iff M next i a x').1 first, - (h.liftSection_entry_iff M next i b y').1 second, - (h.liftSection_entry_iff M next i (d.templates.extension.meet a b) z').1 third] - have preserved := (h.toInputs.liftedEmbedding i).map_meet a b - change h.toInputs.lift i (d.templates.extension.meet a b) = - h.toInputs.nextBatch.extension.meet (h.toInputs.lift i a) (h.toInputs.lift i b) at preserved - rw [preserved] - exact h.next_meet_entry M next (h.toInputs.lift i a) (h.toInputs.lift i b) - -theorem liftSection_embedding (i : {i : ZFSet.{u} // i ∈ I}) : - MeetEmbeddingCode d.batchCarrier next.batchCarrier d.batchOrder next.batchOrder - d.batchMeetGraph next.batchMeetGraph (h.liftSection M next i.val) where - injection := h.liftSection_injection M next i - monotone := fun _ _ _ _ lower first second => - (h.liftSection_order_iff M next i first second).2 lower - map_meet := fun _ _ _ _ _ _ meet first second third => - h.liftSection_map_meet M next i meet first second third - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RecursiveActionRealization + +namespace OAI + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +theorem liftGraph_entry (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + ZFSet.pair (ZFSet.pair i.val (d.coding.encode x)) + (h.nextEncode M next (h.toInputs.lift i x)) ∈ h.liftGraph M next := by + classical + cases x with + | inl x => + rw [h.toInputs.lift_old, h.nextEncode_old] + exact (h.liftGraph_old_iff M next (h.maps.value_entry i) x.property).2 + (h.toInputs_previous_entry i x) + | inr q => + by_cases positive : d.templates.upper q.1 (h.toInputs.source i) + · rw [h.toInputs.lift_new_inside i q positive, h.nextEncode_old] + exact (h.liftGraph_positive_iff M next (h.source_entry i) (d.filter_entry q.1) + (h.actor_entry i) (d.freshCode_mem q) positive).2 + (h.toInputs_representative_entry i (.inr q)) + · rw [h.toInputs.lift_new_outside i q positive, h.nextEncode_fresh] + exact (h.liftGraph_negative_iff M next (h.source_entry i) (d.filter_entry q.1) + (d.freshCode_mem q) positive).2 rfl + +theorem liftGraph_entry_iff (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) (y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i.val (d.coding.encode x)) y ∈ h.liftGraph M next ↔ + y = h.nextEncode M next (h.toInputs.lift i x) := by + constructor + · intro entry + exact (show FunctionGraphOn (ZFSet.prod I d.batchCarrier) (h.liftGraph M next) from + ⟨next.batchCarrier, h.liftGraph_function M next⟩).unique entry (h.liftGraph_entry M next i x) + · intro equal + exact equal.symm ▸ h.liftGraph_entry M next i x + +theorem liftSection_entry (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + ZFSet.pair (d.coding.encode x) (h.nextEncode M next (h.toInputs.lift i x)) ∈ + h.liftSection M next i.val := + (pair_mem_indexedRelationSection _ _ _ _ _ _).2 + ⟨d.coding.encode_mem x, h.nextEncode_mem M next _, h.liftGraph_entry M next i x⟩ + +theorem liftSection_entry_iff (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) (y : ZFSet.{u}) : + ZFSet.pair (d.coding.encode x) y ∈ h.liftSection M next i.val ↔ + y = h.nextEncode M next (h.toInputs.lift i x) := by + constructor + · intro entry + exact (h.liftGraph_entry_iff M next i x y).1 + ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 entry).2.2 + · intro equal + exact equal.symm ▸ h.liftSection_entry M next i x + +theorem liftSection_order_iff (i : {i : ZFSet.{u} // i ∈ I}) + {x y x' y' : ZFSet.{u}} + (first : ZFSet.pair x x' ∈ h.liftSection M next i.val) + (second : ZFSet.pair y y' ∈ h.liftSection M next i.val) : + ZFSet.pair x' y' ∈ next.batchOrder ↔ ZFSet.pair x y ∈ d.batchOrder := by + have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 first)).1 + have hy := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 second)).1 + obtain ⟨a, rfl⟩ := d.coding.encode_surjective x hx + obtain ⟨b, rfl⟩ := d.coding.encode_surjective y hy + rw [(h.liftSection_entry_iff M next i a x').1 first, + (h.liftSection_entry_iff M next i b y').1 second, h.next_le_encode] + exact ((h.toInputs.liftedEmbedding i).le_iff a b).trans (d.coding.le_encode a b).symm + +theorem liftSection_injection (i : {i : ZFSet.{u} // i ∈ I}) : + InjectionCode d.batchCarrier next.batchCarrier (h.liftSection M next i.val) where + function := h.liftSection_function M next i.property + injective := by + intro x y z first second + have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 first)).1 + have hy := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 second)).1 + obtain ⟨a, rfl⟩ := d.coding.encode_surjective x hx + obtain ⟨b, rfl⟩ := d.coding.encode_surjective y hy + have equal := ((h.liftSection_entry_iff M next i a z).1 first).symm.trans + ((h.liftSection_entry_iff M next i b z).1 second) + exact congrArg d.coding.encode (h.toInputs.lift_injective i + (h.nextEncode_injective M next equal)) + +theorem liftSection_map_meet (i : {i : ZFSet.{u} // i ∈ I}) + {x y z x' y' z' : ZFSet.{u}} + (meet : ZFSet.pair (ZFSet.pair x y) z ∈ d.batchMeetGraph) + (first : ZFSet.pair x x' ∈ h.liftSection M next i.val) + (second : ZFSet.pair y y' ∈ h.liftSection M next i.val) + (third : ZFSet.pair z z' ∈ h.liftSection M next i.val) : + ZFSet.pair (ZFSet.pair x' y') z' ∈ next.batchMeetGraph := by + have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 first)).1 + have hy := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next i.property).1 second)).1 + obtain ⟨a, rfl⟩ := d.coding.encode_surjective x hx + obtain ⟨b, rfl⟩ := d.coding.encode_surjective y hy + have same : z = d.coding.encode (d.templates.extension.meet a b) := + (show FunctionGraphOn (ZFSet.prod d.batchCarrier d.batchCarrier) d.batchMeetGraph from + ⟨d.batchCarrier, d.batch_meetOrder.operation⟩).unique meet (d.coding.encoded_meet_entry a b) + subst z + rw [(h.liftSection_entry_iff M next i a x').1 first, + (h.liftSection_entry_iff M next i b y').1 second, + (h.liftSection_entry_iff M next i (d.templates.extension.meet a b) z').1 third] + have preserved := (h.toInputs.liftedEmbedding i).map_meet a b + change h.toInputs.lift i (d.templates.extension.meet a b) = + h.toInputs.nextBatch.extension.meet (h.toInputs.lift i a) (h.toInputs.lift i b) at preserved + rw [preserved] + exact h.next_meet_entry M next (h.toInputs.lift i a) (h.toInputs.lift i b) + +theorem liftSection_embedding (i : {i : ZFSet.{u} // i ∈ I}) : + MeetEmbeddingCode d.batchCarrier next.batchCarrier d.batchOrder next.batchOrder + d.batchMeetGraph next.batchMeetGraph (h.liftSection M next i.val) where + injection := h.liftSection_injection M next i + monotone := fun _ _ _ _ lower first second => + (h.liftSection_order_iff M next i first second).2 lower + map_meet := fun _ _ _ _ _ _ meet first second third => + h.liftSection_map_meet M next i meet first second third + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionFunctions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionFunctions.lean index e84295ccca495b8e685e0f0b48dd50620b3ca36a..9fda59a80b7d2fad2f0d8b4c4ef644e68d3c5d0b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionFunctions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/LiftedCompressionFunctions.lean @@ -1,188 +1,188 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions -import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedExtensionCodes - -namespace OAI - -namespace PartitionPilot.Forcing - -universe u - -def liftOldEntry (D Maps i x y : ZFSet.{u}) : Prop := - x ∈ D ∧ ∃ S ∈ ZFSet.sUnion (ZFSet.sUnion Maps), ZFSet.pair i S ∈ Maps ∧ ZFSet.pair x y ∈ S - -def liftFreshEntry (D L J B N Sources Fs Reps G A i x y : ZFSet.{u}) : Prop := - ∃ j ∈ J, ∃ q ∈ B, ∃ a ∈ D, ∃ F ∈ ZFSet.sUnion (ZFSet.sUnion Fs), - x = ZFSet.pair D (ZFSet.pair j q) ∧ ZFSet.pair j q ∈ N ∧ - ZFSet.pair i a ∈ Sources ∧ ZFSet.pair j F ∈ Fs ∧ - ((a ∈ F ∧ ∃ g ∈ G, ZFSet.pair i g ∈ Reps ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A) ∨ - (a ∉ F ∧ y = ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q))) - -def liftedCompressionGraph (I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ x ∈ L, ∃ y ∈ C, - z = ZFSet.pair (ZFSet.pair i x) y ∧ - (liftOldEntry D Maps i x y ∨ liftFreshEntry D L J B N Sources Fs Reps G A i x y)) - (ZFSet.prod (ZFSet.prod I L) C) - -theorem pair_mem_liftedCompressionGraph (I J D L C N B Maps Sources Fs Reps G A i x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i x) y ∈ liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ↔ - i ∈ I ∧ x ∈ L ∧ y ∈ C ∧ - (liftOldEntry D Maps i x y ∨ liftFreshEntry D L J B N Sources Fs Reps G A i x y) := by - rw [liftedCompressionGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, i', hi, x', hx, y', hy, eq, entry⟩ - obtain ⟨ix, rfl⟩ := ZFSet.pair_inj.1 eq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ix - exact ⟨hi, hx, hy, entry⟩ - · rintro ⟨hi, hx, hy, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩, - i, hi, x, hx, y, hy, rfl, entry⟩ - -theorem liftFreshEntry_not_old {D L J B N Sources Fs Reps G A i x y : ZFSet.{u}} - (entry : liftFreshEntry D L J B N Sources Fs Reps G A i x y) : x ∉ D := by - obtain ⟨j, _, q, _, _, _, _, _, eq, _⟩ := entry - rw [eq] - exact pair_tag_not_mem D (ZFSet.pair j q) - -theorem liftOldEntry_iff {I D Maps i S x y : ZFSet.{u}} - (maps : FunctionGraphOn I Maps) (entry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : - liftOldEntry D Maps i x y ↔ ZFSet.pair x y ∈ S := by - constructor - · rintro ⟨_, T, _, iT, xy⟩ - exact maps.unique iT entry ▸ xy - · intro xy - exact ⟨hx, S, pair_second_mem_doubleUnion entry, entry, xy⟩ - -theorem liftedCompressionGraph_old_iff {I J D L C N B Maps Sources Fs Reps G A i S x y : ZFSet.{u}} - (maps : FunctionGraphOn I Maps) (entry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : - ZFSet.pair (ZFSet.pair i x) y ∈ liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ↔ - x ∈ L ∧ y ∈ C ∧ ZFSet.pair x y ∈ S := by - rw [pair_mem_liftedCompressionGraph] - constructor - · rintro ⟨_, hxL, hy, old | fresh⟩ - · exact ⟨hxL, hy, (liftOldEntry_iff maps entry hx).1 old⟩ - · exact False.elim (liftFreshEntry_not_old fresh hx) - · rintro ⟨hxL, hy, xy⟩ - exact ⟨maps.pair_source entry, hxL, hy, Or.inl ((liftOldEntry_iff maps entry hx).2 xy)⟩ - -theorem liftFreshEntry_iff {I D L J B N Sources Fs Reps G A i j q a F y : ZFSet.{u}} - (sources : FunctionGraphOn I Sources) (filters : FunctionGraphOn J Fs) - (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) - (hj : j ∈ J) (hq : q ∈ B) (ha : a ∈ D) (fresh : ZFSet.pair j q ∈ N) : - liftFreshEntry D L J B N Sources Fs Reps G A i (ZFSet.pair D (ZFSet.pair j q)) y ↔ - ((a ∈ F ∧ ∃ g ∈ G, ZFSet.pair i g ∈ Reps ∧ - ZFSet.pair (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) y ∈ A) ∨ - (a ∉ F ∧ y = ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q))) := by - constructor - · rintro ⟨j', _, q', _, a', _, F', _, eq, _, source', filter', output⟩ - have jq := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 eq).2 - obtain ⟨rfl, rfl⟩ := jq - have aEq := sources.unique source' source - have FEq := filters.unique filter' filter - exact aEq ▸ FEq ▸ output - · intro output - exact ⟨j, hj, q, hq, a, ha, F, pair_second_mem_doubleUnion filter, - rfl, fresh, source, filter, output⟩ - -theorem liftedCompressionGraph_fresh_iff - {I J D L C N B Maps Sources Fs Reps G A i j q a F y : ZFSet.{u}} - (sources : FunctionGraphOn I Sources) (filters : FunctionGraphOn J Fs) - (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) - (hj : j ∈ J) (hq : q ∈ B) (ha : a ∈ D) (fresh : ZFSet.pair j q ∈ N) : - ZFSet.pair (ZFSet.pair i (ZFSet.pair D (ZFSet.pair j q))) y ∈ - liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ↔ - ZFSet.pair D (ZFSet.pair j q) ∈ L ∧ y ∈ C ∧ - ((a ∈ F ∧ ∃ g ∈ G, ZFSet.pair i g ∈ Reps ∧ - ZFSet.pair (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) y ∈ A) ∨ - (a ∉ F ∧ y = ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q))) := by - rw [pair_mem_liftedCompressionGraph] - constructor - · rintro ⟨_, hx, hy, old | entry⟩ - · exact False.elim (pair_tag_not_mem D (ZFSet.pair j q) old.1) - · exact ⟨hx, hy, (liftFreshEntry_iff sources filters source filter hj hq ha fresh).1 entry⟩ - · rintro ⟨hx, hy, output⟩ - exact ⟨sources.pair_source source, hx, hy, - Or.inr ((liftFreshEntry_iff sources filters source filter hj hq ha fresh).2 output)⟩ - -theorem liftedCompressionGraph_function - {I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}} - (current : L = taggedExtension D N) (freshShape : N ⊆ ZFSet.prod J B) - (extension : L ⊆ C) (maps : FunctionGraphOn I Maps) - (valid : ∀ i S, ZFSet.pair i S ∈ Maps → ZFSet.IsFunc D L S) - (sources : ZFSet.IsFunc I D Sources) (filters : FunctionGraphOn J Fs) - (reps : ZFSet.IsFunc I G Reps) (action : ZFSet.IsFunc (ZFSet.prod G L) L A) - (negativeTargets : ∀ i ∈ I, ∀ j ∈ J, ∀ q ∈ B, ∀ a F, - ZFSet.pair j q ∈ N → ZFSet.pair i a ∈ Sources → ZFSet.pair j F ∈ Fs → - a ∉ F → ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q) ∈ C) : - ZFSet.IsFunc (ZFSet.prod I L) C - (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) := by - classical - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro p hp - obtain ⟨i, hi, x, hxL, rfl⟩ := ZFSet.mem_prod.1 hp - rcases mem_taggedExtension.1 (current ▸ hxL) with old | ⟨n, hn, rfl⟩ - · obtain ⟨S, mapEntry⟩ := maps.total hi - obtain ⟨y, entry, unique⟩ := (valid i S mapEntry).2 x old - have hy := (ZFSet.pair_mem_prod.1 ((valid i S mapEntry).1 entry)).2 - refine ⟨y, (liftedCompressionGraph_old_iff maps mapEntry old).2 ⟨hxL, extension hy, entry⟩, ?_⟩ - intro z hz - exact unique z ((liftedCompressionGraph_old_iff maps mapEntry old).1 hz).2.2 - · obtain ⟨j, hj, q, hq, rfl⟩ := ZFSet.mem_prod.1 (freshShape hn) - obtain ⟨a, source, _⟩ := sources.2 i hi - have ha := (ZFSet.pair_mem_prod.1 (sources.1 source)).2 - obtain ⟨F, filter⟩ := filters.total hj - have sourceFunc : FunctionGraphOn I Sources := ⟨D, sources⟩ - by_cases positive : a ∈ F - · obtain ⟨g, representative, _⟩ := reps.2 i hi - have hg := (ZFSet.pair_mem_prod.1 (reps.1 representative)).2 - obtain ⟨y, entry, unique⟩ := action.2 - (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) (ZFSet.pair_mem_prod.2 ⟨hg, hxL⟩) - have hy := (ZFSet.pair_mem_prod.1 (action.1 entry)).2 - refine ⟨y, (liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).2 - ⟨hxL, extension hy, Or.inl ⟨positive, g, hg, representative, entry⟩⟩, ?_⟩ - intro z hz - rcases ((liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).1 hz).2.2 - with ⟨_, g', _, representative', entry'⟩ | ⟨negative, _⟩ - · have equal : g' = g := (show FunctionGraphOn I Reps from ⟨G, reps⟩).unique representative' representative - exact unique z (equal ▸ entry') - · exact False.elim (negative positive) - · let y := ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q) - have hy : y ∈ C := negativeTargets i hi j hj q hq a F hn source filter positive - refine ⟨y, (liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).2 - ⟨hxL, hy, Or.inr ⟨positive, rfl⟩⟩, ?_⟩ - intro z hz - rcases ((liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).1 hz).2.2 - with ⟨positive', _⟩ | ⟨_, equal⟩ - · exact False.elim (positive positive') - · exact equal - -theorem indexedRelationSection_function {I L C R i : ZFSet.{u}} - (function : ZFSet.IsFunc (ZFSet.prod I L) C R) (hi : i ∈ I) : - ZFSet.IsFunc L C (indexedRelationSection L C R i) := by - refine ⟨indexedRelationSection_subset L C R i, ?_⟩ - intro x hx - obtain ⟨y, entry, unique⟩ := function.2 (ZFSet.pair i x) (ZFSet.pair_mem_prod.2 ⟨hi, hx⟩) - have hy := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - refine ⟨y, (pair_mem_indexedRelationSection L C R i x y).2 ⟨hx, hy, entry⟩, ?_⟩ - intro z hz - exact unique z ((pair_mem_indexedRelationSection L C R i x z).1 hz).2.2 - -theorem liftedCompressionSection_function - {I J D L C N B Maps Sources Fs Reps G A i : ZFSet.{u}} - (current : L = taggedExtension D N) (freshShape : N ⊆ ZFSet.prod J B) - (extension : L ⊆ C) (maps : FunctionGraphOn I Maps) - (valid : ∀ j S, ZFSet.pair j S ∈ Maps → ZFSet.IsFunc D L S) - (sources : ZFSet.IsFunc I D Sources) (filters : FunctionGraphOn J Fs) - (reps : ZFSet.IsFunc I G Reps) (action : ZFSet.IsFunc (ZFSet.prod G L) L A) - (negativeTargets : ∀ j ∈ I, ∀ k ∈ J, ∀ q ∈ B, ∀ a F, - ZFSet.pair k q ∈ N → ZFSet.pair j a ∈ Sources → ZFSet.pair k F ∈ Fs → - a ∉ F → ZFSet.pair L (ZFSet.pair (ZFSet.pair j k) q) ∈ C) - (hi : i ∈ I) : - ZFSet.IsFunc L C (indexedRelationSection L C - (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) i) := - indexedRelationSection_function - (liftedCompressionGraph_function current freshShape extension maps valid sources filters reps action negativeTargets) hi - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions +import OAI.SetTheory.PartitionPrinciple.Definability.MapFamilyApplicationGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedExtensionCodes + +namespace OAI + +namespace PartitionPilot.Forcing + +universe u + +def liftOldEntry (D Maps i x y : ZFSet.{u}) : Prop := + x ∈ D ∧ ∃ S ∈ ZFSet.sUnion (ZFSet.sUnion Maps), ZFSet.pair i S ∈ Maps ∧ ZFSet.pair x y ∈ S + +def liftFreshEntry (D L J B N Sources Fs Reps G A i x y : ZFSet.{u}) : Prop := + ∃ j ∈ J, ∃ q ∈ B, ∃ a ∈ D, ∃ F ∈ ZFSet.sUnion (ZFSet.sUnion Fs), + x = ZFSet.pair D (ZFSet.pair j q) ∧ ZFSet.pair j q ∈ N ∧ + ZFSet.pair i a ∈ Sources ∧ ZFSet.pair j F ∈ Fs ∧ + ((a ∈ F ∧ ∃ g ∈ G, ZFSet.pair i g ∈ Reps ∧ ZFSet.pair (ZFSet.pair g x) y ∈ A) ∨ + (a ∉ F ∧ y = ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q))) + +def liftedCompressionGraph (I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ x ∈ L, ∃ y ∈ C, + z = ZFSet.pair (ZFSet.pair i x) y ∧ + (liftOldEntry D Maps i x y ∨ liftFreshEntry D L J B N Sources Fs Reps G A i x y)) + (ZFSet.prod (ZFSet.prod I L) C) + +theorem pair_mem_liftedCompressionGraph (I J D L C N B Maps Sources Fs Reps G A i x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i x) y ∈ liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ↔ + i ∈ I ∧ x ∈ L ∧ y ∈ C ∧ + (liftOldEntry D Maps i x y ∨ liftFreshEntry D L J B N Sources Fs Reps G A i x y) := by + rw [liftedCompressionGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, i', hi, x', hx, y', hy, eq, entry⟩ + obtain ⟨ix, rfl⟩ := ZFSet.pair_inj.1 eq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ix + exact ⟨hi, hx, hy, entry⟩ + · rintro ⟨hi, hx, hy, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩, + i, hi, x, hx, y, hy, rfl, entry⟩ + +theorem liftFreshEntry_not_old {D L J B N Sources Fs Reps G A i x y : ZFSet.{u}} + (entry : liftFreshEntry D L J B N Sources Fs Reps G A i x y) : x ∉ D := by + obtain ⟨j, _, q, _, _, _, _, _, eq, _⟩ := entry + rw [eq] + exact pair_tag_not_mem D (ZFSet.pair j q) + +theorem liftOldEntry_iff {I D Maps i S x y : ZFSet.{u}} + (maps : FunctionGraphOn I Maps) (entry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : + liftOldEntry D Maps i x y ↔ ZFSet.pair x y ∈ S := by + constructor + · rintro ⟨_, T, _, iT, xy⟩ + exact maps.unique iT entry ▸ xy + · intro xy + exact ⟨hx, S, pair_second_mem_doubleUnion entry, entry, xy⟩ + +theorem liftedCompressionGraph_old_iff {I J D L C N B Maps Sources Fs Reps G A i S x y : ZFSet.{u}} + (maps : FunctionGraphOn I Maps) (entry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : + ZFSet.pair (ZFSet.pair i x) y ∈ liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ↔ + x ∈ L ∧ y ∈ C ∧ ZFSet.pair x y ∈ S := by + rw [pair_mem_liftedCompressionGraph] + constructor + · rintro ⟨_, hxL, hy, old | fresh⟩ + · exact ⟨hxL, hy, (liftOldEntry_iff maps entry hx).1 old⟩ + · exact False.elim (liftFreshEntry_not_old fresh hx) + · rintro ⟨hxL, hy, xy⟩ + exact ⟨maps.pair_source entry, hxL, hy, Or.inl ((liftOldEntry_iff maps entry hx).2 xy)⟩ + +theorem liftFreshEntry_iff {I D L J B N Sources Fs Reps G A i j q a F y : ZFSet.{u}} + (sources : FunctionGraphOn I Sources) (filters : FunctionGraphOn J Fs) + (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) + (hj : j ∈ J) (hq : q ∈ B) (ha : a ∈ D) (fresh : ZFSet.pair j q ∈ N) : + liftFreshEntry D L J B N Sources Fs Reps G A i (ZFSet.pair D (ZFSet.pair j q)) y ↔ + ((a ∈ F ∧ ∃ g ∈ G, ZFSet.pair i g ∈ Reps ∧ + ZFSet.pair (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) y ∈ A) ∨ + (a ∉ F ∧ y = ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q))) := by + constructor + · rintro ⟨j', _, q', _, a', _, F', _, eq, _, source', filter', output⟩ + have jq := ZFSet.pair_inj.1 (ZFSet.pair_inj.1 eq).2 + obtain ⟨rfl, rfl⟩ := jq + have aEq := sources.unique source' source + have FEq := filters.unique filter' filter + exact aEq ▸ FEq ▸ output + · intro output + exact ⟨j, hj, q, hq, a, ha, F, pair_second_mem_doubleUnion filter, + rfl, fresh, source, filter, output⟩ + +theorem liftedCompressionGraph_fresh_iff + {I J D L C N B Maps Sources Fs Reps G A i j q a F y : ZFSet.{u}} + (sources : FunctionGraphOn I Sources) (filters : FunctionGraphOn J Fs) + (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) + (hj : j ∈ J) (hq : q ∈ B) (ha : a ∈ D) (fresh : ZFSet.pair j q ∈ N) : + ZFSet.pair (ZFSet.pair i (ZFSet.pair D (ZFSet.pair j q))) y ∈ + liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A ↔ + ZFSet.pair D (ZFSet.pair j q) ∈ L ∧ y ∈ C ∧ + ((a ∈ F ∧ ∃ g ∈ G, ZFSet.pair i g ∈ Reps ∧ + ZFSet.pair (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) y ∈ A) ∨ + (a ∉ F ∧ y = ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q))) := by + rw [pair_mem_liftedCompressionGraph] + constructor + · rintro ⟨_, hx, hy, old | entry⟩ + · exact False.elim (pair_tag_not_mem D (ZFSet.pair j q) old.1) + · exact ⟨hx, hy, (liftFreshEntry_iff sources filters source filter hj hq ha fresh).1 entry⟩ + · rintro ⟨hx, hy, output⟩ + exact ⟨sources.pair_source source, hx, hy, + Or.inr ((liftFreshEntry_iff sources filters source filter hj hq ha fresh).2 output)⟩ + +theorem liftedCompressionGraph_function + {I J D L C N B Maps Sources Fs Reps G A : ZFSet.{u}} + (current : L = taggedExtension D N) (freshShape : N ⊆ ZFSet.prod J B) + (extension : L ⊆ C) (maps : FunctionGraphOn I Maps) + (valid : ∀ i S, ZFSet.pair i S ∈ Maps → ZFSet.IsFunc D L S) + (sources : ZFSet.IsFunc I D Sources) (filters : FunctionGraphOn J Fs) + (reps : ZFSet.IsFunc I G Reps) (action : ZFSet.IsFunc (ZFSet.prod G L) L A) + (negativeTargets : ∀ i ∈ I, ∀ j ∈ J, ∀ q ∈ B, ∀ a F, + ZFSet.pair j q ∈ N → ZFSet.pair i a ∈ Sources → ZFSet.pair j F ∈ Fs → + a ∉ F → ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q) ∈ C) : + ZFSet.IsFunc (ZFSet.prod I L) C + (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) := by + classical + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro p hp + obtain ⟨i, hi, x, hxL, rfl⟩ := ZFSet.mem_prod.1 hp + rcases mem_taggedExtension.1 (current ▸ hxL) with old | ⟨n, hn, rfl⟩ + · obtain ⟨S, mapEntry⟩ := maps.total hi + obtain ⟨y, entry, unique⟩ := (valid i S mapEntry).2 x old + have hy := (ZFSet.pair_mem_prod.1 ((valid i S mapEntry).1 entry)).2 + refine ⟨y, (liftedCompressionGraph_old_iff maps mapEntry old).2 ⟨hxL, extension hy, entry⟩, ?_⟩ + intro z hz + exact unique z ((liftedCompressionGraph_old_iff maps mapEntry old).1 hz).2.2 + · obtain ⟨j, hj, q, hq, rfl⟩ := ZFSet.mem_prod.1 (freshShape hn) + obtain ⟨a, source, _⟩ := sources.2 i hi + have ha := (ZFSet.pair_mem_prod.1 (sources.1 source)).2 + obtain ⟨F, filter⟩ := filters.total hj + have sourceFunc : FunctionGraphOn I Sources := ⟨D, sources⟩ + by_cases positive : a ∈ F + · obtain ⟨g, representative, _⟩ := reps.2 i hi + have hg := (ZFSet.pair_mem_prod.1 (reps.1 representative)).2 + obtain ⟨y, entry, unique⟩ := action.2 + (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) (ZFSet.pair_mem_prod.2 ⟨hg, hxL⟩) + have hy := (ZFSet.pair_mem_prod.1 (action.1 entry)).2 + refine ⟨y, (liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).2 + ⟨hxL, extension hy, Or.inl ⟨positive, g, hg, representative, entry⟩⟩, ?_⟩ + intro z hz + rcases ((liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).1 hz).2.2 + with ⟨_, g', _, representative', entry'⟩ | ⟨negative, _⟩ + · have equal : g' = g := (show FunctionGraphOn I Reps from ⟨G, reps⟩).unique representative' representative + exact unique z (equal ▸ entry') + · exact False.elim (negative positive) + · let y := ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q) + have hy : y ∈ C := negativeTargets i hi j hj q hq a F hn source filter positive + refine ⟨y, (liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).2 + ⟨hxL, hy, Or.inr ⟨positive, rfl⟩⟩, ?_⟩ + intro z hz + rcases ((liftedCompressionGraph_fresh_iff sourceFunc filters source filter hj hq ha hn).1 hz).2.2 + with ⟨positive', _⟩ | ⟨_, equal⟩ + · exact False.elim (positive positive') + · exact equal + +theorem indexedRelationSection_function {I L C R i : ZFSet.{u}} + (function : ZFSet.IsFunc (ZFSet.prod I L) C R) (hi : i ∈ I) : + ZFSet.IsFunc L C (indexedRelationSection L C R i) := by + refine ⟨indexedRelationSection_subset L C R i, ?_⟩ + intro x hx + obtain ⟨y, entry, unique⟩ := function.2 (ZFSet.pair i x) (ZFSet.pair_mem_prod.2 ⟨hi, hx⟩) + have hy := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + refine ⟨y, (pair_mem_indexedRelationSection L C R i x y).2 ⟨hx, hy, entry⟩, ?_⟩ + intro z hz + exact unique z ((pair_mem_indexedRelationSection L C R i x z).1 hz).2.2 + +theorem liftedCompressionSection_function + {I J D L C N B Maps Sources Fs Reps G A i : ZFSet.{u}} + (current : L = taggedExtension D N) (freshShape : N ⊆ ZFSet.prod J B) + (extension : L ⊆ C) (maps : FunctionGraphOn I Maps) + (valid : ∀ j S, ZFSet.pair j S ∈ Maps → ZFSet.IsFunc D L S) + (sources : ZFSet.IsFunc I D Sources) (filters : FunctionGraphOn J Fs) + (reps : ZFSet.IsFunc I G Reps) (action : ZFSet.IsFunc (ZFSet.prod G L) L A) + (negativeTargets : ∀ j ∈ I, ∀ k ∈ J, ∀ q ∈ B, ∀ a F, + ZFSet.pair k q ∈ N → ZFSet.pair j a ∈ Sources → ZFSet.pair k F ∈ Fs → + a ∉ F → ZFSet.pair L (ZFSet.pair (ZFSet.pair j k) q) ∈ C) + (hi : i ∈ I) : + ZFSet.IsFunc L C (indexedRelationSection L C + (liftedCompressionGraph I J D L C N B Maps Sources Fs Reps G A) i) := + indexedRelationSection_function + (liftedCompressionGraph_function current freshShape extension maps valid sources filters reps action negativeTargets) hi + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagramGluing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagramGluing.lean index 6d2142e2318dd60034a4e510243d413214193926..a27375b8dcb0921d89c7c4bde8aff20b5eb03652 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagramGluing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagramGluing.lean @@ -1,127 +1,127 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainOrdinalSteps - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -universe u - -namespace Transition - -def transport {s t s' t' : MainStage.{u}} (f : Transition s t) - (source : s = s') (target : t = t') : Transition s' t' := by - cases source - cases target - exact f - -theorem transport_twice {s t s' t' s'' t'' : MainStage.{u}} (f : Transition s t) - (hs : s = s') (ht : t = t') (hs' : s' = s'') (ht' : t' = t'') : - (f.transport hs ht).transport hs' ht' = f.transport (hs.trans hs') (ht.trans ht') := by - cases hs; cases ht; cases hs'; cases ht'; rfl - -theorem transport_comp {s t r s' t' r' : MainStage.{u}} - (f : Transition s t) (g : Transition t r) (hs : s = s') (ht : t = t') (hr : r = r') : - (f.comp g).transport hs hr = (f.transport hs ht).comp (g.transport ht hr) := by - cases hs; cases ht; cases hr; rfl - -theorem transport_injective {s t s' t' : MainStage.{u}} (hs : s = s') (ht : t = t') : - Function.Injective (fun f : Transition s t => f.transport hs ht) := by - cases hs; cases ht; exact Function.injective_id - -end Transition - -namespace Diagram -variable {I : Type u} [LinearOrder I] - -def restrictLE {i j : I} (d : Diagram (Set.Iic j)) (h : i ≤ j) : Diagram (Set.Iic i) := - d.reindex (fun k => ⟨k.val, le_trans k.property h⟩) (fun _ _ h => h) - -theorem restrictLE_self {i : I} (d : Diagram (Set.Iic i)) : d.restrictLE (le_refl i) = d := rfl - -theorem restrictLE_comp {i j k : I} (d : Diagram (Set.Iic k)) (hij : i ≤ j) (hjk : j ≤ k) : - (d.restrictLE hjk).restrictLE hij = d.restrictLE (le_trans hij hjk) := rfl - -theorem transition_of_eq (d e : Diagram I) (eq : d = e) {i j : I} (h : i ≤ j) : - (d.transition h).transport (congrArg (fun d => d.stage i) eq) - (congrArg (fun d => d.stage j) eq) = e.transition h := by cases eq; rfl - -theorem ext_of_transport (d e : Diagram I) (stages : ∀ i, d.stage i = e.stage i) - (transitions : ∀ {i j} (h : i ≤ j), - (d.transition h).transport (stages i) (stages j) = e.transition h) : d = e := by - rcases d with ⟨ds, dt, di, dc⟩ - rcases e with ⟨es, et, ei, ec⟩ - have eq : ds = es := funext stages - cases eq - have teq : @dt = @et := by - funext i j h - exact transitions h - cases teq - rfl - -variable (f : ∀ i : I, Diagram (Set.Iic i)) - -def Compatible : Prop := ∀ {i j} (h : i ≤ j), (f j).restrictLE h = f i - -namespace Compatible -variable {f} (compatible : Compatible f) - -def stage (i : I) : MainStage.{u} := (f i).stage ⟨i, le_refl i⟩ - -include compatible in -theorem stage_at {i j : I} (h : i ≤ j) : - stage (f := f) i = (f j).stage ⟨i, h⟩ := - congrArg (fun d => d.stage ⟨i, le_refl i⟩) (compatible h).symm - -def transition {i j : I} (h : i ≤ j) : Transition (stage (f := f) i) (stage (f := f) j) := - ((f j).transition (i := ⟨i, h⟩) (j := ⟨j, le_refl j⟩) h).transport - (compatible.stage_at h).symm rfl - -theorem transition_at {i j k : I} (hij : i ≤ j) (hjk : j ≤ k) : - (compatible.transition hij).transport (compatible.stage_at (le_trans hij hjk)) - (compatible.stage_at hjk) = - (f k).transition (i := ⟨i, le_trans hij hjk⟩) (j := ⟨j, hjk⟩) hij := by - unfold transition - erw [Transition.transport_twice] - exact transition_of_eq (f j) ((f k).restrictLE hjk) (compatible hjk).symm - (i := ⟨i, hij⟩) (j := ⟨j, le_refl j⟩) hij - -theorem transition_self (i : I) : - compatible.transition (le_refl i) = Transition.identity (stage (f := f) i) := by - change (f i).transition (le_refl (⟨i, le_refl i⟩ : Set.Iic i)) = _ - exact (f i).self _ - -theorem transition_comp {i j k : I} (hij : i ≤ j) (hjk : j ≤ k) : - compatible.transition (le_trans hij hjk) = - (compatible.transition hij).comp (compatible.transition hjk) := by - apply Transition.transport_injective (compatible.stage_at (le_trans hij hjk)) - (compatible.stage_at (le_refl k)) - dsimp only - rw [Transition.transport_comp _ _ _ (compatible.stage_at hjk), - compatible.transition_at hij hjk, compatible.transition_at hjk (le_refl k), - compatible.transition_at (le_trans hij hjk) (le_refl k)] - exact (f k).comp (i := ⟨i, le_trans hij hjk⟩) (j := ⟨j, hjk⟩) - (k := ⟨k, le_refl k⟩) hij hjk - -def glue : Diagram I where - stage := stage (f := f) - transition := compatible.transition - self := compatible.transition_self - comp := compatible.transition_comp - -theorem glue_restrict (i : I) : - compatible.glue.reindex (fun j : Set.Iic i => j.val) (fun _ _ h => h) = f i := by - apply ext_of_transport _ _ (fun j => compatible.stage_at j.property) - intro j k h - exact compatible.transition_at h k.property - -end Compatible - -end Diagram - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainOrdinalSteps + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +universe u + +namespace Transition + +def transport {s t s' t' : MainStage.{u}} (f : Transition s t) + (source : s = s') (target : t = t') : Transition s' t' := by + cases source + cases target + exact f + +theorem transport_twice {s t s' t' s'' t'' : MainStage.{u}} (f : Transition s t) + (hs : s = s') (ht : t = t') (hs' : s' = s'') (ht' : t' = t'') : + (f.transport hs ht).transport hs' ht' = f.transport (hs.trans hs') (ht.trans ht') := by + cases hs; cases ht; cases hs'; cases ht'; rfl + +theorem transport_comp {s t r s' t' r' : MainStage.{u}} + (f : Transition s t) (g : Transition t r) (hs : s = s') (ht : t = t') (hr : r = r') : + (f.comp g).transport hs hr = (f.transport hs ht).comp (g.transport ht hr) := by + cases hs; cases ht; cases hr; rfl + +theorem transport_injective {s t s' t' : MainStage.{u}} (hs : s = s') (ht : t = t') : + Function.Injective (fun f : Transition s t => f.transport hs ht) := by + cases hs; cases ht; exact Function.injective_id + +end Transition + +namespace Diagram +variable {I : Type u} [LinearOrder I] + +def restrictLE {i j : I} (d : Diagram (Set.Iic j)) (h : i ≤ j) : Diagram (Set.Iic i) := + d.reindex (fun k => ⟨k.val, le_trans k.property h⟩) (fun _ _ h => h) + +theorem restrictLE_self {i : I} (d : Diagram (Set.Iic i)) : d.restrictLE (le_refl i) = d := rfl + +theorem restrictLE_comp {i j k : I} (d : Diagram (Set.Iic k)) (hij : i ≤ j) (hjk : j ≤ k) : + (d.restrictLE hjk).restrictLE hij = d.restrictLE (le_trans hij hjk) := rfl + +theorem transition_of_eq (d e : Diagram I) (eq : d = e) {i j : I} (h : i ≤ j) : + (d.transition h).transport (congrArg (fun d => d.stage i) eq) + (congrArg (fun d => d.stage j) eq) = e.transition h := by cases eq; rfl + +theorem ext_of_transport (d e : Diagram I) (stages : ∀ i, d.stage i = e.stage i) + (transitions : ∀ {i j} (h : i ≤ j), + (d.transition h).transport (stages i) (stages j) = e.transition h) : d = e := by + rcases d with ⟨ds, dt, di, dc⟩ + rcases e with ⟨es, et, ei, ec⟩ + have eq : ds = es := funext stages + cases eq + have teq : @dt = @et := by + funext i j h + exact transitions h + cases teq + rfl + +variable (f : ∀ i : I, Diagram (Set.Iic i)) + +def Compatible : Prop := ∀ {i j} (h : i ≤ j), (f j).restrictLE h = f i + +namespace Compatible +variable {f} (compatible : Compatible f) + +def stage (i : I) : MainStage.{u} := (f i).stage ⟨i, le_refl i⟩ + +include compatible in +theorem stage_at {i j : I} (h : i ≤ j) : + stage (f := f) i = (f j).stage ⟨i, h⟩ := + congrArg (fun d => d.stage ⟨i, le_refl i⟩) (compatible h).symm + +def transition {i j : I} (h : i ≤ j) : Transition (stage (f := f) i) (stage (f := f) j) := + ((f j).transition (i := ⟨i, h⟩) (j := ⟨j, le_refl j⟩) h).transport + (compatible.stage_at h).symm rfl + +theorem transition_at {i j k : I} (hij : i ≤ j) (hjk : j ≤ k) : + (compatible.transition hij).transport (compatible.stage_at (le_trans hij hjk)) + (compatible.stage_at hjk) = + (f k).transition (i := ⟨i, le_trans hij hjk⟩) (j := ⟨j, hjk⟩) hij := by + unfold transition + erw [Transition.transport_twice] + exact transition_of_eq (f j) ((f k).restrictLE hjk) (compatible hjk).symm + (i := ⟨i, hij⟩) (j := ⟨j, le_refl j⟩) hij + +theorem transition_self (i : I) : + compatible.transition (le_refl i) = Transition.identity (stage (f := f) i) := by + change (f i).transition (le_refl (⟨i, le_refl i⟩ : Set.Iic i)) = _ + exact (f i).self _ + +theorem transition_comp {i j k : I} (hij : i ≤ j) (hjk : j ≤ k) : + compatible.transition (le_trans hij hjk) = + (compatible.transition hij).comp (compatible.transition hjk) := by + apply Transition.transport_injective (compatible.stage_at (le_trans hij hjk)) + (compatible.stage_at (le_refl k)) + dsimp only + rw [Transition.transport_comp _ _ _ (compatible.stage_at hjk), + compatible.transition_at hij hjk, compatible.transition_at hjk (le_refl k), + compatible.transition_at (le_trans hij hjk) (le_refl k)] + exact (f k).comp (i := ⟨i, le_trans hij hjk⟩) (j := ⟨j, hjk⟩) + (k := ⟨k, le_refl k⟩) hij hjk + +def glue : Diagram I where + stage := stage (f := f) + transition := compatible.transition + self := compatible.transition_self + comp := compatible.transition_comp + +theorem glue_restrict (i : I) : + compatible.glue.reindex (fun j : Set.Iic i => j.val) (fun _ _ h => h) = f i := by + apply ext_of_transport _ _ (fun j => compatible.stage_at j.property) + intro j k h + exact compatible.transition_at h k.property + +end Compatible + +end Diagram + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagrams.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagrams.lean index 23f1fd3a38ae24b7c25eba42136249a6bc8653f3..33c2d98ffbd3c8c81ff617053f5834b8f7e827c4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagrams.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainDiagrams.lean @@ -1,320 +1,320 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.AgreementLimits - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun - -universe u -variable (Label : Type u) - -noncomputable def stage : Nat → MainStage.{u} - | 0 => initial - | n + 1 => (stage n).next Label - -noncomputable def step (n : Nat) : Transition (stage Label n) (stage Label (n + 1)) := - (stage Label n).nextTransition Label - -noncomputable def transition {n m : Nat} (lower : n ≤ m) : Transition (stage Label n) (stage Label m) := - Nat.leRecOn lower (fun {k} e => e.comp (step Label k)) (Transition.identity (stage Label n)) - -theorem transition_self (n : Nat) : - transition Label (Nat.le_refl n) = Transition.identity (stage Label n) := Nat.leRecOn_self _ - -theorem transition_step {n m : Nat} (lower : n ≤ m) : - transition Label (Nat.le_succ_of_le lower) = (transition Label lower).comp (step Label m) := - Nat.leRecOn_succ lower _ - -theorem points_comp {n m k : Nat} (hnm : n ≤ m) (hmk : m ≤ k) (x : (stage Label n).Point) : - (transition Label (Nat.le_trans hnm hmk)).points.toFun x = - (transition Label hmk).points.toFun ((transition Label hnm).points.toFun x) := by - induction hmk with - | refl => - rw [transition_self] - rfl - | @step k hmk ih => - rw [transition_step Label (Nat.le_trans hnm hmk), transition_step Label hmk] - change (step Label k).points.toFun _ = (step Label k).points.toFun _ - exact congrArg (step Label k).points.toFun ih - -theorem actors_comp {n m k : Nat} (hnm : n ≤ m) (hmk : m ≤ k) (x : (stage Label n).Actor) : - (transition Label (Nat.le_trans hnm hmk)).actors x = - (transition Label hmk).actors ((transition Label hnm).actors x) := by - induction hmk with - | refl => - rw [transition_self] - rfl - | @step k hmk ih => - rw [transition_step Label (Nat.le_trans hnm hmk), transition_step Label hmk] - change (step Label k).actors _ = (step Label k).actors _ - exact congrArg (step Label k).actors ih - -abbrev Index := ULift.{u} Nat - -noncomputable def orders : MeetSystem Index.{u} where - system := { - Point := fun i => (stage Label i.down).Point - map := fun lower => (transition Label lower).points.toFun - map_self := by - intro i x - rw [transition_self] - rfl - map_comp := points_comp Label - injective := fun lower _ _ eq => embedding_injective (transition Label lower).points eq } - order i := (stage Label i.down).order - map_le lower := (transition Label lower).points.le_iff - map_meet lower := (transition Label lower).points.map_meet - -noncomputable def groups : GroupSystem Index.{u} where - system := { - Point := fun i => (stage Label i.down).Actor - map := fun lower => (transition Label lower).actors - map_self := by - intro i x - rw [transition_self] - rfl - map_comp := actors_comp Label - injective := fun lower => (transition Label lower).actors_injective } - group i := (stage Label i.down).group - map_one lower := (transition Label lower).actors.map_one - map_mul lower := (transition Label lower).actors.map_mul - -noncomputable def actions : ActionSystem (groups Label) (orders Label) where - action i := (stage Label i.down).action - compatible lower g x := ((transition Label lower).equivariant g x).symm - -noncomputable def heights : (orders Label).Heights - (RationalHeights.lexOrder CountableColumns.order).toHeightOrder where - height i := (stage Label i.down).height - coherent lower := (transition Label lower).height - -theorem agreements : (actions Label).PreservesAgreements := - fun lower => (transition Label lower).agreement - -theorem step_strict_top (n : Nat) (x : (stage Label n).Point) : - ¬ (stage Label (n + 1)).order.le (stage Label (n + 1)).top ((step Label n).points.toFun x) := - (stage Label n).next_strict_top Label x - -end PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun - - - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun - -open RationalHeights -universe u -variable (Label : Type u) - -noncomputable def omegaHeight : StrictHeight (orders Label).boundedOrder - (lexOrder CountableColumns.order).toHeightOrder := - (heights Label).limitHeight (fun i => ((stage Label i.down).height.value (stage Label i.down).top).1) - ((heights Label).stage_bound_from_top (fun i => (stage Label i.down).top) - (fun i => (stage Label i.down).greatest)) - -theorem omegaHeight_stage (i : Index.{u}) (x : (stage Label i.down).Point) : - (omegaHeight Label).value (((orders Label).boundedInclusion i).toFun x) = - (stage Label i.down).height.value x := rfl - -theorem omegaHeight_countable : CountableRange (omegaHeight Label).value := - (heights Label).limitHeight_countable _ _ (fun i => (stage Label i.down).countable_height) - -theorem union_bottom_at (i : Index.{u}) : - (orders Label).system.point i (stage Label i.down).bottom = - (orders Label).system.point ⟨0⟩ (stage Label 0).bottom := by - have eq := (transition Label (Nat.zero_le i.down)).bottom - have raised := congrArg ((orders Label).system.point i) eq - exact raised.symm.trans ((orders Label).system.point_map (i := ⟨0⟩) (j := i) - (Nat.zero_le i.down) (stage Label 0).bottom) - -theorem union_bottom_least (x : (orders Label).system.Union) : - (orders Label).unionOrder.le - ((orders Label).system.point ⟨0⟩ (stage Label 0).bottom) x := by - rcases (orders Label).system.cover x with ⟨i, x, rfl⟩ - rw [← union_bottom_at Label i] - exact ((orders Label).le_stage i _ x).mpr ((stage Label i.down).least x) - -noncomputable def omega : MainStage.{u} where - Point := Option (orders Label).system.Union - order := (orders Label).boundedOrder - Actor := (groups Label).system.Union - action := (actions Label).topAction - bottom := some ((orders Label).system.point ⟨0⟩ (stage Label 0).bottom) - least x := by - cases x with - | none => exact True.intro - | some x => exact union_bottom_least Label x - top := none - greatest := FixedTop.greatest (orders Label).unionOrder - height := omegaHeight Label - countable_height := omegaHeight_countable Label - -noncomputable def omegaTransition (n : Nat) : Transition (stage Label n) (omega Label) where - points := (orders Label).boundedInclusion ⟨n⟩ - actors := (groups Label).inclusion ⟨n⟩ - actors_injective := (groups Label).inclusion_injective ⟨n⟩ - equivariant := (actions Label).topAction_stage ⟨n⟩ - bottom := congrArg some (union_bottom_at Label ⟨n⟩) - height := omegaHeight_stage Label ⟨n⟩ - agreement := (actions Label).top_agreement (agreements Label) ⟨n⟩ - -theorem omega_points_coherent {n m : Nat} (lower : n ≤ m) (x : (stage Label n).Point) : - (omegaTransition Label m).points.toFun ((transition Label lower).points.toFun x) = - (omegaTransition Label n).points.toFun x := - congrArg some ((orders Label).system.point_map (i := ⟨n⟩) (j := ⟨m⟩) lower x) - -theorem omega_actors_coherent {n m : Nat} (lower : n ≤ m) (g : (stage Label n).Actor) : - (omegaTransition Label m).actors ((transition Label lower).actors g) = - (omegaTransition Label n).actors g := - (groups Label).system.point_map (i := ⟨n⟩) (j := ⟨m⟩) lower g - -theorem omega_strict_top (n : Nat) (x : (stage Label n).Point) : - ¬ (omega Label).order.le (omega Label).top ((omegaTransition Label n).points.toFun x) := - ((orders Label).bounded_strict_top ⟨n⟩ x).2 - -theorem omega_point_cover (x : (omega Label).Point) : - x = (omega Label).top ∨ ∃ n y, (omegaTransition Label n).points.toFun y = x := by - cases x with - | none => exact Or.inl rfl - | some x => - rcases (orders Label).system.cover x with ⟨i, y, rfl⟩ - exact Or.inr ⟨i.down, y, rfl⟩ - -theorem omega_actor_cover (g : (omega Label).Actor) : - ∃ n h, (omegaTransition Label n).actors h = g := by - rcases (groups Label).system.cover g with ⟨i, h, rfl⟩ - exact ⟨i.down, h, rfl⟩ - -noncomputable def countableOrdinalLabelsOmega : MainStage.{1} := omega CountableColumns.Column - -end PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun - - - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -universe u - -namespace Transition - -theorem ext {s t : MainStage.{u}} (f g : Transition s t) - (points : ∀ x, f.points.toFun x = g.points.toFun x) - (actors : ∀ x, f.actors x = g.actors x) : f = g := by - have embedding_ext (p q : MeetEmbedding s.order t.order) - (h : ∀ x, p.toFun x = q.toFun x) : p = q := by - cases p - cases q - congr - exact funext h - have ep : f.points = g.points := embedding_ext _ _ points - have eg : f.actors = g.actors := MonoidHom.ext actors - cases f - cases g - cases ep - cases eg - rfl - -theorem identity_comp {s t : MainStage.{u}} (f : Transition s t) : - (identity s).comp f = f := ext _ _ (fun _ => rfl) (fun _ => rfl) - -theorem comp_identity {s t : MainStage.{u}} (f : Transition s t) : - f.comp (identity t) = f := ext _ _ (fun _ => rfl) (fun _ => rfl) - -theorem comp_assoc {s t r q : MainStage.{u}} - (f : Transition s t) (g : Transition t r) (h : Transition r q) : - (f.comp g).comp h = f.comp (g.comp h) := ext _ _ (fun _ => rfl) (fun _ => rfl) - -end Transition - -structure Diagram (I : Type u) [LinearOrder I] where - stage : I → MainStage.{u} - transition : ∀ {i j}, i ≤ j → Transition (stage i) (stage j) - self : ∀ i, transition (le_refl i) = Transition.identity (stage i) - comp : ∀ {i j k} (hij : i ≤ j) (hjk : j ≤ k), - transition (le_trans hij hjk) = (transition hij).comp (transition hjk) - -namespace Diagram -variable {I : Type u} [LinearOrder I] (d : Diagram I) - -def reindex {J : Type u} [LinearOrder J] (f : J → I) (mono : Monotone f) : Diagram J where - stage i := d.stage (f i) - transition h := d.transition (mono h) - self i := d.self (f i) - comp hij hjk := d.comp (mono hij) (mono hjk) - -def constant (s : MainStage.{u}) : Diagram I where - stage _ := s - transition _ := Transition.identity s - self _ := rfl - comp _ _ := (Transition.identity_comp _).symm - -def orders : MeetSystem I where - system := { - Point := fun i => (d.stage i).Point - map := fun lower => (d.transition lower).points.toFun - map_self := by intro i x; rw [d.self]; rfl - map_comp := by - intro i j k hij hjk x - rw [d.comp hij hjk] - rfl - injective := fun h _ _ eq => embedding_injective (d.transition h).points eq } - order i := (d.stage i).order - map_le h := (d.transition h).points.le_iff - map_meet h := (d.transition h).points.map_meet - -def groups : GroupSystem I where - system := { - Point := fun i => (d.stage i).Actor - map := fun lower => (d.transition lower).actors - map_self := by intro i x; rw [d.self]; rfl - map_comp := by - intro i j k hij hjk x - rw [d.comp hij hjk] - rfl - injective := fun h => (d.transition h).actors_injective } - group i := (d.stage i).group - map_one h := (d.transition h).actors.map_one - map_mul h := (d.transition h).actors.map_mul - -def actions : ActionSystem d.groups d.orders where - action i := (d.stage i).action - compatible h g x := ((d.transition h).equivariant g x).symm - -def heights : d.orders.Heights - (RationalHeights.lexOrder CountableColumns.order).toHeightOrder where - height i := (d.stage i).height - coherent h := (d.transition h).height - -theorem agreements [Nonempty I] : d.actions.PreservesAgreements := - fun h => (d.transition h).agreement - -structure Cone where - apex : MainStage.{u} - leg : ∀ i, Transition (d.stage i) apex - coherent : ∀ {i j} (h : i ≤ j), (d.transition h).comp (leg j) = leg i - -def Cone.extend (c : d.Cone) {s : MainStage.{u}} (e : Transition c.apex s) : d.Cone where - apex := s - leg i := (c.leg i).comp e - coherent h := by rw [← Transition.comp_assoc, c.coherent h] - -def Cone.reindex (c : d.Cone) {J : Type u} [LinearOrder J] - (f : J → I) (mono : Monotone f) : (d.reindex f mono).Cone where - apex := c.apex - leg i := c.leg (f i) - coherent h := c.coherent (mono h) - -end Diagram - -noncomputable def FiniteRun.diagram (Label : Type u) : Diagram FiniteRun.Index.{u} where - stage i := FiniteRun.stage Label i.down - transition h := FiniteRun.transition Label h - self i := FiniteRun.transition_self Label i.down - comp hij hjk := Transition.ext _ _ - (FiniteRun.points_comp Label hij hjk) (FiniteRun.actors_comp Label hij hjk) - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.AgreementLimits + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun + +universe u +variable (Label : Type u) + +noncomputable def stage : Nat → MainStage.{u} + | 0 => initial + | n + 1 => (stage n).next Label + +noncomputable def step (n : Nat) : Transition (stage Label n) (stage Label (n + 1)) := + (stage Label n).nextTransition Label + +noncomputable def transition {n m : Nat} (lower : n ≤ m) : Transition (stage Label n) (stage Label m) := + Nat.leRecOn lower (fun {k} e => e.comp (step Label k)) (Transition.identity (stage Label n)) + +theorem transition_self (n : Nat) : + transition Label (Nat.le_refl n) = Transition.identity (stage Label n) := Nat.leRecOn_self _ + +theorem transition_step {n m : Nat} (lower : n ≤ m) : + transition Label (Nat.le_succ_of_le lower) = (transition Label lower).comp (step Label m) := + Nat.leRecOn_succ lower _ + +theorem points_comp {n m k : Nat} (hnm : n ≤ m) (hmk : m ≤ k) (x : (stage Label n).Point) : + (transition Label (Nat.le_trans hnm hmk)).points.toFun x = + (transition Label hmk).points.toFun ((transition Label hnm).points.toFun x) := by + induction hmk with + | refl => + rw [transition_self] + rfl + | @step k hmk ih => + rw [transition_step Label (Nat.le_trans hnm hmk), transition_step Label hmk] + change (step Label k).points.toFun _ = (step Label k).points.toFun _ + exact congrArg (step Label k).points.toFun ih + +theorem actors_comp {n m k : Nat} (hnm : n ≤ m) (hmk : m ≤ k) (x : (stage Label n).Actor) : + (transition Label (Nat.le_trans hnm hmk)).actors x = + (transition Label hmk).actors ((transition Label hnm).actors x) := by + induction hmk with + | refl => + rw [transition_self] + rfl + | @step k hmk ih => + rw [transition_step Label (Nat.le_trans hnm hmk), transition_step Label hmk] + change (step Label k).actors _ = (step Label k).actors _ + exact congrArg (step Label k).actors ih + +abbrev Index := ULift.{u} Nat + +noncomputable def orders : MeetSystem Index.{u} where + system := { + Point := fun i => (stage Label i.down).Point + map := fun lower => (transition Label lower).points.toFun + map_self := by + intro i x + rw [transition_self] + rfl + map_comp := points_comp Label + injective := fun lower _ _ eq => embedding_injective (transition Label lower).points eq } + order i := (stage Label i.down).order + map_le lower := (transition Label lower).points.le_iff + map_meet lower := (transition Label lower).points.map_meet + +noncomputable def groups : GroupSystem Index.{u} where + system := { + Point := fun i => (stage Label i.down).Actor + map := fun lower => (transition Label lower).actors + map_self := by + intro i x + rw [transition_self] + rfl + map_comp := actors_comp Label + injective := fun lower => (transition Label lower).actors_injective } + group i := (stage Label i.down).group + map_one lower := (transition Label lower).actors.map_one + map_mul lower := (transition Label lower).actors.map_mul + +noncomputable def actions : ActionSystem (groups Label) (orders Label) where + action i := (stage Label i.down).action + compatible lower g x := ((transition Label lower).equivariant g x).symm + +noncomputable def heights : (orders Label).Heights + (RationalHeights.lexOrder CountableColumns.order).toHeightOrder where + height i := (stage Label i.down).height + coherent lower := (transition Label lower).height + +theorem agreements : (actions Label).PreservesAgreements := + fun lower => (transition Label lower).agreement + +theorem step_strict_top (n : Nat) (x : (stage Label n).Point) : + ¬ (stage Label (n + 1)).order.le (stage Label (n + 1)).top ((step Label n).points.toFun x) := + (stage Label n).next_strict_top Label x + +end PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun + + + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun + +open RationalHeights +universe u +variable (Label : Type u) + +noncomputable def omegaHeight : StrictHeight (orders Label).boundedOrder + (lexOrder CountableColumns.order).toHeightOrder := + (heights Label).limitHeight (fun i => ((stage Label i.down).height.value (stage Label i.down).top).1) + ((heights Label).stage_bound_from_top (fun i => (stage Label i.down).top) + (fun i => (stage Label i.down).greatest)) + +theorem omegaHeight_stage (i : Index.{u}) (x : (stage Label i.down).Point) : + (omegaHeight Label).value (((orders Label).boundedInclusion i).toFun x) = + (stage Label i.down).height.value x := rfl + +theorem omegaHeight_countable : CountableRange (omegaHeight Label).value := + (heights Label).limitHeight_countable _ _ (fun i => (stage Label i.down).countable_height) + +theorem union_bottom_at (i : Index.{u}) : + (orders Label).system.point i (stage Label i.down).bottom = + (orders Label).system.point ⟨0⟩ (stage Label 0).bottom := by + have eq := (transition Label (Nat.zero_le i.down)).bottom + have raised := congrArg ((orders Label).system.point i) eq + exact raised.symm.trans ((orders Label).system.point_map (i := ⟨0⟩) (j := i) + (Nat.zero_le i.down) (stage Label 0).bottom) + +theorem union_bottom_least (x : (orders Label).system.Union) : + (orders Label).unionOrder.le + ((orders Label).system.point ⟨0⟩ (stage Label 0).bottom) x := by + rcases (orders Label).system.cover x with ⟨i, x, rfl⟩ + rw [← union_bottom_at Label i] + exact ((orders Label).le_stage i _ x).mpr ((stage Label i.down).least x) + +noncomputable def omega : MainStage.{u} where + Point := Option (orders Label).system.Union + order := (orders Label).boundedOrder + Actor := (groups Label).system.Union + action := (actions Label).topAction + bottom := some ((orders Label).system.point ⟨0⟩ (stage Label 0).bottom) + least x := by + cases x with + | none => exact True.intro + | some x => exact union_bottom_least Label x + top := none + greatest := FixedTop.greatest (orders Label).unionOrder + height := omegaHeight Label + countable_height := omegaHeight_countable Label + +noncomputable def omegaTransition (n : Nat) : Transition (stage Label n) (omega Label) where + points := (orders Label).boundedInclusion ⟨n⟩ + actors := (groups Label).inclusion ⟨n⟩ + actors_injective := (groups Label).inclusion_injective ⟨n⟩ + equivariant := (actions Label).topAction_stage ⟨n⟩ + bottom := congrArg some (union_bottom_at Label ⟨n⟩) + height := omegaHeight_stage Label ⟨n⟩ + agreement := (actions Label).top_agreement (agreements Label) ⟨n⟩ + +theorem omega_points_coherent {n m : Nat} (lower : n ≤ m) (x : (stage Label n).Point) : + (omegaTransition Label m).points.toFun ((transition Label lower).points.toFun x) = + (omegaTransition Label n).points.toFun x := + congrArg some ((orders Label).system.point_map (i := ⟨n⟩) (j := ⟨m⟩) lower x) + +theorem omega_actors_coherent {n m : Nat} (lower : n ≤ m) (g : (stage Label n).Actor) : + (omegaTransition Label m).actors ((transition Label lower).actors g) = + (omegaTransition Label n).actors g := + (groups Label).system.point_map (i := ⟨n⟩) (j := ⟨m⟩) lower g + +theorem omega_strict_top (n : Nat) (x : (stage Label n).Point) : + ¬ (omega Label).order.le (omega Label).top ((omegaTransition Label n).points.toFun x) := + ((orders Label).bounded_strict_top ⟨n⟩ x).2 + +theorem omega_point_cover (x : (omega Label).Point) : + x = (omega Label).top ∨ ∃ n y, (omegaTransition Label n).points.toFun y = x := by + cases x with + | none => exact Or.inl rfl + | some x => + rcases (orders Label).system.cover x with ⟨i, y, rfl⟩ + exact Or.inr ⟨i.down, y, rfl⟩ + +theorem omega_actor_cover (g : (omega Label).Actor) : + ∃ n h, (omegaTransition Label n).actors h = g := by + rcases (groups Label).system.cover g with ⟨i, h, rfl⟩ + exact ⟨i.down, h, rfl⟩ + +noncomputable def countableOrdinalLabelsOmega : MainStage.{1} := omega CountableColumns.Column + +end PartitionPilot.Compression.RecursiveMaps.MainStage.FiniteRun + + + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +universe u + +namespace Transition + +theorem ext {s t : MainStage.{u}} (f g : Transition s t) + (points : ∀ x, f.points.toFun x = g.points.toFun x) + (actors : ∀ x, f.actors x = g.actors x) : f = g := by + have embedding_ext (p q : MeetEmbedding s.order t.order) + (h : ∀ x, p.toFun x = q.toFun x) : p = q := by + cases p + cases q + congr + exact funext h + have ep : f.points = g.points := embedding_ext _ _ points + have eg : f.actors = g.actors := MonoidHom.ext actors + cases f + cases g + cases ep + cases eg + rfl + +theorem identity_comp {s t : MainStage.{u}} (f : Transition s t) : + (identity s).comp f = f := ext _ _ (fun _ => rfl) (fun _ => rfl) + +theorem comp_identity {s t : MainStage.{u}} (f : Transition s t) : + f.comp (identity t) = f := ext _ _ (fun _ => rfl) (fun _ => rfl) + +theorem comp_assoc {s t r q : MainStage.{u}} + (f : Transition s t) (g : Transition t r) (h : Transition r q) : + (f.comp g).comp h = f.comp (g.comp h) := ext _ _ (fun _ => rfl) (fun _ => rfl) + +end Transition + +structure Diagram (I : Type u) [LinearOrder I] where + stage : I → MainStage.{u} + transition : ∀ {i j}, i ≤ j → Transition (stage i) (stage j) + self : ∀ i, transition (le_refl i) = Transition.identity (stage i) + comp : ∀ {i j k} (hij : i ≤ j) (hjk : j ≤ k), + transition (le_trans hij hjk) = (transition hij).comp (transition hjk) + +namespace Diagram +variable {I : Type u} [LinearOrder I] (d : Diagram I) + +def reindex {J : Type u} [LinearOrder J] (f : J → I) (mono : Monotone f) : Diagram J where + stage i := d.stage (f i) + transition h := d.transition (mono h) + self i := d.self (f i) + comp hij hjk := d.comp (mono hij) (mono hjk) + +def constant (s : MainStage.{u}) : Diagram I where + stage _ := s + transition _ := Transition.identity s + self _ := rfl + comp _ _ := (Transition.identity_comp _).symm + +def orders : MeetSystem I where + system := { + Point := fun i => (d.stage i).Point + map := fun lower => (d.transition lower).points.toFun + map_self := by intro i x; rw [d.self]; rfl + map_comp := by + intro i j k hij hjk x + rw [d.comp hij hjk] + rfl + injective := fun h _ _ eq => embedding_injective (d.transition h).points eq } + order i := (d.stage i).order + map_le h := (d.transition h).points.le_iff + map_meet h := (d.transition h).points.map_meet + +def groups : GroupSystem I where + system := { + Point := fun i => (d.stage i).Actor + map := fun lower => (d.transition lower).actors + map_self := by intro i x; rw [d.self]; rfl + map_comp := by + intro i j k hij hjk x + rw [d.comp hij hjk] + rfl + injective := fun h => (d.transition h).actors_injective } + group i := (d.stage i).group + map_one h := (d.transition h).actors.map_one + map_mul h := (d.transition h).actors.map_mul + +def actions : ActionSystem d.groups d.orders where + action i := (d.stage i).action + compatible h g x := ((d.transition h).equivariant g x).symm + +def heights : d.orders.Heights + (RationalHeights.lexOrder CountableColumns.order).toHeightOrder where + height i := (d.stage i).height + coherent h := (d.transition h).height + +theorem agreements [Nonempty I] : d.actions.PreservesAgreements := + fun h => (d.transition h).agreement + +structure Cone where + apex : MainStage.{u} + leg : ∀ i, Transition (d.stage i) apex + coherent : ∀ {i j} (h : i ≤ j), (d.transition h).comp (leg j) = leg i + +def Cone.extend (c : d.Cone) {s : MainStage.{u}} (e : Transition c.apex s) : d.Cone where + apex := s + leg i := (c.leg i).comp e + coherent h := by rw [← Transition.comp_assoc, c.coherent h] + +def Cone.reindex (c : d.Cone) {J : Type u} [LinearOrder J] + (f : J → I) (mono : Monotone f) : (d.reindex f mono).Cone where + apex := c.apex + leg i := c.leg (f i) + coherent h := c.coherent (mono h) + +end Diagram + +noncomputable def FiniteRun.diagram (Label : Type u) : Diagram FiniteRun.Index.{u} where + stage i := FiniteRun.stage Label i.down + transition h := FiniteRun.transition Label h + self i := FiniteRun.transition_self Label i.down + comp hij hjk := Transition.ext _ _ + (FiniteRun.points_comp Label hij hjk) (FiniteRun.actors_comp Label hij hjk) + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainEndpoints.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainEndpoints.lean index d77151a5b1df53eb7395ab249f302bd1bbec7379..45702d77756ad6a38f4b1a15babc873c12c21e46 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainEndpoints.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainEndpoints.lean @@ -1,137 +1,137 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.LimitProfilePersistence - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram - -universe u -variable {I : Type u} [LinearOrder I] - -theorem ext (d e : Diagram I) (stages : d.stage = e.stage) - (transitions : HEq (@d.transition) (@e.transition)) : d = e := by - cases d - cases e - cases stages - cases eq_of_heq transitions - rfl - -theorem reindex_comp (d : Diagram I) {J K : Type u} [LinearOrder J] [LinearOrder K] - (f : J → I) (hf : Monotone f) (g : K → J) (hg : Monotone g) : - (d.reindex f hf).reindex g hg = d.reindex (fun i => f (g i)) (hf.comp hg) := rfl - -theorem reindex_congr (d : Diagram I) {J : Type u} [LinearOrder J] - (f g : J → I) (hf : Monotone f) (hg : Monotone g) (eq : f = g) : - d.reindex f hf = d.reindex g hg := by cases eq; rfl - -namespace Cone -variable {d : Diagram I} (c : d.Cone) - -def augmentedStage : WithTop I → MainStage.{u} - | none => c.apex - | some i => d.stage i - -def augmentedTransition {i j : WithTop I} (h : i ≤ j) : - Transition (c.augmentedStage i) (c.augmentedStage j) := by - cases i with - | top => - cases j with - | top => exact Transition.identity c.apex - | coe j => exact False.elim (WithTop.not_top_le_coe j h) - | coe i => - cases j with - | top => exact c.leg i - | coe j => exact d.transition (WithTop.coe_le_coe.mp h) - -theorem augmentedTransition_self (i : WithTop I) : - c.augmentedTransition (le_refl i) = Transition.identity (c.augmentedStage i) := by - cases i with - | top => rfl - | coe i => exact d.self i - -theorem augmentedTransition_comp {i j k : WithTop I} (hij : i ≤ j) (hjk : j ≤ k) : - c.augmentedTransition (le_trans hij hjk) = - (c.augmentedTransition hij).comp (c.augmentedTransition hjk) := by - cases i with - | top => - cases j with - | coe j => exact False.elim (WithTop.not_top_le_coe j hij) - | top => - cases k with - | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) - | top => exact (Transition.identity_comp _).symm - | coe i => - cases j with - | top => - cases k with - | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) - | top => exact (Transition.comp_identity _).symm - | coe j => - cases k with - | top => exact (c.coherent (WithTop.coe_le_coe.mp hij)).symm - | coe k => exact d.comp (WithTop.coe_le_coe.mp hij) (WithTop.coe_le_coe.mp hjk) - -def augmented : Diagram (WithTop I) where - stage := c.augmentedStage - transition := c.augmentedTransition - self := c.augmentedTransition_self - comp := c.augmentedTransition_comp - -theorem augmented_restrict : - c.augmented.reindex (fun i : I => (i : WithTop I)) WithTop.coe_mono = d := rfl - -variable {a : I} - -noncomputable def endIndex (i : Set.Iic a) : WithTop (Set.Iio a) := - if h : i.val < a then some ⟨i.val, h⟩ else none - -theorem endIndex_old (i : Set.Iio a) : - endIndex (⟨i.val, i.property.le⟩ : Set.Iic a) = some i := by - exact dite_eq_left i.property - -theorem endIndex_top : endIndex (⟨a, le_refl a⟩ : Set.Iic a) = none := - dite_eq_right (lt_irrefl a) - -theorem endIndex_mono : Monotone (endIndex (a := a)) := by - classical - intro i j h - by_cases hj : j.val < a - · have hi : i.val < a := lt_of_le_of_lt h hj - erw [endIndex, dite_eq_left hi, endIndex, dite_eq_left hj] - exact WithTop.coe_le_coe.mpr h - · have eq : endIndex j = none := dite_eq_right hj - rw [eq] - exact le_top - -noncomputable def append {d : Diagram (Set.Iio a)} (c : d.Cone) : Diagram (Set.Iic a) := - c.augmented.reindex endIndex endIndex_mono - -theorem append_stage_old {d : Diagram (Set.Iio a)} (c : d.Cone) (i : Set.Iio a) : - c.append.stage ⟨i.val, i.property.le⟩ = d.stage i := by - change c.augmentedStage (endIndex ⟨i.val, i.property.le⟩) = _ - rw [endIndex_old] - rfl - -theorem append_stage_top {d : Diagram (Set.Iio a)} (c : d.Cone) : - c.append.stage ⟨a, le_refl a⟩ = c.apex := by - change c.augmentedStage (endIndex ⟨a, le_refl a⟩) = _ - rw [endIndex_top] - rfl - -theorem append_restrict {d : Diagram (Set.Iio a)} (c : d.Cone) : - c.append.reindex (fun i : Set.Iio a => (⟨i.val, i.property.le⟩ : Set.Iic a)) - (fun _ _ h => h) = d := by - unfold append - erw [reindex_comp] - have eq : (fun i : Set.Iio a => endIndex (⟨i.val, i.property.le⟩ : Set.Iic a)) = - (fun i : Set.Iio a => (i : WithTop (Set.Iio a))) := funext endIndex_old - exact (reindex_congr c.augmented _ _ _ _ eq).trans c.augmented_restrict - -end Cone - -end PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.LimitProfilePersistence + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram + +universe u +variable {I : Type u} [LinearOrder I] + +theorem ext (d e : Diagram I) (stages : d.stage = e.stage) + (transitions : HEq (@d.transition) (@e.transition)) : d = e := by + cases d + cases e + cases stages + cases eq_of_heq transitions + rfl + +theorem reindex_comp (d : Diagram I) {J K : Type u} [LinearOrder J] [LinearOrder K] + (f : J → I) (hf : Monotone f) (g : K → J) (hg : Monotone g) : + (d.reindex f hf).reindex g hg = d.reindex (fun i => f (g i)) (hf.comp hg) := rfl + +theorem reindex_congr (d : Diagram I) {J : Type u} [LinearOrder J] + (f g : J → I) (hf : Monotone f) (hg : Monotone g) (eq : f = g) : + d.reindex f hf = d.reindex g hg := by cases eq; rfl + +namespace Cone +variable {d : Diagram I} (c : d.Cone) + +def augmentedStage : WithTop I → MainStage.{u} + | none => c.apex + | some i => d.stage i + +def augmentedTransition {i j : WithTop I} (h : i ≤ j) : + Transition (c.augmentedStage i) (c.augmentedStage j) := by + cases i with + | top => + cases j with + | top => exact Transition.identity c.apex + | coe j => exact False.elim (WithTop.not_top_le_coe j h) + | coe i => + cases j with + | top => exact c.leg i + | coe j => exact d.transition (WithTop.coe_le_coe.mp h) + +theorem augmentedTransition_self (i : WithTop I) : + c.augmentedTransition (le_refl i) = Transition.identity (c.augmentedStage i) := by + cases i with + | top => rfl + | coe i => exact d.self i + +theorem augmentedTransition_comp {i j k : WithTop I} (hij : i ≤ j) (hjk : j ≤ k) : + c.augmentedTransition (le_trans hij hjk) = + (c.augmentedTransition hij).comp (c.augmentedTransition hjk) := by + cases i with + | top => + cases j with + | coe j => exact False.elim (WithTop.not_top_le_coe j hij) + | top => + cases k with + | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) + | top => exact (Transition.identity_comp _).symm + | coe i => + cases j with + | top => + cases k with + | coe k => exact False.elim (WithTop.not_top_le_coe k hjk) + | top => exact (Transition.comp_identity _).symm + | coe j => + cases k with + | top => exact (c.coherent (WithTop.coe_le_coe.mp hij)).symm + | coe k => exact d.comp (WithTop.coe_le_coe.mp hij) (WithTop.coe_le_coe.mp hjk) + +def augmented : Diagram (WithTop I) where + stage := c.augmentedStage + transition := c.augmentedTransition + self := c.augmentedTransition_self + comp := c.augmentedTransition_comp + +theorem augmented_restrict : + c.augmented.reindex (fun i : I => (i : WithTop I)) WithTop.coe_mono = d := rfl + +variable {a : I} + +noncomputable def endIndex (i : Set.Iic a) : WithTop (Set.Iio a) := + if h : i.val < a then some ⟨i.val, h⟩ else none + +theorem endIndex_old (i : Set.Iio a) : + endIndex (⟨i.val, i.property.le⟩ : Set.Iic a) = some i := by + exact dite_eq_left i.property + +theorem endIndex_top : endIndex (⟨a, le_refl a⟩ : Set.Iic a) = none := + dite_eq_right (lt_irrefl a) + +theorem endIndex_mono : Monotone (endIndex (a := a)) := by + classical + intro i j h + by_cases hj : j.val < a + · have hi : i.val < a := lt_of_le_of_lt h hj + erw [endIndex, dite_eq_left hi, endIndex, dite_eq_left hj] + exact WithTop.coe_le_coe.mpr h + · have eq : endIndex j = none := dite_eq_right hj + rw [eq] + exact le_top + +noncomputable def append {d : Diagram (Set.Iio a)} (c : d.Cone) : Diagram (Set.Iic a) := + c.augmented.reindex endIndex endIndex_mono + +theorem append_stage_old {d : Diagram (Set.Iio a)} (c : d.Cone) (i : Set.Iio a) : + c.append.stage ⟨i.val, i.property.le⟩ = d.stage i := by + change c.augmentedStage (endIndex ⟨i.val, i.property.le⟩) = _ + rw [endIndex_old] + rfl + +theorem append_stage_top {d : Diagram (Set.Iio a)} (c : d.Cone) : + c.append.stage ⟨a, le_refl a⟩ = c.apex := by + change c.augmentedStage (endIndex ⟨a, le_refl a⟩) = _ + rw [endIndex_top] + rfl + +theorem append_restrict {d : Diagram (Set.Iio a)} (c : d.Cone) : + c.append.reindex (fun i : Set.Iio a => (⟨i.val, i.property.le⟩ : Set.Iic a)) + (fun _ _ h => h) = d := by + unfold append + erw [reindex_comp] + have eq : (fun i : Set.Iio a => endIndex (⟨i.val, i.property.le⟩ : Set.Iic a)) = + (fun i : Set.Iio a => (i : WithTop (Set.Iio a))) := funext endIndex_old + exact (reindex_congr c.augmented _ _ _ _ eq).trans c.augmented_restrict + +end Cone + +end PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInitial.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInitial.lean index b448114cd00cc293555f997a984c4428d03f0e3a..325f18d201caed56d8c61aaaeb7684f00aa050f2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInitial.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInitial.lean @@ -1,76 +1,76 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthOrigins - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -open CosetGeometry RationalHeights -universe u - -def initialOrder : MeetOrder (ULift.{u} Bool) where - le x y := x.down ≤ y.down - meet x y := ⟨min x.down y.down⟩ - refl _ := le_rfl - trans := le_trans - antisymm hxy hyx := ULift.ext _ _ (le_antisymm hxy hyx) - meet_le_left x y := min_le_left x.down y.down - meet_le_right x y := min_le_right x.down y.down - le_meet := le_min - -noncomputable def initialHeight : - StrictHeight initialOrder.{u} (lexOrder CountableColumns.order).toHeightOrder where - value x := (CountableColumns.natural 0, if x.down then one else zero) - strict x y lower different := by - rcases x with ⟨x⟩ - rcases y with ⟨y⟩ - cases x <;> cases y - · exact False.elim (different rfl) - · exact Or.inr ⟨rfl, RationalHeights.zero_lt_one⟩ - · exact False.elim ((by decide : ¬ (true : Bool) ≤ false) lower) - · exact False.elim (different rfl) - -theorem initialHeight_countable : CountableRange initialHeight.{u}.value := by - rcases exists_injective_nat (ULift.{u} Bool) with ⟨code, injective⟩ - exact ⟨code, fun x y eq => congrArg initialHeight.value (injective eq)⟩ - -noncomputable def initial : MainStage.{u} where - Point := ULift.{u} Bool - order := initialOrder - Actor := Equiv.Perm (ULift.{u} Unit) - action := { - iso _ := identityIso initialOrder - one _ := rfl - mul _ _ _ := rfl } - bottom := ⟨false⟩ - least x := Bool.false_le x.down - top := ⟨true⟩ - greatest x := Bool.le_true x.down - height := initialHeight - countable_height := initialHeight_countable - -theorem initial_two_points (x : initial.{u}.Point) : x = initial.bottom ∨ x = initial.top := by - rcases x with ⟨x⟩ - cases x - · exact Or.inl rfl - · exact Or.inr rfl - -theorem initial_bottom_ne_top : initial.{u}.bottom ≠ initial.top := by - intro eq - have bad := congrArg ULift.down eq - exact Bool.false_ne_true bad - -theorem initial_action_trivial (g : initial.{u}.Actor) (x : initial.Point) : - (initial.action.iso g).toFun x = x := rfl - -theorem initial_group_trivial (g : initial.{u}.Actor) : g = 1 := by - apply Equiv.ext - intro x - exact Subsingleton.elim _ _ - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthOrigins + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +open CosetGeometry RationalHeights +universe u + +def initialOrder : MeetOrder (ULift.{u} Bool) where + le x y := x.down ≤ y.down + meet x y := ⟨min x.down y.down⟩ + refl _ := le_rfl + trans := le_trans + antisymm hxy hyx := ULift.ext _ _ (le_antisymm hxy hyx) + meet_le_left x y := min_le_left x.down y.down + meet_le_right x y := min_le_right x.down y.down + le_meet := le_min + +noncomputable def initialHeight : + StrictHeight initialOrder.{u} (lexOrder CountableColumns.order).toHeightOrder where + value x := (CountableColumns.natural 0, if x.down then one else zero) + strict x y lower different := by + rcases x with ⟨x⟩ + rcases y with ⟨y⟩ + cases x <;> cases y + · exact False.elim (different rfl) + · exact Or.inr ⟨rfl, RationalHeights.zero_lt_one⟩ + · exact False.elim ((by decide : ¬ (true : Bool) ≤ false) lower) + · exact False.elim (different rfl) + +theorem initialHeight_countable : CountableRange initialHeight.{u}.value := by + rcases exists_injective_nat (ULift.{u} Bool) with ⟨code, injective⟩ + exact ⟨code, fun x y eq => congrArg initialHeight.value (injective eq)⟩ + +noncomputable def initial : MainStage.{u} where + Point := ULift.{u} Bool + order := initialOrder + Actor := Equiv.Perm (ULift.{u} Unit) + action := { + iso _ := identityIso initialOrder + one _ := rfl + mul _ _ _ := rfl } + bottom := ⟨false⟩ + least x := Bool.false_le x.down + top := ⟨true⟩ + greatest x := Bool.le_true x.down + height := initialHeight + countable_height := initialHeight_countable + +theorem initial_two_points (x : initial.{u}.Point) : x = initial.bottom ∨ x = initial.top := by + rcases x with ⟨x⟩ + cases x + · exact Or.inl rfl + · exact Or.inr rfl + +theorem initial_bottom_ne_top : initial.{u}.bottom ≠ initial.top := by + intro eq + have bad := congrArg ULift.down eq + exact Bool.false_ne_true bad + +theorem initial_action_trivial (g : initial.{u}.Actor) (x : initial.Point) : + (initial.action.iso g).toFun x = x := rfl + +theorem initial_group_trivial (g : initial.{u}.Actor) : g = 1 := by + apply Equiv.ext + intro x + exact Subsingleton.elim _ _ + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInsertion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInsertion.lean index 4ec2d7087369dd24ebfc9bf1ae7befc423a9ef00..f6ad46cbcf5a1315c1f0f5327f2aa6915e9fd1f6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInsertion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainInsertion.lean @@ -1,184 +1,184 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthExtensions - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -open CosetGeometry -universe u -variable (s : MainStage.{u}) (Label : Type u) - -noncomputable def compressionActor (i : s.action.AllTasks Label) : (s.next Label).Actor := - generator s.Actor (s.requests Label).Letters ⟨.compression i, ⟨()⟩⟩ - -noncomputable def compressionCap (i : s.action.AllTasks Label) : (s.next Label).Point := - (s.externalTransition Label).points.toFun ((s.tasks Label).unionCap i) - -theorem compression_internal (i : s.action.AllTasks Label) (x : (s.internal Label).Point) : - ((s.next Label).action.iso (s.compressionActor Label i)).toFun - ((s.externalTransition Label).points.toFun x) = - (s.externalTransition Label).points.toFun (((s.tasks Label).unionCompressionIso i).toFun x).val := by - change (((s.requests Label).extensionAction (s.internal Label).action).iso - (s.compressionActor Label i)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = _ - erw [(s.requests Label).extensionAction_copy, mul_one] - apply congrArg some - have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 - (.compression i) ⟨()⟩ x (((s.tasks Label).unionCompressionIso i).toFun x).val - (TileRequests.Request.compression_agrees (s.internal Label).top (s.internal Label).greatest - ((s.tasks Label).unionCap i) ((s.tasks Label).unionCompressionIso i) x) - simp only [one_mul] at eq - exact eq - -theorem compression_below_cap (i : s.action.AllTasks Label) (D : s.Point) : - (s.next Label).order.le - (((s.next Label).action.iso (s.compressionActor Label i)).toFun - ((s.nextTransition Label).points.toFun D)) (s.compressionCap Label i) := by - change (s.next Label).order.le - (((s.next Label).action.iso (s.compressionActor Label i)).toFun - ((s.externalTransition Label).points.toFun ((s.internalTransition Label).points.toFun D))) _ - rw [s.compression_internal] - exact ((s.externalTransition Label).points.le_iff _ _).mpr - (((s.tasks Label).unionCompressionIso i).toFun ((s.internalTransition Label).points.toFun D)).property - -theorem compression_agrees_ideal (i : s.action.AllTasks Label) (z : (s.next Label).Point) - (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun i.val.source)) : - ((s.next Label).action.iso (s.compressionActor Label i)).toFun z = - ((s.next Label).action.iso ((s.nextTransition Label).actors ((s.tasks Label).representative i))).toFun z := by - let e := (s.requests Label).extensionCopy (s.internal Label).action 1 - rcases e.ideal ((s.internalTransition Label).points.toFun i.val.source) z lower with ⟨x, rfl⟩ - have hx := (e.le_iff _ _).mp lower - have base := (s.tasks Label).compressionAlgebra.base_agreement i x hx - change (((s.tasks Label).unionCompressionIso i).toFun x).val = - ((s.internal Label).action.iso ((s.tasks Label).representative i)).toFun x at base - change ((s.next Label).action.iso (s.compressionActor Label i)).toFun - ((s.externalTransition Label).points.toFun x) = _ - rw [s.compression_internal, base] - exact ((s.externalTransition Label).equivariant ((s.tasks Label).representative i) x).symm - -end PartitionPilot.Compression.RecursiveMaps.MainStage - - - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -open Attachment -universe u -variable (s : MainStage.{u}) (Label : Type u) - -def insertionDatum (C E : s.Point) (F : MeetFilter s.order) (label : Label) : - TaskDatum s.order Label where - source := C - target := C - baseMap := { toFun := Subtype.val, le_iff := fun _ _ => Iff.rfl, map_meet := fun _ _ => rfl } - separator := E - filter := F - label := label - -def insertionTask (C E : s.Point) (F : MeetFilter s.order) - (ce : s.order.le C E) (strict : ¬ s.order.le E C) - (above : ∀ x, F.mem x → s.order.le E x) (label : Label) : s.action.AllTasks Label := - ⟨s.insertionDatum Label C E F label, - ⟨⟨(fun x => x.property), (fun y hy => ⟨⟨y, hy⟩, rfl⟩), ce, strict, above⟩, - ⟨1, fun x => s.action.one x.val⟩⟩⟩ - -theorem insertionTask_injective (C E : s.Point) (F : MeetFilter s.order) - (ce : s.order.le C E) (strict : ¬ s.order.le E C) - (above : ∀ x, F.mem x → s.order.le E x) : - Function.Injective (s.insertionTask Label C E F ce strict above) := by - intro i j eq - exact congrArg (fun t : s.action.AllTasks Label => t.val.label) eq - -theorem insertion_representative_fixes (C E : s.Point) (F : MeetFilter s.order) - (ce : s.order.le C E) (strict : ¬ s.order.le E C) - (above : ∀ x, F.mem x → s.order.le E x) (label : Label) - (x : s.Point) (lower : s.order.le x C) : - (s.action.iso ((s.tasks Label).representative - (s.insertionTask Label C E F ce strict above label))).toFun x = x := - (s.tasks Label).represents (s.insertionTask Label C E F ce strict above label) ⟨x, lower⟩ - -end PartitionPilot.Compression.RecursiveMaps.MainStage - - - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -universe u -namespace Transition -variable {s t : MainStage.{u}} - -def Inserts (f : Transition s t) (Label : Type u) (C E D : s.Point) (F : MeetFilter s.order) : Prop := - ∃ (caps : Label → t.Point) (actors : Label → t.Actor), - (∀ l z, t.order.le z (f.points.toFun C) → (t.action.iso (actors l)).toFun z = z) ∧ - (∀ l, t.order.le ((t.action.iso (actors l)).toFun (f.points.toFun D)) (caps l)) ∧ - (∀ l, t.order.le (f.points.toFun C) (caps l) ∧ ¬ t.order.le (caps l) (f.points.toFun C)) ∧ - (∀ l, ¬ t.order.le (f.points.toFun E) (caps l)) ∧ - (∀ i j, i ≠ j → t.order.meet (caps i) (caps j) = f.points.toFun C) ∧ - (∀ l x, t.order.le (f.points.toFun E) x → - (PositiveOver f.points F.mem x → t.order.le (caps l) x) ∧ - (¬ PositiveOver f.points F.mem x → t.order.meet (caps l) x = f.points.toFun C)) - -theorem inserts_transport {t' : MainStage.{u}} (f : Transition s t) (eq : t = t') - (Label : Type u) (C E D : s.Point) (F : MeetFilter s.order) : - (f.transport rfl eq).Inserts Label C E D F ↔ f.Inserts Label C E D F := by - cases eq - rfl - -end Transition - -variable (s : MainStage.{u}) (Label : Type u) - -theorem next_inserts (C E D : s.Point) (F : MeetFilter s.order) - (ce : s.order.le C E) (strict : ¬ s.order.le E C) - (above : ∀ x, F.mem x → s.order.le E x) : - (s.nextTransition Label).Inserts Label C E D F := by - let task := s.insertionTask Label C E F ce strict above - let inc := (s.internalTransition Label).points - let ext := (s.externalTransition Label).points - refine ⟨(fun l => s.compressionCap Label (task l)), - (fun l => s.compressionActor Label (task l)), ?_, ?_, ?_, ?_, ?_, ?_⟩ - · intro l z lower - have agrees := s.compression_agrees_ideal Label (task l) z lower - have fixes := (s.nextTransition Label).agreement ((s.tasks Label).representative (task l)) 1 C - (fun x hx => (s.insertion_representative_fixes Label C E F ce strict above l x hx).trans - (s.action.one x).symm) z lower - exact agrees.trans (fixes.trans (by rw [map_one, (s.next Label).action.one])) - · intro l - exact s.compression_below_cap Label (task l) D - · intro l - have strictCap := (s.tasks Label).compressionAlgebra.strict (task l) - exact ⟨(ext.le_iff _ _).mpr strictCap.1, fun h => strictCap.2 ((ext.le_iff _ _).mp h)⟩ - · intro l h - exact (s.tasks Label).compressionAlgebra.separator (task l) ((ext.le_iff _ _).mp h) - · intro i j different - have neq : task i ≠ task j := fun eq => different - (s.insertionTask_injective Label C E F ce strict above eq) - have meet := (s.tasks Label).union_equal_base_caps (task i) (task j) neq rfl - change (s.next Label).order.meet (ext.toFun _) (ext.toFun _) = ext.toFun (inc.toFun C) - erw [← ext.map_meet] - exact congrArg ext.toFun meet - · intro l - have old : Profile (s.internal Label).order (inc.toFun C) (inc.toFun E) - ((s.tasks Label).unionCap (task l)) (imageFamily inc F.mem) := by - intro x lower - have h := (s.tasks Label).compressionAlgebra.profile (task l) x lower - exact ⟨fun hp => h.1 ((positive_imageFamily inc F.mem x).mp hp), - fun hn => h.2 (fun hp => hn ((positive_imageFamily inc F.mem x).mpr hp))⟩ - have nonempty : ∃ x, imageFamily inc F.mem x := by - rcases F.nonempty with ⟨x, hx⟩ - exact ⟨inc.toFun x, x, hx, rfl⟩ - have persists := s.external_preservesProfiles Label (inc.toFun C) (inc.toFun E) - ((s.tasks Label).unionCap (task l)) (imageFamily inc F.mem) nonempty - ((s.tasks Label).compressionAlgebra.separator (task l)) old - intro x lower - have positive := positiveOver_imageFamily inc ext F.mem x - exact ⟨fun hp => (persists x lower).1 (positive.mpr hp), - fun hn => (persists x lower).2 (fun hp => hn (positive.mp hp))⟩ - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthExtensions + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +open CosetGeometry +universe u +variable (s : MainStage.{u}) (Label : Type u) + +noncomputable def compressionActor (i : s.action.AllTasks Label) : (s.next Label).Actor := + generator s.Actor (s.requests Label).Letters ⟨.compression i, ⟨()⟩⟩ + +noncomputable def compressionCap (i : s.action.AllTasks Label) : (s.next Label).Point := + (s.externalTransition Label).points.toFun ((s.tasks Label).unionCap i) + +theorem compression_internal (i : s.action.AllTasks Label) (x : (s.internal Label).Point) : + ((s.next Label).action.iso (s.compressionActor Label i)).toFun + ((s.externalTransition Label).points.toFun x) = + (s.externalTransition Label).points.toFun (((s.tasks Label).unionCompressionIso i).toFun x).val := by + change (((s.requests Label).extensionAction (s.internal Label).action).iso + (s.compressionActor Label i)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = _ + erw [(s.requests Label).extensionAction_copy, mul_one] + apply congrArg some + have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 + (.compression i) ⟨()⟩ x (((s.tasks Label).unionCompressionIso i).toFun x).val + (TileRequests.Request.compression_agrees (s.internal Label).top (s.internal Label).greatest + ((s.tasks Label).unionCap i) ((s.tasks Label).unionCompressionIso i) x) + simp only [one_mul] at eq + exact eq + +theorem compression_below_cap (i : s.action.AllTasks Label) (D : s.Point) : + (s.next Label).order.le + (((s.next Label).action.iso (s.compressionActor Label i)).toFun + ((s.nextTransition Label).points.toFun D)) (s.compressionCap Label i) := by + change (s.next Label).order.le + (((s.next Label).action.iso (s.compressionActor Label i)).toFun + ((s.externalTransition Label).points.toFun ((s.internalTransition Label).points.toFun D))) _ + rw [s.compression_internal] + exact ((s.externalTransition Label).points.le_iff _ _).mpr + (((s.tasks Label).unionCompressionIso i).toFun ((s.internalTransition Label).points.toFun D)).property + +theorem compression_agrees_ideal (i : s.action.AllTasks Label) (z : (s.next Label).Point) + (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun i.val.source)) : + ((s.next Label).action.iso (s.compressionActor Label i)).toFun z = + ((s.next Label).action.iso ((s.nextTransition Label).actors ((s.tasks Label).representative i))).toFun z := by + let e := (s.requests Label).extensionCopy (s.internal Label).action 1 + rcases e.ideal ((s.internalTransition Label).points.toFun i.val.source) z lower with ⟨x, rfl⟩ + have hx := (e.le_iff _ _).mp lower + have base := (s.tasks Label).compressionAlgebra.base_agreement i x hx + change (((s.tasks Label).unionCompressionIso i).toFun x).val = + ((s.internal Label).action.iso ((s.tasks Label).representative i)).toFun x at base + change ((s.next Label).action.iso (s.compressionActor Label i)).toFun + ((s.externalTransition Label).points.toFun x) = _ + rw [s.compression_internal, base] + exact ((s.externalTransition Label).equivariant ((s.tasks Label).representative i) x).symm + +end PartitionPilot.Compression.RecursiveMaps.MainStage + + + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +open Attachment +universe u +variable (s : MainStage.{u}) (Label : Type u) + +def insertionDatum (C E : s.Point) (F : MeetFilter s.order) (label : Label) : + TaskDatum s.order Label where + source := C + target := C + baseMap := { toFun := Subtype.val, le_iff := fun _ _ => Iff.rfl, map_meet := fun _ _ => rfl } + separator := E + filter := F + label := label + +def insertionTask (C E : s.Point) (F : MeetFilter s.order) + (ce : s.order.le C E) (strict : ¬ s.order.le E C) + (above : ∀ x, F.mem x → s.order.le E x) (label : Label) : s.action.AllTasks Label := + ⟨s.insertionDatum Label C E F label, + ⟨⟨(fun x => x.property), (fun y hy => ⟨⟨y, hy⟩, rfl⟩), ce, strict, above⟩, + ⟨1, fun x => s.action.one x.val⟩⟩⟩ + +theorem insertionTask_injective (C E : s.Point) (F : MeetFilter s.order) + (ce : s.order.le C E) (strict : ¬ s.order.le E C) + (above : ∀ x, F.mem x → s.order.le E x) : + Function.Injective (s.insertionTask Label C E F ce strict above) := by + intro i j eq + exact congrArg (fun t : s.action.AllTasks Label => t.val.label) eq + +theorem insertion_representative_fixes (C E : s.Point) (F : MeetFilter s.order) + (ce : s.order.le C E) (strict : ¬ s.order.le E C) + (above : ∀ x, F.mem x → s.order.le E x) (label : Label) + (x : s.Point) (lower : s.order.le x C) : + (s.action.iso ((s.tasks Label).representative + (s.insertionTask Label C E F ce strict above label))).toFun x = x := + (s.tasks Label).represents (s.insertionTask Label C E F ce strict above label) ⟨x, lower⟩ + +end PartitionPilot.Compression.RecursiveMaps.MainStage + + + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +universe u +namespace Transition +variable {s t : MainStage.{u}} + +def Inserts (f : Transition s t) (Label : Type u) (C E D : s.Point) (F : MeetFilter s.order) : Prop := + ∃ (caps : Label → t.Point) (actors : Label → t.Actor), + (∀ l z, t.order.le z (f.points.toFun C) → (t.action.iso (actors l)).toFun z = z) ∧ + (∀ l, t.order.le ((t.action.iso (actors l)).toFun (f.points.toFun D)) (caps l)) ∧ + (∀ l, t.order.le (f.points.toFun C) (caps l) ∧ ¬ t.order.le (caps l) (f.points.toFun C)) ∧ + (∀ l, ¬ t.order.le (f.points.toFun E) (caps l)) ∧ + (∀ i j, i ≠ j → t.order.meet (caps i) (caps j) = f.points.toFun C) ∧ + (∀ l x, t.order.le (f.points.toFun E) x → + (PositiveOver f.points F.mem x → t.order.le (caps l) x) ∧ + (¬ PositiveOver f.points F.mem x → t.order.meet (caps l) x = f.points.toFun C)) + +theorem inserts_transport {t' : MainStage.{u}} (f : Transition s t) (eq : t = t') + (Label : Type u) (C E D : s.Point) (F : MeetFilter s.order) : + (f.transport rfl eq).Inserts Label C E D F ↔ f.Inserts Label C E D F := by + cases eq + rfl + +end Transition + +variable (s : MainStage.{u}) (Label : Type u) + +theorem next_inserts (C E D : s.Point) (F : MeetFilter s.order) + (ce : s.order.le C E) (strict : ¬ s.order.le E C) + (above : ∀ x, F.mem x → s.order.le E x) : + (s.nextTransition Label).Inserts Label C E D F := by + let task := s.insertionTask Label C E F ce strict above + let inc := (s.internalTransition Label).points + let ext := (s.externalTransition Label).points + refine ⟨(fun l => s.compressionCap Label (task l)), + (fun l => s.compressionActor Label (task l)), ?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro l z lower + have agrees := s.compression_agrees_ideal Label (task l) z lower + have fixes := (s.nextTransition Label).agreement ((s.tasks Label).representative (task l)) 1 C + (fun x hx => (s.insertion_representative_fixes Label C E F ce strict above l x hx).trans + (s.action.one x).symm) z lower + exact agrees.trans (fixes.trans (by rw [map_one, (s.next Label).action.one])) + · intro l + exact s.compression_below_cap Label (task l) D + · intro l + have strictCap := (s.tasks Label).compressionAlgebra.strict (task l) + exact ⟨(ext.le_iff _ _).mpr strictCap.1, fun h => strictCap.2 ((ext.le_iff _ _).mp h)⟩ + · intro l h + exact (s.tasks Label).compressionAlgebra.separator (task l) ((ext.le_iff _ _).mp h) + · intro i j different + have neq : task i ≠ task j := fun eq => different + (s.insertionTask_injective Label C E F ce strict above eq) + have meet := (s.tasks Label).union_equal_base_caps (task i) (task j) neq rfl + change (s.next Label).order.meet (ext.toFun _) (ext.toFun _) = ext.toFun (inc.toFun C) + erw [← ext.map_meet] + exact congrArg ext.toFun meet + · intro l + have old : Profile (s.internal Label).order (inc.toFun C) (inc.toFun E) + ((s.tasks Label).unionCap (task l)) (imageFamily inc F.mem) := by + intro x lower + have h := (s.tasks Label).compressionAlgebra.profile (task l) x lower + exact ⟨fun hp => h.1 ((positive_imageFamily inc F.mem x).mp hp), + fun hn => h.2 (fun hp => hn ((positive_imageFamily inc F.mem x).mpr hp))⟩ + have nonempty : ∃ x, imageFamily inc F.mem x := by + rcases F.nonempty with ⟨x, hx⟩ + exact ⟨inc.toFun x, x, hx, rfl⟩ + have persists := s.external_preservesProfiles Label (inc.toFun C) (inc.toFun E) + ((s.tasks Label).unionCap (task l)) (imageFamily inc F.mem) nonempty + ((s.tasks Label).compressionAlgebra.separator (task l)) old + intro x lower + have positive := positiveOver_imageFamily inc ext F.mem x + exact ⟨fun hp => (persists x lower).1 (positive.mpr hp), + fun hn => (persists x lower).2 (fun hp => hn (positive.mp hp))⟩ + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainProfilePersistence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainProfilePersistence.lean index bfb0e8f044c61a5f419472b7b2fab28bc4b73075..1a50688ecf0aef196204bdb4c4881c8937feaede 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainProfilePersistence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainProfilePersistence.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.ProfileTransport -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthOrigins - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem - -universe u -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -theorem step_preservesProfiles (n : Nat) : PreservesProfiles (f.step n) := by - intro c v K F nonempty separate profile - exact profile_persists_one_step (f.step n) c v K F nonempty profile separate - (Attachment.permitted_extension (f.stages n).batch.data (f.stages n).batch.component_meets) - -theorem origin_preservesProfiles (n : Nat) : PreservesProfiles (f.origin n) := by - induction n with - | zero => exact preservesProfiles_identity P - | succ n ih => exact preservesProfiles_comp (f.origin n) (f.step n) ih (f.step_preservesProfiles n) - -theorem union_preservesProfiles : PreservesProfiles f.originalEmbedding := by - intro c v K F nonempty separate profile x above - rcases f.union_cover x with ⟨n, x, rfl⟩ - exact profileOver_at_embedding (f.origin n) (f.inclusionEmbedding n) f.originalEmbedding - (f.inclusion_original n) c v K F - (f.origin_preservesProfiles n c v K F nonempty separate profile) x above - -end PartitionPilot.Compression.RecursiveMaps.TaskSystem - - - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -universe u -variable (s : MainStage.{u}) (Label : Type u) - -theorem internal_preservesProfiles : PreservesProfiles (s.internalTransition Label).points := - (s.tasks Label).union_preservesProfiles - -theorem external_preservesProfiles : PreservesProfiles (s.externalTransition Label).points := - ((s.requests Label).extensionCopy (s.internal Label).action 1).preservesProfiles - (s.internal Label).top (s.internal Label).greatest - -theorem next_preservesProfiles : PreservesProfiles (s.nextTransition Label).points := - preservesProfiles_comp (s.internalTransition Label).points (s.externalTransition Label).points - (s.internal_preservesProfiles Label) (s.external_preservesProfiles Label) - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.ProfileTransport +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainBirthOrigins + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem + +universe u +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +theorem step_preservesProfiles (n : Nat) : PreservesProfiles (f.step n) := by + intro c v K F nonempty separate profile + exact profile_persists_one_step (f.step n) c v K F nonempty profile separate + (Attachment.permitted_extension (f.stages n).batch.data (f.stages n).batch.component_meets) + +theorem origin_preservesProfiles (n : Nat) : PreservesProfiles (f.origin n) := by + induction n with + | zero => exact preservesProfiles_identity P + | succ n ih => exact preservesProfiles_comp (f.origin n) (f.step n) ih (f.step_preservesProfiles n) + +theorem union_preservesProfiles : PreservesProfiles f.originalEmbedding := by + intro c v K F nonempty separate profile x above + rcases f.union_cover x with ⟨n, x, rfl⟩ + exact profileOver_at_embedding (f.origin n) (f.inclusionEmbedding n) f.originalEmbedding + (f.inclusion_original n) c v K F + (f.origin_preservesProfiles n c v K F nonempty separate profile) x above + +end PartitionPilot.Compression.RecursiveMaps.TaskSystem + + + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +universe u +variable (s : MainStage.{u}) (Label : Type u) + +theorem internal_preservesProfiles : PreservesProfiles (s.internalTransition Label).points := + (s.tasks Label).union_preservesProfiles + +theorem external_preservesProfiles : PreservesProfiles (s.externalTransition Label).points := + ((s.requests Label).extensionCopy (s.internal Label).action 1).preservesProfiles + (s.internal Label).top (s.internal Label).greatest + +theorem next_preservesProfiles : PreservesProfiles (s.nextTransition Label).points := + preservesProfiles_comp (s.internalTransition Label).points (s.externalTransition Label).points + (s.internal_preservesProfiles Label) (s.external_preservesProfiles Label) + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangleMeets.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangleMeets.lean index 03be7e7d3893d2ee7d9a229a4790bf8cd78b6748..900693b9cac32a90ca3abe268204d8bf526ca172 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangleMeets.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangleMeets.lean @@ -1,335 +1,335 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalStageBounds - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -section - -open CosetGeometry -universe u - -namespace Transition -variable {s t : MainStage.{u}} - -def Separates (f : Transition s t) (W D X : s.Point) : Prop := - ∃ g : t.Actor, - (∀ z, t.order.le z (f.points.toFun W) → (t.action.iso g).toFun z = z) ∧ - t.order.meet ((t.action.iso g).toFun (f.points.toFun D)) (f.points.toFun X) = f.points.toFun W - -theorem separates_transport {t' : MainStage.{u}} (f : Transition s t) (eq : t = t') - (W D X : s.Point) : (f.transport rfl eq).Separates W D X ↔ f.Separates W D X := by - cases eq - rfl - -end Transition - -variable (s : MainStage.{u}) (Label : Type u) - -noncomputable def separationActor (W : s.Point) : (s.next Label).Actor := - generator s.Actor (s.requests Label).Letters ⟨.separation W, ⟨()⟩⟩ - -theorem separation_internal (W : s.Point) (x : (s.internal Label).Point) - (lower : (s.internal Label).order.le x ((s.internalTransition Label).points.toFun W)) : - ((s.next Label).action.iso (s.separationActor Label W)).toFun - ((s.externalTransition Label).points.toFun x) = (s.externalTransition Label).points.toFun x := by - change (((s.requests Label).extensionAction (s.internal Label).action).iso - (s.separationActor Label W)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = _ - erw [(s.requests Label).extensionAction_copy, mul_one] - apply congrArg some - have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 - (.separation W) ⟨()⟩ x x - (TileRequests.Request.separation_agrees (s.internal Label).top (s.internal Label).greatest - ((s.internalTransition Label).points.toFun W) x lower) - simp only [one_mul] at eq - exact eq - -theorem separation_fixes_ideal (W : s.Point) (z : (s.next Label).Point) - (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun W)) : - ((s.next Label).action.iso (s.separationActor Label W)).toFun z = z := by - let e := (s.requests Label).extensionCopy (s.internal Label).action 1 - rcases e.ideal ((s.internalTransition Label).points.toFun W) z lower with ⟨x, rfl⟩ - exact s.separation_internal Label W x ((e.le_iff _ _).mp lower) - -theorem separation_meet (W D X : s.Point) (wd : s.order.le W D) (wx : s.order.le W X) : - (s.next Label).order.meet - (((s.next Label).action.iso (s.separationActor Label W)).toFun - ((s.nextTransition Label).points.toFun D)) - ((s.nextTransition Label).points.toFun X) = (s.nextTransition Label).points.toFun W := by - change ((s.requests Label).extensionOrder (s.internal Label).action).meet - ((((s.requests Label).extensionAction (s.internal Label).action).iso - (s.separationActor Label W)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun - ((s.internalTransition Label).points.toFun D))) _ = _ - erw [(s.requests Label).extensionAction_copy, mul_one] - apply congrArg some - have eq := (s.requests Label).transfer_child_root_meet (s.internal Label).action 1 - (.separation W) ⟨()⟩ ((s.internalTransition Label).points.toFun D) - ((s.internalTransition Label).points.toFun X) ((s.internalTransition Label).points.toFun W) - (BinaryTiles.separation_cross_meet (s.internal Label).order - ((s.internalTransition Label).points.toFun W) ((s.internalTransition Label).points.toFun D) - ((s.internalTransition Label).points.toFun X) - (((s.internalTransition Label).points.le_iff _ _).mpr wd) - (((s.internalTransition Label).points.le_iff _ _).mpr wx)) - simp only [one_mul] at eq - exact eq - -theorem next_separates (W D X : s.Point) (wd : s.order.le W D) (wx : s.order.le W X) : - (s.nextTransition Label).Separates W D X := - ⟨s.separationActor Label W, s.separation_fixes_ideal Label W, s.separation_meet Label W D X wd wx⟩ - -end - - - -section - -open CosetGeometry -universe u -variable (s : MainStage.{u}) (Label : Type u) (r : ActionRectangle s.order s.action.iso) - -def rectangleOldActor (j : Bool) : s.Actor := if j then r.second else r.first - -noncomputable def rectangleActor (j : Bool) : (s.next Label).Actor := - generator s.Actor (s.requests Label).Letters ⟨.rectangle r, ⟨j⟩⟩ - -noncomputable def rectangleInput : Rectangle.Input (s.internal Label).order := - (((s.tasks Label).compressionAlgebra.liftRectangle r).toInput - (s.internal Label).top (s.internal Label).greatest) - -theorem rectangle_internal_C (j : Bool) (x : (s.internal Label).Point) - (lower : (s.internal Label).order.le x ((s.internalTransition Label).points.toFun r.C)) : - ((s.next Label).action.iso (s.rectangleActor Label r j)).toFun - ((s.externalTransition Label).points.toFun x) = - (s.externalTransition Label).points.toFun - (((s.internal Label).action.iso (s.rectangleOldActor r j)).toFun x) := by - change (((s.requests Label).extensionAction (s.internal Label).action).iso - (s.rectangleActor Label r j)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = _ - erw [(s.requests Label).extensionAction_copy, mul_one] - apply congrArg some - cases j with - | false => - have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 - (.rectangle r) ⟨false⟩ x (((s.rectangleInput Label r).g1).toFun x) - ((s.rectangleInput Label r).first_agrees x lower) - simp only [one_mul] at eq - exact eq - | true => - have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 - (.rectangle r) ⟨true⟩ x (((s.rectangleInput Label r).g2).toFun x) - ((s.rectangleInput Label r).second_agrees x lower) - simp only [one_mul] at eq - exact eq - -theorem rectangle_internal_B (x : (s.internal Label).Point) - (lower : (s.internal Label).order.le x ((s.internalTransition Label).points.toFun r.B)) : - ((s.next Label).action.iso (s.rectangleActor Label r false)).toFun - ((s.externalTransition Label).points.toFun x) = - ((s.next Label).action.iso (s.rectangleActor Label r true)).toFun - ((s.externalTransition Label).points.toFun x) := by - change (((s.requests Label).extensionAction (s.internal Label).action).iso - (s.rectangleActor Label r false)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = - (((s.requests Label).extensionAction (s.internal Label).action).iso - (s.rectangleActor Label r true)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) - erw [(s.requests Label).extensionAction_copy, (s.requests Label).extensionAction_copy, - mul_one, mul_one] - apply congrArg some - have eq := congrArg ((s.requests Label).placedTile (s.internal Label).action 1 (.rectangle r)).toFun - (((s.rectangleInput Label r).children_intersection x x).mpr ⟨lower, rfl⟩) - change ((s.requests Label).placedTile (s.internal Label).action 1 (.rectangle r)).toFun - ((((s.requests Label).tile (.rectangle r)).child ⟨false⟩).toFun x) = - ((s.requests Label).placedTile (s.internal Label).action 1 (.rectangle r)).toFun - ((((s.requests Label).tile (.rectangle r)).child ⟨true⟩).toFun x) at eq - erw [(s.requests Label).child_identification, (s.requests Label).child_identification] at eq - simp only [one_mul] at eq - exact eq - -theorem rectangle_agrees_C (j : Bool) (z : (s.next Label).Point) - (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun r.C)) : - ((s.next Label).action.iso (s.rectangleActor Label r j)).toFun z = - ((s.next Label).action.iso ((s.nextTransition Label).actors (s.rectangleOldActor r j))).toFun z := by - let e := (s.requests Label).extensionCopy (s.internal Label).action 1 - rcases e.ideal ((s.internalTransition Label).points.toFun r.C) z lower with ⟨x, rfl⟩ - exact (s.rectangle_internal_C Label r j x ((e.le_iff _ _).mp lower)).trans - ((s.requests Label).extension_extends_old (s.internal Label).action (s.rectangleOldActor r j) x).symm - -theorem rectangle_agrees_B (z : (s.next Label).Point) - (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun r.B)) : - ((s.next Label).action.iso (s.rectangleActor Label r false)).toFun z = - ((s.next Label).action.iso (s.rectangleActor Label r true)).toFun z := by - let e := (s.requests Label).extensionCopy (s.internal Label).action 1 - rcases e.ideal ((s.internalTransition Label).points.toFun r.B) z lower with ⟨x, rfl⟩ - exact s.rectangle_internal_B Label r x ((e.le_iff _ _).mp lower) - -end - - - -section - -universe u -variable (s : MainStage.{u}) (Label : Type u) (r : ActionRectangle s.order s.action.iso) - -theorem rectangle_meet_internal (j : Bool) (x : (s.internal Label).Point) : - (s.next Label).order.meet - (((s.next Label).action.iso (s.rectangleActor Label r j)).toFun - ((s.nextTransition Label).points.toFun r.D)) - ((s.externalTransition Label).points.toFun x) = - (s.externalTransition Label).points.toFun ((s.internal Label).order.meet - (((s.internal Label).action.iso (s.rectangleOldActor r j)).toFun - ((s.internalTransition Label).points.toFun r.C)) x) := by - change ((s.requests Label).extensionOrder (s.internal Label).action).meet - ((((s.requests Label).extensionAction (s.internal Label).action).iso - (s.rectangleActor Label r j)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun - ((s.internalTransition Label).points.toFun r.D))) _ = _ - erw [(s.requests Label).extensionAction_copy, mul_one] - apply congrArg some - cases j with - | false => - have eq := (s.requests Label).transfer_child_root_meet (s.internal Label).action 1 - (.rectangle r) ⟨false⟩ (s.rectangleInput Label r).D x _ - ((s.rectangleInput Label r).first_meet_root x) - simp only [one_mul] at eq - exact eq - | true => - have eq := (s.requests Label).transfer_child_root_meet (s.internal Label).action 1 - (.rectangle r) ⟨true⟩ (s.rectangleInput Label r).D x _ - ((s.rectangleInput Label r).second_meet_root x) - simp only [one_mul] at eq - exact eq - -theorem rectangle_meet_root (j : Bool) (X : s.Point) : - (s.next Label).order.meet - (((s.next Label).action.iso (s.rectangleActor Label r j)).toFun - ((s.nextTransition Label).points.toFun r.D)) - ((s.nextTransition Label).points.toFun X) = - (s.nextTransition Label).points.toFun - (s.order.meet (((s.action.iso (s.rectangleOldActor r j))).toFun r.C) X) := by - have eq := s.rectangle_meet_internal Label r j ((s.internalTransition Label).points.toFun X) - have localMeet : (s.internal Label).order.meet - (((s.internal Label).action.iso (s.rectangleOldActor r j)).toFun - ((s.internalTransition Label).points.toFun r.C)) - ((s.internalTransition Label).points.toFun X) = - (s.internalTransition Label).points.toFun - (s.order.meet ((s.action.iso (s.rectangleOldActor r j)).toFun r.C) X) := - (congrArg (fun z => (s.internal Label).order.meet z ((s.internalTransition Label).points.toFun X)) - ((s.internalTransition Label).equivariant (s.rectangleOldActor r j) r.C)).trans - ((s.internalTransition Label).points.map_meet _ _).symm - exact eq.trans (congrArg (s.externalTransition Label).points.toFun localMeet) - -theorem rectangle_meet_pair : - (s.next Label).order.meet - (((s.next Label).action.iso (s.rectangleActor Label r false)).toFun - ((s.nextTransition Label).points.toFun r.D)) - (((s.next Label).action.iso (s.rectangleActor Label r true)).toFun - ((s.nextTransition Label).points.toFun r.D)) = - ((s.next Label).action.iso (s.rectangleActor Label r false)).toFun - ((s.nextTransition Label).points.toFun r.B) := by - change ((s.requests Label).extensionOrder (s.internal Label).action).meet - ((((s.requests Label).extensionAction (s.internal Label).action).iso - (s.rectangleActor Label r false)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun - ((s.internalTransition Label).points.toFun r.D))) - ((((s.requests Label).extensionAction (s.internal Label).action).iso - (s.rectangleActor Label r true)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun - ((s.internalTransition Label).points.toFun r.D))) = - ((((s.requests Label).extensionAction (s.internal Label).action).iso - (s.rectangleActor Label r false)).toFun - (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun - ((s.internalTransition Label).points.toFun r.B))) - erw [(s.requests Label).extensionAction_copy, (s.requests Label).extensionAction_copy, - (s.requests Label).extensionAction_copy, mul_one, mul_one] - apply congrArg some - have eq := (s.requests Label).transfer_child_child_meet (s.internal Label).action 1 - (.rectangle r) ⟨false⟩ ⟨true⟩ (s.rectangleInput Label r).D (s.rectangleInput Label r).D - (s.rectangleInput Label r).B (s.rectangleInput Label r).children_meet - simp only [one_mul] at eq - exact eq - -namespace Transition -variable {s t : MainStage.{u}} - -def Rectangles (f : Transition s t) (r : ActionRectangle s.order s.action.iso) (X : s.Point) : Prop := - ∃ h : Bool → t.Actor, - (∀ j z, t.order.le z (f.points.toFun r.C) → - (t.action.iso (h j)).toFun z = (t.action.iso (f.actors (s.rectangleOldActor r j))).toFun z) ∧ - (∀ z, t.order.le z (f.points.toFun r.B) → - (t.action.iso (h false)).toFun z = (t.action.iso (h true)).toFun z) ∧ - (∀ j, t.order.meet ((t.action.iso (h j)).toFun (f.points.toFun r.D)) (f.points.toFun X) = - f.points.toFun (s.order.meet ((s.action.iso (s.rectangleOldActor r j)).toFun r.C) X)) ∧ - t.order.meet ((t.action.iso (h false)).toFun (f.points.toFun r.D)) - ((t.action.iso (h true)).toFun (f.points.toFun r.D)) = - (t.action.iso (h false)).toFun (f.points.toFun r.B) - -theorem rectangles_transport {t' : MainStage.{u}} (f : Transition s t) (eq : t = t') - (r : ActionRectangle s.order s.action.iso) (X : s.Point) : - (f.transport rfl eq).Rectangles r X ↔ f.Rectangles r X := by cases eq; rfl - -end Transition - -theorem next_rectangles (X : s.Point) : (s.nextTransition Label).Rectangles r X := - ⟨s.rectangleActor Label r, s.rectangle_agrees_C Label r, s.rectangle_agrees_B Label r, - fun j => s.rectangle_meet_root Label r j X, s.rectangle_meet_pair Label r⟩ - -end - - - -namespace OrdinalRun - -open CountableColumns -variable (Label : Type 1) - -theorem stage_successor_separates (a : Column) (W D X : (stage Label a).Point) - (wd : (stage Label a).order.le W D) (wx : (stage Label a).order.le W X) : - (transition Label (lt_start a).le).Separates W D X := by - apply (Transition.separates_transport _ (stage_successor Label a) W D X).mp - rw [transition_successor] - exact (stage Label a).next_separates Label W D X wd wx - -theorem final_separation_at (a : Column) (W D X : (stage Label a).Point) - (wd : (stage Label a).order.le W D) (wx : (stage Label a).order.le W X) : - ∃ g : FinalActor Label, - (∀ z, (finalOrder Label).le z ((finalInclusion Label a).toFun W) → - ((finalAction Label).iso g).toFun z = z) ∧ - (finalOrder Label).meet - (((finalAction Label).iso g).toFun ((finalInclusion Label a).toFun D)) - ((finalInclusion Label a).toFun X) = (finalInclusion Label a).toFun W := by - rcases stage_successor_separates Label a W D X wd wx with ⟨g, fixes, meet⟩ - refine ⟨finalGroupInclusion Label (start a) g, ?_, ?_⟩ - · intro z lower - have h : (finalOrder Label).le z ((finalInclusion Label (start a)).toFun - ((transition Label (lt_start a).le).points.toFun W)) := by - erw [final_points_coherent] - exact lower - have agree := final_agreement Label (start a) g 1 - ((transition Label (lt_start a).le).points.toFun W) - (fun y hy => (fixes y hy).trans ((stage Label (start a)).action.one y).symm) z h - simpa only [map_one, (finalAction Label).one] using agree - · erw [← final_points_coherent Label (lt_start a).le D, - ← final_points_coherent Label (lt_start a).le X, - final_action_stage, ← (finalInclusion Label (start a)).map_meet, - meet, final_points_coherent] - -theorem final_separation (W D X : FinalPoint Label) - (wd : (finalOrder Label).le W D) (wx : (finalOrder Label).le W X) : - ∃ g : FinalActor Label, - (∀ z, (finalOrder Label).le z W → ((finalAction Label).iso g).toFun z = z) ∧ - (finalOrder Label).meet (((finalAction Label).iso g).toFun D) X = W := by - rcases (diagram Label).orders.system.triple_cover (diagram Label).orders.system - (diagram Label).orders.system W D X with ⟨a, W, D, X, rfl, rfl, rfl⟩ - exact final_separation_at Label a W D X - (((finalInclusion Label a).le_iff _ _).mp wd) (((finalInclusion Label a).le_iff _ _).mp wx) - -end OrdinalRun - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.FinalStageBounds + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +section + +open CosetGeometry +universe u + +namespace Transition +variable {s t : MainStage.{u}} + +def Separates (f : Transition s t) (W D X : s.Point) : Prop := + ∃ g : t.Actor, + (∀ z, t.order.le z (f.points.toFun W) → (t.action.iso g).toFun z = z) ∧ + t.order.meet ((t.action.iso g).toFun (f.points.toFun D)) (f.points.toFun X) = f.points.toFun W + +theorem separates_transport {t' : MainStage.{u}} (f : Transition s t) (eq : t = t') + (W D X : s.Point) : (f.transport rfl eq).Separates W D X ↔ f.Separates W D X := by + cases eq + rfl + +end Transition + +variable (s : MainStage.{u}) (Label : Type u) + +noncomputable def separationActor (W : s.Point) : (s.next Label).Actor := + generator s.Actor (s.requests Label).Letters ⟨.separation W, ⟨()⟩⟩ + +theorem separation_internal (W : s.Point) (x : (s.internal Label).Point) + (lower : (s.internal Label).order.le x ((s.internalTransition Label).points.toFun W)) : + ((s.next Label).action.iso (s.separationActor Label W)).toFun + ((s.externalTransition Label).points.toFun x) = (s.externalTransition Label).points.toFun x := by + change (((s.requests Label).extensionAction (s.internal Label).action).iso + (s.separationActor Label W)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = _ + erw [(s.requests Label).extensionAction_copy, mul_one] + apply congrArg some + have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 + (.separation W) ⟨()⟩ x x + (TileRequests.Request.separation_agrees (s.internal Label).top (s.internal Label).greatest + ((s.internalTransition Label).points.toFun W) x lower) + simp only [one_mul] at eq + exact eq + +theorem separation_fixes_ideal (W : s.Point) (z : (s.next Label).Point) + (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun W)) : + ((s.next Label).action.iso (s.separationActor Label W)).toFun z = z := by + let e := (s.requests Label).extensionCopy (s.internal Label).action 1 + rcases e.ideal ((s.internalTransition Label).points.toFun W) z lower with ⟨x, rfl⟩ + exact s.separation_internal Label W x ((e.le_iff _ _).mp lower) + +theorem separation_meet (W D X : s.Point) (wd : s.order.le W D) (wx : s.order.le W X) : + (s.next Label).order.meet + (((s.next Label).action.iso (s.separationActor Label W)).toFun + ((s.nextTransition Label).points.toFun D)) + ((s.nextTransition Label).points.toFun X) = (s.nextTransition Label).points.toFun W := by + change ((s.requests Label).extensionOrder (s.internal Label).action).meet + ((((s.requests Label).extensionAction (s.internal Label).action).iso + (s.separationActor Label W)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun + ((s.internalTransition Label).points.toFun D))) _ = _ + erw [(s.requests Label).extensionAction_copy, mul_one] + apply congrArg some + have eq := (s.requests Label).transfer_child_root_meet (s.internal Label).action 1 + (.separation W) ⟨()⟩ ((s.internalTransition Label).points.toFun D) + ((s.internalTransition Label).points.toFun X) ((s.internalTransition Label).points.toFun W) + (BinaryTiles.separation_cross_meet (s.internal Label).order + ((s.internalTransition Label).points.toFun W) ((s.internalTransition Label).points.toFun D) + ((s.internalTransition Label).points.toFun X) + (((s.internalTransition Label).points.le_iff _ _).mpr wd) + (((s.internalTransition Label).points.le_iff _ _).mpr wx)) + simp only [one_mul] at eq + exact eq + +theorem next_separates (W D X : s.Point) (wd : s.order.le W D) (wx : s.order.le W X) : + (s.nextTransition Label).Separates W D X := + ⟨s.separationActor Label W, s.separation_fixes_ideal Label W, s.separation_meet Label W D X wd wx⟩ + +end + + + +section + +open CosetGeometry +universe u +variable (s : MainStage.{u}) (Label : Type u) (r : ActionRectangle s.order s.action.iso) + +def rectangleOldActor (j : Bool) : s.Actor := if j then r.second else r.first + +noncomputable def rectangleActor (j : Bool) : (s.next Label).Actor := + generator s.Actor (s.requests Label).Letters ⟨.rectangle r, ⟨j⟩⟩ + +noncomputable def rectangleInput : Rectangle.Input (s.internal Label).order := + (((s.tasks Label).compressionAlgebra.liftRectangle r).toInput + (s.internal Label).top (s.internal Label).greatest) + +theorem rectangle_internal_C (j : Bool) (x : (s.internal Label).Point) + (lower : (s.internal Label).order.le x ((s.internalTransition Label).points.toFun r.C)) : + ((s.next Label).action.iso (s.rectangleActor Label r j)).toFun + ((s.externalTransition Label).points.toFun x) = + (s.externalTransition Label).points.toFun + (((s.internal Label).action.iso (s.rectangleOldActor r j)).toFun x) := by + change (((s.requests Label).extensionAction (s.internal Label).action).iso + (s.rectangleActor Label r j)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = _ + erw [(s.requests Label).extensionAction_copy, mul_one] + apply congrArg some + cases j with + | false => + have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 + (.rectangle r) ⟨false⟩ x (((s.rectangleInput Label r).g1).toFun x) + ((s.rectangleInput Label r).first_agrees x lower) + simp only [one_mul] at eq + exact eq + | true => + have eq := (s.requests Label).transfer_child_root (s.internal Label).action 1 + (.rectangle r) ⟨true⟩ x (((s.rectangleInput Label r).g2).toFun x) + ((s.rectangleInput Label r).second_agrees x lower) + simp only [one_mul] at eq + exact eq + +theorem rectangle_internal_B (x : (s.internal Label).Point) + (lower : (s.internal Label).order.le x ((s.internalTransition Label).points.toFun r.B)) : + ((s.next Label).action.iso (s.rectangleActor Label r false)).toFun + ((s.externalTransition Label).points.toFun x) = + ((s.next Label).action.iso (s.rectangleActor Label r true)).toFun + ((s.externalTransition Label).points.toFun x) := by + change (((s.requests Label).extensionAction (s.internal Label).action).iso + (s.rectangleActor Label r false)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) = + (((s.requests Label).extensionAction (s.internal Label).action).iso + (s.rectangleActor Label r true)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun x) + erw [(s.requests Label).extensionAction_copy, (s.requests Label).extensionAction_copy, + mul_one, mul_one] + apply congrArg some + have eq := congrArg ((s.requests Label).placedTile (s.internal Label).action 1 (.rectangle r)).toFun + (((s.rectangleInput Label r).children_intersection x x).mpr ⟨lower, rfl⟩) + change ((s.requests Label).placedTile (s.internal Label).action 1 (.rectangle r)).toFun + ((((s.requests Label).tile (.rectangle r)).child ⟨false⟩).toFun x) = + ((s.requests Label).placedTile (s.internal Label).action 1 (.rectangle r)).toFun + ((((s.requests Label).tile (.rectangle r)).child ⟨true⟩).toFun x) at eq + erw [(s.requests Label).child_identification, (s.requests Label).child_identification] at eq + simp only [one_mul] at eq + exact eq + +theorem rectangle_agrees_C (j : Bool) (z : (s.next Label).Point) + (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun r.C)) : + ((s.next Label).action.iso (s.rectangleActor Label r j)).toFun z = + ((s.next Label).action.iso ((s.nextTransition Label).actors (s.rectangleOldActor r j))).toFun z := by + let e := (s.requests Label).extensionCopy (s.internal Label).action 1 + rcases e.ideal ((s.internalTransition Label).points.toFun r.C) z lower with ⟨x, rfl⟩ + exact (s.rectangle_internal_C Label r j x ((e.le_iff _ _).mp lower)).trans + ((s.requests Label).extension_extends_old (s.internal Label).action (s.rectangleOldActor r j) x).symm + +theorem rectangle_agrees_B (z : (s.next Label).Point) + (lower : (s.next Label).order.le z ((s.nextTransition Label).points.toFun r.B)) : + ((s.next Label).action.iso (s.rectangleActor Label r false)).toFun z = + ((s.next Label).action.iso (s.rectangleActor Label r true)).toFun z := by + let e := (s.requests Label).extensionCopy (s.internal Label).action 1 + rcases e.ideal ((s.internalTransition Label).points.toFun r.B) z lower with ⟨x, rfl⟩ + exact s.rectangle_internal_B Label r x ((e.le_iff _ _).mp lower) + +end + + + +section + +universe u +variable (s : MainStage.{u}) (Label : Type u) (r : ActionRectangle s.order s.action.iso) + +theorem rectangle_meet_internal (j : Bool) (x : (s.internal Label).Point) : + (s.next Label).order.meet + (((s.next Label).action.iso (s.rectangleActor Label r j)).toFun + ((s.nextTransition Label).points.toFun r.D)) + ((s.externalTransition Label).points.toFun x) = + (s.externalTransition Label).points.toFun ((s.internal Label).order.meet + (((s.internal Label).action.iso (s.rectangleOldActor r j)).toFun + ((s.internalTransition Label).points.toFun r.C)) x) := by + change ((s.requests Label).extensionOrder (s.internal Label).action).meet + ((((s.requests Label).extensionAction (s.internal Label).action).iso + (s.rectangleActor Label r j)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun + ((s.internalTransition Label).points.toFun r.D))) _ = _ + erw [(s.requests Label).extensionAction_copy, mul_one] + apply congrArg some + cases j with + | false => + have eq := (s.requests Label).transfer_child_root_meet (s.internal Label).action 1 + (.rectangle r) ⟨false⟩ (s.rectangleInput Label r).D x _ + ((s.rectangleInput Label r).first_meet_root x) + simp only [one_mul] at eq + exact eq + | true => + have eq := (s.requests Label).transfer_child_root_meet (s.internal Label).action 1 + (.rectangle r) ⟨true⟩ (s.rectangleInput Label r).D x _ + ((s.rectangleInput Label r).second_meet_root x) + simp only [one_mul] at eq + exact eq + +theorem rectangle_meet_root (j : Bool) (X : s.Point) : + (s.next Label).order.meet + (((s.next Label).action.iso (s.rectangleActor Label r j)).toFun + ((s.nextTransition Label).points.toFun r.D)) + ((s.nextTransition Label).points.toFun X) = + (s.nextTransition Label).points.toFun + (s.order.meet (((s.action.iso (s.rectangleOldActor r j))).toFun r.C) X) := by + have eq := s.rectangle_meet_internal Label r j ((s.internalTransition Label).points.toFun X) + have localMeet : (s.internal Label).order.meet + (((s.internal Label).action.iso (s.rectangleOldActor r j)).toFun + ((s.internalTransition Label).points.toFun r.C)) + ((s.internalTransition Label).points.toFun X) = + (s.internalTransition Label).points.toFun + (s.order.meet ((s.action.iso (s.rectangleOldActor r j)).toFun r.C) X) := + (congrArg (fun z => (s.internal Label).order.meet z ((s.internalTransition Label).points.toFun X)) + ((s.internalTransition Label).equivariant (s.rectangleOldActor r j) r.C)).trans + ((s.internalTransition Label).points.map_meet _ _).symm + exact eq.trans (congrArg (s.externalTransition Label).points.toFun localMeet) + +theorem rectangle_meet_pair : + (s.next Label).order.meet + (((s.next Label).action.iso (s.rectangleActor Label r false)).toFun + ((s.nextTransition Label).points.toFun r.D)) + (((s.next Label).action.iso (s.rectangleActor Label r true)).toFun + ((s.nextTransition Label).points.toFun r.D)) = + ((s.next Label).action.iso (s.rectangleActor Label r false)).toFun + ((s.nextTransition Label).points.toFun r.B) := by + change ((s.requests Label).extensionOrder (s.internal Label).action).meet + ((((s.requests Label).extensionAction (s.internal Label).action).iso + (s.rectangleActor Label r false)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun + ((s.internalTransition Label).points.toFun r.D))) + ((((s.requests Label).extensionAction (s.internal Label).action).iso + (s.rectangleActor Label r true)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun + ((s.internalTransition Label).points.toFun r.D))) = + ((((s.requests Label).extensionAction (s.internal Label).action).iso + (s.rectangleActor Label r false)).toFun + (((s.requests Label).extensionCopy (s.internal Label).action 1).toFun + ((s.internalTransition Label).points.toFun r.B))) + erw [(s.requests Label).extensionAction_copy, (s.requests Label).extensionAction_copy, + (s.requests Label).extensionAction_copy, mul_one, mul_one] + apply congrArg some + have eq := (s.requests Label).transfer_child_child_meet (s.internal Label).action 1 + (.rectangle r) ⟨false⟩ ⟨true⟩ (s.rectangleInput Label r).D (s.rectangleInput Label r).D + (s.rectangleInput Label r).B (s.rectangleInput Label r).children_meet + simp only [one_mul] at eq + exact eq + +namespace Transition +variable {s t : MainStage.{u}} + +def Rectangles (f : Transition s t) (r : ActionRectangle s.order s.action.iso) (X : s.Point) : Prop := + ∃ h : Bool → t.Actor, + (∀ j z, t.order.le z (f.points.toFun r.C) → + (t.action.iso (h j)).toFun z = (t.action.iso (f.actors (s.rectangleOldActor r j))).toFun z) ∧ + (∀ z, t.order.le z (f.points.toFun r.B) → + (t.action.iso (h false)).toFun z = (t.action.iso (h true)).toFun z) ∧ + (∀ j, t.order.meet ((t.action.iso (h j)).toFun (f.points.toFun r.D)) (f.points.toFun X) = + f.points.toFun (s.order.meet ((s.action.iso (s.rectangleOldActor r j)).toFun r.C) X)) ∧ + t.order.meet ((t.action.iso (h false)).toFun (f.points.toFun r.D)) + ((t.action.iso (h true)).toFun (f.points.toFun r.D)) = + (t.action.iso (h false)).toFun (f.points.toFun r.B) + +theorem rectangles_transport {t' : MainStage.{u}} (f : Transition s t) (eq : t = t') + (r : ActionRectangle s.order s.action.iso) (X : s.Point) : + (f.transport rfl eq).Rectangles r X ↔ f.Rectangles r X := by cases eq; rfl + +end Transition + +theorem next_rectangles (X : s.Point) : (s.nextTransition Label).Rectangles r X := + ⟨s.rectangleActor Label r, s.rectangle_agrees_C Label r, s.rectangle_agrees_B Label r, + fun j => s.rectangle_meet_root Label r j X, s.rectangle_meet_pair Label r⟩ + +end + + + +namespace OrdinalRun + +open CountableColumns +variable (Label : Type 1) + +theorem stage_successor_separates (a : Column) (W D X : (stage Label a).Point) + (wd : (stage Label a).order.le W D) (wx : (stage Label a).order.le W X) : + (transition Label (lt_start a).le).Separates W D X := by + apply (Transition.separates_transport _ (stage_successor Label a) W D X).mp + rw [transition_successor] + exact (stage Label a).next_separates Label W D X wd wx + +theorem final_separation_at (a : Column) (W D X : (stage Label a).Point) + (wd : (stage Label a).order.le W D) (wx : (stage Label a).order.le W X) : + ∃ g : FinalActor Label, + (∀ z, (finalOrder Label).le z ((finalInclusion Label a).toFun W) → + ((finalAction Label).iso g).toFun z = z) ∧ + (finalOrder Label).meet + (((finalAction Label).iso g).toFun ((finalInclusion Label a).toFun D)) + ((finalInclusion Label a).toFun X) = (finalInclusion Label a).toFun W := by + rcases stage_successor_separates Label a W D X wd wx with ⟨g, fixes, meet⟩ + refine ⟨finalGroupInclusion Label (start a) g, ?_, ?_⟩ + · intro z lower + have h : (finalOrder Label).le z ((finalInclusion Label (start a)).toFun + ((transition Label (lt_start a).le).points.toFun W)) := by + erw [final_points_coherent] + exact lower + have agree := final_agreement Label (start a) g 1 + ((transition Label (lt_start a).le).points.toFun W) + (fun y hy => (fixes y hy).trans ((stage Label (start a)).action.one y).symm) z h + simpa only [map_one, (finalAction Label).one] using agree + · erw [← final_points_coherent Label (lt_start a).le D, + ← final_points_coherent Label (lt_start a).le X, + final_action_stage, ← (finalInclusion Label (start a)).map_meet, + meet, final_points_coherent] + +theorem final_separation (W D X : FinalPoint Label) + (wd : (finalOrder Label).le W D) (wx : (finalOrder Label).le W X) : + ∃ g : FinalActor Label, + (∀ z, (finalOrder Label).le z W → ((finalAction Label).iso g).toFun z = z) ∧ + (finalOrder Label).meet (((finalAction Label).iso g).toFun D) X = W := by + rcases (diagram Label).orders.system.triple_cover (diagram Label).orders.system + (diagram Label).orders.system W D X with ⟨a, W, D, X, rfl, rfl, rfl⟩ + exact final_separation_at Label a W D X + (((finalInclusion Label a).le_iff _ _).mp wd) (((finalInclusion Label a).le_iff _ _).mp wx) + +end OrdinalRun + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangles.lean index 1616d32b14bf767b3fb24fb3d843c0a52df48a80..ef8e2583aa7c54ca2ec78be4d475a991647ca867 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/MainRectangles.lean @@ -1,154 +1,154 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GluingBirthRanges - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Attachment CosetGeometry -universe u - -def groupDataOfGroup (G : Type u) [Group G] : GroupData G where - one := 1 - mul := (· * ·) - inv := Inv.inv - assoc := mul_assoc - one_mul := one_mul - mul_one := mul_one - inv_mul := inv_mul_cancel - mul_inv := mul_inv_cancel - -namespace CosetGeometry.OrderAction -variable {A G Label : Type u} [Group G] {P : MeetOrder A} (a : OrderAction G P) - -def Eligible (d : TaskDatum P Label) : Prop := - d.Geometry ∧ ∃ g, ∀ x : {x // P.le x d.source}, (a.iso g).toFun x.val = d.baseMap.toFun x - -def AllTasks (Label : Type u) := {d : TaskDatum P Label // a.Eligible d} - -theorem eligible_transform (g : G) (d : TaskDatum P Label) (eligible : a.Eligible d) : - a.Eligible (TaskDatum.transform (a.iso g) d) := by - refine ⟨TaskDatum.geometry_transform (a.iso g) d eligible.1, ?_⟩ - rcases eligible.2 with ⟨h, represents⟩ - refine ⟨g * h, ?_⟩ - intro x - change (a.iso (g * h)).toFun x.val = (a.iso g).toFun (d.baseMap.toFun x) - erw [a.mul, represents] - -theorem eligible_source_proper (top : A) (greatest : ∀ x, P.le x top) - (d : TaskDatum P Label) (eligible : a.Eligible d) : ¬ P.le top d.source := by - rcases eligible with ⟨geometry, g, represents⟩ - have baseTop : d.baseMap.toFun ⟨d.source, P.refl _⟩ = d.target := by - apply P.antisymm (geometry.base_bound _) - rcases geometry.base_onto d.target (P.refl _) with ⟨x, eq⟩ - rw [← eq] - exact (d.baseMap.le_iff _ _).mpr x.property - have sourceImage : (a.iso g).toFun d.source = d.target := (represents _).trans baseTop - intro lower - have targetTop := ((a.iso g).le_iff top d.source).mpr lower - rw [a.fixes_top top greatest, sourceImage] at targetTop - exact geometry.separator_not_le_base (P.trans (greatest d.separator) targetTop) - -noncomputable def allTaskSystem (top : A) (greatest : ∀ x, P.le x top) (Label : Type u) : - TaskSystem P G (a.AllTasks Label) Label where - group := groupDataOfGroup G - action := a.iso - action_one := a.one - action_mul := a.mul - datum := Subtype.val - faithful _ _ eq := Subtype.ext eq - geometry d := d.property.1 - invariant g d := ⟨⟨TaskDatum.transform (a.iso g) d.val, a.eligible_transform g d.val d.property⟩, rfl⟩ - representable d := d.property.2 - top := top - greatest := greatest - source_proper d := a.eligible_source_proper top greatest d.val d.property - -theorem allTaskSystem_complete (top : A) (greatest : ∀ x, P.le x top) - (d : TaskDatum P Label) (eligible : a.Eligible d) : - ∃ i, (a.allTaskSystem top greatest Label).datum i = d := ⟨⟨d, eligible⟩, rfl⟩ - -theorem allTaskSystem_literal (top : A) (greatest : ∀ x, P.le x top) - (i j : a.AllTasks Label) : - (a.allTaskSystem top greatest Label).datum i = (a.allTaskSystem top greatest Label).datum j ↔ - i = j := ⟨Subtype.ext, congrArg Subtype.val⟩ - -def labelledTask (d : TaskDatum P Label) (eligible : a.Eligible d) (label : Label) : a.AllTasks Label := - ⟨{ d with label := label }, - ⟨⟨eligible.1.base_bound, eligible.1.base_onto, eligible.1.base_le_separator, - eligible.1.separator_not_le_base, eligible.1.separator_le_filter⟩, eligible.2⟩⟩ - -theorem labelledTask_label (d : TaskDatum P Label) (eligible : a.Eligible d) (label : Label) : - (a.labelledTask d eligible label).val.label = label := rfl - -theorem labelledTask_injective (d : TaskDatum P Label) (eligible : a.Eligible d) : - Function.Injective (a.labelledTask d eligible) := by - intro i j eq - exact congrArg (fun task : a.AllTasks Label => task.val.label) eq - -end CosetGeometry.OrderAction -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u -structure ActionRectangle {A G : Type u} (P : MeetOrder A) (action : G → MeetIso P P) where - C : A - B : A - D : A - first : G - second : G - C_le_D : P.le C D - B_le_D : P.le B D - agree : ∀ x, P.le x (P.meet C B) → (action first).toFun x = (action second).toFun x - separated : P.meet ((action first).toFun D) ((action second).toFun D) = - (action first).toFun (P.meet C B) - -namespace ActionRectangle -variable {A G : Type u} {P : MeetOrder A} {action : G → MeetIso P P} - -def toInput (r : ActionRectangle P action) (top : A) (greatest : ∀ x, P.le x top) : - Rectangle.Input P where - top := top - greatest := greatest - C := r.C - B := r.B - D := r.D - C_le_D := r.C_le_D - B_le_D := r.B_le_D - g1 := action r.first - g2 := action r.second - agree := r.agree - separated := r.separated - -end ActionRectangle - -namespace CompressionAlgebra -variable {A G Task Label : Type u} {P : MeetOrder A} {f : TaskSystem P G Task Label} - (e : CompressionAlgebra f) - -def liftRectangle (r : ActionRectangle P f.action) : ActionRectangle e.order e.action where - C := e.original.toFun r.C - B := e.original.toFun r.B - D := e.original.toFun r.D - first := r.first - second := r.second - C_le_D := (e.original.le_iff _ _).mpr r.C_le_D - B_le_D := (e.original.le_iff _ _).mpr r.B_le_D - agree x lower := by - rw [← e.original.map_meet] at lower - exact e.agreement r.first r.second (P.meet r.C r.B) r.agree x lower - separated := by - rw [e.action_original, e.action_original, ← e.original.map_meet, r.separated] - rw [← e.original.map_meet, e.action_original] - -end CompressionAlgebra - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GluingBirthRanges + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Attachment CosetGeometry +universe u + +def groupDataOfGroup (G : Type u) [Group G] : GroupData G where + one := 1 + mul := (· * ·) + inv := Inv.inv + assoc := mul_assoc + one_mul := one_mul + mul_one := mul_one + inv_mul := inv_mul_cancel + mul_inv := mul_inv_cancel + +namespace CosetGeometry.OrderAction +variable {A G Label : Type u} [Group G] {P : MeetOrder A} (a : OrderAction G P) + +def Eligible (d : TaskDatum P Label) : Prop := + d.Geometry ∧ ∃ g, ∀ x : {x // P.le x d.source}, (a.iso g).toFun x.val = d.baseMap.toFun x + +def AllTasks (Label : Type u) := {d : TaskDatum P Label // a.Eligible d} + +theorem eligible_transform (g : G) (d : TaskDatum P Label) (eligible : a.Eligible d) : + a.Eligible (TaskDatum.transform (a.iso g) d) := by + refine ⟨TaskDatum.geometry_transform (a.iso g) d eligible.1, ?_⟩ + rcases eligible.2 with ⟨h, represents⟩ + refine ⟨g * h, ?_⟩ + intro x + change (a.iso (g * h)).toFun x.val = (a.iso g).toFun (d.baseMap.toFun x) + erw [a.mul, represents] + +theorem eligible_source_proper (top : A) (greatest : ∀ x, P.le x top) + (d : TaskDatum P Label) (eligible : a.Eligible d) : ¬ P.le top d.source := by + rcases eligible with ⟨geometry, g, represents⟩ + have baseTop : d.baseMap.toFun ⟨d.source, P.refl _⟩ = d.target := by + apply P.antisymm (geometry.base_bound _) + rcases geometry.base_onto d.target (P.refl _) with ⟨x, eq⟩ + rw [← eq] + exact (d.baseMap.le_iff _ _).mpr x.property + have sourceImage : (a.iso g).toFun d.source = d.target := (represents _).trans baseTop + intro lower + have targetTop := ((a.iso g).le_iff top d.source).mpr lower + rw [a.fixes_top top greatest, sourceImage] at targetTop + exact geometry.separator_not_le_base (P.trans (greatest d.separator) targetTop) + +noncomputable def allTaskSystem (top : A) (greatest : ∀ x, P.le x top) (Label : Type u) : + TaskSystem P G (a.AllTasks Label) Label where + group := groupDataOfGroup G + action := a.iso + action_one := a.one + action_mul := a.mul + datum := Subtype.val + faithful _ _ eq := Subtype.ext eq + geometry d := d.property.1 + invariant g d := ⟨⟨TaskDatum.transform (a.iso g) d.val, a.eligible_transform g d.val d.property⟩, rfl⟩ + representable d := d.property.2 + top := top + greatest := greatest + source_proper d := a.eligible_source_proper top greatest d.val d.property + +theorem allTaskSystem_complete (top : A) (greatest : ∀ x, P.le x top) + (d : TaskDatum P Label) (eligible : a.Eligible d) : + ∃ i, (a.allTaskSystem top greatest Label).datum i = d := ⟨⟨d, eligible⟩, rfl⟩ + +theorem allTaskSystem_literal (top : A) (greatest : ∀ x, P.le x top) + (i j : a.AllTasks Label) : + (a.allTaskSystem top greatest Label).datum i = (a.allTaskSystem top greatest Label).datum j ↔ + i = j := ⟨Subtype.ext, congrArg Subtype.val⟩ + +def labelledTask (d : TaskDatum P Label) (eligible : a.Eligible d) (label : Label) : a.AllTasks Label := + ⟨{ d with label := label }, + ⟨⟨eligible.1.base_bound, eligible.1.base_onto, eligible.1.base_le_separator, + eligible.1.separator_not_le_base, eligible.1.separator_le_filter⟩, eligible.2⟩⟩ + +theorem labelledTask_label (d : TaskDatum P Label) (eligible : a.Eligible d) (label : Label) : + (a.labelledTask d eligible label).val.label = label := rfl + +theorem labelledTask_injective (d : TaskDatum P Label) (eligible : a.Eligible d) : + Function.Injective (a.labelledTask d eligible) := by + intro i j eq + exact congrArg (fun task : a.AllTasks Label => task.val.label) eq + +end CosetGeometry.OrderAction +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u +structure ActionRectangle {A G : Type u} (P : MeetOrder A) (action : G → MeetIso P P) where + C : A + B : A + D : A + first : G + second : G + C_le_D : P.le C D + B_le_D : P.le B D + agree : ∀ x, P.le x (P.meet C B) → (action first).toFun x = (action second).toFun x + separated : P.meet ((action first).toFun D) ((action second).toFun D) = + (action first).toFun (P.meet C B) + +namespace ActionRectangle +variable {A G : Type u} {P : MeetOrder A} {action : G → MeetIso P P} + +def toInput (r : ActionRectangle P action) (top : A) (greatest : ∀ x, P.le x top) : + Rectangle.Input P where + top := top + greatest := greatest + C := r.C + B := r.B + D := r.D + C_le_D := r.C_le_D + B_le_D := r.B_le_D + g1 := action r.first + g2 := action r.second + agree := r.agree + separated := r.separated + +end ActionRectangle + +namespace CompressionAlgebra +variable {A G Task Label : Type u} {P : MeetOrder A} {f : TaskSystem P G Task Label} + (e : CompressionAlgebra f) + +def liftRectangle (r : ActionRectangle P f.action) : ActionRectangle e.order e.action where + C := e.original.toFun r.C + B := e.original.toFun r.B + D := e.original.toFun r.D + first := r.first + second := r.second + C_le_D := (e.original.le_iff _ _).mpr r.C_le_D + B_le_D := (e.original.le_iff _ _).mpr r.B_le_D + agree x lower := by + rw [← e.original.map_meet] at lower + exact e.agreement r.first r.second (P.meet r.C r.B) r.agree x lower + separated := by + rw [e.action_original, e.action_original, ← e.original.map_meet, r.separated] + rw [← e.original.map_meet, e.action_original] + +end CompressionAlgebra + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/NodeCoding.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/NodeCoding.lean index 715b93f98a9bf9f2ac04f1f6fd78ff9fbfd7a9aa..40805d364fc2ed531d00407eb2e31092dd1be36e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/NodeCoding.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/NodeCoding.lean @@ -1,752 +1,752 @@ -import Lean.Elab.Tactic.Omega -import OAI.SetTheory.PartitionPrinciple.Transfinite.CoherentTower - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -namespace TaskSystem - -universe u - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -def Union : Type u := A ⊕ ((n : Nat) × (f.stages n).batch.Fresh) - -def birth : f.Union → Nat - | .inl _ => 0 - | .inr x => x.1 + 1 - -noncomputable def inclusion : (n : Nat) → f.Point n → f.Union - | 0, x => .inl x - | n + 1, .inl x => inclusion n x - | n + 1, .inr x => .inr ⟨n, x⟩ - -theorem inclusion_step (n : Nat) (x : f.Point n) : - f.inclusion (n + 1) ((f.step n).toFun x) = f.inclusion n x := rfl - -theorem inclusion_birth (n : Nat) (x : f.Point n) : f.birth (f.inclusion n x) ≤ n := by - induction n with - | zero => exact Nat.le_refl 0 - | succ n ih => - cases x with - | inl x => exact Nat.le_trans (ih x) (Nat.le_succ n) - | inr x => exact Nat.le_refl (n + 1) - -theorem inclusion_injective (n : Nat) (x y : f.Point n) - (eq : f.inclusion n x = f.inclusion n y) : x = y := by - induction n with - | zero => exact Sum.inl.inj eq - | succ n ih => - cases x with - | inl x => - cases y with - | inl y => exact congrArg Sum.inl (ih x y eq) - | inr y => - have hb := f.inclusion_birth n x - have he := congrArg f.birth eq - change f.birth (f.inclusion n x) = n + 1 at he - omega - | inr x => - cases y with - | inl y => - have hb := f.inclusion_birth n y - have he := congrArg f.birth eq - change n + 1 = f.birth (f.inclusion n y) at he - omega - | inr y => - have he := Sum.inr.inj eq - have hy : x = y := eq_of_heq (Sigma.mk.inj he).2 - exact congrArg Sum.inr hy - -theorem inclusion_original (n : Nat) (x : A) : - f.inclusion n ((f.origin n).toFun x) = .inl x := by - induction n with - | zero => rfl - | succ n ih => - rw [← f.origins_coherent, f.inclusion_step, ih] - -theorem raise_exists {n m : Nat} (h : n ≤ m) : - ∃ e : MeetEmbedding (f.order n) (f.order m), - ∀ x, f.inclusion m (e.toFun x) = f.inclusion n x := by - induction h with - | refl => exact ⟨(identityIso (f.order n)).toMeetEmbedding, fun _ => rfl⟩ - | @step m h ih => - rcases ih with ⟨e, he⟩ - exact ⟨compose e (f.step m), fun x => (f.inclusion_step m (e.toFun x)).trans (he x)⟩ - -theorem union_cover (x : f.Union) : ∃ (n : Nat) (a : f.Point n), f.inclusion n a = x := by - cases x with - | inl x => exact ⟨0, x, rfl⟩ - | inr x => exact ⟨x.1 + 1, .inr x.2, rfl⟩ - -theorem pair_cover (x y : f.Union) : - ∃ (n : Nat) (a b : f.Point n), f.inclusion n a = x ∧ f.inclusion n b = y := by - rcases f.union_cover x with ⟨n, a, ha⟩ - rcases f.union_cover y with ⟨m, b, hb⟩ - rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ - rcases f.raise_exists (Nat.le_max_right n m) with ⟨d, hd⟩ - exact ⟨max n m, e.toFun a, d.toFun b, (he a).trans ha, (hd b).trans hb⟩ - -def UnionLe (x y : f.Union) : Prop := - ∃ (n : Nat) (a b : f.Point n), f.inclusion n a = x ∧ f.inclusion n b = y ∧ (f.order n).le a b - -theorem union_le_stage (n : Nat) (a b : f.Point n) : - f.UnionLe (f.inclusion n a) (f.inclusion n b) ↔ (f.order n).le a b := by - constructor - · rintro ⟨m, x, y, hx, hy, hxy⟩ - rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ - rcases f.raise_exists (Nat.le_max_right n m) with ⟨d, hd⟩ - have ex : d.toFun x = e.toFun a := f.inclusion_injective _ _ _ ((hd x).trans (hx.trans (he a).symm)) - have ey : d.toFun y = e.toFun b := f.inclusion_injective _ _ _ ((hd y).trans (hy.trans (he b).symm)) - have h := (d.le_iff _ _).mpr hxy - rw [ex, ey] at h - exact (e.le_iff _ _).mp h - · intro h - exact ⟨n, a, b, rfl, rfl, h⟩ - -theorem union_le_refl (x : f.Union) : f.UnionLe x x := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - exact (f.union_le_stage n a a).mpr ((f.order n).refl a) - -theorem union_le_trans {x y z : f.Union} (hxy : f.UnionLe x y) (hyz : f.UnionLe y z) : - f.UnionLe x z := by - rcases hxy with ⟨n, a, b, ha, hb, hab⟩ - rcases hyz with ⟨m, c, d, hc, hd, hcd⟩ - rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ - rcases f.raise_exists (Nat.le_max_right n m) with ⟨q, hq⟩ - have middle : e.toFun b = q.toFun c := - f.inclusion_injective _ _ _ ((he b).trans (hb.trans (hc.symm.trans (hq c).symm))) - have lower := (e.le_iff _ _).mpr hab - rw [middle] at lower - exact ⟨max n m, e.toFun a, q.toFun d, (he a).trans ha, (hq d).trans hd, - (f.order _).trans lower ((q.le_iff _ _).mpr hcd)⟩ - -theorem union_le_antisymm {x y : f.Union} (hxy : f.UnionLe x y) (hyx : f.UnionLe y x) : x = y := by - rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - exact congrArg (f.inclusion n) ((f.order n).antisymm - ((f.union_le_stage n a b).mp hxy) ((f.union_le_stage n b a).mp hyx)) - -theorem union_le_meet_stage (n : Nat) (a b : f.Point n) (z : f.Union) - (hza : f.UnionLe z (f.inclusion n a)) (hzb : f.UnionLe z (f.inclusion n b)) : - f.UnionLe z (f.inclusion n ((f.order n).meet a b)) := by - rcases f.union_cover z with ⟨m, c, rfl⟩ - rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ - rcases f.raise_exists (Nat.le_max_right n m) with ⟨q, hq⟩ - have ha : f.UnionLe (f.inclusion (max n m) (q.toFun c)) (f.inclusion (max n m) (e.toFun a)) := by - rw [hq, he] - exact hza - have hb : f.UnionLe (f.inclusion (max n m) (q.toFun c)) (f.inclusion (max n m) (e.toFun b)) := by - rw [hq, he] - exact hzb - have lower := (f.order (max n m)).le_meet - ((f.union_le_stage _ _ _).mp ha) ((f.union_le_stage _ _ _).mp hb) - rw [← e.map_meet] at lower - have result := (f.union_le_stage _ _ _).mpr lower - rw [hq, he] at result - exact result - -theorem union_meet_exists (x y : f.Union) : - ∃ m, f.UnionLe m x ∧ f.UnionLe m y ∧ - ∀ z, f.UnionLe z x → f.UnionLe z y → f.UnionLe z m := by - rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - exact ⟨f.inclusion n ((f.order n).meet a b), - (f.union_le_stage _ _ _).mpr ((f.order n).meet_le_left a b), - (f.union_le_stage _ _ _).mpr ((f.order n).meet_le_right a b), - f.union_le_meet_stage n a b⟩ - -noncomputable def unionMeet (x y : f.Union) : f.Union := Classical.choose (f.union_meet_exists x y) - -noncomputable def unionOrder : MeetOrder f.Union where - le := f.UnionLe - meet := f.unionMeet - refl := f.union_le_refl - trans := f.union_le_trans - antisymm := f.union_le_antisymm - meet_le_left x y := (Classical.choose_spec (f.union_meet_exists x y)).1 - meet_le_right x y := (Classical.choose_spec (f.union_meet_exists x y)).2.1 - le_meet {z x y} := (Classical.choose_spec (f.union_meet_exists x y)).2.2 z - -noncomputable def inclusionEmbedding (n : Nat) : MeetEmbedding (f.order n) f.unionOrder where - toFun := f.inclusion n - le_iff := f.union_le_stage n - map_meet a b := by - apply f.unionOrder.antisymm - · exact f.unionOrder.le_meet - ((f.union_le_stage n _ _).mpr ((f.order n).meet_le_left a b)) - ((f.union_le_stage n _ _).mpr ((f.order n).meet_le_right a b)) - · exact f.union_le_meet_stage n a b _ - (f.unionOrder.meet_le_left _ _) (f.unionOrder.meet_le_right _ _) - -noncomputable def originalEmbedding : MeetEmbedding P f.unionOrder := - compose (f.origin 0) (f.inclusionEmbedding 0) - -theorem union_top (x : f.Union) : f.unionOrder.le x (.inl f.top) := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - rw [← f.inclusion_original n f.top] - exact (f.union_le_stage n _ _).mpr ((f.stages n).top a) - -theorem union_bottom (zero : A) (bottom : ∀ x, P.le zero x) (x : f.Union) : - f.unionOrder.le (.inl zero) x := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - rw [← f.inclusion_original n zero] - exact (f.union_le_stage n _ _).mpr (f.stage_bottom n zero bottom a) - - - - - - - -noncomputable def unionCompression (i : Task) : f.Union → f.Union - | .inl x => f.inclusion 1 ((f.compression 0 i).toFun x) - | .inr ⟨n, x⟩ => f.inclusion (n + 2) ((f.compression (n + 1) i).toFun (.inr x)) - -theorem unionCompression_inclusion (i : Task) (n : Nat) (x : f.Point n) : - f.unionCompression i (f.inclusion n x) = - f.inclusion (n + 1) ((f.compression n i).toFun x) := by - induction n with - | zero => rfl - | succ n ih => - cases x with - | inl x => - change f.unionCompression i (f.inclusion n x) = - f.inclusion (n + 2) ((f.compression (n + 1) i).toFun ((f.step n).toFun x)) - exact (ih x).trans (congrArg (f.inclusion (n + 2)) (f.maps_coherent n i x)) - | inr x => rfl - -noncomputable def unionAction (g : G) : f.Union → f.Union - | .inl x => .inl ((f.action g).toFun x) - | .inr ⟨n, x⟩ => f.inclusion (n + 1) ((f.stageAction (n + 1) g).toFun (.inr x)) - -theorem unionAction_inclusion (g : G) (n : Nat) (x : f.Point n) : - f.unionAction g (f.inclusion n x) = f.inclusion n ((f.stageAction n g).toFun x) := by - induction n with - | zero => rfl - | succ n ih => - cases x with - | inl x => - change f.unionAction g (f.inclusion n x) = - f.inclusion (n + 1) ((f.stageAction (n + 1) g).toFun ((f.step n).toFun x)) - exact (ih x).trans (congrArg (f.inclusion (n + 1)) (f.actions_coherent n g x)) - | inr x => rfl - -theorem unionAction_one (x : f.Union) : f.unionAction f.group.one x = x := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - rw [f.unionAction_inclusion, f.stageAction_one] - -theorem unionAction_mul (g h : G) (x : f.Union) : - f.unionAction (f.group.mul g h) x = f.unionAction g (f.unionAction h x) := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - simp only [f.unionAction_inclusion, f.stageAction_mul] - -theorem unionAction_left (g : G) (x : f.Union) : - f.unionAction (f.group.inv g) (f.unionAction g x) = x := by - rw [← f.unionAction_mul, f.group.inv_mul, f.unionAction_one] - -theorem unionAction_right (g : G) (x : f.Union) : - f.unionAction g (f.unionAction (f.group.inv g) x) = x := by - rw [← f.unionAction_mul, f.group.mul_inv, f.unionAction_one] - -theorem unionAction_order (g : G) (x y : f.Union) : - f.unionOrder.le (f.unionAction g x) (f.unionAction g y) ↔ f.unionOrder.le x y := by - rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - rw [f.unionAction_inclusion, f.unionAction_inclusion] - exact ((f.inclusionEmbedding n).le_iff _ _).trans - (((f.stageAction n g).le_iff a b).trans ((f.inclusionEmbedding n).le_iff a b).symm) - -noncomputable def unionAutomorphism (g : G) : MeetIso f.unionOrder f.unionOrder := - isoOfOrder (f.unionAction g) (f.unionAction (f.group.inv g)) - (f.unionAction_left g) (f.unionAction_right g) (f.unionAction_order g) - -theorem unionCompression_order (i : Task) (x y : f.Union) : - f.unionOrder.le (f.unionCompression i x) (f.unionCompression i y) ↔ f.unionOrder.le x y := by - rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - rw [f.unionCompression_inclusion, f.unionCompression_inclusion] - exact ((f.inclusionEmbedding (n + 1)).le_iff _ _).trans - (((f.compression n i).le_iff a b).trans ((f.inclusionEmbedding n).le_iff a b).symm) - -theorem unionCompression_meet (i : Task) (x y : f.Union) : - f.unionCompression i (f.unionOrder.meet x y) = - f.unionOrder.meet (f.unionCompression i x) (f.unionCompression i y) := by - rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - rw [f.unionCompression_inclusion i n a, f.unionCompression_inclusion i n b] - calc - f.unionCompression i (f.unionOrder.meet (f.inclusion n a) (f.inclusion n b)) = - f.unionCompression i (f.inclusion n ((f.order n).meet a b)) := - congrArg (f.unionCompression i) ((f.inclusionEmbedding n).map_meet a b).symm - _ = f.inclusion (n + 1) ((f.compression n i).toFun ((f.order n).meet a b)) := - f.unionCompression_inclusion i n _ - _ = f.inclusion (n + 1) ((f.order (n + 1)).meet - ((f.compression n i).toFun a) ((f.compression n i).toFun b)) := - congrArg (f.inclusion (n + 1)) ((f.compression n i).map_meet a b) - _ = _ := (f.inclusionEmbedding (n + 1)).map_meet _ _ - -noncomputable def unionCompressionEmbedding (i : Task) : MeetEmbedding f.unionOrder f.unionOrder where - toFun := f.unionCompression i - le_iff := f.unionCompression_order i - map_meet := f.unionCompression_meet i - -theorem union_equivariant (g : G) (i : Task) (x : f.Union) : - (f.unionAutomorphism g).toFun (f.unionCompression i x) = - f.unionCompression (f.perm g i) x := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - change f.unionAction g (f.unionCompression i (f.inclusion n a)) = _ - rw [f.unionCompression_inclusion, f.unionAction_inclusion, f.stage_equivariant, - f.unionCompression_inclusion] - -theorem union_agreement (g h : G) (v : A) - (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) - (x : f.Union) (below : f.unionOrder.le x (.inl v)) : - (f.unionAutomorphism g).toFun x = (f.unionAutomorphism h).toFun x := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - rw [← f.inclusion_original n v] at below - have finite := ((f.inclusionEmbedding n).le_iff _ _).mp below - change f.unionAction g (f.inclusion n a) = f.unionAction h (f.inclusion n a) - rw [f.unionAction_inclusion, f.unionAction_inclusion, f.stage_agreement n g h v agree a finite] - -noncomputable def unionCap (i : Task) : f.Union := f.unionCompression i (.inl f.top) - -theorem unionCap_stage (n : Nat) (i : Task) : - f.inclusion (n + 1) (f.cap n i) = f.unionCap i := by - change f.inclusion (n + 1) ((f.compression n i).toFun ((f.origin n).toFun f.top)) = _ - rw [← f.unionCompression_inclusion, f.inclusion_original] - rfl - -theorem union_range_below_cap (i : Task) (x : f.Union) : - f.unionOrder.le (f.unionCompression i x) (f.unionCap i) := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - rw [f.unionCompression_inclusion, ← f.unionCap_stage n i] - exact ((f.inclusionEmbedding (n + 1)).le_iff _ _).mpr (f.range_below_cap n i a) - -theorem union_base_agreement (i : Task) (x : f.Union) - (below : f.unionOrder.le x (.inl (f.datum i).source)) : - f.unionCompression i x = (f.unionAutomorphism (f.representative i)).toFun x := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - rw [← f.inclusion_original n (f.datum i).source] at below - have finite := ((f.inclusionEmbedding n).le_iff _ _).mp below - change f.unionCompression i (f.inclusion n a) = f.unionAction (f.representative i) (f.inclusion n a) - rw [f.unionCompression_inclusion, f.stage_base_agreement n i a finite, - f.inclusion_step, f.unionAction_inclusion] - -theorem union_action_source (i : Task) : - (f.unionAutomorphism (f.representative i)).toFun (.inl (f.datum i).source) = - .inl (f.datum i).target := - congrArg Sum.inl (f.representative_target i) - -theorem union_maps_base (i : Task) : - f.unionCompression i (.inl (f.datum i).source) = .inl (f.datum i).target := - (f.union_base_agreement i _ (f.unionOrder.refl _)).trans (f.union_action_source i) - - - - - - - -def UnionOriginal (x : f.Union) : Prop := ∃ a : A, Sum.inl a = x - -theorem union_cap_separation (i j : Task) (different : i ≠ j) : - f.unionOrder.le (f.unionCap i) (.inl (f.datum j).target) ∨ - f.unionOrder.le (f.unionCap j) (.inl (f.datum i).target) ∨ - f.unionOrder.meet (f.unionCap i) (f.unionCap j) = - f.unionOrder.meet (.inl (f.datum i).target) (.inl (f.datum j).target) := by - rcases f.cap_separation 0 i j different with h | h | h - · have result := ((f.inclusionEmbedding 1).le_iff _ _).mpr h - change f.unionOrder.le (f.inclusion 1 (f.cap 0 i)) - (f.inclusion 1 ((f.origin 1).toFun (f.datum j).target)) at result - rw [f.unionCap_stage, f.inclusion_original] at result - exact Or.inl result - · have result := ((f.inclusionEmbedding 1).le_iff _ _).mpr h - change f.unionOrder.le (f.inclusion 1 (f.cap 0 j)) - (f.inclusion 1 ((f.origin 1).toFun (f.datum i).target)) at result - rw [f.unionCap_stage, f.inclusion_original] at result - exact Or.inr (Or.inl result) - · have result := congrArg (f.inclusionEmbedding 1).toFun h - rw [(f.inclusionEmbedding 1).map_meet, (f.inclusionEmbedding 1).map_meet] at result - change f.unionOrder.meet (f.inclusion 1 (f.cap 0 i)) (f.inclusion 1 (f.cap 0 j)) = - f.unionOrder.meet (f.inclusion 1 ((f.origin 1).toFun (f.datum i).target)) - (f.inclusion 1 ((f.origin 1).toFun (f.datum j).target)) at result - rw [f.unionCap_stage, f.unionCap_stage, f.inclusion_original, f.inclusion_original] at result - exact Or.inr (Or.inr result) - -theorem union_original_below_cap (i : Task) (v : A) : - f.unionOrder.le (.inl v) (f.unionCap i) ↔ P.le v (f.datum i).target := by - rw [← f.unionCap_stage 0 i, ← f.inclusion_original 1 v] - exact ((f.inclusionEmbedding 1).le_iff _ _).trans (f.original_below_cap 0 i v) - -theorem union_cap_strict (i : Task) : - f.unionOrder.le (.inl (f.datum i).target) (f.unionCap i) ∧ - ¬ f.unionOrder.le (f.unionCap i) (.inl (f.datum i).target) := by - constructor - · exact (f.union_original_below_cap i _).mpr (P.refl _) - · intro h - rw [← f.union_maps_base i] at h - have lower := (f.unionCompression_order i (.inl f.top) (.inl (f.datum i).source)).mp h - exact f.source_proper i ((f.originalEmbedding.le_iff _ _).mp lower) - -theorem union_separator_not_below_cap (i : Task) : - ¬ f.unionOrder.le (.inl (f.datum i).separator) (f.unionCap i) := - fun h => (f.geometry i).separator_not_le_base ((f.union_original_below_cap i _).mp h) - -theorem union_original_shadow (i : Task) (x : f.Union) (original : f.UnionOriginal x) - (below : f.unionOrder.le x (f.unionCap i)) : - f.unionOrder.le x (.inl (f.datum i).target) := by - rcases original with ⟨v, rfl⟩ - exact (f.originalEmbedding.le_iff _ _).mpr ((f.union_original_below_cap i v).mp below) - -theorem union_accounting (x : f.Union) : - f.UnionOriginal x ∨ ∃ i y, f.unionCompression i y = x ∧ - f.unionOrder.le x (f.unionCap i) ∧ ¬ f.unionOrder.le x (.inl (f.datum i).target) := by - cases x with - | inl a => exact Or.inl ⟨a, rfl⟩ - | inr x => - rcases x with ⟨n, z⟩ - rcases f.stage_fresh_accounting n z with ⟨i, y, image, lower, outside⟩ - have image' : f.unionCompression i (f.inclusion n y) = .inr ⟨n, z⟩ := - (f.unionCompression_inclusion i n y).trans (congrArg (f.inclusion (n + 1)) image) - refine Or.inr ⟨i, f.inclusion n y, image', ?_, ?_⟩ - · have result := ((f.inclusionEmbedding (n + 1)).le_iff _ _).mpr lower - change f.unionOrder.le (.inr ⟨n, z⟩) (f.inclusion (n + 1) (f.cap n i)) at result - rw [f.unionCap_stage] at result - exact result - · intro h - have h' : f.unionOrder.le (f.inclusion (n + 1) (.inr z)) - (f.inclusion (n + 1) ((f.origin (n + 1)).toFun (f.datum i).target)) := by - rw [f.inclusion_original] - exact h - exact outside (((f.inclusionEmbedding (n + 1)).le_iff _ _).mp h') - -theorem union_base_filled (i : Task) (x : f.Union) - (below : f.unionOrder.le x (.inl (f.datum i).target)) : - ∃ y, f.unionCompression i y = x := by - have filled := base_ideal_filled f.unionOrder (f.unionCompression i) - (f.unionAutomorphism (f.representative i)) (.inl (f.datum i).source) - (f.union_base_agreement i) x - rw [f.union_action_source] at filled - exact filled below - -theorem union_surjective_ideal (i : Task) (x : f.Union) - (below : f.unionOrder.le x (f.unionCap i)) : ∃ y, f.unionCompression i y = x := - range_completion_from_accounting f.unionOrder f.UnionOriginal - (fun i => .inl (f.datum i).target) f.unionCap f.unionCompression - f.union_base_filled f.union_original_shadow f.union_cap_separation f.union_accounting i x below - -noncomputable def unionCompressionIso (i : Task) : - MeetIso f.unionOrder (Attachment.idealOrder f.unionOrder (f.unionCap i)) := - isoOntoIdeal f.unionOrder (f.unionCompressionEmbedding i) (f.unionCap i) - (f.union_range_below_cap i) (f.union_surjective_ideal i) - -theorem unionCompressionIso_value (i : Task) (x : f.Union) : - ((f.unionCompressionIso i).toFun x).val = f.unionCompression i x := rfl - -end TaskSystem - - - -section - -universe u - -def imageFamily {A B : Type u} {P : MeetOrder A} {Q : MeetOrder B} - (e : MeetEmbedding P Q) (F : A → Prop) (x : B) : Prop := - ∃ a, F a ∧ e.toFun a = x - -theorem positive_imageFamily {A B : Type u} {P : MeetOrder A} {Q : MeetOrder B} - (e : MeetEmbedding P Q) (F : A → Prop) (x : B) : - Positive Q (imageFamily e F) x ↔ PositiveOver e F x := by - constructor - · rintro ⟨y, ⟨a, ha, rfl⟩, hy⟩ - exact ⟨a, ha, hy⟩ - · rintro ⟨a, ha, hy⟩ - exact ⟨e.toFun a, ⟨a, ha, rfl⟩, hy⟩ - -theorem positiveOver_imageFamily {A B C : Type u} - {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} - (e : MeetEmbedding P Q) (j : MeetEmbedding Q R) (F : A → Prop) (x : C) : - PositiveOver j (imageFamily e F) x ↔ PositiveOver (compose e j) F x := by - constructor - · rintro ⟨y, ⟨a, ha, rfl⟩, hy⟩ - exact ⟨a, ha, hy⟩ - · rintro ⟨a, ha, hy⟩ - exact ⟨e.toFun a, ⟨a, ha, rfl⟩, hy⟩ - -namespace TaskSystem - -open Attachment - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -def StageProfile (n : Nat) (i : Task) : Prop := - ∀ x : f.Point (n + 1), (f.order (n + 1)).le ((f.origin (n + 1)).toFun (f.datum i).separator) x → - (PositiveOver (f.origin (n + 1)) (f.datum i).filter.mem x → (f.order (n + 1)).le (f.cap n i) x) ∧ - (¬ PositiveOver (f.origin (n + 1)) (f.datum i).filter.mem x → - (f.order (n + 1)).meet (f.cap n i) x = (f.origin (n + 1)).toFun (f.datum i).target) - -theorem first_stage_profile (i : Task) : f.StageProfile 0 i := by - have profile := f.initial.copy_initial_profile f.top f.greatest f.source_proper i - change Profile (f.order 1) (.inl ((f.action (f.representative i)).toFun (f.datum i).source)) - (.inl (f.datum i).separator) (f.cap 0 i) (f.initial.batch.originalFamily i) at profile - rw [f.representative_target] at profile - intro x above - have positive : Positive (f.order 1) (f.initial.batch.originalFamily i) x ↔ - PositiveOver (f.origin 1) (f.datum i).filter.mem x := by - constructor - · rintro ⟨y, hy, hxy⟩ - cases y with - | inl y => exact ⟨y, hy, hxy⟩ - | inr y => exact False.elim hy - · rintro ⟨y, hy, hxy⟩ - exact ⟨.inl y, hy, hxy⟩ - exact ⟨fun h => (profile x above).1 (positive.mpr h), - fun h => (profile x above).2 (fun hp => h (positive.mp hp))⟩ - -theorem stage_profile (n : Nat) (i : Task) : f.StageProfile n i := by - induction n with - | zero => exact f.first_stage_profile i - | succ n ih => - have old : Profile (f.order (n + 1)) ((f.origin (n + 1)).toFun (f.datum i).target) - ((f.origin (n + 1)).toFun (f.datum i).separator) (f.cap n i) - (imageFamily (f.origin (n + 1)) (f.datum i).filter.mem) := by - intro x above - exact ⟨fun h => (ih x above).1 ((positive_imageFamily _ _ x).mp h), - fun h => (ih x above).2 (fun hp => h ((positive_imageFamily _ _ x).mpr hp))⟩ - have nonempty : ∃ x, imageFamily (f.origin (n + 1)) (f.datum i).filter.mem x := by - rcases (f.datum i).filter.nonempty with ⟨a, ha⟩ - exact ⟨(f.origin (n + 1)).toFun a, a, ha, rfl⟩ - have permitted : PermittedExtension (f.step (n + 1)) := - Attachment.permitted_extension (f.stages (n + 1)).batch.data - (f.stages (n + 1)).batch.component_meets - have persisted := profile_persists_one_step (f.step (n + 1)) - ((f.origin (n + 1)).toFun (f.datum i).target) - ((f.origin (n + 1)).toFun (f.datum i).separator) (f.cap n i) - (imageFamily (f.origin (n + 1)) (f.datum i).filter.mem) nonempty old - (f.separator_not_below_cap n i) permitted - intro x above - have above' : (f.order (n + 2)).le - ((f.step (n + 1)).toFun ((f.origin (n + 1)).toFun (f.datum i).separator)) x := by - rw [f.origins_coherent] - exact above - have result := persisted x above' - rw [f.caps_coherent, f.origins_coherent] at result - have positive := positiveOver_imageFamily (f.origin (n + 1)) (f.step (n + 1)) - (f.datum i).filter.mem x - exact ⟨fun h => result.1 (positive.mpr h), - fun h => result.2 (fun hp => h (positive.mp hp))⟩ - -theorem union_positive_stage (i : Task) (n : Nat) (x : f.Point n) : - (∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) (f.inclusion n x)) ↔ - PositiveOver (f.origin n) (f.datum i).filter.mem x := by - constructor - · rintro ⟨a, ha, hax⟩ - rw [← f.inclusion_original n a] at hax - exact ⟨a, ha, ((f.inclusionEmbedding n).le_iff _ _).mp hax⟩ - · rintro ⟨a, ha, hax⟩ - refine ⟨a, ha, ?_⟩ - rw [← f.inclusion_original n a] - exact ((f.inclusionEmbedding n).le_iff _ _).mpr hax - -theorem union_profile_at_stage (i : Task) (n : Nat) (x : f.Point (n + 1)) - (above : f.unionOrder.le (.inl (f.datum i).separator) (f.inclusion (n + 1) x)) : - ((∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) (f.inclusion (n + 1) x)) → - f.unionOrder.le (f.unionCap i) (f.inclusion (n + 1) x)) ∧ - ((¬ ∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) (f.inclusion (n + 1) x)) → - f.unionOrder.meet (f.unionCap i) (f.inclusion (n + 1) x) = .inl (f.datum i).target) := by - rw [← f.inclusion_original (n + 1) (f.datum i).separator] at above - have finite := ((f.inclusionEmbedding (n + 1)).le_iff ((f.origin (n + 1)).toFun (f.datum i).separator) x).mp above - have profile := f.stage_profile n i x finite - constructor - · intro h - have lower := profile.1 ((f.union_positive_stage i (n + 1) x).mp h) - have result := ((f.inclusionEmbedding (n + 1)).le_iff _ _).mpr lower - change f.unionOrder.le (f.inclusion (n + 1) (f.cap n i)) (f.inclusion (n + 1) x) at result - rw [f.unionCap_stage] at result - exact result - · intro h - have meet := profile.2 (fun hp => h ((f.union_positive_stage i (n + 1) x).mpr hp)) - have result := congrArg (f.inclusionEmbedding (n + 1)).toFun meet - rw [(f.inclusionEmbedding (n + 1)).map_meet] at result - change f.unionOrder.meet (f.inclusion (n + 1) (f.cap n i)) (f.inclusion (n + 1) x) = - f.inclusion (n + 1) ((f.origin (n + 1)).toFun (f.datum i).target) at result - rw [f.unionCap_stage, f.inclusion_original] at result - exact result - -theorem union_profile (i : Task) (x : f.Union) - (above : f.unionOrder.le (.inl (f.datum i).separator) x) : - ((∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) x) → - f.unionOrder.le (f.unionCap i) x) ∧ - ((¬ ∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) x) → - f.unionOrder.meet (f.unionCap i) x = .inl (f.datum i).target) := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - exact f.union_profile_at_stage i n ((f.step n).toFun a) above - -end TaskSystem - - - - - -structure CompressionAlgebra {A G Task Label : Type u} {P : MeetOrder A} - (f : TaskSystem P G Task Label) where - Space : Type u - order : MeetOrder Space - original : MeetEmbedding P order - cap : Task → Space - action : G → MeetIso order order - compress : ∀ i, MeetIso order (Attachment.idealOrder order (cap i)) - top : ∀ x, order.le x (original.toFun f.top) - bottom : ∀ zero, (∀ x, P.le zero x) → ∀ x, order.le (original.toFun zero) x - action_one : ∀ x, (action f.group.one).toFun x = x - action_mul : ∀ g h x, (action (f.group.mul g h)).toFun x = - (action g).toFun ((action h).toFun x) - action_original : ∀ g x, (action g).toFun (original.toFun x) = - original.toFun ((f.action g).toFun x) - strict : ∀ i, order.le (original.toFun (f.datum i).target) (cap i) ∧ - ¬ order.le (cap i) (original.toFun (f.datum i).target) - separator : ∀ i, ¬ order.le (original.toFun (f.datum i).separator) (cap i) - base_agreement : ∀ i x, order.le x (original.toFun (f.datum i).source) → - ((compress i).toFun x).val = (action (f.representative i)).toFun x - equivariant : ∀ g i x, (action g).toFun ((compress i).toFun x).val = - ((compress (f.perm g i)).toFun x).val - agreement : ∀ g h v, - (∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) → - ∀ x, order.le x (original.toFun v) → (action g).toFun x = (action h).toFun x - separation : ∀ i j, i ≠ j → - order.le (cap i) (original.toFun (f.datum j).target) ∨ - order.le (cap j) (original.toFun (f.datum i).target) ∨ - order.meet (cap i) (cap j) = - order.meet (original.toFun (f.datum i).target) (original.toFun (f.datum j).target) - profile : ∀ i x, order.le (original.toFun (f.datum i).separator) x → - ((∃ a, (f.datum i).filter.mem a ∧ order.le (original.toFun a) x) → order.le (cap i) x) ∧ - ((¬ ∃ a, (f.datum i).filter.mem a ∧ order.le (original.toFun a) x) → - order.meet (cap i) x = original.toFun (f.datum i).target) - -namespace TaskSystem - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -noncomputable def compressionAlgebra : CompressionAlgebra f where - Space := f.Union - order := f.unionOrder - original := f.originalEmbedding - cap := f.unionCap - action := f.unionAutomorphism - compress := f.unionCompressionIso - top := f.union_top - bottom := f.union_bottom - action_one := f.unionAction_one - action_mul := f.unionAction_mul - action_original _ _ := rfl - strict := f.union_cap_strict - separator := f.union_separator_not_below_cap - base_agreement := f.union_base_agreement - equivariant := f.union_equivariant - agreement := f.union_agreement - separation := f.union_cap_separation - profile := f.union_profile - -theorem union_equal_base_caps (i j : Task) (different : i ≠ j) - (same_base : (f.datum i).target = (f.datum j).target) : - f.unionOrder.meet (f.unionCap i) (f.unionCap j) = .inl (f.datum i).target := by - rcases f.union_cap_separation i j different with h | h | h - · rw [← same_base] at h - exact False.elim ((f.union_cap_strict i).2 h) - · rw [same_base] at h - exact False.elim ((f.union_cap_strict j).2 h) - · rw [← same_base] at h - exact h.trans (meet_eq_left_of_le f.unionOrder (f.unionOrder.refl _)) - -end TaskSystem -end - - - -namespace TaskSystem - -universe u v - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -noncomputable def componentWord : (n : Nat) → (f.stages n).Components → List Task - | 0, i => [i] - | n + 1, i => i.1 :: componentWord n i.2.val - -theorem componentWord_length (n : Nat) (i : (f.stages n).Components) : - (f.componentWord n i).length = n + 1 := by - induction n with - | zero => rfl - | succ n ih => - change (i.1 :: f.componentWord n i.2.val).length = n + 1 + 1 - rw [List.length_cons, ih] - -theorem componentWord_injective (n : Nat) (i j : (f.stages n).Components) - (eq : f.componentWord n i = f.componentWord n j) : i = j := by - induction n with - | zero => exact (List.cons.inj eq).1 - | succ n ih => - rcases i with ⟨i, ⟨h, hi⟩⟩ - rcases j with ⟨j, ⟨k, hj⟩⟩ - have head := (List.cons.inj eq).1 - have tail := ih h k (List.cons.inj eq).2 - cases head - cases tail - rfl - -noncomputable def templateOriginal : (n : Nat) → (i : (f.stages n).Components) → - MeetIso ((f.stages n).batch.order i) P - | 0, _ => identityIso P - | n + 1, i => templateOriginal n i.2.val - -noncomputable def nodeCode : f.Union → List Task × A - | .inl a => ([], a) - | .inr ⟨n, x⟩ => (f.componentWord n x.1, (f.templateOriginal n x.1).toFun x.2.val) - -theorem nodeCode_injective (x y : f.Union) (eq : f.nodeCode x = f.nodeCode y) : x = y := by - cases x with - | inl a => - cases y with - | inl b => exact congrArg Sum.inl (congrArg Prod.snd eq) - | inr y => - rcases y with ⟨n, h, y, hy⟩ - have length := congrArg (fun c : List Task × A => c.1.length) eq - change 0 = (f.componentWord n h).length at length - rw [f.componentWord_length] at length - omega - | inr x => - cases y with - | inl b => - rcases x with ⟨n, h, x, hx⟩ - have length := congrArg (fun c : List Task × A => c.1.length) eq - change (f.componentWord n h).length = 0 at length - rw [f.componentWord_length] at length - omega - | inr y => - rcases x with ⟨n, h, x, hx⟩ - rcases y with ⟨m, k, y, hy⟩ - have length := congrArg (fun c : List Task × A => c.1.length) eq - change (f.componentWord n h).length = (f.componentWord m k).length at length - rw [f.componentWord_length, f.componentWord_length] at length - have sameStage : n = m := by omega - cases sameStage - have sameComponent : h = k := f.componentWord_injective n h k (congrArg Prod.fst eq) - cases sameComponent - have sameNode : x = y := embedding_injective (f.templateOriginal n h).toMeetEmbedding - (congrArg Prod.snd eq) - cases sameNode - rfl - -theorem union_coding_bound : ∃ code : f.Union → List Task × A, - ∀ x y, code x = code y → x = y := - ⟨f.nodeCode, f.nodeCode_injective⟩ - -theorem union_size_transfer {B : Type v} (pack : List Task × A → B) - (injective : ∀ x y, pack x = pack y → x = y) : - ∃ code : f.Union → B, ∀ x y, code x = code y → x = y := - ⟨fun x => pack (f.nodeCode x), fun x y eq => f.nodeCode_injective x y (injective _ _ eq)⟩ - -end TaskSystem - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import Lean.Elab.Tactic.Omega +import OAI.SetTheory.PartitionPrinciple.Transfinite.CoherentTower + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +namespace TaskSystem + +universe u + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +def Union : Type u := A ⊕ ((n : Nat) × (f.stages n).batch.Fresh) + +def birth : f.Union → Nat + | .inl _ => 0 + | .inr x => x.1 + 1 + +noncomputable def inclusion : (n : Nat) → f.Point n → f.Union + | 0, x => .inl x + | n + 1, .inl x => inclusion n x + | n + 1, .inr x => .inr ⟨n, x⟩ + +theorem inclusion_step (n : Nat) (x : f.Point n) : + f.inclusion (n + 1) ((f.step n).toFun x) = f.inclusion n x := rfl + +theorem inclusion_birth (n : Nat) (x : f.Point n) : f.birth (f.inclusion n x) ≤ n := by + induction n with + | zero => exact Nat.le_refl 0 + | succ n ih => + cases x with + | inl x => exact Nat.le_trans (ih x) (Nat.le_succ n) + | inr x => exact Nat.le_refl (n + 1) + +theorem inclusion_injective (n : Nat) (x y : f.Point n) + (eq : f.inclusion n x = f.inclusion n y) : x = y := by + induction n with + | zero => exact Sum.inl.inj eq + | succ n ih => + cases x with + | inl x => + cases y with + | inl y => exact congrArg Sum.inl (ih x y eq) + | inr y => + have hb := f.inclusion_birth n x + have he := congrArg f.birth eq + change f.birth (f.inclusion n x) = n + 1 at he + omega + | inr x => + cases y with + | inl y => + have hb := f.inclusion_birth n y + have he := congrArg f.birth eq + change n + 1 = f.birth (f.inclusion n y) at he + omega + | inr y => + have he := Sum.inr.inj eq + have hy : x = y := eq_of_heq (Sigma.mk.inj he).2 + exact congrArg Sum.inr hy + +theorem inclusion_original (n : Nat) (x : A) : + f.inclusion n ((f.origin n).toFun x) = .inl x := by + induction n with + | zero => rfl + | succ n ih => + rw [← f.origins_coherent, f.inclusion_step, ih] + +theorem raise_exists {n m : Nat} (h : n ≤ m) : + ∃ e : MeetEmbedding (f.order n) (f.order m), + ∀ x, f.inclusion m (e.toFun x) = f.inclusion n x := by + induction h with + | refl => exact ⟨(identityIso (f.order n)).toMeetEmbedding, fun _ => rfl⟩ + | @step m h ih => + rcases ih with ⟨e, he⟩ + exact ⟨compose e (f.step m), fun x => (f.inclusion_step m (e.toFun x)).trans (he x)⟩ + +theorem union_cover (x : f.Union) : ∃ (n : Nat) (a : f.Point n), f.inclusion n a = x := by + cases x with + | inl x => exact ⟨0, x, rfl⟩ + | inr x => exact ⟨x.1 + 1, .inr x.2, rfl⟩ + +theorem pair_cover (x y : f.Union) : + ∃ (n : Nat) (a b : f.Point n), f.inclusion n a = x ∧ f.inclusion n b = y := by + rcases f.union_cover x with ⟨n, a, ha⟩ + rcases f.union_cover y with ⟨m, b, hb⟩ + rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ + rcases f.raise_exists (Nat.le_max_right n m) with ⟨d, hd⟩ + exact ⟨max n m, e.toFun a, d.toFun b, (he a).trans ha, (hd b).trans hb⟩ + +def UnionLe (x y : f.Union) : Prop := + ∃ (n : Nat) (a b : f.Point n), f.inclusion n a = x ∧ f.inclusion n b = y ∧ (f.order n).le a b + +theorem union_le_stage (n : Nat) (a b : f.Point n) : + f.UnionLe (f.inclusion n a) (f.inclusion n b) ↔ (f.order n).le a b := by + constructor + · rintro ⟨m, x, y, hx, hy, hxy⟩ + rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ + rcases f.raise_exists (Nat.le_max_right n m) with ⟨d, hd⟩ + have ex : d.toFun x = e.toFun a := f.inclusion_injective _ _ _ ((hd x).trans (hx.trans (he a).symm)) + have ey : d.toFun y = e.toFun b := f.inclusion_injective _ _ _ ((hd y).trans (hy.trans (he b).symm)) + have h := (d.le_iff _ _).mpr hxy + rw [ex, ey] at h + exact (e.le_iff _ _).mp h + · intro h + exact ⟨n, a, b, rfl, rfl, h⟩ + +theorem union_le_refl (x : f.Union) : f.UnionLe x x := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + exact (f.union_le_stage n a a).mpr ((f.order n).refl a) + +theorem union_le_trans {x y z : f.Union} (hxy : f.UnionLe x y) (hyz : f.UnionLe y z) : + f.UnionLe x z := by + rcases hxy with ⟨n, a, b, ha, hb, hab⟩ + rcases hyz with ⟨m, c, d, hc, hd, hcd⟩ + rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ + rcases f.raise_exists (Nat.le_max_right n m) with ⟨q, hq⟩ + have middle : e.toFun b = q.toFun c := + f.inclusion_injective _ _ _ ((he b).trans (hb.trans (hc.symm.trans (hq c).symm))) + have lower := (e.le_iff _ _).mpr hab + rw [middle] at lower + exact ⟨max n m, e.toFun a, q.toFun d, (he a).trans ha, (hq d).trans hd, + (f.order _).trans lower ((q.le_iff _ _).mpr hcd)⟩ + +theorem union_le_antisymm {x y : f.Union} (hxy : f.UnionLe x y) (hyx : f.UnionLe y x) : x = y := by + rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + exact congrArg (f.inclusion n) ((f.order n).antisymm + ((f.union_le_stage n a b).mp hxy) ((f.union_le_stage n b a).mp hyx)) + +theorem union_le_meet_stage (n : Nat) (a b : f.Point n) (z : f.Union) + (hza : f.UnionLe z (f.inclusion n a)) (hzb : f.UnionLe z (f.inclusion n b)) : + f.UnionLe z (f.inclusion n ((f.order n).meet a b)) := by + rcases f.union_cover z with ⟨m, c, rfl⟩ + rcases f.raise_exists (Nat.le_max_left n m) with ⟨e, he⟩ + rcases f.raise_exists (Nat.le_max_right n m) with ⟨q, hq⟩ + have ha : f.UnionLe (f.inclusion (max n m) (q.toFun c)) (f.inclusion (max n m) (e.toFun a)) := by + rw [hq, he] + exact hza + have hb : f.UnionLe (f.inclusion (max n m) (q.toFun c)) (f.inclusion (max n m) (e.toFun b)) := by + rw [hq, he] + exact hzb + have lower := (f.order (max n m)).le_meet + ((f.union_le_stage _ _ _).mp ha) ((f.union_le_stage _ _ _).mp hb) + rw [← e.map_meet] at lower + have result := (f.union_le_stage _ _ _).mpr lower + rw [hq, he] at result + exact result + +theorem union_meet_exists (x y : f.Union) : + ∃ m, f.UnionLe m x ∧ f.UnionLe m y ∧ + ∀ z, f.UnionLe z x → f.UnionLe z y → f.UnionLe z m := by + rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + exact ⟨f.inclusion n ((f.order n).meet a b), + (f.union_le_stage _ _ _).mpr ((f.order n).meet_le_left a b), + (f.union_le_stage _ _ _).mpr ((f.order n).meet_le_right a b), + f.union_le_meet_stage n a b⟩ + +noncomputable def unionMeet (x y : f.Union) : f.Union := Classical.choose (f.union_meet_exists x y) + +noncomputable def unionOrder : MeetOrder f.Union where + le := f.UnionLe + meet := f.unionMeet + refl := f.union_le_refl + trans := f.union_le_trans + antisymm := f.union_le_antisymm + meet_le_left x y := (Classical.choose_spec (f.union_meet_exists x y)).1 + meet_le_right x y := (Classical.choose_spec (f.union_meet_exists x y)).2.1 + le_meet {z x y} := (Classical.choose_spec (f.union_meet_exists x y)).2.2 z + +noncomputable def inclusionEmbedding (n : Nat) : MeetEmbedding (f.order n) f.unionOrder where + toFun := f.inclusion n + le_iff := f.union_le_stage n + map_meet a b := by + apply f.unionOrder.antisymm + · exact f.unionOrder.le_meet + ((f.union_le_stage n _ _).mpr ((f.order n).meet_le_left a b)) + ((f.union_le_stage n _ _).mpr ((f.order n).meet_le_right a b)) + · exact f.union_le_meet_stage n a b _ + (f.unionOrder.meet_le_left _ _) (f.unionOrder.meet_le_right _ _) + +noncomputable def originalEmbedding : MeetEmbedding P f.unionOrder := + compose (f.origin 0) (f.inclusionEmbedding 0) + +theorem union_top (x : f.Union) : f.unionOrder.le x (.inl f.top) := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + rw [← f.inclusion_original n f.top] + exact (f.union_le_stage n _ _).mpr ((f.stages n).top a) + +theorem union_bottom (zero : A) (bottom : ∀ x, P.le zero x) (x : f.Union) : + f.unionOrder.le (.inl zero) x := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + rw [← f.inclusion_original n zero] + exact (f.union_le_stage n _ _).mpr (f.stage_bottom n zero bottom a) + + + + + + + +noncomputable def unionCompression (i : Task) : f.Union → f.Union + | .inl x => f.inclusion 1 ((f.compression 0 i).toFun x) + | .inr ⟨n, x⟩ => f.inclusion (n + 2) ((f.compression (n + 1) i).toFun (.inr x)) + +theorem unionCompression_inclusion (i : Task) (n : Nat) (x : f.Point n) : + f.unionCompression i (f.inclusion n x) = + f.inclusion (n + 1) ((f.compression n i).toFun x) := by + induction n with + | zero => rfl + | succ n ih => + cases x with + | inl x => + change f.unionCompression i (f.inclusion n x) = + f.inclusion (n + 2) ((f.compression (n + 1) i).toFun ((f.step n).toFun x)) + exact (ih x).trans (congrArg (f.inclusion (n + 2)) (f.maps_coherent n i x)) + | inr x => rfl + +noncomputable def unionAction (g : G) : f.Union → f.Union + | .inl x => .inl ((f.action g).toFun x) + | .inr ⟨n, x⟩ => f.inclusion (n + 1) ((f.stageAction (n + 1) g).toFun (.inr x)) + +theorem unionAction_inclusion (g : G) (n : Nat) (x : f.Point n) : + f.unionAction g (f.inclusion n x) = f.inclusion n ((f.stageAction n g).toFun x) := by + induction n with + | zero => rfl + | succ n ih => + cases x with + | inl x => + change f.unionAction g (f.inclusion n x) = + f.inclusion (n + 1) ((f.stageAction (n + 1) g).toFun ((f.step n).toFun x)) + exact (ih x).trans (congrArg (f.inclusion (n + 1)) (f.actions_coherent n g x)) + | inr x => rfl + +theorem unionAction_one (x : f.Union) : f.unionAction f.group.one x = x := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + rw [f.unionAction_inclusion, f.stageAction_one] + +theorem unionAction_mul (g h : G) (x : f.Union) : + f.unionAction (f.group.mul g h) x = f.unionAction g (f.unionAction h x) := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + simp only [f.unionAction_inclusion, f.stageAction_mul] + +theorem unionAction_left (g : G) (x : f.Union) : + f.unionAction (f.group.inv g) (f.unionAction g x) = x := by + rw [← f.unionAction_mul, f.group.inv_mul, f.unionAction_one] + +theorem unionAction_right (g : G) (x : f.Union) : + f.unionAction g (f.unionAction (f.group.inv g) x) = x := by + rw [← f.unionAction_mul, f.group.mul_inv, f.unionAction_one] + +theorem unionAction_order (g : G) (x y : f.Union) : + f.unionOrder.le (f.unionAction g x) (f.unionAction g y) ↔ f.unionOrder.le x y := by + rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + rw [f.unionAction_inclusion, f.unionAction_inclusion] + exact ((f.inclusionEmbedding n).le_iff _ _).trans + (((f.stageAction n g).le_iff a b).trans ((f.inclusionEmbedding n).le_iff a b).symm) + +noncomputable def unionAutomorphism (g : G) : MeetIso f.unionOrder f.unionOrder := + isoOfOrder (f.unionAction g) (f.unionAction (f.group.inv g)) + (f.unionAction_left g) (f.unionAction_right g) (f.unionAction_order g) + +theorem unionCompression_order (i : Task) (x y : f.Union) : + f.unionOrder.le (f.unionCompression i x) (f.unionCompression i y) ↔ f.unionOrder.le x y := by + rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + rw [f.unionCompression_inclusion, f.unionCompression_inclusion] + exact ((f.inclusionEmbedding (n + 1)).le_iff _ _).trans + (((f.compression n i).le_iff a b).trans ((f.inclusionEmbedding n).le_iff a b).symm) + +theorem unionCompression_meet (i : Task) (x y : f.Union) : + f.unionCompression i (f.unionOrder.meet x y) = + f.unionOrder.meet (f.unionCompression i x) (f.unionCompression i y) := by + rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + rw [f.unionCompression_inclusion i n a, f.unionCompression_inclusion i n b] + calc + f.unionCompression i (f.unionOrder.meet (f.inclusion n a) (f.inclusion n b)) = + f.unionCompression i (f.inclusion n ((f.order n).meet a b)) := + congrArg (f.unionCompression i) ((f.inclusionEmbedding n).map_meet a b).symm + _ = f.inclusion (n + 1) ((f.compression n i).toFun ((f.order n).meet a b)) := + f.unionCompression_inclusion i n _ + _ = f.inclusion (n + 1) ((f.order (n + 1)).meet + ((f.compression n i).toFun a) ((f.compression n i).toFun b)) := + congrArg (f.inclusion (n + 1)) ((f.compression n i).map_meet a b) + _ = _ := (f.inclusionEmbedding (n + 1)).map_meet _ _ + +noncomputable def unionCompressionEmbedding (i : Task) : MeetEmbedding f.unionOrder f.unionOrder where + toFun := f.unionCompression i + le_iff := f.unionCompression_order i + map_meet := f.unionCompression_meet i + +theorem union_equivariant (g : G) (i : Task) (x : f.Union) : + (f.unionAutomorphism g).toFun (f.unionCompression i x) = + f.unionCompression (f.perm g i) x := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + change f.unionAction g (f.unionCompression i (f.inclusion n a)) = _ + rw [f.unionCompression_inclusion, f.unionAction_inclusion, f.stage_equivariant, + f.unionCompression_inclusion] + +theorem union_agreement (g h : G) (v : A) + (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) + (x : f.Union) (below : f.unionOrder.le x (.inl v)) : + (f.unionAutomorphism g).toFun x = (f.unionAutomorphism h).toFun x := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + rw [← f.inclusion_original n v] at below + have finite := ((f.inclusionEmbedding n).le_iff _ _).mp below + change f.unionAction g (f.inclusion n a) = f.unionAction h (f.inclusion n a) + rw [f.unionAction_inclusion, f.unionAction_inclusion, f.stage_agreement n g h v agree a finite] + +noncomputable def unionCap (i : Task) : f.Union := f.unionCompression i (.inl f.top) + +theorem unionCap_stage (n : Nat) (i : Task) : + f.inclusion (n + 1) (f.cap n i) = f.unionCap i := by + change f.inclusion (n + 1) ((f.compression n i).toFun ((f.origin n).toFun f.top)) = _ + rw [← f.unionCompression_inclusion, f.inclusion_original] + rfl + +theorem union_range_below_cap (i : Task) (x : f.Union) : + f.unionOrder.le (f.unionCompression i x) (f.unionCap i) := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + rw [f.unionCompression_inclusion, ← f.unionCap_stage n i] + exact ((f.inclusionEmbedding (n + 1)).le_iff _ _).mpr (f.range_below_cap n i a) + +theorem union_base_agreement (i : Task) (x : f.Union) + (below : f.unionOrder.le x (.inl (f.datum i).source)) : + f.unionCompression i x = (f.unionAutomorphism (f.representative i)).toFun x := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + rw [← f.inclusion_original n (f.datum i).source] at below + have finite := ((f.inclusionEmbedding n).le_iff _ _).mp below + change f.unionCompression i (f.inclusion n a) = f.unionAction (f.representative i) (f.inclusion n a) + rw [f.unionCompression_inclusion, f.stage_base_agreement n i a finite, + f.inclusion_step, f.unionAction_inclusion] + +theorem union_action_source (i : Task) : + (f.unionAutomorphism (f.representative i)).toFun (.inl (f.datum i).source) = + .inl (f.datum i).target := + congrArg Sum.inl (f.representative_target i) + +theorem union_maps_base (i : Task) : + f.unionCompression i (.inl (f.datum i).source) = .inl (f.datum i).target := + (f.union_base_agreement i _ (f.unionOrder.refl _)).trans (f.union_action_source i) + + + + + + + +def UnionOriginal (x : f.Union) : Prop := ∃ a : A, Sum.inl a = x + +theorem union_cap_separation (i j : Task) (different : i ≠ j) : + f.unionOrder.le (f.unionCap i) (.inl (f.datum j).target) ∨ + f.unionOrder.le (f.unionCap j) (.inl (f.datum i).target) ∨ + f.unionOrder.meet (f.unionCap i) (f.unionCap j) = + f.unionOrder.meet (.inl (f.datum i).target) (.inl (f.datum j).target) := by + rcases f.cap_separation 0 i j different with h | h | h + · have result := ((f.inclusionEmbedding 1).le_iff _ _).mpr h + change f.unionOrder.le (f.inclusion 1 (f.cap 0 i)) + (f.inclusion 1 ((f.origin 1).toFun (f.datum j).target)) at result + rw [f.unionCap_stage, f.inclusion_original] at result + exact Or.inl result + · have result := ((f.inclusionEmbedding 1).le_iff _ _).mpr h + change f.unionOrder.le (f.inclusion 1 (f.cap 0 j)) + (f.inclusion 1 ((f.origin 1).toFun (f.datum i).target)) at result + rw [f.unionCap_stage, f.inclusion_original] at result + exact Or.inr (Or.inl result) + · have result := congrArg (f.inclusionEmbedding 1).toFun h + rw [(f.inclusionEmbedding 1).map_meet, (f.inclusionEmbedding 1).map_meet] at result + change f.unionOrder.meet (f.inclusion 1 (f.cap 0 i)) (f.inclusion 1 (f.cap 0 j)) = + f.unionOrder.meet (f.inclusion 1 ((f.origin 1).toFun (f.datum i).target)) + (f.inclusion 1 ((f.origin 1).toFun (f.datum j).target)) at result + rw [f.unionCap_stage, f.unionCap_stage, f.inclusion_original, f.inclusion_original] at result + exact Or.inr (Or.inr result) + +theorem union_original_below_cap (i : Task) (v : A) : + f.unionOrder.le (.inl v) (f.unionCap i) ↔ P.le v (f.datum i).target := by + rw [← f.unionCap_stage 0 i, ← f.inclusion_original 1 v] + exact ((f.inclusionEmbedding 1).le_iff _ _).trans (f.original_below_cap 0 i v) + +theorem union_cap_strict (i : Task) : + f.unionOrder.le (.inl (f.datum i).target) (f.unionCap i) ∧ + ¬ f.unionOrder.le (f.unionCap i) (.inl (f.datum i).target) := by + constructor + · exact (f.union_original_below_cap i _).mpr (P.refl _) + · intro h + rw [← f.union_maps_base i] at h + have lower := (f.unionCompression_order i (.inl f.top) (.inl (f.datum i).source)).mp h + exact f.source_proper i ((f.originalEmbedding.le_iff _ _).mp lower) + +theorem union_separator_not_below_cap (i : Task) : + ¬ f.unionOrder.le (.inl (f.datum i).separator) (f.unionCap i) := + fun h => (f.geometry i).separator_not_le_base ((f.union_original_below_cap i _).mp h) + +theorem union_original_shadow (i : Task) (x : f.Union) (original : f.UnionOriginal x) + (below : f.unionOrder.le x (f.unionCap i)) : + f.unionOrder.le x (.inl (f.datum i).target) := by + rcases original with ⟨v, rfl⟩ + exact (f.originalEmbedding.le_iff _ _).mpr ((f.union_original_below_cap i v).mp below) + +theorem union_accounting (x : f.Union) : + f.UnionOriginal x ∨ ∃ i y, f.unionCompression i y = x ∧ + f.unionOrder.le x (f.unionCap i) ∧ ¬ f.unionOrder.le x (.inl (f.datum i).target) := by + cases x with + | inl a => exact Or.inl ⟨a, rfl⟩ + | inr x => + rcases x with ⟨n, z⟩ + rcases f.stage_fresh_accounting n z with ⟨i, y, image, lower, outside⟩ + have image' : f.unionCompression i (f.inclusion n y) = .inr ⟨n, z⟩ := + (f.unionCompression_inclusion i n y).trans (congrArg (f.inclusion (n + 1)) image) + refine Or.inr ⟨i, f.inclusion n y, image', ?_, ?_⟩ + · have result := ((f.inclusionEmbedding (n + 1)).le_iff _ _).mpr lower + change f.unionOrder.le (.inr ⟨n, z⟩) (f.inclusion (n + 1) (f.cap n i)) at result + rw [f.unionCap_stage] at result + exact result + · intro h + have h' : f.unionOrder.le (f.inclusion (n + 1) (.inr z)) + (f.inclusion (n + 1) ((f.origin (n + 1)).toFun (f.datum i).target)) := by + rw [f.inclusion_original] + exact h + exact outside (((f.inclusionEmbedding (n + 1)).le_iff _ _).mp h') + +theorem union_base_filled (i : Task) (x : f.Union) + (below : f.unionOrder.le x (.inl (f.datum i).target)) : + ∃ y, f.unionCompression i y = x := by + have filled := base_ideal_filled f.unionOrder (f.unionCompression i) + (f.unionAutomorphism (f.representative i)) (.inl (f.datum i).source) + (f.union_base_agreement i) x + rw [f.union_action_source] at filled + exact filled below + +theorem union_surjective_ideal (i : Task) (x : f.Union) + (below : f.unionOrder.le x (f.unionCap i)) : ∃ y, f.unionCompression i y = x := + range_completion_from_accounting f.unionOrder f.UnionOriginal + (fun i => .inl (f.datum i).target) f.unionCap f.unionCompression + f.union_base_filled f.union_original_shadow f.union_cap_separation f.union_accounting i x below + +noncomputable def unionCompressionIso (i : Task) : + MeetIso f.unionOrder (Attachment.idealOrder f.unionOrder (f.unionCap i)) := + isoOntoIdeal f.unionOrder (f.unionCompressionEmbedding i) (f.unionCap i) + (f.union_range_below_cap i) (f.union_surjective_ideal i) + +theorem unionCompressionIso_value (i : Task) (x : f.Union) : + ((f.unionCompressionIso i).toFun x).val = f.unionCompression i x := rfl + +end TaskSystem + + + +section + +universe u + +def imageFamily {A B : Type u} {P : MeetOrder A} {Q : MeetOrder B} + (e : MeetEmbedding P Q) (F : A → Prop) (x : B) : Prop := + ∃ a, F a ∧ e.toFun a = x + +theorem positive_imageFamily {A B : Type u} {P : MeetOrder A} {Q : MeetOrder B} + (e : MeetEmbedding P Q) (F : A → Prop) (x : B) : + Positive Q (imageFamily e F) x ↔ PositiveOver e F x := by + constructor + · rintro ⟨y, ⟨a, ha, rfl⟩, hy⟩ + exact ⟨a, ha, hy⟩ + · rintro ⟨a, ha, hy⟩ + exact ⟨e.toFun a, ⟨a, ha, rfl⟩, hy⟩ + +theorem positiveOver_imageFamily {A B C : Type u} + {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} + (e : MeetEmbedding P Q) (j : MeetEmbedding Q R) (F : A → Prop) (x : C) : + PositiveOver j (imageFamily e F) x ↔ PositiveOver (compose e j) F x := by + constructor + · rintro ⟨y, ⟨a, ha, rfl⟩, hy⟩ + exact ⟨a, ha, hy⟩ + · rintro ⟨a, ha, hy⟩ + exact ⟨e.toFun a, ⟨a, ha, rfl⟩, hy⟩ + +namespace TaskSystem + +open Attachment + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +def StageProfile (n : Nat) (i : Task) : Prop := + ∀ x : f.Point (n + 1), (f.order (n + 1)).le ((f.origin (n + 1)).toFun (f.datum i).separator) x → + (PositiveOver (f.origin (n + 1)) (f.datum i).filter.mem x → (f.order (n + 1)).le (f.cap n i) x) ∧ + (¬ PositiveOver (f.origin (n + 1)) (f.datum i).filter.mem x → + (f.order (n + 1)).meet (f.cap n i) x = (f.origin (n + 1)).toFun (f.datum i).target) + +theorem first_stage_profile (i : Task) : f.StageProfile 0 i := by + have profile := f.initial.copy_initial_profile f.top f.greatest f.source_proper i + change Profile (f.order 1) (.inl ((f.action (f.representative i)).toFun (f.datum i).source)) + (.inl (f.datum i).separator) (f.cap 0 i) (f.initial.batch.originalFamily i) at profile + rw [f.representative_target] at profile + intro x above + have positive : Positive (f.order 1) (f.initial.batch.originalFamily i) x ↔ + PositiveOver (f.origin 1) (f.datum i).filter.mem x := by + constructor + · rintro ⟨y, hy, hxy⟩ + cases y with + | inl y => exact ⟨y, hy, hxy⟩ + | inr y => exact False.elim hy + · rintro ⟨y, hy, hxy⟩ + exact ⟨.inl y, hy, hxy⟩ + exact ⟨fun h => (profile x above).1 (positive.mpr h), + fun h => (profile x above).2 (fun hp => h (positive.mp hp))⟩ + +theorem stage_profile (n : Nat) (i : Task) : f.StageProfile n i := by + induction n with + | zero => exact f.first_stage_profile i + | succ n ih => + have old : Profile (f.order (n + 1)) ((f.origin (n + 1)).toFun (f.datum i).target) + ((f.origin (n + 1)).toFun (f.datum i).separator) (f.cap n i) + (imageFamily (f.origin (n + 1)) (f.datum i).filter.mem) := by + intro x above + exact ⟨fun h => (ih x above).1 ((positive_imageFamily _ _ x).mp h), + fun h => (ih x above).2 (fun hp => h ((positive_imageFamily _ _ x).mpr hp))⟩ + have nonempty : ∃ x, imageFamily (f.origin (n + 1)) (f.datum i).filter.mem x := by + rcases (f.datum i).filter.nonempty with ⟨a, ha⟩ + exact ⟨(f.origin (n + 1)).toFun a, a, ha, rfl⟩ + have permitted : PermittedExtension (f.step (n + 1)) := + Attachment.permitted_extension (f.stages (n + 1)).batch.data + (f.stages (n + 1)).batch.component_meets + have persisted := profile_persists_one_step (f.step (n + 1)) + ((f.origin (n + 1)).toFun (f.datum i).target) + ((f.origin (n + 1)).toFun (f.datum i).separator) (f.cap n i) + (imageFamily (f.origin (n + 1)) (f.datum i).filter.mem) nonempty old + (f.separator_not_below_cap n i) permitted + intro x above + have above' : (f.order (n + 2)).le + ((f.step (n + 1)).toFun ((f.origin (n + 1)).toFun (f.datum i).separator)) x := by + rw [f.origins_coherent] + exact above + have result := persisted x above' + rw [f.caps_coherent, f.origins_coherent] at result + have positive := positiveOver_imageFamily (f.origin (n + 1)) (f.step (n + 1)) + (f.datum i).filter.mem x + exact ⟨fun h => result.1 (positive.mpr h), + fun h => result.2 (fun hp => h (positive.mp hp))⟩ + +theorem union_positive_stage (i : Task) (n : Nat) (x : f.Point n) : + (∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) (f.inclusion n x)) ↔ + PositiveOver (f.origin n) (f.datum i).filter.mem x := by + constructor + · rintro ⟨a, ha, hax⟩ + rw [← f.inclusion_original n a] at hax + exact ⟨a, ha, ((f.inclusionEmbedding n).le_iff _ _).mp hax⟩ + · rintro ⟨a, ha, hax⟩ + refine ⟨a, ha, ?_⟩ + rw [← f.inclusion_original n a] + exact ((f.inclusionEmbedding n).le_iff _ _).mpr hax + +theorem union_profile_at_stage (i : Task) (n : Nat) (x : f.Point (n + 1)) + (above : f.unionOrder.le (.inl (f.datum i).separator) (f.inclusion (n + 1) x)) : + ((∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) (f.inclusion (n + 1) x)) → + f.unionOrder.le (f.unionCap i) (f.inclusion (n + 1) x)) ∧ + ((¬ ∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) (f.inclusion (n + 1) x)) → + f.unionOrder.meet (f.unionCap i) (f.inclusion (n + 1) x) = .inl (f.datum i).target) := by + rw [← f.inclusion_original (n + 1) (f.datum i).separator] at above + have finite := ((f.inclusionEmbedding (n + 1)).le_iff ((f.origin (n + 1)).toFun (f.datum i).separator) x).mp above + have profile := f.stage_profile n i x finite + constructor + · intro h + have lower := profile.1 ((f.union_positive_stage i (n + 1) x).mp h) + have result := ((f.inclusionEmbedding (n + 1)).le_iff _ _).mpr lower + change f.unionOrder.le (f.inclusion (n + 1) (f.cap n i)) (f.inclusion (n + 1) x) at result + rw [f.unionCap_stage] at result + exact result + · intro h + have meet := profile.2 (fun hp => h ((f.union_positive_stage i (n + 1) x).mpr hp)) + have result := congrArg (f.inclusionEmbedding (n + 1)).toFun meet + rw [(f.inclusionEmbedding (n + 1)).map_meet] at result + change f.unionOrder.meet (f.inclusion (n + 1) (f.cap n i)) (f.inclusion (n + 1) x) = + f.inclusion (n + 1) ((f.origin (n + 1)).toFun (f.datum i).target) at result + rw [f.unionCap_stage, f.inclusion_original] at result + exact result + +theorem union_profile (i : Task) (x : f.Union) + (above : f.unionOrder.le (.inl (f.datum i).separator) x) : + ((∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) x) → + f.unionOrder.le (f.unionCap i) x) ∧ + ((¬ ∃ a, (f.datum i).filter.mem a ∧ f.unionOrder.le (.inl a) x) → + f.unionOrder.meet (f.unionCap i) x = .inl (f.datum i).target) := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + exact f.union_profile_at_stage i n ((f.step n).toFun a) above + +end TaskSystem + + + + + +structure CompressionAlgebra {A G Task Label : Type u} {P : MeetOrder A} + (f : TaskSystem P G Task Label) where + Space : Type u + order : MeetOrder Space + original : MeetEmbedding P order + cap : Task → Space + action : G → MeetIso order order + compress : ∀ i, MeetIso order (Attachment.idealOrder order (cap i)) + top : ∀ x, order.le x (original.toFun f.top) + bottom : ∀ zero, (∀ x, P.le zero x) → ∀ x, order.le (original.toFun zero) x + action_one : ∀ x, (action f.group.one).toFun x = x + action_mul : ∀ g h x, (action (f.group.mul g h)).toFun x = + (action g).toFun ((action h).toFun x) + action_original : ∀ g x, (action g).toFun (original.toFun x) = + original.toFun ((f.action g).toFun x) + strict : ∀ i, order.le (original.toFun (f.datum i).target) (cap i) ∧ + ¬ order.le (cap i) (original.toFun (f.datum i).target) + separator : ∀ i, ¬ order.le (original.toFun (f.datum i).separator) (cap i) + base_agreement : ∀ i x, order.le x (original.toFun (f.datum i).source) → + ((compress i).toFun x).val = (action (f.representative i)).toFun x + equivariant : ∀ g i x, (action g).toFun ((compress i).toFun x).val = + ((compress (f.perm g i)).toFun x).val + agreement : ∀ g h v, + (∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) → + ∀ x, order.le x (original.toFun v) → (action g).toFun x = (action h).toFun x + separation : ∀ i j, i ≠ j → + order.le (cap i) (original.toFun (f.datum j).target) ∨ + order.le (cap j) (original.toFun (f.datum i).target) ∨ + order.meet (cap i) (cap j) = + order.meet (original.toFun (f.datum i).target) (original.toFun (f.datum j).target) + profile : ∀ i x, order.le (original.toFun (f.datum i).separator) x → + ((∃ a, (f.datum i).filter.mem a ∧ order.le (original.toFun a) x) → order.le (cap i) x) ∧ + ((¬ ∃ a, (f.datum i).filter.mem a ∧ order.le (original.toFun a) x) → + order.meet (cap i) x = original.toFun (f.datum i).target) + +namespace TaskSystem + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +noncomputable def compressionAlgebra : CompressionAlgebra f where + Space := f.Union + order := f.unionOrder + original := f.originalEmbedding + cap := f.unionCap + action := f.unionAutomorphism + compress := f.unionCompressionIso + top := f.union_top + bottom := f.union_bottom + action_one := f.unionAction_one + action_mul := f.unionAction_mul + action_original _ _ := rfl + strict := f.union_cap_strict + separator := f.union_separator_not_below_cap + base_agreement := f.union_base_agreement + equivariant := f.union_equivariant + agreement := f.union_agreement + separation := f.union_cap_separation + profile := f.union_profile + +theorem union_equal_base_caps (i j : Task) (different : i ≠ j) + (same_base : (f.datum i).target = (f.datum j).target) : + f.unionOrder.meet (f.unionCap i) (f.unionCap j) = .inl (f.datum i).target := by + rcases f.union_cap_separation i j different with h | h | h + · rw [← same_base] at h + exact False.elim ((f.union_cap_strict i).2 h) + · rw [same_base] at h + exact False.elim ((f.union_cap_strict j).2 h) + · rw [← same_base] at h + exact h.trans (meet_eq_left_of_le f.unionOrder (f.unionOrder.refl _)) + +end TaskSystem +end + + + +namespace TaskSystem + +universe u v + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +noncomputable def componentWord : (n : Nat) → (f.stages n).Components → List Task + | 0, i => [i] + | n + 1, i => i.1 :: componentWord n i.2.val + +theorem componentWord_length (n : Nat) (i : (f.stages n).Components) : + (f.componentWord n i).length = n + 1 := by + induction n with + | zero => rfl + | succ n ih => + change (i.1 :: f.componentWord n i.2.val).length = n + 1 + 1 + rw [List.length_cons, ih] + +theorem componentWord_injective (n : Nat) (i j : (f.stages n).Components) + (eq : f.componentWord n i = f.componentWord n j) : i = j := by + induction n with + | zero => exact (List.cons.inj eq).1 + | succ n ih => + rcases i with ⟨i, ⟨h, hi⟩⟩ + rcases j with ⟨j, ⟨k, hj⟩⟩ + have head := (List.cons.inj eq).1 + have tail := ih h k (List.cons.inj eq).2 + cases head + cases tail + rfl + +noncomputable def templateOriginal : (n : Nat) → (i : (f.stages n).Components) → + MeetIso ((f.stages n).batch.order i) P + | 0, _ => identityIso P + | n + 1, i => templateOriginal n i.2.val + +noncomputable def nodeCode : f.Union → List Task × A + | .inl a => ([], a) + | .inr ⟨n, x⟩ => (f.componentWord n x.1, (f.templateOriginal n x.1).toFun x.2.val) + +theorem nodeCode_injective (x y : f.Union) (eq : f.nodeCode x = f.nodeCode y) : x = y := by + cases x with + | inl a => + cases y with + | inl b => exact congrArg Sum.inl (congrArg Prod.snd eq) + | inr y => + rcases y with ⟨n, h, y, hy⟩ + have length := congrArg (fun c : List Task × A => c.1.length) eq + change 0 = (f.componentWord n h).length at length + rw [f.componentWord_length] at length + omega + | inr x => + cases y with + | inl b => + rcases x with ⟨n, h, x, hx⟩ + have length := congrArg (fun c : List Task × A => c.1.length) eq + change (f.componentWord n h).length = 0 at length + rw [f.componentWord_length] at length + omega + | inr y => + rcases x with ⟨n, h, x, hx⟩ + rcases y with ⟨m, k, y, hy⟩ + have length := congrArg (fun c : List Task × A => c.1.length) eq + change (f.componentWord n h).length = (f.componentWord m k).length at length + rw [f.componentWord_length, f.componentWord_length] at length + have sameStage : n = m := by omega + cases sameStage + have sameComponent : h = k := f.componentWord_injective n h k (congrArg Prod.fst eq) + cases sameComponent + have sameNode : x = y := embedding_injective (f.templateOriginal n h).toMeetEmbedding + (congrArg Prod.snd eq) + cases sameNode + rfl + +theorem union_coding_bound : ∃ code : f.Union → List Task × A, + ∀ x y, code x = code y → x = y := + ⟨f.nodeCode, f.nodeCode_injective⟩ + +theorem union_size_transfer {B : Type v} (pack : List Task × A → B) + (injective : ∀ x y, pack x = pack y → x = y) : + ∃ code : f.Union → B, ∀ x y, code x = code y → x = y := + ⟨fun x => pack (f.nodeCode x), fun x y eq => f.nodeCode_injective x y (injective _ _ eq)⟩ + +end TaskSystem + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OldProfilePreservationComposition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OldProfilePreservationComposition.lean index 41bb053924e3ef457e4993aeeab8e10b7532f754..5a97ebc26af89ede4b3d430e603df89a8b966a1f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OldProfilePreservationComposition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OldProfilePreservationComposition.lean @@ -1,87 +1,87 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaskCapFamilyCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem relationImage_identity_on {P F : ZFSet.{u}} (subset : F ⊆ P) : - relationImage F P (identityFunctionGraph P) = F := by - apply ZFSet.ext - intro y - rw [mem_relationImage] - constructor - · rintro ⟨_, x, hx, entry⟩ - exact ((pair_mem_identityFunctionGraph P x y).1 entry).1 ▸ hx - · intro hy - exact ⟨subset hy, y, hy, (pair_mem_identityFunctionGraph P y y).2 ⟨rfl, subset hy⟩⟩ - -theorem relationImage_composition_on {P Q V F e f : ZFSet.{u}} (subset : F ⊆ P) : - relationImage (relationImage F Q e) V f = relationImage F V (relationCompose P Q V e f) := by - apply ZFSet.ext - intro z - rw [mem_relationImage, mem_relationImage] - constructor - · rintro ⟨hz, y, hy, yz⟩ - obtain ⟨hy, x, hx, xy⟩ := (mem_relationImage F Q e y).1 hy - exact ⟨hz, x, hx, (pair_mem_relationCompose P Q V e f x z).2 - ⟨subset hx, hz, y, hy, xy, yz⟩⟩ - · rintro ⟨hz, x, hx, entry⟩ - obtain ⟨_, _, y, hy, xy, yz⟩ := (pair_mem_relationCompose P Q V e f x z).1 entry - exact ⟨hz, y, (mem_relationImage F Q e y).2 ⟨hy, x, hx, xy⟩, yz⟩ - -namespace OldProfilePreservationCode - -theorem identity (P r μ Filters : ZFSet.{u}) : - OldProfilePreservationCode P r μ P r μ (identityFunctionGraph P) Filters := by - intro F _ c _ E _ K _ profile c' _ E' _ K' _ first second third - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph P c c').1 first - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph P E E').1 second - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph P K K').1 third - rw [relationImage_identity_on profile.filter_subset] - exact profile - -theorem comp_ground (M : TransitiveGround.{u}) (separation : SeparationSchema M.sets) - {P r μ Q R ν V S ξ e f : ZFSet.{u}} - (first : OldProfilePreservationCode P r μ Q R ν e (M.groundPower P)) - (second : OldProfilePreservationCode Q R ν V S ξ f (M.groundPower Q)) - (hQ : Q ∈ M.sets) (he : e ∈ M.sets) : - OldProfilePreservationCode P r μ V S ξ (relationCompose P Q V e f) (M.groundPower P) := by - intro F hF c hc E hE K hK profile c' hc' E' hE' K' hK' imageC imageE imageK - obtain ⟨_, _, a, ha, ca, ac⟩ := (pair_mem_relationCompose P Q V e f c c').1 imageC - obtain ⟨_, _, b, hb, Eb, bE⟩ := (pair_mem_relationCompose P Q V e f E E').1 imageE - obtain ⟨_, _, d, hd, Kd, dK⟩ := (pair_mem_relationCompose P Q V e f K K').1 imageK - have intermediate := first F hF c hc E hE K hK profile a ha b hb d hd ca Eb Kd - have imageGround := M.relationImage_mem separation ((M.mem_groundPower P F).1 hF).1 hQ he - have imageMember := (M.mem_groundPower Q (relationImage F Q e)).2 - ⟨imageGround, fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1⟩ - have result := second _ imageMember a ha b hb d hd intermediate - c' hc' E' hE' K' hK' ac bE dK - rw [relationImage_composition_on profile.filter_subset] at result - exact result - -end OldProfilePreservationCode - -theorem TransitiveGround.realize_groundOldProfilePreservation (M : TransitiveGround.{u}) - (powers : SetFormula.Realize M.sets SetFormula.powerSet Fin.elim0) - {P r μ Q R ν e : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) (hν : ν ∈ M.sets) (he : e ∈ M.sets) : - SetFormula.Realize M.sets (BoundedFormula.oldProfilePreservationFormula 0 1 2 3 4 5 6 7).toFormula - (SetFormula.extend P (SetFormula.extend r (SetFormula.extend μ (SetFormula.extend Q - (SetFormula.extend R (SetFormula.extend ν (SetFormula.extend e - (SetFormula.extend (M.groundPower P) Fin.elim0)))))))) ↔ - OldProfilePreservationCode P r μ Q R ν e (M.groundPower P) := by - apply BoundedFormula.realize_oldProfilePreservationFormula - exact Fin.cases hP (Fin.cases hr (Fin.cases hμ (Fin.cases hQ (Fin.cases hR - (Fin.cases hν (Fin.cases he (Fin.cases (M.groundPower_mem powers hP) - (fun j => Fin.elim0 j)))))))) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaskCapFamilyCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem relationImage_identity_on {P F : ZFSet.{u}} (subset : F ⊆ P) : + relationImage F P (identityFunctionGraph P) = F := by + apply ZFSet.ext + intro y + rw [mem_relationImage] + constructor + · rintro ⟨_, x, hx, entry⟩ + exact ((pair_mem_identityFunctionGraph P x y).1 entry).1 ▸ hx + · intro hy + exact ⟨subset hy, y, hy, (pair_mem_identityFunctionGraph P y y).2 ⟨rfl, subset hy⟩⟩ + +theorem relationImage_composition_on {P Q V F e f : ZFSet.{u}} (subset : F ⊆ P) : + relationImage (relationImage F Q e) V f = relationImage F V (relationCompose P Q V e f) := by + apply ZFSet.ext + intro z + rw [mem_relationImage, mem_relationImage] + constructor + · rintro ⟨hz, y, hy, yz⟩ + obtain ⟨hy, x, hx, xy⟩ := (mem_relationImage F Q e y).1 hy + exact ⟨hz, x, hx, (pair_mem_relationCompose P Q V e f x z).2 + ⟨subset hx, hz, y, hy, xy, yz⟩⟩ + · rintro ⟨hz, x, hx, entry⟩ + obtain ⟨_, _, y, hy, xy, yz⟩ := (pair_mem_relationCompose P Q V e f x z).1 entry + exact ⟨hz, y, (mem_relationImage F Q e y).2 ⟨hy, x, hx, xy⟩, yz⟩ + +namespace OldProfilePreservationCode + +theorem identity (P r μ Filters : ZFSet.{u}) : + OldProfilePreservationCode P r μ P r μ (identityFunctionGraph P) Filters := by + intro F _ c _ E _ K _ profile c' _ E' _ K' _ first second third + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph P c c').1 first + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph P E E').1 second + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph P K K').1 third + rw [relationImage_identity_on profile.filter_subset] + exact profile + +theorem comp_ground (M : TransitiveGround.{u}) (separation : SeparationSchema M.sets) + {P r μ Q R ν V S ξ e f : ZFSet.{u}} + (first : OldProfilePreservationCode P r μ Q R ν e (M.groundPower P)) + (second : OldProfilePreservationCode Q R ν V S ξ f (M.groundPower Q)) + (hQ : Q ∈ M.sets) (he : e ∈ M.sets) : + OldProfilePreservationCode P r μ V S ξ (relationCompose P Q V e f) (M.groundPower P) := by + intro F hF c hc E hE K hK profile c' hc' E' hE' K' hK' imageC imageE imageK + obtain ⟨_, _, a, ha, ca, ac⟩ := (pair_mem_relationCompose P Q V e f c c').1 imageC + obtain ⟨_, _, b, hb, Eb, bE⟩ := (pair_mem_relationCompose P Q V e f E E').1 imageE + obtain ⟨_, _, d, hd, Kd, dK⟩ := (pair_mem_relationCompose P Q V e f K K').1 imageK + have intermediate := first F hF c hc E hE K hK profile a ha b hb d hd ca Eb Kd + have imageGround := M.relationImage_mem separation ((M.mem_groundPower P F).1 hF).1 hQ he + have imageMember := (M.mem_groundPower Q (relationImage F Q e)).2 + ⟨imageGround, fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1⟩ + have result := second _ imageMember a ha b hb d hd intermediate + c' hc' E' hE' K' hK' ac bE dK + rw [relationImage_composition_on profile.filter_subset] at result + exact result + +end OldProfilePreservationCode + +theorem TransitiveGround.realize_groundOldProfilePreservation (M : TransitiveGround.{u}) + (powers : SetFormula.Realize M.sets SetFormula.powerSet Fin.elim0) + {P r μ Q R ν e : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) (hν : ν ∈ M.sets) (he : e ∈ M.sets) : + SetFormula.Realize M.sets (BoundedFormula.oldProfilePreservationFormula 0 1 2 3 4 5 6 7).toFormula + (SetFormula.extend P (SetFormula.extend r (SetFormula.extend μ (SetFormula.extend Q + (SetFormula.extend R (SetFormula.extend ν (SetFormula.extend e + (SetFormula.extend (M.groundPower P) Fin.elim0)))))))) ↔ + OldProfilePreservationCode P r μ Q R ν e (M.groundPower P) := by + apply BoundedFormula.realize_oldProfilePreservationFormula + exact Fin.cases hP (Fin.cases hr (Fin.cases hμ (Fin.cases hQ (Fin.cases hR + (Fin.cases hν (Fin.cases he (Fin.cases (M.groundPower_mem powers hP) + (fun j => Fin.elim0 j)))))))) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OutwardSchedule.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OutwardSchedule.lean index 5f0f000f7003ee768b08601d657888c2ab435623..f528b39ddcfcf68dd0e4ce91da370f31d514a6a1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OutwardSchedule.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/OutwardSchedule.lean @@ -1,314 +1,314 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.PartialBatchLimits - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -open Attachment -universe u -variable {V : Type u} (d : Scheme V) - -def Partial (n : Nat) (U : (d.stages n).Layer → Prop) := (d.stages n).batch.Cutoff U - -noncomputable def partialOrder (n : Nat) (U : (d.stages n).Layer → Prop) : MeetOrder (d.Partial n U) := - (d.stages n).batch.cutoffOrder U - -noncomputable def partialEmbedding (n : Nat) (U : (d.stages n).Layer → Prop) : - IdealEmbedding (d.partialOrder n U) d.gluedOrder := - ((d.stages n).batch.cutoffEmbedding U).comp (d.chain.inclusion (n + 1)) - -theorem partialEmbedding_old (n : Nat) (U : (d.stages n).Layer → Prop) (x : (d.stages n).Point) : - (d.partialEmbedding n U).toFun (((d.stages n).batch.cutoffOld U).toFun x) = d.chain.point n x := - d.point_next n x - -theorem partialEmbedding_tile (n : Nat) (U : (d.stages n).Layer → Prop) - (v : (d.stages n).Layer) (hv : U v) (x : d.Space v.val) : - (d.partialEmbedding n U).toFun (((d.stages n).batch.cutoffTile U v hv).toFun x) = - (d.vertex v.val).toFun x := by - exact ((d.vertex_at v.val (n + 1) v.property.le x).trans - (congrArg (d.chain.point (n + 1)) ((d.stages n).successor_new v x))).symm - -noncomputable def partialOldVertex (n : Nat) (U : (d.stages n).Layer → Prop) - (v : V) (hv : d.depth v ≤ n) : IdealEmbedding (d.order v) (d.partialOrder n U) := - ((d.stages n).vertex v hv).comp ((d.stages n).batch.cutoffOld U) - -theorem partialOldVertex_global (n : Nat) (U : (d.stages n).Layer → Prop) - (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : - (d.partialEmbedding n U).toFun ((d.partialOldVertex n U v hv).toFun x) = - (d.vertex v).toFun x := by - change (d.partialEmbedding n U).toFun (((d.stages n).batch.cutoffOld U).toFun - (((d.stages n).vertex v hv).toFun x)) = _ - rw [d.partialEmbedding_old] - exact (d.vertex_at v n hv x).symm - -theorem partial_no_later_nodes (n : Nat) (U : (d.stages n).Layer → Prop) - (x : d.Partial n U) (y : d.Node) - (lower : d.gluedOrder.le y ((d.partialEmbedding n U).toFun x)) : - ∃ z, (d.partialEmbedding n U).toFun z = y := (d.partialEmbedding n U).ideal x y lower - -noncomputable def partialLater {n m : Nat} (later : n < m) - (U : (d.stages n).Layer → Prop) (W : (d.stages m).Layer → Prop) : - IdealEmbedding (d.partialOrder n U) (d.partialOrder m W) := - (((d.stages n).batch.cutoffEmbedding U).comp (d.chain.raise (Nat.succ_le_of_lt later))).comp - ((d.stages m).batch.cutoffOld W) - -theorem partialLater_global {n m : Nat} (later : n < m) - (U : (d.stages n).Layer → Prop) (W : (d.stages m).Layer → Prop) (x : d.Partial n U) : - (d.partialEmbedding m W).toFun ((d.partialLater later U W).toFun x) = - (d.partialEmbedding n U).toFun x := by - exact (d.partialEmbedding_old m W (d.chain.up (Nat.succ_le_of_lt later) x.val)).trans - (d.chain.include_up (Nat.succ_le_of_lt later) x.val) - -theorem partial_cover (z : d.Node) : - ∃ n, ∃ x : d.Partial n (fun _ => False), (d.partialEmbedding n (fun _ => False)).toFun x = z := by - rcases d.chain.cover z with ⟨n, x, rfl⟩ - exact ⟨n, ((d.stages n).batch.cutoffOld (fun _ => False)).toFun x, d.partialEmbedding_old n _ x⟩ - -theorem partial_outside_meet (n : Nat) (U : (d.stages n).Layer → Prop) - (v : (d.stages n).Layer) (outside : ¬ U v) - (x : ((d.stages n).batch.glue v).Fresh) (y : d.Partial n U) : - d.gluedOrder.meet (d.chain.point (n + 1) (.inr ⟨v, x⟩)) ((d.partialEmbedding n U).toFun y) = - d.gluedOrder.meet (d.chain.point n (((d.stages n).batch.glue v).shadow x.val)) - ((d.partialEmbedding n U).toFun y) := by - rw [← d.point_next n (((d.stages n).batch.glue v).shadow x.val)] - change d.chain.unionOrder.meet ((d.chain.inclusion (n + 1)).toFun (.inr ⟨v, x⟩)) - ((d.chain.inclusion (n + 1)).toFun y.val) = - d.chain.unionOrder.meet ((d.chain.inclusion (n + 1)).toFun - ((d.stages n).batch.old.toFun (((d.stages n).batch.glue v).shadow x.val))) - ((d.chain.inclusion (n + 1)).toFun y.val) - exact ((d.chain.inclusion (n + 1)).map_meet _ _).symm.trans - ((congrArg (d.chain.inclusion (n + 1)).toFun - ((d.stages n).batch.outside_meet U v outside x y)).trans - ((d.chain.inclusion (n + 1)).map_meet _ _)) - -theorem partial_new_vertex_meet (n : Nat) (U : (d.stages n).Layer → Prop) - (v : (d.stages n).Layer) (outside : ¬ U v) - (x : ((d.stages n).batch.glue v).Fresh) (y : d.Partial n U) : - d.gluedOrder.meet ((d.vertex v.val).toFun x.val) ((d.partialEmbedding n U).toFun y) = - d.gluedOrder.meet - ((d.vertex (d.parent v.val)).toFun - ((d.link v.val ((d.stages n).layer_nonzero v)).toFun - (cut (d.order v.val) (d.childAnchor v.val ((d.stages n).layer_nonzero v)) x.val)).val) - ((d.partialEmbedding n U).toFun y) := by - have fresh : ((d.stages n).batch.tile v).toFun x.val = .inr ⟨v, x⟩ := - congrArg ((d.stages n).batch.componentMap v) - (((d.stages n).batch.glue v).represent_new x.val x.property) - have vx := (d.vertex_at v.val (n + 1) v.property.le x.val).trans - (congrArg (d.chain.point (n + 1)) (((d.stages n).successor_new v x.val).trans fresh)) - rw [vx, d.partial_outside_meet n U v outside x y] - congr 1 - exact (d.vertex_at (d.parent v.val) n ((d.stages n).parent_present v) _).symm - -end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - - - -namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces - -universe u -variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) - -def FullRight {v w : Vertex J S R} (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : Prop := - ∀ x, (g.order w).le x i.rightAnchor - -theorem fullRight_reindex {v w v' w' : Vertex J S R} (hv : v = v') (hw : w = w') - (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : - g.FullRight (g.reindexInput hv hw i) ↔ g.FullRight i := by - cases hv - cases hw - rfl - -end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces - -namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -open Attachment CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -theorem edge_full_at_old (d : TileStars.Dart J f.Letters R) (v : CosetGeometry.Vertex J f.Letters) - (targetOld : TileStars.target J f.Letters R Sigma.fst d = .inl v) : - (f.diagram a).FullRight ((f.diagram a).edgeInput d) := by - rcases d with ⟨e, b⟩ - cases e with - | inl c => - cases b with - | false => exact f.greatest - | true => exact False.elim (Sum.inr_ne_inl targetOld) - | inr c => - cases b with - | false => exact False.elim (Sum.inr_ne_inl targetOld) - | true => exact f.greatest - -theorem old_local_full (v : CosetGeometry.Vertex J f.Letters) - (h : TileStars.depth J f.Letters R Sigma.fst (.inl v) ≠ 0) : - (f.diagram a).FullRight ((f.diagram a).localGlue (.inl v) h) := by - have nonroot : Sum.inl v ≠ TileStars.root J f.Letters R := - fun eq => h ((TileStars.depth_zero_iff J f.Letters R Sigma.fst _).mpr eq) - exact ((f.diagram a).fullRight_reindex - (TileStars.parent_eq J f.Letters R Sigma.fst (.inl v) nonroot).symm - (TileStars.incoming_target J f.Letters R Sigma.fst (.inl v) nonroot) _).mpr - (f.edge_full_at_old a _ v (TileStars.incoming_target J f.Letters R Sigma.fst (.inl v) nonroot)) - -theorem old_layer_no_fresh (n : Nat) (v : ((f.diagram a).scheme.stages n).Layer) - (c : CosetGeometry.Vertex J f.Letters) (oldVertex : v.val = .inl c) - (x : (((f.diagram a).scheme.stages n).batch.glue v).Fresh) : False := by - rcases v with ⟨v, hv⟩ - cases oldVertex - exact x.property (f.old_local_full a c - (((f.diagram a).scheme.stages n).layer_nonzero ⟨.inl c, hv⟩) x.val) - -theorem fresh_layer_is_tile (n : Nat) (x : ((f.diagram a).scheme.stages n).batch.Fresh) : - ∃ w r, x.1.val = .inr (w, r) := by - cases hv : x.1.val with - | inl v => exact False.elim (f.old_layer_no_fresh a n x.1 v hv x.2) - | inr c => exact ⟨c.1, c.2, rfl⟩ - -def Layer (n : Nat) := ((f.diagram a).scheme.stages n).Layer -def Cutoff (n : Nat) (U : f.Layer a n → Prop) := (f.diagram a).scheme.Partial n U -noncomputable def cutoffOrder (n : Nat) (U : f.Layer a n → Prop) : MeetOrder (f.Cutoff a n U) := - (f.diagram a).scheme.partialOrder n U -noncomputable def cutoffEmbedding (n : Nat) (U : f.Layer a n → Prop) : - IdealEmbedding (f.cutoffOrder a n U) (f.gluedOrder a) := - (f.diagram a).scheme.partialEmbedding n U - -noncomputable def cutoffPlacedTile (n : Nat) (U : f.Layer a n → Prop) - (w : External J f.Letters) (r : R) - (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) - (selected : U ⟨.inr (w, r), depth⟩) : IdealEmbedding (f.tile r).order (f.cutoffOrder a n U) := - ((f.diagram a).scheme.stages n).batch.cutoffTile U ⟨.inr (w, r), depth⟩ selected - -theorem cutoffPlacedTile_global (n : Nat) (U : f.Layer a n → Prop) - (w : External J f.Letters) (r : R) - (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) - (selected : U ⟨.inr (w, r), depth⟩) (x : (f.tile r).Space) : - (f.cutoffEmbedding a n U).toFun ((f.cutoffPlacedTile a n U w r depth selected).toFun x) = - (f.placedTile a w r).toFun x := - (f.diagram a).scheme.partialEmbedding_tile n U ⟨.inr (w, r), depth⟩ selected x - -noncomputable def cutoffTileRoot (n : Nat) (U : f.Layer a n → Prop) - (w : External J f.Letters) (r : R) - (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) - (selected : U ⟨.inr (w, r), depth⟩) : IdealEmbedding P (f.cutoffOrder a n U) := - (f.tile r).root.comp (f.cutoffPlacedTile a n U w r depth selected) - -noncomputable def cutoffTileChild (n : Nat) (U : f.Layer a n → Prop) - (w : External J f.Letters) (r : R) - (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) - (selected : U ⟨.inr (w, r), depth⟩) (j : f.Child r) : IdealEmbedding P (f.cutoffOrder a n U) := - ((f.tile r).child j).comp (f.cutoffPlacedTile a n U w r depth selected) - -theorem cutoffTileRoot_global (n : Nat) (U : f.Layer a n → Prop) - (w : External J f.Letters) (r : R) - (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) - (selected : U ⟨.inr (w, r), depth⟩) (x : A) : - (f.cutoffEmbedding a n U).toFun ((f.cutoffTileRoot a n U w r depth selected).toFun x) = - (f.copy a w).toFun x := - (f.cutoffPlacedTile_global a n U w r depth selected _).trans (f.root_identification a w r x) - -theorem cutoffTileChild_global (n : Nat) (U : f.Layer a n → Prop) - (w : External J f.Letters) (r : R) - (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) - (selected : U ⟨.inr (w, r), depth⟩) (j : f.Child r) (x : A) : - (f.cutoffEmbedding a n U).toFun ((f.cutoffTileChild a n U w r depth selected j).toFun x) = - (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x := - (f.cutoffPlacedTile_global a n U w r depth selected _).trans (f.child_identification a w r j x) - -end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - - - -namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing - -universe u - -@[instance_reducible] noncomputable def chosenWellOrder (I : Type u) : LinearOrder I := - Classical.choose (exists_wellFoundedLT I) - -theorem chosenWellOrder_wf (I : Type u) : - letI := chosenWellOrder I - WellFoundedLT I := Classical.choose_spec (exists_wellFoundedLT I) - -namespace Scheme -variable {V : Type u} (d : Scheme V) - -noncomputable def layerBefore (n : Nat) (v w : (d.stages n).Layer) : Prop := - letI := chosenWellOrder ((d.stages n).Layer) - w < v - -theorem layerBefore_irrefl (n : Nat) (v : (d.stages n).Layer) : ¬ d.layerBefore n v v := by - let := chosenWellOrder ((d.stages n).Layer) - exact lt_irrefl v - -theorem layerBefore_wf (n : Nat) : WellFounded (fun v w => d.layerBefore n w v) := by - let := chosenWellOrder ((d.stages n).Layer) - let := chosenWellOrder_wf ((d.stages n).Layer) - exact wellFounded_lt - -def Position := (n : Nat) ×' (d.stages n).Layer - -noncomputable def positionBefore : d.Position → d.Position → Prop := - PSigma.Lex Nat.lt (fun n v w => d.layerBefore n w v) - -theorem positionBefore_wf : WellFounded d.positionBefore := - WellFounded.psigma_lex Nat.lt_wfRel.wf d.layerBefore_wf - -theorem parent_position_before (p q : d.Position) (parent : p.2.val = d.parent q.2.val) : - d.positionBefore p q := by - have hp := p.2.property - have hq := q.2.property - have step := d.parent_depth q.2.val ((d.stages q.1).layer_nonzero q.2) - rw [← parent] at step - have less : p.1 < q.1 := by omega - exact @PSigma.Lex.left Nat (fun n => (d.stages n).Layer) Nat.lt - (fun n v w => d.layerBefore n w v) p.1 p.2 q.1 q.2 less - -noncomputable def orderedAttachment (n : Nat) (v : (d.stages n).Layer) : - MeetIso ((d.stages n).batch.stepInput (d.layerBefore n v) v).order - ((d.stages n).batch.cutoffOrder - (PrincipalBatch.Family.addComponent (d.layerBefore n v) v)) := - (d.stages n).batch.stepIso (d.layerBefore n v) v (d.layerBefore_irrefl n v) - -noncomputable def orderedCutoffEmbedding (n : Nat) (v : (d.stages n).Layer) : - IdealEmbedding (d.partialOrder n (d.layerBefore n v)) d.gluedOrder := - d.partialEmbedding n (d.layerBefore n v) - -theorem ordered_limit (n : Nat) (v : (d.stages n).Layer) - (earlier : ∃ s, d.layerBefore n v s) - (limit : ∀ i, d.layerBefore n v i → ∃ s, d.layerBefore n s i ∧ d.layerBefore n v s) - (x : (d.stages n).batch.Node) : - (d.stages n).batch.Present (d.layerBefore n v) x ↔ - ∃ s, d.layerBefore n v s ∧ (d.stages n).batch.Present (d.layerBefore n s) x := by - let := chosenWellOrder ((d.stages n).Layer) - exact (d.stages n).batch.before_limit v earlier limit x - -theorem ordered_layer_cover (n : Nat) (x : (d.stages n).batch.Node) : - (d.stages n).batch.Present (fun _ => False) x ∨ - ∃ v, (d.stages n).batch.Present - (PrincipalBatch.Family.addComponent (d.layerBefore n v) v) x := by - cases x with - | inl x => exact Or.inl True.intro - | inr x => exact Or.inr ⟨x.1, Or.inr rfl⟩ - -theorem ordered_new_vertex_meet (n : Nat) (v : (d.stages n).Layer) - (x : ((d.stages n).batch.glue v).Fresh) (y : d.Partial n (d.layerBefore n v)) : - d.gluedOrder.meet ((d.vertex v.val).toFun x.val) - ((d.orderedCutoffEmbedding n v).toFun y) = - d.gluedOrder.meet - ((d.vertex (d.parent v.val)).toFun - ((d.link v.val ((d.stages n).layer_nonzero v)).toFun - (Attachment.cut (d.order v.val) (d.childAnchor v.val ((d.stages n).layer_nonzero v)) - x.val)).val) - ((d.orderedCutoffEmbedding n v).toFun y) := - d.partial_new_vertex_meet n (d.layerBefore n v) v (d.layerBefore_irrefl n v) x y - -end Scheme - -end PartitionPilot.Compression.RecursiveMaps.RootedGluing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.PartialBatchLimits + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +open Attachment +universe u +variable {V : Type u} (d : Scheme V) + +def Partial (n : Nat) (U : (d.stages n).Layer → Prop) := (d.stages n).batch.Cutoff U + +noncomputable def partialOrder (n : Nat) (U : (d.stages n).Layer → Prop) : MeetOrder (d.Partial n U) := + (d.stages n).batch.cutoffOrder U + +noncomputable def partialEmbedding (n : Nat) (U : (d.stages n).Layer → Prop) : + IdealEmbedding (d.partialOrder n U) d.gluedOrder := + ((d.stages n).batch.cutoffEmbedding U).comp (d.chain.inclusion (n + 1)) + +theorem partialEmbedding_old (n : Nat) (U : (d.stages n).Layer → Prop) (x : (d.stages n).Point) : + (d.partialEmbedding n U).toFun (((d.stages n).batch.cutoffOld U).toFun x) = d.chain.point n x := + d.point_next n x + +theorem partialEmbedding_tile (n : Nat) (U : (d.stages n).Layer → Prop) + (v : (d.stages n).Layer) (hv : U v) (x : d.Space v.val) : + (d.partialEmbedding n U).toFun (((d.stages n).batch.cutoffTile U v hv).toFun x) = + (d.vertex v.val).toFun x := by + exact ((d.vertex_at v.val (n + 1) v.property.le x).trans + (congrArg (d.chain.point (n + 1)) ((d.stages n).successor_new v x))).symm + +noncomputable def partialOldVertex (n : Nat) (U : (d.stages n).Layer → Prop) + (v : V) (hv : d.depth v ≤ n) : IdealEmbedding (d.order v) (d.partialOrder n U) := + ((d.stages n).vertex v hv).comp ((d.stages n).batch.cutoffOld U) + +theorem partialOldVertex_global (n : Nat) (U : (d.stages n).Layer → Prop) + (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : + (d.partialEmbedding n U).toFun ((d.partialOldVertex n U v hv).toFun x) = + (d.vertex v).toFun x := by + change (d.partialEmbedding n U).toFun (((d.stages n).batch.cutoffOld U).toFun + (((d.stages n).vertex v hv).toFun x)) = _ + rw [d.partialEmbedding_old] + exact (d.vertex_at v n hv x).symm + +theorem partial_no_later_nodes (n : Nat) (U : (d.stages n).Layer → Prop) + (x : d.Partial n U) (y : d.Node) + (lower : d.gluedOrder.le y ((d.partialEmbedding n U).toFun x)) : + ∃ z, (d.partialEmbedding n U).toFun z = y := (d.partialEmbedding n U).ideal x y lower + +noncomputable def partialLater {n m : Nat} (later : n < m) + (U : (d.stages n).Layer → Prop) (W : (d.stages m).Layer → Prop) : + IdealEmbedding (d.partialOrder n U) (d.partialOrder m W) := + (((d.stages n).batch.cutoffEmbedding U).comp (d.chain.raise (Nat.succ_le_of_lt later))).comp + ((d.stages m).batch.cutoffOld W) + +theorem partialLater_global {n m : Nat} (later : n < m) + (U : (d.stages n).Layer → Prop) (W : (d.stages m).Layer → Prop) (x : d.Partial n U) : + (d.partialEmbedding m W).toFun ((d.partialLater later U W).toFun x) = + (d.partialEmbedding n U).toFun x := by + exact (d.partialEmbedding_old m W (d.chain.up (Nat.succ_le_of_lt later) x.val)).trans + (d.chain.include_up (Nat.succ_le_of_lt later) x.val) + +theorem partial_cover (z : d.Node) : + ∃ n, ∃ x : d.Partial n (fun _ => False), (d.partialEmbedding n (fun _ => False)).toFun x = z := by + rcases d.chain.cover z with ⟨n, x, rfl⟩ + exact ⟨n, ((d.stages n).batch.cutoffOld (fun _ => False)).toFun x, d.partialEmbedding_old n _ x⟩ + +theorem partial_outside_meet (n : Nat) (U : (d.stages n).Layer → Prop) + (v : (d.stages n).Layer) (outside : ¬ U v) + (x : ((d.stages n).batch.glue v).Fresh) (y : d.Partial n U) : + d.gluedOrder.meet (d.chain.point (n + 1) (.inr ⟨v, x⟩)) ((d.partialEmbedding n U).toFun y) = + d.gluedOrder.meet (d.chain.point n (((d.stages n).batch.glue v).shadow x.val)) + ((d.partialEmbedding n U).toFun y) := by + rw [← d.point_next n (((d.stages n).batch.glue v).shadow x.val)] + change d.chain.unionOrder.meet ((d.chain.inclusion (n + 1)).toFun (.inr ⟨v, x⟩)) + ((d.chain.inclusion (n + 1)).toFun y.val) = + d.chain.unionOrder.meet ((d.chain.inclusion (n + 1)).toFun + ((d.stages n).batch.old.toFun (((d.stages n).batch.glue v).shadow x.val))) + ((d.chain.inclusion (n + 1)).toFun y.val) + exact ((d.chain.inclusion (n + 1)).map_meet _ _).symm.trans + ((congrArg (d.chain.inclusion (n + 1)).toFun + ((d.stages n).batch.outside_meet U v outside x y)).trans + ((d.chain.inclusion (n + 1)).map_meet _ _)) + +theorem partial_new_vertex_meet (n : Nat) (U : (d.stages n).Layer → Prop) + (v : (d.stages n).Layer) (outside : ¬ U v) + (x : ((d.stages n).batch.glue v).Fresh) (y : d.Partial n U) : + d.gluedOrder.meet ((d.vertex v.val).toFun x.val) ((d.partialEmbedding n U).toFun y) = + d.gluedOrder.meet + ((d.vertex (d.parent v.val)).toFun + ((d.link v.val ((d.stages n).layer_nonzero v)).toFun + (cut (d.order v.val) (d.childAnchor v.val ((d.stages n).layer_nonzero v)) x.val)).val) + ((d.partialEmbedding n U).toFun y) := by + have fresh : ((d.stages n).batch.tile v).toFun x.val = .inr ⟨v, x⟩ := + congrArg ((d.stages n).batch.componentMap v) + (((d.stages n).batch.glue v).represent_new x.val x.property) + have vx := (d.vertex_at v.val (n + 1) v.property.le x.val).trans + (congrArg (d.chain.point (n + 1)) (((d.stages n).successor_new v x.val).trans fresh)) + rw [vx, d.partial_outside_meet n U v outside x y] + congr 1 + exact (d.vertex_at (d.parent v.val) n ((d.stages n).parent_present v) _).symm + +end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + + + +namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces + +universe u +variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) + +def FullRight {v w : Vertex J S R} (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : Prop := + ∀ x, (g.order w).le x i.rightAnchor + +theorem fullRight_reindex {v w v' w' : Vertex J S R} (hv : v = v') (hw : w = w') + (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : + g.FullRight (g.reindexInput hv hw i) ↔ g.FullRight i := by + cases hv + cases hw + rfl + +end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces + +namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +open Attachment CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +theorem edge_full_at_old (d : TileStars.Dart J f.Letters R) (v : CosetGeometry.Vertex J f.Letters) + (targetOld : TileStars.target J f.Letters R Sigma.fst d = .inl v) : + (f.diagram a).FullRight ((f.diagram a).edgeInput d) := by + rcases d with ⟨e, b⟩ + cases e with + | inl c => + cases b with + | false => exact f.greatest + | true => exact False.elim (Sum.inr_ne_inl targetOld) + | inr c => + cases b with + | false => exact False.elim (Sum.inr_ne_inl targetOld) + | true => exact f.greatest + +theorem old_local_full (v : CosetGeometry.Vertex J f.Letters) + (h : TileStars.depth J f.Letters R Sigma.fst (.inl v) ≠ 0) : + (f.diagram a).FullRight ((f.diagram a).localGlue (.inl v) h) := by + have nonroot : Sum.inl v ≠ TileStars.root J f.Letters R := + fun eq => h ((TileStars.depth_zero_iff J f.Letters R Sigma.fst _).mpr eq) + exact ((f.diagram a).fullRight_reindex + (TileStars.parent_eq J f.Letters R Sigma.fst (.inl v) nonroot).symm + (TileStars.incoming_target J f.Letters R Sigma.fst (.inl v) nonroot) _).mpr + (f.edge_full_at_old a _ v (TileStars.incoming_target J f.Letters R Sigma.fst (.inl v) nonroot)) + +theorem old_layer_no_fresh (n : Nat) (v : ((f.diagram a).scheme.stages n).Layer) + (c : CosetGeometry.Vertex J f.Letters) (oldVertex : v.val = .inl c) + (x : (((f.diagram a).scheme.stages n).batch.glue v).Fresh) : False := by + rcases v with ⟨v, hv⟩ + cases oldVertex + exact x.property (f.old_local_full a c + (((f.diagram a).scheme.stages n).layer_nonzero ⟨.inl c, hv⟩) x.val) + +theorem fresh_layer_is_tile (n : Nat) (x : ((f.diagram a).scheme.stages n).batch.Fresh) : + ∃ w r, x.1.val = .inr (w, r) := by + cases hv : x.1.val with + | inl v => exact False.elim (f.old_layer_no_fresh a n x.1 v hv x.2) + | inr c => exact ⟨c.1, c.2, rfl⟩ + +def Layer (n : Nat) := ((f.diagram a).scheme.stages n).Layer +def Cutoff (n : Nat) (U : f.Layer a n → Prop) := (f.diagram a).scheme.Partial n U +noncomputable def cutoffOrder (n : Nat) (U : f.Layer a n → Prop) : MeetOrder (f.Cutoff a n U) := + (f.diagram a).scheme.partialOrder n U +noncomputable def cutoffEmbedding (n : Nat) (U : f.Layer a n → Prop) : + IdealEmbedding (f.cutoffOrder a n U) (f.gluedOrder a) := + (f.diagram a).scheme.partialEmbedding n U + +noncomputable def cutoffPlacedTile (n : Nat) (U : f.Layer a n → Prop) + (w : External J f.Letters) (r : R) + (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) + (selected : U ⟨.inr (w, r), depth⟩) : IdealEmbedding (f.tile r).order (f.cutoffOrder a n U) := + ((f.diagram a).scheme.stages n).batch.cutoffTile U ⟨.inr (w, r), depth⟩ selected + +theorem cutoffPlacedTile_global (n : Nat) (U : f.Layer a n → Prop) + (w : External J f.Letters) (r : R) + (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) + (selected : U ⟨.inr (w, r), depth⟩) (x : (f.tile r).Space) : + (f.cutoffEmbedding a n U).toFun ((f.cutoffPlacedTile a n U w r depth selected).toFun x) = + (f.placedTile a w r).toFun x := + (f.diagram a).scheme.partialEmbedding_tile n U ⟨.inr (w, r), depth⟩ selected x + +noncomputable def cutoffTileRoot (n : Nat) (U : f.Layer a n → Prop) + (w : External J f.Letters) (r : R) + (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) + (selected : U ⟨.inr (w, r), depth⟩) : IdealEmbedding P (f.cutoffOrder a n U) := + (f.tile r).root.comp (f.cutoffPlacedTile a n U w r depth selected) + +noncomputable def cutoffTileChild (n : Nat) (U : f.Layer a n → Prop) + (w : External J f.Letters) (r : R) + (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) + (selected : U ⟨.inr (w, r), depth⟩) (j : f.Child r) : IdealEmbedding P (f.cutoffOrder a n U) := + ((f.tile r).child j).comp (f.cutoffPlacedTile a n U w r depth selected) + +theorem cutoffTileRoot_global (n : Nat) (U : f.Layer a n → Prop) + (w : External J f.Letters) (r : R) + (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) + (selected : U ⟨.inr (w, r), depth⟩) (x : A) : + (f.cutoffEmbedding a n U).toFun ((f.cutoffTileRoot a n U w r depth selected).toFun x) = + (f.copy a w).toFun x := + (f.cutoffPlacedTile_global a n U w r depth selected _).trans (f.root_identification a w r x) + +theorem cutoffTileChild_global (n : Nat) (U : f.Layer a n → Prop) + (w : External J f.Letters) (r : R) + (depth : TileStars.depth J f.Letters R Sigma.fst (.inr (w, r)) = n + 1) + (selected : U ⟨.inr (w, r), depth⟩) (j : f.Child r) (x : A) : + (f.cutoffEmbedding a n U).toFun ((f.cutoffTileChild a n U w r depth selected j).toFun x) = + (f.copy a (w * generator J f.Letters ⟨r, j⟩)).toFun x := + (f.cutoffPlacedTile_global a n U w r depth selected _).trans (f.child_identification a w r j x) + +end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + + + +namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing + +universe u + +@[instance_reducible] noncomputable def chosenWellOrder (I : Type u) : LinearOrder I := + Classical.choose (exists_wellFoundedLT I) + +theorem chosenWellOrder_wf (I : Type u) : + letI := chosenWellOrder I + WellFoundedLT I := Classical.choose_spec (exists_wellFoundedLT I) + +namespace Scheme +variable {V : Type u} (d : Scheme V) + +noncomputable def layerBefore (n : Nat) (v w : (d.stages n).Layer) : Prop := + letI := chosenWellOrder ((d.stages n).Layer) + w < v + +theorem layerBefore_irrefl (n : Nat) (v : (d.stages n).Layer) : ¬ d.layerBefore n v v := by + let := chosenWellOrder ((d.stages n).Layer) + exact lt_irrefl v + +theorem layerBefore_wf (n : Nat) : WellFounded (fun v w => d.layerBefore n w v) := by + let := chosenWellOrder ((d.stages n).Layer) + let := chosenWellOrder_wf ((d.stages n).Layer) + exact wellFounded_lt + +def Position := (n : Nat) ×' (d.stages n).Layer + +noncomputable def positionBefore : d.Position → d.Position → Prop := + PSigma.Lex Nat.lt (fun n v w => d.layerBefore n w v) + +theorem positionBefore_wf : WellFounded d.positionBefore := + WellFounded.psigma_lex Nat.lt_wfRel.wf d.layerBefore_wf + +theorem parent_position_before (p q : d.Position) (parent : p.2.val = d.parent q.2.val) : + d.positionBefore p q := by + have hp := p.2.property + have hq := q.2.property + have step := d.parent_depth q.2.val ((d.stages q.1).layer_nonzero q.2) + rw [← parent] at step + have less : p.1 < q.1 := by omega + exact @PSigma.Lex.left Nat (fun n => (d.stages n).Layer) Nat.lt + (fun n v w => d.layerBefore n w v) p.1 p.2 q.1 q.2 less + +noncomputable def orderedAttachment (n : Nat) (v : (d.stages n).Layer) : + MeetIso ((d.stages n).batch.stepInput (d.layerBefore n v) v).order + ((d.stages n).batch.cutoffOrder + (PrincipalBatch.Family.addComponent (d.layerBefore n v) v)) := + (d.stages n).batch.stepIso (d.layerBefore n v) v (d.layerBefore_irrefl n v) + +noncomputable def orderedCutoffEmbedding (n : Nat) (v : (d.stages n).Layer) : + IdealEmbedding (d.partialOrder n (d.layerBefore n v)) d.gluedOrder := + d.partialEmbedding n (d.layerBefore n v) + +theorem ordered_limit (n : Nat) (v : (d.stages n).Layer) + (earlier : ∃ s, d.layerBefore n v s) + (limit : ∀ i, d.layerBefore n v i → ∃ s, d.layerBefore n s i ∧ d.layerBefore n v s) + (x : (d.stages n).batch.Node) : + (d.stages n).batch.Present (d.layerBefore n v) x ↔ + ∃ s, d.layerBefore n v s ∧ (d.stages n).batch.Present (d.layerBefore n s) x := by + let := chosenWellOrder ((d.stages n).Layer) + exact (d.stages n).batch.before_limit v earlier limit x + +theorem ordered_layer_cover (n : Nat) (x : (d.stages n).batch.Node) : + (d.stages n).batch.Present (fun _ => False) x ∨ + ∃ v, (d.stages n).batch.Present + (PrincipalBatch.Family.addComponent (d.layerBefore n v) v) x := by + cases x with + | inl x => exact Or.inl True.intro + | inr x => exact Or.inr ⟨x.1, Or.inr rfl⟩ + +theorem ordered_new_vertex_meet (n : Nat) (v : (d.stages n).Layer) + (x : ((d.stages n).batch.glue v).Fresh) (y : d.Partial n (d.layerBefore n v)) : + d.gluedOrder.meet ((d.vertex v.val).toFun x.val) + ((d.orderedCutoffEmbedding n v).toFun y) = + d.gluedOrder.meet + ((d.vertex (d.parent v.val)).toFun + ((d.link v.val ((d.stages n).layer_nonzero v)).toFun + (Attachment.cut (d.order v.val) (d.childAnchor v.val ((d.stages n).layer_nonzero v)) + x.val)).val) + ((d.orderedCutoffEmbedding n v).toFun y) := + d.partial_new_vertex_meet n (d.layerBefore n v) v (d.layerBefore_irrefl n v) x y + +end Scheme + +end PartitionPilot.Compression.RecursiveMaps.RootedGluing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PartialBatchStep.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PartialBatchStep.lean index e789148efcca45f33b60e8eb8e3265d34fe374ba..8f6f73ad9d3e2d8b63532d3e354d05888768c972 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PartialBatchStep.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PartialBatchStep.lean @@ -1,230 +1,230 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FixedTop - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family - -universe u -variable {A I : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) - -def Present (U : I → Prop) : b.Node → Prop - | .inl _ => True - | .inr x => U x.1 - -theorem present_down (U : I → Prop) {x y : b.Node} (hy : b.Present U y) - (hxy : b.extension.le x y) : b.Present U x := by - cases x with - | inl x => exact True.intro - | inr x => - cases y with - | inl y => exact False.elim hxy - | inr y => - rcases hxy with ⟨eq, _⟩ | impossible - · change U x.1 - change U y.1 at hy - exact eq.symm ▸ hy - · exact False.elim impossible - -def Cutoff (U : I → Prop) := {x : b.Node // b.Present U x} - -noncomputable def cutoffOrder (U : I → Prop) : MeetOrder (b.Cutoff U) where - le x y := b.extension.le x.val y.val - meet x y := ⟨b.extension.meet x.val y.val, - b.present_down U x.property (b.extension.meet_le_left _ _)⟩ - refl x := b.extension.refl x.val - trans := b.extension.trans - antisymm hxy hyx := Subtype.ext (b.extension.antisymm hxy hyx) - meet_le_left x y := b.extension.meet_le_left x.val y.val - meet_le_right x y := b.extension.meet_le_right x.val y.val - le_meet := b.extension.le_meet - -noncomputable def cutoffEmbedding (U : I → Prop) : IdealEmbedding (b.cutoffOrder U) b.extension where - toFun := Subtype.val - le_iff _ _ := Iff.rfl - map_meet _ _ := rfl - ideal x y h := ⟨⟨y, b.present_down U x.property h⟩, rfl⟩ - -noncomputable def cutoffOld (U : I → Prop) : IdealEmbedding P (b.cutoffOrder U) where - toFun x := ⟨b.old.toFun x, True.intro⟩ - le_iff x y := b.old.le_iff x y - map_meet x y := Subtype.ext (b.old.map_meet x y) - ideal x y h := by - rcases b.old.ideal x y.val h with ⟨z, eq⟩ - exact ⟨z, Subtype.ext eq⟩ - -theorem present_tile (U : I → Prop) (i : I) (hi : U i) (x : b.Space i) : - b.Present U ((b.tile i).toFun x) := by - change b.Present U (b.componentMap i ((b.glue i).represent x)) - cases (b.glue i).represent x with - | inl y => exact True.intro - | inr y => exact hi - -noncomputable def cutoffTile (U : I → Prop) (i : I) (hi : U i) : - IdealEmbedding (b.order i) (b.cutoffOrder U) where - toFun x := ⟨(b.tile i).toFun x, b.present_tile U i hi x⟩ - le_iff x y := (b.tile i).le_iff x y - map_meet x y := Subtype.ext ((b.tile i).map_meet x y) - ideal x y h := by - rcases (b.tile i).ideal x y.val h with ⟨z, eq⟩ - exact ⟨z, Subtype.ext eq⟩ - -theorem present_mono {U V : I → Prop} (h : ∀ i, U i → V i) {x : b.Node} - (hx : b.Present U x) : b.Present V x := by - cases x with - | inl x => exact True.intro - | inr x => exact h x.1 hx - -noncomputable def cutoffInclusion {U V : I → Prop} (h : ∀ i, U i → V i) : - IdealEmbedding (b.cutoffOrder U) (b.cutoffOrder V) where - toFun x := ⟨x.val, b.present_mono h x.property⟩ - le_iff _ _ := Iff.rfl - map_meet _ _ := rfl - ideal x y lower := ⟨⟨y.val, b.present_down U x.property lower⟩, rfl⟩ - -theorem cutoffInclusion_coherent {U V W : I → Prop} (hUV : ∀ i, U i → V i) - (hVW : ∀ i, V i → W i) (x : b.Cutoff U) : - (b.cutoffInclusion hVW).toFun ((b.cutoffInclusion hUV).toFun x) = - (b.cutoffInclusion (fun i hi => hVW i (hUV i hi))).toFun x := rfl - -theorem cutoff_no_new_below (U : I → Prop) (x : b.Cutoff U) (y : b.Node) - (lower : b.extension.le y x.val) : ∃ z : b.Cutoff U, z.val = y := - (b.cutoffEmbedding U).ideal x y lower - -theorem cutoff_cover (U : I → Prop) (x : b.Cutoff U) : - (∃ a, (b.cutoffOld U).toFun a = x) ∨ - ∃ i, ∃ hi : U i, ∃ y, (b.cutoffTile U i hi).toFun y = x := by - rcases x with ⟨x, hx⟩ - cases x with - | inl x => exact Or.inl ⟨x, rfl⟩ - | inr x => - refine Or.inr ⟨x.1, hx, x.2.val, ?_⟩ - apply Subtype.ext - exact congrArg (b.componentMap x.1) ((b.glue x.1).represent_new x.2.val x.2.property) - -end PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family - - - -namespace PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family - -open Attachment -universe u -variable {A I : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) - -theorem outside_greatest_part (U : I → Prop) (i : I) (outside : ¬ U i) - (x : (b.glue i).Fresh) (y : b.Cutoff U) : - b.extension.le y.val (.inr ⟨i, x⟩) ↔ - b.extension.le y.val (b.old.toFun ((b.glue i).shadow x.val)) := by - rcases y with ⟨y, hy⟩ - cases y with - | inl y => exact Iff.rfl - | inr y => - constructor - · intro h - have different : y.1 ≠ i := by - intro eq - change U y.1 at hy - exact outside (eq ▸ hy) - exact False.elim (b.different_fresh_incomparable y ⟨i, x⟩ different h) - · exact False.elim - -theorem outside_meet (U : I → Prop) (i : I) (outside : ¬ U i) - (x : (b.glue i).Fresh) (y : b.Cutoff U) : - b.extension.meet (.inr ⟨i, x⟩) y.val = - b.extension.meet (b.old.toFun ((b.glue i).shadow x.val)) y.val := by - apply b.extension.antisymm - · let z : b.Cutoff U := ⟨b.extension.meet (.inr ⟨i, x⟩) y.val, - b.present_down U y.property (b.extension.meet_le_right _ _)⟩ - exact b.extension.le_meet - ((b.outside_greatest_part U i outside x z).mp (b.extension.meet_le_left _ _)) - (b.extension.meet_le_right _ _) - · exact b.extension.le_meet - (b.extension.trans (b.extension.meet_le_left _ _) - ((b.fresh_greatest_old_part ⟨i, x⟩ _).mpr (P.refl _))) - (b.extension.meet_le_right _ _) - -theorem present_unselected_tile (U : I → Prop) (i : I) (outside : ¬ U i) (x : b.Space i) : - b.Present U ((b.tile i).toFun x) ↔ (b.order i).le x (b.glue i).rightAnchor := by - classical - change b.Present U (b.componentMap i ((b.glue i).represent x)) ↔ _ - by_cases hx : (b.order i).le x (b.glue i).rightAnchor - · rw [(b.glue i).represent_old x hx] - exact ⟨fun _ => hx, fun _ => True.intro⟩ - · rw [(b.glue i).represent_new x hx] - exact ⟨fun hi => False.elim (outside hi), fun h => False.elim (hx h)⟩ - -def addComponent (U : I → Prop) (i : I) (j : I) : Prop := U j ∨ j = i - -noncomputable def stepInput (U : I → Prop) (i : I) : - PrincipalAmalgamation.Input (b.cutoffOrder U) (b.order i) where - leftAnchor := (b.cutoffOld U).toFun (b.glue i).leftAnchor - rightAnchor := (b.glue i).rightAnchor - overlap := RootedGluing.chainIso (b.glue i).overlap - ((b.cutoffOld U).principalIso (b.glue i).leftAnchor) - -def stepMap (U : I → Prop) (i : I) : (b.stepInput U i).Node → b.Cutoff (addComponent U i) - | .inl x => ⟨x.val, b.present_mono (fun _ h => Or.inl h) x.property⟩ - | .inr x => ⟨.inr ⟨i, x⟩, Or.inr rfl⟩ - -theorem stepMap_le (U : I → Prop) (i : I) (outside : ¬ U i) (x y : (b.stepInput U i).Node) : - (b.cutoffOrder (addComponent U i)).le (b.stepMap U i x) (b.stepMap U i y) ↔ - (b.stepInput U i).order.le x y := by - cases x with - | inl x => - cases y with - | inl y => exact Iff.rfl - | inr y => exact b.outside_greatest_part U i outside y x - | inr x => - cases y with - | inl y => - exact ⟨fun h => False.elim (outside (b.present_down U y.property h)), False.elim⟩ - | inr y => exact b.componentMap_le i (.inr x) (.inr y) - -theorem stepMap_surjective (U : I → Prop) (i : I) (y : b.Cutoff (addComponent U i)) : - ∃ x, b.stepMap U i x = y := by - rcases y with ⟨y, hy⟩ - cases y with - | inl y => exact ⟨.inl ⟨.inl y, True.intro⟩, rfl⟩ - | inr y => - rcases y with ⟨j, y⟩ - rcases hy with hj | rfl - · exact ⟨.inl ⟨.inr ⟨j, y⟩, hj⟩, rfl⟩ - · exact ⟨.inr y, rfl⟩ - -noncomputable def stepEmbedding (U : I → Prop) (i : I) (outside : ¬ U i) : - IdealEmbedding (b.stepInput U i).order (b.cutoffOrder (addComponent U i)) := - IdealEmbedding.ofOrderMap (b.stepMap U i) (b.stepMap_le U i outside) - (fun _ y _ => b.stepMap_surjective U i y) - -noncomputable def stepIso (U : I → Prop) (i : I) (outside : ¬ U i) : - MeetIso (b.stepInput U i).order (b.cutoffOrder (addComponent U i)) where - toMeetEmbedding := (b.stepEmbedding U i outside).toMeetEmbedding - inverse y := Classical.choose (b.stepMap_surjective U i y) - right_inverse y := Classical.choose_spec (b.stepMap_surjective U i y) - left_inverse x := embedding_injective (b.stepEmbedding U i outside).toMeetEmbedding - (Classical.choose_spec (b.stepMap_surjective U i (b.stepMap U i x))) - -theorem stepIso_old (U : I → Prop) (i : I) (outside : ¬ U i) (x : b.Cutoff U) : - (b.stepIso U i outside).toFun ((b.stepInput U i).left.toFun x) = - (b.cutoffInclusion (fun _ h => Or.inl h : ∀ j, U j → addComponent U i j)).toFun x := rfl - -theorem stepIso_tile (U : I → Prop) (i : I) (outside : ¬ U i) (x : b.Space i) : - (b.stepIso U i outside).toFun ((b.stepInput U i).right.toFun x) = - (b.cutoffTile (addComponent U i) i (Or.inr rfl)).toFun x := by - classical - apply Subtype.ext - change (b.stepMap U i ((b.stepInput U i).represent x)).val = - b.componentMap i ((b.glue i).represent x) - by_cases hx : (b.order i).le x (b.glue i).rightAnchor - · rw [(b.stepInput U i).represent_old x hx, (b.glue i).represent_old x hx] - rfl - · rw [(b.stepInput U i).represent_new x hx, (b.glue i).represent_new x hx] - rfl - -end PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FixedTop + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family + +universe u +variable {A I : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) + +def Present (U : I → Prop) : b.Node → Prop + | .inl _ => True + | .inr x => U x.1 + +theorem present_down (U : I → Prop) {x y : b.Node} (hy : b.Present U y) + (hxy : b.extension.le x y) : b.Present U x := by + cases x with + | inl x => exact True.intro + | inr x => + cases y with + | inl y => exact False.elim hxy + | inr y => + rcases hxy with ⟨eq, _⟩ | impossible + · change U x.1 + change U y.1 at hy + exact eq.symm ▸ hy + · exact False.elim impossible + +def Cutoff (U : I → Prop) := {x : b.Node // b.Present U x} + +noncomputable def cutoffOrder (U : I → Prop) : MeetOrder (b.Cutoff U) where + le x y := b.extension.le x.val y.val + meet x y := ⟨b.extension.meet x.val y.val, + b.present_down U x.property (b.extension.meet_le_left _ _)⟩ + refl x := b.extension.refl x.val + trans := b.extension.trans + antisymm hxy hyx := Subtype.ext (b.extension.antisymm hxy hyx) + meet_le_left x y := b.extension.meet_le_left x.val y.val + meet_le_right x y := b.extension.meet_le_right x.val y.val + le_meet := b.extension.le_meet + +noncomputable def cutoffEmbedding (U : I → Prop) : IdealEmbedding (b.cutoffOrder U) b.extension where + toFun := Subtype.val + le_iff _ _ := Iff.rfl + map_meet _ _ := rfl + ideal x y h := ⟨⟨y, b.present_down U x.property h⟩, rfl⟩ + +noncomputable def cutoffOld (U : I → Prop) : IdealEmbedding P (b.cutoffOrder U) where + toFun x := ⟨b.old.toFun x, True.intro⟩ + le_iff x y := b.old.le_iff x y + map_meet x y := Subtype.ext (b.old.map_meet x y) + ideal x y h := by + rcases b.old.ideal x y.val h with ⟨z, eq⟩ + exact ⟨z, Subtype.ext eq⟩ + +theorem present_tile (U : I → Prop) (i : I) (hi : U i) (x : b.Space i) : + b.Present U ((b.tile i).toFun x) := by + change b.Present U (b.componentMap i ((b.glue i).represent x)) + cases (b.glue i).represent x with + | inl y => exact True.intro + | inr y => exact hi + +noncomputable def cutoffTile (U : I → Prop) (i : I) (hi : U i) : + IdealEmbedding (b.order i) (b.cutoffOrder U) where + toFun x := ⟨(b.tile i).toFun x, b.present_tile U i hi x⟩ + le_iff x y := (b.tile i).le_iff x y + map_meet x y := Subtype.ext ((b.tile i).map_meet x y) + ideal x y h := by + rcases (b.tile i).ideal x y.val h with ⟨z, eq⟩ + exact ⟨z, Subtype.ext eq⟩ + +theorem present_mono {U V : I → Prop} (h : ∀ i, U i → V i) {x : b.Node} + (hx : b.Present U x) : b.Present V x := by + cases x with + | inl x => exact True.intro + | inr x => exact h x.1 hx + +noncomputable def cutoffInclusion {U V : I → Prop} (h : ∀ i, U i → V i) : + IdealEmbedding (b.cutoffOrder U) (b.cutoffOrder V) where + toFun x := ⟨x.val, b.present_mono h x.property⟩ + le_iff _ _ := Iff.rfl + map_meet _ _ := rfl + ideal x y lower := ⟨⟨y.val, b.present_down U x.property lower⟩, rfl⟩ + +theorem cutoffInclusion_coherent {U V W : I → Prop} (hUV : ∀ i, U i → V i) + (hVW : ∀ i, V i → W i) (x : b.Cutoff U) : + (b.cutoffInclusion hVW).toFun ((b.cutoffInclusion hUV).toFun x) = + (b.cutoffInclusion (fun i hi => hVW i (hUV i hi))).toFun x := rfl + +theorem cutoff_no_new_below (U : I → Prop) (x : b.Cutoff U) (y : b.Node) + (lower : b.extension.le y x.val) : ∃ z : b.Cutoff U, z.val = y := + (b.cutoffEmbedding U).ideal x y lower + +theorem cutoff_cover (U : I → Prop) (x : b.Cutoff U) : + (∃ a, (b.cutoffOld U).toFun a = x) ∨ + ∃ i, ∃ hi : U i, ∃ y, (b.cutoffTile U i hi).toFun y = x := by + rcases x with ⟨x, hx⟩ + cases x with + | inl x => exact Or.inl ⟨x, rfl⟩ + | inr x => + refine Or.inr ⟨x.1, hx, x.2.val, ?_⟩ + apply Subtype.ext + exact congrArg (b.componentMap x.1) ((b.glue x.1).represent_new x.2.val x.2.property) + +end PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family + + + +namespace PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family + +open Attachment +universe u +variable {A I : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) + +theorem outside_greatest_part (U : I → Prop) (i : I) (outside : ¬ U i) + (x : (b.glue i).Fresh) (y : b.Cutoff U) : + b.extension.le y.val (.inr ⟨i, x⟩) ↔ + b.extension.le y.val (b.old.toFun ((b.glue i).shadow x.val)) := by + rcases y with ⟨y, hy⟩ + cases y with + | inl y => exact Iff.rfl + | inr y => + constructor + · intro h + have different : y.1 ≠ i := by + intro eq + change U y.1 at hy + exact outside (eq ▸ hy) + exact False.elim (b.different_fresh_incomparable y ⟨i, x⟩ different h) + · exact False.elim + +theorem outside_meet (U : I → Prop) (i : I) (outside : ¬ U i) + (x : (b.glue i).Fresh) (y : b.Cutoff U) : + b.extension.meet (.inr ⟨i, x⟩) y.val = + b.extension.meet (b.old.toFun ((b.glue i).shadow x.val)) y.val := by + apply b.extension.antisymm + · let z : b.Cutoff U := ⟨b.extension.meet (.inr ⟨i, x⟩) y.val, + b.present_down U y.property (b.extension.meet_le_right _ _)⟩ + exact b.extension.le_meet + ((b.outside_greatest_part U i outside x z).mp (b.extension.meet_le_left _ _)) + (b.extension.meet_le_right _ _) + · exact b.extension.le_meet + (b.extension.trans (b.extension.meet_le_left _ _) + ((b.fresh_greatest_old_part ⟨i, x⟩ _).mpr (P.refl _))) + (b.extension.meet_le_right _ _) + +theorem present_unselected_tile (U : I → Prop) (i : I) (outside : ¬ U i) (x : b.Space i) : + b.Present U ((b.tile i).toFun x) ↔ (b.order i).le x (b.glue i).rightAnchor := by + classical + change b.Present U (b.componentMap i ((b.glue i).represent x)) ↔ _ + by_cases hx : (b.order i).le x (b.glue i).rightAnchor + · rw [(b.glue i).represent_old x hx] + exact ⟨fun _ => hx, fun _ => True.intro⟩ + · rw [(b.glue i).represent_new x hx] + exact ⟨fun hi => False.elim (outside hi), fun h => False.elim (hx h)⟩ + +def addComponent (U : I → Prop) (i : I) (j : I) : Prop := U j ∨ j = i + +noncomputable def stepInput (U : I → Prop) (i : I) : + PrincipalAmalgamation.Input (b.cutoffOrder U) (b.order i) where + leftAnchor := (b.cutoffOld U).toFun (b.glue i).leftAnchor + rightAnchor := (b.glue i).rightAnchor + overlap := RootedGluing.chainIso (b.glue i).overlap + ((b.cutoffOld U).principalIso (b.glue i).leftAnchor) + +def stepMap (U : I → Prop) (i : I) : (b.stepInput U i).Node → b.Cutoff (addComponent U i) + | .inl x => ⟨x.val, b.present_mono (fun _ h => Or.inl h) x.property⟩ + | .inr x => ⟨.inr ⟨i, x⟩, Or.inr rfl⟩ + +theorem stepMap_le (U : I → Prop) (i : I) (outside : ¬ U i) (x y : (b.stepInput U i).Node) : + (b.cutoffOrder (addComponent U i)).le (b.stepMap U i x) (b.stepMap U i y) ↔ + (b.stepInput U i).order.le x y := by + cases x with + | inl x => + cases y with + | inl y => exact Iff.rfl + | inr y => exact b.outside_greatest_part U i outside y x + | inr x => + cases y with + | inl y => + exact ⟨fun h => False.elim (outside (b.present_down U y.property h)), False.elim⟩ + | inr y => exact b.componentMap_le i (.inr x) (.inr y) + +theorem stepMap_surjective (U : I → Prop) (i : I) (y : b.Cutoff (addComponent U i)) : + ∃ x, b.stepMap U i x = y := by + rcases y with ⟨y, hy⟩ + cases y with + | inl y => exact ⟨.inl ⟨.inl y, True.intro⟩, rfl⟩ + | inr y => + rcases y with ⟨j, y⟩ + rcases hy with hj | rfl + · exact ⟨.inl ⟨.inr ⟨j, y⟩, hj⟩, rfl⟩ + · exact ⟨.inr y, rfl⟩ + +noncomputable def stepEmbedding (U : I → Prop) (i : I) (outside : ¬ U i) : + IdealEmbedding (b.stepInput U i).order (b.cutoffOrder (addComponent U i)) := + IdealEmbedding.ofOrderMap (b.stepMap U i) (b.stepMap_le U i outside) + (fun _ y _ => b.stepMap_surjective U i y) + +noncomputable def stepIso (U : I → Prop) (i : I) (outside : ¬ U i) : + MeetIso (b.stepInput U i).order (b.cutoffOrder (addComponent U i)) where + toMeetEmbedding := (b.stepEmbedding U i outside).toMeetEmbedding + inverse y := Classical.choose (b.stepMap_surjective U i y) + right_inverse y := Classical.choose_spec (b.stepMap_surjective U i y) + left_inverse x := embedding_injective (b.stepEmbedding U i outside).toMeetEmbedding + (Classical.choose_spec (b.stepMap_surjective U i (b.stepMap U i x))) + +theorem stepIso_old (U : I → Prop) (i : I) (outside : ¬ U i) (x : b.Cutoff U) : + (b.stepIso U i outside).toFun ((b.stepInput U i).left.toFun x) = + (b.cutoffInclusion (fun _ h => Or.inl h : ∀ j, U j → addComponent U i j)).toFun x := rfl + +theorem stepIso_tile (U : I → Prop) (i : I) (outside : ¬ U i) (x : b.Space i) : + (b.stepIso U i outside).toFun ((b.stepInput U i).right.toFun x) = + (b.cutoffTile (addComponent U i) i (Or.inr rfl)).toFun x := by + classical + apply Subtype.ext + change (b.stepMap U i ((b.stepInput U i).represent x)).val = + b.componentMap i ((b.glue i).represent x) + by_cases hx : (b.order i).le x (b.glue i).rightAnchor + · rw [(b.stepInput U i).represent_old x hx, (b.glue i).represent_old x hx] + rfl + · rw [(b.stepInput U i).represent_new x hx, (b.glue i).represent_new x hx] + rfl + +end PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentDecoding.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentDecoding.lean index 209e92fa1ed755ba1f4e4432b1bb1adbd6a9de25..9f68850a4fd72f308cb01eec17b62b04ab0743d2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentDecoding.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentDecoding.lean @@ -1,65 +1,65 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.StructuralForcingStageWitnessStep - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -open scoped ZFSet -universe u -variable {G R : Type u} [Group G] [PartialOrder R] -variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) -variable (Q J B : ZFSet.{u}) -variable (shape : Q ⊆ ZFSet.prod c.carrier (ZFSet.powerset J)) - -include shape in -theorem presentedRowAssignmentOrder_code : PartialOrderCode Q (rawRowAssignmentOrder Q c.conditionOrder) := by - rw [rawRowAssignmentOrder_eq shape] - exact rowAssignmentOrder_partialOrder shape c.conditionOrder_code - -variable (laws : RelationActionLaws G J (fun g => rawActionSection (t.encode g) B J)) -variable (preserves : ∀ g : G, ∀ r : R, ∀ A, - ZFSet.pair (c.encode r) A ∈ Q → - ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) - -noncomputable def presentedRowAssignmentAction : - letI := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder - PosetAction G (SetMembers Q) := by - let := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder - have code : PosetActionCode t.carrier Q ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) - (SetMembers.presentation Q).conditionOrder - (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by - rw [(presentedRowAssignmentOrder_code c Q J shape).conditionOrder_eq] - exact presentedRowAssignmentGraph_code a c t Q J B shape laws preserves - exact code.toPresentedPosetAction t (SetMembers.presentation Q) - -theorem presentedRowAssignmentAction_graph : - letI := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder - (presentedRowAssignmentAction a c t Q J B shape laws preserves).actionGraph (SetMembers.presentation Q) t = - rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B := by - let := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder - unfold presentedRowAssignmentAction - exact PosetActionCode.toPresentedPosetAction_graph _ _ _ - -theorem presentedRowAssignmentAction_coordinates : - letI := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder - ∀ g (p : SetMembers Q) r A, SetMembers.raw p = ZFSet.pair (c.encode r) A → - SetMembers.raw ((presentedRowAssignmentAction a c t Q J B shape laws preserves).iso g p) = - ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) := by - let := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder - intro g p r A equal - let act := presentedRowAssignmentAction a c t Q J B shape laws preserves - have edge := (act.triple_mem_actionGraph (SetMembers.presentation Q) t g p (act.iso g p)).2 rfl - rw [presentedRowAssignmentAction_graph a c t Q J B shape laws preserves] at edge - change ZFSet.pair (ZFSet.pair (t.encode g) (SetMembers.raw p)) (SetMembers.raw (act.iso g p)) ∈ _ at edge - obtain ⟨q, D, _, target⟩ := exists_presentedRowAssignmentCoordinates c shape (SetMembers.raw_mem (act.iso g p)) - rw [equal, target] at edge - obtain ⟨_, _, row, data⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge - rw [target, row, data] - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.StructuralForcingStageWitnessStep + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +open scoped ZFSet +universe u +variable {G R : Type u} [Group G] [PartialOrder R] +variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) +variable (Q J B : ZFSet.{u}) +variable (shape : Q ⊆ ZFSet.prod c.carrier (ZFSet.powerset J)) + +include shape in +theorem presentedRowAssignmentOrder_code : PartialOrderCode Q (rawRowAssignmentOrder Q c.conditionOrder) := by + rw [rawRowAssignmentOrder_eq shape] + exact rowAssignmentOrder_partialOrder shape c.conditionOrder_code + +variable (laws : RelationActionLaws G J (fun g => rawActionSection (t.encode g) B J)) +variable (preserves : ∀ g : G, ∀ r : R, ∀ A, + ZFSet.pair (c.encode r) A ∈ Q → + ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) + +noncomputable def presentedRowAssignmentAction : + letI := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder + PosetAction G (SetMembers Q) := by + let := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder + have code : PosetActionCode t.carrier Q ((t.product t).graph t (fun gh => gh.1 * gh.2)) (t.encode 1) + (SetMembers.presentation Q).conditionOrder + (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by + rw [(presentedRowAssignmentOrder_code c Q J shape).conditionOrder_eq] + exact presentedRowAssignmentGraph_code a c t Q J B shape laws preserves + exact code.toPresentedPosetAction t (SetMembers.presentation Q) + +theorem presentedRowAssignmentAction_graph : + letI := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder + (presentedRowAssignmentAction a c t Q J B shape laws preserves).actionGraph (SetMembers.presentation Q) t = + rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B := by + let := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder + unfold presentedRowAssignmentAction + exact PosetActionCode.toPresentedPosetAction_graph _ _ _ + +theorem presentedRowAssignmentAction_coordinates : + letI := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder + ∀ g (p : SetMembers Q) r A, SetMembers.raw p = ZFSet.pair (c.encode r) A → + SetMembers.raw ((presentedRowAssignmentAction a c t Q J B shape laws preserves).iso g p) = + ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) := by + let := (presentedRowAssignmentOrder_code c Q J shape).toPartialOrder + intro g p r A equal + let act := presentedRowAssignmentAction a c t Q J B shape laws preserves + have edge := (act.triple_mem_actionGraph (SetMembers.presentation Q) t g p (act.iso g p)).2 rfl + rw [presentedRowAssignmentAction_graph a c t Q J B shape laws preserves] at edge + change ZFSet.pair (ZFSet.pair (t.encode g) (SetMembers.raw p)) (SetMembers.raw (act.iso g p)) ∈ _ at edge + obtain ⟨q, D, _, target⟩ := exists_presentedRowAssignmentCoordinates c shape (SetMembers.raw_mem (act.iso g p)) + rw [equal, target] at edge + obtain ⟨_, _, row, data⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge + rw [target, row, data] + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentTotality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentTotality.lean index 14e8ae00be07cd7c4fe555d80857695f37eeb24d..48d1e7c5e6e8001e1f83a286aa0a00feb6cfec95 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentTotality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PresentedRowAssignmentTotality.lean @@ -1,35 +1,35 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PresentedRowAssignmentGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {G R : Type u} [Group G] [PartialOrder R] -variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) -variable (Q J B : ZFSet.{u}) - -theorem presentedRowAssignmentGraph_totalValue {V : ZFSet.{u}} - (shape : Q ⊆ ZFSet.prod c.carrier V) - (function : ZFSet.IsFunc (ZFSet.prod t.carrier Q) Q - (rawRowAssignmentActionGraph t.carrier Q c.carrier Q.sUnion.sUnion J (a.actionGraph c t) B)) - (g : G) (r : R) (A : ZFSet.{u}) (member : ZFSet.pair (c.encode r) A ∈ Q) : - ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q ∧ - ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) - (ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J))) ∈ - rawRowAssignmentActionGraph t.carrier Q c.carrier Q.sUnion.sUnion J (a.actionGraph c t) B := by - obtain ⟨y, edge, _unique⟩ := function.2 (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) - (ZFSet.pair_mem_prod.2 ⟨t.encode_mem g, member⟩) - have hy := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 - obtain ⟨q, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hy - obtain ⟨_, _, row, data⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge - rw [← row, data] at hy edge - exact ⟨hy, edge⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PresentedRowAssignmentGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {G R : Type u} [Group G] [PartialOrder R] +variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G) +variable (Q J B : ZFSet.{u}) + +theorem presentedRowAssignmentGraph_totalValue {V : ZFSet.{u}} + (shape : Q ⊆ ZFSet.prod c.carrier V) + (function : ZFSet.IsFunc (ZFSet.prod t.carrier Q) Q + (rawRowAssignmentActionGraph t.carrier Q c.carrier Q.sUnion.sUnion J (a.actionGraph c t) B)) + (g : G) (r : R) (A : ZFSet.{u}) (member : ZFSet.pair (c.encode r) A ∈ Q) : + ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q ∧ + ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) + (ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J))) ∈ + rawRowAssignmentActionGraph t.carrier Q c.carrier Q.sUnion.sUnion J (a.actionGraph c t) B := by + obtain ⟨y, edge, _unique⟩ := function.2 (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) + (ZFSet.pair_mem_prod.2 ⟨t.encode_mem g, member⟩) + have hy := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 + obtain ⟨q, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hy + obtain ⟨_, _, row, data⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge + rw [← row, data] at hy edge + exact ⟨hy, edge⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PrincipalBatch.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PrincipalBatch.lean index 2ca1889a0f1512b08194bf1553ae96213d1468ab..23f326266026177b3819e0eec739db296c5a9bf8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PrincipalBatch.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/PrincipalBatch.lean @@ -1,1139 +1,1139 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalWordRewriteRelations - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -namespace CosetGeometry - -universe u - -variable (J S : Type u) [Group J] - -def Same (x y : External J S) : Prop := ∃ j, x * old J S j = y - -def cosetSetoid : Setoid (External J S) where - r := Same J S - iseqv := by - constructor - · intro x - exact ⟨1, by rw [map_one, mul_one]⟩ - · rintro x y ⟨j, rfl⟩ - exact ⟨j⁻¹, by rw [map_inv, mul_inv_cancel_right]⟩ - · rintro x y z ⟨i, rfl⟩ ⟨j, rfl⟩ - exact ⟨i * j, by rw [map_mul, mul_assoc]⟩ - -def Vertex := Quotient (cosetSetoid J S) -def point (g : External J S) : Vertex J S := Quotient.mk (cosetSetoid J S) g - -def root : Vertex J S := point J S 1 - -theorem point_eq (g h : External J S) : point J S g = point J S h ↔ ∃ j, g * old J S j = h := - ⟨fun eq => Quotient.exact eq, fun eq => Quotient.sound eq⟩ - -theorem root_eq_point (g : External J S) : root J S = point J S g ↔ ∃ j, old J S j = g := by - rw [root, point_eq] - simp only [one_mul] - -def act (g : External J S) : Vertex J S → Vertex J S := - Quotient.map (fun x => g * x) (by - rintro x y ⟨j, rfl⟩ - exact ⟨j, mul_assoc _ _ _⟩) - -theorem act_point (g h : External J S) : act J S g (point J S h) = point J S (g * h) := rfl - -theorem act_root (g : External J S) : act J S g (root J S) = point J S g := by - change point J S (g * 1) = _ - rw [mul_one] - -theorem act_one (x : Vertex J S) : act J S 1 x = x := by - induction x using Quotient.ind with - | _ x => exact congrArg (point J S) (one_mul x) - -theorem act_mul (g h : External J S) (x : Vertex J S) : - act J S (g * h) x = act J S g (act J S h x) := by - induction x using Quotient.ind with - | _ x => exact congrArg (point J S) (mul_assoc g h x) - -def Dart := (External J S × S) × Bool - -def reverse (d : Dart J S) : Dart J S := (d.1, !d.2) - -def startRep (d : Dart J S) : External J S := - if d.2 then d.1.1 else d.1.1 * generator J S d.1.2 - -def endRep (d : Dart J S) : External J S := - if d.2 then d.1.1 * generator J S d.1.2 else d.1.1 - -def letter (d : Dart J S) : S × Bool := (d.1.2, d.2) -def source (d : Dart J S) : Vertex J S := point J S (startRep J S d) -def target (d : Dart J S) : Vertex J S := point J S (endRep J S d) - -theorem signed_true (s : S) : signed J S (s, true) = generator J S s := rfl - -theorem signed_false (s : S) : signed J S (s, false) = (generator J S s)⁻¹ := by - rw [generator, ← map_inv] - rfl - -theorem end_eq (d : Dart J S) : startRep J S d * signed J S (letter J S d) = endRep J S d := by - rcases d with ⟨⟨w, s⟩, b⟩ - cases b - · change (w * generator J S s) * signed J S (s, false) = w - rw [signed_false, mul_inv_cancel_right] - · rfl - -theorem reverse_reverse (d : Dart J S) : reverse J S (reverse J S d) = d := by - rcases d with ⟨⟨w, s⟩, b⟩ - cases b <;> rfl - -theorem source_reverse (d : Dart J S) : source J S (reverse J S d) = target J S d := by - rcases d with ⟨⟨w, s⟩, b⟩ - cases b <;> rfl - -theorem target_reverse (d : Dart J S) : target J S (reverse J S d) = source J S d := by - rcases d with ⟨⟨w, s⟩, b⟩ - cases b <;> rfl - -theorem cancellation_reverses_edge (d e : Dart J S) - (joined : startRep J S e = endRep J S d) - (cancel : Cancel S (letter J S d) (letter J S e)) : e = reverse J S d := by - rcases d with ⟨⟨w, s⟩, b⟩ - rcases e with ⟨⟨v, t⟩, c⟩ - cases b <;> cases c - · simp [Cancel, letter] at cancel - · have st : s = t := cancel.1 - subst t - change v = w at joined - subst v - rfl - · have st : s = t := cancel.1 - subst t - change v * generator J S s = w * generator J S s at joined - have vw := mul_right_cancel joined - subst v - rfl - · simp [Cancel, letter] at cancel - -def translate (g : External J S) (d : Dart J S) : Dart J S := ((g * d.1.1, d.1.2), d.2) - -theorem source_translate (g : External J S) (d : Dart J S) : - source J S (translate J S g d) = act J S g (source J S d) := by - rcases d with ⟨⟨w, s⟩, b⟩ - cases b - · exact congrArg (point J S) (mul_assoc g w (generator J S s)) - · rfl - -theorem target_translate (g : External J S) (d : Dart J S) : - target J S (translate J S g d) = act J S g (target J S d) := by - rcases d with ⟨⟨w, s⟩, b⟩ - cases b - · rfl - · exact congrArg (point J S) (mul_assoc g w (generator J S s)) - -inductive Follows : Vertex J S → List (Dart J S) → Vertex J S → Prop - | nil (v) : Follows v [] v - | cons (d : Dart J S) {L v} (tail : Follows (target J S d) L v) : - Follows (source J S d) (d :: L) v - -theorem follows_cons_source {v w : Vertex J S} {d : Dart J S} {L} - (path : Follows J S v (d :: L) w) : v = source J S d := by - cases path - rfl - -theorem follows_tail {v w : Vertex J S} {d : Dart J S} {L} - (path : Follows J S v (d :: L) w) : Follows J S (target J S d) L w := by - cases path with - | cons _ tail => exact tail - -theorem follows_append {v w z : Vertex J S} {L M} - (first : Follows J S v L w) (second : Follows J S w M z) : - Follows J S v (L ++ M) z := by - induction first with - | nil => exact second - | cons d tail ih => exact Follows.cons d (ih second) - -theorem follows_translate {v w : Vertex J S} {L} (path : Follows J S v L w) - (g : External J S) : - Follows J S (act J S g v) (L.map (translate J S g)) (act J S g w) := by - induction path with - | nil v => exact Follows.nil _ - | cons d tail ih => - rw [← source_translate, List.map_cons] - apply Follows.cons - rw [target_translate] - exact ih - - - - - - - -def NoBacktracking : List (Dart J S) → Prop - | [] => True - | [_] => True - | d :: e :: rest => e ≠ reverse J S d ∧ NoBacktracking (e :: rest) - -theorem follows_empty_eq {v w : Vertex J S} {L : List (Dart J S)} - (path : Follows J S v L w) (empty : L = []) : v = w := by - induction path with - | nil => rfl - | cons d tail ih => cases empty - -theorem follows_singleton_target {v w : Vertex J S} {d : Dart J S} - (path : Follows J S v [d] w) : w = target J S d := by - have tail : Follows J S (target J S d) [] w := follows_tail J S path - exact (follows_empty_eq J S tail rfl).symm - -theorem path_word (d : Dart J S) (tail : List (Dart J S)) (finish : Vertex J S) - (path : Follows J S (source J S d) (d :: tail) finish) - (reduced : NoBacktracking J S (d :: tail)) : - ∃ j rest, Reduced J S ((letter J S d, j) :: rest) ∧ - point J S (startRep J S d * eval J S ((letter J S d, j) :: rest)) = finish := by - induction tail generalizing d finish with - | nil => - refine ⟨1, [], True.intro, ?_⟩ - rw [follows_singleton_target J S path] - change point J S (startRep J S d * (signed J S (letter J S d) * old J S 1 * 1)) = _ - rw [map_one, mul_one, mul_one, end_eq] - rfl - | cons e tail ih => - have ep := follows_tail J S path - have join : target J S d = source J S e := follows_cons_source J S ep - rw [join] at ep - rcases ih e finish ep reduced.2 with ⟨k, rest, ereduced, endpoint⟩ - rcases (point_eq J S (endRep J S d) (startRep J S e)).mp join with ⟨j, coordinate⟩ - refine ⟨j, (letter J S e, k) :: rest, ⟨?_, ereduced⟩, ?_⟩ - · intro jone cancel - change j = 1 at jone - have joined : startRep J S e = endRep J S d := by - rw [jone, map_one, mul_one] at coordinate - exact coordinate.symm - exact reduced.1 (cancellation_reverses_edge J S d e joined cancel) - · have transition : startRep J S d * signed J S (letter J S d) * old J S j = startRep J S e := - (congrArg (fun x => x * old J S j) (end_eq J S d)).trans coordinate - calc - point J S (startRep J S d * eval J S ((letter J S d, j) :: (letter J S e, k) :: rest)) = - point J S ((startRep J S d * signed J S (letter J S d) * old J S j) * - eval J S ((letter J S e, k) :: rest)) := by simp only [eval, mul_assoc] - _ = point J S (startRep J S e * eval J S ((letter J S e, k) :: rest)) := by rw [transition] - _ = finish := endpoint - -theorem no_closed_reduced_path (v : Vertex J S) (d : Dart J S) (tail : List (Dart J S)) - (path : Follows J S v (d :: tail) v) : ¬ NoBacktracking J S (d :: tail) := by - classical - intro reduced - have start := follows_cons_source J S path - rw [start] at path - rcases path_word J S d tail (source J S d) path reduced with ⟨j, rest, normal, endpoint⟩ - let value := eval J S ((letter J S d, j) :: rest) - rcases (point_eq J S (startRep J S d * value) (startRep J S d)).mp endpoint with ⟨k, eq⟩ - have cancelled : value * old J S k = 1 := by - apply mul_left_cancel (a := startRep J S d) - simpa only [mul_assoc, mul_one] using eq - have value_eq : value = old J S k⁻¹ := by - calc - value = value * (old J S k * old J S k⁻¹) := by rw [map_inv, mul_inv_cancel, mul_one] - _ = (value * old J S k) * old J S k⁻¹ := (mul_assoc _ _ _).symm - _ = old J S k⁻¹ := by rw [cancelled, one_mul] - exact reduced_not_old J S (letter J S d) j rest normal k⁻¹ value_eq - -def Reachable (g : External J S) : Prop := - ∃ L, Follows J S (root J S) L (point J S g) - -theorem reachable_one : Reachable J S 1 := ⟨[], Follows.nil _⟩ - -theorem reachable_old (j : J) : Reachable J S (old J S j) := by - have eq := (root_eq_point J S (old J S j)).mpr ⟨j, rfl⟩ - refine ⟨[], ?_⟩ - rw [← eq] - exact Follows.nil _ - -theorem reachable_mul {g h : External J S} (hg : Reachable J S g) (hh : Reachable J S h) : - Reachable J S (g * h) := by - rcases hg with ⟨L, first⟩ - rcases hh with ⟨M, second⟩ - have shifted := follows_translate J S second g - rw [act_root, act_point] at shifted - exact ⟨L ++ M.map (translate J S g), follows_append J S first shifted⟩ - -theorem reachable_generator (s : S) : Reachable J S (generator J S s) := by - let d : Dart J S := ((1, s), true) - have path := Follows.cons d (Follows.nil (target J S d)) - change Follows J S (root J S) [d] (point J S (1 * generator J S s)) at path - rw [one_mul] at path - exact ⟨[d], path⟩ - -theorem reachable_generator_inv (s : S) : Reachable J S (generator J S s)⁻¹ := by - let d : Dart J S := (((generator J S s)⁻¹, s), false) - have path := Follows.cons d (Follows.nil (target J S d)) - change Follows J S (point J S ((generator J S s)⁻¹ * generator J S s)) [d] - (point J S (generator J S s)⁻¹) at path - rw [inv_mul_cancel] at path - exact ⟨[d], path⟩ - -theorem reachable_free (f : FreeGroup S) : Reachable J S (free J S f) := by - induction f using FreeGroup.induction_on with - | one => rw [map_one]; exact reachable_one J S - | of letter => exact reachable_generator J S letter - | inv_of letter _ => rw [map_inv]; exact reachable_generator_inv J S letter - | mul first second firstReachable secondReachable => - rw [map_mul] - exact reachable_mul J S firstReachable secondReachable - -theorem reachable_element (g : External J S) : Reachable J S g := by - induction g using Monoid.CoprodI.induction_on with - | one => exact reachable_one J S - | of i x => - cases i - · exact reachable_old J S x - · exact reachable_free J S x - | mul x y hx hy => exact reachable_mul J S hx hy - -theorem connected (v : Vertex J S) : ∃ L, Follows J S (root J S) L v := by - induction v using Quotient.ind with - | _ g => exact reachable_element J S g - -def IsIndexedTree : Prop := - (∀ v : Vertex J S, ∃ L, Follows J S (root J S) L v) ∧ - ∀ v d tail, Follows J S v (d :: tail) v → ¬ NoBacktracking J S (d :: tail) - -theorem coset_tree : IsIndexedTree J S := - ⟨connected J S, no_closed_reduced_path J S⟩ - -theorem reversal_of_not_reduced (L : List (Dart J S)) (h : ¬ NoBacktracking J S L) : - ∃ pre d suffix, L = pre ++ d :: reverse J S d :: suffix := by - classical - induction L with - | nil => exact False.elim (h True.intro) - | cons d tail ih => - cases tail with - | nil => exact False.elim (h True.intro) - | cons e tail => - by_cases back : e = reverse J S d - · exact ⟨[], d, tail, by rw [back]; rfl⟩ - · rcases ih (fun ht => h ⟨back, ht⟩) with ⟨pre, x, suffix, eq⟩ - exact ⟨d :: pre, x, suffix, congrArg (List.cons d) eq⟩ - -theorem closed_path_has_reversal (v : Vertex J S) (d : Dart J S) (tail : List (Dart J S)) - (path : Follows J S v (d :: tail) v) : - ∃ pre e suffix, d :: tail = pre ++ e :: reverse J S e :: suffix := - reversal_of_not_reduced J S _ (no_closed_reduced_path J S v d tail path) - -@[instance_reducible] -def groupOfData {G : Type u} (g : GroupData G) : Group G where - mul := g.mul - mul_assoc := g.assoc - one := g.one - one_mul := g.one_mul - mul_one := g.mul_one - inv := g.inv - inv_mul_cancel := g.inv_mul - -theorem taskSystem_coset_tree {A G Task Label : Type u} {P : MeetOrder A} - (f : TaskSystem P G Task Label) (Letters : Type u) : - @IsIndexedTree G Letters (groupOfData f.group) := by - let : Group G := groupOfData f.group - exact coset_tree G Letters - -end CosetGeometry - - - -section - -namespace EdgeWords - -universe u -variable {E : Type u} - -def reverse (d : E × Bool) : E × Bool := (d.1, !d.2) - -def NoBacktracking : List (E × Bool) → Prop - | [] => True - | [_] => True - | d :: e :: rest => e ≠ reverse d ∧ NoBacktracking (e :: rest) - -theorem mk_cons (d : E × Bool) (L : List (E × Bool)) : - FreeGroup.mk (d :: L) = FreeGroup.mk [d] * FreeGroup.mk L := - (@FreeGroup.mul_mk E [d] L).symm - -theorem mk_reverse (d : E × Bool) : - FreeGroup.mk [reverse d] = (FreeGroup.mk [d])⁻¹ := by - rcases d with ⟨e, b⟩ - cases b <;> rfl - -theorem mk_delete_reversal (pre : List (E × Bool)) (d : E × Bool) (suffix) : - FreeGroup.mk (pre ++ d :: reverse d :: suffix) = FreeGroup.mk (pre ++ suffix) := - Quot.sound FreeGroup.Red.Step.not - -theorem reduce_of_no_backtracking [DecidableEq E] (L : List (E × Bool)) - (h : NoBacktracking L) : FreeGroup.reduce L = L := by - induction L with - | nil => rfl - | cons d tail ih => - cases tail with - | nil => rfl - | cons e rest => - rw [FreeGroup.reduce.cons, ih h.2] - have safe : ¬ (d.1 = e.1 ∧ d.2 = !e.2) := by - rintro ⟨edges, signs⟩ - apply h.1 - change e = (d.1, !d.2) - refine Prod.ext edges.symm ?_ - have flipped := congrArg Bool.not signs - simpa only [Bool.not_not] using flipped.symm - change (if d.1 = e.1 ∧ d.2 = !e.2 then rest else d :: e :: rest) = _ - rw [ite_eq_right safe] - -theorem reduced_word_eq_one_iff (L : List (E × Bool)) (h : NoBacktracking L) : - FreeGroup.mk L = 1 ↔ L = [] := by - classical - constructor - · intro eq - have words := congrArg FreeGroup.toWord eq - simpa only [FreeGroup.toWord_mk, FreeGroup.toWord_one, - reduce_of_no_backtracking L h] using words - · rintro rfl - rfl - -end EdgeWords - -namespace CosetGeometry - -universe u -variable (J S : Type u) [Group J] - -theorem follows_delete_reversal (pre : List (Dart J S)) (d : Dart J S) (suffix) - {v w : Vertex J S} (path : Follows J S v (pre ++ d :: reverse J S d :: suffix) w) : - Follows J S v (pre ++ suffix) w := by - induction pre generalizing v with - | nil => - have start := follows_cons_source J S path - have tail := follows_tail J S (follows_tail J S path) - rw [target_reverse] at tail - rw [start] - exact tail - | cons e pre ih => - have start := follows_cons_source J S path - rw [start] - exact Follows.cons e (ih (follows_tail J S path)) - -theorem closed_edge_word (v : Vertex J S) (L : List (Dart J S)) - (path : Follows J S v L v) : FreeGroup.mk L = 1 := by - cases hL : L with - | nil => rfl - | cons d tail => - rw [hL] at path - rcases closed_path_has_reversal J S v d tail path with ⟨pre, e, suffix, eq⟩ - have cut : Follows J S v (pre ++ suffix) v := by - apply follows_delete_reversal J S pre e suffix - rw [← eq] - exact path - calc - FreeGroup.mk (d :: tail) = FreeGroup.mk (pre ++ suffix) := by - erw [eq] - exact EdgeWords.mk_delete_reversal pre e suffix - _ = 1 := closed_edge_word v (pre ++ suffix) cut -termination_by L.length -decreasing_by - rw [hL] - have lengths := congrArg List.length eq - simp only [List.length_cons, List.length_append] at lengths ⊢ - omega - -end CosetGeometry -end - - - -namespace CosetGeometry.TileStars - -universe u -variable (J S R : Type u) [Group J] - -abbrev Center := External J S × R -abbrev OldEdge := External J S × S -def Vertex := Sum (CosetGeometry.Vertex J S) (Center J S R) -def Edge := Sum (Center J S R) (OldEdge J S) -abbrev Dart := Edge J S R × Bool - -def reverse (d : Dart J S R) : Dart J S R := EdgeWords.reverse d - -variable (request : S → R) - -def centerOf (e : OldEdge J S) : Center J S R := (e.1, request e.2) - -def source (d : Dart J S R) : Vertex J S R := - match d.1, d.2 with - | .inl c, true => .inl (point J S c.1) - | .inl c, false => .inr c - | .inr e, true => .inr (centerOf J S R request e) - | .inr e, false => .inl (point J S (e.1 * generator J S e.2)) - -def target (d : Dart J S R) : Vertex J S R := - source J S R request (reverse J S R d) - -theorem reverse_reverse (d : Dart J S R) : reverse J S R (reverse J S R d) = d := by - rcases d with ⟨e, b⟩ - cases b <;> rfl - -theorem source_reverse (d : Dart J S R) : - source J S R request (reverse J S R d) = target J S R request d := rfl - -theorem target_reverse (d : Dart J S R) : - target J S R request (reverse J S R d) = source J S R request d := by - exact congrArg (source J S R request) (reverse_reverse J S R d) - -def root : Vertex J S R := .inl (CosetGeometry.root J S) - -inductive Follows : Vertex J S R → List (Dart J S R) → Vertex J S R → Prop - | nil (v) : Follows v [] v - | cons (d : Dart J S R) {L v} - (tail : Follows (target J S R request d) L v) : - Follows (source J S R request d) (d :: L) v - -theorem follows_append {v w z : Vertex J S R} {L M} - (first : Follows J S R request v L w) (second : Follows J S R request w M z) : - Follows J S R request v (L ++ M) z := by - induction first with - | nil => exact second - | cons d tail ih => exact Follows.cons d (ih second) - -def contract : Vertex J S R → CosetGeometry.Vertex J S - | .inl v => v - | .inr c => point J S c.1 - -def projectDart (d : Dart J S R) : List (CosetGeometry.Dart J S) := - match d.1 with - | .inl _ => [] - | .inr e => [(e, d.2)] - -def project (L : List (Dart J S R)) : List (CosetGeometry.Dart J S) := - L.flatMap (projectDart J S R) - -theorem contract_edge (d : Dart J S R) : - CosetGeometry.Follows J S (contract J S R (source J S R request d)) - (projectDart J S R d) (contract J S R (target J S R request d)) := by - rcases d with ⟨c | e, b⟩ <;> cases b - · exact CosetGeometry.Follows.nil _ - · exact CosetGeometry.Follows.nil _ - · exact CosetGeometry.Follows.cons (e, false) (CosetGeometry.Follows.nil _) - · exact CosetGeometry.Follows.cons (e, true) (CosetGeometry.Follows.nil _) - -theorem follows_project {v w : Vertex J S R} {L} - (path : Follows J S R request v L w) : - CosetGeometry.Follows J S (contract J S R v) (project J S R L) (contract J S R w) := by - induction path with - | nil v => exact CosetGeometry.Follows.nil _ - | cons d tail ih => - exact CosetGeometry.follows_append J S (contract_edge J S R request d) ih - -def expandDart (d : CosetGeometry.Dart J S) : List (Dart J S R) := - if d.2 then - [(.inl (centerOf J S R request d.1), true), (.inr d.1, true)] - else - [(.inr d.1, false), (.inl (centerOf J S R request d.1), false)] - -theorem expand_edge (d : CosetGeometry.Dart J S) : - Follows J S R request (.inl (CosetGeometry.source J S d)) - (expandDart J S R request d) (.inl (CosetGeometry.target J S d)) := by - rcases d with ⟨e, b⟩ - cases b - · exact Follows.cons (.inr e, false) - (Follows.cons (.inl (centerOf J S R request e), false) (Follows.nil _)) - · exact Follows.cons (.inl (centerOf J S R request e), true) - (Follows.cons (.inr e, true) (Follows.nil _)) - -theorem follows_expand {v w : CosetGeometry.Vertex J S} {L} - (path : CosetGeometry.Follows J S v L w) : - Follows J S R request (.inl v) (L.flatMap (expandDart J S R request)) (.inl w) := by - induction path with - | nil v => exact Follows.nil _ - | cons d tail ih => exact follows_append J S R request (expand_edge J S R request d) ih - -theorem connected (v : Vertex J S R) : - ∃ L, Follows J S R request (root J S R) L v := by - cases v with - | inl v => - rcases CosetGeometry.connected J S v with ⟨L, path⟩ - exact ⟨L.flatMap (expandDart J S R request), follows_expand J S R request path⟩ - | inr c => - rcases CosetGeometry.connected J S (point J S c.1) with ⟨L, path⟩ - have lifted := follows_expand J S R request path - have stem := Follows.cons (J := J) (S := S) (R := R) (request := request) - (.inl c, true) (Follows.nil _) - exact ⟨_, follows_append J S R request lifted stem⟩ - -end CosetGeometry.TileStars - - - -namespace CosetGeometry.TileStars - -universe u -variable (J S R : Type u) [Group J] (request : S → R) - -def potential : Vertex J S R → FreeGroup (Edge J S R) - | .inl _ => 1 - | .inr c => FreeGroup.of (.inl c) - -def expandHom : FreeGroup (OldEdge J S) →* FreeGroup (Edge J S R) := - FreeGroup.lift (fun e => - FreeGroup.of (.inl (centerOf J S R request e)) * FreeGroup.of (.inr e)) - -theorem edge_word (d : Dart J S R) : - FreeGroup.mk [d] = - (potential J S R (source J S R request d))⁻¹ * - expandHom J S R request (FreeGroup.mk (projectDart J S R d)) * - potential J S R (target J S R request d) := by - rcases d with ⟨c | e, b⟩ <;> cases b - · change (FreeGroup.of (.inl c : Edge J S R))⁻¹ = - (FreeGroup.of (.inl c))⁻¹ * expandHom J S R request 1 * 1 - erw [map_one, mul_one, mul_one] - rfl - · change FreeGroup.of (.inl c : Edge J S R) = - (1 : FreeGroup (Edge J S R))⁻¹ * expandHom J S R request 1 * FreeGroup.of (.inl c) - erw [map_one, inv_one, one_mul] - rfl - · change (FreeGroup.of (.inr e : Edge J S R))⁻¹ = - (1 : FreeGroup (Edge J S R))⁻¹ * expandHom J S R request (FreeGroup.of e)⁻¹ * - FreeGroup.of (.inl (centerOf J S R request e)) - rw [inv_one, one_mul, map_inv] - rw [expandHom, FreeGroup.lift_apply_of] - change (FreeGroup.of (.inr e : Edge J S R))⁻¹ = - (FreeGroup.of (.inl (centerOf J S R request e)) * FreeGroup.of (.inr e))⁻¹ * - FreeGroup.of (.inl (centerOf J S R request e)) - rw [mul_inv_rev, inv_mul_cancel_right] - · change FreeGroup.of (.inr e : Edge J S R) = - (FreeGroup.of (.inl (centerOf J S R request e)))⁻¹ * - expandHom J S R request (FreeGroup.of e) * 1 - rw [expandHom, FreeGroup.lift_apply_of] - change FreeGroup.of (.inr e : Edge J S R) = - (FreeGroup.of (.inl (centerOf J S R request e)))⁻¹ * - (FreeGroup.of (.inl (centerOf J S R request e)) * FreeGroup.of (.inr e)) * 1 - rw [inv_mul_cancel_left, mul_one] - -theorem path_word {v w : Vertex J S R} {L} - (path : Follows J S R request v L w) : - FreeGroup.mk L = (potential J S R v)⁻¹ * - expandHom J S R request (FreeGroup.mk (project J S R L)) * potential J S R w := by - induction path with - | nil v => - change 1 = (potential J S R v)⁻¹ * expandHom J S R request 1 * potential J S R v - rw [map_one, mul_one, inv_mul_cancel] - | @cons d L w tail ih => - rw [EdgeWords.mk_cons, edge_word, ih] - change (_ * expandHom J S R request (FreeGroup.mk (projectDart J S R d)) * _) * - (_ * expandHom J S R request (FreeGroup.mk (project J S R L)) * _) = - _ * expandHom J S R request (FreeGroup.mk (projectDart J S R d ++ project J S R L)) * _ - erw [← FreeGroup.mul_mk, map_mul] - simp only [mul_assoc, mul_inv_cancel_left] - -theorem closed_edge_word (v : Vertex J S R) (L : List (Dart J S R)) - (path : Follows J S R request v L v) : FreeGroup.mk L = 1 := by - have equation := path_word J S R request path - have contracted := CosetGeometry.closed_edge_word J S (contract J S R v) - (project J S R L) (follows_project J S R request path) - rw [contracted, map_one, mul_one, inv_mul_cancel] at equation - exact equation - -theorem no_closed_reduced_path (v : Vertex J S R) (d : Dart J S R) (tail) - (path : Follows J S R request v (d :: tail) v) : ¬ EdgeWords.NoBacktracking (d :: tail) := by - intro reduced - have empty := (EdgeWords.reduced_word_eq_one_iff (d :: tail) reduced).mp - (closed_edge_word J S R request v (d :: tail) path) - cases empty - -def IsIndexedTree : Prop := - (∀ v : Vertex J S R, ∃ L, Follows J S R request (root J S R) L v) ∧ - ∀ v d tail, Follows J S R request v (d :: tail) v → ¬ EdgeWords.NoBacktracking (d :: tail) - -theorem tile_star_tree : IsIndexedTree J S R request := - ⟨connected J S R request, no_closed_reduced_path J S R request⟩ - -theorem reversal_of_not_reduced (L : List (Dart J S R)) (h : ¬ EdgeWords.NoBacktracking L) : - ∃ pre d suffix, L = pre ++ d :: reverse J S R d :: suffix := by - classical - induction L with - | nil => exact False.elim (h True.intro) - | cons d tail ih => - cases tail with - | nil => exact False.elim (h True.intro) - | cons e tail => - by_cases back : e = reverse J S R d - · exact ⟨[], d, tail, by rw [back]; rfl⟩ - · rcases ih (fun ht => h ⟨back, ht⟩) with ⟨pre, x, suffix, eq⟩ - exact ⟨d :: pre, x, suffix, congrArg (List.cons d) eq⟩ - -theorem closed_path_has_reversal (v : Vertex J S R) (d : Dart J S R) (tail) - (path : Follows J S R request v (d :: tail) v) : - ∃ pre e suffix, d :: tail = pre ++ e :: reverse J S R e :: suffix := - reversal_of_not_reduced J S R _ (no_closed_reduced_path J S R request v d tail path) - -theorem requested_tile_tree (Children : R → Type u) : - IsIndexedTree J (Sigma Children) R Sigma.fst := - tile_star_tree J (Sigma Children) R Sigma.fst - -theorem taskSystem_tile_tree {A G Task Label : Type u} {P : MeetOrder A} - (f : TaskSystem P G Task Label) (Requests : Type u) (Children : Requests → Type u) : - @IsIndexedTree G (Sigma Children) Requests (groupOfData f.group) Sigma.fst := by - let : Group G := groupOfData f.group - exact requested_tile_tree G Requests Children - -end CosetGeometry.TileStars - - - -section - -namespace EdgeWords - -universe u -variable {E : Type u} - -theorem reduced_words_injective {L M : List (E × Bool)} - (hL : NoBacktracking L) (hM : NoBacktracking M) - (eq : FreeGroup.mk L = FreeGroup.mk M) : L = M := by - classical - have words := congrArg FreeGroup.toWord eq - simpa only [FreeGroup.toWord_mk, reduce_of_no_backtracking L hL, - reduce_of_no_backtracking M hM] using words - -theorem no_backtracking_append_left (L M : List (E × Bool)) - (h : NoBacktracking (L ++ M)) : NoBacktracking L := by - induction L with - | nil => exact True.intro - | cons d tail ih => - cases tail with - | nil => exact True.intro - | cons e tail => exact ⟨h.1, ih h.2⟩ - -end EdgeWords - -namespace CosetGeometry.TileStars - -universe u -variable (J S R : Type u) [Group J] (request : S → R) - -theorem follows_cons_source {v w : Vertex J S R} {d : Dart J S R} {L} - (path : Follows J S R request v (d :: L) w) : v = source J S R request d := by - cases path - rfl - -theorem follows_tail {v w : Vertex J S R} {d : Dart J S R} {L} - (path : Follows J S R request v (d :: L) w) : - Follows J S R request (target J S R request d) L w := by - cases path with - | cons _ tail => exact tail - -theorem follows_delete_reversal (pre : List (Dart J S R)) (d : Dart J S R) (suffix) - {v w : Vertex J S R} - (path : Follows J S R request v (pre ++ d :: reverse J S R d :: suffix) w) : - Follows J S R request v (pre ++ suffix) w := by - induction pre generalizing v with - | nil => - have start := follows_cons_source J S R request path - have tail := follows_tail J S R request (follows_tail J S R request path) - rw [target_reverse] at tail - rw [start] - exact tail - | cons e pre ih => - have start := follows_cons_source J S R request path - rw [start] - exact Follows.cons e (ih (follows_tail J S R request path)) - -theorem reduced_path {v w : Vertex J S R} (L : List (Dart J S R)) - (path : Follows J S R request v L w) : - ∃ M, Follows J S R request v M w ∧ EdgeWords.NoBacktracking M ∧ M.length ≤ L.length := by - classical - by_cases reduced : EdgeWords.NoBacktracking L - · exact ⟨L, path, reduced, le_refl _⟩ - · rcases reversal_of_not_reduced J S R L reduced with ⟨pre, d, suffix, eq⟩ - have cut : Follows J S R request v (pre ++ suffix) w := by - apply follows_delete_reversal J S R request pre d suffix - rw [← eq] - exact path - rcases reduced_path (pre ++ suffix) cut with ⟨M, mp, mr, bound⟩ - refine ⟨M, mp, mr, le_trans bound ?_⟩ - rw [eq] - simp only [List.length_append, List.length_cons] - omega -termination_by L.length -decreasing_by - rw [eq] - simp only [List.length_append, List.length_cons] - omega - -theorem follows_reverse {v w : Vertex J S R} {L} - (path : Follows J S R request v L w) : - Follows J S R request w (FreeGroup.invRev L) v := by - induction path with - | nil v => exact Follows.nil _ - | @cons d L w tail ih => - rw [FreeGroup.invRev_cons] - apply follows_append J S R request ih - have last := Follows.cons (J := J) (S := S) (R := R) (request := request) - (reverse J S R d) (Follows.nil _) - rw [source_reverse, target_reverse] at last - exact last - -theorem path_words_equal {v w : Vertex J S R} {L M} - (first : Follows J S R request v L w) (second : Follows J S R request v M w) : - FreeGroup.mk L = FreeGroup.mk M := by - have loop := follows_append J S R request first (follows_reverse J S R request second) - have equation := closed_edge_word J S R request v (L ++ FreeGroup.invRev M) loop - rw [← FreeGroup.mul_mk, ← FreeGroup.inv_mk] at equation - exact mul_inv_eq_one.mp equation - -theorem reduced_path_unique {v w : Vertex J S R} {L M} - (first : Follows J S R request v L w) (second : Follows J S R request v M w) - (hL : EdgeWords.NoBacktracking L) (hM : EdgeWords.NoBacktracking M) : L = M := - EdgeWords.reduced_words_injective hL hM (path_words_equal J S R request first second) - -theorem unique_root_path (v : Vertex J S R) : - ∃! L, Follows J S R request (root J S R) L v ∧ EdgeWords.NoBacktracking L := by - rcases connected J S R request v with ⟨L, path⟩ - rcases reduced_path J S R request L path with ⟨M, mp, mr, _⟩ - exact ⟨M, ⟨mp, mr⟩, fun N hN => reduced_path_unique J S R request hN.1 mp hN.2 mr⟩ - -noncomputable def rootPath (v : Vertex J S R) : List (Dart J S R) := - Classical.choose (unique_root_path J S R request v).exists - -theorem rootPath_follows (v : Vertex J S R) : - Follows J S R request (root J S R) (rootPath J S R request v) v := - (Classical.choose_spec (unique_root_path J S R request v).exists).1 - -theorem rootPath_reduced (v : Vertex J S R) : - EdgeWords.NoBacktracking (rootPath J S R request v) := - (Classical.choose_spec (unique_root_path J S R request v).exists).2 - -theorem rootPath_eq {v : Vertex J S R} {L} - (path : Follows J S R request (root J S R) L v) (reduced : EdgeWords.NoBacktracking L) : - rootPath J S R request v = L := - reduced_path_unique J S R request (rootPath_follows J S R request v) path - (rootPath_reduced J S R request v) reduced - -theorem rootPath_root : rootPath J S R request (root J S R) = [] := - rootPath_eq J S R request (Follows.nil _) True.intro - -noncomputable def depth (v : Vertex J S R) : Nat := (rootPath J S R request v).length - -theorem rootPath_shortest {v : Vertex J S R} {L} - (path : Follows J S R request (root J S R) L v) : depth J S R request v ≤ L.length := by - rcases reduced_path J S R request L path with ⟨M, mp, mr, bound⟩ - have eq := rootPath_eq J S R request mp mr - exact (congrArg List.length eq).le.trans bound - -theorem follows_empty_eq {v w : Vertex J S R} {L} - (path : Follows J S R request v L w) (empty : L = []) : v = w := by - induction path with - | nil => rfl - | cons d tail ih => cases empty - -theorem rootPath_empty_iff (v : Vertex J S R) : - rootPath J S R request v = [] ↔ v = root J S R := by - constructor - · intro empty - exact (follows_empty_eq J S R request (rootPath_follows J S R request v) empty).symm - · rintro rfl - exact rootPath_root J S R request - -theorem follows_last (pre : List (Dart J S R)) (d : Dart J S R) {v w : Vertex J S R} - (path : Follows J S R request v (pre ++ [d]) w) : - Follows J S R request v pre (source J S R request d) ∧ target J S R request d = w := by - induction pre generalizing v with - | nil => - have start := follows_cons_source J S R request path - have finish := follows_empty_eq J S R request (follows_tail J S R request path) rfl - rw [start] - exact ⟨Follows.nil _, finish⟩ - | cons e pre ih => - rcases ih (follows_tail J S R request path) with ⟨first, finish⟩ - refine ⟨?_, finish⟩ - rw [follows_cons_source J S R request path] - exact Follows.cons e first - -theorem exists_parent_edge (v : Vertex J S R) (nonroot : v ≠ root J S R) : - ∃ d : Dart J S R, target J S R request d = v ∧ - rootPath J S R request v = rootPath J S R request (source J S R request d) ++ [d] ∧ - depth J S R request v = depth J S R request (source J S R request d) + 1 := by - rcases List.eq_nil_or_concat' (rootPath J S R request v) with empty | ⟨pre, d, eq⟩ - · exact False.elim (nonroot ((rootPath_empty_iff J S R request v).mp empty)) - · have path := rootPath_follows J S R request v - have reduced := rootPath_reduced J S R request v - rw [eq] at path reduced - rcases follows_last J S R request pre d path with ⟨first, finish⟩ - have shorter := rootPath_eq J S R request first - (EdgeWords.no_backtracking_append_left pre [d] reduced) - refine ⟨d, finish, ?_, ?_⟩ - · rw [eq, shorter] - · change (rootPath J S R request v).length = - (rootPath J S R request (source J S R request d)).length + 1 - rw [eq, shorter, List.length_append] - rfl - -end CosetGeometry.TileStars - - - - -open Attachment -universe u v w - -structure IdealEmbedding {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) - extends MeetEmbedding P Q where - ideal : ∀ a x, Q.le x (toFun a) → ∃ b, toFun b = x - -namespace IdealEmbedding - -variable {A : Type u} {B : Type v} {C : Type w} - {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} - -def identity (P : MeetOrder A) : IdealEmbedding P P where - toMeetEmbedding := (identityIso P).toMeetEmbedding - ideal _ x _ := ⟨x, rfl⟩ - -def comp (f : IdealEmbedding P Q) (g : IdealEmbedding Q R) : IdealEmbedding P R where - toMeetEmbedding := compose f.toMeetEmbedding g.toMeetEmbedding - ideal a x hx := by - rcases g.ideal (f.toFun a) x hx with ⟨b, rfl⟩ - rcases f.ideal a b ((g.le_iff _ _).mp hx) with ⟨c, rfl⟩ - exact ⟨c, rfl⟩ - -def ofOrderMap (f : A → B) (le_iff : ∀ a b, Q.le (f a) (f b) ↔ P.le a b) - (ideal : ∀ a x, Q.le x (f a) → ∃ b, f b = x) : IdealEmbedding P Q where - toFun := f - le_iff := le_iff - ideal := ideal - map_meet a b := by - apply Q.antisymm - · exact Q.le_meet ((le_iff _ _).mpr (P.meet_le_left a b)) - ((le_iff _ _).mpr (P.meet_le_right a b)) - · rcases ideal a (Q.meet (f a) (f b)) (Q.meet_le_left _ _) with ⟨c, eq⟩ - rw [← eq] - apply (le_iff _ _).mpr - apply P.le_meet - · apply (le_iff _ _).mp - rw [eq] - exact Q.meet_le_left _ _ - · apply (le_iff _ _).mp - rw [eq] - exact Q.meet_le_right _ _ - -theorem principal (f : IdealEmbedding P Q) (top : A) (greatest : ∀ a, P.le a top) (x : B) : - Q.le x (f.toFun top) ↔ ∃ a, f.toFun a = x := by - constructor - · exact f.ideal top x - · rintro ⟨a, rfl⟩ - exact (f.le_iff _ _).mpr (greatest a) - -theorem principal_surjective (f : IdealEmbedding P Q) (a : A) - (x : {x : B // Q.le x (f.toFun a)}) : - ∃ y : {y : A // P.le y a}, f.toFun y.val = x.val := by - rcases f.ideal a x.val x.property with ⟨y, eq⟩ - exact ⟨⟨y, (f.le_iff _ _).mp (eq ▸ x.property)⟩, eq⟩ - -noncomputable def principalIso (f : IdealEmbedding P Q) (a : A) : - MeetIso (idealOrder P a) (idealOrder Q (f.toFun a)) where - toFun x := ⟨f.toFun x.val, (f.le_iff _ _).mpr x.property⟩ - le_iff x y := f.le_iff x.val y.val - map_meet x y := Subtype.ext (f.map_meet x.val y.val) - inverse x := Classical.choose (f.principal_surjective a x) - right_inverse x := Subtype.ext (Classical.choose_spec (f.principal_surjective a x)) - left_inverse x := by - apply Subtype.ext - apply embedding_injective f.toMeetEmbedding - exact Classical.choose_spec (f.principal_surjective a _) - -noncomputable def projection (f : IdealEmbedding P Q) (top : A) (x : B) : A := - Classical.choose (f.ideal top (Q.meet x (f.toFun top)) (Q.meet_le_right _ _)) - -theorem projection_spec (f : IdealEmbedding P Q) (top : A) (x : B) : - f.toFun (f.projection top x) = Q.meet x (f.toFun top) := - Classical.choose_spec (f.ideal top (Q.meet x (f.toFun top)) (Q.meet_le_right _ _)) - -theorem greatest_part (f : IdealEmbedding P Q) (top : A) - (greatest : ∀ a, P.le a top) (x : B) (a : A) : - Q.le (f.toFun a) x ↔ P.le a (f.projection top x) := by - rw [← f.le_iff, f.projection_spec] - constructor - · intro h - exact Q.le_meet h ((f.le_iff _ _).mpr (greatest a)) - · intro h - exact Q.trans h (Q.meet_le_left _ _) - -end IdealEmbedding -end - - - -namespace PrincipalBatch - -open Attachment -universe u - -structure Family {A : Type u} (P : MeetOrder A) (I : Type u) where - Space : I → Type u - order : ∀ i, MeetOrder (Space i) - glue : ∀ i, PrincipalAmalgamation.Input P (order i) - -namespace Family - -variable {A I : Type u} {P : MeetOrder A} (b : Family P I) - -def Fresh := (i : I) × (b.glue i).Fresh -def Node := A ⊕ b.Fresh - -def Inside (x y : b.Fresh) : Prop := - ∃ h : x.1 = y.1, (b.order x.1).le x.2.val (h.symm ▸ y.2.val) - -def data : Data P b.Fresh I where - component := Sigma.fst - base i := (b.glue i).leftAnchor - upper _ _ := False - upper_up := by intro _ _ _ h _; exact h - upper_meet := by intro _ _ _ h _; exact h - base_le_upper := by intro _ _ h; exact False.elim h - base_not_upper := by intro _ h; exact h - shadow x := (b.glue x.1).shadow x.2.val - shadow_le_base x := (b.glue x.1).shadow_le_anchor x.2.val - inside := b.Inside - inside_refl x := ⟨rfl, (b.order x.1).refl x.2.val⟩ - inside_trans := by - rintro ⟨i, x⟩ ⟨j, y⟩ ⟨k, z⟩ ⟨hij, hxy⟩ ⟨hjk, hyz⟩ - cases hij - cases hjk - exact ⟨rfl, (b.order i).trans hxy hyz⟩ - inside_antisymm := by - rintro ⟨i, x⟩ ⟨j, y⟩ ⟨hij, hxy⟩ ⟨hji, hyx⟩ - cases hij - cases hji - exact congrArg (Sigma.mk i) (Subtype.ext ((b.order i).antisymm hxy hyx)) - inside_component h := h.choose - inside_shadow := by - rintro ⟨i, x⟩ ⟨j, y⟩ ⟨hij, hxy⟩ - cases hij - exact (b.glue i).shadow_mono hxy - -theorem component_meets : ComponentMeets b.data := by - classical - rintro ⟨i, x⟩ ⟨j, z⟩ same - change i = j at same - cases same - by_cases old : (b.order i).le ((b.order i).meet x.val z.val) (b.glue i).rightAnchor - · apply Or.inr - rintro ⟨k, y⟩ ⟨hki, hyx⟩ ⟨hki', hyz⟩ - cases hki - cases hki' - exact y.property ((b.order i).trans ((b.order i).le_meet hyx hyz) old) - · refine Or.inl ⟨⟨i, ⟨(b.order i).meet x.val z.val, old⟩⟩, - ⟨rfl, (b.order i).meet_le_left _ _⟩, ⟨rfl, (b.order i).meet_le_right _ _⟩, ?_, ?_⟩ - · rintro ⟨k, y⟩ ⟨hki, hyx⟩ ⟨hki', hyz⟩ - cases hki - cases hki' - exact ⟨rfl, (b.order i).le_meet hyx hyz⟩ - · exact (b.glue i).shadow_meet x.val z.val - -noncomputable def extension : MeetOrder b.Node := meetOrder b.data b.component_meets - -noncomputable def old : IdealEmbedding P b.extension where - toMeetEmbedding := oldEmbedding b.data b.component_meets - ideal a x hx := by - cases x with - | inl x => exact ⟨x, rfl⟩ - | inr x => exact False.elim hx - -def componentMap (i : I) : (b.glue i).Node → b.Node - | .inl a => .inl a - | .inr x => .inr ⟨i, x⟩ - -theorem componentMap_le (i : I) (x y : (b.glue i).Node) : - b.extension.le (b.componentMap i x) (b.componentMap i y) ↔ (b.glue i).order.le x y := by - cases x with - | inl a => cases y <;> exact Iff.rfl - | inr x => - cases y with - | inl a => exact Iff.rfl - | inr y => - change (b.Inside ⟨i, x⟩ ⟨i, y⟩ ∨ False) ↔ ((b.order i).le x.val y.val ∨ False) - constructor - · rintro (⟨h, lower⟩ | impossible) - · cases h - exact Or.inl lower - · exact False.elim impossible - · rintro (lower | impossible) - · exact Or.inl ⟨rfl, lower⟩ - · exact False.elim impossible - -theorem componentMap_ideal (i : I) (a : (b.glue i).Node) (x : b.Node) - (lower : b.extension.le x (b.componentMap i a)) : - ∃ y, b.componentMap i y = x := by - cases x with - | inl x => exact ⟨.inl x, rfl⟩ - | inr x => - cases a with - | inl a => exact False.elim lower - | inr a => - rcases lower with h | impossible - · rcases x with ⟨j, x⟩ - rcases h with ⟨eq, _⟩ - cases eq - exact ⟨.inr x, rfl⟩ - · exact False.elim impossible - -noncomputable def component (i : I) : IdealEmbedding (b.glue i).order b.extension := - IdealEmbedding.ofOrderMap (b.componentMap i) (b.componentMap_le i) (b.componentMap_ideal i) - -noncomputable def tile (i : I) : IdealEmbedding (b.order i) b.extension := - IdealEmbedding.comp - { toMeetEmbedding := (b.glue i).right, ideal := (b.glue i).right_ideal } - (b.component i) - -theorem tile_old_overlap (i : I) (x : b.Space i) (a : A) : - (b.tile i).toFun x = b.old.toFun a ↔ - ∃ h : (b.order i).le x (b.glue i).rightAnchor, - ((b.glue i).overlap.toFun ⟨x, h⟩).val = a := by - change b.componentMap i ((b.glue i).right.toFun x) = b.componentMap i (.inl a) ↔ _ - exact (Iff.intro (fun h => embedding_injective (b.component i).toMeetEmbedding h) - (congrArg (b.componentMap i))).trans ((b.glue i).overlap_exact a x) - -theorem cover (x : b.Node) : - (∃ a, b.old.toFun a = x) ∨ ∃ i y, (b.tile i).toFun y = x := by - cases x with - | inl a => exact Or.inl ⟨a, rfl⟩ - | inr x => - refine Or.inr ⟨x.1, x.2.val, ?_⟩ - exact congrArg (b.componentMap x.1) ((b.glue x.1).represent_new x.2.val x.2.property) - -theorem fresh_old_meet (x : b.Fresh) (a : A) : - b.extension.meet (.inr x) (b.old.toFun a) = - b.old.toFun (P.meet ((b.glue x.1).shadow x.2.val) a) := - meet_eq b.data b.component_meets (Attachment.shadow_meet b.data x a (fun h => h)) - -theorem fresh_greatest_old_part (x : b.Fresh) (a : A) : - b.extension.le (b.old.toFun a) (.inr x) ↔ P.le a ((b.glue x.1).shadow x.2.val) := Iff.rfl - -theorem different_fresh_incomparable (x y : b.Fresh) (different : x.1 ≠ y.1) : - ¬ b.extension.le (.inr x) (.inr y) := by - intro lower - rcases lower with ⟨same, _⟩ | impossible - · exact different same - · exact impossible - -theorem old_vertex_preserved {V : Type u} {Q : MeetOrder V} (f : IdealEmbedding Q P) : - ∃ e : IdealEmbedding Q b.extension, ∀ x, e.toFun x = b.old.toFun (f.toFun x) := - ⟨f.comp b.old, fun _ => rfl⟩ - -theorem tile_vertex_preserved (i : I) {V : Type u} {Q : MeetOrder V} - (f : IdealEmbedding Q (b.order i)) : - ∃ e : IdealEmbedding Q b.extension, ∀ x, e.toFun x = (b.tile i).toFun (f.toFun x) := - ⟨f.comp (b.tile i), fun _ => rfl⟩ - -end Family -end PrincipalBatch - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalWordRewriteRelations + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +namespace CosetGeometry + +universe u + +variable (J S : Type u) [Group J] + +def Same (x y : External J S) : Prop := ∃ j, x * old J S j = y + +def cosetSetoid : Setoid (External J S) where + r := Same J S + iseqv := by + constructor + · intro x + exact ⟨1, by rw [map_one, mul_one]⟩ + · rintro x y ⟨j, rfl⟩ + exact ⟨j⁻¹, by rw [map_inv, mul_inv_cancel_right]⟩ + · rintro x y z ⟨i, rfl⟩ ⟨j, rfl⟩ + exact ⟨i * j, by rw [map_mul, mul_assoc]⟩ + +def Vertex := Quotient (cosetSetoid J S) +def point (g : External J S) : Vertex J S := Quotient.mk (cosetSetoid J S) g + +def root : Vertex J S := point J S 1 + +theorem point_eq (g h : External J S) : point J S g = point J S h ↔ ∃ j, g * old J S j = h := + ⟨fun eq => Quotient.exact eq, fun eq => Quotient.sound eq⟩ + +theorem root_eq_point (g : External J S) : root J S = point J S g ↔ ∃ j, old J S j = g := by + rw [root, point_eq] + simp only [one_mul] + +def act (g : External J S) : Vertex J S → Vertex J S := + Quotient.map (fun x => g * x) (by + rintro x y ⟨j, rfl⟩ + exact ⟨j, mul_assoc _ _ _⟩) + +theorem act_point (g h : External J S) : act J S g (point J S h) = point J S (g * h) := rfl + +theorem act_root (g : External J S) : act J S g (root J S) = point J S g := by + change point J S (g * 1) = _ + rw [mul_one] + +theorem act_one (x : Vertex J S) : act J S 1 x = x := by + induction x using Quotient.ind with + | _ x => exact congrArg (point J S) (one_mul x) + +theorem act_mul (g h : External J S) (x : Vertex J S) : + act J S (g * h) x = act J S g (act J S h x) := by + induction x using Quotient.ind with + | _ x => exact congrArg (point J S) (mul_assoc g h x) + +def Dart := (External J S × S) × Bool + +def reverse (d : Dart J S) : Dart J S := (d.1, !d.2) + +def startRep (d : Dart J S) : External J S := + if d.2 then d.1.1 else d.1.1 * generator J S d.1.2 + +def endRep (d : Dart J S) : External J S := + if d.2 then d.1.1 * generator J S d.1.2 else d.1.1 + +def letter (d : Dart J S) : S × Bool := (d.1.2, d.2) +def source (d : Dart J S) : Vertex J S := point J S (startRep J S d) +def target (d : Dart J S) : Vertex J S := point J S (endRep J S d) + +theorem signed_true (s : S) : signed J S (s, true) = generator J S s := rfl + +theorem signed_false (s : S) : signed J S (s, false) = (generator J S s)⁻¹ := by + rw [generator, ← map_inv] + rfl + +theorem end_eq (d : Dart J S) : startRep J S d * signed J S (letter J S d) = endRep J S d := by + rcases d with ⟨⟨w, s⟩, b⟩ + cases b + · change (w * generator J S s) * signed J S (s, false) = w + rw [signed_false, mul_inv_cancel_right] + · rfl + +theorem reverse_reverse (d : Dart J S) : reverse J S (reverse J S d) = d := by + rcases d with ⟨⟨w, s⟩, b⟩ + cases b <;> rfl + +theorem source_reverse (d : Dart J S) : source J S (reverse J S d) = target J S d := by + rcases d with ⟨⟨w, s⟩, b⟩ + cases b <;> rfl + +theorem target_reverse (d : Dart J S) : target J S (reverse J S d) = source J S d := by + rcases d with ⟨⟨w, s⟩, b⟩ + cases b <;> rfl + +theorem cancellation_reverses_edge (d e : Dart J S) + (joined : startRep J S e = endRep J S d) + (cancel : Cancel S (letter J S d) (letter J S e)) : e = reverse J S d := by + rcases d with ⟨⟨w, s⟩, b⟩ + rcases e with ⟨⟨v, t⟩, c⟩ + cases b <;> cases c + · simp [Cancel, letter] at cancel + · have st : s = t := cancel.1 + subst t + change v = w at joined + subst v + rfl + · have st : s = t := cancel.1 + subst t + change v * generator J S s = w * generator J S s at joined + have vw := mul_right_cancel joined + subst v + rfl + · simp [Cancel, letter] at cancel + +def translate (g : External J S) (d : Dart J S) : Dart J S := ((g * d.1.1, d.1.2), d.2) + +theorem source_translate (g : External J S) (d : Dart J S) : + source J S (translate J S g d) = act J S g (source J S d) := by + rcases d with ⟨⟨w, s⟩, b⟩ + cases b + · exact congrArg (point J S) (mul_assoc g w (generator J S s)) + · rfl + +theorem target_translate (g : External J S) (d : Dart J S) : + target J S (translate J S g d) = act J S g (target J S d) := by + rcases d with ⟨⟨w, s⟩, b⟩ + cases b + · rfl + · exact congrArg (point J S) (mul_assoc g w (generator J S s)) + +inductive Follows : Vertex J S → List (Dart J S) → Vertex J S → Prop + | nil (v) : Follows v [] v + | cons (d : Dart J S) {L v} (tail : Follows (target J S d) L v) : + Follows (source J S d) (d :: L) v + +theorem follows_cons_source {v w : Vertex J S} {d : Dart J S} {L} + (path : Follows J S v (d :: L) w) : v = source J S d := by + cases path + rfl + +theorem follows_tail {v w : Vertex J S} {d : Dart J S} {L} + (path : Follows J S v (d :: L) w) : Follows J S (target J S d) L w := by + cases path with + | cons _ tail => exact tail + +theorem follows_append {v w z : Vertex J S} {L M} + (first : Follows J S v L w) (second : Follows J S w M z) : + Follows J S v (L ++ M) z := by + induction first with + | nil => exact second + | cons d tail ih => exact Follows.cons d (ih second) + +theorem follows_translate {v w : Vertex J S} {L} (path : Follows J S v L w) + (g : External J S) : + Follows J S (act J S g v) (L.map (translate J S g)) (act J S g w) := by + induction path with + | nil v => exact Follows.nil _ + | cons d tail ih => + rw [← source_translate, List.map_cons] + apply Follows.cons + rw [target_translate] + exact ih + + + + + + + +def NoBacktracking : List (Dart J S) → Prop + | [] => True + | [_] => True + | d :: e :: rest => e ≠ reverse J S d ∧ NoBacktracking (e :: rest) + +theorem follows_empty_eq {v w : Vertex J S} {L : List (Dart J S)} + (path : Follows J S v L w) (empty : L = []) : v = w := by + induction path with + | nil => rfl + | cons d tail ih => cases empty + +theorem follows_singleton_target {v w : Vertex J S} {d : Dart J S} + (path : Follows J S v [d] w) : w = target J S d := by + have tail : Follows J S (target J S d) [] w := follows_tail J S path + exact (follows_empty_eq J S tail rfl).symm + +theorem path_word (d : Dart J S) (tail : List (Dart J S)) (finish : Vertex J S) + (path : Follows J S (source J S d) (d :: tail) finish) + (reduced : NoBacktracking J S (d :: tail)) : + ∃ j rest, Reduced J S ((letter J S d, j) :: rest) ∧ + point J S (startRep J S d * eval J S ((letter J S d, j) :: rest)) = finish := by + induction tail generalizing d finish with + | nil => + refine ⟨1, [], True.intro, ?_⟩ + rw [follows_singleton_target J S path] + change point J S (startRep J S d * (signed J S (letter J S d) * old J S 1 * 1)) = _ + rw [map_one, mul_one, mul_one, end_eq] + rfl + | cons e tail ih => + have ep := follows_tail J S path + have join : target J S d = source J S e := follows_cons_source J S ep + rw [join] at ep + rcases ih e finish ep reduced.2 with ⟨k, rest, ereduced, endpoint⟩ + rcases (point_eq J S (endRep J S d) (startRep J S e)).mp join with ⟨j, coordinate⟩ + refine ⟨j, (letter J S e, k) :: rest, ⟨?_, ereduced⟩, ?_⟩ + · intro jone cancel + change j = 1 at jone + have joined : startRep J S e = endRep J S d := by + rw [jone, map_one, mul_one] at coordinate + exact coordinate.symm + exact reduced.1 (cancellation_reverses_edge J S d e joined cancel) + · have transition : startRep J S d * signed J S (letter J S d) * old J S j = startRep J S e := + (congrArg (fun x => x * old J S j) (end_eq J S d)).trans coordinate + calc + point J S (startRep J S d * eval J S ((letter J S d, j) :: (letter J S e, k) :: rest)) = + point J S ((startRep J S d * signed J S (letter J S d) * old J S j) * + eval J S ((letter J S e, k) :: rest)) := by simp only [eval, mul_assoc] + _ = point J S (startRep J S e * eval J S ((letter J S e, k) :: rest)) := by rw [transition] + _ = finish := endpoint + +theorem no_closed_reduced_path (v : Vertex J S) (d : Dart J S) (tail : List (Dart J S)) + (path : Follows J S v (d :: tail) v) : ¬ NoBacktracking J S (d :: tail) := by + classical + intro reduced + have start := follows_cons_source J S path + rw [start] at path + rcases path_word J S d tail (source J S d) path reduced with ⟨j, rest, normal, endpoint⟩ + let value := eval J S ((letter J S d, j) :: rest) + rcases (point_eq J S (startRep J S d * value) (startRep J S d)).mp endpoint with ⟨k, eq⟩ + have cancelled : value * old J S k = 1 := by + apply mul_left_cancel (a := startRep J S d) + simpa only [mul_assoc, mul_one] using eq + have value_eq : value = old J S k⁻¹ := by + calc + value = value * (old J S k * old J S k⁻¹) := by rw [map_inv, mul_inv_cancel, mul_one] + _ = (value * old J S k) * old J S k⁻¹ := (mul_assoc _ _ _).symm + _ = old J S k⁻¹ := by rw [cancelled, one_mul] + exact reduced_not_old J S (letter J S d) j rest normal k⁻¹ value_eq + +def Reachable (g : External J S) : Prop := + ∃ L, Follows J S (root J S) L (point J S g) + +theorem reachable_one : Reachable J S 1 := ⟨[], Follows.nil _⟩ + +theorem reachable_old (j : J) : Reachable J S (old J S j) := by + have eq := (root_eq_point J S (old J S j)).mpr ⟨j, rfl⟩ + refine ⟨[], ?_⟩ + rw [← eq] + exact Follows.nil _ + +theorem reachable_mul {g h : External J S} (hg : Reachable J S g) (hh : Reachable J S h) : + Reachable J S (g * h) := by + rcases hg with ⟨L, first⟩ + rcases hh with ⟨M, second⟩ + have shifted := follows_translate J S second g + rw [act_root, act_point] at shifted + exact ⟨L ++ M.map (translate J S g), follows_append J S first shifted⟩ + +theorem reachable_generator (s : S) : Reachable J S (generator J S s) := by + let d : Dart J S := ((1, s), true) + have path := Follows.cons d (Follows.nil (target J S d)) + change Follows J S (root J S) [d] (point J S (1 * generator J S s)) at path + rw [one_mul] at path + exact ⟨[d], path⟩ + +theorem reachable_generator_inv (s : S) : Reachable J S (generator J S s)⁻¹ := by + let d : Dart J S := (((generator J S s)⁻¹, s), false) + have path := Follows.cons d (Follows.nil (target J S d)) + change Follows J S (point J S ((generator J S s)⁻¹ * generator J S s)) [d] + (point J S (generator J S s)⁻¹) at path + rw [inv_mul_cancel] at path + exact ⟨[d], path⟩ + +theorem reachable_free (f : FreeGroup S) : Reachable J S (free J S f) := by + induction f using FreeGroup.induction_on with + | one => rw [map_one]; exact reachable_one J S + | of letter => exact reachable_generator J S letter + | inv_of letter _ => rw [map_inv]; exact reachable_generator_inv J S letter + | mul first second firstReachable secondReachable => + rw [map_mul] + exact reachable_mul J S firstReachable secondReachable + +theorem reachable_element (g : External J S) : Reachable J S g := by + induction g using Monoid.CoprodI.induction_on with + | one => exact reachable_one J S + | of i x => + cases i + · exact reachable_old J S x + · exact reachable_free J S x + | mul x y hx hy => exact reachable_mul J S hx hy + +theorem connected (v : Vertex J S) : ∃ L, Follows J S (root J S) L v := by + induction v using Quotient.ind with + | _ g => exact reachable_element J S g + +def IsIndexedTree : Prop := + (∀ v : Vertex J S, ∃ L, Follows J S (root J S) L v) ∧ + ∀ v d tail, Follows J S v (d :: tail) v → ¬ NoBacktracking J S (d :: tail) + +theorem coset_tree : IsIndexedTree J S := + ⟨connected J S, no_closed_reduced_path J S⟩ + +theorem reversal_of_not_reduced (L : List (Dart J S)) (h : ¬ NoBacktracking J S L) : + ∃ pre d suffix, L = pre ++ d :: reverse J S d :: suffix := by + classical + induction L with + | nil => exact False.elim (h True.intro) + | cons d tail ih => + cases tail with + | nil => exact False.elim (h True.intro) + | cons e tail => + by_cases back : e = reverse J S d + · exact ⟨[], d, tail, by rw [back]; rfl⟩ + · rcases ih (fun ht => h ⟨back, ht⟩) with ⟨pre, x, suffix, eq⟩ + exact ⟨d :: pre, x, suffix, congrArg (List.cons d) eq⟩ + +theorem closed_path_has_reversal (v : Vertex J S) (d : Dart J S) (tail : List (Dart J S)) + (path : Follows J S v (d :: tail) v) : + ∃ pre e suffix, d :: tail = pre ++ e :: reverse J S e :: suffix := + reversal_of_not_reduced J S _ (no_closed_reduced_path J S v d tail path) + +@[instance_reducible] +def groupOfData {G : Type u} (g : GroupData G) : Group G where + mul := g.mul + mul_assoc := g.assoc + one := g.one + one_mul := g.one_mul + mul_one := g.mul_one + inv := g.inv + inv_mul_cancel := g.inv_mul + +theorem taskSystem_coset_tree {A G Task Label : Type u} {P : MeetOrder A} + (f : TaskSystem P G Task Label) (Letters : Type u) : + @IsIndexedTree G Letters (groupOfData f.group) := by + let : Group G := groupOfData f.group + exact coset_tree G Letters + +end CosetGeometry + + + +section + +namespace EdgeWords + +universe u +variable {E : Type u} + +def reverse (d : E × Bool) : E × Bool := (d.1, !d.2) + +def NoBacktracking : List (E × Bool) → Prop + | [] => True + | [_] => True + | d :: e :: rest => e ≠ reverse d ∧ NoBacktracking (e :: rest) + +theorem mk_cons (d : E × Bool) (L : List (E × Bool)) : + FreeGroup.mk (d :: L) = FreeGroup.mk [d] * FreeGroup.mk L := + (@FreeGroup.mul_mk E [d] L).symm + +theorem mk_reverse (d : E × Bool) : + FreeGroup.mk [reverse d] = (FreeGroup.mk [d])⁻¹ := by + rcases d with ⟨e, b⟩ + cases b <;> rfl + +theorem mk_delete_reversal (pre : List (E × Bool)) (d : E × Bool) (suffix) : + FreeGroup.mk (pre ++ d :: reverse d :: suffix) = FreeGroup.mk (pre ++ suffix) := + Quot.sound FreeGroup.Red.Step.not + +theorem reduce_of_no_backtracking [DecidableEq E] (L : List (E × Bool)) + (h : NoBacktracking L) : FreeGroup.reduce L = L := by + induction L with + | nil => rfl + | cons d tail ih => + cases tail with + | nil => rfl + | cons e rest => + rw [FreeGroup.reduce.cons, ih h.2] + have safe : ¬ (d.1 = e.1 ∧ d.2 = !e.2) := by + rintro ⟨edges, signs⟩ + apply h.1 + change e = (d.1, !d.2) + refine Prod.ext edges.symm ?_ + have flipped := congrArg Bool.not signs + simpa only [Bool.not_not] using flipped.symm + change (if d.1 = e.1 ∧ d.2 = !e.2 then rest else d :: e :: rest) = _ + rw [ite_eq_right safe] + +theorem reduced_word_eq_one_iff (L : List (E × Bool)) (h : NoBacktracking L) : + FreeGroup.mk L = 1 ↔ L = [] := by + classical + constructor + · intro eq + have words := congrArg FreeGroup.toWord eq + simpa only [FreeGroup.toWord_mk, FreeGroup.toWord_one, + reduce_of_no_backtracking L h] using words + · rintro rfl + rfl + +end EdgeWords + +namespace CosetGeometry + +universe u +variable (J S : Type u) [Group J] + +theorem follows_delete_reversal (pre : List (Dart J S)) (d : Dart J S) (suffix) + {v w : Vertex J S} (path : Follows J S v (pre ++ d :: reverse J S d :: suffix) w) : + Follows J S v (pre ++ suffix) w := by + induction pre generalizing v with + | nil => + have start := follows_cons_source J S path + have tail := follows_tail J S (follows_tail J S path) + rw [target_reverse] at tail + rw [start] + exact tail + | cons e pre ih => + have start := follows_cons_source J S path + rw [start] + exact Follows.cons e (ih (follows_tail J S path)) + +theorem closed_edge_word (v : Vertex J S) (L : List (Dart J S)) + (path : Follows J S v L v) : FreeGroup.mk L = 1 := by + cases hL : L with + | nil => rfl + | cons d tail => + rw [hL] at path + rcases closed_path_has_reversal J S v d tail path with ⟨pre, e, suffix, eq⟩ + have cut : Follows J S v (pre ++ suffix) v := by + apply follows_delete_reversal J S pre e suffix + rw [← eq] + exact path + calc + FreeGroup.mk (d :: tail) = FreeGroup.mk (pre ++ suffix) := by + erw [eq] + exact EdgeWords.mk_delete_reversal pre e suffix + _ = 1 := closed_edge_word v (pre ++ suffix) cut +termination_by L.length +decreasing_by + rw [hL] + have lengths := congrArg List.length eq + simp only [List.length_cons, List.length_append] at lengths ⊢ + omega + +end CosetGeometry +end + + + +namespace CosetGeometry.TileStars + +universe u +variable (J S R : Type u) [Group J] + +abbrev Center := External J S × R +abbrev OldEdge := External J S × S +def Vertex := Sum (CosetGeometry.Vertex J S) (Center J S R) +def Edge := Sum (Center J S R) (OldEdge J S) +abbrev Dart := Edge J S R × Bool + +def reverse (d : Dart J S R) : Dart J S R := EdgeWords.reverse d + +variable (request : S → R) + +def centerOf (e : OldEdge J S) : Center J S R := (e.1, request e.2) + +def source (d : Dart J S R) : Vertex J S R := + match d.1, d.2 with + | .inl c, true => .inl (point J S c.1) + | .inl c, false => .inr c + | .inr e, true => .inr (centerOf J S R request e) + | .inr e, false => .inl (point J S (e.1 * generator J S e.2)) + +def target (d : Dart J S R) : Vertex J S R := + source J S R request (reverse J S R d) + +theorem reverse_reverse (d : Dart J S R) : reverse J S R (reverse J S R d) = d := by + rcases d with ⟨e, b⟩ + cases b <;> rfl + +theorem source_reverse (d : Dart J S R) : + source J S R request (reverse J S R d) = target J S R request d := rfl + +theorem target_reverse (d : Dart J S R) : + target J S R request (reverse J S R d) = source J S R request d := by + exact congrArg (source J S R request) (reverse_reverse J S R d) + +def root : Vertex J S R := .inl (CosetGeometry.root J S) + +inductive Follows : Vertex J S R → List (Dart J S R) → Vertex J S R → Prop + | nil (v) : Follows v [] v + | cons (d : Dart J S R) {L v} + (tail : Follows (target J S R request d) L v) : + Follows (source J S R request d) (d :: L) v + +theorem follows_append {v w z : Vertex J S R} {L M} + (first : Follows J S R request v L w) (second : Follows J S R request w M z) : + Follows J S R request v (L ++ M) z := by + induction first with + | nil => exact second + | cons d tail ih => exact Follows.cons d (ih second) + +def contract : Vertex J S R → CosetGeometry.Vertex J S + | .inl v => v + | .inr c => point J S c.1 + +def projectDart (d : Dart J S R) : List (CosetGeometry.Dart J S) := + match d.1 with + | .inl _ => [] + | .inr e => [(e, d.2)] + +def project (L : List (Dart J S R)) : List (CosetGeometry.Dart J S) := + L.flatMap (projectDart J S R) + +theorem contract_edge (d : Dart J S R) : + CosetGeometry.Follows J S (contract J S R (source J S R request d)) + (projectDart J S R d) (contract J S R (target J S R request d)) := by + rcases d with ⟨c | e, b⟩ <;> cases b + · exact CosetGeometry.Follows.nil _ + · exact CosetGeometry.Follows.nil _ + · exact CosetGeometry.Follows.cons (e, false) (CosetGeometry.Follows.nil _) + · exact CosetGeometry.Follows.cons (e, true) (CosetGeometry.Follows.nil _) + +theorem follows_project {v w : Vertex J S R} {L} + (path : Follows J S R request v L w) : + CosetGeometry.Follows J S (contract J S R v) (project J S R L) (contract J S R w) := by + induction path with + | nil v => exact CosetGeometry.Follows.nil _ + | cons d tail ih => + exact CosetGeometry.follows_append J S (contract_edge J S R request d) ih + +def expandDart (d : CosetGeometry.Dart J S) : List (Dart J S R) := + if d.2 then + [(.inl (centerOf J S R request d.1), true), (.inr d.1, true)] + else + [(.inr d.1, false), (.inl (centerOf J S R request d.1), false)] + +theorem expand_edge (d : CosetGeometry.Dart J S) : + Follows J S R request (.inl (CosetGeometry.source J S d)) + (expandDart J S R request d) (.inl (CosetGeometry.target J S d)) := by + rcases d with ⟨e, b⟩ + cases b + · exact Follows.cons (.inr e, false) + (Follows.cons (.inl (centerOf J S R request e), false) (Follows.nil _)) + · exact Follows.cons (.inl (centerOf J S R request e), true) + (Follows.cons (.inr e, true) (Follows.nil _)) + +theorem follows_expand {v w : CosetGeometry.Vertex J S} {L} + (path : CosetGeometry.Follows J S v L w) : + Follows J S R request (.inl v) (L.flatMap (expandDart J S R request)) (.inl w) := by + induction path with + | nil v => exact Follows.nil _ + | cons d tail ih => exact follows_append J S R request (expand_edge J S R request d) ih + +theorem connected (v : Vertex J S R) : + ∃ L, Follows J S R request (root J S R) L v := by + cases v with + | inl v => + rcases CosetGeometry.connected J S v with ⟨L, path⟩ + exact ⟨L.flatMap (expandDart J S R request), follows_expand J S R request path⟩ + | inr c => + rcases CosetGeometry.connected J S (point J S c.1) with ⟨L, path⟩ + have lifted := follows_expand J S R request path + have stem := Follows.cons (J := J) (S := S) (R := R) (request := request) + (.inl c, true) (Follows.nil _) + exact ⟨_, follows_append J S R request lifted stem⟩ + +end CosetGeometry.TileStars + + + +namespace CosetGeometry.TileStars + +universe u +variable (J S R : Type u) [Group J] (request : S → R) + +def potential : Vertex J S R → FreeGroup (Edge J S R) + | .inl _ => 1 + | .inr c => FreeGroup.of (.inl c) + +def expandHom : FreeGroup (OldEdge J S) →* FreeGroup (Edge J S R) := + FreeGroup.lift (fun e => + FreeGroup.of (.inl (centerOf J S R request e)) * FreeGroup.of (.inr e)) + +theorem edge_word (d : Dart J S R) : + FreeGroup.mk [d] = + (potential J S R (source J S R request d))⁻¹ * + expandHom J S R request (FreeGroup.mk (projectDart J S R d)) * + potential J S R (target J S R request d) := by + rcases d with ⟨c | e, b⟩ <;> cases b + · change (FreeGroup.of (.inl c : Edge J S R))⁻¹ = + (FreeGroup.of (.inl c))⁻¹ * expandHom J S R request 1 * 1 + erw [map_one, mul_one, mul_one] + rfl + · change FreeGroup.of (.inl c : Edge J S R) = + (1 : FreeGroup (Edge J S R))⁻¹ * expandHom J S R request 1 * FreeGroup.of (.inl c) + erw [map_one, inv_one, one_mul] + rfl + · change (FreeGroup.of (.inr e : Edge J S R))⁻¹ = + (1 : FreeGroup (Edge J S R))⁻¹ * expandHom J S R request (FreeGroup.of e)⁻¹ * + FreeGroup.of (.inl (centerOf J S R request e)) + rw [inv_one, one_mul, map_inv] + rw [expandHom, FreeGroup.lift_apply_of] + change (FreeGroup.of (.inr e : Edge J S R))⁻¹ = + (FreeGroup.of (.inl (centerOf J S R request e)) * FreeGroup.of (.inr e))⁻¹ * + FreeGroup.of (.inl (centerOf J S R request e)) + rw [mul_inv_rev, inv_mul_cancel_right] + · change FreeGroup.of (.inr e : Edge J S R) = + (FreeGroup.of (.inl (centerOf J S R request e)))⁻¹ * + expandHom J S R request (FreeGroup.of e) * 1 + rw [expandHom, FreeGroup.lift_apply_of] + change FreeGroup.of (.inr e : Edge J S R) = + (FreeGroup.of (.inl (centerOf J S R request e)))⁻¹ * + (FreeGroup.of (.inl (centerOf J S R request e)) * FreeGroup.of (.inr e)) * 1 + rw [inv_mul_cancel_left, mul_one] + +theorem path_word {v w : Vertex J S R} {L} + (path : Follows J S R request v L w) : + FreeGroup.mk L = (potential J S R v)⁻¹ * + expandHom J S R request (FreeGroup.mk (project J S R L)) * potential J S R w := by + induction path with + | nil v => + change 1 = (potential J S R v)⁻¹ * expandHom J S R request 1 * potential J S R v + rw [map_one, mul_one, inv_mul_cancel] + | @cons d L w tail ih => + rw [EdgeWords.mk_cons, edge_word, ih] + change (_ * expandHom J S R request (FreeGroup.mk (projectDart J S R d)) * _) * + (_ * expandHom J S R request (FreeGroup.mk (project J S R L)) * _) = + _ * expandHom J S R request (FreeGroup.mk (projectDart J S R d ++ project J S R L)) * _ + erw [← FreeGroup.mul_mk, map_mul] + simp only [mul_assoc, mul_inv_cancel_left] + +theorem closed_edge_word (v : Vertex J S R) (L : List (Dart J S R)) + (path : Follows J S R request v L v) : FreeGroup.mk L = 1 := by + have equation := path_word J S R request path + have contracted := CosetGeometry.closed_edge_word J S (contract J S R v) + (project J S R L) (follows_project J S R request path) + rw [contracted, map_one, mul_one, inv_mul_cancel] at equation + exact equation + +theorem no_closed_reduced_path (v : Vertex J S R) (d : Dart J S R) (tail) + (path : Follows J S R request v (d :: tail) v) : ¬ EdgeWords.NoBacktracking (d :: tail) := by + intro reduced + have empty := (EdgeWords.reduced_word_eq_one_iff (d :: tail) reduced).mp + (closed_edge_word J S R request v (d :: tail) path) + cases empty + +def IsIndexedTree : Prop := + (∀ v : Vertex J S R, ∃ L, Follows J S R request (root J S R) L v) ∧ + ∀ v d tail, Follows J S R request v (d :: tail) v → ¬ EdgeWords.NoBacktracking (d :: tail) + +theorem tile_star_tree : IsIndexedTree J S R request := + ⟨connected J S R request, no_closed_reduced_path J S R request⟩ + +theorem reversal_of_not_reduced (L : List (Dart J S R)) (h : ¬ EdgeWords.NoBacktracking L) : + ∃ pre d suffix, L = pre ++ d :: reverse J S R d :: suffix := by + classical + induction L with + | nil => exact False.elim (h True.intro) + | cons d tail ih => + cases tail with + | nil => exact False.elim (h True.intro) + | cons e tail => + by_cases back : e = reverse J S R d + · exact ⟨[], d, tail, by rw [back]; rfl⟩ + · rcases ih (fun ht => h ⟨back, ht⟩) with ⟨pre, x, suffix, eq⟩ + exact ⟨d :: pre, x, suffix, congrArg (List.cons d) eq⟩ + +theorem closed_path_has_reversal (v : Vertex J S R) (d : Dart J S R) (tail) + (path : Follows J S R request v (d :: tail) v) : + ∃ pre e suffix, d :: tail = pre ++ e :: reverse J S R e :: suffix := + reversal_of_not_reduced J S R _ (no_closed_reduced_path J S R request v d tail path) + +theorem requested_tile_tree (Children : R → Type u) : + IsIndexedTree J (Sigma Children) R Sigma.fst := + tile_star_tree J (Sigma Children) R Sigma.fst + +theorem taskSystem_tile_tree {A G Task Label : Type u} {P : MeetOrder A} + (f : TaskSystem P G Task Label) (Requests : Type u) (Children : Requests → Type u) : + @IsIndexedTree G (Sigma Children) Requests (groupOfData f.group) Sigma.fst := by + let : Group G := groupOfData f.group + exact requested_tile_tree G Requests Children + +end CosetGeometry.TileStars + + + +section + +namespace EdgeWords + +universe u +variable {E : Type u} + +theorem reduced_words_injective {L M : List (E × Bool)} + (hL : NoBacktracking L) (hM : NoBacktracking M) + (eq : FreeGroup.mk L = FreeGroup.mk M) : L = M := by + classical + have words := congrArg FreeGroup.toWord eq + simpa only [FreeGroup.toWord_mk, reduce_of_no_backtracking L hL, + reduce_of_no_backtracking M hM] using words + +theorem no_backtracking_append_left (L M : List (E × Bool)) + (h : NoBacktracking (L ++ M)) : NoBacktracking L := by + induction L with + | nil => exact True.intro + | cons d tail ih => + cases tail with + | nil => exact True.intro + | cons e tail => exact ⟨h.1, ih h.2⟩ + +end EdgeWords + +namespace CosetGeometry.TileStars + +universe u +variable (J S R : Type u) [Group J] (request : S → R) + +theorem follows_cons_source {v w : Vertex J S R} {d : Dart J S R} {L} + (path : Follows J S R request v (d :: L) w) : v = source J S R request d := by + cases path + rfl + +theorem follows_tail {v w : Vertex J S R} {d : Dart J S R} {L} + (path : Follows J S R request v (d :: L) w) : + Follows J S R request (target J S R request d) L w := by + cases path with + | cons _ tail => exact tail + +theorem follows_delete_reversal (pre : List (Dart J S R)) (d : Dart J S R) (suffix) + {v w : Vertex J S R} + (path : Follows J S R request v (pre ++ d :: reverse J S R d :: suffix) w) : + Follows J S R request v (pre ++ suffix) w := by + induction pre generalizing v with + | nil => + have start := follows_cons_source J S R request path + have tail := follows_tail J S R request (follows_tail J S R request path) + rw [target_reverse] at tail + rw [start] + exact tail + | cons e pre ih => + have start := follows_cons_source J S R request path + rw [start] + exact Follows.cons e (ih (follows_tail J S R request path)) + +theorem reduced_path {v w : Vertex J S R} (L : List (Dart J S R)) + (path : Follows J S R request v L w) : + ∃ M, Follows J S R request v M w ∧ EdgeWords.NoBacktracking M ∧ M.length ≤ L.length := by + classical + by_cases reduced : EdgeWords.NoBacktracking L + · exact ⟨L, path, reduced, le_refl _⟩ + · rcases reversal_of_not_reduced J S R L reduced with ⟨pre, d, suffix, eq⟩ + have cut : Follows J S R request v (pre ++ suffix) w := by + apply follows_delete_reversal J S R request pre d suffix + rw [← eq] + exact path + rcases reduced_path (pre ++ suffix) cut with ⟨M, mp, mr, bound⟩ + refine ⟨M, mp, mr, le_trans bound ?_⟩ + rw [eq] + simp only [List.length_append, List.length_cons] + omega +termination_by L.length +decreasing_by + rw [eq] + simp only [List.length_append, List.length_cons] + omega + +theorem follows_reverse {v w : Vertex J S R} {L} + (path : Follows J S R request v L w) : + Follows J S R request w (FreeGroup.invRev L) v := by + induction path with + | nil v => exact Follows.nil _ + | @cons d L w tail ih => + rw [FreeGroup.invRev_cons] + apply follows_append J S R request ih + have last := Follows.cons (J := J) (S := S) (R := R) (request := request) + (reverse J S R d) (Follows.nil _) + rw [source_reverse, target_reverse] at last + exact last + +theorem path_words_equal {v w : Vertex J S R} {L M} + (first : Follows J S R request v L w) (second : Follows J S R request v M w) : + FreeGroup.mk L = FreeGroup.mk M := by + have loop := follows_append J S R request first (follows_reverse J S R request second) + have equation := closed_edge_word J S R request v (L ++ FreeGroup.invRev M) loop + rw [← FreeGroup.mul_mk, ← FreeGroup.inv_mk] at equation + exact mul_inv_eq_one.mp equation + +theorem reduced_path_unique {v w : Vertex J S R} {L M} + (first : Follows J S R request v L w) (second : Follows J S R request v M w) + (hL : EdgeWords.NoBacktracking L) (hM : EdgeWords.NoBacktracking M) : L = M := + EdgeWords.reduced_words_injective hL hM (path_words_equal J S R request first second) + +theorem unique_root_path (v : Vertex J S R) : + ∃! L, Follows J S R request (root J S R) L v ∧ EdgeWords.NoBacktracking L := by + rcases connected J S R request v with ⟨L, path⟩ + rcases reduced_path J S R request L path with ⟨M, mp, mr, _⟩ + exact ⟨M, ⟨mp, mr⟩, fun N hN => reduced_path_unique J S R request hN.1 mp hN.2 mr⟩ + +noncomputable def rootPath (v : Vertex J S R) : List (Dart J S R) := + Classical.choose (unique_root_path J S R request v).exists + +theorem rootPath_follows (v : Vertex J S R) : + Follows J S R request (root J S R) (rootPath J S R request v) v := + (Classical.choose_spec (unique_root_path J S R request v).exists).1 + +theorem rootPath_reduced (v : Vertex J S R) : + EdgeWords.NoBacktracking (rootPath J S R request v) := + (Classical.choose_spec (unique_root_path J S R request v).exists).2 + +theorem rootPath_eq {v : Vertex J S R} {L} + (path : Follows J S R request (root J S R) L v) (reduced : EdgeWords.NoBacktracking L) : + rootPath J S R request v = L := + reduced_path_unique J S R request (rootPath_follows J S R request v) path + (rootPath_reduced J S R request v) reduced + +theorem rootPath_root : rootPath J S R request (root J S R) = [] := + rootPath_eq J S R request (Follows.nil _) True.intro + +noncomputable def depth (v : Vertex J S R) : Nat := (rootPath J S R request v).length + +theorem rootPath_shortest {v : Vertex J S R} {L} + (path : Follows J S R request (root J S R) L v) : depth J S R request v ≤ L.length := by + rcases reduced_path J S R request L path with ⟨M, mp, mr, bound⟩ + have eq := rootPath_eq J S R request mp mr + exact (congrArg List.length eq).le.trans bound + +theorem follows_empty_eq {v w : Vertex J S R} {L} + (path : Follows J S R request v L w) (empty : L = []) : v = w := by + induction path with + | nil => rfl + | cons d tail ih => cases empty + +theorem rootPath_empty_iff (v : Vertex J S R) : + rootPath J S R request v = [] ↔ v = root J S R := by + constructor + · intro empty + exact (follows_empty_eq J S R request (rootPath_follows J S R request v) empty).symm + · rintro rfl + exact rootPath_root J S R request + +theorem follows_last (pre : List (Dart J S R)) (d : Dart J S R) {v w : Vertex J S R} + (path : Follows J S R request v (pre ++ [d]) w) : + Follows J S R request v pre (source J S R request d) ∧ target J S R request d = w := by + induction pre generalizing v with + | nil => + have start := follows_cons_source J S R request path + have finish := follows_empty_eq J S R request (follows_tail J S R request path) rfl + rw [start] + exact ⟨Follows.nil _, finish⟩ + | cons e pre ih => + rcases ih (follows_tail J S R request path) with ⟨first, finish⟩ + refine ⟨?_, finish⟩ + rw [follows_cons_source J S R request path] + exact Follows.cons e first + +theorem exists_parent_edge (v : Vertex J S R) (nonroot : v ≠ root J S R) : + ∃ d : Dart J S R, target J S R request d = v ∧ + rootPath J S R request v = rootPath J S R request (source J S R request d) ++ [d] ∧ + depth J S R request v = depth J S R request (source J S R request d) + 1 := by + rcases List.eq_nil_or_concat' (rootPath J S R request v) with empty | ⟨pre, d, eq⟩ + · exact False.elim (nonroot ((rootPath_empty_iff J S R request v).mp empty)) + · have path := rootPath_follows J S R request v + have reduced := rootPath_reduced J S R request v + rw [eq] at path reduced + rcases follows_last J S R request pre d path with ⟨first, finish⟩ + have shorter := rootPath_eq J S R request first + (EdgeWords.no_backtracking_append_left pre [d] reduced) + refine ⟨d, finish, ?_, ?_⟩ + · rw [eq, shorter] + · change (rootPath J S R request v).length = + (rootPath J S R request (source J S R request d)).length + 1 + rw [eq, shorter, List.length_append] + rfl + +end CosetGeometry.TileStars + + + + +open Attachment +universe u v w + +structure IdealEmbedding {A : Type u} {B : Type v} (P : MeetOrder A) (Q : MeetOrder B) + extends MeetEmbedding P Q where + ideal : ∀ a x, Q.le x (toFun a) → ∃ b, toFun b = x + +namespace IdealEmbedding + +variable {A : Type u} {B : Type v} {C : Type w} + {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} + +def identity (P : MeetOrder A) : IdealEmbedding P P where + toMeetEmbedding := (identityIso P).toMeetEmbedding + ideal _ x _ := ⟨x, rfl⟩ + +def comp (f : IdealEmbedding P Q) (g : IdealEmbedding Q R) : IdealEmbedding P R where + toMeetEmbedding := compose f.toMeetEmbedding g.toMeetEmbedding + ideal a x hx := by + rcases g.ideal (f.toFun a) x hx with ⟨b, rfl⟩ + rcases f.ideal a b ((g.le_iff _ _).mp hx) with ⟨c, rfl⟩ + exact ⟨c, rfl⟩ + +def ofOrderMap (f : A → B) (le_iff : ∀ a b, Q.le (f a) (f b) ↔ P.le a b) + (ideal : ∀ a x, Q.le x (f a) → ∃ b, f b = x) : IdealEmbedding P Q where + toFun := f + le_iff := le_iff + ideal := ideal + map_meet a b := by + apply Q.antisymm + · exact Q.le_meet ((le_iff _ _).mpr (P.meet_le_left a b)) + ((le_iff _ _).mpr (P.meet_le_right a b)) + · rcases ideal a (Q.meet (f a) (f b)) (Q.meet_le_left _ _) with ⟨c, eq⟩ + rw [← eq] + apply (le_iff _ _).mpr + apply P.le_meet + · apply (le_iff _ _).mp + rw [eq] + exact Q.meet_le_left _ _ + · apply (le_iff _ _).mp + rw [eq] + exact Q.meet_le_right _ _ + +theorem principal (f : IdealEmbedding P Q) (top : A) (greatest : ∀ a, P.le a top) (x : B) : + Q.le x (f.toFun top) ↔ ∃ a, f.toFun a = x := by + constructor + · exact f.ideal top x + · rintro ⟨a, rfl⟩ + exact (f.le_iff _ _).mpr (greatest a) + +theorem principal_surjective (f : IdealEmbedding P Q) (a : A) + (x : {x : B // Q.le x (f.toFun a)}) : + ∃ y : {y : A // P.le y a}, f.toFun y.val = x.val := by + rcases f.ideal a x.val x.property with ⟨y, eq⟩ + exact ⟨⟨y, (f.le_iff _ _).mp (eq ▸ x.property)⟩, eq⟩ + +noncomputable def principalIso (f : IdealEmbedding P Q) (a : A) : + MeetIso (idealOrder P a) (idealOrder Q (f.toFun a)) where + toFun x := ⟨f.toFun x.val, (f.le_iff _ _).mpr x.property⟩ + le_iff x y := f.le_iff x.val y.val + map_meet x y := Subtype.ext (f.map_meet x.val y.val) + inverse x := Classical.choose (f.principal_surjective a x) + right_inverse x := Subtype.ext (Classical.choose_spec (f.principal_surjective a x)) + left_inverse x := by + apply Subtype.ext + apply embedding_injective f.toMeetEmbedding + exact Classical.choose_spec (f.principal_surjective a _) + +noncomputable def projection (f : IdealEmbedding P Q) (top : A) (x : B) : A := + Classical.choose (f.ideal top (Q.meet x (f.toFun top)) (Q.meet_le_right _ _)) + +theorem projection_spec (f : IdealEmbedding P Q) (top : A) (x : B) : + f.toFun (f.projection top x) = Q.meet x (f.toFun top) := + Classical.choose_spec (f.ideal top (Q.meet x (f.toFun top)) (Q.meet_le_right _ _)) + +theorem greatest_part (f : IdealEmbedding P Q) (top : A) + (greatest : ∀ a, P.le a top) (x : B) (a : A) : + Q.le (f.toFun a) x ↔ P.le a (f.projection top x) := by + rw [← f.le_iff, f.projection_spec] + constructor + · intro h + exact Q.le_meet h ((f.le_iff _ _).mpr (greatest a)) + · intro h + exact Q.trans h (Q.meet_le_left _ _) + +end IdealEmbedding +end + + + +namespace PrincipalBatch + +open Attachment +universe u + +structure Family {A : Type u} (P : MeetOrder A) (I : Type u) where + Space : I → Type u + order : ∀ i, MeetOrder (Space i) + glue : ∀ i, PrincipalAmalgamation.Input P (order i) + +namespace Family + +variable {A I : Type u} {P : MeetOrder A} (b : Family P I) + +def Fresh := (i : I) × (b.glue i).Fresh +def Node := A ⊕ b.Fresh + +def Inside (x y : b.Fresh) : Prop := + ∃ h : x.1 = y.1, (b.order x.1).le x.2.val (h.symm ▸ y.2.val) + +def data : Data P b.Fresh I where + component := Sigma.fst + base i := (b.glue i).leftAnchor + upper _ _ := False + upper_up := by intro _ _ _ h _; exact h + upper_meet := by intro _ _ _ h _; exact h + base_le_upper := by intro _ _ h; exact False.elim h + base_not_upper := by intro _ h; exact h + shadow x := (b.glue x.1).shadow x.2.val + shadow_le_base x := (b.glue x.1).shadow_le_anchor x.2.val + inside := b.Inside + inside_refl x := ⟨rfl, (b.order x.1).refl x.2.val⟩ + inside_trans := by + rintro ⟨i, x⟩ ⟨j, y⟩ ⟨k, z⟩ ⟨hij, hxy⟩ ⟨hjk, hyz⟩ + cases hij + cases hjk + exact ⟨rfl, (b.order i).trans hxy hyz⟩ + inside_antisymm := by + rintro ⟨i, x⟩ ⟨j, y⟩ ⟨hij, hxy⟩ ⟨hji, hyx⟩ + cases hij + cases hji + exact congrArg (Sigma.mk i) (Subtype.ext ((b.order i).antisymm hxy hyx)) + inside_component h := h.choose + inside_shadow := by + rintro ⟨i, x⟩ ⟨j, y⟩ ⟨hij, hxy⟩ + cases hij + exact (b.glue i).shadow_mono hxy + +theorem component_meets : ComponentMeets b.data := by + classical + rintro ⟨i, x⟩ ⟨j, z⟩ same + change i = j at same + cases same + by_cases old : (b.order i).le ((b.order i).meet x.val z.val) (b.glue i).rightAnchor + · apply Or.inr + rintro ⟨k, y⟩ ⟨hki, hyx⟩ ⟨hki', hyz⟩ + cases hki + cases hki' + exact y.property ((b.order i).trans ((b.order i).le_meet hyx hyz) old) + · refine Or.inl ⟨⟨i, ⟨(b.order i).meet x.val z.val, old⟩⟩, + ⟨rfl, (b.order i).meet_le_left _ _⟩, ⟨rfl, (b.order i).meet_le_right _ _⟩, ?_, ?_⟩ + · rintro ⟨k, y⟩ ⟨hki, hyx⟩ ⟨hki', hyz⟩ + cases hki + cases hki' + exact ⟨rfl, (b.order i).le_meet hyx hyz⟩ + · exact (b.glue i).shadow_meet x.val z.val + +noncomputable def extension : MeetOrder b.Node := meetOrder b.data b.component_meets + +noncomputable def old : IdealEmbedding P b.extension where + toMeetEmbedding := oldEmbedding b.data b.component_meets + ideal a x hx := by + cases x with + | inl x => exact ⟨x, rfl⟩ + | inr x => exact False.elim hx + +def componentMap (i : I) : (b.glue i).Node → b.Node + | .inl a => .inl a + | .inr x => .inr ⟨i, x⟩ + +theorem componentMap_le (i : I) (x y : (b.glue i).Node) : + b.extension.le (b.componentMap i x) (b.componentMap i y) ↔ (b.glue i).order.le x y := by + cases x with + | inl a => cases y <;> exact Iff.rfl + | inr x => + cases y with + | inl a => exact Iff.rfl + | inr y => + change (b.Inside ⟨i, x⟩ ⟨i, y⟩ ∨ False) ↔ ((b.order i).le x.val y.val ∨ False) + constructor + · rintro (⟨h, lower⟩ | impossible) + · cases h + exact Or.inl lower + · exact False.elim impossible + · rintro (lower | impossible) + · exact Or.inl ⟨rfl, lower⟩ + · exact False.elim impossible + +theorem componentMap_ideal (i : I) (a : (b.glue i).Node) (x : b.Node) + (lower : b.extension.le x (b.componentMap i a)) : + ∃ y, b.componentMap i y = x := by + cases x with + | inl x => exact ⟨.inl x, rfl⟩ + | inr x => + cases a with + | inl a => exact False.elim lower + | inr a => + rcases lower with h | impossible + · rcases x with ⟨j, x⟩ + rcases h with ⟨eq, _⟩ + cases eq + exact ⟨.inr x, rfl⟩ + · exact False.elim impossible + +noncomputable def component (i : I) : IdealEmbedding (b.glue i).order b.extension := + IdealEmbedding.ofOrderMap (b.componentMap i) (b.componentMap_le i) (b.componentMap_ideal i) + +noncomputable def tile (i : I) : IdealEmbedding (b.order i) b.extension := + IdealEmbedding.comp + { toMeetEmbedding := (b.glue i).right, ideal := (b.glue i).right_ideal } + (b.component i) + +theorem tile_old_overlap (i : I) (x : b.Space i) (a : A) : + (b.tile i).toFun x = b.old.toFun a ↔ + ∃ h : (b.order i).le x (b.glue i).rightAnchor, + ((b.glue i).overlap.toFun ⟨x, h⟩).val = a := by + change b.componentMap i ((b.glue i).right.toFun x) = b.componentMap i (.inl a) ↔ _ + exact (Iff.intro (fun h => embedding_injective (b.component i).toMeetEmbedding h) + (congrArg (b.componentMap i))).trans ((b.glue i).overlap_exact a x) + +theorem cover (x : b.Node) : + (∃ a, b.old.toFun a = x) ∨ ∃ i y, (b.tile i).toFun y = x := by + cases x with + | inl a => exact Or.inl ⟨a, rfl⟩ + | inr x => + refine Or.inr ⟨x.1, x.2.val, ?_⟩ + exact congrArg (b.componentMap x.1) ((b.glue x.1).represent_new x.2.val x.2.property) + +theorem fresh_old_meet (x : b.Fresh) (a : A) : + b.extension.meet (.inr x) (b.old.toFun a) = + b.old.toFun (P.meet ((b.glue x.1).shadow x.2.val) a) := + meet_eq b.data b.component_meets (Attachment.shadow_meet b.data x a (fun h => h)) + +theorem fresh_greatest_old_part (x : b.Fresh) (a : A) : + b.extension.le (b.old.toFun a) (.inr x) ↔ P.le a ((b.glue x.1).shadow x.2.val) := Iff.rfl + +theorem different_fresh_incomparable (x y : b.Fresh) (different : x.1 ≠ y.1) : + ¬ b.extension.le (.inr x) (.inr y) := by + intro lower + rcases lower with ⟨same, _⟩ | impossible + · exact different same + · exact impossible + +theorem old_vertex_preserved {V : Type u} {Q : MeetOrder V} (f : IdealEmbedding Q P) : + ∃ e : IdealEmbedding Q b.extension, ∀ x, e.toFun x = b.old.toFun (f.toFun x) := + ⟨f.comp b.old, fun _ => rfl⟩ + +theorem tile_vertex_preserved (i : I) {V : Type u} {Q : MeetOrder V} + (f : IdealEmbedding Q (b.order i)) : + ∃ e : IdealEmbedding Q b.extension, ∀ x, e.toFun x = (b.tile i).toFun (f.toFun x) := + ⟨f.comp (b.tile i), fun _ => rfl⟩ + +end Family +end PrincipalBatch + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalHeightDescent.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalHeightDescent.lean index f96d9b41536f0a7e1f35ebca134ad7e11d0ff050..d5bdab580e362c6d7a98fb3cbb077db4bbfda4db 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalHeightDescent.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalHeightDescent.lean @@ -1,103 +1,103 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.ChronologicalTheorem - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.Chronological - -open RationalHeights - -universe u v - -def columnOrder (Column : Type v) [LinearOrder Column] : LinearHeightOrder Column where - lt := (· < ·) - irrefl := lt_irrefl - trans := lt_trans - compare := lt_trichotomy - -theorem rational_decreasing_countable {Index : Type u} {Column : Type v} - [LinearOrder Index] [WellFoundedLT Index] [LinearOrder Column] [WellFoundedLT Column] - (value : Index → Column × Rational) - (decreasing : ∀ i j, i < j → (lexOrder (columnOrder Column)).lt (value j) (value i)) : - Countable Index := by - classical - have injective : Function.Injective value := by - intro i j eq - rcases lt_trichotomy i j with h | h | h - · have impossible := decreasing i j h - rw [eq] at impossible - exact False.elim ((lexOrder (columnOrder Column)).irrefl _ impossible) - · exact h - · have impossible := decreasing j i h - rw [eq] at impossible - exact False.elim ((lexOrder (columnOrder Column)).irrefl _ impossible) - have columns : ∀ i j, i ≤ j → (value j).1 ≤ (value i).1 := by - intro i j lower - rcases lt_or_eq_of_le lower with less | rfl - · rcases decreasing i j less with h | ⟨h, _⟩ - · exact le_of_lt h - · exact le_of_eq h - · exact le_refl _ - have fiber : ∀ c : Column, Set.Countable {i : Index | (value i).1 = c} := by - intro c - apply Function.Injective.countable - (f := fun i : {i : Index // (value i).1 = c} => Rational.code (value i.val).2) - intro i j eq - apply Subtype.ext - apply injective - exact Prod.ext (i.property.trans j.property.symm) (Rational.code_injective _ _ eq) - have wf : WellFounded ((· < ·) : Column → Column → Prop) := wellFounded_lt - have tails : ∀ c : Column, ∀ i : Index, (value i).1 = c → Set.Countable {j | i ≤ j} := by - intro c - induction c using wf.induction with - | h c ih => - intro i eq - let lower : Set Index := {j | i ≤ j ∧ (value j).1 < c} - by_cases nonempty : lower.Nonempty - · have iwf : WellFounded ((· < ·) : Index → Index → Prop) := wellFounded_lt - rcases iwf.has_min lower nonempty with ⟨j, hj, minimal⟩ - have rest : Set.Countable {k | j ≤ k} := ih (value j).1 hj.2 j rfl - apply ((fiber c).union rest).mono - intro k hk - by_cases column : (value k).1 = c - · exact Or.inl column - · right - have upper : (value k).1 ≤ c := eq ▸ columns i k hk - have less : (value k).1 < c := lt_of_le_of_ne upper column - exact le_of_not_gt (minimal k ⟨hk, less⟩) - · apply (fiber c).mono - intro j hj - have upper : (value j).1 ≤ c := eq ▸ columns i j hj - show (value j).1 = c - apply Classical.byContradiction - intro different - exact nonempty ⟨j, hj, lt_of_le_of_ne upper different⟩ - by_cases nonempty : (Set.univ : Set Index).Nonempty - · have iwf : WellFounded ((· < ·) : Index → Index → Prop) := wellFounded_lt - rcases iwf.has_min Set.univ nonempty with ⟨i, _, minimal⟩ - apply Set.countable_univ_iff.mp - apply (tails (value i).1 i rfl).mono - intro j _ - exact le_of_not_gt (minimal j (Set.mem_univ j)) - · apply Set.countable_univ_iff.mp - rw [Set.not_nonempty_iff_eq_empty.mp nonempty] - exact Set.countable_empty - -theorem rational_descending_property {Stage : Type u} {Column : Type v} - [LinearOrder Stage] [WellFoundedLT Stage] [LinearOrder Column] [WellFoundedLT Column] : - DescendingCountable (Stage := Stage) (lexOrder (columnOrder Column)).toHeightOrder := by - intro S value decreasing - exact rational_decreasing_countable value decreasing - -theorem History.rational_all_filters_countable {Stage : Type u} {Column : Type v} - [LinearOrder Stage] [WellFoundedLT Stage] [LinearOrder Column] [WellFoundedLT Column] - (history : History Stage (lexOrder (columnOrder Column)).toHeightOrder) : - ∀ cutoff, AllFiltersCountable (history.order cutoff) := - history.all_filters_countable rational_descending_property - -end PartitionPilot.Compression.RecursiveMaps.Chronological - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.ChronologicalTheorem + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.Chronological + +open RationalHeights + +universe u v + +def columnOrder (Column : Type v) [LinearOrder Column] : LinearHeightOrder Column where + lt := (· < ·) + irrefl := lt_irrefl + trans := lt_trans + compare := lt_trichotomy + +theorem rational_decreasing_countable {Index : Type u} {Column : Type v} + [LinearOrder Index] [WellFoundedLT Index] [LinearOrder Column] [WellFoundedLT Column] + (value : Index → Column × Rational) + (decreasing : ∀ i j, i < j → (lexOrder (columnOrder Column)).lt (value j) (value i)) : + Countable Index := by + classical + have injective : Function.Injective value := by + intro i j eq + rcases lt_trichotomy i j with h | h | h + · have impossible := decreasing i j h + rw [eq] at impossible + exact False.elim ((lexOrder (columnOrder Column)).irrefl _ impossible) + · exact h + · have impossible := decreasing j i h + rw [eq] at impossible + exact False.elim ((lexOrder (columnOrder Column)).irrefl _ impossible) + have columns : ∀ i j, i ≤ j → (value j).1 ≤ (value i).1 := by + intro i j lower + rcases lt_or_eq_of_le lower with less | rfl + · rcases decreasing i j less with h | ⟨h, _⟩ + · exact le_of_lt h + · exact le_of_eq h + · exact le_refl _ + have fiber : ∀ c : Column, Set.Countable {i : Index | (value i).1 = c} := by + intro c + apply Function.Injective.countable + (f := fun i : {i : Index // (value i).1 = c} => Rational.code (value i.val).2) + intro i j eq + apply Subtype.ext + apply injective + exact Prod.ext (i.property.trans j.property.symm) (Rational.code_injective _ _ eq) + have wf : WellFounded ((· < ·) : Column → Column → Prop) := wellFounded_lt + have tails : ∀ c : Column, ∀ i : Index, (value i).1 = c → Set.Countable {j | i ≤ j} := by + intro c + induction c using wf.induction with + | h c ih => + intro i eq + let lower : Set Index := {j | i ≤ j ∧ (value j).1 < c} + by_cases nonempty : lower.Nonempty + · have iwf : WellFounded ((· < ·) : Index → Index → Prop) := wellFounded_lt + rcases iwf.has_min lower nonempty with ⟨j, hj, minimal⟩ + have rest : Set.Countable {k | j ≤ k} := ih (value j).1 hj.2 j rfl + apply ((fiber c).union rest).mono + intro k hk + by_cases column : (value k).1 = c + · exact Or.inl column + · right + have upper : (value k).1 ≤ c := eq ▸ columns i k hk + have less : (value k).1 < c := lt_of_le_of_ne upper column + exact le_of_not_gt (minimal k ⟨hk, less⟩) + · apply (fiber c).mono + intro j hj + have upper : (value j).1 ≤ c := eq ▸ columns i j hj + show (value j).1 = c + apply Classical.byContradiction + intro different + exact nonempty ⟨j, hj, lt_of_le_of_ne upper different⟩ + by_cases nonempty : (Set.univ : Set Index).Nonempty + · have iwf : WellFounded ((· < ·) : Index → Index → Prop) := wellFounded_lt + rcases iwf.has_min Set.univ nonempty with ⟨i, _, minimal⟩ + apply Set.countable_univ_iff.mp + apply (tails (value i).1 i rfl).mono + intro j _ + exact le_of_not_gt (minimal j (Set.mem_univ j)) + · apply Set.countable_univ_iff.mp + rw [Set.not_nonempty_iff_eq_empty.mp nonempty] + exact Set.countable_empty + +theorem rational_descending_property {Stage : Type u} {Column : Type v} + [LinearOrder Stage] [WellFoundedLT Stage] [LinearOrder Column] [WellFoundedLT Column] : + DescendingCountable (Stage := Stage) (lexOrder (columnOrder Column)).toHeightOrder := by + intro S value decreasing + exact rational_decreasing_countable value decreasing + +theorem History.rational_all_filters_countable {Stage : Type u} {Column : Type v} + [LinearOrder Stage] [WellFoundedLT Stage] [LinearOrder Column] [WellFoundedLT Column] + (history : History Stage (lexOrder (columnOrder Column)).toHeightOrder) : + ∀ cutoff, AllFiltersCountable (history.order cutoff) := + history.all_filters_countable rational_descending_property + +end PartitionPilot.Compression.RecursiveMaps.Chronological + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalOrderBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalOrderBounds.lean index ad76eadf57bd4bf827e09cea76b71317a878e125..473f69d330e42693e97cfc9819d8ab5f77153bbc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalOrderBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RationalOrderBounds.lean @@ -1,209 +1,209 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.DenseInterpolation - -namespace OAI - -namespace PartitionPilot.Compression.RecursiveMaps.RationalHeights - -structure Fraction where - num : Int - den : Nat - positive : 0 < den - -namespace Fraction - -def Lt (a b : Fraction) : Prop := a.num * (b.den : Int) < b.num * (a.den : Int) -def Equiv (a b : Fraction) : Prop := a.num * (b.den : Int) = b.num * (a.den : Int) - -theorem den_pos (a : Fraction) : 0 < (a.den : Int) := Int.natCast_pos.mpr a.positive - -theorem cancel_lt {a b c : Int} (pos : 0 < c) (h : a * c < b * c) : a < b := by - apply Classical.byContradiction - intro hn - have ba : b ≤ a := by omega - have hc : 0 ≤ c := by omega - have hb := Int.mul_le_mul_of_nonneg_right ba hc - omega - -theorem equiv_trans {a b c : Fraction} (ab : Equiv a b) (bc : Equiv b c) : Equiv a c := by - apply Int.eq_of_mul_eq_mul_right (a := (b.den : Int)) (by have := b.den_pos; omega) - change (a.num * (c.den : Int)) * b.den = (c.num * (a.den : Int)) * b.den - calc - _ = (a.num * (b.den : Int)) * c.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - _ = (b.num * (a.den : Int)) * c.den := congrArg (fun x => x * (c.den : Int)) ab - _ = (b.num * (c.den : Int)) * a.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - _ = (c.num * (b.den : Int)) * a.den := congrArg (fun x => x * (a.den : Int)) bc - _ = _ := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - -theorem lt_trans {a b c : Fraction} (ab : Lt a b) (bc : Lt b c) : Lt a c := by - apply cancel_lt b.den_pos - have h₁ := Int.mul_lt_mul_of_pos_right ab c.den_pos - have h₂ := Int.mul_lt_mul_of_pos_right bc a.den_pos - have eq : (b.num * (a.den : Int)) * c.den = (b.num * (c.den : Int)) * a.den := by - simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - rw [eq] at h₁ - have h := Int.lt_trans h₁ h₂ - simpa only [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] using h - -theorem lt_left {a b c : Fraction} (eq : Equiv a b) (h : Lt a c) : Lt b c := by - have scaled := Int.mul_lt_mul_of_pos_right h b.den_pos - have lhs : (a.num * (c.den : Int)) * b.den = (b.num * (c.den : Int)) * a.den := by - calc - _ = (a.num * (b.den : Int)) * c.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - _ = (b.num * (a.den : Int)) * c.den := congrArg (fun x => x * (c.den : Int)) eq - _ = _ := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - have rhs : (c.num * (a.den : Int)) * b.den = (c.num * (b.den : Int)) * a.den := by - simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - rw [lhs, rhs] at scaled - exact cancel_lt a.den_pos scaled - -theorem lt_right {a b c : Fraction} (eq : Equiv b c) (h : Lt a b) : Lt a c := by - have scaled := Int.mul_lt_mul_of_pos_right h c.den_pos - have lhs : (a.num * (b.den : Int)) * c.den = (a.num * (c.den : Int)) * b.den := by - simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - have rhs : (b.num * (a.den : Int)) * c.den = (c.num * (a.den : Int)) * b.den := by - calc - _ = (b.num * (c.den : Int)) * a.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - _ = (c.num * (b.den : Int)) * a.den := congrArg (fun x => x * (a.den : Int)) eq - _ = _ := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] - rw [lhs, rhs] at scaled - exact cancel_lt b.den_pos scaled - -def setoid : Setoid Fraction where - r := Equiv - iseqv := ⟨fun _ => rfl, fun h => h.symm, fun h h' => equiv_trans h h'⟩ - -def mediant (a b : Fraction) : Fraction := - ⟨a.num + b.num, a.den + b.den, by have := a.positive; omega⟩ - -theorem mediant_between (a b : Fraction) (h : Lt a b) : - Lt a (mediant a b) ∧ Lt (mediant a b) b := by - change a.num * (b.den : Int) < b.num * (a.den : Int) at h - constructor - · change a.num * ((a.den + b.den : Nat) : Int) < (a.num + b.num) * (a.den : Int) - rw [Int.natCast_add, Int.mul_add, Int.add_mul] - omega - · change (a.num + b.num) * (b.den : Int) < b.num * ((a.den + b.den : Nat) : Int) - rw [Int.natCast_add, Int.mul_add, Int.add_mul] - omega - -def above (a : Fraction) : Fraction := ⟨a.num + a.den, a.den, a.positive⟩ - -theorem lt_above (a : Fraction) : Lt a (above a) := by - have pos := Int.mul_pos a.den_pos a.den_pos - change a.num * (a.den : Int) < (a.num + (a.den : Int)) * a.den - rw [Int.add_mul] - omega - -def intCode : Int → Nat - | .ofNat n => 2 * n - | .negSucc n => 2 * n + 1 - -theorem intCode_injective (a b : Int) (h : intCode a = intCode b) : a = b := by - cases a <;> cases b <;> simp only [intCode] at h <;> congr 1 <;> omega - -def code (a : Fraction) : Nat := natPair (intCode a.num) a.den - -theorem code_injective (a b : Fraction) (h : code a = code b) : a = b := by - have parts := natPair_injective h - have hn := intCode_injective a.num b.num parts.1 - rcases a with ⟨an, ad, ha⟩ - rcases b with ⟨bn, bd, hb⟩ - dsimp at hn - have hd : ad = bd := parts.2 - cases hn - cases hd - rfl - -end Fraction - -def Rational := Quotient Fraction.setoid - -namespace Rational - -def mk (a : Fraction) : Rational := Quotient.mk Fraction.setoid a - -def lt : Rational → Rational → Prop := - Quotient.lift₂ Fraction.Lt (fun _ _ _ _ ha hb => - propext ⟨fun h => Fraction.lt_right hb (Fraction.lt_left ha h), - fun h => Fraction.lt_right hb.symm (Fraction.lt_left ha.symm h)⟩) - -theorem irrefl (a : Rational) : ¬ lt a a := by - induction a using Quotient.ind with - | _ a => exact Int.lt_irrefl _ - -theorem trans {a b c : Rational} (h : lt a b) (h' : lt b c) : lt a c := by - induction a, b, c using Quotient.inductionOn₃ with - | _ a b c => exact Fraction.lt_trans h h' - -theorem compare (a b : Rational) : lt a b ∨ a = b ∨ lt b a := by - induction a, b using Quotient.inductionOn₂ with - | _ a b => - have h : a.num * (b.den : Int) < b.num * (a.den : Int) ∨ - a.num * (b.den : Int) = b.num * (a.den : Int) ∨ - b.num * (a.den : Int) < a.num * (b.den : Int) := by omega - rcases h with h | h | h - · exact Or.inl h - · exact Or.inr (Or.inl (Quotient.sound h)) - · exact Or.inr (Or.inr h) - -theorem between (a b : Rational) (h : lt a b) : ∃ c, lt a c ∧ lt c b := by - induction a, b using Quotient.inductionOn₂ with - | _ a b => exact ⟨mk (a.mediant b), Fraction.mediant_between a b h⟩ - -theorem unbounded_above (a : Rational) : ∃ b, lt a b := by - induction a using Quotient.ind with - | _ a => exact ⟨mk a.above, a.lt_above⟩ - -def order : DenseHeightOrder Rational where - lt := lt - irrefl := irrefl - trans := trans - compare := compare - between := between - -noncomputable def representative (a : Rational) : Fraction := - Classical.choose (Quotient.exists_rep a) - -theorem representative_eq (a : Rational) : mk (representative a) = a := - Classical.choose_spec (Quotient.exists_rep a) - -noncomputable def code (a : Rational) : Nat := (representative a).code - -theorem code_injective (a b : Rational) (h : code a = code b) : a = b := by - have eq := Fraction.code_injective (representative a) (representative b) h - exact (representative_eq a).symm.trans ((congrArg mk eq).trans (representative_eq b)) - -end Rational - -namespace Fraction - -def below (a : Fraction) : Fraction := ⟨a.num - a.den, a.den, a.positive⟩ - -theorem below_lt (a : Fraction) : Lt (below a) a := by - have positive := Int.mul_pos a.den_pos a.den_pos - change (a.num - (a.den : Int)) * a.den < a.num * (a.den : Int) - rw [Int.sub_mul] - omega - -end Fraction - -namespace Rational - -theorem mk_eq_iff (a b : Fraction) : mk a = mk b ↔ Fraction.Equiv a b := by - exact ⟨fun h => Quotient.exact h, fun h => @Quotient.sound Fraction Fraction.setoid a b h⟩ - -theorem mk_lt_iff (a b : Fraction) : lt (mk a) (mk b) ↔ Fraction.Lt a b := Iff.rfl - -theorem unbounded_below (a : Rational) : ∃ b, lt b a := by - induction a using Quotient.ind with - | _ a => exact ⟨mk a.below, a.below_lt⟩ - -theorem representative_equiv (a : Fraction) : - Fraction.Equiv (representative (mk a)) a := - (mk_eq_iff _ _).1 (representative_eq (mk a)) - -end Rational - -end PartitionPilot.Compression.RecursiveMaps.RationalHeights - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.DenseInterpolation + +namespace OAI + +namespace PartitionPilot.Compression.RecursiveMaps.RationalHeights + +structure Fraction where + num : Int + den : Nat + positive : 0 < den + +namespace Fraction + +def Lt (a b : Fraction) : Prop := a.num * (b.den : Int) < b.num * (a.den : Int) +def Equiv (a b : Fraction) : Prop := a.num * (b.den : Int) = b.num * (a.den : Int) + +theorem den_pos (a : Fraction) : 0 < (a.den : Int) := Int.natCast_pos.mpr a.positive + +theorem cancel_lt {a b c : Int} (pos : 0 < c) (h : a * c < b * c) : a < b := by + apply Classical.byContradiction + intro hn + have ba : b ≤ a := by omega + have hc : 0 ≤ c := by omega + have hb := Int.mul_le_mul_of_nonneg_right ba hc + omega + +theorem equiv_trans {a b c : Fraction} (ab : Equiv a b) (bc : Equiv b c) : Equiv a c := by + apply Int.eq_of_mul_eq_mul_right (a := (b.den : Int)) (by have := b.den_pos; omega) + change (a.num * (c.den : Int)) * b.den = (c.num * (a.den : Int)) * b.den + calc + _ = (a.num * (b.den : Int)) * c.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + _ = (b.num * (a.den : Int)) * c.den := congrArg (fun x => x * (c.den : Int)) ab + _ = (b.num * (c.den : Int)) * a.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + _ = (c.num * (b.den : Int)) * a.den := congrArg (fun x => x * (a.den : Int)) bc + _ = _ := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + +theorem lt_trans {a b c : Fraction} (ab : Lt a b) (bc : Lt b c) : Lt a c := by + apply cancel_lt b.den_pos + have h₁ := Int.mul_lt_mul_of_pos_right ab c.den_pos + have h₂ := Int.mul_lt_mul_of_pos_right bc a.den_pos + have eq : (b.num * (a.den : Int)) * c.den = (b.num * (c.den : Int)) * a.den := by + simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + rw [eq] at h₁ + have h := Int.lt_trans h₁ h₂ + simpa only [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] using h + +theorem lt_left {a b c : Fraction} (eq : Equiv a b) (h : Lt a c) : Lt b c := by + have scaled := Int.mul_lt_mul_of_pos_right h b.den_pos + have lhs : (a.num * (c.den : Int)) * b.den = (b.num * (c.den : Int)) * a.den := by + calc + _ = (a.num * (b.den : Int)) * c.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + _ = (b.num * (a.den : Int)) * c.den := congrArg (fun x => x * (c.den : Int)) eq + _ = _ := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + have rhs : (c.num * (a.den : Int)) * b.den = (c.num * (b.den : Int)) * a.den := by + simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + rw [lhs, rhs] at scaled + exact cancel_lt a.den_pos scaled + +theorem lt_right {a b c : Fraction} (eq : Equiv b c) (h : Lt a b) : Lt a c := by + have scaled := Int.mul_lt_mul_of_pos_right h c.den_pos + have lhs : (a.num * (b.den : Int)) * c.den = (a.num * (c.den : Int)) * b.den := by + simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + have rhs : (b.num * (a.den : Int)) * c.den = (c.num * (a.den : Int)) * b.den := by + calc + _ = (b.num * (c.den : Int)) * a.den := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + _ = (c.num * (b.den : Int)) * a.den := congrArg (fun x => x * (a.den : Int)) eq + _ = _ := by simp [Int.mul_assoc, Int.mul_comm, Int.mul_left_comm] + rw [lhs, rhs] at scaled + exact cancel_lt b.den_pos scaled + +def setoid : Setoid Fraction where + r := Equiv + iseqv := ⟨fun _ => rfl, fun h => h.symm, fun h h' => equiv_trans h h'⟩ + +def mediant (a b : Fraction) : Fraction := + ⟨a.num + b.num, a.den + b.den, by have := a.positive; omega⟩ + +theorem mediant_between (a b : Fraction) (h : Lt a b) : + Lt a (mediant a b) ∧ Lt (mediant a b) b := by + change a.num * (b.den : Int) < b.num * (a.den : Int) at h + constructor + · change a.num * ((a.den + b.den : Nat) : Int) < (a.num + b.num) * (a.den : Int) + rw [Int.natCast_add, Int.mul_add, Int.add_mul] + omega + · change (a.num + b.num) * (b.den : Int) < b.num * ((a.den + b.den : Nat) : Int) + rw [Int.natCast_add, Int.mul_add, Int.add_mul] + omega + +def above (a : Fraction) : Fraction := ⟨a.num + a.den, a.den, a.positive⟩ + +theorem lt_above (a : Fraction) : Lt a (above a) := by + have pos := Int.mul_pos a.den_pos a.den_pos + change a.num * (a.den : Int) < (a.num + (a.den : Int)) * a.den + rw [Int.add_mul] + omega + +def intCode : Int → Nat + | .ofNat n => 2 * n + | .negSucc n => 2 * n + 1 + +theorem intCode_injective (a b : Int) (h : intCode a = intCode b) : a = b := by + cases a <;> cases b <;> simp only [intCode] at h <;> congr 1 <;> omega + +def code (a : Fraction) : Nat := natPair (intCode a.num) a.den + +theorem code_injective (a b : Fraction) (h : code a = code b) : a = b := by + have parts := natPair_injective h + have hn := intCode_injective a.num b.num parts.1 + rcases a with ⟨an, ad, ha⟩ + rcases b with ⟨bn, bd, hb⟩ + dsimp at hn + have hd : ad = bd := parts.2 + cases hn + cases hd + rfl + +end Fraction + +def Rational := Quotient Fraction.setoid + +namespace Rational + +def mk (a : Fraction) : Rational := Quotient.mk Fraction.setoid a + +def lt : Rational → Rational → Prop := + Quotient.lift₂ Fraction.Lt (fun _ _ _ _ ha hb => + propext ⟨fun h => Fraction.lt_right hb (Fraction.lt_left ha h), + fun h => Fraction.lt_right hb.symm (Fraction.lt_left ha.symm h)⟩) + +theorem irrefl (a : Rational) : ¬ lt a a := by + induction a using Quotient.ind with + | _ a => exact Int.lt_irrefl _ + +theorem trans {a b c : Rational} (h : lt a b) (h' : lt b c) : lt a c := by + induction a, b, c using Quotient.inductionOn₃ with + | _ a b c => exact Fraction.lt_trans h h' + +theorem compare (a b : Rational) : lt a b ∨ a = b ∨ lt b a := by + induction a, b using Quotient.inductionOn₂ with + | _ a b => + have h : a.num * (b.den : Int) < b.num * (a.den : Int) ∨ + a.num * (b.den : Int) = b.num * (a.den : Int) ∨ + b.num * (a.den : Int) < a.num * (b.den : Int) := by omega + rcases h with h | h | h + · exact Or.inl h + · exact Or.inr (Or.inl (Quotient.sound h)) + · exact Or.inr (Or.inr h) + +theorem between (a b : Rational) (h : lt a b) : ∃ c, lt a c ∧ lt c b := by + induction a, b using Quotient.inductionOn₂ with + | _ a b => exact ⟨mk (a.mediant b), Fraction.mediant_between a b h⟩ + +theorem unbounded_above (a : Rational) : ∃ b, lt a b := by + induction a using Quotient.ind with + | _ a => exact ⟨mk a.above, a.lt_above⟩ + +def order : DenseHeightOrder Rational where + lt := lt + irrefl := irrefl + trans := trans + compare := compare + between := between + +noncomputable def representative (a : Rational) : Fraction := + Classical.choose (Quotient.exists_rep a) + +theorem representative_eq (a : Rational) : mk (representative a) = a := + Classical.choose_spec (Quotient.exists_rep a) + +noncomputable def code (a : Rational) : Nat := (representative a).code + +theorem code_injective (a b : Rational) (h : code a = code b) : a = b := by + have eq := Fraction.code_injective (representative a) (representative b) h + exact (representative_eq a).symm.trans ((congrArg mk eq).trans (representative_eq b)) + +end Rational + +namespace Fraction + +def below (a : Fraction) : Fraction := ⟨a.num - a.den, a.den, a.positive⟩ + +theorem below_lt (a : Fraction) : Lt (below a) a := by + have positive := Int.mul_pos a.den_pos a.den_pos + change (a.num - (a.den : Int)) * a.den < a.num * (a.den : Int) + rw [Int.sub_mul] + omega + +end Fraction + +namespace Rational + +theorem mk_eq_iff (a b : Fraction) : mk a = mk b ↔ Fraction.Equiv a b := by + exact ⟨fun h => Quotient.exact h, fun h => @Quotient.sound Fraction Fraction.setoid a b h⟩ + +theorem mk_lt_iff (a b : Fraction) : lt (mk a) (mk b) ↔ Fraction.Lt a b := Iff.rfl + +theorem unbounded_below (a : Rational) : ∃ b, lt b a := by + induction a using Quotient.ind with + | _ a => exact ⟨mk a.below, a.below_lt⟩ + +theorem representative_equiv (a : Fraction) : + Fraction.Equiv (representative (mk a)) a := + (mk_eq_iff _ _).1 (representative_eq (mk a)) + +end Rational + +end PartitionPilot.Compression.RecursiveMaps.RationalHeights + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RawEqualitySteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RawEqualitySteps.lean index 97814a6da851e01cd690df9af47bdc3f85924be3..f20e63c60473dc819df17a48b354fc42eff99a21 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RawEqualitySteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RawEqualitySteps.lean @@ -1,156 +1,156 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedEqualityRelations - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -def RawRelationMeaning {k : Nat} (R : P → ZFSet.{u} → ZFSet.{u} → Prop) - (E : SetFormula (k + 3)) (constants : Fin k → ZFSet.{u}) : Prop := - ∀ p x, x ∈ M.sets → ∀ y, y ∈ M.sets → - (Realize M.sets E (extend (s.encode p) (extend x (extend y constants))) ↔ R p x y) - -def RawMembership (R : P → ZFSet.{u} → ZFSet.{u} → Prop) (p : P) (x y : ZFSet.{u}) : Prop := - ∀ q, q ≤ p → ∃ t, t ≤ q ∧ ∃ v ∈ M.sets, ∃ r, - ZFSet.pair v (s.encode r) ∈ y ∧ t ≤ r ∧ R t x v - -def RawMatching (R : P → ZFSet.{u} → ZFSet.{u} → Prop) (p : P) (x y : ZFSet.{u}) : Prop := - ∀ v ∈ M.sets, ∀ r, ZFSet.pair v (s.encode r) ∈ x → - ∀ q, q ≤ p → q ≤ r → M.RawMembership s R q v y - -def RawEqualityStep (R : P → ZFSet.{u} → ZFSet.{u} → Prop) - (p : P) (x y : ZFSet.{u}) : Prop := - M.RawMatching s R p x y ∧ M.RawMatching s (fun t v w => R t w v) p y x - -theorem rawEqualityStep_mono {R S : P → ZFSet.{u} → ZFSet.{u} → Prop} - (mono : ∀ p x y, R p x y → S p x y) {p : P} {x y : ZFSet.{u}} - (h : M.RawEqualityStep s R p x y) : M.RawEqualityStep s S p x y := by - constructor - · intro v hv r entry q qp qr t tq - obtain ⟨a, hat, w, hw, b, eb, ab, rel⟩ := h.1 v hv r entry q qp qr t tq - exact ⟨a, hat, w, hw, b, eb, ab, mono a v w rel⟩ - · intro v hv r entry q qp qr t tq - obtain ⟨a, hat, w, hw, b, eb, ab, rel⟩ := h.2 v hv r entry q qp qr t tq - exact ⟨a, hat, w, hw, b, eb, ab, mono a w v rel⟩ - -theorem realize_rawMembership (R : P → ZFSet.{u} → ZFSet.{u} → Prop) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) - (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (meaning : M.RawRelationMeaning s R E (fun j => env (params j))) - (p : P) (hp : env pi = s.encode p) (hσ : env si ∈ M.sets) (hτ : env ti ∈ M.sets) : - Realize M.sets (membershipFormula E c o params pi si ti) env ↔ - M.RawMembership s R p (env si) (env ti) := by - rw [membershipFormula, M.realize_allConditions s _ _ env carrier hc] - change (∀ q : P, Realize M.sets _ (extend (s.encode q) env)) ↔ _ - apply forall_congr' - intro q - rw [realize_imp, M.realize_conditionLE s pairing carrier order 0 pi.succ (params o).succ - (extend (s.encode q) env) q p rfl hp ho] - apply forall_congr' - intro _ - rw [M.realize_exConditions s (params c).succ _ (extend (s.encode q) env) carrier hc] - constructor - · rintro ⟨t, ht⟩ - obtain ⟨v, hv, rest⟩ := (realize_ex M.sets _ _).1 ht - obtain ⟨r, entry, tq, tr, rel⟩ := (M.realize_exConditions s (params c).succ.succ.succ _ - (extend v (extend (s.encode t) (extend (s.encode q) env))) carrier hc).1 rest - let e := extend (s.encode r) (extend v (extend (s.encode t) (extend (s.encode q) env))) - have lookup := (realize_atomicApplication M.sets E - (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).1 rel - exact ⟨t, (M.realize_conditionLE s pairing carrier order 2 3 - (params o).succ.succ.succ.succ e t q rfl rfl ho).1 tq, - v, hv, r, - (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e - hv (M.transitive carrier (s.encode_mem r)) hτ).1 entry, - (M.realize_conditionLE s pairing carrier order 2 0 - (params o).succ.succ.succ.succ e t r rfl rfl ho).1 tr, - (meaning t (env si) hσ v hv).1 lookup⟩ - · rintro ⟨t, tq, v, hv, r, entry, tr, rel⟩ - refine ⟨t, ?_⟩ - rw [realize_ex] - refine ⟨v, hv, ?_⟩ - apply (M.realize_exConditions s (params c).succ.succ.succ _ - (extend v (extend (s.encode t) (extend (s.encode q) env))) carrier hc).2 - let e := extend (s.encode r) (extend v (extend (s.encode t) (extend (s.encode q) env))) - refine ⟨r, ?_, ?_, ?_, ?_⟩ - · exact (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e - hv (M.transitive carrier (s.encode_mem r)) hτ).2 entry - · exact (M.realize_conditionLE s pairing carrier order 2 3 - (params o).succ.succ.succ.succ e t q rfl rfl ho).2 tq - · exact (M.realize_conditionLE s pairing carrier order 2 0 - (params o).succ.succ.succ.succ e t r rfl rfl ho).2 tr - · exact (realize_atomicApplication M.sets E - (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).2 - ((meaning t (env si) hσ v hv).2 rel) - -theorem realize_rawMatching (R : P → ZFSet.{u} → ZFSet.{u} → Prop) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) - (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (meaning : M.RawRelationMeaning s R E (fun j => env (params j))) - (p : P) (hp : env pi = s.encode p) (hσ : env si ∈ M.sets) (hτ : env ti ∈ M.sets) : - Realize M.sets (matchingDirectionFormula E c o params pi si ti) env ↔ - M.RawMatching s R p (env si) (env ti) := by - change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ - apply forall_congr' - intro v - apply forall_congr' - intro hv - rw [M.realize_allConditions s (params c).succ _ (extend v env) carrier hc] - apply forall_congr' - intro r - rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 si.succ.succ - (extend (s.encode r) (extend v env)) hv (M.transitive carrier (s.encode_mem r)) hσ] - apply forall_congr' - intro _ - rw [M.realize_allConditions s (params c).succ.succ _ - (extend (s.encode r) (extend v env)) carrier hc] - apply forall_congr' - intro q - let e := extend (s.encode q) (extend (s.encode r) (extend v env)) - rw [realize_imp] - change (Realize M.sets _ e ∧ Realize M.sets _ e → Realize M.sets _ e) ↔ _ - rw [M.realize_conditionLE s pairing carrier order 0 pi.succ.succ.succ - (params o).succ.succ.succ e q p rfl hp ho, - M.realize_conditionLE s pairing carrier order 0 1 (params o).succ.succ.succ e q r rfl rfl ho, - M.realize_rawMembership s R pairing carrier order E c o - (fun j => (params j).succ.succ.succ) 0 2 ti.succ.succ.succ e hc ho meaning q rfl hv hτ] - exact and_imp - -theorem realize_rawEqualityStep (R : P → ZFSet.{u} → ZFSet.{u} → Prop) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) - (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (meaning : M.RawRelationMeaning s R E (fun j => env (params j))) - (p : P) (hp : env pi = s.encode p) (hσ : env si ∈ M.sets) (hτ : env ti ∈ M.sets) : - Realize M.sets (equalityStepFormula E c o params pi si ti) env ↔ - M.RawEqualityStep s R p (env si) (env ti) := by - have swapped : M.RawRelationMeaning s (fun t x y => R t y x) (swapEquality E) - (fun j => env (params j)) := by - intro t x hx y hy - rw [swapEquality, realize_atomicApplication] - exact meaning t y hy x hx - change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ - rw [M.realize_rawMatching s R pairing carrier order E c o params pi si ti - env hc ho meaning p hp hσ hτ, - M.realize_rawMatching s (fun t x y => R t y x) pairing carrier order - (swapEquality E) c o params pi ti si env hc ho swapped p hp hτ hσ] - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedEqualityRelations + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +def RawRelationMeaning {k : Nat} (R : P → ZFSet.{u} → ZFSet.{u} → Prop) + (E : SetFormula (k + 3)) (constants : Fin k → ZFSet.{u}) : Prop := + ∀ p x, x ∈ M.sets → ∀ y, y ∈ M.sets → + (Realize M.sets E (extend (s.encode p) (extend x (extend y constants))) ↔ R p x y) + +def RawMembership (R : P → ZFSet.{u} → ZFSet.{u} → Prop) (p : P) (x y : ZFSet.{u}) : Prop := + ∀ q, q ≤ p → ∃ t, t ≤ q ∧ ∃ v ∈ M.sets, ∃ r, + ZFSet.pair v (s.encode r) ∈ y ∧ t ≤ r ∧ R t x v + +def RawMatching (R : P → ZFSet.{u} → ZFSet.{u} → Prop) (p : P) (x y : ZFSet.{u}) : Prop := + ∀ v ∈ M.sets, ∀ r, ZFSet.pair v (s.encode r) ∈ x → + ∀ q, q ≤ p → q ≤ r → M.RawMembership s R q v y + +def RawEqualityStep (R : P → ZFSet.{u} → ZFSet.{u} → Prop) + (p : P) (x y : ZFSet.{u}) : Prop := + M.RawMatching s R p x y ∧ M.RawMatching s (fun t v w => R t w v) p y x + +theorem rawEqualityStep_mono {R S : P → ZFSet.{u} → ZFSet.{u} → Prop} + (mono : ∀ p x y, R p x y → S p x y) {p : P} {x y : ZFSet.{u}} + (h : M.RawEqualityStep s R p x y) : M.RawEqualityStep s S p x y := by + constructor + · intro v hv r entry q qp qr t tq + obtain ⟨a, hat, w, hw, b, eb, ab, rel⟩ := h.1 v hv r entry q qp qr t tq + exact ⟨a, hat, w, hw, b, eb, ab, mono a v w rel⟩ + · intro v hv r entry q qp qr t tq + obtain ⟨a, hat, w, hw, b, eb, ab, rel⟩ := h.2 v hv r entry q qp qr t tq + exact ⟨a, hat, w, hw, b, eb, ab, mono a w v rel⟩ + +theorem realize_rawMembership (R : P → ZFSet.{u} → ZFSet.{u} → Prop) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) + (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (meaning : M.RawRelationMeaning s R E (fun j => env (params j))) + (p : P) (hp : env pi = s.encode p) (hσ : env si ∈ M.sets) (hτ : env ti ∈ M.sets) : + Realize M.sets (membershipFormula E c o params pi si ti) env ↔ + M.RawMembership s R p (env si) (env ti) := by + rw [membershipFormula, M.realize_allConditions s _ _ env carrier hc] + change (∀ q : P, Realize M.sets _ (extend (s.encode q) env)) ↔ _ + apply forall_congr' + intro q + rw [realize_imp, M.realize_conditionLE s pairing carrier order 0 pi.succ (params o).succ + (extend (s.encode q) env) q p rfl hp ho] + apply forall_congr' + intro _ + rw [M.realize_exConditions s (params c).succ _ (extend (s.encode q) env) carrier hc] + constructor + · rintro ⟨t, ht⟩ + obtain ⟨v, hv, rest⟩ := (realize_ex M.sets _ _).1 ht + obtain ⟨r, entry, tq, tr, rel⟩ := (M.realize_exConditions s (params c).succ.succ.succ _ + (extend v (extend (s.encode t) (extend (s.encode q) env))) carrier hc).1 rest + let e := extend (s.encode r) (extend v (extend (s.encode t) (extend (s.encode q) env))) + have lookup := (realize_atomicApplication M.sets E + (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).1 rel + exact ⟨t, (M.realize_conditionLE s pairing carrier order 2 3 + (params o).succ.succ.succ.succ e t q rfl rfl ho).1 tq, + v, hv, r, + (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e + hv (M.transitive carrier (s.encode_mem r)) hτ).1 entry, + (M.realize_conditionLE s pairing carrier order 2 0 + (params o).succ.succ.succ.succ e t r rfl rfl ho).1 tr, + (meaning t (env si) hσ v hv).1 lookup⟩ + · rintro ⟨t, tq, v, hv, r, entry, tr, rel⟩ + refine ⟨t, ?_⟩ + rw [realize_ex] + refine ⟨v, hv, ?_⟩ + apply (M.realize_exConditions s (params c).succ.succ.succ _ + (extend v (extend (s.encode t) (extend (s.encode q) env))) carrier hc).2 + let e := extend (s.encode r) (extend v (extend (s.encode t) (extend (s.encode q) env))) + refine ⟨r, ?_, ?_, ?_, ?_⟩ + · exact (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e + hv (M.transitive carrier (s.encode_mem r)) hτ).2 entry + · exact (M.realize_conditionLE s pairing carrier order 2 3 + (params o).succ.succ.succ.succ e t q rfl rfl ho).2 tq + · exact (M.realize_conditionLE s pairing carrier order 2 0 + (params o).succ.succ.succ.succ e t r rfl rfl ho).2 tr + · exact (realize_atomicApplication M.sets E + (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).2 + ((meaning t (env si) hσ v hv).2 rel) + +theorem realize_rawMatching (R : P → ZFSet.{u} → ZFSet.{u} → Prop) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) + (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (meaning : M.RawRelationMeaning s R E (fun j => env (params j))) + (p : P) (hp : env pi = s.encode p) (hσ : env si ∈ M.sets) (hτ : env ti ∈ M.sets) : + Realize M.sets (matchingDirectionFormula E c o params pi si ti) env ↔ + M.RawMatching s R p (env si) (env ti) := by + change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _ + apply forall_congr' + intro v + apply forall_congr' + intro hv + rw [M.realize_allConditions s (params c).succ _ (extend v env) carrier hc] + apply forall_congr' + intro r + rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 si.succ.succ + (extend (s.encode r) (extend v env)) hv (M.transitive carrier (s.encode_mem r)) hσ] + apply forall_congr' + intro _ + rw [M.realize_allConditions s (params c).succ.succ _ + (extend (s.encode r) (extend v env)) carrier hc] + apply forall_congr' + intro q + let e := extend (s.encode q) (extend (s.encode r) (extend v env)) + rw [realize_imp] + change (Realize M.sets _ e ∧ Realize M.sets _ e → Realize M.sets _ e) ↔ _ + rw [M.realize_conditionLE s pairing carrier order 0 pi.succ.succ.succ + (params o).succ.succ.succ e q p rfl hp ho, + M.realize_conditionLE s pairing carrier order 0 1 (params o).succ.succ.succ e q r rfl rfl ho, + M.realize_rawMembership s R pairing carrier order E c o + (fun j => (params j).succ.succ.succ) 0 2 ti.succ.succ.succ e hc ho meaning q rfl hv hτ] + exact and_imp + +theorem realize_rawEqualityStep (R : P → ZFSet.{u} → ZFSet.{u} → Prop) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) + (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (meaning : M.RawRelationMeaning s R E (fun j => env (params j))) + (p : P) (hp : env pi = s.encode p) (hσ : env si ∈ M.sets) (hτ : env ti ∈ M.sets) : + Realize M.sets (equalityStepFormula E c o params pi si ti) env ↔ + M.RawEqualityStep s R p (env si) (env ti) := by + have swapped : M.RawRelationMeaning s (fun t x y => R t y x) (swapEquality E) + (fun j => env (params j)) := by + intro t x hx y hy + rw [swapEquality, realize_atomicApplication] + exact meaning t y hy x hx + change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ + rw [M.realize_rawMatching s R pairing carrier order E c o params pi si ti + env hc ho meaning p hp hσ hτ, + M.realize_rawMatching s (fun t x y => R t y x) pairing carrier order + (swapEquality E) c o params pi ti si env hc ho swapped p hp hτ hσ] + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleFulfillmentAtBound.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleFulfillmentAtBound.lean index 709fbecb3eb3b454406c979265566023f91e3076..0ae8bac95540d682cb8d1472fde140f2016ef809 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleFulfillmentAtBound.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleFulfillmentAtBound.lean @@ -1,547 +1,547 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainTransitionCodes - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def externalRectangleCode (c b d g h : ZFSet.{u}) : ZFSet.{u} := - ZFSet.pair c (ZFSet.pair b (ZFSet.pair d (ZFSet.pair g h))) - -noncomputable def externalRectangleBound (P G : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod P (ZFSet.prod P (ZFSet.prod P (ZFSet.prod G G))) - -def ExternalRectangleCode (P G r μ A c b d g h : ZFSet.{u}) : Prop := - c ∈ P ∧ b ∈ P ∧ d ∈ P ∧ g ∈ G ∧ h ∈ G ∧ - ZFSet.pair c d ∈ r ∧ ZFSet.pair b d ∈ r ∧ - ∃ w ∈ P, ZFSet.pair (ZFSet.pair c b) w ∈ μ ∧ ActionAgreementBelow P r A g h w ∧ - ∀ y ∈ P, ∀ z ∈ P, ∀ v ∈ P, - (ZFSet.pair (ZFSet.pair g d) y ∈ A ∧ ZFSet.pair (ZFSet.pair h d) z ∈ A ∧ - ZFSet.pair (ZFSet.pair g w) v ∈ A) → ZFSet.pair (ZFSet.pair y z) v ∈ μ - -noncomputable def externalRectangles (P G r μ A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun t => ∃ c ∈ P, ∃ b ∈ P, ∃ d ∈ P, ∃ g ∈ G, ∃ h ∈ G, - t = externalRectangleCode c b d g h ∧ ExternalRectangleCode P G r μ A c b d g h) - (externalRectangleBound P G) - -theorem externalRectangleCode_inj {c b d g h c' b' d' g' h' : ZFSet.{u}} : - externalRectangleCode c b d g h = externalRectangleCode c' b' d' g' h' ↔ - c = c' ∧ b = b' ∧ d = d' ∧ g = g' ∧ h = h' := by - simp only [externalRectangleCode, ZFSet.pair_inj] - -theorem externalRectangleCode_mem_bound (P G c b d g h : ZFSet.{u}) : - externalRectangleCode c b d g h ∈ externalRectangleBound P G ↔ - c ∈ P ∧ b ∈ P ∧ d ∈ P ∧ g ∈ G ∧ h ∈ G := by - simp only [externalRectangleCode, externalRectangleBound, ZFSet.pair_mem_prod] - -theorem mem_externalRectangles (P G r μ A t : ZFSet.{u}) : - t ∈ externalRectangles P G r μ A ↔ ∃ c b d g h, - t = externalRectangleCode c b d g h ∧ ExternalRectangleCode P G r μ A c b d g h := by - rw [externalRectangles, ZFSet.mem_sep] - constructor - · rintro ⟨_, c, _, b, _, d, _, g, _, h, _, eq, code⟩ - exact ⟨c, b, d, g, h, eq, code⟩ - · rintro ⟨c, b, d, g, h, rfl, code⟩ - exact ⟨(externalRectangleCode_mem_bound P G c b d g h).2 - ⟨code.1, code.2.1, code.2.2.1, code.2.2.2.1, code.2.2.2.2.1⟩, - c, code.1, b, code.2.1, d, code.2.2.1, g, code.2.2.2.1, h, code.2.2.2.2.1, rfl, code⟩ - -theorem externalRectangleCode_mem (P G r μ A c b d g h : ZFSet.{u}) : - externalRectangleCode c b d g h ∈ externalRectangles P G r μ A ↔ - ExternalRectangleCode P G r μ A c b d g h := by - rw [mem_externalRectangles] - constructor - · rintro ⟨c', b', d', g', h', equal, code⟩ - obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := externalRectangleCode_inj.1 equal - exact code - · intro code - exact ⟨c, b, d, g, h, rfl, code⟩ - -namespace BoundedFormula -open SetFormula - -def actionAgreementBelowFormula {n} (P r A g h w : Fin n) : BoundedFormula n := - .allMem P (.allMem P.succ (imp (pairMembershipFormula 1 w.succ.succ r.succ.succ) - (.conj (imp (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ) - (tripleMembershipFormula h.succ.succ 1 0 A.succ.succ)) - (imp (tripleMembershipFormula h.succ.succ 1 0 A.succ.succ) - (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ))))) - -theorem truth_actionAgreementBelowFormula {n} (P r A g h w : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (actionAgreementBelowFormula P r A g h w) env ↔ - ActionAgreementBelow (env P) (env r) (env A) (env g) (env h) (env w) := by - simp only [actionAgreementBelowFormula, ActionAgreementBelow, Truth, truth_imp, iff_def, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - constructor <;> exact fun h => h - -def rectangleSeparatedFormula {n} (P μ A d w g h : Fin n) : BoundedFormula n := - .allMem P (.allMem P.succ (.allMem P.succ.succ - (imp (.conj (tripleMembershipFormula g.succ.succ.succ d.succ.succ.succ 2 A.succ.succ.succ) - (.conj (tripleMembershipFormula h.succ.succ.succ d.succ.succ.succ 1 A.succ.succ.succ) - (tripleMembershipFormula g.succ.succ.succ w.succ.succ.succ 0 A.succ.succ.succ))) - (tripleMembershipFormula 2 1 0 μ.succ.succ.succ)))) - -def externalRectangleFormula {n} (P G r μ A c b d g h : Fin n) : BoundedFormula n := - .conj (.mem c P) (.conj (.mem b P) (.conj (.mem d P) (.conj (.mem g G) (.conj (.mem h G) - (.conj (pairMembershipFormula c d r) (.conj (pairMembershipFormula b d r) - (exMem P (.conj (tripleMembershipFormula c.succ b.succ 0 μ.succ) - (.conj (actionAgreementBelowFormula P.succ r.succ A.succ g.succ h.succ 0) - (rectangleSeparatedFormula P.succ μ.succ A.succ d.succ 0 g.succ h.succ)))))))))) - -theorem truth_externalRectangleFormula {n} (P G r μ A c b d g h : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (externalRectangleFormula P G r μ A c b d g h) env ↔ - ExternalRectangleCode (env P) (env G) (env r) (env μ) (env A) - (env c) (env b) (env d) (env g) (env h) := by - simp only [externalRectangleFormula, ExternalRectangleCode, rectangleSeparatedFormula, - Truth, truth_exMem, truth_imp, truth_actionAgreementBelowFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula] - rfl - -def externalRectangleTupleFormula {n} (t c b d g h : Fin n) : BoundedFormula n := - nonemptyTupleFormula 4 t - (Fin.cases c (Fin.cases b (Fin.cases d (Fin.cases g (Fin.cases h Fin.elim0))))) - -theorem truth_externalRectangleTupleFormula {n} (t c b d g h : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (externalRectangleTupleFormula t c b d g h) env ↔ - env t = externalRectangleCode (env c) (env b) (env d) (env g) (env h) := by - rw [externalRectangleTupleFormula, truth_nonemptyTupleFormula] - rfl - -def externalRectanglesEntryFormula {n} (t P G r μ A : Fin n) : BoundedFormula n := - exMem P (exMem P.succ (exMem P.succ.succ (exMem G.succ.succ.succ - (exMem G.succ.succ.succ.succ - (.conj (externalRectangleTupleFormula t.succ.succ.succ.succ.succ 4 3 2 1 0) - (externalRectangleFormula P.succ.succ.succ.succ.succ G.succ.succ.succ.succ.succ - r.succ.succ.succ.succ.succ μ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ - 4 3 2 1 0)))))) - -theorem truth_externalRectanglesEntryFormula {n} (t P G r μ A : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (externalRectanglesEntryFormula t P G r μ A) env ↔ - ∃ c ∈ env P, ∃ b ∈ env P, ∃ d ∈ env P, ∃ g ∈ env G, ∃ h ∈ env G, - env t = externalRectangleCode c b d g h ∧ - ExternalRectangleCode (env P) (env G) (env r) (env μ) (env A) c b d g h := by - simp only [externalRectanglesEntryFormula, truth_exMem, Truth, - truth_externalRectangleTupleFormula, truth_externalRectangleFormula] - rfl - -end BoundedFormula - - - - - -def CompressionActorCode - (P G Q H R B e a Sources Reps top Caps i k : ZFSet.{u}) : Prop := - (∀ s ∈ P, ∀ g ∈ G, ∀ g' ∈ H, ∀ s' ∈ Q, - ZFSet.pair i s ∈ Sources → ZFSet.pair i g ∈ Reps → - ZFSet.pair g g' ∈ a → ZFSet.pair s s' ∈ e → - ActionAgreementBelow Q R B k g' s') ∧ - ∀ top' ∈ Q, ∀ v ∈ Q, ZFSet.pair top top' ∈ e → - (ZFSet.pair (ZFSet.pair k top') v ∈ B ↔ ZFSet.pair i v ∈ Caps) - -def CompressionActorFulfillmentCode - (I P G Q H R B e a Sources Reps top Caps : ZFSet.{u}) : Prop := - ∀ i ∈ I, ∃ k ∈ H, CompressionActorCode P G Q H R B e a Sources Reps top Caps i k - -namespace BoundedFormula - -def compressionActorFormula {n} - (P G Q H R B e a Sources Reps top Caps i k : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ.succ.succ - .conj - (.allMem P (.allMem G.succ (.allMem H.succ.succ (.allMem Q.succ.succ.succ - (imp (pairMembershipFormula (lift i) 3 (lift Sources)) - (imp (pairMembershipFormula (lift i) 2 (lift Reps)) - (imp (pairMembershipFormula 2 1 (lift a)) - (imp (pairMembershipFormula 3 0 (lift e)) - (actionAgreementBelowFormula (lift Q) (lift R) (lift B) (lift k) 1 0))))))))) - (.allMem Q (.allMem Q.succ - (imp (pairMembershipFormula top.succ.succ 1 e.succ.succ) - (.conj - (imp (tripleMembershipFormula k.succ.succ 1 0 B.succ.succ) - (pairMembershipFormula i.succ.succ 0 Caps.succ.succ)) - (imp (pairMembershipFormula i.succ.succ 0 Caps.succ.succ) - (tripleMembershipFormula k.succ.succ 1 0 B.succ.succ)))))) - -theorem truth_compressionActorFormula {n} - (P G Q H R B e a Sources Reps top Caps i k : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (compressionActorFormula P G Q H R B e a Sources Reps top Caps i k) env ↔ - CompressionActorCode (env P) (env G) (env Q) (env H) (env R) (env B) - (env e) (env a) (env Sources) (env Reps) (env top) (env Caps) (env i) (env k) := by - simp only [compressionActorFormula, CompressionActorCode, Truth, truth_imp, - truth_pairMembershipFormula, truth_tripleMembershipFormula, - truth_actionAgreementBelowFormula, iff_def] - constructor <;> exact fun h => h - -def compressionActorFulfillmentFormula {n} - (I P G Q H R B e a Sources Reps top Caps : Fin n) : BoundedFormula n := - .allMem I (.exMem H.succ - (compressionActorFormula P.succ.succ G.succ.succ Q.succ.succ H.succ.succ - R.succ.succ B.succ.succ e.succ.succ a.succ.succ Sources.succ.succ - Reps.succ.succ top.succ.succ Caps.succ.succ 1 0)) - -theorem truth_compressionActorFulfillmentFormula {n} - (I P G Q H R B e a Sources Reps top Caps : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (compressionActorFulfillmentFormula I P G Q H R B e a Sources Reps top Caps) env ↔ - CompressionActorFulfillmentCode (env I) (env P) (env G) (env Q) (env H) (env R) - (env B) (env e) (env a) (env Sources) (env Reps) (env top) (env Caps) := by - simp only [compressionActorFulfillmentFormula, Truth, truth_exMem, truth_compressionActorFormula] - rfl - -theorem realize_compressionActorFulfillmentFormula (M : TransitiveGround.{u}) {n} - (I P G Q H R B e a Sources Reps top Caps : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - SetFormula.Realize M.sets - (compressionActorFulfillmentFormula I P G Q H R B e a Sources Reps top Caps).toFormula env ↔ - CompressionActorFulfillmentCode (env I) (env P) (env G) (env Q) (env H) (env R) - (env B) (env e) (env a) (env Sources) (env Reps) (env top) (env Caps) := - (realize_toFormula M _ env members).trans - (truth_compressionActorFulfillmentFormula I P G Q H R B e a Sources Reps top Caps env) - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u -variable {P G r μ A m inv one c b d g h : ZFSet.{u}} -variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) -variable (meet : MeetOrderCode P r μ) - -noncomputable def ExternalRectangleCode.toActionRectangle - (code : ExternalRectangleCode P G r μ A c b d g h) : - Compression.RecursiveMaps.ActionRectangle meet.toMeetOrder (action.toMeetIso group meet) := by - obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code - let w := Classical.choose witness - have mw := (Classical.choose_spec witness).2.1 - have agree := (Classical.choose_spec witness).2.2.1 - have separated := (Classical.choose_spec witness).2.2.2 - let C := (⟨c, hc⟩ : {x : ZFSet.{u} // x ∈ P}) - let B := (⟨b, hb⟩ : {x : ZFSet.{u} // x ∈ P}) - let D := (⟨d, hd⟩ : {x : ZFSet.{u} // x ∈ P}) - let first := (⟨g, hg⟩ : {x : ZFSet.{u} // x ∈ G}) - let second := (⟨h, hh⟩ : {x : ZFSet.{u} // x ∈ G}) - have meetValue : (meet.toMeetOrder.meet C B).val = w := - (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique - (meet.toMeetOrder_meet_entry C B) mw - refine { - C := C - B := B - D := D - first := first - second := second - C_le_D := cd - B_le_D := bd - agree := ?_ - separated := ?_ } - · intro x lower - apply Subtype.ext - have lowerW : ZFSet.pair x.val w ∈ r := meetValue ▸ lower - exact agree.entry_eq action hh x.property lowerW - (action.toMeetIso_entry group meet first x) - (action.toMeetIso_entry group meet second x) - · apply Subtype.ext - let y := (action.toMeetIso group meet first).toFun D - let z := (action.toMeetIso group meet second).toFun D - let v := (action.toMeetIso group meet first).toFun (meet.toMeetOrder.meet C B) - have actMeet : ZFSet.pair (ZFSet.pair g w) v.val ∈ A := by - rw [← meetValue] - exact action.toMeetIso_entry group meet first (meet.toMeetOrder.meet C B) - have value := separated y.val y.property z.val z.property v.val v.property - ⟨action.toMeetIso_entry group meet first D, action.toMeetIso_entry group meet second D, actMeet⟩ - exact (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique - (meet.toMeetOrder_meet_entry y z) value - -theorem ExternalRectangleCode.toActionRectangle_fields - (code : ExternalRectangleCode P G r μ A c b d g h) : - let request := code.toActionRectangle group action meet - request.C.val = c ∧ request.B.val = b ∧ request.D.val = d ∧ - request.first.val = g ∧ request.second.val = h := by - obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code - exact ⟨rfl, rfl, rfl, rfl, rfl⟩ - -theorem externalRectangleCode_of_actionRectangle - (request : Compression.RecursiveMaps.ActionRectangle meet.toMeetOrder (action.toMeetIso group meet)) : - ExternalRectangleCode P G r μ A request.C.val request.B.val request.D.val - request.first.val request.second.val := by - refine ⟨request.C.property, request.B.property, request.D.property, - request.first.property, request.second.property, request.C_le_D, request.B_le_D, - (meet.toMeetOrder.meet request.C request.B).val, - (meet.toMeetOrder.meet request.C request.B).property, - meet.toMeetOrder_meet_entry request.C request.B, ?_, ?_⟩ - · intro x hx y hy lower - have same := request.agree ⟨x, hx⟩ lower - rw [← action.toMeetIso_eq_iff group meet request.first ⟨x, hx⟩ ⟨y, hy⟩, - ← action.toMeetIso_eq_iff group meet request.second ⟨x, hx⟩ ⟨y, hy⟩] - exact ⟨fun entry => same.symm.trans entry, fun entry => same.trans entry⟩ - · intro y hy z hz v hv entries - have first := (action.toMeetIso_eq_iff group meet request.first request.D ⟨y, hy⟩).2 entries.1 - have second := (action.toMeetIso_eq_iff group meet request.second request.D ⟨z, hz⟩).2 entries.2.1 - have meetImage := (action.toMeetIso_eq_iff group meet request.first - (meet.toMeetOrder.meet request.C request.B) ⟨v, hv⟩).2 entries.2.2 - have same : meet.toMeetOrder.meet ⟨y, hy⟩ ⟨z, hz⟩ = ⟨v, hv⟩ := by - rw [← first, ← second, request.separated] - exact meetImage - have entry := meet.toMeetOrder_meet_entry ⟨y, hy⟩ ⟨z, hz⟩ - rw [same] at entry - exact entry - -theorem actionRectangle_mem_externalRectangles - (request : Compression.RecursiveMaps.ActionRectangle meet.toMeetOrder (action.toMeetIso group meet)) : - externalRectangleCode request.C.val request.B.val request.D.val request.first.val request.second.val ∈ - externalRectangles P G r μ A := - (externalRectangleCode_mem _ _ _ _ _ _ _ _ _ _).2 - (externalRectangleCode_of_actionRectangle group action meet request) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -def RectangleIdealCode (Q H R B e a c b g h k l : ZFSet.{u}) : Prop := - (∀ c' ∈ Q, ∀ g' ∈ H, ∀ h' ∈ H, - ZFSet.pair c c' ∈ e → ZFSet.pair g g' ∈ a → ZFSet.pair h h' ∈ a → - ActionAgreementBelow Q R B k g' c' ∧ ActionAgreementBelow Q R B l h' c') ∧ - ∀ b' ∈ Q, ZFSet.pair b b' ∈ e → ActionAgreementBelow Q R B k l b' - -def RectangleRootMeetCode (P μ A Q ν B e c d g k : ZFSet.{u}) : Prop := - ∀ x ∈ P, ∀ v ∈ P, ∀ w ∈ P, ∀ d' ∈ Q, ∀ x' ∈ Q, ∀ w' ∈ Q, ∀ y ∈ Q, - ZFSet.pair (ZFSet.pair g c) v ∈ A → ZFSet.pair (ZFSet.pair v x) w ∈ μ → - ZFSet.pair d d' ∈ e → ZFSet.pair x x' ∈ e → ZFSet.pair w w' ∈ e → - ZFSet.pair (ZFSet.pair k d') y ∈ B → ZFSet.pair (ZFSet.pair y x') w' ∈ ν - -def RectangleCrossMeetCode (Q ν B e b d k l : ZFSet.{u}) : Prop := - ∀ b' ∈ Q, ∀ d' ∈ Q, ∀ y ∈ Q, ∀ v ∈ Q, ∀ z ∈ Q, - ZFSet.pair b b' ∈ e → ZFSet.pair d d' ∈ e → - ZFSet.pair (ZFSet.pair k d') y ∈ B → ZFSet.pair (ZFSet.pair l d') v ∈ B → - ZFSet.pair (ZFSet.pair k b') z ∈ B → - ZFSet.pair (ZFSet.pair y v) z ∈ ν ∧ ZFSet.pair (ZFSet.pair l b') z ∈ B - -def RectangleActorPairCode (P μ A Q H R ν B e a c b d g h k l : ZFSet.{u}) : Prop := - RectangleIdealCode Q H R B e a c b g h k l ∧ - RectangleRootMeetCode P μ A Q ν B e c d g k ∧ - RectangleRootMeetCode P μ A Q ν B e c d h l ∧ - RectangleCrossMeetCode Q ν B e b d k l - -def RectangleFulfillmentCode (P G r μ A Q H R ν B e a : ZFSet.{u}) : Prop := - ∀ c ∈ P, ∀ b ∈ P, ∀ d ∈ P, ∀ g ∈ G, ∀ h ∈ G, - ExternalRectangleCode P G r μ A c b d g h → - ∃ k ∈ H, ∃ l ∈ H, RectangleActorPairCode P μ A Q H R ν B e a c b d g h k l - -namespace BoundedFormula - -def rectangleIdealFormula {n} (Q H R B e a c b g h k l : Fin n) : BoundedFormula n := - (.conj (.allMem Q (.allMem H.succ (.allMem H.succ.succ (imp (pairMembershipFormula c.succ.succ.succ 2 e.succ.succ.succ) (imp (pairMembershipFormula g.succ.succ.succ 1 a.succ.succ.succ) (imp (pairMembershipFormula h.succ.succ.succ 0 a.succ.succ.succ) (.conj (actionAgreementBelowFormula Q.succ.succ.succ R.succ.succ.succ B.succ.succ.succ k.succ.succ.succ 1 2) (actionAgreementBelowFormula Q.succ.succ.succ R.succ.succ.succ B.succ.succ.succ l.succ.succ.succ 0 2)))))))) (.allMem Q (imp (pairMembershipFormula b.succ 0 e.succ) (actionAgreementBelowFormula Q.succ R.succ B.succ k.succ l.succ 0)))) - -theorem truth_rectangleIdealFormula {n} (Q H R B e a c b g h k l : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rectangleIdealFormula Q H R B e a c b g h k l) env ↔ RectangleIdealCode (env Q) (env H) (env R) (env B) (env e) (env a) (env c) (env b) (env g) (env h) (env k) (env l) := by - simp only [rectangleIdealFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_actionAgreementBelowFormula] - rfl - -def rectangleRootMeetFormula {n} (P μ A Q ν B e c d g k : Fin n) : BoundedFormula n := - (.allMem P (.allMem P.succ (.allMem P.succ.succ (.allMem Q.succ.succ.succ (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ.succ (imp (tripleMembershipFormula g.succ.succ.succ.succ.succ.succ.succ c.succ.succ.succ.succ.succ.succ.succ 5 A.succ.succ.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula 5 6 4 μ.succ.succ.succ.succ.succ.succ.succ) (imp (pairMembershipFormula d.succ.succ.succ.succ.succ.succ.succ 3 e.succ.succ.succ.succ.succ.succ.succ) (imp (pairMembershipFormula 6 2 e.succ.succ.succ.succ.succ.succ.succ) (imp (pairMembershipFormula 4 1 e.succ.succ.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ.succ.succ 3 0 B.succ.succ.succ.succ.succ.succ.succ) (tripleMembershipFormula 0 2 1 ν.succ.succ.succ.succ.succ.succ.succ)))))))))))))) - -theorem truth_rectangleRootMeetFormula {n} (P μ A Q ν B e c d g k : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rectangleRootMeetFormula P μ A Q ν B e c d g k) env ↔ RectangleRootMeetCode (env P) (env μ) (env A) (env Q) (env ν) (env B) (env e) (env c) (env d) (env g) (env k) := by - simp only [rectangleRootMeetFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_tripleMembershipFormula] - rfl - -def rectangleCrossMeetFormula {n} (Q ν B e b d k l : Fin n) : BoundedFormula n := - (.allMem Q (.allMem Q.succ (.allMem Q.succ.succ (.allMem Q.succ.succ.succ (.allMem Q.succ.succ.succ.succ (imp (pairMembershipFormula b.succ.succ.succ.succ.succ 4 e.succ.succ.succ.succ.succ) (imp (pairMembershipFormula d.succ.succ.succ.succ.succ 3 e.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ 3 2 B.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula l.succ.succ.succ.succ.succ 3 1 B.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ 4 0 B.succ.succ.succ.succ.succ) (.conj (tripleMembershipFormula 2 1 0 ν.succ.succ.succ.succ.succ) (tripleMembershipFormula l.succ.succ.succ.succ.succ 4 0 B.succ.succ.succ.succ.succ)))))))))))) - -theorem truth_rectangleCrossMeetFormula {n} (Q ν B e b d k l : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rectangleCrossMeetFormula Q ν B e b d k l) env ↔ RectangleCrossMeetCode (env Q) (env ν) (env B) (env e) (env b) (env d) (env k) (env l) := by - simp only [rectangleCrossMeetFormula, Truth, truth_imp, truth_pairMembershipFormula, - truth_tripleMembershipFormula] - rfl - -def rectangleActorPairFormula {n} (P μ A Q H R ν B e a c b d g h k l : Fin n) : BoundedFormula n := - (.conj (rectangleIdealFormula Q H R B e a c b g h k l) (.conj (rectangleRootMeetFormula P μ A Q ν B e c d g k) (.conj (rectangleRootMeetFormula P μ A Q ν B e c d h l) (rectangleCrossMeetFormula Q ν B e b d k l)))) - -theorem truth_rectangleActorPairFormula {n} (P μ A Q H R ν B e a c b d g h k l : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rectangleActorPairFormula P μ A Q H R ν B e a c b d g h k l) env ↔ RectangleActorPairCode (env P) (env μ) (env A) (env Q) (env H) (env R) (env ν) (env B) (env e) (env a) (env c) (env b) (env d) (env g) (env h) (env k) (env l) := by - simp only [rectangleActorPairFormula, Truth, truth_rectangleIdealFormula, - truth_rectangleRootMeetFormula, truth_rectangleCrossMeetFormula] - rfl - -def rectangleFulfillmentFormula {n} (P G r μ A Q H R ν B e a : Fin n) : BoundedFormula n := - (.allMem P (.allMem P.succ (.allMem P.succ.succ (.allMem G.succ.succ.succ (.allMem G.succ.succ.succ.succ (imp (externalRectangleFormula P.succ.succ.succ.succ.succ G.succ.succ.succ.succ.succ r.succ.succ.succ.succ.succ μ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ 4 3 2 1 0) (.exMem H.succ.succ.succ.succ.succ (.exMem H.succ.succ.succ.succ.succ.succ (rectangleActorPairFormula P.succ.succ.succ.succ.succ.succ.succ μ.succ.succ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ.succ.succ Q.succ.succ.succ.succ.succ.succ.succ H.succ.succ.succ.succ.succ.succ.succ R.succ.succ.succ.succ.succ.succ.succ ν.succ.succ.succ.succ.succ.succ.succ B.succ.succ.succ.succ.succ.succ.succ e.succ.succ.succ.succ.succ.succ.succ a.succ.succ.succ.succ.succ.succ.succ 6 5 4 3 2 1 0))))))))) - -theorem truth_rectangleFulfillmentFormula {n} (P G r μ A Q H R ν B e a : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rectangleFulfillmentFormula P G r μ A Q H R ν B e a) env ↔ RectangleFulfillmentCode (env P) (env G) (env r) (env μ) (env A) (env Q) (env H) (env R) (env ν) (env B) (env e) (env a) := by - simp only [rectangleFulfillmentFormula, Truth, truth_imp, truth_exMem, - truth_externalRectangleFormula, truth_rectangleActorPairFormula] - rfl - -theorem realize_rectangleFulfillmentFormula (M : TransitiveGround.{u}) {n} - (P G r μ A Q H R ν B e a : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - SetFormula.Realize M.sets (rectangleFulfillmentFormula P G r μ A Q H R ν B e a).toFormula env ↔ - RectangleFulfillmentCode (env P) (env G) (env r) (env μ) (env A) (env Q) (env H) - (env R) (env ν) (env B) (env e) (env a) := - (realize_toFormula M _ env members).trans (truth_rectangleFulfillmentFormula P G r μ A Q H R ν B e a env) - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem choose_compressionActorFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I P G Q H R B e a Sources Reps top Caps : ZFSet.{u}} - (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hQ : Q ∈ M.sets) - (hH : H ∈ M.sets) (hR : R ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) - (ha : a ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hTop : top ∈ M.sets) (hCaps : Caps ∈ M.sets) - (total : CompressionActorFulfillmentCode I P G Q H R B e a Sources Reps top Caps) : - ∃ f ∈ M.sets, ZFSet.IsFunc I H f ∧ - ∀ i k, ZFSet.pair i k ∈ f → CompressionActorCode P G Q H R B e a Sources Reps top Caps i k := by - let params : Fin 12 → ZFSet.{u} := extend P (extend G (extend Q (extend H (extend R (extend B - (extend e (extend a (extend Sources (extend Reps (extend top (extend Caps Fin.elim0))))))))))) - have members : ∀ j, params j ∈ M.sets := Fin.cases hP (Fin.cases hG (Fin.cases hQ (Fin.cases hH - (Fin.cases hR (Fin.cases hB (Fin.cases he (Fin.cases ha (Fin.cases hSources - (Fin.cases hReps (Fin.cases hTop (Fin.cases hCaps (fun j => Fin.elim0 j)))))))))))) - let φ : SetFormula 14 := (BoundedFormula.compressionActorFormula 2 3 4 5 6 7 8 9 10 11 12 13 0 1).toFormula - let relation := M.definableRelation φ params I H - have ground : relation ∈ M.sets := M.definableRelation_mem pairing unions powers separation φ params members hI hH - have exactCode (i k : ZFSet.{u}) (hi : i ∈ I) (hk : k ∈ H) : - Realize M.sets φ (extend i (extend k params)) ↔ - CompressionActorCode P G Q H R B e a Sources Reps top Caps i k := - (BoundedFormula.realize_toFormula M _ _ - (Fin.cases (M.transitive hI hi) (Fin.cases (M.transitive hH hk) members))).trans - (BoundedFormula.truth_compressionActorFormula 2 3 4 5 6 7 8 9 10 11 12 13 0 1 _) - obtain ⟨f, hf, function, included⟩ := M.uniformize_relation pairing unions powers separation choice hI hH ground (by - intro i hi - obtain ⟨k, hk, code⟩ := total i hi - exact ⟨k, hk, (M.pair_mem_definableRelation φ params I H i k).2 ⟨hi, hk, (exactCode i k hi hk).2 code⟩⟩) - refine ⟨f, hf, function, ?_⟩ - intro i k entry - obtain ⟨hi, hk, realized⟩ := (M.pair_mem_definableRelation φ params I H i k).1 (included entry) - exact (exactCode i k hi hk).1 realized - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -universe u - -structure RectangleAtBoundCode (P r μ A c b d g h X k l : ZFSet.{u}) : Prop where - first_agreement : ActionAgreementBelow P r A k g c - second_agreement : ActionAgreementBelow P r A l h c - common_agreement : ActionAgreementBelow P r A k l b - values : ∃ v ∈ P, ∃ w ∈ P, ∃ y ∈ P, ∃ z ∈ P, ∃ t ∈ P, - ZFSet.pair (ZFSet.pair g c) v ∈ A ∧ ZFSet.pair (ZFSet.pair h c) w ∈ A ∧ - ZFSet.pair (ZFSet.pair k d) y ∈ A ∧ ZFSet.pair (ZFSet.pair l d) z ∈ A ∧ - ZFSet.pair (ZFSet.pair k b) t ∈ A ∧ ZFSet.pair (ZFSet.pair l b) t ∈ A ∧ - ZFSet.pair (ZFSet.pair y X) v ∈ μ ∧ ZFSet.pair (ZFSet.pair z X) w ∈ μ ∧ - ZFSet.pair (ZFSet.pair y z) t ∈ μ - -theorem MeetOrderCode.meet_entry_of_lower {P r μ x y : ZFSet.{u}} - (meet : MeetOrderCode P r μ) (hx : x ∈ P) (hy : y ∈ P) - (lower : ZFSet.pair x y ∈ r) : ZFSet.pair (ZFSet.pair x y) x ∈ μ := by - obtain ⟨z, entry, _⟩ := meet.operation.2 (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - have hz := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 - have equal : z = x := meet.order.antisymm z hz x hx (meet.lower_left x y z entry) - (meet.greatest x y z x hx entry (meet.order.refl x hx) lower) - exact equal ▸ entry - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundMainTransition -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {source target : GroundMainStage M C D rD} -variable (transition : GroundMainTransition source target) - -theorem rectangle_at_bound - (fulfills : RectangleFulfillmentCode source.carrier source.actors source.order - source.meetGraph source.action target.carrier target.actors target.order target.meetGraph - target.action transition.points transition.actors) - {c b d g h X c' b' d' g' h' X' : ZFSet.{u}} - (rectangle : ExternalRectangleCode source.carrier source.actors source.order - source.meetGraph source.action c b d g h) (hX : X ∈ source.carrier) - (firstUpper : ∀ y ∈ source.carrier, ZFSet.pair (ZFSet.pair g d) y ∈ source.action → - ZFSet.pair y X ∈ source.order) - (secondUpper : ∀ y ∈ source.carrier, ZFSet.pair (ZFSet.pair h d) y ∈ source.action → - ZFSet.pair y X ∈ source.order) - (imageC : ZFSet.pair c c' ∈ transition.points) - (imageB : ZFSet.pair b b' ∈ transition.points) - (imageD : ZFSet.pair d d' ∈ transition.points) - (imageX : ZFSet.pair X X' ∈ transition.points) - (imageG : ZFSet.pair g g' ∈ transition.actors) - (imageH : ZFSet.pair h h' ∈ transition.actors) : - ∃ k ∈ target.actors, ∃ l ∈ target.actors, - RectangleAtBoundCode target.carrier target.order target.meetGraph target.action - c' b' d' g' h' X' k l := by - have rectangleData := rectangle - obtain ⟨hc, hb, hd, hg, hh, cd, _, _⟩ := rectangleData - obtain ⟨k, hk, l, hl, ideals, rootG, rootH, cross⟩ := fulfills c hc b hb d hd g hg h hh rectangle - have hc' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 - have hb' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageB)).2 - have hd' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageD)).2 - have hX' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageX)).2 - have hg' := (ZFSet.pair_mem_prod.1 (transition.group_embedding.injection.function.1 imageG)).2 - have hh' := (ZFSet.pair_mem_prod.1 (transition.group_embedding.injection.function.1 imageH)).2 - obtain ⟨v, gv, _⟩ := source.action_code.function.2 (ZFSet.pair g c) (ZFSet.pair_mem_prod.2 ⟨hg, hc⟩) - obtain ⟨w, hwAction, _⟩ := source.action_code.function.2 (ZFSet.pair h c) (ZFSet.pair_mem_prod.2 ⟨hh, hc⟩) - obtain ⟨gd, gD, _⟩ := source.action_code.function.2 (ZFSet.pair g d) (ZFSet.pair_mem_prod.2 ⟨hg, hd⟩) - obtain ⟨hdv, hD, _⟩ := source.action_code.function.2 (ZFSet.pair h d) (ZFSet.pair_mem_prod.2 ⟨hh, hd⟩) - have hv := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 gv)).2 - have hw := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 hwAction)).2 - have hgd := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 gD)).2 - have hhd := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 hD)).2 - have vX := source.meet.order.trans v hv gd hgd X hX - (source.action_code.monotone g hg c hc d hd v hv gd hgd gv gD cd) (firstUpper gd hgd gD) - have wX := source.meet.order.trans w hw hdv hhd X hX - (source.action_code.monotone h hh c hc d hd w hw hdv hhd hwAction hD cd) (secondUpper hdv hhd hD) - have meetV := source.meet.meet_entry_of_lower hv hX vX - have meetW := source.meet.meet_entry_of_lower hw hX wX - obtain ⟨v', vv', _⟩ := transition.point_embedding.injection.function.2 v hv - obtain ⟨w', ww', _⟩ := transition.point_embedding.injection.function.2 w hw - have hv' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 vv')).2 - have hw' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 ww')).2 - obtain ⟨y, ky, _⟩ := target.action_code.function.2 (ZFSet.pair k d') (ZFSet.pair_mem_prod.2 ⟨hk, hd'⟩) - obtain ⟨z, lz, _⟩ := target.action_code.function.2 (ZFSet.pair l d') (ZFSet.pair_mem_prod.2 ⟨hl, hd'⟩) - obtain ⟨t, kt, _⟩ := target.action_code.function.2 (ZFSet.pair k b') (ZFSet.pair_mem_prod.2 ⟨hk, hb'⟩) - have hy := (ZFSet.pair_mem_prod.1 (target.action_code.function.1 ky)).2 - have hz := (ZFSet.pair_mem_prod.1 (target.action_code.function.1 lz)).2 - have ht := (ZFSet.pair_mem_prod.1 (target.action_code.function.1 kt)).2 - have agree := ideals.1 c' hc' g' hg' h' hh' imageC imageG imageH - have meets := cross b' hb' d' hd' y hy z hz t ht imageB imageD ky lz kt - refine ⟨k, hk, l, hl, agree.1, agree.2, ideals.2 b' hb' imageB, - v', hv', w', hw', y, hy, z, hz, t, ht, ?_, ?_, ky, lz, kt, meets.2, ?_, ?_, meets.1⟩ - · exact transition.equivariant g g' c v c' v' imageG imageC vv' gv - · exact transition.equivariant h h' c w c' w' imageH imageC ww' hwAction - · exact rootG X hX v hv v hv d' hd' X' hX' v' hv' y hy gv meetV imageD imageX vv' ky - · exact rootH X hX w hw w hw d' hd' X' hX' w' hw' z hz hwAction meetW imageD imageX ww' lz - -end PartitionPilot.Forcing.GroundMainTransition - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainTransitionCodes + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def externalRectangleCode (c b d g h : ZFSet.{u}) : ZFSet.{u} := + ZFSet.pair c (ZFSet.pair b (ZFSet.pair d (ZFSet.pair g h))) + +noncomputable def externalRectangleBound (P G : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod P (ZFSet.prod P (ZFSet.prod P (ZFSet.prod G G))) + +def ExternalRectangleCode (P G r μ A c b d g h : ZFSet.{u}) : Prop := + c ∈ P ∧ b ∈ P ∧ d ∈ P ∧ g ∈ G ∧ h ∈ G ∧ + ZFSet.pair c d ∈ r ∧ ZFSet.pair b d ∈ r ∧ + ∃ w ∈ P, ZFSet.pair (ZFSet.pair c b) w ∈ μ ∧ ActionAgreementBelow P r A g h w ∧ + ∀ y ∈ P, ∀ z ∈ P, ∀ v ∈ P, + (ZFSet.pair (ZFSet.pair g d) y ∈ A ∧ ZFSet.pair (ZFSet.pair h d) z ∈ A ∧ + ZFSet.pair (ZFSet.pair g w) v ∈ A) → ZFSet.pair (ZFSet.pair y z) v ∈ μ + +noncomputable def externalRectangles (P G r μ A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun t => ∃ c ∈ P, ∃ b ∈ P, ∃ d ∈ P, ∃ g ∈ G, ∃ h ∈ G, + t = externalRectangleCode c b d g h ∧ ExternalRectangleCode P G r μ A c b d g h) + (externalRectangleBound P G) + +theorem externalRectangleCode_inj {c b d g h c' b' d' g' h' : ZFSet.{u}} : + externalRectangleCode c b d g h = externalRectangleCode c' b' d' g' h' ↔ + c = c' ∧ b = b' ∧ d = d' ∧ g = g' ∧ h = h' := by + simp only [externalRectangleCode, ZFSet.pair_inj] + +theorem externalRectangleCode_mem_bound (P G c b d g h : ZFSet.{u}) : + externalRectangleCode c b d g h ∈ externalRectangleBound P G ↔ + c ∈ P ∧ b ∈ P ∧ d ∈ P ∧ g ∈ G ∧ h ∈ G := by + simp only [externalRectangleCode, externalRectangleBound, ZFSet.pair_mem_prod] + +theorem mem_externalRectangles (P G r μ A t : ZFSet.{u}) : + t ∈ externalRectangles P G r μ A ↔ ∃ c b d g h, + t = externalRectangleCode c b d g h ∧ ExternalRectangleCode P G r μ A c b d g h := by + rw [externalRectangles, ZFSet.mem_sep] + constructor + · rintro ⟨_, c, _, b, _, d, _, g, _, h, _, eq, code⟩ + exact ⟨c, b, d, g, h, eq, code⟩ + · rintro ⟨c, b, d, g, h, rfl, code⟩ + exact ⟨(externalRectangleCode_mem_bound P G c b d g h).2 + ⟨code.1, code.2.1, code.2.2.1, code.2.2.2.1, code.2.2.2.2.1⟩, + c, code.1, b, code.2.1, d, code.2.2.1, g, code.2.2.2.1, h, code.2.2.2.2.1, rfl, code⟩ + +theorem externalRectangleCode_mem (P G r μ A c b d g h : ZFSet.{u}) : + externalRectangleCode c b d g h ∈ externalRectangles P G r μ A ↔ + ExternalRectangleCode P G r μ A c b d g h := by + rw [mem_externalRectangles] + constructor + · rintro ⟨c', b', d', g', h', equal, code⟩ + obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := externalRectangleCode_inj.1 equal + exact code + · intro code + exact ⟨c, b, d, g, h, rfl, code⟩ + +namespace BoundedFormula +open SetFormula + +def actionAgreementBelowFormula {n} (P r A g h w : Fin n) : BoundedFormula n := + .allMem P (.allMem P.succ (imp (pairMembershipFormula 1 w.succ.succ r.succ.succ) + (.conj (imp (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ) + (tripleMembershipFormula h.succ.succ 1 0 A.succ.succ)) + (imp (tripleMembershipFormula h.succ.succ 1 0 A.succ.succ) + (tripleMembershipFormula g.succ.succ 1 0 A.succ.succ))))) + +theorem truth_actionAgreementBelowFormula {n} (P r A g h w : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (actionAgreementBelowFormula P r A g h w) env ↔ + ActionAgreementBelow (env P) (env r) (env A) (env g) (env h) (env w) := by + simp only [actionAgreementBelowFormula, ActionAgreementBelow, Truth, truth_imp, iff_def, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + constructor <;> exact fun h => h + +def rectangleSeparatedFormula {n} (P μ A d w g h : Fin n) : BoundedFormula n := + .allMem P (.allMem P.succ (.allMem P.succ.succ + (imp (.conj (tripleMembershipFormula g.succ.succ.succ d.succ.succ.succ 2 A.succ.succ.succ) + (.conj (tripleMembershipFormula h.succ.succ.succ d.succ.succ.succ 1 A.succ.succ.succ) + (tripleMembershipFormula g.succ.succ.succ w.succ.succ.succ 0 A.succ.succ.succ))) + (tripleMembershipFormula 2 1 0 μ.succ.succ.succ)))) + +def externalRectangleFormula {n} (P G r μ A c b d g h : Fin n) : BoundedFormula n := + .conj (.mem c P) (.conj (.mem b P) (.conj (.mem d P) (.conj (.mem g G) (.conj (.mem h G) + (.conj (pairMembershipFormula c d r) (.conj (pairMembershipFormula b d r) + (exMem P (.conj (tripleMembershipFormula c.succ b.succ 0 μ.succ) + (.conj (actionAgreementBelowFormula P.succ r.succ A.succ g.succ h.succ 0) + (rectangleSeparatedFormula P.succ μ.succ A.succ d.succ 0 g.succ h.succ)))))))))) + +theorem truth_externalRectangleFormula {n} (P G r μ A c b d g h : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (externalRectangleFormula P G r μ A c b d g h) env ↔ + ExternalRectangleCode (env P) (env G) (env r) (env μ) (env A) + (env c) (env b) (env d) (env g) (env h) := by + simp only [externalRectangleFormula, ExternalRectangleCode, rectangleSeparatedFormula, + Truth, truth_exMem, truth_imp, truth_actionAgreementBelowFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula] + rfl + +def externalRectangleTupleFormula {n} (t c b d g h : Fin n) : BoundedFormula n := + nonemptyTupleFormula 4 t + (Fin.cases c (Fin.cases b (Fin.cases d (Fin.cases g (Fin.cases h Fin.elim0))))) + +theorem truth_externalRectangleTupleFormula {n} (t c b d g h : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (externalRectangleTupleFormula t c b d g h) env ↔ + env t = externalRectangleCode (env c) (env b) (env d) (env g) (env h) := by + rw [externalRectangleTupleFormula, truth_nonemptyTupleFormula] + rfl + +def externalRectanglesEntryFormula {n} (t P G r μ A : Fin n) : BoundedFormula n := + exMem P (exMem P.succ (exMem P.succ.succ (exMem G.succ.succ.succ + (exMem G.succ.succ.succ.succ + (.conj (externalRectangleTupleFormula t.succ.succ.succ.succ.succ 4 3 2 1 0) + (externalRectangleFormula P.succ.succ.succ.succ.succ G.succ.succ.succ.succ.succ + r.succ.succ.succ.succ.succ μ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ + 4 3 2 1 0)))))) + +theorem truth_externalRectanglesEntryFormula {n} (t P G r μ A : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (externalRectanglesEntryFormula t P G r μ A) env ↔ + ∃ c ∈ env P, ∃ b ∈ env P, ∃ d ∈ env P, ∃ g ∈ env G, ∃ h ∈ env G, + env t = externalRectangleCode c b d g h ∧ + ExternalRectangleCode (env P) (env G) (env r) (env μ) (env A) c b d g h := by + simp only [externalRectanglesEntryFormula, truth_exMem, Truth, + truth_externalRectangleTupleFormula, truth_externalRectangleFormula] + rfl + +end BoundedFormula + + + + + +def CompressionActorCode + (P G Q H R B e a Sources Reps top Caps i k : ZFSet.{u}) : Prop := + (∀ s ∈ P, ∀ g ∈ G, ∀ g' ∈ H, ∀ s' ∈ Q, + ZFSet.pair i s ∈ Sources → ZFSet.pair i g ∈ Reps → + ZFSet.pair g g' ∈ a → ZFSet.pair s s' ∈ e → + ActionAgreementBelow Q R B k g' s') ∧ + ∀ top' ∈ Q, ∀ v ∈ Q, ZFSet.pair top top' ∈ e → + (ZFSet.pair (ZFSet.pair k top') v ∈ B ↔ ZFSet.pair i v ∈ Caps) + +def CompressionActorFulfillmentCode + (I P G Q H R B e a Sources Reps top Caps : ZFSet.{u}) : Prop := + ∀ i ∈ I, ∃ k ∈ H, CompressionActorCode P G Q H R B e a Sources Reps top Caps i k + +namespace BoundedFormula + +def compressionActorFormula {n} + (P G Q H R B e a Sources Reps top Caps i k : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ.succ.succ + .conj + (.allMem P (.allMem G.succ (.allMem H.succ.succ (.allMem Q.succ.succ.succ + (imp (pairMembershipFormula (lift i) 3 (lift Sources)) + (imp (pairMembershipFormula (lift i) 2 (lift Reps)) + (imp (pairMembershipFormula 2 1 (lift a)) + (imp (pairMembershipFormula 3 0 (lift e)) + (actionAgreementBelowFormula (lift Q) (lift R) (lift B) (lift k) 1 0))))))))) + (.allMem Q (.allMem Q.succ + (imp (pairMembershipFormula top.succ.succ 1 e.succ.succ) + (.conj + (imp (tripleMembershipFormula k.succ.succ 1 0 B.succ.succ) + (pairMembershipFormula i.succ.succ 0 Caps.succ.succ)) + (imp (pairMembershipFormula i.succ.succ 0 Caps.succ.succ) + (tripleMembershipFormula k.succ.succ 1 0 B.succ.succ)))))) + +theorem truth_compressionActorFormula {n} + (P G Q H R B e a Sources Reps top Caps i k : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (compressionActorFormula P G Q H R B e a Sources Reps top Caps i k) env ↔ + CompressionActorCode (env P) (env G) (env Q) (env H) (env R) (env B) + (env e) (env a) (env Sources) (env Reps) (env top) (env Caps) (env i) (env k) := by + simp only [compressionActorFormula, CompressionActorCode, Truth, truth_imp, + truth_pairMembershipFormula, truth_tripleMembershipFormula, + truth_actionAgreementBelowFormula, iff_def] + constructor <;> exact fun h => h + +def compressionActorFulfillmentFormula {n} + (I P G Q H R B e a Sources Reps top Caps : Fin n) : BoundedFormula n := + .allMem I (.exMem H.succ + (compressionActorFormula P.succ.succ G.succ.succ Q.succ.succ H.succ.succ + R.succ.succ B.succ.succ e.succ.succ a.succ.succ Sources.succ.succ + Reps.succ.succ top.succ.succ Caps.succ.succ 1 0)) + +theorem truth_compressionActorFulfillmentFormula {n} + (I P G Q H R B e a Sources Reps top Caps : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (compressionActorFulfillmentFormula I P G Q H R B e a Sources Reps top Caps) env ↔ + CompressionActorFulfillmentCode (env I) (env P) (env G) (env Q) (env H) (env R) + (env B) (env e) (env a) (env Sources) (env Reps) (env top) (env Caps) := by + simp only [compressionActorFulfillmentFormula, Truth, truth_exMem, truth_compressionActorFormula] + rfl + +theorem realize_compressionActorFulfillmentFormula (M : TransitiveGround.{u}) {n} + (I P G Q H R B e a Sources Reps top Caps : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + SetFormula.Realize M.sets + (compressionActorFulfillmentFormula I P G Q H R B e a Sources Reps top Caps).toFormula env ↔ + CompressionActorFulfillmentCode (env I) (env P) (env G) (env Q) (env H) (env R) + (env B) (env e) (env a) (env Sources) (env Reps) (env top) (env Caps) := + (realize_toFormula M _ env members).trans + (truth_compressionActorFulfillmentFormula I P G Q H R B e a Sources Reps top Caps env) + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u +variable {P G r μ A m inv one c b d g h : ZFSet.{u}} +variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) +variable (meet : MeetOrderCode P r μ) + +noncomputable def ExternalRectangleCode.toActionRectangle + (code : ExternalRectangleCode P G r μ A c b d g h) : + Compression.RecursiveMaps.ActionRectangle meet.toMeetOrder (action.toMeetIso group meet) := by + obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code + let w := Classical.choose witness + have mw := (Classical.choose_spec witness).2.1 + have agree := (Classical.choose_spec witness).2.2.1 + have separated := (Classical.choose_spec witness).2.2.2 + let C := (⟨c, hc⟩ : {x : ZFSet.{u} // x ∈ P}) + let B := (⟨b, hb⟩ : {x : ZFSet.{u} // x ∈ P}) + let D := (⟨d, hd⟩ : {x : ZFSet.{u} // x ∈ P}) + let first := (⟨g, hg⟩ : {x : ZFSet.{u} // x ∈ G}) + let second := (⟨h, hh⟩ : {x : ZFSet.{u} // x ∈ G}) + have meetValue : (meet.toMeetOrder.meet C B).val = w := + (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique + (meet.toMeetOrder_meet_entry C B) mw + refine { + C := C + B := B + D := D + first := first + second := second + C_le_D := cd + B_le_D := bd + agree := ?_ + separated := ?_ } + · intro x lower + apply Subtype.ext + have lowerW : ZFSet.pair x.val w ∈ r := meetValue ▸ lower + exact agree.entry_eq action hh x.property lowerW + (action.toMeetIso_entry group meet first x) + (action.toMeetIso_entry group meet second x) + · apply Subtype.ext + let y := (action.toMeetIso group meet first).toFun D + let z := (action.toMeetIso group meet second).toFun D + let v := (action.toMeetIso group meet first).toFun (meet.toMeetOrder.meet C B) + have actMeet : ZFSet.pair (ZFSet.pair g w) v.val ∈ A := by + rw [← meetValue] + exact action.toMeetIso_entry group meet first (meet.toMeetOrder.meet C B) + have value := separated y.val y.property z.val z.property v.val v.property + ⟨action.toMeetIso_entry group meet first D, action.toMeetIso_entry group meet second D, actMeet⟩ + exact (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique + (meet.toMeetOrder_meet_entry y z) value + +theorem ExternalRectangleCode.toActionRectangle_fields + (code : ExternalRectangleCode P G r μ A c b d g h) : + let request := code.toActionRectangle group action meet + request.C.val = c ∧ request.B.val = b ∧ request.D.val = d ∧ + request.first.val = g ∧ request.second.val = h := by + obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code + exact ⟨rfl, rfl, rfl, rfl, rfl⟩ + +theorem externalRectangleCode_of_actionRectangle + (request : Compression.RecursiveMaps.ActionRectangle meet.toMeetOrder (action.toMeetIso group meet)) : + ExternalRectangleCode P G r μ A request.C.val request.B.val request.D.val + request.first.val request.second.val := by + refine ⟨request.C.property, request.B.property, request.D.property, + request.first.property, request.second.property, request.C_le_D, request.B_le_D, + (meet.toMeetOrder.meet request.C request.B).val, + (meet.toMeetOrder.meet request.C request.B).property, + meet.toMeetOrder_meet_entry request.C request.B, ?_, ?_⟩ + · intro x hx y hy lower + have same := request.agree ⟨x, hx⟩ lower + rw [← action.toMeetIso_eq_iff group meet request.first ⟨x, hx⟩ ⟨y, hy⟩, + ← action.toMeetIso_eq_iff group meet request.second ⟨x, hx⟩ ⟨y, hy⟩] + exact ⟨fun entry => same.symm.trans entry, fun entry => same.trans entry⟩ + · intro y hy z hz v hv entries + have first := (action.toMeetIso_eq_iff group meet request.first request.D ⟨y, hy⟩).2 entries.1 + have second := (action.toMeetIso_eq_iff group meet request.second request.D ⟨z, hz⟩).2 entries.2.1 + have meetImage := (action.toMeetIso_eq_iff group meet request.first + (meet.toMeetOrder.meet request.C request.B) ⟨v, hv⟩).2 entries.2.2 + have same : meet.toMeetOrder.meet ⟨y, hy⟩ ⟨z, hz⟩ = ⟨v, hv⟩ := by + rw [← first, ← second, request.separated] + exact meetImage + have entry := meet.toMeetOrder_meet_entry ⟨y, hy⟩ ⟨z, hz⟩ + rw [same] at entry + exact entry + +theorem actionRectangle_mem_externalRectangles + (request : Compression.RecursiveMaps.ActionRectangle meet.toMeetOrder (action.toMeetIso group meet)) : + externalRectangleCode request.C.val request.B.val request.D.val request.first.val request.second.val ∈ + externalRectangles P G r μ A := + (externalRectangleCode_mem _ _ _ _ _ _ _ _ _ _).2 + (externalRectangleCode_of_actionRectangle group action meet request) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +def RectangleIdealCode (Q H R B e a c b g h k l : ZFSet.{u}) : Prop := + (∀ c' ∈ Q, ∀ g' ∈ H, ∀ h' ∈ H, + ZFSet.pair c c' ∈ e → ZFSet.pair g g' ∈ a → ZFSet.pair h h' ∈ a → + ActionAgreementBelow Q R B k g' c' ∧ ActionAgreementBelow Q R B l h' c') ∧ + ∀ b' ∈ Q, ZFSet.pair b b' ∈ e → ActionAgreementBelow Q R B k l b' + +def RectangleRootMeetCode (P μ A Q ν B e c d g k : ZFSet.{u}) : Prop := + ∀ x ∈ P, ∀ v ∈ P, ∀ w ∈ P, ∀ d' ∈ Q, ∀ x' ∈ Q, ∀ w' ∈ Q, ∀ y ∈ Q, + ZFSet.pair (ZFSet.pair g c) v ∈ A → ZFSet.pair (ZFSet.pair v x) w ∈ μ → + ZFSet.pair d d' ∈ e → ZFSet.pair x x' ∈ e → ZFSet.pair w w' ∈ e → + ZFSet.pair (ZFSet.pair k d') y ∈ B → ZFSet.pair (ZFSet.pair y x') w' ∈ ν + +def RectangleCrossMeetCode (Q ν B e b d k l : ZFSet.{u}) : Prop := + ∀ b' ∈ Q, ∀ d' ∈ Q, ∀ y ∈ Q, ∀ v ∈ Q, ∀ z ∈ Q, + ZFSet.pair b b' ∈ e → ZFSet.pair d d' ∈ e → + ZFSet.pair (ZFSet.pair k d') y ∈ B → ZFSet.pair (ZFSet.pair l d') v ∈ B → + ZFSet.pair (ZFSet.pair k b') z ∈ B → + ZFSet.pair (ZFSet.pair y v) z ∈ ν ∧ ZFSet.pair (ZFSet.pair l b') z ∈ B + +def RectangleActorPairCode (P μ A Q H R ν B e a c b d g h k l : ZFSet.{u}) : Prop := + RectangleIdealCode Q H R B e a c b g h k l ∧ + RectangleRootMeetCode P μ A Q ν B e c d g k ∧ + RectangleRootMeetCode P μ A Q ν B e c d h l ∧ + RectangleCrossMeetCode Q ν B e b d k l + +def RectangleFulfillmentCode (P G r μ A Q H R ν B e a : ZFSet.{u}) : Prop := + ∀ c ∈ P, ∀ b ∈ P, ∀ d ∈ P, ∀ g ∈ G, ∀ h ∈ G, + ExternalRectangleCode P G r μ A c b d g h → + ∃ k ∈ H, ∃ l ∈ H, RectangleActorPairCode P μ A Q H R ν B e a c b d g h k l + +namespace BoundedFormula + +def rectangleIdealFormula {n} (Q H R B e a c b g h k l : Fin n) : BoundedFormula n := + (.conj (.allMem Q (.allMem H.succ (.allMem H.succ.succ (imp (pairMembershipFormula c.succ.succ.succ 2 e.succ.succ.succ) (imp (pairMembershipFormula g.succ.succ.succ 1 a.succ.succ.succ) (imp (pairMembershipFormula h.succ.succ.succ 0 a.succ.succ.succ) (.conj (actionAgreementBelowFormula Q.succ.succ.succ R.succ.succ.succ B.succ.succ.succ k.succ.succ.succ 1 2) (actionAgreementBelowFormula Q.succ.succ.succ R.succ.succ.succ B.succ.succ.succ l.succ.succ.succ 0 2)))))))) (.allMem Q (imp (pairMembershipFormula b.succ 0 e.succ) (actionAgreementBelowFormula Q.succ R.succ B.succ k.succ l.succ 0)))) + +theorem truth_rectangleIdealFormula {n} (Q H R B e a c b g h k l : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rectangleIdealFormula Q H R B e a c b g h k l) env ↔ RectangleIdealCode (env Q) (env H) (env R) (env B) (env e) (env a) (env c) (env b) (env g) (env h) (env k) (env l) := by + simp only [rectangleIdealFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_actionAgreementBelowFormula] + rfl + +def rectangleRootMeetFormula {n} (P μ A Q ν B e c d g k : Fin n) : BoundedFormula n := + (.allMem P (.allMem P.succ (.allMem P.succ.succ (.allMem Q.succ.succ.succ (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ.succ (imp (tripleMembershipFormula g.succ.succ.succ.succ.succ.succ.succ c.succ.succ.succ.succ.succ.succ.succ 5 A.succ.succ.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula 5 6 4 μ.succ.succ.succ.succ.succ.succ.succ) (imp (pairMembershipFormula d.succ.succ.succ.succ.succ.succ.succ 3 e.succ.succ.succ.succ.succ.succ.succ) (imp (pairMembershipFormula 6 2 e.succ.succ.succ.succ.succ.succ.succ) (imp (pairMembershipFormula 4 1 e.succ.succ.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ.succ.succ 3 0 B.succ.succ.succ.succ.succ.succ.succ) (tripleMembershipFormula 0 2 1 ν.succ.succ.succ.succ.succ.succ.succ)))))))))))))) + +theorem truth_rectangleRootMeetFormula {n} (P μ A Q ν B e c d g k : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rectangleRootMeetFormula P μ A Q ν B e c d g k) env ↔ RectangleRootMeetCode (env P) (env μ) (env A) (env Q) (env ν) (env B) (env e) (env c) (env d) (env g) (env k) := by + simp only [rectangleRootMeetFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_tripleMembershipFormula] + rfl + +def rectangleCrossMeetFormula {n} (Q ν B e b d k l : Fin n) : BoundedFormula n := + (.allMem Q (.allMem Q.succ (.allMem Q.succ.succ (.allMem Q.succ.succ.succ (.allMem Q.succ.succ.succ.succ (imp (pairMembershipFormula b.succ.succ.succ.succ.succ 4 e.succ.succ.succ.succ.succ) (imp (pairMembershipFormula d.succ.succ.succ.succ.succ 3 e.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ 3 2 B.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula l.succ.succ.succ.succ.succ 3 1 B.succ.succ.succ.succ.succ) (imp (tripleMembershipFormula k.succ.succ.succ.succ.succ 4 0 B.succ.succ.succ.succ.succ) (.conj (tripleMembershipFormula 2 1 0 ν.succ.succ.succ.succ.succ) (tripleMembershipFormula l.succ.succ.succ.succ.succ 4 0 B.succ.succ.succ.succ.succ)))))))))))) + +theorem truth_rectangleCrossMeetFormula {n} (Q ν B e b d k l : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rectangleCrossMeetFormula Q ν B e b d k l) env ↔ RectangleCrossMeetCode (env Q) (env ν) (env B) (env e) (env b) (env d) (env k) (env l) := by + simp only [rectangleCrossMeetFormula, Truth, truth_imp, truth_pairMembershipFormula, + truth_tripleMembershipFormula] + rfl + +def rectangleActorPairFormula {n} (P μ A Q H R ν B e a c b d g h k l : Fin n) : BoundedFormula n := + (.conj (rectangleIdealFormula Q H R B e a c b g h k l) (.conj (rectangleRootMeetFormula P μ A Q ν B e c d g k) (.conj (rectangleRootMeetFormula P μ A Q ν B e c d h l) (rectangleCrossMeetFormula Q ν B e b d k l)))) + +theorem truth_rectangleActorPairFormula {n} (P μ A Q H R ν B e a c b d g h k l : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rectangleActorPairFormula P μ A Q H R ν B e a c b d g h k l) env ↔ RectangleActorPairCode (env P) (env μ) (env A) (env Q) (env H) (env R) (env ν) (env B) (env e) (env a) (env c) (env b) (env d) (env g) (env h) (env k) (env l) := by + simp only [rectangleActorPairFormula, Truth, truth_rectangleIdealFormula, + truth_rectangleRootMeetFormula, truth_rectangleCrossMeetFormula] + rfl + +def rectangleFulfillmentFormula {n} (P G r μ A Q H R ν B e a : Fin n) : BoundedFormula n := + (.allMem P (.allMem P.succ (.allMem P.succ.succ (.allMem G.succ.succ.succ (.allMem G.succ.succ.succ.succ (imp (externalRectangleFormula P.succ.succ.succ.succ.succ G.succ.succ.succ.succ.succ r.succ.succ.succ.succ.succ μ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ 4 3 2 1 0) (.exMem H.succ.succ.succ.succ.succ (.exMem H.succ.succ.succ.succ.succ.succ (rectangleActorPairFormula P.succ.succ.succ.succ.succ.succ.succ μ.succ.succ.succ.succ.succ.succ.succ A.succ.succ.succ.succ.succ.succ.succ Q.succ.succ.succ.succ.succ.succ.succ H.succ.succ.succ.succ.succ.succ.succ R.succ.succ.succ.succ.succ.succ.succ ν.succ.succ.succ.succ.succ.succ.succ B.succ.succ.succ.succ.succ.succ.succ e.succ.succ.succ.succ.succ.succ.succ a.succ.succ.succ.succ.succ.succ.succ 6 5 4 3 2 1 0))))))))) + +theorem truth_rectangleFulfillmentFormula {n} (P G r μ A Q H R ν B e a : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rectangleFulfillmentFormula P G r μ A Q H R ν B e a) env ↔ RectangleFulfillmentCode (env P) (env G) (env r) (env μ) (env A) (env Q) (env H) (env R) (env ν) (env B) (env e) (env a) := by + simp only [rectangleFulfillmentFormula, Truth, truth_imp, truth_exMem, + truth_externalRectangleFormula, truth_rectangleActorPairFormula] + rfl + +theorem realize_rectangleFulfillmentFormula (M : TransitiveGround.{u}) {n} + (P G r μ A Q H R ν B e a : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + SetFormula.Realize M.sets (rectangleFulfillmentFormula P G r μ A Q H R ν B e a).toFormula env ↔ + RectangleFulfillmentCode (env P) (env G) (env r) (env μ) (env A) (env Q) (env H) + (env R) (env ν) (env B) (env e) (env a) := + (realize_toFormula M _ env members).trans (truth_rectangleFulfillmentFormula P G r μ A Q H R ν B e a env) + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem choose_compressionActorFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I P G Q H R B e a Sources Reps top Caps : ZFSet.{u}} + (hI : I ∈ M.sets) (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hQ : Q ∈ M.sets) + (hH : H ∈ M.sets) (hR : R ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) + (ha : a ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hTop : top ∈ M.sets) (hCaps : Caps ∈ M.sets) + (total : CompressionActorFulfillmentCode I P G Q H R B e a Sources Reps top Caps) : + ∃ f ∈ M.sets, ZFSet.IsFunc I H f ∧ + ∀ i k, ZFSet.pair i k ∈ f → CompressionActorCode P G Q H R B e a Sources Reps top Caps i k := by + let params : Fin 12 → ZFSet.{u} := extend P (extend G (extend Q (extend H (extend R (extend B + (extend e (extend a (extend Sources (extend Reps (extend top (extend Caps Fin.elim0))))))))))) + have members : ∀ j, params j ∈ M.sets := Fin.cases hP (Fin.cases hG (Fin.cases hQ (Fin.cases hH + (Fin.cases hR (Fin.cases hB (Fin.cases he (Fin.cases ha (Fin.cases hSources + (Fin.cases hReps (Fin.cases hTop (Fin.cases hCaps (fun j => Fin.elim0 j)))))))))))) + let φ : SetFormula 14 := (BoundedFormula.compressionActorFormula 2 3 4 5 6 7 8 9 10 11 12 13 0 1).toFormula + let relation := M.definableRelation φ params I H + have ground : relation ∈ M.sets := M.definableRelation_mem pairing unions powers separation φ params members hI hH + have exactCode (i k : ZFSet.{u}) (hi : i ∈ I) (hk : k ∈ H) : + Realize M.sets φ (extend i (extend k params)) ↔ + CompressionActorCode P G Q H R B e a Sources Reps top Caps i k := + (BoundedFormula.realize_toFormula M _ _ + (Fin.cases (M.transitive hI hi) (Fin.cases (M.transitive hH hk) members))).trans + (BoundedFormula.truth_compressionActorFormula 2 3 4 5 6 7 8 9 10 11 12 13 0 1 _) + obtain ⟨f, hf, function, included⟩ := M.uniformize_relation pairing unions powers separation choice hI hH ground (by + intro i hi + obtain ⟨k, hk, code⟩ := total i hi + exact ⟨k, hk, (M.pair_mem_definableRelation φ params I H i k).2 ⟨hi, hk, (exactCode i k hi hk).2 code⟩⟩) + refine ⟨f, hf, function, ?_⟩ + intro i k entry + obtain ⟨hi, hk, realized⟩ := (M.pair_mem_definableRelation φ params I H i k).1 (included entry) + exact (exactCode i k hi hk).1 realized + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +universe u + +structure RectangleAtBoundCode (P r μ A c b d g h X k l : ZFSet.{u}) : Prop where + first_agreement : ActionAgreementBelow P r A k g c + second_agreement : ActionAgreementBelow P r A l h c + common_agreement : ActionAgreementBelow P r A k l b + values : ∃ v ∈ P, ∃ w ∈ P, ∃ y ∈ P, ∃ z ∈ P, ∃ t ∈ P, + ZFSet.pair (ZFSet.pair g c) v ∈ A ∧ ZFSet.pair (ZFSet.pair h c) w ∈ A ∧ + ZFSet.pair (ZFSet.pair k d) y ∈ A ∧ ZFSet.pair (ZFSet.pair l d) z ∈ A ∧ + ZFSet.pair (ZFSet.pair k b) t ∈ A ∧ ZFSet.pair (ZFSet.pair l b) t ∈ A ∧ + ZFSet.pair (ZFSet.pair y X) v ∈ μ ∧ ZFSet.pair (ZFSet.pair z X) w ∈ μ ∧ + ZFSet.pair (ZFSet.pair y z) t ∈ μ + +theorem MeetOrderCode.meet_entry_of_lower {P r μ x y : ZFSet.{u}} + (meet : MeetOrderCode P r μ) (hx : x ∈ P) (hy : y ∈ P) + (lower : ZFSet.pair x y ∈ r) : ZFSet.pair (ZFSet.pair x y) x ∈ μ := by + obtain ⟨z, entry, _⟩ := meet.operation.2 (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + have hz := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 + have equal : z = x := meet.order.antisymm z hz x hx (meet.lower_left x y z entry) + (meet.greatest x y z x hx entry (meet.order.refl x hx) lower) + exact equal ▸ entry + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundMainTransition +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {source target : GroundMainStage M C D rD} +variable (transition : GroundMainTransition source target) + +theorem rectangle_at_bound + (fulfills : RectangleFulfillmentCode source.carrier source.actors source.order + source.meetGraph source.action target.carrier target.actors target.order target.meetGraph + target.action transition.points transition.actors) + {c b d g h X c' b' d' g' h' X' : ZFSet.{u}} + (rectangle : ExternalRectangleCode source.carrier source.actors source.order + source.meetGraph source.action c b d g h) (hX : X ∈ source.carrier) + (firstUpper : ∀ y ∈ source.carrier, ZFSet.pair (ZFSet.pair g d) y ∈ source.action → + ZFSet.pair y X ∈ source.order) + (secondUpper : ∀ y ∈ source.carrier, ZFSet.pair (ZFSet.pair h d) y ∈ source.action → + ZFSet.pair y X ∈ source.order) + (imageC : ZFSet.pair c c' ∈ transition.points) + (imageB : ZFSet.pair b b' ∈ transition.points) + (imageD : ZFSet.pair d d' ∈ transition.points) + (imageX : ZFSet.pair X X' ∈ transition.points) + (imageG : ZFSet.pair g g' ∈ transition.actors) + (imageH : ZFSet.pair h h' ∈ transition.actors) : + ∃ k ∈ target.actors, ∃ l ∈ target.actors, + RectangleAtBoundCode target.carrier target.order target.meetGraph target.action + c' b' d' g' h' X' k l := by + have rectangleData := rectangle + obtain ⟨hc, hb, hd, hg, hh, cd, _, _⟩ := rectangleData + obtain ⟨k, hk, l, hl, ideals, rootG, rootH, cross⟩ := fulfills c hc b hb d hd g hg h hh rectangle + have hc' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageC)).2 + have hb' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageB)).2 + have hd' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageD)).2 + have hX' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 imageX)).2 + have hg' := (ZFSet.pair_mem_prod.1 (transition.group_embedding.injection.function.1 imageG)).2 + have hh' := (ZFSet.pair_mem_prod.1 (transition.group_embedding.injection.function.1 imageH)).2 + obtain ⟨v, gv, _⟩ := source.action_code.function.2 (ZFSet.pair g c) (ZFSet.pair_mem_prod.2 ⟨hg, hc⟩) + obtain ⟨w, hwAction, _⟩ := source.action_code.function.2 (ZFSet.pair h c) (ZFSet.pair_mem_prod.2 ⟨hh, hc⟩) + obtain ⟨gd, gD, _⟩ := source.action_code.function.2 (ZFSet.pair g d) (ZFSet.pair_mem_prod.2 ⟨hg, hd⟩) + obtain ⟨hdv, hD, _⟩ := source.action_code.function.2 (ZFSet.pair h d) (ZFSet.pair_mem_prod.2 ⟨hh, hd⟩) + have hv := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 gv)).2 + have hw := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 hwAction)).2 + have hgd := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 gD)).2 + have hhd := (ZFSet.pair_mem_prod.1 (source.action_code.function.1 hD)).2 + have vX := source.meet.order.trans v hv gd hgd X hX + (source.action_code.monotone g hg c hc d hd v hv gd hgd gv gD cd) (firstUpper gd hgd gD) + have wX := source.meet.order.trans w hw hdv hhd X hX + (source.action_code.monotone h hh c hc d hd w hw hdv hhd hwAction hD cd) (secondUpper hdv hhd hD) + have meetV := source.meet.meet_entry_of_lower hv hX vX + have meetW := source.meet.meet_entry_of_lower hw hX wX + obtain ⟨v', vv', _⟩ := transition.point_embedding.injection.function.2 v hv + obtain ⟨w', ww', _⟩ := transition.point_embedding.injection.function.2 w hw + have hv' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 vv')).2 + have hw' := (ZFSet.pair_mem_prod.1 (transition.point_embedding.injection.function.1 ww')).2 + obtain ⟨y, ky, _⟩ := target.action_code.function.2 (ZFSet.pair k d') (ZFSet.pair_mem_prod.2 ⟨hk, hd'⟩) + obtain ⟨z, lz, _⟩ := target.action_code.function.2 (ZFSet.pair l d') (ZFSet.pair_mem_prod.2 ⟨hl, hd'⟩) + obtain ⟨t, kt, _⟩ := target.action_code.function.2 (ZFSet.pair k b') (ZFSet.pair_mem_prod.2 ⟨hk, hb'⟩) + have hy := (ZFSet.pair_mem_prod.1 (target.action_code.function.1 ky)).2 + have hz := (ZFSet.pair_mem_prod.1 (target.action_code.function.1 lz)).2 + have ht := (ZFSet.pair_mem_prod.1 (target.action_code.function.1 kt)).2 + have agree := ideals.1 c' hc' g' hg' h' hh' imageC imageG imageH + have meets := cross b' hb' d' hd' y hy z hz t ht imageB imageD ky lz kt + refine ⟨k, hk, l, hl, agree.1, agree.2, ideals.2 b' hb' imageB, + v', hv', w', hw', y, hy, z, hz, t, ht, ?_, ?_, ky, lz, kt, meets.2, ?_, ?_, meets.1⟩ + · exact transition.equivariant g g' c v c' v' imageG imageC vv' gv + · exact transition.equivariant h h' c w c' w' imageH imageC ww' hwAction + · exact rootG X hX v hv v hv d' hd' X' hX' v' hv' y hy gv meetV imageD imageX vv' ky + · exact rootH X hX w hw w hw d' hd' X' hX' w' hw' z hz hwAction meetW imageD imageX ww' lz + +end PartitionPilot.Forcing.GroundMainTransition + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleTile.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleTile.lean index cdfa6f173334ead795e5c23fd09f355a00554263..1cb220190815068ad2a5b5fc704b836d4fcf09e6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleTile.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RectangleTile.lean @@ -1,298 +1,298 @@ -import OAI.SetTheory.PartitionPrinciple.Models.CopyQuotient - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.Rectangle - -universe u - -inductive Vertex where - | root | one | two - deriving DecidableEq - -instance : Countable Vertex := by - apply Function.Injective.countable - (f := fun v => match v with | .root => (0 : Nat) | .one => 1 | .two => 2) - intro x y eq - cases x <;> cases y <;> simp_all - -structure Input {A : Type u} (P : MeetOrder A) where - top : A - greatest : ∀ x, P.le x top - C : A - B : A - D : A - C_le_D : P.le C D - B_le_D : P.le B D - g1 : MeetIso P P - g2 : MeetIso P P - agree : ∀ x, P.le x (P.meet C B) → g1.toFun x = g2.toFun x - separated : P.meet (g1.toFun D) (g2.toFun D) = g1.toFun (P.meet C B) - -namespace Input - -variable {A : Type u} {P : MeetOrder A} (r : Input P) - -def W : A := P.meet r.C r.B - -theorem agree_W : r.g1.toFun r.W = r.g2.toFun r.W := r.agree r.W (P.refl r.W) - -theorem root_intersection : P.meet (r.g1.toFun r.C) (r.g2.toFun r.C) = r.g1.toFun r.W := by - apply P.antisymm - · have separated : P.meet (r.g1.toFun r.D) (r.g2.toFun r.D) = r.g1.toFun r.W := r.separated - rw [← separated] - exact P.le_meet - (P.trans (P.meet_le_left _ _) ((r.g1.le_iff _ _).mpr r.C_le_D)) - (P.trans (P.meet_le_right _ _) ((r.g2.le_iff _ _).mpr r.C_le_D)) - · apply P.le_meet - · exact (r.g1.le_iff _ _).mpr (P.meet_le_left _ _) - · rw [r.agree_W] - exact (r.g2.le_iff _ _).mpr (P.meet_le_left _ _) - -private theorem image_bound (f g : MeetIso P P) - (intersection : P.meet (f.toFun r.C) (g.toFun r.C) = f.toFun r.W) - (x : A) (hx : P.le x r.C) : P.le (f.toFun x) (g.toFun r.C) ↔ P.le x r.B := by - constructor - · intro h - have lower := P.le_meet ((f.le_iff _ _).mpr hx) h - rw [intersection] at lower - exact P.trans ((f.le_iff _ _).mp lower) (P.meet_le_right _ _) - · intro h - have lower : P.le (f.toFun x) (f.toFun r.W) := (f.le_iff _ _).mpr (P.le_meet hx h) - rw [← intersection] at lower - exact P.trans lower (P.meet_le_right _ _) - -theorem g1_bound (x : A) (hx : P.le x r.C) : - P.le (r.g1.toFun x) (r.g2.toFun r.C) ↔ P.le x r.B := - r.image_bound r.g1 r.g2 r.root_intersection x hx - -theorem g2_bound (x : A) (hx : P.le x r.C) : - P.le (r.g2.toFun x) (r.g1.toFun r.C) ↔ P.le x r.B := by - apply r.image_bound r.g2 r.g1 - rw [meet_comm, r.root_intersection, r.agree_W] - exact hx - -theorem inverse1_C (x : A) (hx : P.le x (r.g1.toFun r.C)) : P.le (r.g1.inverse x) r.C := by - apply (r.g1.le_iff _ _).mp - rw [r.g1.right_inverse] - exact hx - -theorem inverse2_C (x : A) (hx : P.le x (r.g2.toFun r.C)) : P.le (r.g2.inverse x) r.C := by - apply (r.g2.le_iff _ _).mp - rw [r.g2.right_inverse] - exact hx - -theorem root_domain1 (x : A) (hx : P.le x (r.g1.toFun r.C)) : - P.le (r.g1.inverse x) r.B ↔ P.le x (r.g2.toFun r.C) := by - have h := (r.g1_bound (r.g1.inverse x) (r.inverse1_C x hx)).symm - rw [r.g1.right_inverse] at h - exact h - -theorem root_domain2 (x : A) (hx : P.le x (r.g2.toFun r.C)) : - P.le (r.g2.inverse x) r.B ↔ P.le x (r.g1.toFun r.C) := by - have h := (r.g2_bound (r.g2.inverse x) (r.inverse2_C x hx)).symm - rw [r.g2.right_inverse] at h - exact h - -theorem inverses_agree (x : A) (h1 : P.le x (r.g1.toFun r.C)) - (h2 : P.le x (r.g2.toFun r.C)) : r.g1.inverse x = r.g2.inverse x := by - have hx : P.le (r.g1.inverse x) r.W := - P.le_meet (r.inverse1_C x h1) ((r.root_domain1 x h1).mpr h2) - have eq : r.g2.toFun (r.g1.inverse x) = x := - (r.agree _ hx).symm.trans (r.g1.right_inverse x) - have inv := congrArg r.g2.inverse eq - rw [r.g2.left_inverse] at inv - exact inv - -def anchor : Vertex → Vertex → A - | .root, .root => r.top - | .one, .one => r.top - | .two, .two => r.top - | .root, .one => r.g1.toFun r.C - | .one, .root => r.C - | .root, .two => r.g2.toFun r.C - | .two, .root => r.C - | .one, .two => r.B - | .two, .one => r.B - -def transition : Vertex → Vertex → MeetIso P P - | .root, .one => inverseIso r.g1 - | .one, .root => r.g1 - | .root, .two => inverseIso r.g2 - | .two, .root => r.g2 - | _, _ => identityIso P - -theorem triangle_domain (i j k : Vertex) (ij : i ≠ j) (jk : j ≠ k) (ik : i ≠ k) - (x : A) (hx : P.le x (r.anchor i j)) : - P.le ((r.transition i j).toFun x) (r.anchor j k) ↔ P.le x (r.anchor i k) := by - cases i <;> cases j <;> cases k <;> try contradiction - · exact r.root_domain1 x hx - · exact r.root_domain2 x hx - · exact r.g1_bound x hx - · exact Iff.rfl - · exact r.g2_bound x hx - · exact Iff.rfl - -theorem triangle_change (i j k : Vertex) (ij : i ≠ j) (jk : j ≠ k) (ik : i ≠ k) - (x : A) (hx : P.le x (r.anchor i j)) (hy : P.le x (r.anchor i k)) : - (r.transition j k).toFun ((r.transition i j).toFun x) = (r.transition i k).toFun x := by - cases i <;> cases j <;> cases k <;> try contradiction - · exact r.inverses_agree x hx hy - · exact (r.inverses_agree x hy hx).symm - · change r.g2.inverse (r.g1.toFun x) = x - rw [r.agree x (P.le_meet hx hy), r.g2.left_inverse] - · exact (r.agree x (P.le_meet hy hx)).symm - · change r.g1.inverse (r.g2.toFun x) = x - rw [← r.agree x (P.le_meet hx hy), r.g1.left_inverse] - · exact r.agree x (P.le_meet hy hx) - -def copies : CompatibleCopies.Data P Vertex where - top := r.top - greatest := r.greatest - anchor := r.anchor - change := r.transition - self_anchor := by intro i; cases i <;> rfl - self_change := by intro i x; cases i <;> rfl - reverse := by - intro i j x - cases i <;> cases j - · rfl - · exact r.g1.right_inverse x - · exact r.g2.right_inverse x - · exact r.g1.left_inverse x - · rfl - · rfl - · exact r.g2.left_inverse x - · rfl - · rfl - anchor_change := by - intro i j - cases i <;> cases j - · rfl - · exact r.g1.left_inverse r.C - · exact r.g2.left_inverse r.C - · rfl - · rfl - · rfl - · rfl - · rfl - · rfl - triangle_domain := r.triangle_domain - triangle_change := r.triangle_change - -end Input -end PartitionPilot.Compression.RecursiveMaps.Rectangle - -end - -section - -namespace PartitionPilot.Compression.RecursiveMaps.Rectangle.Input - -universe u - -variable {A : Type u} {P : MeetOrder A} (r : Input P) - -noncomputable def root : MeetEmbedding P r.copies.order := r.copies.vertex .root -noncomputable def first : MeetEmbedding P r.copies.order := r.copies.vertex .one -noncomputable def second : MeetEmbedding P r.copies.order := r.copies.vertex .two - -theorem first_agrees (x : A) (below : P.le x r.C) : - r.first.toFun x = r.root.toFun (r.g1.toFun x) := - (r.copies.exact_overlap .one .root x (r.g1.toFun x)).mpr ⟨below, rfl⟩ - -theorem second_agrees (x : A) (below : P.le x r.C) : - r.second.toFun x = r.root.toFun (r.g2.toFun x) := - (r.copies.exact_overlap .two .root x (r.g2.toFun x)).mpr ⟨below, rfl⟩ - -theorem children_agree (x : A) (below : P.le x r.B) : - r.first.toFun x = r.second.toFun x := - (r.copies.exact_overlap .one .two x x).mpr ⟨below, rfl⟩ - -theorem first_root_intersection (x y : A) : - r.first.toFun x = r.root.toFun y ↔ P.le x r.C ∧ r.g1.toFun x = y := - r.copies.exact_overlap .one .root x y - -theorem second_root_intersection (x y : A) : - r.second.toFun x = r.root.toFun y ↔ P.le x r.C ∧ r.g2.toFun x = y := - r.copies.exact_overlap .two .root x y - -theorem children_intersection (x y : A) : - r.first.toFun x = r.second.toFun y ↔ P.le x r.B ∧ x = y := - r.copies.exact_overlap .one .two x y - -theorem meet_D_C : P.meet r.D r.C = r.C := - P.antisymm (P.meet_le_right _ _) (P.le_meet r.C_le_D (P.refl _)) - -theorem meet_D_B : P.meet r.D r.B = r.B := - P.antisymm (P.meet_le_right _ _) (P.le_meet r.B_le_D (P.refl _)) - -theorem first_root_part : r.copies.projection .root (r.first.toFun r.D) = r.g1.toFun r.C := by - change r.g1.toFun (P.meet r.D r.C) = r.g1.toFun r.C - rw [r.meet_D_C] - -theorem second_root_part : r.copies.projection .root (r.second.toFun r.D) = r.g2.toFun r.C := by - change r.g2.toFun (P.meet r.D r.C) = r.g2.toFun r.C - rw [r.meet_D_C] - -theorem first_meet_root (x : A) : - r.copies.order.meet (r.first.toFun r.D) (r.root.toFun x) = - r.root.toFun (P.meet (r.g1.toFun r.C) x) := by - rw [meet_comm r.copies.order] - have eq := r.copies.cross_meet .root .one x r.D - change r.copies.order.meet (r.root.toFun x) (r.first.toFun r.D) = - r.root.toFun (P.meet x (r.g1.toFun (P.meet r.D r.C))) at eq - rw [r.meet_D_C, meet_comm P x] at eq - exact eq - -theorem second_meet_root (x : A) : - r.copies.order.meet (r.second.toFun r.D) (r.root.toFun x) = - r.root.toFun (P.meet (r.g2.toFun r.C) x) := by - rw [meet_comm r.copies.order] - have eq := r.copies.cross_meet .root .two x r.D - change r.copies.order.meet (r.root.toFun x) (r.second.toFun r.D) = - r.root.toFun (P.meet x (r.g2.toFun (P.meet r.D r.C))) at eq - rw [r.meet_D_C, meet_comm P x] at eq - exact eq - -theorem children_meet : - r.copies.order.meet (r.first.toFun r.D) (r.second.toFun r.D) = r.first.toFun r.B := by - have eq := r.copies.cross_meet .one .two r.D r.D - change r.copies.order.meet (r.first.toFun r.D) (r.second.toFun r.D) = - r.first.toFun (P.meet r.D (P.meet r.D r.B)) at eq - rw [r.meet_D_B, r.meet_D_B] at eq - exact eq - -theorem children_meet_both : - r.copies.order.meet (r.first.toFun r.D) (r.second.toFun r.D) = r.first.toFun r.B ∧ - r.first.toFun r.B = r.second.toFun r.B := - ⟨r.children_meet, r.children_agree r.B (P.refl _)⟩ - -theorem three_vertex_cover (x : r.copies.Node) : - ∃ i y, (r.copies.vertex i).toFun y = x := r.copies.cover x - -open Chronological in - -noncomputable def incoming_layer {O Stage : Type u} [LinearOrder Stage] {Q : MeetOrder O} - (g : PrincipalAmalgamation.Input Q r.copies.order) - (Space : Stage → Type u) (order : ∀ t, MeetOrder (Space t)) - (oldBirth : O → Stage) (s t : Stage) (old : ∀ a, oldBirth a < s) (earlier : t < s) - (template : MeetIso (order t) P) : - GrowthLayer Space order g.order (g.birth oldBirth s) s := by - apply g.incoming_layer Space order oldBirth s old (ULift.{u} Vertex) - (fun _ => t) (fun _ => earlier) - (fun i => compose template.toMeetEmbedding (r.copies.vertex i.down)) - intro x - rcases r.three_vertex_cover x with ⟨i, y, eq⟩ - refine ⟨⟨i⟩, template.inverse y, ?_⟩ - change (r.copies.vertex i).toFun (template.toFun (template.inverse y)) = x - rw [template.right_inverse] - exact eq - -end PartitionPilot.Compression.RecursiveMaps.Rectangle.Input - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.CopyQuotient + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.Rectangle + +universe u + +inductive Vertex where + | root | one | two + deriving DecidableEq + +instance : Countable Vertex := by + apply Function.Injective.countable + (f := fun v => match v with | .root => (0 : Nat) | .one => 1 | .two => 2) + intro x y eq + cases x <;> cases y <;> simp_all + +structure Input {A : Type u} (P : MeetOrder A) where + top : A + greatest : ∀ x, P.le x top + C : A + B : A + D : A + C_le_D : P.le C D + B_le_D : P.le B D + g1 : MeetIso P P + g2 : MeetIso P P + agree : ∀ x, P.le x (P.meet C B) → g1.toFun x = g2.toFun x + separated : P.meet (g1.toFun D) (g2.toFun D) = g1.toFun (P.meet C B) + +namespace Input + +variable {A : Type u} {P : MeetOrder A} (r : Input P) + +def W : A := P.meet r.C r.B + +theorem agree_W : r.g1.toFun r.W = r.g2.toFun r.W := r.agree r.W (P.refl r.W) + +theorem root_intersection : P.meet (r.g1.toFun r.C) (r.g2.toFun r.C) = r.g1.toFun r.W := by + apply P.antisymm + · have separated : P.meet (r.g1.toFun r.D) (r.g2.toFun r.D) = r.g1.toFun r.W := r.separated + rw [← separated] + exact P.le_meet + (P.trans (P.meet_le_left _ _) ((r.g1.le_iff _ _).mpr r.C_le_D)) + (P.trans (P.meet_le_right _ _) ((r.g2.le_iff _ _).mpr r.C_le_D)) + · apply P.le_meet + · exact (r.g1.le_iff _ _).mpr (P.meet_le_left _ _) + · rw [r.agree_W] + exact (r.g2.le_iff _ _).mpr (P.meet_le_left _ _) + +private theorem image_bound (f g : MeetIso P P) + (intersection : P.meet (f.toFun r.C) (g.toFun r.C) = f.toFun r.W) + (x : A) (hx : P.le x r.C) : P.le (f.toFun x) (g.toFun r.C) ↔ P.le x r.B := by + constructor + · intro h + have lower := P.le_meet ((f.le_iff _ _).mpr hx) h + rw [intersection] at lower + exact P.trans ((f.le_iff _ _).mp lower) (P.meet_le_right _ _) + · intro h + have lower : P.le (f.toFun x) (f.toFun r.W) := (f.le_iff _ _).mpr (P.le_meet hx h) + rw [← intersection] at lower + exact P.trans lower (P.meet_le_right _ _) + +theorem g1_bound (x : A) (hx : P.le x r.C) : + P.le (r.g1.toFun x) (r.g2.toFun r.C) ↔ P.le x r.B := + r.image_bound r.g1 r.g2 r.root_intersection x hx + +theorem g2_bound (x : A) (hx : P.le x r.C) : + P.le (r.g2.toFun x) (r.g1.toFun r.C) ↔ P.le x r.B := by + apply r.image_bound r.g2 r.g1 + rw [meet_comm, r.root_intersection, r.agree_W] + exact hx + +theorem inverse1_C (x : A) (hx : P.le x (r.g1.toFun r.C)) : P.le (r.g1.inverse x) r.C := by + apply (r.g1.le_iff _ _).mp + rw [r.g1.right_inverse] + exact hx + +theorem inverse2_C (x : A) (hx : P.le x (r.g2.toFun r.C)) : P.le (r.g2.inverse x) r.C := by + apply (r.g2.le_iff _ _).mp + rw [r.g2.right_inverse] + exact hx + +theorem root_domain1 (x : A) (hx : P.le x (r.g1.toFun r.C)) : + P.le (r.g1.inverse x) r.B ↔ P.le x (r.g2.toFun r.C) := by + have h := (r.g1_bound (r.g1.inverse x) (r.inverse1_C x hx)).symm + rw [r.g1.right_inverse] at h + exact h + +theorem root_domain2 (x : A) (hx : P.le x (r.g2.toFun r.C)) : + P.le (r.g2.inverse x) r.B ↔ P.le x (r.g1.toFun r.C) := by + have h := (r.g2_bound (r.g2.inverse x) (r.inverse2_C x hx)).symm + rw [r.g2.right_inverse] at h + exact h + +theorem inverses_agree (x : A) (h1 : P.le x (r.g1.toFun r.C)) + (h2 : P.le x (r.g2.toFun r.C)) : r.g1.inverse x = r.g2.inverse x := by + have hx : P.le (r.g1.inverse x) r.W := + P.le_meet (r.inverse1_C x h1) ((r.root_domain1 x h1).mpr h2) + have eq : r.g2.toFun (r.g1.inverse x) = x := + (r.agree _ hx).symm.trans (r.g1.right_inverse x) + have inv := congrArg r.g2.inverse eq + rw [r.g2.left_inverse] at inv + exact inv + +def anchor : Vertex → Vertex → A + | .root, .root => r.top + | .one, .one => r.top + | .two, .two => r.top + | .root, .one => r.g1.toFun r.C + | .one, .root => r.C + | .root, .two => r.g2.toFun r.C + | .two, .root => r.C + | .one, .two => r.B + | .two, .one => r.B + +def transition : Vertex → Vertex → MeetIso P P + | .root, .one => inverseIso r.g1 + | .one, .root => r.g1 + | .root, .two => inverseIso r.g2 + | .two, .root => r.g2 + | _, _ => identityIso P + +theorem triangle_domain (i j k : Vertex) (ij : i ≠ j) (jk : j ≠ k) (ik : i ≠ k) + (x : A) (hx : P.le x (r.anchor i j)) : + P.le ((r.transition i j).toFun x) (r.anchor j k) ↔ P.le x (r.anchor i k) := by + cases i <;> cases j <;> cases k <;> try contradiction + · exact r.root_domain1 x hx + · exact r.root_domain2 x hx + · exact r.g1_bound x hx + · exact Iff.rfl + · exact r.g2_bound x hx + · exact Iff.rfl + +theorem triangle_change (i j k : Vertex) (ij : i ≠ j) (jk : j ≠ k) (ik : i ≠ k) + (x : A) (hx : P.le x (r.anchor i j)) (hy : P.le x (r.anchor i k)) : + (r.transition j k).toFun ((r.transition i j).toFun x) = (r.transition i k).toFun x := by + cases i <;> cases j <;> cases k <;> try contradiction + · exact r.inverses_agree x hx hy + · exact (r.inverses_agree x hy hx).symm + · change r.g2.inverse (r.g1.toFun x) = x + rw [r.agree x (P.le_meet hx hy), r.g2.left_inverse] + · exact (r.agree x (P.le_meet hy hx)).symm + · change r.g1.inverse (r.g2.toFun x) = x + rw [← r.agree x (P.le_meet hx hy), r.g1.left_inverse] + · exact r.agree x (P.le_meet hy hx) + +def copies : CompatibleCopies.Data P Vertex where + top := r.top + greatest := r.greatest + anchor := r.anchor + change := r.transition + self_anchor := by intro i; cases i <;> rfl + self_change := by intro i x; cases i <;> rfl + reverse := by + intro i j x + cases i <;> cases j + · rfl + · exact r.g1.right_inverse x + · exact r.g2.right_inverse x + · exact r.g1.left_inverse x + · rfl + · rfl + · exact r.g2.left_inverse x + · rfl + · rfl + anchor_change := by + intro i j + cases i <;> cases j + · rfl + · exact r.g1.left_inverse r.C + · exact r.g2.left_inverse r.C + · rfl + · rfl + · rfl + · rfl + · rfl + · rfl + triangle_domain := r.triangle_domain + triangle_change := r.triangle_change + +end Input +end PartitionPilot.Compression.RecursiveMaps.Rectangle + +end + +section + +namespace PartitionPilot.Compression.RecursiveMaps.Rectangle.Input + +universe u + +variable {A : Type u} {P : MeetOrder A} (r : Input P) + +noncomputable def root : MeetEmbedding P r.copies.order := r.copies.vertex .root +noncomputable def first : MeetEmbedding P r.copies.order := r.copies.vertex .one +noncomputable def second : MeetEmbedding P r.copies.order := r.copies.vertex .two + +theorem first_agrees (x : A) (below : P.le x r.C) : + r.first.toFun x = r.root.toFun (r.g1.toFun x) := + (r.copies.exact_overlap .one .root x (r.g1.toFun x)).mpr ⟨below, rfl⟩ + +theorem second_agrees (x : A) (below : P.le x r.C) : + r.second.toFun x = r.root.toFun (r.g2.toFun x) := + (r.copies.exact_overlap .two .root x (r.g2.toFun x)).mpr ⟨below, rfl⟩ + +theorem children_agree (x : A) (below : P.le x r.B) : + r.first.toFun x = r.second.toFun x := + (r.copies.exact_overlap .one .two x x).mpr ⟨below, rfl⟩ + +theorem first_root_intersection (x y : A) : + r.first.toFun x = r.root.toFun y ↔ P.le x r.C ∧ r.g1.toFun x = y := + r.copies.exact_overlap .one .root x y + +theorem second_root_intersection (x y : A) : + r.second.toFun x = r.root.toFun y ↔ P.le x r.C ∧ r.g2.toFun x = y := + r.copies.exact_overlap .two .root x y + +theorem children_intersection (x y : A) : + r.first.toFun x = r.second.toFun y ↔ P.le x r.B ∧ x = y := + r.copies.exact_overlap .one .two x y + +theorem meet_D_C : P.meet r.D r.C = r.C := + P.antisymm (P.meet_le_right _ _) (P.le_meet r.C_le_D (P.refl _)) + +theorem meet_D_B : P.meet r.D r.B = r.B := + P.antisymm (P.meet_le_right _ _) (P.le_meet r.B_le_D (P.refl _)) + +theorem first_root_part : r.copies.projection .root (r.first.toFun r.D) = r.g1.toFun r.C := by + change r.g1.toFun (P.meet r.D r.C) = r.g1.toFun r.C + rw [r.meet_D_C] + +theorem second_root_part : r.copies.projection .root (r.second.toFun r.D) = r.g2.toFun r.C := by + change r.g2.toFun (P.meet r.D r.C) = r.g2.toFun r.C + rw [r.meet_D_C] + +theorem first_meet_root (x : A) : + r.copies.order.meet (r.first.toFun r.D) (r.root.toFun x) = + r.root.toFun (P.meet (r.g1.toFun r.C) x) := by + rw [meet_comm r.copies.order] + have eq := r.copies.cross_meet .root .one x r.D + change r.copies.order.meet (r.root.toFun x) (r.first.toFun r.D) = + r.root.toFun (P.meet x (r.g1.toFun (P.meet r.D r.C))) at eq + rw [r.meet_D_C, meet_comm P x] at eq + exact eq + +theorem second_meet_root (x : A) : + r.copies.order.meet (r.second.toFun r.D) (r.root.toFun x) = + r.root.toFun (P.meet (r.g2.toFun r.C) x) := by + rw [meet_comm r.copies.order] + have eq := r.copies.cross_meet .root .two x r.D + change r.copies.order.meet (r.root.toFun x) (r.second.toFun r.D) = + r.root.toFun (P.meet x (r.g2.toFun (P.meet r.D r.C))) at eq + rw [r.meet_D_C, meet_comm P x] at eq + exact eq + +theorem children_meet : + r.copies.order.meet (r.first.toFun r.D) (r.second.toFun r.D) = r.first.toFun r.B := by + have eq := r.copies.cross_meet .one .two r.D r.D + change r.copies.order.meet (r.first.toFun r.D) (r.second.toFun r.D) = + r.first.toFun (P.meet r.D (P.meet r.D r.B)) at eq + rw [r.meet_D_B, r.meet_D_B] at eq + exact eq + +theorem children_meet_both : + r.copies.order.meet (r.first.toFun r.D) (r.second.toFun r.D) = r.first.toFun r.B ∧ + r.first.toFun r.B = r.second.toFun r.B := + ⟨r.children_meet, r.children_agree r.B (P.refl _)⟩ + +theorem three_vertex_cover (x : r.copies.Node) : + ∃ i y, (r.copies.vertex i).toFun y = x := r.copies.cover x + +open Chronological in + +noncomputable def incoming_layer {O Stage : Type u} [LinearOrder Stage] {Q : MeetOrder O} + (g : PrincipalAmalgamation.Input Q r.copies.order) + (Space : Stage → Type u) (order : ∀ t, MeetOrder (Space t)) + (oldBirth : O → Stage) (s t : Stage) (old : ∀ a, oldBirth a < s) (earlier : t < s) + (template : MeetIso (order t) P) : + GrowthLayer Space order g.order (g.birth oldBirth s) s := by + apply g.incoming_layer Space order oldBirth s old (ULift.{u} Vertex) + (fun _ => t) (fun _ => earlier) + (fun i => compose template.toMeetEmbedding (r.copies.vertex i.down)) + intro x + rcases r.three_vertex_cover x with ⟨i, y, eq⟩ + refine ⟨⟨i⟩, template.inverse y, ?_⟩ + change (r.copies.vertex i).toFun (template.toFun (template.inverse y)) = x + rw [template.right_inverse] + exact eq + +end PartitionPilot.Compression.RecursiveMaps.Rectangle.Input + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementIndexThreeLevels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementIndexThreeLevels.lean index 29fcd7a74d454bc2dfeb693f6ff04ab074027ff8..36b3e9fa5cf771732f43676b2f2412b962e525bd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementIndexThreeLevels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementIndexThreeLevels.lean @@ -1,99 +1,99 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoIndexAnchors - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -namespace RefinementIndexLevelCode -variable {I level B : ZFSet.{u}} - -theorem level_field_graph (code : RefinementIndexLevelCode I level) (bound : level ∈ B) : - refinementIndexFieldGraph I B 0 = ZFSet.prod I {level} := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hz).1) - obtain ⟨hx, _, v, eqv, hy⟩ := (pair_mem_refinementIndexFieldGraph I B x y 0).1 hz - obtain ⟨w, eqw, hw⟩ := code x hx - have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) - exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_singleton.2 - (hy.trans ((congrFun equal 0).trans hw))⟩ - · intro hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - have same := ZFSet.mem_singleton.1 hy - obtain ⟨v, eqv, hv⟩ := code x hx - exact (pair_mem_refinementIndexFieldGraph I B x y 0).2 - ⟨hx, same.symm ▸ bound, v, eqv, same.trans hv.symm⟩ - -theorem level_field_function (code : RefinementIndexLevelCode I level) (bound : level ∈ B) : - ZFSet.IsFunc I B (refinementIndexFieldGraph I B 0) := by - apply refinementIndexFieldGraph_function - intro x hx - obtain ⟨v, equal, hv⟩ := code x hx - exact ⟨v, equal, hv.symm ▸ bound⟩ - -end RefinementIndexLevelCode - -theorem refinementIndexFieldGraph_function_union {I J B : ZFSet.{u}} (j : Fin 6) - (first : ZFSet.IsFunc I B (refinementIndexFieldGraph I B j)) - (second : ZFSet.IsFunc J B (refinementIndexFieldGraph J B j)) : - ZFSet.IsFunc (I ∪ J) B (refinementIndexFieldGraph (I ∪ J) B j) := by - apply refinementIndexFieldGraph_function - intro x hx - rcases ZFSet.mem_union.1 hx with hi | hj - · obtain ⟨y, entry, _⟩ := first.2 x hi - obtain ⟨_, hy, v, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph I B x y j).1 entry - exact ⟨v, ex, ey ▸ hy⟩ - · obtain ⟨y, entry, _⟩ := second.2 x hj - obtain ⟨_, hy, v, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph J B x y j).1 entry - exact ⟨v, ex, ey ▸ hy⟩ - -namespace RefinementIndexLevelCode -variable {I0 I1 I2 : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) -include first second third - -theorem three_level_function : - ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) (natSetCode 3) - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) := - refinementIndexFieldGraph_function_union 0 - (refinementIndexFieldGraph_function_union 0 - (first.level_field_function ((natSetCode_mem_iff 0 3).2 (by decide))) - (second.level_field_function ((natSetCode_mem_iff 1 3).2 (by decide)))) - (third.level_field_function ((natSetCode_mem_iff 2 3).2 (by decide))) - -theorem three_level_graph : - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 = - (ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1}) ∪ - ZFSet.prod I2 {natSetCode 2} := by - rw [refinementIndexFieldGraph_union, refinementIndexFieldGraph_union, - first.level_field_graph ((natSetCode_mem_iff 0 3).2 (by decide)), - second.level_field_graph ((natSetCode_mem_iff 1 3).2 (by decide)), - third.level_field_graph ((natSetCode_mem_iff 2 3).2 (by decide))] - -theorem three_level_entry (x level : ZFSet.{u}) : - ZFSet.pair x level ∈ refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ↔ - (x ∈ I0 ∧ level = ∅) ∨ (x ∈ I1 ∧ level = natSetCode 1) ∨ - (x ∈ I2 ∧ level = natSetCode 2) := by - rw [first.three_level_graph second third] - simp only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton, or_assoc] - -theorem three_levels_disjoint : - (∀ x, ¬ (x ∈ I0 ∧ x ∈ I1)) ∧ (∀ x, ¬ (x ∈ I0 ∧ x ∈ I2)) ∧ - (∀ x, ¬ (x ∈ I1 ∧ x ∈ I2)) := by - exact ⟨first.disjoint second (fun h => (by decide : (0 : Nat) ≠ 1) (natSetCode_injective h)), - first.disjoint third (fun h => (by decide : (0 : Nat) ≠ 2) (natSetCode_injective h)), - second.disjoint third (fun h => (by decide : (1 : Nat) ≠ 2) (natSetCode_injective h))⟩ - -end RefinementIndexLevelCode -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageTwoIndexAnchors + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +namespace RefinementIndexLevelCode +variable {I level B : ZFSet.{u}} + +theorem level_field_graph (code : RefinementIndexLevelCode I level) (bound : level ∈ B) : + refinementIndexFieldGraph I B 0 = ZFSet.prod I {level} := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hz).1) + obtain ⟨hx, _, v, eqv, hy⟩ := (pair_mem_refinementIndexFieldGraph I B x y 0).1 hz + obtain ⟨w, eqw, hw⟩ := code x hx + have equal := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) + exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_singleton.2 + (hy.trans ((congrFun equal 0).trans hw))⟩ + · intro hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + have same := ZFSet.mem_singleton.1 hy + obtain ⟨v, eqv, hv⟩ := code x hx + exact (pair_mem_refinementIndexFieldGraph I B x y 0).2 + ⟨hx, same.symm ▸ bound, v, eqv, same.trans hv.symm⟩ + +theorem level_field_function (code : RefinementIndexLevelCode I level) (bound : level ∈ B) : + ZFSet.IsFunc I B (refinementIndexFieldGraph I B 0) := by + apply refinementIndexFieldGraph_function + intro x hx + obtain ⟨v, equal, hv⟩ := code x hx + exact ⟨v, equal, hv.symm ▸ bound⟩ + +end RefinementIndexLevelCode + +theorem refinementIndexFieldGraph_function_union {I J B : ZFSet.{u}} (j : Fin 6) + (first : ZFSet.IsFunc I B (refinementIndexFieldGraph I B j)) + (second : ZFSet.IsFunc J B (refinementIndexFieldGraph J B j)) : + ZFSet.IsFunc (I ∪ J) B (refinementIndexFieldGraph (I ∪ J) B j) := by + apply refinementIndexFieldGraph_function + intro x hx + rcases ZFSet.mem_union.1 hx with hi | hj + · obtain ⟨y, entry, _⟩ := first.2 x hi + obtain ⟨_, hy, v, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph I B x y j).1 entry + exact ⟨v, ex, ey ▸ hy⟩ + · obtain ⟨y, entry, _⟩ := second.2 x hj + obtain ⟨_, hy, v, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph J B x y j).1 entry + exact ⟨v, ex, ey ▸ hy⟩ + +namespace RefinementIndexLevelCode +variable {I0 I1 I2 : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) +include first second third + +theorem three_level_function : + ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) (natSetCode 3) + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) := + refinementIndexFieldGraph_function_union 0 + (refinementIndexFieldGraph_function_union 0 + (first.level_field_function ((natSetCode_mem_iff 0 3).2 (by decide))) + (second.level_field_function ((natSetCode_mem_iff 1 3).2 (by decide)))) + (third.level_field_function ((natSetCode_mem_iff 2 3).2 (by decide))) + +theorem three_level_graph : + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 = + (ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1}) ∪ + ZFSet.prod I2 {natSetCode 2} := by + rw [refinementIndexFieldGraph_union, refinementIndexFieldGraph_union, + first.level_field_graph ((natSetCode_mem_iff 0 3).2 (by decide)), + second.level_field_graph ((natSetCode_mem_iff 1 3).2 (by decide)), + third.level_field_graph ((natSetCode_mem_iff 2 3).2 (by decide))] + +theorem three_level_entry (x level : ZFSet.{u}) : + ZFSet.pair x level ∈ refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ↔ + (x ∈ I0 ∧ level = ∅) ∨ (x ∈ I1 ∧ level = natSetCode 1) ∨ + (x ∈ I2 ∧ level = natSetCode 2) := by + rw [first.three_level_graph second third] + simp only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton, or_assoc] + +theorem three_levels_disjoint : + (∀ x, ¬ (x ∈ I0 ∧ x ∈ I1)) ∧ (∀ x, ¬ (x ∈ I0 ∧ x ∈ I2)) ∧ + (∀ x, ¬ (x ∈ I1 ∧ x ∈ I2)) := by + exact ⟨first.disjoint second (fun h => (by decide : (0 : Nat) ≠ 1) (natSetCode_injective h)), + first.disjoint third (fun h => (by decide : (0 : Nat) ≠ 2) (natSetCode_injective h)), + second.disjoint third (fun h => (by decide : (1 : Nat) ≠ 2) (natSetCode_injective h))⟩ + +end RefinementIndexLevelCode +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeTestGuards.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeTestGuards.lean index c0622aae260b2959223a4f3aa95a5ab03ce1f4df..3b9ff92d9afdac34fcb3906b38508baa90720646 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeTestGuards.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeTestGuards.lean @@ -1,55 +1,55 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFourFlatStageHistories - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -variable {I0 I1 T2 : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -variable (third : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) (natSetCode 2)) -include first second third - -theorem refinementLevelTests_stageThreeSplice (Aq Ap : ZFSet.{u}) (p : P) : - let I2 := M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2 - (assignmentSplice (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) Aq Ap) p ↔ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2 Ap p := by - apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid - a b d base directed system - intro t ht u _ w _ - exact stageThreeAssignmentSplice_upper_iff first second third Aq Ap ht - -theorem refinementLevelTests_stageThreeOld {A : ZFSet.{u}} (p : P) - (subsetOld : A ⊆ stageOneAssignments (I0 ∪ I1) T) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2 A p := by - apply M.refinementLevelTests_of_no_assignments s pairing unions powers separation collection carrier order - hT valid a b d base directed system - intro t ht u _ w _ - exact stageThreeAssignment_old_no_upper first second third subsetOld ht - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFourFlatStageHistories + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +variable {I0 I1 T2 : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +variable (third : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) (natSetCode 2)) +include first second third + +theorem refinementLevelTests_stageThreeSplice (Aq Ap : ZFSet.{u}) (p : P) : + let I2 := M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2 + (assignmentSplice (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) Aq Ap) p ↔ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2 Ap p := by + apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid + a b d base directed system + intro t ht u _ w _ + exact stageThreeAssignmentSplice_upper_iff first second third Aq Ap ht + +theorem refinementLevelTests_stageThreeOld {A : ZFSet.{u}} (p : P) + (subsetOld : A ⊆ stageOneAssignments (I0 ∪ I1) T) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2 A p := by + apply M.refinementLevelTests_of_no_assignments s pairing unions powers separation collection carrier order + hT valid a b d base directed system + intro t ht u _ w _ + exact stageThreeAssignment_old_no_upper first second third subsetOld ht + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeUnionGuards.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeUnionGuards.lean index fd30c9fd0ee8034af4426582d851b61fe73ee2d5..a1a914b6517ec57de5dc84f362f0d2f700bc17c3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeUnionGuards.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementLevelThreeUnionGuards.lean @@ -1,47 +1,47 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFourFlatStageHistories - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -variable {I0 I1 T2 : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -variable (third : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) (natSetCode 2)) -include first second third - -theorem refinementLevelTests_stageThreeUnion (Aold Anew : ZFSet.{u}) (p : P) - (lower : Aold ⊆ stageOneAssignments (I0 ∪ I1) T) : - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2 (Aold ∪ Anew) p ↔ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2 Anew p := by - apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid - a b d base directed system - intro t ht u _ w _ - rw [ZFSet.mem_union] - have absent := stageThreeAssignment_old_no_upper first second third lower (u := u) (w := w) ht - exact ⟨fun h => h.elim (fun impossible => False.elim (absent impossible)) id, Or.inr⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundFourFlatStageHistories + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +variable {I0 I1 T2 : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +variable (third : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) (natSetCode 2)) +include first second third + +theorem refinementLevelTests_stageThreeUnion (Aold Anew : ZFSet.{u}) (p : P) + (lower : Aold ⊆ stageOneAssignments (I0 ∪ I1) T) : + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2 (Aold ∪ Anew) p ↔ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2 Anew p := by + apply M.refinementLevelTests_congr s pairing unions powers separation collection carrier order hT valid + a b d base directed system + intro t ht u _ w _ + rw [ZFSet.mem_union] + have absent := stageThreeAssignment_old_no_upper first second third lower (u := u) (w := w) ht + exact ⟨fun h => h.elim (fun impossible => False.elim (absent impossible)) id, Or.inr⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementValidityReindex.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementValidityReindex.lean index 04b221f4f28694d9f2f97b87aeb1a933dc48ba48..83f5294fc806602203464c001cc34a5c410264fc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementValidityReindex.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RefinementValidityReindex.lean @@ -1,34 +1,34 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem refinementValidity_empty (T : ZFSet.{u}) : - RefinementValidityCode T ∅ ∅ ∅ := by - have relation : EquivalenceRelationCode (∅ : ZFSet.{u}) ∅ := - ⟨by simp, by simp, by simp, by simp⟩ - exact ⟨by simp, relation, relation, fun _ h => h⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_refinementValidityFormula_reindex {n : Nat} - (f : Fin 4 → Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i : Fin 4, env (f i) ∈ M.sets) : - Realize M.sets (reindex f BoundedFormula.refinementValidityFormula.toFormula) env ↔ - RefinementValidityCode (env (f 3)) (env (f 0)) (env (f 1)) (env (f 2)) := by - rw [realize_reindex] - exact M.realize_refinementValidityFormula (fun i => env (f i)) members - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem refinementValidity_empty (T : ZFSet.{u}) : + RefinementValidityCode T ∅ ∅ ∅ := by + have relation : EquivalenceRelationCode (∅ : ZFSet.{u}) ∅ := + ⟨by simp, by simp, by simp, by simp⟩ + exact ⟨by simp, relation, relation, fun _ h => h⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_refinementValidityFormula_reindex {n : Nat} + (f : Fin 4 → Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i : Fin 4, env (f i) ∈ M.sets) : + Realize M.sets (reindex f BoundedFormula.refinementValidityFormula.toFormula) env ↔ + RefinementValidityCode (env (f 3)) (env (f 0)) (env (f 1)) (env (f 2)) := by + rw [realize_reindex] + exact M.realize_refinementValidityFormula (fun i => env (f i)) members + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RepresentativeIndexSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RepresentativeIndexSteps.lean index ebac4cd3c894315f14ffa7cb7c89a580280e0639..1c19b33c4fbc1330a334d4c892af81daf167c8b4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RepresentativeIndexSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RepresentativeIndexSteps.lean @@ -1,472 +1,472 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceAssignmentClassFamilies - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def assignmentIndices (I T A : ZFSet.{u}) : ZFSet.{u} := - relationImage A I (productFirst I (ZFSet.prod T T)) - -noncomputable def assignmentOnIndices (B T A : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ stageOneAssignments B T) A - -theorem mem_assignmentIndices (I T A t : ZFSet.{u}) : - t ∈ assignmentIndices I T A ↔ - t ∈ I ∧ ∃ u ∈ T, ∃ w ∈ T, stageOneAssignment t u w ∈ A := by - rw [assignmentIndices, mem_relationImage] - constructor - · rintro ⟨ht, z, hz, entry⟩ - obtain ⟨i, _, rest, hr, equal⟩ := (mem_productFirst I (ZFSet.prod T T) _).1 entry - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨u, hu, w, hw, rfl⟩ := ZFSet.mem_prod.1 hr - exact ⟨ht, u, hu, w, hw, hz⟩ - · rintro ⟨ht, u, hu, w, hw, member⟩ - exact ⟨ht, stageOneAssignment t u w, member, - (mem_productFirst I (ZFSet.prod T T) _).2 - ⟨t, ht, ZFSet.pair u w, ZFSet.pair_mem_prod.2 ⟨hu, hw⟩, rfl⟩⟩ - -theorem mem_assignmentOnIndices (B T A z : ZFSet.{u}) : - z ∈ assignmentOnIndices B T A ↔ z ∈ A ∧ z ∈ stageOneAssignments B T := - ZFSet.mem_sep - -theorem assignmentOnIndices_entry (B T A t u w : ZFSet.{u}) : - stageOneAssignment t u w ∈ assignmentOnIndices B T A ↔ - stageOneAssignment t u w ∈ A ∧ t ∈ B ∧ u ∈ T ∧ w ∈ T := by - rw [mem_assignmentOnIndices, stageOneAssignment_mem_assignments] - -theorem assignmentIndices_on (I T B A : ZFSet.{u}) : - assignmentIndices I T (assignmentOnIndices B T A) = assignmentIndices I T A ∩ B := by - apply ZFSet.ext - intro t - rw [mem_assignmentIndices, ZFSet.mem_inter, mem_assignmentIndices] - constructor - · rintro ⟨ht, u, hu, w, hw, entry⟩ - have e := (assignmentOnIndices_entry B T A t u w).1 entry - exact ⟨⟨ht, u, hu, w, hw, e.1⟩, e.2.1⟩ - · rintro ⟨⟨ht, u, hu, w, hw, entry⟩, hb⟩ - exact ⟨ht, u, hu, w, hw, (assignmentOnIndices_entry B T A t u w).2 - ⟨entry, hb, hu, hw⟩⟩ - -theorem assignmentOnIndices_own {I T A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments I T) : - assignmentOnIndices (assignmentIndices I T A) T A = A := by - apply ZFSet.ext - intro z - rw [mem_assignmentOnIndices] - refine ⟨And.left, fun hz => ⟨hz, ?_⟩⟩ - obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 (subset hz) - exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 - ⟨(mem_assignmentIndices I T A t).2 ⟨ht, u, hu, w, hw, hz⟩, hu, hw⟩ - -theorem assignment_subset_iff_indices_subset {I T A X : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments I T) : - A ⊆ stageOneAssignments X T ↔ assignmentIndices I T A ⊆ X := by - constructor - · intro h t ht - obtain ⟨_, u, _, w, _, entry⟩ := (mem_assignmentIndices I T A t).1 ht - exact ((stageOneAssignment_mem_assignments X T t u w).1 (h entry)).1 - · intro h z hz - obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 (subset hz) - exact (stageOneAssignment_mem_assignments X T t u w).2 - ⟨h ((mem_assignmentIndices I T A t).2 ⟨ht, u, hu, w, hw, hz⟩), hu, hw⟩ - - - - - -def AssignmentQueryWithin (X T q : ZFSet.{u}) : Prop := - ∃ row L, q = ZFSet.pair row L ∧ L ⊆ stageOneAssignments X T - -noncomputable def assignmentQueriesWithin (Q X T : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (AssignmentQueryWithin X T) Q - -noncomputable def representativeIndexAdditions (I T Q c X : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun i => ∃ q ∈ Q, AssignmentQueryWithin X T q ∧ - ∃ row A, ZFSet.pair q (ZFSet.pair row A) ∈ c ∧ - ∃ v ∈ T, ∃ w ∈ T, stageOneAssignment i v w ∈ A) I - -noncomputable def representativeIndexStep (I T Q c X : ZFSet.{u}) : ZFSet.{u} := - X ∪ representativeIndexAdditions I T Q c X - -theorem mem_assignmentQueriesWithin (Q X T q : ZFSet.{u}) : - q ∈ assignmentQueriesWithin Q X T ↔ q ∈ Q ∧ AssignmentQueryWithin X T q := - ZFSet.mem_sep - -theorem mem_representativeIndexAdditions (I T Q c X i : ZFSet.{u}) : - i ∈ representativeIndexAdditions I T Q c X ↔ i ∈ I ∧ - ∃ q ∈ Q, AssignmentQueryWithin X T q ∧ - ∃ row A, ZFSet.pair q (ZFSet.pair row A) ∈ c ∧ - ∃ v ∈ T, ∃ w ∈ T, stageOneAssignment i v w ∈ A := - ZFSet.mem_sep - -theorem representativeIndexStep_contains (I T Q c X : ZFSet.{u}) : - X ⊆ representativeIndexStep I T Q c X := - fun _ member => ZFSet.mem_union.2 (Or.inl member) - -theorem representativeIndexStep_subset {I T Q c X : ZFSet.{u}} (subset : X ⊆ I) : - representativeIndexStep I T Q c X ⊆ I := by - intro i member - exact (ZFSet.mem_union.1 member).elim (fun h => subset h) - (fun h => ((mem_representativeIndexAdditions I T Q c X i).1 h).1) - -theorem representativeIndexStep_covers {I T Q c X q row A : ZFSet.{u}} - (query : q ∈ Q) (within : AssignmentQueryWithin X T q) - (entry : ZFSet.pair q (ZFSet.pair row A) ∈ c) : - assignmentIndices I T A ⊆ representativeIndexStep I T Q c X := by - intro i member - obtain ⟨hi, v, hv, w, hw, e⟩ := (mem_assignmentIndices I T A i).1 member - exact ZFSet.mem_union.2 (Or.inr - ((mem_representativeIndexAdditions I T Q c X i).2 - ⟨hi, q, query, within, row, A, entry, v, hv, w, hw, e⟩)) - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem assignmentIndices_mem {I T A : ZFSet.{u}} - (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) : - assignmentIndices I T A ∈ M.sets := - M.relationImage_mem separation hA hI (M.productFirst_mem pairing unions powers separation - hI (M.prod_mem pairing unions powers separation hT hT)) - -theorem assignmentOnIndices_mem {B T A : ZFSet.{u}} - (hB : B ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) : - assignmentOnIndices B T A ∈ M.sets := - M.bounded_separation_mem separation (.mem 0 1) - (extend (stageOneAssignments B T) Fin.elim0) - (Fin.cases (M.stageOneAssignments_mem pairing unions powers separation hB hT) - (fun i => Fin.elim0 i)) hA - -theorem assignmentIndices_small - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I T A N : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : - M.groundEmbeddable (assignmentIndices I T A) N := - M.groundEmbeddable_function_image pairing unions powers separation choice hA hI hN - (M.productFirst_mem pairing unions powers separation hI - (M.prod_mem pairing unions powers separation hT hT)) (productFirst_function I (ZFSet.prod T T)) small - -theorem assignmentOnIndices_small {B T A N : ZFSet.{u}} - (hB : B ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) - (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : - M.groundEmbeddable (assignmentOnIndices B T A) N := - M.groundEmbeddable_restrict separation - (M.assignmentOnIndices_mem pairing unions powers separation hB hT hA) hN - (fun _ hz => (mem_assignmentOnIndices B T A _).1 hz |>.1) small - -theorem assignmentOnIndices_candidate {rows I T B row A : ZFSet.{u}} - (hB : B ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (member : ZFSet.pair row A ∈ M.stageOneCandidateBound rows I T) : - ZFSet.pair row (assignmentOnIndices B T A) ∈ M.stageOneCandidateBound rows B T := by - obtain ⟨hr, hA, _, small⟩ := (M.pair_mem_stageOneCandidateBound rows I T row A).1 member - exact (M.pair_mem_stageOneCandidateBound rows B T row _).2 - ⟨hr, M.assignmentOnIndices_mem pairing unions powers separation hB hT hA, - fun _ hz => (mem_assignmentOnIndices B T A _).1 hz |>.2, - M.assignmentOnIndices_small pairing unions powers separation hB hT hA omega small⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -universe u -variable (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) - -theorem stageOneRawTests_transfer {A B : ZFSet.{u}} (lower : ZFSet.{u}) - (tests : stageOneRawTests M d A lower) - (guards : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - stageOneAssignment t u w ∈ B → stageOneAssignment t u w ∈ A) : - stageOneRawTests M d B lower := - ⟨fun t ht u hu w hw entry => tests.1 t ht u hu w hw (guards t ht u hu w hw entry), - fun t ht u hu u' hu' w hw w' hw' entry entry' => - tests.2 t ht u hu u' hu' w hw w' hw' - (guards t ht u hu w hw entry) (guards t ht u' hu' w' hw' entry')⟩ - -theorem stageOneRawTests_congr (A B lower : ZFSet.{u}) - (guards : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - stageOneAssignment t u w ∈ A ↔ stageOneAssignment t u w ∈ B) : - stageOneRawTests M d A lower ↔ stageOneRawTests M d B lower := - ⟨fun tests => stageOneRawTests_transfer M d lower tests - (fun t ht u hu w hw entry => (guards t ht u hu w hw).2 entry), - fun tests => stageOneRawTests_transfer M d lower tests - (fun t ht u hu w hw entry => (guards t ht u hu w hw).1 entry)⟩ - -theorem stageOneRawTests_cut_iff (levels beta A lower : ZFSet.{u}) - (covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - ∃ xi ∈ beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : - stageOneRawTests M d (assignmentCut levels beta A) lower ↔ stageOneRawTests M d A lower := by - apply stageOneRawTests_congr - intro t ht u hu w hw - rw [mem_assignmentCut] - exact ⟨And.left, fun entry => ⟨entry, covered t ht u hu w hw⟩⟩ - -theorem stageTwoConditionCode_pair_iff (levels alpha row A : ZFSet.{u}) : - StageTwoConditionCode M levels alpha d (ZFSet.pair row A) ↔ - ZFSet.pair row (assignmentCut levels alpha A) ∈ d 7 ∧ - stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels alpha A)) := by - constructor - · rintro ⟨row', A', equal, member, tests⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_injective equal - exact ⟨member, tests⟩ - · rintro ⟨member, tests⟩ - exact ⟨row, A, rfl, member, tests⟩ - -theorem stageTwoConditionCode_cut_iff (levels alpha beta row A : ZFSet.{u}) - (below : alpha ⊆ beta) - (covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - ∃ xi ∈ beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : - StageTwoConditionCode M levels alpha d (ZFSet.pair row (assignmentCut levels beta A)) ↔ - StageTwoConditionCode M levels alpha d (ZFSet.pair row A) := by - rw [stageTwoConditionCode_pair_iff, stageTwoConditionCode_pair_iff, assignmentCut_nested below] - exact and_congr Iff.rfl (stageOneRawTests_cut_iff M d levels beta A _ covered) - -theorem packedSuccessorConditionCode_cut_iff (levels alpha beta row A : ZFSet.{u}) - (below : alpha ⊆ beta) - (covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - ∃ xi ∈ beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : - PackedSuccessorConditionCode M levels alpha (refinementFormulaDataCode d) - (ZFSet.pair row (assignmentCut levels beta A)) ↔ - PackedSuccessorConditionCode M levels alpha (refinementFormulaDataCode d) (ZFSet.pair row A) := by - rw [packedSuccessorConditionCode_code_iff, packedSuccessorConditionCode_code_iff] - exact stageTwoConditionCode_cut_iff M d levels alpha beta row A below covered - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -def AssignmentIndexAgreement (A B : ZFSet.{u}) : Prop := - ∀ t, (∃ u w, stageOneAssignment t u w ∈ A) → - (∃ u w, stageOneAssignment t u w ∈ B) → - ∀ u w, stageOneAssignment t u w ∈ A ↔ stageOneAssignment t u w ∈ B - -theorem stageOneRawTests_binary_union (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) - {A B lower : ZFSet.{u}} (agreement : AssignmentIndexAgreement A B) - (first : stageOneRawTests M d A lower) (second : stageOneRawTests M d B lower) : - stageOneRawTests M d (A ∪ B) lower := by - refine ⟨?_, ?_⟩ - · intro t ht u hu w hw entry - rcases ZFSet.mem_union.1 entry with entry | entry - · exact first.1 t ht u hu w hw entry - · exact second.1 t ht u hu w hw entry - · intro t ht u hu u' hu' w hw w' hw' entry entry' - rcases ZFSet.mem_union.1 entry with entry | entry - · rcases ZFSet.mem_union.1 entry' with entry' | entry' - · exact first.2 t ht u hu u' hu' w hw w' hw' entry entry' - · exact first.2 t ht u hu u' hu' w hw w' hw' entry - ((agreement t ⟨u, w, entry⟩ ⟨u', w', entry'⟩ u' w').2 entry') - · rcases ZFSet.mem_union.1 entry' with entry' | entry' - · exact second.2 t ht u hu u' hu' w hw w' hw' entry - ((agreement t ⟨u', w', entry'⟩ ⟨u, w, entry⟩ u' w').1 entry') - · exact second.2 t ht u hu u' hu' w hw w' hw' entry entry' - - - - - -def stageOneRawCrossCollisions (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) - (A B lower : ZFSet.{u}) : Prop := - ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ u' ∈ d 6, ∀ w ∈ d 6, ∀ w' ∈ d 6, - stageOneAssignment t u w ∈ A → stageOneAssignment t u' w' ∈ B → - stageOneRawCollision M d t u u' w w' lower ∧ - stageOneRawCollision M d t u' u w' w lower - -theorem stageOneRawTests_mixed_union (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) - {A B lower : ZFSet.{u}} (first : stageOneRawTests M d A lower) - (second : stageOneRawTests M d B lower) - (cross : stageOneRawCrossCollisions M d A B lower) : - stageOneRawTests M d (A ∪ B) lower := by - refine ⟨?_, ?_⟩ - · intro t ht u hu w hw entry - exact (ZFSet.mem_union.1 entry).elim - (first.1 t ht u hu w hw) (second.1 t ht u hu w hw) - · intro t ht u hu u' hu' w hw w' hw' entry entry' - rcases ZFSet.mem_union.1 entry with entry | entry - · rcases ZFSet.mem_union.1 entry' with entry' | entry' - · exact first.2 t ht u hu u' hu' w hw w' hw' entry entry' - · exact (cross t ht u hu u' hu' w hw w' hw' entry entry').1 - · rcases ZFSet.mem_union.1 entry' with entry' | entry' - · exact (cross t ht u' hu' u hu w' hw' w hw entry' entry).2 - · exact second.2 t ht u hu u' hu' w hw w' hw' entry entry' - - - - - -theorem assignment_representative_agreement {I T X A C : ZFSet.{u}} - (first : A ⊆ stageOneAssignments I T) (second : C ⊆ stageOneAssignments I T) - (contained : assignmentIndices I T C ⊆ X) - (exactLists : assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = - assignmentOnIndices X T A) : AssignmentIndexAgreement C A := by - intro t atC atA - obtain ⟨uC, wC, entryC⟩ := atC - obtain ⟨uA, wA, entryA⟩ := atA - have fieldsC := (stageOneAssignment_mem_assignments I T t uC wC).1 (second entryC) - have fieldsA := (stageOneAssignment_mem_assignments I T t uA wA).1 (first entryA) - have inX : t ∈ X := contained ((mem_assignmentIndices I T C t).2 - ⟨fieldsC.1, uC, fieldsC.2.1, wC, fieldsC.2.2, entryC⟩) - have inQuery : t ∈ assignmentIndices I T (assignmentOnIndices X T A) := by - rw [assignmentIndices_on, ZFSet.mem_inter] - exact ⟨(mem_assignmentIndices I T A t).2 - ⟨fieldsA.1, uA, fieldsA.2.1, wA, fieldsA.2.2, entryA⟩, inX⟩ - intro u w - constructor - · intro entry - have fields := (stageOneAssignment_mem_assignments I T t u w).1 (second entry) - have selected := (assignmentOnIndices_entry _ T C t u w).2 - ⟨entry, inQuery, fields.2.1, fields.2.2⟩ - rw [exactLists] at selected - exact ((assignmentOnIndices_entry X T A t u w).1 selected).1 - · intro entry - have fields := (stageOneAssignment_mem_assignments I T t u w).1 (first entry) - have selected := (assignmentOnIndices_entry X T A t u w).2 - ⟨entry, inX, fields.2.1, fields.2.2⟩ - rw [← exactLists] at selected - exact ((assignmentOnIndices_entry _ T C t u w).1 selected).1 - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -private noncomputable def classSelectionDefinition (phi : SetFormula 7) : - GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => - ZFSet.sep (fun z => Realize M.sets phi (extend z ![env 0, env 1, env 2, env 3, env 4, env 5])) - (ZFSet.prod (env 0) (M.groundRelations (env 2) (env 3)))) := by - let v := GroundSetTerm.var M (n := 6) - let names := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 2, v 3] - let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, names] - let term := GroundSetTerm.app (M.definable_separation separation phi) - ![bound, v 0, v 1, v 2, v 3, v 4, v 5] - refine term.definition.congr ?_ - intro env - apply congrArg (fun params : Fin 6 → ZFSet.{u} => ZFSet.sep - (fun z => Realize M.sets phi (extend z params)) - (ZFSet.prod (env 0) (M.groundRelations (env 2) (env 3)))) - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j - -noncomputable def definable_assignmentClassGraph (side : Fin 2) : - GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => - M.assignmentClassGraph side (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by - unfold assignmentClassGraph - exact classSelectionDefinition M pairing unions powers separation _ - -noncomputable def definable_assignmentOnIndices : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => - assignmentOnIndices (env 0) (env 1) (env 2)) := by - let v := GroundSetTerm.var M (n := 3) - let pairs := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 1, v 1] - let assignments := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, pairs] - let term := GroundSetTerm.app (M.definable_separation separation (.mem 0 1)) ![v 2, assignments] - exact term.definition - -noncomputable def storedAssignmentClassGraph (A : ZFSet.{u}) - (fields : Fin 15 → ZFSet.{u}) (side : Fin 2) : ZFSet.{u} := - M.assignmentClassGraph side (assignmentOnIndices (fields 0) (fields 6) A) - (fields (Fin.cases 5 (fun _ => 4) side)) (fields 6) (fields 7) (fields 8) (fields 9) - -noncomputable def definable_storedAssignmentClassGraph (side : Fin 2) : - GroundDefinableFunction M (fun env : Fin 16 → ZFSet.{u} => - M.storedAssignmentClassGraph (env 0) (fun j => env j.succ) side) := by - let v := GroundSetTerm.var M (n := 16) - let selected := GroundSetTerm.app (M.definable_assignmentOnIndices pairing unions powers separation) - ![v 1, v 7, v 0] - let term := GroundSetTerm.app (M.definable_assignmentClassGraph pairing unions powers separation side) - ![selected, v (Fin.cases 6 (fun _ => 5) side), v 7, v 8, v 9, v 10] - refine term.definition.congr ?_ - intro env - have shift : (Fin.cases 6 (fun _ => 5) side : Fin 16) = - (Fin.cases 5 (fun _ => 4) side : Fin 15).succ := - Fin.cases rfl (fun _ => rfl) side - change M.assignmentClassGraph side (assignmentOnIndices (env 1) (env 7) (env 0)) - (env (Fin.cases 6 (fun _ => 5) side)) (env 7) (env 8) (env 9) (env 10) = - M.assignmentClassGraph side (assignmentOnIndices (env 1) (env 7) (env 0)) - (env (Fin.cases 5 (fun _ => 4) side : Fin 15).succ) (env 7) (env 8) (env 9) (env 10) - rw [shift] - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def storedPreparationRequests (A : ZFSet.{u}) - (fields : Fin 15 → ZFSet.{u}) : ZFSet.{u} := - let selected := assignmentOnIndices (fields 0) (fields 6) A - relationImage selected (fields 14) (M.storedAssignmentClassGraph A fields 0) ∪ - relationImage selected (fields 14) (M.storedAssignmentClassGraph A fields 1) - -private noncomputable def relationImageDefinition (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => - relationImage (env 0) (env 1) (env 2)) where - formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula - closed := fun _ members => M.relationImage_mem separation (members 0) (members 1) (members 2) - correct := by - intro env members z hz - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), - BoundedFormula.truth_relationImageEqualityFormula] - rfl - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_storedPreparationRequests : - GroundDefinableFunction M (fun env : Fin 16 → ZFSet.{u} => - M.storedPreparationRequests (env 0) (fun j => env j.succ)) := by - let v := GroundSetTerm.var M (n := 16) - let selected := GroundSetTerm.app (M.definable_assignmentOnIndices pairing unions powers separation) - ![v 1, v 7, v 0] - let graph (side : Fin 2) := GroundSetTerm.app - (M.definable_storedAssignmentClassGraph pairing unions powers separation side) v - let image (side : Fin 2) := GroundSetTerm.app (relationImageDefinition M separation) - ![selected, v 15, graph side] - exact (GroundSetTerm.app (M.definable_binaryUnion pairing unions) ![image 0, image 1]).definition - -include pairing unions powers separation in -theorem storedPreparationRequests_mem {A : ZFSet.{u}} (hA : A ∈ M.sets) - (fields : Fin 15 → ZFSet.{u}) (members : ∀ j, fields j ∈ M.sets) : - M.storedPreparationRequests A fields ∈ M.sets := - (M.definable_storedPreparationRequests pairing unions powers separation).closed - (extend A fields) (Fin.cases hA members) - -theorem storedPreparationRequests_typed {G P L : Type u} - [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (A : ZFSet.{u}) : - M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid) = - let selected := assignmentOnIndices (M.niceRefinementIndices a s b d level T T2 valid) T A - let graphs := M.niceAssignmentClassGraphs a s b d level T T2 valid selected - relationImage selected (M.groundRelations T s.carrier) (graphs 0) ∪ - relationImage selected (M.groundRelations T s.carrier) (graphs 1) := rfl - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceAssignmentClassFamilies + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def assignmentIndices (I T A : ZFSet.{u}) : ZFSet.{u} := + relationImage A I (productFirst I (ZFSet.prod T T)) + +noncomputable def assignmentOnIndices (B T A : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ stageOneAssignments B T) A + +theorem mem_assignmentIndices (I T A t : ZFSet.{u}) : + t ∈ assignmentIndices I T A ↔ + t ∈ I ∧ ∃ u ∈ T, ∃ w ∈ T, stageOneAssignment t u w ∈ A := by + rw [assignmentIndices, mem_relationImage] + constructor + · rintro ⟨ht, z, hz, entry⟩ + obtain ⟨i, _, rest, hr, equal⟩ := (mem_productFirst I (ZFSet.prod T T) _).1 entry + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨u, hu, w, hw, rfl⟩ := ZFSet.mem_prod.1 hr + exact ⟨ht, u, hu, w, hw, hz⟩ + · rintro ⟨ht, u, hu, w, hw, member⟩ + exact ⟨ht, stageOneAssignment t u w, member, + (mem_productFirst I (ZFSet.prod T T) _).2 + ⟨t, ht, ZFSet.pair u w, ZFSet.pair_mem_prod.2 ⟨hu, hw⟩, rfl⟩⟩ + +theorem mem_assignmentOnIndices (B T A z : ZFSet.{u}) : + z ∈ assignmentOnIndices B T A ↔ z ∈ A ∧ z ∈ stageOneAssignments B T := + ZFSet.mem_sep + +theorem assignmentOnIndices_entry (B T A t u w : ZFSet.{u}) : + stageOneAssignment t u w ∈ assignmentOnIndices B T A ↔ + stageOneAssignment t u w ∈ A ∧ t ∈ B ∧ u ∈ T ∧ w ∈ T := by + rw [mem_assignmentOnIndices, stageOneAssignment_mem_assignments] + +theorem assignmentIndices_on (I T B A : ZFSet.{u}) : + assignmentIndices I T (assignmentOnIndices B T A) = assignmentIndices I T A ∩ B := by + apply ZFSet.ext + intro t + rw [mem_assignmentIndices, ZFSet.mem_inter, mem_assignmentIndices] + constructor + · rintro ⟨ht, u, hu, w, hw, entry⟩ + have e := (assignmentOnIndices_entry B T A t u w).1 entry + exact ⟨⟨ht, u, hu, w, hw, e.1⟩, e.2.1⟩ + · rintro ⟨⟨ht, u, hu, w, hw, entry⟩, hb⟩ + exact ⟨ht, u, hu, w, hw, (assignmentOnIndices_entry B T A t u w).2 + ⟨entry, hb, hu, hw⟩⟩ + +theorem assignmentOnIndices_own {I T A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments I T) : + assignmentOnIndices (assignmentIndices I T A) T A = A := by + apply ZFSet.ext + intro z + rw [mem_assignmentOnIndices] + refine ⟨And.left, fun hz => ⟨hz, ?_⟩⟩ + obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 (subset hz) + exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 + ⟨(mem_assignmentIndices I T A t).2 ⟨ht, u, hu, w, hw, hz⟩, hu, hw⟩ + +theorem assignment_subset_iff_indices_subset {I T A X : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments I T) : + A ⊆ stageOneAssignments X T ↔ assignmentIndices I T A ⊆ X := by + constructor + · intro h t ht + obtain ⟨_, u, _, w, _, entry⟩ := (mem_assignmentIndices I T A t).1 ht + exact ((stageOneAssignment_mem_assignments X T t u w).1 (h entry)).1 + · intro h z hz + obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 (subset hz) + exact (stageOneAssignment_mem_assignments X T t u w).2 + ⟨h ((mem_assignmentIndices I T A t).2 ⟨ht, u, hu, w, hw, hz⟩), hu, hw⟩ + + + + + +def AssignmentQueryWithin (X T q : ZFSet.{u}) : Prop := + ∃ row L, q = ZFSet.pair row L ∧ L ⊆ stageOneAssignments X T + +noncomputable def assignmentQueriesWithin (Q X T : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (AssignmentQueryWithin X T) Q + +noncomputable def representativeIndexAdditions (I T Q c X : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun i => ∃ q ∈ Q, AssignmentQueryWithin X T q ∧ + ∃ row A, ZFSet.pair q (ZFSet.pair row A) ∈ c ∧ + ∃ v ∈ T, ∃ w ∈ T, stageOneAssignment i v w ∈ A) I + +noncomputable def representativeIndexStep (I T Q c X : ZFSet.{u}) : ZFSet.{u} := + X ∪ representativeIndexAdditions I T Q c X + +theorem mem_assignmentQueriesWithin (Q X T q : ZFSet.{u}) : + q ∈ assignmentQueriesWithin Q X T ↔ q ∈ Q ∧ AssignmentQueryWithin X T q := + ZFSet.mem_sep + +theorem mem_representativeIndexAdditions (I T Q c X i : ZFSet.{u}) : + i ∈ representativeIndexAdditions I T Q c X ↔ i ∈ I ∧ + ∃ q ∈ Q, AssignmentQueryWithin X T q ∧ + ∃ row A, ZFSet.pair q (ZFSet.pair row A) ∈ c ∧ + ∃ v ∈ T, ∃ w ∈ T, stageOneAssignment i v w ∈ A := + ZFSet.mem_sep + +theorem representativeIndexStep_contains (I T Q c X : ZFSet.{u}) : + X ⊆ representativeIndexStep I T Q c X := + fun _ member => ZFSet.mem_union.2 (Or.inl member) + +theorem representativeIndexStep_subset {I T Q c X : ZFSet.{u}} (subset : X ⊆ I) : + representativeIndexStep I T Q c X ⊆ I := by + intro i member + exact (ZFSet.mem_union.1 member).elim (fun h => subset h) + (fun h => ((mem_representativeIndexAdditions I T Q c X i).1 h).1) + +theorem representativeIndexStep_covers {I T Q c X q row A : ZFSet.{u}} + (query : q ∈ Q) (within : AssignmentQueryWithin X T q) + (entry : ZFSet.pair q (ZFSet.pair row A) ∈ c) : + assignmentIndices I T A ⊆ representativeIndexStep I T Q c X := by + intro i member + obtain ⟨hi, v, hv, w, hw, e⟩ := (mem_assignmentIndices I T A i).1 member + exact ZFSet.mem_union.2 (Or.inr + ((mem_representativeIndexAdditions I T Q c X i).2 + ⟨hi, q, query, within, row, A, entry, v, hv, w, hw, e⟩)) + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem assignmentIndices_mem {I T A : ZFSet.{u}} + (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) : + assignmentIndices I T A ∈ M.sets := + M.relationImage_mem separation hA hI (M.productFirst_mem pairing unions powers separation + hI (M.prod_mem pairing unions powers separation hT hT)) + +theorem assignmentOnIndices_mem {B T A : ZFSet.{u}} + (hB : B ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) : + assignmentOnIndices B T A ∈ M.sets := + M.bounded_separation_mem separation (.mem 0 1) + (extend (stageOneAssignments B T) Fin.elim0) + (Fin.cases (M.stageOneAssignments_mem pairing unions powers separation hB hT) + (fun i => Fin.elim0 i)) hA + +theorem assignmentIndices_small + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I T A N : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (hA : A ∈ M.sets) (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : + M.groundEmbeddable (assignmentIndices I T A) N := + M.groundEmbeddable_function_image pairing unions powers separation choice hA hI hN + (M.productFirst_mem pairing unions powers separation hI + (M.prod_mem pairing unions powers separation hT hT)) (productFirst_function I (ZFSet.prod T T)) small + +theorem assignmentOnIndices_small {B T A N : ZFSet.{u}} + (hB : B ∈ M.sets) (hT : T ∈ M.sets) (hA : A ∈ M.sets) + (hN : N ∈ M.sets) (small : M.groundEmbeddable A N) : + M.groundEmbeddable (assignmentOnIndices B T A) N := + M.groundEmbeddable_restrict separation + (M.assignmentOnIndices_mem pairing unions powers separation hB hT hA) hN + (fun _ hz => (mem_assignmentOnIndices B T A _).1 hz |>.1) small + +theorem assignmentOnIndices_candidate {rows I T B row A : ZFSet.{u}} + (hB : B ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (member : ZFSet.pair row A ∈ M.stageOneCandidateBound rows I T) : + ZFSet.pair row (assignmentOnIndices B T A) ∈ M.stageOneCandidateBound rows B T := by + obtain ⟨hr, hA, _, small⟩ := (M.pair_mem_stageOneCandidateBound rows I T row A).1 member + exact (M.pair_mem_stageOneCandidateBound rows B T row _).2 + ⟨hr, M.assignmentOnIndices_mem pairing unions powers separation hB hT hA, + fun _ hz => (mem_assignmentOnIndices B T A _).1 hz |>.2, + M.assignmentOnIndices_small pairing unions powers separation hB hT hA omega small⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +universe u +variable (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) + +theorem stageOneRawTests_transfer {A B : ZFSet.{u}} (lower : ZFSet.{u}) + (tests : stageOneRawTests M d A lower) + (guards : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + stageOneAssignment t u w ∈ B → stageOneAssignment t u w ∈ A) : + stageOneRawTests M d B lower := + ⟨fun t ht u hu w hw entry => tests.1 t ht u hu w hw (guards t ht u hu w hw entry), + fun t ht u hu u' hu' w hw w' hw' entry entry' => + tests.2 t ht u hu u' hu' w hw w' hw' + (guards t ht u hu w hw entry) (guards t ht u' hu' w' hw' entry')⟩ + +theorem stageOneRawTests_congr (A B lower : ZFSet.{u}) + (guards : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + stageOneAssignment t u w ∈ A ↔ stageOneAssignment t u w ∈ B) : + stageOneRawTests M d A lower ↔ stageOneRawTests M d B lower := + ⟨fun tests => stageOneRawTests_transfer M d lower tests + (fun t ht u hu w hw entry => (guards t ht u hu w hw).2 entry), + fun tests => stageOneRawTests_transfer M d lower tests + (fun t ht u hu w hw entry => (guards t ht u hu w hw).1 entry)⟩ + +theorem stageOneRawTests_cut_iff (levels beta A lower : ZFSet.{u}) + (covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + ∃ xi ∈ beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : + stageOneRawTests M d (assignmentCut levels beta A) lower ↔ stageOneRawTests M d A lower := by + apply stageOneRawTests_congr + intro t ht u hu w hw + rw [mem_assignmentCut] + exact ⟨And.left, fun entry => ⟨entry, covered t ht u hu w hw⟩⟩ + +theorem stageTwoConditionCode_pair_iff (levels alpha row A : ZFSet.{u}) : + StageTwoConditionCode M levels alpha d (ZFSet.pair row A) ↔ + ZFSet.pair row (assignmentCut levels alpha A) ∈ d 7 ∧ + stageOneRawTests M d A (ZFSet.pair row (assignmentCut levels alpha A)) := by + constructor + · rintro ⟨row', A', equal, member, tests⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_injective equal + exact ⟨member, tests⟩ + · rintro ⟨member, tests⟩ + exact ⟨row, A, rfl, member, tests⟩ + +theorem stageTwoConditionCode_cut_iff (levels alpha beta row A : ZFSet.{u}) + (below : alpha ⊆ beta) + (covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + ∃ xi ∈ beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : + StageTwoConditionCode M levels alpha d (ZFSet.pair row (assignmentCut levels beta A)) ↔ + StageTwoConditionCode M levels alpha d (ZFSet.pair row A) := by + rw [stageTwoConditionCode_pair_iff, stageTwoConditionCode_pair_iff, assignmentCut_nested below] + exact and_congr Iff.rfl (stageOneRawTests_cut_iff M d levels beta A _ covered) + +theorem packedSuccessorConditionCode_cut_iff (levels alpha beta row A : ZFSet.{u}) + (below : alpha ⊆ beta) + (covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + ∃ xi ∈ beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ levels) : + PackedSuccessorConditionCode M levels alpha (refinementFormulaDataCode d) + (ZFSet.pair row (assignmentCut levels beta A)) ↔ + PackedSuccessorConditionCode M levels alpha (refinementFormulaDataCode d) (ZFSet.pair row A) := by + rw [packedSuccessorConditionCode_code_iff, packedSuccessorConditionCode_code_iff] + exact stageTwoConditionCode_cut_iff M d levels alpha beta row A below covered + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +def AssignmentIndexAgreement (A B : ZFSet.{u}) : Prop := + ∀ t, (∃ u w, stageOneAssignment t u w ∈ A) → + (∃ u w, stageOneAssignment t u w ∈ B) → + ∀ u w, stageOneAssignment t u w ∈ A ↔ stageOneAssignment t u w ∈ B + +theorem stageOneRawTests_binary_union (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) + {A B lower : ZFSet.{u}} (agreement : AssignmentIndexAgreement A B) + (first : stageOneRawTests M d A lower) (second : stageOneRawTests M d B lower) : + stageOneRawTests M d (A ∪ B) lower := by + refine ⟨?_, ?_⟩ + · intro t ht u hu w hw entry + rcases ZFSet.mem_union.1 entry with entry | entry + · exact first.1 t ht u hu w hw entry + · exact second.1 t ht u hu w hw entry + · intro t ht u hu u' hu' w hw w' hw' entry entry' + rcases ZFSet.mem_union.1 entry with entry | entry + · rcases ZFSet.mem_union.1 entry' with entry' | entry' + · exact first.2 t ht u hu u' hu' w hw w' hw' entry entry' + · exact first.2 t ht u hu u' hu' w hw w' hw' entry + ((agreement t ⟨u, w, entry⟩ ⟨u', w', entry'⟩ u' w').2 entry') + · rcases ZFSet.mem_union.1 entry' with entry' | entry' + · exact second.2 t ht u hu u' hu' w hw w' hw' entry + ((agreement t ⟨u', w', entry'⟩ ⟨u, w, entry⟩ u' w').1 entry') + · exact second.2 t ht u hu u' hu' w hw w' hw' entry entry' + + + + + +def stageOneRawCrossCollisions (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) + (A B lower : ZFSet.{u}) : Prop := + ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ u' ∈ d 6, ∀ w ∈ d 6, ∀ w' ∈ d 6, + stageOneAssignment t u w ∈ A → stageOneAssignment t u' w' ∈ B → + stageOneRawCollision M d t u u' w w' lower ∧ + stageOneRawCollision M d t u' u w' w lower + +theorem stageOneRawTests_mixed_union (M : TransitiveGround.{u}) (d : Fin 15 → ZFSet.{u}) + {A B lower : ZFSet.{u}} (first : stageOneRawTests M d A lower) + (second : stageOneRawTests M d B lower) + (cross : stageOneRawCrossCollisions M d A B lower) : + stageOneRawTests M d (A ∪ B) lower := by + refine ⟨?_, ?_⟩ + · intro t ht u hu w hw entry + exact (ZFSet.mem_union.1 entry).elim + (first.1 t ht u hu w hw) (second.1 t ht u hu w hw) + · intro t ht u hu u' hu' w hw w' hw' entry entry' + rcases ZFSet.mem_union.1 entry with entry | entry + · rcases ZFSet.mem_union.1 entry' with entry' | entry' + · exact first.2 t ht u hu u' hu' w hw w' hw' entry entry' + · exact (cross t ht u hu u' hu' w hw w' hw' entry entry').1 + · rcases ZFSet.mem_union.1 entry' with entry' | entry' + · exact (cross t ht u' hu' u hu w' hw' w hw entry' entry).2 + · exact second.2 t ht u hu u' hu' w hw w' hw' entry entry' + + + + + +theorem assignment_representative_agreement {I T X A C : ZFSet.{u}} + (first : A ⊆ stageOneAssignments I T) (second : C ⊆ stageOneAssignments I T) + (contained : assignmentIndices I T C ⊆ X) + (exactLists : assignmentOnIndices (assignmentIndices I T (assignmentOnIndices X T A)) T C = + assignmentOnIndices X T A) : AssignmentIndexAgreement C A := by + intro t atC atA + obtain ⟨uC, wC, entryC⟩ := atC + obtain ⟨uA, wA, entryA⟩ := atA + have fieldsC := (stageOneAssignment_mem_assignments I T t uC wC).1 (second entryC) + have fieldsA := (stageOneAssignment_mem_assignments I T t uA wA).1 (first entryA) + have inX : t ∈ X := contained ((mem_assignmentIndices I T C t).2 + ⟨fieldsC.1, uC, fieldsC.2.1, wC, fieldsC.2.2, entryC⟩) + have inQuery : t ∈ assignmentIndices I T (assignmentOnIndices X T A) := by + rw [assignmentIndices_on, ZFSet.mem_inter] + exact ⟨(mem_assignmentIndices I T A t).2 + ⟨fieldsA.1, uA, fieldsA.2.1, wA, fieldsA.2.2, entryA⟩, inX⟩ + intro u w + constructor + · intro entry + have fields := (stageOneAssignment_mem_assignments I T t u w).1 (second entry) + have selected := (assignmentOnIndices_entry _ T C t u w).2 + ⟨entry, inQuery, fields.2.1, fields.2.2⟩ + rw [exactLists] at selected + exact ((assignmentOnIndices_entry X T A t u w).1 selected).1 + · intro entry + have fields := (stageOneAssignment_mem_assignments I T t u w).1 (first entry) + have selected := (assignmentOnIndices_entry X T A t u w).2 + ⟨entry, inX, fields.2.1, fields.2.2⟩ + rw [← exactLists] at selected + exact ((assignmentOnIndices_entry _ T C t u w).1 selected).1 + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +private noncomputable def classSelectionDefinition (phi : SetFormula 7) : + GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => + ZFSet.sep (fun z => Realize M.sets phi (extend z ![env 0, env 1, env 2, env 3, env 4, env 5])) + (ZFSet.prod (env 0) (M.groundRelations (env 2) (env 3)))) := by + let v := GroundSetTerm.var M (n := 6) + let names := GroundSetTerm.app (M.definable_groundRelations pairing unions powers separation) ![v 2, v 3] + let bound := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, names] + let term := GroundSetTerm.app (M.definable_separation separation phi) + ![bound, v 0, v 1, v 2, v 3, v 4, v 5] + refine term.definition.congr ?_ + intro env + apply congrArg (fun params : Fin 6 → ZFSet.{u} => ZFSet.sep + (fun z => Realize M.sets phi (extend z params)) + (ZFSet.prod (env 0) (M.groundRelations (env 2) (env 3)))) + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))))) j + +noncomputable def definable_assignmentClassGraph (side : Fin 2) : + GroundDefinableFunction M (fun env : Fin 6 → ZFSet.{u} => + M.assignmentClassGraph side (env 0) (env 1) (env 2) (env 3) (env 4) (env 5)) := by + unfold assignmentClassGraph + exact classSelectionDefinition M pairing unions powers separation _ + +noncomputable def definable_assignmentOnIndices : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => + assignmentOnIndices (env 0) (env 1) (env 2)) := by + let v := GroundSetTerm.var M (n := 3) + let pairs := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 1, v 1] + let assignments := GroundSetTerm.app (M.definable_product pairing unions powers separation) ![v 0, pairs] + let term := GroundSetTerm.app (M.definable_separation separation (.mem 0 1)) ![v 2, assignments] + exact term.definition + +noncomputable def storedAssignmentClassGraph (A : ZFSet.{u}) + (fields : Fin 15 → ZFSet.{u}) (side : Fin 2) : ZFSet.{u} := + M.assignmentClassGraph side (assignmentOnIndices (fields 0) (fields 6) A) + (fields (Fin.cases 5 (fun _ => 4) side)) (fields 6) (fields 7) (fields 8) (fields 9) + +noncomputable def definable_storedAssignmentClassGraph (side : Fin 2) : + GroundDefinableFunction M (fun env : Fin 16 → ZFSet.{u} => + M.storedAssignmentClassGraph (env 0) (fun j => env j.succ) side) := by + let v := GroundSetTerm.var M (n := 16) + let selected := GroundSetTerm.app (M.definable_assignmentOnIndices pairing unions powers separation) + ![v 1, v 7, v 0] + let term := GroundSetTerm.app (M.definable_assignmentClassGraph pairing unions powers separation side) + ![selected, v (Fin.cases 6 (fun _ => 5) side), v 7, v 8, v 9, v 10] + refine term.definition.congr ?_ + intro env + have shift : (Fin.cases 6 (fun _ => 5) side : Fin 16) = + (Fin.cases 5 (fun _ => 4) side : Fin 15).succ := + Fin.cases rfl (fun _ => rfl) side + change M.assignmentClassGraph side (assignmentOnIndices (env 1) (env 7) (env 0)) + (env (Fin.cases 6 (fun _ => 5) side)) (env 7) (env 8) (env 9) (env 10) = + M.assignmentClassGraph side (assignmentOnIndices (env 1) (env 7) (env 0)) + (env (Fin.cases 5 (fun _ => 4) side : Fin 15).succ) (env 7) (env 8) (env 9) (env 10) + rw [shift] + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def storedPreparationRequests (A : ZFSet.{u}) + (fields : Fin 15 → ZFSet.{u}) : ZFSet.{u} := + let selected := assignmentOnIndices (fields 0) (fields 6) A + relationImage selected (fields 14) (M.storedAssignmentClassGraph A fields 0) ∪ + relationImage selected (fields 14) (M.storedAssignmentClassGraph A fields 1) + +private noncomputable def relationImageDefinition (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 3 → ZFSet.{u} => + relationImage (env 0) (env 1) (env 2)) where + formula := (BoundedFormula.relationImageEqualityFormula 0 1 2 3).toFormula + closed := fun _ members => M.relationImage_mem separation (members 0) (members 1) (members 2) + correct := by + intro env members z hz + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members), + BoundedFormula.truth_relationImageEqualityFormula] + rfl + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_storedPreparationRequests : + GroundDefinableFunction M (fun env : Fin 16 → ZFSet.{u} => + M.storedPreparationRequests (env 0) (fun j => env j.succ)) := by + let v := GroundSetTerm.var M (n := 16) + let selected := GroundSetTerm.app (M.definable_assignmentOnIndices pairing unions powers separation) + ![v 1, v 7, v 0] + let graph (side : Fin 2) := GroundSetTerm.app + (M.definable_storedAssignmentClassGraph pairing unions powers separation side) v + let image (side : Fin 2) := GroundSetTerm.app (relationImageDefinition M separation) + ![selected, v 15, graph side] + exact (GroundSetTerm.app (M.definable_binaryUnion pairing unions) ![image 0, image 1]).definition + +include pairing unions powers separation in +theorem storedPreparationRequests_mem {A : ZFSet.{u}} (hA : A ∈ M.sets) + (fields : Fin 15 → ZFSet.{u}) (members : ∀ j, fields j ∈ M.sets) : + M.storedPreparationRequests A fields ∈ M.sets := + (M.definable_storedPreparationRequests pairing unions powers separation).closed + (extend A fields) (Fin.cases hA members) + +theorem storedPreparationRequests_typed {G P L : Type u} + [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (A : ZFSet.{u}) : + M.storedPreparationRequests A (M.refinementLevelFormulaData a s b d level T T2 valid) = + let selected := assignmentOnIndices (M.niceRefinementIndices a s b d level T T2 valid) T A + let graphs := M.niceAssignmentClassGraphs a s b d level T T2 valid selected + relationImage selected (M.groundRelations T s.carrier) (graphs 0) ∪ + relationImage selected (M.groundRelations T s.carrier) (graphs 1) := rfl + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RequestedOwnerSlotLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RequestedOwnerSlotLaws.lean index 1ccf0b5efc3a1f7f5410cc3661460c553a7abf28..7f6488112f3c05e2129380a772a202431b276835 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RequestedOwnerSlotLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RequestedOwnerSlotLaws.lean @@ -1,229 +1,229 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalCopyRelations -import OAI.SetTheory.PartitionPrinciple.Definability.RootedSupportOwnerFunction -import OAI.SetTheory.PartitionPrinciple.Forcing.RequestedSupportOwners - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.TileRequests -open Attachment CosetGeometry -universe u -variable {A : Type u} {P : MeetOrder A} - -namespace Request - -def vertexSlot : (r : Request P) → Option r.Child → Nat - | _, none => 0 - | .separation _, some _ => 1 - | .compression _ _, some _ => 1 - | .rectangle _, some j => if j.down then 2 else 1 - -theorem vertexSlot_lt_three (r : Request P) (i : Option r.Child) : r.vertexSlot i < 3 := by - cases r with - | separation W => cases i <;> simp [vertexSlot] - | compression K copy => cases i <;> simp [vertexSlot] - | rectangle rect => - cases i with - | none => simp [vertexSlot] - | some i => cases i with | up b => cases b <;> simp [vertexSlot] - -theorem vertexSlot_injective (r : Request P) : Function.Injective r.vertexSlot := by - cases r with - | separation W => - intro i j equal - cases i <;> cases j <;> simp_all [vertexSlot, Child] - exact congrArg some (Subsingleton.elim _ _) - | compression K copy => - intro i j equal - cases i <;> cases j <;> simp_all [vertexSlot, Child] - exact congrArg some (Subsingleton.elim _ _) - | rectangle rect => - intro i j equal - cases i with - | none => - cases j with - | none => rfl - | some j => cases j with | up b => cases b <;> simp_all [vertexSlot] - | some i => - cases j with - | none => cases i with | up b => cases b <;> simp_all [vertexSlot] - | some j => - cases i with | up b => - cases j with | up c => - cases b <;> cases c <;> simp_all [vertexSlot] - -end Request - -namespace Family -variable {R : Type u} (f : Family P R) - -def VertexSlotSupports (r : R) (j : Nat) (x : (f.tile r).Space) : Prop := - ∃ i : Option (f.Child r), (f.request r).vertexSlot i = j ∧ - ∃ y, (f.flatVertex r i).toFun y = x - -theorem vertexSlotSupports_bound {r : R} {j : Nat} {x : (f.tile r).Space} - (supported : f.VertexSlotSupports r j x) : j < 3 := by - obtain ⟨i, rfl, _⟩ := supported - exact (f.request r).vertexSlot_lt_three i - -theorem vertexSlotSupports_cover (r : R) (x : (f.tile r).Space) : - ∃ j, f.VertexSlotSupports r j x := by - obtain ⟨i, y, equal⟩ := f.flatVertex_cover r x - exact ⟨(f.request r).vertexSlot i, i, rfl, y, equal⟩ - -theorem vertexSlotSupports_lower {r : R} {j : Nat} {x y : (f.tile r).Space} - (supported : f.VertexSlotSupports r j y) (lower : (f.tile r).order.le x y) : - f.VertexSlotSupports r j x := by - obtain ⟨i, code, z, rfl⟩ := supported - obtain ⟨v, equal⟩ := (f.flatVertex r i).ideal z x lower - exact ⟨i, code, v, equal⟩ - -noncomputable def leastVertexSlot (r : R) (x : (f.tile r).Space) : Nat := by - classical - exact Nat.find (f.vertexSlotSupports_cover r x) - -theorem leastVertexSlot_support (r : R) (x : (f.tile r).Space) : - f.VertexSlotSupports r (f.leastVertexSlot r x) x := by - classical - exact Nat.find_spec (f.vertexSlotSupports_cover r x) - -theorem leastVertexSlot_lt_three (r : R) (x : (f.tile r).Space) : - f.leastVertexSlot r x < 3 := - f.vertexSlotSupports_bound (f.leastVertexSlot_support r x) - -theorem leastVertexSlot_le {r : R} {j : Nat} {x : (f.tile r).Space} - (supported : f.VertexSlotSupports r j x) : f.leastVertexSlot r x ≤ j := by - classical - exact Nat.find_min' (f.vertexSlotSupports_cover r x) supported - -theorem leastVertexSlot_eq_iff (r : R) (x : (f.tile r).Space) (j : Nat) : - f.leastVertexSlot r x = j ↔ - f.VertexSlotSupports r j x ∧ ∀ k, k < j → ¬ f.VertexSlotSupports r k x := by - constructor - · rintro rfl - refine ⟨f.leastVertexSlot_support r x, ?_⟩ - intro k lower supported - exact (Nat.not_lt_of_ge (f.leastVertexSlot_le supported)) lower - · rintro ⟨supported, minimal⟩ - apply Nat.le_antisymm (f.leastVertexSlot_le supported) - exact Nat.le_of_not_gt (fun lower => minimal _ lower (f.leastVertexSlot_support r x)) - -theorem leastVertexSlot_mono {r : R} {x y : (f.tile r).Space} - (lower : (f.tile r).order.le x y) : f.leastVertexSlot r x ≤ f.leastVertexSlot r y := - f.leastVertexSlot_le (f.vertexSlotSupports_lower (f.leastVertexSlot_support r y) lower) - -end Family -end PartitionPilot.Compression.RecursiveMaps.TileRequests - - - -namespace PartitionPilot.Compression.RecursiveMaps -open Attachment CosetGeometry -universe u - -namespace RootedGluing.Scheme -variable {V : Type u} (d : Scheme V) - -theorem leastSupport_meet_depth_lt {x y : d.Node} {v w k : V} - (first : d.LeastSupport v x) (second : d.LeastSupport w y) - (third : d.LeastSupport k (d.gluedOrder.meet x y)) - (same : d.depth v = d.depth w) (different : v ≠ w) : d.depth k < d.depth v := by - have bound := d.leastSupport_depth_mono third first (d.gluedOrder.meet_le_left x y) - apply Nat.lt_of_le_of_ne bound - intro equal - have left := d.leastSupport_eq_of_depth_eq third first - (d.gluedOrder.meet_le_left x y) equal - have right := d.leastSupport_eq_of_depth_eq third second - (d.gluedOrder.meet_le_right x y) (equal.trans same) - exact different (left.symm.trans right) - -theorem owner_meet_depth_lt {x y : d.Node} - (same : d.depth (d.owner x) = d.depth (d.owner y)) (different : d.owner x ≠ d.owner y) : - d.depth (d.owner (d.gluedOrder.meet x y)) < d.depth (d.owner x) := - d.leastSupport_meet_depth_lt (d.owner_least x) (d.owner_least y) - (d.owner_least (d.gluedOrder.meet x y)) same different - -end RootedGluing.Scheme - -namespace TileRequests.Family -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -def SlotSupports (w : External J f.Letters) (r : R) (j : Nat) (x : f.Node a) : Prop := - ∃ i : Option (f.Child r), (f.request r).vertexSlot i = j ∧ - ∃ y, (f.copy a (f.flatWord w r i)).toFun y = x - -theorem slotSupports_iff (w : External J f.Letters) (r : R) (j : Nat) (x : f.Node a) : - f.SlotSupports a w r j x ↔ - ∃ y : (f.tile r).Space, f.VertexSlotSupports r j y ∧ (f.placedTile a w r).toFun y = x := by - constructor - · rintro ⟨i, code, y, rfl⟩ - exact ⟨(f.flatVertex r i).toFun y, ⟨i, code, y, rfl⟩, f.flatVertex_copy a w r i y⟩ - · rintro ⟨y, ⟨i, code, z, rfl⟩, equal⟩ - exact ⟨i, code, z, (f.flatVertex_copy a w r i z).symm.trans equal⟩ - -theorem slotSupports_placed_iff (w : External J f.Letters) (r : R) (j : Nat) - (x : (f.tile r).Space) : - f.SlotSupports a w r j ((f.placedTile a w r).toFun x) ↔ f.VertexSlotSupports r j x := by - rw [f.slotSupports_iff] - constructor - · rintro ⟨y, supported, equal⟩ - have same := embedding_injective (f.placedTile a w r).toMeetEmbedding equal - exact same ▸ supported - · intro supported - exact ⟨x, supported, rfl⟩ - -theorem slotSupports_bound {w : External J f.Letters} {r : R} {j : Nat} {x : f.Node a} - (supported : f.SlotSupports a w r j x) : j < 3 := by - obtain ⟨i, rfl, _⟩ := supported - exact (f.request r).vertexSlot_lt_three i - -theorem slotSupports_lower {w : External J f.Letters} {r : R} {j : Nat} {x y : f.Node a} - (supported : f.SlotSupports a w r j y) (lower : (f.gluedOrder a).le x y) : - f.SlotSupports a w r j x := by - obtain ⟨i, code, z, rfl⟩ := supported - obtain ⟨v, equal⟩ := (f.copy a (f.flatWord w r i)).ideal z x lower - exact ⟨i, code, v, equal⟩ - -theorem slotSupports_tile {w : External J f.Letters} {r : R} {j : Nat} {x : f.Node a} - (supported : f.SlotSupports a w r j x) : (f.diagram a).scheme.Supports (.inr (w, r)) x := by - obtain ⟨y, _, equal⟩ := (f.slotSupports_iff a w r j x).1 supported - exact ⟨y, equal⟩ - -theorem tile_slot_cover (w : External J f.Letters) (r : R) (x : (f.tile r).Space) : - ∃ j, j < 3 ∧ f.SlotSupports a w r j ((f.placedTile a w r).toFun x) := - ⟨f.leastVertexSlot r x, f.leastVertexSlot_lt_three r x, - (f.slotSupports_placed_iff a w r _ x).2 (f.leastVertexSlot_support r x)⟩ - -theorem fresh_owner_slot_cover (x : f.Node a) (fresh : ¬ ∃ y, (f.copy a 1).toFun y = x) : - ∃ w r j, j < 3 ∧ (f.diagram a).scheme.LeastSupport (.inr (w, r)) x ∧ - f.SlotSupports a w r j x := by - obtain ⟨w, r, y, least, rfl, _⟩ := f.new_point_has_fresh_tile a x fresh - obtain ⟨j, bound, supported⟩ := f.tile_slot_cover a w r y - exact ⟨w, r, j, bound, least, supported⟩ - -theorem slotSupports_owner_cutoff {w : External J f.Letters} {r : R} {j : Nat} - {x : f.Node a} {v : TileStars.Vertex J f.Letters R} - (supported : f.SlotSupports a w r j x) (least : (f.diagram a).scheme.LeastSupport v x) : - (f.diagram a).scheme.depth v < (f.diagram a).scheme.depth (.inr (w, r)) ∨ - (v = .inr (w, r) ∧ ∃ y : (f.tile r).Space, - (f.placedTile a w r).toFun y = x ∧ f.leastVertexSlot r y ≤ j) := by - have bound := least.2 (.inr (w, r)) (f.slotSupports_tile a supported) - rcases Nat.lt_or_eq_of_le bound with lower | equal - · exact Or.inl lower - · have tileLeast : (f.diagram a).scheme.LeastSupport (.inr (w, r)) x := by - refine ⟨f.slotSupports_tile a supported, ?_⟩ - intro z supportZ - rw [← equal] - exact least.2 z supportZ - have same := (f.diagram a).scheme.leastSupport_unique least tileLeast - obtain ⟨y, localSupport, entry⟩ := (f.slotSupports_iff a w r j x).1 supported - exact Or.inr ⟨same, y, entry, f.leastVertexSlot_le localSupport⟩ - -end TileRequests.Family -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalCopyRelations +import OAI.SetTheory.PartitionPrinciple.Definability.RootedSupportOwnerFunction +import OAI.SetTheory.PartitionPrinciple.Forcing.RequestedSupportOwners + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.TileRequests +open Attachment CosetGeometry +universe u +variable {A : Type u} {P : MeetOrder A} + +namespace Request + +def vertexSlot : (r : Request P) → Option r.Child → Nat + | _, none => 0 + | .separation _, some _ => 1 + | .compression _ _, some _ => 1 + | .rectangle _, some j => if j.down then 2 else 1 + +theorem vertexSlot_lt_three (r : Request P) (i : Option r.Child) : r.vertexSlot i < 3 := by + cases r with + | separation W => cases i <;> simp [vertexSlot] + | compression K copy => cases i <;> simp [vertexSlot] + | rectangle rect => + cases i with + | none => simp [vertexSlot] + | some i => cases i with | up b => cases b <;> simp [vertexSlot] + +theorem vertexSlot_injective (r : Request P) : Function.Injective r.vertexSlot := by + cases r with + | separation W => + intro i j equal + cases i <;> cases j <;> simp_all [vertexSlot, Child] + exact congrArg some (Subsingleton.elim _ _) + | compression K copy => + intro i j equal + cases i <;> cases j <;> simp_all [vertexSlot, Child] + exact congrArg some (Subsingleton.elim _ _) + | rectangle rect => + intro i j equal + cases i with + | none => + cases j with + | none => rfl + | some j => cases j with | up b => cases b <;> simp_all [vertexSlot] + | some i => + cases j with + | none => cases i with | up b => cases b <;> simp_all [vertexSlot] + | some j => + cases i with | up b => + cases j with | up c => + cases b <;> cases c <;> simp_all [vertexSlot] + +end Request + +namespace Family +variable {R : Type u} (f : Family P R) + +def VertexSlotSupports (r : R) (j : Nat) (x : (f.tile r).Space) : Prop := + ∃ i : Option (f.Child r), (f.request r).vertexSlot i = j ∧ + ∃ y, (f.flatVertex r i).toFun y = x + +theorem vertexSlotSupports_bound {r : R} {j : Nat} {x : (f.tile r).Space} + (supported : f.VertexSlotSupports r j x) : j < 3 := by + obtain ⟨i, rfl, _⟩ := supported + exact (f.request r).vertexSlot_lt_three i + +theorem vertexSlotSupports_cover (r : R) (x : (f.tile r).Space) : + ∃ j, f.VertexSlotSupports r j x := by + obtain ⟨i, y, equal⟩ := f.flatVertex_cover r x + exact ⟨(f.request r).vertexSlot i, i, rfl, y, equal⟩ + +theorem vertexSlotSupports_lower {r : R} {j : Nat} {x y : (f.tile r).Space} + (supported : f.VertexSlotSupports r j y) (lower : (f.tile r).order.le x y) : + f.VertexSlotSupports r j x := by + obtain ⟨i, code, z, rfl⟩ := supported + obtain ⟨v, equal⟩ := (f.flatVertex r i).ideal z x lower + exact ⟨i, code, v, equal⟩ + +noncomputable def leastVertexSlot (r : R) (x : (f.tile r).Space) : Nat := by + classical + exact Nat.find (f.vertexSlotSupports_cover r x) + +theorem leastVertexSlot_support (r : R) (x : (f.tile r).Space) : + f.VertexSlotSupports r (f.leastVertexSlot r x) x := by + classical + exact Nat.find_spec (f.vertexSlotSupports_cover r x) + +theorem leastVertexSlot_lt_three (r : R) (x : (f.tile r).Space) : + f.leastVertexSlot r x < 3 := + f.vertexSlotSupports_bound (f.leastVertexSlot_support r x) + +theorem leastVertexSlot_le {r : R} {j : Nat} {x : (f.tile r).Space} + (supported : f.VertexSlotSupports r j x) : f.leastVertexSlot r x ≤ j := by + classical + exact Nat.find_min' (f.vertexSlotSupports_cover r x) supported + +theorem leastVertexSlot_eq_iff (r : R) (x : (f.tile r).Space) (j : Nat) : + f.leastVertexSlot r x = j ↔ + f.VertexSlotSupports r j x ∧ ∀ k, k < j → ¬ f.VertexSlotSupports r k x := by + constructor + · rintro rfl + refine ⟨f.leastVertexSlot_support r x, ?_⟩ + intro k lower supported + exact (Nat.not_lt_of_ge (f.leastVertexSlot_le supported)) lower + · rintro ⟨supported, minimal⟩ + apply Nat.le_antisymm (f.leastVertexSlot_le supported) + exact Nat.le_of_not_gt (fun lower => minimal _ lower (f.leastVertexSlot_support r x)) + +theorem leastVertexSlot_mono {r : R} {x y : (f.tile r).Space} + (lower : (f.tile r).order.le x y) : f.leastVertexSlot r x ≤ f.leastVertexSlot r y := + f.leastVertexSlot_le (f.vertexSlotSupports_lower (f.leastVertexSlot_support r y) lower) + +end Family +end PartitionPilot.Compression.RecursiveMaps.TileRequests + + + +namespace PartitionPilot.Compression.RecursiveMaps +open Attachment CosetGeometry +universe u + +namespace RootedGluing.Scheme +variable {V : Type u} (d : Scheme V) + +theorem leastSupport_meet_depth_lt {x y : d.Node} {v w k : V} + (first : d.LeastSupport v x) (second : d.LeastSupport w y) + (third : d.LeastSupport k (d.gluedOrder.meet x y)) + (same : d.depth v = d.depth w) (different : v ≠ w) : d.depth k < d.depth v := by + have bound := d.leastSupport_depth_mono third first (d.gluedOrder.meet_le_left x y) + apply Nat.lt_of_le_of_ne bound + intro equal + have left := d.leastSupport_eq_of_depth_eq third first + (d.gluedOrder.meet_le_left x y) equal + have right := d.leastSupport_eq_of_depth_eq third second + (d.gluedOrder.meet_le_right x y) (equal.trans same) + exact different (left.symm.trans right) + +theorem owner_meet_depth_lt {x y : d.Node} + (same : d.depth (d.owner x) = d.depth (d.owner y)) (different : d.owner x ≠ d.owner y) : + d.depth (d.owner (d.gluedOrder.meet x y)) < d.depth (d.owner x) := + d.leastSupport_meet_depth_lt (d.owner_least x) (d.owner_least y) + (d.owner_least (d.gluedOrder.meet x y)) same different + +end RootedGluing.Scheme + +namespace TileRequests.Family +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +def SlotSupports (w : External J f.Letters) (r : R) (j : Nat) (x : f.Node a) : Prop := + ∃ i : Option (f.Child r), (f.request r).vertexSlot i = j ∧ + ∃ y, (f.copy a (f.flatWord w r i)).toFun y = x + +theorem slotSupports_iff (w : External J f.Letters) (r : R) (j : Nat) (x : f.Node a) : + f.SlotSupports a w r j x ↔ + ∃ y : (f.tile r).Space, f.VertexSlotSupports r j y ∧ (f.placedTile a w r).toFun y = x := by + constructor + · rintro ⟨i, code, y, rfl⟩ + exact ⟨(f.flatVertex r i).toFun y, ⟨i, code, y, rfl⟩, f.flatVertex_copy a w r i y⟩ + · rintro ⟨y, ⟨i, code, z, rfl⟩, equal⟩ + exact ⟨i, code, z, (f.flatVertex_copy a w r i z).symm.trans equal⟩ + +theorem slotSupports_placed_iff (w : External J f.Letters) (r : R) (j : Nat) + (x : (f.tile r).Space) : + f.SlotSupports a w r j ((f.placedTile a w r).toFun x) ↔ f.VertexSlotSupports r j x := by + rw [f.slotSupports_iff] + constructor + · rintro ⟨y, supported, equal⟩ + have same := embedding_injective (f.placedTile a w r).toMeetEmbedding equal + exact same ▸ supported + · intro supported + exact ⟨x, supported, rfl⟩ + +theorem slotSupports_bound {w : External J f.Letters} {r : R} {j : Nat} {x : f.Node a} + (supported : f.SlotSupports a w r j x) : j < 3 := by + obtain ⟨i, rfl, _⟩ := supported + exact (f.request r).vertexSlot_lt_three i + +theorem slotSupports_lower {w : External J f.Letters} {r : R} {j : Nat} {x y : f.Node a} + (supported : f.SlotSupports a w r j y) (lower : (f.gluedOrder a).le x y) : + f.SlotSupports a w r j x := by + obtain ⟨i, code, z, rfl⟩ := supported + obtain ⟨v, equal⟩ := (f.copy a (f.flatWord w r i)).ideal z x lower + exact ⟨i, code, v, equal⟩ + +theorem slotSupports_tile {w : External J f.Letters} {r : R} {j : Nat} {x : f.Node a} + (supported : f.SlotSupports a w r j x) : (f.diagram a).scheme.Supports (.inr (w, r)) x := by + obtain ⟨y, _, equal⟩ := (f.slotSupports_iff a w r j x).1 supported + exact ⟨y, equal⟩ + +theorem tile_slot_cover (w : External J f.Letters) (r : R) (x : (f.tile r).Space) : + ∃ j, j < 3 ∧ f.SlotSupports a w r j ((f.placedTile a w r).toFun x) := + ⟨f.leastVertexSlot r x, f.leastVertexSlot_lt_three r x, + (f.slotSupports_placed_iff a w r _ x).2 (f.leastVertexSlot_support r x)⟩ + +theorem fresh_owner_slot_cover (x : f.Node a) (fresh : ¬ ∃ y, (f.copy a 1).toFun y = x) : + ∃ w r j, j < 3 ∧ (f.diagram a).scheme.LeastSupport (.inr (w, r)) x ∧ + f.SlotSupports a w r j x := by + obtain ⟨w, r, y, least, rfl, _⟩ := f.new_point_has_fresh_tile a x fresh + obtain ⟨j, bound, supported⟩ := f.tile_slot_cover a w r y + exact ⟨w, r, j, bound, least, supported⟩ + +theorem slotSupports_owner_cutoff {w : External J f.Letters} {r : R} {j : Nat} + {x : f.Node a} {v : TileStars.Vertex J f.Letters R} + (supported : f.SlotSupports a w r j x) (least : (f.diagram a).scheme.LeastSupport v x) : + (f.diagram a).scheme.depth v < (f.diagram a).scheme.depth (.inr (w, r)) ∨ + (v = .inr (w, r) ∧ ∃ y : (f.tile r).Space, + (f.placedTile a w r).toFun y = x ∧ f.leastVertexSlot r y ≤ j) := by + have bound := least.2 (.inr (w, r)) (f.slotSupports_tile a supported) + rcases Nat.lt_or_eq_of_le bound with lower | equal + · exact Or.inl lower + · have tileLeast : (f.diagram a).scheme.LeastSupport (.inr (w, r)) x := by + refine ⟨f.slotSupports_tile a supported, ?_⟩ + intro z supportZ + rw [← equal] + exact least.2 z supportZ + have same := (f.diagram a).scheme.leastSupport_unique least tileLeast + obtain ⟨y, localSupport, entry⟩ := (f.slotSupports_iff a w r j x).1 supported + exact Or.inr ⟨same, y, entry, f.leastVertexSlot_le localSupport⟩ + +end TileRequests.Family +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RootedSupportOrder.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RootedSupportOrder.lean index cc567021fca2dfc84f727c6e34eb8ab5bafda6a1..79ca9ea8f3b3ce6cd716ff1ef0cd43cf0f397bf1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RootedSupportOrder.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RootedSupportOrder.lean @@ -1,64 +1,64 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.RootedSupportOwners - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -universe u -variable {V : Type u} (d : Scheme V) - -theorem supports_lower {v : V} {x y : d.Node} - (supported : d.Supports v y) (lower : d.gluedOrder.le x y) : d.Supports v x := by - rcases supported with ⟨b, rfl⟩ - exact (d.vertex v).ideal b x lower - -theorem leastSupport_depth_mono {v w : V} {x y : d.Node} - (first : d.LeastSupport v x) (second : d.LeastSupport w y) - (lower : d.gluedOrder.le x y) : d.depth v ≤ d.depth w := - first.2 w (d.supports_lower second.1 lower) - -theorem leastSupport_eq_of_depth_eq {v w : V} {x y : d.Node} - (first : d.LeastSupport v x) (second : d.LeastSupport w y) - (lower : d.gluedOrder.le x y) (same : d.depth v = d.depth w) : v = w := by - apply d.leastSupport_unique first - refine ⟨d.supports_lower second.1 lower, ?_⟩ - intro z hz - rw [← same] - exact first.2 z hz - -theorem supports_coordinate_unique {v : V} {x : d.Node} (supported : d.Supports v x) : - ∃! a, (d.vertex v).toFun a = x := by - rcases supported with ⟨a, ha⟩ - exact ⟨a, ha, fun b hb => embedding_injective (d.vertex v).toMeetEmbedding (hb.trans ha.symm)⟩ - -theorem leastSupport_iff_not_parent (v : V) (h : d.depth v ≠ 0) (x : d.Node) : - d.LeastSupport v x ↔ d.Supports v x ∧ ¬ d.Supports (d.parent v) x := by - constructor - · intro least - refine ⟨least.1, ?_⟩ - intro parent - have bound := least.2 (d.parent v) parent - have smaller := d.parent_depth v h - omega - · rintro ⟨⟨a, rfl⟩, notparent⟩ - exact (d.leastSupport_vertex_iff v h a).mpr - (fun ha => notparent ((d.supports_parent_iff v h a).mpr ha)) - -theorem leastSupport_coordinates {v : V} {x y : d.Node} - (first : d.LeastSupport v x) (second : d.LeastSupport v y) - (lower : d.gluedOrder.le x y) : - ∃ a b, (d.vertex v).toFun a = x ∧ (d.vertex v).toFun b = y ∧ - (d.order v).le a b ∧ (a = b ↔ x = y) := by - rcases first.1 with ⟨a, rfl⟩ - rcases second.1 with ⟨b, rfl⟩ - refine ⟨a, b, rfl, rfl, ((d.vertex v).le_iff _ _).mp lower, ?_⟩ - exact ⟨congrArg (d.vertex v).toFun, - embedding_injective (d.vertex v).toMeetEmbedding⟩ - -end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.RootedSupportOwners + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +universe u +variable {V : Type u} (d : Scheme V) + +theorem supports_lower {v : V} {x y : d.Node} + (supported : d.Supports v y) (lower : d.gluedOrder.le x y) : d.Supports v x := by + rcases supported with ⟨b, rfl⟩ + exact (d.vertex v).ideal b x lower + +theorem leastSupport_depth_mono {v w : V} {x y : d.Node} + (first : d.LeastSupport v x) (second : d.LeastSupport w y) + (lower : d.gluedOrder.le x y) : d.depth v ≤ d.depth w := + first.2 w (d.supports_lower second.1 lower) + +theorem leastSupport_eq_of_depth_eq {v w : V} {x y : d.Node} + (first : d.LeastSupport v x) (second : d.LeastSupport w y) + (lower : d.gluedOrder.le x y) (same : d.depth v = d.depth w) : v = w := by + apply d.leastSupport_unique first + refine ⟨d.supports_lower second.1 lower, ?_⟩ + intro z hz + rw [← same] + exact first.2 z hz + +theorem supports_coordinate_unique {v : V} {x : d.Node} (supported : d.Supports v x) : + ∃! a, (d.vertex v).toFun a = x := by + rcases supported with ⟨a, ha⟩ + exact ⟨a, ha, fun b hb => embedding_injective (d.vertex v).toMeetEmbedding (hb.trans ha.symm)⟩ + +theorem leastSupport_iff_not_parent (v : V) (h : d.depth v ≠ 0) (x : d.Node) : + d.LeastSupport v x ↔ d.Supports v x ∧ ¬ d.Supports (d.parent v) x := by + constructor + · intro least + refine ⟨least.1, ?_⟩ + intro parent + have bound := least.2 (d.parent v) parent + have smaller := d.parent_depth v h + omega + · rintro ⟨⟨a, rfl⟩, notparent⟩ + exact (d.leastSupport_vertex_iff v h a).mpr + (fun ha => notparent ((d.supports_parent_iff v h a).mpr ha)) + +theorem leastSupport_coordinates {v : V} {x y : d.Node} + (first : d.LeastSupport v x) (second : d.LeastSupport v y) + (lower : d.gluedOrder.le x y) : + ∃ a b, (d.vertex v).toFun a = x ∧ (d.vertex v).toFun b = y ∧ + (d.order v).le a b ∧ (a = b ↔ x = y) := by + rcases first.1 with ⟨a, rfl⟩ + rcases second.1 with ⟨b, rfl⟩ + refine ⟨a, b, rfl, rfl, ((d.vertex v).le_iff _ _).mp lower, ?_⟩ + exact ⟨congrArg (d.vertex v).toFun, + embedding_injective (d.vertex v).toMeetEmbedding⟩ + +end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentOrderLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentOrderLaws.lean index 138333f0e64d7f4aee2ac0733f6b7f3bafc14f45..c6b851288533a2d87f7842da1a801a86491631d3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentOrderLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentOrderLaws.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneOrder - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem rowAssignmentOrder_partialOrder {Q C B r : ZFSet.{u}} - (shape : Q ⊆ ZFSet.prod C B) (rows : PartialOrderCode C r) : - PartialOrderCode Q (rowAssignmentOrder Q C B r) := by - refine ⟨fun z member => (mem_rowAssignmentOrder Q C B r z).1 member |>.1, ?_, ?_, ?_⟩ - · intro z hz - obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hz) - exact (pair_mem_rowAssignmentOrder Q C B r q A q A).2 - ⟨hz, hz, hq, hA, hq, hA, rows.refl q hq, fun _ h => h⟩ - · intro x hx y hy xy yx - obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hx) - obtain ⟨p, hp, D, hD, rfl⟩ := ZFSet.mem_prod.1 (shape hy) - have first := (pair_mem_rowAssignmentOrder Q C B r q A p D).1 xy - have second := (pair_mem_rowAssignmentOrder Q C B r p D q A).1 yx - have rowEq := rows.antisymm q hq p hp first.2.2.2.2.2.2.1 second.2.2.2.2.2.2.1 - have dataEq : A = D := ZFSet.ext (fun z => - ⟨fun h => second.2.2.2.2.2.2.2 h, fun h => first.2.2.2.2.2.2.2 h⟩) - rw [rowEq, dataEq] - · intro x hx y hy z hz xy yz - obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hx) - obtain ⟨p, hp, D, hD, rfl⟩ := ZFSet.mem_prod.1 (shape hy) - obtain ⟨s, hs, E, hE, rfl⟩ := ZFSet.mem_prod.1 (shape hz) - have first := (pair_mem_rowAssignmentOrder Q C B r q A p D).1 xy - have second := (pair_mem_rowAssignmentOrder Q C B r p D s E).1 yz - exact (pair_mem_rowAssignmentOrder Q C B r q A s E).2 - ⟨hx, hz, hq, hA, hs, hE, - rows.trans q hq p hp s hs first.2.2.2.2.2.2.1 second.2.2.2.2.2.2.1, - fun _ h => first.2.2.2.2.2.2.2 (second.2.2.2.2.2.2.2 h)⟩ - -theorem rowAssignmentOrder_top {Q C B r top : ZFSet.{u}} - (shape : Q ⊆ ZFSet.prod C B) - (rowTop : ∀ q ∈ C, ZFSet.pair q top ∈ r) - (member : ZFSet.pair top ∅ ∈ Q) : - ∀ z ∈ Q, ZFSet.pair z (ZFSet.pair top ∅) ∈ rowAssignmentOrder Q C B r := by - have topShape := ZFSet.pair_mem_prod.1 (shape member) - intro z hz - obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hz) - exact (pair_mem_rowAssignmentOrder Q C B r q A top ∅).2 - ⟨hz, member, hq, hA, topShape.1, topShape.2, rowTop q hq, - fun x impossible => False.elim (ZFSet.notMem_empty x impossible)⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageOneOrder + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem rowAssignmentOrder_partialOrder {Q C B r : ZFSet.{u}} + (shape : Q ⊆ ZFSet.prod C B) (rows : PartialOrderCode C r) : + PartialOrderCode Q (rowAssignmentOrder Q C B r) := by + refine ⟨fun z member => (mem_rowAssignmentOrder Q C B r z).1 member |>.1, ?_, ?_, ?_⟩ + · intro z hz + obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hz) + exact (pair_mem_rowAssignmentOrder Q C B r q A q A).2 + ⟨hz, hz, hq, hA, hq, hA, rows.refl q hq, fun _ h => h⟩ + · intro x hx y hy xy yx + obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hx) + obtain ⟨p, hp, D, hD, rfl⟩ := ZFSet.mem_prod.1 (shape hy) + have first := (pair_mem_rowAssignmentOrder Q C B r q A p D).1 xy + have second := (pair_mem_rowAssignmentOrder Q C B r p D q A).1 yx + have rowEq := rows.antisymm q hq p hp first.2.2.2.2.2.2.1 second.2.2.2.2.2.2.1 + have dataEq : A = D := ZFSet.ext (fun z => + ⟨fun h => second.2.2.2.2.2.2.2 h, fun h => first.2.2.2.2.2.2.2 h⟩) + rw [rowEq, dataEq] + · intro x hx y hy z hz xy yz + obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hx) + obtain ⟨p, hp, D, hD, rfl⟩ := ZFSet.mem_prod.1 (shape hy) + obtain ⟨s, hs, E, hE, rfl⟩ := ZFSet.mem_prod.1 (shape hz) + have first := (pair_mem_rowAssignmentOrder Q C B r q A p D).1 xy + have second := (pair_mem_rowAssignmentOrder Q C B r p D s E).1 yz + exact (pair_mem_rowAssignmentOrder Q C B r q A s E).2 + ⟨hx, hz, hq, hA, hs, hE, + rows.trans q hq p hp s hs first.2.2.2.2.2.2.1 second.2.2.2.2.2.2.1, + fun _ h => first.2.2.2.2.2.2.2 (second.2.2.2.2.2.2.2 h)⟩ + +theorem rowAssignmentOrder_top {Q C B r top : ZFSet.{u}} + (shape : Q ⊆ ZFSet.prod C B) + (rowTop : ∀ q ∈ C, ZFSet.pair q top ∈ r) + (member : ZFSet.pair top ∅ ∈ Q) : + ∀ z ∈ Q, ZFSet.pair z (ZFSet.pair top ∅) ∈ rowAssignmentOrder Q C B r := by + have topShape := ZFSet.pair_mem_prod.1 (shape member) + intro z hz + obtain ⟨q, hq, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape hz) + exact (pair_mem_rowAssignmentOrder Q C B r q A top ∅).2 + ⟨hz, member, hq, hA, topShape.1, topShape.2, rowTop q hq, + fun x impossible => False.elim (ZFSet.notMem_empty x impossible)⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentTransitionFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentTransitionFamilies.lean index a8b01588c61e17634f0a93356689bc9008f62528..f9b28db9c7543ffcab2093006658f48e3acd949f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentTransitionFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAssignmentTransitionFamilies.lean @@ -1,76 +1,76 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RowAssignmentCutGraphLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -noncomputable def rowAssignmentTransitionFamily (stages history levels W : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ stages, ∃ j ∈ stages, ∃ Qi Qj R, - R ∈ W ∧ z = ZFSet.pair (ZFSet.pair i j) R ∧ - ZFSet.pair i Qi ∈ history ∧ ZFSet.pair j Qj ∈ history ∧ - R = rowAssignmentCutGraph Qi Qj levels j) - (ZFSet.prod (ZFSet.prod stages stages) W) - -theorem mem_rowAssignmentTransitionFamily (stages history levels W z : ZFSet.{u}) : - z ∈ rowAssignmentTransitionFamily stages history levels W ↔ - z ∈ ZFSet.prod (ZFSet.prod stages stages) W ∧ - ∃ i ∈ stages, ∃ j ∈ stages, ∃ Qi Qj R, - R ∈ W ∧ z = ZFSet.pair (ZFSet.pair i j) R ∧ - ZFSet.pair i Qi ∈ history ∧ ZFSet.pair j Qj ∈ history ∧ - R = rowAssignmentCutGraph Qi Qj levels j := ZFSet.mem_sep - -theorem pair_mem_rowAssignmentTransitionFamily (stages history levels W i j R : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i j) R ∈ rowAssignmentTransitionFamily stages history levels W ↔ - i ∈ stages ∧ j ∈ stages ∧ R ∈ W ∧ ∃ Qi Qj, - ZFSet.pair i Qi ∈ history ∧ ZFSet.pair j Qj ∈ history ∧ - R = rowAssignmentCutGraph Qi Qj levels j := by - constructor - · intro entry - obtain ⟨_, a, ha, b, hb, Qi, Qj, R', hR, equal, first, second, output⟩ := - ZFSet.mem_sep.1 entry - obtain ⟨indices, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 indices - exact ⟨ha, hb, hR, Qi, Qj, first, second, output⟩ - · rintro ⟨hi, hj, hR, Qi, Qj, first, second, output⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hj⟩, hR⟩, - i, hi, j, hj, Qi, Qj, R, hR, rfl, first, second, output⟩ - -theorem rowAssignmentTransitionFamily_entry_iff {stages history levels W i j Qi Qj R : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (first : ZFSet.pair i Qi ∈ history) (second : ZFSet.pair j Qj ∈ history) : - ZFSet.pair (ZFSet.pair i j) R ∈ rowAssignmentTransitionFamily stages history levels W ↔ - R ∈ W ∧ R = rowAssignmentCutGraph Qi Qj levels j := by - rw [pair_mem_rowAssignmentTransitionFamily] - constructor - · rintro ⟨_, _, hR, Qi', Qj', left, right, equal⟩ - have eqi := function.unique left first - have eqj := function.unique right second - exact ⟨hR, eqi ▸ eqj ▸ equal⟩ - · rintro ⟨hR, equal⟩ - exact ⟨function.pair_source first, function.pair_source second, hR, Qi, Qj, first, second, equal⟩ - -theorem rowAssignmentTransitionFamily_function {stages history levels W : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (bounded : ∀ i ∈ stages, ∀ j ∈ stages, ∀ Qi Qj, - ZFSet.pair i Qi ∈ history → ZFSet.pair j Qj ∈ history → - rowAssignmentCutGraph Qi Qj levels j ∈ W) : - ZFSet.IsFunc (ZFSet.prod stages stages) W (rowAssignmentTransitionFamily stages history levels W) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro k hk - obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 hk - obtain ⟨Qi, first⟩ := function.total hi - obtain ⟨Qj, second⟩ := function.total hj - refine ⟨rowAssignmentCutGraph Qi Qj levels j, - (rowAssignmentTransitionFamily_entry_iff function first second).2 - ⟨bounded i hi j hj Qi Qj first second, rfl⟩, ?_⟩ - intro R entry - exact ((rowAssignmentTransitionFamily_entry_iff function first second).1 entry).2 - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RowAssignmentCutGraphLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +noncomputable def rowAssignmentTransitionFamily (stages history levels W : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ stages, ∃ j ∈ stages, ∃ Qi Qj R, + R ∈ W ∧ z = ZFSet.pair (ZFSet.pair i j) R ∧ + ZFSet.pair i Qi ∈ history ∧ ZFSet.pair j Qj ∈ history ∧ + R = rowAssignmentCutGraph Qi Qj levels j) + (ZFSet.prod (ZFSet.prod stages stages) W) + +theorem mem_rowAssignmentTransitionFamily (stages history levels W z : ZFSet.{u}) : + z ∈ rowAssignmentTransitionFamily stages history levels W ↔ + z ∈ ZFSet.prod (ZFSet.prod stages stages) W ∧ + ∃ i ∈ stages, ∃ j ∈ stages, ∃ Qi Qj R, + R ∈ W ∧ z = ZFSet.pair (ZFSet.pair i j) R ∧ + ZFSet.pair i Qi ∈ history ∧ ZFSet.pair j Qj ∈ history ∧ + R = rowAssignmentCutGraph Qi Qj levels j := ZFSet.mem_sep + +theorem pair_mem_rowAssignmentTransitionFamily (stages history levels W i j R : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i j) R ∈ rowAssignmentTransitionFamily stages history levels W ↔ + i ∈ stages ∧ j ∈ stages ∧ R ∈ W ∧ ∃ Qi Qj, + ZFSet.pair i Qi ∈ history ∧ ZFSet.pair j Qj ∈ history ∧ + R = rowAssignmentCutGraph Qi Qj levels j := by + constructor + · intro entry + obtain ⟨_, a, ha, b, hb, Qi, Qj, R', hR, equal, first, second, output⟩ := + ZFSet.mem_sep.1 entry + obtain ⟨indices, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 indices + exact ⟨ha, hb, hR, Qi, Qj, first, second, output⟩ + · rintro ⟨hi, hj, hR, Qi, Qj, first, second, output⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hj⟩, hR⟩, + i, hi, j, hj, Qi, Qj, R, hR, rfl, first, second, output⟩ + +theorem rowAssignmentTransitionFamily_entry_iff {stages history levels W i j Qi Qj R : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (first : ZFSet.pair i Qi ∈ history) (second : ZFSet.pair j Qj ∈ history) : + ZFSet.pair (ZFSet.pair i j) R ∈ rowAssignmentTransitionFamily stages history levels W ↔ + R ∈ W ∧ R = rowAssignmentCutGraph Qi Qj levels j := by + rw [pair_mem_rowAssignmentTransitionFamily] + constructor + · rintro ⟨_, _, hR, Qi', Qj', left, right, equal⟩ + have eqi := function.unique left first + have eqj := function.unique right second + exact ⟨hR, eqi ▸ eqj ▸ equal⟩ + · rintro ⟨hR, equal⟩ + exact ⟨function.pair_source first, function.pair_source second, hR, Qi, Qj, first, second, equal⟩ + +theorem rowAssignmentTransitionFamily_function {stages history levels W : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (bounded : ∀ i ∈ stages, ∀ j ∈ stages, ∀ Qi Qj, + ZFSet.pair i Qi ∈ history → ZFSet.pair j Qj ∈ history → + rowAssignmentCutGraph Qi Qj levels j ∈ W) : + ZFSet.IsFunc (ZFSet.prod stages stages) W (rowAssignmentTransitionFamily stages history levels W) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro k hk + obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 hk + obtain ⟨Qi, first⟩ := function.total hi + obtain ⟨Qj, second⟩ := function.total hj + refine ⟨rowAssignmentCutGraph Qi Qj levels j, + (rowAssignmentTransitionFamily_entry_iff function first second).2 + ⟨bounded i hi j hj Qi Qj first second, rfl⟩, ?_⟩ + intro R entry + exact ((rowAssignmentTransitionFamily_entry_iff function first second).1 entry).2 + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAtomicDescent.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAtomicDescent.lean index 03d17bb6380c9c8fd44edf75c930aa1b07cbf1f0..f1605707777a5230d25cf6435a831ebbeec9b1f4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAtomicDescent.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowAtomicDescent.lean @@ -1,67 +1,67 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.RowSupportDescent - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Rows - -open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns -open Compression.RecursiveMaps.MainStage.OrdinalRun - -def rowAtomicFamily (N : Name.NameDomain namePresentation) : Set (Set RowForcing) := - Name.atomicFamily N ∪ {E | ∃ p C B D x y, x ∈ N.names ∧ y ∈ N.names ∧ - E ∈ descentWitnessFamily p C B D x y} - -theorem translated_eval_eq_of_forcesEq (N : Name.NameDomain namePresentation) - (translated : ∀ g τ, τ ∈ N.names → posetAction.act namePresentation g τ ∈ N.names) - (H : ConditionFilter RowForcing) (generic : H.GenericFor (Name.atomicFamily N)) - {x y : Name namePresentation} (hx : x ∈ N.names) (hy : y ∈ N.names) - {p : RowForcing} (eq : Name.ForcesEq p x y) : - ∀ g, H.mem (rowAction g p) → - Name.eval {q | H.mem q} (posetAction.act namePresentation g x) = - Name.eval {q | H.mem q} (posetAction.act namePresentation g y) := by - intro g active - exact Name.forcesEq_sound N H generic _ (translated g x hx) _ (translated g y hy) - _ active (posetAction.forcesEq_act namePresentation g eq) - -theorem row_common_support_of_eval_eq (N : Name.NameDomain namePresentation) - (translated : ∀ g τ, τ ∈ N.names → posetAction.act namePresentation g τ ∈ N.names) - (mixed : ∀ W p τ, τ ∈ N.names → posetAction.mix namePresentation - ((finalAction Column).fixSubgroup W) p τ ∈ N.names) - (H : ConditionFilter RowForcing) (generic : H.GenericFor (rowAtomicFamily N)) - (C B : FinalPoint Column) (x y : Name namePresentation) - (hx : x ∈ N.names) (hy : y ∈ N.names) - (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) - (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) - (hs : HereditarilySymmetric posetAction namePresentation (supportFamily Column) x) - (values : Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} y) : - ∃ z ∈ N.names, - HereditarilySymmetric posetAction namePresentation (supportFamily Column) z ∧ - (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) ≤ - posetAction.stabilizer namePresentation z ∧ - Name.nameRank z ≤ Name.nameRank x ∧ - Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by - have atoms : H.GenericFor (Name.atomicFamily N) := - fun E hE dense => generic E (Or.inl hE) dense - obtain ⟨p, hp, eq⟩ := (Name.eval_eq_iff_forcesEq N H atoms hx hy).1 values - obtain ⟨D, bp, upper⟩ := bounds_with p {C, B} ((Set.countable_singleton B).insert C) - have cd := upper C (by simp) - have bd := upper B (by simp) - have copies : H.GenericFor (descentWitnessFamily p C B D x y) := - fun E hE dense => generic E (Or.inr ⟨p, C, B, D, x, y, hx, hy, hE⟩) dense - let W := (finalOrder Column).meet C B - let K := (finalAction Column).fixSubgroup W - refine ⟨posetAction.mix namePresentation K p x, mixed W p x hx, - posetAction.mix_hs namePresentation (supportFamily Column) K ⟨W, le_rfl⟩ p hs, - ?_, posetAction.nameRank_mix_le namePresentation K p x, ?_⟩ - · intro g hg - exact posetAction.mix_fixed namePresentation K p x hg - · exact row_mix_capture p C B D x y bp cd bd sx sy H copies hp - (translated_eval_eq_of_forcesEq N translated H atoms hx hy eq) - -end PartitionPilot.Forcing.Rows - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.RowSupportDescent + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Rows + +open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns +open Compression.RecursiveMaps.MainStage.OrdinalRun + +def rowAtomicFamily (N : Name.NameDomain namePresentation) : Set (Set RowForcing) := + Name.atomicFamily N ∪ {E | ∃ p C B D x y, x ∈ N.names ∧ y ∈ N.names ∧ + E ∈ descentWitnessFamily p C B D x y} + +theorem translated_eval_eq_of_forcesEq (N : Name.NameDomain namePresentation) + (translated : ∀ g τ, τ ∈ N.names → posetAction.act namePresentation g τ ∈ N.names) + (H : ConditionFilter RowForcing) (generic : H.GenericFor (Name.atomicFamily N)) + {x y : Name namePresentation} (hx : x ∈ N.names) (hy : y ∈ N.names) + {p : RowForcing} (eq : Name.ForcesEq p x y) : + ∀ g, H.mem (rowAction g p) → + Name.eval {q | H.mem q} (posetAction.act namePresentation g x) = + Name.eval {q | H.mem q} (posetAction.act namePresentation g y) := by + intro g active + exact Name.forcesEq_sound N H generic _ (translated g x hx) _ (translated g y hy) + _ active (posetAction.forcesEq_act namePresentation g eq) + +theorem row_common_support_of_eval_eq (N : Name.NameDomain namePresentation) + (translated : ∀ g τ, τ ∈ N.names → posetAction.act namePresentation g τ ∈ N.names) + (mixed : ∀ W p τ, τ ∈ N.names → posetAction.mix namePresentation + ((finalAction Column).fixSubgroup W) p τ ∈ N.names) + (H : ConditionFilter RowForcing) (generic : H.GenericFor (rowAtomicFamily N)) + (C B : FinalPoint Column) (x y : Name namePresentation) + (hx : x ∈ N.names) (hy : y ∈ N.names) + (sx : (finalAction Column).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) + (sy : (finalAction Column).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) + (hs : HereditarilySymmetric posetAction namePresentation (supportFamily Column) x) + (values : Name.eval {q | H.mem q} x = Name.eval {q | H.mem q} y) : + ∃ z ∈ N.names, + HereditarilySymmetric posetAction namePresentation (supportFamily Column) z ∧ + (finalAction Column).fixSubgroup ((finalOrder Column).meet C B) ≤ + posetAction.stabilizer namePresentation z ∧ + Name.nameRank z ≤ Name.nameRank x ∧ + Name.eval {q | H.mem q} z = Name.eval {q | H.mem q} x := by + have atoms : H.GenericFor (Name.atomicFamily N) := + fun E hE dense => generic E (Or.inl hE) dense + obtain ⟨p, hp, eq⟩ := (Name.eval_eq_iff_forcesEq N H atoms hx hy).1 values + obtain ⟨D, bp, upper⟩ := bounds_with p {C, B} ((Set.countable_singleton B).insert C) + have cd := upper C (by simp) + have bd := upper B (by simp) + have copies : H.GenericFor (descentWitnessFamily p C B D x y) := + fun E hE dense => generic E (Or.inr ⟨p, C, B, D, x, y, hx, hy, hE⟩) dense + let W := (finalOrder Column).meet C B + let K := (finalAction Column).fixSubgroup W + refine ⟨posetAction.mix namePresentation K p x, mixed W p x hx, + posetAction.mix_hs namePresentation (supportFamily Column) K ⟨W, le_rfl⟩ p hs, + ?_, posetAction.nameRank_mix_le namePresentation K p x, ?_⟩ + · intro g hg + exact posetAction.mix_fixed namePresentation K p x hg + · exact row_mix_capture p C B D x y bp cd bd sx sy H copies hp + (translated_eval_eq_of_forcesEq N translated H atoms hx hy eq) + +end PartitionPilot.Forcing.Rows + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowCopyRefinements.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowCopyRefinements.lean index a7bc801404aff0e1333b0b2b3a8d9687d41cf9b1..e04109354a63e3031a198a76997bb43410d2f46d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowCopyRefinements.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowCopyRefinements.lean @@ -1,265 +1,265 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.NameMixingRanks -import OAI.SetTheory.PartitionPrinciple.Forcing.RowNames - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Rows - -open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns -open Compression.RecursiveMaps.MainStage.OrdinalRun CountableCondition - -def Bounds (p : RowForcing) (D : FinalPoint Column) : Prop := - ∀ i : Position, ∀ α : Column, p.value (i, α) ≠ none → (finalOrder Column).le i.val D - -theorem bounds_mono {p : RowForcing} {D E : FinalPoint Column} - (bounded : Bounds p D) (lower : (finalOrder Column).le D E) : Bounds p E := - fun i α hi => (finalOrder Column).trans (bounded i α hi) lower - -theorem bounds_action {p : RowForcing} {D : FinalPoint Column} - (bounded : Bounds p D) (g : FinalActor Column) : - Bounds (rowAction g p) (((finalAction Column).iso g).toFun D) := by - intro i α hi - let j := (positionPermutation g).symm i - have gj : positionAction g j = i := (positionPermutation g).apply_symm_apply i - have val := rowAction_value g p j α - rw [gj] at val - have lower := (((finalAction Column).iso g).le_iff _ _).2 - (bounded j α (val ▸ hi)) - change (finalOrder Column).le (positionAction g j).val _ at lower - simpa only [gj] using lower - -theorem bounds_with (p : RowForcing) (extra : Set (FinalPoint Column)) - (small : extra.Countable) : - ∃ D, Bounds p D ∧ ∀ x ∈ extra, (finalOrder Column).le x D := by - let positions : Set (FinalPoint Column) := (fun c : Position × Column => c.1.val) '' p.domain - have countable : positions.Countable := p.countable_domain.image (fun c => c.1.val) - obtain ⟨D, bound⟩ := final_countable_upper_bound Column (positions ∪ extra) (countable.union small) - exact ⟨D, fun i α hi => bound i.val (Or.inl ⟨(i, α), hi, rfl⟩), - fun x hx => bound x (Or.inr hx)⟩ - -theorem aligned_agrees {p r : RowForcing} {D X V₀ : FinalPoint Column} - {g h : FinalActor Column} (bp : Bounds p D) (br : Bounds r X) - (reference : r ≤ rowAction g p) - (overlap : (finalOrder Column).meet (((finalAction Column).iso h).toFun D) X = - ((finalAction Column).iso h).toFun V₀) - (agree : ∀ z, (finalOrder Column).le z V₀ → - ((finalAction Column).iso h).toFun z = ((finalAction Column).iso g).toFun z) : - Agrees r (rowAction h p) := by - rintro ⟨i, α⟩ a b ra hb - have ri := br i α (by rw [ra]; exact Option.some_ne_none a) - have hi := bounds_action bp h i α (by rw [hb]; exact Option.some_ne_none b) - have below := (finalOrder Column).le_meet hi ri - rw [overlap] at below - let j := (positionPermutation h).symm i - have hj : positionAction h j = i := (positionPermutation h).apply_symm_apply i - have old : (finalOrder Column).le j.val V₀ := by - apply (((finalAction Column).iso h).le_iff _ _).1 - change (finalOrder Column).le (positionAction h j).val _ - simpa only [hj] using below - have gj : positionAction g j = i := by - apply Subtype.ext - exact (agree j.val old).symm.trans (congrArg Subtype.val hj) - have pv := rowAction_value h p j α - rw [hj, hb] at pv - have gv := rowAction_value g p j α - rw [gj, ← pv] at gv - have rb := reference (i, α) b gv - exact Option.some.inj (ra.symm.trans rb) - -theorem one_copy_union {p r : RowForcing} {D X V₀ : FinalPoint Column} - {g h : FinalActor Column} (bp : Bounds p D) (br : Bounds r X) - (reference : r ≤ rowAction g p) - (overlap : (finalOrder Column).meet (((finalAction Column).iso h).toFun D) X = - ((finalAction Column).iso h).toFun V₀) - (agree : ∀ z, (finalOrder Column).le z V₀ → - ((finalAction Column).iso h).toFun z = ((finalAction Column).iso g).toFun z) : - ∃ t, t ≤ r ∧ t ≤ rowAction h p := - ⟨merge r (rowAction h p), merge_le_left _ _, - merge_le_right (aligned_agrees bp br reference overlap agree)⟩ - -theorem rectangle_union {p r : RowForcing} {D X C B : FinalPoint Column} - {g₁ g₂ h₁ h₂ : FinalActor Column} (bp : Bounds p D) (br : Bounds r X) - (ref₁ : r ≤ rowAction g₁ p) (ref₂ : r ≤ rowAction g₂ p) - (agree₁ : ∀ z, (finalOrder Column).le z C → - ((finalAction Column).iso h₁).toFun z = ((finalAction Column).iso g₁).toFun z) - (agree₂ : ∀ z, (finalOrder Column).le z C → - ((finalAction Column).iso h₂).toFun z = ((finalAction Column).iso g₂).toFun z) - (agreeB : ∀ z, (finalOrder Column).le z B → - ((finalAction Column).iso h₁).toFun z = ((finalAction Column).iso h₂).toFun z) - (overlap₁ : (finalOrder Column).meet (((finalAction Column).iso h₁).toFun D) X = - ((finalAction Column).iso h₁).toFun C) - (overlap₂ : (finalOrder Column).meet (((finalAction Column).iso h₂).toFun D) X = - ((finalAction Column).iso h₂).toFun C) - (pairOverlap : (finalOrder Column).meet (((finalAction Column).iso h₁).toFun D) - (((finalAction Column).iso h₂).toFun D) = ((finalAction Column).iso h₁).toFun B) : - ∃ t, t ≤ r ∧ t ≤ rowAction h₁ p ∧ t ≤ rowAction h₂ p := by - have one := aligned_agrees bp br ref₁ overlap₁ agree₁ - have two := aligned_agrees bp br ref₂ overlap₂ agree₂ - have pair := aligned_agrees bp (bounds_action bp h₂) le_rfl pairOverlap agreeB - exact three_agree_common one two (agrees_symm pair) - -end PartitionPilot.Forcing.Rows - - - -namespace PartitionPilot.Forcing.PosetAction - -open SetRealization Compression.RecursiveMaps -universe u v -variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] -variable (a : PosetAction G P) (s : Presentation P) - -def RectangleWitness (p : P) (x y : Name s) (g₁ g₂ : G) : Set P := - {q | ∃ h₁ h₂, q ≤ a.iso h₁ p ∧ q ≤ a.iso h₂ p ∧ - a.act s h₁ x = a.act s g₁ x ∧ a.act s h₂ x = a.act s g₂ x ∧ - a.act s h₁ y = a.act s h₂ y} - -def SeparationWitness (K : Subgroup G) (Sep : G → G → Prop) (p : P) (g₁ g₂ : G) : Set P := - {q | ∃ h ∈ K, q ≤ a.iso h p ∧ Sep h g₁ ∧ Sep h g₂} - -def copyWitnessFamily (K : Subgroup G) (Sep : G → G → Prop) (p : P) (x y : Name s) : - Set (Set P) := - {D | (∃ r g₁ g₂, D = Localized r (a.RectangleWitness s p x y g₁ g₂)) ∨ - ∃ r g₁ g₂, D = Localized r (a.SeparationWitness K Sep p g₁ g₂)} - -theorem separated_copies_agree (K : Subgroup G) (Sep : G → G → Prop) - (p : P) (x y : Name s) (H : ConditionFilter P) - (generic : H.GenericFor (a.copyWitnessFamily s K Sep p x y)) - (xy : ∀ g, H.mem (a.iso g p) → - Name.eval {q | H.mem q} (a.act s g x) = Name.eval {q | H.mem q} (a.act s g y)) - (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, - r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) - {g₁ g₂ : G} (hg₁ : g₁ ∈ K) (hg₂ : g₂ ∈ K) (sep : Sep g₁ g₂) - (active₁ : H.mem (a.iso g₁ p)) (active₂ : H.mem (a.iso g₂ p)) : - Name.eval {q | H.mem q} (a.act s g₁ x) = Name.eval {q | H.mem q} (a.act s g₂ x) := by - obtain ⟨r, hr, r₁, r₂⟩ := H.directed active₁ active₂ - obtain ⟨q, hq, h₁, h₂, q₁, q₂, hx₁, hx₂, hy⟩ := - H.meets_below generic hr (Or.inl ⟨r, g₁, g₂, rfl⟩) - (rectangles g₁ hg₁ g₂ hg₂ sep r r₁ r₂) - have eq₁ := xy h₁ (H.upward hq q₁) - have eq₂ := xy h₂ (H.upward hq q₂) - rw [hx₁] at eq₁ - rw [hx₂] at eq₂ - exact eq₁.trans ((congrArg (Name.eval {q | H.mem q}) hy).trans eq₂.symm) - -theorem active_copies_agree (K : Subgroup G) (Sep : G → G → Prop) - (p : P) (x y : Name s) (H : ConditionFilter P) - (generic : H.GenericFor (a.copyWitnessFamily s K Sep p x y)) - (xy : ∀ g, H.mem (a.iso g p) → - Name.eval {q | H.mem q} (a.act s g x) = Name.eval {q | H.mem q} (a.act s g y)) - (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, - r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) - (separation : ∀ g₁ ∈ K, ∀ g₂ ∈ K, ∀ r, - r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.SeparationWitness K Sep p g₁ g₂)) - {g₁ g₂ : G} (hg₁ : g₁ ∈ K) (hg₂ : g₂ ∈ K) - (active₁ : H.mem (a.iso g₁ p)) (active₂ : H.mem (a.iso g₂ p)) : - Name.eval {q | H.mem q} (a.act s g₁ x) = Name.eval {q | H.mem q} (a.act s g₂ x) := by - obtain ⟨r, hr, r₁, r₂⟩ := H.directed active₁ active₂ - obtain ⟨q, hq, h, hh, qh, sep₁, sep₂⟩ := - H.meets_below generic hr (Or.inr ⟨r, g₁, g₂, rfl⟩) - (separation g₁ hg₁ g₂ hg₂ r r₁ r₂) - have active := H.upward hq qh - have eq₁ := a.separated_copies_agree s K Sep p x y H generic xy rectangles hh hg₁ sep₁ active active₁ - have eq₂ := a.separated_copies_agree s K Sep p x y H generic xy rectangles hh hg₂ sep₂ active active₂ - exact eq₁.symm.trans eq₂ - -theorem mix_capture_from_refinements [Small.{u} G] (K : Subgroup G) (Sep : G → G → Prop) - (p : P) (x y : Name s) (H : ConditionFilter P) - (generic : H.GenericFor (a.copyWitnessFamily s K Sep p x y)) (hp : H.mem p) - (xy : ∀ g, H.mem (a.iso g p) → - Name.eval {q | H.mem q} (a.act s g x) = Name.eval {q | H.mem q} (a.act s g y)) - (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, - r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) - (separation : ∀ g₁ ∈ K, ∀ g₂ ∈ K, ∀ r, - r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.SeparationWitness K Sep p g₁ g₂)) : - Name.eval {q | H.mem q} (a.mix s K p x) = Name.eval {q | H.mem q} x := by - apply a.eval_mix_of_active_equal s K p x H hp - intro g hg active - have eq := a.active_copies_agree s K Sep p x y H generic xy rectangles separation - hg K.one_mem active (by simpa only [a.one] using hp) - simpa only [a.act_one] using eq - -end PartitionPilot.Forcing.PosetAction - - - -namespace PartitionPilot.Forcing.Rows - -open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns -open Compression.RecursiveMaps.MainStage.OrdinalRun - -local notation "L" => finalOrder Column -local notation "geom" => finalAction Column - -def Separated (D W : FinalPoint Column) (g h : FinalActor Column) : Prop := - (L).meet (((geom).iso g).toFun D) (((geom).iso h).toFun D) = W - -theorem fixed_lower_image {W D : FinalPoint Column} {g : FinalActor Column} - (wd : (L).le W D) (hg : g ∈ (geom).fixSubgroup W) : (L).le W (((geom).iso g).toFun D) := by - have lower := (((geom).iso g).le_iff _ _).2 wd - rw [hg W ((L).refl W)] at lower - exact lower - -theorem rectangle_refinement (p : RowForcing) (C B D : FinalPoint Column) - (x y : Name namePresentation) (bp : Bounds p D) (cd : (L).le C D) (bd : (L).le B D) - (sx : (geom).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) - (sy : (geom).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) - (g₁ : FinalActor Column) (hg₁ : g₁ ∈ (geom).fixSubgroup ((L).meet C B)) - (g₂ : FinalActor Column) (hg₂ : g₂ ∈ (geom).fixSubgroup ((L).meet C B)) - (sep : Separated D ((L).meet C B) g₁ g₂) (r : RowForcing) - (ref₁ : r ≤ rowAction g₁ p) (ref₂ : r ≤ rowAction g₂ p) : - DenseBelow r (posetAction.RectangleWitness namePresentation p x y g₁ g₂) := by - intro q qr - obtain ⟨X, bq, upper⟩ := bounds_with q - {(((geom).iso g₁).toFun D), (((geom).iso g₂).toFun D)} ((Set.countable_singleton _).insert _) - let rect : ActionRectangle L (geom).iso := { - C := C, B := B, D := D, first := g₁, second := g₂, - C_le_D := cd, B_le_D := bd, - agree := fun z hz => (hg₁ z hz).trans (hg₂ z hz).symm, - separated := sep.trans (hg₁ ((L).meet C B) ((L).refl _)).symm } - obtain ⟨h₁, h₂, agree₁, agree₂, agreeB, meet₁, meet₂, pairMeet⟩ := - final_rectangles Column rect X (upper _ (by simp [rect])) (upper _ (by simp [rect])) - have overlap₁ : (L).meet (((geom).iso h₁).toFun D) X = ((geom).iso h₁).toFun C := - meet₁.trans (agree₁ C ((L).refl C)).symm - have overlap₂ : (L).meet (((geom).iso h₂).toFun D) X = ((geom).iso h₂).toFun C := - meet₂.trans (agree₂ C ((L).refl C)).symm - obtain ⟨t, tq, th₁, th₂⟩ := rectangle_union bp bq (le_trans qr ref₁) (le_trans qr ref₂) - agree₁ agree₂ agreeB overlap₁ overlap₂ pairMeet - exact ⟨t, tq, h₁, h₂, th₁, th₂, - posetAction.act_eq_of_support_agreement geom namePresentation sx agree₁, - posetAction.act_eq_of_support_agreement geom namePresentation sx agree₂, - posetAction.act_eq_of_support_agreement geom namePresentation sy agreeB⟩ - -theorem separation_refinement (p : RowForcing) (W D : FinalPoint Column) - (bp : Bounds p D) (wd : (L).le W D) - (g₁ : FinalActor Column) (hg₁ : g₁ ∈ (geom).fixSubgroup W) - (g₂ : FinalActor Column) (hg₂ : g₂ ∈ (geom).fixSubgroup W) - (r : RowForcing) (ref₁ : r ≤ rowAction g₁ p) : - DenseBelow r (posetAction.SeparationWitness ((geom).fixSubgroup W) (Separated D W) p g₁ g₂) := by - intro q qr - obtain ⟨X, bq, upper⟩ := bounds_with q - {(((geom).iso g₁).toFun D), (((geom).iso g₂).toFun D)} ((Set.countable_singleton _).insert _) - have lower₁ := fixed_lower_image wd hg₁ - have lower₂ := fixed_lower_image wd hg₂ - have upper₁ := upper (((geom).iso g₁).toFun D) (by simp) - have upper₂ := upper (((geom).iso g₂).toFun D) (by simp) - obtain ⟨h, fixed, overlap⟩ := final_separation Column W D X wd ((L).trans lower₁ upper₁) - have overlap' : (L).meet (((geom).iso h).toFun D) X = ((geom).iso h).toFun W := - overlap.trans (fixed W ((L).refl W)).symm - obtain ⟨t, tq, th⟩ := one_copy_union bp bq (le_trans qr ref₁) overlap' - (fun z hz => (fixed z hz).trans (hg₁ z hz).symm) - have sep (Y : FinalPoint Column) (wy : (L).le W Y) (yx : (L).le Y X) : - (L).meet (((geom).iso h).toFun D) Y = W := by - apply (L).antisymm - · rw [← overlap] - exact (L).le_meet ((L).meet_le_left _ _) ((L).trans ((L).meet_le_right _ _) yx) - · exact (L).le_meet (fixed_lower_image wd fixed) wy - exact ⟨t, tq, h, fixed, th, sep _ lower₁ upper₁, sep _ lower₂ upper₂⟩ - -end PartitionPilot.Forcing.Rows - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.NameMixingRanks +import OAI.SetTheory.PartitionPrinciple.Forcing.RowNames + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Rows + +open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns +open Compression.RecursiveMaps.MainStage.OrdinalRun CountableCondition + +def Bounds (p : RowForcing) (D : FinalPoint Column) : Prop := + ∀ i : Position, ∀ α : Column, p.value (i, α) ≠ none → (finalOrder Column).le i.val D + +theorem bounds_mono {p : RowForcing} {D E : FinalPoint Column} + (bounded : Bounds p D) (lower : (finalOrder Column).le D E) : Bounds p E := + fun i α hi => (finalOrder Column).trans (bounded i α hi) lower + +theorem bounds_action {p : RowForcing} {D : FinalPoint Column} + (bounded : Bounds p D) (g : FinalActor Column) : + Bounds (rowAction g p) (((finalAction Column).iso g).toFun D) := by + intro i α hi + let j := (positionPermutation g).symm i + have gj : positionAction g j = i := (positionPermutation g).apply_symm_apply i + have val := rowAction_value g p j α + rw [gj] at val + have lower := (((finalAction Column).iso g).le_iff _ _).2 + (bounded j α (val ▸ hi)) + change (finalOrder Column).le (positionAction g j).val _ at lower + simpa only [gj] using lower + +theorem bounds_with (p : RowForcing) (extra : Set (FinalPoint Column)) + (small : extra.Countable) : + ∃ D, Bounds p D ∧ ∀ x ∈ extra, (finalOrder Column).le x D := by + let positions : Set (FinalPoint Column) := (fun c : Position × Column => c.1.val) '' p.domain + have countable : positions.Countable := p.countable_domain.image (fun c => c.1.val) + obtain ⟨D, bound⟩ := final_countable_upper_bound Column (positions ∪ extra) (countable.union small) + exact ⟨D, fun i α hi => bound i.val (Or.inl ⟨(i, α), hi, rfl⟩), + fun x hx => bound x (Or.inr hx)⟩ + +theorem aligned_agrees {p r : RowForcing} {D X V₀ : FinalPoint Column} + {g h : FinalActor Column} (bp : Bounds p D) (br : Bounds r X) + (reference : r ≤ rowAction g p) + (overlap : (finalOrder Column).meet (((finalAction Column).iso h).toFun D) X = + ((finalAction Column).iso h).toFun V₀) + (agree : ∀ z, (finalOrder Column).le z V₀ → + ((finalAction Column).iso h).toFun z = ((finalAction Column).iso g).toFun z) : + Agrees r (rowAction h p) := by + rintro ⟨i, α⟩ a b ra hb + have ri := br i α (by rw [ra]; exact Option.some_ne_none a) + have hi := bounds_action bp h i α (by rw [hb]; exact Option.some_ne_none b) + have below := (finalOrder Column).le_meet hi ri + rw [overlap] at below + let j := (positionPermutation h).symm i + have hj : positionAction h j = i := (positionPermutation h).apply_symm_apply i + have old : (finalOrder Column).le j.val V₀ := by + apply (((finalAction Column).iso h).le_iff _ _).1 + change (finalOrder Column).le (positionAction h j).val _ + simpa only [hj] using below + have gj : positionAction g j = i := by + apply Subtype.ext + exact (agree j.val old).symm.trans (congrArg Subtype.val hj) + have pv := rowAction_value h p j α + rw [hj, hb] at pv + have gv := rowAction_value g p j α + rw [gj, ← pv] at gv + have rb := reference (i, α) b gv + exact Option.some.inj (ra.symm.trans rb) + +theorem one_copy_union {p r : RowForcing} {D X V₀ : FinalPoint Column} + {g h : FinalActor Column} (bp : Bounds p D) (br : Bounds r X) + (reference : r ≤ rowAction g p) + (overlap : (finalOrder Column).meet (((finalAction Column).iso h).toFun D) X = + ((finalAction Column).iso h).toFun V₀) + (agree : ∀ z, (finalOrder Column).le z V₀ → + ((finalAction Column).iso h).toFun z = ((finalAction Column).iso g).toFun z) : + ∃ t, t ≤ r ∧ t ≤ rowAction h p := + ⟨merge r (rowAction h p), merge_le_left _ _, + merge_le_right (aligned_agrees bp br reference overlap agree)⟩ + +theorem rectangle_union {p r : RowForcing} {D X C B : FinalPoint Column} + {g₁ g₂ h₁ h₂ : FinalActor Column} (bp : Bounds p D) (br : Bounds r X) + (ref₁ : r ≤ rowAction g₁ p) (ref₂ : r ≤ rowAction g₂ p) + (agree₁ : ∀ z, (finalOrder Column).le z C → + ((finalAction Column).iso h₁).toFun z = ((finalAction Column).iso g₁).toFun z) + (agree₂ : ∀ z, (finalOrder Column).le z C → + ((finalAction Column).iso h₂).toFun z = ((finalAction Column).iso g₂).toFun z) + (agreeB : ∀ z, (finalOrder Column).le z B → + ((finalAction Column).iso h₁).toFun z = ((finalAction Column).iso h₂).toFun z) + (overlap₁ : (finalOrder Column).meet (((finalAction Column).iso h₁).toFun D) X = + ((finalAction Column).iso h₁).toFun C) + (overlap₂ : (finalOrder Column).meet (((finalAction Column).iso h₂).toFun D) X = + ((finalAction Column).iso h₂).toFun C) + (pairOverlap : (finalOrder Column).meet (((finalAction Column).iso h₁).toFun D) + (((finalAction Column).iso h₂).toFun D) = ((finalAction Column).iso h₁).toFun B) : + ∃ t, t ≤ r ∧ t ≤ rowAction h₁ p ∧ t ≤ rowAction h₂ p := by + have one := aligned_agrees bp br ref₁ overlap₁ agree₁ + have two := aligned_agrees bp br ref₂ overlap₂ agree₂ + have pair := aligned_agrees bp (bounds_action bp h₂) le_rfl pairOverlap agreeB + exact three_agree_common one two (agrees_symm pair) + +end PartitionPilot.Forcing.Rows + + + +namespace PartitionPilot.Forcing.PosetAction + +open SetRealization Compression.RecursiveMaps +universe u v +variable {G : Type v} [Group G] {P : Type u} [PartialOrder P] +variable (a : PosetAction G P) (s : Presentation P) + +def RectangleWitness (p : P) (x y : Name s) (g₁ g₂ : G) : Set P := + {q | ∃ h₁ h₂, q ≤ a.iso h₁ p ∧ q ≤ a.iso h₂ p ∧ + a.act s h₁ x = a.act s g₁ x ∧ a.act s h₂ x = a.act s g₂ x ∧ + a.act s h₁ y = a.act s h₂ y} + +def SeparationWitness (K : Subgroup G) (Sep : G → G → Prop) (p : P) (g₁ g₂ : G) : Set P := + {q | ∃ h ∈ K, q ≤ a.iso h p ∧ Sep h g₁ ∧ Sep h g₂} + +def copyWitnessFamily (K : Subgroup G) (Sep : G → G → Prop) (p : P) (x y : Name s) : + Set (Set P) := + {D | (∃ r g₁ g₂, D = Localized r (a.RectangleWitness s p x y g₁ g₂)) ∨ + ∃ r g₁ g₂, D = Localized r (a.SeparationWitness K Sep p g₁ g₂)} + +theorem separated_copies_agree (K : Subgroup G) (Sep : G → G → Prop) + (p : P) (x y : Name s) (H : ConditionFilter P) + (generic : H.GenericFor (a.copyWitnessFamily s K Sep p x y)) + (xy : ∀ g, H.mem (a.iso g p) → + Name.eval {q | H.mem q} (a.act s g x) = Name.eval {q | H.mem q} (a.act s g y)) + (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, + r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) + {g₁ g₂ : G} (hg₁ : g₁ ∈ K) (hg₂ : g₂ ∈ K) (sep : Sep g₁ g₂) + (active₁ : H.mem (a.iso g₁ p)) (active₂ : H.mem (a.iso g₂ p)) : + Name.eval {q | H.mem q} (a.act s g₁ x) = Name.eval {q | H.mem q} (a.act s g₂ x) := by + obtain ⟨r, hr, r₁, r₂⟩ := H.directed active₁ active₂ + obtain ⟨q, hq, h₁, h₂, q₁, q₂, hx₁, hx₂, hy⟩ := + H.meets_below generic hr (Or.inl ⟨r, g₁, g₂, rfl⟩) + (rectangles g₁ hg₁ g₂ hg₂ sep r r₁ r₂) + have eq₁ := xy h₁ (H.upward hq q₁) + have eq₂ := xy h₂ (H.upward hq q₂) + rw [hx₁] at eq₁ + rw [hx₂] at eq₂ + exact eq₁.trans ((congrArg (Name.eval {q | H.mem q}) hy).trans eq₂.symm) + +theorem active_copies_agree (K : Subgroup G) (Sep : G → G → Prop) + (p : P) (x y : Name s) (H : ConditionFilter P) + (generic : H.GenericFor (a.copyWitnessFamily s K Sep p x y)) + (xy : ∀ g, H.mem (a.iso g p) → + Name.eval {q | H.mem q} (a.act s g x) = Name.eval {q | H.mem q} (a.act s g y)) + (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, + r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) + (separation : ∀ g₁ ∈ K, ∀ g₂ ∈ K, ∀ r, + r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.SeparationWitness K Sep p g₁ g₂)) + {g₁ g₂ : G} (hg₁ : g₁ ∈ K) (hg₂ : g₂ ∈ K) + (active₁ : H.mem (a.iso g₁ p)) (active₂ : H.mem (a.iso g₂ p)) : + Name.eval {q | H.mem q} (a.act s g₁ x) = Name.eval {q | H.mem q} (a.act s g₂ x) := by + obtain ⟨r, hr, r₁, r₂⟩ := H.directed active₁ active₂ + obtain ⟨q, hq, h, hh, qh, sep₁, sep₂⟩ := + H.meets_below generic hr (Or.inr ⟨r, g₁, g₂, rfl⟩) + (separation g₁ hg₁ g₂ hg₂ r r₁ r₂) + have active := H.upward hq qh + have eq₁ := a.separated_copies_agree s K Sep p x y H generic xy rectangles hh hg₁ sep₁ active active₁ + have eq₂ := a.separated_copies_agree s K Sep p x y H generic xy rectangles hh hg₂ sep₂ active active₂ + exact eq₁.symm.trans eq₂ + +theorem mix_capture_from_refinements [Small.{u} G] (K : Subgroup G) (Sep : G → G → Prop) + (p : P) (x y : Name s) (H : ConditionFilter P) + (generic : H.GenericFor (a.copyWitnessFamily s K Sep p x y)) (hp : H.mem p) + (xy : ∀ g, H.mem (a.iso g p) → + Name.eval {q | H.mem q} (a.act s g x) = Name.eval {q | H.mem q} (a.act s g y)) + (rectangles : ∀ g₁ ∈ K, ∀ g₂ ∈ K, Sep g₁ g₂ → ∀ r, + r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.RectangleWitness s p x y g₁ g₂)) + (separation : ∀ g₁ ∈ K, ∀ g₂ ∈ K, ∀ r, + r ≤ a.iso g₁ p → r ≤ a.iso g₂ p → DenseBelow r (a.SeparationWitness K Sep p g₁ g₂)) : + Name.eval {q | H.mem q} (a.mix s K p x) = Name.eval {q | H.mem q} x := by + apply a.eval_mix_of_active_equal s K p x H hp + intro g hg active + have eq := a.active_copies_agree s K Sep p x y H generic xy rectangles separation + hg K.one_mem active (by simpa only [a.one] using hp) + simpa only [a.act_one] using eq + +end PartitionPilot.Forcing.PosetAction + + + +namespace PartitionPilot.Forcing.Rows + +open Compression.RecursiveMaps Compression.RecursiveMaps.CountableColumns +open Compression.RecursiveMaps.MainStage.OrdinalRun + +local notation "L" => finalOrder Column +local notation "geom" => finalAction Column + +def Separated (D W : FinalPoint Column) (g h : FinalActor Column) : Prop := + (L).meet (((geom).iso g).toFun D) (((geom).iso h).toFun D) = W + +theorem fixed_lower_image {W D : FinalPoint Column} {g : FinalActor Column} + (wd : (L).le W D) (hg : g ∈ (geom).fixSubgroup W) : (L).le W (((geom).iso g).toFun D) := by + have lower := (((geom).iso g).le_iff _ _).2 wd + rw [hg W ((L).refl W)] at lower + exact lower + +theorem rectangle_refinement (p : RowForcing) (C B D : FinalPoint Column) + (x y : Name namePresentation) (bp : Bounds p D) (cd : (L).le C D) (bd : (L).le B D) + (sx : (geom).fixSubgroup C ≤ posetAction.stabilizer namePresentation x) + (sy : (geom).fixSubgroup B ≤ posetAction.stabilizer namePresentation y) + (g₁ : FinalActor Column) (hg₁ : g₁ ∈ (geom).fixSubgroup ((L).meet C B)) + (g₂ : FinalActor Column) (hg₂ : g₂ ∈ (geom).fixSubgroup ((L).meet C B)) + (sep : Separated D ((L).meet C B) g₁ g₂) (r : RowForcing) + (ref₁ : r ≤ rowAction g₁ p) (ref₂ : r ≤ rowAction g₂ p) : + DenseBelow r (posetAction.RectangleWitness namePresentation p x y g₁ g₂) := by + intro q qr + obtain ⟨X, bq, upper⟩ := bounds_with q + {(((geom).iso g₁).toFun D), (((geom).iso g₂).toFun D)} ((Set.countable_singleton _).insert _) + let rect : ActionRectangle L (geom).iso := { + C := C, B := B, D := D, first := g₁, second := g₂, + C_le_D := cd, B_le_D := bd, + agree := fun z hz => (hg₁ z hz).trans (hg₂ z hz).symm, + separated := sep.trans (hg₁ ((L).meet C B) ((L).refl _)).symm } + obtain ⟨h₁, h₂, agree₁, agree₂, agreeB, meet₁, meet₂, pairMeet⟩ := + final_rectangles Column rect X (upper _ (by simp [rect])) (upper _ (by simp [rect])) + have overlap₁ : (L).meet (((geom).iso h₁).toFun D) X = ((geom).iso h₁).toFun C := + meet₁.trans (agree₁ C ((L).refl C)).symm + have overlap₂ : (L).meet (((geom).iso h₂).toFun D) X = ((geom).iso h₂).toFun C := + meet₂.trans (agree₂ C ((L).refl C)).symm + obtain ⟨t, tq, th₁, th₂⟩ := rectangle_union bp bq (le_trans qr ref₁) (le_trans qr ref₂) + agree₁ agree₂ agreeB overlap₁ overlap₂ pairMeet + exact ⟨t, tq, h₁, h₂, th₁, th₂, + posetAction.act_eq_of_support_agreement geom namePresentation sx agree₁, + posetAction.act_eq_of_support_agreement geom namePresentation sx agree₂, + posetAction.act_eq_of_support_agreement geom namePresentation sy agreeB⟩ + +theorem separation_refinement (p : RowForcing) (W D : FinalPoint Column) + (bp : Bounds p D) (wd : (L).le W D) + (g₁ : FinalActor Column) (hg₁ : g₁ ∈ (geom).fixSubgroup W) + (g₂ : FinalActor Column) (hg₂ : g₂ ∈ (geom).fixSubgroup W) + (r : RowForcing) (ref₁ : r ≤ rowAction g₁ p) : + DenseBelow r (posetAction.SeparationWitness ((geom).fixSubgroup W) (Separated D W) p g₁ g₂) := by + intro q qr + obtain ⟨X, bq, upper⟩ := bounds_with q + {(((geom).iso g₁).toFun D), (((geom).iso g₂).toFun D)} ((Set.countable_singleton _).insert _) + have lower₁ := fixed_lower_image wd hg₁ + have lower₂ := fixed_lower_image wd hg₂ + have upper₁ := upper (((geom).iso g₁).toFun D) (by simp) + have upper₂ := upper (((geom).iso g₂).toFun D) (by simp) + obtain ⟨h, fixed, overlap⟩ := final_separation Column W D X wd ((L).trans lower₁ upper₁) + have overlap' : (L).meet (((geom).iso h).toFun D) X = ((geom).iso h).toFun W := + overlap.trans (fixed W ((L).refl W)).symm + obtain ⟨t, tq, th⟩ := one_copy_union bp bq (le_trans qr ref₁) overlap' + (fun z hz => (fixed z hz).trans (hg₁ z hz).symm) + have sep (Y : FinalPoint Column) (wy : (L).le W Y) (yx : (L).le Y X) : + (L).meet (((geom).iso h).toFun D) Y = W := by + apply (L).antisymm + · rw [← overlap] + exact (L).le_meet ((L).meet_le_left _ _) ((L).trans ((L).meet_le_right _ _) yx) + · exact (L).le_meet (fixed_lower_image wd fixed) wy + exact ⟨t, tq, h, fixed, th, sep _ lower₁ upper₁, sep _ lower₂ upper₂⟩ + +end PartitionPilot.Forcing.Rows + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowPositionBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowPositionBounds.lean index 915c37c51b9648972ea8a36523b3b3bed78d7e64..10db56687a825ca4c8e983c325320abf1c1775b7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowPositionBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/RowPositionBounds.lean @@ -1,214 +1,214 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundSuccessorInjections - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -def RowPositionSequenceAt (L r I delta f : ZFSet.{u}) : Prop := - ZFSet.IsFunc delta I f ∧ ∃ D ∈ L, ∀ a x, ZFSet.pair a x ∈ f → ZFSet.pair x D ∈ r - -def RowPositionSequenceCode (L r I mu f : ZFSet.{u}) : Prop := - ∃ delta ∈ insert mu mu, RowPositionSequenceAt L r I delta f - -theorem rowPositionSequence_length {mu delta : ZFSet.{u}} - (ordinal : ordinalSetProperty mu) (length : delta ∈ insert mu mu) : - ordinalSetProperty delta ∧ delta ⊆ mu := by - rcases ZFSet.mem_insert_iff.1 length with rfl | member - · exact ⟨ordinal, fun _ hx => hx⟩ - · exact ⟨ordinalSetProperty_member ordinal member, fun a ha => ordinal.1 delta member a ha⟩ - -theorem RowPositionSequenceCode.shape {L r I mu f : ZFSet.{u}} - (code : RowPositionSequenceCode L r I mu f) (ordinal : ordinalSetProperty mu) : - f ⊆ ZFSet.prod mu I := by - obtain ⟨delta, length, function, _⟩ := code - intro z hz - obtain ⟨a, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨(rowPositionSequence_length ordinal length).2 ha, hx⟩ - -theorem RowPositionSequenceAt.domain_unique {L r I delta eta f : ZFSet.{u}} - (first : RowPositionSequenceAt L r I delta f) (second : RowPositionSequenceAt L r I eta f) : - delta = eta := by - apply ZFSet.ext - intro a - constructor - · intro ha - obtain ⟨x, entry, _⟩ := first.1.2 a ha - exact (ZFSet.pair_mem_prod.1 (second.1.1 entry)).1 - · intro ha - obtain ⟨x, entry, _⟩ := second.1.2 a ha - exact (ZFSet.pair_mem_prod.1 (first.1.1 entry)).1 - -namespace BoundedFormula - -def rowPositionSequenceAtFormula {n} (L r I delta f : Fin n) : BoundedFormula n := - .conj (functionFormula delta I f) - (exMem L (.allMem delta.succ (.allMem I.succ.succ - (imp (pairMembershipFormula 1 0 f.succ.succ.succ) - (pairMembershipFormula 0 2 r.succ.succ.succ))))) - -theorem truth_rowPositionSequenceAtFormula {n} (L r I delta f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rowPositionSequenceAtFormula L r I delta f) env ↔ - RowPositionSequenceAt (env L) (env r) (env I) (env delta) (env f) := by - simp only [rowPositionSequenceAtFormula, Truth, truth_functionFormula, - truth_exMem, truth_imp, truth_pairMembershipFormula] - change (ZFSet.IsFunc (env delta) (env I) (env f) ∧ - ∃ D ∈ env L, ∀ a ∈ env delta, ∀ x ∈ env I, - ZFSet.pair a x ∈ env f → ZFSet.pair x D ∈ env r) ↔ _ - constructor - · rintro ⟨function, D, hD, bounds⟩ - refine ⟨function, D, hD, ?_⟩ - intro a x entry - have shape := ZFSet.pair_mem_prod.1 (function.1 entry) - exact bounds a shape.1 x shape.2 entry - · rintro ⟨function, D, hD, bounds⟩ - exact ⟨function, D, hD, fun a _ x _ entry => bounds a x entry⟩ - -def rowPositionSequenceFormula {n} (L r I mu f : Fin n) : BoundedFormula n := - disj (rowPositionSequenceAtFormula L r I mu f) - (exMem mu (rowPositionSequenceAtFormula L.succ r.succ I.succ 0 f.succ)) - -theorem truth_rowPositionSequenceFormula {n} (L r I mu f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (rowPositionSequenceFormula L r I mu f) env ↔ - RowPositionSequenceCode (env L) (env r) (env I) (env mu) (env f) := by - simp only [rowPositionSequenceFormula, truth_disj, truth_exMem, truth_rowPositionSequenceAtFormula] - change (RowPositionSequenceAt (env L) (env r) (env I) (env mu) (env f) ∨ - ∃ delta ∈ env mu, RowPositionSequenceAt (env L) (env r) (env I) delta (env f)) ↔ _ - constructor - · rintro (whole | ⟨delta, hdelta, code⟩) - · exact ⟨env mu, ZFSet.mem_insert _ _, whole⟩ - · exact ⟨delta, ZFSet.mem_insert_of_mem _ hdelta, code⟩ - · rintro ⟨delta, hdelta, code⟩ - rcases ZFSet.mem_insert_iff.1 hdelta with equal | hdelta - · exact Or.inl (equal ▸ code) - · exact Or.inr ⟨delta, hdelta, code⟩ - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def rowPositionSequences (L r I mu : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (RowPositionSequenceCode L r I mu) (M.groundRelations mu I) - -theorem mem_rowPositionSequences {L r I mu f : ZFSet.{u}} (ordinal : ordinalSetProperty mu) : - f ∈ M.rowPositionSequences L r I mu ↔ f ∈ M.sets ∧ RowPositionSequenceCode L r I mu f := by - rw [rowPositionSequences, ZFSet.mem_sep, M.mem_groundRelations] - exact ⟨fun ⟨ground, code⟩ => ⟨ground.1, code⟩, - fun ⟨ground, code⟩ => ⟨⟨ground, code.shape ordinal⟩, code⟩⟩ - -theorem rowPositionSequences_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {L r I mu : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) - (hI : I ∈ M.sets) (hmu : mu ∈ M.sets) : M.rowPositionSequences L r I mu ∈ M.sets := by - let formula : BoundedFormula 5 := BoundedFormula.rowPositionSequenceFormula 1 2 3 4 0 - let params := extend L (extend r (extend I (extend mu Fin.elim0))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hL (Fin.cases hr (Fin.cases hI (Fin.cases hmu (fun i => Fin.elim0 i)))) - have ground := M.bounded_separation_mem separation formula params members - (M.groundRelations_mem pairing unions powers separation hmu hI) - have equal : ZFSet.sep (fun f => BoundedFormula.Truth formula (extend f params)) - (M.groundRelations mu I) = M.rowPositionSequences L r I mu := by - apply ZFSet.ext - intro f - rw [ZFSet.mem_sep, rowPositionSequences, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_rowPositionSequenceFormula 1 2 3 4 0 _) - exact equal ▸ ground - -theorem rowPositionSequence_data {L r I mu f : ZFSet.{u}} - (hL : L ∈ M.sets) (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) - (member : f ∈ M.rowPositionSequences L r I mu) : - f ∈ M.sets ∧ ∃ delta ∈ M.sets, ordinalSetProperty delta ∧ delta ⊆ mu ∧ - ZFSet.IsFunc delta I f ∧ ∃ D ∈ L, D ∈ M.sets ∧ - ∀ a x, ZFSet.pair a x ∈ f → ZFSet.pair x D ∈ r := by - obtain ⟨ground, delta, length, function, D, hD, bounds⟩ := - (M.mem_rowPositionSequences ordinal).1 member - have hdelta : delta ∈ M.sets := (ZFSet.mem_insert_iff.1 length).elim - (fun equal => equal ▸ hmu) (M.transitive hmu) - have ordBound := rowPositionSequence_length ordinal length - exact ⟨ground, delta, hdelta, ordBound.1, ordBound.2, function, - D, hD, M.transitive hL hD, bounds⟩ - -theorem empty_mem_rowPositionSequences {L r I mu : ZFSet.{u}} - (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) (inhabited : L.Nonempty) : - (∅ : ZFSet.{u}) ∈ M.rowPositionSequences L r I mu := by - obtain ⟨D, hD⟩ := inhabited - have length : (∅ : ZFSet.{u}) ∈ insert mu mu := by - obtain ⟨o, rfl⟩ := (ordinalSetProperty_iff mu).1 ordinal - rw [← ordinalCode_succ, ← ordinalCode_zero] - exact (mem_ordinalCode_iff _ _).2 (Order.lt_succ_iff.2 zero_le) - exact (M.mem_rowPositionSequences ordinal).2 - ⟨M.empty_mem ⟨mu, hmu⟩, ∅, length, - ⟨ZFSet.empty_subset _, fun a ha => False.elim (ZFSet.notMem_empty a ha)⟩, - D, hD, fun a x entry => False.elim (ZFSet.notMem_empty (ZFSet.pair a x) entry)⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -def RowPositionBound (mu I r f D : ZFSet.{u}) : Prop := - f ⊆ ZFSet.prod mu I ∧ ∀ a x, ZFSet.pair a x ∈ f → ZFSet.pair x D ∈ r - -namespace BoundedFormula - -def rowPositionBoundFormula {n} (mu I r f D : Fin n) : BoundedFormula n := - .conj (relationBetweenFormula mu I f) - (.allMem mu (.allMem I.succ - (imp (pairMembershipFormula 1 0 f.succ.succ) (pairMembershipFormula 0 D.succ.succ r.succ.succ)))) - -theorem truth_rowPositionBoundFormula {n} (mu I r f D : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (rowPositionBoundFormula mu I r f D) env ↔ - RowPositionBound (env mu) (env I) (env r) (env f) (env D) := by - simp only [rowPositionBoundFormula, Truth, truth_relationBetweenFormula, truth_imp, - truth_pairMembershipFormula] - change (env f ⊆ ZFSet.prod (env mu) (env I) ∧ ∀ a ∈ env mu, ∀ x ∈ env I, - ZFSet.pair a x ∈ env f → ZFSet.pair x (env D) ∈ env r) ↔ _ - constructor - · rintro ⟨shape,bound⟩ - refine ⟨shape,fun a x entry => ?_⟩ - have fields := ZFSet.pair_mem_prod.1 (shape entry) - exact bound a fields.1 x fields.2 entry - · rintro ⟨shape,bound⟩ - exact ⟨shape,fun a _ x _ entry => bound a x entry⟩ - -end BoundedFormula - -theorem RowPositionBound.mono {L : Type u} [Preorder L] (s : Presentation L) - {mu I f : ZFSet.{u}} {D E : L} - (bound : RowPositionBound mu I s.conditionOrder f (s.encode D)) (le : D ≤ E) : - RowPositionBound mu I s.conditionOrder f (s.encode E) := by - refine ⟨bound.1,fun a x entry => ?_⟩ - have lower := bound.2 a x entry - have hx : x ∈ s.carrier := - (ZFSet.pair_mem_prod.1 ((s.product s).subset_carrier (fun z => z.1 ≤ z.2) lower)).1 - obtain ⟨x,rfl⟩ := (s.mem_carrier x).1 hx - exact (s.pair_mem_conditionOrder x E).2 (le_trans ((s.pair_mem_conditionOrder x D).1 lower) le) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem rowPositionSequence_bound {L r I mu f : ZFSet.{u}} - (member : f ∈ M.rowPositionSequences L r I mu) : - ∃ D ∈ L, RowPositionBound mu I r f D := by - have data := ZFSet.mem_sep.1 member - have shape := ((M.mem_groundRelations mu I f).1 data.1).2 - obtain ⟨delta,_,_,D,hD,bound⟩ := data.2 - exact ⟨D,hD,shape,bound⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundSuccessorInjections + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +def RowPositionSequenceAt (L r I delta f : ZFSet.{u}) : Prop := + ZFSet.IsFunc delta I f ∧ ∃ D ∈ L, ∀ a x, ZFSet.pair a x ∈ f → ZFSet.pair x D ∈ r + +def RowPositionSequenceCode (L r I mu f : ZFSet.{u}) : Prop := + ∃ delta ∈ insert mu mu, RowPositionSequenceAt L r I delta f + +theorem rowPositionSequence_length {mu delta : ZFSet.{u}} + (ordinal : ordinalSetProperty mu) (length : delta ∈ insert mu mu) : + ordinalSetProperty delta ∧ delta ⊆ mu := by + rcases ZFSet.mem_insert_iff.1 length with rfl | member + · exact ⟨ordinal, fun _ hx => hx⟩ + · exact ⟨ordinalSetProperty_member ordinal member, fun a ha => ordinal.1 delta member a ha⟩ + +theorem RowPositionSequenceCode.shape {L r I mu f : ZFSet.{u}} + (code : RowPositionSequenceCode L r I mu f) (ordinal : ordinalSetProperty mu) : + f ⊆ ZFSet.prod mu I := by + obtain ⟨delta, length, function, _⟩ := code + intro z hz + obtain ⟨a, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨(rowPositionSequence_length ordinal length).2 ha, hx⟩ + +theorem RowPositionSequenceAt.domain_unique {L r I delta eta f : ZFSet.{u}} + (first : RowPositionSequenceAt L r I delta f) (second : RowPositionSequenceAt L r I eta f) : + delta = eta := by + apply ZFSet.ext + intro a + constructor + · intro ha + obtain ⟨x, entry, _⟩ := first.1.2 a ha + exact (ZFSet.pair_mem_prod.1 (second.1.1 entry)).1 + · intro ha + obtain ⟨x, entry, _⟩ := second.1.2 a ha + exact (ZFSet.pair_mem_prod.1 (first.1.1 entry)).1 + +namespace BoundedFormula + +def rowPositionSequenceAtFormula {n} (L r I delta f : Fin n) : BoundedFormula n := + .conj (functionFormula delta I f) + (exMem L (.allMem delta.succ (.allMem I.succ.succ + (imp (pairMembershipFormula 1 0 f.succ.succ.succ) + (pairMembershipFormula 0 2 r.succ.succ.succ))))) + +theorem truth_rowPositionSequenceAtFormula {n} (L r I delta f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rowPositionSequenceAtFormula L r I delta f) env ↔ + RowPositionSequenceAt (env L) (env r) (env I) (env delta) (env f) := by + simp only [rowPositionSequenceAtFormula, Truth, truth_functionFormula, + truth_exMem, truth_imp, truth_pairMembershipFormula] + change (ZFSet.IsFunc (env delta) (env I) (env f) ∧ + ∃ D ∈ env L, ∀ a ∈ env delta, ∀ x ∈ env I, + ZFSet.pair a x ∈ env f → ZFSet.pair x D ∈ env r) ↔ _ + constructor + · rintro ⟨function, D, hD, bounds⟩ + refine ⟨function, D, hD, ?_⟩ + intro a x entry + have shape := ZFSet.pair_mem_prod.1 (function.1 entry) + exact bounds a shape.1 x shape.2 entry + · rintro ⟨function, D, hD, bounds⟩ + exact ⟨function, D, hD, fun a _ x _ entry => bounds a x entry⟩ + +def rowPositionSequenceFormula {n} (L r I mu f : Fin n) : BoundedFormula n := + disj (rowPositionSequenceAtFormula L r I mu f) + (exMem mu (rowPositionSequenceAtFormula L.succ r.succ I.succ 0 f.succ)) + +theorem truth_rowPositionSequenceFormula {n} (L r I mu f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (rowPositionSequenceFormula L r I mu f) env ↔ + RowPositionSequenceCode (env L) (env r) (env I) (env mu) (env f) := by + simp only [rowPositionSequenceFormula, truth_disj, truth_exMem, truth_rowPositionSequenceAtFormula] + change (RowPositionSequenceAt (env L) (env r) (env I) (env mu) (env f) ∨ + ∃ delta ∈ env mu, RowPositionSequenceAt (env L) (env r) (env I) delta (env f)) ↔ _ + constructor + · rintro (whole | ⟨delta, hdelta, code⟩) + · exact ⟨env mu, ZFSet.mem_insert _ _, whole⟩ + · exact ⟨delta, ZFSet.mem_insert_of_mem _ hdelta, code⟩ + · rintro ⟨delta, hdelta, code⟩ + rcases ZFSet.mem_insert_iff.1 hdelta with equal | hdelta + · exact Or.inl (equal ▸ code) + · exact Or.inr ⟨delta, hdelta, code⟩ + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def rowPositionSequences (L r I mu : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (RowPositionSequenceCode L r I mu) (M.groundRelations mu I) + +theorem mem_rowPositionSequences {L r I mu f : ZFSet.{u}} (ordinal : ordinalSetProperty mu) : + f ∈ M.rowPositionSequences L r I mu ↔ f ∈ M.sets ∧ RowPositionSequenceCode L r I mu f := by + rw [rowPositionSequences, ZFSet.mem_sep, M.mem_groundRelations] + exact ⟨fun ⟨ground, code⟩ => ⟨ground.1, code⟩, + fun ⟨ground, code⟩ => ⟨⟨ground, code.shape ordinal⟩, code⟩⟩ + +theorem rowPositionSequences_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {L r I mu : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) + (hI : I ∈ M.sets) (hmu : mu ∈ M.sets) : M.rowPositionSequences L r I mu ∈ M.sets := by + let formula : BoundedFormula 5 := BoundedFormula.rowPositionSequenceFormula 1 2 3 4 0 + let params := extend L (extend r (extend I (extend mu Fin.elim0))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hL (Fin.cases hr (Fin.cases hI (Fin.cases hmu (fun i => Fin.elim0 i)))) + have ground := M.bounded_separation_mem separation formula params members + (M.groundRelations_mem pairing unions powers separation hmu hI) + have equal : ZFSet.sep (fun f => BoundedFormula.Truth formula (extend f params)) + (M.groundRelations mu I) = M.rowPositionSequences L r I mu := by + apply ZFSet.ext + intro f + rw [ZFSet.mem_sep, rowPositionSequences, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_rowPositionSequenceFormula 1 2 3 4 0 _) + exact equal ▸ ground + +theorem rowPositionSequence_data {L r I mu f : ZFSet.{u}} + (hL : L ∈ M.sets) (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) + (member : f ∈ M.rowPositionSequences L r I mu) : + f ∈ M.sets ∧ ∃ delta ∈ M.sets, ordinalSetProperty delta ∧ delta ⊆ mu ∧ + ZFSet.IsFunc delta I f ∧ ∃ D ∈ L, D ∈ M.sets ∧ + ∀ a x, ZFSet.pair a x ∈ f → ZFSet.pair x D ∈ r := by + obtain ⟨ground, delta, length, function, D, hD, bounds⟩ := + (M.mem_rowPositionSequences ordinal).1 member + have hdelta : delta ∈ M.sets := (ZFSet.mem_insert_iff.1 length).elim + (fun equal => equal ▸ hmu) (M.transitive hmu) + have ordBound := rowPositionSequence_length ordinal length + exact ⟨ground, delta, hdelta, ordBound.1, ordBound.2, function, + D, hD, M.transitive hL hD, bounds⟩ + +theorem empty_mem_rowPositionSequences {L r I mu : ZFSet.{u}} + (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) (inhabited : L.Nonempty) : + (∅ : ZFSet.{u}) ∈ M.rowPositionSequences L r I mu := by + obtain ⟨D, hD⟩ := inhabited + have length : (∅ : ZFSet.{u}) ∈ insert mu mu := by + obtain ⟨o, rfl⟩ := (ordinalSetProperty_iff mu).1 ordinal + rw [← ordinalCode_succ, ← ordinalCode_zero] + exact (mem_ordinalCode_iff _ _).2 (Order.lt_succ_iff.2 zero_le) + exact (M.mem_rowPositionSequences ordinal).2 + ⟨M.empty_mem ⟨mu, hmu⟩, ∅, length, + ⟨ZFSet.empty_subset _, fun a ha => False.elim (ZFSet.notMem_empty a ha)⟩, + D, hD, fun a x entry => False.elim (ZFSet.notMem_empty (ZFSet.pair a x) entry)⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +def RowPositionBound (mu I r f D : ZFSet.{u}) : Prop := + f ⊆ ZFSet.prod mu I ∧ ∀ a x, ZFSet.pair a x ∈ f → ZFSet.pair x D ∈ r + +namespace BoundedFormula + +def rowPositionBoundFormula {n} (mu I r f D : Fin n) : BoundedFormula n := + .conj (relationBetweenFormula mu I f) + (.allMem mu (.allMem I.succ + (imp (pairMembershipFormula 1 0 f.succ.succ) (pairMembershipFormula 0 D.succ.succ r.succ.succ)))) + +theorem truth_rowPositionBoundFormula {n} (mu I r f D : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (rowPositionBoundFormula mu I r f D) env ↔ + RowPositionBound (env mu) (env I) (env r) (env f) (env D) := by + simp only [rowPositionBoundFormula, Truth, truth_relationBetweenFormula, truth_imp, + truth_pairMembershipFormula] + change (env f ⊆ ZFSet.prod (env mu) (env I) ∧ ∀ a ∈ env mu, ∀ x ∈ env I, + ZFSet.pair a x ∈ env f → ZFSet.pair x (env D) ∈ env r) ↔ _ + constructor + · rintro ⟨shape,bound⟩ + refine ⟨shape,fun a x entry => ?_⟩ + have fields := ZFSet.pair_mem_prod.1 (shape entry) + exact bound a fields.1 x fields.2 entry + · rintro ⟨shape,bound⟩ + exact ⟨shape,fun a _ x _ entry => bound a x entry⟩ + +end BoundedFormula + +theorem RowPositionBound.mono {L : Type u} [Preorder L] (s : Presentation L) + {mu I f : ZFSet.{u}} {D E : L} + (bound : RowPositionBound mu I s.conditionOrder f (s.encode D)) (le : D ≤ E) : + RowPositionBound mu I s.conditionOrder f (s.encode E) := by + refine ⟨bound.1,fun a x entry => ?_⟩ + have lower := bound.2 a x entry + have hx : x ∈ s.carrier := + (ZFSet.pair_mem_prod.1 ((s.product s).subset_carrier (fun z => z.1 ≤ z.2) lower)).1 + obtain ⟨x,rfl⟩ := (s.mem_carrier x).1 hx + exact (s.pair_mem_conditionOrder x E).2 (le_trans ((s.pair_mem_conditionOrder x D).1 lower) le) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem rowPositionSequence_bound {L r I mu f : ZFSet.{u}} + (member : f ∈ M.rowPositionSequences L r I mu) : + ∃ D ∈ L, RowPositionBound mu I r f D := by + have data := ZFSet.mem_sep.1 member + have shape := ((M.mem_groundRelations mu I f).1 data.1).2 + obtain ⟨delta,_,_,D,hD,bound⟩ := data.2 + exact ⟨D,hD,shape,bound⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/SeparationTileCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/SeparationTileCodes.lean index 035178fe8d9976910a12acd66efcd5994e8ed7da..5ea9d7cf31c77a40814981470d844087c29482f2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/SeparationTileCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/SeparationTileCodes.lean @@ -1,756 +1,756 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FixedTopCodes - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -def singleAttachmentLe (P N rP rQ shadow F x y : ZFSet.{u}) : Prop := - (x ∈ P ∧ y ∈ P ∧ ZFSet.pair x y ∈ rP) ∨ - (x ∈ P ∧ ∃ q ∈ N, ∃ s ∈ P, - y = ZFSet.pair P q ∧ ZFSet.pair q s ∈ shadow ∧ ZFSet.pair x s ∈ rP) ∨ - ((∃ q ∈ N, x = ZFSet.pair P q) ∧ y ∈ F) ∨ - (∃ q ∈ N, ∃ t ∈ N, - x = ZFSet.pair P q ∧ y = ZFSet.pair P t ∧ ZFSet.pair q t ∈ rQ) - -def singleAttachmentOrder (P N rP rQ shadow F : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ taggedExtension P N, ∃ y ∈ taggedExtension P N, - z = ZFSet.pair x y ∧ singleAttachmentLe P N rP rQ shadow F x y) - (ZFSet.prod (taggedExtension P N) (taggedExtension P N)) - -theorem pair_mem_singleAttachmentOrder (P N rP rQ shadow F x y : ZFSet.{u}) : - ZFSet.pair x y ∈ singleAttachmentOrder P N rP rQ shadow F ↔ - x ∈ taggedExtension P N ∧ y ∈ taggedExtension P N ∧ - singleAttachmentLe P N rP rQ shadow F x y := by - simp only [singleAttachmentOrder, ZFSet.mem_sep, ZFSet.pair_mem_prod, ZFSet.pair_inj] - constructor - · rintro ⟨⟨hx, hy⟩, a, _, b, _, ⟨rfl, rfl⟩, lower⟩ - exact ⟨hx, hy, lower⟩ - · rintro ⟨hx, hy, lower⟩ - exact ⟨⟨hx, hy⟩, x, hx, y, hy, ⟨rfl, rfl⟩, lower⟩ - -theorem singleAttachmentOrder_shape (P N rP rQ shadow F : ZFSet.{u}) : - singleAttachmentOrder P N rP rQ shadow F ⊆ - ZFSet.prod (taggedExtension P N) (taggedExtension P N) := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -namespace BoundedFormula - -open SetFormula - -def attachmentTagFormula {n} (x p nset : Fin n) : BoundedFormula n := - exMem nset (orderedPairFormula x.succ p.succ 0) - -def attachmentOldNewFormula {n} (x y p nset shadow r : Fin n) : BoundedFormula n := - .conj (.mem x p) (exMem nset (exMem p.succ - (.conj (orderedPairFormula y.succ.succ p.succ.succ 1) - (.conj (pairMembershipFormula 1 0 shadow.succ.succ) - (pairMembershipFormula x.succ.succ 0 r.succ.succ))))) - -def attachmentNewNewFormula {n} (x y p nset r : Fin n) : BoundedFormula n := - exMem nset (exMem nset.succ - (.conj (orderedPairFormula x.succ.succ p.succ.succ 1) - (.conj (orderedPairFormula y.succ.succ p.succ.succ 0) - (pairMembershipFormula 1 0 r.succ.succ)))) - -def singleAttachmentLeFormula {n} (x y p nset rP rQ shadow f : Fin n) : BoundedFormula n := - disj (.conj (.mem x p) (.conj (.mem y p) (pairMembershipFormula x y rP))) - (disj (attachmentOldNewFormula x y p nset shadow rP) - (disj (.conj (attachmentTagFormula x p nset) (.mem y f)) - (attachmentNewNewFormula x y p nset rQ))) - -def singleAttachmentOrderEntryFormula {n} (z l p nset rP rQ shadow f : Fin n) : - BoundedFormula n := - exMem l (exMem l.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (singleAttachmentLeFormula 1 0 p.succ.succ nset.succ.succ - rP.succ.succ rQ.succ.succ shadow.succ.succ f.succ.succ))) - -theorem truth_singleAttachmentLeFormula {n} (x y p nset rP rQ shadow f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (singleAttachmentLeFormula x y p nset rP rQ shadow f) env ↔ - singleAttachmentLe (env p) (env nset) (env rP) (env rQ) (env shadow) - (env f) (env x) (env y) := by - simp only [singleAttachmentLeFormula, attachmentOldNewFormula, attachmentTagFormula, - attachmentNewNewFormula, truth_disj, Truth, truth_exMem, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl - -theorem truth_singleAttachmentOrderEntryFormula {n} (z l p nset rP rQ shadow f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (singleAttachmentOrderEntryFormula z l p nset rP rQ shadow f) env ↔ - ∃ x ∈ env l, ∃ y ∈ env l, env z = ZFSet.pair x y ∧ - singleAttachmentLe (env p) (env nset) (env rP) (env rQ) - (env shadow) (env f) x y := by - simp only [singleAttachmentOrderEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_singleAttachmentLeFormula] - rfl - -end BoundedFormula - - - - - -def codedAttachmentFreshLe (P inside shadow upper x y : ZFSet.{u}) : Prop := - ZFSet.pair x y ∈ inside ∨ - ∃ s ∈ P, ZFSet.pair y s ∈ shadow ∧ ZFSet.pair x s ∈ upper - -def codedAttachmentLe (P N r inside shadow upper x y : ZFSet.{u}) : Prop := - (x ∈ P ∧ y ∈ P ∧ ZFSet.pair x y ∈ r) ∨ - (x ∈ P ∧ ∃ q ∈ N, ∃ s ∈ P, - y = ZFSet.pair P q ∧ ZFSet.pair q s ∈ shadow ∧ ZFSet.pair x s ∈ r) ∨ - (y ∈ P ∧ ∃ q ∈ N, x = ZFSet.pair P q ∧ ZFSet.pair q y ∈ upper) ∨ - (∃ q ∈ N, ∃ t ∈ N, x = ZFSet.pair P q ∧ y = ZFSet.pair P t ∧ - codedAttachmentFreshLe P inside shadow upper q t) - -noncomputable def codedAttachmentOrder (P N r inside shadow upper : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ taggedExtension P N, ∃ y ∈ taggedExtension P N, - z = ZFSet.pair x y ∧ codedAttachmentLe P N r inside shadow upper x y) - (ZFSet.prod (taggedExtension P N) (taggedExtension P N)) - -theorem pair_mem_codedAttachmentOrder (P N r inside shadow upper x y : ZFSet.{u}) : - ZFSet.pair x y ∈ codedAttachmentOrder P N r inside shadow upper ↔ - x ∈ taggedExtension P N ∧ y ∈ taggedExtension P N ∧ - codedAttachmentLe P N r inside shadow upper x y := by - simp only [codedAttachmentOrder, ZFSet.mem_sep, ZFSet.pair_mem_prod, ZFSet.pair_inj] - constructor - · rintro ⟨⟨hx, hy⟩, a, _, b, _, ⟨rfl, rfl⟩, lower⟩ - exact ⟨hx, hy, lower⟩ - · rintro ⟨hx, hy, lower⟩ - exact ⟨⟨hx, hy⟩, x, hx, y, hy, ⟨rfl, rfl⟩, lower⟩ - -theorem codedAttachmentOrder_shape (P N r inside shadow upper : ZFSet.{u}) : - codedAttachmentOrder P N r inside shadow upper ⊆ - ZFSet.prod (taggedExtension P N) (taggedExtension P N) := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -namespace BoundedFormula -open SetFormula - -def codedAttachmentFreshLeFormula {n} (x y p inside shadow upper : Fin n) : BoundedFormula n := - disj (pairMembershipFormula x y inside) (exMem p - (.conj (pairMembershipFormula y.succ 0 shadow.succ) - (pairMembershipFormula x.succ 0 upper.succ))) - -def codedAttachmentLeFormula {n} (x y p nset r inside shadow upper : Fin n) : BoundedFormula n := - disj (.conj (.mem x p) (.conj (.mem y p) (pairMembershipFormula x y r))) - (disj (attachmentOldNewFormula x y p nset shadow r) - (disj (.conj (.mem y p) (exMem nset - (.conj (orderedPairFormula x.succ p.succ 0) - (pairMembershipFormula 0 y.succ upper.succ)))) - (exMem nset (exMem nset.succ - (.conj (orderedPairFormula x.succ.succ p.succ.succ 1) - (.conj (orderedPairFormula y.succ.succ p.succ.succ 0) - (codedAttachmentFreshLeFormula 1 0 p.succ.succ inside.succ.succ - shadow.succ.succ upper.succ.succ))))))) - -def codedAttachmentOrderEntryFormula {n} (z l p nset r inside shadow upper : Fin n) : - BoundedFormula n := - exMem l (exMem l.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (codedAttachmentLeFormula 1 0 p.succ.succ nset.succ.succ r.succ.succ - inside.succ.succ shadow.succ.succ upper.succ.succ))) - -theorem truth_codedAttachmentFreshLeFormula {n} (x y p inside shadow upper : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (codedAttachmentFreshLeFormula x y p inside shadow upper) env ↔ - codedAttachmentFreshLe (env p) (env inside) (env shadow) (env upper) (env x) (env y) := by - simp only [codedAttachmentFreshLeFormula, truth_disj, truth_exMem, Truth, - truth_pairMembershipFormula] - rfl - -theorem truth_codedAttachmentLeFormula {n} (x y p nset r inside shadow upper : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (codedAttachmentLeFormula x y p nset r inside shadow upper) env ↔ - codedAttachmentLe (env p) (env nset) (env r) (env inside) (env shadow) - (env upper) (env x) (env y) := by - simp only [codedAttachmentLeFormula, attachmentOldNewFormula, truth_disj, truth_exMem, - Truth, truth_pairMembershipFormula, truth_orderedPairFormula, truth_codedAttachmentFreshLeFormula] - rfl - -theorem truth_codedAttachmentOrderEntryFormula {n} (z l p nset r inside shadow upper : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (codedAttachmentOrderEntryFormula z l p nset r inside shadow upper) env ↔ - ∃ x ∈ env l, ∃ y ∈ env l, env z = ZFSet.pair x y ∧ - codedAttachmentLe (env p) (env nset) (env r) (env inside) (env shadow) (env upper) x y := by - simp only [codedAttachmentOrderEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_codedAttachmentLeFormula] - rfl - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem singleAttachmentOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P N rP rQ shadow F : ZFSet.{u}} - (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hrP : rP ∈ M.sets) - (hrQ : rQ ∈ M.sets) (hs : shadow ∈ M.sets) (hF : F ∈ M.sets) : - singleAttachmentOrder P N rP rQ shadow F ∈ M.sets := by - let L := taggedExtension P N - have hL := M.taggedExtension_mem pairing unions powers separation hP hN - let params := extend L (extend P (extend N (extend rP (extend rQ - (extend shadow (extend F Fin.elim0)))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.singleAttachmentOrderEntryFormula 0 1 2 3 4 5 6 7) params - (Fin.cases hL (Fin.cases hP (Fin.cases hN (Fin.cases hrP (Fin.cases hrQ - (Fin.cases hs (Fin.cases hF (fun i => Fin.elim0 i)))))))) - (M.prod_mem pairing unions powers separation hL hL) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.singleAttachmentOrderEntryFormula 0 1 2 3 4 5 6 7) - (extend z params)) (ZFSet.prod L L) = singleAttachmentOrder P N rP rQ shadow F := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, singleAttachmentOrder, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_singleAttachmentOrderEntryFormula - 0 1 2 3 4 5 6 7 _) - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -universe u - -namespace BoundedFormula - -open SetFormula - -def greatestLowerBoundFormula {n} (l r x y z : Fin n) : BoundedFormula n := - .conj (pairMembershipFormula z x r) (.conj (pairMembershipFormula z y r) - (allMem l (imp (pairMembershipFormula 0 x.succ r.succ) - (imp (pairMembershipFormula 0 y.succ r.succ) (pairMembershipFormula 0 z.succ r.succ))))) - -theorem truth_greatestLowerBoundFormula {n} (l r x y z : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (greatestLowerBoundFormula l r x y z) env ↔ - GreatestLowerBoundCode (env l) (env r) (env x) (env y) (env z) := by - simp only [greatestLowerBoundFormula, Truth, truth_imp, - truth_pairMembershipFormula, GreatestLowerBoundCode] - rfl - -def canonicalMeetEntryFormula {n} (v l r : Fin n) : BoundedFormula n := - exMem l (exMem l.succ (exMem l.succ.succ - (.conj (orderedTripleFormula v.succ.succ.succ 2 1 0) - (greatestLowerBoundFormula l.succ.succ.succ r.succ.succ.succ 2 1 0)))) - -theorem truth_canonicalMeetEntryFormula {n} (v l r : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (canonicalMeetEntryFormula v l r) env ↔ - env v ∈ canonicalMeetGraph (env l) (env r) := by - simp only [canonicalMeetEntryFormula, truth_exMem, Truth, - truth_orderedTripleFormula, truth_greatestLowerBoundFormula, mem_canonicalMeetGraph] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula - -theorem canonicalMeetGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {L r : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) : - canonicalMeetGraph L r ∈ M.sets := by - let params := extend L (extend r Fin.elim0) - have selected := M.bounded_separation_mem separation - (BoundedFormula.canonicalMeetEntryFormula 0 1 2) params - (Fin.cases hL (Fin.cases hr (fun i => Fin.elim0 i))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hL hL) hL) - have eq : ZFSet.sep (fun v => BoundedFormula.Truth - (BoundedFormula.canonicalMeetEntryFormula 0 1 2) (extend v params)) - (ZFSet.prod (ZFSet.prod L L) L) = canonicalMeetGraph L r := by - apply ZFSet.ext - intro v - rw [ZFSet.mem_sep, BoundedFormula.truth_canonicalMeetEntryFormula] - exact ⟨And.right, fun hv => ⟨canonicalMeetGraph_subset L r hv, hv⟩⟩ - exact eq ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open Compression.RecursiveMaps -universe u - -structure CodedPrincipalTile {P Q rP rQ μP μQ : ZFSet.{u}} - (old : MeetOrderCode P rP μP) (right : MeetOrderCode Q rQ μQ) - (g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder) (ell : ZFSet.{u}) where - base_function : ZFSet.IsFunc (attachmentIdeal Q rQ g.rightAnchor.val) P ell - base_entry : ∀ x, ZFSet.pair x.val.val (g.overlap.toFun x).val.val ∈ ell - -namespace CodedPrincipalTile -variable {P Q rP rQ μP μQ ell : ZFSet.{u}} -variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} -variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} -variable (d : CodedPrincipalTile old right g ell) - -abbrev Nodes := g.Node - -def encode (_d : CodedPrincipalTile old right g ell) : g.Node → ZFSet.{u} - | .inl p => p.val - | .inr q => ZFSet.pair P q.val.val - -noncomputable abbrev carrier (_d : CodedPrincipalTile old right g ell) := - taggedExtension P (freshPart Q rQ g.rightAnchor.val) -noncomputable abbrev order (_d : CodedPrincipalTile old right g ell) := - singleAttachmentOrder P (freshPart Q rQ g.rightAnchor.val) rP rQ - (attachmentShadowGraph Q P μQ ell g.rightAnchor.val) ∅ -noncomputable abbrev meetGraph := canonicalMeetGraph d.carrier d.order - -include d - -omit d in -theorem fresh_mem (_d : CodedPrincipalTile old right g ell) (q : g.Fresh) : q.val.val ∈ freshPart Q rQ g.rightAnchor.val := - (mem_freshPart _ _ _ _).2 ⟨q.val.property, q.property⟩ - -theorem shadow_entry (q : {q : ZFSet.{u} // q ∈ Q}) : - ZFSet.pair q.val (g.shadow q).val ∈ attachmentShadowGraph Q P μQ ell g.rightAnchor.val := by - apply (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2 - exact ⟨q.property, (g.shadow q).property, - (right.toMeetOrder.meet q g.rightAnchor).val, - (right.toMeetOrder.meet q g.rightAnchor).property, - right.toMeetOrder_meet_entry q g.rightAnchor, - d.base_entry (Attachment.cut right.toMeetOrder g.rightAnchor q)⟩ - -theorem encode_mem (x : g.Node) : d.encode x ∈ d.carrier := by - cases x with - | inl p => exact old_mem_taggedExtension p.property - | inr q => exact pair_mem_taggedExtension.2 (d.fresh_mem q) - -theorem encode_injective : Function.Injective d.encode := by - intro x y eq - cases x with - | inl p => - cases y with - | inl s => exact congrArg Sum.inl (Subtype.ext eq) - | inr q => - change p.val = ZFSet.pair P q.val.val at eq - exact False.elim (pair_tag_not_mem P q.val.val (eq ▸ p.property)) - | inr q => - cases y with - | inl p => - change ZFSet.pair P q.val.val = p.val at eq - exact False.elim (pair_tag_not_mem P q.val.val (eq.symm ▸ p.property)) - | inr t => exact congrArg Sum.inr (Subtype.ext (Subtype.ext (ZFSet.pair_inj.1 eq).2)) - -theorem encode_surjective : ∀ z ∈ d.carrier, ∃ x : g.Node, d.encode x = z := by - intro z hz - rcases mem_taggedExtension.1 hz with old | ⟨q, hq, eq⟩ - · exact ⟨.inl ⟨z, old⟩, rfl⟩ - · have fresh := (mem_freshPart Q rQ g.rightAnchor.val q).1 hq - exact ⟨.inr ⟨⟨q, fresh.1⟩, fresh.2⟩, eq.symm⟩ - -omit d in -theorem fresh_lower_iff (_d : CodedPrincipalTile old right g ell) (q t : g.Fresh) : - g.order.le (.inr q) (.inr t) ↔ ZFSet.pair q.val.val t.val.val ∈ rQ := by - change (_ ∨ False) ↔ _ - exact ⟨fun h => h.elim id False.elim, Or.inl⟩ - -theorem le_encode (x y : g.Node) : - ZFSet.pair (d.encode x) (d.encode y) ∈ d.order ↔ g.order.le x y := by - rw [pair_mem_singleAttachmentOrder] - have bounded : d.encode x ∈ d.carrier ∧ d.encode y ∈ d.carrier := - ⟨d.encode_mem x, d.encode_mem y⟩ - simp only [bounded.1, bounded.2, true_and] - cases x with - | inl p => - cases y with - | inl s => - change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) p.val s.val ↔ ZFSet.pair p.val s.val ∈ rP - constructor - · rintro (h | h | h | h) - · exact h.2.2 - · obtain ⟨_, q, _, t, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P q (eq ▸ s.property)) - · obtain ⟨⟨q, _, eq⟩, _⟩ := h - exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) - · obtain ⟨q, _, t, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) - · intro lower - exact Or.inl ⟨p.property, s.property, lower⟩ - | inr q => - change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) p.val (ZFSet.pair P q.val.val) ↔ - ZFSet.pair p.val (g.shadow q.val).val ∈ rP - constructor - · rintro (h | h | h | h) - · exact False.elim (pair_tag_not_mem P q.val.val h.2.1) - · obtain ⟨_, t, _, s, _, eq, image, lower⟩ := h - have same : q.val.val = t := (ZFSet.pair_inj.1 eq).2 - subst t - have graph := attachmentShadowGraph_function right g.rightAnchor.property d.base_function - obtain ⟨v, _, unique⟩ := graph.2 q.val.val q.val.property - have sameValue := (unique s image).trans (unique _ (d.shadow_entry q.val)).symm - exact sameValue ▸ lower - · obtain ⟨⟨t, _, eq⟩, _⟩ := h - exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) - · obtain ⟨t, _, s, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) - · intro lower - exact Or.inr (Or.inl ⟨p.property, q.val.val, d.fresh_mem q, - (g.shadow q.val).val, (g.shadow q.val).property, rfl, - d.shadow_entry q.val, lower⟩) - | inr q => - cases y with - | inl p => - change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) (ZFSet.pair P q.val.val) p.val ↔ False - constructor - · rintro (h | h | h | h) - · exact False.elim (pair_tag_not_mem P q.val.val h.1) - · exact False.elim (pair_tag_not_mem P q.val.val h.1) - · exact ZFSet.notMem_empty _ h.2 - · obtain ⟨s, _, t, _, _, eq, _⟩ := h - exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) - · intro upper - exact False.elim upper - | inr t => - rw [d.fresh_lower_iff] - change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) - (ZFSet.pair P q.val.val) (ZFSet.pair P t.val.val) ↔ - ZFSet.pair q.val.val t.val.val ∈ rQ - constructor - · rintro (h | h | h | h) - · exact False.elim (pair_tag_not_mem P q.val.val h.1) - · exact False.elim (pair_tag_not_mem P q.val.val h.1) - · exact False.elim (ZFSet.notMem_empty _ h.2) - · obtain ⟨s, _, v, _, eqQ, eqT, lower⟩ := h - have sameQ := (ZFSet.pair_inj.1 eqQ).2 - have sameT := (ZFSet.pair_inj.1 eqT).2 - exact sameQ.symm ▸ sameT.symm ▸ lower - · intro lower - exact Or.inr (Or.inr (Or.inr ⟨q.val.val, d.fresh_mem q, - t.val.val, d.fresh_mem t, rfl, rfl, lower⟩)) - -theorem partialOrder : PartialOrderCode d.carrier d.order where - relation := singleAttachmentOrder_shape P _ rP rQ _ (∅ : ZFSet) - refl z hz := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - exact (d.le_encode x x).2 (g.order.refl x) - antisymm z hz w hw zw wz := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - obtain ⟨y, rfl⟩ := d.encode_surjective w hw - exact congrArg d.encode (g.order.antisymm - ((d.le_encode x y).1 zw) ((d.le_encode y x).1 wz)) - trans z hz w hw v hv zw wv := by - obtain ⟨x, rfl⟩ := d.encode_surjective z hz - obtain ⟨y, rfl⟩ := d.encode_surjective w hw - obtain ⟨t, rfl⟩ := d.encode_surjective v hv - exact (d.le_encode x t).2 (g.order.trans - ((d.le_encode x y).1 zw) ((d.le_encode y t).1 wv)) - -theorem encoded_meet_glb (x y : g.Node) : - GreatestLowerBoundCode d.carrier d.order (d.encode x) (d.encode y) - (d.encode (g.order.meet x y)) := by - refine ⟨(d.le_encode _ _).2 (g.order.meet_le_left x y), - (d.le_encode _ _).2 (g.order.meet_le_right x y), ?_⟩ - intro w hw wx wy - obtain ⟨z, rfl⟩ := d.encode_surjective w hw - exact (d.le_encode _ _).2 (g.order.le_meet - ((d.le_encode _ _).1 wx) ((d.le_encode _ _).1 wy)) - -theorem meetOrder : MeetOrderCode d.carrier d.order d.meetGraph := by - apply canonicalMeetGraph_code d.partialOrder - intro x hx y hy - obtain ⟨s, rfl⟩ := d.encode_surjective x hx - obtain ⟨t, rfl⟩ := d.encode_surjective y hy - exact ⟨d.encode (g.order.meet s t), d.encode_mem _, d.encoded_meet_glb s t⟩ - -theorem encoded_meet_entry (x y : g.Node) : - ZFSet.pair (ZFSet.pair (d.encode x) (d.encode y)) - (d.encode (g.order.meet x y)) ∈ d.meetGraph := - (pair_mem_canonicalMeetGraph _ _ _ _ _).2 - ⟨d.encode_mem x, d.encode_mem y, d.encode_mem _, d.encoded_meet_glb x y⟩ - -end CodedPrincipalTile - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.CodedPrincipalTile -open Compression.RecursiveMaps -universe u -variable {P Q rP rQ μP μQ ell : ZFSet.{u}} -variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} -variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} -variable (d : CodedPrincipalTile old right g ell) - -theorem encoded_embedding_order_iff {A r μ graph : ZFSet.{u}} - (source : MeetOrderCode A r μ) - (embedding : MeetEmbedding source.toMeetOrder g.order) - (function : ZFSet.IsFunc A d.carrier graph) - (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, - ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) - {x y x' y' : ZFSet.{u}} (hx : ZFSet.pair x x' ∈ graph) (hy : ZFSet.pair y y' ∈ graph) : - ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ r := by - have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 - have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 - obtain ⟨w, _, uniqueX⟩ := function.2 x hxA - obtain ⟨v, _, uniqueY⟩ := function.2 y hyA - have eqX := (uniqueX x' hx).trans (uniqueX _ (entries ⟨x, hxA⟩)).symm - have eqY := (uniqueY y' hy).trans (uniqueY _ (entries ⟨y, hyA⟩)).symm - rw [eqX, eqY, d.le_encode] - exact embedding.le_iff ⟨x, hxA⟩ ⟨y, hyA⟩ - -theorem encoded_embedding_code {A r μ graph : ZFSet.{u}} - (source : MeetOrderCode A r μ) - (embedding : MeetEmbedding source.toMeetOrder g.order) - (function : ZFSet.IsFunc A d.carrier graph) - (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, - ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) : - MeetEmbeddingCode A d.carrier r d.order μ d.meetGraph graph := by - refine ⟨⟨function, ?_⟩, ?_, ?_⟩ - · intro x y z hx hy - have xA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 - have yA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 - have zL := (ZFSet.pair_mem_prod.1 (function.1 hx)).2 - have refl := d.partialOrder.refl z zL - exact source.order.antisymm x xA y yA - ((d.encoded_embedding_order_iff source embedding function entries hx hy).1 refl) - ((d.encoded_embedding_order_iff source embedding function entries hy hx).1 refl) - · intro x y x' y' lower hx hy - exact (d.encoded_embedding_order_iff source embedding function entries hx hy).2 lower - · intro x y z x' y' z' meet hx hy hz - have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 - have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 - have hzA := (ZFSet.pair_mem_prod.1 (function.1 hz)).1 - let X : {x : ZFSet.{u} // x ∈ A} := ⟨x, hxA⟩ - let Y : {y : ZFSet.{u} // y ∈ A} := ⟨y, hyA⟩ - let Z : {z : ZFSet.{u} // z ∈ A} := ⟨z, hzA⟩ - have image_eq (t : {t : ZFSet.{u} // t ∈ A}) (v : ZFSet.{u}) - (entry : ZFSet.pair t.val v ∈ graph) : v = d.encode (embedding.toFun t) := by - obtain ⟨w, _, unique⟩ := function.2 t.val t.property - exact (unique v entry).trans (unique _ (entries t)).symm - have meet_eq : source.toMeetOrder.meet X Y = Z := by - apply Subtype.ext - obtain ⟨w, _, unique⟩ := source.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.2 ⟨hxA, hyA⟩) - exact (unique _ (source.toMeetOrder_meet_entry X Y)).trans (unique z meet).symm - have mapped : embedding.toFun Z = - g.order.meet (embedding.toFun X) (embedding.toFun Y) := by - rw [← meet_eq] - exact embedding.map_meet X Y - rw [image_eq X x' hx, image_eq Y y' hy, image_eq Z z' hz, mapped] - exact d.encoded_meet_entry (embedding.toFun X) (embedding.toFun Y) - -theorem old_embedding_code : - MeetEmbeddingCode P d.carrier rP d.order μP d.meetGraph (attachmentOldEmbeddingGraph P) := by - apply d.encoded_embedding_code old g.left - (attachmentOldEmbeddingGraph_isFunc P (freshPart Q rQ g.rightAnchor.val)) - intro p - exact (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩ - -theorem template_entry (q : {q : ZFSet.{u} // q ∈ Q}) : - ZFSet.pair q.val (d.encode (g.right.toFun q)) ∈ - attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by - classical - change ZFSet.pair q.val (d.encode (g.represent q)) ∈ _ - by_cases h : right.toMeetOrder.le q g.rightAnchor - · rw [g.represent_old q h] - exact (pair_mem_attachmentTemplateEmbeddingGraph _ _ _ _ _ _ _).2 - (Or.inl (d.base_entry ⟨q, h⟩)) - · rw [g.represent_new q h] - exact (pair_mem_attachmentTemplateEmbeddingGraph _ _ _ _ _ _ _).2 - (Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.property, h⟩, rfl⟩) - -theorem template_embedding_code : - MeetEmbeddingCode Q d.carrier rQ d.order μQ d.meetGraph - (attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val) := - d.encoded_embedding_code right g.right (attachmentTemplateEmbeddingGraph_isFunc d.base_function) - d.template_entry - -theorem template_entry_iff (q : {q : ZFSet.{u} // q ∈ Q}) (y : ZFSet.{u}) : - ZFSet.pair q.val y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ↔ - y = d.encode (g.right.toFun q) := by - constructor - · intro entry - obtain ⟨z, _, unique⟩ := (attachmentTemplateEmbeddingGraph_isFunc d.base_function).2 q.val q.property - exact (unique y entry).trans (unique _ (d.template_entry q)).symm - · intro eq - exact eq.symm ▸ d.template_entry q - -include d in -theorem template_old_overlap (p : {p : ZFSet.{u} // p ∈ P}) - (q : {q : ZFSet.{u} // q ∈ Q}) : - ZFSet.pair q.val p.val ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ↔ - ∃ h : right.toMeetOrder.le q g.rightAnchor, - (g.overlap.toFun ⟨q, h⟩).val = p := by - rw [d.template_entry_iff] - have equal : p.val = d.encode (g.right.toFun q) ↔ g.right.toFun q = g.left.toFun p := by - exact ⟨fun eq => d.encode_injective eq.symm, fun eq => congrArg d.encode eq.symm⟩ - exact equal.trans (g.overlap_exact p q) - -theorem old_ideal (p : {p : ZFSet.{u} // p ∈ P}) (x : g.Node) - (lower : ZFSet.pair (d.encode x) p.val ∈ d.order) : ∃ q, g.left.toFun q = x := - g.left_ideal p x ((d.le_encode x (g.left.toFun p)).1 lower) - -theorem template_ideal (q : {q : ZFSet.{u} // q ∈ Q}) (x : g.Node) - (lower : ZFSet.pair (d.encode x) (d.encode (g.right.toFun q)) ∈ d.order) : - ∃ p, g.right.toFun p = x := - g.right_ideal q x ((d.le_encode x (g.right.toFun q)).1 lower) - -end PartitionPilot.Forcing.CodedPrincipalTile - - - -namespace PartitionPilot.Forcing.CodedPrincipalTile -open SetFormula Compression.RecursiveMaps -universe u -variable {P Q rP rQ μP μQ ell : ZFSet.{u}} -variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} -variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} -variable (d : CodedPrincipalTile old right g ell) (M : TransitiveGround.{u}) - -theorem ground_codes - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) - (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) : - d.carrier ∈ M.sets ∧ d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ - attachmentOldEmbeddingGraph P ∈ M.sets ∧ - attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ∈ M.sets := by - have ha := M.transitive hQ g.rightAnchor.property - have hN := M.freshPart_mem separation hQ hrQ ha - have hL := M.taggedExtension_mem pairing unions powers separation hP hN - have hs := M.attachmentShadowGraph_mem pairing unions powers separation hQ hP hμQ hell ha - have hr := M.singleAttachmentOrder_mem pairing unions powers separation hP hN hrP hrQ hs - (M.empty_mem ⟨P, hP⟩) - exact ⟨hL, hr, M.canonicalMeetGraph_mem pairing unions powers separation hL hr, - M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP, - M.attachmentTemplateEmbeddingGraph_mem pairing unions powers separation hP hQ hrQ hell ha⟩ - -theorem exists_ground_tile - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) - (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) : - ∃ L ∈ M.sets, ∃ r ∈ M.sets, ∃ μ ∈ M.sets, ∃ leftMap ∈ M.sets, ∃ rightMap ∈ M.sets, - L = d.carrier ∧ r = d.order ∧ μ = d.meetGraph ∧ - leftMap = attachmentOldEmbeddingGraph P ∧ - rightMap = attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ∧ - MeetOrderCode L r μ ∧ MeetEmbeddingCode P L rP r μP μ leftMap ∧ - MeetEmbeddingCode Q L rQ r μQ μ rightMap := by - obtain ⟨hL, hr, hμ, hl, ht⟩ := d.ground_codes M pairing unions powers separation hP hQ hrP hrQ hμQ hell - exact ⟨d.carrier, hL, d.order, hr, d.meetGraph, hμ, - attachmentOldEmbeddingGraph P, hl, - attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val, ht, - rfl, rfl, rfl, rfl, rfl, d.meetOrder, d.old_embedding_code, d.template_embedding_code⟩ - -end PartitionPilot.Forcing.CodedPrincipalTile - - - -namespace PartitionPilot.Forcing -open Compression.RecursiveMaps SetFormula -universe u - -noncomputable def separationTileBase (P r W : ZFSet.{u}) : ZFSet.{u} := - attachmentOldEmbeddingGraph (attachmentIdeal P r W) - -noncomputable def separationTileCarrier (P r W : ZFSet.{u}) : ZFSet.{u} := - taggedExtension P (freshPart P r W) - -noncomputable def separationTileOrder (P r μ W : ZFSet.{u}) : ZFSet.{u} := - singleAttachmentOrder P (freshPart P r W) r r - (attachmentShadowGraph P P μ (separationTileBase P r W) W) ∅ - -noncomputable def separationTileMeet (P r μ W : ZFSet.{u}) : ZFSet.{u} := - canonicalMeetGraph (separationTileCarrier P r W) (separationTileOrder P r μ W) - -noncomputable def separationTileMap (P r W : ZFSet.{u}) : ZFSet.{u} := - attachmentTemplateEmbeddingGraph P P r (separationTileBase P r W) W - -theorem separationTileBase_function (P r W : ZFSet.{u}) : - ZFSet.IsFunc (attachmentIdeal P r W) P (separationTileBase P r W) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, rfl⟩ := (mem_attachmentOldEmbeddingGraph _ z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hx, ((mem_attachmentIdeal _ _ _ _).1 hx).1⟩ - · intro x hx - exact ⟨x, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨hx, rfl⟩, - fun y hy => ((pair_mem_attachmentOldEmbeddingGraph _ _ _).1 hy).2⟩ - -theorem separationTileCoding {P r μ : ZFSet.{u}} - (old : MeetOrderCode P r μ) (W : {x : ZFSet.{u} // x ∈ P}) : - CodedPrincipalTile old old (BinaryTiles.separation old.toMeetOrder W) - (separationTileBase P r W.val) := by - refine ⟨separationTileBase_function P r W.val, ?_⟩ - intro point - exact (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 - ⟨(mem_attachmentIdeal _ _ _ _).2 ⟨point.val.property, point.property⟩, rfl⟩ - -theorem pair_mem_separationTileMap (P r W x y : ZFSet.{u}) : - ZFSet.pair x y ∈ separationTileMap P r W ↔ - x ∈ P ∧ ((ZFSet.pair x W ∈ r ∧ y = x) ∨ - (ZFSet.pair x W ∉ r ∧ y = ZFSet.pair P x)) := by - rw [separationTileMap, pair_mem_attachmentTemplateEmbeddingGraph] - rw [separationTileBase, pair_mem_attachmentOldEmbeddingGraph, mem_attachmentIdeal, mem_freshPart] - tauto - -theorem separationTile_meetOrder {P r μ W : ZFSet.{u}} - (old : MeetOrderCode P r μ) (hW : W ∈ P) : - MeetOrderCode (separationTileCarrier P r W) (separationTileOrder P r μ W) - (separationTileMeet P r μ W) := - (separationTileCoding old ⟨W, hW⟩).meetOrder - -theorem separationTile_embeddings {P r μ W : ZFSet.{u}} - (old : MeetOrderCode P r μ) (hW : W ∈ P) : - MeetEmbeddingCode P (separationTileCarrier P r W) r (separationTileOrder P r μ W) - μ (separationTileMeet P r μ W) (attachmentOldEmbeddingGraph P) ∧ - MeetEmbeddingCode P (separationTileCarrier P r W) r (separationTileOrder P r μ W) - μ (separationTileMeet P r μ W) (separationTileMap P r W) := - ⟨(separationTileCoding old ⟨W, hW⟩).old_embedding_code, - (separationTileCoding old ⟨W, hW⟩).template_embedding_code⟩ - -theorem separationTile_exact_overlap {P r W x y : ZFSet.{u}} (hy : y ∈ P) : - ZFSet.pair x y ∈ separationTileMap P r W ↔ x ∈ P ∧ ZFSet.pair x W ∈ r ∧ y = x := by - rw [pair_mem_separationTileMap] - constructor - · rintro ⟨hx, h | h⟩ - · exact ⟨hx, h⟩ - · exact False.elim (pair_tag_not_mem P x (h.2 ▸ hy)) - · exact fun ⟨hx, h⟩ => ⟨hx, Or.inl h⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem separationTile_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r μ W : ZFSet.{u}} (old : MeetOrderCode P r μ) - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hW : W ∈ P) : - separationTileCarrier P r W ∈ M.sets ∧ separationTileOrder P r μ W ∈ M.sets ∧ - separationTileMeet P r μ W ∈ M.sets ∧ attachmentOldEmbeddingGraph P ∈ M.sets ∧ - separationTileMap P r W ∈ M.sets := by - have hBase := M.attachmentOldEmbeddingGraph_mem pairing unions powers separation - (M.attachmentIdeal_mem separation hP hr (M.transitive hP hW)) - exact (separationTileCoding old ⟨W, hW⟩).ground_codes M pairing unions powers separation - hP hP hr hr hμ hBase - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FixedTopCodes + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +def singleAttachmentLe (P N rP rQ shadow F x y : ZFSet.{u}) : Prop := + (x ∈ P ∧ y ∈ P ∧ ZFSet.pair x y ∈ rP) ∨ + (x ∈ P ∧ ∃ q ∈ N, ∃ s ∈ P, + y = ZFSet.pair P q ∧ ZFSet.pair q s ∈ shadow ∧ ZFSet.pair x s ∈ rP) ∨ + ((∃ q ∈ N, x = ZFSet.pair P q) ∧ y ∈ F) ∨ + (∃ q ∈ N, ∃ t ∈ N, + x = ZFSet.pair P q ∧ y = ZFSet.pair P t ∧ ZFSet.pair q t ∈ rQ) + +def singleAttachmentOrder (P N rP rQ shadow F : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ taggedExtension P N, ∃ y ∈ taggedExtension P N, + z = ZFSet.pair x y ∧ singleAttachmentLe P N rP rQ shadow F x y) + (ZFSet.prod (taggedExtension P N) (taggedExtension P N)) + +theorem pair_mem_singleAttachmentOrder (P N rP rQ shadow F x y : ZFSet.{u}) : + ZFSet.pair x y ∈ singleAttachmentOrder P N rP rQ shadow F ↔ + x ∈ taggedExtension P N ∧ y ∈ taggedExtension P N ∧ + singleAttachmentLe P N rP rQ shadow F x y := by + simp only [singleAttachmentOrder, ZFSet.mem_sep, ZFSet.pair_mem_prod, ZFSet.pair_inj] + constructor + · rintro ⟨⟨hx, hy⟩, a, _, b, _, ⟨rfl, rfl⟩, lower⟩ + exact ⟨hx, hy, lower⟩ + · rintro ⟨hx, hy, lower⟩ + exact ⟨⟨hx, hy⟩, x, hx, y, hy, ⟨rfl, rfl⟩, lower⟩ + +theorem singleAttachmentOrder_shape (P N rP rQ shadow F : ZFSet.{u}) : + singleAttachmentOrder P N rP rQ shadow F ⊆ + ZFSet.prod (taggedExtension P N) (taggedExtension P N) := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +namespace BoundedFormula + +open SetFormula + +def attachmentTagFormula {n} (x p nset : Fin n) : BoundedFormula n := + exMem nset (orderedPairFormula x.succ p.succ 0) + +def attachmentOldNewFormula {n} (x y p nset shadow r : Fin n) : BoundedFormula n := + .conj (.mem x p) (exMem nset (exMem p.succ + (.conj (orderedPairFormula y.succ.succ p.succ.succ 1) + (.conj (pairMembershipFormula 1 0 shadow.succ.succ) + (pairMembershipFormula x.succ.succ 0 r.succ.succ))))) + +def attachmentNewNewFormula {n} (x y p nset r : Fin n) : BoundedFormula n := + exMem nset (exMem nset.succ + (.conj (orderedPairFormula x.succ.succ p.succ.succ 1) + (.conj (orderedPairFormula y.succ.succ p.succ.succ 0) + (pairMembershipFormula 1 0 r.succ.succ)))) + +def singleAttachmentLeFormula {n} (x y p nset rP rQ shadow f : Fin n) : BoundedFormula n := + disj (.conj (.mem x p) (.conj (.mem y p) (pairMembershipFormula x y rP))) + (disj (attachmentOldNewFormula x y p nset shadow rP) + (disj (.conj (attachmentTagFormula x p nset) (.mem y f)) + (attachmentNewNewFormula x y p nset rQ))) + +def singleAttachmentOrderEntryFormula {n} (z l p nset rP rQ shadow f : Fin n) : + BoundedFormula n := + exMem l (exMem l.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (singleAttachmentLeFormula 1 0 p.succ.succ nset.succ.succ + rP.succ.succ rQ.succ.succ shadow.succ.succ f.succ.succ))) + +theorem truth_singleAttachmentLeFormula {n} (x y p nset rP rQ shadow f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (singleAttachmentLeFormula x y p nset rP rQ shadow f) env ↔ + singleAttachmentLe (env p) (env nset) (env rP) (env rQ) (env shadow) + (env f) (env x) (env y) := by + simp only [singleAttachmentLeFormula, attachmentOldNewFormula, attachmentTagFormula, + attachmentNewNewFormula, truth_disj, Truth, truth_exMem, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl + +theorem truth_singleAttachmentOrderEntryFormula {n} (z l p nset rP rQ shadow f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (singleAttachmentOrderEntryFormula z l p nset rP rQ shadow f) env ↔ + ∃ x ∈ env l, ∃ y ∈ env l, env z = ZFSet.pair x y ∧ + singleAttachmentLe (env p) (env nset) (env rP) (env rQ) + (env shadow) (env f) x y := by + simp only [singleAttachmentOrderEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_singleAttachmentLeFormula] + rfl + +end BoundedFormula + + + + + +def codedAttachmentFreshLe (P inside shadow upper x y : ZFSet.{u}) : Prop := + ZFSet.pair x y ∈ inside ∨ + ∃ s ∈ P, ZFSet.pair y s ∈ shadow ∧ ZFSet.pair x s ∈ upper + +def codedAttachmentLe (P N r inside shadow upper x y : ZFSet.{u}) : Prop := + (x ∈ P ∧ y ∈ P ∧ ZFSet.pair x y ∈ r) ∨ + (x ∈ P ∧ ∃ q ∈ N, ∃ s ∈ P, + y = ZFSet.pair P q ∧ ZFSet.pair q s ∈ shadow ∧ ZFSet.pair x s ∈ r) ∨ + (y ∈ P ∧ ∃ q ∈ N, x = ZFSet.pair P q ∧ ZFSet.pair q y ∈ upper) ∨ + (∃ q ∈ N, ∃ t ∈ N, x = ZFSet.pair P q ∧ y = ZFSet.pair P t ∧ + codedAttachmentFreshLe P inside shadow upper q t) + +noncomputable def codedAttachmentOrder (P N r inside shadow upper : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ taggedExtension P N, ∃ y ∈ taggedExtension P N, + z = ZFSet.pair x y ∧ codedAttachmentLe P N r inside shadow upper x y) + (ZFSet.prod (taggedExtension P N) (taggedExtension P N)) + +theorem pair_mem_codedAttachmentOrder (P N r inside shadow upper x y : ZFSet.{u}) : + ZFSet.pair x y ∈ codedAttachmentOrder P N r inside shadow upper ↔ + x ∈ taggedExtension P N ∧ y ∈ taggedExtension P N ∧ + codedAttachmentLe P N r inside shadow upper x y := by + simp only [codedAttachmentOrder, ZFSet.mem_sep, ZFSet.pair_mem_prod, ZFSet.pair_inj] + constructor + · rintro ⟨⟨hx, hy⟩, a, _, b, _, ⟨rfl, rfl⟩, lower⟩ + exact ⟨hx, hy, lower⟩ + · rintro ⟨hx, hy, lower⟩ + exact ⟨⟨hx, hy⟩, x, hx, y, hy, ⟨rfl, rfl⟩, lower⟩ + +theorem codedAttachmentOrder_shape (P N r inside shadow upper : ZFSet.{u}) : + codedAttachmentOrder P N r inside shadow upper ⊆ + ZFSet.prod (taggedExtension P N) (taggedExtension P N) := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +namespace BoundedFormula +open SetFormula + +def codedAttachmentFreshLeFormula {n} (x y p inside shadow upper : Fin n) : BoundedFormula n := + disj (pairMembershipFormula x y inside) (exMem p + (.conj (pairMembershipFormula y.succ 0 shadow.succ) + (pairMembershipFormula x.succ 0 upper.succ))) + +def codedAttachmentLeFormula {n} (x y p nset r inside shadow upper : Fin n) : BoundedFormula n := + disj (.conj (.mem x p) (.conj (.mem y p) (pairMembershipFormula x y r))) + (disj (attachmentOldNewFormula x y p nset shadow r) + (disj (.conj (.mem y p) (exMem nset + (.conj (orderedPairFormula x.succ p.succ 0) + (pairMembershipFormula 0 y.succ upper.succ)))) + (exMem nset (exMem nset.succ + (.conj (orderedPairFormula x.succ.succ p.succ.succ 1) + (.conj (orderedPairFormula y.succ.succ p.succ.succ 0) + (codedAttachmentFreshLeFormula 1 0 p.succ.succ inside.succ.succ + shadow.succ.succ upper.succ.succ))))))) + +def codedAttachmentOrderEntryFormula {n} (z l p nset r inside shadow upper : Fin n) : + BoundedFormula n := + exMem l (exMem l.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (codedAttachmentLeFormula 1 0 p.succ.succ nset.succ.succ r.succ.succ + inside.succ.succ shadow.succ.succ upper.succ.succ))) + +theorem truth_codedAttachmentFreshLeFormula {n} (x y p inside shadow upper : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (codedAttachmentFreshLeFormula x y p inside shadow upper) env ↔ + codedAttachmentFreshLe (env p) (env inside) (env shadow) (env upper) (env x) (env y) := by + simp only [codedAttachmentFreshLeFormula, truth_disj, truth_exMem, Truth, + truth_pairMembershipFormula] + rfl + +theorem truth_codedAttachmentLeFormula {n} (x y p nset r inside shadow upper : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (codedAttachmentLeFormula x y p nset r inside shadow upper) env ↔ + codedAttachmentLe (env p) (env nset) (env r) (env inside) (env shadow) + (env upper) (env x) (env y) := by + simp only [codedAttachmentLeFormula, attachmentOldNewFormula, truth_disj, truth_exMem, + Truth, truth_pairMembershipFormula, truth_orderedPairFormula, truth_codedAttachmentFreshLeFormula] + rfl + +theorem truth_codedAttachmentOrderEntryFormula {n} (z l p nset r inside shadow upper : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (codedAttachmentOrderEntryFormula z l p nset r inside shadow upper) env ↔ + ∃ x ∈ env l, ∃ y ∈ env l, env z = ZFSet.pair x y ∧ + codedAttachmentLe (env p) (env nset) (env r) (env inside) (env shadow) (env upper) x y := by + simp only [codedAttachmentOrderEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_codedAttachmentLeFormula] + rfl + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem singleAttachmentOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P N rP rQ shadow F : ZFSet.{u}} + (hP : P ∈ M.sets) (hN : N ∈ M.sets) (hrP : rP ∈ M.sets) + (hrQ : rQ ∈ M.sets) (hs : shadow ∈ M.sets) (hF : F ∈ M.sets) : + singleAttachmentOrder P N rP rQ shadow F ∈ M.sets := by + let L := taggedExtension P N + have hL := M.taggedExtension_mem pairing unions powers separation hP hN + let params := extend L (extend P (extend N (extend rP (extend rQ + (extend shadow (extend F Fin.elim0)))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.singleAttachmentOrderEntryFormula 0 1 2 3 4 5 6 7) params + (Fin.cases hL (Fin.cases hP (Fin.cases hN (Fin.cases hrP (Fin.cases hrQ + (Fin.cases hs (Fin.cases hF (fun i => Fin.elim0 i)))))))) + (M.prod_mem pairing unions powers separation hL hL) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.singleAttachmentOrderEntryFormula 0 1 2 3 4 5 6 7) + (extend z params)) (ZFSet.prod L L) = singleAttachmentOrder P N rP rQ shadow F := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, singleAttachmentOrder, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_singleAttachmentOrderEntryFormula + 0 1 2 3 4 5 6 7 _) + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +universe u + +namespace BoundedFormula + +open SetFormula + +def greatestLowerBoundFormula {n} (l r x y z : Fin n) : BoundedFormula n := + .conj (pairMembershipFormula z x r) (.conj (pairMembershipFormula z y r) + (allMem l (imp (pairMembershipFormula 0 x.succ r.succ) + (imp (pairMembershipFormula 0 y.succ r.succ) (pairMembershipFormula 0 z.succ r.succ))))) + +theorem truth_greatestLowerBoundFormula {n} (l r x y z : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (greatestLowerBoundFormula l r x y z) env ↔ + GreatestLowerBoundCode (env l) (env r) (env x) (env y) (env z) := by + simp only [greatestLowerBoundFormula, Truth, truth_imp, + truth_pairMembershipFormula, GreatestLowerBoundCode] + rfl + +def canonicalMeetEntryFormula {n} (v l r : Fin n) : BoundedFormula n := + exMem l (exMem l.succ (exMem l.succ.succ + (.conj (orderedTripleFormula v.succ.succ.succ 2 1 0) + (greatestLowerBoundFormula l.succ.succ.succ r.succ.succ.succ 2 1 0)))) + +theorem truth_canonicalMeetEntryFormula {n} (v l r : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (canonicalMeetEntryFormula v l r) env ↔ + env v ∈ canonicalMeetGraph (env l) (env r) := by + simp only [canonicalMeetEntryFormula, truth_exMem, Truth, + truth_orderedTripleFormula, truth_greatestLowerBoundFormula, mem_canonicalMeetGraph] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula + +theorem canonicalMeetGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {L r : ZFSet.{u}} (hL : L ∈ M.sets) (hr : r ∈ M.sets) : + canonicalMeetGraph L r ∈ M.sets := by + let params := extend L (extend r Fin.elim0) + have selected := M.bounded_separation_mem separation + (BoundedFormula.canonicalMeetEntryFormula 0 1 2) params + (Fin.cases hL (Fin.cases hr (fun i => Fin.elim0 i))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hL hL) hL) + have eq : ZFSet.sep (fun v => BoundedFormula.Truth + (BoundedFormula.canonicalMeetEntryFormula 0 1 2) (extend v params)) + (ZFSet.prod (ZFSet.prod L L) L) = canonicalMeetGraph L r := by + apply ZFSet.ext + intro v + rw [ZFSet.mem_sep, BoundedFormula.truth_canonicalMeetEntryFormula] + exact ⟨And.right, fun hv => ⟨canonicalMeetGraph_subset L r hv, hv⟩⟩ + exact eq ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open Compression.RecursiveMaps +universe u + +structure CodedPrincipalTile {P Q rP rQ μP μQ : ZFSet.{u}} + (old : MeetOrderCode P rP μP) (right : MeetOrderCode Q rQ μQ) + (g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder) (ell : ZFSet.{u}) where + base_function : ZFSet.IsFunc (attachmentIdeal Q rQ g.rightAnchor.val) P ell + base_entry : ∀ x, ZFSet.pair x.val.val (g.overlap.toFun x).val.val ∈ ell + +namespace CodedPrincipalTile +variable {P Q rP rQ μP μQ ell : ZFSet.{u}} +variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} +variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} +variable (d : CodedPrincipalTile old right g ell) + +abbrev Nodes := g.Node + +def encode (_d : CodedPrincipalTile old right g ell) : g.Node → ZFSet.{u} + | .inl p => p.val + | .inr q => ZFSet.pair P q.val.val + +noncomputable abbrev carrier (_d : CodedPrincipalTile old right g ell) := + taggedExtension P (freshPart Q rQ g.rightAnchor.val) +noncomputable abbrev order (_d : CodedPrincipalTile old right g ell) := + singleAttachmentOrder P (freshPart Q rQ g.rightAnchor.val) rP rQ + (attachmentShadowGraph Q P μQ ell g.rightAnchor.val) ∅ +noncomputable abbrev meetGraph := canonicalMeetGraph d.carrier d.order + +include d + +omit d in +theorem fresh_mem (_d : CodedPrincipalTile old right g ell) (q : g.Fresh) : q.val.val ∈ freshPart Q rQ g.rightAnchor.val := + (mem_freshPart _ _ _ _).2 ⟨q.val.property, q.property⟩ + +theorem shadow_entry (q : {q : ZFSet.{u} // q ∈ Q}) : + ZFSet.pair q.val (g.shadow q).val ∈ attachmentShadowGraph Q P μQ ell g.rightAnchor.val := by + apply (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2 + exact ⟨q.property, (g.shadow q).property, + (right.toMeetOrder.meet q g.rightAnchor).val, + (right.toMeetOrder.meet q g.rightAnchor).property, + right.toMeetOrder_meet_entry q g.rightAnchor, + d.base_entry (Attachment.cut right.toMeetOrder g.rightAnchor q)⟩ + +theorem encode_mem (x : g.Node) : d.encode x ∈ d.carrier := by + cases x with + | inl p => exact old_mem_taggedExtension p.property + | inr q => exact pair_mem_taggedExtension.2 (d.fresh_mem q) + +theorem encode_injective : Function.Injective d.encode := by + intro x y eq + cases x with + | inl p => + cases y with + | inl s => exact congrArg Sum.inl (Subtype.ext eq) + | inr q => + change p.val = ZFSet.pair P q.val.val at eq + exact False.elim (pair_tag_not_mem P q.val.val (eq ▸ p.property)) + | inr q => + cases y with + | inl p => + change ZFSet.pair P q.val.val = p.val at eq + exact False.elim (pair_tag_not_mem P q.val.val (eq.symm ▸ p.property)) + | inr t => exact congrArg Sum.inr (Subtype.ext (Subtype.ext (ZFSet.pair_inj.1 eq).2)) + +theorem encode_surjective : ∀ z ∈ d.carrier, ∃ x : g.Node, d.encode x = z := by + intro z hz + rcases mem_taggedExtension.1 hz with old | ⟨q, hq, eq⟩ + · exact ⟨.inl ⟨z, old⟩, rfl⟩ + · have fresh := (mem_freshPart Q rQ g.rightAnchor.val q).1 hq + exact ⟨.inr ⟨⟨q, fresh.1⟩, fresh.2⟩, eq.symm⟩ + +omit d in +theorem fresh_lower_iff (_d : CodedPrincipalTile old right g ell) (q t : g.Fresh) : + g.order.le (.inr q) (.inr t) ↔ ZFSet.pair q.val.val t.val.val ∈ rQ := by + change (_ ∨ False) ↔ _ + exact ⟨fun h => h.elim id False.elim, Or.inl⟩ + +theorem le_encode (x y : g.Node) : + ZFSet.pair (d.encode x) (d.encode y) ∈ d.order ↔ g.order.le x y := by + rw [pair_mem_singleAttachmentOrder] + have bounded : d.encode x ∈ d.carrier ∧ d.encode y ∈ d.carrier := + ⟨d.encode_mem x, d.encode_mem y⟩ + simp only [bounded.1, bounded.2, true_and] + cases x with + | inl p => + cases y with + | inl s => + change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) p.val s.val ↔ ZFSet.pair p.val s.val ∈ rP + constructor + · rintro (h | h | h | h) + · exact h.2.2 + · obtain ⟨_, q, _, t, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P q (eq ▸ s.property)) + · obtain ⟨⟨q, _, eq⟩, _⟩ := h + exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) + · obtain ⟨q, _, t, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P q (eq ▸ p.property)) + · intro lower + exact Or.inl ⟨p.property, s.property, lower⟩ + | inr q => + change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) p.val (ZFSet.pair P q.val.val) ↔ + ZFSet.pair p.val (g.shadow q.val).val ∈ rP + constructor + · rintro (h | h | h | h) + · exact False.elim (pair_tag_not_mem P q.val.val h.2.1) + · obtain ⟨_, t, _, s, _, eq, image, lower⟩ := h + have same : q.val.val = t := (ZFSet.pair_inj.1 eq).2 + subst t + have graph := attachmentShadowGraph_function right g.rightAnchor.property d.base_function + obtain ⟨v, _, unique⟩ := graph.2 q.val.val q.val.property + have sameValue := (unique s image).trans (unique _ (d.shadow_entry q.val)).symm + exact sameValue ▸ lower + · obtain ⟨⟨t, _, eq⟩, _⟩ := h + exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) + · obtain ⟨t, _, s, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) + · intro lower + exact Or.inr (Or.inl ⟨p.property, q.val.val, d.fresh_mem q, + (g.shadow q.val).val, (g.shadow q.val).property, rfl, + d.shadow_entry q.val, lower⟩) + | inr q => + cases y with + | inl p => + change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) (ZFSet.pair P q.val.val) p.val ↔ False + constructor + · rintro (h | h | h | h) + · exact False.elim (pair_tag_not_mem P q.val.val h.1) + · exact False.elim (pair_tag_not_mem P q.val.val h.1) + · exact ZFSet.notMem_empty _ h.2 + · obtain ⟨s, _, t, _, _, eq, _⟩ := h + exact False.elim (pair_tag_not_mem P t (eq ▸ p.property)) + · intro upper + exact False.elim upper + | inr t => + rw [d.fresh_lower_iff] + change singleAttachmentLe P _ rP rQ _ (∅ : ZFSet) + (ZFSet.pair P q.val.val) (ZFSet.pair P t.val.val) ↔ + ZFSet.pair q.val.val t.val.val ∈ rQ + constructor + · rintro (h | h | h | h) + · exact False.elim (pair_tag_not_mem P q.val.val h.1) + · exact False.elim (pair_tag_not_mem P q.val.val h.1) + · exact False.elim (ZFSet.notMem_empty _ h.2) + · obtain ⟨s, _, v, _, eqQ, eqT, lower⟩ := h + have sameQ := (ZFSet.pair_inj.1 eqQ).2 + have sameT := (ZFSet.pair_inj.1 eqT).2 + exact sameQ.symm ▸ sameT.symm ▸ lower + · intro lower + exact Or.inr (Or.inr (Or.inr ⟨q.val.val, d.fresh_mem q, + t.val.val, d.fresh_mem t, rfl, rfl, lower⟩)) + +theorem partialOrder : PartialOrderCode d.carrier d.order where + relation := singleAttachmentOrder_shape P _ rP rQ _ (∅ : ZFSet) + refl z hz := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + exact (d.le_encode x x).2 (g.order.refl x) + antisymm z hz w hw zw wz := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + obtain ⟨y, rfl⟩ := d.encode_surjective w hw + exact congrArg d.encode (g.order.antisymm + ((d.le_encode x y).1 zw) ((d.le_encode y x).1 wz)) + trans z hz w hw v hv zw wv := by + obtain ⟨x, rfl⟩ := d.encode_surjective z hz + obtain ⟨y, rfl⟩ := d.encode_surjective w hw + obtain ⟨t, rfl⟩ := d.encode_surjective v hv + exact (d.le_encode x t).2 (g.order.trans + ((d.le_encode x y).1 zw) ((d.le_encode y t).1 wv)) + +theorem encoded_meet_glb (x y : g.Node) : + GreatestLowerBoundCode d.carrier d.order (d.encode x) (d.encode y) + (d.encode (g.order.meet x y)) := by + refine ⟨(d.le_encode _ _).2 (g.order.meet_le_left x y), + (d.le_encode _ _).2 (g.order.meet_le_right x y), ?_⟩ + intro w hw wx wy + obtain ⟨z, rfl⟩ := d.encode_surjective w hw + exact (d.le_encode _ _).2 (g.order.le_meet + ((d.le_encode _ _).1 wx) ((d.le_encode _ _).1 wy)) + +theorem meetOrder : MeetOrderCode d.carrier d.order d.meetGraph := by + apply canonicalMeetGraph_code d.partialOrder + intro x hx y hy + obtain ⟨s, rfl⟩ := d.encode_surjective x hx + obtain ⟨t, rfl⟩ := d.encode_surjective y hy + exact ⟨d.encode (g.order.meet s t), d.encode_mem _, d.encoded_meet_glb s t⟩ + +theorem encoded_meet_entry (x y : g.Node) : + ZFSet.pair (ZFSet.pair (d.encode x) (d.encode y)) + (d.encode (g.order.meet x y)) ∈ d.meetGraph := + (pair_mem_canonicalMeetGraph _ _ _ _ _).2 + ⟨d.encode_mem x, d.encode_mem y, d.encode_mem _, d.encoded_meet_glb x y⟩ + +end CodedPrincipalTile + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.CodedPrincipalTile +open Compression.RecursiveMaps +universe u +variable {P Q rP rQ μP μQ ell : ZFSet.{u}} +variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} +variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} +variable (d : CodedPrincipalTile old right g ell) + +theorem encoded_embedding_order_iff {A r μ graph : ZFSet.{u}} + (source : MeetOrderCode A r μ) + (embedding : MeetEmbedding source.toMeetOrder g.order) + (function : ZFSet.IsFunc A d.carrier graph) + (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, + ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) + {x y x' y' : ZFSet.{u}} (hx : ZFSet.pair x x' ∈ graph) (hy : ZFSet.pair y y' ∈ graph) : + ZFSet.pair x' y' ∈ d.order ↔ ZFSet.pair x y ∈ r := by + have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 + have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 + obtain ⟨w, _, uniqueX⟩ := function.2 x hxA + obtain ⟨v, _, uniqueY⟩ := function.2 y hyA + have eqX := (uniqueX x' hx).trans (uniqueX _ (entries ⟨x, hxA⟩)).symm + have eqY := (uniqueY y' hy).trans (uniqueY _ (entries ⟨y, hyA⟩)).symm + rw [eqX, eqY, d.le_encode] + exact embedding.le_iff ⟨x, hxA⟩ ⟨y, hyA⟩ + +theorem encoded_embedding_code {A r μ graph : ZFSet.{u}} + (source : MeetOrderCode A r μ) + (embedding : MeetEmbedding source.toMeetOrder g.order) + (function : ZFSet.IsFunc A d.carrier graph) + (entries : ∀ x : {x : ZFSet.{u} // x ∈ A}, + ZFSet.pair x.val (d.encode (embedding.toFun x)) ∈ graph) : + MeetEmbeddingCode A d.carrier r d.order μ d.meetGraph graph := by + refine ⟨⟨function, ?_⟩, ?_, ?_⟩ + · intro x y z hx hy + have xA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 + have yA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 + have zL := (ZFSet.pair_mem_prod.1 (function.1 hx)).2 + have refl := d.partialOrder.refl z zL + exact source.order.antisymm x xA y yA + ((d.encoded_embedding_order_iff source embedding function entries hx hy).1 refl) + ((d.encoded_embedding_order_iff source embedding function entries hy hx).1 refl) + · intro x y x' y' lower hx hy + exact (d.encoded_embedding_order_iff source embedding function entries hx hy).2 lower + · intro x y z x' y' z' meet hx hy hz + have hxA := (ZFSet.pair_mem_prod.1 (function.1 hx)).1 + have hyA := (ZFSet.pair_mem_prod.1 (function.1 hy)).1 + have hzA := (ZFSet.pair_mem_prod.1 (function.1 hz)).1 + let X : {x : ZFSet.{u} // x ∈ A} := ⟨x, hxA⟩ + let Y : {y : ZFSet.{u} // y ∈ A} := ⟨y, hyA⟩ + let Z : {z : ZFSet.{u} // z ∈ A} := ⟨z, hzA⟩ + have image_eq (t : {t : ZFSet.{u} // t ∈ A}) (v : ZFSet.{u}) + (entry : ZFSet.pair t.val v ∈ graph) : v = d.encode (embedding.toFun t) := by + obtain ⟨w, _, unique⟩ := function.2 t.val t.property + exact (unique v entry).trans (unique _ (entries t)).symm + have meet_eq : source.toMeetOrder.meet X Y = Z := by + apply Subtype.ext + obtain ⟨w, _, unique⟩ := source.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.2 ⟨hxA, hyA⟩) + exact (unique _ (source.toMeetOrder_meet_entry X Y)).trans (unique z meet).symm + have mapped : embedding.toFun Z = + g.order.meet (embedding.toFun X) (embedding.toFun Y) := by + rw [← meet_eq] + exact embedding.map_meet X Y + rw [image_eq X x' hx, image_eq Y y' hy, image_eq Z z' hz, mapped] + exact d.encoded_meet_entry (embedding.toFun X) (embedding.toFun Y) + +theorem old_embedding_code : + MeetEmbeddingCode P d.carrier rP d.order μP d.meetGraph (attachmentOldEmbeddingGraph P) := by + apply d.encoded_embedding_code old g.left + (attachmentOldEmbeddingGraph_isFunc P (freshPart Q rQ g.rightAnchor.val)) + intro p + exact (pair_mem_attachmentOldEmbeddingGraph P p.val p.val).2 ⟨p.property, rfl⟩ + +theorem template_entry (q : {q : ZFSet.{u} // q ∈ Q}) : + ZFSet.pair q.val (d.encode (g.right.toFun q)) ∈ + attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by + classical + change ZFSet.pair q.val (d.encode (g.represent q)) ∈ _ + by_cases h : right.toMeetOrder.le q g.rightAnchor + · rw [g.represent_old q h] + exact (pair_mem_attachmentTemplateEmbeddingGraph _ _ _ _ _ _ _).2 + (Or.inl (d.base_entry ⟨q, h⟩)) + · rw [g.represent_new q h] + exact (pair_mem_attachmentTemplateEmbeddingGraph _ _ _ _ _ _ _).2 + (Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.property, h⟩, rfl⟩) + +theorem template_embedding_code : + MeetEmbeddingCode Q d.carrier rQ d.order μQ d.meetGraph + (attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val) := + d.encoded_embedding_code right g.right (attachmentTemplateEmbeddingGraph_isFunc d.base_function) + d.template_entry + +theorem template_entry_iff (q : {q : ZFSet.{u} // q ∈ Q}) (y : ZFSet.{u}) : + ZFSet.pair q.val y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ↔ + y = d.encode (g.right.toFun q) := by + constructor + · intro entry + obtain ⟨z, _, unique⟩ := (attachmentTemplateEmbeddingGraph_isFunc d.base_function).2 q.val q.property + exact (unique y entry).trans (unique _ (d.template_entry q)).symm + · intro eq + exact eq.symm ▸ d.template_entry q + +include d in +theorem template_old_overlap (p : {p : ZFSet.{u} // p ∈ P}) + (q : {q : ZFSet.{u} // q ∈ Q}) : + ZFSet.pair q.val p.val ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ↔ + ∃ h : right.toMeetOrder.le q g.rightAnchor, + (g.overlap.toFun ⟨q, h⟩).val = p := by + rw [d.template_entry_iff] + have equal : p.val = d.encode (g.right.toFun q) ↔ g.right.toFun q = g.left.toFun p := by + exact ⟨fun eq => d.encode_injective eq.symm, fun eq => congrArg d.encode eq.symm⟩ + exact equal.trans (g.overlap_exact p q) + +theorem old_ideal (p : {p : ZFSet.{u} // p ∈ P}) (x : g.Node) + (lower : ZFSet.pair (d.encode x) p.val ∈ d.order) : ∃ q, g.left.toFun q = x := + g.left_ideal p x ((d.le_encode x (g.left.toFun p)).1 lower) + +theorem template_ideal (q : {q : ZFSet.{u} // q ∈ Q}) (x : g.Node) + (lower : ZFSet.pair (d.encode x) (d.encode (g.right.toFun q)) ∈ d.order) : + ∃ p, g.right.toFun p = x := + g.right_ideal q x ((d.le_encode x (g.right.toFun q)).1 lower) + +end PartitionPilot.Forcing.CodedPrincipalTile + + + +namespace PartitionPilot.Forcing.CodedPrincipalTile +open SetFormula Compression.RecursiveMaps +universe u +variable {P Q rP rQ μP μQ ell : ZFSet.{u}} +variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ} +variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder} +variable (d : CodedPrincipalTile old right g ell) (M : TransitiveGround.{u}) + +theorem ground_codes + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) + (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) : + d.carrier ∈ M.sets ∧ d.order ∈ M.sets ∧ d.meetGraph ∈ M.sets ∧ + attachmentOldEmbeddingGraph P ∈ M.sets ∧ + attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ∈ M.sets := by + have ha := M.transitive hQ g.rightAnchor.property + have hN := M.freshPart_mem separation hQ hrQ ha + have hL := M.taggedExtension_mem pairing unions powers separation hP hN + have hs := M.attachmentShadowGraph_mem pairing unions powers separation hQ hP hμQ hell ha + have hr := M.singleAttachmentOrder_mem pairing unions powers separation hP hN hrP hrQ hs + (M.empty_mem ⟨P, hP⟩) + exact ⟨hL, hr, M.canonicalMeetGraph_mem pairing unions powers separation hL hr, + M.attachmentOldEmbeddingGraph_mem pairing unions powers separation hP, + M.attachmentTemplateEmbeddingGraph_mem pairing unions powers separation hP hQ hrQ hell ha⟩ + +theorem exists_ground_tile + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hP : P ∈ M.sets) (hQ : Q ∈ M.sets) (hrP : rP ∈ M.sets) + (hrQ : rQ ∈ M.sets) (hμQ : μQ ∈ M.sets) (hell : ell ∈ M.sets) : + ∃ L ∈ M.sets, ∃ r ∈ M.sets, ∃ μ ∈ M.sets, ∃ leftMap ∈ M.sets, ∃ rightMap ∈ M.sets, + L = d.carrier ∧ r = d.order ∧ μ = d.meetGraph ∧ + leftMap = attachmentOldEmbeddingGraph P ∧ + rightMap = attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val ∧ + MeetOrderCode L r μ ∧ MeetEmbeddingCode P L rP r μP μ leftMap ∧ + MeetEmbeddingCode Q L rQ r μQ μ rightMap := by + obtain ⟨hL, hr, hμ, hl, ht⟩ := d.ground_codes M pairing unions powers separation hP hQ hrP hrQ hμQ hell + exact ⟨d.carrier, hL, d.order, hr, d.meetGraph, hμ, + attachmentOldEmbeddingGraph P, hl, + attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val, ht, + rfl, rfl, rfl, rfl, rfl, d.meetOrder, d.old_embedding_code, d.template_embedding_code⟩ + +end PartitionPilot.Forcing.CodedPrincipalTile + + + +namespace PartitionPilot.Forcing +open Compression.RecursiveMaps SetFormula +universe u + +noncomputable def separationTileBase (P r W : ZFSet.{u}) : ZFSet.{u} := + attachmentOldEmbeddingGraph (attachmentIdeal P r W) + +noncomputable def separationTileCarrier (P r W : ZFSet.{u}) : ZFSet.{u} := + taggedExtension P (freshPart P r W) + +noncomputable def separationTileOrder (P r μ W : ZFSet.{u}) : ZFSet.{u} := + singleAttachmentOrder P (freshPart P r W) r r + (attachmentShadowGraph P P μ (separationTileBase P r W) W) ∅ + +noncomputable def separationTileMeet (P r μ W : ZFSet.{u}) : ZFSet.{u} := + canonicalMeetGraph (separationTileCarrier P r W) (separationTileOrder P r μ W) + +noncomputable def separationTileMap (P r W : ZFSet.{u}) : ZFSet.{u} := + attachmentTemplateEmbeddingGraph P P r (separationTileBase P r W) W + +theorem separationTileBase_function (P r W : ZFSet.{u}) : + ZFSet.IsFunc (attachmentIdeal P r W) P (separationTileBase P r W) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, rfl⟩ := (mem_attachmentOldEmbeddingGraph _ z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hx, ((mem_attachmentIdeal _ _ _ _).1 hx).1⟩ + · intro x hx + exact ⟨x, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨hx, rfl⟩, + fun y hy => ((pair_mem_attachmentOldEmbeddingGraph _ _ _).1 hy).2⟩ + +theorem separationTileCoding {P r μ : ZFSet.{u}} + (old : MeetOrderCode P r μ) (W : {x : ZFSet.{u} // x ∈ P}) : + CodedPrincipalTile old old (BinaryTiles.separation old.toMeetOrder W) + (separationTileBase P r W.val) := by + refine ⟨separationTileBase_function P r W.val, ?_⟩ + intro point + exact (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 + ⟨(mem_attachmentIdeal _ _ _ _).2 ⟨point.val.property, point.property⟩, rfl⟩ + +theorem pair_mem_separationTileMap (P r W x y : ZFSet.{u}) : + ZFSet.pair x y ∈ separationTileMap P r W ↔ + x ∈ P ∧ ((ZFSet.pair x W ∈ r ∧ y = x) ∨ + (ZFSet.pair x W ∉ r ∧ y = ZFSet.pair P x)) := by + rw [separationTileMap, pair_mem_attachmentTemplateEmbeddingGraph] + rw [separationTileBase, pair_mem_attachmentOldEmbeddingGraph, mem_attachmentIdeal, mem_freshPart] + tauto + +theorem separationTile_meetOrder {P r μ W : ZFSet.{u}} + (old : MeetOrderCode P r μ) (hW : W ∈ P) : + MeetOrderCode (separationTileCarrier P r W) (separationTileOrder P r μ W) + (separationTileMeet P r μ W) := + (separationTileCoding old ⟨W, hW⟩).meetOrder + +theorem separationTile_embeddings {P r μ W : ZFSet.{u}} + (old : MeetOrderCode P r μ) (hW : W ∈ P) : + MeetEmbeddingCode P (separationTileCarrier P r W) r (separationTileOrder P r μ W) + μ (separationTileMeet P r μ W) (attachmentOldEmbeddingGraph P) ∧ + MeetEmbeddingCode P (separationTileCarrier P r W) r (separationTileOrder P r μ W) + μ (separationTileMeet P r μ W) (separationTileMap P r W) := + ⟨(separationTileCoding old ⟨W, hW⟩).old_embedding_code, + (separationTileCoding old ⟨W, hW⟩).template_embedding_code⟩ + +theorem separationTile_exact_overlap {P r W x y : ZFSet.{u}} (hy : y ∈ P) : + ZFSet.pair x y ∈ separationTileMap P r W ↔ x ∈ P ∧ ZFSet.pair x W ∈ r ∧ y = x := by + rw [pair_mem_separationTileMap] + constructor + · rintro ⟨hx, h | h⟩ + · exact ⟨hx, h⟩ + · exact False.elim (pair_tag_not_mem P x (h.2 ▸ hy)) + · exact fun ⟨hx, h⟩ => ⟨hx, Or.inl h⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem separationTile_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r μ W : ZFSet.{u}} (old : MeetOrderCode P r μ) + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hW : W ∈ P) : + separationTileCarrier P r W ∈ M.sets ∧ separationTileOrder P r μ W ∈ M.sets ∧ + separationTileMeet P r μ W ∈ M.sets ∧ attachmentOldEmbeddingGraph P ∈ M.sets ∧ + separationTileMap P r W ∈ M.sets := by + have hBase := M.attachmentOldEmbeddingGraph_mem pairing unions powers separation + (M.attachmentIdeal_mem separation hP hr (M.transitive hP hW)) + exact (separationTileCoding old ⟨W, hW⟩).ground_codes M pairing unions powers separation + hP hP hr hr hμ hBase + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/StructuralPreparationSourceImages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/StructuralPreparationSourceImages.lean index 22e647e70b23f1b2ea270c3dd3d531bdbeb8c2bc..e8b4b02032d05260b1004e4a66409353552b83f3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/StructuralPreparationSourceImages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/StructuralPreparationSourceImages.lean @@ -1,738 +1,738 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingActionGraphs - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) - -theorem rawStageRefinementAssignmentActionGraph_branch_bound - (g P order top action G nodes nodeOrder nodeAction basis T T2 level : ZFSet.{u}) : - M.rawStageRefinementAssignmentActionGraph g P order top action G nodes nodeOrder nodeAction basis T T2 level ⊆ - ZFSet.prod - (stageOneAssignments (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) - (stageOneAssignments (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) := by - intro z member - unfold rawStageRefinementAssignmentActionGraph rawRefinementAssignmentActionGraph relationProduct at member - exact (ZFSet.mem_sep.1 member).1 - -variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) - -theorem mem_structuralAssignments (stages history x : ZFSet.{u}) : - x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 stages history ↔ - ∃ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - x ∈ stageOneAssignments - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T := by - rw [structuralAssignments, mem_stageOneAssignments] - constructor - · rintro ⟨i, hi, u, hu, w, hw, rfl⟩ - obtain ⟨level, hl, data, entry, member⟩ := (mem_refinementDataHistoryIndices _ _ _).1 hi - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - exact ⟨level, hl, P, order, top, action, stored, - (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨member, hu, hw⟩⟩ - · rintro ⟨level, hl, P, order, top, action, stored, member⟩ - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 member - refine ⟨i, ?_, u, hu, w, hw, rfl⟩ - exact (mem_refinementDataHistoryIndices _ _ _).2 - ⟨level, hl, M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level, - (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨hl, P, order, top, action, stored, rfl⟩, hi⟩ - -theorem structuralAssignment_branch_unique {stages history level other P order top action - P' order' top' action' x : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) - (stored' : ZFSet.pair other (forcingStageCode P' order' top' action') ∈ history) - (member : x ∈ stageOneAssignments - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) - (member' : x ∈ stageOneAssignments - (M.rawRefinementFormulaData P' order' top' action' G nodes nodeOrder basis T T2 other 0) T) : - level = other ∧ P = P' ∧ order = order' ∧ top = top' ∧ action = action' := by - obtain ⟨i, hi, u, _hu, w, _hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 member - have hi' := ((stageOneAssignment_mem_assignments _ _ _ _ _).1 member').1 - obtain ⟨v, eqv, hv⟩ := M.rawRefinementFormulaData_level P order top action G nodes nodeOrder basis T T2 level i hi - obtain ⟨v', eqv', hv'⟩ := M.rawRefinementFormulaData_level P' order' top' action' G nodes nodeOrder basis T T2 other i hi' - have fields := nonemptyTupleCode_injective 5 (eqv.symm.trans eqv') - have equal : level = other := hv.symm.trans ((congrFun fields 0).trans hv') - rw [← equal] at stored' - exact ⟨equal, (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 (function.unique stored stored')⟩ - -theorem structuralAssignmentActionGraph_branch_entry - (nodeAction : ZFSet.{u}) {stages history level P order top action x : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) - (member : x ∈ stageOneAssignments - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) - (g y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ↔ - g ∈ G ∧ ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action - G nodes nodeOrder nodeAction basis T T2 level := by - rw [M.pair_mem_structuralAssignmentActionGraph] - constructor - · rintro ⟨hg, other, _ho, P', order', top', action', stored', edge⟩ - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound g P' order' top' action' - G nodes nodeOrder nodeAction basis T T2 other edge) - obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := - M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 function stored stored' member bounds.1 - exact ⟨hg, edge⟩ - · rintro ⟨hg, edge⟩ - exact ⟨hg, level, function.pair_source stored, P, order, top, action, stored, edge⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) -local notation "J" => M.structuralAssignments G nodes nodeOrder basis T T2 stages history -local notation "graph" => M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history - -noncomputable def structuralAssignmentImage (g A : ZFSet.{u}) : ZFSet.{u} := - relationImage A J (rawActionSection g graph J) - -theorem structuralAssignmentImage_subset (g A : ZFSet.{u}) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ⊆ J := - fun y hy => ((mem_relationImage A J (rawActionSection g graph J) y).1 hy).1 - -theorem structuralAssignmentImage_mono (g : ZFSet.{u}) {A B : ZFSet.{u}} (subset : A ⊆ B) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ⊆ - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g B := by - intro y hy - obtain ⟨hy, x, hx, edge⟩ := (mem_relationImage A J (rawActionSection g graph J) y).1 hy - exact (mem_relationImage B J (rawActionSection g graph J) y).2 ⟨hy, x, subset hx, edge⟩ - -variable {H : Type u} [Group H] (t : Presentation H) -variable (laws : RelationActionLaws H - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) - (fun g => rawActionSection (t.encode g) - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history))) - -include laws in -theorem structuralAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode 1) A = A := - laws.image_one subset - -include laws in -theorem structuralAssignmentImage_mul (g h : H) {A : ZFSet.{u}} (subset : A ⊆ J) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode (g * h)) A = - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) - (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode h) A) := - laws.image_mul g h subset - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) - -theorem structuralAssignmentLevels_entry (stages history x level : ZFSet.{u}) : - ZFSet.pair x level ∈ refinementDataHistoryLevels stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T ↔ - level ∈ stages ∧ ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - x ∈ stageOneAssignments - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T := by - rw [pair_mem_refinementDataHistoryLevels] - constructor - · rintro ⟨i, hi, u, hu, w, hw, rfl, hl, fields, eqFields, levelEq⟩ - obtain ⟨other, _ho, data, entry, member⟩ := (mem_refinementDataHistoryIndices _ _ _).1 hi - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - obtain ⟨v, eqv, hv⟩ := - M.rawRefinementFormulaData_level P order top action G nodes nodeOrder basis T T2 other i member - have tupleEq := nonemptyTupleCode_injective 5 (eqFields.symm.trans eqv) - have same : level = other := levelEq.trans ((congrFun tupleEq 0).trans hv) - cases same - exact ⟨hl, P, order, top, action, stored, - (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨member, hu, hw⟩⟩ - · rintro ⟨hl, P, order, top, action, stored, member⟩ - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 member - obtain ⟨v, eqv, hv⟩ := - M.rawRefinementFormulaData_level P order top action G nodes nodeOrder basis T T2 level i hi - refine ⟨i, ?_, u, hu, w, hw, rfl, hl, v, eqv, hv.symm⟩ - exact (mem_refinementDataHistoryIndices _ _ _).2 - ⟨level, hl, M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level, - (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨hl, P, order, top, action, stored, rfl⟩, hi⟩ - -theorem structuralAssignments_cut_eq {stages earlier : ZFSet.{u}} - (subset : earlier ⊆ stages) (history A : ZFSet.{u}) : - assignmentCut (refinementDataHistoryLevels stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier A = - ZFSet.sep (fun x => x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) A := by - apply ZFSet.ext - intro x - rw [mem_assignmentCut, ZFSet.mem_sep, M.mem_structuralAssignments] - constructor - · rintro ⟨member, level, hl, edge⟩ - obtain ⟨_, P, order, top, action, stored, branch⟩ := - (M.structuralAssignmentLevels_entry G nodes nodeOrder basis T T2 stages history x level).1 edge - exact ⟨member, level, hl, P, order, top, action, stored, branch⟩ - · rintro ⟨member, level, hl, P, order, top, action, stored, branch⟩ - exact ⟨member, level, hl, - (M.structuralAssignmentLevels_entry G nodes nodeOrder basis T T2 stages history x level).2 - ⟨subset hl, P, order, top, action, stored, branch⟩⟩ - -theorem structuralAssignments_mono {stages earlier : ZFSet.{u}} - (subset : earlier ⊆ stages) (history : ZFSet.{u}) : - M.structuralAssignments G nodes nodeOrder basis T T2 earlier history ⊆ - M.structuralAssignments G nodes nodeOrder basis T T2 stages history := by - intro x member - obtain ⟨level, hl, rest⟩ := (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).1 member - exact (M.mem_structuralAssignments G nodes nodeOrder basis T T2 stages history x).2 ⟨level, subset hl, rest⟩ - -theorem structuralAssignments_history_restrict (stages history : ZFSet.{u}) : - M.structuralAssignments G nodes nodeOrder basis T T2 stages (graphRestriction stages history) = - M.structuralAssignments G nodes nodeOrder basis T T2 stages history := by - apply ZFSet.ext - intro x - rw [M.mem_structuralAssignments, M.mem_structuralAssignments] - constructor - · rintro ⟨level, hl, P, order, top, action, stored, member⟩ - exact ⟨level, hl, P, order, top, action, (pair_mem_graphRestriction.1 stored).1, member⟩ - · rintro ⟨level, hl, P, order, top, action, stored, member⟩ - exact ⟨level, hl, P, order, top, action, pair_mem_graphRestriction.2 ⟨stored, hl⟩, member⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable {G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}} -variable (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) -variable (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) -variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) -local notation "J" => M.structuralAssignments G nodes nodeOrder basis T T2 stages history -local notation "graph" => M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history - -include pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh in -theorem structuralAssignmentSection_mem {g : ZFSet.{u}} (hg : g ∈ M.sets) : - rawActionSection g graph J ∈ M.sets := by - have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed - ![G,nodes,nodeOrder,basis,T,T2,stages,history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT - (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hF := M.structuralAssignmentActionGraph_mem pairing unions powers separation collection - hG hn hno hna hb hT hT2 hs hh - exact (M.definable_rawActionSection pairing unions powers separation).closed ![g,graph,J] - (Fin.cases hg (Fin.cases hF (Fin.cases hJ (fun j => Fin.elim0 j)))) - -include pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh in -theorem structuralAssignmentImage_mem {g A : ZFSet.{u}} (hg : g ∈ M.sets) (hA : A ∈ M.sets) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ∈ M.sets := by - have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed - ![G,nodes,nodeOrder,basis,T,T2,stages,history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT - (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - exact M.relationImage_mem separation hA hJ - (M.structuralAssignmentSection_mem pairing unions powers separation collection - hG hn hno hna hb hT hT2 hs hh hg) - -include pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh in -theorem structuralAssignmentImage_small (omega : ZFSet.omega ∈ M.sets) - {g A : ZFSet.{u}} (hg : g ∈ M.sets) - (injection : InjectionCode J J (rawActionSection g graph J)) - (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ∈ - M.groundSmallSubsets J ZFSet.omega := by - obtain ⟨hA, subset, small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member - have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed - ![G,nodes,nodeOrder,basis,T,T2,stages,history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT - (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hF := M.structuralAssignmentSection_mem pairing unions powers separation collection - hG hn hno hna hb hT hT2 hs hh hg - exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 - ⟨M.relationImage_mem separation hA hJ hF, - M.structuralAssignmentImage_subset G nodes nodeOrder nodeAction basis T T2 stages history g A, - M.groundEmbeddable_image pairing unions powers separation hA hJ omega hF injection subset small⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - -theorem structuralAssignmentActionGraph_history_restrict (stages history : ZFSet.{u}) : - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages (graphRestriction stages history) = - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history := by - apply ZFSet.ext - intro z - rw [M.mem_structuralAssignmentActionGraph, M.mem_structuralAssignmentActionGraph] - constructor - · rintro ⟨g, hg, x, y, equal, level, hl, P, order, top, action, stored, edge⟩ - exact ⟨g, hg, x, y, equal, level, hl, P, order, top, action, - (pair_mem_graphRestriction.1 stored).1, edge⟩ - · rintro ⟨g, hg, x, y, equal, level, hl, P, order, top, action, stored, edge⟩ - exact ⟨g, hg, x, y, equal, level, hl, P, order, top, action, - pair_mem_graphRestriction.2 ⟨stored, hl⟩, edge⟩ - -theorem structuralAssignmentActionGraph_prefix_entry {stages earlier history : ZFSet.{u}} - (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g x y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 earlier history ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ∧ - x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history := by - constructor - · intro edge - obtain ⟨hg, level, hl, P, order, top, action, stored, branch⟩ := - (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action - G nodes nodeOrder nodeAction basis T T2 level branch) - exact ⟨(M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).2 - ⟨hg, level, subset hl, P, order, top, action, stored, branch⟩, - (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).2 - ⟨level, hl, P, order, top, action, stored, bounds.1⟩⟩ - · rintro ⟨edge, source⟩ - obtain ⟨hg, level, _hl, P, order, top, action, stored, branch⟩ := - (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge - obtain ⟨other, ho, P', order', top', action', stored', member⟩ := - (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).1 source - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action - G nodes nodeOrder nodeAction basis T T2 level branch) - obtain ⟨same, _⟩ := M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 - function stored stored' bounds.1 member - exact (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).2 - ⟨hg, level, same.symm ▸ ho, P, order, top, action, stored, branch⟩ - -theorem structuralAssignmentActionGraph_domain_restrict {stages earlier history : ZFSet.{u}} - (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) : - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 earlier history = - graphRestriction (ZFSet.prod G (M.structuralAssignments G nodes nodeOrder basis T T2 earlier history)) - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) := by - apply ZFSet.ext - intro z - constructor - · intro edge - obtain ⟨g, hg, x, y, rfl, _⟩ := (M.mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _).1 edge - obtain ⟨whole, source⟩ := - (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).1 edge - exact pair_mem_graphRestriction.2 ⟨whole, ZFSet.pair_mem_prod.2 ⟨hg, source⟩⟩ - · intro member - obtain ⟨source, hs, y, rfl, edge⟩ := mem_graphRestriction.1 member - obtain ⟨g, _hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hs - exact (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 - ⟨edge, hx⟩ - -theorem structuralAssignmentSection_entry (stages history g x y : ZFSet.{u}) : - ZFSet.pair x y ∈ rawActionSection g - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history := by - rw [pair_mem_rawActionSection] - constructor - · exact fun member => member.2.2 - · intro edge - obtain ⟨_hg, level, hl, P, order, top, action, stored, branch⟩ := - (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_bound g G nodes nodeOrder nodeAction basis T T2 - stages history level P order top action hl stored branch) - exact ⟨bounds.1, bounds.2, edge⟩ - -theorem structuralAssignmentSection_domain_restrict {stages earlier history : ZFSet.{u}} - (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g : ZFSet.{u}) : - rawActionSection g - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 earlier history) - (M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) = - graphRestriction (M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) - (rawActionSection g - (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) - (M.structuralAssignments G nodes nodeOrder basis T T2 stages history)) := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨x, _hx, y, _hy, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 member).1) - have edge := (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 earlier history g x y).1 member - obtain ⟨whole, source⟩ := - (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).1 edge - exact pair_mem_graphRestriction.2 - ⟨(M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).2 whole, source⟩ - · intro member - obtain ⟨x, hx, y, rfl, edge⟩ := mem_graphRestriction.1 member - apply (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 earlier history g x y).2 - apply (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 - exact ⟨(M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).1 edge, hx⟩ - -theorem structuralAssignmentActionGraph_earlier_iff {stages history g x y : ZFSet.{u}} - (function : FunctionGraphOn stages history) (earlier : ZFSet.{u}) - (edge : ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) : - x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history ↔ - y ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history := by - obtain ⟨_hg, level, _hl, P, order, top, action, stored, branch⟩ := - (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action - G nodes nodeOrder nodeAction basis T T2 level branch) - constructor - · intro member - obtain ⟨other, ho, P', order', top', action', stored', source⟩ := - (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).1 member - have same := (M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 - function stored stored' bounds.1 source).1 - exact (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history y).2 - ⟨level, same.symm ▸ ho, P, order, top, action, stored, bounds.2⟩ - · intro member - obtain ⟨other, ho, P', order', top', action', stored', target⟩ := - (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history y).1 member - have same := (M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 - function stored stored' bounds.2 target).1 - exact (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).2 - ⟨level, same.symm ▸ ho, P, order, top, action, stored, bounds.1⟩ - - - - - -theorem structuralAssignmentImage_entry (stages history g A y : ZFSet.{u}) : - y ∈ M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ↔ - ∃ x ∈ A, ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history := by - rw [structuralAssignmentImage, mem_relationImage] - constructor - · rintro ⟨_, x, hx, edge⟩ - exact ⟨x, hx, (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).1 edge⟩ - · rintro ⟨x, hx, edge⟩ - have sectionEdge := (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).2 edge - exact ⟨((pair_mem_rawActionSection _ _ _ _ _).1 sectionEdge).2.1, x, hx, sectionEdge⟩ - -theorem structuralAssignmentImage_history_restrict (stages history g A : ZFSet.{u}) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages (graphRestriction stages history) g A = - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A := by - unfold structuralAssignmentImage - rw [M.structuralAssignments_history_restrict, M.structuralAssignmentActionGraph_history_restrict] - -theorem structuralAssignmentImage_branch {stages history level P order top action g A : ZFSet.{u}} - (function : FunctionGraphOn stages history) (actor : g ∈ G) - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) - (subset : A ⊆ stageOneAssignments - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A = - relationImage A - (stageOneAssignments (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) - (M.rawStageRefinementAssignmentActionGraph g P order top action G nodes nodeOrder nodeAction basis T T2 level) := by - apply ZFSet.ext - intro y - rw [M.structuralAssignmentImage_entry, mem_relationImage] - constructor - · rintro ⟨x, hx, edge⟩ - have branch := (M.structuralAssignmentActionGraph_branch_entry G nodes nodeOrder basis T T2 - nodeAction function stored (subset hx) g y).1 edge |>.2 - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action - G nodes nodeOrder nodeAction basis T T2 level branch) - exact ⟨bounds.2, x, hx, branch⟩ - · rintro ⟨_, x, hx, branch⟩ - exact ⟨x, hx, (M.structuralAssignmentActionGraph_branch_entry G nodes nodeOrder basis T T2 - nodeAction function stored (subset hx) g y).2 ⟨actor, branch⟩⟩ - -theorem structuralAssignmentImage_domain_restrict {stages earlier history : ZFSet.{u}} - (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g A : ZFSet.{u}) : - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 earlier history g A = - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g - (ZFSet.sep (fun x => x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) A) := by - apply ZFSet.ext - intro y - rw [M.structuralAssignmentImage_entry, M.structuralAssignmentImage_entry] - constructor - · rintro ⟨x, hx, edge⟩ - obtain ⟨whole, source⟩ := - (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).1 edge - exact ⟨x, ZFSet.mem_sep.2 ⟨hx, source⟩, whole⟩ - · rintro ⟨x, hx, edge⟩ - obtain ⟨member, source⟩ := ZFSet.mem_sep.1 hx - exact ⟨x, member, - (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 - ⟨edge, source⟩⟩ - -theorem structuralAssignmentImage_cut {stages earlier history : ZFSet.{u}} - (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g A : ZFSet.{u}) : - assignmentCut (refinementDataHistoryLevels stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier - (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A) = - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 earlier history g - (assignmentCut (refinementDataHistoryLevels stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier A) := by - rw [M.structuralAssignments_cut_eq G nodes nodeOrder basis T T2 subset, - M.structuralAssignments_cut_eq G nodes nodeOrder basis T T2 subset] - apply ZFSet.ext - intro y - rw [ZFSet.mem_sep, M.structuralAssignmentImage_entry, M.structuralAssignmentImage_entry] - constructor - · rintro ⟨⟨x, hx, edge⟩, target⟩ - have source := (M.structuralAssignmentActionGraph_earlier_iff G nodes nodeOrder nodeAction basis T T2 - function earlier edge).2 target - exact ⟨x, ZFSet.mem_sep.2 ⟨hx, source⟩, - (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 - ⟨edge, source⟩⟩ - · rintro ⟨x, hx, edge⟩ - obtain ⟨member, source⟩ := ZFSet.mem_sep.1 hx - have whole := (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 - function subset g x y).1 edge |>.1 - exact ⟨⟨x, member, whole⟩, - (M.structuralAssignmentActionGraph_earlier_iff G nodes nodeOrder nodeAction basis T T2 - function earlier whole).1 source⟩ - -theorem structuralAssignmentImage_prefix_cut {stages earlier history : ZFSet.{u}} - (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g A : ZFSet.{u}) : - assignmentCut (refinementDataHistoryLevels stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier - (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A) = - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 earlier (graphRestriction earlier history) g - (assignmentCut (refinementDataHistoryLevels stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier A) := by - rw [M.structuralAssignmentImage_history_restrict] - exact M.structuralAssignmentImage_cut G nodes nodeOrder nodeAction basis T T2 function subset g A - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) -variable {stages history level P order top action : ZFSet.{u}} -variable (function : FunctionGraphOn stages history) -variable (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) -include function stored - -theorem structuralAssignmentActionGraph_branch_iff {g x y : ZFSet.{u}} - (edge : ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) : - x ∈ stageOneAssignments - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T ↔ - y ∈ stageOneAssignments - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T := by - constructor - · intro member - have branch := (M.structuralAssignmentActionGraph_branch_entry G nodes nodeOrder basis T T2 - nodeAction function stored member g y).1 edge |>.2 - exact (ZFSet.pair_mem_prod.1 (M.rawStageRefinementAssignmentActionGraph_branch_bound - g P order top action G nodes nodeOrder nodeAction basis T T2 level branch)).2 - · intro member - obtain ⟨_, other, _, P', order', top', action', stored', branch⟩ := - (M.pair_mem_structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 - stages history g x y).1 edge - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound g P' order' top' action' - G nodes nodeOrder nodeAction basis T T2 other branch) - obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := M.structuralAssignment_branch_unique - G nodes nodeOrder basis T T2 function stored stored' member bounds.2 - exact bounds.1 - -theorem structuralAssignmentImage_select_branch (g A : ZFSet.{u}) : - let I := M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0 - assignmentOnIndices I T - (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A) = - M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g - (assignmentOnIndices I T A) := by - dsimp only - apply ZFSet.ext - intro y - rw [mem_assignmentOnIndices, M.structuralAssignmentImage_entry, M.structuralAssignmentImage_entry] - constructor - · rintro ⟨⟨x, hx, edge⟩, hy⟩ - exact ⟨x, (mem_assignmentOnIndices _ _ _ _).2 ⟨hx, - (M.structuralAssignmentActionGraph_branch_iff G nodes nodeOrder nodeAction basis T T2 - function stored edge).2 hy⟩, edge⟩ - · rintro ⟨x, hx, edge⟩ - obtain ⟨member, branch⟩ := (mem_assignmentOnIndices _ _ _ _).1 hx - exact ⟨⟨x, member, edge⟩, - (M.structuralAssignmentActionGraph_branch_iff G nodes nodeOrder nodeAction basis T T2 - function stored edge).1 branch⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) -variable {stages history level P order top action g : ZFSet.{u}} -variable (function : FunctionGraphOn stages history) (actor : g ∈ G) -variable (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) -local notation "d" => M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level -local notation "J" => stageOneAssignments (d 0) T -local notation "branch" => M.rawStageRefinementAssignmentActionGraph g P order top action - G nodes nodeOrder nodeAction basis T T2 level -local notation "image" => M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g - -include function actor stored in -theorem structuralAssignmentImage_target_branch_iff {A y : ZFSet.{u}} (target : y ∈ J) : - y ∈ image A ↔ y ∈ relationImage A J branch := by - rw [M.structuralAssignmentImage_entry, mem_relationImage] - constructor - · rintro ⟨x, hx, edge⟩ - obtain ⟨_hg, other, _ho, P', order', top', action', stored', entry⟩ := - (M.pair_mem_structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 - stages history g x y).1 edge - have bounds := ZFSet.pair_mem_prod.1 - (M.rawStageRefinementAssignmentActionGraph_branch_bound g P' order' top' action' - G nodes nodeOrder nodeAction basis T T2 other entry) - obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := - M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 - function stored stored' target bounds.2 - exact ⟨target, x, hx, entry⟩ - · rintro ⟨_, x, hx, entry⟩ - exact ⟨x, hx, (M.pair_mem_structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 - stages history g x y).2 - ⟨actor, level, function.pair_source stored, P, order, top, action, stored, entry⟩⟩ - -include function actor stored in -theorem structuralAssignmentImage_rawTests_branch_iff (A lower : ZFSet.{u}) : - stageOneRawTests M d (image A) lower ↔ - stageOneRawTests M d (relationImage A J branch) lower := by - apply stageOneRawTests_congr - intro i hi u hu w hw - change u ∈ T at hu - change w ∈ T at hw - exact M.structuralAssignmentImage_target_branch_iff G nodes nodeOrder nodeAction basis T T2 - function actor stored ((stageOneAssignment_mem_assignments (d 0) T i u w).2 ⟨hi, hu, hw⟩) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (level T T2 : ZFSet.{u}) -variable (system : RefinementStageSystem M a s t b d base directed level T T2) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) -include system pairing unions powers separation collection carrier order group nodes supports hLevel hT - -theorem structuralAssignmentImage_decode - {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) - (a.actionGraph s t)) ∈ history) - (h : G) (A sharedIdx rawU rawW : ZFSet.{u}) - (index : sharedIdx ∈ M.niceRefinementIndices a s b d level T T2 system.valid1) - (hu : rawU ∈ T) (hw : rawW ∈ T) - (member : stageOneAssignment sharedIdx rawU rawW ∈ - M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) A) : - ∃ (C E : L) (U Rf Rc u w : (M.nameDomain s).names), - refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d level T T2 system.valid1 ∧ - u.val.val ∈ T ∧ w.val.val ∈ T ∧ - stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val w.val.val ∈ A ∧ - sharedIdx = refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) - (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val ∧ - rawU = (a.act s h u.val).val ∧ rawW = (a.act s h w.val).val ∧ - ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment - (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val w.val.val)) (stageOneAssignment sharedIdx rawU rawW) ∈ - M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 stages history := by - obtain ⟨x, source, edge⟩ := (M.structuralAssignmentImage_entry t.carrier b.carrier b.conditionOrder - (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 stages history - (t.encode h) A _).1 member - have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection - carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2 - have target : stageOneAssignment sharedIdx rawU rawW ∈ stageOneAssignments - (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) - t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by - rw [dataEq] - exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨index, hu, hw⟩ - have branchMember := (M.structuralAssignmentActionGraph_branch_iff t.carrier b.carrier - b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 - function stored edge).2 target - have original := branchMember - rw [dataEq] at original - obtain ⟨idx, hi, originalU, hOriginalU, originalW, hOriginalW, rfl⟩ := - (mem_stageOneAssignments _ _ x).1 original - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := - M.exists_niceRefinementIndex_fields a s b d level T T2 system.valid1 system.valid2 hi - let u : (M.nameDomain s).names := - ⟨⟨originalU, system.valid1 originalU hOriginalU⟩, M.transitive hT hOriginalU⟩ - let w : (M.nameDomain s).names := - ⟨⟨originalW, system.valid1 originalW hOriginalW⟩, M.transitive hT hOriginalW⟩ - have branch := ((M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored - branchMember (t.encode h) (stageOneAssignment sharedIdx rawU rawW)).1 edge).2 - rw [M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation collection - carrier group nodes order system.inputs.condition_maps system.inputs.node_maps supports level T T2 - hLevel hT system.valid1 system.valid2 system.inputs.terms_closed system.inputs.pairs_closed - system.inputs.family_ground system.indices.index_ground h] at branch - have moved := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 - system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier - order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground - h C E U Rf Rc u.val w.val hi hOriginalU hOriginalW _).1 branch - obtain ⟨sameIndex, sameU, sameW⟩ := (stageOneAssignment_eq_iff _ _ _ _ _ _).1 moved - exact ⟨C, E, U, Rf, Rc, u, w, hi, hOriginalU, hOriginalW, source, - sameIndex, sameU, sameW, edge⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - -theorem structuralAssignmentImage_selected_edge - {stages history level P order top action g sourceA x y : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) - (member : x ∈ assignmentOnIndices - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T sourceA) - (edge : ZFSet.pair (ZFSet.pair g x) y ∈ - M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) : - y ∈ assignmentOnIndices - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T - (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g sourceA) := by - obtain ⟨source, branch⟩ := (mem_assignmentOnIndices _ _ _ _).1 member - exact (mem_assignmentOnIndices _ _ _ _).2 - ⟨(M.structuralAssignmentImage_entry G nodes nodeOrder nodeAction basis T T2 - stages history g sourceA y).2 ⟨x, source, edge⟩, - (M.structuralAssignmentActionGraph_branch_iff G nodes nodeOrder nodeAction basis T T2 - function stored edge).1 branch⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingActionGraphs + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) + +theorem rawStageRefinementAssignmentActionGraph_branch_bound + (g P order top action G nodes nodeOrder nodeAction basis T T2 level : ZFSet.{u}) : + M.rawStageRefinementAssignmentActionGraph g P order top action G nodes nodeOrder nodeAction basis T T2 level ⊆ + ZFSet.prod + (stageOneAssignments (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) + (stageOneAssignments (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) := by + intro z member + unfold rawStageRefinementAssignmentActionGraph rawRefinementAssignmentActionGraph relationProduct at member + exact (ZFSet.mem_sep.1 member).1 + +variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) + +theorem mem_structuralAssignments (stages history x : ZFSet.{u}) : + x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 stages history ↔ + ∃ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + x ∈ stageOneAssignments + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T := by + rw [structuralAssignments, mem_stageOneAssignments] + constructor + · rintro ⟨i, hi, u, hu, w, hw, rfl⟩ + obtain ⟨level, hl, data, entry, member⟩ := (mem_refinementDataHistoryIndices _ _ _).1 hi + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + exact ⟨level, hl, P, order, top, action, stored, + (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨member, hu, hw⟩⟩ + · rintro ⟨level, hl, P, order, top, action, stored, member⟩ + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 member + refine ⟨i, ?_, u, hu, w, hw, rfl⟩ + exact (mem_refinementDataHistoryIndices _ _ _).2 + ⟨level, hl, M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level, + (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨hl, P, order, top, action, stored, rfl⟩, hi⟩ + +theorem structuralAssignment_branch_unique {stages history level other P order top action + P' order' top' action' x : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) + (stored' : ZFSet.pair other (forcingStageCode P' order' top' action') ∈ history) + (member : x ∈ stageOneAssignments + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) + (member' : x ∈ stageOneAssignments + (M.rawRefinementFormulaData P' order' top' action' G nodes nodeOrder basis T T2 other 0) T) : + level = other ∧ P = P' ∧ order = order' ∧ top = top' ∧ action = action' := by + obtain ⟨i, hi, u, _hu, w, _hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 member + have hi' := ((stageOneAssignment_mem_assignments _ _ _ _ _).1 member').1 + obtain ⟨v, eqv, hv⟩ := M.rawRefinementFormulaData_level P order top action G nodes nodeOrder basis T T2 level i hi + obtain ⟨v', eqv', hv'⟩ := M.rawRefinementFormulaData_level P' order' top' action' G nodes nodeOrder basis T T2 other i hi' + have fields := nonemptyTupleCode_injective 5 (eqv.symm.trans eqv') + have equal : level = other := hv.symm.trans ((congrFun fields 0).trans hv') + rw [← equal] at stored' + exact ⟨equal, (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 (function.unique stored stored')⟩ + +theorem structuralAssignmentActionGraph_branch_entry + (nodeAction : ZFSet.{u}) {stages history level P order top action x : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) + (member : x ∈ stageOneAssignments + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) + (g y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ↔ + g ∈ G ∧ ZFSet.pair x y ∈ M.rawStageRefinementAssignmentActionGraph g P order top action + G nodes nodeOrder nodeAction basis T T2 level := by + rw [M.pair_mem_structuralAssignmentActionGraph] + constructor + · rintro ⟨hg, other, _ho, P', order', top', action', stored', edge⟩ + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound g P' order' top' action' + G nodes nodeOrder nodeAction basis T T2 other edge) + obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := + M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 function stored stored' member bounds.1 + exact ⟨hg, edge⟩ + · rintro ⟨hg, edge⟩ + exact ⟨hg, level, function.pair_source stored, P, order, top, action, stored, edge⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}) +local notation "J" => M.structuralAssignments G nodes nodeOrder basis T T2 stages history +local notation "graph" => M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history + +noncomputable def structuralAssignmentImage (g A : ZFSet.{u}) : ZFSet.{u} := + relationImage A J (rawActionSection g graph J) + +theorem structuralAssignmentImage_subset (g A : ZFSet.{u}) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ⊆ J := + fun y hy => ((mem_relationImage A J (rawActionSection g graph J) y).1 hy).1 + +theorem structuralAssignmentImage_mono (g : ZFSet.{u}) {A B : ZFSet.{u}} (subset : A ⊆ B) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ⊆ + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g B := by + intro y hy + obtain ⟨hy, x, hx, edge⟩ := (mem_relationImage A J (rawActionSection g graph J) y).1 hy + exact (mem_relationImage B J (rawActionSection g graph J) y).2 ⟨hy, x, subset hx, edge⟩ + +variable {H : Type u} [Group H] (t : Presentation H) +variable (laws : RelationActionLaws H + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) + (fun g => rawActionSection (t.encode g) + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history))) + +include laws in +theorem structuralAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode 1) A = A := + laws.image_one subset + +include laws in +theorem structuralAssignmentImage_mul (g h : H) {A : ZFSet.{u}} (subset : A ⊆ J) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode (g * h)) A = + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode g) + (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history (t.encode h) A) := + laws.image_mul g h subset + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) + +theorem structuralAssignmentLevels_entry (stages history x level : ZFSet.{u}) : + ZFSet.pair x level ∈ refinementDataHistoryLevels stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T ↔ + level ∈ stages ∧ ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + x ∈ stageOneAssignments + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T := by + rw [pair_mem_refinementDataHistoryLevels] + constructor + · rintro ⟨i, hi, u, hu, w, hw, rfl, hl, fields, eqFields, levelEq⟩ + obtain ⟨other, _ho, data, entry, member⟩ := (mem_refinementDataHistoryIndices _ _ _).1 hi + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + obtain ⟨v, eqv, hv⟩ := + M.rawRefinementFormulaData_level P order top action G nodes nodeOrder basis T T2 other i member + have tupleEq := nonemptyTupleCode_injective 5 (eqFields.symm.trans eqv) + have same : level = other := levelEq.trans ((congrFun tupleEq 0).trans hv) + cases same + exact ⟨hl, P, order, top, action, stored, + (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨member, hu, hw⟩⟩ + · rintro ⟨hl, P, order, top, action, stored, member⟩ + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ _).1 member + obtain ⟨v, eqv, hv⟩ := + M.rawRefinementFormulaData_level P order top action G nodes nodeOrder basis T T2 level i hi + refine ⟨i, ?_, u, hu, w, hw, rfl, hl, v, eqv, hv.symm⟩ + exact (mem_refinementDataHistoryIndices _ _ _).2 + ⟨level, hl, M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level, + (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨hl, P, order, top, action, stored, rfl⟩, hi⟩ + +theorem structuralAssignments_cut_eq {stages earlier : ZFSet.{u}} + (subset : earlier ⊆ stages) (history A : ZFSet.{u}) : + assignmentCut (refinementDataHistoryLevels stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier A = + ZFSet.sep (fun x => x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) A := by + apply ZFSet.ext + intro x + rw [mem_assignmentCut, ZFSet.mem_sep, M.mem_structuralAssignments] + constructor + · rintro ⟨member, level, hl, edge⟩ + obtain ⟨_, P, order, top, action, stored, branch⟩ := + (M.structuralAssignmentLevels_entry G nodes nodeOrder basis T T2 stages history x level).1 edge + exact ⟨member, level, hl, P, order, top, action, stored, branch⟩ + · rintro ⟨member, level, hl, P, order, top, action, stored, branch⟩ + exact ⟨member, level, hl, + (M.structuralAssignmentLevels_entry G nodes nodeOrder basis T T2 stages history x level).2 + ⟨subset hl, P, order, top, action, stored, branch⟩⟩ + +theorem structuralAssignments_mono {stages earlier : ZFSet.{u}} + (subset : earlier ⊆ stages) (history : ZFSet.{u}) : + M.structuralAssignments G nodes nodeOrder basis T T2 earlier history ⊆ + M.structuralAssignments G nodes nodeOrder basis T T2 stages history := by + intro x member + obtain ⟨level, hl, rest⟩ := (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).1 member + exact (M.mem_structuralAssignments G nodes nodeOrder basis T T2 stages history x).2 ⟨level, subset hl, rest⟩ + +theorem structuralAssignments_history_restrict (stages history : ZFSet.{u}) : + M.structuralAssignments G nodes nodeOrder basis T T2 stages (graphRestriction stages history) = + M.structuralAssignments G nodes nodeOrder basis T T2 stages history := by + apply ZFSet.ext + intro x + rw [M.mem_structuralAssignments, M.mem_structuralAssignments] + constructor + · rintro ⟨level, hl, P, order, top, action, stored, member⟩ + exact ⟨level, hl, P, order, top, action, (pair_mem_graphRestriction.1 stored).1, member⟩ + · rintro ⟨level, hl, P, order, top, action, stored, member⟩ + exact ⟨level, hl, P, order, top, action, pair_mem_graphRestriction.2 ⟨stored, hl⟩, member⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable {G nodes nodeOrder nodeAction basis T T2 stages history : ZFSet.{u}} +variable (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) +variable (hna : nodeAction ∈ M.sets) (hb : basis ∈ M.sets) +variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) +local notation "J" => M.structuralAssignments G nodes nodeOrder basis T T2 stages history +local notation "graph" => M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history + +include pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh in +theorem structuralAssignmentSection_mem {g : ZFSet.{u}} (hg : g ∈ M.sets) : + rawActionSection g graph J ∈ M.sets := by + have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed + ![G,nodes,nodeOrder,basis,T,T2,stages,history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT + (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hF := M.structuralAssignmentActionGraph_mem pairing unions powers separation collection + hG hn hno hna hb hT hT2 hs hh + exact (M.definable_rawActionSection pairing unions powers separation).closed ![g,graph,J] + (Fin.cases hg (Fin.cases hF (Fin.cases hJ (fun j => Fin.elim0 j)))) + +include pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh in +theorem structuralAssignmentImage_mem {g A : ZFSet.{u}} (hg : g ∈ M.sets) (hA : A ∈ M.sets) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ∈ M.sets := by + have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed + ![G,nodes,nodeOrder,basis,T,T2,stages,history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT + (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + exact M.relationImage_mem separation hA hJ + (M.structuralAssignmentSection_mem pairing unions powers separation collection + hG hn hno hna hb hT hT2 hs hh hg) + +include pairing unions powers separation collection hG hn hno hna hb hT hT2 hs hh in +theorem structuralAssignmentImage_small (omega : ZFSet.omega ∈ M.sets) + {g A : ZFSet.{u}} (hg : g ∈ M.sets) + (injection : InjectionCode J J (rawActionSection g graph J)) + (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ∈ + M.groundSmallSubsets J ZFSet.omega := by + obtain ⟨hA, subset, small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member + have hJ := (M.definable_structuralAssignments pairing unions powers separation collection).closed + ![G,nodes,nodeOrder,basis,T,T2,stages,history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT + (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hF := M.structuralAssignmentSection_mem pairing unions powers separation collection + hG hn hno hna hb hT hT2 hs hh hg + exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 + ⟨M.relationImage_mem separation hA hJ hF, + M.structuralAssignmentImage_subset G nodes nodeOrder nodeAction basis T T2 stages history g A, + M.groundEmbeddable_image pairing unions powers separation hA hJ omega hF injection subset small⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + +theorem structuralAssignmentActionGraph_history_restrict (stages history : ZFSet.{u}) : + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages (graphRestriction stages history) = + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history := by + apply ZFSet.ext + intro z + rw [M.mem_structuralAssignmentActionGraph, M.mem_structuralAssignmentActionGraph] + constructor + · rintro ⟨g, hg, x, y, equal, level, hl, P, order, top, action, stored, edge⟩ + exact ⟨g, hg, x, y, equal, level, hl, P, order, top, action, + (pair_mem_graphRestriction.1 stored).1, edge⟩ + · rintro ⟨g, hg, x, y, equal, level, hl, P, order, top, action, stored, edge⟩ + exact ⟨g, hg, x, y, equal, level, hl, P, order, top, action, + pair_mem_graphRestriction.2 ⟨stored, hl⟩, edge⟩ + +theorem structuralAssignmentActionGraph_prefix_entry {stages earlier history : ZFSet.{u}} + (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g x y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 earlier history ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history ∧ + x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history := by + constructor + · intro edge + obtain ⟨hg, level, hl, P, order, top, action, stored, branch⟩ := + (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action + G nodes nodeOrder nodeAction basis T T2 level branch) + exact ⟨(M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).2 + ⟨hg, level, subset hl, P, order, top, action, stored, branch⟩, + (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).2 + ⟨level, hl, P, order, top, action, stored, bounds.1⟩⟩ + · rintro ⟨edge, source⟩ + obtain ⟨hg, level, _hl, P, order, top, action, stored, branch⟩ := + (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge + obtain ⟨other, ho, P', order', top', action', stored', member⟩ := + (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).1 source + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action + G nodes nodeOrder nodeAction basis T T2 level branch) + obtain ⟨same, _⟩ := M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 + function stored stored' bounds.1 member + exact (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).2 + ⟨hg, level, same.symm ▸ ho, P, order, top, action, stored, branch⟩ + +theorem structuralAssignmentActionGraph_domain_restrict {stages earlier history : ZFSet.{u}} + (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) : + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 earlier history = + graphRestriction (ZFSet.prod G (M.structuralAssignments G nodes nodeOrder basis T T2 earlier history)) + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) := by + apply ZFSet.ext + intro z + constructor + · intro edge + obtain ⟨g, hg, x, y, rfl, _⟩ := (M.mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _).1 edge + obtain ⟨whole, source⟩ := + (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).1 edge + exact pair_mem_graphRestriction.2 ⟨whole, ZFSet.pair_mem_prod.2 ⟨hg, source⟩⟩ + · intro member + obtain ⟨source, hs, y, rfl, edge⟩ := mem_graphRestriction.1 member + obtain ⟨g, _hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hs + exact (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 + ⟨edge, hx⟩ + +theorem structuralAssignmentSection_entry (stages history g x y : ZFSet.{u}) : + ZFSet.pair x y ∈ rawActionSection g + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history) ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history := by + rw [pair_mem_rawActionSection] + constructor + · exact fun member => member.2.2 + · intro edge + obtain ⟨_hg, level, hl, P, order, top, action, stored, branch⟩ := + (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_bound g G nodes nodeOrder nodeAction basis T T2 + stages history level P order top action hl stored branch) + exact ⟨bounds.1, bounds.2, edge⟩ + +theorem structuralAssignmentSection_domain_restrict {stages earlier history : ZFSet.{u}} + (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g : ZFSet.{u}) : + rawActionSection g + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 earlier history) + (M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) = + graphRestriction (M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) + (rawActionSection g + (M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) + (M.structuralAssignments G nodes nodeOrder basis T T2 stages history)) := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨x, _hx, y, _hy, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 member).1) + have edge := (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 earlier history g x y).1 member + obtain ⟨whole, source⟩ := + (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).1 edge + exact pair_mem_graphRestriction.2 + ⟨(M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).2 whole, source⟩ + · intro member + obtain ⟨x, hx, y, rfl, edge⟩ := mem_graphRestriction.1 member + apply (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 earlier history g x y).2 + apply (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 + exact ⟨(M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).1 edge, hx⟩ + +theorem structuralAssignmentActionGraph_earlier_iff {stages history g x y : ZFSet.{u}} + (function : FunctionGraphOn stages history) (earlier : ZFSet.{u}) + (edge : ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) : + x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history ↔ + y ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history := by + obtain ⟨_hg, level, _hl, P, order, top, action, stored, branch⟩ := + (M.pair_mem_structuralAssignmentActionGraph _ _ _ _ _ _ _ _ _ _ _ _).1 edge + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action + G nodes nodeOrder nodeAction basis T T2 level branch) + constructor + · intro member + obtain ⟨other, ho, P', order', top', action', stored', source⟩ := + (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).1 member + have same := (M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 + function stored stored' bounds.1 source).1 + exact (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history y).2 + ⟨level, same.symm ▸ ho, P, order, top, action, stored, bounds.2⟩ + · intro member + obtain ⟨other, ho, P', order', top', action', stored', target⟩ := + (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history y).1 member + have same := (M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 + function stored stored' bounds.2 target).1 + exact (M.mem_structuralAssignments G nodes nodeOrder basis T T2 earlier history x).2 + ⟨level, same.symm ▸ ho, P, order, top, action, stored, bounds.1⟩ + + + + + +theorem structuralAssignmentImage_entry (stages history g A y : ZFSet.{u}) : + y ∈ M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A ↔ + ∃ x ∈ A, ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history := by + rw [structuralAssignmentImage, mem_relationImage] + constructor + · rintro ⟨_, x, hx, edge⟩ + exact ⟨x, hx, (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).1 edge⟩ + · rintro ⟨x, hx, edge⟩ + have sectionEdge := (M.structuralAssignmentSection_entry G nodes nodeOrder nodeAction basis T T2 stages history g x y).2 edge + exact ⟨((pair_mem_rawActionSection _ _ _ _ _).1 sectionEdge).2.1, x, hx, sectionEdge⟩ + +theorem structuralAssignmentImage_history_restrict (stages history g A : ZFSet.{u}) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages (graphRestriction stages history) g A = + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A := by + unfold structuralAssignmentImage + rw [M.structuralAssignments_history_restrict, M.structuralAssignmentActionGraph_history_restrict] + +theorem structuralAssignmentImage_branch {stages history level P order top action g A : ZFSet.{u}} + (function : FunctionGraphOn stages history) (actor : g ∈ G) + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) + (subset : A ⊆ stageOneAssignments + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A = + relationImage A + (stageOneAssignments (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T) + (M.rawStageRefinementAssignmentActionGraph g P order top action G nodes nodeOrder nodeAction basis T T2 level) := by + apply ZFSet.ext + intro y + rw [M.structuralAssignmentImage_entry, mem_relationImage] + constructor + · rintro ⟨x, hx, edge⟩ + have branch := (M.structuralAssignmentActionGraph_branch_entry G nodes nodeOrder basis T T2 + nodeAction function stored (subset hx) g y).1 edge |>.2 + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound g P order top action + G nodes nodeOrder nodeAction basis T T2 level branch) + exact ⟨bounds.2, x, hx, branch⟩ + · rintro ⟨_, x, hx, branch⟩ + exact ⟨x, hx, (M.structuralAssignmentActionGraph_branch_entry G nodes nodeOrder basis T T2 + nodeAction function stored (subset hx) g y).2 ⟨actor, branch⟩⟩ + +theorem structuralAssignmentImage_domain_restrict {stages earlier history : ZFSet.{u}} + (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g A : ZFSet.{u}) : + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 earlier history g A = + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g + (ZFSet.sep (fun x => x ∈ M.structuralAssignments G nodes nodeOrder basis T T2 earlier history) A) := by + apply ZFSet.ext + intro y + rw [M.structuralAssignmentImage_entry, M.structuralAssignmentImage_entry] + constructor + · rintro ⟨x, hx, edge⟩ + obtain ⟨whole, source⟩ := + (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).1 edge + exact ⟨x, ZFSet.mem_sep.2 ⟨hx, source⟩, whole⟩ + · rintro ⟨x, hx, edge⟩ + obtain ⟨member, source⟩ := ZFSet.mem_sep.1 hx + exact ⟨x, member, + (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 + ⟨edge, source⟩⟩ + +theorem structuralAssignmentImage_cut {stages earlier history : ZFSet.{u}} + (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g A : ZFSet.{u}) : + assignmentCut (refinementDataHistoryLevels stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier + (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A) = + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 earlier history g + (assignmentCut (refinementDataHistoryLevels stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier A) := by + rw [M.structuralAssignments_cut_eq G nodes nodeOrder basis T T2 subset, + M.structuralAssignments_cut_eq G nodes nodeOrder basis T T2 subset] + apply ZFSet.ext + intro y + rw [ZFSet.mem_sep, M.structuralAssignmentImage_entry, M.structuralAssignmentImage_entry] + constructor + · rintro ⟨⟨x, hx, edge⟩, target⟩ + have source := (M.structuralAssignmentActionGraph_earlier_iff G nodes nodeOrder nodeAction basis T T2 + function earlier edge).2 target + exact ⟨x, ZFSet.mem_sep.2 ⟨hx, source⟩, + (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 function subset g x y).2 + ⟨edge, source⟩⟩ + · rintro ⟨x, hx, edge⟩ + obtain ⟨member, source⟩ := ZFSet.mem_sep.1 hx + have whole := (M.structuralAssignmentActionGraph_prefix_entry G nodes nodeOrder nodeAction basis T T2 + function subset g x y).1 edge |>.1 + exact ⟨⟨x, member, whole⟩, + (M.structuralAssignmentActionGraph_earlier_iff G nodes nodeOrder nodeAction basis T T2 + function earlier whole).1 source⟩ + +theorem structuralAssignmentImage_prefix_cut {stages earlier history : ZFSet.{u}} + (function : FunctionGraphOn stages history) (subset : earlier ⊆ stages) (g A : ZFSet.{u}) : + assignmentCut (refinementDataHistoryLevels stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier + (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A) = + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 earlier (graphRestriction earlier history) g + (assignmentCut (refinementDataHistoryLevels stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) earlier A) := by + rw [M.structuralAssignmentImage_history_restrict] + exact M.structuralAssignmentImage_cut G nodes nodeOrder nodeAction basis T T2 function subset g A + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) +variable {stages history level P order top action : ZFSet.{u}} +variable (function : FunctionGraphOn stages history) +variable (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) +include function stored + +theorem structuralAssignmentActionGraph_branch_iff {g x y : ZFSet.{u}} + (edge : ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) : + x ∈ stageOneAssignments + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T ↔ + y ∈ stageOneAssignments + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T := by + constructor + · intro member + have branch := (M.structuralAssignmentActionGraph_branch_entry G nodes nodeOrder basis T T2 + nodeAction function stored member g y).1 edge |>.2 + exact (ZFSet.pair_mem_prod.1 (M.rawStageRefinementAssignmentActionGraph_branch_bound + g P order top action G nodes nodeOrder nodeAction basis T T2 level branch)).2 + · intro member + obtain ⟨_, other, _, P', order', top', action', stored', branch⟩ := + (M.pair_mem_structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 + stages history g x y).1 edge + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound g P' order' top' action' + G nodes nodeOrder nodeAction basis T T2 other branch) + obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := M.structuralAssignment_branch_unique + G nodes nodeOrder basis T T2 function stored stored' member bounds.2 + exact bounds.1 + +theorem structuralAssignmentImage_select_branch (g A : ZFSet.{u}) : + let I := M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0 + assignmentOnIndices I T + (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g A) = + M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g + (assignmentOnIndices I T A) := by + dsimp only + apply ZFSet.ext + intro y + rw [mem_assignmentOnIndices, M.structuralAssignmentImage_entry, M.structuralAssignmentImage_entry] + constructor + · rintro ⟨⟨x, hx, edge⟩, hy⟩ + exact ⟨x, (mem_assignmentOnIndices _ _ _ _).2 ⟨hx, + (M.structuralAssignmentActionGraph_branch_iff G nodes nodeOrder nodeAction basis T T2 + function stored edge).2 hy⟩, edge⟩ + · rintro ⟨x, hx, edge⟩ + obtain ⟨member, branch⟩ := (mem_assignmentOnIndices _ _ _ _).1 hx + exact ⟨⟨x, member, edge⟩, + (M.structuralAssignmentActionGraph_branch_iff G nodes nodeOrder nodeAction basis T T2 + function stored edge).1 branch⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) +variable {stages history level P order top action g : ZFSet.{u}} +variable (function : FunctionGraphOn stages history) (actor : g ∈ G) +variable (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) +local notation "d" => M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level +local notation "J" => stageOneAssignments (d 0) T +local notation "branch" => M.rawStageRefinementAssignmentActionGraph g P order top action + G nodes nodeOrder nodeAction basis T T2 level +local notation "image" => M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g + +include function actor stored in +theorem structuralAssignmentImage_target_branch_iff {A y : ZFSet.{u}} (target : y ∈ J) : + y ∈ image A ↔ y ∈ relationImage A J branch := by + rw [M.structuralAssignmentImage_entry, mem_relationImage] + constructor + · rintro ⟨x, hx, edge⟩ + obtain ⟨_hg, other, _ho, P', order', top', action', stored', entry⟩ := + (M.pair_mem_structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 + stages history g x y).1 edge + have bounds := ZFSet.pair_mem_prod.1 + (M.rawStageRefinementAssignmentActionGraph_branch_bound g P' order' top' action' + G nodes nodeOrder nodeAction basis T T2 other entry) + obtain ⟨rfl, rfl, rfl, rfl, rfl⟩ := + M.structuralAssignment_branch_unique G nodes nodeOrder basis T T2 + function stored stored' target bounds.2 + exact ⟨target, x, hx, entry⟩ + · rintro ⟨_, x, hx, entry⟩ + exact ⟨x, hx, (M.pair_mem_structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 + stages history g x y).2 + ⟨actor, level, function.pair_source stored, P, order, top, action, stored, entry⟩⟩ + +include function actor stored in +theorem structuralAssignmentImage_rawTests_branch_iff (A lower : ZFSet.{u}) : + stageOneRawTests M d (image A) lower ↔ + stageOneRawTests M d (relationImage A J branch) lower := by + apply stageOneRawTests_congr + intro i hi u hu w hw + change u ∈ T at hu + change w ∈ T at hw + exact M.structuralAssignmentImage_target_branch_iff G nodes nodeOrder nodeAction basis T T2 + function actor stored ((stageOneAssignment_mem_assignments (d 0) T i u w).2 ⟨hi, hu, hw⟩) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (level T T2 : ZFSet.{u}) +variable (system : RefinementStageSystem M a s t b d base directed level T T2) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) +include system pairing unions powers separation collection carrier order group nodes supports hLevel hT + +theorem structuralAssignmentImage_decode + {stages history : ZFSet.{u}} (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode s.carrier s.conditionOrder (s.encode ⊤) + (a.actionGraph s t)) ∈ history) + (h : G) (A sharedIdx rawU rawW : ZFSet.{u}) + (index : sharedIdx ∈ M.niceRefinementIndices a s b d level T T2 system.valid1) + (hu : rawU ∈ T) (hw : rawW ∈ T) + (member : stageOneAssignment sharedIdx rawU rawW ∈ + M.structuralAssignmentImage t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history (t.encode h) A) : + ∃ (C E : L) (U Rf Rc u w : (M.nameDomain s).names), + refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d level T T2 system.valid1 ∧ + u.val.val ∈ T ∧ w.val.val ∈ T ∧ + stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val w.val.val ∈ A ∧ + sharedIdx = refinementIndexCode level (b.encode (d.iso h C)) (b.encode (d.iso h E)) + (a.act s h U.val).val (a.act s h Rf.val).val (a.act s h Rc.val).val ∧ + rawU = (a.act s h u.val).val ∧ rawW = (a.act s h w.val).val ∧ + ZFSet.pair (ZFSet.pair (t.encode h) (stageOneAssignment + (refinementIndexCode level (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val w.val.val)) (stageOneAssignment sharedIdx rawU rawW) ∈ + M.structuralAssignmentActionGraph t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 stages history := by + obtain ⟨x, source, edge⟩ := (M.structuralAssignmentImage_entry t.carrier b.carrier b.conditionOrder + (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 stages history + (t.encode h) A _).1 member + have dataEq := M.rawRefinementFormulaData_eq a s t b d pairing unions powers separation collection + carrier group nodes supports system.inputs.condition_maps level T T2 system.valid1 system.valid2 + have target : stageOneAssignment sharedIdx rawU rawW ∈ stageOneAssignments + (M.rawRefinementFormulaData s.carrier s.conditionOrder (s.encode ⊤) (a.actionGraph s t) + t.carrier b.carrier b.conditionOrder (supportBasisCode b t d.principalFix) T T2 level 0) T := by + rw [dataEq] + exact (stageOneAssignment_mem_assignments _ _ _ _ _).2 ⟨index, hu, hw⟩ + have branchMember := (M.structuralAssignmentActionGraph_branch_iff t.carrier b.carrier + b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 + function stored edge).2 target + have original := branchMember + rw [dataEq] at original + obtain ⟨idx, hi, originalU, hOriginalU, originalW, hOriginalW, rfl⟩ := + (mem_stageOneAssignments _ _ x).1 original + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := + M.exists_niceRefinementIndex_fields a s b d level T T2 system.valid1 system.valid2 hi + let u : (M.nameDomain s).names := + ⟨⟨originalU, system.valid1 originalU hOriginalU⟩, M.transitive hT hOriginalU⟩ + let w : (M.nameDomain s).names := + ⟨⟨originalW, system.valid1 originalW hOriginalW⟩, M.transitive hT hOriginalW⟩ + have branch := ((M.structuralAssignmentActionGraph_branch_entry t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 (d.actionGraph b t) function stored + branchMember (t.encode h) (stageOneAssignment sharedIdx rawU rawW)).1 edge).2 + rw [M.rawStageRefinementAssignmentActionGraph_eq a s t b d pairing unions powers separation collection + carrier group nodes order system.inputs.condition_maps system.inputs.node_maps supports level T T2 + hLevel hT system.valid1 system.valid2 system.inputs.terms_closed system.inputs.pairs_closed + system.inputs.family_ground system.indices.index_ground h] at branch + have moved := (M.refinementAssignmentActionGraph_entry a s b d level T T2 system.valid1 + system.valid2 system.inputs.terms_closed t pairing unions powers separation collection carrier + order system.inputs.condition_maps system.inputs.pairs_closed system.inputs.family_ground + h C E U Rf Rc u.val w.val hi hOriginalU hOriginalW _).1 branch + obtain ⟨sameIndex, sameU, sameW⟩ := (stageOneAssignment_eq_iff _ _ _ _ _ _).1 moved + exact ⟨C, E, U, Rf, Rc, u, w, hi, hOriginalU, hOriginalW, source, + sameIndex, sameU, sameW, edge⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + +theorem structuralAssignmentImage_selected_edge + {stages history level P order top action g sourceA x y : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) + (member : x ∈ assignmentOnIndices + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T sourceA) + (edge : ZFSet.pair (ZFSet.pair g x) y ∈ + M.structuralAssignmentActionGraph G nodes nodeOrder nodeAction basis T T2 stages history) : + y ∈ assignmentOnIndices + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) T + (M.structuralAssignmentImage G nodes nodeOrder nodeAction basis T T2 stages history g sourceA) := by + obtain ⟨source, branch⟩ := (mem_assignmentOnIndices _ _ _ _).1 member + exact (mem_assignmentOnIndices _ _ _ _).2 + ⟨(M.structuralAssignmentImage_entry G nodes nodeOrder nodeAction basis T T2 + stages history g sourceA y).2 ⟨x, source, edge⟩, + (M.structuralAssignmentActionGraph_branch_iff G nodes nodeOrder nodeAction basis T T2 + function stored edge).1 branch⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaggedGrowthLayerRanks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaggedGrowthLayerRanks.lean index 9b368af1577332785f7ee9ac234f1eb3695c26c4..d2c31f764952ab0edf7cb4c9b4ed653ceeeb76a2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaggedGrowthLayerRanks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaggedGrowthLayerRanks.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas -import OAI.SetTheory.PartitionPrinciple.Models.LiteralQuotientRankBounds - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem rank_nonemptyTupleCode_field_le (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) : - ∀ j, ZFSet.rank (fields j) ≤ ZFSet.rank (nonemptyTupleCode k fields) := by - induction k with - | zero => exact Fin.cases le_rfl (fun i => Fin.elim0 i) - | succ k ih => - let tail := nonemptyTupleCode k (fun j => fields j.succ) - have both : ZFSet.rank ({fields 0, tail} : ZFSet.{u}) < - ZFSet.rank (ZFSet.pair (fields 0) tail) := - ZFSet.rank_lt_of_mem (ZFSet.mem_pair.2 (Or.inr rfl)) - have head : ZFSet.rank (fields 0) < ZFSet.rank (ZFSet.pair (fields 0) tail) := - (ZFSet.rank_lt_of_mem (show fields 0 ∈ ({fields 0, tail} : ZFSet.{u}) from - ZFSet.mem_pair.2 (Or.inl rfl))).trans both - have rest : ZFSet.rank tail < ZFSet.rank (ZFSet.pair (fields 0) tail) := - (ZFSet.rank_lt_of_mem (show tail ∈ ({fields 0, tail} : ZFSet.{u}) from - ZFSet.mem_pair.2 (Or.inr rfl))).trans both - exact Fin.cases head.le (fun j => (ih _ j).trans rest.le) - -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include limit - -theorem countableLayerWitness_rank_lt {D injection : ZFSet.{u}} - (hD : ZFSet.rank D < o) (hInjection : ZFSet.rank injection < o) : - ZFSet.rank (countableLayerWitness D injection) < o := - rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases (rank_natSetCode_lt limit 0) (Fin.cases hD (fun _ => hInjection))) - -theorem copyLayerWitness_rank_lt {I parts Indices Maps W injection : ZFSet.{u}} - (hI : ZFSet.rank I < o) (hParts : ZFSet.rank parts < o) - (hIndices : ZFSet.rank Indices < o) (hMaps : ZFSet.rank Maps < o) - (hW : ZFSet.rank W < o) (hInjection : ZFSet.rank injection < o) : - ZFSet.rank (copyLayerWitness I parts Indices Maps W injection) < o := - rank_nonemptyTupleCode_lt limit 6 _ (Fin.cases (rank_natSetCode_lt limit 1) - (Fin.cases hI (Fin.cases hParts (Fin.cases hIndices - (Fin.cases hMaps (Fin.cases hW (fun _ => hInjection))))))) - -theorem separatedLayerWitness_rank_lt {I Indices Maps W Components F : ZFSet.{u}} - (hI : ZFSet.rank I < o) (hIndices : ZFSet.rank Indices < o) - (hMaps : ZFSet.rank Maps < o) (hW : ZFSet.rank W < o) - (hComponents : ZFSet.rank Components < o) (hF : ZFSet.rank F < o) : - ZFSet.rank (separatedLayerWitness I Indices Maps W Components F) < o := - rank_nonemptyTupleCode_lt limit 6 _ (Fin.cases (rank_natSetCode_lt limit 2) - (Fin.cases hI (Fin.cases hIndices (Fin.cases hMaps - (Fin.cases hW (Fin.cases hComponents (fun _ => hF))))))) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas +import OAI.SetTheory.PartitionPrinciple.Models.LiteralQuotientRankBounds + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem rank_nonemptyTupleCode_field_le (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) : + ∀ j, ZFSet.rank (fields j) ≤ ZFSet.rank (nonemptyTupleCode k fields) := by + induction k with + | zero => exact Fin.cases le_rfl (fun i => Fin.elim0 i) + | succ k ih => + let tail := nonemptyTupleCode k (fun j => fields j.succ) + have both : ZFSet.rank ({fields 0, tail} : ZFSet.{u}) < + ZFSet.rank (ZFSet.pair (fields 0) tail) := + ZFSet.rank_lt_of_mem (ZFSet.mem_pair.2 (Or.inr rfl)) + have head : ZFSet.rank (fields 0) < ZFSet.rank (ZFSet.pair (fields 0) tail) := + (ZFSet.rank_lt_of_mem (show fields 0 ∈ ({fields 0, tail} : ZFSet.{u}) from + ZFSet.mem_pair.2 (Or.inl rfl))).trans both + have rest : ZFSet.rank tail < ZFSet.rank (ZFSet.pair (fields 0) tail) := + (ZFSet.rank_lt_of_mem (show tail ∈ ({fields 0, tail} : ZFSet.{u}) from + ZFSet.mem_pair.2 (Or.inr rfl))).trans both + exact Fin.cases head.le (fun j => (ih _ j).trans rest.le) + +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include limit + +theorem countableLayerWitness_rank_lt {D injection : ZFSet.{u}} + (hD : ZFSet.rank D < o) (hInjection : ZFSet.rank injection < o) : + ZFSet.rank (countableLayerWitness D injection) < o := + rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases (rank_natSetCode_lt limit 0) (Fin.cases hD (fun _ => hInjection))) + +theorem copyLayerWitness_rank_lt {I parts Indices Maps W injection : ZFSet.{u}} + (hI : ZFSet.rank I < o) (hParts : ZFSet.rank parts < o) + (hIndices : ZFSet.rank Indices < o) (hMaps : ZFSet.rank Maps < o) + (hW : ZFSet.rank W < o) (hInjection : ZFSet.rank injection < o) : + ZFSet.rank (copyLayerWitness I parts Indices Maps W injection) < o := + rank_nonemptyTupleCode_lt limit 6 _ (Fin.cases (rank_natSetCode_lt limit 1) + (Fin.cases hI (Fin.cases hParts (Fin.cases hIndices + (Fin.cases hMaps (Fin.cases hW (fun _ => hInjection))))))) + +theorem separatedLayerWitness_rank_lt {I Indices Maps W Components F : ZFSet.{u}} + (hI : ZFSet.rank I < o) (hIndices : ZFSet.rank Indices < o) + (hMaps : ZFSet.rank Maps < o) (hW : ZFSet.rank W < o) + (hComponents : ZFSet.rank Components < o) (hF : ZFSet.rank F < o) : + ZFSet.rank (separatedLayerWitness I Indices Maps W Components F) < o := + rank_nonemptyTupleCode_lt limit 6 _ (Fin.cases (rank_natSetCode_lt limit 2) + (Fin.cases hI (Fin.cases hIndices (Fin.cases hMaps + (Fin.cases hW (Fin.cases hComponents (fun _ => hF))))))) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaskSystem.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaskSystem.lean index 6a724ec4969c2f6b2ad47101080efe16ece3ac7f..b23ede2b658d860eb4bed38cf72e4aa0f1d91613 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaskSystem.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TaskSystem.lean @@ -1,362 +1,362 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.RecursiveAction - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Attachment - -universe u v w z r q - -theorem meetEmbedding_ext {A : Type u} {B : Type v} - {P : MeetOrder A} {Q : MeetOrder B} (f g : MeetEmbedding P Q) - (eq : ∀ x, f.toFun x = g.toFun x) : f = g := by - cases f with - | mk f orderf meetf => - cases g with - | mk g orderg meetg => - have h : f = g := funext eq - cases h - rfl - -theorem meetFilter_ext {A : Type u} {P : MeetOrder A} (F H : MeetFilter P) - (eq : ∀ x, F.mem x ↔ H.mem x) : F = H := by - cases F with - | mk F nonemptyF upwardF closedF => - cases H with - | mk H nonemptyH upwardH closedH => - have h : F = H := funext (fun x => propext (eq x)) - cases h - rfl - -theorem pushFilter_iso_image {A : Type u} {P : MeetOrder A} - (g : MeetIso P P) (F : MeetFilter P) (y : A) : - (pushFilter g.toMeetEmbedding F).mem y ↔ - ∃ f, F.mem f ∧ g.toFun f = y := by - constructor - · rintro ⟨f, hf, hfy⟩ - have lower : P.le f (g.inverse y) := by - apply (g.le_iff _ _).mp - rw [g.right_inverse] - exact hfy - exact ⟨g.inverse y, F.upward hf lower, g.right_inverse y⟩ - · rintro ⟨f, hf, rfl⟩ - exact ⟨f, hf, P.refl _⟩ - -def identityIso {A : Type u} (P : MeetOrder A) : MeetIso P P := - isoOfOrder (fun x => x) (fun x => x) (fun _ => rfl) - (fun _ => rfl) (fun _ _ => Iff.rfl) - -def composeIso {A : Type u} {P : MeetOrder A} (g h : MeetIso P P) : MeetIso P P where - toMeetEmbedding := compose h.toMeetEmbedding g.toMeetEmbedding - inverse x := h.inverse (g.inverse x) - left_inverse x := by - change h.inverse (g.inverse (g.toFun (h.toFun x))) = x - rw [g.left_inverse, h.left_inverse] - right_inverse x := by - change g.toFun (h.toFun (h.inverse (g.inverse x))) = x - rw [h.right_inverse, g.right_inverse] - -theorem pushFilter_comp {A : Type u} {B : Type v} {C : Type w} - {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} - (f : MeetEmbedding P Q) (g : MeetEmbedding Q R) (F : MeetFilter P) : - pushFilter (compose f g) F = pushFilter g (pushFilter f F) := by - apply meetFilter_ext - intro y - constructor - · rintro ⟨a, ha, hay⟩ - exact ⟨f.toFun a, ⟨a, ha, Q.refl _⟩, hay⟩ - · rintro ⟨b, ⟨a, ha, hab⟩, hby⟩ - exact ⟨a, ha, R.trans ((g.le_iff _ _).mpr hab) hby⟩ - -structure TaskDatum {A : Type u} (P : MeetOrder A) (Label : Type v) where - source : A - target : A - baseMap : MeetEmbedding (idealOrder P source) P - separator : A - filter : MeetFilter P - label : Label - -namespace TaskDatum - -variable {A : Type u} {P : MeetOrder A} {Label : Type v} - -structure Geometry (i : TaskDatum P Label) : Prop where - base_bound : ∀ x, P.le (i.baseMap.toFun x) i.target - base_onto : ∀ y, P.le y i.target → ∃ x, i.baseMap.toFun x = y - base_le_separator : P.le i.target i.separator - separator_not_le_base : ¬ P.le i.separator i.target - separator_le_filter : ∀ f, i.filter.mem f → P.le i.separator f - -def transform (g : MeetIso P P) (i : TaskDatum P Label) : TaskDatum P Label where - source := i.source - target := g.toFun i.target - baseMap := compose i.baseMap g.toMeetEmbedding - separator := g.toFun i.separator - filter := pushFilter g.toMeetEmbedding i.filter - label := i.label - -theorem transform_identity (i : TaskDatum P Label) : - transform (identityIso P) i = i := by - have hb := meetEmbedding_ext (compose i.baseMap (identityIso P).toMeetEmbedding) - i.baseMap (fun _ => rfl) - have hf : pushFilter (identityIso P).toMeetEmbedding i.filter = i.filter := - meetFilter_ext _ _ (fun x => pushFilter_trace (identityIso P).toMeetEmbedding i.filter x) - unfold transform - rw [hb, hf] - rfl - -theorem transform_composition (g h : MeetIso P P) (i : TaskDatum P Label) : - transform (composeIso g h) i = transform g (transform h i) := by - unfold transform - change TaskDatum.mk i.source (g.toFun (h.toFun i.target)) - (compose i.baseMap (compose h.toMeetEmbedding g.toMeetEmbedding)) - (g.toFun (h.toFun i.separator)) - (pushFilter (compose h.toMeetEmbedding g.toMeetEmbedding) i.filter) i.label = _ - rw [pushFilter_comp] - rfl - -theorem geometry_transform (g : MeetIso P P) (i : TaskDatum P Label) - (valid : i.Geometry) : (transform g i).Geometry where - base_bound x := (g.le_iff _ _).mpr (valid.base_bound x) - base_onto y hy := by - have hy' : P.le (g.inverse y) i.target := by - apply (g.le_iff _ _).mp - rw [g.right_inverse] - exact hy - rcases valid.base_onto (g.inverse y) hy' with ⟨x, hx⟩ - refine ⟨x, ?_⟩ - change g.toFun (i.baseMap.toFun x) = y - rw [hx, g.right_inverse] - base_le_separator := (g.le_iff _ _).mpr valid.base_le_separator - separator_not_le_base h := valid.separator_not_le_base ((g.le_iff _ _).mp h) - separator_le_filter f hf := - pushFilter_lower_bound g.toMeetEmbedding i.filter i.separator - valid.separator_le_filter f hf - -theorem transform_ext (g h : MeetIso P P) (i : TaskDatum P Label) - (target : g.toFun i.target = h.toFun i.target) - (base : ∀ x, g.toFun (i.baseMap.toFun x) = h.toFun (i.baseMap.toFun x)) - (separator : g.toFun i.separator = h.toFun i.separator) - (filter : ∀ y, (pushFilter g.toMeetEmbedding i.filter).mem y ↔ - (pushFilter h.toMeetEmbedding i.filter).mem y) : - transform g i = transform h i := by - have hb := meetEmbedding_ext (compose i.baseMap g.toMeetEmbedding) - (compose i.baseMap h.toMeetEmbedding) base - have hf := meetFilter_ext (pushFilter g.toMeetEmbedding i.filter) - (pushFilter h.toMeetEmbedding i.filter) filter - unfold transform - rw [target, hb, separator, hf] - -theorem transform_agrees (g h : MeetIso P P) (i : TaskDatum P Label) - (valid : i.Geometry) (v : A) (positive : i.filter.mem v) - (agree : ∀ x, P.le x v → g.toFun x = h.toFun x) : - transform g i = transform h i := by - have sep := valid.separator_le_filter v positive - have target := P.trans valid.base_le_separator sep - apply transform_ext g h i - · exact agree i.target target - · intro x - exact agree (i.baseMap.toFun x) (P.trans (valid.base_bound x) target) - · exact agree i.separator sep - · intro y - rw [pushFilter_iso_image, pushFilter_iso_image] - exact filter_images_agree P i.filter g h v positive agree y - -theorem permutations_agree {Task : Type w} (datum : Task → TaskDatum P Label) - (faithful : ∀ i j, datum i = datum j → i = j) - (g h : MeetIso P P) (permG permH : Task → Task) - (transportG : ∀ i, datum (permG i) = transform g (datum i)) - (transportH : ∀ i, datum (permH i) = transform h (datum i)) - (i : Task) (valid : (datum i).Geometry) (v : A) - (positive : (datum i).filter.mem v) - (agree : ∀ x, P.le x v → g.toFun x = h.toFun x) : permG i = permH i := by - apply faithful - rw [transportG, transportH] - exact transform_agrees g h (datum i) valid v positive agree - -theorem representatives_compatible {Task : Type w} (datum : Task → TaskDatum P Label) - (chosen : Task → MeetIso P P) - (represents : ∀ i (x : {x // P.le x (datum i).source}), - (chosen i).toFun x.val = (datum i).baseMap.toFun x) - (g : MeetIso P P) (perm : Task → Task) - (transport : ∀ i, datum (perm i) = transform g (datum i)) - (i : Task) (x : A) (hx : P.le x (datum i).source) : - g.toFun ((chosen i).toFun x) = (chosen (perm i)).toFun x := by - have target := represents (perm i) - rw [transport i] at target - exact (congrArg g.toFun (represents i ⟨x, hx⟩)).trans (target ⟨x, hx⟩).symm - -theorem successor_agreement {O : Type z} {I : Type r} {R : MeetOrder O} - {b : Templates.{z,q,r} R I} {Task : Type w} {d : Inputs b Task} - (s t : TaskSymmetry d) (original : MeetEmbedding P R) - (datum : Task → TaskDatum P Label) - (faithful : ∀ i j, datum i = datum j → i = j) - (valid : ∀ i, (datum i).Geometry) - (g h : MeetIso P P) - (transportG : ∀ i, datum (s.perm i) = transform g (datum i)) - (transportH : ∀ i, datum (t.perm i) = transform h (datum i)) - (T : O) (top : ∀ p, R.le p T) (v : A) - (negative : ∀ i, ¬ (datum i).filter.mem v → - b.extension.le - (b.extension.meet ((d.previous i).toFun T) (.inl (original.toFun v))) - ((d.previous i).toFun (d.source i))) - (ground_agree : ∀ x, P.le x v → g.toFun x = h.toFun x) - (current_agree : ∀ x, b.extension.le x (.inl (original.toFun v)) → - s.current.toFun x = t.current.toFun x) - (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) - (below : d.nextBatch.extension.le x (.inl (.inl (original.toFun v)))) : - s.nextIso.toFun x = t.nextIso.toFun x := by - apply s.agreement_persists t T top (original.toFun v) - (fun i => (datum i).filter.mem v) negative current_agree - (fun i positive => permutations_agree datum faithful g h s.perm t.perm - transportG transportH i (valid i) v positive ground_agree) x below - -end TaskDatum -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps - -open Attachment - -universe u - -structure GroupData (G : Type u) where - one : G - mul : G → G → G - inv : G → G - assoc : ∀ a b c, mul (mul a b) c = mul a (mul b c) - one_mul : ∀ a, mul one a = a - mul_one : ∀ a, mul a one = a - inv_mul : ∀ a, mul (inv a) a = one - mul_inv : ∀ a, mul a (inv a) = one - -theorem transform_congr {A Label : Type u} {P : MeetOrder A} - (g h : MeetIso P P) (eq : ∀ x, g.toFun x = h.toFun x) (i : TaskDatum P Label) : - TaskDatum.transform g i = TaskDatum.transform h i := by - apply TaskDatum.transform_ext g h i (eq _) (fun x => eq _) (eq _) - intro y - rw [pushFilter_iso_image, pushFilter_iso_image] - constructor - · rintro ⟨f, hf, hfy⟩ - exact ⟨f, hf, (eq f).symm.trans hfy⟩ - · rintro ⟨f, hf, hfy⟩ - exact ⟨f, hf, (eq f).trans hfy⟩ - -structure TaskSystem {A : Type u} (P : MeetOrder A) (G Task Label : Type u) where - group : GroupData G - action : G → MeetIso P P - action_one : ∀ x, (action group.one).toFun x = x - action_mul : ∀ g h x, (action (group.mul g h)).toFun x = - (action g).toFun ((action h).toFun x) - datum : Task → TaskDatum P Label - faithful : ∀ i j, datum i = datum j → i = j - geometry : ∀ i, (datum i).Geometry - invariant : ∀ g i, ∃ j, datum j = TaskDatum.transform (action g) (datum i) - representable : ∀ i, ∃ g, ∀ x : {x // P.le x (datum i).source}, - (action g).toFun x.val = (datum i).baseMap.toFun x - top : A - greatest : ∀ x, P.le x top - source_proper : ∀ i, ¬ P.le top (datum i).source - -namespace TaskSystem - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -noncomputable def perm (g : G) (i : Task) : Task := Classical.choose (f.invariant g i) - -theorem transport (g : G) (i : Task) : - f.datum (f.perm g i) = TaskDatum.transform (f.action g) (f.datum i) := - Classical.choose_spec (f.invariant g i) - -theorem perm_one (i : Task) : f.perm f.group.one i = i := by - apply f.faithful - rw [f.transport] - exact (transform_congr _ (identityIso P) f.action_one _).trans - (TaskDatum.transform_identity _) - -theorem perm_mul (g h : G) (i : Task) : - f.perm (f.group.mul g h) i = f.perm g (f.perm h i) := by - apply f.faithful - rw [f.transport, f.transport, f.transport] - exact (transform_congr _ (composeIso (f.action g) (f.action h)) - (f.action_mul g h) _).trans (TaskDatum.transform_composition _ _ _) - -theorem perm_left (g : G) (i : Task) : f.perm (f.group.inv g) (f.perm g i) = i := by - rw [← f.perm_mul, f.group.inv_mul, f.perm_one] - -theorem perm_right (g : G) (i : Task) : f.perm g (f.perm (f.group.inv g) i) = i := by - rw [← f.perm_mul, f.group.mul_inv, f.perm_one] - -theorem action_left (g : G) (x : A) : - (f.action (f.group.inv g)).toFun ((f.action g).toFun x) = x := by - rw [← f.action_mul, f.group.inv_mul, f.action_one] - -theorem action_right (g : G) (x : A) : - (f.action g).toFun ((f.action (f.group.inv g)).toFun x) = x := by - rw [← f.action_mul, f.group.mul_inv, f.action_one] - -theorem source_invariant (g : G) (i : Task) : - (f.datum (f.perm g i)).source = (f.datum i).source := by - rw [f.transport] - rfl - -noncomputable def representative (i : Task) : G := Classical.choose (f.representable i) - -theorem represents (i : Task) (x : {x // P.le x (f.datum i).source}) : - (f.action (f.representative i)).toFun x.val = (f.datum i).baseMap.toFun x := - Classical.choose_spec (f.representable i) x - -theorem base_top (i : Task) : - (f.datum i).baseMap.toFun ⟨(f.datum i).source, P.refl _⟩ = (f.datum i).target := by - apply P.antisymm - · exact (f.geometry i).base_bound _ - · rcases (f.geometry i).base_onto (f.datum i).target (P.refl _) with ⟨x, hx⟩ - rw [← hx] - exact ((f.datum i).baseMap.le_iff _ _).mpr x.property - -theorem representative_target (i : Task) : - (f.action (f.representative i)).toFun (f.datum i).source = (f.datum i).target := - (f.represents i ⟨_, P.refl _⟩).trans (f.base_top i) - -theorem ground_compatible (g : G) (i : Task) (x : A) - (hx : P.le x (f.datum i).source) : - (f.action g).toFun ((f.action (f.representative i)).toFun x) = - (f.action (f.representative (f.perm g i))).toFun x := - TaskDatum.representatives_compatible f.datum (fun i => f.action (f.representative i)) - f.represents (f.action g) (f.perm g) (f.transport g) i x hx - -theorem positive_perms_agree (g h : G) (v : A) - (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) - (i : Task) (positive : (f.datum i).filter.mem v) : f.perm g i = f.perm h i := - TaskDatum.permutations_agree f.datum f.faithful (f.action g) (f.action h) - (f.perm g) (f.perm h) (f.transport g) (f.transport h) i (f.geometry i) v positive agree - -noncomputable def initial : InitialTasks P Task where - source i := (f.datum i).source - representative i := f.action (f.representative i) - filter i := (f.datum i).filter - separator i := (f.datum i).separator - base_le_separator i := by - rw [f.representative_target] - exact (f.geometry i).base_le_separator - separator_not_le_base i := by - rw [f.representative_target] - exact (f.geometry i).separator_not_le_base - separator_le_filter i := (f.geometry i).separator_le_filter - -theorem filter_covariant (g : G) (i : Task) (x : A) : - (f.datum (f.perm g i)).filter.mem ((f.action g).toFun x) ↔ (f.datum i).filter.mem x := by - rw [f.transport] - exact pushFilter_trace (f.action g).toMeetEmbedding (f.datum i).filter x - -end TaskSystem -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.RecursiveAction + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Attachment + +universe u v w z r q + +theorem meetEmbedding_ext {A : Type u} {B : Type v} + {P : MeetOrder A} {Q : MeetOrder B} (f g : MeetEmbedding P Q) + (eq : ∀ x, f.toFun x = g.toFun x) : f = g := by + cases f with + | mk f orderf meetf => + cases g with + | mk g orderg meetg => + have h : f = g := funext eq + cases h + rfl + +theorem meetFilter_ext {A : Type u} {P : MeetOrder A} (F H : MeetFilter P) + (eq : ∀ x, F.mem x ↔ H.mem x) : F = H := by + cases F with + | mk F nonemptyF upwardF closedF => + cases H with + | mk H nonemptyH upwardH closedH => + have h : F = H := funext (fun x => propext (eq x)) + cases h + rfl + +theorem pushFilter_iso_image {A : Type u} {P : MeetOrder A} + (g : MeetIso P P) (F : MeetFilter P) (y : A) : + (pushFilter g.toMeetEmbedding F).mem y ↔ + ∃ f, F.mem f ∧ g.toFun f = y := by + constructor + · rintro ⟨f, hf, hfy⟩ + have lower : P.le f (g.inverse y) := by + apply (g.le_iff _ _).mp + rw [g.right_inverse] + exact hfy + exact ⟨g.inverse y, F.upward hf lower, g.right_inverse y⟩ + · rintro ⟨f, hf, rfl⟩ + exact ⟨f, hf, P.refl _⟩ + +def identityIso {A : Type u} (P : MeetOrder A) : MeetIso P P := + isoOfOrder (fun x => x) (fun x => x) (fun _ => rfl) + (fun _ => rfl) (fun _ _ => Iff.rfl) + +def composeIso {A : Type u} {P : MeetOrder A} (g h : MeetIso P P) : MeetIso P P where + toMeetEmbedding := compose h.toMeetEmbedding g.toMeetEmbedding + inverse x := h.inverse (g.inverse x) + left_inverse x := by + change h.inverse (g.inverse (g.toFun (h.toFun x))) = x + rw [g.left_inverse, h.left_inverse] + right_inverse x := by + change g.toFun (h.toFun (h.inverse (g.inverse x))) = x + rw [h.right_inverse, g.right_inverse] + +theorem pushFilter_comp {A : Type u} {B : Type v} {C : Type w} + {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} + (f : MeetEmbedding P Q) (g : MeetEmbedding Q R) (F : MeetFilter P) : + pushFilter (compose f g) F = pushFilter g (pushFilter f F) := by + apply meetFilter_ext + intro y + constructor + · rintro ⟨a, ha, hay⟩ + exact ⟨f.toFun a, ⟨a, ha, Q.refl _⟩, hay⟩ + · rintro ⟨b, ⟨a, ha, hab⟩, hby⟩ + exact ⟨a, ha, R.trans ((g.le_iff _ _).mpr hab) hby⟩ + +structure TaskDatum {A : Type u} (P : MeetOrder A) (Label : Type v) where + source : A + target : A + baseMap : MeetEmbedding (idealOrder P source) P + separator : A + filter : MeetFilter P + label : Label + +namespace TaskDatum + +variable {A : Type u} {P : MeetOrder A} {Label : Type v} + +structure Geometry (i : TaskDatum P Label) : Prop where + base_bound : ∀ x, P.le (i.baseMap.toFun x) i.target + base_onto : ∀ y, P.le y i.target → ∃ x, i.baseMap.toFun x = y + base_le_separator : P.le i.target i.separator + separator_not_le_base : ¬ P.le i.separator i.target + separator_le_filter : ∀ f, i.filter.mem f → P.le i.separator f + +def transform (g : MeetIso P P) (i : TaskDatum P Label) : TaskDatum P Label where + source := i.source + target := g.toFun i.target + baseMap := compose i.baseMap g.toMeetEmbedding + separator := g.toFun i.separator + filter := pushFilter g.toMeetEmbedding i.filter + label := i.label + +theorem transform_identity (i : TaskDatum P Label) : + transform (identityIso P) i = i := by + have hb := meetEmbedding_ext (compose i.baseMap (identityIso P).toMeetEmbedding) + i.baseMap (fun _ => rfl) + have hf : pushFilter (identityIso P).toMeetEmbedding i.filter = i.filter := + meetFilter_ext _ _ (fun x => pushFilter_trace (identityIso P).toMeetEmbedding i.filter x) + unfold transform + rw [hb, hf] + rfl + +theorem transform_composition (g h : MeetIso P P) (i : TaskDatum P Label) : + transform (composeIso g h) i = transform g (transform h i) := by + unfold transform + change TaskDatum.mk i.source (g.toFun (h.toFun i.target)) + (compose i.baseMap (compose h.toMeetEmbedding g.toMeetEmbedding)) + (g.toFun (h.toFun i.separator)) + (pushFilter (compose h.toMeetEmbedding g.toMeetEmbedding) i.filter) i.label = _ + rw [pushFilter_comp] + rfl + +theorem geometry_transform (g : MeetIso P P) (i : TaskDatum P Label) + (valid : i.Geometry) : (transform g i).Geometry where + base_bound x := (g.le_iff _ _).mpr (valid.base_bound x) + base_onto y hy := by + have hy' : P.le (g.inverse y) i.target := by + apply (g.le_iff _ _).mp + rw [g.right_inverse] + exact hy + rcases valid.base_onto (g.inverse y) hy' with ⟨x, hx⟩ + refine ⟨x, ?_⟩ + change g.toFun (i.baseMap.toFun x) = y + rw [hx, g.right_inverse] + base_le_separator := (g.le_iff _ _).mpr valid.base_le_separator + separator_not_le_base h := valid.separator_not_le_base ((g.le_iff _ _).mp h) + separator_le_filter f hf := + pushFilter_lower_bound g.toMeetEmbedding i.filter i.separator + valid.separator_le_filter f hf + +theorem transform_ext (g h : MeetIso P P) (i : TaskDatum P Label) + (target : g.toFun i.target = h.toFun i.target) + (base : ∀ x, g.toFun (i.baseMap.toFun x) = h.toFun (i.baseMap.toFun x)) + (separator : g.toFun i.separator = h.toFun i.separator) + (filter : ∀ y, (pushFilter g.toMeetEmbedding i.filter).mem y ↔ + (pushFilter h.toMeetEmbedding i.filter).mem y) : + transform g i = transform h i := by + have hb := meetEmbedding_ext (compose i.baseMap g.toMeetEmbedding) + (compose i.baseMap h.toMeetEmbedding) base + have hf := meetFilter_ext (pushFilter g.toMeetEmbedding i.filter) + (pushFilter h.toMeetEmbedding i.filter) filter + unfold transform + rw [target, hb, separator, hf] + +theorem transform_agrees (g h : MeetIso P P) (i : TaskDatum P Label) + (valid : i.Geometry) (v : A) (positive : i.filter.mem v) + (agree : ∀ x, P.le x v → g.toFun x = h.toFun x) : + transform g i = transform h i := by + have sep := valid.separator_le_filter v positive + have target := P.trans valid.base_le_separator sep + apply transform_ext g h i + · exact agree i.target target + · intro x + exact agree (i.baseMap.toFun x) (P.trans (valid.base_bound x) target) + · exact agree i.separator sep + · intro y + rw [pushFilter_iso_image, pushFilter_iso_image] + exact filter_images_agree P i.filter g h v positive agree y + +theorem permutations_agree {Task : Type w} (datum : Task → TaskDatum P Label) + (faithful : ∀ i j, datum i = datum j → i = j) + (g h : MeetIso P P) (permG permH : Task → Task) + (transportG : ∀ i, datum (permG i) = transform g (datum i)) + (transportH : ∀ i, datum (permH i) = transform h (datum i)) + (i : Task) (valid : (datum i).Geometry) (v : A) + (positive : (datum i).filter.mem v) + (agree : ∀ x, P.le x v → g.toFun x = h.toFun x) : permG i = permH i := by + apply faithful + rw [transportG, transportH] + exact transform_agrees g h (datum i) valid v positive agree + +theorem representatives_compatible {Task : Type w} (datum : Task → TaskDatum P Label) + (chosen : Task → MeetIso P P) + (represents : ∀ i (x : {x // P.le x (datum i).source}), + (chosen i).toFun x.val = (datum i).baseMap.toFun x) + (g : MeetIso P P) (perm : Task → Task) + (transport : ∀ i, datum (perm i) = transform g (datum i)) + (i : Task) (x : A) (hx : P.le x (datum i).source) : + g.toFun ((chosen i).toFun x) = (chosen (perm i)).toFun x := by + have target := represents (perm i) + rw [transport i] at target + exact (congrArg g.toFun (represents i ⟨x, hx⟩)).trans (target ⟨x, hx⟩).symm + +theorem successor_agreement {O : Type z} {I : Type r} {R : MeetOrder O} + {b : Templates.{z,q,r} R I} {Task : Type w} {d : Inputs b Task} + (s t : TaskSymmetry d) (original : MeetEmbedding P R) + (datum : Task → TaskDatum P Label) + (faithful : ∀ i j, datum i = datum j → i = j) + (valid : ∀ i, (datum i).Geometry) + (g h : MeetIso P P) + (transportG : ∀ i, datum (s.perm i) = transform g (datum i)) + (transportH : ∀ i, datum (t.perm i) = transform h (datum i)) + (T : O) (top : ∀ p, R.le p T) (v : A) + (negative : ∀ i, ¬ (datum i).filter.mem v → + b.extension.le + (b.extension.meet ((d.previous i).toFun T) (.inl (original.toFun v))) + ((d.previous i).toFun (d.source i))) + (ground_agree : ∀ x, P.le x v → g.toFun x = h.toFun x) + (current_agree : ∀ x, b.extension.le x (.inl (original.toFun v)) → + s.current.toFun x = t.current.toFun x) + (x : (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh) + (below : d.nextBatch.extension.le x (.inl (.inl (original.toFun v)))) : + s.nextIso.toFun x = t.nextIso.toFun x := by + apply s.agreement_persists t T top (original.toFun v) + (fun i => (datum i).filter.mem v) negative current_agree + (fun i positive => permutations_agree datum faithful g h s.perm t.perm + transportG transportH i (valid i) v positive ground_agree) x below + +end TaskDatum +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps + +open Attachment + +universe u + +structure GroupData (G : Type u) where + one : G + mul : G → G → G + inv : G → G + assoc : ∀ a b c, mul (mul a b) c = mul a (mul b c) + one_mul : ∀ a, mul one a = a + mul_one : ∀ a, mul a one = a + inv_mul : ∀ a, mul (inv a) a = one + mul_inv : ∀ a, mul a (inv a) = one + +theorem transform_congr {A Label : Type u} {P : MeetOrder A} + (g h : MeetIso P P) (eq : ∀ x, g.toFun x = h.toFun x) (i : TaskDatum P Label) : + TaskDatum.transform g i = TaskDatum.transform h i := by + apply TaskDatum.transform_ext g h i (eq _) (fun x => eq _) (eq _) + intro y + rw [pushFilter_iso_image, pushFilter_iso_image] + constructor + · rintro ⟨f, hf, hfy⟩ + exact ⟨f, hf, (eq f).symm.trans hfy⟩ + · rintro ⟨f, hf, hfy⟩ + exact ⟨f, hf, (eq f).trans hfy⟩ + +structure TaskSystem {A : Type u} (P : MeetOrder A) (G Task Label : Type u) where + group : GroupData G + action : G → MeetIso P P + action_one : ∀ x, (action group.one).toFun x = x + action_mul : ∀ g h x, (action (group.mul g h)).toFun x = + (action g).toFun ((action h).toFun x) + datum : Task → TaskDatum P Label + faithful : ∀ i j, datum i = datum j → i = j + geometry : ∀ i, (datum i).Geometry + invariant : ∀ g i, ∃ j, datum j = TaskDatum.transform (action g) (datum i) + representable : ∀ i, ∃ g, ∀ x : {x // P.le x (datum i).source}, + (action g).toFun x.val = (datum i).baseMap.toFun x + top : A + greatest : ∀ x, P.le x top + source_proper : ∀ i, ¬ P.le top (datum i).source + +namespace TaskSystem + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +noncomputable def perm (g : G) (i : Task) : Task := Classical.choose (f.invariant g i) + +theorem transport (g : G) (i : Task) : + f.datum (f.perm g i) = TaskDatum.transform (f.action g) (f.datum i) := + Classical.choose_spec (f.invariant g i) + +theorem perm_one (i : Task) : f.perm f.group.one i = i := by + apply f.faithful + rw [f.transport] + exact (transform_congr _ (identityIso P) f.action_one _).trans + (TaskDatum.transform_identity _) + +theorem perm_mul (g h : G) (i : Task) : + f.perm (f.group.mul g h) i = f.perm g (f.perm h i) := by + apply f.faithful + rw [f.transport, f.transport, f.transport] + exact (transform_congr _ (composeIso (f.action g) (f.action h)) + (f.action_mul g h) _).trans (TaskDatum.transform_composition _ _ _) + +theorem perm_left (g : G) (i : Task) : f.perm (f.group.inv g) (f.perm g i) = i := by + rw [← f.perm_mul, f.group.inv_mul, f.perm_one] + +theorem perm_right (g : G) (i : Task) : f.perm g (f.perm (f.group.inv g) i) = i := by + rw [← f.perm_mul, f.group.mul_inv, f.perm_one] + +theorem action_left (g : G) (x : A) : + (f.action (f.group.inv g)).toFun ((f.action g).toFun x) = x := by + rw [← f.action_mul, f.group.inv_mul, f.action_one] + +theorem action_right (g : G) (x : A) : + (f.action g).toFun ((f.action (f.group.inv g)).toFun x) = x := by + rw [← f.action_mul, f.group.mul_inv, f.action_one] + +theorem source_invariant (g : G) (i : Task) : + (f.datum (f.perm g i)).source = (f.datum i).source := by + rw [f.transport] + rfl + +noncomputable def representative (i : Task) : G := Classical.choose (f.representable i) + +theorem represents (i : Task) (x : {x // P.le x (f.datum i).source}) : + (f.action (f.representative i)).toFun x.val = (f.datum i).baseMap.toFun x := + Classical.choose_spec (f.representable i) x + +theorem base_top (i : Task) : + (f.datum i).baseMap.toFun ⟨(f.datum i).source, P.refl _⟩ = (f.datum i).target := by + apply P.antisymm + · exact (f.geometry i).base_bound _ + · rcases (f.geometry i).base_onto (f.datum i).target (P.refl _) with ⟨x, hx⟩ + rw [← hx] + exact ((f.datum i).baseMap.le_iff _ _).mpr x.property + +theorem representative_target (i : Task) : + (f.action (f.representative i)).toFun (f.datum i).source = (f.datum i).target := + (f.represents i ⟨_, P.refl _⟩).trans (f.base_top i) + +theorem ground_compatible (g : G) (i : Task) (x : A) + (hx : P.le x (f.datum i).source) : + (f.action g).toFun ((f.action (f.representative i)).toFun x) = + (f.action (f.representative (f.perm g i))).toFun x := + TaskDatum.representatives_compatible f.datum (fun i => f.action (f.representative i)) + f.represents (f.action g) (f.perm g) (f.transport g) i x hx + +theorem positive_perms_agree (g h : G) (v : A) + (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) + (i : Task) (positive : (f.datum i).filter.mem v) : f.perm g i = f.perm h i := + TaskDatum.permutations_agree f.datum f.faithful (f.action g) (f.action h) + (f.perm g) (f.perm h) (f.transport g) (f.transport h) i (f.geometry i) v positive agree + +noncomputable def initial : InitialTasks P Task where + source i := (f.datum i).source + representative i := f.action (f.representative i) + filter i := (f.datum i).filter + separator i := (f.datum i).separator + base_le_separator i := by + rw [f.representative_target] + exact (f.geometry i).base_le_separator + separator_not_le_base i := by + rw [f.representative_target] + exact (f.geometry i).separator_not_le_base + separator_le_filter i := (f.geometry i).separator_le_filter + +theorem filter_covariant (g : G) (i : Task) (x : A) : + (f.datum (f.perm g i)).filter.mem ((f.action g).toFun x) ↔ (f.datum i).filter.mem x := by + rw [f.transport] + exact pushFilter_trace (f.action g).toMeetEmbedding (f.datum i).filter x + +end TaskSystem +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TemplateHeightRangeCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TemplateHeightRangeCodes.lean index 12b70f56c7c26f75c761e5477a5a117a03f65816..1811845703daa9a522ff9dc98b1f4f98cc631e1e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TemplateHeightRangeCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TemplateHeightRangeCodes.lean @@ -1,372 +1,372 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.IntervalSequenceFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSingleAttachment - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing - -universe u - -structure TemplateHeightFamilyInputs - {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) - (Vs vrs Hs : ZFSet.{u}) : Prop where - ranges : FunctionGraphOn I Vs - orders : FunctionGraphOn I vrs - heights : FunctionGraphOn I Hs - linear : ∀ i, StrictLinearOrderCode (ranges.value i) (orders.value i) - function : ∀ i, ZFSet.IsFunc (d.space i) (ranges.value i) (heights.value i) - strict : ∀ i x y a b, ZFSet.pair x y ∈ d.rel i → x ≠ y → - ZFSet.pair x a ∈ heights.value i → ZFSet.pair y b ∈ heights.value i → - ZFSet.pair a b ∈ orders.value i - -noncomputable def componentHeightGraph (I Qs B Hs Cs E C D : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun w => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ g ∈ ⋃₀ ⋃₀ Hs, ∃ f ∈ ⋃₀ ⋃₀ E, - ∃ q ∈ Q, ∃ a ∈ B, ∃ c ∈ C, ∃ z ∈ D, - w = ZFSet.pair (ZFSet.pair i q) (ZFSet.pair c z) ∧ - ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i g ∈ Hs ∧ ZFSet.pair i f ∈ E ∧ - ZFSet.pair i c ∈ Cs ∧ ZFSet.pair q a ∈ g ∧ ZFSet.pair a z ∈ f) - (ZFSet.prod (indexedAttachmentDomain I Qs) (ZFSet.prod C D)) - -theorem componentHeightGraph_shape (I Qs B Hs Cs E C D : ZFSet.{u}) : - componentHeightGraph I Qs B Hs Cs E C D ⊆ - ZFSet.prod (indexedAttachmentDomain I Qs) (ZFSet.prod C D) := - fun _ h => (ZFSet.mem_sep.1 h).1 - -theorem pair_mem_componentHeightGraph (I Qs B Hs Cs E C D i q c z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i q) (ZFSet.pair c z) ∈ componentHeightGraph I Qs B Hs Cs E C D ↔ - i ∈ I ∧ c ∈ C ∧ z ∈ D ∧ ∃ Q g f, ZFSet.pair i Q ∈ Qs ∧ - ZFSet.pair i g ∈ Hs ∧ ZFSet.pair i f ∈ E ∧ q ∈ Q ∧ ZFSet.pair i c ∈ Cs ∧ - ∃ a ∈ B, ZFSet.pair q a ∈ g ∧ ZFSet.pair a z ∈ f := by - constructor - · intro member - obtain ⟨j, hj, Q, _, g, _, f, _, u, hu, a, ha, b, hb, v, hv, - equal, eQ, eg, ef, ec, height, image⟩ := (ZFSet.mem_sep.1 member).2 - obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right - exact ⟨hj, hb, hv, Q, g, f, eQ, eg, ef, hu, ec, a, ha, height, image⟩ - · rintro ⟨hi, hc, hz, Q, g, f, eQ, eg, ef, hq, ec, a, ha, height, image⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 - ⟨(pair_mem_indexedAttachmentDomain I Qs i q).2 ⟨hi, Q, eQ, hq⟩, - ZFSet.pair_mem_prod.2 ⟨hc, hz⟩⟩, - i, hi, Q, pair_second_mem_doubleUnion eQ, g, pair_second_mem_doubleUnion eg, - f, pair_second_mem_doubleUnion ef, q, hq, a, ha, c, hc, z, hz, - rfl, eQ, eg, ef, ec, height, image⟩ - -namespace TemplateHeightFamilyInputs - -variable {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs B Cs E C D : ZFSet.{u}} - {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} - (t : TemplateHeightFamilyInputs d Vs vrs Hs) - -theorem componentHeightGraph_entry_iff (embeddings : FunctionGraphOn I E) - (i : {i : ZFSet.{u} // i ∈ I}) (q c z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i.val q) (ZFSet.pair c z) ∈ componentHeightGraph I Qs B Hs Cs E C D ↔ - q ∈ d.space i ∧ c ∈ C ∧ z ∈ D ∧ ZFSet.pair i.val c ∈ Cs ∧ - ∃ a ∈ B, ZFSet.pair q a ∈ t.heights.value i ∧ ZFSet.pair a z ∈ embeddings.value i := by - rw [pair_mem_componentHeightGraph] - constructor - · rintro ⟨_, hc, hz, Q, g, f, eQ, eg, ef, hq, ec, a, ha, height, image⟩ - have eqQ := d.spaces.unique eQ (d.space_entry i) - have eqg := t.heights.unique eg (t.heights.value_entry i) - have eqf := embeddings.unique ef (embeddings.value_entry i) - exact ⟨eqQ ▸ hq, hc, hz, ec, a, ha, eqg ▸ height, eqf ▸ image⟩ - · rintro ⟨hq, hc, hz, ec, a, ha, height, image⟩ - exact ⟨i.property, hc, hz, d.space i, t.heights.value i, embeddings.value i, - d.space_entry i, t.heights.value_entry i, embeddings.value_entry i, - hq, ec, a, ha, height, image⟩ - -theorem componentHeightGraph_function - (columns : ZFSet.IsFunc I C Cs) (embeddings : FunctionGraphOn I E) - (maps : ∀ i, ZFSet.IsFunc (t.ranges.value i) D (embeddings.value i)) - (bounds : ∀ i, t.ranges.value i ⊆ B) : - ZFSet.IsFunc (indexedAttachmentDomain I Qs) (ZFSet.prod C D) - (componentHeightGraph I Qs B Hs Cs E C D) := by - refine ⟨componentHeightGraph_shape I Qs B Hs Cs E C D, ?_⟩ - intro x hx - obtain ⟨i, hi, q, rfl, Q, eQ, hq⟩ := (mem_indexedAttachmentDomain I Qs x).1 hx - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have qQ : q ∈ d.space j := d.spaces.unique eQ (d.space_entry j) ▸ hq - obtain ⟨a, height, uniqueA⟩ := (t.function j).2 q qQ - have aV := (ZFSet.pair_mem_prod.1 ((t.function j).1 height)).2 - obtain ⟨z, image, uniqueZ⟩ := (maps j).2 a aV - have zD := (ZFSet.pair_mem_prod.1 ((maps j).1 image)).2 - obtain ⟨c, column, uniqueC⟩ := columns.2 i hi - have cC := (ZFSet.pair_mem_prod.1 (columns.1 column)).2 - refine ⟨ZFSet.pair c z, (t.componentHeightGraph_entry_iff embeddings j q c z).2 - ⟨qQ, cC, zD, column, a, bounds j aV, height, image⟩, ?_⟩ - intro y entry - have shape := ZFSet.pair_mem_prod.1 (componentHeightGraph_shape I Qs B Hs Cs E C D entry) - obtain ⟨c', _, z', _, rfl⟩ := ZFSet.mem_prod.1 shape.2 - obtain ⟨_, _, _, column', a', _, height', image'⟩ := - (t.componentHeightGraph_entry_iff embeddings j q c' z').1 entry - have equalA := uniqueA a' height' - exact congrArg₂ ZFSet.pair (uniqueC c' column') (uniqueZ z' (equalA ▸ image')) - -end TemplateHeightFamilyInputs - -noncomputable def taggedHeightGraph (P N H old fresh : ZFSet.{u}) : ZFSet.{u} := - old ∪ ZFSet.sep (fun w => ∃ x ∈ N, ∃ h ∈ H, - w = ZFSet.pair (ZFSet.pair P x) h ∧ ZFSet.pair x h ∈ fresh) - (ZFSet.prod (taggedExtension P N) H) - -theorem taggedHeightGraph_old_entry {P N H old fresh x h : ZFSet.{u}} (hx : x ∈ P) : - ZFSet.pair x h ∈ taggedHeightGraph P N H old fresh ↔ ZFSet.pair x h ∈ old := by - constructor - · intro member - rcases ZFSet.mem_union.1 member with member | member - · exact member - · obtain ⟨q, _, v, _, equal, _⟩ := (ZFSet.mem_sep.1 member).2 - exact False.elim (pair_tag_not_mem P q ((ZFSet.pair_inj.1 equal).1 ▸ hx)) - · exact fun member => ZFSet.mem_union.2 (Or.inl member) - -theorem taggedHeightGraph_fresh_entry {P N H old fresh x h : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P H old) (freshFunction : ZFSet.IsFunc N H fresh) : - ZFSet.pair (ZFSet.pair P x) h ∈ taggedHeightGraph P N H old fresh ↔ - ZFSet.pair x h ∈ fresh := by - constructor - · intro member - rcases ZFSet.mem_union.1 member with member | member - · exact False.elim (pair_tag_not_mem P x (ZFSet.pair_mem_prod.1 (oldFunction.1 member)).1) - · obtain ⟨q, _, v, _, equal, entry⟩ := (ZFSet.mem_sep.1 member).2 - obtain ⟨left, rfl⟩ := ZFSet.pair_inj.1 equal - exact (ZFSet.pair_inj.1 left).2.symm ▸ entry - · intro entry - have shape := ZFSet.pair_mem_prod.1 (freshFunction.1 entry) - exact ZFSet.mem_union.2 (Or.inr (ZFSet.mem_sep.2 - ⟨ZFSet.pair_mem_prod.2 ⟨pair_mem_taggedExtension.2 shape.1, shape.2⟩, - x, shape.1, h, shape.2, rfl, entry⟩)) - -theorem taggedHeightGraph_function {P N H old fresh : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P H old) (freshFunction : ZFSet.IsFunc N H fresh) : - ZFSet.IsFunc (taggedExtension P N) H (taggedHeightGraph P N H old fresh) := by - refine ⟨?_, ?_⟩ - · intro w member - rcases ZFSet.mem_union.1 member with member | member - · obtain ⟨x, hx, h, hh, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 member) - exact ZFSet.pair_mem_prod.2 ⟨old_mem_taggedExtension hx, hh⟩ - · exact (ZFSet.mem_sep.1 member).1 - · intro x hx - rcases mem_taggedExtension.1 hx with old | ⟨q, hq, rfl⟩ - · obtain ⟨h, entry, unique⟩ := oldFunction.2 x old - exact ⟨h, (taggedHeightGraph_old_entry old).2 entry, - fun y hy => unique y ((taggedHeightGraph_old_entry old).1 hy)⟩ - · obtain ⟨h, entry, unique⟩ := freshFunction.2 q hq - exact ⟨h, (taggedHeightGraph_fresh_entry oldFunction freshFunction).2 entry, - fun y hy => unique y ((taggedHeightGraph_fresh_entry oldFunction freshFunction).1 hy)⟩ - -noncomputable def heightOrderRestriction (R r : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ ZFSet.prod R R) r - -theorem pair_mem_heightOrderRestriction (R r a b : ZFSet.{u}) : - ZFSet.pair a b ∈ heightOrderRestriction R r ↔ - ZFSet.pair a b ∈ r ∧ a ∈ R ∧ b ∈ R := by - rw [heightOrderRestriction, ZFSet.mem_sep, ZFSet.pair_mem_prod] - -theorem heightOrderRestriction_linear {B R r : ZFSet.{u}} - (linear : StrictLinearOrderCode B r) (subset : R ⊆ B) : - StrictLinearOrderCode R (heightOrderRestriction R r) := by - refine ⟨fun _ h => (ZFSet.mem_sep.1 h).2, ?_, ?_, ?_⟩ - · intro a ha entry - exact linear.irrefl a (subset ha) (ZFSet.mem_sep.1 entry).1 - · intro a b c first second - obtain ⟨ab, ha, _⟩ := (pair_mem_heightOrderRestriction R r a b).1 first - obtain ⟨bc, _, hc⟩ := (pair_mem_heightOrderRestriction R r b c).1 second - exact (pair_mem_heightOrderRestriction R r a c).2 ⟨linear.trans a b c ab bc, ha, hc⟩ - · intro a ha b hb - rcases linear.compare a (subset ha) b (subset hb) with ab | equal | ba - · exact Or.inl ((pair_mem_heightOrderRestriction R r a b).2 ⟨ab, ha, hb⟩) - · exact Or.inr (Or.inl equal) - · exact Or.inr (Or.inr ((pair_mem_heightOrderRestriction R r b a).2 ⟨ba, hb, ha⟩)) - -theorem function_on_relationImage {A B h : ZFSet.{u}} (function : ZFSet.IsFunc A B h) : - ZFSet.IsFunc A (relationImage A B h) h := by - refine ⟨?_, function.2⟩ - intro z hz - obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨ha, (mem_relationImage A B h b).2 ⟨hb, a, ha, hz⟩⟩ - -def heightImageCandidate (Qs Bs Hs i R : ZFSet.{u}) : Prop := - ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ B ∈ ⋃₀ ⋃₀ Bs, ∃ h ∈ ⋃₀ ⋃₀ Hs, - ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i B ∈ Bs ∧ ZFSet.pair i h ∈ Hs ∧ - R = relationImage Q B h - -def heightOrderCandidate (Rs brs i r : ZFSet.{u}) : Prop := - ∃ R ∈ ⋃₀ ⋃₀ Rs, ∃ s ∈ ⋃₀ ⋃₀ brs, - ZFSet.pair i R ∈ Rs ∧ ZFSet.pair i s ∈ brs ∧ r = heightOrderRestriction R s - -noncomputable def heightImageFamily (I W Qs Bs Hs : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ R ∈ W, - z = ZFSet.pair i R ∧ heightImageCandidate Qs Bs Hs i R) (ZFSet.prod I W) - -noncomputable def heightOrderFamily (I W Rs brs : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ r ∈ W, - z = ZFSet.pair i r ∧ heightOrderCandidate Rs brs i r) (ZFSet.prod I W) - -theorem pair_mem_heightImageFamily (I W Qs Bs Hs i R : ZFSet.{u}) : - ZFSet.pair i R ∈ heightImageFamily I W Qs Bs Hs ↔ - i ∈ I ∧ R ∈ W ∧ heightImageCandidate Qs Bs Hs i R := by - rw [heightImageFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hi, hR⟩, j, _, S, _, equal, candidate⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hi, hR, candidate⟩ - · rintro ⟨hi, hR, candidate⟩ - exact ⟨⟨hi, hR⟩, i, hi, R, hR, rfl, candidate⟩ - -theorem pair_mem_heightOrderFamily (I W Rs brs i r : ZFSet.{u}) : - ZFSet.pair i r ∈ heightOrderFamily I W Rs brs ↔ - i ∈ I ∧ r ∈ W ∧ heightOrderCandidate Rs brs i r := by - rw [heightOrderFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hi, hr⟩, j, _, s, _, equal, candidate⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hi, hr, candidate⟩ - · rintro ⟨hi, hr, candidate⟩ - exact ⟨⟨hi, hr⟩, i, hi, r, hr, rfl, candidate⟩ - -namespace BoundedFormula - -open SetFormula - -def heightImageEquationFormula {n} (R Q B h : Fin n) : BoundedFormula n := - .conj (.allMem R (.conj (.mem 0 B.succ) (imageMemberFormula 0 Q.succ h.succ))) - (.allMem B (imp (imageMemberFormula 0 Q.succ h.succ) (.mem 0 R.succ))) - -theorem truth_heightImageEquationFormula {n} (R Q B h : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (heightImageEquationFormula R Q B h) env ↔ - env R = relationImage (env Q) (env B) (env h) := by - simp only [heightImageEquationFormula, Truth, truth_imp, truth_imageMemberFormula] - change ((∀ x ∈ env R, x ∈ env B ∧ ∃ q ∈ env Q, ZFSet.pair q x ∈ env h) ∧ - (∀ x ∈ env B, (∃ q ∈ env Q, ZFSet.pair q x ∈ env h) → x ∈ env R)) ↔ _ - constructor - · rintro ⟨subset, covers⟩ - apply ZFSet.ext - intro x - rw [mem_relationImage] - exact ⟨subset x, fun hx => covers x hx.1 hx.2⟩ - · intro equal - constructor - · intro x hx - exact (mem_relationImage _ _ _ x).1 (equal ▸ hx) - · intro x hx image - exact equal.symm ▸ (mem_relationImage _ _ _ x).2 ⟨hx, image⟩ - -def heightOrderEquationFormula {n} (r R s : Fin n) : BoundedFormula n := - .conj (.allMem r (.conj (.mem 0 s.succ) (productElementFormula 0 R.succ R.succ))) - (.allMem s (imp (productElementFormula 0 R.succ R.succ) (.mem 0 r.succ))) - -theorem truth_heightOrderEquationFormula {n} (r R s : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (heightOrderEquationFormula r R s) env ↔ - env r = heightOrderRestriction (env R) (env s) := by - simp only [heightOrderEquationFormula, Truth, truth_imp, truth_productElementFormula] - change ((∀ x ∈ env r, x ∈ env s ∧ x ∈ ZFSet.prod (env R) (env R)) ∧ - (∀ x ∈ env s, x ∈ ZFSet.prod (env R) (env R) → x ∈ env r)) ↔ _ - constructor - · rintro ⟨subset, covers⟩ - apply ZFSet.ext - intro x - rw [heightOrderRestriction, ZFSet.mem_sep] - exact ⟨subset x, fun hx => covers x hx.1 hx.2⟩ - · intro equal - constructor - · intro x hx - have member : x ∈ heightOrderRestriction (env R) (env s) := equal ▸ hx - exact ZFSet.mem_sep.1 member - · intro x hx bound - exact equal.symm ▸ ZFSet.mem_sep.2 ⟨hx, bound⟩ - -def heightImageCandidateFormula {n} (Qs Bs Hs i R qb bb hb : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ.succ - exMem qb (exMem bb.succ (exMem hb.succ.succ - (.conj (pairMembershipFormula (lift i) 2 (lift Qs)) - (.conj (pairMembershipFormula (lift i) 1 (lift Bs)) - (.conj (pairMembershipFormula (lift i) 0 (lift Hs)) - (heightImageEquationFormula (lift R) 2 1 0)))))) - -theorem truth_heightImageCandidateFormula {n} (Qs Bs Hs i R qb bb hb : Fin n) - (env : Fin n → ZFSet.{u}) (eqQ : env qb = ⋃₀ ⋃₀ env Qs) - (eqB : env bb = ⋃₀ ⋃₀ env Bs) (eqH : env hb = ⋃₀ ⋃₀ env Hs) : - Truth (heightImageCandidateFormula Qs Bs Hs i R qb bb hb) env ↔ - heightImageCandidate (env Qs) (env Bs) (env Hs) (env i) (env R) := by - simp only [heightImageCandidateFormula, truth_exMem, Truth, - truth_pairMembershipFormula, truth_heightImageEquationFormula] - change (∃ Q ∈ env qb, ∃ B ∈ env bb, ∃ h ∈ env hb, - ZFSet.pair (env i) Q ∈ env Qs ∧ ZFSet.pair (env i) B ∈ env Bs ∧ - ZFSet.pair (env i) h ∈ env Hs ∧ env R = relationImage Q B h) ↔ _ - rw [eqQ, eqB, eqH] - rfl - -def heightOrderCandidateFormula {n} (Rs brs i r rb sb : Fin n) : BoundedFormula n := - exMem rb (exMem sb.succ - (.conj (pairMembershipFormula i.succ.succ 1 Rs.succ.succ) - (.conj (pairMembershipFormula i.succ.succ 0 brs.succ.succ) - (heightOrderEquationFormula r.succ.succ 1 0)))) - -theorem truth_heightOrderCandidateFormula {n} (Rs brs i r rb sb : Fin n) - (env : Fin n → ZFSet.{u}) (eqR : env rb = ⋃₀ ⋃₀ env Rs) - (eqS : env sb = ⋃₀ ⋃₀ env brs) : - Truth (heightOrderCandidateFormula Rs brs i r rb sb) env ↔ - heightOrderCandidate (env Rs) (env brs) (env i) (env r) := by - simp only [heightOrderCandidateFormula, truth_exMem, Truth, - truth_pairMembershipFormula, truth_heightOrderEquationFormula] - change (∃ R ∈ env rb, ∃ s ∈ env sb, - ZFSet.pair (env i) R ∈ env Rs ∧ ZFSet.pair (env i) s ∈ env brs ∧ - env r = heightOrderRestriction R s) ↔ _ - rw [eqR, eqS] - rfl - -def heightImageFamilyEntryFormula {n} (z I W Qs Bs Hs qb bb hb : Fin n) : BoundedFormula n := - exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (heightImageCandidateFormula Qs.succ.succ Bs.succ.succ Hs.succ.succ 1 0 - qb.succ.succ bb.succ.succ hb.succ.succ))) - -theorem truth_heightImageFamilyEntryFormula {n} (z I W Qs Bs Hs qb bb hb : Fin n) - (env : Fin n → ZFSet.{u}) (eqQ : env qb = ⋃₀ ⋃₀ env Qs) - (eqB : env bb = ⋃₀ ⋃₀ env Bs) (eqH : env hb = ⋃₀ ⋃₀ env Hs) : - Truth (heightImageFamilyEntryFormula z I W Qs Bs Hs qb bb hb) env ↔ - ∃ i ∈ env I, ∃ R ∈ env W, env z = ZFSet.pair i R ∧ - heightImageCandidate (env Qs) (env Bs) (env Hs) i R := by - simp only [heightImageFamilyEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - apply exists_congr - intro i - apply and_congr_right - intro _ - apply exists_congr - intro R - apply and_congr_right - intro _ - exact and_congr Iff.rfl (truth_heightImageCandidateFormula Qs.succ.succ Bs.succ.succ - Hs.succ.succ 1 0 qb.succ.succ bb.succ.succ hb.succ.succ - (extend R (extend i env)) eqQ eqB eqH) - -def heightOrderFamilyEntryFormula {n} (z I W Rs brs rb sb : Fin n) : BoundedFormula n := - exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (heightOrderCandidateFormula Rs.succ.succ brs.succ.succ 1 0 rb.succ.succ sb.succ.succ))) - -theorem truth_heightOrderFamilyEntryFormula {n} (z I W Rs brs rb sb : Fin n) - (env : Fin n → ZFSet.{u}) (eqR : env rb = ⋃₀ ⋃₀ env Rs) - (eqS : env sb = ⋃₀ ⋃₀ env brs) : - Truth (heightOrderFamilyEntryFormula z I W Rs brs rb sb) env ↔ - ∃ i ∈ env I, ∃ r ∈ env W, env z = ZFSet.pair i r ∧ - heightOrderCandidate (env Rs) (env brs) i r := by - simp only [heightOrderFamilyEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - apply exists_congr - intro i - apply and_congr_right - intro _ - apply exists_congr - intro r - apply and_congr_right - intro _ - exact and_congr Iff.rfl (truth_heightOrderCandidateFormula Rs.succ.succ brs.succ.succ - 1 0 rb.succ.succ sb.succ.succ (extend r (extend i env)) eqR eqS) - -end BoundedFormula - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.IntervalSequenceFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSingleAttachment + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing + +universe u + +structure TemplateHeightFamilyInputs + {P rP μP I Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss) + (Vs vrs Hs : ZFSet.{u}) : Prop where + ranges : FunctionGraphOn I Vs + orders : FunctionGraphOn I vrs + heights : FunctionGraphOn I Hs + linear : ∀ i, StrictLinearOrderCode (ranges.value i) (orders.value i) + function : ∀ i, ZFSet.IsFunc (d.space i) (ranges.value i) (heights.value i) + strict : ∀ i x y a b, ZFSet.pair x y ∈ d.rel i → x ≠ y → + ZFSet.pair x a ∈ heights.value i → ZFSet.pair y b ∈ heights.value i → + ZFSet.pair a b ∈ orders.value i + +noncomputable def componentHeightGraph (I Qs B Hs Cs E C D : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun w => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ g ∈ ⋃₀ ⋃₀ Hs, ∃ f ∈ ⋃₀ ⋃₀ E, + ∃ q ∈ Q, ∃ a ∈ B, ∃ c ∈ C, ∃ z ∈ D, + w = ZFSet.pair (ZFSet.pair i q) (ZFSet.pair c z) ∧ + ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i g ∈ Hs ∧ ZFSet.pair i f ∈ E ∧ + ZFSet.pair i c ∈ Cs ∧ ZFSet.pair q a ∈ g ∧ ZFSet.pair a z ∈ f) + (ZFSet.prod (indexedAttachmentDomain I Qs) (ZFSet.prod C D)) + +theorem componentHeightGraph_shape (I Qs B Hs Cs E C D : ZFSet.{u}) : + componentHeightGraph I Qs B Hs Cs E C D ⊆ + ZFSet.prod (indexedAttachmentDomain I Qs) (ZFSet.prod C D) := + fun _ h => (ZFSet.mem_sep.1 h).1 + +theorem pair_mem_componentHeightGraph (I Qs B Hs Cs E C D i q c z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i q) (ZFSet.pair c z) ∈ componentHeightGraph I Qs B Hs Cs E C D ↔ + i ∈ I ∧ c ∈ C ∧ z ∈ D ∧ ∃ Q g f, ZFSet.pair i Q ∈ Qs ∧ + ZFSet.pair i g ∈ Hs ∧ ZFSet.pair i f ∈ E ∧ q ∈ Q ∧ ZFSet.pair i c ∈ Cs ∧ + ∃ a ∈ B, ZFSet.pair q a ∈ g ∧ ZFSet.pair a z ∈ f := by + constructor + · intro member + obtain ⟨j, hj, Q, _, g, _, f, _, u, hu, a, ha, b, hb, v, hv, + equal, eQ, eg, ef, ec, height, image⟩ := (ZFSet.mem_sep.1 member).2 + obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right + exact ⟨hj, hb, hv, Q, g, f, eQ, eg, ef, hu, ec, a, ha, height, image⟩ + · rintro ⟨hi, hc, hz, Q, g, f, eQ, eg, ef, hq, ec, a, ha, height, image⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 + ⟨(pair_mem_indexedAttachmentDomain I Qs i q).2 ⟨hi, Q, eQ, hq⟩, + ZFSet.pair_mem_prod.2 ⟨hc, hz⟩⟩, + i, hi, Q, pair_second_mem_doubleUnion eQ, g, pair_second_mem_doubleUnion eg, + f, pair_second_mem_doubleUnion ef, q, hq, a, ha, c, hc, z, hz, + rfl, eQ, eg, ef, ec, height, image⟩ + +namespace TemplateHeightFamilyInputs + +variable {P rP μP I Qs rs μs As Es Fs Ss Vs vrs Hs B Cs E C D : ZFSet.{u}} + {d : AttachmentBatchInputs P rP μP I Qs rs μs As Es Fs Ss} + (t : TemplateHeightFamilyInputs d Vs vrs Hs) + +theorem componentHeightGraph_entry_iff (embeddings : FunctionGraphOn I E) + (i : {i : ZFSet.{u} // i ∈ I}) (q c z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i.val q) (ZFSet.pair c z) ∈ componentHeightGraph I Qs B Hs Cs E C D ↔ + q ∈ d.space i ∧ c ∈ C ∧ z ∈ D ∧ ZFSet.pair i.val c ∈ Cs ∧ + ∃ a ∈ B, ZFSet.pair q a ∈ t.heights.value i ∧ ZFSet.pair a z ∈ embeddings.value i := by + rw [pair_mem_componentHeightGraph] + constructor + · rintro ⟨_, hc, hz, Q, g, f, eQ, eg, ef, hq, ec, a, ha, height, image⟩ + have eqQ := d.spaces.unique eQ (d.space_entry i) + have eqg := t.heights.unique eg (t.heights.value_entry i) + have eqf := embeddings.unique ef (embeddings.value_entry i) + exact ⟨eqQ ▸ hq, hc, hz, ec, a, ha, eqg ▸ height, eqf ▸ image⟩ + · rintro ⟨hq, hc, hz, ec, a, ha, height, image⟩ + exact ⟨i.property, hc, hz, d.space i, t.heights.value i, embeddings.value i, + d.space_entry i, t.heights.value_entry i, embeddings.value_entry i, + hq, ec, a, ha, height, image⟩ + +theorem componentHeightGraph_function + (columns : ZFSet.IsFunc I C Cs) (embeddings : FunctionGraphOn I E) + (maps : ∀ i, ZFSet.IsFunc (t.ranges.value i) D (embeddings.value i)) + (bounds : ∀ i, t.ranges.value i ⊆ B) : + ZFSet.IsFunc (indexedAttachmentDomain I Qs) (ZFSet.prod C D) + (componentHeightGraph I Qs B Hs Cs E C D) := by + refine ⟨componentHeightGraph_shape I Qs B Hs Cs E C D, ?_⟩ + intro x hx + obtain ⟨i, hi, q, rfl, Q, eQ, hq⟩ := (mem_indexedAttachmentDomain I Qs x).1 hx + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have qQ : q ∈ d.space j := d.spaces.unique eQ (d.space_entry j) ▸ hq + obtain ⟨a, height, uniqueA⟩ := (t.function j).2 q qQ + have aV := (ZFSet.pair_mem_prod.1 ((t.function j).1 height)).2 + obtain ⟨z, image, uniqueZ⟩ := (maps j).2 a aV + have zD := (ZFSet.pair_mem_prod.1 ((maps j).1 image)).2 + obtain ⟨c, column, uniqueC⟩ := columns.2 i hi + have cC := (ZFSet.pair_mem_prod.1 (columns.1 column)).2 + refine ⟨ZFSet.pair c z, (t.componentHeightGraph_entry_iff embeddings j q c z).2 + ⟨qQ, cC, zD, column, a, bounds j aV, height, image⟩, ?_⟩ + intro y entry + have shape := ZFSet.pair_mem_prod.1 (componentHeightGraph_shape I Qs B Hs Cs E C D entry) + obtain ⟨c', _, z', _, rfl⟩ := ZFSet.mem_prod.1 shape.2 + obtain ⟨_, _, _, column', a', _, height', image'⟩ := + (t.componentHeightGraph_entry_iff embeddings j q c' z').1 entry + have equalA := uniqueA a' height' + exact congrArg₂ ZFSet.pair (uniqueC c' column') (uniqueZ z' (equalA ▸ image')) + +end TemplateHeightFamilyInputs + +noncomputable def taggedHeightGraph (P N H old fresh : ZFSet.{u}) : ZFSet.{u} := + old ∪ ZFSet.sep (fun w => ∃ x ∈ N, ∃ h ∈ H, + w = ZFSet.pair (ZFSet.pair P x) h ∧ ZFSet.pair x h ∈ fresh) + (ZFSet.prod (taggedExtension P N) H) + +theorem taggedHeightGraph_old_entry {P N H old fresh x h : ZFSet.{u}} (hx : x ∈ P) : + ZFSet.pair x h ∈ taggedHeightGraph P N H old fresh ↔ ZFSet.pair x h ∈ old := by + constructor + · intro member + rcases ZFSet.mem_union.1 member with member | member + · exact member + · obtain ⟨q, _, v, _, equal, _⟩ := (ZFSet.mem_sep.1 member).2 + exact False.elim (pair_tag_not_mem P q ((ZFSet.pair_inj.1 equal).1 ▸ hx)) + · exact fun member => ZFSet.mem_union.2 (Or.inl member) + +theorem taggedHeightGraph_fresh_entry {P N H old fresh x h : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P H old) (freshFunction : ZFSet.IsFunc N H fresh) : + ZFSet.pair (ZFSet.pair P x) h ∈ taggedHeightGraph P N H old fresh ↔ + ZFSet.pair x h ∈ fresh := by + constructor + · intro member + rcases ZFSet.mem_union.1 member with member | member + · exact False.elim (pair_tag_not_mem P x (ZFSet.pair_mem_prod.1 (oldFunction.1 member)).1) + · obtain ⟨q, _, v, _, equal, entry⟩ := (ZFSet.mem_sep.1 member).2 + obtain ⟨left, rfl⟩ := ZFSet.pair_inj.1 equal + exact (ZFSet.pair_inj.1 left).2.symm ▸ entry + · intro entry + have shape := ZFSet.pair_mem_prod.1 (freshFunction.1 entry) + exact ZFSet.mem_union.2 (Or.inr (ZFSet.mem_sep.2 + ⟨ZFSet.pair_mem_prod.2 ⟨pair_mem_taggedExtension.2 shape.1, shape.2⟩, + x, shape.1, h, shape.2, rfl, entry⟩)) + +theorem taggedHeightGraph_function {P N H old fresh : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P H old) (freshFunction : ZFSet.IsFunc N H fresh) : + ZFSet.IsFunc (taggedExtension P N) H (taggedHeightGraph P N H old fresh) := by + refine ⟨?_, ?_⟩ + · intro w member + rcases ZFSet.mem_union.1 member with member | member + · obtain ⟨x, hx, h, hh, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 member) + exact ZFSet.pair_mem_prod.2 ⟨old_mem_taggedExtension hx, hh⟩ + · exact (ZFSet.mem_sep.1 member).1 + · intro x hx + rcases mem_taggedExtension.1 hx with old | ⟨q, hq, rfl⟩ + · obtain ⟨h, entry, unique⟩ := oldFunction.2 x old + exact ⟨h, (taggedHeightGraph_old_entry old).2 entry, + fun y hy => unique y ((taggedHeightGraph_old_entry old).1 hy)⟩ + · obtain ⟨h, entry, unique⟩ := freshFunction.2 q hq + exact ⟨h, (taggedHeightGraph_fresh_entry oldFunction freshFunction).2 entry, + fun y hy => unique y ((taggedHeightGraph_fresh_entry oldFunction freshFunction).1 hy)⟩ + +noncomputable def heightOrderRestriction (R r : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ ZFSet.prod R R) r + +theorem pair_mem_heightOrderRestriction (R r a b : ZFSet.{u}) : + ZFSet.pair a b ∈ heightOrderRestriction R r ↔ + ZFSet.pair a b ∈ r ∧ a ∈ R ∧ b ∈ R := by + rw [heightOrderRestriction, ZFSet.mem_sep, ZFSet.pair_mem_prod] + +theorem heightOrderRestriction_linear {B R r : ZFSet.{u}} + (linear : StrictLinearOrderCode B r) (subset : R ⊆ B) : + StrictLinearOrderCode R (heightOrderRestriction R r) := by + refine ⟨fun _ h => (ZFSet.mem_sep.1 h).2, ?_, ?_, ?_⟩ + · intro a ha entry + exact linear.irrefl a (subset ha) (ZFSet.mem_sep.1 entry).1 + · intro a b c first second + obtain ⟨ab, ha, _⟩ := (pair_mem_heightOrderRestriction R r a b).1 first + obtain ⟨bc, _, hc⟩ := (pair_mem_heightOrderRestriction R r b c).1 second + exact (pair_mem_heightOrderRestriction R r a c).2 ⟨linear.trans a b c ab bc, ha, hc⟩ + · intro a ha b hb + rcases linear.compare a (subset ha) b (subset hb) with ab | equal | ba + · exact Or.inl ((pair_mem_heightOrderRestriction R r a b).2 ⟨ab, ha, hb⟩) + · exact Or.inr (Or.inl equal) + · exact Or.inr (Or.inr ((pair_mem_heightOrderRestriction R r b a).2 ⟨ba, hb, ha⟩)) + +theorem function_on_relationImage {A B h : ZFSet.{u}} (function : ZFSet.IsFunc A B h) : + ZFSet.IsFunc A (relationImage A B h) h := by + refine ⟨?_, function.2⟩ + intro z hz + obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨ha, (mem_relationImage A B h b).2 ⟨hb, a, ha, hz⟩⟩ + +def heightImageCandidate (Qs Bs Hs i R : ZFSet.{u}) : Prop := + ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ B ∈ ⋃₀ ⋃₀ Bs, ∃ h ∈ ⋃₀ ⋃₀ Hs, + ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i B ∈ Bs ∧ ZFSet.pair i h ∈ Hs ∧ + R = relationImage Q B h + +def heightOrderCandidate (Rs brs i r : ZFSet.{u}) : Prop := + ∃ R ∈ ⋃₀ ⋃₀ Rs, ∃ s ∈ ⋃₀ ⋃₀ brs, + ZFSet.pair i R ∈ Rs ∧ ZFSet.pair i s ∈ brs ∧ r = heightOrderRestriction R s + +noncomputable def heightImageFamily (I W Qs Bs Hs : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ R ∈ W, + z = ZFSet.pair i R ∧ heightImageCandidate Qs Bs Hs i R) (ZFSet.prod I W) + +noncomputable def heightOrderFamily (I W Rs brs : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ r ∈ W, + z = ZFSet.pair i r ∧ heightOrderCandidate Rs brs i r) (ZFSet.prod I W) + +theorem pair_mem_heightImageFamily (I W Qs Bs Hs i R : ZFSet.{u}) : + ZFSet.pair i R ∈ heightImageFamily I W Qs Bs Hs ↔ + i ∈ I ∧ R ∈ W ∧ heightImageCandidate Qs Bs Hs i R := by + rw [heightImageFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hi, hR⟩, j, _, S, _, equal, candidate⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hi, hR, candidate⟩ + · rintro ⟨hi, hR, candidate⟩ + exact ⟨⟨hi, hR⟩, i, hi, R, hR, rfl, candidate⟩ + +theorem pair_mem_heightOrderFamily (I W Rs brs i r : ZFSet.{u}) : + ZFSet.pair i r ∈ heightOrderFamily I W Rs brs ↔ + i ∈ I ∧ r ∈ W ∧ heightOrderCandidate Rs brs i r := by + rw [heightOrderFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hi, hr⟩, j, _, s, _, equal, candidate⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hi, hr, candidate⟩ + · rintro ⟨hi, hr, candidate⟩ + exact ⟨⟨hi, hr⟩, i, hi, r, hr, rfl, candidate⟩ + +namespace BoundedFormula + +open SetFormula + +def heightImageEquationFormula {n} (R Q B h : Fin n) : BoundedFormula n := + .conj (.allMem R (.conj (.mem 0 B.succ) (imageMemberFormula 0 Q.succ h.succ))) + (.allMem B (imp (imageMemberFormula 0 Q.succ h.succ) (.mem 0 R.succ))) + +theorem truth_heightImageEquationFormula {n} (R Q B h : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (heightImageEquationFormula R Q B h) env ↔ + env R = relationImage (env Q) (env B) (env h) := by + simp only [heightImageEquationFormula, Truth, truth_imp, truth_imageMemberFormula] + change ((∀ x ∈ env R, x ∈ env B ∧ ∃ q ∈ env Q, ZFSet.pair q x ∈ env h) ∧ + (∀ x ∈ env B, (∃ q ∈ env Q, ZFSet.pair q x ∈ env h) → x ∈ env R)) ↔ _ + constructor + · rintro ⟨subset, covers⟩ + apply ZFSet.ext + intro x + rw [mem_relationImage] + exact ⟨subset x, fun hx => covers x hx.1 hx.2⟩ + · intro equal + constructor + · intro x hx + exact (mem_relationImage _ _ _ x).1 (equal ▸ hx) + · intro x hx image + exact equal.symm ▸ (mem_relationImage _ _ _ x).2 ⟨hx, image⟩ + +def heightOrderEquationFormula {n} (r R s : Fin n) : BoundedFormula n := + .conj (.allMem r (.conj (.mem 0 s.succ) (productElementFormula 0 R.succ R.succ))) + (.allMem s (imp (productElementFormula 0 R.succ R.succ) (.mem 0 r.succ))) + +theorem truth_heightOrderEquationFormula {n} (r R s : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (heightOrderEquationFormula r R s) env ↔ + env r = heightOrderRestriction (env R) (env s) := by + simp only [heightOrderEquationFormula, Truth, truth_imp, truth_productElementFormula] + change ((∀ x ∈ env r, x ∈ env s ∧ x ∈ ZFSet.prod (env R) (env R)) ∧ + (∀ x ∈ env s, x ∈ ZFSet.prod (env R) (env R) → x ∈ env r)) ↔ _ + constructor + · rintro ⟨subset, covers⟩ + apply ZFSet.ext + intro x + rw [heightOrderRestriction, ZFSet.mem_sep] + exact ⟨subset x, fun hx => covers x hx.1 hx.2⟩ + · intro equal + constructor + · intro x hx + have member : x ∈ heightOrderRestriction (env R) (env s) := equal ▸ hx + exact ZFSet.mem_sep.1 member + · intro x hx bound + exact equal.symm ▸ ZFSet.mem_sep.2 ⟨hx, bound⟩ + +def heightImageCandidateFormula {n} (Qs Bs Hs i R qb bb hb : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ.succ + exMem qb (exMem bb.succ (exMem hb.succ.succ + (.conj (pairMembershipFormula (lift i) 2 (lift Qs)) + (.conj (pairMembershipFormula (lift i) 1 (lift Bs)) + (.conj (pairMembershipFormula (lift i) 0 (lift Hs)) + (heightImageEquationFormula (lift R) 2 1 0)))))) + +theorem truth_heightImageCandidateFormula {n} (Qs Bs Hs i R qb bb hb : Fin n) + (env : Fin n → ZFSet.{u}) (eqQ : env qb = ⋃₀ ⋃₀ env Qs) + (eqB : env bb = ⋃₀ ⋃₀ env Bs) (eqH : env hb = ⋃₀ ⋃₀ env Hs) : + Truth (heightImageCandidateFormula Qs Bs Hs i R qb bb hb) env ↔ + heightImageCandidate (env Qs) (env Bs) (env Hs) (env i) (env R) := by + simp only [heightImageCandidateFormula, truth_exMem, Truth, + truth_pairMembershipFormula, truth_heightImageEquationFormula] + change (∃ Q ∈ env qb, ∃ B ∈ env bb, ∃ h ∈ env hb, + ZFSet.pair (env i) Q ∈ env Qs ∧ ZFSet.pair (env i) B ∈ env Bs ∧ + ZFSet.pair (env i) h ∈ env Hs ∧ env R = relationImage Q B h) ↔ _ + rw [eqQ, eqB, eqH] + rfl + +def heightOrderCandidateFormula {n} (Rs brs i r rb sb : Fin n) : BoundedFormula n := + exMem rb (exMem sb.succ + (.conj (pairMembershipFormula i.succ.succ 1 Rs.succ.succ) + (.conj (pairMembershipFormula i.succ.succ 0 brs.succ.succ) + (heightOrderEquationFormula r.succ.succ 1 0)))) + +theorem truth_heightOrderCandidateFormula {n} (Rs brs i r rb sb : Fin n) + (env : Fin n → ZFSet.{u}) (eqR : env rb = ⋃₀ ⋃₀ env Rs) + (eqS : env sb = ⋃₀ ⋃₀ env brs) : + Truth (heightOrderCandidateFormula Rs brs i r rb sb) env ↔ + heightOrderCandidate (env Rs) (env brs) (env i) (env r) := by + simp only [heightOrderCandidateFormula, truth_exMem, Truth, + truth_pairMembershipFormula, truth_heightOrderEquationFormula] + change (∃ R ∈ env rb, ∃ s ∈ env sb, + ZFSet.pair (env i) R ∈ env Rs ∧ ZFSet.pair (env i) s ∈ env brs ∧ + env r = heightOrderRestriction R s) ↔ _ + rw [eqR, eqS] + rfl + +def heightImageFamilyEntryFormula {n} (z I W Qs Bs Hs qb bb hb : Fin n) : BoundedFormula n := + exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (heightImageCandidateFormula Qs.succ.succ Bs.succ.succ Hs.succ.succ 1 0 + qb.succ.succ bb.succ.succ hb.succ.succ))) + +theorem truth_heightImageFamilyEntryFormula {n} (z I W Qs Bs Hs qb bb hb : Fin n) + (env : Fin n → ZFSet.{u}) (eqQ : env qb = ⋃₀ ⋃₀ env Qs) + (eqB : env bb = ⋃₀ ⋃₀ env Bs) (eqH : env hb = ⋃₀ ⋃₀ env Hs) : + Truth (heightImageFamilyEntryFormula z I W Qs Bs Hs qb bb hb) env ↔ + ∃ i ∈ env I, ∃ R ∈ env W, env z = ZFSet.pair i R ∧ + heightImageCandidate (env Qs) (env Bs) (env Hs) i R := by + simp only [heightImageFamilyEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + apply exists_congr + intro i + apply and_congr_right + intro _ + apply exists_congr + intro R + apply and_congr_right + intro _ + exact and_congr Iff.rfl (truth_heightImageCandidateFormula Qs.succ.succ Bs.succ.succ + Hs.succ.succ 1 0 qb.succ.succ bb.succ.succ hb.succ.succ + (extend R (extend i env)) eqQ eqB eqH) + +def heightOrderFamilyEntryFormula {n} (z I W Rs brs rb sb : Fin n) : BoundedFormula n := + exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (heightOrderCandidateFormula Rs.succ.succ brs.succ.succ 1 0 rb.succ.succ sb.succ.succ))) + +theorem truth_heightOrderFamilyEntryFormula {n} (z I W Rs brs rb sb : Fin n) + (env : Fin n → ZFSet.{u}) (eqR : env rb = ⋃₀ ⋃₀ env Rs) + (eqS : env sb = ⋃₀ ⋃₀ env brs) : + Truth (heightOrderFamilyEntryFormula z I W Rs brs rb sb) env ↔ + ∃ i ∈ env I, ∃ r ∈ env W, env z = ZFSet.pair i r ∧ + heightOrderCandidate (env Rs) (env brs) i r := by + simp only [heightOrderFamilyEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + apply exists_congr + intro i + apply and_congr_right + intro _ + apply exists_congr + intro r + apply and_congr_right + intro _ + exact and_congr Iff.rfl (truth_heightOrderCandidateFormula Rs.succ.succ brs.succ.succ + 1 0 rb.succ.succ sb.succ.succ (extend r (extend i env)) eqR eqS) + +end BoundedFormula + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileStarIncomingCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileStarIncomingCodes.lean index 8b8db75b468bdafcf3a26566c27257bafd126f4a..4c6a503317e8948b14006df35fbb5a6f23d179bd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileStarIncomingCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileStarIncomingCodes.lean @@ -1,849 +1,849 @@ -import Mathlib.Data.List.Chain -import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordMapCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedClassInclusions -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundNaturalRecursion - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -def FiniteRelationPathCode (omega A R x y t : ZFSet.{u}) : Prop := - ∃ n ∈ omega, ∃ d ∈ omega, d = insert n n ∧ - IterationTraceCode n d A R x t ∧ ZFSet.pair n y ∈ t - -theorem IterationTraceCode.reflTransGen {B : Type u} (s : Presentation B) - (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - {n : Nat} {t : ZFSet.{u}} {x : B} - (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier R - (s.encode x) t) : - ∀ k ≤ n, ∀ y, ZFSet.pair (natSetCode k) (s.encode y) ∈ t → - Relation.ReflTransGen r x y := by - intro k - induction k with - | zero => - intro _ y entry - have same := (show FunctionGraphOn (natSetCode (n + 1)) t from - ⟨s.carrier, trace.function⟩).unique trace.seed entry - have equal : x = y := s.injective same - subst y - exact .refl - | succ k ih => - intro hk y entry - have domain := (natSetCode_mem_iff k (n + 1)).2 (by omega) - obtain ⟨a, prev, _⟩ := trace.function.2 (natSetCode k) domain - have ha := (ZFSet.pair_mem_prod.1 (trace.function.1 prev)).2 - obtain ⟨b, eq⟩ := (s.mem_carrier a).1 ha - have previous : ZFSet.pair (natSetCode k) (s.encode b) ∈ t := eq.symm ▸ prev - have step := trace.next (natSetCode k) ((natSetCode_mem_iff k n).2 (by omega)) - (natSetCode (k + 1)) ((natSetCode_mem_iff _ _).2 (by omega)) - _ (s.encode_mem b) _ (s.encode_mem y) rfl previous entry - exact (ih (by omega) b previous).tail ((edges b y).1 step) - -theorem FiniteRelationPathCode.reflTransGen {B : Type u} (s : Presentation B) - (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - {x y : B} {t : ZFSet.{u}} - (path : FiniteRelationPathCode ZFSet.omega s.carrier R (s.encode x) (s.encode y) t) : - Relation.ReflTransGen r x y := by - obtain ⟨n, hn, d, _, succ, trace, out⟩ := path - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have dcode : d = natSetCode (n + 1) := succ - exact (dcode ▸ trace).reflTransGen s r edges n (Nat.le_refl n) y out - -theorem finiteWordGraph_chain_trace {B : Type u} (s : Presentation B) - (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - (x : B) (xs : List B) (chain : List.IsChain r (x :: xs)) : - IterationTraceCode (natSetCode xs.length) (natSetCode (xs.length + 1)) - s.carrier R (s.encode x) (finiteWordGraph s (x :: xs)) := by - refine ⟨?_, ?_, ?_⟩ - · simpa only [List.length_cons] using finiteWordGraph_function s (x :: xs) - · apply (pair_mem_finiteWordGraph s (x :: xs) 0 _).2 - exact ⟨by simp, rfl⟩ - · intro i hi j _ a _ b _ succ prev next - obtain ⟨k, hk, rfl⟩ := (mem_natSetCode i xs.length).1 hi - have jcode : j = natSetCode (k + 1) := succ - obtain ⟨_, avalue⟩ := (pair_mem_finiteWordGraph s (x :: xs) k a).1 prev - obtain ⟨_, bvalue⟩ := (pair_mem_finiteWordGraph s (x :: xs) (k + 1) b).1 (jcode ▸ next) - rw [avalue, bvalue, edges] - simpa only [List.get_eq_getElem] using - chain.getElem k (by simpa only [List.length_cons] using Nat.succ_lt_succ hk) - -theorem finiteWordGraph_chain_path {B : Type u} (s : Presentation B) - (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - (x : B) (xs : List B) (chain : List.IsChain r (x :: xs)) : - FiniteRelationPathCode ZFSet.omega s.carrier R (s.encode x) - (s.encode ((x :: xs).getLast (List.cons_ne_nil _ _))) - (finiteWordGraph s (x :: xs)) := by - refine ⟨natSetCode xs.length, natSetCode_mem_omega _, natSetCode (xs.length + 1), - natSetCode_mem_omega _, rfl, finiteWordGraph_chain_trace s r edges x xs chain, ?_⟩ - apply (pair_mem_finiteWordGraph s (x :: xs) xs.length _).2 - refine ⟨by simp, ?_⟩ - simp only [List.get_eq_getElem, List.getLast_eq_getElem, List.length_cons, Nat.add_sub_cancel] - -theorem reflTransGen_iff_finiteWordGraph_path {B : Type u} (s : Presentation B) - (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) (x y : B) : - Relation.ReflTransGen r x y ↔ ∃ xs : List B, - FiniteRelationPathCode ZFSet.omega s.carrier R (s.encode x) (s.encode y) - (finiteWordGraph s xs) := by - constructor - · intro path - obtain ⟨xs, chain, last⟩ := List.exists_isChain_cons_of_relationReflTransGen path - exact ⟨x :: xs, last ▸ finiteWordGraph_chain_path s r edges x xs chain⟩ - · rintro ⟨xs, code⟩ - exact code.reflTransGen s r edges - - - - - -inductive RelationPathSteps {B : Type u} (r : B → B → Prop) : Nat → B → B → Prop - | nil (x : B) : RelationPathSteps r 0 x x - | tail {n : Nat} {x y z : B} : RelationPathSteps r n x y → r y z → RelationPathSteps r (n + 1) x z - -theorem chain_append_last {B : Type u} {r : B → B → Prop} {x z : B} {xs : List B} - (chain : List.IsChain r (x :: xs)) (edge : r ((x :: xs).getLast (List.cons_ne_nil _ _)) z) : - List.IsChain r (x :: (xs ++ [z])) := by - induction xs generalizing x with - | nil => exact .cons_cons edge (.singleton _) - | cons next rest ih => - obtain ⟨first, tail⟩ := List.isChain_cons_cons.mp chain - exact .cons_cons first (ih tail (by simpa only [List.getLast_cons_cons] using edge)) - -namespace RelationPathSteps -variable {B : Type u} {r : B → B → Prop} {n : Nat} {x y z : B} - -theorem append {m : Nat} (first : RelationPathSteps r n x y) (second : RelationPathSteps r m y z) : - RelationPathSteps r (n + m) x z := by - induction second with - | nil => exact first - | tail previous edge ih => exact .tail (ih first) edge - -theorem cons (edge : r x y) (path : RelationPathSteps r n y z) : RelationPathSteps r (n + 1) x z := by - simpa only [Nat.add_comm] using (RelationPathSteps.tail (RelationPathSteps.nil x) edge).append path - -theorem chain (path : RelationPathSteps r n x y) : - ∃ xs : List B, List.IsChain r (x :: xs) ∧ - (x :: xs).getLast (List.cons_ne_nil _ _) = y ∧ xs.length = n := by - induction path with - | nil x => exact ⟨[], .singleton _, rfl, rfl⟩ - | @tail n x y z previous edge ih => - obtain ⟨xs, chain, last, length⟩ := ih - refine ⟨xs ++ [z], chain_append_last chain (last.symm ▸ edge), ?_, ?_⟩ - · simp - · simp only [List.length_append, List.length_singleton, length] - -end RelationPathSteps - -theorem IterationTraceCode.pathSteps {B : Type u} (s : Presentation B) - (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - {n : Nat} {t : ZFSet.{u}} {x : B} - (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier R (s.encode x) t) : - ∀ k ≤ n, ∀ y, ZFSet.pair (natSetCode k) (s.encode y) ∈ t → RelationPathSteps r k x y := by - intro k - induction k with - | zero => - intro _ y entry - have same := (show FunctionGraphOn (natSetCode (n + 1)) t from ⟨s.carrier, trace.function⟩).unique trace.seed entry - have equal := s.injective same - subst y - exact .nil x - | succ k ih => - intro hk y entry - obtain ⟨a, prev, _⟩ := trace.function.2 (natSetCode k) ((natSetCode_mem_iff _ _).2 (by omega)) - obtain ⟨b, equal⟩ := (s.mem_carrier a).1 (ZFSet.pair_mem_prod.1 (trace.function.1 prev)).2 - have previous : ZFSet.pair (natSetCode k) (s.encode b) ∈ t := equal.symm ▸ prev - have edge := trace.next (natSetCode k) ((natSetCode_mem_iff _ _).2 (by omega)) - (natSetCode (k + 1)) ((natSetCode_mem_iff _ _).2 (by omega)) - _ (s.encode_mem b) _ (s.encode_mem y) rfl previous entry - exact .tail (ih (by omega) b previous) ((edges b y).1 edge) - -theorem RelationPathSteps.exists_trace {B : Type u} (s : Presentation B) - (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - {n : Nat} {x y : B} (path : RelationPathSteps r n x y) : - ∃ xs : List B, IterationTraceCode (natSetCode n) (natSetCode (n + 1)) - s.carrier R (s.encode x) (finiteWordGraph s xs) ∧ ZFSet.pair (natSetCode n) (s.encode y) ∈ finiteWordGraph s xs := by - obtain ⟨xs, chain, last, rfl⟩ := path.chain - refine ⟨x :: xs, finiteWordGraph_chain_trace s r edges x xs chain, ?_⟩ - apply (pair_mem_finiteWordGraph s (x :: xs) xs.length _).2 - refine ⟨by simp, ?_⟩ - rw [← last] - simp only [List.get_eq_getElem, List.getLast_eq_getElem, List.length_cons, Nat.add_sub_cancel] - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace BoundedFormula - -def finiteRelationPathFormula {k} (omega A R x y t zero : Fin k) : BoundedFormula k := - exMem omega (exMem omega.succ (.conj (successorFormula 0 1) - (.conj (iterationTraceFormula 1 0 A.succ.succ R.succ.succ x.succ.succ - t.succ.succ zero.succ.succ) (pairMembershipFormula 1 y.succ.succ t.succ.succ)))) - -theorem truth_finiteRelationPathFormula {k} (omega A R x y t zero : Fin k) - (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : - Truth (finiteRelationPathFormula omega A R x y t zero) env ↔ - FiniteRelationPathCode (env omega) (env A) (env R) (env x) (env y) (env t) := by - simp only [finiteRelationPathFormula, truth_exMem, Truth, truth_successorFormula, - truth_pairMembershipFormula, FiniteRelationPathCode] - apply exists_congr - intro n - apply and_congr_right - intro _ - apply exists_congr - intro d - apply and_congr_right - intro _ - exact and_congr Iff.rfl (and_congr - (truth_iterationTraceFormula _ _ _ _ _ _ _ _ (by exact hzero)) Iff.rfl) - -def finitePathClosureEntryFormula {k} (z A R omega paths zero : Fin k) : BoundedFormula k := - exMem A (exMem A.succ (exMem paths.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 1) - (finiteRelationPathFormula omega.succ.succ.succ A.succ.succ.succ - R.succ.succ.succ 2 1 0 zero.succ.succ.succ)))) - -theorem truth_finitePathClosureEntryFormula {k} (z A R omega paths zero : Fin k) - (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : - Truth (finitePathClosureEntryFormula z A R omega paths zero) env ↔ - ∃ x ∈ env A, ∃ y ∈ env A, ∃ t ∈ env paths, - env z = ZFSet.pair x y ∧ - FiniteRelationPathCode (env omega) (env A) (env R) x y t := by - simp only [finitePathClosureEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] - apply exists_congr - intro x - apply and_congr_right - intro _ - apply exists_congr - intro y - apply and_congr_right - intro _ - apply exists_congr - intro t - apply and_congr_right - intro _ - exact and_congr Iff.rfl - (truth_finiteRelationPathFormula _ _ _ _ _ _ _ _ (by exact hzero)) - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def finitePathClosure (A R : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ A, ∃ t ∈ M.finiteWords A, - z = ZFSet.pair x y ∧ FiniteRelationPathCode ZFSet.omega A R x y t) (ZFSet.prod A A) - -theorem pair_mem_finitePathClosure_iff (A R x y : ZFSet.{u}) : - ZFSet.pair x y ∈ M.finitePathClosure A R ↔ - x ∈ A ∧ y ∈ A ∧ ∃ t ∈ M.finiteWords A, FiniteRelationPathCode ZFSet.omega A R x y t := by - rw [finitePathClosure, ZFSet.mem_sep] - constructor - · rintro ⟨_, a, ha, b, hb, t, ht, eq, code⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨ha, hb, t, ht, code⟩ - · rintro ⟨hx, hy, t, ht, code⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, t, ht, rfl, code⟩ - -theorem finitePathClosure_subset (A R : ZFSet.{u}) : - M.finitePathClosure A R ⊆ ZFSet.prod A A := - fun _ h => (ZFSet.mem_sep.1 h).1 - -theorem finitePathClosure_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A R : ZFSet.{u}} (hA : A ∈ M.sets) (hR : R ∈ M.sets) : - M.finitePathClosure A R ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - have hPaths := M.finiteWords_mem pairing unions powers separation infinite hA - have hZero := M.empty_mem ⟨A, hA⟩ - let params := extend A (extend R (extend ZFSet.omega (extend (M.finiteWords A) - (extend ∅ Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.finitePathClosureEntryFormula 0 1 2 3 4 5) params - (Fin.cases hA (Fin.cases hR (Fin.cases hOmega (Fin.cases hPaths - (Fin.cases hZero (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hA hA) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.finitePathClosureEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod A A) = M.finitePathClosure A R := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, finitePathClosure, ZFSet.mem_sep] - exact and_congr Iff.rfl - (BoundedFormula.truth_finitePathClosureEntryFormula _ _ _ _ _ _ _ rfl) - exact equal ▸ selected - -theorem pair_mem_finitePathClosure - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {B : Type u} (s : Presentation B) (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - (hB : s.carrier ∈ M.sets) (x y : B) : - ZFSet.pair (s.encode x) (s.encode y) ∈ M.finitePathClosure s.carrier R ↔ - Relation.ReflTransGen r x y := by - rw [M.pair_mem_finitePathClosure_iff] - constructor - · rintro ⟨_, _, t, _, code⟩ - exact code.reflTransGen s r edges - · intro path - obtain ⟨xs, code⟩ := (reflTransGen_iff_finiteWordGraph_path s r edges x y).1 path - exact ⟨s.encode_mem x, s.encode_mem y, finiteWordGraph s xs, - finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, code⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {B : Type u} (s : Presentation B) (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - (hB : s.carrier ∈ M.sets) - -include pairing unions separation infinite edges hB in -theorem finitePathClosure_equivalence (symmetric : ∀ ⦃left right⦄, r left right → r right left) : - EquivalenceRelationCode s.carrier (M.finitePathClosure s.carrier R) := by - let : Std.Symm r := ⟨fun _ _ related => symmetric related⟩ - have exactPath := M.pair_mem_finitePathClosure pairing unions separation infinite s r edges hB - refine ⟨M.finitePathClosure_subset s.carrier R, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - exact (exactPath a a).2 .refl - · intro x y xy - obtain ⟨hx, hy, _⟩ := (M.pair_mem_finitePathClosure_iff s.carrier R x y).1 xy - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy - exact (exactPath b a).2 (symm ((exactPath a b).1 xy)) - · intro x y z xy yz - obtain ⟨hx, hy, _⟩ := (M.pair_mem_finitePathClosure_iff s.carrier R x y).1 xy - have hz := ((M.pair_mem_finitePathClosure_iff s.carrier R y z).1 yz).2.1 - obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨c, rfl⟩ := (s.mem_carrier z).1 hz - exact (exactPath a c).2 (((exactPath a b).1 xy).trans ((exactPath b c).1 yz)) - -include pairing unions separation infinite edges hB in -theorem finitePathQuotient_spec - (powers : Realize M.sets powerSet Fin.elim0) (hR : R ∈ M.sets) - (symmetric : ∀ ⦃left right⦄, r left right → r right left) : - let E := M.finitePathClosure s.carrier R - E ∈ M.sets ∧ EquivalenceRelationCode s.carrier E ∧ - equivalenceClasses s.carrier E ∈ M.sets ∧ equivalenceClassifier s.carrier E ∈ M.sets ∧ - ZFSet.IsFunc s.carrier (equivalenceClasses s.carrier E) (equivalenceClassifier s.carrier E) ∧ - (∀ C ∈ equivalenceClasses s.carrier E, ∃ x ∈ s.carrier, - ZFSet.pair x C ∈ equivalenceClassifier s.carrier E) ∧ - (∀ x y C D, ZFSet.pair x C ∈ equivalenceClassifier s.carrier E → - ZFSet.pair y D ∈ equivalenceClassifier s.carrier E → (C = D ↔ ZFSet.pair x y ∈ E)) := by - dsimp only - have ground := M.finitePathClosure_mem pairing unions powers separation infinite hB hR - have equivalence := M.finitePathClosure_equivalence pairing unions separation infinite s r edges hB symmetric - exact ⟨ground, equivalence, - M.equivalenceClasses_spec pairing unions powers separation hB ground equivalence⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def relationPathLengths (A R root : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ y ∈ A, ∃ d ∈ ZFSet.omega, ∃ t ∈ M.finiteWords A, - z = ZFSet.pair n y ∧ d = insert n n ∧ IterationTraceCode n d A R root t ∧ ZFSet.pair n y ∈ t) - (ZFSet.prod ZFSet.omega A) - -theorem pair_mem_relationPathLengths (A R root n y : ZFSet.{u}) : - ZFSet.pair n y ∈ M.relationPathLengths A R root ↔ n ∈ ZFSet.omega ∧ y ∈ A ∧ - ∃ d ∈ ZFSet.omega, ∃ t ∈ M.finiteWords A, - d = insert n n ∧ IterationTraceCode n d A R root t ∧ ZFSet.pair n y ∈ t := by - rw [relationPathLengths, ZFSet.mem_sep] - constructor - · rintro ⟨_, n', hn, y', hy, d, hd, t, ht, equal, succ, trace, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hn, hy, d, hd, t, ht, succ, trace, entry⟩ - · rintro ⟨hn, hy, d, hd, t, ht, succ, trace, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hn, hy⟩, n, hn, y, hy, d, hd, t, ht, rfl, succ, trace, entry⟩ - -theorem relationPathLengths_subset (A R root : ZFSet.{u}) : - M.relationPathLengths A R root ⊆ ZFSet.prod ZFSet.omega A := fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem relationPathLengths_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A R root : ZFSet.{u}} (hA : A ∈ M.sets) (hR : R ∈ M.sets) (hRoot : root ∈ M.sets) : - M.relationPathLengths A R root ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - have hPaths := M.finiteWords_mem pairing unions powers separation infinite hA - have hZero := M.empty_mem ⟨A, hA⟩ - let params := extend ZFSet.omega (extend A (extend R (extend root (extend (M.finiteWords A) (extend ∅ Fin.elim0))))) - have selected := M.bounded_separation_mem separation (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) - params (Fin.cases hOmega (Fin.cases hA (Fin.cases hR (Fin.cases hRoot (Fin.cases hPaths - (Fin.cases hZero (fun i => Fin.elim0 i))))))) (M.prod_mem pairing unions powers separation hOmega hA) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) - (extend z params)) (ZFSet.prod ZFSet.omega A) = M.relationPathLengths A R root := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, relationPathLengths, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_iterationEntryFormula _ _ _ _ _ _ _ _ rfl) - exact equal ▸ selected - -theorem relationPathLengths_iff_steps - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {B : Type u} (s : Presentation B) (r : B → B → Prop) {R : ZFSet.{u}} - (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) - (hB : s.carrier ∈ M.sets) (root y : B) (n : Nat) : - ZFSet.pair (natSetCode n) (s.encode y) ∈ M.relationPathLengths s.carrier R (s.encode root) ↔ - RelationPathSteps r n root y := by - rw [M.pair_mem_relationPathLengths] - constructor - · rintro ⟨_, _, d, _, t, _, succ, trace, out⟩ - have dcode : d = natSetCode (n + 1) := succ - exact (dcode ▸ trace).pathSteps s r edges n (Nat.le_refl n) y out - · intro path - obtain ⟨xs, trace, out⟩ := path.exists_trace s r edges - exact ⟨natSetCode_mem_omega n, s.encode_mem y, natSetCode (n + 1), natSetCode_mem_omega _, - finiteWordGraph s xs, finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, - rfl, trace, out⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -noncomputable def shortestLengthGraph (A lengths : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ y ∈ A, ∃ n ∈ ZFSet.omega, z = ZFSet.pair y n ∧ - ZFSet.pair n y ∈ lengths ∧ ∀ k ∈ n, ZFSet.pair k y ∉ lengths) (ZFSet.prod A ZFSet.omega) - -theorem pair_mem_shortestLengthGraph (A lengths y n : ZFSet.{u}) : - ZFSet.pair y n ∈ shortestLengthGraph A lengths ↔ y ∈ A ∧ n ∈ ZFSet.omega ∧ - ZFSet.pair n y ∈ lengths ∧ ∀ k ∈ n, ZFSet.pair k y ∉ lengths := by - rw [shortestLengthGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, y', hy, n', hn, equal, entry, minimal⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hy, hn, entry, minimal⟩ - · rintro ⟨hy, hn, entry, minimal⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hy, hn⟩, y, hy, n, hn, rfl, entry, minimal⟩ - -namespace BoundedFormula -def shortestLengthEntryFormula {k} (z A omega lengths : Fin k) : BoundedFormula k := - exMem A (exMem omega.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (.conj (pairMembershipFormula 0 1 lengths.succ.succ) - (.allMem 0 (.neg (pairMembershipFormula 0 2 lengths.succ.succ.succ)))))) - -theorem truth_shortestLengthEntryFormula {k} (z A omega lengths : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (shortestLengthEntryFormula z A omega lengths) env ↔ - ∃ y ∈ env A, ∃ n ∈ env omega, env z = ZFSet.pair y n ∧ - ZFSet.pair n y ∈ env lengths ∧ ∀ j ∈ n, ZFSet.pair j y ∉ env lengths := by - simp only [shortestLengthEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_pairMembershipFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem shortestLengthGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A lengths : ZFSet.{u}} (hA : A ∈ M.sets) (hLengths : lengths ∈ M.sets) : - shortestLengthGraph A lengths ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - let params := extend A (extend ZFSet.omega (extend lengths Fin.elim0)) - have selected := M.bounded_separation_mem separation (BoundedFormula.shortestLengthEntryFormula 0 1 2 3) - params (Fin.cases hA (Fin.cases hOmega (Fin.cases hLengths (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hA hOmega) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.shortestLengthEntryFormula 0 1 2 3) - (extend z params)) (ZFSet.prod A ZFSet.omega) = shortestLengthGraph A lengths := by - apply ZFSet.ext - intro z - rw [shortestLengthGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_shortestLengthEntryFormula _ _ _ _ _) - exact equal ▸ selected - -noncomputable def relationDepthGraph (A R root : ZFSet.{u}) : ZFSet.{u} := - shortestLengthGraph A (M.relationPathLengths A R root) - -theorem relationDepthGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A R root : ZFSet.{u}} (hA : A ∈ M.sets) (hR : R ∈ M.sets) (hRoot : root ∈ M.sets) : - M.relationDepthGraph A R root ∈ M.sets := - M.shortestLengthGraph_mem pairing unions powers separation infinite hA - (M.relationPathLengths_mem pairing unions powers separation infinite hA hR hRoot) -end TransitiveGround - -variable {B : Type u} (s : Presentation B) (depth : B → Nat) {lengths : ZFSet.{u}} -variable (valid : ∀ x, ZFSet.pair (natSetCode (depth x)) (s.encode x) ∈ lengths) -variable (minimal : ∀ x n, ZFSet.pair (natSetCode n) (s.encode x) ∈ lengths → depth x ≤ n) -include valid minimal - -theorem shortestLengthGraph_entry (x : B) (n : Nat) : - ZFSet.pair (s.encode x) (natSetCode n) ∈ shortestLengthGraph s.carrier lengths ↔ n = depth x := by - rw [pair_mem_shortestLengthGraph] - constructor - · rintro ⟨_, _, entry, least⟩ - have lower := minimal x n entry - have notLower : ¬ depth x < n := fun h => least _ ((natSetCode_mem_iff _ _).2 h) (valid x) - omega - · rintro rfl - refine ⟨s.encode_mem x, natSetCode_mem_omega _, valid x, ?_⟩ - intro k hk entry - obtain ⟨n, hn, rfl⟩ := (mem_natSetCode k (depth x)).1 hk - exact Nat.not_lt_of_ge (minimal x n entry) hn - -theorem shortestLengthGraph_eq_graph : - shortestLengthGraph s.carrier lengths = s.graph natPresentation (fun x => ⟨depth x⟩) := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨x, hx, n, hn, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have equal := (shortestLengthGraph_entry s depth valid minimal x n).1 entry - exact (s.pair_mem_graph natPresentation (fun x => ⟨depth x⟩) x ⟨n⟩).2 (congrArg ULift.up equal.symm) - · intro entry - obtain ⟨x, rfl⟩ := (s.mem_graph natPresentation (fun x => ⟨depth x⟩) z).1 entry - exact (shortestLengthGraph_entry s depth valid minimal x (depth x)).2 rfl - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def LowerDepthEdgeCode (omega depths adjacency p v : ZFSet.{u}) : Prop := - ZFSet.pair p v ∈ adjacency ∧ ∃ n ∈ omega, ∃ m ∈ omega, - ZFSet.pair v n ∈ depths ∧ ZFSet.pair p m ∈ depths ∧ n = insert m m - -noncomputable def treeParentGraph (V depths adjacency root : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ v ∈ V, ∃ p ∈ V, z = ZFSet.pair v p ∧ - ((v = root ∧ p = root) ∨ LowerDepthEdgeCode ZFSet.omega depths adjacency p v)) (ZFSet.prod V V) - -theorem pair_mem_treeParentGraph (V depths adjacency root v p : ZFSet.{u}) : - ZFSet.pair v p ∈ treeParentGraph V depths adjacency root ↔ v ∈ V ∧ p ∈ V ∧ - ((v = root ∧ p = root) ∨ LowerDepthEdgeCode ZFSet.omega depths adjacency p v) := by - rw [treeParentGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, v', hv, p', hp, equal, body⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hv, hp, body⟩ - · rintro ⟨hv, hp, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hp⟩, v, hv, p, hp, rfl, body⟩ - -namespace BoundedFormula -def lowerDepthEdgeFormula {k} (omega depths adjacency p v : Fin k) : BoundedFormula k := - .conj (pairMembershipFormula p v adjacency) (exMem omega (exMem omega.succ - (.conj (pairMembershipFormula v.succ.succ 1 depths.succ.succ) - (.conj (pairMembershipFormula p.succ.succ 0 depths.succ.succ) (successorFormula 1 0))))) - -theorem truth_lowerDepthEdgeFormula {k} (omega depths adjacency p v : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (lowerDepthEdgeFormula omega depths adjacency p v) env ↔ - LowerDepthEdgeCode (env omega) (env depths) (env adjacency) (env p) (env v) := by - simp only [lowerDepthEdgeFormula, Truth, truth_pairMembershipFormula, truth_exMem, truth_successorFormula] - rfl - -def treeParentEntryFormula {k} (z V omega depths adjacency root : Fin k) : BoundedFormula k := - exMem V (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (disj (.conj (.equal 1 root.succ.succ) (.equal 0 root.succ.succ)) - (lowerDepthEdgeFormula omega.succ.succ depths.succ.succ adjacency.succ.succ 0 1)))) - -theorem truth_treeParentEntryFormula {k} (z V omega depths adjacency root : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (treeParentEntryFormula z V omega depths adjacency root) env ↔ - ∃ v ∈ env V, ∃ p ∈ env V, env z = ZFSet.pair v p ∧ - ((v = env root ∧ p = env root) ∨ LowerDepthEdgeCode (env omega) (env depths) (env adjacency) p v) := by - simp only [treeParentEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_disj, - truth_lowerDepthEdgeFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -theorem treeParentGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {V depths adjacency root : ZFSet.{u}} (hV : V ∈ M.sets) (hDepths : depths ∈ M.sets) - (hAdjacency : adjacency ∈ M.sets) (hRoot : root ∈ M.sets) : - treeParentGraph V depths adjacency root ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - let params := extend V (extend ZFSet.omega (extend depths (extend adjacency (extend root Fin.elim0)))) - have selected := M.bounded_separation_mem separation (BoundedFormula.treeParentEntryFormula 0 1 2 3 4 5) - params (Fin.cases hV (Fin.cases hOmega (Fin.cases hDepths (Fin.cases hAdjacency - (Fin.cases hRoot (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hV hV) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.treeParentEntryFormula 0 1 2 3 4 5) - (extend z params)) (ZFSet.prod V V) = treeParentGraph V depths adjacency root := by - apply ZFSet.ext - intro z - rw [treeParentGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_treeParentEntryFormula _ _ _ _ _ _ _) - exact equal ▸ selected -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars -open Forcing SetRealization SetFormula -universe u -variable (J S R : Type u) [Group J] (request : S → R) -local notation "adj" => fun x y => ∃ d : Dart J S R, source J S R request d = x ∧ target J S R request d = y - -theorem Follows.pathSteps {x y : Vertex J S R} {L : List (Dart J S R)} - (path : Follows J S R request x L y) : RelationPathSteps adj L.length x y := by - induction path with - | nil => exact .nil _ - | cons d tail ih => exact ih.cons ⟨d, rfl, rfl⟩ - -theorem follows_of_pathSteps {n : Nat} {x y : Vertex J S R} (path : RelationPathSteps adj n x y) : - ∃ L : List (Dart J S R), Follows J S R request x L y ∧ L.length = n := by - induction path with - | nil x => exact ⟨[], Follows.nil x, rfl⟩ - | @tail n x y z previous edge ih => - obtain ⟨L, followed, length⟩ := ih - obtain ⟨d, src, tgt⟩ := edge - have oneEdge : Follows J S R request y [d] z := by - rw [← src, ← tgt] - exact Follows.cons d (Follows.nil _) - exact ⟨L ++ [d], follows_append J S R request followed oneEdge, - by simp only [List.length_append, List.length_singleton, length]⟩ - -theorem depth_pathSteps (x : Vertex J S R) : - RelationPathSteps adj (depth J S R request x) (root J S R) x := - (rootPath_follows J S R request x).pathSteps J S R request - -theorem depth_le_steps {x : Vertex J S R} {n : Nat} - (path : RelationPathSteps adj n (root J S R) x) : depth J S R request x ≤ n := by - obtain ⟨L, followed, rfl⟩ := follows_of_pathSteps J S R request path - exact rootPath_shortest J S R request followed - -variable (M : Forcing.TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (s : Presentation (Vertex J S R)) {adjacency : ZFSet.{u}} -variable (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ adjacency ↔ - ∃ d : Dart J S R, TileStars.source J S R request d = x ∧ TileStars.target J S R request d = y) -variable (hV : s.carrier ∈ M.sets) - -include pairing unions separation infinite edges hV in -theorem depthGraph_eq_graph : - M.relationDepthGraph s.carrier adjacency (s.encode (root J S R)) = - s.graph natPresentation (fun x => ⟨depth J S R request x⟩) := by - change shortestLengthGraph s.carrier - (M.relationPathLengths s.carrier adjacency (s.encode (root J S R))) = _ - apply shortestLengthGraph_eq_graph s (depth J S R request) - (lengths := M.relationPathLengths s.carrier adjacency (s.encode (root J S R))) - · intro x - exact (M.relationPathLengths_iff_steps pairing unions separation infinite s - (fun x y => ∃ d : Dart J S R, source J S R request d = x ∧ target J S R request d = y) - edges hV (root J S R) x (depth J S R request x)).2 (depth_pathSteps J S R request x) - · intro x n entry - exact depth_le_steps J S R request - ((M.relationPathLengths_iff_steps pairing unions separation infinite s - (fun x y => ∃ d : Dart J S R, source J S R request d = x ∧ target J S R request d = y) - edges hV (root J S R) x n).1 entry) - -include pairing unions powers separation infinite edges hV in -theorem depthGraph_spec (hAdjacency : adjacency ∈ M.sets) : - M.relationDepthGraph s.carrier adjacency (s.encode (root J S R)) ∈ M.sets ∧ - ZFSet.IsFunc s.carrier ZFSet.omega (M.relationDepthGraph s.carrier adjacency (s.encode (root J S R))) ∧ - ∀ x n, ZFSet.pair (s.encode x) (natSetCode n) ∈ - M.relationDepthGraph s.carrier adjacency (s.encode (root J S R)) ↔ n = depth J S R request x := by - refine ⟨M.relationDepthGraph_mem pairing unions powers separation infinite hV hAdjacency - (M.transitive hV (s.encode_mem _)), ?_, ?_⟩ - · rw [depthGraph_eq_graph J S R request M pairing unions separation infinite s edges hV] - exact s.graph_isFunc natPresentation _ - · intro x n - rw [depthGraph_eq_graph J S R request M pairing unions separation infinite s edges hV] - have entry := s.pair_mem_graph natPresentation (fun x => ⟨depth J S R request x⟩) x ⟨n⟩ - exact entry.trans ⟨fun equal => (congrArg ULift.down equal).symm, - fun equal => congrArg ULift.up equal.symm⟩ - -end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def treeNonrootCarrier (V root : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun v => v ≠ root) V - -noncomputable def treeIncomingGraph (V D parents source target root : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ v ∈ V, ∃ d ∈ D, z = ZFSet.pair v d ∧ v ≠ root ∧ - ZFSet.pair d v ∈ target ∧ ∃ p ∈ V, ZFSet.pair d p ∈ source ∧ ZFSet.pair v p ∈ parents) - (ZFSet.prod V D) - -theorem pair_mem_treeIncomingGraph (V D parents source target root v d : ZFSet.{u}) : - ZFSet.pair v d ∈ treeIncomingGraph V D parents source target root ↔ - v ∈ V ∧ d ∈ D ∧ v ≠ root ∧ ZFSet.pair d v ∈ target ∧ - ∃ p ∈ V, ZFSet.pair d p ∈ source ∧ ZFSet.pair v p ∈ parents := by - rw [treeIncomingGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, v', hv, d', hd, equal, body⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hv, hd, body⟩ - · rintro ⟨hv, hd, body⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hd⟩, v, hv, d, hd, rfl, body⟩ - -namespace BoundedFormula -def treeIncomingEntryFormula {k} (z V D parents source target root : Fin k) : BoundedFormula k := - exMem V (exMem D.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (.conj (.neg (.equal 1 root.succ.succ)) - (.conj (pairMembershipFormula 0 1 target.succ.succ) - (exMem V.succ.succ (.conj (pairMembershipFormula 1 0 source.succ.succ.succ) - (pairMembershipFormula 2 0 parents.succ.succ.succ))))))) - -theorem truth_treeIncomingEntryFormula {k} (z V D parents source target root : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (treeIncomingEntryFormula z V D parents source target root) env ↔ - ∃ v ∈ env V, ∃ d ∈ env D, env z = ZFSet.pair v d ∧ v ≠ env root ∧ - ZFSet.pair d v ∈ env target ∧ ∃ p ∈ env V, - ZFSet.pair d p ∈ env source ∧ ZFSet.pair v p ∈ env parents := by - simp only [treeIncomingEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_pairMembershipFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -theorem treeNonrootCarrier_mem (separation : SeparationSchema M.sets) - {V root : ZFSet.{u}} (hV : V ∈ M.sets) (hRoot : root ∈ M.sets) : - treeNonrootCarrier V root ∈ M.sets := - M.bounded_separation_mem separation (.neg (.equal 0 1)) - (extend root Fin.elim0) (Fin.cases hRoot (fun i => Fin.elim0 i)) hV - -theorem treeIncomingGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {V D parents source target root : ZFSet.{u}} (hV : V ∈ M.sets) (hD : D ∈ M.sets) - (hParents : parents ∈ M.sets) (hSource : source ∈ M.sets) (hTarget : target ∈ M.sets) - (hRoot : root ∈ M.sets) : treeIncomingGraph V D parents source target root ∈ M.sets := by - let params := extend V (extend D (extend parents (extend source (extend target (extend root Fin.elim0))))) - have selected := M.bounded_separation_mem separation (BoundedFormula.treeIncomingEntryFormula 0 1 2 3 4 5 6) - params (Fin.cases hV (Fin.cases hD (Fin.cases hParents (Fin.cases hSource (Fin.cases hTarget - (Fin.cases hRoot (fun i => Fin.elim0 i))))))) (M.prod_mem pairing unions powers separation hV hD) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.treeIncomingEntryFormula 0 1 2 3 4 5 6) - (extend z params)) (ZFSet.prod V D) = treeIncomingGraph V D parents source target root := by - apply ZFSet.ext - intro z - rw [treeIncomingGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_treeIncomingEntryFormula _ _ _ _ _ _ _ _) - exact equal ▸ selected -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars -open Forcing SetRealization SetFormula -universe u -variable (J S R : Type u) [Group J] (request : S → R) -variable (s : Presentation (Vertex J S R)) (t : Presentation (Dart J S R)) -variable {parents src tgt : ZFSet.{u}} -variable (parentEntries : ∀ v p, ZFSet.pair (s.encode v) (s.encode p) ∈ parents ↔ parent J S R request v = p) -variable (sourceEntries : ∀ d v, ZFSet.pair (t.encode d) (s.encode v) ∈ src ↔ TileStars.source J S R request d = v) -variable (targetEntries : ∀ d v, ZFSet.pair (t.encode d) (s.encode v) ∈ tgt ↔ TileStars.target J S R request d = v) -include parentEntries sourceEntries targetEntries - -theorem incomingGraph_entry (v : Vertex J S R) (nonroot : v ≠ root J S R) (d : Dart J S R) : - ZFSet.pair (s.encode v) (t.encode d) ∈ treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R)) ↔ - incoming J S R request v nonroot = d := by - rw [pair_mem_treeIncomingGraph] - constructor - · rintro ⟨_, _, _, target, p, hp, source, parent⟩ - obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 hp - have atTarget := (targetEntries d v).1 target - have atSource := (sourceEntries d p).1 source - have atParent := (parentEntries v p).1 parent - apply (incoming_iff J S R request v nonroot d).2 - refine ⟨atTarget, ?_⟩ - rw [atSource, ← atParent] - exact parent_depth J S R request v (fun zero => nonroot ((depth_zero_iff J S R request v).1 zero)) - · rintro rfl - refine ⟨s.encode_mem v, t.encode_mem _, fun equal => nonroot (s.injective equal), - (targetEntries _ v).2 (incoming_target J S R request v nonroot), - s.encode (parent J S R request v), s.encode_mem _, ?_, (parentEntries v _).2 rfl⟩ - exact (sourceEntries _ _).2 (parent_eq J S R request v nonroot).symm - -theorem incomingGraph_function : - ZFSet.IsFunc (treeNonrootCarrier s.carrier (s.encode (root J S R))) t.carrier - (treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R))) := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨v, hv, d, hd, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 - have body := (pair_mem_treeIncomingGraph _ _ _ _ _ _ _ _).1 hz - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_sep.2 ⟨hv, body.2.2.1⟩, hd⟩ - · intro v hv - obtain ⟨hv, nonroot⟩ := ZFSet.mem_sep.1 hv - obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv - have ne : v ≠ root J S R := fun eq => nonroot (congrArg s.encode eq) - refine ⟨t.encode (incoming J S R request v ne), - (incomingGraph_entry J S R request s t parentEntries sourceEntries targetEntries v ne _).2 rfl, ?_⟩ - intro d hd - have body := (pair_mem_treeIncomingGraph _ _ _ _ _ _ _ _).1 hd - obtain ⟨d, rfl⟩ := (t.mem_carrier d).1 body.2.1 - exact congrArg t.encode ((incomingGraph_entry J S R request s t parentEntries sourceEntries targetEntries v ne d).1 hd).symm - -theorem incomingGraph_spec (M : Forcing.TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hV : s.carrier ∈ M.sets) (hD : t.carrier ∈ M.sets) - (hParents : parents ∈ M.sets) (hSource : src ∈ M.sets) (hTarget : tgt ∈ M.sets) : - treeNonrootCarrier s.carrier (s.encode (root J S R)) ∈ M.sets ∧ - treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R)) ∈ M.sets ∧ - ZFSet.IsFunc (treeNonrootCarrier s.carrier (s.encode (root J S R))) t.carrier - (treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R))) := by - have hRoot := M.transitive hV (s.encode_mem (root J S R)) - exact ⟨M.treeNonrootCarrier_mem separation hV hRoot, - M.treeIncomingGraph_mem pairing unions powers separation hV hD hParents hSource hTarget hRoot, - incomingGraph_function J S R request s t parentEntries sourceEntries targetEntries⟩ - -end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars - -end OAI +import Mathlib.Data.List.Chain +import OAI.SetTheory.PartitionPrinciple.Definability.FiniteWordMapCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedClassInclusions +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundNaturalRecursion + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +def FiniteRelationPathCode (omega A R x y t : ZFSet.{u}) : Prop := + ∃ n ∈ omega, ∃ d ∈ omega, d = insert n n ∧ + IterationTraceCode n d A R x t ∧ ZFSet.pair n y ∈ t + +theorem IterationTraceCode.reflTransGen {B : Type u} (s : Presentation B) + (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + {n : Nat} {t : ZFSet.{u}} {x : B} + (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier R + (s.encode x) t) : + ∀ k ≤ n, ∀ y, ZFSet.pair (natSetCode k) (s.encode y) ∈ t → + Relation.ReflTransGen r x y := by + intro k + induction k with + | zero => + intro _ y entry + have same := (show FunctionGraphOn (natSetCode (n + 1)) t from + ⟨s.carrier, trace.function⟩).unique trace.seed entry + have equal : x = y := s.injective same + subst y + exact .refl + | succ k ih => + intro hk y entry + have domain := (natSetCode_mem_iff k (n + 1)).2 (by omega) + obtain ⟨a, prev, _⟩ := trace.function.2 (natSetCode k) domain + have ha := (ZFSet.pair_mem_prod.1 (trace.function.1 prev)).2 + obtain ⟨b, eq⟩ := (s.mem_carrier a).1 ha + have previous : ZFSet.pair (natSetCode k) (s.encode b) ∈ t := eq.symm ▸ prev + have step := trace.next (natSetCode k) ((natSetCode_mem_iff k n).2 (by omega)) + (natSetCode (k + 1)) ((natSetCode_mem_iff _ _).2 (by omega)) + _ (s.encode_mem b) _ (s.encode_mem y) rfl previous entry + exact (ih (by omega) b previous).tail ((edges b y).1 step) + +theorem FiniteRelationPathCode.reflTransGen {B : Type u} (s : Presentation B) + (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + {x y : B} {t : ZFSet.{u}} + (path : FiniteRelationPathCode ZFSet.omega s.carrier R (s.encode x) (s.encode y) t) : + Relation.ReflTransGen r x y := by + obtain ⟨n, hn, d, _, succ, trace, out⟩ := path + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have dcode : d = natSetCode (n + 1) := succ + exact (dcode ▸ trace).reflTransGen s r edges n (Nat.le_refl n) y out + +theorem finiteWordGraph_chain_trace {B : Type u} (s : Presentation B) + (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + (x : B) (xs : List B) (chain : List.IsChain r (x :: xs)) : + IterationTraceCode (natSetCode xs.length) (natSetCode (xs.length + 1)) + s.carrier R (s.encode x) (finiteWordGraph s (x :: xs)) := by + refine ⟨?_, ?_, ?_⟩ + · simpa only [List.length_cons] using finiteWordGraph_function s (x :: xs) + · apply (pair_mem_finiteWordGraph s (x :: xs) 0 _).2 + exact ⟨by simp, rfl⟩ + · intro i hi j _ a _ b _ succ prev next + obtain ⟨k, hk, rfl⟩ := (mem_natSetCode i xs.length).1 hi + have jcode : j = natSetCode (k + 1) := succ + obtain ⟨_, avalue⟩ := (pair_mem_finiteWordGraph s (x :: xs) k a).1 prev + obtain ⟨_, bvalue⟩ := (pair_mem_finiteWordGraph s (x :: xs) (k + 1) b).1 (jcode ▸ next) + rw [avalue, bvalue, edges] + simpa only [List.get_eq_getElem] using + chain.getElem k (by simpa only [List.length_cons] using Nat.succ_lt_succ hk) + +theorem finiteWordGraph_chain_path {B : Type u} (s : Presentation B) + (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + (x : B) (xs : List B) (chain : List.IsChain r (x :: xs)) : + FiniteRelationPathCode ZFSet.omega s.carrier R (s.encode x) + (s.encode ((x :: xs).getLast (List.cons_ne_nil _ _))) + (finiteWordGraph s (x :: xs)) := by + refine ⟨natSetCode xs.length, natSetCode_mem_omega _, natSetCode (xs.length + 1), + natSetCode_mem_omega _, rfl, finiteWordGraph_chain_trace s r edges x xs chain, ?_⟩ + apply (pair_mem_finiteWordGraph s (x :: xs) xs.length _).2 + refine ⟨by simp, ?_⟩ + simp only [List.get_eq_getElem, List.getLast_eq_getElem, List.length_cons, Nat.add_sub_cancel] + +theorem reflTransGen_iff_finiteWordGraph_path {B : Type u} (s : Presentation B) + (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) (x y : B) : + Relation.ReflTransGen r x y ↔ ∃ xs : List B, + FiniteRelationPathCode ZFSet.omega s.carrier R (s.encode x) (s.encode y) + (finiteWordGraph s xs) := by + constructor + · intro path + obtain ⟨xs, chain, last⟩ := List.exists_isChain_cons_of_relationReflTransGen path + exact ⟨x :: xs, last ▸ finiteWordGraph_chain_path s r edges x xs chain⟩ + · rintro ⟨xs, code⟩ + exact code.reflTransGen s r edges + + + + + +inductive RelationPathSteps {B : Type u} (r : B → B → Prop) : Nat → B → B → Prop + | nil (x : B) : RelationPathSteps r 0 x x + | tail {n : Nat} {x y z : B} : RelationPathSteps r n x y → r y z → RelationPathSteps r (n + 1) x z + +theorem chain_append_last {B : Type u} {r : B → B → Prop} {x z : B} {xs : List B} + (chain : List.IsChain r (x :: xs)) (edge : r ((x :: xs).getLast (List.cons_ne_nil _ _)) z) : + List.IsChain r (x :: (xs ++ [z])) := by + induction xs generalizing x with + | nil => exact .cons_cons edge (.singleton _) + | cons next rest ih => + obtain ⟨first, tail⟩ := List.isChain_cons_cons.mp chain + exact .cons_cons first (ih tail (by simpa only [List.getLast_cons_cons] using edge)) + +namespace RelationPathSteps +variable {B : Type u} {r : B → B → Prop} {n : Nat} {x y z : B} + +theorem append {m : Nat} (first : RelationPathSteps r n x y) (second : RelationPathSteps r m y z) : + RelationPathSteps r (n + m) x z := by + induction second with + | nil => exact first + | tail previous edge ih => exact .tail (ih first) edge + +theorem cons (edge : r x y) (path : RelationPathSteps r n y z) : RelationPathSteps r (n + 1) x z := by + simpa only [Nat.add_comm] using (RelationPathSteps.tail (RelationPathSteps.nil x) edge).append path + +theorem chain (path : RelationPathSteps r n x y) : + ∃ xs : List B, List.IsChain r (x :: xs) ∧ + (x :: xs).getLast (List.cons_ne_nil _ _) = y ∧ xs.length = n := by + induction path with + | nil x => exact ⟨[], .singleton _, rfl, rfl⟩ + | @tail n x y z previous edge ih => + obtain ⟨xs, chain, last, length⟩ := ih + refine ⟨xs ++ [z], chain_append_last chain (last.symm ▸ edge), ?_, ?_⟩ + · simp + · simp only [List.length_append, List.length_singleton, length] + +end RelationPathSteps + +theorem IterationTraceCode.pathSteps {B : Type u} (s : Presentation B) + (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + {n : Nat} {t : ZFSet.{u}} {x : B} + (trace : IterationTraceCode (natSetCode n) (natSetCode (n + 1)) s.carrier R (s.encode x) t) : + ∀ k ≤ n, ∀ y, ZFSet.pair (natSetCode k) (s.encode y) ∈ t → RelationPathSteps r k x y := by + intro k + induction k with + | zero => + intro _ y entry + have same := (show FunctionGraphOn (natSetCode (n + 1)) t from ⟨s.carrier, trace.function⟩).unique trace.seed entry + have equal := s.injective same + subst y + exact .nil x + | succ k ih => + intro hk y entry + obtain ⟨a, prev, _⟩ := trace.function.2 (natSetCode k) ((natSetCode_mem_iff _ _).2 (by omega)) + obtain ⟨b, equal⟩ := (s.mem_carrier a).1 (ZFSet.pair_mem_prod.1 (trace.function.1 prev)).2 + have previous : ZFSet.pair (natSetCode k) (s.encode b) ∈ t := equal.symm ▸ prev + have edge := trace.next (natSetCode k) ((natSetCode_mem_iff _ _).2 (by omega)) + (natSetCode (k + 1)) ((natSetCode_mem_iff _ _).2 (by omega)) + _ (s.encode_mem b) _ (s.encode_mem y) rfl previous entry + exact .tail (ih (by omega) b previous) ((edges b y).1 edge) + +theorem RelationPathSteps.exists_trace {B : Type u} (s : Presentation B) + (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + {n : Nat} {x y : B} (path : RelationPathSteps r n x y) : + ∃ xs : List B, IterationTraceCode (natSetCode n) (natSetCode (n + 1)) + s.carrier R (s.encode x) (finiteWordGraph s xs) ∧ ZFSet.pair (natSetCode n) (s.encode y) ∈ finiteWordGraph s xs := by + obtain ⟨xs, chain, last, rfl⟩ := path.chain + refine ⟨x :: xs, finiteWordGraph_chain_trace s r edges x xs chain, ?_⟩ + apply (pair_mem_finiteWordGraph s (x :: xs) xs.length _).2 + refine ⟨by simp, ?_⟩ + rw [← last] + simp only [List.get_eq_getElem, List.getLast_eq_getElem, List.length_cons, Nat.add_sub_cancel] + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace BoundedFormula + +def finiteRelationPathFormula {k} (omega A R x y t zero : Fin k) : BoundedFormula k := + exMem omega (exMem omega.succ (.conj (successorFormula 0 1) + (.conj (iterationTraceFormula 1 0 A.succ.succ R.succ.succ x.succ.succ + t.succ.succ zero.succ.succ) (pairMembershipFormula 1 y.succ.succ t.succ.succ)))) + +theorem truth_finiteRelationPathFormula {k} (omega A R x y t zero : Fin k) + (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : + Truth (finiteRelationPathFormula omega A R x y t zero) env ↔ + FiniteRelationPathCode (env omega) (env A) (env R) (env x) (env y) (env t) := by + simp only [finiteRelationPathFormula, truth_exMem, Truth, truth_successorFormula, + truth_pairMembershipFormula, FiniteRelationPathCode] + apply exists_congr + intro n + apply and_congr_right + intro _ + apply exists_congr + intro d + apply and_congr_right + intro _ + exact and_congr Iff.rfl (and_congr + (truth_iterationTraceFormula _ _ _ _ _ _ _ _ (by exact hzero)) Iff.rfl) + +def finitePathClosureEntryFormula {k} (z A R omega paths zero : Fin k) : BoundedFormula k := + exMem A (exMem A.succ (exMem paths.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 1) + (finiteRelationPathFormula omega.succ.succ.succ A.succ.succ.succ + R.succ.succ.succ 2 1 0 zero.succ.succ.succ)))) + +theorem truth_finitePathClosureEntryFormula {k} (z A R omega paths zero : Fin k) + (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : + Truth (finitePathClosureEntryFormula z A R omega paths zero) env ↔ + ∃ x ∈ env A, ∃ y ∈ env A, ∃ t ∈ env paths, + env z = ZFSet.pair x y ∧ + FiniteRelationPathCode (env omega) (env A) (env R) x y t := by + simp only [finitePathClosureEntryFormula, truth_exMem, Truth, truth_orderedPairFormula] + apply exists_congr + intro x + apply and_congr_right + intro _ + apply exists_congr + intro y + apply and_congr_right + intro _ + apply exists_congr + intro t + apply and_congr_right + intro _ + exact and_congr Iff.rfl + (truth_finiteRelationPathFormula _ _ _ _ _ _ _ _ (by exact hzero)) + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def finitePathClosure (A R : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ A, ∃ t ∈ M.finiteWords A, + z = ZFSet.pair x y ∧ FiniteRelationPathCode ZFSet.omega A R x y t) (ZFSet.prod A A) + +theorem pair_mem_finitePathClosure_iff (A R x y : ZFSet.{u}) : + ZFSet.pair x y ∈ M.finitePathClosure A R ↔ + x ∈ A ∧ y ∈ A ∧ ∃ t ∈ M.finiteWords A, FiniteRelationPathCode ZFSet.omega A R x y t := by + rw [finitePathClosure, ZFSet.mem_sep] + constructor + · rintro ⟨_, a, ha, b, hb, t, ht, eq, code⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨ha, hb, t, ht, code⟩ + · rintro ⟨hx, hy, t, ht, code⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, t, ht, rfl, code⟩ + +theorem finitePathClosure_subset (A R : ZFSet.{u}) : + M.finitePathClosure A R ⊆ ZFSet.prod A A := + fun _ h => (ZFSet.mem_sep.1 h).1 + +theorem finitePathClosure_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A R : ZFSet.{u}} (hA : A ∈ M.sets) (hR : R ∈ M.sets) : + M.finitePathClosure A R ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + have hPaths := M.finiteWords_mem pairing unions powers separation infinite hA + have hZero := M.empty_mem ⟨A, hA⟩ + let params := extend A (extend R (extend ZFSet.omega (extend (M.finiteWords A) + (extend ∅ Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.finitePathClosureEntryFormula 0 1 2 3 4 5) params + (Fin.cases hA (Fin.cases hR (Fin.cases hOmega (Fin.cases hPaths + (Fin.cases hZero (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hA hA) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.finitePathClosureEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod A A) = M.finitePathClosure A R := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, finitePathClosure, ZFSet.mem_sep] + exact and_congr Iff.rfl + (BoundedFormula.truth_finitePathClosureEntryFormula _ _ _ _ _ _ _ rfl) + exact equal ▸ selected + +theorem pair_mem_finitePathClosure + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {B : Type u} (s : Presentation B) (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + (hB : s.carrier ∈ M.sets) (x y : B) : + ZFSet.pair (s.encode x) (s.encode y) ∈ M.finitePathClosure s.carrier R ↔ + Relation.ReflTransGen r x y := by + rw [M.pair_mem_finitePathClosure_iff] + constructor + · rintro ⟨_, _, t, _, code⟩ + exact code.reflTransGen s r edges + · intro path + obtain ⟨xs, code⟩ := (reflTransGen_iff_finiteWordGraph_path s r edges x y).1 path + exact ⟨s.encode_mem x, s.encode_mem y, finiteWordGraph s xs, + finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, code⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {B : Type u} (s : Presentation B) (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + (hB : s.carrier ∈ M.sets) + +include pairing unions separation infinite edges hB in +theorem finitePathClosure_equivalence (symmetric : ∀ ⦃left right⦄, r left right → r right left) : + EquivalenceRelationCode s.carrier (M.finitePathClosure s.carrier R) := by + let : Std.Symm r := ⟨fun _ _ related => symmetric related⟩ + have exactPath := M.pair_mem_finitePathClosure pairing unions separation infinite s r edges hB + refine ⟨M.finitePathClosure_subset s.carrier R, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + exact (exactPath a a).2 .refl + · intro x y xy + obtain ⟨hx, hy, _⟩ := (M.pair_mem_finitePathClosure_iff s.carrier R x y).1 xy + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy + exact (exactPath b a).2 (symm ((exactPath a b).1 xy)) + · intro x y z xy yz + obtain ⟨hx, hy, _⟩ := (M.pair_mem_finitePathClosure_iff s.carrier R x y).1 xy + have hz := ((M.pair_mem_finitePathClosure_iff s.carrier R y z).1 yz).2.1 + obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨c, rfl⟩ := (s.mem_carrier z).1 hz + exact (exactPath a c).2 (((exactPath a b).1 xy).trans ((exactPath b c).1 yz)) + +include pairing unions separation infinite edges hB in +theorem finitePathQuotient_spec + (powers : Realize M.sets powerSet Fin.elim0) (hR : R ∈ M.sets) + (symmetric : ∀ ⦃left right⦄, r left right → r right left) : + let E := M.finitePathClosure s.carrier R + E ∈ M.sets ∧ EquivalenceRelationCode s.carrier E ∧ + equivalenceClasses s.carrier E ∈ M.sets ∧ equivalenceClassifier s.carrier E ∈ M.sets ∧ + ZFSet.IsFunc s.carrier (equivalenceClasses s.carrier E) (equivalenceClassifier s.carrier E) ∧ + (∀ C ∈ equivalenceClasses s.carrier E, ∃ x ∈ s.carrier, + ZFSet.pair x C ∈ equivalenceClassifier s.carrier E) ∧ + (∀ x y C D, ZFSet.pair x C ∈ equivalenceClassifier s.carrier E → + ZFSet.pair y D ∈ equivalenceClassifier s.carrier E → (C = D ↔ ZFSet.pair x y ∈ E)) := by + dsimp only + have ground := M.finitePathClosure_mem pairing unions powers separation infinite hB hR + have equivalence := M.finitePathClosure_equivalence pairing unions separation infinite s r edges hB symmetric + exact ⟨ground, equivalence, + M.equivalenceClasses_spec pairing unions powers separation hB ground equivalence⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def relationPathLengths (A R root : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ y ∈ A, ∃ d ∈ ZFSet.omega, ∃ t ∈ M.finiteWords A, + z = ZFSet.pair n y ∧ d = insert n n ∧ IterationTraceCode n d A R root t ∧ ZFSet.pair n y ∈ t) + (ZFSet.prod ZFSet.omega A) + +theorem pair_mem_relationPathLengths (A R root n y : ZFSet.{u}) : + ZFSet.pair n y ∈ M.relationPathLengths A R root ↔ n ∈ ZFSet.omega ∧ y ∈ A ∧ + ∃ d ∈ ZFSet.omega, ∃ t ∈ M.finiteWords A, + d = insert n n ∧ IterationTraceCode n d A R root t ∧ ZFSet.pair n y ∈ t := by + rw [relationPathLengths, ZFSet.mem_sep] + constructor + · rintro ⟨_, n', hn, y', hy, d, hd, t, ht, equal, succ, trace, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hn, hy, d, hd, t, ht, succ, trace, entry⟩ + · rintro ⟨hn, hy, d, hd, t, ht, succ, trace, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hn, hy⟩, n, hn, y, hy, d, hd, t, ht, rfl, succ, trace, entry⟩ + +theorem relationPathLengths_subset (A R root : ZFSet.{u}) : + M.relationPathLengths A R root ⊆ ZFSet.prod ZFSet.omega A := fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem relationPathLengths_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A R root : ZFSet.{u}} (hA : A ∈ M.sets) (hR : R ∈ M.sets) (hRoot : root ∈ M.sets) : + M.relationPathLengths A R root ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + have hPaths := M.finiteWords_mem pairing unions powers separation infinite hA + have hZero := M.empty_mem ⟨A, hA⟩ + let params := extend ZFSet.omega (extend A (extend R (extend root (extend (M.finiteWords A) (extend ∅ Fin.elim0))))) + have selected := M.bounded_separation_mem separation (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) + params (Fin.cases hOmega (Fin.cases hA (Fin.cases hR (Fin.cases hRoot (Fin.cases hPaths + (Fin.cases hZero (fun i => Fin.elim0 i))))))) (M.prod_mem pairing unions powers separation hOmega hA) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) + (extend z params)) (ZFSet.prod ZFSet.omega A) = M.relationPathLengths A R root := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, relationPathLengths, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_iterationEntryFormula _ _ _ _ _ _ _ _ rfl) + exact equal ▸ selected + +theorem relationPathLengths_iff_steps + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {B : Type u} (s : Presentation B) (r : B → B → Prop) {R : ZFSet.{u}} + (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ R ↔ r x y) + (hB : s.carrier ∈ M.sets) (root y : B) (n : Nat) : + ZFSet.pair (natSetCode n) (s.encode y) ∈ M.relationPathLengths s.carrier R (s.encode root) ↔ + RelationPathSteps r n root y := by + rw [M.pair_mem_relationPathLengths] + constructor + · rintro ⟨_, _, d, _, t, _, succ, trace, out⟩ + have dcode : d = natSetCode (n + 1) := succ + exact (dcode ▸ trace).pathSteps s r edges n (Nat.le_refl n) y out + · intro path + obtain ⟨xs, trace, out⟩ := path.exists_trace s r edges + exact ⟨natSetCode_mem_omega n, s.encode_mem y, natSetCode (n + 1), natSetCode_mem_omega _, + finiteWordGraph s xs, finiteWordGraph_mem_finiteWords s M pairing unions separation infinite hB xs, + rfl, trace, out⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +noncomputable def shortestLengthGraph (A lengths : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ y ∈ A, ∃ n ∈ ZFSet.omega, z = ZFSet.pair y n ∧ + ZFSet.pair n y ∈ lengths ∧ ∀ k ∈ n, ZFSet.pair k y ∉ lengths) (ZFSet.prod A ZFSet.omega) + +theorem pair_mem_shortestLengthGraph (A lengths y n : ZFSet.{u}) : + ZFSet.pair y n ∈ shortestLengthGraph A lengths ↔ y ∈ A ∧ n ∈ ZFSet.omega ∧ + ZFSet.pair n y ∈ lengths ∧ ∀ k ∈ n, ZFSet.pair k y ∉ lengths := by + rw [shortestLengthGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, y', hy, n', hn, equal, entry, minimal⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hy, hn, entry, minimal⟩ + · rintro ⟨hy, hn, entry, minimal⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hy, hn⟩, y, hy, n, hn, rfl, entry, minimal⟩ + +namespace BoundedFormula +def shortestLengthEntryFormula {k} (z A omega lengths : Fin k) : BoundedFormula k := + exMem A (exMem omega.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (.conj (pairMembershipFormula 0 1 lengths.succ.succ) + (.allMem 0 (.neg (pairMembershipFormula 0 2 lengths.succ.succ.succ)))))) + +theorem truth_shortestLengthEntryFormula {k} (z A omega lengths : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (shortestLengthEntryFormula z A omega lengths) env ↔ + ∃ y ∈ env A, ∃ n ∈ env omega, env z = ZFSet.pair y n ∧ + ZFSet.pair n y ∈ env lengths ∧ ∀ j ∈ n, ZFSet.pair j y ∉ env lengths := by + simp only [shortestLengthEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_pairMembershipFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem shortestLengthGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A lengths : ZFSet.{u}} (hA : A ∈ M.sets) (hLengths : lengths ∈ M.sets) : + shortestLengthGraph A lengths ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + let params := extend A (extend ZFSet.omega (extend lengths Fin.elim0)) + have selected := M.bounded_separation_mem separation (BoundedFormula.shortestLengthEntryFormula 0 1 2 3) + params (Fin.cases hA (Fin.cases hOmega (Fin.cases hLengths (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hA hOmega) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.shortestLengthEntryFormula 0 1 2 3) + (extend z params)) (ZFSet.prod A ZFSet.omega) = shortestLengthGraph A lengths := by + apply ZFSet.ext + intro z + rw [shortestLengthGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_shortestLengthEntryFormula _ _ _ _ _) + exact equal ▸ selected + +noncomputable def relationDepthGraph (A R root : ZFSet.{u}) : ZFSet.{u} := + shortestLengthGraph A (M.relationPathLengths A R root) + +theorem relationDepthGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A R root : ZFSet.{u}} (hA : A ∈ M.sets) (hR : R ∈ M.sets) (hRoot : root ∈ M.sets) : + M.relationDepthGraph A R root ∈ M.sets := + M.shortestLengthGraph_mem pairing unions powers separation infinite hA + (M.relationPathLengths_mem pairing unions powers separation infinite hA hR hRoot) +end TransitiveGround + +variable {B : Type u} (s : Presentation B) (depth : B → Nat) {lengths : ZFSet.{u}} +variable (valid : ∀ x, ZFSet.pair (natSetCode (depth x)) (s.encode x) ∈ lengths) +variable (minimal : ∀ x n, ZFSet.pair (natSetCode n) (s.encode x) ∈ lengths → depth x ≤ n) +include valid minimal + +theorem shortestLengthGraph_entry (x : B) (n : Nat) : + ZFSet.pair (s.encode x) (natSetCode n) ∈ shortestLengthGraph s.carrier lengths ↔ n = depth x := by + rw [pair_mem_shortestLengthGraph] + constructor + · rintro ⟨_, _, entry, least⟩ + have lower := minimal x n entry + have notLower : ¬ depth x < n := fun h => least _ ((natSetCode_mem_iff _ _).2 h) (valid x) + omega + · rintro rfl + refine ⟨s.encode_mem x, natSetCode_mem_omega _, valid x, ?_⟩ + intro k hk entry + obtain ⟨n, hn, rfl⟩ := (mem_natSetCode k (depth x)).1 hk + exact Nat.not_lt_of_ge (minimal x n entry) hn + +theorem shortestLengthGraph_eq_graph : + shortestLengthGraph s.carrier lengths = s.graph natPresentation (fun x => ⟨depth x⟩) := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨x, hx, n, hn, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have equal := (shortestLengthGraph_entry s depth valid minimal x n).1 entry + exact (s.pair_mem_graph natPresentation (fun x => ⟨depth x⟩) x ⟨n⟩).2 (congrArg ULift.up equal.symm) + · intro entry + obtain ⟨x, rfl⟩ := (s.mem_graph natPresentation (fun x => ⟨depth x⟩) z).1 entry + exact (shortestLengthGraph_entry s depth valid minimal x (depth x)).2 rfl + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def LowerDepthEdgeCode (omega depths adjacency p v : ZFSet.{u}) : Prop := + ZFSet.pair p v ∈ adjacency ∧ ∃ n ∈ omega, ∃ m ∈ omega, + ZFSet.pair v n ∈ depths ∧ ZFSet.pair p m ∈ depths ∧ n = insert m m + +noncomputable def treeParentGraph (V depths adjacency root : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ v ∈ V, ∃ p ∈ V, z = ZFSet.pair v p ∧ + ((v = root ∧ p = root) ∨ LowerDepthEdgeCode ZFSet.omega depths adjacency p v)) (ZFSet.prod V V) + +theorem pair_mem_treeParentGraph (V depths adjacency root v p : ZFSet.{u}) : + ZFSet.pair v p ∈ treeParentGraph V depths adjacency root ↔ v ∈ V ∧ p ∈ V ∧ + ((v = root ∧ p = root) ∨ LowerDepthEdgeCode ZFSet.omega depths adjacency p v) := by + rw [treeParentGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, v', hv, p', hp, equal, body⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hv, hp, body⟩ + · rintro ⟨hv, hp, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hp⟩, v, hv, p, hp, rfl, body⟩ + +namespace BoundedFormula +def lowerDepthEdgeFormula {k} (omega depths adjacency p v : Fin k) : BoundedFormula k := + .conj (pairMembershipFormula p v adjacency) (exMem omega (exMem omega.succ + (.conj (pairMembershipFormula v.succ.succ 1 depths.succ.succ) + (.conj (pairMembershipFormula p.succ.succ 0 depths.succ.succ) (successorFormula 1 0))))) + +theorem truth_lowerDepthEdgeFormula {k} (omega depths adjacency p v : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (lowerDepthEdgeFormula omega depths adjacency p v) env ↔ + LowerDepthEdgeCode (env omega) (env depths) (env adjacency) (env p) (env v) := by + simp only [lowerDepthEdgeFormula, Truth, truth_pairMembershipFormula, truth_exMem, truth_successorFormula] + rfl + +def treeParentEntryFormula {k} (z V omega depths adjacency root : Fin k) : BoundedFormula k := + exMem V (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (disj (.conj (.equal 1 root.succ.succ) (.equal 0 root.succ.succ)) + (lowerDepthEdgeFormula omega.succ.succ depths.succ.succ adjacency.succ.succ 0 1)))) + +theorem truth_treeParentEntryFormula {k} (z V omega depths adjacency root : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (treeParentEntryFormula z V omega depths adjacency root) env ↔ + ∃ v ∈ env V, ∃ p ∈ env V, env z = ZFSet.pair v p ∧ + ((v = env root ∧ p = env root) ∨ LowerDepthEdgeCode (env omega) (env depths) (env adjacency) p v) := by + simp only [treeParentEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_disj, + truth_lowerDepthEdgeFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +theorem treeParentGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {V depths adjacency root : ZFSet.{u}} (hV : V ∈ M.sets) (hDepths : depths ∈ M.sets) + (hAdjacency : adjacency ∈ M.sets) (hRoot : root ∈ M.sets) : + treeParentGraph V depths adjacency root ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + let params := extend V (extend ZFSet.omega (extend depths (extend adjacency (extend root Fin.elim0)))) + have selected := M.bounded_separation_mem separation (BoundedFormula.treeParentEntryFormula 0 1 2 3 4 5) + params (Fin.cases hV (Fin.cases hOmega (Fin.cases hDepths (Fin.cases hAdjacency + (Fin.cases hRoot (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hV hV) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.treeParentEntryFormula 0 1 2 3 4 5) + (extend z params)) (ZFSet.prod V V) = treeParentGraph V depths adjacency root := by + apply ZFSet.ext + intro z + rw [treeParentGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_treeParentEntryFormula _ _ _ _ _ _ _) + exact equal ▸ selected +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars +open Forcing SetRealization SetFormula +universe u +variable (J S R : Type u) [Group J] (request : S → R) +local notation "adj" => fun x y => ∃ d : Dart J S R, source J S R request d = x ∧ target J S R request d = y + +theorem Follows.pathSteps {x y : Vertex J S R} {L : List (Dart J S R)} + (path : Follows J S R request x L y) : RelationPathSteps adj L.length x y := by + induction path with + | nil => exact .nil _ + | cons d tail ih => exact ih.cons ⟨d, rfl, rfl⟩ + +theorem follows_of_pathSteps {n : Nat} {x y : Vertex J S R} (path : RelationPathSteps adj n x y) : + ∃ L : List (Dart J S R), Follows J S R request x L y ∧ L.length = n := by + induction path with + | nil x => exact ⟨[], Follows.nil x, rfl⟩ + | @tail n x y z previous edge ih => + obtain ⟨L, followed, length⟩ := ih + obtain ⟨d, src, tgt⟩ := edge + have oneEdge : Follows J S R request y [d] z := by + rw [← src, ← tgt] + exact Follows.cons d (Follows.nil _) + exact ⟨L ++ [d], follows_append J S R request followed oneEdge, + by simp only [List.length_append, List.length_singleton, length]⟩ + +theorem depth_pathSteps (x : Vertex J S R) : + RelationPathSteps adj (depth J S R request x) (root J S R) x := + (rootPath_follows J S R request x).pathSteps J S R request + +theorem depth_le_steps {x : Vertex J S R} {n : Nat} + (path : RelationPathSteps adj n (root J S R) x) : depth J S R request x ≤ n := by + obtain ⟨L, followed, rfl⟩ := follows_of_pathSteps J S R request path + exact rootPath_shortest J S R request followed + +variable (M : Forcing.TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (s : Presentation (Vertex J S R)) {adjacency : ZFSet.{u}} +variable (edges : ∀ x y, ZFSet.pair (s.encode x) (s.encode y) ∈ adjacency ↔ + ∃ d : Dart J S R, TileStars.source J S R request d = x ∧ TileStars.target J S R request d = y) +variable (hV : s.carrier ∈ M.sets) + +include pairing unions separation infinite edges hV in +theorem depthGraph_eq_graph : + M.relationDepthGraph s.carrier adjacency (s.encode (root J S R)) = + s.graph natPresentation (fun x => ⟨depth J S R request x⟩) := by + change shortestLengthGraph s.carrier + (M.relationPathLengths s.carrier adjacency (s.encode (root J S R))) = _ + apply shortestLengthGraph_eq_graph s (depth J S R request) + (lengths := M.relationPathLengths s.carrier adjacency (s.encode (root J S R))) + · intro x + exact (M.relationPathLengths_iff_steps pairing unions separation infinite s + (fun x y => ∃ d : Dart J S R, source J S R request d = x ∧ target J S R request d = y) + edges hV (root J S R) x (depth J S R request x)).2 (depth_pathSteps J S R request x) + · intro x n entry + exact depth_le_steps J S R request + ((M.relationPathLengths_iff_steps pairing unions separation infinite s + (fun x y => ∃ d : Dart J S R, source J S R request d = x ∧ target J S R request d = y) + edges hV (root J S R) x n).1 entry) + +include pairing unions powers separation infinite edges hV in +theorem depthGraph_spec (hAdjacency : adjacency ∈ M.sets) : + M.relationDepthGraph s.carrier adjacency (s.encode (root J S R)) ∈ M.sets ∧ + ZFSet.IsFunc s.carrier ZFSet.omega (M.relationDepthGraph s.carrier adjacency (s.encode (root J S R))) ∧ + ∀ x n, ZFSet.pair (s.encode x) (natSetCode n) ∈ + M.relationDepthGraph s.carrier adjacency (s.encode (root J S R)) ↔ n = depth J S R request x := by + refine ⟨M.relationDepthGraph_mem pairing unions powers separation infinite hV hAdjacency + (M.transitive hV (s.encode_mem _)), ?_, ?_⟩ + · rw [depthGraph_eq_graph J S R request M pairing unions separation infinite s edges hV] + exact s.graph_isFunc natPresentation _ + · intro x n + rw [depthGraph_eq_graph J S R request M pairing unions separation infinite s edges hV] + have entry := s.pair_mem_graph natPresentation (fun x => ⟨depth J S R request x⟩) x ⟨n⟩ + exact entry.trans ⟨fun equal => (congrArg ULift.down equal).symm, + fun equal => congrArg ULift.up equal.symm⟩ + +end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def treeNonrootCarrier (V root : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun v => v ≠ root) V + +noncomputable def treeIncomingGraph (V D parents source target root : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ v ∈ V, ∃ d ∈ D, z = ZFSet.pair v d ∧ v ≠ root ∧ + ZFSet.pair d v ∈ target ∧ ∃ p ∈ V, ZFSet.pair d p ∈ source ∧ ZFSet.pair v p ∈ parents) + (ZFSet.prod V D) + +theorem pair_mem_treeIncomingGraph (V D parents source target root v d : ZFSet.{u}) : + ZFSet.pair v d ∈ treeIncomingGraph V D parents source target root ↔ + v ∈ V ∧ d ∈ D ∧ v ≠ root ∧ ZFSet.pair d v ∈ target ∧ + ∃ p ∈ V, ZFSet.pair d p ∈ source ∧ ZFSet.pair v p ∈ parents := by + rw [treeIncomingGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, v', hv, d', hd, equal, body⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hv, hd, body⟩ + · rintro ⟨hv, hd, body⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hd⟩, v, hv, d, hd, rfl, body⟩ + +namespace BoundedFormula +def treeIncomingEntryFormula {k} (z V D parents source target root : Fin k) : BoundedFormula k := + exMem V (exMem D.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (.conj (.neg (.equal 1 root.succ.succ)) + (.conj (pairMembershipFormula 0 1 target.succ.succ) + (exMem V.succ.succ (.conj (pairMembershipFormula 1 0 source.succ.succ.succ) + (pairMembershipFormula 2 0 parents.succ.succ.succ))))))) + +theorem truth_treeIncomingEntryFormula {k} (z V D parents source target root : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (treeIncomingEntryFormula z V D parents source target root) env ↔ + ∃ v ∈ env V, ∃ d ∈ env D, env z = ZFSet.pair v d ∧ v ≠ env root ∧ + ZFSet.pair d v ∈ env target ∧ ∃ p ∈ env V, + ZFSet.pair d p ∈ env source ∧ ZFSet.pair v p ∈ env parents := by + simp only [treeIncomingEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_pairMembershipFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +theorem treeNonrootCarrier_mem (separation : SeparationSchema M.sets) + {V root : ZFSet.{u}} (hV : V ∈ M.sets) (hRoot : root ∈ M.sets) : + treeNonrootCarrier V root ∈ M.sets := + M.bounded_separation_mem separation (.neg (.equal 0 1)) + (extend root Fin.elim0) (Fin.cases hRoot (fun i => Fin.elim0 i)) hV + +theorem treeIncomingGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {V D parents source target root : ZFSet.{u}} (hV : V ∈ M.sets) (hD : D ∈ M.sets) + (hParents : parents ∈ M.sets) (hSource : source ∈ M.sets) (hTarget : target ∈ M.sets) + (hRoot : root ∈ M.sets) : treeIncomingGraph V D parents source target root ∈ M.sets := by + let params := extend V (extend D (extend parents (extend source (extend target (extend root Fin.elim0))))) + have selected := M.bounded_separation_mem separation (BoundedFormula.treeIncomingEntryFormula 0 1 2 3 4 5 6) + params (Fin.cases hV (Fin.cases hD (Fin.cases hParents (Fin.cases hSource (Fin.cases hTarget + (Fin.cases hRoot (fun i => Fin.elim0 i))))))) (M.prod_mem pairing unions powers separation hV hD) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.treeIncomingEntryFormula 0 1 2 3 4 5 6) + (extend z params)) (ZFSet.prod V D) = treeIncomingGraph V D parents source target root := by + apply ZFSet.ext + intro z + rw [treeIncomingGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_treeIncomingEntryFormula _ _ _ _ _ _ _ _) + exact equal ▸ selected +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars +open Forcing SetRealization SetFormula +universe u +variable (J S R : Type u) [Group J] (request : S → R) +variable (s : Presentation (Vertex J S R)) (t : Presentation (Dart J S R)) +variable {parents src tgt : ZFSet.{u}} +variable (parentEntries : ∀ v p, ZFSet.pair (s.encode v) (s.encode p) ∈ parents ↔ parent J S R request v = p) +variable (sourceEntries : ∀ d v, ZFSet.pair (t.encode d) (s.encode v) ∈ src ↔ TileStars.source J S R request d = v) +variable (targetEntries : ∀ d v, ZFSet.pair (t.encode d) (s.encode v) ∈ tgt ↔ TileStars.target J S R request d = v) +include parentEntries sourceEntries targetEntries + +theorem incomingGraph_entry (v : Vertex J S R) (nonroot : v ≠ root J S R) (d : Dart J S R) : + ZFSet.pair (s.encode v) (t.encode d) ∈ treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R)) ↔ + incoming J S R request v nonroot = d := by + rw [pair_mem_treeIncomingGraph] + constructor + · rintro ⟨_, _, _, target, p, hp, source, parent⟩ + obtain ⟨p, rfl⟩ := (s.mem_carrier p).1 hp + have atTarget := (targetEntries d v).1 target + have atSource := (sourceEntries d p).1 source + have atParent := (parentEntries v p).1 parent + apply (incoming_iff J S R request v nonroot d).2 + refine ⟨atTarget, ?_⟩ + rw [atSource, ← atParent] + exact parent_depth J S R request v (fun zero => nonroot ((depth_zero_iff J S R request v).1 zero)) + · rintro rfl + refine ⟨s.encode_mem v, t.encode_mem _, fun equal => nonroot (s.injective equal), + (targetEntries _ v).2 (incoming_target J S R request v nonroot), + s.encode (parent J S R request v), s.encode_mem _, ?_, (parentEntries v _).2 rfl⟩ + exact (sourceEntries _ _).2 (parent_eq J S R request v nonroot).symm + +theorem incomingGraph_function : + ZFSet.IsFunc (treeNonrootCarrier s.carrier (s.encode (root J S R))) t.carrier + (treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R))) := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨v, hv, d, hd, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).1 + have body := (pair_mem_treeIncomingGraph _ _ _ _ _ _ _ _).1 hz + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_sep.2 ⟨hv, body.2.2.1⟩, hd⟩ + · intro v hv + obtain ⟨hv, nonroot⟩ := ZFSet.mem_sep.1 hv + obtain ⟨v, rfl⟩ := (s.mem_carrier v).1 hv + have ne : v ≠ root J S R := fun eq => nonroot (congrArg s.encode eq) + refine ⟨t.encode (incoming J S R request v ne), + (incomingGraph_entry J S R request s t parentEntries sourceEntries targetEntries v ne _).2 rfl, ?_⟩ + intro d hd + have body := (pair_mem_treeIncomingGraph _ _ _ _ _ _ _ _).1 hd + obtain ⟨d, rfl⟩ := (t.mem_carrier d).1 body.2.1 + exact congrArg t.encode ((incomingGraph_entry J S R request s t parentEntries sourceEntries targetEntries v ne d).1 hd).symm + +theorem incomingGraph_spec (M : Forcing.TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hV : s.carrier ∈ M.sets) (hD : t.carrier ∈ M.sets) + (hParents : parents ∈ M.sets) (hSource : src ∈ M.sets) (hTarget : tgt ∈ M.sets) : + treeNonrootCarrier s.carrier (s.encode (root J S R)) ∈ M.sets ∧ + treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R)) ∈ M.sets ∧ + ZFSet.IsFunc (treeNonrootCarrier s.carrier (s.encode (root J S R))) t.carrier + (treeIncomingGraph s.carrier t.carrier parents src tgt (s.encode (root J S R))) := by + have hRoot := M.transitive hV (s.encode_mem (root J S R)) + exact ⟨M.treeNonrootCarrier_mem separation hV hRoot, + M.treeIncomingGraph_mem pairing unions powers separation hV hD hParents hSource hTarget hRoot, + incomingGraph_function J S R request s t parentEntries sourceEntries targetEntries⟩ + +end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileTreeGluing.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileTreeGluing.lean index a542b3c0dd68b0cd801c497bf54b7eaf8aab16d5..a23472ab73675f23aabb86e6c9dbfba6f044dcab 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileTreeGluing.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/TileTreeGluing.lean @@ -1,498 +1,498 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.IdealChain - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -namespace RootedGluing - -open Attachment -universe u - -def chainIso {A B C : Type u} {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} - (f : MeetIso P Q) (g : MeetIso Q R) : MeetIso P R where - toMeetEmbedding := compose f.toMeetEmbedding g.toMeetEmbedding - inverse x := f.inverse (g.inverse x) - left_inverse x := by - change f.inverse (g.inverse (g.toFun (f.toFun x))) = x - rw [g.left_inverse, f.left_inverse] - right_inverse x := by - change g.toFun (f.toFun (f.inverse (g.inverse x))) = x - rw [f.right_inverse, g.right_inverse] - -structure Scheme (V : Type u) where - root : V - depth : V → Nat - depth_root : depth root = 0 - zero_eq_root : ∀ v, depth v = 0 → v = root - parent : V → V - parent_depth : ∀ v, depth v ≠ 0 → depth (parent v) + 1 = depth v - Space : V → Type u - order : ∀ v, MeetOrder (Space v) - childAnchor : ∀ v, depth v ≠ 0 → Space v - parentAnchor : ∀ v, depth v ≠ 0 → Space (parent v) - link : ∀ v h, MeetIso (idealOrder (order v) (childAnchor v h)) - (idealOrder (order (parent v)) (parentAnchor v h)) - -namespace Scheme -variable {V : Type u} (d : Scheme V) - -structure Stage (n : Nat) where - Point : Type u - order : MeetOrder Point - vertex : ∀ v, d.depth v ≤ n → IdealEmbedding (d.order v) order - -noncomputable def initial : d.Stage 0 where - Point := d.Space d.root - order := d.order d.root - vertex v hv := by - have eq := d.zero_eq_root v (Nat.eq_zero_of_le_zero hv) - subst v - exact IdealEmbedding.identity _ - -namespace Stage -variable {d} {n : Nat} (s : d.Stage n) - -def Layer (_s : d.Stage n) := {v : V // d.depth v = n + 1} - -theorem layer_nonzero (v : s.Layer) : d.depth v.val ≠ 0 := by - rw [v.property] - exact Nat.succ_ne_zero n - -theorem parent_present (v : s.Layer) : d.depth (d.parent v.val) ≤ n := by - have h := d.parent_depth v.val (s.layer_nonzero v) - rw [v.property] at h - omega - -noncomputable def batch : PrincipalBatch.Family s.order s.Layer where - Space v := d.Space v.val - order v := d.order v.val - glue v := { - leftAnchor := (s.vertex (d.parent v.val) (s.parent_present v)).toFun - (d.parentAnchor v.val (s.layer_nonzero v)) - rightAnchor := d.childAnchor v.val (s.layer_nonzero v) - overlap := chainIso (d.link v.val (s.layer_nonzero v)) - ((s.vertex (d.parent v.val) (s.parent_present v)).principalIso - (d.parentAnchor v.val (s.layer_nonzero v))) } - -noncomputable def successor : d.Stage (n + 1) := by - classical - exact { - Point := s.batch.Node - order := s.batch.extension - vertex := fun v hv => - if old : d.depth v ≤ n then (s.vertex v old).comp s.batch.old - else s.batch.tile ⟨v, by omega⟩ } - -theorem successor_old (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : - (s.successor.vertex v (Nat.le_succ_of_le hv)).toFun x = - s.batch.old.toFun ((s.vertex v hv).toFun x) := by - dsimp only [successor] - erw [dite_eq_left hv] - rfl - -theorem successor_new (v : s.Layer) (x : d.Space v.val) : - (s.successor.vertex v.val v.property.le).toFun x = (s.batch.tile v).toFun x := by - have fresh : ¬ d.depth v.val ≤ n := by rw [v.property]; omega - dsimp only [successor] - erw [dite_eq_right fresh] - rfl - -end Stage - -noncomputable def stages : (n : Nat) → d.Stage n - | 0 => d.initial - | n + 1 => (stages n).successor - -noncomputable def chain : IdealChain where - Point n := (d.stages n).Point - order n := (d.stages n).order - next n := (d.stages n).batch.old - -theorem vertex_coherent {n m : Nat} (hnm : n ≤ m) (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : - d.chain.up hnm ((d.stages n).vertex v hv |>.toFun x) = - ((d.stages m).vertex v (Nat.le_trans hv hnm)).toFun x := by - induction hnm with - | refl => exact d.chain.up_self _ _ - | @step m h ih => - erw [d.chain.up_succ h, ih] - exact ((d.stages m).successor_old v (le_trans hv h) x).symm - -def Node := d.chain.Union -noncomputable def gluedOrder : MeetOrder d.Node := d.chain.unionOrder - -noncomputable def vertex (v : V) : IdealEmbedding (d.order v) d.gluedOrder := - ((d.stages (d.depth v)).vertex v (le_refl _)).comp (d.chain.inclusion (d.depth v)) - -theorem vertex_at (v : V) (n : Nat) (hv : d.depth v ≤ n) (x : d.Space v) : - (d.vertex v).toFun x = d.chain.point n (((d.stages n).vertex v hv).toFun x) := by - change d.chain.point (d.depth v) (((d.stages (d.depth v)).vertex v (le_refl _)).toFun x) = _ - erw [← d.chain.include_up hv, d.vertex_coherent hv] - -theorem vertex_principal (v : V) (top : d.Space v) (greatest : ∀ x, (d.order v).le x top) - (z : d.Node) : d.gluedOrder.le z ((d.vertex v).toFun top) ↔ ∃ x, (d.vertex v).toFun x = z := - (d.vertex v).principal top greatest z - -theorem vertex_greatest_part (v : V) (top : d.Space v) (greatest : ∀ x, (d.order v).le x top) - (z : d.Node) (x : d.Space v) : - d.gluedOrder.le ((d.vertex v).toFun x) z ↔ - (d.order v).le x ((d.vertex v).projection top z) := - (d.vertex v).greatest_part top greatest z x - -end Scheme -end RootedGluing - - - -namespace RootedGluing.Scheme - -open Attachment -universe u -variable {V : Type u} (d : Scheme V) - -theorem stage_cover (n : Nat) (x : (d.stages n).Point) : - ∃ (v : V) (hv : d.depth v ≤ n) (a : d.Space v), ((d.stages n).vertex v hv).toFun a = x := by - induction n with - | zero => exact ⟨d.root, d.depth_root.le, x, rfl⟩ - | succ n ih => - rcases (d.stages n).batch.cover x with ⟨a, rfl⟩ | ⟨v, a, rfl⟩ - · rcases ih a with ⟨v, hv, b, eq⟩ - refine ⟨v, Nat.le_succ_of_le hv, b, ?_⟩ - exact ((d.stages n).successor_old v hv b).trans (congrArg _ eq) - · exact ⟨v.val, v.property.le, a, (d.stages n).successor_new v a⟩ - -theorem cover (x : d.Node) : ∃ v a, (d.vertex v).toFun a = x := by - rcases d.chain.cover x with ⟨n, a, rfl⟩ - rcases d.stage_cover n a with ⟨v, hv, b, eq⟩ - exact ⟨v, b, (d.vertex_at v n hv b).trans (congrArg _ eq)⟩ - -theorem comparison_in_vertex (x y : d.Node) (lower : d.gluedOrder.le x y) : - ∃ v a b, (d.vertex v).toFun a = x ∧ (d.vertex v).toFun b = y ∧ (d.order v).le a b := by - rcases d.cover y with ⟨v, b, rfl⟩ - rcases (d.vertex v).ideal b x lower with ⟨a, rfl⟩ - exact ⟨v, a, b, rfl, rfl, ((d.vertex v).le_iff _ _).mp lower⟩ - -theorem point_next (n : Nat) (x : (d.stages n).Point) : - d.chain.point (n + 1) ((d.stages n).batch.old.toFun x) = d.chain.point n x := by - have eq := d.chain.include_up (Nat.le_succ n) x - erw [d.chain.up_succ (Nat.le_refl n), d.chain.up_self] at eq - exact eq - -theorem parent_identification (v : V) (h : d.depth v ≠ 0) - (x : {x : d.Space v // (d.order v).le x (d.childAnchor v h)}) : - (d.vertex v).toFun x.val = (d.vertex (d.parent v)).toFun ((d.link v h).toFun x).val := by - let n := d.depth (d.parent v) - let s := d.stages n - let i : s.Layer := ⟨v, (d.parent_depth v h).symm⟩ - have base : (s.batch.tile i).toFun x.val = - s.batch.old.toFun ((s.vertex (d.parent v) (s.parent_present i)).toFun ((d.link v h).toFun x).val) := by - apply (s.batch.tile_old_overlap i x.val _).mpr - exact ⟨x.property, rfl⟩ - exact (d.vertex_at v (n + 1) i.property.le x.val).trans - ((congrArg (d.chain.point (n + 1)) (s.successor_new i x.val)).trans - ((congrArg (d.chain.point (n + 1)) base).trans - ((d.point_next n _).trans (d.vertex_at (d.parent v) n (s.parent_present i) _).symm))) - -theorem fresh_old_meet (n : Nat) (x : (d.stages n).batch.Fresh) (a : (d.stages n).Point) : - d.gluedOrder.meet (d.chain.point (n + 1) (.inr x)) (d.chain.point n a) = - d.chain.point n ((d.stages n).order.meet - (((d.stages n).batch.glue x.1).shadow x.2.val) a) := by - rw [← d.point_next n a] - change d.chain.unionOrder.meet - ((d.chain.inclusion (n + 1)).toFun (.inr x)) - ((d.chain.inclusion (n + 1)).toFun ((d.stages n).batch.old.toFun a)) = _ - erw [← (d.chain.inclusion (n + 1)).map_meet] - change d.chain.point (n + 1) - ((d.stages n).batch.extension.meet (.inr x) ((d.stages n).batch.old.toFun a)) = _ - rw [(d.stages n).batch.fresh_old_meet, d.point_next] - -theorem no_later_nodes_below_stage (n : Nat) (a : (d.stages n).Point) (x : d.Node) - (lower : d.gluedOrder.le x (d.chain.point n a)) : ∃ b, d.chain.point n b = x := - (d.chain.inclusion n).ideal a x lower - -end RootedGluing.Scheme - - - -section - -namespace EdgeWords -universe u -variable {E : Type u} - -theorem append_reduced_or_cancelled (L : List (E × Bool)) (d : E × Bool) - (h : NoBacktracking L) : - NoBacktracking (L ++ [d]) ∨ ∃ pre, L = pre ++ [reverse d] := by - classical - induction L with - | nil => exact Or.inl True.intro - | cons a tail ih => - cases tail with - | nil => - by_cases back : d = reverse a - · refine Or.inr ⟨[], ?_⟩ - have twice : reverse (reverse a) = a := by - rcases a with ⟨e, b⟩ - cases b <;> rfl - rw [back, twice] - rfl - · exact Or.inl ⟨back, True.intro⟩ - | cons b tail => - rcases ih h.2 with reduced | ⟨pre, eq⟩ - · exact Or.inl ⟨h.1, reduced⟩ - · exact Or.inr ⟨a :: pre, congrArg (List.cons a) eq⟩ - -end EdgeWords - -namespace CosetGeometry.TileStars -universe u -variable (J S R : Type u) [Group J] (request : S → R) - -theorem depth_zero_iff (v : Vertex J S R) : depth J S R request v = 0 ↔ v = root J S R := by - simp only [depth, List.length_eq_zero_iff, rootPath_empty_iff] - -theorem edge_root_paths (d : Dart J S R) : - rootPath J S R request (target J S R request d) = - rootPath J S R request (source J S R request d) ++ [d] ∨ - rootPath J S R request (source J S R request d) = - rootPath J S R request (target J S R request d) ++ [reverse J S R d] := by - have first := rootPath_follows J S R request (source J S R request d) - have reduced := rootPath_reduced J S R request (source J S R request d) - rcases EdgeWords.append_reduced_or_cancelled _ d reduced with forward | ⟨pre, eq⟩ - · apply Or.inl - exact rootPath_eq J S R request - (follows_append J S R request first (Follows.cons d (Follows.nil _))) forward - · rw [eq] at first reduced - have prefixPath := (follows_last J S R request pre (reverse J S R d) first).1 - rw [source_reverse] at prefixPath - have canonical := rootPath_eq J S R request prefixPath - (EdgeWords.no_backtracking_append_left pre _ reduced) - exact Or.inr (eq.trans (congrArg (fun L => L ++ [reverse J S R d]) canonical.symm)) - -noncomputable def incoming (v : Vertex J S R) (nonroot : v ≠ root J S R) : Dart J S R := - Classical.choose (exists_parent_edge J S R request v nonroot) - -theorem incoming_target (v : Vertex J S R) (nonroot : v ≠ root J S R) : - target J S R request (incoming J S R request v nonroot) = v := - (Classical.choose_spec (exists_parent_edge J S R request v nonroot)).1 - -theorem incoming_path (v : Vertex J S R) (nonroot : v ≠ root J S R) : - rootPath J S R request v = - rootPath J S R request (source J S R request (incoming J S R request v nonroot)) ++ - [incoming J S R request v nonroot] := - (Classical.choose_spec (exists_parent_edge J S R request v nonroot)).2.1 - -noncomputable def parent (v : Vertex J S R) : Vertex J S R := by - classical - exact if h : v = root J S R then root J S R else - source J S R request (incoming J S R request v h) - -theorem parent_eq (v : Vertex J S R) (nonroot : v ≠ root J S R) : - parent J S R request v = source J S R request (incoming J S R request v nonroot) := by - simp only [parent, dite_eq_right nonroot] - -theorem parent_depth (v : Vertex J S R) (nonzero : depth J S R request v ≠ 0) : - depth J S R request (parent J S R request v) + 1 = depth J S R request v := by - have nonroot : v ≠ root J S R := fun h => nonzero ((depth_zero_iff J S R request v).mpr h) - rw [parent_eq J S R request v nonroot] - exact (Classical.choose_spec (exists_parent_edge J S R request v nonroot)).2.2.symm - -theorem extension_nonroot (d : Dart J S R) - (eq : rootPath J S R request (target J S R request d) = - rootPath J S R request (source J S R request d) ++ [d]) : - target J S R request d ≠ root J S R := by - intro h - rw [h, rootPath_root] at eq - have lengths := congrArg List.length eq - simp only [List.length_nil, List.length_append, List.length_cons] at lengths - omega - -theorem incoming_of_extension (d : Dart J S R) - (eq : rootPath J S R request (target J S R request d) = - rootPath J S R request (source J S R request d) ++ [d]) : - incoming J S R request (target J S R request d) - (extension_nonroot J S R request d eq) = d := by - have other := incoming_path J S R request (target J S R request d) - (extension_nonroot J S R request d eq) - have lasts := congrArg List.getLast? (other.symm.trans eq) - simpa only [List.getLast?_append, List.getLast?_singleton, Option.some_or, Option.some.injEq] using lasts - -theorem edge_is_parent (d : Dart J S R) : - (target J S R request d ≠ root J S R ∧ - parent J S R request (target J S R request d) = source J S R request d) ∨ - (source J S R request d ≠ root J S R ∧ - parent J S R request (source J S R request d) = target J S R request d) := by - rcases edge_root_paths J S R request d with forward | backward - · have nonroot := extension_nonroot J S R request d forward - exact Or.inl ⟨nonroot, (parent_eq J S R request _ nonroot).trans - (congrArg (source J S R request) (incoming_of_extension J S R request d forward))⟩ - · have reversed : rootPath J S R request (target J S R request (reverse J S R d)) = - rootPath J S R request (source J S R request (reverse J S R d)) ++ [reverse J S R d] := by - rw [source_reverse, target_reverse] - exact backward - have nonroot := extension_nonroot J S R request (reverse J S R d) reversed - have same := (parent_eq J S R request _ nonroot).trans - (congrArg (source J S R request) (incoming_of_extension J S R request (reverse J S R d) reversed)) - simp only [source_reverse, target_reverse] at nonroot same - exact Or.inr ⟨nonroot, same⟩ - -end CosetGeometry.TileStars -end - - - -namespace CosetGeometry.TileStars -universe u -variable (J S R : Type u) [Group J] (request : S → R) - -theorem parent_root : parent J S R request (root J S R) = root J S R := by - simp [parent] - -theorem parent_of_depth_edge (d : Dart J S R) - (lower : depth J S R request (source J S R request d) + 1 = depth J S R request (target J S R request d)) : - parent J S R request (target J S R request d) = source J S R request d := by - rcases edge_is_parent J S R request d with ⟨_, forward⟩ | ⟨nonroot, backward⟩ - · exact forward - · have nonzero : depth J S R request (source J S R request d) ≠ 0 := - fun zero => nonroot ((depth_zero_iff J S R request _).1 zero) - have bound := parent_depth J S R request _ nonzero - rw [backward] at bound - omega - -theorem parent_iff (v p : Vertex J S R) : - parent J S R request v = p ↔ (v = root J S R ∧ p = root J S R) ∨ - ((∃ d : Dart J S R, source J S R request d = p ∧ target J S R request d = v) ∧ - depth J S R request p + 1 = depth J S R request v) := by - constructor - · rintro rfl - by_cases equal : v = root J S R - · exact Or.inl ⟨equal, equal ▸ parent_root J S R request⟩ - · exact Or.inr ⟨⟨incoming J S R request v equal, (parent_eq J S R request v equal).symm, - incoming_target J S R request v equal⟩, - parent_depth J S R request v (fun zero => equal ((depth_zero_iff J S R request v).1 zero))⟩ - · rintro (⟨rfl, rfl⟩ | ⟨⟨d, src, tgt⟩, lower⟩) - · exact parent_root J S R request - · rw [← src, ← tgt] at lower ⊢ - exact parent_of_depth_edge J S R request d lower - -theorem incoming_iff (v : Vertex J S R) (nonroot : v ≠ root J S R) (d : Dart J S R) : - incoming J S R request v nonroot = d ↔ target J S R request d = v ∧ - depth J S R request (source J S R request d) + 1 = depth J S R request v := by - constructor - · rintro rfl - refine ⟨incoming_target J S R request v nonroot, ?_⟩ - rw [← parent_eq J S R request v nonroot] - exact parent_depth J S R request v (fun zero => nonroot ((depth_zero_iff J S R request v).1 zero)) - · rintro ⟨tgt, lower⟩ - have lower' := lower - rw [← tgt] at lower' - rcases edge_root_paths J S R request d with forward | backward - · have same := incoming_of_extension J S R request d forward - simpa only [tgt] using same - · have lengths := congrArg List.length backward - change depth J S R request (source J S R request d) = - (rootPath J S R request (target J S R request d) ++ [reverse J S R d]).length at lengths - rw [List.length_append, List.length_singleton] at lengths - change depth J S R request (source J S R request d) = depth J S R request (target J S R request d) + 1 at lengths - omega - -end CosetGeometry.TileStars - - - -namespace CosetGeometry.TileStars - -open Attachment -universe u -variable (J S R : Type u) [Group J] (request : S → R) - -structure Spaces where - Space : Vertex J S R → Type u - order : ∀ v, MeetOrder (Space v) - leftAnchor : ∀ e : Edge J S R, Space (source J S R request (e, true)) - rightAnchor : ∀ e : Edge J S R, Space (target J S R request (e, true)) - overlap : ∀ e, MeetIso - (idealOrder (order (source J S R request (e, true))) (leftAnchor e)) - (idealOrder (order (target J S R request (e, true))) (rightAnchor e)) - -namespace Spaces -variable {J S R request} (g : Spaces J S R request) - -def anchor (d : Dart J S R) : g.Space (source J S R request d) := by - rcases d with ⟨e, b⟩ - cases b - · exact g.rightAnchor e - · exact g.leftAnchor e - -def arrow (d : Dart J S R) : MeetIso - (idealOrder (g.order (source J S R request d)) (g.anchor d)) - (idealOrder (g.order (target J S R request d)) (g.anchor (reverse J S R d))) := by - rcases d with ⟨e, b⟩ - cases b - · exact inverseIso (g.overlap e) - · exact g.overlap e - -def edgeInput (d : Dart J S R) : PrincipalAmalgamation.Input - (g.order (source J S R request d)) (g.order (target J S R request d)) where - leftAnchor := g.anchor d - rightAnchor := g.anchor (reverse J S R d) - overlap := inverseIso (g.arrow d) - -def reindexInput {v w v' w' : Vertex J S R} (hv : v = v') (hw : w = w') - (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : - PrincipalAmalgamation.Input (g.order v') (g.order w') := hv ▸ hw ▸ i - -noncomputable def localGlue (v : Vertex J S R) (nonzero : depth J S R request v ≠ 0) : - PrincipalAmalgamation.Input (g.order (parent J S R request v)) (g.order v) := by - have nonroot : v ≠ root J S R := fun h => nonzero ((depth_zero_iff J S R request v).mpr h) - exact g.reindexInput (parent_eq J S R request v nonroot).symm - (incoming_target J S R request v nonroot) (g.edgeInput (incoming J S R request v nonroot)) - -noncomputable def scheme : RootedGluing.Scheme (Vertex J S R) where - root := root J S R - depth := depth J S R request - depth_root := (depth_zero_iff J S R request _).mpr rfl - zero_eq_root v := (depth_zero_iff J S R request v).mp - parent := parent J S R request - parent_depth := parent_depth J S R request - Space := g.Space - order := g.order - childAnchor v h := (g.localGlue v h).rightAnchor - parentAnchor v h := (g.localGlue v h).leftAnchor - link v h := (g.localGlue v h).overlap - -def Node := g.scheme.Node -noncomputable def gluedOrder : MeetOrder g.Node := g.scheme.gluedOrder -noncomputable def vertex (v : Vertex J S R) : IdealEmbedding (g.order v) g.gluedOrder := - g.scheme.vertex v - -theorem vertex_principal (v : Vertex J S R) (top : g.Space v) - (greatest : ∀ x, (g.order v).le x top) (z : g.Node) : - g.gluedOrder.le z ((g.vertex v).toFun top) ↔ ∃ x, (g.vertex v).toFun x = z := - g.scheme.vertex_principal v top greatest z - -theorem vertex_greatest_part (v : Vertex J S R) (top : g.Space v) - (greatest : ∀ x, (g.order v).le x top) (z : g.Node) (x : g.Space v) : - g.gluedOrder.le ((g.vertex v).toFun x) z ↔ - (g.order v).le x ((g.vertex v).projection top z) := - g.scheme.vertex_greatest_part v top greatest z x - -theorem parent_identification (v : Vertex J S R) (h : depth J S R request v ≠ 0) - (x : {x : g.Space v // (g.order v).le x (g.localGlue v h).rightAnchor}) : - (g.vertex v).toFun x.val = - (g.vertex (parent J S R request v)).toFun ((g.localGlue v h).overlap.toFun x).val := - g.scheme.parent_identification v h x - -theorem cover (z : g.Node) : ∃ v x, (g.vertex v).toFun x = z := g.scheme.cover z - -theorem comparison_in_vertex (x y : g.Node) (lower : g.gluedOrder.le x y) : - ∃ v a b, (g.vertex v).toFun a = x ∧ (g.vertex v).toFun b = y ∧ (g.order v).le a b := - g.scheme.comparison_in_vertex x y lower - -end Spaces -end CosetGeometry.TileStars - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.IdealChain + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +namespace RootedGluing + +open Attachment +universe u + +def chainIso {A B C : Type u} {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} + (f : MeetIso P Q) (g : MeetIso Q R) : MeetIso P R where + toMeetEmbedding := compose f.toMeetEmbedding g.toMeetEmbedding + inverse x := f.inverse (g.inverse x) + left_inverse x := by + change f.inverse (g.inverse (g.toFun (f.toFun x))) = x + rw [g.left_inverse, f.left_inverse] + right_inverse x := by + change g.toFun (f.toFun (f.inverse (g.inverse x))) = x + rw [f.right_inverse, g.right_inverse] + +structure Scheme (V : Type u) where + root : V + depth : V → Nat + depth_root : depth root = 0 + zero_eq_root : ∀ v, depth v = 0 → v = root + parent : V → V + parent_depth : ∀ v, depth v ≠ 0 → depth (parent v) + 1 = depth v + Space : V → Type u + order : ∀ v, MeetOrder (Space v) + childAnchor : ∀ v, depth v ≠ 0 → Space v + parentAnchor : ∀ v, depth v ≠ 0 → Space (parent v) + link : ∀ v h, MeetIso (idealOrder (order v) (childAnchor v h)) + (idealOrder (order (parent v)) (parentAnchor v h)) + +namespace Scheme +variable {V : Type u} (d : Scheme V) + +structure Stage (n : Nat) where + Point : Type u + order : MeetOrder Point + vertex : ∀ v, d.depth v ≤ n → IdealEmbedding (d.order v) order + +noncomputable def initial : d.Stage 0 where + Point := d.Space d.root + order := d.order d.root + vertex v hv := by + have eq := d.zero_eq_root v (Nat.eq_zero_of_le_zero hv) + subst v + exact IdealEmbedding.identity _ + +namespace Stage +variable {d} {n : Nat} (s : d.Stage n) + +def Layer (_s : d.Stage n) := {v : V // d.depth v = n + 1} + +theorem layer_nonzero (v : s.Layer) : d.depth v.val ≠ 0 := by + rw [v.property] + exact Nat.succ_ne_zero n + +theorem parent_present (v : s.Layer) : d.depth (d.parent v.val) ≤ n := by + have h := d.parent_depth v.val (s.layer_nonzero v) + rw [v.property] at h + omega + +noncomputable def batch : PrincipalBatch.Family s.order s.Layer where + Space v := d.Space v.val + order v := d.order v.val + glue v := { + leftAnchor := (s.vertex (d.parent v.val) (s.parent_present v)).toFun + (d.parentAnchor v.val (s.layer_nonzero v)) + rightAnchor := d.childAnchor v.val (s.layer_nonzero v) + overlap := chainIso (d.link v.val (s.layer_nonzero v)) + ((s.vertex (d.parent v.val) (s.parent_present v)).principalIso + (d.parentAnchor v.val (s.layer_nonzero v))) } + +noncomputable def successor : d.Stage (n + 1) := by + classical + exact { + Point := s.batch.Node + order := s.batch.extension + vertex := fun v hv => + if old : d.depth v ≤ n then (s.vertex v old).comp s.batch.old + else s.batch.tile ⟨v, by omega⟩ } + +theorem successor_old (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : + (s.successor.vertex v (Nat.le_succ_of_le hv)).toFun x = + s.batch.old.toFun ((s.vertex v hv).toFun x) := by + dsimp only [successor] + erw [dite_eq_left hv] + rfl + +theorem successor_new (v : s.Layer) (x : d.Space v.val) : + (s.successor.vertex v.val v.property.le).toFun x = (s.batch.tile v).toFun x := by + have fresh : ¬ d.depth v.val ≤ n := by rw [v.property]; omega + dsimp only [successor] + erw [dite_eq_right fresh] + rfl + +end Stage + +noncomputable def stages : (n : Nat) → d.Stage n + | 0 => d.initial + | n + 1 => (stages n).successor + +noncomputable def chain : IdealChain where + Point n := (d.stages n).Point + order n := (d.stages n).order + next n := (d.stages n).batch.old + +theorem vertex_coherent {n m : Nat} (hnm : n ≤ m) (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : + d.chain.up hnm ((d.stages n).vertex v hv |>.toFun x) = + ((d.stages m).vertex v (Nat.le_trans hv hnm)).toFun x := by + induction hnm with + | refl => exact d.chain.up_self _ _ + | @step m h ih => + erw [d.chain.up_succ h, ih] + exact ((d.stages m).successor_old v (le_trans hv h) x).symm + +def Node := d.chain.Union +noncomputable def gluedOrder : MeetOrder d.Node := d.chain.unionOrder + +noncomputable def vertex (v : V) : IdealEmbedding (d.order v) d.gluedOrder := + ((d.stages (d.depth v)).vertex v (le_refl _)).comp (d.chain.inclusion (d.depth v)) + +theorem vertex_at (v : V) (n : Nat) (hv : d.depth v ≤ n) (x : d.Space v) : + (d.vertex v).toFun x = d.chain.point n (((d.stages n).vertex v hv).toFun x) := by + change d.chain.point (d.depth v) (((d.stages (d.depth v)).vertex v (le_refl _)).toFun x) = _ + erw [← d.chain.include_up hv, d.vertex_coherent hv] + +theorem vertex_principal (v : V) (top : d.Space v) (greatest : ∀ x, (d.order v).le x top) + (z : d.Node) : d.gluedOrder.le z ((d.vertex v).toFun top) ↔ ∃ x, (d.vertex v).toFun x = z := + (d.vertex v).principal top greatest z + +theorem vertex_greatest_part (v : V) (top : d.Space v) (greatest : ∀ x, (d.order v).le x top) + (z : d.Node) (x : d.Space v) : + d.gluedOrder.le ((d.vertex v).toFun x) z ↔ + (d.order v).le x ((d.vertex v).projection top z) := + (d.vertex v).greatest_part top greatest z x + +end Scheme +end RootedGluing + + + +namespace RootedGluing.Scheme + +open Attachment +universe u +variable {V : Type u} (d : Scheme V) + +theorem stage_cover (n : Nat) (x : (d.stages n).Point) : + ∃ (v : V) (hv : d.depth v ≤ n) (a : d.Space v), ((d.stages n).vertex v hv).toFun a = x := by + induction n with + | zero => exact ⟨d.root, d.depth_root.le, x, rfl⟩ + | succ n ih => + rcases (d.stages n).batch.cover x with ⟨a, rfl⟩ | ⟨v, a, rfl⟩ + · rcases ih a with ⟨v, hv, b, eq⟩ + refine ⟨v, Nat.le_succ_of_le hv, b, ?_⟩ + exact ((d.stages n).successor_old v hv b).trans (congrArg _ eq) + · exact ⟨v.val, v.property.le, a, (d.stages n).successor_new v a⟩ + +theorem cover (x : d.Node) : ∃ v a, (d.vertex v).toFun a = x := by + rcases d.chain.cover x with ⟨n, a, rfl⟩ + rcases d.stage_cover n a with ⟨v, hv, b, eq⟩ + exact ⟨v, b, (d.vertex_at v n hv b).trans (congrArg _ eq)⟩ + +theorem comparison_in_vertex (x y : d.Node) (lower : d.gluedOrder.le x y) : + ∃ v a b, (d.vertex v).toFun a = x ∧ (d.vertex v).toFun b = y ∧ (d.order v).le a b := by + rcases d.cover y with ⟨v, b, rfl⟩ + rcases (d.vertex v).ideal b x lower with ⟨a, rfl⟩ + exact ⟨v, a, b, rfl, rfl, ((d.vertex v).le_iff _ _).mp lower⟩ + +theorem point_next (n : Nat) (x : (d.stages n).Point) : + d.chain.point (n + 1) ((d.stages n).batch.old.toFun x) = d.chain.point n x := by + have eq := d.chain.include_up (Nat.le_succ n) x + erw [d.chain.up_succ (Nat.le_refl n), d.chain.up_self] at eq + exact eq + +theorem parent_identification (v : V) (h : d.depth v ≠ 0) + (x : {x : d.Space v // (d.order v).le x (d.childAnchor v h)}) : + (d.vertex v).toFun x.val = (d.vertex (d.parent v)).toFun ((d.link v h).toFun x).val := by + let n := d.depth (d.parent v) + let s := d.stages n + let i : s.Layer := ⟨v, (d.parent_depth v h).symm⟩ + have base : (s.batch.tile i).toFun x.val = + s.batch.old.toFun ((s.vertex (d.parent v) (s.parent_present i)).toFun ((d.link v h).toFun x).val) := by + apply (s.batch.tile_old_overlap i x.val _).mpr + exact ⟨x.property, rfl⟩ + exact (d.vertex_at v (n + 1) i.property.le x.val).trans + ((congrArg (d.chain.point (n + 1)) (s.successor_new i x.val)).trans + ((congrArg (d.chain.point (n + 1)) base).trans + ((d.point_next n _).trans (d.vertex_at (d.parent v) n (s.parent_present i) _).symm))) + +theorem fresh_old_meet (n : Nat) (x : (d.stages n).batch.Fresh) (a : (d.stages n).Point) : + d.gluedOrder.meet (d.chain.point (n + 1) (.inr x)) (d.chain.point n a) = + d.chain.point n ((d.stages n).order.meet + (((d.stages n).batch.glue x.1).shadow x.2.val) a) := by + rw [← d.point_next n a] + change d.chain.unionOrder.meet + ((d.chain.inclusion (n + 1)).toFun (.inr x)) + ((d.chain.inclusion (n + 1)).toFun ((d.stages n).batch.old.toFun a)) = _ + erw [← (d.chain.inclusion (n + 1)).map_meet] + change d.chain.point (n + 1) + ((d.stages n).batch.extension.meet (.inr x) ((d.stages n).batch.old.toFun a)) = _ + rw [(d.stages n).batch.fresh_old_meet, d.point_next] + +theorem no_later_nodes_below_stage (n : Nat) (a : (d.stages n).Point) (x : d.Node) + (lower : d.gluedOrder.le x (d.chain.point n a)) : ∃ b, d.chain.point n b = x := + (d.chain.inclusion n).ideal a x lower + +end RootedGluing.Scheme + + + +section + +namespace EdgeWords +universe u +variable {E : Type u} + +theorem append_reduced_or_cancelled (L : List (E × Bool)) (d : E × Bool) + (h : NoBacktracking L) : + NoBacktracking (L ++ [d]) ∨ ∃ pre, L = pre ++ [reverse d] := by + classical + induction L with + | nil => exact Or.inl True.intro + | cons a tail ih => + cases tail with + | nil => + by_cases back : d = reverse a + · refine Or.inr ⟨[], ?_⟩ + have twice : reverse (reverse a) = a := by + rcases a with ⟨e, b⟩ + cases b <;> rfl + rw [back, twice] + rfl + · exact Or.inl ⟨back, True.intro⟩ + | cons b tail => + rcases ih h.2 with reduced | ⟨pre, eq⟩ + · exact Or.inl ⟨h.1, reduced⟩ + · exact Or.inr ⟨a :: pre, congrArg (List.cons a) eq⟩ + +end EdgeWords + +namespace CosetGeometry.TileStars +universe u +variable (J S R : Type u) [Group J] (request : S → R) + +theorem depth_zero_iff (v : Vertex J S R) : depth J S R request v = 0 ↔ v = root J S R := by + simp only [depth, List.length_eq_zero_iff, rootPath_empty_iff] + +theorem edge_root_paths (d : Dart J S R) : + rootPath J S R request (target J S R request d) = + rootPath J S R request (source J S R request d) ++ [d] ∨ + rootPath J S R request (source J S R request d) = + rootPath J S R request (target J S R request d) ++ [reverse J S R d] := by + have first := rootPath_follows J S R request (source J S R request d) + have reduced := rootPath_reduced J S R request (source J S R request d) + rcases EdgeWords.append_reduced_or_cancelled _ d reduced with forward | ⟨pre, eq⟩ + · apply Or.inl + exact rootPath_eq J S R request + (follows_append J S R request first (Follows.cons d (Follows.nil _))) forward + · rw [eq] at first reduced + have prefixPath := (follows_last J S R request pre (reverse J S R d) first).1 + rw [source_reverse] at prefixPath + have canonical := rootPath_eq J S R request prefixPath + (EdgeWords.no_backtracking_append_left pre _ reduced) + exact Or.inr (eq.trans (congrArg (fun L => L ++ [reverse J S R d]) canonical.symm)) + +noncomputable def incoming (v : Vertex J S R) (nonroot : v ≠ root J S R) : Dart J S R := + Classical.choose (exists_parent_edge J S R request v nonroot) + +theorem incoming_target (v : Vertex J S R) (nonroot : v ≠ root J S R) : + target J S R request (incoming J S R request v nonroot) = v := + (Classical.choose_spec (exists_parent_edge J S R request v nonroot)).1 + +theorem incoming_path (v : Vertex J S R) (nonroot : v ≠ root J S R) : + rootPath J S R request v = + rootPath J S R request (source J S R request (incoming J S R request v nonroot)) ++ + [incoming J S R request v nonroot] := + (Classical.choose_spec (exists_parent_edge J S R request v nonroot)).2.1 + +noncomputable def parent (v : Vertex J S R) : Vertex J S R := by + classical + exact if h : v = root J S R then root J S R else + source J S R request (incoming J S R request v h) + +theorem parent_eq (v : Vertex J S R) (nonroot : v ≠ root J S R) : + parent J S R request v = source J S R request (incoming J S R request v nonroot) := by + simp only [parent, dite_eq_right nonroot] + +theorem parent_depth (v : Vertex J S R) (nonzero : depth J S R request v ≠ 0) : + depth J S R request (parent J S R request v) + 1 = depth J S R request v := by + have nonroot : v ≠ root J S R := fun h => nonzero ((depth_zero_iff J S R request v).mpr h) + rw [parent_eq J S R request v nonroot] + exact (Classical.choose_spec (exists_parent_edge J S R request v nonroot)).2.2.symm + +theorem extension_nonroot (d : Dart J S R) + (eq : rootPath J S R request (target J S R request d) = + rootPath J S R request (source J S R request d) ++ [d]) : + target J S R request d ≠ root J S R := by + intro h + rw [h, rootPath_root] at eq + have lengths := congrArg List.length eq + simp only [List.length_nil, List.length_append, List.length_cons] at lengths + omega + +theorem incoming_of_extension (d : Dart J S R) + (eq : rootPath J S R request (target J S R request d) = + rootPath J S R request (source J S R request d) ++ [d]) : + incoming J S R request (target J S R request d) + (extension_nonroot J S R request d eq) = d := by + have other := incoming_path J S R request (target J S R request d) + (extension_nonroot J S R request d eq) + have lasts := congrArg List.getLast? (other.symm.trans eq) + simpa only [List.getLast?_append, List.getLast?_singleton, Option.some_or, Option.some.injEq] using lasts + +theorem edge_is_parent (d : Dart J S R) : + (target J S R request d ≠ root J S R ∧ + parent J S R request (target J S R request d) = source J S R request d) ∨ + (source J S R request d ≠ root J S R ∧ + parent J S R request (source J S R request d) = target J S R request d) := by + rcases edge_root_paths J S R request d with forward | backward + · have nonroot := extension_nonroot J S R request d forward + exact Or.inl ⟨nonroot, (parent_eq J S R request _ nonroot).trans + (congrArg (source J S R request) (incoming_of_extension J S R request d forward))⟩ + · have reversed : rootPath J S R request (target J S R request (reverse J S R d)) = + rootPath J S R request (source J S R request (reverse J S R d)) ++ [reverse J S R d] := by + rw [source_reverse, target_reverse] + exact backward + have nonroot := extension_nonroot J S R request (reverse J S R d) reversed + have same := (parent_eq J S R request _ nonroot).trans + (congrArg (source J S R request) (incoming_of_extension J S R request (reverse J S R d) reversed)) + simp only [source_reverse, target_reverse] at nonroot same + exact Or.inr ⟨nonroot, same⟩ + +end CosetGeometry.TileStars +end + + + +namespace CosetGeometry.TileStars +universe u +variable (J S R : Type u) [Group J] (request : S → R) + +theorem parent_root : parent J S R request (root J S R) = root J S R := by + simp [parent] + +theorem parent_of_depth_edge (d : Dart J S R) + (lower : depth J S R request (source J S R request d) + 1 = depth J S R request (target J S R request d)) : + parent J S R request (target J S R request d) = source J S R request d := by + rcases edge_is_parent J S R request d with ⟨_, forward⟩ | ⟨nonroot, backward⟩ + · exact forward + · have nonzero : depth J S R request (source J S R request d) ≠ 0 := + fun zero => nonroot ((depth_zero_iff J S R request _).1 zero) + have bound := parent_depth J S R request _ nonzero + rw [backward] at bound + omega + +theorem parent_iff (v p : Vertex J S R) : + parent J S R request v = p ↔ (v = root J S R ∧ p = root J S R) ∨ + ((∃ d : Dart J S R, source J S R request d = p ∧ target J S R request d = v) ∧ + depth J S R request p + 1 = depth J S R request v) := by + constructor + · rintro rfl + by_cases equal : v = root J S R + · exact Or.inl ⟨equal, equal ▸ parent_root J S R request⟩ + · exact Or.inr ⟨⟨incoming J S R request v equal, (parent_eq J S R request v equal).symm, + incoming_target J S R request v equal⟩, + parent_depth J S R request v (fun zero => equal ((depth_zero_iff J S R request v).1 zero))⟩ + · rintro (⟨rfl, rfl⟩ | ⟨⟨d, src, tgt⟩, lower⟩) + · exact parent_root J S R request + · rw [← src, ← tgt] at lower ⊢ + exact parent_of_depth_edge J S R request d lower + +theorem incoming_iff (v : Vertex J S R) (nonroot : v ≠ root J S R) (d : Dart J S R) : + incoming J S R request v nonroot = d ↔ target J S R request d = v ∧ + depth J S R request (source J S R request d) + 1 = depth J S R request v := by + constructor + · rintro rfl + refine ⟨incoming_target J S R request v nonroot, ?_⟩ + rw [← parent_eq J S R request v nonroot] + exact parent_depth J S R request v (fun zero => nonroot ((depth_zero_iff J S R request v).1 zero)) + · rintro ⟨tgt, lower⟩ + have lower' := lower + rw [← tgt] at lower' + rcases edge_root_paths J S R request d with forward | backward + · have same := incoming_of_extension J S R request d forward + simpa only [tgt] using same + · have lengths := congrArg List.length backward + change depth J S R request (source J S R request d) = + (rootPath J S R request (target J S R request d) ++ [reverse J S R d]).length at lengths + rw [List.length_append, List.length_singleton] at lengths + change depth J S R request (source J S R request d) = depth J S R request (target J S R request d) + 1 at lengths + omega + +end CosetGeometry.TileStars + + + +namespace CosetGeometry.TileStars + +open Attachment +universe u +variable (J S R : Type u) [Group J] (request : S → R) + +structure Spaces where + Space : Vertex J S R → Type u + order : ∀ v, MeetOrder (Space v) + leftAnchor : ∀ e : Edge J S R, Space (source J S R request (e, true)) + rightAnchor : ∀ e : Edge J S R, Space (target J S R request (e, true)) + overlap : ∀ e, MeetIso + (idealOrder (order (source J S R request (e, true))) (leftAnchor e)) + (idealOrder (order (target J S R request (e, true))) (rightAnchor e)) + +namespace Spaces +variable {J S R request} (g : Spaces J S R request) + +def anchor (d : Dart J S R) : g.Space (source J S R request d) := by + rcases d with ⟨e, b⟩ + cases b + · exact g.rightAnchor e + · exact g.leftAnchor e + +def arrow (d : Dart J S R) : MeetIso + (idealOrder (g.order (source J S R request d)) (g.anchor d)) + (idealOrder (g.order (target J S R request d)) (g.anchor (reverse J S R d))) := by + rcases d with ⟨e, b⟩ + cases b + · exact inverseIso (g.overlap e) + · exact g.overlap e + +def edgeInput (d : Dart J S R) : PrincipalAmalgamation.Input + (g.order (source J S R request d)) (g.order (target J S R request d)) where + leftAnchor := g.anchor d + rightAnchor := g.anchor (reverse J S R d) + overlap := inverseIso (g.arrow d) + +def reindexInput {v w v' w' : Vertex J S R} (hv : v = v') (hw : w = w') + (i : PrincipalAmalgamation.Input (g.order v) (g.order w)) : + PrincipalAmalgamation.Input (g.order v') (g.order w') := hv ▸ hw ▸ i + +noncomputable def localGlue (v : Vertex J S R) (nonzero : depth J S R request v ≠ 0) : + PrincipalAmalgamation.Input (g.order (parent J S R request v)) (g.order v) := by + have nonroot : v ≠ root J S R := fun h => nonzero ((depth_zero_iff J S R request v).mpr h) + exact g.reindexInput (parent_eq J S R request v nonroot).symm + (incoming_target J S R request v nonroot) (g.edgeInput (incoming J S R request v nonroot)) + +noncomputable def scheme : RootedGluing.Scheme (Vertex J S R) where + root := root J S R + depth := depth J S R request + depth_root := (depth_zero_iff J S R request _).mpr rfl + zero_eq_root v := (depth_zero_iff J S R request v).mp + parent := parent J S R request + parent_depth := parent_depth J S R request + Space := g.Space + order := g.order + childAnchor v h := (g.localGlue v h).rightAnchor + parentAnchor v h := (g.localGlue v h).leftAnchor + link v h := (g.localGlue v h).overlap + +def Node := g.scheme.Node +noncomputable def gluedOrder : MeetOrder g.Node := g.scheme.gluedOrder +noncomputable def vertex (v : Vertex J S R) : IdealEmbedding (g.order v) g.gluedOrder := + g.scheme.vertex v + +theorem vertex_principal (v : Vertex J S R) (top : g.Space v) + (greatest : ∀ x, (g.order v).le x top) (z : g.Node) : + g.gluedOrder.le z ((g.vertex v).toFun top) ↔ ∃ x, (g.vertex v).toFun x = z := + g.scheme.vertex_principal v top greatest z + +theorem vertex_greatest_part (v : Vertex J S R) (top : g.Space v) + (greatest : ∀ x, (g.order v).le x top) (z : g.Node) (x : g.Space v) : + g.gluedOrder.le ((g.vertex v).toFun x) z ↔ + (g.order v).le x ((g.vertex v).projection top z) := + g.scheme.vertex_greatest_part v top greatest z x + +theorem parent_identification (v : Vertex J S R) (h : depth J S R request v ≠ 0) + (x : {x : g.Space v // (g.order v).le x (g.localGlue v h).rightAnchor}) : + (g.vertex v).toFun x.val = + (g.vertex (parent J S R request v)).toFun ((g.localGlue v h).overlap.toFun x).val := + g.scheme.parent_identification v h x + +theorem cover (z : g.Node) : ∃ v x, (g.vertex v).toFun x = z := g.scheme.cover z + +theorem comparison_in_vertex (x y : g.Node) (lower : g.gluedOrder.le x y) : + ∃ v a b, (g.vertex v).toFun a = x ∧ (g.vertex v).toFun b = y ∧ (g.order v).le a b := + g.scheme.comparison_in_vertex x y lower + +end Spaces +end CosetGeometry.TileStars + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/UniformAtomicEquality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/UniformAtomicEquality.lean index c78ee5301318f92eee4ec14b7d414b7157d18af3..0000227a65b3f2b9c2c27d23db8e188eb98b7ee1 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Geometry/UniformAtomicEquality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Geometry/UniformAtomicEquality.lean @@ -1,471 +1,471 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BoundedAtomicEquality - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem collection_witness (collection : CollectionSchema M.sets) - {n : Nat} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {a : ZFSet.{u}} (ha : a ∈ M.sets) - (existsWitness : ∀ x ∈ a, ∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params))) : - ∃ b ∈ M.sets, ∀ x ∈ a, ∃ y ∈ b, Realize M.sets φ (extend x (extend y params)) := by - obtain ⟨b, hb, spec⟩ := collection φ params members a ha (fun x _ hx => existsWitness x hx) - refine ⟨b, hb, ?_⟩ - intro x hx - obtain ⟨y, _, hy, rel⟩ := spec x (M.transitive ha hx) hx - exact ⟨y, hy, rel⟩ - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def transitiveSetFormula {n : Nat} (t : Fin n) : SetFormula n := - .all (imp (.mem 0 t.succ) (.all (imp (.mem 0 1) (.mem 0 t.succ.succ)))) - -def transitiveCoverFormula : SetFormula 2 := - .conj (.mem 0 1) (transitiveSetFormula 1) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem realize_transitiveSetFormula {n : Nat} (t : Fin n) (env : Fin n → ZFSet.{u}) - (ht : env t ∈ M.sets) : - Realize M.sets (transitiveSetFormula t) env ↔ - ∀ x ∈ env t, ∀ y ∈ x, y ∈ env t := by - simp only [transitiveSetFormula, realize_imp, Realize] - constructor - · intro h x hx y hy - exact h x (M.transitive ht hx) hx y (M.transitive (M.transitive ht hx) hy) hy - · intro h x _ hx y _ hy - exact h x hx y hy - -theorem realize_transitiveCoverFormula (x T : ZFSet.{u}) (hT : T ∈ M.sets) : - Realize M.sets transitiveCoverFormula (extend x (extend T Fin.elim0)) ↔ - x ∈ T ∧ ∀ z ∈ T, ∀ y ∈ z, y ∈ T := by - change (x ∈ T ∧ Realize M.sets (transitiveSetFormula 1) _) ↔ _ - rw [M.realize_transitiveSetFormula 1 _ hT] - rfl - -theorem exists_transitiveCover - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) : - ∀ x ∈ M.sets, ∃ T ∈ M.sets, x ∈ T ∧ ∀ z ∈ T, ∀ y ∈ z, y ∈ T := by - intro x - induction x using ZFSet.inductionOn with - | h x ih => - intro hx - have witnesses : ∀ y ∈ x, ∃ T ∈ M.sets, - Realize M.sets transitiveCoverFormula (extend y (extend T Fin.elim0)) := by - intro y hy - obtain ⟨T, hT, member, trans⟩ := ih y hy (M.transitive hx hy) - exact ⟨T, hT, (M.realize_transitiveCoverFormula y T hT).2 ⟨member, trans⟩⟩ - obtain ⟨W, hW, covers⟩ := M.collection_witness collection transitiveCoverFormula Fin.elim0 - (fun i => Fin.elim0 i) hx witnesses - let C := ZFSet.sep (fun T => Realize M.sets (transitiveSetFormula 0) (extend T Fin.elim0)) W - have hC : C ∈ M.sets := M.separation_mem separation (transitiveSetFormula 0) Fin.elim0 - (fun i => Fin.elim0 i) hW - have transC : ∀ T ∈ C, ∀ z ∈ T, ∀ y ∈ z, y ∈ T := by - intro T hTC - obtain ⟨hTW, spec⟩ := ZFSet.mem_sep.1 hTC - exact (M.realize_transitiveSetFormula 0 (extend T Fin.elim0) (M.transitive hW hTW)).1 spec - have included : x ⊆ ZFSet.sUnion C := by - intro y hy - obtain ⟨T, hTW, spec⟩ := covers y hy - have hT := M.transitive hW hTW - obtain ⟨member, trans⟩ := (M.realize_transitiveCoverFormula y T hT).1 spec - exact ZFSet.mem_sUnion.2 ⟨T, ZFSet.mem_sep.2 ⟨hTW, - (M.realize_transitiveSetFormula 0 (extend T Fin.elim0) hT).2 trans⟩, member⟩ - have transU : ∀ z ∈ ZFSet.sUnion C, ∀ y ∈ z, y ∈ ZFSet.sUnion C := by - intro z hz y hy - obtain ⟨T, hTC, hzT⟩ := ZFSet.mem_sUnion.1 hz - exact ZFSet.mem_sUnion.2 ⟨T, hTC, transC T hTC z hzT y hy⟩ - let T := ({x, x} : ZFSet.{u}) ∪ ZFSet.sUnion C - have hT : T ∈ M.sets := M.binary_union_mem pairing unions - (M.unorderedPair_mem pairing hx hx) (M.union_mem unions hC) - refine ⟨T, hT, ZFSet.mem_union.2 (Or.inl (ZFSet.mem_pair.2 (Or.inl rfl))), ?_⟩ - intro z hz y hy - apply ZFSet.mem_union.2 - apply Or.inr - rcases ZFSet.mem_union.1 hz with hz | hz - · rcases ZFSet.mem_pair.1 hz with rfl | rfl - · exact included hy - · exact included hy - · exact transU z hz y hy - -theorem exists_pair_transitiveCover - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : - ∃ T ∈ M.sets, x ∈ T ∧ y ∈ T ∧ ∀ z ∈ T, ∀ w ∈ z, w ∈ T := by - obtain ⟨T, hT, pair, trans⟩ := M.exists_transitiveCover pairing unions separation collection - ({x, y} : ZFSet.{u}) (M.unorderedPair_mem pairing hx hy) - exact ⟨T, hT, trans _ pair x (ZFSet.mem_pair.2 (Or.inl rfl)), - trans _ pair y (ZFSet.mem_pair.2 (Or.inr rfl)), trans⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -def EqualityMeaning (D : Name.NameDomain s) {k : Nat} (E : SetFormula (k + 3)) - (constants : Fin k → ZFSet.{u}) : Prop := - ∀ (p : P) (σ τ : D.names), - Realize M.sets E (extend (s.encode p) (extend σ.val.val (extend τ.val.val constants))) ↔ - Name.ForcesEq p σ.val τ.val - -theorem realize_membershipFormula (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) - (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) - (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) - (atomic : M.EqualityMeaning s D E (fun j => env (params j))) - (p : P) (σ τ : D.names) (hp : env pi = s.encode p) - (hσ : env si = σ.val.val) (hτ : env ti = τ.val.val) : - Realize M.sets (membershipFormula E c o params pi si ti) env ↔ - Name.ForcesMem p σ.val τ.val := by - have hτM : env ti ∈ M.sets := hτ ▸ ground τ.val τ.property - rw [membershipFormula, M.realize_allConditions s _ _ env carrier hc] - change (∀ q : P, Realize M.sets _ (extend (s.encode q) env)) ↔ - ∀ q, q ≤ p → ∃ t, t ≤ q ∧ ∃ ν r, - Name.Entry ν τ.val r ∧ t ≤ r ∧ Name.ForcesEq t σ.val ν - apply forall_congr' - intro q - rw [realize_imp, M.realize_conditionLE s pairing carrier order 0 pi.succ (params o).succ - (extend (s.encode q) env) q p rfl hp ho] - apply forall_congr' - intro _ - rw [M.realize_exConditions s (params c).succ _ (extend (s.encode q) env) carrier hc] - constructor - · rintro ⟨t, ht⟩ - obtain ⟨v, hv, rest⟩ := (realize_ex M.sets _ _).1 ht - obtain ⟨r, entry, tq, tr, eq⟩ := (M.realize_exConditions s (params c).succ.succ.succ _ - (extend v (extend (s.encode t) (extend (s.encode q) env))) carrier hc).1 rest - let e := extend (s.encode r) (extend v (extend (s.encode t) (extend (s.encode q) env))) - have raw := (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e - hv (M.transitive carrier (s.encode_mem r)) hτM).1 entry - change ZFSet.pair v (s.encode r) ∈ env ti at raw - rw [hτ] at raw - let ν : Name s := ⟨v, Name.isName_of_pair_mem τ.val v r raw⟩ - have hν : ν ∈ D.names := D.children τ.property raw - have forced := (realize_atomicApplication M.sets E - (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).1 eq - change Realize M.sets E (extend (s.encode t) (extend (env si) - (extend v (fun j => env (params j))))) at forced - rw [hσ] at forced - exact ⟨t, (M.realize_conditionLE s pairing carrier order 2 3 - (params o).succ.succ.succ.succ e t q rfl rfl ho).1 tq, - ν, r, raw, (M.realize_conditionLE s pairing carrier order 2 0 - (params o).succ.succ.succ.succ e t r rfl rfl ho).1 tr, - (atomic t σ ⟨ν, hν⟩).1 forced⟩ - · rintro ⟨t, tq, ν, r, entry, tr, forced⟩ - have hν : ν ∈ D.names := D.children τ.property entry - refine ⟨t, ?_⟩ - rw [realize_ex] - refine ⟨ν.val, ground ν hν, ?_⟩ - apply (M.realize_exConditions s (params c).succ.succ.succ _ - (extend ν.val (extend (s.encode t) (extend (s.encode q) env))) carrier hc).2 - let e := extend (s.encode r) (extend ν.val (extend (s.encode t) (extend (s.encode q) env))) - refine ⟨r, ?_, ?_, ?_, ?_⟩ - · apply (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e - (ground ν hν) (M.transitive carrier (s.encode_mem r)) hτM).2 - change ZFSet.pair ν.val (s.encode r) ∈ env ti - rw [hτ] - exact entry - · exact (M.realize_conditionLE s pairing carrier order 2 3 - (params o).succ.succ.succ.succ e t q rfl rfl ho).2 tq - · exact (M.realize_conditionLE s pairing carrier order 2 0 - (params o).succ.succ.succ.succ e t r rfl rfl ho).2 tr - · apply (realize_atomicApplication M.sets E - (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).2 - change Realize M.sets E (extend (s.encode t) (extend (env si) - (extend ν.val (fun j => env (params j))))) - rw [hσ] - exact (atomic t σ ⟨ν, hν⟩).2 forced - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable {P : Type u} (s : Presentation P) - -def namesInTransitiveSet (T : ZFSet.{u}) - (trans : ∀ {x y : ZFSet.{u}}, x ∈ T → y ∈ x → y ∈ T) : Name.NameDomain s := - nameDomain ⟨{x | x ∈ T}, trans⟩ s - -variable (M : TransitiveGround.{u}) [Preorder P] - -theorem exists_transitiveCover_atomicEquality - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (T : ZFSet.{u}) (hT : T ∈ M.sets) - (trans : ∀ {x y : ZFSet.{u}}, x ∈ T → y ∈ x → y ∈ T) : - ∃ S ∈ M.sets, ∀ p (σ τ : Name s), σ.val ∈ T → τ.val ∈ T → - (Name.codedEqualityRelation s S p σ τ ↔ Name.ForcesEq p σ τ) := by - let D := namesInTransitiveSet s T trans - have ground : ∀ τ ∈ D.names, τ.val ∈ M.sets := fun _ hτ => M.transitive hT hτ - obtain ⟨C, hC, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT - obtain ⟨B, hB, tripleBound⟩ := M.exists_pair_bound pairing unions powers carrier hC - have bound : ∀ p (σ τ : D.names), - ZFSet.pair (s.encode p) (ZFSet.pair σ.val.val τ.val.val) ∈ B := by - intro p σ τ - exact tripleBound (s.encode p) (s.encode_mem p) _ - (pairBound σ.val.val σ.property τ.val.val τ.property) - obtain ⟨S, hS, _, spec⟩ := M.exists_bounded_atomicEquality s D ground pairing unions powers - separation carrier order B hB bound - refine ⟨S, hS, ?_⟩ - intro p σ τ hσ hτ - exact spec p ⟨σ, hσ⟩ ⟨τ, hτ⟩ - -end PartitionPilot.Forcing.TransitiveGround - - -section - -namespace PartitionPilot.Forcing.SetFormula - -def equalityCertificateFormula : SetFormula 3 := postfixedFormula equalityStateFormula - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem equalityCertificate_sound (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (S : ZFSet.{u}) (hS : S ∈ M.sets) - (certificate : Realize M.sets equalityCertificateFormula (extend S (equalityParameters s))) - (p : P) (σ τ : D.names) : - Name.codedEqualityRelation s S p σ.val τ.val → Name.ForcesEq p σ.val τ.val := by - have post : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, - Name.codedEqualityRelation s S p σ τ → Name.EqualityStep (Name.codedEqualityRelation s S) p σ τ := by - intro σ hσ τ hτ p rel - have step := (realize_imp M.sets _ _ _).1 - (certificate _ (M.transitive hS rel)) rel - exact (M.realize_equalityState_names s D ground pairing carrier order S hS - p ⟨σ, hσ⟩ ⟨τ, hτ⟩).1 step - exact Name.postfixed_equality_sound D (Name.codedEqualityRelation s S) post - σ.val σ.property τ.val τ.property p - -theorem exists_equalityState_fixedPoint - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (B : ZFSet.{u}) (hB : B ∈ M.sets) : - ∃ S ∈ M.sets, S ⊆ B ∧ - definableOperator M.sets equalityStateFormula (equalityParameters s) B S = S := by - have members : ∀ i, equalityParameters s i ∈ M.sets := - Fin.cases carrier (Fin.cases order (fun i => Fin.elim0 i)) - have mono : ∀ S ∈ M.sets, ∀ T ∈ M.sets, S ⊆ B → T ⊆ B → S ⊆ T → - definableOperator M.sets equalityStateFormula (equalityParameters s) B S ⊆ - definableOperator M.sets equalityStateFormula (equalityParameters s) B T := by - intro S hS T hT _ _ sub z hz - obtain ⟨hzB, step⟩ := ZFSet.mem_sep.1 hz - exact ZFSet.mem_sep.2 ⟨hzB, - M.equalityState_mono s pairing carrier order (M.transitive hB hzB) hS hT sub step⟩ - obtain ⟨S, hS, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation - equalityStateFormula (equalityParameters s) members hB mono - exact ⟨S, hS, bound, fixed⟩ - -theorem fixedPoint_equalityCertificate {B S : ZFSet.{u}} (hS : S ∈ M.sets) (bound : S ⊆ B) - (fixed : definableOperator M.sets equalityStateFormula (equalityParameters s) B S = S) : - Realize M.sets equalityCertificateFormula (extend S (equalityParameters s)) := by - apply (M.realize_postfixedFormula equalityStateFormula (equalityParameters s) hS bound).2 - rw [fixed] - -theorem equality_fixedPoint_iff (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {B S : ZFSet.{u}} (hS : S ∈ M.sets) - (bound : ∀ p (σ τ : D.names), ZFSet.pair (s.encode p) (ZFSet.pair σ.val.val τ.val.val) ∈ B) - (fixed : definableOperator M.sets equalityStateFormula (equalityParameters s) B S = S) - (p : P) (σ τ : D.names) : - Name.codedEqualityRelation s S p σ.val τ.val ↔ Name.ForcesEq p σ.val τ.val := by - have step : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, - Name.codedEqualityRelation s S p σ τ ↔ Name.EqualityStep (Name.codedEqualityRelation s S) p σ τ := by - intro σ hσ τ hτ p - change ZFSet.pair (s.encode p) (ZFSet.pair σ.val τ.val) ∈ S ↔ _ - calc - _ ↔ ZFSet.pair (s.encode p) (ZFSet.pair σ.val τ.val) ∈ - definableOperator M.sets equalityStateFormula (equalityParameters s) B S := by rw [fixed] - _ ↔ _ := by - rw [definableOperator, ZFSet.mem_sep, - M.realize_equalityState_names s D ground pairing carrier order S hS p ⟨σ, hσ⟩ ⟨τ, hτ⟩] - exact and_iff_right (bound p ⟨σ, hσ⟩ ⟨τ, hτ⟩) - exact Name.fixed_equality_iff D (Name.codedEqualityRelation s S) step σ.property τ.property p - -end PartitionPilot.Forcing.TransitiveGround - -end - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem exists_atomicEquality_certificate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (p : P) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) - (forced : Name.ForcesEq p σ τ) : - ∃ S ∈ M.sets, Realize M.sets equalityCertificateFormula (extend S (equalityParameters s)) ∧ - Name.codedEqualityRelation s S p σ τ := by - obtain ⟨T, hT, σT, τT, trans⟩ := M.exists_pair_transitiveCover pairing unions separation collection hσ hτ - let D := namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy) - have ground : ∀ ν ∈ D.names, ν.val ∈ M.sets := fun _ hν => M.transitive hT hν - obtain ⟨C, hC, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT - obtain ⟨B, hB, tripleBound⟩ := M.exists_pair_bound pairing unions powers carrier hC - have bound : ∀ q (ν ρ : D.names), - ZFSet.pair (s.encode q) (ZFSet.pair ν.val.val ρ.val.val) ∈ B := by - intro q ν ρ - exact tripleBound (s.encode q) (s.encode_mem q) _ - (pairBound ν.val.val ν.property ρ.val.val ρ.property) - obtain ⟨S, hS, hSB, fixed⟩ := M.exists_equalityState_fixedPoint s pairing unions powers separation - carrier order B hB - exact ⟨S, hS, M.fixedPoint_equalityCertificate s hS hSB fixed, - (M.equality_fixedPoint_iff s D ground pairing carrier order hS bound fixed p ⟨σ, σT⟩ ⟨τ, τT⟩).2 forced⟩ - -theorem forcesEq_iff_exists_certificate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (p : P) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : - Name.ForcesEq p σ τ ↔ - ∃ S ∈ M.sets, Realize M.sets equalityCertificateFormula (extend S (equalityParameters s)) ∧ - Name.codedEqualityRelation s S p σ τ := by - constructor - · exact M.exists_atomicEquality_certificate s pairing unions powers separation collection carrier order - p σ τ hσ hτ - · rintro ⟨S, hS, certificate, rel⟩ - exact M.equalityCertificate_sound s (M.nameDomain s) (fun _ h => h) - pairing carrier order S hS certificate p ⟨σ, hσ⟩ ⟨τ, hτ⟩ rel - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.SetFormula - -universe u v - -theorem map_empty {A : Type u} {B : Type v} (f : A → B) : - (fun i : Fin 0 => f (Fin.elim0 i)) = (Fin.elim0 : Fin 0 → B) := by - funext i - exact Fin.elim0 i - -def uniformEqualityFormula : SetFormula 5 := - ex (.conj (atomicApplication equalityCertificateFormula Fin.elim0 0 4 5) - (tripleMembershipFormula 1 2 3 0)) - -def liftedEqualityFormula {k : Nat} (c o : Fin k) : SetFormula (k + 3) := - atomicApplication uniformEqualityFormula - (extend c.succ.succ.succ (extend o.succ.succ.succ Fin.elim0)) 0 1 2 - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem realize_uniformEqualityFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (p : P) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : - Realize M.sets uniformEqualityFormula - (extend (s.encode p) (extend σ.val (extend τ.val (equalityParameters s)))) ↔ - Name.ForcesEq p σ τ := by - rw [M.forcesEq_iff_exists_certificate s pairing unions powers separation collection carrier order p σ τ hσ hτ, - uniformEqualityFormula, realize_ex] - apply exists_congr - intro S - apply and_congr_right - intro hS - let env := extend S (extend (s.encode p) (extend σ.val (extend τ.val (equalityParameters s)))) - change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ - rw [realize_atomicApplication, - M.realize_tripleMembershipFormula pairing 1 2 3 0 env - (M.transitive carrier (s.encode_mem p)) hσ hτ hS, map_empty] - rfl - -theorem equalityMeaning_uniform (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) : - M.EqualityMeaning s D uniformEqualityFormula (equalityParameters s) := by - intro p σ τ - exact M.realize_uniformEqualityFormula s pairing unions powers separation collection carrier order - p σ.val τ.val (ground σ.val σ.property) (ground τ.val τ.property) - -theorem equalityMeaning_lifted (D : Name.NameDomain s) - (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - {k : Nat} (c o : Fin k) (constants : Fin k → ZFSet.{u}) - (hc : constants c = s.carrier) (ho : constants o = s.conditionOrder) : - M.EqualityMeaning s D (liftedEqualityFormula c o) constants := by - intro p σ τ - rw [liftedEqualityFormula, realize_atomicApplication, map_extend, map_extend, map_empty] - change Realize M.sets uniformEqualityFormula - (extend (s.encode p) (extend σ.val.val (extend τ.val.val - (extend (constants c) (extend (constants o) Fin.elim0))))) ↔ _ - rw [hc, ho] - exact M.realize_uniformEqualityFormula s pairing unions powers separation collection carrier order - p σ.val τ.val (ground σ.val σ.property) (ground τ.val τ.property) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BoundedAtomicEquality + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem collection_witness (collection : CollectionSchema M.sets) + {n : Nat} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {a : ZFSet.{u}} (ha : a ∈ M.sets) + (existsWitness : ∀ x ∈ a, ∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params))) : + ∃ b ∈ M.sets, ∀ x ∈ a, ∃ y ∈ b, Realize M.sets φ (extend x (extend y params)) := by + obtain ⟨b, hb, spec⟩ := collection φ params members a ha (fun x _ hx => existsWitness x hx) + refine ⟨b, hb, ?_⟩ + intro x hx + obtain ⟨y, _, hy, rel⟩ := spec x (M.transitive ha hx) hx + exact ⟨y, hy, rel⟩ + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def transitiveSetFormula {n : Nat} (t : Fin n) : SetFormula n := + .all (imp (.mem 0 t.succ) (.all (imp (.mem 0 1) (.mem 0 t.succ.succ)))) + +def transitiveCoverFormula : SetFormula 2 := + .conj (.mem 0 1) (transitiveSetFormula 1) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem realize_transitiveSetFormula {n : Nat} (t : Fin n) (env : Fin n → ZFSet.{u}) + (ht : env t ∈ M.sets) : + Realize M.sets (transitiveSetFormula t) env ↔ + ∀ x ∈ env t, ∀ y ∈ x, y ∈ env t := by + simp only [transitiveSetFormula, realize_imp, Realize] + constructor + · intro h x hx y hy + exact h x (M.transitive ht hx) hx y (M.transitive (M.transitive ht hx) hy) hy + · intro h x _ hx y _ hy + exact h x hx y hy + +theorem realize_transitiveCoverFormula (x T : ZFSet.{u}) (hT : T ∈ M.sets) : + Realize M.sets transitiveCoverFormula (extend x (extend T Fin.elim0)) ↔ + x ∈ T ∧ ∀ z ∈ T, ∀ y ∈ z, y ∈ T := by + change (x ∈ T ∧ Realize M.sets (transitiveSetFormula 1) _) ↔ _ + rw [M.realize_transitiveSetFormula 1 _ hT] + rfl + +theorem exists_transitiveCover + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) : + ∀ x ∈ M.sets, ∃ T ∈ M.sets, x ∈ T ∧ ∀ z ∈ T, ∀ y ∈ z, y ∈ T := by + intro x + induction x using ZFSet.inductionOn with + | h x ih => + intro hx + have witnesses : ∀ y ∈ x, ∃ T ∈ M.sets, + Realize M.sets transitiveCoverFormula (extend y (extend T Fin.elim0)) := by + intro y hy + obtain ⟨T, hT, member, trans⟩ := ih y hy (M.transitive hx hy) + exact ⟨T, hT, (M.realize_transitiveCoverFormula y T hT).2 ⟨member, trans⟩⟩ + obtain ⟨W, hW, covers⟩ := M.collection_witness collection transitiveCoverFormula Fin.elim0 + (fun i => Fin.elim0 i) hx witnesses + let C := ZFSet.sep (fun T => Realize M.sets (transitiveSetFormula 0) (extend T Fin.elim0)) W + have hC : C ∈ M.sets := M.separation_mem separation (transitiveSetFormula 0) Fin.elim0 + (fun i => Fin.elim0 i) hW + have transC : ∀ T ∈ C, ∀ z ∈ T, ∀ y ∈ z, y ∈ T := by + intro T hTC + obtain ⟨hTW, spec⟩ := ZFSet.mem_sep.1 hTC + exact (M.realize_transitiveSetFormula 0 (extend T Fin.elim0) (M.transitive hW hTW)).1 spec + have included : x ⊆ ZFSet.sUnion C := by + intro y hy + obtain ⟨T, hTW, spec⟩ := covers y hy + have hT := M.transitive hW hTW + obtain ⟨member, trans⟩ := (M.realize_transitiveCoverFormula y T hT).1 spec + exact ZFSet.mem_sUnion.2 ⟨T, ZFSet.mem_sep.2 ⟨hTW, + (M.realize_transitiveSetFormula 0 (extend T Fin.elim0) hT).2 trans⟩, member⟩ + have transU : ∀ z ∈ ZFSet.sUnion C, ∀ y ∈ z, y ∈ ZFSet.sUnion C := by + intro z hz y hy + obtain ⟨T, hTC, hzT⟩ := ZFSet.mem_sUnion.1 hz + exact ZFSet.mem_sUnion.2 ⟨T, hTC, transC T hTC z hzT y hy⟩ + let T := ({x, x} : ZFSet.{u}) ∪ ZFSet.sUnion C + have hT : T ∈ M.sets := M.binary_union_mem pairing unions + (M.unorderedPair_mem pairing hx hx) (M.union_mem unions hC) + refine ⟨T, hT, ZFSet.mem_union.2 (Or.inl (ZFSet.mem_pair.2 (Or.inl rfl))), ?_⟩ + intro z hz y hy + apply ZFSet.mem_union.2 + apply Or.inr + rcases ZFSet.mem_union.1 hz with hz | hz + · rcases ZFSet.mem_pair.1 hz with rfl | rfl + · exact included hy + · exact included hy + · exact transU z hz y hy + +theorem exists_pair_transitiveCover + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : + ∃ T ∈ M.sets, x ∈ T ∧ y ∈ T ∧ ∀ z ∈ T, ∀ w ∈ z, w ∈ T := by + obtain ⟨T, hT, pair, trans⟩ := M.exists_transitiveCover pairing unions separation collection + ({x, y} : ZFSet.{u}) (M.unorderedPair_mem pairing hx hy) + exact ⟨T, hT, trans _ pair x (ZFSet.mem_pair.2 (Or.inl rfl)), + trans _ pair y (ZFSet.mem_pair.2 (Or.inr rfl)), trans⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +def EqualityMeaning (D : Name.NameDomain s) {k : Nat} (E : SetFormula (k + 3)) + (constants : Fin k → ZFSet.{u}) : Prop := + ∀ (p : P) (σ τ : D.names), + Realize M.sets E (extend (s.encode p) (extend σ.val.val (extend τ.val.val constants))) ↔ + Name.ForcesEq p σ.val τ.val + +theorem realize_membershipFormula (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k m : Nat} (E : SetFormula (k + 3)) (c o : Fin k) (params : Fin k → Fin m) + (pi si ti : Fin m) (env : Fin m → ZFSet.{u}) + (hc : env (params c) = s.carrier) (ho : env (params o) = s.conditionOrder) + (atomic : M.EqualityMeaning s D E (fun j => env (params j))) + (p : P) (σ τ : D.names) (hp : env pi = s.encode p) + (hσ : env si = σ.val.val) (hτ : env ti = τ.val.val) : + Realize M.sets (membershipFormula E c o params pi si ti) env ↔ + Name.ForcesMem p σ.val τ.val := by + have hτM : env ti ∈ M.sets := hτ ▸ ground τ.val τ.property + rw [membershipFormula, M.realize_allConditions s _ _ env carrier hc] + change (∀ q : P, Realize M.sets _ (extend (s.encode q) env)) ↔ + ∀ q, q ≤ p → ∃ t, t ≤ q ∧ ∃ ν r, + Name.Entry ν τ.val r ∧ t ≤ r ∧ Name.ForcesEq t σ.val ν + apply forall_congr' + intro q + rw [realize_imp, M.realize_conditionLE s pairing carrier order 0 pi.succ (params o).succ + (extend (s.encode q) env) q p rfl hp ho] + apply forall_congr' + intro _ + rw [M.realize_exConditions s (params c).succ _ (extend (s.encode q) env) carrier hc] + constructor + · rintro ⟨t, ht⟩ + obtain ⟨v, hv, rest⟩ := (realize_ex M.sets _ _).1 ht + obtain ⟨r, entry, tq, tr, eq⟩ := (M.realize_exConditions s (params c).succ.succ.succ _ + (extend v (extend (s.encode t) (extend (s.encode q) env))) carrier hc).1 rest + let e := extend (s.encode r) (extend v (extend (s.encode t) (extend (s.encode q) env))) + have raw := (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e + hv (M.transitive carrier (s.encode_mem r)) hτM).1 entry + change ZFSet.pair v (s.encode r) ∈ env ti at raw + rw [hτ] at raw + let ν : Name s := ⟨v, Name.isName_of_pair_mem τ.val v r raw⟩ + have hν : ν ∈ D.names := D.children τ.property raw + have forced := (realize_atomicApplication M.sets E + (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).1 eq + change Realize M.sets E (extend (s.encode t) (extend (env si) + (extend v (fun j => env (params j))))) at forced + rw [hσ] at forced + exact ⟨t, (M.realize_conditionLE s pairing carrier order 2 3 + (params o).succ.succ.succ.succ e t q rfl rfl ho).1 tq, + ν, r, raw, (M.realize_conditionLE s pairing carrier order 2 0 + (params o).succ.succ.succ.succ e t r rfl rfl ho).1 tr, + (atomic t σ ⟨ν, hν⟩).1 forced⟩ + · rintro ⟨t, tq, ν, r, entry, tr, forced⟩ + have hν : ν ∈ D.names := D.children τ.property entry + refine ⟨t, ?_⟩ + rw [realize_ex] + refine ⟨ν.val, ground ν hν, ?_⟩ + apply (M.realize_exConditions s (params c).succ.succ.succ _ + (extend ν.val (extend (s.encode t) (extend (s.encode q) env))) carrier hc).2 + let e := extend (s.encode r) (extend ν.val (extend (s.encode t) (extend (s.encode q) env))) + refine ⟨r, ?_, ?_, ?_, ?_⟩ + · apply (M.realize_pairMembershipFormula pairing 1 0 ti.succ.succ.succ.succ e + (ground ν hν) (M.transitive carrier (s.encode_mem r)) hτM).2 + change ZFSet.pair ν.val (s.encode r) ∈ env ti + rw [hτ] + exact entry + · exact (M.realize_conditionLE s pairing carrier order 2 3 + (params o).succ.succ.succ.succ e t q rfl rfl ho).2 tq + · exact (M.realize_conditionLE s pairing carrier order 2 0 + (params o).succ.succ.succ.succ e t r rfl rfl ho).2 tr + · apply (realize_atomicApplication M.sets E + (fun j => (params j).succ.succ.succ.succ) 2 si.succ.succ.succ.succ 1 e).2 + change Realize M.sets E (extend (s.encode t) (extend (env si) + (extend ν.val (fun j => env (params j))))) + rw [hσ] + exact (atomic t σ ⟨ν, hν⟩).2 forced + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable {P : Type u} (s : Presentation P) + +def namesInTransitiveSet (T : ZFSet.{u}) + (trans : ∀ {x y : ZFSet.{u}}, x ∈ T → y ∈ x → y ∈ T) : Name.NameDomain s := + nameDomain ⟨{x | x ∈ T}, trans⟩ s + +variable (M : TransitiveGround.{u}) [Preorder P] + +theorem exists_transitiveCover_atomicEquality + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (T : ZFSet.{u}) (hT : T ∈ M.sets) + (trans : ∀ {x y : ZFSet.{u}}, x ∈ T → y ∈ x → y ∈ T) : + ∃ S ∈ M.sets, ∀ p (σ τ : Name s), σ.val ∈ T → τ.val ∈ T → + (Name.codedEqualityRelation s S p σ τ ↔ Name.ForcesEq p σ τ) := by + let D := namesInTransitiveSet s T trans + have ground : ∀ τ ∈ D.names, τ.val ∈ M.sets := fun _ hτ => M.transitive hT hτ + obtain ⟨C, hC, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT + obtain ⟨B, hB, tripleBound⟩ := M.exists_pair_bound pairing unions powers carrier hC + have bound : ∀ p (σ τ : D.names), + ZFSet.pair (s.encode p) (ZFSet.pair σ.val.val τ.val.val) ∈ B := by + intro p σ τ + exact tripleBound (s.encode p) (s.encode_mem p) _ + (pairBound σ.val.val σ.property τ.val.val τ.property) + obtain ⟨S, hS, _, spec⟩ := M.exists_bounded_atomicEquality s D ground pairing unions powers + separation carrier order B hB bound + refine ⟨S, hS, ?_⟩ + intro p σ τ hσ hτ + exact spec p ⟨σ, hσ⟩ ⟨τ, hτ⟩ + +end PartitionPilot.Forcing.TransitiveGround + + +section + +namespace PartitionPilot.Forcing.SetFormula + +def equalityCertificateFormula : SetFormula 3 := postfixedFormula equalityStateFormula + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem equalityCertificate_sound (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (S : ZFSet.{u}) (hS : S ∈ M.sets) + (certificate : Realize M.sets equalityCertificateFormula (extend S (equalityParameters s))) + (p : P) (σ τ : D.names) : + Name.codedEqualityRelation s S p σ.val τ.val → Name.ForcesEq p σ.val τ.val := by + have post : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, + Name.codedEqualityRelation s S p σ τ → Name.EqualityStep (Name.codedEqualityRelation s S) p σ τ := by + intro σ hσ τ hτ p rel + have step := (realize_imp M.sets _ _ _).1 + (certificate _ (M.transitive hS rel)) rel + exact (M.realize_equalityState_names s D ground pairing carrier order S hS + p ⟨σ, hσ⟩ ⟨τ, hτ⟩).1 step + exact Name.postfixed_equality_sound D (Name.codedEqualityRelation s S) post + σ.val σ.property τ.val τ.property p + +theorem exists_equalityState_fixedPoint + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (B : ZFSet.{u}) (hB : B ∈ M.sets) : + ∃ S ∈ M.sets, S ⊆ B ∧ + definableOperator M.sets equalityStateFormula (equalityParameters s) B S = S := by + have members : ∀ i, equalityParameters s i ∈ M.sets := + Fin.cases carrier (Fin.cases order (fun i => Fin.elim0 i)) + have mono : ∀ S ∈ M.sets, ∀ T ∈ M.sets, S ⊆ B → T ⊆ B → S ⊆ T → + definableOperator M.sets equalityStateFormula (equalityParameters s) B S ⊆ + definableOperator M.sets equalityStateFormula (equalityParameters s) B T := by + intro S hS T hT _ _ sub z hz + obtain ⟨hzB, step⟩ := ZFSet.mem_sep.1 hz + exact ZFSet.mem_sep.2 ⟨hzB, + M.equalityState_mono s pairing carrier order (M.transitive hB hzB) hS hT sub step⟩ + obtain ⟨S, hS, bound, fixed, _⟩ := M.exists_greatest_definable_fixedPoint unions powers separation + equalityStateFormula (equalityParameters s) members hB mono + exact ⟨S, hS, bound, fixed⟩ + +theorem fixedPoint_equalityCertificate {B S : ZFSet.{u}} (hS : S ∈ M.sets) (bound : S ⊆ B) + (fixed : definableOperator M.sets equalityStateFormula (equalityParameters s) B S = S) : + Realize M.sets equalityCertificateFormula (extend S (equalityParameters s)) := by + apply (M.realize_postfixedFormula equalityStateFormula (equalityParameters s) hS bound).2 + rw [fixed] + +theorem equality_fixedPoint_iff (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {B S : ZFSet.{u}} (hS : S ∈ M.sets) + (bound : ∀ p (σ τ : D.names), ZFSet.pair (s.encode p) (ZFSet.pair σ.val.val τ.val.val) ∈ B) + (fixed : definableOperator M.sets equalityStateFormula (equalityParameters s) B S = S) + (p : P) (σ τ : D.names) : + Name.codedEqualityRelation s S p σ.val τ.val ↔ Name.ForcesEq p σ.val τ.val := by + have step : ∀ σ ∈ D.names, ∀ τ ∈ D.names, ∀ p, + Name.codedEqualityRelation s S p σ τ ↔ Name.EqualityStep (Name.codedEqualityRelation s S) p σ τ := by + intro σ hσ τ hτ p + change ZFSet.pair (s.encode p) (ZFSet.pair σ.val τ.val) ∈ S ↔ _ + calc + _ ↔ ZFSet.pair (s.encode p) (ZFSet.pair σ.val τ.val) ∈ + definableOperator M.sets equalityStateFormula (equalityParameters s) B S := by rw [fixed] + _ ↔ _ := by + rw [definableOperator, ZFSet.mem_sep, + M.realize_equalityState_names s D ground pairing carrier order S hS p ⟨σ, hσ⟩ ⟨τ, hτ⟩] + exact and_iff_right (bound p ⟨σ, hσ⟩ ⟨τ, hτ⟩) + exact Name.fixed_equality_iff D (Name.codedEqualityRelation s S) step σ.property τ.property p + +end PartitionPilot.Forcing.TransitiveGround + +end + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem exists_atomicEquality_certificate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (p : P) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) + (forced : Name.ForcesEq p σ τ) : + ∃ S ∈ M.sets, Realize M.sets equalityCertificateFormula (extend S (equalityParameters s)) ∧ + Name.codedEqualityRelation s S p σ τ := by + obtain ⟨T, hT, σT, τT, trans⟩ := M.exists_pair_transitiveCover pairing unions separation collection hσ hτ + let D := namesInTransitiveSet s T (fun hx hy => trans _ hx _ hy) + have ground : ∀ ν ∈ D.names, ν.val ∈ M.sets := fun _ hν => M.transitive hT hν + obtain ⟨C, hC, pairBound⟩ := M.exists_pair_bound pairing unions powers hT hT + obtain ⟨B, hB, tripleBound⟩ := M.exists_pair_bound pairing unions powers carrier hC + have bound : ∀ q (ν ρ : D.names), + ZFSet.pair (s.encode q) (ZFSet.pair ν.val.val ρ.val.val) ∈ B := by + intro q ν ρ + exact tripleBound (s.encode q) (s.encode_mem q) _ + (pairBound ν.val.val ν.property ρ.val.val ρ.property) + obtain ⟨S, hS, hSB, fixed⟩ := M.exists_equalityState_fixedPoint s pairing unions powers separation + carrier order B hB + exact ⟨S, hS, M.fixedPoint_equalityCertificate s hS hSB fixed, + (M.equality_fixedPoint_iff s D ground pairing carrier order hS bound fixed p ⟨σ, σT⟩ ⟨τ, τT⟩).2 forced⟩ + +theorem forcesEq_iff_exists_certificate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (p : P) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : + Name.ForcesEq p σ τ ↔ + ∃ S ∈ M.sets, Realize M.sets equalityCertificateFormula (extend S (equalityParameters s)) ∧ + Name.codedEqualityRelation s S p σ τ := by + constructor + · exact M.exists_atomicEquality_certificate s pairing unions powers separation collection carrier order + p σ τ hσ hτ + · rintro ⟨S, hS, certificate, rel⟩ + exact M.equalityCertificate_sound s (M.nameDomain s) (fun _ h => h) + pairing carrier order S hS certificate p ⟨σ, hσ⟩ ⟨τ, hτ⟩ rel + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.SetFormula + +universe u v + +theorem map_empty {A : Type u} {B : Type v} (f : A → B) : + (fun i : Fin 0 => f (Fin.elim0 i)) = (Fin.elim0 : Fin 0 → B) := by + funext i + exact Fin.elim0 i + +def uniformEqualityFormula : SetFormula 5 := + ex (.conj (atomicApplication equalityCertificateFormula Fin.elim0 0 4 5) + (tripleMembershipFormula 1 2 3 0)) + +def liftedEqualityFormula {k : Nat} (c o : Fin k) : SetFormula (k + 3) := + atomicApplication uniformEqualityFormula + (extend c.succ.succ.succ (extend o.succ.succ.succ Fin.elim0)) 0 1 2 + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem realize_uniformEqualityFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (p : P) (σ τ : Name s) (hσ : σ.val ∈ M.sets) (hτ : τ.val ∈ M.sets) : + Realize M.sets uniformEqualityFormula + (extend (s.encode p) (extend σ.val (extend τ.val (equalityParameters s)))) ↔ + Name.ForcesEq p σ τ := by + rw [M.forcesEq_iff_exists_certificate s pairing unions powers separation collection carrier order p σ τ hσ hτ, + uniformEqualityFormula, realize_ex] + apply exists_congr + intro S + apply and_congr_right + intro hS + let env := extend S (extend (s.encode p) (extend σ.val (extend τ.val (equalityParameters s)))) + change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _ + rw [realize_atomicApplication, + M.realize_tripleMembershipFormula pairing 1 2 3 0 env + (M.transitive carrier (s.encode_mem p)) hσ hτ hS, map_empty] + rfl + +theorem equalityMeaning_uniform (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) : + M.EqualityMeaning s D uniformEqualityFormula (equalityParameters s) := by + intro p σ τ + exact M.realize_uniformEqualityFormula s pairing unions powers separation collection carrier order + p σ.val τ.val (ground σ.val σ.property) (ground τ.val τ.property) + +theorem equalityMeaning_lifted (D : Name.NameDomain s) + (ground : ∀ τ ∈ D.names, τ.val ∈ M.sets) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + {k : Nat} (c o : Fin k) (constants : Fin k → ZFSet.{u}) + (hc : constants c = s.carrier) (ho : constants o = s.conditionOrder) : + M.EqualityMeaning s D (liftedEqualityFormula c o) constants := by + intro p σ τ + rw [liftedEqualityFormula, realize_atomicApplication, map_extend, map_extend, map_empty] + change Realize M.sets uniformEqualityFormula + (extend (s.encode p) (extend σ.val.val (extend τ.val.val + (extend (constants c) (extend (constants o) Fin.elim0))))) ↔ _ + rw [hc, ho] + exact M.realize_uniformEqualityFormula s pairing unions powers separation collection carrier order + p σ.val τ.val (ground σ.val σ.property) (ground τ.val τ.property) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Main.lean b/lean/OAI/SetTheory/PartitionPrinciple/Main.lean index 29c4b672983e0a12ac9100bf53a19f64094fd0dc..f2b5e5ccf7f7aaac11316ef4af089132c9934d3f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Main.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Main.lean @@ -1,45 +1,45 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerSourceCongruence -import OAI.SetTheory.PartitionPrinciple.Definability.FinalRankRealization -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRowGraphDescent -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralRequestActions -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralSupportIncidence -import OAI.SetTheory.PartitionPrinciple.Definability.GroundStandardInaccessibleFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalRowNiceNames -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSameFilterPreparationBatch -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSymmetricRefinementOutputs -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementDiagonalConditions -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRestrictedActions -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneGenericProjection -import OAI.SetTheory.PartitionPrinciple.Geometry.DepthLayerHeights -import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalColumnOrders -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompletedCompressionCertificateRecognition -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalCompressionFieldRecognition -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRequestFieldRecognition -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundForcedSequenceReadings -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionIterates -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialLiftEmbeddings -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowModelDescent -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRawCandidateDensity -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRequestedRectangleHeights -import OAI.SetTheory.PartitionPrinciple.Geometry.PresentedRowAssignmentDecoding -import OAI.SetTheory.PartitionPrinciple.Models.GroundFiniteWordInjections -import OAI.SetTheory.PartitionPrinciple.Models.GroundMainFinalAssignmentLabelInjections -import OAI.SetTheory.PartitionPrinciple.Models.GroundNameSupportEnumerationChoices -import OAI.SetTheory.PartitionPrinciple.Models.Separation -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologicalExternalCoinitiality -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableRowExactUnions -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialRecursiveSuccessor -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPersistentSuccessorLabels -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageThreeHistory -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixConeValues -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixCoveredLimitAppend -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixExtensionRelations -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixOmegaOneAppend -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixSuccessor -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRawFinitePowerStageSystems -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRefinementHistorySpliceSteps -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSelectedMainLimitCoverage -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyRestrictions -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexWeakSize -import OAI.SetTheory.PartitionPrinciple.Transfinite.NaturalRecursionTraceValues - +import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerSourceCongruence +import OAI.SetTheory.PartitionPrinciple.Definability.FinalRankRealization +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRowGraphDescent +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralRequestActions +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralSupportIncidence +import OAI.SetTheory.PartitionPrinciple.Definability.GroundStandardInaccessibleFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalRowNiceNames +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSameFilterPreparationBatch +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalSymmetricRefinementOutputs +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementDiagonalConditions +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRestrictedActions +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneGenericProjection +import OAI.SetTheory.PartitionPrinciple.Geometry.DepthLayerHeights +import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalColumnOrders +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompletedCompressionCertificateRecognition +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalCompressionFieldRecognition +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRequestFieldRecognition +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundForcedSequenceReadings +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionIterates +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialLiftEmbeddings +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowModelDescent +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRawCandidateDensity +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRequestedRectangleHeights +import OAI.SetTheory.PartitionPrinciple.Geometry.PresentedRowAssignmentDecoding +import OAI.SetTheory.PartitionPrinciple.Models.GroundFiniteWordInjections +import OAI.SetTheory.PartitionPrinciple.Models.GroundMainFinalAssignmentLabelInjections +import OAI.SetTheory.PartitionPrinciple.Models.GroundNameSupportEnumerationChoices +import OAI.SetTheory.PartitionPrinciple.Models.Separation +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologicalExternalCoinitiality +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableRowExactUnions +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialRecursiveSuccessor +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalPersistentSuccessorLabels +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainFinalStageThreeHistory +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixConeValues +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixCoveredLimitAppend +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixExtensionRelations +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixOmegaOneAppend +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixSuccessor +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRawFinitePowerStageSystems +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRefinementHistorySpliceSteps +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSelectedMainLimitCoverage +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyRestrictions +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexWeakSize +import OAI.SetTheory.PartitionPrinciple.Transfinite.NaturalRecursionTraceValues + diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Model.lean b/lean/OAI/SetTheory/PartitionPrinciple/Model.lean index eca31026462f2f441585e04020179e20e3825ad0..ca85b005a1950fd032e1dcfe1193e29f55add32d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Model.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Model.lean @@ -1,254 +1,254 @@ -import Mathlib - -namespace OAI - -namespace PartitionPilot.Forcing - -universe u - -inductive SetFormula : Nat → Type - | equal {n} : Fin n → Fin n → SetFormula n - | mem {n} : Fin n → Fin n → SetFormula n - | neg {n} : SetFormula n → SetFormula n - | conj {n} : SetFormula n → SetFormula n → SetFormula n - | all {n} : SetFormula (n + 1) → SetFormula n - -namespace SetFormula - -def extend {A : Type u} {n : Nat} (x : A) (env : Fin n → A) : Fin (n + 1) → A := - Fin.cases x env - -def Realize (U : Set ZFSet.{u}) : {n : Nat} → SetFormula n → (Fin n → ZFSet.{u}) → Prop - | _, .equal i j, env => env i = env j - | _, .mem i j, env => env i ∈ env j - | _, .neg φ, env => ¬ Realize U φ env - | _, .conj φ ψ, env => Realize U φ env ∧ Realize U ψ env - | _, .all φ, env => ∀ x ∈ U, Realize U φ (extend x env) - -def ex {n : Nat} (φ : SetFormula (n + 1)) : SetFormula n := .neg (.all (.neg φ)) - -def disj {n : Nat} (φ ψ : SetFormula n) : SetFormula n := .neg (.conj (.neg φ) (.neg ψ)) - -def imp {n : Nat} (φ ψ : SetFormula n) : SetFormula n := .neg (.conj φ (.neg ψ)) - -end SetFormula - -inductive BoundedFormula : Nat → Type - | equal {n} : Fin n → Fin n → BoundedFormula n - | mem {n} : Fin n → Fin n → BoundedFormula n - | neg {n} : BoundedFormula n → BoundedFormula n - | conj {n} : BoundedFormula n → BoundedFormula n → BoundedFormula n - | allMem {n} : Fin n → BoundedFormula (n + 1) → BoundedFormula n - -namespace BoundedFormula - -open SetFormula - -def imp {n} (φ ψ : BoundedFormula n) : BoundedFormula n := .neg (.conj φ (.neg ψ)) - -def disj {n} (φ ψ : BoundedFormula n) : BoundedFormula n := .neg (.conj (.neg φ) (.neg ψ)) - -def exMem {n} (b : Fin n) (φ : BoundedFormula (n + 1)) : BoundedFormula n := - .neg (.allMem b (.neg φ)) - -def toFormula : {n : Nat} → BoundedFormula n → SetFormula n - | _, .equal i j => .equal i j - | _, .mem i j => .mem i j - | _, .neg φ => .neg φ.toFormula - | _, .conj φ ψ => .conj φ.toFormula ψ.toFormula - | _, .allMem b φ => .all (SetFormula.imp (.mem 0 b.succ) φ.toFormula) - -def singletonFormula {n} (z x : Fin n) : BoundedFormula n := - .conj (.mem x z) (.allMem z (.equal 0 x.succ)) - -def unorderedPairFormula {n} (z x y : Fin n) : BoundedFormula n := - .conj (.mem x z) (.conj (.mem y z) (.allMem z (disj (.equal 0 x.succ) (.equal 0 y.succ)))) - -def orderedPairFormula {n} (z x y : Fin n) : BoundedFormula n := - exMem z (.conj (singletonFormula 0 x.succ) - (exMem z.succ (.conj (unorderedPairFormula 0 x.succ.succ y.succ.succ) - (unorderedPairFormula z.succ.succ 1 0)))) - -def pairMembershipFormula {n} (x y r : Fin n) : BoundedFormula n := - exMem r (orderedPairFormula 0 x.succ y.succ) - -def relationBetweenFormula {n} (a b f : Fin n) : BoundedFormula n := - .allMem f (exMem a.succ (exMem b.succ.succ (orderedPairFormula 2 1 0))) - -def functionFormula {n} (a b f : Fin n) : BoundedFormula n := - .conj (relationBetweenFormula a b f) - (.allMem a (exMem b.succ (.conj (pairMembershipFormula 1 0 f.succ.succ) - (.allMem b.succ.succ (imp (pairMembershipFormula 2 0 f.succ.succ.succ) (.equal 0 1)))))) - -def nonemptyFormula {n} (x : Fin n) : BoundedFormula n := exMem x (.equal 0 0) - -def choiceFunctionFormula {n} (a f : Fin n) : BoundedFormula n := - .conj (.allMem f (exMem a.succ (exMem 0 (orderedPairFormula 2 1 0)))) - (.allMem a (exMem 0 (.conj (pairMembershipFormula 1 0 f.succ.succ) - (.allMem 1 (imp (pairMembershipFormula 2 0 f.succ.succ.succ) (.equal 0 1)))))) - -end BoundedFormula - -structure TransitiveGround where - sets : Set ZFSet.{u} - transitive : ∀ {x y}, x ∈ sets → y ∈ x → y ∈ sets - -structure InjectionCode (D N f : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc D N f - injective : ∀ x y z, ZFSet.pair x z ∈ f → ZFSet.pair y z ∈ f → x = y - -namespace TransitiveGround - -open SetFormula - -variable (M : TransitiveGround.{u}) - -def groundEmbeddable (D N : ZFSet.{u}) : Prop := ∃ f ∈ M.sets, InjectionCode D N f - -end TransitiveGround - -def setTransitive (x : ZFSet.{u}) : Prop := ∀ y ∈ x, ∀ z ∈ y, z ∈ x - -def ordinalSetProperty (x : ZFSet.{u}) : Prop := - setTransitive x ∧ ∀ y ∈ x, setTransitive y - -namespace TransitiveGround - -open SetFormula - -variable (M : TransitiveGround.{u}) - -noncomputable def groundPower (B : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun p => p ∈ M.sets) (ZFSet.powerset B) - -end TransitiveGround - -def GroundBelow (M : TransitiveGround.{u}) (A K : ZFSet.{u}) : Prop := - ∃ β ∈ K, M.groundEmbeddable A β - -def GroundCardinal (M : TransitiveGround.{u}) (κ : ZFSet.{u}) : Prop := - ordinalSetProperty κ ∧ ∀ β ∈ κ, ¬ M.groundEmbeddable κ β - -def CofinalFunctionCode (α K f : ZFSet.{u}) : Prop := - ZFSet.IsFunc α K f ∧ ∀ β ∈ K, ∃ x ∈ α, ∃ y ∈ K, - ZFSet.pair x y ∈ f ∧ (β = y ∨ β ∈ y) - -def GroundCofinalRegular (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := - ∀ α ∈ K, ∀ f ∈ M.sets, ¬ CofinalFunctionCode α K f - -def GroundCardinalStrongLimit (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := - ∀ κ ∈ K, GroundCardinal M κ → GroundBelow M (M.groundPower κ) K - -def GroundStandardInaccessible (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := - GroundCardinal M K ∧ ¬ M.groundEmbeddable K ZFSet.omega ∧ - GroundCofinalRegular M K ∧ GroundCardinalStrongLimit M K - -namespace SetFormula - -def extensionality : SetFormula 0 := - .all (.all (imp - (.all (.conj (imp (.mem 0 2) (.mem 0 1)) (imp (.mem 0 1) (.mem 0 2)))) - (.equal 1 0))) - -def foundation : SetFormula 0 := - .all (imp (ex (.mem 0 1)) - (ex (.conj (.mem 0 1) (.all (.neg (.conj (.mem 0 2) (.mem 0 1))))))) - -def emptySet : SetFormula 0 := ex (.all (.neg (.mem 0 1))) - -def pairing : SetFormula 0 := - .all (.all (ex (.all (.conj - (imp (.mem 0 1) (disj (.equal 0 3) (.equal 0 2))) - (imp (disj (.equal 0 3) (.equal 0 2)) (.mem 0 1)))))) - -def union : SetFormula 0 := - .all (ex (.all (.conj - (imp (.mem 0 1) (ex (.conj (.mem 0 3) (.mem 1 0)))) - (imp (ex (.conj (.mem 0 3) (.mem 1 0))) (.mem 0 1))))) - -def powerSet : SetFormula 0 := - .all (ex (.all (.conj - (imp (.mem 0 1) (.all (imp (.mem 0 1) (.mem 0 3)))) - (imp (.all (imp (.mem 0 1) (.mem 0 3))) (.mem 0 1))))) - -def SeparationSchema (U : Set ZFSet.{u}) : Prop := - ∀ {n} (φ : SetFormula (n + 1)) (params : Fin n → ZFSet.{u}), - (∀ i, params i ∈ U) → ∀ x ∈ U, ∃ y ∈ U, - ∀ z ∈ U, z ∈ y ↔ z ∈ x ∧ Realize U φ (extend z params) - -def CollectionSchema (U : Set ZFSet.{u}) : Prop := - ∀ {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}), - (∀ i, params i ∈ U) → ∀ a ∈ U, - (∀ x ∈ U, x ∈ a → ∃ y ∈ U, Realize U φ (extend x (extend y params))) → - ∃ b ∈ U, ∀ x ∈ U, x ∈ a → - ∃ y ∈ U, y ∈ b ∧ Realize U φ (extend x (extend y params)) - -def emptySetFormula {n : Nat} (x : Fin n) : SetFormula n := .all (.neg (.mem 0 x.succ)) - -def successorFormula {n : Nat} (y x : Fin n) : SetFormula n := - .all (.conj (imp (.mem 0 y.succ) (disj (.equal 0 x.succ) (.mem 0 x.succ))) - (imp (disj (.equal 0 x.succ) (.mem 0 x.succ)) (.mem 0 y.succ))) - -def infinity : SetFormula 0 := - ex (.conj (ex (.conj (.mem 0 1) (emptySetFormula 0))) - (.all (imp (.mem 0 1) (ex (.conj (.mem 0 2) (successorFormula 0 1)))))) - -def choice : SetFormula 0 := - .all (imp (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)).toFormula - (ex (BoundedFormula.choiceFunctionFormula 1 0).toFormula)) - -def ReplacementSchema (U : Set ZFSet.{u}) : Prop := - ∀ {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}), - (∀ i, params i ∈ U) → ∀ A ∈ U, - (∀ x ∈ U, x ∈ A → ∃ y ∈ U, Realize U φ (extend x (extend y params)) ∧ - ∀ z ∈ U, Realize U φ (extend x (extend z params)) → z = y) → - ∃ B ∈ U, ∀ y ∈ U, y ∈ B ↔ ∃ x ∈ U, x ∈ A ∧ Realize U φ (extend x (extend y params)) - -def finiteZFAxioms : SetFormula 0 := - .conj extensionality (.conj foundation (.conj emptySet - (.conj pairing (.conj SetFormula.union (.conj powerSet infinity))))) - -def ZFRealization (U : Set ZFSet.{u}) : Prop := - Realize U finiteZFAxioms Fin.elim0 ∧ SeparationSchema U ∧ ReplacementSchema U - -end SetFormula - -namespace BoundedFormula - -open SetFormula - -def injectionFormula {n} (d c f : Fin n) : BoundedFormula n := - .conj (functionFormula d c f) (.allMem d (.allMem d.succ (.allMem c.succ.succ - (imp (.conj (pairMembershipFormula 2 0 f.succ.succ.succ) - (pairMembershipFormula 1 0 f.succ.succ.succ)) (.equal 2 1))))) - -end BoundedFormula - -namespace SetFormula - -def hasInjectionFormula {n} (d c : Fin n) : SetFormula n := - ex (BoundedFormula.injectionFormula d.succ c.succ 0).toFormula - -end SetFormula - -namespace BoundedFormula - -open SetFormula - -def surjectionFormula {n : Nat} (a b f : Fin n) : BoundedFormula n := - .conj (functionFormula a b f) - (.allMem b (exMem a.succ (pairMembershipFormula 0 1 f.succ.succ))) - -end BoundedFormula - -namespace SetFormula - -def partitionPrinciple : SetFormula 0 := - .all (.all (.all (imp (BoundedFormula.surjectionFormula (n := 3) 2 1 0).toFormula - (hasInjectionFormula (n := 3) 1 2)))) - -end SetFormula - -end PartitionPilot.Forcing - -end OAI +import Mathlib + +namespace OAI + +namespace PartitionPilot.Forcing + +universe u + +inductive SetFormula : Nat → Type + | equal {n} : Fin n → Fin n → SetFormula n + | mem {n} : Fin n → Fin n → SetFormula n + | neg {n} : SetFormula n → SetFormula n + | conj {n} : SetFormula n → SetFormula n → SetFormula n + | all {n} : SetFormula (n + 1) → SetFormula n + +namespace SetFormula + +def extend {A : Type u} {n : Nat} (x : A) (env : Fin n → A) : Fin (n + 1) → A := + Fin.cases x env + +def Realize (U : Set ZFSet.{u}) : {n : Nat} → SetFormula n → (Fin n → ZFSet.{u}) → Prop + | _, .equal i j, env => env i = env j + | _, .mem i j, env => env i ∈ env j + | _, .neg φ, env => ¬ Realize U φ env + | _, .conj φ ψ, env => Realize U φ env ∧ Realize U ψ env + | _, .all φ, env => ∀ x ∈ U, Realize U φ (extend x env) + +def ex {n : Nat} (φ : SetFormula (n + 1)) : SetFormula n := .neg (.all (.neg φ)) + +def disj {n : Nat} (φ ψ : SetFormula n) : SetFormula n := .neg (.conj (.neg φ) (.neg ψ)) + +def imp {n : Nat} (φ ψ : SetFormula n) : SetFormula n := .neg (.conj φ (.neg ψ)) + +end SetFormula + +inductive BoundedFormula : Nat → Type + | equal {n} : Fin n → Fin n → BoundedFormula n + | mem {n} : Fin n → Fin n → BoundedFormula n + | neg {n} : BoundedFormula n → BoundedFormula n + | conj {n} : BoundedFormula n → BoundedFormula n → BoundedFormula n + | allMem {n} : Fin n → BoundedFormula (n + 1) → BoundedFormula n + +namespace BoundedFormula + +open SetFormula + +def imp {n} (φ ψ : BoundedFormula n) : BoundedFormula n := .neg (.conj φ (.neg ψ)) + +def disj {n} (φ ψ : BoundedFormula n) : BoundedFormula n := .neg (.conj (.neg φ) (.neg ψ)) + +def exMem {n} (b : Fin n) (φ : BoundedFormula (n + 1)) : BoundedFormula n := + .neg (.allMem b (.neg φ)) + +def toFormula : {n : Nat} → BoundedFormula n → SetFormula n + | _, .equal i j => .equal i j + | _, .mem i j => .mem i j + | _, .neg φ => .neg φ.toFormula + | _, .conj φ ψ => .conj φ.toFormula ψ.toFormula + | _, .allMem b φ => .all (SetFormula.imp (.mem 0 b.succ) φ.toFormula) + +def singletonFormula {n} (z x : Fin n) : BoundedFormula n := + .conj (.mem x z) (.allMem z (.equal 0 x.succ)) + +def unorderedPairFormula {n} (z x y : Fin n) : BoundedFormula n := + .conj (.mem x z) (.conj (.mem y z) (.allMem z (disj (.equal 0 x.succ) (.equal 0 y.succ)))) + +def orderedPairFormula {n} (z x y : Fin n) : BoundedFormula n := + exMem z (.conj (singletonFormula 0 x.succ) + (exMem z.succ (.conj (unorderedPairFormula 0 x.succ.succ y.succ.succ) + (unorderedPairFormula z.succ.succ 1 0)))) + +def pairMembershipFormula {n} (x y r : Fin n) : BoundedFormula n := + exMem r (orderedPairFormula 0 x.succ y.succ) + +def relationBetweenFormula {n} (a b f : Fin n) : BoundedFormula n := + .allMem f (exMem a.succ (exMem b.succ.succ (orderedPairFormula 2 1 0))) + +def functionFormula {n} (a b f : Fin n) : BoundedFormula n := + .conj (relationBetweenFormula a b f) + (.allMem a (exMem b.succ (.conj (pairMembershipFormula 1 0 f.succ.succ) + (.allMem b.succ.succ (imp (pairMembershipFormula 2 0 f.succ.succ.succ) (.equal 0 1)))))) + +def nonemptyFormula {n} (x : Fin n) : BoundedFormula n := exMem x (.equal 0 0) + +def choiceFunctionFormula {n} (a f : Fin n) : BoundedFormula n := + .conj (.allMem f (exMem a.succ (exMem 0 (orderedPairFormula 2 1 0)))) + (.allMem a (exMem 0 (.conj (pairMembershipFormula 1 0 f.succ.succ) + (.allMem 1 (imp (pairMembershipFormula 2 0 f.succ.succ.succ) (.equal 0 1)))))) + +end BoundedFormula + +structure TransitiveGround where + sets : Set ZFSet.{u} + transitive : ∀ {x y}, x ∈ sets → y ∈ x → y ∈ sets + +structure InjectionCode (D N f : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc D N f + injective : ∀ x y z, ZFSet.pair x z ∈ f → ZFSet.pair y z ∈ f → x = y + +namespace TransitiveGround + +open SetFormula + +variable (M : TransitiveGround.{u}) + +def groundEmbeddable (D N : ZFSet.{u}) : Prop := ∃ f ∈ M.sets, InjectionCode D N f + +end TransitiveGround + +def setTransitive (x : ZFSet.{u}) : Prop := ∀ y ∈ x, ∀ z ∈ y, z ∈ x + +def ordinalSetProperty (x : ZFSet.{u}) : Prop := + setTransitive x ∧ ∀ y ∈ x, setTransitive y + +namespace TransitiveGround + +open SetFormula + +variable (M : TransitiveGround.{u}) + +noncomputable def groundPower (B : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun p => p ∈ M.sets) (ZFSet.powerset B) + +end TransitiveGround + +def GroundBelow (M : TransitiveGround.{u}) (A K : ZFSet.{u}) : Prop := + ∃ β ∈ K, M.groundEmbeddable A β + +def GroundCardinal (M : TransitiveGround.{u}) (κ : ZFSet.{u}) : Prop := + ordinalSetProperty κ ∧ ∀ β ∈ κ, ¬ M.groundEmbeddable κ β + +def CofinalFunctionCode (α K f : ZFSet.{u}) : Prop := + ZFSet.IsFunc α K f ∧ ∀ β ∈ K, ∃ x ∈ α, ∃ y ∈ K, + ZFSet.pair x y ∈ f ∧ (β = y ∨ β ∈ y) + +def GroundCofinalRegular (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := + ∀ α ∈ K, ∀ f ∈ M.sets, ¬ CofinalFunctionCode α K f + +def GroundCardinalStrongLimit (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := + ∀ κ ∈ K, GroundCardinal M κ → GroundBelow M (M.groundPower κ) K + +def GroundStandardInaccessible (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := + GroundCardinal M K ∧ ¬ M.groundEmbeddable K ZFSet.omega ∧ + GroundCofinalRegular M K ∧ GroundCardinalStrongLimit M K + +namespace SetFormula + +def extensionality : SetFormula 0 := + .all (.all (imp + (.all (.conj (imp (.mem 0 2) (.mem 0 1)) (imp (.mem 0 1) (.mem 0 2)))) + (.equal 1 0))) + +def foundation : SetFormula 0 := + .all (imp (ex (.mem 0 1)) + (ex (.conj (.mem 0 1) (.all (.neg (.conj (.mem 0 2) (.mem 0 1))))))) + +def emptySet : SetFormula 0 := ex (.all (.neg (.mem 0 1))) + +def pairing : SetFormula 0 := + .all (.all (ex (.all (.conj + (imp (.mem 0 1) (disj (.equal 0 3) (.equal 0 2))) + (imp (disj (.equal 0 3) (.equal 0 2)) (.mem 0 1)))))) + +def union : SetFormula 0 := + .all (ex (.all (.conj + (imp (.mem 0 1) (ex (.conj (.mem 0 3) (.mem 1 0)))) + (imp (ex (.conj (.mem 0 3) (.mem 1 0))) (.mem 0 1))))) + +def powerSet : SetFormula 0 := + .all (ex (.all (.conj + (imp (.mem 0 1) (.all (imp (.mem 0 1) (.mem 0 3)))) + (imp (.all (imp (.mem 0 1) (.mem 0 3))) (.mem 0 1))))) + +def SeparationSchema (U : Set ZFSet.{u}) : Prop := + ∀ {n} (φ : SetFormula (n + 1)) (params : Fin n → ZFSet.{u}), + (∀ i, params i ∈ U) → ∀ x ∈ U, ∃ y ∈ U, + ∀ z ∈ U, z ∈ y ↔ z ∈ x ∧ Realize U φ (extend z params) + +def CollectionSchema (U : Set ZFSet.{u}) : Prop := + ∀ {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}), + (∀ i, params i ∈ U) → ∀ a ∈ U, + (∀ x ∈ U, x ∈ a → ∃ y ∈ U, Realize U φ (extend x (extend y params))) → + ∃ b ∈ U, ∀ x ∈ U, x ∈ a → + ∃ y ∈ U, y ∈ b ∧ Realize U φ (extend x (extend y params)) + +def emptySetFormula {n : Nat} (x : Fin n) : SetFormula n := .all (.neg (.mem 0 x.succ)) + +def successorFormula {n : Nat} (y x : Fin n) : SetFormula n := + .all (.conj (imp (.mem 0 y.succ) (disj (.equal 0 x.succ) (.mem 0 x.succ))) + (imp (disj (.equal 0 x.succ) (.mem 0 x.succ)) (.mem 0 y.succ))) + +def infinity : SetFormula 0 := + ex (.conj (ex (.conj (.mem 0 1) (emptySetFormula 0))) + (.all (imp (.mem 0 1) (ex (.conj (.mem 0 2) (successorFormula 0 1)))))) + +def choice : SetFormula 0 := + .all (imp (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)).toFormula + (ex (BoundedFormula.choiceFunctionFormula 1 0).toFormula)) + +def ReplacementSchema (U : Set ZFSet.{u}) : Prop := + ∀ {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}), + (∀ i, params i ∈ U) → ∀ A ∈ U, + (∀ x ∈ U, x ∈ A → ∃ y ∈ U, Realize U φ (extend x (extend y params)) ∧ + ∀ z ∈ U, Realize U φ (extend x (extend z params)) → z = y) → + ∃ B ∈ U, ∀ y ∈ U, y ∈ B ↔ ∃ x ∈ U, x ∈ A ∧ Realize U φ (extend x (extend y params)) + +def finiteZFAxioms : SetFormula 0 := + .conj extensionality (.conj foundation (.conj emptySet + (.conj pairing (.conj SetFormula.union (.conj powerSet infinity))))) + +def ZFRealization (U : Set ZFSet.{u}) : Prop := + Realize U finiteZFAxioms Fin.elim0 ∧ SeparationSchema U ∧ ReplacementSchema U + +end SetFormula + +namespace BoundedFormula + +open SetFormula + +def injectionFormula {n} (d c f : Fin n) : BoundedFormula n := + .conj (functionFormula d c f) (.allMem d (.allMem d.succ (.allMem c.succ.succ + (imp (.conj (pairMembershipFormula 2 0 f.succ.succ.succ) + (pairMembershipFormula 1 0 f.succ.succ.succ)) (.equal 2 1))))) + +end BoundedFormula + +namespace SetFormula + +def hasInjectionFormula {n} (d c : Fin n) : SetFormula n := + ex (BoundedFormula.injectionFormula d.succ c.succ 0).toFormula + +end SetFormula + +namespace BoundedFormula + +open SetFormula + +def surjectionFormula {n : Nat} (a b f : Fin n) : BoundedFormula n := + .conj (functionFormula a b f) + (.allMem b (exMem a.succ (pairMembershipFormula 0 1 f.succ.succ))) + +end BoundedFormula + +namespace SetFormula + +def partitionPrinciple : SetFormula 0 := + .all (.all (.all (imp (BoundedFormula.surjectionFormula (n := 3) 2 1 0).toFormula + (hasInjectionFormula (n := 3) 1 2)))) + +end SetFormula + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/CopyQuotient.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/CopyQuotient.lean index f6e676dd8fbb3b7f0c0cdad62f32f2a66b0d2053..8623049de0b0ac6ab3b7ea8ccdb0249bb96cfd2c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/CopyQuotient.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/CopyQuotient.lean @@ -1,155 +1,155 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompatibleCopies - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.CompatibleCopies.Data - -universe u v - -variable {A : Type u} {I : Type v} {P : MeetOrder A} (d : Data P I) - -def Node := Quotient d.setoid - -def point (i : I) (x : A) : d.Node := Quotient.mk d.setoid (i, x) - -def nodeLe : d.Node → d.Node → Prop := - Quotient.lift₂ d.Le (fun _ _ _ _ ha hb => propext - ⟨fun h => d.le_trans (d.related_le (d.related_symm ha)) (d.le_trans h (d.related_le hb)), - fun h => d.le_trans (d.related_le ha) (d.le_trans h (d.related_le (d.related_symm hb)))⟩) - -theorem mk_le_mk (i j : I) (x y : A) : d.nodeLe (d.point i x) (d.point j y) ↔ d.Le (i, x) (j, y) := - Iff.rfl - -theorem mk_eq_mk (i j : I) (x y : A) : d.point i x = d.point j y ↔ d.Related (i, x) (j, y) := - ⟨fun h => Quotient.exact h, fun h => Quotient.sound h⟩ - -theorem node_refl (x : d.Node) : d.nodeLe x x := by - induction x using Quotient.ind with - | _ x => exact d.le_refl x - -theorem node_trans {x y z : d.Node} (hxy : d.nodeLe x y) (hyz : d.nodeLe y z) : d.nodeLe x z := by - induction x, y, z using Quotient.inductionOn₃ with - | _ x y z => exact d.le_trans hxy hyz - -theorem node_antisymm {x y : d.Node} (hxy : d.nodeLe x y) (hyx : d.nodeLe y x) : x = y := by - induction x, y using Quotient.inductionOn₂ with - | _ x y => exact Quotient.sound (d.le_antisymm_related hxy hyx) - -theorem vertex_le (i : I) (x y : A) : d.nodeLe (d.point i x) (d.point i y) ↔ P.le x y := - d.same_vertex_le i x y - -theorem vertex_below (i j : I) (x y : A) : - d.nodeLe (d.point i x) (d.point j y) ↔ P.le x (d.part i j y) := - d.below_iff_part i j x y - -theorem cover (x : d.Node) : ∃ i y, d.point i y = x := by - induction x using Quotient.ind with - | _ x => exact ⟨x.1, x.2, rfl⟩ - -theorem vertex_ideal (i : I) (y : A) (x : d.Node) (lower : d.nodeLe x (d.point i y)) : - ∃ z, d.point i z = x := by - induction x using Quotient.ind with - | _ x => - have moved := d.move_to_upper_vertex lower - exact ⟨(d.change x.1 i).toFun x.2, (Quotient.sound moved.1).symm⟩ - -def IsMeet (x y m : d.Node) : Prop := - d.nodeLe m x ∧ d.nodeLe m y ∧ ∀ z, d.nodeLe z x → d.nodeLe z y → d.nodeLe z m - -theorem cross_meet_spec (i j : I) (x y : A) : - d.IsMeet (d.point i x) (d.point j y) (d.point i (P.meet x (d.part i j y))) := by - refine ⟨(d.vertex_le i _ _).mpr (P.meet_le_left _ _), - (d.vertex_below i j _ _).mpr (P.meet_le_right _ _), ?_⟩ - intro z hx hy - rcases d.vertex_ideal i x z hx with ⟨a, rfl⟩ - exact (d.vertex_le i _ _).mpr - (P.le_meet ((d.vertex_le i _ _).mp hx) ((d.vertex_below i j _ _).mp hy)) - -theorem all_meets (x y : d.Node) : ∃ m, d.IsMeet x y m := by - induction x, y using Quotient.inductionOn₂ with - | _ x y => exact ⟨_, d.cross_meet_spec x.1 y.1 x.2 y.2⟩ - -noncomputable def order : MeetOrder d.Node where - le := d.nodeLe - meet x y := Classical.choose (d.all_meets x y) - refl := d.node_refl - trans := d.node_trans - antisymm := d.node_antisymm - meet_le_left x y := (Classical.choose_spec (d.all_meets x y)).1 - meet_le_right x y := (Classical.choose_spec (d.all_meets x y)).2.1 - le_meet hx hy := (Classical.choose_spec (d.all_meets _ _)).2.2 _ hx hy - -theorem meet_eq {x y m : d.Node} (h : d.IsMeet x y m) : d.order.meet x y = m := - d.node_antisymm (h.2.2 _ (d.order.meet_le_left x y) (d.order.meet_le_right x y)) - (d.order.le_meet h.1 h.2.1) - -theorem vertex_meet_spec (i : I) (x y : A) : - d.IsMeet (d.point i x) (d.point i y) (d.point i (P.meet x y)) := by - refine ⟨(d.vertex_le i _ _).mpr (P.meet_le_left _ _), - (d.vertex_le i _ _).mpr (P.meet_le_right _ _), ?_⟩ - intro z hx hy - rcases d.vertex_ideal i x z hx with ⟨a, rfl⟩ - exact (d.vertex_le i _ _).mpr - (P.le_meet ((d.vertex_le i _ _).mp hx) ((d.vertex_le i _ _).mp hy)) - -noncomputable def vertex (i : I) : MeetEmbedding P d.order where - toFun := d.point i - le_iff := d.vertex_le i - map_meet x y := (d.meet_eq (d.vertex_meet_spec i x y)).symm - -theorem vertex_injective (i : I) : Function.Injective (d.vertex i).toFun := - fun _ _ h => embedding_injective (d.vertex i) h - -theorem exact_overlap (i j : I) (x y : A) : - (d.vertex i).toFun x = (d.vertex j).toFun y ↔ - P.le x (d.anchor i j) ∧ (d.change i j).toFun x = y := - d.mk_eq_mk i j x y - -theorem cross_meet (i j : I) (x y : A) : - d.order.meet ((d.vertex i).toFun x) ((d.vertex j).toFun y) = - (d.vertex i).toFun (P.meet x (d.part i j y)) := - d.meet_eq (d.cross_meet_spec i j x y) - -theorem part_respects (i : I) {x y : d.Label} (h : d.Related x y) : - d.part i x.1 x.2 = d.part i y.1 y.2 := by - apply P.antisymm - · exact (d.below_iff_part i y.1 _ _).mp - (d.le_trans (d.part_below i x.1 x.2) (d.related_le h)) - · exact (d.below_iff_part i x.1 _ _).mp - (d.le_trans (d.part_below i y.1 y.2) (d.related_le (d.related_symm h))) - -def projection (i : I) : d.Node → A := - Quotient.lift (fun x => d.part i x.1 x.2) (fun _ _ h => d.part_respects i h) - -theorem greatest_part (i : I) (x : d.Node) (a : A) : - d.order.le ((d.vertex i).toFun a) x ↔ P.le a (d.projection i x) := by - induction x using Quotient.ind with - | _ x => exact d.below_iff_part i x.1 a x.2 - -theorem projection_formula (i j : I) (x : A) : - d.projection i ((d.vertex j).toFun x) = (d.change j i).toFun (P.meet x (d.anchor j i)) := rfl - -theorem vertex_principal (i : I) (x : d.Node) : - d.order.le x ((d.vertex i).toFun d.top) ↔ ∃ a, (d.vertex i).toFun a = x := by - constructor - · exact d.vertex_ideal i d.top x - · rintro ⟨a, rfl⟩ - exact (d.vertex_le i _ _).mpr (d.greatest a) - -theorem bottom_preserved (i : I) (zero : A) (least : ∀ x, P.le zero x) : - ∀ x, d.order.le ((d.vertex i).toFun zero) x := - fun x => (d.greatest_part i x zero).mpr (least _) - -theorem comparison_in_vertex (x y : d.Node) (lower : d.order.le x y) : - ∃ i a b, (d.vertex i).toFun a = x ∧ (d.vertex i).toFun b = y ∧ P.le a b := by - rcases d.cover y with ⟨i, b, rfl⟩ - rcases d.vertex_ideal i b x lower with ⟨a, rfl⟩ - exact ⟨i, a, b, rfl, rfl, (d.vertex_le i _ _).mp lower⟩ - -end PartitionPilot.Compression.RecursiveMaps.CompatibleCopies.Data - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompatibleCopies + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.CompatibleCopies.Data + +universe u v + +variable {A : Type u} {I : Type v} {P : MeetOrder A} (d : Data P I) + +def Node := Quotient d.setoid + +def point (i : I) (x : A) : d.Node := Quotient.mk d.setoid (i, x) + +def nodeLe : d.Node → d.Node → Prop := + Quotient.lift₂ d.Le (fun _ _ _ _ ha hb => propext + ⟨fun h => d.le_trans (d.related_le (d.related_symm ha)) (d.le_trans h (d.related_le hb)), + fun h => d.le_trans (d.related_le ha) (d.le_trans h (d.related_le (d.related_symm hb)))⟩) + +theorem mk_le_mk (i j : I) (x y : A) : d.nodeLe (d.point i x) (d.point j y) ↔ d.Le (i, x) (j, y) := + Iff.rfl + +theorem mk_eq_mk (i j : I) (x y : A) : d.point i x = d.point j y ↔ d.Related (i, x) (j, y) := + ⟨fun h => Quotient.exact h, fun h => Quotient.sound h⟩ + +theorem node_refl (x : d.Node) : d.nodeLe x x := by + induction x using Quotient.ind with + | _ x => exact d.le_refl x + +theorem node_trans {x y z : d.Node} (hxy : d.nodeLe x y) (hyz : d.nodeLe y z) : d.nodeLe x z := by + induction x, y, z using Quotient.inductionOn₃ with + | _ x y z => exact d.le_trans hxy hyz + +theorem node_antisymm {x y : d.Node} (hxy : d.nodeLe x y) (hyx : d.nodeLe y x) : x = y := by + induction x, y using Quotient.inductionOn₂ with + | _ x y => exact Quotient.sound (d.le_antisymm_related hxy hyx) + +theorem vertex_le (i : I) (x y : A) : d.nodeLe (d.point i x) (d.point i y) ↔ P.le x y := + d.same_vertex_le i x y + +theorem vertex_below (i j : I) (x y : A) : + d.nodeLe (d.point i x) (d.point j y) ↔ P.le x (d.part i j y) := + d.below_iff_part i j x y + +theorem cover (x : d.Node) : ∃ i y, d.point i y = x := by + induction x using Quotient.ind with + | _ x => exact ⟨x.1, x.2, rfl⟩ + +theorem vertex_ideal (i : I) (y : A) (x : d.Node) (lower : d.nodeLe x (d.point i y)) : + ∃ z, d.point i z = x := by + induction x using Quotient.ind with + | _ x => + have moved := d.move_to_upper_vertex lower + exact ⟨(d.change x.1 i).toFun x.2, (Quotient.sound moved.1).symm⟩ + +def IsMeet (x y m : d.Node) : Prop := + d.nodeLe m x ∧ d.nodeLe m y ∧ ∀ z, d.nodeLe z x → d.nodeLe z y → d.nodeLe z m + +theorem cross_meet_spec (i j : I) (x y : A) : + d.IsMeet (d.point i x) (d.point j y) (d.point i (P.meet x (d.part i j y))) := by + refine ⟨(d.vertex_le i _ _).mpr (P.meet_le_left _ _), + (d.vertex_below i j _ _).mpr (P.meet_le_right _ _), ?_⟩ + intro z hx hy + rcases d.vertex_ideal i x z hx with ⟨a, rfl⟩ + exact (d.vertex_le i _ _).mpr + (P.le_meet ((d.vertex_le i _ _).mp hx) ((d.vertex_below i j _ _).mp hy)) + +theorem all_meets (x y : d.Node) : ∃ m, d.IsMeet x y m := by + induction x, y using Quotient.inductionOn₂ with + | _ x y => exact ⟨_, d.cross_meet_spec x.1 y.1 x.2 y.2⟩ + +noncomputable def order : MeetOrder d.Node where + le := d.nodeLe + meet x y := Classical.choose (d.all_meets x y) + refl := d.node_refl + trans := d.node_trans + antisymm := d.node_antisymm + meet_le_left x y := (Classical.choose_spec (d.all_meets x y)).1 + meet_le_right x y := (Classical.choose_spec (d.all_meets x y)).2.1 + le_meet hx hy := (Classical.choose_spec (d.all_meets _ _)).2.2 _ hx hy + +theorem meet_eq {x y m : d.Node} (h : d.IsMeet x y m) : d.order.meet x y = m := + d.node_antisymm (h.2.2 _ (d.order.meet_le_left x y) (d.order.meet_le_right x y)) + (d.order.le_meet h.1 h.2.1) + +theorem vertex_meet_spec (i : I) (x y : A) : + d.IsMeet (d.point i x) (d.point i y) (d.point i (P.meet x y)) := by + refine ⟨(d.vertex_le i _ _).mpr (P.meet_le_left _ _), + (d.vertex_le i _ _).mpr (P.meet_le_right _ _), ?_⟩ + intro z hx hy + rcases d.vertex_ideal i x z hx with ⟨a, rfl⟩ + exact (d.vertex_le i _ _).mpr + (P.le_meet ((d.vertex_le i _ _).mp hx) ((d.vertex_le i _ _).mp hy)) + +noncomputable def vertex (i : I) : MeetEmbedding P d.order where + toFun := d.point i + le_iff := d.vertex_le i + map_meet x y := (d.meet_eq (d.vertex_meet_spec i x y)).symm + +theorem vertex_injective (i : I) : Function.Injective (d.vertex i).toFun := + fun _ _ h => embedding_injective (d.vertex i) h + +theorem exact_overlap (i j : I) (x y : A) : + (d.vertex i).toFun x = (d.vertex j).toFun y ↔ + P.le x (d.anchor i j) ∧ (d.change i j).toFun x = y := + d.mk_eq_mk i j x y + +theorem cross_meet (i j : I) (x y : A) : + d.order.meet ((d.vertex i).toFun x) ((d.vertex j).toFun y) = + (d.vertex i).toFun (P.meet x (d.part i j y)) := + d.meet_eq (d.cross_meet_spec i j x y) + +theorem part_respects (i : I) {x y : d.Label} (h : d.Related x y) : + d.part i x.1 x.2 = d.part i y.1 y.2 := by + apply P.antisymm + · exact (d.below_iff_part i y.1 _ _).mp + (d.le_trans (d.part_below i x.1 x.2) (d.related_le h)) + · exact (d.below_iff_part i x.1 _ _).mp + (d.le_trans (d.part_below i y.1 y.2) (d.related_le (d.related_symm h))) + +def projection (i : I) : d.Node → A := + Quotient.lift (fun x => d.part i x.1 x.2) (fun _ _ h => d.part_respects i h) + +theorem greatest_part (i : I) (x : d.Node) (a : A) : + d.order.le ((d.vertex i).toFun a) x ↔ P.le a (d.projection i x) := by + induction x using Quotient.ind with + | _ x => exact d.below_iff_part i x.1 a x.2 + +theorem projection_formula (i j : I) (x : A) : + d.projection i ((d.vertex j).toFun x) = (d.change j i).toFun (P.meet x (d.anchor j i)) := rfl + +theorem vertex_principal (i : I) (x : d.Node) : + d.order.le x ((d.vertex i).toFun d.top) ↔ ∃ a, (d.vertex i).toFun a = x := by + constructor + · exact d.vertex_ideal i d.top x + · rintro ⟨a, rfl⟩ + exact (d.vertex_le i _ _).mpr (d.greatest a) + +theorem bottom_preserved (i : I) (zero : A) (least : ∀ x, P.le zero x) : + ∀ x, d.order.le ((d.vertex i).toFun zero) x := + fun x => (d.greatest_part i x zero).mpr (least _) + +theorem comparison_in_vertex (x y : d.Node) (lower : d.order.le x y) : + ∃ i a b, (d.vertex i).toFun a = x ∧ (d.vertex i).toFun b = y ∧ P.le a b := by + rcases d.cover y with ⟨i, b, rfl⟩ + rcases d.vertex_ideal i b x lower with ⟨a, rfl⟩ + exact ⟨i, a, b, rfl, rfl, (d.vertex_le i _ _).mp lower⟩ + +end PartitionPilot.Compression.RecursiveMaps.CompatibleCopies.Data + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/ExternalCopyQuotient.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/ExternalCopyQuotient.lean index 610bc302e1e5b2de67b35d62cdd43372f196e88d..226e9713202f4e666968d9c59cf8f111a73abfdc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/ExternalCopyQuotient.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/ExternalCopyQuotient.lean @@ -1,52 +1,52 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalCopyDescent - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family -open Attachment CosetGeometry -universe u -variable {A J R : Type u} [Group J] {P : MeetOrder A} -variable (f : Family P R) (a : OrderAction J P) - -noncomputable def fromFlatQuotient : f.FlatQuotient a → f.Node a := - Quotient.lift (fun x => (f.copy a x.1).toFun x.2) - (fun _ _ path => FlatPath.copy_eq f a path) - -theorem fromFlatQuotient_class (w : External J f.Letters) (x : A) : - f.fromFlatQuotient a (f.flatClass a w x) = (f.copy a w).toFun x := rfl - -noncomputable def flatQuotientEquiv : f.FlatQuotient a ≃ f.Node a where - toFun := f.fromFlatQuotient a - invFun := f.toFlatQuotient a - left_inv q := by - induction q using Quotient.ind with - | _ x => exact f.toFlatQuotient_copy a x.1 x.2 - right_inv z := by - obtain ⟨w, x, rfl⟩ := f.copy_cover a z - rw [f.toFlatQuotient_copy, f.fromFlatQuotient_class] - -theorem flatQuotientEquiv_class (w : External J f.Letters) (x : A) : - f.flatQuotientEquiv a (f.flatClass a w x) = (f.copy a w).toFun x := rfl - -theorem FlatPath.translate (g : External J f.Letters) {x y : f.FlatLabel (J := J)} - (path : f.FlatPath a x y) : - f.FlatPath a (g * x.1, x.2) (g * y.1, y.2) := by - apply (f.flatPath_iff_copy_eq a _ _).2 - have equal := congrArg (f.translate a g) ((f.flatPath_iff_copy_eq a x y).1 path) - simpa only [f.translate_copy] using equal - -theorem flatPath_translate_iff (g : External J f.Letters) (x y : f.FlatLabel (J := J)) : - f.FlatPath a (g * x.1, x.2) (g * y.1, y.2) ↔ f.FlatPath a x y := by - constructor - · intro path - have inverse := FlatPath.translate f a g⁻¹ path - simpa only [Prod.fst, Prod.snd, inv_mul_cancel_left] using inverse - · exact FlatPath.translate f a g - -end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalCopyDescent + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.TileRequests.Family +open Attachment CosetGeometry +universe u +variable {A J R : Type u} [Group J] {P : MeetOrder A} +variable (f : Family P R) (a : OrderAction J P) + +noncomputable def fromFlatQuotient : f.FlatQuotient a → f.Node a := + Quotient.lift (fun x => (f.copy a x.1).toFun x.2) + (fun _ _ path => FlatPath.copy_eq f a path) + +theorem fromFlatQuotient_class (w : External J f.Letters) (x : A) : + f.fromFlatQuotient a (f.flatClass a w x) = (f.copy a w).toFun x := rfl + +noncomputable def flatQuotientEquiv : f.FlatQuotient a ≃ f.Node a where + toFun := f.fromFlatQuotient a + invFun := f.toFlatQuotient a + left_inv q := by + induction q using Quotient.ind with + | _ x => exact f.toFlatQuotient_copy a x.1 x.2 + right_inv z := by + obtain ⟨w, x, rfl⟩ := f.copy_cover a z + rw [f.toFlatQuotient_copy, f.fromFlatQuotient_class] + +theorem flatQuotientEquiv_class (w : External J f.Letters) (x : A) : + f.flatQuotientEquiv a (f.flatClass a w x) = (f.copy a w).toFun x := rfl + +theorem FlatPath.translate (g : External J f.Letters) {x y : f.FlatLabel (J := J)} + (path : f.FlatPath a x y) : + f.FlatPath a (g * x.1, x.2) (g * y.1, y.2) := by + apply (f.flatPath_iff_copy_eq a _ _).2 + have equal := congrArg (f.translate a g) ((f.flatPath_iff_copy_eq a x y).1 path) + simpa only [f.translate_copy] using equal + +theorem flatPath_translate_iff (g : External J f.Letters) (x y : f.FlatLabel (J := J)) : + f.FlatPath a (g * x.1, x.2) (g * y.1, y.2) ↔ f.FlatPath a x y := by + constructor + · intro path + have inverse := FlatPath.translate f a g⁻¹ path + simpa only [Prod.fst, Prod.snd, inv_mul_cancel_left] using inverse + · exact FlatPath.translate f a g + +end PartitionPilot.Compression.RecursiveMaps.TileRequests.Family + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationSteps.lean index fbe69d4cba15f5888c438de49363354ba2ecc672..bee5e868cd5a975c3b91916391e0d9373b72d535 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationSteps.lean @@ -1,124 +1,124 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundIntervalRecursion - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def enumerationRemainder (A a p : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun x => ¬ ∃ b ∈ a, ZFSet.pair b x ∈ p) A - -theorem mem_enumerationRemainder (A a p x : ZFSet.{u}) : - x ∈ enumerationRemainder A a p ↔ x ∈ A ∧ ¬ ∃ b ∈ a, ZFSet.pair b x ∈ p := - ZFSet.mem_sep - -def ChoiceEnumerationStep (A F c a p y : ZFSet.{u}) : Prop := - (∃ R ∈ F, R = enumerationRemainder A a p ∧ ZFSet.pair R y ∈ c) ∨ - (¬ (enumerationRemainder A a p).Nonempty ∧ y = A) - -namespace BoundedFormula - -def enumerationRemainderFormula {n} (R A a p : Fin n) : BoundedFormula n := - .conj (.allMem R (.mem 0 A.succ)) (.allMem A - (.conj (imp (.mem 0 R.succ) - (.neg (exMem a.succ (pairMembershipFormula 0 1 p.succ.succ)))) - (imp (.neg (exMem a.succ (pairMembershipFormula 0 1 p.succ.succ))) - (.mem 0 R.succ)))) - -theorem truth_enumerationRemainderFormula {n} (R A a p : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (enumerationRemainderFormula R A a p) env ↔ - env R = enumerationRemainder (env A) (env a) (env p) := by - simp only [enumerationRemainderFormula, Truth, truth_imp, truth_exMem, - truth_pairMembershipFormula, ← iff_def] - change ((∀ x ∈ env R, x ∈ env A) ∧ ∀ x ∈ env A, - x ∈ env R ↔ ¬ ∃ b ∈ env a, ZFSet.pair b x ∈ env p) ↔ _ - constructor - · rintro ⟨subset, spec⟩ - apply ZFSet.ext - intro x - rw [mem_enumerationRemainder] - exact ⟨fun hx => ⟨subset x hx, (spec x (subset x hx)).1 hx⟩, - fun ⟨hx, unused⟩ => (spec x hx).2 unused⟩ - · intro equal - rw [equal] - exact ⟨fun _ hx => (mem_enumerationRemainder _ _ _ _).1 hx |>.1, - fun x hx => by rw [mem_enumerationRemainder]; exact and_iff_right hx⟩ - -def choiceEnumerationStepFormula {n} (A F c a p y : Fin n) : BoundedFormula n := - disj (exMem F (.conj (enumerationRemainderFormula 0 A.succ a.succ p.succ) - (pairMembershipFormula 0 y.succ c.succ))) - (.conj (.neg (exMem A (.neg (exMem a.succ - (pairMembershipFormula 0 1 p.succ.succ))))) (.equal y A)) - -theorem truth_choiceEnumerationStepFormula {n} (A F c a p y : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (choiceEnumerationStepFormula A F c a p y) env ↔ - ChoiceEnumerationStep (env A) (env F) (env c) (env a) (env p) (env y) := by - simp only [choiceEnumerationStepFormula, truth_disj, truth_exMem, Truth, - truth_enumerationRemainderFormula, truth_pairMembershipFormula] - change ((∃ R ∈ env F, R = enumerationRemainder (env A) (env a) (env p) ∧ - ZFSet.pair R (env y) ∈ env c) ∨ - (¬ (∃ x ∈ env A, ¬ ∃ b ∈ env a, ZFSet.pair b x ∈ env p) ∧ env y = env A)) ↔ _ - have nonempty : (enumerationRemainder (env A) (env a) (env p)).Nonempty ↔ - ∃ x ∈ env A, ¬ ∃ b ∈ env a, ZFSet.pair b x ∈ env p := by - change (∃ x, x ∈ enumerationRemainder (env A) (env a) (env p)) ↔ _ - simp only [mem_enumerationRemainder] - simp only [ChoiceEnumerationStep, nonempty] - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem enumerationRemainder_mem (separation : SeparationSchema M.sets) - {A a p : ZFSet.{u}} (hA : A ∈ M.sets) (ha : a ∈ M.sets) (hp : p ∈ M.sets) : - enumerationRemainder A a p ∈ M.sets := by - let formula : BoundedFormula 3 := .neg (BoundedFormula.exMem 1 - (BoundedFormula.pairMembershipFormula 0 1 3)) - let params := extend a (extend p Fin.elim0) - have ground := M.bounded_separation_mem separation formula params - (Fin.cases ha (Fin.cases hp (fun i => Fin.elim0 i))) hA - have equal : ZFSet.sep (fun x => BoundedFormula.Truth formula (extend x params)) A = - enumerationRemainder A a p := by - apply ZFSet.ext - intro x - simp only [ZFSet.mem_sep, enumerationRemainder, formula, BoundedFormula.Truth, - BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] - rfl - exact equal ▸ ground - -theorem choiceEnumerationStep_exists_unique (separation : SeparationSchema M.sets) - {A c a p : ZFSet.{u}} (hA : A ∈ M.sets) (ha : a ∈ M.sets) (hp : p ∈ M.sets) - (code : ChoiceFunctionCode (M.nonemptyGroundSubsets A) c) : - ∃ y ∈ M.sets, ChoiceEnumerationStep A (M.nonemptyGroundSubsets A) c a p y ∧ - ∀ z, ChoiceEnumerationStep A (M.nonemptyGroundSubsets A) c a p z → z = y := by - classical - let R := enumerationRemainder A a p - have hR := M.enumerationRemainder_mem separation hA ha hp - have subset : R ⊆ A := fun _ hx => (mem_enumerationRemainder _ _ _ _).1 hx |>.1 - by_cases nonempty : R.Nonempty - · have member := (M.mem_nonemptyGroundSubsets A R).2 ⟨hR, subset, nonempty⟩ - obtain ⟨y, entry, unique⟩ := code.function.2 R member - have hy := code.chosen R y entry - refine ⟨y, M.transitive hA (subset hy), Or.inl ⟨R, member, rfl, entry⟩, ?_⟩ - intro z step - rcases step with ⟨S, _, rfl, selected⟩ | ⟨empty, _⟩ - · exact unique z selected - · exact False.elim (empty nonempty) - · refine ⟨A, hA, Or.inr ⟨nonempty, rfl⟩, ?_⟩ - intro z step - rcases step with ⟨S, member, rfl, _⟩ | ⟨_, equal⟩ - · exact False.elim (nonempty ((M.mem_nonemptyGroundSubsets A _).1 member).2.2) - · exact equal - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundIntervalRecursion + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def enumerationRemainder (A a p : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun x => ¬ ∃ b ∈ a, ZFSet.pair b x ∈ p) A + +theorem mem_enumerationRemainder (A a p x : ZFSet.{u}) : + x ∈ enumerationRemainder A a p ↔ x ∈ A ∧ ¬ ∃ b ∈ a, ZFSet.pair b x ∈ p := + ZFSet.mem_sep + +def ChoiceEnumerationStep (A F c a p y : ZFSet.{u}) : Prop := + (∃ R ∈ F, R = enumerationRemainder A a p ∧ ZFSet.pair R y ∈ c) ∨ + (¬ (enumerationRemainder A a p).Nonempty ∧ y = A) + +namespace BoundedFormula + +def enumerationRemainderFormula {n} (R A a p : Fin n) : BoundedFormula n := + .conj (.allMem R (.mem 0 A.succ)) (.allMem A + (.conj (imp (.mem 0 R.succ) + (.neg (exMem a.succ (pairMembershipFormula 0 1 p.succ.succ)))) + (imp (.neg (exMem a.succ (pairMembershipFormula 0 1 p.succ.succ))) + (.mem 0 R.succ)))) + +theorem truth_enumerationRemainderFormula {n} (R A a p : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (enumerationRemainderFormula R A a p) env ↔ + env R = enumerationRemainder (env A) (env a) (env p) := by + simp only [enumerationRemainderFormula, Truth, truth_imp, truth_exMem, + truth_pairMembershipFormula, ← iff_def] + change ((∀ x ∈ env R, x ∈ env A) ∧ ∀ x ∈ env A, + x ∈ env R ↔ ¬ ∃ b ∈ env a, ZFSet.pair b x ∈ env p) ↔ _ + constructor + · rintro ⟨subset, spec⟩ + apply ZFSet.ext + intro x + rw [mem_enumerationRemainder] + exact ⟨fun hx => ⟨subset x hx, (spec x (subset x hx)).1 hx⟩, + fun ⟨hx, unused⟩ => (spec x hx).2 unused⟩ + · intro equal + rw [equal] + exact ⟨fun _ hx => (mem_enumerationRemainder _ _ _ _).1 hx |>.1, + fun x hx => by rw [mem_enumerationRemainder]; exact and_iff_right hx⟩ + +def choiceEnumerationStepFormula {n} (A F c a p y : Fin n) : BoundedFormula n := + disj (exMem F (.conj (enumerationRemainderFormula 0 A.succ a.succ p.succ) + (pairMembershipFormula 0 y.succ c.succ))) + (.conj (.neg (exMem A (.neg (exMem a.succ + (pairMembershipFormula 0 1 p.succ.succ))))) (.equal y A)) + +theorem truth_choiceEnumerationStepFormula {n} (A F c a p y : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (choiceEnumerationStepFormula A F c a p y) env ↔ + ChoiceEnumerationStep (env A) (env F) (env c) (env a) (env p) (env y) := by + simp only [choiceEnumerationStepFormula, truth_disj, truth_exMem, Truth, + truth_enumerationRemainderFormula, truth_pairMembershipFormula] + change ((∃ R ∈ env F, R = enumerationRemainder (env A) (env a) (env p) ∧ + ZFSet.pair R (env y) ∈ env c) ∨ + (¬ (∃ x ∈ env A, ¬ ∃ b ∈ env a, ZFSet.pair b x ∈ env p) ∧ env y = env A)) ↔ _ + have nonempty : (enumerationRemainder (env A) (env a) (env p)).Nonempty ↔ + ∃ x ∈ env A, ¬ ∃ b ∈ env a, ZFSet.pair b x ∈ env p := by + change (∃ x, x ∈ enumerationRemainder (env A) (env a) (env p)) ↔ _ + simp only [mem_enumerationRemainder] + simp only [ChoiceEnumerationStep, nonempty] + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem enumerationRemainder_mem (separation : SeparationSchema M.sets) + {A a p : ZFSet.{u}} (hA : A ∈ M.sets) (ha : a ∈ M.sets) (hp : p ∈ M.sets) : + enumerationRemainder A a p ∈ M.sets := by + let formula : BoundedFormula 3 := .neg (BoundedFormula.exMem 1 + (BoundedFormula.pairMembershipFormula 0 1 3)) + let params := extend a (extend p Fin.elim0) + have ground := M.bounded_separation_mem separation formula params + (Fin.cases ha (Fin.cases hp (fun i => Fin.elim0 i))) hA + have equal : ZFSet.sep (fun x => BoundedFormula.Truth formula (extend x params)) A = + enumerationRemainder A a p := by + apply ZFSet.ext + intro x + simp only [ZFSet.mem_sep, enumerationRemainder, formula, BoundedFormula.Truth, + BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] + rfl + exact equal ▸ ground + +theorem choiceEnumerationStep_exists_unique (separation : SeparationSchema M.sets) + {A c a p : ZFSet.{u}} (hA : A ∈ M.sets) (ha : a ∈ M.sets) (hp : p ∈ M.sets) + (code : ChoiceFunctionCode (M.nonemptyGroundSubsets A) c) : + ∃ y ∈ M.sets, ChoiceEnumerationStep A (M.nonemptyGroundSubsets A) c a p y ∧ + ∀ z, ChoiceEnumerationStep A (M.nonemptyGroundSubsets A) c a p z → z = y := by + classical + let R := enumerationRemainder A a p + have hR := M.enumerationRemainder_mem separation hA ha hp + have subset : R ⊆ A := fun _ hx => (mem_enumerationRemainder _ _ _ _).1 hx |>.1 + by_cases nonempty : R.Nonempty + · have member := (M.mem_nonemptyGroundSubsets A R).2 ⟨hR, subset, nonempty⟩ + obtain ⟨y, entry, unique⟩ := code.function.2 R member + have hy := code.chosen R y entry + refine ⟨y, M.transitive hA (subset hy), Or.inl ⟨R, member, rfl, entry⟩, ?_⟩ + intro z step + rcases step with ⟨S, _, rfl, selected⟩ | ⟨empty, _⟩ + · exact unique z selected + · exact False.elim (empty nonempty) + · refine ⟨A, hA, Or.inr ⟨nonempty, rfl⟩, ?_⟩ + intro z step + rcases step with ⟨S, member, rfl, _⟩ | ⟨_, equal⟩ + · exact False.elim (nonempty ((M.mem_nonemptyGroundSubsets A _).1 member).2.2) + · exact equal + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationTraces.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationTraces.lean index 42360af0041ed05df545a7d2ef1e1b21d4228ec2..e342e835f9d90027457c92e97423364a41d9481d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationTraces.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundChoiceEnumerationTraces.lean @@ -1,53 +1,53 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalEnumerationFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_choiceEnumerationTrace - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {A c T : ZFSet.{u}} (hA : A ∈ M.sets) (hc : c ∈ M.sets) - (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) - (code : ChoiceFunctionCode (M.nonemptyGroundSubsets A) c) : - ∃ f ∈ M.sets, - OrdinalRecursionTrace (ChoiceEnumerationStep A (M.nonemptyGroundSubsets A) c) T f := by - let F := M.nonemptyGroundSubsets A - have hF : F ∈ M.sets := M.nonemptyGroundSubsets_mem powers separation hA - let params := extend A (extend F (extend c Fin.elim0)) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hA (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))) - let formula : BoundedFormula 6 := BoundedFormula.choiceEnumerationStepFormula 3 4 5 0 1 2 - have recognize (a p y : ZFSet.{u}) (ha : a ∈ M.sets) (hp : p ∈ M.sets) - (hy : y ∈ M.sets) : - Realize M.sets formula.toFormula (extend a (extend p (extend y params))) ↔ - ChoiceEnumerationStep A F c a p y := - (BoundedFormula.realize_toFormula M formula _ - (Fin.cases ha (Fin.cases hp (Fin.cases hy members)))).trans - (BoundedFormula.truth_choiceEnumerationStepFormula 3 4 5 0 1 2 _) - have closure : GroundOrdinalStepClosure M T formula.toFormula params := by - intro a ha p hp _ - have haM := M.transitive hT ha - obtain ⟨y, hy, step, unique⟩ := - M.choiceEnumerationStep_exists_unique separation hA haM hp code - exact ⟨y, hy, (recognize a p y haM hp hy).2 step, - fun z hz relation => unique z ((recognize a p z haM hp hz).1 relation)⟩ - obtain ⟨f, hf, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection - hT ordinal formula.toFormula params members closure - refine ⟨f, hf, trace.1, ?_⟩ - intro a ha y entry - have step := trace.2 a ha y entry - exact (recognize a _ y (M.transitive hT ha) step.1 step.2.1).1 step.2.2 - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalEnumerationFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_choiceEnumerationTrace + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {A c T : ZFSet.{u}} (hA : A ∈ M.sets) (hc : c ∈ M.sets) + (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) + (code : ChoiceFunctionCode (M.nonemptyGroundSubsets A) c) : + ∃ f ∈ M.sets, + OrdinalRecursionTrace (ChoiceEnumerationStep A (M.nonemptyGroundSubsets A) c) T f := by + let F := M.nonemptyGroundSubsets A + have hF : F ∈ M.sets := M.nonemptyGroundSubsets_mem powers separation hA + let params := extend A (extend F (extend c Fin.elim0)) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hA (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))) + let formula : BoundedFormula 6 := BoundedFormula.choiceEnumerationStepFormula 3 4 5 0 1 2 + have recognize (a p y : ZFSet.{u}) (ha : a ∈ M.sets) (hp : p ∈ M.sets) + (hy : y ∈ M.sets) : + Realize M.sets formula.toFormula (extend a (extend p (extend y params))) ↔ + ChoiceEnumerationStep A F c a p y := + (BoundedFormula.realize_toFormula M formula _ + (Fin.cases ha (Fin.cases hp (Fin.cases hy members)))).trans + (BoundedFormula.truth_choiceEnumerationStepFormula 3 4 5 0 1 2 _) + have closure : GroundOrdinalStepClosure M T formula.toFormula params := by + intro a ha p hp _ + have haM := M.transitive hT ha + obtain ⟨y, hy, step, unique⟩ := + M.choiceEnumerationStep_exists_unique separation hA haM hp code + exact ⟨y, hy, (recognize a p y haM hp hy).2 step, + fun z hz relation => unique z ((recognize a p z haM hp hz).1 relation)⟩ + obtain ⟨f, hf, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection + hT ordinal formula.toFormula params members closure + refine ⟨f, hf, trace.1, ?_⟩ + intro a ha y entry + have step := trace.2 a ha y entry + exact (recognize a _ y (M.transitive hT ha) step.1 step.2.1).1 step.2.2 + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCoherentHeightChoices.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCoherentHeightChoices.lean index 9a88b3f05c76ce302dbeac3e1f80c015e9318b89..e83a96be8fbe229200fd3b9a01d0c2144c459450 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCoherentHeightChoices.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCoherentHeightChoices.lean @@ -1,168 +1,168 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerialOrbits - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -noncomputable def stagedGraphRelation (W : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n m h k, - z = ZFSet.pair (ZFSet.pair n h) (ZFSet.pair m k) ∧ m = insert n n ∧ h ⊆ k) - (ZFSet.prod W W) - -theorem pair_mem_stagedGraphRelation (W n m h k : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair n h) (ZFSet.pair m k) ∈ stagedGraphRelation W ↔ - ZFSet.pair n h ∈ W ∧ ZFSet.pair m k ∈ W ∧ m = insert n n ∧ h ⊆ k := by - rw [stagedGraphRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨first, second⟩, a, b, c, d, equal, successor, subset⟩ - obtain ⟨firstEq, secondEq⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 firstEq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 secondEq - exact ⟨first, second, successor, subset⟩ - · rintro ⟨first, second, successor, subset⟩ - exact ⟨⟨first, second⟩, n, m, h, k, rfl, successor, subset⟩ - -namespace BoundedFormula - -def stagedGraphEntryFormula {n} (z omega b : Fin n) : BoundedFormula n := - exMem omega (exMem omega.succ (exMem b.succ.succ (exMem b.succ.succ.succ - (.conj (pairOfPairsFormula z.succ.succ.succ.succ 3 1 2 0) - (.conj (successorFormula 2 3) (subsetFormula 1 0)))))) - -theorem truth_stagedGraphEntryFormula {n} (z omega b : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (stagedGraphEntryFormula z omega b) env ↔ - ∃ a ∈ env omega, ∃ c ∈ env omega, ∃ h ∈ env b, ∃ k ∈ env b, - env z = ZFSet.pair (ZFSet.pair a h) (ZFSet.pair c k) ∧ c = insert a a ∧ h ⊆ k := by - simp only [stagedGraphEntryFormula, truth_exMem, Truth, truth_pairOfPairsFormula, - truth_successorFormula, truth_subsetFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem stagedGraphRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {W B : ZFSet.{u}} (hW : W ∈ M.sets) (hB : B ∈ M.sets) - (shape : W ⊆ ZFSet.prod ZFSet.omega B) : stagedGraphRelation W ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - let params := extend ZFSet.omega (extend B Fin.elim0) - have selected := M.bounded_separation_mem separation (BoundedFormula.stagedGraphEntryFormula 0 1 2) - params (Fin.cases hOmega (Fin.cases hB (fun i => Fin.elim0 i))) - (M.prod_mem pairing unions powers separation hW hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.stagedGraphEntryFormula 0 1 2) - (extend z params)) (ZFSet.prod W W) = stagedGraphRelation W := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, stagedGraphRelation, ZFSet.mem_sep, - BoundedFormula.truth_stagedGraphEntryFormula] - change (_ ∧ ∃ n ∈ ZFSet.omega, ∃ m ∈ ZFSet.omega, ∃ h ∈ B, ∃ k ∈ B, - z = ZFSet.pair (ZFSet.pair n h) (ZFSet.pair m k) ∧ m = insert n n ∧ h ⊆ k) ↔ _ - constructor - · rintro ⟨bound, n, _, m, _, h, _, k, _, eq, successor, subset⟩ - exact ⟨bound, n, m, h, k, eq, successor, subset⟩ - · rintro ⟨bound, n, m, h, k, rfl, successor, subset⟩ - have points := ZFSet.pair_mem_prod.1 bound - have first := ZFSet.pair_mem_prod.1 (shape points.1) - have second := ZFSet.pair_mem_prod.1 (shape points.2) - exact ⟨bound, n, first.1, m, second.1, h, first.2, k, second.2, rfl, successor, subset⟩ - exact equal ▸ selected - -theorem exists_groundCoherentChoices - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {W B initial : ZFSet.{u}} (hW : W ∈ M.sets) (hB : B ∈ M.sets) - (shape : W ⊆ ZFSet.prod ZFSet.omega B) (start : ZFSet.pair ∅ initial ∈ W) - (extendable : ∀ n ∈ ZFSet.omega, ∀ h, ZFSet.pair n h ∈ W → - ∃ k, ZFSet.pair (insert n n) k ∈ W ∧ h ⊆ k) : - ∃ history ∈ M.sets, ZFSet.IsFunc ZFSet.omega B history ∧ - (∀ h, ZFSet.pair ∅ h ∈ history ↔ h = initial) ∧ - (∀ n ∈ ZFSet.omega, ∀ h, ZFSet.pair n h ∈ history → ZFSet.pair n h ∈ W) ∧ - ∀ n ∈ ZFSet.omega, ∀ h k, - ZFSet.pair n h ∈ history → ZFSet.pair (insert n n) k ∈ history → h ⊆ k := by - have hOmega := M.omega_mem separation infinite - have relationGround := M.stagedGraphRelation_mem pairing unions powers separation infinite hW hB shape - have serial : ∀ x ∈ W, ∃ y ∈ W, ZFSet.pair x y ∈ stagedGraphRelation W := by - intro x hx - obtain ⟨n, hn, h, _, rfl⟩ := ZFSet.mem_prod.1 (shape hx) - obtain ⟨k, next, subset⟩ := extendable n hn h hx - exact ⟨ZFSet.pair (insert n n) k, next, - (pair_mem_stagedGraphRelation W n (insert n n) h k).2 ⟨hx, next, rfl, subset⟩⟩ - obtain ⟨orbit, hOrbit, orbitFunction, zero, step⟩ := - M.exists_groundSerialOrbit pairing unions powers separation infinite choice hW relationGround start serial - have stageValue : ∀ n : Nat, ∀ z, ZFSet.pair (natSetCode n) z ∈ orbit → - ∃ h, z = ZFSet.pair (natSetCode n) h := by - intro n - induction n with - | zero => - intro z entry - exact ⟨initial, (zero z).1 entry⟩ - | succ n ih => - intro z entry - obtain ⟨w, previous, _⟩ := orbitFunction.2 (natSetCode n) (natSetCode_mem_omega n) - obtain ⟨h, rfl⟩ := ih w previous - have rel := step (natSetCode n) (natSetCode_mem_omega n) _ z previous entry - obtain ⟨_, a, b, c, d, equal, successor, _⟩ := ZFSet.mem_sep.1 rel - obtain ⟨source, target⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 source - refine ⟨d, ?_⟩ - rw [successor] at target - exact target - have stageValueRaw (n z : ZFSet.{u}) (hn : n ∈ ZFSet.omega) - (entry : ZFSet.pair n z ∈ orbit) : ∃ h, z = ZFSet.pair n h := by - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact stageValue k z entry - let history := relationCompose ZFSet.omega W B orbit (productSecond ZFSet.omega B) - have historyGround : history ∈ M.sets := M.relationCompose_mem pairing unions powers separation - hOmega hW hB hOrbit (M.productSecond_mem pairing unions powers separation hOmega hB) - have historyFunction : ZFSet.IsFunc ZFSet.omega B history := - relationCompose_function_of_subset orbitFunction (productSecond_function ZFSet.omega B) shape - have projected (n h : ZFSet.{u}) (hn : n ∈ ZFSet.omega) : - ZFSet.pair n h ∈ history ↔ ZFSet.pair n (ZFSet.pair n h) ∈ orbit := by - change ZFSet.pair n h ∈ relationCompose _ _ _ _ _ ↔ _ - rw [pair_mem_relationCompose] - constructor - · rintro ⟨_, _, z, _, entry, projection⟩ - obtain ⟨k, rfl⟩ := stageValueRaw n z hn entry - obtain ⟨a, _, b, _, equal⟩ := (mem_productSecond _ _ _).1 projection - obtain ⟨first, second⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first - exact second ▸ entry - · intro entry - have point := (ZFSet.pair_mem_prod.1 (orbitFunction.1 entry)).2 - have inB := (ZFSet.pair_mem_prod.1 (shape point)).2 - exact ⟨hn, inB, ZFSet.pair n h, point, entry, - (mem_productSecond _ _ _).2 ⟨n, hn, h, inB, rfl⟩⟩ - refine ⟨history, historyGround, historyFunction, ?_, ?_, ?_⟩ - · intro h - rw [projected ∅ h (natSetCode_mem_omega 0), zero, ZFSet.pair_inj] - exact ⟨And.right, fun eq => ⟨rfl, eq⟩⟩ - · intro n hn h entry - exact (ZFSet.pair_mem_prod.1 (orbitFunction.1 ((projected n h hn).1 entry))).2 - · intro n hn h k first second - have successorMem : insert n n ∈ ZFSet.omega := by - obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact natSetCode_mem_omega (j + 1) - have rel := step n hn _ _ ((projected n h hn).1 first) - ((projected (insert n n) k successorMem).1 second) - exact ((pair_mem_stagedGraphRelation W n (insert n n) h k).1 rel).2.2.2 - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerialOrbits + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +noncomputable def stagedGraphRelation (W : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n m h k, + z = ZFSet.pair (ZFSet.pair n h) (ZFSet.pair m k) ∧ m = insert n n ∧ h ⊆ k) + (ZFSet.prod W W) + +theorem pair_mem_stagedGraphRelation (W n m h k : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair n h) (ZFSet.pair m k) ∈ stagedGraphRelation W ↔ + ZFSet.pair n h ∈ W ∧ ZFSet.pair m k ∈ W ∧ m = insert n n ∧ h ⊆ k := by + rw [stagedGraphRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨first, second⟩, a, b, c, d, equal, successor, subset⟩ + obtain ⟨firstEq, secondEq⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 firstEq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 secondEq + exact ⟨first, second, successor, subset⟩ + · rintro ⟨first, second, successor, subset⟩ + exact ⟨⟨first, second⟩, n, m, h, k, rfl, successor, subset⟩ + +namespace BoundedFormula + +def stagedGraphEntryFormula {n} (z omega b : Fin n) : BoundedFormula n := + exMem omega (exMem omega.succ (exMem b.succ.succ (exMem b.succ.succ.succ + (.conj (pairOfPairsFormula z.succ.succ.succ.succ 3 1 2 0) + (.conj (successorFormula 2 3) (subsetFormula 1 0)))))) + +theorem truth_stagedGraphEntryFormula {n} (z omega b : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (stagedGraphEntryFormula z omega b) env ↔ + ∃ a ∈ env omega, ∃ c ∈ env omega, ∃ h ∈ env b, ∃ k ∈ env b, + env z = ZFSet.pair (ZFSet.pair a h) (ZFSet.pair c k) ∧ c = insert a a ∧ h ⊆ k := by + simp only [stagedGraphEntryFormula, truth_exMem, Truth, truth_pairOfPairsFormula, + truth_successorFormula, truth_subsetFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem stagedGraphRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {W B : ZFSet.{u}} (hW : W ∈ M.sets) (hB : B ∈ M.sets) + (shape : W ⊆ ZFSet.prod ZFSet.omega B) : stagedGraphRelation W ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + let params := extend ZFSet.omega (extend B Fin.elim0) + have selected := M.bounded_separation_mem separation (BoundedFormula.stagedGraphEntryFormula 0 1 2) + params (Fin.cases hOmega (Fin.cases hB (fun i => Fin.elim0 i))) + (M.prod_mem pairing unions powers separation hW hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.stagedGraphEntryFormula 0 1 2) + (extend z params)) (ZFSet.prod W W) = stagedGraphRelation W := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, stagedGraphRelation, ZFSet.mem_sep, + BoundedFormula.truth_stagedGraphEntryFormula] + change (_ ∧ ∃ n ∈ ZFSet.omega, ∃ m ∈ ZFSet.omega, ∃ h ∈ B, ∃ k ∈ B, + z = ZFSet.pair (ZFSet.pair n h) (ZFSet.pair m k) ∧ m = insert n n ∧ h ⊆ k) ↔ _ + constructor + · rintro ⟨bound, n, _, m, _, h, _, k, _, eq, successor, subset⟩ + exact ⟨bound, n, m, h, k, eq, successor, subset⟩ + · rintro ⟨bound, n, m, h, k, rfl, successor, subset⟩ + have points := ZFSet.pair_mem_prod.1 bound + have first := ZFSet.pair_mem_prod.1 (shape points.1) + have second := ZFSet.pair_mem_prod.1 (shape points.2) + exact ⟨bound, n, first.1, m, second.1, h, first.2, k, second.2, rfl, successor, subset⟩ + exact equal ▸ selected + +theorem exists_groundCoherentChoices + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {W B initial : ZFSet.{u}} (hW : W ∈ M.sets) (hB : B ∈ M.sets) + (shape : W ⊆ ZFSet.prod ZFSet.omega B) (start : ZFSet.pair ∅ initial ∈ W) + (extendable : ∀ n ∈ ZFSet.omega, ∀ h, ZFSet.pair n h ∈ W → + ∃ k, ZFSet.pair (insert n n) k ∈ W ∧ h ⊆ k) : + ∃ history ∈ M.sets, ZFSet.IsFunc ZFSet.omega B history ∧ + (∀ h, ZFSet.pair ∅ h ∈ history ↔ h = initial) ∧ + (∀ n ∈ ZFSet.omega, ∀ h, ZFSet.pair n h ∈ history → ZFSet.pair n h ∈ W) ∧ + ∀ n ∈ ZFSet.omega, ∀ h k, + ZFSet.pair n h ∈ history → ZFSet.pair (insert n n) k ∈ history → h ⊆ k := by + have hOmega := M.omega_mem separation infinite + have relationGround := M.stagedGraphRelation_mem pairing unions powers separation infinite hW hB shape + have serial : ∀ x ∈ W, ∃ y ∈ W, ZFSet.pair x y ∈ stagedGraphRelation W := by + intro x hx + obtain ⟨n, hn, h, _, rfl⟩ := ZFSet.mem_prod.1 (shape hx) + obtain ⟨k, next, subset⟩ := extendable n hn h hx + exact ⟨ZFSet.pair (insert n n) k, next, + (pair_mem_stagedGraphRelation W n (insert n n) h k).2 ⟨hx, next, rfl, subset⟩⟩ + obtain ⟨orbit, hOrbit, orbitFunction, zero, step⟩ := + M.exists_groundSerialOrbit pairing unions powers separation infinite choice hW relationGround start serial + have stageValue : ∀ n : Nat, ∀ z, ZFSet.pair (natSetCode n) z ∈ orbit → + ∃ h, z = ZFSet.pair (natSetCode n) h := by + intro n + induction n with + | zero => + intro z entry + exact ⟨initial, (zero z).1 entry⟩ + | succ n ih => + intro z entry + obtain ⟨w, previous, _⟩ := orbitFunction.2 (natSetCode n) (natSetCode_mem_omega n) + obtain ⟨h, rfl⟩ := ih w previous + have rel := step (natSetCode n) (natSetCode_mem_omega n) _ z previous entry + obtain ⟨_, a, b, c, d, equal, successor, _⟩ := ZFSet.mem_sep.1 rel + obtain ⟨source, target⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 source + refine ⟨d, ?_⟩ + rw [successor] at target + exact target + have stageValueRaw (n z : ZFSet.{u}) (hn : n ∈ ZFSet.omega) + (entry : ZFSet.pair n z ∈ orbit) : ∃ h, z = ZFSet.pair n h := by + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact stageValue k z entry + let history := relationCompose ZFSet.omega W B orbit (productSecond ZFSet.omega B) + have historyGround : history ∈ M.sets := M.relationCompose_mem pairing unions powers separation + hOmega hW hB hOrbit (M.productSecond_mem pairing unions powers separation hOmega hB) + have historyFunction : ZFSet.IsFunc ZFSet.omega B history := + relationCompose_function_of_subset orbitFunction (productSecond_function ZFSet.omega B) shape + have projected (n h : ZFSet.{u}) (hn : n ∈ ZFSet.omega) : + ZFSet.pair n h ∈ history ↔ ZFSet.pair n (ZFSet.pair n h) ∈ orbit := by + change ZFSet.pair n h ∈ relationCompose _ _ _ _ _ ↔ _ + rw [pair_mem_relationCompose] + constructor + · rintro ⟨_, _, z, _, entry, projection⟩ + obtain ⟨k, rfl⟩ := stageValueRaw n z hn entry + obtain ⟨a, _, b, _, equal⟩ := (mem_productSecond _ _ _).1 projection + obtain ⟨first, second⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 first + exact second ▸ entry + · intro entry + have point := (ZFSet.pair_mem_prod.1 (orbitFunction.1 entry)).2 + have inB := (ZFSet.pair_mem_prod.1 (shape point)).2 + exact ⟨hn, inB, ZFSet.pair n h, point, entry, + (mem_productSecond _ _ _).2 ⟨n, hn, h, inB, rfl⟩⟩ + refine ⟨history, historyGround, historyFunction, ?_, ?_, ?_⟩ + · intro h + rw [projected ∅ h (natSetCode_mem_omega 0), zero, ZFSet.pair_inj] + exact ⟨And.right, fun eq => ⟨rfl, eq⟩⟩ + · intro n hn h entry + exact (ZFSet.pair_mem_prod.1 (orbitFunction.1 ((projected n h hn).1 entry))).2 + · intro n hn h k first second + have successorMem : insert n n ∈ ZFSet.omega := by + obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact natSetCode_mem_omega (j + 1) + have rel := step n hn _ _ ((projected n h hn).1 first) + ((projected (insert n n) k successorMem).1 second) + exact ((pair_mem_stagedGraphRelation W n (insert n n) h k).1 rel).2.2.2 + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCountableQuotients.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCountableQuotients.lean index 37eb1541b55cfc0be0764648d3025cd58075300f..a8d4985a56a97ef3cd2a0b925981fb36fca31ee7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCountableQuotients.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundCountableQuotients.lean @@ -1,145 +1,145 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations - -namespace OAI - -namespace PartitionPilot.Forcing - -universe u - -structure EquivalenceRelationCode (S E : ZFSet.{u}) : Prop where - shape : E ⊆ ZFSet.prod S S - refl : ∀ x ∈ S, ZFSet.pair x x ∈ E - symm : ∀ x y, ZFSet.pair x y ∈ E → ZFSet.pair y x ∈ E - trans : ∀ x y z, ZFSet.pair x y ∈ E → ZFSet.pair y z ∈ E → ZFSet.pair x z ∈ E - -def canonicalRepresentativeProperty (S E c x : ZFSet.{u}) : Prop := - ∃ n ∈ ZFSet.omega, ZFSet.pair x n ∈ c ∧ - ∀ y ∈ S, ZFSet.pair x y ∈ E → ∀ m ∈ n, ZFSet.pair y m ∉ c - -noncomputable def canonicalRepresentatives (S E c : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (canonicalRepresentativeProperty S E c) S - -theorem mem_canonicalRepresentatives (S E c x : ZFSet.{u}) : - x ∈ canonicalRepresentatives S E c ↔ x ∈ S ∧ canonicalRepresentativeProperty S E c x := - ZFSet.mem_sep - -theorem canonicalRepresentatives_subset (S E c : ZFSet.{u}) : - canonicalRepresentatives S E c ⊆ S := - fun _ h => (ZFSet.mem_sep.1 h).1 - -theorem canonical_exists {S E c x : ZFSet.{u}} - (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) - (hx : x ∈ S) : ∃ y ∈ canonicalRepresentatives S E c, ZFSet.pair x y ∈ E := by - classical - let valid : Nat → Prop := fun n => ∃ y ∈ S, ZFSet.pair x y ∈ E ∧ ZFSet.pair y (natSetCode n) ∈ c - have existsValid : ∃ n, valid n := by - obtain ⟨a, entry, _⟩ := injection.function.2 x hx - have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat - exact ⟨n, x, hx, equivalence.refl x hx, entry⟩ - obtain ⟨y, hy, related, entry⟩ := Nat.find_spec existsValid - refine ⟨y, (mem_canonicalRepresentatives S E c y).2 - ⟨hy, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩, related⟩ - intro z hz yz m hm smaller - obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm - have validK : valid k := ⟨z, hz, equivalence.trans x y z related yz, equal ▸ smaller⟩ - exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower - -theorem canonical_equiv_eq {S E c x y : ZFSet.{u}} - (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) - (hx : x ∈ canonicalRepresentatives S E c) (hy : y ∈ canonicalRepresentatives S E c) - (related : ZFSet.pair x y ∈ E) : x = y := by - obtain ⟨xS, n, hn, xn, leastX⟩ := (mem_canonicalRepresentatives S E c x).1 hx - obtain ⟨yS, m, hm, ym, leastY⟩ := (mem_canonicalRepresentatives S E c y).1 hy - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - rcases lt_trichotomy k l with smaller | equal | larger - · exact False.elim (leastY x xS (equivalence.symm x y related) (natSetCode k) - ((natSetCode_mem_iff k l).2 smaller) xn) - · subst l - exact injection.injective x y (natSetCode k) xn ym - · exact False.elim (leastX y yS related (natSetCode l) - ((natSetCode_mem_iff l k).2 larger) ym) - -theorem canonical_exists_unique {S E c x : ZFSet.{u}} - (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) - (hx : x ∈ S) : ∃! y, y ∈ canonicalRepresentatives S E c ∧ ZFSet.pair x y ∈ E := by - obtain ⟨y, hy, related⟩ := canonical_exists equivalence injection hx - refine ⟨y, ⟨hy, related⟩, ?_⟩ - intro z hz - exact canonical_equiv_eq equivalence injection hz.1 hy - (equivalence.trans z x y (equivalence.symm x z hz.2) related) - -noncomputable def canonicalRepresentativesInjection (S E c : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ ZFSet.prod (canonicalRepresentatives S E c) ZFSet.omega) c - -theorem canonicalRepresentativesInjection_code {S E c : ZFSet.{u}} - (injection : InjectionCode S ZFSet.omega c) : - InjectionCode (canonicalRepresentatives S E c) ZFSet.omega (canonicalRepresentativesInjection S E c) := - injection.restrict (canonicalRepresentatives_subset S E c) - -namespace BoundedFormula - -open SetFormula - -def canonicalRepresentativeFormula {n} (x s e c omega : Fin n) : BoundedFormula n := - exMem omega (.conj (pairMembershipFormula x.succ 0 c.succ) - (.allMem s.succ (imp (pairMembershipFormula x.succ.succ 0 e.succ.succ) - (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ)))))) - -theorem truth_canonicalRepresentativeFormula {n} (x s e c omega : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (canonicalRepresentativeFormula x s e c omega) env ↔ - ∃ k ∈ env omega, ZFSet.pair (env x) k ∈ env c ∧ - ∀ y ∈ env s, ZFSet.pair (env x) y ∈ env e → ∀ m ∈ k, ZFSet.pair y m ∉ env c := by - simp only [canonicalRepresentativeFormula, truth_exMem, Truth, truth_imp, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem canonicalRepresentatives_mem (separation : SeparationSchema M.sets) - {S E c : ZFSet.{u}} (hS : S ∈ M.sets) (hE : E ∈ M.sets) (hc : c ∈ M.sets) - (hOmega : ZFSet.omega ∈ M.sets) : canonicalRepresentatives S E c ∈ M.sets := by - let params := extend S (extend E (extend c (extend ZFSet.omega Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.canonicalRepresentativeFormula 0 1 2 3 4) params - (Fin.cases hS (Fin.cases hE (Fin.cases hc (Fin.cases hOmega (fun i => Fin.elim0 i))))) hS - have eq : ZFSet.sep (fun x => BoundedFormula.Truth - (BoundedFormula.canonicalRepresentativeFormula 0 1 2 3 4) (extend x params)) S = - canonicalRepresentatives S E c := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, mem_canonicalRepresentatives] - exact and_congr Iff.rfl (BoundedFormula.truth_canonicalRepresentativeFormula 0 1 2 3 4 _) - exact eq ▸ selected - -theorem canonicalRepresentativesInjection_mem (separation : SeparationSchema M.sets) - {S E c : ZFSet.{u}} (hS : S ∈ M.sets) (hE : E ∈ M.sets) (hc : c ∈ M.sets) - (hOmega : ZFSet.omega ∈ M.sets) : canonicalRepresentativesInjection S E c ∈ M.sets := - M.injection_restriction_mem separation - (M.canonicalRepresentatives_mem separation hS hE hc hOmega) hOmega hc - -theorem canonicalRepresentatives_spec (separation : SeparationSchema M.sets) - {S E c : ZFSet.{u}} (hS : S ∈ M.sets) (hE : E ∈ M.sets) (hc : c ∈ M.sets) - (hOmega : ZFSet.omega ∈ M.sets) - (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) : - canonicalRepresentatives S E c ∈ M.sets ∧ canonicalRepresentatives S E c ⊆ S ∧ - canonicalRepresentativesInjection S E c ∈ M.sets ∧ - InjectionCode (canonicalRepresentatives S E c) ZFSet.omega (canonicalRepresentativesInjection S E c) ∧ - ∀ x ∈ S, ∃! y, y ∈ canonicalRepresentatives S E c ∧ ZFSet.pair x y ∈ E := - ⟨M.canonicalRepresentatives_mem separation hS hE hc hOmega, - canonicalRepresentatives_subset S E c, - M.canonicalRepresentativesInjection_mem separation hS hE hc hOmega, - canonicalRepresentativesInjection_code injection, - fun _ hx => canonical_exists_unique equivalence injection hx⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations + +namespace OAI + +namespace PartitionPilot.Forcing + +universe u + +structure EquivalenceRelationCode (S E : ZFSet.{u}) : Prop where + shape : E ⊆ ZFSet.prod S S + refl : ∀ x ∈ S, ZFSet.pair x x ∈ E + symm : ∀ x y, ZFSet.pair x y ∈ E → ZFSet.pair y x ∈ E + trans : ∀ x y z, ZFSet.pair x y ∈ E → ZFSet.pair y z ∈ E → ZFSet.pair x z ∈ E + +def canonicalRepresentativeProperty (S E c x : ZFSet.{u}) : Prop := + ∃ n ∈ ZFSet.omega, ZFSet.pair x n ∈ c ∧ + ∀ y ∈ S, ZFSet.pair x y ∈ E → ∀ m ∈ n, ZFSet.pair y m ∉ c + +noncomputable def canonicalRepresentatives (S E c : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (canonicalRepresentativeProperty S E c) S + +theorem mem_canonicalRepresentatives (S E c x : ZFSet.{u}) : + x ∈ canonicalRepresentatives S E c ↔ x ∈ S ∧ canonicalRepresentativeProperty S E c x := + ZFSet.mem_sep + +theorem canonicalRepresentatives_subset (S E c : ZFSet.{u}) : + canonicalRepresentatives S E c ⊆ S := + fun _ h => (ZFSet.mem_sep.1 h).1 + +theorem canonical_exists {S E c x : ZFSet.{u}} + (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) + (hx : x ∈ S) : ∃ y ∈ canonicalRepresentatives S E c, ZFSet.pair x y ∈ E := by + classical + let valid : Nat → Prop := fun n => ∃ y ∈ S, ZFSet.pair x y ∈ E ∧ ZFSet.pair y (natSetCode n) ∈ c + have existsValid : ∃ n, valid n := by + obtain ⟨a, entry, _⟩ := injection.function.2 x hx + have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2 + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat + exact ⟨n, x, hx, equivalence.refl x hx, entry⟩ + obtain ⟨y, hy, related, entry⟩ := Nat.find_spec existsValid + refine ⟨y, (mem_canonicalRepresentatives S E c y).2 + ⟨hy, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩, related⟩ + intro z hz yz m hm smaller + obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm + have validK : valid k := ⟨z, hz, equivalence.trans x y z related yz, equal ▸ smaller⟩ + exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower + +theorem canonical_equiv_eq {S E c x y : ZFSet.{u}} + (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) + (hx : x ∈ canonicalRepresentatives S E c) (hy : y ∈ canonicalRepresentatives S E c) + (related : ZFSet.pair x y ∈ E) : x = y := by + obtain ⟨xS, n, hn, xn, leastX⟩ := (mem_canonicalRepresentatives S E c x).1 hx + obtain ⟨yS, m, hm, ym, leastY⟩ := (mem_canonicalRepresentatives S E c y).1 hy + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + rcases lt_trichotomy k l with smaller | equal | larger + · exact False.elim (leastY x xS (equivalence.symm x y related) (natSetCode k) + ((natSetCode_mem_iff k l).2 smaller) xn) + · subst l + exact injection.injective x y (natSetCode k) xn ym + · exact False.elim (leastX y yS related (natSetCode l) + ((natSetCode_mem_iff l k).2 larger) ym) + +theorem canonical_exists_unique {S E c x : ZFSet.{u}} + (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) + (hx : x ∈ S) : ∃! y, y ∈ canonicalRepresentatives S E c ∧ ZFSet.pair x y ∈ E := by + obtain ⟨y, hy, related⟩ := canonical_exists equivalence injection hx + refine ⟨y, ⟨hy, related⟩, ?_⟩ + intro z hz + exact canonical_equiv_eq equivalence injection hz.1 hy + (equivalence.trans z x y (equivalence.symm x z hz.2) related) + +noncomputable def canonicalRepresentativesInjection (S E c : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ ZFSet.prod (canonicalRepresentatives S E c) ZFSet.omega) c + +theorem canonicalRepresentativesInjection_code {S E c : ZFSet.{u}} + (injection : InjectionCode S ZFSet.omega c) : + InjectionCode (canonicalRepresentatives S E c) ZFSet.omega (canonicalRepresentativesInjection S E c) := + injection.restrict (canonicalRepresentatives_subset S E c) + +namespace BoundedFormula + +open SetFormula + +def canonicalRepresentativeFormula {n} (x s e c omega : Fin n) : BoundedFormula n := + exMem omega (.conj (pairMembershipFormula x.succ 0 c.succ) + (.allMem s.succ (imp (pairMembershipFormula x.succ.succ 0 e.succ.succ) + (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ)))))) + +theorem truth_canonicalRepresentativeFormula {n} (x s e c omega : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (canonicalRepresentativeFormula x s e c omega) env ↔ + ∃ k ∈ env omega, ZFSet.pair (env x) k ∈ env c ∧ + ∀ y ∈ env s, ZFSet.pair (env x) y ∈ env e → ∀ m ∈ k, ZFSet.pair y m ∉ env c := by + simp only [canonicalRepresentativeFormula, truth_exMem, Truth, truth_imp, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem canonicalRepresentatives_mem (separation : SeparationSchema M.sets) + {S E c : ZFSet.{u}} (hS : S ∈ M.sets) (hE : E ∈ M.sets) (hc : c ∈ M.sets) + (hOmega : ZFSet.omega ∈ M.sets) : canonicalRepresentatives S E c ∈ M.sets := by + let params := extend S (extend E (extend c (extend ZFSet.omega Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.canonicalRepresentativeFormula 0 1 2 3 4) params + (Fin.cases hS (Fin.cases hE (Fin.cases hc (Fin.cases hOmega (fun i => Fin.elim0 i))))) hS + have eq : ZFSet.sep (fun x => BoundedFormula.Truth + (BoundedFormula.canonicalRepresentativeFormula 0 1 2 3 4) (extend x params)) S = + canonicalRepresentatives S E c := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, mem_canonicalRepresentatives] + exact and_congr Iff.rfl (BoundedFormula.truth_canonicalRepresentativeFormula 0 1 2 3 4 _) + exact eq ▸ selected + +theorem canonicalRepresentativesInjection_mem (separation : SeparationSchema M.sets) + {S E c : ZFSet.{u}} (hS : S ∈ M.sets) (hE : E ∈ M.sets) (hc : c ∈ M.sets) + (hOmega : ZFSet.omega ∈ M.sets) : canonicalRepresentativesInjection S E c ∈ M.sets := + M.injection_restriction_mem separation + (M.canonicalRepresentatives_mem separation hS hE hc hOmega) hOmega hc + +theorem canonicalRepresentatives_spec (separation : SeparationSchema M.sets) + {S E c : ZFSet.{u}} (hS : S ∈ M.sets) (hE : E ∈ M.sets) (hc : c ∈ M.sets) + (hOmega : ZFSet.omega ∈ M.sets) + (equivalence : EquivalenceRelationCode S E) (injection : InjectionCode S ZFSet.omega c) : + canonicalRepresentatives S E c ∈ M.sets ∧ canonicalRepresentatives S E c ⊆ S ∧ + canonicalRepresentativesInjection S E c ∈ M.sets ∧ + InjectionCode (canonicalRepresentatives S E c) ZFSet.omega (canonicalRepresentativesInjection S E c) ∧ + ∀ x ∈ S, ∃! y, y ∈ canonicalRepresentatives S E c ∧ ZFSet.pair x y ∈ E := + ⟨M.canonicalRepresentatives_mem separation hS hE hc hOmega, + canonicalRepresentatives_subset S E c, + M.canonicalRepresentativesInjection_mem separation hS hE hc hOmega, + canonicalRepresentativesInjection_code injection, + fun _ hx => canonical_exists_unique equivalence injection hx⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundExternalWordQuotient.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundExternalWordQuotient.lean index c70b93ebe0f612f78b06742272c2701e88f09c2e..a7638ad8fc723521fda72cc191967f36c89485ba 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundExternalWordQuotient.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundExternalWordQuotient.lean @@ -1,300 +1,300 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalWordRewriteRealization -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyPresentation - -namespace OAI - -section - -namespace PartitionPilot.Forcing.ExternalWordRewrite - -open PartitionPilot.Compression.RecursiveMaps.CosetGeometry -universe u -variable (J S : Type u) [Group J] - -abbrev WordQuotient := (congruence J S).Quotient - -def quotientMap : FreeMonoid (Alphabet J S) →* WordQuotient J S := - (congruence J S).mk' - -def symbolValue : Alphabet J S → External J S - | .inl g => old J S g - | .inr p => signed J S p - -def evalWord : FreeMonoid (Alphabet J S) →* External J S := FreeMonoid.lift (symbolValue J S) - -theorem atomic_eval {xs ys : List (Alphabet J S)} (h : Atomic xs ys) : - evalWord J S xs = evalWord J S ys := by - cases h with - | old_one => exact (old J S).map_one - | old_mul g h => exact ((old J S).map_mul g h).symm - | cancel s b => - have cancel : FreeGroup.mk [(s, b), (s, !b)] = (1 : FreeGroup S) := - Quot.sound (@FreeGroup.Red.Step.not S [] [] s b) - change signed J S (s, b) * (signed J S (s, !b) * 1) = 1 - rw [mul_one] - change free J S (FreeGroup.mk [(s, b)]) * free J S (FreeGroup.mk [(s, !b)]) = 1 - rw [← map_mul, FreeGroup.mul_mk] - change free J S (FreeGroup.mk [(s, b), (s, !b)]) = 1 - rw [cancel, map_one] - -def evalQuotient : WordQuotient J S →* External J S := - (congruence J S).lift (evalWord J S) - (Con.conGen_le.2 (fun _ _ h => atomic_eval J S h)) - -theorem evalQuotient_mk (xs : List (Alphabet J S)) : - evalQuotient J S (quotientMap J S xs) = evalWord J S xs := rfl - -def oldClass : J →* WordQuotient J S where - toFun g := quotientMap J S [.inl g] - map_one' := (Con.eq _).2 - (ConGen.Rel.of (M := FreeMonoid (Alphabet J S)) _ _ Atomic.old_one) - map_mul' g h := ((Con.eq _).2 - (ConGen.Rel.of (M := FreeMonoid (Alphabet J S)) _ _ (Atomic.old_mul g h))).symm - -def freeWordMap : FreeMonoid (S × Bool) →* WordQuotient J S := - (quotientMap J S).comp (FreeMonoid.map Sum.inr) - -theorem freeWordMap_step {xs ys : List (S × Bool)} (h : FreeGroup.Red.Step xs ys) : - freeWordMap J S xs = freeWordMap J S ys := by - cases h with - | @not pre post s b => - apply (Con.eq _).2 - change congruence J S ((pre ++ (s, b) :: (s, !b) :: post).map Sum.inr) - ((pre ++ post).map Sum.inr) - have step := ((Atomic.cancel (J := J) s b).step.append_left (pre.map Sum.inr)).append_right - (post.map Sum.inr) - simpa only [List.map_append, List.map_cons, List.map_nil, List.append_assoc, - List.cons_append, List.nil_append] using step.to_congruence - -def freeClass : FreeGroup S →* WordQuotient J S where - toFun := Quot.lift (fun xs => freeWordMap J S xs) (fun _ _ h => freeWordMap_step J S h) - map_one' := (freeWordMap J S).map_one - map_mul' := by - rintro ⟨xs⟩ ⟨ys⟩ - exact (freeWordMap J S).map_mul xs ys - -theorem freeClass_mk (xs : List (S × Bool)) : - freeClass J S (FreeGroup.mk xs) = quotientMap J S (xs.map Sum.inr) := rfl - -def fromExternal : External J S →* WordQuotient J S := - Monoid.CoprodI.lift (fun b => match b with - | false => oldClass J S - | true => freeClass J S) - -theorem fromExternal_old (g : J) : - fromExternal J S (old J S g) = oldClass J S g := rfl - -theorem fromExternal_free (x : FreeGroup S) : - fromExternal J S (free J S x) = freeClass J S x := rfl - -theorem fromExternal_evalWord (xs : List (Alphabet J S)) : - fromExternal J S (evalWord J S xs) = quotientMap J S xs := by - have hom : (fromExternal J S).comp (evalWord J S) = quotientMap J S := by - apply FreeMonoid.hom_eq - intro a - change fromExternal J S (symbolValue J S a) = quotientMap J S [a] - cases a with - | inl g => exact fromExternal_old J S g - | inr p => exact fromExternal_free J S (FreeGroup.mk [p]) - exact DFunLike.congr_fun hom xs - -theorem evalWord_signed_word (xs : List (S × Bool)) : - evalWord J S (xs.map Sum.inr) = free J S (FreeGroup.mk xs) := by - induction xs with - | nil => exact ((free J S).map_one).symm - | cons p xs ih => - have step : evalWord J S ((p :: xs).map Sum.inr) = - signed J S p * evalWord J S (xs.map Sum.inr) := by - exact (evalWord J S).map_mul (FreeMonoid.of (.inr p)) - (FreeMonoid.ofList (xs.map Sum.inr)) - rw [step, ih] - change free J S (FreeGroup.mk [p]) * free J S (FreeGroup.mk xs) = - free J S (FreeGroup.mk (p :: xs)) - rw [← map_mul, FreeGroup.mul_mk] - rfl - -theorem evalQuotient_fromExternal (x : External J S) : - evalQuotient J S (fromExternal J S x) = x := by - induction x using Monoid.CoprodI.induction_on with - | one => rw [map_one, map_one] - | of b x => - cases b with - | false => - change J at x - change evalQuotient J S (fromExternal J S (old J S x)) = old J S x - rw [fromExternal_old] - change evalWord J S [.inl x] = old J S x - rfl - | true => - change FreeGroup S at x - change evalQuotient J S (fromExternal J S (free J S x)) = free J S x - rw [fromExternal_free] - induction x using Quot.inductionOn with - | h xs => - change evalQuotient J S (freeClass J S (FreeGroup.mk xs)) = free J S (FreeGroup.mk xs) - rw [freeClass_mk, evalQuotient_mk] - exact evalWord_signed_word J S xs - | mul x y hx hy => simp only [map_mul, hx, hy] - -theorem fromExternal_evalQuotient (x : WordQuotient J S) : - fromExternal J S (evalQuotient J S x) = x := by - refine Con.induction_on x ?_ - intro xs - exact fromExternal_evalWord J S xs - -def quotientEquiv : WordQuotient J S ≃* External J S where - toFun := evalQuotient J S - invFun := fromExternal J S - left_inv := fromExternal_evalQuotient J S - right_inv := evalQuotient_fromExternal J S - map_mul' := (evalQuotient J S).map_mul - -theorem path_iff_evalWord (xs ys : List (Alphabet J S)) : - Path xs ys ↔ evalWord J S xs = evalWord J S ys := by - constructor - · intro h - have eq : quotientMap J S xs = quotientMap J S ys := - (Con.eq _).2 ((path_iff_conGen xs ys).1 h) - exact congrArg (evalQuotient J S) eq - · intro eq - apply (path_iff_conGen xs ys).2 - apply (Con.eq _).1 - apply (quotientEquiv J S).injective - exact eq - -theorem evalWord_surjective : Function.Surjective (evalWord J S) := by - intro x - obtain ⟨xs, eq⟩ := (Con.mk'_surjective (c := congruence J S)) (fromExternal J S x) - exact ⟨xs, (congrArg (evalQuotient J S) eq).trans (evalQuotient_fromExternal J S x)⟩ - -end PartitionPilot.Forcing.ExternalWordRewrite - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def externalWordEquivalence (G S m one : ZFSet.{u}) : ZFSet.{u} := - M.finitePathClosure (M.finiteWords (externalGeneratorAlphabet G S)) (M.externalWordSteps G S m one) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) - -include pairing unions powers separation infinite - -theorem externalWordEquivalence_mem {G S m one : ZFSet.{u}} - (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : - M.externalWordEquivalence G S m one ∈ M.sets := - M.finitePathClosure_mem pairing unions powers separation infinite - (M.finiteWords_mem pairing unions powers separation infinite - (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS)) - (M.externalWordSteps_mem pairing unions powers separation infinite hG hS hm hOne) - -theorem externalWordEquivalence_code {G S m one : ZFSet.{u}} - (hG : G ∈ M.sets) (hS : S ∈ M.sets) : - EquivalenceRelationCode (M.finiteWords (externalGeneratorAlphabet G S)) - (M.externalWordEquivalence G S m one) := by - let W := M.finiteWords (externalGeneratorAlphabet G S) - let p := SetMembers.presentation W - have hW : W ∈ M.sets := M.finiteWords_mem pairing unions powers separation infinite - (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS) - exact M.finitePathClosure_equivalence pairing unions separation infinite p - (fun x y => ZFSet.pair (p.encode x) (p.encode y) ∈ M.externalWordSteps G S m one) - (fun _ _ => Iff.rfl) hW (fun _ _ entry => externalWordStepGraph_symmetric entry) - -variable {J L : Type u} [Group J] (s : Presentation J) (t : Presentation L) -variable (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) - -include pairing unions powers separation infinite hG hS in -theorem pair_mem_externalWordEquivalence (xs ys : List (J ⊕ (L × Bool))) : - ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) - (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ - M.externalWordEquivalence s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ - ExternalWordRewrite.Path xs ys := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - let a := externalGeneratorAlphabetPresentation s t - let w := finiteWordPresentation a M pairing unions separation infinite hAlphabet - exact M.pair_mem_finitePathClosure pairing unions separation infinite w ExternalWordRewrite.Step - (M.pair_mem_externalWordSteps s t pairing unions separation infinite hAlphabet) - (M.finiteWords_mem pairing unions powers separation infinite hAlphabet) xs ys - -include pairing unions powers separation infinite hG hS in -theorem pair_mem_externalWordEquivalence_eval (xs ys : List (J ⊕ (L × Bool))) : - ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) - (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ - M.externalWordEquivalence s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ - ExternalWordRewrite.evalWord J L xs = ExternalWordRewrite.evalWord J L ys := - (M.pair_mem_externalWordEquivalence pairing unions powers separation infinite s t hG hS xs ys).trans - (ExternalWordRewrite.path_iff_evalWord J L xs ys) - -include pairing unions powers separation infinite hG hS in -theorem pair_mem_externalWordEquivalence_congruence (xs ys : List (J ⊕ (L × Bool))) : - ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) - (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ - M.externalWordEquivalence s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ - ExternalWordRewrite.congruence J L xs ys := - (M.pair_mem_externalWordEquivalence pairing unions powers separation infinite s t hG hS xs ys).trans - (ExternalWordRewrite.path_iff_conGen xs ys) - -noncomputable def externalWordQuotientPresentation : Presentation (ExternalWordRewrite.WordQuotient J L) := - let a := externalGeneratorAlphabetPresentation s t - let hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - let w := finiteWordPresentation a M pairing unions separation infinite hAlphabet - w.quotientPresentation (ExternalWordRewrite.congruence J L).toSetoid - (M.externalWordEquivalence_code pairing unions powers separation infinite hG hS) - (M.pair_mem_externalWordEquivalence_congruence pairing unions powers separation infinite s t hG hS) - -theorem externalWordQuotientPresentation_carrier : - (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS).carrier = - equivalenceClasses (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) - (M.externalWordEquivalence s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) := rfl - -theorem externalWordQuotientPresentation_encode_mk (xs : List (J ⊕ (L × Bool))) : - (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS).encode - (ExternalWordRewrite.quotientMap J L xs) = - equivalenceClass (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) - (M.externalWordEquivalence s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) - (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) := rfl - -theorem externalWordClassifier_eq_graph : - equivalenceClassifier (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) - (M.externalWordEquivalence s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) = - (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) M pairing unions separation infinite - (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS)).graph - (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS) - (ExternalWordRewrite.quotientMap J L) := by - exact (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) M - pairing unions separation infinite - (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS)).quotientClassifier_eq_graph - (ExternalWordRewrite.congruence J L).toSetoid - (M.externalWordEquivalence_code pairing unions powers separation infinite hG hS) - (M.pair_mem_externalWordEquivalence_congruence pairing unions powers separation infinite s t hG hS) - -theorem externalWordQuotient_ground - (hm : (s.product s).graph s (fun p => p.1 * p.2) ∈ M.sets) : - (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS).carrier ∈ M.sets ∧ - equivalenceClassifier (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) - (M.externalWordEquivalence s.carrier t.carrier - ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) ∈ M.sets := by - have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS - have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet - have hE := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm - (M.transitive hG (s.encode_mem 1)) - exact ⟨M.equivalenceClasses_mem powers separation hWords hE, - M.equivalenceClassifier_mem pairing unions powers separation hWords hE⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalWordRewriteRealization +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyPresentation + +namespace OAI + +section + +namespace PartitionPilot.Forcing.ExternalWordRewrite + +open PartitionPilot.Compression.RecursiveMaps.CosetGeometry +universe u +variable (J S : Type u) [Group J] + +abbrev WordQuotient := (congruence J S).Quotient + +def quotientMap : FreeMonoid (Alphabet J S) →* WordQuotient J S := + (congruence J S).mk' + +def symbolValue : Alphabet J S → External J S + | .inl g => old J S g + | .inr p => signed J S p + +def evalWord : FreeMonoid (Alphabet J S) →* External J S := FreeMonoid.lift (symbolValue J S) + +theorem atomic_eval {xs ys : List (Alphabet J S)} (h : Atomic xs ys) : + evalWord J S xs = evalWord J S ys := by + cases h with + | old_one => exact (old J S).map_one + | old_mul g h => exact ((old J S).map_mul g h).symm + | cancel s b => + have cancel : FreeGroup.mk [(s, b), (s, !b)] = (1 : FreeGroup S) := + Quot.sound (@FreeGroup.Red.Step.not S [] [] s b) + change signed J S (s, b) * (signed J S (s, !b) * 1) = 1 + rw [mul_one] + change free J S (FreeGroup.mk [(s, b)]) * free J S (FreeGroup.mk [(s, !b)]) = 1 + rw [← map_mul, FreeGroup.mul_mk] + change free J S (FreeGroup.mk [(s, b), (s, !b)]) = 1 + rw [cancel, map_one] + +def evalQuotient : WordQuotient J S →* External J S := + (congruence J S).lift (evalWord J S) + (Con.conGen_le.2 (fun _ _ h => atomic_eval J S h)) + +theorem evalQuotient_mk (xs : List (Alphabet J S)) : + evalQuotient J S (quotientMap J S xs) = evalWord J S xs := rfl + +def oldClass : J →* WordQuotient J S where + toFun g := quotientMap J S [.inl g] + map_one' := (Con.eq _).2 + (ConGen.Rel.of (M := FreeMonoid (Alphabet J S)) _ _ Atomic.old_one) + map_mul' g h := ((Con.eq _).2 + (ConGen.Rel.of (M := FreeMonoid (Alphabet J S)) _ _ (Atomic.old_mul g h))).symm + +def freeWordMap : FreeMonoid (S × Bool) →* WordQuotient J S := + (quotientMap J S).comp (FreeMonoid.map Sum.inr) + +theorem freeWordMap_step {xs ys : List (S × Bool)} (h : FreeGroup.Red.Step xs ys) : + freeWordMap J S xs = freeWordMap J S ys := by + cases h with + | @not pre post s b => + apply (Con.eq _).2 + change congruence J S ((pre ++ (s, b) :: (s, !b) :: post).map Sum.inr) + ((pre ++ post).map Sum.inr) + have step := ((Atomic.cancel (J := J) s b).step.append_left (pre.map Sum.inr)).append_right + (post.map Sum.inr) + simpa only [List.map_append, List.map_cons, List.map_nil, List.append_assoc, + List.cons_append, List.nil_append] using step.to_congruence + +def freeClass : FreeGroup S →* WordQuotient J S where + toFun := Quot.lift (fun xs => freeWordMap J S xs) (fun _ _ h => freeWordMap_step J S h) + map_one' := (freeWordMap J S).map_one + map_mul' := by + rintro ⟨xs⟩ ⟨ys⟩ + exact (freeWordMap J S).map_mul xs ys + +theorem freeClass_mk (xs : List (S × Bool)) : + freeClass J S (FreeGroup.mk xs) = quotientMap J S (xs.map Sum.inr) := rfl + +def fromExternal : External J S →* WordQuotient J S := + Monoid.CoprodI.lift (fun b => match b with + | false => oldClass J S + | true => freeClass J S) + +theorem fromExternal_old (g : J) : + fromExternal J S (old J S g) = oldClass J S g := rfl + +theorem fromExternal_free (x : FreeGroup S) : + fromExternal J S (free J S x) = freeClass J S x := rfl + +theorem fromExternal_evalWord (xs : List (Alphabet J S)) : + fromExternal J S (evalWord J S xs) = quotientMap J S xs := by + have hom : (fromExternal J S).comp (evalWord J S) = quotientMap J S := by + apply FreeMonoid.hom_eq + intro a + change fromExternal J S (symbolValue J S a) = quotientMap J S [a] + cases a with + | inl g => exact fromExternal_old J S g + | inr p => exact fromExternal_free J S (FreeGroup.mk [p]) + exact DFunLike.congr_fun hom xs + +theorem evalWord_signed_word (xs : List (S × Bool)) : + evalWord J S (xs.map Sum.inr) = free J S (FreeGroup.mk xs) := by + induction xs with + | nil => exact ((free J S).map_one).symm + | cons p xs ih => + have step : evalWord J S ((p :: xs).map Sum.inr) = + signed J S p * evalWord J S (xs.map Sum.inr) := by + exact (evalWord J S).map_mul (FreeMonoid.of (.inr p)) + (FreeMonoid.ofList (xs.map Sum.inr)) + rw [step, ih] + change free J S (FreeGroup.mk [p]) * free J S (FreeGroup.mk xs) = + free J S (FreeGroup.mk (p :: xs)) + rw [← map_mul, FreeGroup.mul_mk] + rfl + +theorem evalQuotient_fromExternal (x : External J S) : + evalQuotient J S (fromExternal J S x) = x := by + induction x using Monoid.CoprodI.induction_on with + | one => rw [map_one, map_one] + | of b x => + cases b with + | false => + change J at x + change evalQuotient J S (fromExternal J S (old J S x)) = old J S x + rw [fromExternal_old] + change evalWord J S [.inl x] = old J S x + rfl + | true => + change FreeGroup S at x + change evalQuotient J S (fromExternal J S (free J S x)) = free J S x + rw [fromExternal_free] + induction x using Quot.inductionOn with + | h xs => + change evalQuotient J S (freeClass J S (FreeGroup.mk xs)) = free J S (FreeGroup.mk xs) + rw [freeClass_mk, evalQuotient_mk] + exact evalWord_signed_word J S xs + | mul x y hx hy => simp only [map_mul, hx, hy] + +theorem fromExternal_evalQuotient (x : WordQuotient J S) : + fromExternal J S (evalQuotient J S x) = x := by + refine Con.induction_on x ?_ + intro xs + exact fromExternal_evalWord J S xs + +def quotientEquiv : WordQuotient J S ≃* External J S where + toFun := evalQuotient J S + invFun := fromExternal J S + left_inv := fromExternal_evalQuotient J S + right_inv := evalQuotient_fromExternal J S + map_mul' := (evalQuotient J S).map_mul + +theorem path_iff_evalWord (xs ys : List (Alphabet J S)) : + Path xs ys ↔ evalWord J S xs = evalWord J S ys := by + constructor + · intro h + have eq : quotientMap J S xs = quotientMap J S ys := + (Con.eq _).2 ((path_iff_conGen xs ys).1 h) + exact congrArg (evalQuotient J S) eq + · intro eq + apply (path_iff_conGen xs ys).2 + apply (Con.eq _).1 + apply (quotientEquiv J S).injective + exact eq + +theorem evalWord_surjective : Function.Surjective (evalWord J S) := by + intro x + obtain ⟨xs, eq⟩ := (Con.mk'_surjective (c := congruence J S)) (fromExternal J S x) + exact ⟨xs, (congrArg (evalQuotient J S) eq).trans (evalQuotient_fromExternal J S x)⟩ + +end PartitionPilot.Forcing.ExternalWordRewrite + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def externalWordEquivalence (G S m one : ZFSet.{u}) : ZFSet.{u} := + M.finitePathClosure (M.finiteWords (externalGeneratorAlphabet G S)) (M.externalWordSteps G S m one) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) + +include pairing unions powers separation infinite + +theorem externalWordEquivalence_mem {G S m one : ZFSet.{u}} + (hG : G ∈ M.sets) (hS : S ∈ M.sets) (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : + M.externalWordEquivalence G S m one ∈ M.sets := + M.finitePathClosure_mem pairing unions powers separation infinite + (M.finiteWords_mem pairing unions powers separation infinite + (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS)) + (M.externalWordSteps_mem pairing unions powers separation infinite hG hS hm hOne) + +theorem externalWordEquivalence_code {G S m one : ZFSet.{u}} + (hG : G ∈ M.sets) (hS : S ∈ M.sets) : + EquivalenceRelationCode (M.finiteWords (externalGeneratorAlphabet G S)) + (M.externalWordEquivalence G S m one) := by + let W := M.finiteWords (externalGeneratorAlphabet G S) + let p := SetMembers.presentation W + have hW : W ∈ M.sets := M.finiteWords_mem pairing unions powers separation infinite + (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS) + exact M.finitePathClosure_equivalence pairing unions separation infinite p + (fun x y => ZFSet.pair (p.encode x) (p.encode y) ∈ M.externalWordSteps G S m one) + (fun _ _ => Iff.rfl) hW (fun _ _ entry => externalWordStepGraph_symmetric entry) + +variable {J L : Type u} [Group J] (s : Presentation J) (t : Presentation L) +variable (hG : s.carrier ∈ M.sets) (hS : t.carrier ∈ M.sets) + +include pairing unions powers separation infinite hG hS in +theorem pair_mem_externalWordEquivalence (xs ys : List (J ⊕ (L × Bool))) : + ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) + (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ + M.externalWordEquivalence s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ + ExternalWordRewrite.Path xs ys := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + let a := externalGeneratorAlphabetPresentation s t + let w := finiteWordPresentation a M pairing unions separation infinite hAlphabet + exact M.pair_mem_finitePathClosure pairing unions separation infinite w ExternalWordRewrite.Step + (M.pair_mem_externalWordSteps s t pairing unions separation infinite hAlphabet) + (M.finiteWords_mem pairing unions powers separation infinite hAlphabet) xs ys + +include pairing unions powers separation infinite hG hS in +theorem pair_mem_externalWordEquivalence_eval (xs ys : List (J ⊕ (L × Bool))) : + ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) + (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ + M.externalWordEquivalence s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ + ExternalWordRewrite.evalWord J L xs = ExternalWordRewrite.evalWord J L ys := + (M.pair_mem_externalWordEquivalence pairing unions powers separation infinite s t hG hS xs ys).trans + (ExternalWordRewrite.path_iff_evalWord J L xs ys) + +include pairing unions powers separation infinite hG hS in +theorem pair_mem_externalWordEquivalence_congruence (xs ys : List (J ⊕ (L × Bool))) : + ZFSet.pair (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) + (finiteWordGraph (externalGeneratorAlphabetPresentation s t) ys) ∈ + M.externalWordEquivalence s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1) ↔ + ExternalWordRewrite.congruence J L xs ys := + (M.pair_mem_externalWordEquivalence pairing unions powers separation infinite s t hG hS xs ys).trans + (ExternalWordRewrite.path_iff_conGen xs ys) + +noncomputable def externalWordQuotientPresentation : Presentation (ExternalWordRewrite.WordQuotient J L) := + let a := externalGeneratorAlphabetPresentation s t + let hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + let w := finiteWordPresentation a M pairing unions separation infinite hAlphabet + w.quotientPresentation (ExternalWordRewrite.congruence J L).toSetoid + (M.externalWordEquivalence_code pairing unions powers separation infinite hG hS) + (M.pair_mem_externalWordEquivalence_congruence pairing unions powers separation infinite s t hG hS) + +theorem externalWordQuotientPresentation_carrier : + (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS).carrier = + equivalenceClasses (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) + (M.externalWordEquivalence s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) := rfl + +theorem externalWordQuotientPresentation_encode_mk (xs : List (J ⊕ (L × Bool))) : + (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS).encode + (ExternalWordRewrite.quotientMap J L xs) = + equivalenceClass (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) + (M.externalWordEquivalence s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) + (finiteWordGraph (externalGeneratorAlphabetPresentation s t) xs) := rfl + +theorem externalWordClassifier_eq_graph : + equivalenceClassifier (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) + (M.externalWordEquivalence s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) = + (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) M pairing unions separation infinite + (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS)).graph + (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS) + (ExternalWordRewrite.quotientMap J L) := by + exact (finiteWordPresentation (externalGeneratorAlphabetPresentation s t) M + pairing unions separation infinite + (M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS)).quotientClassifier_eq_graph + (ExternalWordRewrite.congruence J L).toSetoid + (M.externalWordEquivalence_code pairing unions powers separation infinite hG hS) + (M.pair_mem_externalWordEquivalence_congruence pairing unions powers separation infinite s t hG hS) + +theorem externalWordQuotient_ground + (hm : (s.product s).graph s (fun p => p.1 * p.2) ∈ M.sets) : + (M.externalWordQuotientPresentation pairing unions powers separation infinite s t hG hS).carrier ∈ M.sets ∧ + equivalenceClassifier (M.finiteWords (externalGeneratorAlphabet s.carrier t.carrier)) + (M.externalWordEquivalence s.carrier t.carrier + ((s.product s).graph s (fun p => p.1 * p.2)) (s.encode 1)) ∈ M.sets := by + have hAlphabet := M.externalGeneratorAlphabet_mem pairing unions powers separation hG hS + have hWords := M.finiteWords_mem pairing unions powers separation infinite hAlphabet + have hE := M.externalWordEquivalence_mem pairing unions powers separation infinite hG hS hm + (M.transitive hG (s.encode_mem 1)) + exact ⟨M.equivalenceClasses_mem powers separation hWords hE, + M.equivalenceClassifier_mem pairing unions powers separation hWords hE⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundFiniteWordInjections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundFiniteWordInjections.lean index 4725b2ffc147d268b347be6379648ddec5557ccb..2c0772cc0236b30fa68fdd870c9c19ffacfb4989 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundFiniteWordInjections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundFiniteWordInjections.lean @@ -1,61 +1,61 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteWordLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem finiteWordMapGraph_injection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A B e : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (code : InjectionCode A B e) : - InjectionCode (M.finiteWords A) (M.finiteWords B) (M.finiteWordMapGraph A B e) := by - let s := SetMembers.presentation A - let t := SetMembers.presentation B - let map := s.decodeFunction t e code.function - have graph : s.graph t map = e := s.graph_decodeFunction t e code.function - rw [← graph] - change InjectionCode (M.finiteWords s.carrier) (M.finiteWords t.carrier) - (M.finiteWordMapGraph s.carrier t.carrier (s.graph t map)) - rw [M.finiteWordMapGraph_eq_graph pairing unions separation infinite s t map hA hB] - exact (finiteWordPresentation s M pairing unions separation infinite hA).graph_injection - (finiteWordPresentation t M pairing unions separation infinite hB) (List.map map) - (List.map_injective_iff.2 code.decoded_injective) - -theorem finiteWordMapGraph_ground_injection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A B e : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) - (code : InjectionCode A B e) : - M.finiteWordMapGraph A B e ∈ M.sets ∧ - InjectionCode (M.finiteWords A) (M.finiteWords B) (M.finiteWordMapGraph A B e) := - ⟨M.finiteWordMapGraph_mem pairing unions powers separation infinite hA hB he, - M.finiteWordMapGraph_injection pairing unions separation infinite hA hB code⟩ - -theorem groundEmbeddable_finiteWords - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (injection : M.groundEmbeddable A B) : - M.groundEmbeddable (M.finiteWords A) (M.finiteWords B) := by - obtain ⟨e, he, code⟩ := injection - exact ⟨M.finiteWordMapGraph A B e, - M.finiteWordMapGraph_ground_injection pairing unions powers separation infinite hA hB he code⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteWordLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem finiteWordMapGraph_injection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A B e : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (code : InjectionCode A B e) : + InjectionCode (M.finiteWords A) (M.finiteWords B) (M.finiteWordMapGraph A B e) := by + let s := SetMembers.presentation A + let t := SetMembers.presentation B + let map := s.decodeFunction t e code.function + have graph : s.graph t map = e := s.graph_decodeFunction t e code.function + rw [← graph] + change InjectionCode (M.finiteWords s.carrier) (M.finiteWords t.carrier) + (M.finiteWordMapGraph s.carrier t.carrier (s.graph t map)) + rw [M.finiteWordMapGraph_eq_graph pairing unions separation infinite s t map hA hB] + exact (finiteWordPresentation s M pairing unions separation infinite hA).graph_injection + (finiteWordPresentation t M pairing unions separation infinite hB) (List.map map) + (List.map_injective_iff.2 code.decoded_injective) + +theorem finiteWordMapGraph_ground_injection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A B e : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (he : e ∈ M.sets) + (code : InjectionCode A B e) : + M.finiteWordMapGraph A B e ∈ M.sets ∧ + InjectionCode (M.finiteWords A) (M.finiteWords B) (M.finiteWordMapGraph A B e) := + ⟨M.finiteWordMapGraph_mem pairing unions powers separation infinite hA hB he, + M.finiteWordMapGraph_injection pairing unions separation infinite hA hB code⟩ + +theorem groundEmbeddable_finiteWords + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (injection : M.groundEmbeddable A B) : + M.groundEmbeddable (M.finiteWords A) (M.finiteWords B) := by + obtain ⟨e, he, code⟩ := injection + exact ⟨M.finiteWordMapGraph A B e, + M.finiteWordMapGraph_ground_injection pairing unions powers separation infinite hA hB he code⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInjectionRestrictions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInjectionRestrictions.lean index f54b9c181af040fcfdf439ff4a48af4b5888d9fc..457200c8f14c52a40ec707ebba0ac613aff9107f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInjectionRestrictions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInjectionRestrictions.lean @@ -1,71 +1,71 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSmallFunctionSpaces - -namespace OAI - -section - -namespace PartitionPilot.Forcing.InjectionCode - -universe u - -theorem restrict {D N f Q : ZFSet.{u}} (h : InjectionCode D N f) (subset : Q ⊆ D) : - InjectionCode Q N (ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f) := by - refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩, ?_⟩ - · intro x hx - obtain ⟨y, rel, unique⟩ := h.function.2 x (subset hx) - have hy := (ZFSet.pair_mem_prod.1 (h.function.1 rel)).2 - exact ⟨y, ZFSet.mem_sep.2 ⟨rel, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩⟩, - fun z hz => unique z (ZFSet.mem_sep.1 hz).1⟩ - · intro x y z hx hy - exact h.injective x y z (ZFSet.mem_sep.1 hx).1 (ZFSet.mem_sep.1 hy).1 - -end PartitionPilot.Forcing.InjectionCode - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem injection_restriction_mem (separation : SeparationSchema M.sets) - {Q N f : ZFSet.{u}} (hQ : Q ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) : - ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f ∈ M.sets := by - let params := extend Q (extend N Fin.elim0) - have selected := M.separation_mem separation (BoundedFormula.productElementFormula 0 1 2).toFormula - params (Fin.cases hQ (Fin.cases hN (fun j => Fin.elim0 j))) hf - have eq : ZFSet.sep (fun z => Realize M.sets - (BoundedFormula.productElementFormula 0 1 2).toFormula (extend z params)) f = - ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, ZFSet.mem_sep] - constructor - · rintro ⟨hz, rel⟩ - exact ⟨hz, (BoundedFormula.truth_productElementFormula 0 1 2 _).1 - ((BoundedFormula.realize_toFormula M _ _ (Fin.cases (M.transitive hf hz) - (Fin.cases hQ (Fin.cases hN (fun j => Fin.elim0 j))))).1 rel)⟩ - · rintro ⟨hz, rel⟩ - exact ⟨hz, (BoundedFormula.realize_toFormula M _ _ (Fin.cases (M.transitive hf hz) - (Fin.cases hQ (Fin.cases hN (fun j => Fin.elim0 j))))).2 - ((BoundedFormula.truth_productElementFormula 0 1 2 _).2 rel)⟩ - exact eq ▸ selected - -theorem groundEmbeddable_restrict (separation : SeparationSchema M.sets) - {D Q N : ZFSet.{u}} (hQ : Q ∈ M.sets) (hN : N ∈ M.sets) (subset : Q ⊆ D) - (small : M.groundEmbeddable D N) : M.groundEmbeddable Q N := by - obtain ⟨f, hf, code⟩ := small - exact ⟨ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f, - M.injection_restriction_mem separation hQ hN hf, code.restrict subset⟩ - -theorem smallPartialFunctions_restrict (separation : SeparationSchema M.sets) - {X Y N p q : ZFSet.{u}} (hp : p ∈ M.smallPartialFunctions X Y N) - (hq : q ∈ M.sets) (hN : N ∈ M.sets) (subset : q ⊆ p) : q ∈ M.smallPartialFunctions X Y N := by - obtain ⟨_, code, small⟩ := (M.mem_smallPartialFunctions X Y N p).1 hp - exact (M.mem_smallPartialFunctions X Y N q).2 - ⟨hq, code.mono subset, M.groundEmbeddable_restrict separation hq hN subset small⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSmallFunctionSpaces + +namespace OAI + +section + +namespace PartitionPilot.Forcing.InjectionCode + +universe u + +theorem restrict {D N f Q : ZFSet.{u}} (h : InjectionCode D N f) (subset : Q ⊆ D) : + InjectionCode Q N (ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f) := by + refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩, ?_⟩ + · intro x hx + obtain ⟨y, rel, unique⟩ := h.function.2 x (subset hx) + have hy := (ZFSet.pair_mem_prod.1 (h.function.1 rel)).2 + exact ⟨y, ZFSet.mem_sep.2 ⟨rel, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩⟩, + fun z hz => unique z (ZFSet.mem_sep.1 hz).1⟩ + · intro x y z hx hy + exact h.injective x y z (ZFSet.mem_sep.1 hx).1 (ZFSet.mem_sep.1 hy).1 + +end PartitionPilot.Forcing.InjectionCode + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem injection_restriction_mem (separation : SeparationSchema M.sets) + {Q N f : ZFSet.{u}} (hQ : Q ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) : + ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f ∈ M.sets := by + let params := extend Q (extend N Fin.elim0) + have selected := M.separation_mem separation (BoundedFormula.productElementFormula 0 1 2).toFormula + params (Fin.cases hQ (Fin.cases hN (fun j => Fin.elim0 j))) hf + have eq : ZFSet.sep (fun z => Realize M.sets + (BoundedFormula.productElementFormula 0 1 2).toFormula (extend z params)) f = + ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, ZFSet.mem_sep] + constructor + · rintro ⟨hz, rel⟩ + exact ⟨hz, (BoundedFormula.truth_productElementFormula 0 1 2 _).1 + ((BoundedFormula.realize_toFormula M _ _ (Fin.cases (M.transitive hf hz) + (Fin.cases hQ (Fin.cases hN (fun j => Fin.elim0 j))))).1 rel)⟩ + · rintro ⟨hz, rel⟩ + exact ⟨hz, (BoundedFormula.realize_toFormula M _ _ (Fin.cases (M.transitive hf hz) + (Fin.cases hQ (Fin.cases hN (fun j => Fin.elim0 j))))).2 + ((BoundedFormula.truth_productElementFormula 0 1 2 _).2 rel)⟩ + exact eq ▸ selected + +theorem groundEmbeddable_restrict (separation : SeparationSchema M.sets) + {D Q N : ZFSet.{u}} (hQ : Q ∈ M.sets) (hN : N ∈ M.sets) (subset : Q ⊆ D) + (small : M.groundEmbeddable D N) : M.groundEmbeddable Q N := by + obtain ⟨f, hf, code⟩ := small + exact ⟨ZFSet.sep (fun z => z ∈ ZFSet.prod Q N) f, + M.injection_restriction_mem separation hQ hN hf, code.restrict subset⟩ + +theorem smallPartialFunctions_restrict (separation : SeparationSchema M.sets) + {X Y N p q : ZFSet.{u}} (hp : p ∈ M.smallPartialFunctions X Y N) + (hq : q ∈ M.sets) (hN : N ∈ M.sets) (subset : q ⊆ p) : q ∈ M.smallPartialFunctions X Y N := by + obtain ⟨_, code, small⟩ := (M.mem_smallPartialFunctions X Y N p).1 hp + exact (M.mem_smallPartialFunctions X Y N q).2 + ⟨hq, code.mono subset, M.groundEmbeddable_restrict separation hq hN subset small⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInternalRowChoice.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInternalRowChoice.lean index aab462161308b3028e71816955173385b3f45ca0..a477f6b871e2c3a7f676de72dfb8b384b3a04a68 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInternalRowChoice.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundInternalRowChoice.lean @@ -1,218 +1,218 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundInternalRowSetZF -import OAI.SetTheory.PartitionPrinciple.Definability.GroundOutsideRowCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSeparatedRowConditions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (N : TransitiveGround.{u}) - -theorem exists_function_choosing_subsets - (powers : Realize N.sets powerSet Fin.elim0) - (separation : SeparationSchema N.sets) - (choice : Realize N.sets SetFormula.choice Fin.elim0) - {R : ZFSet.{u}} (hR : R ∈ N.sets) : - ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ R → S.Nonempty → - ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x := by - obtain ⟨W, hW, subsets⟩ := N.power_witness powers hR - let A := ZFSet.sep (fun S => S.Nonempty) W - have hA : A ∈ N.sets := by - have selected := N.bounded_separation_mem separation (BoundedFormula.nonemptyFormula 0) - Fin.elim0 (fun i => Fin.elim0 i) hW - have eq : ZFSet.sep (fun S => BoundedFormula.Truth (BoundedFormula.nonemptyFormula 0) - (extend S Fin.elim0)) W = A := by - apply ZFSet.ext - intro S - simp only [A, ZFSet.mem_sep, BoundedFormula.truth_nonemptyFormula] - rfl - exact eq ▸ selected - obtain ⟨f, hf, code⟩ := N.choice_witness choice hA - (fun S hS => (ZFSet.mem_sep.1 hS).2) - refine ⟨f, hf, ?_⟩ - intro S hS subset nonempty - have member : S ∈ A := ZFSet.mem_sep.2 ⟨(subsets S hS).2 subset, nonempty⟩ - obtain ⟨x, chosen, unique⟩ := code.function.2 S member - exact ⟨x, code.chosen S x chosen, chosen, fun z _ hz => unique z hz⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [Group G] [PartialOrder L] [OrderBot L] - -theorem internalRow_not_choice - (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) - (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) - (countableBound : ∀ A ∈ M.sets, A ⊆ s.carrier → M.groundEmbeddable A ZFSet.omega → - ∃ D : L, ∀ i : L, s.encode i ∈ A → i ≤ D) - (separate : ∀ B D : L, B ≤ D → ∃ g : G, g ∈ a.principalFix B ∧ - ∀ x : L, x ≤ D → x ≤ a.iso g D → x ≤ B) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) - (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) - (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : L) directed - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)), - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) → - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) → - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - intro act c F H generic zf allegedChoice - let dom := act.symmetricDomain c (M.nameDomain c) F - let N : TransitiveGround := ⟨dom.values {q | H.mem q}, dom.values_transitive {q | H.mem q}⟩ - have hRows := M.nonbottom_carrier_mem s separation hL - have hTwo := M.natSetCode_mem separation infinite 2 - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers - separation infinite (M.prod_mem pairing unions powers separation hRows hC) hTwo - have hRname : M.internalRowSetName s C hL ∈ dom.names := - ⟨M.internalRowSetName_mem s C pairing unions powers separation collection infinite hL hC, - M.internalRowSetName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed⟩ - have hR : Name.eval {q | H.mem q} (M.internalRowSetName s C hL) ∈ N.sets := - (dom.mem_values {q | H.mem q} _).2 ⟨_, hRname, rfl⟩ - have nPowers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 - obtain ⟨f, hf, selection⟩ := N.exists_function_choosing_subsets nPowers zf.2.1 allegedChoice hR - obtain ⟨fname, hfname, rfl⟩ := (dom.mem_values {q | H.mem q} f).1 hf - have hsF : HereditarilySymmetric act c F fname := hfname.2 - obtain ⟨B, fixedF⟩ := hsF.symmetric - let Sname := M.internalOutsideRowsName s C hL B - have hSname : Sname ∈ dom.names := - ⟨M.internalOutsideRowsName_mem s C pairing unions powers separation collection infinite hL hC order B, - M.internalOutsideRowsName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed B⟩ - have hS : Name.eval {q | H.mem q} Sname ∈ N.sets := - (dom.mem_values {q | H.mem q} _).2 ⟨Sname, hSname, rfl⟩ - obtain ⟨x, hx, chosen, unique⟩ := selection _ hS - (M.eval_internalOutsideRowsName_subset s C hL B H) - (M.eval_internalOutsideRowsName_nonempty s C hL B (unbounded B) H) - obtain ⟨i, outside, rowValue⟩ := (M.mem_eval_internalOutsideRowsName s C hL B H x).1 hx - let rowName := M.internalRowName s C hL i - have hRowName : rowName ∈ dom.names := - ⟨M.internalRowName_mem s C pairing unions powers separation collection infinite hL hC i, - M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i⟩ - let sn : dom.names := ⟨Sname, hSname⟩ - let xn : dom.names := ⟨rowName, hRowName⟩ - let fn : dom.names := ⟨fname, hfname⟩ - let env := extend sn (extend xn (extend fn Fin.elim0)) - have rowEq : Name.eval {q | H.mem q} rowName = x := - (M.eval_internalRowName s C hL i H).trans rowValue - have truth : Realize (dom.values {q | H.mem q}) - (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula (evalAssignment {q | H.mem q} env) := by - apply (realize_uniqueFiber_values dom {q | H.mem q} 0 1 2 env).2 - change Name.eval {q | H.mem q} rowName ∈ Name.eval {q | H.mem q} Sname ∧ - ZFSet.pair (Name.eval {q | H.mem q} Sname) (Name.eval {q | H.mem q} rowName) ∈ - Name.eval {q | H.mem q} fname ∧ - ∀ z ∈ Name.eval {q | H.mem q} Sname, - ZFSet.pair (Name.eval {q | H.mem q} Sname) z ∈ Name.eval {q | H.mem q} fname → - z = Name.eval {q | H.mem q} rowName - rw [rowEq] - exact ⟨hx, chosen, unique⟩ - obtain ⟨p, _, forced⟩ := (forcing_truth dom H generic - (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula env).1 truth - let used := rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) - obtain ⟨hUsed, usedSmall⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation - infinite groundChoice hRows hC hTwo (SetMembers.raw_mem p) - have usedSubset : used ⊆ s.carrier := by - intro z hz - exact ((s.mem_nonbottom_carrier z).1 (rowUsedRows_subset s.nonbottom.carrier C - (natSetCode 2) (SetMembers.raw p) hz)).1 - obtain ⟨D₀, bound₀⟩ := countableBound used hUsed usedSubset usedSmall - obtain ⟨D₁, first, containsB⟩ := directed D₀ B - obtain ⟨D, second, containsI⟩ := directed D₁ i.val - have bound : ∀ j : {j : L // j ≠ ⊥}, s.encode j.val ∈ used → j.val ≤ D := - fun j hj => le_trans (bound₀ j.val hj) (le_trans first second) - obtain ⟨g, fixed, overlap⟩ := separate B D (le_trans containsB second) - obtain ⟨r, _, rp, rgp⟩ := M.internalRowAction_common_extension_of_separated a s b C pairing unions - powers separation infinite hL hC hG graph groundChoice g B D fixed overlap p bound - obtain ⟨K, kr, groundGeneric, _, symmetricGeneric⟩ := - M.exists_joint_generic c act F small carrier r - have maps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation - collection carrier hG (M.internalRowActionGraph_mem a s b C pairing unions powers separation - infinite hL hC hG graph) - have groundClosed : ∀ g τ, τ ∈ (M.nameDomain c).names → act.act c g τ ∈ (M.nameDomain c).names := - M.act_mem c act b pairing unions powers separation collection carrier maps - have closed : ∀ g τ, τ ∈ dom.names → act.act c g τ ∈ dom.names := - fun g τ hτ => act.symmetricDomain_translated c (M.nameDomain c) F groundClosed g hτ - have equal := act.uniqueFiber_eq_of_fixed_names c dom closed g sn xn fn - (M.internalOutsideRowsName_action a s b C pairing unions powers separation infinite hL hC hG graph B g fixed) - (fixedF fixed) p forced K symmetricGeneric (K.upward kr rp) (K.upward kr rgp) - change Name.eval {q | K.mem q} (M.internalRowName s C hL i) = - Name.eval {q | K.mem q} (act.act c g (M.internalRowName s C hL i)) at equal - rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph, - M.eval_internalRowName, M.eval_internalRowName] at equal - have moved : a.iso g i.val ≠ i.val := a.moved_ne_of_separated g B D i.val overlap containsI outside - have distinct : s.encode i.val ≠ s.encode (a.iso g i.val) := - fun eq => moved (s.injective eq).symm - exact M.binaryGenericRow_ne pairing unions powers separation infinite groundChoice hRows hC - (s.nonbottom.encode_mem i) (s.nonbottom.encode_mem (a.nonbottom.iso g i)) distinct - uncountable K groundGeneric equal - -theorem exists_internalRow_ZF_not_choice - (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) - (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) - (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) - (countableBound : ∀ A ∈ M.sets, A ⊆ s.carrier → M.groundEmbeddable A ZFSet.omega → - ∃ D : L, ∀ i : L, s.encode i ∈ A → i ≤ D) - (separate : ∀ B D : L, B ≤ D → ∃ g : G, g ∈ a.principalFix B ∧ - ∀ x : L, x ≤ D → x ≤ a.iso g D → x ≤ B) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) - (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) - (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) - (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega) - let F := a.principalSupportFamily (⊥ : L) directed - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) - (natSetCode 2) ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) - SetFormula.choice Fin.elim0 := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - obtain ⟨H, hp, ground, ordinary, symmetric, includes, zf, _, _, _, _⟩ := - M.exists_internalRow_ZF_with_rowSet a s b C directed small pairing unions powers separation - collection infinite groundChoice hL hC hG order graph uncountable p - exact ⟨H, hp, ground, ordinary, symmetric, includes, zf, - M.internalRow_not_choice a s b C directed unbounded countableBound separate small pairing - unions powers separation collection infinite groundChoice hL hC hG order graph uncountable - H symmetric zf⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundInternalRowSetZF +import OAI.SetTheory.PartitionPrinciple.Definability.GroundOutsideRowCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSeparatedRowConditions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (N : TransitiveGround.{u}) + +theorem exists_function_choosing_subsets + (powers : Realize N.sets powerSet Fin.elim0) + (separation : SeparationSchema N.sets) + (choice : Realize N.sets SetFormula.choice Fin.elim0) + {R : ZFSet.{u}} (hR : R ∈ N.sets) : + ∃ f ∈ N.sets, ∀ S ∈ N.sets, S ⊆ R → S.Nonempty → + ∃ x ∈ S, ZFSet.pair S x ∈ f ∧ ∀ z ∈ S, ZFSet.pair S z ∈ f → z = x := by + obtain ⟨W, hW, subsets⟩ := N.power_witness powers hR + let A := ZFSet.sep (fun S => S.Nonempty) W + have hA : A ∈ N.sets := by + have selected := N.bounded_separation_mem separation (BoundedFormula.nonemptyFormula 0) + Fin.elim0 (fun i => Fin.elim0 i) hW + have eq : ZFSet.sep (fun S => BoundedFormula.Truth (BoundedFormula.nonemptyFormula 0) + (extend S Fin.elim0)) W = A := by + apply ZFSet.ext + intro S + simp only [A, ZFSet.mem_sep, BoundedFormula.truth_nonemptyFormula] + rfl + exact eq ▸ selected + obtain ⟨f, hf, code⟩ := N.choice_witness choice hA + (fun S hS => (ZFSet.mem_sep.1 hS).2) + refine ⟨f, hf, ?_⟩ + intro S hS subset nonempty + have member : S ∈ A := ZFSet.mem_sep.2 ⟨(subsets S hS).2 subset, nonempty⟩ + obtain ⟨x, chosen, unique⟩ := code.function.2 S member + exact ⟨x, code.chosen S x chosen, chosen, fun z _ hz => unique z hz⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [Group G] [PartialOrder L] [OrderBot L] + +theorem internalRow_not_choice + (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) + (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) + (countableBound : ∀ A ∈ M.sets, A ⊆ s.carrier → M.groundEmbeddable A ZFSet.omega → + ∃ D : L, ∀ i : L, s.encode i ∈ A → i ≤ D) + (separate : ∀ B D : L, B ≤ D → ∃ g : G, g ∈ a.principalFix B ∧ + ∀ x : L, x ≤ D → x ≤ a.iso g D → x ≤ B) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) + (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) + (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : L) directed + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)), + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) → + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) → + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + intro act c F H generic zf allegedChoice + let dom := act.symmetricDomain c (M.nameDomain c) F + let N : TransitiveGround := ⟨dom.values {q | H.mem q}, dom.values_transitive {q | H.mem q}⟩ + have hRows := M.nonbottom_carrier_mem s separation hL + have hTwo := M.natSetCode_mem separation infinite 2 + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem pairing unions powers + separation infinite (M.prod_mem pairing unions powers separation hRows hC) hTwo + have hRname : M.internalRowSetName s C hL ∈ dom.names := + ⟨M.internalRowSetName_mem s C pairing unions powers separation collection infinite hL hC, + M.internalRowSetName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed⟩ + have hR : Name.eval {q | H.mem q} (M.internalRowSetName s C hL) ∈ N.sets := + (dom.mem_values {q | H.mem q} _).2 ⟨_, hRname, rfl⟩ + have nPowers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 + obtain ⟨f, hf, selection⟩ := N.exists_function_choosing_subsets nPowers zf.2.1 allegedChoice hR + obtain ⟨fname, hfname, rfl⟩ := (dom.mem_values {q | H.mem q} f).1 hf + have hsF : HereditarilySymmetric act c F fname := hfname.2 + obtain ⟨B, fixedF⟩ := hsF.symmetric + let Sname := M.internalOutsideRowsName s C hL B + have hSname : Sname ∈ dom.names := + ⟨M.internalOutsideRowsName_mem s C pairing unions powers separation collection infinite hL hC order B, + M.internalOutsideRowsName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed B⟩ + have hS : Name.eval {q | H.mem q} Sname ∈ N.sets := + (dom.mem_values {q | H.mem q} _).2 ⟨Sname, hSname, rfl⟩ + obtain ⟨x, hx, chosen, unique⟩ := selection _ hS + (M.eval_internalOutsideRowsName_subset s C hL B H) + (M.eval_internalOutsideRowsName_nonempty s C hL B (unbounded B) H) + obtain ⟨i, outside, rowValue⟩ := (M.mem_eval_internalOutsideRowsName s C hL B H x).1 hx + let rowName := M.internalRowName s C hL i + have hRowName : rowName ∈ dom.names := + ⟨M.internalRowName_mem s C pairing unions powers separation collection infinite hL hC i, + M.internalRowName_hs a s b C pairing unions powers separation infinite hL hC hG graph directed i⟩ + let sn : dom.names := ⟨Sname, hSname⟩ + let xn : dom.names := ⟨rowName, hRowName⟩ + let fn : dom.names := ⟨fname, hfname⟩ + let env := extend sn (extend xn (extend fn Fin.elim0)) + have rowEq : Name.eval {q | H.mem q} rowName = x := + (M.eval_internalRowName s C hL i H).trans rowValue + have truth : Realize (dom.values {q | H.mem q}) + (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula (evalAssignment {q | H.mem q} env) := by + apply (realize_uniqueFiber_values dom {q | H.mem q} 0 1 2 env).2 + change Name.eval {q | H.mem q} rowName ∈ Name.eval {q | H.mem q} Sname ∧ + ZFSet.pair (Name.eval {q | H.mem q} Sname) (Name.eval {q | H.mem q} rowName) ∈ + Name.eval {q | H.mem q} fname ∧ + ∀ z ∈ Name.eval {q | H.mem q} Sname, + ZFSet.pair (Name.eval {q | H.mem q} Sname) z ∈ Name.eval {q | H.mem q} fname → + z = Name.eval {q | H.mem q} rowName + rw [rowEq] + exact ⟨hx, chosen, unique⟩ + obtain ⟨p, _, forced⟩ := (forcing_truth dom H generic + (BoundedFormula.uniqueFiberFormula 0 1 2).toFormula env).1 truth + let used := rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) + obtain ⟨hUsed, usedSmall⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation + infinite groundChoice hRows hC hTwo (SetMembers.raw_mem p) + have usedSubset : used ⊆ s.carrier := by + intro z hz + exact ((s.mem_nonbottom_carrier z).1 (rowUsedRows_subset s.nonbottom.carrier C + (natSetCode 2) (SetMembers.raw p) hz)).1 + obtain ⟨D₀, bound₀⟩ := countableBound used hUsed usedSubset usedSmall + obtain ⟨D₁, first, containsB⟩ := directed D₀ B + obtain ⟨D, second, containsI⟩ := directed D₁ i.val + have bound : ∀ j : {j : L // j ≠ ⊥}, s.encode j.val ∈ used → j.val ≤ D := + fun j hj => le_trans (bound₀ j.val hj) (le_trans first second) + obtain ⟨g, fixed, overlap⟩ := separate B D (le_trans containsB second) + obtain ⟨r, _, rp, rgp⟩ := M.internalRowAction_common_extension_of_separated a s b C pairing unions + powers separation infinite hL hC hG graph groundChoice g B D fixed overlap p bound + obtain ⟨K, kr, groundGeneric, _, symmetricGeneric⟩ := + M.exists_joint_generic c act F small carrier r + have maps := M.conditionMapFamily_mem_of_actionGraph act c b pairing unions powers separation + collection carrier hG (M.internalRowActionGraph_mem a s b C pairing unions powers separation + infinite hL hC hG graph) + have groundClosed : ∀ g τ, τ ∈ (M.nameDomain c).names → act.act c g τ ∈ (M.nameDomain c).names := + M.act_mem c act b pairing unions powers separation collection carrier maps + have closed : ∀ g τ, τ ∈ dom.names → act.act c g τ ∈ dom.names := + fun g τ hτ => act.symmetricDomain_translated c (M.nameDomain c) F groundClosed g hτ + have equal := act.uniqueFiber_eq_of_fixed_names c dom closed g sn xn fn + (M.internalOutsideRowsName_action a s b C pairing unions powers separation infinite hL hC hG graph B g fixed) + (fixedF fixed) p forced K symmetricGeneric (K.upward kr rp) (K.upward kr rgp) + change Name.eval {q | K.mem q} (M.internalRowName s C hL i) = + Name.eval {q | K.mem q} (act.act c g (M.internalRowName s C hL i)) at equal + rw [M.internalRowName_action a s b C pairing unions powers separation infinite hL hC hG graph, + M.eval_internalRowName, M.eval_internalRowName] at equal + have moved : a.iso g i.val ≠ i.val := a.moved_ne_of_separated g B D i.val overlap containsI outside + have distinct : s.encode i.val ≠ s.encode (a.iso g i.val) := + fun eq => moved (s.injective eq).symm + exact M.binaryGenericRow_ne pairing unions powers separation infinite groundChoice hRows hC + (s.nonbottom.encode_mem i) (s.nonbottom.encode_mem (a.nonbottom.iso g i)) distinct + uncountable K groundGeneric equal + +theorem exists_internalRow_ZF_not_choice + (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) + (directed : ∀ i j : L, ∃ k, i ≤ k ∧ j ≤ k) + (unbounded : ∀ B : L, ∃ i : L, ¬ i ≤ B) + (countableBound : ∀ A ∈ M.sets, A ⊆ s.carrier → M.groundEmbeddable A ZFSet.omega → + ∃ D : L, ∀ i : L, s.encode i ∈ A → i ≤ D) + (separate : ∀ B D : L, B ≤ D → ∃ g : G, g ∈ a.principalFix B ∧ + ∀ x : L, x ≤ D → x ≤ a.iso g D → x ≤ B) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (groundChoice : Realize M.sets SetFormula.choice Fin.elim0) + (hL : s.carrier ∈ M.sets) (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) + (order : s.conditionOrder ∈ M.sets) (graph : a.actionGraph s b ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable C ZFSet.omega) + (p : SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega) + let F := a.principalSupportFamily (⊥ : L) directed + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions (ZFSet.prod s.nonbottom.carrier C) + (natSetCode 2) ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ¬ Realize ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) + SetFormula.choice Fin.elim0 := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + obtain ⟨H, hp, ground, ordinary, symmetric, includes, zf, _, _, _, _⟩ := + M.exists_internalRow_ZF_with_rowSet a s b C directed small pairing unions powers separation + collection infinite groundChoice hL hC hG order graph uncountable p + exact ⟨H, hp, ground, ordinary, symmetric, includes, zf, + M.internalRow_not_choice a s b C directed unbounded countableBound separate small pairing + unions powers separation collection infinite groundChoice hL hC hG order graph uncountable + H symmetric zf⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalAssignmentLabelInjections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalAssignmentLabelInjections.lean index 5061b84af346564792febfb9e69ed04d4e6dc2da..014566cf1e6b5b45892f316f8797c2820348faa4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalAssignmentLabelInjections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalAssignmentLabelInjections.lean @@ -1,231 +1,231 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPersistentAssignmentLabels - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_successor_assignment_label_injection - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset - pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) - topMem topRows mono - ∀ (_successor : insert alpha alpha = stages) - (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → - ∀ (H : ConditionFilter (SetMembers upperSet)), H.GenericFor (formulaFamily (M.nameDomain upper)) → - let label := Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val - let J := Name.eval {p | H.mem p} label - let coarse := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val) - let fine := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rf.val) - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - InjectionCode coarse fine J ∧ - J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset - pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) - topMem topRows mono - intro successor V E U Rf Rc index H ordinary - have total := fulfilled.structural_successor_assignment_label_total collection infinite choice labels - small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace alpha member successor V E U Rf Rc index H ordinary - exact M.semanticStructuralAssignmentLabel_injection_package c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary total - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPersistentAssignmentLabels + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_successor_assignment_label_injection + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset + pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) + topMem topRows mono + ∀ (_successor : insert alpha alpha = stages) + (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → + ∀ (H : ConditionFilter (SetMembers upperSet)), H.GenericFor (formulaFamily (M.nameDomain upper)) → + let label := Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val + let J := Name.eval {p | H.mem p} label + let coarse := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val) + let fine := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rf.val) + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + InjectionCode coarse fine J ∧ + J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset + pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) + topMem topRows mono + intro successor V E U Rf Rc index H ordinary + have total := fulfilled.structural_successor_assignment_label_total collection infinite choice labels + small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace alpha member successor V E U Rf Rc index H ordinary + exact M.semanticStructuralAssignmentLabel_injection_package c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index H ordinary total + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalPartitionModel.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalPartitionModel.lean index 9a72f812ed9665fe2df37ad4c6eae5843f09331e..6297054a7a617fbd2d6f281a6f01de977c1dad00 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalPartitionModel.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalPartitionModel.lean @@ -1,826 +1,826 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainFinalGraphValueCandidateAvailability -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralSymmetricRefinementOutputs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPersistentAssignmentLabels -import OAI.SetTheory.PartitionPrinciple.Models.GroundMainFinalStructuralRowNonchoice -import OAI.SetTheory.PartitionPrinciple.Models.GroundRowCoverPartitionPrinciple -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExtensionOrdinals -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveOriginalRowFamilies - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] -variable (s : Presentation P) {G : Type v} [Group G] -variable (a : PosetAction G P) (F : Compression.RecursiveMaps.NormalSubgroupFamily G) - -theorem symmetricExtension_quotient_injections - (H : ConditionFilter P) (rowName : Name s) - (named : ∀ tau : Fin 3 → (M.nameDomain s).names, - (∀ i, HereditarilySymmetric a s F (tau i).val) → - RefinementValidityCode (Name.eval {p | H.mem p} rowName) - (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∃ J ∈ (M.symmetricExtension s a F H).sets, - InjectionCode - (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 2).val)) - (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val)) J) : - ∀ U ∈ (M.symmetricExtension s a F H).sets, - ∀ Rf ∈ (M.symmetricExtension s a F H).sets, - ∀ Rc ∈ (M.symmetricExtension s a F H).sets, - RefinementValidityCode (Name.eval {p | H.mem p} rowName) U Rf Rc → - (M.symmetricExtension s a F H).groundEmbeddable - (equivalenceClasses U Rc) (equivalenceClasses U Rf) := by - intro U hU Rf hRf Rc hRc validity - obtain ⟨u, hu, symmetricU, equalU⟩ := (M.mem_symmetricExtension s a F H U).1 hU - obtain ⟨fine, hFine, symmetricFine, equalFine⟩ := (M.mem_symmetricExtension s a F H Rf).1 hRf - obtain ⟨coarse, hCoarse, symmetricCoarse, equalCoarse⟩ := - (M.mem_symmetricExtension s a F H Rc).1 hRc - let tau : Fin 3 → (M.nameDomain s).names := ![⟨u, hu⟩, ⟨fine, hFine⟩, ⟨coarse, hCoarse⟩] - have symmetric : ∀ i, HereditarilySymmetric a s F (tau i).val := - Fin.cases symmetricU (Fin.cases symmetricFine (Fin.cases symmetricCoarse (fun i => Fin.elim0 i))) - have actual : RefinementValidityCode (Name.eval {p | H.mem p} rowName) - (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) := by - change RefinementValidityCode (Name.eval {p | H.mem p} rowName) - (Name.eval {p | H.mem p} u) (Name.eval {p | H.mem p} fine) (Name.eval {p | H.mem p} coarse) - rwa [equalU, equalFine, equalCoarse] - obtain ⟨J, hJ, injection⟩ := named tau symmetric actual - refine ⟨J, hJ, ?_⟩ - change InjectionCode - (equivalenceClasses (Name.eval {p | H.mem p} u) (Name.eval {p | H.mem p} coarse)) - (equivalenceClasses (Name.eval {p | H.mem p} u) (Name.eval {p | H.mem p} fine)) J at injection - rwa [equalU, equalFine, equalCoarse] at injection - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_ordinal_choice - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - ∀ H : ConditionFilter (SetMembers upperQ), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - let N := M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H - ZFRealization N.sets → - ∀ delta ∈ N.sets, ordinalSetProperty delta → - ∀ z ∈ N.sets, FunctionGraphOn delta z → - (∀ beta A, ZFSet.pair beta A ∈ z → A.Nonempty) → - ∃ f ∈ N.sets, FunctionGraphOn delta f ∧ - ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ f → x ∈ A := by - intro geometry - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - intro s b a directed hL hG hC order graph nodeMaps supports - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 - closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace - coordinates two carrier forcingOrder forcingAction omega topMem topRows packed upperQ - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - intro historyRun - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - intro upperAct upper H ordinary N zf delta hDelta ordinal z hz function nonempty - have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers - separation carrier hLifted hs hPacked omega - have groundDelta : delta ∈ M.sets := M.symmetricExtension_ordinal_mem - pairing unions powers separation collection upper upperAct - (a.principalSupportFamily ⊥ directed) H hDelta ordinal - obtain ⟨zName, groundZ, symmetric, same⟩ := - (M.mem_symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H z).1 hz - obtain ⟨V, fixedZ⟩ := symmetric.symmetric - obtain ⟨E, strict⟩ := fulfilled.toFinalFulfillment.decoded_strict_growth V - let original : (M.nameDomain upper).names := ⟨zName, groundZ⟩ - have candidates := fulfilled.structural_graphValue_candidate_availability - collection infinite choice labels small smallD irreflexive columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace original V E strict symmetric fixedZ - let W := M.graphValueCandidateCodes upperAct upper (a.principalFix E) zName - have groundW : W ∈ M.sets := candidates.1 - have validW : ∀ x ∈ W, IsName upper x := candidates.2.1 - have fixed : ∀ psi : Name upper, psi.val ∈ W → - a.principalFix E ≤ upperAct.stabilizer upper psi := fun psi member => - (candidates.2.2.1 psi member).1 - have children : ∀ psi : Name upper, psi.val ∈ W → - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) psi := - fun psi member => (candidates.2.2.1 psi member).2 - apply M.supportedNameFamily_graph_choice upper upperAct (a.principalSupportFamily ⊥ directed) - pairing unions powers separation collection choice hQ groundW validW - (a.principalFix E) ⟨E, le_rfl⟩ fixed children H zf hDelta hz function - intro beta member - have groundBeta : beta ∈ M.sets := M.transitive groundDelta member - obtain ⟨A, edge⟩ := function.total member - have edgeOriginal : ZFSet.pair beta A ∈ Name.eval {p | H.mem p} original.val := by - rw [show Name.eval {p | H.mem p} original.val = z from same] - exact edge - obtain ⟨psi, candidate, B, betaB, chosen⟩ := candidates.2.2.2 beta groundBeta H ordinary - ⟨A, edgeOriginal, nonempty beta A edge⟩ - exact ⟨psi, candidate, B, same ▸ betaB, chosen⟩ - - - - - - -theorem structural_refinement_quotient_injection - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history) - (_standard : GroundStandardInaccessible M stages) - (_smallRows : GroundBelow M c.carrier stages) (_smallLifted : GroundBelow M lifted stages), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers stagesOrdinal carrier lifted valid1 - ∀ (H : ConditionFilter (SetMembers upperSet)), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - (∀ (beta : ZFSet.{u}) (member : beta ∈ stages), - let hBeta := M.transitive hs member - let betaOrdinal := ordinalSetProperty_member stagesOrdinal member - let betaSubset := (And.left stagesOrdinal) beta member - let lowerPacked := graphRestriction beta packed - let lowerSet := M.refinementHistoryForcing c.carrier lifted beta lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta lowerPacked - (historyRun.carriers.restrict betaOrdinal betaSubset) betaOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation lowerSet - let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace beta hBeta betaOrdinal betaSubset infinite choice - (projection.projectedFilter H).GenericFor (M.codedFamily lower) ∧ - (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower))) → - ∀ tau : Fin 3 → (M.nameDomain upper).names, - (∀ i, HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) (tau i).val) → - RefinementValidityCode - (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) - (Name.eval {p | H.mem p} (tau 2).val) → - ∃ J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets, - InjectionCode - (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 2).val)) - (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) - (Name.eval {p | H.mem p} (tau 1).val)) J := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace standard smallRows smallLifted - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers stagesOrdinal carrier lifted valid1 - intro H ordinary lowerGeneric tau symmetric originalValid - have indexed := M.semanticStructuralTrace_refinementOutputs c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh standard trace infinite choice smallRows smallLifted small rfl - fulfilled.toFinalFulfillment.decoded_strict_growth tau symmetric - obtain ⟨beta, member, data⟩ := indexed - let hBeta := M.transitive hs member - let betaOrdinal := ordinalSetProperty_member stagesOrdinal member - let betaSubset := (And.left stagesOrdinal) beta member - let lowerPacked := graphRestriction beta packed - let lowerSet := M.refinementHistoryForcing c.carrier lifted beta lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta lowerPacked - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta lowerPacked - (historyRun.carriers.restrict betaOrdinal betaSubset) betaOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation lowerSet - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict betaOrdinal betaSubset) betaOrdinal carrier lifted valid1 - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal betaOrdinal betaSubset - pairing unions powers separation infinite choice hs hPacked hLifted hBeta carrier (c.encode ⊤) topMem topRows mono - dsimp only at data - obtain ⟨_env, _names, _last, normalized, _entries, _normalizedLast, _forced, _supported, - V, E, _baseV, _strict, _fixes, index, _stored, _attained, _fineGround, _coarseGround, _mapGround, values⟩ := data - have outputValues := values H ordinary (lowerGeneric beta member).1 (lowerGeneric beta member).2 originalValid - obtain ⟨_same, _objects, fineValues, coarseValues, _naturalMap⟩ := outputValues - have injection := fulfilled.structural_assignment_label_injection collection infinite choice labels small smallD - irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace beta member V E (normalized 0) (normalized 1) (normalized 2) - index H ordinary - have fineEq : Name.eval {q | H.mem (inc q)} - (Name.refinementQuotient lifted localValid (normalized 0).val (normalized 1).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) := - fineValues - have coarseEq : Name.eval {q | H.mem (inc q)} - (Name.refinementQuotient lifted localValid (normalized 0).val (normalized 2).val) = - equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 2).val) := - coarseValues - refine ⟨_, injection.2, ?_⟩ - rw [← coarseEq, ← fineEq] - exact injection.1 - - - - - - -theorem exists_rowSemanticQuotientInjectionModel - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (historyRun).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (historyRun).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - historyRun.carriers standard.1.1 carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers - standard.1.1 carrier lifted valid1 - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) ∧ - (∀ tau : Fin 3 → (M.nameDomain upperPres).names, - (∀ i, HereditarilySymmetric upperAction upperPres F (tau i).val) → - RefinementValidityCode - (Name.eval {q | H.mem q} (Name.familySet ⊤ lifted validUpper)) - (Name.eval {q | H.mem q} (tau 0).val) (Name.eval {q | H.mem q} (tau 1).val) - (Name.eval {q | H.mem q} (tau 2).val) → - ∃ J ∈ (M.symmetricExtension upperPres upperAction F H).sets, - InjectionCode - (equivalenceClasses (Name.eval {q | H.mem q} (tau 0).val) - (Name.eval {q | H.mem q} (tau 2).val)) - (equivalenceClasses (Name.eval {q | H.mem q} (tau 0).val) - (Name.eval {q | H.mem q} (tau 1).val)) J) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have original := fulfilled.toFinalFulfillment.exists_rowSemanticStructuralSequenceReflection - collection infinite choice small hK standard indices - obtain ⟨mu, hmu, hmuK, cardinal, omegaIncluded, positions, ground, below, valid, data⟩ := original - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - _hGraph, _injection, history, hHistory, trace, _hPacked0, _historyRun0, _witnesses0, - _P, _order0, _top0, _action0, _code0, _fields0, _witness0, final⟩ := data - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omegaIncluded, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - history, hHistory, trace, ?_⟩ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (historyRun).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (historyRun).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - historyRun.carriers standard.1.1 carrier (c.encode ⊤) topMem topRows - let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers - standard.1.1 carrier lifted valid1 - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := - (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - obtain ⟨_carrierEq, chosen⟩ := final - intro p - obtain ⟨H, hp, coded, ordinary, symmetricGeneric, projectedGeneric, includes, zf, reflection⟩ := chosen p - refine ⟨H, hp, coded, ordinary, symmetricGeneric, projectedGeneric, includes, zf, reflection, ?_⟩ - intro tau symmetric validity - apply fulfilled.structural_refinement_quotient_injection collection infinite choice labels small smallD - irreflexive columns hColumns hmu cardinal.1 valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 K history hK hHistory standard.1.1 trace standard rowSize liftedSize H ordinary - _ tau symmetric validity - intro beta member - exact projectedGeneric ⟨beta, M.transitive hK member, - ordinalSetProperty_member standard.1.1 member, (And.left standard.1.1) beta member⟩ - - - - - - -include fulfilled - -theorem exists_partitionPrinciple_not_choice - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : - ∃ N : TransitiveGround.{u}, M.sets ⊆ N.sets ∧ ZFRealization N.sets ∧ - (∀ X ∈ N.sets, ∀ Y ∈ N.sets, ∀ f ∈ N.sets, ZFSet.IsFunc X Y f → - (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → N.groundEmbeddable Y X) ∧ - ¬ Realize N.sets SetFormula.choice Fin.elim0 := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - have original := fulfilled.exists_rowSemanticQuotientInjectionModel - collection infinite choice small hK standard indices labels smallD irreflexive - obtain ⟨mu, hmu, _hmuK, cardinal, _omegaIncluded, positions, _ground, _below, valid, data⟩ := original - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - history, hHistory, trace, chosen⟩ := data - have topMem := c.encode_mem ⊤ - have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed - historyRun.carriers standard.1.1 carrier (c.encode ⊤) topMem topRows - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction geometry.actors_ground - geometry.carrier_ground nodeOrderGround nodeActionGround nodeMaps supports hLifted hSquared omega - valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let upper := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers - standard.1.1 carrier lifted valid1 - let rowName := Name.familySet (⊤ : SetMembers Q) lifted validUpper - obtain ⟨H, _atTop, _coded, ordinary, _symmetricGeneric, _projectedGeneric, - includes, zf, _reflection, named⟩ := chosen (⊤ : SetMembers Q) - let N := M.symmetricExtension upper upperAction F H - have quotientInjection := M.symmetricExtension_quotient_injections upper upperAction F H rowName named - have uncountable : ¬ M.groundEmbeddable columns ZFSet.omega := - (M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.2.2 - have covers := M.semanticBinaryRow_ordinal_partial_cover a s b columns - pairing unions powers separation collection infinite choice geometry.carrier_ground - nodeOrderGround hColumns geometry.actors_ground nodeActionGround nodeMaps supports directed - uncountable mu hmu cardinal.1 positions lifted squared hLifted hSquared valid1 valid2 - closed1 closed2 children1 children2 K history hK hHistory standard.1.1 trace - obtain ⟨validRows, directValid, covers⟩ := covers - let directRowName : Name upper := Name.familySet (⊤ : SetMembers Q) - (Name.renamedFamily upper - (M.refinementHistoryRowInclusion c historyRun.carriers standard.1.1 carrier) T validRows) directValid - have actualCover : - let Trow := Name.eval {p | H.mem p} directRowName - Trow ∈ N.sets ∧ - ∀ X ∈ N.sets, ∃ delta ∈ N.sets, ordinalSetProperty delta ∧ - ∃ h ∈ N.sets, FunctionGraphOn delta h ∧ - (∀ i hi, ZFSet.pair i hi ∈ h → PartialFunctionCode Trow (⋃₀ ⋃₀ hi) hi) ∧ - ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ - ∃ u ∈ Trow, ZFSet.pair u x ∈ hi := covers H ordinary - have sameRows : directRowName = rowName := - M.refinementHistory_originalRowFamilySet_eq c historyRun.carriers - standard.1.1 carrier (⊤ : SetMembers Q) T validRows directValid validUpper - rw [sameRows] at actualCover - have acwo := fulfilled.structural_ordinal_choice collection infinite choice labels small smallD - irreflexive columns hColumns hmu cardinal.1 valid hLifted hSquared valid1 valid2 closed1 - closed2 children1 children2 K history hK hHistory standard.1.1 trace H ordinary zf - have notChoice := fulfilled.structural_lifted_rows_not_wellorderable_not_choice - collection infinite choice small smallD irreflexive columns hColumns uncountable hmu - cardinal.1 valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - K history hK hHistory standard.1.1 trace H ordinary zf - exact ⟨N, includes, zf, - N.partitionPrinciple_of_rowCover_quotients zf actualCover.1 acwo actualCover.2 quotientInjection, - notChoice.2.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainFinalGraphValueCandidateAvailability +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralSymmetricRefinementOutputs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPersistentAssignmentLabels +import OAI.SetTheory.PartitionPrinciple.Models.GroundMainFinalStructuralRowNonchoice +import OAI.SetTheory.PartitionPrinciple.Models.GroundRowCoverPartitionPrinciple +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExtensionOrdinals +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveOriginalRowFamilies + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] +variable (s : Presentation P) {G : Type v} [Group G] +variable (a : PosetAction G P) (F : Compression.RecursiveMaps.NormalSubgroupFamily G) + +theorem symmetricExtension_quotient_injections + (H : ConditionFilter P) (rowName : Name s) + (named : ∀ tau : Fin 3 → (M.nameDomain s).names, + (∀ i, HereditarilySymmetric a s F (tau i).val) → + RefinementValidityCode (Name.eval {p | H.mem p} rowName) + (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∃ J ∈ (M.symmetricExtension s a F H).sets, + InjectionCode + (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 2).val)) + (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val)) J) : + ∀ U ∈ (M.symmetricExtension s a F H).sets, + ∀ Rf ∈ (M.symmetricExtension s a F H).sets, + ∀ Rc ∈ (M.symmetricExtension s a F H).sets, + RefinementValidityCode (Name.eval {p | H.mem p} rowName) U Rf Rc → + (M.symmetricExtension s a F H).groundEmbeddable + (equivalenceClasses U Rc) (equivalenceClasses U Rf) := by + intro U hU Rf hRf Rc hRc validity + obtain ⟨u, hu, symmetricU, equalU⟩ := (M.mem_symmetricExtension s a F H U).1 hU + obtain ⟨fine, hFine, symmetricFine, equalFine⟩ := (M.mem_symmetricExtension s a F H Rf).1 hRf + obtain ⟨coarse, hCoarse, symmetricCoarse, equalCoarse⟩ := + (M.mem_symmetricExtension s a F H Rc).1 hRc + let tau : Fin 3 → (M.nameDomain s).names := ![⟨u, hu⟩, ⟨fine, hFine⟩, ⟨coarse, hCoarse⟩] + have symmetric : ∀ i, HereditarilySymmetric a s F (tau i).val := + Fin.cases symmetricU (Fin.cases symmetricFine (Fin.cases symmetricCoarse (fun i => Fin.elim0 i))) + have actual : RefinementValidityCode (Name.eval {p | H.mem p} rowName) + (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) := by + change RefinementValidityCode (Name.eval {p | H.mem p} rowName) + (Name.eval {p | H.mem p} u) (Name.eval {p | H.mem p} fine) (Name.eval {p | H.mem p} coarse) + rwa [equalU, equalFine, equalCoarse] + obtain ⟨J, hJ, injection⟩ := named tau symmetric actual + refine ⟨J, hJ, ?_⟩ + change InjectionCode + (equivalenceClasses (Name.eval {p | H.mem p} u) (Name.eval {p | H.mem p} coarse)) + (equivalenceClasses (Name.eval {p | H.mem p} u) (Name.eval {p | H.mem p} fine)) J at injection + rwa [equalU, equalFine, equalCoarse] at injection + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_ordinal_choice + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + ∀ H : ConditionFilter (SetMembers upperQ), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + let N := M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H + ZFRealization N.sets → + ∀ delta ∈ N.sets, ordinalSetProperty delta → + ∀ z ∈ N.sets, FunctionGraphOn delta z → + (∀ beta A, ZFSet.pair beta A ∈ z → A.Nonempty) → + ∃ f ∈ N.sets, FunctionGraphOn delta f ∧ + ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ f → x ∈ A := by + intro geometry + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + intro s b a directed hL hG hC order graph nodeMaps supports + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 + closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace + coordinates two carrier forcingOrder forcingAction omega topMem topRows packed upperQ + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + intro historyRun + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + intro upperAct upper H ordinary N zf delta hDelta ordinal z hz function nonempty + have hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + have hQ : upper.carrier ∈ M.sets := M.refinementHistoryForcing_mem pairing unions powers + separation carrier hLifted hs hPacked omega + have groundDelta : delta ∈ M.sets := M.symmetricExtension_ordinal_mem + pairing unions powers separation collection upper upperAct + (a.principalSupportFamily ⊥ directed) H hDelta ordinal + obtain ⟨zName, groundZ, symmetric, same⟩ := + (M.mem_symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H z).1 hz + obtain ⟨V, fixedZ⟩ := symmetric.symmetric + obtain ⟨E, strict⟩ := fulfilled.toFinalFulfillment.decoded_strict_growth V + let original : (M.nameDomain upper).names := ⟨zName, groundZ⟩ + have candidates := fulfilled.structural_graphValue_candidate_availability + collection infinite choice labels small smallD irreflexive columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace original V E strict symmetric fixedZ + let W := M.graphValueCandidateCodes upperAct upper (a.principalFix E) zName + have groundW : W ∈ M.sets := candidates.1 + have validW : ∀ x ∈ W, IsName upper x := candidates.2.1 + have fixed : ∀ psi : Name upper, psi.val ∈ W → + a.principalFix E ≤ upperAct.stabilizer upper psi := fun psi member => + (candidates.2.2.1 psi member).1 + have children : ∀ psi : Name upper, psi.val ∈ W → + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) psi := + fun psi member => (candidates.2.2.1 psi member).2 + apply M.supportedNameFamily_graph_choice upper upperAct (a.principalSupportFamily ⊥ directed) + pairing unions powers separation collection choice hQ groundW validW + (a.principalFix E) ⟨E, le_rfl⟩ fixed children H zf hDelta hz function + intro beta member + have groundBeta : beta ∈ M.sets := M.transitive groundDelta member + obtain ⟨A, edge⟩ := function.total member + have edgeOriginal : ZFSet.pair beta A ∈ Name.eval {p | H.mem p} original.val := by + rw [show Name.eval {p | H.mem p} original.val = z from same] + exact edge + obtain ⟨psi, candidate, B, betaB, chosen⟩ := candidates.2.2.2 beta groundBeta H ordinary + ⟨A, edgeOriginal, nonempty beta A edge⟩ + exact ⟨psi, candidate, B, same ▸ betaB, chosen⟩ + + + + + + +theorem structural_refinement_quotient_injection + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history) + (_standard : GroundStandardInaccessible M stages) + (_smallRows : GroundBelow M c.carrier stages) (_smallLifted : GroundBelow M lifted stages), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers stagesOrdinal carrier lifted valid1 + ∀ (H : ConditionFilter (SetMembers upperSet)), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + (∀ (beta : ZFSet.{u}) (member : beta ∈ stages), + let hBeta := M.transitive hs member + let betaOrdinal := ordinalSetProperty_member stagesOrdinal member + let betaSubset := (And.left stagesOrdinal) beta member + let lowerPacked := graphRestriction beta packed + let lowerSet := M.refinementHistoryForcing c.carrier lifted beta lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta lowerPacked + (historyRun.carriers.restrict betaOrdinal betaSubset) betaOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation lowerSet + let projection := M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace beta hBeta betaOrdinal betaSubset infinite choice + (projection.projectedFilter H).GenericFor (M.codedFamily lower) ∧ + (projection.projectedFilter H).GenericFor (formulaFamily (M.nameDomain lower))) → + ∀ tau : Fin 3 → (M.nameDomain upper).names, + (∀ i, HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) (tau i).val) → + RefinementValidityCode + (Name.eval {p | H.mem p} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) + (Name.eval {p | H.mem p} (tau 2).val) → + ∃ J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets, + InjectionCode + (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 2).val)) + (equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) + (Name.eval {p | H.mem p} (tau 1).val)) J := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace standard smallRows smallLifted + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers stagesOrdinal carrier lifted valid1 + intro H ordinary lowerGeneric tau symmetric originalValid + have indexed := M.semanticStructuralTrace_refinementOutputs c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh standard trace infinite choice smallRows smallLifted small rfl + fulfilled.toFinalFulfillment.decoded_strict_growth tau symmetric + obtain ⟨beta, member, data⟩ := indexed + let hBeta := M.transitive hs member + let betaOrdinal := ordinalSetProperty_member stagesOrdinal member + let betaSubset := (And.left stagesOrdinal) beta member + let lowerPacked := graphRestriction beta packed + let lowerSet := M.refinementHistoryForcing c.carrier lifted beta lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted beta lowerPacked + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted beta lowerPacked + (historyRun.carriers.restrict betaOrdinal betaSubset) betaOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation lowerSet + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict betaOrdinal betaSubset) betaOrdinal carrier lifted valid1 + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal betaOrdinal betaSubset + pairing unions powers separation infinite choice hs hPacked hLifted hBeta carrier (c.encode ⊤) topMem topRows mono + dsimp only at data + obtain ⟨_env, _names, _last, normalized, _entries, _normalizedLast, _forced, _supported, + V, E, _baseV, _strict, _fixes, index, _stored, _attained, _fineGround, _coarseGround, _mapGround, values⟩ := data + have outputValues := values H ordinary (lowerGeneric beta member).1 (lowerGeneric beta member).2 originalValid + obtain ⟨_same, _objects, fineValues, coarseValues, _naturalMap⟩ := outputValues + have injection := fulfilled.structural_assignment_label_injection collection infinite choice labels small smallD + irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace beta member V E (normalized 0) (normalized 1) (normalized 2) + index H ordinary + have fineEq : Name.eval {q | H.mem (inc q)} + (Name.refinementQuotient lifted localValid (normalized 0).val (normalized 1).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 1).val) := + fineValues + have coarseEq : Name.eval {q | H.mem (inc q)} + (Name.refinementQuotient lifted localValid (normalized 0).val (normalized 2).val) = + equivalenceClasses (Name.eval {p | H.mem p} (tau 0).val) (Name.eval {p | H.mem p} (tau 2).val) := + coarseValues + refine ⟨_, injection.2, ?_⟩ + rw [← coarseEq, ← fineEq] + exact injection.1 + + + + + + +theorem exists_rowSemanticQuotientInjectionModel + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (historyRun).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (historyRun).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + historyRun.carriers standard.1.1 carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers + standard.1.1 carrier lifted valid1 + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) ∧ + (∀ tau : Fin 3 → (M.nameDomain upperPres).names, + (∀ i, HereditarilySymmetric upperAction upperPres F (tau i).val) → + RefinementValidityCode + (Name.eval {q | H.mem q} (Name.familySet ⊤ lifted validUpper)) + (Name.eval {q | H.mem q} (tau 0).val) (Name.eval {q | H.mem q} (tau 1).val) + (Name.eval {q | H.mem q} (tau 2).val) → + ∃ J ∈ (M.symmetricExtension upperPres upperAction F H).sets, + InjectionCode + (equivalenceClasses (Name.eval {q | H.mem q} (tau 0).val) + (Name.eval {q | H.mem q} (tau 2).val)) + (equivalenceClasses (Name.eval {q | H.mem q} (tau 0).val) + (Name.eval {q | H.mem q} (tau 1).val)) J) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have original := fulfilled.toFinalFulfillment.exists_rowSemanticStructuralSequenceReflection + collection infinite choice small hK standard indices + obtain ⟨mu, hmu, hmuK, cardinal, omegaIncluded, positions, ground, below, valid, data⟩ := original + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + _hGraph, _injection, history, hHistory, trace, _hPacked0, _historyRun0, _witnesses0, + _P, _order0, _top0, _action0, _code0, _fields0, _witness0, final⟩ := data + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omegaIncluded, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + history, hHistory, trace, ?_⟩ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (historyRun).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (historyRun).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + historyRun.carriers standard.1.1 carrier (c.encode ⊤) topMem topRows + let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers + standard.1.1 carrier lifted valid1 + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := + (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + obtain ⟨_carrierEq, chosen⟩ := final + intro p + obtain ⟨H, hp, coded, ordinary, symmetricGeneric, projectedGeneric, includes, zf, reflection⟩ := chosen p + refine ⟨H, hp, coded, ordinary, symmetricGeneric, projectedGeneric, includes, zf, reflection, ?_⟩ + intro tau symmetric validity + apply fulfilled.structural_refinement_quotient_injection collection infinite choice labels small smallD + irreflexive columns hColumns hmu cardinal.1 valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 K history hK hHistory standard.1.1 trace standard rowSize liftedSize H ordinary + _ tau symmetric validity + intro beta member + exact projectedGeneric ⟨beta, M.transitive hK member, + ordinalSetProperty_member standard.1.1 member, (And.left standard.1.1) beta member⟩ + + + + + + +include fulfilled + +theorem exists_partitionPrinciple_not_choice + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) : + ∃ N : TransitiveGround.{u}, M.sets ⊆ N.sets ∧ ZFRealization N.sets ∧ + (∀ X ∈ N.sets, ∀ Y ∈ N.sets, ∀ f ∈ N.sets, ZFSet.IsFunc X Y f → + (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → N.groundEmbeddable Y X) ∧ + ¬ Realize N.sets SetFormula.choice Fin.elim0 := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + have original := fulfilled.exists_rowSemanticQuotientInjectionModel + collection infinite choice small hK standard indices labels smallD irreflexive + obtain ⟨mu, hmu, _hmuK, cardinal, _omegaIncluded, positions, _ground, _below, valid, data⟩ := original + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + history, hHistory, trace, chosen⟩ := data + have topMem := c.encode_mem ⊤ + have topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted K packed + historyRun.carriers standard.1.1 carrier (c.encode ⊤) topMem topRows + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction geometry.actors_ground + geometry.carrier_ground nodeOrderGround nodeActionGround nodeMaps supports hLifted hSquared omega + valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let upper := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + let validUpper := M.refinementHistoryRowNameFamily_valid c historyRun.carriers + standard.1.1 carrier lifted valid1 + let rowName := Name.familySet (⊤ : SetMembers Q) lifted validUpper + obtain ⟨H, _atTop, _coded, ordinary, _symmetricGeneric, _projectedGeneric, + includes, zf, _reflection, named⟩ := chosen (⊤ : SetMembers Q) + let N := M.symmetricExtension upper upperAction F H + have quotientInjection := M.symmetricExtension_quotient_injections upper upperAction F H rowName named + have uncountable : ¬ M.groundEmbeddable columns ZFSet.omega := + (M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.2.2 + have covers := M.semanticBinaryRow_ordinal_partial_cover a s b columns + pairing unions powers separation collection infinite choice geometry.carrier_ground + nodeOrderGround hColumns geometry.actors_ground nodeActionGround nodeMaps supports directed + uncountable mu hmu cardinal.1 positions lifted squared hLifted hSquared valid1 valid2 + closed1 closed2 children1 children2 K history hK hHistory standard.1.1 trace + obtain ⟨validRows, directValid, covers⟩ := covers + let directRowName : Name upper := Name.familySet (⊤ : SetMembers Q) + (Name.renamedFamily upper + (M.refinementHistoryRowInclusion c historyRun.carriers standard.1.1 carrier) T validRows) directValid + have actualCover : + let Trow := Name.eval {p | H.mem p} directRowName + Trow ∈ N.sets ∧ + ∀ X ∈ N.sets, ∃ delta ∈ N.sets, ordinalSetProperty delta ∧ + ∃ h ∈ N.sets, FunctionGraphOn delta h ∧ + (∀ i hi, ZFSet.pair i hi ∈ h → PartialFunctionCode Trow (⋃₀ ⋃₀ hi) hi) ∧ + ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ + ∃ u ∈ Trow, ZFSet.pair u x ∈ hi := covers H ordinary + have sameRows : directRowName = rowName := + M.refinementHistory_originalRowFamilySet_eq c historyRun.carriers + standard.1.1 carrier (⊤ : SetMembers Q) T validRows directValid validUpper + rw [sameRows] at actualCover + have acwo := fulfilled.structural_ordinal_choice collection infinite choice labels small smallD + irreflexive columns hColumns hmu cardinal.1 valid hLifted hSquared valid1 valid2 closed1 + closed2 children1 children2 K history hK hHistory standard.1.1 trace H ordinary zf + have notChoice := fulfilled.structural_lifted_rows_not_wellorderable_not_choice + collection infinite choice small smallD irreflexive columns hColumns uncountable hmu + cardinal.1 valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + K history hK hHistory standard.1.1 trace H ordinary zf + exact ⟨N, includes, zf, + N.partitionPrinciple_of_rowCover_quotients zf actualCover.1 acwo actualCover.2 quotientInjection, + notChoice.2.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalStructuralRowNonchoice.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalStructuralRowNonchoice.lean index dacdbd0bd514f1a96894ddc04afffd0c94d27ffd..6f57623ccdaeea3cc7479c7e9cf2ea2e7a278c7c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalStructuralRowNonchoice.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundMainFinalStructuralRowNonchoice.lean @@ -1,175 +1,175 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInternalNoChooserConsequences -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralRowNoChooser - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_lifted_rows_not_wellorderable_not_choice - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - (uncountable : ¬ M.groundEmbeddable columns ZFSet.omega) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier - ∀ (H : ConditionFilter (SetMembers upperQ)), - H.GenericFor (formulaFamily (M.nameDomain upper)) → - let N := M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H - let rowSet := Name.eval {p | H.mem p} - (Name.rename upper inclusion (M.internalRowSetName s columns hL)) - ZFRealization N.sets → - rowSet ∈ N.sets ∧ - (¬ ∃ index ∈ N.sets, ordinalSetProperty index ∧ - ∃ enumeration ∈ N.sets, ZFSet.IsFunc index rowSet enumeration ∧ - ∀ x ∈ rowSet, ∃ i ∈ index, ZFSet.pair i x ∈ enumeration) ∧ - ¬ Realize N.sets SetFormula.choice Fin.elim0 := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let upper := SetMembers.presentation upperQ - let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier - intro H ordinary zf - have noChooser := fulfilled.structural_lifted_rows_no_chooser collection infinite choice small - smallD irreflexive columns hColumns uncountable hmu muOrdinal valid hLifted hSquared - valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace H ordinary - exact ⟨noChooser.1, - TransitiveGround.noChooser_no_ordinal_surjection_not_choice - (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H) - zf noChooser.1 noChooser.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInternalNoChooserConsequences +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralRowNoChooser + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_lifted_rows_not_wellorderable_not_choice + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + (uncountable : ¬ M.groundEmbeddable columns ZFSet.omega) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier + ∀ (H : ConditionFilter (SetMembers upperQ)), + H.GenericFor (formulaFamily (M.nameDomain upper)) → + let N := M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H + let rowSet := Name.eval {p | H.mem p} + (Name.rename upper inclusion (M.internalRowSetName s columns hL)) + ZFRealization N.sets → + rowSet ∈ N.sets ∧ + (¬ ∃ index ∈ N.sets, ordinalSetProperty index ∧ + ∃ enumeration ∈ N.sets, ZFSet.IsFunc index rowSet enumeration ∧ + ∀ x ∈ rowSet, ∃ i ∈ index, ZFSet.pair i x ∈ enumeration) ∧ + ¬ Realize N.sets SetFormula.choice Fin.elim0 := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + let upperQ := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let upper := SetMembers.presentation upperQ + let recursive := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let inclusion := M.refinementHistoryRowEmbedding c lifted stages packed recursive stagesOrdinal carrier + intro H ordinary zf + have noChooser := fulfilled.structural_lifted_rows_no_chooser collection infinite choice small + smallD irreflexive columns hColumns uncountable hmu muOrdinal valid hLifted hSquared + valid1 valid2 closed1 closed2 children1 children2 stages history hs hh stagesOrdinal trace H ordinary + exact ⟨noChooser.1, + TransitiveGround.noChooser_no_ordinal_surjection_not_choice + (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H) + zf noChooser.1 noChooser.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundNameSupportEnumerationChoices.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundNameSupportEnumerationChoices.lean index 64c2ff686612b4556e22d2b28626f84710c12668..0e76a1820b0d33f140d54205d33985659dc23455 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundNameSupportEnumerationChoices.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundNameSupportEnumerationChoices.lean @@ -1,85 +1,85 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalEnumerationFamilies - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [PartialOrder L] [OrderBot L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -theorem exists_groundSupportEnumerationChoices - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) - (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (W : ZFSet.{u}) (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) - (symmetric : ∀ tau : Name s, tau.val ∈ W → - HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) tau) : - ∃ supportChoice ∈ M.sets, ∃ B ∈ M.sets, ∃ enumerationChoice ∈ M.sets, - ZFSet.IsFunc W b.carrier supportChoice ∧ ZFSet.IsFunc b.carrier B enumerationChoice ∧ - let selected := relationCompose W b.carrier B supportChoice enumerationChoice - selected ∈ M.sets ∧ ZFSet.IsFunc W B selected ∧ - ∀ (tau : Name s) z, ZFSet.pair tau.val z ∈ selected → - ∃ D : L, ZFSet.pair tau.val (b.encode D) ∈ supportChoice ∧ - ZFSet.pair (b.encode D) z ∈ enumerationChoice ∧ - d.principalFix D ≤ a.stabilizer s tau ∧ - ∃ delta ∈ M.sets, ∃ f ∈ M.sets, z = ZFSet.pair delta f ∧ - ordinalSetProperty delta ∧ - InjectionCode delta (relationFiber b.nonbottom.carrier - (relationConverse b.carrier b.carrier b.conditionOrder) (b.encode D)) f ∧ - ∀ v : L, v ≠ ⊥ → v ≤ D → ∃ i ∈ delta, ZFSet.pair i (b.encode v) ∈ f := by - have hNonbottom := M.nonbottom_carrier_mem b separation nodes - let reverse := relationConverse b.carrier b.carrier b.conditionOrder - have hReverse := M.relationConverse_mem pairing unions powers separation nodes nodes nodeOrder - let fibers := M.relationFiberFamily b.carrier b.nonbottom.carrier reverse - have hFibers : fibers ∈ M.sets := M.relationFiberFamily_mem pairing unions powers separation - nodes hNonbottom hReverse - have fibersFunction := M.relationFiberFamily_function separation nodes hNonbottom hReverse - have hPower := M.groundPower_mem powers hNonbottom - obtain ⟨B, hB, enumerations, hEnumerations, enumFunction, enumValues⟩ := - M.exists_groundOrdinalEnumerationFamily pairing unions powers separation collection choice - (M.groundPower b.nonbottom.carrier) hPower - let enumerationChoice := relationCompose b.carrier (M.groundPower b.nonbottom.carrier) B fibers enumerations - have enumerationGround : enumerationChoice ∈ M.sets := M.relationCompose_mem pairing unions powers - separation nodes hPower hB hFibers hEnumerations - have enumerationFunction : ZFSet.IsFunc b.carrier B enumerationChoice := - relationCompose_function_of_subset fibersFunction enumFunction (fun _ h => h) - obtain ⟨supportChoice, hSupportChoice, supportFunction, supported⟩ := - M.exists_groundNameSupportChoice a s t b d ⊥ directed pairing unions powers separation collection - choice carrier group nodes supports maps W hW valid symmetric - refine ⟨supportChoice, hSupportChoice, B, hB, enumerationChoice, enumerationGround, - supportFunction, enumerationFunction, ?_⟩ - dsimp only - refine ⟨M.relationCompose_mem pairing unions powers separation hW nodes hB hSupportChoice enumerationGround, - relationCompose_function_of_subset supportFunction enumerationFunction (fun _ h => h), ?_⟩ - intro tau z entry - obtain ⟨_, _, v, hv, supportEdge, enumEdge⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - obtain ⟨D, rfl⟩ := (b.mem_carrier v).1 hv - have fixes := (supported tau D supportEdge).2 - obtain ⟨_, _, ideal, _, idealEdge, chosen⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 enumEdge - have idealEq := ((M.pair_mem_relationFiberFamily b.carrier b.nonbottom.carrier reverse - (b.encode D) ideal).1 idealEdge).2.2 - obtain ⟨delta, hDelta, f, hf, shape, ordinal, injection, onto⟩ := enumValues ideal z chosen - rw [idealEq] at injection onto - refine ⟨D, supportEdge, enumEdge, fixes, delta, hDelta, f, hf, shape, ordinal, injection, ?_⟩ - intro v nonzero below - have member : b.encode v ∈ relationFiber b.nonbottom.carrier reverse (b.encode D) := by - apply (mem_relationFiber _ _ _ _).2 - refine ⟨?_, (pair_mem_relationConverse _ _ _ _ _).2 - ⟨b.encode_mem v, b.encode_mem D, (b.pair_mem_conditionOrder v D).2 below⟩⟩ - exact (b.nonbottom.mem_carrier _).2 ⟨⟨v, nonzero⟩, rfl⟩ - exact onto (b.encode v) member - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinalEnumerationFamilies + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [PartialOrder L] [OrderBot L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +theorem exists_groundSupportEnumerationChoices + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) + (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (W : ZFSet.{u}) (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) + (symmetric : ∀ tau : Name s, tau.val ∈ W → + HereditarilySymmetric a s (d.principalSupportFamily ⊥ directed) tau) : + ∃ supportChoice ∈ M.sets, ∃ B ∈ M.sets, ∃ enumerationChoice ∈ M.sets, + ZFSet.IsFunc W b.carrier supportChoice ∧ ZFSet.IsFunc b.carrier B enumerationChoice ∧ + let selected := relationCompose W b.carrier B supportChoice enumerationChoice + selected ∈ M.sets ∧ ZFSet.IsFunc W B selected ∧ + ∀ (tau : Name s) z, ZFSet.pair tau.val z ∈ selected → + ∃ D : L, ZFSet.pair tau.val (b.encode D) ∈ supportChoice ∧ + ZFSet.pair (b.encode D) z ∈ enumerationChoice ∧ + d.principalFix D ≤ a.stabilizer s tau ∧ + ∃ delta ∈ M.sets, ∃ f ∈ M.sets, z = ZFSet.pair delta f ∧ + ordinalSetProperty delta ∧ + InjectionCode delta (relationFiber b.nonbottom.carrier + (relationConverse b.carrier b.carrier b.conditionOrder) (b.encode D)) f ∧ + ∀ v : L, v ≠ ⊥ → v ≤ D → ∃ i ∈ delta, ZFSet.pair i (b.encode v) ∈ f := by + have hNonbottom := M.nonbottom_carrier_mem b separation nodes + let reverse := relationConverse b.carrier b.carrier b.conditionOrder + have hReverse := M.relationConverse_mem pairing unions powers separation nodes nodes nodeOrder + let fibers := M.relationFiberFamily b.carrier b.nonbottom.carrier reverse + have hFibers : fibers ∈ M.sets := M.relationFiberFamily_mem pairing unions powers separation + nodes hNonbottom hReverse + have fibersFunction := M.relationFiberFamily_function separation nodes hNonbottom hReverse + have hPower := M.groundPower_mem powers hNonbottom + obtain ⟨B, hB, enumerations, hEnumerations, enumFunction, enumValues⟩ := + M.exists_groundOrdinalEnumerationFamily pairing unions powers separation collection choice + (M.groundPower b.nonbottom.carrier) hPower + let enumerationChoice := relationCompose b.carrier (M.groundPower b.nonbottom.carrier) B fibers enumerations + have enumerationGround : enumerationChoice ∈ M.sets := M.relationCompose_mem pairing unions powers + separation nodes hPower hB hFibers hEnumerations + have enumerationFunction : ZFSet.IsFunc b.carrier B enumerationChoice := + relationCompose_function_of_subset fibersFunction enumFunction (fun _ h => h) + obtain ⟨supportChoice, hSupportChoice, supportFunction, supported⟩ := + M.exists_groundNameSupportChoice a s t b d ⊥ directed pairing unions powers separation collection + choice carrier group nodes supports maps W hW valid symmetric + refine ⟨supportChoice, hSupportChoice, B, hB, enumerationChoice, enumerationGround, + supportFunction, enumerationFunction, ?_⟩ + dsimp only + refine ⟨M.relationCompose_mem pairing unions powers separation hW nodes hB hSupportChoice enumerationGround, + relationCompose_function_of_subset supportFunction enumerationFunction (fun _ h => h), ?_⟩ + intro tau z entry + obtain ⟨_, _, v, hv, supportEdge, enumEdge⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + obtain ⟨D, rfl⟩ := (b.mem_carrier v).1 hv + have fixes := (supported tau D supportEdge).2 + obtain ⟨_, _, ideal, _, idealEdge, chosen⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 enumEdge + have idealEq := ((M.pair_mem_relationFiberFamily b.carrier b.nonbottom.carrier reverse + (b.encode D) ideal).1 idealEdge).2.2 + obtain ⟨delta, hDelta, f, hf, shape, ordinal, injection, onto⟩ := enumValues ideal z chosen + rw [idealEq] at injection onto + refine ⟨D, supportEdge, enumEdge, fixes, delta, hDelta, f, hf, shape, ordinal, injection, ?_⟩ + intro v nonzero below + have member : b.encode v ∈ relationFiber b.nonbottom.carrier reverse (b.encode D) := by + apply (mem_relationFiber _ _ _ _).2 + refine ⟨?_, (pair_mem_relationConverse _ _ _ _ _).2 + ⟨b.encode_mem v, b.encode_mem D, (b.pair_mem_conditionOrder v D).2 below⟩⟩ + exact (b.nonbottom.mem_carrier _).2 ⟨⟨v, nonzero⟩, rfl⟩ + exact onto (b.encode v) member + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundOrdinalPartitionInjectionAssembly.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundOrdinalPartitionInjectionAssembly.lean index de7c1abef34fdc319f8c3f376870990064c0df46..55fff3804d1adc7a49794932c1e45d5e98d13073 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundOrdinalPartitionInjectionAssembly.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundOrdinalPartitionInjectionAssembly.lean @@ -1,461 +1,461 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionClosure - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def definableRelationEntryFormula {n} (φ : SetFormula (n + 2)) : SetFormula (n + 3) := - ex (.conj (.mem 0 2) (ex (.conj (.mem 0 4) - (.conj (BoundedFormula.orderedPairFormula 2 1 0).toFormula - (binaryApplication φ (fun i => i.succ.succ.succ.succ.succ) 1 0))))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def definableRelation {n} (φ : SetFormula (n + 2)) - (params : Fin n → ZFSet.{u}) (A B : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧ - Realize M.sets φ (extend x (extend y params))) (ZFSet.prod A B) - -theorem pair_mem_definableRelation {n} (φ : SetFormula (n + 2)) - (params : Fin n → ZFSet.{u}) (A B x y : ZFSet.{u}) : - ZFSet.pair x y ∈ M.definableRelation φ params A B ↔ - x ∈ A ∧ y ∈ B ∧ Realize M.sets φ (extend x (extend y params)) := by - rw [definableRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, a, ha, b, hb, equal, relation⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨ha, hb, relation⟩ - · rintro ⟨hx, hy, relation⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, relation⟩ - -theorem realize_definableRelationEntryFormula {n} (φ : SetFormula (n + 2)) - (params : Fin n → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets (definableRelationEntryFormula φ) (extend z (extend A (extend B params))) ↔ - ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧ Realize M.sets φ (extend x (extend y params)) := by - simp only [definableRelationEntryFormula, realize_ex, Realize] - constructor - · rintro ⟨x, hx, inA, y, hy, inB, pair, relation⟩ - have ground : ∀ i, (extend y (extend x (extend z (extend A (extend B params))))) i ∈ M.sets := - Fin.cases hy (Fin.cases hx (Fin.cases hz (Fin.cases hA (Fin.cases hB members)))) - have exactPair := (BoundedFormula.truth_orderedPairFormula 2 1 0 _).1 - ((BoundedFormula.realize_toFormula M _ _ ground).1 pair) - exact ⟨x, inA, y, inB, exactPair, (realize_binaryApplication M.sets φ _ _ _ _).1 relation⟩ - · rintro ⟨x, hx, y, hy, pair, relation⟩ - have hxM := M.transitive hA hx - have hyM := M.transitive hB hy - have ground : ∀ i, (extend y (extend x (extend z (extend A (extend B params))))) i ∈ M.sets := - Fin.cases hyM (Fin.cases hxM (Fin.cases hz (Fin.cases hA (Fin.cases hB members)))) - exact ⟨x, hxM, hx, y, hyM, hy, - (BoundedFormula.realize_toFormula M _ _ ground).2 - ((BoundedFormula.truth_orderedPairFormula 2 1 0 _).2 pair), - (realize_binaryApplication M.sets φ _ _ _ _).2 relation⟩ - -theorem definableRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : - M.definableRelation φ params A B ∈ M.sets := by - have hProd := M.prod_mem pairing unions powers separation hA hB - have selected := M.separation_mem separation (definableRelationEntryFormula φ) - (extend A (extend B params)) (Fin.cases hA (Fin.cases hB members)) hProd - have equal : ZFSet.sep (fun z => Realize M.sets (definableRelationEntryFormula φ) - (extend z (extend A (extend B params)))) (ZFSet.prod A B) = M.definableRelation φ params A B := by - apply ZFSet.ext - intro z - rw [definableRelation, ZFSet.mem_sep, ZFSet.mem_sep] - apply and_congr_right - intro hz - exact M.realize_definableRelationEntryFormula φ params members hA hB z (M.transitive hProd hz) - exact equal ▸ selected - -theorem choose_definable_relation - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {A : ZFSet.{u}} (hA : A ∈ M.sets) - (total : ∀ x ∈ A, ∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params))) : - ∃ B ∈ M.sets, ∃ f ∈ M.sets, ZFSet.IsFunc A B f ∧ - ∀ x y, ZFSet.pair x y ∈ f → Realize M.sets φ (extend x (extend y params)) := by - obtain ⟨B, hB, bounded⟩ := M.collection_witness collection φ params members hA total - obtain ⟨f, hf, function, subset⟩ := M.uniformize_relation pairing unions powers separation choice - hA hB (M.definableRelation_mem pairing unions powers separation φ params members hA hB) (by - intro x hx - obtain ⟨y, hy, recognized⟩ := bounded x hx - exact ⟨y, hy, (M.pair_mem_definableRelation φ params A B x y).2 ⟨hx, hy, recognized⟩⟩) - exact ⟨B, hB, f, hf, function, fun x y entry => - ((M.pair_mem_definableRelation φ params A B x y).1 (subset entry)).2.2⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -theorem exists_groundNameSupportChoice - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (W : ZFSet.{u}) (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) - (symmetric : ∀ tau : Name s, tau.val ∈ W → - HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) : - ∃ f ∈ M.sets, ZFSet.IsFunc W b.carrier f ∧ - ∀ (tau : Name s) (D : L), ZFSet.pair tau.val (b.encode D) ∈ f → - tau.val ∈ W ∧ d.principalFix D ≤ a.stabilizer s tau := by - let params := extend s.carrier (extend t.carrier (extend (supportBasisCode b t d.principalFix) - (extend (a.conditionMapFamily s t) Fin.elim0))) - have members : ∀ j, params j ∈ M.sets := - Fin.cases carrier (Fin.cases group (Fin.cases supports (Fin.cases maps (fun j => Fin.elim0 j)))) - let relation := M.definableRelation nameSupportFormula params W b.carrier - have ground : relation ∈ M.sets := - M.definableRelation_mem pairing unions powers separation nameSupportFormula params members hW nodes - have meaning (tau : Name s) (member : tau.val ∈ W) (D : L) : - Realize M.sets nameSupportFormula (extend tau.val (extend (b.encode D) params)) ↔ - d.principalFix D ≤ a.stabilizer s tau := - M.realize_nameSupportFormula a s t b d.principalFix pairing unions powers separation collection - carrier group supports maps D (M.transitive nodes (b.encode_mem D)) tau (M.transitive hW member) - have total : ∀ z ∈ W, ∃ v ∈ b.carrier, ZFSet.pair z v ∈ relation := by - intro z member - let tau : Name s := ⟨z, valid z member⟩ - obtain ⟨D, supported⟩ := (symmetric tau member).symmetric - exact ⟨b.encode D, b.encode_mem D, - (M.pair_mem_definableRelation nameSupportFormula params W b.carrier z (b.encode D)).2 - ⟨member, b.encode_mem D, (meaning tau member D).2 supported⟩⟩ - obtain ⟨f, hf, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice - hW nodes ground total - refine ⟨f, hf, function, ?_⟩ - intro tau D entry - have chosen := (M.pair_mem_definableRelation nameSupportFormula params W b.carrier - tau.val (b.encode D)).1 (selected entry) - exact ⟨chosen.1, (meaning tau chosen.1 D).1 chosen.2.2⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace BoundedFormula -private def coveringPositionFormula : BoundedFormula 5 := - disj (.conj (emptyFormula 1) (.allMem 2 (.neg (pairMembershipFormula 0 1 4)))) - (.conj (functionFormula 4 2 1) - (.conj (.allMem 4 (.allMem 3 - (imp (pairMembershipFormula 1 0 3) (pairMembershipFormula 0 2 5)))) - (.allMem 2 (imp (pairMembershipFormula 0 1 4) - (exMem 5 (pairMembershipFormula 0 1 3)))))) - -private theorem coveringPosition_meaning (D f I r mu : ZFSet.{u}) : - Truth coveringPositionFormula ![D, f, I, r, mu] ↔ - (f = ∅ ∧ ∀ v ∈ I, ¬ ZFSet.pair v D ∈ r) ∨ - (ZFSet.IsFunc mu I f ∧ (∀ i v, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ r) ∧ - ∀ v ∈ I, ZFSet.pair v D ∈ r → ∃ i ∈ mu, ZFSet.pair i v ∈ f) := by - simp only [coveringPositionFormula, truth_disj, Truth, truth_emptyFormula, - truth_functionFormula, truth_imp, truth_pairMembershipFormula, truth_exMem] - change (f = ∅ ∧ ∀ v ∈ I, ¬ ZFSet.pair v D ∈ r) ∨ - (ZFSet.IsFunc mu I f ∧ (∀ i ∈ mu, ∀ v ∈ I, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ r) ∧ - ∀ v ∈ I, ZFSet.pair v D ∈ r → ∃ i ∈ mu, ZFSet.pair i v ∈ f) ↔ _ - apply or_congr Iff.rfl - constructor - · rintro ⟨function, bounds, onto⟩ - exact ⟨function, fun i v entry => bounds i (ZFSet.pair_mem_prod.1 (function.1 entry)).1 - v (ZFSet.pair_mem_prod.1 (function.1 entry)).2 entry, onto⟩ - · rintro ⟨function, bounds, onto⟩ - exact ⟨function, fun i _ v _ entry => bounds i v entry, onto⟩ -end BoundedFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] -variable (b : Presentation L) - -theorem exists_groundCoveringRowPositions - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (nodes : b.carrier ∈ M.sets) (order : b.conditionOrder ∈ M.sets) - (mu : ZFSet.{u}) (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) - (small : M.groundEmbeddable b.nonbottom.carrier mu) : - let S := M.rowPositionSequences b.carrier b.conditionOrder b.nonbottom.carrier mu - ∃ selected ∈ M.sets, ZFSet.IsFunc b.carrier S selected ∧ - ∀ (D : L) f, ZFSet.pair (b.encode D) f ∈ selected → - f ∈ S ∧ ∃ delta, (delta = ∅ ∨ delta = mu) ∧ FunctionGraphOn delta f ∧ - (∀ i v, ZFSet.pair i v ∈ f → v ∈ b.nonbottom.carrier ∧ ZFSet.pair v (b.encode D) ∈ b.conditionOrder) ∧ - ∀ v : L, v ≠ ⊥ → v ≤ D → ∃ i ∈ delta, ZFSet.pair i (b.encode v) ∈ f := by - intro S - have hI := M.nonbottom_carrier_mem b separation nodes - have hS := M.rowPositionSequences_mem pairing unions powers separation nodes order hI hmu - let params := extend b.nonbottom.carrier (extend b.conditionOrder (extend mu Fin.elim0)) - have members : ∀ j, params j ∈ M.sets := Fin.cases hI (Fin.cases order (Fin.cases hmu (fun j => Fin.elim0 j))) - let formula := BoundedFormula.coveringPositionFormula.toFormula - let relation := M.definableRelation formula params b.carrier S - have hRelation := M.definableRelation_mem pairing unions powers separation formula params members nodes hS - have meaning (D f : ZFSet.{u}) (hD : D ∈ M.sets) (hf : f ∈ M.sets) : - Realize M.sets formula (extend D (extend f params)) ↔ - (f = ∅ ∧ ∀ v ∈ b.nonbottom.carrier, ¬ ZFSet.pair v D ∈ b.conditionOrder) ∨ - (ZFSet.IsFunc mu b.nonbottom.carrier f ∧ - (∀ i v, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ b.conditionOrder) ∧ - ∀ v ∈ b.nonbottom.carrier, ZFSet.pair v D ∈ b.conditionOrder → - ∃ i ∈ mu, ZFSet.pair i v ∈ f) := by - rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hD (Fin.cases hf members))] - exact BoundedFormula.coveringPosition_meaning D f b.nonbottom.carrier b.conditionOrder mu - have total : ∀ D ∈ b.carrier, ∃ f ∈ S, ZFSet.pair D f ∈ relation := by - intro D hD - let ideal := ZFSet.sep (fun v => ZFSet.pair v D ∈ b.conditionOrder) b.nonbottom.carrier - have hDM := M.transitive nodes hD - have hIdeal : ideal ∈ M.sets := by - have selected := M.bounded_separation_mem separation - (BoundedFormula.pairMembershipFormula 0 1 2) (extend D (extend b.conditionOrder Fin.elim0)) - (Fin.cases hDM (Fin.cases order (fun j => Fin.elim0 j))) hI - simp only [BoundedFormula.truth_pairMembershipFormula] at selected - exact selected - by_cases inhabited : ideal.Nonempty - · have idealSmall : M.groundEmbeddable ideal mu := by - obtain ⟨f, hf, inject⟩ := small - exact ⟨ZFSet.sep (fun z => z ∈ ZFSet.prod ideal mu) f, - M.injection_restriction_mem separation hIdeal hmu hf, - inject.restrict (fun _ h => (ZFSet.mem_sep.1 h).1)⟩ - obtain ⟨f, hf, function, onto⟩ := M.groundEmbeddable_enumeration pairing unions powers separation hIdeal hmu inhabited idealSmall - have retarget : ZFSet.IsFunc mu b.nonbottom.carrier f := - ⟨fun z hz => by - obtain ⟨i, hi, v, hv, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hi, (ZFSet.mem_sep.1 hv).1⟩, function.2⟩ - have bounds : ∀ i v, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ b.conditionOrder := - fun _ _ h => (ZFSet.mem_sep.1 (ZFSet.pair_mem_prod.1 (function.1 h)).2).2 - have code : RowPositionSequenceCode b.carrier b.conditionOrder b.nonbottom.carrier mu f := - ⟨mu, ZFSet.mem_insert _ _, retarget, D, hD, bounds⟩ - have inS := (M.mem_rowPositionSequences ordinal).2 ⟨hf, code⟩ - exact ⟨f, inS, (M.pair_mem_definableRelation formula params b.carrier S D f).2 - ⟨hD, inS, (meaning D f hDM hf).2 (Or.inr ⟨retarget, bounds, - fun v hv below => onto v (ZFSet.mem_sep.2 ⟨hv, below⟩)⟩)⟩⟩ - · have empty := M.empty_mem ⟨b.carrier, nodes⟩ - have inS : (∅ : ZFSet.{u}) ∈ S := M.empty_mem_rowPositionSequences hmu ordinal ⟨D, hD⟩ - exact ⟨∅, inS, (M.pair_mem_definableRelation formula params b.carrier S D ∅).2 - ⟨hD, inS, (meaning D ∅ hDM empty).2 (Or.inl ⟨rfl, - fun v hv below => inhabited ⟨v, ZFSet.mem_sep.2 ⟨hv, below⟩⟩⟩)⟩⟩ - obtain ⟨selected, hSelected, function, included⟩ := M.uniformize_relation pairing unions powers separation choice - nodes hS hRelation total - refine ⟨selected, hSelected, function, ?_⟩ - intro D f entry - have chosen := (M.pair_mem_definableRelation formula params b.carrier S (b.encode D) f).1 (included entry) - refine ⟨chosen.2.1, ?_⟩ - have truth := (meaning (b.encode D) f (M.transitive nodes (b.encode_mem D)) - (M.transitive hS chosen.2.1)).1 chosen.2.2 - have nonbottom (v : L) (h : v ≠ ⊥) : b.encode v ∈ b.nonbottom.carrier := - (b.nonbottom.mem_carrier _).2 ⟨⟨v, h⟩, rfl⟩ - rcases truth with ⟨rfl, none⟩ | ⟨func, bounds, onto⟩ - · exact ⟨∅, Or.inl rfl, FunctionGraphOn.empty, - fun i v entry => (ZFSet.notMem_empty _ entry).elim, - fun v hv below => (none _ (nonbottom v hv) ((b.pair_mem_conditionOrder v D).2 below)).elim⟩ - · exact ⟨mu, Or.inr rfl, ⟨b.nonbottom.carrier, func⟩, - fun i v entry => ⟨(ZFSet.pair_mem_prod.1 (func.1 entry)).2, bounds i v entry⟩, - fun v hv below => onto _ (nonbottom v hv) ((b.pair_mem_conditionOrder v D).2 below)⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (N : TransitiveGround.{u}) - -theorem indexedInjectionCandidates - (zf : ZFRealization N.sets) {delta Y X p q : ZFSet.{u}} - (hDelta : delta ∈ N.sets) (hY : Y ∈ N.sets) (hX : X ∈ N.sets) - (hp : p ∈ N.sets) (hq : q ∈ N.sets) - (pFunction : FunctionGraphOn delta p) (qFunction : FunctionGraphOn delta q) - (bounds : ∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) - (possible : ∀ i ∈ delta, ∀ U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → - N.groundEmbeddable U V) : - ∃ J ∈ N.sets, FunctionGraphOn delta J ∧ - (∀ i S, ZFSet.pair i S ∈ J → S.Nonempty) ∧ - ∀ i S U V f, ZFSet.pair i S ∈ J → ZFSet.pair i U ∈ p → - ZFSet.pair i V ∈ q → (f ∈ S ↔ f ∈ N.sets ∧ InjectionCode U V f) := by - have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 - have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 - have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 - have separation : SeparationSchema N.sets := zf.2.1 - let PB := ⋃₀ ⋃₀ p - let QB := ⋃₀ ⋃₀ q - let W := N.groundRelations Y X - have hPB : PB ∈ N.sets := N.union_mem unions (N.union_mem unions hp) - have hQB : QB ∈ N.sets := N.union_mem unions (N.union_mem unions hq) - have hW : W ∈ N.sets := N.groundRelations_mem pairing unions powers separation hY hX - let params := extend p (extend q (extend PB (extend QB Fin.elim0))) - have members : ∀ j, params j ∈ N.sets := - Fin.cases hp (Fin.cases hq (Fin.cases hPB (Fin.cases hQB (fun j => Fin.elim0 j)))) - let phi : BoundedFormula 6 := BoundedFormula.exMem 4 (BoundedFormula.exMem 6 - (.conj (BoundedFormula.pairMembershipFormula 2 1 4) - (.conj (BoundedFormula.pairMembershipFormula 2 0 5) - (BoundedFormula.injectionFormula 1 0 3)))) - let R := N.definableRelation phi.toFormula params delta W - have hR : R ∈ N.sets := N.definableRelation_mem pairing unions powers separation - phi.toFormula params members hDelta hW - have meaning (i f : ZFSet.{u}) (hi : i ∈ N.sets) (hf : f ∈ N.sets) : - Realize N.sets phi.toFormula (extend i (extend f params)) ↔ - ∃ U ∈ PB, ∃ V ∈ QB, ZFSet.pair i U ∈ p ∧ ZFSet.pair i V ∈ q ∧ InjectionCode U V f := by - rw [BoundedFormula.realize_toFormula N phi _ (Fin.cases hi (Fin.cases hf members))] - simp only [phi, BoundedFormula.truth_exMem, BoundedFormula.Truth, - BoundedFormula.truth_pairMembershipFormula, BoundedFormula.truth_injectionFormula] - rfl - have entry (i U V f : ZFSet.{u}) (ip : ZFSet.pair i U ∈ p) (iq : ZFSet.pair i V ∈ q) : - ZFSet.pair i f ∈ R ↔ f ∈ N.sets ∧ InjectionCode U V f := by - rw [N.pair_mem_definableRelation] - constructor - · rintro ⟨hi, hf, raw⟩ - have hfN := N.transitive hW hf - obtain ⟨U', _hU, V', _hV, ip', iq', code⟩ := (meaning i f (N.transitive hDelta hi) hfN).1 raw - have sameU := pFunction.unique ip' ip - have sameV := qFunction.unique iq' iq - exact ⟨hfN, sameU ▸ sameV ▸ code⟩ - · rintro ⟨hf, code⟩ - have hi := pFunction.pair_source ip - have bound : f ⊆ ZFSet.prod Y X := by - intro z hz - obtain ⟨u, hu, v, hv, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨(bounds i U V ip iq).1 hu, (bounds i U V ip iq).2 hv⟩ - refine ⟨hi, (N.mem_groundRelations Y X f).2 ⟨hf, bound⟩, - (meaning i f (N.transitive hDelta hi) hf).2 ?_⟩ - exact ⟨U, pair_second_mem_doubleUnion ip, V, pair_second_mem_doubleUnion iq, ip, iq, code⟩ - let J := N.relationFiberFamily delta W R - have hJ : J ∈ N.sets := N.relationFiberFamily_mem pairing unions powers separation hDelta hW hR - have jFunction : FunctionGraphOn delta J := - ⟨_, N.relationFiberFamily_function separation hDelta hW hR⟩ - have exactCandidate (i S U V f : ZFSet.{u}) (j : ZFSet.pair i S ∈ J) - (ip : ZFSet.pair i U ∈ p) (iq : ZFSet.pair i V ∈ q) : - f ∈ S ↔ f ∈ N.sets ∧ InjectionCode U V f := by - have same := ((N.pair_mem_relationFiberFamily delta W R i S).1 j).2.2 - rw [same, mem_relationFiber] - constructor - · intro member - exact (entry i U V f ip iq).1 member.2 - · intro code - have edge := (entry i U V f ip iq).2 code - exact ⟨((N.pair_mem_definableRelation phi.toFormula params delta W i f).1 edge).2.1, edge⟩ - refine ⟨J, hJ, jFunction, ?_, exactCandidate⟩ - intro i S j - have hi := jFunction.pair_source j - obtain ⟨U, ip⟩ := pFunction.total hi - obtain ⟨V, iq⟩ := qFunction.total hi - obtain ⟨f, hf, code⟩ := possible i hi U V ip iq - exact ⟨f, (exactCandidate i S U V f j ip iq).2 ⟨hf, code⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (N : TransitiveGround.{u}) - -theorem ordinalPartition_injection_assembly - (zf : ZFRealization N.sets) - (acwo : ∀ delta ∈ N.sets, ordinalSetProperty delta → - ∀ z ∈ N.sets, FunctionGraphOn delta z → - (∀ beta A, ZFSet.pair beta A ∈ z → A.Nonempty) → - ∃ c ∈ N.sets, FunctionGraphOn delta c ∧ - ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ c → x ∈ A) - {delta Y X p q : ZFSet.{u}} - (hDelta : delta ∈ N.sets) (ordinal : ordinalSetProperty delta) - (hY : Y ∈ N.sets) (hX : X ∈ N.sets) (hp : p ∈ N.sets) (hq : q ∈ N.sets) - (pFunction : FunctionGraphOn delta p) (qFunction : FunctionGraphOn delta q) - (bounds : ∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) - (cover : ∀ y ∈ Y, ∃ i ∈ delta, ∃ U, ZFSet.pair i U ∈ p ∧ y ∈ U) - (domainDisjoint : ∀ i k U V y, ZFSet.pair i U ∈ p → ZFSet.pair k V ∈ p → - y ∈ U → y ∈ V → i = k) - (targetDisjoint : ∀ i k U V x, ZFSet.pair i U ∈ q → ZFSet.pair k V ∈ q → - x ∈ U → x ∈ V → i = k) - (possible : ∀ i ∈ delta, ∀ U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → - N.groundEmbeddable U V) : - N.groundEmbeddable Y X := by - have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 - obtain ⟨J, hJ, jFunction, nonempty, candidates⟩ := - N.indexedInjectionCandidates zf hDelta hY hX hp hq pFunction qFunction bounds possible - obtain ⟨c, hc, cFunction, chosen⟩ := acwo delta hDelta ordinal J hJ jFunction nonempty - have codes (i U V f : ZFSet.{u}) (ip : ZFSet.pair i U ∈ p) - (iq : ZFSet.pair i V ∈ q) (entry : ZFSet.pair i f ∈ c) : InjectionCode U V f := by - obtain ⟨S, indexed⟩ := jFunction.total (cFunction.pair_source entry) - exact ((candidates i S U V f indexed ip iq).1 (chosen i S f indexed entry)).2 - let family := relationImage delta (⋃₀ ⋃₀ c) c - let j := ⋃₀ family - have hFamily : family ∈ N.sets := N.relationImage_mem zf.2.1 hDelta - (N.union_mem unions (N.union_mem unions hc)) hc - have hj : j ∈ N.sets := N.union_mem unions hFamily - have entries (z : ZFSet.{u}) : z ∈ j ↔ - ∃ i ∈ delta, ∃ f, ZFSet.pair i f ∈ c ∧ z ∈ f := by - rw [ZFSet.mem_sUnion] - constructor - · rintro ⟨f, member, zf⟩ - obtain ⟨_bound, i, hi, edge⟩ := (mem_relationImage delta (⋃₀ ⋃₀ c) c f).1 member - exact ⟨i, hi, f, edge, zf⟩ - · rintro ⟨i, hi, f, edge, zf⟩ - exact ⟨f, (mem_relationImage delta (⋃₀ ⋃₀ c) c f).2 - ⟨pair_second_mem_doubleUnion edge, i, hi, edge⟩, zf⟩ - have localCode (i : ZFSet.{u}) (hi : i ∈ delta) (f : ZFSet.{u}) (edge : ZFSet.pair i f ∈ c) : - ∃ U V, ZFSet.pair i U ∈ p ∧ ZFSet.pair i V ∈ q ∧ InjectionCode U V f := by - obtain ⟨U, ip⟩ := pFunction.total hi - obtain ⟨V, iq⟩ := qFunction.total hi - exact ⟨U, V, ip, iq, codes i U V f ip iq edge⟩ - refine ⟨j, hj, ⟨⟨?_, ?_⟩, ?_⟩⟩ - · intro z member - obtain ⟨i, hi, f, edge, zf⟩ := (entries z).1 member - obtain ⟨U, V, ip, iq, code⟩ := localCode i hi f edge - obtain ⟨y, hy, x, hx, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 zf) - exact ZFSet.pair_mem_prod.2 ⟨(bounds i U V ip iq).1 hy, (bounds i U V ip iq).2 hx⟩ - · intro y hy - obtain ⟨i, hi, U, ip, yu⟩ := cover y hy - obtain ⟨V, iq⟩ := qFunction.total hi - obtain ⟨f, edge⟩ := cFunction.total hi - have code := codes i U V f ip iq edge - obtain ⟨x, picked, unique⟩ := code.function.2 y yu - refine ⟨x, (entries _).2 ⟨i, hi, f, edge, picked⟩, ?_⟩ - intro x' other - obtain ⟨k, hk, g, otherEdge, otherPicked⟩ := (entries _).1 other - obtain ⟨U', V', kp, kq, otherCode⟩ := localCode k hk g otherEdge - have inU' := (ZFSet.pair_mem_prod.1 (otherCode.function.1 otherPicked)).1 - have equalIndex : i = k := domainDisjoint i k U U' y ip kp yu inU' - subst k - have equalFunction : g = f := cFunction.unique otherEdge edge - exact unique x' (equalFunction ▸ otherPicked) - · intro y y' x first second - obtain ⟨i, hi, f, edge, picked⟩ := (entries _).1 first - obtain ⟨k, hk, g, otherEdge, otherPicked⟩ := (entries _).1 second - obtain ⟨U, V, ip, iq, code⟩ := localCode i hi f edge - obtain ⟨U', V', kp, kq, otherCode⟩ := localCode k hk g otherEdge - have inV := (ZFSet.pair_mem_prod.1 (code.function.1 picked)).2 - have inV' := (ZFSet.pair_mem_prod.1 (otherCode.function.1 otherPicked)).2 - have equalIndex : i = k := targetDisjoint i k V V' x iq kq inV inV' - subst k - have equalFunction : g = f := cFunction.unique otherEdge edge - exact code.injective y y' x picked (equalFunction ▸ otherPicked) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableFunctionClosure + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def definableRelationEntryFormula {n} (φ : SetFormula (n + 2)) : SetFormula (n + 3) := + ex (.conj (.mem 0 2) (ex (.conj (.mem 0 4) + (.conj (BoundedFormula.orderedPairFormula 2 1 0).toFormula + (binaryApplication φ (fun i => i.succ.succ.succ.succ.succ) 1 0))))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def definableRelation {n} (φ : SetFormula (n + 2)) + (params : Fin n → ZFSet.{u}) (A B : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧ + Realize M.sets φ (extend x (extend y params))) (ZFSet.prod A B) + +theorem pair_mem_definableRelation {n} (φ : SetFormula (n + 2)) + (params : Fin n → ZFSet.{u}) (A B x y : ZFSet.{u}) : + ZFSet.pair x y ∈ M.definableRelation φ params A B ↔ + x ∈ A ∧ y ∈ B ∧ Realize M.sets φ (extend x (extend y params)) := by + rw [definableRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, a, ha, b, hb, equal, relation⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨ha, hb, relation⟩ + · rintro ⟨hx, hy, relation⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, relation⟩ + +theorem realize_definableRelationEntryFormula {n} (φ : SetFormula (n + 2)) + (params : Fin n → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets (definableRelationEntryFormula φ) (extend z (extend A (extend B params))) ↔ + ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧ Realize M.sets φ (extend x (extend y params)) := by + simp only [definableRelationEntryFormula, realize_ex, Realize] + constructor + · rintro ⟨x, hx, inA, y, hy, inB, pair, relation⟩ + have ground : ∀ i, (extend y (extend x (extend z (extend A (extend B params))))) i ∈ M.sets := + Fin.cases hy (Fin.cases hx (Fin.cases hz (Fin.cases hA (Fin.cases hB members)))) + have exactPair := (BoundedFormula.truth_orderedPairFormula 2 1 0 _).1 + ((BoundedFormula.realize_toFormula M _ _ ground).1 pair) + exact ⟨x, inA, y, inB, exactPair, (realize_binaryApplication M.sets φ _ _ _ _).1 relation⟩ + · rintro ⟨x, hx, y, hy, pair, relation⟩ + have hxM := M.transitive hA hx + have hyM := M.transitive hB hy + have ground : ∀ i, (extend y (extend x (extend z (extend A (extend B params))))) i ∈ M.sets := + Fin.cases hyM (Fin.cases hxM (Fin.cases hz (Fin.cases hA (Fin.cases hB members)))) + exact ⟨x, hxM, hx, y, hyM, hy, + (BoundedFormula.realize_toFormula M _ _ ground).2 + ((BoundedFormula.truth_orderedPairFormula 2 1 0 _).2 pair), + (realize_binaryApplication M.sets φ _ _ _ _).2 relation⟩ + +theorem definableRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : + M.definableRelation φ params A B ∈ M.sets := by + have hProd := M.prod_mem pairing unions powers separation hA hB + have selected := M.separation_mem separation (definableRelationEntryFormula φ) + (extend A (extend B params)) (Fin.cases hA (Fin.cases hB members)) hProd + have equal : ZFSet.sep (fun z => Realize M.sets (definableRelationEntryFormula φ) + (extend z (extend A (extend B params)))) (ZFSet.prod A B) = M.definableRelation φ params A B := by + apply ZFSet.ext + intro z + rw [definableRelation, ZFSet.mem_sep, ZFSet.mem_sep] + apply and_congr_right + intro hz + exact M.realize_definableRelationEntryFormula φ params members hA hB z (M.transitive hProd hz) + exact equal ▸ selected + +theorem choose_definable_relation + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + {n} (φ : SetFormula (n + 2)) (params : Fin n → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {A : ZFSet.{u}} (hA : A ∈ M.sets) + (total : ∀ x ∈ A, ∃ y ∈ M.sets, Realize M.sets φ (extend x (extend y params))) : + ∃ B ∈ M.sets, ∃ f ∈ M.sets, ZFSet.IsFunc A B f ∧ + ∀ x y, ZFSet.pair x y ∈ f → Realize M.sets φ (extend x (extend y params)) := by + obtain ⟨B, hB, bounded⟩ := M.collection_witness collection φ params members hA total + obtain ⟨f, hf, function, subset⟩ := M.uniformize_relation pairing unions powers separation choice + hA hB (M.definableRelation_mem pairing unions powers separation φ params members hA hB) (by + intro x hx + obtain ⟨y, hy, recognized⟩ := bounded x hx + exact ⟨y, hy, (M.pair_mem_definableRelation φ params A B x y).2 ⟨hx, hy, recognized⟩⟩) + exact ⟨B, hB, f, hf, function, fun x y entry => + ((M.pair_mem_definableRelation φ params A B x y).1 (subset entry)).2.2⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +theorem exists_groundNameSupportChoice + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (W : ZFSet.{u}) (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) + (symmetric : ∀ tau : Name s, tau.val ∈ W → + HereditarilySymmetric a s (d.principalSupportFamily base directed) tau) : + ∃ f ∈ M.sets, ZFSet.IsFunc W b.carrier f ∧ + ∀ (tau : Name s) (D : L), ZFSet.pair tau.val (b.encode D) ∈ f → + tau.val ∈ W ∧ d.principalFix D ≤ a.stabilizer s tau := by + let params := extend s.carrier (extend t.carrier (extend (supportBasisCode b t d.principalFix) + (extend (a.conditionMapFamily s t) Fin.elim0))) + have members : ∀ j, params j ∈ M.sets := + Fin.cases carrier (Fin.cases group (Fin.cases supports (Fin.cases maps (fun j => Fin.elim0 j)))) + let relation := M.definableRelation nameSupportFormula params W b.carrier + have ground : relation ∈ M.sets := + M.definableRelation_mem pairing unions powers separation nameSupportFormula params members hW nodes + have meaning (tau : Name s) (member : tau.val ∈ W) (D : L) : + Realize M.sets nameSupportFormula (extend tau.val (extend (b.encode D) params)) ↔ + d.principalFix D ≤ a.stabilizer s tau := + M.realize_nameSupportFormula a s t b d.principalFix pairing unions powers separation collection + carrier group supports maps D (M.transitive nodes (b.encode_mem D)) tau (M.transitive hW member) + have total : ∀ z ∈ W, ∃ v ∈ b.carrier, ZFSet.pair z v ∈ relation := by + intro z member + let tau : Name s := ⟨z, valid z member⟩ + obtain ⟨D, supported⟩ := (symmetric tau member).symmetric + exact ⟨b.encode D, b.encode_mem D, + (M.pair_mem_definableRelation nameSupportFormula params W b.carrier z (b.encode D)).2 + ⟨member, b.encode_mem D, (meaning tau member D).2 supported⟩⟩ + obtain ⟨f, hf, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice + hW nodes ground total + refine ⟨f, hf, function, ?_⟩ + intro tau D entry + have chosen := (M.pair_mem_definableRelation nameSupportFormula params W b.carrier + tau.val (b.encode D)).1 (selected entry) + exact ⟨chosen.1, (meaning tau chosen.1 D).1 chosen.2.2⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace BoundedFormula +private def coveringPositionFormula : BoundedFormula 5 := + disj (.conj (emptyFormula 1) (.allMem 2 (.neg (pairMembershipFormula 0 1 4)))) + (.conj (functionFormula 4 2 1) + (.conj (.allMem 4 (.allMem 3 + (imp (pairMembershipFormula 1 0 3) (pairMembershipFormula 0 2 5)))) + (.allMem 2 (imp (pairMembershipFormula 0 1 4) + (exMem 5 (pairMembershipFormula 0 1 3)))))) + +private theorem coveringPosition_meaning (D f I r mu : ZFSet.{u}) : + Truth coveringPositionFormula ![D, f, I, r, mu] ↔ + (f = ∅ ∧ ∀ v ∈ I, ¬ ZFSet.pair v D ∈ r) ∨ + (ZFSet.IsFunc mu I f ∧ (∀ i v, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ r) ∧ + ∀ v ∈ I, ZFSet.pair v D ∈ r → ∃ i ∈ mu, ZFSet.pair i v ∈ f) := by + simp only [coveringPositionFormula, truth_disj, Truth, truth_emptyFormula, + truth_functionFormula, truth_imp, truth_pairMembershipFormula, truth_exMem] + change (f = ∅ ∧ ∀ v ∈ I, ¬ ZFSet.pair v D ∈ r) ∨ + (ZFSet.IsFunc mu I f ∧ (∀ i ∈ mu, ∀ v ∈ I, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ r) ∧ + ∀ v ∈ I, ZFSet.pair v D ∈ r → ∃ i ∈ mu, ZFSet.pair i v ∈ f) ↔ _ + apply or_congr Iff.rfl + constructor + · rintro ⟨function, bounds, onto⟩ + exact ⟨function, fun i v entry => bounds i (ZFSet.pair_mem_prod.1 (function.1 entry)).1 + v (ZFSet.pair_mem_prod.1 (function.1 entry)).2 entry, onto⟩ + · rintro ⟨function, bounds, onto⟩ + exact ⟨function, fun i _ v _ entry => bounds i v entry, onto⟩ +end BoundedFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] +variable (b : Presentation L) + +theorem exists_groundCoveringRowPositions + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (nodes : b.carrier ∈ M.sets) (order : b.conditionOrder ∈ M.sets) + (mu : ZFSet.{u}) (hmu : mu ∈ M.sets) (ordinal : ordinalSetProperty mu) + (small : M.groundEmbeddable b.nonbottom.carrier mu) : + let S := M.rowPositionSequences b.carrier b.conditionOrder b.nonbottom.carrier mu + ∃ selected ∈ M.sets, ZFSet.IsFunc b.carrier S selected ∧ + ∀ (D : L) f, ZFSet.pair (b.encode D) f ∈ selected → + f ∈ S ∧ ∃ delta, (delta = ∅ ∨ delta = mu) ∧ FunctionGraphOn delta f ∧ + (∀ i v, ZFSet.pair i v ∈ f → v ∈ b.nonbottom.carrier ∧ ZFSet.pair v (b.encode D) ∈ b.conditionOrder) ∧ + ∀ v : L, v ≠ ⊥ → v ≤ D → ∃ i ∈ delta, ZFSet.pair i (b.encode v) ∈ f := by + intro S + have hI := M.nonbottom_carrier_mem b separation nodes + have hS := M.rowPositionSequences_mem pairing unions powers separation nodes order hI hmu + let params := extend b.nonbottom.carrier (extend b.conditionOrder (extend mu Fin.elim0)) + have members : ∀ j, params j ∈ M.sets := Fin.cases hI (Fin.cases order (Fin.cases hmu (fun j => Fin.elim0 j))) + let formula := BoundedFormula.coveringPositionFormula.toFormula + let relation := M.definableRelation formula params b.carrier S + have hRelation := M.definableRelation_mem pairing unions powers separation formula params members nodes hS + have meaning (D f : ZFSet.{u}) (hD : D ∈ M.sets) (hf : f ∈ M.sets) : + Realize M.sets formula (extend D (extend f params)) ↔ + (f = ∅ ∧ ∀ v ∈ b.nonbottom.carrier, ¬ ZFSet.pair v D ∈ b.conditionOrder) ∨ + (ZFSet.IsFunc mu b.nonbottom.carrier f ∧ + (∀ i v, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ b.conditionOrder) ∧ + ∀ v ∈ b.nonbottom.carrier, ZFSet.pair v D ∈ b.conditionOrder → + ∃ i ∈ mu, ZFSet.pair i v ∈ f) := by + rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases hD (Fin.cases hf members))] + exact BoundedFormula.coveringPosition_meaning D f b.nonbottom.carrier b.conditionOrder mu + have total : ∀ D ∈ b.carrier, ∃ f ∈ S, ZFSet.pair D f ∈ relation := by + intro D hD + let ideal := ZFSet.sep (fun v => ZFSet.pair v D ∈ b.conditionOrder) b.nonbottom.carrier + have hDM := M.transitive nodes hD + have hIdeal : ideal ∈ M.sets := by + have selected := M.bounded_separation_mem separation + (BoundedFormula.pairMembershipFormula 0 1 2) (extend D (extend b.conditionOrder Fin.elim0)) + (Fin.cases hDM (Fin.cases order (fun j => Fin.elim0 j))) hI + simp only [BoundedFormula.truth_pairMembershipFormula] at selected + exact selected + by_cases inhabited : ideal.Nonempty + · have idealSmall : M.groundEmbeddable ideal mu := by + obtain ⟨f, hf, inject⟩ := small + exact ⟨ZFSet.sep (fun z => z ∈ ZFSet.prod ideal mu) f, + M.injection_restriction_mem separation hIdeal hmu hf, + inject.restrict (fun _ h => (ZFSet.mem_sep.1 h).1)⟩ + obtain ⟨f, hf, function, onto⟩ := M.groundEmbeddable_enumeration pairing unions powers separation hIdeal hmu inhabited idealSmall + have retarget : ZFSet.IsFunc mu b.nonbottom.carrier f := + ⟨fun z hz => by + obtain ⟨i, hi, v, hv, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hi, (ZFSet.mem_sep.1 hv).1⟩, function.2⟩ + have bounds : ∀ i v, ZFSet.pair i v ∈ f → ZFSet.pair v D ∈ b.conditionOrder := + fun _ _ h => (ZFSet.mem_sep.1 (ZFSet.pair_mem_prod.1 (function.1 h)).2).2 + have code : RowPositionSequenceCode b.carrier b.conditionOrder b.nonbottom.carrier mu f := + ⟨mu, ZFSet.mem_insert _ _, retarget, D, hD, bounds⟩ + have inS := (M.mem_rowPositionSequences ordinal).2 ⟨hf, code⟩ + exact ⟨f, inS, (M.pair_mem_definableRelation formula params b.carrier S D f).2 + ⟨hD, inS, (meaning D f hDM hf).2 (Or.inr ⟨retarget, bounds, + fun v hv below => onto v (ZFSet.mem_sep.2 ⟨hv, below⟩)⟩)⟩⟩ + · have empty := M.empty_mem ⟨b.carrier, nodes⟩ + have inS : (∅ : ZFSet.{u}) ∈ S := M.empty_mem_rowPositionSequences hmu ordinal ⟨D, hD⟩ + exact ⟨∅, inS, (M.pair_mem_definableRelation formula params b.carrier S D ∅).2 + ⟨hD, inS, (meaning D ∅ hDM empty).2 (Or.inl ⟨rfl, + fun v hv below => inhabited ⟨v, ZFSet.mem_sep.2 ⟨hv, below⟩⟩⟩)⟩⟩ + obtain ⟨selected, hSelected, function, included⟩ := M.uniformize_relation pairing unions powers separation choice + nodes hS hRelation total + refine ⟨selected, hSelected, function, ?_⟩ + intro D f entry + have chosen := (M.pair_mem_definableRelation formula params b.carrier S (b.encode D) f).1 (included entry) + refine ⟨chosen.2.1, ?_⟩ + have truth := (meaning (b.encode D) f (M.transitive nodes (b.encode_mem D)) + (M.transitive hS chosen.2.1)).1 chosen.2.2 + have nonbottom (v : L) (h : v ≠ ⊥) : b.encode v ∈ b.nonbottom.carrier := + (b.nonbottom.mem_carrier _).2 ⟨⟨v, h⟩, rfl⟩ + rcases truth with ⟨rfl, none⟩ | ⟨func, bounds, onto⟩ + · exact ⟨∅, Or.inl rfl, FunctionGraphOn.empty, + fun i v entry => (ZFSet.notMem_empty _ entry).elim, + fun v hv below => (none _ (nonbottom v hv) ((b.pair_mem_conditionOrder v D).2 below)).elim⟩ + · exact ⟨mu, Or.inr rfl, ⟨b.nonbottom.carrier, func⟩, + fun i v entry => ⟨(ZFSet.pair_mem_prod.1 (func.1 entry)).2, bounds i v entry⟩, + fun v hv below => onto _ (nonbottom v hv) ((b.pair_mem_conditionOrder v D).2 below)⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (N : TransitiveGround.{u}) + +theorem indexedInjectionCandidates + (zf : ZFRealization N.sets) {delta Y X p q : ZFSet.{u}} + (hDelta : delta ∈ N.sets) (hY : Y ∈ N.sets) (hX : X ∈ N.sets) + (hp : p ∈ N.sets) (hq : q ∈ N.sets) + (pFunction : FunctionGraphOn delta p) (qFunction : FunctionGraphOn delta q) + (bounds : ∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) + (possible : ∀ i ∈ delta, ∀ U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → + N.groundEmbeddable U V) : + ∃ J ∈ N.sets, FunctionGraphOn delta J ∧ + (∀ i S, ZFSet.pair i S ∈ J → S.Nonempty) ∧ + ∀ i S U V f, ZFSet.pair i S ∈ J → ZFSet.pair i U ∈ p → + ZFSet.pair i V ∈ q → (f ∈ S ↔ f ∈ N.sets ∧ InjectionCode U V f) := by + have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 + have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 + have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 + have separation : SeparationSchema N.sets := zf.2.1 + let PB := ⋃₀ ⋃₀ p + let QB := ⋃₀ ⋃₀ q + let W := N.groundRelations Y X + have hPB : PB ∈ N.sets := N.union_mem unions (N.union_mem unions hp) + have hQB : QB ∈ N.sets := N.union_mem unions (N.union_mem unions hq) + have hW : W ∈ N.sets := N.groundRelations_mem pairing unions powers separation hY hX + let params := extend p (extend q (extend PB (extend QB Fin.elim0))) + have members : ∀ j, params j ∈ N.sets := + Fin.cases hp (Fin.cases hq (Fin.cases hPB (Fin.cases hQB (fun j => Fin.elim0 j)))) + let phi : BoundedFormula 6 := BoundedFormula.exMem 4 (BoundedFormula.exMem 6 + (.conj (BoundedFormula.pairMembershipFormula 2 1 4) + (.conj (BoundedFormula.pairMembershipFormula 2 0 5) + (BoundedFormula.injectionFormula 1 0 3)))) + let R := N.definableRelation phi.toFormula params delta W + have hR : R ∈ N.sets := N.definableRelation_mem pairing unions powers separation + phi.toFormula params members hDelta hW + have meaning (i f : ZFSet.{u}) (hi : i ∈ N.sets) (hf : f ∈ N.sets) : + Realize N.sets phi.toFormula (extend i (extend f params)) ↔ + ∃ U ∈ PB, ∃ V ∈ QB, ZFSet.pair i U ∈ p ∧ ZFSet.pair i V ∈ q ∧ InjectionCode U V f := by + rw [BoundedFormula.realize_toFormula N phi _ (Fin.cases hi (Fin.cases hf members))] + simp only [phi, BoundedFormula.truth_exMem, BoundedFormula.Truth, + BoundedFormula.truth_pairMembershipFormula, BoundedFormula.truth_injectionFormula] + rfl + have entry (i U V f : ZFSet.{u}) (ip : ZFSet.pair i U ∈ p) (iq : ZFSet.pair i V ∈ q) : + ZFSet.pair i f ∈ R ↔ f ∈ N.sets ∧ InjectionCode U V f := by + rw [N.pair_mem_definableRelation] + constructor + · rintro ⟨hi, hf, raw⟩ + have hfN := N.transitive hW hf + obtain ⟨U', _hU, V', _hV, ip', iq', code⟩ := (meaning i f (N.transitive hDelta hi) hfN).1 raw + have sameU := pFunction.unique ip' ip + have sameV := qFunction.unique iq' iq + exact ⟨hfN, sameU ▸ sameV ▸ code⟩ + · rintro ⟨hf, code⟩ + have hi := pFunction.pair_source ip + have bound : f ⊆ ZFSet.prod Y X := by + intro z hz + obtain ⟨u, hu, v, hv, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨(bounds i U V ip iq).1 hu, (bounds i U V ip iq).2 hv⟩ + refine ⟨hi, (N.mem_groundRelations Y X f).2 ⟨hf, bound⟩, + (meaning i f (N.transitive hDelta hi) hf).2 ?_⟩ + exact ⟨U, pair_second_mem_doubleUnion ip, V, pair_second_mem_doubleUnion iq, ip, iq, code⟩ + let J := N.relationFiberFamily delta W R + have hJ : J ∈ N.sets := N.relationFiberFamily_mem pairing unions powers separation hDelta hW hR + have jFunction : FunctionGraphOn delta J := + ⟨_, N.relationFiberFamily_function separation hDelta hW hR⟩ + have exactCandidate (i S U V f : ZFSet.{u}) (j : ZFSet.pair i S ∈ J) + (ip : ZFSet.pair i U ∈ p) (iq : ZFSet.pair i V ∈ q) : + f ∈ S ↔ f ∈ N.sets ∧ InjectionCode U V f := by + have same := ((N.pair_mem_relationFiberFamily delta W R i S).1 j).2.2 + rw [same, mem_relationFiber] + constructor + · intro member + exact (entry i U V f ip iq).1 member.2 + · intro code + have edge := (entry i U V f ip iq).2 code + exact ⟨((N.pair_mem_definableRelation phi.toFormula params delta W i f).1 edge).2.1, edge⟩ + refine ⟨J, hJ, jFunction, ?_, exactCandidate⟩ + intro i S j + have hi := jFunction.pair_source j + obtain ⟨U, ip⟩ := pFunction.total hi + obtain ⟨V, iq⟩ := qFunction.total hi + obtain ⟨f, hf, code⟩ := possible i hi U V ip iq + exact ⟨f, (exactCandidate i S U V f j ip iq).2 ⟨hf, code⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (N : TransitiveGround.{u}) + +theorem ordinalPartition_injection_assembly + (zf : ZFRealization N.sets) + (acwo : ∀ delta ∈ N.sets, ordinalSetProperty delta → + ∀ z ∈ N.sets, FunctionGraphOn delta z → + (∀ beta A, ZFSet.pair beta A ∈ z → A.Nonempty) → + ∃ c ∈ N.sets, FunctionGraphOn delta c ∧ + ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ c → x ∈ A) + {delta Y X p q : ZFSet.{u}} + (hDelta : delta ∈ N.sets) (ordinal : ordinalSetProperty delta) + (hY : Y ∈ N.sets) (hX : X ∈ N.sets) (hp : p ∈ N.sets) (hq : q ∈ N.sets) + (pFunction : FunctionGraphOn delta p) (qFunction : FunctionGraphOn delta q) + (bounds : ∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) + (cover : ∀ y ∈ Y, ∃ i ∈ delta, ∃ U, ZFSet.pair i U ∈ p ∧ y ∈ U) + (domainDisjoint : ∀ i k U V y, ZFSet.pair i U ∈ p → ZFSet.pair k V ∈ p → + y ∈ U → y ∈ V → i = k) + (targetDisjoint : ∀ i k U V x, ZFSet.pair i U ∈ q → ZFSet.pair k V ∈ q → + x ∈ U → x ∈ V → i = k) + (possible : ∀ i ∈ delta, ∀ U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → + N.groundEmbeddable U V) : + N.groundEmbeddable Y X := by + have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 + obtain ⟨J, hJ, jFunction, nonempty, candidates⟩ := + N.indexedInjectionCandidates zf hDelta hY hX hp hq pFunction qFunction bounds possible + obtain ⟨c, hc, cFunction, chosen⟩ := acwo delta hDelta ordinal J hJ jFunction nonempty + have codes (i U V f : ZFSet.{u}) (ip : ZFSet.pair i U ∈ p) + (iq : ZFSet.pair i V ∈ q) (entry : ZFSet.pair i f ∈ c) : InjectionCode U V f := by + obtain ⟨S, indexed⟩ := jFunction.total (cFunction.pair_source entry) + exact ((candidates i S U V f indexed ip iq).1 (chosen i S f indexed entry)).2 + let family := relationImage delta (⋃₀ ⋃₀ c) c + let j := ⋃₀ family + have hFamily : family ∈ N.sets := N.relationImage_mem zf.2.1 hDelta + (N.union_mem unions (N.union_mem unions hc)) hc + have hj : j ∈ N.sets := N.union_mem unions hFamily + have entries (z : ZFSet.{u}) : z ∈ j ↔ + ∃ i ∈ delta, ∃ f, ZFSet.pair i f ∈ c ∧ z ∈ f := by + rw [ZFSet.mem_sUnion] + constructor + · rintro ⟨f, member, zf⟩ + obtain ⟨_bound, i, hi, edge⟩ := (mem_relationImage delta (⋃₀ ⋃₀ c) c f).1 member + exact ⟨i, hi, f, edge, zf⟩ + · rintro ⟨i, hi, f, edge, zf⟩ + exact ⟨f, (mem_relationImage delta (⋃₀ ⋃₀ c) c f).2 + ⟨pair_second_mem_doubleUnion edge, i, hi, edge⟩, zf⟩ + have localCode (i : ZFSet.{u}) (hi : i ∈ delta) (f : ZFSet.{u}) (edge : ZFSet.pair i f ∈ c) : + ∃ U V, ZFSet.pair i U ∈ p ∧ ZFSet.pair i V ∈ q ∧ InjectionCode U V f := by + obtain ⟨U, ip⟩ := pFunction.total hi + obtain ⟨V, iq⟩ := qFunction.total hi + exact ⟨U, V, ip, iq, codes i U V f ip iq edge⟩ + refine ⟨j, hj, ⟨⟨?_, ?_⟩, ?_⟩⟩ + · intro z member + obtain ⟨i, hi, f, edge, zf⟩ := (entries z).1 member + obtain ⟨U, V, ip, iq, code⟩ := localCode i hi f edge + obtain ⟨y, hy, x, hx, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 zf) + exact ZFSet.pair_mem_prod.2 ⟨(bounds i U V ip iq).1 hy, (bounds i U V ip iq).2 hx⟩ + · intro y hy + obtain ⟨i, hi, U, ip, yu⟩ := cover y hy + obtain ⟨V, iq⟩ := qFunction.total hi + obtain ⟨f, edge⟩ := cFunction.total hi + have code := codes i U V f ip iq edge + obtain ⟨x, picked, unique⟩ := code.function.2 y yu + refine ⟨x, (entries _).2 ⟨i, hi, f, edge, picked⟩, ?_⟩ + intro x' other + obtain ⟨k, hk, g, otherEdge, otherPicked⟩ := (entries _).1 other + obtain ⟨U', V', kp, kq, otherCode⟩ := localCode k hk g otherEdge + have inU' := (ZFSet.pair_mem_prod.1 (otherCode.function.1 otherPicked)).1 + have equalIndex : i = k := domainDisjoint i k U U' y ip kp yu inU' + subst k + have equalFunction : g = f := cFunction.unique otherEdge edge + exact unique x' (equalFunction ▸ otherPicked) + · intro y y' x first second + obtain ⟨i, hi, f, edge, picked⟩ := (entries _).1 first + obtain ⟨k, hk, g, otherEdge, otherPicked⟩ := (entries _).1 second + obtain ⟨U, V, ip, iq, code⟩ := localCode i hi f edge + obtain ⟨U', V', kp, kq, otherCode⟩ := localCode k hk g otherEdge + have inV := (ZFSet.pair_mem_prod.1 (code.function.1 picked)).2 + have inV' := (ZFSet.pair_mem_prod.1 (otherCode.function.1 otherPicked)).2 + have equalIndex : i = k := targetDisjoint i k V V' x iq kq inV inV' + subst k + have equalFunction : g = f := cFunction.unique otherEdge edge + exact code.injective y y' x picked (equalFunction ▸ otherPicked) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientBinaryOperations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientBinaryOperations.lean index 0257be5260f139228be682913923c00cff3332d8..76726b0a066185d94cb4686382edc057659d290c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientBinaryOperations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientBinaryOperations.lean @@ -1,154 +1,154 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -def quotientBinaryGraph (W Q classifier op : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ a ∈ Q, ∃ b ∈ Q, ∃ c ∈ Q, - z = ZFSet.pair (ZFSet.pair a b) c ∧ - ∃ x ∈ W, ∃ y ∈ W, ∃ t ∈ W, - ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ - ZFSet.pair t c ∈ classifier ∧ ZFSet.pair (ZFSet.pair x y) t ∈ op) - (ZFSet.prod (ZFSet.prod Q Q) Q) - -theorem mem_quotientBinaryGraph (W Q classifier op z : ZFSet.{u}) : - z ∈ quotientBinaryGraph W Q classifier op ↔ - ∃ a ∈ Q, ∃ b ∈ Q, ∃ c ∈ Q, z = ZFSet.pair (ZFSet.pair a b) c ∧ - ∃ x ∈ W, ∃ y ∈ W, ∃ t ∈ W, - ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ - ZFSet.pair t c ∈ classifier ∧ ZFSet.pair (ZFSet.pair x y) t ∈ op := by - rw [quotientBinaryGraph, ZFSet.mem_sep] - refine ⟨And.right, ?_⟩ - rintro ⟨a, ha, b, hb, c, hc, eq, rest⟩ - exact ⟨eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, hc⟩, - a, ha, b, hb, c, hc, eq, rest⟩ - -theorem pair_mem_quotientBinaryGraph (W Q classifier op a b c : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair a b) c ∈ quotientBinaryGraph W Q classifier op ↔ - a ∈ Q ∧ b ∈ Q ∧ c ∈ Q ∧ ∃ x ∈ W, ∃ y ∈ W, ∃ t ∈ W, - ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ - ZFSet.pair t c ∈ classifier ∧ ZFSet.pair (ZFSet.pair x y) t ∈ op := by - rw [mem_quotientBinaryGraph] - constructor - · rintro ⟨a', ha, b', hb, c', hc, eq, rest⟩ - obtain ⟨ab, rfl⟩ := ZFSet.pair_inj.1 eq - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab - exact ⟨ha, hb, hc, rest⟩ - · rintro ⟨ha, hb, hc, rest⟩ - exact ⟨a, ha, b, hb, c, hc, rfl, rest⟩ - -theorem quotientBinaryGraph_eq_graph {A B : Type u} (s : Presentation A) (t : Presentation B) - (q : A → B) (source : A → A → A) (target : B → B → B) - (onto : Function.Surjective q) - (compatible : ∀ x y, q (source x y) = target (q x) (q y)) : - quotientBinaryGraph s.carrier t.carrier (s.graph t q) - ((s.product s).graph s (fun p => source p.1 p.2)) = - (t.product t).graph t (fun p => target p.1 p.2) := by - apply ZFSet.ext - intro z - rw [mem_quotientBinaryGraph, Presentation.mem_graph] - constructor - · rintro ⟨a, ha, b, hb, c, hc, rfl, x, hx, y, hy, w, hw, xa, yb, wc, op⟩ - obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha - obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb - obtain ⟨c, rfl⟩ := (t.mem_carrier c).1 hc - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw - have first := (s.pair_mem_graph t q x a).1 xa - have second := (s.pair_mem_graph t q y b).1 yb - have output := (s.pair_mem_graph t q w c).1 wc - have value := ((s.product s).pair_mem_graph s (fun p => source p.1 p.2) (x, y) w).1 op - have equal : target a b = c := by - rw [← first, ← second, ← compatible, value] - exact output - exact ⟨(a, b), by change ZFSet.pair (ZFSet.pair _ _) (t.encode (target a b)) = _; rw [equal]⟩ - · rintro ⟨⟨a, b⟩, rfl⟩ - obtain ⟨x, rfl⟩ := onto a - obtain ⟨y, rfl⟩ := onto b - refine ⟨t.encode (q x), t.encode_mem _, t.encode (q y), t.encode_mem _, - t.encode (target (q x) (q y)), t.encode_mem _, rfl, - s.encode x, s.encode_mem _, s.encode y, s.encode_mem _, - s.encode (source x y), s.encode_mem _, ?_, ?_, ?_, ?_⟩ - · exact (s.pair_mem_graph t q _ _).2 rfl - · exact (s.pair_mem_graph t q _ _).2 rfl - · exact (s.pair_mem_graph t q _ _).2 (compatible x y) - · exact ((s.product s).pair_mem_graph s (fun p => source p.1 p.2) (x, y) _).2 rfl - -theorem quotientBinaryGraph_function {A B : Type u} (s : Presentation A) (t : Presentation B) - (q : A → B) (source : A → A → A) (target : B → B → B) - (onto : Function.Surjective q) - (compatible : ∀ x y, q (source x y) = target (q x) (q y)) : - ZFSet.IsFunc (ZFSet.prod t.carrier t.carrier) t.carrier - (quotientBinaryGraph s.carrier t.carrier (s.graph t q) - ((s.product s).graph s (fun p => source p.1 p.2))) := by - rw [quotientBinaryGraph_eq_graph s t q source target onto compatible] - exact (t.product t).graph_isFunc t _ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace BoundedFormula - -def quotientBinaryEntryFormula {n} (z w q classifier op : Fin n) : BoundedFormula n := - exMem q (exMem q.succ (exMem q.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) - (exMem w.succ.succ.succ (exMem w.succ.succ.succ.succ - (exMem w.succ.succ.succ.succ.succ - (.conj (pairMembershipFormula 2 5 classifier.succ.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 1 4 classifier.succ.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 0 3 classifier.succ.succ.succ.succ.succ.succ) - (tripleMembershipFormula 2 1 0 op.succ.succ.succ.succ.succ.succ)))))))))) - -theorem truth_quotientBinaryEntryFormula {n} (z w q classifier op : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (quotientBinaryEntryFormula z w q classifier op) env ↔ - env z ∈ quotientBinaryGraph (env w) (env q) (env classifier) (env op) := by - simp only [quotientBinaryEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_pairMembershipFormula, truth_tripleMembershipFormula, mem_quotientBinaryGraph] - rfl - -end BoundedFormula - -namespace TransitiveGround - -theorem quotientBinaryGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {W Q classifier op : ZFSet.{u}} (hW : W ∈ M.sets) (hQ : Q ∈ M.sets) - (hc : classifier ∈ M.sets) (ho : op ∈ M.sets) : - quotientBinaryGraph W Q classifier op ∈ M.sets := by - have bound := M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hQ hQ) hQ - let params := extend W (extend Q (extend classifier (extend op Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.quotientBinaryEntryFormula 0 1 2 3 4) params - (Fin.cases hW (Fin.cases hQ (Fin.cases hc (Fin.cases ho (fun i => Fin.elim0 i))))) bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.quotientBinaryEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod (ZFSet.prod Q Q) Q) = quotientBinaryGraph W Q classifier op := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_quotientBinaryEntryFormula] - change (z ∈ ZFSet.prod (ZFSet.prod Q Q) Q ∧ z ∈ quotientBinaryGraph W Q classifier op) ↔ _ - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact eq ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +def quotientBinaryGraph (W Q classifier op : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ a ∈ Q, ∃ b ∈ Q, ∃ c ∈ Q, + z = ZFSet.pair (ZFSet.pair a b) c ∧ + ∃ x ∈ W, ∃ y ∈ W, ∃ t ∈ W, + ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ + ZFSet.pair t c ∈ classifier ∧ ZFSet.pair (ZFSet.pair x y) t ∈ op) + (ZFSet.prod (ZFSet.prod Q Q) Q) + +theorem mem_quotientBinaryGraph (W Q classifier op z : ZFSet.{u}) : + z ∈ quotientBinaryGraph W Q classifier op ↔ + ∃ a ∈ Q, ∃ b ∈ Q, ∃ c ∈ Q, z = ZFSet.pair (ZFSet.pair a b) c ∧ + ∃ x ∈ W, ∃ y ∈ W, ∃ t ∈ W, + ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ + ZFSet.pair t c ∈ classifier ∧ ZFSet.pair (ZFSet.pair x y) t ∈ op := by + rw [quotientBinaryGraph, ZFSet.mem_sep] + refine ⟨And.right, ?_⟩ + rintro ⟨a, ha, b, hb, c, hc, eq, rest⟩ + exact ⟨eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, hc⟩, + a, ha, b, hb, c, hc, eq, rest⟩ + +theorem pair_mem_quotientBinaryGraph (W Q classifier op a b c : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair a b) c ∈ quotientBinaryGraph W Q classifier op ↔ + a ∈ Q ∧ b ∈ Q ∧ c ∈ Q ∧ ∃ x ∈ W, ∃ y ∈ W, ∃ t ∈ W, + ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ + ZFSet.pair t c ∈ classifier ∧ ZFSet.pair (ZFSet.pair x y) t ∈ op := by + rw [mem_quotientBinaryGraph] + constructor + · rintro ⟨a', ha, b', hb, c', hc, eq, rest⟩ + obtain ⟨ab, rfl⟩ := ZFSet.pair_inj.1 eq + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab + exact ⟨ha, hb, hc, rest⟩ + · rintro ⟨ha, hb, hc, rest⟩ + exact ⟨a, ha, b, hb, c, hc, rfl, rest⟩ + +theorem quotientBinaryGraph_eq_graph {A B : Type u} (s : Presentation A) (t : Presentation B) + (q : A → B) (source : A → A → A) (target : B → B → B) + (onto : Function.Surjective q) + (compatible : ∀ x y, q (source x y) = target (q x) (q y)) : + quotientBinaryGraph s.carrier t.carrier (s.graph t q) + ((s.product s).graph s (fun p => source p.1 p.2)) = + (t.product t).graph t (fun p => target p.1 p.2) := by + apply ZFSet.ext + intro z + rw [mem_quotientBinaryGraph, Presentation.mem_graph] + constructor + · rintro ⟨a, ha, b, hb, c, hc, rfl, x, hx, y, hy, w, hw, xa, yb, wc, op⟩ + obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha + obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb + obtain ⟨c, rfl⟩ := (t.mem_carrier c).1 hc + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw + have first := (s.pair_mem_graph t q x a).1 xa + have second := (s.pair_mem_graph t q y b).1 yb + have output := (s.pair_mem_graph t q w c).1 wc + have value := ((s.product s).pair_mem_graph s (fun p => source p.1 p.2) (x, y) w).1 op + have equal : target a b = c := by + rw [← first, ← second, ← compatible, value] + exact output + exact ⟨(a, b), by change ZFSet.pair (ZFSet.pair _ _) (t.encode (target a b)) = _; rw [equal]⟩ + · rintro ⟨⟨a, b⟩, rfl⟩ + obtain ⟨x, rfl⟩ := onto a + obtain ⟨y, rfl⟩ := onto b + refine ⟨t.encode (q x), t.encode_mem _, t.encode (q y), t.encode_mem _, + t.encode (target (q x) (q y)), t.encode_mem _, rfl, + s.encode x, s.encode_mem _, s.encode y, s.encode_mem _, + s.encode (source x y), s.encode_mem _, ?_, ?_, ?_, ?_⟩ + · exact (s.pair_mem_graph t q _ _).2 rfl + · exact (s.pair_mem_graph t q _ _).2 rfl + · exact (s.pair_mem_graph t q _ _).2 (compatible x y) + · exact ((s.product s).pair_mem_graph s (fun p => source p.1 p.2) (x, y) _).2 rfl + +theorem quotientBinaryGraph_function {A B : Type u} (s : Presentation A) (t : Presentation B) + (q : A → B) (source : A → A → A) (target : B → B → B) + (onto : Function.Surjective q) + (compatible : ∀ x y, q (source x y) = target (q x) (q y)) : + ZFSet.IsFunc (ZFSet.prod t.carrier t.carrier) t.carrier + (quotientBinaryGraph s.carrier t.carrier (s.graph t q) + ((s.product s).graph s (fun p => source p.1 p.2))) := by + rw [quotientBinaryGraph_eq_graph s t q source target onto compatible] + exact (t.product t).graph_isFunc t _ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace BoundedFormula + +def quotientBinaryEntryFormula {n} (z w q classifier op : Fin n) : BoundedFormula n := + exMem q (exMem q.succ (exMem q.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ 2 1 0) + (exMem w.succ.succ.succ (exMem w.succ.succ.succ.succ + (exMem w.succ.succ.succ.succ.succ + (.conj (pairMembershipFormula 2 5 classifier.succ.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 1 4 classifier.succ.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 0 3 classifier.succ.succ.succ.succ.succ.succ) + (tripleMembershipFormula 2 1 0 op.succ.succ.succ.succ.succ.succ)))))))))) + +theorem truth_quotientBinaryEntryFormula {n} (z w q classifier op : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (quotientBinaryEntryFormula z w q classifier op) env ↔ + env z ∈ quotientBinaryGraph (env w) (env q) (env classifier) (env op) := by + simp only [quotientBinaryEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_pairMembershipFormula, truth_tripleMembershipFormula, mem_quotientBinaryGraph] + rfl + +end BoundedFormula + +namespace TransitiveGround + +theorem quotientBinaryGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {W Q classifier op : ZFSet.{u}} (hW : W ∈ M.sets) (hQ : Q ∈ M.sets) + (hc : classifier ∈ M.sets) (ho : op ∈ M.sets) : + quotientBinaryGraph W Q classifier op ∈ M.sets := by + have bound := M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hQ hQ) hQ + let params := extend W (extend Q (extend classifier (extend op Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.quotientBinaryEntryFormula 0 1 2 3 4) params + (Fin.cases hW (Fin.cases hQ (Fin.cases hc (Fin.cases ho (fun i => Fin.elim0 i))))) bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.quotientBinaryEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod (ZFSet.prod Q Q) Q) = quotientBinaryGraph W Q classifier op := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_quotientBinaryEntryFormula] + change (z ∈ ZFSet.prod (ZFSet.prod Q Q) Q ∧ z ∈ quotientBinaryGraph W Q classifier op) ↔ _ + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact eq ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientUnaryOperations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientUnaryOperations.lean index d3dcc4cc5a6f8c7f00bf702398e8dec58e975a67..0e5200f347a121920a6c275cbd982a9e85555a6b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientUnaryOperations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundQuotientUnaryOperations.lean @@ -1,129 +1,129 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -def quotientUnaryGraph (W Q classifier op : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ a ∈ Q, ∃ b ∈ Q, z = ZFSet.pair a b ∧ - ∃ x ∈ W, ∃ y ∈ W, ZFSet.pair x a ∈ classifier ∧ - ZFSet.pair y b ∈ classifier ∧ ZFSet.pair x y ∈ op) (ZFSet.prod Q Q) - -theorem mem_quotientUnaryGraph (W Q classifier op z : ZFSet.{u}) : - z ∈ quotientUnaryGraph W Q classifier op ↔ - ∃ a ∈ Q, ∃ b ∈ Q, z = ZFSet.pair a b ∧ ∃ x ∈ W, ∃ y ∈ W, - ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ ZFSet.pair x y ∈ op := by - rw [quotientUnaryGraph, ZFSet.mem_sep] - refine ⟨And.right, ?_⟩ - rintro ⟨a, ha, b, hb, eq, rest⟩ - exact ⟨eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, a, ha, b, hb, eq, rest⟩ - -theorem pair_mem_quotientUnaryGraph (W Q classifier op a b : ZFSet.{u}) : - ZFSet.pair a b ∈ quotientUnaryGraph W Q classifier op ↔ - a ∈ Q ∧ b ∈ Q ∧ ∃ x ∈ W, ∃ y ∈ W, - ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ ZFSet.pair x y ∈ op := by - rw [mem_quotientUnaryGraph] - constructor - · rintro ⟨a', ha, b', hb, eq, rest⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨ha, hb, rest⟩ - · rintro ⟨ha, hb, rest⟩ - exact ⟨a, ha, b, hb, rfl, rest⟩ - -theorem quotientUnaryGraph_eq_graph {A B : Type u} (s : Presentation A) (t : Presentation B) - (q : A → B) (source : A → A) (target : B → B) - (onto : Function.Surjective q) (compatible : ∀ x, q (source x) = target (q x)) : - quotientUnaryGraph s.carrier t.carrier (s.graph t q) (s.graph s source) = t.graph t target := by - apply ZFSet.ext - intro z - rw [mem_quotientUnaryGraph, Presentation.mem_graph] - constructor - · rintro ⟨a, ha, b, hb, rfl, x, hx, y, hy, xa, yb, op⟩ - obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha - obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb - obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx - obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy - have first := (s.pair_mem_graph t q x a).1 xa - have output := (s.pair_mem_graph t q y b).1 yb - have value := (s.pair_mem_graph s source x y).1 op - have equal : target a = b := by - rw [← first, ← compatible, value] - exact output - exact ⟨a, by rw [equal]⟩ - · rintro ⟨a, rfl⟩ - obtain ⟨x, rfl⟩ := onto a - exact ⟨t.encode (q x), t.encode_mem _, t.encode (target (q x)), t.encode_mem _, rfl, - s.encode x, s.encode_mem _, s.encode (source x), s.encode_mem _, - (s.pair_mem_graph t q _ _).2 rfl, (s.pair_mem_graph t q _ _).2 (compatible x), - (s.pair_mem_graph s source _ _).2 rfl⟩ - -theorem quotientUnaryGraph_function {A B : Type u} (s : Presentation A) (t : Presentation B) - (q : A → B) (source : A → A) (target : B → B) - (onto : Function.Surjective q) (compatible : ∀ x, q (source x) = target (q x)) : - ZFSet.IsFunc t.carrier t.carrier - (quotientUnaryGraph s.carrier t.carrier (s.graph t q) (s.graph s source)) := by - rw [quotientUnaryGraph_eq_graph s t q source target onto compatible] - exact t.graph_isFunc t target - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace BoundedFormula - -def quotientUnaryEntryFormula {n} (z w q classifier op : Fin n) : BoundedFormula n := - exMem q (exMem q.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (exMem w.succ.succ (exMem w.succ.succ.succ - (.conj (pairMembershipFormula 1 3 classifier.succ.succ.succ.succ) - (.conj (pairMembershipFormula 0 2 classifier.succ.succ.succ.succ) - (pairMembershipFormula 1 0 op.succ.succ.succ.succ))))))) - -theorem truth_quotientUnaryEntryFormula {n} (z w q classifier op : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (quotientUnaryEntryFormula z w q classifier op) env ↔ - env z ∈ quotientUnaryGraph (env w) (env q) (env classifier) (env op) := by - simp only [quotientUnaryEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_pairMembershipFormula, mem_quotientUnaryGraph] - rfl - -end BoundedFormula - -namespace TransitiveGround - -theorem quotientUnaryGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {W Q classifier op : ZFSet.{u}} (hW : W ∈ M.sets) (hQ : Q ∈ M.sets) - (hc : classifier ∈ M.sets) (ho : op ∈ M.sets) : - quotientUnaryGraph W Q classifier op ∈ M.sets := by - have bound := M.prod_mem pairing unions powers separation hQ hQ - let params := extend W (extend Q (extend classifier (extend op Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.quotientUnaryEntryFormula 0 1 2 3 4) params - (Fin.cases hW (Fin.cases hQ (Fin.cases hc (Fin.cases ho (fun i => Fin.elim0 i))))) bound - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.quotientUnaryEntryFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod Q Q) = quotientUnaryGraph W Q classifier op := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_quotientUnaryEntryFormula] - change (z ∈ ZFSet.prod Q Q ∧ z ∈ quotientUnaryGraph W Q classifier op) ↔ _ - exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ - exact eq ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +def quotientUnaryGraph (W Q classifier op : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ a ∈ Q, ∃ b ∈ Q, z = ZFSet.pair a b ∧ + ∃ x ∈ W, ∃ y ∈ W, ZFSet.pair x a ∈ classifier ∧ + ZFSet.pair y b ∈ classifier ∧ ZFSet.pair x y ∈ op) (ZFSet.prod Q Q) + +theorem mem_quotientUnaryGraph (W Q classifier op z : ZFSet.{u}) : + z ∈ quotientUnaryGraph W Q classifier op ↔ + ∃ a ∈ Q, ∃ b ∈ Q, z = ZFSet.pair a b ∧ ∃ x ∈ W, ∃ y ∈ W, + ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ ZFSet.pair x y ∈ op := by + rw [quotientUnaryGraph, ZFSet.mem_sep] + refine ⟨And.right, ?_⟩ + rintro ⟨a, ha, b, hb, eq, rest⟩ + exact ⟨eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, a, ha, b, hb, eq, rest⟩ + +theorem pair_mem_quotientUnaryGraph (W Q classifier op a b : ZFSet.{u}) : + ZFSet.pair a b ∈ quotientUnaryGraph W Q classifier op ↔ + a ∈ Q ∧ b ∈ Q ∧ ∃ x ∈ W, ∃ y ∈ W, + ZFSet.pair x a ∈ classifier ∧ ZFSet.pair y b ∈ classifier ∧ ZFSet.pair x y ∈ op := by + rw [mem_quotientUnaryGraph] + constructor + · rintro ⟨a', ha, b', hb, eq, rest⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨ha, hb, rest⟩ + · rintro ⟨ha, hb, rest⟩ + exact ⟨a, ha, b, hb, rfl, rest⟩ + +theorem quotientUnaryGraph_eq_graph {A B : Type u} (s : Presentation A) (t : Presentation B) + (q : A → B) (source : A → A) (target : B → B) + (onto : Function.Surjective q) (compatible : ∀ x, q (source x) = target (q x)) : + quotientUnaryGraph s.carrier t.carrier (s.graph t q) (s.graph s source) = t.graph t target := by + apply ZFSet.ext + intro z + rw [mem_quotientUnaryGraph, Presentation.mem_graph] + constructor + · rintro ⟨a, ha, b, hb, rfl, x, hx, y, hy, xa, yb, op⟩ + obtain ⟨a, rfl⟩ := (t.mem_carrier a).1 ha + obtain ⟨b, rfl⟩ := (t.mem_carrier b).1 hb + obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx + obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy + have first := (s.pair_mem_graph t q x a).1 xa + have output := (s.pair_mem_graph t q y b).1 yb + have value := (s.pair_mem_graph s source x y).1 op + have equal : target a = b := by + rw [← first, ← compatible, value] + exact output + exact ⟨a, by rw [equal]⟩ + · rintro ⟨a, rfl⟩ + obtain ⟨x, rfl⟩ := onto a + exact ⟨t.encode (q x), t.encode_mem _, t.encode (target (q x)), t.encode_mem _, rfl, + s.encode x, s.encode_mem _, s.encode (source x), s.encode_mem _, + (s.pair_mem_graph t q _ _).2 rfl, (s.pair_mem_graph t q _ _).2 (compatible x), + (s.pair_mem_graph s source _ _).2 rfl⟩ + +theorem quotientUnaryGraph_function {A B : Type u} (s : Presentation A) (t : Presentation B) + (q : A → B) (source : A → A) (target : B → B) + (onto : Function.Surjective q) (compatible : ∀ x, q (source x) = target (q x)) : + ZFSet.IsFunc t.carrier t.carrier + (quotientUnaryGraph s.carrier t.carrier (s.graph t q) (s.graph s source)) := by + rw [quotientUnaryGraph_eq_graph s t q source target onto compatible] + exact t.graph_isFunc t target + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace BoundedFormula + +def quotientUnaryEntryFormula {n} (z w q classifier op : Fin n) : BoundedFormula n := + exMem q (exMem q.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (exMem w.succ.succ (exMem w.succ.succ.succ + (.conj (pairMembershipFormula 1 3 classifier.succ.succ.succ.succ) + (.conj (pairMembershipFormula 0 2 classifier.succ.succ.succ.succ) + (pairMembershipFormula 1 0 op.succ.succ.succ.succ))))))) + +theorem truth_quotientUnaryEntryFormula {n} (z w q classifier op : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (quotientUnaryEntryFormula z w q classifier op) env ↔ + env z ∈ quotientUnaryGraph (env w) (env q) (env classifier) (env op) := by + simp only [quotientUnaryEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_pairMembershipFormula, mem_quotientUnaryGraph] + rfl + +end BoundedFormula + +namespace TransitiveGround + +theorem quotientUnaryGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {W Q classifier op : ZFSet.{u}} (hW : W ∈ M.sets) (hQ : Q ∈ M.sets) + (hc : classifier ∈ M.sets) (ho : op ∈ M.sets) : + quotientUnaryGraph W Q classifier op ∈ M.sets := by + have bound := M.prod_mem pairing unions powers separation hQ hQ + let params := extend W (extend Q (extend classifier (extend op Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.quotientUnaryEntryFormula 0 1 2 3 4) params + (Fin.cases hW (Fin.cases hQ (Fin.cases hc (Fin.cases ho (fun i => Fin.elim0 i))))) bound + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.quotientUnaryEntryFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod Q Q) = quotientUnaryGraph W Q classifier op := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_quotientUnaryEntryFormula] + change (z ∈ ZFSet.prod Q Q ∧ z ∈ quotientUnaryGraph W Q classifier op) ↔ _ + exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩ + exact eq ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRefinementQuotientNames.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRefinementQuotientNames.lean index c274e5beb0c7b713441cf82776d3390fe525ef8f..57996af30b4ba748ab0555eb321d4230d3f23eee 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRefinementQuotientNames.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRefinementQuotientNames.lean @@ -1,420 +1,420 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs -import OAI.SetTheory.PartitionPrinciple.Forcing.ActiveNameImageSymmetry -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedClassInclusions - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def refinementQuotientMap (U Rf Rc : ZFSet.{u}) : ZFSet.{u} := - relationCompose (equivalenceClasses U Rf) U (equivalenceClasses U Rc) - (relationConverse U (equivalenceClasses U Rf) (equivalenceClassifier U Rf)) - (equivalenceClassifier U Rc) - -theorem refinementQuotientMap_subset (U Rf Rc : ZFSet.{u}) : - refinementQuotientMap U Rf Rc ⊆ - ZFSet.prod (equivalenceClasses U Rf) (equivalenceClasses U Rc) := by - intro z hz - rw [refinementQuotientMap, relationCompose, ZFSet.mem_sep] at hz - exact hz.1 - -theorem pair_mem_refinementQuotientMap (U Rf Rc C D : ZFSet.{u}) : - ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc ↔ - ∃ x ∈ U, C = equivalenceClass U Rf x ∧ D = equivalenceClass U Rc x := by - rw [refinementQuotientMap, pair_mem_relationCompose] - constructor - · rintro ⟨_, _, x, hx, first, second⟩ - exact ⟨x, hx, - ((pair_mem_equivalenceClassifier U Rf x C).1 - ((pair_mem_relationConverse _ _ _ x C).1 first).2.2).2, - ((pair_mem_equivalenceClassifier U Rc x D).1 second).2⟩ - · rintro ⟨x, hx, rfl, rfl⟩ - have hf := equivalenceClass_mem (E := Rf) hx - have hc := equivalenceClass_mem (E := Rc) hx - exact ⟨hf, hc, x, hx, (pair_mem_relationConverse _ _ _ x _).2 - ⟨hx, hf, (pair_mem_equivalenceClassifier U Rf x _).2 ⟨hx, rfl⟩⟩, - (pair_mem_equivalenceClassifier U Rc x _).2 ⟨hx, rfl⟩⟩ - -theorem mem_refinementQuotientMap (U Rf Rc z : ZFSet.{u}) : - z ∈ refinementQuotientMap U Rf Rc ↔ - ∃ x ∈ U, z = ZFSet.pair (equivalenceClass U Rf x) (equivalenceClass U Rc x) := by - constructor - · intro hz - obtain ⟨C, _, D, _, rfl⟩ := ZFSet.mem_prod.1 (refinementQuotientMap_subset U Rf Rc hz) - obtain ⟨x, hx, rfl, rfl⟩ := (pair_mem_refinementQuotientMap U Rf Rc C D).1 hz - exact ⟨x, hx, rfl⟩ - · rintro ⟨x, hx, rfl⟩ - exact (pair_mem_refinementQuotientMap U Rf Rc _ _).2 ⟨x, hx, rfl, rfl⟩ - -theorem refinementQuotientMap_class_entry {U Rf Rc x : ZFSet.{u}} (hx : x ∈ U) : - ZFSet.pair (equivalenceClass U Rf x) (equivalenceClass U Rc x) ∈ - refinementQuotientMap U Rf Rc := - (pair_mem_refinementQuotientMap U Rf Rc _ _).2 ⟨x, hx, rfl, rfl⟩ - -theorem equivalenceClass_refinement_subset {U Rf Rc x : ZFSet.{u}} - (refinement : Rf ⊆ Rc) : equivalenceClass U Rf x ⊆ equivalenceClass U Rc x := by - intro y hy - obtain ⟨hy, related⟩ := (mem_equivalenceClass U Rf x y).1 hy - exact (mem_equivalenceClass U Rc x y).2 ⟨hy, refinement related⟩ - -theorem refinementQuotientMap_value_iff {U Rf Rc x D : ZFSet.{u}} - (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) - (refinement : Rf ⊆ Rc) (hx : x ∈ U) : - ZFSet.pair (equivalenceClass U Rf x) D ∈ refinementQuotientMap U Rf Rc ↔ - D = equivalenceClass U Rc x := by - constructor - · intro entry - obtain ⟨y, hy, equal, rfl⟩ := - (pair_mem_refinementQuotientMap U Rf Rc _ D).1 entry - exact ((coarse.class_eq_iff hx hy).2 - (refinement ((fine.class_eq_iff hx hy).1 equal))).symm - · rintro rfl - exact refinementQuotientMap_class_entry hx - -theorem refinementQuotientMap_function {U Rf Rc : ZFSet.{u}} - (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) - (refinement : Rf ⊆ Rc) : - ZFSet.IsFunc (equivalenceClasses U Rf) (equivalenceClasses U Rc) - (refinementQuotientMap U Rf Rc) := by - refine ⟨refinementQuotientMap_subset U Rf Rc, ?_⟩ - intro C hC - obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClasses U Rf C).1 hC - exact ⟨equivalenceClass U Rc x, refinementQuotientMap_class_entry hx, - fun D entry => (refinementQuotientMap_value_iff fine coarse refinement hx).1 entry⟩ - -theorem refinementQuotientMap_onto {U Rf Rc D : ZFSet.{u}} - (hD : D ∈ equivalenceClasses U Rc) : - ∃ C ∈ equivalenceClasses U Rf, ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc := by - obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClasses U Rc D).1 hD - exact ⟨equivalenceClass U Rf x, equivalenceClass_mem hx, - refinementQuotientMap_class_entry hx⟩ - -theorem refinementQuotientMap_entry_iff_subset {U Rf Rc C D : ZFSet.{u}} - (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) - (refinement : Rf ⊆ Rc) : - ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc ↔ - C ∈ equivalenceClasses U Rf ∧ D ∈ equivalenceClasses U Rc ∧ C ⊆ D := by - constructor - · intro entry - obtain ⟨x, hx, rfl, rfl⟩ := (pair_mem_refinementQuotientMap U Rf Rc C D).1 entry - exact ⟨equivalenceClass_mem hx, equivalenceClass_mem hx, - equivalenceClass_refinement_subset refinement⟩ - · rintro ⟨hC, hD, subset⟩ - obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClasses U Rf C).1 hC - obtain ⟨y, hy, rfl⟩ := (mem_equivalenceClasses U Rc D).1 hD - have related := ((mem_equivalenceClass U Rc y x).1 (subset (fine.class_self hx))).2 - exact (refinementQuotientMap_value_iff fine coarse refinement hx).2 - ((coarse.class_eq_iff hx hy).2 related).symm - -theorem refinementQuotientMap_member_value {U Rf Rc C D x : ZFSet.{u}} - (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) - (refinement : Rf ⊆ Rc) (entry : ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc) - (hx : x ∈ C) : D = equivalenceClass U Rc x := by - obtain ⟨y, hy, rfl, rfl⟩ := (pair_mem_refinementQuotientMap U Rf Rc C D).1 entry - obtain ⟨hx, xy⟩ := (mem_equivalenceClass U Rf y x).1 hx - have classEqual := (fine.class_eq_iff hx hy).2 xy - exact (refinementQuotientMap_value_iff fine coarse refinement hx).1 - (classEqual.symm ▸ refinementQuotientMap_class_entry (Rf := Rf) (Rc := Rc) hy) - -theorem refinementQuotientMap_triangle {U Rf Rc : ZFSet.{u}} - (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) - (refinement : Rf ⊆ Rc) : - relationCompose U (equivalenceClasses U Rf) (equivalenceClasses U Rc) - (equivalenceClassifier U Rf) (refinementQuotientMap U Rf Rc) = - equivalenceClassifier U Rc := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, C, _, D, _, rfl, first, second⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz - have equal := ((pair_mem_equivalenceClassifier U Rf x C).1 first).2 - subst C - exact (pair_mem_equivalenceClassifier U Rc x D).2 - ⟨hx, (refinementQuotientMap_value_iff fine coarse refinement hx).1 second⟩ - · intro hz - obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClassifier U Rc z).1 hz - exact (pair_mem_relationCompose _ _ _ _ _ x _).2 - ⟨hx, equivalenceClass_mem hx, equivalenceClass U Rf x, equivalenceClass_mem hx, - (pair_mem_equivalenceClassifier U Rf x _).2 ⟨hx, rfl⟩, - refinementQuotientMap_class_entry hx⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u - -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem refinementQuotientMap_mem - {U Rf Rc : ZFSet.{u}} (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) : - refinementQuotientMap U Rf Rc ∈ M.sets := by - have fineClasses := M.equivalenceClasses_mem powers separation hU hf - have coarseClasses := M.equivalenceClasses_mem powers separation hU hc - have fineClassifier := M.equivalenceClassifier_mem pairing unions - powers separation hU hf - have coarseClassifier := M.equivalenceClassifier_mem pairing unions - powers separation hU hc - have converse := M.relationConverse_mem pairing unions powers - separation hU fineClasses fineClassifier - exact M.relationCompose_mem pairing unions powers separation - fineClasses hU coarseClasses converse coarseClassifier - -theorem refinementQuotientMap_spec - {U Rf Rc : ZFSet.{u}} (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) - (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) - (refinement : Rf ⊆ Rc) : - equivalenceClasses U Rf ∈ M.sets ∧ equivalenceClasses U Rc ∈ M.sets ∧ - refinementQuotientMap U Rf Rc ∈ M.sets ∧ - ZFSet.IsFunc (equivalenceClasses U Rf) (equivalenceClasses U Rc) - (refinementQuotientMap U Rf Rc) ∧ - (∀ D ∈ equivalenceClasses U Rc, ∃ C ∈ equivalenceClasses U Rf, - ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc) ∧ - (∀ C D, ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc ↔ - C ∈ equivalenceClasses U Rf ∧ D ∈ equivalenceClasses U Rc ∧ C ⊆ D) := - ⟨M.equivalenceClasses_mem powers separation hU hf, - M.equivalenceClasses_mem powers separation hU hc, - M.refinementQuotientMap_mem pairing unions powers separation hU hf hc, - refinementQuotientMap_function fine coarse refinement, - fun _ hD => refinementQuotientMap_onto hD, - fun _ _ => refinementQuotientMap_entry_iff_subset fine coarse refinement⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -theorem equivalenceClass_eq_of_carrier_subset {T U R : ZFSet.{u}} - (subset : U ⊆ T) (shape : R ⊆ ZFSet.prod U U) (x : ZFSet.{u}) : - equivalenceClass T R x = equivalenceClass U R x := by - apply ZFSet.ext - intro y - rw [mem_equivalenceClass, mem_equivalenceClass] - exact ⟨fun h => ⟨(ZFSet.pair_mem_prod.1 (shape h.2)).1, h.2⟩, - fun h => ⟨subset h.1, h.2⟩⟩ - -namespace Name -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} - -noncomputable def refinementQuotient (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U R : Name s) : Name s := - activeImage T valid U (refinementClass T valid R) - -noncomputable def refinementNaturalMap (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U Rf Rc : Name s) : Name s := - activeImage T valid U (fun w => - orderedPair ⊤ (refinementClass T valid Rf w) (refinementClass T valid Rc w)) - -theorem entry_refinementQuotient (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U R σ : Name s) (p : P) : - Entry σ (refinementQuotient T valid U R) p ↔ - ∃ w : Name s, w.val ∈ T ∧ ForcesMem p w U ∧ refinementClass T valid R w = σ := - entry_activeImage T valid U _ σ p - -theorem entry_refinementNaturalMap (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (U Rf Rc σ : Name s) (p : P) : - Entry σ (refinementNaturalMap T valid U Rf Rc) p ↔ - ∃ w : Name s, w.val ∈ T ∧ ForcesMem p w U ∧ - orderedPair ⊤ (refinementClass T valid Rf w) (refinementClass T valid Rc w) = σ := - entry_activeImage T valid U _ σ p - -theorem eval_refinementQuotient (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (U R : Name s) - (hU : U ∈ D.names) (hR : R ∈ D.names) - (terms : ∀ w : Name s, w.val ∈ T → w ∈ D.names) - (pairs : ∀ z w : Name s, z.val ∈ T → w.val ∈ T → orderedPair ⊤ z w ∈ D.names) - (subset : eval {p | H.mem p} U ⊆ eval {p | H.mem p} (familySet ⊤ T valid)) - (shape : eval {p | H.mem p} R ⊆ ZFSet.prod (eval {p | H.mem p} U) (eval {p | H.mem p} U)) : - eval {p | H.mem p} (refinementQuotient T valid U R) = - equivalenceClasses (eval {p | H.mem p} U) (eval {p | H.mem p} R) := by - have value (w : Name s) (hw : w.val ∈ T) := - (eval_refinementClass D H generic T valid R w hR (fun z hz => pairs z w hz hw)).trans - (equivalenceClass_eq_of_carrier_subset subset shape (eval {p | H.mem p} w)) - apply ZFSet.ext - intro C - rw [refinementQuotient, mem_eval_activeImage D H generic T valid U _ hU terms, - mem_equivalenceClasses] - constructor - · rintro ⟨w, hw, active, equal⟩ - exact ⟨eval {p | H.mem p} w, active, equal.symm.trans (value w hw)⟩ - · rintro ⟨x, hx, equal⟩ - obtain ⟨w, hw, rfl⟩ := - (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).1 (subset hx) - exact ⟨w, hw, hx, (value w hw).trans equal.symm⟩ - -theorem eval_refinementNaturalMap (D : NameDomain s) (H : ConditionFilter P) - (generic : H.GenericFor (atomicFamily D)) - (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) - (hU : U ∈ D.names) (hRf : Rf ∈ D.names) (hRc : Rc ∈ D.names) - (terms : ∀ w : Name s, w.val ∈ T → w ∈ D.names) - (pairs : ∀ z w : Name s, z.val ∈ T → w.val ∈ T → orderedPair ⊤ z w ∈ D.names) - (subset : eval {p | H.mem p} U ⊆ eval {p | H.mem p} (familySet ⊤ T valid)) - (fine : eval {p | H.mem p} Rf ⊆ ZFSet.prod (eval {p | H.mem p} U) (eval {p | H.mem p} U)) - (coarse : eval {p | H.mem p} Rc ⊆ ZFSet.prod (eval {p | H.mem p} U) (eval {p | H.mem p} U)) : - eval {p | H.mem p} (refinementNaturalMap T valid U Rf Rc) = - refinementQuotientMap (eval {p | H.mem p} U) (eval {p | H.mem p} Rf) (eval {p | H.mem p} Rc) := by - have value (w : Name s) (hw : w.val ∈ T) : - eval {p | H.mem p} (orderedPair ⊤ (refinementClass T valid Rf w) (refinementClass T valid Rc w)) = - ZFSet.pair (equivalenceClass (eval {p | H.mem p} U) (eval {p | H.mem p} Rf) (eval {p | H.mem p} w)) - (equivalenceClass (eval {p | H.mem p} U) (eval {p | H.mem p} Rc) (eval {p | H.mem p} w)) := by - rw [eval_orderedPair {p | H.mem p} ⊤ H.top_mem, - eval_refinementClass D H generic T valid Rf w hRf (fun z hz => pairs z w hz hw), - eval_refinementClass D H generic T valid Rc w hRc (fun z hz => pairs z w hz hw), - equivalenceClass_eq_of_carrier_subset subset fine, - equivalenceClass_eq_of_carrier_subset subset coarse] - apply ZFSet.ext - intro z - rw [refinementNaturalMap, mem_eval_activeImage D H generic T valid U _ hU terms, - mem_refinementQuotientMap] - constructor - · rintro ⟨w, hw, active, equal⟩ - exact ⟨eval {p | H.mem p} w, active, equal.symm.trans (value w hw)⟩ - · rintro ⟨x, hx, equal⟩ - obtain ⟨w, hw, rfl⟩ := - (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).1 (subset hx) - exact ⟨w, hw, hx, (value w hw).trans equal.symm⟩ - -end Name - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.Name -open SetRealization Compression.RecursiveMaps -universe u v -variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} -variable {G : Type v} [Group G] (a : PosetAction G P) -variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -include closed - -theorem act_refinementQuotient (g : G) (U R : Name s) : - a.act s g (refinementQuotient T valid U R) = - refinementQuotient T valid (a.act s g U) (a.act s g R) := by - apply act_activeImage a T valid closed g U - intro w _ - exact act_refinementClass a T valid closed g R w - -theorem act_refinementNaturalMap (g : G) (U Rf Rc : Name s) : - a.act s g (refinementNaturalMap T valid U Rf Rc) = - refinementNaturalMap T valid (a.act s g U) (a.act s g Rf) (a.act s g Rc) := by - apply act_activeImage a T valid closed g U - intro w _ - change rename s (a.iso g) (orderedPair ⊤ _ _) = _ - rw [rename_orderedPair, (a.iso g).map_top] - change orderedPair ⊤ (a.act s g (refinementClass T valid Rf w)) - (a.act s g (refinementClass T valid Rc w)) = _ - rw [act_refinementClass a T valid closed, act_refinementClass a T valid closed] - -theorem refinementQuotient_support (U R : Name s) (K : Subgroup G) - (activity : K ≤ a.stabilizer s U) (relation : K ≤ a.stabilizer s R) : - K ≤ a.stabilizer s (refinementQuotient T valid U R) := by - intro g hg - change a.act s g _ = _ - rw [act_refinementQuotient a T valid closed, activity hg, relation hg] - -theorem refinementNaturalMap_support (U Rf Rc : Name s) (K : Subgroup G) - (activity : K ≤ a.stabilizer s U) (fine : K ≤ a.stabilizer s Rf) - (coarse : K ≤ a.stabilizer s Rc) : - K ≤ a.stabilizer s (refinementNaturalMap T valid U Rf Rc) := by - intro g hg - change a.act s g _ = _ - rw [act_refinementNaturalMap a T valid closed, activity hg, fine hg, coarse hg] - -theorem refinementClass_hs_of_hs (F : NormalSubgroupFamily G) - (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F w) - (R w : Name s) (relation : HereditarilySymmetric a s F R) - (representative : HereditarilySymmetric a s F w) : - HereditarilySymmetric a s F (refinementClass T valid R w) := - refinementClass_hs a F T valid closed children R w - (a.stabilizer s R ⊓ a.stabilizer s w) (F.inf relation.symmetric representative.symmetric) - (fun _ hg => hg.1) (fun _ hg => hg.2) - -theorem refinementQuotient_hs (F : NormalSubgroupFamily G) - (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F w) - (U R : Name s) (activity : HereditarilySymmetric a s F U) - (relation : HereditarilySymmetric a s F R) : - HereditarilySymmetric a s F (refinementQuotient T valid U R) := by - refine HereditarilySymmetric.mk - (F.upward (F.inf activity.symmetric relation.symmetric) - (refinementQuotient_support a T valid closed U R - (a.stabilizer s U ⊓ a.stabilizer s R) (fun _ hg => hg.1) (fun _ hg => hg.2))) ?_ - intro σ p entry - obtain ⟨w, hw, _, rfl⟩ := (entry_refinementQuotient T valid U R σ p).1 entry - exact refinementClass_hs_of_hs a T valid closed F children R w relation (children w hw) - -theorem refinementNaturalMap_hs (F : NormalSubgroupFamily G) - (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F w) - (U Rf Rc : Name s) (activity : HereditarilySymmetric a s F U) - (fine : HereditarilySymmetric a s F Rf) (coarse : HereditarilySymmetric a s F Rc) : - HereditarilySymmetric a s F (refinementNaturalMap T valid U Rf Rc) := by - refine HereditarilySymmetric.mk - (F.upward (F.inf activity.symmetric (F.inf fine.symmetric coarse.symmetric)) - (refinementNaturalMap_support a T valid closed U Rf Rc - (a.stabilizer s U ⊓ (a.stabilizer s Rf ⊓ a.stabilizer s Rc)) - (fun _ hg => hg.1) (fun _ hg => hg.2.1) (fun _ hg => hg.2.2))) ?_ - intro σ p entry - obtain ⟨w, hw, _, rfl⟩ := (entry_refinementNaturalMap T valid U Rf Rc σ p).1 entry - exact (refinementClass_hs_of_hs a T valid closed F children Rf w fine (children w hw)).orderedPair - (refinementClass_hs_of_hs a T valid closed F children Rc w coarse (children w hw)) - -end PartitionPilot.Forcing.Name - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - -include pairing unions powers separation collection carrier order in -theorem refinementQuotient_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U R : Name s) - (hU : U.val ∈ M.sets) (hR : R.val ∈ M.sets) : - (Name.refinementQuotient T valid U R).val ∈ M.sets := - M.activeImage_mem s pairing unions powers separation collection carrier order hT valid U hU - (Name.refinementClass T valid R) (Name.refinementClassGraph T valid R T valid) - (M.refinementClassGraph_mem s pairing unions powers separation collection carrier order - hT hT valid valid R hR) - (Name.pair_mem_refinementClassGraph T valid R T valid) - -include pairing unions powers separation collection carrier order in -theorem refinementNaturalMap_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) - (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) - (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) : - (Name.refinementNaturalMap T valid U Rf Rc).val ∈ M.sets := - M.activeImage_mem s pairing unions powers separation collection carrier order hT valid U hU - (fun w => Name.orderedPair ⊤ (Name.refinementClass T valid Rf w) (Name.refinementClass T valid Rc w)) - (Name.refinementPairClassGraph T valid Rf Rc T valid) - (M.refinementPairClassGraph_mem s pairing unions powers separation collection carrier order - hT hT valid valid Rf Rc hRf hRc) - (Name.pair_mem_refinementPairClassGraph T valid Rf Rc T valid) - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs +import OAI.SetTheory.PartitionPrinciple.Forcing.ActiveNameImageSymmetry +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedClassInclusions + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def refinementQuotientMap (U Rf Rc : ZFSet.{u}) : ZFSet.{u} := + relationCompose (equivalenceClasses U Rf) U (equivalenceClasses U Rc) + (relationConverse U (equivalenceClasses U Rf) (equivalenceClassifier U Rf)) + (equivalenceClassifier U Rc) + +theorem refinementQuotientMap_subset (U Rf Rc : ZFSet.{u}) : + refinementQuotientMap U Rf Rc ⊆ + ZFSet.prod (equivalenceClasses U Rf) (equivalenceClasses U Rc) := by + intro z hz + rw [refinementQuotientMap, relationCompose, ZFSet.mem_sep] at hz + exact hz.1 + +theorem pair_mem_refinementQuotientMap (U Rf Rc C D : ZFSet.{u}) : + ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc ↔ + ∃ x ∈ U, C = equivalenceClass U Rf x ∧ D = equivalenceClass U Rc x := by + rw [refinementQuotientMap, pair_mem_relationCompose] + constructor + · rintro ⟨_, _, x, hx, first, second⟩ + exact ⟨x, hx, + ((pair_mem_equivalenceClassifier U Rf x C).1 + ((pair_mem_relationConverse _ _ _ x C).1 first).2.2).2, + ((pair_mem_equivalenceClassifier U Rc x D).1 second).2⟩ + · rintro ⟨x, hx, rfl, rfl⟩ + have hf := equivalenceClass_mem (E := Rf) hx + have hc := equivalenceClass_mem (E := Rc) hx + exact ⟨hf, hc, x, hx, (pair_mem_relationConverse _ _ _ x _).2 + ⟨hx, hf, (pair_mem_equivalenceClassifier U Rf x _).2 ⟨hx, rfl⟩⟩, + (pair_mem_equivalenceClassifier U Rc x _).2 ⟨hx, rfl⟩⟩ + +theorem mem_refinementQuotientMap (U Rf Rc z : ZFSet.{u}) : + z ∈ refinementQuotientMap U Rf Rc ↔ + ∃ x ∈ U, z = ZFSet.pair (equivalenceClass U Rf x) (equivalenceClass U Rc x) := by + constructor + · intro hz + obtain ⟨C, _, D, _, rfl⟩ := ZFSet.mem_prod.1 (refinementQuotientMap_subset U Rf Rc hz) + obtain ⟨x, hx, rfl, rfl⟩ := (pair_mem_refinementQuotientMap U Rf Rc C D).1 hz + exact ⟨x, hx, rfl⟩ + · rintro ⟨x, hx, rfl⟩ + exact (pair_mem_refinementQuotientMap U Rf Rc _ _).2 ⟨x, hx, rfl, rfl⟩ + +theorem refinementQuotientMap_class_entry {U Rf Rc x : ZFSet.{u}} (hx : x ∈ U) : + ZFSet.pair (equivalenceClass U Rf x) (equivalenceClass U Rc x) ∈ + refinementQuotientMap U Rf Rc := + (pair_mem_refinementQuotientMap U Rf Rc _ _).2 ⟨x, hx, rfl, rfl⟩ + +theorem equivalenceClass_refinement_subset {U Rf Rc x : ZFSet.{u}} + (refinement : Rf ⊆ Rc) : equivalenceClass U Rf x ⊆ equivalenceClass U Rc x := by + intro y hy + obtain ⟨hy, related⟩ := (mem_equivalenceClass U Rf x y).1 hy + exact (mem_equivalenceClass U Rc x y).2 ⟨hy, refinement related⟩ + +theorem refinementQuotientMap_value_iff {U Rf Rc x D : ZFSet.{u}} + (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) + (refinement : Rf ⊆ Rc) (hx : x ∈ U) : + ZFSet.pair (equivalenceClass U Rf x) D ∈ refinementQuotientMap U Rf Rc ↔ + D = equivalenceClass U Rc x := by + constructor + · intro entry + obtain ⟨y, hy, equal, rfl⟩ := + (pair_mem_refinementQuotientMap U Rf Rc _ D).1 entry + exact ((coarse.class_eq_iff hx hy).2 + (refinement ((fine.class_eq_iff hx hy).1 equal))).symm + · rintro rfl + exact refinementQuotientMap_class_entry hx + +theorem refinementQuotientMap_function {U Rf Rc : ZFSet.{u}} + (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) + (refinement : Rf ⊆ Rc) : + ZFSet.IsFunc (equivalenceClasses U Rf) (equivalenceClasses U Rc) + (refinementQuotientMap U Rf Rc) := by + refine ⟨refinementQuotientMap_subset U Rf Rc, ?_⟩ + intro C hC + obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClasses U Rf C).1 hC + exact ⟨equivalenceClass U Rc x, refinementQuotientMap_class_entry hx, + fun D entry => (refinementQuotientMap_value_iff fine coarse refinement hx).1 entry⟩ + +theorem refinementQuotientMap_onto {U Rf Rc D : ZFSet.{u}} + (hD : D ∈ equivalenceClasses U Rc) : + ∃ C ∈ equivalenceClasses U Rf, ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc := by + obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClasses U Rc D).1 hD + exact ⟨equivalenceClass U Rf x, equivalenceClass_mem hx, + refinementQuotientMap_class_entry hx⟩ + +theorem refinementQuotientMap_entry_iff_subset {U Rf Rc C D : ZFSet.{u}} + (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) + (refinement : Rf ⊆ Rc) : + ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc ↔ + C ∈ equivalenceClasses U Rf ∧ D ∈ equivalenceClasses U Rc ∧ C ⊆ D := by + constructor + · intro entry + obtain ⟨x, hx, rfl, rfl⟩ := (pair_mem_refinementQuotientMap U Rf Rc C D).1 entry + exact ⟨equivalenceClass_mem hx, equivalenceClass_mem hx, + equivalenceClass_refinement_subset refinement⟩ + · rintro ⟨hC, hD, subset⟩ + obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClasses U Rf C).1 hC + obtain ⟨y, hy, rfl⟩ := (mem_equivalenceClasses U Rc D).1 hD + have related := ((mem_equivalenceClass U Rc y x).1 (subset (fine.class_self hx))).2 + exact (refinementQuotientMap_value_iff fine coarse refinement hx).2 + ((coarse.class_eq_iff hx hy).2 related).symm + +theorem refinementQuotientMap_member_value {U Rf Rc C D x : ZFSet.{u}} + (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) + (refinement : Rf ⊆ Rc) (entry : ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc) + (hx : x ∈ C) : D = equivalenceClass U Rc x := by + obtain ⟨y, hy, rfl, rfl⟩ := (pair_mem_refinementQuotientMap U Rf Rc C D).1 entry + obtain ⟨hx, xy⟩ := (mem_equivalenceClass U Rf y x).1 hx + have classEqual := (fine.class_eq_iff hx hy).2 xy + exact (refinementQuotientMap_value_iff fine coarse refinement hx).1 + (classEqual.symm ▸ refinementQuotientMap_class_entry (Rf := Rf) (Rc := Rc) hy) + +theorem refinementQuotientMap_triangle {U Rf Rc : ZFSet.{u}} + (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) + (refinement : Rf ⊆ Rc) : + relationCompose U (equivalenceClasses U Rf) (equivalenceClasses U Rc) + (equivalenceClassifier U Rf) (refinementQuotientMap U Rf Rc) = + equivalenceClassifier U Rc := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, C, _, D, _, rfl, first, second⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz + have equal := ((pair_mem_equivalenceClassifier U Rf x C).1 first).2 + subst C + exact (pair_mem_equivalenceClassifier U Rc x D).2 + ⟨hx, (refinementQuotientMap_value_iff fine coarse refinement hx).1 second⟩ + · intro hz + obtain ⟨x, hx, rfl⟩ := (mem_equivalenceClassifier U Rc z).1 hz + exact (pair_mem_relationCompose _ _ _ _ _ x _).2 + ⟨hx, equivalenceClass_mem hx, equivalenceClass U Rf x, equivalenceClass_mem hx, + (pair_mem_equivalenceClassifier U Rf x _).2 ⟨hx, rfl⟩, + refinementQuotientMap_class_entry hx⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u + +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem refinementQuotientMap_mem + {U Rf Rc : ZFSet.{u}} (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) : + refinementQuotientMap U Rf Rc ∈ M.sets := by + have fineClasses := M.equivalenceClasses_mem powers separation hU hf + have coarseClasses := M.equivalenceClasses_mem powers separation hU hc + have fineClassifier := M.equivalenceClassifier_mem pairing unions + powers separation hU hf + have coarseClassifier := M.equivalenceClassifier_mem pairing unions + powers separation hU hc + have converse := M.relationConverse_mem pairing unions powers + separation hU fineClasses fineClassifier + exact M.relationCompose_mem pairing unions powers separation + fineClasses hU coarseClasses converse coarseClassifier + +theorem refinementQuotientMap_spec + {U Rf Rc : ZFSet.{u}} (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) + (fine : EquivalenceRelationCode U Rf) (coarse : EquivalenceRelationCode U Rc) + (refinement : Rf ⊆ Rc) : + equivalenceClasses U Rf ∈ M.sets ∧ equivalenceClasses U Rc ∈ M.sets ∧ + refinementQuotientMap U Rf Rc ∈ M.sets ∧ + ZFSet.IsFunc (equivalenceClasses U Rf) (equivalenceClasses U Rc) + (refinementQuotientMap U Rf Rc) ∧ + (∀ D ∈ equivalenceClasses U Rc, ∃ C ∈ equivalenceClasses U Rf, + ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc) ∧ + (∀ C D, ZFSet.pair C D ∈ refinementQuotientMap U Rf Rc ↔ + C ∈ equivalenceClasses U Rf ∧ D ∈ equivalenceClasses U Rc ∧ C ⊆ D) := + ⟨M.equivalenceClasses_mem powers separation hU hf, + M.equivalenceClasses_mem powers separation hU hc, + M.refinementQuotientMap_mem pairing unions powers separation hU hf hc, + refinementQuotientMap_function fine coarse refinement, + fun _ hD => refinementQuotientMap_onto hD, + fun _ _ => refinementQuotientMap_entry_iff_subset fine coarse refinement⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +theorem equivalenceClass_eq_of_carrier_subset {T U R : ZFSet.{u}} + (subset : U ⊆ T) (shape : R ⊆ ZFSet.prod U U) (x : ZFSet.{u}) : + equivalenceClass T R x = equivalenceClass U R x := by + apply ZFSet.ext + intro y + rw [mem_equivalenceClass, mem_equivalenceClass] + exact ⟨fun h => ⟨(ZFSet.pair_mem_prod.1 (shape h.2)).1, h.2⟩, + fun h => ⟨subset h.1, h.2⟩⟩ + +namespace Name +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} + +noncomputable def refinementQuotient (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U R : Name s) : Name s := + activeImage T valid U (refinementClass T valid R) + +noncomputable def refinementNaturalMap (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U Rf Rc : Name s) : Name s := + activeImage T valid U (fun w => + orderedPair ⊤ (refinementClass T valid Rf w) (refinementClass T valid Rc w)) + +theorem entry_refinementQuotient (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U R σ : Name s) (p : P) : + Entry σ (refinementQuotient T valid U R) p ↔ + ∃ w : Name s, w.val ∈ T ∧ ForcesMem p w U ∧ refinementClass T valid R w = σ := + entry_activeImage T valid U _ σ p + +theorem entry_refinementNaturalMap (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (U Rf Rc σ : Name s) (p : P) : + Entry σ (refinementNaturalMap T valid U Rf Rc) p ↔ + ∃ w : Name s, w.val ∈ T ∧ ForcesMem p w U ∧ + orderedPair ⊤ (refinementClass T valid Rf w) (refinementClass T valid Rc w) = σ := + entry_activeImage T valid U _ σ p + +theorem eval_refinementQuotient (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (U R : Name s) + (hU : U ∈ D.names) (hR : R ∈ D.names) + (terms : ∀ w : Name s, w.val ∈ T → w ∈ D.names) + (pairs : ∀ z w : Name s, z.val ∈ T → w.val ∈ T → orderedPair ⊤ z w ∈ D.names) + (subset : eval {p | H.mem p} U ⊆ eval {p | H.mem p} (familySet ⊤ T valid)) + (shape : eval {p | H.mem p} R ⊆ ZFSet.prod (eval {p | H.mem p} U) (eval {p | H.mem p} U)) : + eval {p | H.mem p} (refinementQuotient T valid U R) = + equivalenceClasses (eval {p | H.mem p} U) (eval {p | H.mem p} R) := by + have value (w : Name s) (hw : w.val ∈ T) := + (eval_refinementClass D H generic T valid R w hR (fun z hz => pairs z w hz hw)).trans + (equivalenceClass_eq_of_carrier_subset subset shape (eval {p | H.mem p} w)) + apply ZFSet.ext + intro C + rw [refinementQuotient, mem_eval_activeImage D H generic T valid U _ hU terms, + mem_equivalenceClasses] + constructor + · rintro ⟨w, hw, active, equal⟩ + exact ⟨eval {p | H.mem p} w, active, equal.symm.trans (value w hw)⟩ + · rintro ⟨x, hx, equal⟩ + obtain ⟨w, hw, rfl⟩ := + (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).1 (subset hx) + exact ⟨w, hw, hx, (value w hw).trans equal.symm⟩ + +theorem eval_refinementNaturalMap (D : NameDomain s) (H : ConditionFilter P) + (generic : H.GenericFor (atomicFamily D)) + (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) + (hU : U ∈ D.names) (hRf : Rf ∈ D.names) (hRc : Rc ∈ D.names) + (terms : ∀ w : Name s, w.val ∈ T → w ∈ D.names) + (pairs : ∀ z w : Name s, z.val ∈ T → w.val ∈ T → orderedPair ⊤ z w ∈ D.names) + (subset : eval {p | H.mem p} U ⊆ eval {p | H.mem p} (familySet ⊤ T valid)) + (fine : eval {p | H.mem p} Rf ⊆ ZFSet.prod (eval {p | H.mem p} U) (eval {p | H.mem p} U)) + (coarse : eval {p | H.mem p} Rc ⊆ ZFSet.prod (eval {p | H.mem p} U) (eval {p | H.mem p} U)) : + eval {p | H.mem p} (refinementNaturalMap T valid U Rf Rc) = + refinementQuotientMap (eval {p | H.mem p} U) (eval {p | H.mem p} Rf) (eval {p | H.mem p} Rc) := by + have value (w : Name s) (hw : w.val ∈ T) : + eval {p | H.mem p} (orderedPair ⊤ (refinementClass T valid Rf w) (refinementClass T valid Rc w)) = + ZFSet.pair (equivalenceClass (eval {p | H.mem p} U) (eval {p | H.mem p} Rf) (eval {p | H.mem p} w)) + (equivalenceClass (eval {p | H.mem p} U) (eval {p | H.mem p} Rc) (eval {p | H.mem p} w)) := by + rw [eval_orderedPair {p | H.mem p} ⊤ H.top_mem, + eval_refinementClass D H generic T valid Rf w hRf (fun z hz => pairs z w hz hw), + eval_refinementClass D H generic T valid Rc w hRc (fun z hz => pairs z w hz hw), + equivalenceClass_eq_of_carrier_subset subset fine, + equivalenceClass_eq_of_carrier_subset subset coarse] + apply ZFSet.ext + intro z + rw [refinementNaturalMap, mem_eval_activeImage D H generic T valid U _ hU terms, + mem_refinementQuotientMap] + constructor + · rintro ⟨w, hw, active, equal⟩ + exact ⟨eval {p | H.mem p} w, active, equal.symm.trans (value w hw)⟩ + · rintro ⟨x, hx, equal⟩ + obtain ⟨w, hw, rfl⟩ := + (mem_eval_familySet {p | H.mem p} ⊤ H.top_mem T valid x).1 (subset hx) + exact ⟨w, hw, hx, (value w hw).trans equal.symm⟩ + +end Name + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.Name +open SetRealization Compression.RecursiveMaps +universe u v +variable {P : Type u} [PartialOrder P] [OrderTop P] {s : Presentation P} +variable {G : Type v} [Group G] (a : PosetAction G P) +variable (T : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +include closed + +theorem act_refinementQuotient (g : G) (U R : Name s) : + a.act s g (refinementQuotient T valid U R) = + refinementQuotient T valid (a.act s g U) (a.act s g R) := by + apply act_activeImage a T valid closed g U + intro w _ + exact act_refinementClass a T valid closed g R w + +theorem act_refinementNaturalMap (g : G) (U Rf Rc : Name s) : + a.act s g (refinementNaturalMap T valid U Rf Rc) = + refinementNaturalMap T valid (a.act s g U) (a.act s g Rf) (a.act s g Rc) := by + apply act_activeImage a T valid closed g U + intro w _ + change rename s (a.iso g) (orderedPair ⊤ _ _) = _ + rw [rename_orderedPair, (a.iso g).map_top] + change orderedPair ⊤ (a.act s g (refinementClass T valid Rf w)) + (a.act s g (refinementClass T valid Rc w)) = _ + rw [act_refinementClass a T valid closed, act_refinementClass a T valid closed] + +theorem refinementQuotient_support (U R : Name s) (K : Subgroup G) + (activity : K ≤ a.stabilizer s U) (relation : K ≤ a.stabilizer s R) : + K ≤ a.stabilizer s (refinementQuotient T valid U R) := by + intro g hg + change a.act s g _ = _ + rw [act_refinementQuotient a T valid closed, activity hg, relation hg] + +theorem refinementNaturalMap_support (U Rf Rc : Name s) (K : Subgroup G) + (activity : K ≤ a.stabilizer s U) (fine : K ≤ a.stabilizer s Rf) + (coarse : K ≤ a.stabilizer s Rc) : + K ≤ a.stabilizer s (refinementNaturalMap T valid U Rf Rc) := by + intro g hg + change a.act s g _ = _ + rw [act_refinementNaturalMap a T valid closed, activity hg, fine hg, coarse hg] + +theorem refinementClass_hs_of_hs (F : NormalSubgroupFamily G) + (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F w) + (R w : Name s) (relation : HereditarilySymmetric a s F R) + (representative : HereditarilySymmetric a s F w) : + HereditarilySymmetric a s F (refinementClass T valid R w) := + refinementClass_hs a F T valid closed children R w + (a.stabilizer s R ⊓ a.stabilizer s w) (F.inf relation.symmetric representative.symmetric) + (fun _ hg => hg.1) (fun _ hg => hg.2) + +theorem refinementQuotient_hs (F : NormalSubgroupFamily G) + (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F w) + (U R : Name s) (activity : HereditarilySymmetric a s F U) + (relation : HereditarilySymmetric a s F R) : + HereditarilySymmetric a s F (refinementQuotient T valid U R) := by + refine HereditarilySymmetric.mk + (F.upward (F.inf activity.symmetric relation.symmetric) + (refinementQuotient_support a T valid closed U R + (a.stabilizer s U ⊓ a.stabilizer s R) (fun _ hg => hg.1) (fun _ hg => hg.2))) ?_ + intro σ p entry + obtain ⟨w, hw, _, rfl⟩ := (entry_refinementQuotient T valid U R σ p).1 entry + exact refinementClass_hs_of_hs a T valid closed F children R w relation (children w hw) + +theorem refinementNaturalMap_hs (F : NormalSubgroupFamily G) + (children : ∀ w : Name s, w.val ∈ T → HereditarilySymmetric a s F w) + (U Rf Rc : Name s) (activity : HereditarilySymmetric a s F U) + (fine : HereditarilySymmetric a s F Rf) (coarse : HereditarilySymmetric a s F Rc) : + HereditarilySymmetric a s F (refinementNaturalMap T valid U Rf Rc) := by + refine HereditarilySymmetric.mk + (F.upward (F.inf activity.symmetric (F.inf fine.symmetric coarse.symmetric)) + (refinementNaturalMap_support a T valid closed U Rf Rc + (a.stabilizer s U ⊓ (a.stabilizer s Rf ⊓ a.stabilizer s Rc)) + (fun _ hg => hg.1) (fun _ hg => hg.2.1) (fun _ hg => hg.2.2))) ?_ + intro σ p entry + obtain ⟨w, hw, _, rfl⟩ := (entry_refinementNaturalMap T valid U Rf Rc σ p).1 entry + exact (refinementClass_hs_of_hs a T valid closed F children Rf w fine (children w hw)).orderedPair + (refinementClass_hs_of_hs a T valid closed F children Rc w coarse (children w hw)) + +end PartitionPilot.Forcing.Name + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + +include pairing unions powers separation collection carrier order in +theorem refinementQuotient_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U R : Name s) + (hU : U.val ∈ M.sets) (hR : R.val ∈ M.sets) : + (Name.refinementQuotient T valid U R).val ∈ M.sets := + M.activeImage_mem s pairing unions powers separation collection carrier order hT valid U hU + (Name.refinementClass T valid R) (Name.refinementClassGraph T valid R T valid) + (M.refinementClassGraph_mem s pairing unions powers separation collection carrier order + hT hT valid valid R hR) + (Name.pair_mem_refinementClassGraph T valid R T valid) + +include pairing unions powers separation collection carrier order in +theorem refinementNaturalMap_mem {T : ZFSet.{u}} (hT : T ∈ M.sets) + (valid : ∀ z ∈ T, IsName s z) (U Rf Rc : Name s) + (hU : U.val ∈ M.sets) (hRf : Rf.val ∈ M.sets) (hRc : Rc.val ∈ M.sets) : + (Name.refinementNaturalMap T valid U Rf Rc).val ∈ M.sets := + M.activeImage_mem s pairing unions powers separation collection carrier order hT valid U hU + (fun w => Name.orderedPair ⊤ (Name.refinementClass T valid Rf w) (Name.refinementClass T valid Rc w)) + (Name.refinementPairClassGraph T valid Rf Rc T valid) + (M.refinementPairClassGraph_mem s pairing unions powers separation collection carrier order + hT hT valid valid Rf Rc hRf hRc) + (Name.pair_mem_refinementPairClassGraph T valid Rf Rc T valid) + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRowCoverPartitionPrinciple.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRowCoverPartitionPrinciple.lean index fa6718c50e06dc9b8ec37d8af215c2f1ba5fb15e..2343f6fcbaa90433fa6b8cf10c22199320bfca23 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRowCoverPartitionPrinciple.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundRowCoverPartitionPrinciple.lean @@ -1,250 +1,250 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedClassInclusions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPartialCoverPartitions -import OAI.SetTheory.PartitionPrinciple.Models.GroundOrdinalPartitionInjectionAssembly - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (N : TransitiveGround.{u}) - -theorem function_kernel_quotient - (zf : ZFRealization N.sets) {U V f : ZFSet.{u}} - (hU : U ∈ N.sets) (hV : V ∈ N.sets) (hf : f ∈ N.sets) - (function : ZFSet.IsFunc U V f) - (onto : ∀ x ∈ V, ∃ u ∈ U, ZFSet.pair u x ∈ f) : - ∃ R ∈ N.sets, EquivalenceRelationCode U R ∧ - (∀ u v, ZFSet.pair u v ∈ R ↔ u ∈ U ∧ v ∈ U ∧ - ∃ x ∈ V, ZFSet.pair u x ∈ f ∧ ZFSet.pair v x ∈ f) ∧ - ∃ a ∈ N.sets, InjectionCode (equivalenceClasses U R) V a ∧ - (∀ x ∈ V, ∃ C ∈ equivalenceClasses U R, ZFSet.pair C x ∈ a) ∧ - (∀ u x, ZFSet.pair u x ∈ f → - ZFSet.pair (equivalenceClass U R u) x ∈ a) := by - have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 - have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 - have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 - let inverse := relationConverse U V f - let R := relationCompose U V U f inverse - have inverseGround := N.relationConverse_mem pairing unions powers zf.2.1 hU hV hf - have hR : R ∈ N.sets := - N.relationCompose_mem pairing unions powers zf.2.1 hU hV hU hf inverseGround - have entries (u v : ZFSet.{u}) : ZFSet.pair u v ∈ R ↔ u ∈ U ∧ v ∈ U ∧ - ∃ x ∈ V, ZFSet.pair u x ∈ f ∧ ZFSet.pair v x ∈ f := by - simp only [R, inverse, pair_mem_relationCompose, pair_mem_relationConverse] - exact ⟨fun ⟨hu, hv, x, hx, ux, _, _, vx⟩ => ⟨hu, hv, x, hx, ux, vx⟩, - fun ⟨hu, hv, x, hx, ux, vx⟩ => ⟨hu, hv, x, hx, ux, hv, hx, vx⟩⟩ - have unique {u x y : ZFSet.{u}} (ux : ZFSet.pair u x ∈ f) - (uy : ZFSet.pair u y ∈ f) : x = y := by - obtain ⟨v, _, unique⟩ := function.2 u (ZFSet.pair_mem_prod.1 (function.1 ux)).1 - exact (unique x ux).trans (unique y uy).symm - have equivalence : EquivalenceRelationCode U R := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_, ?_, ?_⟩ - · intro u hu - obtain ⟨x, ux, _⟩ := function.2 u hu - exact (entries u u).2 ⟨hu, hu, x, (ZFSet.pair_mem_prod.1 (function.1 ux)).2, ux, ux⟩ - · intro u v uv - obtain ⟨hu, hv, x, hx, ux, vx⟩ := (entries u v).1 uv - exact (entries v u).2 ⟨hv, hu, x, hx, vx, ux⟩ - · intro u v w uv vw - obtain ⟨hu, _, x, hx, ux, vx⟩ := (entries u v).1 uv - obtain ⟨_, hw, y, _, vy, wy⟩ := (entries v w).1 vw - exact (entries u w).2 ⟨hu, hw, x, hx, ux, (unique vy vx) ▸ wy⟩ - let Q := equivalenceClasses U R - let classifier := equivalenceClassifier U R - let backward := relationConverse U Q classifier - let a := relationCompose Q U V backward f - have hQ : Q ∈ N.sets := N.equivalenceClasses_mem powers zf.2.1 hU hR - have hClassifier : classifier ∈ N.sets := - N.equivalenceClassifier_mem pairing unions powers zf.2.1 hU hR - have hBackward : backward ∈ N.sets := - N.relationConverse_mem pairing unions powers zf.2.1 hU hQ hClassifier - have ha : a ∈ N.sets := N.relationCompose_mem pairing unions powers zf.2.1 hQ hU hV hBackward hf - have aEntries (C x : ZFSet.{u}) : ZFSet.pair C x ∈ a ↔ - C ∈ Q ∧ x ∈ V ∧ ∃ u ∈ U, C = equivalenceClass U R u ∧ ZFSet.pair u x ∈ f := by - change ZFSet.pair C x ∈ relationCompose Q U V backward f ↔ _ - rw [pair_mem_relationCompose] - constructor - · rintro ⟨hC, hx, u, hu, cu, ux⟩ - have uc := (pair_mem_relationConverse U Q classifier u C).1 cu - have equal := (pair_mem_equivalenceClassifier U R u C).1 uc.2.2 - exact ⟨hC, hx, u, hu, equal.2, ux⟩ - · rintro ⟨hC, hx, u, hu, equal, ux⟩ - exact ⟨hC, hx, u, hu, (pair_mem_relationConverse U Q classifier u C).2 - ⟨hu, hC, (pair_mem_equivalenceClassifier U R u C).2 ⟨hu, equal⟩⟩, ux⟩ - have canonical (u x : ZFSet.{u}) (ux : ZFSet.pair u x ∈ f) : - ZFSet.pair (equivalenceClass U R u) x ∈ a := by - obtain ⟨hu, hx⟩ := ZFSet.pair_mem_prod.1 (function.1 ux) - exact (aEntries _ x).2 ⟨Forcing.equivalenceClass_mem hu, hx, u, hu, rfl, ux⟩ - have injection : InjectionCode Q V a := by - refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ - · intro C hC - obtain ⟨u, hu, rfl⟩ := (mem_equivalenceClasses U R C).1 hC - obtain ⟨x, ux, _⟩ := function.2 u hu - refine ⟨x, canonical u x ux, ?_⟩ - intro y cy - obtain ⟨_, _, v, hv, equal, vy⟩ := (aEntries _ y).1 cy - obtain ⟨_, _, z, _, uz, vz⟩ := (entries u v).1 ((equivalence.class_eq_iff hu hv).1 equal) - exact (unique vy vz).trans (unique uz ux) - · intro C D x cx dx - obtain ⟨_, hx, u, hu, rfl, ux⟩ := (aEntries C x).1 cx - obtain ⟨_, _, v, hv, rfl, vx⟩ := (aEntries D x).1 dx - exact (equivalence.class_eq_iff hu hv).2 ((entries u v).2 ⟨hu, hv, x, hx, ux, vx⟩) - refine ⟨R, hR, equivalence, entries, a, ha, injection, ?_, canonical⟩ - intro x hx - obtain ⟨u, hu, ux⟩ := onto x hx - exact ⟨equivalenceClass U R u, Forcing.equivalenceClass_mem hu, canonical u x ux⟩ - -theorem partialCover_quotient_injection - (zf : ZFRealization N.sets) {T B X Y X' Y' h f : ZFSet.{u}} - (quotientInjection : ∀ U ∈ N.sets, ∀ Rf ∈ N.sets, ∀ Rc ∈ N.sets, - RefinementValidityCode T U Rf Rc → - N.groundEmbeddable (equivalenceClasses U Rc) (equivalenceClasses U Rf)) - (hT : T ∈ N.sets) (_hX : X ∈ N.sets) (_hY : Y ∈ N.sets) - (hX' : X' ∈ N.sets) (hY' : Y' ∈ N.sets) (hh : h ∈ N.sets) (hf : f ∈ N.sets) - (partialCode : PartialFunctionCode T B h) (function : ZFSet.IsFunc X Y f) - (sourceSubset : X' ⊆ X) (_targetSubset : Y' ⊆ Y) - (maps : ∀ x ∈ X', ∀ y, ZFSet.pair x y ∈ f → y ∈ Y') - (onto : ∀ y ∈ Y', ∃ x ∈ X', ZFSet.pair x y ∈ f) - (covered : ∀ x ∈ X', ∃ u ∈ T, ZFSet.pair u x ∈ h) : - N.groundEmbeddable Y' X' := by - have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 - have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 - have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 - let inverse := relationConverse T X' h - let U := relationImage X' T inverse - have hInverse : inverse ∈ N.sets := - N.relationConverse_mem pairing unions powers zf.2.1 hT hX' hh - have hU : U ∈ N.sets := N.relationImage_mem zf.2.1 hX' hT hInverse - have uEntries (u : ZFSet.{u}) : u ∈ U ↔ u ∈ T ∧ ∃ x ∈ X', ZFSet.pair u x ∈ h := by - simp only [U, inverse, mem_relationImage, pair_mem_relationConverse] - exact ⟨fun ⟨hu, x, hx, _, _, ux⟩ => ⟨hu, x, hx, ux⟩, - fun ⟨hu, x, hx, ux⟩ => ⟨hu, x, hx, hu, hx, ux⟩⟩ - let h' := ZFSet.sep (fun z => z ∈ ZFSet.prod U X') h - have hh' : h' ∈ N.sets := N.injection_restriction_mem zf.2.1 hU hX' hh - have hEntries (u x : ZFSet.{u}) : ZFSet.pair u x ∈ h' ↔ - ZFSet.pair u x ∈ h ∧ u ∈ U ∧ x ∈ X' := by - exact ZFSet.mem_sep.trans (and_congr_right fun _ => ZFSet.pair_mem_prod) - have hFunction : ZFSet.IsFunc U X' h' := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ - intro u hu - obtain ⟨_, x, hx, ux⟩ := (uEntries u).1 hu - exact ⟨x, (hEntries u x).2 ⟨ux, hu, hx⟩, - fun y uy => partialCode.unique u y x ((hEntries u y).1 uy).1 ux⟩ - have hOnto : ∀ x ∈ X', ∃ u ∈ U, ZFSet.pair u x ∈ h' := by - intro x hx - obtain ⟨u, hu, ux⟩ := covered x hx - have member := (uEntries u).2 ⟨hu, x, hx, ux⟩ - exact ⟨u, member, (hEntries u x).2 ⟨ux, member, hx⟩⟩ - let f' := ZFSet.sep (fun z => z ∈ ZFSet.prod X' Y') f - have hf' : f' ∈ N.sets := N.injection_restriction_mem zf.2.1 hX' hY' hf - have fEntries (x y : ZFSet.{u}) : ZFSet.pair x y ∈ f' ↔ - ZFSet.pair x y ∈ f ∧ x ∈ X' ∧ y ∈ Y' := by - exact ZFSet.mem_sep.trans (and_congr_right fun _ => ZFSet.pair_mem_prod) - have fFunction : ZFSet.IsFunc X' Y' f' := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ - intro x hx - obtain ⟨y, xy, unique⟩ := function.2 x (sourceSubset hx) - exact ⟨y, (fEntries x y).2 ⟨xy, hx, maps x hx y xy⟩, - fun z xz => unique z ((fEntries x z).1 xz).1⟩ - let g := relationCompose U X' Y' h' f' - have hg : g ∈ N.sets := N.relationCompose_mem pairing unions powers zf.2.1 hU hX' hY' hh' hf' - have gFunction : ZFSet.IsFunc U Y' g := - relationCompose_function_of_subset hFunction fFunction (fun _ hx => hx) - have gOnto : ∀ y ∈ Y', ∃ u ∈ U, ZFSet.pair u y ∈ g := by - intro y hy - obtain ⟨x, hx, xy⟩ := onto y hy - obtain ⟨u, hu, ux⟩ := hOnto x hx - exact ⟨u, hu, (pair_mem_relationCompose U X' Y' h' f' u y).2 - ⟨hu, hy, x, hx, ux, (fEntries x y).2 ⟨xy, hx, hy⟩⟩⟩ - obtain ⟨Rf, hRf, fine, fineEntries, a, ha, aInjection, _aOnto, _aCanonical⟩ := - N.function_kernel_quotient zf hU hX' hh' hFunction hOnto - obtain ⟨Rc, hRc, coarse, coarseEntries, b, hb, bInjection, bOnto, _bCanonical⟩ := - N.function_kernel_quotient zf hU hY' hg gFunction gOnto - have refines : Rf ⊆ Rc := by - intro z hz - obtain ⟨u, hu, v, hv, rfl⟩ := ZFSet.mem_prod.1 (fine.shape hz) - obtain ⟨_, _, x, hx, ux, vx⟩ := (fineEntries u v).1 hz - obtain ⟨y, xy, _⟩ := fFunction.2 x hx - have hy := (ZFSet.pair_mem_prod.1 (fFunction.1 xy)).2 - exact (coarseEntries u v).2 ⟨hu, hv, y, hy, - (pair_mem_relationCompose U X' Y' h' f' u y).2 ⟨hu, hy, x, hx, ux, xy⟩, - (pair_mem_relationCompose U X' Y' h' f' v y).2 ⟨hv, hy, x, hx, vx, xy⟩⟩ - obtain ⟨ell, hEll, ellInjection⟩ := quotientInjection U hU Rf hRf Rc hRc - ⟨fun u hu => ((uEntries u).1 hu).1, fine, coarse, refines⟩ - have fineGround := N.equivalenceClasses_mem powers zf.2.1 hU hRf - have coarseGround := N.equivalenceClasses_mem powers zf.2.1 hU hRc - have imageEq : relationImage (equivalenceClasses U Rc) Y' b = Y' := by - apply ZFSet.ext - intro y - rw [mem_relationImage] - exact ⟨And.left, fun hy => ⟨hy, bOnto y hy⟩⟩ - have inverseInjection : InjectionCode Y' (equivalenceClasses U Rc) - (relationConverse (equivalenceClasses U Rc) Y' b) := by - have inverse := bInjection.converse_image - rw [imageEq] at inverse - exact inverse - have inverseGround := N.relationConverse_mem pairing unions powers zf.2.1 coarseGround hY' hb - let first := relationCompose Y' (equivalenceClasses U Rc) (equivalenceClasses U Rf) - (relationConverse (equivalenceClasses U Rc) Y' b) ell - have firstGround : first ∈ N.sets := N.relationCompose_mem pairing unions powers zf.2.1 - hY' coarseGround fineGround inverseGround hEll - exact ⟨relationCompose Y' (equivalenceClasses U Rf) X' first a, - N.relationCompose_mem pairing unions powers zf.2.1 hY' fineGround hX' firstGround ha, - (inverseInjection.compose ellInjection).compose aInjection⟩ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (N : TransitiveGround.{u}) - -theorem partitionPrinciple_of_rowCover_quotients - (zf : ZFRealization N.sets) {T : ZFSet.{u}} (hT : T ∈ N.sets) - (acwo : ∀ delta ∈ N.sets, ordinalSetProperty delta → - ∀ z ∈ N.sets, FunctionGraphOn delta z → - (∀ beta A, ZFSet.pair beta A ∈ z → A.Nonempty) → - ∃ c ∈ N.sets, FunctionGraphOn delta c ∧ - ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ c → x ∈ A) - (rowCover : ∀ X ∈ N.sets, ∃ delta ∈ N.sets, ordinalSetProperty delta ∧ - ∃ h ∈ N.sets, FunctionGraphOn delta h ∧ - (∀ i hi, ZFSet.pair i hi ∈ h → PartialFunctionCode T (⋃₀ ⋃₀ hi) hi) ∧ - ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ - ∃ u ∈ T, ZFSet.pair u x ∈ hi) - (quotientInjection : ∀ U ∈ N.sets, ∀ Rf ∈ N.sets, ∀ Rc ∈ N.sets, - RefinementValidityCode T U Rf Rc → - N.groundEmbeddable (equivalenceClasses U Rc) (equivalenceClasses U Rf)) : - ∀ X ∈ N.sets, ∀ Y ∈ N.sets, ∀ f ∈ N.sets, ZFSet.IsFunc X Y f → - (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → N.groundEmbeddable Y X := by - intro X hX Y hY f hf function onto - obtain ⟨delta, hDelta, ordinal, h, hh, family, partials, cover⟩ := rowCover X hX - obtain ⟨full, _hFull, p, hp, q, hq, fullFunction, pFunction, qFunction, - bounds, coverY, disjointY, disjointX, pieces⟩ := - N.partialCover_ordinal_partitions zf hDelta ordinal hT hX hY hh hf family function onto cover - apply N.ordinalPartition_injection_assembly zf acwo hDelta ordinal hY hX hp hq - pFunction qFunction bounds coverY disjointY disjointX - intro i hi U V ip iq - obtain ⟨g, ig⟩ := family.total hi - obtain ⟨A, iA⟩ := fullFunction.total hi - obtain ⟨_original, _least, _source, _hRestrict, restrictFunction, restrictOnto, covered⟩ := - pieces i g A U V ig iA ip iq - have hU : U ∈ N.sets := N.pair_right (N.transitive hp ip) - have hV : V ∈ N.sets := N.pair_right (N.transitive hq iq) - have hg : g ∈ N.sets := N.pair_right (N.transitive hh ig) - apply N.partialCover_quotient_injection zf quotientInjection hT hX hY hV hU hg hf - (partials i g ig) function (bounds i U V ip iq).2 (bounds i U V ip iq).1 - · intro x hx y xy - exact (ZFSet.pair_mem_prod.1 (restrictFunction.1 - (pair_mem_graphRestriction.2 ⟨xy, hx⟩))).2 - · intro y hy - obtain ⟨x, hx, xy⟩ := restrictOnto y hy - exact ⟨x, hx, (pair_mem_graphRestriction.1 xy).1⟩ - · exact covered - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementValidityCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedClassInclusions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPartialCoverPartitions +import OAI.SetTheory.PartitionPrinciple.Models.GroundOrdinalPartitionInjectionAssembly + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (N : TransitiveGround.{u}) + +theorem function_kernel_quotient + (zf : ZFRealization N.sets) {U V f : ZFSet.{u}} + (hU : U ∈ N.sets) (hV : V ∈ N.sets) (hf : f ∈ N.sets) + (function : ZFSet.IsFunc U V f) + (onto : ∀ x ∈ V, ∃ u ∈ U, ZFSet.pair u x ∈ f) : + ∃ R ∈ N.sets, EquivalenceRelationCode U R ∧ + (∀ u v, ZFSet.pair u v ∈ R ↔ u ∈ U ∧ v ∈ U ∧ + ∃ x ∈ V, ZFSet.pair u x ∈ f ∧ ZFSet.pair v x ∈ f) ∧ + ∃ a ∈ N.sets, InjectionCode (equivalenceClasses U R) V a ∧ + (∀ x ∈ V, ∃ C ∈ equivalenceClasses U R, ZFSet.pair C x ∈ a) ∧ + (∀ u x, ZFSet.pair u x ∈ f → + ZFSet.pair (equivalenceClass U R u) x ∈ a) := by + have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 + have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 + have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 + let inverse := relationConverse U V f + let R := relationCompose U V U f inverse + have inverseGround := N.relationConverse_mem pairing unions powers zf.2.1 hU hV hf + have hR : R ∈ N.sets := + N.relationCompose_mem pairing unions powers zf.2.1 hU hV hU hf inverseGround + have entries (u v : ZFSet.{u}) : ZFSet.pair u v ∈ R ↔ u ∈ U ∧ v ∈ U ∧ + ∃ x ∈ V, ZFSet.pair u x ∈ f ∧ ZFSet.pair v x ∈ f := by + simp only [R, inverse, pair_mem_relationCompose, pair_mem_relationConverse] + exact ⟨fun ⟨hu, hv, x, hx, ux, _, _, vx⟩ => ⟨hu, hv, x, hx, ux, vx⟩, + fun ⟨hu, hv, x, hx, ux, vx⟩ => ⟨hu, hv, x, hx, ux, hv, hx, vx⟩⟩ + have unique {u x y : ZFSet.{u}} (ux : ZFSet.pair u x ∈ f) + (uy : ZFSet.pair u y ∈ f) : x = y := by + obtain ⟨v, _, unique⟩ := function.2 u (ZFSet.pair_mem_prod.1 (function.1 ux)).1 + exact (unique x ux).trans (unique y uy).symm + have equivalence : EquivalenceRelationCode U R := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_, ?_, ?_⟩ + · intro u hu + obtain ⟨x, ux, _⟩ := function.2 u hu + exact (entries u u).2 ⟨hu, hu, x, (ZFSet.pair_mem_prod.1 (function.1 ux)).2, ux, ux⟩ + · intro u v uv + obtain ⟨hu, hv, x, hx, ux, vx⟩ := (entries u v).1 uv + exact (entries v u).2 ⟨hv, hu, x, hx, vx, ux⟩ + · intro u v w uv vw + obtain ⟨hu, _, x, hx, ux, vx⟩ := (entries u v).1 uv + obtain ⟨_, hw, y, _, vy, wy⟩ := (entries v w).1 vw + exact (entries u w).2 ⟨hu, hw, x, hx, ux, (unique vy vx) ▸ wy⟩ + let Q := equivalenceClasses U R + let classifier := equivalenceClassifier U R + let backward := relationConverse U Q classifier + let a := relationCompose Q U V backward f + have hQ : Q ∈ N.sets := N.equivalenceClasses_mem powers zf.2.1 hU hR + have hClassifier : classifier ∈ N.sets := + N.equivalenceClassifier_mem pairing unions powers zf.2.1 hU hR + have hBackward : backward ∈ N.sets := + N.relationConverse_mem pairing unions powers zf.2.1 hU hQ hClassifier + have ha : a ∈ N.sets := N.relationCompose_mem pairing unions powers zf.2.1 hQ hU hV hBackward hf + have aEntries (C x : ZFSet.{u}) : ZFSet.pair C x ∈ a ↔ + C ∈ Q ∧ x ∈ V ∧ ∃ u ∈ U, C = equivalenceClass U R u ∧ ZFSet.pair u x ∈ f := by + change ZFSet.pair C x ∈ relationCompose Q U V backward f ↔ _ + rw [pair_mem_relationCompose] + constructor + · rintro ⟨hC, hx, u, hu, cu, ux⟩ + have uc := (pair_mem_relationConverse U Q classifier u C).1 cu + have equal := (pair_mem_equivalenceClassifier U R u C).1 uc.2.2 + exact ⟨hC, hx, u, hu, equal.2, ux⟩ + · rintro ⟨hC, hx, u, hu, equal, ux⟩ + exact ⟨hC, hx, u, hu, (pair_mem_relationConverse U Q classifier u C).2 + ⟨hu, hC, (pair_mem_equivalenceClassifier U R u C).2 ⟨hu, equal⟩⟩, ux⟩ + have canonical (u x : ZFSet.{u}) (ux : ZFSet.pair u x ∈ f) : + ZFSet.pair (equivalenceClass U R u) x ∈ a := by + obtain ⟨hu, hx⟩ := ZFSet.pair_mem_prod.1 (function.1 ux) + exact (aEntries _ x).2 ⟨Forcing.equivalenceClass_mem hu, hx, u, hu, rfl, ux⟩ + have injection : InjectionCode Q V a := by + refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ + · intro C hC + obtain ⟨u, hu, rfl⟩ := (mem_equivalenceClasses U R C).1 hC + obtain ⟨x, ux, _⟩ := function.2 u hu + refine ⟨x, canonical u x ux, ?_⟩ + intro y cy + obtain ⟨_, _, v, hv, equal, vy⟩ := (aEntries _ y).1 cy + obtain ⟨_, _, z, _, uz, vz⟩ := (entries u v).1 ((equivalence.class_eq_iff hu hv).1 equal) + exact (unique vy vz).trans (unique uz ux) + · intro C D x cx dx + obtain ⟨_, hx, u, hu, rfl, ux⟩ := (aEntries C x).1 cx + obtain ⟨_, _, v, hv, rfl, vx⟩ := (aEntries D x).1 dx + exact (equivalence.class_eq_iff hu hv).2 ((entries u v).2 ⟨hu, hv, x, hx, ux, vx⟩) + refine ⟨R, hR, equivalence, entries, a, ha, injection, ?_, canonical⟩ + intro x hx + obtain ⟨u, hu, ux⟩ := onto x hx + exact ⟨equivalenceClass U R u, Forcing.equivalenceClass_mem hu, canonical u x ux⟩ + +theorem partialCover_quotient_injection + (zf : ZFRealization N.sets) {T B X Y X' Y' h f : ZFSet.{u}} + (quotientInjection : ∀ U ∈ N.sets, ∀ Rf ∈ N.sets, ∀ Rc ∈ N.sets, + RefinementValidityCode T U Rf Rc → + N.groundEmbeddable (equivalenceClasses U Rc) (equivalenceClasses U Rf)) + (hT : T ∈ N.sets) (_hX : X ∈ N.sets) (_hY : Y ∈ N.sets) + (hX' : X' ∈ N.sets) (hY' : Y' ∈ N.sets) (hh : h ∈ N.sets) (hf : f ∈ N.sets) + (partialCode : PartialFunctionCode T B h) (function : ZFSet.IsFunc X Y f) + (sourceSubset : X' ⊆ X) (_targetSubset : Y' ⊆ Y) + (maps : ∀ x ∈ X', ∀ y, ZFSet.pair x y ∈ f → y ∈ Y') + (onto : ∀ y ∈ Y', ∃ x ∈ X', ZFSet.pair x y ∈ f) + (covered : ∀ x ∈ X', ∃ u ∈ T, ZFSet.pair u x ∈ h) : + N.groundEmbeddable Y' X' := by + have pairing : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 + have unions : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 + have powers : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 + let inverse := relationConverse T X' h + let U := relationImage X' T inverse + have hInverse : inverse ∈ N.sets := + N.relationConverse_mem pairing unions powers zf.2.1 hT hX' hh + have hU : U ∈ N.sets := N.relationImage_mem zf.2.1 hX' hT hInverse + have uEntries (u : ZFSet.{u}) : u ∈ U ↔ u ∈ T ∧ ∃ x ∈ X', ZFSet.pair u x ∈ h := by + simp only [U, inverse, mem_relationImage, pair_mem_relationConverse] + exact ⟨fun ⟨hu, x, hx, _, _, ux⟩ => ⟨hu, x, hx, ux⟩, + fun ⟨hu, x, hx, ux⟩ => ⟨hu, x, hx, hu, hx, ux⟩⟩ + let h' := ZFSet.sep (fun z => z ∈ ZFSet.prod U X') h + have hh' : h' ∈ N.sets := N.injection_restriction_mem zf.2.1 hU hX' hh + have hEntries (u x : ZFSet.{u}) : ZFSet.pair u x ∈ h' ↔ + ZFSet.pair u x ∈ h ∧ u ∈ U ∧ x ∈ X' := by + exact ZFSet.mem_sep.trans (and_congr_right fun _ => ZFSet.pair_mem_prod) + have hFunction : ZFSet.IsFunc U X' h' := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ + intro u hu + obtain ⟨_, x, hx, ux⟩ := (uEntries u).1 hu + exact ⟨x, (hEntries u x).2 ⟨ux, hu, hx⟩, + fun y uy => partialCode.unique u y x ((hEntries u y).1 uy).1 ux⟩ + have hOnto : ∀ x ∈ X', ∃ u ∈ U, ZFSet.pair u x ∈ h' := by + intro x hx + obtain ⟨u, hu, ux⟩ := covered x hx + have member := (uEntries u).2 ⟨hu, x, hx, ux⟩ + exact ⟨u, member, (hEntries u x).2 ⟨ux, member, hx⟩⟩ + let f' := ZFSet.sep (fun z => z ∈ ZFSet.prod X' Y') f + have hf' : f' ∈ N.sets := N.injection_restriction_mem zf.2.1 hX' hY' hf + have fEntries (x y : ZFSet.{u}) : ZFSet.pair x y ∈ f' ↔ + ZFSet.pair x y ∈ f ∧ x ∈ X' ∧ y ∈ Y' := by + exact ZFSet.mem_sep.trans (and_congr_right fun _ => ZFSet.pair_mem_prod) + have fFunction : ZFSet.IsFunc X' Y' f' := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ + intro x hx + obtain ⟨y, xy, unique⟩ := function.2 x (sourceSubset hx) + exact ⟨y, (fEntries x y).2 ⟨xy, hx, maps x hx y xy⟩, + fun z xz => unique z ((fEntries x z).1 xz).1⟩ + let g := relationCompose U X' Y' h' f' + have hg : g ∈ N.sets := N.relationCompose_mem pairing unions powers zf.2.1 hU hX' hY' hh' hf' + have gFunction : ZFSet.IsFunc U Y' g := + relationCompose_function_of_subset hFunction fFunction (fun _ hx => hx) + have gOnto : ∀ y ∈ Y', ∃ u ∈ U, ZFSet.pair u y ∈ g := by + intro y hy + obtain ⟨x, hx, xy⟩ := onto y hy + obtain ⟨u, hu, ux⟩ := hOnto x hx + exact ⟨u, hu, (pair_mem_relationCompose U X' Y' h' f' u y).2 + ⟨hu, hy, x, hx, ux, (fEntries x y).2 ⟨xy, hx, hy⟩⟩⟩ + obtain ⟨Rf, hRf, fine, fineEntries, a, ha, aInjection, _aOnto, _aCanonical⟩ := + N.function_kernel_quotient zf hU hX' hh' hFunction hOnto + obtain ⟨Rc, hRc, coarse, coarseEntries, b, hb, bInjection, bOnto, _bCanonical⟩ := + N.function_kernel_quotient zf hU hY' hg gFunction gOnto + have refines : Rf ⊆ Rc := by + intro z hz + obtain ⟨u, hu, v, hv, rfl⟩ := ZFSet.mem_prod.1 (fine.shape hz) + obtain ⟨_, _, x, hx, ux, vx⟩ := (fineEntries u v).1 hz + obtain ⟨y, xy, _⟩ := fFunction.2 x hx + have hy := (ZFSet.pair_mem_prod.1 (fFunction.1 xy)).2 + exact (coarseEntries u v).2 ⟨hu, hv, y, hy, + (pair_mem_relationCompose U X' Y' h' f' u y).2 ⟨hu, hy, x, hx, ux, xy⟩, + (pair_mem_relationCompose U X' Y' h' f' v y).2 ⟨hv, hy, x, hx, vx, xy⟩⟩ + obtain ⟨ell, hEll, ellInjection⟩ := quotientInjection U hU Rf hRf Rc hRc + ⟨fun u hu => ((uEntries u).1 hu).1, fine, coarse, refines⟩ + have fineGround := N.equivalenceClasses_mem powers zf.2.1 hU hRf + have coarseGround := N.equivalenceClasses_mem powers zf.2.1 hU hRc + have imageEq : relationImage (equivalenceClasses U Rc) Y' b = Y' := by + apply ZFSet.ext + intro y + rw [mem_relationImage] + exact ⟨And.left, fun hy => ⟨hy, bOnto y hy⟩⟩ + have inverseInjection : InjectionCode Y' (equivalenceClasses U Rc) + (relationConverse (equivalenceClasses U Rc) Y' b) := by + have inverse := bInjection.converse_image + rw [imageEq] at inverse + exact inverse + have inverseGround := N.relationConverse_mem pairing unions powers zf.2.1 coarseGround hY' hb + let first := relationCompose Y' (equivalenceClasses U Rc) (equivalenceClasses U Rf) + (relationConverse (equivalenceClasses U Rc) Y' b) ell + have firstGround : first ∈ N.sets := N.relationCompose_mem pairing unions powers zf.2.1 + hY' coarseGround fineGround inverseGround hEll + exact ⟨relationCompose Y' (equivalenceClasses U Rf) X' first a, + N.relationCompose_mem pairing unions powers zf.2.1 hY' fineGround hX' firstGround ha, + (inverseInjection.compose ellInjection).compose aInjection⟩ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (N : TransitiveGround.{u}) + +theorem partitionPrinciple_of_rowCover_quotients + (zf : ZFRealization N.sets) {T : ZFSet.{u}} (hT : T ∈ N.sets) + (acwo : ∀ delta ∈ N.sets, ordinalSetProperty delta → + ∀ z ∈ N.sets, FunctionGraphOn delta z → + (∀ beta A, ZFSet.pair beta A ∈ z → A.Nonempty) → + ∃ c ∈ N.sets, FunctionGraphOn delta c ∧ + ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ c → x ∈ A) + (rowCover : ∀ X ∈ N.sets, ∃ delta ∈ N.sets, ordinalSetProperty delta ∧ + ∃ h ∈ N.sets, FunctionGraphOn delta h ∧ + (∀ i hi, ZFSet.pair i hi ∈ h → PartialFunctionCode T (⋃₀ ⋃₀ hi) hi) ∧ + ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ + ∃ u ∈ T, ZFSet.pair u x ∈ hi) + (quotientInjection : ∀ U ∈ N.sets, ∀ Rf ∈ N.sets, ∀ Rc ∈ N.sets, + RefinementValidityCode T U Rf Rc → + N.groundEmbeddable (equivalenceClasses U Rc) (equivalenceClasses U Rf)) : + ∀ X ∈ N.sets, ∀ Y ∈ N.sets, ∀ f ∈ N.sets, ZFSet.IsFunc X Y f → + (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → N.groundEmbeddable Y X := by + intro X hX Y hY f hf function onto + obtain ⟨delta, hDelta, ordinal, h, hh, family, partials, cover⟩ := rowCover X hX + obtain ⟨full, _hFull, p, hp, q, hq, fullFunction, pFunction, qFunction, + bounds, coverY, disjointY, disjointX, pieces⟩ := + N.partialCover_ordinal_partitions zf hDelta ordinal hT hX hY hh hf family function onto cover + apply N.ordinalPartition_injection_assembly zf acwo hDelta ordinal hY hX hp hq + pFunction qFunction bounds coverY disjointY disjointX + intro i hi U V ip iq + obtain ⟨g, ig⟩ := family.total hi + obtain ⟨A, iA⟩ := fullFunction.total hi + obtain ⟨_original, _least, _source, _hRestrict, restrictFunction, restrictOnto, covered⟩ := + pieces i g A U V ig iA ip iq + have hU : U ∈ N.sets := N.pair_right (N.transitive hp ip) + have hV : V ∈ N.sets := N.pair_right (N.transitive hq iq) + have hg : g ∈ N.sets := N.pair_right (N.transitive hh ig) + apply N.partialCover_quotient_injection zf quotientInjection hT hX hY hV hU hg hf + (partials i g ig) function (bounds i U V ip iq).2 (bounds i U V ip iq).1 + · intro x hx y xy + exact (ZFSet.pair_mem_prod.1 (restrictFunction.1 + (pair_mem_graphRestriction.2 ⟨xy, hx⟩))).2 + · intro y hy + obtain ⟨x, hx, xy⟩ := restrictOnto y hy + exact ⟨x, hx, (pair_mem_graphRestriction.1 xy).1⟩ + · exact covered + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSuccessorInjections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSuccessorInjections.lean index 3c1fae5a307d1d4d2a19986293909d2c16c57e21..0bc314ff9d5b0d7abf822d51bdae48090b5eff09 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSuccessorInjections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSuccessorInjections.lean @@ -1,235 +1,235 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalNumbers - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -theorem setSuccessor_injective : Function.Injective (fun x : ZFSet.{u} => insert x x) := by - intro x y eq - change insert x x = insert y y at eq - have xy : x = y ∨ x ∈ y := ZFSet.mem_insert_iff.1 (eq ▸ ZFSet.mem_insert x x) - have yx : y = x ∨ y ∈ x := ZFSet.mem_insert_iff.1 (eq.symm ▸ ZFSet.mem_insert y y) - rcases xy with eq | xy - · exact eq - · rcases yx with eq | yx - · exact eq.symm - · exact False.elim (ZFSet.mem_asymm xy yx) - -theorem setSuccessor_ne_empty (x : ZFSet.{u}) : insert x x ≠ (∅ : ZFSet.{u}) := by - intro eq - exact ZFSet.notMem_empty x (eq ▸ ZFSet.mem_insert x x) - -noncomputable def shiftedInjectionGraph (D f : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ D, ∃ n ∈ ZFSet.omega, - z = ZFSet.pair x (insert n n) ∧ ZFSet.pair x n ∈ f) (ZFSet.prod D ZFSet.omega) - -theorem mem_shiftedInjectionGraph (D f z : ZFSet.{u}) : - z ∈ shiftedInjectionGraph D f ↔ ∃ x ∈ D, ∃ n ∈ ZFSet.omega, - z = ZFSet.pair x (insert n n) ∧ ZFSet.pair x n ∈ f := by - rw [shiftedInjectionGraph, ZFSet.mem_sep] - constructor - · exact And.right - · intro h - obtain ⟨x, hx, n, hn, eq, rel⟩ := h - exact ⟨eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.omega_succ hn⟩, - x, hx, n, hn, eq, rel⟩ - -theorem pair_mem_shiftedInjectionGraph (D f x y : ZFSet.{u}) : - ZFSet.pair x y ∈ shiftedInjectionGraph D f ↔ - x ∈ D ∧ ∃ n ∈ ZFSet.omega, y = insert n n ∧ ZFSet.pair x n ∈ f := by - rw [mem_shiftedInjectionGraph] - constructor - · rintro ⟨a, ha, n, hn, eq, rel⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨ha, n, hn, rfl, rel⟩ - · rintro ⟨hx, n, hn, rfl, rel⟩ - exact ⟨x, hx, n, hn, rfl, rel⟩ - -theorem shiftedInjectionGraph_no_zero (D f x : ZFSet.{u}) : - ZFSet.pair x ∅ ∉ shiftedInjectionGraph D f := by - intro rel - obtain ⟨_, n, _, eq, _⟩ := (pair_mem_shiftedInjectionGraph D f x ∅).1 rel - exact setSuccessor_ne_empty n eq.symm - -namespace InjectionCode - -theorem shift {D f : ZFSet.{u}} (h : InjectionCode D ZFSet.omega f) : - InjectionCode D ZFSet.omega (shiftedInjectionGraph D f) := by - refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ - · intro x hx - obtain ⟨n, rel, unique⟩ := h.function.2 x hx - have hn := (ZFSet.pair_mem_prod.1 (h.function.1 rel)).2 - refine ⟨insert n n, (pair_mem_shiftedInjectionGraph D f x _).2 ⟨hx, n, hn, rfl, rel⟩, ?_⟩ - intro y hy - obtain ⟨_, m, _, eq, hm⟩ := (pair_mem_shiftedInjectionGraph D f x y).1 hy - rw [eq, unique m hm] - · intro x y z hx hy - obtain ⟨_, n, _, zn, xn⟩ := (pair_mem_shiftedInjectionGraph D f x z).1 hx - obtain ⟨_, m, _, zm, ym⟩ := (pair_mem_shiftedInjectionGraph D f y z).1 hy - have eq := setSuccessor_injective (zn.symm.trans zm) - exact h.injective x y m (eq ▸ xn) ym - -end InjectionCode - -noncomputable def adjoinInjectionGraph (D f a : ZFSet.{u}) : ZFSet.{u} := - insert (ZFSet.pair a ∅) (shiftedInjectionGraph D f) - -theorem pair_mem_adjoinInjectionGraph (D f a x y : ZFSet.{u}) : - ZFSet.pair x y ∈ adjoinInjectionGraph D f a ↔ - (x = a ∧ y = ∅) ∨ ZFSet.pair x y ∈ shiftedInjectionGraph D f := by - rw [adjoinInjectionGraph, ZFSet.mem_insert_iff, ZFSet.pair_inj] - -namespace InjectionCode - -theorem adjoin_fresh {D f a : ZFSet.{u}} (h : InjectionCode D ZFSet.omega f) (fresh : a ∉ D) : - InjectionCode (insert a D) ZFSet.omega (adjoinInjectionGraph D f a) := by - have shifted := h.shift - refine ⟨⟨?_, ?_⟩, ?_⟩ - · intro z hz - rcases ZFSet.mem_insert_iff.1 hz with rfl | hz - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert a D, ZFSet.omega_zero⟩ - · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shifted.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem a hx, hy⟩ - · intro x hx - rcases ZFSet.mem_insert_iff.1 hx with eq | hx - · subst x - refine ⟨∅, (pair_mem_adjoinInjectionGraph D f a a ∅).2 (Or.inl ⟨rfl, rfl⟩), ?_⟩ - intro y hy - rcases (pair_mem_adjoinInjectionGraph D f a a y).1 hy with eq | rel - · exact eq.2 - · exact False.elim (fresh ((pair_mem_shiftedInjectionGraph D f a y).1 rel).1) - · obtain ⟨y, rel, unique⟩ := shifted.function.2 x hx - refine ⟨y, (pair_mem_adjoinInjectionGraph D f a x y).2 (Or.inr rel), ?_⟩ - intro z hz - rcases (pair_mem_adjoinInjectionGraph D f a x z).1 hz with eq | rel - · exact False.elim (fresh (eq.1 ▸ hx)) - · exact unique z rel - · intro x y z hx hy - rcases (pair_mem_adjoinInjectionGraph D f a x z).1 hx with eqx | shiftx - · rcases (pair_mem_adjoinInjectionGraph D f a y z).1 hy with eqy | shifty - · exact eqx.1.trans eqy.1.symm - · rw [eqx.2] at shifty - exact False.elim (shiftedInjectionGraph_no_zero D f y shifty) - · rcases (pair_mem_adjoinInjectionGraph D f a y z).1 hy with eqy | shifty - · rw [eqy.2] at shiftx - exact False.elim (shiftedInjectionGraph_no_zero D f x shiftx) - · exact shifted.injective x y z shiftx shifty - -end InjectionCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def shiftedInjectionEntryFormula {n} (z d o f : Fin n) : BoundedFormula n := - exMem d (exMem o.succ (exMem o.succ.succ - (.conj (successorFormula 0 1) - (.conj (orderedPairFormula z.succ.succ.succ 2 0) - (pairMembershipFormula 2 1 f.succ.succ.succ))))) - -theorem truth_shiftedInjectionEntryFormula {n} (z d o f : Fin n) - (env : Fin n → ZFSet.{u}) (omega : env o = ZFSet.omega) : - Truth (shiftedInjectionEntryFormula z d o f) env ↔ - ∃ x ∈ env d, ∃ m ∈ ZFSet.omega, - env z = ZFSet.pair x (insert m m) ∧ ZFSet.pair x m ∈ env f := by - simp only [shiftedInjectionEntryFormula, truth_exMem, Truth, - truth_successorFormula, truth_orderedPairFormula, truth_pairMembershipFormula] - change (∃ x ∈ env d, ∃ m ∈ env o, ∃ k ∈ env o, - k = insert m m ∧ env z = ZFSet.pair x k ∧ ZFSet.pair x m ∈ env f) ↔ _ - rw [omega] - constructor - · rintro ⟨x, hx, m, hm, k, _, rfl, eq, rel⟩ - exact ⟨x, hx, m, hm, eq, rel⟩ - · rintro ⟨x, hx, m, hm, eq, rel⟩ - exact ⟨x, hx, m, hm, insert m m, ZFSet.omega_succ hm, rfl, eq, rel⟩ - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem insert_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {a D : ZFSet.{u}} (ha : a ∈ M.sets) (hD : D ∈ M.sets) : insert a D ∈ M.sets := by - have single : ({a} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ha ha - have joined := M.binary_union_mem pairing unions single hD - have eq : ({a} : ZFSet.{u}) ∪ D = insert a D := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_union, ZFSet.mem_singleton, ZFSet.mem_insert_iff] - exact eq ▸ joined - -theorem shiftedInjectionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {D f : ZFSet.{u}} (hD : D ∈ M.sets) (hf : f ∈ M.sets) : - shiftedInjectionGraph D f ∈ M.sets := by - have hO := M.omega_mem separation infinite - have bound := M.prod_mem pairing unions powers separation hD hO - let params := extend D (extend ZFSet.omega (extend f Fin.elim0)) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hD (Fin.cases hO (Fin.cases hf (fun i => Fin.elim0 i))) - have selected := M.separation_mem separation - (BoundedFormula.shiftedInjectionEntryFormula 0 1 2 3).toFormula params members bound - have eq : ZFSet.sep (fun z => Realize M.sets - (BoundedFormula.shiftedInjectionEntryFormula 0 1 2 3).toFormula (extend z params)) - (ZFSet.prod D ZFSet.omega) = shiftedInjectionGraph D f := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, shiftedInjectionGraph, ZFSet.mem_sep] - apply and_congr_right - intro hz - exact (BoundedFormula.realize_toFormula M _ _ - (Fin.cases (M.transitive bound hz) members)).trans - (BoundedFormula.truth_shiftedInjectionEntryFormula 0 1 2 3 (extend z params) rfl) - exact eq ▸ selected - -theorem adjoinInjectionGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {D f a : ZFSet.{u}} (hD : D ∈ M.sets) (hf : f ∈ M.sets) (ha : a ∈ M.sets) : - adjoinInjectionGraph D f a ∈ M.sets := - M.insert_mem pairing unions - (M.orderedPair_mem pairing ha (M.empty_mem ⟨a, ha⟩)) - (M.shiftedInjectionGraph_mem pairing unions powers separation infinite hD hf) - -theorem groundEmbeddable_insert - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {D a : ZFSet.{u}} (hD : D ∈ M.sets) (ha : a ∈ M.sets) - (small : M.groundEmbeddable D ZFSet.omega) : - M.groundEmbeddable (insert a D) ZFSet.omega := by - classical - by_cases member : a ∈ D - · have eq : insert a D = D := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_insert_iff] - exact ⟨fun h => h.elim (fun eq => eq.symm ▸ member) id, Or.inr⟩ - exact eq.symm ▸ small - · obtain ⟨f, hf, code⟩ := small - exact ⟨adjoinInjectionGraph D f a, - M.adjoinInjectionGraph_mem pairing unions powers separation infinite hD hf ha, - code.adjoin_fresh member⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalNumbers + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +theorem setSuccessor_injective : Function.Injective (fun x : ZFSet.{u} => insert x x) := by + intro x y eq + change insert x x = insert y y at eq + have xy : x = y ∨ x ∈ y := ZFSet.mem_insert_iff.1 (eq ▸ ZFSet.mem_insert x x) + have yx : y = x ∨ y ∈ x := ZFSet.mem_insert_iff.1 (eq.symm ▸ ZFSet.mem_insert y y) + rcases xy with eq | xy + · exact eq + · rcases yx with eq | yx + · exact eq.symm + · exact False.elim (ZFSet.mem_asymm xy yx) + +theorem setSuccessor_ne_empty (x : ZFSet.{u}) : insert x x ≠ (∅ : ZFSet.{u}) := by + intro eq + exact ZFSet.notMem_empty x (eq ▸ ZFSet.mem_insert x x) + +noncomputable def shiftedInjectionGraph (D f : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ D, ∃ n ∈ ZFSet.omega, + z = ZFSet.pair x (insert n n) ∧ ZFSet.pair x n ∈ f) (ZFSet.prod D ZFSet.omega) + +theorem mem_shiftedInjectionGraph (D f z : ZFSet.{u}) : + z ∈ shiftedInjectionGraph D f ↔ ∃ x ∈ D, ∃ n ∈ ZFSet.omega, + z = ZFSet.pair x (insert n n) ∧ ZFSet.pair x n ∈ f := by + rw [shiftedInjectionGraph, ZFSet.mem_sep] + constructor + · exact And.right + · intro h + obtain ⟨x, hx, n, hn, eq, rel⟩ := h + exact ⟨eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.omega_succ hn⟩, + x, hx, n, hn, eq, rel⟩ + +theorem pair_mem_shiftedInjectionGraph (D f x y : ZFSet.{u}) : + ZFSet.pair x y ∈ shiftedInjectionGraph D f ↔ + x ∈ D ∧ ∃ n ∈ ZFSet.omega, y = insert n n ∧ ZFSet.pair x n ∈ f := by + rw [mem_shiftedInjectionGraph] + constructor + · rintro ⟨a, ha, n, hn, eq, rel⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨ha, n, hn, rfl, rel⟩ + · rintro ⟨hx, n, hn, rfl, rel⟩ + exact ⟨x, hx, n, hn, rfl, rel⟩ + +theorem shiftedInjectionGraph_no_zero (D f x : ZFSet.{u}) : + ZFSet.pair x ∅ ∉ shiftedInjectionGraph D f := by + intro rel + obtain ⟨_, n, _, eq, _⟩ := (pair_mem_shiftedInjectionGraph D f x ∅).1 rel + exact setSuccessor_ne_empty n eq.symm + +namespace InjectionCode + +theorem shift {D f : ZFSet.{u}} (h : InjectionCode D ZFSet.omega f) : + InjectionCode D ZFSet.omega (shiftedInjectionGraph D f) := by + refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ + · intro x hx + obtain ⟨n, rel, unique⟩ := h.function.2 x hx + have hn := (ZFSet.pair_mem_prod.1 (h.function.1 rel)).2 + refine ⟨insert n n, (pair_mem_shiftedInjectionGraph D f x _).2 ⟨hx, n, hn, rfl, rel⟩, ?_⟩ + intro y hy + obtain ⟨_, m, _, eq, hm⟩ := (pair_mem_shiftedInjectionGraph D f x y).1 hy + rw [eq, unique m hm] + · intro x y z hx hy + obtain ⟨_, n, _, zn, xn⟩ := (pair_mem_shiftedInjectionGraph D f x z).1 hx + obtain ⟨_, m, _, zm, ym⟩ := (pair_mem_shiftedInjectionGraph D f y z).1 hy + have eq := setSuccessor_injective (zn.symm.trans zm) + exact h.injective x y m (eq ▸ xn) ym + +end InjectionCode + +noncomputable def adjoinInjectionGraph (D f a : ZFSet.{u}) : ZFSet.{u} := + insert (ZFSet.pair a ∅) (shiftedInjectionGraph D f) + +theorem pair_mem_adjoinInjectionGraph (D f a x y : ZFSet.{u}) : + ZFSet.pair x y ∈ adjoinInjectionGraph D f a ↔ + (x = a ∧ y = ∅) ∨ ZFSet.pair x y ∈ shiftedInjectionGraph D f := by + rw [adjoinInjectionGraph, ZFSet.mem_insert_iff, ZFSet.pair_inj] + +namespace InjectionCode + +theorem adjoin_fresh {D f a : ZFSet.{u}} (h : InjectionCode D ZFSet.omega f) (fresh : a ∉ D) : + InjectionCode (insert a D) ZFSet.omega (adjoinInjectionGraph D f a) := by + have shifted := h.shift + refine ⟨⟨?_, ?_⟩, ?_⟩ + · intro z hz + rcases ZFSet.mem_insert_iff.1 hz with rfl | hz + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert a D, ZFSet.omega_zero⟩ + · obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (shifted.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem a hx, hy⟩ + · intro x hx + rcases ZFSet.mem_insert_iff.1 hx with eq | hx + · subst x + refine ⟨∅, (pair_mem_adjoinInjectionGraph D f a a ∅).2 (Or.inl ⟨rfl, rfl⟩), ?_⟩ + intro y hy + rcases (pair_mem_adjoinInjectionGraph D f a a y).1 hy with eq | rel + · exact eq.2 + · exact False.elim (fresh ((pair_mem_shiftedInjectionGraph D f a y).1 rel).1) + · obtain ⟨y, rel, unique⟩ := shifted.function.2 x hx + refine ⟨y, (pair_mem_adjoinInjectionGraph D f a x y).2 (Or.inr rel), ?_⟩ + intro z hz + rcases (pair_mem_adjoinInjectionGraph D f a x z).1 hz with eq | rel + · exact False.elim (fresh (eq.1 ▸ hx)) + · exact unique z rel + · intro x y z hx hy + rcases (pair_mem_adjoinInjectionGraph D f a x z).1 hx with eqx | shiftx + · rcases (pair_mem_adjoinInjectionGraph D f a y z).1 hy with eqy | shifty + · exact eqx.1.trans eqy.1.symm + · rw [eqx.2] at shifty + exact False.elim (shiftedInjectionGraph_no_zero D f y shifty) + · rcases (pair_mem_adjoinInjectionGraph D f a y z).1 hy with eqy | shifty + · rw [eqy.2] at shiftx + exact False.elim (shiftedInjectionGraph_no_zero D f x shiftx) + · exact shifted.injective x y z shiftx shifty + +end InjectionCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def shiftedInjectionEntryFormula {n} (z d o f : Fin n) : BoundedFormula n := + exMem d (exMem o.succ (exMem o.succ.succ + (.conj (successorFormula 0 1) + (.conj (orderedPairFormula z.succ.succ.succ 2 0) + (pairMembershipFormula 2 1 f.succ.succ.succ))))) + +theorem truth_shiftedInjectionEntryFormula {n} (z d o f : Fin n) + (env : Fin n → ZFSet.{u}) (omega : env o = ZFSet.omega) : + Truth (shiftedInjectionEntryFormula z d o f) env ↔ + ∃ x ∈ env d, ∃ m ∈ ZFSet.omega, + env z = ZFSet.pair x (insert m m) ∧ ZFSet.pair x m ∈ env f := by + simp only [shiftedInjectionEntryFormula, truth_exMem, Truth, + truth_successorFormula, truth_orderedPairFormula, truth_pairMembershipFormula] + change (∃ x ∈ env d, ∃ m ∈ env o, ∃ k ∈ env o, + k = insert m m ∧ env z = ZFSet.pair x k ∧ ZFSet.pair x m ∈ env f) ↔ _ + rw [omega] + constructor + · rintro ⟨x, hx, m, hm, k, _, rfl, eq, rel⟩ + exact ⟨x, hx, m, hm, eq, rel⟩ + · rintro ⟨x, hx, m, hm, eq, rel⟩ + exact ⟨x, hx, m, hm, insert m m, ZFSet.omega_succ hm, rfl, eq, rel⟩ + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem insert_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {a D : ZFSet.{u}} (ha : a ∈ M.sets) (hD : D ∈ M.sets) : insert a D ∈ M.sets := by + have single : ({a} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ha ha + have joined := M.binary_union_mem pairing unions single hD + have eq : ({a} : ZFSet.{u}) ∪ D = insert a D := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_union, ZFSet.mem_singleton, ZFSet.mem_insert_iff] + exact eq ▸ joined + +theorem shiftedInjectionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {D f : ZFSet.{u}} (hD : D ∈ M.sets) (hf : f ∈ M.sets) : + shiftedInjectionGraph D f ∈ M.sets := by + have hO := M.omega_mem separation infinite + have bound := M.prod_mem pairing unions powers separation hD hO + let params := extend D (extend ZFSet.omega (extend f Fin.elim0)) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hD (Fin.cases hO (Fin.cases hf (fun i => Fin.elim0 i))) + have selected := M.separation_mem separation + (BoundedFormula.shiftedInjectionEntryFormula 0 1 2 3).toFormula params members bound + have eq : ZFSet.sep (fun z => Realize M.sets + (BoundedFormula.shiftedInjectionEntryFormula 0 1 2 3).toFormula (extend z params)) + (ZFSet.prod D ZFSet.omega) = shiftedInjectionGraph D f := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, shiftedInjectionGraph, ZFSet.mem_sep] + apply and_congr_right + intro hz + exact (BoundedFormula.realize_toFormula M _ _ + (Fin.cases (M.transitive bound hz) members)).trans + (BoundedFormula.truth_shiftedInjectionEntryFormula 0 1 2 3 (extend z params) rfl) + exact eq ▸ selected + +theorem adjoinInjectionGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {D f a : ZFSet.{u}} (hD : D ∈ M.sets) (hf : f ∈ M.sets) (ha : a ∈ M.sets) : + adjoinInjectionGraph D f a ∈ M.sets := + M.insert_mem pairing unions + (M.orderedPair_mem pairing ha (M.empty_mem ⟨a, ha⟩)) + (M.shiftedInjectionGraph_mem pairing unions powers separation infinite hD hf) + +theorem groundEmbeddable_insert + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {D a : ZFSet.{u}} (hD : D ∈ M.sets) (ha : a ∈ M.sets) + (small : M.groundEmbeddable D ZFSet.omega) : + M.groundEmbeddable (insert a D) ZFSet.omega := by + classical + by_cases member : a ∈ D + · have eq : insert a D = D := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_insert_iff] + exact ⟨fun h => h.elim (fun eq => eq.symm ▸ member) id, Or.inr⟩ + exact eq.symm ▸ small + · obtain ⟨f, hf, code⟩ := small + exact ⟨adjoinInjectionGraph D f a, + M.adjoinInjectionGraph_mem pairing unions powers separation infinite hD hf ha, + code.adjoin_fresh member⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSupportedEqualityChoices.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSupportedEqualityChoices.lean index 9aa37f9523a367454d25efb424462a7f517284f0..0d5199828a427f86f03085e192e7a5e274358d67 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSupportedEqualityChoices.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/GroundSupportedEqualityChoices.lean @@ -1,399 +1,399 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.SupportedCertificateRelations -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProjectedRowChooserWitnesses -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinaryCountableFunctions - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -def OrdinalChoiceValue (T e x y : ZFSet.{u}) : Prop := - ∃ i ∈ T, ZFSet.pair i y ∈ e ∧ ∀ j ∈ i, ∀ z ∈ x, ZFSet.pair j z ∉ e - -noncomputable def ordinalIndexedChoiceGraph (A T e : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ x, z = ZFSet.pair x y ∧ OrdinalChoiceValue T e x y) - (ZFSet.prod A (⋃₀ A)) - -theorem pair_mem_ordinalIndexedChoiceGraph (A T e x y : ZFSet.{u}) : - ZFSet.pair x y ∈ ordinalIndexedChoiceGraph A T e ↔ - x ∈ A ∧ y ∈ x ∧ OrdinalChoiceValue T e x y := by - rw [ordinalIndexedChoiceGraph, ZFSet.mem_sep] - constructor - · rintro ⟨_, x', hx, y', hy, eq, least⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hx, hy, least⟩ - · rintro ⟨hx, hy, least⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩⟩, - x, hx, y, hy, rfl, least⟩ - -theorem ordinalIndexedChoiceGraph_choice {A T e : ZFSet.{u}} - (ordinal : ordinalSetProperty T) (function : FunctionGraphOn T e) - (meets : ∀ x ∈ A, ∃ i ∈ T, ∃ y ∈ x, ZFSet.pair i y ∈ e) : - ChoiceFunctionCode A (ordinalIndexedChoiceGraph A T e) := by - obtain ⟨B, function⟩ := function - refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ - · intro x hx - let indices : Set ZFSet.{u} := {i | i ∈ T ∧ ∃ y ∈ x, ZFSet.pair i y ∈ e} - have inhabited : indices.Nonempty := by - obtain ⟨i, hi, y, hy, entry⟩ := meets x hx - exact ⟨i, hi, y, hy, entry⟩ - obtain ⟨i, hi, minimal⟩ := ZFSet.mem_wf.has_min indices inhabited - obtain ⟨hiT, y, hy, entry⟩ := hi - have least : OrdinalChoiceValue T e x y := by - refine ⟨i, hiT, entry, ?_⟩ - intro j hji z hz rel - exact minimal j ⟨ordinal.1 i hiT j hji, z, hz, rel⟩ hji - refine ⟨y, (pair_mem_ordinalIndexedChoiceGraph A T e x y).2 ⟨hx, hy, least⟩, ?_⟩ - intro z hz - obtain ⟨_, zx, j, hjT, jz, smaller⟩ := (pair_mem_ordinalIndexedChoiceGraph A T e x z).1 hz - rcases ordinalSetProperty_mem_compare ordinal hiT hjT with before | equal | after - · exact False.elim (smaller i before y hy entry) - · subst j - obtain ⟨v, _, unique⟩ := function.2 i hiT - exact (unique z jz).trans (unique y entry).symm - · exact False.elim (minimal j ⟨hjT, z, zx, jz⟩ after) - · intro x y entry - exact ((pair_mem_ordinalIndexedChoiceGraph A T e x y).1 entry).2.1 - -namespace BoundedFormula - -def ordinalChoiceValueFormula {n} (T e x y : Fin n) : BoundedFormula n := - exMem T (.conj (pairMembershipFormula 0 y.succ e.succ) - (allMem 0 (allMem x.succ.succ (.neg (pairMembershipFormula 1 0 e.succ.succ.succ))))) - -theorem truth_ordinalChoiceValueFormula {n} (T e x y : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (ordinalChoiceValueFormula T e x y) env ↔ - OrdinalChoiceValue (env T) (env e) (env x) (env y) := by - simp only [ordinalChoiceValueFormula, truth_exMem, Truth, truth_pairMembershipFormula] - rfl - -def ordinalIndexedChoiceEntryFormula {n} (z A T e : Fin n) : BoundedFormula n := - exMem A (exMem 0 (.conj (orderedPairFormula z.succ.succ 1 0) - (ordinalChoiceValueFormula T.succ.succ e.succ.succ 1 0))) - -theorem truth_ordinalIndexedChoiceEntryFormula {n} (z A T e : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (ordinalIndexedChoiceEntryFormula z A T e) env ↔ - ∃ x ∈ env A, ∃ y ∈ x, env z = ZFSet.pair x y ∧ OrdinalChoiceValue (env T) (env e) x y := by - simp only [ordinalIndexedChoiceEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_ordinalChoiceValueFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -theorem ordinalIndexedChoiceGraph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A T e : ZFSet.{u}} (hA : A ∈ M.sets) (hT : T ∈ M.sets) (he : e ∈ M.sets) : - ordinalIndexedChoiceGraph A T e ∈ M.sets := by - let env := extend A (extend T (extend e Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.ordinalIndexedChoiceEntryFormula 0 1 2 3) env - (Fin.cases hA (Fin.cases hT (Fin.cases he (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hA (M.union_mem unions hA)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.ordinalIndexedChoiceEntryFormula 0 1 2 3) (extend z env)) - (ZFSet.prod A (⋃₀ A)) = ordinalIndexedChoiceGraph A T e := by - apply ZFSet.ext - intro z - rw [ordinalIndexedChoiceGraph, ZFSet.mem_sep, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_ordinalIndexedChoiceEntryFormula _ _ _ _ _) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -universe u - -theorem ordinalIndexedChoiceGraph_total {F T e : ZFSet.{u}} - (ordinal : ordinalSetProperty T) - (meets : ∀ R ∈ F, ∃ i ∈ T, ∃ y ∈ R, ZFSet.pair i y ∈ e) : - ∀ R ∈ F, ∃ y ∈ ⋃₀ F, ZFSet.pair R y ∈ ordinalIndexedChoiceGraph F T e := by - intro R hR - let indices : Set ZFSet.{u} := {i | i ∈ T ∧ ∃ y ∈ R, ZFSet.pair i y ∈ e} - have inhabited : indices.Nonempty := meets R hR - obtain ⟨i, hi, minimal⟩ := ZFSet.mem_wf.has_min indices inhabited - obtain ⟨hiT, y, hy, entry⟩ := hi - refine ⟨y, ZFSet.mem_sUnion.2 ⟨R, hR, hy⟩, - (pair_mem_ordinalIndexedChoiceGraph F T e R y).2 ⟨hR, hy, i, hiT, entry, ?_⟩⟩ - intro j hji z hz stored - exact minimal j ⟨ordinal.1 i hiT j hji, z, hz, stored⟩ hji - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem exists_ordinalRelationChoice - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A T e : ZFSet.{u}} (hA : A ∈ M.sets) (hT : T ∈ M.sets) (he : e ∈ M.sets) - (ordinal : ordinalSetProperty T) - (covers : ∀ x ∈ A, ∃ i ∈ T, ZFSet.pair i x ∈ e) : - ∃ c ∈ M.sets, ChoiceFunctionCode (M.nonemptyGroundSubsets A) c ∧ - ∀ R y, ZFSet.pair R y ∈ c → OrdinalChoiceValue T e R y := by - let F := M.nonemptyGroundSubsets A - have hF : F ∈ M.sets := M.nonemptyGroundSubsets_mem powers separation hA - have meets : ∀ R ∈ F, ∃ i ∈ T, ∃ y ∈ R, ZFSet.pair i y ∈ e := by - intro R hR - obtain ⟨_, subset, y, hy⟩ := (M.mem_nonemptyGroundSubsets A R).1 hR - obtain ⟨i, hi, entry⟩ := covers y (subset hy) - exact ⟨i, hi, y, hy, entry⟩ - obtain ⟨c, hc, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice - hF (M.union_mem unions hF) - (M.ordinalIndexedChoiceGraph_mem pairing unions powers separation hF hT he) - (ordinalIndexedChoiceGraph_total ordinal meets) - refine ⟨c, hc, ⟨function, ?_⟩, ?_⟩ - · intro R y entry - exact ((pair_mem_ordinalIndexedChoiceGraph F T e R y).1 (selected entry)).2.1 - · intro R y entry - exact ((pair_mem_ordinalIndexedChoiceGraph F T e R y).1 (selected entry)).2.2 - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem choice_of_witnesses - (witnesses : ∀ A ∈ M.sets, (∀ x ∈ A, x.Nonempty) → - ∃ f ∈ M.sets, ChoiceFunctionCode A f) : - Realize M.sets SetFormula.choice Fin.elim0 := by - intro A hA - apply (realize_imp M.sets _ _ _).2 - intro premise - have nonempty : ∀ x ∈ A, x.Nonempty := by - have raw := (BoundedFormula.realize_toFormula M - (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)) - (extend A Fin.elim0) (Fin.cases hA (fun i => Fin.elim0 i))).1 premise - intro x hx - exact (BoundedFormula.truth_nonemptyFormula 0 _).1 (raw x hx) - obtain ⟨f, hf, code⟩ := witnesses A hA nonempty - apply (realize_ex M.sets _ _).2 - refine ⟨f, hf, ?_⟩ - apply (BoundedFormula.realize_toFormula M _ _ - (Fin.cases hf (Fin.cases hA (fun i => Fin.elim0 i)))).2 - exact (BoundedFormula.truth_choiceFunctionFormula 1 0 _).2 code - -variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - -include pairing unions powers separation collection infinite choice carrier order generic in -theorem ordinaryExtension_choice_witness {A : ZFSet.{u}} - (hA : A ∈ (M.ordinaryExtension s H).sets) (nonempty : ∀ x ∈ A, x.Nonempty) : - ∃ f ∈ (M.ordinaryExtension s H).sets, ChoiceFunctionCode A f := by - let N := M.ordinaryExtension s H - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic - have pairingN : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 - have unionsN : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 - have powersN : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 - have separationN : SeparationSchema N.sets := zf.2.1 - have hUnion := N.union_mem unionsN hA - obtain ⟨β, hβ, value⟩ := (M.mem_ordinaryExtension s H (⋃₀ A)).1 hUnion - have boundM := M.union_mem unions (M.union_mem unions hβ) - have poolM := M.namePool_mem s pairing unions powers separation collection carrier boundM - obtain ⟨T, hT, f, hf, ordinal, injection, onto⟩ := - M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice poolM - let function : FunctionGraphOn T f := ⟨_, injection.function⟩ - have names : ∀ i, IsName s (function.value i) := by - intro i - exact ((mem_namePool s _ _).1 - (ZFSet.pair_mem_prod.1 (injection.function.1 (function.value_entry i))).2).2 - let η := Name.indexedGraphName ⊤ function names - have hη : η ∈ (M.nameDomain s).names := - M.indexedGraphName_mem s ⊤ pairing unions powers separation collection - (M.transitive carrier (s.encode_mem ⊤)) hT hf function names - let e := Name.eval {q | H.mem q} η - have he : e ∈ N.sets := (M.mem_ordinaryExtension s H e).2 ⟨η, hη, rfl⟩ - have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H - have hTN : T ∈ N.sets := includes hT - have enumeration : FunctionGraphOn T e := - ⟨_, Name.eval_indexedGraphName_function {q | H.mem q} ⊤ H.top_mem function names⟩ - have covers := Name.indexedGraphName_covers_eval {q | H.mem q} ⊤ H.top_mem β function names onto - have meets : ∀ x ∈ A, ∃ i ∈ T, ∃ y ∈ x, ZFSet.pair i y ∈ e := by - intro x hx - obtain ⟨y, hy⟩ := nonempty x hx - have member : y ∈ Name.eval {q | H.mem q} β := by - rw [value] - exact ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩ - obtain ⟨i, hi, entry⟩ := covers y member - exact ⟨i, hi, y, hy, entry⟩ - exact ⟨ordinalIndexedChoiceGraph A T e, - N.ordinalIndexedChoiceGraph_mem pairingN unionsN powersN separationN hA hTN he, - ordinalIndexedChoiceGraph_choice ordinal enumeration meets⟩ - -include pairing unions powers separation collection infinite choice carrier order generic in -theorem ordinaryExtension_choice : - Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0 := by - apply (M.ordinaryExtension s H).choice_of_witnesses - intro A hA nonempty - exact M.ordinaryExtension_choice_witness s pairing unions powers separation collection infinite choice - carrier order H generic hA nonempty - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u v -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable {G : Type v} [Group G] - -theorem supportedNameFamily_graph_choice - (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) (carrier : s.carrier ∈ M.sets) - {W : ZFSet.{u}} (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) - (K : Subgroup G) (support : F.mem K) - (fixed : ∀ psi : Name s, psi.val ∈ W → K ≤ a.stabilizer s psi) - (children : ∀ psi : Name s, psi.val ∈ W → HereditarilySymmetric a s F psi) - (H : ConditionFilter P) (zf : ZFRealization (M.symmetricExtension s a F H).sets) - {delta z : ZFSet.{u}} - (hDelta : delta ∈ (M.symmetricExtension s a F H).sets) - (hz : z ∈ (M.symmetricExtension s a F H).sets) (function : FunctionGraphOn delta z) - (available : ∀ beta ∈ delta, ∃ psi : Name s, psi.val ∈ W ∧ - ∃ A, ZFSet.pair beta A ∈ z ∧ Name.eval {p | H.mem p} psi ∈ A) : - ∃ f ∈ (M.symmetricExtension s a F H).sets, FunctionGraphOn delta f ∧ - ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ f → x ∈ A := by - let N := M.symmetricExtension s a F H - have pairingN : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 - have unionsN : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 - have powersN : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 - have separationN : SeparationSchema N.sets := zf.2.1 - obtain ⟨T, hT, e, he, ordinal, injection, onto⟩ := - M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice hW - let enumeration : FunctionGraphOn T e := ⟨W, injection.function⟩ - have values : ∀ i, enumeration.value i ∈ W := by - intro i - exact (ZFSet.pair_mem_prod.1 (injection.function.1 (enumeration.value_entry i))).2 - have names : ∀ i, IsName s (enumeration.value i) := fun i => valid _ (values i) - have sequence := M.supportedNameSequence_function_mem s a F pairing unions powers separation - collection carrier hT he enumeration names K support - (fun g hg i => fixed ⟨enumeration.value i, names i⟩ (values i) hg) - (fun i => children ⟨enumeration.value i, names i⟩ (values i)) H - let E := Name.eval {p | H.mem p} (Name.indexedGraphName ⊤ enumeration names) - have hE : E ∈ N.sets := sequence.2.2.2.2 - have evalFunction : FunctionGraphOn T E := ⟨_, sequence.2.2.2.1⟩ - have includes := M.ground_subset_symmetricExtension s a F - pairing unions powers separation collection carrier H - have hTN : T ∈ N.sets := includes hT - let B := ⋃₀ ⋃₀ z - let A := relationImage delta B z - have hB : B ∈ N.sets := N.union_mem unionsN (N.union_mem unionsN hz) - have hA : A ∈ N.sets := N.relationImage_mem separationN hDelta hB hz - have imageEntry {beta Y : ZFSet.{u}} (edge : ZFSet.pair beta Y ∈ z) : Y ∈ A := - (mem_relationImage delta B z Y).2 - ⟨pair_second_mem_doubleUnion edge, beta, function.pair_source edge, edge⟩ - have meets : ∀ Y ∈ A, ∃ i ∈ T, ∃ x ∈ Y, ZFSet.pair i x ∈ E := by - intro Y member - obtain ⟨_bound, beta, hBeta, edge⟩ := (mem_relationImage delta B z Y).1 member - obtain ⟨psi, hPsi, Y', otherEdge, memberValue⟩ := available beta hBeta - have same : Y' = Y := function.unique otherEdge edge - rw [same] at memberValue - obtain ⟨i, hi, code⟩ := onto psi.val hPsi - let j : T.toSet := ⟨i, hi⟩ - have valueEq : enumeration.value j = psi.val := enumeration.value_eq_of_entry j code - have nameEq : (⟨enumeration.value j, names j⟩ : Name s) = psi := Subtype.ext valueEq - refine ⟨i, hi, Name.eval {p | H.mem p} psi, memberValue, ?_⟩ - exact (Name.pair_mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem - enumeration names j _).2 (congrArg (Name.eval {p | H.mem p}) nameEq) - let c := ordinalIndexedChoiceGraph A T E - have hc : c ∈ N.sets := N.ordinalIndexedChoiceGraph_mem pairingN unionsN powersN separationN hA hTN hE - have chooser : ChoiceFunctionCode A c := ordinalIndexedChoiceGraph_choice ordinal evalFunction meets - let f := relationCompose delta A (⋃₀ A) z c - have hf : f ∈ N.sets := N.relationCompose_mem pairingN unionsN powersN separationN - hDelta hA (N.union_mem unionsN hA) hz hc - have code : ZFSet.IsFunc delta (⋃₀ A) f := by - refine ⟨fun _ member => (ZFSet.mem_sep.1 member).1, ?_⟩ - intro beta hBeta - obtain ⟨Y, edge⟩ := function.total hBeta - have member := imageEntry edge - obtain ⟨x, chosen, unique⟩ := chooser.function.2 Y member - have hx := chooser.chosen Y x chosen - refine ⟨x, (pair_mem_relationCompose delta A (⋃₀ A) z c beta x).2 - ⟨hBeta, ZFSet.mem_sUnion.2 ⟨Y, member, hx⟩, Y, member, edge, chosen⟩, ?_⟩ - intro y yEdge - obtain ⟨_key, _range, Y', _member, other, picked⟩ := - (pair_mem_relationCompose delta A (⋃₀ A) z c beta y).1 yEdge - have same : Y' = Y := function.unique other edge - exact unique y (same ▸ picked) - refine ⟨f, hf, ⟨⋃₀ A, code⟩, ?_⟩ - intro beta Y x edge chosen - obtain ⟨_key, _range, Y', _member, other, picked⟩ := - (pair_mem_relationCompose delta A (⋃₀ A) z c beta x).1 chosen - have same : Y' = Y := function.unique other edge - exact same ▸ chooser.chosen Y' x picked - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] -variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) -variable (b : Presentation L) (T : ZFSet.{u}) (K : L → Subgroup G) - -theorem exists_ground_supportedEqualityChoice - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) - (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) - (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - {B : ZFSet.{u}} (hB : B ∈ M.sets) (smallB : M.groundEmbeddable B ZFSet.omega) - (subset : B ⊆ b.carrier) (z : (M.nameDomain s).names) - (visible : ∀ v : L, b.encode v ∈ B → Name.eval {p | H.mem p} z.val ∈ - Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v))) : - ∃ f ∈ M.sets, ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f ∧ - f ⊆ supportedEqualityRelation B (M.niceSupportNameCodes a s T K) - (M.niceSupportRelation a s b T K) - (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) - (Name.eval {p | H.mem p} z.val) := by - let N := M.ordinaryExtension s H - have codesGround := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation - collection carrier group nodes supports maps hT valid - have relationGround := M.supportedEqualityRelation_mem_ordinary a s b T K H t pairing unions powers - separation collection infinite carrier order group nodes supports maps hT valid genericFormula hB z - have total := M.supportedEqualityRelation_total a s b T K H subset visible - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order - infinite H genericFormula - have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite - choice carrier order H genericFormula - have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H - obtain ⟨f, hf, function, selected⟩ := N.uniformize_relation zf.1.2.2.2.1 zf.1.2.2.2.2.1 - zf.1.2.2.2.2.2.1 zf.2.1 choiceN (includes hB) (includes codesGround) relationGround total - have ground := M.ordinaryExtension_countableDomainFunction_mem s pairing unions powers separation - collection infinite choice carrier order small hB codesGround smallB closed H genericCoded - genericFormula hf function - exact ⟨f, ground, function, selected⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.SupportedCertificateRelations +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProjectedRowChooserWitnesses +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOrdinaryCountableFunctions + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +def OrdinalChoiceValue (T e x y : ZFSet.{u}) : Prop := + ∃ i ∈ T, ZFSet.pair i y ∈ e ∧ ∀ j ∈ i, ∀ z ∈ x, ZFSet.pair j z ∉ e + +noncomputable def ordinalIndexedChoiceGraph (A T e : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ x, z = ZFSet.pair x y ∧ OrdinalChoiceValue T e x y) + (ZFSet.prod A (⋃₀ A)) + +theorem pair_mem_ordinalIndexedChoiceGraph (A T e x y : ZFSet.{u}) : + ZFSet.pair x y ∈ ordinalIndexedChoiceGraph A T e ↔ + x ∈ A ∧ y ∈ x ∧ OrdinalChoiceValue T e x y := by + rw [ordinalIndexedChoiceGraph, ZFSet.mem_sep] + constructor + · rintro ⟨_, x', hx, y', hy, eq, least⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hx, hy, least⟩ + · rintro ⟨hx, hy, least⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩⟩, + x, hx, y, hy, rfl, least⟩ + +theorem ordinalIndexedChoiceGraph_choice {A T e : ZFSet.{u}} + (ordinal : ordinalSetProperty T) (function : FunctionGraphOn T e) + (meets : ∀ x ∈ A, ∃ i ∈ T, ∃ y ∈ x, ZFSet.pair i y ∈ e) : + ChoiceFunctionCode A (ordinalIndexedChoiceGraph A T e) := by + obtain ⟨B, function⟩ := function + refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩ + · intro x hx + let indices : Set ZFSet.{u} := {i | i ∈ T ∧ ∃ y ∈ x, ZFSet.pair i y ∈ e} + have inhabited : indices.Nonempty := by + obtain ⟨i, hi, y, hy, entry⟩ := meets x hx + exact ⟨i, hi, y, hy, entry⟩ + obtain ⟨i, hi, minimal⟩ := ZFSet.mem_wf.has_min indices inhabited + obtain ⟨hiT, y, hy, entry⟩ := hi + have least : OrdinalChoiceValue T e x y := by + refine ⟨i, hiT, entry, ?_⟩ + intro j hji z hz rel + exact minimal j ⟨ordinal.1 i hiT j hji, z, hz, rel⟩ hji + refine ⟨y, (pair_mem_ordinalIndexedChoiceGraph A T e x y).2 ⟨hx, hy, least⟩, ?_⟩ + intro z hz + obtain ⟨_, zx, j, hjT, jz, smaller⟩ := (pair_mem_ordinalIndexedChoiceGraph A T e x z).1 hz + rcases ordinalSetProperty_mem_compare ordinal hiT hjT with before | equal | after + · exact False.elim (smaller i before y hy entry) + · subst j + obtain ⟨v, _, unique⟩ := function.2 i hiT + exact (unique z jz).trans (unique y entry).symm + · exact False.elim (minimal j ⟨hjT, z, zx, jz⟩ after) + · intro x y entry + exact ((pair_mem_ordinalIndexedChoiceGraph A T e x y).1 entry).2.1 + +namespace BoundedFormula + +def ordinalChoiceValueFormula {n} (T e x y : Fin n) : BoundedFormula n := + exMem T (.conj (pairMembershipFormula 0 y.succ e.succ) + (allMem 0 (allMem x.succ.succ (.neg (pairMembershipFormula 1 0 e.succ.succ.succ))))) + +theorem truth_ordinalChoiceValueFormula {n} (T e x y : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (ordinalChoiceValueFormula T e x y) env ↔ + OrdinalChoiceValue (env T) (env e) (env x) (env y) := by + simp only [ordinalChoiceValueFormula, truth_exMem, Truth, truth_pairMembershipFormula] + rfl + +def ordinalIndexedChoiceEntryFormula {n} (z A T e : Fin n) : BoundedFormula n := + exMem A (exMem 0 (.conj (orderedPairFormula z.succ.succ 1 0) + (ordinalChoiceValueFormula T.succ.succ e.succ.succ 1 0))) + +theorem truth_ordinalIndexedChoiceEntryFormula {n} (z A T e : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (ordinalIndexedChoiceEntryFormula z A T e) env ↔ + ∃ x ∈ env A, ∃ y ∈ x, env z = ZFSet.pair x y ∧ OrdinalChoiceValue (env T) (env e) x y := by + simp only [ordinalIndexedChoiceEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_ordinalChoiceValueFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +theorem ordinalIndexedChoiceGraph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A T e : ZFSet.{u}} (hA : A ∈ M.sets) (hT : T ∈ M.sets) (he : e ∈ M.sets) : + ordinalIndexedChoiceGraph A T e ∈ M.sets := by + let env := extend A (extend T (extend e Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.ordinalIndexedChoiceEntryFormula 0 1 2 3) env + (Fin.cases hA (Fin.cases hT (Fin.cases he (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hA (M.union_mem unions hA)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.ordinalIndexedChoiceEntryFormula 0 1 2 3) (extend z env)) + (ZFSet.prod A (⋃₀ A)) = ordinalIndexedChoiceGraph A T e := by + apply ZFSet.ext + intro z + rw [ordinalIndexedChoiceGraph, ZFSet.mem_sep, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_ordinalIndexedChoiceEntryFormula _ _ _ _ _) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +universe u + +theorem ordinalIndexedChoiceGraph_total {F T e : ZFSet.{u}} + (ordinal : ordinalSetProperty T) + (meets : ∀ R ∈ F, ∃ i ∈ T, ∃ y ∈ R, ZFSet.pair i y ∈ e) : + ∀ R ∈ F, ∃ y ∈ ⋃₀ F, ZFSet.pair R y ∈ ordinalIndexedChoiceGraph F T e := by + intro R hR + let indices : Set ZFSet.{u} := {i | i ∈ T ∧ ∃ y ∈ R, ZFSet.pair i y ∈ e} + have inhabited : indices.Nonempty := meets R hR + obtain ⟨i, hi, minimal⟩ := ZFSet.mem_wf.has_min indices inhabited + obtain ⟨hiT, y, hy, entry⟩ := hi + refine ⟨y, ZFSet.mem_sUnion.2 ⟨R, hR, hy⟩, + (pair_mem_ordinalIndexedChoiceGraph F T e R y).2 ⟨hR, hy, i, hiT, entry, ?_⟩⟩ + intro j hji z hz stored + exact minimal j ⟨ordinal.1 i hiT j hji, z, hz, stored⟩ hji + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem exists_ordinalRelationChoice + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A T e : ZFSet.{u}} (hA : A ∈ M.sets) (hT : T ∈ M.sets) (he : e ∈ M.sets) + (ordinal : ordinalSetProperty T) + (covers : ∀ x ∈ A, ∃ i ∈ T, ZFSet.pair i x ∈ e) : + ∃ c ∈ M.sets, ChoiceFunctionCode (M.nonemptyGroundSubsets A) c ∧ + ∀ R y, ZFSet.pair R y ∈ c → OrdinalChoiceValue T e R y := by + let F := M.nonemptyGroundSubsets A + have hF : F ∈ M.sets := M.nonemptyGroundSubsets_mem powers separation hA + have meets : ∀ R ∈ F, ∃ i ∈ T, ∃ y ∈ R, ZFSet.pair i y ∈ e := by + intro R hR + obtain ⟨_, subset, y, hy⟩ := (M.mem_nonemptyGroundSubsets A R).1 hR + obtain ⟨i, hi, entry⟩ := covers y (subset hy) + exact ⟨i, hi, y, hy, entry⟩ + obtain ⟨c, hc, function, selected⟩ := M.uniformize_relation pairing unions powers separation choice + hF (M.union_mem unions hF) + (M.ordinalIndexedChoiceGraph_mem pairing unions powers separation hF hT he) + (ordinalIndexedChoiceGraph_total ordinal meets) + refine ⟨c, hc, ⟨function, ?_⟩, ?_⟩ + · intro R y entry + exact ((pair_mem_ordinalIndexedChoiceGraph F T e R y).1 (selected entry)).2.1 + · intro R y entry + exact ((pair_mem_ordinalIndexedChoiceGraph F T e R y).1 (selected entry)).2.2 + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem choice_of_witnesses + (witnesses : ∀ A ∈ M.sets, (∀ x ∈ A, x.Nonempty) → + ∃ f ∈ M.sets, ChoiceFunctionCode A f) : + Realize M.sets SetFormula.choice Fin.elim0 := by + intro A hA + apply (realize_imp M.sets _ _ _).2 + intro premise + have nonempty : ∀ x ∈ A, x.Nonempty := by + have raw := (BoundedFormula.realize_toFormula M + (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)) + (extend A Fin.elim0) (Fin.cases hA (fun i => Fin.elim0 i))).1 premise + intro x hx + exact (BoundedFormula.truth_nonemptyFormula 0 _).1 (raw x hx) + obtain ⟨f, hf, code⟩ := witnesses A hA nonempty + apply (realize_ex M.sets _ _).2 + refine ⟨f, hf, ?_⟩ + apply (BoundedFormula.realize_toFormula M _ _ + (Fin.cases hf (Fin.cases hA (fun i => Fin.elim0 i)))).2 + exact (BoundedFormula.truth_choiceFunctionFormula 1 0 _).2 code + +variable {P : Type u} [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + +include pairing unions powers separation collection infinite choice carrier order generic in +theorem ordinaryExtension_choice_witness {A : ZFSet.{u}} + (hA : A ∈ (M.ordinaryExtension s H).sets) (nonempty : ∀ x ∈ A, x.Nonempty) : + ∃ f ∈ (M.ordinaryExtension s H).sets, ChoiceFunctionCode A f := by + let N := M.ordinaryExtension s H + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic + have pairingN : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 + have unionsN : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 + have powersN : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 + have separationN : SeparationSchema N.sets := zf.2.1 + have hUnion := N.union_mem unionsN hA + obtain ⟨β, hβ, value⟩ := (M.mem_ordinaryExtension s H (⋃₀ A)).1 hUnion + have boundM := M.union_mem unions (M.union_mem unions hβ) + have poolM := M.namePool_mem s pairing unions powers separation collection carrier boundM + obtain ⟨T, hT, f, hf, ordinal, injection, onto⟩ := + M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice poolM + let function : FunctionGraphOn T f := ⟨_, injection.function⟩ + have names : ∀ i, IsName s (function.value i) := by + intro i + exact ((mem_namePool s _ _).1 + (ZFSet.pair_mem_prod.1 (injection.function.1 (function.value_entry i))).2).2 + let η := Name.indexedGraphName ⊤ function names + have hη : η ∈ (M.nameDomain s).names := + M.indexedGraphName_mem s ⊤ pairing unions powers separation collection + (M.transitive carrier (s.encode_mem ⊤)) hT hf function names + let e := Name.eval {q | H.mem q} η + have he : e ∈ N.sets := (M.mem_ordinaryExtension s H e).2 ⟨η, hη, rfl⟩ + have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H + have hTN : T ∈ N.sets := includes hT + have enumeration : FunctionGraphOn T e := + ⟨_, Name.eval_indexedGraphName_function {q | H.mem q} ⊤ H.top_mem function names⟩ + have covers := Name.indexedGraphName_covers_eval {q | H.mem q} ⊤ H.top_mem β function names onto + have meets : ∀ x ∈ A, ∃ i ∈ T, ∃ y ∈ x, ZFSet.pair i y ∈ e := by + intro x hx + obtain ⟨y, hy⟩ := nonempty x hx + have member : y ∈ Name.eval {q | H.mem q} β := by + rw [value] + exact ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩ + obtain ⟨i, hi, entry⟩ := covers y member + exact ⟨i, hi, y, hy, entry⟩ + exact ⟨ordinalIndexedChoiceGraph A T e, + N.ordinalIndexedChoiceGraph_mem pairingN unionsN powersN separationN hA hTN he, + ordinalIndexedChoiceGraph_choice ordinal enumeration meets⟩ + +include pairing unions powers separation collection infinite choice carrier order generic in +theorem ordinaryExtension_choice : + Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0 := by + apply (M.ordinaryExtension s H).choice_of_witnesses + intro A hA nonempty + exact M.ordinaryExtension_choice_witness s pairing unions powers separation collection infinite choice + carrier order H generic hA nonempty + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u v +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable {G : Type v} [Group G] + +theorem supportedNameFamily_graph_choice + (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) (carrier : s.carrier ∈ M.sets) + {W : ZFSet.{u}} (hW : W ∈ M.sets) (valid : ∀ z ∈ W, IsName s z) + (K : Subgroup G) (support : F.mem K) + (fixed : ∀ psi : Name s, psi.val ∈ W → K ≤ a.stabilizer s psi) + (children : ∀ psi : Name s, psi.val ∈ W → HereditarilySymmetric a s F psi) + (H : ConditionFilter P) (zf : ZFRealization (M.symmetricExtension s a F H).sets) + {delta z : ZFSet.{u}} + (hDelta : delta ∈ (M.symmetricExtension s a F H).sets) + (hz : z ∈ (M.symmetricExtension s a F H).sets) (function : FunctionGraphOn delta z) + (available : ∀ beta ∈ delta, ∃ psi : Name s, psi.val ∈ W ∧ + ∃ A, ZFSet.pair beta A ∈ z ∧ Name.eval {p | H.mem p} psi ∈ A) : + ∃ f ∈ (M.symmetricExtension s a F H).sets, FunctionGraphOn delta f ∧ + ∀ beta A x, ZFSet.pair beta A ∈ z → ZFSet.pair beta x ∈ f → x ∈ A := by + let N := M.symmetricExtension s a F H + have pairingN : Realize N.sets SetFormula.pairing Fin.elim0 := zf.1.2.2.2.1 + have unionsN : Realize N.sets SetFormula.union Fin.elim0 := zf.1.2.2.2.2.1 + have powersN : Realize N.sets powerSet Fin.elim0 := zf.1.2.2.2.2.2.1 + have separationN : SeparationSchema N.sets := zf.2.1 + obtain ⟨T, hT, e, he, ordinal, injection, onto⟩ := + M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice hW + let enumeration : FunctionGraphOn T e := ⟨W, injection.function⟩ + have values : ∀ i, enumeration.value i ∈ W := by + intro i + exact (ZFSet.pair_mem_prod.1 (injection.function.1 (enumeration.value_entry i))).2 + have names : ∀ i, IsName s (enumeration.value i) := fun i => valid _ (values i) + have sequence := M.supportedNameSequence_function_mem s a F pairing unions powers separation + collection carrier hT he enumeration names K support + (fun g hg i => fixed ⟨enumeration.value i, names i⟩ (values i) hg) + (fun i => children ⟨enumeration.value i, names i⟩ (values i)) H + let E := Name.eval {p | H.mem p} (Name.indexedGraphName ⊤ enumeration names) + have hE : E ∈ N.sets := sequence.2.2.2.2 + have evalFunction : FunctionGraphOn T E := ⟨_, sequence.2.2.2.1⟩ + have includes := M.ground_subset_symmetricExtension s a F + pairing unions powers separation collection carrier H + have hTN : T ∈ N.sets := includes hT + let B := ⋃₀ ⋃₀ z + let A := relationImage delta B z + have hB : B ∈ N.sets := N.union_mem unionsN (N.union_mem unionsN hz) + have hA : A ∈ N.sets := N.relationImage_mem separationN hDelta hB hz + have imageEntry {beta Y : ZFSet.{u}} (edge : ZFSet.pair beta Y ∈ z) : Y ∈ A := + (mem_relationImage delta B z Y).2 + ⟨pair_second_mem_doubleUnion edge, beta, function.pair_source edge, edge⟩ + have meets : ∀ Y ∈ A, ∃ i ∈ T, ∃ x ∈ Y, ZFSet.pair i x ∈ E := by + intro Y member + obtain ⟨_bound, beta, hBeta, edge⟩ := (mem_relationImage delta B z Y).1 member + obtain ⟨psi, hPsi, Y', otherEdge, memberValue⟩ := available beta hBeta + have same : Y' = Y := function.unique otherEdge edge + rw [same] at memberValue + obtain ⟨i, hi, code⟩ := onto psi.val hPsi + let j : T.toSet := ⟨i, hi⟩ + have valueEq : enumeration.value j = psi.val := enumeration.value_eq_of_entry j code + have nameEq : (⟨enumeration.value j, names j⟩ : Name s) = psi := Subtype.ext valueEq + refine ⟨i, hi, Name.eval {p | H.mem p} psi, memberValue, ?_⟩ + exact (Name.pair_mem_eval_indexedGraphName {p | H.mem p} ⊤ H.top_mem + enumeration names j _).2 (congrArg (Name.eval {p | H.mem p}) nameEq) + let c := ordinalIndexedChoiceGraph A T E + have hc : c ∈ N.sets := N.ordinalIndexedChoiceGraph_mem pairingN unionsN powersN separationN hA hTN hE + have chooser : ChoiceFunctionCode A c := ordinalIndexedChoiceGraph_choice ordinal evalFunction meets + let f := relationCompose delta A (⋃₀ A) z c + have hf : f ∈ N.sets := N.relationCompose_mem pairingN unionsN powersN separationN + hDelta hA (N.union_mem unionsN hA) hz hc + have code : ZFSet.IsFunc delta (⋃₀ A) f := by + refine ⟨fun _ member => (ZFSet.mem_sep.1 member).1, ?_⟩ + intro beta hBeta + obtain ⟨Y, edge⟩ := function.total hBeta + have member := imageEntry edge + obtain ⟨x, chosen, unique⟩ := chooser.function.2 Y member + have hx := chooser.chosen Y x chosen + refine ⟨x, (pair_mem_relationCompose delta A (⋃₀ A) z c beta x).2 + ⟨hBeta, ZFSet.mem_sUnion.2 ⟨Y, member, hx⟩, Y, member, edge, chosen⟩, ?_⟩ + intro y yEdge + obtain ⟨_key, _range, Y', _member, other, picked⟩ := + (pair_mem_relationCompose delta A (⋃₀ A) z c beta y).1 yEdge + have same : Y' = Y := function.unique other edge + exact unique y (same ▸ picked) + refine ⟨f, hf, ⟨⋃₀ A, code⟩, ?_⟩ + intro beta Y x edge chosen + obtain ⟨_key, _range, Y', _member, other, picked⟩ := + (pair_mem_relationCompose delta A (⋃₀ A) z c beta x).1 chosen + have same : Y' = Y := function.unique other edge + exact same ▸ chooser.chosen Y' x picked + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] +variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) +variable (b : Presentation L) (T : ZFSet.{u}) (K : L → Subgroup G) + +theorem exists_ground_supportedEqualityChoice + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t K ∈ M.sets) (maps : a.conditionMapFamily s t ∈ M.sets) + (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + (small : M.sets.Countable) (closed : InternallyCountablyClosed M s) + (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + {B : ZFSet.{u}} (hB : B ∈ M.sets) (smallB : M.groundEmbeddable B ZFSet.omega) + (subset : B ⊆ b.carrier) (z : (M.nameDomain s).names) + (visible : ∀ v : L, b.encode v ∈ B → Name.eval {p | H.mem p} z.val ∈ + Name.eval {p | H.mem p} (M.niceVisibilityName a s T (K v))) : + ∃ f ∈ M.sets, ZFSet.IsFunc B (M.niceSupportNameCodes a s T K) f ∧ + f ⊆ supportedEqualityRelation B (M.niceSupportNameCodes a s T K) + (M.niceSupportRelation a s b T K) + (Name.eval {p | H.mem p} (M.niceSupportEvaluationName a s T K)) + (Name.eval {p | H.mem p} z.val) := by + let N := M.ordinaryExtension s H + have codesGround := M.niceSupportNameCodes_mem a s b T K t pairing unions powers separation + collection carrier group nodes supports maps hT valid + have relationGround := M.supportedEqualityRelation_mem_ordinary a s b T K H t pairing unions powers + separation collection infinite carrier order group nodes supports maps hT valid genericFormula hB z + have total := M.supportedEqualityRelation_total a s b T K H subset visible + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order + infinite H genericFormula + have choiceN := M.ordinaryExtension_choice s pairing unions powers separation collection infinite + choice carrier order H genericFormula + have includes := M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H + obtain ⟨f, hf, function, selected⟩ := N.uniformize_relation zf.1.2.2.2.1 zf.1.2.2.2.2.1 + zf.1.2.2.2.2.2.1 zf.2.1 choiceN (includes hB) (includes codesGround) relationGround total + have ground := M.ordinaryExtension_countableDomainFunction_mem s pairing unions powers separation + collection infinite choice carrier order small hB codesGround smallB closed H genericCoded + genericFormula hf function + exact ⟨f, ground, function, selected⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/IncidenceQuotient.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/IncidenceQuotient.lean index ec158248f12c1b82934291b721afe558af32669f..9be1efadc7935ad2c09d4de7644249ed57dde721 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/IncidenceQuotient.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/IncidenceQuotient.lean @@ -1,83 +1,83 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GluingHeights - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces - -universe u -variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) -variable {B : Type u} (value : ∀ v, g.Space v → B) - -theorem realizes_of_equation (d : Dart J S R) (h : g.Equation value d) : - g.Realizes value (source J S R request d) (target J S R request d) (g.edgeInput d) := by - intro x - have eq := h ((g.arrow d).inverse x) - erw [(g.arrow d).right_inverse] at eq - exact eq.symm - -theorem parents_of_equations (edges : ∀ d, g.Equation value d) - (v : Vertex J S R) (h : depth J S R request v ≠ 0) : - g.Realizes value (parent J S R request v) v (g.localGlue v h) := by - have nonroot : v ≠ root J S R := fun eq => h ((depth_zero_iff J S R request v).mpr eq) - exact (g.realizes_reindex value (parent_eq J S R request v nonroot).symm - (incoming_target J S R request v nonroot) _).mpr - (g.realizes_of_equation value _ (edges _)) - -inductive EdgeRelated : g.scheme.Label → g.scheme.Label → Prop - | edge (d : Dart J S R) - (x : {x : g.Space (source J S R request d) // - (g.order (source J S R request d)).le x (g.anchor d)}) : - EdgeRelated ⟨source J S R request d, x.val⟩ - ⟨target J S R request d, ((g.arrow d).toFun x).val⟩ - | refl (x) : EdgeRelated x x - | symm {x y} : EdgeRelated x y → EdgeRelated y x - | trans {x y z} : EdgeRelated x y → EdgeRelated y z → EdgeRelated x z - -def edgeSetoid : Setoid g.scheme.Label := - ⟨g.EdgeRelated, EdgeRelated.refl, EdgeRelated.symm, EdgeRelated.trans⟩ - -def EdgeQuotient := Quotient g.edgeSetoid -def edgeClass (v : Vertex J S R) (x : g.Space v) : g.EdgeQuotient := - Quotient.mk g.edgeSetoid ⟨v, x⟩ - -theorem edge_class_equation (d : Dart J S R) : g.Equation g.edgeClass d := - fun x => Quotient.sound (EdgeRelated.edge d x) - -theorem parent_related_edge {x y : g.scheme.Label} (h : g.scheme.Related x y) : - g.EdgeRelated x y := by - induction h with - | parent v hv x => - exact Quotient.exact (g.parents_of_equations g.edgeClass g.edge_class_equation v hv x) - | refl => exact EdgeRelated.refl _ - | symm h ih => exact EdgeRelated.symm ih - | trans h1 h2 ih1 ih2 => exact EdgeRelated.trans ih1 ih2 - -theorem edge_related_sound {x y : g.scheme.Label} (h : g.EdgeRelated x y) : - (g.vertex x.1).toFun x.2 = (g.vertex y.1).toFun y.2 := by - induction h with - | edge d x => exact g.edge_identification d x - | refl => rfl - | symm h ih => exact ih.symm - | trans h1 h2 ih1 ih2 => exact ih1.trans ih2 - -theorem exact_edge_identifications (v w : Vertex J S R) (x : g.Space v) (y : g.Space w) : - (g.vertex v).toFun x = (g.vertex w).toFun y ↔ g.EdgeRelated ⟨v, x⟩ ⟨w, y⟩ := by - constructor - · intro eq - exact g.parent_related_edge ((g.scheme.exact_identifications v w x y).mp eq) - · exact g.edge_related_sound - -theorem edge_related_iff_parent (x y : g.scheme.Label) : - g.EdgeRelated x y ↔ g.scheme.Related x y := by - constructor - · intro h - exact (g.scheme.exact_identifications x.1 y.1 x.2 y.2).mp (g.edge_related_sound h) - · exact g.parent_related_edge - -end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GluingHeights + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces + +universe u +variable {J S R : Type u} [Group J] {request : S → R} (g : Spaces J S R request) +variable {B : Type u} (value : ∀ v, g.Space v → B) + +theorem realizes_of_equation (d : Dart J S R) (h : g.Equation value d) : + g.Realizes value (source J S R request d) (target J S R request d) (g.edgeInput d) := by + intro x + have eq := h ((g.arrow d).inverse x) + erw [(g.arrow d).right_inverse] at eq + exact eq.symm + +theorem parents_of_equations (edges : ∀ d, g.Equation value d) + (v : Vertex J S R) (h : depth J S R request v ≠ 0) : + g.Realizes value (parent J S R request v) v (g.localGlue v h) := by + have nonroot : v ≠ root J S R := fun eq => h ((depth_zero_iff J S R request v).mpr eq) + exact (g.realizes_reindex value (parent_eq J S R request v nonroot).symm + (incoming_target J S R request v nonroot) _).mpr + (g.realizes_of_equation value _ (edges _)) + +inductive EdgeRelated : g.scheme.Label → g.scheme.Label → Prop + | edge (d : Dart J S R) + (x : {x : g.Space (source J S R request d) // + (g.order (source J S R request d)).le x (g.anchor d)}) : + EdgeRelated ⟨source J S R request d, x.val⟩ + ⟨target J S R request d, ((g.arrow d).toFun x).val⟩ + | refl (x) : EdgeRelated x x + | symm {x y} : EdgeRelated x y → EdgeRelated y x + | trans {x y z} : EdgeRelated x y → EdgeRelated y z → EdgeRelated x z + +def edgeSetoid : Setoid g.scheme.Label := + ⟨g.EdgeRelated, EdgeRelated.refl, EdgeRelated.symm, EdgeRelated.trans⟩ + +def EdgeQuotient := Quotient g.edgeSetoid +def edgeClass (v : Vertex J S R) (x : g.Space v) : g.EdgeQuotient := + Quotient.mk g.edgeSetoid ⟨v, x⟩ + +theorem edge_class_equation (d : Dart J S R) : g.Equation g.edgeClass d := + fun x => Quotient.sound (EdgeRelated.edge d x) + +theorem parent_related_edge {x y : g.scheme.Label} (h : g.scheme.Related x y) : + g.EdgeRelated x y := by + induction h with + | parent v hv x => + exact Quotient.exact (g.parents_of_equations g.edgeClass g.edge_class_equation v hv x) + | refl => exact EdgeRelated.refl _ + | symm h ih => exact EdgeRelated.symm ih + | trans h1 h2 ih1 ih2 => exact EdgeRelated.trans ih1 ih2 + +theorem edge_related_sound {x y : g.scheme.Label} (h : g.EdgeRelated x y) : + (g.vertex x.1).toFun x.2 = (g.vertex y.1).toFun y.2 := by + induction h with + | edge d x => exact g.edge_identification d x + | refl => rfl + | symm h ih => exact ih.symm + | trans h1 h2 ih1 ih2 => exact ih1.trans ih2 + +theorem exact_edge_identifications (v w : Vertex J S R) (x : g.Space v) (y : g.Space w) : + (g.vertex v).toFun x = (g.vertex w).toFun y ↔ g.EdgeRelated ⟨v, x⟩ ⟨w, y⟩ := by + constructor + · intro eq + exact g.parent_related_edge ((g.scheme.exact_identifications v w x y).mp eq) + · exact g.edge_related_sound + +theorem edge_related_iff_parent (x y : g.scheme.Label) : + g.EdgeRelated x y ↔ g.scheme.Related x y := by + constructor + · intro h + exact (g.scheme.exact_identifications x.1 y.1 x.2 y.2).mp (g.edge_related_sound h) + · exact g.parent_related_edge + +end PartitionPilot.Compression.RecursiveMaps.CosetGeometry.TileStars.Spaces + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/LiteralQuotientRankBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/LiteralQuotientRankBounds.lean index bd6bf63e61f8c3ea4fef5a2a020a5668aee7bbc0..febcdff35262621fab08742c7116b9a977c1ef3f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/LiteralQuotientRankBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/LiteralQuotientRankBounds.lean @@ -1,37 +1,37 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.FixedTopCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include limit - -theorem rank_natSetCode_lt (n : Nat) : ZFSet.rank (natSetCode n) < o := by - induction n with - | zero => simpa only [natSetCode_zero, ZFSet.rank_empty] using limit.pos - | succ n ih => - rw [natSetCode_succ, ZFSet.rank_insert] - exact max_lt (limit.succ_lt ih) ih - -theorem rank_equivalenceClasses_lt {A : ZFSet.{u}} (E : ZFSet.{u}) - (carrier : ZFSet.rank A < o) : ZFSet.rank (equivalenceClasses A E) < o := by - have subset : equivalenceClasses A E ⊆ ZFSet.powerset A := - fun _ hx => (ZFSet.mem_sep.1 hx).1 - have bound := ZFSet.rank_mono subset - rw [ZFSet.rank_powerset] at bound - exact bound.trans_lt (limit.succ_lt carrier) - -theorem rank_fixedTopCarrier_lt {P : ZFSet.{u}} (carrier : ZFSet.rank P < o) : - ZFSet.rank (fixedTopCarrier P) < o := by - rw [fixedTopCarrier, ZFSet.rank_insert] - exact max_lt (limit.succ_lt carrier) carrier - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.FixedTopCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include limit + +theorem rank_natSetCode_lt (n : Nat) : ZFSet.rank (natSetCode n) < o := by + induction n with + | zero => simpa only [natSetCode_zero, ZFSet.rank_empty] using limit.pos + | succ n ih => + rw [natSetCode_succ, ZFSet.rank_insert] + exact max_lt (limit.succ_lt ih) ih + +theorem rank_equivalenceClasses_lt {A : ZFSet.{u}} (E : ZFSet.{u}) + (carrier : ZFSet.rank A < o) : ZFSet.rank (equivalenceClasses A E) < o := by + have subset : equivalenceClasses A E ⊆ ZFSet.powerset A := + fun _ hx => (ZFSet.mem_sep.1 hx).1 + have bound := ZFSet.rank_mono subset + rw [ZFSet.rank_powerset] at bound + exact bound.trans_lt (limit.succ_lt carrier) + +theorem rank_fixedTopCarrier_lt {P : ZFSet.{u}} (carrier : ZFSet.rank P < o) : + ZFSet.rank (fixedTopCarrier P) < o := by + rw [fixedTopCarrier, ZFSet.rank_insert] + exact max_lt (limit.succ_lt carrier) carrier + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/RootedGluingQuotient.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/RootedGluingQuotient.lean index 1ac1097bf982eee5001d32c3d2816803752d70c6..86651ee66fe3af7e7ec90600936c0f120b875ca4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/RootedGluingQuotient.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/RootedGluingQuotient.lean @@ -1,119 +1,119 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.TileTreeGluing - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -universe u -variable {V : Type u} (d : Scheme V) - -def Label := (v : V) × d.Space v - -inductive Related : d.Label → d.Label → Prop - | parent (v : V) (h : d.depth v ≠ 0) - (x : {x : d.Space v // (d.order v).le x (d.childAnchor v h)}) : - Related ⟨v, x.val⟩ ⟨d.parent v, ((d.link v h).toFun x).val⟩ - | refl (x) : Related x x - | symm {x y} : Related x y → Related y x - | trans {x y z} : Related x y → Related y z → Related x z - -def labelSetoid : Setoid d.Label := ⟨d.Related, Related.refl, Related.symm, Related.trans⟩ -def Generated := Quotient d.labelSetoid -def labelClass (v : V) (x : d.Space v) : d.Generated := Quotient.mk d.labelSetoid ⟨v, x⟩ - -theorem label_parent (v : V) (h : d.depth v ≠ 0) - (x : {x : d.Space v // (d.order v).le x (d.childAnchor v h)}) : - d.labelClass v x.val = d.labelClass (d.parent v) ((d.link v h).toFun x).val := - Quotient.sound (Related.parent v h x) - -noncomputable def stageClass : (n : Nat) → (d.stages n).Point → d.Generated - | 0, x => d.labelClass d.root x - | n + 1, .inl x => stageClass n x - | _ + 1, .inr x => d.labelClass x.1.val x.2.val - -theorem stageClass_old (n : Nat) (x : (d.stages n).Point) : - d.stageClass (n + 1) ((d.stages n).batch.old.toFun x) = d.stageClass n x := rfl - -theorem stageClass_vertex (n : Nat) (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : - d.stageClass n (((d.stages n).vertex v hv).toFun x) = d.labelClass v x := by - classical - induction n generalizing v with - | zero => - have eq := d.zero_eq_root v (Nat.eq_zero_of_le_zero hv) - subst v - rfl - | succ n ih => - change d.stageClass (n + 1) (((d.stages n).successor.vertex v hv).toFun x) = _ - by_cases older : d.depth v ≤ n - · rw [(d.stages n).successor_old v older x, d.stageClass_old] - exact ih v older x - · let s := d.stages n - let i : s.Layer := ⟨v, by omega⟩ - rw [s.successor_new i x] - by_cases base : (d.order v).le x (d.childAnchor v (s.layer_nonzero i)) - · have eq : (s.batch.tile i).toFun x = - s.batch.old.toFun ((s.vertex (d.parent v) (s.parent_present i)).toFun - ((d.link v (s.layer_nonzero i)).toFun ⟨x, base⟩).val) := - (s.batch.tile_old_overlap i x _).mpr ⟨base, rfl⟩ - rw [eq, d.stageClass_old] - exact (ih (d.parent v) (s.parent_present i) _).trans - (d.label_parent v (s.layer_nonzero i) ⟨x, base⟩).symm - · have represented := (s.batch.glue i).represent_new x base - change d.stageClass (n + 1) (s.batch.componentMap i ((s.batch.glue i).represent x)) = _ - rw [represented] - rfl - -theorem stageClass_up {n m : Nat} (h : n ≤ m) (x : (d.stages n).Point) : - d.stageClass m (d.chain.up h x) = d.stageClass n x := by - induction h with - | refl => erw [d.chain.up_self] - | @step m h ih => - erw [d.chain.up_succ h] - exact (d.stageClass_old m _).trans ih - -noncomputable def toGenerated : d.Node → d.Generated := - Quotient.lift (fun x => d.stageClass x.1 x.2) (by - rintro x y ⟨k, hx, hy, eq⟩ - exact (d.stageClass_up hx x.2).symm.trans - ((congrArg (d.stageClass k) eq).trans (d.stageClass_up hy y.2))) - -theorem toGenerated_vertex (v : V) (x : d.Space v) : - d.toGenerated ((d.vertex v).toFun x) = d.labelClass v x := - d.stageClass_vertex (d.depth v) v (le_refl _) x - -theorem related_sound {x y : d.Label} (h : d.Related x y) : - (d.vertex x.1).toFun x.2 = (d.vertex y.1).toFun y.2 := by - induction h with - | parent v hv x => exact d.parent_identification v hv x - | refl => rfl - | symm h ih => exact ih.symm - | trans h1 h2 ih1 ih2 => exact ih1.trans ih2 - -theorem exact_identifications (v w : V) (x : d.Space v) (y : d.Space w) : - (d.vertex v).toFun x = (d.vertex w).toFun y ↔ d.Related ⟨v, x⟩ ⟨w, y⟩ := by - constructor - · intro eq - have classes := congrArg d.toGenerated eq - rw [d.toGenerated_vertex, d.toGenerated_vertex] at classes - exact Quotient.exact classes - · exact d.related_sound - -noncomputable def fromGenerated : d.Generated → d.Node := - Quotient.lift (fun x => (d.vertex x.1).toFun x.2) (fun _ _ h => d.related_sound h) - -theorem from_to (x : d.Node) : d.fromGenerated (d.toGenerated x) = x := by - rcases d.cover x with ⟨v, a, rfl⟩ - rw [d.toGenerated_vertex] - rfl - -theorem to_from (x : d.Generated) : d.toGenerated (d.fromGenerated x) = x := by - induction x using Quotient.ind with - | _ x => exact d.toGenerated_vertex x.1 x.2 - -end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.TileTreeGluing + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +universe u +variable {V : Type u} (d : Scheme V) + +def Label := (v : V) × d.Space v + +inductive Related : d.Label → d.Label → Prop + | parent (v : V) (h : d.depth v ≠ 0) + (x : {x : d.Space v // (d.order v).le x (d.childAnchor v h)}) : + Related ⟨v, x.val⟩ ⟨d.parent v, ((d.link v h).toFun x).val⟩ + | refl (x) : Related x x + | symm {x y} : Related x y → Related y x + | trans {x y z} : Related x y → Related y z → Related x z + +def labelSetoid : Setoid d.Label := ⟨d.Related, Related.refl, Related.symm, Related.trans⟩ +def Generated := Quotient d.labelSetoid +def labelClass (v : V) (x : d.Space v) : d.Generated := Quotient.mk d.labelSetoid ⟨v, x⟩ + +theorem label_parent (v : V) (h : d.depth v ≠ 0) + (x : {x : d.Space v // (d.order v).le x (d.childAnchor v h)}) : + d.labelClass v x.val = d.labelClass (d.parent v) ((d.link v h).toFun x).val := + Quotient.sound (Related.parent v h x) + +noncomputable def stageClass : (n : Nat) → (d.stages n).Point → d.Generated + | 0, x => d.labelClass d.root x + | n + 1, .inl x => stageClass n x + | _ + 1, .inr x => d.labelClass x.1.val x.2.val + +theorem stageClass_old (n : Nat) (x : (d.stages n).Point) : + d.stageClass (n + 1) ((d.stages n).batch.old.toFun x) = d.stageClass n x := rfl + +theorem stageClass_vertex (n : Nat) (v : V) (hv : d.depth v ≤ n) (x : d.Space v) : + d.stageClass n (((d.stages n).vertex v hv).toFun x) = d.labelClass v x := by + classical + induction n generalizing v with + | zero => + have eq := d.zero_eq_root v (Nat.eq_zero_of_le_zero hv) + subst v + rfl + | succ n ih => + change d.stageClass (n + 1) (((d.stages n).successor.vertex v hv).toFun x) = _ + by_cases older : d.depth v ≤ n + · rw [(d.stages n).successor_old v older x, d.stageClass_old] + exact ih v older x + · let s := d.stages n + let i : s.Layer := ⟨v, by omega⟩ + rw [s.successor_new i x] + by_cases base : (d.order v).le x (d.childAnchor v (s.layer_nonzero i)) + · have eq : (s.batch.tile i).toFun x = + s.batch.old.toFun ((s.vertex (d.parent v) (s.parent_present i)).toFun + ((d.link v (s.layer_nonzero i)).toFun ⟨x, base⟩).val) := + (s.batch.tile_old_overlap i x _).mpr ⟨base, rfl⟩ + rw [eq, d.stageClass_old] + exact (ih (d.parent v) (s.parent_present i) _).trans + (d.label_parent v (s.layer_nonzero i) ⟨x, base⟩).symm + · have represented := (s.batch.glue i).represent_new x base + change d.stageClass (n + 1) (s.batch.componentMap i ((s.batch.glue i).represent x)) = _ + rw [represented] + rfl + +theorem stageClass_up {n m : Nat} (h : n ≤ m) (x : (d.stages n).Point) : + d.stageClass m (d.chain.up h x) = d.stageClass n x := by + induction h with + | refl => erw [d.chain.up_self] + | @step m h ih => + erw [d.chain.up_succ h] + exact (d.stageClass_old m _).trans ih + +noncomputable def toGenerated : d.Node → d.Generated := + Quotient.lift (fun x => d.stageClass x.1 x.2) (by + rintro x y ⟨k, hx, hy, eq⟩ + exact (d.stageClass_up hx x.2).symm.trans + ((congrArg (d.stageClass k) eq).trans (d.stageClass_up hy y.2))) + +theorem toGenerated_vertex (v : V) (x : d.Space v) : + d.toGenerated ((d.vertex v).toFun x) = d.labelClass v x := + d.stageClass_vertex (d.depth v) v (le_refl _) x + +theorem related_sound {x y : d.Label} (h : d.Related x y) : + (d.vertex x.1).toFun x.2 = (d.vertex y.1).toFun y.2 := by + induction h with + | parent v hv x => exact d.parent_identification v hv x + | refl => rfl + | symm h ih => exact ih.symm + | trans h1 h2 ih1 ih2 => exact ih1.trans ih2 + +theorem exact_identifications (v w : V) (x : d.Space v) (y : d.Space w) : + (d.vertex v).toFun x = (d.vertex w).toFun y ↔ d.Related ⟨v, x⟩ ⟨w, y⟩ := by + constructor + · intro eq + have classes := congrArg d.toGenerated eq + rw [d.toGenerated_vertex, d.toGenerated_vertex] at classes + exact Quotient.exact classes + · exact d.related_sound + +noncomputable def fromGenerated : d.Generated → d.Node := + Quotient.lift (fun x => (d.vertex x.1).toFun x.2) (fun _ _ h => d.related_sound h) + +theorem from_to (x : d.Node) : d.fromGenerated (d.toGenerated x) = x := by + rcases d.cover x with ⟨v, a, rfl⟩ + rw [d.toGenerated_vertex] + rfl + +theorem to_from (x : d.Generated) : d.toGenerated (d.fromGenerated x) = x := by + induction x using Quotient.ind with + | _ x => exact d.toGenerated_vertex x.1 x.2 + +end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Models/Separation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Models/Separation.lean index c4580cc0c4c6a9f8e7c593558c3393439202af8c..70884df9515d0b4af6f7a6acaf9aba13a2e8793b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Models/Separation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Models/Separation.lean @@ -1,51 +1,51 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PartitionPrincipleFormula -import OAI.SetTheory.PartitionPrinciple.Models.GroundMainFinalPartitionModel - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_partitionPrinciple_without_choice - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - ∃ N : TransitiveGround.{u}, M.sets ⊆ N.sets ∧ ZFRealization N.sets ∧ - (∀ X ∈ N.sets, ∀ Y ∈ N.sets, ∀ f ∈ N.sets, ZFSet.IsFunc X Y f → - (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → N.groundEmbeddable Y X) ∧ - ¬ Realize N.sets SetFormula.choice Fin.elim0 := by - obtain ⟨data, ordinalC, original⟩ := - M.exists_groundMainFinalSupport pairing unions powers separation collection infinite choice hK standard - let := ordinalMainIndexPreorder ordinalC - obtain ⟨run, _indices, _profiles, _terminal, _extension, _unique, indexBound, _rank, - i0, _zero, fulfilled, _geometryProperties⟩ := original - exact fulfilled.exists_partitionPrinciple_not_choice collection infinite choice small hK standard - indexBound rfl ⟨data.seed.coordinateInjection, data.seed.injection_ground, data.seed.injection_code⟩ - data.seed.dense.irrefl - -theorem exists_model_partitionPrinciple_without_choice - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - ∃ N : TransitiveGround.{u}, M.sets ⊆ N.sets ∧ ZFRealization N.sets ∧ - Realize N.sets partitionPrinciple Fin.elim0 ∧ - ¬ Realize N.sets SetFormula.choice Fin.elim0 := by - obtain ⟨N, includes, zf, pp, notChoice⟩ := M.exists_partitionPrinciple_without_choice - pairing unions powers separation collection infinite choice small hK standard - exact ⟨N, includes, zf, (N.realize_partitionPrinciple).2 pp, notChoice⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PartitionPrincipleFormula +import OAI.SetTheory.PartitionPrinciple.Models.GroundMainFinalPartitionModel + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_partitionPrinciple_without_choice + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + ∃ N : TransitiveGround.{u}, M.sets ⊆ N.sets ∧ ZFRealization N.sets ∧ + (∀ X ∈ N.sets, ∀ Y ∈ N.sets, ∀ f ∈ N.sets, ZFSet.IsFunc X Y f → + (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → N.groundEmbeddable Y X) ∧ + ¬ Realize N.sets SetFormula.choice Fin.elim0 := by + obtain ⟨data, ordinalC, original⟩ := + M.exists_groundMainFinalSupport pairing unions powers separation collection infinite choice hK standard + let := ordinalMainIndexPreorder ordinalC + obtain ⟨run, _indices, _profiles, _terminal, _extension, _unique, indexBound, _rank, + i0, _zero, fulfilled, _geometryProperties⟩ := original + exact fulfilled.exists_partitionPrinciple_not_choice collection infinite choice small hK standard + indexBound rfl ⟨data.seed.coordinateInjection, data.seed.injection_ground, data.seed.injection_code⟩ + data.seed.dense.irrefl + +theorem exists_model_partitionPrinciple_without_choice + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + ∃ N : TransitiveGround.{u}, M.sets ⊆ N.sets ∧ ZFRealization N.sets ∧ + Realize N.sets partitionPrinciple Fin.elim0 ∧ + ¬ Realize N.sets SetFormula.choice Fin.elim0 := by + obtain ⟨N, includes, zf, pp, notChoice⟩ := M.exists_partitionPrinciple_without_choice + pairing unions powers separation collection infinite choice small hK standard + exact ⟨N, includes, zf, (N.realize_partitionPrinciple).2 pp, notChoice⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AgreementLimits.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AgreementLimits.lean index 12c2e8522966a81fc5121fb7eb3fac25bfdec95f..719d7c997ab5e62fa9283b59030f9367f574a718 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AgreementLimits.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AgreementLimits.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.MainInitial - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.ActionSystem - -open CosetGeometry -universe u -variable {I : Type u} [LinearOrder I] [Nonempty I] - {g : GroupSystem I} {p : MeetSystem I} (a : ActionSystem g p) - -def PreservesAgreements : Prop := ∀ {i j} (lower : i ≤ j) (s t : g.system.Point i) (v : p.system.Point i), - (∀ x, (p.order i).le x v → ((a.action i).iso s).toFun x = ((a.action i).iso t).toFun x) → - ∀ x, (p.order j).le x (p.system.map lower v) → - ((a.action j).iso (g.system.map lower s)).toFun x = - ((a.action j).iso (g.system.map lower t)).toFun x - -theorem union_agreement (preserves : a.PreservesAgreements) - (i : I) (s t : g.system.Point i) (v : p.system.Point i) - (agree : ∀ x, (p.order i).le x v → ((a.action i).iso s).toFun x = ((a.action i).iso t).toFun x) - (x : p.system.Union) (lower : p.unionOrder.le x ((p.inclusion i).toFun v)) : - (a.unionAction.iso ((g.inclusion i) s)).toFun x = - (a.unionAction.iso ((g.inclusion i) t)).toFun x := by - rcases p.system.cover x with ⟨j, x, rfl⟩ - let hi := le_max_left i j - let hj := le_max_right i j - have lowerAt : p.unionOrder.le (p.system.point (max i j) (p.system.map hj x)) - (p.system.point (max i j) (p.system.map hi v)) := by - rw [p.system.point_map, p.system.point_map] - exact lower - have eq := preserves hi s t v agree (p.system.map hj x) ((p.le_stage _ _ _).mp lowerAt) - change a.act (g.system.point i s) (p.system.point j x) = - a.act (g.system.point i t) (p.system.point j x) - rw [← g.system.point_map hi s, ← g.system.point_map hi t, ← p.system.point_map hj x, - a.act_point, a.act_point] - exact congrArg (p.system.point (max i j)) eq - -theorem top_agreement (preserves : a.PreservesAgreements) - (i : I) (s t : g.system.Point i) (v : p.system.Point i) - (agree : ∀ x, (p.order i).le x v → ((a.action i).iso s).toFun x = ((a.action i).iso t).toFun x) - (x : Option p.system.Union) (lower : p.boundedOrder.le x ((p.boundedInclusion i).toFun v)) : - (a.topAction.iso ((g.inclusion i) s)).toFun x = - (a.topAction.iso ((g.inclusion i) t)).toFun x := by - cases x with - | none => exact False.elim lower - | some x => exact congrArg some (a.union_agreement preserves i s t v agree x lower) - -end PartitionPilot.Compression.RecursiveMaps.ActionSystem - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.MainInitial + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.ActionSystem + +open CosetGeometry +universe u +variable {I : Type u} [LinearOrder I] [Nonempty I] + {g : GroupSystem I} {p : MeetSystem I} (a : ActionSystem g p) + +def PreservesAgreements : Prop := ∀ {i j} (lower : i ≤ j) (s t : g.system.Point i) (v : p.system.Point i), + (∀ x, (p.order i).le x v → ((a.action i).iso s).toFun x = ((a.action i).iso t).toFun x) → + ∀ x, (p.order j).le x (p.system.map lower v) → + ((a.action j).iso (g.system.map lower s)).toFun x = + ((a.action j).iso (g.system.map lower t)).toFun x + +theorem union_agreement (preserves : a.PreservesAgreements) + (i : I) (s t : g.system.Point i) (v : p.system.Point i) + (agree : ∀ x, (p.order i).le x v → ((a.action i).iso s).toFun x = ((a.action i).iso t).toFun x) + (x : p.system.Union) (lower : p.unionOrder.le x ((p.inclusion i).toFun v)) : + (a.unionAction.iso ((g.inclusion i) s)).toFun x = + (a.unionAction.iso ((g.inclusion i) t)).toFun x := by + rcases p.system.cover x with ⟨j, x, rfl⟩ + let hi := le_max_left i j + let hj := le_max_right i j + have lowerAt : p.unionOrder.le (p.system.point (max i j) (p.system.map hj x)) + (p.system.point (max i j) (p.system.map hi v)) := by + rw [p.system.point_map, p.system.point_map] + exact lower + have eq := preserves hi s t v agree (p.system.map hj x) ((p.le_stage _ _ _).mp lowerAt) + change a.act (g.system.point i s) (p.system.point j x) = + a.act (g.system.point i t) (p.system.point j x) + rw [← g.system.point_map hi s, ← g.system.point_map hi t, ← p.system.point_map hj x, + a.act_point, a.act_point] + exact congrArg (p.system.point (max i j)) eq + +theorem top_agreement (preserves : a.PreservesAgreements) + (i : I) (s t : g.system.Point i) (v : p.system.Point i) + (agree : ∀ x, (p.order i).le x v → ((a.action i).iso s).toFun x = ((a.action i).iso t).toFun x) + (x : Option p.system.Union) (lower : p.boundedOrder.le x ((p.boundedInclusion i).toFun v)) : + (a.topAction.iso ((g.inclusion i) s)).toFun x = + (a.topAction.iso ((g.inclusion i) t)).toFun x := by + cases x with + | none => exact False.elim lower + | some x => exact congrArg some (a.union_agreement preserves i s t v agree x lower) + +end PartitionPilot.Compression.RecursiveMaps.ActionSystem + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AmalgamationCoinitiality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AmalgamationCoinitiality.lean index a519c3ddd23a5ee4c7b281e1e5b7770e39120815..9720aa30b63b08f69767e2a467983996a33c3261 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AmalgamationCoinitiality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AmalgamationCoinitiality.lean @@ -1,108 +1,108 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.ChronologicalTransport - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input - -open Attachment Chronological - -universe u - -variable {A B Stage : Type u} [LinearOrder Stage] - {P : MeetOrder A} {Q : MeetOrder B} (g : Input P Q) - -def birth (oldBirth : A → Stage) (s : Stage) : g.Node → Stage - | .inl a => oldBirth a - | .inr _ => s - -theorem birth_le (oldBirth : A → Stage) (s : Stage) (old : ∀ a, oldBirth a < s) : - ∀ x, g.birth oldBirth s x ≤ s := by - intro x - cases x with - | inl a => exact le_of_lt (old a) - | inr _ => exact le_refl s - -theorem old_meet_preserved (oldBirth : A → Stage) (s : Stage) - (old : ∀ a, oldBirth a < s) (previous : OldMeet (P := P) oldBirth) : - OldMeet (P := g.order) (g.birth oldBirth s) := by - intro x y earlier notLower - cases x with - | inl a => - cases y with - | inl b => - have eq : g.order.meet (.inl a) (.inl b) = Sum.inl (P.meet a b) := - (g.left.map_meet a b).symm - rw [eq] - exact previous a b earlier notLower - | inr y => exact False.elim (lt_asymm earlier (old a)) - | inr x => - cases y with - | inl a => - rw [g.new_shadow_meet] - exact old _ - | inr y => exact False.elim (lt_irrefl s earlier) - -noncomputable def earlier_layer {Space : Stage → Type u} - {order : ∀ t, MeetOrder (Space t)} (oldBirth : A → Stage) (s t : Stage) - (earlier : t < s) (layer : GrowthLayer Space order P oldBirth t) : - GrowthLayer Space order g.order (g.birth oldBirth s) t := by - apply layer.transport g.left (fun _ => rfl) - intro x hx - cases x with - | inl a => exact ⟨a, rfl⟩ - | inr x => - change s = t at hx - exact False.elim (lt_irrefl s (hx ▸ earlier)) - -noncomputable def incoming_layer (Space : Stage → Type u) - (order : ∀ t, MeetOrder (Space t)) (oldBirth : A → Stage) (s : Stage) - (old : ∀ a, oldBirth a < s) (I : Type u) [Countable I] - (index : I → Stage) (earlier : ∀ i, index i < s) - (copy : ∀ i, MeetEmbedding (order (index i)) Q) - (cover : ∀ b, ∃ i y, (copy i).toFun y = b) : - GrowthLayer Space order g.order (g.birth oldBirth s) s := by - apply GrowthLayer.copies I inferInstance index earlier (fun i => compose (copy i) g.right) - intro x hx - cases x with - | inl a => - change oldBirth a = s at hx - exact False.elim (lt_irrefl s (hx ▸ old a)) - | inr b => - rcases cover b.val with ⟨i, y, eq⟩ - exact ⟨i, y, (congrArg g.right.toFun eq).trans (g.represent_new b.val b.property)⟩ - -theorem profile_persists (c e K : A) (F : A → Prop) (inhabited : ∃ f, F f) - (profile : Profile P c e K F) (separated : ¬ P.le e K) : - ProfileOver g.left c e K F := - attachment_preserves_profile g.data g.component_meets c e K F inhabited profile separated - -end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input - -namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation - -open Chronological - -universe u - -noncomputable def binary_incoming_layer {A T Stage : Type u} [LinearOrder Stage] - {P : MeetOrder A} {R : MeetOrder T} (tile : Input R R) (g : Input P tile.order) - (Space : Stage → Type u) (order : ∀ t, MeetOrder (Space t)) - (oldBirth : A → Stage) (s t : Stage) (old : ∀ a, oldBirth a < s) (earlier : t < s) - (template : MeetIso (order t) R) : - GrowthLayer Space order g.order (g.birth oldBirth s) s := by - apply g.incoming_layer Space order oldBirth s old (ULift.{u} Bool) (fun _ => t) (fun _ => earlier) - (fun i => compose template.toMeetEmbedding (BinaryTiles.vertex R tile i.down)) - intro x - rcases BinaryTiles.vertex_cover R tile x with ⟨i, y, eq⟩ - refine ⟨⟨i⟩, template.inverse y, ?_⟩ - change (BinaryTiles.vertex R tile i).toFun (template.toFun (template.inverse y)) = x - rw [template.right_inverse] - exact eq - -end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.ChronologicalTransport + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input + +open Attachment Chronological + +universe u + +variable {A B Stage : Type u} [LinearOrder Stage] + {P : MeetOrder A} {Q : MeetOrder B} (g : Input P Q) + +def birth (oldBirth : A → Stage) (s : Stage) : g.Node → Stage + | .inl a => oldBirth a + | .inr _ => s + +theorem birth_le (oldBirth : A → Stage) (s : Stage) (old : ∀ a, oldBirth a < s) : + ∀ x, g.birth oldBirth s x ≤ s := by + intro x + cases x with + | inl a => exact le_of_lt (old a) + | inr _ => exact le_refl s + +theorem old_meet_preserved (oldBirth : A → Stage) (s : Stage) + (old : ∀ a, oldBirth a < s) (previous : OldMeet (P := P) oldBirth) : + OldMeet (P := g.order) (g.birth oldBirth s) := by + intro x y earlier notLower + cases x with + | inl a => + cases y with + | inl b => + have eq : g.order.meet (.inl a) (.inl b) = Sum.inl (P.meet a b) := + (g.left.map_meet a b).symm + rw [eq] + exact previous a b earlier notLower + | inr y => exact False.elim (lt_asymm earlier (old a)) + | inr x => + cases y with + | inl a => + rw [g.new_shadow_meet] + exact old _ + | inr y => exact False.elim (lt_irrefl s earlier) + +noncomputable def earlier_layer {Space : Stage → Type u} + {order : ∀ t, MeetOrder (Space t)} (oldBirth : A → Stage) (s t : Stage) + (earlier : t < s) (layer : GrowthLayer Space order P oldBirth t) : + GrowthLayer Space order g.order (g.birth oldBirth s) t := by + apply layer.transport g.left (fun _ => rfl) + intro x hx + cases x with + | inl a => exact ⟨a, rfl⟩ + | inr x => + change s = t at hx + exact False.elim (lt_irrefl s (hx ▸ earlier)) + +noncomputable def incoming_layer (Space : Stage → Type u) + (order : ∀ t, MeetOrder (Space t)) (oldBirth : A → Stage) (s : Stage) + (old : ∀ a, oldBirth a < s) (I : Type u) [Countable I] + (index : I → Stage) (earlier : ∀ i, index i < s) + (copy : ∀ i, MeetEmbedding (order (index i)) Q) + (cover : ∀ b, ∃ i y, (copy i).toFun y = b) : + GrowthLayer Space order g.order (g.birth oldBirth s) s := by + apply GrowthLayer.copies I inferInstance index earlier (fun i => compose (copy i) g.right) + intro x hx + cases x with + | inl a => + change oldBirth a = s at hx + exact False.elim (lt_irrefl s (hx ▸ old a)) + | inr b => + rcases cover b.val with ⟨i, y, eq⟩ + exact ⟨i, y, (congrArg g.right.toFun eq).trans (g.represent_new b.val b.property)⟩ + +theorem profile_persists (c e K : A) (F : A → Prop) (inhabited : ∃ f, F f) + (profile : Profile P c e K F) (separated : ¬ P.le e K) : + ProfileOver g.left c e K F := + attachment_preserves_profile g.data g.component_meets c e K F inhabited profile separated + +end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input + +namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation + +open Chronological + +universe u + +noncomputable def binary_incoming_layer {A T Stage : Type u} [LinearOrder Stage] + {P : MeetOrder A} {R : MeetOrder T} (tile : Input R R) (g : Input P tile.order) + (Space : Stage → Type u) (order : ∀ t, MeetOrder (Space t)) + (oldBirth : A → Stage) (s t : Stage) (old : ∀ a, oldBirth a < s) (earlier : t < s) + (template : MeetIso (order t) R) : + GrowthLayer Space order g.order (g.birth oldBirth s) s := by + apply g.incoming_layer Space order oldBirth s old (ULift.{u} Bool) (fun _ => t) (fun _ => earlier) + (fun i => compose template.toMeetEmbedding (BinaryTiles.vertex R tile i.down)) + intro x + rcases BinaryTiles.vertex_cover R tile x with ⟨i, y, eq⟩ + refine ⟨⟨i⟩, template.inverse y, ?_⟩ + change (BinaryTiles.vertex R tile i).toFun (template.toFun (template.inverse y)) = x + rw [template.right_inverse] + exact eq + +end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AttachmentCoinitiality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AttachmentCoinitiality.lean index a3827e618d8e8091e68e04ec6fb4067c4405f571..4b7c1c752afb5c08dd868d22027f5bae4fcf098a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AttachmentCoinitiality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/AttachmentCoinitiality.lean @@ -1,113 +1,113 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RationalHeightDescent - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.Chronological - -open Attachment - -universe u - -variable {O I Stage : Type u} [LinearOrder Stage] {P : MeetOrder O} - (b : Templates.{u,u,u} P I) - -theorem attachment_bridge (birth : O ⊕ b.Fresh → Stage) (s : Stage) - (old : ∀ a, birth (.inl a) < s) (x y : b.Fresh) (different : x.1 ≠ y.1) : - OldBridge (P := b.extension) birth s (.inr x) (.inr y) := by - classical - by_cases xy : b.extension.le (.inr x) (.inr y) - · exact Or.inr (Or.inl ⟨.inl (b.shadow y), old _, - (b.cross_le_iff x y different).mp xy, P.refl _⟩) - · by_cases yx : b.extension.le (.inr y) (.inr x) - · exact Or.inr (Or.inr ⟨.inl (b.shadow x), old _, - (b.cross_le_iff y x different.symm).mp yx, P.refl _⟩) - · apply Or.inl - rw [b.cross_meet_eq x y different xy yx] - exact old _ - -theorem attachment_essential_component (birth : O ⊕ b.Fresh → Stage) (s : Stage) - (old : ∀ a, birth (.inl a) < s) (fresh : ∀ x : b.Fresh, birth (.inr x) = s) - (F : MeetFilter b.extension) (x y : b.Fresh) - (hx : Essential birth F (.inr x)) (hy : Essential birth F (.inr y)) : x.1 = y.1 := by - by_contra different - exact essentials_no_bridge birth F s (.inr x) (.inr y) hx hy (fresh x) (fresh y) - (attachment_bridge b birth s old x y different) - -theorem attachment_old_meet (birth : O ⊕ b.Fresh → Stage) (s : Stage) - (old : ∀ a, birth (.inl a) < s) (fresh : ∀ x : b.Fresh, birth (.inr x) = s) - (previous : OldMeet (P := P) (fun a => birth (.inl a))) : - OldMeet (P := b.extension) birth := by - intro x y earlier notLower - cases x with - | inl a => - cases y with - | inl c => - have eq := (b.oldEmbedding.map_meet a c).symm - change b.extension.meet (.inl a) (.inl c) = .inl (P.meet a c) at eq - rw [eq] - exact previous a c earlier notLower - | inr y => - rw [fresh] at earlier - exact False.elim (lt_asymm earlier (old a)) - | inr x => - cases y with - | inl a => - rw [b.shadow_meet_eq x a notLower, fresh] - exact old _ - | inr y => - rw [fresh, fresh] at earlier - exact False.elim (lt_irrefl _ earlier) - -def birthFresh (birth : O ⊕ b.Fresh → Stage) (s : Stage) - (old : ∀ a, birth (.inl a) < s) (x : {x // birth x = s}) : b.Fresh := by - rcases x with ⟨x, hx⟩ - cases x with - | inl a => - have impossible := old a - rw [hx] at impossible - exact False.elim (lt_irrefl _ impossible) - | inr x => exact x - -theorem birthFresh_eq (birth : O ⊕ b.Fresh → Stage) (s : Stage) - (old : ∀ a, birth (.inl a) < s) (x : {x // birth x = s}) : - Sum.inr (birthFresh b birth s old x) = x.val := by - rcases x with ⟨x, hx⟩ - cases x with - | inl a => - have impossible := old a - rw [hx] at impossible - exact False.elim (lt_irrefl _ impossible) - | inr x => rfl - -noncomputable def attachmentLayer (Space : Stage → Type u) (order : ∀ s, MeetOrder (Space s)) - (birth : O ⊕ b.Fresh → Stage) (s : Stage) (old : ∀ a, birth (.inl a) < s) - (index : I → Stage) (earlier : ∀ i, index i < s) - (template : ∀ i, MeetIso (order (index i)) (b.order i)) : - GrowthLayer Space order b.extension birth s := by - apply GrowthLayer.separated I index earlier - (fun i => compose (template i).toMeetEmbedding (b.templateEmbedding i)) - (fun x => (birthFresh b birth s old x).1) - · intro x - let z := birthFresh b birth s old x - refine ⟨(template z.1).inverse z.2.val, ?_⟩ - change b.represent z.1 ((template z.1).toFun ((template z.1).inverse z.2.val)) = x.val - rw [(template z.1).right_inverse, b.represent_new z.1 z.2.val z.2.property] - exact birthFresh_eq b birth s old x - · intro x y different - have bridge := attachment_bridge b birth s old - (birthFresh b birth s old x) (birthFresh b birth s old y) different - rw [birthFresh_eq, birthFresh_eq] at bridge - exact bridge - -def finiteLayer {A : Type u} {P : MeetOrder A} (Space : Stage → Type u) - (order : ∀ s, MeetOrder (Space s)) (birth : A → Stage) (s : Stage) - (finite : Set.Finite {x | birth x = s}) : GrowthLayer Space order P birth s := - .countablePoints finite.countable - -end PartitionPilot.Compression.RecursiveMaps.Chronological - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RationalHeightDescent + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.Chronological + +open Attachment + +universe u + +variable {O I Stage : Type u} [LinearOrder Stage] {P : MeetOrder O} + (b : Templates.{u,u,u} P I) + +theorem attachment_bridge (birth : O ⊕ b.Fresh → Stage) (s : Stage) + (old : ∀ a, birth (.inl a) < s) (x y : b.Fresh) (different : x.1 ≠ y.1) : + OldBridge (P := b.extension) birth s (.inr x) (.inr y) := by + classical + by_cases xy : b.extension.le (.inr x) (.inr y) + · exact Or.inr (Or.inl ⟨.inl (b.shadow y), old _, + (b.cross_le_iff x y different).mp xy, P.refl _⟩) + · by_cases yx : b.extension.le (.inr y) (.inr x) + · exact Or.inr (Or.inr ⟨.inl (b.shadow x), old _, + (b.cross_le_iff y x different.symm).mp yx, P.refl _⟩) + · apply Or.inl + rw [b.cross_meet_eq x y different xy yx] + exact old _ + +theorem attachment_essential_component (birth : O ⊕ b.Fresh → Stage) (s : Stage) + (old : ∀ a, birth (.inl a) < s) (fresh : ∀ x : b.Fresh, birth (.inr x) = s) + (F : MeetFilter b.extension) (x y : b.Fresh) + (hx : Essential birth F (.inr x)) (hy : Essential birth F (.inr y)) : x.1 = y.1 := by + by_contra different + exact essentials_no_bridge birth F s (.inr x) (.inr y) hx hy (fresh x) (fresh y) + (attachment_bridge b birth s old x y different) + +theorem attachment_old_meet (birth : O ⊕ b.Fresh → Stage) (s : Stage) + (old : ∀ a, birth (.inl a) < s) (fresh : ∀ x : b.Fresh, birth (.inr x) = s) + (previous : OldMeet (P := P) (fun a => birth (.inl a))) : + OldMeet (P := b.extension) birth := by + intro x y earlier notLower + cases x with + | inl a => + cases y with + | inl c => + have eq := (b.oldEmbedding.map_meet a c).symm + change b.extension.meet (.inl a) (.inl c) = .inl (P.meet a c) at eq + rw [eq] + exact previous a c earlier notLower + | inr y => + rw [fresh] at earlier + exact False.elim (lt_asymm earlier (old a)) + | inr x => + cases y with + | inl a => + rw [b.shadow_meet_eq x a notLower, fresh] + exact old _ + | inr y => + rw [fresh, fresh] at earlier + exact False.elim (lt_irrefl _ earlier) + +def birthFresh (birth : O ⊕ b.Fresh → Stage) (s : Stage) + (old : ∀ a, birth (.inl a) < s) (x : {x // birth x = s}) : b.Fresh := by + rcases x with ⟨x, hx⟩ + cases x with + | inl a => + have impossible := old a + rw [hx] at impossible + exact False.elim (lt_irrefl _ impossible) + | inr x => exact x + +theorem birthFresh_eq (birth : O ⊕ b.Fresh → Stage) (s : Stage) + (old : ∀ a, birth (.inl a) < s) (x : {x // birth x = s}) : + Sum.inr (birthFresh b birth s old x) = x.val := by + rcases x with ⟨x, hx⟩ + cases x with + | inl a => + have impossible := old a + rw [hx] at impossible + exact False.elim (lt_irrefl _ impossible) + | inr x => rfl + +noncomputable def attachmentLayer (Space : Stage → Type u) (order : ∀ s, MeetOrder (Space s)) + (birth : O ⊕ b.Fresh → Stage) (s : Stage) (old : ∀ a, birth (.inl a) < s) + (index : I → Stage) (earlier : ∀ i, index i < s) + (template : ∀ i, MeetIso (order (index i)) (b.order i)) : + GrowthLayer Space order b.extension birth s := by + apply GrowthLayer.separated I index earlier + (fun i => compose (template i).toMeetEmbedding (b.templateEmbedding i)) + (fun x => (birthFresh b birth s old x).1) + · intro x + let z := birthFresh b birth s old x + refine ⟨(template z.1).inverse z.2.val, ?_⟩ + change b.represent z.1 ((template z.1).toFun ((template z.1).inverse z.2.val)) = x.val + rw [(template z.1).right_inverse, b.represent_new z.1 z.2.val z.2.property] + exact birthFresh_eq b birth s old x + · intro x y different + have bridge := attachment_bridge b birth s old + (birthFresh b birth s old x) (birthFresh b birth s old y) different + rw [birthFresh_eq, birthFresh_eq] at bridge + exact bridge + +def finiteLayer {A : Type u} {P : MeetOrder A} (Space : Stage → Type u) + (order : ∀ s, MeetOrder (Space s)) (birth : A → Stage) (s : Stage) + (finite : Set.Finite {x | birth x = s}) : GrowthLayer Space order P birth s := + .countablePoints finite.countable + +end PartitionPilot.Compression.RecursiveMaps.Chronological + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ChronologicalTheorem.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ChronologicalTheorem.lean index 9146dc04c5dceea110a3cd77b769e1f66238ade7..3412827b8eb087d84a23be51996b0326ea603b3e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ChronologicalTheorem.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ChronologicalTheorem.lean @@ -1,259 +1,259 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionTheorem - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.Chronological - -universe u v w - -variable {A : Type u} {P : MeetOrder A} - -def CountableBelow (F : MeetFilter P) (target : A → Prop) : Prop := - ∃ B : Set A, B.Countable ∧ (∀ x ∈ B, F.mem x) ∧ - ∀ x, target x → ∃ y ∈ B, P.le y x - -def CountableBasis (F : MeetFilter P) : Prop := CountableBelow F F.mem - -def AllFiltersCountable (P : MeetOrder A) : Prop := ∀ F : MeetFilter P, CountableBasis F - -theorem countableBelow_mono (F : MeetFilter P) {small large : A → Prop} - (basis : CountableBelow F large) (subset : ∀ x, small x → large x) : CountableBelow F small := by - rcases basis with ⟨B, countable, positive, coinitial⟩ - exact ⟨B, countable, positive, fun x hx => coinitial x (subset x hx)⟩ - -theorem countableBelow_empty (F : MeetFilter P) (target : A → Prop) - (empty : ∀ x, ¬ target x) : CountableBelow F target := - ⟨∅, Set.countable_empty, by simp, fun x hx => False.elim (empty x hx)⟩ - -theorem countableBelow_of_countable (F : MeetFilter P) (target : A → Prop) - (countable : Set.Countable {x | target x}) (positive : ∀ x, target x → F.mem x) : - CountableBelow F target := - ⟨{x | target x}, countable, positive, fun x hx => ⟨x, hx, P.refl x⟩⟩ - -theorem countableBelow_union {I : Type v} [Countable I] (F : MeetFilter P) - (target : A → Prop) (parts : I → A → Prop) - (cover : ∀ x, target x → ∃ i, parts i x) - (localBases : ∀ i, CountableBelow F (parts i)) : CountableBelow F target := by - classical - choose B countable positive coinitial using localBases - refine ⟨⋃ i, B i, Set.countable_iUnion countable, ?_, ?_⟩ - · intro x hx - rcases Set.mem_iUnion.mp hx with ⟨i, hi⟩ - exact positive i x hi - · intro x hx - rcases cover x hx with ⟨i, hi⟩ - rcases coinitial i x hi with ⟨y, hy, below⟩ - exact ⟨y, Set.mem_iUnion.mpr ⟨i, hy⟩, below⟩ - -def pullFilter {B : Type v} {Q : MeetOrder B} (e : MeetEmbedding Q P) (F : MeetFilter P) - (inhabited : ∃ x, F.mem (e.toFun x)) : MeetFilter Q where - mem x := F.mem (e.toFun x) - nonempty := inhabited - upward hx lower := F.upward hx ((e.le_iff _ _).mpr lower) - closed_meet hx hy := by - rw [e.map_meet] - exact F.closed_meet hx hy - -theorem countableBelow_copy {B : Type v} {Q : MeetOrder B} - (e : MeetEmbedding Q P) (F : MeetFilter P) (earlier : AllFiltersCountable Q) : - CountableBelow F (fun x => F.mem x ∧ ∃ y, e.toFun y = x) := by - classical - by_cases inhabited : ∃ y, F.mem (e.toFun y) - · rcases earlier (pullFilter e F inhabited) with ⟨B, countable, positive, coinitial⟩ - refine ⟨e.toFun '' B, countable.image e.toFun, ?_, ?_⟩ - · rintro x ⟨y, hy, rfl⟩ - exact positive y hy - · rintro x ⟨hx, y, rfl⟩ - rcases coinitial y hx with ⟨z, hz, lower⟩ - exact ⟨e.toFun z, ⟨z, hz, rfl⟩, (e.le_iff _ _).mpr lower⟩ - · refine ⟨∅, Set.countable_empty, by simp, ?_⟩ - rintro x ⟨hx, y, rfl⟩ - exact False.elim (inhabited ⟨y, hx⟩) - -section Birth - -variable {Stage : Type v} [LinearOrder Stage] (birth : A → Stage) - -def Essential (F : MeetFilter P) (x : A) : Prop := - F.mem x ∧ ∀ y, F.mem y → P.le y x → ¬ birth y < birth x - -def EssentialStages (F : MeetFilter P) : Set Stage := - {s | ∃ x, Essential birth F x ∧ birth x = s} - -theorem positive_above_essential [WellFoundedLT Stage] (F : MeetFilter P) - (x : A) (positive : F.mem x) : ∃ y, Essential birth F y ∧ P.le y x := by - let S : Set Stage := {s | ∃ y, F.mem y ∧ P.le y x ∧ birth y = s} - have inhabited : S.Nonempty := ⟨birth x, x, positive, P.refl x, rfl⟩ - rcases wellFounded_lt.has_min S inhabited with ⟨s, ⟨y, hy, below, born⟩, minimal⟩ - refine ⟨y, ⟨hy, ?_⟩, below⟩ - intro z hz lower earlier - apply minimal (birth z) ⟨z, hz, P.trans lower below, rfl⟩ - exact born ▸ earlier - -def OldMeet : Prop := ∀ x y, birth y < birth x → ¬ P.le x y → - birth (P.meet x y) < birth x - -theorem essential_below_earlier (oldMeet : OldMeet (P := P) birth) (F : MeetFilter P) - (x y : A) (essential : Essential birth F x) (positive : F.mem y) - (earlier : birth y < birth x) : P.le x y ∧ x ≠ y := by - classical - have lower : P.le x y := by - by_contra hn - exact essential.2 (P.meet x y) (F.closed_meet essential.1 positive) - (P.meet_le_left x y) (oldMeet x y earlier hn) - refine ⟨lower, ?_⟩ - intro eq - subst y - exact lt_irrefl _ earlier - -def DescendingCountable {H : Type w} (R : HeightOrder H) : Prop := - ∀ (S : Set Stage) (value : S → H), - (∀ i j : S, i.val < j.val → R.lt (value j) (value i)) → S.Countable - -theorem essential_stages_countable {H : Type w} {R : HeightOrder H} - (height : StrictHeight P R) (descending : DescendingCountable (Stage := Stage) R) - (oldMeet : OldMeet (P := P) birth) (F : MeetFilter P) : - (EssentialStages birth F).Countable := by - classical - let point : EssentialStages birth F → A := fun s => Classical.choose s.property - have essential : ∀ s, Essential birth F (point s) := - fun s => (Classical.choose_spec s.property).1 - have born : ∀ s, birth (point s) = s.val := - fun s => (Classical.choose_spec s.property).2 - apply descending (EssentialStages birth F) (fun s => height.value (point s)) - intro i j earlier - have old : birth (point i) < birth (point j) := by rw [born, born]; exact earlier - have lower := essential_below_earlier birth oldMeet F (point j) (point i) - (essential j) (essential i).1 old - exact height.strict _ _ lower.1 lower.2 - -theorem countable_basis_of_layers [WellFoundedLT Stage] (F : MeetFilter P) - (stages : (EssentialStages birth F).Countable) - (localBases : ∀ s, CountableBelow F (fun x => Essential birth F x ∧ birth x = s)) : - CountableBasis F := by - have := stages.to_subtype - have essentials : CountableBelow F (Essential birth F) := - countableBelow_union F (Essential birth F) - (fun s : EssentialStages birth F => fun x => Essential birth F x ∧ birth x = s.val) - (fun x hx => ⟨⟨birth x, x, hx, rfl⟩, hx, rfl⟩) - (fun s => localBases s.val) - rcases essentials with ⟨B, countable, positive, coinitial⟩ - refine ⟨B, countable, positive, ?_⟩ - intro x hx - rcases positive_above_essential birth F x hx with ⟨y, hy, lower⟩ - rcases coinitial y hy with ⟨z, hz, below⟩ - exact ⟨z, hz, P.trans below lower⟩ - -end Birth - -end PartitionPilot.Compression.RecursiveMaps.Chronological - - - -namespace PartitionPilot.Compression.RecursiveMaps.Chronological - -universe u v - -variable {A Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} - -def OldBridge (birth : A → Stage) (s : Stage) (x y : A) : Prop := - birth (P.meet x y) < s ∨ - (∃ z, birth z < s ∧ P.le x z ∧ P.le z y) ∨ - (∃ z, birth z < s ∧ P.le y z ∧ P.le z x) - -theorem essentials_no_bridge (birth : A → Stage) (F : MeetFilter P) (s : Stage) - (x y : A) (hx : Essential birth F x) (hy : Essential birth F y) - (bx : birth x = s) (by_ : birth y = s) : ¬ OldBridge (P := P) birth s x y := by - intro bridge - rcases bridge with meet | between | between - · exact hx.2 (P.meet x y) (F.closed_meet hx.1 hy.1) (P.meet_le_left x y) (bx ▸ meet) - · rcases between with ⟨z, old, lower, upper⟩ - exact hy.2 z (F.upward hx.1 lower) upper (by_ ▸ old) - · rcases between with ⟨z, old, lower, upper⟩ - exact hx.2 z (F.upward hy.1 lower) upper (bx ▸ old) - -inductive GrowthLayer (Space : Stage → Type u) (order : ∀ s, MeetOrder (Space s)) - (P : MeetOrder A) (birth : A → Stage) (s : Stage) : Type (u + 1) where - | countablePoints (small : Set.Countable {x | birth x = s}) - | copies (I : Type u) (small : Countable I) (index : I → Stage) - (earlier : ∀ i, index i < s) - (copy : ∀ i, MeetEmbedding (order (index i)) P) - (cover : ∀ x, birth x = s → ∃ i y, (copy i).toFun y = x) - | separated (I : Type u) (index : I → Stage) (earlier : ∀ i, index i < s) - (copy : ∀ i, MeetEmbedding (order (index i)) P) - (component : {x // birth x = s} → I) - (cover : ∀ x : {x // birth x = s}, ∃ y, (copy (component x)).toFun y = x.val) - (separated : ∀ x y : {x // birth x = s}, component x ≠ component y → - OldBridge (P := P) birth s x.val y.val) - -theorem GrowthLayer.countable_essentials {Space : Stage → Type u} - {order : ∀ s, MeetOrder (Space s)} {birth : A → Stage} {s : Stage} - (layer : GrowthLayer Space order P birth s) (F : MeetFilter P) - (inductionHypothesis : ∀ t, t < s → AllFiltersCountable (order t)) : - CountableBelow F (fun x => Essential birth F x ∧ birth x = s) := by - classical - cases layer with - | countablePoints small => - exact countableBelow_of_countable F _ (small.mono (fun _ h => h.2)) (fun _ h => h.1.1) - | copies I small index earlier copy cover => - let := small - apply countableBelow_union F _ (fun i => fun x => F.mem x ∧ ∃ y, (copy i).toFun y = x) - · intro x hx - rcases cover x hx.2 with ⟨i, y, eq⟩ - exact ⟨i, hx.1.1, y, eq⟩ - · intro i - exact countableBelow_copy (copy i) F (inductionHypothesis (index i) (earlier i)) - | separated I index earlier copy component cover separated => - by_cases existsEssential : ∃ x, Essential birth F x ∧ birth x = s - · rcases existsEssential with ⟨x, hx, bx⟩ - let i := component ⟨x, bx⟩ - apply countableBelow_mono F - (countableBelow_copy (copy i) F (inductionHypothesis (index i) (earlier i))) - intro y hy - have same : component ⟨y, hy.2⟩ = i := by - by_contra different - exact essentials_no_bridge birth F s y x hy.1 hx hy.2 bx - (separated ⟨y, hy.2⟩ ⟨x, bx⟩ different) - have hz := cover ⟨y, hy.2⟩ - rw [same] at hz - exact ⟨hy.1.1, hz⟩ - · exact countableBelow_empty F _ (fun x hx => existsEssential ⟨x, hx⟩) - -structure History (Stage : Type u) [LinearOrder Stage] {H : Type v} (R : HeightOrder H) where - Space : Stage → Type u - order : ∀ s, MeetOrder (Space s) - birth : ∀ s, Space s → Stage - birth_le : ∀ s x, birth s x ≤ s - old_meet : ∀ s, OldMeet (P := order s) (birth s) - height : ∀ s, StrictHeight (order s) R - layer : ∀ cutoff s, s ≤ cutoff → GrowthLayer Space order (order cutoff) (birth cutoff) s - -theorem History.all_filters_countable [WellFoundedLT Stage] {H : Type v} {R : HeightOrder H} - (history : History Stage R) (descending : DescendingCountable (Stage := Stage) R) : - ∀ cutoff, AllFiltersCountable (history.order cutoff) := by - intro cutoff - have wf : WellFounded ((· < ·) : Stage → Stage → Prop) := wellFounded_lt - induction cutoff using wf.induction with - | h cutoff ih => - intro F - apply countable_basis_of_layers (history.birth cutoff) F - · exact essential_stages_countable (history.birth cutoff) (history.height cutoff) - descending (history.old_meet cutoff) F - · intro s - by_cases present : s ≤ cutoff - · apply (history.layer cutoff s present).countable_essentials F - intro t earlier - exact ih t (lt_of_lt_of_le earlier present) - · apply countableBelow_empty F _ - intro x hx - apply present - rw [← hx.2] - exact history.birth_le cutoff x - -end PartitionPilot.Compression.RecursiveMaps.Chronological - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionTheorem + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.Chronological + +universe u v w + +variable {A : Type u} {P : MeetOrder A} + +def CountableBelow (F : MeetFilter P) (target : A → Prop) : Prop := + ∃ B : Set A, B.Countable ∧ (∀ x ∈ B, F.mem x) ∧ + ∀ x, target x → ∃ y ∈ B, P.le y x + +def CountableBasis (F : MeetFilter P) : Prop := CountableBelow F F.mem + +def AllFiltersCountable (P : MeetOrder A) : Prop := ∀ F : MeetFilter P, CountableBasis F + +theorem countableBelow_mono (F : MeetFilter P) {small large : A → Prop} + (basis : CountableBelow F large) (subset : ∀ x, small x → large x) : CountableBelow F small := by + rcases basis with ⟨B, countable, positive, coinitial⟩ + exact ⟨B, countable, positive, fun x hx => coinitial x (subset x hx)⟩ + +theorem countableBelow_empty (F : MeetFilter P) (target : A → Prop) + (empty : ∀ x, ¬ target x) : CountableBelow F target := + ⟨∅, Set.countable_empty, by simp, fun x hx => False.elim (empty x hx)⟩ + +theorem countableBelow_of_countable (F : MeetFilter P) (target : A → Prop) + (countable : Set.Countable {x | target x}) (positive : ∀ x, target x → F.mem x) : + CountableBelow F target := + ⟨{x | target x}, countable, positive, fun x hx => ⟨x, hx, P.refl x⟩⟩ + +theorem countableBelow_union {I : Type v} [Countable I] (F : MeetFilter P) + (target : A → Prop) (parts : I → A → Prop) + (cover : ∀ x, target x → ∃ i, parts i x) + (localBases : ∀ i, CountableBelow F (parts i)) : CountableBelow F target := by + classical + choose B countable positive coinitial using localBases + refine ⟨⋃ i, B i, Set.countable_iUnion countable, ?_, ?_⟩ + · intro x hx + rcases Set.mem_iUnion.mp hx with ⟨i, hi⟩ + exact positive i x hi + · intro x hx + rcases cover x hx with ⟨i, hi⟩ + rcases coinitial i x hi with ⟨y, hy, below⟩ + exact ⟨y, Set.mem_iUnion.mpr ⟨i, hy⟩, below⟩ + +def pullFilter {B : Type v} {Q : MeetOrder B} (e : MeetEmbedding Q P) (F : MeetFilter P) + (inhabited : ∃ x, F.mem (e.toFun x)) : MeetFilter Q where + mem x := F.mem (e.toFun x) + nonempty := inhabited + upward hx lower := F.upward hx ((e.le_iff _ _).mpr lower) + closed_meet hx hy := by + rw [e.map_meet] + exact F.closed_meet hx hy + +theorem countableBelow_copy {B : Type v} {Q : MeetOrder B} + (e : MeetEmbedding Q P) (F : MeetFilter P) (earlier : AllFiltersCountable Q) : + CountableBelow F (fun x => F.mem x ∧ ∃ y, e.toFun y = x) := by + classical + by_cases inhabited : ∃ y, F.mem (e.toFun y) + · rcases earlier (pullFilter e F inhabited) with ⟨B, countable, positive, coinitial⟩ + refine ⟨e.toFun '' B, countable.image e.toFun, ?_, ?_⟩ + · rintro x ⟨y, hy, rfl⟩ + exact positive y hy + · rintro x ⟨hx, y, rfl⟩ + rcases coinitial y hx with ⟨z, hz, lower⟩ + exact ⟨e.toFun z, ⟨z, hz, rfl⟩, (e.le_iff _ _).mpr lower⟩ + · refine ⟨∅, Set.countable_empty, by simp, ?_⟩ + rintro x ⟨hx, y, rfl⟩ + exact False.elim (inhabited ⟨y, hx⟩) + +section Birth + +variable {Stage : Type v} [LinearOrder Stage] (birth : A → Stage) + +def Essential (F : MeetFilter P) (x : A) : Prop := + F.mem x ∧ ∀ y, F.mem y → P.le y x → ¬ birth y < birth x + +def EssentialStages (F : MeetFilter P) : Set Stage := + {s | ∃ x, Essential birth F x ∧ birth x = s} + +theorem positive_above_essential [WellFoundedLT Stage] (F : MeetFilter P) + (x : A) (positive : F.mem x) : ∃ y, Essential birth F y ∧ P.le y x := by + let S : Set Stage := {s | ∃ y, F.mem y ∧ P.le y x ∧ birth y = s} + have inhabited : S.Nonempty := ⟨birth x, x, positive, P.refl x, rfl⟩ + rcases wellFounded_lt.has_min S inhabited with ⟨s, ⟨y, hy, below, born⟩, minimal⟩ + refine ⟨y, ⟨hy, ?_⟩, below⟩ + intro z hz lower earlier + apply minimal (birth z) ⟨z, hz, P.trans lower below, rfl⟩ + exact born ▸ earlier + +def OldMeet : Prop := ∀ x y, birth y < birth x → ¬ P.le x y → + birth (P.meet x y) < birth x + +theorem essential_below_earlier (oldMeet : OldMeet (P := P) birth) (F : MeetFilter P) + (x y : A) (essential : Essential birth F x) (positive : F.mem y) + (earlier : birth y < birth x) : P.le x y ∧ x ≠ y := by + classical + have lower : P.le x y := by + by_contra hn + exact essential.2 (P.meet x y) (F.closed_meet essential.1 positive) + (P.meet_le_left x y) (oldMeet x y earlier hn) + refine ⟨lower, ?_⟩ + intro eq + subst y + exact lt_irrefl _ earlier + +def DescendingCountable {H : Type w} (R : HeightOrder H) : Prop := + ∀ (S : Set Stage) (value : S → H), + (∀ i j : S, i.val < j.val → R.lt (value j) (value i)) → S.Countable + +theorem essential_stages_countable {H : Type w} {R : HeightOrder H} + (height : StrictHeight P R) (descending : DescendingCountable (Stage := Stage) R) + (oldMeet : OldMeet (P := P) birth) (F : MeetFilter P) : + (EssentialStages birth F).Countable := by + classical + let point : EssentialStages birth F → A := fun s => Classical.choose s.property + have essential : ∀ s, Essential birth F (point s) := + fun s => (Classical.choose_spec s.property).1 + have born : ∀ s, birth (point s) = s.val := + fun s => (Classical.choose_spec s.property).2 + apply descending (EssentialStages birth F) (fun s => height.value (point s)) + intro i j earlier + have old : birth (point i) < birth (point j) := by rw [born, born]; exact earlier + have lower := essential_below_earlier birth oldMeet F (point j) (point i) + (essential j) (essential i).1 old + exact height.strict _ _ lower.1 lower.2 + +theorem countable_basis_of_layers [WellFoundedLT Stage] (F : MeetFilter P) + (stages : (EssentialStages birth F).Countable) + (localBases : ∀ s, CountableBelow F (fun x => Essential birth F x ∧ birth x = s)) : + CountableBasis F := by + have := stages.to_subtype + have essentials : CountableBelow F (Essential birth F) := + countableBelow_union F (Essential birth F) + (fun s : EssentialStages birth F => fun x => Essential birth F x ∧ birth x = s.val) + (fun x hx => ⟨⟨birth x, x, hx, rfl⟩, hx, rfl⟩) + (fun s => localBases s.val) + rcases essentials with ⟨B, countable, positive, coinitial⟩ + refine ⟨B, countable, positive, ?_⟩ + intro x hx + rcases positive_above_essential birth F x hx with ⟨y, hy, lower⟩ + rcases coinitial y hy with ⟨z, hz, below⟩ + exact ⟨z, hz, P.trans below lower⟩ + +end Birth + +end PartitionPilot.Compression.RecursiveMaps.Chronological + + + +namespace PartitionPilot.Compression.RecursiveMaps.Chronological + +universe u v + +variable {A Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} + +def OldBridge (birth : A → Stage) (s : Stage) (x y : A) : Prop := + birth (P.meet x y) < s ∨ + (∃ z, birth z < s ∧ P.le x z ∧ P.le z y) ∨ + (∃ z, birth z < s ∧ P.le y z ∧ P.le z x) + +theorem essentials_no_bridge (birth : A → Stage) (F : MeetFilter P) (s : Stage) + (x y : A) (hx : Essential birth F x) (hy : Essential birth F y) + (bx : birth x = s) (by_ : birth y = s) : ¬ OldBridge (P := P) birth s x y := by + intro bridge + rcases bridge with meet | between | between + · exact hx.2 (P.meet x y) (F.closed_meet hx.1 hy.1) (P.meet_le_left x y) (bx ▸ meet) + · rcases between with ⟨z, old, lower, upper⟩ + exact hy.2 z (F.upward hx.1 lower) upper (by_ ▸ old) + · rcases between with ⟨z, old, lower, upper⟩ + exact hx.2 z (F.upward hy.1 lower) upper (bx ▸ old) + +inductive GrowthLayer (Space : Stage → Type u) (order : ∀ s, MeetOrder (Space s)) + (P : MeetOrder A) (birth : A → Stage) (s : Stage) : Type (u + 1) where + | countablePoints (small : Set.Countable {x | birth x = s}) + | copies (I : Type u) (small : Countable I) (index : I → Stage) + (earlier : ∀ i, index i < s) + (copy : ∀ i, MeetEmbedding (order (index i)) P) + (cover : ∀ x, birth x = s → ∃ i y, (copy i).toFun y = x) + | separated (I : Type u) (index : I → Stage) (earlier : ∀ i, index i < s) + (copy : ∀ i, MeetEmbedding (order (index i)) P) + (component : {x // birth x = s} → I) + (cover : ∀ x : {x // birth x = s}, ∃ y, (copy (component x)).toFun y = x.val) + (separated : ∀ x y : {x // birth x = s}, component x ≠ component y → + OldBridge (P := P) birth s x.val y.val) + +theorem GrowthLayer.countable_essentials {Space : Stage → Type u} + {order : ∀ s, MeetOrder (Space s)} {birth : A → Stage} {s : Stage} + (layer : GrowthLayer Space order P birth s) (F : MeetFilter P) + (inductionHypothesis : ∀ t, t < s → AllFiltersCountable (order t)) : + CountableBelow F (fun x => Essential birth F x ∧ birth x = s) := by + classical + cases layer with + | countablePoints small => + exact countableBelow_of_countable F _ (small.mono (fun _ h => h.2)) (fun _ h => h.1.1) + | copies I small index earlier copy cover => + let := small + apply countableBelow_union F _ (fun i => fun x => F.mem x ∧ ∃ y, (copy i).toFun y = x) + · intro x hx + rcases cover x hx.2 with ⟨i, y, eq⟩ + exact ⟨i, hx.1.1, y, eq⟩ + · intro i + exact countableBelow_copy (copy i) F (inductionHypothesis (index i) (earlier i)) + | separated I index earlier copy component cover separated => + by_cases existsEssential : ∃ x, Essential birth F x ∧ birth x = s + · rcases existsEssential with ⟨x, hx, bx⟩ + let i := component ⟨x, bx⟩ + apply countableBelow_mono F + (countableBelow_copy (copy i) F (inductionHypothesis (index i) (earlier i))) + intro y hy + have same : component ⟨y, hy.2⟩ = i := by + by_contra different + exact essentials_no_bridge birth F s y x hy.1 hx hy.2 bx + (separated ⟨y, hy.2⟩ ⟨x, bx⟩ different) + have hz := cover ⟨y, hy.2⟩ + rw [same] at hz + exact ⟨hy.1.1, hz⟩ + · exact countableBelow_empty F _ (fun x hx => existsEssential ⟨x, hx⟩) + +structure History (Stage : Type u) [LinearOrder Stage] {H : Type v} (R : HeightOrder H) where + Space : Stage → Type u + order : ∀ s, MeetOrder (Space s) + birth : ∀ s, Space s → Stage + birth_le : ∀ s x, birth s x ≤ s + old_meet : ∀ s, OldMeet (P := order s) (birth s) + height : ∀ s, StrictHeight (order s) R + layer : ∀ cutoff s, s ≤ cutoff → GrowthLayer Space order (order cutoff) (birth cutoff) s + +theorem History.all_filters_countable [WellFoundedLT Stage] {H : Type v} {R : HeightOrder H} + (history : History Stage R) (descending : DescendingCountable (Stage := Stage) R) : + ∀ cutoff, AllFiltersCountable (history.order cutoff) := by + intro cutoff + have wf : WellFounded ((· < ·) : Stage → Stage → Prop) := wellFounded_lt + induction cutoff using wf.induction with + | h cutoff ih => + intro F + apply countable_basis_of_layers (history.birth cutoff) F + · exact essential_stages_countable (history.birth cutoff) (history.height cutoff) + descending (history.old_meet cutoff) F + · intro s + by_cases present : s ≤ cutoff + · apply (history.layer cutoff s present).countable_essentials F + intro t earlier + exact ih t (lt_of_lt_of_le earlier present) + · apply countableBelow_empty F _ + intro x hx + apply present + rw [← hx.2] + exact history.birth_le cutoff x + +end PartitionPilot.Compression.RecursiveMaps.Chronological + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CodedMainPrefixSystems.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CodedMainPrefixSystems.lean index 0aaf84ca0366730babe533ca7d1fa2ed5a2522dd..bad2297c22235732b4b93ba5a843bbb39d51143e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CodedMainPrefixSystems.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CodedMainPrefixSystems.lean @@ -1,635 +1,635 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundExternalCutoffFieldGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.GroundLowRankFunctionGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSerializedCodeRanks -import OAI.SetTheory.PartitionPrinciple.Definability.LinkedMainInvariantCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionFiniteFieldGraphs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialSeedSerializationRanks -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageCandidates - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace GroundChronologicalHistory -noncomputable def fieldValue {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} - (prior : GroundChronologicalHistory M T C D rD) : Fin 5 → ZFSet.{u} → ZFSet.{u} := - Fin.cases prior.space (Fin.cases prior.order (Fin.cases prior.meetGraph - (Fin.cases prior.birth (fun _ => prior.height)))) - -end GroundChronologicalHistory - -namespace CompressionChronologyFields -noncomputable def fieldValue (fields : CompressionChronologyFields.{u}) : Fin 5 → ZFSet.{u} → ZFSet.{u} := - Fin.cases fields.space (Fin.cases fields.order (Fin.cases fields.meetGraph - (Fin.cases fields.birth (fun _ => fields.height)))) - -end CompressionChronologyFields - -namespace GroundExternalBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (priorFields : GroundChronologyFields M T0) - -noncomputable def chronologyGraph (j : Fin 5) : ZFSet.{u} := - compressionPrefixGraph oldTimes births.limit (priorFields.graph j) - (births.cutoffFieldFamily heights j) births.stamps (births.terminalField heights j) - -variable {inv : ZFSet.{u}} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (ordinal : ordinalSetProperty T0) (hOld : oldTimes ∈ T0) -include data group action pairing unions powers separation infinite hG hP0 - -theorem chronologyGraph_ground (j : Fin 5) : births.chronologyGraph heights priorFields j ∈ M.sets := - M.compressionPrefixGraph_mem pairing unions powers separation - (M.omega_mem separation infinite) - (M.transitive births.limit_ground births.times.base_mem_limit) births.limit_ground - (priorFields.graph_ground j) - (births.cutoffFieldFamily_spec heights data group action pairing unions powers separation infinite hG hP0 j).1 - births.stamps_ground - (births.terminalField_ground heights data group action pairing unions powers separation infinite hG hP0 j) - -include ordinal hOld in -theorem chronologyGraph_function (j : Fin 5) : - FunctionGraphOn (insert births.limit births.limit) (births.chronologyGraph heights priorFields j) := by - apply compressionPrefixGraph_function births.times (priorFields.value j) (births.cutoffField heights j) - · intro s before y - have hs : s ∈ T0 := before.elim (fun h => ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) - exact ⟨fun entry => (priorFields.value_eq_of_entry j entry).symm, - fun equal => equal.symm ▸ priorFields.value_entry j hs⟩ - · exact (births.cutoffFieldFamily_spec heights data group action pairing unions powers separation infinite hG hP0 j).2.2 - -noncomputable def groundChronologyFields : GroundChronologyFields M (insert births.limit births.limit) := - GroundChronologyFields.ofGraphs pairing unions (M.insert_mem pairing unions births.limit_ground births.limit_ground) - (births.chronologyGraph heights priorFields) - (births.chronologyGraph_ground heights priorFields data group action pairing unions powers separation infinite hG hP0) - (births.chronologyGraph_function heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld) - -theorem groundChronologyFields_graph : - (births.groundChronologyFields heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld).graph = - births.chronologyGraph heights priorFields := rfl - -include ordinal hOld in -theorem groundChronologyFields_values (prior : GroundChronologicalHistory M T0 C D rD) - (agreement : ∀ j s, s ∈ T0 → priorFields.value j s = prior.fieldValue j s) - (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ insert births.limit births.limit) : - (births.groundChronologyFields heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld).value j s = - (births.chronologyFields heights prior).fieldValue j s := by - have field : (births.chronologyFields heights prior).fieldValue j = - compressionPrefixValue oldTimes births.limit (prior.fieldValue j) - (births.cutoffField heights j) (births.terminalField heights j) := - Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j - have oldEntries : ∀ t, t ∈ oldTimes ∨ t = oldTimes → ∀ y, - ZFSet.pair t y ∈ priorFields.graph j ↔ y = prior.fieldValue j t := by - intro t before y - have ht : t ∈ T0 := before.elim (fun h => ordinal.1 oldTimes hOld t h) (fun h => h.symm ▸ hOld) - constructor - · intro entry - exact (priorFields.value_eq_of_entry j entry).symm.trans (agreement j t ht) - · intro equal - rw [← agreement j t ht] at equal - exact equal.symm ▸ priorFields.value_entry j ht - apply GroundChronologyFields.value_eq_of_entry - change ZFSet.pair s ((births.chronologyFields heights prior).fieldValue j s) ∈ - compressionPrefixGraph oldTimes births.limit (priorFields.graph j) - (births.cutoffFieldFamily heights j) births.stamps (births.terminalField heights j) - exact (compressionPrefixGraph_exact births.times (prior.fieldValue j) (births.cutoffField heights j) - oldEntries (births.cutoffFieldFamily_spec heights data group action pairing unions powers separation infinite hG hP0 j).2.2 s _).2 - ⟨hs,congrFun field s⟩ - -include ordinal hOld in -theorem groundChronologyFields_code_ground : - (births.groundChronologyFields heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld).code ∈ M.sets := - GroundChronologyFields.code_ground _ pairing - -end GroundExternalBirthData - - - - -namespace GroundChronologyFields -variable {M : TransitiveGround.{u}} {T U cutoff : ZFSet.{u}} - -theorem graphPrefixCode_iff_values (source : GroundChronologyFields M T) - (target : GroundChronologyFields M U) - (domains : ∀ s, s = cutoff ∨ s ∈ cutoff → s ∈ T ∧ s ∈ U) : - ChronologyGraphPrefixCode cutoff source.graph target.graph ↔ - ∀ j s, s = cutoff ∨ s ∈ cutoff → source.value j s = target.value j s := by - constructor - · intro code j s before - exact (target.value_eq_of_entry j - ((code j s before _).1 (source.value_entry j (domains s before).1))).symm - · intro values j s before x - constructor - · intro entry - have equal := (values j s before).symm.trans (source.value_eq_of_entry j entry) - exact equal ▸ target.value_entry j (domains s before).2 - · intro entry - have equal := (values j s before).trans (target.value_eq_of_entry j entry) - exact equal ▸ source.value_entry j (domains s before).1 - -end GroundChronologyFields - -namespace GroundChronologicalMainTransition -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {source target : GroundChronologicalMainStage M C D rD} -variable (sourceFields : GroundChronologyFields M (insert source.cutoff source.cutoff)) -variable (targetFields : GroundChronologyFields M (insert target.cutoff target.cutoff)) -variable (sourceAgreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → - sourceFields.value j s = source.history.fieldValue j s) -variable (targetAgreement : ∀ j s, s ∈ insert target.cutoff target.cutoff → - targetFields.value j s = target.history.fieldValue j s) - -include sourceAgreement targetAgreement - -theorem field_laws (transition : GroundChronologicalMainTransition source target) : - ChronologicalTransitionLaws transition.map.points source.cutoff target.cutoff source.birth target.birth - sourceFields.graph targetFields.graph := by - refine ⟨transition.cutoff_le, transition.birth, ?_⟩ - apply (sourceFields.graphPrefixCode_iff_values targetFields (fun s before => - ⟨ZFSet.mem_insert_iff.2 before, ZFSet.mem_insert_iff.2 (transition.prefix_bound before)⟩)).2 - intro j s before - rw [sourceAgreement j s (ZFSet.mem_insert_iff.2 before), - targetAgreement j s (ZFSet.mem_insert_iff.2 (transition.prefix_bound before))] - have h := transition.history_prefix s before - exact Fin.cases h.1.symm (Fin.cases h.2.1.symm (Fin.cases h.2.2.1.symm - (Fin.cases h.2.2.2.1.symm (Fin.cases h.2.2.2.2.symm (fun i => Fin.elim0 i))))) j - -def ofFieldLaws (map : GroundMainTransition source.stage target.stage) - (valid : ChronologicalTransitionLaws map.points source.cutoff target.cutoff source.birth target.birth - sourceFields.graph targetFields.graph) : GroundChronologicalMainTransition source target where - map := map - cutoff_le := valid.cutoff_le - birth := valid.birth - history_prefix := by - intro s before - have bound : s = target.cutoff ∨ s ∈ target.cutoff := by - rcases valid.cutoff_le with equal | lower - · exact equal ▸ before - · exact Or.inr (before.elim (fun equal => equal.symm ▸ lower) - (fun hs => target.cutoff_ordinal.1 source.cutoff lower s hs)) - have values := (sourceFields.graphPrefixCode_iff_values targetFields (fun a earlier => by - refine ⟨ZFSet.mem_insert_iff.2 earlier, ZFSet.mem_insert_iff.2 ?_⟩ - rcases valid.cutoff_le with equal | lower - · exact equal ▸ earlier - · exact Or.inr (earlier.elim (fun equal => equal.symm ▸ lower) - (fun ha => target.cutoff_ordinal.1 source.cutoff lower a ha)))).1 valid.history_prefix - have same (j : Fin 5) : target.history.fieldValue j s = source.history.fieldValue j s := by - rw [← sourceAgreement j s (ZFSet.mem_insert_iff.2 before), - ← targetAgreement j s (ZFSet.mem_insert_iff.2 bound)] - exact (values j s before).symm - exact ⟨same 0, same 1, same 2, same 3, same 4⟩ - -theorem ofFieldLaws_map (map : GroundMainTransition source.stage target.stage) - (valid : ChronologicalTransitionLaws map.points source.cutoff target.cutoff source.birth target.birth - sourceFields.graph targetFields.graph) : - (ofFieldLaws sourceFields targetFields sourceAgreement targetAgreement map valid).map = map := rfl - -theorem ofFieldLaws_self (transition : GroundChronologicalMainTransition source target) : - ofFieldLaws sourceFields targetFields sourceAgreement targetAgreement transition.map - (field_laws sourceFields targetFields sourceAgreement targetAgreement transition) = transition := - ext rfl - -end GroundChronologicalMainTransition -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} - -theorem GroundChronologicalHistory.fieldValue_rank_lt - (history : GroundChronologicalHistory M T C D rD) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (times : ZFSet.rank T < o) (columns : ZFSet.rank C < o) - (coordinates : ZFSet.rank D < o) {s : ZFSet.{u}} (hs : s ∈ T) - (points : ZFSet.rank (history.space s) < o) (j : Fin 5) : - ZFSet.rank (history.fieldValue j s) < o := by - have meet := history.meet_order s hs - have pp := rank_product_lt limit points points - have order := (ZFSet.rank_mono meet.order.relation).trans_lt pp - have operation := rank_functionGraph_lt limit meet.operation pp points - have birth := rank_functionGraph_lt limit (history.birth_function s hs) points times - have height := rank_functionGraph_lt limit (history.strict_height s hs).function points - (rank_product_lt limit columns coordinates) - exact Fin.cases points (Fin.cases order (Fin.cases operation - (Fin.cases birth (Fin.cases height (fun i => Fin.elim0 i))))) j - -namespace GroundChronologyFields -variable (fields : GroundChronologyFields M T) - -theorem graph_rank_lt_of_history - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (hT : T ∈ K) (history : GroundChronologicalHistory M T C D rD) - (agreement : ∀ j s, s ∈ T → fields.value j s = history.fieldValue j s) - (points : ∀ s ∈ T, ZFSet.rank (history.space s) < ZFSet.rank K) - (columns : ZFSet.rank C < ZFSet.rank K) (coordinates : ZFSet.rank D < ZFSet.rank K) - (j : Fin 5) : ZFSet.rank (fields.graph j) < ZFSet.rank K := by - apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite hK - hT (fields.graph_ground j) ⟨fields.bound, fields.function j⟩ - intro s hs v entry - rw [← fields.value_eq_of_entry j entry, agreement j s hs] - exact history.fieldValue_rank_lt - (conditions.rank_isLimit pairing unions powers separation infinite hK) - (ZFSet.rank_lt_of_mem hT) columns coordinates hs (points s hs) j - -end GroundChronologyFields - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (priorFields : GroundChronologyFields M T0) -variable (prior : GroundChronologicalHistory M T0 C Q qlt) - -noncomputable def prefixGraph (finiteGraphs : Fin 5 → ZFSet.{u}) (j : Fin 5) : ZFSet.{u} := - compressionPrefixGraph base births.limit (priorFields.graph j) (finiteGraphs j) births.stamps - (state.prefixTerminalField data births heights j) - -theorem prefixGraph_exact - (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) - (agreement : ∀ j s, s ∈ T0 → priorFields.value j s = prior.fieldValue j s) - {finiteGraphs : Fin 5 → ZFSet.{u}} - (finiteEntries : ∀ j n y, ZFSet.pair (natSetCode n) y ∈ finiteGraphs j ↔ - y = state.prefixFiniteField data births heights j n) - (j : Fin 5) (s y : ZFSet.{u}) : - ZFSet.pair s y ∈ state.prefixGraph data births heights priorFields finiteGraphs j ↔ - s ∈ insert births.limit births.limit ∧ - y = (state.prefixFields data births heights prior).fieldValue j s := by - have field : (state.prefixFields data births heights prior).fieldValue j = - compressionPrefixValue base births.limit (prior.fieldValue j) - (state.prefixFiniteField data births heights j) (state.prefixTerminalField data births heights j) := - Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j - rw [field] - apply compressionPrefixGraph_exact births.times - · intro t before z - have ht : t ∈ T0 := before.elim (fun h => ordinal.1 base hBase t h) (fun h => h.symm ▸ hBase) - constructor - · intro entry - exact (priorFields.value_eq_of_entry j entry).symm.trans (agreement j t ht) - · intro equal - rw [← agreement j t ht] at equal - exact equal.symm ▸ priorFields.value_entry j ht - · exact finiteEntries j - -theorem exists_groundPrefixFields - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) - (agreement : ∀ j s, s ∈ T0 → priorFields.value j s = prior.fieldValue j s) : - ∃ fields : GroundChronologyFields M (insert births.limit births.limit), - fields.code ∈ M.sets ∧ ChronologyCoreCode (insert births.limit births.limit) - fields.bound C Q qlt fields.graph ∧ - ∀ j s, s ∈ insert births.limit births.limit → - fields.value j s = (state.prefixFields data births heights prior).fieldValue j s := by - obtain ⟨finiteGraphs, finiteGround, _, finiteEntries⟩ := state.exists_prefixFiniteGraphs data births heights - pairing unions powers separation collection infinite hI hSources hReps hG hT - let graphs := state.prefixGraph data births heights priorFields finiteGraphs - have ground : ∀ j, graphs j ∈ M.sets := by - intro j - exact M.compressionPrefixGraph_mem pairing unions powers separation (M.omega_mem separation infinite) - (M.transitive births.limit_ground births.times.base_mem_limit) births.limit_ground - (priorFields.graph_ground j) (finiteGround j) births.stamps_ground - (state.prefixTerminalField_ground data births heights j) - have functions : ∀ j, FunctionGraphOn (insert births.limit births.limit) (graphs j) := by - intro j - apply compressionPrefixGraph_function births.times (priorFields.value j) - (state.prefixFiniteField data births heights j) - · intro s before y - have hs : s ∈ T0 := before.elim (fun h => ordinal.1 base hBase s h) (fun h => h.symm ▸ hBase) - exact ⟨fun entry => (priorFields.value_eq_of_entry j entry).symm, - fun equal => equal.symm ▸ priorFields.value_entry j hs⟩ - · exact finiteEntries j - let fields := GroundChronologyFields.ofGraphs pairing unions - (M.insert_mem pairing unions births.limit_ground births.limit_ground) graphs ground functions - have values : ∀ j s, s ∈ insert births.limit births.limit → - fields.value j s = (state.prefixFields data births heights prior).fieldValue j s := by - intro j s hs - apply fields.value_eq_of_entry - exact (state.prefixGraph_exact data births heights priorFields prior ordinal hBase agreement - finiteEntries j s _).2 ⟨hs, rfl⟩ - refine ⟨fields, fields.code_ground pairing, ⟨fields.function, ?_⟩, values⟩ - intro s hs L r μ birth height eL er eμ eb eh - have eqL := (fields.value_eq_of_entry 0 eL).symm.trans (values 0 s hs) - have eqr := (fields.value_eq_of_entry 1 er).symm.trans (values 1 s hs) - have eqμ := (fields.value_eq_of_entry 2 eμ).symm.trans (values 2 s hs) - have eqb := (fields.value_eq_of_entry 3 eb).symm.trans (values 3 s hs) - have eqh := (fields.value_eq_of_entry 4 eh).symm.trans (values 4 s hs) - rw [eqL, eqr, eqμ, eqb, eqh] - have laws := state.prefixFields_stage_laws data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs - exact ⟨laws.1, laws.2.1, laws.2.2.1, laws.2.2.2.1, laws.2.2.2.2⟩ - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def linkedMainStageCode (stage cutoff serial : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 2 (Fin.cases stage (Fin.cases cutoff (fun _ => serial))) - -theorem linkedMainStageCode_inj {a t h a' t' h' : ZFSet.{u}} : - linkedMainStageCode a t h = linkedMainStageCode a' t' h' ↔ a = a' ∧ t = t' ∧ h = h' := by - constructor - · intro equal - have fields := nonemptyTupleCode_injective 2 equal - exact ⟨congrFun fields 0, congrFun fields 1, congrFun fields 2⟩ - · rintro ⟨rfl, rfl, rfl⟩ - rfl - -structure GroundLinkedMainStage (M : TransitiveGround.{u}) (K Labels C D rD : ZFSet.{u}) where - main : GroundChronologicalMainStage M C D rD - serial : GroundSerializedChronology M (insert main.cutoff main.cutoff) C D rD - agreement : ∀ j s, s ∈ insert main.cutoff main.cutoff → - serial.fields.value j s = main.history.fieldValue j s - invariant : main.Invariant K Labels - serial_rank : ZFSet.rank serial.code < ZFSet.rank K - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (linked : GroundLinkedMainStage M K Labels C D rD) - -noncomputable def code : ZFSet.{u} := - linkedMainStageCode linked.main.stage.code linked.main.cutoff linked.serial.code - -theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : linked.code ∈ M.sets := - M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases (linked.main.stage.code_mem pairing) - (Fin.cases linked.main.cutoff_ground (fun _ => linked.serial.code_ground pairing))) - -theorem terminal_values : - linked.serial.fields.value 0 linked.main.cutoff = linked.main.stage.carrier ∧ - linked.serial.fields.value 1 linked.main.cutoff = linked.main.stage.order ∧ - linked.serial.fields.value 2 linked.main.cutoff = linked.main.stage.meetGraph ∧ - linked.serial.fields.value 3 linked.main.cutoff = linked.main.birth ∧ - linked.serial.fields.value 4 linked.main.cutoff = linked.main.stage.height := - ⟨(linked.agreement 0 _ (ZFSet.mem_insert _ _)).trans linked.main.carrier_eq, - (linked.agreement 1 _ (ZFSet.mem_insert _ _)).trans linked.main.order_eq, - (linked.agreement 2 _ (ZFSet.mem_insert _ _)).trans linked.main.meet_eq, - linked.agreement 3 _ (ZFSet.mem_insert _ _), - (linked.agreement 4 _ (ZFSet.mem_insert _ _)).trans linked.main.height_eq⟩ - -theorem invariant_code : LinkedMainInvariantCode M K Labels C D linked.main.stage.carrier - linked.main.stage.actors linked.main.cutoff linked.serial.code := - ⟨linked.invariant.points_small, linked.invariant.actors_small, linked.invariant.labels_small, - linked.invariant.points_rank, linked.invariant.actors_rank, linked.invariant.labels_rank, - linked.invariant.cutoff_mem, linked.invariant.columns_rank, linked.invariant.coordinates_rank, - linked.serial_rank⟩ - -theorem code_rank_lt - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) : ZFSet.rank linked.code < ZFSet.rank K := - rank_nonemptyTupleCode_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) 2 _ - (Fin.cases (linked.invariant.code_rank_lt pairing unions powers separation infinite hK conditions) - (Fin.cases (ZFSet.rank_lt_of_mem linked.invariant.cutoff_mem) (fun _ => linked.serial_rank))) - -end GroundLinkedMainStage - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u v - -structure GroundMainPrefix (M : TransitiveGround.{u}) (K Labels C D rD : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (I : Type v) [Small.{u} I] [Preorder I] where - key : I → ZFSet.{u} - key_injective : Function.Injective key - key_order : ∀ i j, i ≤ j ↔ key i = key j ∨ key i ∈ key j - indices_ground : ZFSet.range key ∈ M.sets - indices_ordinal : ordinalSetProperty (ZFSet.range key) - diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I - linked : I → GroundLinkedMainStage M K Labels C D rD - linked_main : ∀ i, (linked i).main = diagram.stage i - coverage : diagram.CoversOldBirths - stages_ground : familyCodeGraph key (fun i => (linked i).code) ∈ M.sets - transitions_ground : familyCodeGraph (mainTransitionIndexKey key) - (fun p => (diagram.transition p.property).map.code) ∈ M.sets - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def indices : ZFSet.{u} := ZFSet.range run.key - -noncomputable def stageGraph : ZFSet.{u} := familyCodeGraph run.key (fun i => (run.linked i).code) - -noncomputable def transitionGraph : ZFSet.{u} := familyCodeGraph (mainTransitionIndexKey run.key) - (fun p => (run.diagram.transition p.property).map.code) - -noncomputable def code : ZFSet.{u} := nonemptyTupleCode 2 - (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) - -theorem code_ground : run.code ∈ M.sets := - M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases run.indices_ground - (Fin.cases run.stages_ground (fun _ => run.transitions_ground))) - -theorem stageGraph_function : FunctionGraphOn run.indices run.stageGraph := - familyCodeGraph_function run.key _ run.key_injective - -theorem transitionGraph_function : FunctionGraphOn (chronologyPairs run.indices) run.transitionGraph := by - have function := familyCodeGraph_function (mainTransitionIndexKey run.key) - (fun p => (run.diagram.transition p.property).map.code) - (mainTransitionIndexKey_injective run.key run.key_injective) - rw [mainTransitionIndex_range run.key run.key_order] at function - exact function - -theorem stageGraph_entry (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.stageGraph ↔ z = (run.linked i).code := - pair_mem_familyCodeGraph run.key _ run.key_injective i z - -theorem transitionGraph_entry {i j : I} (before : i ≤ j) (z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.transitionGraph ↔ - z = (run.diagram.transition before).map.code := - pair_mem_familyCodeGraph (mainTransitionIndexKey run.key) _ - (mainTransitionIndexKey_injective run.key run.key_injective) ⟨(i, j), before⟩ z - -theorem identity_entry (i : I) : - ZFSet.pair (ZFSet.pair (run.key i) (run.key i)) - (GroundChronologicalMainTransition.identity pairing unions powers separation (run.diagram.stage i)).map.code ∈ - run.transitionGraph := by - rw [run.transitionGraph_entry (le_refl i), run.diagram.self] - -theorem composition_entry {i j k : I} (hij : i ≤ j) (hjk : j ≤ k) : - ZFSet.pair (ZFSet.pair (run.key k) (run.key i)) - ((run.diagram.transition hij).comp pairing unions powers separation - (run.diagram.transition hjk)).map.code ∈ run.transitionGraph := by - rw [run.transitionGraph_entry (le_trans hij hjk), run.diagram.comp hij hjk] - -end GroundMainPrefix - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundInitialMainSeedData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} -variable (seed : GroundInitialMainSeedData M K C) - -theorem initialSerialization_agreement - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {injection : ZFSet.{u}} (hInjection : injection ∈ M.sets) - (injected : InjectionCode seed.source.stage.carrier ZFSet.omega injection) : - let serial := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected - ∀ j t, t ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u}) → - serial.fields.value j t = seed.source.history.fieldValue j t := by - dsimp only - intro j t ht - have zero : t = ∅ := by - simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using ht - subst t - have values := seed.source.stage.initialSerializedChronology_values pairing unions powers separation - hInjection injected (ZFSet.mem_insert (∅ : ZFSet.{u}) ∅) - have carrier := (congrArg seed.source.history.space seed.cutoff_zero).symm.trans seed.source.carrier_eq - have order := (congrArg seed.source.history.order seed.cutoff_zero).symm.trans seed.source.order_eq - have meet := (congrArg seed.source.history.meetGraph seed.cutoff_zero).symm.trans seed.source.meet_eq - have height := (congrArg seed.source.history.height seed.cutoff_zero).symm.trans seed.source.height_eq - have birth : seed.source.stage.initialBirth = seed.source.history.birth ∅ := by - have equal : seed.source.stage.initialBirth = seed.source.birth := by - rw [GroundMainStage.initialBirth, seed.points_eq, seed.birth_eq] - exact equal.trans (congrArg seed.source.history.birth seed.cutoff_zero) - exact Fin.cases (values.1.trans carrier.symm) - (Fin.cases (values.2.1.trans order.symm) - (Fin.cases (values.2.2.1.trans meet.symm) - (Fin.cases (values.2.2.2.1.trans birth) - (Fin.cases (values.2.2.2.2.trans height.symm) (fun i => Fin.elim0 i))))) j - -end PartitionPilot.Forcing.GroundInitialMainSeedData - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u v -namespace GroundChronologicalMainDiagram -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Preorder I] -variable (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) - -noncomputable def pointSystem (upper : ∀ i j : I, ∃ k, i ≤ k ∧ j ≤ k) : CodedDirectSystem.{u} I where - carrier i := (diagram.stage i).stage.carrier - map before := (diagram.transition before).map.points - injection before := (diagram.transition before).map.point_embedding.injection - identity := by - intro i - rw [diagram.self] - rfl - composition := by - intro i j k first second - rw [diagram.comp first second] - rfl - common_upper := upper - -noncomputable def actorSystem (upper : ∀ i j : I, ∃ k, i ≤ k ∧ j ≤ k) : CodedDirectSystem.{u} I where - carrier i := (diagram.stage i).stage.actors - map before := (diagram.transition before).map.actors - injection before := (diagram.transition before).map.group_embedding.injection - identity := by - intro i - rw [diagram.self] - rfl - composition := by - intro i j k first second - rw [diagram.comp first second] - rfl - common_upper := upper - -end GroundChronologicalMainDiagram - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -include run in -theorem common_upper (i j : I) : ∃ k, i ≤ k ∧ j ≤ k := by - let first := SetMembers.ofMem (run.key i) (ZFSet.mem_range.2 ⟨i, rfl⟩ : run.key i ∈ run.indices) - let second := SetMembers.ofMem (run.key j) (ZFSet.mem_range.2 ⟨j, rfl⟩ : run.key j ∈ run.indices) - have total := ordinalMainIndex_total run.indices_ordinal first second - change (SetMembers.raw first = SetMembers.raw second ∨ SetMembers.raw first ∈ SetMembers.raw second) ∨ - (SetMembers.raw second = SetMembers.raw first ∨ SetMembers.raw second ∈ SetMembers.raw first) at total - simp only [first, second, SetMembers.raw_ofMem] at total - rcases total with before | after - · exact ⟨j, (run.key_order i j).2 before, le_rfl⟩ - · exact ⟨i, le_rfl, (run.key_order j i).2 after⟩ - -noncomputable def pointSystem : CodedDirectSystem.{u} I := - run.diagram.pointSystem run.common_upper - -noncomputable def actorSystem : CodedDirectSystem.{u} I := - run.diagram.actorSystem run.common_upper - -theorem pointSystem_carrier (i : I) : - run.pointSystem.carrier i = (run.diagram.stage i).stage.carrier := rfl - -theorem pointSystem_map {i j : I} (before : i ≤ j) : - run.pointSystem.map before = (run.diagram.transition before).map.points := rfl - -theorem actorSystem_carrier (i : I) : - run.actorSystem.carrier i = (run.diagram.stage i).stage.actors := rfl - -theorem actorSystem_map {i j : I} (before : i ≤ j) : - run.actorSystem.map before = (run.diagram.transition before).map.actors := rfl - -end GroundMainPrefix -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundExternalCutoffFieldGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.GroundLowRankFunctionGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSerializedCodeRanks +import OAI.SetTheory.PartitionPrinciple.Definability.LinkedMainInvariantCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionFiniteFieldGraphs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialSeedSerializationRanks +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageCandidates + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace GroundChronologicalHistory +noncomputable def fieldValue {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} + (prior : GroundChronologicalHistory M T C D rD) : Fin 5 → ZFSet.{u} → ZFSet.{u} := + Fin.cases prior.space (Fin.cases prior.order (Fin.cases prior.meetGraph + (Fin.cases prior.birth (fun _ => prior.height)))) + +end GroundChronologicalHistory + +namespace CompressionChronologyFields +noncomputable def fieldValue (fields : CompressionChronologyFields.{u}) : Fin 5 → ZFSet.{u} → ZFSet.{u} := + Fin.cases fields.space (Fin.cases fields.order (Fin.cases fields.meetGraph + (Fin.cases fields.birth (fun _ => fields.height)))) + +end CompressionChronologyFields + +namespace GroundExternalBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (priorFields : GroundChronologyFields M T0) + +noncomputable def chronologyGraph (j : Fin 5) : ZFSet.{u} := + compressionPrefixGraph oldTimes births.limit (priorFields.graph j) + (births.cutoffFieldFamily heights j) births.stamps (births.terminalField heights j) + +variable {inv : ZFSet.{u}} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (ordinal : ordinalSetProperty T0) (hOld : oldTimes ∈ T0) +include data group action pairing unions powers separation infinite hG hP0 + +theorem chronologyGraph_ground (j : Fin 5) : births.chronologyGraph heights priorFields j ∈ M.sets := + M.compressionPrefixGraph_mem pairing unions powers separation + (M.omega_mem separation infinite) + (M.transitive births.limit_ground births.times.base_mem_limit) births.limit_ground + (priorFields.graph_ground j) + (births.cutoffFieldFamily_spec heights data group action pairing unions powers separation infinite hG hP0 j).1 + births.stamps_ground + (births.terminalField_ground heights data group action pairing unions powers separation infinite hG hP0 j) + +include ordinal hOld in +theorem chronologyGraph_function (j : Fin 5) : + FunctionGraphOn (insert births.limit births.limit) (births.chronologyGraph heights priorFields j) := by + apply compressionPrefixGraph_function births.times (priorFields.value j) (births.cutoffField heights j) + · intro s before y + have hs : s ∈ T0 := before.elim (fun h => ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) + exact ⟨fun entry => (priorFields.value_eq_of_entry j entry).symm, + fun equal => equal.symm ▸ priorFields.value_entry j hs⟩ + · exact (births.cutoffFieldFamily_spec heights data group action pairing unions powers separation infinite hG hP0 j).2.2 + +noncomputable def groundChronologyFields : GroundChronologyFields M (insert births.limit births.limit) := + GroundChronologyFields.ofGraphs pairing unions (M.insert_mem pairing unions births.limit_ground births.limit_ground) + (births.chronologyGraph heights priorFields) + (births.chronologyGraph_ground heights priorFields data group action pairing unions powers separation infinite hG hP0) + (births.chronologyGraph_function heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld) + +theorem groundChronologyFields_graph : + (births.groundChronologyFields heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld).graph = + births.chronologyGraph heights priorFields := rfl + +include ordinal hOld in +theorem groundChronologyFields_values (prior : GroundChronologicalHistory M T0 C D rD) + (agreement : ∀ j s, s ∈ T0 → priorFields.value j s = prior.fieldValue j s) + (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ insert births.limit births.limit) : + (births.groundChronologyFields heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld).value j s = + (births.chronologyFields heights prior).fieldValue j s := by + have field : (births.chronologyFields heights prior).fieldValue j = + compressionPrefixValue oldTimes births.limit (prior.fieldValue j) + (births.cutoffField heights j) (births.terminalField heights j) := + Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j + have oldEntries : ∀ t, t ∈ oldTimes ∨ t = oldTimes → ∀ y, + ZFSet.pair t y ∈ priorFields.graph j ↔ y = prior.fieldValue j t := by + intro t before y + have ht : t ∈ T0 := before.elim (fun h => ordinal.1 oldTimes hOld t h) (fun h => h.symm ▸ hOld) + constructor + · intro entry + exact (priorFields.value_eq_of_entry j entry).symm.trans (agreement j t ht) + · intro equal + rw [← agreement j t ht] at equal + exact equal.symm ▸ priorFields.value_entry j ht + apply GroundChronologyFields.value_eq_of_entry + change ZFSet.pair s ((births.chronologyFields heights prior).fieldValue j s) ∈ + compressionPrefixGraph oldTimes births.limit (priorFields.graph j) + (births.cutoffFieldFamily heights j) births.stamps (births.terminalField heights j) + exact (compressionPrefixGraph_exact births.times (prior.fieldValue j) (births.cutoffField heights j) + oldEntries (births.cutoffFieldFamily_spec heights data group action pairing unions powers separation infinite hG hP0 j).2.2 s _).2 + ⟨hs,congrFun field s⟩ + +include ordinal hOld in +theorem groundChronologyFields_code_ground : + (births.groundChronologyFields heights priorFields data group action pairing unions powers separation infinite hG hP0 ordinal hOld).code ∈ M.sets := + GroundChronologyFields.code_ground _ pairing + +end GroundExternalBirthData + + + + +namespace GroundChronologyFields +variable {M : TransitiveGround.{u}} {T U cutoff : ZFSet.{u}} + +theorem graphPrefixCode_iff_values (source : GroundChronologyFields M T) + (target : GroundChronologyFields M U) + (domains : ∀ s, s = cutoff ∨ s ∈ cutoff → s ∈ T ∧ s ∈ U) : + ChronologyGraphPrefixCode cutoff source.graph target.graph ↔ + ∀ j s, s = cutoff ∨ s ∈ cutoff → source.value j s = target.value j s := by + constructor + · intro code j s before + exact (target.value_eq_of_entry j + ((code j s before _).1 (source.value_entry j (domains s before).1))).symm + · intro values j s before x + constructor + · intro entry + have equal := (values j s before).symm.trans (source.value_eq_of_entry j entry) + exact equal ▸ target.value_entry j (domains s before).2 + · intro entry + have equal := (values j s before).trans (target.value_eq_of_entry j entry) + exact equal ▸ source.value_entry j (domains s before).1 + +end GroundChronologyFields + +namespace GroundChronologicalMainTransition +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {source target : GroundChronologicalMainStage M C D rD} +variable (sourceFields : GroundChronologyFields M (insert source.cutoff source.cutoff)) +variable (targetFields : GroundChronologyFields M (insert target.cutoff target.cutoff)) +variable (sourceAgreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → + sourceFields.value j s = source.history.fieldValue j s) +variable (targetAgreement : ∀ j s, s ∈ insert target.cutoff target.cutoff → + targetFields.value j s = target.history.fieldValue j s) + +include sourceAgreement targetAgreement + +theorem field_laws (transition : GroundChronologicalMainTransition source target) : + ChronologicalTransitionLaws transition.map.points source.cutoff target.cutoff source.birth target.birth + sourceFields.graph targetFields.graph := by + refine ⟨transition.cutoff_le, transition.birth, ?_⟩ + apply (sourceFields.graphPrefixCode_iff_values targetFields (fun s before => + ⟨ZFSet.mem_insert_iff.2 before, ZFSet.mem_insert_iff.2 (transition.prefix_bound before)⟩)).2 + intro j s before + rw [sourceAgreement j s (ZFSet.mem_insert_iff.2 before), + targetAgreement j s (ZFSet.mem_insert_iff.2 (transition.prefix_bound before))] + have h := transition.history_prefix s before + exact Fin.cases h.1.symm (Fin.cases h.2.1.symm (Fin.cases h.2.2.1.symm + (Fin.cases h.2.2.2.1.symm (Fin.cases h.2.2.2.2.symm (fun i => Fin.elim0 i))))) j + +def ofFieldLaws (map : GroundMainTransition source.stage target.stage) + (valid : ChronologicalTransitionLaws map.points source.cutoff target.cutoff source.birth target.birth + sourceFields.graph targetFields.graph) : GroundChronologicalMainTransition source target where + map := map + cutoff_le := valid.cutoff_le + birth := valid.birth + history_prefix := by + intro s before + have bound : s = target.cutoff ∨ s ∈ target.cutoff := by + rcases valid.cutoff_le with equal | lower + · exact equal ▸ before + · exact Or.inr (before.elim (fun equal => equal.symm ▸ lower) + (fun hs => target.cutoff_ordinal.1 source.cutoff lower s hs)) + have values := (sourceFields.graphPrefixCode_iff_values targetFields (fun a earlier => by + refine ⟨ZFSet.mem_insert_iff.2 earlier, ZFSet.mem_insert_iff.2 ?_⟩ + rcases valid.cutoff_le with equal | lower + · exact equal ▸ earlier + · exact Or.inr (earlier.elim (fun equal => equal.symm ▸ lower) + (fun ha => target.cutoff_ordinal.1 source.cutoff lower a ha)))).1 valid.history_prefix + have same (j : Fin 5) : target.history.fieldValue j s = source.history.fieldValue j s := by + rw [← sourceAgreement j s (ZFSet.mem_insert_iff.2 before), + ← targetAgreement j s (ZFSet.mem_insert_iff.2 bound)] + exact (values j s before).symm + exact ⟨same 0, same 1, same 2, same 3, same 4⟩ + +theorem ofFieldLaws_map (map : GroundMainTransition source.stage target.stage) + (valid : ChronologicalTransitionLaws map.points source.cutoff target.cutoff source.birth target.birth + sourceFields.graph targetFields.graph) : + (ofFieldLaws sourceFields targetFields sourceAgreement targetAgreement map valid).map = map := rfl + +theorem ofFieldLaws_self (transition : GroundChronologicalMainTransition source target) : + ofFieldLaws sourceFields targetFields sourceAgreement targetAgreement transition.map + (field_laws sourceFields targetFields sourceAgreement targetAgreement transition) = transition := + ext rfl + +end GroundChronologicalMainTransition +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} + +theorem GroundChronologicalHistory.fieldValue_rank_lt + (history : GroundChronologicalHistory M T C D rD) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (times : ZFSet.rank T < o) (columns : ZFSet.rank C < o) + (coordinates : ZFSet.rank D < o) {s : ZFSet.{u}} (hs : s ∈ T) + (points : ZFSet.rank (history.space s) < o) (j : Fin 5) : + ZFSet.rank (history.fieldValue j s) < o := by + have meet := history.meet_order s hs + have pp := rank_product_lt limit points points + have order := (ZFSet.rank_mono meet.order.relation).trans_lt pp + have operation := rank_functionGraph_lt limit meet.operation pp points + have birth := rank_functionGraph_lt limit (history.birth_function s hs) points times + have height := rank_functionGraph_lt limit (history.strict_height s hs).function points + (rank_product_lt limit columns coordinates) + exact Fin.cases points (Fin.cases order (Fin.cases operation + (Fin.cases birth (Fin.cases height (fun i => Fin.elim0 i))))) j + +namespace GroundChronologyFields +variable (fields : GroundChronologyFields M T) + +theorem graph_rank_lt_of_history + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (hT : T ∈ K) (history : GroundChronologicalHistory M T C D rD) + (agreement : ∀ j s, s ∈ T → fields.value j s = history.fieldValue j s) + (points : ∀ s ∈ T, ZFSet.rank (history.space s) < ZFSet.rank K) + (columns : ZFSet.rank C < ZFSet.rank K) (coordinates : ZFSet.rank D < ZFSet.rank K) + (j : Fin 5) : ZFSet.rank (fields.graph j) < ZFSet.rank K := by + apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite hK + hT (fields.graph_ground j) ⟨fields.bound, fields.function j⟩ + intro s hs v entry + rw [← fields.value_eq_of_entry j entry, agreement j s hs] + exact history.fieldValue_rank_lt + (conditions.rank_isLimit pairing unions powers separation infinite hK) + (ZFSet.rank_lt_of_mem hT) columns coordinates hs (points s hs) j + +end GroundChronologyFields + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (priorFields : GroundChronologyFields M T0) +variable (prior : GroundChronologicalHistory M T0 C Q qlt) + +noncomputable def prefixGraph (finiteGraphs : Fin 5 → ZFSet.{u}) (j : Fin 5) : ZFSet.{u} := + compressionPrefixGraph base births.limit (priorFields.graph j) (finiteGraphs j) births.stamps + (state.prefixTerminalField data births heights j) + +theorem prefixGraph_exact + (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) + (agreement : ∀ j s, s ∈ T0 → priorFields.value j s = prior.fieldValue j s) + {finiteGraphs : Fin 5 → ZFSet.{u}} + (finiteEntries : ∀ j n y, ZFSet.pair (natSetCode n) y ∈ finiteGraphs j ↔ + y = state.prefixFiniteField data births heights j n) + (j : Fin 5) (s y : ZFSet.{u}) : + ZFSet.pair s y ∈ state.prefixGraph data births heights priorFields finiteGraphs j ↔ + s ∈ insert births.limit births.limit ∧ + y = (state.prefixFields data births heights prior).fieldValue j s := by + have field : (state.prefixFields data births heights prior).fieldValue j = + compressionPrefixValue base births.limit (prior.fieldValue j) + (state.prefixFiniteField data births heights j) (state.prefixTerminalField data births heights j) := + Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j + rw [field] + apply compressionPrefixGraph_exact births.times + · intro t before z + have ht : t ∈ T0 := before.elim (fun h => ordinal.1 base hBase t h) (fun h => h.symm ▸ hBase) + constructor + · intro entry + exact (priorFields.value_eq_of_entry j entry).symm.trans (agreement j t ht) + · intro equal + rw [← agreement j t ht] at equal + exact equal.symm ▸ priorFields.value_entry j ht + · exact finiteEntries j + +theorem exists_groundPrefixFields + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) + (agreement : ∀ j s, s ∈ T0 → priorFields.value j s = prior.fieldValue j s) : + ∃ fields : GroundChronologyFields M (insert births.limit births.limit), + fields.code ∈ M.sets ∧ ChronologyCoreCode (insert births.limit births.limit) + fields.bound C Q qlt fields.graph ∧ + ∀ j s, s ∈ insert births.limit births.limit → + fields.value j s = (state.prefixFields data births heights prior).fieldValue j s := by + obtain ⟨finiteGraphs, finiteGround, _, finiteEntries⟩ := state.exists_prefixFiniteGraphs data births heights + pairing unions powers separation collection infinite hI hSources hReps hG hT + let graphs := state.prefixGraph data births heights priorFields finiteGraphs + have ground : ∀ j, graphs j ∈ M.sets := by + intro j + exact M.compressionPrefixGraph_mem pairing unions powers separation (M.omega_mem separation infinite) + (M.transitive births.limit_ground births.times.base_mem_limit) births.limit_ground + (priorFields.graph_ground j) (finiteGround j) births.stamps_ground + (state.prefixTerminalField_ground data births heights j) + have functions : ∀ j, FunctionGraphOn (insert births.limit births.limit) (graphs j) := by + intro j + apply compressionPrefixGraph_function births.times (priorFields.value j) + (state.prefixFiniteField data births heights j) + · intro s before y + have hs : s ∈ T0 := before.elim (fun h => ordinal.1 base hBase s h) (fun h => h.symm ▸ hBase) + exact ⟨fun entry => (priorFields.value_eq_of_entry j entry).symm, + fun equal => equal.symm ▸ priorFields.value_entry j hs⟩ + · exact finiteEntries j + let fields := GroundChronologyFields.ofGraphs pairing unions + (M.insert_mem pairing unions births.limit_ground births.limit_ground) graphs ground functions + have values : ∀ j s, s ∈ insert births.limit births.limit → + fields.value j s = (state.prefixFields data births heights prior).fieldValue j s := by + intro j s hs + apply fields.value_eq_of_entry + exact (state.prefixGraph_exact data births heights priorFields prior ordinal hBase agreement + finiteEntries j s _).2 ⟨hs, rfl⟩ + refine ⟨fields, fields.code_ground pairing, ⟨fields.function, ?_⟩, values⟩ + intro s hs L r μ birth height eL er eμ eb eh + have eqL := (fields.value_eq_of_entry 0 eL).symm.trans (values 0 s hs) + have eqr := (fields.value_eq_of_entry 1 er).symm.trans (values 1 s hs) + have eqμ := (fields.value_eq_of_entry 2 eμ).symm.trans (values 2 s hs) + have eqb := (fields.value_eq_of_entry 3 eb).symm.trans (values 3 s hs) + have eqh := (fields.value_eq_of_entry 4 eh).symm.trans (values 4 s hs) + rw [eqL, eqr, eqμ, eqb, eqh] + have laws := state.prefixFields_stage_laws data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs + exact ⟨laws.1, laws.2.1, laws.2.2.1, laws.2.2.2.1, laws.2.2.2.2⟩ + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def linkedMainStageCode (stage cutoff serial : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 2 (Fin.cases stage (Fin.cases cutoff (fun _ => serial))) + +theorem linkedMainStageCode_inj {a t h a' t' h' : ZFSet.{u}} : + linkedMainStageCode a t h = linkedMainStageCode a' t' h' ↔ a = a' ∧ t = t' ∧ h = h' := by + constructor + · intro equal + have fields := nonemptyTupleCode_injective 2 equal + exact ⟨congrFun fields 0, congrFun fields 1, congrFun fields 2⟩ + · rintro ⟨rfl, rfl, rfl⟩ + rfl + +structure GroundLinkedMainStage (M : TransitiveGround.{u}) (K Labels C D rD : ZFSet.{u}) where + main : GroundChronologicalMainStage M C D rD + serial : GroundSerializedChronology M (insert main.cutoff main.cutoff) C D rD + agreement : ∀ j s, s ∈ insert main.cutoff main.cutoff → + serial.fields.value j s = main.history.fieldValue j s + invariant : main.Invariant K Labels + serial_rank : ZFSet.rank serial.code < ZFSet.rank K + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (linked : GroundLinkedMainStage M K Labels C D rD) + +noncomputable def code : ZFSet.{u} := + linkedMainStageCode linked.main.stage.code linked.main.cutoff linked.serial.code + +theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : linked.code ∈ M.sets := + M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases (linked.main.stage.code_mem pairing) + (Fin.cases linked.main.cutoff_ground (fun _ => linked.serial.code_ground pairing))) + +theorem terminal_values : + linked.serial.fields.value 0 linked.main.cutoff = linked.main.stage.carrier ∧ + linked.serial.fields.value 1 linked.main.cutoff = linked.main.stage.order ∧ + linked.serial.fields.value 2 linked.main.cutoff = linked.main.stage.meetGraph ∧ + linked.serial.fields.value 3 linked.main.cutoff = linked.main.birth ∧ + linked.serial.fields.value 4 linked.main.cutoff = linked.main.stage.height := + ⟨(linked.agreement 0 _ (ZFSet.mem_insert _ _)).trans linked.main.carrier_eq, + (linked.agreement 1 _ (ZFSet.mem_insert _ _)).trans linked.main.order_eq, + (linked.agreement 2 _ (ZFSet.mem_insert _ _)).trans linked.main.meet_eq, + linked.agreement 3 _ (ZFSet.mem_insert _ _), + (linked.agreement 4 _ (ZFSet.mem_insert _ _)).trans linked.main.height_eq⟩ + +theorem invariant_code : LinkedMainInvariantCode M K Labels C D linked.main.stage.carrier + linked.main.stage.actors linked.main.cutoff linked.serial.code := + ⟨linked.invariant.points_small, linked.invariant.actors_small, linked.invariant.labels_small, + linked.invariant.points_rank, linked.invariant.actors_rank, linked.invariant.labels_rank, + linked.invariant.cutoff_mem, linked.invariant.columns_rank, linked.invariant.coordinates_rank, + linked.serial_rank⟩ + +theorem code_rank_lt + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) : ZFSet.rank linked.code < ZFSet.rank K := + rank_nonemptyTupleCode_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) 2 _ + (Fin.cases (linked.invariant.code_rank_lt pairing unions powers separation infinite hK conditions) + (Fin.cases (ZFSet.rank_lt_of_mem linked.invariant.cutoff_mem) (fun _ => linked.serial_rank))) + +end GroundLinkedMainStage + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u v + +structure GroundMainPrefix (M : TransitiveGround.{u}) (K Labels C D rD : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (I : Type v) [Small.{u} I] [Preorder I] where + key : I → ZFSet.{u} + key_injective : Function.Injective key + key_order : ∀ i j, i ≤ j ↔ key i = key j ∨ key i ∈ key j + indices_ground : ZFSet.range key ∈ M.sets + indices_ordinal : ordinalSetProperty (ZFSet.range key) + diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I + linked : I → GroundLinkedMainStage M K Labels C D rD + linked_main : ∀ i, (linked i).main = diagram.stage i + coverage : diagram.CoversOldBirths + stages_ground : familyCodeGraph key (fun i => (linked i).code) ∈ M.sets + transitions_ground : familyCodeGraph (mainTransitionIndexKey key) + (fun p => (diagram.transition p.property).map.code) ∈ M.sets + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def indices : ZFSet.{u} := ZFSet.range run.key + +noncomputable def stageGraph : ZFSet.{u} := familyCodeGraph run.key (fun i => (run.linked i).code) + +noncomputable def transitionGraph : ZFSet.{u} := familyCodeGraph (mainTransitionIndexKey run.key) + (fun p => (run.diagram.transition p.property).map.code) + +noncomputable def code : ZFSet.{u} := nonemptyTupleCode 2 + (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) + +theorem code_ground : run.code ∈ M.sets := + M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases run.indices_ground + (Fin.cases run.stages_ground (fun _ => run.transitions_ground))) + +theorem stageGraph_function : FunctionGraphOn run.indices run.stageGraph := + familyCodeGraph_function run.key _ run.key_injective + +theorem transitionGraph_function : FunctionGraphOn (chronologyPairs run.indices) run.transitionGraph := by + have function := familyCodeGraph_function (mainTransitionIndexKey run.key) + (fun p => (run.diagram.transition p.property).map.code) + (mainTransitionIndexKey_injective run.key run.key_injective) + rw [mainTransitionIndex_range run.key run.key_order] at function + exact function + +theorem stageGraph_entry (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.stageGraph ↔ z = (run.linked i).code := + pair_mem_familyCodeGraph run.key _ run.key_injective i z + +theorem transitionGraph_entry {i j : I} (before : i ≤ j) (z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.transitionGraph ↔ + z = (run.diagram.transition before).map.code := + pair_mem_familyCodeGraph (mainTransitionIndexKey run.key) _ + (mainTransitionIndexKey_injective run.key run.key_injective) ⟨(i, j), before⟩ z + +theorem identity_entry (i : I) : + ZFSet.pair (ZFSet.pair (run.key i) (run.key i)) + (GroundChronologicalMainTransition.identity pairing unions powers separation (run.diagram.stage i)).map.code ∈ + run.transitionGraph := by + rw [run.transitionGraph_entry (le_refl i), run.diagram.self] + +theorem composition_entry {i j k : I} (hij : i ≤ j) (hjk : j ≤ k) : + ZFSet.pair (ZFSet.pair (run.key k) (run.key i)) + ((run.diagram.transition hij).comp pairing unions powers separation + (run.diagram.transition hjk)).map.code ∈ run.transitionGraph := by + rw [run.transitionGraph_entry (le_trans hij hjk), run.diagram.comp hij hjk] + +end GroundMainPrefix + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundInitialMainSeedData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K C : ZFSet.{u}} +variable (seed : GroundInitialMainSeedData M K C) + +theorem initialSerialization_agreement + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {injection : ZFSet.{u}} (hInjection : injection ∈ M.sets) + (injected : InjectionCode seed.source.stage.carrier ZFSet.omega injection) : + let serial := seed.source.stage.initialSerializedChronology pairing unions powers separation hInjection injected + ∀ j t, t ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u}) → + serial.fields.value j t = seed.source.history.fieldValue j t := by + dsimp only + intro j t ht + have zero : t = ∅ := by + simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using ht + subst t + have values := seed.source.stage.initialSerializedChronology_values pairing unions powers separation + hInjection injected (ZFSet.mem_insert (∅ : ZFSet.{u}) ∅) + have carrier := (congrArg seed.source.history.space seed.cutoff_zero).symm.trans seed.source.carrier_eq + have order := (congrArg seed.source.history.order seed.cutoff_zero).symm.trans seed.source.order_eq + have meet := (congrArg seed.source.history.meetGraph seed.cutoff_zero).symm.trans seed.source.meet_eq + have height := (congrArg seed.source.history.height seed.cutoff_zero).symm.trans seed.source.height_eq + have birth : seed.source.stage.initialBirth = seed.source.history.birth ∅ := by + have equal : seed.source.stage.initialBirth = seed.source.birth := by + rw [GroundMainStage.initialBirth, seed.points_eq, seed.birth_eq] + exact equal.trans (congrArg seed.source.history.birth seed.cutoff_zero) + exact Fin.cases (values.1.trans carrier.symm) + (Fin.cases (values.2.1.trans order.symm) + (Fin.cases (values.2.2.1.trans meet.symm) + (Fin.cases (values.2.2.2.1.trans birth) + (Fin.cases (values.2.2.2.2.trans height.symm) (fun i => Fin.elim0 i))))) j + +end PartitionPilot.Forcing.GroundInitialMainSeedData + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u v +namespace GroundChronologicalMainDiagram +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Preorder I] +variable (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) + +noncomputable def pointSystem (upper : ∀ i j : I, ∃ k, i ≤ k ∧ j ≤ k) : CodedDirectSystem.{u} I where + carrier i := (diagram.stage i).stage.carrier + map before := (diagram.transition before).map.points + injection before := (diagram.transition before).map.point_embedding.injection + identity := by + intro i + rw [diagram.self] + rfl + composition := by + intro i j k first second + rw [diagram.comp first second] + rfl + common_upper := upper + +noncomputable def actorSystem (upper : ∀ i j : I, ∃ k, i ≤ k ∧ j ≤ k) : CodedDirectSystem.{u} I where + carrier i := (diagram.stage i).stage.actors + map before := (diagram.transition before).map.actors + injection before := (diagram.transition before).map.group_embedding.injection + identity := by + intro i + rw [diagram.self] + rfl + composition := by + intro i j k first second + rw [diagram.comp first second] + rfl + common_upper := upper + +end GroundChronologicalMainDiagram + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +include run in +theorem common_upper (i j : I) : ∃ k, i ≤ k ∧ j ≤ k := by + let first := SetMembers.ofMem (run.key i) (ZFSet.mem_range.2 ⟨i, rfl⟩ : run.key i ∈ run.indices) + let second := SetMembers.ofMem (run.key j) (ZFSet.mem_range.2 ⟨j, rfl⟩ : run.key j ∈ run.indices) + have total := ordinalMainIndex_total run.indices_ordinal first second + change (SetMembers.raw first = SetMembers.raw second ∨ SetMembers.raw first ∈ SetMembers.raw second) ∨ + (SetMembers.raw second = SetMembers.raw first ∨ SetMembers.raw second ∈ SetMembers.raw first) at total + simp only [first, second, SetMembers.raw_ofMem] at total + rcases total with before | after + · exact ⟨j, (run.key_order i j).2 before, le_rfl⟩ + · exact ⟨i, le_rfl, (run.key_order j i).2 after⟩ + +noncomputable def pointSystem : CodedDirectSystem.{u} I := + run.diagram.pointSystem run.common_upper + +noncomputable def actorSystem : CodedDirectSystem.{u} I := + run.diagram.actorSystem run.common_upper + +theorem pointSystem_carrier (i : I) : + run.pointSystem.carrier i = (run.diagram.stage i).stage.carrier := rfl + +theorem pointSystem_map {i j : I} (before : i ≤ j) : + run.pointSystem.map before = (run.diagram.transition before).map.points := rfl + +theorem actorSystem_carrier (i : I) : + run.actorSystem.carrier i = (run.diagram.stage i).stage.actors := rfl + +theorem actorSystem_map {i j : I} (before : i ≤ j) : + run.actorSystem.map before = (run.diagram.transition before).map.actors := rfl + +end GroundMainPrefix +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoherentTower.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoherentTower.lean index ccb319428ff3a662a04ceda5b76a579694c36b69..216791dc7a7504d7acf399647929a8d355d78578 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoherentTower.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoherentTower.lean @@ -1,371 +1,371 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.InitialAction - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Attachment - -universe u - -structure CompressionStage {A G Task Label : Type u} {P : MeetOrder A} - (f : TaskSystem P G Task Label) where - Old : Type u - Components : Type u - oldOrder : MeetOrder Old - batch : Templates.{u,u,u} oldOrder Components - original : MeetEmbedding P oldOrder - inputs : Inputs batch Task - source_original : ∀ i, inputs.source i = original.toFun (f.datum i).source - top : ∀ x, oldOrder.le x (original.toFun f.top) - symmetry : G → TaskSymmetry inputs - perm_eq : ∀ g i, (symmetry g).perm i = f.perm g i - representatives : ∀ i x, (symmetry (f.representative i)).current.toFun x = - (inputs.representative i).toFun x - action_one : ∀ x, (symmetry f.group.one).current.toFun x = x - action_mul : ∀ g h x, (symmetry (f.group.mul g h)).current.toFun x = - (symmetry g).current.toFun ((symmetry h).current.toFun x) - action_original : ∀ g x, (symmetry g).current.toFun (.inl (original.toFun x)) = - .inl (original.toFun ((f.action g).toFun x)) - agreement : ∀ g h v, - (∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) → - ∀ x, batch.extension.le x (.inl (original.toFun v)) → - (symmetry g).current.toFun x = (symmetry h).current.toFun x - negative : ∀ i v, ¬ (f.datum i).filter.mem v → - batch.extension.le - (batch.extension.meet ((inputs.previous i).toFun (original.toFun f.top)) - (.inl (original.toFun v))) - ((inputs.previous i).toFun (inputs.source i)) - -namespace CompressionStage - -variable {A G Task Label : Type u} {P : MeetOrder A} {f : TaskSystem P G Task Label} - (s : CompressionStage f) - -theorem compatible (g : G) (i : Task) (x : s.Old ⊕ s.batch.Fresh) - (hx : s.batch.extension.le x (.inl (s.inputs.source i))) : - (s.symmetry g).current.toFun ((s.inputs.representative i).toFun x) = - (s.inputs.representative ((s.symmetry g).perm i)).toFun x := by - have ground : ∀ y, P.le y (f.datum i).source → - (f.action (f.group.mul g (f.representative i))).toFun y = - (f.action (f.representative (f.perm g i))).toFun y := by - intro y hy - rw [f.action_mul] - exact f.ground_compatible g i y hy - rw [s.source_original] at hx - have current := s.agreement (f.group.mul g (f.representative i)) - (f.representative (f.perm g i)) (f.datum i).source ground x hx - rw [s.action_mul, s.representatives, s.representatives] at current - rw [s.perm_eq] - exact current - -noncomputable def nextInputs : Inputs s.inputs.nextBatch Task := - s.inputs.nextInputs (fun i => s.symmetry (f.representative i)) s.representatives - -noncomputable def nextAction (g : G) : TaskSymmetry s.nextInputs := - s.inputs.nextSymmetry (fun i => s.symmetry (f.representative i)) s.representatives - (s.symmetry g) (s.compatible g) - -theorem next_action_one (x : (s.Old ⊕ s.batch.Fresh) ⊕ s.inputs.nextBatch.Fresh) : - (s.nextAction f.group.one).current.toFun x = x := by - cases x with - | inl x => exact congrArg Sum.inl (s.action_one x) - | inr x => - rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ - apply congrArg Sum.inr - exact TaskSymmetry.fresh_task_eq ((s.perm_eq f.group.one i).trans (f.perm_one i)) - -theorem next_action_mul (g h : G) - (x : (s.Old ⊕ s.batch.Fresh) ⊕ s.inputs.nextBatch.Fresh) : - (s.nextAction (f.group.mul g h)).current.toFun x = - (s.nextAction g).current.toFun ((s.nextAction h).current.toFun x) := by - cases x with - | inl x => exact congrArg Sum.inl (s.action_mul g h x) - | inr x => - rcases x with ⟨⟨i, ⟨k, eligible⟩⟩, ⟨y, outside⟩⟩ - apply congrArg Sum.inr - apply TaskSymmetry.fresh_task_eq - change (s.symmetry (f.group.mul g h)).perm i = (s.symmetry g).perm ((s.symmetry h).perm i) - rw [s.perm_eq, s.perm_eq, s.perm_eq, f.perm_mul] - -theorem next_action_original (g : G) (x : A) : - (s.nextAction g).current.toFun (.inl (.inl (s.original.toFun x))) = - .inl (.inl (s.original.toFun ((f.action g).toFun x))) := - congrArg Sum.inl (s.action_original g x) - -theorem next_agreement (g h : G) (v : A) - (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) - (x : (s.Old ⊕ s.batch.Fresh) ⊕ s.inputs.nextBatch.Fresh) - (below : s.inputs.nextBatch.extension.le x (.inl (.inl (s.original.toFun v)))) : - (s.nextAction g).current.toFun x = (s.nextAction h).current.toFun x := by - apply TaskDatum.successor_agreement (s.symmetry g) (s.symmetry h) s.original - f.datum f.faithful f.geometry (f.action g) (f.action h) - (fun i => (congrArg f.datum (s.perm_eq g i)).trans (f.transport g i)) - (fun i => (congrArg f.datum (s.perm_eq h i)).trans (f.transport h i)) - (s.original.toFun f.top) s.top v (fun i => s.negative i v) - agree (s.agreement g h v agree) x below - -theorem next_negative (i : Task) (v : A) (negative : ¬ (f.datum i).filter.mem v) : - s.inputs.nextBatch.extension.le - (s.inputs.nextBatch.extension.meet - ((s.nextInputs.previous i).toFun (.inl (s.original.toFun f.top))) - (.inl (.inl (s.original.toFun v)))) - ((s.nextInputs.previous i).toFun (s.nextInputs.source i)) := by - have h := (s.inputs.nextBatch.oldEmbedding.le_iff _ _).mpr (s.negative i v negative) - have hm := s.inputs.nextBatch.oldEmbedding.map_meet - ((s.inputs.previous i).toFun (s.original.toFun f.top)) (.inl (s.original.toFun v)) - rw [hm] at h - exact h - -noncomputable def next : CompressionStage f where - Old := s.Old ⊕ s.batch.Fresh - Components := s.inputs.Labels - oldOrder := s.batch.extension - batch := s.inputs.nextBatch - original := compose s.original s.batch.oldEmbedding - inputs := s.nextInputs - source_original i := congrArg Sum.inl (s.source_original i) - top := s.batch.greatest_preserved (s.original.toFun f.top) s.top - symmetry := s.nextAction - perm_eq := s.perm_eq - representatives _ _ := rfl - action_one := s.next_action_one - action_mul := s.next_action_mul - action_original := s.next_action_original - agreement := s.next_agreement - negative := s.next_negative - -end CompressionStage - -namespace TaskSystem - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -noncomputable def firstStage : CompressionStage f where - Old := A - Components := Task - oldOrder := P - batch := f.initial.batch - original := (identityIso P).toMeetEmbedding - inputs := f.initialInputs - source_original _ := rfl - top := f.greatest - symmetry := f.initialSymmetry - perm_eq _ _ := rfl - representatives _ _ := rfl - action_one := f.initialIso_one - action_mul := f.initialIso_mul - action_original := f.initialIso_old - agreement := f.initial_agreement - negative := f.initial_negative - -noncomputable def stages : Nat → CompressionStage f - | 0 => f.firstStage - | n + 1 => (stages n).next - -theorem stages_agreement (n : Nat) (g h : G) (v : A) - (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) - (x : (f.stages n).Old ⊕ (f.stages n).batch.Fresh) - (below : (f.stages n).batch.extension.le x (.inl ((f.stages n).original.toFun v))) : - ((f.stages n).symmetry g).current.toFun x = - ((f.stages n).symmetry h).current.toFun x := - (f.stages n).agreement g h v agree x below - -end TaskSystem -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem - -open Attachment - -universe u - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -def Point (n : Nat) : Type u := (f.stages n).Old - -noncomputable def order (n : Nat) : MeetOrder (f.Point n) := (f.stages n).oldOrder - -noncomputable def origin (n : Nat) : MeetEmbedding P (f.order n) := (f.stages n).original - -noncomputable def step (n : Nat) : MeetEmbedding (f.order n) (f.order (n + 1)) := - (f.stages n).batch.oldEmbedding - -noncomputable def compression (n : Nat) (i : Task) : MeetEmbedding (f.order n) (f.order (n + 1)) := - (f.stages n).inputs.previous i - -noncomputable def stageAction : (n : Nat) → G → MeetIso (f.order n) (f.order n) - | 0, g => f.action g - | n + 1, g => ((f.stages n).symmetry g).current - -theorem origins_coherent (n : Nat) (x : A) : - (f.step n).toFun ((f.origin n).toFun x) = (f.origin (n + 1)).toFun x := rfl - -theorem maps_coherent (n : Nat) (i : Task) (x : f.Point n) : - (f.step (n + 1)).toFun ((f.compression n i).toFun x) = - (f.compression (n + 1) i).toFun ((f.step n).toFun x) := rfl - -theorem actions_coherent (n : Nat) (g : G) (x : f.Point n) : - (f.step n).toFun ((f.stageAction n g).toFun x) = - (f.stageAction (n + 1) g).toFun ((f.step n).toFun x) := by - cases n <;> rfl - -theorem stage_bottom (n : Nat) (zero : A) (bottom : ∀ x, P.le zero x) : - ∀ x : f.Point n, (f.order n).le ((f.origin n).toFun zero) x := by - induction n with - | zero => exact bottom - | succ n ih => exact (f.stages n).batch.least_preserved ((f.origin n).toFun zero) ih - -theorem stageAction_one (n : Nat) (x : f.Point n) : - (f.stageAction n f.group.one).toFun x = x := by - cases n with - | zero => exact f.action_one x - | succ n => exact (f.stages n).action_one x - -theorem stageAction_mul (n : Nat) (g h : G) (x : f.Point n) : - (f.stageAction n (f.group.mul g h)).toFun x = - (f.stageAction n g).toFun ((f.stageAction n h).toFun x) := by - cases n with - | zero => exact f.action_mul g h x - | succ n => exact (f.stages n).action_mul g h x - -theorem stageAction_original (n : Nat) (g : G) (x : A) : - (f.stageAction n g).toFun ((f.origin n).toFun x) = - (f.origin n).toFun ((f.action g).toFun x) := by - cases n with - | zero => rfl - | succ n => exact (f.stages n).action_original g x - -theorem stage_equivariant (n : Nat) (g : G) (i : Task) (x : f.Point n) : - (f.stageAction (n + 1) g).toFun ((f.compression n i).toFun x) = - (f.compression n (f.perm g i)).toFun x := by - have h := ((f.stages n).symmetry g).intertwine i x - rw [(f.stages n).perm_eq] at h - exact h - -theorem stage_agreement (n : Nat) (g h : G) (v : A) - (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) - (x : f.Point n) (below : (f.order n).le x ((f.origin n).toFun v)) : - (f.stageAction n g).toFun x = (f.stageAction n h).toFun x := by - cases n with - | zero => exact agree x below - | succ n => exact (f.stages n).agreement g h v agree x below - -theorem stage_base_agreement (n : Nat) (i : Task) (x : f.Point n) - (below : (f.order n).le x ((f.origin n).toFun (f.datum i).source)) : - (f.compression n i).toFun x = - (f.step n).toFun ((f.stageAction n (f.representative i)).toFun x) := by - have hx : (f.stages n).oldOrder.le x ((f.stages n).inputs.source i) := by - rw [(f.stages n).source_original] - exact below - exact ((f.stages n).inputs.agree i x hx).trans - (((f.stages n).representatives i (.inl x)).symm.trans - (f.actions_coherent n (f.representative i) x).symm) - -theorem maps_base (n : Nat) (i : Task) : - (f.compression n i).toFun ((f.origin n).toFun (f.datum i).source) = - (f.origin (n + 1)).toFun (f.datum i).target := by - rw [f.stage_base_agreement n i _ ((f.order n).refl _), f.stageAction_original, - f.representative_target, f.origins_coherent] - -noncomputable def cap (n : Nat) (i : Task) : f.Point (n + 1) := - (f.compression n i).toFun ((f.origin n).toFun f.top) - -theorem caps_coherent (n : Nat) (i : Task) : - (f.step (n + 1)).toFun (f.cap n i) = f.cap (n + 1) i := - f.maps_coherent n i ((f.origin n).toFun f.top) - -theorem range_below_cap (n : Nat) (i : Task) (x : f.Point n) : - (f.order (n + 1)).le ((f.compression n i).toFun x) (f.cap n i) := - ((f.compression n i).le_iff _ _).mpr ((f.stages n).top x) - -theorem cap_separation (n : Nat) (i j : Task) (different : i ≠ j) : - (f.order (n + 1)).le (f.cap n i) ((f.origin (n + 1)).toFun (f.datum j).target) ∨ - (f.order (n + 1)).le (f.cap n j) ((f.origin (n + 1)).toFun (f.datum i).target) ∨ - (f.order (n + 1)).meet (f.cap n i) (f.cap n j) = - (f.order (n + 1)).meet ((f.origin (n + 1)).toFun (f.datum i).target) - ((f.origin (n + 1)).toFun (f.datum j).target) := by - induction n with - | zero => - have h := f.initial.copy_cap_separation f.top f.greatest f.source_proper i j different - have bi : f.initial.batch.base i = (f.datum i).target := f.representative_target i - have bj : f.initial.batch.base j = (f.datum j).target := f.representative_target j - rw [bi, bj] at h - exact h - | succ n ih => - rcases ih with h | h | h - · have hn := ((f.step (n + 1)).le_iff _ _).mpr h - rw [f.caps_coherent, f.origins_coherent] at hn - exact Or.inl hn - · have hn := ((f.step (n + 1)).le_iff _ _).mpr h - rw [f.caps_coherent, f.origins_coherent] at hn - exact Or.inr (Or.inl hn) - · have hn := congrArg (f.step (n + 1)).toFun h - rw [(f.step (n + 1)).map_meet, (f.step (n + 1)).map_meet, - f.caps_coherent, f.caps_coherent, f.origins_coherent, f.origins_coherent] at hn - exact Or.inr (Or.inr hn) - -theorem original_below_cap (n : Nat) (i : Task) (v : A) : - (f.order (n + 1)).le ((f.origin (n + 1)).toFun v) (f.cap n i) ↔ P.le v (f.datum i).target := by - induction n with - | zero => - change f.initial.batch.extension.le (.inl v) (f.initial.batch.represent i f.top) ↔ _ - rw [f.initial.batch.represent_new i f.top (f.source_proper i)] - change P.le v (f.initial.batch.shadow ⟨i, ⟨f.top, f.source_proper i⟩⟩) ↔ _ - have hs := f.initial.batch.cap_shadow i f.top f.greatest (f.source_proper i) - change f.initial.batch.shadow ⟨i, ⟨f.top, f.source_proper i⟩⟩ = _ at hs - rw [hs] - have hb : f.initial.batch.base i = (f.datum i).target := f.representative_target i - rw [hb] - | succ n ih => - rw [← f.caps_coherent n i, ← f.origins_coherent (n + 1) v] - exact ((f.step (n + 1)).le_iff _ _).trans ih - -theorem cap_strict (n : Nat) (i : Task) : - (f.order (n + 1)).le ((f.origin (n + 1)).toFun (f.datum i).target) (f.cap n i) ∧ - ¬ (f.order (n + 1)).le (f.cap n i) ((f.origin (n + 1)).toFun (f.datum i).target) := by - constructor - · exact (f.original_below_cap n i _).mpr (P.refl _) - · intro h - rw [← f.maps_base n i] at h - have lower := ((f.compression n i).le_iff _ _).mp h - exact f.source_proper i (((f.origin n).le_iff _ _).mp lower) - -theorem separator_not_below_cap (n : Nat) (i : Task) : - ¬ (f.order (n + 1)).le ((f.origin (n + 1)).toFun (f.datum i).separator) (f.cap n i) := - fun h => (f.geometry i).separator_not_le_base ((f.original_below_cap n i _).mp h) - -theorem stage_fresh_accounting (n : Nat) (z : (f.stages n).batch.Fresh) : - ∃ (i : Task) (y : f.Point n), (f.compression n i).toFun y = .inr z ∧ - (f.order (n + 1)).le (.inr z) (f.cap n i) ∧ - ¬ (f.order (n + 1)).le (.inr z) ((f.origin (n + 1)).toFun (f.datum i).target) := by - cases n with - | zero => - rcases z with ⟨i, y, hy⟩ - have image := f.initial.batch.represent_new i y hy - refine ⟨i, y, image, ?_, ?_⟩ - · have lower := f.range_below_cap 0 i y - change f.initial.batch.extension.le (f.initial.batch.represent i y) _ at lower - rw [image] at lower - exact lower - · exact fun h => (f.geometry i).separator_not_le_base - ((f.geometry i).separator_le_filter _ h) - | succ n => - rcases (f.stages n).inputs.fresh_accounting ((f.stages n).original.toFun f.top) - (f.stages n).top z with ⟨i, y, image, lower, outside⟩ - refine ⟨i, y, image, lower, ?_⟩ - rw [← f.maps_base (n + 1) i] - change ¬ (f.stages n).inputs.nextBatch.extension.le (.inr z) - (.inl (((f.stages n).inputs.previous i).toFun ((f.stages n).original.toFun (f.datum i).source))) - rw [← (f.stages n).source_original] - exact outside - -end PartitionPilot.Compression.RecursiveMaps.TaskSystem - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.InitialAction + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Attachment + +universe u + +structure CompressionStage {A G Task Label : Type u} {P : MeetOrder A} + (f : TaskSystem P G Task Label) where + Old : Type u + Components : Type u + oldOrder : MeetOrder Old + batch : Templates.{u,u,u} oldOrder Components + original : MeetEmbedding P oldOrder + inputs : Inputs batch Task + source_original : ∀ i, inputs.source i = original.toFun (f.datum i).source + top : ∀ x, oldOrder.le x (original.toFun f.top) + symmetry : G → TaskSymmetry inputs + perm_eq : ∀ g i, (symmetry g).perm i = f.perm g i + representatives : ∀ i x, (symmetry (f.representative i)).current.toFun x = + (inputs.representative i).toFun x + action_one : ∀ x, (symmetry f.group.one).current.toFun x = x + action_mul : ∀ g h x, (symmetry (f.group.mul g h)).current.toFun x = + (symmetry g).current.toFun ((symmetry h).current.toFun x) + action_original : ∀ g x, (symmetry g).current.toFun (.inl (original.toFun x)) = + .inl (original.toFun ((f.action g).toFun x)) + agreement : ∀ g h v, + (∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) → + ∀ x, batch.extension.le x (.inl (original.toFun v)) → + (symmetry g).current.toFun x = (symmetry h).current.toFun x + negative : ∀ i v, ¬ (f.datum i).filter.mem v → + batch.extension.le + (batch.extension.meet ((inputs.previous i).toFun (original.toFun f.top)) + (.inl (original.toFun v))) + ((inputs.previous i).toFun (inputs.source i)) + +namespace CompressionStage + +variable {A G Task Label : Type u} {P : MeetOrder A} {f : TaskSystem P G Task Label} + (s : CompressionStage f) + +theorem compatible (g : G) (i : Task) (x : s.Old ⊕ s.batch.Fresh) + (hx : s.batch.extension.le x (.inl (s.inputs.source i))) : + (s.symmetry g).current.toFun ((s.inputs.representative i).toFun x) = + (s.inputs.representative ((s.symmetry g).perm i)).toFun x := by + have ground : ∀ y, P.le y (f.datum i).source → + (f.action (f.group.mul g (f.representative i))).toFun y = + (f.action (f.representative (f.perm g i))).toFun y := by + intro y hy + rw [f.action_mul] + exact f.ground_compatible g i y hy + rw [s.source_original] at hx + have current := s.agreement (f.group.mul g (f.representative i)) + (f.representative (f.perm g i)) (f.datum i).source ground x hx + rw [s.action_mul, s.representatives, s.representatives] at current + rw [s.perm_eq] + exact current + +noncomputable def nextInputs : Inputs s.inputs.nextBatch Task := + s.inputs.nextInputs (fun i => s.symmetry (f.representative i)) s.representatives + +noncomputable def nextAction (g : G) : TaskSymmetry s.nextInputs := + s.inputs.nextSymmetry (fun i => s.symmetry (f.representative i)) s.representatives + (s.symmetry g) (s.compatible g) + +theorem next_action_one (x : (s.Old ⊕ s.batch.Fresh) ⊕ s.inputs.nextBatch.Fresh) : + (s.nextAction f.group.one).current.toFun x = x := by + cases x with + | inl x => exact congrArg Sum.inl (s.action_one x) + | inr x => + rcases x with ⟨⟨i, ⟨h, eligible⟩⟩, ⟨y, outside⟩⟩ + apply congrArg Sum.inr + exact TaskSymmetry.fresh_task_eq ((s.perm_eq f.group.one i).trans (f.perm_one i)) + +theorem next_action_mul (g h : G) + (x : (s.Old ⊕ s.batch.Fresh) ⊕ s.inputs.nextBatch.Fresh) : + (s.nextAction (f.group.mul g h)).current.toFun x = + (s.nextAction g).current.toFun ((s.nextAction h).current.toFun x) := by + cases x with + | inl x => exact congrArg Sum.inl (s.action_mul g h x) + | inr x => + rcases x with ⟨⟨i, ⟨k, eligible⟩⟩, ⟨y, outside⟩⟩ + apply congrArg Sum.inr + apply TaskSymmetry.fresh_task_eq + change (s.symmetry (f.group.mul g h)).perm i = (s.symmetry g).perm ((s.symmetry h).perm i) + rw [s.perm_eq, s.perm_eq, s.perm_eq, f.perm_mul] + +theorem next_action_original (g : G) (x : A) : + (s.nextAction g).current.toFun (.inl (.inl (s.original.toFun x))) = + .inl (.inl (s.original.toFun ((f.action g).toFun x))) := + congrArg Sum.inl (s.action_original g x) + +theorem next_agreement (g h : G) (v : A) + (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) + (x : (s.Old ⊕ s.batch.Fresh) ⊕ s.inputs.nextBatch.Fresh) + (below : s.inputs.nextBatch.extension.le x (.inl (.inl (s.original.toFun v)))) : + (s.nextAction g).current.toFun x = (s.nextAction h).current.toFun x := by + apply TaskDatum.successor_agreement (s.symmetry g) (s.symmetry h) s.original + f.datum f.faithful f.geometry (f.action g) (f.action h) + (fun i => (congrArg f.datum (s.perm_eq g i)).trans (f.transport g i)) + (fun i => (congrArg f.datum (s.perm_eq h i)).trans (f.transport h i)) + (s.original.toFun f.top) s.top v (fun i => s.negative i v) + agree (s.agreement g h v agree) x below + +theorem next_negative (i : Task) (v : A) (negative : ¬ (f.datum i).filter.mem v) : + s.inputs.nextBatch.extension.le + (s.inputs.nextBatch.extension.meet + ((s.nextInputs.previous i).toFun (.inl (s.original.toFun f.top))) + (.inl (.inl (s.original.toFun v)))) + ((s.nextInputs.previous i).toFun (s.nextInputs.source i)) := by + have h := (s.inputs.nextBatch.oldEmbedding.le_iff _ _).mpr (s.negative i v negative) + have hm := s.inputs.nextBatch.oldEmbedding.map_meet + ((s.inputs.previous i).toFun (s.original.toFun f.top)) (.inl (s.original.toFun v)) + rw [hm] at h + exact h + +noncomputable def next : CompressionStage f where + Old := s.Old ⊕ s.batch.Fresh + Components := s.inputs.Labels + oldOrder := s.batch.extension + batch := s.inputs.nextBatch + original := compose s.original s.batch.oldEmbedding + inputs := s.nextInputs + source_original i := congrArg Sum.inl (s.source_original i) + top := s.batch.greatest_preserved (s.original.toFun f.top) s.top + symmetry := s.nextAction + perm_eq := s.perm_eq + representatives _ _ := rfl + action_one := s.next_action_one + action_mul := s.next_action_mul + action_original := s.next_action_original + agreement := s.next_agreement + negative := s.next_negative + +end CompressionStage + +namespace TaskSystem + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +noncomputable def firstStage : CompressionStage f where + Old := A + Components := Task + oldOrder := P + batch := f.initial.batch + original := (identityIso P).toMeetEmbedding + inputs := f.initialInputs + source_original _ := rfl + top := f.greatest + symmetry := f.initialSymmetry + perm_eq _ _ := rfl + representatives _ _ := rfl + action_one := f.initialIso_one + action_mul := f.initialIso_mul + action_original := f.initialIso_old + agreement := f.initial_agreement + negative := f.initial_negative + +noncomputable def stages : Nat → CompressionStage f + | 0 => f.firstStage + | n + 1 => (stages n).next + +theorem stages_agreement (n : Nat) (g h : G) (v : A) + (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) + (x : (f.stages n).Old ⊕ (f.stages n).batch.Fresh) + (below : (f.stages n).batch.extension.le x (.inl ((f.stages n).original.toFun v))) : + ((f.stages n).symmetry g).current.toFun x = + ((f.stages n).symmetry h).current.toFun x := + (f.stages n).agreement g h v agree x below + +end TaskSystem +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem + +open Attachment + +universe u + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +def Point (n : Nat) : Type u := (f.stages n).Old + +noncomputable def order (n : Nat) : MeetOrder (f.Point n) := (f.stages n).oldOrder + +noncomputable def origin (n : Nat) : MeetEmbedding P (f.order n) := (f.stages n).original + +noncomputable def step (n : Nat) : MeetEmbedding (f.order n) (f.order (n + 1)) := + (f.stages n).batch.oldEmbedding + +noncomputable def compression (n : Nat) (i : Task) : MeetEmbedding (f.order n) (f.order (n + 1)) := + (f.stages n).inputs.previous i + +noncomputable def stageAction : (n : Nat) → G → MeetIso (f.order n) (f.order n) + | 0, g => f.action g + | n + 1, g => ((f.stages n).symmetry g).current + +theorem origins_coherent (n : Nat) (x : A) : + (f.step n).toFun ((f.origin n).toFun x) = (f.origin (n + 1)).toFun x := rfl + +theorem maps_coherent (n : Nat) (i : Task) (x : f.Point n) : + (f.step (n + 1)).toFun ((f.compression n i).toFun x) = + (f.compression (n + 1) i).toFun ((f.step n).toFun x) := rfl + +theorem actions_coherent (n : Nat) (g : G) (x : f.Point n) : + (f.step n).toFun ((f.stageAction n g).toFun x) = + (f.stageAction (n + 1) g).toFun ((f.step n).toFun x) := by + cases n <;> rfl + +theorem stage_bottom (n : Nat) (zero : A) (bottom : ∀ x, P.le zero x) : + ∀ x : f.Point n, (f.order n).le ((f.origin n).toFun zero) x := by + induction n with + | zero => exact bottom + | succ n ih => exact (f.stages n).batch.least_preserved ((f.origin n).toFun zero) ih + +theorem stageAction_one (n : Nat) (x : f.Point n) : + (f.stageAction n f.group.one).toFun x = x := by + cases n with + | zero => exact f.action_one x + | succ n => exact (f.stages n).action_one x + +theorem stageAction_mul (n : Nat) (g h : G) (x : f.Point n) : + (f.stageAction n (f.group.mul g h)).toFun x = + (f.stageAction n g).toFun ((f.stageAction n h).toFun x) := by + cases n with + | zero => exact f.action_mul g h x + | succ n => exact (f.stages n).action_mul g h x + +theorem stageAction_original (n : Nat) (g : G) (x : A) : + (f.stageAction n g).toFun ((f.origin n).toFun x) = + (f.origin n).toFun ((f.action g).toFun x) := by + cases n with + | zero => rfl + | succ n => exact (f.stages n).action_original g x + +theorem stage_equivariant (n : Nat) (g : G) (i : Task) (x : f.Point n) : + (f.stageAction (n + 1) g).toFun ((f.compression n i).toFun x) = + (f.compression n (f.perm g i)).toFun x := by + have h := ((f.stages n).symmetry g).intertwine i x + rw [(f.stages n).perm_eq] at h + exact h + +theorem stage_agreement (n : Nat) (g h : G) (v : A) + (agree : ∀ x, P.le x v → (f.action g).toFun x = (f.action h).toFun x) + (x : f.Point n) (below : (f.order n).le x ((f.origin n).toFun v)) : + (f.stageAction n g).toFun x = (f.stageAction n h).toFun x := by + cases n with + | zero => exact agree x below + | succ n => exact (f.stages n).agreement g h v agree x below + +theorem stage_base_agreement (n : Nat) (i : Task) (x : f.Point n) + (below : (f.order n).le x ((f.origin n).toFun (f.datum i).source)) : + (f.compression n i).toFun x = + (f.step n).toFun ((f.stageAction n (f.representative i)).toFun x) := by + have hx : (f.stages n).oldOrder.le x ((f.stages n).inputs.source i) := by + rw [(f.stages n).source_original] + exact below + exact ((f.stages n).inputs.agree i x hx).trans + (((f.stages n).representatives i (.inl x)).symm.trans + (f.actions_coherent n (f.representative i) x).symm) + +theorem maps_base (n : Nat) (i : Task) : + (f.compression n i).toFun ((f.origin n).toFun (f.datum i).source) = + (f.origin (n + 1)).toFun (f.datum i).target := by + rw [f.stage_base_agreement n i _ ((f.order n).refl _), f.stageAction_original, + f.representative_target, f.origins_coherent] + +noncomputable def cap (n : Nat) (i : Task) : f.Point (n + 1) := + (f.compression n i).toFun ((f.origin n).toFun f.top) + +theorem caps_coherent (n : Nat) (i : Task) : + (f.step (n + 1)).toFun (f.cap n i) = f.cap (n + 1) i := + f.maps_coherent n i ((f.origin n).toFun f.top) + +theorem range_below_cap (n : Nat) (i : Task) (x : f.Point n) : + (f.order (n + 1)).le ((f.compression n i).toFun x) (f.cap n i) := + ((f.compression n i).le_iff _ _).mpr ((f.stages n).top x) + +theorem cap_separation (n : Nat) (i j : Task) (different : i ≠ j) : + (f.order (n + 1)).le (f.cap n i) ((f.origin (n + 1)).toFun (f.datum j).target) ∨ + (f.order (n + 1)).le (f.cap n j) ((f.origin (n + 1)).toFun (f.datum i).target) ∨ + (f.order (n + 1)).meet (f.cap n i) (f.cap n j) = + (f.order (n + 1)).meet ((f.origin (n + 1)).toFun (f.datum i).target) + ((f.origin (n + 1)).toFun (f.datum j).target) := by + induction n with + | zero => + have h := f.initial.copy_cap_separation f.top f.greatest f.source_proper i j different + have bi : f.initial.batch.base i = (f.datum i).target := f.representative_target i + have bj : f.initial.batch.base j = (f.datum j).target := f.representative_target j + rw [bi, bj] at h + exact h + | succ n ih => + rcases ih with h | h | h + · have hn := ((f.step (n + 1)).le_iff _ _).mpr h + rw [f.caps_coherent, f.origins_coherent] at hn + exact Or.inl hn + · have hn := ((f.step (n + 1)).le_iff _ _).mpr h + rw [f.caps_coherent, f.origins_coherent] at hn + exact Or.inr (Or.inl hn) + · have hn := congrArg (f.step (n + 1)).toFun h + rw [(f.step (n + 1)).map_meet, (f.step (n + 1)).map_meet, + f.caps_coherent, f.caps_coherent, f.origins_coherent, f.origins_coherent] at hn + exact Or.inr (Or.inr hn) + +theorem original_below_cap (n : Nat) (i : Task) (v : A) : + (f.order (n + 1)).le ((f.origin (n + 1)).toFun v) (f.cap n i) ↔ P.le v (f.datum i).target := by + induction n with + | zero => + change f.initial.batch.extension.le (.inl v) (f.initial.batch.represent i f.top) ↔ _ + rw [f.initial.batch.represent_new i f.top (f.source_proper i)] + change P.le v (f.initial.batch.shadow ⟨i, ⟨f.top, f.source_proper i⟩⟩) ↔ _ + have hs := f.initial.batch.cap_shadow i f.top f.greatest (f.source_proper i) + change f.initial.batch.shadow ⟨i, ⟨f.top, f.source_proper i⟩⟩ = _ at hs + rw [hs] + have hb : f.initial.batch.base i = (f.datum i).target := f.representative_target i + rw [hb] + | succ n ih => + rw [← f.caps_coherent n i, ← f.origins_coherent (n + 1) v] + exact ((f.step (n + 1)).le_iff _ _).trans ih + +theorem cap_strict (n : Nat) (i : Task) : + (f.order (n + 1)).le ((f.origin (n + 1)).toFun (f.datum i).target) (f.cap n i) ∧ + ¬ (f.order (n + 1)).le (f.cap n i) ((f.origin (n + 1)).toFun (f.datum i).target) := by + constructor + · exact (f.original_below_cap n i _).mpr (P.refl _) + · intro h + rw [← f.maps_base n i] at h + have lower := ((f.compression n i).le_iff _ _).mp h + exact f.source_proper i (((f.origin n).le_iff _ _).mp lower) + +theorem separator_not_below_cap (n : Nat) (i : Task) : + ¬ (f.order (n + 1)).le ((f.origin (n + 1)).toFun (f.datum i).separator) (f.cap n i) := + fun h => (f.geometry i).separator_not_le_base ((f.original_below_cap n i _).mp h) + +theorem stage_fresh_accounting (n : Nat) (z : (f.stages n).batch.Fresh) : + ∃ (i : Task) (y : f.Point n), (f.compression n i).toFun y = .inr z ∧ + (f.order (n + 1)).le (.inr z) (f.cap n i) ∧ + ¬ (f.order (n + 1)).le (.inr z) ((f.origin (n + 1)).toFun (f.datum i).target) := by + cases n with + | zero => + rcases z with ⟨i, y, hy⟩ + have image := f.initial.batch.represent_new i y hy + refine ⟨i, y, image, ?_, ?_⟩ + · have lower := f.range_below_cap 0 i y + change f.initial.batch.extension.le (f.initial.batch.represent i y) _ at lower + rw [image] at lower + exact lower + · exact fun h => (f.geometry i).separator_not_le_base + ((f.geometry i).separator_le_filter _ h) + | succ n => + rcases (f.stages n).inputs.fresh_accounting ((f.stages n).original.toFun f.top) + (f.stages n).top z with ⟨i, y, image, lower, outside⟩ + refine ⟨i, y, image, lower, ?_⟩ + rw [← f.maps_base (n + 1) i] + change ¬ (f.stages n).inputs.nextBatch.extension.le (.inr z) + (.inl (((f.stages n).inputs.previous i).toFun ((f.stages n).original.toFun (f.datum i).source))) + rw [← (f.stages n).source_original] + exact outside + +end PartitionPilot.Compression.RecursiveMaps.TaskSystem + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoinitialityPreservation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoinitialityPreservation.lean index 1b9f587790ded511939186106f1d8998279bc5a3..94eaea1361953ca31d6bd609b8cfe8795c846af3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoinitialityPreservation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CoinitialityPreservation.lean @@ -1,87 +1,87 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.FinalProfilePersistence - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.Chronological - -universe u v w - -theorem all_filters_of_countable {A : Type u} [Countable A] (P : MeetOrder A) : - AllFiltersCountable P := fun F => - countableBelow_of_countable F F.mem (Set.to_countable _) (fun _ h => h) - -theorem all_filters_of_countable_cover {A : Type u} {I : Type v} [Countable I] - {P : MeetOrder A} (Space : I → Type w) (orders : ∀ i, MeetOrder (Space i)) - (copy : ∀ i, MeetEmbedding (orders i) P) - (cover : ∀ x, ∃ i y, (copy i).toFun y = x) - (small : ∀ i, AllFiltersCountable (orders i)) : AllFiltersCountable P := by - intro F - apply countableBelow_union F F.mem (fun i x => F.mem x ∧ ∃ y, (copy i).toFun y = x) - · intro x positive - rcases cover x with ⟨i, y, eq⟩ - exact ⟨i, positive, y, eq⟩ - · intro i - exact countableBelow_copy (copy i) F (small i) - -theorem all_filters_of_surjective {A : Type u} {B : Type v} - {P : MeetOrder A} {Q : MeetOrder B} (e : MeetEmbedding P Q) - (onto : Function.Surjective e.toFun) (small : AllFiltersCountable P) : AllFiltersCountable Q := by - intro F - exact countableBelow_mono F (countableBelow_copy e F small) (fun x hx => ⟨hx, onto x⟩) - -def twoLayerBirth {O : Type u} {N : Type v} : O ⊕ N → ULift.{max u v} Nat - | .inl _ => ⟨0⟩ - | .inr _ => ⟨1⟩ - -theorem all_filters_of_separated_sum {O N I : Type u} {P : MeetOrder O} - (Q : MeetOrder (O ⊕ N)) (old : MeetEmbedding P Q) - (old_eq : ∀ x, old.toFun x = .inl x) - (Space : I → Type u) (orders : ∀ i, MeetOrder (Space i)) - (copy : ∀ i, MeetEmbedding (orders i) Q) (component : N → I) - (cover : ∀ x, ∃ y, (copy (component x)).toFun y = .inr x) - (separated : ∀ x y, component x ≠ component y → - OldBridge (P := Q) twoLayerBirth ⟨1⟩ (.inr x) (.inr y)) - (oldSmall : AllFiltersCountable P) (copySmall : ∀ i, AllFiltersCountable (orders i)) : - AllFiltersCountable Q := by - classical - let : WellFoundedLT (ULift.{u} Nat) := InvImage.wf ULift.down Nat.lt_wfRel.wf - intro F - have fresh : CountableBelow F - (fun x => Essential twoLayerBirth F x ∧ ∃ y, Sum.inr y = x) := by - by_cases inhabited : ∃ x : N, Essential twoLayerBirth F (.inr x) - · rcases inhabited with ⟨x, hx⟩ - apply countableBelow_mono F (countableBelow_copy (copy (component x)) F (copySmall _)) - rintro y ⟨hy, z, rfl⟩ - have same : component z = component x := by - by_contra different - exact essentials_no_bridge twoLayerBirth F ⟨1⟩ (.inr z) (.inr x) hy hx rfl rfl - (separated z x different) - have covered := cover z - rw [same] at covered - exact ⟨hy.1, covered⟩ - · exact countableBelow_empty F _ (by - rintro x ⟨hx, y, rfl⟩ - exact inhabited ⟨y, hx⟩) - apply countable_basis_of_layers twoLayerBirth F (Set.to_countable _) - rintro ⟨s⟩ - cases s with - | zero => - apply countableBelow_mono F (countableBelow_copy old F oldSmall) - rintro x ⟨hx, born⟩ - cases x with - | inl x => exact ⟨hx.1, x, old_eq x⟩ - | inr x => exact False.elim (Nat.one_ne_zero (congrArg ULift.down born)) - | succ s => - apply countableBelow_mono F fresh - rintro x ⟨hx, born⟩ - cases x with - | inl x => exact False.elim (Nat.noConfusion (congrArg ULift.down born)) - | inr x => exact ⟨hx, x, rfl⟩ - -end PartitionPilot.Compression.RecursiveMaps.Chronological - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.FinalProfilePersistence + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.Chronological + +universe u v w + +theorem all_filters_of_countable {A : Type u} [Countable A] (P : MeetOrder A) : + AllFiltersCountable P := fun F => + countableBelow_of_countable F F.mem (Set.to_countable _) (fun _ h => h) + +theorem all_filters_of_countable_cover {A : Type u} {I : Type v} [Countable I] + {P : MeetOrder A} (Space : I → Type w) (orders : ∀ i, MeetOrder (Space i)) + (copy : ∀ i, MeetEmbedding (orders i) P) + (cover : ∀ x, ∃ i y, (copy i).toFun y = x) + (small : ∀ i, AllFiltersCountable (orders i)) : AllFiltersCountable P := by + intro F + apply countableBelow_union F F.mem (fun i x => F.mem x ∧ ∃ y, (copy i).toFun y = x) + · intro x positive + rcases cover x with ⟨i, y, eq⟩ + exact ⟨i, positive, y, eq⟩ + · intro i + exact countableBelow_copy (copy i) F (small i) + +theorem all_filters_of_surjective {A : Type u} {B : Type v} + {P : MeetOrder A} {Q : MeetOrder B} (e : MeetEmbedding P Q) + (onto : Function.Surjective e.toFun) (small : AllFiltersCountable P) : AllFiltersCountable Q := by + intro F + exact countableBelow_mono F (countableBelow_copy e F small) (fun x hx => ⟨hx, onto x⟩) + +def twoLayerBirth {O : Type u} {N : Type v} : O ⊕ N → ULift.{max u v} Nat + | .inl _ => ⟨0⟩ + | .inr _ => ⟨1⟩ + +theorem all_filters_of_separated_sum {O N I : Type u} {P : MeetOrder O} + (Q : MeetOrder (O ⊕ N)) (old : MeetEmbedding P Q) + (old_eq : ∀ x, old.toFun x = .inl x) + (Space : I → Type u) (orders : ∀ i, MeetOrder (Space i)) + (copy : ∀ i, MeetEmbedding (orders i) Q) (component : N → I) + (cover : ∀ x, ∃ y, (copy (component x)).toFun y = .inr x) + (separated : ∀ x y, component x ≠ component y → + OldBridge (P := Q) twoLayerBirth ⟨1⟩ (.inr x) (.inr y)) + (oldSmall : AllFiltersCountable P) (copySmall : ∀ i, AllFiltersCountable (orders i)) : + AllFiltersCountable Q := by + classical + let : WellFoundedLT (ULift.{u} Nat) := InvImage.wf ULift.down Nat.lt_wfRel.wf + intro F + have fresh : CountableBelow F + (fun x => Essential twoLayerBirth F x ∧ ∃ y, Sum.inr y = x) := by + by_cases inhabited : ∃ x : N, Essential twoLayerBirth F (.inr x) + · rcases inhabited with ⟨x, hx⟩ + apply countableBelow_mono F (countableBelow_copy (copy (component x)) F (copySmall _)) + rintro y ⟨hy, z, rfl⟩ + have same : component z = component x := by + by_contra different + exact essentials_no_bridge twoLayerBirth F ⟨1⟩ (.inr z) (.inr x) hy hx rfl rfl + (separated z x different) + have covered := cover z + rw [same] at covered + exact ⟨hy.1, covered⟩ + · exact countableBelow_empty F _ (by + rintro x ⟨hx, y, rfl⟩ + exact inhabited ⟨y, hx⟩) + apply countable_basis_of_layers twoLayerBirth F (Set.to_countable _) + rintro ⟨s⟩ + cases s with + | zero => + apply countableBelow_mono F (countableBelow_copy old F oldSmall) + rintro x ⟨hx, born⟩ + cases x with + | inl x => exact ⟨hx.1, x, old_eq x⟩ + | inr x => exact False.elim (Nat.one_ne_zero (congrArg ULift.down born)) + | succ s => + apply countableBelow_mono F fresh + rintro x ⟨hx, born⟩ + cases x with + | inl x => exact False.elim (Nat.noConfusion (congrArg ULift.down born)) + | inr x => exact ⟨hx, x, rfl⟩ + +end PartitionPilot.Compression.RecursiveMaps.Chronological + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CompressionPrefixCoinitiality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CompressionPrefixCoinitiality.lean index 9c0843116cae4399b5f62a76519c3c4279cfe7db..d06ffcaad980d1932d15f4d08baf7bcc784cc10f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CompressionPrefixCoinitiality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CompressionPrefixCoinitiality.lean @@ -1,554 +1,554 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend - -namespace OAI - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -noncomputable def incoming_birth_layer_of_constancy - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {base birth bound stamp : ZFSet.{u}} - (born : ZFSet.IsFunc state.data.D bound birth) - (old : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (before : base ∈ stamp) - (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) : - CodedGrowthLayer M Space sourceOrder sourceMeet state.data.currentCarrier - state.data.currentOrder state.data.currentMeet (state.batch.batchBirth birth stamp) stamp := by - apply state.batch.batchBirth_incoming_layer pairing unions powers separation - state.ground.carrier state.ground.indices state.ground.spaces state.ground.relations - state.ground.anchors state.ground.embeddings born old (fun _ => base) (fun _ => before) - · intro i - exact space.trans ((constant.space_entry_iff _ _).1 - (state.batch.space_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩)).2.symm - · intro i - exact order.trans ((constant.relation_entry_iff _ _).1 - (state.batch.rel_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩)).2.symm - · intro i - exact meet.trans ((constant.meet_entry_iff _ _).1 - (state.batch.meet_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩)).2.symm - -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include hI hSources hReps hG hT - -noncomputable def canonical_incoming_birth_layer - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {base stamps limit old birth : ZFSet.{u}} - (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) - (compressionStamp base) old birth) - (born : ZFSet.IsFunc state.data.D limit old) - (times : CompressionStampCode base stamps limit) - (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) - (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) - (n : Nat) : - CodedGrowthLayer M Space sourceOrder sourceMeet - (state.data.iterate M I Sources Reps G T n).currentCarrier - (state.data.iterate M I Sources Reps G T n).currentOrder - (state.data.iterate M I Sources Reps G T n).currentMeet - (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D birth) - (compressionStamp base n) := by - let current := state.iterate pairing unions powers separation hI hSources hReps hG hT n - have equal : current.data = state.data.iterate M I Sources Reps G T n := - state.iterate_data pairing unions powers separation hI hSources hReps hG hT n - have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by - simpa only [equal] using constant.iterate M I Sources Reps G T n - have finite : ZFSet.IsFunc current.data.D limit - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by - simpa only [equal] using state.canonical_birth_function data pairing unions powers separation - hI hSources hReps hG hT code born times n - have earlier : ∀ x t, ZFSet.pair x t ∈ - graphRestriction (state.data.iterate M I Sources Reps G T n).D birth → t ∈ compressionStamp base n := - fun _ _ entry => state.canonical_birth_before_stamp pairing unions powers separation - hI hSources hReps hG hT code oldBound n entry - have result := current.incoming_birth_layer_of_constancy pairing unions powers separation - currentConstant finite earlier (compressionStamp_base_mem base n) space order meet - change CodedGrowthLayer M Space sourceOrder sourceMeet current.data.currentCarrier - current.data.currentOrder current.data.currentMeet - (taggedBirth current.data.D current.data.fresh - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) - (compressionStamp base n)) (compressionStamp base n) at result - rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT code born n] - simpa only [equal] using result - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -include pairing unions powers separation hI hSources hReps hG hT - -noncomputable def ground_birth_incoming_layer - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) - (n : Nat) : - CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) - (data.fields 2) births.birth (compressionStamp base n) := - state.canonical_birth_layer_to_union data pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_function (n + 1) - ((compressionStamp_mem_iff base n (n + 1)).2 (Nat.lt_succ_self n)) - (state.canonical_incoming_birth_layer pairing unions powers separation data - hI hSources hReps hG hT constant births.extension births.initial_function births.times - births.initial_bound space order meet n) - -noncomputable def ground_birth_prior_layer {t : ZFSet.{u}} (priorTime : t ∈ base ∨ t = base) - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet state.data.D state.data.rD state.data.μD old t) : - CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) - (data.fields 2) births.birth t := - state.prior_birth_layer_to_union data pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_function priorTime layer - -omit pairing unions powers separation hI hSources hReps hG hT in -def ground_birth_limit_layer : - CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) - (data.fields 2) births.birth births.limit := - .empty_of_no_birth ⟨data.fields 0, data.ground 0⟩ (fun x _ => births.no_limit_birth x) - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} -include pairing unions powers separation hI hSources hReps hG hT - -section Transfer -variable {base limit old birth : ZFSet.{u}} -variable (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) - (compressionStamp base) old birth) -variable (born : ZFSet.IsFunc state.data.D limit old) -include code born - -noncomputable def canonical_birth_layer_to_finite (n k : Nat) (before : n ≤ k) - {t : ZFSet.{u}} (earlier : t ∈ compressionStamp base n) - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet - (state.data.iterate M I Sources Reps G T n).D - (state.data.iterate M I Sources Reps G T n).rD - (state.data.iterate M I Sources Reps G T n).μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) t) : - CodedGrowthLayer M Space sourceOrder sourceMeet - (state.data.iterate M I Sources Reps G T k).D - (state.data.iterate M I Sources Reps G T k).rD - (state.data.iterate M I Sources Reps G T k).μD - (graphRestriction (state.data.iterate M I Sources Reps G T k).D birth) t := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - have growth := state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT before - have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := by - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - rw [← equal] - exact current.ground.carrier - exact layer.of_literal_extension separation ground growth.1 growth.2.1 growth.2.2.1 - (NatBirthExtensionCode.restriction_mono mono before) - (fun _ _ entry => code.earlier_fiber mono born - (fun _ _ h => compressionStamp_subset base h) n earlier - (pair_mem_graphRestriction.1 entry).1) - -noncomputable def prior_birth_layer_to_finite (k : Nat) {t : ZFSet.{u}} - (priorTime : t ∈ base ∨ t = base) - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet - state.data.D state.data.rD state.data.μD old t) : - CodedGrowthLayer M Space sourceOrder sourceMeet - (state.data.iterate M I Sources Reps G T k).D - (state.data.iterate M I Sources Reps G T k).rD - (state.data.iterate M I Sources Reps G T k).μD - (graphRestriction (state.data.iterate M I Sources Reps G T k).D birth) t := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - have zero := code.restriction_zero mono born - apply state.canonical_birth_layer_to_finite pairing unions powers separation - hI hSources hReps hG hT code born 0 k (Nat.zero_le k) (compressionStamp_old_mem priorTime 0) - rw [zero] - simpa only [RecursiveStateData.iterate_zero] using layer -end Transfer - -noncomputable def ground_birth_finite_all_layers - (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) - {base old : ZFSet.{u}} - (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) - (prior : ∀ t, t ∈ base ∨ t = base → - CodedGrowthLayer M Space sourceOrder sourceMeet state.data.D state.data.rD state.data.μD old t) - (n : Nat) (t : ZFSet.{u}) (bound : t ∈ compressionStamp base n ∨ t = compressionStamp base n) : - CodedGrowthLayer M Space sourceOrder sourceMeet - (state.data.iterate M I Sources Reps G T (n + 1)).D - (state.data.iterate M I Sources Reps G T (n + 1)).rD - (state.data.iterate M I Sources Reps G T (n + 1)).μD - (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) t := by - have cases : t ∈ base ∨ t = base ∨ ∃ j, j ≤ n ∧ t = compressionStamp base j := by - rcases bound with before | equal - · rcases (mem_compressionStamp_iff base t n).1 before with old | equal | ⟨j, before, equal⟩ - · exact Or.inl old - · exact Or.inr (Or.inl equal) - · exact Or.inr (Or.inr ⟨j, Nat.le_of_lt before, equal⟩) - · exact Or.inr (Or.inr ⟨n, Nat.le_refl n, equal⟩) - apply Classical.choice - rcases cases with old | equal | ⟨j, before, rfl⟩ - · exact ⟨state.prior_birth_layer_to_finite pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_function (n + 1) - (Or.inl old) (prior t (Or.inl old))⟩ - · exact ⟨state.prior_birth_layer_to_finite pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_function (n + 1) - (Or.inr equal) (prior t (Or.inr equal))⟩ - · exact ⟨state.canonical_birth_layer_to_finite pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_function (j + 1) (n + 1) - (Nat.add_le_add_right before 1) - ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) - (state.canonical_incoming_birth_layer pairing unions powers separation data - hI hSources hReps hG hT constant births.extension births.initial_function births.times - births.initial_bound space order meet j)⟩ - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) - -noncomputable def ground_birth_all_layers - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) - (prior : ∀ t, t ∈ base ∨ t = base → - CodedGrowthLayer M Space sourceOrder sourceMeet state.data.D state.data.rD state.data.μD old t) - (t : ZFSet.{u}) (bound : t ∈ births.limit ∨ t = births.limit) : - CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) - (data.fields 2) births.birth t := by - apply Classical.choice - rcases bound with before | rfl - · rcases (births.times.mem_limit_iff t).1 before with original | same | ⟨n, rfl⟩ - · exact ⟨state.ground_birth_prior_layer data births pairing unions powers separation - hI hSources hReps hG hT (Or.inl original) (prior t (Or.inl original))⟩ - · exact ⟨state.ground_birth_prior_layer data births pairing unions powers separation - hI hSources hReps hG hT (Or.inr same) (prior t (Or.inr same))⟩ - · exact ⟨state.ground_birth_incoming_layer data births pairing unions powers separation - hI hSources hReps hG hT constant space order meet n⟩ - · exact ⟨state.ground_birth_limit_layer data births⟩ - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T - data P0 C Q qlt original) -variable (prior : GroundChronologicalHistory M T0 C Q qlt) - -theorem prefix_sources_eq_below {t s : ZFSet.{u}} (oldTime : t ∈ base ∨ t = base) - (before : s ∈ t) : - (state.prefixFields data births heights prior).space s = prior.space s ∧ (state.prefixFields data births heights prior).order s = prior.order s ∧ - (state.prefixFields data births heights prior).meetGraph s = prior.meetGraph s := by - dsimp only [prefixFields] - exact ⟨compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, - compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, - compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before⟩ - -variable (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) -include ordinal hBase - -noncomputable def prefix_old_layer {cutoff t : ZFSet.{u}} - (oldCutoff : cutoff ∈ base ∨ cutoff = base) (bound : t = cutoff ∨ t ∈ cutoff) : - CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph - ((state.prefixFields data births heights prior).space cutoff) ((state.prefixFields data births heights prior).order cutoff) ((state.prefixFields data births heights prior).meetGraph cutoff) ((state.prefixFields data births heights prior).birth cutoff) t := by - have hc : cutoff ∈ T0 := oldCutoff.elim - (fun member => ordinal.1 base hBase cutoff member) (fun equal => equal.symm ▸ hBase) - have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) - (fun before => ordinal.1 cutoff hc t before) - have oldTime : t ∈ base ∨ t = base := by - rcases bound with equal | before - · exact equal.symm ▸ oldCutoff - · apply Or.inl - rcases oldCutoff with member | equal - · exact ordinal.2 base hBase cutoff member t before - · exact equal ▸ before - have layer := (prior.layer cutoff hc t ht bound).congr_sources_below - (fun s hs => (state.prefix_sources_eq_below data births heights prior oldTime hs).1.symm) - (fun s hs => (state.prefix_sources_eq_below data births heights prior oldTime hs).2.1.symm) - (fun s hs => (state.prefix_sources_eq_below data births heights prior oldTime hs).2.2.symm) - have values := state.prefixFields_old data births heights prior oldCutoff - simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer - -variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) -variable (initialMeet : state.data.μD = μ0) -variable (priorSpace : prior.space base = P0) (priorOrder : prior.order base = r0) -variable (priorMeet : prior.meetGraph base = μ0) (priorBirth : prior.birth base = old) -include initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth - -noncomputable def prefix_base_layers (t : ZFSet.{u}) (before : t ∈ base ∨ t = base) : - CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph - state.data.D state.data.rD state.data.μD old t := by - have layer := state.prefix_old_layer data births heights prior ordinal hBase - (Or.inr rfl : base ∈ base ∨ base = base) before.symm - have values := state.prefixFields_old data births heights prior (Or.inr rfl : base ∈ base ∨ base = base) - simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1, - priorSpace, priorOrder, priorMeet, priorBirth, initialDomain, initialOrder, initialMeet] using layer - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) -include pairing unions powers separation hI hSources hReps hG hT constant - -noncomputable def prefix_finite_layers (n : Nat) (t : ZFSet.{u}) - (bound : t = compressionStamp base n ∨ t ∈ compressionStamp base n) : - CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph - ((state.prefixFields data births heights prior).space (compressionStamp base n)) ((state.prefixFields data births heights prior).order (compressionStamp base n)) - ((state.prefixFields data births heights prior).meetGraph (compressionStamp base n)) ((state.prefixFields data births heights prior).birth (compressionStamp base n)) t := by - have atBase := state.prefixFields_old data births heights prior (Or.inr rfl : base ∈ base ∨ base = base) - have layer := state.ground_birth_finite_all_layers pairing unions powers separation - hI hSources hReps hG hT data births constant - (atBase.1.trans priorSpace) (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) - (state.prefix_base_layers data births heights prior ordinal hBase initialDomain initialOrder - initialMeet priorSpace priorOrder priorMeet priorBirth) n t bound.symm - have values := state.prefixFields_stamp data births heights prior n - simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer - -noncomputable def prefix_union_layers (t : ZFSet.{u}) - (bound : t = births.limit ∨ t ∈ births.limit) : - CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph - ((state.prefixFields data births heights prior).space births.limit) ((state.prefixFields data births heights prior).order births.limit) - ((state.prefixFields data births heights prior).meetGraph births.limit) ((state.prefixFields data births heights prior).birth births.limit) t := by - have atBase := state.prefixFields_old data births heights prior (Or.inr rfl : base ∈ base ∨ base = base) - have layer := state.ground_birth_all_layers data births pairing unions powers separation - hI hSources hReps hG hT constant - (atBase.1.trans priorSpace) (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) - (state.prefix_base_layers data births heights prior ordinal hBase initialDomain initialOrder - initialMeet priorSpace priorOrder priorMeet priorBirth) t bound.symm - have values := state.prefixFields_limit data births heights prior - simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer - -noncomputable def prefix_all_layers : - ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, - t = cutoff ∨ t ∈ cutoff → CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph - ((state.prefixFields data births heights prior).space cutoff) ((state.prefixFields data births heights prior).order cutoff) ((state.prefixFields data births heights prior).meetGraph cutoff) ((state.prefixFields data births heights prior).birth cutoff) t := by - intro cutoff hc t _ bound - apply Classical.choice - rcases ZFSet.mem_insert_iff.1 hc with equal | before - · subst cutoff - exact ⟨state.prefix_union_layers data births heights prior ordinal hBase initialDomain initialOrder - initialMeet priorSpace priorOrder priorMeet priorBirth pairing unions powers separation - hI hSources hReps hG hT constant t bound⟩ - · rcases (births.times.mem_limit_iff cutoff).1 before with oldTime | same | ⟨n, rfl⟩ - · exact ⟨state.prefix_old_layer data births heights prior ordinal hBase (Or.inl oldTime) bound⟩ - · exact ⟨state.prefix_old_layer data births heights prior ordinal hBase (Or.inr same) bound⟩ - · exact ⟨state.prefix_finite_layers data births heights prior ordinal hBase initialDomain initialOrder - initialMeet priorSpace priorOrder priorMeet priorBirth pairing unions powers separation - hI hSources hReps hG hT constant n t bound⟩ - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundChronologicalHistory M T0 C Q qlt) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) -variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) -variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) -variable (initialMeet : state.data.μD = μ0) -variable (priorSpace : prior.space base = P0) (priorOrder : prior.order base = r0) -variable (priorMeet : prior.meetGraph base = μ0) (priorBirth : prior.birth base = old) - -noncomputable def prefixHistory : - GroundChronologicalHistory M (insert births.limit births.limit) C Q qlt where - space := (state.prefixFields data births heights prior).space - order := (state.prefixFields data births heights prior).order - meetGraph := (state.prefixFields data births heights prior).meetGraph - birth := (state.prefixFields data births heights prior).birth - height := (state.prefixFields data births heights prior).height - space_mem := fun _ hs => (state.prefixFields_ground data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).1 - order_mem := fun _ hs => (state.prefixFields_ground data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.1 - meet_mem := fun _ hs => (state.prefixFields_ground data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.1 - birth_mem := fun _ hs => (state.prefixFields_ground data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.1 - height_mem := fun _ hs => (state.prefixFields_ground data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.2 - meet_order := fun _ hs => (state.prefixFields_stage_laws data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).1 - birth_function := fun _ hs => (state.prefixFields_stage_laws data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.1 - birth_bound := fun _ hs => (state.prefixFields_stage_laws data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.1 - old_meet := fun _ hs => (state.prefixFields_stage_laws data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.1 - strict_height := fun _ hs => (state.prefixFields_stage_laws data births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.2 - layer := state.prefix_all_layers data births heights prior ordinal hBase initialDomain initialOrder - initialMeet priorSpace priorOrder priorMeet priorBirth pairing unions powers separation - hI hSources hReps hG hT constant - -local notation "history" => state.prefixHistory data births heights prior pairing unions powers separation - hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet - priorSpace priorOrder priorMeet priorBirth - -theorem prefixHistory_old {s : ZFSet.{u}} (before : s ∈ base ∨ s = base) : - (history).space s = prior.space s ∧ (history).order s = prior.order s ∧ - (history).meetGraph s = prior.meetGraph s ∧ (history).birth s = prior.birth s ∧ - (history).height s = prior.height s := - state.prefixFields_old data births heights prior before - -theorem prefixHistory_stamp (n : Nat) : - (history).space (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ - (history).order (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ - (history).meetGraph (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ - (history).birth (compressionStamp base n) = - graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth ∧ - (history).height (compressionStamp base n) = heights.function.natValue (n + 1) := - state.prefixFields_stamp data births heights prior n - -theorem prefixHistory_limit : - (history).space births.limit = data.fields 0 ∧ (history).order births.limit = data.fields 1 ∧ - (history).meetGraph births.limit = data.fields 2 ∧ (history).birth births.limit = births.birth ∧ - (history).height births.limit = heights.height := - state.prefixFields_limit data births heights prior - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M N : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T - data P0 C Q qlt original) -variable (prior : GroundChronologicalHistory M T0 C Q qlt) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) -variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) -variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) -variable (initialMeet : state.data.μD = μ0) -variable (priorSpace : prior.space base = P0) (priorOrder : prior.order base = r0) -variable (priorMeet : prior.meetGraph base = μ0) (priorBirth : prior.birth base = old) - -include state data births heights prior pairing unions powers separation - hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet - priorSpace priorOrder priorMeet priorBirth - -theorem prefix_exists_extension_basis - (includes : M.sets ⊆ N.sets) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets SetFormula.infinity Fin.elim0) - (choiceN : Realize N.sets SetFormula.choice Fin.elim0) - (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) - (smallQ : M.groundEmbeddable Q ZFSet.omega) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - {F : ZFSet.{u}} (hF : F ∈ N.sets) - (filter : MeetFilterCode (data.fields 0) (data.fields 1) (data.fields 2) F) : - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ data.fields 1 := by - let history := state.prefixHistory data births heights prior pairing unions powers separation - hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet - priorSpace priorOrder priorMeet priorBirth - have atLimit := state.prefixHistory_limit data births heights prior pairing unions powers separation - hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet - priorSpace priorOrder priorMeet priorBirth - change history.space births.limit = data.fields 0 ∧ history.order births.limit = data.fields 1 ∧ - history.meetGraph births.limit = data.fields 2 ∧ history.birth births.limit = births.birth ∧ - history.height births.limit = heights.height at atLimit - have filterAtLimit : MeetFilterCode (history.space births.limit) (history.order births.limit) - (history.meetGraph births.limit) F := by - simpa only [atLimit.1, atLimit.2.1, atLimit.2.2.1] using filter - have basis := history.exists_extension_basis includes pairingN unionsN powersN separationN - infiniteN choiceN (M.insert_mem pairing unions births.limit_ground births.limit_ground) - hC hQ (ordinalSetProperty_succ births.times.ordinal) smallQ irreflexive - (ZFSet.mem_insert births.limit births.limit) hF filterAtLimit - simpa only [atLimit.2.1] using basis - -end PartitionPilot.Forcing.GroundCompressionState - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend + +namespace OAI + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +noncomputable def incoming_birth_layer_of_constancy + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {base birth bound stamp : ZFSet.{u}} + (born : ZFSet.IsFunc state.data.D bound birth) + (old : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (before : base ∈ stamp) + (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) : + CodedGrowthLayer M Space sourceOrder sourceMeet state.data.currentCarrier + state.data.currentOrder state.data.currentMeet (state.batch.batchBirth birth stamp) stamp := by + apply state.batch.batchBirth_incoming_layer pairing unions powers separation + state.ground.carrier state.ground.indices state.ground.spaces state.ground.relations + state.ground.anchors state.ground.embeddings born old (fun _ => base) (fun _ => before) + · intro i + exact space.trans ((constant.space_entry_iff _ _).1 + (state.batch.space_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩)).2.symm + · intro i + exact order.trans ((constant.relation_entry_iff _ _).1 + (state.batch.rel_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩)).2.symm + · intro i + exact meet.trans ((constant.meet_entry_iff _ _).1 + (state.batch.meet_entry ⟨SetMembers.raw i, SetMembers.raw_mem i⟩)).2.symm + +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include hI hSources hReps hG hT + +noncomputable def canonical_incoming_birth_layer + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {base stamps limit old birth : ZFSet.{u}} + (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) + (compressionStamp base) old birth) + (born : ZFSet.IsFunc state.data.D limit old) + (times : CompressionStampCode base stamps limit) + (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) + (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) + (n : Nat) : + CodedGrowthLayer M Space sourceOrder sourceMeet + (state.data.iterate M I Sources Reps G T n).currentCarrier + (state.data.iterate M I Sources Reps G T n).currentOrder + (state.data.iterate M I Sources Reps G T n).currentMeet + (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D birth) + (compressionStamp base n) := by + let current := state.iterate pairing unions powers separation hI hSources hReps hG hT n + have equal : current.data = state.data.iterate M I Sources Reps G T n := + state.iterate_data pairing unions powers separation hI hSources hReps hG hT n + have currentConstant : RecursiveTemplateConstancy P0 r0 μ0 current.data := by + simpa only [equal] using constant.iterate M I Sources Reps G T n + have finite : ZFSet.IsFunc current.data.D limit + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by + simpa only [equal] using state.canonical_birth_function data pairing unions powers separation + hI hSources hReps hG hT code born times n + have earlier : ∀ x t, ZFSet.pair x t ∈ + graphRestriction (state.data.iterate M I Sources Reps G T n).D birth → t ∈ compressionStamp base n := + fun _ _ entry => state.canonical_birth_before_stamp pairing unions powers separation + hI hSources hReps hG hT code oldBound n entry + have result := current.incoming_birth_layer_of_constancy pairing unions powers separation + currentConstant finite earlier (compressionStamp_base_mem base n) space order meet + change CodedGrowthLayer M Space sourceOrder sourceMeet current.data.currentCarrier + current.data.currentOrder current.data.currentMeet + (taggedBirth current.data.D current.data.fresh + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) + (compressionStamp base n)) (compressionStamp base n) at result + rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT code born n] + simpa only [equal] using result + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +include pairing unions powers separation hI hSources hReps hG hT + +noncomputable def ground_birth_incoming_layer + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) + (n : Nat) : + CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) + (data.fields 2) births.birth (compressionStamp base n) := + state.canonical_birth_layer_to_union data pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_function (n + 1) + ((compressionStamp_mem_iff base n (n + 1)).2 (Nat.lt_succ_self n)) + (state.canonical_incoming_birth_layer pairing unions powers separation data + hI hSources hReps hG hT constant births.extension births.initial_function births.times + births.initial_bound space order meet n) + +noncomputable def ground_birth_prior_layer {t : ZFSet.{u}} (priorTime : t ∈ base ∨ t = base) + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet state.data.D state.data.rD state.data.μD old t) : + CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) + (data.fields 2) births.birth t := + state.prior_birth_layer_to_union data pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_function priorTime layer + +omit pairing unions powers separation hI hSources hReps hG hT in +def ground_birth_limit_layer : + CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) + (data.fields 2) births.birth births.limit := + .empty_of_no_birth ⟨data.fields 0, data.ground 0⟩ (fun x _ => births.no_limit_birth x) + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} +include pairing unions powers separation hI hSources hReps hG hT + +section Transfer +variable {base limit old birth : ZFSet.{u}} +variable (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) + (compressionStamp base) old birth) +variable (born : ZFSet.IsFunc state.data.D limit old) +include code born + +noncomputable def canonical_birth_layer_to_finite (n k : Nat) (before : n ≤ k) + {t : ZFSet.{u}} (earlier : t ∈ compressionStamp base n) + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet + (state.data.iterate M I Sources Reps G T n).D + (state.data.iterate M I Sources Reps G T n).rD + (state.data.iterate M I Sources Reps G T n).μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) t) : + CodedGrowthLayer M Space sourceOrder sourceMeet + (state.data.iterate M I Sources Reps G T k).D + (state.data.iterate M I Sources Reps G T k).rD + (state.data.iterate M I Sources Reps G T k).μD + (graphRestriction (state.data.iterate M I Sources Reps G T k).D birth) t := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + have growth := state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT before + have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := by + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + rw [← equal] + exact current.ground.carrier + exact layer.of_literal_extension separation ground growth.1 growth.2.1 growth.2.2.1 + (NatBirthExtensionCode.restriction_mono mono before) + (fun _ _ entry => code.earlier_fiber mono born + (fun _ _ h => compressionStamp_subset base h) n earlier + (pair_mem_graphRestriction.1 entry).1) + +noncomputable def prior_birth_layer_to_finite (k : Nat) {t : ZFSet.{u}} + (priorTime : t ∈ base ∨ t = base) + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet + state.data.D state.data.rD state.data.μD old t) : + CodedGrowthLayer M Space sourceOrder sourceMeet + (state.data.iterate M I Sources Reps G T k).D + (state.data.iterate M I Sources Reps G T k).rD + (state.data.iterate M I Sources Reps G T k).μD + (graphRestriction (state.data.iterate M I Sources Reps G T k).D birth) t := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + have zero := code.restriction_zero mono born + apply state.canonical_birth_layer_to_finite pairing unions powers separation + hI hSources hReps hG hT code born 0 k (Nat.zero_le k) (compressionStamp_old_mem priorTime 0) + rw [zero] + simpa only [RecursiveStateData.iterate_zero] using layer +end Transfer + +noncomputable def ground_birth_finite_all_layers + (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) + {base old : ZFSet.{u}} + (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) + (prior : ∀ t, t ∈ base ∨ t = base → + CodedGrowthLayer M Space sourceOrder sourceMeet state.data.D state.data.rD state.data.μD old t) + (n : Nat) (t : ZFSet.{u}) (bound : t ∈ compressionStamp base n ∨ t = compressionStamp base n) : + CodedGrowthLayer M Space sourceOrder sourceMeet + (state.data.iterate M I Sources Reps G T (n + 1)).D + (state.data.iterate M I Sources Reps G T (n + 1)).rD + (state.data.iterate M I Sources Reps G T (n + 1)).μD + (graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) t := by + have cases : t ∈ base ∨ t = base ∨ ∃ j, j ≤ n ∧ t = compressionStamp base j := by + rcases bound with before | equal + · rcases (mem_compressionStamp_iff base t n).1 before with old | equal | ⟨j, before, equal⟩ + · exact Or.inl old + · exact Or.inr (Or.inl equal) + · exact Or.inr (Or.inr ⟨j, Nat.le_of_lt before, equal⟩) + · exact Or.inr (Or.inr ⟨n, Nat.le_refl n, equal⟩) + apply Classical.choice + rcases cases with old | equal | ⟨j, before, rfl⟩ + · exact ⟨state.prior_birth_layer_to_finite pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_function (n + 1) + (Or.inl old) (prior t (Or.inl old))⟩ + · exact ⟨state.prior_birth_layer_to_finite pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_function (n + 1) + (Or.inr equal) (prior t (Or.inr equal))⟩ + · exact ⟨state.canonical_birth_layer_to_finite pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_function (j + 1) (n + 1) + (Nat.add_le_add_right before 1) + ((compressionStamp_mem_iff base j (j + 1)).2 (Nat.lt_succ_self j)) + (state.canonical_incoming_birth_layer pairing unions powers separation data + hI hSources hReps hG hT constant births.extension births.initial_function births.times + births.initial_bound space order meet j)⟩ + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) + +noncomputable def ground_birth_all_layers + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + (space : Space base = P0) (order : sourceOrder base = r0) (meet : sourceMeet base = μ0) + (prior : ∀ t, t ∈ base ∨ t = base → + CodedGrowthLayer M Space sourceOrder sourceMeet state.data.D state.data.rD state.data.μD old t) + (t : ZFSet.{u}) (bound : t ∈ births.limit ∨ t = births.limit) : + CodedGrowthLayer M Space sourceOrder sourceMeet (data.fields 0) (data.fields 1) + (data.fields 2) births.birth t := by + apply Classical.choice + rcases bound with before | rfl + · rcases (births.times.mem_limit_iff t).1 before with original | same | ⟨n, rfl⟩ + · exact ⟨state.ground_birth_prior_layer data births pairing unions powers separation + hI hSources hReps hG hT (Or.inl original) (prior t (Or.inl original))⟩ + · exact ⟨state.ground_birth_prior_layer data births pairing unions powers separation + hI hSources hReps hG hT (Or.inr same) (prior t (Or.inr same))⟩ + · exact ⟨state.ground_birth_incoming_layer data births pairing unions powers separation + hI hSources hReps hG hT constant space order meet n⟩ + · exact ⟨state.ground_birth_limit_layer data births⟩ + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T + data P0 C Q qlt original) +variable (prior : GroundChronologicalHistory M T0 C Q qlt) + +theorem prefix_sources_eq_below {t s : ZFSet.{u}} (oldTime : t ∈ base ∨ t = base) + (before : s ∈ t) : + (state.prefixFields data births heights prior).space s = prior.space s ∧ (state.prefixFields data births heights prior).order s = prior.order s ∧ + (state.prefixFields data births heights prior).meetGraph s = prior.meetGraph s := by + dsimp only [prefixFields] + exact ⟨compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, + compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, + compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before⟩ + +variable (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) +include ordinal hBase + +noncomputable def prefix_old_layer {cutoff t : ZFSet.{u}} + (oldCutoff : cutoff ∈ base ∨ cutoff = base) (bound : t = cutoff ∨ t ∈ cutoff) : + CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph + ((state.prefixFields data births heights prior).space cutoff) ((state.prefixFields data births heights prior).order cutoff) ((state.prefixFields data births heights prior).meetGraph cutoff) ((state.prefixFields data births heights prior).birth cutoff) t := by + have hc : cutoff ∈ T0 := oldCutoff.elim + (fun member => ordinal.1 base hBase cutoff member) (fun equal => equal.symm ▸ hBase) + have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) + (fun before => ordinal.1 cutoff hc t before) + have oldTime : t ∈ base ∨ t = base := by + rcases bound with equal | before + · exact equal.symm ▸ oldCutoff + · apply Or.inl + rcases oldCutoff with member | equal + · exact ordinal.2 base hBase cutoff member t before + · exact equal ▸ before + have layer := (prior.layer cutoff hc t ht bound).congr_sources_below + (fun s hs => (state.prefix_sources_eq_below data births heights prior oldTime hs).1.symm) + (fun s hs => (state.prefix_sources_eq_below data births heights prior oldTime hs).2.1.symm) + (fun s hs => (state.prefix_sources_eq_below data births heights prior oldTime hs).2.2.symm) + have values := state.prefixFields_old data births heights prior oldCutoff + simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer + +variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) +variable (initialMeet : state.data.μD = μ0) +variable (priorSpace : prior.space base = P0) (priorOrder : prior.order base = r0) +variable (priorMeet : prior.meetGraph base = μ0) (priorBirth : prior.birth base = old) +include initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth + +noncomputable def prefix_base_layers (t : ZFSet.{u}) (before : t ∈ base ∨ t = base) : + CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph + state.data.D state.data.rD state.data.μD old t := by + have layer := state.prefix_old_layer data births heights prior ordinal hBase + (Or.inr rfl : base ∈ base ∨ base = base) before.symm + have values := state.prefixFields_old data births heights prior (Or.inr rfl : base ∈ base ∨ base = base) + simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1, + priorSpace, priorOrder, priorMeet, priorBirth, initialDomain, initialOrder, initialMeet] using layer + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) +include pairing unions powers separation hI hSources hReps hG hT constant + +noncomputable def prefix_finite_layers (n : Nat) (t : ZFSet.{u}) + (bound : t = compressionStamp base n ∨ t ∈ compressionStamp base n) : + CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph + ((state.prefixFields data births heights prior).space (compressionStamp base n)) ((state.prefixFields data births heights prior).order (compressionStamp base n)) + ((state.prefixFields data births heights prior).meetGraph (compressionStamp base n)) ((state.prefixFields data births heights prior).birth (compressionStamp base n)) t := by + have atBase := state.prefixFields_old data births heights prior (Or.inr rfl : base ∈ base ∨ base = base) + have layer := state.ground_birth_finite_all_layers pairing unions powers separation + hI hSources hReps hG hT data births constant + (atBase.1.trans priorSpace) (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) + (state.prefix_base_layers data births heights prior ordinal hBase initialDomain initialOrder + initialMeet priorSpace priorOrder priorMeet priorBirth) n t bound.symm + have values := state.prefixFields_stamp data births heights prior n + simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer + +noncomputable def prefix_union_layers (t : ZFSet.{u}) + (bound : t = births.limit ∨ t ∈ births.limit) : + CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph + ((state.prefixFields data births heights prior).space births.limit) ((state.prefixFields data births heights prior).order births.limit) + ((state.prefixFields data births heights prior).meetGraph births.limit) ((state.prefixFields data births heights prior).birth births.limit) t := by + have atBase := state.prefixFields_old data births heights prior (Or.inr rfl : base ∈ base ∨ base = base) + have layer := state.ground_birth_all_layers data births pairing unions powers separation + hI hSources hReps hG hT constant + (atBase.1.trans priorSpace) (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) + (state.prefix_base_layers data births heights prior ordinal hBase initialDomain initialOrder + initialMeet priorSpace priorOrder priorMeet priorBirth) t bound.symm + have values := state.prefixFields_limit data births heights prior + simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer + +noncomputable def prefix_all_layers : + ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, + t = cutoff ∨ t ∈ cutoff → CodedGrowthLayer M (state.prefixFields data births heights prior).space (state.prefixFields data births heights prior).order (state.prefixFields data births heights prior).meetGraph + ((state.prefixFields data births heights prior).space cutoff) ((state.prefixFields data births heights prior).order cutoff) ((state.prefixFields data births heights prior).meetGraph cutoff) ((state.prefixFields data births heights prior).birth cutoff) t := by + intro cutoff hc t _ bound + apply Classical.choice + rcases ZFSet.mem_insert_iff.1 hc with equal | before + · subst cutoff + exact ⟨state.prefix_union_layers data births heights prior ordinal hBase initialDomain initialOrder + initialMeet priorSpace priorOrder priorMeet priorBirth pairing unions powers separation + hI hSources hReps hG hT constant t bound⟩ + · rcases (births.times.mem_limit_iff cutoff).1 before with oldTime | same | ⟨n, rfl⟩ + · exact ⟨state.prefix_old_layer data births heights prior ordinal hBase (Or.inl oldTime) bound⟩ + · exact ⟨state.prefix_old_layer data births heights prior ordinal hBase (Or.inr same) bound⟩ + · exact ⟨state.prefix_finite_layers data births heights prior ordinal hBase initialDomain initialOrder + initialMeet priorSpace priorOrder priorMeet priorBirth pairing unions powers separation + hI hSources hReps hG hT constant n t bound⟩ + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundChronologicalHistory M T0 C Q qlt) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) +variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) +variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) +variable (initialMeet : state.data.μD = μ0) +variable (priorSpace : prior.space base = P0) (priorOrder : prior.order base = r0) +variable (priorMeet : prior.meetGraph base = μ0) (priorBirth : prior.birth base = old) + +noncomputable def prefixHistory : + GroundChronologicalHistory M (insert births.limit births.limit) C Q qlt where + space := (state.prefixFields data births heights prior).space + order := (state.prefixFields data births heights prior).order + meetGraph := (state.prefixFields data births heights prior).meetGraph + birth := (state.prefixFields data births heights prior).birth + height := (state.prefixFields data births heights prior).height + space_mem := fun _ hs => (state.prefixFields_ground data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).1 + order_mem := fun _ hs => (state.prefixFields_ground data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.1 + meet_mem := fun _ hs => (state.prefixFields_ground data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.1 + birth_mem := fun _ hs => (state.prefixFields_ground data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.1 + height_mem := fun _ hs => (state.prefixFields_ground data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.2 + meet_order := fun _ hs => (state.prefixFields_stage_laws data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).1 + birth_function := fun _ hs => (state.prefixFields_stage_laws data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.1 + birth_bound := fun _ hs => (state.prefixFields_stage_laws data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.1 + old_meet := fun _ hs => (state.prefixFields_stage_laws data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.1 + strict_height := fun _ hs => (state.prefixFields_stage_laws data births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal hBase hs).2.2.2.2 + layer := state.prefix_all_layers data births heights prior ordinal hBase initialDomain initialOrder + initialMeet priorSpace priorOrder priorMeet priorBirth pairing unions powers separation + hI hSources hReps hG hT constant + +local notation "history" => state.prefixHistory data births heights prior pairing unions powers separation + hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet + priorSpace priorOrder priorMeet priorBirth + +theorem prefixHistory_old {s : ZFSet.{u}} (before : s ∈ base ∨ s = base) : + (history).space s = prior.space s ∧ (history).order s = prior.order s ∧ + (history).meetGraph s = prior.meetGraph s ∧ (history).birth s = prior.birth s ∧ + (history).height s = prior.height s := + state.prefixFields_old data births heights prior before + +theorem prefixHistory_stamp (n : Nat) : + (history).space (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ + (history).order (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ + (history).meetGraph (compressionStamp base n) = (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ + (history).birth (compressionStamp base n) = + graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth ∧ + (history).height (compressionStamp base n) = heights.function.natValue (n + 1) := + state.prefixFields_stamp data births heights prior n + +theorem prefixHistory_limit : + (history).space births.limit = data.fields 0 ∧ (history).order births.limit = data.fields 1 ∧ + (history).meetGraph births.limit = data.fields 2 ∧ (history).birth births.limit = births.birth ∧ + (history).height births.limit = heights.height := + state.prefixFields_limit data births heights prior + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M N : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T + data P0 C Q qlt original) +variable (prior : GroundChronologicalHistory M T0 C Q qlt) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) +variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) +variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) +variable (initialMeet : state.data.μD = μ0) +variable (priorSpace : prior.space base = P0) (priorOrder : prior.order base = r0) +variable (priorMeet : prior.meetGraph base = μ0) (priorBirth : prior.birth base = old) + +include state data births heights prior pairing unions powers separation + hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet + priorSpace priorOrder priorMeet priorBirth + +theorem prefix_exists_extension_basis + (includes : M.sets ⊆ N.sets) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets SetFormula.infinity Fin.elim0) + (choiceN : Realize N.sets SetFormula.choice Fin.elim0) + (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) + (smallQ : M.groundEmbeddable Q ZFSet.omega) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + {F : ZFSet.{u}} (hF : F ∈ N.sets) + (filter : MeetFilterCode (data.fields 0) (data.fields 1) (data.fields 2) F) : + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ data.fields 1 := by + let history := state.prefixHistory data births heights prior pairing unions powers separation + hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet + priorSpace priorOrder priorMeet priorBirth + have atLimit := state.prefixHistory_limit data births heights prior pairing unions powers separation + hI hSources hReps hG hT ordinal hBase constant initialDomain initialOrder initialMeet + priorSpace priorOrder priorMeet priorBirth + change history.space births.limit = data.fields 0 ∧ history.order births.limit = data.fields 1 ∧ + history.meetGraph births.limit = data.fields 2 ∧ history.birth births.limit = births.birth ∧ + history.height births.limit = heights.height at atLimit + have filterAtLimit : MeetFilterCode (history.space births.limit) (history.order births.limit) + (history.meetGraph births.limit) F := by + simpa only [atLimit.1, atLimit.2.1, atLimit.2.2.1] using filter + have basis := history.exists_extension_basis includes pairingN unionsN powersN separationN + infiniteN choiceN (M.insert_mem pairing unions births.limit_ground births.limit_ground) + hC hQ (ordinalSetProperty_succ births.times.ordinal) smallQ irreflexive + (ZFSet.mem_insert births.limit births.limit) hF filterAtLimit + simpa only [atLimit.2.1] using basis + +end PartitionPilot.Forcing.GroundCompressionState + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CountableCoding.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CountableCoding.lean index ba022221862f61be92cdad61caabfed60e0c4013..9f809c77b94fc706fd2d7e4359b7a818dcb58cc5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CountableCoding.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CountableCoding.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.NodeCoding - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u - -def natPair (a b : Nat) : Nat := (a + b) * (a + b) + a - -theorem natPair_upper (a b : Nat) : natPair a b < (a + b + 1) * (a + b + 1) := by - unfold natPair - rw [Nat.succ_mul_succ] - omega - -theorem natPair_sum_lt {a b c d : Nat} (less : a + b < c + d) : natPair a b < natPair c d := by - have step : a + b + 1 ≤ c + d := by omega - have sq := Nat.mul_le_mul step step - have bound := natPair_upper a b - unfold natPair at * - omega - -theorem natPair_injective {a b c d : Nat} (eq : natPair a b = natPair c d) : a = c ∧ b = d := by - have sums : a + b = c + d := by - have h₁ : ¬ a + b < c + d := fun h => Nat.ne_of_lt (natPair_sum_lt h) eq - have h₂ : ¬ c + d < a + b := fun h => Nat.ne_of_lt (natPair_sum_lt h) eq.symm - omega - unfold natPair at eq - rw [sums] at eq - omega - -def listCode {A : Type u} (encode : A → Nat) : List A → Nat - | [] => 0 - | a :: xs => natPair (encode a) (listCode encode xs) + 1 - -theorem listCode_injective {A : Type u} (encode : A → Nat) - (injective : ∀ a b, encode a = encode b → a = b) - (xs ys : List A) (eq : listCode encode xs = listCode encode ys) : xs = ys := by - induction xs generalizing ys with - | nil => - cases ys with - | nil => rfl - | cons y ys => exact False.elim (Nat.zero_ne_add_one _ eq) - | cons x xs ih => - cases ys with - | nil => exact False.elim (Nat.zero_ne_add_one _ eq.symm) - | cons y ys => - have parts := natPair_injective (Nat.add_right_cancel eq) - have head := injective x y parts.1 - have tail := ih ys parts.2 - cases head - cases tail - rfl - -namespace TaskSystem - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -theorem union_countable (encodeA : A → Nat) - (injectiveA : ∀ a b, encodeA a = encodeA b → a = b) - (encodeTask : Task → Nat) - (injectiveTask : ∀ i j, encodeTask i = encodeTask j → i = j) : - ∃ encode : f.Union → Nat, ∀ x y, encode x = encode y → x = y := by - apply f.union_size_transfer (fun p => natPair (listCode encodeTask p.1) (encodeA p.2)) - intro x y eq - have parts := natPair_injective eq - exact Prod.ext (listCode_injective encodeTask injectiveTask _ _ parts.1) - (injectiveA _ _ parts.2) - -end TaskSystem -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.NodeCoding + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u + +def natPair (a b : Nat) : Nat := (a + b) * (a + b) + a + +theorem natPair_upper (a b : Nat) : natPair a b < (a + b + 1) * (a + b + 1) := by + unfold natPair + rw [Nat.succ_mul_succ] + omega + +theorem natPair_sum_lt {a b c d : Nat} (less : a + b < c + d) : natPair a b < natPair c d := by + have step : a + b + 1 ≤ c + d := by omega + have sq := Nat.mul_le_mul step step + have bound := natPair_upper a b + unfold natPair at * + omega + +theorem natPair_injective {a b c d : Nat} (eq : natPair a b = natPair c d) : a = c ∧ b = d := by + have sums : a + b = c + d := by + have h₁ : ¬ a + b < c + d := fun h => Nat.ne_of_lt (natPair_sum_lt h) eq + have h₂ : ¬ c + d < a + b := fun h => Nat.ne_of_lt (natPair_sum_lt h) eq.symm + omega + unfold natPair at eq + rw [sums] at eq + omega + +def listCode {A : Type u} (encode : A → Nat) : List A → Nat + | [] => 0 + | a :: xs => natPair (encode a) (listCode encode xs) + 1 + +theorem listCode_injective {A : Type u} (encode : A → Nat) + (injective : ∀ a b, encode a = encode b → a = b) + (xs ys : List A) (eq : listCode encode xs = listCode encode ys) : xs = ys := by + induction xs generalizing ys with + | nil => + cases ys with + | nil => rfl + | cons y ys => exact False.elim (Nat.zero_ne_add_one _ eq) + | cons x xs ih => + cases ys with + | nil => exact False.elim (Nat.zero_ne_add_one _ eq.symm) + | cons y ys => + have parts := natPair_injective (Nat.add_right_cancel eq) + have head := injective x y parts.1 + have tail := ih ys parts.2 + cases head + cases tail + rfl + +namespace TaskSystem + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +theorem union_countable (encodeA : A → Nat) + (injectiveA : ∀ a b, encodeA a = encodeA b → a = b) + (encodeTask : Task → Nat) + (injectiveTask : ∀ i j, encodeTask i = encodeTask j → i = j) : + ∃ encode : f.Union → Nat, ∀ x y, encode x = encode y → x = y := by + apply f.union_size_transfer (fun p => natPair (listCode encodeTask p.1) (encodeA p.2)) + intro x y eq + have parts := natPair_injective eq + exact Prod.ext (listCode_injective encodeTask injectiveTask _ _ parts.1) + (injectiveA _ _ parts.2) + +end TaskSystem +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CrossStageParameterSupports.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CrossStageParameterSupports.lean index a828ed816fc989c3453ef7ab3c874b821c21da71..54a79db5aa5ae936712494f731874b9530e699bc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CrossStageParameterSupports.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/CrossStageParameterSupports.lean @@ -1,43 +1,43 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.CrossStageMembershipNameActions -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization - -namespace OAI - -section - -namespace PartitionPilot.Forcing.Name -open SetRealization SetFormula -universe u v -variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] [OrderTop Q] -variable {G : Type v} [Group G] - -theorem crossStageParameter_support - (upper : PosetAction G P) (lower : PosetAction G Q) - (s : Presentation P) (t : Presentation Q) (inclusion : Q → P) - (equivariant : ∀ g p, inclusion (lower.iso g p) = upper.iso g (inclusion p)) - {n : Nat} (J : Fin n → ZFSet.{u}) - (valid : ∀ i z, z ∈ J i → IsName t z) - (closed : ∀ i g (sigma : Name t), sigma.val ∈ J i → (lower.act t g sigma).val ∈ J i) - (tau : Fin n → Name s) (D : NameDomain t) (env : Assignment D (n + 1)) - (names : ∀ i, (env i.castSucc).val = crossStageMembershipName s t inclusion (J i) (valid i) (tau i)) - (T : ZFSet.{u}) (validT : ∀ z ∈ T, IsName t z) - (closedT : ∀ g (sigma : Name t), sigma.val ∈ T → (lower.act t g sigma).val ∈ T) - (family : (env (Fin.last n)).val = familySet ⊤ T validT) - (K : Subgroup G) (supported : ∀ i, K ≤ upper.stabilizer s (tau i)) : - ∀ j, K ≤ lower.stabilizer t (env j).val := by - intro j - refine Fin.lastCases ?_ (fun i => ?_) j - · intro g _ - change lower.act t g (env (Fin.last n)).val = (env (Fin.last n)).val - rw [family] - exact act_familySet lower T validT closedT g - · rw [names i] - exact (supported i).trans - (crossStageMembershipName_stabilizer upper lower s t inclusion (J i) (valid i) - equivariant (closed i) (tau i)) - -end PartitionPilot.Forcing.Name - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.CrossStageMembershipNameActions +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNiceNameNormalization + +namespace OAI + +section + +namespace PartitionPilot.Forcing.Name +open SetRealization SetFormula +universe u v +variable {P Q : Type u} [PartialOrder P] [PartialOrder Q] [OrderTop Q] +variable {G : Type v} [Group G] + +theorem crossStageParameter_support + (upper : PosetAction G P) (lower : PosetAction G Q) + (s : Presentation P) (t : Presentation Q) (inclusion : Q → P) + (equivariant : ∀ g p, inclusion (lower.iso g p) = upper.iso g (inclusion p)) + {n : Nat} (J : Fin n → ZFSet.{u}) + (valid : ∀ i z, z ∈ J i → IsName t z) + (closed : ∀ i g (sigma : Name t), sigma.val ∈ J i → (lower.act t g sigma).val ∈ J i) + (tau : Fin n → Name s) (D : NameDomain t) (env : Assignment D (n + 1)) + (names : ∀ i, (env i.castSucc).val = crossStageMembershipName s t inclusion (J i) (valid i) (tau i)) + (T : ZFSet.{u}) (validT : ∀ z ∈ T, IsName t z) + (closedT : ∀ g (sigma : Name t), sigma.val ∈ T → (lower.act t g sigma).val ∈ T) + (family : (env (Fin.last n)).val = familySet ⊤ T validT) + (K : Subgroup G) (supported : ∀ i, K ≤ upper.stabilizer s (tau i)) : + ∀ j, K ≤ lower.stabilizer t (env j).val := by + intro j + refine Fin.lastCases ?_ (fun i => ?_) j + · intro g _ + change lower.act t g (env (Fin.last n)).val = (env (Fin.last n)).val + rw [family] + exact act_familySet lower T validT closedT g + · rw [names i] + exact (supported i).trans + (crossStageMembershipName_stabilizer upper lower s t inclusion (J i) (valid i) + equivariant (closed i) (tau i)) + +end PartitionPilot.Forcing.Name + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalBirthLayerSeparation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalBirthLayerSeparation.lean index c82406449b5ab879149fb541861eca712585ef1e..76af83c4efd8bdc7380df06df847a5016ab8ceea 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalBirthLayerSeparation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalBirthLayerSeparation.lean @@ -1,277 +1,277 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerRestrictions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalSlotCopies -import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace GroundExternalBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "V" => M.externalStarVertices G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) - (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one -local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 - -noncomputable def layerFiber (k : Nat) : ZFSet.{u} := layerBirthFiber B births.birth (compressionStamp oldTimes k) -noncomputable def layerOwners (k : Nat) : ZFSet.{u} := relationImage (births.layerFiber k) V owner -noncomputable def layerComponents (k : Nat) : ZFSet.{u} := graphRestriction (births.layerFiber k) owner -noncomputable def layerIndices (k : Nat) : ZFSet.{u} := constantFamilyGraph (births.layerOwners k) oldTimes -noncomputable def layerMaps (k : Nat) : ZFSet.{u} := - completion.externalSlotCopyMaps P0 r0 μ0 A0 (births.layerOwners k) (natSetCode (k % 3)) -noncomputable def layerWitness (k : Nat) : ZFSet.{u} := - separatedLayerWitness (births.layerOwners k) (births.layerIndices k) (births.layerMaps k) - (M.groundRelations U B) (births.layerComponents k) (births.layerFiber k) - -theorem mem_layerFiber (k : Nat) (x : ZFSet.{u}) : - x ∈ births.layerFiber k ↔ x ∈ B ∧ ZFSet.pair x (compressionStamp oldTimes k) ∈ births.birth := - mem_layerBirthFiber _ _ _ _ - -theorem layerFiber_level {k : Nat} {x : ZFSet.{u}} (hx : x ∈ births.layerFiber k) : - ZFSet.pair x (natSetCode k) ∈ completion.externalOwnerLevels P0 r0 μ0 A0 := - ((births.stamp_fiber k x).1 ((births.mem_layerFiber k x).1 hx).2).2 - -theorem layerOwners_cases {k : Nat} {v : ZFSet.{u}} (hv : v ∈ births.layerOwners k) : - v ∈ V ∧ ∃ x ∈ births.layerFiber k, ZFSet.pair x v ∈ owner := - (mem_relationImage _ _ _ _).1 hv - -variable {inv : ZFSet.{u}} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -include data group oldAction pairing unions powers separation infinite hG hP0 - -theorem layer_fields_ground (k : Nat) : - births.layerFiber k ∈ M.sets ∧ births.layerOwners k ∈ M.sets ∧ - births.layerComponents k ∈ M.sets ∧ births.layerIndices k ∈ M.sets ∧ - births.layerMaps k ∈ M.sets ∧ M.groundRelations U B ∈ M.sets := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have owners := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 - have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 - have fiber := M.layerBirthFiber_mem separation geometry.carrier_ground births.birth_ground - (M.transitive births.limit_ground (births.times.stamp_mem_limit k)) - have active := M.relationImage_mem separation fiber vertices owners.1 - have components := M.graphRestriction_mem unions separation fiber owners.1 - have indices := M.constantFamilyGraph_mem pairing unions powers separation active - (M.transitive births.limit_ground births.times.base_mem_limit) - have maps := data.externalSlotCopyMaps_spec group oldAction pairing unions powers separation infinite hG hP0 - active (M.natSetCode_mem separation infinite (k % 3)) - exact ⟨fiber, active, components, indices, maps.1, - M.groundRelations_mem pairing unions powers separation (completion.algebra.union.ground 0) geometry.carrier_ground⟩ - -theorem layerComponents_function (k : Nat) : - ZFSet.IsFunc (births.layerFiber k) (births.layerOwners k) (births.layerComponents k) := by - have ownerCode := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have restricted := (show FunctionGraphOn B owner from ⟨V, ownerCode⟩).restrict - (fun x hx => (births.mem_layerFiber k x).1 hx |>.1) - apply isFunc_retarget_of_entries restricted.to_isFunc - intro x v entry - obtain ⟨owned, hx⟩ := pair_mem_graphRestriction.1 entry - exact (mem_relationImage _ _ _ _).2 - ⟨(ZFSet.pair_mem_prod.1 (ownerCode.1 owned)).2, x, hx, owned⟩ - -omit data group oldAction pairing unions powers separation infinite hG hP0 in -theorem layerIndices_function (k : Nat) : - ZFSet.IsFunc (births.layerOwners k) (compressionStamp oldTimes k) (births.layerIndices k) := by - apply isFunc_retarget_of_entries (constantFamilyGraph_function (births.layerOwners k) oldTimes) - intro v t entry - rw [((pair_mem_constantFamilyGraph _ _ _ _).1 entry).2] - exact compressionStamp_base_mem oldTimes k - -theorem layerMaps_spec (k : Nat) : - ZFSet.IsFunc (births.layerOwners k) (M.groundRelations U B) (births.layerMaps k) ∧ - ∀ v e, ZFSet.pair v e ∈ births.layerMaps k ↔ v ∈ births.layerOwners k ∧ - e = indexedRelationSection U B (completion.externalSlotCopyRelation P0 r0 μ0 A0 (natSetCode (k % 3))) v := by - exact (data.externalSlotCopyMaps_spec group oldAction pairing unions powers separation infinite hG hP0 - (births.layer_fields_ground data group oldAction pairing unions powers separation infinite hG hP0 k).2.1 - (M.natSetCode_mem separation infinite (k % 3))).2 - -theorem layerWitness_ground (k : Nat) : births.layerWitness k ∈ M.sets := by - have ground := births.layer_fields_ground data group oldAction pairing unions powers separation infinite hG hP0 k - exact M.separatedLayerWitness_mem pairing unions ground.2.1 ground.2.2.2.1 - ground.2.2.2.2.1 ground.2.2.2.2.2 ground.2.2.1 ground.1 - -end GroundExternalBirthData -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -include births data group oldAction pairing unions powers separation infinite hG hP0 - -theorem layerMaps_copy (k : Nat) {x v e : ZFSet.{u}} - (hx : x ∈ births.layerFiber k) (owned : ZFSet.pair x v ∈ owner) - (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) : - letI := group.toGroup - ∃ w r, v = (vpres).encode (.inr (w, r)) ∧ - e = completion.externalCopyGraph P0 r0 μ0 A0 - ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r))) ∧ - x ∈ relationImage U B e := by - let := group.toGroup - have level := births.layerFiber_level hx - obtain ⟨w, r, actualOwner, covered⟩ := data.externalBirthCopy_witness group oldAction - pairing unions powers separation infinite hG hP0 k level - have ownerCode : FunctionGraphOn B owner := - ⟨_, (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ - have same := ownerCode.unique owned actualOwner - obtain ⟨n, _, rank⟩ := data.externalBirthCopy_level_slot group oldAction - pairing unions powers separation infinite hG hP0 w r k actualOwner level - let i := data.externalBirthCopyVertex group oldAction k r - have slot : ((family).request r).vertexSlot i = k % 3 := by - rw [rank, depthSlotIndex, Nat.add_mod] - simp only [i, Nat.mul_mod, Nat.mod_self, Nat.zero_mul, Nat.zero_mod, Nat.zero_add, - Nat.mod_eq_of_lt (((family).request r).vertexSlot_lt_three (data.externalBirthCopyVertex group oldAction k r))] - have literal : completion.externalFamilyVertexCode group oldAction data.original r i = natSetCode (k % 3) := - (completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i).trans - (congrArg natSetCode slot) - have mapEq := ((births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).2 v e).1 mapEntry |>.2 - have sectionEq := data.externalSlotCopySection_eq group oldAction pairing unions powers separation infinite hG w r i - rw [literal, ← same] at sectionEq - have actual := mapEq.trans sectionEq - exact ⟨w, r, same, actual, actual.symm ▸ covered⟩ - -theorem layerMaps_embedding (k : Nat) {v e : ZFSet.{u}} - (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) : - MeetEmbeddingCode U B (completion.algebra.union.fields 1) (completion.externalPointOrder P0 r0 μ0 A0) - (completion.algebra.union.fields 2) (completion.externalPointMeet P0 r0 μ0 A0) e := by - let := group.toGroup - have active := ((births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).2 v e).1 mapEntry |>.1 - obtain ⟨_, x, hx, owned⟩ := births.layerOwners_cases active - obtain ⟨w, r, _, rfl, _⟩ := births.layerMaps_copy data group oldAction pairing unions powers separation infinite hG hP0 k hx owned mapEntry - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - exact geometry.copies _ (sc ▸ (s).encode_mem _) - -theorem layerMaps_outputs_cutoff (k n : Nat) (before : k ≤ n) {v e u y : ZFSet.{u}} - (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) (copied : ZFSet.pair u y ∈ e) : - y ∈ births.cutoff n := by - let := group.toGroup - have active := ((births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).2 v e).1 mapEntry |>.1 - obtain ⟨_, x, hx, owned⟩ := births.layerOwners_cases active - obtain ⟨w, r, same, actual, _⟩ := births.layerMaps_copy data group oldAction pairing unions powers separation infinite hG hP0 k hx owned mapEntry - rcases data.externalBirthCopy_level_bound group oldAction pairing unions powers separation infinite hG hP0 - w r k (same ▸ owned) (births.layerFiber_level hx) (actual ▸ copied) with old | ⟨l, bound, level⟩ - · exact births.cutoff_old n old - · have levelCode := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have fresh := (mem_ownerFresh P B y).1 (ZFSet.pair_mem_prod.1 (levelCode.1 level)).1 - apply (mem_ownerLevelPrefix _ _ _ _ _).2 - refine Or.inr ⟨fresh.1, fresh.2, natSetCode l, natSetCode_mem_omega l, level, ?_⟩ - rcases Nat.lt_or_eq_of_le (Nat.le_trans bound before) with less | same - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - -theorem layerMaps_cutoff_embedding (k n : Nat) (before : k ≤ n) {v e : ZFSet.{u}} - (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) : - MeetEmbeddingCode U (births.cutoff n) (completion.algebra.union.fields 1) (births.cutoffOrder n) - (completion.algebra.union.fields 2) (births.cutoffMeet n) e := - (births.layerMaps_embedding data group oldAction pairing unions powers separation infinite hG hP0 k mapEntry).restrictTarget - (fun _ _ copied => births.layerMaps_outputs_cutoff data group oldAction pairing unions powers separation infinite hG hP0 k n before mapEntry copied) - -end PartitionPilot.Forcing.GroundExternalBirthData - - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -include births data group oldAction pairing unions powers separation infinite hG hP0 - -omit data group oldAction pairing unions powers separation infinite hG hP0 in -theorem layerFiber_cutoff (k n : Nat) (before : k ≤ n) : - births.layerFiber k = layerBirthFiber (births.cutoff n) (births.cutoffBirth n) (compressionStamp oldTimes k) := by - apply ZFSet.ext - intro x - rw [births.mem_layerFiber, mem_layerBirthFiber] - constructor - · rintro ⟨hx, entry⟩ - have fresh := (births.stamp_fiber k x).1 entry - have hxCut : x ∈ births.cutoff n := by - apply (mem_ownerLevelPrefix _ _ _ _ _).2 - refine Or.inr ⟨hx, ((mem_ownerFresh P B x).1 fresh.1).2, - natSetCode k, natSetCode_mem_omega k, fresh.2, ?_⟩ - rcases Nat.lt_or_eq_of_le before with less | same - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - exact ⟨hxCut, pair_mem_graphRestriction.2 ⟨entry, hxCut⟩⟩ - · rintro ⟨hx, entry⟩ - exact ⟨births.cutoff_subset n hx, (pair_mem_graphRestriction.1 entry).1⟩ - -theorem layerComponents_earlier_meet (k : Nat) {x y v w : ZFSet.{u}} - (hx : x ∈ births.layerFiber k) (hy : y ∈ births.layerFiber k) - (first : ZFSet.pair x v ∈ births.layerComponents k) - (second : ZFSet.pair y w ∈ births.layerComponents k) (different : v ≠ w) : - ∃ z a, ZFSet.pair (ZFSet.pair x y) z ∈ completion.externalPointMeet P0 r0 μ0 A0 ∧ - ZFSet.pair z a ∈ births.birth ∧ a ∈ compressionStamp oldTimes k := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have bounds := ZFSet.pair_mem_prod.2 - ⟨((births.mem_layerFiber k x).1 hx).1, ((births.mem_layerFiber k y).1 hy).1⟩ - obtain ⟨z, meetEntry, _⟩ := geometry.meet.operation.2 (ZFSet.pair x y) bounds - have hz := (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2 - obtain ⟨a, born, _⟩ := births.function.2 z hz - have earlier := data.externalOwnerLevels_meet_old_or_lower group oldAction pairing unions powers separation infinite hG hP0 - (pair_mem_graphRestriction.1 first).1 (pair_mem_graphRestriction.1 second).1 different - (births.layerFiber_level hx) (births.layerFiber_level hy) meetEntry - refine ⟨z, a, meetEntry, born, ?_⟩ - apply ownerBirthGraph_earlier_of_level births.seed_function - (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - births.times.ownerStampCode ?_ ((births.times.entries k _).2 rfl) born earlier - intro u b j t entry stamp - rw [(births.times.entries j t).1 stamp] - exact births.old_before entry j - -end PartitionPilot.Forcing.GroundExternalBirthData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedLayerRestrictions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalSlotCopies +import OAI.SetTheory.PartitionPrinciple.Transfinite.ExternalChronologyStageLaws + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace GroundExternalBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "V" => M.externalStarVertices G (externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0)) + (externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0)) m one +local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 + +noncomputable def layerFiber (k : Nat) : ZFSet.{u} := layerBirthFiber B births.birth (compressionStamp oldTimes k) +noncomputable def layerOwners (k : Nat) : ZFSet.{u} := relationImage (births.layerFiber k) V owner +noncomputable def layerComponents (k : Nat) : ZFSet.{u} := graphRestriction (births.layerFiber k) owner +noncomputable def layerIndices (k : Nat) : ZFSet.{u} := constantFamilyGraph (births.layerOwners k) oldTimes +noncomputable def layerMaps (k : Nat) : ZFSet.{u} := + completion.externalSlotCopyMaps P0 r0 μ0 A0 (births.layerOwners k) (natSetCode (k % 3)) +noncomputable def layerWitness (k : Nat) : ZFSet.{u} := + separatedLayerWitness (births.layerOwners k) (births.layerIndices k) (births.layerMaps k) + (M.groundRelations U B) (births.layerComponents k) (births.layerFiber k) + +theorem mem_layerFiber (k : Nat) (x : ZFSet.{u}) : + x ∈ births.layerFiber k ↔ x ∈ B ∧ ZFSet.pair x (compressionStamp oldTimes k) ∈ births.birth := + mem_layerBirthFiber _ _ _ _ + +theorem layerFiber_level {k : Nat} {x : ZFSet.{u}} (hx : x ∈ births.layerFiber k) : + ZFSet.pair x (natSetCode k) ∈ completion.externalOwnerLevels P0 r0 μ0 A0 := + ((births.stamp_fiber k x).1 ((births.mem_layerFiber k x).1 hx).2).2 + +theorem layerOwners_cases {k : Nat} {v : ZFSet.{u}} (hv : v ∈ births.layerOwners k) : + v ∈ V ∧ ∃ x ∈ births.layerFiber k, ZFSet.pair x v ∈ owner := + (mem_relationImage _ _ _ _).1 hv + +variable {inv : ZFSet.{u}} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +include data group oldAction pairing unions powers separation infinite hG hP0 + +theorem layer_fields_ground (k : Nat) : + births.layerFiber k ∈ M.sets ∧ births.layerOwners k ∈ M.sets ∧ + births.layerComponents k ∈ M.sets ∧ births.layerIndices k ∈ M.sets ∧ + births.layerMaps k ∈ M.sets ∧ M.groundRelations U B ∈ M.sets := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have owners := data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0 + have vertices := (data.externalStarCarriers_ground pairing unions powers separation hG).1 + have fiber := M.layerBirthFiber_mem separation geometry.carrier_ground births.birth_ground + (M.transitive births.limit_ground (births.times.stamp_mem_limit k)) + have active := M.relationImage_mem separation fiber vertices owners.1 + have components := M.graphRestriction_mem unions separation fiber owners.1 + have indices := M.constantFamilyGraph_mem pairing unions powers separation active + (M.transitive births.limit_ground births.times.base_mem_limit) + have maps := data.externalSlotCopyMaps_spec group oldAction pairing unions powers separation infinite hG hP0 + active (M.natSetCode_mem separation infinite (k % 3)) + exact ⟨fiber, active, components, indices, maps.1, + M.groundRelations_mem pairing unions powers separation (completion.algebra.union.ground 0) geometry.carrier_ground⟩ + +theorem layerComponents_function (k : Nat) : + ZFSet.IsFunc (births.layerFiber k) (births.layerOwners k) (births.layerComponents k) := by + have ownerCode := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have restricted := (show FunctionGraphOn B owner from ⟨V, ownerCode⟩).restrict + (fun x hx => (births.mem_layerFiber k x).1 hx |>.1) + apply isFunc_retarget_of_entries restricted.to_isFunc + intro x v entry + obtain ⟨owned, hx⟩ := pair_mem_graphRestriction.1 entry + exact (mem_relationImage _ _ _ _).2 + ⟨(ZFSet.pair_mem_prod.1 (ownerCode.1 owned)).2, x, hx, owned⟩ + +omit data group oldAction pairing unions powers separation infinite hG hP0 in +theorem layerIndices_function (k : Nat) : + ZFSet.IsFunc (births.layerOwners k) (compressionStamp oldTimes k) (births.layerIndices k) := by + apply isFunc_retarget_of_entries (constantFamilyGraph_function (births.layerOwners k) oldTimes) + intro v t entry + rw [((pair_mem_constantFamilyGraph _ _ _ _).1 entry).2] + exact compressionStamp_base_mem oldTimes k + +theorem layerMaps_spec (k : Nat) : + ZFSet.IsFunc (births.layerOwners k) (M.groundRelations U B) (births.layerMaps k) ∧ + ∀ v e, ZFSet.pair v e ∈ births.layerMaps k ↔ v ∈ births.layerOwners k ∧ + e = indexedRelationSection U B (completion.externalSlotCopyRelation P0 r0 μ0 A0 (natSetCode (k % 3))) v := by + exact (data.externalSlotCopyMaps_spec group oldAction pairing unions powers separation infinite hG hP0 + (births.layer_fields_ground data group oldAction pairing unions powers separation infinite hG hP0 k).2.1 + (M.natSetCode_mem separation infinite (k % 3))).2 + +theorem layerWitness_ground (k : Nat) : births.layerWitness k ∈ M.sets := by + have ground := births.layer_fields_ground data group oldAction pairing unions powers separation infinite hG hP0 k + exact M.separatedLayerWitness_mem pairing unions ground.2.1 ground.2.2.2.1 + ground.2.2.2.2.1 ground.2.2.2.2.2 ground.2.2.1 ground.1 + +end GroundExternalBirthData +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +include births data group oldAction pairing unions powers separation infinite hG hP0 + +theorem layerMaps_copy (k : Nat) {x v e : ZFSet.{u}} + (hx : x ∈ births.layerFiber k) (owned : ZFSet.pair x v ∈ owner) + (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) : + letI := group.toGroup + ∃ w r, v = (vpres).encode (.inr (w, r)) ∧ + e = completion.externalCopyGraph P0 r0 μ0 A0 + ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r))) ∧ + x ∈ relationImage U B e := by + let := group.toGroup + have level := births.layerFiber_level hx + obtain ⟨w, r, actualOwner, covered⟩ := data.externalBirthCopy_witness group oldAction + pairing unions powers separation infinite hG hP0 k level + have ownerCode : FunctionGraphOn B owner := + ⟨_, (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2⟩ + have same := ownerCode.unique owned actualOwner + obtain ⟨n, _, rank⟩ := data.externalBirthCopy_level_slot group oldAction + pairing unions powers separation infinite hG hP0 w r k actualOwner level + let i := data.externalBirthCopyVertex group oldAction k r + have slot : ((family).request r).vertexSlot i = k % 3 := by + rw [rank, depthSlotIndex, Nat.add_mod] + simp only [i, Nat.mul_mod, Nat.mod_self, Nat.zero_mul, Nat.zero_mod, Nat.zero_add, + Nat.mod_eq_of_lt (((family).request r).vertexSlot_lt_three (data.externalBirthCopyVertex group oldAction k r))] + have literal : completion.externalFamilyVertexCode group oldAction data.original r i = natSetCode (k % 3) := + (completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i).trans + (congrArg natSetCode slot) + have mapEq := ((births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).2 v e).1 mapEntry |>.2 + have sectionEq := data.externalSlotCopySection_eq group oldAction pairing unions powers separation infinite hG w r i + rw [literal, ← same] at sectionEq + have actual := mapEq.trans sectionEq + exact ⟨w, r, same, actual, actual.symm ▸ covered⟩ + +theorem layerMaps_embedding (k : Nat) {v e : ZFSet.{u}} + (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) : + MeetEmbeddingCode U B (completion.algebra.union.fields 1) (completion.externalPointOrder P0 r0 μ0 A0) + (completion.algebra.union.fields 2) (completion.externalPointMeet P0 r0 μ0 A0) e := by + let := group.toGroup + have active := ((births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).2 v e).1 mapEntry |>.1 + obtain ⟨_, x, hx, owned⟩ := births.layerOwners_cases active + obtain ⟨w, r, _, rfl, _⟩ := births.layerMaps_copy data group oldAction pairing unions powers separation infinite hG hP0 k hx owned mapEntry + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + exact geometry.copies _ (sc ▸ (s).encode_mem _) + +theorem layerMaps_outputs_cutoff (k n : Nat) (before : k ≤ n) {v e u y : ZFSet.{u}} + (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) (copied : ZFSet.pair u y ∈ e) : + y ∈ births.cutoff n := by + let := group.toGroup + have active := ((births.layerMaps_spec data group oldAction pairing unions powers separation infinite hG hP0 k).2 v e).1 mapEntry |>.1 + obtain ⟨_, x, hx, owned⟩ := births.layerOwners_cases active + obtain ⟨w, r, same, actual, _⟩ := births.layerMaps_copy data group oldAction pairing unions powers separation infinite hG hP0 k hx owned mapEntry + rcases data.externalBirthCopy_level_bound group oldAction pairing unions powers separation infinite hG hP0 + w r k (same ▸ owned) (births.layerFiber_level hx) (actual ▸ copied) with old | ⟨l, bound, level⟩ + · exact births.cutoff_old n old + · have levelCode := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have fresh := (mem_ownerFresh P B y).1 (ZFSet.pair_mem_prod.1 (levelCode.1 level)).1 + apply (mem_ownerLevelPrefix _ _ _ _ _).2 + refine Or.inr ⟨fresh.1, fresh.2, natSetCode l, natSetCode_mem_omega l, level, ?_⟩ + rcases Nat.lt_or_eq_of_le (Nat.le_trans bound before) with less | same + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + +theorem layerMaps_cutoff_embedding (k n : Nat) (before : k ≤ n) {v e : ZFSet.{u}} + (mapEntry : ZFSet.pair v e ∈ births.layerMaps k) : + MeetEmbeddingCode U (births.cutoff n) (completion.algebra.union.fields 1) (births.cutoffOrder n) + (completion.algebra.union.fields 2) (births.cutoffMeet n) e := + (births.layerMaps_embedding data group oldAction pairing unions powers separation infinite hG hP0 k mapEntry).restrictTarget + (fun _ _ copied => births.layerMaps_outputs_cutoff data group oldAction pairing unions powers separation infinite hG hP0 k n before mapEntry copied) + +end PartitionPilot.Forcing.GroundExternalBirthData + + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula SetRealization Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +include births data group oldAction pairing unions powers separation infinite hG hP0 + +omit data group oldAction pairing unions powers separation infinite hG hP0 in +theorem layerFiber_cutoff (k n : Nat) (before : k ≤ n) : + births.layerFiber k = layerBirthFiber (births.cutoff n) (births.cutoffBirth n) (compressionStamp oldTimes k) := by + apply ZFSet.ext + intro x + rw [births.mem_layerFiber, mem_layerBirthFiber] + constructor + · rintro ⟨hx, entry⟩ + have fresh := (births.stamp_fiber k x).1 entry + have hxCut : x ∈ births.cutoff n := by + apply (mem_ownerLevelPrefix _ _ _ _ _).2 + refine Or.inr ⟨hx, ((mem_ownerFresh P B x).1 fresh.1).2, + natSetCode k, natSetCode_mem_omega k, fresh.2, ?_⟩ + rcases Nat.lt_or_eq_of_le before with less | same + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + exact ⟨hxCut, pair_mem_graphRestriction.2 ⟨entry, hxCut⟩⟩ + · rintro ⟨hx, entry⟩ + exact ⟨births.cutoff_subset n hx, (pair_mem_graphRestriction.1 entry).1⟩ + +theorem layerComponents_earlier_meet (k : Nat) {x y v w : ZFSet.{u}} + (hx : x ∈ births.layerFiber k) (hy : y ∈ births.layerFiber k) + (first : ZFSet.pair x v ∈ births.layerComponents k) + (second : ZFSet.pair y w ∈ births.layerComponents k) (different : v ≠ w) : + ∃ z a, ZFSet.pair (ZFSet.pair x y) z ∈ completion.externalPointMeet P0 r0 μ0 A0 ∧ + ZFSet.pair z a ∈ births.birth ∧ a ∈ compressionStamp oldTimes k := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have bounds := ZFSet.pair_mem_prod.2 + ⟨((births.mem_layerFiber k x).1 hx).1, ((births.mem_layerFiber k y).1 hy).1⟩ + obtain ⟨z, meetEntry, _⟩ := geometry.meet.operation.2 (ZFSet.pair x y) bounds + have hz := (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2 + obtain ⟨a, born, _⟩ := births.function.2 z hz + have earlier := data.externalOwnerLevels_meet_old_or_lower group oldAction pairing unions powers separation infinite hG hP0 + (pair_mem_graphRestriction.1 first).1 (pair_mem_graphRestriction.1 second).1 different + (births.layerFiber_level hx) (births.layerFiber_level hy) meetEntry + refine ⟨z, a, meetEntry, born, ?_⟩ + apply ownerBirthGraph_earlier_of_level births.seed_function + (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + births.times.ownerStampCode ?_ ((births.times.entries k _).2 rfl) born earlier + intro u b j t entry stamp + rw [(births.times.entries j t).1 stamp] + exact births.old_before entry j + +end PartitionPilot.Forcing.GroundExternalBirthData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalChronologyStageLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalChronologyStageLaws.lean index b9d26b86c9038a3a2a998210a6dea2a5848cd5df..d0e9b28ab4cbae93d183d9fc4c0999833aeff2c3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalChronologyStageLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalChronologyStageLaws.lean @@ -1,794 +1,794 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExternalBirthLayers - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def ownerLevelPrefix (P B levels n : ZFSet.{u}) : ZFSet.{u} := - P ∪ ZFSet.sep (fun x => x ∉ P ∧ ∃ k ∈ ZFSet.omega, - ZFSet.pair x k ∈ levels ∧ (k = n ∨ k ∈ n)) B - -theorem mem_ownerLevelPrefix (P B levels n x : ZFSet.{u}) : - x ∈ ownerLevelPrefix P B levels n ↔ x ∈ P ∨ - x ∈ B ∧ x ∉ P ∧ ∃ k ∈ ZFSet.omega, ZFSet.pair x k ∈ levels ∧ (k = n ∨ k ∈ n) := by - rw [ownerLevelPrefix, ZFSet.mem_union, ZFSet.mem_sep] - -theorem ownerLevelPrefix_old (P B levels n : ZFSet.{u}) : P ⊆ ownerLevelPrefix P B levels n := - fun _ hx => (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inl hx) - -theorem ownerLevelPrefix_subset {P B : ZFSet.{u}} (subset : P ⊆ B) (levels n : ZFSet.{u}) : - ownerLevelPrefix P B levels n ⊆ B := by - intro x hx - exact ((mem_ownerLevelPrefix _ _ _ _ _).1 hx).elim (fun h => subset h) And.left - -theorem mem_ownerLevelPrefix_fresh {P B levels n x : ZFSet.{u}} (fresh : x ∉ P) : - x ∈ ownerLevelPrefix P B levels n ↔ - x ∈ B ∧ ∃ k ∈ ZFSet.omega, ZFSet.pair x k ∈ levels ∧ (k = n ∨ k ∈ n) := by - rw [mem_ownerLevelPrefix] - exact ⟨fun h => h.elim (fun old => False.elim (fresh old)) (fun h => ⟨h.1, h.2.2⟩), - fun h => Or.inr ⟨h.1, fresh, h.2⟩⟩ - -theorem omegaMemberOrEqual_trans {k n m : ZFSet.{u}} (hk : k ∈ ZFSet.omega) - (hn : n ∈ ZFSet.omega) (hm : m ∈ ZFSet.omega) - (first : k = n ∨ k ∈ n) (second : n = m ∨ n ∈ m) : k = m ∨ k ∈ m := by - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm - have kn : k ≤ n := first.elim (fun h => Nat.le_of_eq (natSetCode_injective h)) - (fun h => Nat.le_of_lt ((natSetCode_mem_iff _ _).1 h)) - have nm : n ≤ m := second.elim (fun h => Nat.le_of_eq (natSetCode_injective h)) - (fun h => Nat.le_of_lt ((natSetCode_mem_iff _ _).1 h)) - rcases Nat.lt_or_eq_of_le (Nat.le_trans kn nm) with less | same - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - -theorem ownerLevelPrefix_mono {P B levels n m : ZFSet.{u}} - (hn : n ∈ ZFSet.omega) (hm : m ∈ ZFSet.omega) (before : n = m ∨ n ∈ m) : - ownerLevelPrefix P B levels n ⊆ ownerLevelPrefix P B levels m := by - intro x hx - rcases (mem_ownerLevelPrefix _ _ _ _ _).1 hx with old | ⟨hx, fresh, k, hk, entry, bound⟩ - · exact ownerLevelPrefix_old _ _ _ _ old - · exact (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inr - ⟨hx, fresh, k, hk, entry, omegaMemberOrEqual_trans hk hn hm bound before⟩) - -theorem ownerLevelPrefix_union {P B levels : ZFSet.{u}} (subset : P ⊆ B) - (function : ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) ZFSet.omega levels) (x : ZFSet.{u}) : - x ∈ B ↔ ∃ n : Nat, x ∈ ownerLevelPrefix P B levels (natSetCode n) := by - classical - constructor - · intro hx - by_cases old : x ∈ P - · exact ⟨0, ownerLevelPrefix_old _ _ _ _ old⟩ - · obtain ⟨k, entry, _⟩ := function.2 x (ZFSet.mem_sep.2 ⟨hx, old⟩) - have hk := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - exact ⟨n, (mem_ownerLevelPrefix _ _ _ _ _).2 - (Or.inr ⟨hx, old, natSetCode n, natSetCode_mem_omega n, entry, Or.inl rfl⟩)⟩ - · rintro ⟨n, hx⟩ - exact ownerLevelPrefix_subset subset levels (natSetCode n) hx - -theorem ownerLevelPrefix_lower {P B levels order n : ZFSet.{u}} - (hn : n ∈ ZFSet.omega) - (oldLower : ∀ x ∈ B, ∀ y ∈ P, ZFSet.pair x y ∈ order → x ∈ P) - (function : ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) ZFSet.omega levels) - (monotone : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ k l, - ZFSet.pair x k ∈ levels → ZFSet.pair y l ∈ levels → ZFSet.pair x y ∈ order → k = l ∨ k ∈ l) : - ∀ x ∈ B, ∀ y ∈ ownerLevelPrefix P B levels n, - ZFSet.pair x y ∈ order → x ∈ ownerLevelPrefix P B levels n := by - classical - intro x hx y hy lower - by_cases old : x ∈ P - · exact ownerLevelPrefix_old _ _ _ _ old - rcases (mem_ownerLevelPrefix _ _ _ _ _).1 hy with hy | ⟨hy, fresh, l, hl, atY, bound⟩ - · exact False.elim (old (oldLower x hx y hy lower)) - · obtain ⟨k, atX, _⟩ := function.2 x (ZFSet.mem_sep.2 ⟨hx, old⟩) - have hk := (ZFSet.pair_mem_prod.1 (function.1 atX)).2 - exact (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inr ⟨hx, old, k, hk, atX, - omegaMemberOrEqual_trans hk hl hn (monotone x hx old y hy fresh k l atX atY lower) bound⟩) - - - - - -noncomputable def ownerLevelPrefixPoints (P B levels : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ x ∈ B, - z = ZFSet.pair n x ∧ x ∈ ownerLevelPrefix P B levels n) (ZFSet.prod ZFSet.omega B) - -theorem pair_mem_ownerLevelPrefixPoints (P B levels n x : ZFSet.{u}) : - ZFSet.pair n x ∈ ownerLevelPrefixPoints P B levels ↔ - n ∈ ZFSet.omega ∧ x ∈ B ∧ x ∈ ownerLevelPrefix P B levels n := by - rw [ownerLevelPrefixPoints, ZFSet.mem_sep] - constructor - · rintro ⟨_, n', hn, x', hx, equal, member⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hn, hx, member⟩ - · rintro ⟨hn, hx, member⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hn, hx⟩, n, hn, x, hx, rfl, member⟩ - -theorem ownerLevelPrefixPoints_fiber {P B levels n : ZFSet.{u}} - (subset : P ⊆ B) (hn : n ∈ ZFSet.omega) : - relationFiber B (ownerLevelPrefixPoints P B levels) n = ownerLevelPrefix P B levels n := by - apply ZFSet.ext - intro x - rw [mem_relationFiber, pair_mem_ownerLevelPrefixPoints] - exact ⟨fun h => h.2.2.2, fun hx => - ⟨ownerLevelPrefix_subset subset levels n hx, hn, ownerLevelPrefix_subset subset levels n hx, hx⟩⟩ - -namespace BoundedFormula - -def ownerLevelPrefixFormula {n} (x P B levels cutoff omega : Fin n) : BoundedFormula n := - disj (.mem x P) (.conj (.mem x B) (.conj (.neg (.mem x P)) - (exMem omega (.conj (pairMembershipFormula x.succ 0 levels.succ) - (disj (.equal 0 cutoff.succ) (.mem 0 cutoff.succ)))))) - -theorem truth_ownerLevelPrefixFormula {n} (x P B levels cutoff omega : Fin n) - (env : Fin n → ZFSet.{u}) (omegaEq : env omega = ZFSet.omega) : - Truth (ownerLevelPrefixFormula x P B levels cutoff omega) env ↔ - env x ∈ ownerLevelPrefix (env P) (env B) (env levels) (env cutoff) := by - simp only [ownerLevelPrefixFormula, truth_disj, Truth, truth_exMem, truth_pairMembershipFormula] - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [omegaEq, mem_ownerLevelPrefix] - -def ownerLevelPrefixPointFormula {n} (z P B levels omega : Fin n) : BoundedFormula n := - exMem omega (exMem B.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (ownerLevelPrefixFormula 0 P.succ.succ B.succ.succ levels.succ.succ 1 omega.succ.succ))) - -theorem truth_ownerLevelPrefixPointFormula {n} (z P B levels omega : Fin n) - (env : Fin n → ZFSet.{u}) (omegaEq : env omega = ZFSet.omega) : - Truth (ownerLevelPrefixPointFormula z P B levels omega) env ↔ - env z ∈ ownerLevelPrefixPoints (env P) (env B) (env levels) := by - simp only [ownerLevelPrefixPointFormula, truth_exMem, Truth, truth_orderedPairFormula, - ownerLevelPrefixFormula, truth_disj, truth_pairMembershipFormula] - simp only [extend, Fin.cases_zero, Fin.cases_succ] - rw [omegaEq, ownerLevelPrefixPoints, ZFSet.mem_sep] - simp only [mem_ownerLevelPrefix] - refine ⟨fun h => ⟨?_, h⟩, And.right⟩ - obtain ⟨n, hn, x, hx, equal, _⟩ := h - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨hn, hx⟩ -end BoundedFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def ownerLevelPrefixFamily (P B levels : ZFSet.{u}) : ZFSet.{u} := - M.relationFiberFamily ZFSet.omega B (ownerLevelPrefixPoints P B levels) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable {P B levels : ZFSet.{u}} (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hLevels : levels ∈ M.sets) -include pairing unions powers separation infinite hP hB hLevels - -theorem ownerLevelPrefixPoints_mem : ownerLevelPrefixPoints P B levels ∈ M.sets := by - have hOmega := M.omega_mem separation infinite - let params := extend P (extend B (extend levels (extend ZFSet.omega Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.ownerLevelPrefixPointFormula 0 1 2 3 4) params - (Fin.cases hP (Fin.cases hB (Fin.cases hLevels (Fin.cases hOmega (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation hOmega hB) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.ownerLevelPrefixPointFormula 0 1 2 3 4) (extend z params)) - (ZFSet.prod ZFSet.omega B) = ownerLevelPrefixPoints P B levels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_ownerLevelPrefixPointFormula _ _ _ _ _ _ rfl] - exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ - exact equal ▸ selected - -theorem ownerLevelPrefix_mem (subset : P ⊆ B) {n : ZFSet.{u}} (hn : n ∈ ZFSet.omega) : - ownerLevelPrefix P B levels n ∈ M.sets := by - rw [← ownerLevelPrefixPoints_fiber subset hn] - exact M.relationFiber_mem separation hB (M.ownerLevelPrefixPoints_mem pairing unions powers separation infinite hP hB hLevels) - (M.transitive (M.omega_mem separation infinite) hn) - -theorem ownerLevelPrefixFamily_spec (subset : P ⊆ B) : - M.ownerLevelPrefixFamily P B levels ∈ M.sets ∧ - FunctionGraphOn ZFSet.omega (M.ownerLevelPrefixFamily P B levels) ∧ - ∀ n S, ZFSet.pair n S ∈ M.ownerLevelPrefixFamily P B levels ↔ - n ∈ ZFSet.omega ∧ S = ownerLevelPrefix P B levels n := by - have hOmega := M.omega_mem separation infinite - have hPoints := M.ownerLevelPrefixPoints_mem pairing unions powers separation infinite hP hB hLevels - refine ⟨M.relationFiberFamily_mem pairing unions powers separation hOmega hB hPoints, - ⟨M.groundPower B, M.relationFiberFamily_function separation hOmega hB hPoints⟩, ?_⟩ - intro n S - change ZFSet.pair n S ∈ M.relationFiberFamily _ _ _ ↔ _ - rw [M.relationFiberFamily_entries separation hOmega hB hPoints] - exact ⟨fun h => ⟨h.1, h.2.trans (ownerLevelPrefixPoints_fiber subset h.1)⟩, - fun h => ⟨h.1, h.2.trans (ownerLevelPrefixPoints_fiber subset h.1).symm⟩⟩ - -end TransitiveGround - - - - - -theorem PartialOrderCode.heightOrderRestriction {B Q r : ZFSet.{u}} - (order : PartialOrderCode B r) (subset : Q ⊆ B) : - PartialOrderCode Q (heightOrderRestriction Q r) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_, ?_, ?_⟩ - · intro x hx - exact (pair_mem_heightOrderRestriction _ _ _ _).2 ⟨order.refl x (subset hx), hx, hx⟩ - · intro x hx y hy xy yx - exact order.antisymm x (subset hx) y (subset hy) (ZFSet.mem_sep.1 xy).1 (ZFSet.mem_sep.1 yx).1 - · intro x hx y hy z hz xy yz - exact (pair_mem_heightOrderRestriction _ _ _ _).2 - ⟨order.trans x (subset hx) y (subset hy) z (subset hz) (ZFSet.mem_sep.1 xy).1 (ZFSet.mem_sep.1 yz).1, hx, hz⟩ - -theorem MeetOrderCode.restrict_lower {B Q r μ : ZFSet.{u}} - (meet : MeetOrderCode B r μ) (subset : Q ⊆ B) - (lower : ∀ x ∈ B, ∀ y ∈ Q, ZFSet.pair x y ∈ r → x ∈ Q) : - MeetOrderCode Q (heightOrderRestriction Q r) (graphRestriction (ZFSet.prod Q Q) μ) := by - have productSubset : ZFSet.prod Q Q ⊆ ZFSet.prod B B := by - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz - exact ZFSet.pair_mem_prod.2 ⟨subset hx, subset hy⟩ - have function := (show FunctionGraphOn (ZFSet.prod B B) μ from ⟨B, meet.operation⟩).restrict productSubset - have result : ∀ x y z, ZFSet.pair (ZFSet.pair x y) z ∈ graphRestriction (ZFSet.prod Q Q) μ → z ∈ Q := by - intro x y z entry - obtain ⟨entry, domain⟩ := pair_mem_graphRestriction.1 entry - exact lower z (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 - x (ZFSet.pair_mem_prod.1 domain).1 (meet.lower_left x y z entry) - refine ⟨meet.order.heightOrderRestriction subset, ⟨?_, function.to_isFunc.2⟩, ?_, ?_, ?_⟩ - · intro z hz - obtain ⟨a, ha, w, rfl, _⟩ := mem_graphRestriction.1 hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ha - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, result x y w hz⟩ - · intro x y z entry - have domain := ZFSet.pair_mem_prod.1 (pair_mem_graphRestriction.1 entry).2 - exact (pair_mem_heightOrderRestriction _ _ _ _).2 - ⟨meet.lower_left x y z (pair_mem_graphRestriction.1 entry).1, result x y z entry, domain.1⟩ - · intro x y z entry - have domain := ZFSet.pair_mem_prod.1 (pair_mem_graphRestriction.1 entry).2 - exact (pair_mem_heightOrderRestriction _ _ _ _).2 - ⟨meet.lower_right x y z (pair_mem_graphRestriction.1 entry).1, result x y z entry, domain.2⟩ - · intro x y z w hw entry left right - exact (pair_mem_heightOrderRestriction _ _ _ _).2 - ⟨meet.greatest x y z w (subset hw) (pair_mem_graphRestriction.1 entry).1 - (ZFSet.mem_sep.1 left).1 (ZFSet.mem_sep.1 right).1, hw, result x y z entry⟩ - -theorem StrictLexHeightCode.restrict_order {B Q C D r height rD : ZFSet.{u}} - (code : StrictLexHeightCode B C D r height rD) (subset : Q ⊆ B) : - StrictLexHeightCode Q C D (heightOrderRestriction Q r) (graphRestriction Q height) rD := by - have function := (show FunctionGraphOn B height from ⟨ZFSet.prod C D, code.function⟩).restrict subset - refine ⟨⟨?_, function.to_isFunc.2⟩, ?_⟩ - · intro z hz - obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz - exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2⟩ - · intro x hx y hy c q d v lower distinct first second - exact code.strict x (subset hx) y (subset hy) c q d v (ZFSet.mem_sep.1 lower).1 distinct - (pair_mem_graphRestriction.1 first).1 (pair_mem_graphRestriction.1 second).1 - -theorem ownerLevelPrefix_codes {P B levels r μ C D height rD n : ZFSet.{u}} - (subset : P ⊆ B) (hn : n ∈ ZFSet.omega) - (oldLower : ∀ x ∈ B, ∀ y ∈ P, ZFSet.pair x y ∈ r → x ∈ P) - (function : ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) ZFSet.omega levels) - (monotone : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ k l, - ZFSet.pair x k ∈ levels → ZFSet.pair y l ∈ levels → ZFSet.pair x y ∈ r → k = l ∨ k ∈ l) - (meet : MeetOrderCode B r μ) (code : StrictLexHeightCode B C D r height rD) : - let Q := ownerLevelPrefix P B levels n - MeetOrderCode Q (heightOrderRestriction Q r) (graphRestriction (ZFSet.prod Q Q) μ) ∧ - StrictLexHeightCode Q C D (heightOrderRestriction Q r) (graphRestriction Q height) rD := by - exact ⟨meet.restrict_lower (ownerLevelPrefix_subset subset levels n) - (ownerLevelPrefix_lower hn oldLower function monotone), - code.restrict_order (ownerLevelPrefix_subset subset levels n)⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem heightOrderRestriction_mem {Q r : ZFSet.{u}} (hQ : Q ∈ M.sets) (hr : r ∈ M.sets) : - heightOrderRestriction Q r ∈ M.sets := by - have hProduct := M.prod_mem pairing unions powers separation hQ hQ - exact M.bounded_separation_mem separation (.mem 0 1) (extend (ZFSet.prod Q Q) Fin.elim0) - (Fin.cases hProduct (fun i => Fin.elim0 i)) hr - -theorem ownerLevelPrefix_fields_mem - (infinite : Realize M.sets infinity Fin.elim0) - {P B levels r μ height n : ZFSet.{u}} - (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hLevels : levels ∈ M.sets) - (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hHeight : height ∈ M.sets) - (subset : P ⊆ B) (hn : n ∈ ZFSet.omega) : - let Q := ownerLevelPrefix P B levels n - Q ∈ M.sets ∧ heightOrderRestriction Q r ∈ M.sets ∧ - graphRestriction (ZFSet.prod Q Q) μ ∈ M.sets ∧ graphRestriction Q height ∈ M.sets := by - have hQ := M.ownerLevelPrefix_mem pairing unions powers separation infinite hP hB hLevels subset hn - exact ⟨hQ, M.heightOrderRestriction_mem pairing unions powers separation hQ hr, - M.graphRestriction_mem unions separation (M.prod_mem pairing unions powers separation hQ hQ) hμ, - M.graphRestriction_mem unions separation hQ hHeight⟩ - -end TransitiveGround - - - - - -noncomputable def chronologyRestriction (kind : Fin 3) (P f : ZFSet.{u}) : ZFSet.{u} := - Fin.cases (graphRestriction P f) (Fin.cases (heightOrderRestriction P f) - (fun _ => graphRestriction (ZFSet.prod P P) f)) kind - -namespace BoundedFormula - -def chronologyRestrictionMemberFormula (kind : Fin 3) {n} (z P R : Fin n) : BoundedFormula n := - Fin.cases (productElementFormula z P R) (Fin.cases (productElementFormula z P P) - (fun _ => exMem R (exMem R.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (productElementFormula 1 P.succ.succ P.succ.succ))))) kind - -theorem truth_chronologyRestrictionMemberFormula (kind : Fin 3) {n} - (z P R : Fin n) (env : Fin n → ZFSet.{u}) {f : ZFSet.{u}} - (bound : env R = ZFSet.sUnion (ZFSet.sUnion f)) (member : env z ∈ f) : - Truth (chronologyRestrictionMemberFormula kind z P R) env ↔ - env z ∈ chronologyRestriction kind (env P) f := by - refine Fin.cases ?_ (Fin.cases ?_ (fun _ => ?_)) kind - · simp only [chronologyRestrictionMemberFormula, chronologyRestriction, Fin.cases_zero, - truth_productElementFormula, graphRestriction, ZFSet.mem_sep, member, true_and, bound] - · simp only [chronologyRestrictionMemberFormula, chronologyRestriction, Fin.cases_succ, - Fin.cases_zero, truth_productElementFormula, heightOrderRestriction, ZFSet.mem_sep, member, true_and] - · simp only [chronologyRestrictionMemberFormula, chronologyRestriction, Fin.cases_succ, - truth_exMem, Truth, truth_orderedPairFormula, truth_productElementFormula] - change (∃ a ∈ env R, ∃ b ∈ env R, env z = ZFSet.pair a b ∧ a ∈ ZFSet.prod (env P) (env P)) ↔ _ - constructor - · rintro ⟨a, _, b, _, equal, ha⟩ - rw [equal] at member ⊢ - exact pair_mem_graphRestriction.2 ⟨member, ha⟩ - · intro entry - obtain ⟨a, ha, b, equal, pair⟩ := mem_graphRestriction.1 entry - exact ⟨a, bound.symm ▸ pair_first_mem_doubleUnion pair, - b, bound.symm ▸ pair_second_mem_doubleUnion pair, equal, ha⟩ - -def chronologyRestrictionFormula (kind : Fin 3) {n} (q P R f : Fin n) : BoundedFormula n := - .conj (.allMem q (.conj (.mem 0 f.succ) (chronologyRestrictionMemberFormula kind 0 P.succ R.succ))) - (.allMem f (imp (chronologyRestrictionMemberFormula kind 0 P.succ R.succ) (.mem 0 q.succ))) - -theorem truth_chronologyRestrictionFormula (kind : Fin 3) {n} - (q P R f : Fin n) (env : Fin n → ZFSet.{u}) (bound : env R = ZFSet.sUnion (ZFSet.sUnion (env f))) : - Truth (chronologyRestrictionFormula kind q P R f) env ↔ - env q = chronologyRestriction kind (env P) (env f) := by - have subset : chronologyRestriction kind (env P) (env f) ⊆ env f := by - exact Fin.cases (graphRestriction_subset _ _) - (Fin.cases (fun _ hz => (ZFSet.mem_sep.1 hz).1) - (fun _ => graphRestriction_subset _ _)) kind - simp only [chronologyRestrictionFormula, Truth, truth_imp] - constructor - · rintro ⟨forward, backward⟩ - apply ZFSet.ext - intro z - constructor - · intro hz - exact (truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ (extend z env) - bound (forward z hz).1).1 (forward z hz).2 - · intro hz - exact backward z (subset hz) ((truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ - (extend z env) bound (subset hz)).2 hz) - · intro equal - change (∀ z ∈ env q, z ∈ env f ∧ _) ∧ (∀ z ∈ env f, _ → z ∈ env q) - rw [equal] - exact ⟨fun z hz => ⟨subset hz, (truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ - (extend z env) bound (subset hz)).2 hz⟩, - fun z hz recognized => (truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ - (extend z env) bound hz).1 recognized⟩ - -def chronologyRestrictionFamilyFormula (kind : Fin 3) {n} - (z I Ps Q R W f : Fin n) : BoundedFormula n := - exMem I (exMem Q.succ (exMem W.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 0) - (.conj (pairMembershipFormula 2 1 Ps.succ.succ.succ) - (chronologyRestrictionFormula kind 0 1 R.succ.succ.succ f.succ.succ.succ))))) - -theorem truth_chronologyRestrictionFamilyFormula (kind : Fin 3) {n} - (z I Ps Q R W f : Fin n) (env : Fin n → ZFSet.{u}) (bound : env R = ZFSet.sUnion (ZFSet.sUnion (env f))) : - Truth (chronologyRestrictionFamilyFormula kind z I Ps Q R W f) env ↔ - ∃ i ∈ env I, ∃ P ∈ env Q, ∃ q ∈ env W, env z = ZFSet.pair i q ∧ - ZFSet.pair i P ∈ env Ps ∧ q = chronologyRestriction kind P (env f) := by - have meaning (i P q : ZFSet.{u}) := - truth_chronologyRestrictionFormula kind 0 1 R.succ.succ.succ f.succ.succ.succ - (extend q (extend P (extend i env))) bound - simp only [chronologyRestrictionFamilyFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, meaning] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def chronologyRestrictionFamily (kind : Fin 3) (I Ps f : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ P ∈ ZFSet.sUnion (ZFSet.sUnion Ps), ∃ q ∈ M.groundPower f, - z = ZFSet.pair i q ∧ ZFSet.pair i P ∈ Ps ∧ q = chronologyRestriction kind P f) - (ZFSet.prod I (M.groundPower f)) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem chronologyRestriction_mem (kind : Fin 3) {P f : ZFSet.{u}} - (hP : P ∈ M.sets) (hf : f ∈ M.sets) : chronologyRestriction kind P f ∈ M.sets := by - exact Fin.cases (M.graphRestriction_mem unions separation hP hf) - (Fin.cases (M.heightOrderRestriction_mem pairing unions powers separation hP hf) - (fun _ => M.graphRestriction_mem unions separation - (M.prod_mem pairing unions powers separation hP hP) hf)) kind - -theorem chronologyRestrictionFamily_mem (kind : Fin 3) {I Ps f : ZFSet.{u}} - (hI : I ∈ M.sets) (hPs : Ps ∈ M.sets) (hf : f ∈ M.sets) : - M.chronologyRestrictionFamily kind I Ps f ∈ M.sets := by - have hW := M.groundPower_mem powers hf - let params := extend I (extend Ps (extend (ZFSet.sUnion (ZFSet.sUnion Ps)) (extend (ZFSet.sUnion (ZFSet.sUnion f)) - (extend (M.groundPower f) (extend f Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.chronologyRestrictionFamilyFormula kind 0 1 2 3 4 5 6) params - (Fin.cases hI (Fin.cases hPs (Fin.cases (M.union_mem unions (M.union_mem unions hPs)) - (Fin.cases (M.union_mem unions (M.union_mem unions hf)) (Fin.cases hW - (Fin.cases hf (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hI hW) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.chronologyRestrictionFamilyFormula kind 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod I (M.groundPower f)) = M.chronologyRestrictionFamily kind I Ps f := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, chronologyRestrictionFamily, ZFSet.mem_sep, - BoundedFormula.truth_chronologyRestrictionFamilyFormula kind _ _ _ _ _ _ _ _ rfl] - rfl - exact equal ▸ selected - -theorem chronologyRestrictionFamily_entries (kind : Fin 3) {I Ps f : ZFSet.{u}} - (hPs : Ps ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I Ps) - {i P : ZFSet.{u}} (entry : ZFSet.pair i P ∈ Ps) (q : ZFSet.{u}) : - ZFSet.pair i q ∈ M.chronologyRestrictionFamily kind I Ps f ↔ - q = chronologyRestriction kind P f := by - constructor - · intro member - obtain ⟨_, j, _, Q, _, w, _, equal, input, output⟩ := ZFSet.mem_sep.1 member - obtain ⟨rfl,rfl⟩ := ZFSet.pair_inj.1 equal - exact function.unique input entry ▸ output - · intro equal - have hP := M.pair_right (M.transitive hPs entry) - have subset : chronologyRestriction kind P f ⊆ f := by - exact Fin.cases (graphRestriction_subset _ _) - (Fin.cases (fun _ hz => (ZFSet.mem_sep.1 hz).1) - (fun _ => graphRestriction_subset _ _)) kind - have bound := (M.mem_groundPower f q).2 ⟨equal.symm ▸ - M.chronologyRestriction_mem pairing unions powers separation kind hP hf, - fun z hz => subset (equal ▸ hz)⟩ - have hi := (ZFSet.pair_mem_prod.1 (function.to_isFunc.1 entry)).1 - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi,bound⟩, i,hi,P, - pair_second_mem_doubleUnion entry,q,bound,rfl,entry,equal⟩ - -theorem chronologyRestrictionFamily_function (kind : Fin 3) {I Ps f : ZFSet.{u}} - (hPs : Ps ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I Ps) : - ZFSet.IsFunc I (M.groundPower f) (M.chronologyRestrictionFamily kind I Ps f) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro i hi - obtain ⟨P, entry, _⟩ := function.to_isFunc.2 i hi - have exactEntries := M.chronologyRestrictionFamily_entries pairing unions powers separation kind hPs hf function entry - exact ⟨chronologyRestriction kind P f, (exactEntries _).2 rfl, fun q hq => (exactEntries q).1 hq⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "r" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 - -noncomputable def cutoff (_births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) (n : Nat) : ZFSet.{u} := - ownerLevelPrefix P B levels (natSetCode n) - -noncomputable def cutoffFamily (_births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) : ZFSet.{u} := - M.ownerLevelPrefixFamily P B levels - -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -noncomputable def cutoffOrder (n : Nat) : ZFSet.{u} := heightOrderRestriction (births.cutoff n) r -noncomputable def cutoffMeet (n : Nat) : ZFSet.{u} := graphRestriction (ZFSet.prod (births.cutoff n) (births.cutoff n)) μ -noncomputable def cutoffBirth (n : Nat) : ZFSet.{u} := graphRestriction (births.cutoff n) births.birth -noncomputable def cutoffHeight (height : ZFSet.{u}) (n : Nat) : ZFSet.{u} := graphRestriction (births.cutoff n) height - -theorem cutoff_old (n : Nat) : P ⊆ births.cutoff n := ownerLevelPrefix_old _ _ _ _ - -theorem cutoff_subset (n : Nat) : births.cutoff n ⊆ B := - ownerLevelPrefix_subset (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) levels (natSetCode n) - -theorem cutoff_mono {n k : Nat} (before : n ≤ k) : births.cutoff n ⊆ births.cutoff k := by - apply ownerLevelPrefix_mono (natSetCode_mem_omega n) (natSetCode_mem_omega k) - rcases Nat.lt_or_eq_of_le before with less | same - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - -theorem cutoff_union - (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) (x : ZFSet.{u}) : - x ∈ B ↔ ∃ n : Nat, x ∈ births.cutoff n := - ownerLevelPrefix_union (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) levelFunction x - -theorem cutoff_birth_function (n : Nat) : - ZFSet.IsFunc (births.cutoff n) births.limit (births.cutoffBirth n) := by - have restricted := (show FunctionGraphOn B births.birth from ⟨births.limit, births.function⟩).restrict (births.cutoff_subset n) - apply isFunc_retarget_of_entries restricted.to_isFunc - intro x t entry - exact (ZFSet.pair_mem_prod.1 (births.function.1 (pair_mem_graphRestriction.1 entry).1)).2 - -theorem cutoff_old_meet (n : Nat) : OldMeetCode (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) := by - intro x y z a b c ya xb before notLower xy zc - have hx := (pair_mem_graphRestriction.1 xb).2 - have hy := (pair_mem_graphRestriction.1 ya).2 - exact births.old_meet x y z a b c (pair_mem_graphRestriction.1 ya).1 (pair_mem_graphRestriction.1 xb).1 before - (fun lower => notLower ((pair_mem_heightOrderRestriction _ _ _ _).2 ⟨lower, hx, hy⟩)) - (pair_mem_graphRestriction.1 xy).1 (pair_mem_graphRestriction.1 zc).1 - -theorem cutoff_birth_bound - (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) - (n : Nat) {x t : ZFSet.{u}} (entry : ZFSet.pair x t ∈ births.cutoffBirth n) : - t ∈ compressionStamp oldTimes n ∨ t = compressionStamp oldTimes n := by - classical - obtain ⟨entry, hx⟩ := pair_mem_graphRestriction.1 entry - by_cases old : x ∈ P - · exact Or.inl (births.old_before ((ownerBirthGraph_old_iff old).1 entry) n) - · obtain ⟨_, k, hk, level, bound⟩ := (mem_ownerLevelPrefix_fresh old).1 hx - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - obtain ⟨_, _, j, actualLevel, stamp⟩ := (ownerBirthGraph_fresh_nat_iff births.seed_function old).1 entry - have equal : j = k := natSetCode_injective - ((show FunctionGraphOn (ownerFresh P B) levels from ⟨ZFSet.omega, levelFunction⟩).unique actualLevel level) - subst j - rw [(births.times.entries k t).1 stamp] - rcases bound with same | before - · exact Or.inr (congrArg (compressionStamp oldTimes) (natSetCode_injective same)) - · exact Or.inl ((compressionStamp_mem_iff oldTimes k n).2 ((natSetCode_mem_iff _ _).1 before)) - -variable {inv : ZFSet.{u}} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -include data group action pairing unions powers separation infinite hG hP0 - -theorem cutoffFamily_spec : births.cutoffFamily ∈ M.sets ∧ FunctionGraphOn ZFSet.omega births.cutoffFamily ∧ - ∀ n : Nat, ∀ Q, ZFSet.pair (natSetCode n) Q ∈ births.cutoffFamily ↔ Q = births.cutoff n := by - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - have hSeed := data.externalSeedCarrier_ground group action pairing unions powers separation infinite hG hP0 - have hLevels := (data.externalOwnerLevels_ground_function group action pairing unions powers separation infinite hG hP0).1 - have spec := M.ownerLevelPrefixFamily_spec pairing unions powers separation infinite hSeed geometry.carrier_ground hLevels - (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) - exact ⟨spec.1, spec.2.1, fun n Q => (spec.2.2 (natSetCode n) Q).trans (and_iff_right (natSetCode_mem_omega n))⟩ - -theorem cutoff_lower (n : Nat) : - ∀ x ∈ B, ∀ y ∈ births.cutoff n, ZFSet.pair x y ∈ r → x ∈ births.cutoff n := by - have levelFunction := (data.externalOwnerLevels_ground_function group action pairing unions powers separation infinite hG hP0).2 - apply ownerLevelPrefix_lower (natSetCode_mem_omega n) - (fun _ hx _ hy lower => data.externalSeedCarrier_lower group action pairing unions powers separation infinite hG hx hy lower) levelFunction - intro x _ _ y _ _ k l first second lower - have hk := (ZFSet.pair_mem_prod.1 (levelFunction.1 first)).2 - have hl := (ZFSet.pair_mem_prod.1 (levelFunction.1 second)).2 - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode l).1 hl - have before := data.externalOwnerLevels_monotone group action pairing unions powers separation infinite hG hP0 lower first second - rcases Nat.lt_or_eq_of_le before with less | same - · exact Or.inr ((natSetCode_mem_iff _ _).2 less) - · exact Or.inl (congrArg natSetCode same) - -theorem cutoff_fields {C D rD lo hi seed : ZFSet.{u}} - (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi seed completion) - (n : Nat) : - births.cutoff n ∈ M.sets ∧ births.cutoffOrder n ∈ M.sets ∧ births.cutoffMeet n ∈ M.sets ∧ - births.cutoffBirth n ∈ M.sets ∧ births.cutoffHeight heights.height n ∈ M.sets ∧ - MeetOrderCode (births.cutoff n) (births.cutoffOrder n) (births.cutoffMeet n) ∧ - ZFSet.IsFunc (births.cutoff n) births.limit (births.cutoffBirth n) ∧ - OldMeetCode (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) ∧ - StrictLexHeightCode (births.cutoff n) C D (births.cutoffOrder n) (births.cutoffHeight heights.height n) rD ∧ - ∀ x t, ZFSet.pair x t ∈ births.cutoffBirth n → t ∈ compressionStamp oldTimes n ∨ t = compressionStamp oldTimes n := by - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - have levelCode := data.externalOwnerLevels_ground_function group action pairing unions powers separation infinite hG hP0 - have hSeed := data.externalSeedCarrier_ground group action pairing unions powers separation infinite hG hP0 - have hQ := M.ownerLevelPrefix_mem pairing unions powers separation infinite hSeed geometry.carrier_ground levelCode.1 - (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) (natSetCode_mem_omega n) - refine ⟨hQ, M.heightOrderRestriction_mem pairing unions powers separation hQ geometry.order_ground, - M.graphRestriction_mem unions separation (M.prod_mem pairing unions powers separation hQ hQ) geometry.meet_ground, - M.graphRestriction_mem unions separation hQ births.birth_ground, - M.graphRestriction_mem unions separation hQ heights.height_ground, - geometry.meet.restrict_lower (births.cutoff_subset n) - (births.cutoff_lower data group action pairing unions powers separation infinite hG hP0 n), - births.cutoff_birth_function n, births.cutoff_old_meet n, - heights.code.restrict_order (births.cutoff_subset n), ?_⟩ - intro x t entry - exact births.cutoff_birth_bound levelCode.2 n entry - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 - -theorem cutoff_iff_birth_le_stamp (n : Nat) {x a : ZFSet.{u}} - (entry : ZFSet.pair x a ∈ births.birth) : - x ∈ births.cutoff n ↔ a ∈ compressionStamp oldTimes n ∨ a = compressionStamp oldTimes n := by - have function : FunctionGraphOn B births.birth := ⟨births.limit, births.function⟩ - constructor - · intro member - rcases (mem_ownerLevelPrefix _ _ _ _ _).1 member with old | ⟨hx, fresh, k, hk, level, bound⟩ - · exact Or.inl (births.old_before ((ownerBirthGraph_old_iff old).1 entry) n) - · obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - have atStamp := (births.stamp_fiber k x).2 ⟨(mem_ownerFresh P B x).2 ⟨hx, fresh⟩, level⟩ - rw [function.unique entry atStamp] - rcases bound with same | before - · exact Or.inr (congrArg (compressionStamp oldTimes) (natSetCode_injective same)) - · exact Or.inl ((compressionStamp_mem_iff oldTimes k n).2 ((natSetCode_mem_iff k n).1 before)) - · intro bound - by_cases old : x ∈ P - · exact births.cutoff_old n old - · obtain ⟨hx, _, k, level, stamp⟩ := (ownerBirthGraph_fresh_nat_iff births.seed_function old).1 entry - have actual := (births.times.entries k a).1 stamp - refine (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inr ⟨hx, old, natSetCode k, - natSetCode_mem_omega k, level, ?_⟩) - rcases bound with before | same - · exact Or.inr ((natSetCode_mem_iff k n).2 ((compressionStamp_mem_iff oldTimes k n).1 (actual ▸ before))) - · have atN : ZFSet.pair (natSetCode n) a ∈ births.stamps := (births.times.entries n a).2 same - exact Or.inl (congrArg natSetCode (births.times.ownerStampCode.injective stamp atN)) - -theorem point_in_birth_cutoff {n : Nat} {x : ZFSet.{u}} - (entry : ZFSet.pair x (compressionStamp oldTimes n) ∈ births.birth) : x ∈ births.cutoff n := - (births.cutoff_iff_birth_le_stamp n entry).2 (Or.inr rfl) - -theorem fresh_birth_cutoff_iff {n : Nat} {x : ZFSet.{u}} - (entry : ZFSet.pair x (compressionStamp oldTimes n) ∈ births.birth) (k : Nat) : - x ∈ births.cutoff k ↔ n ≤ k := by - rw [births.cutoff_iff_birth_le_stamp k entry] - constructor - · rintro (before | same) - · exact Nat.le_of_lt ((compressionStamp_mem_iff oldTimes n k).1 before) - · have first := (births.times.entries n _).2 rfl - have second := (births.times.entries k _).2 same - exact Nat.le_of_eq (births.times.ownerStampCode.injective first second) - · intro before - rcases Nat.lt_or_eq_of_le before with before | same - · exact Or.inl ((compressionStamp_mem_iff oldTimes n k).2 before) - · exact Or.inr (congrArg (compressionStamp oldTimes) same) - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundChronologicalHistory M T0 C D rD) - -noncomputable def chronologyFields : CompressionChronologyFields.{u} where - space := compressionPrefixValue oldTimes births.limit prior.space births.cutoff - (completion.externalPointCarrier P0 r0 μ0 A0) - order := compressionPrefixValue oldTimes births.limit prior.order births.cutoffOrder - (completion.externalPointOrder P0 r0 μ0 A0) - meetGraph := compressionPrefixValue oldTimes births.limit prior.meetGraph births.cutoffMeet - (completion.externalPointMeet P0 r0 μ0 A0) - birth := compressionPrefixValue oldTimes births.limit prior.birth births.cutoffBirth births.birth - height := compressionPrefixValue oldTimes births.limit prior.height (births.cutoffHeight heights.height) heights.height - -theorem chronologyFields_old {s : ZFSet.{u}} (before : s ∈ oldTimes ∨ s = oldTimes) : - (births.chronologyFields heights prior).space s = prior.space s ∧ - (births.chronologyFields heights prior).order s = prior.order s ∧ - (births.chronologyFields heights prior).meetGraph s = prior.meetGraph s ∧ - (births.chronologyFields heights prior).birth s = prior.birth s ∧ - (births.chronologyFields heights prior).height s = prior.height s := by - dsimp only [chronologyFields] - exact ⟨compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before, - compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before, - compressionPrefixValue_old _ _ _ before⟩ - -theorem chronologyFields_stamp (n : Nat) : - (births.chronologyFields heights prior).space (compressionStamp oldTimes n) = births.cutoff n ∧ - (births.chronologyFields heights prior).order (compressionStamp oldTimes n) = births.cutoffOrder n ∧ - (births.chronologyFields heights prior).meetGraph (compressionStamp oldTimes n) = births.cutoffMeet n ∧ - (births.chronologyFields heights prior).birth (compressionStamp oldTimes n) = births.cutoffBirth n ∧ - (births.chronologyFields heights prior).height (compressionStamp oldTimes n) = births.cutoffHeight heights.height n := by - dsimp only [chronologyFields] - exact ⟨compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n, - compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n, - compressionPrefixValue_stamp _ _ _ births.times n⟩ - -theorem chronologyFields_limit : - (births.chronologyFields heights prior).space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 ∧ - (births.chronologyFields heights prior).order births.limit = completion.externalPointOrder P0 r0 μ0 A0 ∧ - (births.chronologyFields heights prior).meetGraph births.limit = completion.externalPointMeet P0 r0 μ0 A0 ∧ - (births.chronologyFields heights prior).birth births.limit = births.birth ∧ - (births.chronologyFields heights prior).height births.limit = heights.height := by - dsimp only [chronologyFields] - exact ⟨compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times, - compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times, - compressionPrefixValue_limit _ _ _ births.times⟩ - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundChronologicalHistory M T0 C D rD) - -theorem chronologyFields_stage_laws - (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) - (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) - (ordinal : ordinalSetProperty T0) (hOld : oldTimes ∈ T0) - {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : - let fields := births.chronologyFields heights prior - MeetOrderCode (fields.space s) (fields.order s) (fields.meetGraph s) ∧ - ZFSet.IsFunc (fields.space s) (insert births.limit births.limit) (fields.birth s) ∧ - (∀ x ∈ fields.space s, ∀ t, ZFSet.pair x t ∈ fields.birth s → t = s ∨ t ∈ s) ∧ - OldMeetCode (fields.order s) (fields.meetGraph s) (fields.birth s) ∧ - StrictLexHeightCode (fields.space s) C D (fields.order s) (fields.height s) rD := by - classical - dsimp only - by_cases before : s ∈ oldTimes ∨ s = oldTimes - · have hs := before.elim (fun member => ordinal.1 oldTimes hOld s member) - (fun equal => equal.symm ▸ hOld) - obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_old heights prior before - rw [space, order, meet, birth, height] - exact ⟨prior.meet_order s hs, - prior.prefix_birth_function_successor births.times ordinal hOld before, - prior.birth_bound s hs, prior.old_meet s hs, prior.strict_height s hs⟩ - · rcases ZFSet.mem_insert_iff.1 cutoff with rfl | below - · obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_limit heights prior - rw [space, order, meet, birth, height] - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - exact ⟨geometry.meet, isFunc_retarget_of_entries births.function - (fun _ _ entry => ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2), - fun _ _ _ entry => Or.inr (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2, - births.old_meet, heights.code⟩ - · have stamped : ∃ n, s = compressionStamp oldTimes n := by - rcases (births.times.mem_limit_iff s).1 below with member | equal | stamped - · exact False.elim (before (Or.inl member)) - · exact False.elim (before (Or.inr equal)) - · exact stamped - obtain ⟨n, rfl⟩ := stamped - obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_stamp heights prior n - rw [space, order, meet, birth, height] - have fields := births.cutoff_fields data group action pairing unions powers separation infinite hG hP0 heights n - obtain ⟨_, _, _, _, _, meetCode, born, oldMeet, strict, bound⟩ := fields - exact ⟨meetCode, isFunc_retarget_of_entries born - (fun _ _ entry => ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.1 (born.1 entry)).2), - fun x _ t entry => (bound x t entry).symm, oldMeet, strict⟩ - -end PartitionPilot.Forcing.GroundExternalBirthData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExternalBirthLayers + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def ownerLevelPrefix (P B levels n : ZFSet.{u}) : ZFSet.{u} := + P ∪ ZFSet.sep (fun x => x ∉ P ∧ ∃ k ∈ ZFSet.omega, + ZFSet.pair x k ∈ levels ∧ (k = n ∨ k ∈ n)) B + +theorem mem_ownerLevelPrefix (P B levels n x : ZFSet.{u}) : + x ∈ ownerLevelPrefix P B levels n ↔ x ∈ P ∨ + x ∈ B ∧ x ∉ P ∧ ∃ k ∈ ZFSet.omega, ZFSet.pair x k ∈ levels ∧ (k = n ∨ k ∈ n) := by + rw [ownerLevelPrefix, ZFSet.mem_union, ZFSet.mem_sep] + +theorem ownerLevelPrefix_old (P B levels n : ZFSet.{u}) : P ⊆ ownerLevelPrefix P B levels n := + fun _ hx => (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inl hx) + +theorem ownerLevelPrefix_subset {P B : ZFSet.{u}} (subset : P ⊆ B) (levels n : ZFSet.{u}) : + ownerLevelPrefix P B levels n ⊆ B := by + intro x hx + exact ((mem_ownerLevelPrefix _ _ _ _ _).1 hx).elim (fun h => subset h) And.left + +theorem mem_ownerLevelPrefix_fresh {P B levels n x : ZFSet.{u}} (fresh : x ∉ P) : + x ∈ ownerLevelPrefix P B levels n ↔ + x ∈ B ∧ ∃ k ∈ ZFSet.omega, ZFSet.pair x k ∈ levels ∧ (k = n ∨ k ∈ n) := by + rw [mem_ownerLevelPrefix] + exact ⟨fun h => h.elim (fun old => False.elim (fresh old)) (fun h => ⟨h.1, h.2.2⟩), + fun h => Or.inr ⟨h.1, fresh, h.2⟩⟩ + +theorem omegaMemberOrEqual_trans {k n m : ZFSet.{u}} (hk : k ∈ ZFSet.omega) + (hn : n ∈ ZFSet.omega) (hm : m ∈ ZFSet.omega) + (first : k = n ∨ k ∈ n) (second : n = m ∨ n ∈ m) : k = m ∨ k ∈ m := by + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm + have kn : k ≤ n := first.elim (fun h => Nat.le_of_eq (natSetCode_injective h)) + (fun h => Nat.le_of_lt ((natSetCode_mem_iff _ _).1 h)) + have nm : n ≤ m := second.elim (fun h => Nat.le_of_eq (natSetCode_injective h)) + (fun h => Nat.le_of_lt ((natSetCode_mem_iff _ _).1 h)) + rcases Nat.lt_or_eq_of_le (Nat.le_trans kn nm) with less | same + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + +theorem ownerLevelPrefix_mono {P B levels n m : ZFSet.{u}} + (hn : n ∈ ZFSet.omega) (hm : m ∈ ZFSet.omega) (before : n = m ∨ n ∈ m) : + ownerLevelPrefix P B levels n ⊆ ownerLevelPrefix P B levels m := by + intro x hx + rcases (mem_ownerLevelPrefix _ _ _ _ _).1 hx with old | ⟨hx, fresh, k, hk, entry, bound⟩ + · exact ownerLevelPrefix_old _ _ _ _ old + · exact (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inr + ⟨hx, fresh, k, hk, entry, omegaMemberOrEqual_trans hk hn hm bound before⟩) + +theorem ownerLevelPrefix_union {P B levels : ZFSet.{u}} (subset : P ⊆ B) + (function : ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) ZFSet.omega levels) (x : ZFSet.{u}) : + x ∈ B ↔ ∃ n : Nat, x ∈ ownerLevelPrefix P B levels (natSetCode n) := by + classical + constructor + · intro hx + by_cases old : x ∈ P + · exact ⟨0, ownerLevelPrefix_old _ _ _ _ old⟩ + · obtain ⟨k, entry, _⟩ := function.2 x (ZFSet.mem_sep.2 ⟨hx, old⟩) + have hk := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + exact ⟨n, (mem_ownerLevelPrefix _ _ _ _ _).2 + (Or.inr ⟨hx, old, natSetCode n, natSetCode_mem_omega n, entry, Or.inl rfl⟩)⟩ + · rintro ⟨n, hx⟩ + exact ownerLevelPrefix_subset subset levels (natSetCode n) hx + +theorem ownerLevelPrefix_lower {P B levels order n : ZFSet.{u}} + (hn : n ∈ ZFSet.omega) + (oldLower : ∀ x ∈ B, ∀ y ∈ P, ZFSet.pair x y ∈ order → x ∈ P) + (function : ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) ZFSet.omega levels) + (monotone : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ k l, + ZFSet.pair x k ∈ levels → ZFSet.pair y l ∈ levels → ZFSet.pair x y ∈ order → k = l ∨ k ∈ l) : + ∀ x ∈ B, ∀ y ∈ ownerLevelPrefix P B levels n, + ZFSet.pair x y ∈ order → x ∈ ownerLevelPrefix P B levels n := by + classical + intro x hx y hy lower + by_cases old : x ∈ P + · exact ownerLevelPrefix_old _ _ _ _ old + rcases (mem_ownerLevelPrefix _ _ _ _ _).1 hy with hy | ⟨hy, fresh, l, hl, atY, bound⟩ + · exact False.elim (old (oldLower x hx y hy lower)) + · obtain ⟨k, atX, _⟩ := function.2 x (ZFSet.mem_sep.2 ⟨hx, old⟩) + have hk := (ZFSet.pair_mem_prod.1 (function.1 atX)).2 + exact (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inr ⟨hx, old, k, hk, atX, + omegaMemberOrEqual_trans hk hl hn (monotone x hx old y hy fresh k l atX atY lower) bound⟩) + + + + + +noncomputable def ownerLevelPrefixPoints (P B levels : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ x ∈ B, + z = ZFSet.pair n x ∧ x ∈ ownerLevelPrefix P B levels n) (ZFSet.prod ZFSet.omega B) + +theorem pair_mem_ownerLevelPrefixPoints (P B levels n x : ZFSet.{u}) : + ZFSet.pair n x ∈ ownerLevelPrefixPoints P B levels ↔ + n ∈ ZFSet.omega ∧ x ∈ B ∧ x ∈ ownerLevelPrefix P B levels n := by + rw [ownerLevelPrefixPoints, ZFSet.mem_sep] + constructor + · rintro ⟨_, n', hn, x', hx, equal, member⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hn, hx, member⟩ + · rintro ⟨hn, hx, member⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hn, hx⟩, n, hn, x, hx, rfl, member⟩ + +theorem ownerLevelPrefixPoints_fiber {P B levels n : ZFSet.{u}} + (subset : P ⊆ B) (hn : n ∈ ZFSet.omega) : + relationFiber B (ownerLevelPrefixPoints P B levels) n = ownerLevelPrefix P B levels n := by + apply ZFSet.ext + intro x + rw [mem_relationFiber, pair_mem_ownerLevelPrefixPoints] + exact ⟨fun h => h.2.2.2, fun hx => + ⟨ownerLevelPrefix_subset subset levels n hx, hn, ownerLevelPrefix_subset subset levels n hx, hx⟩⟩ + +namespace BoundedFormula + +def ownerLevelPrefixFormula {n} (x P B levels cutoff omega : Fin n) : BoundedFormula n := + disj (.mem x P) (.conj (.mem x B) (.conj (.neg (.mem x P)) + (exMem omega (.conj (pairMembershipFormula x.succ 0 levels.succ) + (disj (.equal 0 cutoff.succ) (.mem 0 cutoff.succ)))))) + +theorem truth_ownerLevelPrefixFormula {n} (x P B levels cutoff omega : Fin n) + (env : Fin n → ZFSet.{u}) (omegaEq : env omega = ZFSet.omega) : + Truth (ownerLevelPrefixFormula x P B levels cutoff omega) env ↔ + env x ∈ ownerLevelPrefix (env P) (env B) (env levels) (env cutoff) := by + simp only [ownerLevelPrefixFormula, truth_disj, Truth, truth_exMem, truth_pairMembershipFormula] + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [omegaEq, mem_ownerLevelPrefix] + +def ownerLevelPrefixPointFormula {n} (z P B levels omega : Fin n) : BoundedFormula n := + exMem omega (exMem B.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (ownerLevelPrefixFormula 0 P.succ.succ B.succ.succ levels.succ.succ 1 omega.succ.succ))) + +theorem truth_ownerLevelPrefixPointFormula {n} (z P B levels omega : Fin n) + (env : Fin n → ZFSet.{u}) (omegaEq : env omega = ZFSet.omega) : + Truth (ownerLevelPrefixPointFormula z P B levels omega) env ↔ + env z ∈ ownerLevelPrefixPoints (env P) (env B) (env levels) := by + simp only [ownerLevelPrefixPointFormula, truth_exMem, Truth, truth_orderedPairFormula, + ownerLevelPrefixFormula, truth_disj, truth_pairMembershipFormula] + simp only [extend, Fin.cases_zero, Fin.cases_succ] + rw [omegaEq, ownerLevelPrefixPoints, ZFSet.mem_sep] + simp only [mem_ownerLevelPrefix] + refine ⟨fun h => ⟨?_, h⟩, And.right⟩ + obtain ⟨n, hn, x, hx, equal, _⟩ := h + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨hn, hx⟩ +end BoundedFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def ownerLevelPrefixFamily (P B levels : ZFSet.{u}) : ZFSet.{u} := + M.relationFiberFamily ZFSet.omega B (ownerLevelPrefixPoints P B levels) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable {P B levels : ZFSet.{u}} (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hLevels : levels ∈ M.sets) +include pairing unions powers separation infinite hP hB hLevels + +theorem ownerLevelPrefixPoints_mem : ownerLevelPrefixPoints P B levels ∈ M.sets := by + have hOmega := M.omega_mem separation infinite + let params := extend P (extend B (extend levels (extend ZFSet.omega Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.ownerLevelPrefixPointFormula 0 1 2 3 4) params + (Fin.cases hP (Fin.cases hB (Fin.cases hLevels (Fin.cases hOmega (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation hOmega hB) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.ownerLevelPrefixPointFormula 0 1 2 3 4) (extend z params)) + (ZFSet.prod ZFSet.omega B) = ownerLevelPrefixPoints P B levels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_ownerLevelPrefixPointFormula _ _ _ _ _ _ rfl] + exact ⟨And.right, fun h => ⟨(ZFSet.mem_sep.1 h).1, h⟩⟩ + exact equal ▸ selected + +theorem ownerLevelPrefix_mem (subset : P ⊆ B) {n : ZFSet.{u}} (hn : n ∈ ZFSet.omega) : + ownerLevelPrefix P B levels n ∈ M.sets := by + rw [← ownerLevelPrefixPoints_fiber subset hn] + exact M.relationFiber_mem separation hB (M.ownerLevelPrefixPoints_mem pairing unions powers separation infinite hP hB hLevels) + (M.transitive (M.omega_mem separation infinite) hn) + +theorem ownerLevelPrefixFamily_spec (subset : P ⊆ B) : + M.ownerLevelPrefixFamily P B levels ∈ M.sets ∧ + FunctionGraphOn ZFSet.omega (M.ownerLevelPrefixFamily P B levels) ∧ + ∀ n S, ZFSet.pair n S ∈ M.ownerLevelPrefixFamily P B levels ↔ + n ∈ ZFSet.omega ∧ S = ownerLevelPrefix P B levels n := by + have hOmega := M.omega_mem separation infinite + have hPoints := M.ownerLevelPrefixPoints_mem pairing unions powers separation infinite hP hB hLevels + refine ⟨M.relationFiberFamily_mem pairing unions powers separation hOmega hB hPoints, + ⟨M.groundPower B, M.relationFiberFamily_function separation hOmega hB hPoints⟩, ?_⟩ + intro n S + change ZFSet.pair n S ∈ M.relationFiberFamily _ _ _ ↔ _ + rw [M.relationFiberFamily_entries separation hOmega hB hPoints] + exact ⟨fun h => ⟨h.1, h.2.trans (ownerLevelPrefixPoints_fiber subset h.1)⟩, + fun h => ⟨h.1, h.2.trans (ownerLevelPrefixPoints_fiber subset h.1).symm⟩⟩ + +end TransitiveGround + + + + + +theorem PartialOrderCode.heightOrderRestriction {B Q r : ZFSet.{u}} + (order : PartialOrderCode B r) (subset : Q ⊆ B) : + PartialOrderCode Q (heightOrderRestriction Q r) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_, ?_, ?_⟩ + · intro x hx + exact (pair_mem_heightOrderRestriction _ _ _ _).2 ⟨order.refl x (subset hx), hx, hx⟩ + · intro x hx y hy xy yx + exact order.antisymm x (subset hx) y (subset hy) (ZFSet.mem_sep.1 xy).1 (ZFSet.mem_sep.1 yx).1 + · intro x hx y hy z hz xy yz + exact (pair_mem_heightOrderRestriction _ _ _ _).2 + ⟨order.trans x (subset hx) y (subset hy) z (subset hz) (ZFSet.mem_sep.1 xy).1 (ZFSet.mem_sep.1 yz).1, hx, hz⟩ + +theorem MeetOrderCode.restrict_lower {B Q r μ : ZFSet.{u}} + (meet : MeetOrderCode B r μ) (subset : Q ⊆ B) + (lower : ∀ x ∈ B, ∀ y ∈ Q, ZFSet.pair x y ∈ r → x ∈ Q) : + MeetOrderCode Q (heightOrderRestriction Q r) (graphRestriction (ZFSet.prod Q Q) μ) := by + have productSubset : ZFSet.prod Q Q ⊆ ZFSet.prod B B := by + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz + exact ZFSet.pair_mem_prod.2 ⟨subset hx, subset hy⟩ + have function := (show FunctionGraphOn (ZFSet.prod B B) μ from ⟨B, meet.operation⟩).restrict productSubset + have result : ∀ x y z, ZFSet.pair (ZFSet.pair x y) z ∈ graphRestriction (ZFSet.prod Q Q) μ → z ∈ Q := by + intro x y z entry + obtain ⟨entry, domain⟩ := pair_mem_graphRestriction.1 entry + exact lower z (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2 + x (ZFSet.pair_mem_prod.1 domain).1 (meet.lower_left x y z entry) + refine ⟨meet.order.heightOrderRestriction subset, ⟨?_, function.to_isFunc.2⟩, ?_, ?_, ?_⟩ + · intro z hz + obtain ⟨a, ha, w, rfl, _⟩ := mem_graphRestriction.1 hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ha + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, result x y w hz⟩ + · intro x y z entry + have domain := ZFSet.pair_mem_prod.1 (pair_mem_graphRestriction.1 entry).2 + exact (pair_mem_heightOrderRestriction _ _ _ _).2 + ⟨meet.lower_left x y z (pair_mem_graphRestriction.1 entry).1, result x y z entry, domain.1⟩ + · intro x y z entry + have domain := ZFSet.pair_mem_prod.1 (pair_mem_graphRestriction.1 entry).2 + exact (pair_mem_heightOrderRestriction _ _ _ _).2 + ⟨meet.lower_right x y z (pair_mem_graphRestriction.1 entry).1, result x y z entry, domain.2⟩ + · intro x y z w hw entry left right + exact (pair_mem_heightOrderRestriction _ _ _ _).2 + ⟨meet.greatest x y z w (subset hw) (pair_mem_graphRestriction.1 entry).1 + (ZFSet.mem_sep.1 left).1 (ZFSet.mem_sep.1 right).1, hw, result x y z entry⟩ + +theorem StrictLexHeightCode.restrict_order {B Q C D r height rD : ZFSet.{u}} + (code : StrictLexHeightCode B C D r height rD) (subset : Q ⊆ B) : + StrictLexHeightCode Q C D (heightOrderRestriction Q r) (graphRestriction Q height) rD := by + have function := (show FunctionGraphOn B height from ⟨ZFSet.prod C D, code.function⟩).restrict subset + refine ⟨⟨?_, function.to_isFunc.2⟩, ?_⟩ + · intro z hz + obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz + exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2⟩ + · intro x hx y hy c q d v lower distinct first second + exact code.strict x (subset hx) y (subset hy) c q d v (ZFSet.mem_sep.1 lower).1 distinct + (pair_mem_graphRestriction.1 first).1 (pair_mem_graphRestriction.1 second).1 + +theorem ownerLevelPrefix_codes {P B levels r μ C D height rD n : ZFSet.{u}} + (subset : P ⊆ B) (hn : n ∈ ZFSet.omega) + (oldLower : ∀ x ∈ B, ∀ y ∈ P, ZFSet.pair x y ∈ r → x ∈ P) + (function : ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) ZFSet.omega levels) + (monotone : ∀ x ∈ B, x ∉ P → ∀ y ∈ B, y ∉ P → ∀ k l, + ZFSet.pair x k ∈ levels → ZFSet.pair y l ∈ levels → ZFSet.pair x y ∈ r → k = l ∨ k ∈ l) + (meet : MeetOrderCode B r μ) (code : StrictLexHeightCode B C D r height rD) : + let Q := ownerLevelPrefix P B levels n + MeetOrderCode Q (heightOrderRestriction Q r) (graphRestriction (ZFSet.prod Q Q) μ) ∧ + StrictLexHeightCode Q C D (heightOrderRestriction Q r) (graphRestriction Q height) rD := by + exact ⟨meet.restrict_lower (ownerLevelPrefix_subset subset levels n) + (ownerLevelPrefix_lower hn oldLower function monotone), + code.restrict_order (ownerLevelPrefix_subset subset levels n)⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem heightOrderRestriction_mem {Q r : ZFSet.{u}} (hQ : Q ∈ M.sets) (hr : r ∈ M.sets) : + heightOrderRestriction Q r ∈ M.sets := by + have hProduct := M.prod_mem pairing unions powers separation hQ hQ + exact M.bounded_separation_mem separation (.mem 0 1) (extend (ZFSet.prod Q Q) Fin.elim0) + (Fin.cases hProduct (fun i => Fin.elim0 i)) hr + +theorem ownerLevelPrefix_fields_mem + (infinite : Realize M.sets infinity Fin.elim0) + {P B levels r μ height n : ZFSet.{u}} + (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hLevels : levels ∈ M.sets) + (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hHeight : height ∈ M.sets) + (subset : P ⊆ B) (hn : n ∈ ZFSet.omega) : + let Q := ownerLevelPrefix P B levels n + Q ∈ M.sets ∧ heightOrderRestriction Q r ∈ M.sets ∧ + graphRestriction (ZFSet.prod Q Q) μ ∈ M.sets ∧ graphRestriction Q height ∈ M.sets := by + have hQ := M.ownerLevelPrefix_mem pairing unions powers separation infinite hP hB hLevels subset hn + exact ⟨hQ, M.heightOrderRestriction_mem pairing unions powers separation hQ hr, + M.graphRestriction_mem unions separation (M.prod_mem pairing unions powers separation hQ hQ) hμ, + M.graphRestriction_mem unions separation hQ hHeight⟩ + +end TransitiveGround + + + + + +noncomputable def chronologyRestriction (kind : Fin 3) (P f : ZFSet.{u}) : ZFSet.{u} := + Fin.cases (graphRestriction P f) (Fin.cases (heightOrderRestriction P f) + (fun _ => graphRestriction (ZFSet.prod P P) f)) kind + +namespace BoundedFormula + +def chronologyRestrictionMemberFormula (kind : Fin 3) {n} (z P R : Fin n) : BoundedFormula n := + Fin.cases (productElementFormula z P R) (Fin.cases (productElementFormula z P P) + (fun _ => exMem R (exMem R.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (productElementFormula 1 P.succ.succ P.succ.succ))))) kind + +theorem truth_chronologyRestrictionMemberFormula (kind : Fin 3) {n} + (z P R : Fin n) (env : Fin n → ZFSet.{u}) {f : ZFSet.{u}} + (bound : env R = ZFSet.sUnion (ZFSet.sUnion f)) (member : env z ∈ f) : + Truth (chronologyRestrictionMemberFormula kind z P R) env ↔ + env z ∈ chronologyRestriction kind (env P) f := by + refine Fin.cases ?_ (Fin.cases ?_ (fun _ => ?_)) kind + · simp only [chronologyRestrictionMemberFormula, chronologyRestriction, Fin.cases_zero, + truth_productElementFormula, graphRestriction, ZFSet.mem_sep, member, true_and, bound] + · simp only [chronologyRestrictionMemberFormula, chronologyRestriction, Fin.cases_succ, + Fin.cases_zero, truth_productElementFormula, heightOrderRestriction, ZFSet.mem_sep, member, true_and] + · simp only [chronologyRestrictionMemberFormula, chronologyRestriction, Fin.cases_succ, + truth_exMem, Truth, truth_orderedPairFormula, truth_productElementFormula] + change (∃ a ∈ env R, ∃ b ∈ env R, env z = ZFSet.pair a b ∧ a ∈ ZFSet.prod (env P) (env P)) ↔ _ + constructor + · rintro ⟨a, _, b, _, equal, ha⟩ + rw [equal] at member ⊢ + exact pair_mem_graphRestriction.2 ⟨member, ha⟩ + · intro entry + obtain ⟨a, ha, b, equal, pair⟩ := mem_graphRestriction.1 entry + exact ⟨a, bound.symm ▸ pair_first_mem_doubleUnion pair, + b, bound.symm ▸ pair_second_mem_doubleUnion pair, equal, ha⟩ + +def chronologyRestrictionFormula (kind : Fin 3) {n} (q P R f : Fin n) : BoundedFormula n := + .conj (.allMem q (.conj (.mem 0 f.succ) (chronologyRestrictionMemberFormula kind 0 P.succ R.succ))) + (.allMem f (imp (chronologyRestrictionMemberFormula kind 0 P.succ R.succ) (.mem 0 q.succ))) + +theorem truth_chronologyRestrictionFormula (kind : Fin 3) {n} + (q P R f : Fin n) (env : Fin n → ZFSet.{u}) (bound : env R = ZFSet.sUnion (ZFSet.sUnion (env f))) : + Truth (chronologyRestrictionFormula kind q P R f) env ↔ + env q = chronologyRestriction kind (env P) (env f) := by + have subset : chronologyRestriction kind (env P) (env f) ⊆ env f := by + exact Fin.cases (graphRestriction_subset _ _) + (Fin.cases (fun _ hz => (ZFSet.mem_sep.1 hz).1) + (fun _ => graphRestriction_subset _ _)) kind + simp only [chronologyRestrictionFormula, Truth, truth_imp] + constructor + · rintro ⟨forward, backward⟩ + apply ZFSet.ext + intro z + constructor + · intro hz + exact (truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ (extend z env) + bound (forward z hz).1).1 (forward z hz).2 + · intro hz + exact backward z (subset hz) ((truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ + (extend z env) bound (subset hz)).2 hz) + · intro equal + change (∀ z ∈ env q, z ∈ env f ∧ _) ∧ (∀ z ∈ env f, _ → z ∈ env q) + rw [equal] + exact ⟨fun z hz => ⟨subset hz, (truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ + (extend z env) bound (subset hz)).2 hz⟩, + fun z hz recognized => (truth_chronologyRestrictionMemberFormula kind 0 P.succ R.succ + (extend z env) bound hz).1 recognized⟩ + +def chronologyRestrictionFamilyFormula (kind : Fin 3) {n} + (z I Ps Q R W f : Fin n) : BoundedFormula n := + exMem I (exMem Q.succ (exMem W.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 0) + (.conj (pairMembershipFormula 2 1 Ps.succ.succ.succ) + (chronologyRestrictionFormula kind 0 1 R.succ.succ.succ f.succ.succ.succ))))) + +theorem truth_chronologyRestrictionFamilyFormula (kind : Fin 3) {n} + (z I Ps Q R W f : Fin n) (env : Fin n → ZFSet.{u}) (bound : env R = ZFSet.sUnion (ZFSet.sUnion (env f))) : + Truth (chronologyRestrictionFamilyFormula kind z I Ps Q R W f) env ↔ + ∃ i ∈ env I, ∃ P ∈ env Q, ∃ q ∈ env W, env z = ZFSet.pair i q ∧ + ZFSet.pair i P ∈ env Ps ∧ q = chronologyRestriction kind P (env f) := by + have meaning (i P q : ZFSet.{u}) := + truth_chronologyRestrictionFormula kind 0 1 R.succ.succ.succ f.succ.succ.succ + (extend q (extend P (extend i env))) bound + simp only [chronologyRestrictionFamilyFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, meaning] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def chronologyRestrictionFamily (kind : Fin 3) (I Ps f : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ P ∈ ZFSet.sUnion (ZFSet.sUnion Ps), ∃ q ∈ M.groundPower f, + z = ZFSet.pair i q ∧ ZFSet.pair i P ∈ Ps ∧ q = chronologyRestriction kind P f) + (ZFSet.prod I (M.groundPower f)) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem chronologyRestriction_mem (kind : Fin 3) {P f : ZFSet.{u}} + (hP : P ∈ M.sets) (hf : f ∈ M.sets) : chronologyRestriction kind P f ∈ M.sets := by + exact Fin.cases (M.graphRestriction_mem unions separation hP hf) + (Fin.cases (M.heightOrderRestriction_mem pairing unions powers separation hP hf) + (fun _ => M.graphRestriction_mem unions separation + (M.prod_mem pairing unions powers separation hP hP) hf)) kind + +theorem chronologyRestrictionFamily_mem (kind : Fin 3) {I Ps f : ZFSet.{u}} + (hI : I ∈ M.sets) (hPs : Ps ∈ M.sets) (hf : f ∈ M.sets) : + M.chronologyRestrictionFamily kind I Ps f ∈ M.sets := by + have hW := M.groundPower_mem powers hf + let params := extend I (extend Ps (extend (ZFSet.sUnion (ZFSet.sUnion Ps)) (extend (ZFSet.sUnion (ZFSet.sUnion f)) + (extend (M.groundPower f) (extend f Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.chronologyRestrictionFamilyFormula kind 0 1 2 3 4 5 6) params + (Fin.cases hI (Fin.cases hPs (Fin.cases (M.union_mem unions (M.union_mem unions hPs)) + (Fin.cases (M.union_mem unions (M.union_mem unions hf)) (Fin.cases hW + (Fin.cases hf (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hI hW) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.chronologyRestrictionFamilyFormula kind 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod I (M.groundPower f)) = M.chronologyRestrictionFamily kind I Ps f := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, chronologyRestrictionFamily, ZFSet.mem_sep, + BoundedFormula.truth_chronologyRestrictionFamilyFormula kind _ _ _ _ _ _ _ _ rfl] + rfl + exact equal ▸ selected + +theorem chronologyRestrictionFamily_entries (kind : Fin 3) {I Ps f : ZFSet.{u}} + (hPs : Ps ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I Ps) + {i P : ZFSet.{u}} (entry : ZFSet.pair i P ∈ Ps) (q : ZFSet.{u}) : + ZFSet.pair i q ∈ M.chronologyRestrictionFamily kind I Ps f ↔ + q = chronologyRestriction kind P f := by + constructor + · intro member + obtain ⟨_, j, _, Q, _, w, _, equal, input, output⟩ := ZFSet.mem_sep.1 member + obtain ⟨rfl,rfl⟩ := ZFSet.pair_inj.1 equal + exact function.unique input entry ▸ output + · intro equal + have hP := M.pair_right (M.transitive hPs entry) + have subset : chronologyRestriction kind P f ⊆ f := by + exact Fin.cases (graphRestriction_subset _ _) + (Fin.cases (fun _ hz => (ZFSet.mem_sep.1 hz).1) + (fun _ => graphRestriction_subset _ _)) kind + have bound := (M.mem_groundPower f q).2 ⟨equal.symm ▸ + M.chronologyRestriction_mem pairing unions powers separation kind hP hf, + fun z hz => subset (equal ▸ hz)⟩ + have hi := (ZFSet.pair_mem_prod.1 (function.to_isFunc.1 entry)).1 + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi,bound⟩, i,hi,P, + pair_second_mem_doubleUnion entry,q,bound,rfl,entry,equal⟩ + +theorem chronologyRestrictionFamily_function (kind : Fin 3) {I Ps f : ZFSet.{u}} + (hPs : Ps ∈ M.sets) (hf : f ∈ M.sets) (function : FunctionGraphOn I Ps) : + ZFSet.IsFunc I (M.groundPower f) (M.chronologyRestrictionFamily kind I Ps f) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro i hi + obtain ⟨P, entry, _⟩ := function.to_isFunc.2 i hi + have exactEntries := M.chronologyRestrictionFamily_entries pairing unions powers separation kind hPs hf function entry + exact ⟨chronologyRestriction kind P f, (exactEntries _).2 rfl, fun q hq => (exactEntries q).1 hq⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "r" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 + +noncomputable def cutoff (_births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) (n : Nat) : ZFSet.{u} := + ownerLevelPrefix P B levels (natSetCode n) + +noncomputable def cutoffFamily (_births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) : ZFSet.{u} := + M.ownerLevelPrefixFamily P B levels + +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +noncomputable def cutoffOrder (n : Nat) : ZFSet.{u} := heightOrderRestriction (births.cutoff n) r +noncomputable def cutoffMeet (n : Nat) : ZFSet.{u} := graphRestriction (ZFSet.prod (births.cutoff n) (births.cutoff n)) μ +noncomputable def cutoffBirth (n : Nat) : ZFSet.{u} := graphRestriction (births.cutoff n) births.birth +noncomputable def cutoffHeight (height : ZFSet.{u}) (n : Nat) : ZFSet.{u} := graphRestriction (births.cutoff n) height + +theorem cutoff_old (n : Nat) : P ⊆ births.cutoff n := ownerLevelPrefix_old _ _ _ _ + +theorem cutoff_subset (n : Nat) : births.cutoff n ⊆ B := + ownerLevelPrefix_subset (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) levels (natSetCode n) + +theorem cutoff_mono {n k : Nat} (before : n ≤ k) : births.cutoff n ⊆ births.cutoff k := by + apply ownerLevelPrefix_mono (natSetCode_mem_omega n) (natSetCode_mem_omega k) + rcases Nat.lt_or_eq_of_le before with less | same + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + +theorem cutoff_union + (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) (x : ZFSet.{u}) : + x ∈ B ↔ ∃ n : Nat, x ∈ births.cutoff n := + ownerLevelPrefix_union (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) levelFunction x + +theorem cutoff_birth_function (n : Nat) : + ZFSet.IsFunc (births.cutoff n) births.limit (births.cutoffBirth n) := by + have restricted := (show FunctionGraphOn B births.birth from ⟨births.limit, births.function⟩).restrict (births.cutoff_subset n) + apply isFunc_retarget_of_entries restricted.to_isFunc + intro x t entry + exact (ZFSet.pair_mem_prod.1 (births.function.1 (pair_mem_graphRestriction.1 entry).1)).2 + +theorem cutoff_old_meet (n : Nat) : OldMeetCode (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) := by + intro x y z a b c ya xb before notLower xy zc + have hx := (pair_mem_graphRestriction.1 xb).2 + have hy := (pair_mem_graphRestriction.1 ya).2 + exact births.old_meet x y z a b c (pair_mem_graphRestriction.1 ya).1 (pair_mem_graphRestriction.1 xb).1 before + (fun lower => notLower ((pair_mem_heightOrderRestriction _ _ _ _).2 ⟨lower, hx, hy⟩)) + (pair_mem_graphRestriction.1 xy).1 (pair_mem_graphRestriction.1 zc).1 + +theorem cutoff_birth_bound + (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) + (n : Nat) {x t : ZFSet.{u}} (entry : ZFSet.pair x t ∈ births.cutoffBirth n) : + t ∈ compressionStamp oldTimes n ∨ t = compressionStamp oldTimes n := by + classical + obtain ⟨entry, hx⟩ := pair_mem_graphRestriction.1 entry + by_cases old : x ∈ P + · exact Or.inl (births.old_before ((ownerBirthGraph_old_iff old).1 entry) n) + · obtain ⟨_, k, hk, level, bound⟩ := (mem_ownerLevelPrefix_fresh old).1 hx + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + obtain ⟨_, _, j, actualLevel, stamp⟩ := (ownerBirthGraph_fresh_nat_iff births.seed_function old).1 entry + have equal : j = k := natSetCode_injective + ((show FunctionGraphOn (ownerFresh P B) levels from ⟨ZFSet.omega, levelFunction⟩).unique actualLevel level) + subst j + rw [(births.times.entries k t).1 stamp] + rcases bound with same | before + · exact Or.inr (congrArg (compressionStamp oldTimes) (natSetCode_injective same)) + · exact Or.inl ((compressionStamp_mem_iff oldTimes k n).2 ((natSetCode_mem_iff _ _).1 before)) + +variable {inv : ZFSet.{u}} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +include data group action pairing unions powers separation infinite hG hP0 + +theorem cutoffFamily_spec : births.cutoffFamily ∈ M.sets ∧ FunctionGraphOn ZFSet.omega births.cutoffFamily ∧ + ∀ n : Nat, ∀ Q, ZFSet.pair (natSetCode n) Q ∈ births.cutoffFamily ↔ Q = births.cutoff n := by + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + have hSeed := data.externalSeedCarrier_ground group action pairing unions powers separation infinite hG hP0 + have hLevels := (data.externalOwnerLevels_ground_function group action pairing unions powers separation infinite hG hP0).1 + have spec := M.ownerLevelPrefixFamily_spec pairing unions powers separation infinite hSeed geometry.carrier_ground hLevels + (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) + exact ⟨spec.1, spec.2.1, fun n Q => (spec.2.2 (natSetCode n) Q).trans (and_iff_right (natSetCode_mem_omega n))⟩ + +theorem cutoff_lower (n : Nat) : + ∀ x ∈ B, ∀ y ∈ births.cutoff n, ZFSet.pair x y ∈ r → x ∈ births.cutoff n := by + have levelFunction := (data.externalOwnerLevels_ground_function group action pairing unions powers separation infinite hG hP0).2 + apply ownerLevelPrefix_lower (natSetCode_mem_omega n) + (fun _ hx _ hy lower => data.externalSeedCarrier_lower group action pairing unions powers separation infinite hG hx hy lower) levelFunction + intro x _ _ y _ _ k l first second lower + have hk := (ZFSet.pair_mem_prod.1 (levelFunction.1 first)).2 + have hl := (ZFSet.pair_mem_prod.1 (levelFunction.1 second)).2 + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode l).1 hl + have before := data.externalOwnerLevels_monotone group action pairing unions powers separation infinite hG hP0 lower first second + rcases Nat.lt_or_eq_of_le before with less | same + · exact Or.inr ((natSetCode_mem_iff _ _).2 less) + · exact Or.inl (congrArg natSetCode same) + +theorem cutoff_fields {C D rD lo hi seed : ZFSet.{u}} + (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 C D rD lo hi seed completion) + (n : Nat) : + births.cutoff n ∈ M.sets ∧ births.cutoffOrder n ∈ M.sets ∧ births.cutoffMeet n ∈ M.sets ∧ + births.cutoffBirth n ∈ M.sets ∧ births.cutoffHeight heights.height n ∈ M.sets ∧ + MeetOrderCode (births.cutoff n) (births.cutoffOrder n) (births.cutoffMeet n) ∧ + ZFSet.IsFunc (births.cutoff n) births.limit (births.cutoffBirth n) ∧ + OldMeetCode (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) ∧ + StrictLexHeightCode (births.cutoff n) C D (births.cutoffOrder n) (births.cutoffHeight heights.height n) rD ∧ + ∀ x t, ZFSet.pair x t ∈ births.cutoffBirth n → t ∈ compressionStamp oldTimes n ∨ t = compressionStamp oldTimes n := by + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + have levelCode := data.externalOwnerLevels_ground_function group action pairing unions powers separation infinite hG hP0 + have hSeed := data.externalSeedCarrier_ground group action pairing unions powers separation infinite hG hP0 + have hQ := M.ownerLevelPrefix_mem pairing unions powers separation infinite hSeed geometry.carrier_ground levelCode.1 + (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) (natSetCode_mem_omega n) + refine ⟨hQ, M.heightOrderRestriction_mem pairing unions powers separation hQ geometry.order_ground, + M.graphRestriction_mem unions separation (M.prod_mem pairing unions powers separation hQ hQ) geometry.meet_ground, + M.graphRestriction_mem unions separation hQ births.birth_ground, + M.graphRestriction_mem unions separation hQ heights.height_ground, + geometry.meet.restrict_lower (births.cutoff_subset n) + (births.cutoff_lower data group action pairing unions powers separation infinite hG hP0 n), + births.cutoff_birth_function n, births.cutoff_old_meet n, + heights.code.restrict_order (births.cutoff_subset n), ?_⟩ + intro x t entry + exact births.cutoff_birth_bound levelCode.2 n entry + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 + +theorem cutoff_iff_birth_le_stamp (n : Nat) {x a : ZFSet.{u}} + (entry : ZFSet.pair x a ∈ births.birth) : + x ∈ births.cutoff n ↔ a ∈ compressionStamp oldTimes n ∨ a = compressionStamp oldTimes n := by + have function : FunctionGraphOn B births.birth := ⟨births.limit, births.function⟩ + constructor + · intro member + rcases (mem_ownerLevelPrefix _ _ _ _ _).1 member with old | ⟨hx, fresh, k, hk, level, bound⟩ + · exact Or.inl (births.old_before ((ownerBirthGraph_old_iff old).1 entry) n) + · obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + have atStamp := (births.stamp_fiber k x).2 ⟨(mem_ownerFresh P B x).2 ⟨hx, fresh⟩, level⟩ + rw [function.unique entry atStamp] + rcases bound with same | before + · exact Or.inr (congrArg (compressionStamp oldTimes) (natSetCode_injective same)) + · exact Or.inl ((compressionStamp_mem_iff oldTimes k n).2 ((natSetCode_mem_iff k n).1 before)) + · intro bound + by_cases old : x ∈ P + · exact births.cutoff_old n old + · obtain ⟨hx, _, k, level, stamp⟩ := (ownerBirthGraph_fresh_nat_iff births.seed_function old).1 entry + have actual := (births.times.entries k a).1 stamp + refine (mem_ownerLevelPrefix _ _ _ _ _).2 (Or.inr ⟨hx, old, natSetCode k, + natSetCode_mem_omega k, level, ?_⟩) + rcases bound with before | same + · exact Or.inr ((natSetCode_mem_iff k n).2 ((compressionStamp_mem_iff oldTimes k n).1 (actual ▸ before))) + · have atN : ZFSet.pair (natSetCode n) a ∈ births.stamps := (births.times.entries n a).2 same + exact Or.inl (congrArg natSetCode (births.times.ownerStampCode.injective stamp atN)) + +theorem point_in_birth_cutoff {n : Nat} {x : ZFSet.{u}} + (entry : ZFSet.pair x (compressionStamp oldTimes n) ∈ births.birth) : x ∈ births.cutoff n := + (births.cutoff_iff_birth_le_stamp n entry).2 (Or.inr rfl) + +theorem fresh_birth_cutoff_iff {n : Nat} {x : ZFSet.{u}} + (entry : ZFSet.pair x (compressionStamp oldTimes n) ∈ births.birth) (k : Nat) : + x ∈ births.cutoff k ↔ n ≤ k := by + rw [births.cutoff_iff_birth_le_stamp k entry] + constructor + · rintro (before | same) + · exact Nat.le_of_lt ((compressionStamp_mem_iff oldTimes n k).1 before) + · have first := (births.times.entries n _).2 rfl + have second := (births.times.entries k _).2 same + exact Nat.le_of_eq (births.times.ownerStampCode.injective first second) + · intro before + rcases Nat.lt_or_eq_of_le before with before | same + · exact Or.inl ((compressionStamp_mem_iff oldTimes n k).2 before) + · exact Or.inr (congrArg (compressionStamp oldTimes) same) + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundChronologicalHistory M T0 C D rD) + +noncomputable def chronologyFields : CompressionChronologyFields.{u} where + space := compressionPrefixValue oldTimes births.limit prior.space births.cutoff + (completion.externalPointCarrier P0 r0 μ0 A0) + order := compressionPrefixValue oldTimes births.limit prior.order births.cutoffOrder + (completion.externalPointOrder P0 r0 μ0 A0) + meetGraph := compressionPrefixValue oldTimes births.limit prior.meetGraph births.cutoffMeet + (completion.externalPointMeet P0 r0 μ0 A0) + birth := compressionPrefixValue oldTimes births.limit prior.birth births.cutoffBirth births.birth + height := compressionPrefixValue oldTimes births.limit prior.height (births.cutoffHeight heights.height) heights.height + +theorem chronologyFields_old {s : ZFSet.{u}} (before : s ∈ oldTimes ∨ s = oldTimes) : + (births.chronologyFields heights prior).space s = prior.space s ∧ + (births.chronologyFields heights prior).order s = prior.order s ∧ + (births.chronologyFields heights prior).meetGraph s = prior.meetGraph s ∧ + (births.chronologyFields heights prior).birth s = prior.birth s ∧ + (births.chronologyFields heights prior).height s = prior.height s := by + dsimp only [chronologyFields] + exact ⟨compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before, + compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before, + compressionPrefixValue_old _ _ _ before⟩ + +theorem chronologyFields_stamp (n : Nat) : + (births.chronologyFields heights prior).space (compressionStamp oldTimes n) = births.cutoff n ∧ + (births.chronologyFields heights prior).order (compressionStamp oldTimes n) = births.cutoffOrder n ∧ + (births.chronologyFields heights prior).meetGraph (compressionStamp oldTimes n) = births.cutoffMeet n ∧ + (births.chronologyFields heights prior).birth (compressionStamp oldTimes n) = births.cutoffBirth n ∧ + (births.chronologyFields heights prior).height (compressionStamp oldTimes n) = births.cutoffHeight heights.height n := by + dsimp only [chronologyFields] + exact ⟨compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n, + compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n, + compressionPrefixValue_stamp _ _ _ births.times n⟩ + +theorem chronologyFields_limit : + (births.chronologyFields heights prior).space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 ∧ + (births.chronologyFields heights prior).order births.limit = completion.externalPointOrder P0 r0 μ0 A0 ∧ + (births.chronologyFields heights prior).meetGraph births.limit = completion.externalPointMeet P0 r0 μ0 A0 ∧ + (births.chronologyFields heights prior).birth births.limit = births.birth ∧ + (births.chronologyFields heights prior).height births.limit = heights.height := by + dsimp only [chronologyFields] + exact ⟨compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times, + compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times, + compressionPrefixValue_limit _ _ _ births.times⟩ + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundChronologicalHistory M T0 C D rD) + +theorem chronologyFields_stage_laws + (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) + (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) + (ordinal : ordinalSetProperty T0) (hOld : oldTimes ∈ T0) + {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : + let fields := births.chronologyFields heights prior + MeetOrderCode (fields.space s) (fields.order s) (fields.meetGraph s) ∧ + ZFSet.IsFunc (fields.space s) (insert births.limit births.limit) (fields.birth s) ∧ + (∀ x ∈ fields.space s, ∀ t, ZFSet.pair x t ∈ fields.birth s → t = s ∨ t ∈ s) ∧ + OldMeetCode (fields.order s) (fields.meetGraph s) (fields.birth s) ∧ + StrictLexHeightCode (fields.space s) C D (fields.order s) (fields.height s) rD := by + classical + dsimp only + by_cases before : s ∈ oldTimes ∨ s = oldTimes + · have hs := before.elim (fun member => ordinal.1 oldTimes hOld s member) + (fun equal => equal.symm ▸ hOld) + obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_old heights prior before + rw [space, order, meet, birth, height] + exact ⟨prior.meet_order s hs, + prior.prefix_birth_function_successor births.times ordinal hOld before, + prior.birth_bound s hs, prior.old_meet s hs, prior.strict_height s hs⟩ + · rcases ZFSet.mem_insert_iff.1 cutoff with rfl | below + · obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_limit heights prior + rw [space, order, meet, birth, height] + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + exact ⟨geometry.meet, isFunc_retarget_of_entries births.function + (fun _ _ entry => ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2), + fun _ _ _ entry => Or.inr (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2, + births.old_meet, heights.code⟩ + · have stamped : ∃ n, s = compressionStamp oldTimes n := by + rcases (births.times.mem_limit_iff s).1 below with member | equal | stamped + · exact False.elim (before (Or.inl member)) + · exact False.elim (before (Or.inr equal)) + · exact stamped + obtain ⟨n, rfl⟩ := stamped + obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_stamp heights prior n + rw [space, order, meet, birth, height] + have fields := births.cutoff_fields data group action pairing unions powers separation infinite hG hP0 heights n + obtain ⟨_, _, _, _, _, meetCode, born, oldMeet, strict, bound⟩ := fields + exact ⟨meetCode, isFunc_retarget_of_entries born + (fun _ _ entry => ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.1 (born.1 entry)).2), + fun x _ t entry => (bound x t entry).symm, oldMeet, strict⟩ + +end PartitionPilot.Forcing.GroundExternalBirthData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalRequestRankBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalRequestRankBounds.lean index 36a10a09942c70fb059c4a0657e6483a0491144d..ad04529082d2570d8eca739c93e561f8164c178e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalRequestRankBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/ExternalRequestRankBounds.lean @@ -1,64 +1,64 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialExternalGroup - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include limit - -theorem externalRectangleBound_rank_lt {P G : ZFSet.{u}} - (points : ZFSet.rank P < o) (actors : ZFSet.rank G < o) : - ZFSet.rank (externalRectangleBound P G) < o := - rank_product_lt limit points (rank_product_lt limit points - (rank_product_lt limit points (rank_product_lt limit actors actors))) - -theorem externalRectangles_rank_lt {P G : ZFSet.{u}} (r μ A : ZFSet.{u}) - (points : ZFSet.rank P < o) (actors : ZFSet.rank G < o) : - ZFSet.rank (externalRectangles P G r μ A) < o := - (ZFSet.rank_mono (show externalRectangles P G r μ A ⊆ externalRectangleBound P G from - fun _ hx => (ZFSet.mem_sep.1 hx).1)).trans_lt - (externalRectangleBound_rank_lt limit points actors) - -theorem externalRequestCarrier_rank_lt {I P Rectangles : ZFSet.{u}} - (indices : ZFSet.rank I < o) (points : ZFSet.rank P < o) - (rectangles : ZFSet.rank Rectangles < o) : - ZFSet.rank (externalRequestCarrier I P Rectangles) < o := by - have tag := fun n => rank_singleton_lt limit (rank_natSetCode_lt limit n) - rw [externalRequestCarrier, ZFSet.rank_union, ZFSet.rank_union] - exact max_lt (max_lt (rank_product_lt limit (tag 0) indices) - (rank_product_lt limit (tag 1) points)) (rank_product_lt limit (tag 2) rectangles) - -theorem externalChildLetters_rank_lt {I P Rectangles : ZFSet.{u}} - (indices : ZFSet.rank I < o) (points : ZFSet.rank P < o) - (rectangles : ZFSet.rank Rectangles < o) : - ZFSet.rank (externalChildLetters I P Rectangles) < o := by - have tag := fun n => rank_singleton_lt limit (rank_natSetCode_lt limit n) - rw [externalChildLetters, ZFSet.rank_union] - exact max_lt - (rank_product_lt limit (externalRequestCarrier_rank_lt limit indices points rectangles) (tag 0)) - (rank_product_lt limit (rank_product_lt limit (tag 2) rectangles) (tag 1)) - -theorem externalGeneratorAlphabet_rank_lt {G S : ZFSet.{u}} - (actors : ZFSet.rank G < o) (letters : ZFSet.rank S < o) : - ZFSet.rank (externalGeneratorAlphabet G S) < o := by - rw [externalGeneratorAlphabet, ZFSet.rank_union] - exact max_lt - (rank_product_lt limit (rank_singleton_lt limit (rank_natSetCode_lt limit 0)) actors) - (rank_product_lt limit (rank_singleton_lt limit (rank_natSetCode_lt limit 1)) - (rank_product_lt limit letters (rank_natSetCode_lt limit 2))) - -theorem externalRequestAlphabet_rank_lt {I P G : ZFSet.{u}} (r μ A : ZFSet.{u}) - (indices : ZFSet.rank I < o) (points : ZFSet.rank P < o) (actors : ZFSet.rank G < o) : - ZFSet.rank (externalRequestAlphabet I P G r μ A) < o := - externalGeneratorAlphabet_rank_lt limit actors - (externalChildLetters_rank_lt limit indices points (externalRectangles_rank_lt limit r μ A points actors)) - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialExternalGroup + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include limit + +theorem externalRectangleBound_rank_lt {P G : ZFSet.{u}} + (points : ZFSet.rank P < o) (actors : ZFSet.rank G < o) : + ZFSet.rank (externalRectangleBound P G) < o := + rank_product_lt limit points (rank_product_lt limit points + (rank_product_lt limit points (rank_product_lt limit actors actors))) + +theorem externalRectangles_rank_lt {P G : ZFSet.{u}} (r μ A : ZFSet.{u}) + (points : ZFSet.rank P < o) (actors : ZFSet.rank G < o) : + ZFSet.rank (externalRectangles P G r μ A) < o := + (ZFSet.rank_mono (show externalRectangles P G r μ A ⊆ externalRectangleBound P G from + fun _ hx => (ZFSet.mem_sep.1 hx).1)).trans_lt + (externalRectangleBound_rank_lt limit points actors) + +theorem externalRequestCarrier_rank_lt {I P Rectangles : ZFSet.{u}} + (indices : ZFSet.rank I < o) (points : ZFSet.rank P < o) + (rectangles : ZFSet.rank Rectangles < o) : + ZFSet.rank (externalRequestCarrier I P Rectangles) < o := by + have tag := fun n => rank_singleton_lt limit (rank_natSetCode_lt limit n) + rw [externalRequestCarrier, ZFSet.rank_union, ZFSet.rank_union] + exact max_lt (max_lt (rank_product_lt limit (tag 0) indices) + (rank_product_lt limit (tag 1) points)) (rank_product_lt limit (tag 2) rectangles) + +theorem externalChildLetters_rank_lt {I P Rectangles : ZFSet.{u}} + (indices : ZFSet.rank I < o) (points : ZFSet.rank P < o) + (rectangles : ZFSet.rank Rectangles < o) : + ZFSet.rank (externalChildLetters I P Rectangles) < o := by + have tag := fun n => rank_singleton_lt limit (rank_natSetCode_lt limit n) + rw [externalChildLetters, ZFSet.rank_union] + exact max_lt + (rank_product_lt limit (externalRequestCarrier_rank_lt limit indices points rectangles) (tag 0)) + (rank_product_lt limit (rank_product_lt limit (tag 2) rectangles) (tag 1)) + +theorem externalGeneratorAlphabet_rank_lt {G S : ZFSet.{u}} + (actors : ZFSet.rank G < o) (letters : ZFSet.rank S < o) : + ZFSet.rank (externalGeneratorAlphabet G S) < o := by + rw [externalGeneratorAlphabet, ZFSet.rank_union] + exact max_lt + (rank_product_lt limit (rank_singleton_lt limit (rank_natSetCode_lt limit 0)) actors) + (rank_product_lt limit (rank_singleton_lt limit (rank_natSetCode_lt limit 1)) + (rank_product_lt limit letters (rank_natSetCode_lt limit 2))) + +theorem externalRequestAlphabet_rank_lt {I P G : ZFSet.{u}} (r μ A : ZFSet.{u}) + (indices : ZFSet.rank I < o) (points : ZFSet.rank P < o) (actors : ZFSet.rank G < o) : + ZFSet.rank (externalRequestAlphabet I P G r μ A) < o := + externalGeneratorAlphabet_rank_lt limit actors + (externalChildLetters_rank_lt limit indices points (externalRectangles_rank_lt limit r μ A points actors)) + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FairPreparationBirthPersistence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FairPreparationBirthPersistence.lean index 0e0381527418752e24019b6c76c7c691d6890d69..fc2d75a17dda46a83125e86636d32303746730dd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FairPreparationBirthPersistence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FairPreparationBirthPersistence.lean @@ -1,63 +1,63 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFairPreparationMonotonicity - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem fairPreparation_birthPersistence - {Q E0 stages U enumSelector prepSelector gridGraph : ZFSet.{u}} - (function : ZFSet.IsFunc Q E0 enumSelector) - (clocks conditions births events enumerations : Nat → ZFSet.{u}) - (chosen : ∀ k, ZFSet.pair (conditions k) (enumerations k) ∈ enumSelector) - (initialClock : clocks 0 = ∅) - (initialBirths : births 0 = {ZFSet.pair ∅ (enumerations 0)}) - (steps : ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U - enumSelector prepSelector gridGraph - (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) (ZFSet.pair (births k) (events k)))) - (ZFSet.pair (clocks (k + 1)) - (ZFSet.pair (conditions (k + 1)) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) : - ∀ k, clocks k = natSetCode k ∧ births k = finiteStageHistory enumerations (k + 1) ∧ - (∀ i y, ZFSet.pair (natSetCode i) y ∈ births k ↔ i ≤ k ∧ y = enumerations i) ∧ - ∀ y, ZFSet.pair (natSetCode (Nat.unpair k).1) y ∈ births k ↔ - y = enumerations (Nat.unpair k).1 := by - have successor (k : Nat) : clocks (k + 1) = insert (clocks k) (clocks k) ∧ - births (k + 1) = insert (ZFSet.pair (clocks (k + 1)) (enumerations (k + 1))) (births k) := by - obtain ⟨n, p, b, last, m, q, nextBirths, event, source, target, next, - i, _hi, j, _hj, e, _he, newE, _hNew, _grid, _old, selected, append, _branch⟩ := steps k - obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 source - obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 target - obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner - have hp := (ZFSet.pair_mem_prod.1 (function.1 (chosen (k + 1)))).1 - obtain ⟨_, _, unique⟩ := function.2 _ hp - have same := (unique newE selected).trans (unique _ (chosen (k + 1))).symm - exact ⟨next, same ▸ append⟩ - have exactHistory : ∀ k, clocks k = natSetCode k ∧ births k = finiteStageHistory enumerations (k + 1) := by - intro k - induction k with - | zero => - refine ⟨initialClock, ?_⟩ - exact initialBirths - | succ k ih => - have next := successor k - have clock : clocks (k + 1) = natSetCode (k + 1) := by - rw [next.1, ih.1, natSetCode_succ] - exact ⟨clock, by rw [next.2, clock, ih.2]; rfl⟩ - intro k - have facts := exactHistory k - have lookup (i : Nat) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode i) y ∈ births k ↔ i ≤ k ∧ y = enumerations i := by - rw [facts.2, pair_mem_finiteStageHistory, Nat.lt_succ_iff] - exact ⟨facts.1, facts.2, lookup, fun y => (lookup _ y).trans - ⟨And.right, fun equal => ⟨Nat.unpair_left_le k, equal⟩⟩⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFairPreparationMonotonicity + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem fairPreparation_birthPersistence + {Q E0 stages U enumSelector prepSelector gridGraph : ZFSet.{u}} + (function : ZFSet.IsFunc Q E0 enumSelector) + (clocks conditions births events enumerations : Nat → ZFSet.{u}) + (chosen : ∀ k, ZFSet.pair (conditions k) (enumerations k) ∈ enumSelector) + (initialClock : clocks 0 = ∅) + (initialBirths : births 0 = {ZFSet.pair ∅ (enumerations 0)}) + (steps : ∀ k, FairPreparationStepCode ZFSet.omega E0 stages U + enumSelector prepSelector gridGraph + (ZFSet.pair (clocks k) (ZFSet.pair (conditions k) (ZFSet.pair (births k) (events k)))) + (ZFSet.pair (clocks (k + 1)) + (ZFSet.pair (conditions (k + 1)) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) : + ∀ k, clocks k = natSetCode k ∧ births k = finiteStageHistory enumerations (k + 1) ∧ + (∀ i y, ZFSet.pair (natSetCode i) y ∈ births k ↔ i ≤ k ∧ y = enumerations i) ∧ + ∀ y, ZFSet.pair (natSetCode (Nat.unpair k).1) y ∈ births k ↔ + y = enumerations (Nat.unpair k).1 := by + have successor (k : Nat) : clocks (k + 1) = insert (clocks k) (clocks k) ∧ + births (k + 1) = insert (ZFSet.pair (clocks (k + 1)) (enumerations (k + 1))) (births k) := by + obtain ⟨n, p, b, last, m, q, nextBirths, event, source, target, next, + i, _hi, j, _hj, e, _he, newE, _hNew, _grid, _old, selected, append, _branch⟩ := steps k + obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 source + obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + obtain ⟨rfl, tail⟩ := ZFSet.pair_inj.1 target + obtain ⟨rfl, inner⟩ := ZFSet.pair_inj.1 tail + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner + have hp := (ZFSet.pair_mem_prod.1 (function.1 (chosen (k + 1)))).1 + obtain ⟨_, _, unique⟩ := function.2 _ hp + have same := (unique newE selected).trans (unique _ (chosen (k + 1))).symm + exact ⟨next, same ▸ append⟩ + have exactHistory : ∀ k, clocks k = natSetCode k ∧ births k = finiteStageHistory enumerations (k + 1) := by + intro k + induction k with + | zero => + refine ⟨initialClock, ?_⟩ + exact initialBirths + | succ k ih => + have next := successor k + have clock : clocks (k + 1) = natSetCode (k + 1) := by + rw [next.1, ih.1, natSetCode_succ] + exact ⟨clock, by rw [next.2, clock, ih.2]; rfl⟩ + intro k + have facts := exactHistory k + have lookup (i : Nat) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode i) y ∈ births k ↔ i ≤ k ∧ y = enumerations i := by + rw [facts.2, pair_mem_finiteStageHistory, Nat.lt_succ_iff] + exact ⟨facts.1, facts.2, lookup, fun y => (lookup _ y).trans + ⟨And.right, fun equal => ⟨Nat.unpair_left_le k, equal⟩⟩⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalCardinality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalCardinality.lean index 2c1b10544d412f7bfc6a5ca77afb87da9d6c8fee..a983b167faa1e6b122dcd673dca5a7a9bf88b1a3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalCardinality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalCardinality.lean @@ -1,337 +1,337 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.FinalProfilePersistence - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -open Cardinal -open scoped Cardinal -universe u - -namespace CosetGeometry -variable (J S : Type u) [Group J] - -def factorCode : (Σ b, Factor J S b) → J ⊕ FreeGroup S - | ⟨false, x⟩ => .inl x - | ⟨true, x⟩ => .inr x - -omit [Group J] in -theorem factorCode_injective : Function.Injective (factorCode J S) := by - rintro ⟨firstTag, first⟩ ⟨secondTag, second⟩ equal - cases firstTag <;> cases secondTag - · have values := Sum.inl.inj equal - cases values - rfl - · change Sum.inl first = Sum.inr second at equal - cases equal - · change Sum.inr first = Sum.inl second at equal - cases equal - · have values := Sum.inr.inj equal - cases values - rfl - -theorem freeGroup_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (small : #S < κ) : #(FreeGroup S) < κ := by - have signed : #(S × Bool) < κ := by - simpa only [mk_prod, lift_id, lift_uzero, mk_bool, lift_ofNat] using - (mul_lt_of_lt inaccessible.1.le small ((ofNat_lt_aleph0 (n := 2)).trans inaccessible.1)) - exact (mk_quot_le (r := FreeGroup.Red.Step)).trans_lt (SizeBounds.list_lt κ inaccessible signed) - -theorem external_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (oldSmall : #J < κ) (letters : #S < κ) : #(External J S) < κ := by - have factors : #(Σ b, Factor J S b) < κ := - (mk_le_of_injective (factorCode_injective J S)).trans_lt - (SizeBounds.sum_lt κ inaccessible oldSmall (freeGroup_cardinal_lt S κ inaccessible letters)) - have words : #(List (Σ b, Factor J S b)) < κ := SizeBounds.list_lt κ inaccessible factors - exact (mk_quotient_le (s := (conGen (Monoid.CoprodI.Rel (Factor J S))).toSetoid)).trans_lt words - -end CosetGeometry - -namespace TileRequests - -def Request.childCode {A : Type u} {P : MeetOrder A} : (r : Request P) → r.Child → Bool - | .separation _, _ => false - | .compression _ _, _ => false - | .rectangle _, j => j.down - -theorem Request.childCode_injective {A : Type u} {P : MeetOrder A} (r : Request P) : - Function.Injective r.childCode := by - cases r with - | separation _ => intro x y _; exact ULift.ext _ _ (Subsingleton.elim x.down y.down) - | compression _ _ => intro x y _; exact ULift.ext _ _ (Subsingleton.elim x.down y.down) - | rectangle _ => intro x y eq; exact ULift.ext _ _ eq - -namespace Family -open CosetGeometry -variable {A J R : Type u} [Group J] {P : MeetOrder A} (f : Family P R) - -def letterCode (l : f.Letters) : R × Bool := (l.1, (f.request l.1).childCode l.2) - -theorem letterCode_injective : Function.Injective f.letterCode := by - rintro ⟨r, i⟩ ⟨s, j⟩ eq - have same : r = s := congrArg Prod.fst eq - cases same - have child := (f.request r).childCode_injective (congrArg Prod.snd eq) - cases child - rfl - -theorem letters_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (requests : #R < κ) : #f.Letters < κ := by - apply (mk_le_of_injective f.letterCode_injective).trans_lt - simpa only [mk_prod, lift_id, lift_uzero, mk_bool, lift_ofNat] using - (mul_lt_of_lt inaccessible.1.le requests ((ofNat_lt_aleph0 (n := 2)).trans inaccessible.1)) - -theorem node_cardinal_lt (a : OrderAction J P) (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (nodes : #A < κ) (oldGroup : #J < κ) (requests : #R < κ) : #(f.Node a) < κ := by - have cover : Function.Surjective (fun p : External J f.Letters × A => (f.copy a p.1).toFun p.2) := by - intro x - rcases f.copy_cover a x with ⟨w, y, eq⟩ - exact ⟨(w, y), eq⟩ - exact (mk_le_of_surjective cover).trans_lt (SizeBounds.prod_lt κ inaccessible - (external_cardinal_lt J f.Letters κ inaccessible oldGroup (f.letters_cardinal_lt κ inaccessible requests)) nodes) - -theorem extension_cardinal_lt (a : OrderAction J P) (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (nodes : #A < κ) (oldGroup : #J < κ) (requests : #R < κ) : #(f.Extension a) < κ := - SizeBounds.option_lt κ inaccessible (f.node_cardinal_lt a κ inaccessible nodes oldGroup requests) - -end Family -end TileRequests - - - - - - -namespace TaskDatum -variable {A Label : Type u} {P : MeetOrder A} - -def sizeCode (d : TaskDatum P Label) : A × A × A × Label × Set A × Set (A × A) := - (d.source, d.target, d.separator, d.label, d.filter.mem, - {p | ∃ h : P.le p.1 d.source, d.baseMap.toFun ⟨p.1, h⟩ = p.2}) - -theorem sizeCode_injective : Function.Injective (sizeCode (P := P) (Label := Label)) := by - intro d e eq - rcases d with ⟨s, t, m, v, F, l⟩ - rcases e with ⟨s', t', m', v', F', l'⟩ - simp only [sizeCode, Prod.mk.injEq] at eq - have hs := eq.1 - have ht := eq.2.1 - have hv := eq.2.2.1 - have hl := eq.2.2.2.1 - have hF := congrArg Prod.fst eq.2.2.2.2 - have graph := congrArg Prod.snd eq.2.2.2.2 - dsimp only at hF graph - cases hs - cases ht - cases hv - cases hl - have filters : F = F' := meetFilter_ext F F' (fun x => by rw [hF]) - cases filters - have maps : m = m' := by - apply meetEmbedding_ext - intro x - have hx : (x.val, m.toFun x) ∈ {p | ∃ h : P.le p.1 s, m.toFun ⟨p.1, h⟩ = p.2} := - ⟨x.property, rfl⟩ - rw [graph] at hx - rcases hx with ⟨_, eq⟩ - exact eq.symm - cases maps - rfl - -theorem cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (nodes : #A < κ) (labels : #Label < κ) : #(TaskDatum P Label) < κ := by - apply (mk_le_of_injective (sizeCode_injective (P := P) (Label := Label))).trans_lt - exact SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible nodes - (SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible labels - (SizeBounds.prod_lt κ inaccessible (SizeBounds.sets_lt κ inaccessible nodes) - (SizeBounds.sets_lt κ inaccessible (SizeBounds.prod_lt κ inaccessible nodes nodes)))))) - -end TaskDatum - -namespace MainStage -variable (s : MainStage.{u}) (Label : Type u) - -theorem tasks_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (nodes : #s.Point < κ) (labels : #Label < κ) : #(s.action.AllTasks Label) < κ := - SizeBounds.subtype_lt κ (TaskDatum.cardinal_lt κ inaccessible nodes labels) _ - -theorem internal_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (nodes : #s.Point < κ) (labels : #Label < κ) : #(s.internal Label).Point < κ := - (s.tasks Label).union_cardinal_lt κ inaccessible.1 nodes - (s.tasks_cardinal_lt Label κ inaccessible nodes labels) - -end MainStage - - - - - - -namespace ActionRectangle -variable {A G : Type u} {P : MeetOrder A} {action : G → MeetIso P P} - -def sizeCode (r : ActionRectangle P action) : A × A × A × G × G := - (r.C, r.B, r.D, r.first, r.second) - -theorem sizeCode_injective : Function.Injective (sizeCode (P := P) (action := action)) := by - intro r s eq - cases r - cases s - simp only [sizeCode, Prod.mk.injEq] at eq - rcases eq with ⟨rfl, rfl, rfl, rfl, rfl⟩ - rfl - -theorem cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (nodes : #A < κ) (actors : #G < κ) : #(ActionRectangle P action) < κ := - (mk_le_of_injective (sizeCode_injective (P := P) (action := action))).trans_lt - (SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible nodes - (SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible actors actors)))) - -end ActionRectangle - -namespace MainStage -variable (s : MainStage.{u}) (Label : Type u) - -def CardinalBound (κ : Cardinal.{u}) : Prop := #s.Point < κ ∧ #s.Actor < κ - -def requestCode : s.RequestIndex Label → - s.action.AllTasks Label ⊕ (s.Point ⊕ ActionRectangle s.order s.action.iso) - | .compression t => .inl t - | .separation x => .inr (.inl x) - | .rectangle r => .inr (.inr r) - -theorem requestCode_injective : Function.Injective (s.requestCode Label) := by - intro i j eq - cases i <;> cases j <;> simp only [requestCode, Sum.inl.injEq, Sum.inr.injEq, - Sum.inl_ne_inr, Sum.inr_ne_inl] at eq - all_goals cases eq; rfl - -theorem requests_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (small : s.CardinalBound κ) (labels : #Label < κ) : #(s.RequestIndex Label) < κ := - (mk_le_of_injective (s.requestCode_injective Label)).trans_lt - (SizeBounds.sum_lt κ inaccessible (s.tasks_cardinal_lt Label κ inaccessible small.1 labels) - (SizeBounds.sum_lt κ inaccessible small.1 (ActionRectangle.cardinal_lt κ inaccessible small.1 small.2))) - -theorem next_cardinal_bound (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (small : s.CardinalBound κ) (labels : #Label < κ) : (s.next Label).CardinalBound κ := by - have requests := s.requests_cardinal_lt Label κ inaccessible small labels - have internal := s.internal_cardinal_lt Label κ inaccessible small.1 labels - exact ⟨(s.requests Label).extension_cardinal_lt (s.internal Label).action κ inaccessible internal small.2 requests, - CosetGeometry.external_cardinal_lt s.Actor (s.requests Label).Letters κ inaccessible small.2 - ((s.requests Label).letters_cardinal_lt κ inaccessible requests)⟩ - -end MainStage - - - - - - -namespace DirectSystem -variable {I : Type u} [LinearOrder I] (d : DirectSystem I) - -theorem cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (indices : #I < κ) (stages : ∀ i, #(d.Point i) < κ) : #d.Union < κ := - SizeBounds.image_cover_lt κ inaccessible indices d.Point stages d.point d.cover - -end DirectSystem - -namespace MainStage - -theorem cardinal_bound_of_eq {s t : MainStage.{u}} (eq : s = t) (κ : Cardinal.{u}) - (small : t.CardinalBound κ) : s.CardinalBound κ := by cases eq; exact small - -theorem initial_cardinal_bound (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) : - initial.{u}.CardinalBound κ := by - constructor - · exact SizeBounds.countable_lt κ inaccessible (A := ULift.{u} Bool) - · have injective : Function.Injective (fun _ : initial.{u}.Actor => (⟨()⟩ : ULift.{u} Unit)) := by - intro x y _ - exact (initial_group_trivial x).trans (initial_group_trivial y).symm - exact (mk_le_of_injective injective).trans_lt - (SizeBounds.countable_lt κ inaccessible (A := ULift.{u} Unit)) - -namespace Diagram -variable {I : Type u} [LinearOrder I] (d : Diagram I) - -theorem union_cardinal_bounds (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (indices : #I < κ) (small : ∀ i, (d.stage i).CardinalBound κ) : - #d.orders.system.Union < κ ∧ #d.groups.system.Union < κ := - ⟨d.orders.system.cardinal_lt κ inaccessible indices (fun i => (small i).1), - d.groups.system.cardinal_lt κ inaccessible indices (fun i => (small i).2)⟩ - -theorem limit_cardinal_bound [Nonempty I] [Countable I] - (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) - (small : ∀ i, (d.stage i).CardinalBound κ) : d.limit.CardinalBound κ := by - have bounds := d.union_cardinal_bounds κ inaccessible (SizeBounds.countable_lt κ inaccessible) small - exact ⟨SizeBounds.option_lt κ inaccessible bounds.1, bounds.2⟩ - -end Diagram - -open CountableColumns - -theorem ordinalStep_cardinal_bound (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) (labels : #Label < κ) - (small : ∀ i, (d.stage i).CardinalBound κ) : (ordinalStep Label a d).apex.CardinalBound κ := by - classical - by_cases inhabited : Nonempty (Set.Iio a) - · by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last - · exact cardinal_bound_of_eq (ordinalStep_last Label a d hasLast.choose hasLast.choose_spec) κ - ((d.stage hasLast.choose).next_cardinal_bound Label κ inaccessible (small hasLast.choose) labels) - · let _ := inhabited - have eq : ordinalStep Label a d = d.limitCone := (dite_eq_left inhabited).trans (dite_eq_right hasLast) - exact cardinal_bound_of_eq (congrArg Diagram.Cone.apex eq) κ - (d.limit_cardinal_bound κ inaccessible small) - · exact cardinal_bound_of_eq (ordinalStep_empty Label a d inhabited) κ (initial_cardinal_bound κ inaccessible) - -end MainStage - -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps - -open Cardinal -open scoped Cardinal - -namespace CountableColumns - -theorem cardinal_eq_aleph_one : #Column = (ℵ₁ : Cardinal.{1}) := by - have types : Column = Set.Iio (ℵ₁ : Cardinal.{0}).ord := - congrArg Subtype (funext (fun o => propext (membership_iff o))) - rw [types, Cardinal.mk_Iio_ordinal, Cardinal.card_ord, Cardinal.lift_aleph, Ordinal.lift_one] - -theorem cardinal_lt_inaccessible (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : #Column < κ := by - rw [cardinal_eq_aleph_one, ← Cardinal.succ_aleph0] - exact inaccessible.isSuccLimit.succ_lt inaccessible.aleph0_lt - -end CountableColumns - -namespace MainStage.OrdinalRun -open CountableColumns -variable (Label : Type 1) - -theorem stage_cardinal_bound (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) - (labels : #Label < κ) (a : Column) : (stage Label a).CardinalBound κ := by - have wf : WellFounded ((· < ·) : Column → Column → Prop) := wellFounded_lt - induction a using wf.induction with - | h a ih => - apply cardinal_bound_of_eq (Transfinite.stage_generated (ordinalStep Label) a) κ - exact ordinalStep_cardinal_bound Label a (before Label a) κ inaccessible labels (fun i => ih i.val i.property) - -theorem final_cardinal_bounds (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) - (labels : #Label < κ) : #(FinalPoint Label) < κ ∧ #(FinalActor Label) < κ := - (diagram Label).union_cardinal_bounds κ inaccessible (cardinal_lt_inaccessible κ inaccessible) - (stage_cardinal_bound Label κ inaccessible labels) - -theorem countableOrdinalLabels_final_cardinal_bounds (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : - #(FinalPoint Column) < κ ∧ #(FinalActor Column) < κ := - final_cardinal_bounds Column κ inaccessible (cardinal_lt_inaccessible κ inaccessible) - -end MainStage.OrdinalRun - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.FinalProfilePersistence + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +open Cardinal +open scoped Cardinal +universe u + +namespace CosetGeometry +variable (J S : Type u) [Group J] + +def factorCode : (Σ b, Factor J S b) → J ⊕ FreeGroup S + | ⟨false, x⟩ => .inl x + | ⟨true, x⟩ => .inr x + +omit [Group J] in +theorem factorCode_injective : Function.Injective (factorCode J S) := by + rintro ⟨firstTag, first⟩ ⟨secondTag, second⟩ equal + cases firstTag <;> cases secondTag + · have values := Sum.inl.inj equal + cases values + rfl + · change Sum.inl first = Sum.inr second at equal + cases equal + · change Sum.inr first = Sum.inl second at equal + cases equal + · have values := Sum.inr.inj equal + cases values + rfl + +theorem freeGroup_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (small : #S < κ) : #(FreeGroup S) < κ := by + have signed : #(S × Bool) < κ := by + simpa only [mk_prod, lift_id, lift_uzero, mk_bool, lift_ofNat] using + (mul_lt_of_lt inaccessible.1.le small ((ofNat_lt_aleph0 (n := 2)).trans inaccessible.1)) + exact (mk_quot_le (r := FreeGroup.Red.Step)).trans_lt (SizeBounds.list_lt κ inaccessible signed) + +theorem external_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (oldSmall : #J < κ) (letters : #S < κ) : #(External J S) < κ := by + have factors : #(Σ b, Factor J S b) < κ := + (mk_le_of_injective (factorCode_injective J S)).trans_lt + (SizeBounds.sum_lt κ inaccessible oldSmall (freeGroup_cardinal_lt S κ inaccessible letters)) + have words : #(List (Σ b, Factor J S b)) < κ := SizeBounds.list_lt κ inaccessible factors + exact (mk_quotient_le (s := (conGen (Monoid.CoprodI.Rel (Factor J S))).toSetoid)).trans_lt words + +end CosetGeometry + +namespace TileRequests + +def Request.childCode {A : Type u} {P : MeetOrder A} : (r : Request P) → r.Child → Bool + | .separation _, _ => false + | .compression _ _, _ => false + | .rectangle _, j => j.down + +theorem Request.childCode_injective {A : Type u} {P : MeetOrder A} (r : Request P) : + Function.Injective r.childCode := by + cases r with + | separation _ => intro x y _; exact ULift.ext _ _ (Subsingleton.elim x.down y.down) + | compression _ _ => intro x y _; exact ULift.ext _ _ (Subsingleton.elim x.down y.down) + | rectangle _ => intro x y eq; exact ULift.ext _ _ eq + +namespace Family +open CosetGeometry +variable {A J R : Type u} [Group J] {P : MeetOrder A} (f : Family P R) + +def letterCode (l : f.Letters) : R × Bool := (l.1, (f.request l.1).childCode l.2) + +theorem letterCode_injective : Function.Injective f.letterCode := by + rintro ⟨r, i⟩ ⟨s, j⟩ eq + have same : r = s := congrArg Prod.fst eq + cases same + have child := (f.request r).childCode_injective (congrArg Prod.snd eq) + cases child + rfl + +theorem letters_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (requests : #R < κ) : #f.Letters < κ := by + apply (mk_le_of_injective f.letterCode_injective).trans_lt + simpa only [mk_prod, lift_id, lift_uzero, mk_bool, lift_ofNat] using + (mul_lt_of_lt inaccessible.1.le requests ((ofNat_lt_aleph0 (n := 2)).trans inaccessible.1)) + +theorem node_cardinal_lt (a : OrderAction J P) (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (nodes : #A < κ) (oldGroup : #J < κ) (requests : #R < κ) : #(f.Node a) < κ := by + have cover : Function.Surjective (fun p : External J f.Letters × A => (f.copy a p.1).toFun p.2) := by + intro x + rcases f.copy_cover a x with ⟨w, y, eq⟩ + exact ⟨(w, y), eq⟩ + exact (mk_le_of_surjective cover).trans_lt (SizeBounds.prod_lt κ inaccessible + (external_cardinal_lt J f.Letters κ inaccessible oldGroup (f.letters_cardinal_lt κ inaccessible requests)) nodes) + +theorem extension_cardinal_lt (a : OrderAction J P) (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (nodes : #A < κ) (oldGroup : #J < κ) (requests : #R < κ) : #(f.Extension a) < κ := + SizeBounds.option_lt κ inaccessible (f.node_cardinal_lt a κ inaccessible nodes oldGroup requests) + +end Family +end TileRequests + + + + + + +namespace TaskDatum +variable {A Label : Type u} {P : MeetOrder A} + +def sizeCode (d : TaskDatum P Label) : A × A × A × Label × Set A × Set (A × A) := + (d.source, d.target, d.separator, d.label, d.filter.mem, + {p | ∃ h : P.le p.1 d.source, d.baseMap.toFun ⟨p.1, h⟩ = p.2}) + +theorem sizeCode_injective : Function.Injective (sizeCode (P := P) (Label := Label)) := by + intro d e eq + rcases d with ⟨s, t, m, v, F, l⟩ + rcases e with ⟨s', t', m', v', F', l'⟩ + simp only [sizeCode, Prod.mk.injEq] at eq + have hs := eq.1 + have ht := eq.2.1 + have hv := eq.2.2.1 + have hl := eq.2.2.2.1 + have hF := congrArg Prod.fst eq.2.2.2.2 + have graph := congrArg Prod.snd eq.2.2.2.2 + dsimp only at hF graph + cases hs + cases ht + cases hv + cases hl + have filters : F = F' := meetFilter_ext F F' (fun x => by rw [hF]) + cases filters + have maps : m = m' := by + apply meetEmbedding_ext + intro x + have hx : (x.val, m.toFun x) ∈ {p | ∃ h : P.le p.1 s, m.toFun ⟨p.1, h⟩ = p.2} := + ⟨x.property, rfl⟩ + rw [graph] at hx + rcases hx with ⟨_, eq⟩ + exact eq.symm + cases maps + rfl + +theorem cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (nodes : #A < κ) (labels : #Label < κ) : #(TaskDatum P Label) < κ := by + apply (mk_le_of_injective (sizeCode_injective (P := P) (Label := Label))).trans_lt + exact SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible nodes + (SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible labels + (SizeBounds.prod_lt κ inaccessible (SizeBounds.sets_lt κ inaccessible nodes) + (SizeBounds.sets_lt κ inaccessible (SizeBounds.prod_lt κ inaccessible nodes nodes)))))) + +end TaskDatum + +namespace MainStage +variable (s : MainStage.{u}) (Label : Type u) + +theorem tasks_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (nodes : #s.Point < κ) (labels : #Label < κ) : #(s.action.AllTasks Label) < κ := + SizeBounds.subtype_lt κ (TaskDatum.cardinal_lt κ inaccessible nodes labels) _ + +theorem internal_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (nodes : #s.Point < κ) (labels : #Label < κ) : #(s.internal Label).Point < κ := + (s.tasks Label).union_cardinal_lt κ inaccessible.1 nodes + (s.tasks_cardinal_lt Label κ inaccessible nodes labels) + +end MainStage + + + + + + +namespace ActionRectangle +variable {A G : Type u} {P : MeetOrder A} {action : G → MeetIso P P} + +def sizeCode (r : ActionRectangle P action) : A × A × A × G × G := + (r.C, r.B, r.D, r.first, r.second) + +theorem sizeCode_injective : Function.Injective (sizeCode (P := P) (action := action)) := by + intro r s eq + cases r + cases s + simp only [sizeCode, Prod.mk.injEq] at eq + rcases eq with ⟨rfl, rfl, rfl, rfl, rfl⟩ + rfl + +theorem cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (nodes : #A < κ) (actors : #G < κ) : #(ActionRectangle P action) < κ := + (mk_le_of_injective (sizeCode_injective (P := P) (action := action))).trans_lt + (SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible nodes + (SizeBounds.prod_lt κ inaccessible nodes (SizeBounds.prod_lt κ inaccessible actors actors)))) + +end ActionRectangle + +namespace MainStage +variable (s : MainStage.{u}) (Label : Type u) + +def CardinalBound (κ : Cardinal.{u}) : Prop := #s.Point < κ ∧ #s.Actor < κ + +def requestCode : s.RequestIndex Label → + s.action.AllTasks Label ⊕ (s.Point ⊕ ActionRectangle s.order s.action.iso) + | .compression t => .inl t + | .separation x => .inr (.inl x) + | .rectangle r => .inr (.inr r) + +theorem requestCode_injective : Function.Injective (s.requestCode Label) := by + intro i j eq + cases i <;> cases j <;> simp only [requestCode, Sum.inl.injEq, Sum.inr.injEq, + Sum.inl_ne_inr, Sum.inr_ne_inl] at eq + all_goals cases eq; rfl + +theorem requests_cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (small : s.CardinalBound κ) (labels : #Label < κ) : #(s.RequestIndex Label) < κ := + (mk_le_of_injective (s.requestCode_injective Label)).trans_lt + (SizeBounds.sum_lt κ inaccessible (s.tasks_cardinal_lt Label κ inaccessible small.1 labels) + (SizeBounds.sum_lt κ inaccessible small.1 (ActionRectangle.cardinal_lt κ inaccessible small.1 small.2))) + +theorem next_cardinal_bound (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (small : s.CardinalBound κ) (labels : #Label < κ) : (s.next Label).CardinalBound κ := by + have requests := s.requests_cardinal_lt Label κ inaccessible small labels + have internal := s.internal_cardinal_lt Label κ inaccessible small.1 labels + exact ⟨(s.requests Label).extension_cardinal_lt (s.internal Label).action κ inaccessible internal small.2 requests, + CosetGeometry.external_cardinal_lt s.Actor (s.requests Label).Letters κ inaccessible small.2 + ((s.requests Label).letters_cardinal_lt κ inaccessible requests)⟩ + +end MainStage + + + + + + +namespace DirectSystem +variable {I : Type u} [LinearOrder I] (d : DirectSystem I) + +theorem cardinal_lt (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (indices : #I < κ) (stages : ∀ i, #(d.Point i) < κ) : #d.Union < κ := + SizeBounds.image_cover_lt κ inaccessible indices d.Point stages d.point d.cover + +end DirectSystem + +namespace MainStage + +theorem cardinal_bound_of_eq {s t : MainStage.{u}} (eq : s = t) (κ : Cardinal.{u}) + (small : t.CardinalBound κ) : s.CardinalBound κ := by cases eq; exact small + +theorem initial_cardinal_bound (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) : + initial.{u}.CardinalBound κ := by + constructor + · exact SizeBounds.countable_lt κ inaccessible (A := ULift.{u} Bool) + · have injective : Function.Injective (fun _ : initial.{u}.Actor => (⟨()⟩ : ULift.{u} Unit)) := by + intro x y _ + exact (initial_group_trivial x).trans (initial_group_trivial y).symm + exact (mk_le_of_injective injective).trans_lt + (SizeBounds.countable_lt κ inaccessible (A := ULift.{u} Unit)) + +namespace Diagram +variable {I : Type u} [LinearOrder I] (d : Diagram I) + +theorem union_cardinal_bounds (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (indices : #I < κ) (small : ∀ i, (d.stage i).CardinalBound κ) : + #d.orders.system.Union < κ ∧ #d.groups.system.Union < κ := + ⟨d.orders.system.cardinal_lt κ inaccessible indices (fun i => (small i).1), + d.groups.system.cardinal_lt κ inaccessible indices (fun i => (small i).2)⟩ + +theorem limit_cardinal_bound [Nonempty I] [Countable I] + (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) + (small : ∀ i, (d.stage i).CardinalBound κ) : d.limit.CardinalBound κ := by + have bounds := d.union_cardinal_bounds κ inaccessible (SizeBounds.countable_lt κ inaccessible) small + exact ⟨SizeBounds.option_lt κ inaccessible bounds.1, bounds.2⟩ + +end Diagram + +open CountableColumns + +theorem ordinalStep_cardinal_bound (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) (labels : #Label < κ) + (small : ∀ i, (d.stage i).CardinalBound κ) : (ordinalStep Label a d).apex.CardinalBound κ := by + classical + by_cases inhabited : Nonempty (Set.Iio a) + · by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last + · exact cardinal_bound_of_eq (ordinalStep_last Label a d hasLast.choose hasLast.choose_spec) κ + ((d.stage hasLast.choose).next_cardinal_bound Label κ inaccessible (small hasLast.choose) labels) + · let _ := inhabited + have eq : ordinalStep Label a d = d.limitCone := (dite_eq_left inhabited).trans (dite_eq_right hasLast) + exact cardinal_bound_of_eq (congrArg Diagram.Cone.apex eq) κ + (d.limit_cardinal_bound κ inaccessible small) + · exact cardinal_bound_of_eq (ordinalStep_empty Label a d inhabited) κ (initial_cardinal_bound κ inaccessible) + +end MainStage + +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps + +open Cardinal +open scoped Cardinal + +namespace CountableColumns + +theorem cardinal_eq_aleph_one : #Column = (ℵ₁ : Cardinal.{1}) := by + have types : Column = Set.Iio (ℵ₁ : Cardinal.{0}).ord := + congrArg Subtype (funext (fun o => propext (membership_iff o))) + rw [types, Cardinal.mk_Iio_ordinal, Cardinal.card_ord, Cardinal.lift_aleph, Ordinal.lift_one] + +theorem cardinal_lt_inaccessible (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : #Column < κ := by + rw [cardinal_eq_aleph_one, ← Cardinal.succ_aleph0] + exact inaccessible.isSuccLimit.succ_lt inaccessible.aleph0_lt + +end CountableColumns + +namespace MainStage.OrdinalRun +open CountableColumns +variable (Label : Type 1) + +theorem stage_cardinal_bound (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) + (labels : #Label < κ) (a : Column) : (stage Label a).CardinalBound κ := by + have wf : WellFounded ((· < ·) : Column → Column → Prop) := wellFounded_lt + induction a using wf.induction with + | h a ih => + apply cardinal_bound_of_eq (Transfinite.stage_generated (ordinalStep Label) a) κ + exact ordinalStep_cardinal_bound Label a (before Label a) κ inaccessible labels (fun i => ih i.val i.property) + +theorem final_cardinal_bounds (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) + (labels : #Label < κ) : #(FinalPoint Label) < κ ∧ #(FinalActor Label) < κ := + (diagram Label).union_cardinal_bounds κ inaccessible (cardinal_lt_inaccessible κ inaccessible) + (stage_cardinal_bound Label κ inaccessible labels) + +theorem countableOrdinalLabels_final_cardinal_bounds (κ : Cardinal.{1}) (inaccessible : κ.IsInaccessible) : + #(FinalPoint Column) < κ ∧ #(FinalActor Column) < κ := + final_cardinal_bounds Column κ inaccessible (cardinal_lt_inaccessible κ inaccessible) + +end MainStage.OrdinalRun + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalInsertionStages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalInsertionStages.lean index 0a2bbe28fa5d3c6b2c2648c4fa9827e9ab7f0411..aaa87b81f35ee831660b7de2356f222229392073 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalInsertionStages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalInsertionStages.lean @@ -1,101 +1,101 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.FinalProfilePersistence -import OAI.SetTheory.PartitionPrinciple.Geometry.MainInsertion - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u -open CosetGeometry - -def HasInsertionFamily {A G : Type u} [Group G] {P : MeetOrder A} - (a : OrderAction G P) (Label : Type u) (C E D : A) (F : A → Prop) : Prop := - ∃ (caps : Label → A) (actors : Label → G), - (∀ l z, P.le z C → (a.iso (actors l)).toFun z = z) ∧ - (∀ l, P.le ((a.iso (actors l)).toFun D) (caps l)) ∧ - (∀ l, P.le C (caps l) ∧ ¬ P.le (caps l) C) ∧ - (∀ l, ¬ P.le E (caps l)) ∧ - (∀ i j, i ≠ j → P.meet (caps i) (caps j) = C) ∧ - (∀ l x, P.le E x → (F x → P.le (caps l) x) ∧ (¬ F x → P.meet (caps l) x = C)) - -namespace MainStage.OrdinalRun -open CountableColumns -variable (Label : Type 1) - -theorem stage_successor_inserts (a : Column) (C E D : (stage Label a).Point) - (F : MeetFilter (stage Label a).order) - (ce : (stage Label a).order.le C E) (strict : ¬ (stage Label a).order.le E C) - (above : ∀ x, F.mem x → (stage Label a).order.le E x) : - (transition Label (lt_start a).le).Inserts Label C E D F := by - apply (Transition.inserts_transport _ (stage_successor Label a) Label C E D F).mp - rw [transition_successor] - exact (stage Label a).next_inserts Label C E D F ce strict above - -theorem final_inserts_at (a : Column) (C E D : (stage Label a).Point) - (F : MeetFilter (stage Label a).order) - (ce : (stage Label a).order.le C E) (strict : ¬ (stage Label a).order.le E C) - (above : ∀ x, F.mem x → (stage Label a).order.le E x) : - HasInsertionFamily (finalAction Label) Label - ((finalInclusion Label a).toFun C) ((finalInclusion Label a).toFun E) - ((finalInclusion Label a).toFun D) (pushFilter (finalInclusion Label a) F).mem := by - rcases stage_successor_inserts Label a C E D F ce strict above with - ⟨caps, actors, fixes, bounds, strictCaps, separators, pairs, profiles⟩ - let tr := transition Label (lt_start a).le - let inc := finalInclusion Label (start a) - refine ⟨(fun l => inc.toFun (caps l)), (fun l => finalGroupInclusion Label (start a) (actors l)), - ?_, ?_, ?_, ?_, ?_, ?_⟩ - · intro l z lower - have hz : (finalOrder Label).le z (inc.toFun (tr.points.toFun C)) := by - rw [final_points_coherent Label (lt_start a).le C] - exact lower - have agree := final_agreement Label (start a) (actors l) 1 (tr.points.toFun C) - (fun x hx => (fixes l x hx).trans ((stage Label (start a)).action.one x).symm) z hz - simpa only [map_one, (finalAction Label).one] using agree - · intro l - rw [← final_points_coherent Label (lt_start a).le D, final_action_stage] - exact (inc.le_iff _ _).mpr (bounds l) - · intro l - rw [← final_points_coherent Label (lt_start a).le C] - exact ⟨(inc.le_iff _ _).mpr (strictCaps l).1, - fun h => (strictCaps l).2 ((inc.le_iff _ _).mp h)⟩ - · intro l lower - rw [← final_points_coherent Label (lt_start a).le E] at lower - exact separators l ((inc.le_iff _ _).mp lower) - · intro i j different - rw [← inc.map_meet, pairs i j different] - exact final_points_coherent Label (lt_start a).le C - · intro l - have old : Profile (stage Label (start a)).order (tr.points.toFun C) (tr.points.toFun E) - (caps l) (imageFamily tr.points F.mem) := by - intro x hx - exact ⟨fun hp => (profiles l x hx).1 ((positive_imageFamily tr.points F.mem x).mp hp), - fun hn => (profiles l x hx).2 (fun hp => hn ((positive_imageFamily tr.points F.mem x).mpr hp))⟩ - have nonempty : ∃ x, imageFamily tr.points F.mem x := by - rcases F.nonempty with ⟨x, hx⟩ - exact ⟨tr.points.toFun x, x, hx, rfl⟩ - have persists := final_preservesProfiles Label (start a) (tr.points.toFun C) (tr.points.toFun E) - (caps l) (imageFamily tr.points F.mem) nonempty (separators l) old - have coherent : compose tr.points inc = finalInclusion Label a := - meetEmbedding_ext _ _ (final_points_coherent Label (lt_start a).le) - intro x lower - have hx : (finalOrder Label).le (inc.toFun (tr.points.toFun E)) x := by - rw [final_points_coherent Label (lt_start a).le E] - exact lower - have positive := positiveOver_imageFamily tr.points inc F.mem x - rw [coherent] at positive - have result := persists x hx - constructor - · intro hp - exact result.1 (positive.mpr hp) - · intro hn - exact (result.2 (fun hp => hn (positive.mp hp))).trans (final_points_coherent Label (lt_start a).le C) - -end MainStage.OrdinalRun - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.FinalProfilePersistence +import OAI.SetTheory.PartitionPrinciple.Geometry.MainInsertion + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u +open CosetGeometry + +def HasInsertionFamily {A G : Type u} [Group G] {P : MeetOrder A} + (a : OrderAction G P) (Label : Type u) (C E D : A) (F : A → Prop) : Prop := + ∃ (caps : Label → A) (actors : Label → G), + (∀ l z, P.le z C → (a.iso (actors l)).toFun z = z) ∧ + (∀ l, P.le ((a.iso (actors l)).toFun D) (caps l)) ∧ + (∀ l, P.le C (caps l) ∧ ¬ P.le (caps l) C) ∧ + (∀ l, ¬ P.le E (caps l)) ∧ + (∀ i j, i ≠ j → P.meet (caps i) (caps j) = C) ∧ + (∀ l x, P.le E x → (F x → P.le (caps l) x) ∧ (¬ F x → P.meet (caps l) x = C)) + +namespace MainStage.OrdinalRun +open CountableColumns +variable (Label : Type 1) + +theorem stage_successor_inserts (a : Column) (C E D : (stage Label a).Point) + (F : MeetFilter (stage Label a).order) + (ce : (stage Label a).order.le C E) (strict : ¬ (stage Label a).order.le E C) + (above : ∀ x, F.mem x → (stage Label a).order.le E x) : + (transition Label (lt_start a).le).Inserts Label C E D F := by + apply (Transition.inserts_transport _ (stage_successor Label a) Label C E D F).mp + rw [transition_successor] + exact (stage Label a).next_inserts Label C E D F ce strict above + +theorem final_inserts_at (a : Column) (C E D : (stage Label a).Point) + (F : MeetFilter (stage Label a).order) + (ce : (stage Label a).order.le C E) (strict : ¬ (stage Label a).order.le E C) + (above : ∀ x, F.mem x → (stage Label a).order.le E x) : + HasInsertionFamily (finalAction Label) Label + ((finalInclusion Label a).toFun C) ((finalInclusion Label a).toFun E) + ((finalInclusion Label a).toFun D) (pushFilter (finalInclusion Label a) F).mem := by + rcases stage_successor_inserts Label a C E D F ce strict above with + ⟨caps, actors, fixes, bounds, strictCaps, separators, pairs, profiles⟩ + let tr := transition Label (lt_start a).le + let inc := finalInclusion Label (start a) + refine ⟨(fun l => inc.toFun (caps l)), (fun l => finalGroupInclusion Label (start a) (actors l)), + ?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro l z lower + have hz : (finalOrder Label).le z (inc.toFun (tr.points.toFun C)) := by + rw [final_points_coherent Label (lt_start a).le C] + exact lower + have agree := final_agreement Label (start a) (actors l) 1 (tr.points.toFun C) + (fun x hx => (fixes l x hx).trans ((stage Label (start a)).action.one x).symm) z hz + simpa only [map_one, (finalAction Label).one] using agree + · intro l + rw [← final_points_coherent Label (lt_start a).le D, final_action_stage] + exact (inc.le_iff _ _).mpr (bounds l) + · intro l + rw [← final_points_coherent Label (lt_start a).le C] + exact ⟨(inc.le_iff _ _).mpr (strictCaps l).1, + fun h => (strictCaps l).2 ((inc.le_iff _ _).mp h)⟩ + · intro l lower + rw [← final_points_coherent Label (lt_start a).le E] at lower + exact separators l ((inc.le_iff _ _).mp lower) + · intro i j different + rw [← inc.map_meet, pairs i j different] + exact final_points_coherent Label (lt_start a).le C + · intro l + have old : Profile (stage Label (start a)).order (tr.points.toFun C) (tr.points.toFun E) + (caps l) (imageFamily tr.points F.mem) := by + intro x hx + exact ⟨fun hp => (profiles l x hx).1 ((positive_imageFamily tr.points F.mem x).mp hp), + fun hn => (profiles l x hx).2 (fun hp => hn ((positive_imageFamily tr.points F.mem x).mpr hp))⟩ + have nonempty : ∃ x, imageFamily tr.points F.mem x := by + rcases F.nonempty with ⟨x, hx⟩ + exact ⟨tr.points.toFun x, x, hx, rfl⟩ + have persists := final_preservesProfiles Label (start a) (tr.points.toFun C) (tr.points.toFun E) + (caps l) (imageFamily tr.points F.mem) nonempty (separators l) old + have coherent : compose tr.points inc = finalInclusion Label a := + meetEmbedding_ext _ _ (final_points_coherent Label (lt_start a).le) + intro x lower + have hx : (finalOrder Label).le (inc.toFun (tr.points.toFun E)) x := by + rw [final_points_coherent Label (lt_start a).le E] + exact lower + have positive := positiveOver_imageFamily tr.points inc F.mem x + rw [coherent] at positive + have result := persists x hx + constructor + · intro hp + exact result.1 (positive.mpr hp) + · intro hn + exact (result.2 (fun hp => hn (positive.mp hp))).trans (final_points_coherent Label (lt_start a).le C) + +end MainStage.OrdinalRun + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalRectangleStages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalRectangleStages.lean index 5d977cc98b26b296371d71afbe9e1b250a95d6b3..ea64576827ef42fb38a199aefa5bd520c75060f5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalRectangleStages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalRectangleStages.lean @@ -1,62 +1,62 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.MainRectangleMeets - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open CountableColumns -variable (Label : Type 1) - -theorem stage_successor_rectangles (a : Column) - (r : ActionRectangle (stage Label a).order (stage Label a).action.iso) - (X : (stage Label a).Point) : (transition Label (lt_start a).le).Rectangles r X := by - apply (Transition.rectangles_transport _ (stage_successor Label a) r X).mp - rw [transition_successor] - exact (stage Label a).next_rectangles Label r X - -theorem final_rectangles_at (a : Column) - (r : ActionRectangle (stage Label a).order (stage Label a).action.iso) - (X : (stage Label a).Point) : - ∃ h : Bool → FinalActor Label, - (∀ j z, (finalOrder Label).le z ((finalInclusion Label a).toFun r.C) → - ((finalAction Label).iso (h j)).toFun z = - ((finalAction Label).iso (finalGroupInclusion Label a ((stage Label a).rectangleOldActor r j))).toFun z) ∧ - (∀ z, (finalOrder Label).le z ((finalInclusion Label a).toFun r.B) → - ((finalAction Label).iso (h false)).toFun z = ((finalAction Label).iso (h true)).toFun z) ∧ - (∀ j, (finalOrder Label).meet - (((finalAction Label).iso (h j)).toFun ((finalInclusion Label a).toFun r.D)) - ((finalInclusion Label a).toFun X) = (finalInclusion Label a).toFun - ((stage Label a).order.meet - (((stage Label a).action.iso ((stage Label a).rectangleOldActor r j)).toFun r.C) X)) ∧ - (finalOrder Label).meet - (((finalAction Label).iso (h false)).toFun ((finalInclusion Label a).toFun r.D)) - (((finalAction Label).iso (h true)).toFun ((finalInclusion Label a).toFun r.D)) = - ((finalAction Label).iso (h false)).toFun ((finalInclusion Label a).toFun r.B) := by - rcases stage_successor_rectangles Label a r X with ⟨h, agreeC, agreeB, rootMeet, pairMeet⟩ - refine ⟨fun j => finalGroupInclusion Label (start a) (h j), ?_, ?_, ?_, ?_⟩ - · intro j z lower - rw [← final_actors_coherent Label (lt_start a).le ((stage Label a).rectangleOldActor r j)] - apply final_agreement Label (start a) _ _ _ (agreeC j) z - erw [final_points_coherent] - exact lower - · intro z lower - apply final_agreement Label (start a) _ _ _ agreeB z - erw [final_points_coherent] - exact lower - · intro j - erw [← final_points_coherent Label (lt_start a).le r.D, - ← final_points_coherent Label (lt_start a).le X, - final_action_stage, ← (finalInclusion Label (start a)).map_meet, - rootMeet, final_points_coherent] - · rw [← final_points_coherent Label (lt_start a).le r.D, - ← final_points_coherent Label (lt_start a).le r.B, - final_action_stage, final_action_stage, final_action_stage, - ← (finalInclusion Label (start a)).map_meet, pairMeet] - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.MainRectangleMeets + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open CountableColumns +variable (Label : Type 1) + +theorem stage_successor_rectangles (a : Column) + (r : ActionRectangle (stage Label a).order (stage Label a).action.iso) + (X : (stage Label a).Point) : (transition Label (lt_start a).le).Rectangles r X := by + apply (Transition.rectangles_transport _ (stage_successor Label a) r X).mp + rw [transition_successor] + exact (stage Label a).next_rectangles Label r X + +theorem final_rectangles_at (a : Column) + (r : ActionRectangle (stage Label a).order (stage Label a).action.iso) + (X : (stage Label a).Point) : + ∃ h : Bool → FinalActor Label, + (∀ j z, (finalOrder Label).le z ((finalInclusion Label a).toFun r.C) → + ((finalAction Label).iso (h j)).toFun z = + ((finalAction Label).iso (finalGroupInclusion Label a ((stage Label a).rectangleOldActor r j))).toFun z) ∧ + (∀ z, (finalOrder Label).le z ((finalInclusion Label a).toFun r.B) → + ((finalAction Label).iso (h false)).toFun z = ((finalAction Label).iso (h true)).toFun z) ∧ + (∀ j, (finalOrder Label).meet + (((finalAction Label).iso (h j)).toFun ((finalInclusion Label a).toFun r.D)) + ((finalInclusion Label a).toFun X) = (finalInclusion Label a).toFun + ((stage Label a).order.meet + (((stage Label a).action.iso ((stage Label a).rectangleOldActor r j)).toFun r.C) X)) ∧ + (finalOrder Label).meet + (((finalAction Label).iso (h false)).toFun ((finalInclusion Label a).toFun r.D)) + (((finalAction Label).iso (h true)).toFun ((finalInclusion Label a).toFun r.D)) = + ((finalAction Label).iso (h false)).toFun ((finalInclusion Label a).toFun r.B) := by + rcases stage_successor_rectangles Label a r X with ⟨h, agreeC, agreeB, rootMeet, pairMeet⟩ + refine ⟨fun j => finalGroupInclusion Label (start a) (h j), ?_, ?_, ?_, ?_⟩ + · intro j z lower + rw [← final_actors_coherent Label (lt_start a).le ((stage Label a).rectangleOldActor r j)] + apply final_agreement Label (start a) _ _ _ (agreeC j) z + erw [final_points_coherent] + exact lower + · intro z lower + apply final_agreement Label (start a) _ _ _ agreeB z + erw [final_points_coherent] + exact lower + · intro j + erw [← final_points_coherent Label (lt_start a).le r.D, + ← final_points_coherent Label (lt_start a).le X, + final_action_stage, ← (finalInclusion Label (start a)).map_meet, + rootMeet, final_points_coherent] + · rw [← final_points_coherent Label (lt_start a).le r.D, + ← final_points_coherent Label (lt_start a).le r.B, + final_action_stage, final_action_stage, final_action_stage, + ← (finalInclusion Label (start a)).map_meet, pairMeet] + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalStageBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalStageBounds.lean index 432eb391ad954b936148ce22ba0a26caf6475da2..aef1c8e3fa465be4ae833db86068c7226b087ffc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalStageBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FinalStageBounds.lean @@ -1,224 +1,224 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FinalFilterLocalization - -namespace OAI - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open CountableColumns BirthLabels -variable (Label : Type 1) - -noncomputable def birthStep (a : Column) - (past : ∀ b, b < a → BirthRecord (stage Label b) b) : BirthRecord (stage Label a) a := by - classical - let seed : EarlierBirths Label a := fun i => past i.val i.property - exact if coherent : EarlierCoherent Label a seed then extendBirths Label a seed coherent - else BirthRecord.constant (stage Label a) a - -noncomputable def birthRun : ∀ a : Column, BirthRecord (stage Label a) a := - wellFounded_lt.fix (birthStep Label) - -theorem birthRun_eq (a : Column) : - birthRun Label a = birthStep Label a (fun b _ => birthRun Label b) := wellFounded_lt.fix_eq _ a - -theorem birthRun_coherent_at (a : Column) : ∀ b (h : b ≤ a) (x : (stage Label b).Point), - (birthRun Label a).birth ((transition Label h).points.toFun x) = (birthRun Label b).birth x := by - refine (show WellFounded ((· < ·) : Column → Column → Prop) from wellFounded_lt).induction - (C := fun a => ∀ b (h : b ≤ a) (x : (stage Label b).Point), - (birthRun Label a).birth ((transition Label h).points.toFun x) = (birthRun Label b).birth x) a ?_ - intro a ih - let seed : EarlierBirths Label a := fun i => birthRun Label i.val - have coherent : EarlierCoherent Label a seed := by - intro i j h x - exact ih j.val j.property i.val h x - have generated : birthRun Label a = extendBirths Label a seed coherent := - (birthRun_eq Label a).trans (dite_eq_left (c := EarlierCoherent Label a seed) coherent) - intro b h x - rcases lt_or_eq_of_le h with lower | rfl - · rw [generated] - exact extendBirths_preserves Label a seed coherent ⟨b, lower⟩ x - · rw [transition_self] - rfl - -theorem birthRun_earlier_coherent (a : Column) : - EarlierCoherent Label a (fun i => birthRun Label i.val) := - fun {_ j} h x => birthRun_coherent_at Label j.val _ h x - -theorem birthRun_generated (a : Column) : - birthRun Label a = extendBirths Label a (fun i => birthRun Label i.val) - (birthRun_earlier_coherent Label a) := - (birthRun_eq Label a).trans - (dite_eq_left (c := EarlierCoherent Label a (fun i => birthRun Label i.val)) - (birthRun_earlier_coherent Label a)) - -theorem birthRun_source (a : Column) (x : (stage Label a).Point) : - (∃ i : Set.Iio a, ∃ y, (transition Label i.property.le).points.toFun y = x ∧ - (birthRun Label a).birth x = (birthRun Label i.val).birth y) ∨ - main ((birthRun Label a).birth x) = a := by - rw [birthRun_generated Label a] - exact extendBirths_source Label a (fun i => birthRun Label i.val) - (birthRun_earlier_coherent Label a) x - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open Chronological CountableColumns -universe v -variable (Label : Type 1) (BirthIndex : Type v) [LinearOrder BirthIndex] - -structure BoundedBirthCertificate where - birth : FinalPoint Label → BirthIndex - old_meet : OldMeet (P := finalOrder Label) birth - bound : BirthIndex → Column - covered : ∀ x, ∃ y, (finalInclusion Label (bound (birth x))).toFun y = x - -variable {Label BirthIndex} [WellFoundedLT BirthIndex] - -omit [WellFoundedLT BirthIndex] in -theorem BoundedBirthCertificate.fiber_basis - (c : BoundedBirthCertificate Label BirthIndex) (F : MeetFilter (finalOrder Label)) - (t : BirthIndex) : - CountableBelow F (fun x => Essential c.birth F x ∧ c.birth x = t) := by - apply countableBelow_mono F - (countableBelow_copy (finalInclusion Label (c.bound t)) F - (stage_all_filters_countable Label (c.bound t))) - intro x hx - refine ⟨hx.1.1, ?_⟩ - have represented := c.covered x - rw [hx.2] at represented - exact represented - -theorem BoundedBirthCertificate.all_filters_countable - (c : BoundedBirthCertificate Label BirthIndex) : AllFiltersCountable (finalOrder Label) := by - intro F - apply countable_basis_of_layers c.birth F - · exact essential_stages_countable c.birth (finalHeight Label) - CountableColumns.descending_property c.old_meet F - · exact c.fiber_basis F - -theorem BoundedBirthCertificate.localizes - (c : BoundedBirthCertificate Label BirthIndex) (F : MeetFilter (finalOrder Label)) : - LocalizedFilter Label F := basis_localized Label F (c.all_filters_countable F) - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open Chronological CountableColumns BirthLabels -variable (Label : Type 1) - -theorem birthRun_origin (a : Column) : ∀ x : (stage Label a).Point, - ∃ y, (finalInclusion Label (main ((birthRun Label a).birth x))).toFun y = - (finalInclusion Label a).toFun x := by - refine (show WellFounded ((· < ·) : Column → Column → Prop) from wellFounded_lt).induction - (C := fun a => ∀ x : (stage Label a).Point, - ∃ y, (finalInclusion Label (main ((birthRun Label a).birth x))).toFun y = - (finalInclusion Label a).toFun x) a ?_ - intro a ih x - rcases birthRun_source Label a x with ⟨i, y, eq, born⟩ | fresh - · rw [born] - rcases ih i.val i.property y with ⟨z, hz⟩ - exact ⟨z, hz.trans ((final_points_coherent Label i.property.le y).symm.trans - (congrArg (finalInclusion Label a).toFun eq))⟩ - · rw [fresh] - exact ⟨x, rfl⟩ - -noncomputable def finalBirth : FinalPoint Label → Index := - (diagram Label).orders.system.descend (fun a => (birthRun Label a).birth) - (fun {_ b} h x => birthRun_coherent_at Label b _ h x) - -theorem finalBirth_stage (a : Column) (x : (stage Label a).Point) : - finalBirth Label ((finalInclusion Label a).toFun x) = (birthRun Label a).birth x := rfl - -theorem finalBirth_old_meet : OldMeet (P := finalOrder Label) (finalBirth Label) := - oldMeet_of_covered_stages (fun a => (stage Label a).order) (finalBirth Label) - (fun a => (birthRun Label a).birth) (finalInclusion Label) (fun _ _ => rfl) - ((diagram Label).orders.system.pair_cover (diagram Label).orders.system) - (fun a => (birthRun Label a).old_meet) - -theorem finalBirth_origin (x : FinalPoint Label) : - ∃ y, (finalInclusion Label (main (finalBirth Label x))).toFun y = x := by - rcases final_point_cover Label x with ⟨a, x, rfl⟩ - exact birthRun_origin Label a x - -theorem finalBirth_main_le (a : Column) (x : (stage Label a).Point) : - main (finalBirth Label ((finalInclusion Label a).toFun x)) ≤ a := - main_le ((birthRun Label a).bounded x) - -theorem finalBirth_main_eq_canonical (x : FinalPoint Label) : - main (finalBirth Label x) = (diagram Label).orders.system.birth x := by - apply le_antisymm - · rcases (diagram Label).orders.system.present_birth x with ⟨y, eq⟩ - have bounded := finalBirth_main_le Label ((diagram Label).orders.system.birth x) y - change main (finalBirth Label ((diagram Label).orders.system.point - ((diagram Label).orders.system.birth x) y)) ≤ _ at bounded - rw [eq] at bounded - exact bounded - · exact ((diagram Label).orders.system.birth_le_iff x _).mpr (finalBirth_origin Label x) - -noncomputable def finalBirthCertificate : BoundedBirthCertificate Label Index where - birth := finalBirth Label - old_meet := finalBirth_old_meet Label - bound := main - covered := finalBirth_origin Label - -theorem final_all_filters_countable : AllFiltersCountable (finalOrder Label) := - (finalBirthCertificate Label).all_filters_countable - -theorem final_filter_basis (F : MeetFilter (finalOrder Label)) : CountableBasis F := - final_all_filters_countable Label F - -theorem final_filters_localized (F : MeetFilter (finalOrder Label)) : LocalizedFilter Label F := - (finalBirthCertificate Label).localizes F - -theorem countableOrdinalLabels_final_filter_basis (F : MeetFilter (finalOrder Column)) : - CountableBasis F := final_filter_basis Column F - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -open CountableColumns -universe v w -variable (Label : Type 1) - -theorem final_countable_upper_bound (B : Set (FinalPoint Label)) (small : B.Countable) : - ∃ top, ∀ x ∈ B, (finalOrder Label).le x top := by - rcases countable_points_in_stage Label B small with ⟨a, cover⟩ - refine ⟨(finalInclusion Label a).toFun (stage Label a).top, ?_⟩ - intro x hx - rcases cover x hx with ⟨y, rfl⟩ - exact ((finalInclusion Label a).le_iff _ _).mpr ((stage Label a).greatest y) - -theorem countable_actors_in_stage (B : Set (FinalActor Label)) (small : B.Countable) : - ∃ a, ∀ g ∈ B, ∃ h, finalGroupInclusion Label a h = g := by - classical - let := small.to_subtype - let index (g : B) : Column := Classical.choose (final_actor_cover Label g.val) - have represented (g : B) : ∃ h, finalGroupInclusion Label (index g) h = g.val := - Classical.choose_spec (final_actor_cover Label g.val) - refine ⟨upperBound index, ?_⟩ - intro g hg - rcases represented ⟨g, hg⟩ with ⟨h, eq⟩ - have lower : index ⟨g, hg⟩ < upperBound index := upperBound_above index ⟨g, hg⟩ - exact ⟨(transition Label lower.le).actors h, (final_actors_coherent Label lower.le h).trans eq⟩ - -theorem countable_data_in_stage {I : Type v} {J : Type w} [Countable I] [Countable J] - (points : I → FinalPoint Label) (actors : J → FinalActor Label) : - ∃ a, (∀ i, ∃ x, (finalInclusion Label a).toFun x = points i) ∧ - (∀ j, ∃ g, finalGroupInclusion Label a g = actors j) := by - rcases countable_points_in_stage Label (Set.range points) (Set.countable_range points) with ⟨a, hp⟩ - rcases countable_actors_in_stage Label (Set.range actors) (Set.countable_range actors) with ⟨b, hg⟩ - refine ⟨max a b, ?_, ?_⟩ - · intro i - rcases hp (points i) (Set.mem_range_self i) with ⟨x, hx⟩ - exact ⟨(transition Label (le_max_left a b)).points.toFun x, - (final_points_coherent Label (le_max_left a b) x).trans hx⟩ - · intro j - rcases hg (actors j) (Set.mem_range_self j) with ⟨g, hg⟩ - exact ⟨(transition Label (le_max_right a b)).actors g, - (final_actors_coherent Label (le_max_right a b) g).trans hg⟩ - -end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FinalFilterLocalization + +namespace OAI + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open CountableColumns BirthLabels +variable (Label : Type 1) + +noncomputable def birthStep (a : Column) + (past : ∀ b, b < a → BirthRecord (stage Label b) b) : BirthRecord (stage Label a) a := by + classical + let seed : EarlierBirths Label a := fun i => past i.val i.property + exact if coherent : EarlierCoherent Label a seed then extendBirths Label a seed coherent + else BirthRecord.constant (stage Label a) a + +noncomputable def birthRun : ∀ a : Column, BirthRecord (stage Label a) a := + wellFounded_lt.fix (birthStep Label) + +theorem birthRun_eq (a : Column) : + birthRun Label a = birthStep Label a (fun b _ => birthRun Label b) := wellFounded_lt.fix_eq _ a + +theorem birthRun_coherent_at (a : Column) : ∀ b (h : b ≤ a) (x : (stage Label b).Point), + (birthRun Label a).birth ((transition Label h).points.toFun x) = (birthRun Label b).birth x := by + refine (show WellFounded ((· < ·) : Column → Column → Prop) from wellFounded_lt).induction + (C := fun a => ∀ b (h : b ≤ a) (x : (stage Label b).Point), + (birthRun Label a).birth ((transition Label h).points.toFun x) = (birthRun Label b).birth x) a ?_ + intro a ih + let seed : EarlierBirths Label a := fun i => birthRun Label i.val + have coherent : EarlierCoherent Label a seed := by + intro i j h x + exact ih j.val j.property i.val h x + have generated : birthRun Label a = extendBirths Label a seed coherent := + (birthRun_eq Label a).trans (dite_eq_left (c := EarlierCoherent Label a seed) coherent) + intro b h x + rcases lt_or_eq_of_le h with lower | rfl + · rw [generated] + exact extendBirths_preserves Label a seed coherent ⟨b, lower⟩ x + · rw [transition_self] + rfl + +theorem birthRun_earlier_coherent (a : Column) : + EarlierCoherent Label a (fun i => birthRun Label i.val) := + fun {_ j} h x => birthRun_coherent_at Label j.val _ h x + +theorem birthRun_generated (a : Column) : + birthRun Label a = extendBirths Label a (fun i => birthRun Label i.val) + (birthRun_earlier_coherent Label a) := + (birthRun_eq Label a).trans + (dite_eq_left (c := EarlierCoherent Label a (fun i => birthRun Label i.val)) + (birthRun_earlier_coherent Label a)) + +theorem birthRun_source (a : Column) (x : (stage Label a).Point) : + (∃ i : Set.Iio a, ∃ y, (transition Label i.property.le).points.toFun y = x ∧ + (birthRun Label a).birth x = (birthRun Label i.val).birth y) ∨ + main ((birthRun Label a).birth x) = a := by + rw [birthRun_generated Label a] + exact extendBirths_source Label a (fun i => birthRun Label i.val) + (birthRun_earlier_coherent Label a) x + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open Chronological CountableColumns +universe v +variable (Label : Type 1) (BirthIndex : Type v) [LinearOrder BirthIndex] + +structure BoundedBirthCertificate where + birth : FinalPoint Label → BirthIndex + old_meet : OldMeet (P := finalOrder Label) birth + bound : BirthIndex → Column + covered : ∀ x, ∃ y, (finalInclusion Label (bound (birth x))).toFun y = x + +variable {Label BirthIndex} [WellFoundedLT BirthIndex] + +omit [WellFoundedLT BirthIndex] in +theorem BoundedBirthCertificate.fiber_basis + (c : BoundedBirthCertificate Label BirthIndex) (F : MeetFilter (finalOrder Label)) + (t : BirthIndex) : + CountableBelow F (fun x => Essential c.birth F x ∧ c.birth x = t) := by + apply countableBelow_mono F + (countableBelow_copy (finalInclusion Label (c.bound t)) F + (stage_all_filters_countable Label (c.bound t))) + intro x hx + refine ⟨hx.1.1, ?_⟩ + have represented := c.covered x + rw [hx.2] at represented + exact represented + +theorem BoundedBirthCertificate.all_filters_countable + (c : BoundedBirthCertificate Label BirthIndex) : AllFiltersCountable (finalOrder Label) := by + intro F + apply countable_basis_of_layers c.birth F + · exact essential_stages_countable c.birth (finalHeight Label) + CountableColumns.descending_property c.old_meet F + · exact c.fiber_basis F + +theorem BoundedBirthCertificate.localizes + (c : BoundedBirthCertificate Label BirthIndex) (F : MeetFilter (finalOrder Label)) : + LocalizedFilter Label F := basis_localized Label F (c.all_filters_countable F) + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open Chronological CountableColumns BirthLabels +variable (Label : Type 1) + +theorem birthRun_origin (a : Column) : ∀ x : (stage Label a).Point, + ∃ y, (finalInclusion Label (main ((birthRun Label a).birth x))).toFun y = + (finalInclusion Label a).toFun x := by + refine (show WellFounded ((· < ·) : Column → Column → Prop) from wellFounded_lt).induction + (C := fun a => ∀ x : (stage Label a).Point, + ∃ y, (finalInclusion Label (main ((birthRun Label a).birth x))).toFun y = + (finalInclusion Label a).toFun x) a ?_ + intro a ih x + rcases birthRun_source Label a x with ⟨i, y, eq, born⟩ | fresh + · rw [born] + rcases ih i.val i.property y with ⟨z, hz⟩ + exact ⟨z, hz.trans ((final_points_coherent Label i.property.le y).symm.trans + (congrArg (finalInclusion Label a).toFun eq))⟩ + · rw [fresh] + exact ⟨x, rfl⟩ + +noncomputable def finalBirth : FinalPoint Label → Index := + (diagram Label).orders.system.descend (fun a => (birthRun Label a).birth) + (fun {_ b} h x => birthRun_coherent_at Label b _ h x) + +theorem finalBirth_stage (a : Column) (x : (stage Label a).Point) : + finalBirth Label ((finalInclusion Label a).toFun x) = (birthRun Label a).birth x := rfl + +theorem finalBirth_old_meet : OldMeet (P := finalOrder Label) (finalBirth Label) := + oldMeet_of_covered_stages (fun a => (stage Label a).order) (finalBirth Label) + (fun a => (birthRun Label a).birth) (finalInclusion Label) (fun _ _ => rfl) + ((diagram Label).orders.system.pair_cover (diagram Label).orders.system) + (fun a => (birthRun Label a).old_meet) + +theorem finalBirth_origin (x : FinalPoint Label) : + ∃ y, (finalInclusion Label (main (finalBirth Label x))).toFun y = x := by + rcases final_point_cover Label x with ⟨a, x, rfl⟩ + exact birthRun_origin Label a x + +theorem finalBirth_main_le (a : Column) (x : (stage Label a).Point) : + main (finalBirth Label ((finalInclusion Label a).toFun x)) ≤ a := + main_le ((birthRun Label a).bounded x) + +theorem finalBirth_main_eq_canonical (x : FinalPoint Label) : + main (finalBirth Label x) = (diagram Label).orders.system.birth x := by + apply le_antisymm + · rcases (diagram Label).orders.system.present_birth x with ⟨y, eq⟩ + have bounded := finalBirth_main_le Label ((diagram Label).orders.system.birth x) y + change main (finalBirth Label ((diagram Label).orders.system.point + ((diagram Label).orders.system.birth x) y)) ≤ _ at bounded + rw [eq] at bounded + exact bounded + · exact ((diagram Label).orders.system.birth_le_iff x _).mpr (finalBirth_origin Label x) + +noncomputable def finalBirthCertificate : BoundedBirthCertificate Label Index where + birth := finalBirth Label + old_meet := finalBirth_old_meet Label + bound := main + covered := finalBirth_origin Label + +theorem final_all_filters_countable : AllFiltersCountable (finalOrder Label) := + (finalBirthCertificate Label).all_filters_countable + +theorem final_filter_basis (F : MeetFilter (finalOrder Label)) : CountableBasis F := + final_all_filters_countable Label F + +theorem final_filters_localized (F : MeetFilter (finalOrder Label)) : LocalizedFilter Label F := + (finalBirthCertificate Label).localizes F + +theorem countableOrdinalLabels_final_filter_basis (F : MeetFilter (finalOrder Column)) : + CountableBasis F := final_filter_basis Column F + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +open CountableColumns +universe v w +variable (Label : Type 1) + +theorem final_countable_upper_bound (B : Set (FinalPoint Label)) (small : B.Countable) : + ∃ top, ∀ x ∈ B, (finalOrder Label).le x top := by + rcases countable_points_in_stage Label B small with ⟨a, cover⟩ + refine ⟨(finalInclusion Label a).toFun (stage Label a).top, ?_⟩ + intro x hx + rcases cover x hx with ⟨y, rfl⟩ + exact ((finalInclusion Label a).le_iff _ _).mpr ((stage Label a).greatest y) + +theorem countable_actors_in_stage (B : Set (FinalActor Label)) (small : B.Countable) : + ∃ a, ∀ g ∈ B, ∃ h, finalGroupInclusion Label a h = g := by + classical + let := small.to_subtype + let index (g : B) : Column := Classical.choose (final_actor_cover Label g.val) + have represented (g : B) : ∃ h, finalGroupInclusion Label (index g) h = g.val := + Classical.choose_spec (final_actor_cover Label g.val) + refine ⟨upperBound index, ?_⟩ + intro g hg + rcases represented ⟨g, hg⟩ with ⟨h, eq⟩ + have lower : index ⟨g, hg⟩ < upperBound index := upperBound_above index ⟨g, hg⟩ + exact ⟨(transition Label lower.le).actors h, (final_actors_coherent Label lower.le h).trans eq⟩ + +theorem countable_data_in_stage {I : Type v} {J : Type w} [Countable I] [Countable J] + (points : I → FinalPoint Label) (actors : J → FinalActor Label) : + ∃ a, (∀ i, ∃ x, (finalInclusion Label a).toFun x = points i) ∧ + (∀ j, ∃ g, finalGroupInclusion Label a g = actors j) := by + rcases countable_points_in_stage Label (Set.range points) (Set.countable_range points) with ⟨a, hp⟩ + rcases countable_actors_in_stage Label (Set.range actors) (Set.countable_range actors) with ⟨b, hg⟩ + refine ⟨max a b, ?_, ?_⟩ + · intro i + rcases hp (points i) (Set.mem_range_self i) with ⟨x, hx⟩ + exact ⟨(transition Label (le_max_left a b)).points.toFun x, + (final_points_coherent Label (le_max_left a b) x).trans hx⟩ + · intro j + rcases hg (actors j) (Set.mem_range_self j) with ⟨g, hg⟩ + exact ⟨(transition Label (le_max_right a b)).actors g, + (final_actors_coherent Label (le_max_right a b) g).trans hg⟩ + +end PartitionPilot.Compression.RecursiveMaps.MainStage.OrdinalRun + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFamilyRankBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFamilyRankBounds.lean index a04e7b268dbfdd0b04f51b977085e2985eca552b..02521894b9d8ccf26f423eca78fcaf21297eddad 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFamilyRankBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFamilyRankBounds.lean @@ -1,71 +1,71 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLiteralTaskFieldRecognition - -namespace OAI - - -namespace PartitionPilot -universe u -namespace SetRealization - -theorem rank_functionGraph_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {A B f : ZFSet.{u}} (function : ZFSet.IsFunc A B f) - (source : ZFSet.rank A < o) (target : ZFSet.rank B < o) : - ZFSet.rank f < o := - (ZFSet.rank_mono function.1).trans_lt (rank_product_lt limit source target) - -end SetRealization - -namespace Forcing -open SetRealization - -theorem rank_nonemptyTupleCode_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) (bounds : ∀ j, ZFSet.rank (fields j) < o) : - ZFSet.rank (nonemptyTupleCode k fields) < o := by - induction k with - | zero => exact bounds 0 - | succ k ih => exact rank_orderedPair_lt limit (bounds 0) (ih _ (fun j => bounds j.succ)) - -end Forcing -end PartitionPilot - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include limit - -theorem rank_finiteRange_lt (n : Nat) (f : Fin n → ZFSet.{u}) - (bounds : ∀ i, ZFSet.rank (f i) < o) : ZFSet.rank (ZFSet.range f) < o := by - induction n with - | zero => - have empty : ZFSet.range f = ∅ := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_range] - exact ⟨fun ⟨i, _⟩ => Fin.elim0 i, fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ - simpa only [empty, ZFSet.rank_empty] using limit.pos - | succ n ih => - have split : ZFSet.range f = insert (f 0) (ZFSet.range (fun i : Fin n => f i.succ)) := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_range, ZFSet.mem_insert_iff, ZFSet.mem_range] - constructor - · rintro ⟨i, equal⟩ - exact Fin.cases (fun h => Or.inl h.symm) (fun j h => Or.inr ⟨j, h⟩) i equal - · rintro (equal | ⟨i, equal⟩) - · exact ⟨0, equal.symm⟩ - · exact ⟨i.succ, equal⟩ - rw [split, ZFSet.rank_insert] - exact max_lt (limit.succ_lt (bounds 0)) (ih _ (fun i => bounds i.succ)) - -theorem rank_constantFamilyGraph_lt {I x : ZFSet.{u}} - (domain : ZFSet.rank I < o) (value : ZFSet.rank x < o) : - ZFSet.rank (constantFamilyGraph I x) < o := - rank_functionGraph_lt limit (constantFamilyGraph_function I x) domain - (rank_singleton_lt limit value) - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLiteralTaskFieldRecognition + +namespace OAI + + +namespace PartitionPilot +universe u +namespace SetRealization + +theorem rank_functionGraph_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {A B f : ZFSet.{u}} (function : ZFSet.IsFunc A B f) + (source : ZFSet.rank A < o) (target : ZFSet.rank B < o) : + ZFSet.rank f < o := + (ZFSet.rank_mono function.1).trans_lt (rank_product_lt limit source target) + +end SetRealization + +namespace Forcing +open SetRealization + +theorem rank_nonemptyTupleCode_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) (bounds : ∀ j, ZFSet.rank (fields j) < o) : + ZFSet.rank (nonemptyTupleCode k fields) < o := by + induction k with + | zero => exact bounds 0 + | succ k ih => exact rank_orderedPair_lt limit (bounds 0) (ih _ (fun j => bounds j.succ)) + +end Forcing +end PartitionPilot + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include limit + +theorem rank_finiteRange_lt (n : Nat) (f : Fin n → ZFSet.{u}) + (bounds : ∀ i, ZFSet.rank (f i) < o) : ZFSet.rank (ZFSet.range f) < o := by + induction n with + | zero => + have empty : ZFSet.range f = ∅ := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_range] + exact ⟨fun ⟨i, _⟩ => Fin.elim0 i, fun hx => False.elim (ZFSet.notMem_empty x hx)⟩ + simpa only [empty, ZFSet.rank_empty] using limit.pos + | succ n ih => + have split : ZFSet.range f = insert (f 0) (ZFSet.range (fun i : Fin n => f i.succ)) := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_range, ZFSet.mem_insert_iff, ZFSet.mem_range] + constructor + · rintro ⟨i, equal⟩ + exact Fin.cases (fun h => Or.inl h.symm) (fun j h => Or.inr ⟨j, h⟩) i equal + · rintro (equal | ⟨i, equal⟩) + · exact ⟨0, equal.symm⟩ + · exact ⟨i.succ, equal⟩ + rw [split, ZFSet.rank_insert] + exact max_lt (limit.succ_lt (bounds 0)) (ih _ (fun i => bounds i.succ)) + +theorem rank_constantFamilyGraph_lt {I x : ZFSet.{u}} + (domain : ZFSet.rank I < o) (value : ZFSet.rank x < o) : + ZFSet.rank (constantFamilyGraph I x) < o := + rank_functionGraph_lt limit (constantFamilyGraph_function I x) domain + (rank_singleton_lt limit value) + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFlatHistoryCoherence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFlatHistoryCoherence.lean index 49b66cc93220cf46ba74eea8fb310671892df704..8c748a27f2630a687010cde19774784e7d908362 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFlatHistoryCoherence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/FiniteFlatHistoryCoherence.lean @@ -1,418 +1,418 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentTransitionFamilies -import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementIndexThreeLevels -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing -universe u - -noncomputable def finiteStageHistory (values : Nat → ZFSet.{u}) : Nat → ZFSet.{u} - | 0 => ∅ - | n + 1 => insert (ZFSet.pair (natSetCode n) (values n)) (finiteStageHistory values n) - -theorem mem_finiteStageHistory (values : Nat → ZFSet.{u}) (n : Nat) (z : ZFSet.{u}) : - z ∈ finiteStageHistory values n ↔ ∃ i < n, z = ZFSet.pair (natSetCode i) (values i) := by - induction n with - | zero => simp [finiteStageHistory] - | succ n ih => - rw [finiteStageHistory, ZFSet.mem_insert_iff, ih] - constructor - · rintro (equal | ⟨i, hi, equal⟩) - · exact ⟨n, Nat.lt_succ_self n, equal⟩ - · exact ⟨i, Nat.lt_succ_of_lt hi, equal⟩ - · rintro ⟨i, hi, equal⟩ - rcases Nat.lt_or_eq_of_le (Nat.le_of_lt_succ hi) with hi | rfl - · exact Or.inr ⟨i, hi, equal⟩ - · exact Or.inl equal - -theorem pair_mem_finiteStageHistory (values : Nat → ZFSet.{u}) (n i : Nat) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode i) y ∈ finiteStageHistory values n ↔ i < n ∧ y = values i := by - rw [mem_finiteStageHistory] - constructor - · rintro ⟨j, hj, equal⟩ - obtain ⟨index, value⟩ := ZFSet.pair_inj.1 equal - obtain rfl := natSetCode_injective index - exact ⟨hj, value⟩ - · rintro ⟨hi, rfl⟩ - exact ⟨i, hi, rfl⟩ - -theorem finiteStageHistory_function (values : Nat → ZFSet.{u}) (n : Nat) : - FunctionGraphOn (natSetCode n) (finiteStageHistory values n) := by - induction n with - | zero => exact FunctionGraphOn.empty - | succ n ih => - rw [natSetCode_succ, finiteStageHistory] - exact ih.insert (ZFSet.mem_irrefl _) (values n) - -theorem finiteStageHistory_restrict (values : Nat → ZFSet.{u}) {m n : Nat} (below : m ≤ n) : - graphRestriction (natSetCode m) (finiteStageHistory values n) = finiteStageHistory values m := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz - obtain ⟨i, hi, equal⟩ := (mem_finiteStageHistory values n _).1 entry - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact (pair_mem_finiteStageHistory values m i _).2 ⟨(natSetCode_mem_iff i m).1 hx, rfl⟩ - · intro hz - obtain ⟨i, hi, rfl⟩ := (mem_finiteStageHistory values m z).1 hz - exact pair_mem_graphRestriction.2 - ⟨(pair_mem_finiteStageHistory values n i _).2 ⟨Nat.lt_of_lt_of_le hi below, rfl⟩, - (natSetCode_mem_iff i m).2 hi⟩ - -theorem finiteStageHistory_congr {values other : Nat → ZFSet.{u}} (n : Nat) - (same : ∀ i < n, values i = other i) : finiteStageHistory values n = finiteStageHistory other n := by - apply ZFSet.ext - intro z - rw [mem_finiteStageHistory, mem_finiteStageHistory] - constructor - · rintro ⟨i, hi, equal⟩ - exact ⟨i, hi, equal.trans (congrArg (ZFSet.pair (natSetCode i)) (same i hi))⟩ - · rintro ⟨i, hi, equal⟩ - exact ⟨i, hi, equal.trans (congrArg (ZFSet.pair (natSetCode i)) (same i hi).symm)⟩ - -theorem flatHistoryCuts_finite_iff (values : Nat → ZFSet.{u}) (n : Nat) - (levels row A : ZFSet.{u}) : - FlatHistoryCuts (natSetCode n) (finiteStageHistory values n) levels row A ↔ - ∀ i < n, ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i := by - constructor - · intro valid i hi - obtain ⟨Q, entry, member⟩ := valid (natSetCode i) ((natSetCode_mem_iff i n).2 hi) - exact ((pair_mem_finiteStageHistory values n i Q).1 entry).2 ▸ member - · intro valid beta hbeta - obtain ⟨i, hi, rfl⟩ := (mem_natSetCode beta n).1 hbeta - exact ⟨values i, (pair_mem_finiteStageHistory values n i _).2 ⟨hi, rfl⟩, valid i hi⟩ - -theorem finiteFlatCuts_down (values : Nat → ZFSet.{u}) (n : Nat) (levels : ZFSet.{u}) - (self : ∀ i < n, ∀ row A, ZFSet.pair row A ∈ values i → - assignmentCut levels (natSetCode i) A = A) - (adjacent : ∀ i, i + 1 < n → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → - ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i) : - ∀ i < n, ∀ j, j ≤ i → ∀ row A, ZFSet.pair row A ∈ values i → - ZFSet.pair row (assignmentCut levels (natSetCode j) A) ∈ values j := by - intro i - induction i with - | zero => - intro hi j hj row A member - have equal : j = 0 := Nat.eq_zero_of_le_zero hj - subst j - rw [self 0 hi row A member] - exact member - | succ i ih => - intro hi j hj row A member - rcases Nat.lt_or_eq_of_le hj with hj | rfl - · have below : j ≤ i := Nat.le_of_lt_succ hj - have cut := adjacent i hi row A member - have result := ih (Nat.lt_of_succ_lt hi) j below row - (assignmentCut levels (natSetCode i) A) cut - have subset : (natSetCode j : ZFSet.{u}) ⊆ natSetCode i := by - intro z hz - obtain ⟨k, hk, rfl⟩ := (mem_natSetCode z j).1 hz - exact (natSetCode_mem_iff k i).2 (Nat.lt_of_lt_of_le hk below) - rwa [assignmentCut_nested subset] at result - · rw [self (i + 1) hi row A member] - exact member - -theorem finiteFlatCuts_history (values : Nat → ZFSet.{u}) (n : Nat) (levels : ZFSet.{u}) - (self : ∀ i < n, ∀ row A, ZFSet.pair row A ∈ values i → - assignmentCut levels (natSetCode i) A = A) - (adjacent : ∀ i, i + 1 < n → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → - ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i) - {i : Nat} (hi : i < n) (row A : ZFSet.{u}) (member : ZFSet.pair row A ∈ values i) : - FlatHistoryCuts (natSetCode (i + 1)) (finiteStageHistory values (i + 1)) levels row A := by - rw [flatHistoryCuts_finite_iff] - intro j hj - exact finiteFlatCuts_down values n levels self adjacent i hi j (Nat.le_of_lt_succ hj) row A member - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem finiteStageHistory_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (values : Nat → ZFSet.{u}) (n : Nat) - (ground : ∀ i < n, values i ∈ M.sets) : finiteStageHistory values n ∈ M.sets := by - induction n with - | zero => exact M.empty_mem ⟨ZFSet.omega, M.omega_mem separation infinite⟩ - | succ n ih => - exact M.insert_mem pairing unions - (M.orderedPair_mem pairing (M.natSetCode_mem separation infinite n) - (ground n (Nat.lt_succ_self n))) - (ih (fun i hi => ground i (Nat.lt_succ_of_lt hi))) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -universe u - -noncomputable def stageThreeAssignmentLevels (I0 I1 I2 T : ZFSet.{u}) : ZFSet.{u} := - assignmentIndexLevels ((I0 ∪ I1) ∪ I2) T (natSetCode 3) - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) - -variable {I0 I1 I2 T : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) -include first second third - -theorem pair_mem_stageThreeAssignmentLevels (z level : ZFSet.{u}) : - ZFSet.pair z level ∈ stageThreeAssignmentLevels I0 I1 I2 T ↔ - (z ∈ stageOneAssignments I0 T ∧ level = ∅) ∨ - (z ∈ stageOneAssignments I1 T ∧ level = natSetCode 1) ∨ - (z ∈ stageOneAssignments I2 T ∧ level = natSetCode 2) := by - rw [stageThreeAssignmentLevels, pair_mem_assignmentIndexLevels] - constructor - · rintro ⟨i, _, u, hu, w, hw, rfl, _, entry⟩ - rcases (first.three_level_entry second third i level).1 entry with h0 | h1 | h2 - · exact Or.inl ⟨(stageOneAssignment_mem_assignments I0 T i u w).2 ⟨h0.1, hu, hw⟩, h0.2⟩ - · exact Or.inr (Or.inl ⟨(stageOneAssignment_mem_assignments I1 T i u w).2 ⟨h1.1, hu, hw⟩, h1.2⟩) - · exact Or.inr (Or.inr ⟨(stageOneAssignment_mem_assignments I2 T i u w).2 ⟨h2.1, hu, hw⟩, h2.2⟩) - · rintro (⟨hz, rfl⟩ | ⟨hz, rfl⟩ | ⟨hz, rfl⟩) - · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 hz - exact ⟨i, ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inl hi))), - u, hu, w, hw, rfl, (natSetCode_mem_iff 0 3).2 (by decide), - (first.three_level_entry second third i ∅).2 (Or.inl ⟨hi, rfl⟩)⟩ - · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I1 T z).1 hz - exact ⟨i, ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inr hi))), - u, hu, w, hw, rfl, (natSetCode_mem_iff 1 3).2 (by decide), - (first.three_level_entry second third i (natSetCode 1)).2 (Or.inr (Or.inl ⟨hi, rfl⟩))⟩ - · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I2 T z).1 hz - exact ⟨i, ZFSet.mem_union.2 (Or.inr hi), - u, hu, w, hw, rfl, (natSetCode_mem_iff 2 3).2 (by decide), - (first.three_level_entry second third i (natSetCode 2)).2 (Or.inr (Or.inr ⟨hi, rfl⟩))⟩ - -theorem stageThreeAssignmentLevels_function : - ZFSet.IsFunc (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (natSetCode 3) - (stageThreeAssignmentLevels I0 I1 I2 T) := - assignmentIndexLevels_function (first.three_level_function second third) - -theorem stageThreeAssignmentLevels_eq : - stageThreeAssignmentLevels I0 I1 I2 T = - (ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ - ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1}) ∪ - ZFSet.prod (stageOneAssignments I2 T) {natSetCode 2} := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, _, level, _, rfl⟩ := ZFSet.mem_prod.1 - ((stageThreeAssignmentLevels_function first second third).1 hz) - simpa only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton, or_assoc] using - (pair_mem_stageThreeAssignmentLevels first second third x level).1 hz - · intro hz - rcases ZFSet.mem_union.1 hz with lower | upper - · rcases ZFSet.mem_union.1 lower with zero | one - · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 zero - exact (pair_mem_stageThreeAssignmentLevels first second third x level).2 - (Or.inl ⟨hx, ZFSet.mem_singleton.1 hl⟩) - · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 one - exact (pair_mem_stageThreeAssignmentLevels first second third x level).2 - (Or.inr (Or.inl ⟨hx, ZFSet.mem_singleton.1 hl⟩)) - · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 upper - exact (pair_mem_stageThreeAssignmentLevels first second third x level).2 - (Or.inr (Or.inr ⟨hx, ZFSet.mem_singleton.1 hl⟩)) - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {I0 I1 I2 T : ZFSet.{u}} -include pairing unions powers separation - -theorem stageThreeIndexLevels_mem (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (hI2 : I2 ∈ M.sets) : - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ∈ M.sets := by - have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I0, hI0⟩ - have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 - have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 - have h3 : natSetCode 3 ∈ M.sets := M.insert_mem pairing unions h2 h2 - exact M.refinementIndexFieldGraph_mem pairing unions powers separation - (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) h3 0 - -theorem stageThreeAssignmentLevels_mem (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (hI2 : I2 ∈ M.sets) (hT : T ∈ M.sets) : - stageThreeAssignmentLevels I0 I1 I2 T ∈ M.sets := by - have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I0, hI0⟩ - have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 - have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 - have h3 : natSetCode 3 ∈ M.sets := M.insert_mem pairing unions h2 h2 - exact M.assignmentIndexLevels_mem pairing unions powers separation - (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) hT h3 - (M.stageThreeIndexLevels_mem pairing unions powers separation hI0 hI1 hI2) - -theorem stageThreeLevelData (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (hI2 : I2 ∈ M.sets) (hT : T ∈ M.sets) - (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (third : RefinementIndexLevelCode I2 (natSetCode 2)) : - ((I0 ∪ I1) ∪ I2) ∈ M.sets ∧ - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ∈ M.sets ∧ - stageThreeAssignmentLevels I0 I1 I2 T ∈ M.sets ∧ - ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) (natSetCode 3) - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) ∧ - ZFSet.IsFunc (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (natSetCode 3) - (stageThreeAssignmentLevels I0 I1 I2 T) ∧ - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 = - (ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1}) ∪ ZFSet.prod I2 {natSetCode 2} ∧ - stageThreeAssignmentLevels I0 I1 I2 T = - (ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ - ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1}) ∪ - ZFSet.prod (stageOneAssignments I2 T) {natSetCode 2} ∧ - (∀ x, ¬ (x ∈ I0 ∧ x ∈ I1)) ∧ (∀ x, ¬ (x ∈ I0 ∧ x ∈ I2)) ∧ - (∀ x, ¬ (x ∈ I1 ∧ x ∈ I2)) := by - exact ⟨M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2, - M.stageThreeIndexLevels_mem pairing unions powers separation hI0 hI1 hI2, - M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 hI2 hT, - first.three_level_function second third, stageThreeAssignmentLevels_function first second third, - first.three_level_graph second third, stageThreeAssignmentLevels_eq first second third, - first.three_levels_disjoint second third⟩ - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -universe u - -noncomputable def threeRefinementHistory (I0 I1 I2 : ZFSet.{u}) : ZFSet.{u} := - finiteStageHistory (fun | 0 => I0 | 1 => I1 | _ => I2) 3 - -theorem pair_mem_threeRefinementHistory (I0 I1 I2 xi I : ZFSet.{u}) : - ZFSet.pair xi I ∈ threeRefinementHistory I0 I1 I2 ↔ - (xi = natSetCode 0 ∧ I = I0) ∨ (xi = natSetCode 1 ∧ I = I1) ∨ - (xi = natSetCode 2 ∧ I = I2) := by - simp only [threeRefinementHistory, finiteStageHistory, ZFSet.mem_insert_iff, - ZFSet.notMem_empty, or_false, ZFSet.pair_inj] - constructor - · rintro (h2 | h1 | h0) - · exact Or.inr (Or.inr h2) - · exact Or.inr (Or.inl h1) - · exact Or.inl h0 - · rintro (h0 | h1 | h2) - · exact Or.inr (Or.inr h0) - · exact Or.inr (Or.inl h1) - · exact Or.inl h2 - -theorem threeRefinementHistory_function (I0 I1 I2 : ZFSet.{u}) : - FunctionGraphOn (natSetCode 3) (threeRefinementHistory I0 I1 I2) := - finiteStageHistory_function _ 3 - -theorem threeRefinementHistory_literal {I0 I1 I2 : ZFSet.{u}} - (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (third : RefinementIndexLevelCode I2 (natSetCode 2)) : - ∀ xi I, ZFSet.pair xi I ∈ threeRefinementHistory I0 I1 I2 → RefinementIndexLevelCode I xi := by - intro xi I entry - rcases (pair_mem_threeRefinementHistory I0 I1 I2 xi I).1 entry with - ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ - · exact first - · exact second - · exact third - -theorem threeRefinementHistory_indices (I0 I1 I2 : ZFSet.{u}) : - refinementHistoryIndices (natSetCode 3) (threeRefinementHistory I0 I1 I2) = (I0 ∪ I1) ∪ I2 := by - apply ZFSet.ext - intro x - rw [mem_refinementHistoryIndices, ZFSet.mem_union, ZFSet.mem_union] - constructor - · rintro ⟨xi, _, I, entry, hi⟩ - rcases (pair_mem_threeRefinementHistory I0 I1 I2 xi I).1 entry with - ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ - · exact Or.inl (Or.inl hi) - · exact Or.inl (Or.inr hi) - · exact Or.inr hi - · have h0 := (pair_mem_threeRefinementHistory I0 I1 I2 (natSetCode 0) I0).2 - (Or.inl ⟨rfl, rfl⟩) - have h1 := (pair_mem_threeRefinementHistory I0 I1 I2 (natSetCode 1) I1).2 - (Or.inr (Or.inl ⟨rfl, rfl⟩)) - have h2 := (pair_mem_threeRefinementHistory I0 I1 I2 (natSetCode 2) I2).2 - (Or.inr (Or.inr ⟨rfl, rfl⟩)) - have function := threeRefinementHistory_function I0 I1 I2 - rintro ((hi | hi) | hi) - · exact ⟨natSetCode 0, function.pair_source h0, I0, h0, hi⟩ - · exact ⟨natSetCode 1, function.pair_source h1, I1, h1, hi⟩ - · exact ⟨natSetCode 2, function.pair_source h2, I2, h2, hi⟩ - -theorem threeRefinementHistory_levels (I0 I1 I2 : ZFSet.{u}) : - refinementHistoryLevels (natSetCode 3) (threeRefinementHistory I0 I1 I2) = - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 := by - rw [refinementHistoryLevels, threeRefinementHistory_indices] - -theorem threeRefinementHistory_assignmentLevels (I0 I1 I2 T : ZFSet.{u}) : - refinementHistoryAssignmentLevels (natSetCode 3) (threeRefinementHistory I0 I1 I2) T = - stageThreeAssignmentLevels I0 I1 I2 T := by - rw [refinementHistoryAssignmentLevels, threeRefinementHistory_indices, threeRefinementHistory_levels] - rfl - -theorem threeRefinementHistory_anchors (I0 I1 I2 B : ZFSet.{u}) : - refinementIndexFieldGraph - (refinementHistoryIndices (natSetCode 3) (threeRefinementHistory I0 I1 I2)) B 2 = - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) B 2 := by - rw [threeRefinementHistory_indices] - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u - -theorem threeRefinementHistory_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {I0 I1 I2 : ZFSet.{u}} (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) : - threeRefinementHistory I0 I1 I2 ∈ M.sets := by - have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I0, hI0⟩ - have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 - have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 - exact M.insert_mem pairing unions (M.orderedPair_mem pairing h2 hI2) - (M.insert_mem pairing unions (M.orderedPair_mem pairing h1 hI1) - (M.insert_mem pairing unions (M.orderedPair_mem pairing h0 hI0) h0)) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -universe u - -structure FiniteFlatHistoryCoherence (M : TransitiveGround.{u}) (values : Nat → ZFSet.{u}) - (n : Nat) (levels : ZFSet.{u}) : Prop where - stages_ground : natSetCode n ∈ M.sets - history_ground : finiteStageHistory values n ∈ M.sets - levels_ground : levels ∈ M.sets - flat : ∀ i < n, ∀ z ∈ values i, ∃ row A, z = ZFSet.pair row A - downward : ∀ i < n, ∀ j, j ≤ i → ∀ row A, ZFSet.pair row A ∈ values i → - ZFSet.pair row (assignmentCut levels (natSetCode j) A) ∈ values j - transition_ground : M.rowAssignmentTransitionFamily (natSetCode n) - (finiteStageHistory values n) levels ∈ M.sets - transition_function : ZFSet.IsFunc (ZFSet.prod (natSetCode n) (natSetCode n)) - (M.groundRelations (⋃₀ ⋃₀ ⋃₀ (finiteStageHistory values n)) (⋃₀ ⋃₀ ⋃₀ (finiteStageHistory values n))) - (M.rowAssignmentTransitionFamily (natSetCode n) (finiteStageHistory values n) levels) - transition_entry : ∀ i < n, ∀ j < n, ∀ R, - ZFSet.pair (ZFSet.pair (natSetCode i) (natSetCode j)) R ∈ - M.rowAssignmentTransitionFamily (natSetCode n) (finiteStageHistory values n) levels ↔ - R = rowAssignmentCutGraph (values i) (values j) levels (natSetCode j) - restriction_function : ∀ i < n, ∀ j, j ≤ i → - ZFSet.IsFunc (values i) (values j) - (rowAssignmentCutGraph (values i) (values j) levels (natSetCode j)) - restriction_identity : ∀ i < n, - rowAssignmentCutGraph (values i) (values i) levels (natSetCode i) = identityFunctionGraph (values i) - restriction_compose : ∀ i < n, ∀ j, j ≤ i → ∀ k, k ≤ j → - relationCompose (values i) (values j) (values k) - (rowAssignmentCutGraph (values i) (values j) levels (natSetCode j)) - (rowAssignmentCutGraph (values j) (values k) levels (natSetCode k)) = - rowAssignmentCutGraph (values i) (values k) levels (natSetCode k) - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentTransitionFamilies +import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementIndexThreeLevels +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing +universe u + +noncomputable def finiteStageHistory (values : Nat → ZFSet.{u}) : Nat → ZFSet.{u} + | 0 => ∅ + | n + 1 => insert (ZFSet.pair (natSetCode n) (values n)) (finiteStageHistory values n) + +theorem mem_finiteStageHistory (values : Nat → ZFSet.{u}) (n : Nat) (z : ZFSet.{u}) : + z ∈ finiteStageHistory values n ↔ ∃ i < n, z = ZFSet.pair (natSetCode i) (values i) := by + induction n with + | zero => simp [finiteStageHistory] + | succ n ih => + rw [finiteStageHistory, ZFSet.mem_insert_iff, ih] + constructor + · rintro (equal | ⟨i, hi, equal⟩) + · exact ⟨n, Nat.lt_succ_self n, equal⟩ + · exact ⟨i, Nat.lt_succ_of_lt hi, equal⟩ + · rintro ⟨i, hi, equal⟩ + rcases Nat.lt_or_eq_of_le (Nat.le_of_lt_succ hi) with hi | rfl + · exact Or.inr ⟨i, hi, equal⟩ + · exact Or.inl equal + +theorem pair_mem_finiteStageHistory (values : Nat → ZFSet.{u}) (n i : Nat) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode i) y ∈ finiteStageHistory values n ↔ i < n ∧ y = values i := by + rw [mem_finiteStageHistory] + constructor + · rintro ⟨j, hj, equal⟩ + obtain ⟨index, value⟩ := ZFSet.pair_inj.1 equal + obtain rfl := natSetCode_injective index + exact ⟨hj, value⟩ + · rintro ⟨hi, rfl⟩ + exact ⟨i, hi, rfl⟩ + +theorem finiteStageHistory_function (values : Nat → ZFSet.{u}) (n : Nat) : + FunctionGraphOn (natSetCode n) (finiteStageHistory values n) := by + induction n with + | zero => exact FunctionGraphOn.empty + | succ n ih => + rw [natSetCode_succ, finiteStageHistory] + exact ih.insert (ZFSet.mem_irrefl _) (values n) + +theorem finiteStageHistory_restrict (values : Nat → ZFSet.{u}) {m n : Nat} (below : m ≤ n) : + graphRestriction (natSetCode m) (finiteStageHistory values n) = finiteStageHistory values m := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz + obtain ⟨i, hi, equal⟩ := (mem_finiteStageHistory values n _).1 entry + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact (pair_mem_finiteStageHistory values m i _).2 ⟨(natSetCode_mem_iff i m).1 hx, rfl⟩ + · intro hz + obtain ⟨i, hi, rfl⟩ := (mem_finiteStageHistory values m z).1 hz + exact pair_mem_graphRestriction.2 + ⟨(pair_mem_finiteStageHistory values n i _).2 ⟨Nat.lt_of_lt_of_le hi below, rfl⟩, + (natSetCode_mem_iff i m).2 hi⟩ + +theorem finiteStageHistory_congr {values other : Nat → ZFSet.{u}} (n : Nat) + (same : ∀ i < n, values i = other i) : finiteStageHistory values n = finiteStageHistory other n := by + apply ZFSet.ext + intro z + rw [mem_finiteStageHistory, mem_finiteStageHistory] + constructor + · rintro ⟨i, hi, equal⟩ + exact ⟨i, hi, equal.trans (congrArg (ZFSet.pair (natSetCode i)) (same i hi))⟩ + · rintro ⟨i, hi, equal⟩ + exact ⟨i, hi, equal.trans (congrArg (ZFSet.pair (natSetCode i)) (same i hi).symm)⟩ + +theorem flatHistoryCuts_finite_iff (values : Nat → ZFSet.{u}) (n : Nat) + (levels row A : ZFSet.{u}) : + FlatHistoryCuts (natSetCode n) (finiteStageHistory values n) levels row A ↔ + ∀ i < n, ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i := by + constructor + · intro valid i hi + obtain ⟨Q, entry, member⟩ := valid (natSetCode i) ((natSetCode_mem_iff i n).2 hi) + exact ((pair_mem_finiteStageHistory values n i Q).1 entry).2 ▸ member + · intro valid beta hbeta + obtain ⟨i, hi, rfl⟩ := (mem_natSetCode beta n).1 hbeta + exact ⟨values i, (pair_mem_finiteStageHistory values n i _).2 ⟨hi, rfl⟩, valid i hi⟩ + +theorem finiteFlatCuts_down (values : Nat → ZFSet.{u}) (n : Nat) (levels : ZFSet.{u}) + (self : ∀ i < n, ∀ row A, ZFSet.pair row A ∈ values i → + assignmentCut levels (natSetCode i) A = A) + (adjacent : ∀ i, i + 1 < n → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → + ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i) : + ∀ i < n, ∀ j, j ≤ i → ∀ row A, ZFSet.pair row A ∈ values i → + ZFSet.pair row (assignmentCut levels (natSetCode j) A) ∈ values j := by + intro i + induction i with + | zero => + intro hi j hj row A member + have equal : j = 0 := Nat.eq_zero_of_le_zero hj + subst j + rw [self 0 hi row A member] + exact member + | succ i ih => + intro hi j hj row A member + rcases Nat.lt_or_eq_of_le hj with hj | rfl + · have below : j ≤ i := Nat.le_of_lt_succ hj + have cut := adjacent i hi row A member + have result := ih (Nat.lt_of_succ_lt hi) j below row + (assignmentCut levels (natSetCode i) A) cut + have subset : (natSetCode j : ZFSet.{u}) ⊆ natSetCode i := by + intro z hz + obtain ⟨k, hk, rfl⟩ := (mem_natSetCode z j).1 hz + exact (natSetCode_mem_iff k i).2 (Nat.lt_of_lt_of_le hk below) + rwa [assignmentCut_nested subset] at result + · rw [self (i + 1) hi row A member] + exact member + +theorem finiteFlatCuts_history (values : Nat → ZFSet.{u}) (n : Nat) (levels : ZFSet.{u}) + (self : ∀ i < n, ∀ row A, ZFSet.pair row A ∈ values i → + assignmentCut levels (natSetCode i) A = A) + (adjacent : ∀ i, i + 1 < n → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → + ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i) + {i : Nat} (hi : i < n) (row A : ZFSet.{u}) (member : ZFSet.pair row A ∈ values i) : + FlatHistoryCuts (natSetCode (i + 1)) (finiteStageHistory values (i + 1)) levels row A := by + rw [flatHistoryCuts_finite_iff] + intro j hj + exact finiteFlatCuts_down values n levels self adjacent i hi j (Nat.le_of_lt_succ hj) row A member + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem finiteStageHistory_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (values : Nat → ZFSet.{u}) (n : Nat) + (ground : ∀ i < n, values i ∈ M.sets) : finiteStageHistory values n ∈ M.sets := by + induction n with + | zero => exact M.empty_mem ⟨ZFSet.omega, M.omega_mem separation infinite⟩ + | succ n ih => + exact M.insert_mem pairing unions + (M.orderedPair_mem pairing (M.natSetCode_mem separation infinite n) + (ground n (Nat.lt_succ_self n))) + (ih (fun i hi => ground i (Nat.lt_succ_of_lt hi))) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +universe u + +noncomputable def stageThreeAssignmentLevels (I0 I1 I2 T : ZFSet.{u}) : ZFSet.{u} := + assignmentIndexLevels ((I0 ∪ I1) ∪ I2) T (natSetCode 3) + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) + +variable {I0 I1 I2 T : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) +include first second third + +theorem pair_mem_stageThreeAssignmentLevels (z level : ZFSet.{u}) : + ZFSet.pair z level ∈ stageThreeAssignmentLevels I0 I1 I2 T ↔ + (z ∈ stageOneAssignments I0 T ∧ level = ∅) ∨ + (z ∈ stageOneAssignments I1 T ∧ level = natSetCode 1) ∨ + (z ∈ stageOneAssignments I2 T ∧ level = natSetCode 2) := by + rw [stageThreeAssignmentLevels, pair_mem_assignmentIndexLevels] + constructor + · rintro ⟨i, _, u, hu, w, hw, rfl, _, entry⟩ + rcases (first.three_level_entry second third i level).1 entry with h0 | h1 | h2 + · exact Or.inl ⟨(stageOneAssignment_mem_assignments I0 T i u w).2 ⟨h0.1, hu, hw⟩, h0.2⟩ + · exact Or.inr (Or.inl ⟨(stageOneAssignment_mem_assignments I1 T i u w).2 ⟨h1.1, hu, hw⟩, h1.2⟩) + · exact Or.inr (Or.inr ⟨(stageOneAssignment_mem_assignments I2 T i u w).2 ⟨h2.1, hu, hw⟩, h2.2⟩) + · rintro (⟨hz, rfl⟩ | ⟨hz, rfl⟩ | ⟨hz, rfl⟩) + · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 hz + exact ⟨i, ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inl hi))), + u, hu, w, hw, rfl, (natSetCode_mem_iff 0 3).2 (by decide), + (first.three_level_entry second third i ∅).2 (Or.inl ⟨hi, rfl⟩)⟩ + · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I1 T z).1 hz + exact ⟨i, ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inr hi))), + u, hu, w, hw, rfl, (natSetCode_mem_iff 1 3).2 (by decide), + (first.three_level_entry second third i (natSetCode 1)).2 (Or.inr (Or.inl ⟨hi, rfl⟩))⟩ + · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I2 T z).1 hz + exact ⟨i, ZFSet.mem_union.2 (Or.inr hi), + u, hu, w, hw, rfl, (natSetCode_mem_iff 2 3).2 (by decide), + (first.three_level_entry second third i (natSetCode 2)).2 (Or.inr (Or.inr ⟨hi, rfl⟩))⟩ + +theorem stageThreeAssignmentLevels_function : + ZFSet.IsFunc (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (natSetCode 3) + (stageThreeAssignmentLevels I0 I1 I2 T) := + assignmentIndexLevels_function (first.three_level_function second third) + +theorem stageThreeAssignmentLevels_eq : + stageThreeAssignmentLevels I0 I1 I2 T = + (ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ + ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1}) ∪ + ZFSet.prod (stageOneAssignments I2 T) {natSetCode 2} := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, _, level, _, rfl⟩ := ZFSet.mem_prod.1 + ((stageThreeAssignmentLevels_function first second third).1 hz) + simpa only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton, or_assoc] using + (pair_mem_stageThreeAssignmentLevels first second third x level).1 hz + · intro hz + rcases ZFSet.mem_union.1 hz with lower | upper + · rcases ZFSet.mem_union.1 lower with zero | one + · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 zero + exact (pair_mem_stageThreeAssignmentLevels first second third x level).2 + (Or.inl ⟨hx, ZFSet.mem_singleton.1 hl⟩) + · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 one + exact (pair_mem_stageThreeAssignmentLevels first second third x level).2 + (Or.inr (Or.inl ⟨hx, ZFSet.mem_singleton.1 hl⟩)) + · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 upper + exact (pair_mem_stageThreeAssignmentLevels first second third x level).2 + (Or.inr (Or.inr ⟨hx, ZFSet.mem_singleton.1 hl⟩)) + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {I0 I1 I2 T : ZFSet.{u}} +include pairing unions powers separation + +theorem stageThreeIndexLevels_mem (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (hI2 : I2 ∈ M.sets) : + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ∈ M.sets := by + have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I0, hI0⟩ + have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 + have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 + have h3 : natSetCode 3 ∈ M.sets := M.insert_mem pairing unions h2 h2 + exact M.refinementIndexFieldGraph_mem pairing unions powers separation + (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) h3 0 + +theorem stageThreeAssignmentLevels_mem (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (hI2 : I2 ∈ M.sets) (hT : T ∈ M.sets) : + stageThreeAssignmentLevels I0 I1 I2 T ∈ M.sets := by + have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I0, hI0⟩ + have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 + have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 + have h3 : natSetCode 3 ∈ M.sets := M.insert_mem pairing unions h2 h2 + exact M.assignmentIndexLevels_mem pairing unions powers separation + (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) hT h3 + (M.stageThreeIndexLevels_mem pairing unions powers separation hI0 hI1 hI2) + +theorem stageThreeLevelData (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (hI2 : I2 ∈ M.sets) (hT : T ∈ M.sets) + (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (third : RefinementIndexLevelCode I2 (natSetCode 2)) : + ((I0 ∪ I1) ∪ I2) ∈ M.sets ∧ + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ∈ M.sets ∧ + stageThreeAssignmentLevels I0 I1 I2 T ∈ M.sets ∧ + ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) (natSetCode 3) + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) ∧ + ZFSet.IsFunc (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (natSetCode 3) + (stageThreeAssignmentLevels I0 I1 I2 T) ∧ + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 = + (ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1}) ∪ ZFSet.prod I2 {natSetCode 2} ∧ + stageThreeAssignmentLevels I0 I1 I2 T = + (ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ + ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1}) ∪ + ZFSet.prod (stageOneAssignments I2 T) {natSetCode 2} ∧ + (∀ x, ¬ (x ∈ I0 ∧ x ∈ I1)) ∧ (∀ x, ¬ (x ∈ I0 ∧ x ∈ I2)) ∧ + (∀ x, ¬ (x ∈ I1 ∧ x ∈ I2)) := by + exact ⟨M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2, + M.stageThreeIndexLevels_mem pairing unions powers separation hI0 hI1 hI2, + M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 hI2 hT, + first.three_level_function second third, stageThreeAssignmentLevels_function first second third, + first.three_level_graph second third, stageThreeAssignmentLevels_eq first second third, + first.three_levels_disjoint second third⟩ + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +universe u + +noncomputable def threeRefinementHistory (I0 I1 I2 : ZFSet.{u}) : ZFSet.{u} := + finiteStageHistory (fun | 0 => I0 | 1 => I1 | _ => I2) 3 + +theorem pair_mem_threeRefinementHistory (I0 I1 I2 xi I : ZFSet.{u}) : + ZFSet.pair xi I ∈ threeRefinementHistory I0 I1 I2 ↔ + (xi = natSetCode 0 ∧ I = I0) ∨ (xi = natSetCode 1 ∧ I = I1) ∨ + (xi = natSetCode 2 ∧ I = I2) := by + simp only [threeRefinementHistory, finiteStageHistory, ZFSet.mem_insert_iff, + ZFSet.notMem_empty, or_false, ZFSet.pair_inj] + constructor + · rintro (h2 | h1 | h0) + · exact Or.inr (Or.inr h2) + · exact Or.inr (Or.inl h1) + · exact Or.inl h0 + · rintro (h0 | h1 | h2) + · exact Or.inr (Or.inr h0) + · exact Or.inr (Or.inl h1) + · exact Or.inl h2 + +theorem threeRefinementHistory_function (I0 I1 I2 : ZFSet.{u}) : + FunctionGraphOn (natSetCode 3) (threeRefinementHistory I0 I1 I2) := + finiteStageHistory_function _ 3 + +theorem threeRefinementHistory_literal {I0 I1 I2 : ZFSet.{u}} + (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (third : RefinementIndexLevelCode I2 (natSetCode 2)) : + ∀ xi I, ZFSet.pair xi I ∈ threeRefinementHistory I0 I1 I2 → RefinementIndexLevelCode I xi := by + intro xi I entry + rcases (pair_mem_threeRefinementHistory I0 I1 I2 xi I).1 entry with + ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ + · exact first + · exact second + · exact third + +theorem threeRefinementHistory_indices (I0 I1 I2 : ZFSet.{u}) : + refinementHistoryIndices (natSetCode 3) (threeRefinementHistory I0 I1 I2) = (I0 ∪ I1) ∪ I2 := by + apply ZFSet.ext + intro x + rw [mem_refinementHistoryIndices, ZFSet.mem_union, ZFSet.mem_union] + constructor + · rintro ⟨xi, _, I, entry, hi⟩ + rcases (pair_mem_threeRefinementHistory I0 I1 I2 xi I).1 entry with + ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ + · exact Or.inl (Or.inl hi) + · exact Or.inl (Or.inr hi) + · exact Or.inr hi + · have h0 := (pair_mem_threeRefinementHistory I0 I1 I2 (natSetCode 0) I0).2 + (Or.inl ⟨rfl, rfl⟩) + have h1 := (pair_mem_threeRefinementHistory I0 I1 I2 (natSetCode 1) I1).2 + (Or.inr (Or.inl ⟨rfl, rfl⟩)) + have h2 := (pair_mem_threeRefinementHistory I0 I1 I2 (natSetCode 2) I2).2 + (Or.inr (Or.inr ⟨rfl, rfl⟩)) + have function := threeRefinementHistory_function I0 I1 I2 + rintro ((hi | hi) | hi) + · exact ⟨natSetCode 0, function.pair_source h0, I0, h0, hi⟩ + · exact ⟨natSetCode 1, function.pair_source h1, I1, h1, hi⟩ + · exact ⟨natSetCode 2, function.pair_source h2, I2, h2, hi⟩ + +theorem threeRefinementHistory_levels (I0 I1 I2 : ZFSet.{u}) : + refinementHistoryLevels (natSetCode 3) (threeRefinementHistory I0 I1 I2) = + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 := by + rw [refinementHistoryLevels, threeRefinementHistory_indices] + +theorem threeRefinementHistory_assignmentLevels (I0 I1 I2 T : ZFSet.{u}) : + refinementHistoryAssignmentLevels (natSetCode 3) (threeRefinementHistory I0 I1 I2) T = + stageThreeAssignmentLevels I0 I1 I2 T := by + rw [refinementHistoryAssignmentLevels, threeRefinementHistory_indices, threeRefinementHistory_levels] + rfl + +theorem threeRefinementHistory_anchors (I0 I1 I2 B : ZFSet.{u}) : + refinementIndexFieldGraph + (refinementHistoryIndices (natSetCode 3) (threeRefinementHistory I0 I1 I2)) B 2 = + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) B 2 := by + rw [threeRefinementHistory_indices] + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u + +theorem threeRefinementHistory_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {I0 I1 I2 : ZFSet.{u}} (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) : + threeRefinementHistory I0 I1 I2 ∈ M.sets := by + have h0 : natSetCode 0 ∈ M.sets := M.empty_mem ⟨I0, hI0⟩ + have h1 : natSetCode 1 ∈ M.sets := M.insert_mem pairing unions h0 h0 + have h2 : natSetCode 2 ∈ M.sets := M.insert_mem pairing unions h1 h1 + exact M.insert_mem pairing unions (M.orderedPair_mem pairing h2 hI2) + (M.insert_mem pairing unions (M.orderedPair_mem pairing h1 hI1) + (M.insert_mem pairing unions (M.orderedPair_mem pairing h0 hI0) h0)) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +universe u + +structure FiniteFlatHistoryCoherence (M : TransitiveGround.{u}) (values : Nat → ZFSet.{u}) + (n : Nat) (levels : ZFSet.{u}) : Prop where + stages_ground : natSetCode n ∈ M.sets + history_ground : finiteStageHistory values n ∈ M.sets + levels_ground : levels ∈ M.sets + flat : ∀ i < n, ∀ z ∈ values i, ∃ row A, z = ZFSet.pair row A + downward : ∀ i < n, ∀ j, j ≤ i → ∀ row A, ZFSet.pair row A ∈ values i → + ZFSet.pair row (assignmentCut levels (natSetCode j) A) ∈ values j + transition_ground : M.rowAssignmentTransitionFamily (natSetCode n) + (finiteStageHistory values n) levels ∈ M.sets + transition_function : ZFSet.IsFunc (ZFSet.prod (natSetCode n) (natSetCode n)) + (M.groundRelations (⋃₀ ⋃₀ ⋃₀ (finiteStageHistory values n)) (⋃₀ ⋃₀ ⋃₀ (finiteStageHistory values n))) + (M.rowAssignmentTransitionFamily (natSetCode n) (finiteStageHistory values n) levels) + transition_entry : ∀ i < n, ∀ j < n, ∀ R, + ZFSet.pair (ZFSet.pair (natSetCode i) (natSetCode j)) R ∈ + M.rowAssignmentTransitionFamily (natSetCode n) (finiteStageHistory values n) levels ↔ + R = rowAssignmentCutGraph (values i) (values j) levels (natSetCode j) + restriction_function : ∀ i < n, ∀ j, j ≤ i → + ZFSet.IsFunc (values i) (values j) + (rowAssignmentCutGraph (values i) (values j) levels (natSetCode j)) + restriction_identity : ∀ i < n, + rowAssignmentCutGraph (values i) (values i) levels (natSetCode i) = identityFunctionGraph (values i) + restriction_compose : ∀ i < n, ∀ j, j ≤ i → ∀ k, k ≤ j → + relationCompose (values i) (values j) (values k) + (rowAssignmentCutGraph (values i) (values j) levels (natSetCode j)) + (rowAssignmentCutGraph (values j) (values k) levels (natSetCode k)) = + rowAssignmentCutGraph (values i) (values k) levels (natSetCode k) + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GluingBirthRanges.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GluingBirthRanges.lean index a4ba1bedcaae02f3da067db429d7822b506f90df..91f42ff90a56d0893195a02c2b8ed8c8437af880 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GluingBirthRanges.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GluingBirthRanges.lean @@ -1,670 +1,670 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.OutwardSchedule -import OAI.SetTheory.PartitionPrinciple.Transfinite.SuccessorBirths - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -namespace TaskSystem - -open Chronological -universe u -variable {A G Task Label Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} - (f : TaskSystem P G Task Label) - -noncomputable def batchBirth (n : Nat) (oldBirth : (f.stages n).Old → Stage) (s : Stage) : - (f.stages n).Old ⊕ (f.stages n).batch.Fresh → Stage := - (f.stages n).batch.birth oldBirth s - -theorem batch_new_old_meet (n : Nat) (oldBirth : (f.stages n).Old → Stage) (s : Stage) - (old : ∀ x, oldBirth x < s) : - NewOldMeet (P := (f.stages n).batch.extension) (f.batchBirth n oldBirth s) s := - (f.stages n).batch.new_old_meet oldBirth s old - -theorem batch_old_meet_preserved (n : Nat) (oldBirth : (f.stages n).Old → Stage) (s : Stage) - (old : ∀ x, oldBirth x < s) (previous : OldMeet (P := (f.stages n).oldOrder) oldBirth) : - OldMeet (P := (f.stages n).batch.extension) (f.batchBirth n oldBirth s) := - (f.stages n).batch.old_meet_preserved oldBirth s old previous - -noncomputable def batch_earlier_layer (n : Nat) - {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} - (oldBirth : (f.stages n).Old → Stage) (s t : Stage) (earlier : t < s) - (layer : GrowthLayer Space orders (f.stages n).oldOrder oldBirth t) : - GrowthLayer Space orders (f.stages n).batch.extension (f.batchBirth n oldBirth s) t := - (f.stages n).batch.earlier_layer oldBirth s t earlier layer - -noncomputable def batch_incoming_layer (n : Nat) - (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) - (oldBirth : (f.stages n).Old → Stage) (s t : Stage) (old : ∀ x, oldBirth x < s) - (earlier : t < s) (original : MeetIso (orders t) P) : - GrowthLayer Space orders (f.stages n).batch.extension (f.batchBirth n oldBirth s) s := - (f.stages n).batch.incoming_layer Space orders oldBirth s old (fun _ => t) - (fun _ => earlier) - (fun i => RootedGluing.chainIso original (inverseIso (f.templateOriginal n i))) - -end TaskSystem - - - -namespace TaskSystem - -open Chronological -universe u -variable {A G Task Label Stage : Type u} {P : MeetOrder A} - (f : TaskSystem P G Task Label) (seed : A → Stage) (stamp : Nat → Stage) - -noncomputable def recordedStageBirth : (n : Nat) → f.Point n → Stage - | 0, x => seed x - | n + 1, .inl x => recordedStageBirth n x - | n + 1, .inr _ => stamp n - -def recordedUnionBirth : f.Union → Stage - | .inl x => seed x - | .inr x => stamp x.1 - -theorem recordedBirth_stage (n : Nat) (x : f.Point n) : - f.recordedUnionBirth seed stamp (f.inclusion n x) = - f.recordedStageBirth seed stamp n x := by - induction n with - | zero => rfl - | succ n ih => - cases x with - | inl x => exact ih x - | inr x => rfl - -theorem recordedBirth_original (x : A) : - f.recordedUnionBirth seed stamp (f.originalEmbedding.toFun x) = seed x := rfl - -theorem recordedBirth_next (n : Nat) (x : f.Point n) : - f.recordedStageBirth seed stamp (n + 1) ((f.step n).toFun x) = - f.recordedStageBirth seed stamp n x := rfl - -theorem recordedBirth_cases (x : f.Union) : - (∃ y, f.recordedUnionBirth seed stamp x = seed y) ∨ - ∃ n, f.recordedUnionBirth seed stamp x = stamp n := by - cases x with - | inl x => exact Or.inl ⟨x, rfl⟩ - | inr x => exact Or.inr ⟨x.1, rfl⟩ - -variable [LinearOrder Stage] - (seed_before : ∀ x n, seed x < stamp n) - (stamps_before : ∀ n m, n < m → stamp n < stamp m) - -include seed_before stamps_before in -theorem recordedStageBirth_lt_later (n m : Nat) (lower : n ≤ m) (x : f.Point n) : - f.recordedStageBirth seed stamp n x < stamp m := by - induction n with - | zero => exact seed_before x m - | succ n ih => - cases x with - | inl x => exact ih (Nat.le_trans (Nat.le_succ n) lower) x - | inr x => exact stamps_before n m (Nat.lt_of_succ_le lower) - -include seed_before stamps_before in -theorem recordedStageBirth_old_meet (initial : OldMeet (P := P) seed) (n : Nat) : - OldMeet (P := f.order n) (f.recordedStageBirth seed stamp n) := by - induction n with - | zero => exact initial - | succ n ih => - have same : f.recordedStageBirth seed stamp (n + 1) = - f.batchBirth n (f.recordedStageBirth seed stamp n) (stamp n) := by - funext x - cases x <;> rfl - rw [same] - exact f.batch_old_meet_preserved n _ _ - (f.recordedStageBirth_lt_later seed stamp seed_before stamps_before n n le_rfl) ih - -include seed_before stamps_before in -theorem recordedUnionBirth_old_meet (initial : OldMeet (P := P) seed) : - OldMeet (P := f.unionOrder) (f.recordedUnionBirth seed stamp) := - oldMeet_of_covered_stages f.order (f.recordedUnionBirth seed stamp) - (f.recordedStageBirth seed stamp) f.inclusionEmbedding - (f.recordedBirth_stage seed stamp) f.pair_cover - (f.recordedStageBirth_old_meet seed stamp seed_before stamps_before initial) - - -end TaskSystem - - - -namespace PrincipalBatch.Family - -open Chronological -universe u -variable {A I Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} - (b : PrincipalBatch.Family P I) - -noncomputable def stepBirth (U : I → Prop) (i : I) (outside : ¬ U i) - (oldBirth : b.Cutoff U → Stage) (s : Stage) : b.Cutoff (addComponent U i) → Stage := - fun x => (b.stepInput U i).birth oldBirth s ((b.stepIso U i outside).inverse x) - -omit [LinearOrder Stage] in -theorem stepBirth_iso (U : I → Prop) (i : I) (outside : ¬ U i) - (oldBirth : b.Cutoff U → Stage) (s : Stage) (x : (b.stepInput U i).Node) : - b.stepBirth U i outside oldBirth s ((b.stepIso U i outside).toFun x) = - (b.stepInput U i).birth oldBirth s x := by - change (b.stepInput U i).birth oldBirth s - ((b.stepIso U i outside).inverse ((b.stepIso U i outside).toFun x)) = _ - rw [(b.stepIso U i outside).left_inverse] - -omit [LinearOrder Stage] in -theorem stepBirth_old (U : I → Prop) (i : I) (outside : ¬ U i) - (oldBirth : b.Cutoff U → Stage) (s : Stage) (x : b.Cutoff U) : - b.stepBirth U i outside oldBirth s - ((b.cutoffInclusion (fun _ h => Or.inl h : ∀ j, U j → addComponent U i j)).toFun x) = - oldBirth x := - b.stepBirth_iso U i outside oldBirth s (.inl x) - -theorem stepBirth_le (U : I → Prop) (i : I) (outside : ¬ U i) - (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (x : b.Cutoff (addComponent U i)) : b.stepBirth U i outside oldBirth s x ≤ s := - (b.stepInput U i).birth_le oldBirth s old ((b.stepIso U i outside).inverse x) - -theorem step_new_old_meet (U : I → Prop) (i : I) (outside : ¬ U i) - (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : - NewOldMeet (P := b.cutoffOrder (addComponent U i)) (b.stepBirth U i outside oldBirth s) s := - ((b.stepInput U i).new_old_meet oldBirth s old).transport - (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) - (fun y => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) - -theorem step_old_meet_preserved (U : I → Prop) (i : I) (outside : ¬ U i) - (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (previous : OldMeet (P := b.cutoffOrder U) oldBirth) : - OldMeet (P := b.cutoffOrder (addComponent U i)) (b.stepBirth U i outside oldBirth s) := - ((b.stepInput U i).old_meet_preserved oldBirth s old previous).transport - (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) - (fun y => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) - -noncomputable def step_earlier_layer (U : I → Prop) (i : I) (outside : ¬ U i) - {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} - (oldBirth : b.Cutoff U → Stage) (s t : Stage) (earlier : t < s) - (layer : GrowthLayer Space orders (b.cutoffOrder U) oldBirth t) : - GrowthLayer Space orders (b.cutoffOrder (addComponent U i)) - (b.stepBirth U i outside oldBirth s) t := - ((b.stepInput U i).earlier_layer oldBirth s t earlier layer).transport - (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) - (fun y _ => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) - -noncomputable def step_incoming_layer (U : I → Prop) (i : I) (outside : ¬ U i) - (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) - (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (K : Type u) [Countable K] (index : K → Stage) (earlier : ∀ k, index k < s) - (copy : ∀ k, MeetEmbedding (orders (index k)) (b.order i)) - (cover : ∀ x, ∃ k y, (copy k).toFun y = x) : - GrowthLayer Space orders (b.cutoffOrder (addComponent U i)) - (b.stepBirth U i outside oldBirth s) s := - ((b.stepInput U i).incoming_layer Space orders oldBirth s old K index earlier copy cover).transport - (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) - (fun y _ => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) - -theorem step_no_birth (U : I → Prop) (i : I) (outside : ¬ U i) - (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (noFresh : ∀ _ : (b.glue i).Fresh, False) (x : b.Cutoff (addComponent U i)) : - b.stepBirth U i outside oldBirth s x < s := by - change (b.stepInput U i).birth oldBirth s ((b.stepIso U i outside).inverse x) < s - cases (b.stepIso U i outside).inverse x with - | inl a => exact old a - | inr y => exact False.elim (noFresh y) - -end PrincipalBatch.Family - - - -namespace TileRequests - -open Chronological -universe u - -namespace Tile -variable {A Child : Type u} {P : MeetOrder A} (tile : Tile P Child) - -def vertex : Option Child → IdealEmbedding P tile.order - | none => tile.root - | some j => tile.child j - -theorem vertex_cover (x : tile.Space) : ∃ j y, (tile.vertex j).toFun y = x := by - rcases tile.cover x with ⟨y, eq⟩ | ⟨j, y, eq⟩ - · exact ⟨none, y, eq⟩ - · exact ⟨some j, y, eq⟩ - -noncomputable def incoming_layer {B Stage : Type u} [LinearOrder Stage] [Countable Child] - {Q : MeetOrder B} (g : PrincipalAmalgamation.Input Q tile.order) - (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) - (oldBirth : B → Stage) (s t : Stage) (old : ∀ x, oldBirth x < s) - (earlier : t < s) (original : MeetIso (orders t) P) : - GrowthLayer Space orders g.order (g.birth oldBirth s) s := by - apply g.incoming_layer Space orders oldBirth s old (Option Child) (fun _ => t) - (fun _ => earlier) (fun j => compose original.toMeetEmbedding (tile.vertex j).toMeetEmbedding) - intro x - rcases tile.vertex_cover x with ⟨j, y, eq⟩ - refine ⟨j, original.inverse y, ?_⟩ - change (tile.vertex j).toFun (original.toFun (original.inverse y)) = x - rw [original.right_inverse] - exact eq - -end Tile - -namespace Request -variable {A : Type u} {P : MeetOrder A} - -instance child_countable (r : Request P) : Countable r.Child := by - cases r <;> dsimp [Child] <;> infer_instance - -end Request - -namespace Family -variable {A R : Type u} {P : MeetOrder A} (f : Family P R) - -instance child_countable (r : R) : Countable (f.Child r) := Request.child_countable (f.request r) - -noncomputable def tile_incoming_layer (r : R) {B Stage : Type u} [LinearOrder Stage] - {Q : MeetOrder B} (g : PrincipalAmalgamation.Input Q (f.tile r).order) - (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) - (oldBirth : B → Stage) (s t : Stage) (old : ∀ x, oldBirth x < s) - (earlier : t < s) (original : MeetIso (orders t) P) : - GrowthLayer Space orders g.order (g.birth oldBirth s) s := - (f.tile r).incoming_layer g Space orders oldBirth s t old earlier original - -end Family -end TileRequests - - - -namespace TileRequests.Family - -open Chronological CosetGeometry -universe u -variable {A J R Stage : Type u} [Group J] [LinearOrder Stage] {P : MeetOrder A} - (f : Family P R) (a : OrderAction J P) - -noncomputable def orderedBirth (n : Nat) (v : f.Layer a n) - (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) : - f.Cutoff a n (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v) → - Stage := - ((f.diagram a).scheme.stages n).batch.stepBirth ((f.diagram a).scheme.layerBefore n v) v - ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s - -omit [LinearOrder Stage] in -theorem ordered_birth_preserves (n : Nat) (v : f.Layer a n) - (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) - (x : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v)) : - f.orderedBirth a n v oldBirth s - ((((f.diagram a).scheme.stages n).batch.cutoffInclusion - (fun _ h => Or.inl h : ∀ j, (f.diagram a).scheme.layerBefore n v j → - PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v j)).toFun x) = - oldBirth x := - ((f.diagram a).scheme.stages n).batch.stepBirth_old _ v - ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s x - -theorem ordered_new_old_meet (n : Nat) (v : f.Layer a n) - (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) - (old : ∀ x, oldBirth x < s) : - NewOldMeet (P := f.cutoffOrder a n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) - (f.orderedBirth a n v oldBirth s) s := - ((f.diagram a).scheme.stages n).batch.step_new_old_meet _ v - ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s old - -theorem ordered_old_meet_preserved (n : Nat) (v : f.Layer a n) - (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) - (old : ∀ x, oldBirth x < s) - (previous : OldMeet (P := f.cutoffOrder a n ((f.diagram a).scheme.layerBefore n v)) oldBirth) : - OldMeet (P := f.cutoffOrder a n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) - (f.orderedBirth a n v oldBirth s) := - ((f.diagram a).scheme.stages n).batch.step_old_meet_preserved _ v - ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s old previous - -noncomputable def ordered_earlier_layer (n : Nat) (v : f.Layer a n) - {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} - (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s t : Stage) - (earlier : t < s) - (layer : GrowthLayer Space orders - (f.cutoffOrder a n ((f.diagram a).scheme.layerBefore n v)) oldBirth t) : - GrowthLayer Space orders (f.cutoffOrder a n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) - (f.orderedBirth a n v oldBirth s) t := - ((f.diagram a).scheme.stages n).batch.step_earlier_layer _ v - ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s t earlier layer - -noncomputable def ordered_incoming_layer (n : Nat) (v : f.Layer a n) - (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) - (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s t : Stage) - (old : ∀ x, oldBirth x < s) (earlier : t < s) (original : MeetIso (orders t) P) : - GrowthLayer Space orders (f.cutoffOrder a n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) - (f.orderedBirth a n v oldBirth s) s := by - rcases v with ⟨v, depth⟩ - cases v with - | inl c => - apply finiteLayer Space orders - apply (Set.finite_empty).subset - intro x hx - have oldPoint := ((f.diagram a).scheme.stages n).batch.step_no_birth - ((f.diagram a).scheme.layerBefore n ⟨.inl c, depth⟩) ⟨.inl c, depth⟩ - ((f.diagram a).scheme.layerBefore_irrefl n ⟨.inl c, depth⟩) oldBirth s old - (f.old_layer_no_fresh a n ⟨.inl c, depth⟩ c rfl) x - exact False.elim ((ne_of_lt oldPoint) hx) - | inr c => - apply ((f.diagram a).scheme.stages n).batch.step_incoming_layer - ((f.diagram a).scheme.layerBefore n ⟨.inr c, depth⟩) ⟨.inr c, depth⟩ - ((f.diagram a).scheme.layerBefore_irrefl n ⟨.inr c, depth⟩) - Space orders oldBirth s old (Option (f.Child c.2)) (fun _ => t) (fun _ => earlier) - (fun j => compose original.toMeetEmbedding ((f.tile c.2).vertex j).toMeetEmbedding) - intro x - rcases (f.tile c.2).vertex_cover x with ⟨j, y, eq⟩ - refine ⟨j, original.inverse y, ?_⟩ - change ((f.tile c.2).vertex j).toFun (original.toFun (original.inverse y)) = x - rw [original.right_inverse] - exact eq - -end TileRequests.Family - - - -namespace PrincipalBatch.Family - -open Attachment Chronological -universe u -variable {A I Stage : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) - -def recordBirth (oldBirth : A → Stage) (stamp : I → Stage) : b.Node → Stage - | .inl x => oldBirth x - | .inr x => stamp x.1 - -theorem different_fresh_meet (x y : b.Fresh) (different : x.1 ≠ y.1) : - b.extension.meet (.inr x) (.inr y) = - b.old.toFun (P.meet ((b.glue x.1).shadow x.2.val) ((b.glue y.1).shadow y.2.val)) := - meet_eq b.data b.component_meets (cross_meet b.data x y different - (b.different_fresh_incomparable x y different) - (b.different_fresh_incomparable y x different.symm)) - -theorem record_old_meet [LinearOrder Stage] (oldBirth : A → Stage) (stamp : I → Stage) - (before : ∀ x i, oldBirth x < stamp i) (previous : OldMeet (P := P) oldBirth) : - OldMeet (P := b.extension) (b.recordBirth oldBirth stamp) := by - intro x y earlier notLower - cases x with - | inl x => - cases y with - | inl y => - have eq : b.extension.meet (.inl x) (.inl y) = .inl (P.meet x y) := - (b.old.map_meet x y).symm - rw [eq] - exact previous x y earlier notLower - | inr y => exact False.elim (lt_asymm earlier (before x y.1)) - | inr x => - cases y with - | inl y => - have eq : b.extension.meet (.inr x) (.inl y) = - .inl (P.meet ((b.glue x.1).shadow x.2.val) y) := b.fresh_old_meet x y - rw [eq] - exact before _ x.1 - | inr y => - have different : x.1 ≠ y.1 := by - intro eq - exact (ne_of_lt earlier) (congrArg stamp eq).symm - rw [b.different_fresh_meet x y different] - exact before _ x.1 - -end PrincipalBatch.Family - - - -namespace RootedGluing.Scheme - -universe u -variable {V Stage : Type u} (d : Scheme V) - (seed : d.Space d.root → Stage) (stamp : ∀ n, (d.stages n).Layer → Stage) - -noncomputable def stageBirth : (n : Nat) → (d.stages n).Point → Stage - | 0, x => seed x - | n + 1, .inl x => stageBirth n x - | n + 1, .inr x => stamp n x.1 - -theorem stageBirth_next (n : Nat) (x : (d.stages n).Point) : - d.stageBirth seed stamp (n + 1) ((d.chain.next n).toFun x) = d.stageBirth seed stamp n x := rfl - -theorem stageBirth_up {n m : Nat} (lower : n ≤ m) (x : (d.stages n).Point) : - d.stageBirth seed stamp m (d.chain.up lower x) = d.stageBirth seed stamp n x := by - induction lower with - | refl => erw [d.chain.up_self] - | @step m lower ih => erw [d.chain.up_succ lower, d.stageBirth_next, ih] - -noncomputable def unionBirth : d.Node → Stage := - Quotient.lift (fun x => d.stageBirth seed stamp x.1 x.2) (by - intro x y related - rcases related with ⟨k, hx, hy, eq⟩ - exact (d.stageBirth_up seed stamp hx x.2).symm.trans - ((congrArg (d.stageBirth seed stamp k) eq).trans (d.stageBirth_up seed stamp hy y.2))) - -theorem unionBirth_stage (n : Nat) (x : (d.stages n).Point) : - d.unionBirth seed stamp (d.chain.point n x) = d.stageBirth seed stamp n x := rfl - -theorem unionBirth_original (x : d.Space d.root) : - d.unionBirth seed stamp ((d.vertex d.root).toFun x) = seed x := by - rw [d.vertex_at d.root 0 d.depth_root.le] - rfl - -noncomputable def partialBirth (n : Nat) (U : (d.stages n).Layer → Prop) : d.Partial n U → Stage := - fun x => d.stageBirth seed stamp (n + 1) x.val - -theorem partialBirth_global (n : Nat) (U : (d.stages n).Layer → Prop) (x : d.Partial n U) : - d.unionBirth seed stamp ((d.partialEmbedding n U).toFun x) = d.partialBirth seed stamp n U x := rfl - -theorem partialBirth_inclusion (n : Nat) {U W : (d.stages n).Layer → Prop} - (lower : ∀ v, U v → W v) (x : d.Partial n U) : - d.partialBirth seed stamp n W (((d.stages n).batch.cutoffInclusion lower).toFun x) = - d.partialBirth seed stamp n U x := rfl - -theorem partialBirth_later {n m : Nat} (later : n < m) - (U : (d.stages n).Layer → Prop) (W : (d.stages m).Layer → Prop) (x : d.Partial n U) : - d.partialBirth seed stamp m W ((d.partialLater later U W).toFun x) = - d.partialBirth seed stamp n U x := by - rw [← d.partialBirth_global, d.partialLater_global, d.partialBirth_global] - -theorem partialBirth_step_iso (n : Nat) (U : (d.stages n).Layer → Prop) - (v : (d.stages n).Layer) (outside : ¬ U v) (x : ((d.stages n).batch.stepInput U v).Node) : - d.partialBirth seed stamp n (PrincipalBatch.Family.addComponent U v) - (((d.stages n).batch.stepIso U v outside).toFun x) = - ((d.stages n).batch.stepInput U v).birth (d.partialBirth seed stamp n U) (stamp n v) x := by - cases x <;> rfl - -theorem partialBirth_step (n : Nat) (U : (d.stages n).Layer → Prop) - (v : (d.stages n).Layer) (outside : ¬ U v) : - d.partialBirth seed stamp n (PrincipalBatch.Family.addComponent U v) = - (d.stages n).batch.stepBirth U v outside (d.partialBirth seed stamp n U) (stamp n v) := by - funext x - have eq := d.partialBirth_step_iso seed stamp n U v outside - (((d.stages n).batch.stepIso U v outside).inverse x) - erw [((d.stages n).batch.stepIso U v outside).right_inverse] at eq - exact eq - -open Chronological -variable [LinearOrder Stage] - (seed_before : ∀ x n v, seed x < stamp n v) - (depth_before : ∀ n m v w, n < m → stamp n v < stamp m w) - (layer_before : ∀ n v w, d.layerBefore n w v → stamp n v < stamp n w) - -include seed_before depth_before in -theorem stageBirth_lt_later (n m : Nat) (lower : n ≤ m) - (x : (d.stages n).Point) (v : (d.stages m).Layer) : - d.stageBirth seed stamp n x < stamp m v := by - induction n with - | zero => exact seed_before x m v - | succ n ih => - cases x with - | inl x => exact ih (Nat.le_trans (Nat.le_succ n) lower) x - | inr x => exact depth_before n m x.1 v (Nat.lt_of_succ_le lower) - -include seed_before depth_before layer_before in -theorem partialBirth_before (n : Nat) (v : (d.stages n).Layer) - (x : d.Partial n (d.layerBefore n v)) : - d.partialBirth seed stamp n (d.layerBefore n v) x < stamp n v := by - rcases x with ⟨x, hx⟩ - cases x with - | inl x => exact d.stageBirth_lt_later seed stamp seed_before depth_before n n le_rfl x v - | inr x => exact layer_before n x.1 v hx - -include seed_before depth_before in -theorem stageBirth_old_meet (initial : OldMeet (P := d.order d.root) seed) (n : Nat) : - OldMeet (P := (d.stages n).order) (d.stageBirth seed stamp n) := by - induction n with - | zero => exact initial - | succ n ih => - have same : d.stageBirth seed stamp (n + 1) = - (d.stages n).batch.recordBirth (d.stageBirth seed stamp n) (stamp n) := by - funext x - cases x <;> rfl - rw [same] - exact (d.stages n).batch.record_old_meet (d.stageBirth seed stamp n) (stamp n) - (fun x v => d.stageBirth_lt_later seed stamp seed_before depth_before n n le_rfl x v) ih - -include seed_before depth_before in -theorem unionBirth_old_meet (initial : OldMeet (P := d.order d.root) seed) : - OldMeet (P := d.gluedOrder) (d.unionBirth seed stamp) := - oldMeet_of_covered_stages (fun n => (d.stages n).order) (d.unionBirth seed stamp) - (d.stageBirth seed stamp) (fun n => (d.chain.inclusion n).toMeetEmbedding) - (fun _ _ => rfl) d.chain.pair_cover (d.stageBirth_old_meet seed stamp seed_before depth_before initial) - -include seed_before depth_before in -theorem partialBirth_old_meet (initial : OldMeet (P := d.order d.root) seed) - (n : Nat) (U : (d.stages n).Layer → Prop) : - OldMeet (P := d.partialOrder n U) (d.partialBirth seed stamp n U) := by - intro x y earlier notLower - have old := d.unionBirth_old_meet seed stamp seed_before depth_before initial - ((d.partialEmbedding n U).toFun x) ((d.partialEmbedding n U).toFun y) earlier - (fun lower => notLower (((d.partialEmbedding n U).le_iff x y).mp lower)) - rw [← (d.partialEmbedding n U).map_meet, d.partialBirth_global] at old - exact old - - -end RootedGluing.Scheme - - - -namespace TileRequests.Family - -open Chronological CosetGeometry -universe u -variable {A J R Stage : Type u} [Group J] {P : MeetOrder A} - (f : Family P R) (a : OrderAction J P) - (seed : A → Stage) (stamp : ∀ n, f.Layer a n → Stage) - -noncomputable def externalBirth : f.Node a → Stage := (f.diagram a).scheme.unionBirth seed stamp - -noncomputable def cutoffBirth (n : Nat) (U : f.Layer a n → Prop) : f.Cutoff a n U → Stage := - (f.diagram a).scheme.partialBirth seed stamp n U - -theorem externalBirth_original (x : A) : - f.externalBirth a seed stamp ((f.copy a 1).toFun x) = seed x := by - rw [f.copy_one] - exact (f.diagram a).scheme.unionBirth_original seed stamp x - -theorem cutoffBirth_global (n : Nat) (U : f.Layer a n → Prop) (x : f.Cutoff a n U) : - f.externalBirth a seed stamp ((f.cutoffEmbedding a n U).toFun x) = - f.cutoffBirth a seed stamp n U x := rfl - -theorem cutoffBirth_ordered (n : Nat) (v : f.Layer a n) : - f.cutoffBirth a seed stamp n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v) = - f.orderedBirth a n v (f.cutoffBirth a seed stamp n ((f.diagram a).scheme.layerBefore n v)) - (stamp n v) := - (f.diagram a).scheme.partialBirth_step seed stamp n ((f.diagram a).scheme.layerBefore n v) v - ((f.diagram a).scheme.layerBefore_irrefl n v) - -variable [LinearOrder Stage] - (seed_before : ∀ x n v, seed x < stamp n v) - (depth_before : ∀ n m v w, n < m → stamp n v < stamp m w) - (layer_before : ∀ n v w, (f.diagram a).scheme.layerBefore n w v → stamp n v < stamp n w) - -include seed_before depth_before layer_before in -theorem cutoffBirth_before (n : Nat) (v : f.Layer a n) - (x : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v)) : - f.cutoffBirth a seed stamp n ((f.diagram a).scheme.layerBefore n v) x < stamp n v := - (f.diagram a).scheme.partialBirth_before seed stamp seed_before depth_before layer_before n v x - -include seed_before depth_before in -theorem externalBirth_old_meet (initial : OldMeet (P := P) seed) : - OldMeet (P := f.gluedOrder a) (f.externalBirth a seed stamp) := - (f.diagram a).scheme.unionBirth_old_meet seed stamp seed_before depth_before initial - -include seed_before depth_before in -theorem cutoffBirth_old_meet (initial : OldMeet (P := P) seed) - (n : Nat) (U : f.Layer a n → Prop) : - OldMeet (P := f.cutoffOrder a n U) (f.cutoffBirth a seed stamp n U) := - (f.diagram a).scheme.partialBirth_old_meet seed stamp seed_before depth_before initial n U - -include seed_before depth_before layer_before in -theorem cutoffBirth_new_old_meet (n : Nat) (v : f.Layer a n) : - NewOldMeet (P := f.cutoffOrder a n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) - (f.cutoffBirth a seed stamp n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) (stamp n v) := by - rw [f.cutoffBirth_ordered] - exact f.ordered_new_old_meet a n v _ (stamp n v) - (f.cutoffBirth_before a seed stamp seed_before depth_before layer_before n v) - -noncomputable def cutoffBirth_incoming_layer (n : Nat) (v : f.Layer a n) - (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) (t : Stage) - (earlier : t < stamp n v) (original : MeetIso (orders t) P) : - GrowthLayer Space orders (f.cutoffOrder a n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) - (f.cutoffBirth a seed stamp n - (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) (stamp n v) := by - rw [f.cutoffBirth_ordered] - exact f.ordered_incoming_layer a n v Space orders _ (stamp n v) t - (f.cutoffBirth_before a seed stamp seed_before depth_before layer_before n v) earlier original - - -end TileRequests.Family - - - - -universe u -namespace RootedGluing.Scheme -variable {V Stage : Type u} (d : Scheme V) - (seed : d.Space d.root → Stage) (stamp : ∀ n, (d.stages n).Layer → Stage) - -theorem stageBirth_cases (n : Nat) (x : (d.stages n).Point) : - (∃ y, d.stageBirth seed stamp n x = seed y) ∨ - ∃ m, m < n ∧ ∃ v, d.stageBirth seed stamp n x = stamp m v := by - induction n with - | zero => exact Or.inl ⟨x, rfl⟩ - | succ n ih => - cases x with - | inl x => - rcases ih x with original | ⟨m, lower, v, eq⟩ - · exact Or.inl original - · exact Or.inr ⟨m, Nat.lt_trans lower (Nat.lt_succ_self n), v, eq⟩ - | inr x => exact Or.inr ⟨n, Nat.lt_succ_self n, x.1, rfl⟩ - -theorem unionBirth_cases (x : d.Node) : - (∃ y, d.unionBirth seed stamp x = seed y) ∨ - ∃ n v, d.unionBirth seed stamp x = stamp n v := by - rcases d.chain.cover x with ⟨n, x, rfl⟩ - erw [d.unionBirth_stage] - rcases d.stageBirth_cases seed stamp n x with original | ⟨m, _, v, eq⟩ - · exact Or.inl original - · exact Or.inr ⟨m, v, eq⟩ - -end RootedGluing.Scheme - -namespace TileRequests.Family -open CosetGeometry -variable {A J R Stage : Type u} [Group J] {P : MeetOrder A} - (f : Family P R) (a : OrderAction J P) - (seed : A → Stage) (stamp : ∀ n, f.Layer a n → Stage) - -theorem externalBirth_cases (x : f.Node a) : - (∃ y, f.externalBirth a seed stamp x = seed y) ∨ - ∃ n v, f.externalBirth a seed stamp x = stamp n v := - (f.diagram a).scheme.unionBirth_cases seed stamp x - -end TileRequests.Family - - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.OutwardSchedule +import OAI.SetTheory.PartitionPrinciple.Transfinite.SuccessorBirths + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +namespace TaskSystem + +open Chronological +universe u +variable {A G Task Label Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} + (f : TaskSystem P G Task Label) + +noncomputable def batchBirth (n : Nat) (oldBirth : (f.stages n).Old → Stage) (s : Stage) : + (f.stages n).Old ⊕ (f.stages n).batch.Fresh → Stage := + (f.stages n).batch.birth oldBirth s + +theorem batch_new_old_meet (n : Nat) (oldBirth : (f.stages n).Old → Stage) (s : Stage) + (old : ∀ x, oldBirth x < s) : + NewOldMeet (P := (f.stages n).batch.extension) (f.batchBirth n oldBirth s) s := + (f.stages n).batch.new_old_meet oldBirth s old + +theorem batch_old_meet_preserved (n : Nat) (oldBirth : (f.stages n).Old → Stage) (s : Stage) + (old : ∀ x, oldBirth x < s) (previous : OldMeet (P := (f.stages n).oldOrder) oldBirth) : + OldMeet (P := (f.stages n).batch.extension) (f.batchBirth n oldBirth s) := + (f.stages n).batch.old_meet_preserved oldBirth s old previous + +noncomputable def batch_earlier_layer (n : Nat) + {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} + (oldBirth : (f.stages n).Old → Stage) (s t : Stage) (earlier : t < s) + (layer : GrowthLayer Space orders (f.stages n).oldOrder oldBirth t) : + GrowthLayer Space orders (f.stages n).batch.extension (f.batchBirth n oldBirth s) t := + (f.stages n).batch.earlier_layer oldBirth s t earlier layer + +noncomputable def batch_incoming_layer (n : Nat) + (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) + (oldBirth : (f.stages n).Old → Stage) (s t : Stage) (old : ∀ x, oldBirth x < s) + (earlier : t < s) (original : MeetIso (orders t) P) : + GrowthLayer Space orders (f.stages n).batch.extension (f.batchBirth n oldBirth s) s := + (f.stages n).batch.incoming_layer Space orders oldBirth s old (fun _ => t) + (fun _ => earlier) + (fun i => RootedGluing.chainIso original (inverseIso (f.templateOriginal n i))) + +end TaskSystem + + + +namespace TaskSystem + +open Chronological +universe u +variable {A G Task Label Stage : Type u} {P : MeetOrder A} + (f : TaskSystem P G Task Label) (seed : A → Stage) (stamp : Nat → Stage) + +noncomputable def recordedStageBirth : (n : Nat) → f.Point n → Stage + | 0, x => seed x + | n + 1, .inl x => recordedStageBirth n x + | n + 1, .inr _ => stamp n + +def recordedUnionBirth : f.Union → Stage + | .inl x => seed x + | .inr x => stamp x.1 + +theorem recordedBirth_stage (n : Nat) (x : f.Point n) : + f.recordedUnionBirth seed stamp (f.inclusion n x) = + f.recordedStageBirth seed stamp n x := by + induction n with + | zero => rfl + | succ n ih => + cases x with + | inl x => exact ih x + | inr x => rfl + +theorem recordedBirth_original (x : A) : + f.recordedUnionBirth seed stamp (f.originalEmbedding.toFun x) = seed x := rfl + +theorem recordedBirth_next (n : Nat) (x : f.Point n) : + f.recordedStageBirth seed stamp (n + 1) ((f.step n).toFun x) = + f.recordedStageBirth seed stamp n x := rfl + +theorem recordedBirth_cases (x : f.Union) : + (∃ y, f.recordedUnionBirth seed stamp x = seed y) ∨ + ∃ n, f.recordedUnionBirth seed stamp x = stamp n := by + cases x with + | inl x => exact Or.inl ⟨x, rfl⟩ + | inr x => exact Or.inr ⟨x.1, rfl⟩ + +variable [LinearOrder Stage] + (seed_before : ∀ x n, seed x < stamp n) + (stamps_before : ∀ n m, n < m → stamp n < stamp m) + +include seed_before stamps_before in +theorem recordedStageBirth_lt_later (n m : Nat) (lower : n ≤ m) (x : f.Point n) : + f.recordedStageBirth seed stamp n x < stamp m := by + induction n with + | zero => exact seed_before x m + | succ n ih => + cases x with + | inl x => exact ih (Nat.le_trans (Nat.le_succ n) lower) x + | inr x => exact stamps_before n m (Nat.lt_of_succ_le lower) + +include seed_before stamps_before in +theorem recordedStageBirth_old_meet (initial : OldMeet (P := P) seed) (n : Nat) : + OldMeet (P := f.order n) (f.recordedStageBirth seed stamp n) := by + induction n with + | zero => exact initial + | succ n ih => + have same : f.recordedStageBirth seed stamp (n + 1) = + f.batchBirth n (f.recordedStageBirth seed stamp n) (stamp n) := by + funext x + cases x <;> rfl + rw [same] + exact f.batch_old_meet_preserved n _ _ + (f.recordedStageBirth_lt_later seed stamp seed_before stamps_before n n le_rfl) ih + +include seed_before stamps_before in +theorem recordedUnionBirth_old_meet (initial : OldMeet (P := P) seed) : + OldMeet (P := f.unionOrder) (f.recordedUnionBirth seed stamp) := + oldMeet_of_covered_stages f.order (f.recordedUnionBirth seed stamp) + (f.recordedStageBirth seed stamp) f.inclusionEmbedding + (f.recordedBirth_stage seed stamp) f.pair_cover + (f.recordedStageBirth_old_meet seed stamp seed_before stamps_before initial) + + +end TaskSystem + + + +namespace PrincipalBatch.Family + +open Chronological +universe u +variable {A I Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} + (b : PrincipalBatch.Family P I) + +noncomputable def stepBirth (U : I → Prop) (i : I) (outside : ¬ U i) + (oldBirth : b.Cutoff U → Stage) (s : Stage) : b.Cutoff (addComponent U i) → Stage := + fun x => (b.stepInput U i).birth oldBirth s ((b.stepIso U i outside).inverse x) + +omit [LinearOrder Stage] in +theorem stepBirth_iso (U : I → Prop) (i : I) (outside : ¬ U i) + (oldBirth : b.Cutoff U → Stage) (s : Stage) (x : (b.stepInput U i).Node) : + b.stepBirth U i outside oldBirth s ((b.stepIso U i outside).toFun x) = + (b.stepInput U i).birth oldBirth s x := by + change (b.stepInput U i).birth oldBirth s + ((b.stepIso U i outside).inverse ((b.stepIso U i outside).toFun x)) = _ + rw [(b.stepIso U i outside).left_inverse] + +omit [LinearOrder Stage] in +theorem stepBirth_old (U : I → Prop) (i : I) (outside : ¬ U i) + (oldBirth : b.Cutoff U → Stage) (s : Stage) (x : b.Cutoff U) : + b.stepBirth U i outside oldBirth s + ((b.cutoffInclusion (fun _ h => Or.inl h : ∀ j, U j → addComponent U i j)).toFun x) = + oldBirth x := + b.stepBirth_iso U i outside oldBirth s (.inl x) + +theorem stepBirth_le (U : I → Prop) (i : I) (outside : ¬ U i) + (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (x : b.Cutoff (addComponent U i)) : b.stepBirth U i outside oldBirth s x ≤ s := + (b.stepInput U i).birth_le oldBirth s old ((b.stepIso U i outside).inverse x) + +theorem step_new_old_meet (U : I → Prop) (i : I) (outside : ¬ U i) + (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : + NewOldMeet (P := b.cutoffOrder (addComponent U i)) (b.stepBirth U i outside oldBirth s) s := + ((b.stepInput U i).new_old_meet oldBirth s old).transport + (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) + (fun y => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) + +theorem step_old_meet_preserved (U : I → Prop) (i : I) (outside : ¬ U i) + (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (previous : OldMeet (P := b.cutoffOrder U) oldBirth) : + OldMeet (P := b.cutoffOrder (addComponent U i)) (b.stepBirth U i outside oldBirth s) := + ((b.stepInput U i).old_meet_preserved oldBirth s old previous).transport + (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) + (fun y => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) + +noncomputable def step_earlier_layer (U : I → Prop) (i : I) (outside : ¬ U i) + {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} + (oldBirth : b.Cutoff U → Stage) (s t : Stage) (earlier : t < s) + (layer : GrowthLayer Space orders (b.cutoffOrder U) oldBirth t) : + GrowthLayer Space orders (b.cutoffOrder (addComponent U i)) + (b.stepBirth U i outside oldBirth s) t := + ((b.stepInput U i).earlier_layer oldBirth s t earlier layer).transport + (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) + (fun y _ => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) + +noncomputable def step_incoming_layer (U : I → Prop) (i : I) (outside : ¬ U i) + (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) + (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (K : Type u) [Countable K] (index : K → Stage) (earlier : ∀ k, index k < s) + (copy : ∀ k, MeetEmbedding (orders (index k)) (b.order i)) + (cover : ∀ x, ∃ k y, (copy k).toFun y = x) : + GrowthLayer Space orders (b.cutoffOrder (addComponent U i)) + (b.stepBirth U i outside oldBirth s) s := + ((b.stepInput U i).incoming_layer Space orders oldBirth s old K index earlier copy cover).transport + (b.stepIso U i outside).toMeetEmbedding (b.stepBirth_iso U i outside oldBirth s) + (fun y _ => ⟨(b.stepIso U i outside).inverse y, (b.stepIso U i outside).right_inverse y⟩) + +theorem step_no_birth (U : I → Prop) (i : I) (outside : ¬ U i) + (oldBirth : b.Cutoff U → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (noFresh : ∀ _ : (b.glue i).Fresh, False) (x : b.Cutoff (addComponent U i)) : + b.stepBirth U i outside oldBirth s x < s := by + change (b.stepInput U i).birth oldBirth s ((b.stepIso U i outside).inverse x) < s + cases (b.stepIso U i outside).inverse x with + | inl a => exact old a + | inr y => exact False.elim (noFresh y) + +end PrincipalBatch.Family + + + +namespace TileRequests + +open Chronological +universe u + +namespace Tile +variable {A Child : Type u} {P : MeetOrder A} (tile : Tile P Child) + +def vertex : Option Child → IdealEmbedding P tile.order + | none => tile.root + | some j => tile.child j + +theorem vertex_cover (x : tile.Space) : ∃ j y, (tile.vertex j).toFun y = x := by + rcases tile.cover x with ⟨y, eq⟩ | ⟨j, y, eq⟩ + · exact ⟨none, y, eq⟩ + · exact ⟨some j, y, eq⟩ + +noncomputable def incoming_layer {B Stage : Type u} [LinearOrder Stage] [Countable Child] + {Q : MeetOrder B} (g : PrincipalAmalgamation.Input Q tile.order) + (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) + (oldBirth : B → Stage) (s t : Stage) (old : ∀ x, oldBirth x < s) + (earlier : t < s) (original : MeetIso (orders t) P) : + GrowthLayer Space orders g.order (g.birth oldBirth s) s := by + apply g.incoming_layer Space orders oldBirth s old (Option Child) (fun _ => t) + (fun _ => earlier) (fun j => compose original.toMeetEmbedding (tile.vertex j).toMeetEmbedding) + intro x + rcases tile.vertex_cover x with ⟨j, y, eq⟩ + refine ⟨j, original.inverse y, ?_⟩ + change (tile.vertex j).toFun (original.toFun (original.inverse y)) = x + rw [original.right_inverse] + exact eq + +end Tile + +namespace Request +variable {A : Type u} {P : MeetOrder A} + +instance child_countable (r : Request P) : Countable r.Child := by + cases r <;> dsimp [Child] <;> infer_instance + +end Request + +namespace Family +variable {A R : Type u} {P : MeetOrder A} (f : Family P R) + +instance child_countable (r : R) : Countable (f.Child r) := Request.child_countable (f.request r) + +noncomputable def tile_incoming_layer (r : R) {B Stage : Type u} [LinearOrder Stage] + {Q : MeetOrder B} (g : PrincipalAmalgamation.Input Q (f.tile r).order) + (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) + (oldBirth : B → Stage) (s t : Stage) (old : ∀ x, oldBirth x < s) + (earlier : t < s) (original : MeetIso (orders t) P) : + GrowthLayer Space orders g.order (g.birth oldBirth s) s := + (f.tile r).incoming_layer g Space orders oldBirth s t old earlier original + +end Family +end TileRequests + + + +namespace TileRequests.Family + +open Chronological CosetGeometry +universe u +variable {A J R Stage : Type u} [Group J] [LinearOrder Stage] {P : MeetOrder A} + (f : Family P R) (a : OrderAction J P) + +noncomputable def orderedBirth (n : Nat) (v : f.Layer a n) + (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) : + f.Cutoff a n (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v) → + Stage := + ((f.diagram a).scheme.stages n).batch.stepBirth ((f.diagram a).scheme.layerBefore n v) v + ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s + +omit [LinearOrder Stage] in +theorem ordered_birth_preserves (n : Nat) (v : f.Layer a n) + (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) + (x : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v)) : + f.orderedBirth a n v oldBirth s + ((((f.diagram a).scheme.stages n).batch.cutoffInclusion + (fun _ h => Or.inl h : ∀ j, (f.diagram a).scheme.layerBefore n v j → + PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v j)).toFun x) = + oldBirth x := + ((f.diagram a).scheme.stages n).batch.stepBirth_old _ v + ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s x + +theorem ordered_new_old_meet (n : Nat) (v : f.Layer a n) + (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) + (old : ∀ x, oldBirth x < s) : + NewOldMeet (P := f.cutoffOrder a n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) + (f.orderedBirth a n v oldBirth s) s := + ((f.diagram a).scheme.stages n).batch.step_new_old_meet _ v + ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s old + +theorem ordered_old_meet_preserved (n : Nat) (v : f.Layer a n) + (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s : Stage) + (old : ∀ x, oldBirth x < s) + (previous : OldMeet (P := f.cutoffOrder a n ((f.diagram a).scheme.layerBefore n v)) oldBirth) : + OldMeet (P := f.cutoffOrder a n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) + (f.orderedBirth a n v oldBirth s) := + ((f.diagram a).scheme.stages n).batch.step_old_meet_preserved _ v + ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s old previous + +noncomputable def ordered_earlier_layer (n : Nat) (v : f.Layer a n) + {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} + (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s t : Stage) + (earlier : t < s) + (layer : GrowthLayer Space orders + (f.cutoffOrder a n ((f.diagram a).scheme.layerBefore n v)) oldBirth t) : + GrowthLayer Space orders (f.cutoffOrder a n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) + (f.orderedBirth a n v oldBirth s) t := + ((f.diagram a).scheme.stages n).batch.step_earlier_layer _ v + ((f.diagram a).scheme.layerBefore_irrefl n v) oldBirth s t earlier layer + +noncomputable def ordered_incoming_layer (n : Nat) (v : f.Layer a n) + (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) + (oldBirth : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v) → Stage) (s t : Stage) + (old : ∀ x, oldBirth x < s) (earlier : t < s) (original : MeetIso (orders t) P) : + GrowthLayer Space orders (f.cutoffOrder a n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) + (f.orderedBirth a n v oldBirth s) s := by + rcases v with ⟨v, depth⟩ + cases v with + | inl c => + apply finiteLayer Space orders + apply (Set.finite_empty).subset + intro x hx + have oldPoint := ((f.diagram a).scheme.stages n).batch.step_no_birth + ((f.diagram a).scheme.layerBefore n ⟨.inl c, depth⟩) ⟨.inl c, depth⟩ + ((f.diagram a).scheme.layerBefore_irrefl n ⟨.inl c, depth⟩) oldBirth s old + (f.old_layer_no_fresh a n ⟨.inl c, depth⟩ c rfl) x + exact False.elim ((ne_of_lt oldPoint) hx) + | inr c => + apply ((f.diagram a).scheme.stages n).batch.step_incoming_layer + ((f.diagram a).scheme.layerBefore n ⟨.inr c, depth⟩) ⟨.inr c, depth⟩ + ((f.diagram a).scheme.layerBefore_irrefl n ⟨.inr c, depth⟩) + Space orders oldBirth s old (Option (f.Child c.2)) (fun _ => t) (fun _ => earlier) + (fun j => compose original.toMeetEmbedding ((f.tile c.2).vertex j).toMeetEmbedding) + intro x + rcases (f.tile c.2).vertex_cover x with ⟨j, y, eq⟩ + refine ⟨j, original.inverse y, ?_⟩ + change ((f.tile c.2).vertex j).toFun (original.toFun (original.inverse y)) = x + rw [original.right_inverse] + exact eq + +end TileRequests.Family + + + +namespace PrincipalBatch.Family + +open Attachment Chronological +universe u +variable {A I Stage : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) + +def recordBirth (oldBirth : A → Stage) (stamp : I → Stage) : b.Node → Stage + | .inl x => oldBirth x + | .inr x => stamp x.1 + +theorem different_fresh_meet (x y : b.Fresh) (different : x.1 ≠ y.1) : + b.extension.meet (.inr x) (.inr y) = + b.old.toFun (P.meet ((b.glue x.1).shadow x.2.val) ((b.glue y.1).shadow y.2.val)) := + meet_eq b.data b.component_meets (cross_meet b.data x y different + (b.different_fresh_incomparable x y different) + (b.different_fresh_incomparable y x different.symm)) + +theorem record_old_meet [LinearOrder Stage] (oldBirth : A → Stage) (stamp : I → Stage) + (before : ∀ x i, oldBirth x < stamp i) (previous : OldMeet (P := P) oldBirth) : + OldMeet (P := b.extension) (b.recordBirth oldBirth stamp) := by + intro x y earlier notLower + cases x with + | inl x => + cases y with + | inl y => + have eq : b.extension.meet (.inl x) (.inl y) = .inl (P.meet x y) := + (b.old.map_meet x y).symm + rw [eq] + exact previous x y earlier notLower + | inr y => exact False.elim (lt_asymm earlier (before x y.1)) + | inr x => + cases y with + | inl y => + have eq : b.extension.meet (.inr x) (.inl y) = + .inl (P.meet ((b.glue x.1).shadow x.2.val) y) := b.fresh_old_meet x y + rw [eq] + exact before _ x.1 + | inr y => + have different : x.1 ≠ y.1 := by + intro eq + exact (ne_of_lt earlier) (congrArg stamp eq).symm + rw [b.different_fresh_meet x y different] + exact before _ x.1 + +end PrincipalBatch.Family + + + +namespace RootedGluing.Scheme + +universe u +variable {V Stage : Type u} (d : Scheme V) + (seed : d.Space d.root → Stage) (stamp : ∀ n, (d.stages n).Layer → Stage) + +noncomputable def stageBirth : (n : Nat) → (d.stages n).Point → Stage + | 0, x => seed x + | n + 1, .inl x => stageBirth n x + | n + 1, .inr x => stamp n x.1 + +theorem stageBirth_next (n : Nat) (x : (d.stages n).Point) : + d.stageBirth seed stamp (n + 1) ((d.chain.next n).toFun x) = d.stageBirth seed stamp n x := rfl + +theorem stageBirth_up {n m : Nat} (lower : n ≤ m) (x : (d.stages n).Point) : + d.stageBirth seed stamp m (d.chain.up lower x) = d.stageBirth seed stamp n x := by + induction lower with + | refl => erw [d.chain.up_self] + | @step m lower ih => erw [d.chain.up_succ lower, d.stageBirth_next, ih] + +noncomputable def unionBirth : d.Node → Stage := + Quotient.lift (fun x => d.stageBirth seed stamp x.1 x.2) (by + intro x y related + rcases related with ⟨k, hx, hy, eq⟩ + exact (d.stageBirth_up seed stamp hx x.2).symm.trans + ((congrArg (d.stageBirth seed stamp k) eq).trans (d.stageBirth_up seed stamp hy y.2))) + +theorem unionBirth_stage (n : Nat) (x : (d.stages n).Point) : + d.unionBirth seed stamp (d.chain.point n x) = d.stageBirth seed stamp n x := rfl + +theorem unionBirth_original (x : d.Space d.root) : + d.unionBirth seed stamp ((d.vertex d.root).toFun x) = seed x := by + rw [d.vertex_at d.root 0 d.depth_root.le] + rfl + +noncomputable def partialBirth (n : Nat) (U : (d.stages n).Layer → Prop) : d.Partial n U → Stage := + fun x => d.stageBirth seed stamp (n + 1) x.val + +theorem partialBirth_global (n : Nat) (U : (d.stages n).Layer → Prop) (x : d.Partial n U) : + d.unionBirth seed stamp ((d.partialEmbedding n U).toFun x) = d.partialBirth seed stamp n U x := rfl + +theorem partialBirth_inclusion (n : Nat) {U W : (d.stages n).Layer → Prop} + (lower : ∀ v, U v → W v) (x : d.Partial n U) : + d.partialBirth seed stamp n W (((d.stages n).batch.cutoffInclusion lower).toFun x) = + d.partialBirth seed stamp n U x := rfl + +theorem partialBirth_later {n m : Nat} (later : n < m) + (U : (d.stages n).Layer → Prop) (W : (d.stages m).Layer → Prop) (x : d.Partial n U) : + d.partialBirth seed stamp m W ((d.partialLater later U W).toFun x) = + d.partialBirth seed stamp n U x := by + rw [← d.partialBirth_global, d.partialLater_global, d.partialBirth_global] + +theorem partialBirth_step_iso (n : Nat) (U : (d.stages n).Layer → Prop) + (v : (d.stages n).Layer) (outside : ¬ U v) (x : ((d.stages n).batch.stepInput U v).Node) : + d.partialBirth seed stamp n (PrincipalBatch.Family.addComponent U v) + (((d.stages n).batch.stepIso U v outside).toFun x) = + ((d.stages n).batch.stepInput U v).birth (d.partialBirth seed stamp n U) (stamp n v) x := by + cases x <;> rfl + +theorem partialBirth_step (n : Nat) (U : (d.stages n).Layer → Prop) + (v : (d.stages n).Layer) (outside : ¬ U v) : + d.partialBirth seed stamp n (PrincipalBatch.Family.addComponent U v) = + (d.stages n).batch.stepBirth U v outside (d.partialBirth seed stamp n U) (stamp n v) := by + funext x + have eq := d.partialBirth_step_iso seed stamp n U v outside + (((d.stages n).batch.stepIso U v outside).inverse x) + erw [((d.stages n).batch.stepIso U v outside).right_inverse] at eq + exact eq + +open Chronological +variable [LinearOrder Stage] + (seed_before : ∀ x n v, seed x < stamp n v) + (depth_before : ∀ n m v w, n < m → stamp n v < stamp m w) + (layer_before : ∀ n v w, d.layerBefore n w v → stamp n v < stamp n w) + +include seed_before depth_before in +theorem stageBirth_lt_later (n m : Nat) (lower : n ≤ m) + (x : (d.stages n).Point) (v : (d.stages m).Layer) : + d.stageBirth seed stamp n x < stamp m v := by + induction n with + | zero => exact seed_before x m v + | succ n ih => + cases x with + | inl x => exact ih (Nat.le_trans (Nat.le_succ n) lower) x + | inr x => exact depth_before n m x.1 v (Nat.lt_of_succ_le lower) + +include seed_before depth_before layer_before in +theorem partialBirth_before (n : Nat) (v : (d.stages n).Layer) + (x : d.Partial n (d.layerBefore n v)) : + d.partialBirth seed stamp n (d.layerBefore n v) x < stamp n v := by + rcases x with ⟨x, hx⟩ + cases x with + | inl x => exact d.stageBirth_lt_later seed stamp seed_before depth_before n n le_rfl x v + | inr x => exact layer_before n x.1 v hx + +include seed_before depth_before in +theorem stageBirth_old_meet (initial : OldMeet (P := d.order d.root) seed) (n : Nat) : + OldMeet (P := (d.stages n).order) (d.stageBirth seed stamp n) := by + induction n with + | zero => exact initial + | succ n ih => + have same : d.stageBirth seed stamp (n + 1) = + (d.stages n).batch.recordBirth (d.stageBirth seed stamp n) (stamp n) := by + funext x + cases x <;> rfl + rw [same] + exact (d.stages n).batch.record_old_meet (d.stageBirth seed stamp n) (stamp n) + (fun x v => d.stageBirth_lt_later seed stamp seed_before depth_before n n le_rfl x v) ih + +include seed_before depth_before in +theorem unionBirth_old_meet (initial : OldMeet (P := d.order d.root) seed) : + OldMeet (P := d.gluedOrder) (d.unionBirth seed stamp) := + oldMeet_of_covered_stages (fun n => (d.stages n).order) (d.unionBirth seed stamp) + (d.stageBirth seed stamp) (fun n => (d.chain.inclusion n).toMeetEmbedding) + (fun _ _ => rfl) d.chain.pair_cover (d.stageBirth_old_meet seed stamp seed_before depth_before initial) + +include seed_before depth_before in +theorem partialBirth_old_meet (initial : OldMeet (P := d.order d.root) seed) + (n : Nat) (U : (d.stages n).Layer → Prop) : + OldMeet (P := d.partialOrder n U) (d.partialBirth seed stamp n U) := by + intro x y earlier notLower + have old := d.unionBirth_old_meet seed stamp seed_before depth_before initial + ((d.partialEmbedding n U).toFun x) ((d.partialEmbedding n U).toFun y) earlier + (fun lower => notLower (((d.partialEmbedding n U).le_iff x y).mp lower)) + rw [← (d.partialEmbedding n U).map_meet, d.partialBirth_global] at old + exact old + + +end RootedGluing.Scheme + + + +namespace TileRequests.Family + +open Chronological CosetGeometry +universe u +variable {A J R Stage : Type u} [Group J] {P : MeetOrder A} + (f : Family P R) (a : OrderAction J P) + (seed : A → Stage) (stamp : ∀ n, f.Layer a n → Stage) + +noncomputable def externalBirth : f.Node a → Stage := (f.diagram a).scheme.unionBirth seed stamp + +noncomputable def cutoffBirth (n : Nat) (U : f.Layer a n → Prop) : f.Cutoff a n U → Stage := + (f.diagram a).scheme.partialBirth seed stamp n U + +theorem externalBirth_original (x : A) : + f.externalBirth a seed stamp ((f.copy a 1).toFun x) = seed x := by + rw [f.copy_one] + exact (f.diagram a).scheme.unionBirth_original seed stamp x + +theorem cutoffBirth_global (n : Nat) (U : f.Layer a n → Prop) (x : f.Cutoff a n U) : + f.externalBirth a seed stamp ((f.cutoffEmbedding a n U).toFun x) = + f.cutoffBirth a seed stamp n U x := rfl + +theorem cutoffBirth_ordered (n : Nat) (v : f.Layer a n) : + f.cutoffBirth a seed stamp n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v) = + f.orderedBirth a n v (f.cutoffBirth a seed stamp n ((f.diagram a).scheme.layerBefore n v)) + (stamp n v) := + (f.diagram a).scheme.partialBirth_step seed stamp n ((f.diagram a).scheme.layerBefore n v) v + ((f.diagram a).scheme.layerBefore_irrefl n v) + +variable [LinearOrder Stage] + (seed_before : ∀ x n v, seed x < stamp n v) + (depth_before : ∀ n m v w, n < m → stamp n v < stamp m w) + (layer_before : ∀ n v w, (f.diagram a).scheme.layerBefore n w v → stamp n v < stamp n w) + +include seed_before depth_before layer_before in +theorem cutoffBirth_before (n : Nat) (v : f.Layer a n) + (x : f.Cutoff a n ((f.diagram a).scheme.layerBefore n v)) : + f.cutoffBirth a seed stamp n ((f.diagram a).scheme.layerBefore n v) x < stamp n v := + (f.diagram a).scheme.partialBirth_before seed stamp seed_before depth_before layer_before n v x + +include seed_before depth_before in +theorem externalBirth_old_meet (initial : OldMeet (P := P) seed) : + OldMeet (P := f.gluedOrder a) (f.externalBirth a seed stamp) := + (f.diagram a).scheme.unionBirth_old_meet seed stamp seed_before depth_before initial + +include seed_before depth_before in +theorem cutoffBirth_old_meet (initial : OldMeet (P := P) seed) + (n : Nat) (U : f.Layer a n → Prop) : + OldMeet (P := f.cutoffOrder a n U) (f.cutoffBirth a seed stamp n U) := + (f.diagram a).scheme.partialBirth_old_meet seed stamp seed_before depth_before initial n U + +include seed_before depth_before layer_before in +theorem cutoffBirth_new_old_meet (n : Nat) (v : f.Layer a n) : + NewOldMeet (P := f.cutoffOrder a n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) + (f.cutoffBirth a seed stamp n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) (stamp n v) := by + rw [f.cutoffBirth_ordered] + exact f.ordered_new_old_meet a n v _ (stamp n v) + (f.cutoffBirth_before a seed stamp seed_before depth_before layer_before n v) + +noncomputable def cutoffBirth_incoming_layer (n : Nat) (v : f.Layer a n) + (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) (t : Stage) + (earlier : t < stamp n v) (original : MeetIso (orders t) P) : + GrowthLayer Space orders (f.cutoffOrder a n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) + (f.cutoffBirth a seed stamp n + (PrincipalBatch.Family.addComponent ((f.diagram a).scheme.layerBefore n v) v)) (stamp n v) := by + rw [f.cutoffBirth_ordered] + exact f.ordered_incoming_layer a n v Space orders _ (stamp n v) t + (f.cutoffBirth_before a seed stamp seed_before depth_before layer_before n v) earlier original + + +end TileRequests.Family + + + + +universe u +namespace RootedGluing.Scheme +variable {V Stage : Type u} (d : Scheme V) + (seed : d.Space d.root → Stage) (stamp : ∀ n, (d.stages n).Layer → Stage) + +theorem stageBirth_cases (n : Nat) (x : (d.stages n).Point) : + (∃ y, d.stageBirth seed stamp n x = seed y) ∨ + ∃ m, m < n ∧ ∃ v, d.stageBirth seed stamp n x = stamp m v := by + induction n with + | zero => exact Or.inl ⟨x, rfl⟩ + | succ n ih => + cases x with + | inl x => + rcases ih x with original | ⟨m, lower, v, eq⟩ + · exact Or.inl original + · exact Or.inr ⟨m, Nat.lt_trans lower (Nat.lt_succ_self n), v, eq⟩ + | inr x => exact Or.inr ⟨n, Nat.lt_succ_self n, x.1, rfl⟩ + +theorem unionBirth_cases (x : d.Node) : + (∃ y, d.unionBirth seed stamp x = seed y) ∨ + ∃ n v, d.unionBirth seed stamp x = stamp n v := by + rcases d.chain.cover x with ⟨n, x, rfl⟩ + erw [d.unionBirth_stage] + rcases d.stageBirth_cases seed stamp n x with original | ⟨m, _, v, eq⟩ + · exact Or.inl original + · exact Or.inr ⟨m, v, eq⟩ + +end RootedGluing.Scheme + +namespace TileRequests.Family +open CosetGeometry +variable {A J R Stage : Type u} [Group J] {P : MeetOrder A} + (f : Family P R) (a : OrderAction J P) + (seed : A → Stage) (stamp : ∀ n, f.Layer a n → Stage) + +theorem externalBirth_cases (x : f.Node a) : + (∃ y, f.externalBirth a seed stamp x = seed y) ∨ + ∃ n v, f.externalBirth a seed stamp x = stamp n v := + (f.diagram a).scheme.unionBirth_cases seed stamp x + +end TileRequests.Family + + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBatchBirths.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBatchBirths.lean index 354b6998fb1cb833b64914ee027936f8461723e3..731063909dc7faf62719c15314c75df61da72d14 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBatchBirths.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBatchBirths.lean @@ -1,556 +1,556 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions -import OAI.SetTheory.PartitionPrinciple.Geometry.GrowthLayerSourceCongruence - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace NatUnionCode -universe u - -theorem oldMeet {r μ birth : Nat → ZFSet.{u}} {R MU B : ZFSet.{u}} - (relation : NatUnionCode r R) (operation : NatUnionCode μ MU) - (born : NatUnionCode birth B) - (laws : ∀ n, OldMeetCode (r n) (μ n) (birth n)) - (operationMono : ∀ n m, n ≤ m → μ n ⊆ μ m) - (birthMono : ∀ n m, n ≤ m → birth n ⊆ birth m) : OldMeetCode R MU B := by - intro x y z a b c ya xb ab notLower xy zc - obtain ⟨i, hi⟩ := (born _).1 ya - obtain ⟨j, hj⟩ := (born _).1 xb - obtain ⟨k, hk⟩ := (operation _).1 xy - obtain ⟨l, hl⟩ := (born _).1 zc - let n := max (max i j) (max k l) - have iN : i ≤ n := (le_max_left i j).trans (le_max_left (max i j) (max k l)) - have jN : j ≤ n := (le_max_right i j).trans (le_max_left (max i j) (max k l)) - have kN : k ≤ n := (le_max_left k l).trans (le_max_right (max i j) (max k l)) - have lN : l ≤ n := (le_max_right k l).trans (le_max_right (max i j) (max k l)) - exact laws n x y z a b c (birthMono i n iN hi) (birthMono j n jN hj) ab - (fun lower => notLower (relation.subset n lower)) (operationMono k n kN hk) - (birthMono l n lN hl) - -theorem birth_bound {birth : Nat → ZFSet.{u}} {B cutoff : ZFSet.{u}} - (born : NatUnionCode birth B) - (bounds : ∀ n x t, ZFSet.pair x t ∈ birth n → t ∈ cutoff) : - ∀ x t, ZFSet.pair x t ∈ B → t ∈ cutoff := by - intro x t entry - obtain ⟨n, hn⟩ := (born _).1 entry - exact bounds n x t hn - -theorem no_birth_at_bound {birth : Nat → ZFSet.{u}} {B cutoff : ZFSet.{u}} - (born : NatUnionCode birth B) - (bounds : ∀ n x t, ZFSet.pair x t ∈ birth n → t ∈ cutoff) : - ∀ x, ZFSet.pair x cutoff ∉ B := by - intro x entry - exact ZFSet.mem_irrefl cutoff (born.birth_bound bounds x cutoff entry) - -theorem stable_birth_entry_iff {birth : Nat → ZFSet.{u}} {B t : ZFSet.{u}} - (born : NatUnionCode birth B) (n : Nat) - (stable : ∀ m x, ZFSet.pair x t ∈ birth m → ZFSet.pair x t ∈ birth n) - (x : ZFSet.{u}) : ZFSet.pair x t ∈ B ↔ ZFSet.pair x t ∈ birth n := by - constructor - · intro entry - obtain ⟨m, hm⟩ := (born _).1 entry - exact stable m x hm - · exact fun entry => born.subset n entry - -theorem stable_birth_fiber {P birth : Nat → ZFSet.{u}} {B t T : ZFSet.{u}} - (born : NatUnionCode birth B) (n : Nat) (function : ZFSet.IsFunc (P n) T (birth n)) - (stable : ∀ m x, ZFSet.pair x t ∈ birth m → ZFSet.pair x t ∈ birth n) : - ∀ x, ZFSet.pair x t ∈ B → x ∈ P n ∧ ZFSet.pair x t ∈ birth n := by - intro x entry - have old := (born.stable_birth_entry_iff n stable x).1 entry - exact ⟨(ZFSet.pair_mem_prod.1 (function.1 old)).1, old⟩ - -end NatUnionCode - -section - -universe u - -theorem MeetEmbeddingCode.enlarge_target - {A L L' rA r r' μA μ μ' e : ZFSet.{u}} - (embedding : MeetEmbeddingCode A L rA r μA μ e) - (carrier : L ⊆ L') (order : r ⊆ r') (meets : μ ⊆ μ') : - MeetEmbeddingCode A L' rA r' μA μ' e := by - refine ⟨⟨⟨?_, embedding.injection.function.2⟩, embedding.injection.injective⟩, - fun x y x' y' below first second => order (embedding.monotone x y x' y' below first second), - fun x y z x' y' z' meet first second third => - meets (embedding.map_meet x y z x' y' z' meet first second third)⟩ - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (embedding.injection.function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, carrier hy⟩ - -theorem relationImage_enlarge_target {A L L' e : ZFSet.{u}} (carrier : L ⊆ L') : - relationImage A L e ⊆ relationImage A L' e := by - intro x hx - obtain ⟨hxL, witness⟩ := (mem_relationImage A L e x).1 hx - exact (mem_relationImage A L' e x).2 ⟨carrier hxL, witness⟩ - -theorem OldBridgeCode.of_literal_extension - {L L' r r' μ μ' birth birth' t x y : ZFSet.{u}} - (bridge : OldBridgeCode L r μ birth t x y) - (carrier : L ⊆ L') (order : r ⊆ r') (meets : μ ⊆ μ') (born : birth ⊆ birth') : - OldBridgeCode L' r' μ' birth' t x y := by - rcases bridge with ⟨z, a, meet, entry, earlier⟩ | ⟨z, hz, a, entry, earlier, between⟩ - · exact Or.inl ⟨z, a, meets meet, born entry, earlier⟩ - · exact Or.inr ⟨z, carrier hz, a, born entry, earlier, - between.elim (fun h => Or.inl ⟨order h.1, order h.2⟩) - (fun h => Or.inr ⟨order h.1, order h.2⟩)⟩ - -def CodedGrowthLayer.of_literal_extension - {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {L L' r r' μ μ' birth birth' t : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) - (separation : SetFormula.SeparationSchema M.sets) (hL : L ∈ M.sets) - (carrier : L ⊆ L') (order : r ⊆ r') (meets : μ ⊆ μ') (born : birth ⊆ birth') - (fiber : ∀ x ∈ L', ZFSet.pair x t ∈ birth' → x ∈ L ∧ ZFSet.pair x t ∈ birth) : - CodedGrowthLayer M Space sourceOrder sourceMeet L' r' μ' birth' t := by - cases layer with - | countablePoints D ground small cover => - exact .countablePoints D ground small (fun x hx entry => - cover x (fiber x hx entry).1 (fiber x hx entry).2) - | copies I parts groundI small groundParts index e earlier groundCopy embedding cover inCopy => - let retained := ZFSet.sep (fun z => z ∈ ZFSet.prod I L) parts - refine .copies I retained groundI small - (M.injection_restriction_mem separation groundI hL groundParts) index e earlier groundCopy - (fun i hi => (embedding i hi).enlarge_target carrier order meets) - ?_ ?_ - · intro x hx entry - have old := fiber x hx entry - obtain ⟨i, hi, part⟩ := cover x old.1 old.2 - exact ⟨i, hi, ZFSet.mem_sep.2 ⟨part, ZFSet.pair_mem_prod.2 ⟨hi, old.1⟩⟩⟩ - · intro i hi x _ entry - obtain ⟨part, bound⟩ := ZFSet.mem_sep.1 entry - have hxL := (ZFSet.pair_mem_prod.1 bound).2 - exact relationImage_enlarge_target carrier (inCopy i hi x hxL part) - | separated I index e earlier groundCopy embedding component cover separated => - let oldPoint (x : {x : ZFSet.{u} // x ∈ L' ∧ ZFSet.pair x t ∈ birth'}) : - {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} := - ⟨x.val, fiber x.val x.property.1 x.property.2⟩ - exact .separated I index e earlier groundCopy - (fun i => (embedding i).enlarge_target carrier order meets) - (fun x => component (oldPoint x)) - (fun x => relationImage_enlarge_target carrier (cover (oldPoint x))) - (fun x y different => (separated (oldPoint x) (oldPoint y) different).of_literal_extension - carrier order meets born) - -noncomputable def fixedTopBirth (P birth s : ZFSet.{u}) : ZFSet.{u} := - insert (ZFSet.pair P s) birth - -theorem pair_mem_fixedTopBirth (P birth s x t : ZFSet.{u}) : - ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ - (x = P ∧ t = s) ∨ ZFSet.pair x t ∈ birth := by - rw [fixedTopBirth, ZFSet.mem_insert_iff, ZFSet.pair_inj] - -theorem fixedTopBirth_subset (P birth s : ZFSet.{u}) : birth ⊆ fixedTopBirth P birth s := - fun _ h => ZFSet.mem_insert_iff.2 (Or.inr h) - -theorem fixedTopBirth_old_iff {P birth s x t : ZFSet.{u}} (hx : x ∈ P) : - ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ ZFSet.pair x t ∈ birth := by - rw [pair_mem_fixedTopBirth] - exact ⟨fun h => h.elim (fun equal => False.elim (ZFSet.mem_irrefl P (equal.1 ▸ hx))) id, - Or.inr⟩ - -theorem fixedTopBirth_top_iff {P T birth s t : ZFSet.{u}} (born : ZFSet.IsFunc P T birth) : - ZFSet.pair P t ∈ fixedTopBirth P birth s ↔ t = s := by - rw [pair_mem_fixedTopBirth] - exact ⟨fun h => h.elim And.right (fun entry => - False.elim (ZFSet.mem_irrefl P (ZFSet.pair_mem_prod.1 (born.1 entry)).1)), - fun equal => Or.inl ⟨rfl, equal⟩⟩ - -theorem fixedTopBirth_function {P T birth s : ZFSet.{u}} - (born : ZFSet.IsFunc P T birth) (hs : s ∈ T) : - ZFSet.IsFunc (fixedTopCarrier P) T (fixedTopBirth P birth s) := by - refine ⟨?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_insert_iff.1 hz with rfl | old - · exact ZFSet.pair_mem_prod.2 ⟨fixedTopCarrier_top P, hs⟩ - · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (born.1 old) - exact ZFSet.pair_mem_prod.2 ⟨fixedTopCarrier_old hx, ht⟩ - · intro x hx - rcases (mem_fixedTopCarrier P x).1 hx with rfl | old - · exact ⟨s, (fixedTopBirth_top_iff born).2 rfl, fun t entry => (fixedTopBirth_top_iff born).1 entry⟩ - · obtain ⟨t, entry, unique⟩ := born.2 x old - exact ⟨t, (fixedTopBirth_old_iff old).2 entry, - fun t' entry' => unique t' ((fixedTopBirth_old_iff old).1 entry')⟩ - -theorem fixedTopBirth_bound {P birth s : ZFSet.{u}} - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : - ∀ x t, ZFSet.pair x t ∈ fixedTopBirth P birth s → t = s ∨ t ∈ s := by - intro x t entry - exact ((pair_mem_fixedTopBirth P birth s x t).1 entry).elim - (fun equal => Or.inl equal.2) (fun old => Or.inr (earlier x t old)) - -theorem fixedTopBirth_new_time_iff {P birth s x : ZFSet.{u}} - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : - ZFSet.pair x s ∈ fixedTopBirth P birth s ↔ x = P := by - rw [pair_mem_fixedTopBirth] - exact ⟨fun h => h.elim And.left (fun old => False.elim (ZFSet.mem_irrefl s (earlier x s old))), - fun equal => Or.inl ⟨equal, rfl⟩⟩ - -theorem fixedTopBirth_earlier_iff {P birth s x t : ZFSet.{u}} (before : t ∈ s) : - ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ ZFSet.pair x t ∈ birth := by - rw [pair_mem_fixedTopBirth] - exact ⟨fun h => h.elim (fun equal => False.elim (ZFSet.mem_irrefl s (equal.2 ▸ before))) id, - Or.inr⟩ - -theorem fixedTopBirth_oldMeet {P T r μ birth s : ZFSet.{u}} - (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) (oldMeet : OldMeetCode r μ birth) : - OldMeetCode (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) := by - intro x y z a b c ya xb ab notLower xy zc - rcases (pair_mem_fixedTopBirth P birth s x b).1 xb with ⟨newx, newb⟩ | oldx - · subst x b - rcases (pair_mem_fixedTopBirth P birth s y a).1 ya with ⟨newy, newa⟩ | oldy - · subst y a - exact False.elim (ZFSet.mem_irrefl s ab) - · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 - have equal := (fixedTopMeet_top_left meet (fixedTopCarrier_old hy)).1 xy - subst z - have oldc := (fixedTopBirth_old_iff hy).1 zc - exact earlier y c oldc - · have hx := (ZFSet.pair_mem_prod.1 (born.1 oldx)).1 - rcases (pair_mem_fixedTopBirth P birth s y a).1 ya with ⟨newy, newa⟩ | oldy - · subst y a - exact False.elim (ZFSet.mem_asymm (earlier x b oldx) ab) - · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 - have oldxy := (fixedTopMeet_old_iff meet hx hy).1 xy - have hz := (ZFSet.pair_mem_prod.1 (meet.operation.1 oldxy)).2 - exact oldMeet x y z a b c oldy oldx ab - (fun lower => notLower ((fixedTopOrder_old_iff hy).2 lower)) oldxy - ((fixedTopBirth_old_iff hz).1 zc) - -theorem fixedTopBirth_singleton_injection (P : ZFSet.{u}) : - InjectionCode {P} ZFSet.omega {ZFSet.pair P ∅} := by - refine ⟨⟨?_, ?_⟩, ?_⟩ - · intro z hz - have equal := ZFSet.mem_singleton.1 hz - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, ZFSet.omega_zero⟩ - · intro x hx - have equal := ZFSet.mem_singleton.1 hx - subst x - refine ⟨∅, ZFSet.mem_singleton.2 rfl, ?_⟩ - intro y entry - exact (ZFSet.pair_inj.1 (ZFSet.mem_singleton.1 entry)).2 - · intro x y z first second - exact (ZFSet.pair_inj.1 (ZFSet.mem_singleton.1 first)).1.trans - (ZFSet.pair_inj.1 (ZFSet.mem_singleton.1 second)).1.symm - -end - -namespace CodedGrowthLayer -open SetFormula -universe u - -def of_natUnion {M : TransitiveGround.{u}} - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {P r μ birth : Nat → ZFSet.{u}} {L R MU B t T : ZFSet.{u}} - (carrier : NatUnionCode P L) (relation : NatUnionCode r R) - (operation : NatUnionCode μ MU) (born : NatUnionCode birth B) - (n : Nat) (layer : CodedGrowthLayer M Space sourceOrder sourceMeet - (P n) (r n) (μ n) (birth n) t) - (separation : SeparationSchema M.sets) (ground : P n ∈ M.sets) - (function : ZFSet.IsFunc (P n) T (birth n)) - (stable : ∀ m x, ZFSet.pair x t ∈ birth m → ZFSet.pair x t ∈ birth n) : - CodedGrowthLayer M Space sourceOrder sourceMeet L R MU B t := - layer.of_literal_extension separation ground (carrier.subset n) (relation.subset n) - (operation.subset n) (born.subset n) - (fun x _ entry => born.stable_birth_fiber n function stable x entry) - -def empty_of_no_birth {M : TransitiveGround.{u}} - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {L r μ birth t : ZFSet.{u}} (inhabited : M.sets.Nonempty) - (empty : ∀ x ∈ L, ZFSet.pair x t ∉ birth) : - CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := - .countablePoints ∅ (M.empty_mem inhabited) (M.empty_groundEmbeddable ZFSet.omega inhabited) - (fun x hx entry => False.elim (empty x hx entry)) - -def empty_at_birth_bound {M : TransitiveGround.{u}} - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {L r μ birth cutoff : ZFSet.{u}} (inhabited : M.sets.Nonempty) - (bounds : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ cutoff) : - CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth cutoff := - empty_of_no_birth inhabited (fun x _ entry => ZFSet.mem_irrefl cutoff (bounds x cutoff entry)) - -end CodedGrowthLayer - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem fixedTopBirth_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - {P birth s : ZFSet.{u}} (hP : P ∈ M.sets) (hBirth : birth ∈ M.sets) (hs : s ∈ M.sets) : - fixedTopBirth P birth s ∈ M.sets := - M.insert_mem pairing unions (M.orderedPair_mem pairing hP hs) hBirth - -theorem fixedTopBirth_singleton_small - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {P : ZFSet.{u}} (hP : P ∈ M.sets) : - ({P} : ZFSet.{u}) ∈ M.sets ∧ M.groundEmbeddable {P} ZFSet.omega := by - have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - have hEntry := M.orderedPair_mem pairing hP (M.empty_mem ⟨P, hP⟩) - have hGraph : ({ZFSet.pair P ∅} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hEntry hEntry - exact ⟨hSingle, {ZFSet.pair P ∅}, hGraph, fixedTopBirth_singleton_injection P⟩ - -def fixedTopBirth_incoming_layer - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {P r birth s : ZFSet.{u}} (hP : P ∈ M.sets) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : - CodedGrowthLayer M Space sourceOrder sourceMeet (fixedTopCarrier P) - (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) s := - .countablePoints {P} (M.fixedTopBirth_singleton_small pairing hP).1 - (M.fixedTopBirth_singleton_small pairing hP).2 - (fun _ _ entry => ZFSet.mem_singleton.2 ((fixedTopBirth_new_time_iff earlier).1 entry)) - -noncomputable def fixedTopBirth_earlier_layer - (separation : SeparationSchema M.sets) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {P T r μ birth s t : ZFSet.{u}} - (hP : P ∈ M.sets) (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) - (before : t ∈ s) - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) : - CodedGrowthLayer M Space sourceOrder sourceMeet (fixedTopCarrier P) - (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t := by - apply layer.of_literal_extension separation hP (fixedTopCarrier_subset P) - (fixedTopOrder_subset P r) (fixedTopMeet_subset meet) (fixedTopBirth_subset P birth s) - intro x _ entry - have old := (fixedTopBirth_earlier_iff before).1 entry - exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ - -noncomputable def fixedTopBirth_layers - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (separation : SeparationSchema M.sets) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {P T r μ birth s : ZFSet.{u}} - (hP : P ∈ M.sets) (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) - (layers : ∀ t ∈ s, CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) - (t : ZFSet.{u}) (bounded : t = s ∨ t ∈ s) : - CodedGrowthLayer M Space sourceOrder sourceMeet (fixedTopCarrier P) - (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t := by - classical - by_cases equal : t = s - · subst t - exact M.fixedTopBirth_incoming_layer pairing hP earlier - · have before := bounded.resolve_left equal - exact M.fixedTopBirth_earlier_layer separation hP meet born before (layers t before) - -end TransitiveGround - -namespace AttachmentBatchInputs -universe u -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) - -noncomputable abbrev batchBirth (_d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) (birth stamp : ZFSet.{u}) : ZFSet.{u} := - taggedBirth P (indexedAttachmentFresh I Qs rs As) birth stamp - -theorem batchBirth_function {T birth stamp : ZFSet.{u}} - (born : ZFSet.IsFunc P T birth) (hs : stamp ∈ T) : - ZFSet.IsFunc d.batchCarrier T (d.batchBirth birth stamp) := taggedBirth_function born hs - -theorem batchBirth_fresh_entry_iff {T birth stamp t : ZFSet.{u}} - (born : ZFSet.IsFunc P T birth) (q : d.templates.Fresh) : - ZFSet.pair (d.coding.encode (.inr q)) t ∈ d.batchBirth birth stamp ↔ t = stamp := - taggedBirth_fresh_iff born (d.freshCode_mem q) - -theorem batchBirth_oldMeet {T birth stamp : ZFSet.{u}} - (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (oldMeet : OldMeetCode r μ birth) : - OldMeetCode d.batchOrder d.batchMeetGraph (d.batchBirth birth stamp) := by - intro x y z a b c ya xb ab notLower meetEntry zc - rcases (pair_mem_taggedBirth _ _ _ _ x b).1 xb with oldx | ⟨freshx, rfl⟩ - · have hx := (ZFSet.pair_mem_prod.1 (born.1 oldx)).1 - rcases (pair_mem_taggedBirth _ _ _ _ y a).1 ya with oldy | ⟨_, rfl⟩ - · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 - have oldEntry := (d.old_meet_iff hx hy).1 meetEntry - have hz := (ZFSet.pair_mem_prod.1 (d.oldOrder.operation.1 oldEntry)).2 - exact oldMeet x y z a b c oldy oldx ab - (fun lower => notLower ((d.old_order_iff hx hy).2 lower)) oldEntry - ((taggedBirth_old_iff hz).1 zc) - · exact False.elim (ZFSet.mem_asymm (earlier x b oldx) ab) - · rcases (pair_mem_taggedBirth _ _ _ _ y a).1 ya with oldy | ⟨_, rfl⟩ - · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 - obtain ⟨p, hp, q, hq, equal⟩ := ZFSet.mem_prod.1 freshx - obtain rfl := ZFSet.mem_singleton.1 hp - subst x - obtain ⟨q', rfl⟩ := d.freshCode_surjective q hq - let v := d.oldOrder.toMeetOrder.meet (d.templates.shadow q') ⟨y, hy⟩ - have other : ZFSet.pair (ZFSet.pair (d.coding.encode (.inr q')) y) v.val ∈ d.batchMeetGraph := - d.coding.encoded_shadow_meet q' ⟨y, hy⟩ notLower - have equal : z = v.val := - (show FunctionGraphOn (ZFSet.prod d.batchCarrier d.batchCarrier) d.batchMeetGraph from - ⟨d.batchCarrier, d.batch_meetOrder.operation⟩).unique meetEntry other - subst z - exact earlier v.val c ((taggedBirth_old_iff v.property).1 zc) - · exact False.elim (ZFSet.mem_irrefl _ ab) - -theorem batchBirth_fresh_cases {birth stamp x : ZFSet.{u}} - (earlier : ∀ y t, ZFSet.pair y t ∈ birth → t ∈ stamp) - (entry : ZFSet.pair x stamp ∈ d.batchBirth birth stamp) : - ∃ q : d.templates.Fresh, d.coding.encode (.inr q) = x := by - have fresh := (taggedBirth_stamp_iff earlier).1 entry - obtain ⟨p, hp, q, hq, equal⟩ := ZFSet.mem_prod.1 fresh - obtain rfl := ZFSet.mem_singleton.1 hp - obtain ⟨q', rfl⟩ := d.freshCode_surjective q hq - exact ⟨q', equal.symm⟩ - -theorem batchBirth_different_components_bridge {T birth stamp : ZFSet.{u}} - (born : ZFSet.IsFunc P T birth) - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (q t : d.templates.Fresh) (different : q.1 ≠ t.1) : - OldBridgeCode d.batchCarrier d.batchOrder d.batchMeetGraph (d.batchBirth birth stamp) stamp - (d.coding.encode (.inr q)) (d.coding.encode (.inr t)) := by - classical - by_cases qt : ZFSet.pair (d.coding.encode (.inr q)) (d.coding.encode (.inr t)) ∈ d.batchOrder - · let z := d.templates.shadow t - obtain ⟨a, entry, _⟩ := born.2 z.val z.property - exact Or.inr ⟨z.val, old_mem_taggedExtension z.property, a, taggedBirth_subset _ _ _ _ entry, - earlier z.val a entry, Or.inl - ⟨(d.coding.old_upper_iff q z).2 ((d.coding.cross_lower_iff q t different).1 qt), - (d.coding.old_lower_iff z t).2 (d.oldOrder.order.refl z.val z.property)⟩⟩ - · by_cases tq : ZFSet.pair (d.coding.encode (.inr t)) (d.coding.encode (.inr q)) ∈ d.batchOrder - · let z := d.templates.shadow q - obtain ⟨a, entry, _⟩ := born.2 z.val z.property - exact Or.inr ⟨z.val, old_mem_taggedExtension z.property, a, taggedBirth_subset _ _ _ _ entry, - earlier z.val a entry, Or.inr - ⟨(d.coding.old_upper_iff t z).2 ((d.coding.cross_lower_iff t q different.symm).1 tq), - (d.coding.old_lower_iff z q).2 (d.oldOrder.order.refl z.val z.property)⟩⟩ - · let z := d.oldOrder.toMeetOrder.meet (d.templates.shadow q) (d.templates.shadow t) - obtain ⟨a, entry, _⟩ := born.2 z.val z.property - exact Or.inl ⟨z.val, a, d.coding.encoded_cross_meet q t different qt tq, - taggedBirth_subset _ _ _ _ entry, earlier z.val a entry⟩ - -end AttachmentBatchInputs - -open SetRealization SetFormula -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem taggedBirth_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P N birth stamp : ZFSet.{u}} (hP : P ∈ M.sets) (hN : N ∈ M.sets) - (hBirth : birth ∈ M.sets) (hStamp : stamp ∈ M.sets) : taggedBirth P N birth stamp ∈ M.sets := by - have hSingleP : ({P} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP - have hSingleStamp : ({stamp} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hStamp hStamp - exact M.binary_union_mem pairing unions hBirth - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hSingleP hN) hSingleStamp) - -end TransitiveGround - -namespace AttachmentBatchInputs -variable {M : TransitiveGround.{u}} -variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) - -theorem batchBirth_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {birth stamp : ZFSet.{u}} (hP : P ∈ M.sets) (hI : I ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hBirth : birth ∈ M.sets) (hStamp : stamp ∈ M.sets) : d.batchBirth birth stamp ∈ M.sets := - M.taggedBirth_mem pairing unions powers separation hP - (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) hBirth hStamp - -noncomputable def batchBirth_earlier_layer - (separation : SeparationSchema M.sets) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {T birth stamp t : ZFSet.{u}} (hP : P ∈ M.sets) - (born : ZFSet.IsFunc P T birth) (before : t ∈ stamp) - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) : - CodedGrowthLayer M Space sourceOrder sourceMeet d.batchCarrier d.batchOrder d.batchMeetGraph - (d.batchBirth birth stamp) t := by - have meetSubset : μ ⊆ d.batchMeetGraph := by - intro z hz - obtain ⟨xy, hxy, v, hv, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.operation.1 hz) - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy - exact d.old_meet_entry hz - apply layer.of_literal_extension separation hP (fun _ => old_mem_taggedExtension) ?_ - meetSubset (taggedBirth_subset _ _ _ _) - · intro x _ entry - have old := (taggedBirth_earlier_iff before).1 entry - exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ - · intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.order.relation hz) - exact (d.old_order_iff hx hy).2 hz - -noncomputable def batchBirth_incoming_layer - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - {T birth stamp : ZFSet.{u}} - (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) - (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) - (born : ZFSet.IsFunc P T birth) - (old : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) - (index : SetMembers I → ZFSet.{u}) (earlier : ∀ i, index i ∈ stamp) - (spaces : ∀ i, Space (index i) = d.space ⟨SetMembers.raw i, SetMembers.raw_mem i⟩) - (orders : ∀ i, sourceOrder (index i) = d.rel ⟨SetMembers.raw i, SetMembers.raw_mem i⟩) - (meets : ∀ i, sourceMeet (index i) = d.meet ⟨SetMembers.raw i, SetMembers.raw_mem i⟩) : - CodedGrowthLayer M Space sourceOrder sourceMeet d.batchCarrier d.batchOrder d.batchMeetGraph - (d.batchBirth birth stamp) stamp := by - classical - let fresh (x : {x : ZFSet.{u} // x ∈ d.batchCarrier ∧ - ZFSet.pair x stamp ∈ d.batchBirth birth stamp}) : d.templates.Fresh := - (d.batchBirth_fresh_cases old x.property.2).choose - have freshEq (x : {x : ZFSet.{u} // x ∈ d.batchCarrier ∧ - ZFSet.pair x stamp ∈ d.batchBirth birth stamp}) : d.coding.encode (.inr (fresh x)) = x.val := - (d.batchBirth_fresh_cases old x.property.2).choose_spec - let component (x : {x : ZFSet.{u} // x ∈ d.batchCarrier ∧ - ZFSet.pair x stamp ∈ d.batchBirth birth stamp}) : SetMembers I := - SetMembers.ofMem (fresh x).1.val (fresh x).1.property - refine .separated (SetMembers I) index - (fun i => batchTemplateGraph I P Qs rs As Es (SetMembers.raw i)) earlier - (fun i => M.batchTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs - (M.transitive hI (SetMembers.raw_mem i))) ?_ component ?_ ?_ - · intro i - simpa only [spaces i, orders i, meets i] using - d.batch_template_embedding_code ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ - · intro x - let q := fresh x - have sameIndex : (⟨SetMembers.raw (component x), SetMembers.raw_mem (component x)⟩ : - {i : ZFSet.{u} // i ∈ I}) = q.1 := by - apply Subtype.ext - exact SetMembers.raw_ofMem q.1.val q.1.property - have rawSame : SetMembers.raw (component x) = q.1.val := congrArg Subtype.val sameIndex - have point : q.2.val.val ∈ Space (index (component x)) := by - rw [spaces, sameIndex] - exact q.2.val.property - apply (mem_relationImage _ _ _ x.val).2 - refine ⟨x.property.1, q.2.val.val, point, ?_⟩ - rw [rawSame, ← freshEq x] - apply (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 - apply (d.batch_template_entry_iff q.1 _ _).2 - exact Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.2.val.property, q.2.property⟩, rfl⟩ - · intro x y different - have separate : (fresh x).1 ≠ (fresh y).1 := by - intro equal - apply different - exact congrArg (fun i : {i : ZFSet.{u} // i ∈ I} => SetMembers.ofMem i.val i.property) equal - have bridge := d.batchBirth_different_components_bridge born old (fresh x) (fresh y) separate - rw [freshEq x, freshEq y] at bridge - exact bridge - -end AttachmentBatchInputs - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFinalInsertionExceptions +import OAI.SetTheory.PartitionPrinciple.Geometry.GrowthLayerSourceCongruence + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace NatUnionCode +universe u + +theorem oldMeet {r μ birth : Nat → ZFSet.{u}} {R MU B : ZFSet.{u}} + (relation : NatUnionCode r R) (operation : NatUnionCode μ MU) + (born : NatUnionCode birth B) + (laws : ∀ n, OldMeetCode (r n) (μ n) (birth n)) + (operationMono : ∀ n m, n ≤ m → μ n ⊆ μ m) + (birthMono : ∀ n m, n ≤ m → birth n ⊆ birth m) : OldMeetCode R MU B := by + intro x y z a b c ya xb ab notLower xy zc + obtain ⟨i, hi⟩ := (born _).1 ya + obtain ⟨j, hj⟩ := (born _).1 xb + obtain ⟨k, hk⟩ := (operation _).1 xy + obtain ⟨l, hl⟩ := (born _).1 zc + let n := max (max i j) (max k l) + have iN : i ≤ n := (le_max_left i j).trans (le_max_left (max i j) (max k l)) + have jN : j ≤ n := (le_max_right i j).trans (le_max_left (max i j) (max k l)) + have kN : k ≤ n := (le_max_left k l).trans (le_max_right (max i j) (max k l)) + have lN : l ≤ n := (le_max_right k l).trans (le_max_right (max i j) (max k l)) + exact laws n x y z a b c (birthMono i n iN hi) (birthMono j n jN hj) ab + (fun lower => notLower (relation.subset n lower)) (operationMono k n kN hk) + (birthMono l n lN hl) + +theorem birth_bound {birth : Nat → ZFSet.{u}} {B cutoff : ZFSet.{u}} + (born : NatUnionCode birth B) + (bounds : ∀ n x t, ZFSet.pair x t ∈ birth n → t ∈ cutoff) : + ∀ x t, ZFSet.pair x t ∈ B → t ∈ cutoff := by + intro x t entry + obtain ⟨n, hn⟩ := (born _).1 entry + exact bounds n x t hn + +theorem no_birth_at_bound {birth : Nat → ZFSet.{u}} {B cutoff : ZFSet.{u}} + (born : NatUnionCode birth B) + (bounds : ∀ n x t, ZFSet.pair x t ∈ birth n → t ∈ cutoff) : + ∀ x, ZFSet.pair x cutoff ∉ B := by + intro x entry + exact ZFSet.mem_irrefl cutoff (born.birth_bound bounds x cutoff entry) + +theorem stable_birth_entry_iff {birth : Nat → ZFSet.{u}} {B t : ZFSet.{u}} + (born : NatUnionCode birth B) (n : Nat) + (stable : ∀ m x, ZFSet.pair x t ∈ birth m → ZFSet.pair x t ∈ birth n) + (x : ZFSet.{u}) : ZFSet.pair x t ∈ B ↔ ZFSet.pair x t ∈ birth n := by + constructor + · intro entry + obtain ⟨m, hm⟩ := (born _).1 entry + exact stable m x hm + · exact fun entry => born.subset n entry + +theorem stable_birth_fiber {P birth : Nat → ZFSet.{u}} {B t T : ZFSet.{u}} + (born : NatUnionCode birth B) (n : Nat) (function : ZFSet.IsFunc (P n) T (birth n)) + (stable : ∀ m x, ZFSet.pair x t ∈ birth m → ZFSet.pair x t ∈ birth n) : + ∀ x, ZFSet.pair x t ∈ B → x ∈ P n ∧ ZFSet.pair x t ∈ birth n := by + intro x entry + have old := (born.stable_birth_entry_iff n stable x).1 entry + exact ⟨(ZFSet.pair_mem_prod.1 (function.1 old)).1, old⟩ + +end NatUnionCode + +section + +universe u + +theorem MeetEmbeddingCode.enlarge_target + {A L L' rA r r' μA μ μ' e : ZFSet.{u}} + (embedding : MeetEmbeddingCode A L rA r μA μ e) + (carrier : L ⊆ L') (order : r ⊆ r') (meets : μ ⊆ μ') : + MeetEmbeddingCode A L' rA r' μA μ' e := by + refine ⟨⟨⟨?_, embedding.injection.function.2⟩, embedding.injection.injective⟩, + fun x y x' y' below first second => order (embedding.monotone x y x' y' below first second), + fun x y z x' y' z' meet first second third => + meets (embedding.map_meet x y z x' y' z' meet first second third)⟩ + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (embedding.injection.function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, carrier hy⟩ + +theorem relationImage_enlarge_target {A L L' e : ZFSet.{u}} (carrier : L ⊆ L') : + relationImage A L e ⊆ relationImage A L' e := by + intro x hx + obtain ⟨hxL, witness⟩ := (mem_relationImage A L e x).1 hx + exact (mem_relationImage A L' e x).2 ⟨carrier hxL, witness⟩ + +theorem OldBridgeCode.of_literal_extension + {L L' r r' μ μ' birth birth' t x y : ZFSet.{u}} + (bridge : OldBridgeCode L r μ birth t x y) + (carrier : L ⊆ L') (order : r ⊆ r') (meets : μ ⊆ μ') (born : birth ⊆ birth') : + OldBridgeCode L' r' μ' birth' t x y := by + rcases bridge with ⟨z, a, meet, entry, earlier⟩ | ⟨z, hz, a, entry, earlier, between⟩ + · exact Or.inl ⟨z, a, meets meet, born entry, earlier⟩ + · exact Or.inr ⟨z, carrier hz, a, born entry, earlier, + between.elim (fun h => Or.inl ⟨order h.1, order h.2⟩) + (fun h => Or.inr ⟨order h.1, order h.2⟩)⟩ + +def CodedGrowthLayer.of_literal_extension + {M : TransitiveGround.{u}} {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {L L' r r' μ μ' birth birth' t : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t) + (separation : SetFormula.SeparationSchema M.sets) (hL : L ∈ M.sets) + (carrier : L ⊆ L') (order : r ⊆ r') (meets : μ ⊆ μ') (born : birth ⊆ birth') + (fiber : ∀ x ∈ L', ZFSet.pair x t ∈ birth' → x ∈ L ∧ ZFSet.pair x t ∈ birth) : + CodedGrowthLayer M Space sourceOrder sourceMeet L' r' μ' birth' t := by + cases layer with + | countablePoints D ground small cover => + exact .countablePoints D ground small (fun x hx entry => + cover x (fiber x hx entry).1 (fiber x hx entry).2) + | copies I parts groundI small groundParts index e earlier groundCopy embedding cover inCopy => + let retained := ZFSet.sep (fun z => z ∈ ZFSet.prod I L) parts + refine .copies I retained groundI small + (M.injection_restriction_mem separation groundI hL groundParts) index e earlier groundCopy + (fun i hi => (embedding i hi).enlarge_target carrier order meets) + ?_ ?_ + · intro x hx entry + have old := fiber x hx entry + obtain ⟨i, hi, part⟩ := cover x old.1 old.2 + exact ⟨i, hi, ZFSet.mem_sep.2 ⟨part, ZFSet.pair_mem_prod.2 ⟨hi, old.1⟩⟩⟩ + · intro i hi x _ entry + obtain ⟨part, bound⟩ := ZFSet.mem_sep.1 entry + have hxL := (ZFSet.pair_mem_prod.1 bound).2 + exact relationImage_enlarge_target carrier (inCopy i hi x hxL part) + | separated I index e earlier groundCopy embedding component cover separated => + let oldPoint (x : {x : ZFSet.{u} // x ∈ L' ∧ ZFSet.pair x t ∈ birth'}) : + {x : ZFSet.{u} // x ∈ L ∧ ZFSet.pair x t ∈ birth} := + ⟨x.val, fiber x.val x.property.1 x.property.2⟩ + exact .separated I index e earlier groundCopy + (fun i => (embedding i).enlarge_target carrier order meets) + (fun x => component (oldPoint x)) + (fun x => relationImage_enlarge_target carrier (cover (oldPoint x))) + (fun x y different => (separated (oldPoint x) (oldPoint y) different).of_literal_extension + carrier order meets born) + +noncomputable def fixedTopBirth (P birth s : ZFSet.{u}) : ZFSet.{u} := + insert (ZFSet.pair P s) birth + +theorem pair_mem_fixedTopBirth (P birth s x t : ZFSet.{u}) : + ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ + (x = P ∧ t = s) ∨ ZFSet.pair x t ∈ birth := by + rw [fixedTopBirth, ZFSet.mem_insert_iff, ZFSet.pair_inj] + +theorem fixedTopBirth_subset (P birth s : ZFSet.{u}) : birth ⊆ fixedTopBirth P birth s := + fun _ h => ZFSet.mem_insert_iff.2 (Or.inr h) + +theorem fixedTopBirth_old_iff {P birth s x t : ZFSet.{u}} (hx : x ∈ P) : + ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ ZFSet.pair x t ∈ birth := by + rw [pair_mem_fixedTopBirth] + exact ⟨fun h => h.elim (fun equal => False.elim (ZFSet.mem_irrefl P (equal.1 ▸ hx))) id, + Or.inr⟩ + +theorem fixedTopBirth_top_iff {P T birth s t : ZFSet.{u}} (born : ZFSet.IsFunc P T birth) : + ZFSet.pair P t ∈ fixedTopBirth P birth s ↔ t = s := by + rw [pair_mem_fixedTopBirth] + exact ⟨fun h => h.elim And.right (fun entry => + False.elim (ZFSet.mem_irrefl P (ZFSet.pair_mem_prod.1 (born.1 entry)).1)), + fun equal => Or.inl ⟨rfl, equal⟩⟩ + +theorem fixedTopBirth_function {P T birth s : ZFSet.{u}} + (born : ZFSet.IsFunc P T birth) (hs : s ∈ T) : + ZFSet.IsFunc (fixedTopCarrier P) T (fixedTopBirth P birth s) := by + refine ⟨?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_insert_iff.1 hz with rfl | old + · exact ZFSet.pair_mem_prod.2 ⟨fixedTopCarrier_top P, hs⟩ + · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (born.1 old) + exact ZFSet.pair_mem_prod.2 ⟨fixedTopCarrier_old hx, ht⟩ + · intro x hx + rcases (mem_fixedTopCarrier P x).1 hx with rfl | old + · exact ⟨s, (fixedTopBirth_top_iff born).2 rfl, fun t entry => (fixedTopBirth_top_iff born).1 entry⟩ + · obtain ⟨t, entry, unique⟩ := born.2 x old + exact ⟨t, (fixedTopBirth_old_iff old).2 entry, + fun t' entry' => unique t' ((fixedTopBirth_old_iff old).1 entry')⟩ + +theorem fixedTopBirth_bound {P birth s : ZFSet.{u}} + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : + ∀ x t, ZFSet.pair x t ∈ fixedTopBirth P birth s → t = s ∨ t ∈ s := by + intro x t entry + exact ((pair_mem_fixedTopBirth P birth s x t).1 entry).elim + (fun equal => Or.inl equal.2) (fun old => Or.inr (earlier x t old)) + +theorem fixedTopBirth_new_time_iff {P birth s x : ZFSet.{u}} + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : + ZFSet.pair x s ∈ fixedTopBirth P birth s ↔ x = P := by + rw [pair_mem_fixedTopBirth] + exact ⟨fun h => h.elim And.left (fun old => False.elim (ZFSet.mem_irrefl s (earlier x s old))), + fun equal => Or.inl ⟨equal, rfl⟩⟩ + +theorem fixedTopBirth_earlier_iff {P birth s x t : ZFSet.{u}} (before : t ∈ s) : + ZFSet.pair x t ∈ fixedTopBirth P birth s ↔ ZFSet.pair x t ∈ birth := by + rw [pair_mem_fixedTopBirth] + exact ⟨fun h => h.elim (fun equal => False.elim (ZFSet.mem_irrefl s (equal.2 ▸ before))) id, + Or.inr⟩ + +theorem fixedTopBirth_oldMeet {P T r μ birth s : ZFSet.{u}} + (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) (oldMeet : OldMeetCode r μ birth) : + OldMeetCode (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) := by + intro x y z a b c ya xb ab notLower xy zc + rcases (pair_mem_fixedTopBirth P birth s x b).1 xb with ⟨newx, newb⟩ | oldx + · subst x b + rcases (pair_mem_fixedTopBirth P birth s y a).1 ya with ⟨newy, newa⟩ | oldy + · subst y a + exact False.elim (ZFSet.mem_irrefl s ab) + · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 + have equal := (fixedTopMeet_top_left meet (fixedTopCarrier_old hy)).1 xy + subst z + have oldc := (fixedTopBirth_old_iff hy).1 zc + exact earlier y c oldc + · have hx := (ZFSet.pair_mem_prod.1 (born.1 oldx)).1 + rcases (pair_mem_fixedTopBirth P birth s y a).1 ya with ⟨newy, newa⟩ | oldy + · subst y a + exact False.elim (ZFSet.mem_asymm (earlier x b oldx) ab) + · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 + have oldxy := (fixedTopMeet_old_iff meet hx hy).1 xy + have hz := (ZFSet.pair_mem_prod.1 (meet.operation.1 oldxy)).2 + exact oldMeet x y z a b c oldy oldx ab + (fun lower => notLower ((fixedTopOrder_old_iff hy).2 lower)) oldxy + ((fixedTopBirth_old_iff hz).1 zc) + +theorem fixedTopBirth_singleton_injection (P : ZFSet.{u}) : + InjectionCode {P} ZFSet.omega {ZFSet.pair P ∅} := by + refine ⟨⟨?_, ?_⟩, ?_⟩ + · intro z hz + have equal := ZFSet.mem_singleton.1 hz + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, ZFSet.omega_zero⟩ + · intro x hx + have equal := ZFSet.mem_singleton.1 hx + subst x + refine ⟨∅, ZFSet.mem_singleton.2 rfl, ?_⟩ + intro y entry + exact (ZFSet.pair_inj.1 (ZFSet.mem_singleton.1 entry)).2 + · intro x y z first second + exact (ZFSet.pair_inj.1 (ZFSet.mem_singleton.1 first)).1.trans + (ZFSet.pair_inj.1 (ZFSet.mem_singleton.1 second)).1.symm + +end + +namespace CodedGrowthLayer +open SetFormula +universe u + +def of_natUnion {M : TransitiveGround.{u}} + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {P r μ birth : Nat → ZFSet.{u}} {L R MU B t T : ZFSet.{u}} + (carrier : NatUnionCode P L) (relation : NatUnionCode r R) + (operation : NatUnionCode μ MU) (born : NatUnionCode birth B) + (n : Nat) (layer : CodedGrowthLayer M Space sourceOrder sourceMeet + (P n) (r n) (μ n) (birth n) t) + (separation : SeparationSchema M.sets) (ground : P n ∈ M.sets) + (function : ZFSet.IsFunc (P n) T (birth n)) + (stable : ∀ m x, ZFSet.pair x t ∈ birth m → ZFSet.pair x t ∈ birth n) : + CodedGrowthLayer M Space sourceOrder sourceMeet L R MU B t := + layer.of_literal_extension separation ground (carrier.subset n) (relation.subset n) + (operation.subset n) (born.subset n) + (fun x _ entry => born.stable_birth_fiber n function stable x entry) + +def empty_of_no_birth {M : TransitiveGround.{u}} + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {L r μ birth t : ZFSet.{u}} (inhabited : M.sets.Nonempty) + (empty : ∀ x ∈ L, ZFSet.pair x t ∉ birth) : + CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := + .countablePoints ∅ (M.empty_mem inhabited) (M.empty_groundEmbeddable ZFSet.omega inhabited) + (fun x hx entry => False.elim (empty x hx entry)) + +def empty_at_birth_bound {M : TransitiveGround.{u}} + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {L r μ birth cutoff : ZFSet.{u}} (inhabited : M.sets.Nonempty) + (bounds : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ cutoff) : + CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth cutoff := + empty_of_no_birth inhabited (fun x _ entry => ZFSet.mem_irrefl cutoff (bounds x cutoff entry)) + +end CodedGrowthLayer + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem fixedTopBirth_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + {P birth s : ZFSet.{u}} (hP : P ∈ M.sets) (hBirth : birth ∈ M.sets) (hs : s ∈ M.sets) : + fixedTopBirth P birth s ∈ M.sets := + M.insert_mem pairing unions (M.orderedPair_mem pairing hP hs) hBirth + +theorem fixedTopBirth_singleton_small + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {P : ZFSet.{u}} (hP : P ∈ M.sets) : + ({P} : ZFSet.{u}) ∈ M.sets ∧ M.groundEmbeddable {P} ZFSet.omega := by + have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + have hEntry := M.orderedPair_mem pairing hP (M.empty_mem ⟨P, hP⟩) + have hGraph : ({ZFSet.pair P ∅} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hEntry hEntry + exact ⟨hSingle, {ZFSet.pair P ∅}, hGraph, fixedTopBirth_singleton_injection P⟩ + +def fixedTopBirth_incoming_layer + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {P r birth s : ZFSet.{u}} (hP : P ∈ M.sets) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) : + CodedGrowthLayer M Space sourceOrder sourceMeet (fixedTopCarrier P) + (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) s := + .countablePoints {P} (M.fixedTopBirth_singleton_small pairing hP).1 + (M.fixedTopBirth_singleton_small pairing hP).2 + (fun _ _ entry => ZFSet.mem_singleton.2 ((fixedTopBirth_new_time_iff earlier).1 entry)) + +noncomputable def fixedTopBirth_earlier_layer + (separation : SeparationSchema M.sets) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {P T r μ birth s t : ZFSet.{u}} + (hP : P ∈ M.sets) (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) + (before : t ∈ s) + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) : + CodedGrowthLayer M Space sourceOrder sourceMeet (fixedTopCarrier P) + (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t := by + apply layer.of_literal_extension separation hP (fixedTopCarrier_subset P) + (fixedTopOrder_subset P r) (fixedTopMeet_subset meet) (fixedTopBirth_subset P birth s) + intro x _ entry + have old := (fixedTopBirth_earlier_iff before).1 entry + exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ + +noncomputable def fixedTopBirth_layers + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (separation : SeparationSchema M.sets) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {P T r μ birth s : ZFSet.{u}} + (hP : P ∈ M.sets) (meet : MeetOrderCode P r μ) (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ s) + (layers : ∀ t ∈ s, CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) + (t : ZFSet.{u}) (bounded : t = s ∨ t ∈ s) : + CodedGrowthLayer M Space sourceOrder sourceMeet (fixedTopCarrier P) + (fixedTopOrder P r) (fixedTopMeet P r) (fixedTopBirth P birth s) t := by + classical + by_cases equal : t = s + · subst t + exact M.fixedTopBirth_incoming_layer pairing hP earlier + · have before := bounded.resolve_left equal + exact M.fixedTopBirth_earlier_layer separation hP meet born before (layers t before) + +end TransitiveGround + +namespace AttachmentBatchInputs +universe u +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) + +noncomputable abbrev batchBirth (_d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) (birth stamp : ZFSet.{u}) : ZFSet.{u} := + taggedBirth P (indexedAttachmentFresh I Qs rs As) birth stamp + +theorem batchBirth_function {T birth stamp : ZFSet.{u}} + (born : ZFSet.IsFunc P T birth) (hs : stamp ∈ T) : + ZFSet.IsFunc d.batchCarrier T (d.batchBirth birth stamp) := taggedBirth_function born hs + +theorem batchBirth_fresh_entry_iff {T birth stamp t : ZFSet.{u}} + (born : ZFSet.IsFunc P T birth) (q : d.templates.Fresh) : + ZFSet.pair (d.coding.encode (.inr q)) t ∈ d.batchBirth birth stamp ↔ t = stamp := + taggedBirth_fresh_iff born (d.freshCode_mem q) + +theorem batchBirth_oldMeet {T birth stamp : ZFSet.{u}} + (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (oldMeet : OldMeetCode r μ birth) : + OldMeetCode d.batchOrder d.batchMeetGraph (d.batchBirth birth stamp) := by + intro x y z a b c ya xb ab notLower meetEntry zc + rcases (pair_mem_taggedBirth _ _ _ _ x b).1 xb with oldx | ⟨freshx, rfl⟩ + · have hx := (ZFSet.pair_mem_prod.1 (born.1 oldx)).1 + rcases (pair_mem_taggedBirth _ _ _ _ y a).1 ya with oldy | ⟨_, rfl⟩ + · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 + have oldEntry := (d.old_meet_iff hx hy).1 meetEntry + have hz := (ZFSet.pair_mem_prod.1 (d.oldOrder.operation.1 oldEntry)).2 + exact oldMeet x y z a b c oldy oldx ab + (fun lower => notLower ((d.old_order_iff hx hy).2 lower)) oldEntry + ((taggedBirth_old_iff hz).1 zc) + · exact False.elim (ZFSet.mem_asymm (earlier x b oldx) ab) + · rcases (pair_mem_taggedBirth _ _ _ _ y a).1 ya with oldy | ⟨_, rfl⟩ + · have hy := (ZFSet.pair_mem_prod.1 (born.1 oldy)).1 + obtain ⟨p, hp, q, hq, equal⟩ := ZFSet.mem_prod.1 freshx + obtain rfl := ZFSet.mem_singleton.1 hp + subst x + obtain ⟨q', rfl⟩ := d.freshCode_surjective q hq + let v := d.oldOrder.toMeetOrder.meet (d.templates.shadow q') ⟨y, hy⟩ + have other : ZFSet.pair (ZFSet.pair (d.coding.encode (.inr q')) y) v.val ∈ d.batchMeetGraph := + d.coding.encoded_shadow_meet q' ⟨y, hy⟩ notLower + have equal : z = v.val := + (show FunctionGraphOn (ZFSet.prod d.batchCarrier d.batchCarrier) d.batchMeetGraph from + ⟨d.batchCarrier, d.batch_meetOrder.operation⟩).unique meetEntry other + subst z + exact earlier v.val c ((taggedBirth_old_iff v.property).1 zc) + · exact False.elim (ZFSet.mem_irrefl _ ab) + +theorem batchBirth_fresh_cases {birth stamp x : ZFSet.{u}} + (earlier : ∀ y t, ZFSet.pair y t ∈ birth → t ∈ stamp) + (entry : ZFSet.pair x stamp ∈ d.batchBirth birth stamp) : + ∃ q : d.templates.Fresh, d.coding.encode (.inr q) = x := by + have fresh := (taggedBirth_stamp_iff earlier).1 entry + obtain ⟨p, hp, q, hq, equal⟩ := ZFSet.mem_prod.1 fresh + obtain rfl := ZFSet.mem_singleton.1 hp + obtain ⟨q', rfl⟩ := d.freshCode_surjective q hq + exact ⟨q', equal.symm⟩ + +theorem batchBirth_different_components_bridge {T birth stamp : ZFSet.{u}} + (born : ZFSet.IsFunc P T birth) + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (q t : d.templates.Fresh) (different : q.1 ≠ t.1) : + OldBridgeCode d.batchCarrier d.batchOrder d.batchMeetGraph (d.batchBirth birth stamp) stamp + (d.coding.encode (.inr q)) (d.coding.encode (.inr t)) := by + classical + by_cases qt : ZFSet.pair (d.coding.encode (.inr q)) (d.coding.encode (.inr t)) ∈ d.batchOrder + · let z := d.templates.shadow t + obtain ⟨a, entry, _⟩ := born.2 z.val z.property + exact Or.inr ⟨z.val, old_mem_taggedExtension z.property, a, taggedBirth_subset _ _ _ _ entry, + earlier z.val a entry, Or.inl + ⟨(d.coding.old_upper_iff q z).2 ((d.coding.cross_lower_iff q t different).1 qt), + (d.coding.old_lower_iff z t).2 (d.oldOrder.order.refl z.val z.property)⟩⟩ + · by_cases tq : ZFSet.pair (d.coding.encode (.inr t)) (d.coding.encode (.inr q)) ∈ d.batchOrder + · let z := d.templates.shadow q + obtain ⟨a, entry, _⟩ := born.2 z.val z.property + exact Or.inr ⟨z.val, old_mem_taggedExtension z.property, a, taggedBirth_subset _ _ _ _ entry, + earlier z.val a entry, Or.inr + ⟨(d.coding.old_upper_iff t z).2 ((d.coding.cross_lower_iff t q different.symm).1 tq), + (d.coding.old_lower_iff z q).2 (d.oldOrder.order.refl z.val z.property)⟩⟩ + · let z := d.oldOrder.toMeetOrder.meet (d.templates.shadow q) (d.templates.shadow t) + obtain ⟨a, entry, _⟩ := born.2 z.val z.property + exact Or.inl ⟨z.val, a, d.coding.encoded_cross_meet q t different qt tq, + taggedBirth_subset _ _ _ _ entry, earlier z.val a entry⟩ + +end AttachmentBatchInputs + +open SetRealization SetFormula +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem taggedBirth_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P N birth stamp : ZFSet.{u}} (hP : P ∈ M.sets) (hN : N ∈ M.sets) + (hBirth : birth ∈ M.sets) (hStamp : stamp ∈ M.sets) : taggedBirth P N birth stamp ∈ M.sets := by + have hSingleP : ({P} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP + have hSingleStamp : ({stamp} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hStamp hStamp + exact M.binary_union_mem pairing unions hBirth + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hSingleP hN) hSingleStamp) + +end TransitiveGround + +namespace AttachmentBatchInputs +variable {M : TransitiveGround.{u}} +variable {P r μ I Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs P r μ I Qs rs μs As Es Fs Ss) + +theorem batchBirth_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {birth stamp : ZFSet.{u}} (hP : P ∈ M.sets) (hI : I ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hBirth : birth ∈ M.sets) (hStamp : stamp ∈ M.sets) : d.batchBirth birth stamp ∈ M.sets := + M.taggedBirth_mem pairing unions powers separation hP + (M.indexedAttachmentFresh_mem pairing unions powers separation hI hQs hrs hAs) hBirth hStamp + +noncomputable def batchBirth_earlier_layer + (separation : SeparationSchema M.sets) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {T birth stamp t : ZFSet.{u}} (hP : P ∈ M.sets) + (born : ZFSet.IsFunc P T birth) (before : t ∈ stamp) + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet P r μ birth t) : + CodedGrowthLayer M Space sourceOrder sourceMeet d.batchCarrier d.batchOrder d.batchMeetGraph + (d.batchBirth birth stamp) t := by + have meetSubset : μ ⊆ d.batchMeetGraph := by + intro z hz + obtain ⟨xy, hxy, v, hv, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.operation.1 hz) + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy + exact d.old_meet_entry hz + apply layer.of_literal_extension separation hP (fun _ => old_mem_taggedExtension) ?_ + meetSubset (taggedBirth_subset _ _ _ _) + · intro x _ entry + have old := (taggedBirth_earlier_iff before).1 entry + exact ⟨(ZFSet.pair_mem_prod.1 (born.1 old)).1, old⟩ + · intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (d.oldOrder.order.relation hz) + exact (d.old_order_iff hx hy).2 hz + +noncomputable def batchBirth_incoming_layer + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + {T birth stamp : ZFSet.{u}} + (hP : P ∈ M.sets) (hI : I ∈ M.sets) (hQs : Qs ∈ M.sets) + (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) + (born : ZFSet.IsFunc P T birth) + (old : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) + (index : SetMembers I → ZFSet.{u}) (earlier : ∀ i, index i ∈ stamp) + (spaces : ∀ i, Space (index i) = d.space ⟨SetMembers.raw i, SetMembers.raw_mem i⟩) + (orders : ∀ i, sourceOrder (index i) = d.rel ⟨SetMembers.raw i, SetMembers.raw_mem i⟩) + (meets : ∀ i, sourceMeet (index i) = d.meet ⟨SetMembers.raw i, SetMembers.raw_mem i⟩) : + CodedGrowthLayer M Space sourceOrder sourceMeet d.batchCarrier d.batchOrder d.batchMeetGraph + (d.batchBirth birth stamp) stamp := by + classical + let fresh (x : {x : ZFSet.{u} // x ∈ d.batchCarrier ∧ + ZFSet.pair x stamp ∈ d.batchBirth birth stamp}) : d.templates.Fresh := + (d.batchBirth_fresh_cases old x.property.2).choose + have freshEq (x : {x : ZFSet.{u} // x ∈ d.batchCarrier ∧ + ZFSet.pair x stamp ∈ d.batchBirth birth stamp}) : d.coding.encode (.inr (fresh x)) = x.val := + (d.batchBirth_fresh_cases old x.property.2).choose_spec + let component (x : {x : ZFSet.{u} // x ∈ d.batchCarrier ∧ + ZFSet.pair x stamp ∈ d.batchBirth birth stamp}) : SetMembers I := + SetMembers.ofMem (fresh x).1.val (fresh x).1.property + refine .separated (SetMembers I) index + (fun i => batchTemplateGraph I P Qs rs As Es (SetMembers.raw i)) earlier + (fun i => M.batchTemplateGraph_mem pairing unions powers separation hI hP hQs hrs hAs hEs + (M.transitive hI (SetMembers.raw_mem i))) ?_ component ?_ ?_ + · intro i + simpa only [spaces i, orders i, meets i] using + d.batch_template_embedding_code ⟨SetMembers.raw i, SetMembers.raw_mem i⟩ + · intro x + let q := fresh x + have sameIndex : (⟨SetMembers.raw (component x), SetMembers.raw_mem (component x)⟩ : + {i : ZFSet.{u} // i ∈ I}) = q.1 := by + apply Subtype.ext + exact SetMembers.raw_ofMem q.1.val q.1.property + have rawSame : SetMembers.raw (component x) = q.1.val := congrArg Subtype.val sameIndex + have point : q.2.val.val ∈ Space (index (component x)) := by + rw [spaces, sameIndex] + exact q.2.val.property + apply (mem_relationImage _ _ _ x.val).2 + refine ⟨x.property.1, q.2.val.val, point, ?_⟩ + rw [rawSame, ← freshEq x] + apply (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 + apply (d.batch_template_entry_iff q.1 _ _).2 + exact Or.inr ⟨(mem_freshPart _ _ _ _).2 ⟨q.2.val.property, q.2.property⟩, rfl⟩ + · intro x y different + have separate : (fresh x).1 ≠ (fresh y).1 := by + intro equal + apply different + exact congrArg (fun i : {i : ZFSet.{u} // i ∈ I} => SetMembers.ofMem i.val i.property) equal + have bridge := d.batchBirth_different_components_bridge born old (fresh x) (fresh y) separate + rw [freshEq x, freshEq y] at bridge + exact bridge + +end AttachmentBatchInputs + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBinaryRowStageOneRefinement.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBinaryRowStageOneRefinement.lean index f821e628b016170f2975e46a72179a07d7393096..21b7641fed5bf0b042602c4b80b35407d06a0c8b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBinaryRowStageOneRefinement.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundBinaryRowStageOneRefinement.lean @@ -1,368 +1,368 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowTermSetNames -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLiftFamilies - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure RefinementStageSystem (M : TransitiveGround.{u}) (a : PosetAction G P) - (s : Presentation P) (t : Presentation G) (b : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (level T T2 : ZFSet.{u}) : Prop where - valid1 : ∀ z ∈ T, IsName s z - valid2 : ∀ z ∈ T2, IsName s z - terms_hs : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ - pairs_hs : ∀ τ : Name s, τ.val ∈ T2 → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ - first : NiceNameSystem M a s b d base directed T valid1 - second : NiceNameSystem M a s b d base directed T2 valid2 - indices : NiceRefinementIndexSystem M a s b d level T T2 valid1 valid2 - inputs : StageOneActionParameters M a s t b d T T2 valid1 - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) -variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -theorem refinementStageSystem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) - (maps : a.conditionMapFamily s t ∈ M.sets) - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - {level T T2 : ZFSet.{u}} (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) - (closed1 : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) - (closed2 : ∀ g (τ : Name s), τ.val ∈ T2 → (a.act s g τ).val ∈ T2) - (children1 : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) - (children2 : ∀ τ : Name s, τ.val ∈ T2 → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) : - RefinementStageSystem M a s t b d base directed level T T2 := by - have first := M.niceNameSystem a s t pairing unions powers separation collection carrier order - maps hT valid1 closed1 b d base directed group nodes supports children1 - have second := M.niceNameSystem a s t pairing unions powers separation collection carrier order - maps hT2 valid2 closed2 b d base directed group nodes supports children2 - have indices := M.niceRefinementIndexSystem a s b d pairing unions powers separation collection - hLevel hT hT2 carrier order nodes nodeOrder first second - exact ⟨valid1,valid2,children1,children2,first,second,indices, - ⟨maps,nodeMaps,closed1,closed2,indices.family_ground⟩⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G P Q L : Type u} [Group G] -variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] [PartialOrder L] - -structure StageTwoIndexData (M : TransitiveGround.{u}) - (a : PosetAction G P) (s : Presentation P) - (e : PosetAction G Q) (t : Presentation Q) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Prop where - next : RefinementStageSystem M e t actors nodes d base directed (natSetCode 1) T T2 - top_code : t.encode ⊤ = s.encode ⊤ - square : T2 = orderedPairNameFamily (t.encode ⊤) T T - powers : ∀ n : Nat, iteratedPairNameFamily (t.encode ⊤) T n = - iteratedPairNameFamily (s.encode ⊤) T n - levels : - let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e t nodes d (natSetCode 1) T T2 next.valid1 - I0 ∪ I1 ∈ M.sets ∧ - refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0 ∈ M.sets ∧ - ZFSet.IsFunc (I0 ∪ I1) {∅, natSetCode 1} - (refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0) ∧ - refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0 = - ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1} ∧ - ∀ z, ¬ (z ∈ I0 ∧ z ∈ I1) - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (rawRowCarrier I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid -local notation "levels" => stageTwoAssignmentLevels I0 I1 T - -include nodes indices in -theorem stageTwoForcing_entry (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid ↔ - row ∈ rawRowCarrier ∧ - A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ - ∃ lower : P, s.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∧ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 1) T2 A lower := by - rw [M.stageTwoForcing_raw_entry] - constructor - · rintro ⟨rowMem, small, lowerMem, raw⟩ - obtain ⟨lower, equal⟩ := (s.mem_carrier _).1 lowerMem - refine ⟨rowMem, small, lower, equal, ?_⟩ - apply (M.refinementLevelRawTests_iff a s b d (natSetCode 1) - pairing unions powers separation collection carrier order nodes hT valid indices - base directed system A lower).1 - exact equal.symm ▸ raw - · rintro ⟨rowMem, small, lower, equal, tests⟩ - refine ⟨rowMem, small, equal ▸ s.encode_mem lower, ?_⟩ - have raw := (M.refinementLevelRawTests_iff a s b d (natSetCode 1) - pairing unions powers separation collection carrier order nodes hT valid indices - base directed system A lower).2 tests - exact equal ▸ raw - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G P Q L : Type u} [Group G] -variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] [PartialOrder L] - -structure StageTwoCarrierData (M : TransitiveGround.{u}) (rawRowCarrier rowTop : ZFSet.{u}) - (a : PosetAction G P) (s : Presentation P) - (e : PosetAction G Q) (t : Presentation Q) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : Prop where - index_data : StageTwoIndexData M a s e t actors nodes d base directed T T2 valid - terms_ground : T ∈ M.sets - lower_carrier_ground : t.carrier ∈ M.sets - lower_order_ground : t.conditionOrder ∈ M.sets - carrier_ground : - M.stageTwoForcing rawRowCarrier (M.niceRefinementIndices a s nodes d ∅ T T2 valid) - e t nodes d T T2 index_data.next.valid1 ∈ M.sets - top_row_mem : rowTop ∈ rawRowCarrier - empty_top : - ZFSet.pair rowTop ∅ ∈ M.stageTwoForcing rawRowCarrier - (M.niceRefinementIndices a s nodes d ∅ T T2 valid) e t nodes d T T2 index_data.next.valid1 - empty_rows : ∀ row ∈ rawRowCarrier, ZFSet.pair row ∅ ∈ t.carrier → - ZFSet.pair row ∅ ∈ M.stageTwoForcing rawRowCarrier - (M.niceRefinementIndices a s nodes d ∅ T T2 valid) e t nodes d T T2 index_data.next.valid1 - raw_entries : ∀ row A : ZFSet.{u}, - let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e t nodes d (natSetCode 1) T T2 index_data.next.valid1 - let levels := stageTwoAssignmentLevels I0 I1 T - ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 e t nodes d T T2 index_data.next.valid1 ↔ - row ∈ rawRowCarrier ∧ - A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ - ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∈ t.carrier ∧ - stageOneRawTests M (M.refinementLevelFormulaData e t nodes d (natSetCode 1) T T2 index_data.next.valid1) - A (ZFSet.pair row (assignmentCut levels (natSetCode 1) A)) - typed_entries : ∀ row A : ZFSet.{u}, - let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e t nodes d (natSetCode 1) T T2 index_data.next.valid1 - let levels := stageTwoAssignmentLevels I0 I1 T - ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 e t nodes d T T2 index_data.next.valid1 ↔ - row ∈ rawRowCarrier ∧ - A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ - ∃ lower : Q, t.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∧ - M.refinementLevelTests t pairing unions powers separation collection - lower_carrier_ground lower_order_ground terms_ground index_data.next.valid1 - e nodes d base directed index_data.next.first (natSetCode 1) T2 A lower - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) (rawRowCarrier rowTop : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (e : PosetAction G Q) (t : Presentation Q) -variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) - -theorem stageTwoCarrierData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (indexData : StageTwoIndexData M a s e t actors nodes d base directed T T2 valid) - (hRow : rawRowCarrier ∈ M.sets) - (hI0 : M.niceRefinementIndices a s nodes d ∅ T T2 valid ∈ M.sets) - (hT : T ∈ M.sets) (carrier : t.carrier ∈ M.sets) (order : t.conditionOrder ∈ M.sets) - (hNodes : nodes.carrier ∈ M.sets) (nodeOrder : nodes.conditionOrder ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) - (topRow : rowTop ∈ rawRowCarrier) (lowerTop : ZFSet.pair rowTop ∅ ∈ t.carrier) : - StageTwoCarrierData M rawRowCarrier rowTop a s e t actors nodes d base directed T T2 valid - pairing unions powers separation collection := by - let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid - refine ⟨indexData, hT, carrier, order, ?_, topRow, ?_, ?_, ?_, ?_⟩ - · exact M.stageTwoForcing_mem rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 - pairing unions powers separation hRow hI0 hT carrier order hNodes nodeOrder - indexData.next.valid2 indexData.next.indices base directed indexData.next.first omega - · exact M.stageTwoForcing_empty rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 - hRow topRow lowerTop - · intro row rowMem lower - exact M.stageTwoForcing_empty rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 - hRow rowMem lower - · exact M.stageTwoForcing_raw_entry rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 - · exact M.stageTwoForcing_entry rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 - pairing unions powers separation collection carrier order hNodes hT - indexData.next.indices base directed indexData.next.first - -end TransitiveGround -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) (t : Presentation G) -variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) -variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "smallTop" => M.stageOneConditionSmallTop a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation - carrier order hT indices base directed system collection t inputs hT2 omega - -theorem stageOneRefinementStageSystem - (nodeOrder : b.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) - (originalMaps : a.conditionMapFamily c t ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - {level : ZFSet.{u}} (hLevel : level ∈ M.sets) - (children1 : ∀ τ : Name c.pairEmpty, τ.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) τ) - (children2 : ∀ τ : Name c.pairEmpty, τ.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) τ) : - letI := smallOrder - letI := smallTop - RefinementStageSystem M (smallAct) (pres) t b d base directed level T T2 := by - let := smallOrder - let := smallTop - obtain ⟨nextValid1,nextClosed1,nextHS1⟩ := - M.stageOneNameFamily_transport a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega - (d.principalSupportFamily base directed) T valid inputs.terms_closed children1 - obtain ⟨nextValid2,nextClosed2,nextHS2⟩ := - M.stageOneNameFamily_transport a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega - (d.principalSupportFamily base directed) T2 valid2 inputs.pairs_closed children2 - have nextCarrier := M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid - pairing unions powers separation carrier order nodes hT indices base directed system collection nodeOrder omega - have nextOrder := M.stageOneConditionOrder_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection nodeOrder omega - have nextMaps := M.stageOneSmallActionMapFamily_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection t inputs hT2 omega nodeOrder group originalMaps - exact M.refinementStageSystem (smallAct) (pres) t b d base directed pairing unions powers separation - collection nextCarrier nextOrder group nodes nodeOrder nextMaps inputs.node_maps supports - hLevel hT hT2 nextValid1 nextValid2 nextClosed1 nextClosed2 nextHS1 nextHS2 - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -include order - -theorem binaryRowStageOneRefinement {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1) - (indices : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2) - (inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1) - (_originalMaps : act.conditionMapFamily c b ∈ M.sets), - let coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted ⊥ directed first collection - letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted ⊥ directed first collection - RefinementStageSystem M - (M.stageOneSmallAction act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted indices ⊥ directed first collection b inputs hSquared - (M.omega_mem separation infinite)) - (M.stageOneConditionPresentation act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hL hLifted indices ⊥ directed first collection) - b s a ⊥ directed (natSetCode 1) lifted squared := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 first indices inputs originalMaps - coordinates two carrier forcingOrder - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted ⊥ directed first collection - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted ⊥ directed first collection - obtain ⟨children1,children2⟩ := M.binaryRowLiftedTermFamilies_hs a s b C pairing unions powers separation - infinite hL hC hG graph directed hmu ordinal valid - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation hL hG order graph - exact M.stageOneRefinementStageSystem act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hL hLifted indices ⊥ directed first collection b inputs hSquared - (M.omega_mem separation infinite) order hG originalMaps supports - (M.natSetCode_mem separation infinite 1) children1 children2 - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRowTermSetNames +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLiftFamilies + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure RefinementStageSystem (M : TransitiveGround.{u}) (a : PosetAction G P) + (s : Presentation P) (t : Presentation G) (b : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (level T T2 : ZFSet.{u}) : Prop where + valid1 : ∀ z ∈ T, IsName s z + valid2 : ∀ z ∈ T2, IsName s z + terms_hs : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ + pairs_hs : ∀ τ : Name s, τ.val ∈ T2 → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ + first : NiceNameSystem M a s b d base directed T valid1 + second : NiceNameSystem M a s b d base directed T2 valid2 + indices : NiceRefinementIndexSystem M a s b d level T T2 valid1 valid2 + inputs : StageOneActionParameters M a s t b d T T2 valid1 + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) (a : PosetAction G P) (s : Presentation P) +variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +theorem refinementStageSystem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) + (maps : a.conditionMapFamily s t ∈ M.sets) + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + {level T T2 : ZFSet.{u}} (hLevel : level ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) + (closed1 : ∀ g (τ : Name s), τ.val ∈ T → (a.act s g τ).val ∈ T) + (closed2 : ∀ g (τ : Name s), τ.val ∈ T2 → (a.act s g τ).val ∈ T2) + (children1 : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) + (children2 : ∀ τ : Name s, τ.val ∈ T2 → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) : + RefinementStageSystem M a s t b d base directed level T T2 := by + have first := M.niceNameSystem a s t pairing unions powers separation collection carrier order + maps hT valid1 closed1 b d base directed group nodes supports children1 + have second := M.niceNameSystem a s t pairing unions powers separation collection carrier order + maps hT2 valid2 closed2 b d base directed group nodes supports children2 + have indices := M.niceRefinementIndexSystem a s b d pairing unions powers separation collection + hLevel hT hT2 carrier order nodes nodeOrder first second + exact ⟨valid1,valid2,children1,children2,first,second,indices, + ⟨maps,nodeMaps,closed1,closed2,indices.family_ground⟩⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G P Q L : Type u} [Group G] +variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] [PartialOrder L] + +structure StageTwoIndexData (M : TransitiveGround.{u}) + (a : PosetAction G P) (s : Presentation P) + (e : PosetAction G Q) (t : Presentation Q) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) : Prop where + next : RefinementStageSystem M e t actors nodes d base directed (natSetCode 1) T T2 + top_code : t.encode ⊤ = s.encode ⊤ + square : T2 = orderedPairNameFamily (t.encode ⊤) T T + powers : ∀ n : Nat, iteratedPairNameFamily (t.encode ⊤) T n = + iteratedPairNameFamily (s.encode ⊤) T n + levels : + let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e t nodes d (natSetCode 1) T T2 next.valid1 + I0 ∪ I1 ∈ M.sets ∧ + refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0 ∈ M.sets ∧ + ZFSet.IsFunc (I0 ∪ I1) {∅, natSetCode 1} + (refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0) ∧ + refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0 = + ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1} ∧ + ∀ z, ¬ (z ∈ I0 ∧ z ∈ I1) + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (rawRowCarrier I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid +local notation "levels" => stageTwoAssignmentLevels I0 I1 T + +include nodes indices in +theorem stageTwoForcing_entry (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 a s b d T T2 valid ↔ + row ∈ rawRowCarrier ∧ + A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ + ∃ lower : P, s.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∧ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 1) T2 A lower := by + rw [M.stageTwoForcing_raw_entry] + constructor + · rintro ⟨rowMem, small, lowerMem, raw⟩ + obtain ⟨lower, equal⟩ := (s.mem_carrier _).1 lowerMem + refine ⟨rowMem, small, lower, equal, ?_⟩ + apply (M.refinementLevelRawTests_iff a s b d (natSetCode 1) + pairing unions powers separation collection carrier order nodes hT valid indices + base directed system A lower).1 + exact equal.symm ▸ raw + · rintro ⟨rowMem, small, lower, equal, tests⟩ + refine ⟨rowMem, small, equal ▸ s.encode_mem lower, ?_⟩ + have raw := (M.refinementLevelRawTests_iff a s b d (natSetCode 1) + pairing unions powers separation collection carrier order nodes hT valid indices + base directed system A lower).2 tests + exact equal ▸ raw + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G P Q L : Type u} [Group G] +variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] [PartialOrder L] + +structure StageTwoCarrierData (M : TransitiveGround.{u}) (rawRowCarrier rowTop : ZFSet.{u}) + (a : PosetAction G P) (s : Presentation P) + (e : PosetAction G Q) (t : Presentation Q) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : Prop where + index_data : StageTwoIndexData M a s e t actors nodes d base directed T T2 valid + terms_ground : T ∈ M.sets + lower_carrier_ground : t.carrier ∈ M.sets + lower_order_ground : t.conditionOrder ∈ M.sets + carrier_ground : + M.stageTwoForcing rawRowCarrier (M.niceRefinementIndices a s nodes d ∅ T T2 valid) + e t nodes d T T2 index_data.next.valid1 ∈ M.sets + top_row_mem : rowTop ∈ rawRowCarrier + empty_top : + ZFSet.pair rowTop ∅ ∈ M.stageTwoForcing rawRowCarrier + (M.niceRefinementIndices a s nodes d ∅ T T2 valid) e t nodes d T T2 index_data.next.valid1 + empty_rows : ∀ row ∈ rawRowCarrier, ZFSet.pair row ∅ ∈ t.carrier → + ZFSet.pair row ∅ ∈ M.stageTwoForcing rawRowCarrier + (M.niceRefinementIndices a s nodes d ∅ T T2 valid) e t nodes d T T2 index_data.next.valid1 + raw_entries : ∀ row A : ZFSet.{u}, + let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e t nodes d (natSetCode 1) T T2 index_data.next.valid1 + let levels := stageTwoAssignmentLevels I0 I1 T + ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 e t nodes d T T2 index_data.next.valid1 ↔ + row ∈ rawRowCarrier ∧ + A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ + ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∈ t.carrier ∧ + stageOneRawTests M (M.refinementLevelFormulaData e t nodes d (natSetCode 1) T T2 index_data.next.valid1) + A (ZFSet.pair row (assignmentCut levels (natSetCode 1) A)) + typed_entries : ∀ row A : ZFSet.{u}, + let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e t nodes d (natSetCode 1) T T2 index_data.next.valid1 + let levels := stageTwoAssignmentLevels I0 I1 T + ZFSet.pair row A ∈ M.stageTwoForcing rawRowCarrier I0 e t nodes d T T2 index_data.next.valid1 ↔ + row ∈ rawRowCarrier ∧ + A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega ∧ + ∃ lower : Q, t.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 1) A) ∧ + M.refinementLevelTests t pairing unions powers separation collection + lower_carrier_ground lower_order_ground terms_ground index_data.next.valid1 + e nodes d base directed index_data.next.first (natSetCode 1) T2 A lower + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) (rawRowCarrier rowTop : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (e : PosetAction G Q) (t : Presentation Q) +variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) + +theorem stageTwoCarrierData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (indexData : StageTwoIndexData M a s e t actors nodes d base directed T T2 valid) + (hRow : rawRowCarrier ∈ M.sets) + (hI0 : M.niceRefinementIndices a s nodes d ∅ T T2 valid ∈ M.sets) + (hT : T ∈ M.sets) (carrier : t.carrier ∈ M.sets) (order : t.conditionOrder ∈ M.sets) + (hNodes : nodes.carrier ∈ M.sets) (nodeOrder : nodes.conditionOrder ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) + (topRow : rowTop ∈ rawRowCarrier) (lowerTop : ZFSet.pair rowTop ∅ ∈ t.carrier) : + StageTwoCarrierData M rawRowCarrier rowTop a s e t actors nodes d base directed T T2 valid + pairing unions powers separation collection := by + let I0 := M.niceRefinementIndices a s nodes d ∅ T T2 valid + refine ⟨indexData, hT, carrier, order, ?_, topRow, ?_, ?_, ?_, ?_⟩ + · exact M.stageTwoForcing_mem rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 + pairing unions powers separation hRow hI0 hT carrier order hNodes nodeOrder + indexData.next.valid2 indexData.next.indices base directed indexData.next.first omega + · exact M.stageTwoForcing_empty rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 + hRow topRow lowerTop + · intro row rowMem lower + exact M.stageTwoForcing_empty rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 + hRow rowMem lower + · exact M.stageTwoForcing_raw_entry rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 + · exact M.stageTwoForcing_entry rawRowCarrier I0 e t nodes d T T2 indexData.next.valid1 + pairing unions powers separation collection carrier order hNodes hT + indexData.next.indices base directed indexData.next.first + +end TransitiveGround +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) (t : Presentation G) +variable (inputs : StageOneActionParameters M a c.pairEmpty t b d T T2 valid) +variable (hT2 : T2 ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "smallTop" => M.stageOneConditionSmallTop a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "smallAct" => M.stageOneSmallAction a c b d T T2 valid pairing unions powers separation + carrier order hT indices base directed system collection t inputs hT2 omega + +theorem stageOneRefinementStageSystem + (nodeOrder : b.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) + (originalMaps : a.conditionMapFamily c t ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + {level : ZFSet.{u}} (hLevel : level ∈ M.sets) + (children1 : ∀ τ : Name c.pairEmpty, τ.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) τ) + (children2 : ∀ τ : Name c.pairEmpty, τ.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) τ) : + letI := smallOrder + letI := smallTop + RefinementStageSystem M (smallAct) (pres) t b d base directed level T T2 := by + let := smallOrder + let := smallTop + obtain ⟨nextValid1,nextClosed1,nextHS1⟩ := + M.stageOneNameFamily_transport a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega + (d.principalSupportFamily base directed) T valid inputs.terms_closed children1 + obtain ⟨nextValid2,nextClosed2,nextHS2⟩ := + M.stageOneNameFamily_transport a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega + (d.principalSupportFamily base directed) T2 valid2 inputs.pairs_closed children2 + have nextCarrier := M.stageOneConditionPresentation_carrier_mem a c b d T T2 valid + pairing unions powers separation carrier order nodes hT indices base directed system collection nodeOrder omega + have nextOrder := M.stageOneConditionOrder_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection nodeOrder omega + have nextMaps := M.stageOneSmallActionMapFamily_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection t inputs hT2 omega nodeOrder group originalMaps + exact M.refinementStageSystem (smallAct) (pres) t b d base directed pairing unions powers separation + collection nextCarrier nextOrder group nodes nodeOrder nextMaps inputs.node_maps supports + hLevel hT hT2 nextValid1 nextValid2 nextClosed1 nextClosed2 nextHS1 nextHS2 + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +include order + +theorem binaryRowStageOneRefinement {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1) + (indices : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2) + (inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1) + (_originalMaps : act.conditionMapFamily c b ∈ M.sets), + let coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted ⊥ directed first collection + letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted ⊥ directed first collection + RefinementStageSystem M + (M.stageOneSmallAction act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted indices ⊥ directed first collection b inputs hSquared + (M.omega_mem separation infinite)) + (M.stageOneConditionPresentation act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hL hLifted indices ⊥ directed first collection) + b s a ⊥ directed (natSetCode 1) lifted squared := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 first indices inputs originalMaps + coordinates two carrier forcingOrder + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted ⊥ directed first collection + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted ⊥ directed first collection + obtain ⟨children1,children2⟩ := M.binaryRowLiftedTermFamilies_hs a s b C pairing unions powers separation + infinite hL hC hG graph directed hmu ordinal valid + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation hL hG order graph + exact M.stageOneRefinementStageSystem act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hL hLifted indices ⊥ directed first collection b inputs hSquared + (M.omega_mem separation infinite) order hG originalMaps supports + (M.natSetCode_mem separation infinite 1) children1 children2 + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCanonicalCompressionHistory.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCanonicalCompressionHistory.lean index 6d5dc861b7e545dc44201bd2493d302ca8cd016d..88aa087ba83ecc29d6e9673ef9c4477d3b8d8158 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCanonicalCompressionHistory.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCanonicalCompressionHistory.lean @@ -1,105 +1,105 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundCompressionHistoryFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace RecursiveStateData -variable (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) -variable (I Sources Reps G T : ZFSet.{u}) - -noncomputable def canonicalHistory : ZFSet.{u} := - familyCodeGraph natSetCode (fun n => (initial.iterate M I Sources Reps G T n).code) - -theorem pair_mem_canonicalHistory (n : Nat) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode n) y ∈ initial.canonicalHistory M I Sources Reps G T ↔ - y = (initial.iterate M I Sources Reps G T n).code := - pair_mem_familyCodeGraph _ _ natSetCode_injective n y - -theorem canonicalHistory_function : - FunctionGraphOn ZFSet.omega (initial.canonicalHistory M I Sources Reps G T) := by - have domain : ZFSet.range (natSetCode : Nat → ZFSet.{u}) = ZFSet.omega := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_range, mem_omega_iff_natSetCode] - change (∃ n, natSetCode n = x) ↔ ∃ n, x = natSetCode n - constructor - · rintro ⟨n, hx⟩ - exact ⟨n, hx.symm⟩ - · rintro ⟨n, hx⟩ - exact ⟨n, hx.symm⟩ - exact domain ▸ familyCodeGraph_function natSetCode - (fun n => (initial.iterate M I Sources Reps G T n).code) natSetCode_injective - -theorem canonicalHistory_eq_of_entries {history : ZFSet.{u}} - (function : FunctionGraphOn ZFSet.omega history) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ - y = (initial.iterate M I Sources Reps G T n).code) : - initial.canonicalHistory M I Sources Reps G T = history := by - apply (initial.canonicalHistory_function M I Sources Reps G T).eq_of_agree function - intro x y z xy xz - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 - ((initial.canonicalHistory_function M I Sources Reps G T).pair_source xy) - exact ((initial.pair_mem_canonicalHistory M I Sources Reps G T n y).1 xy).trans - ((entries n z).1 xz).symm - -end RecursiveStateData - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) - -include pairing unions powers separation collection infinite hI hSources hReps hG hT - -theorem canonicalHistory_spec : - let R := groundRecursionStep M - (naturalStepFormula (M.compressionSuccessorFormula pairing unions powers separation)) - (extend state.data.code (extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0)))))) - state.data.canonicalHistory M I Sources Reps G T ∈ M.sets ∧ - OrdinalRecursionTrace R ZFSet.omega (state.data.canonicalHistory M I Sources Reps G T) ∧ - ∀ history, OrdinalRecursionTrace R ZFSet.omega history → - history = state.data.canonicalHistory M I Sources Reps G T := by - obtain ⟨history, ground, trace, entries, unique, _⟩ := state.exists_groundHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT - have equal := state.data.canonicalHistory_eq_of_entries M I Sources Reps G T trace.1 entries - rw [← equal] at ground trace unique - exact ⟨ground, trace, unique⟩ - -theorem canonicalHistory_mem : - state.data.canonicalHistory M I Sources Reps G T ∈ M.sets := - (state.canonicalHistory_spec pairing unions powers separation collection infinite - hI hSources hReps hG hT).1 - -theorem realize_compressionHistory_iff {history : ZFSet.{u}} (hHistory : history ∈ M.sets) : - Realize M.sets (M.compressionHistoryFormula pairing unions powers separation) - (extend ZFSet.omega (extend history (extend state.data.code - (extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0)))))))) ↔ - history = state.data.canonicalHistory M I Sources Reps G T := by - have initial : state.data.code ∈ M.sets := by - simpa only [RecursiveStateData.iterate_zero] using - state.canonical_iterate_code_mem pairing unions powers separation hI hSources hReps hG hT 0 - rw [M.realize_compressionHistoryFormula pairing unions powers separation - (M.omega_mem separation infinite) hHistory initial hI hSources hReps hG hT] - obtain ⟨_, trace, unique⟩ := state.canonicalHistory_spec pairing unions powers separation - collection infinite hI hSources hReps hG hT - exact ⟨unique history, fun equal => equal.symm ▸ trace⟩ - -end GroundCompressionState -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundCompressionHistoryFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace RecursiveStateData +variable (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) +variable (I Sources Reps G T : ZFSet.{u}) + +noncomputable def canonicalHistory : ZFSet.{u} := + familyCodeGraph natSetCode (fun n => (initial.iterate M I Sources Reps G T n).code) + +theorem pair_mem_canonicalHistory (n : Nat) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode n) y ∈ initial.canonicalHistory M I Sources Reps G T ↔ + y = (initial.iterate M I Sources Reps G T n).code := + pair_mem_familyCodeGraph _ _ natSetCode_injective n y + +theorem canonicalHistory_function : + FunctionGraphOn ZFSet.omega (initial.canonicalHistory M I Sources Reps G T) := by + have domain : ZFSet.range (natSetCode : Nat → ZFSet.{u}) = ZFSet.omega := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_range, mem_omega_iff_natSetCode] + change (∃ n, natSetCode n = x) ↔ ∃ n, x = natSetCode n + constructor + · rintro ⟨n, hx⟩ + exact ⟨n, hx.symm⟩ + · rintro ⟨n, hx⟩ + exact ⟨n, hx.symm⟩ + exact domain ▸ familyCodeGraph_function natSetCode + (fun n => (initial.iterate M I Sources Reps G T n).code) natSetCode_injective + +theorem canonicalHistory_eq_of_entries {history : ZFSet.{u}} + (function : FunctionGraphOn ZFSet.omega history) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ + y = (initial.iterate M I Sources Reps G T n).code) : + initial.canonicalHistory M I Sources Reps G T = history := by + apply (initial.canonicalHistory_function M I Sources Reps G T).eq_of_agree function + intro x y z xy xz + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 + ((initial.canonicalHistory_function M I Sources Reps G T).pair_source xy) + exact ((initial.pair_mem_canonicalHistory M I Sources Reps G T n y).1 xy).trans + ((entries n z).1 xz).symm + +end RecursiveStateData + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) + +include pairing unions powers separation collection infinite hI hSources hReps hG hT + +theorem canonicalHistory_spec : + let R := groundRecursionStep M + (naturalStepFormula (M.compressionSuccessorFormula pairing unions powers separation)) + (extend state.data.code (extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0)))))) + state.data.canonicalHistory M I Sources Reps G T ∈ M.sets ∧ + OrdinalRecursionTrace R ZFSet.omega (state.data.canonicalHistory M I Sources Reps G T) ∧ + ∀ history, OrdinalRecursionTrace R ZFSet.omega history → + history = state.data.canonicalHistory M I Sources Reps G T := by + obtain ⟨history, ground, trace, entries, unique, _⟩ := state.exists_groundHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT + have equal := state.data.canonicalHistory_eq_of_entries M I Sources Reps G T trace.1 entries + rw [← equal] at ground trace unique + exact ⟨ground, trace, unique⟩ + +theorem canonicalHistory_mem : + state.data.canonicalHistory M I Sources Reps G T ∈ M.sets := + (state.canonicalHistory_spec pairing unions powers separation collection infinite + hI hSources hReps hG hT).1 + +theorem realize_compressionHistory_iff {history : ZFSet.{u}} (hHistory : history ∈ M.sets) : + Realize M.sets (M.compressionHistoryFormula pairing unions powers separation) + (extend ZFSet.omega (extend history (extend state.data.code + (extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0)))))))) ↔ + history = state.data.canonicalHistory M I Sources Reps G T := by + have initial : state.data.code ∈ M.sets := by + simpa only [RecursiveStateData.iterate_zero] using + state.canonical_iterate_code_mem pairing unions powers separation hI hSources hReps hG hT 0 + rw [M.realize_compressionHistoryFormula pairing unions powers separation + (M.omega_mem separation infinite) hHistory initial hI hSources hReps hG hT] + obtain ⟨_, trace, unique⟩ := state.canonicalHistory_spec pairing unions powers separation + collection infinite hI hSources hReps hG hT + exact ⟨unique history, fun equal => equal.symm ▸ trace⟩ + +end GroundCompressionState +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalBasis.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalBasis.lean index 4cbf90828f52669d9440256f2eec9516a1e91385..eca36aa663c64ad2fa34d72addea715667707d8f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalBasis.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalBasis.lean @@ -1,207 +1,207 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCoinitialOperations - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def birthEssentialSet (F T r birth : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun x => ∀ y ∈ F, ∀ a ∈ T, ∀ b ∈ T, - ZFSet.pair y x ∈ r → ZFSet.pair y a ∈ birth → ZFSet.pair x b ∈ birth → a ∉ b) F - -theorem mem_birthEssentialSet (F T r birth x : ZFSet.{u}) : - x ∈ birthEssentialSet F T r birth ↔ x ∈ F ∧ - ∀ y ∈ F, ∀ a ∈ T, ∀ b ∈ T, - ZFSet.pair y x ∈ r → ZFSet.pair y a ∈ birth → ZFSet.pair x b ∈ birth → a ∉ b := - ZFSet.mem_sep - -theorem birthEssentialSet_subset (F T r birth : ZFSet.{u}) : - birthEssentialSet F T r birth ⊆ F := fun _ hx => (ZFSet.mem_sep.1 hx).1 - -noncomputable def essentialBirthIndices (F T r birth : ZFSet.{u}) : ZFSet.{u} := - relationImage (birthEssentialSet F T r birth) T birth - -theorem mem_essentialBirthIndices (F T r birth t : ZFSet.{u}) : - t ∈ essentialBirthIndices F T r birth ↔ t ∈ T ∧ - ∃ x ∈ birthEssentialSet F T r birth, ZFSet.pair x t ∈ birth := - mem_relationImage _ _ _ _ - -theorem positive_above_birthEssential {L F T r birth : ZFSet.{u}} - (subset : F ⊆ L) (born : ZFSet.IsFunc L T birth) - (refl : ∀ x ∈ L, ZFSet.pair x x ∈ r) - (trans : ∀ x ∈ L, ∀ y ∈ L, ∀ z ∈ L, - ZFSet.pair x y ∈ r → ZFSet.pair y z ∈ r → ZFSet.pair x z ∈ r) - {x : ZFSet.{u}} (positive : x ∈ F) : - ∃ y ∈ birthEssentialSet F T r birth, ZFSet.pair y x ∈ r := by - let S : Set ZFSet.{u} := {t | ∃ y ∈ F, ZFSet.pair y x ∈ r ∧ ZFSet.pair y t ∈ birth} - obtain ⟨t, xt, _⟩ := born.2 x (subset positive) - have inhabited : S.Nonempty := ⟨t, x, positive, refl x (subset positive), xt⟩ - obtain ⟨t, ⟨y, hy, below, yt⟩, minimal⟩ := ZFSet.mem_wf.has_min S inhabited - refine ⟨y, (mem_birthEssentialSet F T r birth y).2 ⟨hy, ?_⟩, below⟩ - intro z hz a _ b _ zy za yb earlier - obtain ⟨_, _, unique⟩ := born.2 y (subset hy) - have eq : b = t := (unique b yb).trans (unique t yt).symm - have aS : a ∈ S := ⟨z, hz, trans z (subset hz) y (subset hy) x (subset positive) zy below, za⟩ - exact minimal a aS (eq ▸ earlier) - -namespace BoundedFormula - -open SetFormula - -def birthEssentialFormula {n} (x f t r birth : Fin n) : BoundedFormula n := - .allMem f (.allMem t.succ (.allMem t.succ.succ - (imp (.conj (pairMembershipFormula 2 x.succ.succ.succ r.succ.succ.succ) - (.conj (pairMembershipFormula 2 1 birth.succ.succ.succ) - (pairMembershipFormula x.succ.succ.succ 0 birth.succ.succ.succ))) (.neg (.mem 1 0))))) - -theorem truth_birthEssentialFormula {n} (x f t r birth : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (birthEssentialFormula x f t r birth) env ↔ - ∀ y ∈ env f, ∀ a ∈ env t, ∀ b ∈ env t, - ZFSet.pair y (env x) ∈ env r → ZFSet.pair y a ∈ env birth → - ZFSet.pair (env x) b ∈ env birth → a ∉ b := by - simp only [birthEssentialFormula, Truth, truth_imp, truth_pairMembershipFormula] - change (∀ y ∈ env f, ∀ a ∈ env t, ∀ b ∈ env t, - ZFSet.pair y (env x) ∈ env r ∧ ZFSet.pair y a ∈ env birth ∧ - ZFSet.pair (env x) b ∈ env birth → a ∉ b) ↔ _ - constructor - · intro h y hy a ha b hb below bornY bornX - exact h y hy a ha b hb ⟨below, bornY, bornX⟩ - · intro h y hy a ha b hb premises - exact h y hy a ha b hb premises.1 premises.2.1 premises.2.2 - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem birthEssentialSet_mem (separation : SeparationSchema M.sets) - {F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) - (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) : - birthEssentialSet F T r birth ∈ M.sets := by - let params := extend F (extend T (extend r (extend birth Fin.elim0))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.birthEssentialFormula 0 1 2 3 4) params - (Fin.cases hF (Fin.cases hT (Fin.cases hr (Fin.cases hBirth (fun j => Fin.elim0 j))))) hF - have eq : ZFSet.sep (fun x => BoundedFormula.Truth - (BoundedFormula.birthEssentialFormula 0 1 2 3 4) (extend x params)) F = - birthEssentialSet F T r birth := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, mem_birthEssentialSet] - exact and_congr Iff.rfl (BoundedFormula.truth_birthEssentialFormula 0 1 2 3 4 _) - exact eq ▸ selected - -theorem essentialBirthIndices_mem (separation : SeparationSchema M.sets) - {F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) - (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) : - essentialBirthIndices F T r birth ∈ M.sets := - M.relationImage_mem separation (M.birthEssentialSet_mem separation hF hT hr hBirth) hT hBirth - -theorem exists_essentialBirthRepresentatives - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) - (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) : - ∃ g ∈ M.sets, - ZFSet.IsFunc (essentialBirthIndices F T r birth) (birthEssentialSet F T r birth) g ∧ - g ⊆ relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth ∧ - ∀ t ∈ essentialBirthIndices F T r birth, - ∃ x ∈ birthEssentialSet F T r birth, ZFSet.pair t x ∈ g ∧ ZFSet.pair x t ∈ birth := by - let E := birthEssentialSet F T r birth - let S := essentialBirthIndices F T r birth - have hE : E ∈ M.sets := M.birthEssentialSet_mem separation hF hT hr hBirth - have hS : S ∈ M.sets := M.essentialBirthIndices_mem separation hF hT hr hBirth - have hConverse := M.relationConverse_mem pairing unions powers separation hE hS hBirth - have total : ∀ t ∈ S, ∃ x ∈ E, ZFSet.pair t x ∈ relationConverse E S birth := by - intro t ht - obtain ⟨_, x, hx, born⟩ := (mem_essentialBirthIndices F T r birth t).1 ht - exact ⟨x, hx, (pair_mem_relationConverse E S birth x t).2 ⟨hx, ht, born⟩⟩ - obtain ⟨g, hg, function, restricted⟩ := - M.uniformize_relation pairing unions powers separation choice hS hE hConverse total - refine ⟨g, hg, function, restricted, ?_⟩ - intro t ht - obtain ⟨x, chosen, _⟩ := function.2 t ht - have spec := (pair_mem_relationConverse E S birth x t).1 (restricted chosen) - exact ⟨x, spec.1, chosen, spec.2.2⟩ - -theorem exists_essentialBirthInjectionRepresentatives - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {L F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) - (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) - (subset : F ⊆ L) (born : ZFSet.IsFunc L T birth) : - ∃ g ∈ M.sets, - InjectionCode (essentialBirthIndices F T r birth) (birthEssentialSet F T r birth) g ∧ - g ⊆ relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth := by - obtain ⟨g, hg, function, restricted, _⟩ := - M.exists_essentialBirthRepresentatives pairing unions powers separation choice hF hT hr hBirth - refine ⟨g, hg, ⟨function, ?_⟩, restricted⟩ - intro t v x tx vx - have first := (pair_mem_relationConverse _ _ birth x t).1 (restricted tx) - have second := (pair_mem_relationConverse _ _ birth x v).1 (restricted vx) - obtain ⟨_, _, unique⟩ := born.2 x (subset (birthEssentialSet_subset F T r birth first.1)) - exact (unique t first.2.2).trans (unique v second.2.2).symm - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem internal_countable_basis_of_birth_layers - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {L F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) - (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) - (order : PartialOrderCode L r) (subset : F ⊆ L) (born : ZFSet.IsFunc L T birth) - (small : M.groundEmbeddable (essentialBirthIndices F T r birth) ZFSet.omega) - (localBases : ∀ t ∈ essentialBirthIndices F T r birth, - M.InternalCountableBelow r F (relationFiber (birthEssentialSet F T r birth) - (relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth) t)) : - M.InternalCountableBelow r F F := by - let E := birthEssentialSet F T r birth - let S := essentialBirthIndices F T r birth - let parts := relationConverse E S birth - have hE : E ∈ M.sets := M.birthEssentialSet_mem separation hF hT hr hBirth - have hS : S ∈ M.sets := M.essentialBirthIndices_mem separation hF hT hr hBirth - have hParts : parts ∈ M.sets := M.relationConverse_mem pairing unions powers separation hE hS hBirth - have cover (x : ZFSet.{u}) (hx : x ∈ E) : ∃ t ∈ S, ZFSet.pair t x ∈ parts := by - obtain ⟨t, xt, _⟩ := born.2 x (subset (birthEssentialSet_subset F T r birth hx)) - have htT := (ZFSet.pair_mem_prod.1 (born.1 xt)).2 - have htS : t ∈ S := (mem_essentialBirthIndices F T r birth t).2 ⟨htT, x, hx, xt⟩ - exact ⟨t, htS, (pair_mem_relationConverse E S birth x t).2 ⟨hx, htS, xt⟩⟩ - obtain ⟨B, hB, smallB, positive, below⟩ := M.internalCountableBelow_indexed_union - pairing unions powers separation infinite choice hS hr hF hE hParts small cover localBases - refine ⟨B, hB, smallB, positive, ?_⟩ - intro x hx - obtain ⟨y, hy, yx⟩ := positive_above_birthEssential subset born order.refl order.trans hx - obtain ⟨b, hb, byLower⟩ := below y hy - exact ⟨b, hb, order.trans b (subset (positive hb)) y - (subset (birthEssentialSet_subset F T r birth hy)) x (subset hx) byLower yx⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCoinitialOperations + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def birthEssentialSet (F T r birth : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun x => ∀ y ∈ F, ∀ a ∈ T, ∀ b ∈ T, + ZFSet.pair y x ∈ r → ZFSet.pair y a ∈ birth → ZFSet.pair x b ∈ birth → a ∉ b) F + +theorem mem_birthEssentialSet (F T r birth x : ZFSet.{u}) : + x ∈ birthEssentialSet F T r birth ↔ x ∈ F ∧ + ∀ y ∈ F, ∀ a ∈ T, ∀ b ∈ T, + ZFSet.pair y x ∈ r → ZFSet.pair y a ∈ birth → ZFSet.pair x b ∈ birth → a ∉ b := + ZFSet.mem_sep + +theorem birthEssentialSet_subset (F T r birth : ZFSet.{u}) : + birthEssentialSet F T r birth ⊆ F := fun _ hx => (ZFSet.mem_sep.1 hx).1 + +noncomputable def essentialBirthIndices (F T r birth : ZFSet.{u}) : ZFSet.{u} := + relationImage (birthEssentialSet F T r birth) T birth + +theorem mem_essentialBirthIndices (F T r birth t : ZFSet.{u}) : + t ∈ essentialBirthIndices F T r birth ↔ t ∈ T ∧ + ∃ x ∈ birthEssentialSet F T r birth, ZFSet.pair x t ∈ birth := + mem_relationImage _ _ _ _ + +theorem positive_above_birthEssential {L F T r birth : ZFSet.{u}} + (subset : F ⊆ L) (born : ZFSet.IsFunc L T birth) + (refl : ∀ x ∈ L, ZFSet.pair x x ∈ r) + (trans : ∀ x ∈ L, ∀ y ∈ L, ∀ z ∈ L, + ZFSet.pair x y ∈ r → ZFSet.pair y z ∈ r → ZFSet.pair x z ∈ r) + {x : ZFSet.{u}} (positive : x ∈ F) : + ∃ y ∈ birthEssentialSet F T r birth, ZFSet.pair y x ∈ r := by + let S : Set ZFSet.{u} := {t | ∃ y ∈ F, ZFSet.pair y x ∈ r ∧ ZFSet.pair y t ∈ birth} + obtain ⟨t, xt, _⟩ := born.2 x (subset positive) + have inhabited : S.Nonempty := ⟨t, x, positive, refl x (subset positive), xt⟩ + obtain ⟨t, ⟨y, hy, below, yt⟩, minimal⟩ := ZFSet.mem_wf.has_min S inhabited + refine ⟨y, (mem_birthEssentialSet F T r birth y).2 ⟨hy, ?_⟩, below⟩ + intro z hz a _ b _ zy za yb earlier + obtain ⟨_, _, unique⟩ := born.2 y (subset hy) + have eq : b = t := (unique b yb).trans (unique t yt).symm + have aS : a ∈ S := ⟨z, hz, trans z (subset hz) y (subset hy) x (subset positive) zy below, za⟩ + exact minimal a aS (eq ▸ earlier) + +namespace BoundedFormula + +open SetFormula + +def birthEssentialFormula {n} (x f t r birth : Fin n) : BoundedFormula n := + .allMem f (.allMem t.succ (.allMem t.succ.succ + (imp (.conj (pairMembershipFormula 2 x.succ.succ.succ r.succ.succ.succ) + (.conj (pairMembershipFormula 2 1 birth.succ.succ.succ) + (pairMembershipFormula x.succ.succ.succ 0 birth.succ.succ.succ))) (.neg (.mem 1 0))))) + +theorem truth_birthEssentialFormula {n} (x f t r birth : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (birthEssentialFormula x f t r birth) env ↔ + ∀ y ∈ env f, ∀ a ∈ env t, ∀ b ∈ env t, + ZFSet.pair y (env x) ∈ env r → ZFSet.pair y a ∈ env birth → + ZFSet.pair (env x) b ∈ env birth → a ∉ b := by + simp only [birthEssentialFormula, Truth, truth_imp, truth_pairMembershipFormula] + change (∀ y ∈ env f, ∀ a ∈ env t, ∀ b ∈ env t, + ZFSet.pair y (env x) ∈ env r ∧ ZFSet.pair y a ∈ env birth ∧ + ZFSet.pair (env x) b ∈ env birth → a ∉ b) ↔ _ + constructor + · intro h y hy a ha b hb below bornY bornX + exact h y hy a ha b hb ⟨below, bornY, bornX⟩ + · intro h y hy a ha b hb premises + exact h y hy a ha b hb premises.1 premises.2.1 premises.2.2 + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem birthEssentialSet_mem (separation : SeparationSchema M.sets) + {F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) + (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) : + birthEssentialSet F T r birth ∈ M.sets := by + let params := extend F (extend T (extend r (extend birth Fin.elim0))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.birthEssentialFormula 0 1 2 3 4) params + (Fin.cases hF (Fin.cases hT (Fin.cases hr (Fin.cases hBirth (fun j => Fin.elim0 j))))) hF + have eq : ZFSet.sep (fun x => BoundedFormula.Truth + (BoundedFormula.birthEssentialFormula 0 1 2 3 4) (extend x params)) F = + birthEssentialSet F T r birth := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, mem_birthEssentialSet] + exact and_congr Iff.rfl (BoundedFormula.truth_birthEssentialFormula 0 1 2 3 4 _) + exact eq ▸ selected + +theorem essentialBirthIndices_mem (separation : SeparationSchema M.sets) + {F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) + (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) : + essentialBirthIndices F T r birth ∈ M.sets := + M.relationImage_mem separation (M.birthEssentialSet_mem separation hF hT hr hBirth) hT hBirth + +theorem exists_essentialBirthRepresentatives + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) + (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) : + ∃ g ∈ M.sets, + ZFSet.IsFunc (essentialBirthIndices F T r birth) (birthEssentialSet F T r birth) g ∧ + g ⊆ relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth ∧ + ∀ t ∈ essentialBirthIndices F T r birth, + ∃ x ∈ birthEssentialSet F T r birth, ZFSet.pair t x ∈ g ∧ ZFSet.pair x t ∈ birth := by + let E := birthEssentialSet F T r birth + let S := essentialBirthIndices F T r birth + have hE : E ∈ M.sets := M.birthEssentialSet_mem separation hF hT hr hBirth + have hS : S ∈ M.sets := M.essentialBirthIndices_mem separation hF hT hr hBirth + have hConverse := M.relationConverse_mem pairing unions powers separation hE hS hBirth + have total : ∀ t ∈ S, ∃ x ∈ E, ZFSet.pair t x ∈ relationConverse E S birth := by + intro t ht + obtain ⟨_, x, hx, born⟩ := (mem_essentialBirthIndices F T r birth t).1 ht + exact ⟨x, hx, (pair_mem_relationConverse E S birth x t).2 ⟨hx, ht, born⟩⟩ + obtain ⟨g, hg, function, restricted⟩ := + M.uniformize_relation pairing unions powers separation choice hS hE hConverse total + refine ⟨g, hg, function, restricted, ?_⟩ + intro t ht + obtain ⟨x, chosen, _⟩ := function.2 t ht + have spec := (pair_mem_relationConverse E S birth x t).1 (restricted chosen) + exact ⟨x, spec.1, chosen, spec.2.2⟩ + +theorem exists_essentialBirthInjectionRepresentatives + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {L F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) + (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) + (subset : F ⊆ L) (born : ZFSet.IsFunc L T birth) : + ∃ g ∈ M.sets, + InjectionCode (essentialBirthIndices F T r birth) (birthEssentialSet F T r birth) g ∧ + g ⊆ relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth := by + obtain ⟨g, hg, function, restricted, _⟩ := + M.exists_essentialBirthRepresentatives pairing unions powers separation choice hF hT hr hBirth + refine ⟨g, hg, ⟨function, ?_⟩, restricted⟩ + intro t v x tx vx + have first := (pair_mem_relationConverse _ _ birth x t).1 (restricted tx) + have second := (pair_mem_relationConverse _ _ birth x v).1 (restricted vx) + obtain ⟨_, _, unique⟩ := born.2 x (subset (birthEssentialSet_subset F T r birth first.1)) + exact (unique t first.2.2).trans (unique v second.2.2).symm + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem internal_countable_basis_of_birth_layers + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {L F T r birth : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) + (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) + (order : PartialOrderCode L r) (subset : F ⊆ L) (born : ZFSet.IsFunc L T birth) + (small : M.groundEmbeddable (essentialBirthIndices F T r birth) ZFSet.omega) + (localBases : ∀ t ∈ essentialBirthIndices F T r birth, + M.InternalCountableBelow r F (relationFiber (birthEssentialSet F T r birth) + (relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth) t)) : + M.InternalCountableBelow r F F := by + let E := birthEssentialSet F T r birth + let S := essentialBirthIndices F T r birth + let parts := relationConverse E S birth + have hE : E ∈ M.sets := M.birthEssentialSet_mem separation hF hT hr hBirth + have hS : S ∈ M.sets := M.essentialBirthIndices_mem separation hF hT hr hBirth + have hParts : parts ∈ M.sets := M.relationConverse_mem pairing unions powers separation hE hS hBirth + have cover (x : ZFSet.{u}) (hx : x ∈ E) : ∃ t ∈ S, ZFSet.pair t x ∈ parts := by + obtain ⟨t, xt, _⟩ := born.2 x (subset (birthEssentialSet_subset F T r birth hx)) + have htT := (ZFSet.pair_mem_prod.1 (born.1 xt)).2 + have htS : t ∈ S := (mem_essentialBirthIndices F T r birth t).2 ⟨htT, x, hx, xt⟩ + exact ⟨t, htS, (pair_mem_relationConverse E S birth x t).2 ⟨hx, htS, xt⟩⟩ + obtain ⟨B, hB, smallB, positive, below⟩ := M.internalCountableBelow_indexed_union + pairing unions powers separation infinite choice hS hr hF hE hParts small cover localBases + refine ⟨B, hB, smallB, positive, ?_⟩ + intro x hx + obtain ⟨y, hy, yx⟩ := positive_above_birthEssential subset born order.refl order.trans hx + obtain ⟨b, hb, byLower⟩ := below y hy + exact ⟨b, hb, order.trans b (subset (positive hb)) y + (subset (birthEssentialSet_subset F T r birth hy)) x (subset hx) byLower yx⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalCompressionCoinitiality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalCompressionCoinitiality.lean index 77e709bec582773c9c69dbcf8328916cfe94a93a..922ae2357c98ab35ce56e3e2f9ad79ea5585ca54 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalCompressionCoinitiality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalCompressionCoinitiality.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -structure GroundChronologicalCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P0 C Q qlt original Targets Separators Filters base old T0 : ZFSet.{u}) - (prior : GroundChronologicalHistory M T0 C Q qlt) where - born : GroundBornCompression M initial I Sources Reps G m one T τ P0 C Q qlt original - Targets Separators Filters base old - history : GroundChronologicalHistory M (insert born.births.limit born.births.limit) C Q qlt - original_height : prior.height base = original - old_values : ∀ s, s ∈ base ∨ s = base → - history.space s = prior.space s ∧ history.order s = prior.order s ∧ - history.meetGraph s = prior.meetGraph s ∧ history.birth s = prior.birth s ∧ - history.height s = prior.height s - stamp_values : ∀ n, - history.space (compressionStamp base n) = (initial.iterate M I Sources Reps G T (n + 1)).D ∧ - history.order (compressionStamp base n) = (initial.iterate M I Sources Reps G T (n + 1)).rD ∧ - history.meetGraph (compressionStamp base n) = (initial.iterate M I Sources Reps G T (n + 1)).μD ∧ - history.birth (compressionStamp base n) = - graphRestriction (initial.iterate M I Sources Reps G T (n + 1)).D born.births.birth ∧ - history.height (compressionStamp base n) = born.profiled.heighted.heights.function.natValue (n + 1) - limit_values : - history.space born.births.limit = born.profiled.heighted.completion.algebra.union.fields 0 ∧ - history.order born.births.limit = born.profiled.heighted.completion.algebra.union.fields 1 ∧ - history.meetGraph born.births.limit = born.profiled.heighted.completion.algebra.union.fields 2 ∧ - history.birth born.births.limit = born.births.birth ∧ - history.height born.births.limit = born.profiled.heighted.heights.height - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundChronologicalCompression -open SetFormula -universe u -variable {M N : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 C Q qlt original Targets Separators Filters base old T0 : ZFSet.{u}} -variable {prior : GroundChronologicalHistory M T0 C Q qlt} -variable (compression : GroundChronologicalCompression M initial I Sources Reps G m one T τ - P0 C Q qlt original Targets Separators Filters base old T0 prior) - -theorem exists_extension_basis - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (includes : M.sets ⊆ N.sets) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (infiniteN : Realize N.sets SetFormula.infinity Fin.elim0) - (choiceN : Realize N.sets SetFormula.choice Fin.elim0) - (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) - (smallQ : M.groundEmbeddable Q ZFSet.omega) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - {F : ZFSet.{u}} (hF : F ∈ N.sets) - (filter : MeetFilterCode (compression.born.profiled.heighted.completion.algebra.union.fields 0) - (compression.born.profiled.heighted.completion.algebra.union.fields 1) - (compression.born.profiled.heighted.completion.algebra.union.fields 2) F) : - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, - ZFSet.pair b x ∈ compression.born.profiled.heighted.completion.algebra.union.fields 1 := by - have filterAtLimit : MeetFilterCode (compression.history.space compression.born.births.limit) - (compression.history.order compression.born.births.limit) - (compression.history.meetGraph compression.born.births.limit) F := by - simpa only [compression.limit_values.1, compression.limit_values.2.1, - compression.limit_values.2.2.1] using filter - have basis := compression.history.exists_extension_basis includes pairingN unionsN powersN - separationN infiniteN choiceN - (M.insert_mem pairing unions compression.born.births.limit_ground compression.born.births.limit_ground) - hC hQ (ordinalSetProperty_succ compression.born.births.times.ordinal) smallQ irreflexive - (ZFSet.mem_insert compression.born.births.limit compression.born.births.limit) hF filterAtLimit - simpa only [compression.limit_values.2.1] using basis - -end PartitionPilot.Forcing.GroundChronologicalCompression - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.CompressionExternalTileOverlaps +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +structure GroundChronologicalCompression (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P0 C Q qlt original Targets Separators Filters base old T0 : ZFSet.{u}) + (prior : GroundChronologicalHistory M T0 C Q qlt) where + born : GroundBornCompression M initial I Sources Reps G m one T τ P0 C Q qlt original + Targets Separators Filters base old + history : GroundChronologicalHistory M (insert born.births.limit born.births.limit) C Q qlt + original_height : prior.height base = original + old_values : ∀ s, s ∈ base ∨ s = base → + history.space s = prior.space s ∧ history.order s = prior.order s ∧ + history.meetGraph s = prior.meetGraph s ∧ history.birth s = prior.birth s ∧ + history.height s = prior.height s + stamp_values : ∀ n, + history.space (compressionStamp base n) = (initial.iterate M I Sources Reps G T (n + 1)).D ∧ + history.order (compressionStamp base n) = (initial.iterate M I Sources Reps G T (n + 1)).rD ∧ + history.meetGraph (compressionStamp base n) = (initial.iterate M I Sources Reps G T (n + 1)).μD ∧ + history.birth (compressionStamp base n) = + graphRestriction (initial.iterate M I Sources Reps G T (n + 1)).D born.births.birth ∧ + history.height (compressionStamp base n) = born.profiled.heighted.heights.function.natValue (n + 1) + limit_values : + history.space born.births.limit = born.profiled.heighted.completion.algebra.union.fields 0 ∧ + history.order born.births.limit = born.profiled.heighted.completion.algebra.union.fields 1 ∧ + history.meetGraph born.births.limit = born.profiled.heighted.completion.algebra.union.fields 2 ∧ + history.birth born.births.limit = born.births.birth ∧ + history.height born.births.limit = born.profiled.heighted.heights.height + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundChronologicalCompression +open SetFormula +universe u +variable {M N : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 C Q qlt original Targets Separators Filters base old T0 : ZFSet.{u}} +variable {prior : GroundChronologicalHistory M T0 C Q qlt} +variable (compression : GroundChronologicalCompression M initial I Sources Reps G m one T τ + P0 C Q qlt original Targets Separators Filters base old T0 prior) + +theorem exists_extension_basis + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (includes : M.sets ⊆ N.sets) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (infiniteN : Realize N.sets SetFormula.infinity Fin.elim0) + (choiceN : Realize N.sets SetFormula.choice Fin.elim0) + (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) + (smallQ : M.groundEmbeddable Q ZFSet.omega) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + {F : ZFSet.{u}} (hF : F ∈ N.sets) + (filter : MeetFilterCode (compression.born.profiled.heighted.completion.algebra.union.fields 0) + (compression.born.profiled.heighted.completion.algebra.union.fields 1) + (compression.born.profiled.heighted.completion.algebra.union.fields 2) F) : + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, + ZFSet.pair b x ∈ compression.born.profiled.heighted.completion.algebra.union.fields 1 := by + have filterAtLimit : MeetFilterCode (compression.history.space compression.born.births.limit) + (compression.history.order compression.born.births.limit) + (compression.history.meetGraph compression.born.births.limit) F := by + simpa only [compression.limit_values.1, compression.limit_values.2.1, + compression.limit_values.2.2.1] using filter + have basis := compression.history.exists_extension_basis includes pairingN unionsN powersN + separationN infiniteN choiceN + (M.insert_mem pairing unions compression.born.births.limit_ground compression.born.births.limit_ground) + hC hQ (ordinalSetProperty_succ compression.born.births.times.ordinal) smallQ irreflexive + (ZFSet.mem_insert compression.born.births.limit compression.born.births.limit) hF filterAtLimit + simpa only [compression.limit_values.2.1] using basis + +end PartitionPilot.Forcing.GroundChronologicalCompression + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalExternalCoinitiality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalExternalCoinitiality.lean index c9fdca9f39655c80a5e47c00305510a9b8f7fac5..c9a2249d3393925b2e9a6bdf2a424c1db21c51ca 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalExternalCoinitiality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologicalExternalCoinitiality.lean @@ -1,65 +1,65 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialExternalChronology - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundChronologicalExternal -open SetFormula -universe u -variable {M N : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable {births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion} -variable {heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion} -variable {prior : GroundChronologicalHistory M T0 C D rD} -variable (external : GroundChronologicalExternal M initial I Sources Reps G m inv one T τ - P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 completion births heights prior) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (includes : M.sets ⊆ N.sets) -variable (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) -variable (unionsN : Realize N.sets SetFormula.union Fin.elim0) -variable (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) -variable (infiniteN : Realize N.sets SetFormula.infinity Fin.elim0) -variable (choiceN : Realize N.sets SetFormula.choice Fin.elim0) -variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) -variable (smallD : M.groundEmbeddable D ZFSet.omega) -variable (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) -include external pairing unions includes pairingN unionsN powersN separationN infiniteN choiceN hC hD smallD irreflexive - -theorem exists_extension_basis {F : ZFSet.{u}} (hF : F ∈ N.sets) - (filter : MeetFilterCode (completion.externalPointCarrier P0 r0 μ0 A0) - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) F) : - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ completion.externalPointOrder P0 r0 μ0 A0 := by - have filterAtLimit : MeetFilterCode (external.history.space births.limit) - (external.history.order births.limit) (external.history.meetGraph births.limit) F := by - simpa only [external.limit_values.1, external.limit_values.2.1, external.limit_values.2.2.1] using filter - have basis := external.history.exists_extension_basis includes pairingN unionsN powersN separationN infiniteN choiceN - (M.insert_mem pairing unions births.limit_ground births.limit_ground) hC hD - (ordinalSetProperty_succ births.times.ordinal) smallD irreflexive - (ZFSet.mem_insert births.limit births.limit) hF filterAtLimit - simpa only [external.limit_values.2.1] using basis - -theorem exists_bounded_extension_basis {F : ZFSet.{u}} (hF : F ∈ N.sets) - (filter : MeetFilterCode (completion.externalBoundedCarrier P0 r0 μ0 A0) - (completion.externalBoundedOrder P0 r0 μ0 A0) (completion.externalBoundedMeet P0 r0 μ0 A0) F) : - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ completion.externalBoundedOrder P0 r0 μ0 A0 := by - have filterAtLimit : MeetFilterCode (external.bounded_history.space births.limit) - (external.bounded_history.order births.limit) (external.bounded_history.meetGraph births.limit) F := by - simpa only [external.bounded_values.1, external.bounded_values.2.1, external.bounded_values.2.2.1] using filter - have basis := external.bounded_history.exists_extension_basis includes pairingN unionsN powersN separationN infiniteN choiceN - (M.insert_mem pairing unions births.limit_ground births.limit_ground) hC hD - (ordinalSetProperty_succ births.times.ordinal) smallD irreflexive - (ZFSet.mem_insert births.limit births.limit) hF filterAtLimit - simpa only [external.bounded_values.2.1] using basis - -end PartitionPilot.Forcing.GroundChronologicalExternal - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialExternalChronology + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundChronologicalExternal +open SetFormula +universe u +variable {M N : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable {births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion} +variable {heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion} +variable {prior : GroundChronologicalHistory M T0 C D rD} +variable (external : GroundChronologicalExternal M initial I Sources Reps G m inv one T τ + P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 completion births heights prior) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (includes : M.sets ⊆ N.sets) +variable (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) +variable (unionsN : Realize N.sets SetFormula.union Fin.elim0) +variable (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) +variable (infiniteN : Realize N.sets SetFormula.infinity Fin.elim0) +variable (choiceN : Realize N.sets SetFormula.choice Fin.elim0) +variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) +variable (smallD : M.groundEmbeddable D ZFSet.omega) +variable (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) +include external pairing unions includes pairingN unionsN powersN separationN infiniteN choiceN hC hD smallD irreflexive + +theorem exists_extension_basis {F : ZFSet.{u}} (hF : F ∈ N.sets) + (filter : MeetFilterCode (completion.externalPointCarrier P0 r0 μ0 A0) + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) F) : + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ completion.externalPointOrder P0 r0 μ0 A0 := by + have filterAtLimit : MeetFilterCode (external.history.space births.limit) + (external.history.order births.limit) (external.history.meetGraph births.limit) F := by + simpa only [external.limit_values.1, external.limit_values.2.1, external.limit_values.2.2.1] using filter + have basis := external.history.exists_extension_basis includes pairingN unionsN powersN separationN infiniteN choiceN + (M.insert_mem pairing unions births.limit_ground births.limit_ground) hC hD + (ordinalSetProperty_succ births.times.ordinal) smallD irreflexive + (ZFSet.mem_insert births.limit births.limit) hF filterAtLimit + simpa only [external.limit_values.2.1] using basis + +theorem exists_bounded_extension_basis {F : ZFSet.{u}} (hF : F ∈ N.sets) + (filter : MeetFilterCode (completion.externalBoundedCarrier P0 r0 μ0 A0) + (completion.externalBoundedOrder P0 r0 μ0 A0) (completion.externalBoundedMeet P0 r0 μ0 A0) F) : + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ completion.externalBoundedOrder P0 r0 μ0 A0 := by + have filterAtLimit : MeetFilterCode (external.bounded_history.space births.limit) + (external.bounded_history.order births.limit) (external.bounded_history.meetGraph births.limit) F := by + simpa only [external.bounded_values.1, external.bounded_values.2.1, external.bounded_values.2.2.1] using filter + have basis := external.bounded_history.exists_extension_basis includes pairingN unionsN powersN separationN infiniteN choiceN + (M.insert_mem pairing unions births.limit_ground births.limit_ground) hC hD + (ordinalSetProperty_succ births.times.ordinal) smallD irreflexive + (ZFSet.mem_insert births.limit births.limit) hF filterAtLimit + simpa only [external.bounded_values.2.1] using basis + +end PartitionPilot.Forcing.GroundChronologicalExternal + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyFieldAppend.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyFieldAppend.lean index c2c7f895e910b1803a5ddd298155088434d8a9d9..e8a857cd21ad5fa7404f85be290cd7d8b32c8cb9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyFieldAppend.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyFieldAppend.lean @@ -1,619 +1,619 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFixedTopOrders -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem isFunc_retarget_of_entries {A B C f : ZFSet.{u}} - (function : ZFSet.IsFunc A B f) - (bound : ∀ x y, ZFSet.pair x y ∈ f → y ∈ C) : ZFSet.IsFunc A C f := by - refine ⟨?_, function.2⟩ - intro z entry - obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (function.1 entry) - exact ZFSet.pair_mem_prod.2 ⟨hx, bound x y entry⟩ - -namespace GroundCompressionBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T base old : ZFSet.{u}} -variable {data : GroundCompressionUnionData M initial I Sources Reps G m one T} -variable (births : GroundCompressionBirthData M initial I Sources Reps G m one T data base old) - -theorem union_function_successor : - ZFSet.IsFunc (data.fields 0) (insert births.limit births.limit) births.birth := - isFunc_retarget_of_entries births.function - (fun _ _ entry => ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2) - -theorem finite_function_successor (n : Nat) : - ZFSet.IsFunc (initial.iterate M I Sources Reps G T (n + 1)).D - (insert births.limit births.limit) - (graphRestriction (initial.iterate M I Sources Reps G T (n + 1)).D births.birth) := by - have restricted := (show FunctionGraphOn (data.fields 0) births.birth from - ⟨births.limit, births.function⟩).restrict ((data.fieldUnion 0).subset (n + 1)) - apply isFunc_retarget_of_entries restricted.to_isFunc - intro x t entry - exact ZFSet.mem_insert_of_mem _ - (ZFSet.pair_mem_prod.1 (births.function.1 (pair_mem_graphRestriction.1 entry).1)).2 - -end GroundCompressionBirthData - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) - -theorem finite_birth_bound - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) (n : Nat) {x t : ZFSet.{u}} - (entry : ZFSet.pair x t ∈ - graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) : - t ∈ compressionStamp base n ∨ t = compressionStamp base n := by - have before := state.canonical_birth_before_stamp pairing unions powers separation - hI hSources hReps hG hT births.extension births.initial_bound (n + 1) entry - rw [compressionStamp_succ] at before - exact (ZFSet.mem_insert_iff.1 before).symm - -end GroundCompressionState - -namespace GroundChronologicalHistory -variable {M : TransitiveGround.{u}} {T0 C Q qlt base stamps limit s : ZFSet.{u}} -variable (history : GroundChronologicalHistory M T0 C Q qlt) - -theorem prefix_birth_function_successor - (times : CompressionStampCode base stamps limit) - (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) - (prior : s ∈ base ∨ s = base) : - ZFSet.IsFunc (history.space s) (insert limit limit) (history.birth s) := by - have hs : s ∈ T0 := prior.elim (fun before => ordinal.1 base hBase s before) - (fun equal => equal.symm ▸ hBase) - have below : s ∈ limit := times.union.subset 0 (compressionStamp_old_mem prior 0) - apply isFunc_retarget_of_entries (history.birth_function s hs) - intro x t entry - have hx := (ZFSet.pair_mem_prod.1 ((history.birth_function s hs).1 entry)).1 - have bounded := history.birth_bound s hs x hx t entry - apply ZFSet.mem_insert_of_mem - exact bounded.elim (fun equal => equal.symm ▸ below) - (fun before => times.ordinal.1 s below t before) - -end GroundChronologicalHistory - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -structure CompressionChronologyFields where - space : ZFSet.{u} → ZFSet.{u} - order : ZFSet.{u} → ZFSet.{u} - meetGraph : ZFSet.{u} → ZFSet.{u} - birth : ZFSet.{u} → ZFSet.{u} - height : ZFSet.{u} → ZFSet.{u} - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundChronologicalHistory M T0 C Q qlt) - -noncomputable def prefixFields : CompressionChronologyFields.{u} where - space := compressionPrefixValue base births.limit prior.space - (fun n => (state.data.iterate M I Sources Reps G T (n + 1)).D) (data.fields 0) - order := compressionPrefixValue base births.limit prior.order - (fun n => (state.data.iterate M I Sources Reps G T (n + 1)).rD) (data.fields 1) - meetGraph := compressionPrefixValue base births.limit prior.meetGraph - (fun n => (state.data.iterate M I Sources Reps G T (n + 1)).μD) (data.fields 2) - birth := compressionPrefixValue base births.limit prior.birth - (fun n => graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) births.birth - height := compressionPrefixValue base births.limit prior.height - (fun n => heights.function.natValue (n + 1)) heights.height - -theorem prefixFields_old {s : ZFSet.{u}} (before : s ∈ base ∨ s = base) : - (state.prefixFields data births heights prior).space s = prior.space s ∧ - (state.prefixFields data births heights prior).order s = prior.order s ∧ - (state.prefixFields data births heights prior).meetGraph s = prior.meetGraph s ∧ - (state.prefixFields data births heights prior).birth s = prior.birth s ∧ - (state.prefixFields data births heights prior).height s = prior.height s := by - dsimp only [prefixFields] - exact ⟨compressionPrefixValue_old _ _ _ before, - compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before, - compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before⟩ - -theorem prefixFields_stamp (n : Nat) : - (state.prefixFields data births heights prior).space (compressionStamp base n) = - (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ - (state.prefixFields data births heights prior).order (compressionStamp base n) = - (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ - (state.prefixFields data births heights prior).meetGraph (compressionStamp base n) = - (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ - (state.prefixFields data births heights prior).birth (compressionStamp base n) = - graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth ∧ - (state.prefixFields data births heights prior).height (compressionStamp base n) = - heights.function.natValue (n + 1) := by - dsimp only [prefixFields] - exact ⟨compressionPrefixValue_stamp _ _ _ births.times n, - compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n, - compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n⟩ - -theorem prefixFields_limit : - (state.prefixFields data births heights prior).space births.limit = data.fields 0 ∧ - (state.prefixFields data births heights prior).order births.limit = data.fields 1 ∧ - (state.prefixFields data births heights prior).meetGraph births.limit = data.fields 2 ∧ - (state.prefixFields data births heights prior).birth births.limit = births.birth ∧ - (state.prefixFields data births heights prior).height births.limit = heights.height := by - dsimp only [prefixFields] - exact ⟨compressionPrefixValue_limit _ _ _ births.times, - compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times, - compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times⟩ - -end GroundCompressionState - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundChronologicalHistory -universe u -variable {M : TransitiveGround.{u}} {T C D rD cutoff : ZFSet.{u}} -variable (history : GroundChronologicalHistory M T C D rD) -variable (ordinal : ordinalSetProperty T) (hc : cutoff ∈ T) - -def restrictToCutoff : GroundChronologicalHistory M (insert cutoff cutoff) C D rD := by - have included : insert cutoff cutoff ⊆ T := by - intro s hs - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · exact hc - · exact ordinal.1 cutoff hc s hs - refine { - space := history.space, order := history.order, meetGraph := history.meetGraph - birth := history.birth, height := history.height - space_mem := fun s hs => history.space_mem s (included hs) - order_mem := fun s hs => history.order_mem s (included hs) - meet_mem := fun s hs => history.meet_mem s (included hs) - birth_mem := fun s hs => history.birth_mem s (included hs) - height_mem := fun s hs => history.height_mem s (included hs) - meet_order := fun s hs => history.meet_order s (included hs) - birth_function := ?_ - birth_bound := fun s hs => history.birth_bound s (included hs) - old_meet := fun s hs => history.old_meet s (included hs) - strict_height := fun s hs => history.strict_height s (included hs) - layer := fun s hs t ht bound => history.layer s (included hs) t (included ht) bound } - intro s hs - apply isFunc_retarget_of_entries (history.birth_function s (included hs)) - intro x t entry - have hx := (ZFSet.pair_mem_prod.1 ((history.birth_function s (included hs)).1 entry)).1 - rcases history.birth_bound s (included hs) x hx t entry with rfl | before - · exact hs - · rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · exact ZFSet.mem_insert_of_mem _ before - · exact ZFSet.mem_insert_of_mem _ (ordinal.2 cutoff hc s hs t before) - -theorem restrictToCutoff_values (s : ZFSet.{u}) : - (history.restrictToCutoff ordinal hc).space s = history.space s ∧ - (history.restrictToCutoff ordinal hc).order s = history.order s ∧ - (history.restrictToCutoff ordinal hc).meetGraph s = history.meetGraph s ∧ - (history.restrictToCutoff ordinal hc).birth s = history.birth s ∧ - (history.restrictToCutoff ordinal hc).height s = history.height s := ⟨rfl, rfl, rfl, rfl, rfl⟩ - -end PartitionPilot.Forcing.GroundChronologicalHistory - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def appendHistoryValue (time : ZFSet.{u}) - (previous : ZFSet.{u} → ZFSet.{u}) (latest t : ZFSet.{u}) : ZFSet.{u} := by - classical - exact if t = time then latest else previous t - -theorem appendHistoryValue_at (time : ZFSet.{u}) (previous : ZFSet.{u} → ZFSet.{u}) - (latest : ZFSet.{u}) : appendHistoryValue time previous latest time = latest := by - simp [appendHistoryValue] - -theorem appendHistoryValue_old {time t : ZFSet.{u}} (member : t ∈ time) - (previous : ZFSet.{u} → ZFSet.{u}) (latest : ZFSet.{u}) : - appendHistoryValue time previous latest t = previous t := by - apply ite_eq_right - intro equal - exact ZFSet.mem_irrefl time (equal ▸ member) - -namespace GroundChronologicalHistory -variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} -variable (history : GroundChronologicalHistory M (insert s s) C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (ordinal : ordinalSetProperty s) (hs : s ∈ M.sets) -variable (earlier : ∀ x t, ZFSet.pair x t ∈ history.birth s → t ∈ s) -variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) -variable (heightCode : StrictLexHeightCode (fixedTopCarrier (history.space s)) C D - (fixedTopOrder (history.space s) (history.order s)) newHeight rD) - -local notation "time" => (insert s s) -local notation "times" => (insert (insert s s) (insert s s)) -local notation "P" => history.space s -local notation "r" => history.order s -local notation "μ" => history.meetGraph s -local notation "born" => history.birth s -local notation "space'" => appendHistoryValue time history.space (fixedTopCarrier P) -local notation "order'" => appendHistoryValue time history.order (fixedTopOrder P r) -local notation "meet'" => appendHistoryValue time history.meetGraph (fixedTopMeet P r) -local notation "birth'" => appendHistoryValue time history.birth (fixedTopBirth P born s) -local notation "height'" => appendHistoryValue time history.height newHeight - -noncomputable def appendFixedTop : GroundChronologicalHistory M times C D rD := by - classical - have terminal : s ∈ time := ZFSet.mem_insert_iff.2 (Or.inl rfl) - have hP := history.space_mem s terminal - have hr := history.order_mem s terminal - have meet := history.meet_order s terminal - have function := history.birth_function s terminal - have oldOrdinal := ordinalSetProperty_succ ordinal - have sourceSpace : ∀ t ∈ time, ∀ z ∈ t, history.space z = space' z := - fun t ht z hz => (appendHistoryValue_old (oldOrdinal.1 t ht z hz) _ _).symm - have sourceOrder : ∀ t ∈ time, ∀ z ∈ t, history.order z = order' z := - fun t ht z hz => (appendHistoryValue_old (oldOrdinal.1 t ht z hz) _ _).symm - have sourceMeet : ∀ t ∈ time, ∀ z ∈ t, history.meetGraph z = meet' z := - fun t ht z hz => (appendHistoryValue_old (oldOrdinal.1 t ht z hz) _ _).symm - have newBefore : ∀ x t, ZFSet.pair x t ∈ fixedTopBirth P born s → t ∈ time := by - intro x t entry - exact ZFSet.mem_insert_iff.2 (fixedTopBirth_bound earlier x t entry) - refine { - space := space', order := order', meetGraph := meet', birth := birth', height := height' - space_mem := ?_, order_mem := ?_, meet_mem := ?_, birth_mem := ?_, height_mem := ?_ - meet_order := ?_, birth_function := ?_, birth_bound := ?_, old_meet := ?_ - strict_height := ?_, layer := ?_ } - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using M.fixedTopCarrier_mem pairing unions hP - · simpa only [appendHistoryValue_old ht] using history.space_mem t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using M.fixedTopOrder_mem pairing unions powers separation hP hr - · simpa only [appendHistoryValue_old ht] using history.order_mem t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using M.fixedTopMeet_mem pairing unions powers separation hP hr - · simpa only [appendHistoryValue_old ht] using history.meet_mem t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using - M.fixedTopBirth_mem pairing unions hP (history.birth_mem s terminal) hs - · simpa only [appendHistoryValue_old ht] using history.birth_mem t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using hHeight - · simpa only [appendHistoryValue_old ht] using history.height_mem t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using fixedTopMeet_code meet - · simpa only [appendHistoryValue_old ht] using history.meet_order t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simp only [appendHistoryValue_at] - exact isFunc_retarget_of_entries (fixedTopBirth_function function terminal) - (fun x a entry => ZFSet.mem_insert_iff.2 (Or.inr (newBefore x a entry))) - · simp only [appendHistoryValue_old ht] - exact isFunc_retarget_of_entries (history.birth_function t ht) - (fun _ _ entry => ZFSet.mem_insert_iff.2 - (Or.inr (ZFSet.pair_mem_prod.1 ((history.birth_function t ht).1 entry)).2)) - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simp only [appendHistoryValue_at] - exact fun x _ a entry => Or.inr (newBefore x a entry) - · simpa only [appendHistoryValue_old ht] using history.birth_bound t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using - fixedTopBirth_oldMeet meet function earlier (history.old_meet s terminal) - · simpa only [appendHistoryValue_old ht] using history.old_meet t ht - · intro t ht - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · simpa only [appendHistoryValue_at] using heightCode - · simpa only [appendHistoryValue_old ht] using history.strict_height t ht - · intro cutoff hc t ht bound - by_cases equal : cutoff = time - · subst cutoff - simp only [appendHistoryValue_at] - by_cases same : t = time - · subst t - exact CodedGrowthLayer.empty_at_birth_bound ⟨P, hP⟩ newBefore - · have ht := (ZFSet.mem_insert_iff.1 ht).resolve_left same - have layer := M.fixedTopBirth_layers pairing separation hP meet function earlier - (fun a ha => history.layer s terminal a (ZFSet.mem_insert_iff.2 (Or.inr ha)) (Or.inr ha)) - t (ZFSet.mem_insert_iff.1 ht) - exact layer.congr_sources_below (sourceSpace t ht) (sourceOrder t ht) (sourceMeet t ht) - · have hc := (ZFSet.mem_insert_iff.1 hc).resolve_left equal - have htOld : t ∈ time := bound.elim (fun equal => equal ▸ hc) - (fun before => oldOrdinal.1 cutoff hc t before) - simpa only [appendHistoryValue_old hc] using - (history.layer cutoff hc t htOld bound).congr_sources_below - (sourceSpace t htOld) (sourceOrder t htOld) (sourceMeet t htOld) - -local notation "extended" => history.appendFixedTop pairing unions powers separation ordinal hs earlier newHeight hHeight heightCode - -theorem appendFixedTop_old {t : ZFSet.{u}} (ht : t ∈ time) : - (extended).space t = history.space t ∧ (extended).order t = history.order t ∧ - (extended).meetGraph t = history.meetGraph t ∧ (extended).birth t = history.birth t ∧ - (extended).height t = history.height t := by - exact ⟨appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, - appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _⟩ - -theorem appendFixedTop_new : - (extended).space time = fixedTopCarrier P ∧ (extended).order time = fixedTopOrder P r ∧ - (extended).meetGraph time = fixedTopMeet P r ∧ (extended).birth time = fixedTopBirth P born s ∧ - (extended).height time = newHeight := by - exact ⟨appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, - appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _⟩ - -end GroundChronologicalHistory - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundChronologicalHistory M T0 C Q qlt) - -theorem prefixFields_stage_laws - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) - {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : - let fields := state.prefixFields data births heights prior - MeetOrderCode (fields.space s) (fields.order s) (fields.meetGraph s) ∧ - ZFSet.IsFunc (fields.space s) (insert births.limit births.limit) (fields.birth s) ∧ - (∀ x ∈ fields.space s, ∀ t, ZFSet.pair x t ∈ fields.birth s → t = s ∨ t ∈ s) ∧ - OldMeetCode (fields.order s) (fields.meetGraph s) (fields.birth s) ∧ - StrictLexHeightCode (fields.space s) C Q (fields.order s) (fields.height s) qlt := by - classical - dsimp only - by_cases before : s ∈ base ∨ s = base - · have hs := before.elim (fun member => ordinal.1 base hBase s member) - (fun equal => equal.symm ▸ hBase) - obtain ⟨space, order, meet, birth, height⟩ := state.prefixFields_old data births heights prior before - rw [space, order, meet, birth, height] - exact ⟨prior.meet_order s hs, - prior.prefix_birth_function_successor births.times ordinal hBase before, - prior.birth_bound s hs, prior.old_meet s hs, prior.strict_height s hs⟩ - · rcases ZFSet.mem_insert_iff.1 cutoff with rfl | below - · obtain ⟨space, order, meet, birth, height⟩ := state.prefixFields_limit data births heights prior - rw [space, order, meet, birth, height] - exact ⟨data.meet, births.union_function_successor, - fun _ _ _ entry => Or.inr (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2, - births.old_meet, heights.code⟩ - · have stamped : ∃ n, s = compressionStamp base n := by - rcases (births.times.mem_limit_iff s).1 below with member | equal | stamped - · exact False.elim (before (Or.inl member)) - · exact False.elim (before (Or.inr equal)) - · exact stamped - obtain ⟨n, rfl⟩ := stamped - obtain ⟨space, order, meet, birth, height⟩ := state.prefixFields_stamp data births heights prior n - rw [space, order, meet, birth, height] - exact ⟨(state.canonical_iterate_codes pairing unions powers separation - hI hSources hReps hG hT (n + 1)).1, - births.finite_function_successor n, - fun _ _ _ entry => (state.finite_birth_bound data births pairing unions powers separation - hI hSources hReps hG hT n entry).symm, - births.finite_old_meet (n + 1), heights.finite (n + 1)⟩ - - - - - -theorem prefixFields_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) - {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : - (state.prefixFields data births heights prior).space s ∈ M.sets ∧ - (state.prefixFields data births heights prior).order s ∈ M.sets ∧ - (state.prefixFields data births heights prior).meetGraph s ∈ M.sets ∧ - (state.prefixFields data births heights prior).birth s ∈ M.sets ∧ - (state.prefixFields data births heights prior).height s ∈ M.sets := by - have originalIndex {t : ZFSet.{u}} (before : t ∈ base ∨ t = base) : t ∈ T0 := - before.elim (fun h => ordinal.1 base hBase t h) (fun h => h ▸ hBase) - have finite (n : Nat) : - (state.data.iterate M I Sources Reps G T (n + 1)).D ∈ M.sets ∧ - (state.data.iterate M I Sources Reps G T (n + 1)).rD ∈ M.sets ∧ - (state.data.iterate M I Sources Reps G T (n + 1)).μD ∈ M.sets := by - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT (n + 1) - rw [← equal] - exact ⟨current.ground.carrier, current.ground.order, current.ground.meet⟩ - have finiteBirth (n : Nat) : - graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth ∈ M.sets := - M.pair_right (M.transitive births.family_ground ((births.family_entries (n + 1) _).2 rfl)) - have finiteHeight (n : Nat) : heights.function.natValue (n + 1) ∈ M.sets := - M.pair_right (M.transitive heights.family_ground (heights.function.natValue_entry (n + 1))) - dsimp only [prefixFields] - refine ⟨?_, ?_, ?_, ?_, ?_⟩ - · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times - (fun t ht => prior.space_mem t (originalIndex ht)) (fun n => (finite n).1) (data.ground 0) cutoff - · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times - (fun t ht => prior.order_mem t (originalIndex ht)) (fun n => (finite n).2.1) (data.ground 1) cutoff - · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times - (fun t ht => prior.meet_mem t (originalIndex ht)) (fun n => (finite n).2.2) (data.ground 2) cutoff - · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times - (fun t ht => prior.birth_mem t (originalIndex ht)) finiteBirth births.birth_ground cutoff - · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times - (fun t ht => prior.height_mem t (originalIndex ht)) finiteHeight heights.height_ground cutoff - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def terminalChronologyGraph (s f v : ZFSet.{u}) : ZFSet.{u} := - insert (ZFSet.pair s v) (graphRestriction s f) - -theorem pair_mem_terminalChronologyGraph (s f v x y : ZFSet.{u}) : - ZFSet.pair x y ∈ terminalChronologyGraph s f v ↔ - (x = s ∧ y = v) ∨ (ZFSet.pair x y ∈ f ∧ x ∈ s) := by - rw [terminalChronologyGraph, ZFSet.mem_insert_iff, ZFSet.pair_inj, pair_mem_graphRestriction] - -theorem terminalChronologyGraph_function {s f v : ZFSet.{u}} - (function : FunctionGraphOn (insert s s) f) : - FunctionGraphOn (insert s s) (terminalChronologyGraph s f v) := by - refine ⟨insert v (ZFSet.sUnion (ZFSet.sUnion f)), ?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_insert_iff.1 hz with rfl | old - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, ZFSet.mem_insert _ _⟩ - · obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 old - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hx, - ZFSet.mem_insert_of_mem _ (pair_second_mem_doubleUnion entry)⟩ - · intro x hx - rcases ZFSet.mem_insert_iff.1 hx with rfl | hx - · refine ⟨v, (pair_mem_terminalChronologyGraph _ _ _ _ _).2 (Or.inl ⟨rfl,rfl⟩), ?_⟩ - intro y entry - rcases (pair_mem_terminalChronologyGraph _ _ _ _ _).1 entry with new | old - · exact new.2 - · exact False.elim (ZFSet.mem_irrefl _ old.2) - · obtain ⟨y, entry, unique⟩ := function.to_isFunc.2 x (ZFSet.mem_insert_of_mem _ hx) - refine ⟨y, (pair_mem_terminalChronologyGraph _ _ _ _ _).2 (Or.inr ⟨entry,hx⟩), ?_⟩ - intro y' entry' - rcases (pair_mem_terminalChronologyGraph _ _ _ _ _).1 entry' with new | old - · exact False.elim (ZFSet.mem_irrefl s (new.1 ▸ hx)) - · exact unique y' old.1 - -namespace GroundChronologyFields -variable {M : TransitiveGround.{u}} {s : ZFSet.{u}} -variable (fields : GroundChronologyFields M (insert s s)) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) -variable (newValues : Fin 5 → ZFSet.{u}) (ground : ∀ j, newValues j ∈ M.sets) - -noncomputable def replaceTerminal : GroundChronologyFields M (insert s s) := - GroundChronologyFields.ofGraphs pairing unions fields.time_ground - (fun j => terminalChronologyGraph s (fields.graph j) (newValues j)) - (fun j => M.insert_mem pairing unions - (M.orderedPair_mem pairing (M.transitive fields.time_ground (ZFSet.mem_insert _ _)) (ground j)) - (M.graphRestriction_mem unions separation - (M.transitive fields.time_ground (ZFSet.mem_insert _ _)) (fields.graph_ground j))) - (fun j => terminalChronologyGraph_function ⟨fields.bound, fields.function j⟩) - -theorem replaceTerminal_graph (j : Fin 5) : - (fields.replaceTerminal pairing unions separation newValues ground).graph j = - terminalChronologyGraph s (fields.graph j) (newValues j) := rfl - -theorem replaceTerminal_value_at (j : Fin 5) : - (fields.replaceTerminal pairing unions separation newValues ground).value j s = newValues j := by - apply GroundChronologyFields.value_eq_of_entry - exact (pair_mem_terminalChronologyGraph _ _ _ _ _).2 (Or.inl ⟨rfl,rfl⟩) - -theorem replaceTerminal_value_old (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ s) : - (fields.replaceTerminal pairing unions separation newValues ground).value j t = fields.value j t := by - apply GroundChronologyFields.value_eq_of_entry - exact (pair_mem_terminalChronologyGraph _ _ _ _ _).2 - (Or.inr ⟨fields.value_entry j (ZFSet.mem_insert_of_mem _ ht),ht⟩) - -theorem replaceTerminal_value (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ insert s s) : - (fields.replaceTerminal pairing unions separation newValues ground).value j t = - appendHistoryValue s (fields.value j) (newValues j) t := by - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · rw [appendHistoryValue_at] - exact fields.replaceTerminal_value_at pairing unions separation newValues ground j - · rw [appendHistoryValue_old ht] - exact fields.replaceTerminal_value_old pairing unions separation newValues ground j ht - -theorem replaceTerminal_old_entries (j : Fin 5) {t y : ZFSet.{u}} (ht : t ∈ s) : - ZFSet.pair t y ∈ (fields.replaceTerminal pairing unions separation newValues ground).graph j ↔ - ZFSet.pair t y ∈ fields.graph j := by - rw [replaceTerminal_graph, pair_mem_terminalChronologyGraph] - exact ⟨fun h => h.elim (fun eq => False.elim (ZFSet.mem_irrefl s (eq.1 ▸ ht))) And.left, - fun entry => Or.inr ⟨entry,ht⟩⟩ - -end GroundChronologyFields - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundChronologyFields -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {T : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (newValues : Fin 5 → ZFSet.{u}) (ground : ∀ j, newValues j ∈ M.sets) - -noncomputable def appendTime : GroundChronologyFields M (insert T T) := - GroundChronologyFields.ofGraphs pairing unions (M.insert_mem pairing unions fields.time_ground fields.time_ground) - (fun j => insert (ZFSet.pair T (newValues j)) (fields.graph j)) - (fun j => M.insert_mem pairing unions (M.orderedPair_mem pairing fields.time_ground (ground j)) - (fields.graph_ground j)) - (fun j => (fields.graphFunction j).insert (ZFSet.mem_irrefl T) (newValues j)) - -theorem appendTime_graph (j : Fin 5) : - (fields.appendTime pairing unions newValues ground).graph j = - insert (ZFSet.pair T (newValues j)) (fields.graph j) := rfl - -theorem appendTime_value_at (j : Fin 5) : - (fields.appendTime pairing unions newValues ground).value j T = newValues j := by - apply GroundChronologyFields.value_eq_of_entry - exact ZFSet.mem_insert _ _ - -theorem appendTime_old_entries (j : Fin 5) {s y : ZFSet.{u}} (hs : s ∈ T) : - ZFSet.pair s y ∈ (fields.appendTime pairing unions newValues ground).graph j ↔ - ZFSet.pair s y ∈ fields.graph j := by - rw [appendTime_graph, ZFSet.mem_insert_iff, ZFSet.pair_inj] - constructor - · rintro (⟨rfl, _⟩ | entry) - · exact False.elim (ZFSet.mem_irrefl _ hs) - · exact entry - · exact Or.inr - -theorem appendTime_value_old (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ T) : - (fields.appendTime pairing unions newValues ground).value j s = fields.value j s := by - apply GroundChronologyFields.value_eq_of_entry - exact (fields.appendTime_old_entries pairing unions newValues ground j hs).2 (fields.value_entry j hs) - -theorem appendTime_graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (time : ZFSet.rank T < o) (graphs : ∀ j, ZFSet.rank (fields.graph j) < o) - (values : ∀ j, ZFSet.rank (newValues j) < o) (j : Fin 5) : - ZFSet.rank ((fields.appendTime pairing unions newValues ground).graph j) < o := by - rw [appendTime_graph, ZFSet.rank_insert] - exact max_lt (limit.succ_lt (rank_orderedPair_lt limit time (values j))) (graphs j) - -end PartitionPilot.Forcing.GroundChronologyFields - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFixedTopOrders +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem isFunc_retarget_of_entries {A B C f : ZFSet.{u}} + (function : ZFSet.IsFunc A B f) + (bound : ∀ x y, ZFSet.pair x y ∈ f → y ∈ C) : ZFSet.IsFunc A C f := by + refine ⟨?_, function.2⟩ + intro z entry + obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (function.1 entry) + exact ZFSet.pair_mem_prod.2 ⟨hx, bound x y entry⟩ + +namespace GroundCompressionBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T base old : ZFSet.{u}} +variable {data : GroundCompressionUnionData M initial I Sources Reps G m one T} +variable (births : GroundCompressionBirthData M initial I Sources Reps G m one T data base old) + +theorem union_function_successor : + ZFSet.IsFunc (data.fields 0) (insert births.limit births.limit) births.birth := + isFunc_retarget_of_entries births.function + (fun _ _ entry => ZFSet.mem_insert_of_mem _ (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2) + +theorem finite_function_successor (n : Nat) : + ZFSet.IsFunc (initial.iterate M I Sources Reps G T (n + 1)).D + (insert births.limit births.limit) + (graphRestriction (initial.iterate M I Sources Reps G T (n + 1)).D births.birth) := by + have restricted := (show FunctionGraphOn (data.fields 0) births.birth from + ⟨births.limit, births.function⟩).restrict ((data.fieldUnion 0).subset (n + 1)) + apply isFunc_retarget_of_entries restricted.to_isFunc + intro x t entry + exact ZFSet.mem_insert_of_mem _ + (ZFSet.pair_mem_prod.1 (births.function.1 (pair_mem_graphRestriction.1 entry).1)).2 + +end GroundCompressionBirthData + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) + +theorem finite_birth_bound + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) (n : Nat) {x t : ZFSet.{u}} + (entry : ZFSet.pair x t ∈ + graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) : + t ∈ compressionStamp base n ∨ t = compressionStamp base n := by + have before := state.canonical_birth_before_stamp pairing unions powers separation + hI hSources hReps hG hT births.extension births.initial_bound (n + 1) entry + rw [compressionStamp_succ] at before + exact (ZFSet.mem_insert_iff.1 before).symm + +end GroundCompressionState + +namespace GroundChronologicalHistory +variable {M : TransitiveGround.{u}} {T0 C Q qlt base stamps limit s : ZFSet.{u}} +variable (history : GroundChronologicalHistory M T0 C Q qlt) + +theorem prefix_birth_function_successor + (times : CompressionStampCode base stamps limit) + (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) + (prior : s ∈ base ∨ s = base) : + ZFSet.IsFunc (history.space s) (insert limit limit) (history.birth s) := by + have hs : s ∈ T0 := prior.elim (fun before => ordinal.1 base hBase s before) + (fun equal => equal.symm ▸ hBase) + have below : s ∈ limit := times.union.subset 0 (compressionStamp_old_mem prior 0) + apply isFunc_retarget_of_entries (history.birth_function s hs) + intro x t entry + have hx := (ZFSet.pair_mem_prod.1 ((history.birth_function s hs).1 entry)).1 + have bounded := history.birth_bound s hs x hx t entry + apply ZFSet.mem_insert_of_mem + exact bounded.elim (fun equal => equal.symm ▸ below) + (fun before => times.ordinal.1 s below t before) + +end GroundChronologicalHistory + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +structure CompressionChronologyFields where + space : ZFSet.{u} → ZFSet.{u} + order : ZFSet.{u} → ZFSet.{u} + meetGraph : ZFSet.{u} → ZFSet.{u} + birth : ZFSet.{u} → ZFSet.{u} + height : ZFSet.{u} → ZFSet.{u} + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundChronologicalHistory M T0 C Q qlt) + +noncomputable def prefixFields : CompressionChronologyFields.{u} where + space := compressionPrefixValue base births.limit prior.space + (fun n => (state.data.iterate M I Sources Reps G T (n + 1)).D) (data.fields 0) + order := compressionPrefixValue base births.limit prior.order + (fun n => (state.data.iterate M I Sources Reps G T (n + 1)).rD) (data.fields 1) + meetGraph := compressionPrefixValue base births.limit prior.meetGraph + (fun n => (state.data.iterate M I Sources Reps G T (n + 1)).μD) (data.fields 2) + birth := compressionPrefixValue base births.limit prior.birth + (fun n => graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth) births.birth + height := compressionPrefixValue base births.limit prior.height + (fun n => heights.function.natValue (n + 1)) heights.height + +theorem prefixFields_old {s : ZFSet.{u}} (before : s ∈ base ∨ s = base) : + (state.prefixFields data births heights prior).space s = prior.space s ∧ + (state.prefixFields data births heights prior).order s = prior.order s ∧ + (state.prefixFields data births heights prior).meetGraph s = prior.meetGraph s ∧ + (state.prefixFields data births heights prior).birth s = prior.birth s ∧ + (state.prefixFields data births heights prior).height s = prior.height s := by + dsimp only [prefixFields] + exact ⟨compressionPrefixValue_old _ _ _ before, + compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before, + compressionPrefixValue_old _ _ _ before, compressionPrefixValue_old _ _ _ before⟩ + +theorem prefixFields_stamp (n : Nat) : + (state.prefixFields data births heights prior).space (compressionStamp base n) = + (state.data.iterate M I Sources Reps G T (n + 1)).D ∧ + (state.prefixFields data births heights prior).order (compressionStamp base n) = + (state.data.iterate M I Sources Reps G T (n + 1)).rD ∧ + (state.prefixFields data births heights prior).meetGraph (compressionStamp base n) = + (state.data.iterate M I Sources Reps G T (n + 1)).μD ∧ + (state.prefixFields data births heights prior).birth (compressionStamp base n) = + graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth ∧ + (state.prefixFields data births heights prior).height (compressionStamp base n) = + heights.function.natValue (n + 1) := by + dsimp only [prefixFields] + exact ⟨compressionPrefixValue_stamp _ _ _ births.times n, + compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n, + compressionPrefixValue_stamp _ _ _ births.times n, compressionPrefixValue_stamp _ _ _ births.times n⟩ + +theorem prefixFields_limit : + (state.prefixFields data births heights prior).space births.limit = data.fields 0 ∧ + (state.prefixFields data births heights prior).order births.limit = data.fields 1 ∧ + (state.prefixFields data births heights prior).meetGraph births.limit = data.fields 2 ∧ + (state.prefixFields data births heights prior).birth births.limit = births.birth ∧ + (state.prefixFields data births heights prior).height births.limit = heights.height := by + dsimp only [prefixFields] + exact ⟨compressionPrefixValue_limit _ _ _ births.times, + compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times, + compressionPrefixValue_limit _ _ _ births.times, compressionPrefixValue_limit _ _ _ births.times⟩ + +end GroundCompressionState + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundChronologicalHistory +universe u +variable {M : TransitiveGround.{u}} {T C D rD cutoff : ZFSet.{u}} +variable (history : GroundChronologicalHistory M T C D rD) +variable (ordinal : ordinalSetProperty T) (hc : cutoff ∈ T) + +def restrictToCutoff : GroundChronologicalHistory M (insert cutoff cutoff) C D rD := by + have included : insert cutoff cutoff ⊆ T := by + intro s hs + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · exact hc + · exact ordinal.1 cutoff hc s hs + refine { + space := history.space, order := history.order, meetGraph := history.meetGraph + birth := history.birth, height := history.height + space_mem := fun s hs => history.space_mem s (included hs) + order_mem := fun s hs => history.order_mem s (included hs) + meet_mem := fun s hs => history.meet_mem s (included hs) + birth_mem := fun s hs => history.birth_mem s (included hs) + height_mem := fun s hs => history.height_mem s (included hs) + meet_order := fun s hs => history.meet_order s (included hs) + birth_function := ?_ + birth_bound := fun s hs => history.birth_bound s (included hs) + old_meet := fun s hs => history.old_meet s (included hs) + strict_height := fun s hs => history.strict_height s (included hs) + layer := fun s hs t ht bound => history.layer s (included hs) t (included ht) bound } + intro s hs + apply isFunc_retarget_of_entries (history.birth_function s (included hs)) + intro x t entry + have hx := (ZFSet.pair_mem_prod.1 ((history.birth_function s (included hs)).1 entry)).1 + rcases history.birth_bound s (included hs) x hx t entry with rfl | before + · exact hs + · rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · exact ZFSet.mem_insert_of_mem _ before + · exact ZFSet.mem_insert_of_mem _ (ordinal.2 cutoff hc s hs t before) + +theorem restrictToCutoff_values (s : ZFSet.{u}) : + (history.restrictToCutoff ordinal hc).space s = history.space s ∧ + (history.restrictToCutoff ordinal hc).order s = history.order s ∧ + (history.restrictToCutoff ordinal hc).meetGraph s = history.meetGraph s ∧ + (history.restrictToCutoff ordinal hc).birth s = history.birth s ∧ + (history.restrictToCutoff ordinal hc).height s = history.height s := ⟨rfl, rfl, rfl, rfl, rfl⟩ + +end PartitionPilot.Forcing.GroundChronologicalHistory + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def appendHistoryValue (time : ZFSet.{u}) + (previous : ZFSet.{u} → ZFSet.{u}) (latest t : ZFSet.{u}) : ZFSet.{u} := by + classical + exact if t = time then latest else previous t + +theorem appendHistoryValue_at (time : ZFSet.{u}) (previous : ZFSet.{u} → ZFSet.{u}) + (latest : ZFSet.{u}) : appendHistoryValue time previous latest time = latest := by + simp [appendHistoryValue] + +theorem appendHistoryValue_old {time t : ZFSet.{u}} (member : t ∈ time) + (previous : ZFSet.{u} → ZFSet.{u}) (latest : ZFSet.{u}) : + appendHistoryValue time previous latest t = previous t := by + apply ite_eq_right + intro equal + exact ZFSet.mem_irrefl time (equal ▸ member) + +namespace GroundChronologicalHistory +variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} +variable (history : GroundChronologicalHistory M (insert s s) C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (ordinal : ordinalSetProperty s) (hs : s ∈ M.sets) +variable (earlier : ∀ x t, ZFSet.pair x t ∈ history.birth s → t ∈ s) +variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) +variable (heightCode : StrictLexHeightCode (fixedTopCarrier (history.space s)) C D + (fixedTopOrder (history.space s) (history.order s)) newHeight rD) + +local notation "time" => (insert s s) +local notation "times" => (insert (insert s s) (insert s s)) +local notation "P" => history.space s +local notation "r" => history.order s +local notation "μ" => history.meetGraph s +local notation "born" => history.birth s +local notation "space'" => appendHistoryValue time history.space (fixedTopCarrier P) +local notation "order'" => appendHistoryValue time history.order (fixedTopOrder P r) +local notation "meet'" => appendHistoryValue time history.meetGraph (fixedTopMeet P r) +local notation "birth'" => appendHistoryValue time history.birth (fixedTopBirth P born s) +local notation "height'" => appendHistoryValue time history.height newHeight + +noncomputable def appendFixedTop : GroundChronologicalHistory M times C D rD := by + classical + have terminal : s ∈ time := ZFSet.mem_insert_iff.2 (Or.inl rfl) + have hP := history.space_mem s terminal + have hr := history.order_mem s terminal + have meet := history.meet_order s terminal + have function := history.birth_function s terminal + have oldOrdinal := ordinalSetProperty_succ ordinal + have sourceSpace : ∀ t ∈ time, ∀ z ∈ t, history.space z = space' z := + fun t ht z hz => (appendHistoryValue_old (oldOrdinal.1 t ht z hz) _ _).symm + have sourceOrder : ∀ t ∈ time, ∀ z ∈ t, history.order z = order' z := + fun t ht z hz => (appendHistoryValue_old (oldOrdinal.1 t ht z hz) _ _).symm + have sourceMeet : ∀ t ∈ time, ∀ z ∈ t, history.meetGraph z = meet' z := + fun t ht z hz => (appendHistoryValue_old (oldOrdinal.1 t ht z hz) _ _).symm + have newBefore : ∀ x t, ZFSet.pair x t ∈ fixedTopBirth P born s → t ∈ time := by + intro x t entry + exact ZFSet.mem_insert_iff.2 (fixedTopBirth_bound earlier x t entry) + refine { + space := space', order := order', meetGraph := meet', birth := birth', height := height' + space_mem := ?_, order_mem := ?_, meet_mem := ?_, birth_mem := ?_, height_mem := ?_ + meet_order := ?_, birth_function := ?_, birth_bound := ?_, old_meet := ?_ + strict_height := ?_, layer := ?_ } + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using M.fixedTopCarrier_mem pairing unions hP + · simpa only [appendHistoryValue_old ht] using history.space_mem t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using M.fixedTopOrder_mem pairing unions powers separation hP hr + · simpa only [appendHistoryValue_old ht] using history.order_mem t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using M.fixedTopMeet_mem pairing unions powers separation hP hr + · simpa only [appendHistoryValue_old ht] using history.meet_mem t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using + M.fixedTopBirth_mem pairing unions hP (history.birth_mem s terminal) hs + · simpa only [appendHistoryValue_old ht] using history.birth_mem t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using hHeight + · simpa only [appendHistoryValue_old ht] using history.height_mem t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using fixedTopMeet_code meet + · simpa only [appendHistoryValue_old ht] using history.meet_order t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simp only [appendHistoryValue_at] + exact isFunc_retarget_of_entries (fixedTopBirth_function function terminal) + (fun x a entry => ZFSet.mem_insert_iff.2 (Or.inr (newBefore x a entry))) + · simp only [appendHistoryValue_old ht] + exact isFunc_retarget_of_entries (history.birth_function t ht) + (fun _ _ entry => ZFSet.mem_insert_iff.2 + (Or.inr (ZFSet.pair_mem_prod.1 ((history.birth_function t ht).1 entry)).2)) + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simp only [appendHistoryValue_at] + exact fun x _ a entry => Or.inr (newBefore x a entry) + · simpa only [appendHistoryValue_old ht] using history.birth_bound t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using + fixedTopBirth_oldMeet meet function earlier (history.old_meet s terminal) + · simpa only [appendHistoryValue_old ht] using history.old_meet t ht + · intro t ht + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · simpa only [appendHistoryValue_at] using heightCode + · simpa only [appendHistoryValue_old ht] using history.strict_height t ht + · intro cutoff hc t ht bound + by_cases equal : cutoff = time + · subst cutoff + simp only [appendHistoryValue_at] + by_cases same : t = time + · subst t + exact CodedGrowthLayer.empty_at_birth_bound ⟨P, hP⟩ newBefore + · have ht := (ZFSet.mem_insert_iff.1 ht).resolve_left same + have layer := M.fixedTopBirth_layers pairing separation hP meet function earlier + (fun a ha => history.layer s terminal a (ZFSet.mem_insert_iff.2 (Or.inr ha)) (Or.inr ha)) + t (ZFSet.mem_insert_iff.1 ht) + exact layer.congr_sources_below (sourceSpace t ht) (sourceOrder t ht) (sourceMeet t ht) + · have hc := (ZFSet.mem_insert_iff.1 hc).resolve_left equal + have htOld : t ∈ time := bound.elim (fun equal => equal ▸ hc) + (fun before => oldOrdinal.1 cutoff hc t before) + simpa only [appendHistoryValue_old hc] using + (history.layer cutoff hc t htOld bound).congr_sources_below + (sourceSpace t htOld) (sourceOrder t htOld) (sourceMeet t htOld) + +local notation "extended" => history.appendFixedTop pairing unions powers separation ordinal hs earlier newHeight hHeight heightCode + +theorem appendFixedTop_old {t : ZFSet.{u}} (ht : t ∈ time) : + (extended).space t = history.space t ∧ (extended).order t = history.order t ∧ + (extended).meetGraph t = history.meetGraph t ∧ (extended).birth t = history.birth t ∧ + (extended).height t = history.height t := by + exact ⟨appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _, + appendHistoryValue_old ht _ _, appendHistoryValue_old ht _ _⟩ + +theorem appendFixedTop_new : + (extended).space time = fixedTopCarrier P ∧ (extended).order time = fixedTopOrder P r ∧ + (extended).meetGraph time = fixedTopMeet P r ∧ (extended).birth time = fixedTopBirth P born s ∧ + (extended).height time = newHeight := by + exact ⟨appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _, + appendHistoryValue_at _ _ _, appendHistoryValue_at _ _ _⟩ + +end GroundChronologicalHistory + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundChronologicalHistory M T0 C Q qlt) + +theorem prefixFields_stage_laws + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) + {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : + let fields := state.prefixFields data births heights prior + MeetOrderCode (fields.space s) (fields.order s) (fields.meetGraph s) ∧ + ZFSet.IsFunc (fields.space s) (insert births.limit births.limit) (fields.birth s) ∧ + (∀ x ∈ fields.space s, ∀ t, ZFSet.pair x t ∈ fields.birth s → t = s ∨ t ∈ s) ∧ + OldMeetCode (fields.order s) (fields.meetGraph s) (fields.birth s) ∧ + StrictLexHeightCode (fields.space s) C Q (fields.order s) (fields.height s) qlt := by + classical + dsimp only + by_cases before : s ∈ base ∨ s = base + · have hs := before.elim (fun member => ordinal.1 base hBase s member) + (fun equal => equal.symm ▸ hBase) + obtain ⟨space, order, meet, birth, height⟩ := state.prefixFields_old data births heights prior before + rw [space, order, meet, birth, height] + exact ⟨prior.meet_order s hs, + prior.prefix_birth_function_successor births.times ordinal hBase before, + prior.birth_bound s hs, prior.old_meet s hs, prior.strict_height s hs⟩ + · rcases ZFSet.mem_insert_iff.1 cutoff with rfl | below + · obtain ⟨space, order, meet, birth, height⟩ := state.prefixFields_limit data births heights prior + rw [space, order, meet, birth, height] + exact ⟨data.meet, births.union_function_successor, + fun _ _ _ entry => Or.inr (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2, + births.old_meet, heights.code⟩ + · have stamped : ∃ n, s = compressionStamp base n := by + rcases (births.times.mem_limit_iff s).1 below with member | equal | stamped + · exact False.elim (before (Or.inl member)) + · exact False.elim (before (Or.inr equal)) + · exact stamped + obtain ⟨n, rfl⟩ := stamped + obtain ⟨space, order, meet, birth, height⟩ := state.prefixFields_stamp data births heights prior n + rw [space, order, meet, birth, height] + exact ⟨(state.canonical_iterate_codes pairing unions powers separation + hI hSources hReps hG hT (n + 1)).1, + births.finite_function_successor n, + fun _ _ _ entry => (state.finite_birth_bound data births pairing unions powers separation + hI hSources hReps hG hT n entry).symm, + births.finite_old_meet (n + 1), heights.finite (n + 1)⟩ + + + + + +theorem prefixFields_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + (ordinal : ordinalSetProperty T0) (hBase : base ∈ T0) + {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : + (state.prefixFields data births heights prior).space s ∈ M.sets ∧ + (state.prefixFields data births heights prior).order s ∈ M.sets ∧ + (state.prefixFields data births heights prior).meetGraph s ∈ M.sets ∧ + (state.prefixFields data births heights prior).birth s ∈ M.sets ∧ + (state.prefixFields data births heights prior).height s ∈ M.sets := by + have originalIndex {t : ZFSet.{u}} (before : t ∈ base ∨ t = base) : t ∈ T0 := + before.elim (fun h => ordinal.1 base hBase t h) (fun h => h ▸ hBase) + have finite (n : Nat) : + (state.data.iterate M I Sources Reps G T (n + 1)).D ∈ M.sets ∧ + (state.data.iterate M I Sources Reps G T (n + 1)).rD ∈ M.sets ∧ + (state.data.iterate M I Sources Reps G T (n + 1)).μD ∈ M.sets := by + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT (n + 1) + rw [← equal] + exact ⟨current.ground.carrier, current.ground.order, current.ground.meet⟩ + have finiteBirth (n : Nat) : + graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D births.birth ∈ M.sets := + M.pair_right (M.transitive births.family_ground ((births.family_entries (n + 1) _).2 rfl)) + have finiteHeight (n : Nat) : heights.function.natValue (n + 1) ∈ M.sets := + M.pair_right (M.transitive heights.family_ground (heights.function.natValue_entry (n + 1))) + dsimp only [prefixFields] + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times + (fun t ht => prior.space_mem t (originalIndex ht)) (fun n => (finite n).1) (data.ground 0) cutoff + · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times + (fun t ht => prior.order_mem t (originalIndex ht)) (fun n => (finite n).2.1) (data.ground 1) cutoff + · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times + (fun t ht => prior.meet_mem t (originalIndex ht)) (fun n => (finite n).2.2) (data.ground 2) cutoff + · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times + (fun t ht => prior.birth_mem t (originalIndex ht)) finiteBirth births.birth_ground cutoff + · exact TransitiveGround.compressionPrefixValue_mem _ _ _ M births.times + (fun t ht => prior.height_mem t (originalIndex ht)) finiteHeight heights.height_ground cutoff + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def terminalChronologyGraph (s f v : ZFSet.{u}) : ZFSet.{u} := + insert (ZFSet.pair s v) (graphRestriction s f) + +theorem pair_mem_terminalChronologyGraph (s f v x y : ZFSet.{u}) : + ZFSet.pair x y ∈ terminalChronologyGraph s f v ↔ + (x = s ∧ y = v) ∨ (ZFSet.pair x y ∈ f ∧ x ∈ s) := by + rw [terminalChronologyGraph, ZFSet.mem_insert_iff, ZFSet.pair_inj, pair_mem_graphRestriction] + +theorem terminalChronologyGraph_function {s f v : ZFSet.{u}} + (function : FunctionGraphOn (insert s s) f) : + FunctionGraphOn (insert s s) (terminalChronologyGraph s f v) := by + refine ⟨insert v (ZFSet.sUnion (ZFSet.sUnion f)), ?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_insert_iff.1 hz with rfl | old + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, ZFSet.mem_insert _ _⟩ + · obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 old + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hx, + ZFSet.mem_insert_of_mem _ (pair_second_mem_doubleUnion entry)⟩ + · intro x hx + rcases ZFSet.mem_insert_iff.1 hx with rfl | hx + · refine ⟨v, (pair_mem_terminalChronologyGraph _ _ _ _ _).2 (Or.inl ⟨rfl,rfl⟩), ?_⟩ + intro y entry + rcases (pair_mem_terminalChronologyGraph _ _ _ _ _).1 entry with new | old + · exact new.2 + · exact False.elim (ZFSet.mem_irrefl _ old.2) + · obtain ⟨y, entry, unique⟩ := function.to_isFunc.2 x (ZFSet.mem_insert_of_mem _ hx) + refine ⟨y, (pair_mem_terminalChronologyGraph _ _ _ _ _).2 (Or.inr ⟨entry,hx⟩), ?_⟩ + intro y' entry' + rcases (pair_mem_terminalChronologyGraph _ _ _ _ _).1 entry' with new | old + · exact False.elim (ZFSet.mem_irrefl s (new.1 ▸ hx)) + · exact unique y' old.1 + +namespace GroundChronologyFields +variable {M : TransitiveGround.{u}} {s : ZFSet.{u}} +variable (fields : GroundChronologyFields M (insert s s)) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) +variable (newValues : Fin 5 → ZFSet.{u}) (ground : ∀ j, newValues j ∈ M.sets) + +noncomputable def replaceTerminal : GroundChronologyFields M (insert s s) := + GroundChronologyFields.ofGraphs pairing unions fields.time_ground + (fun j => terminalChronologyGraph s (fields.graph j) (newValues j)) + (fun j => M.insert_mem pairing unions + (M.orderedPair_mem pairing (M.transitive fields.time_ground (ZFSet.mem_insert _ _)) (ground j)) + (M.graphRestriction_mem unions separation + (M.transitive fields.time_ground (ZFSet.mem_insert _ _)) (fields.graph_ground j))) + (fun j => terminalChronologyGraph_function ⟨fields.bound, fields.function j⟩) + +theorem replaceTerminal_graph (j : Fin 5) : + (fields.replaceTerminal pairing unions separation newValues ground).graph j = + terminalChronologyGraph s (fields.graph j) (newValues j) := rfl + +theorem replaceTerminal_value_at (j : Fin 5) : + (fields.replaceTerminal pairing unions separation newValues ground).value j s = newValues j := by + apply GroundChronologyFields.value_eq_of_entry + exact (pair_mem_terminalChronologyGraph _ _ _ _ _).2 (Or.inl ⟨rfl,rfl⟩) + +theorem replaceTerminal_value_old (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ s) : + (fields.replaceTerminal pairing unions separation newValues ground).value j t = fields.value j t := by + apply GroundChronologyFields.value_eq_of_entry + exact (pair_mem_terminalChronologyGraph _ _ _ _ _).2 + (Or.inr ⟨fields.value_entry j (ZFSet.mem_insert_of_mem _ ht),ht⟩) + +theorem replaceTerminal_value (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ insert s s) : + (fields.replaceTerminal pairing unions separation newValues ground).value j t = + appendHistoryValue s (fields.value j) (newValues j) t := by + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · rw [appendHistoryValue_at] + exact fields.replaceTerminal_value_at pairing unions separation newValues ground j + · rw [appendHistoryValue_old ht] + exact fields.replaceTerminal_value_old pairing unions separation newValues ground j ht + +theorem replaceTerminal_old_entries (j : Fin 5) {t y : ZFSet.{u}} (ht : t ∈ s) : + ZFSet.pair t y ∈ (fields.replaceTerminal pairing unions separation newValues ground).graph j ↔ + ZFSet.pair t y ∈ fields.graph j := by + rw [replaceTerminal_graph, pair_mem_terminalChronologyGraph] + exact ⟨fun h => h.elim (fun eq => False.elim (ZFSet.mem_irrefl s (eq.1 ▸ ht))) And.left, + fun entry => Or.inr ⟨entry,ht⟩⟩ + +end GroundChronologyFields + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundChronologyFields +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {T : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (newValues : Fin 5 → ZFSet.{u}) (ground : ∀ j, newValues j ∈ M.sets) + +noncomputable def appendTime : GroundChronologyFields M (insert T T) := + GroundChronologyFields.ofGraphs pairing unions (M.insert_mem pairing unions fields.time_ground fields.time_ground) + (fun j => insert (ZFSet.pair T (newValues j)) (fields.graph j)) + (fun j => M.insert_mem pairing unions (M.orderedPair_mem pairing fields.time_ground (ground j)) + (fields.graph_ground j)) + (fun j => (fields.graphFunction j).insert (ZFSet.mem_irrefl T) (newValues j)) + +theorem appendTime_graph (j : Fin 5) : + (fields.appendTime pairing unions newValues ground).graph j = + insert (ZFSet.pair T (newValues j)) (fields.graph j) := rfl + +theorem appendTime_value_at (j : Fin 5) : + (fields.appendTime pairing unions newValues ground).value j T = newValues j := by + apply GroundChronologyFields.value_eq_of_entry + exact ZFSet.mem_insert _ _ + +theorem appendTime_old_entries (j : Fin 5) {s y : ZFSet.{u}} (hs : s ∈ T) : + ZFSet.pair s y ∈ (fields.appendTime pairing unions newValues ground).graph j ↔ + ZFSet.pair s y ∈ fields.graph j := by + rw [appendTime_graph, ZFSet.mem_insert_iff, ZFSet.pair_inj] + constructor + · rintro (⟨rfl, _⟩ | entry) + · exact False.elim (ZFSet.mem_irrefl _ hs) + · exact entry + · exact Or.inr + +theorem appendTime_value_old (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ T) : + (fields.appendTime pairing unions newValues ground).value j s = fields.value j s := by + apply GroundChronologyFields.value_eq_of_entry + exact (fields.appendTime_old_entries pairing unions newValues ground j hs).2 (fields.value_entry j hs) + +theorem appendTime_graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (time : ZFSet.rank T < o) (graphs : ∀ j, ZFSet.rank (fields.graph j) < o) + (values : ∀ j, ZFSet.rank (newValues j) < o) (j : Fin 5) : + ZFSet.rank ((fields.appendTime pairing unions newValues ground).graph j) < o := by + rw [appendTime_graph, ZFSet.rank_insert] + exact max_lt (limit.succ_lt (rank_orderedPair_lt limit time (values j))) (graphs j) + +end PartitionPilot.Forcing.GroundChronologyFields + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyLayerRelation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyLayerRelation.lean index 14199113741d0cbbfd5fea7fa187e96c74ef9ed0..b8efd523558c9b5c21136c861252fc5fc8c79ab0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyLayerRelation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyLayerRelation.lean @@ -1,142 +1,142 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundGrowthLayerRecognition -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace BoundedFormula - -def chronologyLayerPairLookupFormula {n} (p T Qs rs μs births : Fin n) - (v : Fin 6 → Fin n) : BoundedFormula n := - .conj (.mem (v 0) T) (.conj (.mem (v 1) T) - (.conj (disj (.equal (v 1) (v 0)) (.mem (v 1) (v 0))) - (.conj (orderedPairFormula p (v 0) (v 1)) - (.conj (pairMembershipFormula (v 0) (v 2) Qs) - (.conj (pairMembershipFormula (v 0) (v 3) rs) - (.conj (pairMembershipFormula (v 0) (v 4) μs) - (pairMembershipFormula (v 0) (v 5) births))))))) - -theorem truth_chronologyLayerPairLookupFormula {n} (p T Qs rs μs births : Fin n) - (v : Fin 6 → Fin n) (env : Fin n → ZFSet.{u}) : - Truth (chronologyLayerPairLookupFormula p T Qs rs μs births v) env ↔ - env (v 0) ∈ env T ∧ env (v 1) ∈ env T ∧ - (env (v 1) = env (v 0) ∨ env (v 1) ∈ env (v 0)) ∧ - env p = ZFSet.pair (env (v 0)) (env (v 1)) ∧ - ZFSet.pair (env (v 0)) (env (v 2)) ∈ env Qs ∧ - ZFSet.pair (env (v 0)) (env (v 3)) ∈ env rs ∧ - ZFSet.pair (env (v 0)) (env (v 4)) ∈ env μs ∧ - ZFSet.pair (env (v 0)) (env (v 5)) ∈ env births := by - simp only [chronologyLayerPairLookupFormula, Truth, truth_disj, - truth_orderedPairFormula, truth_pairMembershipFormula] -end BoundedFormula - -namespace SetFormula - -def chronologyLayerRelationFormula : SetFormula 8 := - let old := suffixIndex 8 6 - let v := prefixIndex 8 6 - exBlock 6 (.conj - (BoundedFormula.chronologyLayerPairLookupFormula (old 0) (old 2) (old 3) (old 4) (old 5) (old 6) v).toFormula - (growthLayerWitnessFormula (old 1) (old 3) (old 4) (old 5) (v 2) (v 3) (v 4) (v 5) (v 1) (old 7))) -end SetFormula - -namespace GroundChronologyFields -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) - -noncomputable def layerRelationParams (N : ZFSet.{u}) : Fin 6 → ZFSet.{u} := - Fin.cases T (Fin.cases (fields.graph 0) (Fin.cases (fields.graph 1) - (Fin.cases (fields.graph 2) (Fin.cases (fields.graph 3) (fun _ => N))))) - -theorem layerRelationParams_ground {N : ZFSet.{u}} (hN : N ∈ M.sets) : - ∀ i, fields.layerRelationParams N i ∈ M.sets := - Fin.cases fields.time_ground (Fin.cases (fields.graph_ground 0) (Fin.cases (fields.graph_ground 1) - (Fin.cases (fields.graph_ground 2) (Fin.cases (fields.graph_ground 3) (fun _ => hN))))) - -theorem realize_chronologyLayerRelation - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (core : ChronologyCoreCode T fields.bound C D rD fields.graph) - {N z s t : ZFSet.{u}} (hN : N ∈ M.sets) (hz : z ∈ M.sets) - (hs : s ∈ T) (ht : t ∈ T) (earlier : t = s ∨ t ∈ s) : - Realize M.sets chronologyLayerRelationFormula - (extend (ZFSet.pair s t) (extend z (fields.layerRelationParams N))) ↔ - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t N z := by - let env := extend (ZFSet.pair s t) (extend z (fields.layerRelationParams N)) - have members : ∀ i, env i ∈ M.sets := Fin.cases - (M.orderedPair_mem pairing (M.transitive fields.time_ground hs) (M.transitive fields.time_ground ht)) - (Fin.cases hz (fields.layerRelationParams_ground hN)) - rw [chronologyLayerRelationFormula, realize_exBlock] - constructor - · rintro ⟨v, ground, recognized⟩ - have allGround := extendMany_members 6 v env ground members - have lookup := (BoundedFormula.truth_chronologyLayerPairLookupFormula - (suffixIndex 8 6 0) (suffixIndex 8 6 2) (suffixIndex 8 6 3) (suffixIndex 8 6 4) - (suffixIndex 8 6 5) (suffixIndex 8 6 6) (prefixIndex 8 6) (extendMany 6 v env)).1 - ((BoundedFormula.realize_toFormula M _ _ allGround).1 recognized.1) - simp only [extendMany_prefix, extendMany_suffix] at lookup - change v 0 ∈ T ∧ v 1 ∈ T ∧ (v 1 = v 0 ∨ v 1 ∈ v 0) ∧ - ZFSet.pair s t = ZFSet.pair (v 0) (v 1) ∧ - ZFSet.pair (v 0) (v 2) ∈ fields.graph 0 ∧ - ZFSet.pair (v 0) (v 3) ∈ fields.graph 1 ∧ - ZFSet.pair (v 0) (v 4) ∈ fields.graph 2 ∧ - ZFSet.pair (v 0) (v 5) ∈ fields.graph 3 at lookup - have same := ZFSet.pair_inj.1 lookup.2.2.2.1 - have eL := fields.value_eq_of_entry 0 lookup.2.2.2.2.1 - have er := fields.value_eq_of_entry 1 lookup.2.2.2.2.2.1 - have eμ := fields.value_eq_of_entry 2 lookup.2.2.2.2.2.2.1 - have eb := fields.value_eq_of_entry 3 lookup.2.2.2.2.2.2.2 - have meet : MeetOrderCode (v 2) (v 3) (v 4) := - eL ▸ er ▸ eμ ▸ (fields.decoded_point core lookup.1).meet - have liftedMeet : MeetOrderCode - (extendMany 6 v env (prefixIndex 8 6 2)) (extendMany 6 v env (prefixIndex 8 6 3)) - (extendMany 6 v env (prefixIndex 8 6 4)) := by - simpa only [extendMany_prefix] using meet - have witness := (M.realize_growthLayerWitnessFormula unions (suffixIndex 8 6 1) - (suffixIndex 8 6 3) (suffixIndex 8 6 4) (suffixIndex 8 6 5) - (prefixIndex 8 6 2) (prefixIndex 8 6 3) (prefixIndex 8 6 4) (prefixIndex 8 6 5) - (prefixIndex 8 6 1) (suffixIndex 8 6 7) (extendMany 6 v env) allGround liftedMeet).1 recognized.2 - simp only [extendMany_prefix, extendMany_suffix] at witness - change GrowthLayerWitnessCode _ _ _ (v 2) (v 3) (v 4) (v 5) (v 1) N z at witness - rw [← eL, ← er, ← eμ, ← eb, ← same.1, ← same.2] at witness - exact witness - · intro witness - let v : Fin 6 → ZFSet.{u} := Fin.cases s (Fin.cases t (Fin.cases (fields.value 0 s) - (Fin.cases (fields.value 1 s) (Fin.cases (fields.value 2 s) (fun _ => fields.value 3 s))))) - have ground : ∀ i, v i ∈ M.sets := Fin.cases (M.transitive fields.time_ground hs) - (Fin.cases (M.transitive fields.time_ground ht) (Fin.cases (fields.value_ground 0 s) - (Fin.cases (fields.value_ground 1 s) (Fin.cases (fields.value_ground 2 s) (fun _ => fields.value_ground 3 s))))) - have allGround := extendMany_members 6 v env ground members - refine ⟨v, ground, ?_, ?_⟩ - · apply (BoundedFormula.realize_toFormula M _ _ allGround).2 - apply (BoundedFormula.truth_chronologyLayerPairLookupFormula - (suffixIndex 8 6 0) (suffixIndex 8 6 2) (suffixIndex 8 6 3) (suffixIndex 8 6 4) - (suffixIndex 8 6 5) (suffixIndex 8 6 6) (prefixIndex 8 6) (extendMany 6 v env)).2 - simp only [extendMany_prefix, extendMany_suffix] - exact ⟨hs, ht, earlier, rfl, fields.value_entry 0 hs, fields.value_entry 1 hs, - fields.value_entry 2 hs, fields.value_entry 3 hs⟩ - · have liftedMeet : MeetOrderCode - (extendMany 6 v env (prefixIndex 8 6 2)) (extendMany 6 v env (prefixIndex 8 6 3)) - (extendMany 6 v env (prefixIndex 8 6 4)) := by - simp only [extendMany_prefix] - exact (fields.decoded_point core hs).meet - apply (M.realize_growthLayerWitnessFormula unions (suffixIndex 8 6 1) - (suffixIndex 8 6 3) (suffixIndex 8 6 4) (suffixIndex 8 6 5) - (prefixIndex 8 6 2) (prefixIndex 8 6 3) (prefixIndex 8 6 4) (prefixIndex 8 6 5) - (prefixIndex 8 6 1) (suffixIndex 8 6 7) (extendMany 6 v env) allGround liftedMeet).2 - simp only [extendMany_prefix, extendMany_suffix] - exact witness - -end GroundChronologyFields - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundGrowthLayerRecognition +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace BoundedFormula + +def chronologyLayerPairLookupFormula {n} (p T Qs rs μs births : Fin n) + (v : Fin 6 → Fin n) : BoundedFormula n := + .conj (.mem (v 0) T) (.conj (.mem (v 1) T) + (.conj (disj (.equal (v 1) (v 0)) (.mem (v 1) (v 0))) + (.conj (orderedPairFormula p (v 0) (v 1)) + (.conj (pairMembershipFormula (v 0) (v 2) Qs) + (.conj (pairMembershipFormula (v 0) (v 3) rs) + (.conj (pairMembershipFormula (v 0) (v 4) μs) + (pairMembershipFormula (v 0) (v 5) births))))))) + +theorem truth_chronologyLayerPairLookupFormula {n} (p T Qs rs μs births : Fin n) + (v : Fin 6 → Fin n) (env : Fin n → ZFSet.{u}) : + Truth (chronologyLayerPairLookupFormula p T Qs rs μs births v) env ↔ + env (v 0) ∈ env T ∧ env (v 1) ∈ env T ∧ + (env (v 1) = env (v 0) ∨ env (v 1) ∈ env (v 0)) ∧ + env p = ZFSet.pair (env (v 0)) (env (v 1)) ∧ + ZFSet.pair (env (v 0)) (env (v 2)) ∈ env Qs ∧ + ZFSet.pair (env (v 0)) (env (v 3)) ∈ env rs ∧ + ZFSet.pair (env (v 0)) (env (v 4)) ∈ env μs ∧ + ZFSet.pair (env (v 0)) (env (v 5)) ∈ env births := by + simp only [chronologyLayerPairLookupFormula, Truth, truth_disj, + truth_orderedPairFormula, truth_pairMembershipFormula] +end BoundedFormula + +namespace SetFormula + +def chronologyLayerRelationFormula : SetFormula 8 := + let old := suffixIndex 8 6 + let v := prefixIndex 8 6 + exBlock 6 (.conj + (BoundedFormula.chronologyLayerPairLookupFormula (old 0) (old 2) (old 3) (old 4) (old 5) (old 6) v).toFormula + (growthLayerWitnessFormula (old 1) (old 3) (old 4) (old 5) (v 2) (v 3) (v 4) (v 5) (v 1) (old 7))) +end SetFormula + +namespace GroundChronologyFields +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) + +noncomputable def layerRelationParams (N : ZFSet.{u}) : Fin 6 → ZFSet.{u} := + Fin.cases T (Fin.cases (fields.graph 0) (Fin.cases (fields.graph 1) + (Fin.cases (fields.graph 2) (Fin.cases (fields.graph 3) (fun _ => N))))) + +theorem layerRelationParams_ground {N : ZFSet.{u}} (hN : N ∈ M.sets) : + ∀ i, fields.layerRelationParams N i ∈ M.sets := + Fin.cases fields.time_ground (Fin.cases (fields.graph_ground 0) (Fin.cases (fields.graph_ground 1) + (Fin.cases (fields.graph_ground 2) (Fin.cases (fields.graph_ground 3) (fun _ => hN))))) + +theorem realize_chronologyLayerRelation + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (core : ChronologyCoreCode T fields.bound C D rD fields.graph) + {N z s t : ZFSet.{u}} (hN : N ∈ M.sets) (hz : z ∈ M.sets) + (hs : s ∈ T) (ht : t ∈ T) (earlier : t = s ∨ t ∈ s) : + Realize M.sets chronologyLayerRelationFormula + (extend (ZFSet.pair s t) (extend z (fields.layerRelationParams N))) ↔ + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t N z := by + let env := extend (ZFSet.pair s t) (extend z (fields.layerRelationParams N)) + have members : ∀ i, env i ∈ M.sets := Fin.cases + (M.orderedPair_mem pairing (M.transitive fields.time_ground hs) (M.transitive fields.time_ground ht)) + (Fin.cases hz (fields.layerRelationParams_ground hN)) + rw [chronologyLayerRelationFormula, realize_exBlock] + constructor + · rintro ⟨v, ground, recognized⟩ + have allGround := extendMany_members 6 v env ground members + have lookup := (BoundedFormula.truth_chronologyLayerPairLookupFormula + (suffixIndex 8 6 0) (suffixIndex 8 6 2) (suffixIndex 8 6 3) (suffixIndex 8 6 4) + (suffixIndex 8 6 5) (suffixIndex 8 6 6) (prefixIndex 8 6) (extendMany 6 v env)).1 + ((BoundedFormula.realize_toFormula M _ _ allGround).1 recognized.1) + simp only [extendMany_prefix, extendMany_suffix] at lookup + change v 0 ∈ T ∧ v 1 ∈ T ∧ (v 1 = v 0 ∨ v 1 ∈ v 0) ∧ + ZFSet.pair s t = ZFSet.pair (v 0) (v 1) ∧ + ZFSet.pair (v 0) (v 2) ∈ fields.graph 0 ∧ + ZFSet.pair (v 0) (v 3) ∈ fields.graph 1 ∧ + ZFSet.pair (v 0) (v 4) ∈ fields.graph 2 ∧ + ZFSet.pair (v 0) (v 5) ∈ fields.graph 3 at lookup + have same := ZFSet.pair_inj.1 lookup.2.2.2.1 + have eL := fields.value_eq_of_entry 0 lookup.2.2.2.2.1 + have er := fields.value_eq_of_entry 1 lookup.2.2.2.2.2.1 + have eμ := fields.value_eq_of_entry 2 lookup.2.2.2.2.2.2.1 + have eb := fields.value_eq_of_entry 3 lookup.2.2.2.2.2.2.2 + have meet : MeetOrderCode (v 2) (v 3) (v 4) := + eL ▸ er ▸ eμ ▸ (fields.decoded_point core lookup.1).meet + have liftedMeet : MeetOrderCode + (extendMany 6 v env (prefixIndex 8 6 2)) (extendMany 6 v env (prefixIndex 8 6 3)) + (extendMany 6 v env (prefixIndex 8 6 4)) := by + simpa only [extendMany_prefix] using meet + have witness := (M.realize_growthLayerWitnessFormula unions (suffixIndex 8 6 1) + (suffixIndex 8 6 3) (suffixIndex 8 6 4) (suffixIndex 8 6 5) + (prefixIndex 8 6 2) (prefixIndex 8 6 3) (prefixIndex 8 6 4) (prefixIndex 8 6 5) + (prefixIndex 8 6 1) (suffixIndex 8 6 7) (extendMany 6 v env) allGround liftedMeet).1 recognized.2 + simp only [extendMany_prefix, extendMany_suffix] at witness + change GrowthLayerWitnessCode _ _ _ (v 2) (v 3) (v 4) (v 5) (v 1) N z at witness + rw [← eL, ← er, ← eμ, ← eb, ← same.1, ← same.2] at witness + exact witness + · intro witness + let v : Fin 6 → ZFSet.{u} := Fin.cases s (Fin.cases t (Fin.cases (fields.value 0 s) + (Fin.cases (fields.value 1 s) (Fin.cases (fields.value 2 s) (fun _ => fields.value 3 s))))) + have ground : ∀ i, v i ∈ M.sets := Fin.cases (M.transitive fields.time_ground hs) + (Fin.cases (M.transitive fields.time_ground ht) (Fin.cases (fields.value_ground 0 s) + (Fin.cases (fields.value_ground 1 s) (Fin.cases (fields.value_ground 2 s) (fun _ => fields.value_ground 3 s))))) + have allGround := extendMany_members 6 v env ground members + refine ⟨v, ground, ?_, ?_⟩ + · apply (BoundedFormula.realize_toFormula M _ _ allGround).2 + apply (BoundedFormula.truth_chronologyLayerPairLookupFormula + (suffixIndex 8 6 0) (suffixIndex 8 6 2) (suffixIndex 8 6 3) (suffixIndex 8 6 4) + (suffixIndex 8 6 5) (suffixIndex 8 6 6) (prefixIndex 8 6) (extendMany 6 v env)).2 + simp only [extendMany_prefix, extendMany_suffix] + exact ⟨hs, ht, earlier, rfl, fields.value_entry 0 hs, fields.value_entry 1 hs, + fields.value_entry 2 hs, fields.value_entry 3 hs⟩ + · have liftedMeet : MeetOrderCode + (extendMany 6 v env (prefixIndex 8 6 2)) (extendMany 6 v env (prefixIndex 8 6 3)) + (extendMany 6 v env (prefixIndex 8 6 4)) := by + simp only [extendMany_prefix] + exact (fields.decoded_point core hs).meet + apply (M.realize_growthLayerWitnessFormula unions (suffixIndex 8 6 1) + (suffixIndex 8 6 3) (suffixIndex 8 6 4) (suffixIndex 8 6 5) + (prefixIndex 8 6 2) (prefixIndex 8 6 3) (prefixIndex 8 6 4) (prefixIndex 8 6 5) + (prefixIndex 8 6 1) (suffixIndex 8 6 7) (extendMany 6 v env) allGround liftedMeet).2 + simp only [extendMany_prefix, extendMany_suffix] + exact witness + +end GroundChronologyFields + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairRanks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairRanks.lean index 49ab7dd117c6a218b79946aaf88332e9c5d3d244..b099423743409bd4f3c6f4b313bc249704ba463f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairRanks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairRanks.lean @@ -1,95 +1,95 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowRelationSpaces -import OAI.SetTheory.PartitionPrinciple.Definability.GroundLowRankFunctionGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundInaccessibleConditions -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) -include conditions pairing unions powers separation collection infinite hK - -theorem functionGraphOn_rank_lt_small {I f : ZFSet.{u}} - (hI : I ∈ M.sets) (small : GroundBelow M I K) - (inputs : ∀ i ∈ I, ZFSet.rank i < ZFSet.rank K) - (hf : f ∈ M.sets) (function : FunctionGraphOn I f) - (values : ∀ i ∈ I, ∀ v, ZFSet.pair i v ∈ f → ZFSet.rank v < ZFSet.rank K) : - ZFSet.rank f < ZFSet.rank K := by - have smallF := small.functionGraphOn pairing unions powers separation hI hf hK function - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - apply conditions.2.2.1.rank_lt_of_small pairing unions powers separation collection - hf hK conditions.1 smallF - intro z hz - obtain ⟨i, hi, v, rfl⟩ := function.shape z hz - exact rank_orderedPair_lt limit (inputs i hi) (values i hi v hz) - -theorem functionGraph_rank_lt_small_cumulative {I V f : ZFSet.{u}} - (hI : I ∈ M.sets) (small : GroundBelow M I K) - (inputs : ∀ i ∈ I, ZFSet.rank i < ZFSet.rank K) - (hf : f ∈ M.sets) (function : ZFSet.IsFunc I V f) - (level : ∀ x, x ∈ V ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank K) : - ZFSet.rank f < ZFSet.rank K := by - apply conditions.functionGraphOn_rank_lt_small pairing unions powers separation collection - infinite hK hI small inputs hf ⟨V, function⟩ - intro i _ v entry - exact ((level v).1 (ZFSet.pair_mem_prod.1 (function.1 entry)).2).2 - -theorem functionGraph_rank_lt_small_hierarchy {I V H f : ZFSet.{u}} - (hI : I ∈ M.sets) (small : GroundBelow M I K) - (inputs : ∀ i ∈ I, ZFSet.rank i < ZFSet.rank K) - (hf : f ∈ M.sets) (function : ZFSet.IsFunc I V f) - (hierarchy : GroundCumulativeHierarchyCode M (insert K K) H) - (level : ZFSet.pair K V ∈ H) : ZFSet.rank f < ZFSet.rank K := - conditions.functionGraph_rank_lt_small_cumulative pairing unions powers separation collection - infinite hK hI small inputs hf function - (hierarchy.mem_iff_rank_lt (ordinalSetProperty_succ conditions.1) - (ZFSet.mem_insert K K) level) - -end PartitionPilot.Forcing.GroundInaccessibleConditions - - - -namespace PartitionPilot.Forcing.GroundInaccessibleConditions -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K T : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) -variable (hK : K ∈ M.sets) (hT : T ∈ K) -include conditions pairing unions powers separation hK hT - -theorem chronologyPairs_below : GroundBelow M (chronologyPairs T) K := by - have hTM := M.transitive hK hT - have smallT := GroundBelow.of_member pairing unions powers separation hK hT - have smallProduct := smallT.product pairing unions powers separation hTM hTM hK - conditions.1 conditions.2.2.2 smallT - exact smallProduct.restrict separation - (M.chronologyPairs_mem pairing unions powers separation hTM) hK (chronologyPairs_subset T) - -theorem chronologyPairs_rank_lt (infinite : Realize M.sets infinity Fin.elim0) : - ZFSet.rank (chronologyPairs T) < ZFSet.rank K := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - exact (ZFSet.rank_mono (chronologyPairs_subset T)).trans_lt - (rank_product_lt limit (ZFSet.rank_lt_of_mem hT) (ZFSet.rank_lt_of_mem hT)) - -theorem chronologyPairs_member_rank_lt (infinite : Realize M.sets infinity Fin.elim0) - {p : ZFSet.{u}} (hp : p ∈ chronologyPairs T) : ZFSet.rank p < ZFSet.rank K := - (ZFSet.rank_lt_of_mem hp).trans - (conditions.chronologyPairs_rank_lt pairing unions powers separation hK hT infinite) - -end PartitionPilot.Forcing.GroundInaccessibleConditions - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowRelationSpaces +import OAI.SetTheory.PartitionPrinciple.Definability.GroundLowRankFunctionGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundInaccessibleConditions +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) +include conditions pairing unions powers separation collection infinite hK + +theorem functionGraphOn_rank_lt_small {I f : ZFSet.{u}} + (hI : I ∈ M.sets) (small : GroundBelow M I K) + (inputs : ∀ i ∈ I, ZFSet.rank i < ZFSet.rank K) + (hf : f ∈ M.sets) (function : FunctionGraphOn I f) + (values : ∀ i ∈ I, ∀ v, ZFSet.pair i v ∈ f → ZFSet.rank v < ZFSet.rank K) : + ZFSet.rank f < ZFSet.rank K := by + have smallF := small.functionGraphOn pairing unions powers separation hI hf hK function + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + apply conditions.2.2.1.rank_lt_of_small pairing unions powers separation collection + hf hK conditions.1 smallF + intro z hz + obtain ⟨i, hi, v, rfl⟩ := function.shape z hz + exact rank_orderedPair_lt limit (inputs i hi) (values i hi v hz) + +theorem functionGraph_rank_lt_small_cumulative {I V f : ZFSet.{u}} + (hI : I ∈ M.sets) (small : GroundBelow M I K) + (inputs : ∀ i ∈ I, ZFSet.rank i < ZFSet.rank K) + (hf : f ∈ M.sets) (function : ZFSet.IsFunc I V f) + (level : ∀ x, x ∈ V ↔ x ∈ M.sets ∧ ZFSet.rank x < ZFSet.rank K) : + ZFSet.rank f < ZFSet.rank K := by + apply conditions.functionGraphOn_rank_lt_small pairing unions powers separation collection + infinite hK hI small inputs hf ⟨V, function⟩ + intro i _ v entry + exact ((level v).1 (ZFSet.pair_mem_prod.1 (function.1 entry)).2).2 + +theorem functionGraph_rank_lt_small_hierarchy {I V H f : ZFSet.{u}} + (hI : I ∈ M.sets) (small : GroundBelow M I K) + (inputs : ∀ i ∈ I, ZFSet.rank i < ZFSet.rank K) + (hf : f ∈ M.sets) (function : ZFSet.IsFunc I V f) + (hierarchy : GroundCumulativeHierarchyCode M (insert K K) H) + (level : ZFSet.pair K V ∈ H) : ZFSet.rank f < ZFSet.rank K := + conditions.functionGraph_rank_lt_small_cumulative pairing unions powers separation collection + infinite hK hI small inputs hf function + (hierarchy.mem_iff_rank_lt (ordinalSetProperty_succ conditions.1) + (ZFSet.mem_insert K K) level) + +end PartitionPilot.Forcing.GroundInaccessibleConditions + + + +namespace PartitionPilot.Forcing.GroundInaccessibleConditions +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K T : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) +variable (hK : K ∈ M.sets) (hT : T ∈ K) +include conditions pairing unions powers separation hK hT + +theorem chronologyPairs_below : GroundBelow M (chronologyPairs T) K := by + have hTM := M.transitive hK hT + have smallT := GroundBelow.of_member pairing unions powers separation hK hT + have smallProduct := smallT.product pairing unions powers separation hTM hTM hK + conditions.1 conditions.2.2.2 smallT + exact smallProduct.restrict separation + (M.chronologyPairs_mem pairing unions powers separation hTM) hK (chronologyPairs_subset T) + +theorem chronologyPairs_rank_lt (infinite : Realize M.sets infinity Fin.elim0) : + ZFSet.rank (chronologyPairs T) < ZFSet.rank K := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + exact (ZFSet.rank_mono (chronologyPairs_subset T)).trans_lt + (rank_product_lt limit (ZFSet.rank_lt_of_mem hT) (ZFSet.rank_lt_of_mem hT)) + +theorem chronologyPairs_member_rank_lt (infinite : Realize M.sets infinity Fin.elim0) + {p : ZFSet.{u}} (hp : p ∈ chronologyPairs T) : ZFSet.rank p < ZFSet.rank K := + (ZFSet.rank_lt_of_mem hp).trans + (conditions.chronologyPairs_rank_lt pairing unions powers separation hK hT infinite) + +end PartitionPilot.Forcing.GroundInaccessibleConditions + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairs.lean index a92ef135efa28f812aa3bac74287c2a0e24f04cc..b120a03a04d78ffff6ffcd8a4d6d3a0a6a80a7fc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundChronologyPairs.lean @@ -1,133 +1,133 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -noncomputable def chronologyPairs (T : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ s ∈ T, ∃ t ∈ T, - z = ZFSet.pair s t ∧ (t = s ∨ t ∈ s)) (ZFSet.prod T T) - -theorem mem_chronologyPairs (T z : ZFSet.{u}) : - z ∈ chronologyPairs T ↔ ∃ s ∈ T, ∃ t ∈ T, - z = ZFSet.pair s t ∧ (t = s ∨ t ∈ s) := by - rw [chronologyPairs, ZFSet.mem_sep] - constructor - · exact And.right - · rintro ⟨s, hs, t, ht, equal, before⟩ - exact ⟨equal.symm ▸ ZFSet.pair_mem_prod.2 ⟨hs, ht⟩, s, hs, t, ht, equal, before⟩ - -theorem pair_mem_chronologyPairs (T s t : ZFSet.{u}) : - ZFSet.pair s t ∈ chronologyPairs T ↔ s ∈ T ∧ t ∈ T ∧ (t = s ∨ t ∈ s) := by - rw [mem_chronologyPairs] - constructor - · rintro ⟨a, ha, b, hb, equal, before⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨ha, hb, before⟩ - · rintro ⟨hs, ht, before⟩ - exact ⟨s, hs, t, ht, rfl, before⟩ - -theorem chronologyPairs_subset (T : ZFSet.{u}) : chronologyPairs T ⊆ ZFSet.prod T T := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem chronologyPairs_mono {S T : ZFSet.{u}} (subset : S ⊆ T) : - chronologyPairs S ⊆ chronologyPairs T := by - intro z hz - obtain ⟨s, hs, t, ht, rfl, before⟩ := (mem_chronologyPairs S z).1 hz - exact (pair_mem_chronologyPairs T s t).2 ⟨subset hs, subset ht, before⟩ - -theorem chronologyPairs_restrict {S T : ZFSet.{u}} - (subset : S ⊆ T) (transitive : setTransitive S) : - chronologyPairs S = graphRestriction S (chronologyPairs T) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨s, hs, t, ht, rfl, before⟩ := (mem_chronologyPairs S z).1 hz - exact pair_mem_graphRestriction.2 - ⟨(pair_mem_chronologyPairs T s t).2 ⟨subset hs, subset ht, before⟩, hs⟩ - · intro hz - obtain ⟨s, hs, t, rfl, entry⟩ := mem_graphRestriction.1 hz - obtain ⟨_, _, before⟩ := (pair_mem_chronologyPairs T s t).1 entry - have ht : t ∈ S := before.elim (fun equal => equal.symm ▸ hs) - (fun earlier => transitive s hs t earlier) - exact (pair_mem_chronologyPairs S s t).2 ⟨hs, ht, before⟩ - -namespace BoundedFormula - -def chronologyPairFormula {n} (z T : Fin n) : BoundedFormula n := - exMem T (exMem T.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (disj (.equal 0 1) (.mem 0 1)))) - -theorem truth_chronologyPairFormula {n} (z T : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (chronologyPairFormula z T) env ↔ env z ∈ chronologyPairs (env T) := by - simp only [chronologyPairFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_disj, mem_chronologyPairs] - rfl - -def chronologyPairsEquationFormula {n} (J T : Fin n) : BoundedFormula n := - .conj (.allMem J (chronologyPairFormula 0 T.succ)) - (.allMem T (.allMem T.succ (imp (disj (.equal 0 1) (.mem 0 1)) - (pairMembershipFormula 1 0 J.succ.succ)))) - -theorem truth_chronologyPairsEquationFormula {n} (J T : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (chronologyPairsEquationFormula J T) env ↔ env J = chronologyPairs (env T) := by - simp only [chronologyPairsEquationFormula, Truth, truth_chronologyPairFormula, - truth_imp, truth_disj, truth_pairMembershipFormula] - change ((∀ z ∈ env J, z ∈ chronologyPairs (env T)) ∧ - ∀ s ∈ env T, ∀ t ∈ env T, (t = s ∨ t ∈ s) → ZFSet.pair s t ∈ env J) ↔ _ - constructor - · rintro ⟨subset, cover⟩ - apply ZFSet.ext - intro z - refine ⟨subset z, ?_⟩ - intro hz - obtain ⟨s, hs, t, ht, rfl, before⟩ := (mem_chronologyPairs (env T) z).1 hz - exact cover s hs t ht before - · intro equal - rw [equal] - exact ⟨fun _ hz => hz, fun s hs t ht before => - (pair_mem_chronologyPairs (env T) s t).2 ⟨hs, ht, before⟩⟩ - -theorem realize_chronologyPairFormula (M : TransitiveGround.{u}) {n} - (z T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (chronologyPairFormula z T).toFormula env ↔ env z ∈ chronologyPairs (env T) := - (realize_toFormula M _ env members).trans (truth_chronologyPairFormula z T env) - -theorem realize_chronologyPairsEquationFormula (M : TransitiveGround.{u}) {n} - (J T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (chronologyPairsEquationFormula J T).toFormula env ↔ env J = chronologyPairs (env T) := - (realize_toFormula M _ env members).trans (truth_chronologyPairsEquationFormula J T env) - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem chronologyPairs_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) : chronologyPairs T ∈ M.sets := by - let params := extend T Fin.elim0 - have ground := M.bounded_separation_mem separation (BoundedFormula.chronologyPairFormula 0 1) - params (Fin.cases hT (fun i => Fin.elim0 i)) (M.prod_mem pairing unions powers separation hT hT) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.chronologyPairFormula 0 1) - (extend z params)) (ZFSet.prod T T) = chronologyPairs T := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_chronologyPairFormula] - exact ⟨And.right, fun hz => ⟨chronologyPairs_subset T hz, hz⟩⟩ - exact equal ▸ ground - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +noncomputable def chronologyPairs (T : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ s ∈ T, ∃ t ∈ T, + z = ZFSet.pair s t ∧ (t = s ∨ t ∈ s)) (ZFSet.prod T T) + +theorem mem_chronologyPairs (T z : ZFSet.{u}) : + z ∈ chronologyPairs T ↔ ∃ s ∈ T, ∃ t ∈ T, + z = ZFSet.pair s t ∧ (t = s ∨ t ∈ s) := by + rw [chronologyPairs, ZFSet.mem_sep] + constructor + · exact And.right + · rintro ⟨s, hs, t, ht, equal, before⟩ + exact ⟨equal.symm ▸ ZFSet.pair_mem_prod.2 ⟨hs, ht⟩, s, hs, t, ht, equal, before⟩ + +theorem pair_mem_chronologyPairs (T s t : ZFSet.{u}) : + ZFSet.pair s t ∈ chronologyPairs T ↔ s ∈ T ∧ t ∈ T ∧ (t = s ∨ t ∈ s) := by + rw [mem_chronologyPairs] + constructor + · rintro ⟨a, ha, b, hb, equal, before⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨ha, hb, before⟩ + · rintro ⟨hs, ht, before⟩ + exact ⟨s, hs, t, ht, rfl, before⟩ + +theorem chronologyPairs_subset (T : ZFSet.{u}) : chronologyPairs T ⊆ ZFSet.prod T T := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem chronologyPairs_mono {S T : ZFSet.{u}} (subset : S ⊆ T) : + chronologyPairs S ⊆ chronologyPairs T := by + intro z hz + obtain ⟨s, hs, t, ht, rfl, before⟩ := (mem_chronologyPairs S z).1 hz + exact (pair_mem_chronologyPairs T s t).2 ⟨subset hs, subset ht, before⟩ + +theorem chronologyPairs_restrict {S T : ZFSet.{u}} + (subset : S ⊆ T) (transitive : setTransitive S) : + chronologyPairs S = graphRestriction S (chronologyPairs T) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨s, hs, t, ht, rfl, before⟩ := (mem_chronologyPairs S z).1 hz + exact pair_mem_graphRestriction.2 + ⟨(pair_mem_chronologyPairs T s t).2 ⟨subset hs, subset ht, before⟩, hs⟩ + · intro hz + obtain ⟨s, hs, t, rfl, entry⟩ := mem_graphRestriction.1 hz + obtain ⟨_, _, before⟩ := (pair_mem_chronologyPairs T s t).1 entry + have ht : t ∈ S := before.elim (fun equal => equal.symm ▸ hs) + (fun earlier => transitive s hs t earlier) + exact (pair_mem_chronologyPairs S s t).2 ⟨hs, ht, before⟩ + +namespace BoundedFormula + +def chronologyPairFormula {n} (z T : Fin n) : BoundedFormula n := + exMem T (exMem T.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (disj (.equal 0 1) (.mem 0 1)))) + +theorem truth_chronologyPairFormula {n} (z T : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (chronologyPairFormula z T) env ↔ env z ∈ chronologyPairs (env T) := by + simp only [chronologyPairFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_disj, mem_chronologyPairs] + rfl + +def chronologyPairsEquationFormula {n} (J T : Fin n) : BoundedFormula n := + .conj (.allMem J (chronologyPairFormula 0 T.succ)) + (.allMem T (.allMem T.succ (imp (disj (.equal 0 1) (.mem 0 1)) + (pairMembershipFormula 1 0 J.succ.succ)))) + +theorem truth_chronologyPairsEquationFormula {n} (J T : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (chronologyPairsEquationFormula J T) env ↔ env J = chronologyPairs (env T) := by + simp only [chronologyPairsEquationFormula, Truth, truth_chronologyPairFormula, + truth_imp, truth_disj, truth_pairMembershipFormula] + change ((∀ z ∈ env J, z ∈ chronologyPairs (env T)) ∧ + ∀ s ∈ env T, ∀ t ∈ env T, (t = s ∨ t ∈ s) → ZFSet.pair s t ∈ env J) ↔ _ + constructor + · rintro ⟨subset, cover⟩ + apply ZFSet.ext + intro z + refine ⟨subset z, ?_⟩ + intro hz + obtain ⟨s, hs, t, ht, rfl, before⟩ := (mem_chronologyPairs (env T) z).1 hz + exact cover s hs t ht before + · intro equal + rw [equal] + exact ⟨fun _ hz => hz, fun s hs t ht before => + (pair_mem_chronologyPairs (env T) s t).2 ⟨hs, ht, before⟩⟩ + +theorem realize_chronologyPairFormula (M : TransitiveGround.{u}) {n} + (z T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (chronologyPairFormula z T).toFormula env ↔ env z ∈ chronologyPairs (env T) := + (realize_toFormula M _ env members).trans (truth_chronologyPairFormula z T env) + +theorem realize_chronologyPairsEquationFormula (M : TransitiveGround.{u}) {n} + (J T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (chronologyPairsEquationFormula J T).toFormula env ↔ env J = chronologyPairs (env T) := + (realize_toFormula M _ env members).trans (truth_chronologyPairsEquationFormula J T env) + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem chronologyPairs_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) : chronologyPairs T ∈ M.sets := by + let params := extend T Fin.elim0 + have ground := M.bounded_separation_mem separation (BoundedFormula.chronologyPairFormula 0 1) + params (Fin.cases hT (fun i => Fin.elim0 i)) (M.prod_mem pairing unions powers separation hT hT) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.chronologyPairFormula 0 1) + (extend z params)) (ZFSet.prod T T) = chronologyPairs T := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_chronologyPairFormula] + exact ⟨And.right, fun hz => ⟨chronologyPairs_subset T hz, hz⟩⟩ + exact equal ▸ ground + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCoinitialOperations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCoinitialOperations.lean index e7d97622484b92313fde6d3216f55eb597fa4355..b2fbd3f76bf14b5727868aee3312ce8e8717b12c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCoinitialOperations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCoinitialOperations.lean @@ -1,333 +1,333 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableRelationSelections - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -universe u - -def CoinitialBelowCode (order F target B : ZFSet.{u}) : Prop := - B ⊆ F ∧ ∀ x ∈ target, ∃ b ∈ B, ZFSet.pair b x ∈ order - -namespace BoundedFormula - -open SetFormula - -def coinitialBelowFormula {n} (order F target B : Fin n) : BoundedFormula n := - .conj (.allMem B (.mem 0 F.succ)) - (.allMem target (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ))) - -theorem truth_coinitialBelowFormula {n} (order F target B : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (coinitialBelowFormula order F target B) env ↔ - CoinitialBelowCode (env order) (env F) (env target) (env B) := by - simp only [coinitialBelowFormula, Truth, truth_exMem, truth_pairMembershipFormula] - rfl - -theorem realize_coinitialBelowFormula (M : TransitiveGround.{u}) {n} - (order F target B : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (coinitialBelowFormula order F target B).toFormula env ↔ - CoinitialBelowCode (env order) (env F) (env target) (env B) := - (realize_toFormula M _ env members).trans - (truth_coinitialBelowFormula order F target B env) - -end BoundedFormula - -namespace TransitiveGround - -def InternalCountableBelow (M : TransitiveGround.{u}) (order F target : ZFSet.{u}) : Prop := - ∃ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega ∧ CoinitialBelowCode order F target B - -end TransitiveGround - - - - - - -noncomputable def copyPullback (A L e F : ZFSet.{u}) : ZFSet.{u} := - relationImage F A (relationConverse A L e) - -theorem mem_copyPullback (A L e F x : ZFSet.{u}) : - x ∈ copyPullback A L e F ↔ - x ∈ A ∧ ∃ y ∈ F, y ∈ L ∧ ZFSet.pair x y ∈ e := by - rw [copyPullback, mem_relationImage] - constructor - · rintro ⟨hx, y, hy, rel⟩ - exact ⟨hx, y, hy, ((pair_mem_relationConverse A L e x y).1 rel).2⟩ - · rintro ⟨hx, y, hy, hyL, rel⟩ - exact ⟨hx, y, hy, (pair_mem_relationConverse A L e x y).2 ⟨hx, hyL, rel⟩⟩ - -theorem relationImage_copyPullback {A L e : ZFSet.{u}} - (func : ZFSet.IsFunc A L e) (F : ZFSet.{u}) : - relationImage (copyPullback A L e F) L e = F ∩ relationImage A L e := by - apply ZFSet.ext - intro y - rw [mem_relationImage, ZFSet.mem_inter, mem_relationImage] - constructor - · rintro ⟨hy, x, hx, rel⟩ - obtain ⟨hxA, z, hz, _, relz⟩ := (mem_copyPullback A L e F x).1 hx - obtain ⟨w, _, unique⟩ := func.2 x hxA - have equal : y = z := (unique y rel).trans (unique z relz).symm - exact ⟨equal ▸ hz, hy, x, hxA, rel⟩ - · rintro ⟨hyF, hy, x, hx, rel⟩ - exact ⟨hy, x, (mem_copyPullback A L e F x).2 ⟨hx, y, hyF, hy, rel⟩, rel⟩ - -theorem CoinitialBelowCode.copy {A L e sourceOrder targetOrder F target B : ZFSet.{u}} - (func : ZFSet.IsFunc A L e) - (monotone : ∀ x y x' y', ZFSet.pair x y ∈ sourceOrder → - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ targetOrder) - (basis : CoinitialBelowCode sourceOrder (copyPullback A L e F) target B) : - CoinitialBelowCode targetOrder F (relationImage target L e) (relationImage B L e) := by - refine ⟨?_, ?_⟩ - · intro y hy - obtain ⟨_, x, hx, rel⟩ := (mem_relationImage B L e y).1 hy - obtain ⟨hxA, z, hz, _, relz⟩ := (mem_copyPullback A L e F x).1 (basis.1 hx) - obtain ⟨w, _, unique⟩ := func.2 x hxA - exact (unique y rel).trans (unique z relz).symm ▸ hz - · intro y hy - obtain ⟨_, x, hx, rel⟩ := (mem_relationImage target L e y).1 hy - obtain ⟨b, hb, below⟩ := basis.2 x hx - have hbA := ((mem_copyPullback A L e F b).1 (basis.1 hb)).1 - obtain ⟨b', relb, _⟩ := func.2 b hbA - have hbL := (ZFSet.pair_mem_prod.1 (func.1 relb)).2 - exact ⟨b', (mem_relationImage B L e b').2 ⟨hbL, b, hb, relb⟩, - monotone b x b' y below relb rel⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem copyPullback_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A L e F : ZFSet.{u}} (hA : A ∈ M.sets) (hL : L ∈ M.sets) - (he : e ∈ M.sets) (hF : F ∈ M.sets) : copyPullback A L e F ∈ M.sets := - M.relationImage_mem separation hF hA - (M.relationConverse_mem pairing unions powers separation hA hL he) - -theorem internalCountableBelow_copy - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A L e sourceOrder targetOrder F target : ZFSet.{u}} - (hL : L ∈ M.sets) (he : e ∈ M.sets) (code : InjectionCode A L e) - (monotone : ∀ x y x' y', ZFSet.pair x y ∈ sourceOrder → - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ targetOrder) - (basis : M.InternalCountableBelow sourceOrder (copyPullback A L e F) target) : - M.InternalCountableBelow targetOrder F (relationImage target L e) := by - obtain ⟨B, hB, small, coinitial⟩ := basis - have subset : B ⊆ A := fun x hx => ((mem_copyPullback A L e F x).1 (coinitial.1 hx)).1 - exact ⟨relationImage B L e, M.relationImage_mem separation hB hL he, - M.groundEmbeddable_image pairing unions powers separation hB hL - (M.omega_mem separation infinite) he code subset small, - coinitial.copy code.function monotone⟩ - -theorem internalCountableBelow_copy_pullback - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A L e sourceOrder targetOrder F : ZFSet.{u}} - (hL : L ∈ M.sets) (he : e ∈ M.sets) (code : InjectionCode A L e) - (monotone : ∀ x y x' y', ZFSet.pair x y ∈ sourceOrder → - ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ targetOrder) - (basis : M.InternalCountableBelow sourceOrder (copyPullback A L e F) - (copyPullback A L e F)) : - M.InternalCountableBelow targetOrder F (F ∩ relationImage A L e) := by - rw [← relationImage_copyPullback code.function F] - exact M.internalCountableBelow_copy pairing unions powers separation infinite hL he code monotone basis - -end TransitiveGround - - - - - - -def FiberCoveredCode (order target parts i B : ZFSet.{u}) : Prop := - ∀ x ∈ target, ZFSet.pair i x ∈ parts → ∃ b ∈ B, ZFSet.pair b x ∈ order - -noncomputable def basisChoiceRelation (I W order target parts : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ I, ∃ B ∈ W, z = ZFSet.pair i B ∧ - FiberCoveredCode order target parts i B) (ZFSet.prod I W) - -theorem pair_mem_basisChoiceRelation (I W order target parts i B : ZFSet.{u}) : - ZFSet.pair i B ∈ basisChoiceRelation I W order target parts ↔ - i ∈ I ∧ B ∈ W ∧ FiberCoveredCode order target parts i B := by - rw [basisChoiceRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, j, hj, A, hA, eq, covers⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hj, hA, covers⟩ - · rintro ⟨hi, hB, covers⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hB⟩, i, hi, B, hB, rfl, covers⟩ - -namespace BoundedFormula - -open SetFormula - -def fiberCoveredFormula {n} (order target parts i B : Fin n) : BoundedFormula n := - .allMem target (imp (pairMembershipFormula i.succ 0 parts.succ) - (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ))) - -theorem truth_fiberCoveredFormula {n} (order target parts i B : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (fiberCoveredFormula order target parts i B) env ↔ - FiberCoveredCode (env order) (env target) (env parts) (env i) (env B) := by - simp only [fiberCoveredFormula, Truth, truth_imp, truth_exMem, truth_pairMembershipFormula] - rfl - -def basisChoiceEntryFormula {n} (z I W order target parts : Fin n) : BoundedFormula n := - exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (fiberCoveredFormula order.succ.succ target.succ.succ parts.succ.succ 1 0))) - -theorem truth_basisChoiceEntryFormula {n} (z I W order target parts : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (basisChoiceEntryFormula z I W order target parts) env ↔ - ∃ i ∈ env I, ∃ B ∈ env W, env z = ZFSet.pair i B ∧ - FiberCoveredCode (env order) (env target) (env parts) i B := by - simp only [basisChoiceEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_fiberCoveredFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem basisChoiceRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I W order target parts : ZFSet.{u}} (hI : I ∈ M.sets) (hW : W ∈ M.sets) - (hOrder : order ∈ M.sets) (hTarget : target ∈ M.sets) (hParts : parts ∈ M.sets) : - basisChoiceRelation I W order target parts ∈ M.sets := by - let params := extend I (extend W (extend order (extend target (extend parts Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.basisChoiceEntryFormula 0 1 2 3 4 5) params - (Fin.cases hI (Fin.cases hW (Fin.cases hOrder (Fin.cases hTarget (Fin.cases hParts - (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hI hW) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.basisChoiceEntryFormula 0 1 2 3 4 5) (extend z params)) (ZFSet.prod I W) = - basisChoiceRelation I W order target parts := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, basisChoiceRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_basisChoiceEntryFormula 0 1 2 3 4 5 _) - exact eq ▸ selected - -theorem internalCountableBelow_indexed_union - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {I order F target parts : ZFSet.{u}} (hI : I ∈ M.sets) (hOrder : order ∈ M.sets) - (hF : F ∈ M.sets) (hTarget : target ∈ M.sets) (hParts : parts ∈ M.sets) - (smallI : M.groundEmbeddable I ZFSet.omega) - (cover : ∀ x ∈ target, ∃ i ∈ I, ZFSet.pair i x ∈ parts) - (localBases : ∀ i ∈ I, M.InternalCountableBelow order F (relationFiber target parts i)) : - M.InternalCountableBelow order F target := by - have hO := M.omega_mem separation infinite - let W := M.groundSmallSubsets F ZFSet.omega - have hW : W ∈ M.sets := M.groundSmallSubsets_mem powers separation hF hO - have choices := M.basisChoiceRelation_mem pairing unions powers separation hI hW hOrder hTarget hParts - have total (i : ZFSet.{u}) (hi : i ∈ I) : - ∃ B ∈ W, ZFSet.pair i B ∈ basisChoiceRelation I W order target parts := by - obtain ⟨B, hB, smallB, positive, below⟩ := localBases i hi - have hBW : B ∈ W := (M.mem_groundSmallSubsets F ZFSet.omega B).2 ⟨hB, positive, smallB⟩ - exact ⟨B, hBW, (pair_mem_basisChoiceRelation I W order target parts i B).2 - ⟨hi, hBW, fun x hx rel => below x ((mem_relationFiber target parts i x).2 ⟨hx, rel⟩)⟩⟩ - obtain ⟨g, hg, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice - hI hW choices total - let family := relationImage I W g - have hFamily : family ∈ M.sets := M.relationImage_mem separation hI hW hg - have smallFamily : M.groundEmbeddable family ZFSet.omega := - M.groundEmbeddable_function_image pairing unions powers separation choice hI hW hO hg func smallI - have candidates (B : ZFSet.{u}) (hB : B ∈ family) : B ∈ W := - ((mem_relationImage I W g B).1 hB).1 - have smallBasis (B : ZFSet.{u}) (hB : B ∈ family) : M.groundEmbeddable B ZFSet.omega := - ((M.mem_groundSmallSubsets F ZFSet.omega B).1 (candidates B hB)).2.2 - refine ⟨family.sUnion, M.union_mem unions hFamily, - M.groundCountable_family_union pairing unions powers separation infinite choice - hFamily smallFamily smallBasis, ?_, ?_⟩ - · intro x hx - obtain ⟨B, hB, xB⟩ := ZFSet.mem_sUnion.1 hx - exact ((M.mem_groundSmallSubsets F ZFSet.omega B).1 (candidates B hB)).2.1 xB - · intro x hx - obtain ⟨i, hi, ix⟩ := cover x hx - obtain ⟨B, chosen, _⟩ := func.2 i hi - have spec := (pair_mem_basisChoiceRelation I W order target parts i B).1 (selected chosen) - obtain ⟨b, hb, lower⟩ := spec.2.2 x hx ix - have hB : B ∈ family := (mem_relationImage I W g B).2 ⟨spec.2.1, i, hi, chosen⟩ - exact ⟨b, ZFSet.mem_sUnion.2 ⟨B, hB, hb⟩, lower⟩ - -end TransitiveGround - -end - - - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem InternalCountableBelow.mono {order F target smaller : ZFSet.{u}} - (basis : M.InternalCountableBelow order F target) (subset : smaller ⊆ target) : - M.InternalCountableBelow order F smaller := by - obtain ⟨B, hB, small, positive, below⟩ := basis - exact ⟨B, hB, small, positive, fun x hx => below x (subset hx)⟩ - -theorem internalCountableBelow_empty (inhabited : M.sets.Nonempty) (order F : ZFSet.{u}) : - M.InternalCountableBelow order F ∅ := by - exact ⟨∅, M.empty_mem inhabited, M.empty_groundEmbeddable ZFSet.omega inhabited, - fun _ hx => False.elim (ZFSet.notMem_empty _ hx), - fun _ hx => False.elim (ZFSet.notMem_empty _ hx)⟩ - -theorem internalCountableBelow_of_countable {order F target : ZFSet.{u}} - (hTarget : target ∈ M.sets) (small : M.groundEmbeddable target ZFSet.omega) - (positive : target ⊆ F) (refl : ∀ x ∈ target, ZFSet.pair x x ∈ order) : - M.InternalCountableBelow order F target := - ⟨target, hTarget, small, positive, fun x hx => ⟨x, hx, refl x hx⟩⟩ - -theorem internalCountableBelow_binary_union - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {order F target₁ target₂ : ZFSet.{u}} - (first : M.InternalCountableBelow order F target₁) - (second : M.InternalCountableBelow order F target₂) : - M.InternalCountableBelow order F (target₁ ∪ target₂) := by - obtain ⟨B, hB, smallB, positiveB, belowB⟩ := first - obtain ⟨C, hC, smallC, positiveC, belowC⟩ := second - refine ⟨B ∪ C, M.binary_union_mem pairing unions hB hC, - M.groundCountable_binary_union pairing unions powers separation infinite choice - hB hC smallB smallC, ?_, ?_⟩ - · intro x hx - exact (ZFSet.mem_union.1 hx).elim (fun hx => positiveB hx) (fun hx => positiveC hx) - · intro x hx - rcases ZFSet.mem_union.1 hx with hx | hx - · obtain ⟨b, hb, lower⟩ := belowB x hx - exact ⟨b, ZFSet.mem_union.2 (Or.inl hb), lower⟩ - · obtain ⟨c, hc, lower⟩ := belowC x hx - exact ⟨c, ZFSet.mem_union.2 (Or.inr hc), lower⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCountableRelationSelections + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +universe u + +def CoinitialBelowCode (order F target B : ZFSet.{u}) : Prop := + B ⊆ F ∧ ∀ x ∈ target, ∃ b ∈ B, ZFSet.pair b x ∈ order + +namespace BoundedFormula + +open SetFormula + +def coinitialBelowFormula {n} (order F target B : Fin n) : BoundedFormula n := + .conj (.allMem B (.mem 0 F.succ)) + (.allMem target (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ))) + +theorem truth_coinitialBelowFormula {n} (order F target B : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (coinitialBelowFormula order F target B) env ↔ + CoinitialBelowCode (env order) (env F) (env target) (env B) := by + simp only [coinitialBelowFormula, Truth, truth_exMem, truth_pairMembershipFormula] + rfl + +theorem realize_coinitialBelowFormula (M : TransitiveGround.{u}) {n} + (order F target B : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (coinitialBelowFormula order F target B).toFormula env ↔ + CoinitialBelowCode (env order) (env F) (env target) (env B) := + (realize_toFormula M _ env members).trans + (truth_coinitialBelowFormula order F target B env) + +end BoundedFormula + +namespace TransitiveGround + +def InternalCountableBelow (M : TransitiveGround.{u}) (order F target : ZFSet.{u}) : Prop := + ∃ B ∈ M.sets, M.groundEmbeddable B ZFSet.omega ∧ CoinitialBelowCode order F target B + +end TransitiveGround + + + + + + +noncomputable def copyPullback (A L e F : ZFSet.{u}) : ZFSet.{u} := + relationImage F A (relationConverse A L e) + +theorem mem_copyPullback (A L e F x : ZFSet.{u}) : + x ∈ copyPullback A L e F ↔ + x ∈ A ∧ ∃ y ∈ F, y ∈ L ∧ ZFSet.pair x y ∈ e := by + rw [copyPullback, mem_relationImage] + constructor + · rintro ⟨hx, y, hy, rel⟩ + exact ⟨hx, y, hy, ((pair_mem_relationConverse A L e x y).1 rel).2⟩ + · rintro ⟨hx, y, hy, hyL, rel⟩ + exact ⟨hx, y, hy, (pair_mem_relationConverse A L e x y).2 ⟨hx, hyL, rel⟩⟩ + +theorem relationImage_copyPullback {A L e : ZFSet.{u}} + (func : ZFSet.IsFunc A L e) (F : ZFSet.{u}) : + relationImage (copyPullback A L e F) L e = F ∩ relationImage A L e := by + apply ZFSet.ext + intro y + rw [mem_relationImage, ZFSet.mem_inter, mem_relationImage] + constructor + · rintro ⟨hy, x, hx, rel⟩ + obtain ⟨hxA, z, hz, _, relz⟩ := (mem_copyPullback A L e F x).1 hx + obtain ⟨w, _, unique⟩ := func.2 x hxA + have equal : y = z := (unique y rel).trans (unique z relz).symm + exact ⟨equal ▸ hz, hy, x, hxA, rel⟩ + · rintro ⟨hyF, hy, x, hx, rel⟩ + exact ⟨hy, x, (mem_copyPullback A L e F x).2 ⟨hx, y, hyF, hy, rel⟩, rel⟩ + +theorem CoinitialBelowCode.copy {A L e sourceOrder targetOrder F target B : ZFSet.{u}} + (func : ZFSet.IsFunc A L e) + (monotone : ∀ x y x' y', ZFSet.pair x y ∈ sourceOrder → + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ targetOrder) + (basis : CoinitialBelowCode sourceOrder (copyPullback A L e F) target B) : + CoinitialBelowCode targetOrder F (relationImage target L e) (relationImage B L e) := by + refine ⟨?_, ?_⟩ + · intro y hy + obtain ⟨_, x, hx, rel⟩ := (mem_relationImage B L e y).1 hy + obtain ⟨hxA, z, hz, _, relz⟩ := (mem_copyPullback A L e F x).1 (basis.1 hx) + obtain ⟨w, _, unique⟩ := func.2 x hxA + exact (unique y rel).trans (unique z relz).symm ▸ hz + · intro y hy + obtain ⟨_, x, hx, rel⟩ := (mem_relationImage target L e y).1 hy + obtain ⟨b, hb, below⟩ := basis.2 x hx + have hbA := ((mem_copyPullback A L e F b).1 (basis.1 hb)).1 + obtain ⟨b', relb, _⟩ := func.2 b hbA + have hbL := (ZFSet.pair_mem_prod.1 (func.1 relb)).2 + exact ⟨b', (mem_relationImage B L e b').2 ⟨hbL, b, hb, relb⟩, + monotone b x b' y below relb rel⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem copyPullback_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A L e F : ZFSet.{u}} (hA : A ∈ M.sets) (hL : L ∈ M.sets) + (he : e ∈ M.sets) (hF : F ∈ M.sets) : copyPullback A L e F ∈ M.sets := + M.relationImage_mem separation hF hA + (M.relationConverse_mem pairing unions powers separation hA hL he) + +theorem internalCountableBelow_copy + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A L e sourceOrder targetOrder F target : ZFSet.{u}} + (hL : L ∈ M.sets) (he : e ∈ M.sets) (code : InjectionCode A L e) + (monotone : ∀ x y x' y', ZFSet.pair x y ∈ sourceOrder → + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ targetOrder) + (basis : M.InternalCountableBelow sourceOrder (copyPullback A L e F) target) : + M.InternalCountableBelow targetOrder F (relationImage target L e) := by + obtain ⟨B, hB, small, coinitial⟩ := basis + have subset : B ⊆ A := fun x hx => ((mem_copyPullback A L e F x).1 (coinitial.1 hx)).1 + exact ⟨relationImage B L e, M.relationImage_mem separation hB hL he, + M.groundEmbeddable_image pairing unions powers separation hB hL + (M.omega_mem separation infinite) he code subset small, + coinitial.copy code.function monotone⟩ + +theorem internalCountableBelow_copy_pullback + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A L e sourceOrder targetOrder F : ZFSet.{u}} + (hL : L ∈ M.sets) (he : e ∈ M.sets) (code : InjectionCode A L e) + (monotone : ∀ x y x' y', ZFSet.pair x y ∈ sourceOrder → + ZFSet.pair x x' ∈ e → ZFSet.pair y y' ∈ e → ZFSet.pair x' y' ∈ targetOrder) + (basis : M.InternalCountableBelow sourceOrder (copyPullback A L e F) + (copyPullback A L e F)) : + M.InternalCountableBelow targetOrder F (F ∩ relationImage A L e) := by + rw [← relationImage_copyPullback code.function F] + exact M.internalCountableBelow_copy pairing unions powers separation infinite hL he code monotone basis + +end TransitiveGround + + + + + + +def FiberCoveredCode (order target parts i B : ZFSet.{u}) : Prop := + ∀ x ∈ target, ZFSet.pair i x ∈ parts → ∃ b ∈ B, ZFSet.pair b x ∈ order + +noncomputable def basisChoiceRelation (I W order target parts : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ I, ∃ B ∈ W, z = ZFSet.pair i B ∧ + FiberCoveredCode order target parts i B) (ZFSet.prod I W) + +theorem pair_mem_basisChoiceRelation (I W order target parts i B : ZFSet.{u}) : + ZFSet.pair i B ∈ basisChoiceRelation I W order target parts ↔ + i ∈ I ∧ B ∈ W ∧ FiberCoveredCode order target parts i B := by + rw [basisChoiceRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, j, hj, A, hA, eq, covers⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hj, hA, covers⟩ + · rintro ⟨hi, hB, covers⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hB⟩, i, hi, B, hB, rfl, covers⟩ + +namespace BoundedFormula + +open SetFormula + +def fiberCoveredFormula {n} (order target parts i B : Fin n) : BoundedFormula n := + .allMem target (imp (pairMembershipFormula i.succ 0 parts.succ) + (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ))) + +theorem truth_fiberCoveredFormula {n} (order target parts i B : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (fiberCoveredFormula order target parts i B) env ↔ + FiberCoveredCode (env order) (env target) (env parts) (env i) (env B) := by + simp only [fiberCoveredFormula, Truth, truth_imp, truth_exMem, truth_pairMembershipFormula] + rfl + +def basisChoiceEntryFormula {n} (z I W order target parts : Fin n) : BoundedFormula n := + exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (fiberCoveredFormula order.succ.succ target.succ.succ parts.succ.succ 1 0))) + +theorem truth_basisChoiceEntryFormula {n} (z I W order target parts : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (basisChoiceEntryFormula z I W order target parts) env ↔ + ∃ i ∈ env I, ∃ B ∈ env W, env z = ZFSet.pair i B ∧ + FiberCoveredCode (env order) (env target) (env parts) i B := by + simp only [basisChoiceEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_fiberCoveredFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem basisChoiceRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I W order target parts : ZFSet.{u}} (hI : I ∈ M.sets) (hW : W ∈ M.sets) + (hOrder : order ∈ M.sets) (hTarget : target ∈ M.sets) (hParts : parts ∈ M.sets) : + basisChoiceRelation I W order target parts ∈ M.sets := by + let params := extend I (extend W (extend order (extend target (extend parts Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.basisChoiceEntryFormula 0 1 2 3 4 5) params + (Fin.cases hI (Fin.cases hW (Fin.cases hOrder (Fin.cases hTarget (Fin.cases hParts + (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hI hW) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.basisChoiceEntryFormula 0 1 2 3 4 5) (extend z params)) (ZFSet.prod I W) = + basisChoiceRelation I W order target parts := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, basisChoiceRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_basisChoiceEntryFormula 0 1 2 3 4 5 _) + exact eq ▸ selected + +theorem internalCountableBelow_indexed_union + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {I order F target parts : ZFSet.{u}} (hI : I ∈ M.sets) (hOrder : order ∈ M.sets) + (hF : F ∈ M.sets) (hTarget : target ∈ M.sets) (hParts : parts ∈ M.sets) + (smallI : M.groundEmbeddable I ZFSet.omega) + (cover : ∀ x ∈ target, ∃ i ∈ I, ZFSet.pair i x ∈ parts) + (localBases : ∀ i ∈ I, M.InternalCountableBelow order F (relationFiber target parts i)) : + M.InternalCountableBelow order F target := by + have hO := M.omega_mem separation infinite + let W := M.groundSmallSubsets F ZFSet.omega + have hW : W ∈ M.sets := M.groundSmallSubsets_mem powers separation hF hO + have choices := M.basisChoiceRelation_mem pairing unions powers separation hI hW hOrder hTarget hParts + have total (i : ZFSet.{u}) (hi : i ∈ I) : + ∃ B ∈ W, ZFSet.pair i B ∈ basisChoiceRelation I W order target parts := by + obtain ⟨B, hB, smallB, positive, below⟩ := localBases i hi + have hBW : B ∈ W := (M.mem_groundSmallSubsets F ZFSet.omega B).2 ⟨hB, positive, smallB⟩ + exact ⟨B, hBW, (pair_mem_basisChoiceRelation I W order target parts i B).2 + ⟨hi, hBW, fun x hx rel => below x ((mem_relationFiber target parts i x).2 ⟨hx, rel⟩)⟩⟩ + obtain ⟨g, hg, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice + hI hW choices total + let family := relationImage I W g + have hFamily : family ∈ M.sets := M.relationImage_mem separation hI hW hg + have smallFamily : M.groundEmbeddable family ZFSet.omega := + M.groundEmbeddable_function_image pairing unions powers separation choice hI hW hO hg func smallI + have candidates (B : ZFSet.{u}) (hB : B ∈ family) : B ∈ W := + ((mem_relationImage I W g B).1 hB).1 + have smallBasis (B : ZFSet.{u}) (hB : B ∈ family) : M.groundEmbeddable B ZFSet.omega := + ((M.mem_groundSmallSubsets F ZFSet.omega B).1 (candidates B hB)).2.2 + refine ⟨family.sUnion, M.union_mem unions hFamily, + M.groundCountable_family_union pairing unions powers separation infinite choice + hFamily smallFamily smallBasis, ?_, ?_⟩ + · intro x hx + obtain ⟨B, hB, xB⟩ := ZFSet.mem_sUnion.1 hx + exact ((M.mem_groundSmallSubsets F ZFSet.omega B).1 (candidates B hB)).2.1 xB + · intro x hx + obtain ⟨i, hi, ix⟩ := cover x hx + obtain ⟨B, chosen, _⟩ := func.2 i hi + have spec := (pair_mem_basisChoiceRelation I W order target parts i B).1 (selected chosen) + obtain ⟨b, hb, lower⟩ := spec.2.2 x hx ix + have hB : B ∈ family := (mem_relationImage I W g B).2 ⟨spec.2.1, i, hi, chosen⟩ + exact ⟨b, ZFSet.mem_sUnion.2 ⟨B, hB, hb⟩, lower⟩ + +end TransitiveGround + +end + + + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem InternalCountableBelow.mono {order F target smaller : ZFSet.{u}} + (basis : M.InternalCountableBelow order F target) (subset : smaller ⊆ target) : + M.InternalCountableBelow order F smaller := by + obtain ⟨B, hB, small, positive, below⟩ := basis + exact ⟨B, hB, small, positive, fun x hx => below x (subset hx)⟩ + +theorem internalCountableBelow_empty (inhabited : M.sets.Nonempty) (order F : ZFSet.{u}) : + M.InternalCountableBelow order F ∅ := by + exact ⟨∅, M.empty_mem inhabited, M.empty_groundEmbeddable ZFSet.omega inhabited, + fun _ hx => False.elim (ZFSet.notMem_empty _ hx), + fun _ hx => False.elim (ZFSet.notMem_empty _ hx)⟩ + +theorem internalCountableBelow_of_countable {order F target : ZFSet.{u}} + (hTarget : target ∈ M.sets) (small : M.groundEmbeddable target ZFSet.omega) + (positive : target ⊆ F) (refl : ∀ x ∈ target, ZFSet.pair x x ∈ order) : + M.InternalCountableBelow order F target := + ⟨target, hTarget, small, positive, fun x hx => ⟨x, hx, refl x hx⟩⟩ + +theorem internalCountableBelow_binary_union + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {order F target₁ target₂ : ZFSet.{u}} + (first : M.InternalCountableBelow order F target₁) + (second : M.InternalCountableBelow order F target₂) : + M.InternalCountableBelow order F (target₁ ∪ target₂) := by + obtain ⟨B, hB, smallB, positiveB, belowB⟩ := first + obtain ⟨C, hC, smallC, positiveC, belowC⟩ := second + refine ⟨B ∪ C, M.binary_union_mem pairing unions hB hC, + M.groundCountable_binary_union pairing unions powers separation infinite choice + hB hC smallB smallC, ?_, ?_⟩ + · intro x hx + exact (ZFSet.mem_union.1 hx).elim (fun hx => positiveB hx) (fun hx => positiveC hx) + · intro x hx + rcases ZFSet.mem_union.1 hx with hx | hx + · obtain ⟨b, hb, lower⟩ := belowB x hx + exact ⟨b, ZFSet.mem_union.2 (Or.inl hb), lower⟩ + · obtain ⟨c, hc, lower⟩ := belowC x hx + exact ⟨c, ZFSet.mem_union.2 (Or.inr hc), lower⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirthData.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirthData.lean index c83b0b06c3e78265ffffffa1571236fe5edae086..967bc7da98d75526fc2a2e8447acea22e2d9cac2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirthData.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirthData.lean @@ -1,602 +1,602 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionOrigins -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBatchBirths - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def firstAppearanceBirth (U T Ps stamps oldBirth : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => z ∈ oldBirth ∨ ∃ n ∈ ZFSet.omega, ∃ D E x t, - z = ZFSet.pair x t ∧ ZFSet.pair n D ∈ Ps ∧ ZFSet.pair (insert n n) E ∈ Ps ∧ - ZFSet.pair n t ∈ stamps ∧ x ∈ E ∧ x ∉ D) (ZFSet.prod U T) - -theorem firstAppearanceBirth_subset (U T Ps stamps oldBirth : ZFSet.{u}) : - firstAppearanceBirth U T Ps stamps oldBirth ⊆ ZFSet.prod U T := - fun _ h => (ZFSet.mem_sep.1 h).1 - -theorem pair_mem_firstAppearanceBirth (U T Ps stamps oldBirth x t : ZFSet.{u}) : - ZFSet.pair x t ∈ firstAppearanceBirth U T Ps stamps oldBirth ↔ - x ∈ U ∧ t ∈ T ∧ (ZFSet.pair x t ∈ oldBirth ∨ ∃ n ∈ ZFSet.omega, ∃ D E, - ZFSet.pair n D ∈ Ps ∧ ZFSet.pair (insert n n) E ∈ Ps ∧ - ZFSet.pair n t ∈ stamps ∧ x ∈ E ∧ x ∉ D) := by - rw [firstAppearanceBirth, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hx, ht⟩, old | ⟨n, hn, D, E, y, s, equal, before, after, stamp, fresh⟩⟩ - · exact ⟨hx, ht, Or.inl old⟩ - · obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hx, ht, Or.inr ⟨n, hn, D, E, before, after, stamp, fresh⟩⟩ - · rintro ⟨hx, ht, old | ⟨n, hn, D, E, before, after, stamp, fresh⟩⟩ - · exact ⟨⟨hx, ht⟩, Or.inl old⟩ - · exact ⟨⟨hx, ht⟩, Or.inr ⟨n, hn, D, E, x, t, rfl, before, after, stamp, fresh⟩⟩ - -theorem firstAppearanceBirth_nat_iff {U T Ps stamps oldBirth : ZFSet.{u}} - (P stamp : Nat → ZFSet.{u}) - (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) - (times : ∀ n t, ZFSet.pair (natSetCode n) t ∈ stamps ↔ t = stamp n) - (x t : ZFSet.{u}) : - ZFSet.pair x t ∈ firstAppearanceBirth U T Ps stamps oldBirth ↔ - x ∈ U ∧ t ∈ T ∧ (ZFSet.pair x t ∈ oldBirth ∨ - ∃ n, x ∈ P (n + 1) ∧ x ∉ P n ∧ t = stamp n) := by - rw [pair_mem_firstAppearanceBirth] - apply and_congr_right - intro _ - apply and_congr_right - intro _ - apply or_congr Iff.rfl - constructor - · rintro ⟨n, hn, D, E, before, after, stampEntry, hx, outside⟩ - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have oldEq := (domains k D).1 before - have newEq := (domains (k + 1) E).1 after - exact ⟨k, newEq ▸ hx, oldEq ▸ outside, (times k t).1 stampEntry⟩ - · rintro ⟨n, hx, outside, equal⟩ - exact ⟨natSetCode n, natSetCode_mem_omega n, P n, P (n + 1), - (domains n _).2 rfl, (domains (n + 1) _).2 rfl, (times n t).2 equal, hx, outside⟩ - -theorem firstAppearanceBirth_natValue_iff {U T Ps stamps oldBirth : ZFSet.{u}} - (domains : FunctionGraphOn ZFSet.omega Ps) (times : FunctionGraphOn ZFSet.omega stamps) - (x t : ZFSet.{u}) : - ZFSet.pair x t ∈ firstAppearanceBirth U T Ps stamps oldBirth ↔ - x ∈ U ∧ t ∈ T ∧ (ZFSet.pair x t ∈ oldBirth ∨ - ∃ n, x ∈ domains.natValue (n + 1) ∧ x ∉ domains.natValue n ∧ t = times.natValue n) := - firstAppearanceBirth_nat_iff domains.natValue times.natValue - domains.natValue_entry_iff times.natValue_entry_iff x t - -theorem firstAppearanceBirth_old_subset {U T Ps stamps oldBirth : ZFSet.{u}} - (shape : oldBirth ⊆ ZFSet.prod U T) : - oldBirth ⊆ firstAppearanceBirth U T Ps stamps oldBirth := - fun _ entry => ZFSet.mem_sep.2 ⟨shape entry, Or.inl entry⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace BoundedFormula - -def firstAppearanceBirthEntryFormula {k} (z omega u t domains stamps old bound : Fin k) : - BoundedFormula k := - disj (.mem z old) - (exMem omega (exMem omega.succ (exMem bound.succ.succ - (exMem bound.succ.succ.succ (exMem u.succ.succ.succ.succ - (exMem t.succ.succ.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ.succ.succ 1 0) - (.conj (successorFormula 4 5) - (.conj (pairMembershipFormula 5 3 domains.succ.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 4 2 domains.succ.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 5 0 stamps.succ.succ.succ.succ.succ.succ) - (.conj (.mem 1 2) (.neg (.mem 1 3)))))))))))))) - -theorem truth_firstAppearanceBirthEntryFormula {k} - (z omega u t domains stamps old bound : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (firstAppearanceBirthEntryFormula z omega u t domains stamps old bound) env ↔ - env z ∈ env old ∨ ∃ n ∈ env omega, ∃ m ∈ env omega, - ∃ D ∈ env bound, ∃ E ∈ env bound, ∃ x ∈ env u, ∃ a ∈ env t, - env z = ZFSet.pair x a ∧ m = insert n n ∧ ZFSet.pair n D ∈ env domains ∧ - ZFSet.pair m E ∈ env domains ∧ ZFSet.pair n a ∈ env stamps ∧ x ∈ E ∧ x ∉ D := by - simp only [firstAppearanceBirthEntryFormula, truth_disj, truth_exMem, Truth, - truth_orderedPairFormula, truth_successorFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem firstAppearanceBirth_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U T Ps stamps oldBirth : ZFSet.{u}} - (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) - (hStamps : stamps ∈ M.sets) (hOld : oldBirth ∈ M.sets) : - firstAppearanceBirth U T Ps stamps oldBirth ∈ M.sets := by - have hBound := M.union_mem unions (M.union_mem unions hPs) - let params := extend ZFSet.omega (extend U (extend T (extend Ps (extend stamps - (extend oldBirth (extend (⋃₀ ⋃₀ Ps) Fin.elim0)))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.firstAppearanceBirthEntryFormula 0 1 2 3 4 5 6 7) params - (Fin.cases hω (Fin.cases hU (Fin.cases hT (Fin.cases hPs (Fin.cases hStamps - (Fin.cases hOld (Fin.cases hBound (fun i => Fin.elim0 i)))))))) - (M.prod_mem pairing unions powers separation hU hT) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.firstAppearanceBirthEntryFormula 0 1 2 3 4 5 6 7) (extend z params)) - (ZFSet.prod U T) = firstAppearanceBirth U T Ps stamps oldBirth := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, firstAppearanceBirth, ZFSet.mem_sep, - BoundedFormula.truth_firstAppearanceBirthEntryFormula] - change (_ ∧ (z ∈ oldBirth ∨ _)) ↔ _ - apply and_congr_right - intro bound - apply or_congr Iff.rfl - constructor - · rintro ⟨n, hn, m, _, D, _, E, _, x, _, t, _, pair, successor, before, after, stamp, fresh⟩ - rw [successor] at after - exact ⟨n, hn, D, E, x, t, pair, before, after, stamp, fresh⟩ - · rintro ⟨n, hn, D, E, x, t, rfl, before, after, stamp, fresh⟩ - have successorMem : insert n n ∈ ZFSet.omega := by - obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact natSetCode_mem_omega (j + 1) - have points := ZFSet.pair_mem_prod.1 bound - exact ⟨n, hn, insert n n, successorMem, D, pair_second_mem_doubleUnion before, - E, pair_second_mem_doubleUnion after, x, points.1, t, points.2, - rfl, rfl, before, after, stamp, fresh⟩ - exact equal ▸ selected - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -structure NatBirthExtensionCode (P stamp : Nat → ZFSet.{u}) (old birth : ZFSet.{u}) : Prop where - shape : ∀ z ∈ birth, ∃ x t, z = ZFSet.pair x t - entries : ∀ x t, ZFSet.pair x t ∈ birth ↔ - ZFSet.pair x t ∈ old ∨ ∃ n, x ∈ P (n + 1) ∧ x ∉ P n ∧ t = stamp n - -namespace NatBirthExtensionCode -variable {P stamp : Nat → ZFSet.{u}} {old birth U T : ZFSet.{u}} - -theorem first_appearance_unique (mono : ∀ n m, n ≤ m → P n ⊆ P m) - {n m : Nat} {x : ZFSet.{u}} (hn : x ∈ P (n + 1)) (notN : x ∉ P n) - (hm : x ∈ P (m + 1)) (notM : x ∉ P m) : n = m := by - rcases lt_trichotomy n m with before | equal | after - · exact False.elim (notM (mono (n + 1) m (Nat.succ_le_of_lt before) hn)) - · exact equal - · exact False.elim (notN (mono (m + 1) n (Nat.succ_le_of_lt after) hm)) - -theorem first_appearance_exists (carrier : NatUnionCode P U) {x : ZFSet.{u}} - (hx : x ∈ U) (outside : x ∉ P 0) : ∃ n, x ∈ P (n + 1) ∧ x ∉ P n := by - obtain ⟨n, hn⟩ := (carrier x).1 hx - induction n with - | zero => exact False.elim (outside hn) - | succ n ih => - by_cases before : x ∈ P n - · exact ih before - · exact ⟨n, hn, before⟩ - -variable (code : NatBirthExtensionCode P stamp old birth) -include code - -theorem function (carrier : NatUnionCode P U) - (mono : ∀ n m, n ≤ m → P n ⊆ P m) - (born : ZFSet.IsFunc (P 0) T old) (stamps : ∀ n, stamp n ∈ T) : - ZFSet.IsFunc U T birth := by - constructor - · intro z hz - obtain ⟨x, t, rfl⟩ := code.shape z hz - rcases (code.entries x t).1 hz with oldEntry | ⟨n, hn, _, rfl⟩ - · have bounds := ZFSet.pair_mem_prod.1 (born.1 oldEntry) - exact ZFSet.pair_mem_prod.2 ⟨carrier.subset 0 bounds.1, bounds.2⟩ - · exact ZFSet.pair_mem_prod.2 ⟨carrier.subset (n + 1) hn, stamps n⟩ - · intro x hx - by_cases original : x ∈ P 0 - · obtain ⟨t, oldEntry, unique⟩ := born.2 x original - refine ⟨t, (code.entries x t).2 (Or.inl oldEntry), ?_⟩ - intro s entry - rcases (code.entries x s).1 entry with before | ⟨n, _, outside, _⟩ - · exact unique s before - · exact False.elim (outside (mono 0 n (Nat.zero_le n) original)) - · obtain ⟨n, hn, outside⟩ := first_appearance_exists carrier hx original - refine ⟨stamp n, (code.entries x (stamp n)).2 (Or.inr ⟨n, hn, outside, rfl⟩), ?_⟩ - intro s entry - rcases (code.entries x s).1 entry with before | ⟨m, hm, notM, equal⟩ - · exact False.elim (original (ZFSet.pair_mem_prod.1 (born.1 before)).1) - · rw [first_appearance_unique mono hm notM hn outside] at equal - exact equal - -theorem old_entry_iff (mono : ∀ n m, n ≤ m → P n ⊆ P m) - {x t : ZFSet.{u}} (hx : x ∈ P 0) : - ZFSet.pair x t ∈ birth ↔ ZFSet.pair x t ∈ old := by - rw [code.entries] - constructor - · rintro (entry | ⟨n, _, outside, _⟩) - · exact entry - · exact False.elim (outside (mono 0 n (Nat.zero_le n) hx)) - · exact Or.inl - -theorem restriction_zero (mono : ∀ n m, n ≤ m → P n ⊆ P m) - (born : ZFSet.IsFunc (P 0) T old) : graphRestriction (P 0) birth = old := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz - exact (code.old_entry_iff mono hx).1 entry - · intro hz - obtain ⟨x, hx, t, _, rfl⟩ := ZFSet.mem_prod.1 (born.1 hz) - exact pair_mem_graphRestriction.2 ⟨(code.old_entry_iff mono hx).2 hz, hx⟩ - -theorem restriction_function (carrier : NatUnionCode P U) - (mono : ∀ n m, n ≤ m → P n ⊆ P m) - (born : ZFSet.IsFunc (P 0) T old) (stamps : ∀ n, stamp n ∈ T) (n : Nat) : - ZFSet.IsFunc (P n) T (graphRestriction (P n) birth) := by - have full := code.function carrier mono born stamps - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz - exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.pair_mem_prod.1 (full.1 entry)).2⟩ - · intro x hx - obtain ⟨t, entry, unique⟩ := full.2 x (carrier.subset n hx) - exact ⟨t, pair_mem_graphRestriction.2 ⟨entry, hx⟩, - fun s hs => unique s (pair_mem_graphRestriction.1 hs).1⟩ - -theorem restriction_union (carrier : NatUnionCode P U) - (born : ZFSet.IsFunc (P 0) T old) : - NatUnionCode (fun n => graphRestriction (P n) birth) birth := by - intro z - constructor - · intro hz - obtain ⟨x, t, rfl⟩ := code.shape z hz - have hx : x ∈ U := by - rcases (code.entries x t).1 hz with original | ⟨n, hn, _, _⟩ - · exact carrier.subset 0 (ZFSet.pair_mem_prod.1 (born.1 original)).1 - · exact carrier.subset (n + 1) hn - obtain ⟨n, hn⟩ := (carrier x).1 hx - exact ⟨n, pair_mem_graphRestriction.2 ⟨hz, hn⟩⟩ - · rintro ⟨n, hn⟩ - exact graphRestriction_subset (P n) birth hn - -end NatBirthExtensionCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem firstAppearanceBirth_code {U T Ps stamps oldBirth : ZFSet.{u}} - (P stamp : Nat → ZFSet.{u}) - (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) - (times : ∀ n t, ZFSet.pair (natSetCode n) t ∈ stamps ↔ t = stamp n) - (carrier : NatUnionCode P U) (born : ZFSet.IsFunc (P 0) T oldBirth) - (inRange : ∀ n, stamp n ∈ T) : - NatBirthExtensionCode P stamp oldBirth (firstAppearanceBirth U T Ps stamps oldBirth) := by - constructor - · intro z entry - obtain ⟨x, _, t, _, equal⟩ := - ZFSet.mem_prod.1 (firstAppearanceBirth_subset U T Ps stamps oldBirth entry) - exact ⟨x, t, equal⟩ - · intro x t - rw [firstAppearanceBirth_nat_iff P stamp domains times] - constructor - · exact fun entry => entry.2.2 - · intro entry - have bounds : x ∈ U ∧ t ∈ T := by - rcases entry with before | ⟨n, hx, _, rfl⟩ - · have oldBounds := ZFSet.pair_mem_prod.1 (born.1 before) - exact ⟨carrier.subset 0 oldBounds.1, oldBounds.2⟩ - · exact ⟨carrier.subset (n + 1) hx, inRange n⟩ - exact ⟨bounds.1, bounds.2, entry⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundFirstAppearanceBirth - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U T Ps stamps oldBirth : ZFSet.{u}} - (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) - (hStamps : stamps ∈ M.sets) (hOld : oldBirth ∈ M.sets) - (P stamp : Nat → ZFSet.{u}) - (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) - (times : ∀ n t, ZFSet.pair (natSetCode n) t ∈ stamps ↔ t = stamp n) - (carrier : NatUnionCode P U) (born : ZFSet.IsFunc (P 0) T oldBirth) - (inRange : ∀ n, stamp n ∈ T) : - ∃ birth ∈ M.sets, birth = firstAppearanceBirth U T Ps stamps oldBirth ∧ - NatBirthExtensionCode P stamp oldBirth birth := - ⟨firstAppearanceBirth U T Ps stamps oldBirth, - M.firstAppearanceBirth_mem pairing unions powers separation hω hU hT hPs hStamps hOld, - rfl, firstAppearanceBirth_code P stamp domains times carrier born inRange⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.NatBirthExtensionCode -universe u -variable {P stamp : Nat → ZFSet.{u}} {old birth T : ZFSet.{u}} -variable (code : NatBirthExtensionCode P stamp old birth) -variable (mono : ∀ n m, n ≤ m → P n ⊆ P m) -variable (born : ZFSet.IsFunc (P 0) T old) -include code - -omit code in -include mono in -theorem restriction_mono {n m : Nat} (before : n ≤ m) : - graphRestriction (P n) birth ⊆ graphRestriction (P m) birth := by - intro z hz - obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz - exact pair_mem_graphRestriction.2 ⟨entry, mono n m before hx⟩ - -include mono born in -theorem restriction_step (n : Nat) {N : ZFSet.{u}} - (next : P (n + 1) = taggedExtension (P n) N) : - graphRestriction (P (n + 1)) birth = taggedBirth (P n) N (graphRestriction (P n) birth) (stamp n) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz - apply (pair_mem_taggedBirth _ _ _ _ _ _).2 - by_cases oldPoint : x ∈ P n - · exact Or.inl (pair_mem_graphRestriction.2 ⟨entry, oldPoint⟩) - · have fresh : x ∈ ZFSet.prod {P n} N := by - rw [next] at hx - exact (ZFSet.mem_union.1 hx).resolve_left oldPoint - rcases (code.entries x t).1 entry with original | ⟨m, hm, notM, equal⟩ - · exact False.elim (oldPoint (mono 0 n (Nat.zero_le n) - (ZFSet.pair_mem_prod.1 (born.1 original)).1)) - · have same := first_appearance_unique mono hm notM hx oldPoint - exact Or.inr ⟨fresh, same ▸ equal⟩ - · intro hz - rcases ZFSet.mem_union.1 hz with original | fresh - · obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 original - exact pair_mem_graphRestriction.2 ⟨entry, mono n (n + 1) (Nat.le_succ n) hx⟩ - · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 fresh - obtain rfl := ZFSet.mem_singleton.1 ht - have current : x ∈ P (n + 1) := by - rw [next] - exact ZFSet.mem_union.2 (Or.inr hx) - have outside : x ∉ P n := fun h => taggedExtension_disjoint (P n) N x h hx - exact pair_mem_graphRestriction.2 - ⟨(code.entries x (stamp n)).2 (Or.inr ⟨n, current, outside, rfl⟩), current⟩ - -include mono in -theorem restriction_bound - (oldBound : ∀ n x t, ZFSet.pair x t ∈ old → t ∈ stamp n) - (stampBefore : ∀ n m, n < m → stamp n ∈ stamp m) - (n : Nat) {x t : ZFSet.{u}} (entry : ZFSet.pair x t ∈ graphRestriction (P n) birth) : - t ∈ stamp n := by - obtain ⟨entry, hx⟩ := pair_mem_graphRestriction.1 entry - rcases (code.entries x t).1 entry with original | ⟨m, _, notM, rfl⟩ - · exact oldBound n x t original - · exact stampBefore m n (lt_of_not_ge (fun h => notM (mono n m h hx))) - -include mono born in -theorem earlier_fiber - (stampMono : ∀ n m, n ≤ m → stamp n ⊆ stamp m) - (n : Nat) {x t : ZFSet.{u}} (before : t ∈ stamp n) - (entry : ZFSet.pair x t ∈ birth) : - x ∈ P n ∧ ZFSet.pair x t ∈ graphRestriction (P n) birth := by - have hx : x ∈ P n := by - rcases (code.entries x t).1 entry with original | ⟨m, hm, _, rfl⟩ - · exact mono 0 n (Nat.zero_le n) (ZFSet.pair_mem_prod.1 (born.1 original)).1 - · have smaller : m < n := lt_of_not_ge - (fun h => ZFSet.mem_irrefl (stamp m) (stampMono n m h before)) - exact mono (m + 1) n (Nat.succ_le_of_lt smaller) hm - exact ⟨hx, pair_mem_graphRestriction.2 ⟨entry, hx⟩⟩ - -end PartitionPilot.Forcing.NatBirthExtensionCode - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable {base stamps limit old birth : ZFSet.{u}} -variable (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) - (compressionStamp base) old birth) -variable (born : ZFSet.IsFunc state.data.D limit old) -variable (times : CompressionStampCode base stamps limit) -include pairing unions powers separation hI hSources hReps hG hT code - -include data born times in -theorem canonical_birth_function (n : Nat) : - ZFSet.IsFunc (state.data.iterate M I Sources Reps G T n).D limit - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := - code.restriction_function (data.fieldUnion 0) - (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT h).1) born times.stamp_mem_limit n - -include born in -theorem canonical_birth_step (n : Nat) : - graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D birth = - taggedBirth (state.data.iterate M I Sources Reps G T n).D - (state.data.iterate M I Sources Reps G T n).fresh - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) - (compressionStamp base n) := - code.restriction_step - (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT h).1) born n rfl - -theorem canonical_birth_before_stamp - (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) - (n : Nat) {x t : ZFSet.{u}} - (entry : ZFSet.pair x t ∈ graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) : - t ∈ compressionStamp base n := - code.restriction_bound - (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT h).1) - (fun n x t h => compressionStamp_old_mem (oldBound x t h) n) - (fun n k h => (compressionStamp_mem_iff base n k).2 h) n entry - -include data born times in -theorem canonical_birth_oldMeet - (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) - (oldMeet : OldMeetCode state.data.rD state.data.μD old) (n : Nat) : - OldMeetCode (state.data.iterate M I Sources Reps G T n).rD - (state.data.iterate M I Sources Reps G T n).μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by - induction n with - | zero => - rw [code.restriction_zero - (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT h).1) born] - exact oldMeet - | succ n ih => - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - have finite : ZFSet.IsFunc current.data.D limit - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by - simpa only [equal] using state.canonical_birth_function data pairing unions powers separation - hI hSources hReps hG hT code born times n - have oldLaw : OldMeetCode current.data.rD current.data.μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by - simpa only [equal] using ih - have earlier (x t : ZFSet.{u}) - (h : ZFSet.pair x t ∈ graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := - state.canonical_birth_before_stamp pairing unions powers separation - hI hSources hReps hG hT code oldBound n h - have result := current.batch.batchBirth_oldMeet finite earlier oldLaw - change OldMeetCode current.data.currentOrder current.data.currentMeet - (taggedBirth current.data.D current.data.fresh - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) - (compressionStamp base n)) at result - rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT code born n] - simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using result - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable {base stamps limit old birth : ZFSet.{u}} -variable (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) - (compressionStamp base) old birth) -variable (born : ZFSet.IsFunc state.data.D limit old) -variable {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} -include pairing unions powers separation hI hSources hReps hG hT code born - -noncomputable def canonical_birth_layer_to_union (n : Nat) {t : ZFSet.{u}} - (before : t ∈ compressionStamp base n) - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet - (state.data.iterate M I Sources Reps G T n).D - (state.data.iterate M I Sources Reps G T n).rD - (state.data.iterate M I Sources Reps G T n).μD - (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) t) : - CodedGrowthLayer M Space sourceOrder sourceMeet - (data.fields 0) (data.fields 1) (data.fields 2) birth t := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := by - obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation - hI hSources hReps hG hT n - rw [← equal] - exact current.ground.carrier - exact layer.of_literal_extension separation ground - ((data.fieldUnion 0).subset n) ((data.fieldUnion 1).subset n) - ((data.fieldUnion 2).subset n) - (graphRestriction_subset (state.data.iterate M I Sources Reps G T n).D birth) - (fun _ _ entry => code.earlier_fiber mono born - (fun _ _ h => compressionStamp_subset base h) n before entry) - -noncomputable def prior_birth_layer_to_union {t : ZFSet.{u}} (priorTime : t ∈ base ∨ t = base) - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet - state.data.D state.data.rD state.data.μD old t) : - CodedGrowthLayer M Space sourceOrder sourceMeet - (data.fields 0) (data.fields 1) (data.fields 2) birth t := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - have zero := code.restriction_zero mono born - apply state.canonical_birth_layer_to_union data pairing unions powers separation - hI hSources hReps hG hT code born 0 (compressionStamp_old_mem priorTime 0) - rw [zero] - simpa only [RecursiveStateData.iterate_zero] using layer - -def limit_birth_layer_empty (times : CompressionStampCode base stamps limit) : - CodedGrowthLayer M Space sourceOrder sourceMeet - (data.fields 0) (data.fields 1) (data.fields 2) birth limit := by - have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT (n := n) (k := k) h).1 - have function := code.function (data.fieldUnion 0) mono born times.stamp_mem_limit - exact .empty_at_birth_bound ⟨data.fields 0, data.ground 0⟩ - (fun _ _ entry => (ZFSet.pair_mem_prod.1 (function.1 entry)).2) - -end PartitionPilot.Forcing.GroundCompressionState - - - -namespace PartitionPilot.Forcing -universe u - -structure GroundCompressionBirthData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T : ZFSet.{u}) - (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - (base old : ZFSet.{u}) where - stamps : ZFSet.{u} - stamps_ground : stamps ∈ M.sets - limit : ZFSet.{u} - limit_ground : limit ∈ M.sets - times : CompressionStampCode base stamps limit - birth : ZFSet.{u} - birth_ground : birth ∈ M.sets - extension : NatBirthExtensionCode (fun n => (initial.iterate M I Sources Reps G T n).D) - (compressionStamp base) old birth - family : ZFSet.{u} - family_ground : family ∈ M.sets - family_function : FunctionGraphOn ZFSet.omega family - family_entries : ∀ n b, ZFSet.pair (natSetCode n) b ∈ family ↔ - b = graphRestriction (initial.iterate M I Sources Reps G T n).D birth - initial_function : ZFSet.IsFunc initial.D limit old - initial_bound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base - function : ZFSet.IsFunc (data.fields 0) limit birth - original : graphRestriction initial.D birth = old - finite_old_meet : ∀ n, OldMeetCode (initial.iterate M I Sources Reps G T n).rD - (initial.iterate M I Sources Reps G T n).μD - (graphRestriction (initial.iterate M I Sources Reps G T n).D birth) - old_meet : OldMeetCode (data.fields 1) (data.fields 2) birth - no_limit_birth : ∀ x, ZFSet.pair x limit ∉ birth - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionOrigins +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundBatchBirths + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def firstAppearanceBirth (U T Ps stamps oldBirth : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => z ∈ oldBirth ∨ ∃ n ∈ ZFSet.omega, ∃ D E x t, + z = ZFSet.pair x t ∧ ZFSet.pair n D ∈ Ps ∧ ZFSet.pair (insert n n) E ∈ Ps ∧ + ZFSet.pair n t ∈ stamps ∧ x ∈ E ∧ x ∉ D) (ZFSet.prod U T) + +theorem firstAppearanceBirth_subset (U T Ps stamps oldBirth : ZFSet.{u}) : + firstAppearanceBirth U T Ps stamps oldBirth ⊆ ZFSet.prod U T := + fun _ h => (ZFSet.mem_sep.1 h).1 + +theorem pair_mem_firstAppearanceBirth (U T Ps stamps oldBirth x t : ZFSet.{u}) : + ZFSet.pair x t ∈ firstAppearanceBirth U T Ps stamps oldBirth ↔ + x ∈ U ∧ t ∈ T ∧ (ZFSet.pair x t ∈ oldBirth ∨ ∃ n ∈ ZFSet.omega, ∃ D E, + ZFSet.pair n D ∈ Ps ∧ ZFSet.pair (insert n n) E ∈ Ps ∧ + ZFSet.pair n t ∈ stamps ∧ x ∈ E ∧ x ∉ D) := by + rw [firstAppearanceBirth, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hx, ht⟩, old | ⟨n, hn, D, E, y, s, equal, before, after, stamp, fresh⟩⟩ + · exact ⟨hx, ht, Or.inl old⟩ + · obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hx, ht, Or.inr ⟨n, hn, D, E, before, after, stamp, fresh⟩⟩ + · rintro ⟨hx, ht, old | ⟨n, hn, D, E, before, after, stamp, fresh⟩⟩ + · exact ⟨⟨hx, ht⟩, Or.inl old⟩ + · exact ⟨⟨hx, ht⟩, Or.inr ⟨n, hn, D, E, x, t, rfl, before, after, stamp, fresh⟩⟩ + +theorem firstAppearanceBirth_nat_iff {U T Ps stamps oldBirth : ZFSet.{u}} + (P stamp : Nat → ZFSet.{u}) + (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) + (times : ∀ n t, ZFSet.pair (natSetCode n) t ∈ stamps ↔ t = stamp n) + (x t : ZFSet.{u}) : + ZFSet.pair x t ∈ firstAppearanceBirth U T Ps stamps oldBirth ↔ + x ∈ U ∧ t ∈ T ∧ (ZFSet.pair x t ∈ oldBirth ∨ + ∃ n, x ∈ P (n + 1) ∧ x ∉ P n ∧ t = stamp n) := by + rw [pair_mem_firstAppearanceBirth] + apply and_congr_right + intro _ + apply and_congr_right + intro _ + apply or_congr Iff.rfl + constructor + · rintro ⟨n, hn, D, E, before, after, stampEntry, hx, outside⟩ + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have oldEq := (domains k D).1 before + have newEq := (domains (k + 1) E).1 after + exact ⟨k, newEq ▸ hx, oldEq ▸ outside, (times k t).1 stampEntry⟩ + · rintro ⟨n, hx, outside, equal⟩ + exact ⟨natSetCode n, natSetCode_mem_omega n, P n, P (n + 1), + (domains n _).2 rfl, (domains (n + 1) _).2 rfl, (times n t).2 equal, hx, outside⟩ + +theorem firstAppearanceBirth_natValue_iff {U T Ps stamps oldBirth : ZFSet.{u}} + (domains : FunctionGraphOn ZFSet.omega Ps) (times : FunctionGraphOn ZFSet.omega stamps) + (x t : ZFSet.{u}) : + ZFSet.pair x t ∈ firstAppearanceBirth U T Ps stamps oldBirth ↔ + x ∈ U ∧ t ∈ T ∧ (ZFSet.pair x t ∈ oldBirth ∨ + ∃ n, x ∈ domains.natValue (n + 1) ∧ x ∉ domains.natValue n ∧ t = times.natValue n) := + firstAppearanceBirth_nat_iff domains.natValue times.natValue + domains.natValue_entry_iff times.natValue_entry_iff x t + +theorem firstAppearanceBirth_old_subset {U T Ps stamps oldBirth : ZFSet.{u}} + (shape : oldBirth ⊆ ZFSet.prod U T) : + oldBirth ⊆ firstAppearanceBirth U T Ps stamps oldBirth := + fun _ entry => ZFSet.mem_sep.2 ⟨shape entry, Or.inl entry⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace BoundedFormula + +def firstAppearanceBirthEntryFormula {k} (z omega u t domains stamps old bound : Fin k) : + BoundedFormula k := + disj (.mem z old) + (exMem omega (exMem omega.succ (exMem bound.succ.succ + (exMem bound.succ.succ.succ (exMem u.succ.succ.succ.succ + (exMem t.succ.succ.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ.succ.succ 1 0) + (.conj (successorFormula 4 5) + (.conj (pairMembershipFormula 5 3 domains.succ.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 4 2 domains.succ.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 5 0 stamps.succ.succ.succ.succ.succ.succ) + (.conj (.mem 1 2) (.neg (.mem 1 3)))))))))))))) + +theorem truth_firstAppearanceBirthEntryFormula {k} + (z omega u t domains stamps old bound : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (firstAppearanceBirthEntryFormula z omega u t domains stamps old bound) env ↔ + env z ∈ env old ∨ ∃ n ∈ env omega, ∃ m ∈ env omega, + ∃ D ∈ env bound, ∃ E ∈ env bound, ∃ x ∈ env u, ∃ a ∈ env t, + env z = ZFSet.pair x a ∧ m = insert n n ∧ ZFSet.pair n D ∈ env domains ∧ + ZFSet.pair m E ∈ env domains ∧ ZFSet.pair n a ∈ env stamps ∧ x ∈ E ∧ x ∉ D := by + simp only [firstAppearanceBirthEntryFormula, truth_disj, truth_exMem, Truth, + truth_orderedPairFormula, truth_successorFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem firstAppearanceBirth_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U T Ps stamps oldBirth : ZFSet.{u}} + (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) + (hStamps : stamps ∈ M.sets) (hOld : oldBirth ∈ M.sets) : + firstAppearanceBirth U T Ps stamps oldBirth ∈ M.sets := by + have hBound := M.union_mem unions (M.union_mem unions hPs) + let params := extend ZFSet.omega (extend U (extend T (extend Ps (extend stamps + (extend oldBirth (extend (⋃₀ ⋃₀ Ps) Fin.elim0)))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.firstAppearanceBirthEntryFormula 0 1 2 3 4 5 6 7) params + (Fin.cases hω (Fin.cases hU (Fin.cases hT (Fin.cases hPs (Fin.cases hStamps + (Fin.cases hOld (Fin.cases hBound (fun i => Fin.elim0 i)))))))) + (M.prod_mem pairing unions powers separation hU hT) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.firstAppearanceBirthEntryFormula 0 1 2 3 4 5 6 7) (extend z params)) + (ZFSet.prod U T) = firstAppearanceBirth U T Ps stamps oldBirth := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, firstAppearanceBirth, ZFSet.mem_sep, + BoundedFormula.truth_firstAppearanceBirthEntryFormula] + change (_ ∧ (z ∈ oldBirth ∨ _)) ↔ _ + apply and_congr_right + intro bound + apply or_congr Iff.rfl + constructor + · rintro ⟨n, hn, m, _, D, _, E, _, x, _, t, _, pair, successor, before, after, stamp, fresh⟩ + rw [successor] at after + exact ⟨n, hn, D, E, x, t, pair, before, after, stamp, fresh⟩ + · rintro ⟨n, hn, D, E, x, t, rfl, before, after, stamp, fresh⟩ + have successorMem : insert n n ∈ ZFSet.omega := by + obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact natSetCode_mem_omega (j + 1) + have points := ZFSet.pair_mem_prod.1 bound + exact ⟨n, hn, insert n n, successorMem, D, pair_second_mem_doubleUnion before, + E, pair_second_mem_doubleUnion after, x, points.1, t, points.2, + rfl, rfl, before, after, stamp, fresh⟩ + exact equal ▸ selected + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +structure NatBirthExtensionCode (P stamp : Nat → ZFSet.{u}) (old birth : ZFSet.{u}) : Prop where + shape : ∀ z ∈ birth, ∃ x t, z = ZFSet.pair x t + entries : ∀ x t, ZFSet.pair x t ∈ birth ↔ + ZFSet.pair x t ∈ old ∨ ∃ n, x ∈ P (n + 1) ∧ x ∉ P n ∧ t = stamp n + +namespace NatBirthExtensionCode +variable {P stamp : Nat → ZFSet.{u}} {old birth U T : ZFSet.{u}} + +theorem first_appearance_unique (mono : ∀ n m, n ≤ m → P n ⊆ P m) + {n m : Nat} {x : ZFSet.{u}} (hn : x ∈ P (n + 1)) (notN : x ∉ P n) + (hm : x ∈ P (m + 1)) (notM : x ∉ P m) : n = m := by + rcases lt_trichotomy n m with before | equal | after + · exact False.elim (notM (mono (n + 1) m (Nat.succ_le_of_lt before) hn)) + · exact equal + · exact False.elim (notN (mono (m + 1) n (Nat.succ_le_of_lt after) hm)) + +theorem first_appearance_exists (carrier : NatUnionCode P U) {x : ZFSet.{u}} + (hx : x ∈ U) (outside : x ∉ P 0) : ∃ n, x ∈ P (n + 1) ∧ x ∉ P n := by + obtain ⟨n, hn⟩ := (carrier x).1 hx + induction n with + | zero => exact False.elim (outside hn) + | succ n ih => + by_cases before : x ∈ P n + · exact ih before + · exact ⟨n, hn, before⟩ + +variable (code : NatBirthExtensionCode P stamp old birth) +include code + +theorem function (carrier : NatUnionCode P U) + (mono : ∀ n m, n ≤ m → P n ⊆ P m) + (born : ZFSet.IsFunc (P 0) T old) (stamps : ∀ n, stamp n ∈ T) : + ZFSet.IsFunc U T birth := by + constructor + · intro z hz + obtain ⟨x, t, rfl⟩ := code.shape z hz + rcases (code.entries x t).1 hz with oldEntry | ⟨n, hn, _, rfl⟩ + · have bounds := ZFSet.pair_mem_prod.1 (born.1 oldEntry) + exact ZFSet.pair_mem_prod.2 ⟨carrier.subset 0 bounds.1, bounds.2⟩ + · exact ZFSet.pair_mem_prod.2 ⟨carrier.subset (n + 1) hn, stamps n⟩ + · intro x hx + by_cases original : x ∈ P 0 + · obtain ⟨t, oldEntry, unique⟩ := born.2 x original + refine ⟨t, (code.entries x t).2 (Or.inl oldEntry), ?_⟩ + intro s entry + rcases (code.entries x s).1 entry with before | ⟨n, _, outside, _⟩ + · exact unique s before + · exact False.elim (outside (mono 0 n (Nat.zero_le n) original)) + · obtain ⟨n, hn, outside⟩ := first_appearance_exists carrier hx original + refine ⟨stamp n, (code.entries x (stamp n)).2 (Or.inr ⟨n, hn, outside, rfl⟩), ?_⟩ + intro s entry + rcases (code.entries x s).1 entry with before | ⟨m, hm, notM, equal⟩ + · exact False.elim (original (ZFSet.pair_mem_prod.1 (born.1 before)).1) + · rw [first_appearance_unique mono hm notM hn outside] at equal + exact equal + +theorem old_entry_iff (mono : ∀ n m, n ≤ m → P n ⊆ P m) + {x t : ZFSet.{u}} (hx : x ∈ P 0) : + ZFSet.pair x t ∈ birth ↔ ZFSet.pair x t ∈ old := by + rw [code.entries] + constructor + · rintro (entry | ⟨n, _, outside, _⟩) + · exact entry + · exact False.elim (outside (mono 0 n (Nat.zero_le n) hx)) + · exact Or.inl + +theorem restriction_zero (mono : ∀ n m, n ≤ m → P n ⊆ P m) + (born : ZFSet.IsFunc (P 0) T old) : graphRestriction (P 0) birth = old := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz + exact (code.old_entry_iff mono hx).1 entry + · intro hz + obtain ⟨x, hx, t, _, rfl⟩ := ZFSet.mem_prod.1 (born.1 hz) + exact pair_mem_graphRestriction.2 ⟨(code.old_entry_iff mono hx).2 hz, hx⟩ + +theorem restriction_function (carrier : NatUnionCode P U) + (mono : ∀ n m, n ≤ m → P n ⊆ P m) + (born : ZFSet.IsFunc (P 0) T old) (stamps : ∀ n, stamp n ∈ T) (n : Nat) : + ZFSet.IsFunc (P n) T (graphRestriction (P n) birth) := by + have full := code.function carrier mono born stamps + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz + exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.pair_mem_prod.1 (full.1 entry)).2⟩ + · intro x hx + obtain ⟨t, entry, unique⟩ := full.2 x (carrier.subset n hx) + exact ⟨t, pair_mem_graphRestriction.2 ⟨entry, hx⟩, + fun s hs => unique s (pair_mem_graphRestriction.1 hs).1⟩ + +theorem restriction_union (carrier : NatUnionCode P U) + (born : ZFSet.IsFunc (P 0) T old) : + NatUnionCode (fun n => graphRestriction (P n) birth) birth := by + intro z + constructor + · intro hz + obtain ⟨x, t, rfl⟩ := code.shape z hz + have hx : x ∈ U := by + rcases (code.entries x t).1 hz with original | ⟨n, hn, _, _⟩ + · exact carrier.subset 0 (ZFSet.pair_mem_prod.1 (born.1 original)).1 + · exact carrier.subset (n + 1) hn + obtain ⟨n, hn⟩ := (carrier x).1 hx + exact ⟨n, pair_mem_graphRestriction.2 ⟨hz, hn⟩⟩ + · rintro ⟨n, hn⟩ + exact graphRestriction_subset (P n) birth hn + +end NatBirthExtensionCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem firstAppearanceBirth_code {U T Ps stamps oldBirth : ZFSet.{u}} + (P stamp : Nat → ZFSet.{u}) + (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) + (times : ∀ n t, ZFSet.pair (natSetCode n) t ∈ stamps ↔ t = stamp n) + (carrier : NatUnionCode P U) (born : ZFSet.IsFunc (P 0) T oldBirth) + (inRange : ∀ n, stamp n ∈ T) : + NatBirthExtensionCode P stamp oldBirth (firstAppearanceBirth U T Ps stamps oldBirth) := by + constructor + · intro z entry + obtain ⟨x, _, t, _, equal⟩ := + ZFSet.mem_prod.1 (firstAppearanceBirth_subset U T Ps stamps oldBirth entry) + exact ⟨x, t, equal⟩ + · intro x t + rw [firstAppearanceBirth_nat_iff P stamp domains times] + constructor + · exact fun entry => entry.2.2 + · intro entry + have bounds : x ∈ U ∧ t ∈ T := by + rcases entry with before | ⟨n, hx, _, rfl⟩ + · have oldBounds := ZFSet.pair_mem_prod.1 (born.1 before) + exact ⟨carrier.subset 0 oldBounds.1, oldBounds.2⟩ + · exact ⟨carrier.subset (n + 1) hx, inRange n⟩ + exact ⟨bounds.1, bounds.2, entry⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundFirstAppearanceBirth + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U T Ps stamps oldBirth : ZFSet.{u}} + (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) + (hStamps : stamps ∈ M.sets) (hOld : oldBirth ∈ M.sets) + (P stamp : Nat → ZFSet.{u}) + (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) + (times : ∀ n t, ZFSet.pair (natSetCode n) t ∈ stamps ↔ t = stamp n) + (carrier : NatUnionCode P U) (born : ZFSet.IsFunc (P 0) T oldBirth) + (inRange : ∀ n, stamp n ∈ T) : + ∃ birth ∈ M.sets, birth = firstAppearanceBirth U T Ps stamps oldBirth ∧ + NatBirthExtensionCode P stamp oldBirth birth := + ⟨firstAppearanceBirth U T Ps stamps oldBirth, + M.firstAppearanceBirth_mem pairing unions powers separation hω hU hT hPs hStamps hOld, + rfl, firstAppearanceBirth_code P stamp domains times carrier born inRange⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.NatBirthExtensionCode +universe u +variable {P stamp : Nat → ZFSet.{u}} {old birth T : ZFSet.{u}} +variable (code : NatBirthExtensionCode P stamp old birth) +variable (mono : ∀ n m, n ≤ m → P n ⊆ P m) +variable (born : ZFSet.IsFunc (P 0) T old) +include code + +omit code in +include mono in +theorem restriction_mono {n m : Nat} (before : n ≤ m) : + graphRestriction (P n) birth ⊆ graphRestriction (P m) birth := by + intro z hz + obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz + exact pair_mem_graphRestriction.2 ⟨entry, mono n m before hx⟩ + +include mono born in +theorem restriction_step (n : Nat) {N : ZFSet.{u}} + (next : P (n + 1) = taggedExtension (P n) N) : + graphRestriction (P (n + 1)) birth = taggedBirth (P n) N (graphRestriction (P n) birth) (stamp n) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 hz + apply (pair_mem_taggedBirth _ _ _ _ _ _).2 + by_cases oldPoint : x ∈ P n + · exact Or.inl (pair_mem_graphRestriction.2 ⟨entry, oldPoint⟩) + · have fresh : x ∈ ZFSet.prod {P n} N := by + rw [next] at hx + exact (ZFSet.mem_union.1 hx).resolve_left oldPoint + rcases (code.entries x t).1 entry with original | ⟨m, hm, notM, equal⟩ + · exact False.elim (oldPoint (mono 0 n (Nat.zero_le n) + (ZFSet.pair_mem_prod.1 (born.1 original)).1)) + · have same := first_appearance_unique mono hm notM hx oldPoint + exact Or.inr ⟨fresh, same ▸ equal⟩ + · intro hz + rcases ZFSet.mem_union.1 hz with original | fresh + · obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 original + exact pair_mem_graphRestriction.2 ⟨entry, mono n (n + 1) (Nat.le_succ n) hx⟩ + · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 fresh + obtain rfl := ZFSet.mem_singleton.1 ht + have current : x ∈ P (n + 1) := by + rw [next] + exact ZFSet.mem_union.2 (Or.inr hx) + have outside : x ∉ P n := fun h => taggedExtension_disjoint (P n) N x h hx + exact pair_mem_graphRestriction.2 + ⟨(code.entries x (stamp n)).2 (Or.inr ⟨n, current, outside, rfl⟩), current⟩ + +include mono in +theorem restriction_bound + (oldBound : ∀ n x t, ZFSet.pair x t ∈ old → t ∈ stamp n) + (stampBefore : ∀ n m, n < m → stamp n ∈ stamp m) + (n : Nat) {x t : ZFSet.{u}} (entry : ZFSet.pair x t ∈ graphRestriction (P n) birth) : + t ∈ stamp n := by + obtain ⟨entry, hx⟩ := pair_mem_graphRestriction.1 entry + rcases (code.entries x t).1 entry with original | ⟨m, _, notM, rfl⟩ + · exact oldBound n x t original + · exact stampBefore m n (lt_of_not_ge (fun h => notM (mono n m h hx))) + +include mono born in +theorem earlier_fiber + (stampMono : ∀ n m, n ≤ m → stamp n ⊆ stamp m) + (n : Nat) {x t : ZFSet.{u}} (before : t ∈ stamp n) + (entry : ZFSet.pair x t ∈ birth) : + x ∈ P n ∧ ZFSet.pair x t ∈ graphRestriction (P n) birth := by + have hx : x ∈ P n := by + rcases (code.entries x t).1 entry with original | ⟨m, hm, _, rfl⟩ + · exact mono 0 n (Nat.zero_le n) (ZFSet.pair_mem_prod.1 (born.1 original)).1 + · have smaller : m < n := lt_of_not_ge + (fun h => ZFSet.mem_irrefl (stamp m) (stampMono n m h before)) + exact mono (m + 1) n (Nat.succ_le_of_lt smaller) hm + exact ⟨hx, pair_mem_graphRestriction.2 ⟨entry, hx⟩⟩ + +end PartitionPilot.Forcing.NatBirthExtensionCode + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable {base stamps limit old birth : ZFSet.{u}} +variable (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) + (compressionStamp base) old birth) +variable (born : ZFSet.IsFunc state.data.D limit old) +variable (times : CompressionStampCode base stamps limit) +include pairing unions powers separation hI hSources hReps hG hT code + +include data born times in +theorem canonical_birth_function (n : Nat) : + ZFSet.IsFunc (state.data.iterate M I Sources Reps G T n).D limit + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := + code.restriction_function (data.fieldUnion 0) + (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT h).1) born times.stamp_mem_limit n + +include born in +theorem canonical_birth_step (n : Nat) : + graphRestriction (state.data.iterate M I Sources Reps G T (n + 1)).D birth = + taggedBirth (state.data.iterate M I Sources Reps G T n).D + (state.data.iterate M I Sources Reps G T n).fresh + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) + (compressionStamp base n) := + code.restriction_step + (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT h).1) born n rfl + +theorem canonical_birth_before_stamp + (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) + (n : Nat) {x t : ZFSet.{u}} + (entry : ZFSet.pair x t ∈ graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) : + t ∈ compressionStamp base n := + code.restriction_bound + (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT h).1) + (fun n x t h => compressionStamp_old_mem (oldBound x t h) n) + (fun n k h => (compressionStamp_mem_iff base n k).2 h) n entry + +include data born times in +theorem canonical_birth_oldMeet + (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) + (oldMeet : OldMeetCode state.data.rD state.data.μD old) (n : Nat) : + OldMeetCode (state.data.iterate M I Sources Reps G T n).rD + (state.data.iterate M I Sources Reps G T n).μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by + induction n with + | zero => + rw [code.restriction_zero + (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT h).1) born] + exact oldMeet + | succ n ih => + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + have finite : ZFSet.IsFunc current.data.D limit + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by + simpa only [equal] using state.canonical_birth_function data pairing unions powers separation + hI hSources hReps hG hT code born times n + have oldLaw : OldMeetCode current.data.rD current.data.μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := by + simpa only [equal] using ih + have earlier (x t : ZFSet.{u}) + (h : ZFSet.pair x t ∈ graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) := + state.canonical_birth_before_stamp pairing unions powers separation + hI hSources hReps hG hT code oldBound n h + have result := current.batch.batchBirth_oldMeet finite earlier oldLaw + change OldMeetCode current.data.currentOrder current.data.currentMeet + (taggedBirth current.data.D current.data.fresh + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) + (compressionStamp base n)) at result + rw [state.canonical_birth_step pairing unions powers separation hI hSources hReps hG hT code born n] + simpa only [equal, RecursiveStateData.iterate_succ, RecursiveStateData.successor] using result + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable {base stamps limit old birth : ZFSet.{u}} +variable (code : NatBirthExtensionCode (fun n => (state.data.iterate M I Sources Reps G T n).D) + (compressionStamp base) old birth) +variable (born : ZFSet.IsFunc state.data.D limit old) +variable {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} +include pairing unions powers separation hI hSources hReps hG hT code born + +noncomputable def canonical_birth_layer_to_union (n : Nat) {t : ZFSet.{u}} + (before : t ∈ compressionStamp base n) + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet + (state.data.iterate M I Sources Reps G T n).D + (state.data.iterate M I Sources Reps G T n).rD + (state.data.iterate M I Sources Reps G T n).μD + (graphRestriction (state.data.iterate M I Sources Reps G T n).D birth) t) : + CodedGrowthLayer M Space sourceOrder sourceMeet + (data.fields 0) (data.fields 1) (data.fields 2) birth t := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + have ground : (state.data.iterate M I Sources Reps G T n).D ∈ M.sets := by + obtain ⟨current, equal⟩ := state.canonical_iterate_valid pairing unions powers separation + hI hSources hReps hG hT n + rw [← equal] + exact current.ground.carrier + exact layer.of_literal_extension separation ground + ((data.fieldUnion 0).subset n) ((data.fieldUnion 1).subset n) + ((data.fieldUnion 2).subset n) + (graphRestriction_subset (state.data.iterate M I Sources Reps G T n).D birth) + (fun _ _ entry => code.earlier_fiber mono born + (fun _ _ h => compressionStamp_subset base h) n before entry) + +noncomputable def prior_birth_layer_to_union {t : ZFSet.{u}} (priorTime : t ∈ base ∨ t = base) + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet + state.data.D state.data.rD state.data.μD old t) : + CodedGrowthLayer M Space sourceOrder sourceMeet + (data.fields 0) (data.fields 1) (data.fields 2) birth t := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + have zero := code.restriction_zero mono born + apply state.canonical_birth_layer_to_union data pairing unions powers separation + hI hSources hReps hG hT code born 0 (compressionStamp_old_mem priorTime 0) + rw [zero] + simpa only [RecursiveStateData.iterate_zero] using layer + +def limit_birth_layer_empty (times : CompressionStampCode base stamps limit) : + CodedGrowthLayer M Space sourceOrder sourceMeet + (data.fields 0) (data.fields 1) (data.fields 2) birth limit := by + have mono := fun n k h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT (n := n) (k := k) h).1 + have function := code.function (data.fieldUnion 0) mono born times.stamp_mem_limit + exact .empty_at_birth_bound ⟨data.fields 0, data.ground 0⟩ + (fun _ _ entry => (ZFSet.pair_mem_prod.1 (function.1 entry)).2) + +end PartitionPilot.Forcing.GroundCompressionState + + + +namespace PartitionPilot.Forcing +universe u + +structure GroundCompressionBirthData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T : ZFSet.{u}) + (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + (base old : ZFSet.{u}) where + stamps : ZFSet.{u} + stamps_ground : stamps ∈ M.sets + limit : ZFSet.{u} + limit_ground : limit ∈ M.sets + times : CompressionStampCode base stamps limit + birth : ZFSet.{u} + birth_ground : birth ∈ M.sets + extension : NatBirthExtensionCode (fun n => (initial.iterate M I Sources Reps G T n).D) + (compressionStamp base) old birth + family : ZFSet.{u} + family_ground : family ∈ M.sets + family_function : FunctionGraphOn ZFSet.omega family + family_entries : ∀ n b, ZFSet.pair (natSetCode n) b ∈ family ↔ + b = graphRestriction (initial.iterate M I Sources Reps G T n).D birth + initial_function : ZFSet.IsFunc initial.D limit old + initial_bound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base + function : ZFSet.IsFunc (data.fields 0) limit birth + original : graphRestriction initial.D birth = old + finite_old_meet : ∀ n, OldMeetCode (initial.iterate M I Sources Reps G T n).rD + (initial.iterate M I Sources Reps G T n).μD + (graphRestriction (initial.iterate M I Sources Reps G T n).D birth) + old_meet : OldMeetCode (data.fields 1) (data.fields 2) birth + no_limit_birth : ∀ x, ZFSet.pair x limit ∉ birth + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirths.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirths.lean index 1f0cb7b1539902780ad45fe2f25542b79f52dba9..6add80797f2812de213cb52106c5cc906de22bbf 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirths.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionBirths.lean @@ -1,185 +1,185 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace BoundedFormula - -def birthRestrictionFamilyEntryFormula {k} (z omega domainsBound relations t domains birth : Fin k) : - BoundedFormula k := - exMem omega (exMem domainsBound.succ (exMem relations.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ 2 0) - (.conj (pairMembershipFormula 2 1 domains.succ.succ.succ) - (graphRestrictionFormula 0 1 t.succ.succ.succ birth.succ.succ.succ))))) - -theorem truth_birthRestrictionFamilyEntryFormula {k} - (z omega domainsBound relations t domains birth : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (birthRestrictionFamilyEntryFormula z omega domainsBound relations t domains birth) env ↔ - ∃ n ∈ env omega, ∃ P ∈ env domainsBound, ∃ b ∈ env relations, - env z = ZFSet.pair n b ∧ ZFSet.pair n P ∈ env domains ∧ - b = ZFSet.sep (fun w => w ∈ ZFSet.prod P (env t)) (env birth) := by - simp only [birthRestrictionFamilyEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, truth_graphRestrictionFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def birthRestrictionFamily (U T Ps birth : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ P ∈ ⋃₀ ⋃₀ Ps, - ∃ b ∈ M.groundRelations U T, - z = ZFSet.pair n b ∧ ZFSet.pair n P ∈ Ps ∧ b = graphRestriction P birth) - (ZFSet.prod ZFSet.omega (M.groundRelations U T)) - -theorem birthRestrictionFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U T Ps birth : ZFSet.{u}} (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) (hBirth : birth ∈ M.sets) - (born : ZFSet.IsFunc U T birth) : M.birthRestrictionFamily U T Ps birth ∈ M.sets := by - have hBound := M.union_mem unions (M.union_mem unions hPs) - have hRelations := M.groundRelations_mem pairing unions powers separation hU hT - let params := extend ZFSet.omega (extend (⋃₀ ⋃₀ Ps) (extend (M.groundRelations U T) - (extend T (extend Ps (extend birth Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.birthRestrictionFamilyEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hω (Fin.cases hBound (Fin.cases hRelations (Fin.cases hT - (Fin.cases hPs (Fin.cases hBirth (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hω hRelations) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.birthRestrictionFamilyEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod ZFSet.omega (M.groundRelations U T)) = M.birthRestrictionFamily U T Ps birth := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, birthRestrictionFamily, ZFSet.mem_sep, - BoundedFormula.truth_birthRestrictionFamilyEntryFormula] - change (_ ∧ ∃ n ∈ ZFSet.omega, ∃ P ∈ ⋃₀ ⋃₀ Ps, ∃ b ∈ M.groundRelations U T, - z = ZFSet.pair n b ∧ ZFSet.pair n P ∈ Ps ∧ - b = ZFSet.sep (fun w => w ∈ ZFSet.prod P T) birth) ↔ _ - simp only [graphRestriction_eq_sep born] - exact equal ▸ selected - -theorem birthRestrictionFamily_entries - (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) - {U T Ps birth : ZFSet.{u}} (hPs : Ps ∈ M.sets) (hBirth : birth ∈ M.sets) - (P : Nat → ZFSet.{u}) - (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) - (born : ZFSet.IsFunc U T birth) (n : Nat) (b : ZFSet.{u}) : - ZFSet.pair (natSetCode n) b ∈ M.birthRestrictionFamily U T Ps birth ↔ - b = graphRestriction (P n) birth := by - constructor - · intro member - obtain ⟨_, k, _, D, _, c, _, equal, entry, restriction⟩ := ZFSet.mem_sep.1 member - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact (domains n D).1 entry ▸ restriction - · intro equal - have entry := (domains n (P n)).2 rfl - have hP := M.pair_right (M.transitive hPs entry) - have hRestriction := M.graphRestriction_mem unions separation hP hBirth - have relation : b ∈ M.groundRelations U T := (M.mem_groundRelations U T b).2 ⟨ - equal.symm ▸ hRestriction, fun z hz => born.1 - (graphRestriction_subset (P n) birth (equal ▸ hz))⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, relation⟩, - natSetCode n, natSetCode_mem_omega n, P n, pair_second_mem_doubleUnion entry, - b, relation, rfl, entry, equal⟩ - -theorem exists_groundBirthRestrictionFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U T Ps birth : ZFSet.{u}} (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) (hBirth : birth ∈ M.sets) - (P : Nat → ZFSet.{u}) - (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) - (born : ZFSet.IsFunc U T birth) : - ∃ family ∈ M.sets, FunctionGraphOn ZFSet.omega family ∧ - ∀ n b, ZFSet.pair (natSetCode n) b ∈ family ↔ b = graphRestriction (P n) birth := by - have entries := M.birthRestrictionFamily_entries unions separation hPs hBirth P domains born - refine ⟨M.birthRestrictionFamily U T Ps birth, - M.birthRestrictionFamily_mem pairing unions powers separation hω hU hT hPs hBirth born, - ⟨M.groundRelations U T, ?_, ?_⟩, entries⟩ - · exact fun z hz => (ZFSet.mem_sep.1 hz).1 - · intro n hn - obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact ⟨graphRestriction (P j) birth, (entries j _).2 rfl, - fun b hb => (entries j b).1 hb⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem exists_groundBirthData - (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) - {base old : ZFSet.{u}} (hBase : base ∈ M.sets) (hOld : old ∈ M.sets) - (ordinal : ordinalSetProperty base) (oldFunction : FunctionGraphOn state.data.D old) - (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) - (oldMeet : OldMeetCode state.data.rD state.data.μD old) : - Nonempty (GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) := by - obtain ⟨stamps, hStamps, limit, hLimit, _, times⟩ := M.exists_groundCompressionStamps - pairing unions separation collection infinite hBase ordinal - have born : ZFSet.IsFunc state.data.D limit old := by - refine ⟨?_, oldFunction.to_isFunc.2⟩ - intro z hz - obtain ⟨x, hx, t, rfl⟩ := oldFunction.shape z hz - exact ZFSet.pair_mem_prod.2 ⟨hx, times.union.subset 0 - (compressionStamp_old_mem (oldBound x t hz) 0)⟩ - have hω := M.omega_mem separation infinite - let stages := state.data.iterate M I Sources Reps G T - obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT - obtain ⟨domains, hDomains, _, domainEntries⟩ := M.exists_groundStateFieldFamily - pairing separation collection hω hHistory stages entries 0 - obtain ⟨birth, hBirth, _, extension⟩ := M.exists_groundFirstAppearanceBirth - pairing unions powers separation hω (data.ground 0) hLimit hDomains hStamps hOld - (fun n => (stages n).D) (compressionStamp base) domainEntries times.entries - (data.fieldUnion 0) born times.stamp_mem_limit - have mono : ∀ n k, n ≤ k → (stages n).D ⊆ (stages k).D := - fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT h).1 - have function := extension.function (data.fieldUnion 0) mono born times.stamp_mem_limit - obtain ⟨family, hFamily, familyFunction, familyEntries⟩ := M.exists_groundBirthRestrictionFamily - pairing unions powers separation hω (data.ground 0) hLimit hDomains hBirth - (fun n => (stages n).D) domainEntries function - have finite := state.canonical_birth_oldMeet data pairing unions powers separation - hI hSources hReps hG hT extension born times oldBound oldMeet - have unionBirth := extension.restriction_union (data.fieldUnion 0) born - have unionOldMeet := (data.fieldUnion 1).oldMeet (data.fieldUnion 2) unionBirth finite - (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation - hI hSources hReps hG hT h).2.2.1) - (fun _ _ h => NatBirthExtensionCode.restriction_mono mono h) - refine ⟨⟨stamps, hStamps, limit, hLimit, times, birth, hBirth, extension, - family, hFamily, familyFunction, familyEntries, born, oldBound, function, - extension.restriction_zero mono born, finite, unionOldMeet, ?_⟩⟩ - intro x entry - exact ZFSet.mem_irrefl limit (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - -end PartitionPilot.Forcing.GroundCompressionState - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionBirthData + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace BoundedFormula + +def birthRestrictionFamilyEntryFormula {k} (z omega domainsBound relations t domains birth : Fin k) : + BoundedFormula k := + exMem omega (exMem domainsBound.succ (exMem relations.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ 2 0) + (.conj (pairMembershipFormula 2 1 domains.succ.succ.succ) + (graphRestrictionFormula 0 1 t.succ.succ.succ birth.succ.succ.succ))))) + +theorem truth_birthRestrictionFamilyEntryFormula {k} + (z omega domainsBound relations t domains birth : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (birthRestrictionFamilyEntryFormula z omega domainsBound relations t domains birth) env ↔ + ∃ n ∈ env omega, ∃ P ∈ env domainsBound, ∃ b ∈ env relations, + env z = ZFSet.pair n b ∧ ZFSet.pair n P ∈ env domains ∧ + b = ZFSet.sep (fun w => w ∈ ZFSet.prod P (env t)) (env birth) := by + simp only [birthRestrictionFamilyEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, truth_graphRestrictionFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def birthRestrictionFamily (U T Ps birth : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ n ∈ ZFSet.omega, ∃ P ∈ ⋃₀ ⋃₀ Ps, + ∃ b ∈ M.groundRelations U T, + z = ZFSet.pair n b ∧ ZFSet.pair n P ∈ Ps ∧ b = graphRestriction P birth) + (ZFSet.prod ZFSet.omega (M.groundRelations U T)) + +theorem birthRestrictionFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U T Ps birth : ZFSet.{u}} (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) (hBirth : birth ∈ M.sets) + (born : ZFSet.IsFunc U T birth) : M.birthRestrictionFamily U T Ps birth ∈ M.sets := by + have hBound := M.union_mem unions (M.union_mem unions hPs) + have hRelations := M.groundRelations_mem pairing unions powers separation hU hT + let params := extend ZFSet.omega (extend (⋃₀ ⋃₀ Ps) (extend (M.groundRelations U T) + (extend T (extend Ps (extend birth Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.birthRestrictionFamilyEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hω (Fin.cases hBound (Fin.cases hRelations (Fin.cases hT + (Fin.cases hPs (Fin.cases hBirth (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hω hRelations) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.birthRestrictionFamilyEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod ZFSet.omega (M.groundRelations U T)) = M.birthRestrictionFamily U T Ps birth := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, birthRestrictionFamily, ZFSet.mem_sep, + BoundedFormula.truth_birthRestrictionFamilyEntryFormula] + change (_ ∧ ∃ n ∈ ZFSet.omega, ∃ P ∈ ⋃₀ ⋃₀ Ps, ∃ b ∈ M.groundRelations U T, + z = ZFSet.pair n b ∧ ZFSet.pair n P ∈ Ps ∧ + b = ZFSet.sep (fun w => w ∈ ZFSet.prod P T) birth) ↔ _ + simp only [graphRestriction_eq_sep born] + exact equal ▸ selected + +theorem birthRestrictionFamily_entries + (unions : Realize M.sets SetFormula.union Fin.elim0) (separation : SeparationSchema M.sets) + {U T Ps birth : ZFSet.{u}} (hPs : Ps ∈ M.sets) (hBirth : birth ∈ M.sets) + (P : Nat → ZFSet.{u}) + (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) + (born : ZFSet.IsFunc U T birth) (n : Nat) (b : ZFSet.{u}) : + ZFSet.pair (natSetCode n) b ∈ M.birthRestrictionFamily U T Ps birth ↔ + b = graphRestriction (P n) birth := by + constructor + · intro member + obtain ⟨_, k, _, D, _, c, _, equal, entry, restriction⟩ := ZFSet.mem_sep.1 member + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact (domains n D).1 entry ▸ restriction + · intro equal + have entry := (domains n (P n)).2 rfl + have hP := M.pair_right (M.transitive hPs entry) + have hRestriction := M.graphRestriction_mem unions separation hP hBirth + have relation : b ∈ M.groundRelations U T := (M.mem_groundRelations U T b).2 ⟨ + equal.symm ▸ hRestriction, fun z hz => born.1 + (graphRestriction_subset (P n) birth (equal ▸ hz))⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, relation⟩, + natSetCode n, natSetCode_mem_omega n, P n, pair_second_mem_doubleUnion entry, + b, relation, rfl, entry, equal⟩ + +theorem exists_groundBirthRestrictionFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U T Ps birth : ZFSet.{u}} (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + (hU : U ∈ M.sets) (hT : T ∈ M.sets) (hPs : Ps ∈ M.sets) (hBirth : birth ∈ M.sets) + (P : Nat → ZFSet.{u}) + (domains : ∀ n D, ZFSet.pair (natSetCode n) D ∈ Ps ↔ D = P n) + (born : ZFSet.IsFunc U T birth) : + ∃ family ∈ M.sets, FunctionGraphOn ZFSet.omega family ∧ + ∀ n b, ZFSet.pair (natSetCode n) b ∈ family ↔ b = graphRestriction (P n) birth := by + have entries := M.birthRestrictionFamily_entries unions separation hPs hBirth P domains born + refine ⟨M.birthRestrictionFamily U T Ps birth, + M.birthRestrictionFamily_mem pairing unions powers separation hω hU hT hPs hBirth born, + ⟨M.groundRelations U T, ?_, ?_⟩, entries⟩ + · exact fun z hz => (ZFSet.mem_sep.1 hz).1 + · intro n hn + obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact ⟨graphRestriction (P j) birth, (entries j _).2 rfl, + fun b hb => (entries j b).1 hb⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem exists_groundBirthData + (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) + {base old : ZFSet.{u}} (hBase : base ∈ M.sets) (hOld : old ∈ M.sets) + (ordinal : ordinalSetProperty base) (oldFunction : FunctionGraphOn state.data.D old) + (oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base) + (oldMeet : OldMeetCode state.data.rD state.data.μD old) : + Nonempty (GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) := by + obtain ⟨stamps, hStamps, limit, hLimit, _, times⟩ := M.exists_groundCompressionStamps + pairing unions separation collection infinite hBase ordinal + have born : ZFSet.IsFunc state.data.D limit old := by + refine ⟨?_, oldFunction.to_isFunc.2⟩ + intro z hz + obtain ⟨x, hx, t, rfl⟩ := oldFunction.shape z hz + exact ZFSet.pair_mem_prod.2 ⟨hx, times.union.subset 0 + (compressionStamp_old_mem (oldBound x t hz) 0)⟩ + have hω := M.omega_mem separation infinite + let stages := state.data.iterate M I Sources Reps G T + obtain ⟨history, hHistory, _, entries, _, _⟩ := state.exists_groundHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT + obtain ⟨domains, hDomains, _, domainEntries⟩ := M.exists_groundStateFieldFamily + pairing separation collection hω hHistory stages entries 0 + obtain ⟨birth, hBirth, _, extension⟩ := M.exists_groundFirstAppearanceBirth + pairing unions powers separation hω (data.ground 0) hLimit hDomains hStamps hOld + (fun n => (stages n).D) (compressionStamp base) domainEntries times.entries + (data.fieldUnion 0) born times.stamp_mem_limit + have mono : ∀ n k, n ≤ k → (stages n).D ⊆ (stages k).D := + fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT h).1 + have function := extension.function (data.fieldUnion 0) mono born times.stamp_mem_limit + obtain ⟨family, hFamily, familyFunction, familyEntries⟩ := M.exists_groundBirthRestrictionFamily + pairing unions powers separation hω (data.ground 0) hLimit hDomains hBirth + (fun n => (stages n).D) domainEntries function + have finite := state.canonical_birth_oldMeet data pairing unions powers separation + hI hSources hReps hG hT extension born times oldBound oldMeet + have unionBirth := extension.restriction_union (data.fieldUnion 0) born + have unionOldMeet := (data.fieldUnion 1).oldMeet (data.fieldUnion 2) unionBirth finite + (fun _ _ h => (state.canonical_iterate_graphs_mono pairing unions powers separation + hI hSources hReps hG hT h).2.2.1) + (fun _ _ h => NatBirthExtensionCode.restriction_mono mono h) + refine ⟨⟨stamps, hStamps, limit, hLimit, times, birth, hBirth, extension, + family, hFamily, familyFunction, familyEntries, born, oldBound, function, + extension.restriction_zero mono born, finite, unionOldMeet, ?_⟩⟩ + intro x entry + exact ZFSet.mem_irrefl limit (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + +end PartitionPilot.Forcing.GroundCompressionState + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionCarrierRankBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionCarrierRankBounds.lean index fb5165918a67a005bd53f583817e068ab3d1ebc2..4254d1290b6ddef16f1b9e6264cd58b201c3e6b7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionCarrierRankBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionCarrierRankBounds.lean @@ -1,85 +1,85 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionOrigin - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u - -namespace GroundInaccessibleConditions -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} - -theorem exists_rank_limit_above (conditions : GroundInaccessibleConditions M K) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) {o : Ordinal.{u}} (bound : o < ZFSet.rank K) : - ∃ L ∈ K, Order.IsSuccLimit (ZFSet.rank L) ∧ o < ZFSet.rank L := by - have hBase : ordinalCode o ∈ K := by - rw [ordinalSetProperty_eq_code_rank K conditions.1] - exact (mem_ordinalCode_iff o (ZFSet.rank K)).2 bound - obtain ⟨_, _, L, _, _, _, hL, limit, above⟩ := M.exists_groundCompressionStamps_below - pairing unions powers separation collection infinite hK conditions hBase - refine ⟨L, hL, limit, ?_⟩ - simpa only [rank_ordinalCode] using ZFSet.rank_lt_of_mem above - -end GroundInaccessibleConditions - -namespace GroundCompressionUnionData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T : ZFSet.{u}} -variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) - -theorem carrier_rank_lt_inaccessible - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K P r μ : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (constant : RecursiveTemplateConstancy P r μ initial) - (points : ZFSet.rank initial.D < ZFSet.rank K) (indices : ZFSet.rank initial.J < ZFSet.rank K) - (templates : ZFSet.rank P < ZFSet.rank K) (tasks : ZFSet.rank I < ZFSet.rank K) : - ZFSet.rank (data.fields 0) < ZFSet.rank K := by - let b := max (ZFSet.rank initial.D) (max (ZFSet.rank initial.J) (max (ZFSet.rank P) (ZFSet.rank I))) - have bound : b < ZFSet.rank K := max_lt points (max_lt indices (max_lt templates tasks)) - obtain ⟨L, hL, limit, above⟩ := conditions.exists_rank_limit_above - pairing unions powers separation collection infinite hK bound - have pointBound : ZFSet.rank initial.D ≤ b := le_max_left _ _ - have indexBound : ZFSet.rank initial.J ≤ b := (le_max_left _ _).trans (le_max_right _ _) - have templateBound : ZFSet.rank P ≤ b := - (le_max_left _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) - have taskBound : ZFSet.rank I ≤ b := - (le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) - exact (data.carrier_rank_le constant limit (pointBound.trans_lt above) (indexBound.trans_lt above) - (templateBound.trans_lt above) (taskBound.trans_lt above)).trans_lt (ZFSet.rank_lt_of_mem hL) - -end GroundCompressionUnionData - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem initialCompressionUnion_rank_lt - {P G r μ A Labels Sources Reps m one T K : ZFSet.{u}} - (data : GroundCompressionUnionData M (M.initialCompressionData P G r μ A Labels) - (M.groundEligibleTasks P G r μ A Labels) Sources Reps G m one T) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (points : ZFSet.rank P < ZFSet.rank K) (labels : ZFSet.rank Labels < ZFSet.rank K) : - ZFSet.rank (data.fields 0) < ZFSet.rank K := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - have tasks := M.groundEligibleTasks_rank_lt limit G r μ A points labels - exact data.carrier_rank_lt_inaccessible pairing unions powers separation collection infinite hK conditions - (M.initialCompressionData_template_constancy P G r μ A Labels) points tasks points tasks - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionOrigin + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u + +namespace GroundInaccessibleConditions +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} + +theorem exists_rank_limit_above (conditions : GroundInaccessibleConditions M K) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) {o : Ordinal.{u}} (bound : o < ZFSet.rank K) : + ∃ L ∈ K, Order.IsSuccLimit (ZFSet.rank L) ∧ o < ZFSet.rank L := by + have hBase : ordinalCode o ∈ K := by + rw [ordinalSetProperty_eq_code_rank K conditions.1] + exact (mem_ordinalCode_iff o (ZFSet.rank K)).2 bound + obtain ⟨_, _, L, _, _, _, hL, limit, above⟩ := M.exists_groundCompressionStamps_below + pairing unions powers separation collection infinite hK conditions hBase + refine ⟨L, hL, limit, ?_⟩ + simpa only [rank_ordinalCode] using ZFSet.rank_lt_of_mem above + +end GroundInaccessibleConditions + +namespace GroundCompressionUnionData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T : ZFSet.{u}} +variable (data : GroundCompressionUnionData M initial I Sources Reps G m one T) + +theorem carrier_rank_lt_inaccessible + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K P r μ : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (constant : RecursiveTemplateConstancy P r μ initial) + (points : ZFSet.rank initial.D < ZFSet.rank K) (indices : ZFSet.rank initial.J < ZFSet.rank K) + (templates : ZFSet.rank P < ZFSet.rank K) (tasks : ZFSet.rank I < ZFSet.rank K) : + ZFSet.rank (data.fields 0) < ZFSet.rank K := by + let b := max (ZFSet.rank initial.D) (max (ZFSet.rank initial.J) (max (ZFSet.rank P) (ZFSet.rank I))) + have bound : b < ZFSet.rank K := max_lt points (max_lt indices (max_lt templates tasks)) + obtain ⟨L, hL, limit, above⟩ := conditions.exists_rank_limit_above + pairing unions powers separation collection infinite hK bound + have pointBound : ZFSet.rank initial.D ≤ b := le_max_left _ _ + have indexBound : ZFSet.rank initial.J ≤ b := (le_max_left _ _).trans (le_max_right _ _) + have templateBound : ZFSet.rank P ≤ b := + (le_max_left _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) + have taskBound : ZFSet.rank I ≤ b := + (le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) + exact (data.carrier_rank_le constant limit (pointBound.trans_lt above) (indexBound.trans_lt above) + (templateBound.trans_lt above) (taskBound.trans_lt above)).trans_lt (ZFSet.rank_lt_of_mem hL) + +end GroundCompressionUnionData + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem initialCompressionUnion_rank_lt + {P G r μ A Labels Sources Reps m one T K : ZFSet.{u}} + (data : GroundCompressionUnionData M (M.initialCompressionData P G r μ A Labels) + (M.groundEligibleTasks P G r μ A Labels) Sources Reps G m one T) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (points : ZFSet.rank P < ZFSet.rank K) (labels : ZFSet.rank Labels < ZFSet.rank K) : + ZFSet.rank (data.fields 0) < ZFSet.rank K := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + have tasks := M.groundEligibleTasks_rank_lt limit G r μ A points labels + exact data.carrier_rank_lt_inaccessible pairing unions powers separation collection infinite hK conditions + (M.initialCompressionData_template_constancy P G r μ A Labels) points tasks points tasks + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean index f3fb9b14390083d55c77580e04ab93b5cc0d431e..91a1ad103a5947effb9de130122e47752ee78f24 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCompressionPrefixGraphs.lean @@ -1,287 +1,287 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u - -noncomputable def compressionPrefixValue (base limit : ZFSet.{u}) - (prior : ZFSet.{u} → ZFSet.{u}) (stages : Nat → ZFSet.{u}) (final s : ZFSet.{u}) : ZFSet.{u} := by - classical - exact if s ∈ base ∨ s = base then prior s else - if s = limit then final else - if witnessed : ∃ n, s = compressionStamp base n then stages witnessed.choose else ∅ - -variable {base limit : ZFSet.{u}} -variable (prior : ZFSet.{u} → ZFSet.{u}) (stages : Nat → ZFSet.{u}) (final : ZFSet.{u}) - -theorem compressionPrefixValue_old {s : ZFSet.{u}} (old : s ∈ base ∨ s = base) : - compressionPrefixValue base limit prior stages final s = prior s := by - classical - simp only [compressionPrefixValue, ite_eq_left old] - -theorem compressionPrefixValue_stamp {stamps : ZFSet.{u}} - (times : CompressionStampCode base stamps limit) (n : Nat) : - compressionPrefixValue base limit prior stages final (compressionStamp base n) = stages n := by - classical - have notOld : ¬(compressionStamp base n ∈ base ∨ compressionStamp base n = base) := - fun h => h.elim (compressionStamp_not_old base n).1 (compressionStamp_not_old base n).2 - have witnessed : ∃ k, compressionStamp base n = compressionStamp base k := ⟨n, rfl⟩ - simp only [compressionPrefixValue, ite_eq_right notOld, - ite_eq_right (times.stamp_ne_limit n), dite_eq_left witnessed] - exact congrArg stages ((compressionStamp_injective base witnessed.choose_spec).symm) - -theorem compressionPrefixValue_limit {stamps : ZFSet.{u}} - (times : CompressionStampCode base stamps limit) : - compressionPrefixValue base limit prior stages final limit = final := by - classical - have notOld : ¬(limit ∈ base ∨ limit = base) := by - rintro (member | equal) - · exact ZFSet.mem_asymm member times.base_mem_limit - · have member := times.base_mem_limit - rw [equal] at member - exact ZFSet.mem_irrefl base member - simp only [compressionPrefixValue, ite_eq_right notOld, ite_true] - -theorem compressionPrefixValue_eq_prior_below {stamps t s : ZFSet.{u}} - (times : CompressionStampCode base stamps limit) - (old : t ∈ base ∨ t = base) (before : s ∈ t) : - compressionPrefixValue base limit prior stages final s = prior s := by - apply compressionPrefixValue_old prior stages final - apply Or.inl - rcases old with member | equal - · exact (ordinalSetProperty_member times.ordinal times.base_mem_limit).1 t member s before - · exact equal ▸ before - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem compressionPrefixValue_mem {stamps s : ZFSet.{u}} - (times : CompressionStampCode base stamps limit) - (priorGround : ∀ t, t ∈ base ∨ t = base → prior t ∈ M.sets) - (stageGround : ∀ n, stages n ∈ M.sets) (finalGround : final ∈ M.sets) - (cutoff : s ∈ insert limit limit) : - compressionPrefixValue base limit prior stages final s ∈ M.sets := by - rcases ZFSet.mem_insert_iff.1 cutoff with equal | before - · rw [equal, compressionPrefixValue_limit prior stages final times] - exact finalGround - · rcases (times.mem_limit_iff s).1 before with member | equal | ⟨n, equal⟩ - · rw [compressionPrefixValue_old prior stages final (Or.inl member)] - exact priorGround s (Or.inl member) - · rw [compressionPrefixValue_old prior stages final (Or.inr equal)] - exact priorGround s (Or.inr equal) - · rw [equal, compressionPrefixValue_stamp prior stages final times n] - exact stageGround n - -end TransitiveGround - -end - -open SetFormula -universe u - -structure GroundChronologyFields (M : TransitiveGround.{u}) (T : ZFSet.{u}) where - time_ground : T ∈ M.sets - bound : ZFSet.{u} - bound_ground : bound ∈ M.sets - graph : Fin 5 → ZFSet.{u} - graph_ground : ∀ j, graph j ∈ M.sets - function : ∀ j, ZFSet.IsFunc T bound (graph j) - -namespace GroundChronologyFields -variable {M : TransitiveGround.{u}} {T : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) - -theorem graphFunction (j : Fin 5) : FunctionGraphOn T (fields.graph j) := - ⟨fields.bound, fields.function j⟩ - -noncomputable def value (j : Fin 5) (s : ZFSet.{u}) : ZFSet.{u} := - (fields.graphFunction j).totalValue s - -theorem value_entry (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ T) : - ZFSet.pair s (fields.value j s) ∈ fields.graph j := - (fields.graphFunction j).totalValue_entry hs - -theorem value_eq_of_entry (j : Fin 5) {s x : ZFSet.{u}} - (entry : ZFSet.pair s x ∈ fields.graph j) : fields.value j s = x := - (fields.graphFunction j).totalValue_eq_of_entry entry - -theorem value_ground (j : Fin 5) (s : ZFSet.{u}) : fields.value j s ∈ M.sets := - (fields.graphFunction j).totalValue_ground M (fields.graph_ground j) s - -theorem value_mem_bound (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ T) : - fields.value j s ∈ fields.bound := - (ZFSet.pair_mem_prod.1 ((fields.function j).1 (fields.value_entry j hs))).2 - -noncomputable def codeFields : Fin 7 → ZFSet.{u} := - Fin.cases T (Fin.cases fields.bound fields.graph) - -noncomputable def code : ZFSet.{u} := nonemptyTupleCode 6 fields.codeFields - -theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - fields.code ∈ M.sets := - M.nonemptyTupleCode_mem pairing 6 fields.codeFields - (Fin.cases fields.time_ground (Fin.cases fields.bound_ground fields.graph_ground)) - -theorem code_eq_iff (other : GroundChronologyFields M T) : - fields.code = other.code ↔ fields.bound = other.bound ∧ fields.graph = other.graph := by - constructor - · intro equal - have same := nonemptyTupleCode_injective 6 equal - exact ⟨congrFun same 1, funext (fun j => congrFun same j.succ.succ)⟩ - · rintro ⟨bound, graph⟩ - apply congrArg (nonemptyTupleCode 6) - funext i - exact Fin.cases rfl (Fin.cases bound (fun j => congrFun graph j)) i - -end GroundChronologyFields - -noncomputable def compressionPrefixGraph (base limit old stages stamps final : ZFSet.{u}) : ZFSet.{u} := - insert (ZFSet.pair limit final) (graphRestriction (insert base base) old ∪ - relationCompose limit ZFSet.omega (ZFSet.sUnion (ZFSet.sUnion stages)) - (relationConverse ZFSet.omega limit stamps) stages) - -theorem compressionPrefixGraph_entries {base limit old stages stamps final s y : ZFSet.{u}} - (times : CompressionStampCode base stamps limit) : - ZFSet.pair s y ∈ compressionPrefixGraph base limit old stages stamps final ↔ - (s = limit ∧ y = final) ∨ - ((s ∈ base ∨ s = base) ∧ ZFSet.pair s y ∈ old) ∨ - ∃ n, s = compressionStamp base n ∧ ZFSet.pair (natSetCode n) y ∈ stages := by - rw [compressionPrefixGraph, ZFSet.mem_insert_iff, ZFSet.mem_union, - ZFSet.pair_inj, pair_mem_graphRestriction, pair_mem_relationCompose] - constructor - · rintro (terminal | ⟨entry, old⟩ | ⟨_, _, k, hk, reverse, entry⟩) - · exact Or.inl terminal - · exact Or.inr (Or.inl ⟨(ZFSet.mem_insert_iff.1 old).symm, entry⟩) - · obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk - exact Or.inr (Or.inr ⟨n, - (times.entries n s).1 ((pair_mem_relationConverse _ _ _ _ _).1 reverse).2.2, entry⟩) - · rintro (terminal | ⟨old, entry⟩ | ⟨n,rfl,entry⟩) - · exact Or.inl terminal - · exact Or.inr (Or.inl ⟨entry, ZFSet.mem_insert_iff.2 old.symm⟩) - · exact Or.inr (Or.inr ⟨times.stamp_mem_limit n, pair_second_mem_doubleUnion entry, - natSetCode n, natSetCode_mem_omega n, - (pair_mem_relationConverse _ _ _ _ _).2 ⟨natSetCode_mem_omega n, - times.stamp_mem_limit n, (times.entries n _).2 rfl⟩, entry⟩) - -theorem compressionPrefixGraph_exact {base limit old stages stamps final : ZFSet.{u}} - (times : CompressionStampCode base stamps limit) - (prior : ZFSet.{u} → ZFSet.{u}) (finite : Nat → ZFSet.{u}) - (oldEntries : ∀ s, s ∈ base ∨ s = base → ∀ y, ZFSet.pair s y ∈ old ↔ y = prior s) - (finiteEntries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ stages ↔ y = finite n) - (s y : ZFSet.{u}) : - ZFSet.pair s y ∈ compressionPrefixGraph base limit old stages stamps final ↔ - s ∈ insert limit limit ∧ y = compressionPrefixValue base limit prior finite final s := by - rw [compressionPrefixGraph_entries times] - constructor - · rintro (⟨rfl,equal⟩ | ⟨before,entry⟩ | ⟨n,rfl,entry⟩) - · exact ⟨ZFSet.mem_insert _ _, equal.trans (compressionPrefixValue_limit prior finite final times).symm⟩ - · exact ⟨ZFSet.mem_insert_of_mem _ ((times.mem_limit_iff s).2 - (before.elim Or.inl (fun h => Or.inr (Or.inl h)))), - ((oldEntries s before y).1 entry).trans - (compressionPrefixValue_old prior finite final before).symm⟩ - · exact ⟨ZFSet.mem_insert_of_mem _ (times.stamp_mem_limit n), - ((finiteEntries n y).1 entry).trans - (compressionPrefixValue_stamp prior finite final times n).symm⟩ - · rintro ⟨hs,equal⟩ - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · exact Or.inl ⟨rfl,equal.trans (compressionPrefixValue_limit prior finite final times)⟩ - · rcases (times.mem_limit_iff s).1 hs with before | same | ⟨n,rfl⟩ - · exact Or.inr (Or.inl ⟨Or.inl before, (oldEntries s (Or.inl before) y).2 - (equal.trans (compressionPrefixValue_old prior finite final (Or.inl before)))⟩) - · exact Or.inr (Or.inl ⟨Or.inr same, (oldEntries s (Or.inr same) y).2 - (equal.trans (compressionPrefixValue_old prior finite final (Or.inr same)))⟩) - · exact Or.inr (Or.inr ⟨n,rfl,(finiteEntries n y).2 - (equal.trans (compressionPrefixValue_stamp prior finite final times n))⟩) - -theorem compressionPrefixGraph_function {base limit old stages stamps final : ZFSet.{u}} - (times : CompressionStampCode base stamps limit) - (prior : ZFSet.{u} → ZFSet.{u}) (finite : Nat → ZFSet.{u}) - (oldEntries : ∀ s, s ∈ base ∨ s = base → ∀ y, ZFSet.pair s y ∈ old ↔ y = prior s) - (finiteEntries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ stages ↔ y = finite n) : - FunctionGraphOn (insert limit limit) (compressionPrefixGraph base limit old stages stamps final) := by - let graph := compressionPrefixGraph base limit old stages stamps final - have entries := compressionPrefixGraph_exact (final := final) times prior finite oldEntries finiteEntries - refine ⟨ZFSet.sUnion (ZFSet.sUnion graph), ?_, ?_⟩ - · intro z hz - have shape : ∃ s y, z = ZFSet.pair s y := by - rcases ZFSet.mem_insert_iff.1 hz with rfl | member - · exact ⟨limit,final,rfl⟩ - · rcases ZFSet.mem_union.1 member with left | right - · obtain ⟨s,_,y,rfl,_⟩ := mem_graphRestriction.1 left - exact ⟨s,y,rfl⟩ - · obtain ⟨s,_,_,_,y,_,rfl,_,_⟩ := (mem_relationCompose _ _ _ _ _ _).1 right - exact ⟨s,y,rfl⟩ - obtain ⟨s,y,rfl⟩ := shape - exact ZFSet.pair_mem_prod.2 ⟨((entries s y).1 hz).1,pair_second_mem_doubleUnion hz⟩ - · intro s hs - exact ⟨compressionPrefixValue base limit prior finite final s, - (entries s _).2 ⟨hs,rfl⟩, fun y hy => ((entries s y).1 hy).2⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem compressionPrefixGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {base limit old stages stamps final : ZFSet.{u}} - (hOmega : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - (hBase : base ∈ M.sets) (hLimit : limit ∈ M.sets) (hOld : old ∈ M.sets) - (hStages : stages ∈ M.sets) (hStamps : stamps ∈ M.sets) (hFinal : final ∈ M.sets) : - compressionPrefixGraph base limit old stages stamps final ∈ M.sets := by - have hBefore := M.insert_mem pairing unions hBase hBase - have hBound := M.union_mem unions (M.union_mem unions hStages) - exact M.insert_mem pairing unions (M.orderedPair_mem pairing hLimit hFinal) - (M.binary_union_mem pairing unions (M.graphRestriction_mem unions separation hBefore hOld) - (M.relationCompose_mem pairing unions powers separation hLimit hOmega hBound - (M.relationConverse_mem pairing unions powers separation hOmega hLimit hStamps) hStages)) - -end TransitiveGround - -namespace GroundChronologyFields -variable {M : TransitiveGround.{u}} {T : ZFSet.{u}} - -noncomputable def ofGraphs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (hT : T ∈ M.sets) (graphs : Fin 5 → ZFSet.{u}) - (ground : ∀ j, graphs j ∈ M.sets) (functions : ∀ j, FunctionGraphOn T (graphs j)) : - GroundChronologyFields M T := by - let all := graphs 0 ∪ (graphs 1 ∪ (graphs 2 ∪ (graphs 3 ∪ graphs 4))) - have subset (j : Fin 5) : graphs j ⊆ all := by - refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inl hz)) ?_ j - intro j - refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inl hz)))) ?_ j - intro j - refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inl hz)))))) ?_ j - intro j - refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inl hz)))))))) ?_ j - intro j - have equal : j = 0 := Fin.eq_zero j - subst j - exact fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr hz))))))) - refine ⟨hT, ZFSet.sUnion (ZFSet.sUnion all), M.union_mem unions (M.union_mem unions - (M.binary_union_mem pairing unions (ground 0) (M.binary_union_mem pairing unions (ground 1) - (M.binary_union_mem pairing unions (ground 2) (M.binary_union_mem pairing unions (ground 3) (ground 4)))))), - graphs,ground,?_⟩ - intro j - exact ⟨fun z hz => by - obtain ⟨x,hx,y,_,rfl⟩ := ZFSet.mem_prod.1 ((functions j).to_isFunc.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hx,pair_second_mem_doubleUnion (subset j hz)⟩, - (functions j).to_isFunc.2⟩ - -theorem ofGraphs_graph - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (hT : T ∈ M.sets) (graphs : Fin 5 → ZFSet.{u}) - (ground : ∀ j, graphs j ∈ M.sets) (functions : ∀ j, FunctionGraphOn T (graphs j)) : - (ofGraphs pairing unions hT graphs ground functions).graph = graphs := rfl - -end GroundChronologyFields - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u + +noncomputable def compressionPrefixValue (base limit : ZFSet.{u}) + (prior : ZFSet.{u} → ZFSet.{u}) (stages : Nat → ZFSet.{u}) (final s : ZFSet.{u}) : ZFSet.{u} := by + classical + exact if s ∈ base ∨ s = base then prior s else + if s = limit then final else + if witnessed : ∃ n, s = compressionStamp base n then stages witnessed.choose else ∅ + +variable {base limit : ZFSet.{u}} +variable (prior : ZFSet.{u} → ZFSet.{u}) (stages : Nat → ZFSet.{u}) (final : ZFSet.{u}) + +theorem compressionPrefixValue_old {s : ZFSet.{u}} (old : s ∈ base ∨ s = base) : + compressionPrefixValue base limit prior stages final s = prior s := by + classical + simp only [compressionPrefixValue, ite_eq_left old] + +theorem compressionPrefixValue_stamp {stamps : ZFSet.{u}} + (times : CompressionStampCode base stamps limit) (n : Nat) : + compressionPrefixValue base limit prior stages final (compressionStamp base n) = stages n := by + classical + have notOld : ¬(compressionStamp base n ∈ base ∨ compressionStamp base n = base) := + fun h => h.elim (compressionStamp_not_old base n).1 (compressionStamp_not_old base n).2 + have witnessed : ∃ k, compressionStamp base n = compressionStamp base k := ⟨n, rfl⟩ + simp only [compressionPrefixValue, ite_eq_right notOld, + ite_eq_right (times.stamp_ne_limit n), dite_eq_left witnessed] + exact congrArg stages ((compressionStamp_injective base witnessed.choose_spec).symm) + +theorem compressionPrefixValue_limit {stamps : ZFSet.{u}} + (times : CompressionStampCode base stamps limit) : + compressionPrefixValue base limit prior stages final limit = final := by + classical + have notOld : ¬(limit ∈ base ∨ limit = base) := by + rintro (member | equal) + · exact ZFSet.mem_asymm member times.base_mem_limit + · have member := times.base_mem_limit + rw [equal] at member + exact ZFSet.mem_irrefl base member + simp only [compressionPrefixValue, ite_eq_right notOld, ite_true] + +theorem compressionPrefixValue_eq_prior_below {stamps t s : ZFSet.{u}} + (times : CompressionStampCode base stamps limit) + (old : t ∈ base ∨ t = base) (before : s ∈ t) : + compressionPrefixValue base limit prior stages final s = prior s := by + apply compressionPrefixValue_old prior stages final + apply Or.inl + rcases old with member | equal + · exact (ordinalSetProperty_member times.ordinal times.base_mem_limit).1 t member s before + · exact equal ▸ before + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem compressionPrefixValue_mem {stamps s : ZFSet.{u}} + (times : CompressionStampCode base stamps limit) + (priorGround : ∀ t, t ∈ base ∨ t = base → prior t ∈ M.sets) + (stageGround : ∀ n, stages n ∈ M.sets) (finalGround : final ∈ M.sets) + (cutoff : s ∈ insert limit limit) : + compressionPrefixValue base limit prior stages final s ∈ M.sets := by + rcases ZFSet.mem_insert_iff.1 cutoff with equal | before + · rw [equal, compressionPrefixValue_limit prior stages final times] + exact finalGround + · rcases (times.mem_limit_iff s).1 before with member | equal | ⟨n, equal⟩ + · rw [compressionPrefixValue_old prior stages final (Or.inl member)] + exact priorGround s (Or.inl member) + · rw [compressionPrefixValue_old prior stages final (Or.inr equal)] + exact priorGround s (Or.inr equal) + · rw [equal, compressionPrefixValue_stamp prior stages final times n] + exact stageGround n + +end TransitiveGround + +end + +open SetFormula +universe u + +structure GroundChronologyFields (M : TransitiveGround.{u}) (T : ZFSet.{u}) where + time_ground : T ∈ M.sets + bound : ZFSet.{u} + bound_ground : bound ∈ M.sets + graph : Fin 5 → ZFSet.{u} + graph_ground : ∀ j, graph j ∈ M.sets + function : ∀ j, ZFSet.IsFunc T bound (graph j) + +namespace GroundChronologyFields +variable {M : TransitiveGround.{u}} {T : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) + +theorem graphFunction (j : Fin 5) : FunctionGraphOn T (fields.graph j) := + ⟨fields.bound, fields.function j⟩ + +noncomputable def value (j : Fin 5) (s : ZFSet.{u}) : ZFSet.{u} := + (fields.graphFunction j).totalValue s + +theorem value_entry (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ T) : + ZFSet.pair s (fields.value j s) ∈ fields.graph j := + (fields.graphFunction j).totalValue_entry hs + +theorem value_eq_of_entry (j : Fin 5) {s x : ZFSet.{u}} + (entry : ZFSet.pair s x ∈ fields.graph j) : fields.value j s = x := + (fields.graphFunction j).totalValue_eq_of_entry entry + +theorem value_ground (j : Fin 5) (s : ZFSet.{u}) : fields.value j s ∈ M.sets := + (fields.graphFunction j).totalValue_ground M (fields.graph_ground j) s + +theorem value_mem_bound (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ T) : + fields.value j s ∈ fields.bound := + (ZFSet.pair_mem_prod.1 ((fields.function j).1 (fields.value_entry j hs))).2 + +noncomputable def codeFields : Fin 7 → ZFSet.{u} := + Fin.cases T (Fin.cases fields.bound fields.graph) + +noncomputable def code : ZFSet.{u} := nonemptyTupleCode 6 fields.codeFields + +theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + fields.code ∈ M.sets := + M.nonemptyTupleCode_mem pairing 6 fields.codeFields + (Fin.cases fields.time_ground (Fin.cases fields.bound_ground fields.graph_ground)) + +theorem code_eq_iff (other : GroundChronologyFields M T) : + fields.code = other.code ↔ fields.bound = other.bound ∧ fields.graph = other.graph := by + constructor + · intro equal + have same := nonemptyTupleCode_injective 6 equal + exact ⟨congrFun same 1, funext (fun j => congrFun same j.succ.succ)⟩ + · rintro ⟨bound, graph⟩ + apply congrArg (nonemptyTupleCode 6) + funext i + exact Fin.cases rfl (Fin.cases bound (fun j => congrFun graph j)) i + +end GroundChronologyFields + +noncomputable def compressionPrefixGraph (base limit old stages stamps final : ZFSet.{u}) : ZFSet.{u} := + insert (ZFSet.pair limit final) (graphRestriction (insert base base) old ∪ + relationCompose limit ZFSet.omega (ZFSet.sUnion (ZFSet.sUnion stages)) + (relationConverse ZFSet.omega limit stamps) stages) + +theorem compressionPrefixGraph_entries {base limit old stages stamps final s y : ZFSet.{u}} + (times : CompressionStampCode base stamps limit) : + ZFSet.pair s y ∈ compressionPrefixGraph base limit old stages stamps final ↔ + (s = limit ∧ y = final) ∨ + ((s ∈ base ∨ s = base) ∧ ZFSet.pair s y ∈ old) ∨ + ∃ n, s = compressionStamp base n ∧ ZFSet.pair (natSetCode n) y ∈ stages := by + rw [compressionPrefixGraph, ZFSet.mem_insert_iff, ZFSet.mem_union, + ZFSet.pair_inj, pair_mem_graphRestriction, pair_mem_relationCompose] + constructor + · rintro (terminal | ⟨entry, old⟩ | ⟨_, _, k, hk, reverse, entry⟩) + · exact Or.inl terminal + · exact Or.inr (Or.inl ⟨(ZFSet.mem_insert_iff.1 old).symm, entry⟩) + · obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode k).1 hk + exact Or.inr (Or.inr ⟨n, + (times.entries n s).1 ((pair_mem_relationConverse _ _ _ _ _).1 reverse).2.2, entry⟩) + · rintro (terminal | ⟨old, entry⟩ | ⟨n,rfl,entry⟩) + · exact Or.inl terminal + · exact Or.inr (Or.inl ⟨entry, ZFSet.mem_insert_iff.2 old.symm⟩) + · exact Or.inr (Or.inr ⟨times.stamp_mem_limit n, pair_second_mem_doubleUnion entry, + natSetCode n, natSetCode_mem_omega n, + (pair_mem_relationConverse _ _ _ _ _).2 ⟨natSetCode_mem_omega n, + times.stamp_mem_limit n, (times.entries n _).2 rfl⟩, entry⟩) + +theorem compressionPrefixGraph_exact {base limit old stages stamps final : ZFSet.{u}} + (times : CompressionStampCode base stamps limit) + (prior : ZFSet.{u} → ZFSet.{u}) (finite : Nat → ZFSet.{u}) + (oldEntries : ∀ s, s ∈ base ∨ s = base → ∀ y, ZFSet.pair s y ∈ old ↔ y = prior s) + (finiteEntries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ stages ↔ y = finite n) + (s y : ZFSet.{u}) : + ZFSet.pair s y ∈ compressionPrefixGraph base limit old stages stamps final ↔ + s ∈ insert limit limit ∧ y = compressionPrefixValue base limit prior finite final s := by + rw [compressionPrefixGraph_entries times] + constructor + · rintro (⟨rfl,equal⟩ | ⟨before,entry⟩ | ⟨n,rfl,entry⟩) + · exact ⟨ZFSet.mem_insert _ _, equal.trans (compressionPrefixValue_limit prior finite final times).symm⟩ + · exact ⟨ZFSet.mem_insert_of_mem _ ((times.mem_limit_iff s).2 + (before.elim Or.inl (fun h => Or.inr (Or.inl h)))), + ((oldEntries s before y).1 entry).trans + (compressionPrefixValue_old prior finite final before).symm⟩ + · exact ⟨ZFSet.mem_insert_of_mem _ (times.stamp_mem_limit n), + ((finiteEntries n y).1 entry).trans + (compressionPrefixValue_stamp prior finite final times n).symm⟩ + · rintro ⟨hs,equal⟩ + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · exact Or.inl ⟨rfl,equal.trans (compressionPrefixValue_limit prior finite final times)⟩ + · rcases (times.mem_limit_iff s).1 hs with before | same | ⟨n,rfl⟩ + · exact Or.inr (Or.inl ⟨Or.inl before, (oldEntries s (Or.inl before) y).2 + (equal.trans (compressionPrefixValue_old prior finite final (Or.inl before)))⟩) + · exact Or.inr (Or.inl ⟨Or.inr same, (oldEntries s (Or.inr same) y).2 + (equal.trans (compressionPrefixValue_old prior finite final (Or.inr same)))⟩) + · exact Or.inr (Or.inr ⟨n,rfl,(finiteEntries n y).2 + (equal.trans (compressionPrefixValue_stamp prior finite final times n))⟩) + +theorem compressionPrefixGraph_function {base limit old stages stamps final : ZFSet.{u}} + (times : CompressionStampCode base stamps limit) + (prior : ZFSet.{u} → ZFSet.{u}) (finite : Nat → ZFSet.{u}) + (oldEntries : ∀ s, s ∈ base ∨ s = base → ∀ y, ZFSet.pair s y ∈ old ↔ y = prior s) + (finiteEntries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ stages ↔ y = finite n) : + FunctionGraphOn (insert limit limit) (compressionPrefixGraph base limit old stages stamps final) := by + let graph := compressionPrefixGraph base limit old stages stamps final + have entries := compressionPrefixGraph_exact (final := final) times prior finite oldEntries finiteEntries + refine ⟨ZFSet.sUnion (ZFSet.sUnion graph), ?_, ?_⟩ + · intro z hz + have shape : ∃ s y, z = ZFSet.pair s y := by + rcases ZFSet.mem_insert_iff.1 hz with rfl | member + · exact ⟨limit,final,rfl⟩ + · rcases ZFSet.mem_union.1 member with left | right + · obtain ⟨s,_,y,rfl,_⟩ := mem_graphRestriction.1 left + exact ⟨s,y,rfl⟩ + · obtain ⟨s,_,_,_,y,_,rfl,_,_⟩ := (mem_relationCompose _ _ _ _ _ _).1 right + exact ⟨s,y,rfl⟩ + obtain ⟨s,y,rfl⟩ := shape + exact ZFSet.pair_mem_prod.2 ⟨((entries s y).1 hz).1,pair_second_mem_doubleUnion hz⟩ + · intro s hs + exact ⟨compressionPrefixValue base limit prior finite final s, + (entries s _).2 ⟨hs,rfl⟩, fun y hy => ((entries s y).1 hy).2⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem compressionPrefixGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {base limit old stages stamps final : ZFSet.{u}} + (hOmega : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + (hBase : base ∈ M.sets) (hLimit : limit ∈ M.sets) (hOld : old ∈ M.sets) + (hStages : stages ∈ M.sets) (hStamps : stamps ∈ M.sets) (hFinal : final ∈ M.sets) : + compressionPrefixGraph base limit old stages stamps final ∈ M.sets := by + have hBefore := M.insert_mem pairing unions hBase hBase + have hBound := M.union_mem unions (M.union_mem unions hStages) + exact M.insert_mem pairing unions (M.orderedPair_mem pairing hLimit hFinal) + (M.binary_union_mem pairing unions (M.graphRestriction_mem unions separation hBefore hOld) + (M.relationCompose_mem pairing unions powers separation hLimit hOmega hBound + (M.relationConverse_mem pairing unions powers separation hOmega hLimit hStamps) hStages)) + +end TransitiveGround + +namespace GroundChronologyFields +variable {M : TransitiveGround.{u}} {T : ZFSet.{u}} + +noncomputable def ofGraphs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (hT : T ∈ M.sets) (graphs : Fin 5 → ZFSet.{u}) + (ground : ∀ j, graphs j ∈ M.sets) (functions : ∀ j, FunctionGraphOn T (graphs j)) : + GroundChronologyFields M T := by + let all := graphs 0 ∪ (graphs 1 ∪ (graphs 2 ∪ (graphs 3 ∪ graphs 4))) + have subset (j : Fin 5) : graphs j ⊆ all := by + refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inl hz)) ?_ j + intro j + refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inl hz)))) ?_ j + intro j + refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inl hz)))))) ?_ j + intro j + refine Fin.cases (fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inl hz)))))))) ?_ j + intro j + have equal : j = 0 := Fin.eq_zero j + subst j + exact fun _ hz => ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr (ZFSet.mem_union.2 (Or.inr hz))))))) + refine ⟨hT, ZFSet.sUnion (ZFSet.sUnion all), M.union_mem unions (M.union_mem unions + (M.binary_union_mem pairing unions (ground 0) (M.binary_union_mem pairing unions (ground 1) + (M.binary_union_mem pairing unions (ground 2) (M.binary_union_mem pairing unions (ground 3) (ground 4)))))), + graphs,ground,?_⟩ + intro j + exact ⟨fun z hz => by + obtain ⟨x,hx,y,_,rfl⟩ := ZFSet.mem_prod.1 ((functions j).to_isFunc.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hx,pair_second_mem_doubleUnion (subset j hz)⟩, + (functions j).to_isFunc.2⟩ + +theorem ofGraphs_graph + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (hT : T ∈ M.sets) (graphs : Fin 5 → ZFSet.{u}) + (ground : ∀ j, graphs j ∈ M.sets) (functions : ∀ j, FunctionGraphOn T (graphs j)) : + (ofGraphs pairing unions hT graphs ground functions).graph = graphs := rfl + +end GroundChronologyFields + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionClosure.lean index 6f2b564b3b86caf66b7d298f5a4d1649d14a6766..f1e6a5f95ebb5589a3209032a86f2d439e795e9f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionClosure.lean @@ -1,564 +1,564 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRationalCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCountableFunctionForcing -import OAI.SetTheory.PartitionPrinciple.Forcing.UniformGroundSizeWitnesses - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def indexedSizeRelation (U R W N g F : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ U, ∃ n ∈ N, ∃ k ∈ N, ∃ p ∈ R, ∃ f ∈ W, - z = ZFSet.pair (ZFSet.pair n k) x ∧ ZFSet.pair n p ∈ g ∧ - ZFSet.pair p f ∈ F ∧ ZFSet.pair x k ∈ f) (ZFSet.prod (ZFSet.prod N N) U) - -theorem pair_mem_indexedSizeRelation (U R W N g F v x : ZFSet.{u}) : - ZFSet.pair v x ∈ indexedSizeRelation U R W N g F ↔ - x ∈ U ∧ ∃ n ∈ N, ∃ k ∈ N, v = ZFSet.pair n k ∧ ∃ p ∈ R, ∃ f ∈ W, - ZFSet.pair n p ∈ g ∧ ZFSet.pair p f ∈ F ∧ ZFSet.pair x k ∈ f := by - rw [indexedSizeRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, y, hy, n, hn, k, hk, p, hp, f, hf, eq, ng, pf, yk⟩ - obtain ⟨first, second⟩ := ZFSet.pair_inj.1 eq - exact ⟨second.symm ▸ hy, n, hn, k, hk, first, p, hp, f, hf, ng, pf, second.symm ▸ yk⟩ - · rintro ⟨hx, n, hn, k, hk, rfl, p, hp, f, hf, ng, pf, xk⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hn, hk⟩, hx⟩, - x, hx, n, hn, k, hk, p, hp, f, hf, rfl, ng, pf, xk⟩ - -theorem indexedSizeRelation_partial {U R W N g F : ZFSet.{u}} - (enumeration : ZFSet.IsFunc N R g) (family : ZFSet.IsFunc R W F) - (codes : ∀ p f, ZFSet.pair p f ∈ F → InjectionCode p N f) : - PartialFunctionCode (ZFSet.prod N N) U (indexedSizeRelation U R W N g F) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro v x y vx vy - obtain ⟨_, n, hn, k, _, vn, p, hp, f, _, np, pf, xk⟩ := - (pair_mem_indexedSizeRelation U R W N g F v x).1 vx - obtain ⟨_, m, _, l, _, vm, q, _, h, _, mq, qh, yl⟩ := - (pair_mem_indexedSizeRelation U R W N g F v y).1 vy - obtain ⟨nm, kl⟩ := ZFSet.pair_inj.1 (vn.symm.trans vm) - subst m - subst l - obtain ⟨a, _, uniqueP⟩ := enumeration.2 n hn - have pq := (uniqueP p np).trans (uniqueP q mq).symm - subst q - obtain ⟨b, _, uniqueF⟩ := family.2 p hp - have fh := (uniqueF f pf).trans (uniqueF h qh).symm - subst h - exact (codes p f pf).injective x y k xk yl - -theorem indexedSizeRelation_onto {R W N g F : ZFSet.{u}} - (onto : ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ g) (family : ZFSet.IsFunc R W F) - (codes : ∀ p f, ZFSet.pair p f ∈ F → InjectionCode p N f) : - ∀ x ∈ ⋃₀ R, ∃ v ∈ ZFSet.prod N N, - ZFSet.pair v x ∈ indexedSizeRelation (⋃₀ R) R W N g F := by - intro x hx - obtain ⟨p, hp, xp⟩ := ZFSet.mem_sUnion.1 hx - obtain ⟨n, hn, np⟩ := onto p hp - obtain ⟨f, pf, _⟩ := family.2 p hp - have hf := (ZFSet.pair_mem_prod.1 (family.1 pf)).2 - have code := codes p f pf - obtain ⟨k, xk, _⟩ := code.function.2 x xp - have hk := (ZFSet.pair_mem_prod.1 (code.function.1 xk)).2 - exact ⟨ZFSet.pair n k, ZFSet.pair_mem_prod.2 ⟨hn, hk⟩, - (pair_mem_indexedSizeRelation (⋃₀ R) R W N g F _ x).2 - ⟨hx, n, hn, k, hk, rfl, p, hp, f, hf, np, pf, xk⟩⟩ - -namespace BoundedFormula - -open SetFormula - -def indexedSizeEntryFormula {k} (z u r w n g f : Fin k) : BoundedFormula k := - exMem u (exMem n.succ (exMem n.succ.succ (exMem r.succ.succ.succ (exMem w.succ.succ.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ 3 2 4) - (.conj (pairMembershipFormula 3 1 g.succ.succ.succ.succ.succ) - (.conj (pairMembershipFormula 1 0 f.succ.succ.succ.succ.succ) - (pairMembershipFormula 4 2 0)))))))) - -theorem truth_indexedSizeEntryFormula {k} (z u r w n g f : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (indexedSizeEntryFormula z u r w n g f) env ↔ - ∃ x ∈ env u, ∃ i ∈ env n, ∃ j ∈ env n, ∃ p ∈ env r, ∃ h ∈ env w, - env z = ZFSet.pair (ZFSet.pair i j) x ∧ ZFSet.pair i p ∈ env g ∧ - ZFSet.pair p h ∈ env f ∧ ZFSet.pair x j ∈ h := by - simp only [indexedSizeEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem indexedSizeRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U R W N g F : ZFSet.{u}} (hU : U ∈ M.sets) (hR : R ∈ M.sets) (hW : W ∈ M.sets) - (hN : N ∈ M.sets) (hg : g ∈ M.sets) (hF : F ∈ M.sets) : - indexedSizeRelation U R W N g F ∈ M.sets := by - let params := extend U (extend R (extend W (extend N (extend g (extend F Fin.elim0))))) - have selected := M.bounded_separation_mem separation (BoundedFormula.indexedSizeEntryFormula 0 1 2 3 4 5 6) - params (Fin.cases hU (Fin.cases hR (Fin.cases hW (Fin.cases hN (Fin.cases hg - (Fin.cases hF (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hN hN) hU) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.indexedSizeEntryFormula 0 1 2 3 4 5 6) - (extend z params)) (ZFSet.prod (ZFSet.prod N N) U) = indexedSizeRelation U R W N g F := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, indexedSizeRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_indexedSizeEntryFormula 0 1 2 3 4 5 6 _) - exact eq ▸ selected - -theorem groundEmbeddable_of_partial_surjection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A B r : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hr : r ∈ M.sets) - (code : PartialFunctionCode A B r) (onto : ∀ y ∈ B, ∃ x ∈ A, ZFSet.pair x y ∈ r) : - M.groundEmbeddable B A := by - have inverse := M.relationConverse_mem pairing unions powers separation hA hB hr - have total (y : ZFSet.{u}) (hy : y ∈ B) : ∃ x ∈ A, ZFSet.pair y x ∈ relationConverse A B r := by - obtain ⟨x, hx, rel⟩ := onto y hy - exact ⟨x, hx, (pair_mem_relationConverse A B r x y).2 ⟨hx, hy, rel⟩⟩ - obtain ⟨f, hf, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice hB hA inverse total - exact ⟨f, hf, func, fun x y z hx hy => code.unique z x y - ((pair_mem_relationConverse A B r z x).1 (selected hx)).2.2 - ((pair_mem_relationConverse A B r z y).1 (selected hy)).2.2⟩ - -end TransitiveGround - - - - - -noncomputable def unionSizeRelation (U R W D F : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ x ∈ U, ∃ A ∈ R, ∃ k ∈ D, ∃ f ∈ W, - z = ZFSet.pair (ZFSet.pair A k) x ∧ ZFSet.pair A f ∈ F ∧ ZFSet.pair x k ∈ f) - (ZFSet.prod (ZFSet.prod R D) U) - -theorem pair_mem_unionSizeRelation (U R W D F v x : ZFSet.{u}) : - ZFSet.pair v x ∈ unionSizeRelation U R W D F ↔ - x ∈ U ∧ ∃ A ∈ R, ∃ k ∈ D, v = ZFSet.pair A k ∧ - ∃ f ∈ W, ZFSet.pair A f ∈ F ∧ ZFSet.pair x k ∈ f := by - rw [unionSizeRelation, ZFSet.mem_sep] - constructor - · rintro ⟨_, y, hy, A, hA, k, hk, f, hf, equal, selected, value⟩ - obtain ⟨first, second⟩ := ZFSet.pair_inj.1 equal - exact ⟨second.symm ▸ hy, A, hA, k, hk, first, f, hf, selected, second.symm ▸ value⟩ - · rintro ⟨hx, A, hA, k, hk, rfl, f, hf, selected, value⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hA, hk⟩, hx⟩, - x, hx, A, hA, k, hk, f, hf, rfl, selected, value⟩ - -theorem unionSizeRelation_partial {U R W D F : ZFSet.{u}} - (family : ZFSet.IsFunc R W F) - (codes : ∀ A f, ZFSet.pair A f ∈ F → InjectionCode A D f) : - PartialFunctionCode (ZFSet.prod R D) U (unionSizeRelation U R W D F) := by - refine ⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩ - intro v x y first second - obtain ⟨_, A, hA, k, _, va, f, _, selected, value⟩ := - (pair_mem_unionSizeRelation U R W D F v x).1 first - obtain ⟨_, B, _, l, _, vb, g, _, selected', value'⟩ := - (pair_mem_unionSizeRelation U R W D F v y).1 second - obtain ⟨sameA, sameK⟩ := ZFSet.pair_inj.1 (va.symm.trans vb) - subst B - subst l - obtain ⟨_, _, unique⟩ := family.2 A hA - have sameF := (unique f selected).trans (unique g selected').symm - subst g - exact (codes A f selected).injective x y k value value' - -theorem unionSizeRelation_onto {R W D F : ZFSet.{u}} - (family : ZFSet.IsFunc R W F) - (codes : ∀ A f, ZFSet.pair A f ∈ F → InjectionCode A D f) : - ∀ x ∈ ⋃₀ R, ∃ v ∈ ZFSet.prod R D, - ZFSet.pair v x ∈ unionSizeRelation (⋃₀ R) R W D F := by - intro x hx - obtain ⟨A, hA, member⟩ := ZFSet.mem_sUnion.1 hx - obtain ⟨f, selected, _⟩ := family.2 A hA - have hf := (ZFSet.pair_mem_prod.1 (family.1 selected)).2 - have code := codes A f selected - obtain ⟨k, value, _⟩ := code.function.2 x member - have hk := (ZFSet.pair_mem_prod.1 (code.function.1 value)).2 - exact ⟨ZFSet.pair A k, ZFSet.pair_mem_prod.2 ⟨hA, hk⟩, - (pair_mem_unionSizeRelation (⋃₀ R) R W D F _ x).2 - ⟨hx, A, hA, k, hk, rfl, f, hf, selected, value⟩⟩ - -namespace BoundedFormula -open SetFormula - -def unionSizeEntryFormula {n} (z u r w d f : Fin n) : BoundedFormula n := - exMem u (exMem r.succ (exMem d.succ.succ (exMem w.succ.succ.succ - (.conj (orderedTripleFormula z.succ.succ.succ.succ 2 1 3) - (.conj (pairMembershipFormula 2 0 f.succ.succ.succ.succ) - (pairMembershipFormula 3 1 0)))))) - -theorem truth_unionSizeEntryFormula {n} (z u r w d f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (unionSizeEntryFormula z u r w d f) env ↔ - ∃ x ∈ env u, ∃ A ∈ env r, ∃ k ∈ env d, ∃ h ∈ env w, - env z = ZFSet.pair (ZFSet.pair A k) x ∧ - ZFSet.pair A h ∈ env f ∧ ZFSet.pair x k ∈ h := by - simp only [unionSizeEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, - truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem unionSizeRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U R W D F : ZFSet.{u}} (hU : U ∈ M.sets) (hR : R ∈ M.sets) - (hW : W ∈ M.sets) (hD : D ∈ M.sets) (hF : F ∈ M.sets) : - unionSizeRelation U R W D F ∈ M.sets := by - let params := extend U (extend R (extend W (extend D (extend F Fin.elim0)))) - have selected := M.bounded_separation_mem separation (BoundedFormula.unionSizeEntryFormula 0 1 2 3 4 5) - params (Fin.cases hU (Fin.cases hR (Fin.cases hW (Fin.cases hD (Fin.cases hF (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hR hD) hU) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.unionSizeEntryFormula 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod (ZFSet.prod R D) U) = unionSizeRelation U R W D F := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, unionSizeRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_unionSizeEntryFormula 0 1 2 3 4 5 _) - exact equal ▸ selected - -end TransitiveGround - - - - - - -noncomputable def defaultInverse (R N f d : ZFSet.{u}) : ZFSet.{u} := - relationConverse R N f ∪ - ZFSet.prod (ZFSet.sep (fun n => n ∉ relationImage R N f) N) {d} - -theorem pair_mem_defaultInverse (R N f d n p : ZFSet.{u}) : - ZFSet.pair n p ∈ defaultInverse R N f d ↔ - (p ∈ R ∧ n ∈ N ∧ ZFSet.pair p n ∈ f) ∨ - (n ∈ N ∧ n ∉ relationImage R N f ∧ p = d) := by - simp only [defaultInverse, ZFSet.mem_union, pair_mem_relationConverse, - ZFSet.pair_mem_prod, ZFSet.mem_sep, ZFSet.mem_singleton, and_assoc] - -theorem defaultInverse_isFunc {R N f d : ZFSet.{u}} - (code : InjectionCode R N f) (hd : d ∈ R) : - ZFSet.IsFunc N R (defaultInverse R N f d) := by - classical - refine ⟨?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_union.1 hz with hz | hz - · obtain ⟨p, hp, n, hn, rfl, _⟩ := (mem_relationConverse R N f z).1 hz - exact ZFSet.pair_mem_prod.2 ⟨hn, hp⟩ - · obtain ⟨n, hn, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz - exact ZFSet.pair_mem_prod.2 - ⟨(ZFSet.mem_sep.1 hn).1, ZFSet.mem_singleton.1 hp ▸ hd⟩ - · intro n hn - by_cases image : n ∈ relationImage R N f - · obtain ⟨_, p, hp, hpn⟩ := (mem_relationImage R N f n).1 image - refine ⟨p, (pair_mem_defaultInverse R N f d n p).2 (Or.inl ⟨hp, hn, hpn⟩), ?_⟩ - intro q hq - rcases (pair_mem_defaultInverse R N f d n q).1 hq with hq | hq - · exact code.injective q p n hq.2.2 hpn - · exact False.elim (hq.2.1 image) - · refine ⟨d, (pair_mem_defaultInverse R N f d n d).2 (Or.inr ⟨hn, image, rfl⟩), ?_⟩ - intro p hp - rcases (pair_mem_defaultInverse R N f d n p).1 hp with hp | hp - · exact False.elim (image ((mem_relationImage R N f n).2 ⟨hn, p, hp.1, hp.2.2⟩)) - · exact hp.2.2 - -theorem defaultInverse_onto {R N f : ZFSet.{u}} - (code : InjectionCode R N f) (d : ZFSet.{u}) : - ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ defaultInverse R N f d := by - intro p hp - obtain ⟨n, hpn, _⟩ := code.function.2 p hp - have hn := (ZFSet.pair_mem_prod.1 (code.function.1 hpn)).2 - exact ⟨n, hn, (pair_mem_defaultInverse R N f d n p).2 (Or.inl ⟨hp, hn, hpn⟩)⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem defaultInverse_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {R N f d : ZFSet.{u}} - (hR : R ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) (hd : d ∈ M.sets) : - defaultInverse R N f d ∈ M.sets := by - have image := M.relationImage_mem separation hR hN hf - have missing : ZFSet.sep (fun n => n ∉ relationImage R N f) N ∈ M.sets := - M.bounded_separation_mem separation (.neg (.mem 0 1)) - (extend (relationImage R N f) Fin.elim0) (Fin.cases image (fun i => Fin.elim0 i)) hN - have singleton : ({d} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hd hd - exact M.binary_union_mem pairing unions - (M.relationConverse_mem pairing unions powers separation hR hN hf) - (M.prod_mem pairing unions powers separation missing singleton) - -theorem groundEmbeddable_enumeration - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {R N : ZFSet.{u}} (hR : R ∈ M.sets) (hN : N ∈ M.sets) - (nonempty : R.Nonempty) (small : M.groundEmbeddable R N) : - ∃ g ∈ M.sets, ZFSet.IsFunc N R g ∧ - ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ g := by - obtain ⟨d, hd⟩ := nonempty - obtain ⟨f, hf, code⟩ := small - exact ⟨defaultInverse R N f d, - M.defaultInverse_mem pairing unions powers separation hR hN hf (M.transitive hR hd), - defaultInverse_isFunc code hd, defaultInverse_onto code d⟩ - -theorem groundCountable_enumeration - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {R : ZFSet.{u}} (hR : R ∈ M.sets) (nonempty : R.Nonempty) - (small : M.groundEmbeddable R ZFSet.omega) : - ∃ g ∈ M.sets, ZFSet.IsFunc ZFSet.omega R g ∧ - ∀ p ∈ R, ∃ n ∈ ZFSet.omega, ZFSet.pair n p ∈ g := - M.groundEmbeddable_enumeration pairing unions powers separation hR - (M.omega_mem separation infinite) nonempty small - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem enumerated_union_embeds_product - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R B N g : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) (hg : g ∈ M.sets) - (enumeration : ZFSet.IsFunc N R g) (onto : ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ g) - (subsets : ∀ p ∈ R, p ⊆ B) (small : ∀ p ∈ R, M.groundEmbeddable p N) : - M.groundEmbeddable (⋃₀ R) (ZFSet.prod N N) := by - obtain ⟨F, hF, family, codes⟩ := M.uniform_size_witnesses pairing unions powers separation choice - hR hB hN subsets small - have hW := M.groundRelations_mem pairing unions powers separation hB hN - have hU := M.union_mem unions hR - have graph := M.indexedSizeRelation_mem pairing unions powers separation hU hR hW hN hg hF - exact M.groundEmbeddable_of_partial_surjection pairing unions powers separation choice - (M.prod_mem pairing unions powers separation hN hN) hU graph - (indexedSizeRelation_partial enumeration family codes) (indexedSizeRelation_onto onto family codes) - -theorem countable_enumerated_union - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R B g : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hg : g ∈ M.sets) - (enumeration : ZFSet.IsFunc ZFSet.omega R g) - (onto : ∀ p ∈ R, ∃ n ∈ ZFSet.omega, ZFSet.pair n p ∈ g) - (subsets : ∀ p ∈ R, p ⊆ B) (small : ∀ p ∈ R, M.groundEmbeddable p ZFSet.omega) : - M.groundEmbeddable (⋃₀ R) ZFSet.omega := by - have hw := M.omega_mem separation infinite - have hww := M.prod_mem pairing unions powers separation hw hw - obtain ⟨f, hf, code⟩ := M.enumerated_union_embeds_product pairing unions powers separation choice - hR hB hw hg enumeration onto subsets small - obtain ⟨c, hc, ccode⟩ := M.omega_product_countable pairing unions powers separation infinite - exact ⟨relationCompose (⋃₀ R) (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega f c, - M.relationCompose_mem pairing unions powers separation (M.union_mem unions hR) hww hw hf hc, - code.compose ccode⟩ - -theorem countable_union_of_sequence_graph - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {Q B g : ZFSet.{u}} (hQ : Q ∈ M.sets) (hB : B ∈ M.sets) (hg : g ∈ M.sets) - (enumeration : ZFSet.IsFunc ZFSet.omega Q g) - (subsets : ∀ p ∈ Q, p ⊆ B) (small : ∀ p ∈ Q, M.groundEmbeddable p ZFSet.omega) : - (⋃₀ relationImage ZFSet.omega Q g) ∈ M.sets ∧ - M.groundEmbeddable (⋃₀ relationImage ZFSet.omega Q g) ZFSet.omega := by - let R := relationImage ZFSet.omega Q g - have hR := M.relationImage_mem separation (M.omega_mem separation infinite) hQ hg - have restricted : ZFSet.IsFunc ZFSet.omega R g := by - refine ⟨?_, enumeration.2⟩ - intro z hz - obtain ⟨n, hn, p, hp, rfl⟩ := ZFSet.mem_prod.1 (enumeration.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hn, (mem_relationImage ZFSet.omega Q g p).2 ⟨hp, n, hn, hz⟩⟩ - exact ⟨M.union_mem unions hR, - M.countable_enumerated_union pairing unions powers separation infinite choice hR hB hg restricted - (fun p hp => ((mem_relationImage ZFSet.omega Q g p).1 hp).2) - (fun p hp => subsets p ((mem_relationImage ZFSet.omega Q g p).1 hp).1) - (fun p hp => small p ((mem_relationImage ZFSet.omega Q g p).1 hp).1)⟩ - - - - - - -theorem groundCountable_family_union - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {R : ZFSet.{u}} (hR : R ∈ M.sets) - (countR : M.groundEmbeddable R ZFSet.omega) - (small : ∀ p ∈ R, M.groundEmbeddable p ZFSet.omega) : - M.groundEmbeddable (⋃₀ R) ZFSet.omega := by - classical - by_cases nonempty : R.Nonempty - · obtain ⟨g, hg, enumeration, onto⟩ := - M.groundCountable_enumeration pairing unions powers separation infinite hR nonempty countR - exact M.countable_enumerated_union pairing unions powers separation infinite choice - hR (M.union_mem unions hR) hg enumeration onto - (fun p hp _ hz => ZFSet.mem_sUnion.2 ⟨p, hp, hz⟩) small - · have empty : R = ∅ := by - apply ZFSet.ext - intro p - exact ⟨fun hp => False.elim (nonempty ⟨p, hp⟩), fun hp => False.elim (ZFSet.notMem_empty p hp)⟩ - rw [empty, ZFSet.sUnion_empty] - exact M.empty_groundEmbeddable ZFSet.omega ⟨R, hR⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -noncomputable def groundSequenceGraph {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) : ZFSet.{u} := - natPresentation.graph (SetMembers.presentation Q) (fun n => seq n.down) - -noncomputable def groundSequenceUnion {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) : ZFSet.{u} := - ⋃₀ relationImage ZFSet.omega Q (groundSequenceGraph seq) - -theorem mem_groundSequenceUnion {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) (z : ZFSet.{u}) : - z ∈ groundSequenceUnion seq ↔ ∃ n, z ∈ SetMembers.raw (seq n) := by - rw [groundSequenceUnion, ZFSet.mem_sUnion] - constructor - · rintro ⟨p, hp, zp⟩ - obtain ⟨_, n, _, np⟩ := (mem_relationImage ZFSet.omega Q (groundSequenceGraph seq) p).1 hp - obtain ⟨k, eq⟩ := (natPresentation.mem_graph (SetMembers.presentation Q) (fun n => seq n.down) _).1 np - have second := (ZFSet.pair_inj.1 eq).2 - change SetMembers.raw (seq k.down) = p at second - exact ⟨k.down, second.symm ▸ zp⟩ - · rintro ⟨n, hn⟩ - exact ⟨SetMembers.raw (seq n), (mem_relationImage ZFSet.omega Q (groundSequenceGraph seq) _).2 - ⟨SetMembers.raw_mem _, natSetCode n, natSetCode_mem_omega _, - (natPresentation.pair_mem_graph (SetMembers.presentation Q) (fun k => seq k.down) ⟨n⟩ (seq n)).2 rfl⟩, hn⟩ - -theorem groundSequenceUnion_extends {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) (n : Nat) : - SetMembers.raw (seq n) ⊆ groundSequenceUnion seq := - fun _ hz => (mem_groundSequenceUnion seq _).2 ⟨n, hz⟩ - -def InternallyCountablyClosed (M : TransitiveGround.{u}) {P : Type u} [Preorder P] - (s : Presentation P) : Prop := - ∀ seq : Nat → P, natPresentation.graph s (fun n => seq n.down) ∈ M.sets → - Antitone seq → ∃ p, ∀ n, p ≤ seq n - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem descending_function_union_partial (X Y : ZFSet.{u}) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ seq : Nat → SetMembers (M.smallPartialFunctions X Y ZFSet.omega), - Antitone seq → PartialFunctionCode X Y (groundSequenceUnion seq) := by - let smallOrder := M.smallFunctionOrder X Y ZFSet.omega - intro seq decreasing - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨n, hn⟩ := (mem_groundSequenceUnion seq z).1 hz - exact (M.smallFunction_raw_properties X Y ZFSet.omega (seq n)).2.1.shape hn - · intro x y z xy xz - obtain ⟨n, hn⟩ := (mem_groundSequenceUnion seq _).1 xy - obtain ⟨m, hm⟩ := (mem_groundSequenceUnion seq _).1 xz - have code := (M.smallFunction_raw_properties X Y ZFSet.omega (seq (max n m))).2.1 - exact code.unique x y z - ((M.smallFunction_le_iff X Y ZFSet.omega _ _).1 (decreasing (Nat.le_max_left n m)) hn) - ((M.smallFunction_le_iff X Y ZFSet.omega _ _).1 (decreasing (Nat.le_max_right n m)) hm) - -theorem descending_function_union_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ seq : Nat → SetMembers (M.smallPartialFunctions X Y ZFSet.omega), - groundSequenceGraph seq ∈ M.sets → Antitone seq → - groundSequenceUnion seq ∈ M.smallPartialFunctions X Y ZFSet.omega := by - let smallOrder := M.smallFunctionOrder X Y ZFSet.omega - intro seq graph decreasing - have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY - obtain ⟨ground, small⟩ := M.countable_union_of_sequence_graph pairing unions powers separation infinite choice - hQ (M.prod_mem pairing unions powers separation hX hY) graph - (natPresentation.graph_isFunc (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)) - (fun n => seq n.down)) - (fun p hp => ((M.mem_smallPartialFunctions X Y ZFSet.omega p).1 hp).2.1.shape) - (fun p hp => ((M.mem_smallPartialFunctions X Y ZFSet.omega p).1 hp).2.2) - exact (M.mem_smallPartialFunctions X Y ZFSet.omega _).2 - ⟨ground, M.descending_function_union_partial X Y seq decreasing, small⟩ - -theorem countable_function_lower_bound - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ seq : Nat → SetMembers (M.smallPartialFunctions X Y ZFSet.omega), - groundSequenceGraph seq ∈ M.sets → Antitone seq → - ∃ p, SetMembers.raw p = groundSequenceUnion seq ∧ ∀ n, p ≤ seq n := by - let smallOrder := M.smallFunctionOrder X Y ZFSet.omega - intro seq graph decreasing - have member := M.descending_function_union_mem pairing unions powers separation infinite choice - hX hY seq graph decreasing - let p := SetMembers.ofMem (groundSequenceUnion seq) member - have raw : SetMembers.raw p = groundSequenceUnion seq := SetMembers.raw_ofMem _ _ - refine ⟨p, raw, fun n => (M.smallFunction_le_iff X Y ZFSet.omega p (seq n)).2 ?_⟩ - rw [raw] - exact groundSequenceUnion_extends seq n - -theorem countable_function_internally_closed - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - letI := M.smallFunctionOrder X Y ZFSet.omega - InternallyCountablyClosed M (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)) := by - let smallOrder := M.smallFunctionOrder X Y ZFSet.omega - intro seq graph decreasing - obtain ⟨p, _, lower⟩ := M.countable_function_lower_bound pairing unions powers separation infinite choice - hX hY seq graph decreasing - exact ⟨p, lower⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRationalCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCountableFunctionForcing +import OAI.SetTheory.PartitionPrinciple.Forcing.UniformGroundSizeWitnesses + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def indexedSizeRelation (U R W N g F : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ U, ∃ n ∈ N, ∃ k ∈ N, ∃ p ∈ R, ∃ f ∈ W, + z = ZFSet.pair (ZFSet.pair n k) x ∧ ZFSet.pair n p ∈ g ∧ + ZFSet.pair p f ∈ F ∧ ZFSet.pair x k ∈ f) (ZFSet.prod (ZFSet.prod N N) U) + +theorem pair_mem_indexedSizeRelation (U R W N g F v x : ZFSet.{u}) : + ZFSet.pair v x ∈ indexedSizeRelation U R W N g F ↔ + x ∈ U ∧ ∃ n ∈ N, ∃ k ∈ N, v = ZFSet.pair n k ∧ ∃ p ∈ R, ∃ f ∈ W, + ZFSet.pair n p ∈ g ∧ ZFSet.pair p f ∈ F ∧ ZFSet.pair x k ∈ f := by + rw [indexedSizeRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, y, hy, n, hn, k, hk, p, hp, f, hf, eq, ng, pf, yk⟩ + obtain ⟨first, second⟩ := ZFSet.pair_inj.1 eq + exact ⟨second.symm ▸ hy, n, hn, k, hk, first, p, hp, f, hf, ng, pf, second.symm ▸ yk⟩ + · rintro ⟨hx, n, hn, k, hk, rfl, p, hp, f, hf, ng, pf, xk⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hn, hk⟩, hx⟩, + x, hx, n, hn, k, hk, p, hp, f, hf, rfl, ng, pf, xk⟩ + +theorem indexedSizeRelation_partial {U R W N g F : ZFSet.{u}} + (enumeration : ZFSet.IsFunc N R g) (family : ZFSet.IsFunc R W F) + (codes : ∀ p f, ZFSet.pair p f ∈ F → InjectionCode p N f) : + PartialFunctionCode (ZFSet.prod N N) U (indexedSizeRelation U R W N g F) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro v x y vx vy + obtain ⟨_, n, hn, k, _, vn, p, hp, f, _, np, pf, xk⟩ := + (pair_mem_indexedSizeRelation U R W N g F v x).1 vx + obtain ⟨_, m, _, l, _, vm, q, _, h, _, mq, qh, yl⟩ := + (pair_mem_indexedSizeRelation U R W N g F v y).1 vy + obtain ⟨nm, kl⟩ := ZFSet.pair_inj.1 (vn.symm.trans vm) + subst m + subst l + obtain ⟨a, _, uniqueP⟩ := enumeration.2 n hn + have pq := (uniqueP p np).trans (uniqueP q mq).symm + subst q + obtain ⟨b, _, uniqueF⟩ := family.2 p hp + have fh := (uniqueF f pf).trans (uniqueF h qh).symm + subst h + exact (codes p f pf).injective x y k xk yl + +theorem indexedSizeRelation_onto {R W N g F : ZFSet.{u}} + (onto : ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ g) (family : ZFSet.IsFunc R W F) + (codes : ∀ p f, ZFSet.pair p f ∈ F → InjectionCode p N f) : + ∀ x ∈ ⋃₀ R, ∃ v ∈ ZFSet.prod N N, + ZFSet.pair v x ∈ indexedSizeRelation (⋃₀ R) R W N g F := by + intro x hx + obtain ⟨p, hp, xp⟩ := ZFSet.mem_sUnion.1 hx + obtain ⟨n, hn, np⟩ := onto p hp + obtain ⟨f, pf, _⟩ := family.2 p hp + have hf := (ZFSet.pair_mem_prod.1 (family.1 pf)).2 + have code := codes p f pf + obtain ⟨k, xk, _⟩ := code.function.2 x xp + have hk := (ZFSet.pair_mem_prod.1 (code.function.1 xk)).2 + exact ⟨ZFSet.pair n k, ZFSet.pair_mem_prod.2 ⟨hn, hk⟩, + (pair_mem_indexedSizeRelation (⋃₀ R) R W N g F _ x).2 + ⟨hx, n, hn, k, hk, rfl, p, hp, f, hf, np, pf, xk⟩⟩ + +namespace BoundedFormula + +open SetFormula + +def indexedSizeEntryFormula {k} (z u r w n g f : Fin k) : BoundedFormula k := + exMem u (exMem n.succ (exMem n.succ.succ (exMem r.succ.succ.succ (exMem w.succ.succ.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ.succ.succ 3 2 4) + (.conj (pairMembershipFormula 3 1 g.succ.succ.succ.succ.succ) + (.conj (pairMembershipFormula 1 0 f.succ.succ.succ.succ.succ) + (pairMembershipFormula 4 2 0)))))))) + +theorem truth_indexedSizeEntryFormula {k} (z u r w n g f : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (indexedSizeEntryFormula z u r w n g f) env ↔ + ∃ x ∈ env u, ∃ i ∈ env n, ∃ j ∈ env n, ∃ p ∈ env r, ∃ h ∈ env w, + env z = ZFSet.pair (ZFSet.pair i j) x ∧ ZFSet.pair i p ∈ env g ∧ + ZFSet.pair p h ∈ env f ∧ ZFSet.pair x j ∈ h := by + simp only [indexedSizeEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem indexedSizeRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U R W N g F : ZFSet.{u}} (hU : U ∈ M.sets) (hR : R ∈ M.sets) (hW : W ∈ M.sets) + (hN : N ∈ M.sets) (hg : g ∈ M.sets) (hF : F ∈ M.sets) : + indexedSizeRelation U R W N g F ∈ M.sets := by + let params := extend U (extend R (extend W (extend N (extend g (extend F Fin.elim0))))) + have selected := M.bounded_separation_mem separation (BoundedFormula.indexedSizeEntryFormula 0 1 2 3 4 5 6) + params (Fin.cases hU (Fin.cases hR (Fin.cases hW (Fin.cases hN (Fin.cases hg + (Fin.cases hF (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hN hN) hU) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.indexedSizeEntryFormula 0 1 2 3 4 5 6) + (extend z params)) (ZFSet.prod (ZFSet.prod N N) U) = indexedSizeRelation U R W N g F := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, indexedSizeRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_indexedSizeEntryFormula 0 1 2 3 4 5 6 _) + exact eq ▸ selected + +theorem groundEmbeddable_of_partial_surjection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A B r : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hr : r ∈ M.sets) + (code : PartialFunctionCode A B r) (onto : ∀ y ∈ B, ∃ x ∈ A, ZFSet.pair x y ∈ r) : + M.groundEmbeddable B A := by + have inverse := M.relationConverse_mem pairing unions powers separation hA hB hr + have total (y : ZFSet.{u}) (hy : y ∈ B) : ∃ x ∈ A, ZFSet.pair y x ∈ relationConverse A B r := by + obtain ⟨x, hx, rel⟩ := onto y hy + exact ⟨x, hx, (pair_mem_relationConverse A B r x y).2 ⟨hx, hy, rel⟩⟩ + obtain ⟨f, hf, func, selected⟩ := M.uniformize_relation pairing unions powers separation choice hB hA inverse total + exact ⟨f, hf, func, fun x y z hx hy => code.unique z x y + ((pair_mem_relationConverse A B r z x).1 (selected hx)).2.2 + ((pair_mem_relationConverse A B r z y).1 (selected hy)).2.2⟩ + +end TransitiveGround + + + + + +noncomputable def unionSizeRelation (U R W D F : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ x ∈ U, ∃ A ∈ R, ∃ k ∈ D, ∃ f ∈ W, + z = ZFSet.pair (ZFSet.pair A k) x ∧ ZFSet.pair A f ∈ F ∧ ZFSet.pair x k ∈ f) + (ZFSet.prod (ZFSet.prod R D) U) + +theorem pair_mem_unionSizeRelation (U R W D F v x : ZFSet.{u}) : + ZFSet.pair v x ∈ unionSizeRelation U R W D F ↔ + x ∈ U ∧ ∃ A ∈ R, ∃ k ∈ D, v = ZFSet.pair A k ∧ + ∃ f ∈ W, ZFSet.pair A f ∈ F ∧ ZFSet.pair x k ∈ f := by + rw [unionSizeRelation, ZFSet.mem_sep] + constructor + · rintro ⟨_, y, hy, A, hA, k, hk, f, hf, equal, selected, value⟩ + obtain ⟨first, second⟩ := ZFSet.pair_inj.1 equal + exact ⟨second.symm ▸ hy, A, hA, k, hk, first, f, hf, selected, second.symm ▸ value⟩ + · rintro ⟨hx, A, hA, k, hk, rfl, f, hf, selected, value⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hA, hk⟩, hx⟩, + x, hx, A, hA, k, hk, f, hf, rfl, selected, value⟩ + +theorem unionSizeRelation_partial {U R W D F : ZFSet.{u}} + (family : ZFSet.IsFunc R W F) + (codes : ∀ A f, ZFSet.pair A f ∈ F → InjectionCode A D f) : + PartialFunctionCode (ZFSet.prod R D) U (unionSizeRelation U R W D F) := by + refine ⟨fun _ entry => (ZFSet.mem_sep.1 entry).1, ?_⟩ + intro v x y first second + obtain ⟨_, A, hA, k, _, va, f, _, selected, value⟩ := + (pair_mem_unionSizeRelation U R W D F v x).1 first + obtain ⟨_, B, _, l, _, vb, g, _, selected', value'⟩ := + (pair_mem_unionSizeRelation U R W D F v y).1 second + obtain ⟨sameA, sameK⟩ := ZFSet.pair_inj.1 (va.symm.trans vb) + subst B + subst l + obtain ⟨_, _, unique⟩ := family.2 A hA + have sameF := (unique f selected).trans (unique g selected').symm + subst g + exact (codes A f selected).injective x y k value value' + +theorem unionSizeRelation_onto {R W D F : ZFSet.{u}} + (family : ZFSet.IsFunc R W F) + (codes : ∀ A f, ZFSet.pair A f ∈ F → InjectionCode A D f) : + ∀ x ∈ ⋃₀ R, ∃ v ∈ ZFSet.prod R D, + ZFSet.pair v x ∈ unionSizeRelation (⋃₀ R) R W D F := by + intro x hx + obtain ⟨A, hA, member⟩ := ZFSet.mem_sUnion.1 hx + obtain ⟨f, selected, _⟩ := family.2 A hA + have hf := (ZFSet.pair_mem_prod.1 (family.1 selected)).2 + have code := codes A f selected + obtain ⟨k, value, _⟩ := code.function.2 x member + have hk := (ZFSet.pair_mem_prod.1 (code.function.1 value)).2 + exact ⟨ZFSet.pair A k, ZFSet.pair_mem_prod.2 ⟨hA, hk⟩, + (pair_mem_unionSizeRelation (⋃₀ R) R W D F _ x).2 + ⟨hx, A, hA, k, hk, rfl, f, hf, selected, value⟩⟩ + +namespace BoundedFormula +open SetFormula + +def unionSizeEntryFormula {n} (z u r w d f : Fin n) : BoundedFormula n := + exMem u (exMem r.succ (exMem d.succ.succ (exMem w.succ.succ.succ + (.conj (orderedTripleFormula z.succ.succ.succ.succ 2 1 3) + (.conj (pairMembershipFormula 2 0 f.succ.succ.succ.succ) + (pairMembershipFormula 3 1 0)))))) + +theorem truth_unionSizeEntryFormula {n} (z u r w d f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (unionSizeEntryFormula z u r w d f) env ↔ + ∃ x ∈ env u, ∃ A ∈ env r, ∃ k ∈ env d, ∃ h ∈ env w, + env z = ZFSet.pair (ZFSet.pair A k) x ∧ + ZFSet.pair A h ∈ env f ∧ ZFSet.pair x k ∈ h := by + simp only [unionSizeEntryFormula, truth_exMem, Truth, truth_orderedTripleFormula, + truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem unionSizeRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U R W D F : ZFSet.{u}} (hU : U ∈ M.sets) (hR : R ∈ M.sets) + (hW : W ∈ M.sets) (hD : D ∈ M.sets) (hF : F ∈ M.sets) : + unionSizeRelation U R W D F ∈ M.sets := by + let params := extend U (extend R (extend W (extend D (extend F Fin.elim0)))) + have selected := M.bounded_separation_mem separation (BoundedFormula.unionSizeEntryFormula 0 1 2 3 4 5) + params (Fin.cases hU (Fin.cases hR (Fin.cases hW (Fin.cases hD (Fin.cases hF (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hR hD) hU) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.unionSizeEntryFormula 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod (ZFSet.prod R D) U) = unionSizeRelation U R W D F := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, unionSizeRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_unionSizeEntryFormula 0 1 2 3 4 5 _) + exact equal ▸ selected + +end TransitiveGround + + + + + + +noncomputable def defaultInverse (R N f d : ZFSet.{u}) : ZFSet.{u} := + relationConverse R N f ∪ + ZFSet.prod (ZFSet.sep (fun n => n ∉ relationImage R N f) N) {d} + +theorem pair_mem_defaultInverse (R N f d n p : ZFSet.{u}) : + ZFSet.pair n p ∈ defaultInverse R N f d ↔ + (p ∈ R ∧ n ∈ N ∧ ZFSet.pair p n ∈ f) ∨ + (n ∈ N ∧ n ∉ relationImage R N f ∧ p = d) := by + simp only [defaultInverse, ZFSet.mem_union, pair_mem_relationConverse, + ZFSet.pair_mem_prod, ZFSet.mem_sep, ZFSet.mem_singleton, and_assoc] + +theorem defaultInverse_isFunc {R N f d : ZFSet.{u}} + (code : InjectionCode R N f) (hd : d ∈ R) : + ZFSet.IsFunc N R (defaultInverse R N f d) := by + classical + refine ⟨?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_union.1 hz with hz | hz + · obtain ⟨p, hp, n, hn, rfl, _⟩ := (mem_relationConverse R N f z).1 hz + exact ZFSet.pair_mem_prod.2 ⟨hn, hp⟩ + · obtain ⟨n, hn, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz + exact ZFSet.pair_mem_prod.2 + ⟨(ZFSet.mem_sep.1 hn).1, ZFSet.mem_singleton.1 hp ▸ hd⟩ + · intro n hn + by_cases image : n ∈ relationImage R N f + · obtain ⟨_, p, hp, hpn⟩ := (mem_relationImage R N f n).1 image + refine ⟨p, (pair_mem_defaultInverse R N f d n p).2 (Or.inl ⟨hp, hn, hpn⟩), ?_⟩ + intro q hq + rcases (pair_mem_defaultInverse R N f d n q).1 hq with hq | hq + · exact code.injective q p n hq.2.2 hpn + · exact False.elim (hq.2.1 image) + · refine ⟨d, (pair_mem_defaultInverse R N f d n d).2 (Or.inr ⟨hn, image, rfl⟩), ?_⟩ + intro p hp + rcases (pair_mem_defaultInverse R N f d n p).1 hp with hp | hp + · exact False.elim (image ((mem_relationImage R N f n).2 ⟨hn, p, hp.1, hp.2.2⟩)) + · exact hp.2.2 + +theorem defaultInverse_onto {R N f : ZFSet.{u}} + (code : InjectionCode R N f) (d : ZFSet.{u}) : + ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ defaultInverse R N f d := by + intro p hp + obtain ⟨n, hpn, _⟩ := code.function.2 p hp + have hn := (ZFSet.pair_mem_prod.1 (code.function.1 hpn)).2 + exact ⟨n, hn, (pair_mem_defaultInverse R N f d n p).2 (Or.inl ⟨hp, hn, hpn⟩)⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem defaultInverse_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {R N f d : ZFSet.{u}} + (hR : R ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) (hd : d ∈ M.sets) : + defaultInverse R N f d ∈ M.sets := by + have image := M.relationImage_mem separation hR hN hf + have missing : ZFSet.sep (fun n => n ∉ relationImage R N f) N ∈ M.sets := + M.bounded_separation_mem separation (.neg (.mem 0 1)) + (extend (relationImage R N f) Fin.elim0) (Fin.cases image (fun i => Fin.elim0 i)) hN + have singleton : ({d} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hd hd + exact M.binary_union_mem pairing unions + (M.relationConverse_mem pairing unions powers separation hR hN hf) + (M.prod_mem pairing unions powers separation missing singleton) + +theorem groundEmbeddable_enumeration + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {R N : ZFSet.{u}} (hR : R ∈ M.sets) (hN : N ∈ M.sets) + (nonempty : R.Nonempty) (small : M.groundEmbeddable R N) : + ∃ g ∈ M.sets, ZFSet.IsFunc N R g ∧ + ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ g := by + obtain ⟨d, hd⟩ := nonempty + obtain ⟨f, hf, code⟩ := small + exact ⟨defaultInverse R N f d, + M.defaultInverse_mem pairing unions powers separation hR hN hf (M.transitive hR hd), + defaultInverse_isFunc code hd, defaultInverse_onto code d⟩ + +theorem groundCountable_enumeration + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {R : ZFSet.{u}} (hR : R ∈ M.sets) (nonempty : R.Nonempty) + (small : M.groundEmbeddable R ZFSet.omega) : + ∃ g ∈ M.sets, ZFSet.IsFunc ZFSet.omega R g ∧ + ∀ p ∈ R, ∃ n ∈ ZFSet.omega, ZFSet.pair n p ∈ g := + M.groundEmbeddable_enumeration pairing unions powers separation hR + (M.omega_mem separation infinite) nonempty small + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem enumerated_union_embeds_product + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R B N g : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hN : N ∈ M.sets) (hg : g ∈ M.sets) + (enumeration : ZFSet.IsFunc N R g) (onto : ∀ p ∈ R, ∃ n ∈ N, ZFSet.pair n p ∈ g) + (subsets : ∀ p ∈ R, p ⊆ B) (small : ∀ p ∈ R, M.groundEmbeddable p N) : + M.groundEmbeddable (⋃₀ R) (ZFSet.prod N N) := by + obtain ⟨F, hF, family, codes⟩ := M.uniform_size_witnesses pairing unions powers separation choice + hR hB hN subsets small + have hW := M.groundRelations_mem pairing unions powers separation hB hN + have hU := M.union_mem unions hR + have graph := M.indexedSizeRelation_mem pairing unions powers separation hU hR hW hN hg hF + exact M.groundEmbeddable_of_partial_surjection pairing unions powers separation choice + (M.prod_mem pairing unions powers separation hN hN) hU graph + (indexedSizeRelation_partial enumeration family codes) (indexedSizeRelation_onto onto family codes) + +theorem countable_enumerated_union + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R B g : ZFSet.{u}} (hR : R ∈ M.sets) (hB : B ∈ M.sets) (hg : g ∈ M.sets) + (enumeration : ZFSet.IsFunc ZFSet.omega R g) + (onto : ∀ p ∈ R, ∃ n ∈ ZFSet.omega, ZFSet.pair n p ∈ g) + (subsets : ∀ p ∈ R, p ⊆ B) (small : ∀ p ∈ R, M.groundEmbeddable p ZFSet.omega) : + M.groundEmbeddable (⋃₀ R) ZFSet.omega := by + have hw := M.omega_mem separation infinite + have hww := M.prod_mem pairing unions powers separation hw hw + obtain ⟨f, hf, code⟩ := M.enumerated_union_embeds_product pairing unions powers separation choice + hR hB hw hg enumeration onto subsets small + obtain ⟨c, hc, ccode⟩ := M.omega_product_countable pairing unions powers separation infinite + exact ⟨relationCompose (⋃₀ R) (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega f c, + M.relationCompose_mem pairing unions powers separation (M.union_mem unions hR) hww hw hf hc, + code.compose ccode⟩ + +theorem countable_union_of_sequence_graph + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {Q B g : ZFSet.{u}} (hQ : Q ∈ M.sets) (hB : B ∈ M.sets) (hg : g ∈ M.sets) + (enumeration : ZFSet.IsFunc ZFSet.omega Q g) + (subsets : ∀ p ∈ Q, p ⊆ B) (small : ∀ p ∈ Q, M.groundEmbeddable p ZFSet.omega) : + (⋃₀ relationImage ZFSet.omega Q g) ∈ M.sets ∧ + M.groundEmbeddable (⋃₀ relationImage ZFSet.omega Q g) ZFSet.omega := by + let R := relationImage ZFSet.omega Q g + have hR := M.relationImage_mem separation (M.omega_mem separation infinite) hQ hg + have restricted : ZFSet.IsFunc ZFSet.omega R g := by + refine ⟨?_, enumeration.2⟩ + intro z hz + obtain ⟨n, hn, p, hp, rfl⟩ := ZFSet.mem_prod.1 (enumeration.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hn, (mem_relationImage ZFSet.omega Q g p).2 ⟨hp, n, hn, hz⟩⟩ + exact ⟨M.union_mem unions hR, + M.countable_enumerated_union pairing unions powers separation infinite choice hR hB hg restricted + (fun p hp => ((mem_relationImage ZFSet.omega Q g p).1 hp).2) + (fun p hp => subsets p ((mem_relationImage ZFSet.omega Q g p).1 hp).1) + (fun p hp => small p ((mem_relationImage ZFSet.omega Q g p).1 hp).1)⟩ + + + + + + +theorem groundCountable_family_union + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {R : ZFSet.{u}} (hR : R ∈ M.sets) + (countR : M.groundEmbeddable R ZFSet.omega) + (small : ∀ p ∈ R, M.groundEmbeddable p ZFSet.omega) : + M.groundEmbeddable (⋃₀ R) ZFSet.omega := by + classical + by_cases nonempty : R.Nonempty + · obtain ⟨g, hg, enumeration, onto⟩ := + M.groundCountable_enumeration pairing unions powers separation infinite hR nonempty countR + exact M.countable_enumerated_union pairing unions powers separation infinite choice + hR (M.union_mem unions hR) hg enumeration onto + (fun p hp _ hz => ZFSet.mem_sUnion.2 ⟨p, hp, hz⟩) small + · have empty : R = ∅ := by + apply ZFSet.ext + intro p + exact ⟨fun hp => False.elim (nonempty ⟨p, hp⟩), fun hp => False.elim (ZFSet.notMem_empty p hp)⟩ + rw [empty, ZFSet.sUnion_empty] + exact M.empty_groundEmbeddable ZFSet.omega ⟨R, hR⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +noncomputable def groundSequenceGraph {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) : ZFSet.{u} := + natPresentation.graph (SetMembers.presentation Q) (fun n => seq n.down) + +noncomputable def groundSequenceUnion {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) : ZFSet.{u} := + ⋃₀ relationImage ZFSet.omega Q (groundSequenceGraph seq) + +theorem mem_groundSequenceUnion {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) (z : ZFSet.{u}) : + z ∈ groundSequenceUnion seq ↔ ∃ n, z ∈ SetMembers.raw (seq n) := by + rw [groundSequenceUnion, ZFSet.mem_sUnion] + constructor + · rintro ⟨p, hp, zp⟩ + obtain ⟨_, n, _, np⟩ := (mem_relationImage ZFSet.omega Q (groundSequenceGraph seq) p).1 hp + obtain ⟨k, eq⟩ := (natPresentation.mem_graph (SetMembers.presentation Q) (fun n => seq n.down) _).1 np + have second := (ZFSet.pair_inj.1 eq).2 + change SetMembers.raw (seq k.down) = p at second + exact ⟨k.down, second.symm ▸ zp⟩ + · rintro ⟨n, hn⟩ + exact ⟨SetMembers.raw (seq n), (mem_relationImage ZFSet.omega Q (groundSequenceGraph seq) _).2 + ⟨SetMembers.raw_mem _, natSetCode n, natSetCode_mem_omega _, + (natPresentation.pair_mem_graph (SetMembers.presentation Q) (fun k => seq k.down) ⟨n⟩ (seq n)).2 rfl⟩, hn⟩ + +theorem groundSequenceUnion_extends {Q : ZFSet.{u}} (seq : Nat → SetMembers Q) (n : Nat) : + SetMembers.raw (seq n) ⊆ groundSequenceUnion seq := + fun _ hz => (mem_groundSequenceUnion seq _).2 ⟨n, hz⟩ + +def InternallyCountablyClosed (M : TransitiveGround.{u}) {P : Type u} [Preorder P] + (s : Presentation P) : Prop := + ∀ seq : Nat → P, natPresentation.graph s (fun n => seq n.down) ∈ M.sets → + Antitone seq → ∃ p, ∀ n, p ≤ seq n + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem descending_function_union_partial (X Y : ZFSet.{u}) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ seq : Nat → SetMembers (M.smallPartialFunctions X Y ZFSet.omega), + Antitone seq → PartialFunctionCode X Y (groundSequenceUnion seq) := by + let smallOrder := M.smallFunctionOrder X Y ZFSet.omega + intro seq decreasing + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨n, hn⟩ := (mem_groundSequenceUnion seq z).1 hz + exact (M.smallFunction_raw_properties X Y ZFSet.omega (seq n)).2.1.shape hn + · intro x y z xy xz + obtain ⟨n, hn⟩ := (mem_groundSequenceUnion seq _).1 xy + obtain ⟨m, hm⟩ := (mem_groundSequenceUnion seq _).1 xz + have code := (M.smallFunction_raw_properties X Y ZFSet.omega (seq (max n m))).2.1 + exact code.unique x y z + ((M.smallFunction_le_iff X Y ZFSet.omega _ _).1 (decreasing (Nat.le_max_left n m)) hn) + ((M.smallFunction_le_iff X Y ZFSet.omega _ _).1 (decreasing (Nat.le_max_right n m)) hm) + +theorem descending_function_union_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ seq : Nat → SetMembers (M.smallPartialFunctions X Y ZFSet.omega), + groundSequenceGraph seq ∈ M.sets → Antitone seq → + groundSequenceUnion seq ∈ M.smallPartialFunctions X Y ZFSet.omega := by + let smallOrder := M.smallFunctionOrder X Y ZFSet.omega + intro seq graph decreasing + have hQ := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY + obtain ⟨ground, small⟩ := M.countable_union_of_sequence_graph pairing unions powers separation infinite choice + hQ (M.prod_mem pairing unions powers separation hX hY) graph + (natPresentation.graph_isFunc (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)) + (fun n => seq n.down)) + (fun p hp => ((M.mem_smallPartialFunctions X Y ZFSet.omega p).1 hp).2.1.shape) + (fun p hp => ((M.mem_smallPartialFunctions X Y ZFSet.omega p).1 hp).2.2) + exact (M.mem_smallPartialFunctions X Y ZFSet.omega _).2 + ⟨ground, M.descending_function_union_partial X Y seq decreasing, small⟩ + +theorem countable_function_lower_bound + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ seq : Nat → SetMembers (M.smallPartialFunctions X Y ZFSet.omega), + groundSequenceGraph seq ∈ M.sets → Antitone seq → + ∃ p, SetMembers.raw p = groundSequenceUnion seq ∧ ∀ n, p ≤ seq n := by + let smallOrder := M.smallFunctionOrder X Y ZFSet.omega + intro seq graph decreasing + have member := M.descending_function_union_mem pairing unions powers separation infinite choice + hX hY seq graph decreasing + let p := SetMembers.ofMem (groundSequenceUnion seq) member + have raw : SetMembers.raw p = groundSequenceUnion seq := SetMembers.raw_ofMem _ _ + refine ⟨p, raw, fun n => (M.smallFunction_le_iff X Y ZFSet.omega p (seq n)).2 ?_⟩ + rw [raw] + exact groundSequenceUnion_extends seq n + +theorem countable_function_internally_closed + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + letI := M.smallFunctionOrder X Y ZFSet.omega + InternallyCountablyClosed M (SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega)) := by + let smallOrder := M.smallFunctionOrder X Y ZFSet.omega + intro seq graph decreasing + obtain ⟨p, _, lower⟩ := M.countable_function_lower_bound pairing unions powers separation infinite choice + hX hY seq graph decreasing + exact ⟨p, lower⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionEnumerations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionEnumerations.lean index d0d68d67b3f50cda44a14c98ca7ccd77826ae319..fb585b6e4c4080aede72c6482e5d5f20b5e64a96 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionEnumerations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionEnumerations.lean @@ -1,48 +1,48 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundFunction_enumeration - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {B N f : ZFSet.{u}} (hB : B ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) - (nonempty : B.Nonempty) (small : M.groundEmbeddable B ZFSet.omega) - (function : ZFSet.IsFunc B N f) : - ∃ e ∈ M.sets, ∃ names ∈ M.sets, - ZFSet.IsFunc ZFSet.omega B e ∧ ZFSet.IsFunc ZFSet.omega N names ∧ - (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by - obtain ⟨e, he, enumeration, onto⟩ := M.groundCountable_enumeration - pairing unions powers separation infinite hB nonempty small - let names := relationCompose ZFSet.omega B N e f - have namesGround := M.relationCompose_mem pairing unions powers separation - (M.omega_mem separation infinite) hB hN he hf - have namesFunction : ZFSet.IsFunc ZFSet.omega N names := - relationCompose_function_of_subset enumeration function (fun _ member => member) - refine ⟨e, he, names, namesGround, enumeration, namesFunction, onto, ?_, ?_⟩ - · intro n hn v tau nv nt - obtain ⟨_, _, w, _, nw, wt⟩ := (pair_mem_relationCompose _ _ _ _ _ n tau).1 nt - obtain ⟨chosen, _, unique⟩ := enumeration.2 n hn - have equal : w = v := (unique w nw).trans (unique v nv).symm - exact equal ▸ wt - · intro n hn v tau nv vt - have bound := ZFSet.pair_mem_prod.1 (function.1 vt) - exact (pair_mem_relationCompose _ _ _ _ _ n tau).2 ⟨hn, bound.2, v, bound.1, nv, vt⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundFunction_enumeration + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {B N f : ZFSet.{u}} (hB : B ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) + (nonempty : B.Nonempty) (small : M.groundEmbeddable B ZFSet.omega) + (function : ZFSet.IsFunc B N f) : + ∃ e ∈ M.sets, ∃ names ∈ M.sets, + ZFSet.IsFunc ZFSet.omega B e ∧ ZFSet.IsFunc ZFSet.omega N names ∧ + (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by + obtain ⟨e, he, enumeration, onto⟩ := M.groundCountable_enumeration + pairing unions powers separation infinite hB nonempty small + let names := relationCompose ZFSet.omega B N e f + have namesGround := M.relationCompose_mem pairing unions powers separation + (M.omega_mem separation infinite) hB hN he hf + have namesFunction : ZFSet.IsFunc ZFSet.omega N names := + relationCompose_function_of_subset enumeration function (fun _ member => member) + refine ⟨e, he, names, namesGround, enumeration, namesFunction, onto, ?_, ?_⟩ + · intro n hn v tau nv nt + obtain ⟨_, _, w, _, nw, wt⟩ := (pair_mem_relationCompose _ _ _ _ _ n tau).1 nt + obtain ⟨chosen, _, unique⟩ := enumeration.2 n hn + have equal : w = v := (unique w nw).trans (unique v nv).symm + exact equal ▸ wt + · intro n hn v tau nv vt + have bound := ZFSet.pair_mem_prod.1 (function.1 vt) + exact (pair_mem_relationCompose _ _ _ _ _ n tau).2 ⟨hn, bound.2, v, bound.1, nv, vt⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionOrdinaryZFC.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionOrdinaryZFC.lean index 1d2dc59f796a3b3ea908af301105396963dbcc26..c2e80a0556a0c9a593e1c99996c60f80ee3a6e70 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionOrdinaryZFC.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionOrdinaryZFC.lean @@ -1,61 +1,61 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundSupportedEqualityChoices - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem countableFunction_ordinaryZF - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - letI := M.smallFunctionOrder X Y ZFSet.omega - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), - H.GenericFor (formulaFamily (M.nameDomain s)) → - ZFRealization (M.ordinaryExtension s H).sets ∧ - CollectionSchema (M.ordinaryExtension s H).sets := by - let := M.smallFunctionOrder X Y ZFSet.omega - let := M.smallFunctionTop X Y ZFSet.omega ⟨X, hX⟩ - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY - dsimp only - intro H generic - constructor - · exact M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic - · intro n - exact M.ordinaryExtension_collection s pairing unions powers separation collection carrier order H generic - -theorem countableFunction_ordinaryZFC - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : - letI := M.smallFunctionOrder X Y ZFSet.omega - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), - H.GenericFor (formulaFamily (M.nameDomain s)) → - ZFRealization (M.ordinaryExtension s H).sets ∧ - CollectionSchema (M.ordinaryExtension s H).sets ∧ - Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0 := by - let := M.smallFunctionOrder X Y ZFSet.omega - let := M.smallFunctionTop X Y ZFSet.omega ⟨X, hX⟩ - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY - dsimp only - intro H generic - have axioms := M.countableFunction_ordinaryZF pairing unions powers separation collection infinite hX hY H generic - exact ⟨axioms.1, axioms.2, - M.ordinaryExtension_choice s pairing unions powers separation collection infinite choice carrier order H generic⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundSupportedEqualityChoices + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem countableFunction_ordinaryZF + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + letI := M.smallFunctionOrder X Y ZFSet.omega + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), + H.GenericFor (formulaFamily (M.nameDomain s)) → + ZFRealization (M.ordinaryExtension s H).sets ∧ + CollectionSchema (M.ordinaryExtension s H).sets := by + let := M.smallFunctionOrder X Y ZFSet.omega + let := M.smallFunctionTop X Y ZFSet.omega ⟨X, hX⟩ + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY + dsimp only + intro H generic + constructor + · exact M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order infinite H generic + · intro n + exact M.ordinaryExtension_collection s pairing unions powers separation collection carrier order H generic + +theorem countableFunction_ordinaryZFC + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) : + letI := M.smallFunctionOrder X Y ZFSet.omega + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), + H.GenericFor (formulaFamily (M.nameDomain s)) → + ZFRealization (M.ordinaryExtension s H).sets ∧ + CollectionSchema (M.ordinaryExtension s H).sets ∧ + Realize (M.ordinaryExtension s H).sets SetFormula.choice Fin.elim0 := by + let := M.smallFunctionOrder X Y ZFSet.omega + let := M.smallFunctionTop X Y ZFSet.omega ⟨X, hX⟩ + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY + dsimp only + intro H generic + have axioms := M.countableFunction_ordinaryZF pairing unions powers separation collection infinite hX hY H generic + exact ⟨axioms.1, axioms.2, + M.ordinaryExtension_choice s pairing unions powers separation collection infinite choice carrier order H generic⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionSequences.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionSequences.lean index 89ae48c7666184aa17ab8c510bfa06aeac55edf2..b500ae95947e8e37e1108bf70c8813e1ccd5b443 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionSequences.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionSequences.lean @@ -1,57 +1,57 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) - -include pairing unions powers separation collection infinite choice small in -theorem countableFunction_sequenceReflection - {X Y U : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hU : U ∈ M.sets) : - letI := M.smallFunctionOrder X Y ZFSet.omega - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), - H.GenericFor (M.codedFamily s) → H.GenericFor (formulaFamily (M.nameDomain s)) → - GroundSequenceReflection M (M.ordinaryExtension s H) U := by - let := M.smallFunctionOrder X Y ZFSet.omega - let := M.smallFunctionTop X Y ZFSet.omega ⟨X, hX⟩ - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - dsimp only - intro H genericCoded genericFormula - exact M.ordinaryExtension_sequenceReflection s pairing unions powers separation collection infinite - choice (M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY) - (M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY) small hU - (M.countable_function_internally_closed pairing unions powers separation infinite choice hX hY) - H genericCoded genericFormula - -include pairing unions powers separation collection infinite choice small in -theorem exists_countableFunction_generic_sequenceReflection - {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) : - letI := M.smallFunctionOrder X Y ZFSet.omega - let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension s H) U := by - let := M.smallFunctionOrder X Y ZFSet.omega - obtain ⟨H, hp, genericCoded, genericFormula⟩ := - M.exists_countableFunction_generic small pairing unions powers separation infinite hX hY p - exact ⟨H, hp, genericCoded, genericFormula, fun _ hU => - M.countableFunction_sequenceReflection pairing unions powers separation collection infinite choice - small hX hY hU H genericCoded genericFormula⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) (small : M.sets.Countable) + +include pairing unions powers separation collection infinite choice small in +theorem countableFunction_sequenceReflection + {X Y U : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hU : U ∈ M.sets) : + letI := M.smallFunctionOrder X Y ZFSet.omega + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + ∀ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), + H.GenericFor (M.codedFamily s) → H.GenericFor (formulaFamily (M.nameDomain s)) → + GroundSequenceReflection M (M.ordinaryExtension s H) U := by + let := M.smallFunctionOrder X Y ZFSet.omega + let := M.smallFunctionTop X Y ZFSet.omega ⟨X, hX⟩ + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + dsimp only + intro H genericCoded genericFormula + exact M.ordinaryExtension_sequenceReflection s pairing unions powers separation collection infinite + choice (M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY) + (M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY) small hU + (M.countable_function_internally_closed pairing unions powers separation infinite choice hX hY) + H genericCoded genericFormula + +include pairing unions powers separation collection infinite choice small in +theorem exists_countableFunction_generic_sequenceReflection + {X Y : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions X Y ZFSet.omega)) : + letI := M.smallFunctionOrder X Y ZFSet.omega + let s := SetMembers.presentation (M.smallPartialFunctions X Y ZFSet.omega) + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions X Y ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + ∀ U ∈ M.sets, GroundSequenceReflection M (M.ordinaryExtension s H) U := by + let := M.smallFunctionOrder X Y ZFSet.omega + obtain ⟨H, hp, genericCoded, genericFormula⟩ := + M.exists_countableFunction_generic small pairing unions powers separation infinite hX hY p + exact ⟨H, hp, genericCoded, genericFormula, fun _ hU => + M.countableFunction_sequenceReflection pairing unions powers separation collection infinite choice + small hX hY hU H genericCoded genericFormula⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionZF.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionZF.lean index a8777071cab279a4649a0a96e24b2f6eab73c9d3..a2027ec7081ad4d93d2676443e758d1de1dbf2ed 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionZF.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableFunctionZF.lean @@ -1,61 +1,61 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundOutsideRowNames -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPrincipalSupportZF - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {X Y I G : Type u} -variable [Group G] [PartialOrder X] [PartialOrder I] - -theorem exists_countableFunction_ZF - (a : PosetAction G X) (d : PosetAction G I) - (s : Presentation X) (t : Presentation Y) (b : Presentation G) (k : Presentation I) - (C : I) (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) - (small : M.sets.Countable) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) (values : t.carrier.Nonempty) - (hG : b.carrier ∈ M.sets) (hI : k.carrier ∈ M.sets) - (coordinate_graph : a.actionGraph s b ∈ M.sets) - (support_order : k.conditionOrder ∈ M.sets) (support_graph : d.actionGraph k b ∈ M.sets) - (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega)) : - letI := M.smallFunctionOrder s.carrier t.carrier ZFSet.omega - let act := M.smallFunctionAction a s t b pairing unions powers separation hX hY hG - (M.omega_mem separation infinite) coordinate_graph - let c := SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega) - let F := d.principalSupportFamily C directed - ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega)), - H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ - H.GenericFor (formulaFamily (M.nameDomain c)) ∧ - H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ - M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ - ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ - ZFSet.IsFunc s.carrier t.carrier (M.countableGenericGraph s.carrier t.carrier H) := by - let := M.smallFunctionOrder s.carrier t.carrier ZFSet.omega - let := M.smallFunctionTop s.carrier t.carrier ZFSet.omega ⟨s.carrier, hX⟩ - let act := M.smallFunctionAction a s t b pairing unions powers separation hX hY hG - (M.omega_mem separation infinite) coordinate_graph - let c := SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega) - obtain ⟨H, hp, ground, ordinary, symmetric, includes, zf⟩ := - M.exists_ZF_from_principalSupports d act k c b C directed small pairing unions powers separation collection infinite - (M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY) - (M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY) - hG hI support_order support_graph - (M.smallFunctionActionGraph_mem a s t b pairing unions powers separation hX hY hG - (M.omega_mem separation infinite) coordinate_graph) p - exact ⟨H, hp, ground, ordinary, symmetric, includes, zf, - M.countableGenericGraph_isFunc pairing unions powers separation infinite hX hY values H ground⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundOutsideRowNames +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPrincipalSupportZF + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {X Y I G : Type u} +variable [Group G] [PartialOrder X] [PartialOrder I] + +theorem exists_countableFunction_ZF + (a : PosetAction G X) (d : PosetAction G I) + (s : Presentation X) (t : Presentation Y) (b : Presentation G) (k : Presentation I) + (C : I) (directed : ∀ C D : I, ∃ E, C ≤ E ∧ D ≤ E) + (small : M.sets.Countable) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hX : s.carrier ∈ M.sets) (hY : t.carrier ∈ M.sets) (values : t.carrier.Nonempty) + (hG : b.carrier ∈ M.sets) (hI : k.carrier ∈ M.sets) + (coordinate_graph : a.actionGraph s b ∈ M.sets) + (support_order : k.conditionOrder ∈ M.sets) (support_graph : d.actionGraph k b ∈ M.sets) + (p : SetMembers (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega)) : + letI := M.smallFunctionOrder s.carrier t.carrier ZFSet.omega + let act := M.smallFunctionAction a s t b pairing unions powers separation hX hY hG + (M.omega_mem separation infinite) coordinate_graph + let c := SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega) + let F := d.principalSupportFamily C directed + ∃ H : ConditionFilter (SetMembers (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega)), + H.mem p ∧ H.GenericFor (M.codedFamily c) ∧ + H.GenericFor (formulaFamily (M.nameDomain c)) ∧ + H.GenericFor (formulaFamily (act.symmetricDomain c (M.nameDomain c) F)) ∧ + M.sets ⊆ (act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q} ∧ + ZFRealization ((act.symmetricDomain c (M.nameDomain c) F).values {q | H.mem q}) ∧ + ZFSet.IsFunc s.carrier t.carrier (M.countableGenericGraph s.carrier t.carrier H) := by + let := M.smallFunctionOrder s.carrier t.carrier ZFSet.omega + let := M.smallFunctionTop s.carrier t.carrier ZFSet.omega ⟨s.carrier, hX⟩ + let act := M.smallFunctionAction a s t b pairing unions powers separation hX hY hG + (M.omega_mem separation infinite) coordinate_graph + let c := SetMembers.presentation (M.smallPartialFunctions s.carrier t.carrier ZFSet.omega) + obtain ⟨H, hp, ground, ordinary, symmetric, includes, zf⟩ := + M.exists_ZF_from_principalSupports d act k c b C directed small pairing unions powers separation collection infinite + (M.countablePartialFunctions_mem pairing unions powers separation infinite hX hY) + (M.countableFunctionOrder_mem pairing unions powers separation infinite hX hY) + hG hI support_order support_graph + (M.smallFunctionActionGraph_mem a s t b pairing unions powers separation hX hY hG + (M.omega_mem separation infinite) coordinate_graph) p + exact ⟨H, hp, ground, ordinary, symmetric, includes, zf, + M.countableGenericGraph_isFunc pairing unions powers separation infinite hX hY values H ground⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableLayerCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableLayerCodes.lean index d0118b4eecc828ef16b328d5ed6933cb73f48dd2..88f38f6cb9b97d8cb69cf41f027398ba4ea586ed 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableLayerCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableLayerCodes.lean @@ -1,60 +1,60 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GrowthLayerSourceCongruence - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure CountableLayerCode (L birth t D N injection : ZFSet.{u}) : Prop where - small : InjectionCode D N injection - cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → x ∈ D - -namespace BoundedFormula - -def countableLayerFormula {n} (L birth t D N injection : Fin n) : BoundedFormula n := - .conj (injectionFormula D N injection) - (.allMem L (imp (pairMembershipFormula 0 t.succ birth.succ) (.mem 0 D.succ))) - -theorem truth_countableLayerFormula {n} (L birth t D N injection : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (countableLayerFormula L birth t D N injection) env ↔ - CountableLayerCode (env L) (env birth) (env t) (env D) (env N) (env injection) := by - simp only [countableLayerFormula, Truth, truth_injectionFormula, truth_imp, - truth_pairMembershipFormula] - exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.small, h.cover⟩⟩ - -theorem realize_countableLayerFormula (M : TransitiveGround.{u}) {n} - (L birth t D N injection : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (countableLayerFormula L birth t D N injection).toFormula env ↔ - CountableLayerCode (env L) (env birth) (env t) (env D) (env N) (env injection) := - (realize_toFormula M _ env members).trans (truth_countableLayerFormula L birth t D N injection env) - -end BoundedFormula - -namespace CountableLayerCode - -def toLayer {M : TransitiveGround.{u}} {L r μ birth t D N injection : ZFSet.{u}} - (code : CountableLayerCode L birth t D N injection) - (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) - (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) (omega : N = ZFSet.omega) : - CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := - .countablePoints D hD ⟨injection, hInjection, omega ▸ code.small⟩ code.cover - -theorem exists_witness {M : TransitiveGround.{u}} {L birth t D : ZFSet.{u}} - (small : M.groundEmbeddable D ZFSet.omega) - (cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → x ∈ D) : - ∃ injection ∈ M.sets, CountableLayerCode L birth t D ZFSet.omega injection := by - obtain ⟨injection, hInjection, code⟩ := small - exact ⟨injection, hInjection, code, cover⟩ - -end CountableLayerCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GrowthLayerSourceCongruence + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure CountableLayerCode (L birth t D N injection : ZFSet.{u}) : Prop where + small : InjectionCode D N injection + cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → x ∈ D + +namespace BoundedFormula + +def countableLayerFormula {n} (L birth t D N injection : Fin n) : BoundedFormula n := + .conj (injectionFormula D N injection) + (.allMem L (imp (pairMembershipFormula 0 t.succ birth.succ) (.mem 0 D.succ))) + +theorem truth_countableLayerFormula {n} (L birth t D N injection : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (countableLayerFormula L birth t D N injection) env ↔ + CountableLayerCode (env L) (env birth) (env t) (env D) (env N) (env injection) := by + simp only [countableLayerFormula, Truth, truth_injectionFormula, truth_imp, + truth_pairMembershipFormula] + exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.small, h.cover⟩⟩ + +theorem realize_countableLayerFormula (M : TransitiveGround.{u}) {n} + (L birth t D N injection : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (countableLayerFormula L birth t D N injection).toFormula env ↔ + CountableLayerCode (env L) (env birth) (env t) (env D) (env N) (env injection) := + (realize_toFormula M _ env members).trans (truth_countableLayerFormula L birth t D N injection env) + +end BoundedFormula + +namespace CountableLayerCode + +def toLayer {M : TransitiveGround.{u}} {L r μ birth t D N injection : ZFSet.{u}} + (code : CountableLayerCode L birth t D N injection) + (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) + (hD : D ∈ M.sets) (hInjection : injection ∈ M.sets) (omega : N = ZFSet.omega) : + CodedGrowthLayer M Space sourceOrder sourceMeet L r μ birth t := + .countablePoints D hD ⟨injection, hInjection, omega ▸ code.small⟩ code.cover + +theorem exists_witness {M : TransitiveGround.{u}} {L birth t D : ZFSet.{u}} + (small : M.groundEmbeddable D ZFSet.omega) + (cover : ∀ x ∈ L, ZFSet.pair x t ∈ birth → x ∈ D) : + ∃ injection ∈ M.sets, CountableLayerCode L birth t D ZFSet.omega injection := by + obtain ⟨injection, hInjection, code⟩ := small + exact ⟨injection, hInjection, code, cover⟩ + +end CountableLayerCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableProducts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableProducts.lean index 39869bf1d28bc3350cad657b32641346868dd61d..f67f7b09b2a9fad7961668f400136bf1fee3ec1d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableProducts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableProducts.lean @@ -1,159 +1,159 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def relationProduct (A B C D f g : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, ∃ d ∈ D, - z = ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c d) ∧ - ZFSet.pair a c ∈ f ∧ ZFSet.pair b d ∈ g) - (ZFSet.prod (ZFSet.prod A B) (ZFSet.prod C D)) - -theorem mem_relationProduct (A B C D f g z : ZFSet.{u}) : - z ∈ relationProduct A B C D f g ↔ - ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, ∃ d ∈ D, - z = ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c d) ∧ - ZFSet.pair a c ∈ f ∧ ZFSet.pair b d ∈ g := by - constructor - · exact fun h => (ZFSet.mem_sep.1 h).2 - · rintro ⟨a, ha, b, hb, c, hc, d, hd, rfl, fac, gbd⟩ - exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 - ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, ZFSet.pair_mem_prod.2 ⟨hc, hd⟩⟩, - a, ha, b, hb, c, hc, d, hd, rfl, fac, gbd⟩ - -theorem pair_mem_relationProduct (A B C D f g a b c d : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c d) ∈ relationProduct A B C D f g ↔ - a ∈ A ∧ b ∈ B ∧ c ∈ C ∧ d ∈ D ∧ ZFSet.pair a c ∈ f ∧ ZFSet.pair b d ∈ g := by - rw [mem_relationProduct] - constructor - · rintro ⟨a', ha, b', hb, c', hc, d', hd, equal, fac, gbd⟩ - obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right - exact ⟨ha, hb, hc, hd, fac, gbd⟩ - · rintro ⟨ha, hb, hc, hd, fac, gbd⟩ - exact ⟨a, ha, b, hb, c, hc, d, hd, rfl, fac, gbd⟩ - -theorem relationProduct_function {A B C D f g : ZFSet.{u}} - (first : ZFSet.IsFunc A C f) (second : ZFSet.IsFunc B D g) : - ZFSet.IsFunc (ZFSet.prod A B) (ZFSet.prod C D) (relationProduct A B C D f g) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro x hx - obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 hx - obtain ⟨c, fac, uniqueC⟩ := first.2 a ha - obtain ⟨d, gbd, uniqueD⟩ := second.2 b hb - have hc := (ZFSet.pair_mem_prod.1 (first.1 fac)).2 - have hd := (ZFSet.pair_mem_prod.1 (second.1 gbd)).2 - refine ⟨ZFSet.pair c d, (pair_mem_relationProduct A B C D f g a b c d).2 - ⟨ha, hb, hc, hd, fac, gbd⟩, ?_⟩ - intro z hz - obtain ⟨c', _, d', _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hz).1).2 - obtain ⟨_, _, _, _, fac', gbd'⟩ := (pair_mem_relationProduct A B C D f g a b c' d').1 hz - exact congrArg₂ ZFSet.pair (uniqueC c' fac') (uniqueD d' gbd') - -theorem relationProduct_injection {A B C D f g : ZFSet.{u}} - (first : InjectionCode A C f) (second : InjectionCode B D g) : - InjectionCode (ZFSet.prod A B) (ZFSet.prod C D) (relationProduct A B C D f g) := by - refine ⟨relationProduct_function first.function second.function, ?_⟩ - intro x y z hx hy - have shapeX := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hx).1 - have shapeY := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hy).1 - obtain ⟨a, _, b, _, rfl⟩ := ZFSet.mem_prod.1 shapeX.1 - obtain ⟨a', _, b', _, rfl⟩ := ZFSet.mem_prod.1 shapeY.1 - obtain ⟨c, _, d, _, rfl⟩ := ZFSet.mem_prod.1 shapeX.2 - obtain ⟨_, _, _, _, fac, gbd⟩ := (pair_mem_relationProduct A B C D f g a b c d).1 hx - obtain ⟨_, _, _, _, fa'c, gb'd⟩ := (pair_mem_relationProduct A B C D f g a' b' c d).1 hy - exact congrArg₂ ZFSet.pair (first.injective a a' c fac fa'c) (second.injective b b' d gbd gb'd) - -namespace BoundedFormula - -def relationProductEntryFormula {n} (z a b c d f g : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ - exMem a (exMem b.succ (exMem c.succ.succ (exMem d.succ.succ.succ - (.conj (pairOfPairsFormula (lift z) 3 2 1 0) - (.conj (pairMembershipFormula 3 1 (lift f)) (pairMembershipFormula 2 0 (lift g))))))) - -theorem truth_relationProductEntryFormula {n} (z a b c d f g : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (relationProductEntryFormula z a b c d f g) env ↔ - ∃ x ∈ env a, ∃ y ∈ env b, ∃ p ∈ env c, ∃ q ∈ env d, - env z = ZFSet.pair (ZFSet.pair x y) (ZFSet.pair p q) ∧ - ZFSet.pair x p ∈ env f ∧ ZFSet.pair y q ∈ env g := by - simp only [relationProductEntryFormula, truth_exMem, Truth, - truth_pairOfPairsFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem relationProduct_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A B C D f g : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hf : f ∈ M.sets) (hg : g ∈ M.sets) : - relationProduct A B C D f g ∈ M.sets := by - let params := extend A (extend B (extend C (extend D (extend f (extend g Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.relationProductEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hA (Fin.cases hB (Fin.cases hC (Fin.cases hD - (Fin.cases hf (Fin.cases hg (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation - (M.prod_mem pairing unions powers separation hA hB) - (M.prod_mem pairing unions powers separation hC hD)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.relationProductEntryFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod (ZFSet.prod A B) (ZFSet.prod C D)) = relationProduct A B C D f g := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, relationProduct, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_relationProductEntryFormula 0 1 2 3 4 5 6 _) - exact equal ▸ selected - -theorem countableProduct_injection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A B f g : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (hf : f ∈ M.sets) (hg : g ∈ M.sets) - (first : InjectionCode A ZFSet.omega f) (second : InjectionCode B ZFSet.omega g) : - ∃ h ∈ M.sets, InjectionCode (ZFSet.prod A B) ZFSet.omega h := by - have hw := M.omega_mem separation infinite - have hAB := M.prod_mem pairing unions powers separation hA hB - have hww := M.prod_mem pairing unions powers separation hw hw - have product := M.relationProduct_mem pairing unions powers separation hA hB hw hw hf hg - obtain ⟨c, hc, pairingCode⟩ := M.omega_product_countable pairing unions powers separation infinite - exact ⟨relationCompose (ZFSet.prod A B) (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega - (relationProduct A B ZFSet.omega ZFSet.omega f g) c, - M.relationCompose_mem pairing unions powers separation hAB hww hw product hc, - (relationProduct_injection first second).compose pairingCode⟩ - -theorem groundEmbeddable_product - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (first : M.groundEmbeddable A ZFSet.omega) (second : M.groundEmbeddable B ZFSet.omega) : - M.groundEmbeddable (ZFSet.prod A B) ZFSet.omega := by - obtain ⟨f, hf, firstCode⟩ := first - obtain ⟨g, hg, secondCode⟩ := second - exact M.countableProduct_injection pairing unions powers separation infinite hA hB hf hg firstCode secondCode - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BatchAttachmentRealization + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def relationProduct (A B C D f g : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, ∃ d ∈ D, + z = ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c d) ∧ + ZFSet.pair a c ∈ f ∧ ZFSet.pair b d ∈ g) + (ZFSet.prod (ZFSet.prod A B) (ZFSet.prod C D)) + +theorem mem_relationProduct (A B C D f g z : ZFSet.{u}) : + z ∈ relationProduct A B C D f g ↔ + ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, ∃ d ∈ D, + z = ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c d) ∧ + ZFSet.pair a c ∈ f ∧ ZFSet.pair b d ∈ g := by + constructor + · exact fun h => (ZFSet.mem_sep.1 h).2 + · rintro ⟨a, ha, b, hb, c, hc, d, hd, rfl, fac, gbd⟩ + exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 + ⟨ZFSet.pair_mem_prod.2 ⟨ha, hb⟩, ZFSet.pair_mem_prod.2 ⟨hc, hd⟩⟩, + a, ha, b, hb, c, hc, d, hd, rfl, fac, gbd⟩ + +theorem pair_mem_relationProduct (A B C D f g a b c d : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair a b) (ZFSet.pair c d) ∈ relationProduct A B C D f g ↔ + a ∈ A ∧ b ∈ B ∧ c ∈ C ∧ d ∈ D ∧ ZFSet.pair a c ∈ f ∧ ZFSet.pair b d ∈ g := by + rw [mem_relationProduct] + constructor + · rintro ⟨a', ha, b', hb, c', hc, d', hd, equal, fac, gbd⟩ + obtain ⟨left, right⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 left + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 right + exact ⟨ha, hb, hc, hd, fac, gbd⟩ + · rintro ⟨ha, hb, hc, hd, fac, gbd⟩ + exact ⟨a, ha, b, hb, c, hc, d, hd, rfl, fac, gbd⟩ + +theorem relationProduct_function {A B C D f g : ZFSet.{u}} + (first : ZFSet.IsFunc A C f) (second : ZFSet.IsFunc B D g) : + ZFSet.IsFunc (ZFSet.prod A B) (ZFSet.prod C D) (relationProduct A B C D f g) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro x hx + obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 hx + obtain ⟨c, fac, uniqueC⟩ := first.2 a ha + obtain ⟨d, gbd, uniqueD⟩ := second.2 b hb + have hc := (ZFSet.pair_mem_prod.1 (first.1 fac)).2 + have hd := (ZFSet.pair_mem_prod.1 (second.1 gbd)).2 + refine ⟨ZFSet.pair c d, (pair_mem_relationProduct A B C D f g a b c d).2 + ⟨ha, hb, hc, hd, fac, gbd⟩, ?_⟩ + intro z hz + obtain ⟨c', _, d', _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hz).1).2 + obtain ⟨_, _, _, _, fac', gbd'⟩ := (pair_mem_relationProduct A B C D f g a b c' d').1 hz + exact congrArg₂ ZFSet.pair (uniqueC c' fac') (uniqueD d' gbd') + +theorem relationProduct_injection {A B C D f g : ZFSet.{u}} + (first : InjectionCode A C f) (second : InjectionCode B D g) : + InjectionCode (ZFSet.prod A B) (ZFSet.prod C D) (relationProduct A B C D f g) := by + refine ⟨relationProduct_function first.function second.function, ?_⟩ + intro x y z hx hy + have shapeX := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hx).1 + have shapeY := ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 hy).1 + obtain ⟨a, _, b, _, rfl⟩ := ZFSet.mem_prod.1 shapeX.1 + obtain ⟨a', _, b', _, rfl⟩ := ZFSet.mem_prod.1 shapeY.1 + obtain ⟨c, _, d, _, rfl⟩ := ZFSet.mem_prod.1 shapeX.2 + obtain ⟨_, _, _, _, fac, gbd⟩ := (pair_mem_relationProduct A B C D f g a b c d).1 hx + obtain ⟨_, _, _, _, fa'c, gb'd⟩ := (pair_mem_relationProduct A B C D f g a' b' c d).1 hy + exact congrArg₂ ZFSet.pair (first.injective a a' c fac fa'c) (second.injective b b' d gbd gb'd) + +namespace BoundedFormula + +def relationProductEntryFormula {n} (z a b c d f g : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ + exMem a (exMem b.succ (exMem c.succ.succ (exMem d.succ.succ.succ + (.conj (pairOfPairsFormula (lift z) 3 2 1 0) + (.conj (pairMembershipFormula 3 1 (lift f)) (pairMembershipFormula 2 0 (lift g))))))) + +theorem truth_relationProductEntryFormula {n} (z a b c d f g : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (relationProductEntryFormula z a b c d f g) env ↔ + ∃ x ∈ env a, ∃ y ∈ env b, ∃ p ∈ env c, ∃ q ∈ env d, + env z = ZFSet.pair (ZFSet.pair x y) (ZFSet.pair p q) ∧ + ZFSet.pair x p ∈ env f ∧ ZFSet.pair y q ∈ env g := by + simp only [relationProductEntryFormula, truth_exMem, Truth, + truth_pairOfPairsFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem relationProduct_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A B C D f g : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hf : f ∈ M.sets) (hg : g ∈ M.sets) : + relationProduct A B C D f g ∈ M.sets := by + let params := extend A (extend B (extend C (extend D (extend f (extend g Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.relationProductEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hA (Fin.cases hB (Fin.cases hC (Fin.cases hD + (Fin.cases hf (Fin.cases hg (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation + (M.prod_mem pairing unions powers separation hA hB) + (M.prod_mem pairing unions powers separation hC hD)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.relationProductEntryFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod (ZFSet.prod A B) (ZFSet.prod C D)) = relationProduct A B C D f g := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, relationProduct, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_relationProductEntryFormula 0 1 2 3 4 5 6 _) + exact equal ▸ selected + +theorem countableProduct_injection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A B f g : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (hf : f ∈ M.sets) (hg : g ∈ M.sets) + (first : InjectionCode A ZFSet.omega f) (second : InjectionCode B ZFSet.omega g) : + ∃ h ∈ M.sets, InjectionCode (ZFSet.prod A B) ZFSet.omega h := by + have hw := M.omega_mem separation infinite + have hAB := M.prod_mem pairing unions powers separation hA hB + have hww := M.prod_mem pairing unions powers separation hw hw + have product := M.relationProduct_mem pairing unions powers separation hA hB hw hw hf hg + obtain ⟨c, hc, pairingCode⟩ := M.omega_product_countable pairing unions powers separation infinite + exact ⟨relationCompose (ZFSet.prod A B) (ZFSet.prod ZFSet.omega ZFSet.omega) ZFSet.omega + (relationProduct A B ZFSet.omega ZFSet.omega f g) c, + M.relationCompose_mem pairing unions powers separation hAB hww hw product hc, + (relationProduct_injection first second).compose pairingCode⟩ + +theorem groundEmbeddable_product + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (first : M.groundEmbeddable A ZFSet.omega) (second : M.groundEmbeddable B ZFSet.omega) : + M.groundEmbeddable (ZFSet.prod A B) ZFSet.omega := by + obtain ⟨f, hf, firstCode⟩ := first + obtain ⟨g, hg, secondCode⟩ := second + exact M.countableProduct_injection pairing unions powers separation infinite hA hB hf hg firstCode secondCode + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRelationSelections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRelationSelections.lean index 18691c56cc42918f0b813ec20ea003d530efa28c..8663377e17db4ec143f5c74e7790672dff63e32f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRelationSelections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRelationSelections.lean @@ -1,212 +1,212 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing - -open SetRealization -universe u - -noncomputable def binaryUnionEnumeration (A B : ZFSet.{u}) : ZFSet.{u} := - insert (ZFSet.pair (natSetCode 0) A) - (ZFSet.prod (ZFSet.sep (fun n => n ≠ natSetCode 0) ZFSet.omega) {B}) - -theorem pair_mem_binaryUnionEnumeration (A B n p : ZFSet.{u}) : - ZFSet.pair n p ∈ binaryUnionEnumeration A B ↔ - (n = natSetCode 0 ∧ p = A) ∨ - (n ∈ ZFSet.omega ∧ n ≠ natSetCode 0 ∧ p = B) := by - simp only [binaryUnionEnumeration, ZFSet.mem_insert_iff, ZFSet.pair_inj, - ZFSet.pair_mem_prod, ZFSet.mem_sep, ZFSet.mem_singleton, and_assoc] - -theorem binaryUnionEnumeration_isFunc (A B : ZFSet.{u}) : - ZFSet.IsFunc ZFSet.omega {A, B} (binaryUnionEnumeration A B) := by - classical - refine ⟨?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_insert_iff.1 hz with rfl | hz - · exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega 0, ZFSet.mem_pair.2 (Or.inl rfl)⟩ - · obtain ⟨n, hn, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz - exact ZFSet.pair_mem_prod.2 - ⟨(ZFSet.mem_sep.1 hn).1, ZFSet.mem_pair.2 (Or.inr (ZFSet.mem_singleton.1 hp))⟩ - · intro n hn - by_cases zero : n = natSetCode 0 - · refine ⟨A, (pair_mem_binaryUnionEnumeration A B n A).2 (Or.inl ⟨zero, rfl⟩), ?_⟩ - intro p hp - rcases (pair_mem_binaryUnionEnumeration A B n p).1 hp with h | h - · exact h.2 - · exact False.elim (h.2.1 zero) - · refine ⟨B, (pair_mem_binaryUnionEnumeration A B n B).2 (Or.inr ⟨hn, zero, rfl⟩), ?_⟩ - intro p hp - rcases (pair_mem_binaryUnionEnumeration A B n p).1 hp with h | h - · exact False.elim (zero h.1) - · exact h.2.2 - -theorem binaryUnionEnumeration_onto (A B : ZFSet.{u}) : - ∀ p ∈ ({A, B} : ZFSet.{u}), - ∃ n ∈ ZFSet.omega, ZFSet.pair n p ∈ binaryUnionEnumeration A B := by - intro p hp - rcases ZFSet.mem_pair.1 hp with hp | hp - · subst p - exact ⟨natSetCode 0, natSetCode_mem_omega 0, - (pair_mem_binaryUnionEnumeration A B _ _).2 (Or.inl ⟨rfl, rfl⟩)⟩ - · subst p - exact ⟨natSetCode 1, natSetCode_mem_omega 1, - (pair_mem_binaryUnionEnumeration A B _ _).2 - (Or.inr ⟨natSetCode_mem_omega 1, fun eq => Nat.one_ne_zero (natSetCode_injective eq), rfl⟩)⟩ - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem binaryUnionEnumeration_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : - binaryUnionEnumeration A B ∈ M.sets := by - have hzero := M.natSetCode_mem separation infinite 0 - have nonzero : ZFSet.sep (fun n => n ≠ natSetCode 0) ZFSet.omega ∈ M.sets := - M.bounded_separation_mem separation (.neg (.equal 0 1)) - (extend (natSetCode 0) Fin.elim0) (Fin.cases hzero (fun j => Fin.elim0 j)) - (M.omega_mem separation infinite) - have singleton : ({B} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hB hB - exact M.insert_mem pairing unions (M.orderedPair_mem pairing hzero hA) - (M.prod_mem pairing unions powers separation nonzero singleton) - -theorem groundCountable_binary_union - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (countA : M.groundEmbeddable A ZFSet.omega) - (countB : M.groundEmbeddable B ZFSet.omega) : - M.groundEmbeddable (A ∪ B) ZFSet.omega := by - have result := M.countable_enumerated_union pairing unions powers separation infinite choice - (M.unorderedPair_mem pairing hA hB) (M.binary_union_mem pairing unions hA hB) - (M.binaryUnionEnumeration_mem pairing unions powers separation infinite hA hB) - (binaryUnionEnumeration_isFunc A B) (binaryUnionEnumeration_onto A B) - (fun p hp => (ZFSet.mem_pair.1 hp).elim - (fun eq => eq ▸ fun _ hz => ZFSet.mem_union.2 (Or.inl hz)) - (fun eq => eq ▸ fun _ hz => ZFSet.mem_union.2 (Or.inr hz))) - (fun p hp => (ZFSet.mem_pair.1 hp).elim (fun eq => eq ▸ countA) (fun eq => eq ▸ countB)) - simpa only [ZFSet.sUnion_pair] using result - -theorem countablePartialFunctions_union - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {X Y p q : ZFSet.{u}} - (hp : p ∈ M.smallPartialFunctions X Y ZFSet.omega) - (hq : q ∈ M.smallPartialFunctions X Y ZFSet.omega) - (agree : ∀ x y z, ZFSet.pair x y ∈ p → ZFSet.pair x z ∈ q → y = z) : - p ∪ q ∈ M.smallPartialFunctions X Y ZFSet.omega := by - obtain ⟨hpM, hpCode, hpSmall⟩ := (M.mem_smallPartialFunctions X Y ZFSet.omega p).1 hp - obtain ⟨hqM, hqCode, hqSmall⟩ := (M.mem_smallPartialFunctions X Y ZFSet.omega q).1 hq - exact (M.mem_smallPartialFunctions X Y ZFSet.omega _).2 - ⟨M.binary_union_mem pairing unions hpM hqM, hpCode.union hqCode agree, - M.groundCountable_binary_union pairing unions powers separation infinite choice hpM hqM hpSmall hqSmall⟩ - -theorem countableFunction_common_extension - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (X Y : ZFSet.{u}) : - letI := M.smallFunctionOrder X Y ZFSet.omega - ∀ p q : SetMembers (M.smallPartialFunctions X Y ZFSet.omega), - (∀ x y z, ZFSet.pair x y ∈ SetMembers.raw p → ZFSet.pair x z ∈ SetMembers.raw q → y = z) → - ∃ r, SetMembers.raw r = SetMembers.raw p ∪ SetMembers.raw q ∧ r ≤ p ∧ r ≤ q := by - let := M.smallFunctionOrder X Y ZFSet.omega - intro p q agree - have member := M.countablePartialFunctions_union pairing unions powers separation infinite choice - (SetMembers.raw_mem p) (SetMembers.raw_mem q) agree - let r := SetMembers.ofMem (SetMembers.raw p ∪ SetMembers.raw q) member - have raw : SetMembers.raw r = SetMembers.raw p ∪ SetMembers.raw q := SetMembers.raw_ofMem _ _ - refine ⟨r, raw, (M.smallFunction_le_iff X Y ZFSet.omega r p).2 ?_, - (M.smallFunction_le_iff X Y ZFSet.omega r q).2 ?_⟩ - · rw [raw] - exact fun _ hz => ZFSet.mem_union.2 (Or.inl hz) - · rw [raw] - exact fun _ hz => ZFSet.mem_union.2 (Or.inr hz) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include pairing unions powers separation infinite choice - -theorem exists_countableRelationSelection {A L R : ZFSet.{u}} - (hA : A ∈ M.sets) (hL : L ∈ M.sets) (hR : R ∈ M.sets) - (smallA : M.groundEmbeddable A ZFSet.omega) - (total : ∀ x ∈ A, ∃ y ∈ L, ZFSet.pair x y ∈ R) : - ∃ f ∈ M.sets, ZFSet.IsFunc A L f ∧ f ⊆ R ∧ - relationImage A L f ∈ M.sets ∧ M.groundEmbeddable (relationImage A L f) ZFSet.omega := by - obtain ⟨f,hf,function,selected⟩ := M.uniformize_relation pairing unions powers separation choice hA hL hR total - exact ⟨f,hf,function,selected,M.relationImage_mem separation hA hL hf, - M.groundEmbeddable_function_image pairing unions powers separation choice hA hL - (M.omega_mem separation infinite) hf function smallA⟩ - -theorem exists_countableNodeSelection {A L R used extra : ZFSet.{u}} - (hA : A ∈ M.sets) (hL : L ∈ M.sets) (hR : R ∈ M.sets) - (smallA : M.groundEmbeddable A ZFSet.omega) - (total : ∀ x ∈ A, ∃ y ∈ L, ZFSet.pair x y ∈ R) - (hUsed : used ∈ M.sets) (hExtra : extra ∈ M.sets) - (usedSubset : used ⊆ L) (extraSubset : extra ⊆ L) - (smallUsed : M.groundEmbeddable used ZFSet.omega) - (smallExtra : M.groundEmbeddable extra ZFSet.omega) : - ∃ f ∈ M.sets, ∃ W ∈ M.sets, - ZFSet.IsFunc A L f ∧ f ⊆ R ∧ - W = (relationImage A L f ∪ used) ∪ extra ∧ - W ⊆ L ∧ M.groundEmbeddable W ZFSet.omega ∧ - (∀ x y, ZFSet.pair x y ∈ f → y ∈ W) ∧ used ⊆ W ∧ extra ⊆ W := by - obtain ⟨f,hf,function,selected,hImage,smallImage⟩ := - M.exists_countableRelationSelection pairing unions powers separation infinite choice hA hL hR smallA total - have hBoth := M.binary_union_mem pairing unions hImage hUsed - have smallBoth := M.groundCountable_binary_union pairing unions powers separation infinite choice - hImage hUsed smallImage smallUsed - let W := (relationImage A L f ∪ used) ∪ extra - have hW : W ∈ M.sets := M.binary_union_mem pairing unions hBoth hExtra - have smallW : M.groundEmbeddable W ZFSet.omega := - M.groundCountable_binary_union pairing unions powers separation infinite choice hBoth hExtra smallBoth smallExtra - refine ⟨f,hf,W,hW,function,selected,rfl,?_,smallW,?_,?_,?_⟩ - · intro y hy - rcases ZFSet.mem_union.1 hy with both | additional - · rcases ZFSet.mem_union.1 both with image | old - · exact ((mem_relationImage A L f y).1 image).1 - · exact usedSubset old - · exact extraSubset additional - · intro x y entry - have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) - exact ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inl - ((mem_relationImage A L f y).2 ⟨bounds.2,x,bounds.1,entry⟩)))) - · intro y hy - exact ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inr hy))) - · intro y hy - exact ZFSet.mem_union.2 (Or.inr hy) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing + +open SetRealization +universe u + +noncomputable def binaryUnionEnumeration (A B : ZFSet.{u}) : ZFSet.{u} := + insert (ZFSet.pair (natSetCode 0) A) + (ZFSet.prod (ZFSet.sep (fun n => n ≠ natSetCode 0) ZFSet.omega) {B}) + +theorem pair_mem_binaryUnionEnumeration (A B n p : ZFSet.{u}) : + ZFSet.pair n p ∈ binaryUnionEnumeration A B ↔ + (n = natSetCode 0 ∧ p = A) ∨ + (n ∈ ZFSet.omega ∧ n ≠ natSetCode 0 ∧ p = B) := by + simp only [binaryUnionEnumeration, ZFSet.mem_insert_iff, ZFSet.pair_inj, + ZFSet.pair_mem_prod, ZFSet.mem_sep, ZFSet.mem_singleton, and_assoc] + +theorem binaryUnionEnumeration_isFunc (A B : ZFSet.{u}) : + ZFSet.IsFunc ZFSet.omega {A, B} (binaryUnionEnumeration A B) := by + classical + refine ⟨?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_insert_iff.1 hz with rfl | hz + · exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega 0, ZFSet.mem_pair.2 (Or.inl rfl)⟩ + · obtain ⟨n, hn, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz + exact ZFSet.pair_mem_prod.2 + ⟨(ZFSet.mem_sep.1 hn).1, ZFSet.mem_pair.2 (Or.inr (ZFSet.mem_singleton.1 hp))⟩ + · intro n hn + by_cases zero : n = natSetCode 0 + · refine ⟨A, (pair_mem_binaryUnionEnumeration A B n A).2 (Or.inl ⟨zero, rfl⟩), ?_⟩ + intro p hp + rcases (pair_mem_binaryUnionEnumeration A B n p).1 hp with h | h + · exact h.2 + · exact False.elim (h.2.1 zero) + · refine ⟨B, (pair_mem_binaryUnionEnumeration A B n B).2 (Or.inr ⟨hn, zero, rfl⟩), ?_⟩ + intro p hp + rcases (pair_mem_binaryUnionEnumeration A B n p).1 hp with h | h + · exact False.elim (zero h.1) + · exact h.2.2 + +theorem binaryUnionEnumeration_onto (A B : ZFSet.{u}) : + ∀ p ∈ ({A, B} : ZFSet.{u}), + ∃ n ∈ ZFSet.omega, ZFSet.pair n p ∈ binaryUnionEnumeration A B := by + intro p hp + rcases ZFSet.mem_pair.1 hp with hp | hp + · subst p + exact ⟨natSetCode 0, natSetCode_mem_omega 0, + (pair_mem_binaryUnionEnumeration A B _ _).2 (Or.inl ⟨rfl, rfl⟩)⟩ + · subst p + exact ⟨natSetCode 1, natSetCode_mem_omega 1, + (pair_mem_binaryUnionEnumeration A B _ _).2 + (Or.inr ⟨natSetCode_mem_omega 1, fun eq => Nat.one_ne_zero (natSetCode_injective eq), rfl⟩)⟩ + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem binaryUnionEnumeration_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) : + binaryUnionEnumeration A B ∈ M.sets := by + have hzero := M.natSetCode_mem separation infinite 0 + have nonzero : ZFSet.sep (fun n => n ≠ natSetCode 0) ZFSet.omega ∈ M.sets := + M.bounded_separation_mem separation (.neg (.equal 0 1)) + (extend (natSetCode 0) Fin.elim0) (Fin.cases hzero (fun j => Fin.elim0 j)) + (M.omega_mem separation infinite) + have singleton : ({B} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hB hB + exact M.insert_mem pairing unions (M.orderedPair_mem pairing hzero hA) + (M.prod_mem pairing unions powers separation nonzero singleton) + +theorem groundCountable_binary_union + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (countA : M.groundEmbeddable A ZFSet.omega) + (countB : M.groundEmbeddable B ZFSet.omega) : + M.groundEmbeddable (A ∪ B) ZFSet.omega := by + have result := M.countable_enumerated_union pairing unions powers separation infinite choice + (M.unorderedPair_mem pairing hA hB) (M.binary_union_mem pairing unions hA hB) + (M.binaryUnionEnumeration_mem pairing unions powers separation infinite hA hB) + (binaryUnionEnumeration_isFunc A B) (binaryUnionEnumeration_onto A B) + (fun p hp => (ZFSet.mem_pair.1 hp).elim + (fun eq => eq ▸ fun _ hz => ZFSet.mem_union.2 (Or.inl hz)) + (fun eq => eq ▸ fun _ hz => ZFSet.mem_union.2 (Or.inr hz))) + (fun p hp => (ZFSet.mem_pair.1 hp).elim (fun eq => eq ▸ countA) (fun eq => eq ▸ countB)) + simpa only [ZFSet.sUnion_pair] using result + +theorem countablePartialFunctions_union + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {X Y p q : ZFSet.{u}} + (hp : p ∈ M.smallPartialFunctions X Y ZFSet.omega) + (hq : q ∈ M.smallPartialFunctions X Y ZFSet.omega) + (agree : ∀ x y z, ZFSet.pair x y ∈ p → ZFSet.pair x z ∈ q → y = z) : + p ∪ q ∈ M.smallPartialFunctions X Y ZFSet.omega := by + obtain ⟨hpM, hpCode, hpSmall⟩ := (M.mem_smallPartialFunctions X Y ZFSet.omega p).1 hp + obtain ⟨hqM, hqCode, hqSmall⟩ := (M.mem_smallPartialFunctions X Y ZFSet.omega q).1 hq + exact (M.mem_smallPartialFunctions X Y ZFSet.omega _).2 + ⟨M.binary_union_mem pairing unions hpM hqM, hpCode.union hqCode agree, + M.groundCountable_binary_union pairing unions powers separation infinite choice hpM hqM hpSmall hqSmall⟩ + +theorem countableFunction_common_extension + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (X Y : ZFSet.{u}) : + letI := M.smallFunctionOrder X Y ZFSet.omega + ∀ p q : SetMembers (M.smallPartialFunctions X Y ZFSet.omega), + (∀ x y z, ZFSet.pair x y ∈ SetMembers.raw p → ZFSet.pair x z ∈ SetMembers.raw q → y = z) → + ∃ r, SetMembers.raw r = SetMembers.raw p ∪ SetMembers.raw q ∧ r ≤ p ∧ r ≤ q := by + let := M.smallFunctionOrder X Y ZFSet.omega + intro p q agree + have member := M.countablePartialFunctions_union pairing unions powers separation infinite choice + (SetMembers.raw_mem p) (SetMembers.raw_mem q) agree + let r := SetMembers.ofMem (SetMembers.raw p ∪ SetMembers.raw q) member + have raw : SetMembers.raw r = SetMembers.raw p ∪ SetMembers.raw q := SetMembers.raw_ofMem _ _ + refine ⟨r, raw, (M.smallFunction_le_iff X Y ZFSet.omega r p).2 ?_, + (M.smallFunction_le_iff X Y ZFSet.omega r q).2 ?_⟩ + · rw [raw] + exact fun _ hz => ZFSet.mem_union.2 (Or.inl hz) + · rw [raw] + exact fun _ hz => ZFSet.mem_union.2 (Or.inr hz) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include pairing unions powers separation infinite choice + +theorem exists_countableRelationSelection {A L R : ZFSet.{u}} + (hA : A ∈ M.sets) (hL : L ∈ M.sets) (hR : R ∈ M.sets) + (smallA : M.groundEmbeddable A ZFSet.omega) + (total : ∀ x ∈ A, ∃ y ∈ L, ZFSet.pair x y ∈ R) : + ∃ f ∈ M.sets, ZFSet.IsFunc A L f ∧ f ⊆ R ∧ + relationImage A L f ∈ M.sets ∧ M.groundEmbeddable (relationImage A L f) ZFSet.omega := by + obtain ⟨f,hf,function,selected⟩ := M.uniformize_relation pairing unions powers separation choice hA hL hR total + exact ⟨f,hf,function,selected,M.relationImage_mem separation hA hL hf, + M.groundEmbeddable_function_image pairing unions powers separation choice hA hL + (M.omega_mem separation infinite) hf function smallA⟩ + +theorem exists_countableNodeSelection {A L R used extra : ZFSet.{u}} + (hA : A ∈ M.sets) (hL : L ∈ M.sets) (hR : R ∈ M.sets) + (smallA : M.groundEmbeddable A ZFSet.omega) + (total : ∀ x ∈ A, ∃ y ∈ L, ZFSet.pair x y ∈ R) + (hUsed : used ∈ M.sets) (hExtra : extra ∈ M.sets) + (usedSubset : used ⊆ L) (extraSubset : extra ⊆ L) + (smallUsed : M.groundEmbeddable used ZFSet.omega) + (smallExtra : M.groundEmbeddable extra ZFSet.omega) : + ∃ f ∈ M.sets, ∃ W ∈ M.sets, + ZFSet.IsFunc A L f ∧ f ⊆ R ∧ + W = (relationImage A L f ∪ used) ∪ extra ∧ + W ⊆ L ∧ M.groundEmbeddable W ZFSet.omega ∧ + (∀ x y, ZFSet.pair x y ∈ f → y ∈ W) ∧ used ⊆ W ∧ extra ⊆ W := by + obtain ⟨f,hf,function,selected,hImage,smallImage⟩ := + M.exists_countableRelationSelection pairing unions powers separation infinite choice hA hL hR smallA total + have hBoth := M.binary_union_mem pairing unions hImage hUsed + have smallBoth := M.groundCountable_binary_union pairing unions powers separation infinite choice + hImage hUsed smallImage smallUsed + let W := (relationImage A L f ∪ used) ∪ extra + have hW : W ∈ M.sets := M.binary_union_mem pairing unions hBoth hExtra + have smallW : M.groundEmbeddable W ZFSet.omega := + M.groundCountable_binary_union pairing unions powers separation infinite choice hBoth hExtra smallBoth smallExtra + refine ⟨f,hf,W,hW,function,selected,rfl,?_,smallW,?_,?_,?_⟩ + · intro y hy + rcases ZFSet.mem_union.1 hy with both | additional + · rcases ZFSet.mem_union.1 both with image | old + · exact ((mem_relationImage A L f y).1 image).1 + · exact usedSubset old + · exact extraSubset additional + · intro x y entry + have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) + exact ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inl + ((mem_relationImage A L f y).2 ⟨bounds.2,x,bounds.1,entry⟩)))) + · intro y hy + exact ZFSet.mem_union.2 (Or.inl (ZFSet.mem_union.2 (Or.inr hy))) + · intro y hy + exact ZFSet.mem_union.2 (Or.inr hy) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowExactUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowExactUnions.lean index 0cfc7748bed4bad57e82fe9c839cf8a559ee9c51..b8d22a3fd71ff768946c7b59cf4b12c10967845c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowExactUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowExactUnions.lean @@ -1,78 +1,78 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticFairPreparationLimits - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] -variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -theorem countableRow_semanticStructuralTrace_exact_assignment_union - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (X : ZFSet.{u}) (hX : X ∈ M.sets) : - letI := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega - let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) - ∀ (a : PosetAction G (SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega))) - (T T2 rowTop : ZFSet.{u}), - a.actionGraph c t ∈ M.sets → - t.carrier ∈ M.sets → b.carrier ∈ M.sets → b.conditionOrder ∈ M.sets → - d.actionGraph b t ∈ M.sets → d.conditionMapFamily b t ∈ M.sets → - supportBasisCode b t d.principalFix ∈ M.sets → T ∈ M.sets → T2 ∈ M.sets → - (∀ z ∈ T, IsName c.pairEmpty z) → (∀ z ∈ T2, IsName c.pairEmpty z) → - (∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) → - (∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) → - (∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → - (∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → - rowTop ∈ c.carrier → (∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) → - ∀ stages history : ZFSet.{u}, stages ∈ M.sets → history ∈ M.sets → - ordinalSetProperty stages → - OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history → - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let Q := M.refinementHistoryForcing c.carrier T stages packed - let B := M.groundSmallSubsets (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega - let shape := M.refinementHistoryForcing_shape c.carrier T stages packed - let row := flatCarrierRow c Q B shape - let data := flatCarrierData c Q B shape - ∀ seq : Nat → SetMembers Q, groundSequenceGraph seq ∈ M.sets → Antitone seq → - ∃ q : SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega), - (∀ n, q ≤ row (seq n)) ∧ ∃ p : SetMembers Q, - SetMembers.raw p = ZFSet.pair (c.encode q) - (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) ∧ - (∀ n, p ≤ seq n) ∧ - SetMembers.raw (data p) = stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∧ - stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∈ M.sets ∧ - ∀ z, z ∈ SetMembers.raw (data p) ↔ ∃ n, z ∈ SetMembers.raw (data (seq n)) := by - let := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega - let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) - dsimp only - intro a T T2 rowTop action group nodes nodeOrder nodeAction nodeMaps supports hT hT2 - valid1 valid2 closed1 closed2 children1 children2 topMem topRows stages history hs hh ordinal trace - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two - have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice hX two - exact M.semanticStructuralTrace_exact_assignment_union c a t b d base directed T T2 rowTop - pairing unions powers separation collection carrier order action group nodes nodeOrder nodeAction - nodeMaps supports hT hT2 (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hs hh ordinal trace infinite choice rowClosed - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticFairPreparationLimits + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] +variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +theorem countableRow_semanticStructuralTrace_exact_assignment_union + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (X : ZFSet.{u}) (hX : X ∈ M.sets) : + letI := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega + let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) + ∀ (a : PosetAction G (SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega))) + (T T2 rowTop : ZFSet.{u}), + a.actionGraph c t ∈ M.sets → + t.carrier ∈ M.sets → b.carrier ∈ M.sets → b.conditionOrder ∈ M.sets → + d.actionGraph b t ∈ M.sets → d.conditionMapFamily b t ∈ M.sets → + supportBasisCode b t d.principalFix ∈ M.sets → T ∈ M.sets → T2 ∈ M.sets → + (∀ z ∈ T, IsName c.pairEmpty z) → (∀ z ∈ T2, IsName c.pairEmpty z) → + (∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) → + (∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) → + (∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → + (∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → + rowTop ∈ c.carrier → (∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) → + ∀ stages history : ZFSet.{u}, stages ∈ M.sets → history ∈ M.sets → + ordinalSetProperty stages → + OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history → + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let Q := M.refinementHistoryForcing c.carrier T stages packed + let B := M.groundSmallSubsets (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega + let shape := M.refinementHistoryForcing_shape c.carrier T stages packed + let row := flatCarrierRow c Q B shape + let data := flatCarrierData c Q B shape + ∀ seq : Nat → SetMembers Q, groundSequenceGraph seq ∈ M.sets → Antitone seq → + ∃ q : SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega), + (∀ n, q ≤ row (seq n)) ∧ ∃ p : SetMembers Q, + SetMembers.raw p = ZFSet.pair (c.encode q) + (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) ∧ + (∀ n, p ≤ seq n) ∧ + SetMembers.raw (data p) = stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∧ + stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∈ M.sets ∧ + ∀ z, z ∈ SetMembers.raw (data p) ↔ ∃ n, z ∈ SetMembers.raw (data (seq n)) := by + let := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega + let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) + dsimp only + intro a T T2 rowTop action group nodes nodeOrder nodeAction nodeMaps supports hT hT2 + valid1 valid2 closed1 closed2 children1 children2 topMem topRows stages history hs hh ordinal trace + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two + have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice hX two + exact M.semanticStructuralTrace_exact_assignment_union c a t b d base directed T T2 rowTop + pairing unions powers separation collection carrier order action group nodes nodeOrder nodeAction + nodeMaps supports hT hT2 (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hs hh ordinal trace infinite choice rowClosed + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowSequenceReflection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowSequenceReflection.lean index ff55ab0530b9a7b5df493109b28f4ce6ef00b376..4d7691f900eebdbdd1822c049fa56de6b198a68d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowSequenceReflection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundCountableRowSequenceReflection.lean @@ -1,161 +1,161 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralPrefixPreparationInputs - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] -variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - -theorem countableRow_semanticStructuralTrace_internally_closed - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (X : ZFSet.{u}) (hX : X ∈ M.sets) : - letI := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega - let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) - ∀ (a : PosetAction G (SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega))) - (T T2 rowTop : ZFSet.{u}), - a.actionGraph c t ∈ M.sets → - t.carrier ∈ M.sets → b.carrier ∈ M.sets → b.conditionOrder ∈ M.sets → - d.actionGraph b t ∈ M.sets → d.conditionMapFamily b t ∈ M.sets → - supportBasisCode b t d.principalFix ∈ M.sets → T ∈ M.sets → T2 ∈ M.sets → - (∀ z ∈ T, IsName c.pairEmpty z) → (∀ z ∈ T2, IsName c.pairEmpty z) → - (∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) → - (∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) → - (∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → - (∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → - rowTop ∈ c.carrier → (∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) → - ∀ stages history : ZFSet.{u}, stages ∈ M.sets → history ∈ M.sets → - ordinalSetProperty stages → - OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history → - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - InternallyCountablyClosed M (SetMembers.presentation - (M.refinementHistoryForcing c.carrier T stages packed)) := by - let := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega - let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) - dsimp only - intro a T T2 rowTop action group nodes nodeOrder nodeAction nodeMaps supports hT hT2 - valid1 valid2 closed1 closed2 children1 children2 topMem topRows stages history hs hh ordinal trace - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two - have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two - have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice hX two - exact M.semanticStructuralTrace_internally_closed c a t b d base directed T T2 rowTop - pairing unions powers separation collection carrier order action group nodes nodeOrder nodeAction - nodeMaps supports hT hT2 (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hs hh ordinal trace infinite choice rowClosed - - - - - - -theorem countableRow_semanticStructuralTrace_jointZF_sequenceReflection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (X : ZFSet.{u}) (hX : X ∈ M.sets) (small : M.sets.Countable) : - letI := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega - let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) - ∀ (a : PosetAction G (SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega))) - (T T2 rowTop : ZFSet.{u}) - (rowAction : a.actionGraph c t ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) (nodeAction : d.actionGraph b t ∈ M.sets) - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (symmetric1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) - (symmetric2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history), - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two - let rowOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let Q := M.refinementHistoryForcing c.carrier T stages packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ stages} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier T (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 ordinal trace - let witnesses := M.structuralForcingTrace_witnesses c a t b d base directed T T2 rowTop pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows hs hh ordinal trace - let mono := M.structuralHistory_rawTests_mono t b d base directed T T2 stages history - pairing unions powers separation collection group nodes supports hh hT witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] - (Fin.cases group (Fin.cases nodes (Fin.cases nodeOrder (Fin.cases supports - (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let act := M.semanticStructuralAction c a t b d base directed T T2 rowTop pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows hs hh ordinal trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code T j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction ordinal j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion ordinal j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hs hPacked hT j.property.1 carrier rowTop topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c a t b d base directed T T2 rowTop pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows hs hh ordinal trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let s := SetMembers.presentation Q - let F := d.principalSupportFamily base directed - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily ((act).symmetricDomain s (M.nameDomain s) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier T j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier T j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((act).symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ - ZFRealization (((act).symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension s H) U ∧ - GroundSequenceReflection M (M.symmetricExtension s (act) F H) U) := by - let := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega - let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) - dsimp only - intro a T T2 rowTop rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 - valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows stages history hs hh ordinal trace - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two - have rowOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two - have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice hX two - exact M.semanticStructuralTrace_jointZF_sequenceReflection c a t b d base directed T T2 rowTop - pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder - nodeAction nodeMaps supports hT hT2 (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 - symmetric1 symmetric2 topMem topRows hs hh ordinal trace infinite choice rowClosed small - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralPrefixPreparationInputs + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] +variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + +theorem countableRow_semanticStructuralTrace_internally_closed + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (X : ZFSet.{u}) (hX : X ∈ M.sets) : + letI := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega + let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) + ∀ (a : PosetAction G (SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega))) + (T T2 rowTop : ZFSet.{u}), + a.actionGraph c t ∈ M.sets → + t.carrier ∈ M.sets → b.carrier ∈ M.sets → b.conditionOrder ∈ M.sets → + d.actionGraph b t ∈ M.sets → d.conditionMapFamily b t ∈ M.sets → + supportBasisCode b t d.principalFix ∈ M.sets → T ∈ M.sets → T2 ∈ M.sets → + (∀ z ∈ T, IsName c.pairEmpty z) → (∀ z ∈ T2, IsName c.pairEmpty z) → + (∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) → + (∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) → + (∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → + (∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) → + rowTop ∈ c.carrier → (∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) → + ∀ stages history : ZFSet.{u}, stages ∈ M.sets → history ∈ M.sets → + ordinalSetProperty stages → + OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history → + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + InternallyCountablyClosed M (SetMembers.presentation + (M.refinementHistoryForcing c.carrier T stages packed)) := by + let := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega + let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) + dsimp only + intro a T T2 rowTop action group nodes nodeOrder nodeAction nodeMaps supports hT hT2 + valid1 valid2 closed1 closed2 children1 children2 topMem topRows stages history hs hh ordinal trace + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two + have order := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two + have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice hX two + exact M.semanticStructuralTrace_internally_closed c a t b d base directed T T2 rowTop + pairing unions powers separation collection carrier order action group nodes nodeOrder nodeAction + nodeMaps supports hT hT2 (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hs hh ordinal trace infinite choice rowClosed + + + + + + +theorem countableRow_semanticStructuralTrace_jointZF_sequenceReflection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (X : ZFSet.{u}) (hX : X ∈ M.sets) (small : M.sets.Countable) : + letI := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega + let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) + ∀ (a : PosetAction G (SetMembers (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega))) + (T T2 rowTop : ZFSet.{u}) + (rowAction : a.actionGraph c t ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) (nodeAction : d.actionGraph b t ∈ M.sets) + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (symmetric1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) + (symmetric2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history), + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two + let rowOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let Q := M.refinementHistoryForcing c.carrier T stages packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ stages} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier T (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) (supportBasisCode b t d.principalFix) T T2 ordinal trace + let witnesses := M.structuralForcingTrace_witnesses c a t b d base directed T T2 rowTop pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows hs hh ordinal trace + let mono := M.structuralHistory_rawTests_mono t b d base directed T T2 stages history + pairing unions powers separation collection group nodes supports hh hT witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![t.carrier, b.carrier, b.conditionOrder, supportBasisCode b t d.principalFix, T, T2, stages, history] + (Fin.cases group (Fin.cases nodes (Fin.cases nodeOrder (Fin.cases supports + (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let act := M.semanticStructuralAction c a t b d base directed T T2 rowTop pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows hs hh ordinal trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code T j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction ordinal j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion ordinal j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hs hPacked hT j.property.1 carrier rowTop topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c a t b d base directed T T2 rowTop pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 omega valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows hs hh ordinal trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let s := SetMembers.presentation Q + let F := d.principalSupportFamily base directed + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily ((act).symmetricDomain s (M.nameDomain s) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier T j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier T j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((act).symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ + ZFRealization (((act).symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension s H) U ∧ + GroundSequenceReflection M (M.symmetricExtension s (act) F H) U) := by + let := M.smallFunctionOrder X (natSetCode 2) ZFSet.omega + let c := SetMembers.presentation (M.smallPartialFunctions X (natSetCode 2) ZFSet.omega) + dsimp only + intro a T T2 rowTop rowAction group nodes nodeOrder nodeAction nodeMaps supports hT hT2 + valid1 valid2 closed1 closed2 symmetric1 symmetric2 topMem topRows stages history hs hh ordinal trace + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite hX two + have rowOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite hX two + have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice hX two + exact M.semanticStructuralTrace_jointZF_sequenceReflection c a t b d base directed T T2 rowTop + pairing unions powers separation collection carrier rowOrderGround rowAction group nodes nodeOrder + nodeAction nodeMaps supports hT hT2 (M.omega_mem separation infinite) valid1 valid2 closed1 closed2 + symmetric1 symmetric2 topMem topRows hs hh ordinal trace infinite choice rowClosed small + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundDefinableRefinementHistories.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundDefinableRefinementHistories.lean index 329288c35aa4ab730542eac58a90f99eff4d6db2..76914b67846ada85b160df6184be9ab460998f7c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundDefinableRefinementHistories.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundDefinableRefinementHistories.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace SetFormula - -noncomputable def refinementDataHistoryIndicesSetFormula {n : Nat} - (output stages history : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.refinementDataHistoryIndicesEntryFormula stages.succ history.succ 0).toFormula - -noncomputable def refinementDataHistoryLevelsSetFormula {n : Nat} - (output stages history T : Fin n) : SetFormula n := - exactSetFormula output - (BoundedFormula.refinementDataHistoryLevelsEntryFormula stages.succ history.succ T.succ 0).toFormula - -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_refinementDataHistoryIndicesSetFormula {n : Nat} - (output stages history : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (refinementDataHistoryIndicesSetFormula output stages history) env ↔ - env output = refinementDataHistoryIndices (env stages) (env history) := by - have ground := M.refinementDataHistoryIndices_mem pairing unions powers separation - (members stages) (members history) - apply M.realize_exactSetFormula output _ env (members output) - (fun _ member => M.transitive ground member) - intro z hz - exact (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members)).trans - (BoundedFormula.truth_refinementDataHistoryIndicesEntryFormula stages.succ history.succ 0 _) - -theorem realize_refinementDataHistoryLevelsSetFormula {n : Nat} - (output stages history T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (refinementDataHistoryLevelsSetFormula output stages history T) env ↔ - env output = refinementDataHistoryLevels (env stages) (env history) (env T) := by - have ground := M.refinementDataHistoryLevels_mem pairing unions powers separation - (members stages) (members history) (members T) - apply M.realize_exactSetFormula output _ env (members output) - (fun _ member => M.transitive ground member) - intro z hz - exact (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members)).trans - (BoundedFormula.truth_refinementDataHistoryLevelsEntryFormula stages.succ history.succ T.succ 0 _) - -noncomputable def definable_refinementDataHistoryIndices : GroundDefinableFunction M - (fun env : Fin 2 → ZFSet.{u} => refinementDataHistoryIndices (env 0) (env 1)) where - formula := refinementDataHistoryIndicesSetFormula 0 1 2 - closed := fun _ members => M.refinementDataHistoryIndices_mem pairing unions powers separation - (members 0) (members 1) - correct := fun env members z hz => M.realize_refinementDataHistoryIndicesSetFormula - pairing unions powers separation 0 1 2 (extend z env) (Fin.cases hz members) - -noncomputable def definable_refinementDataHistoryLevels : GroundDefinableFunction M - (fun env : Fin 3 → ZFSet.{u} => refinementDataHistoryLevels (env 0) (env 1) (env 2)) where - formula := refinementDataHistoryLevelsSetFormula 0 1 2 3 - closed := fun _ members => M.refinementDataHistoryLevels_mem pairing unions powers separation - (members 0) (members 1) (members 2) - correct := fun env members z hz => M.realize_refinementDataHistoryLevelsSetFormula - pairing unions powers separation 0 1 2 3 (extend z env) (Fin.cases hz members) - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace SetFormula + +noncomputable def refinementDataHistoryIndicesSetFormula {n : Nat} + (output stages history : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.refinementDataHistoryIndicesEntryFormula stages.succ history.succ 0).toFormula + +noncomputable def refinementDataHistoryLevelsSetFormula {n : Nat} + (output stages history T : Fin n) : SetFormula n := + exactSetFormula output + (BoundedFormula.refinementDataHistoryLevelsEntryFormula stages.succ history.succ T.succ 0).toFormula + +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_refinementDataHistoryIndicesSetFormula {n : Nat} + (output stages history : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (refinementDataHistoryIndicesSetFormula output stages history) env ↔ + env output = refinementDataHistoryIndices (env stages) (env history) := by + have ground := M.refinementDataHistoryIndices_mem pairing unions powers separation + (members stages) (members history) + apply M.realize_exactSetFormula output _ env (members output) + (fun _ member => M.transitive ground member) + intro z hz + exact (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members)).trans + (BoundedFormula.truth_refinementDataHistoryIndicesEntryFormula stages.succ history.succ 0 _) + +theorem realize_refinementDataHistoryLevelsSetFormula {n : Nat} + (output stages history T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (refinementDataHistoryLevelsSetFormula output stages history T) env ↔ + env output = refinementDataHistoryLevels (env stages) (env history) (env T) := by + have ground := M.refinementDataHistoryLevels_mem pairing unions powers separation + (members stages) (members history) (members T) + apply M.realize_exactSetFormula output _ env (members output) + (fun _ member => M.transitive ground member) + intro z hz + exact (BoundedFormula.realize_toFormula M _ _ (Fin.cases hz members)).trans + (BoundedFormula.truth_refinementDataHistoryLevelsEntryFormula stages.succ history.succ T.succ 0 _) + +noncomputable def definable_refinementDataHistoryIndices : GroundDefinableFunction M + (fun env : Fin 2 → ZFSet.{u} => refinementDataHistoryIndices (env 0) (env 1)) where + formula := refinementDataHistoryIndicesSetFormula 0 1 2 + closed := fun _ members => M.refinementDataHistoryIndices_mem pairing unions powers separation + (members 0) (members 1) + correct := fun env members z hz => M.realize_refinementDataHistoryIndicesSetFormula + pairing unions powers separation 0 1 2 (extend z env) (Fin.cases hz members) + +noncomputable def definable_refinementDataHistoryLevels : GroundDefinableFunction M + (fun env : Fin 3 → ZFSet.{u} => refinementDataHistoryLevels (env 0) (env 1) (env 2)) where + formula := refinementDataHistoryLevelsSetFormula 0 1 2 3 + closed := fun _ members => M.refinementDataHistoryLevels_mem pairing unions powers separation + (members 0) (members 1) (members 2) + correct := fun env members z hz => M.realize_refinementDataHistoryLevelsSetFormula + pairing unions powers separation 0 1 2 3 (extend z env) (Fin.cases hz members) + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExtensionOrdinals.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExtensionOrdinals.lean index 2dbb18e9752f27fe59498c96b5365d7316fab71f..9c15ce2c2d04f4a8db2af37fc31fe7dda87510f6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExtensionOrdinals.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExtensionOrdinals.lean @@ -1,117 +1,117 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProjectedRowChooserWitnesses - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula Compression.RecursiveMaps -universe u v - -namespace Name - -theorem rank_eval_le_code_rank {P : Type u} {s : Presentation P} (H : Set P) (tau : Name s) : - ZFSet.rank (eval H tau) ≤ ZFSet.rank tau.val := by - induction tau using inductionOn with - | step tau ih => - apply ZFSet.rank_le_iff.2 - intro x hx - obtain ⟨sigma, p, entry, _active, rfl⟩ := (mem_eval H tau x).1 hx - exact (ih sigma p entry).trans_lt (entry_rank_lt entry) - -end Name - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem ordinalCode_rank_mem {x : ZFSet.{u}} (hx : x ∈ M.sets) : - ordinalCode (ZFSet.rank x) ∈ M.sets := by - induction x using ZFSet.inductionOn with - | h x ih => - have witnesses : ∀ y ∈ x, ∃ beta ∈ M.sets, - Realize M.sets (cumulativeRankValueFormula 0 1) - (extend y (extend beta Fin.elim0)) := by - intro y hy - have hyM := M.transitive hx hy - have hRank := ih y hy hyM - refine ⟨ordinalCode (ZFSet.rank y), hRank, ?_⟩ - exact (M.realize_cumulativeRankValueFormula pairing unions powers separation collection - 0 1 _ (Fin.cases hyM (Fin.cases hRank (fun i => Fin.elim0 i)))).2 rfl - obtain ⟨B, hB, collected⟩ := M.collection_witness collection - (cumulativeRankValueFormula 0 1) Fin.elim0 (fun i => Fin.elim0 i) hx witnesses - let O := ZFSet.sep ordinalSetProperty B - have hO : O ∈ M.sets := by - have selected := M.bounded_separation_mem separation (BoundedFormula.ordinalFormula 0) - Fin.elim0 (fun i => Fin.elim0 i) hB - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.ordinalFormula 0) (extend z Fin.elim0)) B = O := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, ZFSet.mem_sep] - apply and_congr Iff.rfl - exact (BoundedFormula.truth_ordinalFormula 0 _).trans (ordinalSetProperty_iff z).symm - exact equal ▸ selected - have ordinals : ∀ beta ∈ O, ordinalSetProperty beta := fun _ member => (ZFSet.mem_sep.1 member).2 - let U := ZFSet.sUnion O - have hU : U ∈ M.sets := M.union_mem unions hO - have ordinalU : ordinalSetProperty U := ordinalSetProperty_sUnion ordinals - have bound : ZFSet.rank x ≤ Order.succ (ZFSet.rank U) := by - apply ZFSet.rank_le_iff.2 - intro y hy - obtain ⟨beta, hb, rankValue⟩ := collected y hy - have equal : beta = ordinalCode (ZFSet.rank y) := - (M.realize_cumulativeRankValueFormula pairing unions powers separation collection - 0 1 _ (Fin.cases (M.transitive hx hy) - (Fin.cases (M.transitive hB hb) (fun i => Fin.elim0 i)))).1 rankValue - have member : ordinalCode (ZFSet.rank y) ∈ O := - ZFSet.mem_sep.2 ⟨equal ▸ hb, ordinalSetProperty_ordinalCode _⟩ - have subset : ordinalCode (ZFSet.rank y) ⊆ U := - fun z hz => ZFSet.mem_sUnion.2 ⟨_, member, hz⟩ - have rankLe : ZFSet.rank y ≤ ZFSet.rank U := by - simpa only [rank_ordinalCode] using ZFSet.rank_mono subset - exact rankLe.trans_lt (Order.lt_succ _) - have hSucc : insert U U ∈ M.sets := M.insert_mem pairing unions hU hU - have hNext : insert (insert U U) (insert U U) ∈ M.sets := - M.insert_mem pairing unions hSucc hSucc - apply M.transitive hNext - rw [ordinalSetProperty_eq_code_rank U ordinalU, ← ordinalCode_succ, ← ordinalCode_succ, - mem_ordinalCode_iff] - exact Order.lt_succ_iff.2 bound - -theorem ordinal_eval_mem {P : Type u} (s : Presentation P) (H : Set P) - (tau : Name s) (ground : tau.val ∈ M.sets) - (ordinal : ordinalSetProperty (Name.eval H tau)) : Name.eval H tau ∈ M.sets := by - have codeGround := M.ordinalCode_rank_mem pairing unions powers separation collection ground - have successorGround := M.insert_mem pairing unions codeGround codeGround - apply M.transitive successorGround - rw [ordinalSetProperty_eq_code_rank (Name.eval H tau) ordinal, - ← ordinalCode_succ, mem_ordinalCode_iff] - exact Order.lt_succ_iff.2 (Name.rank_eval_le_code_rank H tau) - -theorem ordinaryExtension_ordinal_mem {P : Type u} [Preorder P] - (s : Presentation P) (H : ConditionFilter P) {delta : ZFSet.{u}} - (member : delta ∈ (M.ordinaryExtension s H).sets) (ordinal : ordinalSetProperty delta) : - delta ∈ M.sets := by - obtain ⟨tau, ground, rfl⟩ := (M.mem_ordinaryExtension s H delta).1 member - exact M.ordinal_eval_mem pairing unions powers separation collection s {p | H.mem p} tau ground ordinal - -theorem symmetricExtension_ordinal_mem {P : Type u} [PartialOrder P] - (s : Presentation P) {G : Type v} [Group G] (a : PosetAction G P) - (F : NormalSubgroupFamily G) (H : ConditionFilter P) {delta : ZFSet.{u}} - (member : delta ∈ (M.symmetricExtension s a F H).sets) (ordinal : ordinalSetProperty delta) : - delta ∈ M.sets := - M.ordinaryExtension_ordinal_mem pairing unions powers separation collection s H - (M.symmetricExtension_subset_ordinaryExtension s a F H member) ordinal - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProjectedRowChooserWitnesses + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula Compression.RecursiveMaps +universe u v + +namespace Name + +theorem rank_eval_le_code_rank {P : Type u} {s : Presentation P} (H : Set P) (tau : Name s) : + ZFSet.rank (eval H tau) ≤ ZFSet.rank tau.val := by + induction tau using inductionOn with + | step tau ih => + apply ZFSet.rank_le_iff.2 + intro x hx + obtain ⟨sigma, p, entry, _active, rfl⟩ := (mem_eval H tau x).1 hx + exact (ih sigma p entry).trans_lt (entry_rank_lt entry) + +end Name + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem ordinalCode_rank_mem {x : ZFSet.{u}} (hx : x ∈ M.sets) : + ordinalCode (ZFSet.rank x) ∈ M.sets := by + induction x using ZFSet.inductionOn with + | h x ih => + have witnesses : ∀ y ∈ x, ∃ beta ∈ M.sets, + Realize M.sets (cumulativeRankValueFormula 0 1) + (extend y (extend beta Fin.elim0)) := by + intro y hy + have hyM := M.transitive hx hy + have hRank := ih y hy hyM + refine ⟨ordinalCode (ZFSet.rank y), hRank, ?_⟩ + exact (M.realize_cumulativeRankValueFormula pairing unions powers separation collection + 0 1 _ (Fin.cases hyM (Fin.cases hRank (fun i => Fin.elim0 i)))).2 rfl + obtain ⟨B, hB, collected⟩ := M.collection_witness collection + (cumulativeRankValueFormula 0 1) Fin.elim0 (fun i => Fin.elim0 i) hx witnesses + let O := ZFSet.sep ordinalSetProperty B + have hO : O ∈ M.sets := by + have selected := M.bounded_separation_mem separation (BoundedFormula.ordinalFormula 0) + Fin.elim0 (fun i => Fin.elim0 i) hB + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.ordinalFormula 0) (extend z Fin.elim0)) B = O := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, ZFSet.mem_sep] + apply and_congr Iff.rfl + exact (BoundedFormula.truth_ordinalFormula 0 _).trans (ordinalSetProperty_iff z).symm + exact equal ▸ selected + have ordinals : ∀ beta ∈ O, ordinalSetProperty beta := fun _ member => (ZFSet.mem_sep.1 member).2 + let U := ZFSet.sUnion O + have hU : U ∈ M.sets := M.union_mem unions hO + have ordinalU : ordinalSetProperty U := ordinalSetProperty_sUnion ordinals + have bound : ZFSet.rank x ≤ Order.succ (ZFSet.rank U) := by + apply ZFSet.rank_le_iff.2 + intro y hy + obtain ⟨beta, hb, rankValue⟩ := collected y hy + have equal : beta = ordinalCode (ZFSet.rank y) := + (M.realize_cumulativeRankValueFormula pairing unions powers separation collection + 0 1 _ (Fin.cases (M.transitive hx hy) + (Fin.cases (M.transitive hB hb) (fun i => Fin.elim0 i)))).1 rankValue + have member : ordinalCode (ZFSet.rank y) ∈ O := + ZFSet.mem_sep.2 ⟨equal ▸ hb, ordinalSetProperty_ordinalCode _⟩ + have subset : ordinalCode (ZFSet.rank y) ⊆ U := + fun z hz => ZFSet.mem_sUnion.2 ⟨_, member, hz⟩ + have rankLe : ZFSet.rank y ≤ ZFSet.rank U := by + simpa only [rank_ordinalCode] using ZFSet.rank_mono subset + exact rankLe.trans_lt (Order.lt_succ _) + have hSucc : insert U U ∈ M.sets := M.insert_mem pairing unions hU hU + have hNext : insert (insert U U) (insert U U) ∈ M.sets := + M.insert_mem pairing unions hSucc hSucc + apply M.transitive hNext + rw [ordinalSetProperty_eq_code_rank U ordinalU, ← ordinalCode_succ, ← ordinalCode_succ, + mem_ordinalCode_iff] + exact Order.lt_succ_iff.2 bound + +theorem ordinal_eval_mem {P : Type u} (s : Presentation P) (H : Set P) + (tau : Name s) (ground : tau.val ∈ M.sets) + (ordinal : ordinalSetProperty (Name.eval H tau)) : Name.eval H tau ∈ M.sets := by + have codeGround := M.ordinalCode_rank_mem pairing unions powers separation collection ground + have successorGround := M.insert_mem pairing unions codeGround codeGround + apply M.transitive successorGround + rw [ordinalSetProperty_eq_code_rank (Name.eval H tau) ordinal, + ← ordinalCode_succ, mem_ordinalCode_iff] + exact Order.lt_succ_iff.2 (Name.rank_eval_le_code_rank H tau) + +theorem ordinaryExtension_ordinal_mem {P : Type u} [Preorder P] + (s : Presentation P) (H : ConditionFilter P) {delta : ZFSet.{u}} + (member : delta ∈ (M.ordinaryExtension s H).sets) (ordinal : ordinalSetProperty delta) : + delta ∈ M.sets := by + obtain ⟨tau, ground, rfl⟩ := (M.mem_ordinaryExtension s H delta).1 member + exact M.ordinal_eval_mem pairing unions powers separation collection s {p | H.mem p} tau ground ordinal + +theorem symmetricExtension_ordinal_mem {P : Type u} [PartialOrder P] + (s : Presentation P) {G : Type v} [Group G] (a : PosetAction G P) + (F : NormalSubgroupFamily G) (H : ConditionFilter P) {delta : ZFSet.{u}} + (member : delta ∈ (M.symmetricExtension s a F H).sets) (ordinal : ordinalSetProperty delta) : + delta ∈ M.sets := + M.ordinaryExtension_ordinal_mem pairing unions powers separation collection s H + (M.symmetricExtension_subset_ordinaryExtension s a F H member) ordinal + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalBirthLayers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalBirthLayers.lean index 47630f21f8d0cabbb58b1d52244797abe33d83e6..6580e5a32b2db63a7e61fa019e4b03b3f352de38 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalBirthLayers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalBirthLayers.lean @@ -1,484 +1,484 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalFamilySlotCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparationFamilyImages - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem pushedBirthGraph_oldMeet {A B T rA rB μA μB e old : ZFSet.{u}} - (source : MeetOrderCode A rA μA) (target : MeetOrderCode B rB μB) - (embedding : MeetEmbeddingCode A B rA rB μA μB e) - (born : ZFSet.IsFunc A T old) (oldMeet : OldMeetCode rA μA old) : - OldMeetCode rB μB (pushedHeightGraph A B T e old) := by - intro x y z a b c bornY bornX earlier notLower meetXY bornZ - have function := pushedHeightGraph_function embedding.injection born - have hx := (ZFSet.pair_mem_prod.1 (function.1 bornX)).1 - have hy := (ZFSet.pair_mem_prod.1 (function.1 bornY)).1 - obtain ⟨_, x0, hx0, copyX⟩ := (mem_relationImage _ _ _ _).1 hx - obtain ⟨_, y0, hy0, copyY⟩ := (mem_relationImage _ _ _ _).1 hy - obtain ⟨z0, sourceMeet, _⟩ := source.operation.2 (ZFSet.pair x0 y0) (ZFSet.pair_mem_prod.2 ⟨hx0, hy0⟩) - have hz0 := (ZFSet.pair_mem_prod.1 (source.operation.1 sourceMeet)).2 - obtain ⟨z1, copyZ, _⟩ := embedding.injection.function.2 z0 hz0 - have targetMeet := embedding.map_meet x0 y0 z0 x y z1 sourceMeet copyX copyY copyZ - obtain ⟨_, _, unique⟩ := target.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.1 (target.operation.1 meetXY)).1 - have equal := (unique z1 targetMeet).trans (unique z meetXY).symm - subst z1 - exact oldMeet x0 y0 z0 a b c - ((pushedHeightGraph_entry embedding.injection born copyY).1 bornY) - ((pushedHeightGraph_entry embedding.injection born copyX).1 bornX) earlier - (fun lower => notLower (embedding.monotone x0 y0 x y lower copyX copyY)) sourceMeet - ((pushedHeightGraph_entry embedding.injection born copyZ).1 bornZ) - -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.Forcing.GroundCompressionCompletion -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -noncomputable def externalSeedBirth (P r μ A times birth : ZFSet.{u}) : ZFSet.{u} := - pushedHeightGraph (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) - times (completion.externalIdentityCopyGraph P r μ A) birth - -end PartitionPilot.Forcing.GroundCompressionCompletion - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 times birth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "old" => completion.externalSeedBirth P0 r0 μ0 A0 times birth -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG - -theorem externalSeedBirth_spec (hP0 : P0 ∈ M.sets) (hTimes : times ∈ M.sets) (hBirth : birth ∈ M.sets) - (born : ZFSet.IsFunc (completion.algebra.union.fields 0) times birth) - (oldMeet : OldMeetCode (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) birth) : - old ∈ M.sets ∧ ZFSet.IsFunc P times old ∧ - OldMeetCode (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) old := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - exact ⟨M.pushedHeightGraph_mem pairing unions powers separation (completion.algebra.union.ground 0) - geometry.carrier_ground hTimes (geometry.copies_ground _ data.group.group_code.identity_mem) hBirth, - pushedHeightGraph_function embedding.injection born, - pushedBirthGraph_oldMeet completion.algebra.union.meet geometry.meet embedding.toMeetEmbeddingCode born oldMeet⟩ - -theorem externalSeedBirth_entry - (born : ZFSet.IsFunc (completion.algebra.union.fields 0) times birth) - {x y t : ZFSet.{u}} (copied : ZFSet.pair x y ∈ completion.externalIdentityCopyGraph P0 r0 μ0 A0) : - ZFSet.pair y t ∈ old ↔ ZFSet.pair x t ∈ birth := - pushedHeightGraph_entry - (data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG).injection born copied - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end - - -namespace PartitionPilot.Forcing -universe u -namespace GroundCompressionCompletion -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ : ZFSet.{u}} -variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) -noncomputable def externalBirthGraph (P r μ A oldTimes oldBirth limit stamps : ZFSet.{u}) : ZFSet.{u} := - ownerBirthGraph (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A) - limit (completion.externalSeedBirth P r μ A oldTimes oldBirth) - (completion.externalOwnerLevels P r μ A) stamps - -end GroundCompressionCompletion - -structure GroundExternalBirthData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m one T τ P r μ A oldTimes oldBirth : ZFSet.{u}) - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) where - stamps : ZFSet.{u} - limit : ZFSet.{u} - stamps_ground : stamps ∈ M.sets - limit_ground : limit ∈ M.sets - times : CompressionStampCode oldTimes stamps limit - seed_function : ZFSet.IsFunc (completion.externalSeedCarrier P r μ A) oldTimes - (completion.externalSeedBirth P r μ A oldTimes oldBirth) - birth_ground : completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps ∈ M.sets - function : ZFSet.IsFunc (completion.externalPointCarrier P r μ A) limit - (completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps) - old_meet : OldMeetCode (completion.externalPointOrder P r μ A) (completion.externalPointMeet P r μ A) - (completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps) - preserves_seed : ∀ x y t, ZFSet.pair x y ∈ completion.externalIdentityCopyGraph P r μ A → - (ZFSet.pair y t ∈ completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps ↔ - ZFSet.pair x t ∈ oldBirth) - -namespace GroundExternalBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P r μ A oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalBirthData M initial I Sources Reps G m one T τ P r μ A oldTimes oldBirth completion) -noncomputable def birth : ZFSet.{u} := - completion.externalBirthGraph P r μ A oldTimes oldBirth data.limit data.stamps - -include data -theorem old_before {x a : ZFSet.{u}} - (entry : ZFSet.pair x a ∈ completion.externalSeedBirth P r μ A oldTimes oldBirth) (n : Nat) : - a ∈ compressionStamp oldTimes n := - compressionStamp_old_mem (Or.inl (ZFSet.pair_mem_prod.1 (data.seed_function.1 entry)).2) n - -theorem stamp_fiber (n : Nat) (x : ZFSet.{u}) : - ZFSet.pair x (compressionStamp oldTimes n) ∈ data.birth ↔ - x ∈ ownerFresh (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A) ∧ - ZFSet.pair x (natSetCode n) ∈ completion.externalOwnerLevels P r μ A := by - apply ownerBirthGraph_stamp_fiber data.seed_function data.times.ownerStampCode - · intro y a k t entry stamp - rw [(data.times.entries k t).1 stamp] - exact data.old_before entry k - · exact (data.times.entries n _).2 rfl - -theorem no_limit_birth (x : ZFSet.{u}) : ZFSet.pair x data.limit ∉ data.birth := - fun entry => ZFSet.mem_irrefl data.limit (ZFSet.pair_mem_prod.1 (data.function.1 entry)).2 - -end GroundExternalBirthData - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original - -noncomputable def externalBirthCopyVertex (k : Nat) (r : Index) : Option ((family).Child r) := by - classical - exact if h : ∃ i, ((family).request r).vertexSlot i = k % 3 then Classical.choose h else none - -theorem externalBirthCopyVertex_eq (k : Nat) (r : Index) (i : Option ((family).Child r)) - (slot : ((family).request r).vertexSlot i = k % 3) : - data.externalBirthCopyVertex group oldAction k r = i := by - classical - have existsSlot : ∃ j, ((family).request r).vertexSlot j = k % 3 := ⟨i, slot⟩ - simp only [externalBirthCopyVertex, dite_eq_left existsSlot] - exact ((family).request r).vertexSlot_injective ((Classical.choose_spec existsSlot).trans slot.symm) - -include data group oldAction pairing unions powers separation infinite hG - -theorem externalBirthCopy_witness (hP0 : P0 ∈ M.sets) (k : Nat) {x : ZFSet.{u}} - (level : ZFSet.pair x (natSetCode k) ∈ completion.externalOwnerLevels P0 r0 μ0 A0) : - letI := group.toGroup - ∃ w r, ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ completion.externalStarOwner P0 r0 μ0 A0 ∧ - x ∈ relationImage U B (completion.externalCopyGraph P0 r0 μ0 A0 - ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r)))) := by - let := group.toGroup - have owner := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - obtain ⟨_, v, n, j, hj, owned, _, slot, rank⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level - have selected := (pair_mem_leastSlotOwnerGraph_of_owner owner owned).1 slot - obtain ⟨w, r, i, a, eqV, eqJ, eqX⟩ := - data.externalTileSlotPoints_decode group oldAction pairing unions powers separation infinite hG selected.2.2.1 - have ji : j = ((family).request r).vertexSlot i := by - apply natSetCode_injective - exact eqJ.trans (completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i) - have chosen : data.externalBirthCopyVertex group oldAction k r = i := by - apply data.externalBirthCopyVertex_eq group oldAction - rw [← ji, rank, depthSlotIndex, Nat.add_mod] - simp only [Nat.mul_mod, Nat.mod_self, Nat.zero_mul, Nat.zero_mod, Nat.zero_add, Nat.mod_eq_of_lt hj] - refine ⟨w, r, eqV ▸ owned, ?_⟩ - rw [chosen, eqX, (family).flatVertex_copy] - have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG - rw [data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] - apply (mem_relationImage _ _ _ _).2 - exact ⟨qc ▸ (q).encode_mem _, SetMembers.raw a, SetMembers.raw_mem a, - ((SetMembers.presentation U).pair_mem_graph (q) _ a _).2 rfl⟩ - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "old" => completion.externalSeedBirth P0 r0 μ0 A0 oldTimes oldBirth -include data group oldAction pairing unions powers separation collection infinite hG hP0 - -theorem exists_externalBirths_of_seed (hOldTimes : oldTimes ∈ M.sets) - (ordinal : ordinalSetProperty oldTimes) (hOldBirth : oldBirth ∈ M.sets) - (born : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) - (oldMeet : OldMeetCode (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth) : - Nonempty (GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) := by - obtain ⟨stamps, hStamps, limit, hLimit, _, stampCode⟩ := - M.exists_groundCompressionStamps pairing unions separation collection infinite hOldTimes ordinal - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have seed := data.externalSeedBirth_spec group oldAction pairing unions powers separation infinite hG hP0 - hOldTimes hOldBirth born oldMeet - have levels := data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0 - have hP := data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0 - have subset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 - have times : oldTimes ⊆ limit := fun _ ht => stampCode.union.subset 0 (compressionStamp_old_mem (Or.inl ht) 0) - have oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t := by - intro x a n t entry stamp - rw [(stampCode.entries n t).1 stamp] - exact compressionStamp_old_mem (Or.inl (ZFSet.pair_mem_prod.1 (seed.2.1.1 entry)).2) n - refine ⟨{ - stamps := stamps - limit := limit - stamps_ground := hStamps - limit_ground := hLimit - times := stampCode - seed_function := seed.2.1 - birth_ground := M.ownerBirthGraph_mem pairing unions powers separation hP geometry.carrier_ground hLimit - seed.1 levels.1 hStamps (M.omega_mem separation infinite) - function := ownerBirthGraph_function seed.2.1 subset times levels.2 stampCode.function - old_meet := ?_ - preserves_seed := ?_ }⟩ - · apply ownerBirthGraph_oldMeet geometry.meet seed.2.1 subset times levels.2 stampCode.ownerStampCode seed.2.2 - · intro x hx y hy lower - exact data.externalSeedCarrier_lower group oldAction pairing unions powers separation infinite hG hx hy lower - · exact oldBefore - · intro x _ y _ n k first second lower - exact data.externalOwnerLevels_monotone group oldAction pairing unions powers separation infinite hG hP0 lower first second - · intro x y t copied - have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) - have hy : y ∈ P := (mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, copied⟩ - exact (ownerBirthGraph_old_iff hy).trans - (data.externalSeedBirth_entry group oldAction pairing unions powers separation infinite hG born copied) - -theorem exists_externalBirths {base originalBirth : ZFSet.{u}} - (births : GroundCompressionBirthData M initial I Sources Reps G m one T - completion.algebra.union base originalBirth) : - Nonempty (GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 births.limit births.birth completion) := - data.exists_externalBirths_of_seed group oldAction pairing unions powers separation collection infinite hG hP0 - births.limit_ground births.times.ordinal births.birth_ground births.function births.old_meet - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula SetRealization Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "U" => completion.algebra.union.fields 0 -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 -local notation "depths" => M.externalStarDepth G letters requests m one -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -local notation "family" => completion.externalFamily group oldAction data.original -local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -include data group oldAction pairing unions powers separation infinite hG - -theorem externalBirthCopy_level_slot (hP0 : P0 ∈ M.sets) : - letI := group.toGroup - ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (k : Nat) {x : ZFSet.{u}}, - ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ owners → - ZFSet.pair x (natSetCode k) ∈ levels → - ∃ n, ZFSet.pair ((vpres).encode (.inr (w, r))) (natSetCode n) ∈ depths ∧ - k = depthSlotIndex n (((family).request r).vertexSlot (data.externalBirthCopyVertex group oldAction k r)) := by - let := group.toGroup - intro w r k x active level - obtain ⟨_, v, n, j, hj, owned, depth, slot, rank⟩ := - (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level - have owner := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have sameOwner := (show FunctionGraphOn B owners from ⟨_, owner⟩).unique owned active - subst v - have selected := (pair_mem_leastSlotOwnerGraph_of_owner owner active).1 slot - obtain ⟨w', r', i, _, eqV, eqJ, _⟩ := - data.externalTileSlotPoints_decode group oldAction pairing unions powers separation infinite hG selected.2.2.1 - have same := Sum.inr.inj ((vpres).injective eqV) - obtain ⟨rfl, rfl⟩ := Prod.mk.inj same - have ji : j = ((family).request r).vertexSlot i := - natSetCode_injective (eqJ.trans (completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i)) - have chosen : data.externalBirthCopyVertex group oldAction k r = i := by - apply data.externalBirthCopyVertex_eq group oldAction - rw [← ji, rank, depthSlotIndex, Nat.add_mod] - simp only [Nat.mul_mod, Nat.mod_self, Nat.zero_mul, Nat.zero_mod, Nat.zero_add, Nat.mod_eq_of_lt hj] - exact ⟨n, depth, by rw [chosen, ← ji]; exact rank⟩ - -theorem externalBirthCopy_level_bound (hP0 : P0 ∈ M.sets) : - letI := group.toGroup - ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (k : Nat) {x u y : ZFSet.{u}}, - ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ owners → - ZFSet.pair x (natSetCode k) ∈ levels → - ZFSet.pair u y ∈ completion.externalCopyGraph P0 r0 μ0 A0 - ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r))) → - y ∈ P ∨ ∃ l ≤ k, ZFSet.pair y (natSetCode l) ∈ levels := by - let := group.toGroup - intro w r k x u y active level copied - obtain ⟨n, depth, rank⟩ := data.externalBirthCopy_level_slot group oldAction pairing unions powers separation infinite hG hP0 - w r k active level - let i := data.externalBirthCopyVertex group oldAction k r - rw [data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] at copied - obtain ⟨a, equal⟩ := ((SetMembers.presentation U).mem_graph (q) _ _).1 copied - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - have supported := (data.externalTileSlotPoints_entry group oldAction pairing unions powers separation infinite hG - w r i ((family).copy (action) ((family).flatWord w r i) |>.toFun a)).2 - ⟨a, (family).flatVertex_copy (action) w r i a⟩ - rw [completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i] at supported - have bound := data.externalSlotCopy_old_or_level_bound group oldAction pairing unions powers separation infinite hG hP0 - supported depth - rw [← rank] at bound - exact bound - -theorem externalBirthCopy_image_level_bound (hP0 : P0 ∈ M.sets) : - letI := group.toGroup - ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (k : Nat) {x y : ZFSet.{u}}, - ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ owners → - ZFSet.pair x (natSetCode k) ∈ levels → - y ∈ relationImage U B (completion.externalCopyGraph P0 r0 μ0 A0 - ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r)))) → - y ∈ P ∨ ∃ l ≤ k, ZFSet.pair y (natSetCode l) ∈ levels := by - let := group.toGroup - intro w r k x y active level image - obtain ⟨_, u, _, copied⟩ := (mem_relationImage _ _ _ _).1 image - exact data.externalBirthCopy_level_bound group oldAction pairing unions powers separation infinite hG hP0 - w r k active level copied - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) -local notation "family" => completion.externalFamily group oldAction data.original -local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground -local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG -local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG hP0 births - -noncomputable def externalBirth_fresh_layer - (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) - (atSpace : Space oldTimes = U) - (atOrder : sourceOrder oldTimes = completion.algebra.union.fields 1) - (atMeet : sourceMeet oldTimes = completion.algebra.union.fields 2) (k : Nat) : - CodedGrowthLayer M Space sourceOrder sourceMeet B (completion.externalPointOrder P0 r0 μ0 A0) - (completion.externalPointMeet P0 r0 μ0 A0) births.birth (compressionStamp oldTimes k) := by - classical - letI := group.toGroup - let Copies := External (SetMembers G) (family).Letters × Index - let e (v : Copies) := completion.externalCopyGraph P0 r0 μ0 A0 - ((s).encode ((family).flatWord v.1 v.2 (data.externalBirthCopyVertex group oldAction k v.2))) - let Slice := {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode k) ∈ levels} - have witnesses (x : Slice) : ∃ v : Copies, - ZFSet.pair x.val ((vpres).encode (.inr v)) ∈ owner ∧ x.val ∈ relationImage U B (e v) := by - obtain ⟨w, r, owned, covered⟩ := - data.externalBirthCopy_witness group oldAction pairing unions powers separation infinite hG hP0 k x.property.2 - exact ⟨(w, r), owned, covered⟩ - let pick (x : Slice) : Copies := Classical.choose (witnesses x) - have selected (x : Slice) : - ZFSet.pair x.val ((vpres).encode (.inr (pick x))) ∈ owner ∧ - x.val ∈ relationImage U B (e (pick x)) := Classical.choose_spec (witnesses x) - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have levelCode := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 - have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original - pairing unions powers separation infinite hG data.words.letters_ground - have oldSubset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 - have times : oldTimes ⊆ births.limit := fun _ ht => - births.times.union.subset 0 (compressionStamp_old_mem (Or.inl ht) 0) - have oldBefore : ∀ x a n t, ZFSet.pair x a ∈ completion.externalSeedBirth P0 r0 μ0 A0 oldTimes oldBirth → - ZFSet.pair (natSetCode n) t ∈ births.stamps → a ∈ t := by - intro x a n t entry stamp - rw [(births.times.entries n t).1 stamp] - exact births.old_before entry n - refine ownerBirthGraph_separated births.seed_function oldSubset times levelCode births.times.ownerStampCode - oldBefore ((births.times.entries k _).2 rfl) Copies (fun _ => oldTimes) e - (fun _ => compressionStamp_base_mem oldTimes k) ?_ ?_ pick ?_ ?_ - · intro v - exact geometry.copies_ground _ (sc ▸ (s).encode_mem _) - · intro v - rw [atSpace, atOrder, atMeet] - exact geometry.copies _ (sc ▸ (s).encode_mem _) - · intro x _ - rw [atSpace] - exact (selected x).2 - · intro x y _ _ different - have differentOwners : (vpres).encode (.inr (pick x)) ≠ (vpres).encode (.inr (pick y)) := by - intro equal - exact different (Sum.inr.inj ((vpres).injective equal)) - have hx := ((mem_ownerFresh P B x.val).1 x.property.1).1 - have hy := ((mem_ownerFresh P B y.val).1 y.property.1).1 - obtain ⟨z, meetEntry, _⟩ := geometry.meet.operation.2 (ZFSet.pair x.val y.val) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - refine ⟨z, (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2, meetEntry, ?_⟩ - exact data.externalOwnerLevels_meet_old_or_lower group oldAction pairing unions powers separation infinite hG hP0 - (selected x).1 (selected y).1 differentOwners x.property.2 y.property.2 meetEntry - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalFamilySlotCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundPreparationFamilyImages + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem pushedBirthGraph_oldMeet {A B T rA rB μA μB e old : ZFSet.{u}} + (source : MeetOrderCode A rA μA) (target : MeetOrderCode B rB μB) + (embedding : MeetEmbeddingCode A B rA rB μA μB e) + (born : ZFSet.IsFunc A T old) (oldMeet : OldMeetCode rA μA old) : + OldMeetCode rB μB (pushedHeightGraph A B T e old) := by + intro x y z a b c bornY bornX earlier notLower meetXY bornZ + have function := pushedHeightGraph_function embedding.injection born + have hx := (ZFSet.pair_mem_prod.1 (function.1 bornX)).1 + have hy := (ZFSet.pair_mem_prod.1 (function.1 bornY)).1 + obtain ⟨_, x0, hx0, copyX⟩ := (mem_relationImage _ _ _ _).1 hx + obtain ⟨_, y0, hy0, copyY⟩ := (mem_relationImage _ _ _ _).1 hy + obtain ⟨z0, sourceMeet, _⟩ := source.operation.2 (ZFSet.pair x0 y0) (ZFSet.pair_mem_prod.2 ⟨hx0, hy0⟩) + have hz0 := (ZFSet.pair_mem_prod.1 (source.operation.1 sourceMeet)).2 + obtain ⟨z1, copyZ, _⟩ := embedding.injection.function.2 z0 hz0 + have targetMeet := embedding.map_meet x0 y0 z0 x y z1 sourceMeet copyX copyY copyZ + obtain ⟨_, _, unique⟩ := target.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.1 (target.operation.1 meetXY)).1 + have equal := (unique z1 targetMeet).trans (unique z meetXY).symm + subst z1 + exact oldMeet x0 y0 z0 a b c + ((pushedHeightGraph_entry embedding.injection born copyY).1 bornY) + ((pushedHeightGraph_entry embedding.injection born copyX).1 bornX) earlier + (fun lower => notLower (embedding.monotone x0 y0 x y lower copyX copyY)) sourceMeet + ((pushedHeightGraph_entry embedding.injection born copyZ).1 bornZ) + +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.Forcing.GroundCompressionCompletion +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +noncomputable def externalSeedBirth (P r μ A times birth : ZFSet.{u}) : ZFSet.{u} := + pushedHeightGraph (completion.algebra.union.fields 0) (completion.externalPointCarrier P r μ A) + times (completion.externalIdentityCopyGraph P r μ A) birth + +end PartitionPilot.Forcing.GroundCompressionCompletion + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 times birth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "old" => completion.externalSeedBirth P0 r0 μ0 A0 times birth +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG + +theorem externalSeedBirth_spec (hP0 : P0 ∈ M.sets) (hTimes : times ∈ M.sets) (hBirth : birth ∈ M.sets) + (born : ZFSet.IsFunc (completion.algebra.union.fields 0) times birth) + (oldMeet : OldMeetCode (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) birth) : + old ∈ M.sets ∧ ZFSet.IsFunc P times old ∧ + OldMeetCode (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) old := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + exact ⟨M.pushedHeightGraph_mem pairing unions powers separation (completion.algebra.union.ground 0) + geometry.carrier_ground hTimes (geometry.copies_ground _ data.group.group_code.identity_mem) hBirth, + pushedHeightGraph_function embedding.injection born, + pushedBirthGraph_oldMeet completion.algebra.union.meet geometry.meet embedding.toMeetEmbeddingCode born oldMeet⟩ + +theorem externalSeedBirth_entry + (born : ZFSet.IsFunc (completion.algebra.union.fields 0) times birth) + {x y t : ZFSet.{u}} (copied : ZFSet.pair x y ∈ completion.externalIdentityCopyGraph P0 r0 μ0 A0) : + ZFSet.pair y t ∈ old ↔ ZFSet.pair x t ∈ birth := + pushedHeightGraph_entry + (data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG).injection born copied + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end + + +namespace PartitionPilot.Forcing +universe u +namespace GroundCompressionCompletion +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ : ZFSet.{u}} +variable (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) +noncomputable def externalBirthGraph (P r μ A oldTimes oldBirth limit stamps : ZFSet.{u}) : ZFSet.{u} := + ownerBirthGraph (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A) + limit (completion.externalSeedBirth P r μ A oldTimes oldBirth) + (completion.externalOwnerLevels P r μ A) stamps + +end GroundCompressionCompletion + +structure GroundExternalBirthData (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m one T τ P r μ A oldTimes oldBirth : ZFSet.{u}) + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) where + stamps : ZFSet.{u} + limit : ZFSet.{u} + stamps_ground : stamps ∈ M.sets + limit_ground : limit ∈ M.sets + times : CompressionStampCode oldTimes stamps limit + seed_function : ZFSet.IsFunc (completion.externalSeedCarrier P r μ A) oldTimes + (completion.externalSeedBirth P r μ A oldTimes oldBirth) + birth_ground : completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps ∈ M.sets + function : ZFSet.IsFunc (completion.externalPointCarrier P r μ A) limit + (completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps) + old_meet : OldMeetCode (completion.externalPointOrder P r μ A) (completion.externalPointMeet P r μ A) + (completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps) + preserves_seed : ∀ x y t, ZFSet.pair x y ∈ completion.externalIdentityCopyGraph P r μ A → + (ZFSet.pair y t ∈ completion.externalBirthGraph P r μ A oldTimes oldBirth limit stamps ↔ + ZFSet.pair x t ∈ oldBirth) + +namespace GroundExternalBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P r μ A oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalBirthData M initial I Sources Reps G m one T τ P r μ A oldTimes oldBirth completion) +noncomputable def birth : ZFSet.{u} := + completion.externalBirthGraph P r μ A oldTimes oldBirth data.limit data.stamps + +include data +theorem old_before {x a : ZFSet.{u}} + (entry : ZFSet.pair x a ∈ completion.externalSeedBirth P r μ A oldTimes oldBirth) (n : Nat) : + a ∈ compressionStamp oldTimes n := + compressionStamp_old_mem (Or.inl (ZFSet.pair_mem_prod.1 (data.seed_function.1 entry)).2) n + +theorem stamp_fiber (n : Nat) (x : ZFSet.{u}) : + ZFSet.pair x (compressionStamp oldTimes n) ∈ data.birth ↔ + x ∈ ownerFresh (completion.externalSeedCarrier P r μ A) (completion.externalPointCarrier P r μ A) ∧ + ZFSet.pair x (natSetCode n) ∈ completion.externalOwnerLevels P r μ A := by + apply ownerBirthGraph_stamp_fiber data.seed_function data.times.ownerStampCode + · intro y a k t entry stamp + rw [(data.times.entries k t).1 stamp] + exact data.old_before entry k + · exact (data.times.entries n _).2 rfl + +theorem no_limit_birth (x : ZFSet.{u}) : ZFSet.pair x data.limit ∉ data.birth := + fun entry => ZFSet.mem_irrefl data.limit (ZFSet.pair_mem_prod.1 (data.function.1 entry)).2 + +end GroundExternalBirthData + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "vcode" => completion.externalFamilyVertexCode group oldAction data.original + +noncomputable def externalBirthCopyVertex (k : Nat) (r : Index) : Option ((family).Child r) := by + classical + exact if h : ∃ i, ((family).request r).vertexSlot i = k % 3 then Classical.choose h else none + +theorem externalBirthCopyVertex_eq (k : Nat) (r : Index) (i : Option ((family).Child r)) + (slot : ((family).request r).vertexSlot i = k % 3) : + data.externalBirthCopyVertex group oldAction k r = i := by + classical + have existsSlot : ∃ j, ((family).request r).vertexSlot j = k % 3 := ⟨i, slot⟩ + simp only [externalBirthCopyVertex, dite_eq_left existsSlot] + exact ((family).request r).vertexSlot_injective ((Classical.choose_spec existsSlot).trans slot.symm) + +include data group oldAction pairing unions powers separation infinite hG + +theorem externalBirthCopy_witness (hP0 : P0 ∈ M.sets) (k : Nat) {x : ZFSet.{u}} + (level : ZFSet.pair x (natSetCode k) ∈ completion.externalOwnerLevels P0 r0 μ0 A0) : + letI := group.toGroup + ∃ w r, ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ completion.externalStarOwner P0 r0 μ0 A0 ∧ + x ∈ relationImage U B (completion.externalCopyGraph P0 r0 μ0 A0 + ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r)))) := by + let := group.toGroup + have owner := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + obtain ⟨_, v, n, j, hj, owned, _, slot, rank⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level + have selected := (pair_mem_leastSlotOwnerGraph_of_owner owner owned).1 slot + obtain ⟨w, r, i, a, eqV, eqJ, eqX⟩ := + data.externalTileSlotPoints_decode group oldAction pairing unions powers separation infinite hG selected.2.2.1 + have ji : j = ((family).request r).vertexSlot i := by + apply natSetCode_injective + exact eqJ.trans (completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i) + have chosen : data.externalBirthCopyVertex group oldAction k r = i := by + apply data.externalBirthCopyVertex_eq group oldAction + rw [← ji, rank, depthSlotIndex, Nat.add_mod] + simp only [Nat.mul_mod, Nat.mod_self, Nat.zero_mul, Nat.zero_mod, Nat.zero_add, Nat.mod_eq_of_lt hj] + refine ⟨w, r, eqV ▸ owned, ?_⟩ + rw [chosen, eqX, (family).flatVertex_copy] + have qc := data.externalPointPresentation_carrier group oldAction pairing unions powers separation infinite hG + rw [data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] + apply (mem_relationImage _ _ _ _).2 + exact ⟨qc ▸ (q).encode_mem _, SetMembers.raw a, SetMembers.raw_mem a, + ((SetMembers.presentation U).pair_mem_graph (q) _ a _).2 rfl⟩ + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "old" => completion.externalSeedBirth P0 r0 μ0 A0 oldTimes oldBirth +include data group oldAction pairing unions powers separation collection infinite hG hP0 + +theorem exists_externalBirths_of_seed (hOldTimes : oldTimes ∈ M.sets) + (ordinal : ordinalSetProperty oldTimes) (hOldBirth : oldBirth ∈ M.sets) + (born : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) + (oldMeet : OldMeetCode (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth) : + Nonempty (GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) := by + obtain ⟨stamps, hStamps, limit, hLimit, _, stampCode⟩ := + M.exists_groundCompressionStamps pairing unions separation collection infinite hOldTimes ordinal + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have seed := data.externalSeedBirth_spec group oldAction pairing unions powers separation infinite hG hP0 + hOldTimes hOldBirth born oldMeet + have levels := data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0 + have hP := data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0 + have subset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 + have times : oldTimes ⊆ limit := fun _ ht => stampCode.union.subset 0 (compressionStamp_old_mem (Or.inl ht) 0) + have oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t := by + intro x a n t entry stamp + rw [(stampCode.entries n t).1 stamp] + exact compressionStamp_old_mem (Or.inl (ZFSet.pair_mem_prod.1 (seed.2.1.1 entry)).2) n + refine ⟨{ + stamps := stamps + limit := limit + stamps_ground := hStamps + limit_ground := hLimit + times := stampCode + seed_function := seed.2.1 + birth_ground := M.ownerBirthGraph_mem pairing unions powers separation hP geometry.carrier_ground hLimit + seed.1 levels.1 hStamps (M.omega_mem separation infinite) + function := ownerBirthGraph_function seed.2.1 subset times levels.2 stampCode.function + old_meet := ?_ + preserves_seed := ?_ }⟩ + · apply ownerBirthGraph_oldMeet geometry.meet seed.2.1 subset times levels.2 stampCode.ownerStampCode seed.2.2 + · intro x hx y hy lower + exact data.externalSeedCarrier_lower group oldAction pairing unions powers separation infinite hG hx hy lower + · exact oldBefore + · intro x _ y _ n k first second lower + exact data.externalOwnerLevels_monotone group oldAction pairing unions powers separation infinite hG hP0 lower first second + · intro x y t copied + have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) + have hy : y ∈ P := (mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, copied⟩ + exact (ownerBirthGraph_old_iff hy).trans + (data.externalSeedBirth_entry group oldAction pairing unions powers separation infinite hG born copied) + +theorem exists_externalBirths {base originalBirth : ZFSet.{u}} + (births : GroundCompressionBirthData M initial I Sources Reps G m one T + completion.algebra.union base originalBirth) : + Nonempty (GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 births.limit births.birth completion) := + data.exists_externalBirths_of_seed group oldAction pairing unions powers separation collection infinite hG hP0 + births.limit_ground births.times.ordinal births.birth_ground births.function births.old_meet + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula SetRealization Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "U" => completion.algebra.union.fields 0 +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "requests" => externalRequestCarrier I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "owners" => completion.externalStarOwner P0 r0 μ0 A0 +local notation "depths" => M.externalStarDepth G letters requests m one +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +local notation "family" => completion.externalFamily group oldAction data.original +local notation "action" => completion.algebra.union.action.toOrderAction group completion.algebra.union.meet +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "q" => data.externalPointPresentation group oldAction pairing unions powers separation infinite hG +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +include data group oldAction pairing unions powers separation infinite hG + +theorem externalBirthCopy_level_slot (hP0 : P0 ∈ M.sets) : + letI := group.toGroup + ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (k : Nat) {x : ZFSet.{u}}, + ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ owners → + ZFSet.pair x (natSetCode k) ∈ levels → + ∃ n, ZFSet.pair ((vpres).encode (.inr (w, r))) (natSetCode n) ∈ depths ∧ + k = depthSlotIndex n (((family).request r).vertexSlot (data.externalBirthCopyVertex group oldAction k r)) := by + let := group.toGroup + intro w r k x active level + obtain ⟨_, v, n, j, hj, owned, depth, slot, rank⟩ := + (data.externalOwnerLevels_entry_iff group oldAction pairing unions powers separation infinite hG hP0 x k).1 level + have owner := (data.externalStarOwner_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have sameOwner := (show FunctionGraphOn B owners from ⟨_, owner⟩).unique owned active + subst v + have selected := (pair_mem_leastSlotOwnerGraph_of_owner owner active).1 slot + obtain ⟨w', r', i, _, eqV, eqJ, _⟩ := + data.externalTileSlotPoints_decode group oldAction pairing unions powers separation infinite hG selected.2.2.1 + have same := Sum.inr.inj ((vpres).injective eqV) + obtain ⟨rfl, rfl⟩ := Prod.mk.inj same + have ji : j = ((family).request r).vertexSlot i := + natSetCode_injective (eqJ.trans (completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i)) + have chosen : data.externalBirthCopyVertex group oldAction k r = i := by + apply data.externalBirthCopyVertex_eq group oldAction + rw [← ji, rank, depthSlotIndex, Nat.add_mod] + simp only [Nat.mul_mod, Nat.mod_self, Nat.zero_mul, Nat.zero_mod, Nat.zero_add, Nat.mod_eq_of_lt hj] + exact ⟨n, depth, by rw [chosen, ← ji]; exact rank⟩ + +theorem externalBirthCopy_level_bound (hP0 : P0 ∈ M.sets) : + letI := group.toGroup + ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (k : Nat) {x u y : ZFSet.{u}}, + ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ owners → + ZFSet.pair x (natSetCode k) ∈ levels → + ZFSet.pair u y ∈ completion.externalCopyGraph P0 r0 μ0 A0 + ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r))) → + y ∈ P ∨ ∃ l ≤ k, ZFSet.pair y (natSetCode l) ∈ levels := by + let := group.toGroup + intro w r k x u y active level copied + obtain ⟨n, depth, rank⟩ := data.externalBirthCopy_level_slot group oldAction pairing unions powers separation infinite hG hP0 + w r k active level + let i := data.externalBirthCopyVertex group oldAction k r + rw [data.externalCopyGraph_eq_graph group oldAction pairing unions powers separation infinite hG] at copied + obtain ⟨a, equal⟩ := ((SetMembers.presentation U).mem_graph (q) _ _).1 copied + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + have supported := (data.externalTileSlotPoints_entry group oldAction pairing unions powers separation infinite hG + w r i ((family).copy (action) ((family).flatWord w r i) |>.toFun a)).2 + ⟨a, (family).flatVertex_copy (action) w r i a⟩ + rw [completion.externalFamilyVertexCode_eq_slot group oldAction data.original r i] at supported + have bound := data.externalSlotCopy_old_or_level_bound group oldAction pairing unions powers separation infinite hG hP0 + supported depth + rw [← rank] at bound + exact bound + +theorem externalBirthCopy_image_level_bound (hP0 : P0 ∈ M.sets) : + letI := group.toGroup + ∀ (w : External (SetMembers G) (family).Letters) (r : Index) (k : Nat) {x y : ZFSet.{u}}, + ZFSet.pair x ((vpres).encode (.inr (w, r))) ∈ owners → + ZFSet.pair x (natSetCode k) ∈ levels → + y ∈ relationImage U B (completion.externalCopyGraph P0 r0 μ0 A0 + ((s).encode ((family).flatWord w r (data.externalBirthCopyVertex group oldAction k r)))) → + y ∈ P ∨ ∃ l ≤ k, ZFSet.pair y (natSetCode l) ∈ levels := by + let := group.toGroup + intro w r k x y active level image + obtain ⟨_, u, _, copied⟩ := (mem_relationImage _ _ _ _).1 image + exact data.externalBirthCopy_level_bound group oldAction pairing unions powers separation infinite hG hP0 + w r k active level copied + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetRealization SetFormula Compression Compression.RecursiveMaps.CosetGeometry +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth completion) +local notation "family" => completion.externalFamily group oldAction data.original +local notation "s" => completion.externalFamilyGroupPresentation group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground +local notation "vpres" => data.externalStarVertexPresentation group oldAction pairing unions powers separation infinite hG +local notation "Index" => ExternalRequestIndex I P0 (externalRectangles P0 G r0 μ0 A0) +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +local notation "owner" => completion.externalStarOwner P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG hP0 births + +noncomputable def externalBirth_fresh_layer + (Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}) + (atSpace : Space oldTimes = U) + (atOrder : sourceOrder oldTimes = completion.algebra.union.fields 1) + (atMeet : sourceMeet oldTimes = completion.algebra.union.fields 2) (k : Nat) : + CodedGrowthLayer M Space sourceOrder sourceMeet B (completion.externalPointOrder P0 r0 μ0 A0) + (completion.externalPointMeet P0 r0 μ0 A0) births.birth (compressionStamp oldTimes k) := by + classical + letI := group.toGroup + let Copies := External (SetMembers G) (family).Letters × Index + let e (v : Copies) := completion.externalCopyGraph P0 r0 μ0 A0 + ((s).encode ((family).flatWord v.1 v.2 (data.externalBirthCopyVertex group oldAction k v.2))) + let Slice := {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode k) ∈ levels} + have witnesses (x : Slice) : ∃ v : Copies, + ZFSet.pair x.val ((vpres).encode (.inr v)) ∈ owner ∧ x.val ∈ relationImage U B (e v) := by + obtain ⟨w, r, owned, covered⟩ := + data.externalBirthCopy_witness group oldAction pairing unions powers separation infinite hG hP0 k x.property.2 + exact ⟨(w, r), owned, covered⟩ + let pick (x : Slice) : Copies := Classical.choose (witnesses x) + have selected (x : Slice) : + ZFSet.pair x.val ((vpres).encode (.inr (pick x))) ∈ owner ∧ + x.val ∈ relationImage U B (e (pick x)) := Classical.choose_spec (witnesses x) + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have levelCode := (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).2 + have sc := completion.externalFamilyGroupPresentation_carrier group oldAction data.original + pairing unions powers separation infinite hG data.words.letters_ground + have oldSubset : P ⊆ B := fun _ hx => ((mem_relationImage _ _ _ _).1 hx).1 + have times : oldTimes ⊆ births.limit := fun _ ht => + births.times.union.subset 0 (compressionStamp_old_mem (Or.inl ht) 0) + have oldBefore : ∀ x a n t, ZFSet.pair x a ∈ completion.externalSeedBirth P0 r0 μ0 A0 oldTimes oldBirth → + ZFSet.pair (natSetCode n) t ∈ births.stamps → a ∈ t := by + intro x a n t entry stamp + rw [(births.times.entries n t).1 stamp] + exact births.old_before entry n + refine ownerBirthGraph_separated births.seed_function oldSubset times levelCode births.times.ownerStampCode + oldBefore ((births.times.entries k _).2 rfl) Copies (fun _ => oldTimes) e + (fun _ => compressionStamp_base_mem oldTimes k) ?_ ?_ pick ?_ ?_ + · intro v + exact geometry.copies_ground _ (sc ▸ (s).encode_mem _) + · intro v + rw [atSpace, atOrder, atMeet] + exact geometry.copies _ (sc ▸ (s).encode_mem _) + · intro x _ + rw [atSpace] + exact (selected x).2 + · intro x y _ _ different + have differentOwners : (vpres).encode (.inr (pick x)) ≠ (vpres).encode (.inr (pick y)) := by + intro equal + exact different (Sum.inr.inj ((vpres).injective equal)) + have hx := ((mem_ownerFresh P B x.val).1 x.property.1).1 + have hy := ((mem_ownerFresh P B y.val).1 y.property.1).1 + obtain ⟨z, meetEntry, _⟩ := geometry.meet.operation.2 (ZFSet.pair x.val y.val) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + refine ⟨z, (ZFSet.pair_mem_prod.1 (geometry.meet.operation.1 meetEntry)).2, meetEntry, ?_⟩ + exact data.externalOwnerLevels_meet_old_or_lower group oldAction pairing unions powers separation infinite hG hP0 + (selected x).1 (selected y).1 differentOwners x.property.2 y.property.2 meetEntry + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalSerializedChronology.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalSerializedChronology.lean index 28c23919b453d77444c1c5326a8c0f2e20f5303c..056bb86b9a10462399096055d9564133f7cc5f3e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalSerializedChronology.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundExternalSerializedChronology.lean @@ -1,404 +1,404 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologyWitnessSelection -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalLayerWitnessRanks -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixLimitLayerWitnesses -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalSerializedCore - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundSerializedChronology M T0 C D rD) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (hOld : oldTimes ∈ T0) - -local notation "fields" => births.serializedFields heights prior data group action - pairing unions powers separation infinite hG hP0 hOld -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld - -theorem serialized_old_raw_witness {s t : ZFSet.{u}} - (before : s ∈ oldTimes ∨ s = oldTimes) (earlier : t = s ∨ t ∈ s) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by - have baseOrdinal := ordinalSetProperty_member births.times.ordinal births.times.base_mem_limit - have hs : s ∈ T0 := before.elim (fun h => prior.ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) - have ht : t ∈ T0 := earlier.elim (fun h => h.symm ▸ hs) (fun h => prior.ordinal.1 s hs t h) - have oldTime : t ∈ oldTimes ∨ t = oldTimes := by - rcases earlier with rfl | h - · exact before - · exact Or.inl (before.elim (fun member => baseOrdinal.1 s member t h) (fun equal => equal ▸ h)) - have agree (j : Fin 5) (a : ZFSet.{u}) (ha : a ∈ t) (y : ZFSet.{u}) : - ZFSet.pair a y ∈ prior.fields.graph j ↔ ZFSet.pair a y ∈ (fields).graph j := by - have earlierBase : a ∈ oldTimes := oldTime.elim - (fun member => baseOrdinal.1 t member a ha) (fun equal => equal ▸ ha) - exact (births.serializedFields_old_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j (Or.inl earlierBase) y).symm - have code := (prior.layer_code s hs t ht earlier _ (prior.layerWitness_entry hs ht earlier)).congr_source_entries - (agree 0) (agree 1) (agree 2) - refine ⟨prior.layerWitness s t, prior.layerWitness_ground s t, ?_⟩ - rw [births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 before, - births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 before, - births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 before, - births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 before] - exact code - -variable (source : prior.fields.value 0 oldTimes = completion.algebra.union.fields 0 ∧ - prior.fields.value 1 oldTimes = completion.algebra.union.fields 1 ∧ - prior.fields.value 2 oldTimes = completion.algebra.union.fields 2 ∧ - prior.fields.value 3 oldTimes = oldBirth) -include source - -theorem serialized_base_entries : - ZFSet.pair oldTimes U ∈ (fields).graph 0 ∧ - ZFSet.pair oldTimes (completion.algebra.union.fields 1) ∈ (fields).graph 1 ∧ - ZFSet.pair oldTimes (completion.algebra.union.fields 2) ∈ (fields).graph 2 := by - have hs := ZFSet.mem_insert_of_mem births.limit births.times.base_mem_limit - have values (j : Fin 5) := births.serializedFields_old heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j (Or.inr rfl) - exact ⟨(values 0 |>.trans source.1) ▸ (fields).value_entry 0 hs, - (values 1 |>.trans source.2.1) ▸ (fields).value_entry 1 hs, - (values 2 |>.trans source.2.2.1) ▸ (fields).value_entry 2 hs⟩ - -theorem serialized_base_raw_witness (t : ZFSet.{u}) (oldTime : t ∈ oldTimes ∨ t = oldTimes) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t ZFSet.omega z := by - obtain ⟨z, hz, code⟩ := births.serialized_old_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld (Or.inr rfl) oldTime.symm - refine ⟨z, hz, ?_⟩ - have values (j : Fin 5) := births.serializedFields_old heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j (Or.inr rfl) - simpa only [values 0, values 1, values 2, values 3, source.1, source.2.1, source.2.2.1, source.2.2.2] using code - -theorem serialized_finite_raw_witness (n : Nat) (t : ZFSet.{u}) - (bound : t = compressionStamp oldTimes n ∨ t ∈ compressionStamp oldTimes n) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 (compressionStamp oldTimes n)) ((fields).value 1 (compressionStamp oldTimes n)) - ((fields).value 2 (compressionStamp oldTimes n)) ((fields).value 3 (compressionStamp oldTimes n)) t ZFSet.omega z := by - rw [births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 n, - births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 n, - births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 n, - births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 n] - change ∃ z ∈ M.sets, GrowthLayerWitnessCode _ _ _ (births.cutoff n) - (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t ZFSet.omega z - have sources := births.serialized_base_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source - have fresh (k : Nat) (before : k ≤ n) := births.cutoffLayerWitness_spec data group action - pairing unions powers separation infinite hG hP0 - ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k n before (N := ZFSet.omega) - have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - (births.cutoff n) (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) a ZFSet.omega z := by - obtain ⟨z, hz, code⟩ := births.serialized_base_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source a oldTime - exact births.rawCutoffPriorWitness data group action pairing unions powers separation infinite hG hP0 - ((fields).graph_ground 0) (M.omega_mem separation infinite) hz code oldTime n - rcases bound with rfl | before - · exact ⟨_, (fresh n (Nat.le_refl n)).1, (fresh n (Nat.le_refl n)).2⟩ - · rcases (mem_compressionStamp_iff oldTimes t n).1 before with old | same | ⟨k, earlier, rfl⟩ - · exact original t (Or.inl old) - · exact original t (Or.inr same) - · exact ⟨_, (fresh k (Nat.le_of_lt earlier)).1, (fresh k (Nat.le_of_lt earlier)).2⟩ - -theorem serialized_limit_raw_witness (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 births.limit) ((fields).value 1 births.limit) - ((fields).value 2 births.limit) ((fields).value 3 births.limit) t ZFSet.omega z := by - rw [births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0, - births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1, - births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2, - births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3] - change ∃ z ∈ M.sets, GrowthLayerWitnessCode _ _ _ B - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth t ZFSet.omega z - have sources := births.serialized_base_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source - have fresh (k : Nat) := births.layerWitness_spec data group action - pairing unions powers separation infinite hG hP0 - ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k (N := ZFSet.omega) - have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : - ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - B (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth a ZFSet.omega z := by - obtain ⟨z, hz, code⟩ := births.serialized_base_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source a oldTime - exact births.rawPriorWitness data group action pairing unions powers separation infinite hG hP0 - ((fields).graph_ground 0) (M.omega_mem separation infinite) hz code oldTime - rcases bound with rfl | before - · have hEmpty := M.empty_mem ⟨births.limit, births.limit_ground⟩ - refine ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, - Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty ZFSet.omega, ?_⟩⟩⟩ - intro x _ born - exact (births.no_limit_birth x born).elim - · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨k, rfl⟩ - · exact original t (Or.inl old) - · exact original t (Or.inr same) - · exact ⟨_, (fresh k).1, (fresh k).2⟩ - -theorem serialized_all_raw_witnesses : - ∀ s ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, - t = s ∨ t ∈ s → ∃ z ∈ M.sets, - GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by - intro s hs t _ bound - rcases ZFSet.mem_insert_iff.1 hs with rfl | before - · exact births.serialized_limit_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source t bound - · rcases (births.times.mem_limit_iff s).1 before with old | same | ⟨n, rfl⟩ - · exact births.serialized_old_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld (Or.inl old) bound - · exact births.serialized_old_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld (Or.inr same) bound - · exact births.serialized_finite_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source n t bound - -end PartitionPilot.Forcing.GroundExternalBirthData - - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundSerializedChronology M T0 C D rD) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (hOld : oldTimes ∈ T0) -local notation "fields" => births.serializedFields heights prior data group action - pairing unions powers separation infinite hG hP0 hOld -local notation "U" => completion.algebra.union.fields 0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld - -theorem ranked_prior_source_entries {t : ZFSet.{u}} - (oldTime : t ∈ oldTimes ∨ t = oldTimes) (j : Fin 5) : - ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ prior.fields.graph j ↔ ZFSet.pair a y ∈ (fields).graph j := by - intro a ha y - have baseOrdinal := ordinalSetProperty_member births.times.ordinal births.times.base_mem_limit - have earlier : a ∈ oldTimes := oldTime.elim - (fun member => baseOrdinal.1 t member a ha) (fun equal => equal ▸ ha) - exact (births.serializedFields_old_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j (Or.inl earlier) y).symm - -variable {o : Ordinal.{u}} (priorRank : ZFSet.rank prior.code < o) -include priorRank - -theorem serialized_old_ranked_raw_witness {s t : ZFSet.{u}} - (before : s ∈ oldTimes ∨ s = oldTimes) (earlier : t = s ∨ t ∈ s) : - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ - GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by - have baseOrdinal := ordinalSetProperty_member births.times.ordinal births.times.base_mem_limit - have hs : s ∈ T0 := before.elim (fun h => prior.ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) - have ht : t ∈ T0 := earlier.elim (fun h => h.symm ▸ hs) (fun h => prior.ordinal.1 s hs t h) - have oldTime : t ∈ oldTimes ∨ t = oldTimes := by - rcases earlier with rfl | h - · exact before - · exact Or.inl (before.elim (fun member => baseOrdinal.1 s member t h) (fun equal => equal ▸ h)) - have agree (j : Fin 5) := births.ranked_prior_source_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld oldTime j - have code := (prior.layer_code s hs t ht earlier _ (prior.layerWitness_entry hs ht earlier)).congr_source_entries - (agree 0) (agree 1) (agree 2) - refine ⟨prior.layerWitness s t, prior.layerWitness_ground s t, - (prior.layerWitness_rank_lt_code hs ht earlier).trans priorRank, ?_⟩ - rw [births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 before, - births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 before, - births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 before, - births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 before] - exact code - -variable (source : prior.fields.value 0 oldTimes = completion.algebra.union.fields 0 ∧ - prior.fields.value 1 oldTimes = completion.algebra.union.fields 1 ∧ - prior.fields.value 2 oldTimes = completion.algebra.union.fields 2 ∧ - prior.fields.value 3 oldTimes = oldBirth) -include source - -omit births heights data group action pairing unions powers separation infinite hG hP0 in -theorem serialized_terminal_prior_ranked_witness (t : ZFSet.{u}) - (oldTime : t ∈ oldTimes ∨ t = oldTimes) : - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ - GrowthLayerWitnessCode (prior.fields.graph 0) (prior.fields.graph 1) (prior.fields.graph 2) - U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t ZFSet.omega z := by - have ht : t ∈ T0 := oldTime.elim - (fun h => prior.ordinal.1 oldTimes hOld t h) (fun h => h.symm ▸ hOld) - have code := prior.layer_code oldTimes hOld t ht oldTime.symm _ - (prior.layerWitness_entry hOld ht oldTime.symm) - refine ⟨prior.layerWitness oldTimes t, prior.layerWitness_ground oldTimes t, - (prior.layerWitness_rank_lt_code hOld ht oldTime.symm).trans priorRank, ?_⟩ - simpa only [source.1, source.2.1, source.2.2.1, source.2.2.2] using code - -theorem serialized_all_ranked_raw_witnesses (limit : Order.IsSuccLimit o) - (omega : ZFSet.rank ZFSet.omega < o) (indices : ZFSet.rank I < o) - (points : ZFSet.rank P0 < o) (actors : ZFSet.rank G < o) : - ∀ s ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, - t = s ∨ t ∈ s → ∃ z ∈ M.sets, ZFSet.rank z < o ∧ - GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by - have completed : ZFSet.rank U < o := by - rw [← source.1] - exact (prior.fieldValue_rank_lt_code 0 hOld).trans priorRank - have time : ZFSet.rank oldTimes < o := - ((ZFSet.rank_lt_of_mem hOld).trans_le prior.time_rank_le_code).trans priorRank - have carrier := completion.externalPointCarrier_rank_lt_of_inputs limit r0 μ0 A0 - omega indices points actors completed - have sources := births.serialized_base_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source - have old (s t : ZFSet.{u}) (before : s ∈ oldTimes ∨ s = oldTimes) (earlier : t = s ∨ t ∈ s) := - births.serialized_old_ranked_raw_witness heights prior data group action - pairing unions powers separation infinite hG hP0 hOld priorRank before earlier - have base (t : ZFSet.{u}) (oldTime : t ∈ oldTimes ∨ t = oldTimes) := - serialized_terminal_prior_ranked_witness prior hOld priorRank source t oldTime - have finite (n : Nat) (t : ZFSet.{u}) (bound : t = compressionStamp oldTimes n ∨ t ∈ compressionStamp oldTimes n) : - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode - ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 (compressionStamp oldTimes n)) ((fields).value 1 (compressionStamp oldTimes n)) - ((fields).value 2 (compressionStamp oldTimes n)) ((fields).value 3 (compressionStamp oldTimes n)) t ZFSet.omega z := by - rw [births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 n, - births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 n, - births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 n, - births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 n] - change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode _ _ _ (births.cutoff n) - (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t ZFSet.omega z - have fresh (k : Nat) (before : k ≤ n) := births.ranked_cutoffLayerWitness_spec data group action - pairing unions powers separation infinite hG hP0 limit omega indices points actors completed time - ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k n before (N := ZFSet.omega) - have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - (births.cutoff n) (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) a ZFSet.omega z := by - obtain ⟨z, hz, rank, code⟩ := base a oldTime - obtain ⟨z', hz', rank', code'⟩ := births.ranked_rawCutoffPriorWitness data group action - pairing unions powers separation infinite hG hP0 (prior.fields.graph_ground 0) - (M.omega_mem separation infinite) hz code oldTime n limit rank - ((prior.fieldGraph_rank_le_code 0).trans_lt priorRank) carrier omega - have agree (j : Fin 5) := births.ranked_prior_source_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld oldTime j - exact ⟨z', hz', rank', code'.congr_source_entries (agree 0) (agree 1) (agree 2)⟩ - rcases bound with rfl | before - · exact ⟨_, fresh n (Nat.le_refl n)⟩ - · rcases (mem_compressionStamp_iff oldTimes t n).1 before with h | h | ⟨k, earlier, rfl⟩ - · exact original t (Or.inl h) - · exact original t (Or.inr h) - · exact ⟨_, fresh k (Nat.le_of_lt earlier)⟩ - have terminal (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode - ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - ((fields).value 0 births.limit) ((fields).value 1 births.limit) - ((fields).value 2 births.limit) ((fields).value 3 births.limit) t ZFSet.omega z := by - rw [births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0, - births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1, - births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2, - births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3] - change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode _ _ _ B - (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth t ZFSet.omega z - have fresh (k : Nat) := births.ranked_layerWitness_spec data group action - pairing unions powers separation infinite hG hP0 limit omega indices points actors completed time - ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k (N := ZFSet.omega) - have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) - B (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth a ZFSet.omega z := by - obtain ⟨z, hz, rank, code⟩ := base a oldTime - obtain ⟨z', hz', rank', code'⟩ := births.ranked_rawPriorWitness data group action - pairing unions powers separation infinite hG hP0 (prior.fields.graph_ground 0) - (M.omega_mem separation infinite) hz code oldTime limit rank - ((prior.fieldGraph_rank_le_code 0).trans_lt priorRank) carrier omega - have agree (j : Fin 5) := births.ranked_prior_source_entries heights prior data group action - pairing unions powers separation infinite hG hP0 hOld oldTime j - exact ⟨z', hz', rank', code'.congr_source_entries (agree 0) (agree 1) (agree 2)⟩ - rcases bound with rfl | before - · have hEmpty := M.empty_mem ⟨births.limit, births.limit_ground⟩ - have emptyRank : ZFSet.rank (∅ : ZFSet.{u}) < o := by simpa only [ZFSet.rank_empty] using limit.pos - refine ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, - countableLayerWitness_rank_lt limit emptyRank emptyRank, - Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty ZFSet.omega, ?_⟩⟩⟩ - intro x _ born - exact (births.no_limit_birth x born).elim - · rcases (births.times.mem_limit_iff t).1 before with h | h | ⟨k, rfl⟩ - · exact original t (Or.inl h) - · exact original t (Or.inr h) - · exact ⟨_, fresh k⟩ - intro s hs t _ bound - rcases ZFSet.mem_insert_iff.1 hs with rfl | before - · exact terminal t bound - · rcases (births.times.mem_limit_iff s).1 before with h | h | ⟨n, rfl⟩ - · exact old s t (Or.inl h) bound - · exact old s t (Or.inr h) bound - · exact finite n t bound - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundSerializedChronology M T0 C D rD) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (hOld : oldTimes ∈ T0) - -variable (source : prior.fields.value 0 oldTimes = completion.algebra.union.fields 0 ∧ - prior.fields.value 1 oldTimes = completion.algebra.union.fields 1 ∧ - prior.fields.value 2 oldTimes = completion.algebra.union.fields 2 ∧ - prior.fields.value 3 oldTimes = oldBirth) -variable (collection : CollectionSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "fields" => births.serializedFields heights prior data group action - pairing unions powers separation infinite hG hP0 hOld -include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld source collection choice - -theorem exists_externalSerializedChronology : - ∃ serial : GroundSerializedChronology M (insert births.limit births.limit) C D rD, - serial.fields = fields ∧ serial.code ∈ M.sets ∧ - ∀ j s, s ∈ insert births.limit births.limit → - serial.fields.value j s = (births.chronologyFields heights prior.toHistory).fieldValue j s := by - obtain ⟨serial, same, ground⟩ := (fields).exists_serializedChronology - pairing unions powers separation collection choice infinite - (births.serializedFields_core heights prior data group action - pairing unions powers separation infinite hG hP0 hOld) - (births.serialized_all_raw_witnesses heights prior data group action - pairing unions powers separation infinite hG hP0 hOld source) - (ordinalSetProperty_succ births.times.ordinal) - refine ⟨serial, same, ground, ?_⟩ - intro j s hs - rw [same] - exact births.serializedFields_value heights prior data group action - pairing unions powers separation infinite hG hP0 hOld j hs - -end PartitionPilot.Forcing.GroundExternalBirthData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologyWitnessSelection +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundExternalLayerWitnessRanks +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixLimitLayerWitnesses +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalSerializedCore + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundSerializedChronology M T0 C D rD) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (hOld : oldTimes ∈ T0) + +local notation "fields" => births.serializedFields heights prior data group action + pairing unions powers separation infinite hG hP0 hOld +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld + +theorem serialized_old_raw_witness {s t : ZFSet.{u}} + (before : s ∈ oldTimes ∨ s = oldTimes) (earlier : t = s ∨ t ∈ s) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by + have baseOrdinal := ordinalSetProperty_member births.times.ordinal births.times.base_mem_limit + have hs : s ∈ T0 := before.elim (fun h => prior.ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) + have ht : t ∈ T0 := earlier.elim (fun h => h.symm ▸ hs) (fun h => prior.ordinal.1 s hs t h) + have oldTime : t ∈ oldTimes ∨ t = oldTimes := by + rcases earlier with rfl | h + · exact before + · exact Or.inl (before.elim (fun member => baseOrdinal.1 s member t h) (fun equal => equal ▸ h)) + have agree (j : Fin 5) (a : ZFSet.{u}) (ha : a ∈ t) (y : ZFSet.{u}) : + ZFSet.pair a y ∈ prior.fields.graph j ↔ ZFSet.pair a y ∈ (fields).graph j := by + have earlierBase : a ∈ oldTimes := oldTime.elim + (fun member => baseOrdinal.1 t member a ha) (fun equal => equal ▸ ha) + exact (births.serializedFields_old_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j (Or.inl earlierBase) y).symm + have code := (prior.layer_code s hs t ht earlier _ (prior.layerWitness_entry hs ht earlier)).congr_source_entries + (agree 0) (agree 1) (agree 2) + refine ⟨prior.layerWitness s t, prior.layerWitness_ground s t, ?_⟩ + rw [births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 before, + births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 before, + births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 before, + births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 before] + exact code + +variable (source : prior.fields.value 0 oldTimes = completion.algebra.union.fields 0 ∧ + prior.fields.value 1 oldTimes = completion.algebra.union.fields 1 ∧ + prior.fields.value 2 oldTimes = completion.algebra.union.fields 2 ∧ + prior.fields.value 3 oldTimes = oldBirth) +include source + +theorem serialized_base_entries : + ZFSet.pair oldTimes U ∈ (fields).graph 0 ∧ + ZFSet.pair oldTimes (completion.algebra.union.fields 1) ∈ (fields).graph 1 ∧ + ZFSet.pair oldTimes (completion.algebra.union.fields 2) ∈ (fields).graph 2 := by + have hs := ZFSet.mem_insert_of_mem births.limit births.times.base_mem_limit + have values (j : Fin 5) := births.serializedFields_old heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j (Or.inr rfl) + exact ⟨(values 0 |>.trans source.1) ▸ (fields).value_entry 0 hs, + (values 1 |>.trans source.2.1) ▸ (fields).value_entry 1 hs, + (values 2 |>.trans source.2.2.1) ▸ (fields).value_entry 2 hs⟩ + +theorem serialized_base_raw_witness (t : ZFSet.{u}) (oldTime : t ∈ oldTimes ∨ t = oldTimes) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t ZFSet.omega z := by + obtain ⟨z, hz, code⟩ := births.serialized_old_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld (Or.inr rfl) oldTime.symm + refine ⟨z, hz, ?_⟩ + have values (j : Fin 5) := births.serializedFields_old heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j (Or.inr rfl) + simpa only [values 0, values 1, values 2, values 3, source.1, source.2.1, source.2.2.1, source.2.2.2] using code + +theorem serialized_finite_raw_witness (n : Nat) (t : ZFSet.{u}) + (bound : t = compressionStamp oldTimes n ∨ t ∈ compressionStamp oldTimes n) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 (compressionStamp oldTimes n)) ((fields).value 1 (compressionStamp oldTimes n)) + ((fields).value 2 (compressionStamp oldTimes n)) ((fields).value 3 (compressionStamp oldTimes n)) t ZFSet.omega z := by + rw [births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 n, + births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 n, + births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 n, + births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 n] + change ∃ z ∈ M.sets, GrowthLayerWitnessCode _ _ _ (births.cutoff n) + (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t ZFSet.omega z + have sources := births.serialized_base_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source + have fresh (k : Nat) (before : k ≤ n) := births.cutoffLayerWitness_spec data group action + pairing unions powers separation infinite hG hP0 + ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k n before (N := ZFSet.omega) + have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + (births.cutoff n) (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) a ZFSet.omega z := by + obtain ⟨z, hz, code⟩ := births.serialized_base_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source a oldTime + exact births.rawCutoffPriorWitness data group action pairing unions powers separation infinite hG hP0 + ((fields).graph_ground 0) (M.omega_mem separation infinite) hz code oldTime n + rcases bound with rfl | before + · exact ⟨_, (fresh n (Nat.le_refl n)).1, (fresh n (Nat.le_refl n)).2⟩ + · rcases (mem_compressionStamp_iff oldTimes t n).1 before with old | same | ⟨k, earlier, rfl⟩ + · exact original t (Or.inl old) + · exact original t (Or.inr same) + · exact ⟨_, (fresh k (Nat.le_of_lt earlier)).1, (fresh k (Nat.le_of_lt earlier)).2⟩ + +theorem serialized_limit_raw_witness (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 births.limit) ((fields).value 1 births.limit) + ((fields).value 2 births.limit) ((fields).value 3 births.limit) t ZFSet.omega z := by + rw [births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0, + births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1, + births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2, + births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3] + change ∃ z ∈ M.sets, GrowthLayerWitnessCode _ _ _ B + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth t ZFSet.omega z + have sources := births.serialized_base_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source + have fresh (k : Nat) := births.layerWitness_spec data group action + pairing unions powers separation infinite hG hP0 + ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k (N := ZFSet.omega) + have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : + ∃ z ∈ M.sets, GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + B (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth a ZFSet.omega z := by + obtain ⟨z, hz, code⟩ := births.serialized_base_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source a oldTime + exact births.rawPriorWitness data group action pairing unions powers separation infinite hG hP0 + ((fields).graph_ground 0) (M.omega_mem separation infinite) hz code oldTime + rcases bound with rfl | before + · have hEmpty := M.empty_mem ⟨births.limit, births.limit_ground⟩ + refine ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, + Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty ZFSet.omega, ?_⟩⟩⟩ + intro x _ born + exact (births.no_limit_birth x born).elim + · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨k, rfl⟩ + · exact original t (Or.inl old) + · exact original t (Or.inr same) + · exact ⟨_, (fresh k).1, (fresh k).2⟩ + +theorem serialized_all_raw_witnesses : + ∀ s ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, + t = s ∨ t ∈ s → ∃ z ∈ M.sets, + GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by + intro s hs t _ bound + rcases ZFSet.mem_insert_iff.1 hs with rfl | before + · exact births.serialized_limit_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source t bound + · rcases (births.times.mem_limit_iff s).1 before with old | same | ⟨n, rfl⟩ + · exact births.serialized_old_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld (Or.inl old) bound + · exact births.serialized_old_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld (Or.inr same) bound + · exact births.serialized_finite_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source n t bound + +end PartitionPilot.Forcing.GroundExternalBirthData + + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundSerializedChronology M T0 C D rD) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (hOld : oldTimes ∈ T0) +local notation "fields" => births.serializedFields heights prior data group action + pairing unions powers separation infinite hG hP0 hOld +local notation "U" => completion.algebra.union.fields 0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld + +theorem ranked_prior_source_entries {t : ZFSet.{u}} + (oldTime : t ∈ oldTimes ∨ t = oldTimes) (j : Fin 5) : + ∀ a ∈ t, ∀ y, ZFSet.pair a y ∈ prior.fields.graph j ↔ ZFSet.pair a y ∈ (fields).graph j := by + intro a ha y + have baseOrdinal := ordinalSetProperty_member births.times.ordinal births.times.base_mem_limit + have earlier : a ∈ oldTimes := oldTime.elim + (fun member => baseOrdinal.1 t member a ha) (fun equal => equal ▸ ha) + exact (births.serializedFields_old_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j (Or.inl earlier) y).symm + +variable {o : Ordinal.{u}} (priorRank : ZFSet.rank prior.code < o) +include priorRank + +theorem serialized_old_ranked_raw_witness {s t : ZFSet.{u}} + (before : s ∈ oldTimes ∨ s = oldTimes) (earlier : t = s ∨ t ∈ s) : + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ + GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by + have baseOrdinal := ordinalSetProperty_member births.times.ordinal births.times.base_mem_limit + have hs : s ∈ T0 := before.elim (fun h => prior.ordinal.1 oldTimes hOld s h) (fun h => h.symm ▸ hOld) + have ht : t ∈ T0 := earlier.elim (fun h => h.symm ▸ hs) (fun h => prior.ordinal.1 s hs t h) + have oldTime : t ∈ oldTimes ∨ t = oldTimes := by + rcases earlier with rfl | h + · exact before + · exact Or.inl (before.elim (fun member => baseOrdinal.1 s member t h) (fun equal => equal ▸ h)) + have agree (j : Fin 5) := births.ranked_prior_source_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld oldTime j + have code := (prior.layer_code s hs t ht earlier _ (prior.layerWitness_entry hs ht earlier)).congr_source_entries + (agree 0) (agree 1) (agree 2) + refine ⟨prior.layerWitness s t, prior.layerWitness_ground s t, + (prior.layerWitness_rank_lt_code hs ht earlier).trans priorRank, ?_⟩ + rw [births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 before, + births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 before, + births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 before, + births.serializedFields_old heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 before] + exact code + +variable (source : prior.fields.value 0 oldTimes = completion.algebra.union.fields 0 ∧ + prior.fields.value 1 oldTimes = completion.algebra.union.fields 1 ∧ + prior.fields.value 2 oldTimes = completion.algebra.union.fields 2 ∧ + prior.fields.value 3 oldTimes = oldBirth) +include source + +omit births heights data group action pairing unions powers separation infinite hG hP0 in +theorem serialized_terminal_prior_ranked_witness (t : ZFSet.{u}) + (oldTime : t ∈ oldTimes ∨ t = oldTimes) : + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ + GrowthLayerWitnessCode (prior.fields.graph 0) (prior.fields.graph 1) (prior.fields.graph 2) + U (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t ZFSet.omega z := by + have ht : t ∈ T0 := oldTime.elim + (fun h => prior.ordinal.1 oldTimes hOld t h) (fun h => h.symm ▸ hOld) + have code := prior.layer_code oldTimes hOld t ht oldTime.symm _ + (prior.layerWitness_entry hOld ht oldTime.symm) + refine ⟨prior.layerWitness oldTimes t, prior.layerWitness_ground oldTimes t, + (prior.layerWitness_rank_lt_code hOld ht oldTime.symm).trans priorRank, ?_⟩ + simpa only [source.1, source.2.1, source.2.2.1, source.2.2.2] using code + +theorem serialized_all_ranked_raw_witnesses (limit : Order.IsSuccLimit o) + (omega : ZFSet.rank ZFSet.omega < o) (indices : ZFSet.rank I < o) + (points : ZFSet.rank P0 < o) (actors : ZFSet.rank G < o) : + ∀ s ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, + t = s ∨ t ∈ s → ∃ z ∈ M.sets, ZFSet.rank z < o ∧ + GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 s) ((fields).value 1 s) ((fields).value 2 s) ((fields).value 3 s) t ZFSet.omega z := by + have completed : ZFSet.rank U < o := by + rw [← source.1] + exact (prior.fieldValue_rank_lt_code 0 hOld).trans priorRank + have time : ZFSet.rank oldTimes < o := + ((ZFSet.rank_lt_of_mem hOld).trans_le prior.time_rank_le_code).trans priorRank + have carrier := completion.externalPointCarrier_rank_lt_of_inputs limit r0 μ0 A0 + omega indices points actors completed + have sources := births.serialized_base_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source + have old (s t : ZFSet.{u}) (before : s ∈ oldTimes ∨ s = oldTimes) (earlier : t = s ∨ t ∈ s) := + births.serialized_old_ranked_raw_witness heights prior data group action + pairing unions powers separation infinite hG hP0 hOld priorRank before earlier + have base (t : ZFSet.{u}) (oldTime : t ∈ oldTimes ∨ t = oldTimes) := + serialized_terminal_prior_ranked_witness prior hOld priorRank source t oldTime + have finite (n : Nat) (t : ZFSet.{u}) (bound : t = compressionStamp oldTimes n ∨ t ∈ compressionStamp oldTimes n) : + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode + ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 (compressionStamp oldTimes n)) ((fields).value 1 (compressionStamp oldTimes n)) + ((fields).value 2 (compressionStamp oldTimes n)) ((fields).value 3 (compressionStamp oldTimes n)) t ZFSet.omega z := by + rw [births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0 n, + births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1 n, + births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2 n, + births.serializedFields_stamp heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3 n] + change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode _ _ _ (births.cutoff n) + (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t ZFSet.omega z + have fresh (k : Nat) (before : k ≤ n) := births.ranked_cutoffLayerWitness_spec data group action + pairing unions powers separation infinite hG hP0 limit omega indices points actors completed time + ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k n before (N := ZFSet.omega) + have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + (births.cutoff n) (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) a ZFSet.omega z := by + obtain ⟨z, hz, rank, code⟩ := base a oldTime + obtain ⟨z', hz', rank', code'⟩ := births.ranked_rawCutoffPriorWitness data group action + pairing unions powers separation infinite hG hP0 (prior.fields.graph_ground 0) + (M.omega_mem separation infinite) hz code oldTime n limit rank + ((prior.fieldGraph_rank_le_code 0).trans_lt priorRank) carrier omega + have agree (j : Fin 5) := births.ranked_prior_source_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld oldTime j + exact ⟨z', hz', rank', code'.congr_source_entries (agree 0) (agree 1) (agree 2)⟩ + rcases bound with rfl | before + · exact ⟨_, fresh n (Nat.le_refl n)⟩ + · rcases (mem_compressionStamp_iff oldTimes t n).1 before with h | h | ⟨k, earlier, rfl⟩ + · exact original t (Or.inl h) + · exact original t (Or.inr h) + · exact ⟨_, fresh k (Nat.le_of_lt earlier)⟩ + have terminal (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode + ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + ((fields).value 0 births.limit) ((fields).value 1 births.limit) + ((fields).value 2 births.limit) ((fields).value 3 births.limit) t ZFSet.omega z := by + rw [births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 0, + births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 1, + births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 2, + births.serializedFields_limit heights prior data group action pairing unions powers separation infinite hG hP0 hOld 3] + change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode _ _ _ B + (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth t ZFSet.omega z + have fresh (k : Nat) := births.ranked_layerWitness_spec data group action + pairing unions powers separation infinite hG hP0 limit omega indices points actors completed time + ⟨_, (fields).function 0⟩ ⟨_, (fields).function 1⟩ ⟨_, (fields).function 2⟩ sources k (N := ZFSet.omega) + have original (a : ZFSet.{u}) (oldTime : a ∈ oldTimes ∨ a = oldTimes) : + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode ((fields).graph 0) ((fields).graph 1) ((fields).graph 2) + B (completion.externalPointOrder P0 r0 μ0 A0) (completion.externalPointMeet P0 r0 μ0 A0) births.birth a ZFSet.omega z := by + obtain ⟨z, hz, rank, code⟩ := base a oldTime + obtain ⟨z', hz', rank', code'⟩ := births.ranked_rawPriorWitness data group action + pairing unions powers separation infinite hG hP0 (prior.fields.graph_ground 0) + (M.omega_mem separation infinite) hz code oldTime limit rank + ((prior.fieldGraph_rank_le_code 0).trans_lt priorRank) carrier omega + have agree (j : Fin 5) := births.ranked_prior_source_entries heights prior data group action + pairing unions powers separation infinite hG hP0 hOld oldTime j + exact ⟨z', hz', rank', code'.congr_source_entries (agree 0) (agree 1) (agree 2)⟩ + rcases bound with rfl | before + · have hEmpty := M.empty_mem ⟨births.limit, births.limit_ground⟩ + have emptyRank : ZFSet.rank (∅ : ZFSet.{u}) < o := by simpa only [ZFSet.rank_empty] using limit.pos + refine ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, + countableLayerWitness_rank_lt limit emptyRank emptyRank, + Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty ZFSet.omega, ?_⟩⟩⟩ + intro x _ born + exact (births.no_limit_birth x born).elim + · rcases (births.times.mem_limit_iff t).1 before with h | h | ⟨k, rfl⟩ + · exact original t (Or.inl h) + · exact original t (Or.inr h) + · exact ⟨_, fresh k⟩ + intro s hs t _ bound + rcases ZFSet.mem_insert_iff.1 hs with rfl | before + · exact terminal t bound + · rcases (births.times.mem_limit_iff s).1 before with h | h | ⟨n, rfl⟩ + · exact old s t (Or.inl h) bound + · exact old s t (Or.inr h) bound + · exact finite n t bound + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundSerializedChronology M T0 C D rD) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (hOld : oldTimes ∈ T0) + +variable (source : prior.fields.value 0 oldTimes = completion.algebra.union.fields 0 ∧ + prior.fields.value 1 oldTimes = completion.algebra.union.fields 1 ∧ + prior.fields.value 2 oldTimes = completion.algebra.union.fields 2 ∧ + prior.fields.value 3 oldTimes = oldBirth) +variable (collection : CollectionSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "fields" => births.serializedFields heights prior data group action + pairing unions powers separation infinite hG hP0 hOld +include births heights prior data group action pairing unions powers separation infinite hG hP0 hOld source collection choice + +theorem exists_externalSerializedChronology : + ∃ serial : GroundSerializedChronology M (insert births.limit births.limit) C D rD, + serial.fields = fields ∧ serial.code ∈ M.sets ∧ + ∀ j s, s ∈ insert births.limit births.limit → + serial.fields.value j s = (births.chronologyFields heights prior.toHistory).fieldValue j s := by + obtain ⟨serial, same, ground⟩ := (fields).exists_serializedChronology + pairing unions powers separation collection choice infinite + (births.serializedFields_core heights prior data group action + pairing unions powers separation infinite hG hP0 hOld) + (births.serialized_all_raw_witnesses heights prior data group action + pairing unions powers separation infinite hG hP0 hOld source) + (ordinalSetProperty_succ births.times.ordinal) + refine ⟨serial, same, ground, ?_⟩ + intro j s hs + rw [same] + exact births.serializedFields_value heights prior data group action + pairing unions powers separation infinite hG hP0 hOld j hs + +end PartitionPilot.Forcing.GroundExternalBirthData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFairPreparationLimitCertificates.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFairPreparationLimitCertificates.lean index 9b44cd02e30ff830e12a012b6eece1625b9da08c..a354a6274d4b65843a390c85e66e23d3edfcbf32 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFairPreparationLimitCertificates.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFairPreparationLimitCertificates.lean @@ -1,299 +1,299 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFairPreparationOrbits - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v - -def FairPreparationLowerBoundResult (M : TransitiveGround.{u}) - {R : Type u} [PartialOrder R] (c : Presentation R) - (T stages packed nodes p : ZFSet.{u}) : Prop := - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.varyingPreparationRelation stages packed upperQ upperOrder nodes T - let B := M.groundSmallSubsets - (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega - let shape := M.refinementHistoryForcing_shape c.carrier T stages packed - let data := flatCarrierData c upperQ B shape - ∃ enumSelector ∈ M.sets, - ZFSet.IsFunc upperQ (M.groundRelations ZFSet.omega stages) enumSelector ∧ - enumSelector ⊆ M.birthLevelEnumerationRelation upperQ stages - (refinementDataHistoryLevels stages packed T) ∧ - ∃ E0 ∈ M.sets, ZFSet.IsFunc upperQ E0 enumSelector ∧ - ∃ prepSelector ∈ M.sets, - ZFSet.IsFunc (ZFSet.prod stages upperQ) - (M.preparationWitnessBound nodes T upperQ) prepSelector ∧ - prepSelector ⊆ relation ∧ - ∃ seq : Nat → SetMembers upperQ, SetMembers.raw (seq 0) = p ∧ - groundSequenceGraph seq ∈ M.sets ∧ - (∀ i j : Nat, i ≤ j → ZFSet.pair (SetMembers.raw (seq j)) (SetMembers.raw (seq i)) ∈ upperOrder) ∧ - ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ - ∃ clocks births events : Nat → ZFSet.{u}, - clocks 0 = ∅ ∧ births 0 = {ZFSet.pair ∅ e} ∧ events 0 = ∅ ∧ - (∀ k, FairPreparationStepCode ZFSet.omega E0 stages - (M.preparationWitnessBound nodes T upperQ) enumSelector prepSelector - (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) - (ZFSet.pair (clocks k) (ZFSet.pair (SetMembers.raw (seq k)) (ZFSet.pair (births k) (events k)))) - (ZFSet.pair (clocks (k + 1)) - (ZFSet.pair (SetMembers.raw (seq (k + 1))) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) ∧ - ∃ limit : SetMembers upperQ, - (∀ n, ZFSet.pair (SetMembers.raw limit) (SetMembers.raw (seq n)) ∈ upperOrder) ∧ - SetMembers.raw (data limit) = stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∧ - stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∈ M.sets ∧ - (∀ z, z ∈ SetMembers.raw (data limit) ↔ ∃ n, z ∈ SetMembers.raw (data (seq n))) ∧ - ∀ x ∈ SetMembers.raw (data limit), - ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ - x ∈ SetMembers.raw (data (seq i)) ∧ - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ - ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages packed T ∧ - (∀ k, Nat.pair i j ≤ k → - x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k)))) ∧ - ∃ y ∈ M.preparationWitnessBound nodes T upperQ, ∃ payload, - y = ZFSet.pair (SetMembers.raw (seq (Nat.pair i j + 1))) payload ∧ - ZFSet.pair (ZFSet.pair alpha (SetMembers.raw (seq (Nat.pair i j)))) y ∈ prepSelector ∧ - events (Nat.pair i j + 1) = ZFSet.pair alpha y - -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {R : Type u} [PartialOrder R] (c : Presentation R) - -theorem exists_groundFairPreparationLowerBound - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history), - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - ∀ H : ConditionFilter (SetMembers Q), - H.GenericFor (M.codedFamily lower) → - H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val - ), - ∀ p ∈ upperQ, FairPreparationLowerBoundResult M c T stages packed b.carrier p := by - let geometry := run.finalGeometry i₀ - let instGeometryGroup := geometry.group_code.toGroup - let instGeometryOrder := geometry.meet.order.toPartialOrder - let instGeometryBottom := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history hs hh ordinal trace - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let upperQ := M.refinementHistoryForcing c.carrier T stages packed - let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T - intro descent p hp - refine Exists.elim - (fulfilled.exists_groundFairPreparationOrbit c collection infinite choice small smallD irreflexive rowClosed - a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 - topMem topRows stages history hs hh ordinal trace descent p hp) - (fun enumSelector enumRest => ?_) - have hEnum := enumRest.1 - have enumFunction := enumRest.2.1 - have enumSelected := enumRest.2.2.1 - refine Exists.elim enumRest.2.2.2 (fun E0 rangeRest => ?_) - have hE0 := rangeRest.1 - have rangeFunction := rangeRest.2.1 - refine Exists.elim rangeRest.2.2 (fun prepSelector prepRest => ?_) - have hPrep := prepRest.1 - have prepFunction := prepRest.2.1 - have prepSelected := prepRest.2.2.1 - refine Exists.elim prepRest.2.2.2 (fun e eRest => ?_) - have he := eRest.1 - have chosen := eRest.2.1 - refine Exists.elim eRest.2.2 (fun orbit orbitRest => ?_) - have hOrbit := orbitRest.1 - have orbitFunction := orbitRest.2.1 - have initial := orbitRest.2.2.1 - have steps := orbitRest.2.2.2 - let instHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed - let pTyped : SetMembers upperQ := SetMembers.ofMem p hp - have typedChosen : ZFSet.pair (SetMembers.raw pTyped) e ∈ enumSelector := by - simpa only [pTyped, SetMembers.raw_ofMem] using chosen - have typedInitial : ∀ state, ZFSet.pair ∅ state ∈ orbit ↔ - state = ZFSet.pair ∅ (ZFSet.pair (SetMembers.raw pTyped) (ZFSet.pair {ZFSet.pair ∅ e} ∅)) := by - simpa only [pTyped, SetMembers.raw_ofMem] using initial - obtain ⟨seq, start, seqGround, decreasing, clocks, births, events, - clockZero, birthZero, eventZero, rawSteps, limit, below, dataEqual, - unionGround, exactEntries, visits⟩ := - M.semanticStructuralFairPreparation_lower_bound c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hs hh ordinal trace infinite choice rowClosed pTyped E0 enumSelector prepSelector orbit e - hE0 hOrbit rangeFunction enumSelected prepSelected typedChosen orbitFunction typedInitial steps - refine ⟨enumSelector, hEnum, enumFunction, enumSelected, E0, hE0, rangeFunction, - prepSelector, hPrep, prepFunction, prepSelected, seq, ?_, seqGround, (fun _ _ h => decreasing h), - e, he, chosen, clocks, births, events, clockZero, birthZero, eventZero, rawSteps, - limit, below, dataEqual, unionGround, exactEntries, visits⟩ - exact (congrArg SetMembers.raw start).trans (SetMembers.raw_ofMem p hp) - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {R : Type u} [PartialOrder R] - -theorem FairPreparationLowerBoundResult.exists_storedPreparedLimit - (c : Presentation R) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {T stages packed nodes p : ZFSet.{u}} - (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages packed) - (environments : ∀ alpha (fields : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → - StoredPreparationEnvironment M fields) - (result : FairPreparationLowerBoundResult M c T stages packed nodes p) : - ∃ limit ∈ M.refinementHistoryForcing c.carrier T stages packed, - ZFSet.pair limit p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed ∧ - StoredPreparedConditionCode M c.carrier T stages packed nodes limit := by - let Q := M.refinementHistoryForcing c.carrier T stages packed - let order := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let B := M.groundSmallSubsets - (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega - let shape := M.refinementHistoryForcing_shape c.carrier T stages packed - let data := flatCarrierData c Q B shape - let row := flatCarrierRow c Q B shape - obtain ⟨enumSelector, _hEnum, _enumFunction, _enumSelected, E0, _hE0, _rangeFunction, - prepSelector, _hPrep, _prepFunction, prepSelected, seq, start, _seqGround, _decreasing, - e, _he, _chosen, clocks, births, events, _clockZero, _birthZero, _eventZero, _rawSteps, - limit, below, _dataEqual, _unionGround, _exactEntries, visits⟩ := result - refine ⟨SetMembers.raw limit, SetMembers.raw_mem limit, ?_, ?_⟩ - · exact start ▸ below 0 - intro limitRow limitA limitCode x hx - have limitData : SetMembers.raw (data limit) = limitA := - (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape limit).symm.trans limitCode)).2 - have inData : x ∈ SetMembers.raw (data limit) := limitData.symm ▸ hx - obtain ⟨i, j, alpha, hAlpha, fields, _unpaired, _born, _early, stored, _level, - retained, y, _hy, payload, yCode, selected, _event⟩ := visits x inData - let n := Nat.pair i j - have relationEntry := prepSelected selected - rw [yCode] at relationEntry - obtain ⟨_, _inputMember, bounded, other, otherStored, terms, nodeCarrier, meetCode, code⟩ := - (M.pair_mem_varyingPreparationRelation stages packed Q order nodes T alpha - (SetMembers.raw (seq n)) (ZFSet.pair (SetMembers.raw (seq (n + 1))) payload)).1 relationEntry - have same : other = fields := - refinementFormulaDataCode_injective (run.carriers.data.function.unique otherStored stored) - subst other - obtain ⟨sourceRow, sourceA, output, k, enumerations, q, - inputCode, outputCode, _visitBelow, cut, family⟩ := code - have sourceData : SetMembers.raw (data (seq n)) = sourceA := - (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape (seq n)).symm.trans inputCode)).2 - obtain ⟨outputEq, payloadEq⟩ := ZFSet.pair_inj.1 outputCode - subst output - rw [payloadEq] at bounded - obtain ⟨_, hkBound, heBound⟩ := (M.mem_preparationWitnessBound nodes T Q - (SetMembers.raw (seq (n + 1))) k enumerations).1 bounded - have hk := ((M.mem_groundRelations _ _ k).1 hkBound).1 - have hEnumerations := ((M.mem_groundRelations _ _ enumerations).1 heBound).1 - have hSourceA : sourceA ∈ M.sets := sourceData ▸ - ((M.mem_groundSmallSubsets _ _ _).1 (SetMembers.raw_mem (data (seq n)))).1 - have sourceMember : ZFSet.pair sourceRow sourceA ∈ Q := inputCode ▸ SetMembers.raw_mem (seq n) - have sourceBelow := below n - rw [limitCode, inputCode] at sourceBelow - have sourceSubset := ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T - stages packed limitRow limitA sourceRow sourceA).1 sourceBelow).2.2.2 - have sourceSelected : x ∈ assignmentOnIndices (fields 0) T sourceA := - sourceData ▸ retained n (Nat.le_refl n) - have environment := environments alpha fields stored - obtain ⟨rCut, hrCut, finalCut, _cutBelow, finalFamily⟩ := - M.storedPreparationFamily_cut_mono pairing unions powers separation collection run fields - environment stored hSourceA (SetMembers.raw_mem limit) (below (n + 1)) cut family - exact ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meetCode, environment, - sourceRow, sourceA, hSourceA, sourceMember, sourceSubset, sourceSelected, - k, hk, enumerations, hEnumerations, rCut, hrCut, finalCut, finalFamily⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalFairPreparationOrbits + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v + +def FairPreparationLowerBoundResult (M : TransitiveGround.{u}) + {R : Type u} [PartialOrder R] (c : Presentation R) + (T stages packed nodes p : ZFSet.{u}) : Prop := + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.varyingPreparationRelation stages packed upperQ upperOrder nodes T + let B := M.groundSmallSubsets + (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega + let shape := M.refinementHistoryForcing_shape c.carrier T stages packed + let data := flatCarrierData c upperQ B shape + ∃ enumSelector ∈ M.sets, + ZFSet.IsFunc upperQ (M.groundRelations ZFSet.omega stages) enumSelector ∧ + enumSelector ⊆ M.birthLevelEnumerationRelation upperQ stages + (refinementDataHistoryLevels stages packed T) ∧ + ∃ E0 ∈ M.sets, ZFSet.IsFunc upperQ E0 enumSelector ∧ + ∃ prepSelector ∈ M.sets, + ZFSet.IsFunc (ZFSet.prod stages upperQ) + (M.preparationWitnessBound nodes T upperQ) prepSelector ∧ + prepSelector ⊆ relation ∧ + ∃ seq : Nat → SetMembers upperQ, SetMembers.raw (seq 0) = p ∧ + groundSequenceGraph seq ∈ M.sets ∧ + (∀ i j : Nat, i ≤ j → ZFSet.pair (SetMembers.raw (seq j)) (SetMembers.raw (seq i)) ∈ upperOrder) ∧ + ∃ e ∈ E0, ZFSet.pair p e ∈ enumSelector ∧ + ∃ clocks births events : Nat → ZFSet.{u}, + clocks 0 = ∅ ∧ births 0 = {ZFSet.pair ∅ e} ∧ events 0 = ∅ ∧ + (∀ k, FairPreparationStepCode ZFSet.omega E0 stages + (M.preparationWitnessBound nodes T upperQ) enumSelector prepSelector + (natPresentation.graph (natPresentation.product natPresentation) omegaGridEquiv) + (ZFSet.pair (clocks k) (ZFSet.pair (SetMembers.raw (seq k)) (ZFSet.pair (births k) (events k)))) + (ZFSet.pair (clocks (k + 1)) + (ZFSet.pair (SetMembers.raw (seq (k + 1))) (ZFSet.pair (births (k + 1)) (events (k + 1)))))) ∧ + ∃ limit : SetMembers upperQ, + (∀ n, ZFSet.pair (SetMembers.raw limit) (SetMembers.raw (seq n)) ∈ upperOrder) ∧ + SetMembers.raw (data limit) = stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∧ + stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n))) ∈ M.sets ∧ + (∀ z, z ∈ SetMembers.raw (data limit) ↔ ∃ n, z ∈ SetMembers.raw (data (seq n))) ∧ + ∀ x ∈ SetMembers.raw (data limit), + ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ + x ∈ SetMembers.raw (data (seq i)) ∧ + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ + ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages packed T ∧ + (∀ k, Nat.pair i j ≤ k → + x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k)))) ∧ + ∃ y ∈ M.preparationWitnessBound nodes T upperQ, ∃ payload, + y = ZFSet.pair (SetMembers.raw (seq (Nat.pair i j + 1))) payload ∧ + ZFSet.pair (ZFSet.pair alpha (SetMembers.raw (seq (Nat.pair i j)))) y ∈ prepSelector ∧ + events (Nat.pair i j + 1) = ZFSet.pair alpha y + +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {R : Type u} [PartialOrder R] (c : Presentation R) + +theorem exists_groundFairPreparationLowerBound + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history), + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + ∀ (_descent : ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + ∀ H : ConditionFilter (SetMembers Q), + H.GenericFor (M.codedFamily lower) → + H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val + ), + ∀ p ∈ upperQ, FairPreparationLowerBoundResult M c T stages packed b.carrier p := by + let geometry := run.finalGeometry i₀ + let instGeometryGroup := geometry.group_code.toGroup + let instGeometryOrder := geometry.meet.order.toPartialOrder + let instGeometryBottom := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history hs hh ordinal trace + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let upperQ := M.refinementHistoryForcing c.carrier T stages packed + let upperOrder := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let relation := M.varyingPreparationRelation stages packed upperQ upperOrder b.carrier T + intro descent p hp + refine Exists.elim + (fulfilled.exists_groundFairPreparationOrbit c collection infinite choice small smallD irreflexive rowClosed + a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 children1 children2 + topMem topRows stages history hs hh ordinal trace descent p hp) + (fun enumSelector enumRest => ?_) + have hEnum := enumRest.1 + have enumFunction := enumRest.2.1 + have enumSelected := enumRest.2.2.1 + refine Exists.elim enumRest.2.2.2 (fun E0 rangeRest => ?_) + have hE0 := rangeRest.1 + have rangeFunction := rangeRest.2.1 + refine Exists.elim rangeRest.2.2 (fun prepSelector prepRest => ?_) + have hPrep := prepRest.1 + have prepFunction := prepRest.2.1 + have prepSelected := prepRest.2.2.1 + refine Exists.elim prepRest.2.2.2 (fun e eRest => ?_) + have he := eRest.1 + have chosen := eRest.2.1 + refine Exists.elim eRest.2.2 (fun orbit orbitRest => ?_) + have hOrbit := orbitRest.1 + have orbitFunction := orbitRest.2.1 + have initial := orbitRest.2.2.1 + have steps := orbitRest.2.2.2 + let instHistoryOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T stages packed + let pTyped : SetMembers upperQ := SetMembers.ofMem p hp + have typedChosen : ZFSet.pair (SetMembers.raw pTyped) e ∈ enumSelector := by + simpa only [pTyped, SetMembers.raw_ofMem] using chosen + have typedInitial : ∀ state, ZFSet.pair ∅ state ∈ orbit ↔ + state = ZFSet.pair ∅ (ZFSet.pair (SetMembers.raw pTyped) (ZFSet.pair {ZFSet.pair ∅ e} ∅)) := by + simpa only [pTyped, SetMembers.raw_ofMem] using initial + obtain ⟨seq, start, seqGround, decreasing, clocks, births, events, + clockZero, birthZero, eventZero, rawSteps, limit, below, dataEqual, + unionGround, exactEntries, visits⟩ := + M.semanticStructuralFairPreparation_lower_bound c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hs hh ordinal trace infinite choice rowClosed pTyped E0 enumSelector prepSelector orbit e + hE0 hOrbit rangeFunction enumSelected prepSelected typedChosen orbitFunction typedInitial steps + refine ⟨enumSelector, hEnum, enumFunction, enumSelected, E0, hE0, rangeFunction, + prepSelector, hPrep, prepFunction, prepSelected, seq, ?_, seqGround, (fun _ _ h => decreasing h), + e, he, chosen, clocks, births, events, clockZero, birthZero, eventZero, rawSteps, + limit, below, dataEqual, unionGround, exactEntries, visits⟩ + exact (congrArg SetMembers.raw start).trans (SetMembers.raw_ofMem p hp) + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {R : Type u} [PartialOrder R] + +theorem FairPreparationLowerBoundResult.exists_storedPreparedLimit + (c : Presentation R) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {T stages packed nodes p : ZFSet.{u}} + (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages packed) + (environments : ∀ alpha (fields : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → + StoredPreparationEnvironment M fields) + (result : FairPreparationLowerBoundResult M c T stages packed nodes p) : + ∃ limit ∈ M.refinementHistoryForcing c.carrier T stages packed, + ZFSet.pair limit p ∈ M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed ∧ + StoredPreparedConditionCode M c.carrier T stages packed nodes limit := by + let Q := M.refinementHistoryForcing c.carrier T stages packed + let order := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let B := M.groundSmallSubsets + (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega + let shape := M.refinementHistoryForcing_shape c.carrier T stages packed + let data := flatCarrierData c Q B shape + let row := flatCarrierRow c Q B shape + obtain ⟨enumSelector, _hEnum, _enumFunction, _enumSelected, E0, _hE0, _rangeFunction, + prepSelector, _hPrep, _prepFunction, prepSelected, seq, start, _seqGround, _decreasing, + e, _he, _chosen, clocks, births, events, _clockZero, _birthZero, _eventZero, _rawSteps, + limit, below, _dataEqual, _unionGround, _exactEntries, visits⟩ := result + refine ⟨SetMembers.raw limit, SetMembers.raw_mem limit, ?_, ?_⟩ + · exact start ▸ below 0 + intro limitRow limitA limitCode x hx + have limitData : SetMembers.raw (data limit) = limitA := + (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape limit).symm.trans limitCode)).2 + have inData : x ∈ SetMembers.raw (data limit) := limitData.symm ▸ hx + obtain ⟨i, j, alpha, hAlpha, fields, _unpaired, _born, _early, stored, _level, + retained, y, _hy, payload, yCode, selected, _event⟩ := visits x inData + let n := Nat.pair i j + have relationEntry := prepSelected selected + rw [yCode] at relationEntry + obtain ⟨_, _inputMember, bounded, other, otherStored, terms, nodeCarrier, meetCode, code⟩ := + (M.pair_mem_varyingPreparationRelation stages packed Q order nodes T alpha + (SetMembers.raw (seq n)) (ZFSet.pair (SetMembers.raw (seq (n + 1))) payload)).1 relationEntry + have same : other = fields := + refinementFormulaDataCode_injective (run.carriers.data.function.unique otherStored stored) + subst other + obtain ⟨sourceRow, sourceA, output, k, enumerations, q, + inputCode, outputCode, _visitBelow, cut, family⟩ := code + have sourceData : SetMembers.raw (data (seq n)) = sourceA := + (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape (seq n)).symm.trans inputCode)).2 + obtain ⟨outputEq, payloadEq⟩ := ZFSet.pair_inj.1 outputCode + subst output + rw [payloadEq] at bounded + obtain ⟨_, hkBound, heBound⟩ := (M.mem_preparationWitnessBound nodes T Q + (SetMembers.raw (seq (n + 1))) k enumerations).1 bounded + have hk := ((M.mem_groundRelations _ _ k).1 hkBound).1 + have hEnumerations := ((M.mem_groundRelations _ _ enumerations).1 heBound).1 + have hSourceA : sourceA ∈ M.sets := sourceData ▸ + ((M.mem_groundSmallSubsets _ _ _).1 (SetMembers.raw_mem (data (seq n)))).1 + have sourceMember : ZFSet.pair sourceRow sourceA ∈ Q := inputCode ▸ SetMembers.raw_mem (seq n) + have sourceBelow := below n + rw [limitCode, inputCode] at sourceBelow + have sourceSubset := ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T + stages packed limitRow limitA sourceRow sourceA).1 sourceBelow).2.2.2 + have sourceSelected : x ∈ assignmentOnIndices (fields 0) T sourceA := + sourceData ▸ retained n (Nat.le_refl n) + have environment := environments alpha fields stored + obtain ⟨rCut, hrCut, finalCut, _cutBelow, finalFamily⟩ := + M.storedPreparationFamily_cut_mono pairing unions powers separation collection run fields + environment stored hSourceA (SetMembers.raw_mem limit) (below (n + 1)) cut family + exact ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meetCode, environment, + sourceRow, sourceA, hSourceA, sourceMember, sourceSubset, sourceSelected, + k, hk, enumerations, hEnumerations, rCut, hrCut, finalCut, finalFamily⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFiniteBirthHistories.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFiniteBirthHistories.lean index 2f3bc9f947c4e132ffc7d98b8c2e27bfde822441..aded077cdf1f537c12ccf952efd616eb5bf06822 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFiniteBirthHistories.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFiniteBirthHistories.lean @@ -1,73 +1,73 @@ -import OAI.SetTheory.PartitionPrinciple.Models.GroundSuccessorInjections - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem finiteBirthHistory_extend (k : Nat) {E history e : ZFSet.{u}} - (function : ZFSet.IsFunc (natSetCode k) E history) (value : e ∈ E) : - let next := insert (ZFSet.pair (natSetCode k) e) history - ZFSet.IsFunc (natSetCode (k + 1)) E next ∧ history ⊆ next ∧ - graphRestriction (natSetCode k) next = history ∧ - ∀ y, ZFSet.pair (natSetCode k) y ∈ next ↔ y = e := by - let graph : FunctionGraphOn (natSetCode k) history := ⟨E, function⟩ - have extended := graph.successor e - refine ⟨?_, fun _ member => ZFSet.mem_insert_of_mem _ member, ?_, ?_⟩ - · rw [natSetCode_succ] - refine ⟨?_, extended.to_isFunc.2⟩ - intro z member - rcases ZFSet.mem_insert_iff.1 member with rfl | member - · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, value⟩ - · obtain ⟨i, hi, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hi, hy⟩ - · exact (graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl (natSetCode k))).trans - graph.restriction_eq - · intro y - constructor - · intro member - rcases ZFSet.mem_insert_iff.1 member with equal | old - · exact (ZFSet.pair_inj.1 equal).2 - · exact False.elim (ZFSet.mem_irrefl (natSetCode k) (graph.pair_source old)) - · intro equal - exact equal.symm ▸ ZFSet.mem_insert _ _ - -theorem finiteBirthHistory_initial {E e : ZFSet.{u}} (value : e ∈ E) : - ZFSet.IsFunc (natSetCode 1) E {ZFSet.pair ∅ e} ∧ - ∀ y, ZFSet.pair ∅ y ∈ ({ZFSet.pair ∅ e} : ZFSet.{u}) ↔ y = e := by - have empty : ZFSet.IsFunc (natSetCode 0) E (∅ : ZFSet.{u}) := - ⟨ZFSet.empty_subset _, fun i hi => False.elim (ZFSet.notMem_empty i hi)⟩ - have first := finiteBirthHistory_extend 0 empty value - exact ⟨first.1, first.2.2.2⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem finiteBirthHistory_extend_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (k : Nat) {history e : ZFSet.{u}} (ground : history ∈ M.sets) (value : e ∈ M.sets) : - insert (ZFSet.pair (natSetCode k) e) history ∈ M.sets := - M.insert_mem pairing unions - (M.orderedPair_mem pairing (M.natSetCode_mem separation infinite k) value) ground - -theorem finiteBirthHistory_initial_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {e : ZFSet.{u}} (value : e ∈ M.sets) : - ({ZFSet.pair ∅ e} : ZFSet.{u}) ∈ M.sets := by - have empty := M.empty_mem ⟨e, value⟩ - have entry := M.orderedPair_mem pairing empty value - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing entry entry - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Models.GroundSuccessorInjections + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem finiteBirthHistory_extend (k : Nat) {E history e : ZFSet.{u}} + (function : ZFSet.IsFunc (natSetCode k) E history) (value : e ∈ E) : + let next := insert (ZFSet.pair (natSetCode k) e) history + ZFSet.IsFunc (natSetCode (k + 1)) E next ∧ history ⊆ next ∧ + graphRestriction (natSetCode k) next = history ∧ + ∀ y, ZFSet.pair (natSetCode k) y ∈ next ↔ y = e := by + let graph : FunctionGraphOn (natSetCode k) history := ⟨E, function⟩ + have extended := graph.successor e + refine ⟨?_, fun _ member => ZFSet.mem_insert_of_mem _ member, ?_, ?_⟩ + · rw [natSetCode_succ] + refine ⟨?_, extended.to_isFunc.2⟩ + intro z member + rcases ZFSet.mem_insert_iff.1 member with rfl | member + · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, value⟩ + · obtain ⟨i, hi, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hi, hy⟩ + · exact (graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl (natSetCode k))).trans + graph.restriction_eq + · intro y + constructor + · intro member + rcases ZFSet.mem_insert_iff.1 member with equal | old + · exact (ZFSet.pair_inj.1 equal).2 + · exact False.elim (ZFSet.mem_irrefl (natSetCode k) (graph.pair_source old)) + · intro equal + exact equal.symm ▸ ZFSet.mem_insert _ _ + +theorem finiteBirthHistory_initial {E e : ZFSet.{u}} (value : e ∈ E) : + ZFSet.IsFunc (natSetCode 1) E {ZFSet.pair ∅ e} ∧ + ∀ y, ZFSet.pair ∅ y ∈ ({ZFSet.pair ∅ e} : ZFSet.{u}) ↔ y = e := by + have empty : ZFSet.IsFunc (natSetCode 0) E (∅ : ZFSet.{u}) := + ⟨ZFSet.empty_subset _, fun i hi => False.elim (ZFSet.notMem_empty i hi)⟩ + have first := finiteBirthHistory_extend 0 empty value + exact ⟨first.1, first.2.2.2⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem finiteBirthHistory_extend_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (k : Nat) {history e : ZFSet.{u}} (ground : history ∈ M.sets) (value : e ∈ M.sets) : + insert (ZFSet.pair (natSetCode k) e) history ∈ M.sets := + M.insert_mem pairing unions + (M.orderedPair_mem pairing (M.natSetCode_mem separation infinite k) value) ground + +theorem finiteBirthHistory_initial_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {e : ZFSet.{u}} (value : e ∈ M.sets) : + ({ZFSet.pair ∅ e} : ZFSet.{u}) ∈ M.sets := by + have empty := M.empty_mem ⟨e, value⟩ + have entry := M.orderedPair_mem pairing empty value + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing entry entry + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFixedFairPreparationLimitCertificates.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFixedFairPreparationLimitCertificates.lean index 84f960732aa27a2522066461321c5a58bc957eda..dd1a5a5416d273a3107cf0aeaea7b6f5603e1c77 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFixedFairPreparationLimitCertificates.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFixedFairPreparationLimitCertificates.lean @@ -1,113 +1,113 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCarrierSequences -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparedWitnessSelections -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecordedPreparationSupportInclusions - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] - -theorem fixedFairPreparationLimit_supportPrepared - (c : Presentation R) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - {T stages packed nodes E prepSelector : ZFSet.{u}} - (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages packed) - (environments : ∀ alpha (fields : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → - StoredPreparationEnvironment M fields) - (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) - (prepSelected : prepSelector ⊆ M.varyingPreparationRelation stages packed - (M.refinementHistoryForcing c.carrier T stages packed) - (M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed) nodes T) : - let Q := M.refinementHistoryForcing c.carrier T stages packed - let order := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let B := M.groundSmallSubsets - (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega - let shape := M.refinementHistoryForcing_shape c.carrier T stages packed - let data := flatCarrierData c Q B shape - ∀ (seq : Nat → SetMembers Q) (events : Nat → ZFSet.{u}), - ZFSet.IsFunc ZFSet.omega E (familyCodeGraph natSetCode events) → - ∀ limit : SetMembers Q, - (∀ n, ZFSet.pair (SetMembers.raw limit) (SetMembers.raw (seq n)) ∈ order) → - (∀ x ∈ SetMembers.raw (data limit), - ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ - x ∈ SetMembers.raw (data (seq i)) ∧ - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ - ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages packed T ∧ - (∀ k, Nat.pair i j ≤ k → - x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k)))) ∧ - ∃ y ∈ M.preparationWitnessBound nodes T Q, ∃ payload, - y = ZFSet.pair (SetMembers.raw (seq (Nat.pair i j + 1))) payload ∧ - ZFSet.pair (ZFSet.pair alpha (SetMembers.raw (seq (Nat.pair i j)))) y ∈ prepSelector ∧ - events (Nat.pair i j + 1) = ZFSet.pair alpha y) → - StoredSupportPreparedConditionCode M c.carrier T stages packed nodes (SetMembers.raw limit) - (M.preparationUsedSupportUnion nodes E (familyCodeGraph natSetCode events)) := by - let Q := M.refinementHistoryForcing c.carrier T stages packed - let order := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed - let B := M.groundSmallSubsets - (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega - let shape := M.refinementHistoryForcing_shape c.carrier T stages packed - let data := flatCarrierData c Q B shape - dsimp only - intro seq events eventFunction limit below visits limitRow limitA limitCode x hx - have limitData : SetMembers.raw (data limit) = limitA := - (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape limit).symm.trans limitCode)).2 - have inData : x ∈ SetMembers.raw (data limit) := limitData.symm ▸ hx - obtain ⟨i, j, alpha, hAlpha, fields, _unpaired, _born, _early, stored, _level, - retained, y, _hy, payload, yCode, selected, eventAt⟩ := visits x inData - let n := Nat.pair i j - have relationEntry := prepSelected selected - rw [yCode] at relationEntry - obtain ⟨_, _inputMember, bounded, other, otherStored, terms, nodeCarrier, meetCode, code⟩ := - (M.pair_mem_varyingPreparationRelation stages packed Q order nodes T alpha - (SetMembers.raw (seq n)) (ZFSet.pair (SetMembers.raw (seq (n + 1))) payload)).1 relationEntry - have same : other = fields := - refinementFormulaDataCode_injective (run.carriers.data.function.unique otherStored stored) - subst other - obtain ⟨sourceRow, sourceA, output, k, enumerations, q, - inputCode, outputCode, _visitBelow, cut, family⟩ := code - have sourceData : SetMembers.raw (data (seq n)) = sourceA := - (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape (seq n)).symm.trans inputCode)).2 - obtain ⟨outputEq, payloadEq⟩ := ZFSet.pair_inj.1 outputCode - subst output - rw [payloadEq] at bounded - obtain ⟨_, hkBound, heBound⟩ := (M.mem_preparationWitnessBound nodes T Q - (SetMembers.raw (seq (n + 1))) k enumerations).1 bounded - have hk := ((M.mem_groundRelations _ _ k).1 hkBound).1 - have hEnumerations := ((M.mem_groundRelations _ _ enumerations).1 heBound).1 - have hSourceA : sourceA ∈ M.sets := sourceData ▸ - ((M.mem_groundSmallSubsets _ _ _).1 (SetMembers.raw_mem (data (seq n)))).1 - have sourceMember : ZFSet.pair sourceRow sourceA ∈ Q := inputCode ▸ SetMembers.raw_mem (seq n) - have sourceBelow := below n - rw [limitCode, inputCode] at sourceBelow - have sourceSubset := ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T - stages packed limitRow limitA sourceRow sourceA).1 sourceBelow).2.2.2 - have sourceSelected : x ∈ assignmentOnIndices (fields 0) T sourceA := - sourceData ▸ retained n (Nat.le_refl n) - have environment := environments alpha fields stored - obtain ⟨rCut, hrCut, finalCut, _cutBelow, finalFamily⟩ := - M.storedPreparationFamily_cut_mono pairing unions powers separation collection run fields - environment stored hSourceA (SetMembers.raw_mem limit) (below (n + 1)) cut family - have recorded : ZFSet.pair (natSetCode (n + 1)) - (ZFSet.pair alpha (ZFSet.pair (SetMembers.raw (seq (n + 1))) - (ZFSet.pair k enumerations))) ∈ familyCodeGraph natSetCode events := by - apply (mem_familyCodeGraph natSetCode events _).2 - refine ⟨n + 1, ?_⟩ - rw [eventAt, yCode, payloadEq] - have supportBound := M.recordedCertificateUsedSupports_subset separation hNodes hE - eventFunction recorded - exact ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meetCode, environment, - sourceRow, sourceA, hSourceA, sourceMember, sourceSubset, sourceSelected, - k, hk, enumerations, hEnumerations, rCut, hrCut, finalCut, finalFamily, supportBound⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCarrierSequences +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundPreparedWitnessSelections +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecordedPreparationSupportInclusions + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] + +theorem fixedFairPreparationLimit_supportPrepared + (c : Presentation R) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + {T stages packed nodes E prepSelector : ZFSet.{u}} + (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages packed) + (environments : ∀ alpha (fields : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed → + StoredPreparationEnvironment M fields) + (hNodes : nodes ∈ M.sets) (hE : E ∈ M.sets) + (prepSelected : prepSelector ⊆ M.varyingPreparationRelation stages packed + (M.refinementHistoryForcing c.carrier T stages packed) + (M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed) nodes T) : + let Q := M.refinementHistoryForcing c.carrier T stages packed + let order := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let B := M.groundSmallSubsets + (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega + let shape := M.refinementHistoryForcing_shape c.carrier T stages packed + let data := flatCarrierData c Q B shape + ∀ (seq : Nat → SetMembers Q) (events : Nat → ZFSet.{u}), + ZFSet.IsFunc ZFSet.omega E (familyCodeGraph natSetCode events) → + ∀ limit : SetMembers Q, + (∀ n, ZFSet.pair (SetMembers.raw limit) (SetMembers.raw (seq n)) ∈ order) → + (∀ x ∈ SetMembers.raw (data limit), + ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ + x ∈ SetMembers.raw (data (seq i)) ∧ + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧ + ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages packed T ∧ + (∀ k, Nat.pair i j ≤ k → + x ∈ assignmentOnIndices (fields 0) T (SetMembers.raw (data (seq k)))) ∧ + ∃ y ∈ M.preparationWitnessBound nodes T Q, ∃ payload, + y = ZFSet.pair (SetMembers.raw (seq (Nat.pair i j + 1))) payload ∧ + ZFSet.pair (ZFSet.pair alpha (SetMembers.raw (seq (Nat.pair i j)))) y ∈ prepSelector ∧ + events (Nat.pair i j + 1) = ZFSet.pair alpha y) → + StoredSupportPreparedConditionCode M c.carrier T stages packed nodes (SetMembers.raw limit) + (M.preparationUsedSupportUnion nodes E (familyCodeGraph natSetCode events)) := by + let Q := M.refinementHistoryForcing c.carrier T stages packed + let order := M.refinementHistoryOrder c.carrier c.conditionOrder T stages packed + let B := M.groundSmallSubsets + (stageOneAssignments (refinementDataHistoryIndices stages packed) T) ZFSet.omega + let shape := M.refinementHistoryForcing_shape c.carrier T stages packed + let data := flatCarrierData c Q B shape + dsimp only + intro seq events eventFunction limit below visits limitRow limitA limitCode x hx + have limitData : SetMembers.raw (data limit) = limitA := + (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape limit).symm.trans limitCode)).2 + have inData : x ∈ SetMembers.raw (data limit) := limitData.symm ▸ hx + obtain ⟨i, j, alpha, hAlpha, fields, _unpaired, _born, _early, stored, _level, + retained, y, _hy, payload, yCode, selected, eventAt⟩ := visits x inData + let n := Nat.pair i j + have relationEntry := prepSelected selected + rw [yCode] at relationEntry + obtain ⟨_, _inputMember, bounded, other, otherStored, terms, nodeCarrier, meetCode, code⟩ := + (M.pair_mem_varyingPreparationRelation stages packed Q order nodes T alpha + (SetMembers.raw (seq n)) (ZFSet.pair (SetMembers.raw (seq (n + 1))) payload)).1 relationEntry + have same : other = fields := + refinementFormulaDataCode_injective (run.carriers.data.function.unique otherStored stored) + subst other + obtain ⟨sourceRow, sourceA, output, k, enumerations, q, + inputCode, outputCode, _visitBelow, cut, family⟩ := code + have sourceData : SetMembers.raw (data (seq n)) = sourceA := + (ZFSet.pair_inj.1 ((flatCarrier_coordinates c Q B shape (seq n)).symm.trans inputCode)).2 + obtain ⟨outputEq, payloadEq⟩ := ZFSet.pair_inj.1 outputCode + subst output + rw [payloadEq] at bounded + obtain ⟨_, hkBound, heBound⟩ := (M.mem_preparationWitnessBound nodes T Q + (SetMembers.raw (seq (n + 1))) k enumerations).1 bounded + have hk := ((M.mem_groundRelations _ _ k).1 hkBound).1 + have hEnumerations := ((M.mem_groundRelations _ _ enumerations).1 heBound).1 + have hSourceA : sourceA ∈ M.sets := sourceData ▸ + ((M.mem_groundSmallSubsets _ _ _).1 (SetMembers.raw_mem (data (seq n)))).1 + have sourceMember : ZFSet.pair sourceRow sourceA ∈ Q := inputCode ▸ SetMembers.raw_mem (seq n) + have sourceBelow := below n + rw [limitCode, inputCode] at sourceBelow + have sourceSubset := ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T + stages packed limitRow limitA sourceRow sourceA).1 sourceBelow).2.2.2 + have sourceSelected : x ∈ assignmentOnIndices (fields 0) T sourceA := + sourceData ▸ retained n (Nat.le_refl n) + have environment := environments alpha fields stored + obtain ⟨rCut, hrCut, finalCut, _cutBelow, finalFamily⟩ := + M.storedPreparationFamily_cut_mono pairing unions powers separation collection run fields + environment stored hSourceA (SetMembers.raw_mem limit) (below (n + 1)) cut family + have recorded : ZFSet.pair (natSetCode (n + 1)) + (ZFSet.pair alpha (ZFSet.pair (SetMembers.raw (seq (n + 1))) + (ZFSet.pair k enumerations))) ∈ familyCodeGraph natSetCode events := by + apply (mem_familyCodeGraph natSetCode events _).2 + refine ⟨n + 1, ?_⟩ + rw [eventAt, yCode, payloadEq] + have supportBound := M.recordedCertificateUsedSupports_subset separation hNodes hE + eventFunction recorded + exact ⟨alpha, hAlpha, fields, stored, terms, nodeCarrier, meetCode, environment, + sourceRow, sourceA, hSourceA, sourceMember, sourceSubset, sourceSelected, + k, hk, enumerations, hEnumerations, rCut, hrCut, finalCut, finalFamily, supportBound⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatLimitAdequacy.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatLimitAdequacy.lean index 46f76e1e5bdc914c4da2947cf583e50e877a6a25..0ec86d00f680ba9f0c8677478bb42535459d8d68 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatLimitAdequacy.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatLimitAdequacy.lean @@ -1,87 +1,87 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatLimitConditions -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem refinementHistoryCandidate_cut (separation : SeparationSchema M.sets) - {stages indexHistory rows T beta row A : ZFSet.{u}} - (function : FunctionGraphOn stages indexHistory) - (literal : ∀ xi I, ZFSet.pair xi I ∈ indexHistory → RefinementIndexLevelCode I xi) - (below : beta ⊆ stages) - (hLevels : refinementHistoryAssignmentLevels stages indexHistory T ∈ M.sets) - (hBeta : beta ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (candidate : ZFSet.pair row A ∈ - M.stageOneCandidateBound rows (refinementHistoryIndices stages indexHistory) T) : - ZFSet.pair row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) beta A) ∈ - M.stageOneCandidateBound rows (refinementHistoryIndices beta indexHistory) T := by - obtain ⟨hrow, hA, _, small⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate - apply (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 - refine ⟨hrow, M.assignmentCut_mem separation hLevels hBeta hA, ?_, - M.assignmentCut_small separation hLevels hBeta hA omega small⟩ - rw [refinementHistoryAssignmentCut_eq function literal below] - exact fun _ member => (ZFSet.mem_sep.1 member).2 - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {stages indexHistory history rows T : ZFSet.{u}} -variable (hStages : stages ∈ M.sets) (hIndexHistory : indexHistory ∈ M.sets) (hT : T ∈ M.sets) -variable (omega : ZFSet.omega ∈ M.sets) -variable (ordinal : ordinalSetProperty stages) -variable (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) -variable (function : FunctionGraphOn stages indexHistory) -variable (literal : ∀ xi I, ZFSet.pair xi I ∈ indexHistory → RefinementIndexLevelCode I xi) -variable (tests : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop) -variable (recursion : FlatOrdinalCarrierRecursion stages history - (refinementHistoryAssignmentLevels stages indexHistory T) - (fun beta row A => ZFSet.pair row A ∈ - M.stageOneCandidateBound rows (refinementHistoryIndices beta indexHistory) T) tests) -variable (locality : ∀ beta ∈ stages, ∀ row A, - tests beta row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) - (insert beta beta) A) ↔ tests beta row A) -include pairing unions powers separation hStages hIndexHistory hT omega ordinal successors function literal recursion locality - -theorem flatLimitConditions_iff_all_tests (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.flatLimitConditions rows (refinementHistoryIndices stages indexHistory) T - stages history (refinementHistoryAssignmentLevels stages indexHistory T) ↔ - ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementHistoryIndices stages indexHistory) T ∧ - ∀ beta ∈ stages, tests beta row A := by - have levels := M.refinementHistoryAssignmentLevels_mem pairing unions powers separation - hStages hIndexHistory hT - rw [M.mem_flatLimitConditions, flatLimitConditionCode_pair] - apply and_congr_right - intro candidate - exact recursion.cuts_iff_tests ordinal locality successors row A (fun beta member => - M.refinementHistoryCandidate_cut separation function literal (ordinal.1 beta member) - levels (M.transitive hStages member) omega candidate) - -theorem flatLimitConditions_successor_coverage {row A : ZFSet.{u}} - (member : ZFSet.pair row A ∈ - M.flatLimitConditions rows (refinementHistoryIndices stages indexHistory) T stages history - (refinementHistoryAssignmentLevels stages indexHistory T)) : - ∀ beta ∈ stages, ∃ Q Qnext, - ZFSet.pair beta Q ∈ history ∧ ZFSet.pair (insert beta beta) Qnext ∈ history ∧ - ZFSet.pair row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) beta A) ∈ Q ∧ - ZFSet.pair row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) - (insert beta beta) A) ∈ Qnext ∧ tests beta row A := by - have allTests := ((M.flatLimitConditions_iff_all_tests pairing unions powers separation - hStages hIndexHistory hT omega ordinal successors function literal tests recursion locality row A).1 member).2 - have cuts := (flatLimitConditionCode_pair _ _ _ _ _).1 - ((M.mem_flatLimitConditions _ _ _ _ _ _ _).1 member).2 - intro beta hbeta - obtain ⟨Q, entry, lower⟩ := cuts beta hbeta - obtain ⟨Qnext, next, upper⟩ := cuts (insert beta beta) (successors beta hbeta) - exact ⟨Q, Qnext, entry, next, lower, upper, allTests beta hbeta⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatLimitConditions +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem refinementHistoryCandidate_cut (separation : SeparationSchema M.sets) + {stages indexHistory rows T beta row A : ZFSet.{u}} + (function : FunctionGraphOn stages indexHistory) + (literal : ∀ xi I, ZFSet.pair xi I ∈ indexHistory → RefinementIndexLevelCode I xi) + (below : beta ⊆ stages) + (hLevels : refinementHistoryAssignmentLevels stages indexHistory T ∈ M.sets) + (hBeta : beta ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (candidate : ZFSet.pair row A ∈ + M.stageOneCandidateBound rows (refinementHistoryIndices stages indexHistory) T) : + ZFSet.pair row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) beta A) ∈ + M.stageOneCandidateBound rows (refinementHistoryIndices beta indexHistory) T := by + obtain ⟨hrow, hA, _, small⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate + apply (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 + refine ⟨hrow, M.assignmentCut_mem separation hLevels hBeta hA, ?_, + M.assignmentCut_small separation hLevels hBeta hA omega small⟩ + rw [refinementHistoryAssignmentCut_eq function literal below] + exact fun _ member => (ZFSet.mem_sep.1 member).2 + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {stages indexHistory history rows T : ZFSet.{u}} +variable (hStages : stages ∈ M.sets) (hIndexHistory : indexHistory ∈ M.sets) (hT : T ∈ M.sets) +variable (omega : ZFSet.omega ∈ M.sets) +variable (ordinal : ordinalSetProperty stages) +variable (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) +variable (function : FunctionGraphOn stages indexHistory) +variable (literal : ∀ xi I, ZFSet.pair xi I ∈ indexHistory → RefinementIndexLevelCode I xi) +variable (tests : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop) +variable (recursion : FlatOrdinalCarrierRecursion stages history + (refinementHistoryAssignmentLevels stages indexHistory T) + (fun beta row A => ZFSet.pair row A ∈ + M.stageOneCandidateBound rows (refinementHistoryIndices beta indexHistory) T) tests) +variable (locality : ∀ beta ∈ stages, ∀ row A, + tests beta row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) + (insert beta beta) A) ↔ tests beta row A) +include pairing unions powers separation hStages hIndexHistory hT omega ordinal successors function literal recursion locality + +theorem flatLimitConditions_iff_all_tests (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.flatLimitConditions rows (refinementHistoryIndices stages indexHistory) T + stages history (refinementHistoryAssignmentLevels stages indexHistory T) ↔ + ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementHistoryIndices stages indexHistory) T ∧ + ∀ beta ∈ stages, tests beta row A := by + have levels := M.refinementHistoryAssignmentLevels_mem pairing unions powers separation + hStages hIndexHistory hT + rw [M.mem_flatLimitConditions, flatLimitConditionCode_pair] + apply and_congr_right + intro candidate + exact recursion.cuts_iff_tests ordinal locality successors row A (fun beta member => + M.refinementHistoryCandidate_cut separation function literal (ordinal.1 beta member) + levels (M.transitive hStages member) omega candidate) + +theorem flatLimitConditions_successor_coverage {row A : ZFSet.{u}} + (member : ZFSet.pair row A ∈ + M.flatLimitConditions rows (refinementHistoryIndices stages indexHistory) T stages history + (refinementHistoryAssignmentLevels stages indexHistory T)) : + ∀ beta ∈ stages, ∃ Q Qnext, + ZFSet.pair beta Q ∈ history ∧ ZFSet.pair (insert beta beta) Qnext ∈ history ∧ + ZFSet.pair row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) beta A) ∈ Q ∧ + ZFSet.pair row (assignmentCut (refinementHistoryAssignmentLevels stages indexHistory T) + (insert beta beta) A) ∈ Qnext ∧ tests beta row A := by + have allTests := ((M.flatLimitConditions_iff_all_tests pairing unions powers separation + hStages hIndexHistory hT omega ordinal successors function literal tests recursion locality row A).1 member).2 + have cuts := (flatLimitConditionCode_pair _ _ _ _ _).1 + ((M.mem_flatLimitConditions _ _ _ _ _ _ _).1 member).2 + intro beta hbeta + obtain ⟨Q, entry, lower⟩ := cuts beta hbeta + obtain ⟨Qnext, next, upper⟩ := cuts (insert beta beta) (successors beta hbeta) + exact ⟨Q, Qnext, entry, next, lower, upper, allTests beta hbeta⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAssignmentGraphs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAssignmentGraphs.lean index f9e3144e9375d5e1bd229ca9665cfc9055a4d582..354b19e9686a22fb4c7275cf48dd78e39d28f504 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAssignmentGraphs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAssignmentGraphs.lean @@ -1,147 +1,147 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FlatSuccessorConditions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentProjections - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "code" => FlatSuccessorCondition.code M c s I T levels alpha tests - -noncomputable def flatSuccessorCarrier : ZFSet.{u} := - ZFSet.sep (fun z => ∃ p : Condition, code p = z) (M.stageOneCandidateBound c.carrier I T) - -theorem mem_flatSuccessorCarrier (z : ZFSet.{u}) : - z ∈ M.flatSuccessorCarrier c s I T levels alpha tests ↔ ∃ p : Condition, code p = z := by - rw [flatSuccessorCarrier, ZFSet.mem_sep] - exact ⟨And.right, fun ⟨p, equal⟩ => - ⟨equal ▸ FlatSuccessorCondition.code_mem_candidateBound M c s I T levels alpha tests p, - p, equal⟩⟩ - -theorem flatSuccessorCarrier_subset : - M.flatSuccessorCarrier c s I T levels alpha tests ⊆ M.stageOneCandidateBound c.carrier I T := - fun _ member => (ZFSet.mem_sep.1 member).1 - -theorem pair_mem_flatSuccessorCarrier (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.flatSuccessorCarrier c s I T levels alpha tests ↔ - row ∈ c.carrier ∧ A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega ∧ - ∃ lower : P, s.encode lower = ZFSet.pair row (assignmentCut levels alpha A) ∧ - tests A lower := by - rw [M.mem_flatSuccessorCarrier] - constructor - · rintro ⟨p, equal⟩ - change ZFSet.pair (c.encode p.row) p.assignments = ZFSet.pair row A at equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨c.encode_mem p.row, p.assignments_mem, p.lower, p.lower_code, p.tests⟩ - · rintro ⟨rowMem, small, lower, lowerCode, test⟩ - obtain ⟨r, rfl⟩ := (c.mem_carrier row).1 rowMem - exact ⟨⟨r, A, small, lower, lowerCode, test⟩, rfl⟩ - -theorem flatSuccessorCode_mem (p : Condition) : - code p ∈ M.flatSuccessorCarrier c s I T levels alpha tests := - (M.mem_flatSuccessorCarrier c s I T levels alpha tests _).2 ⟨p, rfl⟩ - -noncomputable def flatSuccessorPresentation : Presentation (Shrink Condition) where - carrier := M.flatSuccessorCarrier c s I T levels alpha tests - encode x := code ((equivShrink Condition).symm x) - injective := (FlatSuccessorCondition.code_injective M c s I T levels alpha tests).comp - (equivShrink Condition).symm.injective - mem_carrier z := by - rw [M.mem_flatSuccessorCarrier] - constructor - · rintro ⟨p, equal⟩ - exact ⟨equivShrink Condition p, by simpa only [Equiv.symm_apply_apply] using equal⟩ - · rintro ⟨x, equal⟩ - exact ⟨(equivShrink Condition).symm x, equal⟩ - -theorem flatSuccessorPresentation_encode (p : Condition) : - (M.flatSuccessorPresentation c s I T levels alpha tests).encode (equivShrink Condition p) = - code p := congrArg code ((equivShrink Condition).symm_apply_apply p) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "Q" => M.flatSuccessorCarrier c s I T levels alpha tests -local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests - -noncomputable def flatSuccessorAssignmentGraph : ZFSet.{u} := rowAssignmentData Q c.carrier B - -theorem flatSuccessorAssignmentGraph_entry (row A x : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair row A) x ∈ M.flatSuccessorAssignmentGraph c s I T levels alpha tests ↔ - ZFSet.pair row A ∈ Q ∧ x = A := by - rw [flatSuccessorAssignmentGraph, rowAssignmentData_entry] - constructor - · rintro ⟨member, _, _, equal⟩ - exact ⟨member, equal⟩ - · rintro ⟨member, equal⟩ - have fields := ZFSet.pair_mem_prod.1 - (M.flatSuccessorCarrier_subset c s I T levels alpha tests member) - exact ⟨member, fields.1, fields.2, equal⟩ - -theorem flatSuccessorAssignmentGraph_function : - ZFSet.IsFunc Q B (M.flatSuccessorAssignmentGraph c s I T levels alpha tests) := - rowAssignmentData_function (M.flatSuccessorCarrier_subset c s I T levels alpha tests) - -noncomputable def flatSuccessorConditionData (q : Shrink Condition) : SetMembers B := - SetMembers.ofMem ((equivShrink Condition).symm q).assignments - ((equivShrink Condition).symm q).assignments_mem - -local notation "data" => M.flatSuccessorConditionData c s I T levels alpha tests - -theorem flatSuccessorConditionData_raw (q : Shrink Condition) : - SetMembers.raw (data q) = ((equivShrink Condition).symm q).assignments := - SetMembers.raw_ofMem _ _ - -theorem flatSuccessorAssignmentGraph_eq_graph : - M.flatSuccessorAssignmentGraph c s I T levels alpha tests = - (pres).graph (SetMembers.presentation B) data := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro member - obtain ⟨raw, hr, x, _, rfl⟩ := ZFSet.mem_prod.1 - ((M.flatSuccessorAssignmentGraph_function c s I T levels alpha tests).1 member) - obtain ⟨q, rfl⟩ := ((pres).mem_carrier raw).1 hr - have value := (M.flatSuccessorAssignmentGraph_entry c s I T levels alpha tests - (c.encode ((equivShrink Condition).symm q).row) - ((equivShrink Condition).symm q).assignments x).1 member - refine ⟨q, ?_⟩ - change ZFSet.pair ((pres).encode q) (SetMembers.raw (data q)) = ZFSet.pair ((pres).encode q) x - rw [M.flatSuccessorConditionData_raw, value.2] - · rintro ⟨q, rfl⟩ - exact (M.flatSuccessorAssignmentGraph_entry c s I T levels alpha tests - (c.encode ((equivShrink Condition).symm q).row) - ((equivShrink Condition).symm q).assignments _).2 - ⟨(pres).encode_mem q, M.flatSuccessorConditionData_raw c s I T levels alpha tests q⟩ - -theorem flatSuccessorAssignmentGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (conditions : Q ∈ M.sets) (rows : c.carrier ∈ M.sets) - (assignments : stageOneAssignments I T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.flatSuccessorAssignmentGraph c s I T levels alpha tests ∈ M.sets := - M.rowAssignmentData_mem pairing unions powers separation conditions rows - (M.groundSmallSubsets_mem powers separation assignments omega) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FlatSuccessorConditions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentProjections + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "code" => FlatSuccessorCondition.code M c s I T levels alpha tests + +noncomputable def flatSuccessorCarrier : ZFSet.{u} := + ZFSet.sep (fun z => ∃ p : Condition, code p = z) (M.stageOneCandidateBound c.carrier I T) + +theorem mem_flatSuccessorCarrier (z : ZFSet.{u}) : + z ∈ M.flatSuccessorCarrier c s I T levels alpha tests ↔ ∃ p : Condition, code p = z := by + rw [flatSuccessorCarrier, ZFSet.mem_sep] + exact ⟨And.right, fun ⟨p, equal⟩ => + ⟨equal ▸ FlatSuccessorCondition.code_mem_candidateBound M c s I T levels alpha tests p, + p, equal⟩⟩ + +theorem flatSuccessorCarrier_subset : + M.flatSuccessorCarrier c s I T levels alpha tests ⊆ M.stageOneCandidateBound c.carrier I T := + fun _ member => (ZFSet.mem_sep.1 member).1 + +theorem pair_mem_flatSuccessorCarrier (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.flatSuccessorCarrier c s I T levels alpha tests ↔ + row ∈ c.carrier ∧ A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega ∧ + ∃ lower : P, s.encode lower = ZFSet.pair row (assignmentCut levels alpha A) ∧ + tests A lower := by + rw [M.mem_flatSuccessorCarrier] + constructor + · rintro ⟨p, equal⟩ + change ZFSet.pair (c.encode p.row) p.assignments = ZFSet.pair row A at equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨c.encode_mem p.row, p.assignments_mem, p.lower, p.lower_code, p.tests⟩ + · rintro ⟨rowMem, small, lower, lowerCode, test⟩ + obtain ⟨r, rfl⟩ := (c.mem_carrier row).1 rowMem + exact ⟨⟨r, A, small, lower, lowerCode, test⟩, rfl⟩ + +theorem flatSuccessorCode_mem (p : Condition) : + code p ∈ M.flatSuccessorCarrier c s I T levels alpha tests := + (M.mem_flatSuccessorCarrier c s I T levels alpha tests _).2 ⟨p, rfl⟩ + +noncomputable def flatSuccessorPresentation : Presentation (Shrink Condition) where + carrier := M.flatSuccessorCarrier c s I T levels alpha tests + encode x := code ((equivShrink Condition).symm x) + injective := (FlatSuccessorCondition.code_injective M c s I T levels alpha tests).comp + (equivShrink Condition).symm.injective + mem_carrier z := by + rw [M.mem_flatSuccessorCarrier] + constructor + · rintro ⟨p, equal⟩ + exact ⟨equivShrink Condition p, by simpa only [Equiv.symm_apply_apply] using equal⟩ + · rintro ⟨x, equal⟩ + exact ⟨(equivShrink Condition).symm x, equal⟩ + +theorem flatSuccessorPresentation_encode (p : Condition) : + (M.flatSuccessorPresentation c s I T levels alpha tests).encode (equivShrink Condition p) = + code p := congrArg code ((equivShrink Condition).symm_apply_apply p) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "Q" => M.flatSuccessorCarrier c s I T levels alpha tests +local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests + +noncomputable def flatSuccessorAssignmentGraph : ZFSet.{u} := rowAssignmentData Q c.carrier B + +theorem flatSuccessorAssignmentGraph_entry (row A x : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair row A) x ∈ M.flatSuccessorAssignmentGraph c s I T levels alpha tests ↔ + ZFSet.pair row A ∈ Q ∧ x = A := by + rw [flatSuccessorAssignmentGraph, rowAssignmentData_entry] + constructor + · rintro ⟨member, _, _, equal⟩ + exact ⟨member, equal⟩ + · rintro ⟨member, equal⟩ + have fields := ZFSet.pair_mem_prod.1 + (M.flatSuccessorCarrier_subset c s I T levels alpha tests member) + exact ⟨member, fields.1, fields.2, equal⟩ + +theorem flatSuccessorAssignmentGraph_function : + ZFSet.IsFunc Q B (M.flatSuccessorAssignmentGraph c s I T levels alpha tests) := + rowAssignmentData_function (M.flatSuccessorCarrier_subset c s I T levels alpha tests) + +noncomputable def flatSuccessorConditionData (q : Shrink Condition) : SetMembers B := + SetMembers.ofMem ((equivShrink Condition).symm q).assignments + ((equivShrink Condition).symm q).assignments_mem + +local notation "data" => M.flatSuccessorConditionData c s I T levels alpha tests + +theorem flatSuccessorConditionData_raw (q : Shrink Condition) : + SetMembers.raw (data q) = ((equivShrink Condition).symm q).assignments := + SetMembers.raw_ofMem _ _ + +theorem flatSuccessorAssignmentGraph_eq_graph : + M.flatSuccessorAssignmentGraph c s I T levels alpha tests = + (pres).graph (SetMembers.presentation B) data := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro member + obtain ⟨raw, hr, x, _, rfl⟩ := ZFSet.mem_prod.1 + ((M.flatSuccessorAssignmentGraph_function c s I T levels alpha tests).1 member) + obtain ⟨q, rfl⟩ := ((pres).mem_carrier raw).1 hr + have value := (M.flatSuccessorAssignmentGraph_entry c s I T levels alpha tests + (c.encode ((equivShrink Condition).symm q).row) + ((equivShrink Condition).symm q).assignments x).1 member + refine ⟨q, ?_⟩ + change ZFSet.pair ((pres).encode q) (SetMembers.raw (data q)) = ZFSet.pair ((pres).encode q) x + rw [M.flatSuccessorConditionData_raw, value.2] + · rintro ⟨q, rfl⟩ + exact (M.flatSuccessorAssignmentGraph_entry c s I T levels alpha tests + (c.encode ((equivShrink Condition).symm q).row) + ((equivShrink Condition).symm q).assignments _).2 + ⟨(pres).encode_mem q, M.flatSuccessorConditionData_raw c s I T levels alpha tests q⟩ + +theorem flatSuccessorAssignmentGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (conditions : Q ∈ M.sets) (rows : c.carrier ∈ M.sets) + (assignments : stageOneAssignments I T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.flatSuccessorAssignmentGraph c s I T levels alpha tests ∈ M.sets := + M.rowAssignmentData_mem pairing unions powers separation conditions rows + (M.groundSmallSubsets_mem powers separation assignments omega) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAtomicTransfer.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAtomicTransfer.lean index 305bd3cf0d8fd8170be9426907e4666d8582232b..910ad4bfcd94c0af209930feeaec8b41f7a91f38 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAtomicTransfer.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorAtomicTransfer.lean @@ -1,53 +1,53 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorNameGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws -local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) -local notation "pi" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F -local notation "projection" => M.flatSuccessorSmallCompleteProjection c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - -include pairing unions powers separation infinite choice hLevels hAlpha - -theorem flatSuccessorNameLift_forcesEq : - letI := smallOrder - ∀ (q : Shrink Condition) (σ τ : Name s), - Name.ForcesEq q (liftName σ) (liftName τ) ↔ Name.ForcesEq (pi q) σ τ := by - let instForcesEqSmallOrder := smallOrder - intro q σ τ - exact Name.forcesEq_rename_completeProjection s (pres) pi inc projection q σ τ - -theorem flatSuccessorNameLift_forcesMem : - letI := smallOrder - ∀ (q : Shrink Condition) (σ τ : Name s), - Name.ForcesMem q (liftName σ) (liftName τ) ↔ Name.ForcesMem (pi q) σ τ := by - let instForcesMemSmallOrder := smallOrder - intro q σ τ - exact Name.forcesMem_rename_completeProjection s (pres) pi inc projection q σ τ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorNameGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws +local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) +local notation "pi" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F +local notation "projection" => M.flatSuccessorSmallCompleteProjection c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + +include pairing unions powers separation infinite choice hLevels hAlpha + +theorem flatSuccessorNameLift_forcesEq : + letI := smallOrder + ∀ (q : Shrink Condition) (σ τ : Name s), + Name.ForcesEq q (liftName σ) (liftName τ) ↔ Name.ForcesEq (pi q) σ τ := by + let instForcesEqSmallOrder := smallOrder + intro q σ τ + exact Name.forcesEq_rename_completeProjection s (pres) pi inc projection q σ τ + +theorem flatSuccessorNameLift_forcesMem : + letI := smallOrder + ∀ (q : Shrink Condition) (σ τ : Name s), + Name.ForcesMem q (liftName σ) (liftName τ) ↔ Name.ForcesMem (pi q) σ τ := by + let instForcesMemSmallOrder := smallOrder + intro q σ τ + exact Name.forcesMem_rename_completeProjection s (pres) pi inc projection q σ τ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorProjectedFilters.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorProjectedFilters.lean index d9fa0a18270a54aab72781cb2eee5bd6c8f49b4d..2a290aa176539c679462d1b522c5029888ebbd6d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorProjectedFilters.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFlatSuccessorProjectedFilters.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorNameGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws -local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) -local notation "pi" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F -local notation "projection" => M.flatSuccessorSmallCompleteProjection c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - -noncomputable def flatSuccessorProjectedFilter : - letI := smallOrder - ConditionFilter (Shrink Condition) → ConditionFilter P := by - letI := smallOrder - exact (projection).projectedFilter - -local notation "project" => M.flatSuccessorProjectedFilter c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - -theorem flatSuccessorProjectedFilter_mem_iff : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (p : P), - (project H).mem p ↔ ∃ q : Shrink Condition, H.mem q ∧ pi q = p := by - let := smallOrder - exact (projection).projectedFilter_mem_iff - -theorem flatSuccessorProjectedFilter_codedGeneric - (lower : s.carrier ∈ M.sets) - (upper : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)), H.GenericFor (M.codedFamily (pres)) → - (project H).GenericFor (M.codedFamily s) := by - let := smallOrder - intro H generic - have graph := M.presentedRowAssignmentCutGraph_mem pairing unions powers separation - pres s pi (fun p => c.encode ((equivShrink Condition).symm p).row) - (fun p => ((equivShrink Condition).symm p).assignments) levels alpha - (fun _ => rfl) (M.flatSuccessorSmallRestriction_encode c s I T levels alpha tests F) - upper lower hLevels hAlpha - exact M.completeProjection_codedGeneric (pres) s (projection) - pairing unions powers separation upper lower graph H generic - -theorem flatSuccessorProjectedFilter_eval : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (tau : Name s), - Name.eval H.mem (liftName tau) = Name.eval (project H).mem tau := by - let := smallOrder - intro H tau - exact M.flatSuccessorNameLift_eval c s I T levels alpha tests F laws H.mem tau - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatSuccessorNameGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws +local notation "liftName" => M.flatSuccessorNameLift c s I T levels alpha tests F laws +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) +local notation "pi" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F +local notation "projection" => M.flatSuccessorSmallCompleteProjection c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + +noncomputable def flatSuccessorProjectedFilter : + letI := smallOrder + ConditionFilter (Shrink Condition) → ConditionFilter P := by + letI := smallOrder + exact (projection).projectedFilter + +local notation "project" => M.flatSuccessorProjectedFilter c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + +theorem flatSuccessorProjectedFilter_mem_iff : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (p : P), + (project H).mem p ↔ ∃ q : Shrink Condition, H.mem q ∧ pi q = p := by + let := smallOrder + exact (projection).projectedFilter_mem_iff + +theorem flatSuccessorProjectedFilter_codedGeneric + (lower : s.carrier ∈ M.sets) + (upper : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)), H.GenericFor (M.codedFamily (pres)) → + (project H).GenericFor (M.codedFamily s) := by + let := smallOrder + intro H generic + have graph := M.presentedRowAssignmentCutGraph_mem pairing unions powers separation + pres s pi (fun p => c.encode ((equivShrink Condition).symm p).row) + (fun p => ((equivShrink Condition).symm p).assignments) levels alpha + (fun _ => rfl) (M.flatSuccessorSmallRestriction_encode c s I T levels alpha tests F) + upper lower hLevels hAlpha + exact M.completeProjection_codedGeneric (pres) s (projection) + pairing unions powers separation upper lower graph H generic + +theorem flatSuccessorProjectedFilter_eval : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (tau : Name s), + Name.eval H.mem (liftName tau) = Name.eval (project H).mem tau := by + let := smallOrder + intro H tau + exact M.flatSuccessorNameLift_eval c s I T levels alpha tests F laws H.mem tau + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFourFlatStageHistories.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFourFlatStageHistories.lean index aeddfc31825467904a0559ddac20b53363939f5a..4b17a41779b4141c8900d9a306cb9ca6c83d285a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFourFlatStageHistories.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundFourFlatStageHistories.lean @@ -1,401 +1,401 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FlatConditionSystems -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatLimitConditions -import OAI.SetTheory.PartitionPrinciple.Forcing.StageTwoAssignmentTestActions - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem flatLimitConditions_restrict {rows I T stages earlier history levels z : ZFSet.{u}} - (member : z ∈ M.flatLimitConditions rows I T stages history levels) (subset : earlier ⊆ stages) : - z ∈ M.flatLimitConditions rows I T earlier (graphRestriction earlier history) levels := by - obtain ⟨candidate, row, A, equal, valid⟩ := (M.mem_flatLimitConditions _ _ _ _ _ _ _).1 member - exact (M.mem_flatLimitConditions _ _ _ _ _ _ _).2 - ⟨candidate, row, A, equal, flatHistoryCuts_restrict valid subset⟩ - -theorem flatLimitConditions_cut - (separation : SeparationSchema M.sets) - {rows I targetI T stages earlier history levels alpha row A : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (member : ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels) - (subset : earlier ⊆ stages) - (nested : ∀ beta ∈ earlier, assignmentCut levels beta (assignmentCut levels alpha A) = - assignmentCut levels beta A) - (target : assignmentCut levels alpha A ⊆ stageOneAssignments targetI T) : - ZFSet.pair row (assignmentCut levels alpha A) ∈ - M.flatLimitConditions rows targetI T earlier (graphRestriction earlier history) levels := by - obtain ⟨hrow, hA, _, small, valid⟩ := (M.pair_mem_flatLimitConditions _ _ _ _ _ _ _ _).1 member - exact (M.pair_mem_flatLimitConditions _ _ _ _ _ _ _ _).2 - ⟨hrow, M.assignmentCut_mem separation hLevels hAlpha hA, target, - M.assignmentCut_small separation hLevels hAlpha hA omega small, - flatHistoryCuts_cut valid subset nested⟩ - -theorem flatLimitConditions_cut_of_subset - (separation : SeparationSchema M.sets) - {rows I targetI T stages earlier history levels alpha row A : ZFSet.{u}} - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (member : ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels) - (subset : earlier ⊆ stages) (below : ∀ beta ∈ earlier, beta ⊆ alpha) - (target : assignmentCut levels alpha A ⊆ stageOneAssignments targetI T) : - ZFSet.pair row (assignmentCut levels alpha A) ∈ - M.flatLimitConditions rows targetI T earlier (graphRestriction earlier history) levels := - M.flatLimitConditions_cut separation hLevels hAlpha omega member subset - (fun beta hbeta => assignmentCut_nested (below beta hbeta)) target - -theorem flatLimitConditions_lookup {rows I T stages history levels row A beta Q : ZFSet.{u}} - (member : ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels) - (function : FunctionGraphOn stages history) (hbeta : beta ∈ stages) - (entry : ZFSet.pair beta Q ∈ history) : - ZFSet.pair row (assignmentCut levels beta A) ∈ Q := by - have valid := ((M.pair_mem_flatLimitConditions _ _ _ _ _ _ _ _).1 member).2.2.2.2 - exact (flatHistoryCuts_lookup_iff function).1 valid beta hbeta Q entry - -theorem flatLimitConditions_eq_of_stage {rows I T stages history levels alpha Q : ZFSet.{u}} - (function : FunctionGraphOn stages history) (halpha : alpha ∈ stages) - (entry : ZFSet.pair alpha Q ∈ history) - (shape : Q ⊆ M.stageOneCandidateBound rows I T) - (valid : ∀ row A, ZFSet.pair row A ∈ Q → FlatHistoryCuts stages history levels row A) - (full : ∀ row A, ZFSet.pair row A ∈ M.stageOneCandidateBound rows I T → - assignmentCut levels alpha A = A) : - M.flatLimitConditions rows I T stages history levels = Q := by - apply ZFSet.ext - intro z - constructor - · intro member - have candidate := ((M.mem_flatLimitConditions _ _ _ _ _ _ _).1 member).1 - obtain ⟨row, _, A, _, _, _, rfl⟩ := (M.mem_stageOneCandidateBound rows I T z).1 candidate - have lower := M.flatLimitConditions_lookup member function halpha entry - exact full row A candidate ▸ lower - · intro member - have candidate := shape member - obtain ⟨row, _, A, _, _, _, equal⟩ := (M.mem_stageOneCandidateBound rows I T z).1 candidate - exact (M.mem_flatLimitConditions _ _ _ _ _ _ _).2 - ⟨candidate, row, A, equal, valid row A (equal ▸ member)⟩ - -end TransitiveGround - -section -universe u -variable {I0 I1 I2 T : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (third : RefinementIndexLevelCode I2 (natSetCode 2)) -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -include first second third - -theorem stageThreeAssignmentCut_nat (n : Nat) (A : ZFSet.{u}) : - assignmentCut levels (natSetCode n) A = - ZFSet.sep (fun z => (z ∈ stageOneAssignments I0 T ∧ 0 < n) ∨ - (z ∈ stageOneAssignments I1 T ∧ 1 < n) ∨ - (z ∈ stageOneAssignments I2 T ∧ 2 < n)) A := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut, ZFSet.mem_sep] - constructor - · rintro ⟨hz, level, hl, entry⟩ - rcases (pair_mem_stageThreeAssignmentLevels first second third z level).1 entry with - ⟨h0, rfl⟩ | ⟨h1, rfl⟩ | ⟨h2, rfl⟩ - · exact ⟨hz, Or.inl ⟨h0, (natSetCode_mem_iff 0 n).1 hl⟩⟩ - · exact ⟨hz, Or.inr (Or.inl ⟨h1, (natSetCode_mem_iff 1 n).1 hl⟩)⟩ - · exact ⟨hz, Or.inr (Or.inr ⟨h2, (natSetCode_mem_iff 2 n).1 hl⟩)⟩ - · rintro ⟨hz, h0 | h1 | h2⟩ - · exact ⟨hz, natSetCode 0, (natSetCode_mem_iff 0 n).2 h0.2, - (pair_mem_stageThreeAssignmentLevels first second third z _).2 (Or.inl ⟨h0.1, rfl⟩)⟩ - · exact ⟨hz, natSetCode 1, (natSetCode_mem_iff 1 n).2 h1.2, - (pair_mem_stageThreeAssignmentLevels first second third z _).2 (Or.inr (Or.inl ⟨h1.1, rfl⟩))⟩ - · exact ⟨hz, natSetCode 2, (natSetCode_mem_iff 2 n).2 h2.2, - (pair_mem_stageThreeAssignmentLevels first second third z _).2 (Or.inr (Or.inr ⟨h2.1, rfl⟩))⟩ - -theorem stageThreeAssignmentCut_one (A : ZFSet.{u}) : - assignmentCut levels (natSetCode 1) A = - ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) A := by - rw [stageThreeAssignmentCut_nat first second third] - apply ZFSet.ext - intro z - simp only [ZFSet.mem_sep] - simp - -theorem stageThreeAssignmentCut_two (A : ZFSet.{u}) : - assignmentCut levels (natSetCode 2) A = - ZFSet.sep (fun z => z ∈ stageOneAssignments (I0 ∪ I1) T) A := by - rw [stageThreeAssignmentCut_nat first second third, stageOneAssignments_union] - apply ZFSet.ext - intro z - simp only [ZFSet.mem_sep, ZFSet.mem_union] - simp - -theorem stageThreeAssignmentCut_three {A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments ((I0 ∪ I1) ∪ I2) T) : - assignmentCut levels (natSetCode 3) A = A := - assignmentCut_full (stageThreeAssignmentLevels_function first second third) subset - -theorem stageThreeAssignmentCut_two_eq {A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments (I0 ∪ I1) T) : - assignmentCut levels (natSetCode 2) A = A := by - rw [stageThreeAssignmentCut_two first second third] - apply ZFSet.ext - intro z - exact ⟨fun hz => (ZFSet.mem_sep.1 hz).1, fun hz => ZFSet.mem_sep.2 ⟨hz, subset hz⟩⟩ - -theorem stageThreeAssignmentCut_one_old (A : ZFSet.{u}) : - assignmentCut levels (natSetCode 1) A = - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A := by - rw [stageThreeAssignmentCut_one first second third, stageTwoAssignmentCut_one first second] - -theorem stageThreeAssignmentCut_nested (A : ZFSet.{u}) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) - (assignmentCut levels (natSetCode 2) A) = assignmentCut levels (natSetCode 1) A := by - rw [← stageThreeAssignmentCut_one_old first second third] - exact assignmentCut_nested (show (natSetCode 1 : ZFSet.{u}) ⊆ natSetCode 2 from - fun _ hx => by - rw [natSetCode_succ] - exact ZFSet.mem_insert_of_mem _ hx) - -end - -section -open SetRealization -universe u - -def fourFlatStageValues (Q0 Q1 Q2 Q3 : ZFSet.{u}) : Nat → ZFSet.{u} - | 0 => Q0 - | 1 => Q1 - | 2 => Q2 - | _ => Q3 - -private theorem flatCoordinates {M : TransitiveGround.{u}} {R P : Type u} - [PartialOrder R] [PartialOrder P] {c : Presentation R} {s : Presentation P} {J : ZFSet.{u}} - (F : FlatConditionSystem M c s J) {row A : ZFSet.{u}} - (member : ZFSet.pair row A ∈ s.carrier) : - ∃ p : P, c.encode (F.row p) = row ∧ F.assignments p = A := by - obtain ⟨p, equal⟩ := (s.mem_carrier _).1 member - rw [F.encode] at equal - exact ⟨p, ZFSet.pair_inj.1 equal⟩ - -variable (M : TransitiveGround.{u}) {R P1 P2 P3 : Type u} -variable [PartialOrder R] [PartialOrder P1] [PartialOrder P2] [PartialOrder P3] -variable (c : Presentation R) (s1 : Presentation P1) (s2 : Presentation P2) (s3 : Presentation P3) -variable (I0 I1 I2 T : ZFSet.{u}) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) -variable (F1 : FlatConditionSystem M c s1 (stageOneAssignments I0 T)) -variable (F2 : FlatConditionSystem M c s2 (stageOneAssignments (I0 ∪ I1) T)) -variable (F3 : FlatConditionSystem M c s3 (stageOneAssignments ((I0 ∪ I1) ∪ I2) T)) -local notation "values" => fourFlatStageValues c.pairEmpty.carrier s1.carrier s2.carrier s3.carrier -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T - -include F1 F2 F3 - -theorem fourFlatStageValues_flat : - ∀ i < 4, ∀ z ∈ values i, ∃ row A, z = ZFSet.pair row A := by - intro i hi z hz - have cases : i = 0 ∨ i = 1 ∨ i = 2 ∨ i = 3 := by omega - rcases cases with rfl | rfl | rfl | rfl - · obtain ⟨p, rfl⟩ := (c.pairEmpty.mem_carrier z).1 hz - exact ⟨c.encode p, ∅, rfl⟩ - · obtain ⟨p, rfl⟩ := (s1.mem_carrier z).1 hz - exact ⟨c.encode (F1.row p), F1.assignments p, F1.encode p⟩ - · obtain ⟨p, rfl⟩ := (s2.mem_carrier z).1 hz - exact ⟨c.encode (F2.row p), F2.assignments p, F2.encode p⟩ - · obtain ⟨p, rfl⟩ := (s3.mem_carrier z).1 hz - exact ⟨c.encode (F3.row p), F3.assignments p, F3.encode p⟩ - -include first second third in -theorem fourFlatStageValues_self : - ∀ i < 4, ∀ row A, ZFSet.pair row A ∈ values i → - assignmentCut levels (natSetCode i) A = A := by - intro i hi row A member - have cases : i = 0 ∨ i = 1 ∨ i = 2 ∨ i = 3 := by omega - rcases cases with rfl | rfl | rfl | rfl - · obtain ⟨p, equal⟩ := (c.pairEmpty.mem_carrier _).1 member - have pair : ZFSet.pair (c.encode p) ∅ = ZFSet.pair row A := equal - obtain ⟨_, rfl⟩ := ZFSet.pair_inj.1 pair - apply ZFSet.ext - intro z - simp only [mem_assignmentCut, ZFSet.notMem_empty, false_and] - · obtain ⟨p, _, rfl⟩ := flatCoordinates F1 member - have subset := ((M.mem_groundSmallSubsets _ _ _).1 (F1.assignments_mem p)).2.1 - rw [stageThreeAssignmentCut_one first second third] - apply ZFSet.ext - intro z - exact ⟨fun hz => (ZFSet.mem_sep.1 hz).1, fun hz => ZFSet.mem_sep.2 ⟨hz, subset hz⟩⟩ - · obtain ⟨p, _, rfl⟩ := flatCoordinates F2 member - exact stageThreeAssignmentCut_two_eq first second third - ((M.mem_groundSmallSubsets _ _ _).1 (F2.assignments_mem p)).2.1 - · obtain ⟨p, _, rfl⟩ := flatCoordinates F3 member - exact stageThreeAssignmentCut_three first second third - ((M.mem_groundSmallSubsets _ _ _).1 (F3.assignments_mem p)).2.1 - -variable (r21 : P2 → P1) (r32 : P3 → P2) -variable (code21 : ∀ p, s1.encode (r21 p) = ZFSet.pair (c.encode (F2.row p)) - (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) (F2.assignments p))) -variable (code32 : ∀ p, s2.encode (r32 p) = ZFSet.pair (c.encode (F3.row p)) - (assignmentCut (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) (F3.assignments p))) -include F1 code21 code32 first second third - -theorem fourFlatStageValues_adjacent : - ∀ i, i + 1 < 4 → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → - ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i := by - intro i hi row A member - have cases : i = 0 ∨ i = 1 ∨ i = 2 := by omega - rcases cases with rfl | rfl | rfl - · obtain ⟨p, rfl, rfl⟩ := flatCoordinates F1 member - have empty : assignmentCut levels (natSetCode 0) (F1.assignments p) = ∅ := by - apply ZFSet.ext - intro z - simp only [mem_assignmentCut, natSetCode_zero, ZFSet.notMem_empty, false_and, exists_false, and_false] - rw [empty] - exact c.pairEmpty.encode_mem (F1.row p) - · obtain ⟨p, rfl, rfl⟩ := flatCoordinates F2 member - rw [stageThreeAssignmentCut_one_old first second third] - exact code21 p ▸ s1.encode_mem (r21 p) - · obtain ⟨p, rfl, rfl⟩ := flatCoordinates F3 member - exact code32 p ▸ s2.encode_mem (r32 p) - -theorem fourFlatStageValues_history (row A : ZFSet.{u}) - (member : ZFSet.pair row A ∈ s3.carrier) : - FlatHistoryCuts (natSetCode 4) (finiteStageHistory values 4) levels row A := - finiteFlatCuts_history values 4 levels - (fourFlatStageValues_self M c s1 s2 s3 I0 I1 I2 T first second third F1 F2 F3) - (fourFlatStageValues_adjacent M c s1 s2 s3 I0 I1 I2 T first second third F1 F2 F3 - r21 r32 code21 code32) (by decide : 3 < 4) row A member - -end - -section -universe u -variable {I0 I1 I2 T : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) - (third : RefinementIndexLevelCode I2 (natSetCode 2)) -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -include first second third - -theorem stageThreeAssignment_upper_not_lower {t u w : ZFSet.{u}} (upperIndex : t ∈ I2) : - stageOneAssignment t u w ∉ stageOneAssignments (I0 ∪ I1) T := by - intro member - have lowerIndex := ((stageOneAssignment_mem_assignments (I0 ∪ I1) T t u w).1 member).1 - rcases ZFSet.mem_union.1 lowerIndex with h0 | h1 - · exact first.disjoint third (fun h => (by decide : (0 : Nat) ≠ 2) (natSetCode_injective h)) t - ⟨h0, upperIndex⟩ - · exact second.disjoint third (fun h => (by decide : (1 : Nat) ≠ 2) (natSetCode_injective h)) t - ⟨h1, upperIndex⟩ - -theorem stageThreeAssignment_upper_not_cut (A : ZFSet.{u}) {t u w : ZFSet.{u}} - (upperIndex : t ∈ I2) : - stageOneAssignment t u w ∉ assignmentCut levels (natSetCode 2) A := by - rw [stageThreeAssignmentCut_two first second third] - exact fun member => stageThreeAssignment_upper_not_lower first second third upperIndex - (ZFSet.mem_sep.1 member).2 - -theorem stageThreeAssignmentSplice_upper_iff (Aq Ap : ZFSet.{u}) {t u w : ZFSet.{u}} - (upperIndex : t ∈ I2) : - stageOneAssignment t u w ∈ assignmentSplice levels (natSetCode 2) Aq Ap ↔ - stageOneAssignment t u w ∈ Ap := by - rw [assignmentSplice, ZFSet.mem_union, assignmentUpper, ZFSet.mem_sep] - have noLower := stageThreeAssignment_upper_not_cut (T := T) first second third Aq - (u := u) (w := w) upperIndex - have noOldCut := stageThreeAssignment_upper_not_cut (T := T) first second third Ap - (u := u) (w := w) upperIndex - exact ⟨fun h => h.elim (fun lower => False.elim (noLower lower)) And.left, - fun member => Or.inr ⟨member, noOldCut⟩⟩ - -theorem stageThreeAssignment_old_no_upper {A t u w : ZFSet.{u}} - (subsetOld : A ⊆ stageOneAssignments (I0 ∪ I1) T) (upperIndex : t ∈ I2) : - stageOneAssignment t u w ∉ A := - fun member => stageThreeAssignment_upper_not_lower first second third upperIndex (subsetOld member) - -theorem stageThreeAssignmentSplice_lower_eq {Aq : ZFSet.{u}} (Ap : ZFSet.{u}) - (subsetOld : Aq ⊆ stageOneAssignments (I0 ∪ I1) T) : - assignmentCut levels (natSetCode 2) (assignmentSplice levels (natSetCode 2) Aq Ap) = Aq := by - rw [assignmentCut_splice, stageThreeAssignmentCut_two_eq first second third subsetOld] - -theorem stageThreeAssignmentSplice_first_cut (Aq Ap : ZFSet.{u}) : - assignmentCut levels (natSetCode 1) (assignmentSplice levels (natSetCode 2) Aq Ap) = - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq := by - rw [assignmentCut_splice_below (show (natSetCode 1 : ZFSet.{u}) ⊆ natSetCode 2 from - fun _ hx => by - rw [natSetCode_succ] - exact ZFSet.mem_insert_of_mem _ hx)] - exact stageThreeAssignmentCut_one_old first second third Aq - -theorem stageThreeAssignmentSplice_extends {Aq Ap : ZFSet.{u}} - (subsetOld : Aq ⊆ stageOneAssignments (I0 ∪ I1) T) - (extension : assignmentCut levels (natSetCode 2) Ap ⊆ Aq) : - Ap ⊆ assignmentSplice levels (natSetCode 2) Aq Ap := by - apply assignmentSplice_extends - rw [stageThreeAssignmentCut_two_eq first second third subsetOld] - exact extension - -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P1 P2 P3 : Type u} -variable [PartialOrder R] [PartialOrder P1] [PartialOrder P2] [PartialOrder P3] -variable (c : Presentation R) (s1 : Presentation P1) (s2 : Presentation P2) (s3 : Presentation P3) -local notation "values" => fourFlatStageValues c.pairEmpty.carrier s1.carrier s2.carrier s3.carrier - -omit [PartialOrder R] [PartialOrder P1] [PartialOrder P2] [PartialOrder P3] in -theorem fourFlatStageHistory_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (rows : c.carrier ∈ M.sets) (h1 : s1.carrier ∈ M.sets) - (h2 : s2.carrier ∈ M.sets) (h3 : s3.carrier ∈ M.sets) : - finiteStageHistory values 4 ∈ M.sets := by - apply M.finiteStageHistory_mem pairing unions separation infinite - intro i hi - have cases : i = 0 ∨ i = 1 ∨ i = 2 ∨ i = 3 := by omega - rcases cases with rfl | rfl | rfl | rfl - · exact M.pairEmpty_carrier_mem pairing unions powers separation c rows - · exact h1 - · exact h2 - · exact h3 - -variable (I0 I1 I2 T : ZFSet.{u}) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) -variable (F1 : FlatConditionSystem M c s1 (stageOneAssignments I0 T)) -variable (F2 : FlatConditionSystem M c s2 (stageOneAssignments (I0 ∪ I1) T)) -variable (F3 : FlatConditionSystem M c s3 (stageOneAssignments ((I0 ∪ I1) ∪ I2) T)) -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -variable (r21 : P2 → P1) (r32 : P3 → P2) -variable (code21 : ∀ p, s1.encode (r21 p) = ZFSet.pair (c.encode (F2.row p)) - (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) (F2.assignments p))) -variable (code32 : ∀ p, s2.encode (r32 p) = ZFSet.pair (c.encode (F3.row p)) - (assignmentCut (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) (F3.assignments p))) -include F1 F2 F3 first second third code21 code32 - -theorem fourFlatStageLimit_eq : - M.flatLimitConditions c.carrier ((I0 ∪ I1) ∪ I2) T (natSetCode 4) - (finiteStageHistory values 4) levels = s3.carrier := by - apply M.flatLimitConditions_eq_of_stage (finiteStageHistory_function values 4) - ((natSetCode_mem_iff 3 4).2 (by decide)) - ((pair_mem_finiteStageHistory values 4 3 s3.carrier).2 ⟨by decide, rfl⟩) - · intro z member - obtain ⟨p, rfl⟩ := (s3.mem_carrier z).1 member - rw [F3.encode p] - obtain ⟨ground, subset, small⟩ := (M.mem_groundSmallSubsets _ _ _).1 (F3.assignments_mem p) - exact (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 - ⟨c.encode_mem (F3.row p), ground, subset, small⟩ - · exact fourFlatStageValues_history M c s1 s2 s3 I0 I1 I2 T first second third F1 F2 F3 - r21 r32 code21 code32 - · intro row A candidate - exact stageThreeAssignmentCut_three first second third - ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate).2.2.1 - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FlatConditionSystems +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFlatLimitConditions +import OAI.SetTheory.PartitionPrinciple.Forcing.StageTwoAssignmentTestActions + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem flatLimitConditions_restrict {rows I T stages earlier history levels z : ZFSet.{u}} + (member : z ∈ M.flatLimitConditions rows I T stages history levels) (subset : earlier ⊆ stages) : + z ∈ M.flatLimitConditions rows I T earlier (graphRestriction earlier history) levels := by + obtain ⟨candidate, row, A, equal, valid⟩ := (M.mem_flatLimitConditions _ _ _ _ _ _ _).1 member + exact (M.mem_flatLimitConditions _ _ _ _ _ _ _).2 + ⟨candidate, row, A, equal, flatHistoryCuts_restrict valid subset⟩ + +theorem flatLimitConditions_cut + (separation : SeparationSchema M.sets) + {rows I targetI T stages earlier history levels alpha row A : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (member : ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels) + (subset : earlier ⊆ stages) + (nested : ∀ beta ∈ earlier, assignmentCut levels beta (assignmentCut levels alpha A) = + assignmentCut levels beta A) + (target : assignmentCut levels alpha A ⊆ stageOneAssignments targetI T) : + ZFSet.pair row (assignmentCut levels alpha A) ∈ + M.flatLimitConditions rows targetI T earlier (graphRestriction earlier history) levels := by + obtain ⟨hrow, hA, _, small, valid⟩ := (M.pair_mem_flatLimitConditions _ _ _ _ _ _ _ _).1 member + exact (M.pair_mem_flatLimitConditions _ _ _ _ _ _ _ _).2 + ⟨hrow, M.assignmentCut_mem separation hLevels hAlpha hA, target, + M.assignmentCut_small separation hLevels hAlpha hA omega small, + flatHistoryCuts_cut valid subset nested⟩ + +theorem flatLimitConditions_cut_of_subset + (separation : SeparationSchema M.sets) + {rows I targetI T stages earlier history levels alpha row A : ZFSet.{u}} + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (member : ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels) + (subset : earlier ⊆ stages) (below : ∀ beta ∈ earlier, beta ⊆ alpha) + (target : assignmentCut levels alpha A ⊆ stageOneAssignments targetI T) : + ZFSet.pair row (assignmentCut levels alpha A) ∈ + M.flatLimitConditions rows targetI T earlier (graphRestriction earlier history) levels := + M.flatLimitConditions_cut separation hLevels hAlpha omega member subset + (fun beta hbeta => assignmentCut_nested (below beta hbeta)) target + +theorem flatLimitConditions_lookup {rows I T stages history levels row A beta Q : ZFSet.{u}} + (member : ZFSet.pair row A ∈ M.flatLimitConditions rows I T stages history levels) + (function : FunctionGraphOn stages history) (hbeta : beta ∈ stages) + (entry : ZFSet.pair beta Q ∈ history) : + ZFSet.pair row (assignmentCut levels beta A) ∈ Q := by + have valid := ((M.pair_mem_flatLimitConditions _ _ _ _ _ _ _ _).1 member).2.2.2.2 + exact (flatHistoryCuts_lookup_iff function).1 valid beta hbeta Q entry + +theorem flatLimitConditions_eq_of_stage {rows I T stages history levels alpha Q : ZFSet.{u}} + (function : FunctionGraphOn stages history) (halpha : alpha ∈ stages) + (entry : ZFSet.pair alpha Q ∈ history) + (shape : Q ⊆ M.stageOneCandidateBound rows I T) + (valid : ∀ row A, ZFSet.pair row A ∈ Q → FlatHistoryCuts stages history levels row A) + (full : ∀ row A, ZFSet.pair row A ∈ M.stageOneCandidateBound rows I T → + assignmentCut levels alpha A = A) : + M.flatLimitConditions rows I T stages history levels = Q := by + apply ZFSet.ext + intro z + constructor + · intro member + have candidate := ((M.mem_flatLimitConditions _ _ _ _ _ _ _).1 member).1 + obtain ⟨row, _, A, _, _, _, rfl⟩ := (M.mem_stageOneCandidateBound rows I T z).1 candidate + have lower := M.flatLimitConditions_lookup member function halpha entry + exact full row A candidate ▸ lower + · intro member + have candidate := shape member + obtain ⟨row, _, A, _, _, _, equal⟩ := (M.mem_stageOneCandidateBound rows I T z).1 candidate + exact (M.mem_flatLimitConditions _ _ _ _ _ _ _).2 + ⟨candidate, row, A, equal, valid row A (equal ▸ member)⟩ + +end TransitiveGround + +section +universe u +variable {I0 I1 I2 T : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (third : RefinementIndexLevelCode I2 (natSetCode 2)) +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +include first second third + +theorem stageThreeAssignmentCut_nat (n : Nat) (A : ZFSet.{u}) : + assignmentCut levels (natSetCode n) A = + ZFSet.sep (fun z => (z ∈ stageOneAssignments I0 T ∧ 0 < n) ∨ + (z ∈ stageOneAssignments I1 T ∧ 1 < n) ∨ + (z ∈ stageOneAssignments I2 T ∧ 2 < n)) A := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut, ZFSet.mem_sep] + constructor + · rintro ⟨hz, level, hl, entry⟩ + rcases (pair_mem_stageThreeAssignmentLevels first second third z level).1 entry with + ⟨h0, rfl⟩ | ⟨h1, rfl⟩ | ⟨h2, rfl⟩ + · exact ⟨hz, Or.inl ⟨h0, (natSetCode_mem_iff 0 n).1 hl⟩⟩ + · exact ⟨hz, Or.inr (Or.inl ⟨h1, (natSetCode_mem_iff 1 n).1 hl⟩)⟩ + · exact ⟨hz, Or.inr (Or.inr ⟨h2, (natSetCode_mem_iff 2 n).1 hl⟩)⟩ + · rintro ⟨hz, h0 | h1 | h2⟩ + · exact ⟨hz, natSetCode 0, (natSetCode_mem_iff 0 n).2 h0.2, + (pair_mem_stageThreeAssignmentLevels first second third z _).2 (Or.inl ⟨h0.1, rfl⟩)⟩ + · exact ⟨hz, natSetCode 1, (natSetCode_mem_iff 1 n).2 h1.2, + (pair_mem_stageThreeAssignmentLevels first second third z _).2 (Or.inr (Or.inl ⟨h1.1, rfl⟩))⟩ + · exact ⟨hz, natSetCode 2, (natSetCode_mem_iff 2 n).2 h2.2, + (pair_mem_stageThreeAssignmentLevels first second third z _).2 (Or.inr (Or.inr ⟨h2.1, rfl⟩))⟩ + +theorem stageThreeAssignmentCut_one (A : ZFSet.{u}) : + assignmentCut levels (natSetCode 1) A = + ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) A := by + rw [stageThreeAssignmentCut_nat first second third] + apply ZFSet.ext + intro z + simp only [ZFSet.mem_sep] + simp + +theorem stageThreeAssignmentCut_two (A : ZFSet.{u}) : + assignmentCut levels (natSetCode 2) A = + ZFSet.sep (fun z => z ∈ stageOneAssignments (I0 ∪ I1) T) A := by + rw [stageThreeAssignmentCut_nat first second third, stageOneAssignments_union] + apply ZFSet.ext + intro z + simp only [ZFSet.mem_sep, ZFSet.mem_union] + simp + +theorem stageThreeAssignmentCut_three {A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments ((I0 ∪ I1) ∪ I2) T) : + assignmentCut levels (natSetCode 3) A = A := + assignmentCut_full (stageThreeAssignmentLevels_function first second third) subset + +theorem stageThreeAssignmentCut_two_eq {A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments (I0 ∪ I1) T) : + assignmentCut levels (natSetCode 2) A = A := by + rw [stageThreeAssignmentCut_two first second third] + apply ZFSet.ext + intro z + exact ⟨fun hz => (ZFSet.mem_sep.1 hz).1, fun hz => ZFSet.mem_sep.2 ⟨hz, subset hz⟩⟩ + +theorem stageThreeAssignmentCut_one_old (A : ZFSet.{u}) : + assignmentCut levels (natSetCode 1) A = + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A := by + rw [stageThreeAssignmentCut_one first second third, stageTwoAssignmentCut_one first second] + +theorem stageThreeAssignmentCut_nested (A : ZFSet.{u}) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) + (assignmentCut levels (natSetCode 2) A) = assignmentCut levels (natSetCode 1) A := by + rw [← stageThreeAssignmentCut_one_old first second third] + exact assignmentCut_nested (show (natSetCode 1 : ZFSet.{u}) ⊆ natSetCode 2 from + fun _ hx => by + rw [natSetCode_succ] + exact ZFSet.mem_insert_of_mem _ hx) + +end + +section +open SetRealization +universe u + +def fourFlatStageValues (Q0 Q1 Q2 Q3 : ZFSet.{u}) : Nat → ZFSet.{u} + | 0 => Q0 + | 1 => Q1 + | 2 => Q2 + | _ => Q3 + +private theorem flatCoordinates {M : TransitiveGround.{u}} {R P : Type u} + [PartialOrder R] [PartialOrder P] {c : Presentation R} {s : Presentation P} {J : ZFSet.{u}} + (F : FlatConditionSystem M c s J) {row A : ZFSet.{u}} + (member : ZFSet.pair row A ∈ s.carrier) : + ∃ p : P, c.encode (F.row p) = row ∧ F.assignments p = A := by + obtain ⟨p, equal⟩ := (s.mem_carrier _).1 member + rw [F.encode] at equal + exact ⟨p, ZFSet.pair_inj.1 equal⟩ + +variable (M : TransitiveGround.{u}) {R P1 P2 P3 : Type u} +variable [PartialOrder R] [PartialOrder P1] [PartialOrder P2] [PartialOrder P3] +variable (c : Presentation R) (s1 : Presentation P1) (s2 : Presentation P2) (s3 : Presentation P3) +variable (I0 I1 I2 T : ZFSet.{u}) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) +variable (F1 : FlatConditionSystem M c s1 (stageOneAssignments I0 T)) +variable (F2 : FlatConditionSystem M c s2 (stageOneAssignments (I0 ∪ I1) T)) +variable (F3 : FlatConditionSystem M c s3 (stageOneAssignments ((I0 ∪ I1) ∪ I2) T)) +local notation "values" => fourFlatStageValues c.pairEmpty.carrier s1.carrier s2.carrier s3.carrier +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T + +include F1 F2 F3 + +theorem fourFlatStageValues_flat : + ∀ i < 4, ∀ z ∈ values i, ∃ row A, z = ZFSet.pair row A := by + intro i hi z hz + have cases : i = 0 ∨ i = 1 ∨ i = 2 ∨ i = 3 := by omega + rcases cases with rfl | rfl | rfl | rfl + · obtain ⟨p, rfl⟩ := (c.pairEmpty.mem_carrier z).1 hz + exact ⟨c.encode p, ∅, rfl⟩ + · obtain ⟨p, rfl⟩ := (s1.mem_carrier z).1 hz + exact ⟨c.encode (F1.row p), F1.assignments p, F1.encode p⟩ + · obtain ⟨p, rfl⟩ := (s2.mem_carrier z).1 hz + exact ⟨c.encode (F2.row p), F2.assignments p, F2.encode p⟩ + · obtain ⟨p, rfl⟩ := (s3.mem_carrier z).1 hz + exact ⟨c.encode (F3.row p), F3.assignments p, F3.encode p⟩ + +include first second third in +theorem fourFlatStageValues_self : + ∀ i < 4, ∀ row A, ZFSet.pair row A ∈ values i → + assignmentCut levels (natSetCode i) A = A := by + intro i hi row A member + have cases : i = 0 ∨ i = 1 ∨ i = 2 ∨ i = 3 := by omega + rcases cases with rfl | rfl | rfl | rfl + · obtain ⟨p, equal⟩ := (c.pairEmpty.mem_carrier _).1 member + have pair : ZFSet.pair (c.encode p) ∅ = ZFSet.pair row A := equal + obtain ⟨_, rfl⟩ := ZFSet.pair_inj.1 pair + apply ZFSet.ext + intro z + simp only [mem_assignmentCut, ZFSet.notMem_empty, false_and] + · obtain ⟨p, _, rfl⟩ := flatCoordinates F1 member + have subset := ((M.mem_groundSmallSubsets _ _ _).1 (F1.assignments_mem p)).2.1 + rw [stageThreeAssignmentCut_one first second third] + apply ZFSet.ext + intro z + exact ⟨fun hz => (ZFSet.mem_sep.1 hz).1, fun hz => ZFSet.mem_sep.2 ⟨hz, subset hz⟩⟩ + · obtain ⟨p, _, rfl⟩ := flatCoordinates F2 member + exact stageThreeAssignmentCut_two_eq first second third + ((M.mem_groundSmallSubsets _ _ _).1 (F2.assignments_mem p)).2.1 + · obtain ⟨p, _, rfl⟩ := flatCoordinates F3 member + exact stageThreeAssignmentCut_three first second third + ((M.mem_groundSmallSubsets _ _ _).1 (F3.assignments_mem p)).2.1 + +variable (r21 : P2 → P1) (r32 : P3 → P2) +variable (code21 : ∀ p, s1.encode (r21 p) = ZFSet.pair (c.encode (F2.row p)) + (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) (F2.assignments p))) +variable (code32 : ∀ p, s2.encode (r32 p) = ZFSet.pair (c.encode (F3.row p)) + (assignmentCut (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) (F3.assignments p))) +include F1 code21 code32 first second third + +theorem fourFlatStageValues_adjacent : + ∀ i, i + 1 < 4 → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → + ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i := by + intro i hi row A member + have cases : i = 0 ∨ i = 1 ∨ i = 2 := by omega + rcases cases with rfl | rfl | rfl + · obtain ⟨p, rfl, rfl⟩ := flatCoordinates F1 member + have empty : assignmentCut levels (natSetCode 0) (F1.assignments p) = ∅ := by + apply ZFSet.ext + intro z + simp only [mem_assignmentCut, natSetCode_zero, ZFSet.notMem_empty, false_and, exists_false, and_false] + rw [empty] + exact c.pairEmpty.encode_mem (F1.row p) + · obtain ⟨p, rfl, rfl⟩ := flatCoordinates F2 member + rw [stageThreeAssignmentCut_one_old first second third] + exact code21 p ▸ s1.encode_mem (r21 p) + · obtain ⟨p, rfl, rfl⟩ := flatCoordinates F3 member + exact code32 p ▸ s2.encode_mem (r32 p) + +theorem fourFlatStageValues_history (row A : ZFSet.{u}) + (member : ZFSet.pair row A ∈ s3.carrier) : + FlatHistoryCuts (natSetCode 4) (finiteStageHistory values 4) levels row A := + finiteFlatCuts_history values 4 levels + (fourFlatStageValues_self M c s1 s2 s3 I0 I1 I2 T first second third F1 F2 F3) + (fourFlatStageValues_adjacent M c s1 s2 s3 I0 I1 I2 T first second third F1 F2 F3 + r21 r32 code21 code32) (by decide : 3 < 4) row A member + +end + +section +universe u +variable {I0 I1 I2 T : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) + (third : RefinementIndexLevelCode I2 (natSetCode 2)) +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +include first second third + +theorem stageThreeAssignment_upper_not_lower {t u w : ZFSet.{u}} (upperIndex : t ∈ I2) : + stageOneAssignment t u w ∉ stageOneAssignments (I0 ∪ I1) T := by + intro member + have lowerIndex := ((stageOneAssignment_mem_assignments (I0 ∪ I1) T t u w).1 member).1 + rcases ZFSet.mem_union.1 lowerIndex with h0 | h1 + · exact first.disjoint third (fun h => (by decide : (0 : Nat) ≠ 2) (natSetCode_injective h)) t + ⟨h0, upperIndex⟩ + · exact second.disjoint third (fun h => (by decide : (1 : Nat) ≠ 2) (natSetCode_injective h)) t + ⟨h1, upperIndex⟩ + +theorem stageThreeAssignment_upper_not_cut (A : ZFSet.{u}) {t u w : ZFSet.{u}} + (upperIndex : t ∈ I2) : + stageOneAssignment t u w ∉ assignmentCut levels (natSetCode 2) A := by + rw [stageThreeAssignmentCut_two first second third] + exact fun member => stageThreeAssignment_upper_not_lower first second third upperIndex + (ZFSet.mem_sep.1 member).2 + +theorem stageThreeAssignmentSplice_upper_iff (Aq Ap : ZFSet.{u}) {t u w : ZFSet.{u}} + (upperIndex : t ∈ I2) : + stageOneAssignment t u w ∈ assignmentSplice levels (natSetCode 2) Aq Ap ↔ + stageOneAssignment t u w ∈ Ap := by + rw [assignmentSplice, ZFSet.mem_union, assignmentUpper, ZFSet.mem_sep] + have noLower := stageThreeAssignment_upper_not_cut (T := T) first second third Aq + (u := u) (w := w) upperIndex + have noOldCut := stageThreeAssignment_upper_not_cut (T := T) first second third Ap + (u := u) (w := w) upperIndex + exact ⟨fun h => h.elim (fun lower => False.elim (noLower lower)) And.left, + fun member => Or.inr ⟨member, noOldCut⟩⟩ + +theorem stageThreeAssignment_old_no_upper {A t u w : ZFSet.{u}} + (subsetOld : A ⊆ stageOneAssignments (I0 ∪ I1) T) (upperIndex : t ∈ I2) : + stageOneAssignment t u w ∉ A := + fun member => stageThreeAssignment_upper_not_lower first second third upperIndex (subsetOld member) + +theorem stageThreeAssignmentSplice_lower_eq {Aq : ZFSet.{u}} (Ap : ZFSet.{u}) + (subsetOld : Aq ⊆ stageOneAssignments (I0 ∪ I1) T) : + assignmentCut levels (natSetCode 2) (assignmentSplice levels (natSetCode 2) Aq Ap) = Aq := by + rw [assignmentCut_splice, stageThreeAssignmentCut_two_eq first second third subsetOld] + +theorem stageThreeAssignmentSplice_first_cut (Aq Ap : ZFSet.{u}) : + assignmentCut levels (natSetCode 1) (assignmentSplice levels (natSetCode 2) Aq Ap) = + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq := by + rw [assignmentCut_splice_below (show (natSetCode 1 : ZFSet.{u}) ⊆ natSetCode 2 from + fun _ hx => by + rw [natSetCode_succ] + exact ZFSet.mem_insert_of_mem _ hx)] + exact stageThreeAssignmentCut_one_old first second third Aq + +theorem stageThreeAssignmentSplice_extends {Aq Ap : ZFSet.{u}} + (subsetOld : Aq ⊆ stageOneAssignments (I0 ∪ I1) T) + (extension : assignmentCut levels (natSetCode 2) Ap ⊆ Aq) : + Ap ⊆ assignmentSplice levels (natSetCode 2) Aq Ap := by + apply assignmentSplice_extends + rw [stageThreeAssignmentCut_two_eq first second third subsetOld] + exact extension + +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P1 P2 P3 : Type u} +variable [PartialOrder R] [PartialOrder P1] [PartialOrder P2] [PartialOrder P3] +variable (c : Presentation R) (s1 : Presentation P1) (s2 : Presentation P2) (s3 : Presentation P3) +local notation "values" => fourFlatStageValues c.pairEmpty.carrier s1.carrier s2.carrier s3.carrier + +omit [PartialOrder R] [PartialOrder P1] [PartialOrder P2] [PartialOrder P3] in +theorem fourFlatStageHistory_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (rows : c.carrier ∈ M.sets) (h1 : s1.carrier ∈ M.sets) + (h2 : s2.carrier ∈ M.sets) (h3 : s3.carrier ∈ M.sets) : + finiteStageHistory values 4 ∈ M.sets := by + apply M.finiteStageHistory_mem pairing unions separation infinite + intro i hi + have cases : i = 0 ∨ i = 1 ∨ i = 2 ∨ i = 3 := by omega + rcases cases with rfl | rfl | rfl | rfl + · exact M.pairEmpty_carrier_mem pairing unions powers separation c rows + · exact h1 + · exact h2 + · exact h3 + +variable (I0 I1 I2 T : ZFSet.{u}) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +variable (third : RefinementIndexLevelCode I2 (natSetCode 2)) +variable (F1 : FlatConditionSystem M c s1 (stageOneAssignments I0 T)) +variable (F2 : FlatConditionSystem M c s2 (stageOneAssignments (I0 ∪ I1) T)) +variable (F3 : FlatConditionSystem M c s3 (stageOneAssignments ((I0 ∪ I1) ∪ I2) T)) +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +variable (r21 : P2 → P1) (r32 : P3 → P2) +variable (code21 : ∀ p, s1.encode (r21 p) = ZFSet.pair (c.encode (F2.row p)) + (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) (F2.assignments p))) +variable (code32 : ∀ p, s2.encode (r32 p) = ZFSet.pair (c.encode (F3.row p)) + (assignmentCut (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) (F3.assignments p))) +include F1 F2 F3 first second third code21 code32 + +theorem fourFlatStageLimit_eq : + M.flatLimitConditions c.carrier ((I0 ∪ I1) ∪ I2) T (natSetCode 4) + (finiteStageHistory values 4) levels = s3.carrier := by + apply M.flatLimitConditions_eq_of_stage (finiteStageHistory_function values 4) + ((natSetCode_mem_iff 3 4).2 (by decide)) + ((pair_mem_finiteStageHistory values 4 3 s3.carrier).2 ⟨by decide, rfl⟩) + · intro z member + obtain ⟨p, rfl⟩ := (s3.mem_carrier z).1 member + rw [F3.encode p] + obtain ⟨ground, subset, small⟩ := (M.mem_groundSmallSubsets _ _ _).1 (F3.assignments_mem p) + exact (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 + ⟨c.encode_mem (F3.row p), ground, subset, small⟩ + · exact fourFlatStageValues_history M c s1 s2 s3 I0 I1 I2 T first second third F1 F2 F3 + r21 r32 code21 code32 + · intro row A candidate + exact stageThreeAssignmentCut_three first second third + ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate).2.2.1 + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryFields.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryFields.lean index 14cdc30271ce5483bb286c5aaae7427e93bda0cf..cf516db61c1857a783db1339ac8bc3af51fa22ce 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryFields.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryFields.lean @@ -1,123 +1,123 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.HistoryFieldFormulas - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundStateFieldFamily - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - {history : ZFSet.{u}} (hHistory : history ∈ M.sets) - (states : Nat → RecursiveStateData.{u}) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = (states n).code) - (j : Fin 13) : - ∃ family ∈ M.sets, FunctionGraphOn ZFSet.omega family ∧ - ∀ n y, ZFSet.pair (natSetCode n) y ∈ family ↔ y = (states n).field j := by - let params := extend history Fin.elim0 - have paramsM : ∀ i, params i ∈ M.sets := Fin.cases hHistory (fun i => Fin.elim0 i) - have fieldsM (n : Nat) : (states n).field j ∈ M.sets := - M.recursiveStateData_field_mem (states n) - (M.pair_right (M.transitive hHistory ((entries n _).2 rfl))) j - have naturalM (n : Nat) : natSetCode n ∈ M.sets := M.transitive hω (natSetCode_mem_omega n) - have total : ∀ x ∈ M.sets, x ∈ ZFSet.omega → ∃ z ∈ M.sets, - Realize M.sets (historyFieldPairFormula 0 1 2 j) (extend x (extend z params)) ∧ - ∀ w ∈ M.sets, - Realize M.sets (historyFieldPairFormula 0 1 2 j) (extend x (extend w params)) → w = z := by - intro x hx hxω - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hxω - have pairM := M.orderedPair_mem pairing hx (fieldsM n) - refine ⟨ZFSet.pair (natSetCode n) ((states n).field j), pairM, ?_, ?_⟩ - · exact (M.realize_historyFieldPairFormula 0 1 2 j _ - (Fin.cases hx (Fin.cases pairM paramsM)) states entries n rfl).2 rfl - · intro w hw specified - exact (M.realize_historyFieldPairFormula 0 1 2 j _ - (Fin.cases hx (Fin.cases hw paramsM)) states entries n rfl).1 specified - obtain ⟨family, hFamily, image⟩ := replacement_of_collection_separation M.sets collection separation - (historyFieldPairFormula 0 1 2 j) params paramsM ZFSet.omega hω total - have allEntries (z : ZFSet.{u}) : - z ∈ family ↔ ∃ n, z = ZFSet.pair (natSetCode n) ((states n).field j) := by - constructor - · intro member - have hz := M.transitive hFamily member - obtain ⟨x, hx, hxω, specified⟩ := (image z hz).1 member - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hxω - exact ⟨n, (M.realize_historyFieldPairFormula 0 1 2 j _ - (Fin.cases hx (Fin.cases hz paramsM)) states entries n rfl).1 specified⟩ - · rintro ⟨n, rfl⟩ - have pairM := M.orderedPair_mem pairing (naturalM n) (fieldsM n) - apply (image _ pairM).2 - exact ⟨natSetCode n, naturalM n, natSetCode_mem_omega n, - (M.realize_historyFieldPairFormula 0 1 2 j _ - (Fin.cases (naturalM n) (Fin.cases pairM paramsM)) states entries n rfl).2 rfl⟩ - have exactEntries (n : Nat) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode n) y ∈ family ↔ y = (states n).field j := by - rw [allEntries] - constructor - · rintro ⟨m, equal⟩ - obtain ⟨index, value⟩ := ZFSet.pair_inj.1 equal - have same : n = m := natSetCode_injective index - exact same ▸ value - · intro equal - exact ⟨n, congrArg (ZFSet.pair (natSetCode n)) equal⟩ - refine ⟨family, hFamily, ⟨⋃₀ ⋃₀ family, ?_, ?_⟩, exactEntries⟩ - · intro z member - obtain ⟨n, rfl⟩ := (allEntries z).1 member - exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, pair_second_mem_doubleUnion member⟩ - · intro x hx - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx - refine ⟨(states n).field j, (exactEntries n _).2 rfl, ?_⟩ - intro y hy - exact (exactEntries n y).1 hy - -theorem exists_groundStateFieldUnion - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) - {history : ZFSet.{u}} (hHistory : history ∈ M.sets) - (states : Nat → RecursiveStateData.{u}) - (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = (states n).code) - (j : Fin 13) : - ∃ family ∈ M.sets, ∃ range ∈ M.sets, ∃ union ∈ M.sets, - FunctionGraphOn ZFSet.omega family ∧ - (∀ n y, ZFSet.pair (natSetCode n) y ∈ family ↔ y = (states n).field j) ∧ - (∀ y, y ∈ range ↔ ∃ n, y = (states n).field j) ∧ - union = ⋃₀ range ∧ (∀ x, x ∈ union ↔ ∃ n, x ∈ (states n).field j) := by - obtain ⟨family, hFamily, function, exactEntries⟩ := - M.exists_groundStateFieldFamily pairing separation collection hω hHistory states entries j - let range := relationImage ZFSet.omega (⋃₀ ⋃₀ family) family - have hRange := M.relationImage_mem separation hω (M.union_mem unions (M.union_mem unions hFamily)) hFamily - have exactRange (y : ZFSet.{u}) : y ∈ range ↔ ∃ n, y = (states n).field j := by - rw [mem_relationImage] - constructor - · rintro ⟨_, x, hx, entry⟩ - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx - exact ⟨n, (exactEntries n y).1 entry⟩ - · rintro ⟨n, equal⟩ - have entry := (exactEntries n y).2 equal - exact ⟨pair_second_mem_doubleUnion entry, natSetCode n, natSetCode_mem_omega n, entry⟩ - refine ⟨family, hFamily, range, hRange, ⋃₀ range, M.union_mem unions hRange, - function, exactEntries, exactRange, rfl, ?_⟩ - intro x - rw [ZFSet.mem_sUnion] - constructor - · rintro ⟨field, member, hx⟩ - obtain ⟨n, equal⟩ := (exactRange field).1 member - exact ⟨n, equal ▸ hx⟩ - · rintro ⟨n, hx⟩ - exact ⟨(states n).field j, (exactRange _).2 ⟨n, rfl⟩, hx⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.HistoryFieldFormulas + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundStateFieldFamily + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + {history : ZFSet.{u}} (hHistory : history ∈ M.sets) + (states : Nat → RecursiveStateData.{u}) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = (states n).code) + (j : Fin 13) : + ∃ family ∈ M.sets, FunctionGraphOn ZFSet.omega family ∧ + ∀ n y, ZFSet.pair (natSetCode n) y ∈ family ↔ y = (states n).field j := by + let params := extend history Fin.elim0 + have paramsM : ∀ i, params i ∈ M.sets := Fin.cases hHistory (fun i => Fin.elim0 i) + have fieldsM (n : Nat) : (states n).field j ∈ M.sets := + M.recursiveStateData_field_mem (states n) + (M.pair_right (M.transitive hHistory ((entries n _).2 rfl))) j + have naturalM (n : Nat) : natSetCode n ∈ M.sets := M.transitive hω (natSetCode_mem_omega n) + have total : ∀ x ∈ M.sets, x ∈ ZFSet.omega → ∃ z ∈ M.sets, + Realize M.sets (historyFieldPairFormula 0 1 2 j) (extend x (extend z params)) ∧ + ∀ w ∈ M.sets, + Realize M.sets (historyFieldPairFormula 0 1 2 j) (extend x (extend w params)) → w = z := by + intro x hx hxω + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hxω + have pairM := M.orderedPair_mem pairing hx (fieldsM n) + refine ⟨ZFSet.pair (natSetCode n) ((states n).field j), pairM, ?_, ?_⟩ + · exact (M.realize_historyFieldPairFormula 0 1 2 j _ + (Fin.cases hx (Fin.cases pairM paramsM)) states entries n rfl).2 rfl + · intro w hw specified + exact (M.realize_historyFieldPairFormula 0 1 2 j _ + (Fin.cases hx (Fin.cases hw paramsM)) states entries n rfl).1 specified + obtain ⟨family, hFamily, image⟩ := replacement_of_collection_separation M.sets collection separation + (historyFieldPairFormula 0 1 2 j) params paramsM ZFSet.omega hω total + have allEntries (z : ZFSet.{u}) : + z ∈ family ↔ ∃ n, z = ZFSet.pair (natSetCode n) ((states n).field j) := by + constructor + · intro member + have hz := M.transitive hFamily member + obtain ⟨x, hx, hxω, specified⟩ := (image z hz).1 member + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hxω + exact ⟨n, (M.realize_historyFieldPairFormula 0 1 2 j _ + (Fin.cases hx (Fin.cases hz paramsM)) states entries n rfl).1 specified⟩ + · rintro ⟨n, rfl⟩ + have pairM := M.orderedPair_mem pairing (naturalM n) (fieldsM n) + apply (image _ pairM).2 + exact ⟨natSetCode n, naturalM n, natSetCode_mem_omega n, + (M.realize_historyFieldPairFormula 0 1 2 j _ + (Fin.cases (naturalM n) (Fin.cases pairM paramsM)) states entries n rfl).2 rfl⟩ + have exactEntries (n : Nat) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode n) y ∈ family ↔ y = (states n).field j := by + rw [allEntries] + constructor + · rintro ⟨m, equal⟩ + obtain ⟨index, value⟩ := ZFSet.pair_inj.1 equal + have same : n = m := natSetCode_injective index + exact same ▸ value + · intro equal + exact ⟨n, congrArg (ZFSet.pair (natSetCode n)) equal⟩ + refine ⟨family, hFamily, ⟨⋃₀ ⋃₀ family, ?_, ?_⟩, exactEntries⟩ + · intro z member + obtain ⟨n, rfl⟩ := (allEntries z).1 member + exact ZFSet.pair_mem_prod.2 ⟨natSetCode_mem_omega n, pair_second_mem_doubleUnion member⟩ + · intro x hx + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx + refine ⟨(states n).field j, (exactEntries n _).2 rfl, ?_⟩ + intro y hy + exact (exactEntries n y).1 hy + +theorem exists_groundStateFieldUnion + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (hω : (ZFSet.omega : ZFSet.{u}) ∈ M.sets) + {history : ZFSet.{u}} (hHistory : history ∈ M.sets) + (states : Nat → RecursiveStateData.{u}) + (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ y = (states n).code) + (j : Fin 13) : + ∃ family ∈ M.sets, ∃ range ∈ M.sets, ∃ union ∈ M.sets, + FunctionGraphOn ZFSet.omega family ∧ + (∀ n y, ZFSet.pair (natSetCode n) y ∈ family ↔ y = (states n).field j) ∧ + (∀ y, y ∈ range ↔ ∃ n, y = (states n).field j) ∧ + union = ⋃₀ range ∧ (∀ x, x ∈ union ↔ ∃ n, x ∈ (states n).field j) := by + obtain ⟨family, hFamily, function, exactEntries⟩ := + M.exists_groundStateFieldFamily pairing separation collection hω hHistory states entries j + let range := relationImage ZFSet.omega (⋃₀ ⋃₀ family) family + have hRange := M.relationImage_mem separation hω (M.union_mem unions (M.union_mem unions hFamily)) hFamily + have exactRange (y : ZFSet.{u}) : y ∈ range ↔ ∃ n, y = (states n).field j := by + rw [mem_relationImage] + constructor + · rintro ⟨_, x, hx, entry⟩ + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode x).1 hx + exact ⟨n, (exactEntries n y).1 entry⟩ + · rintro ⟨n, equal⟩ + have entry := (exactEntries n y).2 equal + exact ⟨pair_second_mem_doubleUnion entry, natSetCode n, natSetCode_mem_omega n, entry⟩ + refine ⟨family, hFamily, range, hRange, ⋃₀ range, M.union_mem unions hRange, + function, exactEntries, exactRange, rfl, ?_⟩ + intro x + rw [ZFSet.mem_sUnion] + constructor + · rintro ⟨field, member, hx⟩ + obtain ⟨n, equal⟩ := (exactRange field).1 member + exact ⟨n, equal ▸ hx⟩ + · rintro ⟨n, hx⟩ + exact ⟨(states n).field j, (exactRange _).2 ⟨n, rfl⟩, hx⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryUnionBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryUnionBounds.lean index 9dc55733e3ee8e30b058f3a56d3273590f4f7b2b..53dc0a47f76d60697270cc9b80c9097c5b918f41 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryUnionBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundHistoryUnionBounds.lean @@ -1,288 +1,288 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowInitialCompression -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRawRefinementDataIdentification -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.GroundInaccessibleConditions -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hK : K ∈ M.sets) -include conditions pairing unions powers separation hK - -theorem product {A B : ZFSet.{u}} - (first : A ∈ M.sets ∧ GroundBelow M A K) (second : B ∈ M.sets ∧ GroundBelow M B K) : - ZFSet.prod A B ∈ M.sets ∧ GroundBelow M (ZFSet.prod A B) K := - ⟨M.prod_mem pairing unions powers separation first.1 second.1, - GroundBelow.product pairing unions powers separation first.1 second.1 hK - conditions.1 conditions.2.2.2 first.2 second.2⟩ - -theorem power {A : ZFSet.{u}} (small : A ∈ M.sets ∧ GroundBelow M A K) : - M.groundPower A ∈ M.sets ∧ GroundBelow M (M.groundPower A) K := - ⟨M.groundPower_mem powers small.1, - conditions.2.2.2.power_closed pairing unions powers separation small.1 hK small.2⟩ - -include infinite in -theorem singleton {a : ZFSet.{u}} (ha : a ∈ M.sets) : - ({a} : ZFSet.{u}) ∈ M.sets ∧ GroundBelow M ({a} : ZFSet.{u}) K := by - refine ⟨?_, GroundBelow.singleton pairing unions powers separation infinite hK conditions.2.1 ha⟩ - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ha ha - -include infinite in -theorem natural (n : Nat) : natSetCode n ∈ M.sets ∧ GroundBelow M (natSetCode n) K := - ⟨M.natSetCode_mem separation infinite n, - GroundBelow.of_member pairing unions powers separation hK - (conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega n))⟩ - -include infinite choice in -theorem binary_union {A B : ZFSet.{u}} - (first : A ∈ M.sets ∧ GroundBelow M A K) (second : B ∈ M.sets ∧ GroundBelow M B K) : - A ∪ B ∈ M.sets ∧ GroundBelow M (A ∪ B) K := - ⟨M.binary_union_mem pairing unions first.1 second.1, - GroundBelow.binary_union pairing unions powers separation infinite choice first.1 second.1 hK - conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 first.2 second.2⟩ - -include choice in -theorem sUnion {R : ZFSet.{u}} (family : R ∈ M.sets ∧ GroundBelow M R K) - (small : ∀ A ∈ R, GroundBelow M A K) : - (⋃₀ R) ∈ M.sets ∧ GroundBelow M (⋃₀ R) K := - ⟨M.union_mem unions family.1, GroundBelow.sUnion pairing unions powers separation choice family.1 hK - conditions.1 conditions.2.2.1 conditions.2.2.2 family.2 small⟩ - -end PartitionPilot.Forcing.GroundInaccessibleConditions - -namespace PartitionPilot.Forcing.GroundInaccessibleConditions -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hK : K ∈ M.sets) -include conditions pairing unions powers separation infinite choice hK - -theorem finite_family_union (n : Nat) (family : Fin n → ZFSet.{u}) - (small : ∀ i, family i ∈ M.sets ∧ GroundBelow M (family i) K) : - ∃ U, U ∈ M.sets ∧ GroundBelow M U K ∧ - ∀ x, x ∈ U ↔ ∃ i, x ∈ family i := by - induction n with - | zero => - refine ⟨∅, M.empty_mem ⟨K, hK⟩, - (GroundBelow.empty_iff hK).2 ⟨ZFSet.omega, conditions.2.1⟩, ?_⟩ - intro x - constructor - · intro h - exact False.elim (ZFSet.notMem_empty x h) - · rintro ⟨i, _⟩ - exact Fin.elim0 i - | succ n ih => - obtain ⟨U, hU, smallU, members⟩ := ih (fun i => family i.succ) (fun i => small i.succ) - have whole := conditions.binary_union pairing unions powers separation infinite choice hK - (small 0) ⟨hU, smallU⟩ - refine ⟨family 0 ∪ U, whole.1, whole.2, ?_⟩ - intro x - rw [ZFSet.mem_union, members] - constructor - · rintro (first | ⟨i, later⟩) - · exact ⟨0, first⟩ - · exact ⟨i.succ, later⟩ - · rintro ⟨i, member⟩ - exact Fin.cases (fun h => Or.inl h) - (fun j h => Or.inr ⟨j, h⟩) i member - -end PartitionPilot.Forcing.GroundInaccessibleConditions - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (separation : SeparationSchema M.sets) -variable {n : Nat} {f : (Fin (n + 1) → ZFSet.{u}) → ZFSet.{u}} - -noncomputable def historyUnionStepDefinition (defined : GroundDefinableFunction M f) : - GroundDefinableFunction M (fun env : Fin (n + 2) → ZFSet.{u} => - f (extend (refinementHistoryIndices (env 0) (env 1)) (fun j => env j.succ.succ))) := by - let earlier := (M.definable_historyUnion pairing unions separation).reindex - ![(0 : Fin (n + 2)), 1] - exact defined.comp (Fin.cases earlier - (fun j => GroundDefinableFunction.projection M j.succ.succ)) - -include pairing unions separation in -theorem exists_historyUnionTrace (collection : CollectionSchema M.sets) - (defined : GroundDefinableFunction M f) (params : Fin n → ZFSet.{u}) - (members : ∀ j, params j ∈ M.sets) - {stages : ZFSet.{u}} (hs : stages ∈ M.sets) (ordinal : ordinalSetProperty stages) : - ∃ history ∈ M.sets, OrdinalRecursionTrace - (fun alpha prior output => output = f (extend (refinementHistoryIndices alpha prior) params)) - stages history := by - let operation := M.historyUnionStepDefinition pairing unions separation defined - let slots : Fin (n + 3) → Fin (n + 3) := - Fin.cases 2 (Fin.cases 0 (Fin.cases 1 (fun j => j.succ.succ.succ))) - let formula := SetFormula.reindex slots operation.formula - have recognize (alpha prior output : ZFSet.{u}) (ha : alpha ∈ M.sets) - (hp : prior ∈ M.sets) (ho : output ∈ M.sets) : - Realize M.sets formula (extend alpha (extend prior (extend output params))) ↔ - output = f (extend (refinementHistoryIndices alpha prior) params) := by - rw [show formula = SetFormula.reindex slots operation.formula from rfl, realize_reindex] - have eqEnv : (fun i => extend alpha (extend prior (extend output params)) (slots i)) = - extend output (extend alpha (extend prior params)) := by - funext i - exact Fin.cases rfl (fun j => Fin.cases rfl (fun k => Fin.cases rfl (fun _ => rfl) k) j) i - rw [eqEnv] - exact operation.correct (extend alpha (extend prior params)) - (Fin.cases ha (Fin.cases hp members)) output ho - have closure : GroundOrdinalStepClosure M stages formula params := by - intro alpha member prior hp _ - have ha := M.transitive hs member - have outputGround := operation.closed (extend alpha (extend prior params)) - (Fin.cases ha (Fin.cases hp members)) - refine ⟨_, outputGround, (recognize alpha prior _ ha hp outputGround).2 rfl, ?_⟩ - intro z hz relation - exact (recognize alpha prior z ha hp hz).1 relation - obtain ⟨history, hh, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection - hs ordinal formula params members closure - refine ⟨history, hh, trace.1, ?_⟩ - intro alpha member output entry - have step := trace.2 alpha member output entry - exact (recognize alpha _ output (M.transitive hs member) step.1 step.2.1).1 step.2.2 - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable {I K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (phi : ZFSet.{u} → ZFSet.{u}) -variable (preserves : ∀ X ∈ M.sets, X ⊆ I → GroundBelow M X K → - phi X ⊆ I ∧ GroundBelow M (phi X) K) -include pairing unions powers separation choice hK conditions preserves - -theorem historyUnionTrace_below : - ∀ stages ∈ K, ∀ history ∈ M.sets, - OrdinalRecursionTrace (fun alpha prior output => output = phi (refinementHistoryIndices alpha prior)) - stages history → - (∀ alpha Y, ZFSet.pair alpha Y ∈ history → Y ⊆ I ∧ GroundBelow M Y K) ∧ - refinementHistoryIndices stages history ⊆ I ∧ - GroundBelow M (refinementHistoryIndices stages history) K := by - intro stages - induction stages using ZFSet.inductionOn with - | h stages ih => - intro hStages history hh trace - have hs := M.transitive hK hStages - have ordinal := ordinalSetProperty_member conditions.1 hStages - have fibers : ∀ alpha Y, ZFSet.pair alpha Y ∈ history → Y ⊆ I ∧ GroundBelow M Y K := by - intro alpha Y entry - have member := trace.1.pair_source entry - have ha := M.transitive hs member - have lower := ih alpha member (conditions.1.1 stages hStages alpha member) - (graphRestriction alpha history) (M.graphRestriction_mem unions separation ha hh) - (trace.restrict (ordinalSetProperty_member ordinal member) (ordinal.1 alpha member)) - have earlierGround := M.refinementHistoryIndices_mem unions separation ha - (M.graphRestriction_mem unions separation ha hh) - have result := preserves _ earlierGround lower.2.1 lower.2.2 - exact (trace.2 alpha member Y entry).symm ▸ result - refine ⟨fibers, ?_, ?_⟩ - · intro x hx - obtain ⟨alpha, _, Y, entry, inside⟩ := (mem_refinementHistoryIndices stages history x).1 hx - exact (fibers alpha Y entry).1 inside - · exact GroundBelow.indexed_sUnion pairing unions powers separation choice hs - (M.union_mem unions (M.union_mem unions hh)) hh hK conditions.1 - conditions.2.2.1 conditions.2.2.2 (GroundBelow.of_member pairing unions powers separation hK hStages) - trace.1.to_isFunc (fun alpha Y entry => (fibers alpha Y entry).2) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -include pairing unions powers separation infinite hK conditions - -theorem refinementIndexBound_below {level nodes T1 T2 P : ZFSet.{u}} - (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) - (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hP : P ∈ M.sets) - (smallNodes : GroundBelow M nodes K) (smallT1 : GroundBelow M T1 K) - (smallT2 : GroundBelow M T2 K) (smallP : GroundBelow M P K) : - refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P) ∈ M.sets ∧ - GroundBelow M (refinementIndexBound {level} nodes - (M.groundRelations T1 P) (M.groundRelations T2 P)) K := by - have first : M.groundRelations T1 P ∈ M.sets ∧ GroundBelow M (M.groundRelations T1 P) K := - ⟨M.groundRelations_mem pairing unions powers separation hT1 hP, - GroundBelow.relations pairing unions powers separation hT1 hP hK - conditions.1 conditions.2.2.2 smallT1 smallP⟩ - have second : M.groundRelations T2 P ∈ M.sets ∧ GroundBelow M (M.groundRelations T2 P) K := - ⟨M.groundRelations_mem pairing unions powers separation hT2 hP, - GroundBelow.relations pairing unions powers separation hT2 hP hK - conditions.1 conditions.2.2.2 smallT2 smallP⟩ - have node : nodes ∈ M.sets ∧ GroundBelow M nodes K := ⟨hn, smallNodes⟩ - have tag := conditions.singleton pairing unions powers separation infinite hK hl - exact conditions.product pairing unions powers separation hK tag - (conditions.product pairing unions powers separation hK node - (conditions.product pairing unions powers separation hK node - (conditions.product pairing unions powers separation hK first - (conditions.product pairing unions powers separation hK second second)))) - -theorem refinementIndices_below - {level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}} - (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) (hr : r ∈ M.sets) - (hc : candidates ∈ M.sets) (hrel : relations ∈ M.sets) - (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hT : T ∈ M.sets) - (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) - (smallNodes : GroundBelow M nodes K) (smallT1 : GroundBelow M T1 K) - (smallT2 : GroundBelow M T2 K) (smallP : GroundBelow M P K) : - M.refinementIndices level nodes r candidates relations T1 T2 T P order top ∈ M.sets ∧ - GroundBelow M (M.refinementIndices level nodes r candidates relations T1 T2 T P order top) K := by - have ground := M.refinementIndices_mem pairing unions powers separation - hl hn hr hc hrel hT1 hT2 hT hP ho ht - have bound := M.refinementIndexBound_below pairing unions powers separation infinite hK conditions - hl hn hT1 hT2 hP smallNodes smallT1 smallT2 smallP - exact ⟨ground, bound.2.restrict separation ground hK (fun _ member => (ZFSet.mem_sep.1 member).1)⟩ - -theorem rawRefinementFormulaData_indices_below - (collection : CollectionSchema M.sets) - (P order top action G nodes nodeOrder basis T T2 level : ZFSet.{u}) - (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) (ha : action ∈ M.sets) - (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) - (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hl : level ∈ M.sets) - (smallP : GroundBelow M P K) (smallNodes : GroundBelow M nodes K) - (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) : - M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0 ∈ M.sets ∧ - GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) K := by - let params : Fin 11 → ZFSet.{u} := ![P, order, top, action, G, nodes, nodeOrder, basis, T, T2, level] - have members : ∀ j, params j ∈ M.sets := Fin.cases hP (Fin.cases ho (Fin.cases ht - (Fin.cases ha (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb - (Fin.cases hT (Fin.cases hT2 (Fin.cases hl (fun j => Fin.elim0 j))))))))))) - have code := (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).closed params members - have ground := M.nonemptyTupleCode_field_mem 14 - (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level) code 0 - have bound := M.refinementIndexBound_below pairing unions powers separation infinite hK conditions - hl hn hT hT2 hP smallNodes smallT smallT2 smallP - exact ⟨ground, bound.2.restrict separation ground hK (fun _ member => (ZFSet.mem_sep.1 member).1)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowInitialCompression +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRawRefinementDataIdentification +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementHistoryPrefixLevels + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.GroundInaccessibleConditions +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hK : K ∈ M.sets) +include conditions pairing unions powers separation hK + +theorem product {A B : ZFSet.{u}} + (first : A ∈ M.sets ∧ GroundBelow M A K) (second : B ∈ M.sets ∧ GroundBelow M B K) : + ZFSet.prod A B ∈ M.sets ∧ GroundBelow M (ZFSet.prod A B) K := + ⟨M.prod_mem pairing unions powers separation first.1 second.1, + GroundBelow.product pairing unions powers separation first.1 second.1 hK + conditions.1 conditions.2.2.2 first.2 second.2⟩ + +theorem power {A : ZFSet.{u}} (small : A ∈ M.sets ∧ GroundBelow M A K) : + M.groundPower A ∈ M.sets ∧ GroundBelow M (M.groundPower A) K := + ⟨M.groundPower_mem powers small.1, + conditions.2.2.2.power_closed pairing unions powers separation small.1 hK small.2⟩ + +include infinite in +theorem singleton {a : ZFSet.{u}} (ha : a ∈ M.sets) : + ({a} : ZFSet.{u}) ∈ M.sets ∧ GroundBelow M ({a} : ZFSet.{u}) K := by + refine ⟨?_, GroundBelow.singleton pairing unions powers separation infinite hK conditions.2.1 ha⟩ + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ha ha + +include infinite in +theorem natural (n : Nat) : natSetCode n ∈ M.sets ∧ GroundBelow M (natSetCode n) K := + ⟨M.natSetCode_mem separation infinite n, + GroundBelow.of_member pairing unions powers separation hK + (conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega n))⟩ + +include infinite choice in +theorem binary_union {A B : ZFSet.{u}} + (first : A ∈ M.sets ∧ GroundBelow M A K) (second : B ∈ M.sets ∧ GroundBelow M B K) : + A ∪ B ∈ M.sets ∧ GroundBelow M (A ∪ B) K := + ⟨M.binary_union_mem pairing unions first.1 second.1, + GroundBelow.binary_union pairing unions powers separation infinite choice first.1 second.1 hK + conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 first.2 second.2⟩ + +include choice in +theorem sUnion {R : ZFSet.{u}} (family : R ∈ M.sets ∧ GroundBelow M R K) + (small : ∀ A ∈ R, GroundBelow M A K) : + (⋃₀ R) ∈ M.sets ∧ GroundBelow M (⋃₀ R) K := + ⟨M.union_mem unions family.1, GroundBelow.sUnion pairing unions powers separation choice family.1 hK + conditions.1 conditions.2.2.1 conditions.2.2.2 family.2 small⟩ + +end PartitionPilot.Forcing.GroundInaccessibleConditions + +namespace PartitionPilot.Forcing.GroundInaccessibleConditions +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hK : K ∈ M.sets) +include conditions pairing unions powers separation infinite choice hK + +theorem finite_family_union (n : Nat) (family : Fin n → ZFSet.{u}) + (small : ∀ i, family i ∈ M.sets ∧ GroundBelow M (family i) K) : + ∃ U, U ∈ M.sets ∧ GroundBelow M U K ∧ + ∀ x, x ∈ U ↔ ∃ i, x ∈ family i := by + induction n with + | zero => + refine ⟨∅, M.empty_mem ⟨K, hK⟩, + (GroundBelow.empty_iff hK).2 ⟨ZFSet.omega, conditions.2.1⟩, ?_⟩ + intro x + constructor + · intro h + exact False.elim (ZFSet.notMem_empty x h) + · rintro ⟨i, _⟩ + exact Fin.elim0 i + | succ n ih => + obtain ⟨U, hU, smallU, members⟩ := ih (fun i => family i.succ) (fun i => small i.succ) + have whole := conditions.binary_union pairing unions powers separation infinite choice hK + (small 0) ⟨hU, smallU⟩ + refine ⟨family 0 ∪ U, whole.1, whole.2, ?_⟩ + intro x + rw [ZFSet.mem_union, members] + constructor + · rintro (first | ⟨i, later⟩) + · exact ⟨0, first⟩ + · exact ⟨i.succ, later⟩ + · rintro ⟨i, member⟩ + exact Fin.cases (fun h => Or.inl h) + (fun j h => Or.inr ⟨j, h⟩) i member + +end PartitionPilot.Forcing.GroundInaccessibleConditions + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (separation : SeparationSchema M.sets) +variable {n : Nat} {f : (Fin (n + 1) → ZFSet.{u}) → ZFSet.{u}} + +noncomputable def historyUnionStepDefinition (defined : GroundDefinableFunction M f) : + GroundDefinableFunction M (fun env : Fin (n + 2) → ZFSet.{u} => + f (extend (refinementHistoryIndices (env 0) (env 1)) (fun j => env j.succ.succ))) := by + let earlier := (M.definable_historyUnion pairing unions separation).reindex + ![(0 : Fin (n + 2)), 1] + exact defined.comp (Fin.cases earlier + (fun j => GroundDefinableFunction.projection M j.succ.succ)) + +include pairing unions separation in +theorem exists_historyUnionTrace (collection : CollectionSchema M.sets) + (defined : GroundDefinableFunction M f) (params : Fin n → ZFSet.{u}) + (members : ∀ j, params j ∈ M.sets) + {stages : ZFSet.{u}} (hs : stages ∈ M.sets) (ordinal : ordinalSetProperty stages) : + ∃ history ∈ M.sets, OrdinalRecursionTrace + (fun alpha prior output => output = f (extend (refinementHistoryIndices alpha prior) params)) + stages history := by + let operation := M.historyUnionStepDefinition pairing unions separation defined + let slots : Fin (n + 3) → Fin (n + 3) := + Fin.cases 2 (Fin.cases 0 (Fin.cases 1 (fun j => j.succ.succ.succ))) + let formula := SetFormula.reindex slots operation.formula + have recognize (alpha prior output : ZFSet.{u}) (ha : alpha ∈ M.sets) + (hp : prior ∈ M.sets) (ho : output ∈ M.sets) : + Realize M.sets formula (extend alpha (extend prior (extend output params))) ↔ + output = f (extend (refinementHistoryIndices alpha prior) params) := by + rw [show formula = SetFormula.reindex slots operation.formula from rfl, realize_reindex] + have eqEnv : (fun i => extend alpha (extend prior (extend output params)) (slots i)) = + extend output (extend alpha (extend prior params)) := by + funext i + exact Fin.cases rfl (fun j => Fin.cases rfl (fun k => Fin.cases rfl (fun _ => rfl) k) j) i + rw [eqEnv] + exact operation.correct (extend alpha (extend prior params)) + (Fin.cases ha (Fin.cases hp members)) output ho + have closure : GroundOrdinalStepClosure M stages formula params := by + intro alpha member prior hp _ + have ha := M.transitive hs member + have outputGround := operation.closed (extend alpha (extend prior params)) + (Fin.cases ha (Fin.cases hp members)) + refine ⟨_, outputGround, (recognize alpha prior _ ha hp outputGround).2 rfl, ?_⟩ + intro z hz relation + exact (recognize alpha prior z ha hp hz).1 relation + obtain ⟨history, hh, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection + hs ordinal formula params members closure + refine ⟨history, hh, trace.1, ?_⟩ + intro alpha member output entry + have step := trace.2 alpha member output entry + exact (recognize alpha _ output (M.transitive hs member) step.1 step.2.1).1 step.2.2 + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable {I K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (phi : ZFSet.{u} → ZFSet.{u}) +variable (preserves : ∀ X ∈ M.sets, X ⊆ I → GroundBelow M X K → + phi X ⊆ I ∧ GroundBelow M (phi X) K) +include pairing unions powers separation choice hK conditions preserves + +theorem historyUnionTrace_below : + ∀ stages ∈ K, ∀ history ∈ M.sets, + OrdinalRecursionTrace (fun alpha prior output => output = phi (refinementHistoryIndices alpha prior)) + stages history → + (∀ alpha Y, ZFSet.pair alpha Y ∈ history → Y ⊆ I ∧ GroundBelow M Y K) ∧ + refinementHistoryIndices stages history ⊆ I ∧ + GroundBelow M (refinementHistoryIndices stages history) K := by + intro stages + induction stages using ZFSet.inductionOn with + | h stages ih => + intro hStages history hh trace + have hs := M.transitive hK hStages + have ordinal := ordinalSetProperty_member conditions.1 hStages + have fibers : ∀ alpha Y, ZFSet.pair alpha Y ∈ history → Y ⊆ I ∧ GroundBelow M Y K := by + intro alpha Y entry + have member := trace.1.pair_source entry + have ha := M.transitive hs member + have lower := ih alpha member (conditions.1.1 stages hStages alpha member) + (graphRestriction alpha history) (M.graphRestriction_mem unions separation ha hh) + (trace.restrict (ordinalSetProperty_member ordinal member) (ordinal.1 alpha member)) + have earlierGround := M.refinementHistoryIndices_mem unions separation ha + (M.graphRestriction_mem unions separation ha hh) + have result := preserves _ earlierGround lower.2.1 lower.2.2 + exact (trace.2 alpha member Y entry).symm ▸ result + refine ⟨fibers, ?_, ?_⟩ + · intro x hx + obtain ⟨alpha, _, Y, entry, inside⟩ := (mem_refinementHistoryIndices stages history x).1 hx + exact (fibers alpha Y entry).1 inside + · exact GroundBelow.indexed_sUnion pairing unions powers separation choice hs + (M.union_mem unions (M.union_mem unions hh)) hh hK conditions.1 + conditions.2.2.1 conditions.2.2.2 (GroundBelow.of_member pairing unions powers separation hK hStages) + trace.1.to_isFunc (fun alpha Y entry => (fibers alpha Y entry).2) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +include pairing unions powers separation infinite hK conditions + +theorem refinementIndexBound_below {level nodes T1 T2 P : ZFSet.{u}} + (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) + (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hP : P ∈ M.sets) + (smallNodes : GroundBelow M nodes K) (smallT1 : GroundBelow M T1 K) + (smallT2 : GroundBelow M T2 K) (smallP : GroundBelow M P K) : + refinementIndexBound {level} nodes (M.groundRelations T1 P) (M.groundRelations T2 P) ∈ M.sets ∧ + GroundBelow M (refinementIndexBound {level} nodes + (M.groundRelations T1 P) (M.groundRelations T2 P)) K := by + have first : M.groundRelations T1 P ∈ M.sets ∧ GroundBelow M (M.groundRelations T1 P) K := + ⟨M.groundRelations_mem pairing unions powers separation hT1 hP, + GroundBelow.relations pairing unions powers separation hT1 hP hK + conditions.1 conditions.2.2.2 smallT1 smallP⟩ + have second : M.groundRelations T2 P ∈ M.sets ∧ GroundBelow M (M.groundRelations T2 P) K := + ⟨M.groundRelations_mem pairing unions powers separation hT2 hP, + GroundBelow.relations pairing unions powers separation hT2 hP hK + conditions.1 conditions.2.2.2 smallT2 smallP⟩ + have node : nodes ∈ M.sets ∧ GroundBelow M nodes K := ⟨hn, smallNodes⟩ + have tag := conditions.singleton pairing unions powers separation infinite hK hl + exact conditions.product pairing unions powers separation hK tag + (conditions.product pairing unions powers separation hK node + (conditions.product pairing unions powers separation hK node + (conditions.product pairing unions powers separation hK first + (conditions.product pairing unions powers separation hK second second)))) + +theorem refinementIndices_below + {level nodes r candidates relations T1 T2 T P order top : ZFSet.{u}} + (hl : level ∈ M.sets) (hn : nodes ∈ M.sets) (hr : r ∈ M.sets) + (hc : candidates ∈ M.sets) (hrel : relations ∈ M.sets) + (hT1 : T1 ∈ M.sets) (hT2 : T2 ∈ M.sets) (hT : T ∈ M.sets) + (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) + (smallNodes : GroundBelow M nodes K) (smallT1 : GroundBelow M T1 K) + (smallT2 : GroundBelow M T2 K) (smallP : GroundBelow M P K) : + M.refinementIndices level nodes r candidates relations T1 T2 T P order top ∈ M.sets ∧ + GroundBelow M (M.refinementIndices level nodes r candidates relations T1 T2 T P order top) K := by + have ground := M.refinementIndices_mem pairing unions powers separation + hl hn hr hc hrel hT1 hT2 hT hP ho ht + have bound := M.refinementIndexBound_below pairing unions powers separation infinite hK conditions + hl hn hT1 hT2 hP smallNodes smallT1 smallT2 smallP + exact ⟨ground, bound.2.restrict separation ground hK (fun _ member => (ZFSet.mem_sep.1 member).1)⟩ + +theorem rawRefinementFormulaData_indices_below + (collection : CollectionSchema M.sets) + (P order top action G nodes nodeOrder basis T T2 level : ZFSet.{u}) + (hP : P ∈ M.sets) (ho : order ∈ M.sets) (ht : top ∈ M.sets) (ha : action ∈ M.sets) + (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) + (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hl : level ∈ M.sets) + (smallP : GroundBelow M P K) (smallNodes : GroundBelow M nodes K) + (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) : + M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0 ∈ M.sets ∧ + GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) K := by + let params : Fin 11 → ZFSet.{u} := ![P, order, top, action, G, nodes, nodeOrder, basis, T, T2, level] + have members : ∀ j, params j ∈ M.sets := Fin.cases hP (Fin.cases ho (Fin.cases ht + (Fin.cases ha (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb + (Fin.cases hT (Fin.cases hT2 (Fin.cases hl (fun j => Fin.elim0 j))))))))))) + have code := (M.definable_rawRefinementFormulaDataCode pairing unions powers separation collection).closed params members + have ground := M.nonemptyTupleCode_field_mem 14 + (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level) code 0 + have bound := M.refinementIndexBound_below pairing unions powers separation infinite hK conditions + hl hn hT hT2 hP smallNodes smallT smallT2 smallP + exact ⟨ground, bound.2.restrict separation ground hK (fun _ member => (ZFSet.mem_sep.1 member).1)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInaccessibleOrdinalClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInaccessibleOrdinalClosure.lean index fa9dd176e0ff1c5dde4473d5607973882e78bce5..20c177bccce0961bcdb9f677b25b9935eeba2a59 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInaccessibleOrdinalClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInaccessibleOrdinalClosure.lean @@ -1,56 +1,56 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundInaccessibleConditions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundInaccessibleConditions -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) -include conditions pairing unions powers separation infinite hK - -theorem successor_mem {α : ZFSet.{u}} (hα : α ∈ K) : insert α α ∈ K := by - have hOne := M.natSetCode_mem separation infinite 1 - have oneBelow := conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega 1) - have ground := M.constantFamilyGraph_mem pairing unions powers separation hOne (M.transitive hK hα) - have constant := constantFamilyGraph_function (natSetCode 1) α - have function : ZFSet.IsFunc (natSetCode 1) K (constantFamilyGraph (natSetCode 1) α) := by - refine ⟨?_, constant.2⟩ - intro z hz - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (constant.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.mem_singleton.1 hy) ▸ hα⟩ - obtain ⟨δ, hδ, bounded⟩ := conditions.2.2.1 (natSetCode 1) oneBelow _ ground function - have less := bounded (natSetCode 0) α - ((pair_mem_constantFamilyGraph (natSetCode 1) α _ _).2 - ⟨(natSetCode_mem_iff 0 1).2 (by decide), rfl⟩) - obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff α).1 (ordinalSetProperty_member conditions.1 hα) - obtain ⟨d, eqD⟩ := (ordinalSetProperty_iff δ).1 (ordinalSetProperty_member conditions.1 hδ) - obtain ⟨k, eqK⟩ := (ordinalSetProperty_iff K).1 conditions.1 - rw [eqA, eqD, mem_ordinalCode_iff] at less - rw [eqD, eqK, mem_ordinalCode_iff] at hδ - rw [eqA, eqK, ← ordinalCode_succ, mem_ordinalCode_iff] - exact (Order.succ_le_iff.2 less).trans_lt hδ - -theorem rank_isLimit : Order.IsSuccLimit (ZFSet.rank K) := by - apply Ordinal.isSuccLimit_iff.2 - refine ⟨ne_of_gt (bot_le.trans_lt (ZFSet.rank_lt_of_mem conditions.2.1)), ?_⟩ - rw [Order.isSuccPrelimit_iff_succ_lt] - intro a ha - have hα : ordinalCode a ∈ K := by - rw [ordinalSetProperty_eq_code_rank K conditions.1] - exact (mem_ordinalCode_iff a (ZFSet.rank K)).2 ha - have bound := ZFSet.rank_lt_of_mem (conditions.successor_mem pairing unions powers separation infinite hK hα) - rw [← ordinalCode_succ, rank_ordinalCode] at bound - exact bound - -end PartitionPilot.Forcing.GroundInaccessibleConditions - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundInaccessibleConditions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundInaccessibleConditions +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) +include conditions pairing unions powers separation infinite hK + +theorem successor_mem {α : ZFSet.{u}} (hα : α ∈ K) : insert α α ∈ K := by + have hOne := M.natSetCode_mem separation infinite 1 + have oneBelow := conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega 1) + have ground := M.constantFamilyGraph_mem pairing unions powers separation hOne (M.transitive hK hα) + have constant := constantFamilyGraph_function (natSetCode 1) α + have function : ZFSet.IsFunc (natSetCode 1) K (constantFamilyGraph (natSetCode 1) α) := by + refine ⟨?_, constant.2⟩ + intro z hz + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (constant.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.mem_singleton.1 hy) ▸ hα⟩ + obtain ⟨δ, hδ, bounded⟩ := conditions.2.2.1 (natSetCode 1) oneBelow _ ground function + have less := bounded (natSetCode 0) α + ((pair_mem_constantFamilyGraph (natSetCode 1) α _ _).2 + ⟨(natSetCode_mem_iff 0 1).2 (by decide), rfl⟩) + obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff α).1 (ordinalSetProperty_member conditions.1 hα) + obtain ⟨d, eqD⟩ := (ordinalSetProperty_iff δ).1 (ordinalSetProperty_member conditions.1 hδ) + obtain ⟨k, eqK⟩ := (ordinalSetProperty_iff K).1 conditions.1 + rw [eqA, eqD, mem_ordinalCode_iff] at less + rw [eqD, eqK, mem_ordinalCode_iff] at hδ + rw [eqA, eqK, ← ordinalCode_succ, mem_ordinalCode_iff] + exact (Order.succ_le_iff.2 less).trans_lt hδ + +theorem rank_isLimit : Order.IsSuccLimit (ZFSet.rank K) := by + apply Ordinal.isSuccLimit_iff.2 + refine ⟨ne_of_gt (bot_le.trans_lt (ZFSet.rank_lt_of_mem conditions.2.1)), ?_⟩ + rw [Order.isSuccPrelimit_iff_succ_lt] + intro a ha + have hα : ordinalCode a ∈ K := by + rw [ordinalSetProperty_eq_code_rank K conditions.1] + exact (mem_ordinalCode_iff a (ZFSet.rank K)).2 ha + have bound := ZFSet.rank_lt_of_mem (conditions.successor_mem pairing unions powers separation infinite hK hα) + rw [← ordinalCode_succ, rank_ordinalCode] at bound + exact bound + +end PartitionPilot.Forcing.GroundInaccessibleConditions + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionHistory.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionHistory.lean index 28a24cafad9b42089ca96a8ad20309877d6aa67d..2ff8b3c7198a65f319985b8a9fdda8f417a50cfc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionHistory.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionHistory.lean @@ -1,486 +1,486 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundCompositionFamilyFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSeparatorFamilyFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds -import OAI.SetTheory.PartitionPrinciple.Geometry.InitialCompressionAccounting - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def definable_pairCompositions : - GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => - M.groundPairCompositions (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) where - formula := compositionFamilyFormula 0 1 2 3 4 5 6 7 8 - closed _env members := M.pairCompositionFamily_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) (members 7) - (M.groundRelations_mem pairing unions powers separation (members 3) (members 5)) - correct env members z hz := M.realize_compositionFamilyFormula pairing 0 1 2 3 4 5 6 7 8 - (extend z env) (Fin.cases hz members) - -noncomputable def definable_pairPushFilters : - GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => - M.groundPairPushFilters (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) where - formula := pushFilterFamilyFormula 0 1 2 3 4 5 6 7 - closed _env members := M.pairPushFilterFamily_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) - (M.groundPower_mem powers (members 3)) - correct env members z hz := M.realize_pushFilterFamilyFormula pairing 0 1 2 3 4 5 6 7 - (extend z env) (Fin.cases hz members) - -noncomputable def definable_recursiveSeparators : - GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => - recursiveSeparatorFamily (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) where - formula := recursiveSeparatorFamilyFormula 0 1 2 3 4 5 6 7 - closed _env members := M.recursiveSeparatorFamily_mem pairing unions powers separation - (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) - correct env members z hz := M.realize_recursiveSeparatorFamilyFormula pairing 0 1 2 3 4 5 6 7 - (extend z env) (Fin.cases hz members) - -noncomputable def definable_recursiveAction : - GroundDefinableFunction M (fun env : Fin 9 → ZFSet.{u} => - taggedActionGraph (env 0) (env 1) (env 6) (env 7) - (indexedTaskActionGraph (env 0) (env 4) (env 5) (env 6) - (indexedTaskActionGraph (env 0) (env 2) (env 3) (env 4) (env 8)))) where - formula := recursiveActionGraphFormula 0 1 2 3 4 5 6 7 8 9 - closed env members := by - have index := M.indexedTaskActionGraph_mem pairing unions powers separation - (members 0) (members 2) (members 3) (members 4) (members 8) - have fresh := M.indexedTaskActionGraph_mem pairing unions powers separation - (members 0) (members 4) (members 5) (members 6) index - exact M.taggedActionGraph_mem pairing unions powers separation - (members 0) (members 1) (members 6) (members 7) fresh - correct env members z hz := M.realize_recursiveActionGraphFormula pairing unions powers separation - 0 1 2 3 4 5 6 7 8 9 (extend z env) (Fin.cases hz members) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace RecursiveStateData -noncomputable def iterate (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) - (I Sources Reps G T : ZFSet.{u}) : Nat → RecursiveStateData.{u} - | 0 => initial - | n + 1 => (iterate initial M I Sources Reps G T n).successor M I Sources Reps G T - -theorem iterate_zero (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) - (I Sources Reps G T : ZFSet.{u}) : initial.iterate M I Sources Reps G T 0 = initial := rfl - -theorem iterate_succ (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) - (I Sources Reps G T : ZFSet.{u}) (n : Nat) : - initial.iterate M I Sources Reps G T (n + 1) = - (initial.iterate M I Sources Reps G T n).successor M I Sources Reps G T := rfl - -end RecursiveStateData - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) - -noncomputable def next : GroundCompressionState M seed := - Classical.choose (state.exists_successor pairing unions powers separation hI hSources hReps hG hT) - -theorem next_data : - (state.next pairing unions powers separation hI hSources hReps hG hT).data = - state.data.successor M I Sources Reps G T := - Classical.choose_spec (state.exists_successor pairing unions powers separation hI hSources hReps hG hT) - -noncomputable def iterate : Nat → GroundCompressionState M seed - | 0 => state - | n + 1 => (iterate n).next pairing unions powers separation hI hSources hReps hG hT - -theorem iterate_data (n : Nat) : - (state.iterate pairing unions powers separation hI hSources hReps hG hT n).data = - state.data.iterate M I Sources Reps G T n := by - induction n with - | zero => rfl - | succ n ih => - change ((state.iterate pairing unions powers separation hI hSources hReps hG hT n).next - pairing unions powers separation hI hSources hReps hG hT).data = _ - rw [next_data, ih, RecursiveStateData.iterate_succ] - -include pairing unions powers separation hI hSources hReps hG hT in -theorem canonical_iterate_code_mem (n : Nat) : - (state.data.iterate M I Sources Reps G T n).code ∈ M.sets := by - rw [← state.iterate_data pairing unions powers separation hI hSources hReps hG hT n] - exact (state.iterate pairing unions powers separation hI hSources hReps hG hT n).code_mem pairing - -include pairing unions powers separation hI hSources hReps hG hT in -theorem canonical_iterate_valid (n : Nat) : - ∃ current : GroundCompressionState M seed, - current.data = state.data.iterate M I Sources Reps G T n := - ⟨state.iterate pairing unions powers separation hI hSources hReps hG hT n, - state.iterate_data pairing unions powers separation hI hSources hReps hG hT n⟩ - -end GroundCompressionState -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -universe u - -theorem pairSecondField_constant {I J K : ZFSet.{u}} (value : ZFSet.{u}) - (subset : K ⊆ ZFSet.prod I J) : - pairSecondField I J K (constantFamilyGraph J value) = constantFamilyGraph K value := by - apply ZFSet.ext - intro z - constructor - · intro entry - unfold pairSecondField pairFieldGraph at entry - obtain ⟨k, hk, x, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 - obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) - have old := ((pairSecondField_entry_iff hi hj).1 entry).2 - exact (pair_mem_constantFamilyGraph K value _ x).2 - ⟨hk, ((pair_mem_constantFamilyGraph J value j x).1 old).2⟩ - · intro entry - change z ∈ ZFSet.prod K {value} at entry - obtain ⟨k, hk, x, _, rfl⟩ := ZFSet.mem_prod.1 entry - have equal := ((pair_mem_constantFamilyGraph K value k x).1 entry).2 - obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) - exact (pairSecondField_entry_iff hi hj).2 - ⟨hk, (pair_mem_constantFamilyGraph J value j x).2 ⟨hj, equal⟩⟩ - -structure RecursiveTemplateConstancy (P r μ : ZFSet.{u}) (state : RecursiveStateData.{u}) : Prop where - spaces : state.Qs = constantFamilyGraph state.J P - relations : state.rs = constantFamilyGraph state.J r - meets : state.μs = constantFamilyGraph state.J μ - -namespace RecursiveTemplateConstancy -variable {P r μ : ZFSet.{u}} {state : RecursiveStateData.{u}} -variable (constant : RecursiveTemplateConstancy P r μ state) -include constant - -theorem space_entry_iff (i Q : ZFSet.{u}) : - ZFSet.pair i Q ∈ state.Qs ↔ i ∈ state.J ∧ Q = P := by - rw [constant.spaces, pair_mem_constantFamilyGraph] - -theorem relation_entry_iff (i relation : ZFSet.{u}) : - ZFSet.pair i relation ∈ state.rs ↔ i ∈ state.J ∧ relation = r := by - rw [constant.relations, pair_mem_constantFamilyGraph] - -theorem meet_entry_iff (i operation : ZFSet.{u}) : - ZFSet.pair i operation ∈ state.μs ↔ i ∈ state.J ∧ operation = μ := by - rw [constant.meets, pair_mem_constantFamilyGraph] - -theorem successor (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) : - RecursiveTemplateConstancy P r μ (state.successor M I Sources Reps G T) := by - let K := recursiveAttachmentIndices I state.J state.D (⋃₀ ⋃₀ state.Fs) Sources state.Fs - have subset : K ⊆ ZFSet.prod I state.J := recursiveAttachmentIndices_subset _ _ _ _ _ _ - constructor - · change pairSecondField I state.J K state.Qs = constantFamilyGraph K P - rw [constant.spaces] - exact pairSecondField_constant P subset - · change pairSecondField I state.J K state.rs = constantFamilyGraph K r - rw [constant.relations] - exact pairSecondField_constant r subset - · change pairSecondField I state.J K state.μs = constantFamilyGraph K μ - rw [constant.meets] - exact pairSecondField_constant μ subset - -theorem iterate (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) (n : Nat) : - RecursiveTemplateConstancy P r μ (state.iterate M I Sources Reps G T n) := by - induction n with - | zero => exact constant - | succ n ih => exact ih.successor M I Sources Reps G T - -end RecursiveTemplateConstancy - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula - -def decodedSuccessorFormula (definition : SetFormula 19) : SetFormula 7 := - exBlock 13 (.conj - (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex 7 13 0) (prefixIndex 7 13)).toFormula - (reindex (extend (suffixIndex 7 13 1) - (Fin.addCases (m := 13) (n := 5) (prefixIndex 7 13) - (fun j => suffixIndex 7 13 j.succ.succ))) definition)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_decodedSuccessorFormula - (definition : GroundDefinableFunction M (RecursiveStateData.successorCodeFromEnvironment M)) - (params : Fin 5 → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) - {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets (decodedSuccessorFormula definition.formula) (extend x (extend y params)) ↔ - ∃ fields : Fin 13 → ZFSet.{u}, (∀ i, fields i ∈ M.sets) ∧ - x = nonemptyTupleCode 12 fields ∧ - y = RecursiveStateData.successorCodeFromEnvironment M - (Fin.addCases (m := 13) (n := 5) fields params) := by - rw [decodedSuccessorFormula, realize_exBlock] - apply exists_congr - intro fields - apply and_congr_right - intro hfields - have henv : ∀ i, extendMany 13 fields (extend x (extend y params)) i ∈ M.sets := - extendMany_members 13 fields _ hfields (Fin.cases hx (Fin.cases hy members)) - change (Realize M.sets (BoundedFormula.nonemptyTupleFormula 12 - (suffixIndex 7 13 0) (prefixIndex 7 13)).toFormula _ ∧ _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ henv, BoundedFormula.truth_nonemptyTupleFormula, - realize_reindex, map_extend] - have fieldsEqual : (fun i => extendMany 13 fields (extend x (extend y params)) - (prefixIndex 7 13 i)) = fields := by - funext i - exact extendMany_prefix 13 fields _ i - have envEqual : (fun i => extendMany 13 fields (extend x (extend y params)) - (Fin.addCases (m := 13) (n := 5) (prefixIndex 7 13) - (fun j => suffixIndex 7 13 j.succ.succ) i)) = - Fin.addCases (m := 13) (n := 5) fields params := by - funext i - refine Fin.addCases (m := 13) (n := 5) (fun j => ?_) (fun j => ?_) i - · simp only [Fin.addCases_left] - exact extendMany_prefix 13 fields _ j - · simp only [Fin.addCases_right] - exact extendMany_suffix 13 fields _ j.succ.succ - rw [fieldsEqual, envEqual, extendMany_suffix, extendMany_suffix] - change (x = nonemptyTupleCode 12 fields ∧ - Realize M.sets definition.formula - (extend y (Fin.addCases (m := 13) (n := 5) fields params))) ↔ _ - rw [definition.correct _ (fun i => - Fin.addCases (m := 13) (n := 5) - (fun j => by simpa only [Fin.addCases_left] using hfields j) - (fun j => by simpa only [Fin.addCases_right] using members j) i) y hy] - -theorem realize_recursiveSuccessorCode - (definition : GroundDefinableFunction M (RecursiveStateData.successorCodeFromEnvironment M)) - (state : RecursiveStateData.{u}) (hstate : state.code ∈ M.sets) - {I Sources Reps G T y : ZFSet.{u}} - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets (decodedSuccessorFormula definition.formula) - (extend state.code (extend y (extend I (extend Sources - (extend Reps (extend G (extend T Fin.elim0))))))) ↔ - y = (state.successor M I Sources Reps G T).code := by - rw [M.realize_decodedSuccessorFormula definition _ - (Fin.cases hI (Fin.cases hSources (Fin.cases hReps (Fin.cases hG (Fin.cases hT - (fun i => Fin.elim0 i)))))) hstate hy] - constructor - · rintro ⟨fields, _, code, next⟩ - have equal : RecursiveStateData.ofFields fields = state := - RecursiveStateData.code_injective ((RecursiveStateData.code_ofFields fields).trans code.symm) - have fieldsEqual : fields = state.field := by - rw [← RecursiveStateData.field_ofFields fields, equal] - rw [fieldsEqual] at next - exact next.trans (state.successorCodeFromEnvironment_spec M I Sources Reps G T) - · intro next - refine ⟨state.field, M.recursiveStateData_field_mem state hstate, rfl, ?_⟩ - exact next.trans (state.successorCodeFromEnvironment_spec M I Sources Reps G T).symm - -end TransitiveGround -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -noncomputable def recursiveSuccessorTerm : GroundSetTerm M 18 := - let v : Fin 18 → GroundSetTerm M 18 := GroundSetTerm.var M - let union (term : GroundSetTerm M 18) := - GroundSetTerm.app (M.definable_sUnion unions) (Fin.cases term Fin.elim0) - let bound := union (union (union (v 4))) - let oldFresh := GroundSetTerm.app - (M.definable_indexedFresh pairing unions powers separation) - (Fin.cases (v 3) (Fin.cases (v 4) (Fin.cases (v 5) (Fin.cases (v 7) (Fin.elim0))))) - let carrier := GroundSetTerm.app - (M.definable_taggedExtension pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (oldFresh) (Fin.elim0))) - let inside := GroundSetTerm.app - (M.definable_batchInside pairing unions powers separation) - (Fin.cases (v 3) (Fin.cases (v 4) (Fin.cases (v 5) (Fin.elim0)))) - let shadow := GroundSetTerm.app - (M.definable_batchShadow pairing unions powers separation) - (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (v 4) (Fin.cases (v 6) (Fin.cases (v 7) (Fin.cases (v 8) (Fin.elim0))))))) - let upper := GroundSetTerm.app - (M.definable_batchUpper pairing unions powers separation) - (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (v 4) (Fin.cases (v 9) (Fin.elim0))))) - let order := GroundSetTerm.app - (M.definable_codedAttachmentOrder pairing unions powers separation) - (Fin.cases (v 0) (Fin.cases (oldFresh) (Fin.cases (v 1) (Fin.cases (inside) (Fin.cases (shadow) (Fin.cases (upper) (Fin.elim0))))))) - let meet := GroundSetTerm.app - (M.definable_canonicalMeet pairing unions powers separation) - (Fin.cases (carrier) (Fin.cases (order) (Fin.elim0))) - let indices := GroundSetTerm.app - (M.definable_recursiveIndices pairing unions powers separation) - (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (union (union (v 9))) (Fin.cases (v 14) (Fin.cases (v 9) (Fin.elim0))))))) - let spaces := GroundSetTerm.app - (M.definable_pairSecondField pairing unions powers separation) - (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 4) (Fin.elim0))))) - let relations := GroundSetTerm.app - (M.definable_pairSecondField pairing unions powers separation) - (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 5) (Fin.elim0))))) - let meets := GroundSetTerm.app - (M.definable_pairSecondField pairing unions powers separation) - (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 6) (Fin.elim0))))) - let anchors := GroundSetTerm.app - (M.definable_pairSecondField pairing unions powers separation) - (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 7) (Fin.elim0))))) - let fresh := GroundSetTerm.app - (M.definable_indexedFresh pairing unions powers separation) - (Fin.cases (indices) (Fin.cases (spaces) (Fin.cases (relations) (Fin.cases (anchors) (Fin.elim0))))) - let nextCarrier := GroundSetTerm.app - (M.definable_taggedExtension pairing unions powers separation) - (Fin.cases (carrier) (Fin.cases (fresh) (Fin.elim0))) - let embeddings := GroundSetTerm.app - (M.definable_pairCompositions pairing unions powers separation) - (Fin.cases (indices) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (bound) (Fin.cases (v 0) (Fin.cases (carrier) (Fin.cases (v 8) (Fin.cases (v 11) (Fin.elim0))))))))) - let filters := GroundSetTerm.app - (M.definable_pairPushFilters pairing unions powers separation) - (Fin.cases (indices) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (v 11) (Fin.cases (v 9) (Fin.elim0)))))))) - let separators := GroundSetTerm.app - (M.definable_recursiveSeparators pairing unions powers separation) - (Fin.cases (indices) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (carrier) (Fin.cases (v 11) (Fin.cases (v 10) (Fin.elim0)))))))) - let maps := GroundSetTerm.app - (M.definable_liftedCompressionFamily pairing unions powers separation) - (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (carrier) (Fin.cases (nextCarrier) (Fin.cases (oldFresh) (Fin.cases (bound) (Fin.cases (v 11) (Fin.cases (v 14) (Fin.cases (v 9) (Fin.cases (v 15) (Fin.cases (v 16) (Fin.cases (v 12) (Fin.elim0)))))))))))))) - let action := GroundSetTerm.app - (M.definable_recursiveAction pairing unions powers separation) - (Fin.cases (v 16) (Fin.cases (carrier) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (bound) (Fin.cases (fresh) (Fin.cases (v 12) (Fin.cases (v 17) (Fin.elim0)))))))))) - GroundSetTerm.app (M.definable_nonemptyTuple pairing 12) - (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (meet) (Fin.cases (indices) (Fin.cases (spaces) (Fin.cases (relations) (Fin.cases (meets) (Fin.cases (anchors) (Fin.cases (embeddings) (Fin.cases (filters) (Fin.cases (separators) (Fin.cases (maps) (Fin.cases (action) (Fin.elim0)))))))))))))) - -theorem recursiveSuccessorTerm_eval (env : Fin 18 → ZFSet.{u}) : - (M.recursiveSuccessorTerm pairing unions powers separation).eval env = - RecursiveStateData.successorCodeFromEnvironment M env := by - rfl - -noncomputable def definable_recursiveSuccessorCode : - GroundDefinableFunction M (RecursiveStateData.successorCodeFromEnvironment M) := - (M.recursiveSuccessorTerm pairing unions powers separation).definition.congr - (M.recursiveSuccessorTerm_eval pairing unions powers separation) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace TransitiveGround -noncomputable def compressionSuccessorFormula (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : SetFormula 7 := - decodedSuccessorFormula (M.definable_recursiveSuccessorCode pairing unions powers separation).formula - -end TransitiveGround - -namespace GroundCompressionState -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) - -theorem exists_groundHistory - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : - let φ := M.compressionSuccessorFormula pairing unions powers separation - let params := extend state.data.code - (extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0))))) - ∃ history ∈ M.sets, - OrdinalRecursionTrace (groundRecursionStep M (naturalStepFormula φ) params) ZFSet.omega history ∧ - (∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ - y = (state.data.iterate M I Sources Reps G T n).code) ∧ - (∀ other, OrdinalRecursionTrace (groundRecursionStep M (naturalStepFormula φ) params) - ZFSet.omega other → other = history) ∧ - ∀ n, ∃ current : GroundCompressionState M seed, - current.data = state.data.iterate M I Sources Reps G T n := by - dsimp only - let φ := M.compressionSuccessorFormula pairing unions powers separation - let params := extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0)))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hI (Fin.cases hSources (Fin.cases hReps (Fin.cases hG - (Fin.cases hT (fun i => Fin.elim0 i))))) - let value (n : Nat) := (state.data.iterate M I Sources Reps G T n).code - have values : ∀ n, value n ∈ M.sets := - state.canonical_iterate_code_mem pairing unions powers separation hI hSources hReps hG hT - have nextValue : ∀ n y, y ∈ M.sets → - (Realize M.sets φ (extend (value n) (extend y params)) ↔ y = value (n + 1)) := by - intro n y hy - exact M.realize_recursiveSuccessorCode - (M.definable_recursiveSuccessorCode pairing unions powers separation) - (state.data.iterate M I Sources Reps G T n) (values n) hI hSources hReps hG hT hy - obtain ⟨history, hh, trace, entries, unique⟩ := - M.exists_definableNaturalHistory φ params members value values nextValue - pairing unions separation collection infinite - exact ⟨history, hh, trace, entries, unique, - state.canonical_iterate_valid pairing unions powers separation hI hSources hReps hG hT⟩ - -end GroundCompressionState -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialCompressionHistory - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Sources := literalTaskSourceGraph I P R U Labels - let Filters := literalTaskFilterGraph I P R U Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, - ∃ history ∈ M.sets, FunctionGraphOn ZFSet.omega history ∧ - (∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ - y = ((M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n).code) ∧ - ∀ n, ∃ current : GroundCompressionState M seed, - current.data = (M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n := by - dsimp only - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, initial, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - obtain ⟨history, hh, trace, entries, _, valid⟩ := initial.exists_groundHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, seed, history, hh, trace.1, ?_, ?_⟩ - · simpa only [initialData] using entries - · simpa only [initialData] using valid - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundCompositionFamilyFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSeparatorFamilyFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds +import OAI.SetTheory.PartitionPrinciple.Geometry.InitialCompressionAccounting + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def definable_pairCompositions : + GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => + M.groundPairCompositions (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) where + formula := compositionFamilyFormula 0 1 2 3 4 5 6 7 8 + closed _env members := M.pairCompositionFamily_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) (members 7) + (M.groundRelations_mem pairing unions powers separation (members 3) (members 5)) + correct env members z hz := M.realize_compositionFamilyFormula pairing 0 1 2 3 4 5 6 7 8 + (extend z env) (Fin.cases hz members) + +noncomputable def definable_pairPushFilters : + GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => + M.groundPairPushFilters (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) where + formula := pushFilterFamilyFormula 0 1 2 3 4 5 6 7 + closed _env members := M.pairPushFilterFamily_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) + (M.groundPower_mem powers (members 3)) + correct env members z hz := M.realize_pushFilterFamilyFormula pairing 0 1 2 3 4 5 6 7 + (extend z env) (Fin.cases hz members) + +noncomputable def definable_recursiveSeparators : + GroundDefinableFunction M (fun env : Fin 7 → ZFSet.{u} => + recursiveSeparatorFamily (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6)) where + formula := recursiveSeparatorFamilyFormula 0 1 2 3 4 5 6 7 + closed _env members := M.recursiveSeparatorFamily_mem pairing unions powers separation + (members 0) (members 1) (members 2) (members 3) (members 4) (members 5) (members 6) + correct env members z hz := M.realize_recursiveSeparatorFamilyFormula pairing 0 1 2 3 4 5 6 7 + (extend z env) (Fin.cases hz members) + +noncomputable def definable_recursiveAction : + GroundDefinableFunction M (fun env : Fin 9 → ZFSet.{u} => + taggedActionGraph (env 0) (env 1) (env 6) (env 7) + (indexedTaskActionGraph (env 0) (env 4) (env 5) (env 6) + (indexedTaskActionGraph (env 0) (env 2) (env 3) (env 4) (env 8)))) where + formula := recursiveActionGraphFormula 0 1 2 3 4 5 6 7 8 9 + closed env members := by + have index := M.indexedTaskActionGraph_mem pairing unions powers separation + (members 0) (members 2) (members 3) (members 4) (members 8) + have fresh := M.indexedTaskActionGraph_mem pairing unions powers separation + (members 0) (members 4) (members 5) (members 6) index + exact M.taggedActionGraph_mem pairing unions powers separation + (members 0) (members 1) (members 6) (members 7) fresh + correct env members z hz := M.realize_recursiveActionGraphFormula pairing unions powers separation + 0 1 2 3 4 5 6 7 8 9 (extend z env) (Fin.cases hz members) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace RecursiveStateData +noncomputable def iterate (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) + (I Sources Reps G T : ZFSet.{u}) : Nat → RecursiveStateData.{u} + | 0 => initial + | n + 1 => (iterate initial M I Sources Reps G T n).successor M I Sources Reps G T + +theorem iterate_zero (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) + (I Sources Reps G T : ZFSet.{u}) : initial.iterate M I Sources Reps G T 0 = initial := rfl + +theorem iterate_succ (initial : RecursiveStateData.{u}) (M : TransitiveGround.{u}) + (I Sources Reps G T : ZFSet.{u}) (n : Nat) : + initial.iterate M I Sources Reps G T (n + 1) = + (initial.iterate M I Sources Reps G T n).successor M I Sources Reps G T := rfl + +end RecursiveStateData + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) + +noncomputable def next : GroundCompressionState M seed := + Classical.choose (state.exists_successor pairing unions powers separation hI hSources hReps hG hT) + +theorem next_data : + (state.next pairing unions powers separation hI hSources hReps hG hT).data = + state.data.successor M I Sources Reps G T := + Classical.choose_spec (state.exists_successor pairing unions powers separation hI hSources hReps hG hT) + +noncomputable def iterate : Nat → GroundCompressionState M seed + | 0 => state + | n + 1 => (iterate n).next pairing unions powers separation hI hSources hReps hG hT + +theorem iterate_data (n : Nat) : + (state.iterate pairing unions powers separation hI hSources hReps hG hT n).data = + state.data.iterate M I Sources Reps G T n := by + induction n with + | zero => rfl + | succ n ih => + change ((state.iterate pairing unions powers separation hI hSources hReps hG hT n).next + pairing unions powers separation hI hSources hReps hG hT).data = _ + rw [next_data, ih, RecursiveStateData.iterate_succ] + +include pairing unions powers separation hI hSources hReps hG hT in +theorem canonical_iterate_code_mem (n : Nat) : + (state.data.iterate M I Sources Reps G T n).code ∈ M.sets := by + rw [← state.iterate_data pairing unions powers separation hI hSources hReps hG hT n] + exact (state.iterate pairing unions powers separation hI hSources hReps hG hT n).code_mem pairing + +include pairing unions powers separation hI hSources hReps hG hT in +theorem canonical_iterate_valid (n : Nat) : + ∃ current : GroundCompressionState M seed, + current.data = state.data.iterate M I Sources Reps G T n := + ⟨state.iterate pairing unions powers separation hI hSources hReps hG hT n, + state.iterate_data pairing unions powers separation hI hSources hReps hG hT n⟩ + +end GroundCompressionState +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +universe u + +theorem pairSecondField_constant {I J K : ZFSet.{u}} (value : ZFSet.{u}) + (subset : K ⊆ ZFSet.prod I J) : + pairSecondField I J K (constantFamilyGraph J value) = constantFamilyGraph K value := by + apply ZFSet.ext + intro z + constructor + · intro entry + unfold pairSecondField pairFieldGraph at entry + obtain ⟨k, hk, x, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 entry).1 + obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) + have old := ((pairSecondField_entry_iff hi hj).1 entry).2 + exact (pair_mem_constantFamilyGraph K value _ x).2 + ⟨hk, ((pair_mem_constantFamilyGraph J value j x).1 old).2⟩ + · intro entry + change z ∈ ZFSet.prod K {value} at entry + obtain ⟨k, hk, x, _, rfl⟩ := ZFSet.mem_prod.1 entry + have equal := ((pair_mem_constantFamilyGraph K value k x).1 entry).2 + obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) + exact (pairSecondField_entry_iff hi hj).2 + ⟨hk, (pair_mem_constantFamilyGraph J value j x).2 ⟨hj, equal⟩⟩ + +structure RecursiveTemplateConstancy (P r μ : ZFSet.{u}) (state : RecursiveStateData.{u}) : Prop where + spaces : state.Qs = constantFamilyGraph state.J P + relations : state.rs = constantFamilyGraph state.J r + meets : state.μs = constantFamilyGraph state.J μ + +namespace RecursiveTemplateConstancy +variable {P r μ : ZFSet.{u}} {state : RecursiveStateData.{u}} +variable (constant : RecursiveTemplateConstancy P r μ state) +include constant + +theorem space_entry_iff (i Q : ZFSet.{u}) : + ZFSet.pair i Q ∈ state.Qs ↔ i ∈ state.J ∧ Q = P := by + rw [constant.spaces, pair_mem_constantFamilyGraph] + +theorem relation_entry_iff (i relation : ZFSet.{u}) : + ZFSet.pair i relation ∈ state.rs ↔ i ∈ state.J ∧ relation = r := by + rw [constant.relations, pair_mem_constantFamilyGraph] + +theorem meet_entry_iff (i operation : ZFSet.{u}) : + ZFSet.pair i operation ∈ state.μs ↔ i ∈ state.J ∧ operation = μ := by + rw [constant.meets, pair_mem_constantFamilyGraph] + +theorem successor (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) : + RecursiveTemplateConstancy P r μ (state.successor M I Sources Reps G T) := by + let K := recursiveAttachmentIndices I state.J state.D (⋃₀ ⋃₀ state.Fs) Sources state.Fs + have subset : K ⊆ ZFSet.prod I state.J := recursiveAttachmentIndices_subset _ _ _ _ _ _ + constructor + · change pairSecondField I state.J K state.Qs = constantFamilyGraph K P + rw [constant.spaces] + exact pairSecondField_constant P subset + · change pairSecondField I state.J K state.rs = constantFamilyGraph K r + rw [constant.relations] + exact pairSecondField_constant r subset + · change pairSecondField I state.J K state.μs = constantFamilyGraph K μ + rw [constant.meets] + exact pairSecondField_constant μ subset + +theorem iterate (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) (n : Nat) : + RecursiveTemplateConstancy P r μ (state.iterate M I Sources Reps G T n) := by + induction n with + | zero => exact constant + | succ n ih => exact ih.successor M I Sources Reps G T + +end RecursiveTemplateConstancy + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula + +def decodedSuccessorFormula (definition : SetFormula 19) : SetFormula 7 := + exBlock 13 (.conj + (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex 7 13 0) (prefixIndex 7 13)).toFormula + (reindex (extend (suffixIndex 7 13 1) + (Fin.addCases (m := 13) (n := 5) (prefixIndex 7 13) + (fun j => suffixIndex 7 13 j.succ.succ))) definition)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_decodedSuccessorFormula + (definition : GroundDefinableFunction M (RecursiveStateData.successorCodeFromEnvironment M)) + (params : Fin 5 → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets) + {x y : ZFSet.{u}} (hx : x ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets (decodedSuccessorFormula definition.formula) (extend x (extend y params)) ↔ + ∃ fields : Fin 13 → ZFSet.{u}, (∀ i, fields i ∈ M.sets) ∧ + x = nonemptyTupleCode 12 fields ∧ + y = RecursiveStateData.successorCodeFromEnvironment M + (Fin.addCases (m := 13) (n := 5) fields params) := by + rw [decodedSuccessorFormula, realize_exBlock] + apply exists_congr + intro fields + apply and_congr_right + intro hfields + have henv : ∀ i, extendMany 13 fields (extend x (extend y params)) i ∈ M.sets := + extendMany_members 13 fields _ hfields (Fin.cases hx (Fin.cases hy members)) + change (Realize M.sets (BoundedFormula.nonemptyTupleFormula 12 + (suffixIndex 7 13 0) (prefixIndex 7 13)).toFormula _ ∧ _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ henv, BoundedFormula.truth_nonemptyTupleFormula, + realize_reindex, map_extend] + have fieldsEqual : (fun i => extendMany 13 fields (extend x (extend y params)) + (prefixIndex 7 13 i)) = fields := by + funext i + exact extendMany_prefix 13 fields _ i + have envEqual : (fun i => extendMany 13 fields (extend x (extend y params)) + (Fin.addCases (m := 13) (n := 5) (prefixIndex 7 13) + (fun j => suffixIndex 7 13 j.succ.succ) i)) = + Fin.addCases (m := 13) (n := 5) fields params := by + funext i + refine Fin.addCases (m := 13) (n := 5) (fun j => ?_) (fun j => ?_) i + · simp only [Fin.addCases_left] + exact extendMany_prefix 13 fields _ j + · simp only [Fin.addCases_right] + exact extendMany_suffix 13 fields _ j.succ.succ + rw [fieldsEqual, envEqual, extendMany_suffix, extendMany_suffix] + change (x = nonemptyTupleCode 12 fields ∧ + Realize M.sets definition.formula + (extend y (Fin.addCases (m := 13) (n := 5) fields params))) ↔ _ + rw [definition.correct _ (fun i => + Fin.addCases (m := 13) (n := 5) + (fun j => by simpa only [Fin.addCases_left] using hfields j) + (fun j => by simpa only [Fin.addCases_right] using members j) i) y hy] + +theorem realize_recursiveSuccessorCode + (definition : GroundDefinableFunction M (RecursiveStateData.successorCodeFromEnvironment M)) + (state : RecursiveStateData.{u}) (hstate : state.code ∈ M.sets) + {I Sources Reps G T y : ZFSet.{u}} + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets (decodedSuccessorFormula definition.formula) + (extend state.code (extend y (extend I (extend Sources + (extend Reps (extend G (extend T Fin.elim0))))))) ↔ + y = (state.successor M I Sources Reps G T).code := by + rw [M.realize_decodedSuccessorFormula definition _ + (Fin.cases hI (Fin.cases hSources (Fin.cases hReps (Fin.cases hG (Fin.cases hT + (fun i => Fin.elim0 i)))))) hstate hy] + constructor + · rintro ⟨fields, _, code, next⟩ + have equal : RecursiveStateData.ofFields fields = state := + RecursiveStateData.code_injective ((RecursiveStateData.code_ofFields fields).trans code.symm) + have fieldsEqual : fields = state.field := by + rw [← RecursiveStateData.field_ofFields fields, equal] + rw [fieldsEqual] at next + exact next.trans (state.successorCodeFromEnvironment_spec M I Sources Reps G T) + · intro next + refine ⟨state.field, M.recursiveStateData_field_mem state hstate, rfl, ?_⟩ + exact next.trans (state.successorCodeFromEnvironment_spec M I Sources Reps G T).symm + +end TransitiveGround +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +noncomputable def recursiveSuccessorTerm : GroundSetTerm M 18 := + let v : Fin 18 → GroundSetTerm M 18 := GroundSetTerm.var M + let union (term : GroundSetTerm M 18) := + GroundSetTerm.app (M.definable_sUnion unions) (Fin.cases term Fin.elim0) + let bound := union (union (union (v 4))) + let oldFresh := GroundSetTerm.app + (M.definable_indexedFresh pairing unions powers separation) + (Fin.cases (v 3) (Fin.cases (v 4) (Fin.cases (v 5) (Fin.cases (v 7) (Fin.elim0))))) + let carrier := GroundSetTerm.app + (M.definable_taggedExtension pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (oldFresh) (Fin.elim0))) + let inside := GroundSetTerm.app + (M.definable_batchInside pairing unions powers separation) + (Fin.cases (v 3) (Fin.cases (v 4) (Fin.cases (v 5) (Fin.elim0)))) + let shadow := GroundSetTerm.app + (M.definable_batchShadow pairing unions powers separation) + (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (v 4) (Fin.cases (v 6) (Fin.cases (v 7) (Fin.cases (v 8) (Fin.elim0))))))) + let upper := GroundSetTerm.app + (M.definable_batchUpper pairing unions powers separation) + (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (v 4) (Fin.cases (v 9) (Fin.elim0))))) + let order := GroundSetTerm.app + (M.definable_codedAttachmentOrder pairing unions powers separation) + (Fin.cases (v 0) (Fin.cases (oldFresh) (Fin.cases (v 1) (Fin.cases (inside) (Fin.cases (shadow) (Fin.cases (upper) (Fin.elim0))))))) + let meet := GroundSetTerm.app + (M.definable_canonicalMeet pairing unions powers separation) + (Fin.cases (carrier) (Fin.cases (order) (Fin.elim0))) + let indices := GroundSetTerm.app + (M.definable_recursiveIndices pairing unions powers separation) + (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (union (union (v 9))) (Fin.cases (v 14) (Fin.cases (v 9) (Fin.elim0))))))) + let spaces := GroundSetTerm.app + (M.definable_pairSecondField pairing unions powers separation) + (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 4) (Fin.elim0))))) + let relations := GroundSetTerm.app + (M.definable_pairSecondField pairing unions powers separation) + (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 5) (Fin.elim0))))) + let meets := GroundSetTerm.app + (M.definable_pairSecondField pairing unions powers separation) + (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 6) (Fin.elim0))))) + let anchors := GroundSetTerm.app + (M.definable_pairSecondField pairing unions powers separation) + (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (v 7) (Fin.elim0))))) + let fresh := GroundSetTerm.app + (M.definable_indexedFresh pairing unions powers separation) + (Fin.cases (indices) (Fin.cases (spaces) (Fin.cases (relations) (Fin.cases (anchors) (Fin.elim0))))) + let nextCarrier := GroundSetTerm.app + (M.definable_taggedExtension pairing unions powers separation) + (Fin.cases (carrier) (Fin.cases (fresh) (Fin.elim0))) + let embeddings := GroundSetTerm.app + (M.definable_pairCompositions pairing unions powers separation) + (Fin.cases (indices) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (bound) (Fin.cases (v 0) (Fin.cases (carrier) (Fin.cases (v 8) (Fin.cases (v 11) (Fin.elim0))))))))) + let filters := GroundSetTerm.app + (M.definable_pairPushFilters pairing unions powers separation) + (Fin.cases (indices) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (v 11) (Fin.cases (v 9) (Fin.elim0)))))))) + let separators := GroundSetTerm.app + (M.definable_recursiveSeparators pairing unions powers separation) + (Fin.cases (indices) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (carrier) (Fin.cases (v 11) (Fin.cases (v 10) (Fin.elim0)))))))) + let maps := GroundSetTerm.app + (M.definable_liftedCompressionFamily pairing unions powers separation) + (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (v 0) (Fin.cases (carrier) (Fin.cases (nextCarrier) (Fin.cases (oldFresh) (Fin.cases (bound) (Fin.cases (v 11) (Fin.cases (v 14) (Fin.cases (v 9) (Fin.cases (v 15) (Fin.cases (v 16) (Fin.cases (v 12) (Fin.elim0)))))))))))))) + let action := GroundSetTerm.app + (M.definable_recursiveAction pairing unions powers separation) + (Fin.cases (v 16) (Fin.cases (carrier) (Fin.cases (v 13) (Fin.cases (v 3) (Fin.cases (indices) (Fin.cases (bound) (Fin.cases (fresh) (Fin.cases (v 12) (Fin.cases (v 17) (Fin.elim0)))))))))) + GroundSetTerm.app (M.definable_nonemptyTuple pairing 12) + (Fin.cases (carrier) (Fin.cases (order) (Fin.cases (meet) (Fin.cases (indices) (Fin.cases (spaces) (Fin.cases (relations) (Fin.cases (meets) (Fin.cases (anchors) (Fin.cases (embeddings) (Fin.cases (filters) (Fin.cases (separators) (Fin.cases (maps) (Fin.cases (action) (Fin.elim0)))))))))))))) + +theorem recursiveSuccessorTerm_eval (env : Fin 18 → ZFSet.{u}) : + (M.recursiveSuccessorTerm pairing unions powers separation).eval env = + RecursiveStateData.successorCodeFromEnvironment M env := by + rfl + +noncomputable def definable_recursiveSuccessorCode : + GroundDefinableFunction M (RecursiveStateData.successorCodeFromEnvironment M) := + (M.recursiveSuccessorTerm pairing unions powers separation).definition.congr + (M.recursiveSuccessorTerm_eval pairing unions powers separation) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace TransitiveGround +noncomputable def compressionSuccessorFormula (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : SetFormula 7 := + decodedSuccessorFormula (M.definable_recursiveSuccessorCode pairing unions powers separation).formula + +end TransitiveGround + +namespace GroundCompressionState +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) + +theorem exists_groundHistory + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : + let φ := M.compressionSuccessorFormula pairing unions powers separation + let params := extend state.data.code + (extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0))))) + ∃ history ∈ M.sets, + OrdinalRecursionTrace (groundRecursionStep M (naturalStepFormula φ) params) ZFSet.omega history ∧ + (∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ + y = (state.data.iterate M I Sources Reps G T n).code) ∧ + (∀ other, OrdinalRecursionTrace (groundRecursionStep M (naturalStepFormula φ) params) + ZFSet.omega other → other = history) ∧ + ∀ n, ∃ current : GroundCompressionState M seed, + current.data = state.data.iterate M I Sources Reps G T n := by + dsimp only + let φ := M.compressionSuccessorFormula pairing unions powers separation + let params := extend I (extend Sources (extend Reps (extend G (extend T Fin.elim0)))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hI (Fin.cases hSources (Fin.cases hReps (Fin.cases hG + (Fin.cases hT (fun i => Fin.elim0 i))))) + let value (n : Nat) := (state.data.iterate M I Sources Reps G T n).code + have values : ∀ n, value n ∈ M.sets := + state.canonical_iterate_code_mem pairing unions powers separation hI hSources hReps hG hT + have nextValue : ∀ n y, y ∈ M.sets → + (Realize M.sets φ (extend (value n) (extend y params)) ↔ y = value (n + 1)) := by + intro n y hy + exact M.realize_recursiveSuccessorCode + (M.definable_recursiveSuccessorCode pairing unions powers separation) + (state.data.iterate M I Sources Reps G T n) (values n) hI hSources hReps hG hT hy + obtain ⟨history, hh, trace, entries, unique⟩ := + M.exists_definableNaturalHistory φ params members value values nextValue + pairing unions separation collection infinite + exact ⟨history, hh, trace, entries, unique, + state.canonical_iterate_valid pairing unions powers separation hI hSources hReps hG hT⟩ + +end GroundCompressionState +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialCompressionHistory + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Sources := literalTaskSourceGraph I P R U Labels + let Filters := literalTaskFilterGraph I P R U Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ seed : FixedCompressionSeed P r μ A τ I Sources Reps G m inv one T Filters, + ∃ history ∈ M.sets, FunctionGraphOn ZFSet.omega history ∧ + (∀ n y, ZFSet.pair (natSetCode n) y ∈ history ↔ + y = ((M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n).code) ∧ + ∀ n, ∃ current : GroundCompressionState M seed, + current.data = (M.initialCompressionData P G r μ A Labels).iterate M I Sources Reps G T n := by + dsimp only + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, initial, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + obtain ⟨history, hh, trace, entries, _, valid⟩ := initial.exists_groundHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, seed, history, hh, trace.1, ?_, ?_⟩ + · simpa only [initialData] using entries + · simpa only [initialData] using valid + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionPrefix.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionPrefix.lean index 200d08b20a89b477f32e7554e3743d6ddf853991..f27cb6b8604e1e1d5a46f3dff091ba6e5b94293f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionPrefix.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialCompressionPrefix.lean @@ -1,109 +1,109 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionOrigin - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialCompressionPrefix - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - Nonempty (GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior) := by - dsimp only - have hOld : old ∈ M.sets := priorBirth ▸ prior.birth_mem base baseMember - have oldFunction : FunctionGraphOn P old := by - rw [← priorSpace, ← priorBirth] - exact ⟨T0, prior.birth_function base baseMember⟩ - have oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base := by - intro x t entry - have priorEntry : ZFSet.pair x t ∈ prior.birth base := priorBirth.symm ▸ entry - have hx := (ZFSet.pair_mem_prod.1 ((prior.birth_function base baseMember).1 priorEntry)).1 - exact (prior.birth_bound base baseMember x hx t priorEntry).symm - have oldMeet : OldMeetCode r μ old := by - rw [← priorOrder, ← priorMeet, ← priorBirth] - exact prior.old_meet base baseMember - obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := - M.exists_groundInitialCompressionState pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet hτ top - refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ - rw [← initialData] - obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite - hI hSources hReps hG hT - have accounting := state.initial_union_range_accounting algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl - obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation - hI hSources hReps hG hT accounting - have initialDomain : state.data.D = P := by rw [initialData]; rfl - have initialOrder : state.data.rD = r := by rw [initialData]; rfl - have constant : RecursiveTemplateConstancy P r μ state.data := by - rw [initialData] - exact M.initialCompressionData_template_constancy P G r μ A Labels - obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union - pairing unions powers separation collection infinite choice hI hSources hReps hG hT - initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above - coordinateInjection originalSmall - have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation - hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl - have initialBirthFunction : FunctionGraphOn state.data.D old := initialDomain.symm ▸ oldFunction - have initialOldMeet : OldMeetCode state.data.rD state.data.μD old := by - rw [initialData] - exact oldMeet - obtain ⟨births⟩ := state.exists_groundBirthData completion.algebra.union - pairing unions powers separation collection infinite hI hSources hReps hG hT - hBase hOld (ordinalSetProperty_member ordinal baseMember) initialBirthFunction oldBound initialOldMeet - have initialMeet : state.data.μD = μ := by rw [initialData]; rfl - let history := state.prefixHistory completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth - refine ⟨⟨⟨⟨⟨completion, heights⟩, profiles⟩, births⟩, history, priorHeight, ?_, ?_, ?_⟩⟩ - · intro s before - exact state.prefixHistory_old completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth before - · intro n - exact state.prefixHistory_stamp completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth n - · exact state.prefixHistory_limit completion.algebra.union births heights prior - pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant - initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialCompressionOrigin + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialCompressionPrefix + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one τ C D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (columns : ordinalSetProperty C) (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + Nonempty (GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior) := by + dsimp only + have hOld : old ∈ M.sets := priorBirth ▸ prior.birth_mem base baseMember + have oldFunction : FunctionGraphOn P old := by + rw [← priorSpace, ← priorBirth] + exact ⟨T0, prior.birth_function base baseMember⟩ + have oldBound : ∀ x t, ZFSet.pair x t ∈ old → t ∈ base ∨ t = base := by + intro x t entry + have priorEntry : ZFSet.pair x t ∈ prior.birth base := priorBirth.symm ▸ entry + have hx := (ZFSet.pair_mem_prod.1 ((prior.birth_function base baseMember).1 priorEntry)).1 + exact (prior.birth_bound base baseMember x hx t priorEntry).symm + have oldMeet : OldMeetCode r μ old := by + rw [← priorOrder, ← priorMeet, ← priorBirth] + exact prior.old_meet base baseMember + obtain ⟨hI, hSources, hFilters, hG, hT, Reps, hReps, seed, state, initialData⟩ := + M.exists_groundInitialCompressionState pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet hτ top + refine ⟨hI, hSources, hFilters, hT, Reps, hReps, ?_⟩ + rw [← initialData] + obtain ⟨algebra⟩ := state.exists_groundAlgebra pairing unions powers separation collection infinite + hI hSources hReps hG hT + have accounting := state.initial_union_range_accounting algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl rfl + obtain ⟨completion⟩ := state.completion_of_accounting algebra pairing unions powers separation + hI hSources hReps hG hT accounting + have initialDomain : state.data.D = P := by rw [initialData]; rfl + have initialOrder : state.data.rD = r := by rw [initialData]; rfl + have constant : RecursiveTemplateConstancy P r μ state.data := by + rw [initialData] + exact M.initialCompressionData_template_constancy P G r μ A Labels + obtain ⟨heights⟩ := state.exists_groundHeightData completion.algebra.union + pairing unions powers separation collection infinite choice hI hSources hReps hG hT + initialDomain initialOrder constant hP hC hD hrD hc hOriginal originalCode columns target above + coordinateInjection originalSmall + have profiles := state.initial_union_profiles completion.algebra pairing unions powers separation + hP hG hr hμ hA hLabels hI hSources hReps hT initialData rfl + have initialBirthFunction : FunctionGraphOn state.data.D old := initialDomain.symm ▸ oldFunction + have initialOldMeet : OldMeetCode state.data.rD state.data.μD old := by + rw [initialData] + exact oldMeet + obtain ⟨births⟩ := state.exists_groundBirthData completion.algebra.union + pairing unions powers separation collection infinite hI hSources hReps hG hT + hBase hOld (ordinalSetProperty_member ordinal baseMember) initialBirthFunction oldBound initialOldMeet + have initialMeet : state.data.μD = μ := by rw [initialData]; rfl + let history := state.prefixHistory completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth + refine ⟨⟨⟨⟨⟨completion, heights⟩, profiles⟩, births⟩, history, priorHeight, ?_, ?_, ?_⟩⟩ + · intro s before + exact state.prefixHistory_old completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth before + · intro n + exact state.prefixHistory_stamp completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth n + · exact state.prefixHistory_limit completion.algebra.union births heights prior + pairing unions powers separation hI hSources hReps hG hT ordinal baseMember constant + initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalBirths.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalBirths.lean index d7f3629c2c8c98e3221f099fff5296466775fecb..2cbdb5801bad29ab40b29827b227ba303f3c2e30 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalBirths.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalBirths.lean @@ -1,88 +1,88 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialExternalHeights - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite - -include choice in -theorem exists_groundInitialExternalBirths - {P G r μ A Labels m inv one τ D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ I Sources Reps G m inv one T Filters, - ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, - GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalBoundedGeometryData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ - ∃ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD ∧ - ∃ heights : GroundExternalHeightData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion, - GroundBoundedExternalHeightData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights ∧ - ∃ births : GroundExternalBirthData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth - compression.born.profiled.heighted.completion, - GroundBoundedExternalBirthData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth - compression.born.profiled.heighted.completion births := by - dsimp only - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, - boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights⟩ := - M.exists_groundInitialExternalHeights pairing unions powers separation collection infinite choice - hP hG hr hμ hA hLabels hm hInv group action meet hτ top hD hrD hc hOriginal - originalCode target above coordinateInjection originalSmall hBase prior ordinal baseMember - priorSpace priorOrder priorMeet priorBirth priorHeight - obtain ⟨births⟩ := data.exists_externalBirths group action pairing unions powers separation collection infinite - hG hP compression.born.births - exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, - boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, - births.boundedData pairing unions geometry⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialExternalHeights + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite + +include choice in +theorem exists_groundInitialExternalBirths + {P G r μ A Labels m inv one τ D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ I Sources Reps G m inv one T Filters, + ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, + GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalBoundedGeometryData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ + ∃ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD ∧ + ∃ heights : GroundExternalHeightData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion, + GroundBoundedExternalHeightData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights ∧ + ∃ births : GroundExternalBirthData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth + compression.born.profiled.heighted.completion, + GroundBoundedExternalBirthData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth + compression.born.profiled.heighted.completion births := by + dsimp only + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, + boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights⟩ := + M.exists_groundInitialExternalHeights pairing unions powers separation collection infinite choice + hP hG hr hμ hA hLabels hm hInv group action meet hτ top hD hrD hc hOriginal + originalCode target above coordinateInjection originalSmall hBase prior ordinal baseMember + priorSpace priorOrder priorMeet priorBirth priorHeight + obtain ⟨births⟩ := data.exists_externalBirths group action pairing unions powers separation collection infinite + hG hP compression.born.births + exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, + boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, + births.boundedData pairing unions geometry⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalChronology.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalChronology.lean index 7f2737f099186fb94d3d27e2b9757a443baba319..5588ba3dcbe2ab699d3466828e58036ec27cabc5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalChronology.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialExternalChronology.lean @@ -1,685 +1,685 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFixedTopTerminal -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalCutoffCoherence -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalCutoffLayers -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalProfilePreservation -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialExternalBirths -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram - -namespace OAI - - -namespace PartitionPilot.Forcing.GroundExternalGeometryInputs -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -local notation "U" => completion.algebra.union.fields 0 -local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 -local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 -local notation "r" => completion.externalPointOrder P0 r0 μ0 A0 -local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 -local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 -local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 -include data group oldAction pairing unions powers separation infinite hG hP0 births - -noncomputable def externalBirth_prior_layer - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} {t : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet U - (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t) - (groundSources : ∀ s ∈ t, Space s ∈ M.sets) - (oldFunction : ZFSet.IsFunc U oldTimes oldBirth) (oldTime : t ∈ oldTimes ∨ t = oldTimes) : - CodedGrowthLayer M Space sourceOrder sourceMeet B r μ births.birth t := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - apply layer.ownerBirth_pushforward pairing unions powers separation (completion.algebra.union.ground 0) - geometry.carrier_ground (geometry.copies_ground _ data.group.group_code.identity_mem) - (M.omega_mem separation infinite) groundSources completion.algebra.union.meet - embedding.toMeetEmbeddingCode (fun _ hx => hx) oldFunction - intro n a entry - rw [(births.times.entries n a).1 entry] - exact compressionStamp_old_mem oldTime n - -noncomputable def externalBirth_cutoff_prior_layer - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} {t : ZFSet.{u}} - (layer : CodedGrowthLayer M Space sourceOrder sourceMeet U - (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t) - (groundSources : ∀ s ∈ t, Space s ∈ M.sets) - (oldFunction : ZFSet.IsFunc U oldTimes oldBirth) (oldTime : t ∈ oldTimes ∨ t = oldTimes) - (n : Nat) : - CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) - (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t := by - have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 - have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG - have hQ := M.ownerLevelPrefix_mem pairing unions powers separation infinite - (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) - geometry.carrier_ground - (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).1 - (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) (natSetCode_mem_omega n) - have restricted := embedding.toMeetEmbeddingCode.restrictTarget (Q := births.cutoff n) (by - intro x y copied - have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) - exact births.cutoff_old n ((mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, copied⟩)) - have transported : CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) - (births.cutoffOrder n) (births.cutoffMeet n) births.birth t := by - apply layer.ownerBirth_pushforward pairing unions powers separation (completion.algebra.union.ground 0) - hQ (geometry.copies_ground _ data.group.group_code.identity_mem) (M.omega_mem separation infinite) - groundSources completion.algebra.union.meet restricted (births.cutoff_subset n) oldFunction - intro k a entry - rw [(births.times.entries k a).1 entry] - exact compressionStamp_old_mem oldTime k - exact transported.restrictBirth - (geometry.meet.restrict_lower (births.cutoff_subset n) - (births.cutoff_lower data group oldAction pairing unions powers separation infinite hG hP0 n)) - -end PartitionPilot.Forcing.GroundExternalGeometryInputs - - - -namespace PartitionPilot.Forcing -universe u - -structure GroundChronologicalExternal (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) - (I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}) - (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) - (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) - (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) - (prior : GroundChronologicalHistory M T0 C D rD) where - inputs : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion - history : GroundChronologicalHistory M (insert births.limit births.limit) C D rD - old_values : ∀ s, s ∈ oldTimes ∨ s = oldTimes → - history.space s = prior.space s ∧ history.order s = prior.order s ∧ - history.meetGraph s = prior.meetGraph s ∧ history.birth s = prior.birth s ∧ history.height s = prior.height s - stamp_values : ∀ n, - history.space (compressionStamp oldTimes n) = births.cutoff n ∧ - history.order (compressionStamp oldTimes n) = births.cutoffOrder n ∧ - history.meetGraph (compressionStamp oldTimes n) = births.cutoffMeet n ∧ - history.birth (compressionStamp oldTimes n) = births.cutoffBirth n ∧ - history.height (compressionStamp oldTimes n) = births.cutoffHeight heights.height n - limit_values : - history.space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 ∧ - history.order births.limit = completion.externalPointOrder P0 r0 μ0 A0 ∧ - history.meetGraph births.limit = completion.externalPointMeet P0 r0 μ0 A0 ∧ - history.birth births.limit = births.birth ∧ history.height births.limit = heights.height - bounded_history : GroundChronologicalHistory M (insert births.limit births.limit) C D rD - bounded_old_values : ∀ s ∈ births.limit, - bounded_history.space s = history.space s ∧ bounded_history.order s = history.order s ∧ - bounded_history.meetGraph s = history.meetGraph s ∧ bounded_history.birth s = history.birth s ∧ - bounded_history.height s = history.height s - bounded_values : - bounded_history.space births.limit = completion.externalBoundedCarrier P0 r0 μ0 A0 ∧ - bounded_history.order births.limit = completion.externalBoundedOrder P0 r0 μ0 A0 ∧ - bounded_history.meetGraph births.limit = completion.externalBoundedMeet P0 r0 μ0 A0 ∧ - bounded_history.birth births.limit = births.boundedBirth ∧ - bounded_history.height births.limit = heights.boundedHeight - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundChronologicalHistory M T0 C D rD) - -theorem chronologyFields_ground - (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) - (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) - (ordinal : ordinalSetProperty T0) (hOld : oldTimes ∈ T0) - {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : - let fields := births.chronologyFields heights prior - fields.space s ∈ M.sets ∧ fields.order s ∈ M.sets ∧ fields.meetGraph s ∈ M.sets ∧ - fields.birth s ∈ M.sets ∧ fields.height s ∈ M.sets := by - classical - dsimp only - by_cases before : s ∈ oldTimes ∨ s = oldTimes - · have hs := before.elim (fun member => ordinal.1 oldTimes hOld s member) - (fun equal => equal.symm ▸ hOld) - obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_old heights prior before - rw [space, order, meet, birth, height] - exact ⟨prior.space_mem s hs, prior.order_mem s hs, prior.meet_mem s hs, - prior.birth_mem s hs, prior.height_mem s hs⟩ - · rcases ZFSet.mem_insert_iff.1 cutoff with rfl | below - · obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_limit heights prior - rw [space, order, meet, birth, height] - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 - exact ⟨geometry.carrier_ground, geometry.order_ground, geometry.meet_ground, - births.birth_ground, heights.height_ground⟩ - · have stamped : ∃ n, s = compressionStamp oldTimes n := by - rcases (births.times.mem_limit_iff s).1 below with member | equal | stamped - · exact False.elim (before (Or.inl member)) - · exact False.elim (before (Or.inr equal)) - · exact stamped - obtain ⟨n, rfl⟩ := stamped - obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_stamp heights prior n - rw [space, order, meet, birth, height] - have fields := births.cutoff_fields data group action pairing unions powers separation infinite hG hP0 heights n - exact ⟨fields.1, fields.2.1, fields.2.2.1, fields.2.2.2.1, fields.2.2.2.2.1⟩ - -end PartitionPilot.Forcing.GroundExternalBirthData - - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundChronologicalHistory M T0 C D rD) -local notation "fields" => births.chronologyFields heights prior -local notation "U" => completion.algebra.union.fields 0 - -theorem chronology_sources_eq_below {t s : ZFSet.{u}} - (oldTime : t ∈ oldTimes ∨ t = oldTimes) (before : s ∈ t) : - (fields).space s = prior.space s ∧ (fields).order s = prior.order s ∧ - (fields).meetGraph s = prior.meetGraph s := by - dsimp only [chronologyFields] - exact ⟨compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, - compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, - compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before⟩ - -variable (ordinal : ordinalSetProperty T0) (hOldTimes : oldTimes ∈ T0) -include ordinal hOldTimes - -noncomputable def chronology_old_layer {cutoff t : ZFSet.{u}} - (oldCutoff : cutoff ∈ oldTimes ∨ cutoff = oldTimes) (bound : t = cutoff ∨ t ∈ cutoff) : - CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph - ((fields).space cutoff) ((fields).order cutoff) ((fields).meetGraph cutoff) ((fields).birth cutoff) t := by - have hc : cutoff ∈ T0 := oldCutoff.elim - (fun member => ordinal.1 oldTimes hOldTimes cutoff member) (fun equal => equal.symm ▸ hOldTimes) - have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) - (fun before => ordinal.1 cutoff hc t before) - have oldTime : t ∈ oldTimes ∨ t = oldTimes := by - rcases bound with equal | before - · exact equal.symm ▸ oldCutoff - · exact Or.inl (oldCutoff.elim - (fun member => ordinal.2 oldTimes hOldTimes cutoff member t before) (fun equal => equal ▸ before)) - have layer := (prior.layer cutoff hc t ht bound).congr_sources_below - (fun s hs => (births.chronology_sources_eq_below heights prior oldTime hs).1.symm) - (fun s hs => (births.chronology_sources_eq_below heights prior oldTime hs).2.1.symm) - (fun s hs => (births.chronology_sources_eq_below heights prior oldTime hs).2.2.symm) - have values := births.chronologyFields_old heights prior oldCutoff - simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer - -theorem chronology_sources_ground_below {t : ZFSet.{u}} - (oldTime : t ∈ oldTimes ∨ t = oldTimes) : ∀ s ∈ t, (fields).space s ∈ M.sets := by - intro s hs - rw [(births.chronology_sources_eq_below heights prior oldTime hs).1] - have ht : t ∈ T0 := oldTime.elim - (fun member => ordinal.1 oldTimes hOldTimes t member) (fun equal => equal.symm ▸ hOldTimes) - exact prior.space_mem s (ordinal.1 t ht s hs) - -variable (priorSpace : prior.space oldTimes = completion.algebra.union.fields 0) -variable (priorOrder : prior.order oldTimes = completion.algebra.union.fields 1) -variable (priorMeet : prior.meetGraph oldTimes = completion.algebra.union.fields 2) -variable (priorBirth : prior.birth oldTimes = oldBirth) -include priorSpace priorOrder priorMeet priorBirth - -noncomputable def chronology_base_layer (t : ZFSet.{u}) (oldTime : t ∈ oldTimes ∨ t = oldTimes) : - CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph U - (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t := by - have layer := births.chronology_old_layer heights prior ordinal hOldTimes - (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) oldTime.symm - have values := births.chronologyFields_old heights prior (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) - simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1, - priorSpace, priorOrder, priorMeet, priorBirth] using layer - -variable {inv : ZFSet.{u}} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (oldFunction : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) -include data group action pairing unions powers separation infinite hG hP0 oldFunction - -noncomputable def chronology_finite_layers (n : Nat) (t : ZFSet.{u}) - (bound : t = compressionStamp oldTimes n ∨ t ∈ compressionStamp oldTimes n) : - CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph - ((fields).space (compressionStamp oldTimes n)) ((fields).order (compressionStamp oldTimes n)) - ((fields).meetGraph (compressionStamp oldTimes n)) ((fields).birth (compressionStamp oldTimes n)) t := by - have values := births.chronologyFields_stamp heights prior n - rw [values.1, values.2.1, values.2.2.1, values.2.2.2.1] - have atBase := births.chronologyFields_old heights prior (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) - have fresh (k : Nat) (before : k ≤ n) := data.externalBirth_cutoff_fresh_layer group action - pairing unions powers separation infinite hG hP0 births (fields).space (fields).order (fields).meetGraph - (atBase.1.trans priorSpace) (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) k n before - have original (s : ZFSet.{u}) (oldTime : s ∈ oldTimes ∨ s = oldTimes) := - data.externalBirth_cutoff_prior_layer group action pairing unions powers separation infinite hG hP0 births - (births.chronology_base_layer heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth s oldTime) - (births.chronology_sources_ground_below heights prior ordinal hOldTimes oldTime) oldFunction oldTime n - apply Classical.choice - rcases bound with rfl | before - · exact ⟨fresh n (Nat.le_refl n)⟩ - · rcases (mem_compressionStamp_iff oldTimes t n).1 before with old | same | ⟨k, earlier, rfl⟩ - · exact ⟨original t (Or.inl old)⟩ - · exact ⟨original t (Or.inr same)⟩ - · exact ⟨fresh k (Nat.le_of_lt earlier)⟩ - -noncomputable def chronology_union_layers (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : - CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph - ((fields).space births.limit) ((fields).order births.limit) - ((fields).meetGraph births.limit) ((fields).birth births.limit) t := by - have values := births.chronologyFields_limit heights prior - rw [values.1, values.2.1, values.2.2.1, values.2.2.2.1] - have atBase := births.chronologyFields_old heights prior (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) - have original (s : ZFSet.{u}) (oldTime : s ∈ oldTimes ∨ s = oldTimes) := - data.externalBirth_prior_layer group action pairing unions powers separation infinite hG hP0 births - (births.chronology_base_layer heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth s oldTime) - (births.chronology_sources_ground_below heights prior ordinal hOldTimes oldTime) oldFunction oldTime - apply Classical.choice - rcases bound with rfl | before - · exact ⟨.empty_of_no_birth ⟨births.limit, births.limit_ground⟩ (fun x _ => births.no_limit_birth x)⟩ - · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨k, rfl⟩ - · exact ⟨original t (Or.inl old)⟩ - · exact ⟨original t (Or.inr same)⟩ - · exact ⟨data.externalBirth_fresh_layer group action pairing unions powers separation infinite hG hP0 births - (fields).space (fields).order (fields).meetGraph (atBase.1.trans priorSpace) - (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) k⟩ - -noncomputable def chronology_all_layers : - ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, - t = cutoff ∨ t ∈ cutoff → CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph - ((fields).space cutoff) ((fields).order cutoff) ((fields).meetGraph cutoff) ((fields).birth cutoff) t := by - intro cutoff hc t _ bound - apply Classical.choice - rcases ZFSet.mem_insert_iff.1 hc with rfl | before - · exact ⟨births.chronology_union_layers heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth - data group action pairing unions powers separation infinite hG hP0 oldFunction t bound⟩ - · rcases (births.times.mem_limit_iff cutoff).1 before with old | same | ⟨n, rfl⟩ - · exact ⟨births.chronology_old_layer heights prior ordinal hOldTimes (Or.inl old) bound⟩ - · exact ⟨births.chronology_old_layer heights prior ordinal hOldTimes (Or.inr same) bound⟩ - · exact ⟨births.chronology_finite_layers heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth - data group action pairing unions powers separation infinite hG hP0 oldFunction n t bound⟩ - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 Filters C D rD lo hi seed : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion heights) -variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) -variable {b b' : ZFSet.{u}} (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) -variable (image : ZFSet.pair b b' ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) -local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) - -noncomputable def externalMainStage : GroundMainStage M C D rD := - let geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP0 - let bottom := data.externalOriginalEmbedding_bottom origin group action pairing unions powers separation infinite - hI hSources hReps hG hT hP0 initialDomain initialOrder least image - { carrier := completion.externalBoundedCarrier P0 r0 μ0 A0 - order := completion.externalBoundedOrder P0 r0 μ0 A0 - meetGraph := completion.externalBoundedMeet P0 r0 μ0 A0 - actors := M.externalGroupCarrier G letters m one - multiplication := M.externalGroupMultiplication G letters m one - inverse := M.externalGroupInverse G letters m inv one - identity := M.externalGroupIdentity G letters m one - action := completion.externalBoundedAction P0 r0 μ0 A0 - bottom := b' - top := completion.externalPointCarrier P0 r0 μ0 A0 - height := heights.boundedHeight - carrier_ground := geometry.carrier_ground - order_ground := geometry.order_ground - meet_ground := geometry.meet_ground - actors_ground := data.group.carrier_mem - multiplication_ground := data.group.multiplication_mem - inverse_ground := data.group.inverse_mem - action_ground := geometry.action_ground - height_ground := boundedHeights.height_ground - columns_ground := hC - coordinates_ground := hD - coordinate_order_ground := hrD - meet := geometry.meet - group_code := data.group.group_code - action_code := geometry.action - bottom_mem := bottom.1 - least := bottom.2 - top_mem := geometry.top_mem - greatest := geometry.greatest - height_code := boundedHeights.code - height_range_ground := boundedHeights.range_ground - height_range_countable := boundedHeights.range_countable } - -theorem externalMainStage_fields : - let stage := data.externalMainStage origin group action pairing unions powers separation infinite - hI hSources hReps hG hT hP0 initialDomain initialOrder heights boundedHeights hC hD hrD least image - stage.carrier = completion.externalBoundedCarrier P0 r0 μ0 A0 ∧ - stage.order = completion.externalBoundedOrder P0 r0 μ0 A0 ∧ - stage.meetGraph = completion.externalBoundedMeet P0 r0 μ0 A0 ∧ - stage.actors = M.externalGroupCarrier G letters m one ∧ - stage.multiplication = M.externalGroupMultiplication G letters m one ∧ - stage.inverse = M.externalGroupInverse G letters m inv one ∧ - stage.identity = M.externalGroupIdentity G letters m one ∧ - stage.action = completion.externalBoundedAction P0 r0 μ0 A0 ∧ - stage.bottom = b' ∧ stage.top = completion.externalPointCarrier P0 r0 μ0 A0 ∧ - stage.height = heights.boundedHeight := by - exact ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ - -end GroundExternalGeometryInputs - -namespace GroundChronologicalExternal -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 Filters : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable {births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion} -variable {heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion} -variable {prior : GroundChronologicalHistory M T0 C D rD} -variable (external : GroundChronologicalExternal M initial I Sources Reps G m inv one T τ - P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 completion births heights prior) -variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) -variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion heights) -variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) -variable {b b' : ZFSet.{u}} (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) -variable (image : ZFSet.pair b b' ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) - -noncomputable def toMainStage : GroundChronologicalMainStage M C D rD where - stage := external.inputs.externalMainStage origin group action pairing unions powers separation infinite - hI hSources hReps hG hT hP0 initialDomain initialOrder heights boundedHeights hC hD hrD least image - cutoff := births.limit - cutoff_ground := births.limit_ground - cutoff_ordinal := births.times.ordinal - history := external.bounded_history - carrier_eq := external.bounded_values.1 - order_eq := external.bounded_values.2.1 - meet_eq := external.bounded_values.2.2.1 - height_eq := external.bounded_values.2.2.2.2 - -theorem toMainStage_birth : - (external.toMainStage origin group action pairing unions powers separation infinite hI hSources hReps - hG hT hP0 initialDomain initialOrder boundedHeights hC hD hrD least image).birth = births.boundedBirth := - external.bounded_values.2.2.2.1 - -end GroundChronologicalExternal -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundChronologicalHistory M T0 C D rD) -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) -variable (ordinal : ordinalSetProperty T0) (hOldTimes : oldTimes ∈ T0) -variable (priorSpace : prior.space oldTimes = completion.algebra.union.fields 0) -variable (priorOrder : prior.order oldTimes = completion.algebra.union.fields 1) -variable (priorMeet : prior.meetGraph oldTimes = completion.algebra.union.fields 2) -variable (priorBirth : prior.birth oldTimes = oldBirth) -variable (oldFunction : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) - -noncomputable def chronologyHistory : - GroundChronologicalHistory M (insert births.limit births.limit) C D rD where - space := (births.chronologyFields heights prior).space - order := (births.chronologyFields heights prior).order - meetGraph := (births.chronologyFields heights prior).meetGraph - birth := (births.chronologyFields heights prior).birth - height := (births.chronologyFields heights prior).height - space_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).1 - order_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.1 - meet_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.1 - birth_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.1 - height_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.2 - meet_order := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).1 - birth_function := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.1 - birth_bound := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.1 - old_meet := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.1 - strict_height := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.2 - layer := births.chronology_all_layers heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth - data group action pairing unions powers separation infinite hG hP0 oldFunction - -local notation "history" => births.chronologyHistory heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes - priorSpace priorOrder priorMeet priorBirth oldFunction - -theorem chronologyHistory_old {s : ZFSet.{u}} (before : s ∈ oldTimes ∨ s = oldTimes) : - (history).space s = prior.space s ∧ (history).order s = prior.order s ∧ - (history).meetGraph s = prior.meetGraph s ∧ (history).birth s = prior.birth s ∧ - (history).height s = prior.height s := births.chronologyFields_old heights prior before - -theorem chronologyHistory_stamp (n : Nat) : - (history).space (compressionStamp oldTimes n) = births.cutoff n ∧ - (history).order (compressionStamp oldTimes n) = births.cutoffOrder n ∧ - (history).meetGraph (compressionStamp oldTimes n) = births.cutoffMeet n ∧ - (history).birth (compressionStamp oldTimes n) = births.cutoffBirth n ∧ - (history).height (compressionStamp oldTimes n) = births.cutoffHeight heights.height n := - births.chronologyFields_stamp heights prior n - -theorem chronologyHistory_limit : - (history).space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 ∧ - (history).order births.limit = completion.externalPointOrder P0 r0 μ0 A0 ∧ - (history).meetGraph births.limit = completion.externalPointMeet P0 r0 μ0 A0 ∧ - (history).birth births.limit = births.birth ∧ (history).height births.limit = heights.height := - births.chronologyFields_limit heights prior - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing.GroundExternalBirthData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 oldTimes oldBirth completion) -variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion) -variable (prior : GroundChronologicalHistory M T0 C D rD) - -noncomputable def chronologicalData - (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) - (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) - (ordinal : ordinalSetProperty T0) (hOldTimes : oldTimes ∈ T0) - (priorSpace : prior.space oldTimes = completion.algebra.union.fields 0) - (priorOrder : prior.order oldTimes = completion.algebra.union.fields 1) - (priorMeet : prior.meetGraph oldTimes = completion.algebra.union.fields 2) - (priorBirth : prior.birth oldTimes = oldBirth) - (oldFunction : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) - (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 C D rD lo hi seed completion heights) : - GroundChronologicalExternal M initial I Sources Reps G m inv one T τ - P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 completion births heights prior := by - let history := births.chronologyHistory heights prior data group action - pairing unions powers separation infinite hG hP0 ordinal hOldTimes - priorSpace priorOrder priorMeet priorBirth oldFunction - have terminal := births.chronologyFields_limit heights prior - have space : history.space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 := terminal.1 - have order : history.order births.limit = completion.externalPointOrder P0 r0 μ0 A0 := terminal.2.1 - have birth : history.birth births.limit = births.birth := terminal.2.2.2.1 - have earlier : ∀ x t, ZFSet.pair x t ∈ history.birth births.limit → t ∈ births.limit := by - intro x t entry - rw [birth] at entry - exact (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2 - have heightCode : StrictLexHeightCode (fixedTopCarrier (history.space births.limit)) C D - (fixedTopOrder (history.space births.limit) (history.order births.limit)) heights.boundedHeight rD := by - rw [space, order] - exact boundedHeights.code - let bounded := history.replaceTerminalFixedTop pairing unions powers separation births.times.ordinal - births.limit_ground earlier heights.boundedHeight boundedHeights.height_ground heightCode - refine ⟨data, history, (fun _ before => births.chronologyFields_old heights prior before), - (fun n => births.chronologyFields_stamp heights prior n), terminal, bounded, ?_, ?_⟩ - · intro s hs - exact history.replaceTerminalFixedTop_old pairing unions powers separation births.times.ordinal - births.limit_ground earlier heights.boundedHeight boundedHeights.height_ground heightCode hs - · have values := history.replaceTerminalFixedTop_terminal pairing unions powers separation births.times.ordinal - births.limit_ground earlier heights.boundedHeight boundedHeights.height_ground heightCode - rw [space, order, birth] at values - exact values - -end PartitionPilot.Forcing.GroundExternalBirthData - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite - -include choice in -theorem exists_groundInitialExternalChronology - {P G r μ A Labels m inv one τ D rD c original base old T0 : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) - (originalCode : StrictLexHeightCode P C D r original rD) - (target : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) - (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) - (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) - (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) - (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) - (priorHeight : prior.height base = original) : - let I := M.groundEligibleTasks P G r μ A Labels - let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels - let T := M.groundTaskTransport P G r μ A Labels - I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ - ∃ Reps ∈ M.sets, - ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) - P r μ A τ I Sources Reps G m inv one T Filters, - ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, - GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ - GroundExternalBoundedGeometryData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ - ∃ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD ∧ - ∃ heights : GroundExternalHeightData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion, - GroundBoundedExternalHeightData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights ∧ - ∃ births : GroundExternalBirthData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth - compression.born.profiled.heighted.completion, - GroundBoundedExternalBirthData M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth - compression.born.profiled.heighted.completion births ∧ - Nonempty (GroundChronologicalExternal M (M.initialCompressionData P G r μ A Labels) - I Sources Reps G m inv one T τ P r μ A compression.born.births.limit compression.born.births.birth - C D rD lo hi compression.born.profiled.heighted.heights.height - (insert compression.born.births.limit compression.born.births.limit) - compression.born.profiled.heighted.completion births heights compression.history) := by - dsimp only - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, - boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, boundedBirths⟩ := - M.exists_groundInitialExternalBirths pairing unions powers separation collection infinite choice - hP hG hr hμ hA hLabels hm hInv group action meet hτ top hD hrD hc hOriginal - originalCode target above coordinateInjection originalSmall hBase prior ordinal baseMember - priorSpace priorOrder priorMeet priorBirth priorHeight - let chronological := births.chronologicalData heights compression.history data group action - pairing unions powers separation infinite hG hP - (ordinalSetProperty_succ compression.born.births.times.ordinal) - (ZFSet.mem_insert_iff.2 (Or.inl rfl)) - compression.limit_values.1 compression.limit_values.2.1 compression.limit_values.2.2.1 - compression.limit_values.2.2.2.1 compression.born.births.function boundedHeights - exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, - boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, boundedBirths, - ⟨chronological⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFixedTopTerminal +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalCutoffCoherence +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalCutoffLayers +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalProfilePreservation +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialExternalBirths +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram + +namespace OAI + + +namespace PartitionPilot.Forcing.GroundExternalGeometryInputs +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (oldAction : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +local notation "U" => completion.algebra.union.fields 0 +local notation "P" => completion.externalSeedCarrier P0 r0 μ0 A0 +local notation "B" => completion.externalPointCarrier P0 r0 μ0 A0 +local notation "r" => completion.externalPointOrder P0 r0 μ0 A0 +local notation "μ" => completion.externalPointMeet P0 r0 μ0 A0 +local notation "E" => completion.externalIdentityCopyGraph P0 r0 μ0 A0 +local notation "levels" => completion.externalOwnerLevels P0 r0 μ0 A0 +include data group oldAction pairing unions powers separation infinite hG hP0 births + +noncomputable def externalBirth_prior_layer + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} {t : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet U + (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t) + (groundSources : ∀ s ∈ t, Space s ∈ M.sets) + (oldFunction : ZFSet.IsFunc U oldTimes oldBirth) (oldTime : t ∈ oldTimes ∨ t = oldTimes) : + CodedGrowthLayer M Space sourceOrder sourceMeet B r μ births.birth t := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + apply layer.ownerBirth_pushforward pairing unions powers separation (completion.algebra.union.ground 0) + geometry.carrier_ground (geometry.copies_ground _ data.group.group_code.identity_mem) + (M.omega_mem separation infinite) groundSources completion.algebra.union.meet + embedding.toMeetEmbeddingCode (fun _ hx => hx) oldFunction + intro n a entry + rw [(births.times.entries n a).1 entry] + exact compressionStamp_old_mem oldTime n + +noncomputable def externalBirth_cutoff_prior_layer + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} {t : ZFSet.{u}} + (layer : CodedGrowthLayer M Space sourceOrder sourceMeet U + (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t) + (groundSources : ∀ s ∈ t, Space s ∈ M.sets) + (oldFunction : ZFSet.IsFunc U oldTimes oldBirth) (oldTime : t ∈ oldTimes ∨ t = oldTimes) + (n : Nat) : + CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) + (births.cutoffOrder n) (births.cutoffMeet n) (births.cutoffBirth n) t := by + have geometry := data.externalGeometryData group oldAction pairing unions powers separation infinite hG hP0 + have embedding := data.externalIdentityCopy_ideal group oldAction pairing unions powers separation infinite hG + have hQ := M.ownerLevelPrefix_mem pairing unions powers separation infinite + (data.externalSeedCarrier_ground group oldAction pairing unions powers separation infinite hG hP0) + geometry.carrier_ground + (data.externalOwnerLevels_ground_function group oldAction pairing unions powers separation infinite hG hP0).1 + (fun _ hx => (mem_relationImage _ _ _ _).1 hx |>.1) (natSetCode_mem_omega n) + have restricted := embedding.toMeetEmbeddingCode.restrictTarget (Q := births.cutoff n) (by + intro x y copied + have bounds := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 copied) + exact births.cutoff_old n ((mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, copied⟩)) + have transported : CodedGrowthLayer M Space sourceOrder sourceMeet (births.cutoff n) + (births.cutoffOrder n) (births.cutoffMeet n) births.birth t := by + apply layer.ownerBirth_pushforward pairing unions powers separation (completion.algebra.union.ground 0) + hQ (geometry.copies_ground _ data.group.group_code.identity_mem) (M.omega_mem separation infinite) + groundSources completion.algebra.union.meet restricted (births.cutoff_subset n) oldFunction + intro k a entry + rw [(births.times.entries k a).1 entry] + exact compressionStamp_old_mem oldTime k + exact transported.restrictBirth + (geometry.meet.restrict_lower (births.cutoff_subset n) + (births.cutoff_lower data group oldAction pairing unions powers separation infinite hG hP0 n)) + +end PartitionPilot.Forcing.GroundExternalGeometryInputs + + + +namespace PartitionPilot.Forcing +universe u + +structure GroundChronologicalExternal (M : TransitiveGround.{u}) (initial : RecursiveStateData.{u}) + (I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}) + (completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ) + (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) + (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) + (prior : GroundChronologicalHistory M T0 C D rD) where + inputs : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion + history : GroundChronologicalHistory M (insert births.limit births.limit) C D rD + old_values : ∀ s, s ∈ oldTimes ∨ s = oldTimes → + history.space s = prior.space s ∧ history.order s = prior.order s ∧ + history.meetGraph s = prior.meetGraph s ∧ history.birth s = prior.birth s ∧ history.height s = prior.height s + stamp_values : ∀ n, + history.space (compressionStamp oldTimes n) = births.cutoff n ∧ + history.order (compressionStamp oldTimes n) = births.cutoffOrder n ∧ + history.meetGraph (compressionStamp oldTimes n) = births.cutoffMeet n ∧ + history.birth (compressionStamp oldTimes n) = births.cutoffBirth n ∧ + history.height (compressionStamp oldTimes n) = births.cutoffHeight heights.height n + limit_values : + history.space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 ∧ + history.order births.limit = completion.externalPointOrder P0 r0 μ0 A0 ∧ + history.meetGraph births.limit = completion.externalPointMeet P0 r0 μ0 A0 ∧ + history.birth births.limit = births.birth ∧ history.height births.limit = heights.height + bounded_history : GroundChronologicalHistory M (insert births.limit births.limit) C D rD + bounded_old_values : ∀ s ∈ births.limit, + bounded_history.space s = history.space s ∧ bounded_history.order s = history.order s ∧ + bounded_history.meetGraph s = history.meetGraph s ∧ bounded_history.birth s = history.birth s ∧ + bounded_history.height s = history.height s + bounded_values : + bounded_history.space births.limit = completion.externalBoundedCarrier P0 r0 μ0 A0 ∧ + bounded_history.order births.limit = completion.externalBoundedOrder P0 r0 μ0 A0 ∧ + bounded_history.meetGraph births.limit = completion.externalBoundedMeet P0 r0 μ0 A0 ∧ + bounded_history.birth births.limit = births.boundedBirth ∧ + bounded_history.height births.limit = heights.boundedHeight + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundChronologicalHistory M T0 C D rD) + +theorem chronologyFields_ground + (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) + (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) + (ordinal : ordinalSetProperty T0) (hOld : oldTimes ∈ T0) + {s : ZFSet.{u}} (cutoff : s ∈ insert births.limit births.limit) : + let fields := births.chronologyFields heights prior + fields.space s ∈ M.sets ∧ fields.order s ∈ M.sets ∧ fields.meetGraph s ∈ M.sets ∧ + fields.birth s ∈ M.sets ∧ fields.height s ∈ M.sets := by + classical + dsimp only + by_cases before : s ∈ oldTimes ∨ s = oldTimes + · have hs := before.elim (fun member => ordinal.1 oldTimes hOld s member) + (fun equal => equal.symm ▸ hOld) + obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_old heights prior before + rw [space, order, meet, birth, height] + exact ⟨prior.space_mem s hs, prior.order_mem s hs, prior.meet_mem s hs, + prior.birth_mem s hs, prior.height_mem s hs⟩ + · rcases ZFSet.mem_insert_iff.1 cutoff with rfl | below + · obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_limit heights prior + rw [space, order, meet, birth, height] + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP0 + exact ⟨geometry.carrier_ground, geometry.order_ground, geometry.meet_ground, + births.birth_ground, heights.height_ground⟩ + · have stamped : ∃ n, s = compressionStamp oldTimes n := by + rcases (births.times.mem_limit_iff s).1 below with member | equal | stamped + · exact False.elim (before (Or.inl member)) + · exact False.elim (before (Or.inr equal)) + · exact stamped + obtain ⟨n, rfl⟩ := stamped + obtain ⟨space, order, meet, birth, height⟩ := births.chronologyFields_stamp heights prior n + rw [space, order, meet, birth, height] + have fields := births.cutoff_fields data group action pairing unions powers separation infinite hG hP0 heights n + exact ⟨fields.1, fields.2.1, fields.2.2.1, fields.2.2.2.1, fields.2.2.2.2.1⟩ + +end PartitionPilot.Forcing.GroundExternalBirthData + + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundChronologicalHistory M T0 C D rD) +local notation "fields" => births.chronologyFields heights prior +local notation "U" => completion.algebra.union.fields 0 + +theorem chronology_sources_eq_below {t s : ZFSet.{u}} + (oldTime : t ∈ oldTimes ∨ t = oldTimes) (before : s ∈ t) : + (fields).space s = prior.space s ∧ (fields).order s = prior.order s ∧ + (fields).meetGraph s = prior.meetGraph s := by + dsimp only [chronologyFields] + exact ⟨compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, + compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before, + compressionPrefixValue_eq_prior_below _ _ _ births.times oldTime before⟩ + +variable (ordinal : ordinalSetProperty T0) (hOldTimes : oldTimes ∈ T0) +include ordinal hOldTimes + +noncomputable def chronology_old_layer {cutoff t : ZFSet.{u}} + (oldCutoff : cutoff ∈ oldTimes ∨ cutoff = oldTimes) (bound : t = cutoff ∨ t ∈ cutoff) : + CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph + ((fields).space cutoff) ((fields).order cutoff) ((fields).meetGraph cutoff) ((fields).birth cutoff) t := by + have hc : cutoff ∈ T0 := oldCutoff.elim + (fun member => ordinal.1 oldTimes hOldTimes cutoff member) (fun equal => equal.symm ▸ hOldTimes) + have ht : t ∈ T0 := bound.elim (fun equal => equal.symm ▸ hc) + (fun before => ordinal.1 cutoff hc t before) + have oldTime : t ∈ oldTimes ∨ t = oldTimes := by + rcases bound with equal | before + · exact equal.symm ▸ oldCutoff + · exact Or.inl (oldCutoff.elim + (fun member => ordinal.2 oldTimes hOldTimes cutoff member t before) (fun equal => equal ▸ before)) + have layer := (prior.layer cutoff hc t ht bound).congr_sources_below + (fun s hs => (births.chronology_sources_eq_below heights prior oldTime hs).1.symm) + (fun s hs => (births.chronology_sources_eq_below heights prior oldTime hs).2.1.symm) + (fun s hs => (births.chronology_sources_eq_below heights prior oldTime hs).2.2.symm) + have values := births.chronologyFields_old heights prior oldCutoff + simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1] using layer + +theorem chronology_sources_ground_below {t : ZFSet.{u}} + (oldTime : t ∈ oldTimes ∨ t = oldTimes) : ∀ s ∈ t, (fields).space s ∈ M.sets := by + intro s hs + rw [(births.chronology_sources_eq_below heights prior oldTime hs).1] + have ht : t ∈ T0 := oldTime.elim + (fun member => ordinal.1 oldTimes hOldTimes t member) (fun equal => equal.symm ▸ hOldTimes) + exact prior.space_mem s (ordinal.1 t ht s hs) + +variable (priorSpace : prior.space oldTimes = completion.algebra.union.fields 0) +variable (priorOrder : prior.order oldTimes = completion.algebra.union.fields 1) +variable (priorMeet : prior.meetGraph oldTimes = completion.algebra.union.fields 2) +variable (priorBirth : prior.birth oldTimes = oldBirth) +include priorSpace priorOrder priorMeet priorBirth + +noncomputable def chronology_base_layer (t : ZFSet.{u}) (oldTime : t ∈ oldTimes ∨ t = oldTimes) : + CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph U + (completion.algebra.union.fields 1) (completion.algebra.union.fields 2) oldBirth t := by + have layer := births.chronology_old_layer heights prior ordinal hOldTimes + (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) oldTime.symm + have values := births.chronologyFields_old heights prior (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) + simpa only [values.1, values.2.1, values.2.2.1, values.2.2.2.1, + priorSpace, priorOrder, priorMeet, priorBirth] using layer + +variable {inv : ZFSet.{u}} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (oldFunction : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) +include data group action pairing unions powers separation infinite hG hP0 oldFunction + +noncomputable def chronology_finite_layers (n : Nat) (t : ZFSet.{u}) + (bound : t = compressionStamp oldTimes n ∨ t ∈ compressionStamp oldTimes n) : + CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph + ((fields).space (compressionStamp oldTimes n)) ((fields).order (compressionStamp oldTimes n)) + ((fields).meetGraph (compressionStamp oldTimes n)) ((fields).birth (compressionStamp oldTimes n)) t := by + have values := births.chronologyFields_stamp heights prior n + rw [values.1, values.2.1, values.2.2.1, values.2.2.2.1] + have atBase := births.chronologyFields_old heights prior (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) + have fresh (k : Nat) (before : k ≤ n) := data.externalBirth_cutoff_fresh_layer group action + pairing unions powers separation infinite hG hP0 births (fields).space (fields).order (fields).meetGraph + (atBase.1.trans priorSpace) (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) k n before + have original (s : ZFSet.{u}) (oldTime : s ∈ oldTimes ∨ s = oldTimes) := + data.externalBirth_cutoff_prior_layer group action pairing unions powers separation infinite hG hP0 births + (births.chronology_base_layer heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth s oldTime) + (births.chronology_sources_ground_below heights prior ordinal hOldTimes oldTime) oldFunction oldTime n + apply Classical.choice + rcases bound with rfl | before + · exact ⟨fresh n (Nat.le_refl n)⟩ + · rcases (mem_compressionStamp_iff oldTimes t n).1 before with old | same | ⟨k, earlier, rfl⟩ + · exact ⟨original t (Or.inl old)⟩ + · exact ⟨original t (Or.inr same)⟩ + · exact ⟨fresh k (Nat.le_of_lt earlier)⟩ + +noncomputable def chronology_union_layers (t : ZFSet.{u}) (bound : t = births.limit ∨ t ∈ births.limit) : + CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph + ((fields).space births.limit) ((fields).order births.limit) + ((fields).meetGraph births.limit) ((fields).birth births.limit) t := by + have values := births.chronologyFields_limit heights prior + rw [values.1, values.2.1, values.2.2.1, values.2.2.2.1] + have atBase := births.chronologyFields_old heights prior (Or.inr rfl : oldTimes ∈ oldTimes ∨ oldTimes = oldTimes) + have original (s : ZFSet.{u}) (oldTime : s ∈ oldTimes ∨ s = oldTimes) := + data.externalBirth_prior_layer group action pairing unions powers separation infinite hG hP0 births + (births.chronology_base_layer heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth s oldTime) + (births.chronology_sources_ground_below heights prior ordinal hOldTimes oldTime) oldFunction oldTime + apply Classical.choice + rcases bound with rfl | before + · exact ⟨.empty_of_no_birth ⟨births.limit, births.limit_ground⟩ (fun x _ => births.no_limit_birth x)⟩ + · rcases (births.times.mem_limit_iff t).1 before with old | same | ⟨k, rfl⟩ + · exact ⟨original t (Or.inl old)⟩ + · exact ⟨original t (Or.inr same)⟩ + · exact ⟨data.externalBirth_fresh_layer group action pairing unions powers separation infinite hG hP0 births + (fields).space (fields).order (fields).meetGraph (atBase.1.trans priorSpace) + (atBase.2.1.trans priorOrder) (atBase.2.2.1.trans priorMeet) k⟩ + +noncomputable def chronology_all_layers : + ∀ cutoff ∈ insert births.limit births.limit, ∀ t ∈ insert births.limit births.limit, + t = cutoff ∨ t ∈ cutoff → CodedGrowthLayer M (fields).space (fields).order (fields).meetGraph + ((fields).space cutoff) ((fields).order cutoff) ((fields).meetGraph cutoff) ((fields).birth cutoff) t := by + intro cutoff hc t _ bound + apply Classical.choice + rcases ZFSet.mem_insert_iff.1 hc with rfl | before + · exact ⟨births.chronology_union_layers heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth + data group action pairing unions powers separation infinite hG hP0 oldFunction t bound⟩ + · rcases (births.times.mem_limit_iff cutoff).1 before with old | same | ⟨n, rfl⟩ + · exact ⟨births.chronology_old_layer heights prior ordinal hOldTimes (Or.inl old) bound⟩ + · exact ⟨births.chronology_old_layer heights prior ordinal hOldTimes (Or.inr same) bound⟩ + · exact ⟨births.chronology_finite_layers heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth + data group action pairing unions powers separation infinite hG hP0 oldFunction n t bound⟩ + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 Filters C D rD lo hi seed : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion heights) +variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) +variable {b b' : ZFSet.{u}} (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) +variable (image : ZFSet.pair b b' ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) +local notation "letters" => externalChildLetters I P0 (externalRectangles P0 G r0 μ0 A0) + +noncomputable def externalMainStage : GroundMainStage M C D rD := + let geometry := data.externalBoundedGeometryData group action pairing unions powers separation infinite hG hP0 + let bottom := data.externalOriginalEmbedding_bottom origin group action pairing unions powers separation infinite + hI hSources hReps hG hT hP0 initialDomain initialOrder least image + { carrier := completion.externalBoundedCarrier P0 r0 μ0 A0 + order := completion.externalBoundedOrder P0 r0 μ0 A0 + meetGraph := completion.externalBoundedMeet P0 r0 μ0 A0 + actors := M.externalGroupCarrier G letters m one + multiplication := M.externalGroupMultiplication G letters m one + inverse := M.externalGroupInverse G letters m inv one + identity := M.externalGroupIdentity G letters m one + action := completion.externalBoundedAction P0 r0 μ0 A0 + bottom := b' + top := completion.externalPointCarrier P0 r0 μ0 A0 + height := heights.boundedHeight + carrier_ground := geometry.carrier_ground + order_ground := geometry.order_ground + meet_ground := geometry.meet_ground + actors_ground := data.group.carrier_mem + multiplication_ground := data.group.multiplication_mem + inverse_ground := data.group.inverse_mem + action_ground := geometry.action_ground + height_ground := boundedHeights.height_ground + columns_ground := hC + coordinates_ground := hD + coordinate_order_ground := hrD + meet := geometry.meet + group_code := data.group.group_code + action_code := geometry.action + bottom_mem := bottom.1 + least := bottom.2 + top_mem := geometry.top_mem + greatest := geometry.greatest + height_code := boundedHeights.code + height_range_ground := boundedHeights.range_ground + height_range_countable := boundedHeights.range_countable } + +theorem externalMainStage_fields : + let stage := data.externalMainStage origin group action pairing unions powers separation infinite + hI hSources hReps hG hT hP0 initialDomain initialOrder heights boundedHeights hC hD hrD least image + stage.carrier = completion.externalBoundedCarrier P0 r0 μ0 A0 ∧ + stage.order = completion.externalBoundedOrder P0 r0 μ0 A0 ∧ + stage.meetGraph = completion.externalBoundedMeet P0 r0 μ0 A0 ∧ + stage.actors = M.externalGroupCarrier G letters m one ∧ + stage.multiplication = M.externalGroupMultiplication G letters m one ∧ + stage.inverse = M.externalGroupInverse G letters m inv one ∧ + stage.identity = M.externalGroupIdentity G letters m one ∧ + stage.action = completion.externalBoundedAction P0 r0 μ0 A0 ∧ + stage.bottom = b' ∧ stage.top = completion.externalPointCarrier P0 r0 μ0 A0 ∧ + stage.height = heights.boundedHeight := by + exact ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ + +end GroundExternalGeometryInputs + +namespace GroundChronologicalExternal +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 Filters : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable {births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion} +variable {heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion} +variable {prior : GroundChronologicalHistory M T0 C D rD} +variable (external : GroundChronologicalExternal M initial I Sources Reps G m inv one T τ + P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 completion births heights prior) +variable (origin : GroundCompressionOrigin M initial P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (initialDomain : initial.D = P0) (initialOrder : initial.rD = r0) +variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion heights) +variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) +variable {b b' : ZFSet.{u}} (least : ∀ x ∈ P0, ZFSet.pair b x ∈ r0) +variable (image : ZFSet.pair b b' ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0) + +noncomputable def toMainStage : GroundChronologicalMainStage M C D rD where + stage := external.inputs.externalMainStage origin group action pairing unions powers separation infinite + hI hSources hReps hG hT hP0 initialDomain initialOrder heights boundedHeights hC hD hrD least image + cutoff := births.limit + cutoff_ground := births.limit_ground + cutoff_ordinal := births.times.ordinal + history := external.bounded_history + carrier_eq := external.bounded_values.1 + order_eq := external.bounded_values.2.1 + meet_eq := external.bounded_values.2.2.1 + height_eq := external.bounded_values.2.2.2.2 + +theorem toMainStage_birth : + (external.toMainStage origin group action pairing unions powers separation infinite hI hSources hReps + hG hT hP0 initialDomain initialOrder boundedHeights hC hD hrD least image).birth = births.boundedBirth := + external.bounded_values.2.2.2.1 + +end GroundChronologicalExternal +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundChronologicalHistory M T0 C D rD) +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) +variable (ordinal : ordinalSetProperty T0) (hOldTimes : oldTimes ∈ T0) +variable (priorSpace : prior.space oldTimes = completion.algebra.union.fields 0) +variable (priorOrder : prior.order oldTimes = completion.algebra.union.fields 1) +variable (priorMeet : prior.meetGraph oldTimes = completion.algebra.union.fields 2) +variable (priorBirth : prior.birth oldTimes = oldBirth) +variable (oldFunction : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) + +noncomputable def chronologyHistory : + GroundChronologicalHistory M (insert births.limit births.limit) C D rD where + space := (births.chronologyFields heights prior).space + order := (births.chronologyFields heights prior).order + meetGraph := (births.chronologyFields heights prior).meetGraph + birth := (births.chronologyFields heights prior).birth + height := (births.chronologyFields heights prior).height + space_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).1 + order_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.1 + meet_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.1 + birth_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.1 + height_mem := fun _ hs => (births.chronologyFields_ground heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.2 + meet_order := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).1 + birth_function := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.1 + birth_bound := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.1 + old_meet := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.1 + strict_height := fun _ hs => (births.chronologyFields_stage_laws heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes hs).2.2.2.2 + layer := births.chronology_all_layers heights prior ordinal hOldTimes priorSpace priorOrder priorMeet priorBirth + data group action pairing unions powers separation infinite hG hP0 oldFunction + +local notation "history" => births.chronologyHistory heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes + priorSpace priorOrder priorMeet priorBirth oldFunction + +theorem chronologyHistory_old {s : ZFSet.{u}} (before : s ∈ oldTimes ∨ s = oldTimes) : + (history).space s = prior.space s ∧ (history).order s = prior.order s ∧ + (history).meetGraph s = prior.meetGraph s ∧ (history).birth s = prior.birth s ∧ + (history).height s = prior.height s := births.chronologyFields_old heights prior before + +theorem chronologyHistory_stamp (n : Nat) : + (history).space (compressionStamp oldTimes n) = births.cutoff n ∧ + (history).order (compressionStamp oldTimes n) = births.cutoffOrder n ∧ + (history).meetGraph (compressionStamp oldTimes n) = births.cutoffMeet n ∧ + (history).birth (compressionStamp oldTimes n) = births.cutoffBirth n ∧ + (history).height (compressionStamp oldTimes n) = births.cutoffHeight heights.height n := + births.chronologyFields_stamp heights prior n + +theorem chronologyHistory_limit : + (history).space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 ∧ + (history).order births.limit = completion.externalPointOrder P0 r0 μ0 A0 ∧ + (history).meetGraph births.limit = completion.externalPointMeet P0 r0 μ0 A0 ∧ + (history).birth births.limit = births.birth ∧ (history).height births.limit = heights.height := + births.chronologyFields_limit heights prior + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing.GroundExternalBirthData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 oldTimes oldBirth completion) +variable (heights : GroundExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion) +variable (prior : GroundChronologicalHistory M T0 C D rD) + +noncomputable def chronologicalData + (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P0 r0 μ0 A0 completion) + (group : GroupCode G m inv one) (action : PosetActionCode G P0 m one r0 A0) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP0 : P0 ∈ M.sets) + (ordinal : ordinalSetProperty T0) (hOldTimes : oldTimes ∈ T0) + (priorSpace : prior.space oldTimes = completion.algebra.union.fields 0) + (priorOrder : prior.order oldTimes = completion.algebra.union.fields 1) + (priorMeet : prior.meetGraph oldTimes = completion.algebra.union.fields 2) + (priorBirth : prior.birth oldTimes = oldBirth) + (oldFunction : ZFSet.IsFunc (completion.algebra.union.fields 0) oldTimes oldBirth) + (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 C D rD lo hi seed completion heights) : + GroundChronologicalExternal M initial I Sources Reps G m inv one T τ + P0 r0 μ0 A0 oldTimes oldBirth C D rD lo hi seed T0 completion births heights prior := by + let history := births.chronologyHistory heights prior data group action + pairing unions powers separation infinite hG hP0 ordinal hOldTimes + priorSpace priorOrder priorMeet priorBirth oldFunction + have terminal := births.chronologyFields_limit heights prior + have space : history.space births.limit = completion.externalPointCarrier P0 r0 μ0 A0 := terminal.1 + have order : history.order births.limit = completion.externalPointOrder P0 r0 μ0 A0 := terminal.2.1 + have birth : history.birth births.limit = births.birth := terminal.2.2.2.1 + have earlier : ∀ x t, ZFSet.pair x t ∈ history.birth births.limit → t ∈ births.limit := by + intro x t entry + rw [birth] at entry + exact (ZFSet.pair_mem_prod.1 (births.function.1 entry)).2 + have heightCode : StrictLexHeightCode (fixedTopCarrier (history.space births.limit)) C D + (fixedTopOrder (history.space births.limit) (history.order births.limit)) heights.boundedHeight rD := by + rw [space, order] + exact boundedHeights.code + let bounded := history.replaceTerminalFixedTop pairing unions powers separation births.times.ordinal + births.limit_ground earlier heights.boundedHeight boundedHeights.height_ground heightCode + refine ⟨data, history, (fun _ before => births.chronologyFields_old heights prior before), + (fun n => births.chronologyFields_stamp heights prior n), terminal, bounded, ?_, ?_⟩ + · intro s hs + exact history.replaceTerminalFixedTop_old pairing unions powers separation births.times.ordinal + births.limit_ground earlier heights.boundedHeight boundedHeights.height_ground heightCode hs + · have values := history.replaceTerminalFixedTop_terminal pairing unions powers separation births.times.ordinal + births.limit_ground earlier heights.boundedHeight boundedHeights.height_ground heightCode + rw [space, order, birth] at values + exact values + +end PartitionPilot.Forcing.GroundExternalBirthData + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite + +include choice in +theorem exists_groundInitialExternalChronology + {P G r μ A Labels m inv one τ D rD c original base old T0 : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hτ : τ ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x τ ∈ r) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hc : c ∈ M.sets) (hOriginal : original ∈ M.sets) + (originalCode : StrictLexHeightCode P C D r original rD) + (target : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (originalSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) original) ZFSet.omega) + (hBase : base ∈ M.sets) (prior : GroundChronologicalHistory M T0 C D rD) + (ordinal : ordinalSetProperty T0) (baseMember : base ∈ T0) + (priorSpace : prior.space base = P) (priorOrder : prior.order base = r) + (priorMeet : prior.meetGraph base = μ) (priorBirth : prior.birth base = old) + (priorHeight : prior.height base = original) : + let I := M.groundEligibleTasks P G r μ A Labels + let Sources := literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Filters := literalTaskFilterGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Targets := literalTaskTargetGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let Separators := literalTaskSeparatorGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels + let T := M.groundTaskTransport P G r μ A Labels + I ∈ M.sets ∧ Sources ∈ M.sets ∧ Filters ∈ M.sets ∧ T ∈ M.sets ∧ + ∃ Reps ∈ M.sets, + ∃ _origin : GroundCompressionOrigin M (M.initialCompressionData P G r μ A Labels) + P r μ A τ I Sources Reps G m inv one T Filters, + ∃ compression : GroundChronologicalCompression M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P C D rD original Targets Separators Filters base old T0 prior, + GroundExternalGeometryInputs M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m inv one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalGeometryData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ + GroundExternalBoundedGeometryData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.profiled.heighted.completion ∧ + ∃ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD ∧ + ∃ heights : GroundExternalHeightData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion, + GroundBoundedExternalHeightData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights ∧ + ∃ births : GroundExternalBirthData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth + compression.born.profiled.heighted.completion, + GroundBoundedExternalBirthData M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m one T τ P r μ A compression.born.births.limit compression.born.births.birth + compression.born.profiled.heighted.completion births ∧ + Nonempty (GroundChronologicalExternal M (M.initialCompressionData P G r μ A Labels) + I Sources Reps G m inv one T τ P r μ A compression.born.births.limit compression.born.births.birth + C D rD lo hi compression.born.profiled.heighted.heights.height + (insert compression.born.births.limit compression.born.births.limit) + compression.born.profiled.heighted.completion births heights compression.history) := by + dsimp only + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, + boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, boundedBirths⟩ := + M.exists_groundInitialExternalBirths pairing unions powers separation collection infinite choice + hP hG hr hμ hA hLabels hm hInv group action meet hτ top hD hrD hc hOriginal + originalCode target above coordinateInjection originalSmall hBase prior ordinal baseMember + priorSpace priorOrder priorMeet priorBirth priorHeight + let chronological := births.chronologicalData heights compression.history data group action + pairing unions powers separation infinite hG hP + (ordinalSetProperty_succ compression.born.births.times.ordinal) + (ZFSet.mem_insert_iff.2 (Or.inl rfl)) + compression.limit_values.1 compression.limit_values.2.1 compression.limit_values.2.2.1 + compression.limit_values.2.2.2.1 compression.born.births.function boundedHeights + exact ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, data, geometry, + boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, boundedBirths, + ⟨chronological⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainSeedSuccessorSerialization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainSeedSuccessorSerialization.lean index 985b8153d6952b8ce42145b14c1303a2bc6032cb..6daaefc56a0e5c23fb2984901749c0da38895714 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainSeedSuccessorSerialization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainSeedSuccessorSerialization.lean @@ -1,651 +1,651 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompressionSerializationTransport -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialSeedMatchedSerialization -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExternalSerializedChronology - -namespace OAI - - -namespace PartitionPilot.Forcing.GroundSerializedChronology -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M (insert s s) C D rD) - -noncomputable def fixedTopValues (newHeight : ZFSet.{u}) : Fin 5 → ZFSet.{u} := - Fin.cases (fixedTopCarrier (serial.fields.value 0 s)) - (Fin.cases (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) - (Fin.cases (fixedTopMeet (serial.fields.value 0 s) (serial.fields.value 1 s)) - (Fin.cases (fixedTopBirth (serial.fields.value 0 s) (serial.fields.value 3 s) s) - (fun _ => newHeight)))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) -include pairing unions powers separation hHeight - -theorem fixedTopValues_ground : ∀ j, serial.fixedTopValues newHeight j ∈ M.sets := by - have hP := serial.fields.value_ground 0 s - have hr := serial.fields.value_ground 1 s - have hs := M.transitive serial.fields.time_ground (ZFSet.mem_insert s s) - exact Fin.cases (M.fixedTopCarrier_mem pairing unions hP) - (Fin.cases (M.fixedTopOrder_mem pairing unions powers separation hP hr) - (Fin.cases (M.fixedTopMeet_mem pairing unions powers separation hP hr) - (Fin.cases (M.fixedTopBirth_mem pairing unions hP (serial.fields.value_ground 3 s) hs) - (fun _ => hHeight)))) - -noncomputable def fixedTopFields : GroundChronologyFields M (insert s s) := - serial.fields.replaceTerminal pairing unions separation (serial.fixedTopValues newHeight) - (serial.fixedTopValues_ground pairing unions powers separation newHeight hHeight) - -theorem fixedTopFields_value_at (j : Fin 5) : - (serial.fixedTopFields pairing unions powers separation newHeight hHeight).value j s = - serial.fixedTopValues newHeight j := - serial.fields.replaceTerminal_value_at pairing unions separation _ _ j - -theorem fixedTopFields_value_old (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ s) : - (serial.fixedTopFields pairing unions powers separation newHeight hHeight).value j t = - serial.fields.value j t := - serial.fields.replaceTerminal_value_old pairing unions separation _ _ j ht - -theorem fixedTopFields_value (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ insert s s) : - (serial.fixedTopFields pairing unions powers separation newHeight hHeight).value j t = - appendHistoryValue s (serial.fields.value j) (serial.fixedTopValues newHeight j) t := - serial.fields.replaceTerminal_value pairing unions separation _ _ j ht - -theorem fixedTopFields_old_entries (j : Fin 5) {t y : ZFSet.{u}} (ht : t ∈ s) : - ZFSet.pair t y ∈ (serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph j ↔ - ZFSet.pair t y ∈ serial.fields.graph j := - serial.fields.replaceTerminal_old_entries pairing unions separation _ _ j ht - -theorem fixedTopFields_core - (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) - (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D - (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : - ChronologyCoreCode (insert s s) - (serial.fixedTopFields pairing unions powers separation newHeight hHeight).bound C D rD - (serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph := by - let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight - refine ⟨fields.function, ?_⟩ - intro cutoff hc L r μ birth height eL er eμ eb eh - have eqL := fields.value_eq_of_entry 0 eL - have eqr := fields.value_eq_of_entry 1 er - have eqμ := fields.value_eq_of_entry 2 eμ - have eqb := fields.value_eq_of_entry 3 eb - have eqh := fields.value_eq_of_entry 4 eh - rw [← eqL, ← eqr, ← eqμ, ← eqb, ← eqh] - change ChronologyPointCode (insert s s) C D rD cutoff - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 4 cutoff) - rcases ZFSet.mem_insert_iff.1 hc with equal | hc - · subst cutoff - rw [fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at, - fixedTopFields_value_at, fixedTopFields_value_at] - have point := serial.fields.decoded_point serial.core (ZFSet.mem_insert s s) - exact ⟨fixedTopMeet_code point.meet, - fixedTopBirth_function point.birth_function (ZFSet.mem_insert s s), - fun x _ t entry => fixedTopBirth_bound earlier x t entry, - fixedTopBirth_oldMeet point.meet point.birth_function earlier point.old_meet, heightCode⟩ - · rw [fixedTopFields_value_old _ _ _ _ _ _ _ 0 hc, - fixedTopFields_value_old _ _ _ _ _ _ _ 1 hc, - fixedTopFields_value_old _ _ _ _ _ _ _ 2 hc, - fixedTopFields_value_old _ _ _ _ _ _ _ 3 hc, - fixedTopFields_value_old _ _ _ _ _ _ _ 4 hc] - exact serial.fields.decoded_point serial.core (ZFSet.mem_insert_of_mem _ hc) - -end PartitionPilot.Forcing.GroundSerializedChronology - - - -namespace PartitionPilot.Forcing.GroundSerializedChronology -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M (insert s s) C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) -variable (ordinal : ordinalSetProperty s) -variable (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) -include pairing unions powers separation hHeight ordinal earlier - -theorem fixedTopFields_rawWitnesses : - let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight - ∀ cutoff ∈ insert s s, ∀ t ∈ insert s s, t = cutoff ∨ t ∈ cutoff → - ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) - (fields.value 3 cutoff) t ZFSet.omega z := by - dsimp only - let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight - have inside {t a : ZFSet.{u}} (ht : t ∈ insert s s) (ha : a ∈ t) : a ∈ s := by - rcases ZFSet.mem_insert_iff.1 ht with equal | ht - · exact equal ▸ ha - · exact ordinal.1 t ht a ha - have transportSources {t A r μ birth z : ZFSet.{u}} (ht : t ∈ insert s s) - (code : GrowthLayerWitnessCode (serial.fields.graph 0) (serial.fields.graph 1) (serial.fields.graph 2) - A r μ birth t ZFSet.omega z) : - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - A r μ birth t ZFSet.omega z := by - exact code.congr_source_entries - (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 0 - (y := y) (inside ht ha)).symm) - (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 1 - (y := y) (inside ht ha)).symm) - (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 2 - (y := y) (inside ht ha)).symm) - intro cutoff hc t ht before - change ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) (fields.value 3 cutoff) t ZFSet.omega z - by_cases terminal : cutoff = s - · subst cutoff - change ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 s) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 s) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 s) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 s) t ZFSet.omega z - rw [fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at] - by_cases top : t = s - · subst t - exact ⟨fixedTopLayerWitness (serial.fields.value 0 s), - M.fixedTopLayerWitness_mem pairing (serial.fields.value_ground 0 s), fixedTopLayerWitness_code earlier⟩ - · have strict : t ∈ s := before.resolve_left top - have prior := serial.layer_code s (ZFSet.mem_insert s s) t ht (Or.inr strict) - _ (serial.layerWitness_entry (ZFSet.mem_insert s s) ht (Or.inr strict)) - have point := serial.fields.decoded_point serial.core (ZFSet.mem_insert s s) - obtain ⟨z, hz, code⟩ := prior.exists_fixedTop_earlier pairing unions separation - (serial.fields.value_ground 0 s) (serial.layerWitness_ground s t) point.meet point.birth_function strict - exact ⟨z, hz, transportSources ht code⟩ - · have old : cutoff ∈ s := (ZFSet.mem_insert_iff.1 hc).resolve_left terminal - have code := transportSources ht (serial.layer_code cutoff hc t ht before - _ (serial.layerWitness_entry hc ht before)) - refine ⟨serial.layerWitness cutoff t, serial.layerWitness_ground cutoff t, ?_⟩ - change GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 cutoff) - ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 cutoff) t ZFSet.omega _ - rw [fixedTopFields_value_old _ _ _ _ _ _ _ 0 old, - fixedTopFields_value_old _ _ _ _ _ _ _ 1 old, - fixedTopFields_value_old _ _ _ _ _ _ _ 2 old, - fixedTopFields_value_old _ _ _ _ _ _ _ 3 old] - exact code - -theorem exists_fixedTopSerialization - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (infinite : Realize M.sets infinity Fin.elim0) - (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D - (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : - ∃ extended : GroundSerializedChronology M (insert s s) C D rD, - extended.fields = serial.fixedTopFields pairing unions powers separation newHeight hHeight ∧ - extended.code ∈ M.sets := by - exact (serial.fixedTopFields pairing unions powers separation newHeight hHeight).exists_serializedChronology - pairing unions powers separation collection choice infinite - (serial.fixedTopFields_core pairing unions powers separation newHeight hHeight earlier heightCode) - (serial.fixedTopFields_rawWitnesses pairing unions powers separation newHeight hHeight ordinal earlier) - serial.ordinal - -theorem exists_fixedTopSerialization_values - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (infinite : Realize M.sets infinity Fin.elim0) - (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D - (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : - ∃ extended : GroundSerializedChronology M (insert s s) C D rD, - extended.fields = serial.fixedTopFields pairing unions powers separation newHeight hHeight ∧ - extended.code ∈ M.sets ∧ ∀ j t, t ∈ insert s s → extended.fields.value j t = - appendHistoryValue s (serial.fields.value j) (serial.fixedTopValues newHeight j) t := by - obtain ⟨extended, same, ground⟩ := serial.exists_fixedTopSerialization pairing unions powers separation - newHeight hHeight ordinal earlier collection choice infinite heightCode - refine ⟨extended, same, ground, ?_⟩ - intro j t ht - rw [same] - exact serial.fixedTopFields_value pairing unions powers separation newHeight hHeight j ht - -end PartitionPilot.Forcing.GroundSerializedChronology - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem GroundChronologicalHistory.fieldValue_eq_of_heq - {M : TransitiveGround.{u}} {T T' C D rD : ZFSet.{u}} - {first : GroundChronologicalHistory M T C D rD} - {second : GroundChronologicalHistory M T' C D rD} - (times : T = T') (same : HEq first second) (j : Fin 5) (s : ZFSet.{u}) : - first.fieldValue j s = second.fieldValue j s := by - cases times - cases eq_of_heq same - rfl - -namespace GroundInitialMainSuccessorData -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "comp" => certificate.compression -local notation "completion" => certificate.compression.born.profiled.heighted.completion -local notation "births" => certificate.births -local notation "heights" => certificate.heights -local notation "external" => certificate.external - -include pairing unions powers separation collection infinite choice - -theorem exists_compressionSerialization - (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) - (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → - prior.fields.value j s = source.history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD, - serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → - serial.fields.value j s = (comp).history.fieldValue j s := by - exact certificate.origin.exists_serializedCompression comp prior - pairing unions powers separation collection infinite choice - certificate.indices_ground certificate.sources_ground certificate.representatives_ground - source.stage.actors_ground certificate.task_action_ground (ZFSet.mem_insert _ _) - (M.initialCompressionData_template_constancy source.stage.carrier source.stage.actors - source.stage.order source.stage.meetGraph source.stage.action Labels) - rfl rfl rfl source.carrier_eq source.order_eq source.meet_eq rfl agreement - -theorem exists_externalSerialization - (prior : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD) - (agreement : ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → - prior.fields.value j s = (comp).history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD, - serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert (births).limit (births).limit → - serial.fields.value j s = (external).history.fieldValue j s := by - have atBase (j : Fin 5) := agreement j (comp).born.births.limit (ZFSet.mem_insert _ _) - have sourceValues := (comp).limit_values - have sourceMatch : prior.fields.value 0 (comp).born.births.limit = (completion).algebra.union.fields 0 ∧ - prior.fields.value 1 (comp).born.births.limit = (completion).algebra.union.fields 1 ∧ - prior.fields.value 2 (comp).born.births.limit = (completion).algebra.union.fields 2 ∧ - prior.fields.value 3 (comp).born.births.limit = (comp).born.births.birth := - ⟨(atBase 0).trans sourceValues.1, (atBase 1).trans sourceValues.2.1, - (atBase 2).trans sourceValues.2.2.1, (atBase 3).trans sourceValues.2.2.2.1⟩ - obtain ⟨serial, _, ground, values⟩ := (births).exists_externalSerializedChronology heights prior - (external).inputs source.stage.group_code source.stage.action_code pairing unions powers separation - infinite source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) - sourceMatch collection choice - refine ⟨serial, ground, ?_⟩ - intro j s hs - rw [values j s hs] - have oldValue (a : ZFSet.{u}) (before : a ∈ (comp).born.births.limit ∨ a = (comp).born.births.limit) : - ((births).chronologyFields heights prior.toHistory).fieldValue j a = (external).history.fieldValue j a := by - have ha : a ∈ insert (comp).born.births.limit (comp).born.births.limit := before.elim - (fun h => ZFSet.mem_insert_of_mem _ h) (fun h => h.symm ▸ ZFSet.mem_insert _ _) - have left := (births).chronologyFields_old heights prior.toHistory before - have right := (external).old_values a before - have eLeft : ((births).chronologyFields heights prior.toHistory).fieldValue j a = prior.fields.value j a := - Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 - (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j - have eRight : (external).history.fieldValue j a = (comp).history.fieldValue j a := - Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 - (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j - exact eLeft.trans ((agreement j a ha).trans eRight.symm) - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · have left := (births).chronologyFields_limit heights prior.toHistory - have right := (external).limit_values - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - · rcases ((births).times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ - · exact oldValue s (Or.inl before) - · exact oldValue s (Or.inr equal) - · have left := (births).chronologyFields_stamp heights prior.toHistory n - have right := (external).stamp_values n - exact Fin.cases (left.1.trans right.1.symm) - (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) - (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) - (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j - -theorem exists_boundedSerialization - (prior : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD) - (agreement : ∀ j s, s ∈ insert (births).limit (births).limit → - prior.fields.value j s = (external).history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD, - serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert (births).limit (births).limit → - serial.fields.value j s = (external).bounded_history.fieldValue j s := by - have space := (agreement 0 (births).limit (ZFSet.mem_insert _ _)).trans (external).limit_values.1 - have order := (agreement 1 (births).limit (ZFSet.mem_insert _ _)).trans (external).limit_values.2.1 - have birth := (agreement 3 (births).limit (ZFSet.mem_insert _ _)).trans (external).limit_values.2.2.2.1 - have earlier : ∀ x t, ZFSet.pair x t ∈ prior.fields.value 3 (births).limit → t ∈ (births).limit := by - intro x t entry - rw [birth] at entry - exact (ZFSet.pair_mem_prod.1 ((births).function.1 entry)).2 - have heightCode : StrictLexHeightCode (fixedTopCarrier (prior.fields.value 0 (births).limit)) C D - (fixedTopOrder (prior.fields.value 0 (births).limit) (prior.fields.value 1 (births).limit)) - (heights).boundedHeight rD := by - rw [space, order] - exact certificate.boundedHeights.code - obtain ⟨serial, _, ground, values⟩ := prior.exists_fixedTopSerialization_values - pairing unions powers separation (heights).boundedHeight certificate.boundedHeights.height_ground - (births).times.ordinal earlier collection choice infinite heightCode - have terminal (j : Fin 5) : prior.fixedTopValues (heights).boundedHeight j = - (external).bounded_history.fieldValue j (births).limit := by - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i))))) j - · change fixedTopCarrier (prior.fields.value 0 (births).limit) = _ - rw [space] - exact (external).bounded_values.1.symm - · change fixedTopOrder (prior.fields.value 0 (births).limit) (prior.fields.value 1 (births).limit) = _ - rw [space, order] - exact (external).bounded_values.2.1.symm - · change fixedTopMeet (prior.fields.value 0 (births).limit) (prior.fields.value 1 (births).limit) = _ - rw [space, order] - exact (external).bounded_values.2.2.1.symm - · change fixedTopBirth (prior.fields.value 0 (births).limit) (prior.fields.value 3 (births).limit) (births).limit = _ - rw [space, birth] - exact (external).bounded_values.2.2.2.1.symm - · exact (external).bounded_values.2.2.2.2.symm - refine ⟨serial, ground, ?_⟩ - intro j s hs - rw [values j s hs] - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · rw [appendHistoryValue_at] - exact terminal j - · rw [appendHistoryValue_old hs] - have previous := (external).bounded_old_values s hs - have same : (external).bounded_history.fieldValue j s = (external).history.fieldValue j s := - Fin.cases previous.1 (Fin.cases previous.2.1 (Fin.cases previous.2.2.1 - (Fin.cases previous.2.2.2.1 (Fin.cases previous.2.2.2.2 (fun i => Fin.elim0 i))))) j - exact (agreement j s (ZFSet.mem_insert_of_mem _ hs)).trans same.symm - -theorem exists_targetSerialization - (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) - (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → - prior.fields.value j s = source.history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert certificate.target.cutoff certificate.target.cutoff) C D rD, - serial.code ∈ M.sets ∧ - (∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → - serial.fields.value j s = certificate.target.history.fieldValue j s) ∧ - serial.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ - serial.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ - serial.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ - serial.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ - serial.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by - obtain ⟨compressionSerial, _, compressionValues⟩ := certificate.exists_compressionSerialization - pairing unions powers separation collection infinite choice prior agreement - obtain ⟨externalSerial, _, externalValues⟩ := certificate.exists_externalSerialization - pairing unions powers separation collection infinite choice compressionSerial compressionValues - obtain ⟨bounded, ground, values⟩ := certificate.exists_boundedSerialization - pairing unions powers separation collection infinite choice externalSerial externalValues - have times : insert (births).limit (births).limit = insert certificate.target.cutoff certificate.target.cutoff := - congrArg (fun t : ZFSet.{u} => insert t t) certificate.target_cutoff.symm - let serial := bounded.castTime times - have serialValues : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → - serial.fields.value j s = certificate.target.history.fieldValue j s := by - intro j s hs - rw [GroundSerializedChronology.castTime_value] - have old := values j s (times.symm ▸ hs) - have same := GroundChronologicalHistory.fieldValue_eq_of_heq times.symm certificate.target_history j s - exact old.trans same.symm - refine ⟨serial, ?_, serialValues, ?_, ?_, ?_, ?_, ?_⟩ - · rw [GroundSerializedChronology.castTime_code] - exact ground - · exact (serialValues 0 _ (ZFSet.mem_insert _ _)).trans certificate.target.carrier_eq - · exact (serialValues 1 _ (ZFSet.mem_insert _ _)).trans certificate.target.order_eq - · exact (serialValues 2 _ (ZFSet.mem_insert _ _)).trans certificate.target.meet_eq - · exact serialValues 3 _ (ZFSet.mem_insert _ _) - · exact (serialValues 4 _ (ZFSet.mem_insert _ _)).trans certificate.target.height_eq - -end GroundInitialMainSuccessorData - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -local notation "comp" => certificate.compression -local notation "completion" => certificate.compression.born.profiled.heighted.completion -local notation "births" => certificate.births -local notation "external" => certificate.external -variable {o : Ordinal.{u}} -variable (completed : ZFSet.rank (certificate.compression.born.profiled.heighted.completion.algebra.union.fields 0) < o) -variable (prior : ∀ s ∈ insert source.cutoff source.cutoff, ZFSet.rank (source.history.space s) < o) -include completed prior - -theorem compression_history_carrier_rank_lt {s : ZFSet.{u}} - (hs : s ∈ insert (comp).born.births.limit (comp).born.births.limit) : - ZFSet.rank ((comp).history.space s) < o := by - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · rw [(comp).limit_values.1] - exact completed - · rcases ((comp).born.births.times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ - · rw [((comp).old_values s (Or.inl before)).1] - exact prior s (ZFSet.mem_insert_of_mem _ before) - · rw [((comp).old_values s (Or.inr equal)).1] - exact prior s (equal.symm ▸ ZFSet.mem_insert _ _) - · rw [((comp).stamp_values n).1] - exact (ZFSet.rank_mono (((completion).algebra.union.fieldUnion 0).subset (n + 1))).trans_lt completed - -theorem external_history_carrier_rank_lt - (points : ZFSet.rank ((completion).externalPointCarrier source.stage.carrier - source.stage.order source.stage.meetGraph source.stage.action) < o) - {s : ZFSet.{u}} (hs : s ∈ insert (births).limit (births).limit) : - ZFSet.rank ((external).history.space s) < o := by - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · rw [(external).limit_values.1] - exact points - · rcases ((births).times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ - · rw [((external).old_values s (Or.inl before)).1] - exact certificate.compression_history_carrier_rank_lt completed prior (ZFSet.mem_insert_of_mem _ before) - · rw [((external).old_values s (Or.inr equal)).1] - exact certificate.compression_history_carrier_rank_lt completed prior (equal.symm ▸ ZFSet.mem_insert _ _) - · rw [((external).stamp_values n).1] - exact (ZFSet.rank_mono ((births).cutoff_subset n)).trans_lt points - -theorem target_history_carrier_rank_lt - (target : ZFSet.rank certificate.target.stage.carrier < o) - {s : ZFSet.{u}} (hs : s ∈ insert certificate.target.cutoff certificate.target.cutoff) : - ZFSet.rank (certificate.target.history.space s) < o := by - have times : insert certificate.target.cutoff certificate.target.cutoff = insert (births).limit (births).limit := - congrArg (fun t : ZFSet.{u} => insert t t) certificate.target_cutoff - have same : certificate.target.history.space s = (external).bounded_history.space s := - GroundChronologicalHistory.fieldValue_eq_of_heq times certificate.target_history 0 s - rw [same] - have hs' : s ∈ insert (births).limit (births).limit := times ▸ hs - rcases ZFSet.mem_insert_iff.1 hs' with rfl | hs' - · rw [(external).bounded_values.1, ← certificate.target_fields.1] - exact target - · rw [((external).bounded_old_values s hs').1] - have points : ZFSet.rank ((completion).externalPointCarrier source.stage.carrier - source.stage.order source.stage.meetGraph source.stage.action) < o := by - rw [certificate.target_fields.1] at target - exact (ZFSet.rank_mono (fixedTopCarrier_subset _)).trans_lt target - exact certificate.external_history_carrier_rank_lt completed prior points (ZFSet.mem_insert_of_mem _ hs') - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem GroundSerializedChronology.agreeing_history_carrier_rank_lt - {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} - (serial : GroundSerializedChronology M T C D rD) - (history : GroundChronologicalHistory M T C D rD) - {o : Ordinal.{u}} (rank : ZFSet.rank serial.code < o) - (agreement : ∀ j s, s ∈ T → serial.fields.value j s = history.fieldValue j s) - {s : ZFSet.{u}} (hs : s ∈ T) : ZFSet.rank (history.space s) < o := by - have bound := (serial.fieldValue_rank_lt_code 0 hs).trans rank - rw [agreement 0 s hs] at bound - exact bound - -namespace GroundInitialMainSuccessorData -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (invariant : source.Invariant K Labels) -variable (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) -variable (priorRank : ZFSet.rank prior.code < ZFSet.rank K) -variable (priorAgreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → - prior.fields.value j s = source.history.fieldValue j s) -include certificate pairing unions powers separation collection infinite hK conditions invariant priorRank priorAgreement -local notation "comp" => certificate.compression -local notation "completion" => certificate.compression.born.profiled.heighted.completion -local notation "births" => certificate.births -local notation "external" => certificate.external - -theorem compressionFieldGraphs_rank_lt - (fields : GroundChronologyFields M (insert (comp).born.births.limit (comp).born.births.limit)) - (agreement : ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → - fields.value j s = (comp).history.fieldValue j s) (j : Fin 5) : - ZFSet.rank (fields.graph j) < ZFSet.rank K := by - have completed := certificate.compression_union_rank_lt pairing unions powers separation collection infinite - hK conditions invariant.points_rank invariant.labels_rank - have times := conditions.successor_mem pairing unions powers separation infinite hK - (certificate.compression_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) - exact fields.graph_rank_lt_of_history pairing unions powers separation collection infinite hK conditions times - (comp).history agreement - (fun _ hs => certificate.compression_history_carrier_rank_lt completed - (fun _ ht => prior.agreeing_history_carrier_rank_lt source.history priorRank priorAgreement ht) hs) - invariant.columns_rank invariant.coordinates_rank j - -theorem externalFieldGraphs_rank_lt - (fields : GroundChronologyFields M (insert (births).limit (births).limit)) - (agreement : ∀ j s, s ∈ insert (births).limit (births).limit → - fields.value j s = (external).history.fieldValue j s) (j : Fin 5) : - ZFSet.rank (fields.graph j) < ZFSet.rank K := by - have completed := certificate.compression_union_rank_lt pairing unions powers separation collection infinite - hK conditions invariant.points_rank invariant.labels_rank - have target := (certificate.target_rank_lt pairing unions powers separation collection infinite - hK conditions invariant.points_rank invariant.labels_rank invariant.actors_rank).1 - rw [certificate.target_fields.1] at target - have points := (ZFSet.rank_mono (fixedTopCarrier_subset _)).trans_lt target - have times := conditions.successor_mem pairing unions powers separation infinite hK - (certificate.external_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) - exact fields.graph_rank_lt_of_history pairing unions powers separation collection infinite hK conditions times - (external).history agreement - (fun _ hs => certificate.external_history_carrier_rank_lt completed - (fun _ ht => prior.agreeing_history_carrier_rank_lt source.history priorRank priorAgreement ht) points hs) - invariant.columns_rank invariant.coordinates_rank j - -theorem targetFieldGraphs_rank_lt - (fields : GroundChronologyFields M (insert certificate.target.cutoff certificate.target.cutoff)) - (agreement : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → - fields.value j s = certificate.target.history.fieldValue j s) (j : Fin 5) : - ZFSet.rank (fields.graph j) < ZFSet.rank K := by - have completed := certificate.compression_union_rank_lt pairing unions powers separation collection infinite - hK conditions invariant.points_rank invariant.labels_rank - have target := (certificate.target_rank_lt pairing unions powers separation collection infinite - hK conditions invariant.points_rank invariant.labels_rank invariant.actors_rank).1 - have times := certificate.target_time_domain_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem - exact fields.graph_rank_lt_of_history pairing unions powers separation collection infinite hK conditions times - certificate.target.history agreement - (fun _ hs => certificate.target_history_carrier_rank_lt completed - (fun _ ht => prior.agreeing_history_carrier_rank_lt source.history priorRank priorAgreement ht) target hs) - invariant.columns_rank invariant.coordinates_rank j - -end GroundInitialMainSuccessorData - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialMainSeedSuccessor - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - certificate.target.Invariant K C ∧ - ZFSet.rank certificate.transition.map.code < ZFSet.rank K := by - dsimp only - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite - collection hK conditions - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation - collection infinite choice seed.source hC seed.injection_ground seed.dense - (fun lo hlo => (seed.no_endpoints lo hlo).2) seed.injection_code - have invariant := certificate.target_invariant pairing unions powers separation collection infinite - choice hC hK standard seed.invariant - refine ⟨seed, certificate, invariant, ?_⟩ - exact certificate.transition.map.code_rank_lt_inaccessible pairing unions powers separation infinite - hK conditions seed.invariant.points_rank invariant.points_rank - seed.invariant.actors_rank invariant.actors_rank - - - - - - -theorem exists_groundInitialMainSeedSuccessorSerialized - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - ∃ initial : GroundSerializedChronology M (insert seed.source.cutoff seed.source.cutoff) - C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), - ∃ successor : GroundSerializedChronology M - (insert certificate.target.cutoff certificate.target.cutoff) - C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), - initial.code ∈ M.sets ∧ ZFSet.rank initial.code < ZFSet.rank K ∧ - (∀ j t, t ∈ insert seed.source.cutoff seed.source.cutoff → - initial.fields.value j t = seed.source.history.fieldValue j t) ∧ - successor.code ∈ M.sets ∧ - (∀ j t, t ∈ insert certificate.target.cutoff certificate.target.cutoff → - successor.fields.value j t = certificate.target.history.fieldValue j t) ∧ - certificate.target.Invariant K C ∧ - ZFSet.rank certificate.transition.map.code < ZFSet.rank K ∧ - successor.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ - successor.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ - successor.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ - successor.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ - successor.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by - dsimp only - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite collection hK conditions - obtain ⟨initial, initialGround, initialRank, initialAgreement⟩ := - seed.exists_matchedInitialSerialization pairing unions powers separation infinite hK conditions - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation - collection infinite choice seed.source hC seed.injection_ground seed.dense - (fun lo hlo => (seed.no_endpoints lo hlo).2) seed.injection_code - obtain ⟨successor, successorGround, successorAgreement, terminal⟩ := - certificate.exists_targetSerialization pairing unions powers separation collection infinite choice initial initialAgreement - have invariant := certificate.target_invariant pairing unions powers separation collection infinite - choice hC hK standard seed.invariant - have transitionRank := certificate.transition.map.code_rank_lt_inaccessible pairing unions powers separation infinite - hK conditions seed.invariant.points_rank invariant.points_rank seed.invariant.actors_rank invariant.actors_rank - exact ⟨seed, certificate, initial, successor, initialGround, initialRank, initialAgreement, - successorGround, successorAgreement, invariant, transitionRank, terminal⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundCompressionSerializationTransport +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialSeedMatchedSerialization +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundExternalSerializedChronology + +namespace OAI + + +namespace PartitionPilot.Forcing.GroundSerializedChronology +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M (insert s s) C D rD) + +noncomputable def fixedTopValues (newHeight : ZFSet.{u}) : Fin 5 → ZFSet.{u} := + Fin.cases (fixedTopCarrier (serial.fields.value 0 s)) + (Fin.cases (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) + (Fin.cases (fixedTopMeet (serial.fields.value 0 s) (serial.fields.value 1 s)) + (Fin.cases (fixedTopBirth (serial.fields.value 0 s) (serial.fields.value 3 s) s) + (fun _ => newHeight)))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) +include pairing unions powers separation hHeight + +theorem fixedTopValues_ground : ∀ j, serial.fixedTopValues newHeight j ∈ M.sets := by + have hP := serial.fields.value_ground 0 s + have hr := serial.fields.value_ground 1 s + have hs := M.transitive serial.fields.time_ground (ZFSet.mem_insert s s) + exact Fin.cases (M.fixedTopCarrier_mem pairing unions hP) + (Fin.cases (M.fixedTopOrder_mem pairing unions powers separation hP hr) + (Fin.cases (M.fixedTopMeet_mem pairing unions powers separation hP hr) + (Fin.cases (M.fixedTopBirth_mem pairing unions hP (serial.fields.value_ground 3 s) hs) + (fun _ => hHeight)))) + +noncomputable def fixedTopFields : GroundChronologyFields M (insert s s) := + serial.fields.replaceTerminal pairing unions separation (serial.fixedTopValues newHeight) + (serial.fixedTopValues_ground pairing unions powers separation newHeight hHeight) + +theorem fixedTopFields_value_at (j : Fin 5) : + (serial.fixedTopFields pairing unions powers separation newHeight hHeight).value j s = + serial.fixedTopValues newHeight j := + serial.fields.replaceTerminal_value_at pairing unions separation _ _ j + +theorem fixedTopFields_value_old (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ s) : + (serial.fixedTopFields pairing unions powers separation newHeight hHeight).value j t = + serial.fields.value j t := + serial.fields.replaceTerminal_value_old pairing unions separation _ _ j ht + +theorem fixedTopFields_value (j : Fin 5) {t : ZFSet.{u}} (ht : t ∈ insert s s) : + (serial.fixedTopFields pairing unions powers separation newHeight hHeight).value j t = + appendHistoryValue s (serial.fields.value j) (serial.fixedTopValues newHeight j) t := + serial.fields.replaceTerminal_value pairing unions separation _ _ j ht + +theorem fixedTopFields_old_entries (j : Fin 5) {t y : ZFSet.{u}} (ht : t ∈ s) : + ZFSet.pair t y ∈ (serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph j ↔ + ZFSet.pair t y ∈ serial.fields.graph j := + serial.fields.replaceTerminal_old_entries pairing unions separation _ _ j ht + +theorem fixedTopFields_core + (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) + (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D + (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : + ChronologyCoreCode (insert s s) + (serial.fixedTopFields pairing unions powers separation newHeight hHeight).bound C D rD + (serial.fixedTopFields pairing unions powers separation newHeight hHeight).graph := by + let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight + refine ⟨fields.function, ?_⟩ + intro cutoff hc L r μ birth height eL er eμ eb eh + have eqL := fields.value_eq_of_entry 0 eL + have eqr := fields.value_eq_of_entry 1 er + have eqμ := fields.value_eq_of_entry 2 eμ + have eqb := fields.value_eq_of_entry 3 eb + have eqh := fields.value_eq_of_entry 4 eh + rw [← eqL, ← eqr, ← eqμ, ← eqb, ← eqh] + change ChronologyPointCode (insert s s) C D rD cutoff + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 4 cutoff) + rcases ZFSet.mem_insert_iff.1 hc with equal | hc + · subst cutoff + rw [fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at, + fixedTopFields_value_at, fixedTopFields_value_at] + have point := serial.fields.decoded_point serial.core (ZFSet.mem_insert s s) + exact ⟨fixedTopMeet_code point.meet, + fixedTopBirth_function point.birth_function (ZFSet.mem_insert s s), + fun x _ t entry => fixedTopBirth_bound earlier x t entry, + fixedTopBirth_oldMeet point.meet point.birth_function earlier point.old_meet, heightCode⟩ + · rw [fixedTopFields_value_old _ _ _ _ _ _ _ 0 hc, + fixedTopFields_value_old _ _ _ _ _ _ _ 1 hc, + fixedTopFields_value_old _ _ _ _ _ _ _ 2 hc, + fixedTopFields_value_old _ _ _ _ _ _ _ 3 hc, + fixedTopFields_value_old _ _ _ _ _ _ _ 4 hc] + exact serial.fields.decoded_point serial.core (ZFSet.mem_insert_of_mem _ hc) + +end PartitionPilot.Forcing.GroundSerializedChronology + + + +namespace PartitionPilot.Forcing.GroundSerializedChronology +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {s C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M (insert s s) C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (newHeight : ZFSet.{u}) (hHeight : newHeight ∈ M.sets) +variable (ordinal : ordinalSetProperty s) +variable (earlier : ∀ x t, ZFSet.pair x t ∈ serial.fields.value 3 s → t ∈ s) +include pairing unions powers separation hHeight ordinal earlier + +theorem fixedTopFields_rawWitnesses : + let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight + ∀ cutoff ∈ insert s s, ∀ t ∈ insert s s, t = cutoff ∨ t ∈ cutoff → + ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) + (fields.value 3 cutoff) t ZFSet.omega z := by + dsimp only + let fields := serial.fixedTopFields pairing unions powers separation newHeight hHeight + have inside {t a : ZFSet.{u}} (ht : t ∈ insert s s) (ha : a ∈ t) : a ∈ s := by + rcases ZFSet.mem_insert_iff.1 ht with equal | ht + · exact equal ▸ ha + · exact ordinal.1 t ht a ha + have transportSources {t A r μ birth z : ZFSet.{u}} (ht : t ∈ insert s s) + (code : GrowthLayerWitnessCode (serial.fields.graph 0) (serial.fields.graph 1) (serial.fields.graph 2) + A r μ birth t ZFSet.omega z) : + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + A r μ birth t ZFSet.omega z := by + exact code.congr_source_entries + (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 0 + (y := y) (inside ht ha)).symm) + (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 1 + (y := y) (inside ht ha)).symm) + (fun a ha y => (serial.fixedTopFields_old_entries pairing unions powers separation newHeight hHeight 2 + (y := y) (inside ht ha)).symm) + intro cutoff hc t ht before + change ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) (fields.value 3 cutoff) t ZFSet.omega z + by_cases terminal : cutoff = s + · subst cutoff + change ∃ z ∈ M.sets, GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 s) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 s) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 s) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 s) t ZFSet.omega z + rw [fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at, fixedTopFields_value_at] + by_cases top : t = s + · subst t + exact ⟨fixedTopLayerWitness (serial.fields.value 0 s), + M.fixedTopLayerWitness_mem pairing (serial.fields.value_ground 0 s), fixedTopLayerWitness_code earlier⟩ + · have strict : t ∈ s := before.resolve_left top + have prior := serial.layer_code s (ZFSet.mem_insert s s) t ht (Or.inr strict) + _ (serial.layerWitness_entry (ZFSet.mem_insert s s) ht (Or.inr strict)) + have point := serial.fields.decoded_point serial.core (ZFSet.mem_insert s s) + obtain ⟨z, hz, code⟩ := prior.exists_fixedTop_earlier pairing unions separation + (serial.fields.value_ground 0 s) (serial.layerWitness_ground s t) point.meet point.birth_function strict + exact ⟨z, hz, transportSources ht code⟩ + · have old : cutoff ∈ s := (ZFSet.mem_insert_iff.1 hc).resolve_left terminal + have code := transportSources ht (serial.layer_code cutoff hc t ht before + _ (serial.layerWitness_entry hc ht before)) + refine ⟨serial.layerWitness cutoff t, serial.layerWitness_ground cutoff t, ?_⟩ + change GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 0 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 1 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 2 cutoff) + ((serial.fixedTopFields pairing unions powers separation newHeight hHeight).value 3 cutoff) t ZFSet.omega _ + rw [fixedTopFields_value_old _ _ _ _ _ _ _ 0 old, + fixedTopFields_value_old _ _ _ _ _ _ _ 1 old, + fixedTopFields_value_old _ _ _ _ _ _ _ 2 old, + fixedTopFields_value_old _ _ _ _ _ _ _ 3 old] + exact code + +theorem exists_fixedTopSerialization + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (infinite : Realize M.sets infinity Fin.elim0) + (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D + (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : + ∃ extended : GroundSerializedChronology M (insert s s) C D rD, + extended.fields = serial.fixedTopFields pairing unions powers separation newHeight hHeight ∧ + extended.code ∈ M.sets := by + exact (serial.fixedTopFields pairing unions powers separation newHeight hHeight).exists_serializedChronology + pairing unions powers separation collection choice infinite + (serial.fixedTopFields_core pairing unions powers separation newHeight hHeight earlier heightCode) + (serial.fixedTopFields_rawWitnesses pairing unions powers separation newHeight hHeight ordinal earlier) + serial.ordinal + +theorem exists_fixedTopSerialization_values + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (infinite : Realize M.sets infinity Fin.elim0) + (heightCode : StrictLexHeightCode (fixedTopCarrier (serial.fields.value 0 s)) C D + (fixedTopOrder (serial.fields.value 0 s) (serial.fields.value 1 s)) newHeight rD) : + ∃ extended : GroundSerializedChronology M (insert s s) C D rD, + extended.fields = serial.fixedTopFields pairing unions powers separation newHeight hHeight ∧ + extended.code ∈ M.sets ∧ ∀ j t, t ∈ insert s s → extended.fields.value j t = + appendHistoryValue s (serial.fields.value j) (serial.fixedTopValues newHeight j) t := by + obtain ⟨extended, same, ground⟩ := serial.exists_fixedTopSerialization pairing unions powers separation + newHeight hHeight ordinal earlier collection choice infinite heightCode + refine ⟨extended, same, ground, ?_⟩ + intro j t ht + rw [same] + exact serial.fixedTopFields_value pairing unions powers separation newHeight hHeight j ht + +end PartitionPilot.Forcing.GroundSerializedChronology + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem GroundChronologicalHistory.fieldValue_eq_of_heq + {M : TransitiveGround.{u}} {T T' C D rD : ZFSet.{u}} + {first : GroundChronologicalHistory M T C D rD} + {second : GroundChronologicalHistory M T' C D rD} + (times : T = T') (same : HEq first second) (j : Fin 5) (s : ZFSet.{u}) : + first.fieldValue j s = second.fieldValue j s := by + cases times + cases eq_of_heq same + rfl + +namespace GroundInitialMainSuccessorData +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "comp" => certificate.compression +local notation "completion" => certificate.compression.born.profiled.heighted.completion +local notation "births" => certificate.births +local notation "heights" => certificate.heights +local notation "external" => certificate.external + +include pairing unions powers separation collection infinite choice + +theorem exists_compressionSerialization + (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) + (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → + prior.fields.value j s = source.history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD, + serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → + serial.fields.value j s = (comp).history.fieldValue j s := by + exact certificate.origin.exists_serializedCompression comp prior + pairing unions powers separation collection infinite choice + certificate.indices_ground certificate.sources_ground certificate.representatives_ground + source.stage.actors_ground certificate.task_action_ground (ZFSet.mem_insert _ _) + (M.initialCompressionData_template_constancy source.stage.carrier source.stage.actors + source.stage.order source.stage.meetGraph source.stage.action Labels) + rfl rfl rfl source.carrier_eq source.order_eq source.meet_eq rfl agreement + +theorem exists_externalSerialization + (prior : GroundSerializedChronology M (insert (comp).born.births.limit (comp).born.births.limit) C D rD) + (agreement : ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → + prior.fields.value j s = (comp).history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD, + serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert (births).limit (births).limit → + serial.fields.value j s = (external).history.fieldValue j s := by + have atBase (j : Fin 5) := agreement j (comp).born.births.limit (ZFSet.mem_insert _ _) + have sourceValues := (comp).limit_values + have sourceMatch : prior.fields.value 0 (comp).born.births.limit = (completion).algebra.union.fields 0 ∧ + prior.fields.value 1 (comp).born.births.limit = (completion).algebra.union.fields 1 ∧ + prior.fields.value 2 (comp).born.births.limit = (completion).algebra.union.fields 2 ∧ + prior.fields.value 3 (comp).born.births.limit = (comp).born.births.birth := + ⟨(atBase 0).trans sourceValues.1, (atBase 1).trans sourceValues.2.1, + (atBase 2).trans sourceValues.2.2.1, (atBase 3).trans sourceValues.2.2.2.1⟩ + obtain ⟨serial, _, ground, values⟩ := (births).exists_externalSerializedChronology heights prior + (external).inputs source.stage.group_code source.stage.action_code pairing unions powers separation + infinite source.stage.actors_ground source.stage.carrier_ground (ZFSet.mem_insert _ _) + sourceMatch collection choice + refine ⟨serial, ground, ?_⟩ + intro j s hs + rw [values j s hs] + have oldValue (a : ZFSet.{u}) (before : a ∈ (comp).born.births.limit ∨ a = (comp).born.births.limit) : + ((births).chronologyFields heights prior.toHistory).fieldValue j a = (external).history.fieldValue j a := by + have ha : a ∈ insert (comp).born.births.limit (comp).born.births.limit := before.elim + (fun h => ZFSet.mem_insert_of_mem _ h) (fun h => h.symm ▸ ZFSet.mem_insert _ _) + have left := (births).chronologyFields_old heights prior.toHistory before + have right := (external).old_values a before + have eLeft : ((births).chronologyFields heights prior.toHistory).fieldValue j a = prior.fields.value j a := + Fin.cases left.1 (Fin.cases left.2.1 (Fin.cases left.2.2.1 + (Fin.cases left.2.2.2.1 (Fin.cases left.2.2.2.2 (fun i => Fin.elim0 i))))) j + have eRight : (external).history.fieldValue j a = (comp).history.fieldValue j a := + Fin.cases right.1 (Fin.cases right.2.1 (Fin.cases right.2.2.1 + (Fin.cases right.2.2.2.1 (Fin.cases right.2.2.2.2 (fun i => Fin.elim0 i))))) j + exact eLeft.trans ((agreement j a ha).trans eRight.symm) + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · have left := (births).chronologyFields_limit heights prior.toHistory + have right := (external).limit_values + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + · rcases ((births).times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ + · exact oldValue s (Or.inl before) + · exact oldValue s (Or.inr equal) + · have left := (births).chronologyFields_stamp heights prior.toHistory n + have right := (external).stamp_values n + exact Fin.cases (left.1.trans right.1.symm) + (Fin.cases (left.2.1.trans right.2.1.symm) (Fin.cases (left.2.2.1.trans right.2.2.1.symm) + (Fin.cases (left.2.2.2.1.trans right.2.2.2.1.symm) + (Fin.cases (left.2.2.2.2.trans right.2.2.2.2.symm) (fun i => Fin.elim0 i))))) j + +theorem exists_boundedSerialization + (prior : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD) + (agreement : ∀ j s, s ∈ insert (births).limit (births).limit → + prior.fields.value j s = (external).history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert (births).limit (births).limit) C D rD, + serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert (births).limit (births).limit → + serial.fields.value j s = (external).bounded_history.fieldValue j s := by + have space := (agreement 0 (births).limit (ZFSet.mem_insert _ _)).trans (external).limit_values.1 + have order := (agreement 1 (births).limit (ZFSet.mem_insert _ _)).trans (external).limit_values.2.1 + have birth := (agreement 3 (births).limit (ZFSet.mem_insert _ _)).trans (external).limit_values.2.2.2.1 + have earlier : ∀ x t, ZFSet.pair x t ∈ prior.fields.value 3 (births).limit → t ∈ (births).limit := by + intro x t entry + rw [birth] at entry + exact (ZFSet.pair_mem_prod.1 ((births).function.1 entry)).2 + have heightCode : StrictLexHeightCode (fixedTopCarrier (prior.fields.value 0 (births).limit)) C D + (fixedTopOrder (prior.fields.value 0 (births).limit) (prior.fields.value 1 (births).limit)) + (heights).boundedHeight rD := by + rw [space, order] + exact certificate.boundedHeights.code + obtain ⟨serial, _, ground, values⟩ := prior.exists_fixedTopSerialization_values + pairing unions powers separation (heights).boundedHeight certificate.boundedHeights.height_ground + (births).times.ordinal earlier collection choice infinite heightCode + have terminal (j : Fin 5) : prior.fixedTopValues (heights).boundedHeight j = + (external).bounded_history.fieldValue j (births).limit := by + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun i => Fin.elim0 i))))) j + · change fixedTopCarrier (prior.fields.value 0 (births).limit) = _ + rw [space] + exact (external).bounded_values.1.symm + · change fixedTopOrder (prior.fields.value 0 (births).limit) (prior.fields.value 1 (births).limit) = _ + rw [space, order] + exact (external).bounded_values.2.1.symm + · change fixedTopMeet (prior.fields.value 0 (births).limit) (prior.fields.value 1 (births).limit) = _ + rw [space, order] + exact (external).bounded_values.2.2.1.symm + · change fixedTopBirth (prior.fields.value 0 (births).limit) (prior.fields.value 3 (births).limit) (births).limit = _ + rw [space, birth] + exact (external).bounded_values.2.2.2.1.symm + · exact (external).bounded_values.2.2.2.2.symm + refine ⟨serial, ground, ?_⟩ + intro j s hs + rw [values j s hs] + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · rw [appendHistoryValue_at] + exact terminal j + · rw [appendHistoryValue_old hs] + have previous := (external).bounded_old_values s hs + have same : (external).bounded_history.fieldValue j s = (external).history.fieldValue j s := + Fin.cases previous.1 (Fin.cases previous.2.1 (Fin.cases previous.2.2.1 + (Fin.cases previous.2.2.2.1 (Fin.cases previous.2.2.2.2 (fun i => Fin.elim0 i))))) j + exact (agreement j s (ZFSet.mem_insert_of_mem _ hs)).trans same.symm + +theorem exists_targetSerialization + (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) + (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → + prior.fields.value j s = source.history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert certificate.target.cutoff certificate.target.cutoff) C D rD, + serial.code ∈ M.sets ∧ + (∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → + serial.fields.value j s = certificate.target.history.fieldValue j s) ∧ + serial.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ + serial.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ + serial.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ + serial.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ + serial.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by + obtain ⟨compressionSerial, _, compressionValues⟩ := certificate.exists_compressionSerialization + pairing unions powers separation collection infinite choice prior agreement + obtain ⟨externalSerial, _, externalValues⟩ := certificate.exists_externalSerialization + pairing unions powers separation collection infinite choice compressionSerial compressionValues + obtain ⟨bounded, ground, values⟩ := certificate.exists_boundedSerialization + pairing unions powers separation collection infinite choice externalSerial externalValues + have times : insert (births).limit (births).limit = insert certificate.target.cutoff certificate.target.cutoff := + congrArg (fun t : ZFSet.{u} => insert t t) certificate.target_cutoff.symm + let serial := bounded.castTime times + have serialValues : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → + serial.fields.value j s = certificate.target.history.fieldValue j s := by + intro j s hs + rw [GroundSerializedChronology.castTime_value] + have old := values j s (times.symm ▸ hs) + have same := GroundChronologicalHistory.fieldValue_eq_of_heq times.symm certificate.target_history j s + exact old.trans same.symm + refine ⟨serial, ?_, serialValues, ?_, ?_, ?_, ?_, ?_⟩ + · rw [GroundSerializedChronology.castTime_code] + exact ground + · exact (serialValues 0 _ (ZFSet.mem_insert _ _)).trans certificate.target.carrier_eq + · exact (serialValues 1 _ (ZFSet.mem_insert _ _)).trans certificate.target.order_eq + · exact (serialValues 2 _ (ZFSet.mem_insert _ _)).trans certificate.target.meet_eq + · exact serialValues 3 _ (ZFSet.mem_insert _ _) + · exact (serialValues 4 _ (ZFSet.mem_insert _ _)).trans certificate.target.height_eq + +end GroundInitialMainSuccessorData + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +local notation "comp" => certificate.compression +local notation "completion" => certificate.compression.born.profiled.heighted.completion +local notation "births" => certificate.births +local notation "external" => certificate.external +variable {o : Ordinal.{u}} +variable (completed : ZFSet.rank (certificate.compression.born.profiled.heighted.completion.algebra.union.fields 0) < o) +variable (prior : ∀ s ∈ insert source.cutoff source.cutoff, ZFSet.rank (source.history.space s) < o) +include completed prior + +theorem compression_history_carrier_rank_lt {s : ZFSet.{u}} + (hs : s ∈ insert (comp).born.births.limit (comp).born.births.limit) : + ZFSet.rank ((comp).history.space s) < o := by + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · rw [(comp).limit_values.1] + exact completed + · rcases ((comp).born.births.times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ + · rw [((comp).old_values s (Or.inl before)).1] + exact prior s (ZFSet.mem_insert_of_mem _ before) + · rw [((comp).old_values s (Or.inr equal)).1] + exact prior s (equal.symm ▸ ZFSet.mem_insert _ _) + · rw [((comp).stamp_values n).1] + exact (ZFSet.rank_mono (((completion).algebra.union.fieldUnion 0).subset (n + 1))).trans_lt completed + +theorem external_history_carrier_rank_lt + (points : ZFSet.rank ((completion).externalPointCarrier source.stage.carrier + source.stage.order source.stage.meetGraph source.stage.action) < o) + {s : ZFSet.{u}} (hs : s ∈ insert (births).limit (births).limit) : + ZFSet.rank ((external).history.space s) < o := by + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · rw [(external).limit_values.1] + exact points + · rcases ((births).times.mem_limit_iff s).1 hs with before | equal | ⟨n, rfl⟩ + · rw [((external).old_values s (Or.inl before)).1] + exact certificate.compression_history_carrier_rank_lt completed prior (ZFSet.mem_insert_of_mem _ before) + · rw [((external).old_values s (Or.inr equal)).1] + exact certificate.compression_history_carrier_rank_lt completed prior (equal.symm ▸ ZFSet.mem_insert _ _) + · rw [((external).stamp_values n).1] + exact (ZFSet.rank_mono ((births).cutoff_subset n)).trans_lt points + +theorem target_history_carrier_rank_lt + (target : ZFSet.rank certificate.target.stage.carrier < o) + {s : ZFSet.{u}} (hs : s ∈ insert certificate.target.cutoff certificate.target.cutoff) : + ZFSet.rank (certificate.target.history.space s) < o := by + have times : insert certificate.target.cutoff certificate.target.cutoff = insert (births).limit (births).limit := + congrArg (fun t : ZFSet.{u} => insert t t) certificate.target_cutoff + have same : certificate.target.history.space s = (external).bounded_history.space s := + GroundChronologicalHistory.fieldValue_eq_of_heq times certificate.target_history 0 s + rw [same] + have hs' : s ∈ insert (births).limit (births).limit := times ▸ hs + rcases ZFSet.mem_insert_iff.1 hs' with rfl | hs' + · rw [(external).bounded_values.1, ← certificate.target_fields.1] + exact target + · rw [((external).bounded_old_values s hs').1] + have points : ZFSet.rank ((completion).externalPointCarrier source.stage.carrier + source.stage.order source.stage.meetGraph source.stage.action) < o := by + rw [certificate.target_fields.1] at target + exact (ZFSet.rank_mono (fixedTopCarrier_subset _)).trans_lt target + exact certificate.external_history_carrier_rank_lt completed prior points (ZFSet.mem_insert_of_mem _ hs') + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem GroundSerializedChronology.agreeing_history_carrier_rank_lt + {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} + (serial : GroundSerializedChronology M T C D rD) + (history : GroundChronologicalHistory M T C D rD) + {o : Ordinal.{u}} (rank : ZFSet.rank serial.code < o) + (agreement : ∀ j s, s ∈ T → serial.fields.value j s = history.fieldValue j s) + {s : ZFSet.{u}} (hs : s ∈ T) : ZFSet.rank (history.space s) < o := by + have bound := (serial.fieldValue_rank_lt_code 0 hs).trans rank + rw [agreement 0 s hs] at bound + exact bound + +namespace GroundInitialMainSuccessorData +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (invariant : source.Invariant K Labels) +variable (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) +variable (priorRank : ZFSet.rank prior.code < ZFSet.rank K) +variable (priorAgreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → + prior.fields.value j s = source.history.fieldValue j s) +include certificate pairing unions powers separation collection infinite hK conditions invariant priorRank priorAgreement +local notation "comp" => certificate.compression +local notation "completion" => certificate.compression.born.profiled.heighted.completion +local notation "births" => certificate.births +local notation "external" => certificate.external + +theorem compressionFieldGraphs_rank_lt + (fields : GroundChronologyFields M (insert (comp).born.births.limit (comp).born.births.limit)) + (agreement : ∀ j s, s ∈ insert (comp).born.births.limit (comp).born.births.limit → + fields.value j s = (comp).history.fieldValue j s) (j : Fin 5) : + ZFSet.rank (fields.graph j) < ZFSet.rank K := by + have completed := certificate.compression_union_rank_lt pairing unions powers separation collection infinite + hK conditions invariant.points_rank invariant.labels_rank + have times := conditions.successor_mem pairing unions powers separation infinite hK + (certificate.compression_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) + exact fields.graph_rank_lt_of_history pairing unions powers separation collection infinite hK conditions times + (comp).history agreement + (fun _ hs => certificate.compression_history_carrier_rank_lt completed + (fun _ ht => prior.agreeing_history_carrier_rank_lt source.history priorRank priorAgreement ht) hs) + invariant.columns_rank invariant.coordinates_rank j + +theorem externalFieldGraphs_rank_lt + (fields : GroundChronologyFields M (insert (births).limit (births).limit)) + (agreement : ∀ j s, s ∈ insert (births).limit (births).limit → + fields.value j s = (external).history.fieldValue j s) (j : Fin 5) : + ZFSet.rank (fields.graph j) < ZFSet.rank K := by + have completed := certificate.compression_union_rank_lt pairing unions powers separation collection infinite + hK conditions invariant.points_rank invariant.labels_rank + have target := (certificate.target_rank_lt pairing unions powers separation collection infinite + hK conditions invariant.points_rank invariant.labels_rank invariant.actors_rank).1 + rw [certificate.target_fields.1] at target + have points := (ZFSet.rank_mono (fixedTopCarrier_subset _)).trans_lt target + have times := conditions.successor_mem pairing unions powers separation infinite hK + (certificate.external_limit_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem) + exact fields.graph_rank_lt_of_history pairing unions powers separation collection infinite hK conditions times + (external).history agreement + (fun _ hs => certificate.external_history_carrier_rank_lt completed + (fun _ ht => prior.agreeing_history_carrier_rank_lt source.history priorRank priorAgreement ht) points hs) + invariant.columns_rank invariant.coordinates_rank j + +theorem targetFieldGraphs_rank_lt + (fields : GroundChronologyFields M (insert certificate.target.cutoff certificate.target.cutoff)) + (agreement : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → + fields.value j s = certificate.target.history.fieldValue j s) (j : Fin 5) : + ZFSet.rank (fields.graph j) < ZFSet.rank K := by + have completed := certificate.compression_union_rank_lt pairing unions powers separation collection infinite + hK conditions invariant.points_rank invariant.labels_rank + have target := (certificate.target_rank_lt pairing unions powers separation collection infinite + hK conditions invariant.points_rank invariant.labels_rank invariant.actors_rank).1 + have times := certificate.target_time_domain_mem pairing unions powers separation infinite hK conditions invariant.cutoff_mem + exact fields.graph_rank_lt_of_history pairing unions powers separation collection infinite hK conditions times + certificate.target.history agreement + (fun _ hs => certificate.target_history_carrier_rank_lt completed + (fun _ ht => prior.agreeing_history_carrier_rank_lt source.history priorRank priorAgreement ht) target hs) + invariant.columns_rank invariant.coordinates_rank j + +end GroundInitialMainSuccessorData + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialMainSeedSuccessor + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + certificate.target.Invariant K C ∧ + ZFSet.rank certificate.transition.map.code < ZFSet.rank K := by + dsimp only + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite + collection hK conditions + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation + collection infinite choice seed.source hC seed.injection_ground seed.dense + (fun lo hlo => (seed.no_endpoints lo hlo).2) seed.injection_code + have invariant := certificate.target_invariant pairing unions powers separation collection infinite + choice hC hK standard seed.invariant + refine ⟨seed, certificate, invariant, ?_⟩ + exact certificate.transition.map.code_rank_lt_inaccessible pairing unions powers separation infinite + hK conditions seed.invariant.points_rank invariant.points_rank + seed.invariant.actors_rank invariant.actors_rank + + + + + + +theorem exists_groundInitialMainSeedSuccessorSerialized + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + ∃ initial : GroundSerializedChronology M (insert seed.source.cutoff seed.source.cutoff) + C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), + ∃ successor : GroundSerializedChronology M + (insert certificate.target.cutoff certificate.target.cutoff) + C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), + initial.code ∈ M.sets ∧ ZFSet.rank initial.code < ZFSet.rank K ∧ + (∀ j t, t ∈ insert seed.source.cutoff seed.source.cutoff → + initial.fields.value j t = seed.source.history.fieldValue j t) ∧ + successor.code ∈ M.sets ∧ + (∀ j t, t ∈ insert certificate.target.cutoff certificate.target.cutoff → + successor.fields.value j t = certificate.target.history.fieldValue j t) ∧ + certificate.target.Invariant K C ∧ + ZFSet.rank certificate.transition.map.code < ZFSet.rank K ∧ + successor.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ + successor.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ + successor.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ + successor.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ + successor.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by + dsimp only + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite collection hK conditions + obtain ⟨initial, initialGround, initialRank, initialAgreement⟩ := + seed.exists_matchedInitialSerialization pairing unions powers separation infinite hK conditions + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation + collection infinite choice seed.source hC seed.injection_ground seed.dense + (fun lo hlo => (seed.no_endpoints lo hlo).2) seed.injection_code + obtain ⟨successor, successorGround, successorAgreement, terminal⟩ := + certificate.exists_targetSerialization pairing unions powers separation collection infinite choice initial initialAgreement + have invariant := certificate.target_invariant pairing unions powers separation collection infinite + choice hC hK standard seed.invariant + have transitionRank := certificate.transition.map.code_rank_lt_inaccessible pairing unions powers separation infinite + hK conditions seed.invariant.points_rank invariant.points_rank seed.invariant.actors_rank invariant.actors_rank + exact ⟨seed, certificate, initial, successor, initialGround, initialRank, initialAgreement, + successorGround, successorAgreement, invariant, transitionRank, terminal⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainStage.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainStage.lean index fd54d8746aaef86c2a77b0a0459a396a30c89b9a..1dcf40e9069cba5d2303d9768a8f1507b65b9633 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainStage.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialMainStage.lean @@ -1,468 +1,468 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteSeedBounds -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialMainAlgebra -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTwoPointHeights -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} - -noncomputable def initialBirth (stage : GroundMainStage M C D rD) : ZFSet.{u} := - constantFamilyGraph stage.carrier ∅ - -theorem initialBirth_function (stage : GroundMainStage M C D rD) : - ZFSet.IsFunc stage.carrier (insert (∅ : ZFSet.{u}) ∅) stage.initialBirth := - constantFamilyGraph_function stage.carrier ∅ - -theorem initialBirth_entry (stage : GroundMainStage M C D rD) (x t : ZFSet.{u}) : - ZFSet.pair x t ∈ stage.initialBirth ↔ x ∈ stage.carrier ∧ t = ∅ := - pair_mem_constantFamilyGraph stage.carrier ∅ x t - -theorem initialBirth_ground (stage : GroundMainStage M C D rD) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - stage.initialBirth ∈ M.sets := - M.constantFamilyGraph_mem pairing unions powers separation stage.carrier_ground - (M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩) - -theorem initialBirth_old_meet (stage : GroundMainStage M C D rD) : - OldMeetCode stage.order stage.meetGraph stage.initialBirth := by - intro x y z a b c _ bornX earlier - have equal := ((stage.initialBirth_entry x b).1 bornX).2 - exact False.elim (ZFSet.notMem_empty a (equal ▸ earlier)) - -noncomputable def initialHistory (stage : GroundMainStage M C D rD) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (small : M.groundEmbeddable stage.carrier ZFSet.omega) : - GroundChronologicalHistory M (insert (∅ : ZFSet.{u}) ∅) C D rD where - space := fun _ => stage.carrier - order := fun _ => stage.order - meetGraph := fun _ => stage.meetGraph - birth := fun _ => stage.initialBirth - height := fun _ => stage.height - space_mem := fun _ _ => stage.carrier_ground - order_mem := fun _ _ => stage.order_ground - meet_mem := fun _ _ => stage.meet_ground - birth_mem := fun _ _ => stage.initialBirth_ground pairing unions powers separation - height_mem := fun _ _ => stage.height_ground - meet_order := fun _ _ => stage.meet - birth_function := fun _ _ => stage.initialBirth_function - birth_bound := by - intro s hs x _ t entry - have zero : s = ∅ := by simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, - or_false] using hs - exact Or.inl (((stage.initialBirth_entry x t).1 entry).2.trans zero.symm) - old_meet := fun _ _ => stage.initialBirth_old_meet - strict_height := fun _ _ => stage.height_code - layer := fun _ _ _ _ _ => - .countablePoints stage.carrier stage.carrier_ground small (fun _ hx _ => hx) - -noncomputable def initialChronological (stage : GroundMainStage M C D rD) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (small : M.groundEmbeddable stage.carrier ZFSet.omega) : - GroundChronologicalMainStage M C D rD where - stage := stage - cutoff := ∅ - cutoff_ground := M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩ - cutoff_ordinal := ordinalSetProperty_empty - history := stage.initialHistory pairing unions powers separation small - carrier_eq := rfl - order_eq := rfl - meet_eq := rfl - height_eq := rfl - -noncomputable def initialChronologyField (stage : GroundMainStage M C D rD) : Fin 5 → ZFSet.{u} := - Fin.cases stage.carrier (Fin.cases stage.order (Fin.cases stage.meetGraph - (Fin.cases stage.initialBirth (Fin.cases stage.height Fin.elim0)))) - -noncomputable def initialChronologyGraph (stage : GroundMainStage M C D rD) - (j : Fin 5) : ZFSet.{u} := - constantFamilyGraph (insert (∅ : ZFSet.{u}) ∅) (stage.initialChronologyField j) - -theorem initialChronologyGraph_entry (stage : GroundMainStage M C D rD) - (j : Fin 5) (t x : ZFSet.{u}) : - ZFSet.pair t x ∈ stage.initialChronologyGraph j ↔ - t = ∅ ∧ x = stage.initialChronologyField j := by - simp only [initialChronologyGraph, pair_mem_constantFamilyGraph, - ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] - -theorem initialChronologyGraphs_ground (stage : GroundMainStage M C D rD) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (j : Fin 5) : stage.initialChronologyGraph j ∈ M.sets ∧ - ZFSet.IsFunc (insert (∅ : ZFSet.{u}) ∅) {stage.initialChronologyField j} - (stage.initialChronologyGraph j) := by - have zero := M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩ - have field : stage.initialChronologyField j ∈ M.sets := - Fin.cases stage.carrier_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground - (Fin.cases (stage.initialBirth_ground pairing unions powers separation) - (Fin.cases stage.height_ground (fun i => Fin.elim0 i))))) j - exact ⟨M.constantFamilyGraph_mem pairing unions powers separation - (M.insert_mem pairing unions zero zero) field, constantFamilyGraph_function _ _⟩ - -end GroundMainStage - -namespace GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) - -noncomputable def initialChronologyBound : ZFSet.{u} := - ZFSet.range stage.initialChronologyField - -theorem mem_initialChronologyBound (x : ZFSet.{u}) : - x ∈ stage.initialChronologyBound ↔ ∃ j : Fin 5, stage.initialChronologyField j = x := - ZFSet.mem_range - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem initialChronologyBound_ground : stage.initialChronologyBound ∈ M.sets := by - apply M.finite_range_mem pairing unions ⟨stage.carrier, stage.carrier_ground⟩ - exact Fin.cases stage.carrier_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground - (Fin.cases (stage.initialBirth_ground pairing unions powers separation) - (Fin.cases stage.height_ground (fun i => Fin.elim0 i))))) - -noncomputable def initialGroundChronologyFields : - GroundChronologyFields M (insert (∅ : ZFSet.{u}) ∅) where - time_ground := M.insert_mem pairing unions - (M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩) - (M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩) - bound := stage.initialChronologyBound - bound_ground := stage.initialChronologyBound_ground pairing unions powers separation - graph := stage.initialChronologyGraph - graph_ground := fun j => (stage.initialChronologyGraphs_ground pairing unions powers separation j).1 - function := by - intro j - have actual := (stage.initialChronologyGraphs_ground pairing unions powers separation j).2 - refine ⟨?_, actual.2⟩ - intro z hz - obtain ⟨s, hs, x, hx, rfl⟩ := ZFSet.mem_prod.1 (actual.1 hz) - have equal : x = stage.initialChronologyField j := ZFSet.mem_singleton.1 hx - exact ZFSet.pair_mem_prod.2 ⟨hs, - (stage.mem_initialChronologyBound x).2 ⟨j, equal.symm⟩⟩ - -theorem initialGroundChronologyFields_graph : - (stage.initialGroundChronologyFields pairing unions powers separation).graph = - stage.initialChronologyGraph := rfl - -theorem initialGroundChronologyFields_value (j : Fin 5) {s : ZFSet.{u}} - (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) : - (stage.initialGroundChronologyFields pairing unions powers separation).value j s = - stage.initialChronologyField j := by - apply (stage.initialGroundChronologyFields pairing unions powers separation).value_eq_of_entry j - apply (stage.initialChronologyGraph_entry j s (stage.initialChronologyField j)).2 - exact ⟨by simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using hs, rfl⟩ - -theorem initialGroundChronologyFields_values : - let fields := stage.initialGroundChronologyFields pairing unions powers separation - fields.value 0 ∅ = stage.carrier ∧ fields.value 1 ∅ = stage.order ∧ - fields.value 2 ∅ = stage.meetGraph ∧ fields.value 3 ∅ = stage.initialBirth ∧ - fields.value 4 ∅ = stage.height := by - exact ⟨stage.initialGroundChronologyFields_value pairing unions powers separation 0 (ZFSet.mem_insert _ _), - stage.initialGroundChronologyFields_value pairing unions powers separation 1 (ZFSet.mem_insert _ _), - stage.initialGroundChronologyFields_value pairing unions powers separation 2 (ZFSet.mem_insert _ _), - stage.initialGroundChronologyFields_value pairing unions powers separation 3 (ZFSet.mem_insert _ _), - stage.initialGroundChronologyFields_value pairing unions powers separation 4 (ZFSet.mem_insert _ _)⟩ - -theorem initialGroundChronologyFields_code_ground : - (stage.initialGroundChronologyFields pairing unions powers separation).code ∈ M.sets := - (stage.initialGroundChronologyFields pairing unions powers separation).code_ground pairing - -end GroundMainStage - -section -open SetFormula -universe u - -theorem InitialMainAlgebra.carrier_eq_pair : - (InitialMainAlgebra.carrier : ZFSet.{u}) = - {InitialMainAlgebra.bottom, InitialMainAlgebra.top} := by - apply ZFSet.ext - intro x - rw [InitialMainAlgebra.mem_carrier, ZFSet.mem_pair] - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable {C D rD c d0 d1 : ZFSet.{u}} -variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) -variable (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) (gap : ZFSet.pair d0 d1 ∈ rD) - -noncomputable def initialMainStage : GroundMainStage M C D rD := by - have ground := M.initialMainAlgebra_ground pairing unions separation infinite - have hP := ground.1 - have hG := ground.2.1 - have hr := ground.2.2.1 - have hMeet := ground.2.2.2.1 - have hm := ground.2.2.2.2.1 - have hInv := ground.2.2.2.2.2.1 - have hA := ground.2.2.2.2.2.2 - have hBottom := M.transitive hP InitialMainAlgebra.bottom_mem - have hTop := M.transitive hP InitialMainAlgebra.top_mem - have height := M.twoPointHeight_mem pairing hBottom hTop (M.transitive hC hc) - (M.transitive hD h0) (M.transitive hD h1) - have strict : StrictLexHeightCode InitialMainAlgebra.carrier C D InitialMainAlgebra.order - (twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top c d0 d1) rD := by - rw [InitialMainAlgebra.carrier_eq_pair] - exact twoPointHeight_strict InitialMainAlgebra.bottom_ne_top hc h0 h1 gap - have small : M.groundEmbeddable - (relationImage InitialMainAlgebra.carrier (ZFSet.prod C D) - (twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top c d0 d1)) ZFSet.omega := by - rw [InitialMainAlgebra.carrier_eq_pair] - exact M.twoPointHeight_range_countable pairing unions powers separation infinite hC hD hc h0 h1 - exact GroundMainStage.ofCodes pairing unions powers separation hP hG hr hMeet hA hm hInv - hC hD hrD height InitialMainAlgebra.meet_code InitialMainAlgebra.group_code - InitialMainAlgebra.action_code InitialMainAlgebra.bottom_mem InitialMainAlgebra.least - InitialMainAlgebra.top_mem InitialMainAlgebra.greatest strict small - -noncomputable def initialMainChronological : GroundChronologicalMainStage M C D rD := - (M.initialMainStage pairing unions powers separation infinite hC hD hrD hc h0 h1 gap).initialChronological - pairing unions powers separation (M.natSetCode_countable pairing unions powers separation infinite 2) - -theorem initialMainStage_fields : - let stage := M.initialMainStage pairing unions powers separation infinite hC hD hrD hc h0 h1 gap - stage.carrier = natSetCode 2 ∧ stage.actors = natSetCode 1 ∧ - stage.order = InitialMainAlgebra.order ∧ stage.meetGraph = InitialMainAlgebra.meetGraph ∧ - stage.height = twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top c d0 d1 := - ⟨rfl, rfl, rfl, rfl, rfl⟩ - -theorem initialMainChronological_fields : - let stage := M.initialMainChronological pairing unions powers separation infinite hC hD hrD hc h0 h1 gap - stage.stage.carrier = natSetCode 2 ∧ stage.stage.actors = natSetCode 1 ∧ - stage.cutoff = ∅ ∧ stage.birth = constantFamilyGraph (natSetCode 2) ∅ := - ⟨rfl, rfl, rfl, rfl⟩ - -theorem initialMainStage_two_points : - let stage := M.initialMainStage pairing unions powers separation infinite hC hD hrD hc h0 h1 gap - stage.bottom ≠ stage.top ∧ ∀ x ∈ stage.carrier, x = stage.bottom ∨ x = stage.top := - ⟨InitialMainAlgebra.bottom_ne_top, fun x hx => (InitialMainAlgebra.mem_carrier x).1 hx⟩ - -end TransitiveGround - -end - -namespace GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem initialChronologyCore : - ChronologyCoreCode (insert (∅ : ZFSet.{u}) ∅) stage.initialChronologyBound C D rD - stage.initialChronologyGraph := by - refine ⟨(stage.initialGroundChronologyFields pairing unions powers separation).function, ?_⟩ - intro s hs L r μ birth height eL er eμ eb eh - have zero : s = ∅ := by - simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using hs - have lEq : L = stage.carrier := ((stage.initialChronologyGraph_entry 0 s L).1 eL).2 - have rEq : r = stage.order := ((stage.initialChronologyGraph_entry 1 s r).1 er).2 - have mEq : μ = stage.meetGraph := ((stage.initialChronologyGraph_entry 2 s μ).1 eμ).2 - have bEq : birth = stage.initialBirth := ((stage.initialChronologyGraph_entry 3 s birth).1 eb).2 - have hEq : height = stage.height := ((stage.initialChronologyGraph_entry 4 s height).1 eh).2 - subst s L r μ birth height - exact ⟨stage.meet, stage.initialBirth_function, - fun x _ t entry => Or.inl (((stage.initialBirth_entry x t).1 entry).2), - stage.initialBirth_old_meet, stage.height_code⟩ - -noncomputable def initialDecodedChronology - (small : M.groundEmbeddable stage.carrier ZFSet.omega) : - GroundChronologicalHistory M (insert (∅ : ZFSet.{u}) ∅) C D rD := - (stage.initialGroundChronologyFields pairing unions powers separation).toHistory - (stage.initialChronologyCore pairing unions powers separation) (by - intro cutoff hc _ _ _ - refine .countablePoints stage.carrier stage.carrier_ground small ?_ - intro x hx _ - have equal : (stage.initialGroundChronologyFields pairing unions powers separation).value - 0 cutoff = stage.carrier := - stage.initialGroundChronologyFields_value pairing unions powers separation 0 hc - exact equal ▸ hx) - -theorem initialDecodedChronology_values - (small : M.groundEmbeddable stage.carrier ZFSet.omega) {s : ZFSet.{u}} - (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) : - let history := stage.initialDecodedChronology pairing unions powers separation small - history.space s = stage.carrier ∧ history.order s = stage.order ∧ - history.meetGraph s = stage.meetGraph ∧ history.birth s = stage.initialBirth ∧ - history.height s = stage.height := - ⟨stage.initialGroundChronologyFields_value pairing unions powers separation 0 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 1 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 2 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 3 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 4 hs⟩ - -end GroundMainStage - -namespace GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {injection : ZFSet.{u}} (hInjection : injection ∈ M.sets) -variable (injected : InjectionCode stage.carrier ZFSet.omega injection) - -noncomputable def initialSerializedChronology : - GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) C D rD where - fields := stage.initialGroundChronologyFields pairing unions powers separation - ordinal := ordinalSetProperty_succ ordinalSetProperty_empty - core := stage.initialChronologyCore pairing unions powers separation - layerBound := {countableLayerWitness stage.carrier injection} - layer_bound_ground := by - have ground := M.countableLayerWitness_mem pairing stage.carrier_ground hInjection - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ground ground - layers := constantFamilyGraph (chronologyPairs (insert (∅ : ZFSet.{u}) ∅)) - (countableLayerWitness stage.carrier injection) - layers_ground := M.constantFamilyGraph_mem pairing unions powers separation - (M.chronologyPairs_mem pairing unions powers separation - (stage.initialGroundChronologyFields pairing unions powers separation).time_ground) - (M.countableLayerWitness_mem pairing stage.carrier_ground hInjection) - layer_function := constantFamilyGraph_function _ _ - layer_code := by - intro s hs t _ _ z entry - have equal : z = countableLayerWitness stage.carrier injection := - ((pair_mem_constantFamilyGraph _ _ _ _).1 entry).2 - refine Or.inl ⟨stage.carrier, injection, equal, injected, ?_⟩ - intro x hx _ - have carrier : (stage.initialGroundChronologyFields pairing unions powers separation).value - 0 s = stage.carrier := - stage.initialGroundChronologyFields_value pairing unions powers separation 0 hs - exact carrier ▸ hx - -theorem initialSerializedChronology_layers : - (stage.initialSerializedChronology pairing unions powers separation hInjection injected).layers = - constantFamilyGraph (chronologyPairs (insert (∅ : ZFSet.{u}) ∅)) - (countableLayerWitness stage.carrier injection) := rfl - -theorem initialSerializedChronology_layerWitness {s t : ZFSet.{u}} - (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) - (ht : t ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) (earlier : t = s ∨ t ∈ s) : - (stage.initialSerializedChronology pairing unions powers separation hInjection injected).layerWitness s t = - countableLayerWitness stage.carrier injection := - ((pair_mem_constantFamilyGraph _ _ _ _).1 - ((stage.initialSerializedChronology pairing unions powers separation hInjection injected).layerWitness_entry - hs ht earlier)).2 - -theorem initialSerializedChronology_values {s : ZFSet.{u}} - (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) : - let history := (stage.initialSerializedChronology pairing unions powers separation hInjection injected).toHistory - history.space s = stage.carrier ∧ history.order s = stage.order ∧ - history.meetGraph s = stage.meetGraph ∧ history.birth s = stage.initialBirth ∧ - history.height s = stage.height := - ⟨stage.initialGroundChronologyFields_value pairing unions powers separation 0 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 1 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 2 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 3 hs, - stage.initialGroundChronologyFields_value pairing unions powers separation 4 hs⟩ - -theorem initialSerializedChronology_code_ground : - (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code ∈ M.sets := - (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code_ground pairing - -include pairing unions powers separation in -theorem exists_initialSerializedChronology - (small : M.groundEmbeddable stage.carrier ZFSet.omega) : - ∃ serial : GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) C D rD, - serial.code ∈ M.sets ∧ serial.fields.graph = stage.initialChronologyGraph ∧ - serial.toHistory.space ∅ = stage.carrier ∧ - serial.toHistory.order ∅ = stage.order ∧ - serial.toHistory.meetGraph ∅ = stage.meetGraph ∧ - serial.toHistory.birth ∅ = stage.initialBirth ∧ - serial.toHistory.height ∅ = stage.height := by - obtain ⟨injection, hInjection, injected⟩ := small - exact ⟨stage.initialSerializedChronology pairing unions powers separation hInjection injected, - stage.initialSerializedChronology_code_ground pairing unions powers separation hInjection injected, - rfl, stage.initialSerializedChronology_values pairing unions powers separation hInjection injected - (ZFSet.mem_insert _ _)⟩ - -end GroundMainStage - -namespace GroundMainStage -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -variable (points : ZFSet.rank stage.carrier < o) (height : ZFSet.rank stage.height < o) -include limit points height - -theorem initialChronologyField_rank_lt : ∀ j, ZFSet.rank (stage.initialChronologyField j) < o := by - have pp := rank_product_lt limit points points - have order := (ZFSet.rank_mono stage.meet.order.relation).trans_lt pp - have meet := rank_functionGraph_lt limit stage.meet.operation pp points - have zero : ZFSet.rank (∅ : ZFSet.{u}) < o := by simpa only [ZFSet.rank_empty] using limit.pos - have birth := rank_constantFamilyGraph_lt limit points zero - exact Fin.cases points (Fin.cases order (Fin.cases meet (Fin.cases birth - (Fin.cases height (fun i => Fin.elim0 i))))) - -theorem initialChronologyBound_rank_lt : ZFSet.rank stage.initialChronologyBound < o := - rank_finiteRange_lt limit 5 _ (stage.initialChronologyField_rank_lt limit points height) - -theorem initialChronologyGraph_rank_lt : ∀ j, ZFSet.rank (stage.initialChronologyGraph j) < o := - fun j => rank_constantFamilyGraph_lt limit (rank_natSetCode_lt limit 1) - (stage.initialChronologyField_rank_lt limit points height j) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {injection : ZFSet.{u}} (hInjection : injection ∈ M.sets) -variable (injected : InjectionCode stage.carrier ZFSet.omega injection) - -theorem initialSerializedChronology_code_rank_lt (omega : ZFSet.rank (ZFSet.omega : ZFSet.{u}) < o) : - ZFSet.rank (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code < o := by - let serial := stage.initialSerializedChronology pairing unions powers separation hInjection injected - have time : ZFSet.rank (insert (∅ : ZFSet.{u}) ∅) < o := rank_natSetCode_lt limit 1 - have fieldsCode : ZFSet.rank serial.fields.code < o := - rank_nonemptyTupleCode_lt limit 6 _ (Fin.cases time - (Fin.cases (stage.initialChronologyBound_rank_lt limit points height) - (stage.initialChronologyGraph_rank_lt limit points height))) - have injectionRank := rank_functionGraph_lt limit injected.function points omega - have witness : ZFSet.rank (countableLayerWitness stage.carrier injection) < o := - rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases (rank_natSetCode_lt limit 0) (Fin.cases points (fun _ => injectionRank))) - have layerBound : ZFSet.rank serial.layerBound < o := rank_singleton_lt limit witness - have pairs := (ZFSet.rank_mono (chronologyPairs_subset (insert (∅ : ZFSet.{u}) ∅))).trans_lt - (rank_product_lt limit time time) - have layers : ZFSet.rank serial.layers < o := rank_constantFamilyGraph_lt limit pairs witness - exact rank_nonemptyTupleCode_lt limit 2 _ (Fin.cases fieldsCode (Fin.cases layerBound (fun _ => layers))) - -omit limit points height in -theorem initialSerializedChronology_code_rank_lt_inaccessible - (infinite : Realize M.sets infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (points : ZFSet.rank stage.carrier < ZFSet.rank K) - (height : ZFSet.rank stage.height < ZFSet.rank K) : - ZFSet.rank (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code < - ZFSet.rank K := - stage.initialSerializedChronology_code_rank_lt - (conditions.rank_isLimit pairing unions powers separation infinite hK) points height - pairing unions powers separation hInjection injected (ZFSet.rank_lt_of_mem conditions.2.1) - -end GroundMainStage - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFiniteSeedBounds +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundInitialMainAlgebra +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTwoPointHeights +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTwoStageMainDiagram + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} + +noncomputable def initialBirth (stage : GroundMainStage M C D rD) : ZFSet.{u} := + constantFamilyGraph stage.carrier ∅ + +theorem initialBirth_function (stage : GroundMainStage M C D rD) : + ZFSet.IsFunc stage.carrier (insert (∅ : ZFSet.{u}) ∅) stage.initialBirth := + constantFamilyGraph_function stage.carrier ∅ + +theorem initialBirth_entry (stage : GroundMainStage M C D rD) (x t : ZFSet.{u}) : + ZFSet.pair x t ∈ stage.initialBirth ↔ x ∈ stage.carrier ∧ t = ∅ := + pair_mem_constantFamilyGraph stage.carrier ∅ x t + +theorem initialBirth_ground (stage : GroundMainStage M C D rD) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + stage.initialBirth ∈ M.sets := + M.constantFamilyGraph_mem pairing unions powers separation stage.carrier_ground + (M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩) + +theorem initialBirth_old_meet (stage : GroundMainStage M C D rD) : + OldMeetCode stage.order stage.meetGraph stage.initialBirth := by + intro x y z a b c _ bornX earlier + have equal := ((stage.initialBirth_entry x b).1 bornX).2 + exact False.elim (ZFSet.notMem_empty a (equal ▸ earlier)) + +noncomputable def initialHistory (stage : GroundMainStage M C D rD) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (small : M.groundEmbeddable stage.carrier ZFSet.omega) : + GroundChronologicalHistory M (insert (∅ : ZFSet.{u}) ∅) C D rD where + space := fun _ => stage.carrier + order := fun _ => stage.order + meetGraph := fun _ => stage.meetGraph + birth := fun _ => stage.initialBirth + height := fun _ => stage.height + space_mem := fun _ _ => stage.carrier_ground + order_mem := fun _ _ => stage.order_ground + meet_mem := fun _ _ => stage.meet_ground + birth_mem := fun _ _ => stage.initialBirth_ground pairing unions powers separation + height_mem := fun _ _ => stage.height_ground + meet_order := fun _ _ => stage.meet + birth_function := fun _ _ => stage.initialBirth_function + birth_bound := by + intro s hs x _ t entry + have zero : s = ∅ := by simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, + or_false] using hs + exact Or.inl (((stage.initialBirth_entry x t).1 entry).2.trans zero.symm) + old_meet := fun _ _ => stage.initialBirth_old_meet + strict_height := fun _ _ => stage.height_code + layer := fun _ _ _ _ _ => + .countablePoints stage.carrier stage.carrier_ground small (fun _ hx _ => hx) + +noncomputable def initialChronological (stage : GroundMainStage M C D rD) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (small : M.groundEmbeddable stage.carrier ZFSet.omega) : + GroundChronologicalMainStage M C D rD where + stage := stage + cutoff := ∅ + cutoff_ground := M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩ + cutoff_ordinal := ordinalSetProperty_empty + history := stage.initialHistory pairing unions powers separation small + carrier_eq := rfl + order_eq := rfl + meet_eq := rfl + height_eq := rfl + +noncomputable def initialChronologyField (stage : GroundMainStage M C D rD) : Fin 5 → ZFSet.{u} := + Fin.cases stage.carrier (Fin.cases stage.order (Fin.cases stage.meetGraph + (Fin.cases stage.initialBirth (Fin.cases stage.height Fin.elim0)))) + +noncomputable def initialChronologyGraph (stage : GroundMainStage M C D rD) + (j : Fin 5) : ZFSet.{u} := + constantFamilyGraph (insert (∅ : ZFSet.{u}) ∅) (stage.initialChronologyField j) + +theorem initialChronologyGraph_entry (stage : GroundMainStage M C D rD) + (j : Fin 5) (t x : ZFSet.{u}) : + ZFSet.pair t x ∈ stage.initialChronologyGraph j ↔ + t = ∅ ∧ x = stage.initialChronologyField j := by + simp only [initialChronologyGraph, pair_mem_constantFamilyGraph, + ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] + +theorem initialChronologyGraphs_ground (stage : GroundMainStage M C D rD) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (j : Fin 5) : stage.initialChronologyGraph j ∈ M.sets ∧ + ZFSet.IsFunc (insert (∅ : ZFSet.{u}) ∅) {stage.initialChronologyField j} + (stage.initialChronologyGraph j) := by + have zero := M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩ + have field : stage.initialChronologyField j ∈ M.sets := + Fin.cases stage.carrier_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground + (Fin.cases (stage.initialBirth_ground pairing unions powers separation) + (Fin.cases stage.height_ground (fun i => Fin.elim0 i))))) j + exact ⟨M.constantFamilyGraph_mem pairing unions powers separation + (M.insert_mem pairing unions zero zero) field, constantFamilyGraph_function _ _⟩ + +end GroundMainStage + +namespace GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) + +noncomputable def initialChronologyBound : ZFSet.{u} := + ZFSet.range stage.initialChronologyField + +theorem mem_initialChronologyBound (x : ZFSet.{u}) : + x ∈ stage.initialChronologyBound ↔ ∃ j : Fin 5, stage.initialChronologyField j = x := + ZFSet.mem_range + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem initialChronologyBound_ground : stage.initialChronologyBound ∈ M.sets := by + apply M.finite_range_mem pairing unions ⟨stage.carrier, stage.carrier_ground⟩ + exact Fin.cases stage.carrier_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground + (Fin.cases (stage.initialBirth_ground pairing unions powers separation) + (Fin.cases stage.height_ground (fun i => Fin.elim0 i))))) + +noncomputable def initialGroundChronologyFields : + GroundChronologyFields M (insert (∅ : ZFSet.{u}) ∅) where + time_ground := M.insert_mem pairing unions + (M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩) + (M.empty_mem ⟨stage.carrier, stage.carrier_ground⟩) + bound := stage.initialChronologyBound + bound_ground := stage.initialChronologyBound_ground pairing unions powers separation + graph := stage.initialChronologyGraph + graph_ground := fun j => (stage.initialChronologyGraphs_ground pairing unions powers separation j).1 + function := by + intro j + have actual := (stage.initialChronologyGraphs_ground pairing unions powers separation j).2 + refine ⟨?_, actual.2⟩ + intro z hz + obtain ⟨s, hs, x, hx, rfl⟩ := ZFSet.mem_prod.1 (actual.1 hz) + have equal : x = stage.initialChronologyField j := ZFSet.mem_singleton.1 hx + exact ZFSet.pair_mem_prod.2 ⟨hs, + (stage.mem_initialChronologyBound x).2 ⟨j, equal.symm⟩⟩ + +theorem initialGroundChronologyFields_graph : + (stage.initialGroundChronologyFields pairing unions powers separation).graph = + stage.initialChronologyGraph := rfl + +theorem initialGroundChronologyFields_value (j : Fin 5) {s : ZFSet.{u}} + (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) : + (stage.initialGroundChronologyFields pairing unions powers separation).value j s = + stage.initialChronologyField j := by + apply (stage.initialGroundChronologyFields pairing unions powers separation).value_eq_of_entry j + apply (stage.initialChronologyGraph_entry j s (stage.initialChronologyField j)).2 + exact ⟨by simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using hs, rfl⟩ + +theorem initialGroundChronologyFields_values : + let fields := stage.initialGroundChronologyFields pairing unions powers separation + fields.value 0 ∅ = stage.carrier ∧ fields.value 1 ∅ = stage.order ∧ + fields.value 2 ∅ = stage.meetGraph ∧ fields.value 3 ∅ = stage.initialBirth ∧ + fields.value 4 ∅ = stage.height := by + exact ⟨stage.initialGroundChronologyFields_value pairing unions powers separation 0 (ZFSet.mem_insert _ _), + stage.initialGroundChronologyFields_value pairing unions powers separation 1 (ZFSet.mem_insert _ _), + stage.initialGroundChronologyFields_value pairing unions powers separation 2 (ZFSet.mem_insert _ _), + stage.initialGroundChronologyFields_value pairing unions powers separation 3 (ZFSet.mem_insert _ _), + stage.initialGroundChronologyFields_value pairing unions powers separation 4 (ZFSet.mem_insert _ _)⟩ + +theorem initialGroundChronologyFields_code_ground : + (stage.initialGroundChronologyFields pairing unions powers separation).code ∈ M.sets := + (stage.initialGroundChronologyFields pairing unions powers separation).code_ground pairing + +end GroundMainStage + +section +open SetFormula +universe u + +theorem InitialMainAlgebra.carrier_eq_pair : + (InitialMainAlgebra.carrier : ZFSet.{u}) = + {InitialMainAlgebra.bottom, InitialMainAlgebra.top} := by + apply ZFSet.ext + intro x + rw [InitialMainAlgebra.mem_carrier, ZFSet.mem_pair] + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable {C D rD c d0 d1 : ZFSet.{u}} +variable (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) +variable (hc : c ∈ C) (h0 : d0 ∈ D) (h1 : d1 ∈ D) (gap : ZFSet.pair d0 d1 ∈ rD) + +noncomputable def initialMainStage : GroundMainStage M C D rD := by + have ground := M.initialMainAlgebra_ground pairing unions separation infinite + have hP := ground.1 + have hG := ground.2.1 + have hr := ground.2.2.1 + have hMeet := ground.2.2.2.1 + have hm := ground.2.2.2.2.1 + have hInv := ground.2.2.2.2.2.1 + have hA := ground.2.2.2.2.2.2 + have hBottom := M.transitive hP InitialMainAlgebra.bottom_mem + have hTop := M.transitive hP InitialMainAlgebra.top_mem + have height := M.twoPointHeight_mem pairing hBottom hTop (M.transitive hC hc) + (M.transitive hD h0) (M.transitive hD h1) + have strict : StrictLexHeightCode InitialMainAlgebra.carrier C D InitialMainAlgebra.order + (twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top c d0 d1) rD := by + rw [InitialMainAlgebra.carrier_eq_pair] + exact twoPointHeight_strict InitialMainAlgebra.bottom_ne_top hc h0 h1 gap + have small : M.groundEmbeddable + (relationImage InitialMainAlgebra.carrier (ZFSet.prod C D) + (twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top c d0 d1)) ZFSet.omega := by + rw [InitialMainAlgebra.carrier_eq_pair] + exact M.twoPointHeight_range_countable pairing unions powers separation infinite hC hD hc h0 h1 + exact GroundMainStage.ofCodes pairing unions powers separation hP hG hr hMeet hA hm hInv + hC hD hrD height InitialMainAlgebra.meet_code InitialMainAlgebra.group_code + InitialMainAlgebra.action_code InitialMainAlgebra.bottom_mem InitialMainAlgebra.least + InitialMainAlgebra.top_mem InitialMainAlgebra.greatest strict small + +noncomputable def initialMainChronological : GroundChronologicalMainStage M C D rD := + (M.initialMainStage pairing unions powers separation infinite hC hD hrD hc h0 h1 gap).initialChronological + pairing unions powers separation (M.natSetCode_countable pairing unions powers separation infinite 2) + +theorem initialMainStage_fields : + let stage := M.initialMainStage pairing unions powers separation infinite hC hD hrD hc h0 h1 gap + stage.carrier = natSetCode 2 ∧ stage.actors = natSetCode 1 ∧ + stage.order = InitialMainAlgebra.order ∧ stage.meetGraph = InitialMainAlgebra.meetGraph ∧ + stage.height = twoPointHeight InitialMainAlgebra.bottom InitialMainAlgebra.top c d0 d1 := + ⟨rfl, rfl, rfl, rfl, rfl⟩ + +theorem initialMainChronological_fields : + let stage := M.initialMainChronological pairing unions powers separation infinite hC hD hrD hc h0 h1 gap + stage.stage.carrier = natSetCode 2 ∧ stage.stage.actors = natSetCode 1 ∧ + stage.cutoff = ∅ ∧ stage.birth = constantFamilyGraph (natSetCode 2) ∅ := + ⟨rfl, rfl, rfl, rfl⟩ + +theorem initialMainStage_two_points : + let stage := M.initialMainStage pairing unions powers separation infinite hC hD hrD hc h0 h1 gap + stage.bottom ≠ stage.top ∧ ∀ x ∈ stage.carrier, x = stage.bottom ∨ x = stage.top := + ⟨InitialMainAlgebra.bottom_ne_top, fun x hx => (InitialMainAlgebra.mem_carrier x).1 hx⟩ + +end TransitiveGround + +end + +namespace GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem initialChronologyCore : + ChronologyCoreCode (insert (∅ : ZFSet.{u}) ∅) stage.initialChronologyBound C D rD + stage.initialChronologyGraph := by + refine ⟨(stage.initialGroundChronologyFields pairing unions powers separation).function, ?_⟩ + intro s hs L r μ birth height eL er eμ eb eh + have zero : s = ∅ := by + simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using hs + have lEq : L = stage.carrier := ((stage.initialChronologyGraph_entry 0 s L).1 eL).2 + have rEq : r = stage.order := ((stage.initialChronologyGraph_entry 1 s r).1 er).2 + have mEq : μ = stage.meetGraph := ((stage.initialChronologyGraph_entry 2 s μ).1 eμ).2 + have bEq : birth = stage.initialBirth := ((stage.initialChronologyGraph_entry 3 s birth).1 eb).2 + have hEq : height = stage.height := ((stage.initialChronologyGraph_entry 4 s height).1 eh).2 + subst s L r μ birth height + exact ⟨stage.meet, stage.initialBirth_function, + fun x _ t entry => Or.inl (((stage.initialBirth_entry x t).1 entry).2), + stage.initialBirth_old_meet, stage.height_code⟩ + +noncomputable def initialDecodedChronology + (small : M.groundEmbeddable stage.carrier ZFSet.omega) : + GroundChronologicalHistory M (insert (∅ : ZFSet.{u}) ∅) C D rD := + (stage.initialGroundChronologyFields pairing unions powers separation).toHistory + (stage.initialChronologyCore pairing unions powers separation) (by + intro cutoff hc _ _ _ + refine .countablePoints stage.carrier stage.carrier_ground small ?_ + intro x hx _ + have equal : (stage.initialGroundChronologyFields pairing unions powers separation).value + 0 cutoff = stage.carrier := + stage.initialGroundChronologyFields_value pairing unions powers separation 0 hc + exact equal ▸ hx) + +theorem initialDecodedChronology_values + (small : M.groundEmbeddable stage.carrier ZFSet.omega) {s : ZFSet.{u}} + (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) : + let history := stage.initialDecodedChronology pairing unions powers separation small + history.space s = stage.carrier ∧ history.order s = stage.order ∧ + history.meetGraph s = stage.meetGraph ∧ history.birth s = stage.initialBirth ∧ + history.height s = stage.height := + ⟨stage.initialGroundChronologyFields_value pairing unions powers separation 0 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 1 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 2 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 3 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 4 hs⟩ + +end GroundMainStage + +namespace GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {injection : ZFSet.{u}} (hInjection : injection ∈ M.sets) +variable (injected : InjectionCode stage.carrier ZFSet.omega injection) + +noncomputable def initialSerializedChronology : + GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) C D rD where + fields := stage.initialGroundChronologyFields pairing unions powers separation + ordinal := ordinalSetProperty_succ ordinalSetProperty_empty + core := stage.initialChronologyCore pairing unions powers separation + layerBound := {countableLayerWitness stage.carrier injection} + layer_bound_ground := by + have ground := M.countableLayerWitness_mem pairing stage.carrier_ground hInjection + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing ground ground + layers := constantFamilyGraph (chronologyPairs (insert (∅ : ZFSet.{u}) ∅)) + (countableLayerWitness stage.carrier injection) + layers_ground := M.constantFamilyGraph_mem pairing unions powers separation + (M.chronologyPairs_mem pairing unions powers separation + (stage.initialGroundChronologyFields pairing unions powers separation).time_ground) + (M.countableLayerWitness_mem pairing stage.carrier_ground hInjection) + layer_function := constantFamilyGraph_function _ _ + layer_code := by + intro s hs t _ _ z entry + have equal : z = countableLayerWitness stage.carrier injection := + ((pair_mem_constantFamilyGraph _ _ _ _).1 entry).2 + refine Or.inl ⟨stage.carrier, injection, equal, injected, ?_⟩ + intro x hx _ + have carrier : (stage.initialGroundChronologyFields pairing unions powers separation).value + 0 s = stage.carrier := + stage.initialGroundChronologyFields_value pairing unions powers separation 0 hs + exact carrier ▸ hx + +theorem initialSerializedChronology_layers : + (stage.initialSerializedChronology pairing unions powers separation hInjection injected).layers = + constantFamilyGraph (chronologyPairs (insert (∅ : ZFSet.{u}) ∅)) + (countableLayerWitness stage.carrier injection) := rfl + +theorem initialSerializedChronology_layerWitness {s t : ZFSet.{u}} + (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) + (ht : t ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) (earlier : t = s ∨ t ∈ s) : + (stage.initialSerializedChronology pairing unions powers separation hInjection injected).layerWitness s t = + countableLayerWitness stage.carrier injection := + ((pair_mem_constantFamilyGraph _ _ _ _).1 + ((stage.initialSerializedChronology pairing unions powers separation hInjection injected).layerWitness_entry + hs ht earlier)).2 + +theorem initialSerializedChronology_values {s : ZFSet.{u}} + (hs : s ∈ (insert (∅ : ZFSet.{u}) ∅ : ZFSet.{u})) : + let history := (stage.initialSerializedChronology pairing unions powers separation hInjection injected).toHistory + history.space s = stage.carrier ∧ history.order s = stage.order ∧ + history.meetGraph s = stage.meetGraph ∧ history.birth s = stage.initialBirth ∧ + history.height s = stage.height := + ⟨stage.initialGroundChronologyFields_value pairing unions powers separation 0 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 1 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 2 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 3 hs, + stage.initialGroundChronologyFields_value pairing unions powers separation 4 hs⟩ + +theorem initialSerializedChronology_code_ground : + (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code ∈ M.sets := + (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code_ground pairing + +include pairing unions powers separation in +theorem exists_initialSerializedChronology + (small : M.groundEmbeddable stage.carrier ZFSet.omega) : + ∃ serial : GroundSerializedChronology M (insert (∅ : ZFSet.{u}) ∅) C D rD, + serial.code ∈ M.sets ∧ serial.fields.graph = stage.initialChronologyGraph ∧ + serial.toHistory.space ∅ = stage.carrier ∧ + serial.toHistory.order ∅ = stage.order ∧ + serial.toHistory.meetGraph ∅ = stage.meetGraph ∧ + serial.toHistory.birth ∅ = stage.initialBirth ∧ + serial.toHistory.height ∅ = stage.height := by + obtain ⟨injection, hInjection, injected⟩ := small + exact ⟨stage.initialSerializedChronology pairing unions powers separation hInjection injected, + stage.initialSerializedChronology_code_ground pairing unions powers separation hInjection injected, + rfl, stage.initialSerializedChronology_values pairing unions powers separation hInjection injected + (ZFSet.mem_insert _ _)⟩ + +end GroundMainStage + +namespace GroundMainStage +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +variable (points : ZFSet.rank stage.carrier < o) (height : ZFSet.rank stage.height < o) +include limit points height + +theorem initialChronologyField_rank_lt : ∀ j, ZFSet.rank (stage.initialChronologyField j) < o := by + have pp := rank_product_lt limit points points + have order := (ZFSet.rank_mono stage.meet.order.relation).trans_lt pp + have meet := rank_functionGraph_lt limit stage.meet.operation pp points + have zero : ZFSet.rank (∅ : ZFSet.{u}) < o := by simpa only [ZFSet.rank_empty] using limit.pos + have birth := rank_constantFamilyGraph_lt limit points zero + exact Fin.cases points (Fin.cases order (Fin.cases meet (Fin.cases birth + (Fin.cases height (fun i => Fin.elim0 i))))) + +theorem initialChronologyBound_rank_lt : ZFSet.rank stage.initialChronologyBound < o := + rank_finiteRange_lt limit 5 _ (stage.initialChronologyField_rank_lt limit points height) + +theorem initialChronologyGraph_rank_lt : ∀ j, ZFSet.rank (stage.initialChronologyGraph j) < o := + fun j => rank_constantFamilyGraph_lt limit (rank_natSetCode_lt limit 1) + (stage.initialChronologyField_rank_lt limit points height j) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {injection : ZFSet.{u}} (hInjection : injection ∈ M.sets) +variable (injected : InjectionCode stage.carrier ZFSet.omega injection) + +theorem initialSerializedChronology_code_rank_lt (omega : ZFSet.rank (ZFSet.omega : ZFSet.{u}) < o) : + ZFSet.rank (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code < o := by + let serial := stage.initialSerializedChronology pairing unions powers separation hInjection injected + have time : ZFSet.rank (insert (∅ : ZFSet.{u}) ∅) < o := rank_natSetCode_lt limit 1 + have fieldsCode : ZFSet.rank serial.fields.code < o := + rank_nonemptyTupleCode_lt limit 6 _ (Fin.cases time + (Fin.cases (stage.initialChronologyBound_rank_lt limit points height) + (stage.initialChronologyGraph_rank_lt limit points height))) + have injectionRank := rank_functionGraph_lt limit injected.function points omega + have witness : ZFSet.rank (countableLayerWitness stage.carrier injection) < o := + rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases (rank_natSetCode_lt limit 0) (Fin.cases points (fun _ => injectionRank))) + have layerBound : ZFSet.rank serial.layerBound < o := rank_singleton_lt limit witness + have pairs := (ZFSet.rank_mono (chronologyPairs_subset (insert (∅ : ZFSet.{u}) ∅))).trans_lt + (rank_product_lt limit time time) + have layers : ZFSet.rank serial.layers < o := rank_constantFamilyGraph_lt limit pairs witness + exact rank_nonemptyTupleCode_lt limit 2 _ (Fin.cases fieldsCode (Fin.cases layerBound (fun _ => layers))) + +omit limit points height in +theorem initialSerializedChronology_code_rank_lt_inaccessible + (infinite : Realize M.sets infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (points : ZFSet.rank stage.carrier < ZFSet.rank K) + (height : ZFSet.rank stage.height < ZFSet.rank K) : + ZFSet.rank (stage.initialSerializedChronology pairing unions powers separation hInjection injected).code < + ZFSet.rank K := + stage.initialSerializedChronology_code_rank_lt + (conditions.rank_isLimit pairing unions powers separation infinite hK) points height + pairing unions powers separation hInjection injected (ZFSet.rank_lt_of_mem conditions.2.1) + +end GroundMainStage + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialPreservedMainPrefix.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialPreservedMainPrefix.lean index 818c8036f75c2a14a3ed5b05afaab9583f30d33a..4979cce4e443b1e6a1954c229805ce55d825feb7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialPreservedMainPrefix.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialPreservedMainPrefix.lean @@ -1,587 +1,587 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.MainPrefixValidityFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSmallFamilyRangeRanks -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainPrefixHistoryUnionRecognition - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace SetFormula - -def mainPrefixGraphBodyFormula {n} (K Labels C D rD N T S E J : Fin n) : SetFormula n := - .conj (BoundedFormula.ordinalFormula T).toFormula - (.conj (functionGraphOnFormula T S) - (.conj (functionGraphOnFormula J E) - (.conj (mainPrefixStagesFormula K Labels C D rD N S) - (.conj (mainPrefixTransitionsFormula K Labels C D rD N S E) - (.conj (mainPrefixIdentityFormula E) (mainPrefixCompositionFormula E)))))) - -def mainPrefixGraphFormula {n} (K Labels C D rD N T S E : Fin n) : SetFormula n := - ex (.conj (BoundedFormula.chronologyPairsEquationFormula 0 T.succ).toFormula - (mainPrefixGraphBodyFormula K.succ Labels.succ C.succ D.succ rD.succ N.succ - T.succ S.succ E.succ 0)) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem realize_mainPrefixGraphBodyFormula {n} (K Labels C D rD N T S E J : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) - (pairs : env J = chronologyPairs (env T)) : - Realize M.sets (mainPrefixGraphBodyFormula K Labels C D rD N T S E J) env ↔ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (env T) (env S) (env E) := by - change (Realize M.sets (BoundedFormula.ordinalFormula T).toFormula env ∧ - Realize M.sets (functionGraphOnFormula T S) env ∧ - Realize M.sets (functionGraphOnFormula J E) env ∧ - Realize M.sets (mainPrefixStagesFormula K Labels C D rD N S) env ∧ - Realize M.sets (mainPrefixTransitionsFormula K Labels C D rD N S E) env ∧ - Realize M.sets (mainPrefixIdentityFormula E) env ∧ - Realize M.sets (mainPrefixCompositionFormula E) env) ↔ _ - rw [BoundedFormula.realize_ordinalFormula M T env members, ← ordinalSetProperty_iff, - M.realize_functionGraphOnFormula unions T S env members, - M.realize_functionGraphOnFormula unions J E env members, - M.realize_mainPrefixStagesFormula pairing unions powers separation collection K Labels C D rD N S env members omega ordinal, - M.realize_mainPrefixTransitionsFormula pairing unions powers separation collection K Labels C D rD N S E env members omega ordinal, - M.realize_mainPrefixIdentityFormula E env members, - M.realize_mainPrefixCompositionFormula E env members, pairs] - constructor - · rintro ⟨ord, stages, transitions, valid, maps, self, comp⟩ - exact ⟨ord, stages, transitions, valid, maps, self, comp⟩ - · intro code - exact ⟨code.ordinal, code.stages, code.transitions, code.stage_valid, - code.transition_valid, code.identity, code.composition⟩ - -theorem realize_mainPrefixGraphFormula {n} (K Labels C D rD N T S E : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixGraphFormula K Labels C D rD N T S E) env ↔ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (env T) (env S) (env E) := by - rw [mainPrefixGraphFormula, realize_ex] - constructor - · rintro ⟨J, hJ, equation, body⟩ - have pairs := (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ - (extend J env) (Fin.cases hJ members)).1 equation - exact (M.realize_mainPrefixGraphBodyFormula pairing unions powers separation collection - K.succ Labels.succ C.succ D.succ rD.succ N.succ T.succ S.succ E.succ 0 - (extend J env) (Fin.cases hJ members) omega ordinal pairs).1 body - · intro code - have ground := M.chronologyPairs_mem pairing unions powers separation (members T) - refine ⟨chronologyPairs (env T), ground, ?_, ?_⟩ - · exact (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ - (extend (chronologyPairs (env T)) env) (Fin.cases ground members)).2 rfl - · exact (M.realize_mainPrefixGraphBodyFormula pairing unions powers separation collection - K.succ Labels.succ C.succ D.succ rD.succ N.succ T.succ S.succ E.succ 0 - (extend (chronologyPairs (env T)) env) (Fin.cases ground members) omega ordinal rfl).2 code - -end TransitiveGround - -namespace SetFormula -def mainPrefixFormula {n} (K Labels C D rD N z : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let field := prefixIndex n 3 - exBlock 3 (.conj (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula - (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 0) (field 1) (field 2))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixFormula K Labels C D rD N z) env ↔ - MainPrefixCode M (env K) (env Labels) (env C) (env D) (env rD) (env z) := by - rw [mainPrefixFormula, realize_exBlock] - let old := suffixIndex n 3 - let field := prefixIndex n 3 - have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula - (extendMany 3 f env) ∧ - Realize M.sets (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 0) (field 1) (field 2)) (extendMany 3 f env)) ↔ - env z = mainPrefixCode (f 0) (f 1) (f 2) ∧ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 0) (f 1) (f 2) := by - have mems := extendMany_members 3 f env ground members - have tuple := BoundedFormula.realize_mainPrefixTupleFormula M - (old z) (field 0) (field 1) (field 2) (extendMany 3 f env) mems - have code := M.realize_mainPrefixGraphFormula pairing unions powers separation collection - (old K) (old Labels) (old C) (old D) (old rD) (old N) (field 0) (field 1) (field 2) - (extendMany 3 f env) mems - (by simpa only [old, extendMany_suffix] using omega) - (by simpa only [old, extendMany_suffix] using ordinal) - rw [tuple, code] - simp only [old, field, extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, recognized⟩ - exact ⟨f 0, f 1, f 2, (actual f ground).1 recognized⟩ - · rintro ⟨T, S, E, encoded, code⟩ - have ground := M.mainPrefixCode_fields_mem (encoded ▸ members z) - let f : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) - have fieldsGround : ∀ j, f j ∈ M.sets := Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) - exact ⟨f, fieldsGround, (actual f fieldsGround).2 ⟨encoded, code⟩⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetFormula -universe u v - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem code_eq_mainPrefixCode : run.code = mainPrefixCode run.indices run.stageGraph run.transitionGraph := rfl - -theorem code_valid : MainPrefixCode M K Labels C D rD run.code := - ⟨run.indices, run.stageGraph, run.transitionGraph, rfl, run.graph_code⟩ - -end GroundMainPrefix - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def mainPrefixCandidates (B K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (MainPrefixCode M K Labels C D rD) B - -theorem mem_mainPrefixCandidates (B K Labels C D rD z : ZFSet.{u}) : - z ∈ M.mainPrefixCandidates B K Labels C D rD ↔ - z ∈ B ∧ MainPrefixCode M K Labels C D rD z := ZFSet.mem_sep - -theorem mainPrefixCandidates_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {B K Labels C D rD : ZFSet.{u}} (hB : B ∈ M.sets) (hK : K ∈ M.sets) - (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (ordinal : ordinalSetProperty K) : M.mainPrefixCandidates B K Labels C D rD ∈ M.sets := by - let params := extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))))) - have ground : ∀ j, params j ∈ M.sets := Fin.cases hK (Fin.cases hLabels (Fin.cases hC - (Fin.cases hD (Fin.cases hrD (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))))) - have selected := M.separation_mem separation (mainPrefixFormula 1 2 3 4 5 6 0) params ground hB - have equal : ZFSet.sep (fun z => Realize M.sets (mainPrefixFormula 1 2 3 4 5 6 0) - (extend z params)) B = M.mainPrefixCandidates B K Labels C D rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_mainPrefixCandidates] - apply and_congr_right - intro hz - exact M.realize_mainPrefixFormula pairing unions powers separation collection 1 2 3 4 5 6 0 - (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl ordinal - exact equal ▸ selected - -end TransitiveGround - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) - -noncomputable def validMainPrefixes (Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - M.mainPrefixCandidates level.carrier K Labels C D rD - -theorem validMainPrefixes_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) {Labels C D rD : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - level.validMainPrefixes Labels C D rD ∈ M.sets := - M.mainPrefixCandidates_mem pairing unions powers separation collection infinite - level.carrier_ground hK hLabels hC hD hrD ordinal - -theorem mem_validMainPrefixes {Labels C D rD z : ZFSet.{u}} : - z ∈ level.validMainPrefixes Labels C D rD ↔ - z ∈ level.carrier ∧ MainPrefixCode M K Labels C D rD z := - M.mem_mainPrefixCandidates level.carrier K Labels C D rD z - -theorem prefix_mem_validMainPrefixes - {pairing : Realize M.sets SetFormula.pairing Fin.elim0} - {unions : Realize M.sets SetFormula.union Fin.elim0} - {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} - {Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (rank : ZFSet.rank run.code < ZFSet.rank K) : run.code ∈ level.validMainPrefixes Labels C D rD := - level.mem_validMainPrefixes.2 ⟨(level.membership _).2 ⟨run.code_ground, rank⟩, run.code_valid⟩ - -theorem finite_prefix_mem_validMainPrefixes - {pairing : Realize M.sets SetFormula.pairing Fin.elim0} - {unions : Realize M.sets SetFormula.union Fin.elim0} - {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} - (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) - {Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] [Finite I] - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (keys : ∀ i, ZFSet.rank (run.key i) < ZFSet.rank K) : - run.code ∈ level.validMainPrefixes Labels C D rD := - level.prefix_mem_validMainPrefixes run (run.finite_code_rank_lt infinite hK conditions keys) - -end GroundMainCandidateLevel -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_initialMainPrefixCandidate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, - ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), - level.validMainPrefixes C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ - run.code ∈ level.validMainPrefixes C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - run.indices = natSetCode 2 ∧ run.code ∈ M.sets ∧ ZFSet.rank run.code < ZFSet.rank K ∧ - (run.linked 0).main = seed.source ∧ (run.linked 1).main = certificate.target ∧ - (run.linked 0).serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - (run.linked 1).serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ - (∀ z, ZFSet.pair (ZFSet.pair (natSetCode 1) (natSetCode 0)) z ∈ run.transitionGraph ↔ - z = certificate.transition.map.code) ∧ - (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.points = - certificate.transition.map.points ∧ - (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.actors = - certificate.transition.map.actors := by - dsimp only - obtain ⟨level, seed, certificate, first, second, run, firstMain, secondMain, - firstMember, secondMember, indices, ground, rank, firstLinked, secondLinked, - stageZero, stageOne, _entryZero, _entryOne, entryTransition, points, actors⟩ := - M.exists_groundInitialTwoStageMainPrefix pairing unions powers separation - collection infinite choice hK standard - have conditions := standard.to_conditions pairing unions powers separation hK - refine ⟨level, seed, certificate, run, - level.validMainPrefixes_ground pairing unions powers separation collection infinite hK - conditions.1 seed.source.stage.columns_ground seed.source.stage.columns_ground - seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, - level.prefix_mem_validMainPrefixes run rank, indices, ground, rank, - ?_, ?_, ?_, ?_, stageZero, stageOne, entryTransition, points, actors⟩ - · exact firstLinked ▸ firstMain - · exact secondLinked ▸ secondMain - · exact firstLinked ▸ firstMember - · exact secondLinked ▸ secondMember - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD z : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -theorem MainPrefixCode.exists_decodedPrefix - (valid : MainPrefixCode M K Labels C D rD z) (ground : z ∈ M.sets) : - ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, - letI := ordinalMainIndexPreorder ordinal - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), - run.indices = T ∧ run.code = z := by - obtain ⟨T, S, E, equal, raw⟩ := valid - obtain ⟨hT, hS, hE⟩ := M.mainPrefixCode_fields_mem (equal ▸ ground) - refine ⟨T, hT, raw.ordinal, raw.decodedPrefix pairing unions powers separation hT hS hE, - raw.decodedPrefix_indices pairing unions powers separation hT hS hE, ?_⟩ - exact (raw.decodedPrefix_code pairing unions powers separation hT hS hE).trans equal.symm - -theorem GroundMainCandidateLevel.exists_prefix_of_mem - (level : GroundMainCandidateLevel M K) - (member : z ∈ level.validMainPrefixes Labels C D rD) : - ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, - letI := ordinalMainIndexPreorder ordinal - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), - run.indices = T ∧ run.code = z ∧ ZFSet.rank run.code < ZFSet.rank K := by - obtain ⟨carrier, valid⟩ := level.mem_validMainPrefixes.1 member - obtain ⟨ground, rank⟩ := (level.membership z).1 carrier - obtain ⟨T, hT, ordinal, run, indices, code⟩ := - valid.exists_decodedPrefix pairing unions powers separation ground - exact ⟨T, hT, ordinal, run, indices, code, code.symm ▸ rank⟩ - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_rankedAppendTaskBearing (last : I) (greatest : ∀ i, i ≤ last) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) (limit : Order.IsSuccLimit (ZFSet.rank K)) - (level : GroundMainCandidateLevel M K) {targetCode z : ZFSet.{u}} - (targetRank : ZFSet.rank targetCode < ZFSet.rank K) - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked last).code targetCode z) : - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ step : GroundChronologicalMainTransition (run.diagram.stage last) target.main, - ∃ covered : step.CoversOldBirths, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - extended = run.appendLast last greatest target step covered ∧ - target.code = targetCode ∧ step.map.code = z ∧ step.PreservesOldProfiles ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices targetCode) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = z ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.points = step.map.points ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.actors = step.map.actors ∧ - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked last).code (extended.linked ⊤).code - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code := by - obtain ⟨target, targetEqual, transition, mapEqual, coverage, profiles⟩ := - code.exists_from_linked pairing unions powers separation - let step : GroundChronologicalMainTransition (run.diagram.stage last) target.main := - transition.retargetEq (run.linked_main last) rfl - have covered : step.CoversOldBirths := - (transition.retargetEq_coversOldBirths_iff (run.linked_main last) rfl).2 coverage - have stepCode : step.map.code = z := - (transition.retargetEq_code (run.linked_main last) rfl).trans mapEqual - have stepProfiles : step.PreservesOldProfiles := - (transition.retargetEq_preservesOldProfiles_iff (run.linked_main last) rfl).2 profiles - let extended := run.appendLast last greatest target step covered - have rank : ZFSet.rank extended.code < ZFSet.rank K := - run.appendLast_code_rank_lt last greatest target step covered limit oldRank - (targetEqual.symm ▸ targetRank) - have lastStep := run.appendLast_transition_last last greatest target step covered - have lastCode : - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = z := by - rw [lastStep] - exact stepCode - refine ⟨target, step, covered, extended, rfl, targetEqual, stepCode, stepProfiles, - extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, - run.appendLast_indices last greatest target step covered, - run.appendLast_linked_old last greatest target step covered, - run.appendLast_linked_top last greatest target step covered, ?_, - run.appendLast_stageGraph_restrict last greatest target step covered, - run.appendLast_transitionGraph_restrict last greatest target step covered, - (fun _ _ _ => rfl), lastCode, ?_, ?_, ?_⟩ - · rw [run.appendLast_stageGraph last greatest target step covered, targetEqual] - · rw [lastStep] - · rw [lastStep] - · rw [run.appendLast_linked_top last greatest target step covered, targetEqual, lastCode] - exact code - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing.MainPrefixGraphFamily -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {I : Type v} [Small.{u} I] -variable (family : MainPrefixGraphFamily M K Labels C D rD I) - -theorem fieldUnions_rank_le_codeRange : - ZFSet.rank family.indexUnion ≤ ZFSet.rank (ZFSet.range family.code) ∧ - ZFSet.rank family.stageUnion ≤ ZFSet.rank (ZFSet.range family.code) ∧ - ZFSet.rank family.transitionUnion ≤ ZFSet.rank (ZFSet.range family.code) := by - let entries (i : I) : Fin 3 → ZFSet.{u} := - Fin.cases (family.indices i) (Fin.cases (family.stages i) (fun _ => family.transitions i)) - have fields (i : I) (j : Fin 3) : - ZFSet.rank (entries i j) ≤ ZFSet.rank (family.code i) := by - simpa only [code, mainPrefixCode, entries] using rank_nonemptyTupleCode_field_le 2 - (Fin.cases (family.indices i) (Fin.cases (family.stages i) (fun _ => family.transitions i))) j - have bound (value : I → ZFSet.{u}) (ranks : ∀ i, ZFSet.rank (value i) ≤ ZFSet.rank (family.code i)) : - ZFSet.rank (⋃₀ ZFSet.range value) ≤ ZFSet.rank (ZFSet.range family.code) := by - apply ZFSet.rank_le_iff.2 - intro x hx - obtain ⟨i, hi⟩ := (familyCodeGraph_valueUnion_mem_iff value x).1 hx - exact ((ZFSet.rank_lt_of_mem hi).trans_le (ranks i)).trans - (ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨i, rfl⟩)) - refine ⟨bound family.indices ?_, bound family.stages ?_, bound family.transitions ?_⟩ - · intro i - simpa only [entries, Fin.cases_zero] using fields i 0 - · intro i - exact fields i 1 - · intro i - exact fields i 2 - -theorem unionCode_rank_lt_of_codeRange {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank (ZFSet.range family.code) < o) : ZFSet.rank family.unionCode < o := by - have fields := family.fieldUnions_rank_le_codeRange - exact rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases (fields.1.trans_lt rank) - (Fin.cases (fields.2.1.trans_lt rank) (fun _ => fields.2.2.trans_lt rank))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) -variable (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) -variable (limit : Order.IsSuccLimit (ZFSet.rank K)) -variable (key : I → ZFSet.{u}) (injective : Function.Injective key) -variable (domain : ZFSet.range key ∈ M.sets) -variable (whole : familyCodeGraph key family.code ∈ M.sets) -variable (small : GroundBelow M (ZFSet.range key) K) -variable (ranks : ∀ i, ZFSet.rank (family.code i) < ZFSet.rank K) -include pairing unions powers separation collection hK ordinal regular limit injective domain whole small ranks - -theorem unionCode_rank_lt_small : ZFSet.rank family.unionCode < ZFSet.rank K := - family.unionCode_rank_lt_of_codeRange limit - (regular.familyCodeGraph_valueRange_rank_lt pairing unions powers separation collection hK ordinal - key family.code injective domain whole small ranks) - -theorem unionCode_mem_validMainPrefixes (level : GroundMainCandidateLevel M K) : - family.unionCode ∈ level.validMainPrefixes Labels C D rD := - level.mem_validMainPrefixes.2 ⟨(level.membership _).2 - ⟨family.unionCode_ground pairing unions powers separation key injective domain whole, - family.unionCode_rank_lt_small pairing unions powers separation collection hK ordinal regular limit - key injective domain whole small ranks⟩, family.unionCode_valid⟩ - -end PartitionPilot.Forcing.MainPrefixGraphFamily - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def preservedMainPrefixFormula {n} (K Labels C D rD N z : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let field := prefixIndex n 3 - exBlock 3 (.conj (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula - (.conj (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 0) (field 1) (field 2)) - (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 1) (field 2)))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_preservedMainPrefixFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (preservedMainPrefixFormula K Labels C D rD N z) env ↔ - PreservedMainPrefixCode M (env K) (env Labels) (env C) (env D) (env rD) (env z) := by - rw [preservedMainPrefixFormula, realize_exBlock] - let old := suffixIndex n 3 - let field := prefixIndex n 3 - have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula - (extendMany 3 f env) ∧ - Realize M.sets (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 0) (field 1) (field 2)) (extendMany 3 f env) ∧ - Realize M.sets (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) - (old rD) (old N) (field 1) (field 2)) (extendMany 3 f env)) ↔ - env z = mainPrefixCode (f 0) (f 1) (f 2) ∧ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 0) (f 1) (f 2) ∧ - MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 1) (f 2) := by - have mems := extendMany_members 3 f env ground members - have tuple := BoundedFormula.realize_mainPrefixTupleFormula M - (old z) (field 0) (field 1) (field 2) (extendMany 3 f env) mems - have code := M.realize_mainPrefixGraphFormula pairing unions powers separation collection - (old K) (old Labels) (old C) (old D) (old rD) (old N) (field 0) (field 1) (field 2) - (extendMany 3 f env) mems - (by simpa only [old, extendMany_suffix] using omega) - (by simpa only [old, extendMany_suffix] using ordinal) - have profiles := M.realize_mainPrefixProfileGraphFormula pairing unions powers separation collection - (old K) (old Labels) (old C) (old D) (old rD) (old N) (field 1) (field 2) - (extendMany 3 f env) mems - (by simpa only [old, extendMany_suffix] using omega) - (by simpa only [old, extendMany_suffix] using ordinal) - rw [tuple, code, profiles] - simp only [old, field, extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, recognized⟩ - exact ⟨f 0, f 1, f 2, (actual f ground).1 recognized⟩ - · rintro ⟨T, S, E, encoded, code, preserved⟩ - have ground := M.mainPrefixCode_fields_mem (encoded ▸ members z) - let f : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) - have fieldsGround : ∀ j, f j ∈ M.sets := Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) - exact ⟨f, fieldsGround, (actual f fieldsGround).2 ⟨encoded, code, preserved⟩⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialPreservedMainPrefix - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, - ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), - PreservedMainPrefixCode M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) run.code ∧ - run.PreservesOldProfiles ∧ - run.code ∈ level.validMainPrefixes C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - run.indices = natSetCode 2 ∧ run.code ∈ M.sets ∧ ZFSet.rank run.code < ZFSet.rank K ∧ - run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ - (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.code = - certificate.transition.map.code := by - dsimp only - obtain ⟨level, seed, certificate, run, _, member, indices, ground, rank, - _, _, _, _, first, second, _entry, points, actors⟩ := - M.exists_initialMainPrefixCandidate pairing unions powers separation collection infinite choice hK standard - have crossing : (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).PreservesOldProfiles := by - unfold GroundChronologicalMainTransition.PreservesOldProfiles - rw [points, first, second] - exact certificate.oldProfilePreservation pairing unions powers separation infinite - (M.groundPower seed.source.stage.carrier) - have preserved := run.preservesOldProfiles_of_zero_one crossing - have exactMap : (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.code = - certificate.transition.map.code := congrArg₂ ZFSet.pair points actors - exact ⟨level, seed, certificate, run, run.preserved_code preserved, preserved, member, - indices, ground, rank, first, second, exactMap⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.MainPrefixValidityFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSmallFamilyRangeRanks +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainPrefixHistoryUnionRecognition + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace SetFormula + +def mainPrefixGraphBodyFormula {n} (K Labels C D rD N T S E J : Fin n) : SetFormula n := + .conj (BoundedFormula.ordinalFormula T).toFormula + (.conj (functionGraphOnFormula T S) + (.conj (functionGraphOnFormula J E) + (.conj (mainPrefixStagesFormula K Labels C D rD N S) + (.conj (mainPrefixTransitionsFormula K Labels C D rD N S E) + (.conj (mainPrefixIdentityFormula E) (mainPrefixCompositionFormula E)))))) + +def mainPrefixGraphFormula {n} (K Labels C D rD N T S E : Fin n) : SetFormula n := + ex (.conj (BoundedFormula.chronologyPairsEquationFormula 0 T.succ).toFormula + (mainPrefixGraphBodyFormula K.succ Labels.succ C.succ D.succ rD.succ N.succ + T.succ S.succ E.succ 0)) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem realize_mainPrefixGraphBodyFormula {n} (K Labels C D rD N T S E J : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) + (pairs : env J = chronologyPairs (env T)) : + Realize M.sets (mainPrefixGraphBodyFormula K Labels C D rD N T S E J) env ↔ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (env T) (env S) (env E) := by + change (Realize M.sets (BoundedFormula.ordinalFormula T).toFormula env ∧ + Realize M.sets (functionGraphOnFormula T S) env ∧ + Realize M.sets (functionGraphOnFormula J E) env ∧ + Realize M.sets (mainPrefixStagesFormula K Labels C D rD N S) env ∧ + Realize M.sets (mainPrefixTransitionsFormula K Labels C D rD N S E) env ∧ + Realize M.sets (mainPrefixIdentityFormula E) env ∧ + Realize M.sets (mainPrefixCompositionFormula E) env) ↔ _ + rw [BoundedFormula.realize_ordinalFormula M T env members, ← ordinalSetProperty_iff, + M.realize_functionGraphOnFormula unions T S env members, + M.realize_functionGraphOnFormula unions J E env members, + M.realize_mainPrefixStagesFormula pairing unions powers separation collection K Labels C D rD N S env members omega ordinal, + M.realize_mainPrefixTransitionsFormula pairing unions powers separation collection K Labels C D rD N S E env members omega ordinal, + M.realize_mainPrefixIdentityFormula E env members, + M.realize_mainPrefixCompositionFormula E env members, pairs] + constructor + · rintro ⟨ord, stages, transitions, valid, maps, self, comp⟩ + exact ⟨ord, stages, transitions, valid, maps, self, comp⟩ + · intro code + exact ⟨code.ordinal, code.stages, code.transitions, code.stage_valid, + code.transition_valid, code.identity, code.composition⟩ + +theorem realize_mainPrefixGraphFormula {n} (K Labels C D rD N T S E : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixGraphFormula K Labels C D rD N T S E) env ↔ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (env T) (env S) (env E) := by + rw [mainPrefixGraphFormula, realize_ex] + constructor + · rintro ⟨J, hJ, equation, body⟩ + have pairs := (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ + (extend J env) (Fin.cases hJ members)).1 equation + exact (M.realize_mainPrefixGraphBodyFormula pairing unions powers separation collection + K.succ Labels.succ C.succ D.succ rD.succ N.succ T.succ S.succ E.succ 0 + (extend J env) (Fin.cases hJ members) omega ordinal pairs).1 body + · intro code + have ground := M.chronologyPairs_mem pairing unions powers separation (members T) + refine ⟨chronologyPairs (env T), ground, ?_, ?_⟩ + · exact (BoundedFormula.realize_chronologyPairsEquationFormula M 0 T.succ + (extend (chronologyPairs (env T)) env) (Fin.cases ground members)).2 rfl + · exact (M.realize_mainPrefixGraphBodyFormula pairing unions powers separation collection + K.succ Labels.succ C.succ D.succ rD.succ N.succ T.succ S.succ E.succ 0 + (extend (chronologyPairs (env T)) env) (Fin.cases ground members) omega ordinal rfl).2 code + +end TransitiveGround + +namespace SetFormula +def mainPrefixFormula {n} (K Labels C D rD N z : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let field := prefixIndex n 3 + exBlock 3 (.conj (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula + (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 0) (field 1) (field 2))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixFormula K Labels C D rD N z) env ↔ + MainPrefixCode M (env K) (env Labels) (env C) (env D) (env rD) (env z) := by + rw [mainPrefixFormula, realize_exBlock] + let old := suffixIndex n 3 + let field := prefixIndex n 3 + have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula + (extendMany 3 f env) ∧ + Realize M.sets (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 0) (field 1) (field 2)) (extendMany 3 f env)) ↔ + env z = mainPrefixCode (f 0) (f 1) (f 2) ∧ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 0) (f 1) (f 2) := by + have mems := extendMany_members 3 f env ground members + have tuple := BoundedFormula.realize_mainPrefixTupleFormula M + (old z) (field 0) (field 1) (field 2) (extendMany 3 f env) mems + have code := M.realize_mainPrefixGraphFormula pairing unions powers separation collection + (old K) (old Labels) (old C) (old D) (old rD) (old N) (field 0) (field 1) (field 2) + (extendMany 3 f env) mems + (by simpa only [old, extendMany_suffix] using omega) + (by simpa only [old, extendMany_suffix] using ordinal) + rw [tuple, code] + simp only [old, field, extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, recognized⟩ + exact ⟨f 0, f 1, f 2, (actual f ground).1 recognized⟩ + · rintro ⟨T, S, E, encoded, code⟩ + have ground := M.mainPrefixCode_fields_mem (encoded ▸ members z) + let f : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) + have fieldsGround : ∀ j, f j ∈ M.sets := Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) + exact ⟨f, fieldsGround, (actual f fieldsGround).2 ⟨encoded, code⟩⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetFormula +universe u v + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem code_eq_mainPrefixCode : run.code = mainPrefixCode run.indices run.stageGraph run.transitionGraph := rfl + +theorem code_valid : MainPrefixCode M K Labels C D rD run.code := + ⟨run.indices, run.stageGraph, run.transitionGraph, rfl, run.graph_code⟩ + +end GroundMainPrefix + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def mainPrefixCandidates (B K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (MainPrefixCode M K Labels C D rD) B + +theorem mem_mainPrefixCandidates (B K Labels C D rD z : ZFSet.{u}) : + z ∈ M.mainPrefixCandidates B K Labels C D rD ↔ + z ∈ B ∧ MainPrefixCode M K Labels C D rD z := ZFSet.mem_sep + +theorem mainPrefixCandidates_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {B K Labels C D rD : ZFSet.{u}} (hB : B ∈ M.sets) (hK : K ∈ M.sets) + (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (ordinal : ordinalSetProperty K) : M.mainPrefixCandidates B K Labels C D rD ∈ M.sets := by + let params := extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))))) + have ground : ∀ j, params j ∈ M.sets := Fin.cases hK (Fin.cases hLabels (Fin.cases hC + (Fin.cases hD (Fin.cases hrD (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))))) + have selected := M.separation_mem separation (mainPrefixFormula 1 2 3 4 5 6 0) params ground hB + have equal : ZFSet.sep (fun z => Realize M.sets (mainPrefixFormula 1 2 3 4 5 6 0) + (extend z params)) B = M.mainPrefixCandidates B K Labels C D rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_mainPrefixCandidates] + apply and_congr_right + intro hz + exact M.realize_mainPrefixFormula pairing unions powers separation collection 1 2 3 4 5 6 0 + (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl ordinal + exact equal ▸ selected + +end TransitiveGround + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) + +noncomputable def validMainPrefixes (Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + M.mainPrefixCandidates level.carrier K Labels C D rD + +theorem validMainPrefixes_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) {Labels C D rD : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + level.validMainPrefixes Labels C D rD ∈ M.sets := + M.mainPrefixCandidates_mem pairing unions powers separation collection infinite + level.carrier_ground hK hLabels hC hD hrD ordinal + +theorem mem_validMainPrefixes {Labels C D rD z : ZFSet.{u}} : + z ∈ level.validMainPrefixes Labels C D rD ↔ + z ∈ level.carrier ∧ MainPrefixCode M K Labels C D rD z := + M.mem_mainPrefixCandidates level.carrier K Labels C D rD z + +theorem prefix_mem_validMainPrefixes + {pairing : Realize M.sets SetFormula.pairing Fin.elim0} + {unions : Realize M.sets SetFormula.union Fin.elim0} + {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} + {Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (rank : ZFSet.rank run.code < ZFSet.rank K) : run.code ∈ level.validMainPrefixes Labels C D rD := + level.mem_validMainPrefixes.2 ⟨(level.membership _).2 ⟨run.code_ground, rank⟩, run.code_valid⟩ + +theorem finite_prefix_mem_validMainPrefixes + {pairing : Realize M.sets SetFormula.pairing Fin.elim0} + {unions : Realize M.sets SetFormula.union Fin.elim0} + {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} + (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) + {Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] [Finite I] + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (keys : ∀ i, ZFSet.rank (run.key i) < ZFSet.rank K) : + run.code ∈ level.validMainPrefixes Labels C D rD := + level.prefix_mem_validMainPrefixes run (run.finite_code_rank_lt infinite hK conditions keys) + +end GroundMainCandidateLevel +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_initialMainPrefixCandidate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, + ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), + level.validMainPrefixes C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ + run.code ∈ level.validMainPrefixes C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + run.indices = natSetCode 2 ∧ run.code ∈ M.sets ∧ ZFSet.rank run.code < ZFSet.rank K ∧ + (run.linked 0).main = seed.source ∧ (run.linked 1).main = certificate.target ∧ + (run.linked 0).serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + (run.linked 1).serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ + (∀ z, ZFSet.pair (ZFSet.pair (natSetCode 1) (natSetCode 0)) z ∈ run.transitionGraph ↔ + z = certificate.transition.map.code) ∧ + (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.points = + certificate.transition.map.points ∧ + (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.actors = + certificate.transition.map.actors := by + dsimp only + obtain ⟨level, seed, certificate, first, second, run, firstMain, secondMain, + firstMember, secondMember, indices, ground, rank, firstLinked, secondLinked, + stageZero, stageOne, _entryZero, _entryOne, entryTransition, points, actors⟩ := + M.exists_groundInitialTwoStageMainPrefix pairing unions powers separation + collection infinite choice hK standard + have conditions := standard.to_conditions pairing unions powers separation hK + refine ⟨level, seed, certificate, run, + level.validMainPrefixes_ground pairing unions powers separation collection infinite hK + conditions.1 seed.source.stage.columns_ground seed.source.stage.columns_ground + seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, + level.prefix_mem_validMainPrefixes run rank, indices, ground, rank, + ?_, ?_, ?_, ?_, stageZero, stageOne, entryTransition, points, actors⟩ + · exact firstLinked ▸ firstMain + · exact secondLinked ▸ secondMain + · exact firstLinked ▸ firstMember + · exact secondLinked ▸ secondMember + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD z : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +theorem MainPrefixCode.exists_decodedPrefix + (valid : MainPrefixCode M K Labels C D rD z) (ground : z ∈ M.sets) : + ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, + letI := ordinalMainIndexPreorder ordinal + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), + run.indices = T ∧ run.code = z := by + obtain ⟨T, S, E, equal, raw⟩ := valid + obtain ⟨hT, hS, hE⟩ := M.mainPrefixCode_fields_mem (equal ▸ ground) + refine ⟨T, hT, raw.ordinal, raw.decodedPrefix pairing unions powers separation hT hS hE, + raw.decodedPrefix_indices pairing unions powers separation hT hS hE, ?_⟩ + exact (raw.decodedPrefix_code pairing unions powers separation hT hS hE).trans equal.symm + +theorem GroundMainCandidateLevel.exists_prefix_of_mem + (level : GroundMainCandidateLevel M K) + (member : z ∈ level.validMainPrefixes Labels C D rD) : + ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, + letI := ordinalMainIndexPreorder ordinal + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), + run.indices = T ∧ run.code = z ∧ ZFSet.rank run.code < ZFSet.rank K := by + obtain ⟨carrier, valid⟩ := level.mem_validMainPrefixes.1 member + obtain ⟨ground, rank⟩ := (level.membership z).1 carrier + obtain ⟨T, hT, ordinal, run, indices, code⟩ := + valid.exists_decodedPrefix pairing unions powers separation ground + exact ⟨T, hT, ordinal, run, indices, code, code.symm ▸ rank⟩ + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_rankedAppendTaskBearing (last : I) (greatest : ∀ i, i ≤ last) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) (limit : Order.IsSuccLimit (ZFSet.rank K)) + (level : GroundMainCandidateLevel M K) {targetCode z : ZFSet.{u}} + (targetRank : ZFSet.rank targetCode < ZFSet.rank K) + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked last).code targetCode z) : + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ step : GroundChronologicalMainTransition (run.diagram.stage last) target.main, + ∃ covered : step.CoversOldBirths, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + extended = run.appendLast last greatest target step covered ∧ + target.code = targetCode ∧ step.map.code = z ∧ step.PreservesOldProfiles ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices targetCode) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = z ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.points = step.map.points ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.actors = step.map.actors ∧ + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked last).code (extended.linked ⊤).code + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code := by + obtain ⟨target, targetEqual, transition, mapEqual, coverage, profiles⟩ := + code.exists_from_linked pairing unions powers separation + let step : GroundChronologicalMainTransition (run.diagram.stage last) target.main := + transition.retargetEq (run.linked_main last) rfl + have covered : step.CoversOldBirths := + (transition.retargetEq_coversOldBirths_iff (run.linked_main last) rfl).2 coverage + have stepCode : step.map.code = z := + (transition.retargetEq_code (run.linked_main last) rfl).trans mapEqual + have stepProfiles : step.PreservesOldProfiles := + (transition.retargetEq_preservesOldProfiles_iff (run.linked_main last) rfl).2 profiles + let extended := run.appendLast last greatest target step covered + have rank : ZFSet.rank extended.code < ZFSet.rank K := + run.appendLast_code_rank_lt last greatest target step covered limit oldRank + (targetEqual.symm ▸ targetRank) + have lastStep := run.appendLast_transition_last last greatest target step covered + have lastCode : + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = z := by + rw [lastStep] + exact stepCode + refine ⟨target, step, covered, extended, rfl, targetEqual, stepCode, stepProfiles, + extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, + run.appendLast_indices last greatest target step covered, + run.appendLast_linked_old last greatest target step covered, + run.appendLast_linked_top last greatest target step covered, ?_, + run.appendLast_stageGraph_restrict last greatest target step covered, + run.appendLast_transitionGraph_restrict last greatest target step covered, + (fun _ _ _ => rfl), lastCode, ?_, ?_, ?_⟩ + · rw [run.appendLast_stageGraph last greatest target step covered, targetEqual] + · rw [lastStep] + · rw [lastStep] + · rw [run.appendLast_linked_top last greatest target step covered, targetEqual, lastCode] + exact code + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing.MainPrefixGraphFamily +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {I : Type v} [Small.{u} I] +variable (family : MainPrefixGraphFamily M K Labels C D rD I) + +theorem fieldUnions_rank_le_codeRange : + ZFSet.rank family.indexUnion ≤ ZFSet.rank (ZFSet.range family.code) ∧ + ZFSet.rank family.stageUnion ≤ ZFSet.rank (ZFSet.range family.code) ∧ + ZFSet.rank family.transitionUnion ≤ ZFSet.rank (ZFSet.range family.code) := by + let entries (i : I) : Fin 3 → ZFSet.{u} := + Fin.cases (family.indices i) (Fin.cases (family.stages i) (fun _ => family.transitions i)) + have fields (i : I) (j : Fin 3) : + ZFSet.rank (entries i j) ≤ ZFSet.rank (family.code i) := by + simpa only [code, mainPrefixCode, entries] using rank_nonemptyTupleCode_field_le 2 + (Fin.cases (family.indices i) (Fin.cases (family.stages i) (fun _ => family.transitions i))) j + have bound (value : I → ZFSet.{u}) (ranks : ∀ i, ZFSet.rank (value i) ≤ ZFSet.rank (family.code i)) : + ZFSet.rank (⋃₀ ZFSet.range value) ≤ ZFSet.rank (ZFSet.range family.code) := by + apply ZFSet.rank_le_iff.2 + intro x hx + obtain ⟨i, hi⟩ := (familyCodeGraph_valueUnion_mem_iff value x).1 hx + exact ((ZFSet.rank_lt_of_mem hi).trans_le (ranks i)).trans + (ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨i, rfl⟩)) + refine ⟨bound family.indices ?_, bound family.stages ?_, bound family.transitions ?_⟩ + · intro i + simpa only [entries, Fin.cases_zero] using fields i 0 + · intro i + exact fields i 1 + · intro i + exact fields i 2 + +theorem unionCode_rank_lt_of_codeRange {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank (ZFSet.range family.code) < o) : ZFSet.rank family.unionCode < o := by + have fields := family.fieldUnions_rank_le_codeRange + exact rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases (fields.1.trans_lt rank) + (Fin.cases (fields.2.1.trans_lt rank) (fun _ => fields.2.2.trans_lt rank))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) +variable (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) +variable (limit : Order.IsSuccLimit (ZFSet.rank K)) +variable (key : I → ZFSet.{u}) (injective : Function.Injective key) +variable (domain : ZFSet.range key ∈ M.sets) +variable (whole : familyCodeGraph key family.code ∈ M.sets) +variable (small : GroundBelow M (ZFSet.range key) K) +variable (ranks : ∀ i, ZFSet.rank (family.code i) < ZFSet.rank K) +include pairing unions powers separation collection hK ordinal regular limit injective domain whole small ranks + +theorem unionCode_rank_lt_small : ZFSet.rank family.unionCode < ZFSet.rank K := + family.unionCode_rank_lt_of_codeRange limit + (regular.familyCodeGraph_valueRange_rank_lt pairing unions powers separation collection hK ordinal + key family.code injective domain whole small ranks) + +theorem unionCode_mem_validMainPrefixes (level : GroundMainCandidateLevel M K) : + family.unionCode ∈ level.validMainPrefixes Labels C D rD := + level.mem_validMainPrefixes.2 ⟨(level.membership _).2 + ⟨family.unionCode_ground pairing unions powers separation key injective domain whole, + family.unionCode_rank_lt_small pairing unions powers separation collection hK ordinal regular limit + key injective domain whole small ranks⟩, family.unionCode_valid⟩ + +end PartitionPilot.Forcing.MainPrefixGraphFamily + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def preservedMainPrefixFormula {n} (K Labels C D rD N z : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let field := prefixIndex n 3 + exBlock 3 (.conj (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula + (.conj (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 0) (field 1) (field 2)) + (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 1) (field 2)))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_preservedMainPrefixFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (preservedMainPrefixFormula K Labels C D rD N z) env ↔ + PreservedMainPrefixCode M (env K) (env Labels) (env C) (env D) (env rD) (env z) := by + rw [preservedMainPrefixFormula, realize_exBlock] + let old := suffixIndex n 3 + let field := prefixIndex n 3 + have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)).toFormula + (extendMany 3 f env) ∧ + Realize M.sets (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 0) (field 1) (field 2)) (extendMany 3 f env) ∧ + Realize M.sets (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) + (old rD) (old N) (field 1) (field 2)) (extendMany 3 f env)) ↔ + env z = mainPrefixCode (f 0) (f 1) (f 2) ∧ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 0) (f 1) (f 2) ∧ + MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 1) (f 2) := by + have mems := extendMany_members 3 f env ground members + have tuple := BoundedFormula.realize_mainPrefixTupleFormula M + (old z) (field 0) (field 1) (field 2) (extendMany 3 f env) mems + have code := M.realize_mainPrefixGraphFormula pairing unions powers separation collection + (old K) (old Labels) (old C) (old D) (old rD) (old N) (field 0) (field 1) (field 2) + (extendMany 3 f env) mems + (by simpa only [old, extendMany_suffix] using omega) + (by simpa only [old, extendMany_suffix] using ordinal) + have profiles := M.realize_mainPrefixProfileGraphFormula pairing unions powers separation collection + (old K) (old Labels) (old C) (old D) (old rD) (old N) (field 1) (field 2) + (extendMany 3 f env) mems + (by simpa only [old, extendMany_suffix] using omega) + (by simpa only [old, extendMany_suffix] using ordinal) + rw [tuple, code, profiles] + simp only [old, field, extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, recognized⟩ + exact ⟨f 0, f 1, f 2, (actual f ground).1 recognized⟩ + · rintro ⟨T, S, E, encoded, code, preserved⟩ + have ground := M.mainPrefixCode_fields_mem (encoded ▸ members z) + let f : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) + have fieldsGround : ∀ j, f j ∈ M.sets := Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) + exact ⟨f, fieldsGround, (actual f fieldsGround).2 ⟨encoded, code, preserved⟩⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialPreservedMainPrefix + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, + ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), + PreservedMainPrefixCode M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) run.code ∧ + run.PreservesOldProfiles ∧ + run.code ∈ level.validMainPrefixes C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + run.indices = natSetCode 2 ∧ run.code ∈ M.sets ∧ ZFSet.rank run.code < ZFSet.rank K ∧ + run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ + (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.code = + certificate.transition.map.code := by + dsimp only + obtain ⟨level, seed, certificate, run, _, member, indices, ground, rank, + _, _, _, _, first, second, _entry, points, actors⟩ := + M.exists_initialMainPrefixCandidate pairing unions powers separation collection infinite choice hK standard + have crossing : (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).PreservesOldProfiles := by + unfold GroundChronologicalMainTransition.PreservesOldProfiles + rw [points, first, second] + exact certificate.oldProfilePreservation pairing unions powers separation infinite + (M.groundPower seed.source.stage.carrier) + have preserved := run.preservesOldProfiles_of_zero_one crossing + have exactMap : (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.code = + certificate.transition.map.code := congrArg₂ ZFSet.pair points actors + exact ⟨level, seed, certificate, run, run.preserved_code preserved, preserved, member, + indices, ground, rank, first, second, exactMap⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialRecursiveSuccessor.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialRecursiveSuccessor.lean index 5661ef01695a42f48815c0ff719436e5db86fbba..a570e39cd0d98a315b4f295198f5cacf642a3c7d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialRecursiveSuccessor.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInitialRecursiveSuccessor.lean @@ -1,76 +1,76 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RepresentativeProductAgreement -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInvariantSuccessors - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialRecursiveSuccessor - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - let T := M.groundTaskTransport P G r μ A Labels - ∃ Reps ∈ M.sets, ∃ h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B, - ∃ next : h.NextInputs M, - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ - h.nextActionGraph T ∈ M.sets ∧ - PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) ∧ - h.liftGraph M next ∈ M.sets ∧ - ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ - h.groundLiftFamily M next ∈ M.sets ∧ - (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ - ∃ nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) As Reps - G m inv one (h.nextActionGraph T), CodedRecursiveTaskAction nextInputs T := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let B := M.groundEligibleBatchAction P G r μ A Labels - let T := M.groundTaskTransport P G r μ A Labels - obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨hMaps, maps, valid, hB, currentAction, - Reps, hReps, reps, represents, agreement⟩ := - M.exists_groundInitialRepresentatives pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet - let h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B := - ⟨maps, (fields 0).2, reps, group, currentAction, valid, agreement⟩ - have s := M.groundInitialTaskAction pairing unions powers separation hP hG hr hμ hA hLabels - group action meet Reps h - have compatible : RecursiveRepresentativeCompatibility h T := by - intro δ i j a g g' x y z transport source first second hx below left right - exact M.groundTaskRepresentatives_composed_entry pairing unions powers separation - hP hG hA group action meet reps represents transport source first second hx below left right - exact ⟨Reps, hReps, h, s.exists_groundSuccessor M pairing unions powers separation - compatible hI hI hP hr hQs hrs hμs (fields 0).1 (fields 2).1 (fields 4).1 (fields 3).1 - hMaps (fields 0).1 hReps hG hB - (M.groundTaskTransport_mem pairing unions powers separation hP hG hr hμ hA hLabels meet)⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RepresentativeProductAgreement +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInvariantSuccessors + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialRecursiveSuccessor + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + let T := M.groundTaskTransport P G r μ A Labels + ∃ Reps ∈ M.sets, ∃ h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B, + ∃ next : h.NextInputs M, + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ + h.nextActionGraph T ∈ M.sets ∧ + PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) ∧ + h.liftGraph M next ∈ M.sets ∧ + ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ + h.groundLiftFamily M next ∈ M.sets ∧ + (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ + ∃ nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) As Reps + G m inv one (h.nextActionGraph T), CodedRecursiveTaskAction nextInputs T := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) As (literalTaskBaseGraph I P R U Labels) + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let B := M.groundEligibleBatchAction P G r μ A Labels + let T := M.groundTaskTransport P G r μ A Labels + obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨hMaps, maps, valid, hB, currentAction, + Reps, hReps, reps, represents, agreement⟩ := + M.exists_groundInitialRepresentatives pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet + let h : CodedRecursiveMapInputs d I Maps As Reps G m inv one B := + ⟨maps, (fields 0).2, reps, group, currentAction, valid, agreement⟩ + have s := M.groundInitialTaskAction pairing unions powers separation hP hG hr hμ hA hLabels + group action meet Reps h + have compatible : RecursiveRepresentativeCompatibility h T := by + intro δ i j a g g' x y z transport source first second hx below left right + exact M.groundTaskRepresentatives_composed_entry pairing unions powers separation + hP hG hA group action meet reps represents transport source first second hx below left right + exact ⟨Reps, hReps, h, s.exists_groundSuccessor M pairing unions powers separation + compatible hI hI hP hr hQs hrs hμs (fields 0).1 (fields 2).1 (fields 4).1 (fields 3).1 + hMaps (fields 0).1 hReps hG hB + (M.groundTaskTransport_mem pairing unions powers separation hP hG hr hμ hA hLabels meet)⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundIntervalRecursion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundIntervalRecursion.lean index ef83c3927ad6769d1f41faeaadf475a6f1e78687..b131ec7d674331478c8e3fcdd6ae4b7201eb0b6e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundIntervalRecursion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundIntervalRecursion.lean @@ -1,241 +1,241 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.NaturalStepFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.FiniteIntervalExtension -import OAI.SetTheory.PartitionPrinciple.Geometry.IntervalTraceValidity - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem collect_ordinalSuccessorTraces - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) {A : ZFSet.{u}} (hA : A ∈ M.sets) - (traces : ∀ β ∈ A, ∃ f ∈ M.sets, - OrdinalRecursionTrace (groundRecursionStep M φ params) (insert β β) f) : - ∃ family ∈ M.sets, - (∀ f ∈ family, ∃ β ∈ A, - OrdinalRecursionTrace (groundRecursionStep M φ params) (insert β β) f) ∧ - ∀ β ∈ A, ∃ f ∈ family, - OrdinalRecursionTrace (groundRecursionStep M φ params) (insert β β) f := by - have witnesses : ∀ β ∈ A, ∃ f ∈ M.sets, - Realize M.sets (ordinalSuccessorTraceFormula φ) (extend β (extend f params)) := by - intro β hβ - obtain ⟨f, hf, trace⟩ := traces β hβ - exact ⟨f, hf, (M.realize_ordinalSuccessorTraceFormula pairing unions φ params - members (M.transitive hA hβ) hf).2 trace⟩ - obtain ⟨W, hW, covers⟩ := M.collection_witness collection (ordinalSuccessorTraceFormula φ) - params members hA witnesses - let family := ZFSet.sep (fun f => Realize M.sets - (relationImageFormula (ordinalSuccessorTraceFormula φ)) (extend f (extend A params))) W - have hFamily : family ∈ M.sets := M.separation_mem separation - (relationImageFormula (ordinalSuccessorTraceFormula φ)) (extend A params) - (Fin.cases hA members) hW - refine ⟨family, hFamily, ?_, ?_⟩ - · intro f hf - obtain ⟨hfW, selected⟩ := ZFSet.mem_sep.1 hf - obtain ⟨β, hβ, relation⟩ := (M.realize_relationImageFormula - (ordinalSuccessorTraceFormula φ) params A f hA).1 selected - exact ⟨β, hβ, (M.realize_ordinalSuccessorTraceFormula pairing unions φ params - members (M.transitive hA hβ) (M.transitive hW hfW)).1 relation⟩ - · intro β hβ - obtain ⟨f, hfW, relation⟩ := covers β hβ - have selected := (M.realize_relationImageFormula (ordinalSuccessorTraceFormula φ) - params A f hA).2 ⟨β, hβ, relation⟩ - exact ⟨f, ZFSet.mem_sep.2 ⟨hfW, selected⟩, - (M.realize_ordinalSuccessorTraceFormula pairing unions φ params members - (M.transitive hA hβ) (M.transitive hW hfW)).1 relation⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -open SetFormula -universe u - -def GroundOrdinalStepClosure (M : TransitiveGround.{u}) (T : ZFSet.{u}) - {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) : Prop := - ∀ α ∈ T, ∀ p ∈ M.sets, OrdinalRecursionTrace (groundRecursionStep M φ params) α p → - ∃ y ∈ M.sets, Realize M.sets φ (extend α (extend p (extend y params))) ∧ - ∀ z ∈ M.sets, Realize M.sets φ (extend α (extend p (extend z params))) → z = y - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem groundRecursionStep_unique_on_traces {T : ZFSet.{u}} {k : Nat} - {φ : SetFormula (k + 3)} {params : Fin k → ZFSet.{u}} - (step : GroundOrdinalStepClosure M T φ params) : - ∀ α ∈ T, ∀ p, OrdinalRecursionTrace (groundRecursionStep M φ params) α p → - ∀ y z, groundRecursionStep M φ params α p y → - groundRecursionStep M φ params α p z → y = z := by - intro α hα p trace y z first second - obtain ⟨w, _, _, unique⟩ := step α hα p first.1 trace - exact (unique y first.2.1 first.2.2).trans (unique z second.2.1 second.2.2).symm - -theorem exists_ordinalRecursionTrace - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) - {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) - (step : GroundOrdinalStepClosure M T φ params) : - ∃ f ∈ M.sets, OrdinalRecursionTrace (groundRecursionStep M φ params) T f := by - have unique := M.groundRecursionStep_unique_on_traces step - have successors : ∀ α ∈ T, ∃ f ∈ M.sets, - OrdinalRecursionTrace (groundRecursionStep M φ params) (insert α α) f := by - intro α - induction α using ZFSet.inductionOn with - | h α ih => - intro hα - have hαM := M.transitive hT hα - have ordinalα := ordinalSetProperty_member ordinal hα - have subsetα : α ⊆ T := fun β hβ => ordinal.1 α hα β hβ - obtain ⟨family, hFamily, traces, covers⟩ := M.collect_ordinalSuccessorTraces pairing unions - separation collection φ params members hαM - (fun β hβ => ih β hβ (subsetα hβ)) - have prefixTrace := OrdinalRecursionTrace.sUnion_successors ordinalα subsetα unique traces covers - have hPrefix := M.union_mem unions hFamily - obtain ⟨y, hy, relation, _⟩ := step α hα family.sUnion hPrefix prefixTrace - exact ⟨insert (ZFSet.pair α y) family.sUnion, - M.insert_mem pairing unions (M.orderedPair_mem pairing hαM hy) hPrefix, - prefixTrace.succ ordinalα ⟨hPrefix, hy, relation⟩⟩ - obtain ⟨family, hFamily, traces, covers⟩ := M.collect_ordinalSuccessorTraces pairing unions - separation collection φ params members hT successors - exact ⟨family.sUnion, M.union_mem unions hFamily, - OrdinalRecursionTrace.sUnion_successors ordinal (fun _ hx => hx) unique traces covers⟩ - -theorem ordinalRecursionTrace_entry {T f : ZFSet.{u}} (ordinal : ordinalSetProperty T) - {k : Nat} {φ : SetFormula (k + 3)} {params : Fin k → ZFSet.{u}} - (step : GroundOrdinalStepClosure M T φ params) - (trace : OrdinalRecursionTrace (groundRecursionStep M φ params) T f) : - ∀ α ∈ T, ∀ y ∈ M.sets, ZFSet.pair α y ∈ f ↔ - Realize M.sets φ (extend α (extend (graphRestriction α f) (extend y params))) := by - intro α hα y hy - constructor - · intro entry - exact (trace.2 α hα y entry).2.2 - · intro relation - obtain ⟨w, entry⟩ := trace.1.total hα - have stepW := trace.2 α hα w entry - have prefixTrace := trace.restrict (ordinalSetProperty_member ordinal hα) - (fun β hβ => ordinal.1 α hα β hβ) - have equal := M.groundRecursionStep_unique_on_traces step α hα _ prefixTrace y w - ⟨stepW.1, hy, relation⟩ stepW - rw [equal] - exact entry - -theorem exists_unique_ordinalRecursionTrace - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - {T : ZFSet.{u}} (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) - {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) - (members : ∀ i, params i ∈ M.sets) - (step : GroundOrdinalStepClosure M T φ params) : - ∃ f ∈ M.sets, OrdinalRecursionTrace (groundRecursionStep M φ params) T f ∧ - (∀ g, OrdinalRecursionTrace (groundRecursionStep M φ params) T g → g = f) ∧ - ∀ α ∈ T, ∀ y ∈ M.sets, ZFSet.pair α y ∈ f ↔ - Realize M.sets φ (extend α (extend (graphRestriction α f) (extend y params))) := by - obtain ⟨f, hf, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection - hT ordinal φ params members step - exact ⟨f, hf, trace, fun g other => other.unique trace ordinal (fun _ hx => hx) - (M.groundRecursionStep_unique_on_traces step), M.ordinalRecursionTrace_entry ordinal step trace⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -open SetFormula SetRealization -universe u - -def intervalSequenceParams (A D rA rD e lo hi c : ZFSet.{u}) : Fin 9 → ZFSet.{u} := - extend A (extend D (extend rA (extend rD (extend e - (extend lo (extend hi (extend c (extend ZFSet.omega Fin.elim0)))))))) - -namespace TransitiveGround - -variable (M : TransitiveGround.{u}) - -theorem exists_ground_intervalSequence - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {A D rA rD e lo hi c : ZFSet.{u}} - (hA : A ∈ M.sets) (hD : D ∈ M.sets) (hrA : rA ∈ M.sets) - (hrD : rD ∈ M.sets) (he : e ∈ M.sets) (hc : c ∈ M.sets) - (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) - (injection : InjectionCode D ZFSet.omega c) - (enumeration : ZFSet.IsFunc ZFSet.omega A e) - (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : - ∃ t ∈ M.sets, IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t ∧ - OrdinalRecursionTrace - (groundRecursionStep M intervalSequenceStepFormula (intervalSequenceParams A D rA rD e lo hi c)) - ZFSet.omega t ∧ - ∀ s, OrdinalRecursionTrace - (groundRecursionStep M intervalSequenceStepFormula (intervalSequenceParams A D rA rD e lo hi c)) - ZFSet.omega s → s = t := by - have hw := M.omega_mem separation infinite - have hlo := M.transitive hD loD - have hhi := M.transitive hD hiD - let params := intervalSequenceParams A D rA rD e lo hi c - have members : ∀ i, params i ∈ M.sets := - Fin.cases hA (Fin.cases hD (Fin.cases hrA (Fin.cases hrD (Fin.cases he - (Fin.cases hlo (Fin.cases hhi (Fin.cases hc (Fin.cases hw (fun i => Fin.elim0 i))))))))) - have decode (N p y : ZFSet.{u}) (hN : N ∈ M.sets) (hp : p ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets intervalSequenceStepFormula (extend N (extend p (extend y params))) ↔ - leastIntervalNextCandidate N A D rA rD e lo hi p c y := - M.realize_intervalSequenceStepFormula (extend N (extend p (extend y params))) - (Fin.cases hN (Fin.cases hp (Fin.cases hy members))) rfl - have valid {N p : ZFSet.{u}} (natural : N ⊆ ZFSet.omega) - (trace : OrdinalRecursionTrace (groundRecursionStep M intervalSequenceStepFormula params) N p) : - IntervalSequenceCode N A D rA rD e lo hi p := by - apply intervalSequence_of_next source target.toStrictLinearOrderCode enumeration natural trace.1 - intro i hiN y entry - have step := trace.2 i hiN y entry - exact ((decode i (graphRestriction i p) y (M.transitive hw (natural hiN)) - step.1 step.2.1).1 step.2.2).1 - have closure : GroundOrdinalStepClosure M ZFSet.omega intervalSequenceStepFormula params := by - intro N hN p hp trace - have hNM := M.transitive hw hN - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode N).1 hN - have natural : natSetCode n ⊆ (ZFSet.omega : ZFSet.{u}) := by - intro i hiN - obtain ⟨k, _, rfl⟩ := (mem_natSetCode i n).1 hiN - exact natSetCode_mem_omega k - have prefixValid := valid natural trace - have candidate := finite_intervalNextCandidate_exists n prefixValid enumeration source target - loD hiD gap - obtain ⟨y, selected, unique⟩ := leastIntervalNextCandidate_exists_unique injection candidate - have hy := M.transitive hD selected.1.1 - exact ⟨y, hy, (decode _ p y hNM hp hy).2 selected, - fun z hz relation => unique z ((decode _ p z hNM hp hz).1 relation)⟩ - have ordinal : ordinalSetProperty (ZFSet.omega : ZFSet.{u}) := by - rw [← ordinalCode_omega] - exact ordinalSetProperty_ordinalCode Ordinal.omega0 - obtain ⟨t, ht, trace, unique, _⟩ := M.exists_unique_ordinalRecursionTrace - pairing unions separation collection hw ordinal intervalSequenceStepFormula params members closure - exact ⟨t, ht, valid (fun _ hi => hi) trace, trace, unique⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.NaturalStepFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.FiniteIntervalExtension +import OAI.SetTheory.PartitionPrinciple.Geometry.IntervalTraceValidity + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem collect_ordinalSuccessorTraces + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) {A : ZFSet.{u}} (hA : A ∈ M.sets) + (traces : ∀ β ∈ A, ∃ f ∈ M.sets, + OrdinalRecursionTrace (groundRecursionStep M φ params) (insert β β) f) : + ∃ family ∈ M.sets, + (∀ f ∈ family, ∃ β ∈ A, + OrdinalRecursionTrace (groundRecursionStep M φ params) (insert β β) f) ∧ + ∀ β ∈ A, ∃ f ∈ family, + OrdinalRecursionTrace (groundRecursionStep M φ params) (insert β β) f := by + have witnesses : ∀ β ∈ A, ∃ f ∈ M.sets, + Realize M.sets (ordinalSuccessorTraceFormula φ) (extend β (extend f params)) := by + intro β hβ + obtain ⟨f, hf, trace⟩ := traces β hβ + exact ⟨f, hf, (M.realize_ordinalSuccessorTraceFormula pairing unions φ params + members (M.transitive hA hβ) hf).2 trace⟩ + obtain ⟨W, hW, covers⟩ := M.collection_witness collection (ordinalSuccessorTraceFormula φ) + params members hA witnesses + let family := ZFSet.sep (fun f => Realize M.sets + (relationImageFormula (ordinalSuccessorTraceFormula φ)) (extend f (extend A params))) W + have hFamily : family ∈ M.sets := M.separation_mem separation + (relationImageFormula (ordinalSuccessorTraceFormula φ)) (extend A params) + (Fin.cases hA members) hW + refine ⟨family, hFamily, ?_, ?_⟩ + · intro f hf + obtain ⟨hfW, selected⟩ := ZFSet.mem_sep.1 hf + obtain ⟨β, hβ, relation⟩ := (M.realize_relationImageFormula + (ordinalSuccessorTraceFormula φ) params A f hA).1 selected + exact ⟨β, hβ, (M.realize_ordinalSuccessorTraceFormula pairing unions φ params + members (M.transitive hA hβ) (M.transitive hW hfW)).1 relation⟩ + · intro β hβ + obtain ⟨f, hfW, relation⟩ := covers β hβ + have selected := (M.realize_relationImageFormula (ordinalSuccessorTraceFormula φ) + params A f hA).2 ⟨β, hβ, relation⟩ + exact ⟨f, ZFSet.mem_sep.2 ⟨hfW, selected⟩, + (M.realize_ordinalSuccessorTraceFormula pairing unions φ params members + (M.transitive hA hβ) (M.transitive hW hfW)).1 relation⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +open SetFormula +universe u + +def GroundOrdinalStepClosure (M : TransitiveGround.{u}) (T : ZFSet.{u}) + {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) : Prop := + ∀ α ∈ T, ∀ p ∈ M.sets, OrdinalRecursionTrace (groundRecursionStep M φ params) α p → + ∃ y ∈ M.sets, Realize M.sets φ (extend α (extend p (extend y params))) ∧ + ∀ z ∈ M.sets, Realize M.sets φ (extend α (extend p (extend z params))) → z = y + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem groundRecursionStep_unique_on_traces {T : ZFSet.{u}} {k : Nat} + {φ : SetFormula (k + 3)} {params : Fin k → ZFSet.{u}} + (step : GroundOrdinalStepClosure M T φ params) : + ∀ α ∈ T, ∀ p, OrdinalRecursionTrace (groundRecursionStep M φ params) α p → + ∀ y z, groundRecursionStep M φ params α p y → + groundRecursionStep M φ params α p z → y = z := by + intro α hα p trace y z first second + obtain ⟨w, _, _, unique⟩ := step α hα p first.1 trace + exact (unique y first.2.1 first.2.2).trans (unique z second.2.1 second.2.2).symm + +theorem exists_ordinalRecursionTrace + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) + {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) + (step : GroundOrdinalStepClosure M T φ params) : + ∃ f ∈ M.sets, OrdinalRecursionTrace (groundRecursionStep M φ params) T f := by + have unique := M.groundRecursionStep_unique_on_traces step + have successors : ∀ α ∈ T, ∃ f ∈ M.sets, + OrdinalRecursionTrace (groundRecursionStep M φ params) (insert α α) f := by + intro α + induction α using ZFSet.inductionOn with + | h α ih => + intro hα + have hαM := M.transitive hT hα + have ordinalα := ordinalSetProperty_member ordinal hα + have subsetα : α ⊆ T := fun β hβ => ordinal.1 α hα β hβ + obtain ⟨family, hFamily, traces, covers⟩ := M.collect_ordinalSuccessorTraces pairing unions + separation collection φ params members hαM + (fun β hβ => ih β hβ (subsetα hβ)) + have prefixTrace := OrdinalRecursionTrace.sUnion_successors ordinalα subsetα unique traces covers + have hPrefix := M.union_mem unions hFamily + obtain ⟨y, hy, relation, _⟩ := step α hα family.sUnion hPrefix prefixTrace + exact ⟨insert (ZFSet.pair α y) family.sUnion, + M.insert_mem pairing unions (M.orderedPair_mem pairing hαM hy) hPrefix, + prefixTrace.succ ordinalα ⟨hPrefix, hy, relation⟩⟩ + obtain ⟨family, hFamily, traces, covers⟩ := M.collect_ordinalSuccessorTraces pairing unions + separation collection φ params members hT successors + exact ⟨family.sUnion, M.union_mem unions hFamily, + OrdinalRecursionTrace.sUnion_successors ordinal (fun _ hx => hx) unique traces covers⟩ + +theorem ordinalRecursionTrace_entry {T f : ZFSet.{u}} (ordinal : ordinalSetProperty T) + {k : Nat} {φ : SetFormula (k + 3)} {params : Fin k → ZFSet.{u}} + (step : GroundOrdinalStepClosure M T φ params) + (trace : OrdinalRecursionTrace (groundRecursionStep M φ params) T f) : + ∀ α ∈ T, ∀ y ∈ M.sets, ZFSet.pair α y ∈ f ↔ + Realize M.sets φ (extend α (extend (graphRestriction α f) (extend y params))) := by + intro α hα y hy + constructor + · intro entry + exact (trace.2 α hα y entry).2.2 + · intro relation + obtain ⟨w, entry⟩ := trace.1.total hα + have stepW := trace.2 α hα w entry + have prefixTrace := trace.restrict (ordinalSetProperty_member ordinal hα) + (fun β hβ => ordinal.1 α hα β hβ) + have equal := M.groundRecursionStep_unique_on_traces step α hα _ prefixTrace y w + ⟨stepW.1, hy, relation⟩ stepW + rw [equal] + exact entry + +theorem exists_unique_ordinalRecursionTrace + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + {T : ZFSet.{u}} (hT : T ∈ M.sets) (ordinal : ordinalSetProperty T) + {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) + (members : ∀ i, params i ∈ M.sets) + (step : GroundOrdinalStepClosure M T φ params) : + ∃ f ∈ M.sets, OrdinalRecursionTrace (groundRecursionStep M φ params) T f ∧ + (∀ g, OrdinalRecursionTrace (groundRecursionStep M φ params) T g → g = f) ∧ + ∀ α ∈ T, ∀ y ∈ M.sets, ZFSet.pair α y ∈ f ↔ + Realize M.sets φ (extend α (extend (graphRestriction α f) (extend y params))) := by + obtain ⟨f, hf, trace⟩ := M.exists_ordinalRecursionTrace pairing unions separation collection + hT ordinal φ params members step + exact ⟨f, hf, trace, fun g other => other.unique trace ordinal (fun _ hx => hx) + (M.groundRecursionStep_unique_on_traces step), M.ordinalRecursionTrace_entry ordinal step trace⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +open SetFormula SetRealization +universe u + +def intervalSequenceParams (A D rA rD e lo hi c : ZFSet.{u}) : Fin 9 → ZFSet.{u} := + extend A (extend D (extend rA (extend rD (extend e + (extend lo (extend hi (extend c (extend ZFSet.omega Fin.elim0)))))))) + +namespace TransitiveGround + +variable (M : TransitiveGround.{u}) + +theorem exists_ground_intervalSequence + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {A D rA rD e lo hi c : ZFSet.{u}} + (hA : A ∈ M.sets) (hD : D ∈ M.sets) (hrA : rA ∈ M.sets) + (hrD : rD ∈ M.sets) (he : e ∈ M.sets) (hc : c ∈ M.sets) + (source : StrictLinearOrderCode A rA) (target : DenseOrderCode D rD) + (injection : InjectionCode D ZFSet.omega c) + (enumeration : ZFSet.IsFunc ZFSet.omega A e) + (loD : lo ∈ D) (hiD : hi ∈ D) (gap : ZFSet.pair lo hi ∈ rD) : + ∃ t ∈ M.sets, IntervalSequenceCode ZFSet.omega A D rA rD e lo hi t ∧ + OrdinalRecursionTrace + (groundRecursionStep M intervalSequenceStepFormula (intervalSequenceParams A D rA rD e lo hi c)) + ZFSet.omega t ∧ + ∀ s, OrdinalRecursionTrace + (groundRecursionStep M intervalSequenceStepFormula (intervalSequenceParams A D rA rD e lo hi c)) + ZFSet.omega s → s = t := by + have hw := M.omega_mem separation infinite + have hlo := M.transitive hD loD + have hhi := M.transitive hD hiD + let params := intervalSequenceParams A D rA rD e lo hi c + have members : ∀ i, params i ∈ M.sets := + Fin.cases hA (Fin.cases hD (Fin.cases hrA (Fin.cases hrD (Fin.cases he + (Fin.cases hlo (Fin.cases hhi (Fin.cases hc (Fin.cases hw (fun i => Fin.elim0 i))))))))) + have decode (N p y : ZFSet.{u}) (hN : N ∈ M.sets) (hp : p ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets intervalSequenceStepFormula (extend N (extend p (extend y params))) ↔ + leastIntervalNextCandidate N A D rA rD e lo hi p c y := + M.realize_intervalSequenceStepFormula (extend N (extend p (extend y params))) + (Fin.cases hN (Fin.cases hp (Fin.cases hy members))) rfl + have valid {N p : ZFSet.{u}} (natural : N ⊆ ZFSet.omega) + (trace : OrdinalRecursionTrace (groundRecursionStep M intervalSequenceStepFormula params) N p) : + IntervalSequenceCode N A D rA rD e lo hi p := by + apply intervalSequence_of_next source target.toStrictLinearOrderCode enumeration natural trace.1 + intro i hiN y entry + have step := trace.2 i hiN y entry + exact ((decode i (graphRestriction i p) y (M.transitive hw (natural hiN)) + step.1 step.2.1).1 step.2.2).1 + have closure : GroundOrdinalStepClosure M ZFSet.omega intervalSequenceStepFormula params := by + intro N hN p hp trace + have hNM := M.transitive hw hN + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode N).1 hN + have natural : natSetCode n ⊆ (ZFSet.omega : ZFSet.{u}) := by + intro i hiN + obtain ⟨k, _, rfl⟩ := (mem_natSetCode i n).1 hiN + exact natSetCode_mem_omega k + have prefixValid := valid natural trace + have candidate := finite_intervalNextCandidate_exists n prefixValid enumeration source target + loD hiD gap + obtain ⟨y, selected, unique⟩ := leastIntervalNextCandidate_exists_unique injection candidate + have hy := M.transitive hD selected.1.1 + exact ⟨y, hy, (decode _ p y hNM hp hy).2 selected, + fun z hz relation => unique z ((decode _ p z hNM hp hz).1 relation)⟩ + have ordinal : ordinalSetProperty (ZFSet.omega : ZFSet.{u}) := by + rw [← ordinalCode_omega] + exact ordinalSetProperty_ordinalCode Ordinal.omega0 + obtain ⟨t, ht, trace, unique, _⟩ := M.exists_unique_ordinalRecursionTrace + pairing unions separation collection hw ordinal intervalSequenceStepFormula params members closure + exact ⟨t, ht, valid (fun _ hi => hi) trace, trace, unique⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInvariantSuccessors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInvariantSuccessors.lean index 91464c60c3be87ba2490859b2f6f11e6471cb7ad..a5c47fb5c9f6bf7f76a424e4c2412ac03c5904ea 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInvariantSuccessors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundInvariantSuccessors.lean @@ -1,490 +1,490 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.AttachmentOldCodeLaws -import OAI.SetTheory.PartitionPrinciple.Geometry.FixedCompressionSeeds - -namespace OAI - - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -theorem liftSection_old_iff {i S x y : ZFSet.{u}} - (mapEntry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : - ZFSet.pair x y ∈ h.liftSection M next i ↔ ZFSet.pair x y ∈ S := by - rw [liftSection, pair_mem_indexedRelationSection, h.liftGraph_old_iff M next mapEntry hx] - constructor - · exact fun entry => entry.2.2 - · intro entry - exact ⟨old_mem_taggedExtension hx, old_mem_taggedExtension - (ZFSet.pair_mem_prod.1 ((h.valid i S mapEntry).injection.function.1 entry)).2, entry⟩ - -theorem liftSection_image_base_iff {i a S b x y : ZFSet.{u}} - (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) - (base : ZFSet.pair a b ∈ S) (image : ZFSet.pair x y ∈ h.liftSection M next i) : - ZFSet.pair y b ∈ next.batchOrder ↔ ZFSet.pair x a ∈ d.batchOrder := by - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - exact h.liftSection_order_iff M next ⟨i, h.maps.pair_source mapEntry⟩ image - ((h.liftSection_old_iff M next mapEntry ha).2 base) - -theorem liftSection_cut_iff {i a S b x y z w : ZFSet.{u}} - (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) - (base : ZFSet.pair a b ∈ S) (image : ZFSet.pair x y ∈ h.liftSection M next i) - (cut : ZFSet.pair (ZFSet.pair x a) z ∈ d.batchMeetGraph) : - ZFSet.pair (ZFSet.pair y b) w ∈ next.batchMeetGraph ↔ - ZFSet.pair z w ∈ h.liftSection M next i := by - have hi := h.maps.pair_source mapEntry - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - have baseLift := (h.liftSection_old_iff M next mapEntry ha).2 base - have hz := (ZFSet.pair_mem_prod.1 (d.batch_meetOrder.operation.1 cut)).2 - constructor - · intro targetCut - obtain ⟨value, entry, _⟩ := (h.liftSection_function M next hi).2 z hz - have equal : w = value := - (show FunctionGraphOn (ZFSet.prod next.batchCarrier next.batchCarrier) next.batchMeetGraph from - ⟨next.batchCarrier, next.batch_meetOrder.operation⟩).unique targetCut - (h.liftSection_map_meet M next ⟨i, hi⟩ cut image baseLift entry) - exact equal.symm ▸ entry - · intro entry - exact h.liftSection_map_meet M next ⟨i, hi⟩ cut image baseLift entry - -theorem liftSection_range_below_cap {i S T K x y : ZFSet.{u}} - (mapEntry : ZFSet.pair i S ∈ Maps) (hT : T ∈ D) - (top : ∀ p ∈ D, ZFSet.pair p T ∈ rD) (cap : ZFSet.pair T K ∈ S) - (image : ZFSet.pair x y ∈ h.liftSection M next i) : - ZFSet.pair y K ∈ next.batchOrder := by - have hi := h.maps.pair_source mapEntry - have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next hi).1 image)).1 - obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx - have lower : ZFSet.pair (d.coding.encode X) T ∈ d.batchOrder := - (d.coding.le_encode X (.inl ⟨T, hT⟩)).2 - (d.templates.greatest_preserved ⟨T, hT⟩ (fun p => top p.val p.property) X) - exact (h.liftSection_order_iff M next ⟨i, hi⟩ image - ((h.liftSection_old_iff M next mapEntry hT).2 cap)).2 lower - -theorem liftSection_fresh_outside_base {i a S b y : ZFSet.{u}} - (q : d.templates.Fresh) - (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) - (base : ZFSet.pair a b ∈ S) (negative : a ∉ d.filter q.1) - (image : ZFSet.pair (d.coding.encode (.inr q)) y ∈ h.liftSection M next i) : - ZFSet.pair y b ∉ next.batchOrder := by - intro lower - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - exact negative ((d.coding.le_encode (.inr q) (.inl ⟨a, ha⟩)).1 - ((h.liftSection_image_base_iff M next source mapEntry base image).1 lower)) - - - - - -theorem negative_cap_persists {K v b w : ZFSet.{u}} - (hK : K ∈ d.batchCarrier) (hv : v ∈ d.batchCarrier) (hb : b ∈ d.batchCarrier) - (negative : ∀ z, ZFSet.pair (ZFSet.pair K v) z ∈ d.batchMeetGraph → - ZFSet.pair z b ∈ d.batchOrder) - (entry : ZFSet.pair (ZFSet.pair K v) w ∈ next.batchMeetGraph) : - ZFSet.pair w b ∈ next.batchOrder := by - have oldMeet := (next.old_meet_iff hK hv).1 entry - have hw := (ZFSet.pair_mem_prod.1 (d.batch_meetOrder.operation.1 oldMeet)).2 - exact (next.old_order_iff hw hb).2 (negative w oldMeet) - -theorem liftSection_cap_and_source_unchanged {i S T a K b : ZFSet.{u}} - (mapEntry : ZFSet.pair i S ∈ Maps) (source : ZFSet.pair i a ∈ Sources) - (hT : T ∈ D) (cap : ZFSet.pair T K ∈ S) (base : ZFSet.pair a b ∈ S) : - ZFSet.pair T K ∈ h.liftSection M next i ∧ - ZFSet.pair a b ∈ h.liftSection M next i := - ⟨(h.liftSection_old_iff M next mapEntry hT).2 cap, - (h.liftSection_old_iff M next mapEntry - (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2).2 base⟩ - -theorem liftSection_negative_exclusion {i a S b T K v y : ZFSet.{u}} - (q : d.templates.Fresh) - (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) - (base : ZFSet.pair a b ∈ S) (hT : T ∈ D) - (top : ∀ p ∈ D, ZFSet.pair p T ∈ rD) (cap : ZFSet.pair T K ∈ S) - (hv : v ∈ d.batchCarrier) - (negativeCap : ∀ w, ZFSet.pair (ZFSet.pair K v) w ∈ d.batchMeetGraph → - ZFSet.pair w b ∈ d.batchOrder) - (negativeComponent : a ∉ d.filter q.1) - (image : ZFSet.pair (d.coding.encode (.inr q)) y ∈ h.liftSection M next i) : - ZFSet.pair y v ∉ next.batchOrder := by - intro below - have embedding := h.valid i S mapEntry - have hK := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 cap)).2 - have hb := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 base)).2 - have hy := (ZFSet.pair_mem_prod.1 - ((h.liftSection_function M next (h.maps.pair_source mapEntry)).1 image)).2 - obtain ⟨w, entry, _⟩ := next.batch_meetOrder.operation.2 (ZFSet.pair K v) - (ZFSet.pair_mem_prod.2 ⟨old_mem_taggedExtension hK, old_mem_taggedExtension hv⟩) - have lower := next.batch_meetOrder.greatest K v w y hy entry - (h.liftSection_range_below_cap M next mapEntry hT top cap image) below - have bound := h.negative_cap_persists M next hK hv hb negativeCap entry - have hw := (ZFSet.pair_mem_prod.1 (next.batch_meetOrder.operation.1 entry)).2 - exact h.liftSection_fresh_outside_base M next q source mapEntry base negativeComponent image - (next.batch_meetOrder.order.trans y hy w hw b (old_mem_taggedExtension hb) lower bound) - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - - - -namespace PartitionPilot.Forcing - -universe u - -namespace AttachmentBatchInputs - -variable {P0 r0 μ0 D rD μD J Qs rs μs As Es Fs Ss : ZFSet.{u}} -variable (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) - -theorem original_carrier_subset (original : P0 ⊆ D) : P0 ⊆ d.batchCarrier := - fun _ hx => old_mem_taggedExtension (original hx) - -theorem original_order_iff (original : P0 ⊆ D) - (restriction : ∀ x ∈ P0, ∀ y ∈ P0, ZFSet.pair x y ∈ rD ↔ ZFSet.pair x y ∈ r0) - {x y : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : - ZFSet.pair x y ∈ d.batchOrder ↔ ZFSet.pair x y ∈ r0 := - (d.old_order_iff (original hx) (original hy)).trans (restriction x hx y hy) - -theorem original_meet_iff (original : P0 ⊆ D) - (restriction : ∀ x ∈ P0, ∀ y ∈ P0, ∀ z, - ZFSet.pair (ZFSet.pair x y) z ∈ μD ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ0) - {x y z : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : - ZFSet.pair (ZFSet.pair x y) z ∈ d.batchMeetGraph ↔ - ZFSet.pair (ZFSet.pair x y) z ∈ μ0 := - (d.old_meet_iff (original hx) (original hy)).trans (restriction x hx y hy z) - -end AttachmentBatchInputs - -namespace CodedRecursiveMapInputs - -variable {P0 A0 D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) - -theorem nextAction_original_iff (original : P0 ⊆ D) - (restriction : ∀ g x, x ∈ P0 → ∀ y, - ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A0) - {g x y : ZFSet.{u}} (hx : x ∈ P0) : - ZFSet.pair (ZFSet.pair g x) y ∈ h.nextActionGraph T ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A0 := - (h.nextAction_old_iff (d.original_carrier_subset original hx)).trans (restriction g x hx y) - -end CodedRecursiveMapInputs - - - - - - -structure RecursiveCompressionInvariant - {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} - (seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) - {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} - {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} - (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) : Prop where - originalSubset : P0 ⊆ D - originalOrder : ∀ x ∈ P0, ∀ y ∈ P0, ZFSet.pair x y ∈ rD ↔ ZFSet.pair x y ∈ r0 - originalMeet : ∀ x ∈ P0, ∀ y ∈ P0, ∀ z, - ZFSet.pair (ZFSet.pair x y) z ∈ μD ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ0 - originalAction : ∀ g x, x ∈ P0 → ∀ y, - ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A0 - top : ∀ x ∈ D, ZFSet.pair x τ ∈ rD - agreement : ∀ g ∈ G, ∀ k ∈ G, ∀ v ∈ P0, - ActionAgreementBelow P0 r0 A0 g k v → - ActionAgreementBelow d.batchCarrier d.batchOrder A g k v - negative : ∀ i S a F cap base v w, - ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ Sources → ZFSet.pair i F ∈ Filters → - ZFSet.pair τ cap ∈ S → ZFSet.pair a base ∈ S → v ∈ P0 → v ∉ F → - ZFSet.pair (ZFSet.pair cap v) w ∈ d.batchMeetGraph → ZFSet.pair w base ∈ d.batchOrder - -namespace RecursiveCompressionInvariant - -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (state : RecursiveCompressionInvariant seed h) (s : CodedRecursiveTaskAction h T) - -include state s in -theorem compatible : RecursiveRepresentativeCompatibility h T := by - intro δ i j a g k x y z transport source firstRep secondRep hx below first second - have hδ := (s.taskAction.entry_shape transport).1 - have hg := (ZFSet.pair_mem_prod.1 (h.representatives.1 firstRep)).2 - have hk := (ZFSet.pair_mem_prod.1 (h.representatives.1 secondRep)).2 - have ha := (ZFSet.pair_mem_prod.1 (seed.sources.1 source)).2 - obtain ⟨product, productEntry, _⟩ := h.group.mul_function.2 (ZFSet.pair δ g) - (ZFSet.pair_mem_prod.2 ⟨hδ, hg⟩) - have hp := (ZFSet.pair_mem_prod.1 (h.group.mul_function.1 productEntry)).2 - have agree := state.agreement product hp k hk a ha - (seed.productAgreement δ i j g k product a transport source firstRep secondRep productEntry) - have hy := (ZFSet.pair_mem_prod.1 (h.action.function.1 first)).2 - obtain ⟨w, acted, _⟩ := h.action.function.2 (ZFSet.pair δ y) - (ZFSet.pair_mem_prod.2 ⟨hδ, hy⟩) - have composed := h.action.mul δ hδ g hg product hp x hx y hy w - (ZFSet.pair_mem_prod.1 (h.action.function.1 acted)).2 productEntry first acted - have equal := agree.entry_eq h.action hk hx below composed second - exact equal ▸ acted - -end RecursiveCompressionInvariant - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.CodedRecursiveTaskAction -open SetFormula -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (s : CodedRecursiveTaskAction h T) (M : TransitiveGround.{u}) - -include s in -theorem exists_groundSuccessor - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (compatible : RecursiveRepresentativeCompatibility h T) - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) (hSs : Ss ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hA : A ∈ M.sets) (hT : T ∈ M.sets) : - ∃ next : h.NextInputs M, - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ - h.nextActionGraph T ∈ M.sets ∧ - PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) ∧ - h.liftGraph M next ∈ M.sets ∧ - ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ - h.groundLiftFamily M next ∈ M.sets ∧ - (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ - ∃ nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T), CodedRecursiveTaskAction nextInputs T := by - obtain ⟨next, hC, hrC, hμC, meet, graph, graphFunction, ground, family, entries, _⟩ := - h.exists_groundLiftEmbeddings M pairing unions powers separation hI hJ hD hrD - hQs hrs hμs hAs hEs hFs hSs hMaps hSources hReps hG hA - obtain ⟨hL, _, _, _, _, _⟩ := M.batchAttachment_ground_codes - pairing unions powers separation d hD hrD hJ hQs hrs hμs hAs hEs hFs - have nextAction := s.nextAction_code M next - have nextInputs := h.nextMapInputs_of_family M next family entries nextAction - exact ⟨next, hC, hrC, hμC, meet, - h.nextActionGraph_mem M pairing unions powers separation hI hJ hD hL - hQs hrs hAs hFs hSources hG hA hT, - nextAction, graph, graphFunction, ground, entries, - nextInputs, s.nextTaskAction_of_family M next compatible entries nextInputs⟩ - -end PartitionPilot.Forcing.CodedRecursiveTaskAction - - - -namespace PartitionPilot.Forcing.RecursiveCompressionInvariant - -universe u -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (state : RecursiveCompressionInvariant seed h) (s : CodedRecursiveTaskAction h T) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -include state s in -theorem nextAgreement {g k v : ZFSet.{u}} (hg : g ∈ G) (hk : k ∈ G) (hv : v ∈ P0) - (agree : ActionAgreementBelow P0 r0 A0 g k v) : - ActionAgreementBelow next.batchCarrier next.batchOrder (h.nextActionGraph T) g k v := by - let positive : ZFSet.{u} → Prop := fun i => ∃ F, ZFSet.pair i F ∈ Filters ∧ v ∈ F - apply s.nextAction_agreement M next ⟨g, hg⟩ ⟨k, hk⟩ - ⟨τ, state.originalSubset seed.top_mem⟩ state.top ⟨v, state.originalSubset hv⟩ positive - · intro i S a cap base w mapEntry source capEntry baseEntry notPositive meet - let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, h.maps.pair_source mapEntry⟩ - exact state.negative i S a (seed.filters.value index) cap base v w - mapEntry source (seed.filters.value_entry index) capEntry baseEntry hv - (fun member => notPositive ⟨seed.filters.value index, seed.filters.value_entry index, member⟩) meet - · exact state.agreement g hg k hk v hv agree - · intro i j k pos first second - obtain ⟨F, entry, member⟩ := pos - exact seed.positiveAgreement _ _ v i j k F agree entry member first second - -include state in -theorem nextNegative - (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ - i ∈ I ∧ f = h.liftSection M next i) - {i S a F cap base v w : ZFSet.{u}} - (mapEntry : ZFSet.pair i S ∈ h.groundLiftFamily M next) - (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair i F ∈ Filters) - (capEntry : ZFSet.pair τ cap ∈ S) (baseEntry : ZFSet.pair a base ∈ S) - (hv : v ∈ P0) (negative : v ∉ F) - (meet : ZFSet.pair (ZFSet.pair cap v) w ∈ next.batchMeetGraph) : - ZFSet.pair w base ∈ next.batchOrder := by - obtain ⟨hi, rfl⟩ := (entries i S).1 mapEntry - let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have oldMap := h.maps.value_entry index - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - have oldCap := (h.liftSection_old_iff M next oldMap (state.originalSubset seed.top_mem)).1 capEntry - have oldBase := (h.liftSection_old_iff M next oldMap ha).1 baseEntry - have embedding := h.valid i (h.maps.value index) oldMap - exact h.negative_cap_persists M next - (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 oldCap)).2 - (d.original_carrier_subset state.originalSubset hv) - (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 oldBase)).2 - (fun z entry => state.negative i (h.maps.value index) a F cap base v z - oldMap source filter oldCap oldBase hv negative entry) meet - -include state s in -theorem nextInvariant - (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ - i ∈ I ∧ f = h.liftSection M next i) - (nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T)) : RecursiveCompressionInvariant seed nextInputs where - originalSubset := d.original_carrier_subset state.originalSubset - originalOrder := fun _ hx _ hy => d.original_order_iff state.originalSubset state.originalOrder hx hy - originalMeet := fun _ hx _ hy _ => d.original_meet_iff state.originalSubset state.originalMeet hx hy - originalAction := fun _ _ hx _ => h.nextAction_original_iff state.originalSubset state.originalAction hx - top := d.coding.greatest_preserved (state.originalSubset seed.top_mem) state.top - agreement := fun _ hg _ hk _ hv agree => state.nextAgreement s M next hg hk hv agree - negative := fun _ _ _ _ _ _ _ _ mapEntry source filter capEntry baseEntry hv negative meet => - state.nextNegative M next entries mapEntry source filter capEntry baseEntry hv negative meet - -end PartitionPilot.Forcing.RecursiveCompressionInvariant - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure RecursiveGroundFields (M : TransitiveGround.{u}) - {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} - {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} - (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) : Prop where - carrier : D ∈ M.sets - order : rD ∈ M.sets - meet : μD ∈ M.sets - indices : J ∈ M.sets - spaces : Qs ∈ M.sets - relations : rs ∈ M.sets - meets : μs ∈ M.sets - anchors : As ∈ M.sets - embeddings : Es ∈ M.sets - filters : Fs ∈ M.sets - separators : Ss ∈ M.sets - maps : Maps ∈ M.sets - action : A ∈ M.sets - -namespace RecursiveGroundFields -variable {M : TransitiveGround.{u}} -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (ground : RecursiveGroundFields M h) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include ground pairing unions powers separation - -theorem current_codes : d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ - d.batchMeetGraph ∈ M.sets := by - obtain ⟨hL, hrL, hμL, _, _, _⟩ := M.batchAttachment_ground_codes - pairing unions powers separation d ground.carrier ground.order ground.indices - ground.spaces ground.relations ground.meets ground.anchors ground.embeddings ground.filters - exact ⟨hL, hrL, hμL⟩ - -theorem next_fields - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) : - h.nextIndices ∈ M.sets ∧ - pairSecondField I J h.nextIndices Qs ∈ M.sets ∧ - pairSecondField I J h.nextIndices rs ∈ M.sets ∧ - pairSecondField I J h.nextIndices μs ∈ M.sets ∧ - pairSecondField I J h.nextIndices As ∈ M.sets ∧ - M.groundPairCompositions h.nextIndices I J (familyPointBound Qs) D d.batchCarrier Es Maps ∈ M.sets ∧ - M.groundPairPushFilters h.nextIndices I J d.batchCarrier d.batchOrder Maps Fs ∈ M.sets ∧ - recursiveSeparatorFamily h.nextIndices I J D d.batchCarrier Maps Ss ∈ M.sets := by - obtain ⟨hL, hrL, _⟩ := ground.current_codes pairing unions powers separation - have hK := h.nextIndices_mem M pairing unions powers separation - hI ground.indices ground.carrier ground.filters hSources - have fields {F : ZFSet.{u}} (hF : F ∈ M.sets) : pairSecondField I J h.nextIndices F ∈ M.sets := - M.pairFieldGraph_mem pairing unions powers separation false hI ground.indices hK - (M.union_mem unions (M.union_mem unions hF)) hF - have subset := recursiveAttachmentIndices_subset I J D Fs.sUnion.sUnion Sources Fs - exact ⟨hK, fields ground.spaces, fields ground.relations, fields ground.meets, - fields ground.anchors, - (M.groundPairCompositions_spec pairing unions powers separation hK hI ground.indices - (M.familyPointBound_mem unions ground.spaces) ground.carrier hL ground.embeddings - ground.maps d.embeddings h.maps subset).1, - (M.groundPairPushFilters_spec pairing unions powers separation hK hI ground.indices - hL hrL ground.maps ground.filters h.maps d.filters subset).1, - M.recursiveSeparatorFamily_mem pairing unions powers separation hK hI ground.indices - ground.carrier hL ground.maps ground.separators⟩ - -theorem next_codes (next : h.NextInputs M) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) : - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets := by - obtain ⟨hL, hrL, _⟩ := ground.current_codes pairing unions powers separation - obtain ⟨hK, hQs, hrs, hμs, hAs, hEs, hFs, _⟩ := - ground.next_fields pairing unions powers separation hI hSources - obtain ⟨hC, hrC, hμC, _, _, _⟩ := M.batchAttachment_ground_codes - pairing unions powers separation next hL hrL hK hQs hrs hμs hAs hEs hFs - exact ⟨hC, hrC, hμC⟩ - -theorem next (next : h.NextInputs M) - (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T)) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : RecursiveGroundFields M inputs := by - obtain ⟨hL, hrL, hμL⟩ := ground.current_codes pairing unions powers separation - obtain ⟨hK, hQs, hrs, hμs, hAs, hEs, hFs, hSs⟩ := - ground.next_fields pairing unions powers separation hI hSources - obtain ⟨hC, _, _⟩ := ground.next_codes pairing unions powers separation next hI hSources - have maps := (h.groundLiftFamily_spec M pairing unions powers separation next - hI ground.indices ground.carrier hL hC ground.spaces ground.relations ground.anchors - ground.maps hSources ground.filters hReps hG ground.action).2.1 - have action := h.nextActionGraph_mem M pairing unions powers separation - hI ground.indices ground.carrier hL ground.spaces ground.relations ground.anchors - ground.filters hSources hG ground.action hT - exact ⟨hL, hrL, hμL, hK, hQs, hrs, hμs, hAs, hEs, hFs, hSs, maps, action⟩ - -end RecursiveGroundFields - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.RecursiveCompressionInvariant -open SetFormula -universe u -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} -variable (state : RecursiveCompressionInvariant seed h) (s : CodedRecursiveTaskAction h T) -variable (M : TransitiveGround.{u}) -include state s - -theorem exists_groundNext - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (ground : RecursiveGroundFields M h) - (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hT : T ∈ M.sets) : - ∃ next : h.NextInputs M, - ∃ nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T), - CodedRecursiveTaskAction nextInputs T ∧ RecursiveCompressionInvariant seed nextInputs ∧ - RecursiveGroundFields M nextInputs := by - obtain ⟨next, _, _, _, _, _, _, _, _, _, entries, nextInputs, nextTask⟩ := - s.exists_groundSuccessor M pairing unions powers separation (state.compatible s) - hI ground.indices ground.carrier ground.order ground.spaces ground.relations ground.meets - ground.anchors ground.embeddings ground.filters ground.separators ground.maps - hSources hReps hG ground.action hT - exact ⟨next, nextInputs, nextTask, state.nextInvariant s M next entries nextInputs, - ground.next pairing unions powers separation next nextInputs hI hSources hReps hG hT⟩ - -end PartitionPilot.Forcing.RecursiveCompressionInvariant - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.AttachmentOldCodeLaws +import OAI.SetTheory.PartitionPrinciple.Geometry.FixedCompressionSeeds + +namespace OAI + + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +theorem liftSection_old_iff {i S x y : ZFSet.{u}} + (mapEntry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : + ZFSet.pair x y ∈ h.liftSection M next i ↔ ZFSet.pair x y ∈ S := by + rw [liftSection, pair_mem_indexedRelationSection, h.liftGraph_old_iff M next mapEntry hx] + constructor + · exact fun entry => entry.2.2 + · intro entry + exact ⟨old_mem_taggedExtension hx, old_mem_taggedExtension + (ZFSet.pair_mem_prod.1 ((h.valid i S mapEntry).injection.function.1 entry)).2, entry⟩ + +theorem liftSection_image_base_iff {i a S b x y : ZFSet.{u}} + (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) + (base : ZFSet.pair a b ∈ S) (image : ZFSet.pair x y ∈ h.liftSection M next i) : + ZFSet.pair y b ∈ next.batchOrder ↔ ZFSet.pair x a ∈ d.batchOrder := by + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + exact h.liftSection_order_iff M next ⟨i, h.maps.pair_source mapEntry⟩ image + ((h.liftSection_old_iff M next mapEntry ha).2 base) + +theorem liftSection_cut_iff {i a S b x y z w : ZFSet.{u}} + (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) + (base : ZFSet.pair a b ∈ S) (image : ZFSet.pair x y ∈ h.liftSection M next i) + (cut : ZFSet.pair (ZFSet.pair x a) z ∈ d.batchMeetGraph) : + ZFSet.pair (ZFSet.pair y b) w ∈ next.batchMeetGraph ↔ + ZFSet.pair z w ∈ h.liftSection M next i := by + have hi := h.maps.pair_source mapEntry + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + have baseLift := (h.liftSection_old_iff M next mapEntry ha).2 base + have hz := (ZFSet.pair_mem_prod.1 (d.batch_meetOrder.operation.1 cut)).2 + constructor + · intro targetCut + obtain ⟨value, entry, _⟩ := (h.liftSection_function M next hi).2 z hz + have equal : w = value := + (show FunctionGraphOn (ZFSet.prod next.batchCarrier next.batchCarrier) next.batchMeetGraph from + ⟨next.batchCarrier, next.batch_meetOrder.operation⟩).unique targetCut + (h.liftSection_map_meet M next ⟨i, hi⟩ cut image baseLift entry) + exact equal.symm ▸ entry + · intro entry + exact h.liftSection_map_meet M next ⟨i, hi⟩ cut image baseLift entry + +theorem liftSection_range_below_cap {i S T K x y : ZFSet.{u}} + (mapEntry : ZFSet.pair i S ∈ Maps) (hT : T ∈ D) + (top : ∀ p ∈ D, ZFSet.pair p T ∈ rD) (cap : ZFSet.pair T K ∈ S) + (image : ZFSet.pair x y ∈ h.liftSection M next i) : + ZFSet.pair y K ∈ next.batchOrder := by + have hi := h.maps.pair_source mapEntry + have hx := (ZFSet.pair_mem_prod.1 ((h.liftSection_function M next hi).1 image)).1 + obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx + have lower : ZFSet.pair (d.coding.encode X) T ∈ d.batchOrder := + (d.coding.le_encode X (.inl ⟨T, hT⟩)).2 + (d.templates.greatest_preserved ⟨T, hT⟩ (fun p => top p.val p.property) X) + exact (h.liftSection_order_iff M next ⟨i, hi⟩ image + ((h.liftSection_old_iff M next mapEntry hT).2 cap)).2 lower + +theorem liftSection_fresh_outside_base {i a S b y : ZFSet.{u}} + (q : d.templates.Fresh) + (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) + (base : ZFSet.pair a b ∈ S) (negative : a ∉ d.filter q.1) + (image : ZFSet.pair (d.coding.encode (.inr q)) y ∈ h.liftSection M next i) : + ZFSet.pair y b ∉ next.batchOrder := by + intro lower + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + exact negative ((d.coding.le_encode (.inr q) (.inl ⟨a, ha⟩)).1 + ((h.liftSection_image_base_iff M next source mapEntry base image).1 lower)) + + + + + +theorem negative_cap_persists {K v b w : ZFSet.{u}} + (hK : K ∈ d.batchCarrier) (hv : v ∈ d.batchCarrier) (hb : b ∈ d.batchCarrier) + (negative : ∀ z, ZFSet.pair (ZFSet.pair K v) z ∈ d.batchMeetGraph → + ZFSet.pair z b ∈ d.batchOrder) + (entry : ZFSet.pair (ZFSet.pair K v) w ∈ next.batchMeetGraph) : + ZFSet.pair w b ∈ next.batchOrder := by + have oldMeet := (next.old_meet_iff hK hv).1 entry + have hw := (ZFSet.pair_mem_prod.1 (d.batch_meetOrder.operation.1 oldMeet)).2 + exact (next.old_order_iff hw hb).2 (negative w oldMeet) + +theorem liftSection_cap_and_source_unchanged {i S T a K b : ZFSet.{u}} + (mapEntry : ZFSet.pair i S ∈ Maps) (source : ZFSet.pair i a ∈ Sources) + (hT : T ∈ D) (cap : ZFSet.pair T K ∈ S) (base : ZFSet.pair a b ∈ S) : + ZFSet.pair T K ∈ h.liftSection M next i ∧ + ZFSet.pair a b ∈ h.liftSection M next i := + ⟨(h.liftSection_old_iff M next mapEntry hT).2 cap, + (h.liftSection_old_iff M next mapEntry + (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2).2 base⟩ + +theorem liftSection_negative_exclusion {i a S b T K v y : ZFSet.{u}} + (q : d.templates.Fresh) + (source : ZFSet.pair i a ∈ Sources) (mapEntry : ZFSet.pair i S ∈ Maps) + (base : ZFSet.pair a b ∈ S) (hT : T ∈ D) + (top : ∀ p ∈ D, ZFSet.pair p T ∈ rD) (cap : ZFSet.pair T K ∈ S) + (hv : v ∈ d.batchCarrier) + (negativeCap : ∀ w, ZFSet.pair (ZFSet.pair K v) w ∈ d.batchMeetGraph → + ZFSet.pair w b ∈ d.batchOrder) + (negativeComponent : a ∉ d.filter q.1) + (image : ZFSet.pair (d.coding.encode (.inr q)) y ∈ h.liftSection M next i) : + ZFSet.pair y v ∉ next.batchOrder := by + intro below + have embedding := h.valid i S mapEntry + have hK := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 cap)).2 + have hb := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 base)).2 + have hy := (ZFSet.pair_mem_prod.1 + ((h.liftSection_function M next (h.maps.pair_source mapEntry)).1 image)).2 + obtain ⟨w, entry, _⟩ := next.batch_meetOrder.operation.2 (ZFSet.pair K v) + (ZFSet.pair_mem_prod.2 ⟨old_mem_taggedExtension hK, old_mem_taggedExtension hv⟩) + have lower := next.batch_meetOrder.greatest K v w y hy entry + (h.liftSection_range_below_cap M next mapEntry hT top cap image) below + have bound := h.negative_cap_persists M next hK hv hb negativeCap entry + have hw := (ZFSet.pair_mem_prod.1 (next.batch_meetOrder.operation.1 entry)).2 + exact h.liftSection_fresh_outside_base M next q source mapEntry base negativeComponent image + (next.batch_meetOrder.order.trans y hy w hw b (old_mem_taggedExtension hb) lower bound) + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + + + +namespace PartitionPilot.Forcing + +universe u + +namespace AttachmentBatchInputs + +variable {P0 r0 μ0 D rD μD J Qs rs μs As Es Fs Ss : ZFSet.{u}} +variable (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) + +theorem original_carrier_subset (original : P0 ⊆ D) : P0 ⊆ d.batchCarrier := + fun _ hx => old_mem_taggedExtension (original hx) + +theorem original_order_iff (original : P0 ⊆ D) + (restriction : ∀ x ∈ P0, ∀ y ∈ P0, ZFSet.pair x y ∈ rD ↔ ZFSet.pair x y ∈ r0) + {x y : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : + ZFSet.pair x y ∈ d.batchOrder ↔ ZFSet.pair x y ∈ r0 := + (d.old_order_iff (original hx) (original hy)).trans (restriction x hx y hy) + +theorem original_meet_iff (original : P0 ⊆ D) + (restriction : ∀ x ∈ P0, ∀ y ∈ P0, ∀ z, + ZFSet.pair (ZFSet.pair x y) z ∈ μD ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ0) + {x y z : ZFSet.{u}} (hx : x ∈ P0) (hy : y ∈ P0) : + ZFSet.pair (ZFSet.pair x y) z ∈ d.batchMeetGraph ↔ + ZFSet.pair (ZFSet.pair x y) z ∈ μ0 := + (d.old_meet_iff (original hx) (original hy)).trans (restriction x hx y hy z) + +end AttachmentBatchInputs + +namespace CodedRecursiveMapInputs + +variable {P0 A0 D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) + +theorem nextAction_original_iff (original : P0 ⊆ D) + (restriction : ∀ g x, x ∈ P0 → ∀ y, + ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A0) + {g x y : ZFSet.{u}} (hx : x ∈ P0) : + ZFSet.pair (ZFSet.pair g x) y ∈ h.nextActionGraph T ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A0 := + (h.nextAction_old_iff (d.original_carrier_subset original hx)).trans (restriction g x hx y) + +end CodedRecursiveMapInputs + + + + + + +structure RecursiveCompressionInvariant + {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} + (seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters) + {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} + {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} + (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) : Prop where + originalSubset : P0 ⊆ D + originalOrder : ∀ x ∈ P0, ∀ y ∈ P0, ZFSet.pair x y ∈ rD ↔ ZFSet.pair x y ∈ r0 + originalMeet : ∀ x ∈ P0, ∀ y ∈ P0, ∀ z, + ZFSet.pair (ZFSet.pair x y) z ∈ μD ↔ ZFSet.pair (ZFSet.pair x y) z ∈ μ0 + originalAction : ∀ g x, x ∈ P0 → ∀ y, + ZFSet.pair (ZFSet.pair g x) y ∈ A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A0 + top : ∀ x ∈ D, ZFSet.pair x τ ∈ rD + agreement : ∀ g ∈ G, ∀ k ∈ G, ∀ v ∈ P0, + ActionAgreementBelow P0 r0 A0 g k v → + ActionAgreementBelow d.batchCarrier d.batchOrder A g k v + negative : ∀ i S a F cap base v w, + ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ Sources → ZFSet.pair i F ∈ Filters → + ZFSet.pair τ cap ∈ S → ZFSet.pair a base ∈ S → v ∈ P0 → v ∉ F → + ZFSet.pair (ZFSet.pair cap v) w ∈ d.batchMeetGraph → ZFSet.pair w base ∈ d.batchOrder + +namespace RecursiveCompressionInvariant + +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (state : RecursiveCompressionInvariant seed h) (s : CodedRecursiveTaskAction h T) + +include state s in +theorem compatible : RecursiveRepresentativeCompatibility h T := by + intro δ i j a g k x y z transport source firstRep secondRep hx below first second + have hδ := (s.taskAction.entry_shape transport).1 + have hg := (ZFSet.pair_mem_prod.1 (h.representatives.1 firstRep)).2 + have hk := (ZFSet.pair_mem_prod.1 (h.representatives.1 secondRep)).2 + have ha := (ZFSet.pair_mem_prod.1 (seed.sources.1 source)).2 + obtain ⟨product, productEntry, _⟩ := h.group.mul_function.2 (ZFSet.pair δ g) + (ZFSet.pair_mem_prod.2 ⟨hδ, hg⟩) + have hp := (ZFSet.pair_mem_prod.1 (h.group.mul_function.1 productEntry)).2 + have agree := state.agreement product hp k hk a ha + (seed.productAgreement δ i j g k product a transport source firstRep secondRep productEntry) + have hy := (ZFSet.pair_mem_prod.1 (h.action.function.1 first)).2 + obtain ⟨w, acted, _⟩ := h.action.function.2 (ZFSet.pair δ y) + (ZFSet.pair_mem_prod.2 ⟨hδ, hy⟩) + have composed := h.action.mul δ hδ g hg product hp x hx y hy w + (ZFSet.pair_mem_prod.1 (h.action.function.1 acted)).2 productEntry first acted + have equal := agree.entry_eq h.action hk hx below composed second + exact equal ▸ acted + +end RecursiveCompressionInvariant + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.CodedRecursiveTaskAction +open SetFormula +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (s : CodedRecursiveTaskAction h T) (M : TransitiveGround.{u}) + +include s in +theorem exists_groundSuccessor + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (compatible : RecursiveRepresentativeCompatibility h T) + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) (hSs : Ss ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hA : A ∈ M.sets) (hT : T ∈ M.sets) : + ∃ next : h.NextInputs M, + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ + h.nextActionGraph T ∈ M.sets ∧ + PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) ∧ + h.liftGraph M next ∈ M.sets ∧ + ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ + h.groundLiftFamily M next ∈ M.sets ∧ + (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ + ∃ nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T), CodedRecursiveTaskAction nextInputs T := by + obtain ⟨next, hC, hrC, hμC, meet, graph, graphFunction, ground, family, entries, _⟩ := + h.exists_groundLiftEmbeddings M pairing unions powers separation hI hJ hD hrD + hQs hrs hμs hAs hEs hFs hSs hMaps hSources hReps hG hA + obtain ⟨hL, _, _, _, _, _⟩ := M.batchAttachment_ground_codes + pairing unions powers separation d hD hrD hJ hQs hrs hμs hAs hEs hFs + have nextAction := s.nextAction_code M next + have nextInputs := h.nextMapInputs_of_family M next family entries nextAction + exact ⟨next, hC, hrC, hμC, meet, + h.nextActionGraph_mem M pairing unions powers separation hI hJ hD hL + hQs hrs hAs hFs hSources hG hA hT, + nextAction, graph, graphFunction, ground, entries, + nextInputs, s.nextTaskAction_of_family M next compatible entries nextInputs⟩ + +end PartitionPilot.Forcing.CodedRecursiveTaskAction + + + +namespace PartitionPilot.Forcing.RecursiveCompressionInvariant + +universe u +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (state : RecursiveCompressionInvariant seed h) (s : CodedRecursiveTaskAction h T) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +include state s in +theorem nextAgreement {g k v : ZFSet.{u}} (hg : g ∈ G) (hk : k ∈ G) (hv : v ∈ P0) + (agree : ActionAgreementBelow P0 r0 A0 g k v) : + ActionAgreementBelow next.batchCarrier next.batchOrder (h.nextActionGraph T) g k v := by + let positive : ZFSet.{u} → Prop := fun i => ∃ F, ZFSet.pair i F ∈ Filters ∧ v ∈ F + apply s.nextAction_agreement M next ⟨g, hg⟩ ⟨k, hk⟩ + ⟨τ, state.originalSubset seed.top_mem⟩ state.top ⟨v, state.originalSubset hv⟩ positive + · intro i S a cap base w mapEntry source capEntry baseEntry notPositive meet + let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, h.maps.pair_source mapEntry⟩ + exact state.negative i S a (seed.filters.value index) cap base v w + mapEntry source (seed.filters.value_entry index) capEntry baseEntry hv + (fun member => notPositive ⟨seed.filters.value index, seed.filters.value_entry index, member⟩) meet + · exact state.agreement g hg k hk v hv agree + · intro i j k pos first second + obtain ⟨F, entry, member⟩ := pos + exact seed.positiveAgreement _ _ v i j k F agree entry member first second + +include state in +theorem nextNegative + (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ + i ∈ I ∧ f = h.liftSection M next i) + {i S a F cap base v w : ZFSet.{u}} + (mapEntry : ZFSet.pair i S ∈ h.groundLiftFamily M next) + (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair i F ∈ Filters) + (capEntry : ZFSet.pair τ cap ∈ S) (baseEntry : ZFSet.pair a base ∈ S) + (hv : v ∈ P0) (negative : v ∉ F) + (meet : ZFSet.pair (ZFSet.pair cap v) w ∈ next.batchMeetGraph) : + ZFSet.pair w base ∈ next.batchOrder := by + obtain ⟨hi, rfl⟩ := (entries i S).1 mapEntry + let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have oldMap := h.maps.value_entry index + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + have oldCap := (h.liftSection_old_iff M next oldMap (state.originalSubset seed.top_mem)).1 capEntry + have oldBase := (h.liftSection_old_iff M next oldMap ha).1 baseEntry + have embedding := h.valid i (h.maps.value index) oldMap + exact h.negative_cap_persists M next + (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 oldCap)).2 + (d.original_carrier_subset state.originalSubset hv) + (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 oldBase)).2 + (fun z entry => state.negative i (h.maps.value index) a F cap base v z + oldMap source filter oldCap oldBase hv negative entry) meet + +include state s in +theorem nextInvariant + (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ + i ∈ I ∧ f = h.liftSection M next i) + (nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T)) : RecursiveCompressionInvariant seed nextInputs where + originalSubset := d.original_carrier_subset state.originalSubset + originalOrder := fun _ hx _ hy => d.original_order_iff state.originalSubset state.originalOrder hx hy + originalMeet := fun _ hx _ hy _ => d.original_meet_iff state.originalSubset state.originalMeet hx hy + originalAction := fun _ _ hx _ => h.nextAction_original_iff state.originalSubset state.originalAction hx + top := d.coding.greatest_preserved (state.originalSubset seed.top_mem) state.top + agreement := fun _ hg _ hk _ hv agree => state.nextAgreement s M next hg hk hv agree + negative := fun _ _ _ _ _ _ _ _ mapEntry source filter capEntry baseEntry hv negative meet => + state.nextNegative M next entries mapEntry source filter capEntry baseEntry hv negative meet + +end PartitionPilot.Forcing.RecursiveCompressionInvariant + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure RecursiveGroundFields (M : TransitiveGround.{u}) + {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} + {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} + (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) : Prop where + carrier : D ∈ M.sets + order : rD ∈ M.sets + meet : μD ∈ M.sets + indices : J ∈ M.sets + spaces : Qs ∈ M.sets + relations : rs ∈ M.sets + meets : μs ∈ M.sets + anchors : As ∈ M.sets + embeddings : Es ∈ M.sets + filters : Fs ∈ M.sets + separators : Ss ∈ M.sets + maps : Maps ∈ M.sets + action : A ∈ M.sets + +namespace RecursiveGroundFields +variable {M : TransitiveGround.{u}} +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (ground : RecursiveGroundFields M h) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include ground pairing unions powers separation + +theorem current_codes : d.batchCarrier ∈ M.sets ∧ d.batchOrder ∈ M.sets ∧ + d.batchMeetGraph ∈ M.sets := by + obtain ⟨hL, hrL, hμL, _, _, _⟩ := M.batchAttachment_ground_codes + pairing unions powers separation d ground.carrier ground.order ground.indices + ground.spaces ground.relations ground.meets ground.anchors ground.embeddings ground.filters + exact ⟨hL, hrL, hμL⟩ + +theorem next_fields + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) : + h.nextIndices ∈ M.sets ∧ + pairSecondField I J h.nextIndices Qs ∈ M.sets ∧ + pairSecondField I J h.nextIndices rs ∈ M.sets ∧ + pairSecondField I J h.nextIndices μs ∈ M.sets ∧ + pairSecondField I J h.nextIndices As ∈ M.sets ∧ + M.groundPairCompositions h.nextIndices I J (familyPointBound Qs) D d.batchCarrier Es Maps ∈ M.sets ∧ + M.groundPairPushFilters h.nextIndices I J d.batchCarrier d.batchOrder Maps Fs ∈ M.sets ∧ + recursiveSeparatorFamily h.nextIndices I J D d.batchCarrier Maps Ss ∈ M.sets := by + obtain ⟨hL, hrL, _⟩ := ground.current_codes pairing unions powers separation + have hK := h.nextIndices_mem M pairing unions powers separation + hI ground.indices ground.carrier ground.filters hSources + have fields {F : ZFSet.{u}} (hF : F ∈ M.sets) : pairSecondField I J h.nextIndices F ∈ M.sets := + M.pairFieldGraph_mem pairing unions powers separation false hI ground.indices hK + (M.union_mem unions (M.union_mem unions hF)) hF + have subset := recursiveAttachmentIndices_subset I J D Fs.sUnion.sUnion Sources Fs + exact ⟨hK, fields ground.spaces, fields ground.relations, fields ground.meets, + fields ground.anchors, + (M.groundPairCompositions_spec pairing unions powers separation hK hI ground.indices + (M.familyPointBound_mem unions ground.spaces) ground.carrier hL ground.embeddings + ground.maps d.embeddings h.maps subset).1, + (M.groundPairPushFilters_spec pairing unions powers separation hK hI ground.indices + hL hrL ground.maps ground.filters h.maps d.filters subset).1, + M.recursiveSeparatorFamily_mem pairing unions powers separation hK hI ground.indices + ground.carrier hL ground.maps ground.separators⟩ + +theorem next_codes (next : h.NextInputs M) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) : + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets := by + obtain ⟨hL, hrL, _⟩ := ground.current_codes pairing unions powers separation + obtain ⟨hK, hQs, hrs, hμs, hAs, hEs, hFs, _⟩ := + ground.next_fields pairing unions powers separation hI hSources + obtain ⟨hC, hrC, hμC, _, _, _⟩ := M.batchAttachment_ground_codes + pairing unions powers separation next hL hrL hK hQs hrs hμs hAs hEs hFs + exact ⟨hC, hrC, hμC⟩ + +theorem next (next : h.NextInputs M) + (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T)) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : RecursiveGroundFields M inputs := by + obtain ⟨hL, hrL, hμL⟩ := ground.current_codes pairing unions powers separation + obtain ⟨hK, hQs, hrs, hμs, hAs, hEs, hFs, hSs⟩ := + ground.next_fields pairing unions powers separation hI hSources + obtain ⟨hC, _, _⟩ := ground.next_codes pairing unions powers separation next hI hSources + have maps := (h.groundLiftFamily_spec M pairing unions powers separation next + hI ground.indices ground.carrier hL hC ground.spaces ground.relations ground.anchors + ground.maps hSources ground.filters hReps hG ground.action).2.1 + have action := h.nextActionGraph_mem M pairing unions powers separation + hI ground.indices ground.carrier hL ground.spaces ground.relations ground.anchors + ground.filters hSources hG ground.action hT + exact ⟨hL, hrL, hμL, hK, hQs, hrs, hμs, hAs, hEs, hFs, hSs, maps, action⟩ + +end RecursiveGroundFields + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.RecursiveCompressionInvariant +open SetFormula +universe u +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A} +variable (state : RecursiveCompressionInvariant seed h) (s : CodedRecursiveTaskAction h T) +variable (M : TransitiveGround.{u}) +include state s + +theorem exists_groundNext + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (ground : RecursiveGroundFields M h) + (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hT : T ∈ M.sets) : + ∃ next : h.NextInputs M, + ∃ nextInputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T), + CodedRecursiveTaskAction nextInputs T ∧ RecursiveCompressionInvariant seed nextInputs ∧ + RecursiveGroundFields M nextInputs := by + obtain ⟨next, _, _, _, _, _, _, _, _, _, entries, nextInputs, nextTask⟩ := + s.exists_groundSuccessor M pairing unions powers separation (state.compatible s) + hI ground.indices ground.carrier ground.order ground.spaces ground.relations ground.meets + ground.anchors ground.embeddings ground.filters ground.separators ground.maps + hSources hReps hG ground.action hT + exact ⟨next, nextInputs, nextTask, state.nextInvariant s M next entries nextInputs, + ground.next pairing unions powers separation next nextInputs hI hSources hReps hG hT⟩ + +end PartitionPilot.Forcing.RecursiveCompressionInvariant + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLayerBirthFibers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLayerBirthFibers.lean index ecf9738ffa1a2069ee11d755e3e4b4cb99677d18..3e940232627fce029b2db99be8dee70a6016d7e7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLayerBirthFibers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLayerBirthFibers.lean @@ -1,74 +1,74 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ParentSupportCodes - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def layerBirthFiber (L birth t : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun x => ZFSet.pair x t ∈ birth) L - -theorem mem_layerBirthFiber (L birth t x : ZFSet.{u}) : - x ∈ layerBirthFiber L birth t ↔ x ∈ L ∧ ZFSet.pair x t ∈ birth := ZFSet.mem_sep - -namespace BoundedFormula - -def layerBirthFiberFormula {n} (F L birth t : Fin n) : BoundedFormula n := - .conj (.allMem F (.mem 0 L.succ)) (.allMem L - (.conj (imp (.mem 0 F.succ) (pairMembershipFormula 0 t.succ birth.succ)) - (imp (pairMembershipFormula 0 t.succ birth.succ) (.mem 0 F.succ)))) - -theorem truth_layerBirthFiberFormula {n} (F L birth t : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (layerBirthFiberFormula F L birth t) env ↔ - env F = layerBirthFiber (env L) (env birth) (env t) := by - simp only [layerBirthFiberFormula, Truth, truth_imp, truth_pairMembershipFormula] - change ((∀ x ∈ env F, x ∈ env L) ∧ ∀ x ∈ env L, - (x ∈ env F → ZFSet.pair x (env t) ∈ env birth) ∧ - (ZFSet.pair x (env t) ∈ env birth → x ∈ env F)) ↔ _ - constructor - · rintro ⟨subset, spec⟩ - apply ZFSet.ext - intro x - rw [mem_layerBirthFiber] - exact ⟨fun hx => ⟨subset x hx, (spec x (subset x hx)).1 hx⟩, - fun ⟨hx, born⟩ => (spec x hx).2 born⟩ - · intro eq - rw [eq] - exact ⟨fun _ hx => (mem_layerBirthFiber _ _ _ _).1 hx |>.1, - fun x hx => ⟨fun born => (mem_layerBirthFiber _ _ _ _).1 born |>.2, - fun born => (mem_layerBirthFiber _ _ _ _).2 ⟨hx, born⟩⟩⟩ - -theorem realize_layerBirthFiberFormula (M : TransitiveGround.{u}) {n} - (F L birth t : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (layerBirthFiberFormula F L birth t).toFormula env ↔ - env F = layerBirthFiber (env L) (env birth) (env t) := - (realize_toFormula M _ env members).trans (truth_layerBirthFiberFormula F L birth t env) -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem layerBirthFiber_mem (separation : SeparationSchema M.sets) {L birth t : ZFSet.{u}} - (hL : L ∈ M.sets) (hBirth : birth ∈ M.sets) (ht : t ∈ M.sets) : - layerBirthFiber L birth t ∈ M.sets := by - let params := extend t (extend birth Fin.elim0) - have selected := M.bounded_separation_mem separation (BoundedFormula.pairMembershipFormula 0 1 2) - params (Fin.cases ht (Fin.cases hBirth (fun i => Fin.elim0 i))) hL - have eq : ZFSet.sep (fun x => BoundedFormula.Truth (BoundedFormula.pairMembershipFormula 0 1 2) - (extend x params)) L = layerBirthFiber L birth t := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, mem_layerBirthFiber] - exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 0 1 2 _) - exact eq ▸ selected -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ParentSupportCodes + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def layerBirthFiber (L birth t : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun x => ZFSet.pair x t ∈ birth) L + +theorem mem_layerBirthFiber (L birth t x : ZFSet.{u}) : + x ∈ layerBirthFiber L birth t ↔ x ∈ L ∧ ZFSet.pair x t ∈ birth := ZFSet.mem_sep + +namespace BoundedFormula + +def layerBirthFiberFormula {n} (F L birth t : Fin n) : BoundedFormula n := + .conj (.allMem F (.mem 0 L.succ)) (.allMem L + (.conj (imp (.mem 0 F.succ) (pairMembershipFormula 0 t.succ birth.succ)) + (imp (pairMembershipFormula 0 t.succ birth.succ) (.mem 0 F.succ)))) + +theorem truth_layerBirthFiberFormula {n} (F L birth t : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (layerBirthFiberFormula F L birth t) env ↔ + env F = layerBirthFiber (env L) (env birth) (env t) := by + simp only [layerBirthFiberFormula, Truth, truth_imp, truth_pairMembershipFormula] + change ((∀ x ∈ env F, x ∈ env L) ∧ ∀ x ∈ env L, + (x ∈ env F → ZFSet.pair x (env t) ∈ env birth) ∧ + (ZFSet.pair x (env t) ∈ env birth → x ∈ env F)) ↔ _ + constructor + · rintro ⟨subset, spec⟩ + apply ZFSet.ext + intro x + rw [mem_layerBirthFiber] + exact ⟨fun hx => ⟨subset x hx, (spec x (subset x hx)).1 hx⟩, + fun ⟨hx, born⟩ => (spec x hx).2 born⟩ + · intro eq + rw [eq] + exact ⟨fun _ hx => (mem_layerBirthFiber _ _ _ _).1 hx |>.1, + fun x hx => ⟨fun born => (mem_layerBirthFiber _ _ _ _).1 born |>.2, + fun born => (mem_layerBirthFiber _ _ _ _).2 ⟨hx, born⟩⟩⟩ + +theorem realize_layerBirthFiberFormula (M : TransitiveGround.{u}) {n} + (F L birth t : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (layerBirthFiberFormula F L birth t).toFormula env ↔ + env F = layerBirthFiber (env L) (env birth) (env t) := + (realize_toFormula M _ env members).trans (truth_layerBirthFiberFormula F L birth t env) +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem layerBirthFiber_mem (separation : SeparationSchema M.sets) {L birth t : ZFSet.{u}} + (hL : L ∈ M.sets) (hBirth : birth ∈ M.sets) (ht : t ∈ M.sets) : + layerBirthFiber L birth t ∈ M.sets := by + let params := extend t (extend birth Fin.elim0) + have selected := M.bounded_separation_mem separation (BoundedFormula.pairMembershipFormula 0 1 2) + params (Fin.cases ht (Fin.cases hBirth (fun i => Fin.elim0 i))) hL + have eq : ZFSet.sep (fun x => BoundedFormula.Truth (BoundedFormula.pairMembershipFormula 0 1 2) + (extend x params)) L = layerBirthFiber L birth t := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, mem_layerBirthFiber] + exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 0 1 2 _) + exact eq ▸ selected +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageCodeLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageCodeLaws.lean index 38c6ee7bc177a5d0a387bc82c5d2fe47baac1f91..36d6b6eae23754649335ff93771990a8bc3a65ac 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageCodeLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageCodeLaws.lean @@ -1,515 +1,515 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.SerializedChronologyFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -noncomputable def serializedChronologyCode (T V : ZFSet.{u}) (graphs : Fin 5 → ZFSet.{u}) - (W layers : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 2 (Fin.cases (nonemptyTupleCode 6 (Fin.cases T (Fin.cases V graphs))) - (Fin.cases W (fun _ => layers))) - -theorem GroundSerializedChronology.code_eq_literal {M : TransitiveGround.{u}} - {T C D rD : ZFSet.{u}} (serial : GroundSerializedChronology M T C D rD) : - serial.code = serializedChronologyCode T serial.fields.bound serial.fields.graph - serial.layerBound serial.layers := rfl - -theorem SerializedChronologyCode.toGround_code {M : TransitiveGround.{u}} - {T V C D rD N W layers : ZFSet.{u}} {graphs : Fin 5 → ZFSet.{u}} - (code : SerializedChronologyCode T V C D rD N graphs W layers) - (hT : T ∈ M.sets) (hV : V ∈ M.sets) (hGraphs : ∀ j, graphs j ∈ M.sets) - (hW : W ∈ M.sets) (hLayers : layers ∈ M.sets) (omega : N = ZFSet.omega) : - (code.toGround hT hV hGraphs hW hLayers omega).code = - serializedChronologyCode T V graphs W layers := rfl - -namespace BoundedFormula -def serializedChronologyTupleFormula {n} (z history T V : Fin n) (graphs : Fin 5 → Fin n) - (W layers : Fin n) : BoundedFormula n := - .conj (nonemptyTupleFormula 6 history (Fin.cases T (Fin.cases V graphs))) - (nonemptyTupleFormula 2 z (Fin.cases history (Fin.cases W (fun _ => layers)))) - -theorem truth_serializedChronologyTupleFormula {n} (z history T V : Fin n) - (graphs : Fin 5 → Fin n) (W layers : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (serializedChronologyTupleFormula z history T V graphs W layers) env ↔ - env history = nonemptyTupleCode 6 (Fin.cases (env T) (Fin.cases (env V) (fun j => env (graphs j)))) ∧ - env z = serializedChronologyCode (env T) (env V) (fun j => env (graphs j)) (env W) (env layers) := by - simp only [serializedChronologyTupleFormula, Truth, truth_nonemptyTupleFormula] - have map2 {k : Nat} (a : Fin n) (f : Fin k → Fin n) : - (fun j => env (Fin.cases a f j)) = Fin.cases (env a) (fun j => env (f j)) := by - funext j - exact Fin.cases rfl (fun _ => rfl) j - simp only [map2] - constructor - · rintro ⟨history, code⟩ - rw [history] at code - exact ⟨history, code⟩ - · rintro ⟨history, code⟩ - unfold serializedChronologyCode at code - rw [← history] at code - exact ⟨history, code⟩ - -end BoundedFormula - -end - -section -open SetFormula -universe u v - -def chronologyCandidateGraphs {A : Type v} (fields : Fin 10 → A) : Fin 5 → A := - Fin.cases (fields 2) (Fin.cases (fields 3) (Fin.cases (fields 4) - (Fin.cases (fields 5) (fun _ => fields 6)))) - -namespace SetFormula -def serializedChronologyCandidateFormula {n} (z C D rD N : Fin n) : SetFormula n := - let old := suffixIndex n 10 - let field := prefixIndex n 10 - let graphs := chronologyCandidateGraphs field - exBlock 10 (.conj - (BoundedFormula.serializedChronologyTupleFormula (old z) (field 9) (field 0) (field 1) - graphs (field 7) (field 8)).toFormula - (serializedChronologyFormula (field 0) (field 1) (old C) (old D) (old rD) (old N) - graphs (field 7) (field 8))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_serializedChronologyCandidateFormula_raw {n} (z C D rD N : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (serializedChronologyCandidateFormula z C D rD N) env ↔ - ∃ fields : Fin 10 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ - fields 9 = nonemptyTupleCode 6 (Fin.cases (fields 0) (Fin.cases (fields 1) - (chronologyCandidateGraphs fields))) ∧ - env z = serializedChronologyCode (fields 0) (fields 1) - (chronologyCandidateGraphs fields) (fields 7) (fields 8) ∧ - SerializedChronologyCode (fields 0) (fields 1) (env C) (env D) (env rD) (env N) - (chronologyCandidateGraphs fields) (fields 7) (fields 8) := by - rw [serializedChronologyCandidateFormula, realize_exBlock] - let old := suffixIndex n 10 - let field := prefixIndex n 10 - let graphs := chronologyCandidateGraphs field - have actual (values : Fin 10 → ZFSet.{u}) (ground : ∀ j, values j ∈ M.sets) : - (Realize M.sets - (BoundedFormula.serializedChronologyTupleFormula (old z) (field 9) (field 0) (field 1) - graphs (field 7) (field 8)).toFormula (extendMany 10 values env) ∧ - Realize M.sets - (serializedChronologyFormula (field 0) (field 1) (old C) (old D) (old rD) (old N) - graphs (field 7) (field 8)) (extendMany 10 values env)) ↔ - values 9 = nonemptyTupleCode 6 (Fin.cases (values 0) (Fin.cases (values 1) - (chronologyCandidateGraphs values))) ∧ - env z = serializedChronologyCode (values 0) (values 1) - (chronologyCandidateGraphs values) (values 7) (values 8) ∧ - SerializedChronologyCode (values 0) (values 1) (env C) (env D) (env rD) (env N) - (chronologyCandidateGraphs values) (values 7) (values 8) := by - have mems := extendMany_members 10 values env ground members - have tuple := (BoundedFormula.realize_toFormula M _ _ mems).trans - (BoundedFormula.truth_serializedChronologyTupleFormula (old z) (field 9) (field 0) - (field 1) graphs (field 7) (field 8) (extendMany 10 values env)) - have code := M.realize_serializedChronologyFormula pairing unions powers separation - (field 0) (field 1) (old C) (old D) (old rD) (old N) graphs (field 7) (field 8) - (extendMany 10 values env) mems - have graphMap : (fun j => extendMany 10 values env (graphs j)) = chronologyCandidateGraphs values := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j - rw [tuple, code, graphMap] - simp only [field, old, extendMany_prefix, extendMany_suffix, and_assoc] - constructor - · rintro ⟨fields, ground, recognized⟩ - exact ⟨fields, ground, (actual fields ground).1 recognized⟩ - · rintro ⟨fields, ground, recognized⟩ - exact ⟨fields, ground, (actual fields ground).2 recognized⟩ - -theorem realize_serializedChronologyCandidateFormula {n} (z C D rD N : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : - Realize M.sets (serializedChronologyCandidateFormula z C D rD N) env ↔ - ∃ T, ∃ serial : GroundSerializedChronology M T (env C) (env D) (env rD), serial.code = env z := by - rw [M.realize_serializedChronologyCandidateFormula_raw pairing unions powers separation z C D rD N env members] - constructor - · rintro ⟨fields, ground, _, equal, code⟩ - have hGraphs : ∀ j, chronologyCandidateGraphs fields j ∈ M.sets := - Fin.cases (ground 2) (Fin.cases (ground 3) (Fin.cases (ground 4) - (Fin.cases (ground 5) (fun _ => ground 6)))) - exact ⟨fields 0, code.toGround (ground 0) (ground 1) hGraphs (ground 7) (ground 8) omega, - (code.toGround_code (ground 0) (ground 1) hGraphs (ground 7) (ground 8) omega).trans equal.symm⟩ - · rintro ⟨T, serial, equal⟩ - let fields : Fin 10 → ZFSet.{u} := Fin.cases T (Fin.cases serial.fields.bound - (Fin.cases (serial.fields.graph 0) (Fin.cases (serial.fields.graph 1) - (Fin.cases (serial.fields.graph 2) (Fin.cases (serial.fields.graph 3) - (Fin.cases (serial.fields.graph 4) (Fin.cases serial.layerBound - (Fin.cases serial.layers (fun _ => serial.fields.code))))))))) - have ground : ∀ j, fields j ∈ M.sets := Fin.cases serial.fields.time_ground - (Fin.cases serial.fields.bound_ground (Fin.cases (serial.fields.graph_ground 0) - (Fin.cases (serial.fields.graph_ground 1) (Fin.cases (serial.fields.graph_ground 2) - (Fin.cases (serial.fields.graph_ground 3) (Fin.cases (serial.fields.graph_ground 4) - (Fin.cases serial.layer_bound_ground (Fin.cases serial.layers_ground - (fun _ => serial.fields.code_ground pairing))))))))) - have graphEq : chronologyCandidateGraphs fields = serial.fields.graph := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun i => Fin.elim0 i))))) j - refine ⟨fields, ground, ?_, ?_, ?_⟩ - · rw [graphEq] - rfl - · rw [graphEq] - exact equal.symm.trans serial.code_eq_literal - · rw [graphEq, omega] - exact serial.raw_code - -noncomputable def serializedChronologyCandidates (B C D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ T, ∃ serial : GroundSerializedChronology M T C D rD, serial.code = z) B - -omit pairing unions powers separation in -theorem mem_serializedChronologyCandidates (B C D rD z : ZFSet.{u}) : - z ∈ M.serializedChronologyCandidates B C D rD ↔ - z ∈ B ∧ ∃ T, ∃ serial : GroundSerializedChronology M T C D rD, serial.code = z := ZFSet.mem_sep - -theorem serializedChronologyCandidates_mem - (infinite : Realize M.sets infinity Fin.elim0) {B C D rD : ZFSet.{u}} - (hB : B ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - M.serializedChronologyCandidates B C D rD ∈ M.sets := by - let params := extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))) - have ground : ∀ i, params i ∈ M.sets := Fin.cases hC (Fin.cases hD (Fin.cases hrD - (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))) - have selected := M.separation_mem separation (serializedChronologyCandidateFormula 0 1 2 3 4) - params ground hB - have equal : ZFSet.sep (fun z => Realize M.sets (serializedChronologyCandidateFormula 0 1 2 3 4) - (extend z params)) B = M.serializedChronologyCandidates B C D rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_serializedChronologyCandidates] - apply and_congr_right - intro hz - exact M.realize_serializedChronologyCandidateFormula pairing unions powers separation - 0 1 2 3 4 (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl - exact equal ▸ selected - -omit pairing unions powers separation in -theorem serializedChronology_code_mem_candidates {B T C D rD : ZFSet.{u}} - (serial : GroundSerializedChronology M T C D rD) (bound : serial.code ∈ B) : - serial.code ∈ M.serializedChronologyCandidates B C D rD := - (M.mem_serializedChronologyCandidates B C D rD serial.code).2 ⟨bound, T, serial, rfl⟩ - -end TransitiveGround - -def linkedChronologyGraphs {A : Type v} (f : Fin 24 → A) : Fin 5 → A := - Fin.cases (f 14) (Fin.cases (f 15) (Fin.cases (f 16) (Fin.cases (f 17) (fun _ => f 18)))) - -def LinkedMainStageRawCode (M : TransitiveGround.{u}) (K Labels C D rD N z : ZFSet.{u}) - (f : Fin 24 → ZFSet.{u}) : Prop := - z = linkedMainStageCode (f 22) (f 11) (f 23) ∧ - f 22 = mainStageCode (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8) (f 9) (f 10) ∧ - MainStageValidity M (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8) (f 9) (f 10) C D rD ∧ - f 21 = nonemptyTupleCode 6 (Fin.cases (f 12) (Fin.cases (f 13) (linkedChronologyGraphs f))) ∧ - f 23 = serializedChronologyCode (f 12) (f 13) (linkedChronologyGraphs f) (f 19) (f 20) ∧ - SerializedChronologyCode (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20) ∧ - ordinalSetProperty (f 11) ∧ f 12 = insert (f 11) (f 11) ∧ - ZFSet.pair (f 11) (f 0) ∈ f 14 ∧ ZFSet.pair (f 11) (f 1) ∈ f 15 ∧ - ZFSet.pair (f 11) (f 2) ∈ f 16 ∧ ZFSet.pair (f 11) (f 10) ∈ f 18 ∧ - LinkedMainInvariantCode M K Labels C D (f 0) (f 3) (f 11) (f 23) - -namespace BoundedFormula - -def linkedMainStageTupleFormula {n} (z a t h : Fin n) : BoundedFormula n := - nonemptyTupleFormula 2 z (Fin.cases a (Fin.cases t (fun _ => h))) - -theorem truth_linkedMainStageTupleFormula {n} (z a t h : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (linkedMainStageTupleFormula z a t h) env ↔ - env z = linkedMainStageCode (env a) (env t) (env h) := by - rw [linkedMainStageTupleFormula, truth_nonemptyTupleFormula] - have map : (fun j : Fin 3 => env (Fin.cases a (Fin.cases t (fun _ => h)) j)) = - Fin.cases (env a) (Fin.cases (env t) (fun _ => env h)) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun _ => rfl)) j - rw [map] - rfl - -def linkedTerminalFormula {n} (t T P r μ h : Fin n) (graphs : Fin 5 → Fin n) : BoundedFormula n := - .conj (ordinalFormula t) (.conj (successorFormula T t) - (.conj (pairMembershipFormula t P (graphs 0)) (.conj (pairMembershipFormula t r (graphs 1)) - (.conj (pairMembershipFormula t μ (graphs 2)) (pairMembershipFormula t h (graphs 4)))))) - -theorem truth_linkedTerminalFormula {n} (t T P r μ h : Fin n) (graphs : Fin 5 → Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (linkedTerminalFormula t T P r μ h graphs) env ↔ - ordinalSetProperty (env t) ∧ env T = insert (env t) (env t) ∧ - ZFSet.pair (env t) (env P) ∈ env (graphs 0) ∧ - ZFSet.pair (env t) (env r) ∈ env (graphs 1) ∧ - ZFSet.pair (env t) (env μ) ∈ env (graphs 2) ∧ - ZFSet.pair (env t) (env h) ∈ env (graphs 4) := by - simp only [linkedTerminalFormula, Truth, truth_ordinalFormula, truth_successorFormula, - truth_pairMembershipFormula, ← ordinalSetProperty_iff] -end BoundedFormula - -namespace SetFormula - -def linkedMainStageRawFormula {n} (K Labels C D rD N z : Fin n) (f : Fin 24 → Fin n) : SetFormula n := - .conj (BoundedFormula.linkedMainStageTupleFormula z (f 22) (f 11) (f 23)).toFormula - (.conj (validMainStageCodeFormula (f 22) (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) - (f 7) (f 8) (f 9) (f 10) C D rD N) - (.conj (BoundedFormula.serializedChronologyTupleFormula (f 23) (f 21) (f 12) (f 13) - (linkedChronologyGraphs f) (f 19) (f 20)).toFormula - (.conj (serializedChronologyFormula (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20)) - (.conj (BoundedFormula.linkedTerminalFormula (f 11) (f 12) (f 0) (f 1) (f 2) (f 10) - (linkedChronologyGraphs f)).toFormula - (linkedMainInvariantFormula K Labels C D (f 0) (f 3) (f 11) (f 23)))))) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_linkedMainStageRawFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N z : Fin n) - (f : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedMainStageRawFormula K Labels C D rD N z f) env ↔ - LinkedMainStageRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) (env z) - (fun j => env (f j)) := by - have outer := (BoundedFormula.realize_toFormula M _ env members).trans - (BoundedFormula.truth_linkedMainStageTupleFormula z (f 22) (f 11) (f 23) env) - have stage := M.realize_validMainStageCodeFormula pairing unions powers separation - (f 22) (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8) (f 9) (f 10) C D rD N env members omega - have tuple := (BoundedFormula.realize_toFormula M _ env members).trans - (BoundedFormula.truth_serializedChronologyTupleFormula (f 23) (f 21) (f 12) (f 13) - (linkedChronologyGraphs f) (f 19) (f 20) env) - have serial := M.realize_serializedChronologyFormula pairing unions powers separation - (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20) env members - have terminal := (BoundedFormula.realize_toFormula M _ env members).trans - (BoundedFormula.truth_linkedTerminalFormula (f 11) (f 12) (f 0) (f 1) (f 2) (f 10) - (linkedChronologyGraphs f) env) - have invariant := M.realize_linkedMainInvariantFormula pairing unions powers separation collection - K Labels C D (f 0) (f 3) (f 11) (f 23) env members ordinal - have map : (fun j => env (linkedChronologyGraphs f j)) = linkedChronologyGraphs (fun j => env (f j)) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j - change (Realize M.sets (BoundedFormula.linkedMainStageTupleFormula z (f 22) (f 11) (f 23)).toFormula env ∧ - Realize M.sets (validMainStageCodeFormula (f 22) (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) - (f 7) (f 8) (f 9) (f 10) C D rD N) env ∧ - Realize M.sets (BoundedFormula.serializedChronologyTupleFormula (f 23) (f 21) (f 12) (f 13) - (linkedChronologyGraphs f) (f 19) (f 20)).toFormula env ∧ - Realize M.sets (serializedChronologyFormula (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20)) env ∧ - Realize M.sets (BoundedFormula.linkedTerminalFormula (f 11) (f 12) (f 0) (f 1) (f 2) (f 10) - (linkedChronologyGraphs f)).toFormula env ∧ - Realize M.sets (linkedMainInvariantFormula K Labels C D (f 0) (f 3) (f 11) (f 23)) env) ↔ _ - rw [outer, stage, tuple, serial, terminal, invariant, map] - simp only [LinkedMainStageRawCode, and_assoc] - rfl - -end TransitiveGround - -end - -section -open SetFormula -universe u - -namespace LinkedMainStageRawCode -variable {M : TransitiveGround.{u}} {K Labels C D rD N z : ZFSet.{u}} {f : Fin 24 → ZFSet.{u}} - -theorem exists_linked - (raw : LinkedMainStageRawCode M K Labels C D rD N z f) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (ground : ∀ j, f j ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (omega : N = ZFSet.omega) : - ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z := by - obtain ⟨outer, stageEq, valid, _, serialEq, code, ordinal, domain, eP, er, eμ, eh, inv⟩ := raw - let stage := GroundMainStage.ofValidity pairing unions powers separation - (ground 0) (ground 1) (ground 2) (ground 3) (ground 4) (ground 5) (ground 7) (ground 10) hC hD hrD valid - have code' : SerializedChronologyCode (insert (f 11) (f 11)) (f 13) C D rD N - (linkedChronologyGraphs f) (f 19) (f 20) := domain ▸ code - have graphsGround : ∀ j, linkedChronologyGraphs f j ∈ M.sets := - Fin.cases (ground 14) (Fin.cases (ground 15) (Fin.cases (ground 16) - (Fin.cases (ground 17) (fun _ => ground 18)))) - let serial := code'.toGround (domain ▸ ground 12) (ground 13) graphsGround (ground 19) (ground 20) omega - let main : GroundChronologicalMainStage M C D rD := - { stage := stage - cutoff := f 11 - cutoff_ground := ground 11 - cutoff_ordinal := ordinal - history := serial.toHistory - carrier_eq := serial.fields.value_eq_of_entry 0 eP - order_eq := serial.fields.value_eq_of_entry 1 er - meet_eq := serial.fields.value_eq_of_entry 2 eμ - height_eq := serial.fields.value_eq_of_entry 4 eh } - have serialCode : serial.code = f 23 := by - change serializedChronologyCode (insert (f 11) (f 11)) (f 13) (linkedChronologyGraphs f) (f 19) (f 20) = f 23 - rw [← domain] - exact serialEq.symm - obtain ⟨ps, gs, ls, pr, gr, lr, tm, cr, dr, sr⟩ := inv - let linked : GroundLinkedMainStage M K Labels C D rD := - { main := main - serial := serial - agreement := fun j _ _ => Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j - invariant := ⟨ps, gs, ls, pr, gr, lr, tm, cr, dr⟩ - serial_rank := serialCode ▸ sr } - refine ⟨linked, ?_⟩ - change linkedMainStageCode stage.code (f 11) serial.code = z - have scode : stage.code = f 22 := stageEq.symm - rw [scode, serialCode] - exact outer.symm - -end LinkedMainStageRawCode - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (linked : GroundLinkedMainStage M K Labels C D rD) - -noncomputable def rawFields : Fin 24 → ZFSet.{u} := - (Fin.cases (linked.main.stage.carrier) (Fin.cases (linked.main.stage.order) (Fin.cases (linked.main.stage.meetGraph) (Fin.cases (linked.main.stage.actors) (Fin.cases (linked.main.stage.multiplication) (Fin.cases (linked.main.stage.inverse) (Fin.cases (linked.main.stage.identity) (Fin.cases (linked.main.stage.action) (Fin.cases (linked.main.stage.bottom) (Fin.cases (linked.main.stage.top) (Fin.cases (linked.main.stage.height) (Fin.cases (linked.main.cutoff) (Fin.cases (insert linked.main.cutoff linked.main.cutoff) (Fin.cases (linked.serial.fields.bound) (Fin.cases (linked.serial.fields.graph 0) (Fin.cases (linked.serial.fields.graph 1) (Fin.cases (linked.serial.fields.graph 2) (Fin.cases (linked.serial.fields.graph 3) (Fin.cases (linked.serial.fields.graph 4) (Fin.cases (linked.serial.layerBound) (Fin.cases (linked.serial.layers) (Fin.cases (linked.serial.fields.code) (Fin.cases (linked.main.stage.code) (fun _ => linked.serial.code)))))))))))))))))))))))) - -theorem rawFields_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - ∀ j, linked.rawFields j ∈ M.sets := - (Fin.cases (linked.main.stage.carrier_ground) (Fin.cases (linked.main.stage.order_ground) (Fin.cases (linked.main.stage.meet_ground) (Fin.cases (linked.main.stage.actors_ground) (Fin.cases (linked.main.stage.multiplication_ground) (Fin.cases (linked.main.stage.inverse_ground) (Fin.cases (linked.main.stage.identity_ground) (Fin.cases (linked.main.stage.action_ground) (Fin.cases (linked.main.stage.bottom_ground) (Fin.cases (linked.main.stage.top_ground) (Fin.cases (linked.main.stage.height_ground) (Fin.cases (linked.main.cutoff_ground) (Fin.cases (linked.serial.fields.time_ground) (Fin.cases (linked.serial.fields.bound_ground) (Fin.cases (linked.serial.fields.graph_ground 0) (Fin.cases (linked.serial.fields.graph_ground 1) (Fin.cases (linked.serial.fields.graph_ground 2) (Fin.cases (linked.serial.fields.graph_ground 3) (Fin.cases (linked.serial.fields.graph_ground 4) (Fin.cases (linked.serial.layer_bound_ground) (Fin.cases (linked.serial.layers_ground) (Fin.cases (linked.serial.fields.code_ground pairing) (Fin.cases (linked.main.stage.code_mem pairing) (fun _ => linked.serial.code_ground pairing)))))))))))))))))))))))) - -theorem rawFields_graphs : linkedChronologyGraphs linked.rawFields = linked.serial.fields.graph := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (fun i => Fin.elim0 i))))) j - -theorem rawFields_code : LinkedMainStageRawCode M K Labels C D rD ZFSet.omega linked.code linked.rawFields := by - unfold LinkedMainStageRawCode - rw [linked.rawFields_graphs] - refine ⟨rfl, rfl, linked.main.stage.validity, rfl, rfl, linked.serial.raw_code, - linked.main.cutoff_ordinal, rfl, ?_, ?_, ?_, ?_, linked.invariant_code⟩ - · change ZFSet.pair linked.main.cutoff linked.main.stage.carrier ∈ linked.serial.fields.graph 0 - rw [← linked.terminal_values.1] - exact linked.serial.fields.value_entry 0 (ZFSet.mem_insert _ _) - · change ZFSet.pair linked.main.cutoff linked.main.stage.order ∈ linked.serial.fields.graph 1 - rw [← linked.terminal_values.2.1] - exact linked.serial.fields.value_entry 1 (ZFSet.mem_insert _ _) - · change ZFSet.pair linked.main.cutoff linked.main.stage.meetGraph ∈ linked.serial.fields.graph 2 - rw [← linked.terminal_values.2.2.1] - exact linked.serial.fields.value_entry 2 (ZFSet.mem_insert _ _) - · change ZFSet.pair linked.main.cutoff linked.main.stage.height ∈ linked.serial.fields.graph 4 - rw [← linked.terminal_values.2.2.2.2] - exact linked.serial.fields.value_entry 4 (ZFSet.mem_insert _ _) - -end GroundLinkedMainStage - -namespace LinkedMainStageRawCode -variable {M : TransitiveGround.{u}} {K Labels C D rD N z : ZFSet.{u}} -variable {f g : Fin 24 → ZFSet.{u}} - -theorem fields_unique (first : LinkedMainStageRawCode M K Labels C D rD N z f) - (second : LinkedMainStageRawCode M K Labels C D rD N z g) : f = g := by - obtain ⟨fo, fa, _, fh, fs, _⟩ := first - obtain ⟨go, ga, _, gh, gs, _⟩ := second - have outer := linkedMainStageCode_inj.1 (fo.symm.trans go) - have stage := nonemptyTupleCode_injective 10 (fa.symm.trans (outer.1.trans ga)) - have serial := nonemptyTupleCode_injective 2 (fs.symm.trans (outer.2.2.trans gs)) - have history := nonemptyTupleCode_injective 6 (congrFun serial 0) - have h21 : f 21 = g 21 := fh.trans ((congrFun serial 0).trans gh.symm) - funext j - exact (show ∀ j : Fin 24, f j = g j from (Fin.cases (congrFun stage 0) (Fin.cases (congrFun stage 1) (Fin.cases (congrFun stage 2) (Fin.cases (congrFun stage 3) (Fin.cases (congrFun stage 4) (Fin.cases (congrFun stage 5) (Fin.cases (congrFun stage 6) (Fin.cases (congrFun stage 7) (Fin.cases (congrFun stage 8) (Fin.cases (congrFun stage 9) (Fin.cases (congrFun stage 10) (Fin.cases (outer.2.1) (Fin.cases (congrFun history 0) (Fin.cases (congrFun history 1) (Fin.cases (congrFun history 2) (Fin.cases (congrFun history 3) (Fin.cases (congrFun history 4) (Fin.cases (congrFun history 5) (Fin.cases (congrFun history 6) (Fin.cases (congrFun serial 1) (Fin.cases (congrFun serial 2) (Fin.cases (h21) (Fin.cases (outer.1) (Fin.cases (outer.2.2) (fun i => Fin.elim0 i)))))))))))))))))))))))))) j - -theorem exists_linked_fields - (raw : LinkedMainStageRawCode M K Labels C D rD N z f) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (ground : ∀ j, f j ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (omega : N = ZFSet.omega) : - ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z ∧ linked.rawFields = f := by - obtain ⟨linked, equal⟩ := raw.exists_linked pairing unions powers separation ground hC hD hrD omega - refine ⟨linked, equal, ?_⟩ - rw [omega] at raw - have actual := linked.rawFields_code - rw [equal] at actual - exact actual.fields_unique raw - -end LinkedMainStageRawCode -end - -namespace GroundLinkedMainStage -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} - -structure SameCode (first second : GroundLinkedMainStage M K Labels C D rD) : Prop where - stage : first.main.stage = second.main.stage - cutoff : first.main.cutoff = second.main.cutoff - serial_code : first.serial.code = second.serial.code - raw_fields : first.rawFields = second.rawFields - field_graphs : first.serial.fields.graph = second.serial.fields.graph - -theorem same_code (first second : GroundLinkedMainStage M K Labels C D rD) - (equal : first.code = second.code) : SameCode first second := by - have outer := linkedMainStageCode_inj.1 equal - have other : LinkedMainStageRawCode M K Labels C D rD ZFSet.omega first.code second.rawFields := - equal.symm ▸ second.rawFields_code - have fields := first.rawFields_code.fields_unique other - refine ⟨GroundMainStage.code_injective outer.1, outer.2.1, outer.2.2, fields, ?_⟩ - rw [← first.rawFields_graphs, ← second.rawFields_graphs, fields] - -namespace SameCode -variable {first second : GroundLinkedMainStage M K Labels C D rD} -variable (same : SameCode first second) -include same - -theorem field_bound : first.serial.fields.bound = second.serial.fields.bound := - congrFun same.raw_fields 13 - -theorem layer_bound : first.serial.layerBound = second.serial.layerBound := - congrFun same.raw_fields 19 - -theorem layers : first.serial.layers = second.serial.layers := - congrFun same.raw_fields 20 - -theorem serial_values (j : Fin 5) (s : ZFSet.{u}) : - first.serial.fields.value j s = second.serial.fields.value j s := by - classical - by_cases hs : s ∈ insert first.main.cutoff first.main.cutoff - · have entry := first.serial.fields.value_entry j hs - rw [same.field_graphs] at entry - exact (second.serial.fields.value_eq_of_entry j entry).symm - · have ht : s ∉ insert second.main.cutoff second.main.cutoff := by - simpa only [same.cutoff] using hs - change (first.serial.fields.graphFunction j).totalValue s = - (second.serial.fields.graphFunction j).totalValue s - rw [FunctionGraphOn.totalValue_outside _ hs, FunctionGraphOn.totalValue_outside _ ht] - -theorem history_values (j : Fin 5) (s : ZFSet.{u}) - (hs : s ∈ insert first.main.cutoff first.main.cutoff) : - first.main.history.fieldValue j s = second.main.history.fieldValue j s := by - have ht : s ∈ insert second.main.cutoff second.main.cutoff := by - simpa only [same.cutoff] using hs - rw [← first.agreement j s hs, ← second.agreement j s ht] - exact same.serial_values j s - -theorem birth : first.main.birth = second.main.birth := by - have equal := same.history_values 3 first.main.cutoff (ZFSet.mem_insert _ _) - exact equal.trans (congrArg second.main.history.birth same.cutoff) - -theorem history_five (s : ZFSet.{u}) (before : s = first.main.cutoff ∨ s ∈ first.main.cutoff) : - first.main.history.space s = second.main.history.space s ∧ - first.main.history.order s = second.main.history.order s ∧ - first.main.history.meetGraph s = second.main.history.meetGraph s ∧ - first.main.history.birth s = second.main.history.birth s ∧ - first.main.history.height s = second.main.history.height s := - ⟨same.history_values 0 s (ZFSet.mem_insert_iff.2 before), - same.history_values 1 s (ZFSet.mem_insert_iff.2 before), - same.history_values 2 s (ZFSet.mem_insert_iff.2 before), - same.history_values 3 s (ZFSet.mem_insert_iff.2 before), - same.history_values 4 s (ZFSet.mem_insert_iff.2 before)⟩ - -end SameCode - -end GroundLinkedMainStage - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.SerializedChronologyFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +noncomputable def serializedChronologyCode (T V : ZFSet.{u}) (graphs : Fin 5 → ZFSet.{u}) + (W layers : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 2 (Fin.cases (nonemptyTupleCode 6 (Fin.cases T (Fin.cases V graphs))) + (Fin.cases W (fun _ => layers))) + +theorem GroundSerializedChronology.code_eq_literal {M : TransitiveGround.{u}} + {T C D rD : ZFSet.{u}} (serial : GroundSerializedChronology M T C D rD) : + serial.code = serializedChronologyCode T serial.fields.bound serial.fields.graph + serial.layerBound serial.layers := rfl + +theorem SerializedChronologyCode.toGround_code {M : TransitiveGround.{u}} + {T V C D rD N W layers : ZFSet.{u}} {graphs : Fin 5 → ZFSet.{u}} + (code : SerializedChronologyCode T V C D rD N graphs W layers) + (hT : T ∈ M.sets) (hV : V ∈ M.sets) (hGraphs : ∀ j, graphs j ∈ M.sets) + (hW : W ∈ M.sets) (hLayers : layers ∈ M.sets) (omega : N = ZFSet.omega) : + (code.toGround hT hV hGraphs hW hLayers omega).code = + serializedChronologyCode T V graphs W layers := rfl + +namespace BoundedFormula +def serializedChronologyTupleFormula {n} (z history T V : Fin n) (graphs : Fin 5 → Fin n) + (W layers : Fin n) : BoundedFormula n := + .conj (nonemptyTupleFormula 6 history (Fin.cases T (Fin.cases V graphs))) + (nonemptyTupleFormula 2 z (Fin.cases history (Fin.cases W (fun _ => layers)))) + +theorem truth_serializedChronologyTupleFormula {n} (z history T V : Fin n) + (graphs : Fin 5 → Fin n) (W layers : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (serializedChronologyTupleFormula z history T V graphs W layers) env ↔ + env history = nonemptyTupleCode 6 (Fin.cases (env T) (Fin.cases (env V) (fun j => env (graphs j)))) ∧ + env z = serializedChronologyCode (env T) (env V) (fun j => env (graphs j)) (env W) (env layers) := by + simp only [serializedChronologyTupleFormula, Truth, truth_nonemptyTupleFormula] + have map2 {k : Nat} (a : Fin n) (f : Fin k → Fin n) : + (fun j => env (Fin.cases a f j)) = Fin.cases (env a) (fun j => env (f j)) := by + funext j + exact Fin.cases rfl (fun _ => rfl) j + simp only [map2] + constructor + · rintro ⟨history, code⟩ + rw [history] at code + exact ⟨history, code⟩ + · rintro ⟨history, code⟩ + unfold serializedChronologyCode at code + rw [← history] at code + exact ⟨history, code⟩ + +end BoundedFormula + +end + +section +open SetFormula +universe u v + +def chronologyCandidateGraphs {A : Type v} (fields : Fin 10 → A) : Fin 5 → A := + Fin.cases (fields 2) (Fin.cases (fields 3) (Fin.cases (fields 4) + (Fin.cases (fields 5) (fun _ => fields 6)))) + +namespace SetFormula +def serializedChronologyCandidateFormula {n} (z C D rD N : Fin n) : SetFormula n := + let old := suffixIndex n 10 + let field := prefixIndex n 10 + let graphs := chronologyCandidateGraphs field + exBlock 10 (.conj + (BoundedFormula.serializedChronologyTupleFormula (old z) (field 9) (field 0) (field 1) + graphs (field 7) (field 8)).toFormula + (serializedChronologyFormula (field 0) (field 1) (old C) (old D) (old rD) (old N) + graphs (field 7) (field 8))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_serializedChronologyCandidateFormula_raw {n} (z C D rD N : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (serializedChronologyCandidateFormula z C D rD N) env ↔ + ∃ fields : Fin 10 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ + fields 9 = nonemptyTupleCode 6 (Fin.cases (fields 0) (Fin.cases (fields 1) + (chronologyCandidateGraphs fields))) ∧ + env z = serializedChronologyCode (fields 0) (fields 1) + (chronologyCandidateGraphs fields) (fields 7) (fields 8) ∧ + SerializedChronologyCode (fields 0) (fields 1) (env C) (env D) (env rD) (env N) + (chronologyCandidateGraphs fields) (fields 7) (fields 8) := by + rw [serializedChronologyCandidateFormula, realize_exBlock] + let old := suffixIndex n 10 + let field := prefixIndex n 10 + let graphs := chronologyCandidateGraphs field + have actual (values : Fin 10 → ZFSet.{u}) (ground : ∀ j, values j ∈ M.sets) : + (Realize M.sets + (BoundedFormula.serializedChronologyTupleFormula (old z) (field 9) (field 0) (field 1) + graphs (field 7) (field 8)).toFormula (extendMany 10 values env) ∧ + Realize M.sets + (serializedChronologyFormula (field 0) (field 1) (old C) (old D) (old rD) (old N) + graphs (field 7) (field 8)) (extendMany 10 values env)) ↔ + values 9 = nonemptyTupleCode 6 (Fin.cases (values 0) (Fin.cases (values 1) + (chronologyCandidateGraphs values))) ∧ + env z = serializedChronologyCode (values 0) (values 1) + (chronologyCandidateGraphs values) (values 7) (values 8) ∧ + SerializedChronologyCode (values 0) (values 1) (env C) (env D) (env rD) (env N) + (chronologyCandidateGraphs values) (values 7) (values 8) := by + have mems := extendMany_members 10 values env ground members + have tuple := (BoundedFormula.realize_toFormula M _ _ mems).trans + (BoundedFormula.truth_serializedChronologyTupleFormula (old z) (field 9) (field 0) + (field 1) graphs (field 7) (field 8) (extendMany 10 values env)) + have code := M.realize_serializedChronologyFormula pairing unions powers separation + (field 0) (field 1) (old C) (old D) (old rD) (old N) graphs (field 7) (field 8) + (extendMany 10 values env) mems + have graphMap : (fun j => extendMany 10 values env (graphs j)) = chronologyCandidateGraphs values := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j + rw [tuple, code, graphMap] + simp only [field, old, extendMany_prefix, extendMany_suffix, and_assoc] + constructor + · rintro ⟨fields, ground, recognized⟩ + exact ⟨fields, ground, (actual fields ground).1 recognized⟩ + · rintro ⟨fields, ground, recognized⟩ + exact ⟨fields, ground, (actual fields ground).2 recognized⟩ + +theorem realize_serializedChronologyCandidateFormula {n} (z C D rD N : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : + Realize M.sets (serializedChronologyCandidateFormula z C D rD N) env ↔ + ∃ T, ∃ serial : GroundSerializedChronology M T (env C) (env D) (env rD), serial.code = env z := by + rw [M.realize_serializedChronologyCandidateFormula_raw pairing unions powers separation z C D rD N env members] + constructor + · rintro ⟨fields, ground, _, equal, code⟩ + have hGraphs : ∀ j, chronologyCandidateGraphs fields j ∈ M.sets := + Fin.cases (ground 2) (Fin.cases (ground 3) (Fin.cases (ground 4) + (Fin.cases (ground 5) (fun _ => ground 6)))) + exact ⟨fields 0, code.toGround (ground 0) (ground 1) hGraphs (ground 7) (ground 8) omega, + (code.toGround_code (ground 0) (ground 1) hGraphs (ground 7) (ground 8) omega).trans equal.symm⟩ + · rintro ⟨T, serial, equal⟩ + let fields : Fin 10 → ZFSet.{u} := Fin.cases T (Fin.cases serial.fields.bound + (Fin.cases (serial.fields.graph 0) (Fin.cases (serial.fields.graph 1) + (Fin.cases (serial.fields.graph 2) (Fin.cases (serial.fields.graph 3) + (Fin.cases (serial.fields.graph 4) (Fin.cases serial.layerBound + (Fin.cases serial.layers (fun _ => serial.fields.code))))))))) + have ground : ∀ j, fields j ∈ M.sets := Fin.cases serial.fields.time_ground + (Fin.cases serial.fields.bound_ground (Fin.cases (serial.fields.graph_ground 0) + (Fin.cases (serial.fields.graph_ground 1) (Fin.cases (serial.fields.graph_ground 2) + (Fin.cases (serial.fields.graph_ground 3) (Fin.cases (serial.fields.graph_ground 4) + (Fin.cases serial.layer_bound_ground (Fin.cases serial.layers_ground + (fun _ => serial.fields.code_ground pairing))))))))) + have graphEq : chronologyCandidateGraphs fields = serial.fields.graph := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun i => Fin.elim0 i))))) j + refine ⟨fields, ground, ?_, ?_, ?_⟩ + · rw [graphEq] + rfl + · rw [graphEq] + exact equal.symm.trans serial.code_eq_literal + · rw [graphEq, omega] + exact serial.raw_code + +noncomputable def serializedChronologyCandidates (B C D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ T, ∃ serial : GroundSerializedChronology M T C D rD, serial.code = z) B + +omit pairing unions powers separation in +theorem mem_serializedChronologyCandidates (B C D rD z : ZFSet.{u}) : + z ∈ M.serializedChronologyCandidates B C D rD ↔ + z ∈ B ∧ ∃ T, ∃ serial : GroundSerializedChronology M T C D rD, serial.code = z := ZFSet.mem_sep + +theorem serializedChronologyCandidates_mem + (infinite : Realize M.sets infinity Fin.elim0) {B C D rD : ZFSet.{u}} + (hB : B ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + M.serializedChronologyCandidates B C D rD ∈ M.sets := by + let params := extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))) + have ground : ∀ i, params i ∈ M.sets := Fin.cases hC (Fin.cases hD (Fin.cases hrD + (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))) + have selected := M.separation_mem separation (serializedChronologyCandidateFormula 0 1 2 3 4) + params ground hB + have equal : ZFSet.sep (fun z => Realize M.sets (serializedChronologyCandidateFormula 0 1 2 3 4) + (extend z params)) B = M.serializedChronologyCandidates B C D rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_serializedChronologyCandidates] + apply and_congr_right + intro hz + exact M.realize_serializedChronologyCandidateFormula pairing unions powers separation + 0 1 2 3 4 (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl + exact equal ▸ selected + +omit pairing unions powers separation in +theorem serializedChronology_code_mem_candidates {B T C D rD : ZFSet.{u}} + (serial : GroundSerializedChronology M T C D rD) (bound : serial.code ∈ B) : + serial.code ∈ M.serializedChronologyCandidates B C D rD := + (M.mem_serializedChronologyCandidates B C D rD serial.code).2 ⟨bound, T, serial, rfl⟩ + +end TransitiveGround + +def linkedChronologyGraphs {A : Type v} (f : Fin 24 → A) : Fin 5 → A := + Fin.cases (f 14) (Fin.cases (f 15) (Fin.cases (f 16) (Fin.cases (f 17) (fun _ => f 18)))) + +def LinkedMainStageRawCode (M : TransitiveGround.{u}) (K Labels C D rD N z : ZFSet.{u}) + (f : Fin 24 → ZFSet.{u}) : Prop := + z = linkedMainStageCode (f 22) (f 11) (f 23) ∧ + f 22 = mainStageCode (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8) (f 9) (f 10) ∧ + MainStageValidity M (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8) (f 9) (f 10) C D rD ∧ + f 21 = nonemptyTupleCode 6 (Fin.cases (f 12) (Fin.cases (f 13) (linkedChronologyGraphs f))) ∧ + f 23 = serializedChronologyCode (f 12) (f 13) (linkedChronologyGraphs f) (f 19) (f 20) ∧ + SerializedChronologyCode (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20) ∧ + ordinalSetProperty (f 11) ∧ f 12 = insert (f 11) (f 11) ∧ + ZFSet.pair (f 11) (f 0) ∈ f 14 ∧ ZFSet.pair (f 11) (f 1) ∈ f 15 ∧ + ZFSet.pair (f 11) (f 2) ∈ f 16 ∧ ZFSet.pair (f 11) (f 10) ∈ f 18 ∧ + LinkedMainInvariantCode M K Labels C D (f 0) (f 3) (f 11) (f 23) + +namespace BoundedFormula + +def linkedMainStageTupleFormula {n} (z a t h : Fin n) : BoundedFormula n := + nonemptyTupleFormula 2 z (Fin.cases a (Fin.cases t (fun _ => h))) + +theorem truth_linkedMainStageTupleFormula {n} (z a t h : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (linkedMainStageTupleFormula z a t h) env ↔ + env z = linkedMainStageCode (env a) (env t) (env h) := by + rw [linkedMainStageTupleFormula, truth_nonemptyTupleFormula] + have map : (fun j : Fin 3 => env (Fin.cases a (Fin.cases t (fun _ => h)) j)) = + Fin.cases (env a) (Fin.cases (env t) (fun _ => env h)) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun _ => rfl)) j + rw [map] + rfl + +def linkedTerminalFormula {n} (t T P r μ h : Fin n) (graphs : Fin 5 → Fin n) : BoundedFormula n := + .conj (ordinalFormula t) (.conj (successorFormula T t) + (.conj (pairMembershipFormula t P (graphs 0)) (.conj (pairMembershipFormula t r (graphs 1)) + (.conj (pairMembershipFormula t μ (graphs 2)) (pairMembershipFormula t h (graphs 4)))))) + +theorem truth_linkedTerminalFormula {n} (t T P r μ h : Fin n) (graphs : Fin 5 → Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (linkedTerminalFormula t T P r μ h graphs) env ↔ + ordinalSetProperty (env t) ∧ env T = insert (env t) (env t) ∧ + ZFSet.pair (env t) (env P) ∈ env (graphs 0) ∧ + ZFSet.pair (env t) (env r) ∈ env (graphs 1) ∧ + ZFSet.pair (env t) (env μ) ∈ env (graphs 2) ∧ + ZFSet.pair (env t) (env h) ∈ env (graphs 4) := by + simp only [linkedTerminalFormula, Truth, truth_ordinalFormula, truth_successorFormula, + truth_pairMembershipFormula, ← ordinalSetProperty_iff] +end BoundedFormula + +namespace SetFormula + +def linkedMainStageRawFormula {n} (K Labels C D rD N z : Fin n) (f : Fin 24 → Fin n) : SetFormula n := + .conj (BoundedFormula.linkedMainStageTupleFormula z (f 22) (f 11) (f 23)).toFormula + (.conj (validMainStageCodeFormula (f 22) (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) + (f 7) (f 8) (f 9) (f 10) C D rD N) + (.conj (BoundedFormula.serializedChronologyTupleFormula (f 23) (f 21) (f 12) (f 13) + (linkedChronologyGraphs f) (f 19) (f 20)).toFormula + (.conj (serializedChronologyFormula (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20)) + (.conj (BoundedFormula.linkedTerminalFormula (f 11) (f 12) (f 0) (f 1) (f 2) (f 10) + (linkedChronologyGraphs f)).toFormula + (linkedMainInvariantFormula K Labels C D (f 0) (f 3) (f 11) (f 23)))))) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_linkedMainStageRawFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N z : Fin n) + (f : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedMainStageRawFormula K Labels C D rD N z f) env ↔ + LinkedMainStageRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) (env z) + (fun j => env (f j)) := by + have outer := (BoundedFormula.realize_toFormula M _ env members).trans + (BoundedFormula.truth_linkedMainStageTupleFormula z (f 22) (f 11) (f 23) env) + have stage := M.realize_validMainStageCodeFormula pairing unions powers separation + (f 22) (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8) (f 9) (f 10) C D rD N env members omega + have tuple := (BoundedFormula.realize_toFormula M _ env members).trans + (BoundedFormula.truth_serializedChronologyTupleFormula (f 23) (f 21) (f 12) (f 13) + (linkedChronologyGraphs f) (f 19) (f 20) env) + have serial := M.realize_serializedChronologyFormula pairing unions powers separation + (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20) env members + have terminal := (BoundedFormula.realize_toFormula M _ env members).trans + (BoundedFormula.truth_linkedTerminalFormula (f 11) (f 12) (f 0) (f 1) (f 2) (f 10) + (linkedChronologyGraphs f) env) + have invariant := M.realize_linkedMainInvariantFormula pairing unions powers separation collection + K Labels C D (f 0) (f 3) (f 11) (f 23) env members ordinal + have map : (fun j => env (linkedChronologyGraphs f j)) = linkedChronologyGraphs (fun j => env (f j)) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j + change (Realize M.sets (BoundedFormula.linkedMainStageTupleFormula z (f 22) (f 11) (f 23)).toFormula env ∧ + Realize M.sets (validMainStageCodeFormula (f 22) (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) + (f 7) (f 8) (f 9) (f 10) C D rD N) env ∧ + Realize M.sets (BoundedFormula.serializedChronologyTupleFormula (f 23) (f 21) (f 12) (f 13) + (linkedChronologyGraphs f) (f 19) (f 20)).toFormula env ∧ + Realize M.sets (serializedChronologyFormula (f 12) (f 13) C D rD N (linkedChronologyGraphs f) (f 19) (f 20)) env ∧ + Realize M.sets (BoundedFormula.linkedTerminalFormula (f 11) (f 12) (f 0) (f 1) (f 2) (f 10) + (linkedChronologyGraphs f)).toFormula env ∧ + Realize M.sets (linkedMainInvariantFormula K Labels C D (f 0) (f 3) (f 11) (f 23)) env) ↔ _ + rw [outer, stage, tuple, serial, terminal, invariant, map] + simp only [LinkedMainStageRawCode, and_assoc] + rfl + +end TransitiveGround + +end + +section +open SetFormula +universe u + +namespace LinkedMainStageRawCode +variable {M : TransitiveGround.{u}} {K Labels C D rD N z : ZFSet.{u}} {f : Fin 24 → ZFSet.{u}} + +theorem exists_linked + (raw : LinkedMainStageRawCode M K Labels C D rD N z f) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (ground : ∀ j, f j ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (omega : N = ZFSet.omega) : + ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z := by + obtain ⟨outer, stageEq, valid, _, serialEq, code, ordinal, domain, eP, er, eμ, eh, inv⟩ := raw + let stage := GroundMainStage.ofValidity pairing unions powers separation + (ground 0) (ground 1) (ground 2) (ground 3) (ground 4) (ground 5) (ground 7) (ground 10) hC hD hrD valid + have code' : SerializedChronologyCode (insert (f 11) (f 11)) (f 13) C D rD N + (linkedChronologyGraphs f) (f 19) (f 20) := domain ▸ code + have graphsGround : ∀ j, linkedChronologyGraphs f j ∈ M.sets := + Fin.cases (ground 14) (Fin.cases (ground 15) (Fin.cases (ground 16) + (Fin.cases (ground 17) (fun _ => ground 18)))) + let serial := code'.toGround (domain ▸ ground 12) (ground 13) graphsGround (ground 19) (ground 20) omega + let main : GroundChronologicalMainStage M C D rD := + { stage := stage + cutoff := f 11 + cutoff_ground := ground 11 + cutoff_ordinal := ordinal + history := serial.toHistory + carrier_eq := serial.fields.value_eq_of_entry 0 eP + order_eq := serial.fields.value_eq_of_entry 1 er + meet_eq := serial.fields.value_eq_of_entry 2 eμ + height_eq := serial.fields.value_eq_of_entry 4 eh } + have serialCode : serial.code = f 23 := by + change serializedChronologyCode (insert (f 11) (f 11)) (f 13) (linkedChronologyGraphs f) (f 19) (f 20) = f 23 + rw [← domain] + exact serialEq.symm + obtain ⟨ps, gs, ls, pr, gr, lr, tm, cr, dr, sr⟩ := inv + let linked : GroundLinkedMainStage M K Labels C D rD := + { main := main + serial := serial + agreement := fun j _ _ => Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j + invariant := ⟨ps, gs, ls, pr, gr, lr, tm, cr, dr⟩ + serial_rank := serialCode ▸ sr } + refine ⟨linked, ?_⟩ + change linkedMainStageCode stage.code (f 11) serial.code = z + have scode : stage.code = f 22 := stageEq.symm + rw [scode, serialCode] + exact outer.symm + +end LinkedMainStageRawCode + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (linked : GroundLinkedMainStage M K Labels C D rD) + +noncomputable def rawFields : Fin 24 → ZFSet.{u} := + (Fin.cases (linked.main.stage.carrier) (Fin.cases (linked.main.stage.order) (Fin.cases (linked.main.stage.meetGraph) (Fin.cases (linked.main.stage.actors) (Fin.cases (linked.main.stage.multiplication) (Fin.cases (linked.main.stage.inverse) (Fin.cases (linked.main.stage.identity) (Fin.cases (linked.main.stage.action) (Fin.cases (linked.main.stage.bottom) (Fin.cases (linked.main.stage.top) (Fin.cases (linked.main.stage.height) (Fin.cases (linked.main.cutoff) (Fin.cases (insert linked.main.cutoff linked.main.cutoff) (Fin.cases (linked.serial.fields.bound) (Fin.cases (linked.serial.fields.graph 0) (Fin.cases (linked.serial.fields.graph 1) (Fin.cases (linked.serial.fields.graph 2) (Fin.cases (linked.serial.fields.graph 3) (Fin.cases (linked.serial.fields.graph 4) (Fin.cases (linked.serial.layerBound) (Fin.cases (linked.serial.layers) (Fin.cases (linked.serial.fields.code) (Fin.cases (linked.main.stage.code) (fun _ => linked.serial.code)))))))))))))))))))))))) + +theorem rawFields_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + ∀ j, linked.rawFields j ∈ M.sets := + (Fin.cases (linked.main.stage.carrier_ground) (Fin.cases (linked.main.stage.order_ground) (Fin.cases (linked.main.stage.meet_ground) (Fin.cases (linked.main.stage.actors_ground) (Fin.cases (linked.main.stage.multiplication_ground) (Fin.cases (linked.main.stage.inverse_ground) (Fin.cases (linked.main.stage.identity_ground) (Fin.cases (linked.main.stage.action_ground) (Fin.cases (linked.main.stage.bottom_ground) (Fin.cases (linked.main.stage.top_ground) (Fin.cases (linked.main.stage.height_ground) (Fin.cases (linked.main.cutoff_ground) (Fin.cases (linked.serial.fields.time_ground) (Fin.cases (linked.serial.fields.bound_ground) (Fin.cases (linked.serial.fields.graph_ground 0) (Fin.cases (linked.serial.fields.graph_ground 1) (Fin.cases (linked.serial.fields.graph_ground 2) (Fin.cases (linked.serial.fields.graph_ground 3) (Fin.cases (linked.serial.fields.graph_ground 4) (Fin.cases (linked.serial.layer_bound_ground) (Fin.cases (linked.serial.layers_ground) (Fin.cases (linked.serial.fields.code_ground pairing) (Fin.cases (linked.main.stage.code_mem pairing) (fun _ => linked.serial.code_ground pairing)))))))))))))))))))))))) + +theorem rawFields_graphs : linkedChronologyGraphs linked.rawFields = linked.serial.fields.graph := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (fun i => Fin.elim0 i))))) j + +theorem rawFields_code : LinkedMainStageRawCode M K Labels C D rD ZFSet.omega linked.code linked.rawFields := by + unfold LinkedMainStageRawCode + rw [linked.rawFields_graphs] + refine ⟨rfl, rfl, linked.main.stage.validity, rfl, rfl, linked.serial.raw_code, + linked.main.cutoff_ordinal, rfl, ?_, ?_, ?_, ?_, linked.invariant_code⟩ + · change ZFSet.pair linked.main.cutoff linked.main.stage.carrier ∈ linked.serial.fields.graph 0 + rw [← linked.terminal_values.1] + exact linked.serial.fields.value_entry 0 (ZFSet.mem_insert _ _) + · change ZFSet.pair linked.main.cutoff linked.main.stage.order ∈ linked.serial.fields.graph 1 + rw [← linked.terminal_values.2.1] + exact linked.serial.fields.value_entry 1 (ZFSet.mem_insert _ _) + · change ZFSet.pair linked.main.cutoff linked.main.stage.meetGraph ∈ linked.serial.fields.graph 2 + rw [← linked.terminal_values.2.2.1] + exact linked.serial.fields.value_entry 2 (ZFSet.mem_insert _ _) + · change ZFSet.pair linked.main.cutoff linked.main.stage.height ∈ linked.serial.fields.graph 4 + rw [← linked.terminal_values.2.2.2.2] + exact linked.serial.fields.value_entry 4 (ZFSet.mem_insert _ _) + +end GroundLinkedMainStage + +namespace LinkedMainStageRawCode +variable {M : TransitiveGround.{u}} {K Labels C D rD N z : ZFSet.{u}} +variable {f g : Fin 24 → ZFSet.{u}} + +theorem fields_unique (first : LinkedMainStageRawCode M K Labels C D rD N z f) + (second : LinkedMainStageRawCode M K Labels C D rD N z g) : f = g := by + obtain ⟨fo, fa, _, fh, fs, _⟩ := first + obtain ⟨go, ga, _, gh, gs, _⟩ := second + have outer := linkedMainStageCode_inj.1 (fo.symm.trans go) + have stage := nonemptyTupleCode_injective 10 (fa.symm.trans (outer.1.trans ga)) + have serial := nonemptyTupleCode_injective 2 (fs.symm.trans (outer.2.2.trans gs)) + have history := nonemptyTupleCode_injective 6 (congrFun serial 0) + have h21 : f 21 = g 21 := fh.trans ((congrFun serial 0).trans gh.symm) + funext j + exact (show ∀ j : Fin 24, f j = g j from (Fin.cases (congrFun stage 0) (Fin.cases (congrFun stage 1) (Fin.cases (congrFun stage 2) (Fin.cases (congrFun stage 3) (Fin.cases (congrFun stage 4) (Fin.cases (congrFun stage 5) (Fin.cases (congrFun stage 6) (Fin.cases (congrFun stage 7) (Fin.cases (congrFun stage 8) (Fin.cases (congrFun stage 9) (Fin.cases (congrFun stage 10) (Fin.cases (outer.2.1) (Fin.cases (congrFun history 0) (Fin.cases (congrFun history 1) (Fin.cases (congrFun history 2) (Fin.cases (congrFun history 3) (Fin.cases (congrFun history 4) (Fin.cases (congrFun history 5) (Fin.cases (congrFun history 6) (Fin.cases (congrFun serial 1) (Fin.cases (congrFun serial 2) (Fin.cases (h21) (Fin.cases (outer.1) (Fin.cases (outer.2.2) (fun i => Fin.elim0 i)))))))))))))))))))))))))) j + +theorem exists_linked_fields + (raw : LinkedMainStageRawCode M K Labels C D rD N z f) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (ground : ∀ j, f j ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (omega : N = ZFSet.omega) : + ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z ∧ linked.rawFields = f := by + obtain ⟨linked, equal⟩ := raw.exists_linked pairing unions powers separation ground hC hD hrD omega + refine ⟨linked, equal, ?_⟩ + rw [omega] at raw + have actual := linked.rawFields_code + rw [equal] at actual + exact actual.fields_unique raw + +end LinkedMainStageRawCode +end + +namespace GroundLinkedMainStage +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} + +structure SameCode (first second : GroundLinkedMainStage M K Labels C D rD) : Prop where + stage : first.main.stage = second.main.stage + cutoff : first.main.cutoff = second.main.cutoff + serial_code : first.serial.code = second.serial.code + raw_fields : first.rawFields = second.rawFields + field_graphs : first.serial.fields.graph = second.serial.fields.graph + +theorem same_code (first second : GroundLinkedMainStage M K Labels C D rD) + (equal : first.code = second.code) : SameCode first second := by + have outer := linkedMainStageCode_inj.1 equal + have other : LinkedMainStageRawCode M K Labels C D rD ZFSet.omega first.code second.rawFields := + equal.symm ▸ second.rawFields_code + have fields := first.rawFields_code.fields_unique other + refine ⟨GroundMainStage.code_injective outer.1, outer.2.1, outer.2.2, fields, ?_⟩ + rw [← first.rawFields_graphs, ← second.rawFields_graphs, fields] + +namespace SameCode +variable {first second : GroundLinkedMainStage M K Labels C D rD} +variable (same : SameCode first second) +include same + +theorem field_bound : first.serial.fields.bound = second.serial.fields.bound := + congrFun same.raw_fields 13 + +theorem layer_bound : first.serial.layerBound = second.serial.layerBound := + congrFun same.raw_fields 19 + +theorem layers : first.serial.layers = second.serial.layers := + congrFun same.raw_fields 20 + +theorem serial_values (j : Fin 5) (s : ZFSet.{u}) : + first.serial.fields.value j s = second.serial.fields.value j s := by + classical + by_cases hs : s ∈ insert first.main.cutoff first.main.cutoff + · have entry := first.serial.fields.value_entry j hs + rw [same.field_graphs] at entry + exact (second.serial.fields.value_eq_of_entry j entry).symm + · have ht : s ∉ insert second.main.cutoff second.main.cutoff := by + simpa only [same.cutoff] using hs + change (first.serial.fields.graphFunction j).totalValue s = + (second.serial.fields.graphFunction j).totalValue s + rw [FunctionGraphOn.totalValue_outside _ hs, FunctionGraphOn.totalValue_outside _ ht] + +theorem history_values (j : Fin 5) (s : ZFSet.{u}) + (hs : s ∈ insert first.main.cutoff first.main.cutoff) : + first.main.history.fieldValue j s = second.main.history.fieldValue j s := by + have ht : s ∈ insert second.main.cutoff second.main.cutoff := by + simpa only [same.cutoff] using hs + rw [← first.agreement j s hs, ← second.agreement j s ht] + exact same.serial_values j s + +theorem birth : first.main.birth = second.main.birth := by + have equal := same.history_values 3 first.main.cutoff (ZFSet.mem_insert _ _) + exact equal.trans (congrArg second.main.history.birth same.cutoff) + +theorem history_five (s : ZFSet.{u}) (before : s = first.main.cutoff ∨ s ∈ first.main.cutoff) : + first.main.history.space s = second.main.history.space s ∧ + first.main.history.order s = second.main.history.order s ∧ + first.main.history.meetGraph s = second.main.history.meetGraph s ∧ + first.main.history.birth s = second.main.history.birth s ∧ + first.main.history.height s = second.main.history.height s := + ⟨same.history_values 0 s (ZFSet.mem_insert_iff.2 before), + same.history_values 1 s (ZFSet.mem_insert_iff.2 before), + same.history_values 2 s (ZFSet.mem_insert_iff.2 before), + same.history_values 3 s (ZFSet.mem_insert_iff.2 before), + same.history_values 4 s (ZFSet.mem_insert_iff.2 before)⟩ + +end SameCode + +end GroundLinkedMainStage + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageLevels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageLevels.lean index e9bc2d54415bf50ef96221c3b4849f609247f8cf..ff2e75b110fa98d9853f0b93e1da6082f3972898 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageLevels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundLinkedMainStageLevels.lean @@ -1,154 +1,154 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerializedCandidateLevels - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def linkedMainStageFormula {n} (K Labels C D rD N z : Fin n) : SetFormula n := - let old := suffixIndex n 24 - exBlock 24 (linkedMainStageRawFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) (old z) - (prefixIndex n 24)) -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem realize_linkedMainStageFormula_raw {n} (K Labels C D rD N z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedMainStageFormula K Labels C D rD N z) env ↔ - ∃ f : Fin 24 → ZFSet.{u}, (∀ j, f j ∈ M.sets) ∧ - LinkedMainStageRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) (env z) f := by - rw [linkedMainStageFormula, realize_exBlock] - have actual (f : Fin 24 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) := - M.realize_linkedMainStageRawFormula pairing unions powers separation collection - (suffixIndex n 24 K) (suffixIndex n 24 Labels) (suffixIndex n 24 C) (suffixIndex n 24 D) - (suffixIndex n 24 rD) (suffixIndex n 24 N) (suffixIndex n 24 z) (prefixIndex n 24) - (extendMany 24 f env) (extendMany_members 24 f env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal) - simp only [extendMany_prefix, extendMany_suffix] at actual - constructor - · rintro ⟨f, ground, recognized⟩ - exact ⟨f, ground, (actual f ground).1 recognized⟩ - · rintro ⟨f, ground, raw⟩ - exact ⟨f, ground, (actual f ground).2 raw⟩ - -theorem realize_linkedMainStageFormula {n} (K Labels C D rD N z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (linkedMainStageFormula K Labels C D rD N z) env ↔ - ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD), - linked.code = env z := by - rw [M.realize_linkedMainStageFormula_raw pairing unions powers separation collection - K Labels C D rD N z env members omega ordinal] - constructor - · rintro ⟨f, ground, raw⟩ - exact raw.exists_linked pairing unions powers separation ground (members C) (members D) (members rD) omega - · rintro ⟨linked, equal⟩ - refine ⟨linked.rawFields, linked.rawFields_ground pairing, ?_⟩ - rw [omega, ← equal] - exact linked.rawFields_code - -noncomputable def linkedMainStageCandidates (B K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z) B - -omit pairing unions powers separation collection in -theorem mem_linkedMainStageCandidates (B K Labels C D rD z : ZFSet.{u}) : - z ∈ M.linkedMainStageCandidates B K Labels C D rD ↔ - z ∈ B ∧ ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z := ZFSet.mem_sep - -theorem linkedMainStageCandidates_mem (infinite : Realize M.sets infinity Fin.elim0) - {B K Labels C D rD : ZFSet.{u}} (hB : B ∈ M.sets) (hK : K ∈ M.sets) - (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (ordinal : ordinalSetProperty K) : M.linkedMainStageCandidates B K Labels C D rD ∈ M.sets := by - let params := extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))))) - have ground : ∀ j, params j ∈ M.sets := Fin.cases hK (Fin.cases hLabels (Fin.cases hC - (Fin.cases hD (Fin.cases hrD (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))))) - have selected := M.separation_mem separation (linkedMainStageFormula 1 2 3 4 5 6 0) params ground hB - have equal : ZFSet.sep (fun z => Realize M.sets (linkedMainStageFormula 1 2 3 4 5 6 0) - (extend z params)) B = M.linkedMainStageCandidates B K Labels C D rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_linkedMainStageCandidates] - apply and_congr_right - intro hz - exact M.realize_linkedMainStageFormula pairing unions powers separation collection - 1 2 3 4 5 6 0 (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl ordinal - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) - -noncomputable def validLinkedStages (Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - M.linkedMainStageCandidates level.carrier K Labels C D rD - -theorem validLinkedStages_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) {Labels C D rD : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - level.validLinkedStages Labels C D rD ∈ M.sets := - M.linkedMainStageCandidates_mem pairing unions powers separation collection infinite - level.carrier_ground hK hLabels hC hD hrD ordinal - -theorem mem_validLinkedStages {Labels C D rD z : ZFSet.{u}} : - z ∈ level.validLinkedStages Labels C D rD ↔ - z ∈ level.carrier ∧ ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z := - M.mem_linkedMainStageCandidates level.carrier K Labels C D rD z - -theorem linked_mem_validLinkedStages - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - {Labels C D rD : ZFSet.{u}} (linked : GroundLinkedMainStage M K Labels C D rD) : - linked.code ∈ level.validLinkedStages Labels C D rD := - level.mem_validLinkedStages.2 ⟨(level.membership _).2 ⟨linked.code_ground pairing, - linked.code_rank_lt pairing unions powers separation infinite hK conditions⟩, linked, rfl⟩ - -theorem validLinkedStageFamily_rank_lt - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - {I Labels C D rD f : ZFSet.{u}} (hI : I ∈ K) (hf : f ∈ M.sets) - (function : ZFSet.IsFunc I (level.validLinkedStages Labels C D rD) f) : - ZFSet.rank f < ZFSet.rank K := by - apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite - hK hI hf ⟨level.validLinkedStages Labels C D rD, function⟩ - intro i _ v entry - have hv := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - exact ((level.membership v).1 (level.mem_validLinkedStages.1 hv).1).2 - -end GroundMainCandidateLevel -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerializedCandidateLevels + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def linkedMainStageFormula {n} (K Labels C D rD N z : Fin n) : SetFormula n := + let old := suffixIndex n 24 + exBlock 24 (linkedMainStageRawFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) (old z) + (prefixIndex n 24)) +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem realize_linkedMainStageFormula_raw {n} (K Labels C D rD N z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedMainStageFormula K Labels C D rD N z) env ↔ + ∃ f : Fin 24 → ZFSet.{u}, (∀ j, f j ∈ M.sets) ∧ + LinkedMainStageRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) (env z) f := by + rw [linkedMainStageFormula, realize_exBlock] + have actual (f : Fin 24 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) := + M.realize_linkedMainStageRawFormula pairing unions powers separation collection + (suffixIndex n 24 K) (suffixIndex n 24 Labels) (suffixIndex n 24 C) (suffixIndex n 24 D) + (suffixIndex n 24 rD) (suffixIndex n 24 N) (suffixIndex n 24 z) (prefixIndex n 24) + (extendMany 24 f env) (extendMany_members 24 f env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal) + simp only [extendMany_prefix, extendMany_suffix] at actual + constructor + · rintro ⟨f, ground, recognized⟩ + exact ⟨f, ground, (actual f ground).1 recognized⟩ + · rintro ⟨f, ground, raw⟩ + exact ⟨f, ground, (actual f ground).2 raw⟩ + +theorem realize_linkedMainStageFormula {n} (K Labels C D rD N z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (linkedMainStageFormula K Labels C D rD N z) env ↔ + ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD), + linked.code = env z := by + rw [M.realize_linkedMainStageFormula_raw pairing unions powers separation collection + K Labels C D rD N z env members omega ordinal] + constructor + · rintro ⟨f, ground, raw⟩ + exact raw.exists_linked pairing unions powers separation ground (members C) (members D) (members rD) omega + · rintro ⟨linked, equal⟩ + refine ⟨linked.rawFields, linked.rawFields_ground pairing, ?_⟩ + rw [omega, ← equal] + exact linked.rawFields_code + +noncomputable def linkedMainStageCandidates (B K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z) B + +omit pairing unions powers separation collection in +theorem mem_linkedMainStageCandidates (B K Labels C D rD z : ZFSet.{u}) : + z ∈ M.linkedMainStageCandidates B K Labels C D rD ↔ + z ∈ B ∧ ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z := ZFSet.mem_sep + +theorem linkedMainStageCandidates_mem (infinite : Realize M.sets infinity Fin.elim0) + {B K Labels C D rD : ZFSet.{u}} (hB : B ∈ M.sets) (hK : K ∈ M.sets) + (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (ordinal : ordinalSetProperty K) : M.linkedMainStageCandidates B K Labels C D rD ∈ M.sets := by + let params := extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))))) + have ground : ∀ j, params j ∈ M.sets := Fin.cases hK (Fin.cases hLabels (Fin.cases hC + (Fin.cases hD (Fin.cases hrD (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))))) + have selected := M.separation_mem separation (linkedMainStageFormula 1 2 3 4 5 6 0) params ground hB + have equal : ZFSet.sep (fun z => Realize M.sets (linkedMainStageFormula 1 2 3 4 5 6 0) + (extend z params)) B = M.linkedMainStageCandidates B K Labels C D rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_linkedMainStageCandidates] + apply and_congr_right + intro hz + exact M.realize_linkedMainStageFormula pairing unions powers separation collection + 1 2 3 4 5 6 0 (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl ordinal + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) + +noncomputable def validLinkedStages (Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + M.linkedMainStageCandidates level.carrier K Labels C D rD + +theorem validLinkedStages_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) {Labels C D rD : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + level.validLinkedStages Labels C D rD ∈ M.sets := + M.linkedMainStageCandidates_mem pairing unions powers separation collection infinite + level.carrier_ground hK hLabels hC hD hrD ordinal + +theorem mem_validLinkedStages {Labels C D rD z : ZFSet.{u}} : + z ∈ level.validLinkedStages Labels C D rD ↔ + z ∈ level.carrier ∧ ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = z := + M.mem_linkedMainStageCandidates level.carrier K Labels C D rD z + +theorem linked_mem_validLinkedStages + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + {Labels C D rD : ZFSet.{u}} (linked : GroundLinkedMainStage M K Labels C D rD) : + linked.code ∈ level.validLinkedStages Labels C D rD := + level.mem_validLinkedStages.2 ⟨(level.membership _).2 ⟨linked.code_ground pairing, + linked.code_rank_lt pairing unions powers separation infinite hK conditions⟩, linked, rfl⟩ + +theorem validLinkedStageFamily_rank_lt + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + {I Labels C D rD f : ZFSet.{u}} (hI : I ∈ K) (hf : f ∈ M.sets) + (function : ZFSet.IsFunc I (level.validLinkedStages Labels C D rD) f) : + ZFSet.rank f < ZFSet.rank K := by + apply conditions.functionGraphOn_rank_lt pairing unions powers separation collection infinite + hK hI hf ⟨level.validLinkedStages Labels C D rD, function⟩ + intro i _ v entry + have hv := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + exact ((level.membership v).1 (level.mem_validLinkedStages.1 hv).1).2 + +end GroundMainCandidateLevel +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalChronology.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalChronology.lean index 8f3d0fc95d76b9a6cca2f51e310b9c9622e1d7f1..e93e8f1dfeafdb8e175d31e4371a7e39d2a4e1b7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalChronology.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalChronology.lean @@ -1,143 +1,143 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalSeparatedActors -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageConstruction - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def finalGeometry (i₀ : I) : GroundMainFinalGeometry M C D rD where - carrier := run.limitPoints - order := run.limitOrder - meetGraph := run.limitMeetGraph - actors := run.limitActors - multiplication := run.limitMultiplication - inverse := run.limitInverse - identity := run.limitIdentity i₀ - action := run.limitAction - bottom := run.limitBottom i₀ - height := run.limitHeight - birth := run.limitBirth - times := run.cutoffLimit - carrier_ground := run.limitPoints_ground - order_ground := run.limitOrder_ground - meet_ground := run.limitMeetGraph_ground - actors_ground := run.limitActors_ground - multiplication_ground := run.limitMultiplication_ground - inverse_ground := run.limitInverse_ground - action_ground := run.limitAction_ground - height_ground := run.limitHeight_ground - birth_ground := run.limitBirth_ground - times_ground := run.cutoffLimit_ground - columns_ground := (run.diagram.stage i₀).stage.columns_ground - coordinates_ground := (run.diagram.stage i₀).stage.coordinates_ground - coordinate_order_ground := (run.diagram.stage i₀).stage.coordinate_order_ground - meet := run.limitMeet_code - group_code := run.limitGroup_code i₀ - action_code := run.limitAction_code i₀ - bottom_mem := run.limitBottom_mem i₀ - least := run.limitBottom_least i₀ - height_code := run.limitHeight_code - birth_function := run.limitBirth_function - times_ordinal := run.cutoffLimit_ordinal - old_meet := run.limit_old_meet - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] - -structure FinalChronology - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (level : GroundMainCandidateLevel M K) where - serial : GroundSerializedChronology M (insert run.cutoffLimit run.cutoffLimit) C D rD - code_rank : ZFSet.rank serial.code < ZFSet.rank K - candidate : serial.code ∈ level.validChronologies C D rD - graphs : serial.fields.graph = run.limitChronologyFields.graph - values : ∀ j s, serial.fields.value j s = run.limitChronologyFields.value j s - attained_layer_bound : serial.layerBound = functionGraphRange - (chronologyPairs (insert run.cutoffLimit run.cutoffLimit)) serial.layers - -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_finalChronology - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) - (level : GroundMainCandidateLevel M K) : Nonempty (run.FinalChronology level) := by - obtain ⟨serial, _, codeRank, candidate, graphs, values, attained⟩ := - run.exists_limitSerialization collection infinite choice hK standard indices rank level - exact ⟨⟨serial, codeRank, candidate, graphs, values, attained⟩⟩ - -namespace FinalChronology -variable {run} {level : GroundMainCandidateLevel M K} -variable (chronology : run.FinalChronology level) - -theorem code_ground : chronology.serial.code ∈ M.sets := chronology.serial.code_ground pairing - -theorem history_values (s : ZFSet.{u}) : - chronology.serial.toHistory.space s = run.limitChronologyFields.value 0 s ∧ - chronology.serial.toHistory.order s = run.limitChronologyFields.value 1 s ∧ - chronology.serial.toHistory.meetGraph s = run.limitChronologyFields.value 2 s ∧ - chronology.serial.toHistory.birth s = run.limitChronologyFields.value 3 s ∧ - chronology.serial.toHistory.height s = run.limitChronologyFields.value 4 s := - ⟨chronology.values 0 s, chronology.values 1 s, chronology.values 2 s, - chronology.values 3 s, chronology.values 4 s⟩ - -theorem terminal_values (i₀ : I) : - chronology.serial.toHistory.space run.cutoffLimit = (run.finalGeometry i₀).carrier ∧ - chronology.serial.toHistory.order run.cutoffLimit = (run.finalGeometry i₀).order ∧ - chronology.serial.toHistory.meetGraph run.cutoffLimit = (run.finalGeometry i₀).meetGraph ∧ - chronology.serial.toHistory.birth run.cutoffLimit = (run.finalGeometry i₀).birth ∧ - chronology.serial.toHistory.height run.cutoffLimit = (run.finalGeometry i₀).height := by - obtain ⟨space, order, meet, birth, height⟩ := chronology.history_values run.cutoffLimit - exact ⟨space.trans (run.limitChronologyFields_terminal 0), - order.trans (run.limitChronologyFields_terminal 1), meet.trans (run.limitChronologyFields_terminal 2), - birth.trans (run.limitChronologyFields_terminal 3), height.trans (run.limitChronologyFields_terminal 4)⟩ - -theorem earlier_values (i : I) {s : ZFSet.{u}} - (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : - chronology.serial.toHistory.space s = (run.diagram.stage i).history.space s ∧ - chronology.serial.toHistory.order s = (run.diagram.stage i).history.order s ∧ - chronology.serial.toHistory.meetGraph s = (run.diagram.stage i).history.meetGraph s ∧ - chronology.serial.toHistory.birth s = (run.diagram.stage i).history.birth s ∧ - chronology.serial.toHistory.height s = (run.diagram.stage i).history.height s := by - obtain ⟨space, order, meet, birth, height⟩ := chronology.history_values s - exact ⟨space.trans (run.limitChronologyFields_values i 0 before), - order.trans (run.limitChronologyFields_values i 1 before), - meet.trans (run.limitChronologyFields_values i 2 before), - birth.trans (run.limitChronologyFields_values i 3 before), - height.trans (run.limitChronologyFields_values i 4 before)⟩ - -theorem earlier_entries (i : I) (j : Fin 5) {s : ZFSet.{u}} - (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) (y : ZFSet.{u}) : - ZFSet.pair s y ∈ chronology.serial.fields.graph j ↔ - ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j := by - rw [chronology.graphs] - exact run.limitChronologyFields_source_entries i j before y - -end FinalChronology - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalSeparatedActors +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageConstruction + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def finalGeometry (i₀ : I) : GroundMainFinalGeometry M C D rD where + carrier := run.limitPoints + order := run.limitOrder + meetGraph := run.limitMeetGraph + actors := run.limitActors + multiplication := run.limitMultiplication + inverse := run.limitInverse + identity := run.limitIdentity i₀ + action := run.limitAction + bottom := run.limitBottom i₀ + height := run.limitHeight + birth := run.limitBirth + times := run.cutoffLimit + carrier_ground := run.limitPoints_ground + order_ground := run.limitOrder_ground + meet_ground := run.limitMeetGraph_ground + actors_ground := run.limitActors_ground + multiplication_ground := run.limitMultiplication_ground + inverse_ground := run.limitInverse_ground + action_ground := run.limitAction_ground + height_ground := run.limitHeight_ground + birth_ground := run.limitBirth_ground + times_ground := run.cutoffLimit_ground + columns_ground := (run.diagram.stage i₀).stage.columns_ground + coordinates_ground := (run.diagram.stage i₀).stage.coordinates_ground + coordinate_order_ground := (run.diagram.stage i₀).stage.coordinate_order_ground + meet := run.limitMeet_code + group_code := run.limitGroup_code i₀ + action_code := run.limitAction_code i₀ + bottom_mem := run.limitBottom_mem i₀ + least := run.limitBottom_least i₀ + height_code := run.limitHeight_code + birth_function := run.limitBirth_function + times_ordinal := run.cutoffLimit_ordinal + old_meet := run.limit_old_meet + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] + +structure FinalChronology + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (level : GroundMainCandidateLevel M K) where + serial : GroundSerializedChronology M (insert run.cutoffLimit run.cutoffLimit) C D rD + code_rank : ZFSet.rank serial.code < ZFSet.rank K + candidate : serial.code ∈ level.validChronologies C D rD + graphs : serial.fields.graph = run.limitChronologyFields.graph + values : ∀ j s, serial.fields.value j s = run.limitChronologyFields.value j s + attained_layer_bound : serial.layerBound = functionGraphRange + (chronologyPairs (insert run.cutoffLimit run.cutoffLimit)) serial.layers + +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_finalChronology + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) + (level : GroundMainCandidateLevel M K) : Nonempty (run.FinalChronology level) := by + obtain ⟨serial, _, codeRank, candidate, graphs, values, attained⟩ := + run.exists_limitSerialization collection infinite choice hK standard indices rank level + exact ⟨⟨serial, codeRank, candidate, graphs, values, attained⟩⟩ + +namespace FinalChronology +variable {run} {level : GroundMainCandidateLevel M K} +variable (chronology : run.FinalChronology level) + +theorem code_ground : chronology.serial.code ∈ M.sets := chronology.serial.code_ground pairing + +theorem history_values (s : ZFSet.{u}) : + chronology.serial.toHistory.space s = run.limitChronologyFields.value 0 s ∧ + chronology.serial.toHistory.order s = run.limitChronologyFields.value 1 s ∧ + chronology.serial.toHistory.meetGraph s = run.limitChronologyFields.value 2 s ∧ + chronology.serial.toHistory.birth s = run.limitChronologyFields.value 3 s ∧ + chronology.serial.toHistory.height s = run.limitChronologyFields.value 4 s := + ⟨chronology.values 0 s, chronology.values 1 s, chronology.values 2 s, + chronology.values 3 s, chronology.values 4 s⟩ + +theorem terminal_values (i₀ : I) : + chronology.serial.toHistory.space run.cutoffLimit = (run.finalGeometry i₀).carrier ∧ + chronology.serial.toHistory.order run.cutoffLimit = (run.finalGeometry i₀).order ∧ + chronology.serial.toHistory.meetGraph run.cutoffLimit = (run.finalGeometry i₀).meetGraph ∧ + chronology.serial.toHistory.birth run.cutoffLimit = (run.finalGeometry i₀).birth ∧ + chronology.serial.toHistory.height run.cutoffLimit = (run.finalGeometry i₀).height := by + obtain ⟨space, order, meet, birth, height⟩ := chronology.history_values run.cutoffLimit + exact ⟨space.trans (run.limitChronologyFields_terminal 0), + order.trans (run.limitChronologyFields_terminal 1), meet.trans (run.limitChronologyFields_terminal 2), + birth.trans (run.limitChronologyFields_terminal 3), height.trans (run.limitChronologyFields_terminal 4)⟩ + +theorem earlier_values (i : I) {s : ZFSet.{u}} + (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : + chronology.serial.toHistory.space s = (run.diagram.stage i).history.space s ∧ + chronology.serial.toHistory.order s = (run.diagram.stage i).history.order s ∧ + chronology.serial.toHistory.meetGraph s = (run.diagram.stage i).history.meetGraph s ∧ + chronology.serial.toHistory.birth s = (run.diagram.stage i).history.birth s ∧ + chronology.serial.toHistory.height s = (run.diagram.stage i).history.height s := by + obtain ⟨space, order, meet, birth, height⟩ := chronology.history_values s + exact ⟨space.trans (run.limitChronologyFields_values i 0 before), + order.trans (run.limitChronologyFields_values i 1 before), + meet.trans (run.limitChronologyFields_values i 2 before), + birth.trans (run.limitChronologyFields_values i 3 before), + height.trans (run.limitChronologyFields_values i 4 before)⟩ + +theorem earlier_entries (i : I) (j : Fin 5) {s : ZFSet.{u}} + (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) (y : ZFSet.{u}) : + ZFSet.pair s y ∈ chronology.serial.fields.graph j ↔ + ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j := by + rw [chronology.graphs] + exact run.limitChronologyFields_source_entries i j before y + +end FinalChronology + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPersistentSuccessorLabels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPersistentSuccessorLabels.lean index 5818e5770db3a578f61e4e57ab3d9a2f1291df5e..50efa611f82bb568eb5faa92a155e5a38eb0f960 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPersistentSuccessorLabels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPersistentSuccessorLabels.lean @@ -1,319 +1,319 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPersistentAssignmentLabels - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_persistent_successor_label_injection - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset - pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) - topMem topRows mono - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → - let gamma := insert alpha alpha - let hGamma := M.insert_mem pairing unions hAlpha hAlpha - let gammaOrdinal := ordinalSetProperty_succ cutOrdinal - let alphaGamma : alpha ⊆ gamma := fun x hx => ZFSet.mem_insert_of_mem alpha hx - let gammaSubset : gamma ⊆ stages := fun x hx => - Or.elim (Iff.mp ZFSet.mem_insert_iff hx) - (fun equal => Eq.mpr (congrArg (fun z => z ∈ stages) equal) member) - (fun old => subset x old) - let gammaPacked := graphRestriction gamma packed - let gammaPackedGround := M.graphRestriction_mem unions separation hGamma hPacked - let gammaRun := historyRun.restrict gammaOrdinal gammaSubset - let middleSet := M.refinementHistoryForcing c.carrier lifted gamma gammaPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted gamma gammaPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted gamma gammaPacked - gammaRun.carriers gammaOrdinal carrier (c.encode ⊤) topMem topRows - let middle := SetMembers.presentation middleSet - let gammaMono := fun level fields (entry : ZFSet.pair level (refinementFormulaDataCode fields) ∈ gammaPacked) => mono level fields - (And.left (Iff.mp pair_mem_graphRestriction entry)) - let nestedInclude := RecursiveRefinementOrderHistory.inclusionFunction gammaRun gammaOrdinal cutOrdinal alphaGamma - pairing unions powers separation infinite choice hGamma gammaPackedGround hLifted hAlpha carrier - (c.encode ⊤) topMem topRows gammaMono - let toNested := fun x : SetMembers Q => SetMembers.ofMem (SetMembers.raw x) - (Eq.mpr (congrArg (fun h => SetMembers.raw x ∈ M.refinementHistoryForcing c.carrier lifted alpha h) - (graphRestriction_restrict alphaGamma)) (SetMembers.raw_mem x)) - let prefixInclude := fun x : SetMembers Q => nestedInclude (toNested x) - let successorLabel := Name.refinementAssignmentLabel middle prefixInclude ⊤ lifted localValid idx Rf.val Rc.val - let middleAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hGamma gammaOrdinal gammaSubset - let lift := M.semanticStructuralNameLift c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace hGamma gammaOrdinal gammaSubset infinite choice - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - successorLabel.val ∈ M.sets ∧ - a.principalFix E ≤ middleAct.stabilizer middle successorLabel ∧ - HereditarilySymmetric middleAct middle (a.principalSupportFamily ⊥ directed) successorLabel ∧ - (lift successorLabel).val = successorLabel.val ∧ - (lift successorLabel).val ∈ M.sets ∧ - a.principalFix E ≤ upperAct.stabilizer upper (lift successorLabel) ∧ - HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) (lift successorLabel) ∧ - ∀ H : ConditionFilter (SetMembers upperSet), H.GenericFor (formulaFamily (M.nameDomain upper)) → - let J := Name.eval {p | H.mem p} (lift successorLabel) - let coarse := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val) - let fine := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rf.val) - Name.eval {p | H.mem p} (Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val) = J ∧ - InjectionCode coarse fine J ∧ - J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed - historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows - let upper := SetMembers.presentation upperSet - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, - lifted, squared, stages, history] - (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history - pairing unions powers separation collection hG hL supports hh hLifted witnesses - let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset - pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) - topMem topRows mono - intro V E U Rf Rc index - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - let gamma := insert alpha alpha - let hGamma := M.insert_mem pairing unions hAlpha hAlpha - let gammaOrdinal := ordinalSetProperty_succ cutOrdinal - let alphaGamma : alpha ⊆ gamma := fun x hx => ZFSet.mem_insert_of_mem alpha hx - let gammaSubset : gamma ⊆ stages := fun x hx => - Or.elim (Iff.mp ZFSet.mem_insert_iff hx) - (fun equal => Eq.mpr (congrArg (fun z => z ∈ stages) equal) member) - (fun old => subset x old) - let gammaPacked := graphRestriction gamma packed - let gammaPackedGround := M.graphRestriction_mem unions separation hGamma hPacked - let gammaRun := historyRun.restrict gammaOrdinal gammaSubset - let middleSet := M.refinementHistoryForcing c.carrier lifted gamma gammaPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted gamma gammaPacked - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted gamma gammaPacked - gammaRun.carriers gammaOrdinal carrier (c.encode ⊤) topMem topRows - let middle := SetMembers.presentation middleSet - let gammaMono := fun level fields (entry : ZFSet.pair level (refinementFormulaDataCode fields) ∈ gammaPacked) => mono level fields - (And.left (Iff.mp pair_mem_graphRestriction entry)) - let nestedInclude := RecursiveRefinementOrderHistory.inclusionFunction gammaRun gammaOrdinal cutOrdinal alphaGamma - pairing unions powers separation infinite choice hGamma gammaPackedGround hLifted hAlpha carrier - (c.encode ⊤) topMem topRows gammaMono - let toNested := fun x : SetMembers Q => SetMembers.ofMem (SetMembers.raw x) - (Eq.mpr (congrArg (fun h => SetMembers.raw x ∈ M.refinementHistoryForcing c.carrier lifted alpha h) - (graphRestriction_restrict alphaGamma)) (SetMembers.raw_mem x)) - let prefixInclude := fun x : SetMembers Q => nestedInclude (toNested x) - let successorLabel := Name.refinementAssignmentLabel middle prefixInclude ⊤ lifted localValid idx Rf.val Rc.val - let middleAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hGamma gammaOrdinal gammaSubset - let lift := M.semanticStructuralNameLift c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace hGamma gammaOrdinal gammaSubset infinite choice - let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace - have canonical := M.semanticStructuralAssignmentLabel_canonical_successor_name c act b s a ⊥ directed - lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index - obtain ⟨Uc, Rfc, Rcc, uEq, fineEq, coarseEq, canonicalIndex, labelEq, canonicalGround, - canonicalSupport, canonicalHS, ground, supported, hsName, liftedEq, liftedGround, - liftedSupport, liftedHS, same⟩ := canonical - refine ⟨ground, supported, hsName, liftedEq.trans labelEq, liftedGround, liftedSupport, liftedHS, ?_⟩ - intro H ordinary - have injection := fulfilled.structural_assignment_label_injection collection infinite choice labels - small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 stages history hs hh stagesOrdinal trace alpha member V E U Rf Rc index H ordinary - dsimp only at injection - rw [same H] at injection - exact ⟨same H, injection⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPersistentAssignmentLabels + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_persistent_successor_label_injection + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset + pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) + topMem topRows mono + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → + let gamma := insert alpha alpha + let hGamma := M.insert_mem pairing unions hAlpha hAlpha + let gammaOrdinal := ordinalSetProperty_succ cutOrdinal + let alphaGamma : alpha ⊆ gamma := fun x hx => ZFSet.mem_insert_of_mem alpha hx + let gammaSubset : gamma ⊆ stages := fun x hx => + Or.elim (Iff.mp ZFSet.mem_insert_iff hx) + (fun equal => Eq.mpr (congrArg (fun z => z ∈ stages) equal) member) + (fun old => subset x old) + let gammaPacked := graphRestriction gamma packed + let gammaPackedGround := M.graphRestriction_mem unions separation hGamma hPacked + let gammaRun := historyRun.restrict gammaOrdinal gammaSubset + let middleSet := M.refinementHistoryForcing c.carrier lifted gamma gammaPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted gamma gammaPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted gamma gammaPacked + gammaRun.carriers gammaOrdinal carrier (c.encode ⊤) topMem topRows + let middle := SetMembers.presentation middleSet + let gammaMono := fun level fields (entry : ZFSet.pair level (refinementFormulaDataCode fields) ∈ gammaPacked) => mono level fields + (And.left (Iff.mp pair_mem_graphRestriction entry)) + let nestedInclude := RecursiveRefinementOrderHistory.inclusionFunction gammaRun gammaOrdinal cutOrdinal alphaGamma + pairing unions powers separation infinite choice hGamma gammaPackedGround hLifted hAlpha carrier + (c.encode ⊤) topMem topRows gammaMono + let toNested := fun x : SetMembers Q => SetMembers.ofMem (SetMembers.raw x) + (Eq.mpr (congrArg (fun h => SetMembers.raw x ∈ M.refinementHistoryForcing c.carrier lifted alpha h) + (graphRestriction_restrict alphaGamma)) (SetMembers.raw_mem x)) + let prefixInclude := fun x : SetMembers Q => nestedInclude (toNested x) + let successorLabel := Name.refinementAssignmentLabel middle prefixInclude ⊤ lifted localValid idx Rf.val Rc.val + let middleAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hGamma gammaOrdinal gammaSubset + let lift := M.semanticStructuralNameLift c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace hGamma gammaOrdinal gammaSubset infinite choice + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + successorLabel.val ∈ M.sets ∧ + a.principalFix E ≤ middleAct.stabilizer middle successorLabel ∧ + HereditarilySymmetric middleAct middle (a.principalSupportFamily ⊥ directed) successorLabel ∧ + (lift successorLabel).val = successorLabel.val ∧ + (lift successorLabel).val ∈ M.sets ∧ + a.principalFix E ≤ upperAct.stabilizer upper (lift successorLabel) ∧ + HereditarilySymmetric upperAct upper (a.principalSupportFamily ⊥ directed) (lift successorLabel) ∧ + ∀ H : ConditionFilter (SetMembers upperSet), H.GenericFor (formulaFamily (M.nameDomain upper)) → + let J := Name.eval {p | H.mem p} (lift successorLabel) + let coarse := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rc.val) + let fine := Name.eval {q | H.mem (inc q)} (Name.refinementQuotient lifted localValid U.val Rf.val) + Name.eval {p | H.mem p} (Name.refinementAssignmentLabel upper inc ⊤ lifted localValid idx Rf.val Rc.val) = J ∧ + InjectionCode coarse fine J ∧ + J ∈ (M.symmetricExtension upper upperAct (a.principalSupportFamily ⊥ directed) H).sets := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let upperSet := M.refinementHistoryForcing c.carrier lifted stages packed + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted stages packed + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted stages packed + historyRun.carriers stagesOrdinal carrier (c.encode ⊤) topMem topRows + let upper := SetMembers.presentation upperSet + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, + lifted, squared, stages, history] + (Fin.cases hG (Fin.cases hL (Fin.cases order (Fin.cases supports + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared stages history + pairing unions powers separation collection hG hL supports hh hLifted witnesses + let inc := RecursiveRefinementOrderHistory.inclusionFunction historyRun stagesOrdinal cutOrdinal subset + pairing unions powers separation infinite choice hs hPacked hLifted hAlpha carrier (c.encode ⊤) + topMem topRows mono + intro V E U Rf Rc index + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + let gamma := insert alpha alpha + let hGamma := M.insert_mem pairing unions hAlpha hAlpha + let gammaOrdinal := ordinalSetProperty_succ cutOrdinal + let alphaGamma : alpha ⊆ gamma := fun x hx => ZFSet.mem_insert_of_mem alpha hx + let gammaSubset : gamma ⊆ stages := fun x hx => + Or.elim (Iff.mp ZFSet.mem_insert_iff hx) + (fun equal => Eq.mpr (congrArg (fun z => z ∈ stages) equal) member) + (fun old => subset x old) + let gammaPacked := graphRestriction gamma packed + let gammaPackedGround := M.graphRestriction_mem unions separation hGamma hPacked + let gammaRun := historyRun.restrict gammaOrdinal gammaSubset + let middleSet := M.refinementHistoryForcing c.carrier lifted gamma gammaPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted gamma gammaPacked + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted gamma gammaPacked + gammaRun.carriers gammaOrdinal carrier (c.encode ⊤) topMem topRows + let middle := SetMembers.presentation middleSet + let gammaMono := fun level fields (entry : ZFSet.pair level (refinementFormulaDataCode fields) ∈ gammaPacked) => mono level fields + (And.left (Iff.mp pair_mem_graphRestriction entry)) + let nestedInclude := RecursiveRefinementOrderHistory.inclusionFunction gammaRun gammaOrdinal cutOrdinal alphaGamma + pairing unions powers separation infinite choice hGamma gammaPackedGround hLifted hAlpha carrier + (c.encode ⊤) topMem topRows gammaMono + let toNested := fun x : SetMembers Q => SetMembers.ofMem (SetMembers.raw x) + (Eq.mpr (congrArg (fun h => SetMembers.raw x ∈ M.refinementHistoryForcing c.carrier lifted alpha h) + (graphRestriction_restrict alphaGamma)) (SetMembers.raw_mem x)) + let prefixInclude := fun x : SetMembers Q => nestedInclude (toNested x) + let successorLabel := Name.refinementAssignmentLabel middle prefixInclude ⊤ lifted localValid idx Rf.val Rc.val + let middleAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hGamma gammaOrdinal gammaSubset + let lift := M.semanticStructuralNameLift c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace hGamma gammaOrdinal gammaSubset infinite choice + let upperAct := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace + have canonical := M.semanticStructuralAssignmentLabel_canonical_successor_name c act b s a ⊥ directed + lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice V E U Rf Rc index + obtain ⟨Uc, Rfc, Rcc, uEq, fineEq, coarseEq, canonicalIndex, labelEq, canonicalGround, + canonicalSupport, canonicalHS, ground, supported, hsName, liftedEq, liftedGround, + liftedSupport, liftedHS, same⟩ := canonical + refine ⟨ground, supported, hsName, liftedEq.trans labelEq, liftedGround, liftedSupport, liftedHS, ?_⟩ + intro H ordinary + have injection := fulfilled.structural_assignment_label_injection collection infinite choice labels + small smallD irreflexive columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 stages history hs hh stagesOrdinal trace alpha member V E U Rf Rc index H ordinary + dsimp only at injection + rw [same H] at injection + exact ⟨same H, injection⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixCompatibleCaps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixCompatibleCaps.lean index 728b681dc39ae6344593508c43b50dc1f1ee94e0..36fd2c3d32b3452c246ae93063fc3eddb47fda0a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixCompatibleCaps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixCompatibleCaps.lean @@ -1,271 +1,271 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralLateProfileExclusions - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_prefix_compatible_caps - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) - (small : M.sets.Countable) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let indices := refinementDataHistoryIndices alpha lowerPacked - let anchors := refinementIndexFieldGraph indices s.carrier 2 - ∀ (r : SetMembers Q) (row : SetMembers c.carrier) (A : ZFSet.{u}), - lower.encode r = ZFSet.pair (c.encode row) A → - StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) → - ∀ (V E D0 : SetMembers geometry.carrier) (B Pb Profiles : ZFSet.{u}), - V < E → V ≤ D0 → - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph Pb → - B ∈ M.sets → B.Nonempty → B ⊆ testedMeetFilter Pb geometry.order (s.encode E) → - M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph B = - testedMeetFilter Pb geometry.order (s.encode E) → - Profiles ∈ M.sets → M.groundEmbeddable Profiles ZFSet.omega → - (∀ profile ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph profile) → - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ D0) → - (∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A indices lifted S s.carrier mu - s.nonbottom.carrier s.conditionOrder anchors tuples) → - ∃ (g : SetMembers geometry.actors) (cap : SetMembers geometry.carrier) (q : SetMembers Q), - q ≤ r ∧ q ≤ localAct.iso g r ∧ g ∈ a.principalFix V ∧ V < cap ∧ ¬ E ≤ cap ∧ - a.iso g D0 ≤ cap ∧ - (∀ v : SetMembers geometry.carrier, - s.encode v ∈ testedMeetFilter Pb s.conditionOrder (s.encode E) → cap ≤ v) ∧ - (∀ v : SetMembers geometry.carrier, E ≤ v → - s.encode v ∉ testedMeetFilter Pb s.conditionOrder (s.encode E) → geometry.meet.smallMeet cap v = V) ∧ - (∀ profile ∈ Profiles, s.encode V ∉ profile → s.encode cap ∉ profile) ∧ - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared alpha history (b.encode g) A - ∃ commonRow : SetMembers c.carrier, - SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso g row) ∧ - lower.encode q = ZFSet.pair (c.encode commonRow) (A ∪ movedA) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let indices := refinementDataHistoryIndices alpha lowerPacked - let anchors := refinementIndexFieldGraph indices s.carrier 2 - intro r row A rCode prepared V E D0 B Pb Profiles strict bound filter hB nonempty contained - generated hProfiles smallProfiles profileFilters rowD dataD - have packedEq := (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared alpha history).trans - (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared subset) - have inNodes : B ⊆ geometry.carrier := fun z hz => - filter.subset ((mem_testedMeetFilter Pb geometry.order (s.encode E) z).1 (contained hz)).1 - have above : ∀ z ∈ B, ZFSet.pair (s.encode E) z ∈ geometry.order := fun z hz => - ((mem_testedMeetFilter Pb geometry.order (s.encode E) z).1 (contained hz)).2 - have condition : ZFSet.pair (c.encode row) A ∈ Q := rCode ▸ SetMembers.raw_mem r - obtain ⟨filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, - family, badComp, hBadComp, badCompSubset, badCompSmall, bad, hBad, badSubset, badSmall, - includesComp, goodProfiles, survivor, compatible⟩ := - fulfilled.structural_compatible_insertion_with_late_profiles collection infinite choice labels small - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - alpha (graphRestriction alpha history) hAlpha (M.graphRestriction_mem unions separation hAlpha hh) - cutOrdinal (trace.restrict cutOrdinal subset) row A - (by - change ZFSet.pair (c.encode row) A ∈ M.refinementHistoryForcing c.carrier lifted alpha - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history)) - rw [packedEq] - exact condition) - (by - change StoredPreparedConditionCode M c.carrier lifted alpha - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history)) - s.carrier (ZFSet.pair (c.encode row) A) - rw [packedEq] - exact rCode ▸ prepared) - V E D0 B Profiles strict bound hB inNodes nonempty above hProfiles smallProfiles profileFilters rowD - (by - let restrictedPacked := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history) - change ∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A - (refinementDataHistoryIndices alpha restrictedPacked) lifted S s.carrier mu - s.nonbottom.carrier s.conditionOrder - (refinementIndexFieldGraph (refinementDataHistoryIndices alpha restrictedPacked) s.carrier 2) tuples - dsimp only [restrictedPacked] - rw [packedEq] - exact dataD) - obtain ⟨label, outside⟩ := survivor - let g := family.decodedActors label - let cap := family.decodedCaps label - have capEdge := family.decodedCaps_entry label - obtain ⟨fixed, strictCap, notAbove, movedBound, tested, commonRow, rowCode, - qCondition, qBelow, qMovedBelow⟩ := compatible label outside - rw [M.structuralAssignmentImage_history_restrict, packedEq] at qCondition qBelow qMovedBelow - let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared alpha history (b.encode g) A - let q : SetMembers Q := SetMembers.ofMem (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) qCondition - have qCode : lower.encode q = ZFSet.pair (c.encode commonRow) (A ∪ movedA) := - SetMembers.raw_ofMem _ _ - have actedCode := M.semanticStructuralPrefixAction_coordinates c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction - hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 - children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset g r row A rCode - have leR : q ≤ r := by - change ZFSet.pair (lower.encode q) (lower.encode r) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted alpha lowerPacked - rw [qCode, rCode] - exact qBelow - have leMoved : q ≤ localAct.iso g r := by - change ZFSet.pair (lower.encode q) (SetMembers.raw (localAct.iso g r)) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder lifted alpha lowerPacked - rw [qCode, actedCode] - exact qMovedBelow - refine ⟨g, cap, q, leR, leMoved, fixed, strictCap, notAbove, movedBound, ?_, ?_, ?_, - commonRow, rowCode, qCode⟩ - · intro v member - rw [geometry.decoded_order_eq] at member - have ev : E ≤ v := ((mem_testedMeetFilter Pb geometry.order (s.encode E) (s.encode v)).1 member).2 - apply (tested v ev).1 - rwa [generated] - · intro v ev absent - rw [geometry.decoded_order_eq] at absent - apply (geometry.meet.smallMeet_eq_iff cap v V).2 - apply (tested v ev).2 - rwa [generated] - · exact goodProfiles _ _ capEdge outside - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalStructuralLateProfileExclusions + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_prefix_compatible_caps + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (labels : Labels = M.groundOmegaOne pairing unions powers separation collection infinite) + (small : M.sets.Countable) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let indices := refinementDataHistoryIndices alpha lowerPacked + let anchors := refinementIndexFieldGraph indices s.carrier 2 + ∀ (r : SetMembers Q) (row : SetMembers c.carrier) (A : ZFSet.{u}), + lower.encode r = ZFSet.pair (c.encode row) A → + StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) → + ∀ (V E D0 : SetMembers geometry.carrier) (B Pb Profiles : ZFSet.{u}), + V < E → V ≤ D0 → + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph Pb → + B ∈ M.sets → B.Nonempty → B ⊆ testedMeetFilter Pb geometry.order (s.encode E) → + M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph B = + testedMeetFilter Pb geometry.order (s.encode E) → + Profiles ∈ M.sets → M.groundEmbeddable Profiles ZFSet.omega → + (∀ profile ∈ Profiles, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph profile) → + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw row) → i ≤ D0) → + (∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A indices lifted S s.carrier mu + s.nonbottom.carrier s.conditionOrder anchors tuples) → + ∃ (g : SetMembers geometry.actors) (cap : SetMembers geometry.carrier) (q : SetMembers Q), + q ≤ r ∧ q ≤ localAct.iso g r ∧ g ∈ a.principalFix V ∧ V < cap ∧ ¬ E ≤ cap ∧ + a.iso g D0 ≤ cap ∧ + (∀ v : SetMembers geometry.carrier, + s.encode v ∈ testedMeetFilter Pb s.conditionOrder (s.encode E) → cap ≤ v) ∧ + (∀ v : SetMembers geometry.carrier, E ≤ v → + s.encode v ∉ testedMeetFilter Pb s.conditionOrder (s.encode E) → geometry.meet.smallMeet cap v = V) ∧ + (∀ profile ∈ Profiles, s.encode V ∉ profile → s.encode cap ∉ profile) ∧ + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared alpha history (b.encode g) A + ∃ commonRow : SetMembers c.carrier, + SetMembers.raw commonRow = SetMembers.raw row ∪ SetMembers.raw (act.iso g row) ∧ + lower.encode q = ZFSet.pair (c.encode commonRow) (A ∪ movedA) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let indices := refinementDataHistoryIndices alpha lowerPacked + let anchors := refinementIndexFieldGraph indices s.carrier 2 + intro r row A rCode prepared V E D0 B Pb Profiles strict bound filter hB nonempty contained + generated hProfiles smallProfiles profileFilters rowD dataD + have packedEq := (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared alpha history).trans + (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared subset) + have inNodes : B ⊆ geometry.carrier := fun z hz => + filter.subset ((mem_testedMeetFilter Pb geometry.order (s.encode E) z).1 (contained hz)).1 + have above : ∀ z ∈ B, ZFSet.pair (s.encode E) z ∈ geometry.order := fun z hz => + ((mem_testedMeetFilter Pb geometry.order (s.encode E) z).1 (contained hz)).2 + have condition : ZFSet.pair (c.encode row) A ∈ Q := rCode ▸ SetMembers.raw_mem r + obtain ⟨filterGround, filterCode, contains, least, filterAbove, caps, hCaps, actors, hActors, + family, badComp, hBadComp, badCompSubset, badCompSmall, bad, hBad, badSubset, badSmall, + includesComp, goodProfiles, survivor, compatible⟩ := + fulfilled.structural_compatible_insertion_with_late_profiles collection infinite choice labels small + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + alpha (graphRestriction alpha history) hAlpha (M.graphRestriction_mem unions separation hAlpha hh) + cutOrdinal (trace.restrict cutOrdinal subset) row A + (by + change ZFSet.pair (c.encode row) A ∈ M.refinementHistoryForcing c.carrier lifted alpha + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history)) + rw [packedEq] + exact condition) + (by + change StoredPreparedConditionCode M c.carrier lifted alpha + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history)) + s.carrier (ZFSet.pair (c.encode row) A) + rw [packedEq] + exact rCode ▸ prepared) + V E D0 B Profiles strict bound hB inNodes nonempty above hProfiles smallProfiles profileFilters rowD + (by + let restrictedPacked := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history) + change ∀ z ∈ A, ZFSet.pair z (s.encode D0) ∈ stageOneDataBounds A + (refinementDataHistoryIndices alpha restrictedPacked) lifted S s.carrier mu + s.nonbottom.carrier s.conditionOrder + (refinementIndexFieldGraph (refinementDataHistoryIndices alpha restrictedPacked) s.carrier 2) tuples + dsimp only [restrictedPacked] + rw [packedEq] + exact dataD) + obtain ⟨label, outside⟩ := survivor + let g := family.decodedActors label + let cap := family.decodedCaps label + have capEdge := family.decodedCaps_entry label + obtain ⟨fixed, strictCap, notAbove, movedBound, tested, commonRow, rowCode, + qCondition, qBelow, qMovedBelow⟩ := compatible label outside + rw [M.structuralAssignmentImage_history_restrict, packedEq] at qCondition qBelow qMovedBelow + let movedA := M.structuralAssignmentImage b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared alpha history (b.encode g) A + let q : SetMembers Q := SetMembers.ofMem (ZFSet.pair (c.encode commonRow) (A ∪ movedA)) qCondition + have qCode : lower.encode q = ZFSet.pair (c.encode commonRow) (A ∪ movedA) := + SetMembers.raw_ofMem _ _ + have actedCode := M.semanticStructuralPrefixAction_coordinates c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction + hG hL order graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 + children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset g r row A rCode + have leR : q ≤ r := by + change ZFSet.pair (lower.encode q) (lower.encode r) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted alpha lowerPacked + rw [qCode, rCode] + exact qBelow + have leMoved : q ≤ localAct.iso g r := by + change ZFSet.pair (lower.encode q) (SetMembers.raw (localAct.iso g r)) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder lifted alpha lowerPacked + rw [qCode, actedCode] + exact qMovedBelow + refine ⟨g, cap, q, leR, leMoved, fixed, strictCap, notAbove, movedBound, ?_, ?_, ?_, + commonRow, rowCode, qCode⟩ + · intro v member + rw [geometry.decoded_order_eq] at member + have ev : E ≤ v := ((mem_testedMeetFilter Pb geometry.order (s.encode E) (s.encode v)).1 member).2 + apply (tested v ev).1 + rwa [generated] + · intro v ev absent + rw [geometry.decoded_order_eq] at absent + apply (geometry.meet.smallMeet_eq_iff cap v V).2 + apply (tested v ev).2 + rwa [generated] + · exact goodProfiles _ _ capEdge outside + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixPreparationBatches.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixPreparationBatches.lean index eeb6eb8792592f57e66e1586f30c7ced7785f734..5ee554d544da7bed4426a88685f3165b0162e75c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixPreparationBatches.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPrefixPreparationBatches.lean @@ -1,221 +1,221 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralPrefixPreparationInputs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalEnumeratedCertificateFamilies - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) -variable {R : Type u} [PartialOrder R] (c : Presentation R) - -theorem exists_prefixPreparationBatch - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (rowClosed : InternallyCountablyClosed M c) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) - (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (rowAction : a.actionGraph c t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) - (topMem : rowTop ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) - t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 level prior) stages history) - (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice rowClosed - let lowerGround := inputs.1 - let maps := inputs.2.2.1 - let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid - ∀ (row A : ZFSet.{u}) (_condition : ZFSet.pair row A ∈ - M.refinementHistoryForcing c.carrier T stages packed), - let selected := assignmentOnIndices indices T A - let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected - let bound := M.groundRelations T lower.carrier - let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) - ∀ (H : ConditionFilter (SetMembers Q)) - (_genericCoded : H.GenericFor (M.codedFamily lower)) - (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain lower))) - (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - d.principalFix v ≤ lowerAct.stabilizer lower x.val → - d.principalFix w ≤ lowerAct.stabilizer lower y.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ τ : (M.nameDomain lower).names, - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ - d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ - Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) - (p : SetMembers Q) (_hp : H.mem p), - ∃ (validJ : ∀ z ∈ J, IsName lower z) (hJ : J ∈ M.sets), - M.groundEmbeddable J ZFSet.omega ∧ - (∀ z : Name lower, z.val ∈ J → - HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) z ∧ - Name.eval {q | H.mem q} z ⊆ Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) ∧ - ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), - ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix)) k ∧ - k ⊆ M.supportedCertificateFamilyRelation lowerAct lower b T d.principalFix - geometry.order J validJ H ∧ - ∃ q, H.mem q ∧ q ≤ p ∧ - Forces (M.nameDomain lower) supportedCertificateFamilyFormula - (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers - separation collection lowerGround geometry.actors_ground geometry.carrier_ground - (geometry.decoded_supportBasis_ground pairing unions powers separation) - maps hT valid (M.omega_mem separation infinite) geometry.order J k - geometry.order_ground hJ hk validJ) q ∧ - ∃ enumerations ∈ M.sets, - ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix)) enumerations ∧ - enumerations ⊆ M.certificateEnumerationRelation J b.carrier - (M.niceSupportNameCodes lowerAct lower T d.principalFix) k ∧ - (∀ j F B f e names, - ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → - SynchronizedEnumerationCode ZFSet.omega - (M.niceSupportNameCodes lowerAct lower T d.principalFix) B f e names) ∧ - ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F = M.visibleSupportProfile lowerAct lower b d T H (Name.eval {p | H.mem p} z.val) ∧ - MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ - B.Nonempty ∧ M.DecidesVisibilityProfile lowerAct lower b d.principalFix T F z.val q ∧ - (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix → - ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) ∧ - ∃ e ∈ M.sets, ∃ names ∈ M.sets, - ZFSet.IsFunc ZFSet.omega B e ∧ - ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes lowerAct lower T d.principalFix) names ∧ - (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ - (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → - ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let b := SetMembers.presentation geometry.carrier - let t := SetMembers.presentation geometry.actors - let d := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - dsimp only - intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 - children1 children2 topMem topRows - let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeAction - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let omega := M.omega_mem separation infinite - intro stages history alpha hs hh ordinal trace member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member ordinal member - let subset := (And.left ordinal) alpha member - let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop - (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) - (supportBasisCode b t d.principalFix) T T2 ordinal trace - let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked - let historyTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows - let lower := SetMembers.presentation Q - let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) - cutOrdinal carrier T valid1 - let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset - let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice rowClosed - let lowerGround := inputs.1 - let lowerOrder := inputs.2.1 - let maps := inputs.2.2.1 - let lowerClosed := inputs.2.2.2.1 - let terms := inputs.2.2.2.2.1 - let children := inputs.2.2.2.2.2 - let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid - intro row A condition H genericCoded genericFormula descent p hp - let selected := assignmentOnIndices indices T A - let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected - let bound := M.groundRelations T lower.carrier - let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) - obtain ⟨_, _, _, hJ, smallJ, validJ, facts, _⟩ := - M.semanticStructuralPrefix_assignmentClassRequests c a t b d ⊥ directed T T2 rowTop - pairing unions powers separation collection carrier rowOrder rowAction - geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports - hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member - infinite choice condition - refine ⟨validJ, hJ, smallJ, (fun z hz => ⟨(facts z hz).1, (facts z hz).2 H⟩), ?_⟩ - exact fulfilled.exists_enumeratedSupportedCertificateFamily lower collection infinite choice - lowerGround lowerOrder small lowerClosed smallD irreflexive lowerAct maps T hT valid terms children - H genericCoded genericFormula descent J hJ validJ smallJ - (fun z hz => (facts z hz).1) (fun z hz => (facts z hz).2 H) p hp - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundSemanticStructuralPrefixPreparationInputs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalEnumeratedCertificateFamilies + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) +variable {R : Type u} [PartialOrder R] (c : Presentation R) + +theorem exists_prefixPreparationBatch + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (rowClosed : InternallyCountablyClosed M c) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + ∀ (a : PosetAction (SetMembers geometry.actors) R) (T T2 rowTop : ZFSet.{u}) + (carrier : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (rowAction : a.actionGraph c t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily ⊥ directed) tau) + (topMem : rowTop ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row rowTop ∈ c.conditionOrder), + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + ∀ (stages history alpha : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder rowTop (a.actionGraph c t) + t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 level prior) stages history) + (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + letI := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice rowClosed + let lowerGround := inputs.1 + let maps := inputs.2.2.1 + let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid + ∀ (row A : ZFSet.{u}) (_condition : ZFSet.pair row A ∈ + M.refinementHistoryForcing c.carrier T stages packed), + let selected := assignmentOnIndices indices T A + let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected + let bound := M.groundRelations T lower.carrier + let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) + ∀ (H : ConditionFilter (SetMembers Q)) + (_genericCoded : H.GenericFor (M.codedFamily lower)) + (_genericFormula : H.GenericFor (formulaFamily (M.nameDomain lower))) + (_descent : ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + d.principalFix v ≤ lowerAct.stabilizer lower x.val → + d.principalFix w ≤ lowerAct.stabilizer lower y.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ τ : (M.nameDomain lower).names, + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) τ.val ∧ + d.principalFix (geometry.meet.smallMeet v w) ≤ lowerAct.stabilizer lower τ.val ∧ + Name.eval {p | H.mem p} τ.val = Name.eval {p | H.mem p} x.val) + (p : SetMembers Q) (_hp : H.mem p), + ∃ (validJ : ∀ z ∈ J, IsName lower z) (hJ : J ∈ M.sets), + M.groundEmbeddable J ZFSet.omega ∧ + (∀ z : Name lower, z.val ∈ J → + HereditarilySymmetric lowerAct lower (d.principalSupportFamily ⊥ directed) z ∧ + Name.eval {q | H.mem q} z ⊆ Name.eval {q | H.mem q} (Name.familySet ⊤ T valid)) ∧ + ∃ (k : ZFSet.{u}) (hk : k ∈ M.sets), + ZFSet.IsFunc J (M.supportedEqualityCertificateBound b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix)) k ∧ + k ⊆ M.supportedCertificateFamilyRelation lowerAct lower b T d.principalFix + geometry.order J validJ H ∧ + ∃ q, H.mem q ∧ q ≤ p ∧ + Forces (M.nameDomain lower) supportedCertificateFamilyFormula + (M.supportedCertificateFamilyEnv lowerAct lower t b T d.principalFix pairing unions powers + separation collection lowerGround geometry.actors_ground geometry.carrier_ground + (geometry.decoded_supportBasis_ground pairing unions powers separation) + maps hT valid (M.omega_mem separation infinite) geometry.order J k + geometry.order_ground hJ hk validJ) q ∧ + ∃ enumerations ∈ M.sets, + ZFSet.IsFunc J (M.synchronizedEnumerationBound b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix)) enumerations ∧ + enumerations ⊆ M.certificateEnumerationRelation J b.carrier + (M.niceSupportNameCodes lowerAct lower T d.principalFix) k ∧ + (∀ j F B f e names, + ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + ZFSet.pair j (ZFSet.pair e names) ∈ enumerations → + SynchronizedEnumerationCode ZFSet.omega + (M.niceSupportNameCodes lowerAct lower T d.principalFix) B f e names) ∧ + ∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F = M.visibleSupportProfile lowerAct lower b d T H (Name.eval {p | H.mem p} z.val) ∧ + MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F ∧ + B.Nonempty ∧ M.DecidesVisibilityProfile lowerAct lower b d.principalFix T F z.val q ∧ + (∀ v ∈ B, ∀ tau : Name lower, tau.val ∈ M.niceSupportNameCodes lowerAct lower T d.principalFix → + ZFSet.pair v tau.val ∈ f → Name.ForcesEq q z.val tau) ∧ + ∃ e ∈ M.sets, ∃ names ∈ M.sets, + ZFSet.IsFunc ZFSet.omega B e ∧ + ZFSet.IsFunc ZFSet.omega (M.niceSupportNameCodes lowerAct lower T d.principalFix) names ∧ + (∀ v ∈ B, ∃ n ∈ ZFSet.omega, ZFSet.pair n v ∈ e) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧ + (∀ n ∈ ZFSet.omega, ∀ v tau, ZFSet.pair n v ∈ e → + ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names) := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let b := SetMembers.presentation geometry.carrier + let t := SetMembers.presentation geometry.actors + let d := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + dsimp only + intro a T T2 rowTop carrier rowOrder rowAction hT hT2 valid1 valid2 closed1 closed2 + children1 children2 topMem topRows + let nodeOrder : b.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let nodeAction : d.actionGraph b t ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph d b t pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeAction + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let omega := M.omega_mem separation infinite + intro stages history alpha hs hh ordinal trace member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member ordinal member + let subset := (And.left ordinal) alpha member + let packed := M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier T alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder rowTop + (a.actionGraph c t) t.carrier b.carrier b.conditionOrder (d.actionGraph b t) + (supportBasisCode b t d.principalFix) T T2 ordinal trace + let historyOrder := M.refinementHistoryPartialOrder c.conditionOrder_code T alpha lowerPacked + let historyTop := M.refinementHistoryOrderTop c.conditionOrder_code T alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier rowTop topMem topRows + let lower := SetMembers.presentation Q + let valid := M.refinementHistoryRowNameFamily_valid c (historyRun.carriers.restrict cutOrdinal subset) + cutOrdinal carrier T valid1 + let lowerAct := M.semanticStructuralPrefixAction c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hh trace hAlpha cutOrdinal subset + let inputs := M.semanticStructuralPrefix_preparation_inputs c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice rowClosed + let lowerGround := inputs.1 + let lowerOrder := inputs.2.1 + let maps := inputs.2.2.1 + let lowerClosed := inputs.2.2.2.1 + let terms := inputs.2.2.2.2.1 + let children := inputs.2.2.2.2.2 + let indices := M.niceRefinementIndices lowerAct lower b d alpha T T2 valid + intro row A condition H genericCoded genericFormula descent p hp + let selected := assignmentOnIndices indices T A + let graphs := M.niceAssignmentClassGraphs lowerAct lower b d alpha T T2 valid selected + let bound := M.groundRelations T lower.carrier + let J := relationImage selected bound (graphs 0) ∪ relationImage selected bound (graphs 1) + obtain ⟨_, _, _, hJ, smallJ, validJ, facts, _⟩ := + M.semanticStructuralPrefix_assignmentClassRequests c a t b d ⊥ directed T T2 rowTop + pairing unions powers separation collection carrier rowOrder rowAction + geometry.actors_ground geometry.carrier_ground nodeOrder nodeAction nodeMaps supports + hT hT2 omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hs hh ordinal trace member + infinite choice condition + refine ⟨validJ, hJ, smallJ, (fun z hz => ⟨(facts z hz).1, (facts z hz).2 H⟩), ?_⟩ + exact fulfilled.exists_enumeratedSupportedCertificateFamily lower collection infinite choice + lowerGround lowerOrder small lowerClosed smallD irreflexive lowerAct maps T hT valid terms children + H genericCoded genericFormula descent J hJ validJ smallJ + (fun z hz => (facts z hz).1) (fun z hz => (facts z hz).2 H) p hp + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPreparedPrefixBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPreparedPrefixBounds.lean index 4f4c0b43979bd2f7c633cb849aa4d7dc8857b7e7..f2dab50d17933b89385b128f0201d6a215f5a9a4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPreparedPrefixBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalPreparedPrefixBounds.lean @@ -1,240 +1,240 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowNameSupportBounds -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralSupportPreparation - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem prepared_prefix_term_bound - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let prefixIndices := refinementDataHistoryIndices alpha lowerPacked - let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid - ∀ (E : SetMembers geometry.carrier) (u : (M.nameDomain lower).names), u.val.val ∈ lifted → - ∀ q0 : SetMembers Q, - ∃ r : SetMembers Q, r ≤ q0 ∧ - ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), - lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ - StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ - ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ - a.principalFix D0 ≤ localAct.stabilizer lower u.val ∧ - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ - (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ - stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier - s.conditionOrder prefixAnchors tuples) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - intro E u hu q0 - have packedEq := (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared alpha history).trans - (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared subset) - have preparedResult : GroundSupportPreparedStrengtheningResult M c lifted alpha lowerPacked - s.carrier (lower.encode q0) := by - have actual := fulfilled.structural_support_prepared_strengthening - collection infinite choice small smallD irreflexive columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - alpha (graphRestriction alpha history) hAlpha (M.graphRestriction_mem unions separation hAlpha hh) - cutOrdinal (trace.restrict cutOrdinal subset) - dsimp only at actual - rw [packedEq] at actual - exact actual (lower.encode q0) (lower.encode_mem q0) - obtain ⟨rawR, rawMember, belowQ0, supportsR, _hSupportsR, _supportsSubset, _smallSupports, prepared⟩ := - preparedResult - let r : SetMembers Q := SetMembers.ofMem rawR rawMember - have encodedR : lower.encode r = rawR := SetMembers.raw_ofMem rawR rawMember - have rBelowQ0 : r ≤ q0 := by - apply (lower.pair_mem_conditionOrder r q0).1 - rw [M.refinementHistoryDecodedOrder_eq] - rw [encodedR] - exact belowQ0 - obtain ⟨rawRow, rowMember, lowerA, _, rawCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape c.carrier lifted alpha lowerPacked rawMember) - let rowR := SetMembers.ofMem rawRow rowMember - have rCode : lower.encode r = ZFSet.pair (c.encode rowR) lowerA := - encodedR.trans (rawCode.trans (congrArg (fun z => ZFSet.pair z lowerA) - (SetMembers.raw_ofMem rawRow rowMember).symm)) - have preparedAt : StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier - (lower.encode r) := encodedR.symm ▸ prepared.forget - have countableBound : ∀ Z ∈ M.sets, Z ⊆ s.carrier → M.groundEmbeddable Z ZFSet.omega → - ∃ X : SetMembers geometry.carrier, ∀ z : SetMembers geometry.carrier, s.encode z ∈ Z → z ≤ X := - geometry.decoded_countable_bound - (fun Z hZ subset countable => (fulfilled.countable_localization Z hZ subset countable).2) - have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice - coordinates two - obtain ⟨_lowerGround, _lowerOrder, _maps, _lowerClosed, _terms, children⟩ := - M.semanticStructuralPrefix_preparation_inputs c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hs hh stagesOrdinal trace member infinite choice rowClosed - have restrictedMember : ZFSet.pair (c.encode rowR) lowerA ∈ - M.structuralForcingCarrier c.carrier b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history) := by - change ZFSet.pair (c.encode rowR) lowerA ∈ M.refinementHistoryForcing c.carrier lifted alpha _ - rw [packedEq] - exact rCode ▸ lower.encode_mem r - obtain ⟨D0, rowBound, dataBound, eBelow, nameSupport⟩ := - M.binaryRowStructuralCondition_nameSupportBound s columns pairing unions powers separation collection - infinite choice hL order hColumns directed countableBound hmu ⊤ valid hLifted b.carrier - (supportBasisCode s b a.principalFix) squared alpha (graphRestriction alpha history) - hG supports hSquared hAlpha (M.graphRestriction_mem unions separation hAlpha hh) - rowR lowerA restrictedMember lower localAct a ⊥ ![u.val, u.val] - (fun i => Fin.cases (children u.val hu) - (Fin.cases (children u.val hu) (fun j => Fin.elim0 j)) i) E - rw [packedEq] at dataBound - exact ⟨r, rBelowQ0, rowR, lowerA, rCode, preparedAt, D0, eBelow, nameSupport 0, rowBound, dataBound⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundBinaryRowNameSupportBounds +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralSupportPreparation + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem prepared_prefix_term_bound + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let prefixIndices := refinementDataHistoryIndices alpha lowerPacked + let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid + ∀ (E : SetMembers geometry.carrier) (u : (M.nameDomain lower).names), u.val.val ∈ lifted → + ∀ q0 : SetMembers Q, + ∃ r : SetMembers Q, r ≤ q0 ∧ + ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), + lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ + StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ + ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ + a.principalFix D0 ≤ localAct.stabilizer lower u.val ∧ + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ + (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ + stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier + s.conditionOrder prefixAnchors tuples) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + intro E u hu q0 + have packedEq := (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared alpha history).trans + (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared subset) + have preparedResult : GroundSupportPreparedStrengtheningResult M c lifted alpha lowerPacked + s.carrier (lower.encode q0) := by + have actual := fulfilled.structural_support_prepared_strengthening + collection infinite choice small smallD irreflexive columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + alpha (graphRestriction alpha history) hAlpha (M.graphRestriction_mem unions separation hAlpha hh) + cutOrdinal (trace.restrict cutOrdinal subset) + dsimp only at actual + rw [packedEq] at actual + exact actual (lower.encode q0) (lower.encode_mem q0) + obtain ⟨rawR, rawMember, belowQ0, supportsR, _hSupportsR, _supportsSubset, _smallSupports, prepared⟩ := + preparedResult + let r : SetMembers Q := SetMembers.ofMem rawR rawMember + have encodedR : lower.encode r = rawR := SetMembers.raw_ofMem rawR rawMember + have rBelowQ0 : r ≤ q0 := by + apply (lower.pair_mem_conditionOrder r q0).1 + rw [M.refinementHistoryDecodedOrder_eq] + rw [encodedR] + exact belowQ0 + obtain ⟨rawRow, rowMember, lowerA, _, rawCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape c.carrier lifted alpha lowerPacked rawMember) + let rowR := SetMembers.ofMem rawRow rowMember + have rCode : lower.encode r = ZFSet.pair (c.encode rowR) lowerA := + encodedR.trans (rawCode.trans (congrArg (fun z => ZFSet.pair z lowerA) + (SetMembers.raw_ofMem rawRow rowMember).symm)) + have preparedAt : StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier + (lower.encode r) := encodedR.symm ▸ prepared.forget + have countableBound : ∀ Z ∈ M.sets, Z ⊆ s.carrier → M.groundEmbeddable Z ZFSet.omega → + ∃ X : SetMembers geometry.carrier, ∀ z : SetMembers geometry.carrier, s.encode z ∈ Z → z ≤ X := + geometry.decoded_countable_bound + (fun Z hZ subset countable => (fulfilled.countable_localization Z hZ subset countable).2) + have rowClosed := M.countable_function_internally_closed pairing unions powers separation infinite choice + coordinates two + obtain ⟨_lowerGround, _lowerOrder, _maps, _lowerClosed, _terms, children⟩ := + M.semanticStructuralPrefix_preparation_inputs c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hs hh stagesOrdinal trace member infinite choice rowClosed + have restrictedMember : ZFSet.pair (c.encode rowR) lowerA ∈ + M.structuralForcingCarrier c.carrier b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared alpha (graphRestriction alpha history) := by + change ZFSet.pair (c.encode rowR) lowerA ∈ M.refinementHistoryForcing c.carrier lifted alpha _ + rw [packedEq] + exact rCode ▸ lower.encode_mem r + obtain ⟨D0, rowBound, dataBound, eBelow, nameSupport⟩ := + M.binaryRowStructuralCondition_nameSupportBound s columns pairing unions powers separation collection + infinite choice hL order hColumns directed countableBound hmu ⊤ valid hLifted b.carrier + (supportBasisCode s b a.principalFix) squared alpha (graphRestriction alpha history) + hG supports hSquared hAlpha (M.graphRestriction_mem unions separation hAlpha hh) + rowR lowerA restrictedMember lower localAct a ⊥ ![u.val, u.val] + (fun i => Fin.cases (children u.val hu) + (Fin.cases (children u.val hu) (fun j => Fin.elim0 j)) i) E + rw [packedEq] at dataBound + exact ⟨r, rBelowQ0, rowR, lowerA, rCode, preparedAt, D0, eBelow, nameSupport 0, rowBound, dataBound⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageOneClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageOneClosure.lean index bfdbea8f56a086027ac492db50ace647d97c543f..15adefafdff41fbe25e6b49e921f53dd378f205d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageOneClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageOneClosure.lean @@ -1,313 +1,313 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageOneForcing -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneFlatConditions - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid -local notation "B" => M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection - -local notation "row" => M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "data" => M.stageOneConditionData a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (nodeOrder : b.conditionOrder ∈ M.sets) -variable (closed : InternallyCountablyClosed M c) - -include infinite choice nodeOrder closed in -theorem stageOneCondition_lower_bound : - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - ∀ seq : Nat → Shrink Condition, - natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → - ∃ q : Shrink Condition, - ((equivShrink Condition).symm q).assignments = - stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments) ∧ - ∀ n, q ≤ seq n := by - let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - intro seq whole decreasing - let typed : Nat → Condition := fun n => (equivShrink Condition).symm (seq n) - have typedDecreasing : Antitone typed := fun _ _ less => decreasing less - have rowDecreasing : Antitone (fun n => row (seq n)) := - fun _ _ less => (typedDecreasing less).1 - obtain ⟨rowGround, dataGround⟩ := M.stageOneSequence_projections_ground a c b d T T2 valid - pairing unions powers separation carrier order nodes hT indices base directed system collection - nodeOrder (M.omega_mem separation infinite) seq whole - obtain ⟨p, below⟩ := closed (fun n => row (seq n)) rowGround rowDecreasing - have hJ := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT - have smallRaw := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice - hJ (fun n => data (seq n)) dataGround - have small : stageOneAssignmentUnion (fun n => (typed n).assignments) ∈ B := by - simpa only [M.stageOneConditionData_raw] using smallRaw - let lower : Condition := StageOneCondition.chainUnion M c.pairEmpty pairing unions powers separation - collection pairedCarrier pairedOrder hT valid a b d base directed system T2 - typed typedDecreasing p below small - refine ⟨equivShrink Condition lower, ?_, ?_⟩ - · rw [Equiv.symm_apply_apply] - rfl - · intro n - change (equivShrink Condition).symm (equivShrink Condition lower) ≤ typed n - rw [Equiv.symm_apply_apply] - exact StageOneCondition.chainUnion_le M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 - typed typedDecreasing p below small n - -include infinite choice nodeOrder closed in -theorem stageOneCondition_internally_closed : - letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - InternallyCountablyClosed M (pres) := by - let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - intro seq whole decreasing - obtain ⟨q, _, below⟩ := M.stageOneCondition_lower_bound a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection infinite choice nodeOrder closed seq whole decreasing - exact ⟨q, below⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageOneOrder - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1 ∧ - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2 ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, forcingGround, objects, finitePowers⟩ := - fulfilled.exists_rowStageOneForcing collection infinite choice hK standard indices - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, forcingGround, ?_, objects, finitePowers⟩ - exact M.stageOneForcingOrder_mem act c s a _ _ valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first - order (M.omega_mem separation infinite) - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageOneClosure - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, forcingGround, orderGround, objects, finitePowers⟩ := - fulfilled.exists_rowStageOneOrder collection infinite choice hK standard indices - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, forcingGround, orderGround, ?_, objects, finitePowers⟩ - exact M.stageOneCondition_internally_closed act c s a _ _ valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection - infinite choice order - (M.countable_function_internally_closed pairing unions powers separation infinite choice coordinates two) - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageOneForcing +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneFlatConditions + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid +local notation "B" => M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection + +local notation "row" => M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "data" => M.stageOneConditionData a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (nodeOrder : b.conditionOrder ∈ M.sets) +variable (closed : InternallyCountablyClosed M c) + +include infinite choice nodeOrder closed in +theorem stageOneCondition_lower_bound : + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + ∀ seq : Nat → Shrink Condition, + natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → + ∃ q : Shrink Condition, + ((equivShrink Condition).symm q).assignments = + stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments) ∧ + ∀ n, q ≤ seq n := by + let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + intro seq whole decreasing + let typed : Nat → Condition := fun n => (equivShrink Condition).symm (seq n) + have typedDecreasing : Antitone typed := fun _ _ less => decreasing less + have rowDecreasing : Antitone (fun n => row (seq n)) := + fun _ _ less => (typedDecreasing less).1 + obtain ⟨rowGround, dataGround⟩ := M.stageOneSequence_projections_ground a c b d T T2 valid + pairing unions powers separation carrier order nodes hT indices base directed system collection + nodeOrder (M.omega_mem separation infinite) seq whole + obtain ⟨p, below⟩ := closed (fun n => row (seq n)) rowGround rowDecreasing + have hJ := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT + have smallRaw := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice + hJ (fun n => data (seq n)) dataGround + have small : stageOneAssignmentUnion (fun n => (typed n).assignments) ∈ B := by + simpa only [M.stageOneConditionData_raw] using smallRaw + let lower : Condition := StageOneCondition.chainUnion M c.pairEmpty pairing unions powers separation + collection pairedCarrier pairedOrder hT valid a b d base directed system T2 + typed typedDecreasing p below small + refine ⟨equivShrink Condition lower, ?_, ?_⟩ + · rw [Equiv.symm_apply_apply] + rfl + · intro n + change (equivShrink Condition).symm (equivShrink Condition lower) ≤ typed n + rw [Equiv.symm_apply_apply] + exact StageOneCondition.chainUnion_le M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 + typed typedDecreasing p below small n + +include infinite choice nodeOrder closed in +theorem stageOneCondition_internally_closed : + letI := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + InternallyCountablyClosed M (pres) := by + let := M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + intro seq whole decreasing + obtain ⟨q, _, below⟩ := M.stageOneCondition_lower_bound a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection infinite choice nodeOrder closed seq whole decreasing + exact ⟨q, below⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageOneOrder + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + lifted ∈ M.sets ∧ squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1 ∧ + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2 ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, forcingGround, objects, finitePowers⟩ := + fulfilled.exists_rowStageOneForcing collection infinite choice hK standard indices + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, forcingGround, ?_, objects, finitePowers⟩ + exact M.stageOneForcingOrder_mem act c s a _ _ valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first + order (M.omega_mem separation infinite) + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageOneClosure + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, squared ∈ M.sets ∧ graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + obtain ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, forcingGround, orderGround, objects, finitePowers⟩ := + fulfilled.exists_rowStageOneOrder collection infinite choice hK standard indices + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, forcingGround, orderGround, ?_, objects, finitePowers⟩ + exact M.stageOneCondition_internally_closed act c s a _ _ valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection + infinite choice order + (M.countable_function_internally_closed pairing unions powers separation infinite choice coordinates two) + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeClosure.lean index 149a6070662b40aad9668e4c6e4d7f11bf08ada0..15c8c5dbd61cdcf533a45ad8e9dff217f747a1a5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeClosure.lean @@ -1,480 +1,480 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeClosureData - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageThreeCarrier - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageThreeCarrierData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageTwoNameLifting collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - exact M.stageThreeCarrierData act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - priorAction squaredGround carrier forcingOrder indexSystem.index_ground order geometry.actors_ground action infinite choice - -theorem exists_rowStageThreeProjections - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageThreeProjectionData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageThreeCarrier collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - exact M.stageThreeProjectionData act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - priorAction carrier forcingOrder indexSystem.index_ground order infinite choice - -theorem exists_rowStageThreeClosure - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageThreeClosureData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageThreeProjections collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - exact M.stageThreeClosureData act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - priorAction carrier indexSystem.index_ground order infinite choice - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStageThreeClosureData + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageThreeCarrier + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageThreeCarrierData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageTwoNameLifting collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + exact M.stageThreeCarrierData act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + priorAction squaredGround carrier forcingOrder indexSystem.index_ground order geometry.actors_ground action infinite choice + +theorem exists_rowStageThreeProjections + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageThreeProjectionData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageThreeCarrier collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + exact M.stageThreeProjectionData act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + priorAction carrier forcingOrder indexSystem.index_ground order infinite choice + +theorem exists_rowStageThreeClosure + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageThreeClosureData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageThreeProjections collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + exact M.stageThreeClosureData act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + priorAction carrier indexSystem.index_ground order infinite choice + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeHistory.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeHistory.lean index da83856870c47aeaa46819e026fee10ef6cc540a..eafb59c4b777e584d36f0d227a80a46dd39fcb94 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeHistory.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeHistory.lean @@ -1,364 +1,364 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageThreeNameLifting - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem finiteFlatHistoryCoherence (values : Nat → ZFSet.{u}) (n : Nat) (levels : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hStages : natSetCode n ∈ M.sets) (hHistory : finiteStageHistory values n ∈ M.sets) - (hLevels : levels ∈ M.sets) - (flat : ∀ i < n, ∀ z ∈ values i, ∃ row A, z = ZFSet.pair row A) - (self : ∀ i < n, ∀ row A, ZFSet.pair row A ∈ values i → - assignmentCut levels (natSetCode i) A = A) - (adjacent : ∀ i, i + 1 < n → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → - ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i) : - FiniteFlatHistoryCoherence M values n levels := by - have down := finiteFlatCuts_down values n levels self adjacent - refine ⟨hStages, hHistory, hLevels, flat, down, - M.rowAssignmentTransitionFamily_mem pairing unions powers separation hStages hHistory hLevels, - M.rowAssignmentTransitionFamily_function pairing unions powers separation hStages hHistory hLevels - (finiteStageHistory_function values n), ?_, ?_, ?_, ?_⟩ - · intro i hi j hj R - exact M.rowAssignmentTransitionFamily_entry pairing unions powers separation hStages hHistory hLevels - (finiteStageHistory_function values n) - ((pair_mem_finiteStageHistory values n i (values i)).2 ⟨hi, rfl⟩) - ((pair_mem_finiteStageHistory values n j (values j)).2 ⟨hj, rfl⟩) - · intro i hi j below - exact rowAssignmentCutGraph_function (values i) (values j) levels (natSetCode j) - (flat i hi) (down i hi j below) - · intro i hi - exact rowAssignmentCutGraph_identity (values i) levels (natSetCode i) (flat i hi) (self i hi) - · intro i hi j hji k hkj - have subset : (natSetCode k : ZFSet.{u}) ⊆ natSetCode j := by - intro z hz - obtain ⟨m, hm, rfl⟩ := (mem_natSetCode z k).1 hz - exact (natSetCode_mem_iff m j).2 (Nat.lt_of_lt_of_le hm hkj) - exact rowAssignmentCutGraph_nested (values i) (values j) (values k) levels - (natSetCode k) (natSetCode j) subset (down i hi j hji) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageThreeHistoryData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - name_lifting : StageThreeNameLiftingData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - history : - let actionData := name_lifting.support_data.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, - let tests := M.refinementLevelTests pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 - action nodes d base directed next2.first (natSetCode 2) T2 - let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let values := fourFlatStageValues c.pairEmpty.carrier s.carrier pres.carrier pres3.carrier - let carrierHistory := finiteStageHistory values 4 - let indexHistory := threeRefinementHistory I0 I1 I2 - carrierHistory ∈ M.sets ∧ FunctionGraphOn (natSetCode 4) carrierHistory ∧ - indexHistory ∈ M.sets ∧ FunctionGraphOn (natSetCode 3) indexHistory ∧ - refinementHistoryIndices (natSetCode 3) indexHistory = (I0 ∪ I1) ∪ I2 ∧ - refinementHistoryAssignmentLevels (natSetCode 3) indexHistory T = levels ∧ - FiniteFlatHistoryCoherence M values 4 levels ∧ - M.flatLimitConditions c.carrier ((I0 ∪ I1) ∪ I2) T (natSetCode 4) carrierHistory levels = - pres3.carrier - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (M : TransitiveGround.{u}) -theorem stageThreeHistoryData - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (prior : StageThreeNameLiftingData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used) - (rows : c.carrier ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) : - StageThreeHistoryData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used := by - let actionData := prior.support_data.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data - let data := actionData.closure_data.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - let first := actionData.closure_data.projection_data.first_level - let second := next.indices.levelCode - let stageTwoOrder := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first - obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _, _⟩ := prior.lifting - let stageTwoTop := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder - data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first - let successorOrder := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let F3 := M.flatSuccessorFlatConditionSystem c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let r21 := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first F - let r32 := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 - have code21 : ∀ p, s.encode (r21 p) = ZFSet.pair (c.encode (F2.row p)) - (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) (F2.assignments p)) := - M.stageTwoSmallRestriction_encode c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - data.terms_ground base directed next.first F - have code32 : ∀ p, pres.encode (r32 p) = ZFSet.pair (c.encode (F3.row p)) - (assignmentCut levels (natSetCode 2) (F3.assignments p)) := - M.flatSuccessorSmallRestriction_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 - have hLevels := M.stageThreeAssignmentLevels_mem pairing unions powers separation - hI0 next.indices.index_ground next2.indices.index_ground data.terms_ground - have conditions := M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder - (M.omega_mem separation infinite) - let values := fourFlatStageValues c.pairEmpty.carrier s.carrier pres.carrier pres3.carrier - have ground := M.fourFlatStageHistory_mem c s pres pres3 pairing unions powers separation infinite - rows data.lower_carrier_ground hCarrier conditions - have selfCuts := fourFlatStageValues_self M c s pres pres3 I0 I1 I2 T - first second next2.indices.levelCode F F2 F3 - have adjacent := fourFlatStageValues_adjacent M c s pres pres3 I0 I1 I2 T - first second next2.indices.levelCode F F2 F3 r21 r32 code21 code32 - refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ground, - finiteStageHistory_function values 4, ?_, threeRefinementHistory_function I0 I1 I2, - threeRefinementHistory_indices I0 I1 I2, threeRefinementHistory_assignmentLevels I0 I1 I2 T, ?_, ?_⟩ - · exact M.threeRefinementHistory_mem pairing unions hI0 next.indices.index_ground next2.indices.index_ground - · exact M.finiteFlatHistoryCoherence values 4 levels pairing unions powers separation - (M.natSetCode_mem separation infinite 4) ground hLevels - (fourFlatStageValues_flat M c s pres pres3 I0 I1 I2 T F F2 F3) selfCuts adjacent - · exact M.fourFlatStageLimit_eq c s pres pres3 I0 I1 I2 T first second next2.indices.levelCode - F F2 F3 r21 r32 code21 code32 - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageThreeHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageThreeHistoryData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let geometryGroup := geometry.group_code.toGroup - let geometryOrder := geometry.meet.order.toPartialOrder - let geometryBottom := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageThreeNameLifting collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let stageOneOrder := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let stageOneTop := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid - exact M.stageThreeHistoryData act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - priorAction carrier indexSystem.index_ground order infinite - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageThreeNameLifting + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem finiteFlatHistoryCoherence (values : Nat → ZFSet.{u}) (n : Nat) (levels : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hStages : natSetCode n ∈ M.sets) (hHistory : finiteStageHistory values n ∈ M.sets) + (hLevels : levels ∈ M.sets) + (flat : ∀ i < n, ∀ z ∈ values i, ∃ row A, z = ZFSet.pair row A) + (self : ∀ i < n, ∀ row A, ZFSet.pair row A ∈ values i → + assignmentCut levels (natSetCode i) A = A) + (adjacent : ∀ i, i + 1 < n → ∀ row A, ZFSet.pair row A ∈ values (i + 1) → + ZFSet.pair row (assignmentCut levels (natSetCode i) A) ∈ values i) : + FiniteFlatHistoryCoherence M values n levels := by + have down := finiteFlatCuts_down values n levels self adjacent + refine ⟨hStages, hHistory, hLevels, flat, down, + M.rowAssignmentTransitionFamily_mem pairing unions powers separation hStages hHistory hLevels, + M.rowAssignmentTransitionFamily_function pairing unions powers separation hStages hHistory hLevels + (finiteStageHistory_function values n), ?_, ?_, ?_, ?_⟩ + · intro i hi j hj R + exact M.rowAssignmentTransitionFamily_entry pairing unions powers separation hStages hHistory hLevels + (finiteStageHistory_function values n) + ((pair_mem_finiteStageHistory values n i (values i)).2 ⟨hi, rfl⟩) + ((pair_mem_finiteStageHistory values n j (values j)).2 ⟨hj, rfl⟩) + · intro i hi j below + exact rowAssignmentCutGraph_function (values i) (values j) levels (natSetCode j) + (flat i hi) (down i hi j below) + · intro i hi + exact rowAssignmentCutGraph_identity (values i) levels (natSetCode i) (flat i hi) (self i hi) + · intro i hi j hji k hkj + have subset : (natSetCode k : ZFSet.{u}) ⊆ natSetCode j := by + intro z hz + obtain ⟨m, hm, rfl⟩ := (mem_natSetCode z k).1 hz + exact (natSetCode_mem_iff m j).2 (Nat.lt_of_lt_of_le hm hkj) + exact rowAssignmentCutGraph_nested (values i) (values j) (values k) levels + (natSetCode k) (natSetCode j) subset (down i hi j hji) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageThreeHistoryData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + name_lifting : StageThreeNameLiftingData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + history : + let actionData := name_lifting.support_data.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, + let tests := M.refinementLevelTests pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 + action nodes d base directed next2.first (natSetCode 2) T2 + let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let values := fourFlatStageValues c.pairEmpty.carrier s.carrier pres.carrier pres3.carrier + let carrierHistory := finiteStageHistory values 4 + let indexHistory := threeRefinementHistory I0 I1 I2 + carrierHistory ∈ M.sets ∧ FunctionGraphOn (natSetCode 4) carrierHistory ∧ + indexHistory ∈ M.sets ∧ FunctionGraphOn (natSetCode 3) indexHistory ∧ + refinementHistoryIndices (natSetCode 3) indexHistory = (I0 ∪ I1) ∪ I2 ∧ + refinementHistoryAssignmentLevels (natSetCode 3) indexHistory T = levels ∧ + FiniteFlatHistoryCoherence M values 4 levels ∧ + M.flatLimitConditions c.carrier ((I0 ∪ I1) ∪ I2) T (natSetCode 4) carrierHistory levels = + pres3.carrier + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (M : TransitiveGround.{u}) +theorem stageThreeHistoryData + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (prior : StageThreeNameLiftingData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used) + (rows : c.carrier ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) : + StageThreeHistoryData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used := by + let actionData := prior.support_data.action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data + let data := actionData.closure_data.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + let first := actionData.closure_data.projection_data.first_level + let second := next.indices.levelCode + let stageTwoOrder := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first + obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _, _⟩ := prior.lifting + let stageTwoTop := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder + data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first + let successorOrder := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let F3 := M.flatSuccessorFlatConditionSystem c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let r21 := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first F + let r32 := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 + have code21 : ∀ p, s.encode (r21 p) = ZFSet.pair (c.encode (F2.row p)) + (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) (F2.assignments p)) := + M.stageTwoSmallRestriction_encode c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + data.terms_ground base directed next.first F + have code32 : ∀ p, pres.encode (r32 p) = ZFSet.pair (c.encode (F3.row p)) + (assignmentCut levels (natSetCode 2) (F3.assignments p)) := + M.flatSuccessorSmallRestriction_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 + have hLevels := M.stageThreeAssignmentLevels_mem pairing unions powers separation + hI0 next.indices.index_ground next2.indices.index_ground data.terms_ground + have conditions := M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder + (M.omega_mem separation infinite) + let values := fourFlatStageValues c.pairEmpty.carrier s.carrier pres.carrier pres3.carrier + have ground := M.fourFlatStageHistory_mem c s pres pres3 pairing unions powers separation infinite + rows data.lower_carrier_ground hCarrier conditions + have selfCuts := fourFlatStageValues_self M c s pres pres3 I0 I1 I2 T + first second next2.indices.levelCode F F2 F3 + have adjacent := fourFlatStageValues_adjacent M c s pres pres3 I0 I1 I2 T + first second next2.indices.levelCode F F2 F3 r21 r32 code21 code32 + refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ground, + finiteStageHistory_function values 4, ?_, threeRefinementHistory_function I0 I1 I2, + threeRefinementHistory_indices I0 I1 I2, threeRefinementHistory_assignmentLevels I0 I1 I2 T, ?_, ?_⟩ + · exact M.threeRefinementHistory_mem pairing unions hI0 next.indices.index_ground next2.indices.index_ground + · exact M.finiteFlatHistoryCoherence values 4 levels pairing unions powers separation + (M.natSetCode_mem separation infinite 4) ground hLevels + (fourFlatStageValues_flat M c s pres pres3 I0 I1 I2 T F F2 F3) selfCuts adjacent + · exact M.fourFlatStageLimit_eq c s pres pres3 I0 I1 I2 T first second next2.indices.levelCode + F F2 F3 r21 r32 code21 code32 + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageThreeHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageThreeHistoryData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let geometryGroup := geometry.group_code.toGroup + let geometryOrder := geometry.meet.order.toPartialOrder + let geometryBottom := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let rowOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let rowTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageThreeNameLifting collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let stageOneOrder := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let stageOneTop := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid + exact M.stageThreeHistoryData act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + priorAction carrier indexSystem.index_ground order infinite + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeSupport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeSupport.lean index 63637bc4e9fa351d0fb1067fa8f99aea323a7837..3fa6cfd6cd5b0df42d6c64e8b1b14c05e3dc90f3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeSupport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageThreeSupport.lean @@ -1,480 +1,480 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageThreeAction - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [PartialOrder L] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -variable (b : Presentation L) (d : PosetAction G L) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests - -structure FlatSuccessorPositionSupport (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where - bounds : letI := smallOrder - ∀ (q : Shrink Condition) (extra : ZFSet.{u}), - extra ∈ M.sets → extra ⊆ b.carrier → M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, - (∀ x : L, b.encode x ∈ used ((equivShrink Condition).symm q).row → x ≤ D) ∧ - (∀ z ∈ ((equivShrink Condition).symm q).assignments, - ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments - I T S b.carrier mu X b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) ∧ - (∀ x : L, b.encode x ∈ extra → x ≤ D) ∧ - (∀ g ∈ d.principalFix D, action.iso g q = q) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G P Q : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] -variable (e1 : PosetAction G P) (t1 : Presentation P) -variable (e2 : PosetAction G Q) (t2 : Presentation Q) -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include order choice countable_bound - -theorem binaryRowStageThreePositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) - (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ squared, IsName c.pairEmpty z) - (valid1 : ∀ z ∈ lifted, IsName t1 z) (valid12 : ∀ z ∈ squared, IsName t1 z) - (valid2 : ∀ z ∈ lifted, IsName t2 z) (valid22 : ∀ z ∈ squared, IsName t2 z) - (_indices0 : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid0 valid02) - (_indices1 : NiceRefinementIndexSystem M e1 t1 s a (natSetCode 1) lifted squared valid1 valid12) - (_indices2 : NiceRefinementIndexSystem M e2 t2 s a (natSetCode 2) lifted squared valid2 valid22) - (_params0 : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid0) - (_params1 : StageOneActionParameters M e1 t1 b s a lifted squared valid1) - (_params2 : StageOneActionParameters M e2 t2 b s a lifted squared valid2) - (system2 : NiceNameSystem M e2 t2 s a ⊥ directed lifted valid2) - (_carrier1 : t1.carrier ∈ M.sets) (_order1 : t1.conditionOrder ∈ M.sets) - (carrier2 : t2.carrier ∈ M.sets) (order2 : t2.conditionOrder ∈ M.sets), - let I0 := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid0 - let I1 := M.niceRefinementIndices e1 t1 s a (natSetCode 1) lifted squared valid1 - let I2 := M.niceRefinementIndices e2 t2 s a (natSetCode 2) lifted squared valid2 - let levels := stageThreeAssignmentLevels I0 I1 I2 lifted - let tests := M.refinementLevelTests t2 pairing unions powers separation collection carrier2 order2 hLifted - valid2 e2 s a ⊥ directed system2 (natSetCode 2) squared - let image := M.stageThreeAssignmentImage act c.pairEmpty e1 t1 e2 t2 s a lifted squared - valid0 valid02 valid1 valid12 valid2 valid22 - ∀ inputs : FlatSuccessorActionInputs M c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests act e2 image, - (∀ (D : L), ∀ f ∈ S, ∀ u : Name t1, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → - a.principalFix D ≤ e1.stabilizer t1 u) → - (∀ (D : L), ∀ f ∈ S, ∀ u : Name t2, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → - a.principalFix D ≤ e2.stabilizer t2 u) → - FlatSuccessorPositionSupport M c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests s a - S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) - (M.flatSuccessorSmallAction c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests act e2 image inputs) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared tuples hLifted valid0 valid02 valid1 valid12 valid2 valid22 - indices0 indices1 indices2 params0 params1 params2 system2 carrier1 order1 carrier2 order2 - I0 I1 I2 levels tests image inputs support1 support2 - let := M.flatSuccessorSmallOrder c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests - refine ⟨?_⟩ - intro q extra hExtra extraSubset extraSmall - let p := (equivShrink _).symm q - obtain ⟨D, rowBound, dataBound, extraBound⟩ := - M.binaryRowStageThreeDataBound s C e1 t1 e2 t2 a pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu ⊤ valid hLifted act squared - valid0 valid02 valid1 valid12 valid2 valid22 indices0 indices1 indices2 - p.row p.assignments p.assignments_mem extra hExtra extraSubset extraSmall - refine ⟨D, rowBound, dataBound, extraBound, ?_⟩ - intro g actor - apply (M.flatSuccessorSmallAction_fixed_iff c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests - act e2 image inputs g q).2 - constructor - · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite - hL hC hG graph g p.row D (fun i used => rowBound i.val used) actor - · have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation hL) hC - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - exact M.stageThreeAssignmentImage_eq_of_dataBound act c.pairEmpty e1 t1 e2 t2 s a lifted squared - valid0 valid02 valid1 valid12 valid2 valid22 b pairing unions powers separation collection - (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) - (M.pairEmpty_order_mem pairing unions powers separation c carrier forcingOrder) - carrier1 order1 carrier2 order2 params0 params1 params2 - indices0.levelCode indices1.levelCode indices2.levelCode - S mu s.nonbottom.carrier tuples D - (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation - infinite hL hC hG graph hmu ordinal valid f u D entry bound.2) - (support1 D) (support2 D) g actor - ((M.mem_groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) lifted) ZFSet.omega _).1 - p.assignments_mem).2.1 dataBound - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageThreeSupportData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - action_data : StageThreeActionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - support : - let actionData := action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, - let tests := M.refinementLevelTests pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 - action nodes d base directed next2.first (natSetCode 2) T2 - let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 - ∃ inputs3 : FlatSuccessorActionInputs M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3, - letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - TransitiveGround.FlatSuccessorPositionSupport M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - nodes d S mu X tuples used - (M.flatSuccessorSmallAction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - a action image3 inputs3) - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable [PartialOrder P] [OrderTop P] -variable (e1 : PosetAction G P) (t1 : Presentation P) -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include order choice countable_bound - -theorem binaryRowStageThreeSupportData {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) - (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ squared, IsName c.pairEmpty z) - (_indices0 : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid0 valid02) - (_params0 : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid0) - (_prior : StageThreeActionData M act c e1 t1 b s a ⊥ directed lifted squared valid0 - pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p))), - StageThreeSupportData M act c e1 t1 b s a ⊥ directed lifted squared valid0 - pairing unions powers separation collection S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared tuples hLifted valid0 valid02 indices0 params0 priorAction - refine ⟨priorAction, ?_⟩ - let actionData := priorAction.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid0 - let image := M.stageTwoAssignmentImage act c.pairEmpty e1 t1 s a lifted squared - valid0 actionData.valid2 next.valid1 next.valid2 - let firstLevel := actionData.closure_data.projection_data.first_level - let secondLevel := next.indices.levelCode - let := M.stageTwoConditionSmallOrder c I0 e1 t1 s a lifted squared next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground ⊥ directed next.first - obtain ⟨F, hNodes, inputs2, next2, hCarrier, hOrder, inputs3, _⟩ := priorAction.actions - refine ⟨F, hNodes, inputs2, next2, hCarrier, hOrder, inputs3, ?_⟩ - let := M.stageTwoConditionSmallTop c I0 e1 t1 s a lifted squared next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground ⊥ directed next.first F firstLevel secondLevel - let pres2 := M.stageTwoConditionPresentation c I0 e1 t1 s a lifted squared next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices ⊥ directed next.first - let action2 := M.stageTwoSmallAction c I0 e1 t1 s a lifted squared next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground ⊥ directed next.first act image inputs2 - have tupleRange : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ lifted := by - intro f z entry - exact ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1 - have support1 : ∀ (D : L), ∀ f ∈ S, ∀ u : Name t1, - ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → - a.principalFix D ≤ e1.stabilizer t1 u := by - intro D - apply act.positionSupport_of_term_graphs c.pairEmpty e1 t1 lifted valid0 next.valid1 - actionData.term_graphs s a S mu s.nonbottom.carrier tuples D tupleRange - intro f _ u entry bound - exact M.liftedRowTuple_supported a s b C pairing unions powers separation infinite - hL hC hG graph hmu ordinal valid f u D entry bound.2 - have support2 : ∀ (D : L), ∀ f ∈ S, ∀ u : Name pres2, - ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → - a.principalFix D ≤ action2.stabilizer pres2 u := by - intro D - exact M.stageTwoNameLift_positionSupport c I0 e1 t1 s a lifted squared next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices ⊥ directed next.first F firstLevel secondLevel - act image inputs2 infinite choice indices0.index_ground next.indices.index_ground - S mu s.nonbottom.carrier tuples D tupleRange (support1 D) - have result := M.binaryRowStageThreePositionSupport e1 t1 action2 pres2 a s b C - pairing unions powers separation collection infinite choice hL order hC hG graph directed - countable_bound hmu ordinal valid hLifted valid0 actionData.valid2 next.valid1 next.valid2 - next2.valid1 next2.valid2 indices0 next.indices next2.indices params0 next.inputs next2.inputs next2.first - prior.lower_carrier_ground prior.lower_order_ground hCarrier hOrder inputs3 support1 support2 - exact result - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageThreeSupport - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageThreeSupportData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageThreeAction collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - have countableBound := geometry.decoded_countable_bound - (fun W hW subset small => (fulfilled.countable_localization W hW subset small).2) - exact M.binaryRowStageThreeSupportData nextAction nextPres a s b columns - pairing unions powers separation collection infinite choice geometry.carrier_ground order - hColumns geometry.actors_ground action directed countableBound hmu cardinal.1 valid - liftedGround valid1 valid2 indexSystem inputs priorAction - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageThreeAction + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [PartialOrder L] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +variable (b : Presentation L) (d : PosetAction G L) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests + +structure FlatSuccessorPositionSupport (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where + bounds : letI := smallOrder + ∀ (q : Shrink Condition) (extra : ZFSet.{u}), + extra ∈ M.sets → extra ⊆ b.carrier → M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, + (∀ x : L, b.encode x ∈ used ((equivShrink Condition).symm q).row → x ≤ D) ∧ + (∀ z ∈ ((equivShrink Condition).symm q).assignments, + ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments + I T S b.carrier mu X b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) ∧ + (∀ x : L, b.encode x ∈ extra → x ≤ D) ∧ + (∀ g ∈ d.principalFix D, action.iso g q = q) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G P Q : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] +variable (e1 : PosetAction G P) (t1 : Presentation P) +variable (e2 : PosetAction G Q) (t2 : Presentation Q) +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include order choice countable_bound + +theorem binaryRowStageThreePositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) + (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ squared, IsName c.pairEmpty z) + (valid1 : ∀ z ∈ lifted, IsName t1 z) (valid12 : ∀ z ∈ squared, IsName t1 z) + (valid2 : ∀ z ∈ lifted, IsName t2 z) (valid22 : ∀ z ∈ squared, IsName t2 z) + (_indices0 : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid0 valid02) + (_indices1 : NiceRefinementIndexSystem M e1 t1 s a (natSetCode 1) lifted squared valid1 valid12) + (_indices2 : NiceRefinementIndexSystem M e2 t2 s a (natSetCode 2) lifted squared valid2 valid22) + (_params0 : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid0) + (_params1 : StageOneActionParameters M e1 t1 b s a lifted squared valid1) + (_params2 : StageOneActionParameters M e2 t2 b s a lifted squared valid2) + (system2 : NiceNameSystem M e2 t2 s a ⊥ directed lifted valid2) + (_carrier1 : t1.carrier ∈ M.sets) (_order1 : t1.conditionOrder ∈ M.sets) + (carrier2 : t2.carrier ∈ M.sets) (order2 : t2.conditionOrder ∈ M.sets), + let I0 := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid0 + let I1 := M.niceRefinementIndices e1 t1 s a (natSetCode 1) lifted squared valid1 + let I2 := M.niceRefinementIndices e2 t2 s a (natSetCode 2) lifted squared valid2 + let levels := stageThreeAssignmentLevels I0 I1 I2 lifted + let tests := M.refinementLevelTests t2 pairing unions powers separation collection carrier2 order2 hLifted + valid2 e2 s a ⊥ directed system2 (natSetCode 2) squared + let image := M.stageThreeAssignmentImage act c.pairEmpty e1 t1 e2 t2 s a lifted squared + valid0 valid02 valid1 valid12 valid2 valid22 + ∀ inputs : FlatSuccessorActionInputs M c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests act e2 image, + (∀ (D : L), ∀ f ∈ S, ∀ u : Name t1, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → + a.principalFix D ≤ e1.stabilizer t1 u) → + (∀ (D : L), ∀ f ∈ S, ∀ u : Name t2, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → + a.principalFix D ≤ e2.stabilizer t2 u) → + FlatSuccessorPositionSupport M c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests s a + S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) + (M.flatSuccessorSmallAction c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests act e2 image inputs) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared tuples hLifted valid0 valid02 valid1 valid12 valid2 valid22 + indices0 indices1 indices2 params0 params1 params2 system2 carrier1 order1 carrier2 order2 + I0 I1 I2 levels tests image inputs support1 support2 + let := M.flatSuccessorSmallOrder c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests + refine ⟨?_⟩ + intro q extra hExtra extraSubset extraSmall + let p := (equivShrink _).symm q + obtain ⟨D, rowBound, dataBound, extraBound⟩ := + M.binaryRowStageThreeDataBound s C e1 t1 e2 t2 a pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu ⊤ valid hLifted act squared + valid0 valid02 valid1 valid12 valid2 valid22 indices0 indices1 indices2 + p.row p.assignments p.assignments_mem extra hExtra extraSubset extraSmall + refine ⟨D, rowBound, dataBound, extraBound, ?_⟩ + intro g actor + apply (M.flatSuccessorSmallAction_fixed_iff c t2 ((I0 ∪ I1) ∪ I2) lifted levels (natSetCode 2) tests + act e2 image inputs g q).2 + constructor + · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite + hL hC hG graph g p.row D (fun i used => rowBound i.val used) actor + · have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation hL) hC + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + exact M.stageThreeAssignmentImage_eq_of_dataBound act c.pairEmpty e1 t1 e2 t2 s a lifted squared + valid0 valid02 valid1 valid12 valid2 valid22 b pairing unions powers separation collection + (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) + (M.pairEmpty_order_mem pairing unions powers separation c carrier forcingOrder) + carrier1 order1 carrier2 order2 params0 params1 params2 + indices0.levelCode indices1.levelCode indices2.levelCode + S mu s.nonbottom.carrier tuples D + (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation + infinite hL hC hG graph hmu ordinal valid f u D entry bound.2) + (support1 D) (support2 D) g actor + ((M.mem_groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) lifted) ZFSet.omega _).1 + p.assignments_mem).2.1 dataBound + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageThreeSupportData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + action_data : StageThreeActionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + support : + let actionData := action_data.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, + let tests := M.refinementLevelTests pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 + action nodes d base directed next2.first (natSetCode 2) T2 + let image3 := M.stageThreeAssignmentImage a c.pairEmpty e s action pres nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 next2.valid1 next2.valid2 + ∃ inputs3 : FlatSuccessorActionInputs M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3, + letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + TransitiveGround.FlatSuccessorPositionSupport M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + nodes d S mu X tuples used + (M.flatSuccessorSmallAction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + a action image3 inputs3) + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable [PartialOrder P] [OrderTop P] +variable (e1 : PosetAction G P) (t1 : Presentation P) +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include order choice countable_bound + +theorem binaryRowStageThreeSupportData {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) + (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ squared, IsName c.pairEmpty z) + (_indices0 : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid0 valid02) + (_params0 : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid0) + (_prior : StageThreeActionData M act c e1 t1 b s a ⊥ directed lifted squared valid0 + pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p))), + StageThreeSupportData M act c e1 t1 b s a ⊥ directed lifted squared valid0 + pairing unions powers separation collection S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared tuples hLifted valid0 valid02 indices0 params0 priorAction + refine ⟨priorAction, ?_⟩ + let actionData := priorAction.closure_data.projection_data.carrier_data.name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid0 + let image := M.stageTwoAssignmentImage act c.pairEmpty e1 t1 s a lifted squared + valid0 actionData.valid2 next.valid1 next.valid2 + let firstLevel := actionData.closure_data.projection_data.first_level + let secondLevel := next.indices.levelCode + let := M.stageTwoConditionSmallOrder c I0 e1 t1 s a lifted squared next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground ⊥ directed next.first + obtain ⟨F, hNodes, inputs2, next2, hCarrier, hOrder, inputs3, _⟩ := priorAction.actions + refine ⟨F, hNodes, inputs2, next2, hCarrier, hOrder, inputs3, ?_⟩ + let := M.stageTwoConditionSmallTop c I0 e1 t1 s a lifted squared next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground ⊥ directed next.first F firstLevel secondLevel + let pres2 := M.stageTwoConditionPresentation c I0 e1 t1 s a lifted squared next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices ⊥ directed next.first + let action2 := M.stageTwoSmallAction c I0 e1 t1 s a lifted squared next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground ⊥ directed next.first act image inputs2 + have tupleRange : ∀ f z, ZFSet.pair f z ∈ tuples → z ∈ lifted := by + intro f z entry + exact ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1 + have support1 : ∀ (D : L), ∀ f ∈ S, ∀ u : Name t1, + ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → + a.principalFix D ≤ e1.stabilizer t1 u := by + intro D + apply act.positionSupport_of_term_graphs c.pairEmpty e1 t1 lifted valid0 next.valid1 + actionData.term_graphs s a S mu s.nonbottom.carrier tuples D tupleRange + intro f _ u entry bound + exact M.liftedRowTuple_supported a s b C pairing unions powers separation infinite + hL hC hG graph hmu ordinal valid f u D entry bound.2 + have support2 : ∀ (D : L), ∀ f ∈ S, ∀ u : Name pres2, + ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → + a.principalFix D ≤ action2.stabilizer pres2 u := by + intro D + exact M.stageTwoNameLift_positionSupport c I0 e1 t1 s a lifted squared next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices ⊥ directed next.first F firstLevel secondLevel + act image inputs2 infinite choice indices0.index_ground next.indices.index_ground + S mu s.nonbottom.carrier tuples D tupleRange (support1 D) + have result := M.binaryRowStageThreePositionSupport e1 t1 action2 pres2 a s b C + pairing unions powers separation collection infinite choice hL order hC hG graph directed + countable_bound hmu ordinal valid hLifted valid0 actionData.valid2 next.valid1 next.valid2 + next2.valid1 next2.valid2 indices0 next.indices next2.indices params0 next.inputs next2.inputs next2.first + prior.lower_carrier_ground prior.lower_order_ground hCarrier hOrder inputs3 support1 support2 + exact result + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageThreeSupport + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageThreeSupportData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageThreeAction collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + have countableBound := geometry.decoded_countable_bound + (fun W hW subset small => (fulfilled.countable_localization W hW subset small).2) + exact M.binaryRowStageThreeSupportData nextAction nextPres a s b columns + pairing unions powers separation collection infinite choice geometry.carrier_ground order + hColumns geometry.actors_ground action directed countableBound hmu cardinal.1 valid + liftedGround valid1 valid2 indexSystem inputs priorAction + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoClosure.lean index 458e6581dc584f63d0bbb6c04ebcd98bf28bf670..776ef685f1bf9bc335e504656664a9a0a8bda662 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoClosure.lean @@ -1,316 +1,316 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageTwoConditions - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageTwoProjections - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageTwoProjectionData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageTwoConditions collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, carrierData⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - let flat := M.stageOneFlatConditionSystem act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - exact M.stageTwoProjectionData act c nextAction nextPres b s a ⊥ directed lifted squared valid1 - pairing unions powers separation collection carrierData flat indexSystem.levelCode - carrier indexSystem.index_ground forcingOrder geometry.carrier_ground order infinite choice - -theorem exists_rowStageTwoClosure - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageTwoClosureData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageTwoProjections collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, projectionData⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - exact M.stageTwoClosureData act c nextAction nextPres b s a ⊥ directed lifted squared valid1 - pairing unions powers separation collection projectionData carrier indexSystem.index_ground - order infinite choice closed - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageTwoConditions + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageTwoProjections + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageTwoProjectionData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageTwoConditions collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, carrierData⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + let flat := M.stageOneFlatConditionSystem act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + exact M.stageTwoProjectionData act c nextAction nextPres b s a ⊥ directed lifted squared valid1 + pairing unions powers separation collection carrierData flat indexSystem.levelCode + carrier indexSystem.index_ground forcingOrder geometry.carrier_ground order infinite choice + +theorem exists_rowStageTwoClosure + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageTwoClosureData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageTwoProjections collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, projectionData⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + exact M.stageTwoClosureData act c nextAction nextPres b s a ⊥ directed lifted squared valid1 + pairing unions powers separation collection projectionData carrier indexSystem.index_ground + order infinite choice closed + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoIndices.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoIndices.lean index 0a860e51ef2c7e2ca18e9d74f6c60c26112feb62..082e4e1e783919ca5153db12e389d9f1382c37f7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoIndices.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoIndices.lean @@ -1,515 +1,515 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageOneGroundAction -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneDataBoundSmallFixation -import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoSupportData - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "smallTop" => M.stageOneConditionSmallTop a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - -theorem stageOneEmptyInclusion_top : - letI := smallOrder - letI := smallTop - incl ⊤ = ⊤ := rfl - -theorem stageOneConditionPresentation_top : - letI := smallOrder - letI := smallTop - (pres).encode ⊤ = c.pairEmpty.encode ⊤ := by - let := smallOrder - let := smallTop - change (pres).encode (incl ⊤) = c.pairEmpty.encode ⊤ - exact M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection ⊤ - -theorem stageOne_orderedPairNameFamily (X Y : ZFSet.{u}) : - letI := smallOrder - letI := smallTop - orderedPairNameFamily ((pres).encode ⊤) X Y = - orderedPairNameFamily (c.pairEmpty.encode ⊤) X Y := by - let := smallOrder - let := smallTop - rw [M.stageOneConditionPresentation_top a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] - -theorem stageOne_iteratedPairNameFamily (X : ZFSet.{u}) (n : Nat) : - letI := smallOrder - letI := smallTop - iteratedPairNameFamily ((pres).encode ⊤) X n = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) X n := by - let := smallOrder - let := smallTop - rw [M.stageOneConditionPresentation_top a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "I" => M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid - -structure StageOnePositionSupport (S mu X tuples : ZFSet.{u}) (used : P → ZFSet.{u}) - (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where - bounds : letI := smallOrder - ∀ (q : Shrink Condition) (extra : ZFSet.{u}), - extra ∈ M.sets → extra ⊆ b.carrier → M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, - (∀ x : L, b.encode x ∈ used ((equivShrink Condition).symm q).row → x ≤ D) ∧ - (∀ z ∈ ((equivShrink Condition).symm q).assignments, - ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments - I T S b.carrier mu X b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) ∧ - (∀ x : L, b.encode x ∈ extra → x ≤ D) ∧ - (∀ g ∈ d.principalFix D, action.iso g q = q) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include order choice countable_bound - -theorem binaryRowStageOnePositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1) - (indices : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2) - (inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1), - let coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - StageOnePositionSupport M act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted ⊥ directed first collection S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) - (M.stageOneSmallAction act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted indices ⊥ directed first collection b inputs hSquared - (M.omega_mem separation infinite)) := by - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 first indices inputs - coordinates two carrier forcingOrder - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder hLifted ⊥ directed first collection - refine ⟨?_⟩ - intro q extra hExtra extraSubset extraSmall - let p := (equivShrink _).symm q - let I := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 - let anchors := refinementIndexFieldGraph I s.carrier 2 - have anchorGround : anchors ∈ M.sets := indices.field_ground 2 - have anchorFunction : ZFSet.IsFunc I s.carrier anchors := indices.field_function 2 - obtain ⟨D, rowBound, dataBound, extraBound⟩ := - M.binaryRowStageOneDataBound s C pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu ⊤ valid hLifted I anchors - indices.index_ground anchorGround anchorFunction p.row p.assignments p.assignments_mem - extra hExtra extraSubset extraSmall - refine ⟨D, rowBound, dataBound, extraBound, ?_⟩ - intro g actor - apply M.stageOneSmallAction_fixed_of_dataBound act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder hLifted indices ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) D - (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation - infinite hL hC hG graph hmu ordinal valid f u D entry bound.2) g actor q - · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite - hL hC hG graph g p.row D (fun i used => rowBound i.val used) actor - · exact dataBound - -end TransitiveGround - -namespace GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageOnePositionSupport - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageOneGroundAction collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, ?_⟩ - rw [equal] - have countableBound := geometry.decoded_countable_bound - (fun X hX subset small => (fulfilled.countable_localization X hX subset small).2) - exact M.binaryRowStageOnePositionSupport a s b columns pairing unions powers separation - collection infinite choice geometry.carrier_ground order hColumns geometry.actors_ground action - directed countableBound hmu cardinal.1 valid liftedGround squaredGround valid1 valid2 first indexSystem inputs - -theorem exists_rowStageTwoIndices - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageTwoIndexData M act c.pairEmpty nextAction nextPres b s a ⊥ directed - lifted squared valid1)) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageOnePositionSupport collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - have constructed := M.binaryRowStageOneRefinement a s b columns pairing unions powers separation - collection infinite geometry.carrier_ground order hColumns geometry.actors_ground action - directed hmu cardinal.1 valid liftedGround squaredGround valid1 valid2 first indexSystem inputs originalMaps - have nextSystem : RefinementStageSystem M nextAction nextPres b s a ⊥ directed - (natSetCode 1) lifted squared := by - rw [equal] - exact constructed - refine ⟨nextSystem, ?_, ?_, ?_, ?_⟩ - · exact M.stageOneConditionPresentation_top act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection - · exact (M.stageOne_orderedPairNameFamily act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection lifted lifted).symm - · exact M.stageOne_iteratedPairNameFamily act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection lifted - · - have levelData := indexSystem.union_level_data nextSystem.indices pairing unions powers separation - (M.empty_mem ⟨s.carrier, geometry.carrier_ground⟩) (M.natSetCode_mem separation infinite 1) - refine ⟨levelData.1, levelData.2.1, levelData.2.2.1, levelData.2.2.2, ?_⟩ - apply indexSystem.different_levels_disjoint nextSystem.indices - intro equalLevels - exact Nat.zero_ne_one (natSetCode_injective (show natSetCode 0 = natSetCode 1 from equalLevels)) - -end GroundMainPrefix.FinalFulfillment - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageOneGroundAction +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneDataBoundSmallFixation +import OAI.SetTheory.PartitionPrinciple.Transfinite.StageTwoSupportData + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "smallTop" => M.stageOneConditionSmallTop a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + +theorem stageOneEmptyInclusion_top : + letI := smallOrder + letI := smallTop + incl ⊤ = ⊤ := rfl + +theorem stageOneConditionPresentation_top : + letI := smallOrder + letI := smallTop + (pres).encode ⊤ = c.pairEmpty.encode ⊤ := by + let := smallOrder + let := smallTop + change (pres).encode (incl ⊤) = c.pairEmpty.encode ⊤ + exact M.stageOneEmptyInclusion_encode a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection ⊤ + +theorem stageOne_orderedPairNameFamily (X Y : ZFSet.{u}) : + letI := smallOrder + letI := smallTop + orderedPairNameFamily ((pres).encode ⊤) X Y = + orderedPairNameFamily (c.pairEmpty.encode ⊤) X Y := by + let := smallOrder + let := smallTop + rw [M.stageOneConditionPresentation_top a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] + +theorem stageOne_iteratedPairNameFamily (X : ZFSet.{u}) (n : Nat) : + letI := smallOrder + letI := smallTop + iteratedPairNameFamily ((pres).encode ⊤) X n = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) X n := by + let := smallOrder + let := smallTop + rw [M.stageOneConditionPresentation_top a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "I" => M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid + +structure StageOnePositionSupport (S mu X tuples : ZFSet.{u}) (used : P → ZFSet.{u}) + (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where + bounds : letI := smallOrder + ∀ (q : Shrink Condition) (extra : ZFSet.{u}), + extra ∈ M.sets → extra ⊆ b.carrier → M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, + (∀ x : L, b.encode x ∈ used ((equivShrink Condition).symm q).row → x ≤ D) ∧ + (∀ z ∈ ((equivShrink Condition).symm q).assignments, + ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments + I T S b.carrier mu X b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) ∧ + (∀ x : L, b.encode x ∈ extra → x ≤ D) ∧ + (∀ g ∈ d.principalFix D, action.iso g q = q) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include order choice countable_bound + +theorem binaryRowStageOnePositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1) + (indices : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2) + (inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1), + let coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + StageOnePositionSupport M act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted ⊥ directed first collection S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) + (M.stageOneSmallAction act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted indices ⊥ directed first collection b inputs hSquared + (M.omega_mem separation infinite)) := by + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared hLifted hSquared valid1 valid2 first indices inputs + coordinates two carrier forcingOrder + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder hLifted ⊥ directed first collection + refine ⟨?_⟩ + intro q extra hExtra extraSubset extraSmall + let p := (equivShrink _).symm q + let I := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 + let anchors := refinementIndexFieldGraph I s.carrier 2 + have anchorGround : anchors ∈ M.sets := indices.field_ground 2 + have anchorFunction : ZFSet.IsFunc I s.carrier anchors := indices.field_function 2 + obtain ⟨D, rowBound, dataBound, extraBound⟩ := + M.binaryRowStageOneDataBound s C pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu ⊤ valid hLifted I anchors + indices.index_ground anchorGround anchorFunction p.row p.assignments p.assignments_mem + extra hExtra extraSubset extraSmall + refine ⟨D, rowBound, dataBound, extraBound, ?_⟩ + intro g actor + apply M.stageOneSmallAction_fixed_of_dataBound act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder hLifted indices ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) D + (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation + infinite hL hC hG graph hmu ordinal valid f u D entry bound.2) g actor q + · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite + hL hC hG graph g p.row D (fun i used => rowBound i.val used) actor + · exact dataBound + +end TransitiveGround + +namespace GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageOnePositionSupport + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageOneGroundAction collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, ?_⟩ + rw [equal] + have countableBound := geometry.decoded_countable_bound + (fun X hX subset small => (fulfilled.countable_localization X hX subset small).2) + exact M.binaryRowStageOnePositionSupport a s b columns pairing unions powers separation + collection infinite choice geometry.carrier_ground order hColumns geometry.actors_ground action + directed countableBound hmu cardinal.1 valid liftedGround squaredGround valid1 valid2 first indexSystem inputs + +theorem exists_rowStageTwoIndices + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (ZFSet.sUnion (ZFSet.sUnion rows)) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageTwoIndexData M act c.pairEmpty nextAction nextPres b s a ⊥ directed + lifted squared valid1)) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageOnePositionSupport collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + have constructed := M.binaryRowStageOneRefinement a s b columns pairing unions powers separation + collection infinite geometry.carrier_ground order hColumns geometry.actors_ground action + directed hmu cardinal.1 valid liftedGround squaredGround valid1 valid2 first indexSystem inputs originalMaps + have nextSystem : RefinementStageSystem M nextAction nextPres b s a ⊥ directed + (natSetCode 1) lifted squared := by + rw [equal] + exact constructed + refine ⟨nextSystem, ?_, ?_, ?_, ?_⟩ + · exact M.stageOneConditionPresentation_top act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection + · exact (M.stageOne_orderedPairNameFamily act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection lifted lifted).symm + · exact M.stageOne_iteratedPairNameFamily act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder geometry.carrier_ground liftedGround indexSystem ⊥ directed first collection lifted + · + have levelData := indexSystem.union_level_data nextSystem.indices pairing unions powers separation + (M.empty_mem ⟨s.carrier, geometry.carrier_ground⟩) (M.natSetCode_mem separation infinite 1) + refine ⟨levelData.1, levelData.2.1, levelData.2.2.1, levelData.2.2.2, ?_⟩ + apply indexSystem.different_levels_disjoint nextSystem.indices + intro equalLevels + exact Nat.zero_ne_one (natSetCode_injective (show natSetCode 0 = natSetCode 1 from equalLevels)) + +end GroundMainPrefix.FinalFulfillment + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoSupport.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoSupport.lean index ad450599583ba81d4f6ea738dbb1e175d05040a0..2d3c567204d6323adba1fb2adc086813135cd95c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoSupport.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStageTwoSupport.lean @@ -1,195 +1,195 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageTwoAction - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowStageTwoSupport - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let hCoordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let hTwo := M.natSetCode_mem separation infinite 2 - let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo - let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, - ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, - ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, - NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ - ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, - ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, - act.conditionMapFamily c b ∈ M.sets ∧ - M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ - M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ - (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - ∃ nextAction, - nextAction = M.stageOneSmallAction act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first - collection b inputs hSquared (M.omega_mem separation infinite) ∧ - TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection nextAction ∧ - nextAction.actionGraph - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - nextAction.conditionMapFamily - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) b ∈ M.sets ∧ - InternallyCountablyClosed M - (M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection) ∧ - TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) - nextAction ∧ - (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted - indexSystem ⊥ directed first collection - StageTwoSupportData M act c nextAction nextPres b s a ⊥ directed - lifted squared valid1 pairing unions powers separation collection - S mu s.nonbottom.carrier - (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ - (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), - refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → - RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) - (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ - ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) - (iteratedPairNameFamily_valid ⊤ valid n) = - iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have directed := geometry.decoded_directed fulfilled.directed - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - have original := fulfilled.exists_rowStageTwoAction collection infinite choice hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data - refine data.elim (fun valid data => ?_) - refine data.elim (fun liftedGround data => ?_) - refine data.elim (fun squaredGround data => ?_) - obtain ⟨graphGround, injection, data⟩ := data - refine data.elim (fun valid1 data => ?_) - refine data.elim (fun valid2 data => ?_) - refine data.elim (fun first data => ?_) - obtain ⟨second, data⟩ := data - refine data.elim (fun indexSystem data => ?_) - refine data.elim (fun inputs data => ?_) - obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - liftedGround, squaredGround, graphGround, injection, valid1, valid2, - first, second, indexSystem, inputs, originalMaps, - forcingGround, orderGround, ?_, objects, finitePowers⟩ - let lifted := Name.renamedFamily c.pairEmpty id _ valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData - refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ - let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation - carrier forcingOrder liftedGround ⊥ directed first collection - let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 - pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround - indexSystem ⊥ directed first collection - refine ⟨priorAction, ?_⟩ - let prior := priorAction.closure_data.projection_data.carrier_data - let next := prior.index_data.next - dsimp only - intro nextInputs - have countableBound := geometry.decoded_countable_bound - (fun X hX subset small => (fulfilled.countable_localization X hX subset small).2) - apply M.binaryRowStageTwoPositionSupport nextAction nextPres a s b columns - pairing unions powers separation collection infinite choice geometry.carrier_ground order - hColumns geometry.actors_ground action directed countableBound hmu cardinal.1 valid - liftedGround valid1 priorAction.valid2 next.valid1 next.valid2 - indexSystem next.indices inputs next.inputs next.first prior.lower_carrier_ground - prior.lower_order_ground nextInputs - intro D - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - apply act.positionSupport_of_term_graphs c.pairEmpty nextAction nextPres lifted valid1 next.valid1 - priorAction.term_graphs s a S mu s.nonbottom.carrier tuples D - · intro f z entry - exact ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1 - · intro f _ u entry bound - exact M.liftedRowTuple_supported a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 valid f u D entry bound.2 - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageTwoAction + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowStageTwoSupport + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let hCoordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let hTwo := M.natSetCode_mem separation infinite 2 + let hRow := M.countablePartialFunctions_mem pairing unions powers separation infinite hCoordinates hTwo + let hOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite hCoordinates hTwo + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + (∃ hLifted : lifted ∈ M.sets, ∃ hSquared : squared ∈ M.sets, graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z, + ∃ valid2 : ∀ z ∈ squared, IsName c.pairEmpty z, + ∃ first : NiceNameSystem M act c.pairEmpty s a ⊥ directed lifted valid1, + NiceNameSystem M act c.pairEmpty s a ⊥ directed squared valid2 ∧ + ∃ indexSystem : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid1 valid2, + ∃ inputs : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid1, + act.conditionMapFamily c b ∈ M.sets ∧ + M.stageOneForcing act c s a lifted squared valid1 ∈ M.sets ∧ + M.stageOneForcingOrder act c s a lifted squared valid1 ∈ M.sets ∧ + (letI := M.stageOneConditionSmallOrder act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + ∃ nextAction, + nextAction = M.stageOneSmallAction act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted indexSystem ⊥ directed first + collection b inputs hSquared (M.omega_mem separation infinite) ∧ + TransitiveGround.StageOneSmallActionLaws M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection nextAction ∧ + nextAction.actionGraph + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + nextAction.conditionMapFamily + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) b ∈ M.sets ∧ + InternallyCountablyClosed M + (M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection) ∧ + TransitiveGround.StageOnePositionSupport M act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)) + nextAction ∧ + (letI := M.stageOneConditionSmallTop act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder hLifted ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation hRow hOrder geometry.carrier_ground hLifted + indexSystem ⊥ directed first collection + StageTwoSupportData M act c nextAction nextPres b s a ⊥ directed + lifted squared valid1 pairing unions powers separation collection + S mu s.nonbottom.carrier + (liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun p => rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw p)))) ∧ + (∀ C E (U Rf Rc : (M.nameDomain c.pairEmpty).names), + refinementIndexCode ∅ (s.encode C) (s.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid1 → + RefinementObjectSystem M act c.pairEmpty (a.principalSupportFamily ⊥ directed) + (a.principalFix C) lifted valid1 U.val Rf.val Rc.val) ∧ + ∀ n : Nat, Name.renamedFamily c.pairEmpty id (iteratedPairNameFamily (c.encode ⊤) T n) + (iteratedPairNameFamily_valid ⊤ valid n) = + iteratedPairNameFamily (c.pairEmpty.encode ⊤) lifted n) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have action : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have directed := geometry.decoded_directed fulfilled.directed + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + have original := fulfilled.exists_rowStageTwoAction collection infinite choice hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, data⟩ := data + refine data.elim (fun valid data => ?_) + refine data.elim (fun liftedGround data => ?_) + refine data.elim (fun squaredGround data => ?_) + obtain ⟨graphGround, injection, data⟩ := data + refine data.elim (fun valid1 data => ?_) + refine data.elim (fun valid2 data => ?_) + refine data.elim (fun first data => ?_) + obtain ⟨second, data⟩ := data + refine data.elim (fun indexSystem data => ?_) + refine data.elim (fun inputs data => ?_) + obtain ⟨originalMaps, forcingGround, orderGround, actionData, objects, finitePowers⟩ := data + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + liftedGround, squaredGround, graphGround, injection, valid1, valid2, + first, second, indexSystem, inputs, originalMaps, + forcingGround, orderGround, ?_, objects, finitePowers⟩ + let lifted := Name.renamedFamily c.pairEmpty id _ valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let := M.stageOneConditionSmallOrder act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + obtain ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, priorAction⟩ := actionData + refine ⟨nextAction, equal, laws, wholeAction, wholeMaps, closed, support, ?_⟩ + let := M.stageOneConditionSmallTop act c s a lifted squared valid1 pairing unions powers separation + carrier forcingOrder liftedGround ⊥ directed first collection + let nextPres := M.stageOneConditionPresentation act c s a lifted squared valid1 + pairing unions powers separation carrier forcingOrder geometry.carrier_ground liftedGround + indexSystem ⊥ directed first collection + refine ⟨priorAction, ?_⟩ + let prior := priorAction.closure_data.projection_data.carrier_data + let next := prior.index_data.next + dsimp only + intro nextInputs + have countableBound := geometry.decoded_countable_bound + (fun X hX subset small => (fulfilled.countable_localization X hX subset small).2) + apply M.binaryRowStageTwoPositionSupport nextAction nextPres a s b columns + pairing unions powers separation collection infinite choice geometry.carrier_ground order + hColumns geometry.actors_ground action directed countableBound hmu cardinal.1 valid + liftedGround valid1 priorAction.valid2 next.valid1 next.valid2 + indexSystem next.indices inputs next.inputs next.first prior.lower_carrier_ground + prior.lower_order_ground nextInputs + intro D + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + apply act.positionSupport_of_term_graphs c.pairEmpty nextAction nextPres lifted valid1 next.valid1 + priorAction.term_graphs s a S mu s.nonbottom.carrier tuples D + · intro f z entry + exact ((pair_mem_relationCompose S _ lifted _ _ f z).1 entry).2.1 + · intro f _ u entry bound + exact M.liftedRowTuple_supported a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground action hmu cardinal.1 valid f u D entry bound.2 + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralPrefixDescent.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralPrefixDescent.lean index 8d4610513c363ef54b929a8f5ec49f6d6ba4b423..c84ab3ef7995076f0a36fde60bfa1a2bc3be18ea 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralPrefixDescent.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralPrefixDescent.lean @@ -1,193 +1,193 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralCommonSupportInduction - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem structural_prefix_descent - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - ∀ (H : ConditionFilter (SetMembers Q)), - H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → - ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), - a.principalFix v ≤ localAct.stabilizer lower x.val → - a.principalFix w ≤ localAct.stabilizer lower y.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → - Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → - ∃ tau : (M.nameDomain lower).names, - HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ - Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let Property : ∀ (Q : ZFSet.{u}) (orderQ : PartialOrder (SetMembers Q)), - @PosetAction (SetMembers geometry.actors) _ (SetMembers Q) orderQ → Prop := - fun Q orderQ actionQ => - letI := orderQ - let presentation := SetMembers.presentation Q - ∀ (filter : ConditionFilter (SetMembers Q)), - filter.GenericFor (formulaFamily (M.nameDomain presentation)) → - ∀ (v w : SetMembers geometry.carrier) (first second : Name presentation), - first.val ∈ M.sets → second.val ∈ M.sets → - a.principalFix v ≤ actionQ.stabilizer presentation first → - a.principalFix w ≤ actionQ.stabilizer presentation second → - HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) first → - Name.eval {q | filter.mem q} first = Name.eval {q | filter.mem q} second → - ∃ z : Name presentation, z.val ∈ M.sets ∧ - HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) z ∧ - a.principalFix (geometry.meet.smallMeet v w) ≤ actionQ.stabilizer presentation z ∧ - Name.nameRank z ≤ Name.nameRank first ∧ - Name.eval {q | filter.mem q} z = Name.eval {q | filter.mem q} first - have earlier := fulfilled.structural_common_support_all_stages - collection infinite choice small smallD irreflexive columns hColumns hmu muOrdinal - valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - alpha (graphRestriction alpha history) hAlpha - (M.graphRestriction_mem unions separation hAlpha hh) cutOrdinal - (trace.restrict cutOrdinal subset) - have transferred := (M.semanticStructuralPrefixAction_restricted_property c act b s a ⊥ - directed lifted squared (c.encode ⊤) pairing unions powers separation collection - carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared - omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows - hh trace hAlpha cutOrdinal subset Property).1 earlier - intro lowerH _coded ordinary v w first second firstSupport secondSupport firstHS _secondHS equal - obtain ⟨z, groundZ, symmetricZ, supportZ, _rankZ, valueZ⟩ := transferred lowerH ordinary - v w first.val second.val first.property second.property firstSupport secondSupport firstHS equal - exact ⟨⟨z, groundZ⟩, symmetricZ, supportZ, valueZ⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStructuralCommonSupportInduction + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem structural_prefix_descent + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + ∀ (H : ConditionFilter (SetMembers Q)), + H.GenericFor (M.codedFamily lower) → H.GenericFor (formulaFamily (M.nameDomain lower)) → + ∀ (v w : SetMembers geometry.carrier) (x y : (M.nameDomain lower).names), + a.principalFix v ≤ localAct.stabilizer lower x.val → + a.principalFix w ≤ localAct.stabilizer lower y.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) x.val → + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) y.val → + Name.eval {p | H.mem p} x.val = Name.eval {p | H.mem p} y.val → + ∃ tau : (M.nameDomain lower).names, + HereditarilySymmetric localAct lower (a.principalSupportFamily ⊥ directed) tau.val ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ localAct.stabilizer lower tau.val ∧ + Name.eval {p | H.mem p} tau.val = Name.eval {p | H.mem p} x.val := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let Property : ∀ (Q : ZFSet.{u}) (orderQ : PartialOrder (SetMembers Q)), + @PosetAction (SetMembers geometry.actors) _ (SetMembers Q) orderQ → Prop := + fun Q orderQ actionQ => + letI := orderQ + let presentation := SetMembers.presentation Q + ∀ (filter : ConditionFilter (SetMembers Q)), + filter.GenericFor (formulaFamily (M.nameDomain presentation)) → + ∀ (v w : SetMembers geometry.carrier) (first second : Name presentation), + first.val ∈ M.sets → second.val ∈ M.sets → + a.principalFix v ≤ actionQ.stabilizer presentation first → + a.principalFix w ≤ actionQ.stabilizer presentation second → + HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) first → + Name.eval {q | filter.mem q} first = Name.eval {q | filter.mem q} second → + ∃ z : Name presentation, z.val ∈ M.sets ∧ + HereditarilySymmetric actionQ presentation (a.principalSupportFamily ⊥ directed) z ∧ + a.principalFix (geometry.meet.smallMeet v w) ≤ actionQ.stabilizer presentation z ∧ + Name.nameRank z ≤ Name.nameRank first ∧ + Name.eval {q | filter.mem q} z = Name.eval {q | filter.mem q} first + have earlier := fulfilled.structural_common_support_all_stages + collection infinite choice small smallD irreflexive columns hColumns hmu muOrdinal + valid hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + alpha (graphRestriction alpha history) hAlpha + (M.graphRestriction_mem unions separation hAlpha hh) cutOrdinal + (trace.restrict cutOrdinal subset) + have transferred := (M.semanticStructuralPrefixAction_restricted_property c act b s a ⊥ + directed lifted squared (c.encode ⊤) pairing unions powers separation collection + carrier forcingOrder forcingAction hG hL order graph nodeMaps supports hLifted hSquared + omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows + hh trace hAlpha cutOrdinal subset Property).1 earlier + intro lowerH _coded ordinary v w first second firstSupport secondSupport firstHS _secondHS equal + obtain ⟨z, groundZ, symmetricZ, supportZ, _rankZ, valueZ⟩ := transferred lowerH ordinary + v w first.val second.val first.property second.property firstSupport secondSupport firstHS equal + exact ⟨⟨z, groundZ⟩, symmetricZ, supportZ, valueZ⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralSizeFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralSizeFamilies.lean index 46fcd4402a5199982a8e8f4b2ae391bab6def166..71e7c520a07c3f68ad08a543ffc5aba256541af3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralSizeFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalStructuralSizeFamilies.lean @@ -1,427 +1,427 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainFinalSemanticStructuralZF -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalFulfillment level i₀) - -theorem exists_rowSemanticStructuralSizeHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralSequenceReflection - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - dsimp only - refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, ?_, final.2⟩ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - have topGround := M.transitive (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) - (c.pairEmpty.encode_mem ⊤) - have squaredSize : GroundBelow M squared K := M.orderedPairNameFamily_below - pairing unions powers separation infinite choice topGround hLifted hLifted hK standard liftedSize liftedSize - exact M.structuralForcingTrace_prefix_below c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation - infinite collection choice carrier geometry.actors_ground geometry.carrier_ground nodeOrderGround - supports hLifted hSquared hK conditions rowSize nodeSize liftedSize squaredSize hHistory trace - - - - - - -theorem exists_rowSemanticStructuralSizeFamilyHistory - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground - (geometry.decoded_action_eq.symm ▸ geometry.action_ground) - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let directed := geometry.decoded_directed fulfilled.directed - ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ - M.groundEmbeddable s.nonbottom.carrier mu ∧ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let graph := Name.renameFamilyGraph c.pairEmpty id T valid - ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), - graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ - ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) K history), - M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ - RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K - (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history) ∧ - (∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ - ∃ P order top action, - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared K history = - forcingStageCode P order top action ∧ - (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ - RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ - let coordinateGround := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns - let nodeActionGround : a.actionGraph s b ∈ M.sets := - geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeOrderGround : s.conditionOrder ∈ M.sets := - geometry.decoded_order_eq.symm ▸ geometry.order_ground - let forcingActionGround := M.internalRowActionGraph_mem a s b columns - pairing unions powers separation infinite geometry.carrier_ground hColumns - geometry.actors_ground nodeActionGround - let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection geometry.carrier_ground geometry.actors_ground nodeActionGround - let topMem := c.encode_mem ⊤ - let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by - intro row member - obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member - exact (c.pair_mem_conditionOrder p ⊤).2 le_top - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two - let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two - let omega := M.omega_mem separation infinite - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared K history - let Q := M.refinementHistoryForcing c.carrier lifted K packed - let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} - let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) - let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace - let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history - pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses - let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] - (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround - (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed - let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace - letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => - M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) - let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => - (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code - let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => - (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice - hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code - let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => - M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 - j.property.2.1 j.property.2.2 infinite choice - let upperPres := SetMembers.presentation Q - let F := a.principalSupportFamily ⊥ directed - P = Q ∧ - (∀ beta ∈ K, - GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ - GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) K) ∧ - M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ - (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → - ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → - assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ - ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta - (graphRestriction beta packed)) ∧ - ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), - H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ - H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ - H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ - (∀ j : Cuts, - ((projections j).projectedFilter H).GenericFor - (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ - ((projections j).projectedFilter H).GenericFor - (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ - M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ - ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ - (∀ U ∈ M.sets, - GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ - GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let columns := M.groundOmegaOne pairing unions powers separation collection infinite - have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, geometry.carrier_ground⟩ - have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let act := M.internalRowAction a s b columns pairing unions powers separation infinite - geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - have supports := M.principalSupportBasis_mem a s b pairing unions powers separation - geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround - have original := fulfilled.exists_rowSemanticStructuralSizeHistory - collection infinite choice small hK standard indices - refine original.elim (fun mu data => ?_) - obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data - obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, - hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final⟩ := data - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - have conditions := standard.to_conditions pairing unions powers separation hK - have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 - have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground - have positionSize : GroundBelow M s.nonbottom.carrier K := - nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) - have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK - have rowSize : GroundBelow M c.carrier K := - GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK - conditions positionSize columnSize - have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns - have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem - pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) - have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c - pairing unions powers separation collection carrier ground hK valid below - have topGround := M.transitive (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) - (c.pairEmpty.encode_mem ⊤) - have squaredSize : GroundBelow M squared K := M.orderedPairNameFamily_below - pairing unions powers separation infinite choice topGround hLifted hLifted hK standard liftedSize liftedSize - have fullIndices := M.structuralForcingTrace_indices_embeds c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation - infinite collection choice carrier geometry.actors_ground geometry.carrier_ground nodeOrderGround - supports hLifted hSquared hK conditions rowSize nodeSize liftedSize squaredSize hHistory trace - have families := M.structuralForcingTrace_small_family_prefix c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation - collection choice carrier geometry.actors_ground geometry.carrier_ground nodeOrderGround - supports hLifted hSquared hK hHistory conditions trace - dsimp only - exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, - hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, - history, hHistory, trace, hPacked, historyRun, witnesses, - P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, - fullIndices, families, final.2.2⟩ - -end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainFinalSemanticStructuralZF +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalFulfillment level i₀) + +theorem exists_rowSemanticStructuralSizeHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralSequenceReflection + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + dsimp only + refine ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, ?_, final.2⟩ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + have topGround := M.transitive (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) + (c.pairEmpty.encode_mem ⊤) + have squaredSize : GroundBelow M squared K := M.orderedPairNameFamily_below + pairing unions powers separation infinite choice topGround hLifted hLifted hK standard liftedSize liftedSize + exact M.structuralForcingTrace_prefix_below c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation + infinite collection choice carrier geometry.actors_ground geometry.carrier_ground nodeOrderGround + supports hLifted hSquared hK conditions rowSize nodeSize liftedSize squaredSize hHistory trace + + + + + + +theorem exists_rowSemanticStructuralSizeFamilyHistory + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + let hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground + (geometry.decoded_action_eq.symm ▸ geometry.action_ground) + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let directed := geometry.decoded_directed fulfilled.directed + ∃ mu ∈ M.sets, mu ∈ K ∧ GroundCardinal M mu ∧ ZFSet.omega ⊆ mu ∧ + M.groundEmbeddable s.nonbottom.carrier mu ∧ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + T ∈ M.sets ∧ GroundBelow M T K ∧ ∃ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let graph := Name.renameFamilyGraph c.pairEmpty id T valid + ∃ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau), + graph ∈ M.sets ∧ InjectionCode T lifted graph ∧ + ∃ (history : ZFSet.{u}) (hHistory : history ∈ M.sets) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) K history), + M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history ∈ M.sets ∧ + RecursiveRefinementOrderHistory M c.carrier c.conditionOrder lifted K + (M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history) ∧ + (∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M b s a ⊥ directed lifted squared level P order top action) ∧ + ∃ P order top action, + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared K history = + forcingStageCode P order top action ∧ + (P ∈ M.sets ∧ order ∈ M.sets ∧ top ∈ M.sets ∧ action ∈ M.sets) ∧ + RawRefinementStageWitness M b s a ⊥ directed lifted squared K P order top action ∧ + let coordinateGround := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation geometry.carrier_ground) hColumns + let nodeActionGround : a.actionGraph s b ∈ M.sets := + geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeOrderGround : s.conditionOrder ∈ M.sets := + geometry.decoded_order_eq.symm ▸ geometry.order_ground + let forcingActionGround := M.internalRowActionGraph_mem a s b columns + pairing unions powers separation infinite geometry.carrier_ground hColumns + geometry.actors_ground nodeActionGround + let supportGround := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + let nodeMapsGround := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection geometry.carrier_ground geometry.actors_ground nodeActionGround + let topMem := c.encode_mem ⊤ + let topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode ⊤) ∈ c.conditionOrder := by + intro row member + obtain ⟨p, rfl⟩ := (c.mem_carrier row).1 member + exact (c.pair_mem_conditionOrder p ⊤).2 le_top + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinateGround two + let forcingOrderGround := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinateGround two + let omega := M.omega_mem separation infinite + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared K history + let Q := M.refinementHistoryForcing c.carrier lifted K packed + let Cuts := {alpha : ZFSet // alpha ∈ M.sets ∧ ordinalSetProperty alpha ∧ alpha ⊆ K} + let lower := (fun j : Cuts => SetMembers (M.refinementHistoryForcing c.carrier lifted (Subtype.val j) (graphRestriction (Subtype.val j) packed))) + let run := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) (supportBasisCode s b a.principalFix) lifted squared standard.1.1 trace + let witnesses := M.structuralForcingTrace_witnesses c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + let mono := M.structuralHistory_rawTests_mono b s a ⊥ directed lifted squared K history + pairing unions powers separation collection geometry.actors_ground geometry.carrier_ground supportGround hHistory hLifted witnesses + let hPacked := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![b.carrier, s.carrier, s.conditionOrder, supportBasisCode s b a.principalFix, lifted, squared, K, history] + (Fin.cases geometry.actors_ground (Fin.cases geometry.carrier_ground (Fin.cases nodeOrderGround (Fin.cases supportGround + (Fin.cases hLifted (Fin.cases hSquared (Fin.cases hK (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted K packed + let upperAction := M.semanticStructuralAction c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace + letI : ∀ j : Cuts, PartialOrder (lower j) := fun j => + M.refinementHistoryPartialOrder c.conditionOrder_code lifted j.val (graphRestriction j.val packed) + let restrictions : ∀ j : Cuts, SetMembers Q →o lower j := fun j => + (run).restriction standard.1.1 j.property.2.1 j.property.2.2 c.conditionOrder_code + let inclusions : ∀ j : Cuts, lower j ↪o SetMembers Q := fun j => + (run).inclusion standard.1.1 j.property.2.1 j.property.2.2 pairing unions powers separation infinite choice + hK hPacked hLifted j.property.1 carrier (c.encode ⊤) topMem topRows mono c.conditionOrder_code + let projections : ∀ j, CompleteProjection (restrictions j) (inclusions j) := fun j => + M.semanticStructuralTrace_completeProjection c act b s a ⊥ directed lifted squared (c.encode ⊤) pairing unions powers separation collection carrier forcingOrderGround forcingActionGround geometry.actors_ground geometry.carrier_ground nodeOrderGround nodeActionGround nodeMapsGround supportGround hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 topMem topRows hK hHistory standard.1.1 trace j.val j.property.1 + j.property.2.1 j.property.2.2 infinite choice + let upperPres := SetMembers.presentation Q + let F := a.principalSupportFamily ⊥ directed + P = Q ∧ + (∀ beta ∈ K, + GroundBelow M (refinementDataHistoryIndices beta (graphRestriction beta packed)) K ∧ + GroundBelow M (M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) K) ∧ + M.groundEmbeddable (refinementDataHistoryIndices K packed) K ∧ + (∀ D ∈ M.sets, GroundBelow M D K → D ⊆ Q → + ∃ beta ∈ K, ∀ row A, ZFSet.pair row A ∈ D → + assignmentCut (refinementDataHistoryLevels K packed lifted) beta A = A ∧ + ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted beta + (graphRestriction beta packed)) ∧ + ∀ p : SetMembers Q, ∃ H : ConditionFilter (SetMembers Q), + H.mem p ∧ H.GenericFor (M.codedFamily upperPres) ∧ + H.GenericFor (formulaFamily (M.nameDomain upperPres)) ∧ + H.GenericFor (formulaFamily ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F)) ∧ + (∀ j : Cuts, + ((projections j).projectedFilter H).GenericFor + (M.codedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))) ∧ + ((projections j).projectedFilter H).GenericFor + (formulaFamily (M.nameDomain (SetMembers.presentation (M.refinementHistoryForcing c.carrier lifted j.val (graphRestriction j.val packed)))))) ∧ + M.sets ⊆ ((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q} ∧ + ZFRealization (((upperAction).symmetricDomain upperPres (M.nameDomain upperPres) F).values {q | H.mem q}) ∧ + (∀ U ∈ M.sets, + GroundSequenceReflection M (M.ordinaryExtension upperPres H) U ∧ + GroundSequenceReflection M (M.symmetricExtension upperPres (upperAction) F H) U) := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let columns := M.groundOmegaOne pairing unions powers separation collection infinite + have hColumns := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, geometry.carrier_ground⟩ + have nodeActionGround : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + have nodeOrderGround : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let act := M.internalRowAction a s b columns pairing unions powers separation infinite + geometry.carrier_ground hColumns geometry.actors_ground nodeActionGround + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + have supports := M.principalSupportBasis_mem a s b pairing unions powers separation + geometry.carrier_ground geometry.actors_ground nodeOrderGround nodeActionGround + have original := fulfilled.exists_rowSemanticStructuralSizeHistory + collection infinite choice small hK standard indices + refine original.elim (fun mu data => ?_) + obtain ⟨hmu, hmuK, cardinal, omega, positions, ground, below, valid, data⟩ := data + obtain ⟨hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, + hGraph, injection, history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final⟩ := data + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + have conditions := standard.to_conditions pairing unions powers separation hK + have nodeSize : GroundBelow M s.carrier K := (run.finalGeometry_below i₀ choice hK standard indices).1 + have hPositions := M.nonbottom_carrier_mem s separation geometry.carrier_ground + have positionSize : GroundBelow M s.nonbottom.carrier K := + nodeSize.restrict separation hPositions hK (fun z member => (s.mem_nonbottom_carrier z).1 member |>.1) + have columnSize := conditions.groundOmegaOne_below pairing unions powers separation collection infinite hK + have rowSize : GroundBelow M c.carrier K := + GroundBelow.binaryRowCarrier pairing unions powers separation hPositions hColumns hK + conditions positionSize columnSize + have coordinates := M.prod_mem pairing unions powers separation hPositions hColumns + have carrier : c.carrier ∈ M.sets := M.countablePartialFunctions_mem + pairing unions powers separation infinite coordinates (M.natSetCode_mem separation infinite 2) + have liftedSize : GroundBelow M lifted K := M.pairEmpty_renamedFamily_below c + pairing unions powers separation collection carrier ground hK valid below + have topGround := M.transitive (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) + (c.pairEmpty.encode_mem ⊤) + have squaredSize : GroundBelow M squared K := M.orderedPairNameFamily_below + pairing unions powers separation infinite choice topGround hLifted hLifted hK standard liftedSize liftedSize + have fullIndices := M.structuralForcingTrace_indices_embeds c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation + infinite collection choice carrier geometry.actors_ground geometry.carrier_ground nodeOrderGround + supports hLifted hSquared hK conditions rowSize nodeSize liftedSize squaredSize hHistory trace + have families := M.structuralForcingTrace_small_family_prefix c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared pairing unions powers separation + collection choice carrier geometry.actors_ground geometry.carrier_ground nodeOrderGround + supports hLifted hSquared hK hHistory conditions trace + dsimp only + exact ⟨mu, hmu, hmuK, cardinal, omega, positions, ground, below, valid, + hLifted, hSquared, valid1, valid2, closed1, closed2, children1, children2, hGraph, injection, + history, hHistory, trace, hPacked, historyRun, witnesses, + P, forcingOrder, top, action, code, fields, witness, final.1, final.2.1, + fullIndices, families, final.2.2⟩ + +end PartitionPilot.Forcing.GroundMainPrefix.FinalFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalSuccessorPreparedProfiles.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalSuccessorPreparedProfiles.lean index fa986ce37721d4370117fa02894442cf0af16f23..f8a623c896b4d74becc55c293c72e5e500ce7f85 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalSuccessorPreparedProfiles.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainFinalSuccessorPreparedProfiles.lean @@ -1,340 +1,340 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPreparedInsertionProfiles - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} {i₀ : I} -variable (fulfilled : run.FinalSupportFulfillment level i₀) - -theorem successor_prepared_insertion_profiles - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) - {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : - let geometry := run.finalGeometry i₀ - letI := geometry.group_code.toGroup - letI := geometry.meet.order.toPartialOrder - letI := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) - (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) - (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → - HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) - (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (stagesOrdinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) - b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) → - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → - ∀ r0 : SetMembers Q, - let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val - let N := M.niceSupportNameCodes localAct lower lifted a.principalFix - let Profiles (k : ZFSet.{u}) := M.certificateProfileImage J s.carrier N k - let prefixIndices := refinementDataHistoryIndices alpha lowerPacked - let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid - J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ - ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ - Profiles k ∈ M.sets ∧ M.groundEmbeddable (Profiles k) ZFSet.omega ∧ - (∀ F ∈ Profiles k, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ - ∃ Pb basis representatives, - ZFSet.pair (Name.refinementClass lifted localValid Rc.val u.val).val - (ZFSet.pair Pb (ZFSet.pair basis representatives)) ∈ k ∧ Pb ∈ Profiles k ∧ - ∃ generators ∈ M.sets, M.groundEmbeddable generators ZFSet.omega ∧ generators.Nonempty ∧ - generators ⊆ testedMeetFilter Pb geometry.order (s.encode E) ∧ - M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators = - testedMeetFilter Pb geometry.order (s.encode E) ∧ - ∃ r : SetMembers Q, r ≤ r0 ∧ - ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), - lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ - StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ - ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ - a.principalFix D0 ≤ localAct.stabilizer lower u.val ∧ - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ - (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ - stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier - s.conditionOrder prefixAnchors tuples) ∧ - M.DecidesVisibilityProfile localAct lower s a.principalFix lifted Pb - (Name.refinementClass lifted localValid Rc.val u.val) r ∧ - (∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F ∈ Profiles k ∧ M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val r) ∧ - ∀ v w : (M.nameDomain lower).names, v.val.val ∈ lifted → w.val.val ∈ lifted → - stageOneAssignment idx v.val.val w.val.val ∈ A → - ∃ F B f, ZFSet.pair (Name.refinementClass lifted localValid Rf.val w.val).val - (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ F ∈ Profiles k ∧ - M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F - (Name.refinementClass lifted localValid Rf.val w.val) r := by - let geometry := run.finalGeometry i₀ - let := geometry.group_code.toGroup - let := geometry.meet.order.toPartialOrder - let := geometry.decodedBottom - let s := SetMembers.presentation geometry.carrier - let b := SetMembers.presentation geometry.actors - let a := geometry.decodedAction - let directed := geometry.decoded_directed fulfilled.directed - let hL := geometry.carrier_ground - let hG := geometry.actors_ground - let hC := hColumns - let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground - let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground - let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation - collection hL hG graph - let supports := geometry.decoded_supportBasis_ground pairing unions powers separation - let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S - dsimp only - intro valid - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 - stages history hs hh stagesOrdinal trace - let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC - let two := M.natSetCode_mem separation infinite 2 - let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph - let omega := M.omega_mem separation infinite - let topMem := c.encode_mem ⊤ - let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := - fun r hr => by - obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr - exact (c.pair_mem_conditionOrder r ⊤).2 le_top - let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared stages history - intro alpha member - let hAlpha := M.transitive hs member - let cutOrdinal := ordinalSetProperty_member stagesOrdinal member - let subset := (And.left stagesOrdinal) alpha member - let lowerPacked := graphRestriction alpha packed - let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked - let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked - let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace - let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows - let lower := SetMembers.presentation Q - let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset - let localValid := M.refinementHistoryRowNameFamily_valid c - (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 - let gamma := insert alpha alpha - have hGamma : gamma ∈ M.sets := M.insert_mem pairing unions hAlpha hAlpha - have gammaOrdinal : ordinalSetProperty gamma := ordinalSetProperty_succ cutOrdinal - have alphaGamma : alpha ⊆ gamma := fun _ hx => ZFSet.mem_insert_of_mem _ hx - have gammaSubset : gamma ⊆ stages := by - intro x hx - rcases ZFSet.mem_insert_iff.1 hx with rfl | old - · exact member - · exact subset x old - let historyGamma := graphRestriction gamma history - have hhGamma : historyGamma ∈ M.sets := M.graphRestriction_mem unions separation hGamma hh - have traceGamma := trace.restrict gammaOrdinal gammaSubset - let packedGamma := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared gamma historyGamma - have packedGammaEq : packedGamma = graphRestriction gamma packed := - (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared gamma history).trans - (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder - (supportBasisCode s b a.principalFix) lifted squared gammaSubset) - have lowerPackedEq : graphRestriction alpha packedGamma = lowerPacked := by - rw [packedGammaEq, graphRestriction_restrict alphaGamma] - let Property : ∀ (domainSet : ZFSet.{u}) (orderQ : PartialOrder (SetMembers domainSet)), - @PosetAction (SetMembers geometry.actors) _ (SetMembers domainSet) orderQ → Prop := - fun domainSet orderQ actionQ => - letI := orderQ - ∀ topQ : OrderTop (SetMembers domainSet), - letI := topQ - let lower := SetMembers.presentation domainSet - ∀ localValid : ∀ z ∈ lifted, IsName lower z, - ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) → - ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), - let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices actionQ lower s a alpha lifted squared localValid → u.val.val ∈ lifted → - ∀ r0 : SetMembers domainSet, - let J := M.fixedIndexAugmentedRequests actionQ lower s a alpha lifted squared localValid idx A Rc.val u.val - let N := M.niceSupportNameCodes actionQ lower lifted a.principalFix - let Profiles (k : ZFSet.{u}) := M.certificateProfileImage J s.carrier N k - let prefixIndices := refinementDataHistoryIndices alpha lowerPacked - let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid - J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ - ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ - Profiles k ∈ M.sets ∧ M.groundEmbeddable (Profiles k) ZFSet.omega ∧ - (∀ F ∈ Profiles k, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ - ∃ Pb basis representatives, - ZFSet.pair (Name.refinementClass lifted localValid Rc.val u.val).val - (ZFSet.pair Pb (ZFSet.pair basis representatives)) ∈ k ∧ Pb ∈ Profiles k ∧ - ∃ generators ∈ M.sets, M.groundEmbeddable generators ZFSet.omega ∧ generators.Nonempty ∧ - generators ⊆ testedMeetFilter Pb geometry.order (s.encode E) ∧ - M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators = - testedMeetFilter Pb geometry.order (s.encode E) ∧ - ∃ r : SetMembers domainSet, r ≤ r0 ∧ - ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), - lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ - StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ - ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ - a.principalFix D0 ≤ actionQ.stabilizer lower u.val ∧ - (∀ i : SetMembers geometry.carrier, s.encode i ∈ - rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ - (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ - stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier - s.conditionOrder prefixAnchors tuples) ∧ - M.DecidesVisibilityProfile actionQ lower s a.principalFix lifted Pb - (Name.refinementClass lifted localValid Rc.val u.val) r ∧ - (∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), - ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → - F ∈ Profiles k ∧ M.DecidesVisibilityProfile actionQ lower s a.principalFix lifted F z.val r) ∧ - ∀ v w : (M.nameDomain lower).names, v.val.val ∈ lifted → w.val.val ∈ lifted → - stageOneAssignment idx v.val.val w.val.val ∈ A → - ∃ F B f, ZFSet.pair (Name.refinementClass lifted localValid Rf.val w.val).val - (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ F ∈ Profiles k ∧ - M.DecidesVisibilityProfile actionQ lower s a.principalFix lifted F - (Name.refinementClass lifted localValid Rf.val w.val) r - let QGamma := M.refinementHistoryForcing c.carrier lifted alpha (graphRestriction alpha packedGamma) - let gammaOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha - (graphRestriction alpha packedGamma) - let runGamma := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) - (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) - (supportBasisCode s b a.principalFix) lifted squared gammaOrdinal traceGamma - let topGamma := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha - (graphRestriction alpha packedGamma) (runGamma.carriers.restrict cutOrdinal alphaGamma) - cutOrdinal carrier (c.encode ⊤) topMem topRows - let validGamma := M.refinementHistoryRowNameFamily_valid c - (runGamma.carriers.restrict cutOrdinal alphaGamma) cutOrdinal carrier lifted valid1 - let actionGamma := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) - pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph - nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hhGamma traceGamma hAlpha cutOrdinal alphaGamma - have inside : Property QGamma gammaOrder actionGamma := by - intro topQ - have topEq : topQ = topGamma := Subsingleton.elim _ _ - subst topQ - dsimp only - intro validQ - have validEq : validQ = validGamma := Subsingleton.elim _ _ - subst validQ - intro row A condition V E U Rf Rc u inI hu r0 - have conditionGamma : ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted gamma packedGamma := by - rw [packedGammaEq] - exact condition - obtain ⟨hJ, smallJ, k, hk, function, profilesGround, profilesSmall, filters, - Pb, basis, representatives, coarseEdge, coarseMember, generators, hGenerators, - smallGenerators, nonemptyGenerators, generatorsSubset, generated, r, below, - rowR, lowerA, rCode, prepared, D0, eBelow, nameSupport, rowBound, dataBound, - coarseDecision, decisions, oldProfiles⟩ := - fulfilled.prepared_augmented_profiles collection infinite choice small smallD irreflexive - columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 - children1 children2 gamma historyGamma hGamma hhGamma gammaOrdinal traceGamma - alpha (ZFSet.mem_insert _ _) row A conditionGamma V E U Rf Rc u inI hu r0 - have preparedParent : StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier - ((SetMembers.presentation QGamma).encode r) := by - have transfer (raw : ZFSet.{u}) : - StoredPreparedConditionCode M c.carrier lifted alpha (graphRestriction alpha packedGamma) s.carrier raw → - StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier raw := by - rw [lowerPackedEq] - exact id - exact transfer _ prepared - rw [lowerPackedEq] at dataBound - exact ⟨hJ, smallJ, k, hk, function, profilesGround, profilesSmall, filters, - Pb, basis, representatives, coarseEdge, coarseMember, generators, hGenerators, - smallGenerators, nonemptyGenerators, generatorsSubset, generated, r, below, - rowR, lowerA, rCode, preparedParent, D0, eBelow, nameSupport, rowBound, dataBound, - coarseDecision, decisions, oldProfiles⟩ - have outside := (M.semanticStructuralPrefixAction_subhistory_property c act b s a ⊥ directed lifted squared - (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order - graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 - topMem topRows hh trace hAlpha cutOrdinal subset hGamma gammaOrdinal alphaGamma gammaSubset Property).1 inside - exact outside inferInstance localValid - -end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalPreparedInsertionProfiles + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} {i₀ : I} +variable (fulfilled : run.FinalSupportFulfillment level i₀) + +theorem successor_prepared_insertion_profiles + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (small : M.sets.Countable) (smallD : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + (columns : ZFSet.{u}) (hColumns : columns ∈ M.sets) + {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) (muOrdinal : ordinalSetProperty mu) : + let geometry := run.finalGeometry i₀ + letI := geometry.group_code.toGroup + letI := geometry.meet.order.toPartialOrder + letI := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + ∀ (hLifted : lifted ∈ M.sets) (hSquared : squared ∈ M.sets) + (valid1 : ∀ z ∈ lifted, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ squared, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ lifted → (act.act c.pairEmpty g tau).val ∈ lifted) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ squared → (act.act c.pairEmpty g tau).val ∈ squared) + (children1 : ∀ tau : Name c.pairEmpty, tau.val ∈ lifted → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (children2 : ∀ tau : Name c.pairEmpty, tau.val ∈ squared → + HereditarilySymmetric act c.pairEmpty (a.principalSupportFamily ⊥ directed) tau) + (stages history : ZFSet.{u}) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (stagesOrdinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage c.carrier c.conditionOrder (c.encode ⊤) (act.actionGraph c b) + b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared level prior) stages history), + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + ∀ (alpha : ZFSet.{u}) (member : alpha ∈ stages), + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + letI := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + letI := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) → + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices localAct lower s a alpha lifted squared localValid → u.val.val ∈ lifted → + ∀ r0 : SetMembers Q, + let J := M.fixedIndexAugmentedRequests localAct lower s a alpha lifted squared localValid idx A Rc.val u.val + let N := M.niceSupportNameCodes localAct lower lifted a.principalFix + let Profiles (k : ZFSet.{u}) := M.certificateProfileImage J s.carrier N k + let prefixIndices := refinementDataHistoryIndices alpha lowerPacked + let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid + J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ + ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ + Profiles k ∈ M.sets ∧ M.groundEmbeddable (Profiles k) ZFSet.omega ∧ + (∀ F ∈ Profiles k, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ + ∃ Pb basis representatives, + ZFSet.pair (Name.refinementClass lifted localValid Rc.val u.val).val + (ZFSet.pair Pb (ZFSet.pair basis representatives)) ∈ k ∧ Pb ∈ Profiles k ∧ + ∃ generators ∈ M.sets, M.groundEmbeddable generators ZFSet.omega ∧ generators.Nonempty ∧ + generators ⊆ testedMeetFilter Pb geometry.order (s.encode E) ∧ + M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators = + testedMeetFilter Pb geometry.order (s.encode E) ∧ + ∃ r : SetMembers Q, r ≤ r0 ∧ + ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), + lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ + StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ + ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ + a.principalFix D0 ≤ localAct.stabilizer lower u.val ∧ + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ + (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ + stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier + s.conditionOrder prefixAnchors tuples) ∧ + M.DecidesVisibilityProfile localAct lower s a.principalFix lifted Pb + (Name.refinementClass lifted localValid Rc.val u.val) r ∧ + (∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F ∈ Profiles k ∧ M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F z.val r) ∧ + ∀ v w : (M.nameDomain lower).names, v.val.val ∈ lifted → w.val.val ∈ lifted → + stageOneAssignment idx v.val.val w.val.val ∈ A → + ∃ F B f, ZFSet.pair (Name.refinementClass lifted localValid Rf.val w.val).val + (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ F ∈ Profiles k ∧ + M.DecidesVisibilityProfile localAct lower s a.principalFix lifted F + (Name.refinementClass lifted localValid Rf.val w.val) r := by + let geometry := run.finalGeometry i₀ + let := geometry.group_code.toGroup + let := geometry.meet.order.toPartialOrder + let := geometry.decodedBottom + let s := SetMembers.presentation geometry.carrier + let b := SetMembers.presentation geometry.actors + let a := geometry.decodedAction + let directed := geometry.decoded_directed fulfilled.directed + let hL := geometry.carrier_ground + let hG := geometry.actors_ground + let hC := hColumns + let order : s.conditionOrder ∈ M.sets := geometry.decoded_order_eq.symm ▸ geometry.order_ground + let graph : a.actionGraph s b ∈ M.sets := geometry.decoded_action_eq.symm ▸ geometry.action_ground + let nodeMaps := M.conditionMapFamily_mem_of_actionGraph a s b pairing unions powers separation + collection hL hG graph + let supports := geometry.decoded_supportBasis_ground pairing unions powers separation + let := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + let := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b columns pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier columns) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier columns ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S + dsimp only + intro valid + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + intro hLifted hSquared valid1 valid2 closed1 closed2 children1 children2 + stages history hs hh stagesOrdinal trace + let coordinates := M.prod_mem pairing unions powers separation (M.nonbottom_carrier_mem s separation hL) hC + let two := M.natSetCode_mem separation infinite 2 + let carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + let forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + let forcingAction := M.internalRowActionGraph_mem a s b columns pairing unions powers separation infinite hL hC hG graph + let omega := M.omega_mem separation infinite + let topMem := c.encode_mem ⊤ + let topRows : ∀ r ∈ c.carrier, ZFSet.pair r (c.encode ⊤) ∈ c.conditionOrder := + fun r hr => by + obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr + exact (c.pair_mem_conditionOrder r ⊤).2 le_top + let packed := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared stages history + intro alpha member + let hAlpha := M.transitive hs member + let cutOrdinal := ordinalSetProperty_member stagesOrdinal member + let subset := (And.left stagesOrdinal) alpha member + let lowerPacked := graphRestriction alpha packed + let Q := M.refinementHistoryForcing c.carrier lifted alpha lowerPacked + let := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha lowerPacked + let historyRun := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared stagesOrdinal trace + let := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha lowerPacked + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier (c.encode ⊤) topMem topRows + let lower := SetMembers.presentation Q + let localAct := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset + let localValid := M.refinementHistoryRowNameFamily_valid c + (historyRun.carriers.restrict cutOrdinal subset) cutOrdinal carrier lifted valid1 + let gamma := insert alpha alpha + have hGamma : gamma ∈ M.sets := M.insert_mem pairing unions hAlpha hAlpha + have gammaOrdinal : ordinalSetProperty gamma := ordinalSetProperty_succ cutOrdinal + have alphaGamma : alpha ⊆ gamma := fun _ hx => ZFSet.mem_insert_of_mem _ hx + have gammaSubset : gamma ⊆ stages := by + intro x hx + rcases ZFSet.mem_insert_iff.1 hx with rfl | old + · exact member + · exact subset x old + let historyGamma := graphRestriction gamma history + have hhGamma : historyGamma ∈ M.sets := M.graphRestriction_mem unions separation hGamma hh + have traceGamma := trace.restrict gammaOrdinal gammaSubset + let packedGamma := M.structuralRefinementHistory b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared gamma historyGamma + have packedGammaEq : packedGamma = graphRestriction gamma packed := + (M.structuralRefinementHistory_history_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared gamma history).trans + (M.structuralRefinementHistory_domain_restrict b.carrier s.carrier s.conditionOrder + (supportBasisCode s b a.principalFix) lifted squared gammaSubset) + have lowerPackedEq : graphRestriction alpha packedGamma = lowerPacked := by + rw [packedGammaEq, graphRestriction_restrict alphaGamma] + let Property : ∀ (domainSet : ZFSet.{u}) (orderQ : PartialOrder (SetMembers domainSet)), + @PosetAction (SetMembers geometry.actors) _ (SetMembers domainSet) orderQ → Prop := + fun domainSet orderQ actionQ => + letI := orderQ + ∀ topQ : OrderTop (SetMembers domainSet), + letI := topQ + let lower := SetMembers.presentation domainSet + ∀ localValid : ∀ z ∈ lifted, IsName lower z, + ∀ (row A : ZFSet.{u}), ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted (insert alpha alpha) (graphRestriction (insert alpha alpha) packed) → + ∀ (V E : SetMembers geometry.carrier) (U Rf Rc u : (M.nameDomain lower).names), + let idx := refinementIndexCode alpha (s.encode V) (s.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices actionQ lower s a alpha lifted squared localValid → u.val.val ∈ lifted → + ∀ r0 : SetMembers domainSet, + let J := M.fixedIndexAugmentedRequests actionQ lower s a alpha lifted squared localValid idx A Rc.val u.val + let N := M.niceSupportNameCodes actionQ lower lifted a.principalFix + let Profiles (k : ZFSet.{u}) := M.certificateProfileImage J s.carrier N k + let prefixIndices := refinementDataHistoryIndices alpha lowerPacked + let prefixAnchors := refinementIndexFieldGraph prefixIndices s.carrier 2 + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier rows.sUnion.sUnion rows S valid + J ∈ M.sets ∧ M.groundEmbeddable J ZFSet.omega ∧ + ∃ k ∈ M.sets, ZFSet.IsFunc J (M.supportedEqualityCertificateBound s.carrier N) k ∧ + Profiles k ∈ M.sets ∧ M.groundEmbeddable (Profiles k) ZFSet.omega ∧ + (∀ F ∈ Profiles k, MeetFilterCode geometry.carrier geometry.order geometry.meetGraph F) ∧ + ∃ Pb basis representatives, + ZFSet.pair (Name.refinementClass lifted localValid Rc.val u.val).val + (ZFSet.pair Pb (ZFSet.pair basis representatives)) ∈ k ∧ Pb ∈ Profiles k ∧ + ∃ generators ∈ M.sets, M.groundEmbeddable generators ZFSet.omega ∧ generators.Nonempty ∧ + generators ⊆ testedMeetFilter Pb geometry.order (s.encode E) ∧ + M.generatedMeetFilter geometry.carrier geometry.order geometry.meetGraph generators = + testedMeetFilter Pb geometry.order (s.encode E) ∧ + ∃ r : SetMembers domainSet, r ≤ r0 ∧ + ∃ (rowR : SetMembers c.carrier) (lowerA : ZFSet.{u}), + lower.encode r = ZFSet.pair (c.encode rowR) lowerA ∧ + StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier (lower.encode r) ∧ + ∃ D0 : SetMembers geometry.carrier, E ≤ D0 ∧ + a.principalFix D0 ≤ actionQ.stabilizer lower u.val ∧ + (∀ i : SetMembers geometry.carrier, s.encode i ∈ + rowUsedRows s.nonbottom.carrier columns (natSetCode 2) (SetMembers.raw rowR) → i ≤ D0) ∧ + (∀ z ∈ lowerA, ZFSet.pair z (s.encode D0) ∈ + stageOneDataBounds lowerA prefixIndices lifted S s.carrier mu s.nonbottom.carrier + s.conditionOrder prefixAnchors tuples) ∧ + M.DecidesVisibilityProfile actionQ lower s a.principalFix lifted Pb + (Name.refinementClass lifted localValid Rc.val u.val) r ∧ + (∀ (z : (M.nameDomain lower).names) (F B f : ZFSet.{u}), + ZFSet.pair z.val.val (ZFSet.pair F (ZFSet.pair B f)) ∈ k → + F ∈ Profiles k ∧ M.DecidesVisibilityProfile actionQ lower s a.principalFix lifted F z.val r) ∧ + ∀ v w : (M.nameDomain lower).names, v.val.val ∈ lifted → w.val.val ∈ lifted → + stageOneAssignment idx v.val.val w.val.val ∈ A → + ∃ F B f, ZFSet.pair (Name.refinementClass lifted localValid Rf.val w.val).val + (ZFSet.pair F (ZFSet.pair B f)) ∈ k ∧ F ∈ Profiles k ∧ + M.DecidesVisibilityProfile actionQ lower s a.principalFix lifted F + (Name.refinementClass lifted localValid Rf.val w.val) r + let QGamma := M.refinementHistoryForcing c.carrier lifted alpha (graphRestriction alpha packedGamma) + let gammaOrder := M.refinementHistoryPartialOrder c.conditionOrder_code lifted alpha + (graphRestriction alpha packedGamma) + let runGamma := M.structuralForcingTrace_recursiveOrder c.carrier c.conditionOrder (c.encode ⊤) + (act.actionGraph c b) b.carrier s.carrier s.conditionOrder (a.actionGraph s b) + (supportBasisCode s b a.principalFix) lifted squared gammaOrdinal traceGamma + let topGamma := M.refinementHistoryOrderTop c.conditionOrder_code lifted alpha + (graphRestriction alpha packedGamma) (runGamma.carriers.restrict cutOrdinal alphaGamma) + cutOrdinal carrier (c.encode ⊤) topMem topRows + let validGamma := M.refinementHistoryRowNameFamily_valid c + (runGamma.carriers.restrict cutOrdinal alphaGamma) cutOrdinal carrier lifted valid1 + let actionGamma := M.semanticStructuralPrefixAction c act b s a ⊥ directed lifted squared (c.encode ⊤) + pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order graph + nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hhGamma traceGamma hAlpha cutOrdinal alphaGamma + have inside : Property QGamma gammaOrder actionGamma := by + intro topQ + have topEq : topQ = topGamma := Subsingleton.elim _ _ + subst topQ + dsimp only + intro validQ + have validEq : validQ = validGamma := Subsingleton.elim _ _ + subst validQ + intro row A condition V E U Rf Rc u inI hu r0 + have conditionGamma : ZFSet.pair row A ∈ M.refinementHistoryForcing c.carrier lifted gamma packedGamma := by + rw [packedGammaEq] + exact condition + obtain ⟨hJ, smallJ, k, hk, function, profilesGround, profilesSmall, filters, + Pb, basis, representatives, coarseEdge, coarseMember, generators, hGenerators, + smallGenerators, nonemptyGenerators, generatorsSubset, generated, r, below, + rowR, lowerA, rCode, prepared, D0, eBelow, nameSupport, rowBound, dataBound, + coarseDecision, decisions, oldProfiles⟩ := + fulfilled.prepared_augmented_profiles collection infinite choice small smallD irreflexive + columns hColumns hmu muOrdinal valid hLifted hSquared valid1 valid2 closed1 closed2 + children1 children2 gamma historyGamma hGamma hhGamma gammaOrdinal traceGamma + alpha (ZFSet.mem_insert _ _) row A conditionGamma V E U Rf Rc u inI hu r0 + have preparedParent : StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier + ((SetMembers.presentation QGamma).encode r) := by + have transfer (raw : ZFSet.{u}) : + StoredPreparedConditionCode M c.carrier lifted alpha (graphRestriction alpha packedGamma) s.carrier raw → + StoredPreparedConditionCode M c.carrier lifted alpha lowerPacked s.carrier raw := by + rw [lowerPackedEq] + exact id + exact transfer _ prepared + rw [lowerPackedEq] at dataBound + exact ⟨hJ, smallJ, k, hk, function, profilesGround, profilesSmall, filters, + Pb, basis, representatives, coarseEdge, coarseMember, generators, hGenerators, + smallGenerators, nonemptyGenerators, generatorsSubset, generated, r, below, + rowR, lowerA, rCode, preparedParent, D0, eBelow, nameSupport, rowBound, dataBound, + coarseDecision, decisions, oldProfiles⟩ + have outside := (M.semanticStructuralPrefixAction_subhistory_property c act b s a ⊥ directed lifted squared + (c.encode ⊤) pairing unions powers separation collection carrier forcingOrder forcingAction hG hL order + graph nodeMaps supports hLifted hSquared omega valid1 valid2 closed1 closed2 children1 children2 + topMem topRows hh trace hAlpha cutOrdinal subset hGamma gammaOrdinal alphaGamma gammaSubset Property).1 inside + exact outside inferInstance localValid + +end PartitionPilot.Forcing.GroundMainPrefix.FinalSupportFulfillment + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainOrdinalConstructionData.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainOrdinalConstructionData.lean index 21aca38b64d0a8691e603943f8cacffd3756bdbb..ad3823e756e7ef8a5686dce2744a99e319a61fb6 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainOrdinalConstructionData.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainOrdinalConstructionData.lean @@ -1,177 +1,177 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainConditionalTotality -import OAI.SetTheory.PartitionPrinciple.Transfinite.MainPrefixSelectedTraceLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundMainOrdinalConstruction - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, - ∃ seed : GroundInitialMainSeedData M K C, - ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), - ∃ initial : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation - {i : Fin 2 // run.key i ∈ natSetCode 1}, - let B := level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) - B ∈ M.sets ∧ initial.code ∈ B ∧ initial.indices = natSetCode 1 ∧ - initial.PreservesOldProfiles ∧ initial.code ∈ M.sets ∧ - ZFSet.rank initial.code < ZFSet.rank K ∧ - initial.stageGraph = graphRestriction (natSetCode 1) run.stageGraph ∧ - initial.transitionGraph = graphRestriction (chronologyPairs (natSetCode 1)) run.transitionGraph ∧ - (∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = seed.source) ∧ - ∃ f ∈ M.sets, - ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode)) - (ZFSet.prod level.carrier level.carrier) f ∧ - f ⊆ M.taskBearingSuccessorRelation - (M.linkedMainStageCandidates level.carrier K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode)) - level.carrier K C C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ - (∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - target ∈ M.linkedMainStageCandidates level.carrier K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ - z ∈ level.carrier ∧ TaskBearingMainSuccessorCode M K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) - ZFSet.omega source target z) ∧ - ∃ g ∈ M.sets, ZFSet.IsFunc B B g ∧ - g ⊆ M.mainPrefixConditionalRelation B K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ZFSet.omega f ∧ - (∀ old next, ZFSet.pair old next ∈ g → next ∈ B ∧ - MainPrefixConditionalStepCode M K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) - ZFSet.omega f old next) ∧ - ∃ p ∈ M.sets, - OrdinalRecursionTrace (MainPrefixTraceStepCode B initial.code g) C p ∧ - ∀ q, OrdinalRecursionTrace (MainPrefixTraceStepCode B initial.code g) C q → q = p := by - dsimp only - obtain ⟨level, seed, run, initial, domainGround, initialMember, initialIndices, - profiles, initialGround, initialRank, stageRestriction, transitionRestriction, source⟩ := - M.exists_initialRecursionSeed pairing unions powers separation collection infinite choice hK standard - have columnsGround := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - obtain ⟨f, hf, fFunction, fSelected, fEntries⟩ := - M.exists_groundOmegaOneTaskBearingSuccessorFunction pairing unions powers separation collection infinite choice - hK standard seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground - seed.injection_ground seed.dense (fun x hx => (seed.no_endpoints x hx).2) seed.injection_code level - obtain ⟨g, hg, gFunction, gSelected, gEntries⟩ := - level.exists_groundConditionalPrefixFunction pairing unions powers separation collection infinite choice - hK standard columnsGround seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground - rfl hf fFunction fSelected - let B := level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) - (M.groundOmegaOne pairing unions powers separation collection infinite) - (M.groundOmegaOne pairing unions powers separation collection infinite) - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) - have seedIndex : MainPrefixAtIndex (insert ∅ ∅) initial.code := by - refine ⟨initial.stageGraph, initial.transitionGraph, ?_⟩ - change mainPrefixCode initial.indices initial.stageGraph initial.transitionGraph = _ - rw [initialIndices] - rfl - have advance : ∀ old next T, ZFSet.pair old next ∈ g → MainPrefixAtIndex T old → - MainPrefixAtIndex (insert T T) next ∧ MainPrefixExtends old next := by - intro old next T entry index - obtain ⟨S, E, oldCode⟩ := index - have branch := (gEntries old next entry).2 - exact ⟨branch.next_fields oldCode, branch.extension⟩ - obtain ⟨p, hp, trace, unique⟩ := M.exists_unique_selectedMainPrefixTrace - pairing unions powers separation collection infinite hK standard level - (B := B) rfl domainGround initialMember seedIndex hg gFunction advance - exact ⟨level, seed, run, initial, domainGround, initialMember, initialIndices, - profiles, initialGround, initialRank, stageRestriction, transitionRestriction, source, - f, hf, fFunction, fSelected, fEntries, g, hg, gFunction, gSelected, gEntries, p, hp, trace, unique⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -structure GroundMainOrdinalConstructionData (M : TransitiveGround.{u}) (K C : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) where - level : GroundMainCandidateLevel M K - seed : GroundInitialMainSeedData M K C - seedRun : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2) - initial : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation - {i : Fin 2 // seedRun.key i ∈ natSetCode 1} - domain : ZFSet.{u} - domain_eq : domain = level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) - domain_ground : domain ∈ M.sets - initial_member : initial.code ∈ domain - initial_indices : initial.indices = natSetCode 1 - initial_profiles : initial.PreservesOldProfiles - initial_rank : ZFSet.rank initial.code < ZFSet.rank K - initial_stages : initial.stageGraph = graphRestriction (natSetCode 1) seedRun.stageGraph - initial_transitions : initial.transitionGraph = - graphRestriction (chronologyPairs (natSetCode 1)) seedRun.transitionGraph - initial_source : ∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = seed.source - successors : ZFSet.{u} - successors_ground : successors ∈ M.sets - successors_function : ZFSet.IsFunc - (M.linkedMainStageCandidates level.carrier K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode)) (ZFSet.prod level.carrier level.carrier) successors - successors_selected : successors ⊆ M.taskBearingSuccessorRelation - (M.linkedMainStageCandidates level.carrier K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode)) level.carrier K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) - successors_entries : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ successors → - target ∈ M.linkedMainStageCandidates level.carrier K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ z ∈ level.carrier ∧ - TaskBearingMainSuccessorCode M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ZFSet.omega source target z - steps : ZFSet.{u} - steps_ground : steps ∈ M.sets - steps_function : ZFSet.IsFunc domain domain steps - steps_selected : steps ⊆ M.mainPrefixConditionalRelation domain K C C - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ZFSet.omega successors - steps_entries : ∀ old next, ZFSet.pair old next ∈ steps → next ∈ domain ∧ - MainPrefixConditionalStepCode M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ZFSet.omega successors old next - history : ZFSet.{u} - history_ground : history ∈ M.sets - trace : OrdinalRecursionTrace (MainPrefixTraceStepCode domain initial.code steps) C history - trace_unique : ∀ q, OrdinalRecursionTrace (MainPrefixTraceStepCode domain initial.code steps) C q → - q = history - -theorem TransitiveGround.exists_groundMainOrdinalData (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - Nonempty (GroundMainOrdinalConstructionData M K - (M.groundOmegaOne pairing unions powers separation collection infinite) - pairing unions powers separation) := by - obtain ⟨level, seed, seedRun, initial, domainGround, initialMember, indices, profiles, - _, rank, stages, transitions, source, f, hf, fFunction, fSelected, fEntries, - g, hg, gFunction, gSelected, gEntries, p, hp, trace, unique⟩ := - M.exists_groundMainOrdinalConstruction pairing unions powers separation collection infinite choice hK standard - exact ⟨⟨level, seed, seedRun, initial, _, rfl, domainGround, initialMember, indices, - profiles, rank, stages, transitions, source, f, hf, fFunction, fSelected, fEntries, - g, hg, gFunction, gSelected, gEntries, p, hp, trace, unique⟩⟩ - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainConditionalTotality +import OAI.SetTheory.PartitionPrinciple.Transfinite.MainPrefixSelectedTraceLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundMainOrdinalConstruction + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, + ∃ seed : GroundInitialMainSeedData M K C, + ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), + ∃ initial : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation + {i : Fin 2 // run.key i ∈ natSetCode 1}, + let B := level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) + B ∈ M.sets ∧ initial.code ∈ B ∧ initial.indices = natSetCode 1 ∧ + initial.PreservesOldProfiles ∧ initial.code ∈ M.sets ∧ + ZFSet.rank initial.code < ZFSet.rank K ∧ + initial.stageGraph = graphRestriction (natSetCode 1) run.stageGraph ∧ + initial.transitionGraph = graphRestriction (chronologyPairs (natSetCode 1)) run.transitionGraph ∧ + (∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = seed.source) ∧ + ∃ f ∈ M.sets, + ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode)) + (ZFSet.prod level.carrier level.carrier) f ∧ + f ⊆ M.taskBearingSuccessorRelation + (M.linkedMainStageCandidates level.carrier K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode)) + level.carrier K C C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ + (∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + target ∈ M.linkedMainStageCandidates level.carrier K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ∧ + z ∈ level.carrier ∧ TaskBearingMainSuccessorCode M K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) + ZFSet.omega source target z) ∧ + ∃ g ∈ M.sets, ZFSet.IsFunc B B g ∧ + g ⊆ M.mainPrefixConditionalRelation B K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ZFSet.omega f ∧ + (∀ old next, ZFSet.pair old next ∈ g → next ∈ B ∧ + MainPrefixConditionalStepCode M K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) + ZFSet.omega f old next) ∧ + ∃ p ∈ M.sets, + OrdinalRecursionTrace (MainPrefixTraceStepCode B initial.code g) C p ∧ + ∀ q, OrdinalRecursionTrace (MainPrefixTraceStepCode B initial.code g) C q → q = p := by + dsimp only + obtain ⟨level, seed, run, initial, domainGround, initialMember, initialIndices, + profiles, initialGround, initialRank, stageRestriction, transitionRestriction, source⟩ := + M.exists_initialRecursionSeed pairing unions powers separation collection infinite choice hK standard + have columnsGround := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + obtain ⟨f, hf, fFunction, fSelected, fEntries⟩ := + M.exists_groundOmegaOneTaskBearingSuccessorFunction pairing unions powers separation collection infinite choice + hK standard seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground + seed.injection_ground seed.dense (fun x hx => (seed.no_endpoints x hx).2) seed.injection_code level + obtain ⟨g, hg, gFunction, gSelected, gEntries⟩ := + level.exists_groundConditionalPrefixFunction pairing unions powers separation collection infinite choice + hK standard columnsGround seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground + rfl hf fFunction fSelected + let B := level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) + (M.groundOmegaOne pairing unions powers separation collection infinite) + (M.groundOmegaOne pairing unions powers separation collection infinite) + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) + have seedIndex : MainPrefixAtIndex (insert ∅ ∅) initial.code := by + refine ⟨initial.stageGraph, initial.transitionGraph, ?_⟩ + change mainPrefixCode initial.indices initial.stageGraph initial.transitionGraph = _ + rw [initialIndices] + rfl + have advance : ∀ old next T, ZFSet.pair old next ∈ g → MainPrefixAtIndex T old → + MainPrefixAtIndex (insert T T) next ∧ MainPrefixExtends old next := by + intro old next T entry index + obtain ⟨S, E, oldCode⟩ := index + have branch := (gEntries old next entry).2 + exact ⟨branch.next_fields oldCode, branch.extension⟩ + obtain ⟨p, hp, trace, unique⟩ := M.exists_unique_selectedMainPrefixTrace + pairing unions powers separation collection infinite hK standard level + (B := B) rfl domainGround initialMember seedIndex hg gFunction advance + exact ⟨level, seed, run, initial, domainGround, initialMember, initialIndices, + profiles, initialGround, initialRank, stageRestriction, transitionRestriction, source, + f, hf, fFunction, fSelected, fEntries, g, hg, gFunction, gSelected, gEntries, p, hp, trace, unique⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +structure GroundMainOrdinalConstructionData (M : TransitiveGround.{u}) (K C : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) where + level : GroundMainCandidateLevel M K + seed : GroundInitialMainSeedData M K C + seedRun : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2) + initial : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation + {i : Fin 2 // seedRun.key i ∈ natSetCode 1} + domain : ZFSet.{u} + domain_eq : domain = level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) + domain_ground : domain ∈ M.sets + initial_member : initial.code ∈ domain + initial_indices : initial.indices = natSetCode 1 + initial_profiles : initial.PreservesOldProfiles + initial_rank : ZFSet.rank initial.code < ZFSet.rank K + initial_stages : initial.stageGraph = graphRestriction (natSetCode 1) seedRun.stageGraph + initial_transitions : initial.transitionGraph = + graphRestriction (chronologyPairs (natSetCode 1)) seedRun.transitionGraph + initial_source : ∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = seed.source + successors : ZFSet.{u} + successors_ground : successors ∈ M.sets + successors_function : ZFSet.IsFunc + (M.linkedMainStageCandidates level.carrier K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode)) (ZFSet.prod level.carrier level.carrier) successors + successors_selected : successors ⊆ M.taskBearingSuccessorRelation + (M.linkedMainStageCandidates level.carrier K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode)) level.carrier K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) + successors_entries : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ successors → + target ∈ M.linkedMainStageCandidates level.carrier K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ z ∈ level.carrier ∧ + TaskBearingMainSuccessorCode M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ZFSet.omega source target z + steps : ZFSet.{u} + steps_ground : steps ∈ M.sets + steps_function : ZFSet.IsFunc domain domain steps + steps_selected : steps ⊆ M.mainPrefixConditionalRelation domain K C C + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) ZFSet.omega successors + steps_entries : ∀ old next, ZFSet.pair old next ∈ steps → next ∈ domain ∧ + MainPrefixConditionalStepCode M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ZFSet.omega successors old next + history : ZFSet.{u} + history_ground : history ∈ M.sets + trace : OrdinalRecursionTrace (MainPrefixTraceStepCode domain initial.code steps) C history + trace_unique : ∀ q, OrdinalRecursionTrace (MainPrefixTraceStepCode domain initial.code steps) C q → + q = history + +theorem TransitiveGround.exists_groundMainOrdinalData (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + Nonempty (GroundMainOrdinalConstructionData M K + (M.groundOmegaOne pairing unions powers separation collection infinite) + pairing unions powers separation) := by + obtain ⟨level, seed, seedRun, initial, domainGround, initialMember, indices, profiles, + _, rank, stages, transitions, source, f, hf, fFunction, fSelected, fEntries, + g, hg, gFunction, gSelected, gEntries, p, hp, trace, unique⟩ := + M.exists_groundMainOrdinalConstruction pairing unions powers separation collection infinite choice hK standard + exact ⟨⟨level, seed, seedRun, initial, _, rfl, domainGround, initialMember, indices, + profiles, rank, stages, transitions, source, f, hf, fFunction, fSelected, fEntries, + g, hg, gFunction, gSelected, gEntries, p, hp, trace, unique⟩⟩ + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConePreservation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConePreservation.lean index ae467424639c3710c1a5a08d52d1ed1f8ac25fa7..76df6365e046896012ec5a03b72fb8177447a04e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConePreservation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConePreservation.lean @@ -1,732 +1,732 @@ -import Mathlib.Logic.Equiv.Option -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairedCompositionRows -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainDiagramAppend -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFieldFamilies - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -instance withTopSmall : Small.{u} (WithTop I) := - small_map (Equiv.optionEquivSumPUnit I) -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def appendKey : WithTop I → ZFSet.{u} - | none => run.indices - | some i => run.key i - -theorem appendKey_injective : Function.Injective run.appendKey := by - intro i j equal - cases i with - | top => - cases j with - | top => rfl - | coe j => - have h := ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨j, rfl⟩ : run.key j ∈ run.indices) - change run.indices = run.key j at equal - exact False.elim ((ne_of_lt h) (congrArg ZFSet.rank equal).symm) - | coe i => - cases j with - | top => - have h := ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨i, rfl⟩ : run.key i ∈ run.indices) - exact False.elim ((ne_of_lt h) (congrArg ZFSet.rank equal)) - | coe j => exact congrArg (fun k : I => (k : WithTop I)) (run.key_injective equal) - -theorem appendKey_order (i j : WithTop I) : - i ≤ j ↔ run.appendKey i = run.appendKey j ∨ run.appendKey i ∈ run.appendKey j := by - cases i with - | top => - cases j with - | top => exact iff_of_true le_rfl (Or.inl rfl) - | coe j => - have lower := ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨j, rfl⟩ : run.key j ∈ run.indices) - constructor - · exact fun h => False.elim (WithTop.not_top_le_coe j h) - · rintro (equal | member) - · exact False.elim ((ne_of_lt lower) (congrArg ZFSet.rank equal).symm) - · exact False.elim (lt_asymm lower (ZFSet.rank_lt_of_mem member)) - | coe i => - cases j with - | top => exact iff_of_true le_top (Or.inr (ZFSet.mem_range.2 ⟨i, rfl⟩)) - | coe j => exact WithTop.coe_le_coe.trans (run.key_order i j) - -theorem appendKey_range : ZFSet.range run.appendKey = insert run.indices run.indices := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_range, ZFSet.mem_insert_iff] - constructor - · rintro ⟨i, rfl⟩ - cases i with - | top => exact Or.inl rfl - | coe i => exact Or.inr (ZFSet.mem_range.2 ⟨i, rfl⟩) - · rintro (rfl | hz) - · exact ⟨⊤, rfl⟩ - · obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hz - exact ⟨(i : WithTop I), rfl⟩ - -theorem indices_of_greatest (last : I) (greatest : ∀ i, i ≤ last) : - run.indices = insert (run.key last) (run.key last) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_insert_iff] - constructor - · intro hz - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hz - exact (run.key_order i last).1 (greatest i) - · rintro (rfl | hz) - · exact ZFSet.mem_range.2 ⟨last, rfl⟩ - · exact run.indices_ordinal.1 _ (ZFSet.mem_range.2 ⟨last, rfl⟩) z hz - -def appendLinked (target : GroundLinkedMainStage M K Labels C D rD) : - WithTop I → GroundLinkedMainStage M K Labels C D rD - | none => target - | some i => run.linked i - -theorem appendStageGraph_eq (target : GroundLinkedMainStage M K Labels C D rD) : - familyCodeGraph run.appendKey (fun i => (run.appendLinked target i).code) = - insert (ZFSet.pair run.indices target.code) run.stageGraph := by - apply ZFSet.ext - intro z - rw [mem_familyCodeGraph, ZFSet.mem_insert_iff] - constructor - · rintro ⟨i, rfl⟩ - cases i with - | top => exact Or.inl rfl - | coe i => exact Or.inr ((mem_familyCodeGraph _ _ _).2 ⟨i, rfl⟩) - · rintro (rfl | hz) - · exact ⟨⊤, rfl⟩ - · obtain ⟨i, rfl⟩ := (mem_familyCodeGraph _ _ _).1 hz - exact ⟨(i : WithTop I), rfl⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing -open SetFormula -universe u v - -theorem relationCompose_uniformSource_eq {A B C R f g : ZFSet.{u}} - (member : f ∈ R) (shape : f ⊆ ZFSet.prod A B) : - relationCompose (⋃₀ ⋃₀ ⋃₀ R) B C f g = relationCompose A B C f g := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, _, y, hy, w, hw, rfl, xy, yw⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨(ZFSet.pair_mem_prod.1 (shape xy)).1, hw, y, hy, xy, yw⟩ - · intro hz - obtain ⟨x, _, y, hy, w, hw, rfl, xy, yw⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨pair_first_mem_doubleUnion (ZFSet.mem_sUnion.2 ⟨f, member, xy⟩), hw, y, hy, xy, yw⟩ - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_appendRow (last : I) (greatest : ∀ i, i ≤ last) - (target : GroundLinkedMainStage M K Labels C D rD) - (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) : - ∃ row ∈ M.sets, FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row ∧ - ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code := by - let V := ⋃₀ ⋃₀ run.transitionGraph - let F := indexedRelationSection run.indices V run.transitionGraph (run.key last) - have hV : V ∈ M.sets := M.union_mem unions (M.union_mem unions run.transitions_ground) - have hLast := M.transitive run.indices_ground (ZFSet.mem_range.2 ⟨last, rfl⟩) - have hF : F ∈ M.sets := M.indexedRelationSection_mem pairing unions powers separation - run.indices_ground hV run.transitions_ground hLast - have oldEntry (i : I) : ZFSet.pair (run.key i) (run.diagram.transition (greatest i)).map.code ∈ F := by - have old := (run.transitionGraph_entry (greatest i) _).2 rfl - exact (pair_mem_indexedRelationSection _ _ _ _ _ _).2 - ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, pair_second_mem_doubleUnion old, old⟩ - have oldUnique (i : I) (z : ZFSet.{u}) (entry : ZFSet.pair (run.key i) z ∈ F) : - z = (run.diagram.transition (greatest i)).map.code := - (run.transitionGraph_entry (greatest i) z).1 - ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 entry).2.2 - let R := ⋃₀ ⋃₀ ⋃₀ ⋃₀ F - have hR : R ∈ M.sets := M.union_mem unions (M.union_mem unions - (M.union_mem unions (M.union_mem unions hF))) - have mapBounds (i : I) : (run.diagram.transition (greatest i)).map.points ∈ R ∧ - (run.diagram.transition (greatest i)).map.actors ∈ R := - ⟨pair_first_mem_doubleUnion (pair_second_mem_doubleUnion (oldEntry i)), - pair_second_mem_doubleUnion (pair_second_mem_doubleUnion (oldEntry i))⟩ - have function : ZFSet.IsFunc run.indices (ZFSet.prod R R) F := by - refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨i, hi, value, _, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hi - have equal := (run.transitionGraph_entry (greatest i) value).1 entry - rw [equal] - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, - ZFSet.pair_mem_prod.2 (mapBounds i)⟩ - · intro x hx - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx - exact ⟨_, oldEntry i, oldUnique i⟩ - obtain ⟨row, ground, func, entries⟩ := M.exists_pairedCompositionRow pairing unions powers separation - run.indices_ground run.indices_ground hR - (M.union_mem unions (M.union_mem unions (M.union_mem unions hR))) - (run.diagram.stage last).stage.carrier_ground target.main.stage.carrier_ground - (run.diagram.stage last).stage.actors_ground target.main.stage.actors_ground - hF step.map.points_ground step.map.actors_ground function - refine ⟨row, ground, func, ?_⟩ - intro i z - have entry := entries (run.key i) _ _ z (oldEntry i) - rw [relationCompose_uniformSource_eq (mapBounds i).1 - (run.diagram.transition (greatest i)).map.point_embedding.injection.function.1, - relationCompose_uniformSource_eq (mapBounds i).2 - (run.diagram.transition (greatest i)).map.group_embedding.injection.function.1] at entry - exact entry - -end GroundMainPrefix - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable {S : ZFSet.{u}} (subset : S ⊆ run.indices) -include subset - -theorem restrictedKey_range : - ZFSet.range (fun i : {i // run.key i ∈ S} => run.key i.val) = S := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_range] - constructor - · rintro ⟨i, rfl⟩ - exact i.property - · intro hz - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 (subset hz) - exact ⟨⟨i, hz⟩, rfl⟩ - -theorem restrictedStageGraph_eq : - familyCodeGraph (fun i : {i // run.key i ∈ S} => run.key i.val) - (fun i => (run.linked i.val).code) = graphRestriction S run.stageGraph := by - have equal := familyCodeGraph_restrict run.key (fun i => (run.linked i).code) - run.key_injective (fun i => run.key i ∈ S) - rw [run.restrictedKey_range subset] at equal - exact equal.symm - -theorem restrictedTransitionGraph_eq : - familyCodeGraph (mainTransitionIndexKey (fun i : {i // run.key i ∈ S} => run.key i.val)) - (fun p => (run.diagram.transition (show p.val.1.val ≤ p.val.2.val from p.property)).map.code) = - graphRestriction (chronologyPairs S) run.transitionGraph := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨p, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz - exact pair_mem_graphRestriction.2 - ⟨(run.transitionGraph_entry p.property _).2 rfl, - (pair_mem_chronologyPairs S _ _).2 - ⟨p.val.2.property, p.val.1.property, (run.key_order _ _).1 p.property⟩⟩ - · intro hz - obtain ⟨q, hq, value, rfl, entry⟩ := mem_graphRestriction.1 hz - obtain ⟨target, ht, source, hs, rfl, before⟩ := (mem_chronologyPairs S q).1 hq - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 (subset ht) - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 (subset hs) - have ordered := (run.key_order i j).2 before - have equal := (run.transitionGraph_entry ordered value).1 entry - exact (mem_familyCodeGraph _ _ _).2 - ⟨⟨(⟨i, hs⟩, ⟨j, ht⟩), ordered⟩, - congrArg (ZFSet.pair (ZFSet.pair (run.key j) (run.key i))) equal.symm⟩ - -noncomputable def restrict (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : - GroundMainPrefix M K Labels C D rD pairing unions powers separation {i // run.key i ∈ S} where - key i := run.key i.val - key_injective := fun _ _ equal => Subtype.ext (run.key_injective equal) - key_order i j := run.key_order i.val j.val - indices_ground := (run.restrictedKey_range subset).symm ▸ ground - indices_ordinal := (run.restrictedKey_range subset).symm ▸ ordinal - diagram := run.diagram.reindex Subtype.val (fun _ _ before => before) - linked i := run.linked i.val - linked_main i := run.linked_main i.val - coverage := fun before => run.coverage before - stages_ground := (run.restrictedStageGraph_eq subset).symm ▸ - M.graphRestriction_mem unions separation ground run.stages_ground - transitions_ground := (run.restrictedTransitionGraph_eq subset).symm ▸ - M.graphRestriction_mem unions separation - (M.chronologyPairs_mem pairing unions powers separation ground) run.transitions_ground - -theorem restrict_indices (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : - (run.restrict subset ground ordinal).indices = S := run.restrictedKey_range subset - -theorem restrict_stageGraph (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : - (run.restrict subset ground ordinal).stageGraph = graphRestriction S run.stageGraph := - run.restrictedStageGraph_eq subset - -theorem restrict_transitionGraph (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : - (run.restrict subset ground ordinal).transitionGraph = - graphRestriction (chronologyPairs S) run.transitionGraph := run.restrictedTransitionGraph_eq subset - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (target : GroundLinkedMainStage M K Labels C D rD) (cone : run.diagram.Cone target.main) - -noncomputable def appendTransitionGraph : ZFSet.{u} := - familyCodeGraph (mainTransitionIndexKey run.appendKey) - (fun p => (cone.append.transition p.property).map.code) - -theorem appendTransitionGraph_eq {row : ZFSet.{u}} - (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) - (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) : - run.appendTransitionGraph target cone = - insert (ZFSet.pair (ZFSet.pair run.indices run.indices) - (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code) - (run.transitionGraph ∪ row) := by - apply ZFSet.ext - intro z - rw [appendTransitionGraph, mem_familyCodeGraph, ZFSet.mem_insert_iff, ZFSet.mem_union] - constructor - · rintro ⟨⟨⟨i, j⟩, before⟩, rfl⟩ - cases i with - | top => - cases j with - | top => exact Or.inl rfl - | coe j => exact False.elim (WithTop.not_top_le_coe j before) - | coe i => - cases j with - | top => exact Or.inr (Or.inr ((entries i _).2 rfl)) - | coe j => exact Or.inr (Or.inl ((run.transitionGraph_entry (WithTop.coe_le_coe.mp before) _).2 rfl)) - · rintro (rfl | old | fresh) - · exact ⟨⟨(⊤, ⊤), le_rfl⟩, rfl⟩ - · obtain ⟨⟨⟨i, j⟩, before⟩, rfl⟩ := (mem_familyCodeGraph _ _ _).1 old - exact ⟨⟨((i : WithTop I), (j : WithTop I)), WithTop.coe_le_coe.mpr before⟩, rfl⟩ - · obtain ⟨key, keyMember, value, rfl⟩ := function.shape _ fresh - obtain ⟨a, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 keyMember - have equal := ZFSet.mem_singleton.1 ha - subst a - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx - have valueEq := (entries i value).1 fresh - exact ⟨⟨((i : WithTop I), ⊤), le_top⟩, - congrArg (ZFSet.pair (ZFSet.pair run.indices (run.key i))) valueEq.symm⟩ - -noncomputable def appendCone {row : ZFSet.{u}} (ground : row ∈ M.sets) - (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) - (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) - (covered : cone.append.CoversOldBirths) : - GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I) where - key := run.appendKey - key_injective := run.appendKey_injective - key_order := run.appendKey_order - indices_ground := run.appendKey_range.symm ▸ M.insert_mem pairing unions run.indices_ground run.indices_ground - indices_ordinal := run.appendKey_range.symm ▸ ordinalSetProperty_succ run.indices_ordinal - diagram := cone.append - linked := run.appendLinked target - linked_main := by - intro i - cases i with - | top => rfl - | coe i => exact run.linked_main i - coverage := covered - stages_ground := (run.appendStageGraph_eq target).symm ▸ - M.insert_mem pairing unions (M.orderedPair_mem pairing run.indices_ground (target.code_ground pairing)) run.stages_ground - transitions_ground := by - change run.appendTransitionGraph target cone ∈ M.sets - rw [run.appendTransitionGraph_eq target cone function entries] - exact M.insert_mem pairing unions (M.orderedPair_mem pairing - (M.orderedPair_mem pairing run.indices_ground run.indices_ground) - ((GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code_mem pairing)) - (M.binary_union_mem pairing unions run.transitions_ground ground) - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem restrict_code_rank_lt {S : ZFSet.{u}} (subset : S ⊆ run.indices) - (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (oldRank : ZFSet.rank run.code < o) : - ZFSet.rank (run.restrict subset ground ordinal).code < o := by - have indices : ZFSet.rank (run.restrict subset ground ordinal).indices < o := by - rw [run.restrict_indices subset ground ordinal] - exact (ZFSet.rank_mono subset).trans_lt (run.indices_rank_le_code.trans_lt oldRank) - have stages : ZFSet.rank (run.restrict subset ground ordinal).stageGraph < o := by - rw [run.restrict_stageGraph subset ground ordinal] - exact (ZFSet.rank_mono (graphRestriction_subset S run.stageGraph)).trans_lt - (run.stageGraph_rank_le_code.trans_lt oldRank) - have transitions : ZFSet.rank (run.restrict subset ground ordinal).transitionGraph < o := by - rw [run.restrict_transitionGraph subset ground ordinal] - exact (ZFSet.rank_mono (graphRestriction_subset (chronologyPairs S) run.transitionGraph)).trans_lt - (run.transitionGraph_rank_le_code.trans_lt oldRank) - exact rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases indices (Fin.cases stages (fun _ => transitions))) - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (last : I) (greatest : ∀ i, i ≤ last) -variable (target : GroundLinkedMainStage M K Labels C D rD) -variable (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) -variable (covered : step.CoversOldBirths) - -noncomputable def appendLast : - GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I) := by - let witnesses := run.exists_appendRow last greatest target step - let row := Classical.choose witnesses - have spec := Classical.choose_spec witnesses - exact run.appendCone target (run.diagram.coneOfLast last greatest step) spec.1 spec.2.1 spec.2.2 - (run.diagram.coneOfLast_coverage last greatest step run.coverage covered) - -theorem appendLast_indices : - (run.appendLast last greatest target step covered).indices = insert run.indices run.indices := - run.appendKey_range - -theorem appendLast_linked_old (i : I) : - (run.appendLast last greatest target step covered).linked (i : WithTop I) = run.linked i := rfl - -theorem appendLast_linked_top : - (run.appendLast last greatest target step covered).linked ⊤ = target := rfl - -theorem appendLast_transition_old {i j : I} (before : i ≤ j) : - (run.appendLast last greatest target step covered).diagram.transition (WithTop.coe_le_coe.mpr before) = - run.diagram.transition before := rfl - -theorem appendLast_transition_to_top (i : I) : - (run.appendLast last greatest target step covered).diagram.transition - (show (i : WithTop I) ≤ ⊤ from le_top) = - (run.diagram.transition (greatest i)).comp pairing unions powers separation step := rfl - -theorem appendLast_transition_last : - (run.appendLast last greatest target step covered).diagram.transition - (show (last : WithTop I) ≤ ⊤ from le_top) = step := by - rw [run.appendLast_transition_to_top last greatest target step covered last, - run.diagram.self, GroundChronologicalMainTransition.identity_comp] - -theorem appendLast_stageGraph : - (run.appendLast last greatest target step covered).stageGraph = - insert (ZFSet.pair run.indices target.code) run.stageGraph := - run.appendStageGraph_eq target - -theorem appendLast_row : - ∃ row ∈ M.sets, FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row ∧ - (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code) ∧ - (run.appendLast last greatest target step covered).transitionGraph = - insert (ZFSet.pair (ZFSet.pair run.indices run.indices) - (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code) - (run.transitionGraph ∪ row) := by - let witnesses := run.exists_appendRow last greatest target step - have spec := Classical.choose_spec witnesses - refine ⟨Classical.choose witnesses, spec.1, spec.2.1, spec.2.2, ?_⟩ - exact run.appendTransitionGraph_eq target (run.diagram.coneOfLast last greatest step) spec.2.1 spec.2.2 - -theorem appendLast_stageGraph_restrict : - graphRestriction run.indices (run.appendLast last greatest target step covered).stageGraph = run.stageGraph := by - rw [run.appendLast_stageGraph last greatest target step covered] - rw [graphRestriction_insert_of_not_mem - (fun h => (lt_irrefl _ (ZFSet.rank_lt_of_mem h)) : run.indices ∉ run.indices)] - exact run.stageGraph_function.restriction_eq - -theorem appendLast_transitionGraph_restrict : - graphRestriction (chronologyPairs run.indices) - (run.appendLast last greatest target step covered).transitionGraph = run.transitionGraph := by - let extended := run.appendLast last greatest target step covered - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨key, keyMember, value, rfl, entry⟩ := mem_graphRestriction.1 hz - obtain ⟨j, hj, i, hi, rfl, before⟩ := (mem_chronologyPairs run.indices key).1 keyMember - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hj - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hi - have ordered := (run.key_order i j).2 before - have equal := (extended.transitionGraph_entry (WithTop.coe_le_coe.mpr ordered) value).1 entry - exact (run.transitionGraph_entry ordered value).2 equal - · intro hz - obtain ⟨⟨⟨i, j⟩, before⟩, rfl⟩ := (mem_familyCodeGraph _ _ _).1 hz - exact pair_mem_graphRestriction.2 - ⟨(extended.transitionGraph_entry (WithTop.coe_le_coe.mpr before) _).2 rfl, - (pair_mem_chronologyPairs _ _ _).2 ⟨ZFSet.mem_range.2 ⟨j, rfl⟩, - ZFSet.mem_range.2 ⟨i, rfl⟩, (run.key_order i j).1 before⟩⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u v - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} - -theorem field_rank_le_linkedCode (target : GroundLinkedMainStage M K Labels C D rD) (j : Fin 11) : - ZFSet.rank (target.main.stage.field j) ≤ ZFSet.rank target.code := by - have stageBound : ZFSet.rank target.main.stage.code ≤ ZFSet.rank target.code := by - simpa only [code, linkedMainStageCode, Fin.cases_zero] using - (rank_nonemptyTupleCode_field_le 2 (Fin.cases target.main.stage.code - (Fin.cases target.main.cutoff (fun _ => target.serial.code))) 0) - exact (rank_nonemptyTupleCode_field_le 10 target.main.stage.field j).trans stageBound - -end GroundLinkedMainStage - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def appendSourceBound : ZFSet.{u} := by - let V : ZFSet.{u} := ⋃₀ ⋃₀ run.transitionGraph - let R : ZFSet.{u} := ⋃₀ ⋃₀ V - exact ⋃₀ ⋃₀ ⋃₀ R - -theorem appendSourceBound_rank_le : ZFSet.rank run.appendSourceBound ≤ ZFSet.rank run.code := - ((ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans - ((ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans - ((ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans - (ZFSet.rank_sUnion_le _))))))).trans run.transitionGraph_rank_le_code - -variable (last : I) (greatest : ∀ i, i ≤ last) -variable (target : GroundLinkedMainStage M K Labels C D rD) -variable (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) - -theorem appendRow_subset {row : ZFSet.{u}} - (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) - (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code) : - row ⊆ ZFSet.prod (ZFSet.prod {run.indices} run.indices) - (ZFSet.prod (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.carrier)) - (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.actors))) := by - have pointBound (i : I) : - ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.points ⊆ - ZFSet.prod run.appendSourceBound target.main.stage.carrier := by - intro z hz - obtain ⟨x, _, y, _, w, hw, rfl, xy, _⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz - have old := (run.transitionGraph_entry (greatest i) _).2 rfl - have mapMem := pair_first_mem_doubleUnion (pair_second_mem_doubleUnion old) - exact ZFSet.pair_mem_prod.2 - ⟨pair_first_mem_doubleUnion (ZFSet.mem_sUnion.2 ⟨_, mapMem, xy⟩), hw⟩ - have actorBound (i : I) : - ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.actors ⊆ - ZFSet.prod run.appendSourceBound target.main.stage.actors := by - intro z hz - obtain ⟨x, _, y, _, w, hw, rfl, xy, _⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz - have old := (run.transitionGraph_entry (greatest i) _).2 rfl - have mapMem := pair_second_mem_doubleUnion (pair_second_mem_doubleUnion old) - exact ZFSet.pair_mem_prod.2 - ⟨pair_first_mem_doubleUnion (ZFSet.mem_sUnion.2 ⟨_, mapMem, xy⟩), hw⟩ - intro z hz - obtain ⟨key, keyMember, value, rfl⟩ := function.shape _ hz - obtain ⟨a, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 keyMember - have equal := ZFSet.mem_singleton.1 ha - subst a - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx - have valueEq := (entries i value).1 hz - rw [valueEq] - exact ZFSet.pair_mem_prod.2 - ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, ZFSet.mem_range.2 ⟨i, rfl⟩⟩, - ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_powerset.2 (pointBound i), ZFSet.mem_powerset.2 (actorBound i)⟩⟩ - -theorem appendRow_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (oldRank : ZFSet.rank run.code < o) (targetRank : ZFSet.rank target.code < o) - {row : ZFSet.{u}} (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) - (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code) : - ZFSet.rank row < o := by - have indexRank := run.indices_rank_le_code.trans_lt oldRank - have sourceRank := run.appendSourceBound_rank_le.trans_lt oldRank - have pointRank : ZFSet.rank target.main.stage.carrier < o := - (target.field_rank_le_linkedCode 0).trans_lt targetRank - have actorRank : ZFSet.rank target.main.stage.actors < o := - (target.field_rank_le_linkedCode 3).trans_lt targetRank - have points : ZFSet.rank (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.carrier)) < o := by - rw [ZFSet.rank_powerset] - exact limit.succ_lt (rank_product_lt limit sourceRank pointRank) - have actors : ZFSet.rank (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.actors)) < o := by - rw [ZFSet.rank_powerset] - exact limit.succ_lt (rank_product_lt limit sourceRank actorRank) - exact (ZFSet.rank_mono (run.appendRow_subset last greatest target step function entries)).trans_lt - (rank_product_lt limit (rank_product_lt limit (rank_singleton_lt limit indexRank) indexRank) - (rank_product_lt limit points actors)) - -theorem appendLast_code_rank_lt (covered : step.CoversOldBirths) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (oldRank : ZFSet.rank run.code < o) (targetRank : ZFSet.rank target.code < o) : - ZFSet.rank (run.appendLast last greatest target step covered).code < o := by - let extended := run.appendLast last greatest target step covered - have indexRank := run.indices_rank_le_code.trans_lt oldRank - have newIndices : ZFSet.rank extended.indices < o := by - rw [run.appendLast_indices last greatest target step covered, ZFSet.rank_insert] - exact max_lt (limit.succ_lt indexRank) indexRank - have newStages : ZFSet.rank extended.stageGraph < o := by - rw [run.appendLast_stageGraph last greatest target step covered, ZFSet.rank_insert] - exact max_lt (limit.succ_lt (rank_orderedPair_lt limit indexRank targetRank)) - (run.stageGraph_rank_le_code.trans_lt oldRank) - have newTransitions : ZFSet.rank extended.transitionGraph < o := by - obtain ⟨row, _, function, entries, equal⟩ := run.appendLast_row last greatest target step covered - rw [equal, ZFSet.rank_insert, ZFSet.rank_union] - have pointRank : ZFSet.rank target.main.stage.carrier < o := - (target.field_rank_le_linkedCode 0).trans_lt targetRank - have actorRank : ZFSet.rank target.main.stage.actors < o := - (target.field_rank_le_linkedCode 3).trans_lt targetRank - have identityRank := (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code_rank_lt - limit pointRank pointRank actorRank actorRank - exact max_lt (limit.succ_lt (rank_orderedPair_lt limit (rank_orderedPair_lt limit indexRank indexRank) identityRank)) - (max_lt (run.transitionGraph_rank_le_code.trans_lt oldRank) - (run.appendRow_rank_lt last greatest target step limit oldRank targetRank function entries)) - exact rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases newIndices (Fin.cases newStages (fun _ => newTransitions))) - -end GroundMainPrefix -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (target : GroundLinkedMainStage M K Labels C D rD) (cone : run.diagram.Cone target.main) -variable {row : ZFSet.{u}} (ground : row ∈ M.sets) -variable (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) -variable (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) -variable (covered : cone.append.CoversOldBirths) - -theorem appendCone_indices : - (run.appendCone target cone ground function entries covered).indices = insert run.indices run.indices := - run.appendKey_range - -theorem appendCone_stage_old (i : I) : - (run.appendCone target cone ground function entries covered).diagram.stage (i : WithTop I) = - run.diagram.stage i := rfl - -theorem appendCone_stage_top : - (run.appendCone target cone ground function entries covered).diagram.stage ⊤ = target.main := rfl - -theorem appendCone_linked_old (i : I) : - (run.appendCone target cone ground function entries covered).linked (i : WithTop I) = run.linked i := rfl - -theorem appendCone_linked_top : - (run.appendCone target cone ground function entries covered).linked ⊤ = target := rfl - -theorem appendCone_transition_old {i j : I} (before : i ≤ j) : - (run.appendCone target cone ground function entries covered).diagram.transition - (WithTop.coe_le_coe.mpr before) = run.diagram.transition before := rfl - -theorem appendCone_transition_to_top (i : I) : - (run.appendCone target cone ground function entries covered).diagram.transition - (show (i : WithTop I) ≤ ⊤ from le_top) = cone.leg i := rfl - -theorem appendCone_transition_top : - (run.appendCone target cone ground function entries covered).diagram.transition - (show (⊤ : WithTop I) ≤ ⊤ from le_rfl) = - GroundChronologicalMainTransition.identity pairing unions powers separation target.main := rfl - -theorem appendCone_stageGraph : - (run.appendCone target cone ground function entries covered).stageGraph = - insert (ZFSet.pair run.indices target.code) run.stageGraph := - run.appendStageGraph_eq target - -theorem appendCone_transitionGraph : - (run.appendCone target cone ground function entries covered).transitionGraph = - insert (ZFSet.pair (ZFSet.pair run.indices run.indices) - (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code) - (run.transitionGraph ∪ row) := - run.appendTransitionGraph_eq target cone function entries - -theorem appendCone_stageGraph_restrict : - graphRestriction run.indices (run.appendCone target cone ground function entries covered).stageGraph = - run.stageGraph := by - rw [run.appendCone_stageGraph target cone ground function entries covered] - rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl run.indices)] - exact run.stageGraph_function.restriction_eq - -theorem appendCone_transitionGraph_restrict : - graphRestriction (chronologyPairs run.indices) - (run.appendCone target cone ground function entries covered).transitionGraph = run.transitionGraph := by - let extended := run.appendCone target cone ground function entries covered - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨key, keyMember, value, rfl, entry⟩ := mem_graphRestriction.1 hz - obtain ⟨j, hj, i, hi, rfl, before⟩ := (mem_chronologyPairs run.indices key).1 keyMember - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hj - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hi - have ordered := (run.key_order i j).2 before - have equal := (extended.transitionGraph_entry (WithTop.coe_le_coe.mpr ordered) value).1 entry - exact (run.transitionGraph_entry ordered value).2 equal - · intro hz - obtain ⟨⟨⟨i, j⟩, before⟩, rfl⟩ := (mem_familyCodeGraph _ _ _).1 hz - exact pair_mem_graphRestriction.2 - ⟨(extended.transitionGraph_entry (WithTop.coe_le_coe.mpr before) _).2 rfl, - (pair_mem_chronologyPairs _ _ _).2 ⟨ZFSet.mem_range.2 ⟨j, rfl⟩, - ZFSet.mem_range.2 ⟨i, rfl⟩, (run.key_order i j).1 before⟩⟩ - -theorem appendCone_code_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (oldRank : ZFSet.rank run.code < o) (targetRank : ZFSet.rank target.code < o) - (rowRank : ZFSet.rank row < o) : - ZFSet.rank (run.appendCone target cone ground function entries covered).code < o := by - let extended := run.appendCone target cone ground function entries covered - have indexRank := run.indices_rank_le_code.trans_lt oldRank - have newIndices : ZFSet.rank extended.indices < o := by - rw [run.appendCone_indices target cone ground function entries covered, ZFSet.rank_insert] - exact max_lt (limit.succ_lt indexRank) indexRank - have newStages : ZFSet.rank extended.stageGraph < o := by - rw [run.appendCone_stageGraph target cone ground function entries covered, ZFSet.rank_insert] - exact max_lt (limit.succ_lt (rank_orderedPair_lt limit indexRank targetRank)) - (run.stageGraph_rank_le_code.trans_lt oldRank) - have newTransitions : ZFSet.rank extended.transitionGraph < o := by - rw [run.appendCone_transitionGraph target cone ground function entries covered, - ZFSet.rank_insert, ZFSet.rank_union] - have pointRank : ZFSet.rank target.main.stage.carrier < o := - (target.field_rank_le_linkedCode 0).trans_lt targetRank - have actorRank : ZFSet.rank target.main.stage.actors < o := - (target.field_rank_le_linkedCode 3).trans_lt targetRank - have identityRank := (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code_rank_lt - limit pointRank pointRank actorRank actorRank - exact max_lt (limit.succ_lt (rank_orderedPair_lt limit (rank_orderedPair_lt limit indexRank indexRank) identityRank)) - (max_lt (run.transitionGraph_rank_le_code.trans_lt oldRank) rowRank) - exact rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases newIndices (Fin.cases newStages (fun _ => newTransitions))) - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import Mathlib.Logic.Equiv.Option +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairedCompositionRows +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainDiagramAppend +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFieldFamilies + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +instance withTopSmall : Small.{u} (WithTop I) := + small_map (Equiv.optionEquivSumPUnit I) +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def appendKey : WithTop I → ZFSet.{u} + | none => run.indices + | some i => run.key i + +theorem appendKey_injective : Function.Injective run.appendKey := by + intro i j equal + cases i with + | top => + cases j with + | top => rfl + | coe j => + have h := ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨j, rfl⟩ : run.key j ∈ run.indices) + change run.indices = run.key j at equal + exact False.elim ((ne_of_lt h) (congrArg ZFSet.rank equal).symm) + | coe i => + cases j with + | top => + have h := ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨i, rfl⟩ : run.key i ∈ run.indices) + exact False.elim ((ne_of_lt h) (congrArg ZFSet.rank equal)) + | coe j => exact congrArg (fun k : I => (k : WithTop I)) (run.key_injective equal) + +theorem appendKey_order (i j : WithTop I) : + i ≤ j ↔ run.appendKey i = run.appendKey j ∨ run.appendKey i ∈ run.appendKey j := by + cases i with + | top => + cases j with + | top => exact iff_of_true le_rfl (Or.inl rfl) + | coe j => + have lower := ZFSet.rank_lt_of_mem (ZFSet.mem_range.2 ⟨j, rfl⟩ : run.key j ∈ run.indices) + constructor + · exact fun h => False.elim (WithTop.not_top_le_coe j h) + · rintro (equal | member) + · exact False.elim ((ne_of_lt lower) (congrArg ZFSet.rank equal).symm) + · exact False.elim (lt_asymm lower (ZFSet.rank_lt_of_mem member)) + | coe i => + cases j with + | top => exact iff_of_true le_top (Or.inr (ZFSet.mem_range.2 ⟨i, rfl⟩)) + | coe j => exact WithTop.coe_le_coe.trans (run.key_order i j) + +theorem appendKey_range : ZFSet.range run.appendKey = insert run.indices run.indices := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_range, ZFSet.mem_insert_iff] + constructor + · rintro ⟨i, rfl⟩ + cases i with + | top => exact Or.inl rfl + | coe i => exact Or.inr (ZFSet.mem_range.2 ⟨i, rfl⟩) + · rintro (rfl | hz) + · exact ⟨⊤, rfl⟩ + · obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hz + exact ⟨(i : WithTop I), rfl⟩ + +theorem indices_of_greatest (last : I) (greatest : ∀ i, i ≤ last) : + run.indices = insert (run.key last) (run.key last) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_insert_iff] + constructor + · intro hz + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hz + exact (run.key_order i last).1 (greatest i) + · rintro (rfl | hz) + · exact ZFSet.mem_range.2 ⟨last, rfl⟩ + · exact run.indices_ordinal.1 _ (ZFSet.mem_range.2 ⟨last, rfl⟩) z hz + +def appendLinked (target : GroundLinkedMainStage M K Labels C D rD) : + WithTop I → GroundLinkedMainStage M K Labels C D rD + | none => target + | some i => run.linked i + +theorem appendStageGraph_eq (target : GroundLinkedMainStage M K Labels C D rD) : + familyCodeGraph run.appendKey (fun i => (run.appendLinked target i).code) = + insert (ZFSet.pair run.indices target.code) run.stageGraph := by + apply ZFSet.ext + intro z + rw [mem_familyCodeGraph, ZFSet.mem_insert_iff] + constructor + · rintro ⟨i, rfl⟩ + cases i with + | top => exact Or.inl rfl + | coe i => exact Or.inr ((mem_familyCodeGraph _ _ _).2 ⟨i, rfl⟩) + · rintro (rfl | hz) + · exact ⟨⊤, rfl⟩ + · obtain ⟨i, rfl⟩ := (mem_familyCodeGraph _ _ _).1 hz + exact ⟨(i : WithTop I), rfl⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing +open SetFormula +universe u v + +theorem relationCompose_uniformSource_eq {A B C R f g : ZFSet.{u}} + (member : f ∈ R) (shape : f ⊆ ZFSet.prod A B) : + relationCompose (⋃₀ ⋃₀ ⋃₀ R) B C f g = relationCompose A B C f g := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, _, y, hy, w, hw, rfl, xy, yw⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨(ZFSet.pair_mem_prod.1 (shape xy)).1, hw, y, hy, xy, yw⟩ + · intro hz + obtain ⟨x, _, y, hy, w, hw, rfl, xy, yw⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨pair_first_mem_doubleUnion (ZFSet.mem_sUnion.2 ⟨f, member, xy⟩), hw, y, hy, xy, yw⟩ + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_appendRow (last : I) (greatest : ∀ i, i ≤ last) + (target : GroundLinkedMainStage M K Labels C D rD) + (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) : + ∃ row ∈ M.sets, FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row ∧ + ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code := by + let V := ⋃₀ ⋃₀ run.transitionGraph + let F := indexedRelationSection run.indices V run.transitionGraph (run.key last) + have hV : V ∈ M.sets := M.union_mem unions (M.union_mem unions run.transitions_ground) + have hLast := M.transitive run.indices_ground (ZFSet.mem_range.2 ⟨last, rfl⟩) + have hF : F ∈ M.sets := M.indexedRelationSection_mem pairing unions powers separation + run.indices_ground hV run.transitions_ground hLast + have oldEntry (i : I) : ZFSet.pair (run.key i) (run.diagram.transition (greatest i)).map.code ∈ F := by + have old := (run.transitionGraph_entry (greatest i) _).2 rfl + exact (pair_mem_indexedRelationSection _ _ _ _ _ _).2 + ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, pair_second_mem_doubleUnion old, old⟩ + have oldUnique (i : I) (z : ZFSet.{u}) (entry : ZFSet.pair (run.key i) z ∈ F) : + z = (run.diagram.transition (greatest i)).map.code := + (run.transitionGraph_entry (greatest i) z).1 + ((pair_mem_indexedRelationSection _ _ _ _ _ _).1 entry).2.2 + let R := ⋃₀ ⋃₀ ⋃₀ ⋃₀ F + have hR : R ∈ M.sets := M.union_mem unions (M.union_mem unions + (M.union_mem unions (M.union_mem unions hF))) + have mapBounds (i : I) : (run.diagram.transition (greatest i)).map.points ∈ R ∧ + (run.diagram.transition (greatest i)).map.actors ∈ R := + ⟨pair_first_mem_doubleUnion (pair_second_mem_doubleUnion (oldEntry i)), + pair_second_mem_doubleUnion (pair_second_mem_doubleUnion (oldEntry i))⟩ + have function : ZFSet.IsFunc run.indices (ZFSet.prod R R) F := by + refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨i, hi, value, _, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hi + have equal := (run.transitionGraph_entry (greatest i) value).1 entry + rw [equal] + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, + ZFSet.pair_mem_prod.2 (mapBounds i)⟩ + · intro x hx + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx + exact ⟨_, oldEntry i, oldUnique i⟩ + obtain ⟨row, ground, func, entries⟩ := M.exists_pairedCompositionRow pairing unions powers separation + run.indices_ground run.indices_ground hR + (M.union_mem unions (M.union_mem unions (M.union_mem unions hR))) + (run.diagram.stage last).stage.carrier_ground target.main.stage.carrier_ground + (run.diagram.stage last).stage.actors_ground target.main.stage.actors_ground + hF step.map.points_ground step.map.actors_ground function + refine ⟨row, ground, func, ?_⟩ + intro i z + have entry := entries (run.key i) _ _ z (oldEntry i) + rw [relationCompose_uniformSource_eq (mapBounds i).1 + (run.diagram.transition (greatest i)).map.point_embedding.injection.function.1, + relationCompose_uniformSource_eq (mapBounds i).2 + (run.diagram.transition (greatest i)).map.group_embedding.injection.function.1] at entry + exact entry + +end GroundMainPrefix + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable {S : ZFSet.{u}} (subset : S ⊆ run.indices) +include subset + +theorem restrictedKey_range : + ZFSet.range (fun i : {i // run.key i ∈ S} => run.key i.val) = S := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_range] + constructor + · rintro ⟨i, rfl⟩ + exact i.property + · intro hz + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 (subset hz) + exact ⟨⟨i, hz⟩, rfl⟩ + +theorem restrictedStageGraph_eq : + familyCodeGraph (fun i : {i // run.key i ∈ S} => run.key i.val) + (fun i => (run.linked i.val).code) = graphRestriction S run.stageGraph := by + have equal := familyCodeGraph_restrict run.key (fun i => (run.linked i).code) + run.key_injective (fun i => run.key i ∈ S) + rw [run.restrictedKey_range subset] at equal + exact equal.symm + +theorem restrictedTransitionGraph_eq : + familyCodeGraph (mainTransitionIndexKey (fun i : {i // run.key i ∈ S} => run.key i.val)) + (fun p => (run.diagram.transition (show p.val.1.val ≤ p.val.2.val from p.property)).map.code) = + graphRestriction (chronologyPairs S) run.transitionGraph := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨p, rfl⟩ := (mem_familyCodeGraph _ _ z).1 hz + exact pair_mem_graphRestriction.2 + ⟨(run.transitionGraph_entry p.property _).2 rfl, + (pair_mem_chronologyPairs S _ _).2 + ⟨p.val.2.property, p.val.1.property, (run.key_order _ _).1 p.property⟩⟩ + · intro hz + obtain ⟨q, hq, value, rfl, entry⟩ := mem_graphRestriction.1 hz + obtain ⟨target, ht, source, hs, rfl, before⟩ := (mem_chronologyPairs S q).1 hq + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 (subset ht) + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 (subset hs) + have ordered := (run.key_order i j).2 before + have equal := (run.transitionGraph_entry ordered value).1 entry + exact (mem_familyCodeGraph _ _ _).2 + ⟨⟨(⟨i, hs⟩, ⟨j, ht⟩), ordered⟩, + congrArg (ZFSet.pair (ZFSet.pair (run.key j) (run.key i))) equal.symm⟩ + +noncomputable def restrict (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : + GroundMainPrefix M K Labels C D rD pairing unions powers separation {i // run.key i ∈ S} where + key i := run.key i.val + key_injective := fun _ _ equal => Subtype.ext (run.key_injective equal) + key_order i j := run.key_order i.val j.val + indices_ground := (run.restrictedKey_range subset).symm ▸ ground + indices_ordinal := (run.restrictedKey_range subset).symm ▸ ordinal + diagram := run.diagram.reindex Subtype.val (fun _ _ before => before) + linked i := run.linked i.val + linked_main i := run.linked_main i.val + coverage := fun before => run.coverage before + stages_ground := (run.restrictedStageGraph_eq subset).symm ▸ + M.graphRestriction_mem unions separation ground run.stages_ground + transitions_ground := (run.restrictedTransitionGraph_eq subset).symm ▸ + M.graphRestriction_mem unions separation + (M.chronologyPairs_mem pairing unions powers separation ground) run.transitions_ground + +theorem restrict_indices (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : + (run.restrict subset ground ordinal).indices = S := run.restrictedKey_range subset + +theorem restrict_stageGraph (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : + (run.restrict subset ground ordinal).stageGraph = graphRestriction S run.stageGraph := + run.restrictedStageGraph_eq subset + +theorem restrict_transitionGraph (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) : + (run.restrict subset ground ordinal).transitionGraph = + graphRestriction (chronologyPairs S) run.transitionGraph := run.restrictedTransitionGraph_eq subset + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (target : GroundLinkedMainStage M K Labels C D rD) (cone : run.diagram.Cone target.main) + +noncomputable def appendTransitionGraph : ZFSet.{u} := + familyCodeGraph (mainTransitionIndexKey run.appendKey) + (fun p => (cone.append.transition p.property).map.code) + +theorem appendTransitionGraph_eq {row : ZFSet.{u}} + (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) + (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) : + run.appendTransitionGraph target cone = + insert (ZFSet.pair (ZFSet.pair run.indices run.indices) + (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code) + (run.transitionGraph ∪ row) := by + apply ZFSet.ext + intro z + rw [appendTransitionGraph, mem_familyCodeGraph, ZFSet.mem_insert_iff, ZFSet.mem_union] + constructor + · rintro ⟨⟨⟨i, j⟩, before⟩, rfl⟩ + cases i with + | top => + cases j with + | top => exact Or.inl rfl + | coe j => exact False.elim (WithTop.not_top_le_coe j before) + | coe i => + cases j with + | top => exact Or.inr (Or.inr ((entries i _).2 rfl)) + | coe j => exact Or.inr (Or.inl ((run.transitionGraph_entry (WithTop.coe_le_coe.mp before) _).2 rfl)) + · rintro (rfl | old | fresh) + · exact ⟨⟨(⊤, ⊤), le_rfl⟩, rfl⟩ + · obtain ⟨⟨⟨i, j⟩, before⟩, rfl⟩ := (mem_familyCodeGraph _ _ _).1 old + exact ⟨⟨((i : WithTop I), (j : WithTop I)), WithTop.coe_le_coe.mpr before⟩, rfl⟩ + · obtain ⟨key, keyMember, value, rfl⟩ := function.shape _ fresh + obtain ⟨a, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 keyMember + have equal := ZFSet.mem_singleton.1 ha + subst a + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx + have valueEq := (entries i value).1 fresh + exact ⟨⟨((i : WithTop I), ⊤), le_top⟩, + congrArg (ZFSet.pair (ZFSet.pair run.indices (run.key i))) valueEq.symm⟩ + +noncomputable def appendCone {row : ZFSet.{u}} (ground : row ∈ M.sets) + (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) + (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) + (covered : cone.append.CoversOldBirths) : + GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I) where + key := run.appendKey + key_injective := run.appendKey_injective + key_order := run.appendKey_order + indices_ground := run.appendKey_range.symm ▸ M.insert_mem pairing unions run.indices_ground run.indices_ground + indices_ordinal := run.appendKey_range.symm ▸ ordinalSetProperty_succ run.indices_ordinal + diagram := cone.append + linked := run.appendLinked target + linked_main := by + intro i + cases i with + | top => rfl + | coe i => exact run.linked_main i + coverage := covered + stages_ground := (run.appendStageGraph_eq target).symm ▸ + M.insert_mem pairing unions (M.orderedPair_mem pairing run.indices_ground (target.code_ground pairing)) run.stages_ground + transitions_ground := by + change run.appendTransitionGraph target cone ∈ M.sets + rw [run.appendTransitionGraph_eq target cone function entries] + exact M.insert_mem pairing unions (M.orderedPair_mem pairing + (M.orderedPair_mem pairing run.indices_ground run.indices_ground) + ((GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code_mem pairing)) + (M.binary_union_mem pairing unions run.transitions_ground ground) + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem restrict_code_rank_lt {S : ZFSet.{u}} (subset : S ⊆ run.indices) + (ground : S ∈ M.sets) (ordinal : ordinalSetProperty S) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (oldRank : ZFSet.rank run.code < o) : + ZFSet.rank (run.restrict subset ground ordinal).code < o := by + have indices : ZFSet.rank (run.restrict subset ground ordinal).indices < o := by + rw [run.restrict_indices subset ground ordinal] + exact (ZFSet.rank_mono subset).trans_lt (run.indices_rank_le_code.trans_lt oldRank) + have stages : ZFSet.rank (run.restrict subset ground ordinal).stageGraph < o := by + rw [run.restrict_stageGraph subset ground ordinal] + exact (ZFSet.rank_mono (graphRestriction_subset S run.stageGraph)).trans_lt + (run.stageGraph_rank_le_code.trans_lt oldRank) + have transitions : ZFSet.rank (run.restrict subset ground ordinal).transitionGraph < o := by + rw [run.restrict_transitionGraph subset ground ordinal] + exact (ZFSet.rank_mono (graphRestriction_subset (chronologyPairs S) run.transitionGraph)).trans_lt + (run.transitionGraph_rank_le_code.trans_lt oldRank) + exact rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases indices (Fin.cases stages (fun _ => transitions))) + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (last : I) (greatest : ∀ i, i ≤ last) +variable (target : GroundLinkedMainStage M K Labels C D rD) +variable (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) +variable (covered : step.CoversOldBirths) + +noncomputable def appendLast : + GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I) := by + let witnesses := run.exists_appendRow last greatest target step + let row := Classical.choose witnesses + have spec := Classical.choose_spec witnesses + exact run.appendCone target (run.diagram.coneOfLast last greatest step) spec.1 spec.2.1 spec.2.2 + (run.diagram.coneOfLast_coverage last greatest step run.coverage covered) + +theorem appendLast_indices : + (run.appendLast last greatest target step covered).indices = insert run.indices run.indices := + run.appendKey_range + +theorem appendLast_linked_old (i : I) : + (run.appendLast last greatest target step covered).linked (i : WithTop I) = run.linked i := rfl + +theorem appendLast_linked_top : + (run.appendLast last greatest target step covered).linked ⊤ = target := rfl + +theorem appendLast_transition_old {i j : I} (before : i ≤ j) : + (run.appendLast last greatest target step covered).diagram.transition (WithTop.coe_le_coe.mpr before) = + run.diagram.transition before := rfl + +theorem appendLast_transition_to_top (i : I) : + (run.appendLast last greatest target step covered).diagram.transition + (show (i : WithTop I) ≤ ⊤ from le_top) = + (run.diagram.transition (greatest i)).comp pairing unions powers separation step := rfl + +theorem appendLast_transition_last : + (run.appendLast last greatest target step covered).diagram.transition + (show (last : WithTop I) ≤ ⊤ from le_top) = step := by + rw [run.appendLast_transition_to_top last greatest target step covered last, + run.diagram.self, GroundChronologicalMainTransition.identity_comp] + +theorem appendLast_stageGraph : + (run.appendLast last greatest target step covered).stageGraph = + insert (ZFSet.pair run.indices target.code) run.stageGraph := + run.appendStageGraph_eq target + +theorem appendLast_row : + ∃ row ∈ M.sets, FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row ∧ + (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code) ∧ + (run.appendLast last greatest target step covered).transitionGraph = + insert (ZFSet.pair (ZFSet.pair run.indices run.indices) + (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code) + (run.transitionGraph ∪ row) := by + let witnesses := run.exists_appendRow last greatest target step + have spec := Classical.choose_spec witnesses + refine ⟨Classical.choose witnesses, spec.1, spec.2.1, spec.2.2, ?_⟩ + exact run.appendTransitionGraph_eq target (run.diagram.coneOfLast last greatest step) spec.2.1 spec.2.2 + +theorem appendLast_stageGraph_restrict : + graphRestriction run.indices (run.appendLast last greatest target step covered).stageGraph = run.stageGraph := by + rw [run.appendLast_stageGraph last greatest target step covered] + rw [graphRestriction_insert_of_not_mem + (fun h => (lt_irrefl _ (ZFSet.rank_lt_of_mem h)) : run.indices ∉ run.indices)] + exact run.stageGraph_function.restriction_eq + +theorem appendLast_transitionGraph_restrict : + graphRestriction (chronologyPairs run.indices) + (run.appendLast last greatest target step covered).transitionGraph = run.transitionGraph := by + let extended := run.appendLast last greatest target step covered + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨key, keyMember, value, rfl, entry⟩ := mem_graphRestriction.1 hz + obtain ⟨j, hj, i, hi, rfl, before⟩ := (mem_chronologyPairs run.indices key).1 keyMember + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hj + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hi + have ordered := (run.key_order i j).2 before + have equal := (extended.transitionGraph_entry (WithTop.coe_le_coe.mpr ordered) value).1 entry + exact (run.transitionGraph_entry ordered value).2 equal + · intro hz + obtain ⟨⟨⟨i, j⟩, before⟩, rfl⟩ := (mem_familyCodeGraph _ _ _).1 hz + exact pair_mem_graphRestriction.2 + ⟨(extended.transitionGraph_entry (WithTop.coe_le_coe.mpr before) _).2 rfl, + (pair_mem_chronologyPairs _ _ _).2 ⟨ZFSet.mem_range.2 ⟨j, rfl⟩, + ZFSet.mem_range.2 ⟨i, rfl⟩, (run.key_order i j).1 before⟩⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u v + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} + +theorem field_rank_le_linkedCode (target : GroundLinkedMainStage M K Labels C D rD) (j : Fin 11) : + ZFSet.rank (target.main.stage.field j) ≤ ZFSet.rank target.code := by + have stageBound : ZFSet.rank target.main.stage.code ≤ ZFSet.rank target.code := by + simpa only [code, linkedMainStageCode, Fin.cases_zero] using + (rank_nonemptyTupleCode_field_le 2 (Fin.cases target.main.stage.code + (Fin.cases target.main.cutoff (fun _ => target.serial.code))) 0) + exact (rank_nonemptyTupleCode_field_le 10 target.main.stage.field j).trans stageBound + +end GroundLinkedMainStage + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def appendSourceBound : ZFSet.{u} := by + let V : ZFSet.{u} := ⋃₀ ⋃₀ run.transitionGraph + let R : ZFSet.{u} := ⋃₀ ⋃₀ V + exact ⋃₀ ⋃₀ ⋃₀ R + +theorem appendSourceBound_rank_le : ZFSet.rank run.appendSourceBound ≤ ZFSet.rank run.code := + ((ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans + ((ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans + ((ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans + (ZFSet.rank_sUnion_le _))))))).trans run.transitionGraph_rank_le_code + +variable (last : I) (greatest : ∀ i, i ≤ last) +variable (target : GroundLinkedMainStage M K Labels C D rD) +variable (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) + +theorem appendRow_subset {row : ZFSet.{u}} + (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) + (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code) : + row ⊆ ZFSet.prod (ZFSet.prod {run.indices} run.indices) + (ZFSet.prod (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.carrier)) + (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.actors))) := by + have pointBound (i : I) : + ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.points ⊆ + ZFSet.prod run.appendSourceBound target.main.stage.carrier := by + intro z hz + obtain ⟨x, _, y, _, w, hw, rfl, xy, _⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz + have old := (run.transitionGraph_entry (greatest i) _).2 rfl + have mapMem := pair_first_mem_doubleUnion (pair_second_mem_doubleUnion old) + exact ZFSet.pair_mem_prod.2 + ⟨pair_first_mem_doubleUnion (ZFSet.mem_sUnion.2 ⟨_, mapMem, xy⟩), hw⟩ + have actorBound (i : I) : + ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.actors ⊆ + ZFSet.prod run.appendSourceBound target.main.stage.actors := by + intro z hz + obtain ⟨x, _, y, _, w, hw, rfl, xy, _⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz + have old := (run.transitionGraph_entry (greatest i) _).2 rfl + have mapMem := pair_second_mem_doubleUnion (pair_second_mem_doubleUnion old) + exact ZFSet.pair_mem_prod.2 + ⟨pair_first_mem_doubleUnion (ZFSet.mem_sUnion.2 ⟨_, mapMem, xy⟩), hw⟩ + intro z hz + obtain ⟨key, keyMember, value, rfl⟩ := function.shape _ hz + obtain ⟨a, ha, x, hx, rfl⟩ := ZFSet.mem_prod.1 keyMember + have equal := ZFSet.mem_singleton.1 ha + subst a + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx + have valueEq := (entries i value).1 hz + rw [valueEq] + exact ZFSet.pair_mem_prod.2 + ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, ZFSet.mem_range.2 ⟨i, rfl⟩⟩, + ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_powerset.2 (pointBound i), ZFSet.mem_powerset.2 (actorBound i)⟩⟩ + +theorem appendRow_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (oldRank : ZFSet.rank run.code < o) (targetRank : ZFSet.rank target.code < o) + {row : ZFSet.{u}} (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) + (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = ((run.diagram.transition (greatest i)).comp pairing unions powers separation step).map.code) : + ZFSet.rank row < o := by + have indexRank := run.indices_rank_le_code.trans_lt oldRank + have sourceRank := run.appendSourceBound_rank_le.trans_lt oldRank + have pointRank : ZFSet.rank target.main.stage.carrier < o := + (target.field_rank_le_linkedCode 0).trans_lt targetRank + have actorRank : ZFSet.rank target.main.stage.actors < o := + (target.field_rank_le_linkedCode 3).trans_lt targetRank + have points : ZFSet.rank (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.carrier)) < o := by + rw [ZFSet.rank_powerset] + exact limit.succ_lt (rank_product_lt limit sourceRank pointRank) + have actors : ZFSet.rank (ZFSet.powerset (ZFSet.prod run.appendSourceBound target.main.stage.actors)) < o := by + rw [ZFSet.rank_powerset] + exact limit.succ_lt (rank_product_lt limit sourceRank actorRank) + exact (ZFSet.rank_mono (run.appendRow_subset last greatest target step function entries)).trans_lt + (rank_product_lt limit (rank_product_lt limit (rank_singleton_lt limit indexRank) indexRank) + (rank_product_lt limit points actors)) + +theorem appendLast_code_rank_lt (covered : step.CoversOldBirths) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (oldRank : ZFSet.rank run.code < o) (targetRank : ZFSet.rank target.code < o) : + ZFSet.rank (run.appendLast last greatest target step covered).code < o := by + let extended := run.appendLast last greatest target step covered + have indexRank := run.indices_rank_le_code.trans_lt oldRank + have newIndices : ZFSet.rank extended.indices < o := by + rw [run.appendLast_indices last greatest target step covered, ZFSet.rank_insert] + exact max_lt (limit.succ_lt indexRank) indexRank + have newStages : ZFSet.rank extended.stageGraph < o := by + rw [run.appendLast_stageGraph last greatest target step covered, ZFSet.rank_insert] + exact max_lt (limit.succ_lt (rank_orderedPair_lt limit indexRank targetRank)) + (run.stageGraph_rank_le_code.trans_lt oldRank) + have newTransitions : ZFSet.rank extended.transitionGraph < o := by + obtain ⟨row, _, function, entries, equal⟩ := run.appendLast_row last greatest target step covered + rw [equal, ZFSet.rank_insert, ZFSet.rank_union] + have pointRank : ZFSet.rank target.main.stage.carrier < o := + (target.field_rank_le_linkedCode 0).trans_lt targetRank + have actorRank : ZFSet.rank target.main.stage.actors < o := + (target.field_rank_le_linkedCode 3).trans_lt targetRank + have identityRank := (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code_rank_lt + limit pointRank pointRank actorRank actorRank + exact max_lt (limit.succ_lt (rank_orderedPair_lt limit (rank_orderedPair_lt limit indexRank indexRank) identityRank)) + (max_lt (run.transitionGraph_rank_le_code.trans_lt oldRank) + (run.appendRow_rank_lt last greatest target step limit oldRank targetRank function entries)) + exact rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases newIndices (Fin.cases newStages (fun _ => newTransitions))) + +end GroundMainPrefix +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (target : GroundLinkedMainStage M K Labels C D rD) (cone : run.diagram.Cone target.main) +variable {row : ZFSet.{u}} (ground : row ∈ M.sets) +variable (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) +variable (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) +variable (covered : cone.append.CoversOldBirths) + +theorem appendCone_indices : + (run.appendCone target cone ground function entries covered).indices = insert run.indices run.indices := + run.appendKey_range + +theorem appendCone_stage_old (i : I) : + (run.appendCone target cone ground function entries covered).diagram.stage (i : WithTop I) = + run.diagram.stage i := rfl + +theorem appendCone_stage_top : + (run.appendCone target cone ground function entries covered).diagram.stage ⊤ = target.main := rfl + +theorem appendCone_linked_old (i : I) : + (run.appendCone target cone ground function entries covered).linked (i : WithTop I) = run.linked i := rfl + +theorem appendCone_linked_top : + (run.appendCone target cone ground function entries covered).linked ⊤ = target := rfl + +theorem appendCone_transition_old {i j : I} (before : i ≤ j) : + (run.appendCone target cone ground function entries covered).diagram.transition + (WithTop.coe_le_coe.mpr before) = run.diagram.transition before := rfl + +theorem appendCone_transition_to_top (i : I) : + (run.appendCone target cone ground function entries covered).diagram.transition + (show (i : WithTop I) ≤ ⊤ from le_top) = cone.leg i := rfl + +theorem appendCone_transition_top : + (run.appendCone target cone ground function entries covered).diagram.transition + (show (⊤ : WithTop I) ≤ ⊤ from le_rfl) = + GroundChronologicalMainTransition.identity pairing unions powers separation target.main := rfl + +theorem appendCone_stageGraph : + (run.appendCone target cone ground function entries covered).stageGraph = + insert (ZFSet.pair run.indices target.code) run.stageGraph := + run.appendStageGraph_eq target + +theorem appendCone_transitionGraph : + (run.appendCone target cone ground function entries covered).transitionGraph = + insert (ZFSet.pair (ZFSet.pair run.indices run.indices) + (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code) + (run.transitionGraph ∪ row) := + run.appendTransitionGraph_eq target cone function entries + +theorem appendCone_stageGraph_restrict : + graphRestriction run.indices (run.appendCone target cone ground function entries covered).stageGraph = + run.stageGraph := by + rw [run.appendCone_stageGraph target cone ground function entries covered] + rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl run.indices)] + exact run.stageGraph_function.restriction_eq + +theorem appendCone_transitionGraph_restrict : + graphRestriction (chronologyPairs run.indices) + (run.appendCone target cone ground function entries covered).transitionGraph = run.transitionGraph := by + let extended := run.appendCone target cone ground function entries covered + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨key, keyMember, value, rfl, entry⟩ := mem_graphRestriction.1 hz + obtain ⟨j, hj, i, hi, rfl, before⟩ := (mem_chronologyPairs run.indices key).1 keyMember + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hj + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hi + have ordered := (run.key_order i j).2 before + have equal := (extended.transitionGraph_entry (WithTop.coe_le_coe.mpr ordered) value).1 entry + exact (run.transitionGraph_entry ordered value).2 equal + · intro hz + obtain ⟨⟨⟨i, j⟩, before⟩, rfl⟩ := (mem_familyCodeGraph _ _ _).1 hz + exact pair_mem_graphRestriction.2 + ⟨(extended.transitionGraph_entry (WithTop.coe_le_coe.mpr before) _).2 rfl, + (pair_mem_chronologyPairs _ _ _).2 ⟨ZFSet.mem_range.2 ⟨j, rfl⟩, + ZFSet.mem_range.2 ⟨i, rfl⟩, (run.key_order i j).1 before⟩⟩ + +theorem appendCone_code_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (oldRank : ZFSet.rank run.code < o) (targetRank : ZFSet.rank target.code < o) + (rowRank : ZFSet.rank row < o) : + ZFSet.rank (run.appendCone target cone ground function entries covered).code < o := by + let extended := run.appendCone target cone ground function entries covered + have indexRank := run.indices_rank_le_code.trans_lt oldRank + have newIndices : ZFSet.rank extended.indices < o := by + rw [run.appendCone_indices target cone ground function entries covered, ZFSet.rank_insert] + exact max_lt (limit.succ_lt indexRank) indexRank + have newStages : ZFSet.rank extended.stageGraph < o := by + rw [run.appendCone_stageGraph target cone ground function entries covered, ZFSet.rank_insert] + exact max_lt (limit.succ_lt (rank_orderedPair_lt limit indexRank targetRank)) + (run.stageGraph_rank_le_code.trans_lt oldRank) + have newTransitions : ZFSet.rank extended.transitionGraph < o := by + rw [run.appendCone_transitionGraph target cone ground function entries covered, + ZFSet.rank_insert, ZFSet.rank_union] + have pointRank : ZFSet.rank target.main.stage.carrier < o := + (target.field_rank_le_linkedCode 0).trans_lt targetRank + have actorRank : ZFSet.rank target.main.stage.actors < o := + (target.field_rank_le_linkedCode 3).trans_lt targetRank + have identityRank := (GroundChronologicalMainTransition.identity pairing unions powers separation target.main).map.code_rank_lt + limit pointRank pointRank actorRank actorRank + exact max_lt (limit.succ_lt (rank_orderedPair_lt limit (rank_orderedPair_lt limit indexRank indexRank) identityRank)) + (max_lt (run.transitionGraph_rank_le_code.trans_lt oldRank) rowRank) + exact rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases newIndices (Fin.cases newStages (fun _ => newTransitions))) + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConeValues.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConeValues.lean index cc537a69ef979c7e3723db04f4d0ffb76a2facc5..a0c36bb40c04c7acd5311850c9ae394023e59927 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConeValues.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixConeValues.lean @@ -1,190 +1,190 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageConstruction - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable {target : GroundChronologicalMainStage M C D rD} (cone : run.diagram.Cone target) - -noncomputable def pointCone : run.pointSystem.InjectiveCone target.stage.carrier where - map i := (cone.leg i).map.points - injection i := (cone.leg i).map.point_embedding.injection - coherence := by - intro i j before - exact congrArg (fun t => t.map.points) (cone.coherent before).symm - -noncomputable def actorCone : run.actorSystem.InjectiveCone target.stage.actors where - map i := (cone.leg i).map.actors - injection i := (cone.leg i).map.group_embedding.injection - coherence := by - intro i j before - exact congrArg (fun t => t.map.actors) (cone.coherent before).symm - -theorem pointCone_kernel {i j : I} {x y a b : ZFSet.{u}} - (xa : ZFSet.pair x a ∈ (cone.leg i).map.points) - (yb : ZFSet.pair y b ∈ (cone.leg j).map.points) : - a = b ↔ run.pointSystem.Related i x j y := - (run.pointCone cone).entry_eq_iff_related xa yb - -theorem actorCone_kernel {i j : I} {x y a b : ZFSet.{u}} - (xa : ZFSet.pair x a ∈ (cone.leg i).map.actors) - (yb : ZFSet.pair y b ∈ (cone.leg j).map.actors) : - a = b ↔ run.actorSystem.Related i x j y := - (run.actorCone cone).entry_eq_iff_related xa yb - -namespace LimitCoverage -variable {run cone} (coverage : run.LimitCoverage target cone) -include coverage - -theorem point_quotient_bijection : - InjectionCode run.limitPoints (ZFSet.sep (fun x => x ≠ target.stage.top) target.stage.carrier) - (run.pointPresentation.coneMap (run.pointCone cone)) ∧ - ∀ y, y ∈ target.stage.carrier → y ≠ target.stage.top → - ∃ q ∈ run.limitPoints, ZFSet.pair q y ∈ run.pointPresentation.coneMap (run.pointCone cone) := by - have bound (i : I) (x y : ZFSet.{u}) (entry : ZFSet.pair x y ∈ (run.pointCone cone).map i) : - y ∈ ZFSet.sep (fun z => z ≠ target.stage.top) target.stage.carrier := by - exact ZFSet.mem_sep.2 ((coverage.points y).2 - ⟨i, x, ((run.pointCone cone).entry_bounds entry).1, entry⟩) - refine ⟨run.pointPresentation.coneMap_injection_into (run.pointCone cone) bound, ?_⟩ - intro y member different - exact (run.pointPresentation.coneMap_range (run.pointCone cone) y).2 - ((coverage.points y).1 ⟨member, different⟩) - -theorem actor_quotient_bijection : - InjectionCode run.limitActors target.stage.actors - (run.actorPresentation.coneMap (run.actorCone cone)) ∧ - ∀ g ∈ target.stage.actors, ∃ q ∈ run.limitActors, - ZFSet.pair q g ∈ run.actorPresentation.coneMap (run.actorCone cone) := by - refine ⟨run.actorPresentation.coneMap_injection (run.actorCone cone), ?_⟩ - intro g member - exact (run.actorPresentation.coneMap_range (run.actorCone cone) g).2 ((coverage.actors g).1 member) - -end LimitCoverage - -theorem pointConeMap_order_iff {p q a b : ZFSet.{u}} - (pa : ZFSet.pair p a ∈ run.pointPresentation.coneMap (run.pointCone cone)) - (qb : ZFSet.pair q b ∈ run.pointPresentation.coneMap (run.pointCone cone)) : - ZFSet.pair a b ∈ target.stage.order ↔ ZFSet.pair p q ∈ run.limitOrder := by - have hp := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) pa)).1 - have hq := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) qb)).1 - obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage hp hq - have xa := (run.pointPresentation.coneMap_at (run.pointCone cone) i hx a).1 pa - have yb := (run.pointPresentation.coneMap_at (run.pointCone cone) i hy b).1 qb - exact ((cone.leg i).map.order_iff x y a b xa yb).trans - ((run.limitOrder_entry _ _).trans (run.limitLE_at i hx hy)).symm - -theorem pointConeMap_map_meet {p q r a b c : ZFSet.{u}} - (meet : ZFSet.pair (ZFSet.pair p q) r ∈ run.limitMeetGraph) - (pa : ZFSet.pair p a ∈ run.pointPresentation.coneMap (run.pointCone cone)) - (qb : ZFSet.pair q b ∈ run.pointPresentation.coneMap (run.pointCone cone)) - (rc : ZFSet.pair r c ∈ run.pointPresentation.coneMap (run.pointCone cone)) : - ZFSet.pair (ZFSet.pair a b) c ∈ target.stage.meetGraph := by - obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ := - (run.limitMeetGraph_entry p q r).1 meet - exact (cone.leg i).map.point_embedding.map_meet x y z a b c entry - ((run.pointPresentation.coneMap_at (run.pointCone cone) i hx a).1 pa) - ((run.pointPresentation.coneMap_at (run.pointCone cone) i hy b).1 qb) - ((run.pointPresentation.coneMap_at (run.pointCone cone) i hz c).1 rc) - -theorem pointConeMap_meetEmbedding : - MeetEmbeddingCode run.limitPoints target.stage.carrier run.limitOrder target.stage.order - run.limitMeetGraph target.stage.meetGraph - (run.pointPresentation.coneMap (run.pointCone cone)) where - injection := run.pointPresentation.coneMap_injection (run.pointCone cone) - monotone _ _ _ _ lower first second := (run.pointConeMap_order_iff cone first second).2 lower - map_meet _ _ _ _ _ _ meet first second third := run.pointConeMap_map_meet cone meet first second third - -theorem pointConeMap_meet_iff {p q r a b c : ZFSet.{u}} - (pa : ZFSet.pair p a ∈ run.pointPresentation.coneMap (run.pointCone cone)) - (qb : ZFSet.pair q b ∈ run.pointPresentation.coneMap (run.pointCone cone)) - (rc : ZFSet.pair r c ∈ run.pointPresentation.coneMap (run.pointCone cone)) : - ZFSet.pair (ZFSet.pair a b) c ∈ target.stage.meetGraph ↔ - ZFSet.pair (ZFSet.pair p q) r ∈ run.limitMeetGraph := by - constructor - · intro meet - have hp := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) pa)).1 - have hq := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) qb)).1 - obtain ⟨s, hs, value⟩ := run.limitMeet_total hp hq - have source := (run.limitMeetGraph_entry p q s).2 value - obtain ⟨d, sd, _⟩ := (run.pointPresentation.coneMap_function (run.pointCone cone)).2 s hs - have mapped := run.pointConeMap_map_meet cone source pa qb sd - have equal : d = c := - (show FunctionGraphOn (ZFSet.prod target.stage.carrier target.stage.carrier) target.stage.meetGraph from - ⟨target.stage.carrier, target.stage.meet.operation⟩).unique mapped meet - have same : s = r := (run.pointPresentation.coneMap_injection (run.pointCone cone)).injective - s r c (equal ▸ sd) rc - exact same ▸ source - · exact fun meet => run.pointConeMap_map_meet cone meet pa qb rc - -theorem actorConeMap_mul {g h k a b c : ZFSet.{u}} - (product : ZFSet.pair (ZFSet.pair g h) k ∈ run.limitMultiplication) - (ga : ZFSet.pair g a ∈ run.actorPresentation.coneMap (run.actorCone cone)) - (hb : ZFSet.pair h b ∈ run.actorPresentation.coneMap (run.actorCone cone)) - (kc : ZFSet.pair k c ∈ run.actorPresentation.coneMap (run.actorCone cone)) : - ZFSet.pair (ZFSet.pair a b) c ∈ target.stage.multiplication := by - obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ := - (run.limitMultiplication_entry g h k).1 product - exact (cone.leg i).map.group_embedding.mul x y z a b c entry - ((run.actorPresentation.coneMap_at (run.actorCone cone) i hx a).1 ga) - ((run.actorPresentation.coneMap_at (run.actorCone cone) i hy b).1 hb) - ((run.actorPresentation.coneMap_at (run.actorCone cone) i hz c).1 kc) - -theorem actorConeMap_groupEmbedding (i₀ : I) : - GroupEmbeddingCode run.limitActors target.stage.actors run.limitMultiplication target.stage.multiplication - (run.limitIdentity i₀) target.stage.identity (run.actorPresentation.coneMap (run.actorCone cone)) where - injection := run.actorPresentation.coneMap_injection (run.actorCone cone) - one := (run.actorPresentation.coneMap_at (run.actorCone cone) i₀ - (run.diagram.stage i₀).stage.group_code.identity_mem target.stage.identity).2 - (cone.leg i₀).map.group_embedding.one - mul _ _ _ _ _ _ product first second third := run.actorConeMap_mul cone product first second third - -theorem actorConeMap_inv {g h a b : ZFSet.{u}} - (inverse : ZFSet.pair g h ∈ run.limitInverse) - (ga : ZFSet.pair g a ∈ run.actorPresentation.coneMap (run.actorCone cone)) - (hb : ZFSet.pair h b ∈ run.actorPresentation.coneMap (run.actorCone cone)) : - ZFSet.pair a b ∈ target.stage.inverse := by - obtain ⟨i, x, y, hx, hy, rfl, rfl, entry⟩ := (run.limitInverse_entry g h).1 inverse - exact (cone.leg i).map.group_embedding.map_inv (run.diagram.stage i).stage.group_code target.stage.group_code - entry ((run.actorPresentation.coneMap_at (run.actorCone cone) i hx a).1 ga) - ((run.actorPresentation.coneMap_at (run.actorCone cone) i hy b).1 hb) - -theorem coneMaps_equivariant {g p q a x y : ZFSet.{u}} - (action : ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction) - (ga : ZFSet.pair g a ∈ run.actorPresentation.coneMap (run.actorCone cone)) - (px : ZFSet.pair p x ∈ run.pointPresentation.coneMap (run.pointCone cone)) - (qy : ZFSet.pair q y ∈ run.pointPresentation.coneMap (run.pointCone cone)) : - ZFSet.pair (ZFSet.pair a x) y ∈ target.stage.action := by - obtain ⟨i, h, v, w, hh, hv, hw, rfl, rfl, rfl, entry⟩ := (run.limitAction_entry g p q).1 action - exact (cone.leg i).map.equivariant h a v w x y - ((run.actorPresentation.coneMap_at (run.actorCone cone) i hh a).1 ga) - ((run.pointPresentation.coneMap_at (run.pointCone cone) i hv x).1 px) - ((run.pointPresentation.coneMap_at (run.pointCone cone) i hw y).1 qy) entry - -theorem pointConeMap_bottom (i₀ : I) : - ZFSet.pair (run.limitBottom i₀) target.stage.bottom ∈ - run.pointPresentation.coneMap (run.pointCone cone) := - (run.pointPresentation.coneMap_at (run.pointCone cone) i₀ - (run.diagram.stage i₀).stage.bottom_mem target.stage.bottom).2 (cone.leg i₀).map.bottom - -theorem pointConeMap_height {p q : ZFSet.{u}} - (entry : ZFSet.pair p q ∈ run.pointPresentation.coneMap (run.pointCone cone)) (t : ZFSet.{u}) : - ZFSet.pair q t ∈ target.stage.height ↔ ZFSet.pair p t ∈ run.limitHeight := by - obtain ⟨i, x, hx, rfl, image⟩ := (run.pointPresentation.coneMap_entry (run.pointCone cone) p q).1 entry - exact ((cone.leg i).map.height x q t image).trans (run.limitHeight_at i hx t).symm - -theorem pointConeMap_birth {p q : ZFSet.{u}} - (entry : ZFSet.pair p q ∈ run.pointPresentation.coneMap (run.pointCone cone)) (t : ZFSet.{u}) : - ZFSet.pair q t ∈ target.birth ↔ ZFSet.pair p t ∈ run.limitBirth := by - obtain ⟨i, x, hx, rfl, image⟩ := (run.pointPresentation.coneMap_entry (run.pointCone cone) p q).1 entry - exact ((cone.leg i).birth x q t image).trans (run.limitBirth_at i hx t).symm - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageConstruction + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable {target : GroundChronologicalMainStage M C D rD} (cone : run.diagram.Cone target) + +noncomputable def pointCone : run.pointSystem.InjectiveCone target.stage.carrier where + map i := (cone.leg i).map.points + injection i := (cone.leg i).map.point_embedding.injection + coherence := by + intro i j before + exact congrArg (fun t => t.map.points) (cone.coherent before).symm + +noncomputable def actorCone : run.actorSystem.InjectiveCone target.stage.actors where + map i := (cone.leg i).map.actors + injection i := (cone.leg i).map.group_embedding.injection + coherence := by + intro i j before + exact congrArg (fun t => t.map.actors) (cone.coherent before).symm + +theorem pointCone_kernel {i j : I} {x y a b : ZFSet.{u}} + (xa : ZFSet.pair x a ∈ (cone.leg i).map.points) + (yb : ZFSet.pair y b ∈ (cone.leg j).map.points) : + a = b ↔ run.pointSystem.Related i x j y := + (run.pointCone cone).entry_eq_iff_related xa yb + +theorem actorCone_kernel {i j : I} {x y a b : ZFSet.{u}} + (xa : ZFSet.pair x a ∈ (cone.leg i).map.actors) + (yb : ZFSet.pair y b ∈ (cone.leg j).map.actors) : + a = b ↔ run.actorSystem.Related i x j y := + (run.actorCone cone).entry_eq_iff_related xa yb + +namespace LimitCoverage +variable {run cone} (coverage : run.LimitCoverage target cone) +include coverage + +theorem point_quotient_bijection : + InjectionCode run.limitPoints (ZFSet.sep (fun x => x ≠ target.stage.top) target.stage.carrier) + (run.pointPresentation.coneMap (run.pointCone cone)) ∧ + ∀ y, y ∈ target.stage.carrier → y ≠ target.stage.top → + ∃ q ∈ run.limitPoints, ZFSet.pair q y ∈ run.pointPresentation.coneMap (run.pointCone cone) := by + have bound (i : I) (x y : ZFSet.{u}) (entry : ZFSet.pair x y ∈ (run.pointCone cone).map i) : + y ∈ ZFSet.sep (fun z => z ≠ target.stage.top) target.stage.carrier := by + exact ZFSet.mem_sep.2 ((coverage.points y).2 + ⟨i, x, ((run.pointCone cone).entry_bounds entry).1, entry⟩) + refine ⟨run.pointPresentation.coneMap_injection_into (run.pointCone cone) bound, ?_⟩ + intro y member different + exact (run.pointPresentation.coneMap_range (run.pointCone cone) y).2 + ((coverage.points y).1 ⟨member, different⟩) + +theorem actor_quotient_bijection : + InjectionCode run.limitActors target.stage.actors + (run.actorPresentation.coneMap (run.actorCone cone)) ∧ + ∀ g ∈ target.stage.actors, ∃ q ∈ run.limitActors, + ZFSet.pair q g ∈ run.actorPresentation.coneMap (run.actorCone cone) := by + refine ⟨run.actorPresentation.coneMap_injection (run.actorCone cone), ?_⟩ + intro g member + exact (run.actorPresentation.coneMap_range (run.actorCone cone) g).2 ((coverage.actors g).1 member) + +end LimitCoverage + +theorem pointConeMap_order_iff {p q a b : ZFSet.{u}} + (pa : ZFSet.pair p a ∈ run.pointPresentation.coneMap (run.pointCone cone)) + (qb : ZFSet.pair q b ∈ run.pointPresentation.coneMap (run.pointCone cone)) : + ZFSet.pair a b ∈ target.stage.order ↔ ZFSet.pair p q ∈ run.limitOrder := by + have hp := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) pa)).1 + have hq := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) qb)).1 + obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage hp hq + have xa := (run.pointPresentation.coneMap_at (run.pointCone cone) i hx a).1 pa + have yb := (run.pointPresentation.coneMap_at (run.pointCone cone) i hy b).1 qb + exact ((cone.leg i).map.order_iff x y a b xa yb).trans + ((run.limitOrder_entry _ _).trans (run.limitLE_at i hx hy)).symm + +theorem pointConeMap_map_meet {p q r a b c : ZFSet.{u}} + (meet : ZFSet.pair (ZFSet.pair p q) r ∈ run.limitMeetGraph) + (pa : ZFSet.pair p a ∈ run.pointPresentation.coneMap (run.pointCone cone)) + (qb : ZFSet.pair q b ∈ run.pointPresentation.coneMap (run.pointCone cone)) + (rc : ZFSet.pair r c ∈ run.pointPresentation.coneMap (run.pointCone cone)) : + ZFSet.pair (ZFSet.pair a b) c ∈ target.stage.meetGraph := by + obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ := + (run.limitMeetGraph_entry p q r).1 meet + exact (cone.leg i).map.point_embedding.map_meet x y z a b c entry + ((run.pointPresentation.coneMap_at (run.pointCone cone) i hx a).1 pa) + ((run.pointPresentation.coneMap_at (run.pointCone cone) i hy b).1 qb) + ((run.pointPresentation.coneMap_at (run.pointCone cone) i hz c).1 rc) + +theorem pointConeMap_meetEmbedding : + MeetEmbeddingCode run.limitPoints target.stage.carrier run.limitOrder target.stage.order + run.limitMeetGraph target.stage.meetGraph + (run.pointPresentation.coneMap (run.pointCone cone)) where + injection := run.pointPresentation.coneMap_injection (run.pointCone cone) + monotone _ _ _ _ lower first second := (run.pointConeMap_order_iff cone first second).2 lower + map_meet _ _ _ _ _ _ meet first second third := run.pointConeMap_map_meet cone meet first second third + +theorem pointConeMap_meet_iff {p q r a b c : ZFSet.{u}} + (pa : ZFSet.pair p a ∈ run.pointPresentation.coneMap (run.pointCone cone)) + (qb : ZFSet.pair q b ∈ run.pointPresentation.coneMap (run.pointCone cone)) + (rc : ZFSet.pair r c ∈ run.pointPresentation.coneMap (run.pointCone cone)) : + ZFSet.pair (ZFSet.pair a b) c ∈ target.stage.meetGraph ↔ + ZFSet.pair (ZFSet.pair p q) r ∈ run.limitMeetGraph := by + constructor + · intro meet + have hp := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) pa)).1 + have hq := (ZFSet.pair_mem_prod.1 (run.pointPresentation.coneMap_subset (run.pointCone cone) qb)).1 + obtain ⟨s, hs, value⟩ := run.limitMeet_total hp hq + have source := (run.limitMeetGraph_entry p q s).2 value + obtain ⟨d, sd, _⟩ := (run.pointPresentation.coneMap_function (run.pointCone cone)).2 s hs + have mapped := run.pointConeMap_map_meet cone source pa qb sd + have equal : d = c := + (show FunctionGraphOn (ZFSet.prod target.stage.carrier target.stage.carrier) target.stage.meetGraph from + ⟨target.stage.carrier, target.stage.meet.operation⟩).unique mapped meet + have same : s = r := (run.pointPresentation.coneMap_injection (run.pointCone cone)).injective + s r c (equal ▸ sd) rc + exact same ▸ source + · exact fun meet => run.pointConeMap_map_meet cone meet pa qb rc + +theorem actorConeMap_mul {g h k a b c : ZFSet.{u}} + (product : ZFSet.pair (ZFSet.pair g h) k ∈ run.limitMultiplication) + (ga : ZFSet.pair g a ∈ run.actorPresentation.coneMap (run.actorCone cone)) + (hb : ZFSet.pair h b ∈ run.actorPresentation.coneMap (run.actorCone cone)) + (kc : ZFSet.pair k c ∈ run.actorPresentation.coneMap (run.actorCone cone)) : + ZFSet.pair (ZFSet.pair a b) c ∈ target.stage.multiplication := by + obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ := + (run.limitMultiplication_entry g h k).1 product + exact (cone.leg i).map.group_embedding.mul x y z a b c entry + ((run.actorPresentation.coneMap_at (run.actorCone cone) i hx a).1 ga) + ((run.actorPresentation.coneMap_at (run.actorCone cone) i hy b).1 hb) + ((run.actorPresentation.coneMap_at (run.actorCone cone) i hz c).1 kc) + +theorem actorConeMap_groupEmbedding (i₀ : I) : + GroupEmbeddingCode run.limitActors target.stage.actors run.limitMultiplication target.stage.multiplication + (run.limitIdentity i₀) target.stage.identity (run.actorPresentation.coneMap (run.actorCone cone)) where + injection := run.actorPresentation.coneMap_injection (run.actorCone cone) + one := (run.actorPresentation.coneMap_at (run.actorCone cone) i₀ + (run.diagram.stage i₀).stage.group_code.identity_mem target.stage.identity).2 + (cone.leg i₀).map.group_embedding.one + mul _ _ _ _ _ _ product first second third := run.actorConeMap_mul cone product first second third + +theorem actorConeMap_inv {g h a b : ZFSet.{u}} + (inverse : ZFSet.pair g h ∈ run.limitInverse) + (ga : ZFSet.pair g a ∈ run.actorPresentation.coneMap (run.actorCone cone)) + (hb : ZFSet.pair h b ∈ run.actorPresentation.coneMap (run.actorCone cone)) : + ZFSet.pair a b ∈ target.stage.inverse := by + obtain ⟨i, x, y, hx, hy, rfl, rfl, entry⟩ := (run.limitInverse_entry g h).1 inverse + exact (cone.leg i).map.group_embedding.map_inv (run.diagram.stage i).stage.group_code target.stage.group_code + entry ((run.actorPresentation.coneMap_at (run.actorCone cone) i hx a).1 ga) + ((run.actorPresentation.coneMap_at (run.actorCone cone) i hy b).1 hb) + +theorem coneMaps_equivariant {g p q a x y : ZFSet.{u}} + (action : ZFSet.pair (ZFSet.pair g p) q ∈ run.limitAction) + (ga : ZFSet.pair g a ∈ run.actorPresentation.coneMap (run.actorCone cone)) + (px : ZFSet.pair p x ∈ run.pointPresentation.coneMap (run.pointCone cone)) + (qy : ZFSet.pair q y ∈ run.pointPresentation.coneMap (run.pointCone cone)) : + ZFSet.pair (ZFSet.pair a x) y ∈ target.stage.action := by + obtain ⟨i, h, v, w, hh, hv, hw, rfl, rfl, rfl, entry⟩ := (run.limitAction_entry g p q).1 action + exact (cone.leg i).map.equivariant h a v w x y + ((run.actorPresentation.coneMap_at (run.actorCone cone) i hh a).1 ga) + ((run.pointPresentation.coneMap_at (run.pointCone cone) i hv x).1 px) + ((run.pointPresentation.coneMap_at (run.pointCone cone) i hw y).1 qy) entry + +theorem pointConeMap_bottom (i₀ : I) : + ZFSet.pair (run.limitBottom i₀) target.stage.bottom ∈ + run.pointPresentation.coneMap (run.pointCone cone) := + (run.pointPresentation.coneMap_at (run.pointCone cone) i₀ + (run.diagram.stage i₀).stage.bottom_mem target.stage.bottom).2 (cone.leg i₀).map.bottom + +theorem pointConeMap_height {p q : ZFSet.{u}} + (entry : ZFSet.pair p q ∈ run.pointPresentation.coneMap (run.pointCone cone)) (t : ZFSet.{u}) : + ZFSet.pair q t ∈ target.stage.height ↔ ZFSet.pair p t ∈ run.limitHeight := by + obtain ⟨i, x, hx, rfl, image⟩ := (run.pointPresentation.coneMap_entry (run.pointCone cone) p q).1 entry + exact ((cone.leg i).map.height x q t image).trans (run.limitHeight_at i hx t).symm + +theorem pointConeMap_birth {p q : ZFSet.{u}} + (entry : ZFSet.pair p q ∈ run.pointPresentation.coneMap (run.pointCone cone)) (t : ZFSet.{u}) : + ZFSet.pair q t ∈ target.birth ↔ ZFSet.pair p t ∈ run.limitBirth := by + obtain ⟨i, x, hx, rfl, image⟩ := (run.pointPresentation.coneMap_entry (run.pointCone cone) p q).1 entry + exact ((cone.leg i).birth x q t image).trans (run.limitBirth_at i hx t).symm + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixCoveredLimitAppend.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixCoveredLimitAppend.lean index 03bafad57fc1def6e1efadfcdfef69b8b0f3517d..7917516dca2f027be97e7f39f976be8dc899252e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixCoveredLimitAppend.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixCoveredLimitAppend.lean @@ -1,209 +1,209 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixRawCoveredAppend - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_preservedRankedAppendLimit (preserved : run.PreservesOldProfiles) (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indices : M.groundEmbeddable run.indices ZFSet.omega) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) : - ∃ data : run.FixedTopStage i₀, - ∃ chronology : data.RankedChronology level, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - target.main = chronology.main ∧ - target.serial.code = chronology.serial.code ∧ - extended.PreservesOldProfiles ∧ - target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ - target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ - target.serial.code ∈ level.validChronologies C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (∀ i : I, - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ - (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → - ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ - ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by - have below : GroundBelow M run.indices K := - ⟨ZFSet.omega, standard.omega_mem pairing unions powers separation hK, indices⟩ - obtain ⟨data⟩ := run.exists_fixedTopMainStage i₀ collection infinite choice columns_eq indices - obtain ⟨chronology⟩ := data.exists_rankedChronology collection infinite choice hK standard below oldRank level - let target := chronology.linked infinite choice hK standard below oldRank - have conditions := standard.to_conditions pairing unions powers separation hK - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - obtain ⟨row, ground, function, entries, rowRank⟩ := run.exists_limitTransitionRow limit oldRank - have rowEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = (chronology.cone.leg i).map.code := entries - let extended := run.appendCone target chronology.cone ground function rowEntries chronology.cone_coverage - have rank : ZFSet.rank extended.code < ZFSet.rank K := - run.appendCone_code_rank_lt target chronology.cone ground function rowEntries chronology.cone_coverage - limit oldRank (target.code_rank_lt pairing unions powers separation infinite hK conditions) rowRank - have preservedExtended : extended.PreservesOldProfiles := - run.appendCone_preservesOldProfiles preserved target chronology.cone ground function - rowEntries chronology.cone_coverage - (fun i => chronology.transition_preservesOldProfiles preserved i) - refine ⟨data, chronology, target, extended, rfl, rfl, preservedExtended, - rfl, rfl, chronology.main_birth, chronology.code_member, - run.appendCone_indices target chronology.cone ground function rowEntries chronology.cone_coverage, - extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, - run.appendCone_linked_old target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_linked_top target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_stageGraph target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_stageGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_transitionGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, - ?_, ?_, ?_⟩ - · intro i j before - rfl - · intro i - exact ⟨rfl, rfl⟩ - · intro i x y entry - exact data.point_strict_top i entry - -theorem exists_preservedRankedAppendLimit_of_indices_mem (preserved : run.PreservesOldProfiles) (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indices : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) : - ∃ data : run.FixedTopStage i₀, - ∃ chronology : data.RankedChronology level, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - target.main = chronology.main ∧ - target.serial.code = chronology.serial.code ∧ - extended.PreservesOldProfiles ∧ - target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ - target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ - target.serial.code ∈ level.validChronologies C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - extended.code ∈ level.preservedMainPrefixes Labels C D rD ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (∀ i : I, - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ - (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → - ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ - ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by - obtain ⟨data, chronology, target, extended, result⟩ := - run.exists_preservedRankedAppendLimit preserved i₀ collection infinite choice columns_eq - (M.groundOmegaOne_member_countable pairing unions powers separation collection infinite indices) - oldRank hK standard level - obtain ⟨mainEqual, serialEqual, profiles, stageEqual, cutoffEqual, birthEqual, serialMember, - indexEqual, ground, rank, member, rest⟩ := result - refine ⟨data, chronology, target, extended, mainEqual, serialEqual, profiles, stageEqual, - cutoffEqual, birthEqual, serialMember, indexEqual, ?_, ground, rank, member, - level.prefix_mem_preservedMainPrefixes extended profiles rank, rest⟩ - rw [indexEqual] - exact M.groundOmegaOne_successor pairing unions powers separation collection infinite indices - -theorem exists_coveredPreservedAppendLimit (preserved : run.PreservesOldProfiles) (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indices : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) : - ∃ data : run.FixedTopStage i₀, - ∃ chronology : data.RankedChronology level, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - ∃ cone : run.diagram.Cone target.main, - run.LimitCoverage target.main cone ∧ - (∀ i : I, - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.code = - (cone.leg i).map.code) ∧ - target.main = chronology.main ∧ - target.serial.code = chronology.serial.code ∧ - extended.PreservesOldProfiles ∧ - target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ - target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ - target.serial.code ∈ level.validChronologies C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - extended.code ∈ level.preservedMainPrefixes Labels C D rD ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (∀ i : I, - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ - (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → - ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ - ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by - obtain ⟨data, chronology, target, extended, mainEqual, serialEqual, preservedExtended, - stageEqual, cutoffEqual, birthEqual, serialMember, indexEqual, indexMember, ground, - rank, member, preservedMember, oldLinked, topLinked, stages, stageRestriction, - transitionRestriction, oldMaps, maps, strict⟩ := - run.exists_preservedRankedAppendLimit_of_indices_mem preserved i₀ collection infinite choice - columns_eq indices oldRank hK standard level - let cone : run.diagram.Cone target.main := mainEqual.symm ▸ chronology.cone - have transportCoverage {first second : GroundChronologicalMainStage M C D rD} - (equal : first = second) (original : run.diagram.Cone first) - (covered : run.LimitCoverage first original) : - run.LimitCoverage second (equal ▸ original) := by - cases equal - exact covered - have coverage : run.LimitCoverage target.main cone := - transportCoverage mainEqual.symm chronology.cone chronology.limitCoverage - have transportCode {first second : GroundChronologicalMainStage M C D rD} - (equal : first = second) (original : run.diagram.Cone first) (i : I) : - ((equal ▸ original).leg i).map.code = (original.leg i).map.code := by - cases equal - rfl - have exactMaps (i : I) : - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.code = - (cone.leg i).map.code := by - rw [show (cone.leg i).map.code = (chronology.cone.leg i).map.code from - transportCode mainEqual.symm chronology.cone i] - exact congrArg₂ ZFSet.pair (maps i).1 (maps i).2 - exact ⟨data, chronology, target, extended, cone, coverage, exactMaps, mainEqual, serialEqual, - preservedExtended, stageEqual, cutoffEqual, birthEqual, serialMember, indexEqual, indexMember, - ground, rank, member, preservedMember, oldLinked, topLinked, stages, stageRestriction, - transitionRestriction, oldMaps, maps, strict⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixRawCoveredAppend + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_preservedRankedAppendLimit (preserved : run.PreservesOldProfiles) (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indices : M.groundEmbeddable run.indices ZFSet.omega) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) : + ∃ data : run.FixedTopStage i₀, + ∃ chronology : data.RankedChronology level, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + target.main = chronology.main ∧ + target.serial.code = chronology.serial.code ∧ + extended.PreservesOldProfiles ∧ + target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ + target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ + target.serial.code ∈ level.validChronologies C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (∀ i : I, + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ + (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → + ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ + ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by + have below : GroundBelow M run.indices K := + ⟨ZFSet.omega, standard.omega_mem pairing unions powers separation hK, indices⟩ + obtain ⟨data⟩ := run.exists_fixedTopMainStage i₀ collection infinite choice columns_eq indices + obtain ⟨chronology⟩ := data.exists_rankedChronology collection infinite choice hK standard below oldRank level + let target := chronology.linked infinite choice hK standard below oldRank + have conditions := standard.to_conditions pairing unions powers separation hK + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + obtain ⟨row, ground, function, entries, rowRank⟩ := run.exists_limitTransitionRow limit oldRank + have rowEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = (chronology.cone.leg i).map.code := entries + let extended := run.appendCone target chronology.cone ground function rowEntries chronology.cone_coverage + have rank : ZFSet.rank extended.code < ZFSet.rank K := + run.appendCone_code_rank_lt target chronology.cone ground function rowEntries chronology.cone_coverage + limit oldRank (target.code_rank_lt pairing unions powers separation infinite hK conditions) rowRank + have preservedExtended : extended.PreservesOldProfiles := + run.appendCone_preservesOldProfiles preserved target chronology.cone ground function + rowEntries chronology.cone_coverage + (fun i => chronology.transition_preservesOldProfiles preserved i) + refine ⟨data, chronology, target, extended, rfl, rfl, preservedExtended, + rfl, rfl, chronology.main_birth, chronology.code_member, + run.appendCone_indices target chronology.cone ground function rowEntries chronology.cone_coverage, + extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, + run.appendCone_linked_old target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_linked_top target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_stageGraph target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_stageGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_transitionGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, + ?_, ?_, ?_⟩ + · intro i j before + rfl + · intro i + exact ⟨rfl, rfl⟩ + · intro i x y entry + exact data.point_strict_top i entry + +theorem exists_preservedRankedAppendLimit_of_indices_mem (preserved : run.PreservesOldProfiles) (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indices : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) : + ∃ data : run.FixedTopStage i₀, + ∃ chronology : data.RankedChronology level, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + target.main = chronology.main ∧ + target.serial.code = chronology.serial.code ∧ + extended.PreservesOldProfiles ∧ + target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ + target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ + target.serial.code ∈ level.validChronologies C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + extended.code ∈ level.preservedMainPrefixes Labels C D rD ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (∀ i : I, + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ + (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → + ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ + ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by + obtain ⟨data, chronology, target, extended, result⟩ := + run.exists_preservedRankedAppendLimit preserved i₀ collection infinite choice columns_eq + (M.groundOmegaOne_member_countable pairing unions powers separation collection infinite indices) + oldRank hK standard level + obtain ⟨mainEqual, serialEqual, profiles, stageEqual, cutoffEqual, birthEqual, serialMember, + indexEqual, ground, rank, member, rest⟩ := result + refine ⟨data, chronology, target, extended, mainEqual, serialEqual, profiles, stageEqual, + cutoffEqual, birthEqual, serialMember, indexEqual, ?_, ground, rank, member, + level.prefix_mem_preservedMainPrefixes extended profiles rank, rest⟩ + rw [indexEqual] + exact M.groundOmegaOne_successor pairing unions powers separation collection infinite indices + +theorem exists_coveredPreservedAppendLimit (preserved : run.PreservesOldProfiles) (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indices : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) : + ∃ data : run.FixedTopStage i₀, + ∃ chronology : data.RankedChronology level, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + ∃ cone : run.diagram.Cone target.main, + run.LimitCoverage target.main cone ∧ + (∀ i : I, + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.code = + (cone.leg i).map.code) ∧ + target.main = chronology.main ∧ + target.serial.code = chronology.serial.code ∧ + extended.PreservesOldProfiles ∧ + target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ + target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ + target.serial.code ∈ level.validChronologies C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + extended.code ∈ level.preservedMainPrefixes Labels C D rD ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (∀ i : I, + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ + (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → + ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ + ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by + obtain ⟨data, chronology, target, extended, mainEqual, serialEqual, preservedExtended, + stageEqual, cutoffEqual, birthEqual, serialMember, indexEqual, indexMember, ground, + rank, member, preservedMember, oldLinked, topLinked, stages, stageRestriction, + transitionRestriction, oldMaps, maps, strict⟩ := + run.exists_preservedRankedAppendLimit_of_indices_mem preserved i₀ collection infinite choice + columns_eq indices oldRank hK standard level + let cone : run.diagram.Cone target.main := mainEqual.symm ▸ chronology.cone + have transportCoverage {first second : GroundChronologicalMainStage M C D rD} + (equal : first = second) (original : run.diagram.Cone first) + (covered : run.LimitCoverage first original) : + run.LimitCoverage second (equal ▸ original) := by + cases equal + exact covered + have coverage : run.LimitCoverage target.main cone := + transportCoverage mainEqual.symm chronology.cone chronology.limitCoverage + have transportCode {first second : GroundChronologicalMainStage M C D rD} + (equal : first = second) (original : run.diagram.Cone first) (i : I) : + ((equal ▸ original).leg i).map.code = (original.leg i).map.code := by + cases equal + rfl + have exactMaps (i : I) : + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.code = + (cone.leg i).map.code := by + rw [show (cone.leg i).map.code = (chronology.cone.leg i).map.code from + transportCode mainEqual.symm chronology.cone i] + exact congrArg₂ ZFSet.pair (maps i).1 (maps i).2 + exact ⟨data, chronology, target, extended, cone, coverage, exactMaps, mainEqual, serialEqual, + preservedExtended, stageEqual, cutoffEqual, birthEqual, serialMember, indexEqual, indexMember, + ground, rank, member, preservedMember, oldLinked, topLinked, stages, stageRestriction, + transitionRestriction, oldMaps, maps, strict⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixDecoding.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixDecoding.lean index 4362a438dd1d74cf9026d1d0dd659114cc39627a..37ac7da71486ce9f7366653cde97f2639b3dd2b5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixDecoding.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixDecoding.lean @@ -1,427 +1,427 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedTransitionRetarget - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u - -structure MainPrefixGraphCode (M : TransitiveGround.{u}) - (K Labels C D rD T S E : ZFSet.{u}) : Prop where - ordinal : ordinalSetProperty T - stages : FunctionGraphOn T S - transitions : FunctionGraphOn (chronologyPairs T) E - stage_valid : ∀ i a, ZFSet.pair i a ∈ S → - ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = a - transition_valid : ∀ i j a b z, ZFSet.pair i a ∈ S → ZFSet.pair j b ∈ S → - ZFSet.pair (ZFSet.pair j i) z ∈ E → LinkedMainTransitionCode M K Labels C D rD a b z - identity : ∀ i p a, ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ E → - GraphDiagonalCode p ∧ GraphDiagonalCode a - composition : ∀ i j k p₁ a₁ p₂ a₂ p₃ a₃, - ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ E → - ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ E → - ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ E → - GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ - -end - -namespace MainPrefixGraphCode -open SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD T S E : ZFSet.{u}} -variable (raw : MainPrefixGraphCode M K Labels C D rD T S E) - -noncomputable def decodedLinked (i : SetMembers T) : GroundLinkedMainStage M K Labels C D rD := - Classical.choose (raw.stage_valid (SetMembers.raw i) (decodedFamilyValue raw.stages i) - (decodedFamilyValue_entry raw.stages i)) - -theorem decodedLinked_code (i : SetMembers T) : - (raw.decodedLinked i).code = decodedFamilyValue raw.stages i := - Classical.choose_spec (raw.stage_valid (SetMembers.raw i) (decodedFamilyValue raw.stages i) - (decodedFamilyValue_entry raw.stages i)) - -theorem decodedLinked_entry (i : SetMembers T) : - ZFSet.pair (SetMembers.raw i) (raw.decodedLinked i).code ∈ S := by - rw [raw.decodedLinked_code] - exact decodedFamilyValue_entry raw.stages i - -noncomputable def decodedTransitionIndex (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : - {q : ZFSet.{u} // q ∈ chronologyPairs T} := - ⟨ZFSet.pair (SetMembers.raw j) (SetMembers.raw i), - (pair_mem_chronologyPairs T _ _).2 ⟨SetMembers.raw_mem j, SetMembers.raw_mem i, before⟩⟩ - -noncomputable def decodedTransitionCode (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : ZFSet.{u} := - raw.transitions.value (decodedTransitionIndex i j before) - -theorem decodedTransitionCode_entry (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : - ZFSet.pair (ZFSet.pair (SetMembers.raw j) (SetMembers.raw i)) - (raw.decodedTransitionCode i j before) ∈ E := - raw.transitions.value_entry (decodedTransitionIndex i j before) - -theorem exists_decodedTransition (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : - ∃ transition : GroundChronologicalMainTransition (raw.decodedLinked i).main (raw.decodedLinked j).main, - transition.map.code = raw.decodedTransitionCode i j before ∧ transition.CoversOldBirths := - LinkedMainTransitionCode.exists_at (raw.decodedLinked i) (raw.decodedLinked j) - (raw.transition_valid _ _ _ _ _ (raw.decodedLinked_entry i) (raw.decodedLinked_entry j) - (raw.decodedTransitionCode_entry i j before)) - -noncomputable def decodedTransition (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : - GroundChronologicalMainTransition (raw.decodedLinked i).main (raw.decodedLinked j).main := - Classical.choose (raw.exists_decodedTransition i j before) - -theorem decodedTransition_code (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : - (raw.decodedTransition i j before).map.code = raw.decodedTransitionCode i j before := - (Classical.choose_spec (raw.exists_decodedTransition i j before)).1 - -theorem decodedTransition_coverage (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : - (raw.decodedTransition i j before).CoversOldBirths := - (Classical.choose_spec (raw.exists_decodedTransition i j before)).2 - -theorem decodedTransition_entry (i j : SetMembers T) - (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : - ZFSet.pair (ZFSet.pair (SetMembers.raw j) (SetMembers.raw i)) - (raw.decodedTransition i j before).map.code ∈ E := by - rw [raw.decodedTransition_code] - exact raw.decodedTransitionCode_entry i j before - -end MainPrefixGraphCode - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem linked_transition_code {i j : I} (before : i ≤ j) : - LinkedMainTransitionCode M K Labels C D rD (run.linked i).code (run.linked j).code - (run.diagram.transition before).map.code := by - refine ⟨run.linked i, run.linked j, rfl, rfl, ?_⟩ - rw [run.linked_main i, run.linked_main j] - exact ⟨run.diagram.transition before, rfl, run.coverage before⟩ - -theorem stageGraph_valid {i a : ZFSet.{u}} (entry : ZFSet.pair i a ∈ run.stageGraph) : - ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = a := by - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source entry) - exact ⟨run.linked j, ((run.stageGraph_entry j a).1 entry).symm⟩ - -theorem transitionGraph_valid {i j a b z : ZFSet.{u}} - (first : ZFSet.pair i a ∈ run.stageGraph) (second : ZFSet.pair j b ∈ run.stageGraph) - (entry : ZFSet.pair (ZFSet.pair j i) z ∈ run.transitionGraph) : - LinkedMainTransitionCode M K Labels C D rD a b z := by - obtain ⟨s, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source first) - obtain ⟨t, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source second) - have order := ((pair_mem_chronologyPairs _ _ _).1 - (run.transitionGraph_function.pair_source entry)).2.2 - have before := (run.key_order s t).2 order - rw [(run.stageGraph_entry s a).1 first, (run.stageGraph_entry t b).1 second, - (run.transitionGraph_entry before z).1 entry] - exact run.linked_transition_code before - -theorem transitionGraph_identity {i p a : ZFSet.{u}} - (entry : ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ run.transitionGraph) : - GraphDiagonalCode p ∧ GraphDiagonalCode a := by - have domain := (pair_mem_chronologyPairs _ _ _).1 (run.transitionGraph_function.pair_source entry) - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 domain.1 - have equal := (run.transitionGraph_entry (le_refl j) (ZFSet.pair p a)).1 entry - rw [run.diagram.self] at equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨graphDiagonalCode_identity _, graphDiagonalCode_identity _⟩ - -theorem transitionGraph_composition {i j k p₁ a₁ p₂ a₂ p₃ a₃ : ZFSet.{u}} - (first : ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ run.transitionGraph) - (second : ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ run.transitionGraph) - (third : ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ run.transitionGraph) : - GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ := by - have domain₁ := (pair_mem_chronologyPairs _ _ _).1 (run.transitionGraph_function.pair_source first) - have domain₂ := (pair_mem_chronologyPairs _ _ _).1 (run.transitionGraph_function.pair_source second) - obtain ⟨s, rfl⟩ := ZFSet.mem_range.1 domain₁.2.1 - obtain ⟨t, rfl⟩ := ZFSet.mem_range.1 domain₁.1 - obtain ⟨v, rfl⟩ := ZFSet.mem_range.1 domain₂.1 - have before₁ := (run.key_order s t).2 domain₁.2.2 - have before₂ := (run.key_order t v).2 domain₂.2.2 - have equal₁ := (run.transitionGraph_entry before₁ _).1 first - have equal₂ := (run.transitionGraph_entry before₂ _).1 second - have equal₃ := (run.transitionGraph_entry (le_trans before₁ before₂) _).1 third - rw [run.diagram.comp before₁ before₂] at equal₃ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal₁ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal₂ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal₃ - exact ⟨graphCompositionCode_relationCompose - (run.diagram.transition before₁).map.point_embedding.injection.function - (run.diagram.transition before₂).map.point_embedding.injection.function, - graphCompositionCode_relationCompose - (run.diagram.transition before₁).map.group_embedding.injection.function - (run.diagram.transition before₂).map.group_embedding.injection.function⟩ - -theorem graph_code : MainPrefixGraphCode M K Labels C D rD run.indices run.stageGraph run.transitionGraph where - ordinal := run.indices_ordinal - stages := run.stageGraph_function - transitions := run.transitionGraph_function - stage_valid := fun _ _ entry => run.stageGraph_valid entry - transition_valid := fun _ _ _ _ _ first second entry => run.transitionGraph_valid first second entry - identity := fun _ _ _ entry => run.transitionGraph_identity entry - composition := fun _ _ _ _ _ _ _ _ _ first second third => run.transitionGraph_composition first second third - -end GroundMainPrefix - -section -open SetFormula -universe u - -noncomputable def mainPrefixCode (T S E : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 2 (Fin.cases T (Fin.cases S (fun _ => E))) - -theorem mainPrefixCode_inj {T S E T' S' E' : ZFSet.{u}} : - mainPrefixCode T S E = mainPrefixCode T' S' E' ↔ T = T' ∧ S = S' ∧ E = E' := by - constructor - · intro equal - have fields := nonemptyTupleCode_injective 2 equal - exact ⟨congrFun fields 0, congrFun fields 1, congrFun fields 2⟩ - · rintro ⟨rfl, rfl, rfl⟩ - rfl - -def MainPrefixCode (M : TransitiveGround.{u}) (K Labels C D rD z : ZFSet.{u}) : Prop := - ∃ T S E, z = mainPrefixCode T S E ∧ MainPrefixGraphCode M K Labels C D rD T S E - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem mainPrefixCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {T S E : ZFSet.{u}} (hT : T ∈ M.sets) (hS : S ∈ M.sets) (hE : E ∈ M.sets) : - mainPrefixCode T S E ∈ M.sets := - M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases hT (Fin.cases hS (fun _ => hE))) - -theorem mainPrefixCode_fields_mem {T S E : ZFSet.{u}} (ground : mainPrefixCode T S E ∈ M.sets) : - T ∈ M.sets ∧ S ∈ M.sets ∧ E ∈ M.sets := by - let fields : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) - have encoded : nonemptyTupleCode 2 fields ∈ M.sets := ground - have each := M.nonemptyTupleCode_field_mem 2 fields encoded - exact ⟨each 0, each 1, each 2⟩ - -end TransitiveGround - -namespace BoundedFormula - -def mainPrefixTupleFormula {n} (z T S E : Fin n) : BoundedFormula n := - nonemptyTupleFormula 2 z (Fin.cases T (Fin.cases S (fun _ => E))) - -theorem truth_mainPrefixTupleFormula {n} (z T S E : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (mainPrefixTupleFormula z T S E) env ↔ env z = mainPrefixCode (env T) (env S) (env E) := by - rw [mainPrefixTupleFormula, truth_nonemptyTupleFormula] - have map : (fun j : Fin 3 => env (Fin.cases T (Fin.cases S (fun _ => E)) j)) = - Fin.cases (env T) (Fin.cases (env S) (fun _ => env E)) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (fun _ => rfl)) j - rw [map] - rfl - -theorem realize_mainPrefixTupleFormula (M : TransitiveGround.{u}) {n} - (z T S E : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixTupleFormula z T S E).toFormula env ↔ - env z = mainPrefixCode (env T) (env S) (env E) := - (realize_toFormula M _ env members).trans (truth_mainPrefixTupleFormula z T S E env) - -end BoundedFormula - -end - -namespace MainPrefixGraphCode -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD T S E : ZFSet.{u}} -variable (raw : MainPrefixGraphCode M K Labels C D rD T S E) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -theorem decodedTransition_self (i : SetMembers T) : - raw.decodedTransition i i (Or.inl rfl) = - GroundChronologicalMainTransition.identity pairing unions powers separation (raw.decodedLinked i).main := by - have diagonal := raw.identity (SetMembers.raw i) _ _ (raw.decodedTransition_entry i i (Or.inl rfl)) - apply GroundChronologicalMainTransition.ext - apply GroundMainTransition.ext - · exact diagonal.1.eq_identityFunctionGraph - (raw.decodedTransition i i (Or.inl rfl)).map.point_embedding.injection.function - · exact diagonal.2.eq_identityFunctionGraph - (raw.decodedTransition i i (Or.inl rfl)).map.group_embedding.injection.function - -theorem decodedTransition_comp (i j k : SetMembers T) - (first : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) - (second : SetMembers.raw j = SetMembers.raw k ∨ SetMembers.raw j ∈ SetMembers.raw k) : - raw.decodedTransition i k ((ordinalMainIndexPreorder raw.ordinal).le_trans i j k first second) = - (raw.decodedTransition i j first).comp pairing unions powers separation (raw.decodedTransition j k second) := by - have direct := (ordinalMainIndexPreorder raw.ordinal).le_trans i j k first second - have coherent := raw.composition (SetMembers.raw i) (SetMembers.raw j) (SetMembers.raw k) - _ _ _ _ _ _ (raw.decodedTransition_entry i j first) (raw.decodedTransition_entry j k second) - (raw.decodedTransition_entry i k direct) - apply GroundChronologicalMainTransition.ext - apply GroundMainTransition.ext - · exact coherent.1.eq_relationCompose - (raw.decodedTransition i j first).map.point_embedding.injection.function - (raw.decodedTransition i k direct).map.point_embedding.injection.function.1 - · exact coherent.2.eq_relationCompose - (raw.decodedTransition i j first).map.group_embedding.injection.function - (raw.decodedTransition i k direct).map.group_embedding.injection.function.1 - -noncomputable def decodedDiagram : - letI := ordinalMainIndexPreorder raw.ordinal - GroundChronologicalMainDiagram M C D rD pairing unions powers separation (SetMembers T) := by - let := ordinalMainIndexPreorder raw.ordinal - exact { - stage := fun i => (raw.decodedLinked i).main - transition := fun {i j} before => raw.decodedTransition i j before - self := raw.decodedTransition_self pairing unions powers separation - comp := fun {i j k} first second => raw.decodedTransition_comp pairing unions powers separation i j k first second - } - -theorem decodedDiagram_coverage : - letI := ordinalMainIndexPreorder raw.ordinal - (raw.decodedDiagram pairing unions powers separation).CoversOldBirths := by - let := ordinalMainIndexPreorder raw.ordinal - exact fun {i j} before => raw.decodedTransition_coverage i j before - -end MainPrefixGraphCode - -section -universe u - -def MainPrefixExtends (old next : ZFSet.{u}) : Prop := - ∃ T S E T' S' E', old = mainPrefixCode T S E ∧ next = mainPrefixCode T' S' E' ∧ - T ⊆ T' ∧ S ⊆ S' ∧ E ⊆ E' - -theorem mainPrefixExtends_iff {T S E T' S' E' : ZFSet.{u}} : - MainPrefixExtends (mainPrefixCode T S E) (mainPrefixCode T' S' E') ↔ - T ⊆ T' ∧ S ⊆ S' ∧ E ⊆ E' := by - constructor - · rintro ⟨A, B, C, A', B', C', first, second, indices, stages, transitions⟩ - obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 first - obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 second - exact ⟨indices, stages, transitions⟩ - · rintro ⟨indices, stages, transitions⟩ - exact ⟨T, S, E, T', S', E', rfl, rfl, indices, stages, transitions⟩ - -theorem MainPrefixExtends.refl (T S E : ZFSet.{u}) : - MainPrefixExtends (mainPrefixCode T S E) (mainPrefixCode T S E) := - mainPrefixExtends_iff.2 ⟨fun _ h => h, fun _ h => h, fun _ h => h⟩ - -theorem MainPrefixExtends.trans {a b c : ZFSet.{u}} - (first : MainPrefixExtends a b) (second : MainPrefixExtends b c) : MainPrefixExtends a c := by - obtain ⟨T, S, E, U, F, G, rfl, hb, indices, stages, transitions⟩ := first - obtain ⟨U', F', G', V, H, J, hb', rfl, indices', stages', transitions'⟩ := second - obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 (hb.symm.trans hb') - exact mainPrefixExtends_iff.2 ⟨fun _ h => indices' (indices h), - fun _ h => stages' (stages h), fun _ h => transitions' (transitions h)⟩ - -theorem MainPrefixExtends.antisymm {a b : ZFSet.{u}} - (first : MainPrefixExtends a b) (second : MainPrefixExtends b a) : a = b := by - obtain ⟨T, S, E, U, F, G, rfl, rfl, indices, stages, transitions⟩ := first - obtain ⟨indices', stages', transitions'⟩ := mainPrefixExtends_iff.1 second - exact mainPrefixCode_inj.2 ⟨ZFSet.ext fun _ => ⟨fun h => indices h, fun h => indices' h⟩, - ZFSet.ext fun _ => ⟨fun h => stages h, fun h => stages' h⟩, - ZFSet.ext fun _ => ⟨fun h => transitions h, fun h => transitions' h⟩⟩ - -theorem FunctionGraphOn.restriction_eq_of_subset {A B f g : ZFSet.{u}} - (first : FunctionGraphOn A f) (second : FunctionGraphOn B g) (subset : f ⊆ g) : - graphRestriction A g = f := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz - obtain ⟨w, old⟩ := first.total hx - have equal := second.unique entry (subset old) - exact equal.symm ▸ old - · intro hz - obtain ⟨x, hx, y, rfl⟩ := first.shape _ hz - exact pair_mem_graphRestriction.2 ⟨subset hz, hx⟩ - -theorem mainPrefixExtends_iff_restrictions - {M : TransitiveGround.{u}} {K Labels C D rD T S E T' S' E' : ZFSet.{u}} - (old : MainPrefixGraphCode M K Labels C D rD T S E) - (next : MainPrefixGraphCode M K Labels C D rD T' S' E') : - MainPrefixExtends (mainPrefixCode T S E) (mainPrefixCode T' S' E') ↔ - T ⊆ T' ∧ graphRestriction T S' = S ∧ graphRestriction (chronologyPairs T) E' = E := by - rw [mainPrefixExtends_iff] - constructor - · rintro ⟨indices, stages, transitions⟩ - exact ⟨indices, old.stages.restriction_eq_of_subset next.stages stages, - old.transitions.restriction_eq_of_subset next.transitions transitions⟩ - · rintro ⟨indices, stages, transitions⟩ - exact ⟨indices, stages ▸ graphRestriction_subset T S', - transitions ▸ graphRestriction_subset (chronologyPairs T) E'⟩ - -end - -namespace MainPrefixGraphCode -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD T S E : ZFSet.{u}} -variable (raw : MainPrefixGraphCode M K Labels C D rD T S E) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hT : T ∈ M.sets) (hS : S ∈ M.sets) (hE : E ∈ M.sets) - -noncomputable def decodedPrefix : - letI := ordinalMainIndexPreorder raw.ordinal - GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T) := by - let := ordinalMainIndexPreorder raw.ordinal - exact { - key := SetMembers.raw - key_injective := SetMembers.raw_injective T - key_order := fun i j => ordinalMainIndex_le_iff raw.ordinal i j - indices_ground := (ordinalMainIndex_key_range T).symm ▸ hT - indices_ordinal := (ordinalMainIndex_key_range T).symm ▸ raw.ordinal - diagram := raw.decodedDiagram pairing unions powers separation - linked := raw.decodedLinked - linked_main := fun _ => rfl - coverage := raw.decodedDiagram_coverage pairing unions powers separation - stages_ground := familyCodeGraph_ground_of_entries hS raw.stages _ _ - (ordinalMainIndex_key_range T) raw.decodedLinked_entry - transitions_ground := familyCodeGraph_ground_of_entries hE raw.transitions _ _ - (ordinalMainTransitionIndex_range raw.ordinal) - (fun p => raw.decodedTransition_entry p.val.1 p.val.2 p.property) - } - -theorem decodedPrefix_indices : - letI := ordinalMainIndexPreorder raw.ordinal - (raw.decodedPrefix pairing unions powers separation hT hS hE).indices = T := - ordinalMainIndex_key_range T - -theorem decodedPrefix_stageGraph : - letI := ordinalMainIndexPreorder raw.ordinal - (raw.decodedPrefix pairing unions powers separation hT hS hE).stageGraph = S := - familyCodeGraph_eq_of_entries raw.stages _ _ (ordinalMainIndex_key_range T) raw.decodedLinked_entry - -theorem decodedPrefix_transitionGraph : - letI := ordinalMainIndexPreorder raw.ordinal - (raw.decodedPrefix pairing unions powers separation hT hS hE).transitionGraph = E := by - let := ordinalMainIndexPreorder raw.ordinal - exact familyCodeGraph_eq_of_entries raw.transitions _ _ (ordinalMainTransitionIndex_range raw.ordinal) - (fun p => raw.decodedTransition_entry p.val.1 p.val.2 p.property) - -theorem decodedPrefix_code : - letI := ordinalMainIndexPreorder raw.ordinal - (raw.decodedPrefix pairing unions powers separation hT hS hE).code = - nonemptyTupleCode 2 (Fin.cases T (Fin.cases S (fun _ => E))) := by - let := ordinalMainIndexPreorder raw.ordinal - unfold GroundMainPrefix.code - rw [raw.decodedPrefix_indices, raw.decodedPrefix_stageGraph, raw.decodedPrefix_transitionGraph] - -end MainPrefixGraphCode - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedTransitionRetarget + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u + +structure MainPrefixGraphCode (M : TransitiveGround.{u}) + (K Labels C D rD T S E : ZFSet.{u}) : Prop where + ordinal : ordinalSetProperty T + stages : FunctionGraphOn T S + transitions : FunctionGraphOn (chronologyPairs T) E + stage_valid : ∀ i a, ZFSet.pair i a ∈ S → + ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = a + transition_valid : ∀ i j a b z, ZFSet.pair i a ∈ S → ZFSet.pair j b ∈ S → + ZFSet.pair (ZFSet.pair j i) z ∈ E → LinkedMainTransitionCode M K Labels C D rD a b z + identity : ∀ i p a, ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ E → + GraphDiagonalCode p ∧ GraphDiagonalCode a + composition : ∀ i j k p₁ a₁ p₂ a₂ p₃ a₃, + ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ E → + ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ E → + ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ E → + GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ + +end + +namespace MainPrefixGraphCode +open SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD T S E : ZFSet.{u}} +variable (raw : MainPrefixGraphCode M K Labels C D rD T S E) + +noncomputable def decodedLinked (i : SetMembers T) : GroundLinkedMainStage M K Labels C D rD := + Classical.choose (raw.stage_valid (SetMembers.raw i) (decodedFamilyValue raw.stages i) + (decodedFamilyValue_entry raw.stages i)) + +theorem decodedLinked_code (i : SetMembers T) : + (raw.decodedLinked i).code = decodedFamilyValue raw.stages i := + Classical.choose_spec (raw.stage_valid (SetMembers.raw i) (decodedFamilyValue raw.stages i) + (decodedFamilyValue_entry raw.stages i)) + +theorem decodedLinked_entry (i : SetMembers T) : + ZFSet.pair (SetMembers.raw i) (raw.decodedLinked i).code ∈ S := by + rw [raw.decodedLinked_code] + exact decodedFamilyValue_entry raw.stages i + +noncomputable def decodedTransitionIndex (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : + {q : ZFSet.{u} // q ∈ chronologyPairs T} := + ⟨ZFSet.pair (SetMembers.raw j) (SetMembers.raw i), + (pair_mem_chronologyPairs T _ _).2 ⟨SetMembers.raw_mem j, SetMembers.raw_mem i, before⟩⟩ + +noncomputable def decodedTransitionCode (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : ZFSet.{u} := + raw.transitions.value (decodedTransitionIndex i j before) + +theorem decodedTransitionCode_entry (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : + ZFSet.pair (ZFSet.pair (SetMembers.raw j) (SetMembers.raw i)) + (raw.decodedTransitionCode i j before) ∈ E := + raw.transitions.value_entry (decodedTransitionIndex i j before) + +theorem exists_decodedTransition (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : + ∃ transition : GroundChronologicalMainTransition (raw.decodedLinked i).main (raw.decodedLinked j).main, + transition.map.code = raw.decodedTransitionCode i j before ∧ transition.CoversOldBirths := + LinkedMainTransitionCode.exists_at (raw.decodedLinked i) (raw.decodedLinked j) + (raw.transition_valid _ _ _ _ _ (raw.decodedLinked_entry i) (raw.decodedLinked_entry j) + (raw.decodedTransitionCode_entry i j before)) + +noncomputable def decodedTransition (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : + GroundChronologicalMainTransition (raw.decodedLinked i).main (raw.decodedLinked j).main := + Classical.choose (raw.exists_decodedTransition i j before) + +theorem decodedTransition_code (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : + (raw.decodedTransition i j before).map.code = raw.decodedTransitionCode i j before := + (Classical.choose_spec (raw.exists_decodedTransition i j before)).1 + +theorem decodedTransition_coverage (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : + (raw.decodedTransition i j before).CoversOldBirths := + (Classical.choose_spec (raw.exists_decodedTransition i j before)).2 + +theorem decodedTransition_entry (i j : SetMembers T) + (before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) : + ZFSet.pair (ZFSet.pair (SetMembers.raw j) (SetMembers.raw i)) + (raw.decodedTransition i j before).map.code ∈ E := by + rw [raw.decodedTransition_code] + exact raw.decodedTransitionCode_entry i j before + +end MainPrefixGraphCode + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem linked_transition_code {i j : I} (before : i ≤ j) : + LinkedMainTransitionCode M K Labels C D rD (run.linked i).code (run.linked j).code + (run.diagram.transition before).map.code := by + refine ⟨run.linked i, run.linked j, rfl, rfl, ?_⟩ + rw [run.linked_main i, run.linked_main j] + exact ⟨run.diagram.transition before, rfl, run.coverage before⟩ + +theorem stageGraph_valid {i a : ZFSet.{u}} (entry : ZFSet.pair i a ∈ run.stageGraph) : + ∃ linked : GroundLinkedMainStage M K Labels C D rD, linked.code = a := by + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source entry) + exact ⟨run.linked j, ((run.stageGraph_entry j a).1 entry).symm⟩ + +theorem transitionGraph_valid {i j a b z : ZFSet.{u}} + (first : ZFSet.pair i a ∈ run.stageGraph) (second : ZFSet.pair j b ∈ run.stageGraph) + (entry : ZFSet.pair (ZFSet.pair j i) z ∈ run.transitionGraph) : + LinkedMainTransitionCode M K Labels C D rD a b z := by + obtain ⟨s, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source first) + obtain ⟨t, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source second) + have order := ((pair_mem_chronologyPairs _ _ _).1 + (run.transitionGraph_function.pair_source entry)).2.2 + have before := (run.key_order s t).2 order + rw [(run.stageGraph_entry s a).1 first, (run.stageGraph_entry t b).1 second, + (run.transitionGraph_entry before z).1 entry] + exact run.linked_transition_code before + +theorem transitionGraph_identity {i p a : ZFSet.{u}} + (entry : ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ run.transitionGraph) : + GraphDiagonalCode p ∧ GraphDiagonalCode a := by + have domain := (pair_mem_chronologyPairs _ _ _).1 (run.transitionGraph_function.pair_source entry) + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 domain.1 + have equal := (run.transitionGraph_entry (le_refl j) (ZFSet.pair p a)).1 entry + rw [run.diagram.self] at equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨graphDiagonalCode_identity _, graphDiagonalCode_identity _⟩ + +theorem transitionGraph_composition {i j k p₁ a₁ p₂ a₂ p₃ a₃ : ZFSet.{u}} + (first : ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ run.transitionGraph) + (second : ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ run.transitionGraph) + (third : ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ run.transitionGraph) : + GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ := by + have domain₁ := (pair_mem_chronologyPairs _ _ _).1 (run.transitionGraph_function.pair_source first) + have domain₂ := (pair_mem_chronologyPairs _ _ _).1 (run.transitionGraph_function.pair_source second) + obtain ⟨s, rfl⟩ := ZFSet.mem_range.1 domain₁.2.1 + obtain ⟨t, rfl⟩ := ZFSet.mem_range.1 domain₁.1 + obtain ⟨v, rfl⟩ := ZFSet.mem_range.1 domain₂.1 + have before₁ := (run.key_order s t).2 domain₁.2.2 + have before₂ := (run.key_order t v).2 domain₂.2.2 + have equal₁ := (run.transitionGraph_entry before₁ _).1 first + have equal₂ := (run.transitionGraph_entry before₂ _).1 second + have equal₃ := (run.transitionGraph_entry (le_trans before₁ before₂) _).1 third + rw [run.diagram.comp before₁ before₂] at equal₃ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal₁ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal₂ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal₃ + exact ⟨graphCompositionCode_relationCompose + (run.diagram.transition before₁).map.point_embedding.injection.function + (run.diagram.transition before₂).map.point_embedding.injection.function, + graphCompositionCode_relationCompose + (run.diagram.transition before₁).map.group_embedding.injection.function + (run.diagram.transition before₂).map.group_embedding.injection.function⟩ + +theorem graph_code : MainPrefixGraphCode M K Labels C D rD run.indices run.stageGraph run.transitionGraph where + ordinal := run.indices_ordinal + stages := run.stageGraph_function + transitions := run.transitionGraph_function + stage_valid := fun _ _ entry => run.stageGraph_valid entry + transition_valid := fun _ _ _ _ _ first second entry => run.transitionGraph_valid first second entry + identity := fun _ _ _ entry => run.transitionGraph_identity entry + composition := fun _ _ _ _ _ _ _ _ _ first second third => run.transitionGraph_composition first second third + +end GroundMainPrefix + +section +open SetFormula +universe u + +noncomputable def mainPrefixCode (T S E : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 2 (Fin.cases T (Fin.cases S (fun _ => E))) + +theorem mainPrefixCode_inj {T S E T' S' E' : ZFSet.{u}} : + mainPrefixCode T S E = mainPrefixCode T' S' E' ↔ T = T' ∧ S = S' ∧ E = E' := by + constructor + · intro equal + have fields := nonemptyTupleCode_injective 2 equal + exact ⟨congrFun fields 0, congrFun fields 1, congrFun fields 2⟩ + · rintro ⟨rfl, rfl, rfl⟩ + rfl + +def MainPrefixCode (M : TransitiveGround.{u}) (K Labels C D rD z : ZFSet.{u}) : Prop := + ∃ T S E, z = mainPrefixCode T S E ∧ MainPrefixGraphCode M K Labels C D rD T S E + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem mainPrefixCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {T S E : ZFSet.{u}} (hT : T ∈ M.sets) (hS : S ∈ M.sets) (hE : E ∈ M.sets) : + mainPrefixCode T S E ∈ M.sets := + M.nonemptyTupleCode_mem pairing 2 _ (Fin.cases hT (Fin.cases hS (fun _ => hE))) + +theorem mainPrefixCode_fields_mem {T S E : ZFSet.{u}} (ground : mainPrefixCode T S E ∈ M.sets) : + T ∈ M.sets ∧ S ∈ M.sets ∧ E ∈ M.sets := by + let fields : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) + have encoded : nonemptyTupleCode 2 fields ∈ M.sets := ground + have each := M.nonemptyTupleCode_field_mem 2 fields encoded + exact ⟨each 0, each 1, each 2⟩ + +end TransitiveGround + +namespace BoundedFormula + +def mainPrefixTupleFormula {n} (z T S E : Fin n) : BoundedFormula n := + nonemptyTupleFormula 2 z (Fin.cases T (Fin.cases S (fun _ => E))) + +theorem truth_mainPrefixTupleFormula {n} (z T S E : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (mainPrefixTupleFormula z T S E) env ↔ env z = mainPrefixCode (env T) (env S) (env E) := by + rw [mainPrefixTupleFormula, truth_nonemptyTupleFormula] + have map : (fun j : Fin 3 => env (Fin.cases T (Fin.cases S (fun _ => E)) j)) = + Fin.cases (env T) (Fin.cases (env S) (fun _ => env E)) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (fun _ => rfl)) j + rw [map] + rfl + +theorem realize_mainPrefixTupleFormula (M : TransitiveGround.{u}) {n} + (z T S E : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixTupleFormula z T S E).toFormula env ↔ + env z = mainPrefixCode (env T) (env S) (env E) := + (realize_toFormula M _ env members).trans (truth_mainPrefixTupleFormula z T S E env) + +end BoundedFormula + +end + +namespace MainPrefixGraphCode +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD T S E : ZFSet.{u}} +variable (raw : MainPrefixGraphCode M K Labels C D rD T S E) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +theorem decodedTransition_self (i : SetMembers T) : + raw.decodedTransition i i (Or.inl rfl) = + GroundChronologicalMainTransition.identity pairing unions powers separation (raw.decodedLinked i).main := by + have diagonal := raw.identity (SetMembers.raw i) _ _ (raw.decodedTransition_entry i i (Or.inl rfl)) + apply GroundChronologicalMainTransition.ext + apply GroundMainTransition.ext + · exact diagonal.1.eq_identityFunctionGraph + (raw.decodedTransition i i (Or.inl rfl)).map.point_embedding.injection.function + · exact diagonal.2.eq_identityFunctionGraph + (raw.decodedTransition i i (Or.inl rfl)).map.group_embedding.injection.function + +theorem decodedTransition_comp (i j k : SetMembers T) + (first : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j) + (second : SetMembers.raw j = SetMembers.raw k ∨ SetMembers.raw j ∈ SetMembers.raw k) : + raw.decodedTransition i k ((ordinalMainIndexPreorder raw.ordinal).le_trans i j k first second) = + (raw.decodedTransition i j first).comp pairing unions powers separation (raw.decodedTransition j k second) := by + have direct := (ordinalMainIndexPreorder raw.ordinal).le_trans i j k first second + have coherent := raw.composition (SetMembers.raw i) (SetMembers.raw j) (SetMembers.raw k) + _ _ _ _ _ _ (raw.decodedTransition_entry i j first) (raw.decodedTransition_entry j k second) + (raw.decodedTransition_entry i k direct) + apply GroundChronologicalMainTransition.ext + apply GroundMainTransition.ext + · exact coherent.1.eq_relationCompose + (raw.decodedTransition i j first).map.point_embedding.injection.function + (raw.decodedTransition i k direct).map.point_embedding.injection.function.1 + · exact coherent.2.eq_relationCompose + (raw.decodedTransition i j first).map.group_embedding.injection.function + (raw.decodedTransition i k direct).map.group_embedding.injection.function.1 + +noncomputable def decodedDiagram : + letI := ordinalMainIndexPreorder raw.ordinal + GroundChronologicalMainDiagram M C D rD pairing unions powers separation (SetMembers T) := by + let := ordinalMainIndexPreorder raw.ordinal + exact { + stage := fun i => (raw.decodedLinked i).main + transition := fun {i j} before => raw.decodedTransition i j before + self := raw.decodedTransition_self pairing unions powers separation + comp := fun {i j k} first second => raw.decodedTransition_comp pairing unions powers separation i j k first second + } + +theorem decodedDiagram_coverage : + letI := ordinalMainIndexPreorder raw.ordinal + (raw.decodedDiagram pairing unions powers separation).CoversOldBirths := by + let := ordinalMainIndexPreorder raw.ordinal + exact fun {i j} before => raw.decodedTransition_coverage i j before + +end MainPrefixGraphCode + +section +universe u + +def MainPrefixExtends (old next : ZFSet.{u}) : Prop := + ∃ T S E T' S' E', old = mainPrefixCode T S E ∧ next = mainPrefixCode T' S' E' ∧ + T ⊆ T' ∧ S ⊆ S' ∧ E ⊆ E' + +theorem mainPrefixExtends_iff {T S E T' S' E' : ZFSet.{u}} : + MainPrefixExtends (mainPrefixCode T S E) (mainPrefixCode T' S' E') ↔ + T ⊆ T' ∧ S ⊆ S' ∧ E ⊆ E' := by + constructor + · rintro ⟨A, B, C, A', B', C', first, second, indices, stages, transitions⟩ + obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 first + obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 second + exact ⟨indices, stages, transitions⟩ + · rintro ⟨indices, stages, transitions⟩ + exact ⟨T, S, E, T', S', E', rfl, rfl, indices, stages, transitions⟩ + +theorem MainPrefixExtends.refl (T S E : ZFSet.{u}) : + MainPrefixExtends (mainPrefixCode T S E) (mainPrefixCode T S E) := + mainPrefixExtends_iff.2 ⟨fun _ h => h, fun _ h => h, fun _ h => h⟩ + +theorem MainPrefixExtends.trans {a b c : ZFSet.{u}} + (first : MainPrefixExtends a b) (second : MainPrefixExtends b c) : MainPrefixExtends a c := by + obtain ⟨T, S, E, U, F, G, rfl, hb, indices, stages, transitions⟩ := first + obtain ⟨U', F', G', V, H, J, hb', rfl, indices', stages', transitions'⟩ := second + obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 (hb.symm.trans hb') + exact mainPrefixExtends_iff.2 ⟨fun _ h => indices' (indices h), + fun _ h => stages' (stages h), fun _ h => transitions' (transitions h)⟩ + +theorem MainPrefixExtends.antisymm {a b : ZFSet.{u}} + (first : MainPrefixExtends a b) (second : MainPrefixExtends b a) : a = b := by + obtain ⟨T, S, E, U, F, G, rfl, rfl, indices, stages, transitions⟩ := first + obtain ⟨indices', stages', transitions'⟩ := mainPrefixExtends_iff.1 second + exact mainPrefixCode_inj.2 ⟨ZFSet.ext fun _ => ⟨fun h => indices h, fun h => indices' h⟩, + ZFSet.ext fun _ => ⟨fun h => stages h, fun h => stages' h⟩, + ZFSet.ext fun _ => ⟨fun h => transitions h, fun h => transitions' h⟩⟩ + +theorem FunctionGraphOn.restriction_eq_of_subset {A B f g : ZFSet.{u}} + (first : FunctionGraphOn A f) (second : FunctionGraphOn B g) (subset : f ⊆ g) : + graphRestriction A g = f := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz + obtain ⟨w, old⟩ := first.total hx + have equal := second.unique entry (subset old) + exact equal.symm ▸ old + · intro hz + obtain ⟨x, hx, y, rfl⟩ := first.shape _ hz + exact pair_mem_graphRestriction.2 ⟨subset hz, hx⟩ + +theorem mainPrefixExtends_iff_restrictions + {M : TransitiveGround.{u}} {K Labels C D rD T S E T' S' E' : ZFSet.{u}} + (old : MainPrefixGraphCode M K Labels C D rD T S E) + (next : MainPrefixGraphCode M K Labels C D rD T' S' E') : + MainPrefixExtends (mainPrefixCode T S E) (mainPrefixCode T' S' E') ↔ + T ⊆ T' ∧ graphRestriction T S' = S ∧ graphRestriction (chronologyPairs T) E' = E := by + rw [mainPrefixExtends_iff] + constructor + · rintro ⟨indices, stages, transitions⟩ + exact ⟨indices, old.stages.restriction_eq_of_subset next.stages stages, + old.transitions.restriction_eq_of_subset next.transitions transitions⟩ + · rintro ⟨indices, stages, transitions⟩ + exact ⟨indices, stages ▸ graphRestriction_subset T S', + transitions ▸ graphRestriction_subset (chronologyPairs T) E'⟩ + +end + +namespace MainPrefixGraphCode +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD T S E : ZFSet.{u}} +variable (raw : MainPrefixGraphCode M K Labels C D rD T S E) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hT : T ∈ M.sets) (hS : S ∈ M.sets) (hE : E ∈ M.sets) + +noncomputable def decodedPrefix : + letI := ordinalMainIndexPreorder raw.ordinal + GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T) := by + let := ordinalMainIndexPreorder raw.ordinal + exact { + key := SetMembers.raw + key_injective := SetMembers.raw_injective T + key_order := fun i j => ordinalMainIndex_le_iff raw.ordinal i j + indices_ground := (ordinalMainIndex_key_range T).symm ▸ hT + indices_ordinal := (ordinalMainIndex_key_range T).symm ▸ raw.ordinal + diagram := raw.decodedDiagram pairing unions powers separation + linked := raw.decodedLinked + linked_main := fun _ => rfl + coverage := raw.decodedDiagram_coverage pairing unions powers separation + stages_ground := familyCodeGraph_ground_of_entries hS raw.stages _ _ + (ordinalMainIndex_key_range T) raw.decodedLinked_entry + transitions_ground := familyCodeGraph_ground_of_entries hE raw.transitions _ _ + (ordinalMainTransitionIndex_range raw.ordinal) + (fun p => raw.decodedTransition_entry p.val.1 p.val.2 p.property) + } + +theorem decodedPrefix_indices : + letI := ordinalMainIndexPreorder raw.ordinal + (raw.decodedPrefix pairing unions powers separation hT hS hE).indices = T := + ordinalMainIndex_key_range T + +theorem decodedPrefix_stageGraph : + letI := ordinalMainIndexPreorder raw.ordinal + (raw.decodedPrefix pairing unions powers separation hT hS hE).stageGraph = S := + familyCodeGraph_eq_of_entries raw.stages _ _ (ordinalMainIndex_key_range T) raw.decodedLinked_entry + +theorem decodedPrefix_transitionGraph : + letI := ordinalMainIndexPreorder raw.ordinal + (raw.decodedPrefix pairing unions powers separation hT hS hE).transitionGraph = E := by + let := ordinalMainIndexPreorder raw.ordinal + exact familyCodeGraph_eq_of_entries raw.transitions _ _ (ordinalMainTransitionIndex_range raw.ordinal) + (fun p => raw.decodedTransition_entry p.val.1 p.val.2 p.property) + +theorem decodedPrefix_code : + letI := ordinalMainIndexPreorder raw.ordinal + (raw.decodedPrefix pairing unions powers separation hT hS hE).code = + nonemptyTupleCode 2 (Fin.cases T (Fin.cases S (fun _ => E))) := by + let := ordinalMainIndexPreorder raw.ordinal + unfold GroundMainPrefix.code + rw [raw.decodedPrefix_indices, raw.decodedPrefix_stageGraph, raw.decodedPrefix_transitionGraph] + +end MainPrefixGraphCode + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixExtensionRelations.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixExtensionRelations.lean index 7f72d3fe00942364b244c5e2dd180260e5e08003..79c9436a178e019805f20bfdbdfc09cfbd59105d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixExtensionRelations.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixExtensionRelations.lean @@ -1,66 +1,66 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u v - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def mainPrefixExtensionRelation (B : ZFSet.{u}) : ZFSet.{u} := - M.definableRelation (mainPrefixExtensionFormula (0 : Fin 2) 1) Fin.elim0 B B - -theorem mainPrefixExtensionRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {B : ZFSet.{u}} (hB : B ∈ M.sets) : M.mainPrefixExtensionRelation B ∈ M.sets := - M.definableRelation_mem pairing unions powers separation - (mainPrefixExtensionFormula (0 : Fin 2) 1) Fin.elim0 (fun i => Fin.elim0 i) hB hB - -theorem mainPrefixExtensionRelation_entry {B : ZFSet.{u}} (hB : B ∈ M.sets) - (old next : ZFSet.{u}) : - ZFSet.pair old next ∈ M.mainPrefixExtensionRelation B ↔ - old ∈ B ∧ next ∈ B ∧ MainPrefixExtends old next := by - rw [mainPrefixExtensionRelation, M.pair_mem_definableRelation] - constructor - · rintro ⟨ho, hn, relation⟩ - exact ⟨ho, hn, (M.realize_mainPrefixExtensionFormula 0 1 _ - (Fin.cases (M.transitive hB ho) (Fin.cases (M.transitive hB hn) (fun i => Fin.elim0 i)))).1 relation⟩ - · rintro ⟨ho, hn, relation⟩ - exact ⟨ho, hn, (M.realize_mainPrefixExtensionFormula 0 1 _ - (Fin.cases (M.transitive hB ho) (Fin.cases (M.transitive hB hn) (fun i => Fin.elim0 i)))).2 relation⟩ - -end TransitiveGround - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem appendCone_extends (target : GroundLinkedMainStage M K Labels C D rD) - (cone : run.diagram.Cone target.main) {row : ZFSet.{u}} (ground : row ∈ M.sets) - (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) - (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) - (covered : cone.append.CoversOldBirths) : - MainPrefixExtends run.code (run.appendCone target cone ground function entries covered).code := by - let extended := run.appendCone target cone ground function entries covered - apply (mainPrefixExtends_iff_restrictions run.graph_code extended.graph_code).2 - refine ⟨?_, run.appendCone_stageGraph_restrict target cone ground function entries covered, - run.appendCone_transitionGraph_restrict target cone ground function entries covered⟩ - rw [run.appendCone_indices target cone ground function entries covered] - exact fun _ h => ZFSet.mem_insert_of_mem _ h - -end GroundMainPrefix -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u v + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def mainPrefixExtensionRelation (B : ZFSet.{u}) : ZFSet.{u} := + M.definableRelation (mainPrefixExtensionFormula (0 : Fin 2) 1) Fin.elim0 B B + +theorem mainPrefixExtensionRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {B : ZFSet.{u}} (hB : B ∈ M.sets) : M.mainPrefixExtensionRelation B ∈ M.sets := + M.definableRelation_mem pairing unions powers separation + (mainPrefixExtensionFormula (0 : Fin 2) 1) Fin.elim0 (fun i => Fin.elim0 i) hB hB + +theorem mainPrefixExtensionRelation_entry {B : ZFSet.{u}} (hB : B ∈ M.sets) + (old next : ZFSet.{u}) : + ZFSet.pair old next ∈ M.mainPrefixExtensionRelation B ↔ + old ∈ B ∧ next ∈ B ∧ MainPrefixExtends old next := by + rw [mainPrefixExtensionRelation, M.pair_mem_definableRelation] + constructor + · rintro ⟨ho, hn, relation⟩ + exact ⟨ho, hn, (M.realize_mainPrefixExtensionFormula 0 1 _ + (Fin.cases (M.transitive hB ho) (Fin.cases (M.transitive hB hn) (fun i => Fin.elim0 i)))).1 relation⟩ + · rintro ⟨ho, hn, relation⟩ + exact ⟨ho, hn, (M.realize_mainPrefixExtensionFormula 0 1 _ + (Fin.cases (M.transitive hB ho) (Fin.cases (M.transitive hB hn) (fun i => Fin.elim0 i)))).2 relation⟩ + +end TransitiveGround + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem appendCone_extends (target : GroundLinkedMainStage M K Labels C D rD) + (cone : run.diagram.Cone target.main) {row : ZFSet.{u}} (ground : row ∈ M.sets) + (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) + (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) + (covered : cone.append.CoversOldBirths) : + MainPrefixExtends run.code (run.appendCone target cone ground function entries covered).code := by + let extended := run.appendCone target cone ground function entries covered + apply (mainPrefixExtends_iff_restrictions run.graph_code extended.graph_code).2 + refine ⟨?_, run.appendCone_stageGraph_restrict target cone ground function entries covered, + run.appendCone_transitionGraph_restrict target cone ground function entries covered⟩ + rw [run.appendCone_indices target cone ground function entries covered] + exact fun _ h => ZFSet.mem_insert_of_mem _ h + +end GroundMainPrefix +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFieldFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFieldFamilies.lean index 4c36be8d47a04f0ca06b512503347b9c6b2fa4c3..09ad49af10444612bf6d240261cbe91b5302bd1a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFieldFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFieldFamilies.lean @@ -1,131 +1,131 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem indices_rank_le_code : ZFSet.rank run.indices ≤ ZFSet.rank run.code := by - simpa only [code, Fin.cases_zero] using - (rank_nonemptyTupleCode_field_le 2 - (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) 0) - -theorem stageGraph_rank_le_code : ZFSet.rank run.stageGraph ≤ ZFSet.rank run.code := by - simpa only [code, Fin.cases_zero, Fin.cases_succ] using - (rank_nonemptyTupleCode_field_le 2 - (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) (0 : Fin 2).succ) - -theorem transitionGraph_rank_le_code : ZFSet.rank run.transitionGraph ≤ ZFSet.rank run.code := by - simpa only [code, Fin.cases_zero, Fin.cases_succ] using - (rank_nonemptyTupleCode_field_le 2 - (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) (0 : Fin 1).succ.succ) - -theorem key_rank_lt_code (i : I) : ZFSet.rank (run.key i) < ZFSet.rank run.code := - (ZFSet.rank_lt_of_mem (show run.key i ∈ run.indices from ZFSet.mem_range.2 ⟨i, rfl⟩)).trans_le - run.indices_rank_le_code - -theorem linkedCode_rank_lt_code (i : I) : ZFSet.rank (run.linked i).code < ZFSet.rank run.code := - (ZFSet.rank_lt_of_mem (pair_second_mem_doubleUnion ((run.stageGraph_entry i _).2 rfl))).trans_le - (((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans run.stageGraph_rank_le_code) - -theorem mapCode_rank_lt_code {i j : I} (before : i ≤ j) : - ZFSet.rank (run.diagram.transition before).map.code < ZFSet.rank run.code := - (ZFSet.rank_lt_of_mem (pair_second_mem_doubleUnion ((run.transitionGraph_entry before _).2 rfl))).trans_le - (((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans run.transitionGraph_rank_le_code) - -noncomputable def stageFieldFamily (j : Fin 11) : ZFSet.{u} := - familyCodeGraph run.key (fun i => (run.diagram.stage i).stage.field j) - -noncomputable def carrierFamily : ZFSet.{u} := run.stageFieldFamily 0 - -noncomputable def actorFamily : ZFSet.{u} := run.stageFieldFamily 3 - -noncomputable def pointMapFamily : ZFSet.{u} := - familyCodeGraph (mainTransitionIndexKey run.key) (fun p => (run.diagram.transition p.property).map.points) - -noncomputable def actorMapFamily : ZFSet.{u} := - familyCodeGraph (mainTransitionIndexKey run.key) (fun p => (run.diagram.transition p.property).map.actors) - -theorem stageFieldFamily_ground (j : Fin 11) : run.stageFieldFamily j ∈ M.sets := by - have stageCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).main.stage.code) - (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) - run.key_injective run.indices_ground run.stages_ground).1 - have codes : familyCodeGraph run.key (fun i => (run.diagram.stage i).stage.code) ∈ M.sets := by - simpa only [run.linked_main] using stageCodes - exact M.familyCodeGraph_tuple_fields pairing unions powers separation run.key run.key_injective - run.indices_ground 10 (fun i => (run.diagram.stage i).stage.field) codes j - -theorem carrierFamily_ground : run.carrierFamily ∈ M.sets := run.stageFieldFamily_ground 0 - -theorem actorFamily_ground : run.actorFamily ∈ M.sets := run.stageFieldFamily_ground 3 - -theorem mapFamilies_ground : run.pointMapFamily ∈ M.sets ∧ run.actorMapFamily ∈ M.sets := by - have domain : ZFSet.range (mainTransitionIndexKey run.key) ∈ M.sets := by - rw [mainTransitionIndex_range run.key run.key_order] - exact M.chronologyPairs_mem pairing unions powers separation run.indices_ground - exact M.familyCodeGraph_pair_projections pairing unions powers separation - (mainTransitionIndexKey run.key) _ _ (mainTransitionIndexKey_injective run.key run.key_injective) - domain run.transitions_ground - -theorem pointMapFamily_ground : run.pointMapFamily ∈ M.sets := run.mapFamilies_ground.1 - -theorem actorMapFamily_ground : run.actorMapFamily ∈ M.sets := run.mapFamilies_ground.2 - -theorem stageFieldFamily_function (j : Fin 11) : FunctionGraphOn run.indices (run.stageFieldFamily j) := - familyCodeGraph_function run.key _ run.key_injective - -theorem carrierFamily_function : FunctionGraphOn run.indices run.carrierFamily := - run.stageFieldFamily_function 0 - -theorem actorFamily_function : FunctionGraphOn run.indices run.actorFamily := - run.stageFieldFamily_function 3 - -theorem pointMapFamily_function : FunctionGraphOn (chronologyPairs run.indices) run.pointMapFamily := by - have function := familyCodeGraph_function (mainTransitionIndexKey run.key) - (fun p => (run.diagram.transition p.property).map.points) - (mainTransitionIndexKey_injective run.key run.key_injective) - rw [mainTransitionIndex_range run.key run.key_order] at function - exact function - -theorem actorMapFamily_function : FunctionGraphOn (chronologyPairs run.indices) run.actorMapFamily := by - have function := familyCodeGraph_function (mainTransitionIndexKey run.key) - (fun p => (run.diagram.transition p.property).map.actors) - (mainTransitionIndexKey_injective run.key run.key_injective) - rw [mainTransitionIndex_range run.key run.key_order] at function - exact function - -theorem stageFieldFamily_entry (j : Fin 11) (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.stageFieldFamily j ↔ z = (run.diagram.stage i).stage.field j := - pair_mem_familyCodeGraph run.key _ run.key_injective i z - -theorem carrierFamily_entry (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.carrierFamily ↔ z = (run.diagram.stage i).stage.carrier := - run.stageFieldFamily_entry 0 i z - -theorem actorFamily_entry (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.actorFamily ↔ z = (run.diagram.stage i).stage.actors := - run.stageFieldFamily_entry 3 i z - -theorem pointMapFamily_entry {i j : I} (before : i ≤ j) (z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.pointMapFamily ↔ - z = (run.diagram.transition before).map.points := - pair_mem_familyCodeGraph (mainTransitionIndexKey run.key) _ - (mainTransitionIndexKey_injective run.key run.key_injective) ⟨(i, j), before⟩ z - -theorem actorMapFamily_entry {i j : I} (before : i ≤ j) (z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.actorMapFamily ↔ - z = (run.diagram.transition before).map.actors := - pair_mem_familyCodeGraph (mainTransitionIndexKey run.key) _ - (mainTransitionIndexKey_injective run.key run.key_injective) ⟨(i, j), before⟩ z - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.CodedMainPrefixSystems + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem indices_rank_le_code : ZFSet.rank run.indices ≤ ZFSet.rank run.code := by + simpa only [code, Fin.cases_zero] using + (rank_nonemptyTupleCode_field_le 2 + (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) 0) + +theorem stageGraph_rank_le_code : ZFSet.rank run.stageGraph ≤ ZFSet.rank run.code := by + simpa only [code, Fin.cases_zero, Fin.cases_succ] using + (rank_nonemptyTupleCode_field_le 2 + (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) (0 : Fin 2).succ) + +theorem transitionGraph_rank_le_code : ZFSet.rank run.transitionGraph ≤ ZFSet.rank run.code := by + simpa only [code, Fin.cases_zero, Fin.cases_succ] using + (rank_nonemptyTupleCode_field_le 2 + (Fin.cases run.indices (Fin.cases run.stageGraph (fun _ => run.transitionGraph))) (0 : Fin 1).succ.succ) + +theorem key_rank_lt_code (i : I) : ZFSet.rank (run.key i) < ZFSet.rank run.code := + (ZFSet.rank_lt_of_mem (show run.key i ∈ run.indices from ZFSet.mem_range.2 ⟨i, rfl⟩)).trans_le + run.indices_rank_le_code + +theorem linkedCode_rank_lt_code (i : I) : ZFSet.rank (run.linked i).code < ZFSet.rank run.code := + (ZFSet.rank_lt_of_mem (pair_second_mem_doubleUnion ((run.stageGraph_entry i _).2 rfl))).trans_le + (((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans run.stageGraph_rank_le_code) + +theorem mapCode_rank_lt_code {i j : I} (before : i ≤ j) : + ZFSet.rank (run.diagram.transition before).map.code < ZFSet.rank run.code := + (ZFSet.rank_lt_of_mem (pair_second_mem_doubleUnion ((run.transitionGraph_entry before _).2 rfl))).trans_le + (((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans run.transitionGraph_rank_le_code) + +noncomputable def stageFieldFamily (j : Fin 11) : ZFSet.{u} := + familyCodeGraph run.key (fun i => (run.diagram.stage i).stage.field j) + +noncomputable def carrierFamily : ZFSet.{u} := run.stageFieldFamily 0 + +noncomputable def actorFamily : ZFSet.{u} := run.stageFieldFamily 3 + +noncomputable def pointMapFamily : ZFSet.{u} := + familyCodeGraph (mainTransitionIndexKey run.key) (fun p => (run.diagram.transition p.property).map.points) + +noncomputable def actorMapFamily : ZFSet.{u} := + familyCodeGraph (mainTransitionIndexKey run.key) (fun p => (run.diagram.transition p.property).map.actors) + +theorem stageFieldFamily_ground (j : Fin 11) : run.stageFieldFamily j ∈ M.sets := by + have stageCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).main.stage.code) + (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) + run.key_injective run.indices_ground run.stages_ground).1 + have codes : familyCodeGraph run.key (fun i => (run.diagram.stage i).stage.code) ∈ M.sets := by + simpa only [run.linked_main] using stageCodes + exact M.familyCodeGraph_tuple_fields pairing unions powers separation run.key run.key_injective + run.indices_ground 10 (fun i => (run.diagram.stage i).stage.field) codes j + +theorem carrierFamily_ground : run.carrierFamily ∈ M.sets := run.stageFieldFamily_ground 0 + +theorem actorFamily_ground : run.actorFamily ∈ M.sets := run.stageFieldFamily_ground 3 + +theorem mapFamilies_ground : run.pointMapFamily ∈ M.sets ∧ run.actorMapFamily ∈ M.sets := by + have domain : ZFSet.range (mainTransitionIndexKey run.key) ∈ M.sets := by + rw [mainTransitionIndex_range run.key run.key_order] + exact M.chronologyPairs_mem pairing unions powers separation run.indices_ground + exact M.familyCodeGraph_pair_projections pairing unions powers separation + (mainTransitionIndexKey run.key) _ _ (mainTransitionIndexKey_injective run.key run.key_injective) + domain run.transitions_ground + +theorem pointMapFamily_ground : run.pointMapFamily ∈ M.sets := run.mapFamilies_ground.1 + +theorem actorMapFamily_ground : run.actorMapFamily ∈ M.sets := run.mapFamilies_ground.2 + +theorem stageFieldFamily_function (j : Fin 11) : FunctionGraphOn run.indices (run.stageFieldFamily j) := + familyCodeGraph_function run.key _ run.key_injective + +theorem carrierFamily_function : FunctionGraphOn run.indices run.carrierFamily := + run.stageFieldFamily_function 0 + +theorem actorFamily_function : FunctionGraphOn run.indices run.actorFamily := + run.stageFieldFamily_function 3 + +theorem pointMapFamily_function : FunctionGraphOn (chronologyPairs run.indices) run.pointMapFamily := by + have function := familyCodeGraph_function (mainTransitionIndexKey run.key) + (fun p => (run.diagram.transition p.property).map.points) + (mainTransitionIndexKey_injective run.key run.key_injective) + rw [mainTransitionIndex_range run.key run.key_order] at function + exact function + +theorem actorMapFamily_function : FunctionGraphOn (chronologyPairs run.indices) run.actorMapFamily := by + have function := familyCodeGraph_function (mainTransitionIndexKey run.key) + (fun p => (run.diagram.transition p.property).map.actors) + (mainTransitionIndexKey_injective run.key run.key_injective) + rw [mainTransitionIndex_range run.key run.key_order] at function + exact function + +theorem stageFieldFamily_entry (j : Fin 11) (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.stageFieldFamily j ↔ z = (run.diagram.stage i).stage.field j := + pair_mem_familyCodeGraph run.key _ run.key_injective i z + +theorem carrierFamily_entry (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.carrierFamily ↔ z = (run.diagram.stage i).stage.carrier := + run.stageFieldFamily_entry 0 i z + +theorem actorFamily_entry (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.actorFamily ↔ z = (run.diagram.stage i).stage.actors := + run.stageFieldFamily_entry 3 i z + +theorem pointMapFamily_entry {i j : I} (before : i ≤ j) (z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.pointMapFamily ↔ + z = (run.diagram.transition before).map.points := + pair_mem_familyCodeGraph (mainTransitionIndexKey run.key) _ + (mainTransitionIndexKey_injective run.key run.key_injective) ⟨(i, j), before⟩ z + +theorem actorMapFamily_entry {i j : I} (before : i ≤ j) (z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.actorMapFamily ↔ + z = (run.diagram.transition before).map.actors := + pair_mem_familyCodeGraph (mainTransitionIndexKey run.key) _ + (mainTransitionIndexKey_injective run.key run.key_injective) ⟨(i, j), before⟩ z + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalDirectedness.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalDirectedness.lean index 93fcb631be29c713513e65b9a077a94c4b18084c..0bf9407047e588c8ee9a67001fe90c67952a1777 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalDirectedness.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalDirectedness.lean @@ -1,34 +1,34 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitBottom - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitPoints_directed {x y : ZFSet.{u}} - (hx : x ∈ run.limitPoints) (hy : y ∈ run.limitPoints) : - ∃ z ∈ run.limitPoints, ZFSet.pair x z ∈ run.limitOrder ∧ - ZFSet.pair y z ∈ run.limitOrder := by - obtain ⟨i, a, b, ha, hb, rfl, rfl⟩ := run.pointPresentation.pair_coverage hx hy - have ht := (run.diagram.stage i).stage.top_mem - refine ⟨run.pointPresentation.limitPoint i (run.diagram.stage i).stage.top, - run.pointPresentation.limitPoint_mem ht, ?_, ?_⟩ - · exact (run.limitOrder_entry _ _).2 ((run.limitLE_at i ha ht).2 - ((run.diagram.stage i).stage.greatest a ha)) - · exact (run.limitOrder_entry _ _).2 ((run.limitLE_at i hb ht).2 - ((run.diagram.stage i).stage.greatest b hb)) - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitBottom + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitPoints_directed {x y : ZFSet.{u}} + (hx : x ∈ run.limitPoints) (hy : y ∈ run.limitPoints) : + ∃ z ∈ run.limitPoints, ZFSet.pair x z ∈ run.limitOrder ∧ + ZFSet.pair y z ∈ run.limitOrder := by + obtain ⟨i, a, b, ha, hb, rfl, rfl⟩ := run.pointPresentation.pair_coverage hx hy + have ht := (run.diagram.stage i).stage.top_mem + refine ⟨run.pointPresentation.limitPoint i (run.diagram.stage i).stage.top, + run.pointPresentation.limitPoint_mem ht, ?_, ?_⟩ + · exact (run.limitOrder_entry _ _).2 ((run.limitLE_at i ha ht).2 + ((run.diagram.stage i).stage.greatest a ha)) + · exact (run.limitOrder_entry _ _).2 ((run.limitLE_at i hb ht).2 + ((run.diagram.stage i).stage.greatest b hb)) + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalInsertion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalInsertion.lean index 8ed505e1ae34b581eef404e1b7c038069a7af75b..61fea844209b2df241caa23eb0c797f6f74074d4 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalInsertion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalInsertion.lean @@ -1,483 +1,483 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterPullbackRecovery -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixInsertionFamilyTransport -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedImageCovers -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalExtensionBases -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFinalStrictGrowth -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixInsertionSuccessors - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def pointStageCover : ZFSet.{u} := - indexedImageCover run.indices run.carrierUnion run.limitPoints run.limitPointInclusions - -theorem pointStageCover_ground : run.pointStageCover ∈ M.sets := - M.indexedImageCover_mem pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.limitPoints_ground run.limitPointInclusions_ground - -theorem pointStageCover_entry (i : I) (y : ZFSet.{u}) : - ZFSet.pair y (run.key i) ∈ run.pointStageCover ↔ - ∃ x ∈ (run.diagram.stage i).stage.carrier, ZFSet.pair x y ∈ run.limitPointMap i := by - rw [pointStageCover, pair_mem_indexedImageCover] - constructor - · rintro ⟨_, _, x, _, f, indexed, entry⟩ - have equal := (run.limitPointInclusions_entry i f).1 indexed - subst f - exact ⟨x, (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).1, entry⟩ - · rintro ⟨x, hx, entry⟩ - exact ⟨(ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2, - ZFSet.mem_range.2 ⟨i, rfl⟩, x, run.pointPresentation.carrier_bound i hx, - run.limitPointMap i, (run.limitPointInclusions_entry i _).2 rfl, entry⟩ - -theorem pointStageCover_total {y : ZFSet.{u}} (member : y ∈ run.limitPoints) : - ∃ i ∈ run.indices, ZFSet.pair y i ∈ run.pointStageCover := by - obtain ⟨i, x, hx, equal⟩ := run.pointPresentation.limitPoint_coverage member - exact ⟨run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, - (run.pointStageCover_entry i y).2 - ⟨x, hx, (run.pointPresentation.inclusion_entry i x y).2 ⟨hx, equal⟩⟩⟩ - -theorem exists_groundPointStageCover - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {X : ZFSet.{u}} (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) : - ∃ f ∈ M.sets, ZFSet.IsFunc X run.indices f ∧ f ⊆ run.pointStageCover ∧ - ∀ y t, ZFSet.pair y t ∈ f → ∃ i : I, run.key i = t ∧ - ∃ x ∈ (run.diagram.stage i).stage.carrier, ZFSet.pair x y ∈ run.limitPointMap i := by - obtain ⟨f, ground, function, included⟩ := - M.uniformize_relation pairing unions powers separation choice hX run.indices_ground - run.pointStageCover_ground (fun _ hy => run.pointStageCover_total (subset hy)) - refine ⟨f, ground, function, included, ?_⟩ - intro y t entry - have index := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 index - exact ⟨i, rfl, (run.pointStageCover_entry i y).1 (included entry)⟩ - -theorem finalInsertionFamilies_transport (j : I) - {caps actors c₀ d₀ c e d F : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hCaps : caps ∈ M.sets) (hActors : actors ∈ M.sets) - (capInjection : InjectionCode Labels (run.diagram.stage j).stage.carrier caps) - (actorInjection : InjectionCode Labels (run.diagram.stage j).stage.actors actors) - (imageC : ZFSet.pair c₀ c ∈ run.limitPointMap j) - (imageD : ZFSet.pair d₀ d ∈ run.limitPointMap j) - (fixes : ∀ label k, ZFSet.pair label k ∈ actors → - ∀ z ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair z c₀ ∈ (run.diagram.stage j).stage.order → - ZFSet.pair (ZFSet.pair k z) z ∈ (run.diagram.stage j).stage.action) - (dominates : ∀ label k cap, ZFSet.pair label k ∈ actors → ZFSet.pair label cap ∈ caps → - ∀ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair (ZFSet.pair k d₀) y ∈ (run.diagram.stage j).stage.action → - ZFSet.pair y cap ∈ (run.diagram.stage j).stage.order) - (profiles : ∀ label cap cap', ZFSet.pair label cap ∈ caps → - ZFSet.pair cap cap' ∈ run.limitPointMap j → - CodedCapProfile run.limitPoints run.limitOrder run.limitMeetGraph c e cap' F) - (meets : ∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ caps → - ZFSet.pair second cap₂ ∈ caps → first ≠ second → - ZFSet.pair (ZFSet.pair cap₁ cap₂) c₀ ∈ (run.diagram.stage j).stage.meetGraph) : - run.finalInsertionCaps j caps ∈ M.sets ∧ run.finalInsertionActors j actors ∈ M.sets ∧ - FinalInsertionFamiliesCode Labels run.limitPoints run.limitActors run.limitOrder - run.limitMeetGraph run.limitAction c e d F - (run.finalInsertionCaps j caps) (run.finalInsertionActors j actors) := by - refine ⟨run.finalInsertionCaps_ground j hLabels hCaps, - run.finalInsertionActors_ground j hLabels hActors, ?_⟩ - refine ⟨run.finalInsertionCaps_injection j capInjection, - run.finalInsertionActors_injection j actorInjection, ?_, ?_, ?_, ?_⟩ - · intro label k' entry - obtain ⟨k, oldActor, imageK⟩ := (run.finalInsertionActors_entry j actorInjection).1 entry - have agreement := ((run.diagram.stage j).stage.action_code.agreement_identity_iff_fixes).2 - (fixes label k oldActor) - have finalAgreement := run.limitMaps_agreement j k (run.diagram.stage j).stage.identity - k' (run.limitIdentity j) c₀ c imageK (run.limitActorMap_groupEmbedding j j).one imageC agreement - exact ((run.limitAction_code j).agreement_identity_iff_fixes).1 finalAgreement - · intro label k' cap' actorEntry capEntry y _ acted - obtain ⟨k, oldActor, imageK⟩ := (run.finalInsertionActors_entry j actorInjection).1 actorEntry - obtain ⟨cap, oldCap, imageCap⟩ := (run.finalInsertionCaps_entry j capInjection).1 capEntry - have hk := (ZFSet.pair_mem_prod.1 (actorInjection.function.1 oldActor)).2 - have hd₀ := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageD)).1 - obtain ⟨y₀, stageActed, _⟩ := (run.diagram.stage j).stage.action_code.function.2 - (ZFSet.pair k d₀) (ZFSet.pair_mem_prod.2 ⟨hk, hd₀⟩) - have hy₀ := (ZFSet.pair_mem_prod.1 ((run.diagram.stage j).stage.action_code.function.1 stageActed)).2 - obtain ⟨y', imageY, _⟩ := (run.limitPointMap_injection j).function.2 y₀ hy₀ - have targetActed := run.limitMaps_equivariant j k k' d₀ y₀ d y' imageK imageD imageY stageActed - have actionFunction : FunctionGraphOn (ZFSet.prod run.limitActors run.limitPoints) run.limitAction := - ⟨run.limitPoints, run.limitAction_function⟩ - have equal : y = y' := actionFunction.unique acted targetActed - rw [equal] - exact (run.limitPointMap_meetEmbedding j).monotone y₀ cap y' cap' - (dominates label k cap oldActor oldCap y₀ hy₀ stageActed) imageY imageCap - · intro label cap' entry - obtain ⟨cap, oldCap, imageCap⟩ := (run.finalInsertionCaps_entry j capInjection).1 entry - exact profiles label cap cap' oldCap imageCap - · intro first second cap₁' cap₂' firstEntry secondEntry different - obtain ⟨cap₁, firstCap, firstImage⟩ := (run.finalInsertionCaps_entry j capInjection).1 firstEntry - obtain ⟨cap₂, secondCap, secondImage⟩ := (run.finalInsertionCaps_entry j capInjection).1 secondEntry - exact (run.limitPointMap_meetEmbedding j).map_meet cap₁ cap₂ c₀ cap₁' cap₂' c - (meets first second cap₁ cap₂ firstCap secondCap different) firstImage secondImage imageC - -end GroundMainPrefix - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (indices : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) -include collection infinite choice indices - -theorem exists_countablePointStageCover {X : ZFSet.{u}} - (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) - (small : M.groundEmbeddable X ZFSet.omega) : - ∃ j : I, ∃ f ∈ M.sets, ZFSet.IsFunc X run.indices f ∧ f ⊆ run.pointStageCover ∧ - (∀ x t, ZFSet.pair x t ∈ f → t ∈ run.key j) ∧ - ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ run.limitPointMap j := by - obtain ⟨f, ground, function, included, covers⟩ := - run.exists_groundPointStageCover choice hX subset - have rangeGround := M.relationImage_mem separation hX run.indices_ground ground - have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice - hX run.indices_ground (M.omega_mem separation infinite) ground function small - have rangeSubset : relationImage X run.indices f ⊆ - M.groundOmegaOne pairing unions powers separation collection infinite := by - intro t ht - rw [← indices] - exact ((mem_relationImage _ _ _ _).1 ht).1 - obtain ⟨bound, inOmega, strict⟩ := M.groundOmegaOne_countable_bound - pairing unions powers separation collection infinite choice rangeGround rangeSubset rangeSmall - have inIndices : bound ∈ run.indices := by rw [indices]; exact inOmega - obtain ⟨j, equal⟩ := ZFSet.mem_range.1 inIndices - have strictEntry : ∀ x t, ZFSet.pair x t ∈ f → t ∈ run.key j := by - intro x t entry - rw [equal] - have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) - exact strict t ((mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, entry⟩) - refine ⟨j, f, ground, function, included, strictEntry, ?_⟩ - intro x hx - obtain ⟨t, entry, _⟩ := function.2 x hx - obtain ⟨i, key, y, hy, image⟩ := covers x t entry - have before : i ≤ j := (run.key_order i j).2 (Or.inr (by rw [key]; exact strictEntry x t entry)) - obtain ⟨z, transition⟩ := run.pointSystem.map_entry_total before hy - exact ⟨z, (run.pointSystem.map_entry_bounds before transition).2, - run.limitPointMap_later_entry before transition image⟩ - -theorem exists_countablePointLocalization {X : ZFSet.{u}} - (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) - (small : M.groundEmbeddable X ZFSet.omega) : - ∃ j : I, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair y x ∈ run.limitPointMap j := by - obtain ⟨j, _, _, _, _, _, covered⟩ := - run.exists_countablePointStageCover collection infinite choice indices hX subset small - exact ⟨j, covered⟩ - -theorem exists_countablePointUpperBound {X : ZFSet.{u}} - (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) - (small : M.groundEmbeddable X ZFSet.omega) : - ∃ j : I, ∃ b ∈ M.sets, b ∈ run.limitPoints ∧ - ZFSet.pair (run.diagram.stage j).stage.top b ∈ run.limitPointMap j ∧ - ∀ x ∈ X, ZFSet.pair x b ∈ run.limitOrder := by - obtain ⟨j, covered⟩ := - run.exists_countablePointLocalization collection infinite choice indices hX subset small - obtain ⟨b, image, _⟩ := (run.limitPointMap_injection j).function.2 - (run.diagram.stage j).stage.top (run.diagram.stage j).stage.top_mem - have member := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 image)).2 - refine ⟨j, b, M.transitive run.limitPoints_ground member, member, image, ?_⟩ - intro x hx - obtain ⟨y, hy, atStage⟩ := covered x hx - exact (run.limitPointMap_order_iff j y (run.diagram.stage j).stage.top x b atStage image).2 - ((run.diagram.stage j).stage.greatest y hy) - -end GroundMainPrefix - -section -universe u v - -namespace CodedCapProfile - -theorem of_pushFilter_eq {L r μ c E cap H e F : ZFSet.{u}} - (profile : CodedCapProfile L r μ c E cap (relationImage H L e)) - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (equal : pushFilterCode L r e H = F) : CodedCapProfile L r μ c E cap F := by - have positive_iff (x : ZFSet.{u}) (hx : x ∈ L) : - (∃ y ∈ relationImage H L e, ZFSet.pair y x ∈ r) ↔ x ∈ F := by - rw [← equal, mem_pushFilterCode] - constructor - · rintro ⟨y, hy, lower⟩ - obtain ⟨hyL, h, hh, image⟩ := (mem_relationImage H L e y).1 hy - exact ⟨hx, h, hh, y, hyL, image, lower⟩ - · rintro ⟨_, h, hh, y, hy, image, lower⟩ - exact ⟨y, (mem_relationImage H L e y).2 ⟨hy, h, hh, image⟩, lower⟩ - refine ⟨profile.target_mem, profile.separator_mem, profile.cap_mem, filter.subset, - filter.nonempty, ?_, profile.target_below_cap, profile.cap_not_below_target, - profile.separator_not_below_cap⟩ - intro x hx above - have original := profile.profile x hx above - constructor - · rintro ⟨f, hf, lower⟩ - exact original.1 ((positive_iff x hx).2 (filter.upward f hf x hx lower)) - · intro negative - exact original.2 (fun positive => negative - ⟨x, (positive_iff x hx).1 positive, meet.order.refl x hx⟩) - -end CodedCapProfile - -namespace GroundMainPrefix -open SetFormula -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitInsertionProfile {i j : I} (before : i ≤ j) - (preserved : run.PreservesOldProfiles) - {H F c E cap c' E' cap' : ZFSet.{u}} (hH : H ∈ M.sets) - (subset : H ⊆ (run.diagram.stage i).stage.carrier) - (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) - (equal : pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F) - (profile : CodedCapProfile (run.diagram.stage j).stage.carrier - (run.diagram.stage j).stage.order (run.diagram.stage j).stage.meetGraph c E cap - (relationImage H (run.diagram.stage j).stage.carrier (run.diagram.transition before).map.points)) - (imageC : ZFSet.pair c c' ∈ run.limitPointMap j) - (imageE : ZFSet.pair E E' ∈ run.limitPointMap j) - (imageCap : ZFSet.pair cap cap' ∈ run.limitPointMap j) : - CodedCapProfile run.limitPoints run.limitOrder run.limitMeetGraph c' E' cap' F := by - have whole : relationImage H (run.diagram.stage j).stage.carrier - (run.diagram.transition before).map.points ∈ M.sets := - M.relationImage_mem separation hH (run.diagram.stage j).stage.carrier_ground - (run.diagram.transition before).map.points_ground - have hc' := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageC)).2 - have hE' := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageE)).2 - have hcap' := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageCap)).2 - have finalProfile := run.limitPointMap_oldProfilePreservation preserved j _ - ((M.mem_groundPower _ _).2 ⟨whole, profile.filter_subset⟩) - c profile.target_mem E profile.separator_mem cap profile.cap_mem profile - c' hc' E' hE' cap' hcap' imageC imageE imageCap - have imageEqual : - relationImage (relationImage H (run.diagram.stage j).stage.carrier - (run.diagram.transition before).map.points) run.limitPoints (run.limitPointMap j) = - relationImage H run.limitPoints (run.limitPointMap i) := - (relationImage_composition_on subset).trans - (congrArg (relationImage H run.limitPoints) (run.limitPointMap_comp before)) - rw [imageEqual] at finalProfile - exact finalProfile.of_pushFilter_eq run.limitMeet_code filter equal - -end GroundMainPrefix -end - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem final_insertion_at {i j : I} (before : i ≤ j) - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (preserved : run.PreservesOldProfiles) (hLabels : Labels ∈ M.sets) - {c₀ e₀ d₀ H c e d F : ZFSet.{u}} - (hc₀ : c₀ ∈ (run.diagram.stage i).stage.carrier) - (he₀ : e₀ ∈ (run.diagram.stage i).stage.carrier) - (hd₀ : d₀ ∈ (run.diagram.stage i).stage.carrier) (hH : H ∈ M.sets) - (localFilter : MeetFilterCode (run.diagram.stage i).stage.carrier - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph H) - (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) - (equal : pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F) - (imageC : ZFSet.pair c₀ c ∈ run.limitPointMap i) - (imageE : ZFSet.pair e₀ e ∈ run.limitPointMap i) - (imageD : ZFSet.pair d₀ d ∈ run.limitPointMap i) - (lower : ZFSet.pair c₀ e₀ ∈ (run.diagram.stage i).stage.order) - (strict : ZFSet.pair e₀ c₀ ∉ (run.diagram.stage i).stage.order) - (above : ∀ x ∈ H, ZFSet.pair e₀ x ∈ (run.diagram.stage i).stage.order) : - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - FinalInsertionFamiliesCode Labels run.limitPoints run.limitActors run.limitOrder - run.limitMeetGraph run.limitAction c e d F caps actors := by - obtain ⟨caps, hCaps, actors, hActors, capInjection, actorInjection, _, laws⟩ := - run.insertionFamilies_of_taskBearing before code choice hLabels hc₀ he₀ hH localFilter - lower strict above - obtain ⟨c₁, stepC⟩ := run.pointSystem.map_entry_total before hc₀ - obtain ⟨e₁, stepE⟩ := run.pointSystem.map_entry_total before he₀ - obtain ⟨d₁, stepD⟩ := run.pointSystem.map_entry_total before hd₀ - have finalC := run.limitPointMap_later_entry before stepC imageC - have finalE := run.limitPointMap_later_entry before stepE imageE - have finalD := run.limitPointMap_later_entry before stepD imageD - obtain ⟨fixes, dominates, profiles, meets⟩ := laws c₁ e₁ stepC stepE - have finalFamilies := run.finalInsertionFamilies_transport j hLabels hCaps hActors - capInjection actorInjection finalC finalD fixes - (fun label k cap actor capEntry y _ acted => dominates label k cap actor capEntry - d₀ d₁ y stepD acted) - (fun label cap cap' entry imageCap => run.limitInsertionProfile before preserved hH - localFilter.subset filter equal (profiles label cap entry) finalC finalE imageCap) - meets - exact ⟨run.finalInsertionCaps j caps, finalFamilies.1, - run.finalInsertionActors j actors, finalFamilies.2.1, finalFamilies.2.2⟩ - -theorem filterPullback_configuration (i : I) {c e d c₀ e₀ d₀ F : ZFSet.{u}} - (imageC : ZFSet.pair c₀ c ∈ run.limitPointMap i) - (imageE : ZFSet.pair e₀ e ∈ run.limitPointMap i) - (imageD : ZFSet.pair d₀ d ∈ run.limitPointMap i) - (lower : ZFSet.pair c e ∈ run.limitOrder) (strict : ZFSet.pair e c ∉ run.limitOrder) - (bound : ZFSet.pair c d ∈ run.limitOrder) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ run.limitOrder) : - ZFSet.pair c₀ e₀ ∈ (run.diagram.stage i).stage.order ∧ - ZFSet.pair e₀ c₀ ∉ (run.diagram.stage i).stage.order ∧ - ZFSet.pair c₀ d₀ ∈ (run.diagram.stage i).stage.order ∧ - ∀ x ∈ copyPullback (run.diagram.stage i).stage.carrier run.limitPoints - (run.limitPointMap i) F, ZFSet.pair e₀ x ∈ (run.diagram.stage i).stage.order := by - refine ⟨(run.limitPointMap_order_iff i c₀ e₀ c e imageC imageE).1 lower, - (fun reverse => strict ((run.limitPointMap_order_iff i e₀ c₀ e c imageE imageC).2 reverse)), - (run.limitPointMap_order_iff i c₀ d₀ c d imageC imageD).1 bound, ?_⟩ - intro x hx - obtain ⟨_, y, hy, _, image⟩ := (mem_copyPullback _ _ _ _ x).1 hx - exact (run.limitPointMap_order_iff i e₀ x e y imageE image).1 (above y hy) - -namespace FinalChronology -variable {run} {level : GroundMainCandidateLevel M K} -variable (chronology : run.FinalChronology level) -include chronology - -theorem exists_groundFilterLocalization (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (indices : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) - (coordinateSmall : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {F c e d : ZFSet.{u}} (hF : F ∈ M.sets) - (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) - (hc : c ∈ run.limitPoints) (he : e ∈ run.limitPoints) (hd : d ∈ run.limitPoints) : - ∃ i c₀ e₀ d₀ H, - H = copyPullback (run.diagram.stage i).stage.carrier run.limitPoints (run.limitPointMap i) F ∧ - c₀ ∈ (run.diagram.stage i).stage.carrier ∧ e₀ ∈ (run.diagram.stage i).stage.carrier ∧ - d₀ ∈ (run.diagram.stage i).stage.carrier ∧ - ZFSet.pair c₀ c ∈ run.limitPointMap i ∧ ZFSet.pair e₀ e ∈ run.limitPointMap i ∧ - ZFSet.pair d₀ d ∈ run.limitPointMap i ∧ H ∈ M.sets ∧ - MeetFilterCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order - (run.diagram.stage i).stage.meetGraph H ∧ - pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F := by - obtain ⟨B, hB, f, hf, injection, subset, coinitial⟩ := - chronology.exists_extension_basis i₀ (fun _ h => h) pairing unions powers separation - infinite choice coordinateSmall irreflexive hF filter - obtain ⟨j, covers⟩ := run.exists_countablePointLocalization collection infinite choice indices - hB (fun _ hb => filter.subset (subset hb)) ⟨f, hf, injection⟩ - obtain ⟨k, c₁, e₁, d₁, hc₁, he₁, hd₁, rfl, rfl, rfl⟩ := - run.pointPresentation.triple_coverage hc he hd - obtain ⟨i, ji, ki⟩ := run.common_upper j k - obtain ⟨c₀, cStep⟩ := run.pointSystem.map_entry_total ki hc₁ - obtain ⟨e₀, eStep⟩ := run.pointSystem.map_entry_total ki he₁ - obtain ⟨d₀, dStep⟩ := run.pointSystem.map_entry_total ki hd₁ - have imageC := run.limitPointMap_later_entry ki cStep - ((run.pointPresentation.inclusion_entry k c₁ _).2 ⟨hc₁, rfl⟩) - have imageE := run.limitPointMap_later_entry ki eStep - ((run.pointPresentation.inclusion_entry k e₁ _).2 ⟨he₁, rfl⟩) - have imageD := run.limitPointMap_later_entry ki dStep - ((run.pointPresentation.inclusion_entry k d₁ _).2 ⟨hd₁, rfl⟩) - have coversAt : ∀ b ∈ B, ∃ a ∈ (run.diagram.stage i).stage.carrier, - ZFSet.pair a b ∈ run.limitPointMap i := by - intro b hb - obtain ⟨a, ha, image⟩ := covers b hb - obtain ⟨a', step⟩ := run.pointSystem.map_entry_total ji ha - exact ⟨a', (run.pointSystem.map_entry_bounds ji step).2, - run.limitPointMap_later_entry ji step image⟩ - let H := copyPullback (run.diagram.stage i).stage.carrier run.limitPoints (run.limitPointMap i) F - have ground : H ∈ M.sets := M.copyPullback_mem pairing unions powers separation - (run.diagram.stage i).stage.carrier_ground run.limitPoints_ground (run.limitPointMap_ground i) hF - have nonempty : H.Nonempty := by - obtain ⟨x, hx⟩ := filter.nonempty - obtain ⟨b, hb, _⟩ := coinitial x hx - obtain ⟨a, ha, image⟩ := coversAt b hb - exact ⟨a, (mem_copyPullback _ _ _ _ a).2 ⟨ha, b, subset hb, filter.subset (subset hb), image⟩⟩ - have localFilter := meetFilter_copyPullback (run.diagram.stage i).stage.meet filter - (run.limitPointMap_meetEmbedding i) nonempty - have recovered : pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F := by - apply pushFilter_copyPullback_eq_of_coinitial (run.limitPointMap_injection i).function filter - intro x hx - obtain ⟨b, hb, lower⟩ := coinitial x hx - obtain ⟨a, ha, image⟩ := coversAt b hb - exact ⟨b, subset hb, a, ha, image, lower⟩ - exact ⟨i, c₀, e₀, d₀, H, rfl, (run.pointSystem.map_entry_bounds ki cStep).2, - (run.pointSystem.map_entry_bounds ki eStep).2, (run.pointSystem.map_entry_bounds ki dStep).2, - imageC, imageE, imageD, ground, localFilter, recovered⟩ - -end FinalChronology - -end GroundMainPrefix - -namespace GroundMainPrefix.FinalChronology -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {level : GroundMainCandidateLevel M K} -variable (chronology : run.FinalChronology level) -include chronology - -theorem final_insertion_of_trace (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {B seed f g p : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) - (M.groundOmegaOne pairing unions powers separation collection infinite) p) - (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) - (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) - (indices : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) - (extension : MainPrefixHistoryExtends p run.code) (preserved : run.PreservesOldProfiles) - (hLabels : Labels ∈ M.sets) (coordinateSmall : M.groundEmbeddable D ZFSet.omega) - (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) - {c e d F : ZFSet.{u}} (hc : c ∈ run.limitPoints) (he : e ∈ run.limitPoints) - (hd : d ∈ run.limitPoints) (hF : F ∈ M.sets) - (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) - (lower : ZFSet.pair c e ∈ run.limitOrder) (strict : ZFSet.pair e c ∉ run.limitOrder) - (bound : ZFSet.pair c d ∈ run.limitOrder) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ run.limitOrder) : - ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, - FinalInsertionFamiliesCode Labels run.limitPoints run.limitActors run.limitOrder - run.limitMeetGraph run.limitAction c e d F caps actors := by - obtain ⟨i, c₀, e₀, d₀, H, pullback, hc₀, he₀, hd₀, imageC, imageE, imageD, - hH, localFilter, equal⟩ := chronology.exists_groundFilterLocalization i₀ collection infinite - choice indices coordinateSmall irreflexive hF filter hc he hd - have configuration := run.filterPullback_configuration i imageC imageE imageD lower strict bound above - have aboveH : ∀ x ∈ H, ZFSet.pair e₀ x ∈ (run.diagram.stage i).stage.order := by - simpa only [pullback] using configuration.2.2.2 - have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := - indices ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ - have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member - obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (indices.symm ▸ next) - have before : i ≤ j := (run.key_order i j).2 (by - rw [adjacent] - exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) - exact run.final_insertion_at before - (run.terminal_successor_taskBearing trace chosen tasks indices extension before adjacent) - choice preserved hLabels hc₀ he₀ hd₀ hH localFilter filter equal imageC imageE imageD - configuration.1 configuration.2.1 aboveH - -end GroundMainPrefix.FinalChronology - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterPullbackRecovery +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixInsertionFamilyTransport +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedImageCovers +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalExtensionBases +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixFinalStrictGrowth +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixInsertionSuccessors + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def pointStageCover : ZFSet.{u} := + indexedImageCover run.indices run.carrierUnion run.limitPoints run.limitPointInclusions + +theorem pointStageCover_ground : run.pointStageCover ∈ M.sets := + M.indexedImageCover_mem pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.limitPoints_ground run.limitPointInclusions_ground + +theorem pointStageCover_entry (i : I) (y : ZFSet.{u}) : + ZFSet.pair y (run.key i) ∈ run.pointStageCover ↔ + ∃ x ∈ (run.diagram.stage i).stage.carrier, ZFSet.pair x y ∈ run.limitPointMap i := by + rw [pointStageCover, pair_mem_indexedImageCover] + constructor + · rintro ⟨_, _, x, _, f, indexed, entry⟩ + have equal := (run.limitPointInclusions_entry i f).1 indexed + subst f + exact ⟨x, (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).1, entry⟩ + · rintro ⟨x, hx, entry⟩ + exact ⟨(ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2, + ZFSet.mem_range.2 ⟨i, rfl⟩, x, run.pointPresentation.carrier_bound i hx, + run.limitPointMap i, (run.limitPointInclusions_entry i _).2 rfl, entry⟩ + +theorem pointStageCover_total {y : ZFSet.{u}} (member : y ∈ run.limitPoints) : + ∃ i ∈ run.indices, ZFSet.pair y i ∈ run.pointStageCover := by + obtain ⟨i, x, hx, equal⟩ := run.pointPresentation.limitPoint_coverage member + exact ⟨run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, + (run.pointStageCover_entry i y).2 + ⟨x, hx, (run.pointPresentation.inclusion_entry i x y).2 ⟨hx, equal⟩⟩⟩ + +theorem exists_groundPointStageCover + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {X : ZFSet.{u}} (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) : + ∃ f ∈ M.sets, ZFSet.IsFunc X run.indices f ∧ f ⊆ run.pointStageCover ∧ + ∀ y t, ZFSet.pair y t ∈ f → ∃ i : I, run.key i = t ∧ + ∃ x ∈ (run.diagram.stage i).stage.carrier, ZFSet.pair x y ∈ run.limitPointMap i := by + obtain ⟨f, ground, function, included⟩ := + M.uniformize_relation pairing unions powers separation choice hX run.indices_ground + run.pointStageCover_ground (fun _ hy => run.pointStageCover_total (subset hy)) + refine ⟨f, ground, function, included, ?_⟩ + intro y t entry + have index := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 index + exact ⟨i, rfl, (run.pointStageCover_entry i y).1 (included entry)⟩ + +theorem finalInsertionFamilies_transport (j : I) + {caps actors c₀ d₀ c e d F : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hCaps : caps ∈ M.sets) (hActors : actors ∈ M.sets) + (capInjection : InjectionCode Labels (run.diagram.stage j).stage.carrier caps) + (actorInjection : InjectionCode Labels (run.diagram.stage j).stage.actors actors) + (imageC : ZFSet.pair c₀ c ∈ run.limitPointMap j) + (imageD : ZFSet.pair d₀ d ∈ run.limitPointMap j) + (fixes : ∀ label k, ZFSet.pair label k ∈ actors → + ∀ z ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair z c₀ ∈ (run.diagram.stage j).stage.order → + ZFSet.pair (ZFSet.pair k z) z ∈ (run.diagram.stage j).stage.action) + (dominates : ∀ label k cap, ZFSet.pair label k ∈ actors → ZFSet.pair label cap ∈ caps → + ∀ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair (ZFSet.pair k d₀) y ∈ (run.diagram.stage j).stage.action → + ZFSet.pair y cap ∈ (run.diagram.stage j).stage.order) + (profiles : ∀ label cap cap', ZFSet.pair label cap ∈ caps → + ZFSet.pair cap cap' ∈ run.limitPointMap j → + CodedCapProfile run.limitPoints run.limitOrder run.limitMeetGraph c e cap' F) + (meets : ∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ caps → + ZFSet.pair second cap₂ ∈ caps → first ≠ second → + ZFSet.pair (ZFSet.pair cap₁ cap₂) c₀ ∈ (run.diagram.stage j).stage.meetGraph) : + run.finalInsertionCaps j caps ∈ M.sets ∧ run.finalInsertionActors j actors ∈ M.sets ∧ + FinalInsertionFamiliesCode Labels run.limitPoints run.limitActors run.limitOrder + run.limitMeetGraph run.limitAction c e d F + (run.finalInsertionCaps j caps) (run.finalInsertionActors j actors) := by + refine ⟨run.finalInsertionCaps_ground j hLabels hCaps, + run.finalInsertionActors_ground j hLabels hActors, ?_⟩ + refine ⟨run.finalInsertionCaps_injection j capInjection, + run.finalInsertionActors_injection j actorInjection, ?_, ?_, ?_, ?_⟩ + · intro label k' entry + obtain ⟨k, oldActor, imageK⟩ := (run.finalInsertionActors_entry j actorInjection).1 entry + have agreement := ((run.diagram.stage j).stage.action_code.agreement_identity_iff_fixes).2 + (fixes label k oldActor) + have finalAgreement := run.limitMaps_agreement j k (run.diagram.stage j).stage.identity + k' (run.limitIdentity j) c₀ c imageK (run.limitActorMap_groupEmbedding j j).one imageC agreement + exact ((run.limitAction_code j).agreement_identity_iff_fixes).1 finalAgreement + · intro label k' cap' actorEntry capEntry y _ acted + obtain ⟨k, oldActor, imageK⟩ := (run.finalInsertionActors_entry j actorInjection).1 actorEntry + obtain ⟨cap, oldCap, imageCap⟩ := (run.finalInsertionCaps_entry j capInjection).1 capEntry + have hk := (ZFSet.pair_mem_prod.1 (actorInjection.function.1 oldActor)).2 + have hd₀ := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageD)).1 + obtain ⟨y₀, stageActed, _⟩ := (run.diagram.stage j).stage.action_code.function.2 + (ZFSet.pair k d₀) (ZFSet.pair_mem_prod.2 ⟨hk, hd₀⟩) + have hy₀ := (ZFSet.pair_mem_prod.1 ((run.diagram.stage j).stage.action_code.function.1 stageActed)).2 + obtain ⟨y', imageY, _⟩ := (run.limitPointMap_injection j).function.2 y₀ hy₀ + have targetActed := run.limitMaps_equivariant j k k' d₀ y₀ d y' imageK imageD imageY stageActed + have actionFunction : FunctionGraphOn (ZFSet.prod run.limitActors run.limitPoints) run.limitAction := + ⟨run.limitPoints, run.limitAction_function⟩ + have equal : y = y' := actionFunction.unique acted targetActed + rw [equal] + exact (run.limitPointMap_meetEmbedding j).monotone y₀ cap y' cap' + (dominates label k cap oldActor oldCap y₀ hy₀ stageActed) imageY imageCap + · intro label cap' entry + obtain ⟨cap, oldCap, imageCap⟩ := (run.finalInsertionCaps_entry j capInjection).1 entry + exact profiles label cap cap' oldCap imageCap + · intro first second cap₁' cap₂' firstEntry secondEntry different + obtain ⟨cap₁, firstCap, firstImage⟩ := (run.finalInsertionCaps_entry j capInjection).1 firstEntry + obtain ⟨cap₂, secondCap, secondImage⟩ := (run.finalInsertionCaps_entry j capInjection).1 secondEntry + exact (run.limitPointMap_meetEmbedding j).map_meet cap₁ cap₂ c₀ cap₁' cap₂' c + (meets first second cap₁ cap₂ firstCap secondCap different) firstImage secondImage imageC + +end GroundMainPrefix + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (indices : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) +include collection infinite choice indices + +theorem exists_countablePointStageCover {X : ZFSet.{u}} + (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) + (small : M.groundEmbeddable X ZFSet.omega) : + ∃ j : I, ∃ f ∈ M.sets, ZFSet.IsFunc X run.indices f ∧ f ⊆ run.pointStageCover ∧ + (∀ x t, ZFSet.pair x t ∈ f → t ∈ run.key j) ∧ + ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ run.limitPointMap j := by + obtain ⟨f, ground, function, included, covers⟩ := + run.exists_groundPointStageCover choice hX subset + have rangeGround := M.relationImage_mem separation hX run.indices_ground ground + have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice + hX run.indices_ground (M.omega_mem separation infinite) ground function small + have rangeSubset : relationImage X run.indices f ⊆ + M.groundOmegaOne pairing unions powers separation collection infinite := by + intro t ht + rw [← indices] + exact ((mem_relationImage _ _ _ _).1 ht).1 + obtain ⟨bound, inOmega, strict⟩ := M.groundOmegaOne_countable_bound + pairing unions powers separation collection infinite choice rangeGround rangeSubset rangeSmall + have inIndices : bound ∈ run.indices := by rw [indices]; exact inOmega + obtain ⟨j, equal⟩ := ZFSet.mem_range.1 inIndices + have strictEntry : ∀ x t, ZFSet.pair x t ∈ f → t ∈ run.key j := by + intro x t entry + rw [equal] + have bounds := ZFSet.pair_mem_prod.1 (function.1 entry) + exact strict t ((mem_relationImage _ _ _ _).2 ⟨bounds.2, x, bounds.1, entry⟩) + refine ⟨j, f, ground, function, included, strictEntry, ?_⟩ + intro x hx + obtain ⟨t, entry, _⟩ := function.2 x hx + obtain ⟨i, key, y, hy, image⟩ := covers x t entry + have before : i ≤ j := (run.key_order i j).2 (Or.inr (by rw [key]; exact strictEntry x t entry)) + obtain ⟨z, transition⟩ := run.pointSystem.map_entry_total before hy + exact ⟨z, (run.pointSystem.map_entry_bounds before transition).2, + run.limitPointMap_later_entry before transition image⟩ + +theorem exists_countablePointLocalization {X : ZFSet.{u}} + (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) + (small : M.groundEmbeddable X ZFSet.omega) : + ∃ j : I, ∀ x ∈ X, ∃ y ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair y x ∈ run.limitPointMap j := by + obtain ⟨j, _, _, _, _, _, covered⟩ := + run.exists_countablePointStageCover collection infinite choice indices hX subset small + exact ⟨j, covered⟩ + +theorem exists_countablePointUpperBound {X : ZFSet.{u}} + (hX : X ∈ M.sets) (subset : X ⊆ run.limitPoints) + (small : M.groundEmbeddable X ZFSet.omega) : + ∃ j : I, ∃ b ∈ M.sets, b ∈ run.limitPoints ∧ + ZFSet.pair (run.diagram.stage j).stage.top b ∈ run.limitPointMap j ∧ + ∀ x ∈ X, ZFSet.pair x b ∈ run.limitOrder := by + obtain ⟨j, covered⟩ := + run.exists_countablePointLocalization collection infinite choice indices hX subset small + obtain ⟨b, image, _⟩ := (run.limitPointMap_injection j).function.2 + (run.diagram.stage j).stage.top (run.diagram.stage j).stage.top_mem + have member := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 image)).2 + refine ⟨j, b, M.transitive run.limitPoints_ground member, member, image, ?_⟩ + intro x hx + obtain ⟨y, hy, atStage⟩ := covered x hx + exact (run.limitPointMap_order_iff j y (run.diagram.stage j).stage.top x b atStage image).2 + ((run.diagram.stage j).stage.greatest y hy) + +end GroundMainPrefix + +section +universe u v + +namespace CodedCapProfile + +theorem of_pushFilter_eq {L r μ c E cap H e F : ZFSet.{u}} + (profile : CodedCapProfile L r μ c E cap (relationImage H L e)) + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (equal : pushFilterCode L r e H = F) : CodedCapProfile L r μ c E cap F := by + have positive_iff (x : ZFSet.{u}) (hx : x ∈ L) : + (∃ y ∈ relationImage H L e, ZFSet.pair y x ∈ r) ↔ x ∈ F := by + rw [← equal, mem_pushFilterCode] + constructor + · rintro ⟨y, hy, lower⟩ + obtain ⟨hyL, h, hh, image⟩ := (mem_relationImage H L e y).1 hy + exact ⟨hx, h, hh, y, hyL, image, lower⟩ + · rintro ⟨_, h, hh, y, hy, image, lower⟩ + exact ⟨y, (mem_relationImage H L e y).2 ⟨hy, h, hh, image⟩, lower⟩ + refine ⟨profile.target_mem, profile.separator_mem, profile.cap_mem, filter.subset, + filter.nonempty, ?_, profile.target_below_cap, profile.cap_not_below_target, + profile.separator_not_below_cap⟩ + intro x hx above + have original := profile.profile x hx above + constructor + · rintro ⟨f, hf, lower⟩ + exact original.1 ((positive_iff x hx).2 (filter.upward f hf x hx lower)) + · intro negative + exact original.2 (fun positive => negative + ⟨x, (positive_iff x hx).1 positive, meet.order.refl x hx⟩) + +end CodedCapProfile + +namespace GroundMainPrefix +open SetFormula +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitInsertionProfile {i j : I} (before : i ≤ j) + (preserved : run.PreservesOldProfiles) + {H F c E cap c' E' cap' : ZFSet.{u}} (hH : H ∈ M.sets) + (subset : H ⊆ (run.diagram.stage i).stage.carrier) + (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) + (equal : pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F) + (profile : CodedCapProfile (run.diagram.stage j).stage.carrier + (run.diagram.stage j).stage.order (run.diagram.stage j).stage.meetGraph c E cap + (relationImage H (run.diagram.stage j).stage.carrier (run.diagram.transition before).map.points)) + (imageC : ZFSet.pair c c' ∈ run.limitPointMap j) + (imageE : ZFSet.pair E E' ∈ run.limitPointMap j) + (imageCap : ZFSet.pair cap cap' ∈ run.limitPointMap j) : + CodedCapProfile run.limitPoints run.limitOrder run.limitMeetGraph c' E' cap' F := by + have whole : relationImage H (run.diagram.stage j).stage.carrier + (run.diagram.transition before).map.points ∈ M.sets := + M.relationImage_mem separation hH (run.diagram.stage j).stage.carrier_ground + (run.diagram.transition before).map.points_ground + have hc' := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageC)).2 + have hE' := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageE)).2 + have hcap' := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection j).function.1 imageCap)).2 + have finalProfile := run.limitPointMap_oldProfilePreservation preserved j _ + ((M.mem_groundPower _ _).2 ⟨whole, profile.filter_subset⟩) + c profile.target_mem E profile.separator_mem cap profile.cap_mem profile + c' hc' E' hE' cap' hcap' imageC imageE imageCap + have imageEqual : + relationImage (relationImage H (run.diagram.stage j).stage.carrier + (run.diagram.transition before).map.points) run.limitPoints (run.limitPointMap j) = + relationImage H run.limitPoints (run.limitPointMap i) := + (relationImage_composition_on subset).trans + (congrArg (relationImage H run.limitPoints) (run.limitPointMap_comp before)) + rw [imageEqual] at finalProfile + exact finalProfile.of_pushFilter_eq run.limitMeet_code filter equal + +end GroundMainPrefix +end + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem final_insertion_at {i j : I} (before : i ≤ j) + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (preserved : run.PreservesOldProfiles) (hLabels : Labels ∈ M.sets) + {c₀ e₀ d₀ H c e d F : ZFSet.{u}} + (hc₀ : c₀ ∈ (run.diagram.stage i).stage.carrier) + (he₀ : e₀ ∈ (run.diagram.stage i).stage.carrier) + (hd₀ : d₀ ∈ (run.diagram.stage i).stage.carrier) (hH : H ∈ M.sets) + (localFilter : MeetFilterCode (run.diagram.stage i).stage.carrier + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph H) + (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) + (equal : pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F) + (imageC : ZFSet.pair c₀ c ∈ run.limitPointMap i) + (imageE : ZFSet.pair e₀ e ∈ run.limitPointMap i) + (imageD : ZFSet.pair d₀ d ∈ run.limitPointMap i) + (lower : ZFSet.pair c₀ e₀ ∈ (run.diagram.stage i).stage.order) + (strict : ZFSet.pair e₀ c₀ ∉ (run.diagram.stage i).stage.order) + (above : ∀ x ∈ H, ZFSet.pair e₀ x ∈ (run.diagram.stage i).stage.order) : + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + FinalInsertionFamiliesCode Labels run.limitPoints run.limitActors run.limitOrder + run.limitMeetGraph run.limitAction c e d F caps actors := by + obtain ⟨caps, hCaps, actors, hActors, capInjection, actorInjection, _, laws⟩ := + run.insertionFamilies_of_taskBearing before code choice hLabels hc₀ he₀ hH localFilter + lower strict above + obtain ⟨c₁, stepC⟩ := run.pointSystem.map_entry_total before hc₀ + obtain ⟨e₁, stepE⟩ := run.pointSystem.map_entry_total before he₀ + obtain ⟨d₁, stepD⟩ := run.pointSystem.map_entry_total before hd₀ + have finalC := run.limitPointMap_later_entry before stepC imageC + have finalE := run.limitPointMap_later_entry before stepE imageE + have finalD := run.limitPointMap_later_entry before stepD imageD + obtain ⟨fixes, dominates, profiles, meets⟩ := laws c₁ e₁ stepC stepE + have finalFamilies := run.finalInsertionFamilies_transport j hLabels hCaps hActors + capInjection actorInjection finalC finalD fixes + (fun label k cap actor capEntry y _ acted => dominates label k cap actor capEntry + d₀ d₁ y stepD acted) + (fun label cap cap' entry imageCap => run.limitInsertionProfile before preserved hH + localFilter.subset filter equal (profiles label cap entry) finalC finalE imageCap) + meets + exact ⟨run.finalInsertionCaps j caps, finalFamilies.1, + run.finalInsertionActors j actors, finalFamilies.2.1, finalFamilies.2.2⟩ + +theorem filterPullback_configuration (i : I) {c e d c₀ e₀ d₀ F : ZFSet.{u}} + (imageC : ZFSet.pair c₀ c ∈ run.limitPointMap i) + (imageE : ZFSet.pair e₀ e ∈ run.limitPointMap i) + (imageD : ZFSet.pair d₀ d ∈ run.limitPointMap i) + (lower : ZFSet.pair c e ∈ run.limitOrder) (strict : ZFSet.pair e c ∉ run.limitOrder) + (bound : ZFSet.pair c d ∈ run.limitOrder) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ run.limitOrder) : + ZFSet.pair c₀ e₀ ∈ (run.diagram.stage i).stage.order ∧ + ZFSet.pair e₀ c₀ ∉ (run.diagram.stage i).stage.order ∧ + ZFSet.pair c₀ d₀ ∈ (run.diagram.stage i).stage.order ∧ + ∀ x ∈ copyPullback (run.diagram.stage i).stage.carrier run.limitPoints + (run.limitPointMap i) F, ZFSet.pair e₀ x ∈ (run.diagram.stage i).stage.order := by + refine ⟨(run.limitPointMap_order_iff i c₀ e₀ c e imageC imageE).1 lower, + (fun reverse => strict ((run.limitPointMap_order_iff i e₀ c₀ e c imageE imageC).2 reverse)), + (run.limitPointMap_order_iff i c₀ d₀ c d imageC imageD).1 bound, ?_⟩ + intro x hx + obtain ⟨_, y, hy, _, image⟩ := (mem_copyPullback _ _ _ _ x).1 hx + exact (run.limitPointMap_order_iff i e₀ x e y imageE image).1 (above y hy) + +namespace FinalChronology +variable {run} {level : GroundMainCandidateLevel M K} +variable (chronology : run.FinalChronology level) +include chronology + +theorem exists_groundFilterLocalization (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (indices : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) + (coordinateSmall : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {F c e d : ZFSet.{u}} (hF : F ∈ M.sets) + (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) + (hc : c ∈ run.limitPoints) (he : e ∈ run.limitPoints) (hd : d ∈ run.limitPoints) : + ∃ i c₀ e₀ d₀ H, + H = copyPullback (run.diagram.stage i).stage.carrier run.limitPoints (run.limitPointMap i) F ∧ + c₀ ∈ (run.diagram.stage i).stage.carrier ∧ e₀ ∈ (run.diagram.stage i).stage.carrier ∧ + d₀ ∈ (run.diagram.stage i).stage.carrier ∧ + ZFSet.pair c₀ c ∈ run.limitPointMap i ∧ ZFSet.pair e₀ e ∈ run.limitPointMap i ∧ + ZFSet.pair d₀ d ∈ run.limitPointMap i ∧ H ∈ M.sets ∧ + MeetFilterCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order + (run.diagram.stage i).stage.meetGraph H ∧ + pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F := by + obtain ⟨B, hB, f, hf, injection, subset, coinitial⟩ := + chronology.exists_extension_basis i₀ (fun _ h => h) pairing unions powers separation + infinite choice coordinateSmall irreflexive hF filter + obtain ⟨j, covers⟩ := run.exists_countablePointLocalization collection infinite choice indices + hB (fun _ hb => filter.subset (subset hb)) ⟨f, hf, injection⟩ + obtain ⟨k, c₁, e₁, d₁, hc₁, he₁, hd₁, rfl, rfl, rfl⟩ := + run.pointPresentation.triple_coverage hc he hd + obtain ⟨i, ji, ki⟩ := run.common_upper j k + obtain ⟨c₀, cStep⟩ := run.pointSystem.map_entry_total ki hc₁ + obtain ⟨e₀, eStep⟩ := run.pointSystem.map_entry_total ki he₁ + obtain ⟨d₀, dStep⟩ := run.pointSystem.map_entry_total ki hd₁ + have imageC := run.limitPointMap_later_entry ki cStep + ((run.pointPresentation.inclusion_entry k c₁ _).2 ⟨hc₁, rfl⟩) + have imageE := run.limitPointMap_later_entry ki eStep + ((run.pointPresentation.inclusion_entry k e₁ _).2 ⟨he₁, rfl⟩) + have imageD := run.limitPointMap_later_entry ki dStep + ((run.pointPresentation.inclusion_entry k d₁ _).2 ⟨hd₁, rfl⟩) + have coversAt : ∀ b ∈ B, ∃ a ∈ (run.diagram.stage i).stage.carrier, + ZFSet.pair a b ∈ run.limitPointMap i := by + intro b hb + obtain ⟨a, ha, image⟩ := covers b hb + obtain ⟨a', step⟩ := run.pointSystem.map_entry_total ji ha + exact ⟨a', (run.pointSystem.map_entry_bounds ji step).2, + run.limitPointMap_later_entry ji step image⟩ + let H := copyPullback (run.diagram.stage i).stage.carrier run.limitPoints (run.limitPointMap i) F + have ground : H ∈ M.sets := M.copyPullback_mem pairing unions powers separation + (run.diagram.stage i).stage.carrier_ground run.limitPoints_ground (run.limitPointMap_ground i) hF + have nonempty : H.Nonempty := by + obtain ⟨x, hx⟩ := filter.nonempty + obtain ⟨b, hb, _⟩ := coinitial x hx + obtain ⟨a, ha, image⟩ := coversAt b hb + exact ⟨a, (mem_copyPullback _ _ _ _ a).2 ⟨ha, b, subset hb, filter.subset (subset hb), image⟩⟩ + have localFilter := meetFilter_copyPullback (run.diagram.stage i).stage.meet filter + (run.limitPointMap_meetEmbedding i) nonempty + have recovered : pushFilterCode run.limitPoints run.limitOrder (run.limitPointMap i) H = F := by + apply pushFilter_copyPullback_eq_of_coinitial (run.limitPointMap_injection i).function filter + intro x hx + obtain ⟨b, hb, lower⟩ := coinitial x hx + obtain ⟨a, ha, image⟩ := coversAt b hb + exact ⟨b, subset hb, a, ha, image, lower⟩ + exact ⟨i, c₀, e₀, d₀, H, rfl, (run.pointSystem.map_entry_bounds ki cStep).2, + (run.pointSystem.map_entry_bounds ki eStep).2, (run.pointSystem.map_entry_bounds ki dStep).2, + imageC, imageE, imageD, ground, localFilter, recovered⟩ + +end FinalChronology + +end GroundMainPrefix + +namespace GroundMainPrefix.FinalChronology +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {level : GroundMainCandidateLevel M K} +variable (chronology : run.FinalChronology level) +include chronology + +theorem final_insertion_of_trace (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {B seed f g p : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) + (M.groundOmegaOne pairing unions powers separation collection infinite) p) + (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) + (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) + (indices : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) + (extension : MainPrefixHistoryExtends p run.code) (preserved : run.PreservesOldProfiles) + (hLabels : Labels ∈ M.sets) (coordinateSmall : M.groundEmbeddable D ZFSet.omega) + (irreflexive : ∀ q ∈ D, ZFSet.pair q q ∉ rD) + {c e d F : ZFSet.{u}} (hc : c ∈ run.limitPoints) (he : e ∈ run.limitPoints) + (hd : d ∈ run.limitPoints) (hF : F ∈ M.sets) + (filter : MeetFilterCode run.limitPoints run.limitOrder run.limitMeetGraph F) + (lower : ZFSet.pair c e ∈ run.limitOrder) (strict : ZFSet.pair e c ∉ run.limitOrder) + (bound : ZFSet.pair c d ∈ run.limitOrder) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ run.limitOrder) : + ∃ caps ∈ M.sets, ∃ actors ∈ M.sets, + FinalInsertionFamiliesCode Labels run.limitPoints run.limitActors run.limitOrder + run.limitMeetGraph run.limitAction c e d F caps actors := by + obtain ⟨i, c₀, e₀, d₀, H, pullback, hc₀, he₀, hd₀, imageC, imageE, imageD, + hH, localFilter, equal⟩ := chronology.exists_groundFilterLocalization i₀ collection infinite + choice indices coordinateSmall irreflexive hF filter hc he hd + have configuration := run.filterPullback_configuration i imageC imageE imageD lower strict bound above + have aboveH : ∀ x ∈ H, ZFSet.pair e₀ x ∈ (run.diagram.stage i).stage.order := by + simpa only [pullback] using configuration.2.2.2 + have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := + indices ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ + have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member + obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (indices.symm ▸ next) + have before : i ≤ j := (run.key_order i j).2 (by + rw [adjacent] + exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) + exact run.final_insertion_at before + (run.terminal_successor_taskBearing trace chosen tasks indices extension before adjacent) + choice preserved hLabels hc₀ he₀ hd₀ hH localFilter filter equal imageC imageE imageD + configuration.1 configuration.2.1 aboveH + +end GroundMainPrefix.FinalChronology + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalStrictGrowth.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalStrictGrowth.lean index 94a38e4b0dbf1b60fd7c7fca03eb35aa04fb29c6..29d2d2640dab6253458d51d2ac3e45d72faf8ef5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalStrictGrowth.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixFinalStrictGrowth.lean @@ -1,323 +1,323 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixRectangleBoundTransport -import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalTraceLaws -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingSeparation -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingStrictTop - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem selectedStep_terminal_entry {old next f : ZFSet.{u}} {i j : I} - (before : i ≤ j) (adjacent : run.key j = insert (run.key i) (run.key i)) - (oldIndex : MainPrefixAtIndex (insert (run.key i) (run.key i)) old) - (selected : MainPrefixSelectedStepCode f old next) - (oldExtension : MainPrefixExtends old run.code) - (nextExtension : MainPrefixExtends next run.code) : - ZFSet.pair (run.linked i).code - (ZFSet.pair (run.linked j).code (run.diagram.transition before).map.code) ∈ f := by - obtain ⟨F, G, oldEqual⟩ := oldIndex - obtain ⟨b, S, E, S', E', a, target, z, first, second, _, sourceEntry, - selectedEntry, targetEntry, mapEntry⟩ := selected - have same : b = run.key i := setSuccessor_injective - (mainPrefixCode_inj.1 (first.symm.trans oldEqual)).1 - subst b - rw [first] at oldExtension - rw [second] at nextExtension - have oldIncluded := (mainPrefixExtends_iff.1 oldExtension).2.1 - have nextIncluded := (mainPrefixExtends_iff.1 nextExtension).2 - have sourceEqual := (run.stageGraph_entry i a).1 (oldIncluded sourceEntry) - have targetActual : ZFSet.pair (run.key j) target ∈ run.stageGraph := by - rw [adjacent] - exact nextIncluded.1 targetEntry - have targetEqual := (run.stageGraph_entry j target).1 targetActual - have mapActual : ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.transitionGraph := by - rw [adjacent] - exact nextIncluded.2 mapEntry - have mapEqual := (run.transitionGraph_entry before z).1 mapActual - rw [sourceEqual, targetEqual, mapEqual] at selectedEntry - exact selectedEntry - -theorem terminal_successor_entry {A B seed f g p : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) - (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) - (domain : run.indices = A) (extension : MainPrefixHistoryExtends p run.code) - {i j : I} (before : i ≤ j) - (adjacent : run.key j = insert (run.key i) (run.key i)) : - ZFSet.pair (run.linked i).code - (ZFSet.pair (run.linked j).code (run.diagram.transition before).map.code) ∈ f := by - have oldMember : run.key i ∈ A := domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ - have nextMember : insert (run.key i) (run.key i) ∈ A := by - rw [← adjacent] - exact domain ▸ ZFSet.mem_range.2 ⟨j, rfl⟩ - obtain ⟨old, oldEntry⟩ := trace.1.total oldMember - obtain ⟨next, nextEntry⟩ := trace.1.total nextMember - have selected := trace.mainPrefix_selected_successor chosen - (domain ▸ run.indices_ordinal) nextMember oldEntry nextEntry - exact run.selectedStep_terminal_entry before adjacent (trace.mainPrefix_values oldEntry).2 - selected (extension _ _ oldEntry) (extension _ _ nextEntry) - -theorem terminal_successor_taskBearing {A B seed f g p : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) - (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) - (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) - (domain : run.indices = A) (extension : MainPrefixHistoryExtends p run.code) - {i j : I} (before : i ≤ j) - (adjacent : run.key j = insert (run.key i) (run.key i)) : - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code := - tasks _ _ _ (run.terminal_successor_entry trace chosen domain extension before adjacent) - -theorem final_rectangle_at_bound - (edges : ∀ i, ∃ j, ∃ before : i ≤ j, - RectangleFulfillmentCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.actors - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph - (run.diagram.stage i).stage.action (run.diagram.stage j).stage.carrier - (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.order - (run.diagram.stage j).stage.meetGraph (run.diagram.stage j).stage.action - (run.diagram.transition before).map.points (run.diagram.transition before).map.actors) - {c b d g h X : ZFSet.{u}} - (rectangle : ExternalRectangleCode run.limitPoints run.limitActors run.limitOrder - run.limitMeetGraph run.limitAction c b d g h) (hX : X ∈ run.limitPoints) - (firstUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair g d) y ∈ run.limitAction → - ZFSet.pair y X ∈ run.limitOrder) - (secondUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair h d) y ∈ run.limitAction → - ZFSet.pair y X ∈ run.limitOrder) : - ∃ k ∈ run.limitActors, ∃ l ∈ run.limitActors, - RectangleAtBoundCode run.limitPoints run.limitOrder run.limitMeetGraph run.limitAction - c b d g h X k l := by - obtain ⟨i, c₀, b₀, d₀, X₀, g₀, h₀, hc, hb, hd, hXX, hg, hh, - rfl, rfl, rfl, rfl, rfl, rfl⟩ := run.rectangle_data_coverage - rectangle.1 rectangle.2.1 rectangle.2.2.1 hX rectangle.2.2.2.1 rectangle.2.2.2.2.1 - have localRectangle := run.limitRectangle_reflect i hc hb hd hg hh rectangle - have firstLocal : ∀ y ∈ (run.diagram.stage i).stage.carrier, - ZFSet.pair (ZFSet.pair g₀ d₀) y ∈ (run.diagram.stage i).stage.action → - ZFSet.pair y X₀ ∈ (run.diagram.stage i).stage.order := by - intro y hy entry - exact (run.limitLE_at i hy hXX).1 ((run.limitOrder_entry _ _).1 - (firstUpper _ (run.pointPresentation.limitPoint_mem hy) ((run.limitAction_at i hg hd hy).2 entry))) - have secondLocal : ∀ y ∈ (run.diagram.stage i).stage.carrier, - ZFSet.pair (ZFSet.pair h₀ d₀) y ∈ (run.diagram.stage i).stage.action → - ZFSet.pair y X₀ ∈ (run.diagram.stage i).stage.order := by - intro y hy entry - exact (run.limitLE_at i hy hXX).1 ((run.limitOrder_entry _ _).1 - (secondUpper _ (run.pointPresentation.limitPoint_mem hy) ((run.limitAction_at i hh hd hy).2 entry))) - obtain ⟨j, before, fulfills⟩ := edges i - obtain ⟨c', imageC⟩ := run.pointSystem.map_entry_total before hc - obtain ⟨b', imageB⟩ := run.pointSystem.map_entry_total before hb - obtain ⟨d', imageD⟩ := run.pointSystem.map_entry_total before hd - obtain ⟨X', imageX⟩ := run.pointSystem.map_entry_total before hXX - obtain ⟨g', imageG⟩ := run.actorSystem.map_entry_total before hg - obtain ⟨h', imageH⟩ := run.actorSystem.map_entry_total before hh - obtain ⟨k, hk, l, hl, code⟩ := (run.diagram.transition before).map.rectangle_at_bound - fulfills localRectangle hXX firstLocal secondLocal imageC imageB imageD imageX imageG imageH - have finalCode := run.limitRectangleAtBound j - (run.pointSystem.map_entry_bounds before imageC).2 (run.pointSystem.map_entry_bounds before imageB).2 - (run.pointSystem.map_entry_bounds before imageD).2 (run.pointSystem.map_entry_bounds before imageX).2 - (run.actorSystem.map_entry_bounds before imageG).2 (run.actorSystem.map_entry_bounds before imageH).2 - hk hl code - rw [← run.pointPresentation.limitPoint_transition before imageC, - ← run.pointPresentation.limitPoint_transition before imageB, - ← run.pointPresentation.limitPoint_transition before imageD, - ← run.pointPresentation.limitPoint_transition before imageX, - ← run.actorPresentation.limitPoint_transition before imageG, - ← run.actorPresentation.limitPoint_transition before imageH] at finalCode - exact ⟨run.actorPresentation.limitPoint j k, run.actorPresentation.limitPoint_mem hk, - run.actorPresentation.limitPoint j l, run.actorPresentation.limitPoint_mem hl, finalCode⟩ - -theorem final_rectangle_at_bound_of_trace - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {B seed f g p : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) - (M.groundOmegaOne pairing unions powers separation collection infinite) p) - (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) - (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) - (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) - (extension : MainPrefixHistoryExtends p run.code) - {c b d a a' X : ZFSet.{u}} - (rectangle : ExternalRectangleCode run.limitPoints run.limitActors run.limitOrder - run.limitMeetGraph run.limitAction c b d a a') (hX : X ∈ run.limitPoints) - (firstUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair a d) y ∈ run.limitAction → - ZFSet.pair y X ∈ run.limitOrder) - (secondUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair a' d) y ∈ run.limitAction → - ZFSet.pair y X ∈ run.limitOrder) : - ∃ k ∈ run.limitActors, ∃ l ∈ run.limitActors, - RectangleAtBoundCode run.limitPoints run.limitOrder run.limitMeetGraph run.limitAction - c b d a a' X k l := by - apply run.final_rectangle_at_bound _ rectangle hX firstUpper secondUpper - intro i - have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := - domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ - have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member - obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (domain.symm ▸ next) - have before : i ≤ j := (run.key_order i j).2 (by - rw [adjacent] - exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) - exact ⟨j, before, run.rectangles_of_taskBearing before - (run.terminal_successor_taskBearing trace chosen tasks domain extension before adjacent)⟩ - -theorem limitPoints_separation - (edges : ∀ i, ∃ j, ∃ before : i ≤ j, - SeparationFulfillmentCode (run.diagram.stage i).stage.carrier - (run.diagram.stage i).stage.order (run.diagram.stage j).stage.carrier - (run.diagram.stage j).stage.order (run.diagram.stage j).stage.meetGraph - (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.action - (run.diagram.transition before).map.points) - {W d x : ZFSet.{u}} (hW : W ∈ run.limitPoints) - (hd : d ∈ run.limitPoints) (hx : x ∈ run.limitPoints) - (wd : ZFSet.pair W d ∈ run.limitOrder) (wx : ZFSet.pair W x ∈ run.limitOrder) : - ∃ k ∈ run.limitActors, - (∀ z ∈ run.limitPoints, ZFSet.pair z W ∈ run.limitOrder → - ZFSet.pair (ZFSet.pair k z) z ∈ run.limitAction) ∧ - ∃ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair k d) y ∈ run.limitAction ∧ - ZFSet.pair (ZFSet.pair y x) W ∈ run.limitMeetGraph := by - obtain ⟨i, w, d₀, x₀, hw₀, hd₀, hx₀, rfl, rfl, rfl⟩ := - run.pointPresentation.triple_coverage hW hd hx - have wd' := (run.limitLE_at i hw₀ hd₀).1 ((run.limitOrder_entry _ _).1 wd) - have wx' := (run.limitLE_at i hw₀ hx₀).1 ((run.limitOrder_entry _ _).1 wx) - obtain ⟨j, before, fulfilled⟩ := edges i - obtain ⟨w', ww⟩ := run.pointSystem.map_entry_total before hw₀ - obtain ⟨d', dd⟩ := run.pointSystem.map_entry_total before hd₀ - obtain ⟨x', xx⟩ := run.pointSystem.map_entry_total before hx₀ - have hw' := (run.pointSystem.map_entry_bounds before ww).2 - have hd' := (run.pointSystem.map_entry_bounds before dd).2 - have hx' := (run.pointSystem.map_entry_bounds before xx).2 - obtain ⟨k, hk, actor⟩ := fulfilled w hw₀ - obtain ⟨fixes, separates⟩ := actor w' hw' ww - obtain ⟨y, acted, _⟩ := (run.diagram.stage j).stage.action_code.function.2 - (ZFSet.pair k d') (ZFSet.pair_mem_prod.2 ⟨hk, hd'⟩) - have hy := (ZFSet.pair_mem_prod.1 - ((run.diagram.stage j).stage.action_code.function.1 acted)).2 - have meet := separates d₀ hd₀ x₀ hx₀ d' hd' x' hx' y hy wd' wx' dd xx acted - have imageK := (run.actorPresentation.inclusion_entry j k _).2 ⟨hk, rfl⟩ - have imageW := (run.pointPresentation.inclusion_entry j w' _).2 ⟨hw', rfl⟩ - have identityAgreement := - ((run.diagram.stage j).stage.action_code.agreement_identity_iff_fixes).2 fixes - have finalAgreement := run.limitMaps_agreement j k (run.diagram.stage j).stage.identity - (run.actorPresentation.limitPoint j k) (run.limitIdentity j) w' - (run.pointPresentation.limitPoint j w') imageK - (run.limitActorMap_groupEmbedding j j).one imageW identityAgreement - have finalFixes := ((run.limitAction_code j).agreement_identity_iff_fixes).1 finalAgreement - rw [run.pointPresentation.limitPoint_transition before ww, - run.pointPresentation.limitPoint_transition before dd, - run.pointPresentation.limitPoint_transition before xx] - refine ⟨run.actorPresentation.limitPoint j k, run.actorPresentation.limitPoint_mem hk, - finalFixes, run.pointPresentation.limitPoint j y, run.pointPresentation.limitPoint_mem hy, - (run.limitAction_at j hk hd' hy).2 acted, ?_⟩ - exact (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at j hy hx' hw').2 meet) - -theorem limitPoints_separation_of_trace - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {B seed f g p : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) - (M.groundOmegaOne pairing unions powers separation collection infinite) p) - (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) - (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) - (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) - (extension : MainPrefixHistoryExtends p run.code) - {W d x : ZFSet.{u}} (hW : W ∈ run.limitPoints) - (hd : d ∈ run.limitPoints) (hx : x ∈ run.limitPoints) - (wd : ZFSet.pair W d ∈ run.limitOrder) (wx : ZFSet.pair W x ∈ run.limitOrder) : - ∃ k ∈ run.limitActors, - (∀ z ∈ run.limitPoints, ZFSet.pair z W ∈ run.limitOrder → - ZFSet.pair (ZFSet.pair k z) z ∈ run.limitAction) ∧ - ∃ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair k d) y ∈ run.limitAction ∧ - ZFSet.pair (ZFSet.pair y x) W ∈ run.limitMeetGraph := by - apply run.limitPoints_separation _ hW hd hx wd wx - intro i - have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := - domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ - have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member - obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (domain.symm ▸ next) - have before : i ≤ j := (run.key_order i j).2 (by - rw [adjacent] - exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) - exact ⟨j, before, run.separation_of_taskBearing before - (run.terminal_successor_taskBearing trace chosen tasks domain extension before adjacent)⟩ - -theorem limitPoints_strict_extension - (growth : ∀ i, ∃ j, ∃ before : i ≤ j, - StrictSuccessorTopCode (run.diagram.stage i).stage.carrier - (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order - (run.diagram.transition before).map.points (run.diagram.stage j).stage.top) - {x : ZFSet.{u}} (member : x ∈ run.limitPoints) : - ∃ y ∈ run.limitPoints, ZFSet.pair x y ∈ run.limitOrder ∧ - ZFSet.pair y x ∉ run.limitOrder := by - obtain ⟨i, a, ha, rfl⟩ := run.pointPresentation.limitPoint_coverage member - obtain ⟨j, before, strict⟩ := growth i - obtain ⟨b, entry⟩ := run.pointSystem.map_entry_total before ha - have hb := (run.pointSystem.map_entry_bounds before entry).2 - have ht := (run.diagram.stage j).stage.top_mem - have bounds := strict a ha b hb entry - refine ⟨run.pointPresentation.limitPoint j (run.diagram.stage j).stage.top, - run.pointPresentation.limitPoint_mem ht, ?_⟩ - rw [run.pointPresentation.limitPoint_transition before entry] - exact ⟨(run.limitOrder_entry _ _).2 ((run.limitLE_at j hb ht).2 bounds.1), - fun lower => bounds.2 ((run.limitLE_at j ht hb).1 ((run.limitOrder_entry _ _).1 lower))⟩ - -theorem terminal_adjacent_strict_top - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {B seed f g p : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) - (M.groundOmegaOne pairing unions powers separation collection infinite) p) - (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) - (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) - (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) - (extension : MainPrefixHistoryExtends p run.code) (i : I) : - ∃ j, ∃ before : i ≤ j, run.key j = insert (run.key i) (run.key i) ∧ - StrictSuccessorTopCode (run.diagram.stage i).stage.carrier - (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order - (run.diagram.transition before).map.points (run.diagram.stage j).stage.top := by - have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := - domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ - have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member - obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (domain.symm ▸ next) - have before : i ≤ j := (run.key_order i j).2 (by - rw [adjacent] - exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) - exact ⟨j, before, adjacent, run.strict_top_of_taskBearing before - (run.terminal_successor_taskBearing trace chosen tasks domain extension before adjacent)⟩ - -theorem limitPoints_strict_extension_of_trace - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {B seed f g p : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) - (M.groundOmegaOne pairing unions powers separation collection infinite) p) - (chosen : ∀ old next, ZFSet.pair old next ∈ g → - MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) - (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) - (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) - (extension : MainPrefixHistoryExtends p run.code) - {x : ZFSet.{u}} (member : x ∈ run.limitPoints) : - ∃ y ∈ run.limitPoints, ZFSet.pair x y ∈ run.limitOrder ∧ - ZFSet.pair y x ∉ run.limitOrder := by - apply run.limitPoints_strict_extension _ member - intro i - obtain ⟨j, before, _, strict⟩ := run.terminal_adjacent_strict_top - collection infinite trace chosen tasks domain extension i - exact ⟨j, before, strict⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixRectangleBoundTransport +import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalTraceLaws +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingSeparation +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingStrictTop + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem selectedStep_terminal_entry {old next f : ZFSet.{u}} {i j : I} + (before : i ≤ j) (adjacent : run.key j = insert (run.key i) (run.key i)) + (oldIndex : MainPrefixAtIndex (insert (run.key i) (run.key i)) old) + (selected : MainPrefixSelectedStepCode f old next) + (oldExtension : MainPrefixExtends old run.code) + (nextExtension : MainPrefixExtends next run.code) : + ZFSet.pair (run.linked i).code + (ZFSet.pair (run.linked j).code (run.diagram.transition before).map.code) ∈ f := by + obtain ⟨F, G, oldEqual⟩ := oldIndex + obtain ⟨b, S, E, S', E', a, target, z, first, second, _, sourceEntry, + selectedEntry, targetEntry, mapEntry⟩ := selected + have same : b = run.key i := setSuccessor_injective + (mainPrefixCode_inj.1 (first.symm.trans oldEqual)).1 + subst b + rw [first] at oldExtension + rw [second] at nextExtension + have oldIncluded := (mainPrefixExtends_iff.1 oldExtension).2.1 + have nextIncluded := (mainPrefixExtends_iff.1 nextExtension).2 + have sourceEqual := (run.stageGraph_entry i a).1 (oldIncluded sourceEntry) + have targetActual : ZFSet.pair (run.key j) target ∈ run.stageGraph := by + rw [adjacent] + exact nextIncluded.1 targetEntry + have targetEqual := (run.stageGraph_entry j target).1 targetActual + have mapActual : ZFSet.pair (ZFSet.pair (run.key j) (run.key i)) z ∈ run.transitionGraph := by + rw [adjacent] + exact nextIncluded.2 mapEntry + have mapEqual := (run.transitionGraph_entry before z).1 mapActual + rw [sourceEqual, targetEqual, mapEqual] at selectedEntry + exact selectedEntry + +theorem terminal_successor_entry {A B seed f g p : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) + (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) + (domain : run.indices = A) (extension : MainPrefixHistoryExtends p run.code) + {i j : I} (before : i ≤ j) + (adjacent : run.key j = insert (run.key i) (run.key i)) : + ZFSet.pair (run.linked i).code + (ZFSet.pair (run.linked j).code (run.diagram.transition before).map.code) ∈ f := by + have oldMember : run.key i ∈ A := domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ + have nextMember : insert (run.key i) (run.key i) ∈ A := by + rw [← adjacent] + exact domain ▸ ZFSet.mem_range.2 ⟨j, rfl⟩ + obtain ⟨old, oldEntry⟩ := trace.1.total oldMember + obtain ⟨next, nextEntry⟩ := trace.1.total nextMember + have selected := trace.mainPrefix_selected_successor chosen + (domain ▸ run.indices_ordinal) nextMember oldEntry nextEntry + exact run.selectedStep_terminal_entry before adjacent (trace.mainPrefix_values oldEntry).2 + selected (extension _ _ oldEntry) (extension _ _ nextEntry) + +theorem terminal_successor_taskBearing {A B seed f g p : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) + (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) + (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) + (domain : run.indices = A) (extension : MainPrefixHistoryExtends p run.code) + {i j : I} (before : i ≤ j) + (adjacent : run.key j = insert (run.key i) (run.key i)) : + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code := + tasks _ _ _ (run.terminal_successor_entry trace chosen domain extension before adjacent) + +theorem final_rectangle_at_bound + (edges : ∀ i, ∃ j, ∃ before : i ≤ j, + RectangleFulfillmentCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.actors + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph + (run.diagram.stage i).stage.action (run.diagram.stage j).stage.carrier + (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.order + (run.diagram.stage j).stage.meetGraph (run.diagram.stage j).stage.action + (run.diagram.transition before).map.points (run.diagram.transition before).map.actors) + {c b d g h X : ZFSet.{u}} + (rectangle : ExternalRectangleCode run.limitPoints run.limitActors run.limitOrder + run.limitMeetGraph run.limitAction c b d g h) (hX : X ∈ run.limitPoints) + (firstUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair g d) y ∈ run.limitAction → + ZFSet.pair y X ∈ run.limitOrder) + (secondUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair h d) y ∈ run.limitAction → + ZFSet.pair y X ∈ run.limitOrder) : + ∃ k ∈ run.limitActors, ∃ l ∈ run.limitActors, + RectangleAtBoundCode run.limitPoints run.limitOrder run.limitMeetGraph run.limitAction + c b d g h X k l := by + obtain ⟨i, c₀, b₀, d₀, X₀, g₀, h₀, hc, hb, hd, hXX, hg, hh, + rfl, rfl, rfl, rfl, rfl, rfl⟩ := run.rectangle_data_coverage + rectangle.1 rectangle.2.1 rectangle.2.2.1 hX rectangle.2.2.2.1 rectangle.2.2.2.2.1 + have localRectangle := run.limitRectangle_reflect i hc hb hd hg hh rectangle + have firstLocal : ∀ y ∈ (run.diagram.stage i).stage.carrier, + ZFSet.pair (ZFSet.pair g₀ d₀) y ∈ (run.diagram.stage i).stage.action → + ZFSet.pair y X₀ ∈ (run.diagram.stage i).stage.order := by + intro y hy entry + exact (run.limitLE_at i hy hXX).1 ((run.limitOrder_entry _ _).1 + (firstUpper _ (run.pointPresentation.limitPoint_mem hy) ((run.limitAction_at i hg hd hy).2 entry))) + have secondLocal : ∀ y ∈ (run.diagram.stage i).stage.carrier, + ZFSet.pair (ZFSet.pair h₀ d₀) y ∈ (run.diagram.stage i).stage.action → + ZFSet.pair y X₀ ∈ (run.diagram.stage i).stage.order := by + intro y hy entry + exact (run.limitLE_at i hy hXX).1 ((run.limitOrder_entry _ _).1 + (secondUpper _ (run.pointPresentation.limitPoint_mem hy) ((run.limitAction_at i hh hd hy).2 entry))) + obtain ⟨j, before, fulfills⟩ := edges i + obtain ⟨c', imageC⟩ := run.pointSystem.map_entry_total before hc + obtain ⟨b', imageB⟩ := run.pointSystem.map_entry_total before hb + obtain ⟨d', imageD⟩ := run.pointSystem.map_entry_total before hd + obtain ⟨X', imageX⟩ := run.pointSystem.map_entry_total before hXX + obtain ⟨g', imageG⟩ := run.actorSystem.map_entry_total before hg + obtain ⟨h', imageH⟩ := run.actorSystem.map_entry_total before hh + obtain ⟨k, hk, l, hl, code⟩ := (run.diagram.transition before).map.rectangle_at_bound + fulfills localRectangle hXX firstLocal secondLocal imageC imageB imageD imageX imageG imageH + have finalCode := run.limitRectangleAtBound j + (run.pointSystem.map_entry_bounds before imageC).2 (run.pointSystem.map_entry_bounds before imageB).2 + (run.pointSystem.map_entry_bounds before imageD).2 (run.pointSystem.map_entry_bounds before imageX).2 + (run.actorSystem.map_entry_bounds before imageG).2 (run.actorSystem.map_entry_bounds before imageH).2 + hk hl code + rw [← run.pointPresentation.limitPoint_transition before imageC, + ← run.pointPresentation.limitPoint_transition before imageB, + ← run.pointPresentation.limitPoint_transition before imageD, + ← run.pointPresentation.limitPoint_transition before imageX, + ← run.actorPresentation.limitPoint_transition before imageG, + ← run.actorPresentation.limitPoint_transition before imageH] at finalCode + exact ⟨run.actorPresentation.limitPoint j k, run.actorPresentation.limitPoint_mem hk, + run.actorPresentation.limitPoint j l, run.actorPresentation.limitPoint_mem hl, finalCode⟩ + +theorem final_rectangle_at_bound_of_trace + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {B seed f g p : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) + (M.groundOmegaOne pairing unions powers separation collection infinite) p) + (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) + (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) + (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) + (extension : MainPrefixHistoryExtends p run.code) + {c b d a a' X : ZFSet.{u}} + (rectangle : ExternalRectangleCode run.limitPoints run.limitActors run.limitOrder + run.limitMeetGraph run.limitAction c b d a a') (hX : X ∈ run.limitPoints) + (firstUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair a d) y ∈ run.limitAction → + ZFSet.pair y X ∈ run.limitOrder) + (secondUpper : ∀ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair a' d) y ∈ run.limitAction → + ZFSet.pair y X ∈ run.limitOrder) : + ∃ k ∈ run.limitActors, ∃ l ∈ run.limitActors, + RectangleAtBoundCode run.limitPoints run.limitOrder run.limitMeetGraph run.limitAction + c b d a a' X k l := by + apply run.final_rectangle_at_bound _ rectangle hX firstUpper secondUpper + intro i + have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := + domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ + have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member + obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (domain.symm ▸ next) + have before : i ≤ j := (run.key_order i j).2 (by + rw [adjacent] + exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) + exact ⟨j, before, run.rectangles_of_taskBearing before + (run.terminal_successor_taskBearing trace chosen tasks domain extension before adjacent)⟩ + +theorem limitPoints_separation + (edges : ∀ i, ∃ j, ∃ before : i ≤ j, + SeparationFulfillmentCode (run.diagram.stage i).stage.carrier + (run.diagram.stage i).stage.order (run.diagram.stage j).stage.carrier + (run.diagram.stage j).stage.order (run.diagram.stage j).stage.meetGraph + (run.diagram.stage j).stage.actors (run.diagram.stage j).stage.action + (run.diagram.transition before).map.points) + {W d x : ZFSet.{u}} (hW : W ∈ run.limitPoints) + (hd : d ∈ run.limitPoints) (hx : x ∈ run.limitPoints) + (wd : ZFSet.pair W d ∈ run.limitOrder) (wx : ZFSet.pair W x ∈ run.limitOrder) : + ∃ k ∈ run.limitActors, + (∀ z ∈ run.limitPoints, ZFSet.pair z W ∈ run.limitOrder → + ZFSet.pair (ZFSet.pair k z) z ∈ run.limitAction) ∧ + ∃ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair k d) y ∈ run.limitAction ∧ + ZFSet.pair (ZFSet.pair y x) W ∈ run.limitMeetGraph := by + obtain ⟨i, w, d₀, x₀, hw₀, hd₀, hx₀, rfl, rfl, rfl⟩ := + run.pointPresentation.triple_coverage hW hd hx + have wd' := (run.limitLE_at i hw₀ hd₀).1 ((run.limitOrder_entry _ _).1 wd) + have wx' := (run.limitLE_at i hw₀ hx₀).1 ((run.limitOrder_entry _ _).1 wx) + obtain ⟨j, before, fulfilled⟩ := edges i + obtain ⟨w', ww⟩ := run.pointSystem.map_entry_total before hw₀ + obtain ⟨d', dd⟩ := run.pointSystem.map_entry_total before hd₀ + obtain ⟨x', xx⟩ := run.pointSystem.map_entry_total before hx₀ + have hw' := (run.pointSystem.map_entry_bounds before ww).2 + have hd' := (run.pointSystem.map_entry_bounds before dd).2 + have hx' := (run.pointSystem.map_entry_bounds before xx).2 + obtain ⟨k, hk, actor⟩ := fulfilled w hw₀ + obtain ⟨fixes, separates⟩ := actor w' hw' ww + obtain ⟨y, acted, _⟩ := (run.diagram.stage j).stage.action_code.function.2 + (ZFSet.pair k d') (ZFSet.pair_mem_prod.2 ⟨hk, hd'⟩) + have hy := (ZFSet.pair_mem_prod.1 + ((run.diagram.stage j).stage.action_code.function.1 acted)).2 + have meet := separates d₀ hd₀ x₀ hx₀ d' hd' x' hx' y hy wd' wx' dd xx acted + have imageK := (run.actorPresentation.inclusion_entry j k _).2 ⟨hk, rfl⟩ + have imageW := (run.pointPresentation.inclusion_entry j w' _).2 ⟨hw', rfl⟩ + have identityAgreement := + ((run.diagram.stage j).stage.action_code.agreement_identity_iff_fixes).2 fixes + have finalAgreement := run.limitMaps_agreement j k (run.diagram.stage j).stage.identity + (run.actorPresentation.limitPoint j k) (run.limitIdentity j) w' + (run.pointPresentation.limitPoint j w') imageK + (run.limitActorMap_groupEmbedding j j).one imageW identityAgreement + have finalFixes := ((run.limitAction_code j).agreement_identity_iff_fixes).1 finalAgreement + rw [run.pointPresentation.limitPoint_transition before ww, + run.pointPresentation.limitPoint_transition before dd, + run.pointPresentation.limitPoint_transition before xx] + refine ⟨run.actorPresentation.limitPoint j k, run.actorPresentation.limitPoint_mem hk, + finalFixes, run.pointPresentation.limitPoint j y, run.pointPresentation.limitPoint_mem hy, + (run.limitAction_at j hk hd' hy).2 acted, ?_⟩ + exact (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at j hy hx' hw').2 meet) + +theorem limitPoints_separation_of_trace + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {B seed f g p : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) + (M.groundOmegaOne pairing unions powers separation collection infinite) p) + (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) + (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) + (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) + (extension : MainPrefixHistoryExtends p run.code) + {W d x : ZFSet.{u}} (hW : W ∈ run.limitPoints) + (hd : d ∈ run.limitPoints) (hx : x ∈ run.limitPoints) + (wd : ZFSet.pair W d ∈ run.limitOrder) (wx : ZFSet.pair W x ∈ run.limitOrder) : + ∃ k ∈ run.limitActors, + (∀ z ∈ run.limitPoints, ZFSet.pair z W ∈ run.limitOrder → + ZFSet.pair (ZFSet.pair k z) z ∈ run.limitAction) ∧ + ∃ y ∈ run.limitPoints, ZFSet.pair (ZFSet.pair k d) y ∈ run.limitAction ∧ + ZFSet.pair (ZFSet.pair y x) W ∈ run.limitMeetGraph := by + apply run.limitPoints_separation _ hW hd hx wd wx + intro i + have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := + domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ + have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member + obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (domain.symm ▸ next) + have before : i ≤ j := (run.key_order i j).2 (by + rw [adjacent] + exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) + exact ⟨j, before, run.separation_of_taskBearing before + (run.terminal_successor_taskBearing trace chosen tasks domain extension before adjacent)⟩ + +theorem limitPoints_strict_extension + (growth : ∀ i, ∃ j, ∃ before : i ≤ j, + StrictSuccessorTopCode (run.diagram.stage i).stage.carrier + (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order + (run.diagram.transition before).map.points (run.diagram.stage j).stage.top) + {x : ZFSet.{u}} (member : x ∈ run.limitPoints) : + ∃ y ∈ run.limitPoints, ZFSet.pair x y ∈ run.limitOrder ∧ + ZFSet.pair y x ∉ run.limitOrder := by + obtain ⟨i, a, ha, rfl⟩ := run.pointPresentation.limitPoint_coverage member + obtain ⟨j, before, strict⟩ := growth i + obtain ⟨b, entry⟩ := run.pointSystem.map_entry_total before ha + have hb := (run.pointSystem.map_entry_bounds before entry).2 + have ht := (run.diagram.stage j).stage.top_mem + have bounds := strict a ha b hb entry + refine ⟨run.pointPresentation.limitPoint j (run.diagram.stage j).stage.top, + run.pointPresentation.limitPoint_mem ht, ?_⟩ + rw [run.pointPresentation.limitPoint_transition before entry] + exact ⟨(run.limitOrder_entry _ _).2 ((run.limitLE_at j hb ht).2 bounds.1), + fun lower => bounds.2 ((run.limitLE_at j ht hb).1 ((run.limitOrder_entry _ _).1 lower))⟩ + +theorem terminal_adjacent_strict_top + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {B seed f g p : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) + (M.groundOmegaOne pairing unions powers separation collection infinite) p) + (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) + (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) + (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) + (extension : MainPrefixHistoryExtends p run.code) (i : I) : + ∃ j, ∃ before : i ≤ j, run.key j = insert (run.key i) (run.key i) ∧ + StrictSuccessorTopCode (run.diagram.stage i).stage.carrier + (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order + (run.diagram.transition before).map.points (run.diagram.stage j).stage.top := by + have member : run.key i ∈ M.groundOmegaOne pairing unions powers separation collection infinite := + domain ▸ ZFSet.mem_range.2 ⟨i, rfl⟩ + have next := M.groundOmegaOne_successor pairing unions powers separation collection infinite member + obtain ⟨j, adjacent⟩ := ZFSet.mem_range.1 (domain.symm ▸ next) + have before : i ≤ j := (run.key_order i j).2 (by + rw [adjacent] + exact Or.inr (ZFSet.mem_insert (run.key i) (run.key i))) + exact ⟨j, before, adjacent, run.strict_top_of_taskBearing before + (run.terminal_successor_taskBearing trace chosen tasks domain extension before adjacent)⟩ + +theorem limitPoints_strict_extension_of_trace + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {B seed f g p : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) + (M.groundOmegaOne pairing unions powers separation collection infinite) p) + (chosen : ∀ old next, ZFSet.pair old next ∈ g → + MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f old next) + (tasks : ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) + (domain : run.indices = M.groundOmegaOne pairing unions powers separation collection infinite) + (extension : MainPrefixHistoryExtends p run.code) + {x : ZFSet.{u}} (member : x ∈ run.limitPoints) : + ∃ y ∈ run.limitPoints, ZFSet.pair x y ∈ run.limitOrder ∧ + ZFSet.pair y x ∉ run.limitOrder := by + apply run.limitPoints_strict_extension _ member + intro i + obtain ⟨j, before, _, strict⟩ := run.terminal_adjacent_strict_top + collection infinite trace chosen tasks domain extension i + exact ⟨j, before, strict⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixInsertionSuccessors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixInsertionSuccessors.lean index c7120e6d9a14b4044cc25d715fc687c9c058fd06..ba3f625a2d256bd9da35673d82b94bc8d4c4c202 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixInsertionSuccessors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixInsertionSuccessors.lean @@ -1,74 +1,74 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingInsertionFulfillment - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem insertionFamilies_of_taskBearing {i j : I} (before : i ≤ j) - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) - (hc : c ∈ (run.diagram.stage i).stage.carrier) - (he : e ∈ (run.diagram.stage i).stage.carrier) (hF : F ∈ M.sets) - (filter : MeetFilterCode (run.diagram.stage i).stage.carrier - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph F) - (lower : ZFSet.pair c e ∈ (run.diagram.stage i).stage.order) - (strict : ZFSet.pair e c ∉ (run.diagram.stage i).stage.order) - (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.diagram.stage i).stage.order) : - ∃ capFamily ∈ M.sets, ∃ actorFamily ∈ M.sets, - InjectionCode Labels (run.diagram.stage j).stage.carrier capFamily ∧ - InjectionCode Labels (run.diagram.stage j).stage.actors actorFamily ∧ - (∀ label k top' v, ZFSet.pair label k ∈ actorFamily → - ZFSet.pair (run.diagram.stage i).stage.top top' ∈ (run.diagram.transition before).map.points → - (ZFSet.pair (ZFSet.pair k top') v ∈ (run.diagram.stage j).stage.action ↔ - ZFSet.pair label v ∈ capFamily)) ∧ - ∀ c' e', ZFSet.pair c c' ∈ (run.diagram.transition before).map.points → - ZFSet.pair e e' ∈ (run.diagram.transition before).map.points → - (∀ label k, ZFSet.pair label k ∈ actorFamily → - ∀ z ∈ (run.diagram.stage j).stage.carrier, - ZFSet.pair z c' ∈ (run.diagram.stage j).stage.order → - ZFSet.pair (ZFSet.pair k z) z ∈ (run.diagram.stage j).stage.action) ∧ - (∀ label k cap, ZFSet.pair label k ∈ actorFamily → ZFSet.pair label cap ∈ capFamily → - ∀ x x' y, ZFSet.pair x x' ∈ (run.diagram.transition before).map.points → - ZFSet.pair (ZFSet.pair k x') y ∈ (run.diagram.stage j).stage.action → - ZFSet.pair y cap ∈ (run.diagram.stage j).stage.order) ∧ - (∀ label cap, ZFSet.pair label cap ∈ capFamily → - CodedCapProfile (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order - (run.diagram.stage j).stage.meetGraph c' e' cap - (relationImage F (run.diagram.stage j).stage.carrier - (run.diagram.transition before).map.points)) ∧ - (∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ capFamily → - ZFSet.pair second cap₂ ∈ capFamily → first ≠ second → - ZFSet.pair (ZFSet.pair cap₁ cap₂) c' ∈ (run.diagram.stage j).stage.meetGraph) := by - let transition := (run.diagram.transition before).retargetEq - (run.linked_main i).symm (run.linked_main j).symm - have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked i).code (run.linked j).code transition.map.code := by - simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code - have families := actual.exists_insertionFamilies pairing unions powers separation choice hLabels - (show c ∈ (run.linked i).main.stage.carrier from by simpa only [run.linked_main i] using hc) - (show e ∈ (run.linked i).main.stage.carrier from by simpa only [run.linked_main i] using he) - hF (by simpa only [run.linked_main i] using filter) - (by simpa only [run.linked_main i] using lower) - (by simpa only [run.linked_main i] using strict) - (by simpa only [run.linked_main i] using above) - simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, - run.linked_main i, run.linked_main j] using families - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingInsertionFulfillment + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem insertionFamilies_of_taskBearing {i j : I} (before : i ≤ j) + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {c e F : ZFSet.{u}} (hLabels : Labels ∈ M.sets) + (hc : c ∈ (run.diagram.stage i).stage.carrier) + (he : e ∈ (run.diagram.stage i).stage.carrier) (hF : F ∈ M.sets) + (filter : MeetFilterCode (run.diagram.stage i).stage.carrier + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph F) + (lower : ZFSet.pair c e ∈ (run.diagram.stage i).stage.order) + (strict : ZFSet.pair e c ∉ (run.diagram.stage i).stage.order) + (above : ∀ x ∈ F, ZFSet.pair e x ∈ (run.diagram.stage i).stage.order) : + ∃ capFamily ∈ M.sets, ∃ actorFamily ∈ M.sets, + InjectionCode Labels (run.diagram.stage j).stage.carrier capFamily ∧ + InjectionCode Labels (run.diagram.stage j).stage.actors actorFamily ∧ + (∀ label k top' v, ZFSet.pair label k ∈ actorFamily → + ZFSet.pair (run.diagram.stage i).stage.top top' ∈ (run.diagram.transition before).map.points → + (ZFSet.pair (ZFSet.pair k top') v ∈ (run.diagram.stage j).stage.action ↔ + ZFSet.pair label v ∈ capFamily)) ∧ + ∀ c' e', ZFSet.pair c c' ∈ (run.diagram.transition before).map.points → + ZFSet.pair e e' ∈ (run.diagram.transition before).map.points → + (∀ label k, ZFSet.pair label k ∈ actorFamily → + ∀ z ∈ (run.diagram.stage j).stage.carrier, + ZFSet.pair z c' ∈ (run.diagram.stage j).stage.order → + ZFSet.pair (ZFSet.pair k z) z ∈ (run.diagram.stage j).stage.action) ∧ + (∀ label k cap, ZFSet.pair label k ∈ actorFamily → ZFSet.pair label cap ∈ capFamily → + ∀ x x' y, ZFSet.pair x x' ∈ (run.diagram.transition before).map.points → + ZFSet.pair (ZFSet.pair k x') y ∈ (run.diagram.stage j).stage.action → + ZFSet.pair y cap ∈ (run.diagram.stage j).stage.order) ∧ + (∀ label cap, ZFSet.pair label cap ∈ capFamily → + CodedCapProfile (run.diagram.stage j).stage.carrier (run.diagram.stage j).stage.order + (run.diagram.stage j).stage.meetGraph c' e' cap + (relationImage F (run.diagram.stage j).stage.carrier + (run.diagram.transition before).map.points)) ∧ + (∀ first second cap₁ cap₂, ZFSet.pair first cap₁ ∈ capFamily → + ZFSet.pair second cap₂ ∈ capFamily → first ≠ second → + ZFSet.pair (ZFSet.pair cap₁ cap₂) c' ∈ (run.diagram.stage j).stage.meetGraph) := by + let transition := (run.diagram.transition before).retargetEq + (run.linked_main i).symm (run.linked_main j).symm + have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked i).code (run.linked j).code transition.map.code := by + simpa only [transition, GroundChronologicalMainTransition.retargetEq_code] using code + have families := actual.exists_insertionFamilies pairing unions powers separation choice hLabels + (show c ∈ (run.linked i).main.stage.carrier from by simpa only [run.linked_main i] using hc) + (show e ∈ (run.linked i).main.stage.carrier from by simpa only [run.linked_main i] using he) + hF (by simpa only [run.linked_main i] using filter) + (by simpa only [run.linked_main i] using lower) + (by simpa only [run.linked_main i] using strict) + (by simpa only [run.linked_main i] using above) + simpa only [transition, GroundChronologicalMainTransition.retargetEq_points, + run.linked_main i, run.linked_main j] using families + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitBottom.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitBottom.lean index 844366aca1e92390e0700b923dea4085fb24bdaf..5e9f158c2b5f0069b4e8947f94595e2c2c10d529 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitBottom.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitBottom.lean @@ -1,570 +1,570 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedOperationLifts -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitGroupLaws - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix - -section -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -def LimitLE (p q : ZFSet.{u}) : Prop := - ∃ i x y, x ∈ (run.diagram.stage i).stage.carrier ∧ - y ∈ (run.diagram.stage i).stage.carrier ∧ - p = run.pointPresentation.limitPoint i x ∧ q = run.pointPresentation.limitPoint i y ∧ - ZFSet.pair x y ∈ (run.diagram.stage i).stage.order - -theorem point_order_congr {i j : I} {x y a b : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) - (hy : y ∈ (run.diagram.stage i).stage.carrier) - (ha : a ∈ (run.diagram.stage j).stage.carrier) - (hb : b ∈ (run.diagram.stage j).stage.carrier) - (first : run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j a) - (second : run.pointPresentation.limitPoint i y = run.pointPresentation.limitPoint j b) : - ZFSet.pair x y ∈ (run.diagram.stage i).stage.order ↔ - ZFSet.pair a b ∈ (run.diagram.stage j).stage.order := by - obtain ⟨k, ik, jk⟩ := run.common_upper i j - obtain ⟨x', xx'⟩ := run.pointSystem.map_entry_total ik hx - obtain ⟨y', yy'⟩ := run.pointSystem.map_entry_total ik hy - obtain ⟨a', aa'⟩ := run.pointSystem.map_entry_total jk ha - obtain ⟨b', bb'⟩ := run.pointSystem.map_entry_total jk hb - have equalX := (run.pointSystem.related_iff_common_images ik jk xx' aa').1 - ((run.pointPresentation.limitPoint_eq_iff_related hx ha).1 first) - have equalY := (run.pointSystem.related_iff_common_images ik jk yy' bb').1 - ((run.pointPresentation.limitPoint_eq_iff_related hy hb).1 second) - subst a' - subst b' - exact ((run.diagram.transition ik).map.order_iff x y x' y' xx' yy').symm.trans - ((run.diagram.transition jk).map.order_iff a b x' y' aa' bb') - -theorem limitLE_bounds {p q : ZFSet.{u}} (lower : run.LimitLE p q) : - p ∈ run.limitPoints ∧ q ∈ run.limitPoints := by - obtain ⟨i, x, y, hx, hy, rfl, rfl, _⟩ := lower - exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy⟩ - -theorem limitLE_at (i : I) {x y : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) - (hy : y ∈ (run.diagram.stage i).stage.carrier) : - run.LimitLE (run.pointPresentation.limitPoint i x) (run.pointPresentation.limitPoint i y) ↔ - ZFSet.pair x y ∈ (run.diagram.stage i).stage.order := by - constructor - · rintro ⟨j, a, b, ha, hb, first, second, lower⟩ - exact (run.point_order_congr hx hy ha hb first second).2 lower - · intro lower - exact ⟨i, x, y, hx, hy, rfl, rfl, lower⟩ - -theorem limitLE_refl {p : ZFSet.{u}} (member : p ∈ run.limitPoints) : run.LimitLE p p := by - obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage member - exact (run.limitLE_at i hx hx).2 ((run.diagram.stage i).stage.meet.order.refl x hx) - -theorem limitLE_antisymm {p q : ZFSet.{u}} - (first : run.LimitLE p q) (second : run.LimitLE q p) : p = q := by - obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage - (run.limitLE_bounds first).1 (run.limitLE_bounds first).2 - have equal := (run.diagram.stage i).stage.meet.order.antisymm x hx y hy - ((run.limitLE_at i hx hy).1 first) ((run.limitLE_at i hy hx).1 second) - exact congrArg (run.pointPresentation.limitPoint i) equal - -theorem limitLE_trans {p q r : ZFSet.{u}} - (first : run.LimitLE p q) (second : run.LimitLE q r) : run.LimitLE p r := by - obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl⟩ := run.pointPresentation.triple_coverage - (run.limitLE_bounds first).1 (run.limitLE_bounds first).2 (run.limitLE_bounds second).2 - exact (run.limitLE_at i hx hz).2 ((run.diagram.stage i).stage.meet.order.trans x hx y hy z hz - ((run.limitLE_at i hx hy).1 first) ((run.limitLE_at i hy hz).1 second)) - -end - -section -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank run.code < o) -include limit rank - -theorem limitPointLabels_rank_lt : ZFSet.rank run.limitPointLabels < o := - indexedCarrierLabels_rank_lt limit run.carrierFamily - (run.indices_rank_le_code.trans_lt rank) (run.carrierUnion_rank_le_code.trans_lt rank) - -theorem limitPointRelation_rank_lt : ZFSet.rank run.limitPointRelation < o := - directLimitRelation_rank_lt limit run.indices run.carrierUnion run.pointMapFamily - (run.limitPointLabels_rank_lt limit rank) - -theorem limitPoints_rank_lt : ZFSet.rank run.limitPoints < o := - equivalenceClasses_rank_lt limit run.limitPointRelation (run.limitPointLabels_rank_lt limit rank) - -theorem limitPointMap_rank_lt (i : I) : ZFSet.rank (run.limitPointMap i) < o := - indexedClassInclusion_rank_lt limit run.limitPointRelation (run.key i) - (run.carrierUnion_rank_le_code.trans_lt rank) (run.limitPointLabels_rank_lt limit rank) - -theorem limitPointInclusions_rank_lt : ZFSet.rank run.limitPointInclusions < o := - M.indexedClassInclusions_rank_lt limit run.limitPointRelation - (run.indices_rank_le_code.trans_lt rank) (run.carrierUnion_rank_le_code.trans_lt rank) - (run.limitPointLabels_rank_lt limit rank) - -theorem limitActorLabels_rank_lt : ZFSet.rank run.limitActorLabels < o := - indexedCarrierLabels_rank_lt limit run.actorFamily - (run.indices_rank_le_code.trans_lt rank) (run.actorUnion_rank_le_code.trans_lt rank) - -theorem limitActorRelation_rank_lt : ZFSet.rank run.limitActorRelation < o := - directLimitRelation_rank_lt limit run.indices run.actorUnion run.actorMapFamily - (run.limitActorLabels_rank_lt limit rank) - -theorem limitActors_rank_lt : ZFSet.rank run.limitActors < o := - equivalenceClasses_rank_lt limit run.limitActorRelation (run.limitActorLabels_rank_lt limit rank) - -theorem limitActorMap_rank_lt (i : I) : ZFSet.rank (run.limitActorMap i) < o := - indexedClassInclusion_rank_lt limit run.limitActorRelation (run.key i) - (run.actorUnion_rank_le_code.trans_lt rank) (run.limitActorLabels_rank_lt limit rank) - -theorem limitActorInclusions_rank_lt : ZFSet.rank run.limitActorInclusions < o := - M.indexedClassInclusions_rank_lt limit run.limitActorRelation - (run.indices_rank_le_code.trans_lt rank) (run.actorUnion_rank_le_code.trans_lt rank) - (run.limitActorLabels_rank_lt limit rank) - -end - -section -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -def LimitMeet (p q r : ZFSet.{u}) : Prop := - ∃ i x y z, x ∈ (run.diagram.stage i).stage.carrier ∧ - y ∈ (run.diagram.stage i).stage.carrier ∧ z ∈ (run.diagram.stage i).stage.carrier ∧ - p = run.pointPresentation.limitPoint i x ∧ q = run.pointPresentation.limitPoint i y ∧ - r = run.pointPresentation.limitPoint i z ∧ - ZFSet.pair (ZFSet.pair x y) z ∈ (run.diagram.stage i).stage.meetGraph - -theorem limitMeet_bounds {p q r : ZFSet.{u}} (meet : run.LimitMeet p q r) : - p ∈ run.limitPoints ∧ q ∈ run.limitPoints ∧ r ∈ run.limitPoints := by - obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, _⟩ := meet - exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy, - run.pointPresentation.limitPoint_mem hz⟩ - -theorem limitMeet_lower_left {p q r : ZFSet.{u}} (meet : run.LimitMeet p q r) : - run.LimitLE r p := by - obtain ⟨i, x, y, z, hx, _, hz, rfl, rfl, rfl, entry⟩ := meet - exact (run.limitLE_at i hz hx).2 ((run.diagram.stage i).stage.meet.lower_left x y z entry) - -theorem limitMeet_lower_right {p q r : ZFSet.{u}} (meet : run.LimitMeet p q r) : - run.LimitLE r q := by - obtain ⟨i, x, y, z, _, hy, hz, rfl, rfl, rfl, entry⟩ := meet - exact (run.limitLE_at i hz hy).2 ((run.diagram.stage i).stage.meet.lower_right x y z entry) - -theorem limitMeet_greatest {p q r w : ZFSet.{u}} (meet : run.LimitMeet p q r) - (first : run.LimitLE w p) (second : run.LimitLE w q) : run.LimitLE w r := by - obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ := meet - obtain ⟨j, a, ha, rfl⟩ := run.pointPresentation.limitPoint_coverage (run.limitLE_bounds first).1 - obtain ⟨k, ik, jk⟩ := run.common_upper i j - obtain ⟨x', xx'⟩ := run.pointSystem.map_entry_total ik hx - obtain ⟨y', yy'⟩ := run.pointSystem.map_entry_total ik hy - obtain ⟨z', zz'⟩ := run.pointSystem.map_entry_total ik hz - obtain ⟨a', aa'⟩ := run.pointSystem.map_entry_total jk ha - have hx' := (run.pointSystem.map_entry_bounds ik xx').2 - have hy' := (run.pointSystem.map_entry_bounds ik yy').2 - have hz' := (run.pointSystem.map_entry_bounds ik zz').2 - have ha' := (run.pointSystem.map_entry_bounds jk aa').2 - have mapped := (run.diagram.transition ik).map.point_embedding.map_meet - x y z x' y' z' entry xx' yy' zz' - have ax : run.LimitLE (run.pointPresentation.limitPoint k a') - (run.pointPresentation.limitPoint k x') := by - rw [← run.pointPresentation.limitPoint_transition jk aa', - ← run.pointPresentation.limitPoint_transition ik xx'] - exact first - have ay : run.LimitLE (run.pointPresentation.limitPoint k a') - (run.pointPresentation.limitPoint k y') := by - rw [← run.pointPresentation.limitPoint_transition jk aa', - ← run.pointPresentation.limitPoint_transition ik yy'] - exact second - rw [run.pointPresentation.limitPoint_transition jk aa', - run.pointPresentation.limitPoint_transition ik zz'] - exact (run.limitLE_at k ha' hz').2 ((run.diagram.stage k).stage.meet.greatest - x' y' z' a' ha' mapped ((run.limitLE_at k ha' hx').1 ax) ((run.limitLE_at k ha' hy').1 ay)) - -theorem limitMeet_total {p q : ZFSet.{u}} (hp : p ∈ run.limitPoints) (hq : q ∈ run.limitPoints) : - ∃ r ∈ run.limitPoints, run.LimitMeet p q r := by - obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage hp hq - obtain ⟨z, entry, _⟩ := (run.diagram.stage i).stage.meet.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.meet.operation.1 entry)).2 - exact ⟨run.pointPresentation.limitPoint i z, run.pointPresentation.limitPoint_mem hz, - i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ - -theorem limitMeet_unique {p q r s : ZFSet.{u}} - (first : run.LimitMeet p q r) (second : run.LimitMeet p q s) : r = s := - run.limitLE_antisymm - (run.limitMeet_greatest second (run.limitMeet_lower_left first) (run.limitMeet_lower_right first)) - (run.limitMeet_greatest first (run.limitMeet_lower_left second) (run.limitMeet_lower_right second)) - -theorem limitMeet_at (i : I) {x y z : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) - (hy : y ∈ (run.diagram.stage i).stage.carrier) - (hz : z ∈ (run.diagram.stage i).stage.carrier) : - run.LimitMeet (run.pointPresentation.limitPoint i x) (run.pointPresentation.limitPoint i y) - (run.pointPresentation.limitPoint i z) ↔ - ZFSet.pair (ZFSet.pair x y) z ∈ (run.diagram.stage i).stage.meetGraph := by - constructor - · intro meet - obtain ⟨w, entry, _⟩ := (run.diagram.stage i).stage.meet.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.meet.operation.1 entry)).2 - have canonical : run.LimitMeet (run.pointPresentation.limitPoint i x) - (run.pointPresentation.limitPoint i y) (run.pointPresentation.limitPoint i w) := - ⟨i, x, y, w, hx, hy, hw, rfl, rfl, rfl, entry⟩ - have equal := (run.pointPresentation.limitPoint_same_iff hz hw).1 - (run.limitMeet_unique meet canonical) - subst w - exact entry - · intro entry - exact ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ - -noncomputable def limitMultiplication : ZFSet.{u} := - indexedBinaryLift run.indices run.actorUnion run.limitActors (run.stageFieldFamily 4) run.limitActorInclusions - -noncomputable def limitInverse : ZFSet.{u} := - indexedRelationLift run.indices run.actorUnion run.limitActors (run.stageFieldFamily 5) run.limitActorInclusions - -theorem limitMultiplication_ground : run.limitMultiplication ∈ M.sets := - M.indexedBinaryLift_mem pairing unions powers separation run.indices_ground run.actorUnion_ground - run.limitActors_ground (run.stageFieldFamily_ground 4) run.limitActorInclusions_ground - -theorem limitInverse_ground : run.limitInverse ∈ M.sets := - M.indexedRelationLift_mem pairing unions powers separation run.indices_ground run.actorUnion_ground - run.limitActors_ground (run.stageFieldFamily_ground 5) run.limitActorInclusions_ground - -theorem limitMultiplication_entry (g h k : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair g h) k ∈ run.limitMultiplication ↔ run.LimitMul g h k := by - rw [limitMultiplication, triple_mem_indexedBinaryLift] - constructor - · rintro ⟨_, _, _, j, hj, m, e, a, _, b, _, c, _, operation, inclusion, first, second, third, mul⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hj - have em : m = (run.diagram.stage i).stage.multiplication := (run.stageFieldFamily_entry 4 i m).1 operation - have ee := (run.limitActorInclusions_entry i e).1 inclusion - subst m - subst e - obtain ⟨ha, eg⟩ := (run.actorPresentation.inclusion_entry i a g).1 first - obtain ⟨hb, eh⟩ := (run.actorPresentation.inclusion_entry i b h).1 second - obtain ⟨hc, ek⟩ := (run.actorPresentation.inclusion_entry i c k).1 third - exact ⟨i, a, b, c, ha, hb, hc, eg, eh, ek, mul⟩ - · rintro ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, mul⟩ - exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb, - run.actorPresentation.limitPoint_mem hc, run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, - (run.diagram.stage i).stage.multiplication, run.limitActorMap i, - a, run.actorPresentation.carrier_bound i ha, b, run.actorPresentation.carrier_bound i hb, - c, run.actorPresentation.carrier_bound i hc, - (run.stageFieldFamily_entry 4 i _).2 rfl, (run.limitActorInclusions_entry i _).2 rfl, - (run.actorPresentation.inclusion_entry i a _).2 ⟨ha, rfl⟩, - (run.actorPresentation.inclusion_entry i b _).2 ⟨hb, rfl⟩, - (run.actorPresentation.inclusion_entry i c _).2 ⟨hc, rfl⟩, mul⟩ - -theorem limitInverse_entry (g h : ZFSet.{u}) : - ZFSet.pair g h ∈ run.limitInverse ↔ run.LimitInv g h := by - rw [limitInverse, pair_mem_indexedRelationLift] - constructor - · rintro ⟨_, _, j, hj, r, e, a, _, b, _, operation, inclusion, first, second, inverse⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hj - have er : r = (run.diagram.stage i).stage.inverse := (run.stageFieldFamily_entry 5 i r).1 operation - have ee := (run.limitActorInclusions_entry i e).1 inclusion - subst r - subst e - obtain ⟨ha, eg⟩ := (run.actorPresentation.inclusion_entry i a g).1 first - obtain ⟨hb, eh⟩ := (run.actorPresentation.inclusion_entry i b h).1 second - exact ⟨i, a, b, ha, hb, eg, eh, inverse⟩ - · rintro ⟨i, a, b, ha, hb, rfl, rfl, inverse⟩ - exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb, - run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, (run.diagram.stage i).stage.inverse, - run.limitActorMap i, a, run.actorPresentation.carrier_bound i ha, - b, run.actorPresentation.carrier_bound i hb, - (run.stageFieldFamily_entry 5 i _).2 rfl, (run.limitActorInclusions_entry i _).2 rfl, - (run.actorPresentation.inclusion_entry i a _).2 ⟨ha, rfl⟩, - (run.actorPresentation.inclusion_entry i b _).2 ⟨hb, rfl⟩, inverse⟩ - -theorem limitMultiplication_function : - ZFSet.IsFunc (ZFSet.prod run.limitActors run.limitActors) run.limitActors run.limitMultiplication := by - refine ⟨indexedBinaryLift_subset _ _ _ _ _, ?_⟩ - intro p hp - obtain ⟨g, hg, h, hh, rfl⟩ := ZFSet.mem_prod.1 hp - obtain ⟨k, _, product⟩ := run.limitMul_total hg hh - refine ⟨k, (run.limitMultiplication_entry g h k).2 product, ?_⟩ - intro l entry - exact run.limitMul_unique ((run.limitMultiplication_entry g h l).1 entry) product - -theorem limitInverse_function : ZFSet.IsFunc run.limitActors run.limitActors run.limitInverse := by - refine ⟨indexedRelationLift_subset _ _ _ _ _, ?_⟩ - intro g hg - obtain ⟨h, _, inverse⟩ := run.limitInv_total hg - refine ⟨h, (run.limitInverse_entry g h).2 inverse, ?_⟩ - intro k entry - exact run.limitInv_unique ((run.limitInverse_entry g k).1 entry) inverse - -theorem limitMultiplication_at (i : I) {a b c : ZFSet.{u}} - (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) - (hc : c ∈ (run.diagram.stage i).stage.actors) : - ZFSet.pair (ZFSet.pair (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b)) - (run.actorPresentation.limitPoint i c) ∈ run.limitMultiplication ↔ - ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication := - (run.limitMultiplication_entry _ _ _).trans (run.limitMul_at i ha hb hc) - -theorem limitInverse_at (i : I) {a b : ZFSet.{u}} - (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) : - ZFSet.pair (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b) ∈ - run.limitInverse ↔ ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse := - (run.limitInverse_entry _ _).trans (run.limitInv_at i ha hb) - -theorem limitMultiplication_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitMultiplication < o := - indexedBinaryLift_rank_lt limit _ _ _ _ (run.limitActors_rank_lt limit rank) - -theorem limitInverse_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitInverse < o := - indexedRelationLift_rank_lt limit _ _ _ _ (run.limitActors_rank_lt limit rank) - -end - -section -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_limitTransitionRow {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : - ∃ row ∈ M.sets, FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row ∧ - (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = ZFSet.pair (run.limitPointMap i) (run.limitActorMap i)) ∧ - ZFSet.rank row < o := by - let P := run.limitPointInclusions.sUnion.sUnion - let A := run.limitActorInclusions.sUnion.sUnion - let F := pairedGraph run.indices P A run.limitPointInclusions run.limitActorInclusions - let T := ZFSet.prod {run.indices} run.indices - let row := relationCompose T run.indices (ZFSet.prod P A) - (productSecond {run.indices} run.indices) F - have hP : P ∈ M.sets := M.union_mem unions (M.union_mem unions run.limitPointInclusions_ground) - have hA : A ∈ M.sets := M.union_mem unions (M.union_mem unions run.limitActorInclusions_ground) - have hPair := M.prod_mem pairing unions powers separation hP hA - have hF : F ∈ M.sets := M.pairedGraph_mem pairing unions powers separation - run.indices_ground hP hA run.limitPointInclusions_ground run.limitActorInclusions_ground - have hSingleton : ({run.indices} : ZFSet.{u}) ∈ M.sets := by - rw [← ZFSet.pair_eq_singleton] - exact M.unorderedPair_mem pairing run.indices_ground run.indices_ground - have hT : T ∈ M.sets := M.prod_mem pairing unions powers separation hSingleton run.indices_ground - have funcF : ZFSet.IsFunc run.indices (ZFSet.prod P A) F := - pairedGraph_function_of_subset run.limitPointInclusions_function.to_isFunc - run.limitActorInclusions_function.to_isFunc (fun _ h => h) - have func : ZFSet.IsFunc T (ZFSet.prod P A) row := - relationCompose_function_of_subset (productSecond_function {run.indices} run.indices) - funcF (fun _ h => h) - refine ⟨row, M.relationCompose_mem pairing unions powers separation hT run.indices_ground hPair - (M.productSecond_mem pairing unions powers separation hSingleton run.indices_ground) hF, - ⟨_, func⟩, ?_, ?_⟩ - · intro i z - have hi : run.key i ∈ run.indices := ZFSet.mem_range.2 ⟨i, rfl⟩ - have point := (run.limitPointInclusions_entry i _).2 rfl - have actor := (run.limitActorInclusions_entry i _).2 rfl - have value : ZFSet.pair (run.key i) - (ZFSet.pair (run.limitPointMap i) (run.limitActorMap i)) ∈ F := - (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 - ⟨hi, pair_second_mem_doubleUnion point, pair_second_mem_doubleUnion actor, point, actor⟩ - have actual : ZFSet.pair (ZFSet.pair run.indices (run.key i)) - (ZFSet.pair (run.limitPointMap i) (run.limitActorMap i)) ∈ row := - (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hi⟩, - (ZFSet.pair_mem_prod.1 (funcF.1 value)).2, run.key i, hi, - (mem_productSecond _ _ _).2 ⟨run.indices, ZFSet.mem_singleton.2 rfl, run.key i, hi, rfl⟩, - value⟩ - exact ⟨fun entry => (FunctionGraphOn.unique ⟨_, func⟩ entry actual), fun equal => equal.symm ▸ actual⟩ - · have indexRank := run.indices_rank_le_code.trans_lt rank - have pointRank : ZFSet.rank P < o := - ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans_lt - (run.limitPointInclusions_rank_lt limit rank) - have actorRank : ZFSet.rank A < o := - ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans_lt - (run.limitActorInclusions_rank_lt limit rank) - exact (ZFSet.rank_mono func.1).trans_lt - (rank_product_lt limit (rank_product_lt limit (rank_singleton_lt limit indexRank) indexRank) - (rank_product_lt limit pointRank actorRank)) - -end - -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def limitOrder : ZFSet.{u} := - indexedRelationLift run.indices run.carrierUnion run.limitPoints - (run.stageFieldFamily 1) run.limitPointInclusions - -noncomputable def limitMeetGraph : ZFSet.{u} := - indexedBinaryLift run.indices run.carrierUnion run.limitPoints - (run.stageFieldFamily 2) run.limitPointInclusions - -theorem limitOrder_ground : run.limitOrder ∈ M.sets := - M.indexedRelationLift_mem pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.limitPoints_ground (run.stageFieldFamily_ground 1) - run.limitPointInclusions_ground - -theorem limitMeetGraph_ground : run.limitMeetGraph ∈ M.sets := - M.indexedBinaryLift_mem pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.limitPoints_ground (run.stageFieldFamily_ground 2) - run.limitPointInclusions_ground - -theorem limitOrder_entry (p q : ZFSet.{u}) : - ZFSet.pair p q ∈ run.limitOrder ↔ run.LimitLE p q := by - rw [limitOrder, pair_mem_indexedRelationLift] - constructor - · rintro ⟨_, _, k, hk, r, e, x, _, y, _, relation, inclusion, first, second, lower⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk - have er : r = (run.diagram.stage i).stage.order := (run.stageFieldFamily_entry 1 i r).1 relation - have ee := (run.limitPointInclusions_entry i e).1 inclusion - subst r - subst e - obtain ⟨hx, ep⟩ := (run.pointPresentation.inclusion_entry i x p).1 first - obtain ⟨hy, eq⟩ := (run.pointPresentation.inclusion_entry i y q).1 second - exact ⟨i, x, y, hx, hy, ep, eq, lower⟩ - · rintro ⟨i, x, y, hx, hy, rfl, rfl, lower⟩ - exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy, - run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, (run.diagram.stage i).stage.order, - run.limitPointMap i, x, run.pointPresentation.carrier_bound i hx, - y, run.pointPresentation.carrier_bound i hy, - (run.stageFieldFamily_entry 1 i _).2 rfl, (run.limitPointInclusions_entry i _).2 rfl, - (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, - (run.pointPresentation.inclusion_entry i y _).2 ⟨hy, rfl⟩, lower⟩ - -theorem limitMeetGraph_entry (p q v : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair p q) v ∈ run.limitMeetGraph ↔ run.LimitMeet p q v := by - rw [limitMeetGraph, triple_mem_indexedBinaryLift] - constructor - · rintro ⟨_, _, _, k, hk, b, e, x, _, y, _, z, _, operation, inclusion, first, second, third, meet⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk - have eb : b = (run.diagram.stage i).stage.meetGraph := (run.stageFieldFamily_entry 2 i b).1 operation - have ee := (run.limitPointInclusions_entry i e).1 inclusion - subst b - subst e - obtain ⟨hx, ep⟩ := (run.pointPresentation.inclusion_entry i x p).1 first - obtain ⟨hy, eq⟩ := (run.pointPresentation.inclusion_entry i y q).1 second - obtain ⟨hz, ev⟩ := (run.pointPresentation.inclusion_entry i z v).1 third - exact ⟨i, x, y, z, hx, hy, hz, ep, eq, ev, meet⟩ - · rintro ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, meet⟩ - exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy, - run.pointPresentation.limitPoint_mem hz, run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, - (run.diagram.stage i).stage.meetGraph, run.limitPointMap i, - x, run.pointPresentation.carrier_bound i hx, y, run.pointPresentation.carrier_bound i hy, - z, run.pointPresentation.carrier_bound i hz, - (run.stageFieldFamily_entry 2 i _).2 rfl, (run.limitPointInclusions_entry i _).2 rfl, - (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, - (run.pointPresentation.inclusion_entry i y _).2 ⟨hy, rfl⟩, - (run.pointPresentation.inclusion_entry i z _).2 ⟨hz, rfl⟩, meet⟩ - -theorem limitOrder_code : PartialOrderCode run.limitPoints run.limitOrder where - relation := indexedRelationLift_subset _ _ _ _ _ - refl x hx := (run.limitOrder_entry x x).2 (run.limitLE_refl hx) - antisymm x _ y _ first second := run.limitLE_antisymm - ((run.limitOrder_entry x y).1 first) ((run.limitOrder_entry y x).1 second) - trans x _ y _ z _ first second := (run.limitOrder_entry x z).2 - (run.limitLE_trans ((run.limitOrder_entry x y).1 first) ((run.limitOrder_entry y z).1 second)) - -theorem limitMeet_code : MeetOrderCode run.limitPoints run.limitOrder run.limitMeetGraph where - order := run.limitOrder_code - operation := by - refine ⟨indexedBinaryLift_subset _ _ _ _ _, ?_⟩ - intro w hw - obtain ⟨p, hp, q, hq, rfl⟩ := ZFSet.mem_prod.1 hw - obtain ⟨v, _, meet⟩ := run.limitMeet_total hp hq - refine ⟨v, (run.limitMeetGraph_entry p q v).2 meet, ?_⟩ - intro v' entry - exact run.limitMeet_unique ((run.limitMeetGraph_entry p q v').1 entry) meet - lower_left p q v entry := (run.limitOrder_entry v p).2 - (run.limitMeet_lower_left ((run.limitMeetGraph_entry p q v).1 entry)) - lower_right p q v entry := (run.limitOrder_entry v q).2 - (run.limitMeet_lower_right ((run.limitMeetGraph_entry p q v).1 entry)) - greatest p q v w _ entry first second := (run.limitOrder_entry w v).2 - (run.limitMeet_greatest ((run.limitMeetGraph_entry p q v).1 entry) - ((run.limitOrder_entry w p).1 first) ((run.limitOrder_entry w q).1 second)) - -theorem limitPointMap_order_iff (i : I) (x y p q : ZFSet.{u}) - (first : ZFSet.pair x p ∈ run.limitPointMap i) - (second : ZFSet.pair y q ∈ run.limitPointMap i) : - ZFSet.pair p q ∈ run.limitOrder ↔ ZFSet.pair x y ∈ (run.diagram.stage i).stage.order := by - obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x p).1 first - obtain ⟨hy, rfl⟩ := (run.pointPresentation.inclusion_entry i y q).1 second - exact (run.limitOrder_entry _ _).trans (run.limitLE_at i hx hy) - -theorem limitPointMap_meetEmbedding (i : I) : - MeetEmbeddingCode (run.diagram.stage i).stage.carrier run.limitPoints - (run.diagram.stage i).stage.order run.limitOrder - (run.diagram.stage i).stage.meetGraph run.limitMeetGraph (run.limitPointMap i) where - injection := run.limitPointMap_injection i - monotone x y p q lower first second := (run.limitPointMap_order_iff i x y p q first second).2 lower - map_meet x y z p q v meet first second third := by - obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x p).1 first - obtain ⟨hy, rfl⟩ := (run.pointPresentation.inclusion_entry i y q).1 second - obtain ⟨hz, rfl⟩ := (run.pointPresentation.inclusion_entry i z v).1 third - exact (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hx hy hz).2 meet) - -theorem limitOrder_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitOrder < o := - indexedRelationLift_rank_lt limit _ _ _ _ (run.limitPoints_rank_lt limit rank) - -theorem limitMeetGraph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitMeetGraph < o := - indexedBinaryLift_rank_lt limit _ _ _ _ (run.limitPoints_rank_lt limit rank) - -noncomputable def limitBottom (i : I) : ZFSet.{u} := - run.pointPresentation.limitPoint i (run.diagram.stage i).stage.bottom - -theorem limitBottom_mem (i : I) : run.limitBottom i ∈ run.limitPoints := - run.pointPresentation.limitPoint_mem (run.diagram.stage i).stage.bottom_mem - -theorem limitBottom_ground (i : I) : run.limitBottom i ∈ M.sets := - M.transitive run.limitPoints_ground (run.limitBottom_mem i) - -theorem limitBottom_eq (i j : I) : run.limitBottom i = run.limitBottom j := by - obtain ⟨k, ik, jk⟩ := run.common_upper i j - exact (run.pointPresentation.limitPoint_transition ik (run.diagram.transition ik).map.bottom).trans - (run.pointPresentation.limitPoint_transition jk (run.diagram.transition jk).map.bottom).symm - -theorem limitBottom_least (i : I) (q : ZFSet.{u}) (member : q ∈ run.limitPoints) : - ZFSet.pair (run.limitBottom i) q ∈ run.limitOrder := by - obtain ⟨j, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage member - rw [run.limitBottom_eq i j] - exact (run.limitOrder_entry _ _).2 ((run.limitLE_at j (run.diagram.stage j).stage.bottom_mem hx).2 - ((run.diagram.stage j).stage.least x hx)) - -theorem limitPointMap_bottom (i₀ i : I) : - ZFSet.pair (run.diagram.stage i).stage.bottom (run.limitBottom i₀) ∈ run.limitPointMap i := - (run.pointPresentation.inclusion_entry i _ _).2 - ⟨(run.diagram.stage i).stage.bottom_mem, run.limitBottom_eq i₀ i⟩ - -theorem limitBottom_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) (i : I) : ZFSet.rank (run.limitBottom i) < o := - (ZFSet.rank_lt_of_mem (run.limitBottom_mem i)).trans (run.limitPoints_rank_lt limit rank) - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedOperationLifts +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitGroupLaws + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix + +section +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +def LimitLE (p q : ZFSet.{u}) : Prop := + ∃ i x y, x ∈ (run.diagram.stage i).stage.carrier ∧ + y ∈ (run.diagram.stage i).stage.carrier ∧ + p = run.pointPresentation.limitPoint i x ∧ q = run.pointPresentation.limitPoint i y ∧ + ZFSet.pair x y ∈ (run.diagram.stage i).stage.order + +theorem point_order_congr {i j : I} {x y a b : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) + (hy : y ∈ (run.diagram.stage i).stage.carrier) + (ha : a ∈ (run.diagram.stage j).stage.carrier) + (hb : b ∈ (run.diagram.stage j).stage.carrier) + (first : run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j a) + (second : run.pointPresentation.limitPoint i y = run.pointPresentation.limitPoint j b) : + ZFSet.pair x y ∈ (run.diagram.stage i).stage.order ↔ + ZFSet.pair a b ∈ (run.diagram.stage j).stage.order := by + obtain ⟨k, ik, jk⟩ := run.common_upper i j + obtain ⟨x', xx'⟩ := run.pointSystem.map_entry_total ik hx + obtain ⟨y', yy'⟩ := run.pointSystem.map_entry_total ik hy + obtain ⟨a', aa'⟩ := run.pointSystem.map_entry_total jk ha + obtain ⟨b', bb'⟩ := run.pointSystem.map_entry_total jk hb + have equalX := (run.pointSystem.related_iff_common_images ik jk xx' aa').1 + ((run.pointPresentation.limitPoint_eq_iff_related hx ha).1 first) + have equalY := (run.pointSystem.related_iff_common_images ik jk yy' bb').1 + ((run.pointPresentation.limitPoint_eq_iff_related hy hb).1 second) + subst a' + subst b' + exact ((run.diagram.transition ik).map.order_iff x y x' y' xx' yy').symm.trans + ((run.diagram.transition jk).map.order_iff a b x' y' aa' bb') + +theorem limitLE_bounds {p q : ZFSet.{u}} (lower : run.LimitLE p q) : + p ∈ run.limitPoints ∧ q ∈ run.limitPoints := by + obtain ⟨i, x, y, hx, hy, rfl, rfl, _⟩ := lower + exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy⟩ + +theorem limitLE_at (i : I) {x y : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) + (hy : y ∈ (run.diagram.stage i).stage.carrier) : + run.LimitLE (run.pointPresentation.limitPoint i x) (run.pointPresentation.limitPoint i y) ↔ + ZFSet.pair x y ∈ (run.diagram.stage i).stage.order := by + constructor + · rintro ⟨j, a, b, ha, hb, first, second, lower⟩ + exact (run.point_order_congr hx hy ha hb first second).2 lower + · intro lower + exact ⟨i, x, y, hx, hy, rfl, rfl, lower⟩ + +theorem limitLE_refl {p : ZFSet.{u}} (member : p ∈ run.limitPoints) : run.LimitLE p p := by + obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage member + exact (run.limitLE_at i hx hx).2 ((run.diagram.stage i).stage.meet.order.refl x hx) + +theorem limitLE_antisymm {p q : ZFSet.{u}} + (first : run.LimitLE p q) (second : run.LimitLE q p) : p = q := by + obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage + (run.limitLE_bounds first).1 (run.limitLE_bounds first).2 + have equal := (run.diagram.stage i).stage.meet.order.antisymm x hx y hy + ((run.limitLE_at i hx hy).1 first) ((run.limitLE_at i hy hx).1 second) + exact congrArg (run.pointPresentation.limitPoint i) equal + +theorem limitLE_trans {p q r : ZFSet.{u}} + (first : run.LimitLE p q) (second : run.LimitLE q r) : run.LimitLE p r := by + obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl⟩ := run.pointPresentation.triple_coverage + (run.limitLE_bounds first).1 (run.limitLE_bounds first).2 (run.limitLE_bounds second).2 + exact (run.limitLE_at i hx hz).2 ((run.diagram.stage i).stage.meet.order.trans x hx y hy z hz + ((run.limitLE_at i hx hy).1 first) ((run.limitLE_at i hy hz).1 second)) + +end + +section +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank run.code < o) +include limit rank + +theorem limitPointLabels_rank_lt : ZFSet.rank run.limitPointLabels < o := + indexedCarrierLabels_rank_lt limit run.carrierFamily + (run.indices_rank_le_code.trans_lt rank) (run.carrierUnion_rank_le_code.trans_lt rank) + +theorem limitPointRelation_rank_lt : ZFSet.rank run.limitPointRelation < o := + directLimitRelation_rank_lt limit run.indices run.carrierUnion run.pointMapFamily + (run.limitPointLabels_rank_lt limit rank) + +theorem limitPoints_rank_lt : ZFSet.rank run.limitPoints < o := + equivalenceClasses_rank_lt limit run.limitPointRelation (run.limitPointLabels_rank_lt limit rank) + +theorem limitPointMap_rank_lt (i : I) : ZFSet.rank (run.limitPointMap i) < o := + indexedClassInclusion_rank_lt limit run.limitPointRelation (run.key i) + (run.carrierUnion_rank_le_code.trans_lt rank) (run.limitPointLabels_rank_lt limit rank) + +theorem limitPointInclusions_rank_lt : ZFSet.rank run.limitPointInclusions < o := + M.indexedClassInclusions_rank_lt limit run.limitPointRelation + (run.indices_rank_le_code.trans_lt rank) (run.carrierUnion_rank_le_code.trans_lt rank) + (run.limitPointLabels_rank_lt limit rank) + +theorem limitActorLabels_rank_lt : ZFSet.rank run.limitActorLabels < o := + indexedCarrierLabels_rank_lt limit run.actorFamily + (run.indices_rank_le_code.trans_lt rank) (run.actorUnion_rank_le_code.trans_lt rank) + +theorem limitActorRelation_rank_lt : ZFSet.rank run.limitActorRelation < o := + directLimitRelation_rank_lt limit run.indices run.actorUnion run.actorMapFamily + (run.limitActorLabels_rank_lt limit rank) + +theorem limitActors_rank_lt : ZFSet.rank run.limitActors < o := + equivalenceClasses_rank_lt limit run.limitActorRelation (run.limitActorLabels_rank_lt limit rank) + +theorem limitActorMap_rank_lt (i : I) : ZFSet.rank (run.limitActorMap i) < o := + indexedClassInclusion_rank_lt limit run.limitActorRelation (run.key i) + (run.actorUnion_rank_le_code.trans_lt rank) (run.limitActorLabels_rank_lt limit rank) + +theorem limitActorInclusions_rank_lt : ZFSet.rank run.limitActorInclusions < o := + M.indexedClassInclusions_rank_lt limit run.limitActorRelation + (run.indices_rank_le_code.trans_lt rank) (run.actorUnion_rank_le_code.trans_lt rank) + (run.limitActorLabels_rank_lt limit rank) + +end + +section +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +def LimitMeet (p q r : ZFSet.{u}) : Prop := + ∃ i x y z, x ∈ (run.diagram.stage i).stage.carrier ∧ + y ∈ (run.diagram.stage i).stage.carrier ∧ z ∈ (run.diagram.stage i).stage.carrier ∧ + p = run.pointPresentation.limitPoint i x ∧ q = run.pointPresentation.limitPoint i y ∧ + r = run.pointPresentation.limitPoint i z ∧ + ZFSet.pair (ZFSet.pair x y) z ∈ (run.diagram.stage i).stage.meetGraph + +theorem limitMeet_bounds {p q r : ZFSet.{u}} (meet : run.LimitMeet p q r) : + p ∈ run.limitPoints ∧ q ∈ run.limitPoints ∧ r ∈ run.limitPoints := by + obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, _⟩ := meet + exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy, + run.pointPresentation.limitPoint_mem hz⟩ + +theorem limitMeet_lower_left {p q r : ZFSet.{u}} (meet : run.LimitMeet p q r) : + run.LimitLE r p := by + obtain ⟨i, x, y, z, hx, _, hz, rfl, rfl, rfl, entry⟩ := meet + exact (run.limitLE_at i hz hx).2 ((run.diagram.stage i).stage.meet.lower_left x y z entry) + +theorem limitMeet_lower_right {p q r : ZFSet.{u}} (meet : run.LimitMeet p q r) : + run.LimitLE r q := by + obtain ⟨i, x, y, z, _, hy, hz, rfl, rfl, rfl, entry⟩ := meet + exact (run.limitLE_at i hz hy).2 ((run.diagram.stage i).stage.meet.lower_right x y z entry) + +theorem limitMeet_greatest {p q r w : ZFSet.{u}} (meet : run.LimitMeet p q r) + (first : run.LimitLE w p) (second : run.LimitLE w q) : run.LimitLE w r := by + obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ := meet + obtain ⟨j, a, ha, rfl⟩ := run.pointPresentation.limitPoint_coverage (run.limitLE_bounds first).1 + obtain ⟨k, ik, jk⟩ := run.common_upper i j + obtain ⟨x', xx'⟩ := run.pointSystem.map_entry_total ik hx + obtain ⟨y', yy'⟩ := run.pointSystem.map_entry_total ik hy + obtain ⟨z', zz'⟩ := run.pointSystem.map_entry_total ik hz + obtain ⟨a', aa'⟩ := run.pointSystem.map_entry_total jk ha + have hx' := (run.pointSystem.map_entry_bounds ik xx').2 + have hy' := (run.pointSystem.map_entry_bounds ik yy').2 + have hz' := (run.pointSystem.map_entry_bounds ik zz').2 + have ha' := (run.pointSystem.map_entry_bounds jk aa').2 + have mapped := (run.diagram.transition ik).map.point_embedding.map_meet + x y z x' y' z' entry xx' yy' zz' + have ax : run.LimitLE (run.pointPresentation.limitPoint k a') + (run.pointPresentation.limitPoint k x') := by + rw [← run.pointPresentation.limitPoint_transition jk aa', + ← run.pointPresentation.limitPoint_transition ik xx'] + exact first + have ay : run.LimitLE (run.pointPresentation.limitPoint k a') + (run.pointPresentation.limitPoint k y') := by + rw [← run.pointPresentation.limitPoint_transition jk aa', + ← run.pointPresentation.limitPoint_transition ik yy'] + exact second + rw [run.pointPresentation.limitPoint_transition jk aa', + run.pointPresentation.limitPoint_transition ik zz'] + exact (run.limitLE_at k ha' hz').2 ((run.diagram.stage k).stage.meet.greatest + x' y' z' a' ha' mapped ((run.limitLE_at k ha' hx').1 ax) ((run.limitLE_at k ha' hy').1 ay)) + +theorem limitMeet_total {p q : ZFSet.{u}} (hp : p ∈ run.limitPoints) (hq : q ∈ run.limitPoints) : + ∃ r ∈ run.limitPoints, run.LimitMeet p q r := by + obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage hp hq + obtain ⟨z, entry, _⟩ := (run.diagram.stage i).stage.meet.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + have hz := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.meet.operation.1 entry)).2 + exact ⟨run.pointPresentation.limitPoint i z, run.pointPresentation.limitPoint_mem hz, + i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ + +theorem limitMeet_unique {p q r s : ZFSet.{u}} + (first : run.LimitMeet p q r) (second : run.LimitMeet p q s) : r = s := + run.limitLE_antisymm + (run.limitMeet_greatest second (run.limitMeet_lower_left first) (run.limitMeet_lower_right first)) + (run.limitMeet_greatest first (run.limitMeet_lower_left second) (run.limitMeet_lower_right second)) + +theorem limitMeet_at (i : I) {x y z : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) + (hy : y ∈ (run.diagram.stage i).stage.carrier) + (hz : z ∈ (run.diagram.stage i).stage.carrier) : + run.LimitMeet (run.pointPresentation.limitPoint i x) (run.pointPresentation.limitPoint i y) + (run.pointPresentation.limitPoint i z) ↔ + ZFSet.pair (ZFSet.pair x y) z ∈ (run.diagram.stage i).stage.meetGraph := by + constructor + · intro meet + obtain ⟨w, entry, _⟩ := (run.diagram.stage i).stage.meet.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.meet.operation.1 entry)).2 + have canonical : run.LimitMeet (run.pointPresentation.limitPoint i x) + (run.pointPresentation.limitPoint i y) (run.pointPresentation.limitPoint i w) := + ⟨i, x, y, w, hx, hy, hw, rfl, rfl, rfl, entry⟩ + have equal := (run.pointPresentation.limitPoint_same_iff hz hw).1 + (run.limitMeet_unique meet canonical) + subst w + exact entry + · intro entry + exact ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, entry⟩ + +noncomputable def limitMultiplication : ZFSet.{u} := + indexedBinaryLift run.indices run.actorUnion run.limitActors (run.stageFieldFamily 4) run.limitActorInclusions + +noncomputable def limitInverse : ZFSet.{u} := + indexedRelationLift run.indices run.actorUnion run.limitActors (run.stageFieldFamily 5) run.limitActorInclusions + +theorem limitMultiplication_ground : run.limitMultiplication ∈ M.sets := + M.indexedBinaryLift_mem pairing unions powers separation run.indices_ground run.actorUnion_ground + run.limitActors_ground (run.stageFieldFamily_ground 4) run.limitActorInclusions_ground + +theorem limitInverse_ground : run.limitInverse ∈ M.sets := + M.indexedRelationLift_mem pairing unions powers separation run.indices_ground run.actorUnion_ground + run.limitActors_ground (run.stageFieldFamily_ground 5) run.limitActorInclusions_ground + +theorem limitMultiplication_entry (g h k : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair g h) k ∈ run.limitMultiplication ↔ run.LimitMul g h k := by + rw [limitMultiplication, triple_mem_indexedBinaryLift] + constructor + · rintro ⟨_, _, _, j, hj, m, e, a, _, b, _, c, _, operation, inclusion, first, second, third, mul⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hj + have em : m = (run.diagram.stage i).stage.multiplication := (run.stageFieldFamily_entry 4 i m).1 operation + have ee := (run.limitActorInclusions_entry i e).1 inclusion + subst m + subst e + obtain ⟨ha, eg⟩ := (run.actorPresentation.inclusion_entry i a g).1 first + obtain ⟨hb, eh⟩ := (run.actorPresentation.inclusion_entry i b h).1 second + obtain ⟨hc, ek⟩ := (run.actorPresentation.inclusion_entry i c k).1 third + exact ⟨i, a, b, c, ha, hb, hc, eg, eh, ek, mul⟩ + · rintro ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, mul⟩ + exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb, + run.actorPresentation.limitPoint_mem hc, run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, + (run.diagram.stage i).stage.multiplication, run.limitActorMap i, + a, run.actorPresentation.carrier_bound i ha, b, run.actorPresentation.carrier_bound i hb, + c, run.actorPresentation.carrier_bound i hc, + (run.stageFieldFamily_entry 4 i _).2 rfl, (run.limitActorInclusions_entry i _).2 rfl, + (run.actorPresentation.inclusion_entry i a _).2 ⟨ha, rfl⟩, + (run.actorPresentation.inclusion_entry i b _).2 ⟨hb, rfl⟩, + (run.actorPresentation.inclusion_entry i c _).2 ⟨hc, rfl⟩, mul⟩ + +theorem limitInverse_entry (g h : ZFSet.{u}) : + ZFSet.pair g h ∈ run.limitInverse ↔ run.LimitInv g h := by + rw [limitInverse, pair_mem_indexedRelationLift] + constructor + · rintro ⟨_, _, j, hj, r, e, a, _, b, _, operation, inclusion, first, second, inverse⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hj + have er : r = (run.diagram.stage i).stage.inverse := (run.stageFieldFamily_entry 5 i r).1 operation + have ee := (run.limitActorInclusions_entry i e).1 inclusion + subst r + subst e + obtain ⟨ha, eg⟩ := (run.actorPresentation.inclusion_entry i a g).1 first + obtain ⟨hb, eh⟩ := (run.actorPresentation.inclusion_entry i b h).1 second + exact ⟨i, a, b, ha, hb, eg, eh, inverse⟩ + · rintro ⟨i, a, b, ha, hb, rfl, rfl, inverse⟩ + exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb, + run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, (run.diagram.stage i).stage.inverse, + run.limitActorMap i, a, run.actorPresentation.carrier_bound i ha, + b, run.actorPresentation.carrier_bound i hb, + (run.stageFieldFamily_entry 5 i _).2 rfl, (run.limitActorInclusions_entry i _).2 rfl, + (run.actorPresentation.inclusion_entry i a _).2 ⟨ha, rfl⟩, + (run.actorPresentation.inclusion_entry i b _).2 ⟨hb, rfl⟩, inverse⟩ + +theorem limitMultiplication_function : + ZFSet.IsFunc (ZFSet.prod run.limitActors run.limitActors) run.limitActors run.limitMultiplication := by + refine ⟨indexedBinaryLift_subset _ _ _ _ _, ?_⟩ + intro p hp + obtain ⟨g, hg, h, hh, rfl⟩ := ZFSet.mem_prod.1 hp + obtain ⟨k, _, product⟩ := run.limitMul_total hg hh + refine ⟨k, (run.limitMultiplication_entry g h k).2 product, ?_⟩ + intro l entry + exact run.limitMul_unique ((run.limitMultiplication_entry g h l).1 entry) product + +theorem limitInverse_function : ZFSet.IsFunc run.limitActors run.limitActors run.limitInverse := by + refine ⟨indexedRelationLift_subset _ _ _ _ _, ?_⟩ + intro g hg + obtain ⟨h, _, inverse⟩ := run.limitInv_total hg + refine ⟨h, (run.limitInverse_entry g h).2 inverse, ?_⟩ + intro k entry + exact run.limitInv_unique ((run.limitInverse_entry g k).1 entry) inverse + +theorem limitMultiplication_at (i : I) {a b c : ZFSet.{u}} + (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) + (hc : c ∈ (run.diagram.stage i).stage.actors) : + ZFSet.pair (ZFSet.pair (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b)) + (run.actorPresentation.limitPoint i c) ∈ run.limitMultiplication ↔ + ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication := + (run.limitMultiplication_entry _ _ _).trans (run.limitMul_at i ha hb hc) + +theorem limitInverse_at (i : I) {a b : ZFSet.{u}} + (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) : + ZFSet.pair (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b) ∈ + run.limitInverse ↔ ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse := + (run.limitInverse_entry _ _).trans (run.limitInv_at i ha hb) + +theorem limitMultiplication_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitMultiplication < o := + indexedBinaryLift_rank_lt limit _ _ _ _ (run.limitActors_rank_lt limit rank) + +theorem limitInverse_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitInverse < o := + indexedRelationLift_rank_lt limit _ _ _ _ (run.limitActors_rank_lt limit rank) + +end + +section +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_limitTransitionRow {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : + ∃ row ∈ M.sets, FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row ∧ + (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = ZFSet.pair (run.limitPointMap i) (run.limitActorMap i)) ∧ + ZFSet.rank row < o := by + let P := run.limitPointInclusions.sUnion.sUnion + let A := run.limitActorInclusions.sUnion.sUnion + let F := pairedGraph run.indices P A run.limitPointInclusions run.limitActorInclusions + let T := ZFSet.prod {run.indices} run.indices + let row := relationCompose T run.indices (ZFSet.prod P A) + (productSecond {run.indices} run.indices) F + have hP : P ∈ M.sets := M.union_mem unions (M.union_mem unions run.limitPointInclusions_ground) + have hA : A ∈ M.sets := M.union_mem unions (M.union_mem unions run.limitActorInclusions_ground) + have hPair := M.prod_mem pairing unions powers separation hP hA + have hF : F ∈ M.sets := M.pairedGraph_mem pairing unions powers separation + run.indices_ground hP hA run.limitPointInclusions_ground run.limitActorInclusions_ground + have hSingleton : ({run.indices} : ZFSet.{u}) ∈ M.sets := by + rw [← ZFSet.pair_eq_singleton] + exact M.unorderedPair_mem pairing run.indices_ground run.indices_ground + have hT : T ∈ M.sets := M.prod_mem pairing unions powers separation hSingleton run.indices_ground + have funcF : ZFSet.IsFunc run.indices (ZFSet.prod P A) F := + pairedGraph_function_of_subset run.limitPointInclusions_function.to_isFunc + run.limitActorInclusions_function.to_isFunc (fun _ h => h) + have func : ZFSet.IsFunc T (ZFSet.prod P A) row := + relationCompose_function_of_subset (productSecond_function {run.indices} run.indices) + funcF (fun _ h => h) + refine ⟨row, M.relationCompose_mem pairing unions powers separation hT run.indices_ground hPair + (M.productSecond_mem pairing unions powers separation hSingleton run.indices_ground) hF, + ⟨_, func⟩, ?_, ?_⟩ + · intro i z + have hi : run.key i ∈ run.indices := ZFSet.mem_range.2 ⟨i, rfl⟩ + have point := (run.limitPointInclusions_entry i _).2 rfl + have actor := (run.limitActorInclusions_entry i _).2 rfl + have value : ZFSet.pair (run.key i) + (ZFSet.pair (run.limitPointMap i) (run.limitActorMap i)) ∈ F := + (pair_mem_pairedGraph _ _ _ _ _ _ _ _).2 + ⟨hi, pair_second_mem_doubleUnion point, pair_second_mem_doubleUnion actor, point, actor⟩ + have actual : ZFSet.pair (ZFSet.pair run.indices (run.key i)) + (ZFSet.pair (run.limitPointMap i) (run.limitActorMap i)) ∈ row := + (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hi⟩, + (ZFSet.pair_mem_prod.1 (funcF.1 value)).2, run.key i, hi, + (mem_productSecond _ _ _).2 ⟨run.indices, ZFSet.mem_singleton.2 rfl, run.key i, hi, rfl⟩, + value⟩ + exact ⟨fun entry => (FunctionGraphOn.unique ⟨_, func⟩ entry actual), fun equal => equal.symm ▸ actual⟩ + · have indexRank := run.indices_rank_le_code.trans_lt rank + have pointRank : ZFSet.rank P < o := + ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans_lt + (run.limitPointInclusions_rank_lt limit rank) + have actorRank : ZFSet.rank A < o := + ((ZFSet.rank_sUnion_le _).trans (ZFSet.rank_sUnion_le _)).trans_lt + (run.limitActorInclusions_rank_lt limit rank) + exact (ZFSet.rank_mono func.1).trans_lt + (rank_product_lt limit (rank_product_lt limit (rank_singleton_lt limit indexRank) indexRank) + (rank_product_lt limit pointRank actorRank)) + +end + +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def limitOrder : ZFSet.{u} := + indexedRelationLift run.indices run.carrierUnion run.limitPoints + (run.stageFieldFamily 1) run.limitPointInclusions + +noncomputable def limitMeetGraph : ZFSet.{u} := + indexedBinaryLift run.indices run.carrierUnion run.limitPoints + (run.stageFieldFamily 2) run.limitPointInclusions + +theorem limitOrder_ground : run.limitOrder ∈ M.sets := + M.indexedRelationLift_mem pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.limitPoints_ground (run.stageFieldFamily_ground 1) + run.limitPointInclusions_ground + +theorem limitMeetGraph_ground : run.limitMeetGraph ∈ M.sets := + M.indexedBinaryLift_mem pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.limitPoints_ground (run.stageFieldFamily_ground 2) + run.limitPointInclusions_ground + +theorem limitOrder_entry (p q : ZFSet.{u}) : + ZFSet.pair p q ∈ run.limitOrder ↔ run.LimitLE p q := by + rw [limitOrder, pair_mem_indexedRelationLift] + constructor + · rintro ⟨_, _, k, hk, r, e, x, _, y, _, relation, inclusion, first, second, lower⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk + have er : r = (run.diagram.stage i).stage.order := (run.stageFieldFamily_entry 1 i r).1 relation + have ee := (run.limitPointInclusions_entry i e).1 inclusion + subst r + subst e + obtain ⟨hx, ep⟩ := (run.pointPresentation.inclusion_entry i x p).1 first + obtain ⟨hy, eq⟩ := (run.pointPresentation.inclusion_entry i y q).1 second + exact ⟨i, x, y, hx, hy, ep, eq, lower⟩ + · rintro ⟨i, x, y, hx, hy, rfl, rfl, lower⟩ + exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy, + run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, (run.diagram.stage i).stage.order, + run.limitPointMap i, x, run.pointPresentation.carrier_bound i hx, + y, run.pointPresentation.carrier_bound i hy, + (run.stageFieldFamily_entry 1 i _).2 rfl, (run.limitPointInclusions_entry i _).2 rfl, + (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, + (run.pointPresentation.inclusion_entry i y _).2 ⟨hy, rfl⟩, lower⟩ + +theorem limitMeetGraph_entry (p q v : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair p q) v ∈ run.limitMeetGraph ↔ run.LimitMeet p q v := by + rw [limitMeetGraph, triple_mem_indexedBinaryLift] + constructor + · rintro ⟨_, _, _, k, hk, b, e, x, _, y, _, z, _, operation, inclusion, first, second, third, meet⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk + have eb : b = (run.diagram.stage i).stage.meetGraph := (run.stageFieldFamily_entry 2 i b).1 operation + have ee := (run.limitPointInclusions_entry i e).1 inclusion + subst b + subst e + obtain ⟨hx, ep⟩ := (run.pointPresentation.inclusion_entry i x p).1 first + obtain ⟨hy, eq⟩ := (run.pointPresentation.inclusion_entry i y q).1 second + obtain ⟨hz, ev⟩ := (run.pointPresentation.inclusion_entry i z v).1 third + exact ⟨i, x, y, z, hx, hy, hz, ep, eq, ev, meet⟩ + · rintro ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl, meet⟩ + exact ⟨run.pointPresentation.limitPoint_mem hx, run.pointPresentation.limitPoint_mem hy, + run.pointPresentation.limitPoint_mem hz, run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, + (run.diagram.stage i).stage.meetGraph, run.limitPointMap i, + x, run.pointPresentation.carrier_bound i hx, y, run.pointPresentation.carrier_bound i hy, + z, run.pointPresentation.carrier_bound i hz, + (run.stageFieldFamily_entry 2 i _).2 rfl, (run.limitPointInclusions_entry i _).2 rfl, + (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, + (run.pointPresentation.inclusion_entry i y _).2 ⟨hy, rfl⟩, + (run.pointPresentation.inclusion_entry i z _).2 ⟨hz, rfl⟩, meet⟩ + +theorem limitOrder_code : PartialOrderCode run.limitPoints run.limitOrder where + relation := indexedRelationLift_subset _ _ _ _ _ + refl x hx := (run.limitOrder_entry x x).2 (run.limitLE_refl hx) + antisymm x _ y _ first second := run.limitLE_antisymm + ((run.limitOrder_entry x y).1 first) ((run.limitOrder_entry y x).1 second) + trans x _ y _ z _ first second := (run.limitOrder_entry x z).2 + (run.limitLE_trans ((run.limitOrder_entry x y).1 first) ((run.limitOrder_entry y z).1 second)) + +theorem limitMeet_code : MeetOrderCode run.limitPoints run.limitOrder run.limitMeetGraph where + order := run.limitOrder_code + operation := by + refine ⟨indexedBinaryLift_subset _ _ _ _ _, ?_⟩ + intro w hw + obtain ⟨p, hp, q, hq, rfl⟩ := ZFSet.mem_prod.1 hw + obtain ⟨v, _, meet⟩ := run.limitMeet_total hp hq + refine ⟨v, (run.limitMeetGraph_entry p q v).2 meet, ?_⟩ + intro v' entry + exact run.limitMeet_unique ((run.limitMeetGraph_entry p q v').1 entry) meet + lower_left p q v entry := (run.limitOrder_entry v p).2 + (run.limitMeet_lower_left ((run.limitMeetGraph_entry p q v).1 entry)) + lower_right p q v entry := (run.limitOrder_entry v q).2 + (run.limitMeet_lower_right ((run.limitMeetGraph_entry p q v).1 entry)) + greatest p q v w _ entry first second := (run.limitOrder_entry w v).2 + (run.limitMeet_greatest ((run.limitMeetGraph_entry p q v).1 entry) + ((run.limitOrder_entry w p).1 first) ((run.limitOrder_entry w q).1 second)) + +theorem limitPointMap_order_iff (i : I) (x y p q : ZFSet.{u}) + (first : ZFSet.pair x p ∈ run.limitPointMap i) + (second : ZFSet.pair y q ∈ run.limitPointMap i) : + ZFSet.pair p q ∈ run.limitOrder ↔ ZFSet.pair x y ∈ (run.diagram.stage i).stage.order := by + obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x p).1 first + obtain ⟨hy, rfl⟩ := (run.pointPresentation.inclusion_entry i y q).1 second + exact (run.limitOrder_entry _ _).trans (run.limitLE_at i hx hy) + +theorem limitPointMap_meetEmbedding (i : I) : + MeetEmbeddingCode (run.diagram.stage i).stage.carrier run.limitPoints + (run.diagram.stage i).stage.order run.limitOrder + (run.diagram.stage i).stage.meetGraph run.limitMeetGraph (run.limitPointMap i) where + injection := run.limitPointMap_injection i + monotone x y p q lower first second := (run.limitPointMap_order_iff i x y p q first second).2 lower + map_meet x y z p q v meet first second third := by + obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x p).1 first + obtain ⟨hy, rfl⟩ := (run.pointPresentation.inclusion_entry i y q).1 second + obtain ⟨hz, rfl⟩ := (run.pointPresentation.inclusion_entry i z v).1 third + exact (run.limitMeetGraph_entry _ _ _).2 ((run.limitMeet_at i hx hy hz).2 meet) + +theorem limitOrder_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitOrder < o := + indexedRelationLift_rank_lt limit _ _ _ _ (run.limitPoints_rank_lt limit rank) + +theorem limitMeetGraph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitMeetGraph < o := + indexedBinaryLift_rank_lt limit _ _ _ _ (run.limitPoints_rank_lt limit rank) + +noncomputable def limitBottom (i : I) : ZFSet.{u} := + run.pointPresentation.limitPoint i (run.diagram.stage i).stage.bottom + +theorem limitBottom_mem (i : I) : run.limitBottom i ∈ run.limitPoints := + run.pointPresentation.limitPoint_mem (run.diagram.stage i).stage.bottom_mem + +theorem limitBottom_ground (i : I) : run.limitBottom i ∈ M.sets := + M.transitive run.limitPoints_ground (run.limitBottom_mem i) + +theorem limitBottom_eq (i j : I) : run.limitBottom i = run.limitBottom j := by + obtain ⟨k, ik, jk⟩ := run.common_upper i j + exact (run.pointPresentation.limitPoint_transition ik (run.diagram.transition ik).map.bottom).trans + (run.pointPresentation.limitPoint_transition jk (run.diagram.transition jk).map.bottom).symm + +theorem limitBottom_least (i : I) (q : ZFSet.{u}) (member : q ∈ run.limitPoints) : + ZFSet.pair (run.limitBottom i) q ∈ run.limitOrder := by + obtain ⟨j, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage member + rw [run.limitBottom_eq i j] + exact (run.limitOrder_entry _ _).2 ((run.limitLE_at j (run.diagram.stage j).stage.bottom_mem hx).2 + ((run.diagram.stage j).stage.least x hx)) + +theorem limitPointMap_bottom (i₀ i : I) : + ZFSet.pair (run.diagram.stage i).stage.bottom (run.limitBottom i₀) ∈ run.limitPointMap i := + (run.pointPresentation.inclusion_entry i _ _).2 + ⟨(run.diagram.stage i).stage.bottom_mem, run.limitBottom_eq i₀ i⟩ + +theorem limitBottom_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) (i : I) : ZFSet.rank (run.limitBottom i) < o := + (ZFSet.rank_lt_of_mem (run.limitBottom_mem i)).trans (run.limitPoints_rank_lt limit rank) + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitChronologyCore.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitChronologyCore.lean index a4ca3ba90e96251512d8049b8f0b29f4dbb9ed14..8cbba9b28575a9d1c2602145e634f788fcea884b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitChronologyCore.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitChronologyCore.lean @@ -1,447 +1,447 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitBottom -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixPriorFields - -namespace OAI - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem related_birth_iff {i j : I} {x y : ZFSet.{u}} - (related : run.pointSystem.Related i x j y) (t : ZFSet.{u}) : - ZFSet.pair x t ∈ (run.diagram.stage i).birth ↔ - ZFSet.pair y t ∈ (run.diagram.stage j).birth := by - obtain ⟨k, first, second, z, xz, yz⟩ := related - exact ((run.diagram.transition first).birth x z t xz).symm.trans - ((run.diagram.transition second).birth y z t yz) - -theorem limitPoint_birth_iff {i j : I} {x y : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) - (hy : y ∈ (run.diagram.stage j).stage.carrier) - (equal : run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j y) - (t : ZFSet.{u}) : - ZFSet.pair x t ∈ (run.diagram.stage i).birth ↔ - ZFSet.pair y t ∈ (run.diagram.stage j).birth := - run.related_birth_iff ((run.pointPresentation.limitPoint_eq_iff_related hx hy).1 equal) t - -theorem related_height_iff {i j : I} {x y : ZFSet.{u}} - (related : run.pointSystem.Related i x j y) (t : ZFSet.{u}) : - ZFSet.pair x t ∈ (run.diagram.stage i).stage.height ↔ - ZFSet.pair y t ∈ (run.diagram.stage j).stage.height := by - obtain ⟨k, first, second, z, xz, yz⟩ := related - exact ((run.diagram.transition first).map.height x z t xz).symm.trans - ((run.diagram.transition second).map.height y z t yz) - -theorem limitPoint_height_iff {i j : I} {x y : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) - (hy : y ∈ (run.diagram.stage j).stage.carrier) - (equal : run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j y) - (t : ZFSet.{u}) : - ZFSet.pair x t ∈ (run.diagram.stage i).stage.height ↔ - ZFSet.pair y t ∈ (run.diagram.stage j).stage.height := - run.related_height_iff ((run.pointPresentation.limitPoint_eq_iff_related hx hy).1 equal) t - - - - - -noncomputable def limitValueGraph (F V : ZFSet.{u}) : ZFSet.{u} := - indexedValueLift run.indices run.carrierUnion run.limitPoints V F run.limitPointInclusions - -theorem limitValueGraph_ground {F V : ZFSet.{u}} (hF : F ∈ M.sets) (hV : V ∈ M.sets) : - run.limitValueGraph F V ∈ M.sets := - M.indexedValueLift_mem pairing unions powers separation run.indices_ground run.carrierUnion_ground - run.limitPoints_ground hV hF run.limitPointInclusions_ground - -theorem limitValueGraph_entry (value : I → ZFSet.{u}) {F V : ZFSet.{u}} - (lookup : ∀ i f, ZFSet.pair (run.key i) f ∈ F ↔ f = value i) - (bound : ∀ i x t, ZFSet.pair x t ∈ value i → t ∈ V) (q t : ZFSet.{u}) : - ZFSet.pair q t ∈ run.limitValueGraph F V ↔ - ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ - q = run.pointPresentation.limitPoint i x ∧ ZFSet.pair x t ∈ value i := by - rw [limitValueGraph, pair_mem_indexedValueLift] - constructor - · rintro ⟨_, _, k, hk, f, e, x, _, family, inclusion, image, entry⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk - obtain rfl := (lookup i f).1 family - obtain rfl := (run.limitPointInclusions_entry i e).1 inclusion - obtain ⟨hx, equal⟩ := (run.pointPresentation.inclusion_entry i x q).1 image - exact ⟨i, x, hx, equal, entry⟩ - · rintro ⟨i, x, hx, rfl, entry⟩ - exact ⟨run.pointPresentation.limitPoint_mem hx, bound i x t entry, - run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, value i, run.limitPointMap i, - x, run.pointPresentation.carrier_bound i hx, (lookup i _).2 rfl, - (run.limitPointInclusions_entry i _).2 rfl, - (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, entry⟩ - -theorem limitValueGraph_at (value : I → ZFSet.{u}) {F V : ZFSet.{u}} - (lookup : ∀ i f, ZFSet.pair (run.key i) f ∈ F ↔ f = value i) - (bound : ∀ i x t, ZFSet.pair x t ∈ value i → t ∈ V) - (compatible : ∀ i j x y, x ∈ (run.diagram.stage i).stage.carrier → - y ∈ (run.diagram.stage j).stage.carrier → - run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j y → - ∀ t, ZFSet.pair x t ∈ value i ↔ ZFSet.pair y t ∈ value j) - (i : I) {x : ZFSet.{u}} (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : - ZFSet.pair (run.pointPresentation.limitPoint i x) t ∈ run.limitValueGraph F V ↔ - ZFSet.pair x t ∈ value i := by - rw [run.limitValueGraph_entry value lookup bound] - constructor - · rintro ⟨j, y, hy, equal, entry⟩ - exact (compatible i j x y hx hy equal t).2 entry - · intro entry - exact ⟨i, x, hx, rfl, entry⟩ - -theorem limitValueGraph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) (F : ZFSet.{u}) {V : ZFSet.{u}} - (values : ZFSet.rank V < o) : ZFSet.rank (run.limitValueGraph F V) < o := - indexedValueLift_rank_lt limit run.indices run.carrierUnion F run.limitPointInclusions - (run.limitPoints_rank_lt limit rank) values - - - - - -theorem limitPoint_old_birth_coverage (i j : I) {x t : ZFSet.{u}} - (entry : ZFSet.pair x t ∈ (run.diagram.stage j).birth) - (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : - ∃ y ∈ (run.diagram.stage i).stage.carrier, - ZFSet.pair y t ∈ (run.diagram.stage i).birth ∧ - run.pointPresentation.limitPoint i y = run.pointPresentation.limitPoint j x := by - have hx := (ZFSet.pair_mem_prod.1 ((run.diagram.stage j).birth_function.1 entry)).1 - obtain ⟨k, ik, jk⟩ := run.common_upper i j - obtain ⟨z, xz⟩ := run.pointSystem.map_entry_total jk hx - have terminal := ((run.diagram.transition jk).birth x z t xz).2 entry - obtain ⟨y, hy, yz⟩ := run.coverage ik z t terminal before - exact ⟨y, hy, ((run.diagram.transition ik).birth y z t yz).1 terminal, - (run.pointPresentation.limitPoint_transition ik yz).trans - (run.pointPresentation.limitPoint_transition jk xz).symm⟩ - -def LimitBirthValue (q t : ZFSet.{u}) : Prop := - ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ - q = run.pointPresentation.limitPoint i x ∧ ZFSet.pair x t ∈ (run.diagram.stage i).birth - -theorem limitBirthValue_at (i : I) {x : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : - run.LimitBirthValue (run.pointPresentation.limitPoint i x) t ↔ - ZFSet.pair x t ∈ (run.diagram.stage i).birth := by - constructor - · rintro ⟨j, y, hy, equal, entry⟩ - exact (run.limitPoint_birth_iff hx hy equal t).2 entry - · intro entry - exact ⟨i, x, hx, rfl, entry⟩ - -theorem limitBirthValue_total {q : ZFSet.{u}} (member : q ∈ run.limitPoints) : - ∃ t, run.LimitBirthValue q t := by - obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage member - obtain ⟨t, entry, _⟩ := (run.diagram.stage i).birth_function.2 x hx - exact ⟨t, i, x, hx, rfl, entry⟩ - -theorem limitBirthValue_unique {q t s : ZFSet.{u}} - (first : run.LimitBirthValue q t) (second : run.LimitBirthValue q s) : t = s := by - obtain ⟨i, x, hx, rfl, xt⟩ := first - have xs := (run.limitBirthValue_at i hx s).1 second - exact (show FunctionGraphOn (run.diagram.stage i).stage.carrier (run.diagram.stage i).birth from - ⟨_, (run.diagram.stage i).birth_function⟩).unique xt xs - -theorem limitBirthValue_old_fiber (i : I) (q t : ZFSet.{u}) - (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : - run.LimitBirthValue q t ↔ ∃ x ∈ (run.diagram.stage i).stage.carrier, - ZFSet.pair x t ∈ (run.diagram.stage i).birth ∧ q = run.pointPresentation.limitPoint i x := by - constructor - · rintro ⟨j, y, _, rfl, entry⟩ - obtain ⟨x, hx, birth, equal⟩ := run.limitPoint_old_birth_coverage i j entry before - exact ⟨x, hx, birth, equal.symm⟩ - · rintro ⟨x, hx, birth, rfl⟩ - exact ⟨i, x, hx, rfl, birth⟩ - - - - - -noncomputable def heightValueBound : ZFSet.{u} := ZFSet.sUnion (ZFSet.sUnion (run.stageFieldUnion 10)) - -theorem heightValueBound_ground : run.heightValueBound ∈ M.sets := - M.union_mem unions (M.union_mem unions (run.stageFieldUnion_ground 10)) - -theorem height_value_mem_bound (i : I) {x t : ZFSet.{u}} - (entry : ZFSet.pair x t ∈ (run.diagram.stage i).stage.height) : t ∈ run.heightValueBound := - pair_second_mem_doubleUnion ((run.stageFieldUnion_mem 10 _).2 ⟨i, entry⟩) - -theorem heightValueBound_rank_le_code : ZFSet.rank run.heightValueBound ≤ ZFSet.rank run.code := - (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans (run.stageFieldUnion_rank_le_code 10)) - -noncomputable def limitHeight : ZFSet.{u} := - run.limitValueGraph (run.stageFieldFamily 10) run.heightValueBound - -theorem limitHeight_ground : run.limitHeight ∈ M.sets := - run.limitValueGraph_ground (run.stageFieldFamily_ground 10) run.heightValueBound_ground - -theorem limitHeight_entry (q t : ZFSet.{u}) : - ZFSet.pair q t ∈ run.limitHeight ↔ - ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ - q = run.pointPresentation.limitPoint i x ∧ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := - run.limitValueGraph_entry (fun i => (run.diagram.stage i).stage.height) - (run.stageFieldFamily_entry 10) (fun i _ _ => run.height_value_mem_bound i) q t - -theorem limitHeight_at (i : I) {x : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : - ZFSet.pair (run.pointPresentation.limitPoint i x) t ∈ run.limitHeight ↔ - ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := - run.limitValueGraph_at (fun j => (run.diagram.stage j).stage.height) - (run.stageFieldFamily_entry 10) (fun j _ _ => run.height_value_mem_bound j) - (fun _ _ _ _ hx hy equal t => run.limitPoint_height_iff hx hy equal t) i hx t - -theorem limitHeight_function : ZFSet.IsFunc run.limitPoints (ZFSet.prod C D) run.limitHeight := by - refine ⟨?_, ?_⟩ - · intro z hz - have subset := indexedValueLift_subset run.indices run.carrierUnion run.limitPoints - run.heightValueBound (run.stageFieldFamily 10) run.limitPointInclusions - obtain ⟨q, _, t, _, rfl⟩ := ZFSet.mem_prod.1 (subset hz) - obtain ⟨i, x, hx, rfl, entry⟩ := (run.limitHeight_entry q t).1 hz - exact ZFSet.pair_mem_prod.2 ⟨run.pointPresentation.limitPoint_mem hx, - (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.height_code.function.1 entry)).2⟩ - · intro q hq - obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage hq - obtain ⟨t, entry, unique⟩ := (run.diagram.stage i).stage.height_code.function.2 x hx - refine ⟨t, (run.limitHeight_at i hx t).2 entry, ?_⟩ - intro s hs - exact unique s ((run.limitHeight_at i hx s).1 hs) - -theorem limitPointMap_height (i : I) {x q : ZFSet.{u}} - (image : ZFSet.pair x q ∈ run.limitPointMap i) (t : ZFSet.{u}) : - ZFSet.pair q t ∈ run.limitHeight ↔ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := by - obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x q).1 image - exact run.limitHeight_at i hx t - -theorem limitHeight_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitHeight < o := - run.limitValueGraph_rank_lt limit rank _ (run.heightValueBound_rank_le_code.trans_lt rank) - - - - - -noncomputable def limitBirth : ZFSet.{u} := - run.limitValueGraph run.birthFamily run.cutoffLimit - -theorem limitBirth_ground : run.limitBirth ∈ M.sets := - run.limitValueGraph_ground run.birthFamily_ground run.cutoffLimit_ground - -theorem limitBirth_entry (q t : ZFSet.{u}) : - ZFSet.pair q t ∈ run.limitBirth ↔ run.LimitBirthValue q t := - run.limitValueGraph_entry (fun i => (run.diagram.stage i).birth) run.birthFamily_entry - (fun i _ _ entry => run.birth_time_mem_cutoffLimit i entry) q t - -theorem limitBirth_function : ZFSet.IsFunc run.limitPoints run.cutoffLimit run.limitBirth := by - refine ⟨indexedValueLift_subset run.indices run.carrierUnion run.limitPoints - run.cutoffLimit run.birthFamily run.limitPointInclusions, ?_⟩ - intro q hq - obtain ⟨t, birth⟩ := run.limitBirthValue_total hq - refine ⟨t, (run.limitBirth_entry q t).2 birth, ?_⟩ - intro s entry - exact run.limitBirthValue_unique ((run.limitBirth_entry q s).1 entry) birth - -theorem limitBirth_at (i : I) {x : ZFSet.{u}} - (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : - ZFSet.pair (run.pointPresentation.limitPoint i x) t ∈ run.limitBirth ↔ - ZFSet.pair x t ∈ (run.diagram.stage i).birth := - (run.limitBirth_entry _ t).trans (run.limitBirthValue_at i hx t) - -theorem limitPointMap_birth_iff (i : I) (x q t : ZFSet.{u}) - (entry : ZFSet.pair x q ∈ run.limitPointMap i) : - ZFSet.pair q t ∈ run.limitBirth ↔ ZFSet.pair x t ∈ (run.diagram.stage i).birth := by - obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x q).1 entry - exact run.limitBirth_at i hx t - -theorem limitBirth_old_fiber (i : I) (q t : ZFSet.{u}) - (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : - ZFSet.pair q t ∈ run.limitBirth ↔ ∃ x ∈ (run.diagram.stage i).stage.carrier, - ZFSet.pair x t ∈ (run.diagram.stage i).birth ∧ ZFSet.pair x q ∈ run.limitPointMap i := by - rw [run.limitBirth_entry, run.limitBirthValue_old_fiber i q t before] - constructor - · rintro ⟨x, hx, birth, equal⟩ - exact ⟨x, hx, birth, (run.pointPresentation.inclusion_entry i x q).2 ⟨hx, equal⟩⟩ - · rintro ⟨x, hx, birth, entry⟩ - exact ⟨x, hx, birth, ((run.pointPresentation.inclusion_entry i x q).1 entry).2⟩ - -theorem limitBirth_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitBirth < o := - run.limitValueGraph_rank_lt limit rank run.birthFamily (run.cutoffLimit_rank_le_code.trans_lt rank) - - - - - -theorem limitHeight_code : StrictLexHeightCode run.limitPoints C D run.limitOrder run.limitHeight rD where - function := run.limitHeight_function - strict p hp q hq c a d b lower different first second := by - obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage hp hq - have sourceOrder := (run.limitLE_at i hx hy).1 ((run.limitOrder_entry _ _).1 lower) - have sourceDifferent : x ≠ y := fun equal => different (congrArg (run.pointPresentation.limitPoint i) equal) - exact (run.diagram.stage i).stage.height_code.strict x hx y hy c a d b sourceOrder sourceDifferent - ((run.limitHeight_at i hx _).1 first) ((run.limitHeight_at i hy _).1 second) - -noncomputable def limitHeightRange : ZFSet.{u} := functionGraphRange run.limitPoints run.limitHeight - -theorem limitHeightRange_ground : run.limitHeightRange ∈ M.sets := - M.functionGraphRange_mem unions separation run.limitPoints_ground run.limitHeight_ground - -theorem limitHeightRange_mem (t : ZFSet.{u}) : - t ∈ run.limitHeightRange ↔ - ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := by - rw [limitHeightRange, mem_functionGraphRange] - constructor - · rintro ⟨q, _, entry⟩ - obtain ⟨i, x, hx, _, value⟩ := (run.limitHeight_entry q t).1 entry - exact ⟨i, x, hx, value⟩ - · rintro ⟨i, x, hx, entry⟩ - exact ⟨run.pointPresentation.limitPoint i x, run.pointPresentation.limitPoint_mem hx, - (run.limitHeight_at i hx t).2 entry⟩ - -theorem limitHeightRange_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitHeightRange < o := - (functionGraphRange_rank_le _ _).trans_lt (run.limitHeight_rank_lt limit rank) - - - - - -theorem limit_old_meet : OldMeetCode run.limitOrder run.limitMeetGraph run.limitBirth := by - intro p q v a b c bornQ bornP earlier notLower meet bornV - have bounds := run.limitMeet_bounds ((run.limitMeetGraph_entry p q v).1 meet) - obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl⟩ := - run.pointPresentation.triple_coverage bounds.1 bounds.2.1 bounds.2.2 - apply (run.diagram.stage i).old_meet x y z a b c - ((run.limitBirth_at i hy a).1 bornQ) ((run.limitBirth_at i hx b).1 bornP) earlier - · intro lower - exact notLower ((run.limitOrder_entry _ _).2 ((run.limitLE_at i hx hy).2 lower)) - · exact (run.limitMeet_at i hx hy hz).1 ((run.limitMeetGraph_entry _ _ _).1 meet) - · exact (run.limitBirth_at i hz c).1 bornV - - - - - -noncomputable def limitTerminalFields : Fin 5 → ZFSet.{u} := - Fin.cases run.limitPoints (Fin.cases run.limitOrder (Fin.cases run.limitMeetGraph - (Fin.cases run.limitBirth (Fin.cases run.limitHeight Fin.elim0)))) - -theorem limitTerminalFields_ground : ∀ j, run.limitTerminalFields j ∈ M.sets := - Fin.cases run.limitPoints_ground (Fin.cases run.limitOrder_ground (Fin.cases run.limitMeetGraph_ground - (Fin.cases run.limitBirth_ground (Fin.cases run.limitHeight_ground (fun i => Fin.elim0 i))))) - -theorem limitTerminalPoint : ChronologyPointCode (insert run.cutoffLimit run.cutoffLimit) C D rD - run.cutoffLimit run.limitPoints run.limitOrder run.limitMeetGraph run.limitBirth run.limitHeight where - meet := run.limitMeet_code - birth_function := by - refine ⟨?_, run.limitBirth_function.2⟩ - intro z hz - obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (run.limitBirth_function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_insert_of_mem _ ht⟩ - birth_bound _ _ _ entry := Or.inr (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 entry)).2 - old_meet := run.limit_old_meet - strict_height := run.limitHeight_code - -theorem limitTerminalFields_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ∀ j, ZFSet.rank (run.limitTerminalFields j) < o := - Fin.cases (run.limitPoints_rank_lt limit rank) (Fin.cases (run.limitOrder_rank_lt limit rank) - (Fin.cases (run.limitMeetGraph_rank_lt limit rank) (Fin.cases (run.limitBirth_rank_lt limit rank) - (Fin.cases (run.limitHeight_rank_lt limit rank) (fun i => Fin.elim0 i))))) - - - - - -noncomputable def limitChronologyFields : - GroundChronologyFields M (insert run.cutoffLimit run.cutoffLimit) := - run.limitPriorFields.appendTime pairing unions run.limitTerminalFields run.limitTerminalFields_ground - -theorem limitChronologyFields_graph (j : Fin 5) : - run.limitChronologyFields.graph j = - insert (ZFSet.pair run.cutoffLimit (run.limitTerminalFields j)) (run.serialFieldUnion j) := rfl - -theorem limitChronologyFields_terminal (j : Fin 5) : - run.limitChronologyFields.value j run.cutoffLimit = run.limitTerminalFields j := - run.limitPriorFields.appendTime_value_at pairing unions run.limitTerminalFields run.limitTerminalFields_ground j - -theorem limitChronologyFields_values (i : I) (j : Fin 5) {s : ZFSet.{u}} - (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : - run.limitChronologyFields.value j s = (run.diagram.stage i).history.fieldValue j s := - (run.limitPriorFields.appendTime_value_old pairing unions run.limitTerminalFields run.limitTerminalFields_ground - j ((run.cutoffLimit_mem s).2 ⟨i, before⟩)).trans (run.limitPriorFields_values i j before) - -theorem limitChronologyFields_source_entries (i : I) (j : Fin 5) {s : ZFSet.{u}} - (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) (y : ZFSet.{u}) : - ZFSet.pair s y ∈ run.limitChronologyFields.graph j ↔ - ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j := by - have old := run.limitPriorFields.appendTime_old_entries pairing unions run.limitTerminalFields - run.limitTerminalFields_ground j ((run.cutoffLimit_mem s).2 ⟨i, before⟩) (y := y) - exact (old.trans (run.serialFieldUnion_at i j before y)).trans - ((run.serialFieldGraph_entry i j s y).trans (and_iff_right before)).symm - -theorem limitChronologyFields_graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) (j : Fin 5) : - ZFSet.rank (run.limitChronologyFields.graph j) < o := - run.limitPriorFields.appendTime_graph_rank_lt pairing unions run.limitTerminalFields - run.limitTerminalFields_ground limit (run.cutoffLimit_rank_le_code.trans_lt rank) - (fun j => (run.serialFieldUnion_rank_le_code j).trans_lt rank) - (run.limitTerminalFields_rank_lt limit rank) j - - - - - -theorem limitChronologyPoint {s : ZFSet.{u}} (hs : s ∈ insert run.cutoffLimit run.cutoffLimit) : - ChronologyPointCode (insert run.cutoffLimit run.cutoffLimit) C D rD s - (run.limitChronologyFields.value 0 s) (run.limitChronologyFields.value 1 s) - (run.limitChronologyFields.value 2 s) (run.limitChronologyFields.value 3 s) - (run.limitChronologyFields.value 4 s) := by - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · simp only [run.limitChronologyFields_terminal] - exact run.limitTerminalPoint - · obtain ⟨i, before⟩ := (run.cutoffLimit_mem s).1 hs - rw [run.limitChronologyFields_values i 0 before, run.limitChronologyFields_values i 1 before, - run.limitChronologyFields_values i 2 before, run.limitChronologyFields_values i 3 before, - run.limitChronologyFields_values i 4 before] - change ChronologyPointCode (insert run.cutoffLimit run.cutoffLimit) C D rD s - ((run.diagram.stage i).history.space s) ((run.diagram.stage i).history.order s) - ((run.diagram.stage i).history.meetGraph s) ((run.diagram.stage i).history.birth s) - ((run.diagram.stage i).history.height s) - have sourceTime : s ∈ insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff := - ZFSet.mem_insert_iff.2 before - refine ⟨(run.diagram.stage i).history.meet_order s sourceTime, ?_, - (run.diagram.stage i).history.birth_bound s sourceTime, - (run.diagram.stage i).history.old_meet s sourceTime, - (run.diagram.stage i).history.strict_height s sourceTime⟩ - refine ⟨?_, ((run.diagram.stage i).history.birth_function s sourceTime).2⟩ - intro z hz - obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 - (((run.diagram.stage i).history.birth_function s sourceTime).1 hz) - have member : t ∈ run.cutoffLimit := by - rcases ZFSet.mem_insert_iff.1 ht with rfl | ht - · exact run.cutoff_mem_cutoffLimit i - · exact run.cutoffLimit_ordinal.1 _ (run.cutoff_mem_cutoffLimit i) _ ht - exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_insert_of_mem _ member⟩ - -theorem limitChronologyCore : ChronologyCoreCode (insert run.cutoffLimit run.cutoffLimit) - run.limitChronologyFields.bound C D rD run.limitChronologyFields.graph where - function := run.limitChronologyFields.function - point s hs L r μ birth height eL er eμ eb eh := by - have current := run.limitChronologyPoint hs - rw [run.limitChronologyFields.value_eq_of_entry 0 eL, - run.limitChronologyFields.value_eq_of_entry 1 er, - run.limitChronologyFields.value_eq_of_entry 2 eμ, - run.limitChronologyFields.value_eq_of_entry 3 eb, - run.limitChronologyFields.value_eq_of_entry 4 eh] at current - exact current - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitBottom +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixPriorFields + +namespace OAI + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem related_birth_iff {i j : I} {x y : ZFSet.{u}} + (related : run.pointSystem.Related i x j y) (t : ZFSet.{u}) : + ZFSet.pair x t ∈ (run.diagram.stage i).birth ↔ + ZFSet.pair y t ∈ (run.diagram.stage j).birth := by + obtain ⟨k, first, second, z, xz, yz⟩ := related + exact ((run.diagram.transition first).birth x z t xz).symm.trans + ((run.diagram.transition second).birth y z t yz) + +theorem limitPoint_birth_iff {i j : I} {x y : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) + (hy : y ∈ (run.diagram.stage j).stage.carrier) + (equal : run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j y) + (t : ZFSet.{u}) : + ZFSet.pair x t ∈ (run.diagram.stage i).birth ↔ + ZFSet.pair y t ∈ (run.diagram.stage j).birth := + run.related_birth_iff ((run.pointPresentation.limitPoint_eq_iff_related hx hy).1 equal) t + +theorem related_height_iff {i j : I} {x y : ZFSet.{u}} + (related : run.pointSystem.Related i x j y) (t : ZFSet.{u}) : + ZFSet.pair x t ∈ (run.diagram.stage i).stage.height ↔ + ZFSet.pair y t ∈ (run.diagram.stage j).stage.height := by + obtain ⟨k, first, second, z, xz, yz⟩ := related + exact ((run.diagram.transition first).map.height x z t xz).symm.trans + ((run.diagram.transition second).map.height y z t yz) + +theorem limitPoint_height_iff {i j : I} {x y : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) + (hy : y ∈ (run.diagram.stage j).stage.carrier) + (equal : run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j y) + (t : ZFSet.{u}) : + ZFSet.pair x t ∈ (run.diagram.stage i).stage.height ↔ + ZFSet.pair y t ∈ (run.diagram.stage j).stage.height := + run.related_height_iff ((run.pointPresentation.limitPoint_eq_iff_related hx hy).1 equal) t + + + + + +noncomputable def limitValueGraph (F V : ZFSet.{u}) : ZFSet.{u} := + indexedValueLift run.indices run.carrierUnion run.limitPoints V F run.limitPointInclusions + +theorem limitValueGraph_ground {F V : ZFSet.{u}} (hF : F ∈ M.sets) (hV : V ∈ M.sets) : + run.limitValueGraph F V ∈ M.sets := + M.indexedValueLift_mem pairing unions powers separation run.indices_ground run.carrierUnion_ground + run.limitPoints_ground hV hF run.limitPointInclusions_ground + +theorem limitValueGraph_entry (value : I → ZFSet.{u}) {F V : ZFSet.{u}} + (lookup : ∀ i f, ZFSet.pair (run.key i) f ∈ F ↔ f = value i) + (bound : ∀ i x t, ZFSet.pair x t ∈ value i → t ∈ V) (q t : ZFSet.{u}) : + ZFSet.pair q t ∈ run.limitValueGraph F V ↔ + ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ + q = run.pointPresentation.limitPoint i x ∧ ZFSet.pair x t ∈ value i := by + rw [limitValueGraph, pair_mem_indexedValueLift] + constructor + · rintro ⟨_, _, k, hk, f, e, x, _, family, inclusion, image, entry⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hk + obtain rfl := (lookup i f).1 family + obtain rfl := (run.limitPointInclusions_entry i e).1 inclusion + obtain ⟨hx, equal⟩ := (run.pointPresentation.inclusion_entry i x q).1 image + exact ⟨i, x, hx, equal, entry⟩ + · rintro ⟨i, x, hx, rfl, entry⟩ + exact ⟨run.pointPresentation.limitPoint_mem hx, bound i x t entry, + run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, value i, run.limitPointMap i, + x, run.pointPresentation.carrier_bound i hx, (lookup i _).2 rfl, + (run.limitPointInclusions_entry i _).2 rfl, + (run.pointPresentation.inclusion_entry i x _).2 ⟨hx, rfl⟩, entry⟩ + +theorem limitValueGraph_at (value : I → ZFSet.{u}) {F V : ZFSet.{u}} + (lookup : ∀ i f, ZFSet.pair (run.key i) f ∈ F ↔ f = value i) + (bound : ∀ i x t, ZFSet.pair x t ∈ value i → t ∈ V) + (compatible : ∀ i j x y, x ∈ (run.diagram.stage i).stage.carrier → + y ∈ (run.diagram.stage j).stage.carrier → + run.pointPresentation.limitPoint i x = run.pointPresentation.limitPoint j y → + ∀ t, ZFSet.pair x t ∈ value i ↔ ZFSet.pair y t ∈ value j) + (i : I) {x : ZFSet.{u}} (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : + ZFSet.pair (run.pointPresentation.limitPoint i x) t ∈ run.limitValueGraph F V ↔ + ZFSet.pair x t ∈ value i := by + rw [run.limitValueGraph_entry value lookup bound] + constructor + · rintro ⟨j, y, hy, equal, entry⟩ + exact (compatible i j x y hx hy equal t).2 entry + · intro entry + exact ⟨i, x, hx, rfl, entry⟩ + +theorem limitValueGraph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) (F : ZFSet.{u}) {V : ZFSet.{u}} + (values : ZFSet.rank V < o) : ZFSet.rank (run.limitValueGraph F V) < o := + indexedValueLift_rank_lt limit run.indices run.carrierUnion F run.limitPointInclusions + (run.limitPoints_rank_lt limit rank) values + + + + + +theorem limitPoint_old_birth_coverage (i j : I) {x t : ZFSet.{u}} + (entry : ZFSet.pair x t ∈ (run.diagram.stage j).birth) + (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : + ∃ y ∈ (run.diagram.stage i).stage.carrier, + ZFSet.pair y t ∈ (run.diagram.stage i).birth ∧ + run.pointPresentation.limitPoint i y = run.pointPresentation.limitPoint j x := by + have hx := (ZFSet.pair_mem_prod.1 ((run.diagram.stage j).birth_function.1 entry)).1 + obtain ⟨k, ik, jk⟩ := run.common_upper i j + obtain ⟨z, xz⟩ := run.pointSystem.map_entry_total jk hx + have terminal := ((run.diagram.transition jk).birth x z t xz).2 entry + obtain ⟨y, hy, yz⟩ := run.coverage ik z t terminal before + exact ⟨y, hy, ((run.diagram.transition ik).birth y z t yz).1 terminal, + (run.pointPresentation.limitPoint_transition ik yz).trans + (run.pointPresentation.limitPoint_transition jk xz).symm⟩ + +def LimitBirthValue (q t : ZFSet.{u}) : Prop := + ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ + q = run.pointPresentation.limitPoint i x ∧ ZFSet.pair x t ∈ (run.diagram.stage i).birth + +theorem limitBirthValue_at (i : I) {x : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : + run.LimitBirthValue (run.pointPresentation.limitPoint i x) t ↔ + ZFSet.pair x t ∈ (run.diagram.stage i).birth := by + constructor + · rintro ⟨j, y, hy, equal, entry⟩ + exact (run.limitPoint_birth_iff hx hy equal t).2 entry + · intro entry + exact ⟨i, x, hx, rfl, entry⟩ + +theorem limitBirthValue_total {q : ZFSet.{u}} (member : q ∈ run.limitPoints) : + ∃ t, run.LimitBirthValue q t := by + obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage member + obtain ⟨t, entry, _⟩ := (run.diagram.stage i).birth_function.2 x hx + exact ⟨t, i, x, hx, rfl, entry⟩ + +theorem limitBirthValue_unique {q t s : ZFSet.{u}} + (first : run.LimitBirthValue q t) (second : run.LimitBirthValue q s) : t = s := by + obtain ⟨i, x, hx, rfl, xt⟩ := first + have xs := (run.limitBirthValue_at i hx s).1 second + exact (show FunctionGraphOn (run.diagram.stage i).stage.carrier (run.diagram.stage i).birth from + ⟨_, (run.diagram.stage i).birth_function⟩).unique xt xs + +theorem limitBirthValue_old_fiber (i : I) (q t : ZFSet.{u}) + (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : + run.LimitBirthValue q t ↔ ∃ x ∈ (run.diagram.stage i).stage.carrier, + ZFSet.pair x t ∈ (run.diagram.stage i).birth ∧ q = run.pointPresentation.limitPoint i x := by + constructor + · rintro ⟨j, y, _, rfl, entry⟩ + obtain ⟨x, hx, birth, equal⟩ := run.limitPoint_old_birth_coverage i j entry before + exact ⟨x, hx, birth, equal.symm⟩ + · rintro ⟨x, hx, birth, rfl⟩ + exact ⟨i, x, hx, rfl, birth⟩ + + + + + +noncomputable def heightValueBound : ZFSet.{u} := ZFSet.sUnion (ZFSet.sUnion (run.stageFieldUnion 10)) + +theorem heightValueBound_ground : run.heightValueBound ∈ M.sets := + M.union_mem unions (M.union_mem unions (run.stageFieldUnion_ground 10)) + +theorem height_value_mem_bound (i : I) {x t : ZFSet.{u}} + (entry : ZFSet.pair x t ∈ (run.diagram.stage i).stage.height) : t ∈ run.heightValueBound := + pair_second_mem_doubleUnion ((run.stageFieldUnion_mem 10 _).2 ⟨i, entry⟩) + +theorem heightValueBound_rank_le_code : ZFSet.rank run.heightValueBound ≤ ZFSet.rank run.code := + (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans (run.stageFieldUnion_rank_le_code 10)) + +noncomputable def limitHeight : ZFSet.{u} := + run.limitValueGraph (run.stageFieldFamily 10) run.heightValueBound + +theorem limitHeight_ground : run.limitHeight ∈ M.sets := + run.limitValueGraph_ground (run.stageFieldFamily_ground 10) run.heightValueBound_ground + +theorem limitHeight_entry (q t : ZFSet.{u}) : + ZFSet.pair q t ∈ run.limitHeight ↔ + ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ + q = run.pointPresentation.limitPoint i x ∧ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := + run.limitValueGraph_entry (fun i => (run.diagram.stage i).stage.height) + (run.stageFieldFamily_entry 10) (fun i _ _ => run.height_value_mem_bound i) q t + +theorem limitHeight_at (i : I) {x : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : + ZFSet.pair (run.pointPresentation.limitPoint i x) t ∈ run.limitHeight ↔ + ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := + run.limitValueGraph_at (fun j => (run.diagram.stage j).stage.height) + (run.stageFieldFamily_entry 10) (fun j _ _ => run.height_value_mem_bound j) + (fun _ _ _ _ hx hy equal t => run.limitPoint_height_iff hx hy equal t) i hx t + +theorem limitHeight_function : ZFSet.IsFunc run.limitPoints (ZFSet.prod C D) run.limitHeight := by + refine ⟨?_, ?_⟩ + · intro z hz + have subset := indexedValueLift_subset run.indices run.carrierUnion run.limitPoints + run.heightValueBound (run.stageFieldFamily 10) run.limitPointInclusions + obtain ⟨q, _, t, _, rfl⟩ := ZFSet.mem_prod.1 (subset hz) + obtain ⟨i, x, hx, rfl, entry⟩ := (run.limitHeight_entry q t).1 hz + exact ZFSet.pair_mem_prod.2 ⟨run.pointPresentation.limitPoint_mem hx, + (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.height_code.function.1 entry)).2⟩ + · intro q hq + obtain ⟨i, x, hx, rfl⟩ := run.pointPresentation.limitPoint_coverage hq + obtain ⟨t, entry, unique⟩ := (run.diagram.stage i).stage.height_code.function.2 x hx + refine ⟨t, (run.limitHeight_at i hx t).2 entry, ?_⟩ + intro s hs + exact unique s ((run.limitHeight_at i hx s).1 hs) + +theorem limitPointMap_height (i : I) {x q : ZFSet.{u}} + (image : ZFSet.pair x q ∈ run.limitPointMap i) (t : ZFSet.{u}) : + ZFSet.pair q t ∈ run.limitHeight ↔ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := by + obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x q).1 image + exact run.limitHeight_at i hx t + +theorem limitHeight_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitHeight < o := + run.limitValueGraph_rank_lt limit rank _ (run.heightValueBound_rank_le_code.trans_lt rank) + + + + + +noncomputable def limitBirth : ZFSet.{u} := + run.limitValueGraph run.birthFamily run.cutoffLimit + +theorem limitBirth_ground : run.limitBirth ∈ M.sets := + run.limitValueGraph_ground run.birthFamily_ground run.cutoffLimit_ground + +theorem limitBirth_entry (q t : ZFSet.{u}) : + ZFSet.pair q t ∈ run.limitBirth ↔ run.LimitBirthValue q t := + run.limitValueGraph_entry (fun i => (run.diagram.stage i).birth) run.birthFamily_entry + (fun i _ _ entry => run.birth_time_mem_cutoffLimit i entry) q t + +theorem limitBirth_function : ZFSet.IsFunc run.limitPoints run.cutoffLimit run.limitBirth := by + refine ⟨indexedValueLift_subset run.indices run.carrierUnion run.limitPoints + run.cutoffLimit run.birthFamily run.limitPointInclusions, ?_⟩ + intro q hq + obtain ⟨t, birth⟩ := run.limitBirthValue_total hq + refine ⟨t, (run.limitBirth_entry q t).2 birth, ?_⟩ + intro s entry + exact run.limitBirthValue_unique ((run.limitBirth_entry q s).1 entry) birth + +theorem limitBirth_at (i : I) {x : ZFSet.{u}} + (hx : x ∈ (run.diagram.stage i).stage.carrier) (t : ZFSet.{u}) : + ZFSet.pair (run.pointPresentation.limitPoint i x) t ∈ run.limitBirth ↔ + ZFSet.pair x t ∈ (run.diagram.stage i).birth := + (run.limitBirth_entry _ t).trans (run.limitBirthValue_at i hx t) + +theorem limitPointMap_birth_iff (i : I) (x q t : ZFSet.{u}) + (entry : ZFSet.pair x q ∈ run.limitPointMap i) : + ZFSet.pair q t ∈ run.limitBirth ↔ ZFSet.pair x t ∈ (run.diagram.stage i).birth := by + obtain ⟨hx, rfl⟩ := (run.pointPresentation.inclusion_entry i x q).1 entry + exact run.limitBirth_at i hx t + +theorem limitBirth_old_fiber (i : I) (q t : ZFSet.{u}) + (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : + ZFSet.pair q t ∈ run.limitBirth ↔ ∃ x ∈ (run.diagram.stage i).stage.carrier, + ZFSet.pair x t ∈ (run.diagram.stage i).birth ∧ ZFSet.pair x q ∈ run.limitPointMap i := by + rw [run.limitBirth_entry, run.limitBirthValue_old_fiber i q t before] + constructor + · rintro ⟨x, hx, birth, equal⟩ + exact ⟨x, hx, birth, (run.pointPresentation.inclusion_entry i x q).2 ⟨hx, equal⟩⟩ + · rintro ⟨x, hx, birth, entry⟩ + exact ⟨x, hx, birth, ((run.pointPresentation.inclusion_entry i x q).1 entry).2⟩ + +theorem limitBirth_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitBirth < o := + run.limitValueGraph_rank_lt limit rank run.birthFamily (run.cutoffLimit_rank_le_code.trans_lt rank) + + + + + +theorem limitHeight_code : StrictLexHeightCode run.limitPoints C D run.limitOrder run.limitHeight rD where + function := run.limitHeight_function + strict p hp q hq c a d b lower different first second := by + obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := run.pointPresentation.pair_coverage hp hq + have sourceOrder := (run.limitLE_at i hx hy).1 ((run.limitOrder_entry _ _).1 lower) + have sourceDifferent : x ≠ y := fun equal => different (congrArg (run.pointPresentation.limitPoint i) equal) + exact (run.diagram.stage i).stage.height_code.strict x hx y hy c a d b sourceOrder sourceDifferent + ((run.limitHeight_at i hx _).1 first) ((run.limitHeight_at i hy _).1 second) + +noncomputable def limitHeightRange : ZFSet.{u} := functionGraphRange run.limitPoints run.limitHeight + +theorem limitHeightRange_ground : run.limitHeightRange ∈ M.sets := + M.functionGraphRange_mem unions separation run.limitPoints_ground run.limitHeight_ground + +theorem limitHeightRange_mem (t : ZFSet.{u}) : + t ∈ run.limitHeightRange ↔ + ∃ i x, x ∈ (run.diagram.stage i).stage.carrier ∧ ZFSet.pair x t ∈ (run.diagram.stage i).stage.height := by + rw [limitHeightRange, mem_functionGraphRange] + constructor + · rintro ⟨q, _, entry⟩ + obtain ⟨i, x, hx, _, value⟩ := (run.limitHeight_entry q t).1 entry + exact ⟨i, x, hx, value⟩ + · rintro ⟨i, x, hx, entry⟩ + exact ⟨run.pointPresentation.limitPoint i x, run.pointPresentation.limitPoint_mem hx, + (run.limitHeight_at i hx t).2 entry⟩ + +theorem limitHeightRange_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitHeightRange < o := + (functionGraphRange_rank_le _ _).trans_lt (run.limitHeight_rank_lt limit rank) + + + + + +theorem limit_old_meet : OldMeetCode run.limitOrder run.limitMeetGraph run.limitBirth := by + intro p q v a b c bornQ bornP earlier notLower meet bornV + have bounds := run.limitMeet_bounds ((run.limitMeetGraph_entry p q v).1 meet) + obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl⟩ := + run.pointPresentation.triple_coverage bounds.1 bounds.2.1 bounds.2.2 + apply (run.diagram.stage i).old_meet x y z a b c + ((run.limitBirth_at i hy a).1 bornQ) ((run.limitBirth_at i hx b).1 bornP) earlier + · intro lower + exact notLower ((run.limitOrder_entry _ _).2 ((run.limitLE_at i hx hy).2 lower)) + · exact (run.limitMeet_at i hx hy hz).1 ((run.limitMeetGraph_entry _ _ _).1 meet) + · exact (run.limitBirth_at i hz c).1 bornV + + + + + +noncomputable def limitTerminalFields : Fin 5 → ZFSet.{u} := + Fin.cases run.limitPoints (Fin.cases run.limitOrder (Fin.cases run.limitMeetGraph + (Fin.cases run.limitBirth (Fin.cases run.limitHeight Fin.elim0)))) + +theorem limitTerminalFields_ground : ∀ j, run.limitTerminalFields j ∈ M.sets := + Fin.cases run.limitPoints_ground (Fin.cases run.limitOrder_ground (Fin.cases run.limitMeetGraph_ground + (Fin.cases run.limitBirth_ground (Fin.cases run.limitHeight_ground (fun i => Fin.elim0 i))))) + +theorem limitTerminalPoint : ChronologyPointCode (insert run.cutoffLimit run.cutoffLimit) C D rD + run.cutoffLimit run.limitPoints run.limitOrder run.limitMeetGraph run.limitBirth run.limitHeight where + meet := run.limitMeet_code + birth_function := by + refine ⟨?_, run.limitBirth_function.2⟩ + intro z hz + obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (run.limitBirth_function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_insert_of_mem _ ht⟩ + birth_bound _ _ _ entry := Or.inr (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 entry)).2 + old_meet := run.limit_old_meet + strict_height := run.limitHeight_code + +theorem limitTerminalFields_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ∀ j, ZFSet.rank (run.limitTerminalFields j) < o := + Fin.cases (run.limitPoints_rank_lt limit rank) (Fin.cases (run.limitOrder_rank_lt limit rank) + (Fin.cases (run.limitMeetGraph_rank_lt limit rank) (Fin.cases (run.limitBirth_rank_lt limit rank) + (Fin.cases (run.limitHeight_rank_lt limit rank) (fun i => Fin.elim0 i))))) + + + + + +noncomputable def limitChronologyFields : + GroundChronologyFields M (insert run.cutoffLimit run.cutoffLimit) := + run.limitPriorFields.appendTime pairing unions run.limitTerminalFields run.limitTerminalFields_ground + +theorem limitChronologyFields_graph (j : Fin 5) : + run.limitChronologyFields.graph j = + insert (ZFSet.pair run.cutoffLimit (run.limitTerminalFields j)) (run.serialFieldUnion j) := rfl + +theorem limitChronologyFields_terminal (j : Fin 5) : + run.limitChronologyFields.value j run.cutoffLimit = run.limitTerminalFields j := + run.limitPriorFields.appendTime_value_at pairing unions run.limitTerminalFields run.limitTerminalFields_ground j + +theorem limitChronologyFields_values (i : I) (j : Fin 5) {s : ZFSet.{u}} + (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : + run.limitChronologyFields.value j s = (run.diagram.stage i).history.fieldValue j s := + (run.limitPriorFields.appendTime_value_old pairing unions run.limitTerminalFields run.limitTerminalFields_ground + j ((run.cutoffLimit_mem s).2 ⟨i, before⟩)).trans (run.limitPriorFields_values i j before) + +theorem limitChronologyFields_source_entries (i : I) (j : Fin 5) {s : ZFSet.{u}} + (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) (y : ZFSet.{u}) : + ZFSet.pair s y ∈ run.limitChronologyFields.graph j ↔ + ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j := by + have old := run.limitPriorFields.appendTime_old_entries pairing unions run.limitTerminalFields + run.limitTerminalFields_ground j ((run.cutoffLimit_mem s).2 ⟨i, before⟩) (y := y) + exact (old.trans (run.serialFieldUnion_at i j before y)).trans + ((run.serialFieldGraph_entry i j s y).trans (and_iff_right before)).symm + +theorem limitChronologyFields_graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) (j : Fin 5) : + ZFSet.rank (run.limitChronologyFields.graph j) < o := + run.limitPriorFields.appendTime_graph_rank_lt pairing unions run.limitTerminalFields + run.limitTerminalFields_ground limit (run.cutoffLimit_rank_le_code.trans_lt rank) + (fun j => (run.serialFieldUnion_rank_le_code j).trans_lt rank) + (run.limitTerminalFields_rank_lt limit rank) j + + + + + +theorem limitChronologyPoint {s : ZFSet.{u}} (hs : s ∈ insert run.cutoffLimit run.cutoffLimit) : + ChronologyPointCode (insert run.cutoffLimit run.cutoffLimit) C D rD s + (run.limitChronologyFields.value 0 s) (run.limitChronologyFields.value 1 s) + (run.limitChronologyFields.value 2 s) (run.limitChronologyFields.value 3 s) + (run.limitChronologyFields.value 4 s) := by + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · simp only [run.limitChronologyFields_terminal] + exact run.limitTerminalPoint + · obtain ⟨i, before⟩ := (run.cutoffLimit_mem s).1 hs + rw [run.limitChronologyFields_values i 0 before, run.limitChronologyFields_values i 1 before, + run.limitChronologyFields_values i 2 before, run.limitChronologyFields_values i 3 before, + run.limitChronologyFields_values i 4 before] + change ChronologyPointCode (insert run.cutoffLimit run.cutoffLimit) C D rD s + ((run.diagram.stage i).history.space s) ((run.diagram.stage i).history.order s) + ((run.diagram.stage i).history.meetGraph s) ((run.diagram.stage i).history.birth s) + ((run.diagram.stage i).history.height s) + have sourceTime : s ∈ insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff := + ZFSet.mem_insert_iff.2 before + refine ⟨(run.diagram.stage i).history.meet_order s sourceTime, ?_, + (run.diagram.stage i).history.birth_bound s sourceTime, + (run.diagram.stage i).history.old_meet s sourceTime, + (run.diagram.stage i).history.strict_height s sourceTime⟩ + refine ⟨?_, ((run.diagram.stage i).history.birth_function s sourceTime).2⟩ + intro z hz + obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 + (((run.diagram.stage i).history.birth_function s sourceTime).1 hz) + have member : t ∈ run.cutoffLimit := by + rcases ZFSet.mem_insert_iff.1 ht with rfl | ht + · exact run.cutoff_mem_cutoffLimit i + · exact run.cutoffLimit_ordinal.1 _ (run.cutoff_mem_cutoffLimit i) _ ht + exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_insert_of_mem _ member⟩ + +theorem limitChronologyCore : ChronologyCoreCode (insert run.cutoffLimit run.cutoffLimit) + run.limitChronologyFields.bound C D rD run.limitChronologyFields.graph where + function := run.limitChronologyFields.function + point s hs L r μ birth height eL er eμ eb eh := by + have current := run.limitChronologyPoint hs + rw [run.limitChronologyFields.value_eq_of_entry 0 eL, + run.limitChronologyFields.value_eq_of_entry 1 er, + run.limitChronologyFields.value_eq_of_entry 2 eμ, + run.limitChronologyFields.value_eq_of_entry 3 eb, + run.limitChronologyFields.value_eq_of_entry 4 eh] at current + exact current + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageConstruction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageConstruction.lean index 3fe1316c52691f3cf695874717d06f956a85deea..6db9d3c19ea4306f0c3cb388a55e7e6c4ca4d816 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageConstruction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageConstruction.lean @@ -1,824 +1,824 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixLimitActionLaws -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixPriorLayerWitnesses -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitSizes -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixTopColumns - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitIdentity_ground (i : I) : run.limitIdentity i ∈ M.sets := - M.transitive run.limitActors_ground (run.limitIdentity_mem i) - -theorem limitIdentity_rank_lt (i : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank (run.limitIdentity i) < o := - (ZFSet.rank_lt_of_mem (run.limitIdentity_mem i)).trans (run.limitActors_rank_lt limit rank) - -theorem limitGroup_code (i₀ : I) : - GroupCode run.limitActors run.limitMultiplication run.limitInverse (run.limitIdentity i₀) where - mul_function := run.limitMultiplication_function - inv_function := run.limitInverse_function - identity_mem := run.limitIdentity_mem i₀ - one_mul g hg := by - obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg - rw [run.limitIdentity_eq i₀ i] - exact (run.limitMultiplication_at i (run.diagram.stage i).stage.group_code.identity_mem ha ha).2 - ((run.diagram.stage i).stage.group_code.one_mul a ha) - mul_one g hg := by - obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg - rw [run.limitIdentity_eq i₀ i] - exact (run.limitMultiplication_at i ha (run.diagram.stage i).stage.group_code.identity_mem ha).2 - ((run.diagram.stage i).stage.group_code.mul_one a ha) - inv_mul g hg h hh inverse := by - obtain ⟨i, a, b, ha, hb, rfl, rfl⟩ := run.actorPresentation.pair_coverage hg hh - rw [run.limitIdentity_eq i₀ i] - exact (run.limitMultiplication_at i hb ha (run.diagram.stage i).stage.group_code.identity_mem).2 - ((run.diagram.stage i).stage.group_code.inv_mul a ha b hb ((run.limitInverse_at i ha hb).1 inverse)) - mul_assoc g hg h hh k hk a _ b _ c _ first second third := by - obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl⟩ := run.actorPresentation.triple_coverage hg hh hk - obtain ⟨u, xy, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 - (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) - obtain ⟨v, yz, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 - (ZFSet.pair y z) (ZFSet.pair_mem_prod.2 ⟨hy, hz⟩) - have hu := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 xy)).2 - have hv := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 yz)).2 - obtain ⟨w, uz, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 - (ZFSet.pair u z) (ZFSet.pair_mem_prod.2 ⟨hu, hz⟩) - have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 uz)).2 - have function : FunctionGraphOn (ZFSet.prod run.limitActors run.limitActors) run.limitMultiplication := - ⟨_, run.limitMultiplication_function⟩ - have equalA : a = run.actorPresentation.limitPoint i u := - function.unique first ((run.limitMultiplication_at i hx hy hu).2 xy) - have equalB : b = run.actorPresentation.limitPoint i v := - function.unique second ((run.limitMultiplication_at i hy hz hv).2 yz) - subst a - subst b - have equalC : c = run.actorPresentation.limitPoint i w := - function.unique third ((run.limitMultiplication_at i hu hz hw).2 uz) - subst c - exact (run.limitMultiplication_at i hx hv hw).2 - ((run.diagram.stage i).stage.group_code.mul_assoc x hx y hy z hz u hu v hv w hw xy yz uz) - -theorem limitActorMap_multiplication_iff (i : I) (a b c g h k : ZFSet.{u}) - (first : ZFSet.pair a g ∈ run.limitActorMap i) - (second : ZFSet.pair b h ∈ run.limitActorMap i) - (third : ZFSet.pair c k ∈ run.limitActorMap i) : - ZFSet.pair (ZFSet.pair g h) k ∈ run.limitMultiplication ↔ - ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication := by - obtain ⟨ha, rfl⟩ := (run.actorPresentation.inclusion_entry i a g).1 first - obtain ⟨hb, rfl⟩ := (run.actorPresentation.inclusion_entry i b h).1 second - obtain ⟨hc, rfl⟩ := (run.actorPresentation.inclusion_entry i c k).1 third - exact run.limitMultiplication_at i ha hb hc - -theorem limitActorMap_groupEmbedding (i₀ i : I) : - GroupEmbeddingCode (run.diagram.stage i).stage.actors run.limitActors - (run.diagram.stage i).stage.multiplication run.limitMultiplication - (run.diagram.stage i).stage.identity (run.limitIdentity i₀) (run.limitActorMap i) where - injection := run.limitActorMap_injection i - one := (run.actorPresentation.inclusion_entry i _ _).2 - ⟨(run.diagram.stage i).stage.group_code.identity_mem, run.limitIdentity_eq i₀ i⟩ - mul a b c g h k product first second third := - (run.limitActorMap_multiplication_iff i a b c g h k first second third).2 product - -theorem limitActorMap_inverse_iff (i : I) (a b g h : ZFSet.{u}) - (first : ZFSet.pair a g ∈ run.limitActorMap i) - (second : ZFSet.pair b h ∈ run.limitActorMap i) : - ZFSet.pair g h ∈ run.limitInverse ↔ ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse := by - obtain ⟨ha, rfl⟩ := (run.actorPresentation.inclusion_entry i a g).1 first - obtain ⟨hb, rfl⟩ := (run.actorPresentation.inclusion_entry i b h).1 second - exact run.limitInverse_at i ha hb - -structure FixedTopStage (i₀ : I) where - column : ZFSet.{u} - coordinate : ZFSet.{u} - column_mem : column ∈ C - coordinate_mem : coordinate ∈ D - stage : GroundMainStage M C D rD - carrier_eq : stage.carrier = fixedTopCarrier run.limitPoints - order_eq : stage.order = fixedTopOrder run.limitPoints run.limitOrder - meet_eq : stage.meetGraph = fixedTopMeet run.limitPoints run.limitOrder - actors_eq : stage.actors = run.limitActors - multiplication_eq : stage.multiplication = run.limitMultiplication - inverse_eq : stage.inverse = run.limitInverse - identity_eq : stage.identity = run.limitIdentity i₀ - action_eq : stage.action = fixedTopAction run.limitActors run.limitPoints run.limitAction - bottom_eq : stage.bottom = run.limitBottom i₀ - top_eq : stage.top = run.limitPoints - height_eq : stage.height = fixedTopHeightGraph run.limitPoints run.limitHeight column coordinate - column_above : ∀ c ∈ heightColumns run.limitPoints C D run.limitHeight, c ∈ column - -theorem exists_fixedTopMainStage (i₀ : I) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indices : M.groundEmbeddable run.indices ZFSet.omega) : - Nonempty (run.FixedTopStage i₀) := by - subst C - have nonempty : D.Nonempty := by - obtain ⟨value, entry, _⟩ := (run.diagram.stage i₀).stage.height_code.function.2 - (run.diagram.stage i₀).stage.bottom (run.diagram.stage i₀).stage.bottom_mem - have member := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i₀).stage.height_code.function.1 entry)).2 - obtain ⟨_, _, q, hq, _⟩ := ZFSet.mem_prod.1 member - exact ⟨q, hq⟩ - obtain ⟨b, hb, q, hq, hL, hR, hMu, _, hAction, hHeight, meet, _, action, height, - _, _, _, _, _, _, _, above, _, _, hRange, smallRange, _, _⟩ := - M.exists_fixedTopExtension pairing unions powers separation collection infinite choice - run.limitPoints_ground run.limitOrder_ground run.limitActors_ground run.limitAction_ground - (run.diagram.stage i₀).stage.coordinates_ground run.limitHeight_ground - run.limitMeet_code (run.limitAction_code i₀) (run.limitIdentity_mem i₀) nonempty - run.limitHeight_code (run.limitHeight_relationImage_countable infinite choice indices) - let stage : GroundMainStage M (M.groundOmegaOne pairing unions powers separation collection infinite) D rD := { - carrier := fixedTopCarrier run.limitPoints - order := fixedTopOrder run.limitPoints run.limitOrder - meetGraph := fixedTopMeet run.limitPoints run.limitOrder - actors := run.limitActors - multiplication := run.limitMultiplication - inverse := run.limitInverse - identity := run.limitIdentity i₀ - action := fixedTopAction run.limitActors run.limitPoints run.limitAction - bottom := run.limitBottom i₀ - top := run.limitPoints - height := fixedTopHeightGraph run.limitPoints run.limitHeight b q - carrier_ground := hL - order_ground := hR - meet_ground := hMu - actors_ground := run.limitActors_ground - multiplication_ground := run.limitMultiplication_ground - inverse_ground := run.limitInverse_ground - action_ground := hAction - height_ground := hHeight - columns_ground := (run.diagram.stage i₀).stage.columns_ground - coordinates_ground := (run.diagram.stage i₀).stage.coordinates_ground - coordinate_order_ground := (run.diagram.stage i₀).stage.coordinate_order_ground - meet := meet - group_code := run.limitGroup_code i₀ - action_code := action - bottom_mem := fixedTopCarrier_old (run.limitBottom_mem i₀) - least := fixedTopOrder_bottom (run.limitBottom_mem i₀) (run.limitBottom_least i₀) - top_mem := fixedTopCarrier_top run.limitPoints - greatest := fun _ hx => fixedTopOrder_greatest hx - height_code := height - height_range_ground := hRange - height_range_countable := smallRange } - exact ⟨{ - column := b - coordinate := q - column_mem := hb - coordinate_mem := hq - stage := stage - carrier_eq := rfl - order_eq := rfl - meet_eq := rfl - actors_eq := rfl - multiplication_eq := rfl - inverse_eq := rfl - identity_eq := rfl - action_eq := rfl - bottom_eq := rfl - top_eq := rfl - height_eq := rfl - column_above := above }⟩ - -end GroundMainPrefix - -namespace GroundMainPrefix.FixedTopStage -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {i₀ : I} (data : run.FixedTopStage i₀) - -theorem carrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank data.stage.carrier < o := by - rw [data.carrier_eq] - exact rank_fixedTopCarrier_lt limit (run.limitPoints_rank_lt limit rank) - -theorem actors_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank data.stage.actors < o := by - rw [data.actors_eq] - exact run.limitActors_rank_lt limit rank - -theorem carrier_below (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : GroundBelow M data.stage.carrier K := by - have conditions := standard.to_conditions pairing unions powers separation hK - rw [data.carrier_eq, fixedTopCarrier] - exact GroundBelow.insert pairing unions powers separation infinite choice - run.limitPoints_ground run.limitPoints_ground hK conditions.2.1 conditions.1 - conditions.2.2.1 conditions.2.2.2 (run.limitPoints_below choice hK standard indices) - -theorem actors_below (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : GroundBelow M data.stage.actors K := by - rw [data.actors_eq] - exact run.limitActors_below choice hK standard indices - -theorem height_rank_lt (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (rank : ZFSet.rank run.code < ZFSet.rank K) : ZFSet.rank data.stage.height < ZFSet.rank K := by - have conditions := standard.to_conditions pairing unions powers separation hK - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - exact rank_functionGraph_lt limit data.stage.height_code.function (data.carrier_rank_lt limit rank) - (rank_product_lt limit (run.linked i₀).invariant.columns_rank (run.linked i₀).invariant.coordinates_rank) - -theorem code_rank_lt (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (rank : ZFSet.rank run.code < ZFSet.rank K) : ZFSet.rank data.stage.code < ZFSet.rank K := by - have conditions := standard.to_conditions pairing unions powers separation hK - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - exact data.stage.code_rank_lt limit (data.carrier_rank_lt limit rank) (data.actors_rank_lt limit rank) - (run.linked i₀).invariant.columns_rank (run.linked i₀).invariant.coordinates_rank - -theorem invariant_inputs (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) : - GroundBelow M data.stage.carrier K ∧ GroundBelow M data.stage.actors K ∧ - GroundBelow M Labels K ∧ ZFSet.rank data.stage.carrier < ZFSet.rank K ∧ - ZFSet.rank data.stage.actors < ZFSet.rank K ∧ ZFSet.rank Labels < ZFSet.rank K ∧ - run.cutoffLimit ∈ K ∧ ZFSet.rank C < ZFSet.rank K ∧ ZFSet.rank D < ZFSet.rank K := by - have conditions := standard.to_conditions pairing unions powers separation hK - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - exact ⟨data.carrier_below infinite choice hK standard indices, data.actors_below choice hK standard indices, - (run.linked i₀).invariant.labels_small, data.carrier_rank_lt limit rank, data.actors_rank_lt limit rank, - (run.linked i₀).invariant.labels_rank, run.cutoffLimit_mem_inaccessible hK standard indices, - (run.linked i₀).invariant.columns_rank, (run.linked i₀).invariant.coordinates_rank⟩ - -end GroundMainPrefix.FixedTopStage - -namespace GroundMainPrefix.FixedTopStage -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {i₀ : I} (data : run.FixedTopStage i₀) - -noncomputable def transition (i : I) : GroundMainTransition (run.diagram.stage i).stage data.stage where - points := run.limitPointMap i - actors := run.limitActorMap i - points_ground := run.limitPointMap_ground i - actors_ground := run.limitActorMap_ground i - point_embedding := by - rw [data.carrier_eq, data.order_eq, data.meet_eq] - have original := run.limitPointMap_meetEmbedding i - refine ⟨original.injection.retarget (fixedTopCarrier_subset run.limitPoints), ?_, ?_⟩ - · intro x y p q lower first second - exact fixedTopOrder_subset _ _ (original.monotone x y p q lower first second) - · intro x y z p q v meet first second third - exact fixedTopMeet_subset run.limitMeet_code (original.map_meet x y z p q v meet first second third) - order_iff := by - intro x y p q first second - have hq := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 second)).2 - rw [data.order_eq, fixedTopOrder_old_iff hq] - exact run.limitPointMap_order_iff i x y p q first second - group_embedding := by - rw [data.actors_eq, data.multiplication_eq, data.identity_eq] - exact run.limitActorMap_groupEmbedding i₀ i - equivariant := by - intro a g x y p q actor first second action - have hp := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 first)).2 - rw [data.action_eq] - exact (fixedTopAction_old_iff hp).2 (run.limitMaps_equivariant i a g x y p q actor first second action) - bottom := by - rw [data.bottom_eq] - exact run.limitPointMap_bottom i₀ i - height := by - intro x p value entry - have hp := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 - rw [data.height_eq, fixedTopHeightGraph_old_iff hp] - exact run.limitPointMap_height i entry value - agreement := by - intro g h g' h' v v' first second point agree - have hv := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 point)).2 - rw [data.carrier_eq, data.order_eq, data.action_eq] - exact (run.limitMaps_agreement i g h g' h' v v' first second point agree).fixedTop - run.limitOrder_code (run.limitAction_code i₀) hv - -theorem transition_points (i : I) : (data.transition i).points = run.limitPointMap i := rfl - -theorem transition_actors (i : I) : (data.transition i).actors = run.limitActorMap i := rfl - -theorem point_strict_top (i : I) {x y : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ run.limitPointMap i) : - ZFSet.pair y data.stage.top ∈ data.stage.order ∧ - ZFSet.pair data.stage.top y ∉ data.stage.order := by - rw [data.top_eq, data.order_eq] - exact fixedTopOrder_strict_top run.limitOrder_code - (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 - -end GroundMainPrefix.FixedTopStage - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitChronology_source_entries (i : I) (j : Fin 5) {t : ZFSet.{u}} - (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : - ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j ↔ - ZFSet.pair s y ∈ run.limitChronologyFields.graph j := by - intro s hs y - have earlier : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff := by - right - rcases before with rfl | before - · exact hs - · exact (run.diagram.stage i).cutoff_ordinal.1 _ before _ hs - exact (run.limitChronologyFields_source_entries i j earlier y).symm - -theorem limitChronology_raw_witnesses (hOmega : ZFSet.omega ∈ M.sets) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank run.code < o) - (numbers : ZFSet.rank ZFSet.omega < o) : - ∀ s ∈ insert run.cutoffLimit run.cutoffLimit, - ∀ t ∈ insert run.cutoffLimit run.cutoffLimit, t = s ∨ t ∈ s → - ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode - (run.limitChronologyFields.graph 0) (run.limitChronologyFields.graph 1) - (run.limitChronologyFields.graph 2) (run.limitChronologyFields.value 0 s) - (run.limitChronologyFields.value 1 s) (run.limitChronologyFields.value 2 s) - (run.limitChronologyFields.value 3 s) t ZFSet.omega z := by - intro s hs t _ before - rcases ZFSet.mem_insert_iff.1 hs with rfl | hs - · rw [run.limitChronologyFields_terminal 0, run.limitChronologyFields_terminal 1, - run.limitChronologyFields_terminal 2, run.limitChronologyFields_terminal 3] - change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode _ _ _ - run.limitPoints run.limitOrder run.limitMeetGraph run.limitBirth t ZFSet.omega z - rcases before with rfl | before - · have hEmpty := M.empty_mem ⟨run.cutoffLimit, run.cutoffLimit_ground⟩ - have emptyRank : ZFSet.rank (∅ : ZFSet.{u}) < o := by - simpa only [ZFSet.rank_empty] using limit.pos - refine ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, - countableLayerWitness_rank_lt limit emptyRank emptyRank, - Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty ZFSet.omega, ?_⟩⟩⟩ - intro x _ birth - exact (ZFSet.mem_irrefl _ (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 birth)).2).elim - · obtain ⟨i, old⟩ := (run.cutoffLimit_mem t).1 before - obtain ⟨z, hz, code, ranked⟩ := run.limitTerminal_raw_witness_rank_lt i old - (run.limitChronology_source_entries i 0 old) (run.limitChronology_source_entries i 1 old) - (run.limitChronology_source_entries i 2 old) hOmega limit rank numbers - exact ⟨z, hz, ranked, code⟩ - · obtain ⟨i, old⟩ := (run.cutoffLimit_mem s).1 hs - have oldT : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff := by - rcases before with rfl | before - · exact old - · right - rcases old with rfl | old - · exact before - · exact (run.diagram.stage i).cutoff_ordinal.1 _ old _ before - obtain ⟨z, hz, code, ranked⟩ := run.prior_raw_witness_rank_lt i old before - (run.limitChronology_source_entries i 0 oldT) (run.limitChronology_source_entries i 1 oldT) - (run.limitChronology_source_entries i 2 oldT) rank - rw [run.limitChronologyFields_values i 0 old, run.limitChronologyFields_values i 1 old, - run.limitChronologyFields_values i 2 old, run.limitChronologyFields_values i 3 old] - exact ⟨z, hz, ranked, code⟩ - -end GroundMainPrefix - -section -open SetFormula -universe u v - -theorem relationCompose_enlargeCodomain {A B C D f g : ZFSet.{u}} - (bound : g ⊆ ZFSet.prod B C) (subset : C ⊆ D) : - relationCompose A B D f g = relationCompose A B C f g := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨x, hx, y, hy, w, _, rfl, first, second⟩ := - (mem_relationCompose _ _ _ _ _ z).1 entry - exact (mem_relationCompose _ _ _ _ _ _).2 - ⟨x, hx, y, hy, w, (ZFSet.pair_mem_prod.1 (bound second)).2, rfl, first, second⟩ - · intro entry - obtain ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ := - (mem_relationCompose _ _ _ _ _ z).1 entry - exact (mem_relationCompose _ _ _ _ _ _).2 - ⟨x, hx, y, hy, w, subset hw, rfl, first, second⟩ - -namespace GroundMainPrefix.FixedTopStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {i₀ : I} (data : run.FixedTopStage i₀) - -theorem transition_comp {i j : I} (before : i ≤ j) : - (run.diagram.transition before).map.comp pairing unions powers separation - (data.transition j) = data.transition i := by - apply GroundMainTransition.ext - · change relationCompose _ _ data.stage.carrier _ (run.limitPointMap j) = run.limitPointMap i - rw [data.carrier_eq, relationCompose_enlargeCodomain - (run.limitPointMap_injection j).function.1 (fixedTopCarrier_subset run.limitPoints)] - exact run.limitPointMap_comp before - · change relationCompose _ _ data.stage.actors _ (run.limitActorMap j) = run.limitActorMap i - rw [data.actors_eq] - exact run.limitActorMap_comp before - -end GroundMainPrefix.FixedTopStage - -end - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_limitSerialization - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) - (level : GroundMainCandidateLevel M K) : - ∃ serial : GroundSerializedChronology M (insert run.cutoffLimit run.cutoffLimit) C D rD, - serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ - serial.code ∈ level.validChronologies C D rD ∧ - serial.fields.graph = run.limitChronologyFields.graph ∧ - (∀ j s, serial.fields.value j s = run.limitChronologyFields.value j s) ∧ - serial.layerBound = functionGraphRange - (chronologyPairs (insert run.cutoffLimit run.cutoffLimit)) serial.layers := by - have conditions := standard.to_conditions pairing unions powers separation hK - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - have numbers := standard.omega_mem pairing unions powers separation hK - exact run.limitChronologyFields.exists_rankedSerialization - pairing unions powers separation collection infinite choice hK conditions - (conditions.successor_mem pairing unions powers separation infinite hK - (run.cutoffLimit_mem_inaccessible hK standard indices)) - level (ordinalSetProperty_succ run.cutoffLimit_ordinal) run.limitChronologyCore - (run.limitChronologyFields_graph_rank_lt limit rank) - (run.limitChronology_raw_witnesses (M.transitive hK numbers) limit rank - (ZFSet.rank_lt_of_mem numbers)) - -end GroundMainPrefix - -namespace GroundMainPrefix.FixedTopStage -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {i₀ : I} (data : run.FixedTopStage i₀) - -noncomputable def chronologyValues : Fin 5 → ZFSet.{u} := - Fin.cases data.stage.carrier (Fin.cases data.stage.order - (Fin.cases data.stage.meetGraph - (Fin.cases (fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit) - (fun _ => data.stage.height)))) - -structure RankedChronology (level : GroundMainCandidateLevel M K) where - serial : GroundSerializedChronology M (insert run.cutoffLimit run.cutoffLimit) C D rD - code_ground : serial.code ∈ M.sets - code_rank : ZFSet.rank serial.code < ZFSet.rank K - code_member : serial.code ∈ level.validChronologies C D rD - graphs : ∀ j, serial.fields.graph j = - terminalChronologyGraph run.cutoffLimit (run.limitChronologyFields.graph j) (data.chronologyValues j) - terminal : ∀ j, serial.fields.value j run.cutoffLimit = data.chronologyValues j - old_values : ∀ j s, s ∈ run.cutoffLimit → - serial.fields.value j s = run.limitChronologyFields.value j s - -theorem exists_rankedChronology - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) - (level : GroundMainCandidateLevel M K) : Nonempty (data.RankedChronology level) := by - obtain ⟨prior, _, priorRank, _, priorGraphs, priorValues, _⟩ := - run.exists_limitSerialization collection infinite choice hK standard indices rank level - have terminal (j : Fin 5) : prior.fields.value j run.cutoffLimit = run.limitTerminalFields j := - (priorValues j run.cutoffLimit).trans (run.limitChronologyFields_terminal j) - have newValues : prior.fixedTopValues data.stage.height = data.chronologyValues := by - funext j - refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun _ => rfl)))) j - · change fixedTopCarrier (prior.fields.value 0 run.cutoffLimit) = data.stage.carrier - rw [terminal 0] - exact data.carrier_eq.symm - · change fixedTopOrder (prior.fields.value 0 run.cutoffLimit) - (prior.fields.value 1 run.cutoffLimit) = data.stage.order - rw [terminal 0, terminal 1] - exact data.order_eq.symm - · change fixedTopMeet (prior.fields.value 0 run.cutoffLimit) - (prior.fields.value 1 run.cutoffLimit) = data.stage.meetGraph - rw [terminal 0, terminal 1] - exact data.meet_eq.symm - · change fixedTopBirth (prior.fields.value 0 run.cutoffLimit) - (prior.fields.value 3 run.cutoffLimit) run.cutoffLimit = _ - rw [terminal 0, terminal 3] - rfl - have conditions := standard.to_conditions pairing unions powers separation hK - have earlier : ∀ x t, ZFSet.pair x t ∈ prior.fields.value 3 run.cutoffLimit → t ∈ run.cutoffLimit := by - intro x t entry - rw [terminal 3] at entry - exact (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 entry)).2 - have height : StrictLexHeightCode (fixedTopCarrier (prior.fields.value 0 run.cutoffLimit)) C D - (fixedTopOrder (prior.fields.value 0 run.cutoffLimit) (prior.fields.value 1 run.cutoffLimit)) - data.stage.height rD := by - rw [terminal 0, terminal 1] - change StrictLexHeightCode (fixedTopCarrier run.limitPoints) C D - (fixedTopOrder run.limitPoints run.limitOrder) data.stage.height rD - rw [← data.carrier_eq, ← data.order_eq] - exact data.stage.height_code - obtain ⟨extended, ground, extendedRank, member, graphs, values⟩ := - prior.exists_rankedFixedTopSerialization pairing unions powers separation collection infinite choice - hK conditions (conditions.successor_mem pairing unions powers separation infinite hK - (run.cutoffLimit_mem_inaccessible hK standard indices)) level priorRank - data.stage.height data.stage.height_ground (data.height_rank_lt infinite hK standard rank) - run.cutoffLimit_ordinal earlier height - refine ⟨⟨extended, ground, extendedRank, member, ?_, ?_, ?_⟩⟩ - · intro j - rw [congrFun graphs j] - change terminalChronologyGraph run.cutoffLimit (prior.fields.graph j) - (prior.fixedTopValues data.stage.height j) = _ - rw [priorGraphs, newValues] - · intro j - rw [values j run.cutoffLimit (ZFSet.mem_insert _ _), appendHistoryValue_at, newValues] - · intro j s hs - rw [values j s (ZFSet.mem_insert_of_mem _ hs), appendHistoryValue_old hs, priorValues] - -namespace RankedChronology -variable {data} {level : GroundMainCandidateLevel M K} (chronology : data.RankedChronology level) - -noncomputable def main : GroundChronologicalMainStage M C D rD where - stage := data.stage - cutoff := run.cutoffLimit - cutoff_ground := run.cutoffLimit_ground - cutoff_ordinal := run.cutoffLimit_ordinal - history := chronology.serial.toHistory - carrier_eq := chronology.terminal 0 - order_eq := chronology.terminal 1 - meet_eq := chronology.terminal 2 - height_eq := chronology.terminal 4 - -theorem main_stage : chronology.main.stage = data.stage := rfl - -theorem main_cutoff : chronology.main.cutoff = run.cutoffLimit := rfl - -theorem main_birth : chronology.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit := - chronology.terminal 3 - -theorem agreement (j : Fin 5) (s : ZFSet.{u}) : - chronology.serial.fields.value j s = chronology.main.history.fieldValue j s := by - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j - -theorem history_values (i : I) (j : Fin 5) {s : ZFSet.{u}} - (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : - chronology.main.history.fieldValue j s = (run.diagram.stage i).history.fieldValue j s := by - rw [← chronology.agreement, chronology.old_values j s ((run.cutoffLimit_mem s).2 ⟨i, before⟩)] - exact run.limitChronologyFields_values i j before - -end RankedChronology - -end GroundMainPrefix.FixedTopStage - -namespace GroundMainPrefix.FixedTopStage.RankedChronology -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {i₀ : I} {data : run.FixedTopStage i₀} {level : GroundMainCandidateLevel M K} -variable (chronology : data.RankedChronology level) - -noncomputable def transition (i : I) : - GroundChronologicalMainTransition (run.diagram.stage i) chronology.main where - map := data.transition i - cutoff_le := Or.inr (run.cutoff_mem_cutoffLimit i) - birth := by - intro x y t entry - have hy := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 - rw [chronology.main_birth, fixedTopBirth_old_iff hy] - exact run.limitPointMap_birth_iff i x y t entry - history_prefix := by - intro s before - exact ⟨chronology.history_values i 0 before, chronology.history_values i 1 before, - chronology.history_values i 2 before, chronology.history_values i 3 before, - chronology.history_values i 4 before⟩ - -theorem transition_map (i : I) : (chronology.transition i).map = data.transition i := rfl - -theorem transition_points (i : I) : (chronology.transition i).map.points = run.limitPointMap i := rfl - -theorem transition_actors (i : I) : (chronology.transition i).map.actors = run.limitActorMap i := rfl - -theorem coversOldBirths (i : I) : (chronology.transition i).CoversOldBirths := by - intro y t entry before - rw [chronology.main_birth] at entry - have strict : t ∈ run.cutoffLimit := (run.cutoffLimit_mem t).2 ⟨i, before⟩ - have old := (fixedTopBirth_earlier_iff strict).1 entry - obtain ⟨x, hx, _, image⟩ := (run.limitBirth_old_fiber i y t before).1 old - exact ⟨x, hx, image⟩ - -end GroundMainPrefix.FixedTopStage.RankedChronology - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} - -namespace FixedTopStage.RankedChronology -variable {i₀ : I} {data : run.FixedTopStage i₀} {level : GroundMainCandidateLevel M K} -variable (chronology : data.RankedChronology level) - -theorem invariant (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) : - chronology.main.Invariant K Labels := by - have bounds := data.invariant_inputs infinite choice hK standard indices rank - exact ⟨bounds.1, bounds.2.1, bounds.2.2.1, bounds.2.2.2.1, bounds.2.2.2.2.1, - bounds.2.2.2.2.2.1, bounds.2.2.2.2.2.2.1, bounds.2.2.2.2.2.2.2.1, - bounds.2.2.2.2.2.2.2.2⟩ - -noncomputable def linked (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) : - GroundLinkedMainStage M K Labels C D rD := - ⟨chronology.main, chronology.serial, fun j s _ => chronology.agreement j s, - chronology.invariant infinite choice hK standard indices rank, chronology.code_rank⟩ - -noncomputable def cone : run.diagram.Cone chronology.main where - leg := chronology.transition - coherent := by - intro i j before - apply GroundChronologicalMainTransition.ext - change (run.diagram.transition before).map.comp pairing unions powers separation - (data.transition j) = data.transition i - exact data.transition_comp before - -theorem cone_coverage : chronology.cone.append.CoversOldBirths := - chronology.cone.append_coverage run.coverage chronology.coversOldBirths - -end FixedTopStage.RankedChronology - -variable (run) - -theorem exists_rankedAppendLimit (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indices : M.groundEmbeddable run.indices ZFSet.omega) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) : - ∃ data : run.FixedTopStage i₀, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ - target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ - target.serial.code ∈ level.validChronologies C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (∀ i : I, - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ - (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → - ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ - ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by - have below : GroundBelow M run.indices K := - ⟨ZFSet.omega, standard.omega_mem pairing unions powers separation hK, indices⟩ - obtain ⟨data⟩ := run.exists_fixedTopMainStage i₀ collection infinite choice columns_eq indices - obtain ⟨chronology⟩ := data.exists_rankedChronology collection infinite choice hK standard below oldRank level - let target := chronology.linked infinite choice hK standard below oldRank - have conditions := standard.to_conditions pairing unions powers separation hK - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - obtain ⟨row, ground, function, entries, rowRank⟩ := run.exists_limitTransitionRow limit oldRank - have rowEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = (chronology.cone.leg i).map.code := entries - let extended := run.appendCone target chronology.cone ground function rowEntries chronology.cone_coverage - have rank : ZFSet.rank extended.code < ZFSet.rank K := - run.appendCone_code_rank_lt target chronology.cone ground function rowEntries chronology.cone_coverage - limit oldRank (target.code_rank_lt pairing unions powers separation infinite hK conditions) rowRank - refine ⟨data, target, extended, rfl, rfl, chronology.main_birth, chronology.code_member, - run.appendCone_indices target chronology.cone ground function rowEntries chronology.cone_coverage, - extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, - run.appendCone_linked_old target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_linked_top target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_stageGraph target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_stageGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_transitionGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, - ?_, ?_, ?_⟩ - · intro i j before - rfl - · intro i - exact ⟨rfl, rfl⟩ - · intro i x y entry - exact data.point_strict_top i entry - -end GroundMainPrefix - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitPointMap_coverage_iff (x : ZFSet.{u}) : - x ∈ run.limitPoints ↔ ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ - ZFSet.pair y x ∈ run.limitPointMap i := by - constructor - · intro member - obtain ⟨i, y, hy, equal⟩ := run.pointPresentation.limitPoint_coverage member - exact ⟨i, y, hy, (run.pointPresentation.inclusion_entry i y x).2 ⟨hy, equal⟩⟩ - · rintro ⟨i, y, _, entry⟩ - exact (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 - -theorem limitActorMap_coverage_iff (g : ZFSet.{u}) : - g ∈ run.limitActors ↔ ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ - ZFSet.pair h g ∈ run.limitActorMap i := by - constructor - · intro member - obtain ⟨i, h, hh, equal⟩ := run.actorPresentation.limitPoint_coverage member - exact ⟨i, h, hh, (run.actorPresentation.inclusion_entry i h g).2 ⟨hh, equal⟩⟩ - · rintro ⟨i, h, _, entry⟩ - exact (ZFSet.pair_mem_prod.1 ((run.limitActorMap_injection i).function.1 entry)).2 - -namespace FixedTopStage.RankedChronology -variable {run} {i₀ : I} {data : run.FixedTopStage i₀} {level : GroundMainCandidateLevel M K} -variable (chronology : data.RankedChronology level) - -theorem limitCoverage : run.LimitCoverage chronology.main chronology.cone := by - refine ⟨?_, ?_, ?_, rfl, ?_⟩ - · intro x - change (x ∈ data.stage.carrier ∧ x ≠ data.stage.top) ↔ - ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ ZFSet.pair y x ∈ run.limitPointMap i - rw [data.carrier_eq, data.top_eq, ← run.limitPointMap_coverage_iff] - constructor - · rintro ⟨member, different⟩ - exact ((mem_fixedTopCarrier run.limitPoints x).1 member).resolve_left different - · intro member - exact ⟨fixedTopCarrier_old member, fun equal => ZFSet.mem_irrefl _ (equal ▸ member)⟩ - · intro g - change g ∈ data.stage.actors ↔ - ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ ZFSet.pair h g ∈ run.limitActorMap i - rw [data.actors_eq] - exact run.limitActorMap_coverage_iff g - · intro i x y entry - exact data.point_strict_top i entry - · intro x - rw [chronology.main_birth] - change ZFSet.pair x run.cutoffLimit ∈ fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ↔ - x = data.stage.top - rw [data.top_eq] - exact fixedTopBirth_new_time_iff (fun _ _ entry => - (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 entry)).2) - -end FixedTopStage.RankedChronology -end GroundMainPrefix - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixLimitActionLaws +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixPriorLayerWitnesses +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitSizes +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixTopColumns + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitIdentity_ground (i : I) : run.limitIdentity i ∈ M.sets := + M.transitive run.limitActors_ground (run.limitIdentity_mem i) + +theorem limitIdentity_rank_lt (i : I) {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank (run.limitIdentity i) < o := + (ZFSet.rank_lt_of_mem (run.limitIdentity_mem i)).trans (run.limitActors_rank_lt limit rank) + +theorem limitGroup_code (i₀ : I) : + GroupCode run.limitActors run.limitMultiplication run.limitInverse (run.limitIdentity i₀) where + mul_function := run.limitMultiplication_function + inv_function := run.limitInverse_function + identity_mem := run.limitIdentity_mem i₀ + one_mul g hg := by + obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg + rw [run.limitIdentity_eq i₀ i] + exact (run.limitMultiplication_at i (run.diagram.stage i).stage.group_code.identity_mem ha ha).2 + ((run.diagram.stage i).stage.group_code.one_mul a ha) + mul_one g hg := by + obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg + rw [run.limitIdentity_eq i₀ i] + exact (run.limitMultiplication_at i ha (run.diagram.stage i).stage.group_code.identity_mem ha).2 + ((run.diagram.stage i).stage.group_code.mul_one a ha) + inv_mul g hg h hh inverse := by + obtain ⟨i, a, b, ha, hb, rfl, rfl⟩ := run.actorPresentation.pair_coverage hg hh + rw [run.limitIdentity_eq i₀ i] + exact (run.limitMultiplication_at i hb ha (run.diagram.stage i).stage.group_code.identity_mem).2 + ((run.diagram.stage i).stage.group_code.inv_mul a ha b hb ((run.limitInverse_at i ha hb).1 inverse)) + mul_assoc g hg h hh k hk a _ b _ c _ first second third := by + obtain ⟨i, x, y, z, hx, hy, hz, rfl, rfl, rfl⟩ := run.actorPresentation.triple_coverage hg hh hk + obtain ⟨u, xy, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 + (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩) + obtain ⟨v, yz, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 + (ZFSet.pair y z) (ZFSet.pair_mem_prod.2 ⟨hy, hz⟩) + have hu := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 xy)).2 + have hv := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 yz)).2 + obtain ⟨w, uz, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 + (ZFSet.pair u z) (ZFSet.pair_mem_prod.2 ⟨hu, hz⟩) + have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 uz)).2 + have function : FunctionGraphOn (ZFSet.prod run.limitActors run.limitActors) run.limitMultiplication := + ⟨_, run.limitMultiplication_function⟩ + have equalA : a = run.actorPresentation.limitPoint i u := + function.unique first ((run.limitMultiplication_at i hx hy hu).2 xy) + have equalB : b = run.actorPresentation.limitPoint i v := + function.unique second ((run.limitMultiplication_at i hy hz hv).2 yz) + subst a + subst b + have equalC : c = run.actorPresentation.limitPoint i w := + function.unique third ((run.limitMultiplication_at i hu hz hw).2 uz) + subst c + exact (run.limitMultiplication_at i hx hv hw).2 + ((run.diagram.stage i).stage.group_code.mul_assoc x hx y hy z hz u hu v hv w hw xy yz uz) + +theorem limitActorMap_multiplication_iff (i : I) (a b c g h k : ZFSet.{u}) + (first : ZFSet.pair a g ∈ run.limitActorMap i) + (second : ZFSet.pair b h ∈ run.limitActorMap i) + (third : ZFSet.pair c k ∈ run.limitActorMap i) : + ZFSet.pair (ZFSet.pair g h) k ∈ run.limitMultiplication ↔ + ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication := by + obtain ⟨ha, rfl⟩ := (run.actorPresentation.inclusion_entry i a g).1 first + obtain ⟨hb, rfl⟩ := (run.actorPresentation.inclusion_entry i b h).1 second + obtain ⟨hc, rfl⟩ := (run.actorPresentation.inclusion_entry i c k).1 third + exact run.limitMultiplication_at i ha hb hc + +theorem limitActorMap_groupEmbedding (i₀ i : I) : + GroupEmbeddingCode (run.diagram.stage i).stage.actors run.limitActors + (run.diagram.stage i).stage.multiplication run.limitMultiplication + (run.diagram.stage i).stage.identity (run.limitIdentity i₀) (run.limitActorMap i) where + injection := run.limitActorMap_injection i + one := (run.actorPresentation.inclusion_entry i _ _).2 + ⟨(run.diagram.stage i).stage.group_code.identity_mem, run.limitIdentity_eq i₀ i⟩ + mul a b c g h k product first second third := + (run.limitActorMap_multiplication_iff i a b c g h k first second third).2 product + +theorem limitActorMap_inverse_iff (i : I) (a b g h : ZFSet.{u}) + (first : ZFSet.pair a g ∈ run.limitActorMap i) + (second : ZFSet.pair b h ∈ run.limitActorMap i) : + ZFSet.pair g h ∈ run.limitInverse ↔ ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse := by + obtain ⟨ha, rfl⟩ := (run.actorPresentation.inclusion_entry i a g).1 first + obtain ⟨hb, rfl⟩ := (run.actorPresentation.inclusion_entry i b h).1 second + exact run.limitInverse_at i ha hb + +structure FixedTopStage (i₀ : I) where + column : ZFSet.{u} + coordinate : ZFSet.{u} + column_mem : column ∈ C + coordinate_mem : coordinate ∈ D + stage : GroundMainStage M C D rD + carrier_eq : stage.carrier = fixedTopCarrier run.limitPoints + order_eq : stage.order = fixedTopOrder run.limitPoints run.limitOrder + meet_eq : stage.meetGraph = fixedTopMeet run.limitPoints run.limitOrder + actors_eq : stage.actors = run.limitActors + multiplication_eq : stage.multiplication = run.limitMultiplication + inverse_eq : stage.inverse = run.limitInverse + identity_eq : stage.identity = run.limitIdentity i₀ + action_eq : stage.action = fixedTopAction run.limitActors run.limitPoints run.limitAction + bottom_eq : stage.bottom = run.limitBottom i₀ + top_eq : stage.top = run.limitPoints + height_eq : stage.height = fixedTopHeightGraph run.limitPoints run.limitHeight column coordinate + column_above : ∀ c ∈ heightColumns run.limitPoints C D run.limitHeight, c ∈ column + +theorem exists_fixedTopMainStage (i₀ : I) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indices : M.groundEmbeddable run.indices ZFSet.omega) : + Nonempty (run.FixedTopStage i₀) := by + subst C + have nonempty : D.Nonempty := by + obtain ⟨value, entry, _⟩ := (run.diagram.stage i₀).stage.height_code.function.2 + (run.diagram.stage i₀).stage.bottom (run.diagram.stage i₀).stage.bottom_mem + have member := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i₀).stage.height_code.function.1 entry)).2 + obtain ⟨_, _, q, hq, _⟩ := ZFSet.mem_prod.1 member + exact ⟨q, hq⟩ + obtain ⟨b, hb, q, hq, hL, hR, hMu, _, hAction, hHeight, meet, _, action, height, + _, _, _, _, _, _, _, above, _, _, hRange, smallRange, _, _⟩ := + M.exists_fixedTopExtension pairing unions powers separation collection infinite choice + run.limitPoints_ground run.limitOrder_ground run.limitActors_ground run.limitAction_ground + (run.diagram.stage i₀).stage.coordinates_ground run.limitHeight_ground + run.limitMeet_code (run.limitAction_code i₀) (run.limitIdentity_mem i₀) nonempty + run.limitHeight_code (run.limitHeight_relationImage_countable infinite choice indices) + let stage : GroundMainStage M (M.groundOmegaOne pairing unions powers separation collection infinite) D rD := { + carrier := fixedTopCarrier run.limitPoints + order := fixedTopOrder run.limitPoints run.limitOrder + meetGraph := fixedTopMeet run.limitPoints run.limitOrder + actors := run.limitActors + multiplication := run.limitMultiplication + inverse := run.limitInverse + identity := run.limitIdentity i₀ + action := fixedTopAction run.limitActors run.limitPoints run.limitAction + bottom := run.limitBottom i₀ + top := run.limitPoints + height := fixedTopHeightGraph run.limitPoints run.limitHeight b q + carrier_ground := hL + order_ground := hR + meet_ground := hMu + actors_ground := run.limitActors_ground + multiplication_ground := run.limitMultiplication_ground + inverse_ground := run.limitInverse_ground + action_ground := hAction + height_ground := hHeight + columns_ground := (run.diagram.stage i₀).stage.columns_ground + coordinates_ground := (run.diagram.stage i₀).stage.coordinates_ground + coordinate_order_ground := (run.diagram.stage i₀).stage.coordinate_order_ground + meet := meet + group_code := run.limitGroup_code i₀ + action_code := action + bottom_mem := fixedTopCarrier_old (run.limitBottom_mem i₀) + least := fixedTopOrder_bottom (run.limitBottom_mem i₀) (run.limitBottom_least i₀) + top_mem := fixedTopCarrier_top run.limitPoints + greatest := fun _ hx => fixedTopOrder_greatest hx + height_code := height + height_range_ground := hRange + height_range_countable := smallRange } + exact ⟨{ + column := b + coordinate := q + column_mem := hb + coordinate_mem := hq + stage := stage + carrier_eq := rfl + order_eq := rfl + meet_eq := rfl + actors_eq := rfl + multiplication_eq := rfl + inverse_eq := rfl + identity_eq := rfl + action_eq := rfl + bottom_eq := rfl + top_eq := rfl + height_eq := rfl + column_above := above }⟩ + +end GroundMainPrefix + +namespace GroundMainPrefix.FixedTopStage +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {i₀ : I} (data : run.FixedTopStage i₀) + +theorem carrier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank data.stage.carrier < o := by + rw [data.carrier_eq] + exact rank_fixedTopCarrier_lt limit (run.limitPoints_rank_lt limit rank) + +theorem actors_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank data.stage.actors < o := by + rw [data.actors_eq] + exact run.limitActors_rank_lt limit rank + +theorem carrier_below (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : GroundBelow M data.stage.carrier K := by + have conditions := standard.to_conditions pairing unions powers separation hK + rw [data.carrier_eq, fixedTopCarrier] + exact GroundBelow.insert pairing unions powers separation infinite choice + run.limitPoints_ground run.limitPoints_ground hK conditions.2.1 conditions.1 + conditions.2.2.1 conditions.2.2.2 (run.limitPoints_below choice hK standard indices) + +theorem actors_below (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : GroundBelow M data.stage.actors K := by + rw [data.actors_eq] + exact run.limitActors_below choice hK standard indices + +theorem height_rank_lt (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (rank : ZFSet.rank run.code < ZFSet.rank K) : ZFSet.rank data.stage.height < ZFSet.rank K := by + have conditions := standard.to_conditions pairing unions powers separation hK + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + exact rank_functionGraph_lt limit data.stage.height_code.function (data.carrier_rank_lt limit rank) + (rank_product_lt limit (run.linked i₀).invariant.columns_rank (run.linked i₀).invariant.coordinates_rank) + +theorem code_rank_lt (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (rank : ZFSet.rank run.code < ZFSet.rank K) : ZFSet.rank data.stage.code < ZFSet.rank K := by + have conditions := standard.to_conditions pairing unions powers separation hK + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + exact data.stage.code_rank_lt limit (data.carrier_rank_lt limit rank) (data.actors_rank_lt limit rank) + (run.linked i₀).invariant.columns_rank (run.linked i₀).invariant.coordinates_rank + +theorem invariant_inputs (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) : + GroundBelow M data.stage.carrier K ∧ GroundBelow M data.stage.actors K ∧ + GroundBelow M Labels K ∧ ZFSet.rank data.stage.carrier < ZFSet.rank K ∧ + ZFSet.rank data.stage.actors < ZFSet.rank K ∧ ZFSet.rank Labels < ZFSet.rank K ∧ + run.cutoffLimit ∈ K ∧ ZFSet.rank C < ZFSet.rank K ∧ ZFSet.rank D < ZFSet.rank K := by + have conditions := standard.to_conditions pairing unions powers separation hK + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + exact ⟨data.carrier_below infinite choice hK standard indices, data.actors_below choice hK standard indices, + (run.linked i₀).invariant.labels_small, data.carrier_rank_lt limit rank, data.actors_rank_lt limit rank, + (run.linked i₀).invariant.labels_rank, run.cutoffLimit_mem_inaccessible hK standard indices, + (run.linked i₀).invariant.columns_rank, (run.linked i₀).invariant.coordinates_rank⟩ + +end GroundMainPrefix.FixedTopStage + +namespace GroundMainPrefix.FixedTopStage +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {i₀ : I} (data : run.FixedTopStage i₀) + +noncomputable def transition (i : I) : GroundMainTransition (run.diagram.stage i).stage data.stage where + points := run.limitPointMap i + actors := run.limitActorMap i + points_ground := run.limitPointMap_ground i + actors_ground := run.limitActorMap_ground i + point_embedding := by + rw [data.carrier_eq, data.order_eq, data.meet_eq] + have original := run.limitPointMap_meetEmbedding i + refine ⟨original.injection.retarget (fixedTopCarrier_subset run.limitPoints), ?_, ?_⟩ + · intro x y p q lower first second + exact fixedTopOrder_subset _ _ (original.monotone x y p q lower first second) + · intro x y z p q v meet first second third + exact fixedTopMeet_subset run.limitMeet_code (original.map_meet x y z p q v meet first second third) + order_iff := by + intro x y p q first second + have hq := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 second)).2 + rw [data.order_eq, fixedTopOrder_old_iff hq] + exact run.limitPointMap_order_iff i x y p q first second + group_embedding := by + rw [data.actors_eq, data.multiplication_eq, data.identity_eq] + exact run.limitActorMap_groupEmbedding i₀ i + equivariant := by + intro a g x y p q actor first second action + have hp := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 first)).2 + rw [data.action_eq] + exact (fixedTopAction_old_iff hp).2 (run.limitMaps_equivariant i a g x y p q actor first second action) + bottom := by + rw [data.bottom_eq] + exact run.limitPointMap_bottom i₀ i + height := by + intro x p value entry + have hp := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 + rw [data.height_eq, fixedTopHeightGraph_old_iff hp] + exact run.limitPointMap_height i entry value + agreement := by + intro g h g' h' v v' first second point agree + have hv := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 point)).2 + rw [data.carrier_eq, data.order_eq, data.action_eq] + exact (run.limitMaps_agreement i g h g' h' v v' first second point agree).fixedTop + run.limitOrder_code (run.limitAction_code i₀) hv + +theorem transition_points (i : I) : (data.transition i).points = run.limitPointMap i := rfl + +theorem transition_actors (i : I) : (data.transition i).actors = run.limitActorMap i := rfl + +theorem point_strict_top (i : I) {x y : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ run.limitPointMap i) : + ZFSet.pair y data.stage.top ∈ data.stage.order ∧ + ZFSet.pair data.stage.top y ∉ data.stage.order := by + rw [data.top_eq, data.order_eq] + exact fixedTopOrder_strict_top run.limitOrder_code + (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 + +end GroundMainPrefix.FixedTopStage + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitChronology_source_entries (i : I) (j : Fin 5) {t : ZFSet.{u}} + (before : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff) : + ∀ s ∈ t, ∀ y, ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j ↔ + ZFSet.pair s y ∈ run.limitChronologyFields.graph j := by + intro s hs y + have earlier : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff := by + right + rcases before with rfl | before + · exact hs + · exact (run.diagram.stage i).cutoff_ordinal.1 _ before _ hs + exact (run.limitChronologyFields_source_entries i j earlier y).symm + +theorem limitChronology_raw_witnesses (hOmega : ZFSet.omega ∈ M.sets) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (rank : ZFSet.rank run.code < o) + (numbers : ZFSet.rank ZFSet.omega < o) : + ∀ s ∈ insert run.cutoffLimit run.cutoffLimit, + ∀ t ∈ insert run.cutoffLimit run.cutoffLimit, t = s ∨ t ∈ s → + ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode + (run.limitChronologyFields.graph 0) (run.limitChronologyFields.graph 1) + (run.limitChronologyFields.graph 2) (run.limitChronologyFields.value 0 s) + (run.limitChronologyFields.value 1 s) (run.limitChronologyFields.value 2 s) + (run.limitChronologyFields.value 3 s) t ZFSet.omega z := by + intro s hs t _ before + rcases ZFSet.mem_insert_iff.1 hs with rfl | hs + · rw [run.limitChronologyFields_terminal 0, run.limitChronologyFields_terminal 1, + run.limitChronologyFields_terminal 2, run.limitChronologyFields_terminal 3] + change ∃ z ∈ M.sets, ZFSet.rank z < o ∧ GrowthLayerWitnessCode _ _ _ + run.limitPoints run.limitOrder run.limitMeetGraph run.limitBirth t ZFSet.omega z + rcases before with rfl | before + · have hEmpty := M.empty_mem ⟨run.cutoffLimit, run.cutoffLimit_ground⟩ + have emptyRank : ZFSet.rank (∅ : ZFSet.{u}) < o := by + simpa only [ZFSet.rank_empty] using limit.pos + refine ⟨countableLayerWitness ∅ ∅, M.countableLayerWitness_mem pairing hEmpty hEmpty, + countableLayerWitness_rank_lt limit emptyRank emptyRank, + Or.inl ⟨∅, ∅, rfl, ⟨InjectionCode.empty ZFSet.omega, ?_⟩⟩⟩ + intro x _ birth + exact (ZFSet.mem_irrefl _ (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 birth)).2).elim + · obtain ⟨i, old⟩ := (run.cutoffLimit_mem t).1 before + obtain ⟨z, hz, code, ranked⟩ := run.limitTerminal_raw_witness_rank_lt i old + (run.limitChronology_source_entries i 0 old) (run.limitChronology_source_entries i 1 old) + (run.limitChronology_source_entries i 2 old) hOmega limit rank numbers + exact ⟨z, hz, ranked, code⟩ + · obtain ⟨i, old⟩ := (run.cutoffLimit_mem s).1 hs + have oldT : t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff := by + rcases before with rfl | before + · exact old + · right + rcases old with rfl | old + · exact before + · exact (run.diagram.stage i).cutoff_ordinal.1 _ old _ before + obtain ⟨z, hz, code, ranked⟩ := run.prior_raw_witness_rank_lt i old before + (run.limitChronology_source_entries i 0 oldT) (run.limitChronology_source_entries i 1 oldT) + (run.limitChronology_source_entries i 2 oldT) rank + rw [run.limitChronologyFields_values i 0 old, run.limitChronologyFields_values i 1 old, + run.limitChronologyFields_values i 2 old, run.limitChronologyFields_values i 3 old] + exact ⟨z, hz, ranked, code⟩ + +end GroundMainPrefix + +section +open SetFormula +universe u v + +theorem relationCompose_enlargeCodomain {A B C D f g : ZFSet.{u}} + (bound : g ⊆ ZFSet.prod B C) (subset : C ⊆ D) : + relationCompose A B D f g = relationCompose A B C f g := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨x, hx, y, hy, w, _, rfl, first, second⟩ := + (mem_relationCompose _ _ _ _ _ z).1 entry + exact (mem_relationCompose _ _ _ _ _ _).2 + ⟨x, hx, y, hy, w, (ZFSet.pair_mem_prod.1 (bound second)).2, rfl, first, second⟩ + · intro entry + obtain ⟨x, hx, y, hy, w, hw, rfl, first, second⟩ := + (mem_relationCompose _ _ _ _ _ z).1 entry + exact (mem_relationCompose _ _ _ _ _ _).2 + ⟨x, hx, y, hy, w, subset hw, rfl, first, second⟩ + +namespace GroundMainPrefix.FixedTopStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {i₀ : I} (data : run.FixedTopStage i₀) + +theorem transition_comp {i j : I} (before : i ≤ j) : + (run.diagram.transition before).map.comp pairing unions powers separation + (data.transition j) = data.transition i := by + apply GroundMainTransition.ext + · change relationCompose _ _ data.stage.carrier _ (run.limitPointMap j) = run.limitPointMap i + rw [data.carrier_eq, relationCompose_enlargeCodomain + (run.limitPointMap_injection j).function.1 (fixedTopCarrier_subset run.limitPoints)] + exact run.limitPointMap_comp before + · change relationCompose _ _ data.stage.actors _ (run.limitActorMap j) = run.limitActorMap i + rw [data.actors_eq] + exact run.limitActorMap_comp before + +end GroundMainPrefix.FixedTopStage + +end + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_limitSerialization + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) + (level : GroundMainCandidateLevel M K) : + ∃ serial : GroundSerializedChronology M (insert run.cutoffLimit run.cutoffLimit) C D rD, + serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ + serial.code ∈ level.validChronologies C D rD ∧ + serial.fields.graph = run.limitChronologyFields.graph ∧ + (∀ j s, serial.fields.value j s = run.limitChronologyFields.value j s) ∧ + serial.layerBound = functionGraphRange + (chronologyPairs (insert run.cutoffLimit run.cutoffLimit)) serial.layers := by + have conditions := standard.to_conditions pairing unions powers separation hK + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + have numbers := standard.omega_mem pairing unions powers separation hK + exact run.limitChronologyFields.exists_rankedSerialization + pairing unions powers separation collection infinite choice hK conditions + (conditions.successor_mem pairing unions powers separation infinite hK + (run.cutoffLimit_mem_inaccessible hK standard indices)) + level (ordinalSetProperty_succ run.cutoffLimit_ordinal) run.limitChronologyCore + (run.limitChronologyFields_graph_rank_lt limit rank) + (run.limitChronology_raw_witnesses (M.transitive hK numbers) limit rank + (ZFSet.rank_lt_of_mem numbers)) + +end GroundMainPrefix + +namespace GroundMainPrefix.FixedTopStage +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {i₀ : I} (data : run.FixedTopStage i₀) + +noncomputable def chronologyValues : Fin 5 → ZFSet.{u} := + Fin.cases data.stage.carrier (Fin.cases data.stage.order + (Fin.cases data.stage.meetGraph + (Fin.cases (fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit) + (fun _ => data.stage.height)))) + +structure RankedChronology (level : GroundMainCandidateLevel M K) where + serial : GroundSerializedChronology M (insert run.cutoffLimit run.cutoffLimit) C D rD + code_ground : serial.code ∈ M.sets + code_rank : ZFSet.rank serial.code < ZFSet.rank K + code_member : serial.code ∈ level.validChronologies C D rD + graphs : ∀ j, serial.fields.graph j = + terminalChronologyGraph run.cutoffLimit (run.limitChronologyFields.graph j) (data.chronologyValues j) + terminal : ∀ j, serial.fields.value j run.cutoffLimit = data.chronologyValues j + old_values : ∀ j s, s ∈ run.cutoffLimit → + serial.fields.value j s = run.limitChronologyFields.value j s + +theorem exists_rankedChronology + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) + (level : GroundMainCandidateLevel M K) : Nonempty (data.RankedChronology level) := by + obtain ⟨prior, _, priorRank, _, priorGraphs, priorValues, _⟩ := + run.exists_limitSerialization collection infinite choice hK standard indices rank level + have terminal (j : Fin 5) : prior.fields.value j run.cutoffLimit = run.limitTerminalFields j := + (priorValues j run.cutoffLimit).trans (run.limitChronologyFields_terminal j) + have newValues : prior.fixedTopValues data.stage.height = data.chronologyValues := by + funext j + refine Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (Fin.cases ?_ (fun _ => rfl)))) j + · change fixedTopCarrier (prior.fields.value 0 run.cutoffLimit) = data.stage.carrier + rw [terminal 0] + exact data.carrier_eq.symm + · change fixedTopOrder (prior.fields.value 0 run.cutoffLimit) + (prior.fields.value 1 run.cutoffLimit) = data.stage.order + rw [terminal 0, terminal 1] + exact data.order_eq.symm + · change fixedTopMeet (prior.fields.value 0 run.cutoffLimit) + (prior.fields.value 1 run.cutoffLimit) = data.stage.meetGraph + rw [terminal 0, terminal 1] + exact data.meet_eq.symm + · change fixedTopBirth (prior.fields.value 0 run.cutoffLimit) + (prior.fields.value 3 run.cutoffLimit) run.cutoffLimit = _ + rw [terminal 0, terminal 3] + rfl + have conditions := standard.to_conditions pairing unions powers separation hK + have earlier : ∀ x t, ZFSet.pair x t ∈ prior.fields.value 3 run.cutoffLimit → t ∈ run.cutoffLimit := by + intro x t entry + rw [terminal 3] at entry + exact (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 entry)).2 + have height : StrictLexHeightCode (fixedTopCarrier (prior.fields.value 0 run.cutoffLimit)) C D + (fixedTopOrder (prior.fields.value 0 run.cutoffLimit) (prior.fields.value 1 run.cutoffLimit)) + data.stage.height rD := by + rw [terminal 0, terminal 1] + change StrictLexHeightCode (fixedTopCarrier run.limitPoints) C D + (fixedTopOrder run.limitPoints run.limitOrder) data.stage.height rD + rw [← data.carrier_eq, ← data.order_eq] + exact data.stage.height_code + obtain ⟨extended, ground, extendedRank, member, graphs, values⟩ := + prior.exists_rankedFixedTopSerialization pairing unions powers separation collection infinite choice + hK conditions (conditions.successor_mem pairing unions powers separation infinite hK + (run.cutoffLimit_mem_inaccessible hK standard indices)) level priorRank + data.stage.height data.stage.height_ground (data.height_rank_lt infinite hK standard rank) + run.cutoffLimit_ordinal earlier height + refine ⟨⟨extended, ground, extendedRank, member, ?_, ?_, ?_⟩⟩ + · intro j + rw [congrFun graphs j] + change terminalChronologyGraph run.cutoffLimit (prior.fields.graph j) + (prior.fixedTopValues data.stage.height j) = _ + rw [priorGraphs, newValues] + · intro j + rw [values j run.cutoffLimit (ZFSet.mem_insert _ _), appendHistoryValue_at, newValues] + · intro j s hs + rw [values j s (ZFSet.mem_insert_of_mem _ hs), appendHistoryValue_old hs, priorValues] + +namespace RankedChronology +variable {data} {level : GroundMainCandidateLevel M K} (chronology : data.RankedChronology level) + +noncomputable def main : GroundChronologicalMainStage M C D rD where + stage := data.stage + cutoff := run.cutoffLimit + cutoff_ground := run.cutoffLimit_ground + cutoff_ordinal := run.cutoffLimit_ordinal + history := chronology.serial.toHistory + carrier_eq := chronology.terminal 0 + order_eq := chronology.terminal 1 + meet_eq := chronology.terminal 2 + height_eq := chronology.terminal 4 + +theorem main_stage : chronology.main.stage = data.stage := rfl + +theorem main_cutoff : chronology.main.cutoff = run.cutoffLimit := rfl + +theorem main_birth : chronology.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit := + chronology.terminal 3 + +theorem agreement (j : Fin 5) (s : ZFSet.{u}) : + chronology.serial.fields.value j s = chronology.main.history.fieldValue j s := by + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j + +theorem history_values (i : I) (j : Fin 5) {s : ZFSet.{u}} + (before : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : + chronology.main.history.fieldValue j s = (run.diagram.stage i).history.fieldValue j s := by + rw [← chronology.agreement, chronology.old_values j s ((run.cutoffLimit_mem s).2 ⟨i, before⟩)] + exact run.limitChronologyFields_values i j before + +end RankedChronology + +end GroundMainPrefix.FixedTopStage + +namespace GroundMainPrefix.FixedTopStage.RankedChronology +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {i₀ : I} {data : run.FixedTopStage i₀} {level : GroundMainCandidateLevel M K} +variable (chronology : data.RankedChronology level) + +noncomputable def transition (i : I) : + GroundChronologicalMainTransition (run.diagram.stage i) chronology.main where + map := data.transition i + cutoff_le := Or.inr (run.cutoff_mem_cutoffLimit i) + birth := by + intro x y t entry + have hy := (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 + rw [chronology.main_birth, fixedTopBirth_old_iff hy] + exact run.limitPointMap_birth_iff i x y t entry + history_prefix := by + intro s before + exact ⟨chronology.history_values i 0 before, chronology.history_values i 1 before, + chronology.history_values i 2 before, chronology.history_values i 3 before, + chronology.history_values i 4 before⟩ + +theorem transition_map (i : I) : (chronology.transition i).map = data.transition i := rfl + +theorem transition_points (i : I) : (chronology.transition i).map.points = run.limitPointMap i := rfl + +theorem transition_actors (i : I) : (chronology.transition i).map.actors = run.limitActorMap i := rfl + +theorem coversOldBirths (i : I) : (chronology.transition i).CoversOldBirths := by + intro y t entry before + rw [chronology.main_birth] at entry + have strict : t ∈ run.cutoffLimit := (run.cutoffLimit_mem t).2 ⟨i, before⟩ + have old := (fixedTopBirth_earlier_iff strict).1 entry + obtain ⟨x, hx, _, image⟩ := (run.limitBirth_old_fiber i y t before).1 old + exact ⟨x, hx, image⟩ + +end GroundMainPrefix.FixedTopStage.RankedChronology + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} + +namespace FixedTopStage.RankedChronology +variable {i₀ : I} {data : run.FixedTopStage i₀} {level : GroundMainCandidateLevel M K} +variable (chronology : data.RankedChronology level) + +theorem invariant (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) : + chronology.main.Invariant K Labels := by + have bounds := data.invariant_inputs infinite choice hK standard indices rank + exact ⟨bounds.1, bounds.2.1, bounds.2.2.1, bounds.2.2.2.1, bounds.2.2.2.2.1, + bounds.2.2.2.2.2.1, bounds.2.2.2.2.2.2.1, bounds.2.2.2.2.2.2.2.1, + bounds.2.2.2.2.2.2.2.2⟩ + +noncomputable def linked (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) (rank : ZFSet.rank run.code < ZFSet.rank K) : + GroundLinkedMainStage M K Labels C D rD := + ⟨chronology.main, chronology.serial, fun j s _ => chronology.agreement j s, + chronology.invariant infinite choice hK standard indices rank, chronology.code_rank⟩ + +noncomputable def cone : run.diagram.Cone chronology.main where + leg := chronology.transition + coherent := by + intro i j before + apply GroundChronologicalMainTransition.ext + change (run.diagram.transition before).map.comp pairing unions powers separation + (data.transition j) = data.transition i + exact data.transition_comp before + +theorem cone_coverage : chronology.cone.append.CoversOldBirths := + chronology.cone.append_coverage run.coverage chronology.coversOldBirths + +end FixedTopStage.RankedChronology + +variable (run) + +theorem exists_rankedAppendLimit (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indices : M.groundEmbeddable run.indices ZFSet.omega) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) : + ∃ data : run.FixedTopStage i₀, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ + target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ + target.serial.code ∈ level.validChronologies C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (∀ i : I, + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ + (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → + ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ + ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by + have below : GroundBelow M run.indices K := + ⟨ZFSet.omega, standard.omega_mem pairing unions powers separation hK, indices⟩ + obtain ⟨data⟩ := run.exists_fixedTopMainStage i₀ collection infinite choice columns_eq indices + obtain ⟨chronology⟩ := data.exists_rankedChronology collection infinite choice hK standard below oldRank level + let target := chronology.linked infinite choice hK standard below oldRank + have conditions := standard.to_conditions pairing unions powers separation hK + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + obtain ⟨row, ground, function, entries, rowRank⟩ := run.exists_limitTransitionRow limit oldRank + have rowEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = (chronology.cone.leg i).map.code := entries + let extended := run.appendCone target chronology.cone ground function rowEntries chronology.cone_coverage + have rank : ZFSet.rank extended.code < ZFSet.rank K := + run.appendCone_code_rank_lt target chronology.cone ground function rowEntries chronology.cone_coverage + limit oldRank (target.code_rank_lt pairing unions powers separation infinite hK conditions) rowRank + refine ⟨data, target, extended, rfl, rfl, chronology.main_birth, chronology.code_member, + run.appendCone_indices target chronology.cone ground function rowEntries chronology.cone_coverage, + extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, + run.appendCone_linked_old target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_linked_top target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_stageGraph target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_stageGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_transitionGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, + ?_, ?_, ?_⟩ + · intro i j before + rfl + · intro i + exact ⟨rfl, rfl⟩ + · intro i x y entry + exact data.point_strict_top i entry + +end GroundMainPrefix + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitPointMap_coverage_iff (x : ZFSet.{u}) : + x ∈ run.limitPoints ↔ ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ + ZFSet.pair y x ∈ run.limitPointMap i := by + constructor + · intro member + obtain ⟨i, y, hy, equal⟩ := run.pointPresentation.limitPoint_coverage member + exact ⟨i, y, hy, (run.pointPresentation.inclusion_entry i y x).2 ⟨hy, equal⟩⟩ + · rintro ⟨i, y, _, entry⟩ + exact (ZFSet.pair_mem_prod.1 ((run.limitPointMap_injection i).function.1 entry)).2 + +theorem limitActorMap_coverage_iff (g : ZFSet.{u}) : + g ∈ run.limitActors ↔ ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ + ZFSet.pair h g ∈ run.limitActorMap i := by + constructor + · intro member + obtain ⟨i, h, hh, equal⟩ := run.actorPresentation.limitPoint_coverage member + exact ⟨i, h, hh, (run.actorPresentation.inclusion_entry i h g).2 ⟨hh, equal⟩⟩ + · rintro ⟨i, h, _, entry⟩ + exact (ZFSet.pair_mem_prod.1 ((run.limitActorMap_injection i).function.1 entry)).2 + +namespace FixedTopStage.RankedChronology +variable {run} {i₀ : I} {data : run.FixedTopStage i₀} {level : GroundMainCandidateLevel M K} +variable (chronology : data.RankedChronology level) + +theorem limitCoverage : run.LimitCoverage chronology.main chronology.cone := by + refine ⟨?_, ?_, ?_, rfl, ?_⟩ + · intro x + change (x ∈ data.stage.carrier ∧ x ≠ data.stage.top) ↔ + ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ ZFSet.pair y x ∈ run.limitPointMap i + rw [data.carrier_eq, data.top_eq, ← run.limitPointMap_coverage_iff] + constructor + · rintro ⟨member, different⟩ + exact ((mem_fixedTopCarrier run.limitPoints x).1 member).resolve_left different + · intro member + exact ⟨fixedTopCarrier_old member, fun equal => ZFSet.mem_irrefl _ (equal ▸ member)⟩ + · intro g + change g ∈ data.stage.actors ↔ + ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ ZFSet.pair h g ∈ run.limitActorMap i + rw [data.actors_eq] + exact run.limitActorMap_coverage_iff g + · intro i x y entry + exact data.point_strict_top i entry + · intro x + rw [chronology.main_birth] + change ZFSet.pair x run.cutoffLimit ∈ fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ↔ + x = data.stage.top + rw [data.top_eq] + exact fixedTopBirth_new_time_iff (fun _ _ entry => + (ZFSet.pair_mem_prod.1 (run.limitBirth_function.1 entry)).2) + +end FixedTopStage.RankedChronology +end GroundMainPrefix + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageGraph.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageGraph.lean index a3fdedfb7db4ca31d3b5f08f3e7cf74cccaf2d8f..132230f7e5ba271f27fdf31c9d8e5448328805be 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageGraph.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitCoverageGraph.lean @@ -1,688 +1,688 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixConePreservation -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixDecoding - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -universe u - -def LinkedCoverageFieldsCode (z P G cutoff : ZFSet.{u}) : Prop := - ∃ r μ m inv one action bottom top height serial, - z = linkedMainStageCode (mainStageCode P r μ G m inv one action bottom top height) cutoff serial - -def MainLimitConeEntryCode (T S row i P G cutoff points actors : ZFSet.{u}) : Prop := - i ∈ T ∧ ∃ z, ZFSet.pair i z ∈ S ∧ LinkedCoverageFieldsCode z P G cutoff ∧ - ZFSet.pair (ZFSet.pair T i) (ZFSet.pair points actors) ∈ row - -def MainLimitOldPointImageCode (T S row x : ZFSet.{u}) : Prop := - ∃ i P G cutoff points actors y, MainLimitConeEntryCode T S row i P G cutoff points actors ∧ - y ∈ P ∧ ZFSet.pair y x ∈ points - -def MainLimitOldActorImageCode (T S row g : ZFSet.{u}) : Prop := - ∃ i P G cutoff points actors h, MainLimitConeEntryCode T S row i P G cutoff points actors ∧ - h ∈ G ∧ ZFSet.pair h g ∈ actors - -def MainLimitOldCutoffCode (T S t : ZFSet.{u}) : Prop := - ∃ i ∈ T, ∃ z, ZFSet.pair i z ∈ S ∧ - ∃ P G cutoff, LinkedCoverageFieldsCode z P G cutoff ∧ (t = cutoff ∨ t ∈ cutoff) - -structure MainLimitCoverageGraphCode (T S row Q H R top cutoff birth : ZFSet.{u}) : Prop where - points : ∀ x, (x ∈ Q ∧ x ≠ top) ↔ MainLimitOldPointImageCode T S row x - actors : ∀ g, g ∈ H ↔ MainLimitOldActorImageCode T S row g - strict_top : ∀ i P G t points actors, MainLimitConeEntryCode T S row i P G t points actors → - ∀ x y, ZFSet.pair x y ∈ points → ZFSet.pair y top ∈ R ∧ ZFSet.pair top y ∉ R - cutoff_mem : ∀ t, t ∈ cutoff ↔ MainLimitOldCutoffCode T S t - top_birth : ∀ x, ZFSet.pair x cutoff ∈ birth ↔ x = top - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (stage : GroundLinkedMainStage M K Labels C D rD) - -theorem coverageFields_iff {P G cutoff : ZFSet.{u}} : - LinkedCoverageFieldsCode stage.code P G cutoff ↔ - P = stage.main.stage.carrier ∧ G = stage.main.stage.actors ∧ cutoff = stage.main.cutoff := by - constructor - · rintro ⟨r, μ, m, inv, one, action, bottom, top, height, serial, equal⟩ - have outer := linkedMainStageCode_inj.1 equal - have fields := mainStageCode_inj.1 outer.1 - exact ⟨fields.1.symm, fields.2.2.2.1.symm, outer.2.1.symm⟩ - · rintro ⟨rfl, rfl, rfl⟩ - exact ⟨stage.main.stage.order, stage.main.stage.meetGraph, stage.main.stage.multiplication, - stage.main.stage.inverse, stage.main.stage.identity, stage.main.stage.action, - stage.main.stage.bottom, stage.main.stage.top, stage.main.stage.height, stage.serial.code, rfl⟩ - -end GroundLinkedMainStage - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -structure LimitCoverage (target : GroundChronologicalMainStage M C D rD) - (cone : run.diagram.Cone target) : Prop where - points : ∀ x, (x ∈ target.stage.carrier ∧ x ≠ target.stage.top) ↔ - ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ ZFSet.pair y x ∈ (cone.leg i).map.points - actors : ∀ g, g ∈ target.stage.actors ↔ - ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ ZFSet.pair h g ∈ (cone.leg i).map.actors - strict_top : ∀ i x y, ZFSet.pair x y ∈ (cone.leg i).map.points → - ZFSet.pair y target.stage.top ∈ target.stage.order ∧ - ZFSet.pair target.stage.top y ∉ target.stage.order - cutoff : target.cutoff = - ⋃₀ ZFSet.range (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) - top_birth : ∀ x, ZFSet.pair x target.cutoff ∈ target.birth ↔ x = target.stage.top - -namespace LimitCoverage -variable {run} {target : GroundChronologicalMainStage M C D rD} -variable {cone : run.diagram.Cone target} (coverage : run.LimitCoverage target cone) -include coverage - -theorem top_absent (i : I) (x : ZFSet.{u}) : - ZFSet.pair x target.stage.top ∉ (cone.leg i).map.points := by - intro entry - have strict := coverage.strict_top i x target.stage.top entry - exact strict.2 strict.1 - -theorem new_point_iff {x : ZFSet.{u}} (member : x ∈ target.stage.carrier) : - (¬ ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ - ZFSet.pair y x ∈ (cone.leg i).map.points) ↔ x = target.stage.top := by - constructor - · intro fresh - by_contra different - exact fresh ((coverage.points x).1 ⟨member, different⟩) - · rintro rfl ⟨i, y, _, entry⟩ - exact coverage.top_absent i y entry - -end LimitCoverage - - - - - -noncomputable def stageFieldUnion (j : Fin 11) : ZFSet.{u} := - ⋃₀ ZFSet.range (fun i => (run.diagram.stage i).stage.field j) - -noncomputable def carrierUnion : ZFSet.{u} := run.stageFieldUnion 0 - -noncomputable def actorUnion : ZFSet.{u} := run.stageFieldUnion 3 - -noncomputable def pointMapUnion : ZFSet.{u} := - ⋃₀ ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.points) - -noncomputable def actorMapUnion : ZFSet.{u} := - ⋃₀ ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.actors) - -theorem stageFieldValues_ground (j : Fin 11) : - ZFSet.range (fun i => (run.diagram.stage i).stage.field j) ∈ M.sets := - M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground - (run.stageFieldFamily_ground j) - -theorem pointMapValues_ground : - ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.points) ∈ M.sets := by - apply M.familyCodeGraph_valueRange_mem unions separation (mainTransitionIndexKey run.key) _ _ - run.pointMapFamily_ground - rw [mainTransitionIndex_range run.key run.key_order] - exact M.chronologyPairs_mem pairing unions powers separation run.indices_ground - -theorem actorMapValues_ground : - ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.actors) ∈ M.sets := by - apply M.familyCodeGraph_valueRange_mem unions separation (mainTransitionIndexKey run.key) _ _ - run.actorMapFamily_ground - rw [mainTransitionIndex_range run.key run.key_order] - exact M.chronologyPairs_mem pairing unions powers separation run.indices_ground - -theorem stageFieldUnion_ground (j : Fin 11) : run.stageFieldUnion j ∈ M.sets := - M.union_mem unions (run.stageFieldValues_ground j) - -theorem carrierUnion_ground : run.carrierUnion ∈ M.sets := run.stageFieldUnion_ground 0 - -theorem actorUnion_ground : run.actorUnion ∈ M.sets := run.stageFieldUnion_ground 3 - -theorem pointMapUnion_ground : run.pointMapUnion ∈ M.sets := M.union_mem unions run.pointMapValues_ground - -theorem actorMapUnion_ground : run.actorMapUnion ∈ M.sets := M.union_mem unions run.actorMapValues_ground - -theorem stageFieldUnion_mem (j : Fin 11) (x : ZFSet.{u}) : - x ∈ run.stageFieldUnion j ↔ ∃ i, x ∈ (run.diagram.stage i).stage.field j := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem pointMapUnion_mem (x : ZFSet.{u}) : - x ∈ run.pointMapUnion ↔ ∃ p : MainTransitionIndex I, x ∈ (run.diagram.transition p.property).map.points := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem actorMapUnion_mem (x : ZFSet.{u}) : - x ∈ run.actorMapUnion ↔ ∃ p : MainTransitionIndex I, x ∈ (run.diagram.transition p.property).map.actors := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem stageFieldFamily_subset_union (j : Fin 11) {i X : ZFSet.{u}} - (entry : ZFSet.pair i X ∈ run.stageFieldFamily j) : X ⊆ run.stageFieldUnion j := - familyCodeGraph_value_subset_union run.key _ entry - -theorem carrierFamily_subset_union {i X : ZFSet.{u}} - (entry : ZFSet.pair i X ∈ run.carrierFamily) : X ⊆ run.carrierUnion := - run.stageFieldFamily_subset_union 0 entry - -theorem actorFamily_subset_union {i X : ZFSet.{u}} - (entry : ZFSet.pair i X ∈ run.actorFamily) : X ⊆ run.actorUnion := - run.stageFieldFamily_subset_union 3 entry - -theorem pointMapFamily_subset_union {i X : ZFSet.{u}} - (entry : ZFSet.pair i X ∈ run.pointMapFamily) : X ⊆ run.pointMapUnion := - familyCodeGraph_value_subset_union (mainTransitionIndexKey run.key) _ entry - -theorem actorMapFamily_subset_union {i X : ZFSet.{u}} - (entry : ZFSet.pair i X ∈ run.actorMapFamily) : X ⊆ run.actorMapUnion := - familyCodeGraph_value_subset_union (mainTransitionIndexKey run.key) _ entry - -theorem stageFieldFamily_rank_le_code (j : Fin 11) : - ZFSet.rank (run.stageFieldFamily j) ≤ ZFSet.rank run.code := by - apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans - run.stageGraph_rank_le_code - intro i - simpa only [run.linked_main] using (run.linked i).field_rank_le_linkedCode j - -theorem carrierFamily_rank_le_code : ZFSet.rank run.carrierFamily ≤ ZFSet.rank run.code := - run.stageFieldFamily_rank_le_code 0 - -theorem actorFamily_rank_le_code : ZFSet.rank run.actorFamily ≤ ZFSet.rank run.code := - run.stageFieldFamily_rank_le_code 3 - -theorem pointMapFamily_rank_le_code : ZFSet.rank run.pointMapFamily ≤ ZFSet.rank run.code := by - apply (familyCodeGraph_rank_mono (mainTransitionIndexKey run.key) _ - (fun p => (run.diagram.transition p.property).map.code) ?_).trans run.transitionGraph_rank_le_code - intro p - exact rank_nonemptyTupleCode_field_le 1 - (Fin.cases (run.diagram.transition p.property).map.points - (fun _ => (run.diagram.transition p.property).map.actors)) 0 - -theorem actorMapFamily_rank_le_code : ZFSet.rank run.actorMapFamily ≤ ZFSet.rank run.code := by - apply (familyCodeGraph_rank_mono (mainTransitionIndexKey run.key) _ - (fun p => (run.diagram.transition p.property).map.code) ?_).trans run.transitionGraph_rank_le_code - intro p - exact rank_nonemptyTupleCode_field_le 1 - (Fin.cases (run.diagram.transition p.property).map.points - (fun _ => (run.diagram.transition p.property).map.actors)) 1 - -theorem stageFieldUnion_rank_le_code (j : Fin 11) : - ZFSet.rank (run.stageFieldUnion j) ≤ ZFSet.rank run.code := - (familyCodeGraph_valueUnion_rank_le run.key _).trans (run.stageFieldFamily_rank_le_code j) - -theorem carrierUnion_rank_le_code : ZFSet.rank run.carrierUnion ≤ ZFSet.rank run.code := - run.stageFieldUnion_rank_le_code 0 - -theorem actorUnion_rank_le_code : ZFSet.rank run.actorUnion ≤ ZFSet.rank run.code := - run.stageFieldUnion_rank_le_code 3 - -theorem pointMapUnion_rank_le_code : ZFSet.rank run.pointMapUnion ≤ ZFSet.rank run.code := - (familyCodeGraph_valueUnion_rank_le (mainTransitionIndexKey run.key) _).trans run.pointMapFamily_rank_le_code - -theorem actorMapUnion_rank_le_code : ZFSet.rank run.actorMapUnion ≤ ZFSet.rank run.code := - (familyCodeGraph_valueUnion_rank_le (mainTransitionIndexKey run.key) _).trans run.actorMapFamily_rank_le_code - - - - - -noncomputable def cutoffFamily : ZFSet.{u} := - familyCodeGraph run.key (fun i => (run.diagram.stage i).cutoff) - -noncomputable def serialFieldFamily (j : Fin 5) : ZFSet.{u} := - familyCodeGraph run.key (fun i => (run.linked i).serial.fields.graph j) - -noncomputable def birthFamily : ZFSet.{u} := - familyCodeGraph run.key (fun i => (run.diagram.stage i).birth) - -theorem cutoffFamily_ground : run.cutoffFamily ∈ M.sets := by - have tails := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).main.stage.code) - (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) - run.key_injective run.indices_ground run.stages_ground).2 - have cutoffs := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).main.cutoff) (fun i => (run.linked i).serial.code) - run.key_injective run.indices_ground tails).1 - simpa only [cutoffFamily, run.linked_main] using cutoffs - -theorem serialFieldFamily_ground (j : Fin 5) : run.serialFieldFamily j ∈ M.sets := by - have tails := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).main.stage.code) - (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) - run.key_injective run.indices_ground run.stages_ground).2 - have serialCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).main.cutoff) (fun i => (run.linked i).serial.code) - run.key_injective run.indices_ground tails).2 - have fieldCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).serial.fields.code) - (fun i => ZFSet.pair (run.linked i).serial.layerBound (run.linked i).serial.layers) - run.key_injective run.indices_ground serialCodes).1 - exact M.familyCodeGraph_tuple_fields pairing unions powers separation run.key run.key_injective - run.indices_ground 6 (fun i => (run.linked i).serial.fields.codeFields) fieldCodes j.succ.succ - -theorem serialBirth_entry (i : I) : - ZFSet.pair (run.diagram.stage i).cutoff (run.diagram.stage i).birth ∈ - (run.linked i).serial.fields.graph 3 := by - have entry := (run.linked i).serial.fields.value_entry 3 (ZFSet.mem_insert _ _) - rw [(run.linked i).terminal_values.2.2.2.1] at entry - simpa only [run.linked_main] using entry - -theorem birthFamily_ground : run.birthFamily ∈ M.sets := by - apply M.familyCodeGraph_evaluation_ground pairing unions powers separation run.key - (fun i => (run.diagram.stage i).cutoff) (fun i => (run.linked i).serial.fields.graph 3) - (fun i => (run.diagram.stage i).birth) run.key_injective run.indices_ground - run.cutoffFamily_ground (run.serialFieldFamily_ground 3) - intro i y - exact ⟨fun entry => ((run.linked i).serial.fields.graphFunction 3).unique entry (run.serialBirth_entry i), - fun equal => equal.symm ▸ run.serialBirth_entry i⟩ - -theorem cutoffFamily_function : FunctionGraphOn run.indices run.cutoffFamily := - familyCodeGraph_function run.key _ run.key_injective - -theorem serialFieldFamily_function (j : Fin 5) : FunctionGraphOn run.indices (run.serialFieldFamily j) := - familyCodeGraph_function run.key _ run.key_injective - -theorem birthFamily_function : FunctionGraphOn run.indices run.birthFamily := - familyCodeGraph_function run.key _ run.key_injective - -theorem cutoffFamily_entry (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.cutoffFamily ↔ z = (run.diagram.stage i).cutoff := - pair_mem_familyCodeGraph run.key _ run.key_injective i z - -theorem serialFieldFamily_entry (j : Fin 5) (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.serialFieldFamily j ↔ z = (run.linked i).serial.fields.graph j := - pair_mem_familyCodeGraph run.key _ run.key_injective i z - -theorem birthFamily_entry (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.birthFamily ↔ z = (run.diagram.stage i).birth := - pair_mem_familyCodeGraph run.key _ run.key_injective i z - - - - - -noncomputable def pointPresentation : CodedDirectPresentation run.pointSystem - run.indices run.carrierUnion run.carrierFamily run.pointMapFamily where - key := run.key - key_injective := run.key_injective - key_range := rfl - key_order := run.key_order - carrier_function := run.carrierFamily_function - carrier_entry i := (run.carrierFamily_entry i _).2 rfl - map_function := run.pointMapFamily_function - map_entry before := (run.pointMapFamily_entry before _).2 rfl - carrier_bound i := run.carrierFamily_subset_union ((run.carrierFamily_entry i _).2 rfl) - -noncomputable def actorPresentation : CodedDirectPresentation run.actorSystem - run.indices run.actorUnion run.actorFamily run.actorMapFamily where - key := run.key - key_injective := run.key_injective - key_range := rfl - key_order := run.key_order - carrier_function := run.actorFamily_function - carrier_entry i := (run.actorFamily_entry i _).2 rfl - map_function := run.actorMapFamily_function - map_entry before := (run.actorMapFamily_entry before _).2 rfl - carrier_bound i := run.actorFamily_subset_union ((run.actorFamily_entry i _).2 rfl) - - - - - -noncomputable def cutoffUnion : ZFSet.{u} := ⋃₀ ZFSet.range (fun i => (run.diagram.stage i).cutoff) - -noncomputable def birthUnion : ZFSet.{u} := ⋃₀ ZFSet.range (fun i => (run.diagram.stage i).birth) - -theorem cutoffValues_ground : ZFSet.range (fun i => (run.diagram.stage i).cutoff) ∈ M.sets := - M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.cutoffFamily_ground - -theorem birthValues_ground : ZFSet.range (fun i => (run.diagram.stage i).birth) ∈ M.sets := - M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.birthFamily_ground - -theorem cutoffUnion_ground : run.cutoffUnion ∈ M.sets := M.union_mem unions run.cutoffValues_ground - -theorem birthUnion_ground : run.birthUnion ∈ M.sets := M.union_mem unions run.birthValues_ground - -theorem cutoffUnion_mem (x : ZFSet.{u}) : - x ∈ run.cutoffUnion ↔ ∃ i, x ∈ (run.diagram.stage i).cutoff := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem birthUnion_mem (x : ZFSet.{u}) : - x ∈ run.birthUnion ↔ ∃ i, x ∈ (run.diagram.stage i).birth := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem cutoffFamily_subset_union {i X : ZFSet.{u}} (entry : ZFSet.pair i X ∈ run.cutoffFamily) : - X ⊆ run.cutoffUnion := familyCodeGraph_value_subset_union run.key _ entry - -theorem birthFamily_subset_union {i X : ZFSet.{u}} (entry : ZFSet.pair i X ∈ run.birthFamily) : - X ⊆ run.birthUnion := familyCodeGraph_value_subset_union run.key _ entry - -theorem cutoffFamily_rank_le_code : ZFSet.rank run.cutoffFamily ≤ ZFSet.rank run.code := by - apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans - run.stageGraph_rank_le_code - intro i - simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_zero, Fin.cases_succ, - run.linked_main] using (rank_nonemptyTupleCode_field_le 2 - (Fin.cases (run.linked i).main.stage.code - (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) (0 : Fin 2).succ) - -theorem serialFieldFamily_rank_le_code (j : Fin 5) : - ZFSet.rank (run.serialFieldFamily j) ≤ ZFSet.rank run.code := by - apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans - run.stageGraph_rank_le_code - intro i - have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by - simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_zero, Fin.cases_succ] using - (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code - (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) (0 : Fin 1).succ.succ) - exact ((run.linked i).serial.fieldGraph_rank_le_code j).trans serialBound - -theorem birthFamily_rank_le_code : ZFSet.rank run.birthFamily ≤ ZFSet.rank run.code := - (familyCodeGraph_evaluation_rank_le run.key (fun i => (run.diagram.stage i).cutoff) - (fun i => (run.linked i).serial.fields.graph 3) (fun i => (run.diagram.stage i).birth) - run.serialBirth_entry).trans (run.serialFieldFamily_rank_le_code 3) - -theorem cutoffValues_rank_le_code : - ZFSet.rank (ZFSet.range (fun i => (run.diagram.stage i).cutoff)) ≤ ZFSet.rank run.code := - (familyCodeGraph_valueRange_rank_le run.key _).trans run.cutoffFamily_rank_le_code - -theorem birthValues_rank_le_code : - ZFSet.rank (ZFSet.range (fun i => (run.diagram.stage i).birth)) ≤ ZFSet.rank run.code := - (familyCodeGraph_valueRange_rank_le run.key _).trans run.birthFamily_rank_le_code - -theorem cutoffUnion_rank_le_code : ZFSet.rank run.cutoffUnion ≤ ZFSet.rank run.code := - (ZFSet.rank_sUnion_le _).trans run.cutoffValues_rank_le_code - -theorem birthUnion_rank_le_code : ZFSet.rank run.birthUnion ≤ ZFSet.rank run.code := - (ZFSet.rank_sUnion_le _).trans run.birthValues_rank_le_code - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def cutoffSuccessorFamily : ZFSet.{u} := - familyCodeGraph run.key (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) - -noncomputable def cutoffLimit : ZFSet.{u} := - ⋃₀ ZFSet.range (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) - -theorem cutoffSuccessorFamily_ground : run.cutoffSuccessorFamily ∈ M.sets := by - have tails := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).main.stage.code) - (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) - run.key_injective run.indices_ground run.stages_ground).2 - have serialCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).main.cutoff) (fun i => (run.linked i).serial.code) - run.key_injective run.indices_ground tails).2 - have fieldCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - (fun i => (run.linked i).serial.fields.code) - (fun i => ZFSet.pair (run.linked i).serial.layerBound (run.linked i).serial.layers) - run.key_injective run.indices_ground serialCodes).1 - have times := M.familyCodeGraph_tuple_fields pairing unions powers separation run.key run.key_injective - run.indices_ground 6 (fun i => (run.linked i).serial.fields.codeFields) fieldCodes 0 - simpa only [cutoffSuccessorFamily, GroundChronologyFields.codeFields, Fin.cases_zero, - run.linked_main] using times - -theorem cutoffSuccessorFamily_function : FunctionGraphOn run.indices run.cutoffSuccessorFamily := - familyCodeGraph_function run.key _ run.key_injective - -theorem cutoffSuccessorFamily_entry (i : I) (z : ZFSet.{u}) : - ZFSet.pair (run.key i) z ∈ run.cutoffSuccessorFamily ↔ - z = insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff := - pair_mem_familyCodeGraph run.key _ run.key_injective i z - -theorem cutoffSuccessorValues_ground : - ZFSet.range (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) ∈ M.sets := - M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.cutoffSuccessorFamily_ground - -theorem cutoffLimit_ground : run.cutoffLimit ∈ M.sets := M.union_mem unions run.cutoffSuccessorValues_ground - -theorem cutoffLimit_mem (t : ZFSet.{u}) : - t ∈ run.cutoffLimit ↔ ∃ i, t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff := by - rw [cutoffLimit, familyCodeGraph_valueUnion_mem_iff] - exact exists_congr (fun i => ZFSet.mem_insert_iff) - -theorem cutoff_mem_cutoffLimit (i : I) : (run.diagram.stage i).cutoff ∈ run.cutoffLimit := - (run.cutoffLimit_mem _).2 ⟨i, Or.inl rfl⟩ - -theorem birth_time_mem_cutoffLimit (i : I) {x t : ZFSet.{u}} - (entry : ZFSet.pair x t ∈ (run.diagram.stage i).birth) : t ∈ run.cutoffLimit := - (run.cutoffLimit_mem t).2 ⟨i, (run.diagram.stage i).birth_bound entry⟩ - -theorem cutoffLimit_ordinal : ordinalSetProperty run.cutoffLimit := by - apply ordinalSetProperty_sUnion - intro a ha - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 ha - exact ordinalSetProperty_succ (run.diagram.stage i).cutoff_ordinal - -theorem cutoffSuccessorFamily_rank_le_code : - ZFSet.rank run.cutoffSuccessorFamily ≤ ZFSet.rank run.code := by - apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans - run.stageGraph_rank_le_code - intro i - have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by - simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_zero, Fin.cases_succ] using - (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code - (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) (0 : Fin 1).succ.succ) - simpa only [run.linked_main] using (run.linked i).serial.time_rank_le_code.trans serialBound - -theorem cutoffLimit_rank_le_code : ZFSet.rank run.cutoffLimit ≤ ZFSet.rank run.code := - (familyCodeGraph_valueUnion_rank_le run.key _).trans run.cutoffSuccessorFamily_rank_le_code - -theorem cutoffLimit_mem_inaccessible (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (indices : GroundBelow M run.indices K) : run.cutoffLimit ∈ K := by - have family : ZFSet.IsFunc run.indices K run.cutoffFamily := by - refine ⟨?_, run.cutoffFamily_function.to_isFunc.2⟩ - intro z hz - obtain ⟨i, rfl⟩ := (mem_familyCodeGraph run.key (fun i => (run.diagram.stage i).cutoff) z).1 hz - have cutoff : (run.diagram.stage i).cutoff ∈ K := by - simpa only [run.linked_main] using (run.linked i).invariant.cutoff_mem - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, cutoff⟩ - obtain ⟨δ, hδ, bounded⟩ := (standard.2.2.1.regular standard.1.1).bound_small_domain - pairing unions powers separation run.indices_ground hK run.cutoffFamily_ground indices family - have ordinalδ := ordinalSetProperty_member standard.1.1 hδ - have subset : run.cutoffLimit ⊆ δ := by - intro t ht - obtain ⟨i, before⟩ := (run.cutoffLimit_mem t).1 ht - have cutoff := bounded (run.key i) (run.diagram.stage i).cutoff ((run.cutoffFamily_entry i _).2 rfl) - rcases before with rfl | before - · exact cutoff - · exact ordinalδ.1 _ cutoff t before - have coded : ordinalCode (ZFSet.rank run.cutoffLimit) ∈ ordinalCode (ZFSet.rank K) := - (mem_ordinalCode_iff _ _).2 ((ZFSet.rank_mono subset).trans_lt (ZFSet.rank_lt_of_mem hδ)) - exact (congrArg₂ (fun a b : ZFSet.{u} => a ∈ b) - (ordinalSetProperty_eq_code_rank run.cutoffLimit run.cutoffLimit_ordinal) - (ordinalSetProperty_eq_code_rank K standard.1.1)).mpr coded - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing -universe u v - -def mainPrefixLimitTargetFields {A : Type v} (w : Fin 32 → A) : Fin 24 → A := - fun j => w (Fin.natAdd 8 j) - -def MainPrefixLimitStepRawCode (M : TransitiveGround.{u}) - (K Labels C D rD N old next : ZFSet.{u}) (w : Fin 32 → ZFSet.{u}) : Prop := - let v := mainPrefixLimitTargetFields w - w 7 = insert (w 0) (w 0) ∧ - old = mainPrefixCode (w 0) (w 1) (w 2) ∧ - next = mainPrefixCode (w 7) (w 3) (w 4) ∧ - MainPrefixExtends old next ∧ - ZFSet.pair (w 0) (w 5) ∈ w 3 ∧ - LinkedMainStageRawCode M K Labels C D rD N (w 5) v ∧ - ZFSet.pair (v 11) (w 6) ∈ v 17 ∧ - MainLimitCoverageGraphCode (w 0) (w 1) (w 4) (v 0) (v 3) (v 1) (v 9) (v 11) (w 6) - -def MainPrefixLimitStepCode (M : TransitiveGround.{u}) - (K Labels C D rD N old next : ZFSet.{u}) : Prop := - ∃ w : Fin 32 → ZFSet.{u}, (∀ j, w j ∈ M.sets) ∧ - MainPrefixLimitStepRawCode M K Labels C D rD N old next w - -namespace MainPrefixLimitStepCode -variable {M : TransitiveGround.{u}} {K Labels C D rD N old next : ZFSet.{u}} -variable (code : MainPrefixLimitStepCode M K Labels C D rD N old next) -include code - -theorem extension : MainPrefixExtends old next := by - obtain ⟨w, _, raw⟩ := code - exact raw.2.2.2.1 - -theorem indices_successor {T S E T' S' E' : ZFSet.{u}} - (oldCode : old = mainPrefixCode T S E) (nextCode : next = mainPrefixCode T' S' E') : - T' = insert T T := by - obtain ⟨w, _, raw⟩ := code - have oldFields := mainPrefixCode_inj.1 (oldCode.symm.trans raw.2.1) - have nextFields := mainPrefixCode_inj.1 (nextCode.symm.trans raw.2.2.1) - rw [nextFields.1, raw.1, ← oldFields.1] - -theorem next_fields {T S E : ZFSet.{u}} (oldCode : old = mainPrefixCode T S E) : - ∃ S' E', next = mainPrefixCode (insert T T) S' E' := by - obtain ⟨w, _, raw⟩ := code - have fields := mainPrefixCode_inj.1 (oldCode.symm.trans raw.2.1) - refine ⟨w 3, w 4, ?_⟩ - rw [raw.2.2.1, raw.1, ← fields.1] - -end MainPrefixLimitStepCode - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (linked : GroundLinkedMainStage M K Labels C D rD) - -theorem rawFields_birth_entry : - ZFSet.pair (linked.rawFields 11) linked.main.birth ∈ linked.rawFields 17 := by - change ZFSet.pair linked.main.cutoff linked.main.birth ∈ linked.serial.fields.graph 3 - rw [← linked.terminal_values.2.2.2.1] - exact linked.serial.fields.value_entry 3 (ZFSet.mem_insert _ _) - -end GroundLinkedMainStage - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable {target : GroundChronologicalMainStage M C D rD} (cone : run.diagram.Cone target) -variable {row : ZFSet.{u}} -variable (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = (cone.leg i).map.code) - -include entries - -theorem limitConeEntry_iff (i : I) {P G cutoff points actors : ZFSet.{u}} : - MainLimitConeEntryCode run.indices run.stageGraph row (run.key i) P G cutoff points actors ↔ - P = (run.diagram.stage i).stage.carrier ∧ G = (run.diagram.stage i).stage.actors ∧ - cutoff = (run.diagram.stage i).cutoff ∧ points = (cone.leg i).map.points ∧ - actors = (cone.leg i).map.actors := by - have fields : LinkedCoverageFieldsCode (run.linked i).code P G cutoff ↔ - P = (run.diagram.stage i).stage.carrier ∧ G = (run.diagram.stage i).stage.actors ∧ - cutoff = (run.diagram.stage i).cutoff := by - rw [(run.linked i).coverageFields_iff, run.linked_main] - constructor - · rintro ⟨_, z, stageEntry, shape, mapEntry⟩ - rw [(run.stageGraph_entry i z).1 stageEntry] at shape - obtain ⟨hp, hg, ht⟩ := fields.1 shape - have maps := ZFSet.pair_inj.1 ((entries i _).1 mapEntry) - exact ⟨hp, hg, ht, maps.1, maps.2⟩ - · rintro ⟨hp, hg, ht, rfl, rfl⟩ - exact ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, (run.linked i).code, - (run.stageGraph_entry i _).2 rfl, fields.2 ⟨hp, hg, ht⟩, (entries i _).2 rfl⟩ - -theorem limitOldPointImage_iff (x : ZFSet.{u}) : - MainLimitOldPointImageCode run.indices run.stageGraph row x ↔ - ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ - ZFSet.pair y x ∈ (cone.leg i).map.points := by - constructor - · rintro ⟨key, P, G, cutoff, points, actors, y, entry, hy, image⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 entry.1 - obtain ⟨rfl, _, _, rfl, _⟩ := (run.limitConeEntry_iff cone entries i).1 entry - exact ⟨i, y, hy, image⟩ - · rintro ⟨i, y, hy, image⟩ - exact ⟨run.key i, _, _, _, _, _, y, - (run.limitConeEntry_iff cone entries i).2 ⟨rfl, rfl, rfl, rfl, rfl⟩, hy, image⟩ - -theorem limitOldActorImage_iff (g : ZFSet.{u}) : - MainLimitOldActorImageCode run.indices run.stageGraph row g ↔ - ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ - ZFSet.pair h g ∈ (cone.leg i).map.actors := by - constructor - · rintro ⟨key, P, G, cutoff, points, actors, h, entry, hh, image⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 entry.1 - obtain ⟨_, rfl, _, _, rfl⟩ := (run.limitConeEntry_iff cone entries i).1 entry - exact ⟨i, h, hh, image⟩ - · rintro ⟨i, h, hh, image⟩ - exact ⟨run.key i, _, _, _, _, _, h, - (run.limitConeEntry_iff cone entries i).2 ⟨rfl, rfl, rfl, rfl, rfl⟩, hh, image⟩ - -omit entries in -theorem limitOldCutoff_iff (t : ZFSet.{u}) : - MainLimitOldCutoffCode run.indices run.stageGraph t ↔ t ∈ run.cutoffLimit := by - rw [run.cutoffLimit_mem] - constructor - · rintro ⟨key, member, z, entry, P, G, cutoff, shape, bound⟩ - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 member - rw [(run.stageGraph_entry i z).1 entry, (run.linked i).coverageFields_iff, - run.linked_main] at shape - exact ⟨i, shape.2.2 ▸ bound⟩ - · rintro ⟨i, bound⟩ - refine ⟨run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, (run.linked i).code, - (run.stageGraph_entry i _).2 rfl, (run.diagram.stage i).stage.carrier, - (run.diagram.stage i).stage.actors, (run.diagram.stage i).cutoff, ?_, bound⟩ - rw [(run.linked i).coverageFields_iff, run.linked_main] - exact ⟨rfl, rfl, rfl⟩ - -theorem limitCoverage_graph_iff : - MainLimitCoverageGraphCode run.indices run.stageGraph row target.stage.carrier - target.stage.actors target.stage.order target.stage.top target.cutoff target.birth ↔ - run.LimitCoverage target cone := by - constructor - · intro raw - refine ⟨fun x => (raw.points x).trans (run.limitOldPointImage_iff cone entries x), - fun g => (raw.actors g).trans (run.limitOldActorImage_iff cone entries g), ?_, ?_, raw.top_birth⟩ - · intro i x y entry - exact raw.strict_top _ _ _ _ _ _ - ((run.limitConeEntry_iff cone entries i).2 ⟨rfl, rfl, rfl, rfl, rfl⟩) x y entry - · exact ZFSet.ext (fun t => (raw.cutoff_mem t).trans (run.limitOldCutoff_iff t)) - · intro coverage - refine ⟨fun x => (coverage.points x).trans (run.limitOldPointImage_iff cone entries x).symm, - fun g => (coverage.actors g).trans (run.limitOldActorImage_iff cone entries g).symm, - ?_, ?_, coverage.top_birth⟩ - · intro key P G t points actors entry x y image - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 entry.1 - obtain ⟨_, _, _, rfl, _⟩ := (run.limitConeEntry_iff cone entries i).1 entry - exact coverage.strict_top i x y image - · intro t - rw [coverage.cutoff] - exact (run.limitOldCutoff_iff t).symm - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixConePreservation +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixDecoding + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +universe u + +def LinkedCoverageFieldsCode (z P G cutoff : ZFSet.{u}) : Prop := + ∃ r μ m inv one action bottom top height serial, + z = linkedMainStageCode (mainStageCode P r μ G m inv one action bottom top height) cutoff serial + +def MainLimitConeEntryCode (T S row i P G cutoff points actors : ZFSet.{u}) : Prop := + i ∈ T ∧ ∃ z, ZFSet.pair i z ∈ S ∧ LinkedCoverageFieldsCode z P G cutoff ∧ + ZFSet.pair (ZFSet.pair T i) (ZFSet.pair points actors) ∈ row + +def MainLimitOldPointImageCode (T S row x : ZFSet.{u}) : Prop := + ∃ i P G cutoff points actors y, MainLimitConeEntryCode T S row i P G cutoff points actors ∧ + y ∈ P ∧ ZFSet.pair y x ∈ points + +def MainLimitOldActorImageCode (T S row g : ZFSet.{u}) : Prop := + ∃ i P G cutoff points actors h, MainLimitConeEntryCode T S row i P G cutoff points actors ∧ + h ∈ G ∧ ZFSet.pair h g ∈ actors + +def MainLimitOldCutoffCode (T S t : ZFSet.{u}) : Prop := + ∃ i ∈ T, ∃ z, ZFSet.pair i z ∈ S ∧ + ∃ P G cutoff, LinkedCoverageFieldsCode z P G cutoff ∧ (t = cutoff ∨ t ∈ cutoff) + +structure MainLimitCoverageGraphCode (T S row Q H R top cutoff birth : ZFSet.{u}) : Prop where + points : ∀ x, (x ∈ Q ∧ x ≠ top) ↔ MainLimitOldPointImageCode T S row x + actors : ∀ g, g ∈ H ↔ MainLimitOldActorImageCode T S row g + strict_top : ∀ i P G t points actors, MainLimitConeEntryCode T S row i P G t points actors → + ∀ x y, ZFSet.pair x y ∈ points → ZFSet.pair y top ∈ R ∧ ZFSet.pair top y ∉ R + cutoff_mem : ∀ t, t ∈ cutoff ↔ MainLimitOldCutoffCode T S t + top_birth : ∀ x, ZFSet.pair x cutoff ∈ birth ↔ x = top + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (stage : GroundLinkedMainStage M K Labels C D rD) + +theorem coverageFields_iff {P G cutoff : ZFSet.{u}} : + LinkedCoverageFieldsCode stage.code P G cutoff ↔ + P = stage.main.stage.carrier ∧ G = stage.main.stage.actors ∧ cutoff = stage.main.cutoff := by + constructor + · rintro ⟨r, μ, m, inv, one, action, bottom, top, height, serial, equal⟩ + have outer := linkedMainStageCode_inj.1 equal + have fields := mainStageCode_inj.1 outer.1 + exact ⟨fields.1.symm, fields.2.2.2.1.symm, outer.2.1.symm⟩ + · rintro ⟨rfl, rfl, rfl⟩ + exact ⟨stage.main.stage.order, stage.main.stage.meetGraph, stage.main.stage.multiplication, + stage.main.stage.inverse, stage.main.stage.identity, stage.main.stage.action, + stage.main.stage.bottom, stage.main.stage.top, stage.main.stage.height, stage.serial.code, rfl⟩ + +end GroundLinkedMainStage + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +structure LimitCoverage (target : GroundChronologicalMainStage M C D rD) + (cone : run.diagram.Cone target) : Prop where + points : ∀ x, (x ∈ target.stage.carrier ∧ x ≠ target.stage.top) ↔ + ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ ZFSet.pair y x ∈ (cone.leg i).map.points + actors : ∀ g, g ∈ target.stage.actors ↔ + ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ ZFSet.pair h g ∈ (cone.leg i).map.actors + strict_top : ∀ i x y, ZFSet.pair x y ∈ (cone.leg i).map.points → + ZFSet.pair y target.stage.top ∈ target.stage.order ∧ + ZFSet.pair target.stage.top y ∉ target.stage.order + cutoff : target.cutoff = + ⋃₀ ZFSet.range (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) + top_birth : ∀ x, ZFSet.pair x target.cutoff ∈ target.birth ↔ x = target.stage.top + +namespace LimitCoverage +variable {run} {target : GroundChronologicalMainStage M C D rD} +variable {cone : run.diagram.Cone target} (coverage : run.LimitCoverage target cone) +include coverage + +theorem top_absent (i : I) (x : ZFSet.{u}) : + ZFSet.pair x target.stage.top ∉ (cone.leg i).map.points := by + intro entry + have strict := coverage.strict_top i x target.stage.top entry + exact strict.2 strict.1 + +theorem new_point_iff {x : ZFSet.{u}} (member : x ∈ target.stage.carrier) : + (¬ ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ + ZFSet.pair y x ∈ (cone.leg i).map.points) ↔ x = target.stage.top := by + constructor + · intro fresh + by_contra different + exact fresh ((coverage.points x).1 ⟨member, different⟩) + · rintro rfl ⟨i, y, _, entry⟩ + exact coverage.top_absent i y entry + +end LimitCoverage + + + + + +noncomputable def stageFieldUnion (j : Fin 11) : ZFSet.{u} := + ⋃₀ ZFSet.range (fun i => (run.diagram.stage i).stage.field j) + +noncomputable def carrierUnion : ZFSet.{u} := run.stageFieldUnion 0 + +noncomputable def actorUnion : ZFSet.{u} := run.stageFieldUnion 3 + +noncomputable def pointMapUnion : ZFSet.{u} := + ⋃₀ ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.points) + +noncomputable def actorMapUnion : ZFSet.{u} := + ⋃₀ ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.actors) + +theorem stageFieldValues_ground (j : Fin 11) : + ZFSet.range (fun i => (run.diagram.stage i).stage.field j) ∈ M.sets := + M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground + (run.stageFieldFamily_ground j) + +theorem pointMapValues_ground : + ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.points) ∈ M.sets := by + apply M.familyCodeGraph_valueRange_mem unions separation (mainTransitionIndexKey run.key) _ _ + run.pointMapFamily_ground + rw [mainTransitionIndex_range run.key run.key_order] + exact M.chronologyPairs_mem pairing unions powers separation run.indices_ground + +theorem actorMapValues_ground : + ZFSet.range (fun p : MainTransitionIndex I => (run.diagram.transition p.property).map.actors) ∈ M.sets := by + apply M.familyCodeGraph_valueRange_mem unions separation (mainTransitionIndexKey run.key) _ _ + run.actorMapFamily_ground + rw [mainTransitionIndex_range run.key run.key_order] + exact M.chronologyPairs_mem pairing unions powers separation run.indices_ground + +theorem stageFieldUnion_ground (j : Fin 11) : run.stageFieldUnion j ∈ M.sets := + M.union_mem unions (run.stageFieldValues_ground j) + +theorem carrierUnion_ground : run.carrierUnion ∈ M.sets := run.stageFieldUnion_ground 0 + +theorem actorUnion_ground : run.actorUnion ∈ M.sets := run.stageFieldUnion_ground 3 + +theorem pointMapUnion_ground : run.pointMapUnion ∈ M.sets := M.union_mem unions run.pointMapValues_ground + +theorem actorMapUnion_ground : run.actorMapUnion ∈ M.sets := M.union_mem unions run.actorMapValues_ground + +theorem stageFieldUnion_mem (j : Fin 11) (x : ZFSet.{u}) : + x ∈ run.stageFieldUnion j ↔ ∃ i, x ∈ (run.diagram.stage i).stage.field j := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem pointMapUnion_mem (x : ZFSet.{u}) : + x ∈ run.pointMapUnion ↔ ∃ p : MainTransitionIndex I, x ∈ (run.diagram.transition p.property).map.points := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem actorMapUnion_mem (x : ZFSet.{u}) : + x ∈ run.actorMapUnion ↔ ∃ p : MainTransitionIndex I, x ∈ (run.diagram.transition p.property).map.actors := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem stageFieldFamily_subset_union (j : Fin 11) {i X : ZFSet.{u}} + (entry : ZFSet.pair i X ∈ run.stageFieldFamily j) : X ⊆ run.stageFieldUnion j := + familyCodeGraph_value_subset_union run.key _ entry + +theorem carrierFamily_subset_union {i X : ZFSet.{u}} + (entry : ZFSet.pair i X ∈ run.carrierFamily) : X ⊆ run.carrierUnion := + run.stageFieldFamily_subset_union 0 entry + +theorem actorFamily_subset_union {i X : ZFSet.{u}} + (entry : ZFSet.pair i X ∈ run.actorFamily) : X ⊆ run.actorUnion := + run.stageFieldFamily_subset_union 3 entry + +theorem pointMapFamily_subset_union {i X : ZFSet.{u}} + (entry : ZFSet.pair i X ∈ run.pointMapFamily) : X ⊆ run.pointMapUnion := + familyCodeGraph_value_subset_union (mainTransitionIndexKey run.key) _ entry + +theorem actorMapFamily_subset_union {i X : ZFSet.{u}} + (entry : ZFSet.pair i X ∈ run.actorMapFamily) : X ⊆ run.actorMapUnion := + familyCodeGraph_value_subset_union (mainTransitionIndexKey run.key) _ entry + +theorem stageFieldFamily_rank_le_code (j : Fin 11) : + ZFSet.rank (run.stageFieldFamily j) ≤ ZFSet.rank run.code := by + apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans + run.stageGraph_rank_le_code + intro i + simpa only [run.linked_main] using (run.linked i).field_rank_le_linkedCode j + +theorem carrierFamily_rank_le_code : ZFSet.rank run.carrierFamily ≤ ZFSet.rank run.code := + run.stageFieldFamily_rank_le_code 0 + +theorem actorFamily_rank_le_code : ZFSet.rank run.actorFamily ≤ ZFSet.rank run.code := + run.stageFieldFamily_rank_le_code 3 + +theorem pointMapFamily_rank_le_code : ZFSet.rank run.pointMapFamily ≤ ZFSet.rank run.code := by + apply (familyCodeGraph_rank_mono (mainTransitionIndexKey run.key) _ + (fun p => (run.diagram.transition p.property).map.code) ?_).trans run.transitionGraph_rank_le_code + intro p + exact rank_nonemptyTupleCode_field_le 1 + (Fin.cases (run.diagram.transition p.property).map.points + (fun _ => (run.diagram.transition p.property).map.actors)) 0 + +theorem actorMapFamily_rank_le_code : ZFSet.rank run.actorMapFamily ≤ ZFSet.rank run.code := by + apply (familyCodeGraph_rank_mono (mainTransitionIndexKey run.key) _ + (fun p => (run.diagram.transition p.property).map.code) ?_).trans run.transitionGraph_rank_le_code + intro p + exact rank_nonemptyTupleCode_field_le 1 + (Fin.cases (run.diagram.transition p.property).map.points + (fun _ => (run.diagram.transition p.property).map.actors)) 1 + +theorem stageFieldUnion_rank_le_code (j : Fin 11) : + ZFSet.rank (run.stageFieldUnion j) ≤ ZFSet.rank run.code := + (familyCodeGraph_valueUnion_rank_le run.key _).trans (run.stageFieldFamily_rank_le_code j) + +theorem carrierUnion_rank_le_code : ZFSet.rank run.carrierUnion ≤ ZFSet.rank run.code := + run.stageFieldUnion_rank_le_code 0 + +theorem actorUnion_rank_le_code : ZFSet.rank run.actorUnion ≤ ZFSet.rank run.code := + run.stageFieldUnion_rank_le_code 3 + +theorem pointMapUnion_rank_le_code : ZFSet.rank run.pointMapUnion ≤ ZFSet.rank run.code := + (familyCodeGraph_valueUnion_rank_le (mainTransitionIndexKey run.key) _).trans run.pointMapFamily_rank_le_code + +theorem actorMapUnion_rank_le_code : ZFSet.rank run.actorMapUnion ≤ ZFSet.rank run.code := + (familyCodeGraph_valueUnion_rank_le (mainTransitionIndexKey run.key) _).trans run.actorMapFamily_rank_le_code + + + + + +noncomputable def cutoffFamily : ZFSet.{u} := + familyCodeGraph run.key (fun i => (run.diagram.stage i).cutoff) + +noncomputable def serialFieldFamily (j : Fin 5) : ZFSet.{u} := + familyCodeGraph run.key (fun i => (run.linked i).serial.fields.graph j) + +noncomputable def birthFamily : ZFSet.{u} := + familyCodeGraph run.key (fun i => (run.diagram.stage i).birth) + +theorem cutoffFamily_ground : run.cutoffFamily ∈ M.sets := by + have tails := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).main.stage.code) + (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) + run.key_injective run.indices_ground run.stages_ground).2 + have cutoffs := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).main.cutoff) (fun i => (run.linked i).serial.code) + run.key_injective run.indices_ground tails).1 + simpa only [cutoffFamily, run.linked_main] using cutoffs + +theorem serialFieldFamily_ground (j : Fin 5) : run.serialFieldFamily j ∈ M.sets := by + have tails := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).main.stage.code) + (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) + run.key_injective run.indices_ground run.stages_ground).2 + have serialCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).main.cutoff) (fun i => (run.linked i).serial.code) + run.key_injective run.indices_ground tails).2 + have fieldCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).serial.fields.code) + (fun i => ZFSet.pair (run.linked i).serial.layerBound (run.linked i).serial.layers) + run.key_injective run.indices_ground serialCodes).1 + exact M.familyCodeGraph_tuple_fields pairing unions powers separation run.key run.key_injective + run.indices_ground 6 (fun i => (run.linked i).serial.fields.codeFields) fieldCodes j.succ.succ + +theorem serialBirth_entry (i : I) : + ZFSet.pair (run.diagram.stage i).cutoff (run.diagram.stage i).birth ∈ + (run.linked i).serial.fields.graph 3 := by + have entry := (run.linked i).serial.fields.value_entry 3 (ZFSet.mem_insert _ _) + rw [(run.linked i).terminal_values.2.2.2.1] at entry + simpa only [run.linked_main] using entry + +theorem birthFamily_ground : run.birthFamily ∈ M.sets := by + apply M.familyCodeGraph_evaluation_ground pairing unions powers separation run.key + (fun i => (run.diagram.stage i).cutoff) (fun i => (run.linked i).serial.fields.graph 3) + (fun i => (run.diagram.stage i).birth) run.key_injective run.indices_ground + run.cutoffFamily_ground (run.serialFieldFamily_ground 3) + intro i y + exact ⟨fun entry => ((run.linked i).serial.fields.graphFunction 3).unique entry (run.serialBirth_entry i), + fun equal => equal.symm ▸ run.serialBirth_entry i⟩ + +theorem cutoffFamily_function : FunctionGraphOn run.indices run.cutoffFamily := + familyCodeGraph_function run.key _ run.key_injective + +theorem serialFieldFamily_function (j : Fin 5) : FunctionGraphOn run.indices (run.serialFieldFamily j) := + familyCodeGraph_function run.key _ run.key_injective + +theorem birthFamily_function : FunctionGraphOn run.indices run.birthFamily := + familyCodeGraph_function run.key _ run.key_injective + +theorem cutoffFamily_entry (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.cutoffFamily ↔ z = (run.diagram.stage i).cutoff := + pair_mem_familyCodeGraph run.key _ run.key_injective i z + +theorem serialFieldFamily_entry (j : Fin 5) (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.serialFieldFamily j ↔ z = (run.linked i).serial.fields.graph j := + pair_mem_familyCodeGraph run.key _ run.key_injective i z + +theorem birthFamily_entry (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.birthFamily ↔ z = (run.diagram.stage i).birth := + pair_mem_familyCodeGraph run.key _ run.key_injective i z + + + + + +noncomputable def pointPresentation : CodedDirectPresentation run.pointSystem + run.indices run.carrierUnion run.carrierFamily run.pointMapFamily where + key := run.key + key_injective := run.key_injective + key_range := rfl + key_order := run.key_order + carrier_function := run.carrierFamily_function + carrier_entry i := (run.carrierFamily_entry i _).2 rfl + map_function := run.pointMapFamily_function + map_entry before := (run.pointMapFamily_entry before _).2 rfl + carrier_bound i := run.carrierFamily_subset_union ((run.carrierFamily_entry i _).2 rfl) + +noncomputable def actorPresentation : CodedDirectPresentation run.actorSystem + run.indices run.actorUnion run.actorFamily run.actorMapFamily where + key := run.key + key_injective := run.key_injective + key_range := rfl + key_order := run.key_order + carrier_function := run.actorFamily_function + carrier_entry i := (run.actorFamily_entry i _).2 rfl + map_function := run.actorMapFamily_function + map_entry before := (run.actorMapFamily_entry before _).2 rfl + carrier_bound i := run.actorFamily_subset_union ((run.actorFamily_entry i _).2 rfl) + + + + + +noncomputable def cutoffUnion : ZFSet.{u} := ⋃₀ ZFSet.range (fun i => (run.diagram.stage i).cutoff) + +noncomputable def birthUnion : ZFSet.{u} := ⋃₀ ZFSet.range (fun i => (run.diagram.stage i).birth) + +theorem cutoffValues_ground : ZFSet.range (fun i => (run.diagram.stage i).cutoff) ∈ M.sets := + M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.cutoffFamily_ground + +theorem birthValues_ground : ZFSet.range (fun i => (run.diagram.stage i).birth) ∈ M.sets := + M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.birthFamily_ground + +theorem cutoffUnion_ground : run.cutoffUnion ∈ M.sets := M.union_mem unions run.cutoffValues_ground + +theorem birthUnion_ground : run.birthUnion ∈ M.sets := M.union_mem unions run.birthValues_ground + +theorem cutoffUnion_mem (x : ZFSet.{u}) : + x ∈ run.cutoffUnion ↔ ∃ i, x ∈ (run.diagram.stage i).cutoff := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem birthUnion_mem (x : ZFSet.{u}) : + x ∈ run.birthUnion ↔ ∃ i, x ∈ (run.diagram.stage i).birth := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem cutoffFamily_subset_union {i X : ZFSet.{u}} (entry : ZFSet.pair i X ∈ run.cutoffFamily) : + X ⊆ run.cutoffUnion := familyCodeGraph_value_subset_union run.key _ entry + +theorem birthFamily_subset_union {i X : ZFSet.{u}} (entry : ZFSet.pair i X ∈ run.birthFamily) : + X ⊆ run.birthUnion := familyCodeGraph_value_subset_union run.key _ entry + +theorem cutoffFamily_rank_le_code : ZFSet.rank run.cutoffFamily ≤ ZFSet.rank run.code := by + apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans + run.stageGraph_rank_le_code + intro i + simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_zero, Fin.cases_succ, + run.linked_main] using (rank_nonemptyTupleCode_field_le 2 + (Fin.cases (run.linked i).main.stage.code + (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) (0 : Fin 2).succ) + +theorem serialFieldFamily_rank_le_code (j : Fin 5) : + ZFSet.rank (run.serialFieldFamily j) ≤ ZFSet.rank run.code := by + apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans + run.stageGraph_rank_le_code + intro i + have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by + simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_zero, Fin.cases_succ] using + (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code + (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) (0 : Fin 1).succ.succ) + exact ((run.linked i).serial.fieldGraph_rank_le_code j).trans serialBound + +theorem birthFamily_rank_le_code : ZFSet.rank run.birthFamily ≤ ZFSet.rank run.code := + (familyCodeGraph_evaluation_rank_le run.key (fun i => (run.diagram.stage i).cutoff) + (fun i => (run.linked i).serial.fields.graph 3) (fun i => (run.diagram.stage i).birth) + run.serialBirth_entry).trans (run.serialFieldFamily_rank_le_code 3) + +theorem cutoffValues_rank_le_code : + ZFSet.rank (ZFSet.range (fun i => (run.diagram.stage i).cutoff)) ≤ ZFSet.rank run.code := + (familyCodeGraph_valueRange_rank_le run.key _).trans run.cutoffFamily_rank_le_code + +theorem birthValues_rank_le_code : + ZFSet.rank (ZFSet.range (fun i => (run.diagram.stage i).birth)) ≤ ZFSet.rank run.code := + (familyCodeGraph_valueRange_rank_le run.key _).trans run.birthFamily_rank_le_code + +theorem cutoffUnion_rank_le_code : ZFSet.rank run.cutoffUnion ≤ ZFSet.rank run.code := + (ZFSet.rank_sUnion_le _).trans run.cutoffValues_rank_le_code + +theorem birthUnion_rank_le_code : ZFSet.rank run.birthUnion ≤ ZFSet.rank run.code := + (ZFSet.rank_sUnion_le _).trans run.birthValues_rank_le_code + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def cutoffSuccessorFamily : ZFSet.{u} := + familyCodeGraph run.key (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) + +noncomputable def cutoffLimit : ZFSet.{u} := + ⋃₀ ZFSet.range (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) + +theorem cutoffSuccessorFamily_ground : run.cutoffSuccessorFamily ∈ M.sets := by + have tails := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).main.stage.code) + (fun i => ZFSet.pair (run.linked i).main.cutoff (run.linked i).serial.code) + run.key_injective run.indices_ground run.stages_ground).2 + have serialCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).main.cutoff) (fun i => (run.linked i).serial.code) + run.key_injective run.indices_ground tails).2 + have fieldCodes := (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + (fun i => (run.linked i).serial.fields.code) + (fun i => ZFSet.pair (run.linked i).serial.layerBound (run.linked i).serial.layers) + run.key_injective run.indices_ground serialCodes).1 + have times := M.familyCodeGraph_tuple_fields pairing unions powers separation run.key run.key_injective + run.indices_ground 6 (fun i => (run.linked i).serial.fields.codeFields) fieldCodes 0 + simpa only [cutoffSuccessorFamily, GroundChronologyFields.codeFields, Fin.cases_zero, + run.linked_main] using times + +theorem cutoffSuccessorFamily_function : FunctionGraphOn run.indices run.cutoffSuccessorFamily := + familyCodeGraph_function run.key _ run.key_injective + +theorem cutoffSuccessorFamily_entry (i : I) (z : ZFSet.{u}) : + ZFSet.pair (run.key i) z ∈ run.cutoffSuccessorFamily ↔ + z = insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff := + pair_mem_familyCodeGraph run.key _ run.key_injective i z + +theorem cutoffSuccessorValues_ground : + ZFSet.range (fun i => insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) ∈ M.sets := + M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.cutoffSuccessorFamily_ground + +theorem cutoffLimit_ground : run.cutoffLimit ∈ M.sets := M.union_mem unions run.cutoffSuccessorValues_ground + +theorem cutoffLimit_mem (t : ZFSet.{u}) : + t ∈ run.cutoffLimit ↔ ∃ i, t = (run.diagram.stage i).cutoff ∨ t ∈ (run.diagram.stage i).cutoff := by + rw [cutoffLimit, familyCodeGraph_valueUnion_mem_iff] + exact exists_congr (fun i => ZFSet.mem_insert_iff) + +theorem cutoff_mem_cutoffLimit (i : I) : (run.diagram.stage i).cutoff ∈ run.cutoffLimit := + (run.cutoffLimit_mem _).2 ⟨i, Or.inl rfl⟩ + +theorem birth_time_mem_cutoffLimit (i : I) {x t : ZFSet.{u}} + (entry : ZFSet.pair x t ∈ (run.diagram.stage i).birth) : t ∈ run.cutoffLimit := + (run.cutoffLimit_mem t).2 ⟨i, (run.diagram.stage i).birth_bound entry⟩ + +theorem cutoffLimit_ordinal : ordinalSetProperty run.cutoffLimit := by + apply ordinalSetProperty_sUnion + intro a ha + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 ha + exact ordinalSetProperty_succ (run.diagram.stage i).cutoff_ordinal + +theorem cutoffSuccessorFamily_rank_le_code : + ZFSet.rank run.cutoffSuccessorFamily ≤ ZFSet.rank run.code := by + apply (familyCodeGraph_rank_mono run.key _ (fun i => (run.linked i).code) ?_).trans + run.stageGraph_rank_le_code + intro i + have serialBound : ZFSet.rank (run.linked i).serial.code ≤ ZFSet.rank (run.linked i).code := by + simpa only [GroundLinkedMainStage.code, linkedMainStageCode, Fin.cases_zero, Fin.cases_succ] using + (rank_nonemptyTupleCode_field_le 2 (Fin.cases (run.linked i).main.stage.code + (Fin.cases (run.linked i).main.cutoff (fun _ => (run.linked i).serial.code))) (0 : Fin 1).succ.succ) + simpa only [run.linked_main] using (run.linked i).serial.time_rank_le_code.trans serialBound + +theorem cutoffLimit_rank_le_code : ZFSet.rank run.cutoffLimit ≤ ZFSet.rank run.code := + (familyCodeGraph_valueUnion_rank_le run.key _).trans run.cutoffSuccessorFamily_rank_le_code + +theorem cutoffLimit_mem_inaccessible (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (indices : GroundBelow M run.indices K) : run.cutoffLimit ∈ K := by + have family : ZFSet.IsFunc run.indices K run.cutoffFamily := by + refine ⟨?_, run.cutoffFamily_function.to_isFunc.2⟩ + intro z hz + obtain ⟨i, rfl⟩ := (mem_familyCodeGraph run.key (fun i => (run.diagram.stage i).cutoff) z).1 hz + have cutoff : (run.diagram.stage i).cutoff ∈ K := by + simpa only [run.linked_main] using (run.linked i).invariant.cutoff_mem + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, cutoff⟩ + obtain ⟨δ, hδ, bounded⟩ := (standard.2.2.1.regular standard.1.1).bound_small_domain + pairing unions powers separation run.indices_ground hK run.cutoffFamily_ground indices family + have ordinalδ := ordinalSetProperty_member standard.1.1 hδ + have subset : run.cutoffLimit ⊆ δ := by + intro t ht + obtain ⟨i, before⟩ := (run.cutoffLimit_mem t).1 ht + have cutoff := bounded (run.key i) (run.diagram.stage i).cutoff ((run.cutoffFamily_entry i _).2 rfl) + rcases before with rfl | before + · exact cutoff + · exact ordinalδ.1 _ cutoff t before + have coded : ordinalCode (ZFSet.rank run.cutoffLimit) ∈ ordinalCode (ZFSet.rank K) := + (mem_ordinalCode_iff _ _).2 ((ZFSet.rank_mono subset).trans_lt (ZFSet.rank_lt_of_mem hδ)) + exact (congrArg₂ (fun a b : ZFSet.{u} => a ∈ b) + (ordinalSetProperty_eq_code_rank run.cutoffLimit run.cutoffLimit_ordinal) + (ordinalSetProperty_eq_code_rank K standard.1.1)).mpr coded + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing +universe u v + +def mainPrefixLimitTargetFields {A : Type v} (w : Fin 32 → A) : Fin 24 → A := + fun j => w (Fin.natAdd 8 j) + +def MainPrefixLimitStepRawCode (M : TransitiveGround.{u}) + (K Labels C D rD N old next : ZFSet.{u}) (w : Fin 32 → ZFSet.{u}) : Prop := + let v := mainPrefixLimitTargetFields w + w 7 = insert (w 0) (w 0) ∧ + old = mainPrefixCode (w 0) (w 1) (w 2) ∧ + next = mainPrefixCode (w 7) (w 3) (w 4) ∧ + MainPrefixExtends old next ∧ + ZFSet.pair (w 0) (w 5) ∈ w 3 ∧ + LinkedMainStageRawCode M K Labels C D rD N (w 5) v ∧ + ZFSet.pair (v 11) (w 6) ∈ v 17 ∧ + MainLimitCoverageGraphCode (w 0) (w 1) (w 4) (v 0) (v 3) (v 1) (v 9) (v 11) (w 6) + +def MainPrefixLimitStepCode (M : TransitiveGround.{u}) + (K Labels C D rD N old next : ZFSet.{u}) : Prop := + ∃ w : Fin 32 → ZFSet.{u}, (∀ j, w j ∈ M.sets) ∧ + MainPrefixLimitStepRawCode M K Labels C D rD N old next w + +namespace MainPrefixLimitStepCode +variable {M : TransitiveGround.{u}} {K Labels C D rD N old next : ZFSet.{u}} +variable (code : MainPrefixLimitStepCode M K Labels C D rD N old next) +include code + +theorem extension : MainPrefixExtends old next := by + obtain ⟨w, _, raw⟩ := code + exact raw.2.2.2.1 + +theorem indices_successor {T S E T' S' E' : ZFSet.{u}} + (oldCode : old = mainPrefixCode T S E) (nextCode : next = mainPrefixCode T' S' E') : + T' = insert T T := by + obtain ⟨w, _, raw⟩ := code + have oldFields := mainPrefixCode_inj.1 (oldCode.symm.trans raw.2.1) + have nextFields := mainPrefixCode_inj.1 (nextCode.symm.trans raw.2.2.1) + rw [nextFields.1, raw.1, ← oldFields.1] + +theorem next_fields {T S E : ZFSet.{u}} (oldCode : old = mainPrefixCode T S E) : + ∃ S' E', next = mainPrefixCode (insert T T) S' E' := by + obtain ⟨w, _, raw⟩ := code + have fields := mainPrefixCode_inj.1 (oldCode.symm.trans raw.2.1) + refine ⟨w 3, w 4, ?_⟩ + rw [raw.2.2.1, raw.1, ← fields.1] + +end MainPrefixLimitStepCode + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (linked : GroundLinkedMainStage M K Labels C D rD) + +theorem rawFields_birth_entry : + ZFSet.pair (linked.rawFields 11) linked.main.birth ∈ linked.rawFields 17 := by + change ZFSet.pair linked.main.cutoff linked.main.birth ∈ linked.serial.fields.graph 3 + rw [← linked.terminal_values.2.2.2.1] + exact linked.serial.fields.value_entry 3 (ZFSet.mem_insert _ _) + +end GroundLinkedMainStage + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable {target : GroundChronologicalMainStage M C D rD} (cone : run.diagram.Cone target) +variable {row : ZFSet.{u}} +variable (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = (cone.leg i).map.code) + +include entries + +theorem limitConeEntry_iff (i : I) {P G cutoff points actors : ZFSet.{u}} : + MainLimitConeEntryCode run.indices run.stageGraph row (run.key i) P G cutoff points actors ↔ + P = (run.diagram.stage i).stage.carrier ∧ G = (run.diagram.stage i).stage.actors ∧ + cutoff = (run.diagram.stage i).cutoff ∧ points = (cone.leg i).map.points ∧ + actors = (cone.leg i).map.actors := by + have fields : LinkedCoverageFieldsCode (run.linked i).code P G cutoff ↔ + P = (run.diagram.stage i).stage.carrier ∧ G = (run.diagram.stage i).stage.actors ∧ + cutoff = (run.diagram.stage i).cutoff := by + rw [(run.linked i).coverageFields_iff, run.linked_main] + constructor + · rintro ⟨_, z, stageEntry, shape, mapEntry⟩ + rw [(run.stageGraph_entry i z).1 stageEntry] at shape + obtain ⟨hp, hg, ht⟩ := fields.1 shape + have maps := ZFSet.pair_inj.1 ((entries i _).1 mapEntry) + exact ⟨hp, hg, ht, maps.1, maps.2⟩ + · rintro ⟨hp, hg, ht, rfl, rfl⟩ + exact ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, (run.linked i).code, + (run.stageGraph_entry i _).2 rfl, fields.2 ⟨hp, hg, ht⟩, (entries i _).2 rfl⟩ + +theorem limitOldPointImage_iff (x : ZFSet.{u}) : + MainLimitOldPointImageCode run.indices run.stageGraph row x ↔ + ∃ i y, y ∈ (run.diagram.stage i).stage.carrier ∧ + ZFSet.pair y x ∈ (cone.leg i).map.points := by + constructor + · rintro ⟨key, P, G, cutoff, points, actors, y, entry, hy, image⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 entry.1 + obtain ⟨rfl, _, _, rfl, _⟩ := (run.limitConeEntry_iff cone entries i).1 entry + exact ⟨i, y, hy, image⟩ + · rintro ⟨i, y, hy, image⟩ + exact ⟨run.key i, _, _, _, _, _, y, + (run.limitConeEntry_iff cone entries i).2 ⟨rfl, rfl, rfl, rfl, rfl⟩, hy, image⟩ + +theorem limitOldActorImage_iff (g : ZFSet.{u}) : + MainLimitOldActorImageCode run.indices run.stageGraph row g ↔ + ∃ i h, h ∈ (run.diagram.stage i).stage.actors ∧ + ZFSet.pair h g ∈ (cone.leg i).map.actors := by + constructor + · rintro ⟨key, P, G, cutoff, points, actors, h, entry, hh, image⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 entry.1 + obtain ⟨_, rfl, _, _, rfl⟩ := (run.limitConeEntry_iff cone entries i).1 entry + exact ⟨i, h, hh, image⟩ + · rintro ⟨i, h, hh, image⟩ + exact ⟨run.key i, _, _, _, _, _, h, + (run.limitConeEntry_iff cone entries i).2 ⟨rfl, rfl, rfl, rfl, rfl⟩, hh, image⟩ + +omit entries in +theorem limitOldCutoff_iff (t : ZFSet.{u}) : + MainLimitOldCutoffCode run.indices run.stageGraph t ↔ t ∈ run.cutoffLimit := by + rw [run.cutoffLimit_mem] + constructor + · rintro ⟨key, member, z, entry, P, G, cutoff, shape, bound⟩ + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 member + rw [(run.stageGraph_entry i z).1 entry, (run.linked i).coverageFields_iff, + run.linked_main] at shape + exact ⟨i, shape.2.2 ▸ bound⟩ + · rintro ⟨i, bound⟩ + refine ⟨run.key i, ZFSet.mem_range.2 ⟨i, rfl⟩, (run.linked i).code, + (run.stageGraph_entry i _).2 rfl, (run.diagram.stage i).stage.carrier, + (run.diagram.stage i).stage.actors, (run.diagram.stage i).cutoff, ?_, bound⟩ + rw [(run.linked i).coverageFields_iff, run.linked_main] + exact ⟨rfl, rfl, rfl⟩ + +theorem limitCoverage_graph_iff : + MainLimitCoverageGraphCode run.indices run.stageGraph row target.stage.carrier + target.stage.actors target.stage.order target.stage.top target.cutoff target.birth ↔ + run.LimitCoverage target cone := by + constructor + · intro raw + refine ⟨fun x => (raw.points x).trans (run.limitOldPointImage_iff cone entries x), + fun g => (raw.actors g).trans (run.limitOldActorImage_iff cone entries g), ?_, ?_, raw.top_birth⟩ + · intro i x y entry + exact raw.strict_top _ _ _ _ _ _ + ((run.limitConeEntry_iff cone entries i).2 ⟨rfl, rfl, rfl, rfl, rfl⟩) x y entry + · exact ZFSet.ext (fun t => (raw.cutoff_mem t).trans (run.limitOldCutoff_iff t)) + · intro coverage + refine ⟨fun x => (coverage.points x).trans (run.limitOldPointImage_iff cone entries x).symm, + fun g => (coverage.actors g).trans (run.limitOldActorImage_iff cone entries g).symm, + ?_, ?_, coverage.top_birth⟩ + · intro key P G t points actors entry x y image + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 entry.1 + obtain ⟨_, _, _, rfl, _⟩ := (run.limitConeEntry_iff cone entries i).1 entry + exact coverage.strict_top i x y image + · intro t + rw [coverage.cutoff] + exact (run.limitOldCutoff_iff t).symm + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitGroupLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitGroupLaws.lean index 1f34c2cfded74d4a22b37c34c0373162e8838ded..c13260f405150effff582841d667a29f1b25d204 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitGroupLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitGroupLaws.lean @@ -1,783 +1,783 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedValueLifts -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing -universe u - -noncomputable def directLimitRelation (T U F L : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ T, ∃ x ∈ U, ∃ j ∈ T, ∃ y ∈ U, - ∃ k ∈ T, ∃ w ∈ U, ∃ f ∈ ⋃₀ ⋃₀ F, ∃ g ∈ ⋃₀ ⋃₀ F, - z = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ - ZFSet.pair (ZFSet.pair k i) f ∈ F ∧ ZFSet.pair (ZFSet.pair k j) g ∈ F ∧ - ZFSet.pair x w ∈ f ∧ ZFSet.pair y w ∈ g) (ZFSet.prod L L) - -theorem directLimitRelation_subset (T U F L : ZFSet.{u}) : - directLimitRelation T U F L ⊆ ZFSet.prod L L := fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem pair_mem_directLimitRelation (T U F L i x j y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∈ directLimitRelation T U F L ↔ - ZFSet.pair i x ∈ L ∧ ZFSet.pair j y ∈ L ∧ - i ∈ T ∧ x ∈ U ∧ j ∈ T ∧ y ∈ U ∧ - ∃ k ∈ T, ∃ w ∈ U, ∃ f g, - ZFSet.pair (ZFSet.pair k i) f ∈ F ∧ ZFSet.pair (ZFSet.pair k j) g ∈ F ∧ - ZFSet.pair x w ∈ f ∧ ZFSet.pair y w ∈ g := by - rw [directLimitRelation, ZFSet.mem_sep] - constructor - · rintro ⟨shape, a, ha, b, hb, c, hc, d, hd, k, hk, w, hw, f, _, g, _, equal, first, second, left, right⟩ - obtain ⟨ab, cd⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 cd - exact ⟨(ZFSet.pair_mem_prod.1 shape).1, (ZFSet.pair_mem_prod.1 shape).2, - ha, hb, hc, hd, k, hk, w, hw, f, g, first, second, left, right⟩ - · rintro ⟨leftLabel, rightLabel, hi, hx, hj, hy, k, hk, w, hw, f, g, first, second, left, right⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨leftLabel, rightLabel⟩, - i, hi, x, hx, j, hj, y, hy, k, hk, w, hw, - f, pair_second_mem_doubleUnion first, g, pair_second_mem_doubleUnion second, - rfl, first, second, left, right⟩ - -namespace BoundedFormula -open SetFormula - -def directLimitRelationEntryFormula : BoundedFormula 5 := - exMem 1 (exMem 3 (exMem 3 (exMem 5 (exMem 5 (exMem 7 (exMem 9 (exMem 10 - (.conj (pairOfPairsFormula 8 7 6 5 4) - (.conj (tripleMembershipFormula 3 7 1 12) - (.conj (tripleMembershipFormula 3 5 0 12) - (.conj (pairMembershipFormula 6 2 1) (pairMembershipFormula 4 2 0)))))))))))) - -theorem truth_directLimitRelationEntryFormula (env : Fin 5 → ZFSet.{u}) : - Truth directLimitRelationEntryFormula env ↔ - ∃ i ∈ env 1, ∃ x ∈ env 2, ∃ j ∈ env 1, ∃ y ∈ env 2, - ∃ k ∈ env 1, ∃ w ∈ env 2, ∃ f ∈ env 3, ∃ g ∈ env 3, - env 0 = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ - ZFSet.pair (ZFSet.pair k i) f ∈ env 4 ∧ ZFSet.pair (ZFSet.pair k j) g ∈ env 4 ∧ - ZFSet.pair x w ∈ f ∧ ZFSet.pair y w ∈ g := by - simp only [directLimitRelationEntryFormula, truth_exMem, Truth, - truth_pairOfPairsFormula, truth_tripleMembershipFormula, truth_pairMembershipFormula] - rfl - -end BoundedFormula - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem directLimitRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {T U F L : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) - (hF : F ∈ M.sets) (hL : L ∈ M.sets) : directLimitRelation T U F L ∈ M.sets := by - have hB := M.union_mem unions (M.union_mem unions hF) - let params := extend T (extend U (extend (⋃₀ ⋃₀ F) (extend F Fin.elim0))) - have selected := M.bounded_separation_mem separation BoundedFormula.directLimitRelationEntryFormula - params (Fin.cases hT (Fin.cases hU (Fin.cases hB (Fin.cases hF (fun i => Fin.elim0 i))))) - (M.prod_mem pairing unions powers separation hL hL) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.directLimitRelationEntryFormula - (extend z params)) (ZFSet.prod L L) = directLimitRelation T U F L := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, directLimitRelation, ZFSet.mem_sep, - BoundedFormula.truth_directLimitRelationEntryFormula] - rfl - exact equal ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.CodedDirectPresentation -universe u v -variable {I : Type v} [Small.{u} I] [Preorder I] {system : CodedDirectSystem.{u} I} -variable {T U A F : ZFSet.{u}} (p : CodedDirectPresentation system T U A F) - -theorem relation_iff (i : I) (x : ZFSet.{u}) (j : I) (y : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (p.key i) x) (ZFSet.pair (p.key j) y) ∈ - directLimitRelation T U F (indexedCarrierLabels T U A) ↔ system.Related i x j y := by - rw [pair_mem_directLimitRelation] - constructor - · rintro ⟨_, _, _, _, _, _, k, hk, w, _, f, g, first, second, left, right⟩ - obtain ⟨k, rfl⟩ := p.exists_key hk - obtain ⟨before, rfl⟩ := p.map_lookup first - obtain ⟨after, rfl⟩ := p.map_lookup second - exact ⟨k, before, after, w, left, right⟩ - · rintro ⟨k, first, second, w, left, right⟩ - have leftBounds := system.map_entry_bounds first left - have rightBounds := system.map_entry_bounds second right - exact ⟨(p.label_mem i x).2 leftBounds.1, (p.label_mem j y).2 rightBounds.1, - p.key_mem i, p.carrier_bound i leftBounds.1, p.key_mem j, p.carrier_bound j rightBounds.1, - p.key k, p.key_mem k, w, p.carrier_bound k leftBounds.2, - system.map first, system.map second, p.map_entry first, p.map_entry second, left, right⟩ - -include p in -theorem relation_equivalence : EquivalenceRelationCode (indexedCarrierLabels T U A) - (directLimitRelation T U F (indexedCarrierLabels T U A)) := by - refine ⟨directLimitRelation_subset _ _ _ _, ?_, ?_, ?_⟩ - · intro x hx - obtain ⟨i, x, member, rfl⟩ := p.label_cases hx - exact (p.relation_iff i x i x).2 (system.related_refl member) - · intro x y related - obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (directLimitRelation_subset _ _ _ _ related) - obtain ⟨i, x, _, rfl⟩ := p.label_cases hx - obtain ⟨j, y, _, rfl⟩ := p.label_cases hy - exact (p.relation_iff j y i x).2 (system.related_symm ((p.relation_iff i x j y).1 related)) - · intro x y z first second - obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (directLimitRelation_subset _ _ _ _ first) - have hz := (ZFSet.pair_mem_prod.1 (directLimitRelation_subset _ _ _ _ second)).2 - obtain ⟨i, x, _, rfl⟩ := p.label_cases hx - obtain ⟨j, y, _, rfl⟩ := p.label_cases hy - obtain ⟨k, z, _, rfl⟩ := p.label_cases hz - exact (p.relation_iff i x k z).2 - (system.related_trans ((p.relation_iff i x j y).1 first) ((p.relation_iff j y k z).1 second)) - -end PartitionPilot.Forcing.CodedDirectPresentation - -namespace PartitionPilot.Forcing -universe u v - -noncomputable def directLimitCarrier (T U A F : ZFSet.{u}) : ZFSet.{u} := - equivalenceClasses (indexedCarrierLabels T U A) - (directLimitRelation T U F (indexedCarrierLabels T U A)) - -noncomputable def directLimitInclusion (T U A F k : ZFSet.{u}) : ZFSet.{u} := - indexedClassInclusion U (indexedCarrierLabels T U A) - (directLimitRelation T U F (indexedCarrierLabels T U A)) k - -namespace CodedDirectPresentation -variable {I : Type v} [Small.{u} I] [Preorder I] {system : CodedDirectSystem.{u} I} -variable {T U A F : ZFSet.{u}} (p : CodedDirectPresentation system T U A F) - -noncomputable def limitPoint (i : I) (x : ZFSet.{u}) : ZFSet.{u} := - equivalenceClass (indexedCarrierLabels T U A) - (directLimitRelation T U F (indexedCarrierLabels T U A)) (ZFSet.pair (p.key i) x) - -theorem limitPoint_mem {i : I} {x : ZFSet.{u}} (member : x ∈ system.carrier i) : - p.limitPoint i x ∈ directLimitCarrier T U A F := - equivalenceClass_mem ((p.label_mem i x).2 member) - -theorem limitPoint_eq_iff_related {i j : I} {x y : ZFSet.{u}} - (hx : x ∈ system.carrier i) (hy : y ∈ system.carrier j) : - p.limitPoint i x = p.limitPoint j y ↔ system.Related i x j y := - (p.relation_equivalence.class_eq_iff ((p.label_mem i x).2 hx) ((p.label_mem j y).2 hy)).trans - (p.relation_iff i x j y) - -theorem limitPoint_same_iff {i : I} {x y : ZFSet.{u}} - (hx : x ∈ system.carrier i) (hy : y ∈ system.carrier i) : - p.limitPoint i x = p.limitPoint i y ↔ x = y := - (p.limitPoint_eq_iff_related hx hy).trans (system.related_same_iff_eq hx) - -theorem limitPoint_transition {i j : I} (before : i ≤ j) {x y : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ system.map before) : - p.limitPoint i x = p.limitPoint j y := - (p.limitPoint_eq_iff_related (system.map_entry_bounds before entry).1 - (system.map_entry_bounds before entry).2).2 (system.related_of_entry before entry) - -theorem limitPoint_later_iff {i j : I} (before : i ≤ j) {x y : ZFSet.{u}} - (hx : x ∈ system.carrier i) (hy : y ∈ system.carrier j) : - p.limitPoint i x = p.limitPoint j y ↔ ZFSet.pair x y ∈ system.map before := - (p.limitPoint_eq_iff_related hx hy).trans (system.related_iff_entry before) - -theorem inclusion_entry (i : I) (x y : ZFSet.{u}) : - ZFSet.pair x y ∈ directLimitInclusion T U A F (p.key i) ↔ - x ∈ system.carrier i ∧ y = p.limitPoint i x := - pair_mem_indexedClassInclusion_of_entry p.carrier_function (p.carrier_entry i) (p.carrier_bound i) - -theorem inclusion_injection (i : I) : - InjectionCode (system.carrier i) (directLimitCarrier T U A F) - (directLimitInclusion T U A F (p.key i)) := by - refine ⟨indexedClassInclusion_function p.carrier_function (p.carrier_entry i) (p.carrier_bound i), ?_⟩ - intro x y z first second - obtain ⟨hx, left⟩ := (p.inclusion_entry i x z).1 first - obtain ⟨hy, right⟩ := (p.inclusion_entry i y z).1 second - exact (p.limitPoint_same_iff hx hy).1 (left.symm.trans right) - -theorem inclusion_comp {i j : I} (before : i ≤ j) : - relationCompose (system.carrier i) (system.carrier j) (directLimitCarrier T U A F) - (system.map before) (directLimitInclusion T U A F (p.key j)) = - directLimitInclusion T U A F (p.key i) := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨x, hx, y, _, w, _, rfl, xy, yw⟩ := (mem_relationCompose _ _ _ _ _ z).1 entry - obtain ⟨_, equal⟩ := (p.inclusion_entry j y w).1 yw - exact (p.inclusion_entry i x w).2 ⟨hx, equal.trans (p.limitPoint_transition before xy).symm⟩ - · intro entry - obtain ⟨x, _, w, _, rfl⟩ := ZFSet.mem_prod.1 ((p.inclusion_injection i).function.1 entry) - obtain ⟨hx, rfl⟩ := (p.inclusion_entry i x w).1 entry - obtain ⟨y, xy⟩ := system.map_entry_total before hx - have hy := (system.map_entry_bounds before xy).2 - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨hx, p.limitPoint_mem hx, y, hy, xy, - (p.inclusion_entry j y (p.limitPoint i x)).2 ⟨hy, p.limitPoint_transition before xy⟩⟩ - -end CodedDirectPresentation - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -theorem indexedCarrierLabels_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {T U : ZFSet.{u}} (A : ZFSet.{u}) - (indices : ZFSet.rank T < o) (points : ZFSet.rank U < o) : - ZFSet.rank (indexedCarrierLabels T U A) < o := - (ZFSet.rank_mono (indexedCarrierLabels_subset T U A)).trans_lt - (rank_product_lt limit indices points) - -theorem directLimitRelation_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (T U F : ZFSet.{u}) {L : ZFSet.{u}} (labels : ZFSet.rank L < o) : - ZFSet.rank (directLimitRelation T U F L) < o := - (ZFSet.rank_mono (directLimitRelation_subset T U F L)).trans_lt - (rank_product_lt limit labels labels) - -theorem equivalenceClasses_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {L : ZFSet.{u}} (E : ZFSet.{u}) (labels : ZFSet.rank L < o) : - ZFSet.rank (equivalenceClasses L E) < o := by - have bound := ZFSet.rank_mono - (show equivalenceClasses L E ⊆ ZFSet.powerset L from fun _ hz => (ZFSet.mem_sep.1 hz).1) - rw [ZFSet.rank_powerset] at bound - exact bound.trans_lt (limit.succ_lt labels) - -theorem equivalenceClassifier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {L : ZFSet.{u}} (E : ZFSet.{u}) (labels : ZFSet.rank L < o) : - ZFSet.rank (equivalenceClassifier L E) < o := - (ZFSet.rank_mono - (show equivalenceClassifier L E ⊆ ZFSet.prod L (equivalenceClasses L E) - from fun _ hz => (ZFSet.mem_sep.1 hz).1)).trans_lt - (rank_product_lt limit labels (equivalenceClasses_rank_lt limit E labels)) - -theorem indexedClassInclusion_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {U L : ZFSet.{u}} (E i : ZFSet.{u}) - (points : ZFSet.rank U < o) (labels : ZFSet.rank L < o) : - ZFSet.rank (indexedClassInclusion U L E i) < o := - (ZFSet.rank_mono (indexedRelationSection_subset U (equivalenceClasses L E) - (equivalenceClassifier L E) i)).trans_lt - (rank_product_lt limit points (equivalenceClasses_rank_lt limit E labels)) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem indexedClassInclusions_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - {T U L : ZFSet.{u}} (E : ZFSet.{u}) (indices : ZFSet.rank T < o) - (points : ZFSet.rank U < o) (labels : ZFSet.rank L < o) : - ZFSet.rank (M.indexedClassInclusions T U L E) < o := - (ZFSet.rank_mono - (show M.indexedClassInclusions T U L E ⊆ - ZFSet.prod T (M.groundRelations U (equivalenceClasses L E)) - from fun _ hz => by - unfold indexedClassInclusions indexedRelationSections at hz - exact (ZFSet.mem_sep.1 hz).1)).trans_lt - (rank_product_lt limit indices - (M.groundRelations_rank_lt limit points (equivalenceClasses_rank_lt limit E labels))) - -end TransitiveGround - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.CodedDirectPresentation -universe u v -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {system : CodedDirectSystem.{u} I} {T U A F : ZFSet.{u}} -variable (p : CodedDirectPresentation system T U A F) - -theorem limitPoint_coverage {z : ZFSet.{u}} (member : z ∈ directLimitCarrier T U A F) : - ∃ i x, x ∈ system.carrier i ∧ z = p.limitPoint i x := by - obtain ⟨label, labelMember, rfl⟩ := (mem_equivalenceClasses _ _ z).1 member - obtain ⟨i, x, hx, rfl⟩ := p.label_cases labelMember - exact ⟨i, x, hx, rfl⟩ - -theorem mixed_pair_coverage {other : CodedDirectSystem.{u} I} {T' U' A' F' : ZFSet.{u}} - (q : CodedDirectPresentation other T' U' A' F') {z w : ZFSet.{u}} - (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T' U' A' F') : - ∃ k x y, x ∈ system.carrier k ∧ y ∈ other.carrier k ∧ - z = p.limitPoint k x ∧ w = q.limitPoint k y := by - obtain ⟨i, x, hx, rfl⟩ := p.limitPoint_coverage hz - obtain ⟨j, y, hy, rfl⟩ := q.limitPoint_coverage hw - obtain ⟨k, ik, jk⟩ := system.common_upper i j - obtain ⟨x', xx'⟩ := system.map_entry_total ik hx - obtain ⟨y', yy'⟩ := other.map_entry_total jk hy - exact ⟨k, x', y', (system.map_entry_bounds ik xx').2, (other.map_entry_bounds jk yy').2, - p.limitPoint_transition ik xx', q.limitPoint_transition jk yy'⟩ - -theorem mixed_triple_coverage {other third : CodedDirectSystem.{u} I} - {T' U' A' F' T'' U'' A'' F'' : ZFSet.{u}} - (q : CodedDirectPresentation other T' U' A' F') - (r : CodedDirectPresentation third T'' U'' A'' F'') {z w v : ZFSet.{u}} - (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T' U' A' F') - (hv : v ∈ directLimitCarrier T'' U'' A'' F'') : - ∃ k x y a, x ∈ system.carrier k ∧ y ∈ other.carrier k ∧ a ∈ third.carrier k ∧ - z = p.limitPoint k x ∧ w = q.limitPoint k y ∧ v = r.limitPoint k a := by - obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := p.mixed_pair_coverage q hz hw - obtain ⟨j, a, ha, rfl⟩ := r.limitPoint_coverage hv - obtain ⟨k, ik, jk⟩ := system.common_upper i j - obtain ⟨x', xx'⟩ := system.map_entry_total ik hx - obtain ⟨y', yy'⟩ := other.map_entry_total ik hy - obtain ⟨a', aa'⟩ := third.map_entry_total jk ha - exact ⟨k, x', y', a', (system.map_entry_bounds ik xx').2, (other.map_entry_bounds ik yy').2, - (third.map_entry_bounds jk aa').2, p.limitPoint_transition ik xx', - q.limitPoint_transition ik yy', r.limitPoint_transition jk aa'⟩ - -theorem pair_coverage {z w : ZFSet.{u}} - (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T U A F) : - ∃ k x y, x ∈ system.carrier k ∧ y ∈ system.carrier k ∧ - z = p.limitPoint k x ∧ w = p.limitPoint k y := - p.mixed_pair_coverage p hz hw - -theorem triple_coverage {z w v : ZFSet.{u}} - (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T U A F) - (hv : v ∈ directLimitCarrier T U A F) : - ∃ k x y a, x ∈ system.carrier k ∧ y ∈ system.carrier k ∧ a ∈ system.carrier k ∧ - z = p.limitPoint k x ∧ w = p.limitPoint k y ∧ v = p.limitPoint k a := - p.mixed_triple_coverage p p hz hw hv - -end PartitionPilot.Forcing.CodedDirectPresentation - -namespace PartitionPilot.Forcing.CodedDirectPresentation -universe u v -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {system : CodedDirectSystem.{u} I} {T U A F Q : ZFSet.{u}} -variable (p : CodedDirectPresentation system T U A F) (cone : system.InjectiveCone Q) - -noncomputable def coneMap : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i x y, x ∈ system.carrier i ∧ - z = ZFSet.pair (p.limitPoint i x) y ∧ ZFSet.pair x y ∈ cone.map i) - (ZFSet.prod (directLimitCarrier T U A F) Q) - -theorem coneMap_subset : p.coneMap cone ⊆ ZFSet.prod (directLimitCarrier T U A F) Q := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem coneMap_entry (q y : ZFSet.{u}) : - ZFSet.pair q y ∈ p.coneMap cone ↔ - ∃ i x, x ∈ system.carrier i ∧ q = p.limitPoint i x ∧ ZFSet.pair x y ∈ cone.map i := by - rw [coneMap, ZFSet.mem_sep] - constructor - · rintro ⟨_, i, x, y', hx, equal, entry⟩ - obtain ⟨eq, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨i, x, hx, eq, entry⟩ - · rintro ⟨i, x, hx, rfl, entry⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨p.limitPoint_mem hx, (cone.entry_bounds entry).2⟩, - i, x, y, hx, rfl, entry⟩ - -theorem coneMap_at (i : I) {x : ZFSet.{u}} (hx : x ∈ system.carrier i) (y : ZFSet.{u}) : - ZFSet.pair (p.limitPoint i x) y ∈ p.coneMap cone ↔ ZFSet.pair x y ∈ cone.map i := by - rw [p.coneMap_entry cone] - constructor - · rintro ⟨j, z, hz, equal, zy⟩ - obtain ⟨v, xv⟩ := cone.entry_total hx - have same := (cone.entry_eq_iff_related xv zy).2 ((p.limitPoint_eq_iff_related hx hz).1 equal) - exact same ▸ xv - · exact fun entry => ⟨i, x, hx, rfl, entry⟩ - -theorem coneMap_function : ZFSet.IsFunc (directLimitCarrier T U A F) Q (p.coneMap cone) := by - refine ⟨p.coneMap_subset cone, ?_⟩ - intro q hq - obtain ⟨i, x, hx, rfl⟩ := p.limitPoint_coverage hq - obtain ⟨y, xy⟩ := cone.entry_total hx - refine ⟨y, (p.coneMap_at cone i hx y).2 xy, ?_⟩ - intro z entry - exact (show FunctionGraphOn (system.carrier i) (cone.map i) from - ⟨Q, (cone.injection i).function⟩).unique ((p.coneMap_at cone i hx z).1 entry) xy - -theorem coneMap_injection : InjectionCode (directLimitCarrier T U A F) Q (p.coneMap cone) := by - refine ⟨p.coneMap_function cone, ?_⟩ - intro q r y first second - obtain ⟨i, x, hx, rfl, xy⟩ := (p.coneMap_entry cone q y).1 first - obtain ⟨j, z, hz, rfl, zy⟩ := (p.coneMap_entry cone r y).1 second - exact (p.limitPoint_eq_iff_related hx hz).2 ((cone.entry_eq_iff_related xy zy).1 rfl) - -theorem coneMap_triangle (i : I) : - relationCompose (system.carrier i) (directLimitCarrier T U A F) Q - (directLimitInclusion T U A F (p.key i)) (p.coneMap cone) = cone.map i := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨x, _, q, _, y, _, rfl, inclusion, image⟩ := (mem_relationCompose _ _ _ _ _ z).1 entry - obtain ⟨hx, rfl⟩ := (p.inclusion_entry i x q).1 inclusion - exact (p.coneMap_at cone i hx y).1 image - · intro entry - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((cone.injection i).function.1 entry) - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hx, hy, p.limitPoint i x, - p.limitPoint_mem hx, (p.inclusion_entry i x _).2 ⟨hx, rfl⟩, - (p.coneMap_at cone i hx y).2 entry⟩ - -theorem coneMap_range (y : ZFSet.{u}) : - (∃ q ∈ directLimitCarrier T U A F, ZFSet.pair q y ∈ p.coneMap cone) ↔ - ∃ i x, x ∈ system.carrier i ∧ ZFSet.pair x y ∈ cone.map i := by - constructor - · rintro ⟨q, _, entry⟩ - obtain ⟨i, x, hx, _, xy⟩ := (p.coneMap_entry cone q y).1 entry - exact ⟨i, x, hx, xy⟩ - · rintro ⟨i, x, hx, xy⟩ - exact ⟨p.limitPoint i x, p.limitPoint_mem hx, (p.coneMap_at cone i hx y).2 xy⟩ - -theorem coneMap_onto {B : ZFSet.{u}} (coverage : cone.Covers B) : - ∀ y ∈ B, ∃ q ∈ directLimitCarrier T U A F, ZFSet.pair q y ∈ p.coneMap cone := - fun y hy => (p.coneMap_range cone y).2 (coverage y hy) - -theorem coneMap_unique {g : ZFSet.{u}} - (function : ZFSet.IsFunc (directLimitCarrier T U A F) Q g) - (triangles : ∀ i, relationCompose (system.carrier i) (directLimitCarrier T U A F) Q - (directLimitInclusion T U A F (p.key i)) g = cone.map i) : g = p.coneMap cone := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨q, hq, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 entry) - obtain ⟨i, x, hx, rfl⟩ := p.limitPoint_coverage hq - apply (p.coneMap_at cone i hx y).2 - rw [← triangles i] - exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨hx, hy, p.limitPoint i x, p.limitPoint_mem hx, - (p.inclusion_entry i x _).2 ⟨hx, rfl⟩, entry⟩ - · intro entry - obtain ⟨q, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (p.coneMap_subset cone entry) - obtain ⟨i, x, _, rfl, xy⟩ := (p.coneMap_entry cone q y).1 entry - rw [← triangles i] at xy - obtain ⟨_, _, q, _, inclusion, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xy - obtain ⟨_, rfl⟩ := (p.inclusion_entry i x q).1 inclusion - exact image - -end PartitionPilot.Forcing.CodedDirectPresentation - -namespace PartitionPilot.Forcing.CodedDirectPresentation -open SetFormula -universe u v -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {system : CodedDirectSystem.{u} I} {T U A F Q : ZFSet.{u}} -variable (p : CodedDirectPresentation system T U A F) (cone : system.InjectiveCone Q) - -theorem coneMap_eq_indexedValueLift {G J : ZFSet.{u}} - (legs : ∀ i g, ZFSet.pair (p.key i) g ∈ G ↔ g = cone.map i) - (inclusions : ∀ i e, ZFSet.pair (p.key i) e ∈ J ↔ - e = directLimitInclusion T U A F (p.key i)) : - p.coneMap cone = indexedValueLift T U (directLimitCarrier T U A F) Q G J := by - apply ZFSet.ext - intro z - constructor - · intro entry - obtain ⟨q, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (p.coneMap_subset cone entry) - obtain ⟨i, x, hx, rfl, xy⟩ := (p.coneMap_entry cone q y).1 entry - exact (pair_mem_indexedValueLift _ _ _ _ _ _ _ _).2 - ⟨p.limitPoint_mem hx, (cone.entry_bounds xy).2, p.key i, p.key_mem i, - cone.map i, directLimitInclusion T U A F (p.key i), x, p.carrier_bound i hx, - (legs i _).2 rfl, (inclusions i _).2 rfl, - (p.inclusion_entry i x _).2 ⟨hx, rfl⟩, xy⟩ - · intro entry - obtain ⟨q, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (indexedValueLift_subset _ _ _ _ _ _ entry) - obtain ⟨_, _, k, hk, g, e, x, _, kg, ke, image, xy⟩ := - (pair_mem_indexedValueLift _ _ _ _ _ _ _ _).1 entry - obtain ⟨i, rfl⟩ := p.exists_key hk - obtain rfl := (legs i g).1 kg - obtain rfl := (inclusions i e).1 ke - obtain ⟨hx, rfl⟩ := (p.inclusion_entry i x q).1 image - exact (p.coneMap_at cone i hx y).2 xy - -theorem coneMap_ground (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {G : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) - (hA : A ∈ M.sets) (hF : F ∈ M.sets) (hQ : Q ∈ M.sets) (hG : G ∈ M.sets) - (family : FunctionGraphOn T G) (entries : ∀ i, ZFSet.pair (p.key i) (cone.map i) ∈ G) : - p.coneMap cone ∈ M.sets := by - let L := indexedCarrierLabels T U A - let E := directLimitRelation T U F L - let J := M.indexedClassInclusions T U L E - have hL : L ∈ M.sets := M.indexedCarrierLabels_mem pairing unions powers separation hT hU hA - have hE : E ∈ M.sets := M.directLimitRelation_mem pairing unions powers separation hT hU hF hL - have hClasses : directLimitCarrier T U A F ∈ M.sets := - M.equivalenceClasses_mem powers separation hL hE - have hJ : J ∈ M.sets := M.indexedClassInclusions_mem pairing unions powers separation hT hU hL hE - have legs (i : I) (g : ZFSet.{u}) : ZFSet.pair (p.key i) g ∈ G ↔ g = cone.map i := - ⟨fun entry => family.unique entry (entries i), fun equal => equal.symm ▸ entries i⟩ - have inclusions (i : I) (e : ZFSet.{u}) : ZFSet.pair (p.key i) e ∈ J ↔ - e = directLimitInclusion T U A F (p.key i) := by - exact (M.indexedClassInclusions_entries pairing unions powers separation hT hU hL hE - (p.key i) e).trans (and_iff_right (p.key_mem i)) - rw [p.coneMap_eq_indexedValueLift cone legs inclusions] - exact M.indexedValueLift_mem pairing unions powers separation hT hU hClasses hQ hG hJ - -theorem coneMap_injection_into {B : ZFSet.{u}} - (bound : ∀ i x y, ZFSet.pair x y ∈ cone.map i → y ∈ B) : - InjectionCode (directLimitCarrier T U A F) B (p.coneMap cone) := by - refine ⟨⟨?_, (p.coneMap_function cone).2⟩, (p.coneMap_injection cone).injective⟩ - intro z entry - obtain ⟨q, hq, y, _, rfl⟩ := ZFSet.mem_prod.1 (p.coneMap_subset cone entry) - obtain ⟨i, x, _, _, xy⟩ := (p.coneMap_entry cone q y).1 entry - exact ZFSet.pair_mem_prod.2 ⟨hq, bound i x y xy⟩ - -theorem coneMap_bijection_onto {B : ZFSet.{u}} - (bound : ∀ i x y, ZFSet.pair x y ∈ cone.map i → y ∈ B) (coverage : cone.Covers B) : - InjectionCode (directLimitCarrier T U A F) B (p.coneMap cone) ∧ - ∀ y ∈ B, ∃ q ∈ directLimitCarrier T U A F, ZFSet.pair q y ∈ p.coneMap cone := - ⟨p.coneMap_injection_into cone bound, p.coneMap_onto cone coverage⟩ - -end PartitionPilot.Forcing.CodedDirectPresentation - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def limitPointLabels : ZFSet.{u} := - indexedCarrierLabels run.indices run.carrierUnion run.carrierFamily - -noncomputable def limitPointRelation : ZFSet.{u} := - directLimitRelation run.indices run.carrierUnion run.pointMapFamily run.limitPointLabels - -noncomputable def limitPoints : ZFSet.{u} := - directLimitCarrier run.indices run.carrierUnion run.carrierFamily run.pointMapFamily - -noncomputable def limitPointMap (i : I) : ZFSet.{u} := - directLimitInclusion run.indices run.carrierUnion run.carrierFamily run.pointMapFamily (run.key i) - -noncomputable def limitPointInclusions : ZFSet.{u} := - M.indexedClassInclusions run.indices run.carrierUnion run.limitPointLabels run.limitPointRelation - -theorem limitPointLabels_ground : run.limitPointLabels ∈ M.sets := - M.indexedCarrierLabels_mem pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.carrierFamily_ground - -theorem limitPointRelation_ground : run.limitPointRelation ∈ M.sets := - M.directLimitRelation_mem pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.pointMapFamily_ground run.limitPointLabels_ground - -theorem limitPoints_ground : run.limitPoints ∈ M.sets := - M.equivalenceClasses_mem powers separation run.limitPointLabels_ground run.limitPointRelation_ground - -theorem limitPointMap_ground (i : I) : run.limitPointMap i ∈ M.sets := - M.indexedClassInclusion_mem pairing unions powers separation run.carrierUnion_ground - run.limitPointLabels_ground run.limitPointRelation_ground - (M.transitive run.indices_ground (ZFSet.mem_range.2 ⟨i, rfl⟩)) - -theorem limitPointInclusions_ground : run.limitPointInclusions ∈ M.sets := - M.indexedClassInclusions_mem pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.limitPointLabels_ground run.limitPointRelation_ground - -theorem limitPointMap_injection (i : I) : - InjectionCode (run.diagram.stage i).stage.carrier run.limitPoints (run.limitPointMap i) := - run.pointPresentation.inclusion_injection i - -theorem limitPointInclusions_function : FunctionGraphOn run.indices run.limitPointInclusions := - ⟨_, M.indexedClassInclusions_function pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.limitPointLabels_ground run.limitPointRelation_ground⟩ - -theorem limitPointInclusions_entry (i : I) (f : ZFSet.{u}) : - ZFSet.pair (run.key i) f ∈ run.limitPointInclusions ↔ f = run.limitPointMap i := by - exact (M.indexedClassInclusions_entries pairing unions powers separation (T := run.indices) - run.indices_ground run.carrierUnion_ground run.limitPointLabels_ground run.limitPointRelation_ground - (run.key i) f).trans (and_iff_right (show run.key i ∈ run.indices from ZFSet.mem_range.2 ⟨i, rfl⟩)) - -theorem limitPointMap_comp {i j : I} (before : i ≤ j) : - relationCompose (run.diagram.stage i).stage.carrier (run.diagram.stage j).stage.carrier - run.limitPoints (run.diagram.transition before).map.points - (run.limitPointMap j) = run.limitPointMap i := - run.pointPresentation.inclusion_comp before - -noncomputable def limitActorLabels : ZFSet.{u} := - indexedCarrierLabels run.indices run.actorUnion run.actorFamily - -noncomputable def limitActorRelation : ZFSet.{u} := - directLimitRelation run.indices run.actorUnion run.actorMapFamily run.limitActorLabels - -noncomputable def limitActors : ZFSet.{u} := - directLimitCarrier run.indices run.actorUnion run.actorFamily run.actorMapFamily - -noncomputable def limitActorMap (i : I) : ZFSet.{u} := - directLimitInclusion run.indices run.actorUnion run.actorFamily run.actorMapFamily (run.key i) - -noncomputable def limitActorInclusions : ZFSet.{u} := - M.indexedClassInclusions run.indices run.actorUnion run.limitActorLabels run.limitActorRelation - -theorem limitActorLabels_ground : run.limitActorLabels ∈ M.sets := - M.indexedCarrierLabels_mem pairing unions powers separation run.indices_ground - run.actorUnion_ground run.actorFamily_ground - -theorem limitActorRelation_ground : run.limitActorRelation ∈ M.sets := - M.directLimitRelation_mem pairing unions powers separation run.indices_ground - run.actorUnion_ground run.actorMapFamily_ground run.limitActorLabels_ground - -theorem limitActors_ground : run.limitActors ∈ M.sets := - M.equivalenceClasses_mem powers separation run.limitActorLabels_ground run.limitActorRelation_ground - -theorem limitActorMap_ground (i : I) : run.limitActorMap i ∈ M.sets := - M.indexedClassInclusion_mem pairing unions powers separation run.actorUnion_ground - run.limitActorLabels_ground run.limitActorRelation_ground - (M.transitive run.indices_ground (ZFSet.mem_range.2 ⟨i, rfl⟩)) - -theorem limitActorInclusions_ground : run.limitActorInclusions ∈ M.sets := - M.indexedClassInclusions_mem pairing unions powers separation run.indices_ground - run.actorUnion_ground run.limitActorLabels_ground run.limitActorRelation_ground - -theorem limitActorMap_injection (i : I) : - InjectionCode (run.diagram.stage i).stage.actors run.limitActors (run.limitActorMap i) := - run.actorPresentation.inclusion_injection i - -theorem limitActorInclusions_function : FunctionGraphOn run.indices run.limitActorInclusions := - ⟨_, M.indexedClassInclusions_function pairing unions powers separation run.indices_ground - run.actorUnion_ground run.limitActorLabels_ground run.limitActorRelation_ground⟩ - -theorem limitActorInclusions_entry (i : I) (f : ZFSet.{u}) : - ZFSet.pair (run.key i) f ∈ run.limitActorInclusions ↔ f = run.limitActorMap i := by - exact (M.indexedClassInclusions_entries pairing unions powers separation (T := run.indices) - run.indices_ground run.actorUnion_ground run.limitActorLabels_ground run.limitActorRelation_ground - (run.key i) f).trans (and_iff_right (show run.key i ∈ run.indices from ZFSet.mem_range.2 ⟨i, rfl⟩)) - -theorem limitActorMap_comp {i j : I} (before : i ≤ j) : - relationCompose (run.diagram.stage i).stage.actors (run.diagram.stage j).stage.actors - run.limitActors (run.diagram.transition before).map.actors - (run.limitActorMap j) = run.limitActorMap i := - run.actorPresentation.inclusion_comp before - -def LimitMul (g h k : ZFSet.{u}) : Prop := - ∃ i a b c, a ∈ (run.diagram.stage i).stage.actors ∧ b ∈ (run.diagram.stage i).stage.actors ∧ - c ∈ (run.diagram.stage i).stage.actors ∧ g = run.actorPresentation.limitPoint i a ∧ - h = run.actorPresentation.limitPoint i b ∧ k = run.actorPresentation.limitPoint i c ∧ - ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication - -def LimitInv (g h : ZFSet.{u}) : Prop := - ∃ i a b, a ∈ (run.diagram.stage i).stage.actors ∧ b ∈ (run.diagram.stage i).stage.actors ∧ - g = run.actorPresentation.limitPoint i a ∧ h = run.actorPresentation.limitPoint i b ∧ - ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse - -theorem limitMul_bounds {g h k : ZFSet.{u}} (mul : run.LimitMul g h k) : - g ∈ run.limitActors ∧ h ∈ run.limitActors ∧ k ∈ run.limitActors := by - obtain ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, _⟩ := mul - exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb, - run.actorPresentation.limitPoint_mem hc⟩ - -theorem limitInv_bounds {g h : ZFSet.{u}} (inv : run.LimitInv g h) : - g ∈ run.limitActors ∧ h ∈ run.limitActors := by - obtain ⟨i, a, b, ha, hb, rfl, rfl, _⟩ := inv - exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb⟩ - -theorem limitMul_total {g h : ZFSet.{u}} (hg : g ∈ run.limitActors) (hh : h ∈ run.limitActors) : - ∃ k ∈ run.limitActors, run.LimitMul g h k := by - obtain ⟨i, a, b, ha, hb, rfl, rfl⟩ := run.actorPresentation.pair_coverage hg hh - obtain ⟨c, entry, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 - (ZFSet.pair a b) (ZFSet.pair_mem_prod.2 ⟨ha, hb⟩) - have hc := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 entry)).2 - exact ⟨run.actorPresentation.limitPoint i c, run.actorPresentation.limitPoint_mem hc, - i, a, b, c, ha, hb, hc, rfl, rfl, rfl, entry⟩ - -theorem limitInv_total {g : ZFSet.{u}} (hg : g ∈ run.limitActors) : - ∃ h ∈ run.limitActors, run.LimitInv g h := by - obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg - obtain ⟨b, entry, _⟩ := (run.diagram.stage i).stage.group_code.inv_function.2 a ha - have hb := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.inv_function.1 entry)).2 - exact ⟨run.actorPresentation.limitPoint i b, run.actorPresentation.limitPoint_mem hb, - i, a, b, ha, hb, rfl, rfl, entry⟩ - -theorem limitMul_unique {g h k l : ZFSet.{u}} - (first : run.LimitMul g h k) (second : run.LimitMul g h l) : k = l := by - obtain ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, product⟩ := first - obtain ⟨j, d, e, f, hd, he, hf, equalA, equalB, rfl, product'⟩ := second - obtain ⟨m, im, jm⟩ := run.common_upper i j - obtain ⟨a', aa'⟩ := run.actorSystem.map_entry_total im ha - obtain ⟨b', bb'⟩ := run.actorSystem.map_entry_total im hb - obtain ⟨c', cc'⟩ := run.actorSystem.map_entry_total im hc - obtain ⟨d', dd'⟩ := run.actorSystem.map_entry_total jm hd - obtain ⟨e', ee'⟩ := run.actorSystem.map_entry_total jm he - obtain ⟨f', ff'⟩ := run.actorSystem.map_entry_total jm hf - have sameA := (run.actorSystem.related_iff_common_images im jm aa' dd').1 - ((run.actorPresentation.limitPoint_eq_iff_related ha hd).1 equalA) - have sameB := (run.actorSystem.related_iff_common_images im jm bb' ee').1 - ((run.actorPresentation.limitPoint_eq_iff_related hb he).1 equalB) - subst d' - subst e' - have left := (run.diagram.transition im).map.group_embedding.mul a b c a' b' c' product aa' bb' cc' - have right := (run.diagram.transition jm).map.group_embedding.mul d e f a' b' f' product' dd' ee' ff' - have sameC : c' = f' := - (show FunctionGraphOn (ZFSet.prod (run.diagram.stage m).stage.actors (run.diagram.stage m).stage.actors) - (run.diagram.stage m).stage.multiplication from - ⟨_, (run.diagram.stage m).stage.group_code.mul_function⟩).unique left right - apply (run.actorPresentation.limitPoint_eq_iff_related hc hf).2 - exact ⟨m, im, jm, c', cc', sameC.symm ▸ ff'⟩ - -theorem limitInv_unique {g h k : ZFSet.{u}} - (first : run.LimitInv g h) (second : run.LimitInv g k) : h = k := by - obtain ⟨i, a, b, ha, hb, rfl, rfl, inverse⟩ := first - obtain ⟨j, c, d, hc, hd, equal, rfl, inverse'⟩ := second - obtain ⟨m, im, jm⟩ := run.common_upper i j - obtain ⟨a', aa'⟩ := run.actorSystem.map_entry_total im ha - obtain ⟨b', bb'⟩ := run.actorSystem.map_entry_total im hb - obtain ⟨c', cc'⟩ := run.actorSystem.map_entry_total jm hc - obtain ⟨d', dd'⟩ := run.actorSystem.map_entry_total jm hd - have sameA := (run.actorSystem.related_iff_common_images im jm aa' cc').1 - ((run.actorPresentation.limitPoint_eq_iff_related ha hc).1 equal) - subst c' - have left := (run.diagram.transition im).map.group_embedding.map_inv - (run.diagram.stage i).stage.group_code (run.diagram.stage m).stage.group_code inverse aa' bb' - have right := (run.diagram.transition jm).map.group_embedding.map_inv - (run.diagram.stage j).stage.group_code (run.diagram.stage m).stage.group_code inverse' cc' dd' - have sameB : b' = d' := - (show FunctionGraphOn (run.diagram.stage m).stage.actors (run.diagram.stage m).stage.inverse from - ⟨_, (run.diagram.stage m).stage.group_code.inv_function⟩).unique left right - apply (run.actorPresentation.limitPoint_eq_iff_related hb hd).2 - exact ⟨m, im, jm, b', bb', sameB.symm ▸ dd'⟩ - -theorem limitMul_at (i : I) {a b c : ZFSet.{u}} - (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) - (hc : c ∈ (run.diagram.stage i).stage.actors) : - run.LimitMul (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b) - (run.actorPresentation.limitPoint i c) ↔ - ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication := by - constructor - · intro product - obtain ⟨d, entry, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 - (ZFSet.pair a b) (ZFSet.pair_mem_prod.2 ⟨ha, hb⟩) - have hd := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 entry)).2 - have canonical : run.LimitMul (run.actorPresentation.limitPoint i a) - (run.actorPresentation.limitPoint i b) (run.actorPresentation.limitPoint i d) := - ⟨i, a, b, d, ha, hb, hd, rfl, rfl, rfl, entry⟩ - have equal := (run.actorPresentation.limitPoint_same_iff hc hd).1 (run.limitMul_unique product canonical) - subst d - exact entry - · intro entry - exact ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, entry⟩ - -theorem limitInv_at (i : I) {a b : ZFSet.{u}} - (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) : - run.LimitInv (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b) ↔ - ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse := by - constructor - · intro inverse - obtain ⟨c, entry, _⟩ := (run.diagram.stage i).stage.group_code.inv_function.2 a ha - have hc := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.inv_function.1 entry)).2 - have canonical : run.LimitInv (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i c) := - ⟨i, a, c, ha, hc, rfl, rfl, entry⟩ - have equal := (run.actorPresentation.limitPoint_same_iff hb hc).1 (run.limitInv_unique inverse canonical) - subst c - exact entry - · intro entry - exact ⟨i, a, b, ha, hb, rfl, rfl, entry⟩ - -noncomputable def limitIdentity (i : I) : ZFSet.{u} := - run.actorPresentation.limitPoint i (run.diagram.stage i).stage.identity - -theorem limitIdentity_mem (i : I) : run.limitIdentity i ∈ run.limitActors := - run.actorPresentation.limitPoint_mem (run.diagram.stage i).stage.group_code.identity_mem - -theorem limitIdentity_eq (i j : I) : run.limitIdentity i = run.limitIdentity j := by - obtain ⟨k, ik, jk⟩ := run.common_upper i j - apply (run.actorPresentation.limitPoint_eq_iff_related - (run.diagram.stage i).stage.group_code.identity_mem (run.diagram.stage j).stage.group_code.identity_mem).2 - exact ⟨k, ik, jk, (run.diagram.stage k).stage.identity, - (run.diagram.transition ik).map.group_embedding.one, (run.diagram.transition jk).map.group_embedding.one⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIndexedValueLifts +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing +universe u + +noncomputable def directLimitRelation (T U F L : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ T, ∃ x ∈ U, ∃ j ∈ T, ∃ y ∈ U, + ∃ k ∈ T, ∃ w ∈ U, ∃ f ∈ ⋃₀ ⋃₀ F, ∃ g ∈ ⋃₀ ⋃₀ F, + z = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ + ZFSet.pair (ZFSet.pair k i) f ∈ F ∧ ZFSet.pair (ZFSet.pair k j) g ∈ F ∧ + ZFSet.pair x w ∈ f ∧ ZFSet.pair y w ∈ g) (ZFSet.prod L L) + +theorem directLimitRelation_subset (T U F L : ZFSet.{u}) : + directLimitRelation T U F L ⊆ ZFSet.prod L L := fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem pair_mem_directLimitRelation (T U F L i x j y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∈ directLimitRelation T U F L ↔ + ZFSet.pair i x ∈ L ∧ ZFSet.pair j y ∈ L ∧ + i ∈ T ∧ x ∈ U ∧ j ∈ T ∧ y ∈ U ∧ + ∃ k ∈ T, ∃ w ∈ U, ∃ f g, + ZFSet.pair (ZFSet.pair k i) f ∈ F ∧ ZFSet.pair (ZFSet.pair k j) g ∈ F ∧ + ZFSet.pair x w ∈ f ∧ ZFSet.pair y w ∈ g := by + rw [directLimitRelation, ZFSet.mem_sep] + constructor + · rintro ⟨shape, a, ha, b, hb, c, hc, d, hd, k, hk, w, hw, f, _, g, _, equal, first, second, left, right⟩ + obtain ⟨ab, cd⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 cd + exact ⟨(ZFSet.pair_mem_prod.1 shape).1, (ZFSet.pair_mem_prod.1 shape).2, + ha, hb, hc, hd, k, hk, w, hw, f, g, first, second, left, right⟩ + · rintro ⟨leftLabel, rightLabel, hi, hx, hj, hy, k, hk, w, hw, f, g, first, second, left, right⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨leftLabel, rightLabel⟩, + i, hi, x, hx, j, hj, y, hy, k, hk, w, hw, + f, pair_second_mem_doubleUnion first, g, pair_second_mem_doubleUnion second, + rfl, first, second, left, right⟩ + +namespace BoundedFormula +open SetFormula + +def directLimitRelationEntryFormula : BoundedFormula 5 := + exMem 1 (exMem 3 (exMem 3 (exMem 5 (exMem 5 (exMem 7 (exMem 9 (exMem 10 + (.conj (pairOfPairsFormula 8 7 6 5 4) + (.conj (tripleMembershipFormula 3 7 1 12) + (.conj (tripleMembershipFormula 3 5 0 12) + (.conj (pairMembershipFormula 6 2 1) (pairMembershipFormula 4 2 0)))))))))))) + +theorem truth_directLimitRelationEntryFormula (env : Fin 5 → ZFSet.{u}) : + Truth directLimitRelationEntryFormula env ↔ + ∃ i ∈ env 1, ∃ x ∈ env 2, ∃ j ∈ env 1, ∃ y ∈ env 2, + ∃ k ∈ env 1, ∃ w ∈ env 2, ∃ f ∈ env 3, ∃ g ∈ env 3, + env 0 = ZFSet.pair (ZFSet.pair i x) (ZFSet.pair j y) ∧ + ZFSet.pair (ZFSet.pair k i) f ∈ env 4 ∧ ZFSet.pair (ZFSet.pair k j) g ∈ env 4 ∧ + ZFSet.pair x w ∈ f ∧ ZFSet.pair y w ∈ g := by + simp only [directLimitRelationEntryFormula, truth_exMem, Truth, + truth_pairOfPairsFormula, truth_tripleMembershipFormula, truth_pairMembershipFormula] + rfl + +end BoundedFormula + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem directLimitRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {T U F L : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) + (hF : F ∈ M.sets) (hL : L ∈ M.sets) : directLimitRelation T U F L ∈ M.sets := by + have hB := M.union_mem unions (M.union_mem unions hF) + let params := extend T (extend U (extend (⋃₀ ⋃₀ F) (extend F Fin.elim0))) + have selected := M.bounded_separation_mem separation BoundedFormula.directLimitRelationEntryFormula + params (Fin.cases hT (Fin.cases hU (Fin.cases hB (Fin.cases hF (fun i => Fin.elim0 i))))) + (M.prod_mem pairing unions powers separation hL hL) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.directLimitRelationEntryFormula + (extend z params)) (ZFSet.prod L L) = directLimitRelation T U F L := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, directLimitRelation, ZFSet.mem_sep, + BoundedFormula.truth_directLimitRelationEntryFormula] + rfl + exact equal ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.CodedDirectPresentation +universe u v +variable {I : Type v} [Small.{u} I] [Preorder I] {system : CodedDirectSystem.{u} I} +variable {T U A F : ZFSet.{u}} (p : CodedDirectPresentation system T U A F) + +theorem relation_iff (i : I) (x : ZFSet.{u}) (j : I) (y : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (p.key i) x) (ZFSet.pair (p.key j) y) ∈ + directLimitRelation T U F (indexedCarrierLabels T U A) ↔ system.Related i x j y := by + rw [pair_mem_directLimitRelation] + constructor + · rintro ⟨_, _, _, _, _, _, k, hk, w, _, f, g, first, second, left, right⟩ + obtain ⟨k, rfl⟩ := p.exists_key hk + obtain ⟨before, rfl⟩ := p.map_lookup first + obtain ⟨after, rfl⟩ := p.map_lookup second + exact ⟨k, before, after, w, left, right⟩ + · rintro ⟨k, first, second, w, left, right⟩ + have leftBounds := system.map_entry_bounds first left + have rightBounds := system.map_entry_bounds second right + exact ⟨(p.label_mem i x).2 leftBounds.1, (p.label_mem j y).2 rightBounds.1, + p.key_mem i, p.carrier_bound i leftBounds.1, p.key_mem j, p.carrier_bound j rightBounds.1, + p.key k, p.key_mem k, w, p.carrier_bound k leftBounds.2, + system.map first, system.map second, p.map_entry first, p.map_entry second, left, right⟩ + +include p in +theorem relation_equivalence : EquivalenceRelationCode (indexedCarrierLabels T U A) + (directLimitRelation T U F (indexedCarrierLabels T U A)) := by + refine ⟨directLimitRelation_subset _ _ _ _, ?_, ?_, ?_⟩ + · intro x hx + obtain ⟨i, x, member, rfl⟩ := p.label_cases hx + exact (p.relation_iff i x i x).2 (system.related_refl member) + · intro x y related + obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (directLimitRelation_subset _ _ _ _ related) + obtain ⟨i, x, _, rfl⟩ := p.label_cases hx + obtain ⟨j, y, _, rfl⟩ := p.label_cases hy + exact (p.relation_iff j y i x).2 (system.related_symm ((p.relation_iff i x j y).1 related)) + · intro x y z first second + obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (directLimitRelation_subset _ _ _ _ first) + have hz := (ZFSet.pair_mem_prod.1 (directLimitRelation_subset _ _ _ _ second)).2 + obtain ⟨i, x, _, rfl⟩ := p.label_cases hx + obtain ⟨j, y, _, rfl⟩ := p.label_cases hy + obtain ⟨k, z, _, rfl⟩ := p.label_cases hz + exact (p.relation_iff i x k z).2 + (system.related_trans ((p.relation_iff i x j y).1 first) ((p.relation_iff j y k z).1 second)) + +end PartitionPilot.Forcing.CodedDirectPresentation + +namespace PartitionPilot.Forcing +universe u v + +noncomputable def directLimitCarrier (T U A F : ZFSet.{u}) : ZFSet.{u} := + equivalenceClasses (indexedCarrierLabels T U A) + (directLimitRelation T U F (indexedCarrierLabels T U A)) + +noncomputable def directLimitInclusion (T U A F k : ZFSet.{u}) : ZFSet.{u} := + indexedClassInclusion U (indexedCarrierLabels T U A) + (directLimitRelation T U F (indexedCarrierLabels T U A)) k + +namespace CodedDirectPresentation +variable {I : Type v} [Small.{u} I] [Preorder I] {system : CodedDirectSystem.{u} I} +variable {T U A F : ZFSet.{u}} (p : CodedDirectPresentation system T U A F) + +noncomputable def limitPoint (i : I) (x : ZFSet.{u}) : ZFSet.{u} := + equivalenceClass (indexedCarrierLabels T U A) + (directLimitRelation T U F (indexedCarrierLabels T U A)) (ZFSet.pair (p.key i) x) + +theorem limitPoint_mem {i : I} {x : ZFSet.{u}} (member : x ∈ system.carrier i) : + p.limitPoint i x ∈ directLimitCarrier T U A F := + equivalenceClass_mem ((p.label_mem i x).2 member) + +theorem limitPoint_eq_iff_related {i j : I} {x y : ZFSet.{u}} + (hx : x ∈ system.carrier i) (hy : y ∈ system.carrier j) : + p.limitPoint i x = p.limitPoint j y ↔ system.Related i x j y := + (p.relation_equivalence.class_eq_iff ((p.label_mem i x).2 hx) ((p.label_mem j y).2 hy)).trans + (p.relation_iff i x j y) + +theorem limitPoint_same_iff {i : I} {x y : ZFSet.{u}} + (hx : x ∈ system.carrier i) (hy : y ∈ system.carrier i) : + p.limitPoint i x = p.limitPoint i y ↔ x = y := + (p.limitPoint_eq_iff_related hx hy).trans (system.related_same_iff_eq hx) + +theorem limitPoint_transition {i j : I} (before : i ≤ j) {x y : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ system.map before) : + p.limitPoint i x = p.limitPoint j y := + (p.limitPoint_eq_iff_related (system.map_entry_bounds before entry).1 + (system.map_entry_bounds before entry).2).2 (system.related_of_entry before entry) + +theorem limitPoint_later_iff {i j : I} (before : i ≤ j) {x y : ZFSet.{u}} + (hx : x ∈ system.carrier i) (hy : y ∈ system.carrier j) : + p.limitPoint i x = p.limitPoint j y ↔ ZFSet.pair x y ∈ system.map before := + (p.limitPoint_eq_iff_related hx hy).trans (system.related_iff_entry before) + +theorem inclusion_entry (i : I) (x y : ZFSet.{u}) : + ZFSet.pair x y ∈ directLimitInclusion T U A F (p.key i) ↔ + x ∈ system.carrier i ∧ y = p.limitPoint i x := + pair_mem_indexedClassInclusion_of_entry p.carrier_function (p.carrier_entry i) (p.carrier_bound i) + +theorem inclusion_injection (i : I) : + InjectionCode (system.carrier i) (directLimitCarrier T U A F) + (directLimitInclusion T U A F (p.key i)) := by + refine ⟨indexedClassInclusion_function p.carrier_function (p.carrier_entry i) (p.carrier_bound i), ?_⟩ + intro x y z first second + obtain ⟨hx, left⟩ := (p.inclusion_entry i x z).1 first + obtain ⟨hy, right⟩ := (p.inclusion_entry i y z).1 second + exact (p.limitPoint_same_iff hx hy).1 (left.symm.trans right) + +theorem inclusion_comp {i j : I} (before : i ≤ j) : + relationCompose (system.carrier i) (system.carrier j) (directLimitCarrier T U A F) + (system.map before) (directLimitInclusion T U A F (p.key j)) = + directLimitInclusion T U A F (p.key i) := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨x, hx, y, _, w, _, rfl, xy, yw⟩ := (mem_relationCompose _ _ _ _ _ z).1 entry + obtain ⟨_, equal⟩ := (p.inclusion_entry j y w).1 yw + exact (p.inclusion_entry i x w).2 ⟨hx, equal.trans (p.limitPoint_transition before xy).symm⟩ + · intro entry + obtain ⟨x, _, w, _, rfl⟩ := ZFSet.mem_prod.1 ((p.inclusion_injection i).function.1 entry) + obtain ⟨hx, rfl⟩ := (p.inclusion_entry i x w).1 entry + obtain ⟨y, xy⟩ := system.map_entry_total before hx + have hy := (system.map_entry_bounds before xy).2 + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨hx, p.limitPoint_mem hx, y, hy, xy, + (p.inclusion_entry j y (p.limitPoint i x)).2 ⟨hy, p.limitPoint_transition before xy⟩⟩ + +end CodedDirectPresentation + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +theorem indexedCarrierLabels_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {T U : ZFSet.{u}} (A : ZFSet.{u}) + (indices : ZFSet.rank T < o) (points : ZFSet.rank U < o) : + ZFSet.rank (indexedCarrierLabels T U A) < o := + (ZFSet.rank_mono (indexedCarrierLabels_subset T U A)).trans_lt + (rank_product_lt limit indices points) + +theorem directLimitRelation_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (T U F : ZFSet.{u}) {L : ZFSet.{u}} (labels : ZFSet.rank L < o) : + ZFSet.rank (directLimitRelation T U F L) < o := + (ZFSet.rank_mono (directLimitRelation_subset T U F L)).trans_lt + (rank_product_lt limit labels labels) + +theorem equivalenceClasses_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {L : ZFSet.{u}} (E : ZFSet.{u}) (labels : ZFSet.rank L < o) : + ZFSet.rank (equivalenceClasses L E) < o := by + have bound := ZFSet.rank_mono + (show equivalenceClasses L E ⊆ ZFSet.powerset L from fun _ hz => (ZFSet.mem_sep.1 hz).1) + rw [ZFSet.rank_powerset] at bound + exact bound.trans_lt (limit.succ_lt labels) + +theorem equivalenceClassifier_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {L : ZFSet.{u}} (E : ZFSet.{u}) (labels : ZFSet.rank L < o) : + ZFSet.rank (equivalenceClassifier L E) < o := + (ZFSet.rank_mono + (show equivalenceClassifier L E ⊆ ZFSet.prod L (equivalenceClasses L E) + from fun _ hz => (ZFSet.mem_sep.1 hz).1)).trans_lt + (rank_product_lt limit labels (equivalenceClasses_rank_lt limit E labels)) + +theorem indexedClassInclusion_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {U L : ZFSet.{u}} (E i : ZFSet.{u}) + (points : ZFSet.rank U < o) (labels : ZFSet.rank L < o) : + ZFSet.rank (indexedClassInclusion U L E i) < o := + (ZFSet.rank_mono (indexedRelationSection_subset U (equivalenceClasses L E) + (equivalenceClassifier L E) i)).trans_lt + (rank_product_lt limit points (equivalenceClasses_rank_lt limit E labels)) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem indexedClassInclusions_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + {T U L : ZFSet.{u}} (E : ZFSet.{u}) (indices : ZFSet.rank T < o) + (points : ZFSet.rank U < o) (labels : ZFSet.rank L < o) : + ZFSet.rank (M.indexedClassInclusions T U L E) < o := + (ZFSet.rank_mono + (show M.indexedClassInclusions T U L E ⊆ + ZFSet.prod T (M.groundRelations U (equivalenceClasses L E)) + from fun _ hz => by + unfold indexedClassInclusions indexedRelationSections at hz + exact (ZFSet.mem_sep.1 hz).1)).trans_lt + (rank_product_lt limit indices + (M.groundRelations_rank_lt limit points (equivalenceClasses_rank_lt limit E labels))) + +end TransitiveGround + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.CodedDirectPresentation +universe u v +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {system : CodedDirectSystem.{u} I} {T U A F : ZFSet.{u}} +variable (p : CodedDirectPresentation system T U A F) + +theorem limitPoint_coverage {z : ZFSet.{u}} (member : z ∈ directLimitCarrier T U A F) : + ∃ i x, x ∈ system.carrier i ∧ z = p.limitPoint i x := by + obtain ⟨label, labelMember, rfl⟩ := (mem_equivalenceClasses _ _ z).1 member + obtain ⟨i, x, hx, rfl⟩ := p.label_cases labelMember + exact ⟨i, x, hx, rfl⟩ + +theorem mixed_pair_coverage {other : CodedDirectSystem.{u} I} {T' U' A' F' : ZFSet.{u}} + (q : CodedDirectPresentation other T' U' A' F') {z w : ZFSet.{u}} + (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T' U' A' F') : + ∃ k x y, x ∈ system.carrier k ∧ y ∈ other.carrier k ∧ + z = p.limitPoint k x ∧ w = q.limitPoint k y := by + obtain ⟨i, x, hx, rfl⟩ := p.limitPoint_coverage hz + obtain ⟨j, y, hy, rfl⟩ := q.limitPoint_coverage hw + obtain ⟨k, ik, jk⟩ := system.common_upper i j + obtain ⟨x', xx'⟩ := system.map_entry_total ik hx + obtain ⟨y', yy'⟩ := other.map_entry_total jk hy + exact ⟨k, x', y', (system.map_entry_bounds ik xx').2, (other.map_entry_bounds jk yy').2, + p.limitPoint_transition ik xx', q.limitPoint_transition jk yy'⟩ + +theorem mixed_triple_coverage {other third : CodedDirectSystem.{u} I} + {T' U' A' F' T'' U'' A'' F'' : ZFSet.{u}} + (q : CodedDirectPresentation other T' U' A' F') + (r : CodedDirectPresentation third T'' U'' A'' F'') {z w v : ZFSet.{u}} + (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T' U' A' F') + (hv : v ∈ directLimitCarrier T'' U'' A'' F'') : + ∃ k x y a, x ∈ system.carrier k ∧ y ∈ other.carrier k ∧ a ∈ third.carrier k ∧ + z = p.limitPoint k x ∧ w = q.limitPoint k y ∧ v = r.limitPoint k a := by + obtain ⟨i, x, y, hx, hy, rfl, rfl⟩ := p.mixed_pair_coverage q hz hw + obtain ⟨j, a, ha, rfl⟩ := r.limitPoint_coverage hv + obtain ⟨k, ik, jk⟩ := system.common_upper i j + obtain ⟨x', xx'⟩ := system.map_entry_total ik hx + obtain ⟨y', yy'⟩ := other.map_entry_total ik hy + obtain ⟨a', aa'⟩ := third.map_entry_total jk ha + exact ⟨k, x', y', a', (system.map_entry_bounds ik xx').2, (other.map_entry_bounds ik yy').2, + (third.map_entry_bounds jk aa').2, p.limitPoint_transition ik xx', + q.limitPoint_transition ik yy', r.limitPoint_transition jk aa'⟩ + +theorem pair_coverage {z w : ZFSet.{u}} + (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T U A F) : + ∃ k x y, x ∈ system.carrier k ∧ y ∈ system.carrier k ∧ + z = p.limitPoint k x ∧ w = p.limitPoint k y := + p.mixed_pair_coverage p hz hw + +theorem triple_coverage {z w v : ZFSet.{u}} + (hz : z ∈ directLimitCarrier T U A F) (hw : w ∈ directLimitCarrier T U A F) + (hv : v ∈ directLimitCarrier T U A F) : + ∃ k x y a, x ∈ system.carrier k ∧ y ∈ system.carrier k ∧ a ∈ system.carrier k ∧ + z = p.limitPoint k x ∧ w = p.limitPoint k y ∧ v = p.limitPoint k a := + p.mixed_triple_coverage p p hz hw hv + +end PartitionPilot.Forcing.CodedDirectPresentation + +namespace PartitionPilot.Forcing.CodedDirectPresentation +universe u v +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {system : CodedDirectSystem.{u} I} {T U A F Q : ZFSet.{u}} +variable (p : CodedDirectPresentation system T U A F) (cone : system.InjectiveCone Q) + +noncomputable def coneMap : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i x y, x ∈ system.carrier i ∧ + z = ZFSet.pair (p.limitPoint i x) y ∧ ZFSet.pair x y ∈ cone.map i) + (ZFSet.prod (directLimitCarrier T U A F) Q) + +theorem coneMap_subset : p.coneMap cone ⊆ ZFSet.prod (directLimitCarrier T U A F) Q := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem coneMap_entry (q y : ZFSet.{u}) : + ZFSet.pair q y ∈ p.coneMap cone ↔ + ∃ i x, x ∈ system.carrier i ∧ q = p.limitPoint i x ∧ ZFSet.pair x y ∈ cone.map i := by + rw [coneMap, ZFSet.mem_sep] + constructor + · rintro ⟨_, i, x, y', hx, equal, entry⟩ + obtain ⟨eq, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨i, x, hx, eq, entry⟩ + · rintro ⟨i, x, hx, rfl, entry⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨p.limitPoint_mem hx, (cone.entry_bounds entry).2⟩, + i, x, y, hx, rfl, entry⟩ + +theorem coneMap_at (i : I) {x : ZFSet.{u}} (hx : x ∈ system.carrier i) (y : ZFSet.{u}) : + ZFSet.pair (p.limitPoint i x) y ∈ p.coneMap cone ↔ ZFSet.pair x y ∈ cone.map i := by + rw [p.coneMap_entry cone] + constructor + · rintro ⟨j, z, hz, equal, zy⟩ + obtain ⟨v, xv⟩ := cone.entry_total hx + have same := (cone.entry_eq_iff_related xv zy).2 ((p.limitPoint_eq_iff_related hx hz).1 equal) + exact same ▸ xv + · exact fun entry => ⟨i, x, hx, rfl, entry⟩ + +theorem coneMap_function : ZFSet.IsFunc (directLimitCarrier T U A F) Q (p.coneMap cone) := by + refine ⟨p.coneMap_subset cone, ?_⟩ + intro q hq + obtain ⟨i, x, hx, rfl⟩ := p.limitPoint_coverage hq + obtain ⟨y, xy⟩ := cone.entry_total hx + refine ⟨y, (p.coneMap_at cone i hx y).2 xy, ?_⟩ + intro z entry + exact (show FunctionGraphOn (system.carrier i) (cone.map i) from + ⟨Q, (cone.injection i).function⟩).unique ((p.coneMap_at cone i hx z).1 entry) xy + +theorem coneMap_injection : InjectionCode (directLimitCarrier T U A F) Q (p.coneMap cone) := by + refine ⟨p.coneMap_function cone, ?_⟩ + intro q r y first second + obtain ⟨i, x, hx, rfl, xy⟩ := (p.coneMap_entry cone q y).1 first + obtain ⟨j, z, hz, rfl, zy⟩ := (p.coneMap_entry cone r y).1 second + exact (p.limitPoint_eq_iff_related hx hz).2 ((cone.entry_eq_iff_related xy zy).1 rfl) + +theorem coneMap_triangle (i : I) : + relationCompose (system.carrier i) (directLimitCarrier T U A F) Q + (directLimitInclusion T U A F (p.key i)) (p.coneMap cone) = cone.map i := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨x, _, q, _, y, _, rfl, inclusion, image⟩ := (mem_relationCompose _ _ _ _ _ z).1 entry + obtain ⟨hx, rfl⟩ := (p.inclusion_entry i x q).1 inclusion + exact (p.coneMap_at cone i hx y).1 image + · intro entry + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((cone.injection i).function.1 entry) + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hx, hy, p.limitPoint i x, + p.limitPoint_mem hx, (p.inclusion_entry i x _).2 ⟨hx, rfl⟩, + (p.coneMap_at cone i hx y).2 entry⟩ + +theorem coneMap_range (y : ZFSet.{u}) : + (∃ q ∈ directLimitCarrier T U A F, ZFSet.pair q y ∈ p.coneMap cone) ↔ + ∃ i x, x ∈ system.carrier i ∧ ZFSet.pair x y ∈ cone.map i := by + constructor + · rintro ⟨q, _, entry⟩ + obtain ⟨i, x, hx, _, xy⟩ := (p.coneMap_entry cone q y).1 entry + exact ⟨i, x, hx, xy⟩ + · rintro ⟨i, x, hx, xy⟩ + exact ⟨p.limitPoint i x, p.limitPoint_mem hx, (p.coneMap_at cone i hx y).2 xy⟩ + +theorem coneMap_onto {B : ZFSet.{u}} (coverage : cone.Covers B) : + ∀ y ∈ B, ∃ q ∈ directLimitCarrier T U A F, ZFSet.pair q y ∈ p.coneMap cone := + fun y hy => (p.coneMap_range cone y).2 (coverage y hy) + +theorem coneMap_unique {g : ZFSet.{u}} + (function : ZFSet.IsFunc (directLimitCarrier T U A F) Q g) + (triangles : ∀ i, relationCompose (system.carrier i) (directLimitCarrier T U A F) Q + (directLimitInclusion T U A F (p.key i)) g = cone.map i) : g = p.coneMap cone := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨q, hq, y, hy, rfl⟩ := ZFSet.mem_prod.1 (function.1 entry) + obtain ⟨i, x, hx, rfl⟩ := p.limitPoint_coverage hq + apply (p.coneMap_at cone i hx y).2 + rw [← triangles i] + exact (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨hx, hy, p.limitPoint i x, p.limitPoint_mem hx, + (p.inclusion_entry i x _).2 ⟨hx, rfl⟩, entry⟩ + · intro entry + obtain ⟨q, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (p.coneMap_subset cone entry) + obtain ⟨i, x, _, rfl, xy⟩ := (p.coneMap_entry cone q y).1 entry + rw [← triangles i] at xy + obtain ⟨_, _, q, _, inclusion, image⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 xy + obtain ⟨_, rfl⟩ := (p.inclusion_entry i x q).1 inclusion + exact image + +end PartitionPilot.Forcing.CodedDirectPresentation + +namespace PartitionPilot.Forcing.CodedDirectPresentation +open SetFormula +universe u v +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {system : CodedDirectSystem.{u} I} {T U A F Q : ZFSet.{u}} +variable (p : CodedDirectPresentation system T U A F) (cone : system.InjectiveCone Q) + +theorem coneMap_eq_indexedValueLift {G J : ZFSet.{u}} + (legs : ∀ i g, ZFSet.pair (p.key i) g ∈ G ↔ g = cone.map i) + (inclusions : ∀ i e, ZFSet.pair (p.key i) e ∈ J ↔ + e = directLimitInclusion T U A F (p.key i)) : + p.coneMap cone = indexedValueLift T U (directLimitCarrier T U A F) Q G J := by + apply ZFSet.ext + intro z + constructor + · intro entry + obtain ⟨q, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (p.coneMap_subset cone entry) + obtain ⟨i, x, hx, rfl, xy⟩ := (p.coneMap_entry cone q y).1 entry + exact (pair_mem_indexedValueLift _ _ _ _ _ _ _ _).2 + ⟨p.limitPoint_mem hx, (cone.entry_bounds xy).2, p.key i, p.key_mem i, + cone.map i, directLimitInclusion T U A F (p.key i), x, p.carrier_bound i hx, + (legs i _).2 rfl, (inclusions i _).2 rfl, + (p.inclusion_entry i x _).2 ⟨hx, rfl⟩, xy⟩ + · intro entry + obtain ⟨q, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (indexedValueLift_subset _ _ _ _ _ _ entry) + obtain ⟨_, _, k, hk, g, e, x, _, kg, ke, image, xy⟩ := + (pair_mem_indexedValueLift _ _ _ _ _ _ _ _).1 entry + obtain ⟨i, rfl⟩ := p.exists_key hk + obtain rfl := (legs i g).1 kg + obtain rfl := (inclusions i e).1 ke + obtain ⟨hx, rfl⟩ := (p.inclusion_entry i x q).1 image + exact (p.coneMap_at cone i hx y).2 xy + +theorem coneMap_ground (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {G : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) + (hA : A ∈ M.sets) (hF : F ∈ M.sets) (hQ : Q ∈ M.sets) (hG : G ∈ M.sets) + (family : FunctionGraphOn T G) (entries : ∀ i, ZFSet.pair (p.key i) (cone.map i) ∈ G) : + p.coneMap cone ∈ M.sets := by + let L := indexedCarrierLabels T U A + let E := directLimitRelation T U F L + let J := M.indexedClassInclusions T U L E + have hL : L ∈ M.sets := M.indexedCarrierLabels_mem pairing unions powers separation hT hU hA + have hE : E ∈ M.sets := M.directLimitRelation_mem pairing unions powers separation hT hU hF hL + have hClasses : directLimitCarrier T U A F ∈ M.sets := + M.equivalenceClasses_mem powers separation hL hE + have hJ : J ∈ M.sets := M.indexedClassInclusions_mem pairing unions powers separation hT hU hL hE + have legs (i : I) (g : ZFSet.{u}) : ZFSet.pair (p.key i) g ∈ G ↔ g = cone.map i := + ⟨fun entry => family.unique entry (entries i), fun equal => equal.symm ▸ entries i⟩ + have inclusions (i : I) (e : ZFSet.{u}) : ZFSet.pair (p.key i) e ∈ J ↔ + e = directLimitInclusion T U A F (p.key i) := by + exact (M.indexedClassInclusions_entries pairing unions powers separation hT hU hL hE + (p.key i) e).trans (and_iff_right (p.key_mem i)) + rw [p.coneMap_eq_indexedValueLift cone legs inclusions] + exact M.indexedValueLift_mem pairing unions powers separation hT hU hClasses hQ hG hJ + +theorem coneMap_injection_into {B : ZFSet.{u}} + (bound : ∀ i x y, ZFSet.pair x y ∈ cone.map i → y ∈ B) : + InjectionCode (directLimitCarrier T U A F) B (p.coneMap cone) := by + refine ⟨⟨?_, (p.coneMap_function cone).2⟩, (p.coneMap_injection cone).injective⟩ + intro z entry + obtain ⟨q, hq, y, _, rfl⟩ := ZFSet.mem_prod.1 (p.coneMap_subset cone entry) + obtain ⟨i, x, _, _, xy⟩ := (p.coneMap_entry cone q y).1 entry + exact ZFSet.pair_mem_prod.2 ⟨hq, bound i x y xy⟩ + +theorem coneMap_bijection_onto {B : ZFSet.{u}} + (bound : ∀ i x y, ZFSet.pair x y ∈ cone.map i → y ∈ B) (coverage : cone.Covers B) : + InjectionCode (directLimitCarrier T U A F) B (p.coneMap cone) ∧ + ∀ y ∈ B, ∃ q ∈ directLimitCarrier T U A F, ZFSet.pair q y ∈ p.coneMap cone := + ⟨p.coneMap_injection_into cone bound, p.coneMap_onto cone coverage⟩ + +end PartitionPilot.Forcing.CodedDirectPresentation + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def limitPointLabels : ZFSet.{u} := + indexedCarrierLabels run.indices run.carrierUnion run.carrierFamily + +noncomputable def limitPointRelation : ZFSet.{u} := + directLimitRelation run.indices run.carrierUnion run.pointMapFamily run.limitPointLabels + +noncomputable def limitPoints : ZFSet.{u} := + directLimitCarrier run.indices run.carrierUnion run.carrierFamily run.pointMapFamily + +noncomputable def limitPointMap (i : I) : ZFSet.{u} := + directLimitInclusion run.indices run.carrierUnion run.carrierFamily run.pointMapFamily (run.key i) + +noncomputable def limitPointInclusions : ZFSet.{u} := + M.indexedClassInclusions run.indices run.carrierUnion run.limitPointLabels run.limitPointRelation + +theorem limitPointLabels_ground : run.limitPointLabels ∈ M.sets := + M.indexedCarrierLabels_mem pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.carrierFamily_ground + +theorem limitPointRelation_ground : run.limitPointRelation ∈ M.sets := + M.directLimitRelation_mem pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.pointMapFamily_ground run.limitPointLabels_ground + +theorem limitPoints_ground : run.limitPoints ∈ M.sets := + M.equivalenceClasses_mem powers separation run.limitPointLabels_ground run.limitPointRelation_ground + +theorem limitPointMap_ground (i : I) : run.limitPointMap i ∈ M.sets := + M.indexedClassInclusion_mem pairing unions powers separation run.carrierUnion_ground + run.limitPointLabels_ground run.limitPointRelation_ground + (M.transitive run.indices_ground (ZFSet.mem_range.2 ⟨i, rfl⟩)) + +theorem limitPointInclusions_ground : run.limitPointInclusions ∈ M.sets := + M.indexedClassInclusions_mem pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.limitPointLabels_ground run.limitPointRelation_ground + +theorem limitPointMap_injection (i : I) : + InjectionCode (run.diagram.stage i).stage.carrier run.limitPoints (run.limitPointMap i) := + run.pointPresentation.inclusion_injection i + +theorem limitPointInclusions_function : FunctionGraphOn run.indices run.limitPointInclusions := + ⟨_, M.indexedClassInclusions_function pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.limitPointLabels_ground run.limitPointRelation_ground⟩ + +theorem limitPointInclusions_entry (i : I) (f : ZFSet.{u}) : + ZFSet.pair (run.key i) f ∈ run.limitPointInclusions ↔ f = run.limitPointMap i := by + exact (M.indexedClassInclusions_entries pairing unions powers separation (T := run.indices) + run.indices_ground run.carrierUnion_ground run.limitPointLabels_ground run.limitPointRelation_ground + (run.key i) f).trans (and_iff_right (show run.key i ∈ run.indices from ZFSet.mem_range.2 ⟨i, rfl⟩)) + +theorem limitPointMap_comp {i j : I} (before : i ≤ j) : + relationCompose (run.diagram.stage i).stage.carrier (run.diagram.stage j).stage.carrier + run.limitPoints (run.diagram.transition before).map.points + (run.limitPointMap j) = run.limitPointMap i := + run.pointPresentation.inclusion_comp before + +noncomputable def limitActorLabels : ZFSet.{u} := + indexedCarrierLabels run.indices run.actorUnion run.actorFamily + +noncomputable def limitActorRelation : ZFSet.{u} := + directLimitRelation run.indices run.actorUnion run.actorMapFamily run.limitActorLabels + +noncomputable def limitActors : ZFSet.{u} := + directLimitCarrier run.indices run.actorUnion run.actorFamily run.actorMapFamily + +noncomputable def limitActorMap (i : I) : ZFSet.{u} := + directLimitInclusion run.indices run.actorUnion run.actorFamily run.actorMapFamily (run.key i) + +noncomputable def limitActorInclusions : ZFSet.{u} := + M.indexedClassInclusions run.indices run.actorUnion run.limitActorLabels run.limitActorRelation + +theorem limitActorLabels_ground : run.limitActorLabels ∈ M.sets := + M.indexedCarrierLabels_mem pairing unions powers separation run.indices_ground + run.actorUnion_ground run.actorFamily_ground + +theorem limitActorRelation_ground : run.limitActorRelation ∈ M.sets := + M.directLimitRelation_mem pairing unions powers separation run.indices_ground + run.actorUnion_ground run.actorMapFamily_ground run.limitActorLabels_ground + +theorem limitActors_ground : run.limitActors ∈ M.sets := + M.equivalenceClasses_mem powers separation run.limitActorLabels_ground run.limitActorRelation_ground + +theorem limitActorMap_ground (i : I) : run.limitActorMap i ∈ M.sets := + M.indexedClassInclusion_mem pairing unions powers separation run.actorUnion_ground + run.limitActorLabels_ground run.limitActorRelation_ground + (M.transitive run.indices_ground (ZFSet.mem_range.2 ⟨i, rfl⟩)) + +theorem limitActorInclusions_ground : run.limitActorInclusions ∈ M.sets := + M.indexedClassInclusions_mem pairing unions powers separation run.indices_ground + run.actorUnion_ground run.limitActorLabels_ground run.limitActorRelation_ground + +theorem limitActorMap_injection (i : I) : + InjectionCode (run.diagram.stage i).stage.actors run.limitActors (run.limitActorMap i) := + run.actorPresentation.inclusion_injection i + +theorem limitActorInclusions_function : FunctionGraphOn run.indices run.limitActorInclusions := + ⟨_, M.indexedClassInclusions_function pairing unions powers separation run.indices_ground + run.actorUnion_ground run.limitActorLabels_ground run.limitActorRelation_ground⟩ + +theorem limitActorInclusions_entry (i : I) (f : ZFSet.{u}) : + ZFSet.pair (run.key i) f ∈ run.limitActorInclusions ↔ f = run.limitActorMap i := by + exact (M.indexedClassInclusions_entries pairing unions powers separation (T := run.indices) + run.indices_ground run.actorUnion_ground run.limitActorLabels_ground run.limitActorRelation_ground + (run.key i) f).trans (and_iff_right (show run.key i ∈ run.indices from ZFSet.mem_range.2 ⟨i, rfl⟩)) + +theorem limitActorMap_comp {i j : I} (before : i ≤ j) : + relationCompose (run.diagram.stage i).stage.actors (run.diagram.stage j).stage.actors + run.limitActors (run.diagram.transition before).map.actors + (run.limitActorMap j) = run.limitActorMap i := + run.actorPresentation.inclusion_comp before + +def LimitMul (g h k : ZFSet.{u}) : Prop := + ∃ i a b c, a ∈ (run.diagram.stage i).stage.actors ∧ b ∈ (run.diagram.stage i).stage.actors ∧ + c ∈ (run.diagram.stage i).stage.actors ∧ g = run.actorPresentation.limitPoint i a ∧ + h = run.actorPresentation.limitPoint i b ∧ k = run.actorPresentation.limitPoint i c ∧ + ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication + +def LimitInv (g h : ZFSet.{u}) : Prop := + ∃ i a b, a ∈ (run.diagram.stage i).stage.actors ∧ b ∈ (run.diagram.stage i).stage.actors ∧ + g = run.actorPresentation.limitPoint i a ∧ h = run.actorPresentation.limitPoint i b ∧ + ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse + +theorem limitMul_bounds {g h k : ZFSet.{u}} (mul : run.LimitMul g h k) : + g ∈ run.limitActors ∧ h ∈ run.limitActors ∧ k ∈ run.limitActors := by + obtain ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, _⟩ := mul + exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb, + run.actorPresentation.limitPoint_mem hc⟩ + +theorem limitInv_bounds {g h : ZFSet.{u}} (inv : run.LimitInv g h) : + g ∈ run.limitActors ∧ h ∈ run.limitActors := by + obtain ⟨i, a, b, ha, hb, rfl, rfl, _⟩ := inv + exact ⟨run.actorPresentation.limitPoint_mem ha, run.actorPresentation.limitPoint_mem hb⟩ + +theorem limitMul_total {g h : ZFSet.{u}} (hg : g ∈ run.limitActors) (hh : h ∈ run.limitActors) : + ∃ k ∈ run.limitActors, run.LimitMul g h k := by + obtain ⟨i, a, b, ha, hb, rfl, rfl⟩ := run.actorPresentation.pair_coverage hg hh + obtain ⟨c, entry, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 + (ZFSet.pair a b) (ZFSet.pair_mem_prod.2 ⟨ha, hb⟩) + have hc := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 entry)).2 + exact ⟨run.actorPresentation.limitPoint i c, run.actorPresentation.limitPoint_mem hc, + i, a, b, c, ha, hb, hc, rfl, rfl, rfl, entry⟩ + +theorem limitInv_total {g : ZFSet.{u}} (hg : g ∈ run.limitActors) : + ∃ h ∈ run.limitActors, run.LimitInv g h := by + obtain ⟨i, a, ha, rfl⟩ := run.actorPresentation.limitPoint_coverage hg + obtain ⟨b, entry, _⟩ := (run.diagram.stage i).stage.group_code.inv_function.2 a ha + have hb := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.inv_function.1 entry)).2 + exact ⟨run.actorPresentation.limitPoint i b, run.actorPresentation.limitPoint_mem hb, + i, a, b, ha, hb, rfl, rfl, entry⟩ + +theorem limitMul_unique {g h k l : ZFSet.{u}} + (first : run.LimitMul g h k) (second : run.LimitMul g h l) : k = l := by + obtain ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, product⟩ := first + obtain ⟨j, d, e, f, hd, he, hf, equalA, equalB, rfl, product'⟩ := second + obtain ⟨m, im, jm⟩ := run.common_upper i j + obtain ⟨a', aa'⟩ := run.actorSystem.map_entry_total im ha + obtain ⟨b', bb'⟩ := run.actorSystem.map_entry_total im hb + obtain ⟨c', cc'⟩ := run.actorSystem.map_entry_total im hc + obtain ⟨d', dd'⟩ := run.actorSystem.map_entry_total jm hd + obtain ⟨e', ee'⟩ := run.actorSystem.map_entry_total jm he + obtain ⟨f', ff'⟩ := run.actorSystem.map_entry_total jm hf + have sameA := (run.actorSystem.related_iff_common_images im jm aa' dd').1 + ((run.actorPresentation.limitPoint_eq_iff_related ha hd).1 equalA) + have sameB := (run.actorSystem.related_iff_common_images im jm bb' ee').1 + ((run.actorPresentation.limitPoint_eq_iff_related hb he).1 equalB) + subst d' + subst e' + have left := (run.diagram.transition im).map.group_embedding.mul a b c a' b' c' product aa' bb' cc' + have right := (run.diagram.transition jm).map.group_embedding.mul d e f a' b' f' product' dd' ee' ff' + have sameC : c' = f' := + (show FunctionGraphOn (ZFSet.prod (run.diagram.stage m).stage.actors (run.diagram.stage m).stage.actors) + (run.diagram.stage m).stage.multiplication from + ⟨_, (run.diagram.stage m).stage.group_code.mul_function⟩).unique left right + apply (run.actorPresentation.limitPoint_eq_iff_related hc hf).2 + exact ⟨m, im, jm, c', cc', sameC.symm ▸ ff'⟩ + +theorem limitInv_unique {g h k : ZFSet.{u}} + (first : run.LimitInv g h) (second : run.LimitInv g k) : h = k := by + obtain ⟨i, a, b, ha, hb, rfl, rfl, inverse⟩ := first + obtain ⟨j, c, d, hc, hd, equal, rfl, inverse'⟩ := second + obtain ⟨m, im, jm⟩ := run.common_upper i j + obtain ⟨a', aa'⟩ := run.actorSystem.map_entry_total im ha + obtain ⟨b', bb'⟩ := run.actorSystem.map_entry_total im hb + obtain ⟨c', cc'⟩ := run.actorSystem.map_entry_total jm hc + obtain ⟨d', dd'⟩ := run.actorSystem.map_entry_total jm hd + have sameA := (run.actorSystem.related_iff_common_images im jm aa' cc').1 + ((run.actorPresentation.limitPoint_eq_iff_related ha hc).1 equal) + subst c' + have left := (run.diagram.transition im).map.group_embedding.map_inv + (run.diagram.stage i).stage.group_code (run.diagram.stage m).stage.group_code inverse aa' bb' + have right := (run.diagram.transition jm).map.group_embedding.map_inv + (run.diagram.stage j).stage.group_code (run.diagram.stage m).stage.group_code inverse' cc' dd' + have sameB : b' = d' := + (show FunctionGraphOn (run.diagram.stage m).stage.actors (run.diagram.stage m).stage.inverse from + ⟨_, (run.diagram.stage m).stage.group_code.inv_function⟩).unique left right + apply (run.actorPresentation.limitPoint_eq_iff_related hb hd).2 + exact ⟨m, im, jm, b', bb', sameB.symm ▸ dd'⟩ + +theorem limitMul_at (i : I) {a b c : ZFSet.{u}} + (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) + (hc : c ∈ (run.diagram.stage i).stage.actors) : + run.LimitMul (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b) + (run.actorPresentation.limitPoint i c) ↔ + ZFSet.pair (ZFSet.pair a b) c ∈ (run.diagram.stage i).stage.multiplication := by + constructor + · intro product + obtain ⟨d, entry, _⟩ := (run.diagram.stage i).stage.group_code.mul_function.2 + (ZFSet.pair a b) (ZFSet.pair_mem_prod.2 ⟨ha, hb⟩) + have hd := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.mul_function.1 entry)).2 + have canonical : run.LimitMul (run.actorPresentation.limitPoint i a) + (run.actorPresentation.limitPoint i b) (run.actorPresentation.limitPoint i d) := + ⟨i, a, b, d, ha, hb, hd, rfl, rfl, rfl, entry⟩ + have equal := (run.actorPresentation.limitPoint_same_iff hc hd).1 (run.limitMul_unique product canonical) + subst d + exact entry + · intro entry + exact ⟨i, a, b, c, ha, hb, hc, rfl, rfl, rfl, entry⟩ + +theorem limitInv_at (i : I) {a b : ZFSet.{u}} + (ha : a ∈ (run.diagram.stage i).stage.actors) (hb : b ∈ (run.diagram.stage i).stage.actors) : + run.LimitInv (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i b) ↔ + ZFSet.pair a b ∈ (run.diagram.stage i).stage.inverse := by + constructor + · intro inverse + obtain ⟨c, entry, _⟩ := (run.diagram.stage i).stage.group_code.inv_function.2 a ha + have hc := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.group_code.inv_function.1 entry)).2 + have canonical : run.LimitInv (run.actorPresentation.limitPoint i a) (run.actorPresentation.limitPoint i c) := + ⟨i, a, c, ha, hc, rfl, rfl, entry⟩ + have equal := (run.actorPresentation.limitPoint_same_iff hb hc).1 (run.limitInv_unique inverse canonical) + subst c + exact entry + · intro entry + exact ⟨i, a, b, ha, hb, rfl, rfl, entry⟩ + +noncomputable def limitIdentity (i : I) : ZFSet.{u} := + run.actorPresentation.limitPoint i (run.diagram.stage i).stage.identity + +theorem limitIdentity_mem (i : I) : run.limitIdentity i ∈ run.limitActors := + run.actorPresentation.limitPoint_mem (run.diagram.stage i).stage.group_code.identity_mem + +theorem limitIdentity_eq (i j : I) : run.limitIdentity i = run.limitIdentity j := by + obtain ⟨k, ik, jk⟩ := run.common_upper i j + apply (run.actorPresentation.limitPoint_eq_iff_related + (run.diagram.stage i).stage.group_code.identity_mem (run.diagram.stage j).stage.group_code.identity_mem).2 + exact ⟨k, ik, jk, (run.diagram.stage k).stage.identity, + (run.diagram.transition ik).map.group_embedding.one, (run.diagram.transition jk).map.group_embedding.one⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitSizes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitSizes.lean index 366a4374337bf3f60b5e16bb275993a0b043477d..7cceaca38b1368dbe4c4d7eaa3a237a80384a4ac 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitSizes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixLimitSizes.lean @@ -1,96 +1,96 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowIndexedCarriers -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitGroupLaws - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) -variable (indices : GroundBelow M run.indices K) -include choice hK standard indices - -theorem carrierUnion_below : GroundBelow M run.carrierUnion K := by - have conditions := standard.to_conditions pairing unions powers separation hK - change GroundBelow M (ZFSet.sUnion (ZFSet.range (fun i => (run.diagram.stage i).stage.carrier))) K - rw [familyCodeGraph_valueRange_eq run.key _] - apply GroundBelow.indexed_sUnion pairing unions powers separation choice run.indices_ground - (M.union_mem unions (M.union_mem unions run.carrierFamily_ground)) run.carrierFamily_ground hK - conditions.1 conditions.2.2.1 conditions.2.2.2 indices run.carrierFamily_function.to_isFunc - intro i A entry - obtain ⟨j, equal⟩ := (mem_familyCodeGraph run.key - (fun j => (run.diagram.stage j).stage.carrier) _).1 entry - have value : A = (run.diagram.stage j).stage.carrier := (ZFSet.pair_inj.1 equal).2.symm - rw [value] - simpa only [run.linked_main] using (run.linked j).invariant.points_small - -theorem actorUnion_below : GroundBelow M run.actorUnion K := by - have conditions := standard.to_conditions pairing unions powers separation hK - change GroundBelow M (ZFSet.sUnion (ZFSet.range (fun i => (run.diagram.stage i).stage.actors))) K - rw [familyCodeGraph_valueRange_eq run.key _] - apply GroundBelow.indexed_sUnion pairing unions powers separation choice run.indices_ground - (M.union_mem unions (M.union_mem unions run.actorFamily_ground)) run.actorFamily_ground hK - conditions.1 conditions.2.2.1 conditions.2.2.2 indices run.actorFamily_function.to_isFunc - intro i A entry - obtain ⟨j, equal⟩ := (mem_familyCodeGraph run.key - (fun j => (run.diagram.stage j).stage.actors) _).1 entry - have value : A = (run.diagram.stage j).stage.actors := (ZFSet.pair_inj.1 equal).2.symm - rw [value] - simpa only [run.linked_main] using (run.linked j).invariant.actors_small - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) -variable (indices : GroundBelow M run.indices K) -include choice hK standard indices - -theorem limitPointLabels_below : GroundBelow M run.limitPointLabels K := by - have conditions := standard.to_conditions pairing unions powers separation hK - exact GroundBelow.indexedCarrierLabels pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.carrierFamily_ground hK conditions.1 conditions.2.2.2 indices - (run.carrierUnion_below choice hK standard indices) - -theorem limitActorLabels_below : GroundBelow M run.limitActorLabels K := by - have conditions := standard.to_conditions pairing unions powers separation hK - exact GroundBelow.indexedCarrierLabels pairing unions powers separation run.indices_ground - run.actorUnion_ground run.actorFamily_ground hK conditions.1 conditions.2.2.2 indices - (run.actorUnion_below choice hK standard indices) - -theorem limitPoints_below : GroundBelow M run.limitPoints K := by - have conditions := standard.to_conditions pairing unions powers separation hK - exact GroundBelow.indexedCarrierClasses pairing unions powers separation run.indices_ground - run.carrierUnion_ground run.carrierFamily_ground run.limitPointRelation_ground hK - conditions.1 conditions.2.2.2 indices (run.carrierUnion_below choice hK standard indices) - -theorem limitActors_below : GroundBelow M run.limitActors K := by - have conditions := standard.to_conditions pairing unions powers separation hK - exact GroundBelow.indexedCarrierClasses pairing unions powers separation run.indices_ground - run.actorUnion_ground run.actorFamily_ground run.limitActorRelation_ground hK - conditions.1 conditions.2.2.2 indices (run.actorUnion_below choice hK standard indices) - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowIndexedCarriers +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitGroupLaws + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) +variable (indices : GroundBelow M run.indices K) +include choice hK standard indices + +theorem carrierUnion_below : GroundBelow M run.carrierUnion K := by + have conditions := standard.to_conditions pairing unions powers separation hK + change GroundBelow M (ZFSet.sUnion (ZFSet.range (fun i => (run.diagram.stage i).stage.carrier))) K + rw [familyCodeGraph_valueRange_eq run.key _] + apply GroundBelow.indexed_sUnion pairing unions powers separation choice run.indices_ground + (M.union_mem unions (M.union_mem unions run.carrierFamily_ground)) run.carrierFamily_ground hK + conditions.1 conditions.2.2.1 conditions.2.2.2 indices run.carrierFamily_function.to_isFunc + intro i A entry + obtain ⟨j, equal⟩ := (mem_familyCodeGraph run.key + (fun j => (run.diagram.stage j).stage.carrier) _).1 entry + have value : A = (run.diagram.stage j).stage.carrier := (ZFSet.pair_inj.1 equal).2.symm + rw [value] + simpa only [run.linked_main] using (run.linked j).invariant.points_small + +theorem actorUnion_below : GroundBelow M run.actorUnion K := by + have conditions := standard.to_conditions pairing unions powers separation hK + change GroundBelow M (ZFSet.sUnion (ZFSet.range (fun i => (run.diagram.stage i).stage.actors))) K + rw [familyCodeGraph_valueRange_eq run.key _] + apply GroundBelow.indexed_sUnion pairing unions powers separation choice run.indices_ground + (M.union_mem unions (M.union_mem unions run.actorFamily_ground)) run.actorFamily_ground hK + conditions.1 conditions.2.2.1 conditions.2.2.2 indices run.actorFamily_function.to_isFunc + intro i A entry + obtain ⟨j, equal⟩ := (mem_familyCodeGraph run.key + (fun j => (run.diagram.stage j).stage.actors) _).1 entry + have value : A = (run.diagram.stage j).stage.actors := (ZFSet.pair_inj.1 equal).2.symm + rw [value] + simpa only [run.linked_main] using (run.linked j).invariant.actors_small + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) +variable (indices : GroundBelow M run.indices K) +include choice hK standard indices + +theorem limitPointLabels_below : GroundBelow M run.limitPointLabels K := by + have conditions := standard.to_conditions pairing unions powers separation hK + exact GroundBelow.indexedCarrierLabels pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.carrierFamily_ground hK conditions.1 conditions.2.2.2 indices + (run.carrierUnion_below choice hK standard indices) + +theorem limitActorLabels_below : GroundBelow M run.limitActorLabels K := by + have conditions := standard.to_conditions pairing unions powers separation hK + exact GroundBelow.indexedCarrierLabels pairing unions powers separation run.indices_ground + run.actorUnion_ground run.actorFamily_ground hK conditions.1 conditions.2.2.2 indices + (run.actorUnion_below choice hK standard indices) + +theorem limitPoints_below : GroundBelow M run.limitPoints K := by + have conditions := standard.to_conditions pairing unions powers separation hK + exact GroundBelow.indexedCarrierClasses pairing unions powers separation run.indices_ground + run.carrierUnion_ground run.carrierFamily_ground run.limitPointRelation_ground hK + conditions.1 conditions.2.2.2 indices (run.carrierUnion_below choice hK standard indices) + +theorem limitActors_below : GroundBelow M run.limitActors K := by + have conditions := standard.to_conditions pairing unions powers separation hK + exact GroundBelow.indexedCarrierClasses pairing unions powers separation run.indices_ground + run.actorUnion_ground run.actorFamily_ground run.limitActorRelation_ground hK + conditions.1 conditions.2.2.2 indices (run.actorUnion_below choice hK standard indices) + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixOmegaOneAppend.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixOmegaOneAppend.lean index c8eb791c7739a21b494760d7698e4d218b9d797d..54cfb50aa8ed6a73c29f98c831f3106ad78d8deb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixOmegaOneAppend.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixOmegaOneAppend.lean @@ -1,62 +1,62 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowTerms - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_rankedAppendLimit_of_indices_mem (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indices : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) : - ∃ data : run.FixedTopStage i₀, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ - target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ - target.serial.code ∈ level.validChronologies C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (∀ i : I, - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ - (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → - ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ - ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by - obtain ⟨data, target, extended, result⟩ := run.exists_rankedAppendLimit i₀ collection infinite choice - columns_eq (M.groundOmegaOne_member_countable pairing unions powers separation collection infinite indices) - oldRank hK standard level - have index_eq := result.2.2.2.2.1 - refine ⟨data, target, extended, result.1, result.2.1, result.2.2.1, result.2.2.2.1, - index_eq, ?_, result.2.2.2.2.2⟩ - rw [index_eq] - exact M.groundOmegaOne_successor pairing unions powers separation collection infinite indices - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowTerms + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_rankedAppendLimit_of_indices_mem (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indices : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) : + ∃ data : run.FixedTopStage i₀, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ + target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ + target.serial.code ∈ level.validChronologies C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (∀ i : I, + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ + (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → + ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ + ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by + obtain ⟨data, target, extended, result⟩ := run.exists_rankedAppendLimit i₀ collection infinite choice + columns_eq (M.groundOmegaOne_member_countable pairing unions powers separation collection infinite indices) + oldRank hK standard level + have index_eq := result.2.2.2.2.1 + refine ⟨data, target, extended, result.1, result.2.1, result.2.2.1, result.2.2.2.1, + index_eq, ?_, result.2.2.2.2.2⟩ + rw [index_eq] + exact M.groundOmegaOne_successor pairing unions powers separation collection infinite indices + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPreservedSeeds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPreservedSeeds.lean index ce31568fd66c4e4e568eb5a4bb17aec5e457d31c..b792ec5ad0a04a0d008cd82de8b7bc4087cb70fb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPreservedSeeds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPreservedSeeds.lean @@ -1,478 +1,478 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport -import OAI.SetTheory.PartitionPrinciple.Geometry.OldProfilePreservationComposition -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOmegaOneTaskBearingSuccessorFunction - -namespace OAI - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {I : Type v} [Small.{u} I] [Preorder I] [Finite I] - -local instance : Finite (MainTransitionIndex I) := by - classical - let := Fintype.ofFinite I - infer_instance - -noncomputable def ofFinite (key : I → ZFSet.{u}) (injective : Function.Injective key) - (order : ∀ i j, i ≤ j ↔ key i = key j ∨ key i ∈ key j) - (ground : ZFSet.range key ∈ M.sets) (ordinal : ordinalSetProperty (ZFSet.range key)) - (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) - (linked : I → GroundLinkedMainStage M K Labels C D rD) - (same : ∀ i, (linked i).main = diagram.stage i) (coverage : diagram.CoversOldBirths) : - GroundMainPrefix M K Labels C D rD pairing unions powers separation I where - key := key - key_injective := injective - key_order := order - indices_ground := ground - indices_ordinal := ordinal - diagram := diagram - linked := linked - linked_main := same - coverage := coverage - stages_ground := familyCodeGraph_finite_ground pairing unions ⟨_, ground⟩ key _ - (fun i => M.transitive ground (ZFSet.mem_range.2 ⟨i, rfl⟩)) - (fun i => (linked i).code_ground pairing) - transitions_ground := familyCodeGraph_finite_ground pairing unions ⟨_, ground⟩ _ _ - (fun p => M.orderedPair_mem pairing - (M.transitive ground (ZFSet.mem_range.2 ⟨p.val.2, rfl⟩)) - (M.transitive ground (ZFSet.mem_range.2 ⟨p.val.1, rfl⟩))) - (fun p => (diagram.transition p.property).map.code_mem pairing) - -variable {pairing unions powers separation} -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) -variable (conditions : GroundInaccessibleConditions M K) -variable (keys : ∀ i, ZFSet.rank (run.key i) < ZFSet.rank K) -include infinite hK conditions keys - -theorem finite_stageGraph_rank_lt : ZFSet.rank run.stageGraph < ZFSet.rank K := - familyCodeGraph_finite_rank_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) - run.key _ keys (fun i => (run.linked i).code_rank_lt pairing unions powers separation infinite hK conditions) - -omit keys [Finite I] in -theorem transition_code_rank_lt {i j : I} (before : i ≤ j) : - ZFSet.rank (run.diagram.transition before).map.code < ZFSet.rank K := by - have invariants (k : I) : (run.diagram.stage k).Invariant K Labels := - run.linked_main k ▸ (run.linked k).invariant - exact (run.diagram.transition before).map.code_rank_lt_inaccessible - pairing unions powers separation infinite hK conditions - (invariants i).points_rank (invariants j).points_rank - (invariants i).actors_rank (invariants j).actors_rank - -theorem finite_transitionGraph_rank_lt : ZFSet.rank run.transitionGraph < ZFSet.rank K := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - exact familyCodeGraph_finite_rank_lt limit _ _ - (fun p => rank_orderedPair_lt limit (keys p.val.2) (keys p.val.1)) - (fun p => run.transition_code_rank_lt infinite hK conditions p.property) - -theorem finite_code_rank_lt : ZFSet.rank run.code < ZFSet.rank K := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - exact rank_nonemptyTupleCode_lt limit 2 _ - (Fin.cases (rank_finiteCodeRange_lt limit run.key keys) - (Fin.cases (run.finite_stageGraph_rank_lt infinite hK conditions keys) - (fun _ => run.finite_transitionGraph_rank_lt infinite hK conditions keys))) - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (first second : GroundLinkedMainStage M K Labels C D rD) -variable (step : GroundChronologicalMainTransition first.main second.main) -variable (coverage : step.CoversOldBirths) - -noncomputable def twoStage : - GroundMainPrefix M K Labels C D rD pairing unions powers separation (Fin 2) := by - have empty : (∅ : ZFSet.{u}) ∈ M.sets := - M.empty_mem ⟨first.main.cutoff, first.main.cutoff_ground⟩ - have one := M.insert_mem pairing unions empty empty - have two := M.insert_mem pairing unions one one - have ground : ZFSet.range (@finiteMainIndexKey.{u} 2) ∈ M.sets := by - simpa only [finiteMainIndexKey_range, natSetCode_succ, natSetCode_zero] using two - have ordinal : ordinalSetProperty (ZFSet.range (@finiteMainIndexKey.{u} 2)) := by - rw [finiteMainIndexKey_range] - exact ordinalSetProperty_succ (ordinalSetProperty_succ ordinalSetProperty_empty) - apply ofFinite pairing unions powers separation finiteMainIndexKey - (finiteMainIndexKey_injective 2) finiteMainIndexKey_order ground ordinal - (GroundChronologicalMainDiagram.twoStage pairing unions powers separation step) - (Fin.cases first (fun _ => second)) - · intro i - cases i using Fin.cases <;> rfl - · exact GroundChronologicalMainDiagram.twoStage_coversOldBirths - pairing unions powers separation step coverage - -theorem twoStage_indices : - (twoStage pairing unions powers separation first second step coverage).indices = natSetCode 2 := - finiteMainIndexKey_range 2 - -theorem twoStage_linked_zero : - (twoStage pairing unions powers separation first second step coverage).linked 0 = first := rfl - -theorem twoStage_linked_one : - (twoStage pairing unions powers separation first second step coverage).linked 1 = second := rfl - -theorem twoStage_stage_zero : - (twoStage pairing unions powers separation first second step coverage).diagram.stage 0 = first.main := rfl - -theorem twoStage_stage_one : - (twoStage pairing unions powers separation first second step coverage).diagram.stage 1 = second.main := rfl - -theorem twoStage_transition_zero_one : - (twoStage pairing unions powers separation first second step coverage).diagram.transition - (show (0 : Fin 2) ≤ 1 from by decide) = step := rfl - -theorem twoStage_stageGraph_zero (z : ZFSet.{u}) : - ZFSet.pair (natSetCode 0) z ∈ - (twoStage pairing unions powers separation first second step coverage).stageGraph ↔ z = first.code := - (twoStage pairing unions powers separation first second step coverage).stageGraph_entry 0 z - -theorem twoStage_stageGraph_one (z : ZFSet.{u}) : - ZFSet.pair (natSetCode 1) z ∈ - (twoStage pairing unions powers separation first second step coverage).stageGraph ↔ z = second.code := - (twoStage pairing unions powers separation first second step coverage).stageGraph_entry 1 z - -theorem twoStage_transitionGraph_zero_one (z : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (natSetCode 1) (natSetCode 0)) z ∈ - (twoStage pairing unions powers separation first second step coverage).transitionGraph ↔ z = step.map.code := - (twoStage pairing unions powers separation first second step coverage).transitionGraph_entry - (show (0 : Fin 2) ≤ 1 from by decide) z - -theorem twoStage_code_rank_lt (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : - ZFSet.rank (twoStage pairing unions powers separation first second step coverage).code < ZFSet.rank K := by - apply (twoStage pairing unions powers separation first second step coverage).finite_code_rank_lt - infinite hK conditions - intro i - exact rank_natSetCode_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) i.val - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace GroundChronologicalMainTransition -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {source middle target first second : GroundChronologicalMainStage M C D rD} - -def PreservesOldProfiles (transition : GroundChronologicalMainTransition source target) : Prop := - OldProfilePreservationCode source.stage.carrier source.stage.order source.stage.meetGraph - target.stage.carrier target.stage.order target.stage.meetGraph transition.map.points - (M.groundPower source.stage.carrier) - -theorem identity_preservesOldProfiles - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (stage : GroundChronologicalMainStage M C D rD) : - (identity pairing unions powers separation stage).PreservesOldProfiles := - OldProfilePreservationCode.identity stage.stage.carrier stage.stage.order stage.stage.meetGraph - (M.groundPower stage.stage.carrier) - -theorem comp_preservesOldProfiles - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (left : GroundChronologicalMainTransition source middle) - (right : GroundChronologicalMainTransition middle target) - (first : left.PreservesOldProfiles) (second : right.PreservesOldProfiles) : - (left.comp pairing unions powers separation right).PreservesOldProfiles := - OldProfilePreservationCode.comp_ground M separation first second middle.stage.carrier_ground - left.map.points_ground - -theorem retargetEq_preservesOldProfiles_iff - (transition : GroundChronologicalMainTransition source target) - (sourceEqual : source = first) (targetEqual : target = second) : - (transition.retargetEq sourceEqual targetEqual).PreservesOldProfiles ↔ transition.PreservesOldProfiles := by - cases sourceEqual - cases targetEqual - rfl - -end GroundChronologicalMainTransition - -namespace TaskBearingMainSuccessorCode -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target : GroundLinkedMainStage M K Labels C D rD} -variable {transition : GroundChronologicalMainTransition source.main target.main} - -theorem preservesOldProfiles - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) : transition.PreservesOldProfiles := - code.old_profiles_on_linked - -end TaskBearingMainSuccessorCode -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialTwoStageMainPrefix - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, - ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - ∃ first second : GroundLinkedMainStage M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode), - ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), - first.main = seed.source ∧ second.main = certificate.target ∧ - first.serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - second.serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - run.indices = natSetCode 2 ∧ run.code ∈ M.sets ∧ ZFSet.rank run.code < ZFSet.rank K ∧ - run.linked 0 = first ∧ run.linked 1 = second ∧ - run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ - (∀ z, ZFSet.pair (natSetCode 0) z ∈ run.stageGraph ↔ z = first.code) ∧ - (∀ z, ZFSet.pair (natSetCode 1) z ∈ run.stageGraph ↔ z = second.code) ∧ - (∀ z, ZFSet.pair (ZFSet.pair (natSetCode 1) (natSetCode 0)) z ∈ run.transitionGraph ↔ - z = certificate.transition.map.code) ∧ - (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.points = - certificate.transition.map.points ∧ - (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.actors = - certificate.transition.map.actors := by - dsimp only - obtain ⟨level, seed, certificate, initial, successor, _candidateGround, - _initialGround, initialRank, initialMember, initialAgreement, - _successorGround, successorRank, successorMember, successorAgreement, - targetInvariant, _transitionRank, _terminal⟩ := - M.exists_groundInitialMainSeedSuccessorRanked pairing unions powers separation - collection infinite choice hK standard - let first : GroundLinkedMainStage M K - (M.groundOmegaOne pairing unions powers separation collection infinite) - (M.groundOmegaOne pairing unions powers separation collection infinite) - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) := - ⟨seed.source, initial, initialAgreement, seed.invariant, initialRank⟩ - let second : GroundLinkedMainStage M K - (M.groundOmegaOne pairing unions powers separation collection infinite) - (M.groundOmegaOne pairing unions powers separation collection infinite) - (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) := - ⟨certificate.target, successor, successorAgreement, targetInvariant, successorRank⟩ - let run := GroundMainPrefix.twoStage pairing unions powers separation first second - certificate.transition certificate.coversOldBirths - have conditions := standard.to_conditions pairing unions powers separation hK - exact ⟨level, seed, certificate, first, second, run, rfl, rfl, initialMember, successorMember, - GroundMainPrefix.twoStage_indices pairing unions powers separation first second - certificate.transition certificate.coversOldBirths, - run.code_ground, - GroundMainPrefix.twoStage_code_rank_lt pairing unions powers separation first second - certificate.transition certificate.coversOldBirths infinite hK conditions, - rfl, rfl, rfl, rfl, - GroundMainPrefix.twoStage_stageGraph_zero pairing unions powers separation first second - certificate.transition certificate.coversOldBirths, - GroundMainPrefix.twoStage_stageGraph_one pairing unions powers separation first second - certificate.transition certificate.coversOldBirths, - GroundMainPrefix.twoStage_transitionGraph_zero_one pairing unions powers separation first second - certificate.transition certificate.coversOldBirths, - rfl, rfl⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -def PreservesOldProfiles : Prop := - ∀ (i j : I) (before : i ≤ j), (run.diagram.transition before).PreservesOldProfiles - -theorem restrict_preservesOldProfiles (preserved : run.PreservesOldProfiles) - {S : ZFSet.{u}} (subset : S ⊆ run.indices) (ground : S ∈ M.sets) - (ordinal : ordinalSetProperty S) : - (run.restrict subset ground ordinal).PreservesOldProfiles := by - intro i j before - exact preserved i.val j.val before - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (Fin 2)) - -theorem zero_key_of_two_indices (indices : run.indices = natSetCode 2) : - run.key 0 = natSetCode 0 := by - have member : natSetCode 0 ∈ run.indices := by - rw [indices] - exact (natSetCode_mem_iff 0 2).2 (by decide) - obtain ⟨i, equal⟩ := ZFSet.mem_range.1 member - obtain equalKeys | below := (run.key_order 0 i).1 (Fin.zero_le i) - · exact equalKeys.trans equal - · rw [equal] at below - exact False.elim (ZFSet.notMem_empty _ below) - -theorem exists_initialRestriction (indices : run.indices = natSetCode 2) - (preserved : run.PreservesOldProfiles) - {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (oldRank : ZFSet.rank run.code < o) : - ∃ initial : GroundMainPrefix M K Labels C D rD pairing unions powers separation - {i : Fin 2 // run.key i ∈ natSetCode 1}, - initial.indices = natSetCode 1 ∧ initial.PreservesOldProfiles ∧ - ZFSet.rank initial.code < o ∧ - initial.stageGraph = graphRestriction (natSetCode 1) run.stageGraph ∧ - initial.transitionGraph = graphRestriction (chronologyPairs (natSetCode 1)) run.transitionGraph ∧ - (∀ i, initial.linked i = run.linked i.val) ∧ - ∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = run.diagram.stage 0 := by - have oneMember : natSetCode 1 ∈ run.indices := by - rw [indices] - exact (natSetCode_mem_iff 1 2).2 (by decide) - have subset : natSetCode 1 ⊆ run.indices := by - intro x hx - rw [indices] - obtain ⟨n, hn, rfl⟩ := (mem_natSetCode x 1).1 hx - exact (natSetCode_mem_iff n 2).2 (by omega) - have ground := M.transitive run.indices_ground oneMember - have ordinal := ordinalSetProperty_member run.indices_ordinal oneMember - let initial := run.restrict subset ground ordinal - have zeroMember : run.key 0 ∈ natSetCode 1 := by - rw [run.zero_key_of_two_indices indices] - exact (natSetCode_mem_iff 0 1).2 (by decide) - exact ⟨initial, run.restrict_indices subset ground ordinal, - run.restrict_preservesOldProfiles preserved subset ground ordinal, - run.restrict_code_rank_lt subset ground ordinal limit oldRank, - run.restrict_stageGraph subset ground ordinal, - run.restrict_transitionGraph subset ground ordinal, fun _ => rfl, - ⟨0, zeroMember⟩, run.zero_key_of_two_indices indices, rfl⟩ - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem appendCone_preservesOldProfiles (preserved : run.PreservesOldProfiles) - (target : GroundLinkedMainStage M K Labels C D rD) (cone : run.diagram.Cone target.main) - {row : ZFSet.{u}} (ground : row ∈ M.sets) - (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) - (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) - (covered : cone.append.CoversOldBirths) (legs : ∀ i, (cone.leg i).PreservesOldProfiles) : - (run.appendCone target cone ground function entries covered).PreservesOldProfiles := by - intro i j before - cases i with - | top => - cases j with - | top => - exact GroundChronologicalMainTransition.identity_preservesOldProfiles - pairing unions powers separation target.main - | coe j => exact False.elim (WithTop.not_top_le_coe j before) - | coe i => - cases j with - | top => exact legs i - | coe j => exact preserved i j (WithTop.coe_le_coe.mp before) - -theorem appendLast_preservesOldProfiles (preserved : run.PreservesOldProfiles) - (last : I) (greatest : ∀ i, i ≤ last) - (target : GroundLinkedMainStage M K Labels C D rD) - (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) - (covered : step.CoversOldBirths) (stepPreserved : step.PreservesOldProfiles) : - (run.appendLast last greatest target step covered).PreservesOldProfiles := by - intro i j before - cases i with - | top => - cases j with - | top => - exact GroundChronologicalMainTransition.identity_preservesOldProfiles - pairing unions powers separation target.main - | coe j => exact False.elim (WithTop.not_top_le_coe j before) - | coe i => - cases j with - | top => - exact GroundChronologicalMainTransition.comp_preservesOldProfiles - pairing unions powers separation (run.diagram.transition (greatest i)) step - (preserved i last (greatest i)) stepPreserved - | coe j => exact preserved i j (WithTop.coe_le_coe.mp before) - -end PartitionPilot.Forcing.GroundMainPrefix - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} - -theorem preservesOldProfiles_of_zero_one - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (Fin 2)) - (crossing : (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).PreservesOldProfiles) : - run.PreservesOldProfiles := by - intro i - refine Fin.cases ?_ (fun i => ?_) i - · intro j - refine Fin.cases ?_ (fun j => ?_) j - · intro before - rw [run.diagram.self] - exact GroundChronologicalMainTransition.identity_preservesOldProfiles - pairing unions powers separation (run.diagram.stage 0) - · rw [Fin.eq_zero j] - intro _ - exact crossing - · rw [Fin.eq_zero i] - intro j - refine Fin.cases ?_ (fun j => ?_) j - · intro before - exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) before) - · rw [Fin.eq_zero j] - intro before - rw [run.diagram.self] - exact GroundChronologicalMainTransition.identity_preservesOldProfiles - pairing unions powers separation (run.diagram.stage 1) - -theorem twoStage_preservesOldProfiles - (first second : GroundLinkedMainStage M K Labels C D rD) - (step : GroundChronologicalMainTransition first.main second.main) - (coverage : step.CoversOldBirths) (preserved : step.PreservesOldProfiles) : - (twoStage pairing unions powers separation first second step coverage).PreservesOldProfiles := - (twoStage pairing unions powers separation first second step coverage).preservesOldProfiles_of_zero_one preserved - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologicalTransitionTransport +import OAI.SetTheory.PartitionPrinciple.Geometry.OldProfilePreservationComposition +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundOmegaOneTaskBearingSuccessorFunction + +namespace OAI + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {I : Type v} [Small.{u} I] [Preorder I] [Finite I] + +local instance : Finite (MainTransitionIndex I) := by + classical + let := Fintype.ofFinite I + infer_instance + +noncomputable def ofFinite (key : I → ZFSet.{u}) (injective : Function.Injective key) + (order : ∀ i j, i ≤ j ↔ key i = key j ∨ key i ∈ key j) + (ground : ZFSet.range key ∈ M.sets) (ordinal : ordinalSetProperty (ZFSet.range key)) + (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) + (linked : I → GroundLinkedMainStage M K Labels C D rD) + (same : ∀ i, (linked i).main = diagram.stage i) (coverage : diagram.CoversOldBirths) : + GroundMainPrefix M K Labels C D rD pairing unions powers separation I where + key := key + key_injective := injective + key_order := order + indices_ground := ground + indices_ordinal := ordinal + diagram := diagram + linked := linked + linked_main := same + coverage := coverage + stages_ground := familyCodeGraph_finite_ground pairing unions ⟨_, ground⟩ key _ + (fun i => M.transitive ground (ZFSet.mem_range.2 ⟨i, rfl⟩)) + (fun i => (linked i).code_ground pairing) + transitions_ground := familyCodeGraph_finite_ground pairing unions ⟨_, ground⟩ _ _ + (fun p => M.orderedPair_mem pairing + (M.transitive ground (ZFSet.mem_range.2 ⟨p.val.2, rfl⟩)) + (M.transitive ground (ZFSet.mem_range.2 ⟨p.val.1, rfl⟩))) + (fun p => (diagram.transition p.property).map.code_mem pairing) + +variable {pairing unions powers separation} +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (infinite : Realize M.sets infinity Fin.elim0) (hK : K ∈ M.sets) +variable (conditions : GroundInaccessibleConditions M K) +variable (keys : ∀ i, ZFSet.rank (run.key i) < ZFSet.rank K) +include infinite hK conditions keys + +theorem finite_stageGraph_rank_lt : ZFSet.rank run.stageGraph < ZFSet.rank K := + familyCodeGraph_finite_rank_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) + run.key _ keys (fun i => (run.linked i).code_rank_lt pairing unions powers separation infinite hK conditions) + +omit keys [Finite I] in +theorem transition_code_rank_lt {i j : I} (before : i ≤ j) : + ZFSet.rank (run.diagram.transition before).map.code < ZFSet.rank K := by + have invariants (k : I) : (run.diagram.stage k).Invariant K Labels := + run.linked_main k ▸ (run.linked k).invariant + exact (run.diagram.transition before).map.code_rank_lt_inaccessible + pairing unions powers separation infinite hK conditions + (invariants i).points_rank (invariants j).points_rank + (invariants i).actors_rank (invariants j).actors_rank + +theorem finite_transitionGraph_rank_lt : ZFSet.rank run.transitionGraph < ZFSet.rank K := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + exact familyCodeGraph_finite_rank_lt limit _ _ + (fun p => rank_orderedPair_lt limit (keys p.val.2) (keys p.val.1)) + (fun p => run.transition_code_rank_lt infinite hK conditions p.property) + +theorem finite_code_rank_lt : ZFSet.rank run.code < ZFSet.rank K := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + exact rank_nonemptyTupleCode_lt limit 2 _ + (Fin.cases (rank_finiteCodeRange_lt limit run.key keys) + (Fin.cases (run.finite_stageGraph_rank_lt infinite hK conditions keys) + (fun _ => run.finite_transitionGraph_rank_lt infinite hK conditions keys))) + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (first second : GroundLinkedMainStage M K Labels C D rD) +variable (step : GroundChronologicalMainTransition first.main second.main) +variable (coverage : step.CoversOldBirths) + +noncomputable def twoStage : + GroundMainPrefix M K Labels C D rD pairing unions powers separation (Fin 2) := by + have empty : (∅ : ZFSet.{u}) ∈ M.sets := + M.empty_mem ⟨first.main.cutoff, first.main.cutoff_ground⟩ + have one := M.insert_mem pairing unions empty empty + have two := M.insert_mem pairing unions one one + have ground : ZFSet.range (@finiteMainIndexKey.{u} 2) ∈ M.sets := by + simpa only [finiteMainIndexKey_range, natSetCode_succ, natSetCode_zero] using two + have ordinal : ordinalSetProperty (ZFSet.range (@finiteMainIndexKey.{u} 2)) := by + rw [finiteMainIndexKey_range] + exact ordinalSetProperty_succ (ordinalSetProperty_succ ordinalSetProperty_empty) + apply ofFinite pairing unions powers separation finiteMainIndexKey + (finiteMainIndexKey_injective 2) finiteMainIndexKey_order ground ordinal + (GroundChronologicalMainDiagram.twoStage pairing unions powers separation step) + (Fin.cases first (fun _ => second)) + · intro i + cases i using Fin.cases <;> rfl + · exact GroundChronologicalMainDiagram.twoStage_coversOldBirths + pairing unions powers separation step coverage + +theorem twoStage_indices : + (twoStage pairing unions powers separation first second step coverage).indices = natSetCode 2 := + finiteMainIndexKey_range 2 + +theorem twoStage_linked_zero : + (twoStage pairing unions powers separation first second step coverage).linked 0 = first := rfl + +theorem twoStage_linked_one : + (twoStage pairing unions powers separation first second step coverage).linked 1 = second := rfl + +theorem twoStage_stage_zero : + (twoStage pairing unions powers separation first second step coverage).diagram.stage 0 = first.main := rfl + +theorem twoStage_stage_one : + (twoStage pairing unions powers separation first second step coverage).diagram.stage 1 = second.main := rfl + +theorem twoStage_transition_zero_one : + (twoStage pairing unions powers separation first second step coverage).diagram.transition + (show (0 : Fin 2) ≤ 1 from by decide) = step := rfl + +theorem twoStage_stageGraph_zero (z : ZFSet.{u}) : + ZFSet.pair (natSetCode 0) z ∈ + (twoStage pairing unions powers separation first second step coverage).stageGraph ↔ z = first.code := + (twoStage pairing unions powers separation first second step coverage).stageGraph_entry 0 z + +theorem twoStage_stageGraph_one (z : ZFSet.{u}) : + ZFSet.pair (natSetCode 1) z ∈ + (twoStage pairing unions powers separation first second step coverage).stageGraph ↔ z = second.code := + (twoStage pairing unions powers separation first second step coverage).stageGraph_entry 1 z + +theorem twoStage_transitionGraph_zero_one (z : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (natSetCode 1) (natSetCode 0)) z ∈ + (twoStage pairing unions powers separation first second step coverage).transitionGraph ↔ z = step.map.code := + (twoStage pairing unions powers separation first second step coverage).transitionGraph_entry + (show (0 : Fin 2) ≤ 1 from by decide) z + +theorem twoStage_code_rank_lt (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) : + ZFSet.rank (twoStage pairing unions powers separation first second step coverage).code < ZFSet.rank K := by + apply (twoStage pairing unions powers separation first second step coverage).finite_code_rank_lt + infinite hK conditions + intro i + exact rank_natSetCode_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) i.val + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace GroundChronologicalMainTransition +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {source middle target first second : GroundChronologicalMainStage M C D rD} + +def PreservesOldProfiles (transition : GroundChronologicalMainTransition source target) : Prop := + OldProfilePreservationCode source.stage.carrier source.stage.order source.stage.meetGraph + target.stage.carrier target.stage.order target.stage.meetGraph transition.map.points + (M.groundPower source.stage.carrier) + +theorem identity_preservesOldProfiles + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (stage : GroundChronologicalMainStage M C D rD) : + (identity pairing unions powers separation stage).PreservesOldProfiles := + OldProfilePreservationCode.identity stage.stage.carrier stage.stage.order stage.stage.meetGraph + (M.groundPower stage.stage.carrier) + +theorem comp_preservesOldProfiles + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (left : GroundChronologicalMainTransition source middle) + (right : GroundChronologicalMainTransition middle target) + (first : left.PreservesOldProfiles) (second : right.PreservesOldProfiles) : + (left.comp pairing unions powers separation right).PreservesOldProfiles := + OldProfilePreservationCode.comp_ground M separation first second middle.stage.carrier_ground + left.map.points_ground + +theorem retargetEq_preservesOldProfiles_iff + (transition : GroundChronologicalMainTransition source target) + (sourceEqual : source = first) (targetEqual : target = second) : + (transition.retargetEq sourceEqual targetEqual).PreservesOldProfiles ↔ transition.PreservesOldProfiles := by + cases sourceEqual + cases targetEqual + rfl + +end GroundChronologicalMainTransition + +namespace TaskBearingMainSuccessorCode +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target : GroundLinkedMainStage M K Labels C D rD} +variable {transition : GroundChronologicalMainTransition source.main target.main} + +theorem preservesOldProfiles + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) : transition.PreservesOldProfiles := + code.old_profiles_on_linked + +end TaskBearingMainSuccessorCode +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialTwoStageMainPrefix + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, + ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + ∃ first second : GroundLinkedMainStage M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode), + ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), + first.main = seed.source ∧ second.main = certificate.target ∧ + first.serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + second.serial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + run.indices = natSetCode 2 ∧ run.code ∈ M.sets ∧ ZFSet.rank run.code < ZFSet.rank K ∧ + run.linked 0 = first ∧ run.linked 1 = second ∧ + run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ + (∀ z, ZFSet.pair (natSetCode 0) z ∈ run.stageGraph ↔ z = first.code) ∧ + (∀ z, ZFSet.pair (natSetCode 1) z ∈ run.stageGraph ↔ z = second.code) ∧ + (∀ z, ZFSet.pair (ZFSet.pair (natSetCode 1) (natSetCode 0)) z ∈ run.transitionGraph ↔ + z = certificate.transition.map.code) ∧ + (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.points = + certificate.transition.map.points ∧ + (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.actors = + certificate.transition.map.actors := by + dsimp only + obtain ⟨level, seed, certificate, initial, successor, _candidateGround, + _initialGround, initialRank, initialMember, initialAgreement, + _successorGround, successorRank, successorMember, successorAgreement, + targetInvariant, _transitionRank, _terminal⟩ := + M.exists_groundInitialMainSeedSuccessorRanked pairing unions powers separation + collection infinite choice hK standard + let first : GroundLinkedMainStage M K + (M.groundOmegaOne pairing unions powers separation collection infinite) + (M.groundOmegaOne pairing unions powers separation collection infinite) + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) := + ⟨seed.source, initial, initialAgreement, seed.invariant, initialRank⟩ + let second : GroundLinkedMainStage M K + (M.groundOmegaOne pairing unions powers separation collection infinite) + (M.groundOmegaOne pairing unions powers separation collection infinite) + (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode) := + ⟨certificate.target, successor, successorAgreement, targetInvariant, successorRank⟩ + let run := GroundMainPrefix.twoStage pairing unions powers separation first second + certificate.transition certificate.coversOldBirths + have conditions := standard.to_conditions pairing unions powers separation hK + exact ⟨level, seed, certificate, first, second, run, rfl, rfl, initialMember, successorMember, + GroundMainPrefix.twoStage_indices pairing unions powers separation first second + certificate.transition certificate.coversOldBirths, + run.code_ground, + GroundMainPrefix.twoStage_code_rank_lt pairing unions powers separation first second + certificate.transition certificate.coversOldBirths infinite hK conditions, + rfl, rfl, rfl, rfl, + GroundMainPrefix.twoStage_stageGraph_zero pairing unions powers separation first second + certificate.transition certificate.coversOldBirths, + GroundMainPrefix.twoStage_stageGraph_one pairing unions powers separation first second + certificate.transition certificate.coversOldBirths, + GroundMainPrefix.twoStage_transitionGraph_zero_one pairing unions powers separation first second + certificate.transition certificate.coversOldBirths, + rfl, rfl⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +def PreservesOldProfiles : Prop := + ∀ (i j : I) (before : i ≤ j), (run.diagram.transition before).PreservesOldProfiles + +theorem restrict_preservesOldProfiles (preserved : run.PreservesOldProfiles) + {S : ZFSet.{u}} (subset : S ⊆ run.indices) (ground : S ∈ M.sets) + (ordinal : ordinalSetProperty S) : + (run.restrict subset ground ordinal).PreservesOldProfiles := by + intro i j before + exact preserved i.val j.val before + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (Fin 2)) + +theorem zero_key_of_two_indices (indices : run.indices = natSetCode 2) : + run.key 0 = natSetCode 0 := by + have member : natSetCode 0 ∈ run.indices := by + rw [indices] + exact (natSetCode_mem_iff 0 2).2 (by decide) + obtain ⟨i, equal⟩ := ZFSet.mem_range.1 member + obtain equalKeys | below := (run.key_order 0 i).1 (Fin.zero_le i) + · exact equalKeys.trans equal + · rw [equal] at below + exact False.elim (ZFSet.notMem_empty _ below) + +theorem exists_initialRestriction (indices : run.indices = natSetCode 2) + (preserved : run.PreservesOldProfiles) + {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) (oldRank : ZFSet.rank run.code < o) : + ∃ initial : GroundMainPrefix M K Labels C D rD pairing unions powers separation + {i : Fin 2 // run.key i ∈ natSetCode 1}, + initial.indices = natSetCode 1 ∧ initial.PreservesOldProfiles ∧ + ZFSet.rank initial.code < o ∧ + initial.stageGraph = graphRestriction (natSetCode 1) run.stageGraph ∧ + initial.transitionGraph = graphRestriction (chronologyPairs (natSetCode 1)) run.transitionGraph ∧ + (∀ i, initial.linked i = run.linked i.val) ∧ + ∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = run.diagram.stage 0 := by + have oneMember : natSetCode 1 ∈ run.indices := by + rw [indices] + exact (natSetCode_mem_iff 1 2).2 (by decide) + have subset : natSetCode 1 ⊆ run.indices := by + intro x hx + rw [indices] + obtain ⟨n, hn, rfl⟩ := (mem_natSetCode x 1).1 hx + exact (natSetCode_mem_iff n 2).2 (by omega) + have ground := M.transitive run.indices_ground oneMember + have ordinal := ordinalSetProperty_member run.indices_ordinal oneMember + let initial := run.restrict subset ground ordinal + have zeroMember : run.key 0 ∈ natSetCode 1 := by + rw [run.zero_key_of_two_indices indices] + exact (natSetCode_mem_iff 0 1).2 (by decide) + exact ⟨initial, run.restrict_indices subset ground ordinal, + run.restrict_preservesOldProfiles preserved subset ground ordinal, + run.restrict_code_rank_lt subset ground ordinal limit oldRank, + run.restrict_stageGraph subset ground ordinal, + run.restrict_transitionGraph subset ground ordinal, fun _ => rfl, + ⟨0, zeroMember⟩, run.zero_key_of_two_indices indices, rfl⟩ + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem appendCone_preservesOldProfiles (preserved : run.PreservesOldProfiles) + (target : GroundLinkedMainStage M K Labels C D rD) (cone : run.diagram.Cone target.main) + {row : ZFSet.{u}} (ground : row ∈ M.sets) + (function : FunctionGraphOn (ZFSet.prod {run.indices} run.indices) row) + (entries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ z = (cone.leg i).map.code) + (covered : cone.append.CoversOldBirths) (legs : ∀ i, (cone.leg i).PreservesOldProfiles) : + (run.appendCone target cone ground function entries covered).PreservesOldProfiles := by + intro i j before + cases i with + | top => + cases j with + | top => + exact GroundChronologicalMainTransition.identity_preservesOldProfiles + pairing unions powers separation target.main + | coe j => exact False.elim (WithTop.not_top_le_coe j before) + | coe i => + cases j with + | top => exact legs i + | coe j => exact preserved i j (WithTop.coe_le_coe.mp before) + +theorem appendLast_preservesOldProfiles (preserved : run.PreservesOldProfiles) + (last : I) (greatest : ∀ i, i ≤ last) + (target : GroundLinkedMainStage M K Labels C D rD) + (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) + (covered : step.CoversOldBirths) (stepPreserved : step.PreservesOldProfiles) : + (run.appendLast last greatest target step covered).PreservesOldProfiles := by + intro i j before + cases i with + | top => + cases j with + | top => + exact GroundChronologicalMainTransition.identity_preservesOldProfiles + pairing unions powers separation target.main + | coe j => exact False.elim (WithTop.not_top_le_coe j before) + | coe i => + cases j with + | top => + exact GroundChronologicalMainTransition.comp_preservesOldProfiles + pairing unions powers separation (run.diagram.transition (greatest i)) step + (preserved i last (greatest i)) stepPreserved + | coe j => exact preserved i j (WithTop.coe_le_coe.mp before) + +end PartitionPilot.Forcing.GroundMainPrefix + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} + +theorem preservesOldProfiles_of_zero_one + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (Fin 2)) + (crossing : (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).PreservesOldProfiles) : + run.PreservesOldProfiles := by + intro i + refine Fin.cases ?_ (fun i => ?_) i + · intro j + refine Fin.cases ?_ (fun j => ?_) j + · intro before + rw [run.diagram.self] + exact GroundChronologicalMainTransition.identity_preservesOldProfiles + pairing unions powers separation (run.diagram.stage 0) + · rw [Fin.eq_zero j] + intro _ + exact crossing + · rw [Fin.eq_zero i] + intro j + refine Fin.cases ?_ (fun j => ?_) j + · intro before + exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) before) + · rw [Fin.eq_zero j] + intro before + rw [run.diagram.self] + exact GroundChronologicalMainTransition.identity_preservesOldProfiles + pairing unions powers separation (run.diagram.stage 1) + +theorem twoStage_preservesOldProfiles + (first second : GroundLinkedMainStage M K Labels C D rD) + (step : GroundChronologicalMainTransition first.main second.main) + (coverage : step.CoversOldBirths) (preserved : step.PreservesOldProfiles) : + (twoStage pairing unions powers separation first second step coverage).PreservesOldProfiles := + (twoStage pairing unions powers separation first second step coverage).preservesOldProfiles_of_zero_one preserved + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPriorFields.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPriorFields.lean index 7fe7094bf3914e007ea72a70f6623f8c9e28357a..813d01ad1a14a06889aa8e3e5ade47162a171d93 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPriorFields.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixPriorFields.lean @@ -1,151 +1,151 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def serialFieldUnion (j : Fin 5) : ZFSet.{u} := - ⋃₀ ZFSet.range (fun i => (run.linked i).serial.fields.graph j) - -theorem serialFieldUnion_ground (j : Fin 5) : run.serialFieldUnion j ∈ M.sets := - M.union_mem unions (M.familyCodeGraph_valueRange_mem unions separation run.key _ - run.indices_ground (run.serialFieldFamily_ground j)) - -theorem serialFieldUnion_rank_le_code (j : Fin 5) : - ZFSet.rank (run.serialFieldUnion j) ≤ ZFSet.rank run.code := - (familyCodeGraph_valueUnion_rank_le run.key _).trans (run.serialFieldFamily_rank_le_code j) - -theorem serialFieldUnion_mem (j : Fin 5) (z : ZFSet.{u}) : - z ∈ run.serialFieldUnion j ↔ ∃ i, z ∈ (run.linked i).serial.fields.graph j := - familyCodeGraph_valueUnion_mem_iff _ z - -theorem historyFieldValue_transition {i k : I} (before : i ≤ k) (j : Fin 5) {s : ZFSet.{u}} - (time : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : - (run.diagram.stage k).history.fieldValue j s = (run.diagram.stage i).history.fieldValue j s := by - have equal := (run.diagram.transition before).history_prefix s time - exact Fin.cases equal.1 (Fin.cases equal.2.1 (Fin.cases equal.2.2.1 - (Fin.cases equal.2.2.2.1 (fun _ => equal.2.2.2.2)))) j - -theorem historyFieldValue_compatible (i k : I) (j : Fin 5) {s : ZFSet.{u}} - (first : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) - (second : s = (run.diagram.stage k).cutoff ∨ s ∈ (run.diagram.stage k).cutoff) : - (run.diagram.stage i).history.fieldValue j s = (run.diagram.stage k).history.fieldValue j s := by - obtain ⟨m, im, km⟩ := run.common_upper i k - exact (run.historyFieldValue_transition im j first).symm.trans - (run.historyFieldValue_transition km j second) - -theorem serialFieldGraph_entry (i : I) (j : Fin 5) (s y : ZFSet.{u}) : - ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j ↔ - (s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) ∧ - y = (run.diagram.stage i).history.fieldValue j s := by - have historyEqual : (run.linked i).main.history.fieldValue j s = - (run.diagram.stage i).history.fieldValue j s := - congrArg (fun stage : GroundChronologicalMainStage M C D rD => stage.history.fieldValue j s) (run.linked_main i) - constructor - · intro entry - have hs := (ZFSet.pair_mem_prod.1 (((run.linked i).serial.fields.function j).1 entry)).1 - have agreement := (run.linked i).agreement j s hs - have value := ((run.linked i).serial.fields.value_eq_of_entry j entry).symm.trans agreement - exact ⟨by simpa only [run.linked_main, ZFSet.mem_insert_iff] using hs, - value.trans historyEqual⟩ - · rintro ⟨time, equal⟩ - have hs : s ∈ insert (run.linked i).main.cutoff (run.linked i).main.cutoff := by - simpa only [run.linked_main, ZFSet.mem_insert_iff] using time - have entry := (run.linked i).serial.fields.value_entry j hs - have agreement := (run.linked i).agreement j s hs - rw [agreement] at entry - have value : ZFSet.pair s ((run.diagram.stage i).history.fieldValue j s) ∈ - (run.linked i).serial.fields.graph j := by rw [← historyEqual]; exact entry - exact equal.symm ▸ value - -theorem serialFieldUnion_entry (j : Fin 5) (s y : ZFSet.{u}) : - ZFSet.pair s y ∈ run.serialFieldUnion j ↔ - ∃ i, (s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) ∧ - y = (run.diagram.stage i).history.fieldValue j s := by - rw [run.serialFieldUnion_mem] - exact exists_congr (fun i => run.serialFieldGraph_entry i j s y) - -theorem serialFieldUnion_at (i : I) (j : Fin 5) {s : ZFSet.{u}} - (time : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) (y : ZFSet.{u}) : - ZFSet.pair s y ∈ run.serialFieldUnion j ↔ y = (run.diagram.stage i).history.fieldValue j s := by - rw [run.serialFieldUnion_entry] - constructor - · intro h - obtain ⟨k, before, equal⟩ := h - exact equal.trans (run.historyFieldValue_compatible k i j before time) - · intro equal - exact ⟨i, time, equal⟩ - -theorem serialFieldUnion_function (j : Fin 5) : FunctionGraphOn run.cutoffLimit (run.serialFieldUnion j) := by - refine ⟨⋃₀ ⋃₀ run.serialFieldUnion j, ?_, ?_⟩ - · intro z hz - obtain ⟨i, entry⟩ := (run.serialFieldUnion_mem j z).1 hz - obtain ⟨s, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (((run.linked i).serial.fields.function j).1 entry) - have before := ((run.serialFieldGraph_entry i j s y).1 entry).1 - exact ZFSet.pair_mem_prod.2 ⟨(run.cutoffLimit_mem s).2 ⟨i, before⟩, pair_second_mem_doubleUnion hz⟩ - · intro s hs - obtain ⟨i, before⟩ := (run.cutoffLimit_mem s).1 hs - exact ⟨(run.diagram.stage i).history.fieldValue j s, (run.serialFieldUnion_at i j before _).2 rfl, - fun y entry => (run.serialFieldUnion_at i j before y).1 entry⟩ - -theorem serialFieldUnion_restrict (i : I) (j : Fin 5) : - graphRestriction (insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) - (run.serialFieldUnion j) = (run.linked i).serial.fields.graph j := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨s, hs, y, rfl, entry⟩ := mem_graphRestriction.1 hz - have before := ZFSet.mem_insert_iff.1 hs - exact (run.serialFieldGraph_entry i j s y).2 ⟨before, (run.serialFieldUnion_at i j before y).1 entry⟩ - · intro entry - obtain ⟨s, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (((run.linked i).serial.fields.function j).1 entry) - have before := ((run.serialFieldGraph_entry i j s y).1 entry).1 - exact pair_mem_graphRestriction.2 ⟨(run.serialFieldUnion_mem j _).2 ⟨i, entry⟩, - ZFSet.mem_insert_iff.2 before⟩ - -noncomputable def limitPriorFields : GroundChronologyFields M run.cutoffLimit := - GroundChronologyFields.ofGraphs pairing unions run.cutoffLimit_ground - run.serialFieldUnion run.serialFieldUnion_ground run.serialFieldUnion_function - -theorem limitPriorFields_graph (j : Fin 5) : - run.limitPriorFields.graph j = run.serialFieldUnion j := rfl - -theorem limitPriorFields_values (i : I) (j : Fin 5) {s : ZFSet.{u}} - (time : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : - run.limitPriorFields.value j s = (run.diagram.stage i).history.fieldValue j s := - run.limitPriorFields.value_eq_of_entry j ((run.serialFieldUnion_at i j time _).2 rfl) - -theorem limitPriorFields_bound_rank_le_code : - ZFSet.rank run.limitPriorFields.bound ≤ ZFSet.rank run.code := by - change ZFSet.rank (⋃₀ ⋃₀ (run.serialFieldUnion 0 ∪ (run.serialFieldUnion 1 ∪ - (run.serialFieldUnion 2 ∪ (run.serialFieldUnion 3 ∪ run.serialFieldUnion 4))))) ≤ _ - apply (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans ?_) - simp only [ZFSet.rank_union] - exact max_le (run.serialFieldUnion_rank_le_code 0) (max_le (run.serialFieldUnion_rank_le_code 1) - (max_le (run.serialFieldUnion_rank_le_code 2) - (max_le (run.serialFieldUnion_rank_le_code 3) (run.serialFieldUnion_rank_le_code 4)))) - -theorem limitPriorFields_code_ground : run.limitPriorFields.code ∈ M.sets := - run.limitPriorFields.code_ground pairing - -theorem limitPriorFields_code_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitPriorFields.code < o := by - apply rank_nonemptyTupleCode_lt limit 6 run.limitPriorFields.codeFields - exact Fin.cases (run.cutoffLimit_rank_le_code.trans_lt rank) - (Fin.cases (run.limitPriorFields_bound_rank_le_code.trans_lt rank) - (fun j => (run.serialFieldUnion_rank_le_code j).trans_lt rank)) - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def serialFieldUnion (j : Fin 5) : ZFSet.{u} := + ⋃₀ ZFSet.range (fun i => (run.linked i).serial.fields.graph j) + +theorem serialFieldUnion_ground (j : Fin 5) : run.serialFieldUnion j ∈ M.sets := + M.union_mem unions (M.familyCodeGraph_valueRange_mem unions separation run.key _ + run.indices_ground (run.serialFieldFamily_ground j)) + +theorem serialFieldUnion_rank_le_code (j : Fin 5) : + ZFSet.rank (run.serialFieldUnion j) ≤ ZFSet.rank run.code := + (familyCodeGraph_valueUnion_rank_le run.key _).trans (run.serialFieldFamily_rank_le_code j) + +theorem serialFieldUnion_mem (j : Fin 5) (z : ZFSet.{u}) : + z ∈ run.serialFieldUnion j ↔ ∃ i, z ∈ (run.linked i).serial.fields.graph j := + familyCodeGraph_valueUnion_mem_iff _ z + +theorem historyFieldValue_transition {i k : I} (before : i ≤ k) (j : Fin 5) {s : ZFSet.{u}} + (time : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : + (run.diagram.stage k).history.fieldValue j s = (run.diagram.stage i).history.fieldValue j s := by + have equal := (run.diagram.transition before).history_prefix s time + exact Fin.cases equal.1 (Fin.cases equal.2.1 (Fin.cases equal.2.2.1 + (Fin.cases equal.2.2.2.1 (fun _ => equal.2.2.2.2)))) j + +theorem historyFieldValue_compatible (i k : I) (j : Fin 5) {s : ZFSet.{u}} + (first : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) + (second : s = (run.diagram.stage k).cutoff ∨ s ∈ (run.diagram.stage k).cutoff) : + (run.diagram.stage i).history.fieldValue j s = (run.diagram.stage k).history.fieldValue j s := by + obtain ⟨m, im, km⟩ := run.common_upper i k + exact (run.historyFieldValue_transition im j first).symm.trans + (run.historyFieldValue_transition km j second) + +theorem serialFieldGraph_entry (i : I) (j : Fin 5) (s y : ZFSet.{u}) : + ZFSet.pair s y ∈ (run.linked i).serial.fields.graph j ↔ + (s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) ∧ + y = (run.diagram.stage i).history.fieldValue j s := by + have historyEqual : (run.linked i).main.history.fieldValue j s = + (run.diagram.stage i).history.fieldValue j s := + congrArg (fun stage : GroundChronologicalMainStage M C D rD => stage.history.fieldValue j s) (run.linked_main i) + constructor + · intro entry + have hs := (ZFSet.pair_mem_prod.1 (((run.linked i).serial.fields.function j).1 entry)).1 + have agreement := (run.linked i).agreement j s hs + have value := ((run.linked i).serial.fields.value_eq_of_entry j entry).symm.trans agreement + exact ⟨by simpa only [run.linked_main, ZFSet.mem_insert_iff] using hs, + value.trans historyEqual⟩ + · rintro ⟨time, equal⟩ + have hs : s ∈ insert (run.linked i).main.cutoff (run.linked i).main.cutoff := by + simpa only [run.linked_main, ZFSet.mem_insert_iff] using time + have entry := (run.linked i).serial.fields.value_entry j hs + have agreement := (run.linked i).agreement j s hs + rw [agreement] at entry + have value : ZFSet.pair s ((run.diagram.stage i).history.fieldValue j s) ∈ + (run.linked i).serial.fields.graph j := by rw [← historyEqual]; exact entry + exact equal.symm ▸ value + +theorem serialFieldUnion_entry (j : Fin 5) (s y : ZFSet.{u}) : + ZFSet.pair s y ∈ run.serialFieldUnion j ↔ + ∃ i, (s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) ∧ + y = (run.diagram.stage i).history.fieldValue j s := by + rw [run.serialFieldUnion_mem] + exact exists_congr (fun i => run.serialFieldGraph_entry i j s y) + +theorem serialFieldUnion_at (i : I) (j : Fin 5) {s : ZFSet.{u}} + (time : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) (y : ZFSet.{u}) : + ZFSet.pair s y ∈ run.serialFieldUnion j ↔ y = (run.diagram.stage i).history.fieldValue j s := by + rw [run.serialFieldUnion_entry] + constructor + · intro h + obtain ⟨k, before, equal⟩ := h + exact equal.trans (run.historyFieldValue_compatible k i j before time) + · intro equal + exact ⟨i, time, equal⟩ + +theorem serialFieldUnion_function (j : Fin 5) : FunctionGraphOn run.cutoffLimit (run.serialFieldUnion j) := by + refine ⟨⋃₀ ⋃₀ run.serialFieldUnion j, ?_, ?_⟩ + · intro z hz + obtain ⟨i, entry⟩ := (run.serialFieldUnion_mem j z).1 hz + obtain ⟨s, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (((run.linked i).serial.fields.function j).1 entry) + have before := ((run.serialFieldGraph_entry i j s y).1 entry).1 + exact ZFSet.pair_mem_prod.2 ⟨(run.cutoffLimit_mem s).2 ⟨i, before⟩, pair_second_mem_doubleUnion hz⟩ + · intro s hs + obtain ⟨i, before⟩ := (run.cutoffLimit_mem s).1 hs + exact ⟨(run.diagram.stage i).history.fieldValue j s, (run.serialFieldUnion_at i j before _).2 rfl, + fun y entry => (run.serialFieldUnion_at i j before y).1 entry⟩ + +theorem serialFieldUnion_restrict (i : I) (j : Fin 5) : + graphRestriction (insert (run.diagram.stage i).cutoff (run.diagram.stage i).cutoff) + (run.serialFieldUnion j) = (run.linked i).serial.fields.graph j := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨s, hs, y, rfl, entry⟩ := mem_graphRestriction.1 hz + have before := ZFSet.mem_insert_iff.1 hs + exact (run.serialFieldGraph_entry i j s y).2 ⟨before, (run.serialFieldUnion_at i j before y).1 entry⟩ + · intro entry + obtain ⟨s, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (((run.linked i).serial.fields.function j).1 entry) + have before := ((run.serialFieldGraph_entry i j s y).1 entry).1 + exact pair_mem_graphRestriction.2 ⟨(run.serialFieldUnion_mem j _).2 ⟨i, entry⟩, + ZFSet.mem_insert_iff.2 before⟩ + +noncomputable def limitPriorFields : GroundChronologyFields M run.cutoffLimit := + GroundChronologyFields.ofGraphs pairing unions run.cutoffLimit_ground + run.serialFieldUnion run.serialFieldUnion_ground run.serialFieldUnion_function + +theorem limitPriorFields_graph (j : Fin 5) : + run.limitPriorFields.graph j = run.serialFieldUnion j := rfl + +theorem limitPriorFields_values (i : I) (j : Fin 5) {s : ZFSet.{u}} + (time : s = (run.diagram.stage i).cutoff ∨ s ∈ (run.diagram.stage i).cutoff) : + run.limitPriorFields.value j s = (run.diagram.stage i).history.fieldValue j s := + run.limitPriorFields.value_eq_of_entry j ((run.serialFieldUnion_at i j time _).2 rfl) + +theorem limitPriorFields_bound_rank_le_code : + ZFSet.rank run.limitPriorFields.bound ≤ ZFSet.rank run.code := by + change ZFSet.rank (⋃₀ ⋃₀ (run.serialFieldUnion 0 ∪ (run.serialFieldUnion 1 ∪ + (run.serialFieldUnion 2 ∪ (run.serialFieldUnion 3 ∪ run.serialFieldUnion 4))))) ≤ _ + apply (ZFSet.rank_sUnion_le _).trans ((ZFSet.rank_sUnion_le _).trans ?_) + simp only [ZFSet.rank_union] + exact max_le (run.serialFieldUnion_rank_le_code 0) (max_le (run.serialFieldUnion_rank_le_code 1) + (max_le (run.serialFieldUnion_rank_le_code 2) + (max_le (run.serialFieldUnion_rank_le_code 3) (run.serialFieldUnion_rank_le_code 4)))) + +theorem limitPriorFields_code_ground : run.limitPriorFields.code ∈ M.sets := + run.limitPriorFields.code_ground pairing + +theorem limitPriorFields_code_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (rank : ZFSet.rank run.code < o) : ZFSet.rank run.limitPriorFields.code < o := by + apply rank_nonemptyTupleCode_lt limit 6 run.limitPriorFields.codeFields + exact Fin.cases (run.cutoffLimit_rank_le_code.trans_lt rank) + (Fin.cases (run.limitPriorFields_bound_rank_le_code.trans_lt rank) + (fun j => (run.serialFieldUnion_rank_le_code j).trans_lt rank)) + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRawCoveredAppend.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRawCoveredAppend.lean index 8a2701e21de130bf88b25f793b4f740d991311bc..ba33c6c2e26a02f0aff844a37f7c28e1bbc4cc10 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRawCoveredAppend.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRawCoveredAppend.lean @@ -1,394 +1,394 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedProfileImageTests -import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.FixedTopProfilePreservation -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowTerms - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitPointMap_later_entry {i j : I} (before : i ≤ j) {x y q : ZFSet.{u}} - (entry : ZFSet.pair x y ∈ (run.diagram.transition before).map.points) - (image : ZFSet.pair x q ∈ run.limitPointMap i) : - ZFSet.pair y q ∈ run.limitPointMap j := - (run.pointPresentation.inclusion_entry j y q).2 - ⟨(run.pointSystem.map_entry_bounds before entry).2, - ((run.pointPresentation.inclusion_entry i x q).1 image).2.trans - (run.pointPresentation.limitPoint_transition before entry)⟩ - -theorem limitPointMap_oldProfilePreservation (preserved : run.PreservesOldProfiles) (i : I) : - OldProfilePreservationCode (run.diagram.stage i).stage.carrier - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph - run.limitPoints run.limitOrder run.limitMeetGraph (run.limitPointMap i) - (M.groundPower (run.diagram.stage i).stage.carrier) := by - intro F hF c hc E hE cap hcap profile c' hc' E' hE' cap' hcap' imageC imageE imageCap - let embedding := run.limitPointMap_meetEmbedding i - refine ⟨hc', hE', hcap', fun _ member => ((mem_relationImage _ _ _ _).1 member).1, - ?_, ?_, embedding.monotone c cap c' cap' profile.target_below_cap imageC imageCap, - fun lower => profile.cap_not_below_target - ((run.limitPointMap_order_iff i cap c cap' c' imageCap imageC).1 lower), - fun lower => profile.separator_not_below_cap - ((run.limitPointMap_order_iff i E cap E' cap' imageE imageCap).1 lower)⟩ - · obtain ⟨f, hf⟩ := profile.nonempty - obtain ⟨f', entry, _⟩ := embedding.injection.function.2 f (profile.filter_subset hf) - exact ⟨f', (mem_relationImage _ _ _ _).2 - ⟨(ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)).2, f, hf, entry⟩⟩ - · intro q hq above - obtain ⟨j, x, hx, equal⟩ := run.pointPresentation.limitPoint_coverage hq - have imageX : ZFSet.pair x q ∈ run.limitPointMap j := - (run.pointPresentation.inclusion_entry j x q).2 ⟨hx, equal⟩ - obtain ⟨k, ik, jk⟩ := run.common_upper i j - obtain ⟨cK, cEntry⟩ := run.pointSystem.map_entry_total ik hc - obtain ⟨eK, eEntry⟩ := run.pointSystem.map_entry_total ik hE - obtain ⟨capK, capEntry⟩ := run.pointSystem.map_entry_total ik hcap - obtain ⟨xK, xEntry⟩ := run.pointSystem.map_entry_total jk hx - have atStage := preserved i k ik F hF c hc E hE cap hcap profile - cK (run.pointSystem.map_entry_bounds ik cEntry).2 - eK (run.pointSystem.map_entry_bounds ik eEntry).2 - capK (run.pointSystem.map_entry_bounds ik capEntry).2 cEntry eEntry capEntry - have tested := atStage.profile.at_embedding (run.limitPointMap_meetEmbedding k) - (run.diagram.stage k).stage.meet run.limitMeet_code atStage.filter_subset - (run.limitPointMap_later_entry ik cEntry imageC) - (run.limitPointMap_later_entry ik eEntry imageE) - (run.limitPointMap_later_entry ik capEntry imageCap) - (run.limitPointMap_later_entry jk xEntry imageX) above - have imageEqual : - relationImage (relationImage F (run.diagram.stage k).stage.carrier - (run.diagram.transition ik).map.points) run.limitPoints (run.limitPointMap k) = - relationImage F run.limitPoints (run.limitPointMap i) := - (relationImage_composition_on profile.filter_subset).trans - (congrArg (relationImage F run.limitPoints) (run.limitPointMap_comp ik)) - rw [imageEqual] at tested - exact tested - -end GroundMainPrefix - -section -open SetFormula SetRealization -universe u v - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -noncomputable def preservedMainPrefixCandidates (B K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (PreservedMainPrefixCode M K Labels C D rD) B - -theorem mem_preservedMainPrefixCandidates (B K Labels C D rD z : ZFSet.{u}) : - z ∈ M.preservedMainPrefixCandidates B K Labels C D rD ↔ - z ∈ B ∧ PreservedMainPrefixCode M K Labels C D rD z := ZFSet.mem_sep - -theorem preservedMainPrefixCandidates_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {B K Labels C D rD : ZFSet.{u}} (hB : B ∈ M.sets) (hK : K ∈ M.sets) - (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (ordinal : ordinalSetProperty K) : M.preservedMainPrefixCandidates B K Labels C D rD ∈ M.sets := by - let params := extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))))) - have ground : ∀ j, params j ∈ M.sets := Fin.cases hK (Fin.cases hLabels (Fin.cases hC - (Fin.cases hD (Fin.cases hrD (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))))) - have selected := M.separation_mem separation (preservedMainPrefixFormula 1 2 3 4 5 6 0) params ground hB - have equal : ZFSet.sep (fun z => Realize M.sets (preservedMainPrefixFormula 1 2 3 4 5 6 0) - (extend z params)) B = M.preservedMainPrefixCandidates B K Labels C D rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_preservedMainPrefixCandidates] - apply and_congr_right - intro hz - exact M.realize_preservedMainPrefixFormula pairing unions powers separation collection 1 2 3 4 5 6 0 - (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl ordinal - exact equal ▸ selected - -end TransitiveGround - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) - -noncomputable def preservedMainPrefixes (Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - M.preservedMainPrefixCandidates level.carrier K Labels C D rD - -theorem preservedMainPrefixes_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) {Labels C D rD : ZFSet.{u}} - (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - level.preservedMainPrefixes Labels C D rD ∈ M.sets := - M.preservedMainPrefixCandidates_mem pairing unions powers separation collection infinite - level.carrier_ground hK hLabels hC hD hrD ordinal - -theorem mem_preservedMainPrefixes {Labels C D rD z : ZFSet.{u}} : - z ∈ level.preservedMainPrefixes Labels C D rD ↔ - z ∈ level.carrier ∧ PreservedMainPrefixCode M K Labels C D rD z := - M.mem_preservedMainPrefixCandidates level.carrier K Labels C D rD z - -theorem prefix_mem_preservedMainPrefixes - {pairing : Realize M.sets SetFormula.pairing Fin.elim0} - {unions : Realize M.sets SetFormula.union Fin.elim0} - {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} - {Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (preserved : run.PreservesOldProfiles) - (rank : ZFSet.rank run.code < ZFSet.rank K) : run.code ∈ level.preservedMainPrefixes Labels C D rD := - level.mem_preservedMainPrefixes.2 ⟨(level.membership _).2 ⟨run.code_ground, rank⟩, run.preserved_code preserved⟩ - -theorem exists_preservedPrefix_of_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Labels C D rD z : ZFSet.{u}} - (member : z ∈ level.preservedMainPrefixes Labels C D rD) : - ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, - letI := ordinalMainIndexPreorder ordinal - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), - run.indices = T ∧ run.code = z ∧ run.PreservesOldProfiles ∧ ZFSet.rank run.code < ZFSet.rank K := by - obtain ⟨carrier, code⟩ := level.mem_preservedMainPrefixes.1 member - obtain ⟨ground, rank⟩ := (level.membership z).1 carrier - obtain ⟨T, hT, ordinal, run, indices, equal, preserved⟩ := - code.exists_decodedPrefix pairing unions powers separation ground - exact ⟨T, hT, ordinal, run, indices, equal, preserved, equal.symm ▸ rank⟩ - -end GroundMainCandidateLevel -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_initialPreservedPrefixCandidate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, - ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), - level.preservedMainPrefixes C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ - run.code ∈ level.preservedMainPrefixes C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - run.indices = natSetCode 2 ∧ run.PreservesOldProfiles ∧ - ZFSet.rank run.code < ZFSet.rank K ∧ - run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ - (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.code = - certificate.transition.map.code := by - dsimp only - obtain ⟨level, seed, certificate, run, _, preserved, _, indices, _, rank, first, second, crossing⟩ := - M.exists_groundInitialPreservedMainPrefix pairing unions powers separation collection infinite choice hK standard - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - exact ⟨level, seed, certificate, run, - level.preservedMainPrefixes_ground pairing unions powers separation collection infinite - hK standard.1.1 hC hC seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, - level.prefix_mem_preservedMainPrefixes run preserved rank, indices, preserved, rank, first, second, crossing⟩ - -end TransitiveGround - -namespace MainPrefixGraphFamily -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {I : Type v} [Small.{u} I] -variable (family : MainPrefixGraphFamily M K Labels C D rD I) - -theorem exists_rankedPreservedUnionPrefix - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (limit : Order.IsSuccLimit (ZFSet.rank K)) - (key : I → ZFSet.{u}) (injective : Function.Injective key) - (domain : ZFSet.range key ∈ M.sets) - (whole : familyCodeGraph key family.code ∈ M.sets) - (small : GroundBelow M (ZFSet.range key) K) - (ranks : ∀ i, ZFSet.rank (family.code i) < ZFSet.rank K) - (preserved : ∀ i, MainPrefixProfileGraphCode M K Labels C D rD - (family.stages i) (family.transitions i)) - (level : GroundMainCandidateLevel M K) : - letI := ordinalMainIndexPreorder family.indexUnion_ordinal - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation - (SetMembers family.indexUnion), - run.indices = family.indexUnion ∧ run.stageGraph = family.stageUnion ∧ - run.transitionGraph = family.transitionUnion ∧ run.code = family.unionCode ∧ - run.PreservesOldProfiles ∧ run.code ∈ M.sets ∧ - ZFSet.rank run.code < ZFSet.rank K ∧ - run.code ∈ level.preservedMainPrefixes Labels C D rD ∧ - (∀ i, graphRestriction (family.indices i) run.stageGraph = family.stages i) ∧ - (∀ i, graphRestriction (chronologyPairs (family.indices i)) run.transitionGraph = - family.transitions i) := by - let := ordinalMainIndexPreorder family.indexUnion_ordinal - obtain ⟨run, indices, stages, transitions, equal, preservation⟩ := - family.exists_preservedUnionPrefix pairing unions powers separation key injective domain whole preserved - have rank : ZFSet.rank run.code < ZFSet.rank K := by - rw [equal] - exact family.unionCode_rank_lt_small pairing unions powers separation collection hK ordinal - regular limit key injective domain whole small ranks - refine ⟨run, indices, stages, transitions, equal, preservation, run.code_ground, rank, - level.prefix_mem_preservedMainPrefixes run preservation rank, ?_, ?_⟩ - · intro i - rw [stages] - exact family.stageUnion_restrict i - · intro i - rw [transitions] - exact family.transitionUnion_restrict i - -end MainPrefixGraphFamily - -namespace GroundMainPrefix.FixedTopStage -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} -variable {i₀ : I} (data : run.FixedTopStage i₀) - -theorem transition_oldProfilePreservation (preserved : run.PreservesOldProfiles) (i : I) : - OldProfilePreservationCode (run.diagram.stage i).stage.carrier - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph - data.stage.carrier data.stage.order data.stage.meetGraph (data.transition i).points - (M.groundPower (run.diagram.stage i).stage.carrier) := by - rw [data.carrier_eq, data.order_eq, data.meet_eq, data.transition_points] - exact (run.limitPointMap_oldProfilePreservation preserved i).fixedTop run.limitMeet_code - (run.limitPointMap_injection i).function.1 - -namespace RankedChronology -variable {data} {level : GroundMainCandidateLevel M K} (chronology : data.RankedChronology level) - -theorem transition_preservesOldProfiles (preserved : run.PreservesOldProfiles) (i : I) : - (chronology.transition i).PreservesOldProfiles := - data.transition_oldProfilePreservation preserved i - -end RankedChronology -end GroundMainPrefix.FixedTopStage - -namespace GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_rawCoveredPreservedAppendLimit (preserved : run.PreservesOldProfiles) (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indexMember : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) : - ∃ data : run.FixedTopStage i₀, - ∃ chronology : data.RankedChronology level, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - (∀ i : I, extended.key (i : WithTop I) = run.key i) ∧ - extended.key ⊤ = run.indices ∧ - (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ extended.transitionGraph ↔ - z = (chronology.cone.leg i).map.code) ∧ - run.LimitCoverage chronology.main chronology.cone ∧ - MainLimitCoverageGraphCode run.indices run.stageGraph extended.transitionGraph - target.main.stage.carrier target.main.stage.actors target.main.stage.order - target.main.stage.top target.main.cutoff target.main.birth ∧ - target.main = chronology.main ∧ - target.serial.code = chronology.serial.code ∧ - extended.PreservesOldProfiles ∧ - target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ - target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ - target.serial.code ∈ level.validChronologies C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - extended.code ∈ level.preservedMainPrefixes Labels C D rD ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (∀ i : I, - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ - (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ - (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → - ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ - ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by - have indices := M.groundOmegaOne_member_countable pairing unions powers separation collection infinite indexMember - have below : GroundBelow M run.indices K := - ⟨ZFSet.omega, standard.omega_mem pairing unions powers separation hK, indices⟩ - obtain ⟨data⟩ := run.exists_fixedTopMainStage i₀ collection infinite choice columns_eq indices - obtain ⟨chronology⟩ := data.exists_rankedChronology collection infinite choice hK standard below oldRank level - let target := chronology.linked infinite choice hK standard below oldRank - have conditions := standard.to_conditions pairing unions powers separation hK - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - obtain ⟨row, ground, function, entries, rowRank⟩ := run.exists_limitTransitionRow limit oldRank - have rowEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ - z = (chronology.cone.leg i).map.code := entries - let extended := run.appendCone target chronology.cone ground function rowEntries chronology.cone_coverage - have rank : ZFSet.rank extended.code < ZFSet.rank K := - run.appendCone_code_rank_lt target chronology.cone ground function rowEntries chronology.cone_coverage - limit oldRank (target.code_rank_lt pairing unions powers separation infinite hK conditions) rowRank - have preservedExtended : extended.PreservesOldProfiles := - run.appendCone_preservesOldProfiles preserved target chronology.cone ground function - rowEntries chronology.cone_coverage - (fun i => chronology.transition_preservesOldProfiles preserved i) - have wholeEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ extended.transitionGraph ↔ - z = (chronology.cone.leg i).map.code := by - intro i z - exact extended.transitionGraph_entry (show (i : WithTop I) ≤ ⊤ from le_top) z - have rawCoverage := (run.limitCoverage_graph_iff chronology.cone wholeEntries).2 chronology.limitCoverage - have indexEqual := run.appendCone_indices target chronology.cone ground function rowEntries chronology.cone_coverage - have extendedIndexMember : extended.indices ∈ - M.groundOmegaOne pairing unions powers separation collection infinite := by - rw [indexEqual] - exact M.groundOmegaOne_successor pairing unions powers separation collection infinite indexMember - refine ⟨data, chronology, target, extended, (fun _ => rfl), rfl, wholeEntries, - chronology.limitCoverage, rawCoverage, rfl, rfl, preservedExtended, - rfl, rfl, chronology.main_birth, chronology.code_member, - indexEqual, extendedIndexMember, - extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, - level.prefix_mem_preservedMainPrefixes extended preservedExtended rank, - run.appendCone_linked_old target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_linked_top target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_stageGraph target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_stageGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, - run.appendCone_transitionGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, - ?_, ?_, ?_⟩ - · intro i j before - rfl - · intro i - exact ⟨rfl, rfl⟩ - · intro i x y entry - exact data.point_strict_top i entry - -end GroundMainPrefix - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedProfileImageTests +import OAI.SetTheory.PartitionPrinciple.Definability.MainLimitCoverageFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.FixedTopProfilePreservation +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainFinalRowTerms + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitPointMap_later_entry {i j : I} (before : i ≤ j) {x y q : ZFSet.{u}} + (entry : ZFSet.pair x y ∈ (run.diagram.transition before).map.points) + (image : ZFSet.pair x q ∈ run.limitPointMap i) : + ZFSet.pair y q ∈ run.limitPointMap j := + (run.pointPresentation.inclusion_entry j y q).2 + ⟨(run.pointSystem.map_entry_bounds before entry).2, + ((run.pointPresentation.inclusion_entry i x q).1 image).2.trans + (run.pointPresentation.limitPoint_transition before entry)⟩ + +theorem limitPointMap_oldProfilePreservation (preserved : run.PreservesOldProfiles) (i : I) : + OldProfilePreservationCode (run.diagram.stage i).stage.carrier + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph + run.limitPoints run.limitOrder run.limitMeetGraph (run.limitPointMap i) + (M.groundPower (run.diagram.stage i).stage.carrier) := by + intro F hF c hc E hE cap hcap profile c' hc' E' hE' cap' hcap' imageC imageE imageCap + let embedding := run.limitPointMap_meetEmbedding i + refine ⟨hc', hE', hcap', fun _ member => ((mem_relationImage _ _ _ _).1 member).1, + ?_, ?_, embedding.monotone c cap c' cap' profile.target_below_cap imageC imageCap, + fun lower => profile.cap_not_below_target + ((run.limitPointMap_order_iff i cap c cap' c' imageCap imageC).1 lower), + fun lower => profile.separator_not_below_cap + ((run.limitPointMap_order_iff i E cap E' cap' imageE imageCap).1 lower)⟩ + · obtain ⟨f, hf⟩ := profile.nonempty + obtain ⟨f', entry, _⟩ := embedding.injection.function.2 f (profile.filter_subset hf) + exact ⟨f', (mem_relationImage _ _ _ _).2 + ⟨(ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)).2, f, hf, entry⟩⟩ + · intro q hq above + obtain ⟨j, x, hx, equal⟩ := run.pointPresentation.limitPoint_coverage hq + have imageX : ZFSet.pair x q ∈ run.limitPointMap j := + (run.pointPresentation.inclusion_entry j x q).2 ⟨hx, equal⟩ + obtain ⟨k, ik, jk⟩ := run.common_upper i j + obtain ⟨cK, cEntry⟩ := run.pointSystem.map_entry_total ik hc + obtain ⟨eK, eEntry⟩ := run.pointSystem.map_entry_total ik hE + obtain ⟨capK, capEntry⟩ := run.pointSystem.map_entry_total ik hcap + obtain ⟨xK, xEntry⟩ := run.pointSystem.map_entry_total jk hx + have atStage := preserved i k ik F hF c hc E hE cap hcap profile + cK (run.pointSystem.map_entry_bounds ik cEntry).2 + eK (run.pointSystem.map_entry_bounds ik eEntry).2 + capK (run.pointSystem.map_entry_bounds ik capEntry).2 cEntry eEntry capEntry + have tested := atStage.profile.at_embedding (run.limitPointMap_meetEmbedding k) + (run.diagram.stage k).stage.meet run.limitMeet_code atStage.filter_subset + (run.limitPointMap_later_entry ik cEntry imageC) + (run.limitPointMap_later_entry ik eEntry imageE) + (run.limitPointMap_later_entry ik capEntry imageCap) + (run.limitPointMap_later_entry jk xEntry imageX) above + have imageEqual : + relationImage (relationImage F (run.diagram.stage k).stage.carrier + (run.diagram.transition ik).map.points) run.limitPoints (run.limitPointMap k) = + relationImage F run.limitPoints (run.limitPointMap i) := + (relationImage_composition_on profile.filter_subset).trans + (congrArg (relationImage F run.limitPoints) (run.limitPointMap_comp ik)) + rw [imageEqual] at tested + exact tested + +end GroundMainPrefix + +section +open SetFormula SetRealization +universe u v + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +noncomputable def preservedMainPrefixCandidates (B K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (PreservedMainPrefixCode M K Labels C D rD) B + +theorem mem_preservedMainPrefixCandidates (B K Labels C D rD z : ZFSet.{u}) : + z ∈ M.preservedMainPrefixCandidates B K Labels C D rD ↔ + z ∈ B ∧ PreservedMainPrefixCode M K Labels C D rD z := ZFSet.mem_sep + +theorem preservedMainPrefixCandidates_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {B K Labels C D rD : ZFSet.{u}} (hB : B ∈ M.sets) (hK : K ∈ M.sets) + (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (ordinal : ordinalSetProperty K) : M.preservedMainPrefixCandidates B K Labels C D rD ∈ M.sets := by + let params := extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))))) + have ground : ∀ j, params j ∈ M.sets := Fin.cases hK (Fin.cases hLabels (Fin.cases hC + (Fin.cases hD (Fin.cases hrD (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))))) + have selected := M.separation_mem separation (preservedMainPrefixFormula 1 2 3 4 5 6 0) params ground hB + have equal : ZFSet.sep (fun z => Realize M.sets (preservedMainPrefixFormula 1 2 3 4 5 6 0) + (extend z params)) B = M.preservedMainPrefixCandidates B K Labels C D rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_preservedMainPrefixCandidates] + apply and_congr_right + intro hz + exact M.realize_preservedMainPrefixFormula pairing unions powers separation collection 1 2 3 4 5 6 0 + (extend z params) (Fin.cases (M.transitive hB hz) ground) rfl ordinal + exact equal ▸ selected + +end TransitiveGround + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) + +noncomputable def preservedMainPrefixes (Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + M.preservedMainPrefixCandidates level.carrier K Labels C D rD + +theorem preservedMainPrefixes_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) {Labels C D rD : ZFSet.{u}} + (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + level.preservedMainPrefixes Labels C D rD ∈ M.sets := + M.preservedMainPrefixCandidates_mem pairing unions powers separation collection infinite + level.carrier_ground hK hLabels hC hD hrD ordinal + +theorem mem_preservedMainPrefixes {Labels C D rD z : ZFSet.{u}} : + z ∈ level.preservedMainPrefixes Labels C D rD ↔ + z ∈ level.carrier ∧ PreservedMainPrefixCode M K Labels C D rD z := + M.mem_preservedMainPrefixCandidates level.carrier K Labels C D rD z + +theorem prefix_mem_preservedMainPrefixes + {pairing : Realize M.sets SetFormula.pairing Fin.elim0} + {unions : Realize M.sets SetFormula.union Fin.elim0} + {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} + {Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (preserved : run.PreservesOldProfiles) + (rank : ZFSet.rank run.code < ZFSet.rank K) : run.code ∈ level.preservedMainPrefixes Labels C D rD := + level.mem_preservedMainPrefixes.2 ⟨(level.membership _).2 ⟨run.code_ground, rank⟩, run.preserved_code preserved⟩ + +theorem exists_preservedPrefix_of_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Labels C D rD z : ZFSet.{u}} + (member : z ∈ level.preservedMainPrefixes Labels C D rD) : + ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, + letI := ordinalMainIndexPreorder ordinal + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), + run.indices = T ∧ run.code = z ∧ run.PreservesOldProfiles ∧ ZFSet.rank run.code < ZFSet.rank K := by + obtain ⟨carrier, code⟩ := level.mem_preservedMainPrefixes.1 member + obtain ⟨ground, rank⟩ := (level.membership z).1 carrier + obtain ⟨T, hT, ordinal, run, indices, equal, preserved⟩ := + code.exists_decodedPrefix pairing unions powers separation ground + exact ⟨T, hT, ordinal, run, indices, equal, preserved, equal.symm ▸ rank⟩ + +end GroundMainCandidateLevel +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_initialPreservedPrefixCandidate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, + ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), + level.preservedMainPrefixes C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ + run.code ∈ level.preservedMainPrefixes C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + run.indices = natSetCode 2 ∧ run.PreservesOldProfiles ∧ + ZFSet.rank run.code < ZFSet.rank K ∧ + run.diagram.stage 0 = seed.source ∧ run.diagram.stage 1 = certificate.target ∧ + (run.diagram.transition (show (0 : Fin 2) ≤ 1 from by decide)).map.code = + certificate.transition.map.code := by + dsimp only + obtain ⟨level, seed, certificate, run, _, preserved, _, indices, _, rank, first, second, crossing⟩ := + M.exists_groundInitialPreservedMainPrefix pairing unions powers separation collection infinite choice hK standard + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + exact ⟨level, seed, certificate, run, + level.preservedMainPrefixes_ground pairing unions powers separation collection infinite + hK standard.1.1 hC hC seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, + level.prefix_mem_preservedMainPrefixes run preserved rank, indices, preserved, rank, first, second, crossing⟩ + +end TransitiveGround + +namespace MainPrefixGraphFamily +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {I : Type v} [Small.{u} I] +variable (family : MainPrefixGraphFamily M K Labels C D rD I) + +theorem exists_rankedPreservedUnionPrefix + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (limit : Order.IsSuccLimit (ZFSet.rank K)) + (key : I → ZFSet.{u}) (injective : Function.Injective key) + (domain : ZFSet.range key ∈ M.sets) + (whole : familyCodeGraph key family.code ∈ M.sets) + (small : GroundBelow M (ZFSet.range key) K) + (ranks : ∀ i, ZFSet.rank (family.code i) < ZFSet.rank K) + (preserved : ∀ i, MainPrefixProfileGraphCode M K Labels C D rD + (family.stages i) (family.transitions i)) + (level : GroundMainCandidateLevel M K) : + letI := ordinalMainIndexPreorder family.indexUnion_ordinal + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation + (SetMembers family.indexUnion), + run.indices = family.indexUnion ∧ run.stageGraph = family.stageUnion ∧ + run.transitionGraph = family.transitionUnion ∧ run.code = family.unionCode ∧ + run.PreservesOldProfiles ∧ run.code ∈ M.sets ∧ + ZFSet.rank run.code < ZFSet.rank K ∧ + run.code ∈ level.preservedMainPrefixes Labels C D rD ∧ + (∀ i, graphRestriction (family.indices i) run.stageGraph = family.stages i) ∧ + (∀ i, graphRestriction (chronologyPairs (family.indices i)) run.transitionGraph = + family.transitions i) := by + let := ordinalMainIndexPreorder family.indexUnion_ordinal + obtain ⟨run, indices, stages, transitions, equal, preservation⟩ := + family.exists_preservedUnionPrefix pairing unions powers separation key injective domain whole preserved + have rank : ZFSet.rank run.code < ZFSet.rank K := by + rw [equal] + exact family.unionCode_rank_lt_small pairing unions powers separation collection hK ordinal + regular limit key injective domain whole small ranks + refine ⟨run, indices, stages, transitions, equal, preservation, run.code_ground, rank, + level.prefix_mem_preservedMainPrefixes run preservation rank, ?_, ?_⟩ + · intro i + rw [stages] + exact family.stageUnion_restrict i + · intro i + rw [transitions] + exact family.transitionUnion_restrict i + +end MainPrefixGraphFamily + +namespace GroundMainPrefix.FixedTopStage +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I} +variable {i₀ : I} (data : run.FixedTopStage i₀) + +theorem transition_oldProfilePreservation (preserved : run.PreservesOldProfiles) (i : I) : + OldProfilePreservationCode (run.diagram.stage i).stage.carrier + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph + data.stage.carrier data.stage.order data.stage.meetGraph (data.transition i).points + (M.groundPower (run.diagram.stage i).stage.carrier) := by + rw [data.carrier_eq, data.order_eq, data.meet_eq, data.transition_points] + exact (run.limitPointMap_oldProfilePreservation preserved i).fixedTop run.limitMeet_code + (run.limitPointMap_injection i).function.1 + +namespace RankedChronology +variable {data} {level : GroundMainCandidateLevel M K} (chronology : data.RankedChronology level) + +theorem transition_preservesOldProfiles (preserved : run.PreservesOldProfiles) (i : I) : + (chronology.transition i).PreservesOldProfiles := + data.transition_oldProfilePreservation preserved i + +end RankedChronology +end GroundMainPrefix.FixedTopStage + +namespace GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_rawCoveredPreservedAppendLimit (preserved : run.PreservesOldProfiles) (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indexMember : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) : + ∃ data : run.FixedTopStage i₀, + ∃ chronology : data.RankedChronology level, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + (∀ i : I, extended.key (i : WithTop I) = run.key i) ∧ + extended.key ⊤ = run.indices ∧ + (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ extended.transitionGraph ↔ + z = (chronology.cone.leg i).map.code) ∧ + run.LimitCoverage chronology.main chronology.cone ∧ + MainLimitCoverageGraphCode run.indices run.stageGraph extended.transitionGraph + target.main.stage.carrier target.main.stage.actors target.main.stage.order + target.main.stage.top target.main.cutoff target.main.birth ∧ + target.main = chronology.main ∧ + target.serial.code = chronology.serial.code ∧ + extended.PreservesOldProfiles ∧ + target.main.stage = data.stage ∧ target.main.cutoff = run.cutoffLimit ∧ + target.main.birth = fixedTopBirth run.limitPoints run.limitBirth run.cutoffLimit ∧ + target.serial.code ∈ level.validChronologies C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + extended.code ∈ level.preservedMainPrefixes Labels C D rD ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (∀ i : I, + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.points = run.limitPointMap i ∧ + (extended.diagram.transition (show (i : WithTop I) ≤ ⊤ from le_top)).map.actors = run.limitActorMap i) ∧ + (∀ (i : I) (x y : ZFSet.{u}), ZFSet.pair x y ∈ run.limitPointMap i → + ZFSet.pair y target.main.stage.top ∈ target.main.stage.order ∧ + ZFSet.pair target.main.stage.top y ∉ target.main.stage.order) := by + have indices := M.groundOmegaOne_member_countable pairing unions powers separation collection infinite indexMember + have below : GroundBelow M run.indices K := + ⟨ZFSet.omega, standard.omega_mem pairing unions powers separation hK, indices⟩ + obtain ⟨data⟩ := run.exists_fixedTopMainStage i₀ collection infinite choice columns_eq indices + obtain ⟨chronology⟩ := data.exists_rankedChronology collection infinite choice hK standard below oldRank level + let target := chronology.linked infinite choice hK standard below oldRank + have conditions := standard.to_conditions pairing unions powers separation hK + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + obtain ⟨row, ground, function, entries, rowRank⟩ := run.exists_limitTransitionRow limit oldRank + have rowEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ row ↔ + z = (chronology.cone.leg i).map.code := entries + let extended := run.appendCone target chronology.cone ground function rowEntries chronology.cone_coverage + have rank : ZFSet.rank extended.code < ZFSet.rank K := + run.appendCone_code_rank_lt target chronology.cone ground function rowEntries chronology.cone_coverage + limit oldRank (target.code_rank_lt pairing unions powers separation infinite hK conditions) rowRank + have preservedExtended : extended.PreservesOldProfiles := + run.appendCone_preservesOldProfiles preserved target chronology.cone ground function + rowEntries chronology.cone_coverage + (fun i => chronology.transition_preservesOldProfiles preserved i) + have wholeEntries : ∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ extended.transitionGraph ↔ + z = (chronology.cone.leg i).map.code := by + intro i z + exact extended.transitionGraph_entry (show (i : WithTop I) ≤ ⊤ from le_top) z + have rawCoverage := (run.limitCoverage_graph_iff chronology.cone wholeEntries).2 chronology.limitCoverage + have indexEqual := run.appendCone_indices target chronology.cone ground function rowEntries chronology.cone_coverage + have extendedIndexMember : extended.indices ∈ + M.groundOmegaOne pairing unions powers separation collection infinite := by + rw [indexEqual] + exact M.groundOmegaOne_successor pairing unions powers separation collection infinite indexMember + refine ⟨data, chronology, target, extended, (fun _ => rfl), rfl, wholeEntries, + chronology.limitCoverage, rawCoverage, rfl, rfl, preservedExtended, + rfl, rfl, chronology.main_birth, chronology.code_member, + indexEqual, extendedIndexMember, + extended.code_ground, rank, level.prefix_mem_validMainPrefixes extended rank, + level.prefix_mem_preservedMainPrefixes extended preservedExtended rank, + run.appendCone_linked_old target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_linked_top target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_stageGraph target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_stageGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, + run.appendCone_transitionGraph_restrict target chronology.cone ground function rowEntries chronology.cone_coverage, + ?_, ?_, ?_⟩ + · intro i j before + rfl + · intro i + exact ⟨rfl, rfl⟩ + · intro i x y entry + exact data.point_strict_top i entry + +end GroundMainPrefix + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRectangleLocalization.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRectangleLocalization.lean index f99d1d8693f4f0c217d40daf054eb94367e8ecd2..9e0fe7fc68f41baca8b96937017505d64811d304 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRectangleLocalization.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixRectangleLocalization.lean @@ -1,97 +1,97 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixLimitActionLaws -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingRectangles - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem rectangle_data_coverage {c b d X g h : ZFSet.{u}} - (hc : c ∈ run.limitPoints) (hb : b ∈ run.limitPoints) - (hd : d ∈ run.limitPoints) (hX : X ∈ run.limitPoints) - (hg : g ∈ run.limitActors) (hh : h ∈ run.limitActors) : - ∃ i c₀ b₀ d₀ X₀ g₀ h₀, - c₀ ∈ (run.diagram.stage i).stage.carrier ∧ b₀ ∈ (run.diagram.stage i).stage.carrier ∧ - d₀ ∈ (run.diagram.stage i).stage.carrier ∧ X₀ ∈ (run.diagram.stage i).stage.carrier ∧ - g₀ ∈ (run.diagram.stage i).stage.actors ∧ h₀ ∈ (run.diagram.stage i).stage.actors ∧ - c = run.pointPresentation.limitPoint i c₀ ∧ b = run.pointPresentation.limitPoint i b₀ ∧ - d = run.pointPresentation.limitPoint i d₀ ∧ X = run.pointPresentation.limitPoint i X₀ ∧ - g = run.actorPresentation.limitPoint i g₀ ∧ h = run.actorPresentation.limitPoint i h₀ := by - obtain ⟨i, c₀, b₀, d₀, hc₀, hb₀, hd₀, rfl, rfl, rfl⟩ := - run.pointPresentation.triple_coverage hc hb hd - obtain ⟨j, X₀, g₀, h₀, hX₀, hg₀, hh₀, rfl, rfl, rfl⟩ := - run.pointPresentation.mixed_triple_coverage run.actorPresentation run.actorPresentation hX hg hh - obtain ⟨k, ik, jk⟩ := run.common_upper i j - obtain ⟨c', cc⟩ := run.pointSystem.map_entry_total ik hc₀ - obtain ⟨b', bb⟩ := run.pointSystem.map_entry_total ik hb₀ - obtain ⟨d', dd⟩ := run.pointSystem.map_entry_total ik hd₀ - obtain ⟨X', XX⟩ := run.pointSystem.map_entry_total jk hX₀ - obtain ⟨g', gg⟩ := run.actorSystem.map_entry_total jk hg₀ - obtain ⟨h', hhhh⟩ := run.actorSystem.map_entry_total jk hh₀ - exact ⟨k, c', b', d', X', g', h', (run.pointSystem.map_entry_bounds ik cc).2, - (run.pointSystem.map_entry_bounds ik bb).2, (run.pointSystem.map_entry_bounds ik dd).2, - (run.pointSystem.map_entry_bounds jk XX).2, (run.actorSystem.map_entry_bounds jk gg).2, - (run.actorSystem.map_entry_bounds jk hhhh).2, run.pointPresentation.limitPoint_transition ik cc, - run.pointPresentation.limitPoint_transition ik bb, run.pointPresentation.limitPoint_transition ik dd, - run.pointPresentation.limitPoint_transition jk XX, run.actorPresentation.limitPoint_transition jk gg, - run.actorPresentation.limitPoint_transition jk hhhh⟩ - -theorem limitMaps_agreement_reflect (i : I) {g h v : ZFSet.{u}} - (hg : g ∈ (run.diagram.stage i).stage.actors) - (hh : h ∈ (run.diagram.stage i).stage.actors) - (hv : v ∈ (run.diagram.stage i).stage.carrier) - (agree : ActionAgreementBelow run.limitPoints run.limitOrder run.limitAction - (run.actorPresentation.limitPoint i g) (run.actorPresentation.limitPoint i h) - (run.pointPresentation.limitPoint i v)) : - ActionAgreementBelow (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order - (run.diagram.stage i).stage.action g h v := by - intro x hx y hy lower - have finalLower := (run.limitOrder_entry _ _).2 ((run.limitLE_at i hx hv).2 lower) - exact (run.limitAction_at i hg hx hy).symm.trans - ((agree _ (run.pointPresentation.limitPoint_mem hx) _ (run.pointPresentation.limitPoint_mem hy) - finalLower).trans (run.limitAction_at i hh hx hy)) - -theorem limitRectangle_reflect (i : I) {c b d g h : ZFSet.{u}} - (hc : c ∈ (run.diagram.stage i).stage.carrier) - (hb : b ∈ (run.diagram.stage i).stage.carrier) - (hd : d ∈ (run.diagram.stage i).stage.carrier) - (hg : g ∈ (run.diagram.stage i).stage.actors) - (hh : h ∈ (run.diagram.stage i).stage.actors) - (rectangle : ExternalRectangleCode run.limitPoints run.limitActors run.limitOrder - run.limitMeetGraph run.limitAction (run.pointPresentation.limitPoint i c) - (run.pointPresentation.limitPoint i b) (run.pointPresentation.limitPoint i d) - (run.actorPresentation.limitPoint i g) (run.actorPresentation.limitPoint i h)) : - ExternalRectangleCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.actors - (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph - (run.diagram.stage i).stage.action c b d g h := by - obtain ⟨_, _, _, _, _, cd, bd, W, _, meetW, agree, separated⟩ := rectangle - obtain ⟨w, meetw, _⟩ := (run.diagram.stage i).stage.meet.operation.2 - (ZFSet.pair c b) (ZFSet.pair_mem_prod.2 ⟨hc, hb⟩) - have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.meet.operation.1 meetw)).2 - have equal : W = run.pointPresentation.limitPoint i w := run.limitMeet_unique - ((run.limitMeetGraph_entry _ _ _).1 meetW) ((run.limitMeet_at i hc hb hw).2 meetw) - rw [equal] at agree separated - refine ⟨hc, hb, hd, hg, hh, (run.limitLE_at i hc hd).1 ((run.limitOrder_entry _ _).1 cd), - (run.limitLE_at i hb hd).1 ((run.limitOrder_entry _ _).1 bd), w, hw, meetw, - run.limitMaps_agreement_reflect i hg hh hw agree, ?_⟩ - intro y hy z hz v hv actions - exact (run.limitMeet_at i hy hz hv).1 ((run.limitMeetGraph_entry _ _ _).1 - (separated _ (run.pointPresentation.limitPoint_mem hy) _ (run.pointPresentation.limitPoint_mem hz) - _ (run.pointPresentation.limitPoint_mem hv) - ⟨(run.limitAction_at i hg hd hy).2 actions.1, (run.limitAction_at i hh hd hz).2 actions.2.1, - (run.limitAction_at i hg hw hv).2 actions.2.2⟩)) - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainPrefixLimitActionLaws +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundTaskBearingRectangles + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem rectangle_data_coverage {c b d X g h : ZFSet.{u}} + (hc : c ∈ run.limitPoints) (hb : b ∈ run.limitPoints) + (hd : d ∈ run.limitPoints) (hX : X ∈ run.limitPoints) + (hg : g ∈ run.limitActors) (hh : h ∈ run.limitActors) : + ∃ i c₀ b₀ d₀ X₀ g₀ h₀, + c₀ ∈ (run.diagram.stage i).stage.carrier ∧ b₀ ∈ (run.diagram.stage i).stage.carrier ∧ + d₀ ∈ (run.diagram.stage i).stage.carrier ∧ X₀ ∈ (run.diagram.stage i).stage.carrier ∧ + g₀ ∈ (run.diagram.stage i).stage.actors ∧ h₀ ∈ (run.diagram.stage i).stage.actors ∧ + c = run.pointPresentation.limitPoint i c₀ ∧ b = run.pointPresentation.limitPoint i b₀ ∧ + d = run.pointPresentation.limitPoint i d₀ ∧ X = run.pointPresentation.limitPoint i X₀ ∧ + g = run.actorPresentation.limitPoint i g₀ ∧ h = run.actorPresentation.limitPoint i h₀ := by + obtain ⟨i, c₀, b₀, d₀, hc₀, hb₀, hd₀, rfl, rfl, rfl⟩ := + run.pointPresentation.triple_coverage hc hb hd + obtain ⟨j, X₀, g₀, h₀, hX₀, hg₀, hh₀, rfl, rfl, rfl⟩ := + run.pointPresentation.mixed_triple_coverage run.actorPresentation run.actorPresentation hX hg hh + obtain ⟨k, ik, jk⟩ := run.common_upper i j + obtain ⟨c', cc⟩ := run.pointSystem.map_entry_total ik hc₀ + obtain ⟨b', bb⟩ := run.pointSystem.map_entry_total ik hb₀ + obtain ⟨d', dd⟩ := run.pointSystem.map_entry_total ik hd₀ + obtain ⟨X', XX⟩ := run.pointSystem.map_entry_total jk hX₀ + obtain ⟨g', gg⟩ := run.actorSystem.map_entry_total jk hg₀ + obtain ⟨h', hhhh⟩ := run.actorSystem.map_entry_total jk hh₀ + exact ⟨k, c', b', d', X', g', h', (run.pointSystem.map_entry_bounds ik cc).2, + (run.pointSystem.map_entry_bounds ik bb).2, (run.pointSystem.map_entry_bounds ik dd).2, + (run.pointSystem.map_entry_bounds jk XX).2, (run.actorSystem.map_entry_bounds jk gg).2, + (run.actorSystem.map_entry_bounds jk hhhh).2, run.pointPresentation.limitPoint_transition ik cc, + run.pointPresentation.limitPoint_transition ik bb, run.pointPresentation.limitPoint_transition ik dd, + run.pointPresentation.limitPoint_transition jk XX, run.actorPresentation.limitPoint_transition jk gg, + run.actorPresentation.limitPoint_transition jk hhhh⟩ + +theorem limitMaps_agreement_reflect (i : I) {g h v : ZFSet.{u}} + (hg : g ∈ (run.diagram.stage i).stage.actors) + (hh : h ∈ (run.diagram.stage i).stage.actors) + (hv : v ∈ (run.diagram.stage i).stage.carrier) + (agree : ActionAgreementBelow run.limitPoints run.limitOrder run.limitAction + (run.actorPresentation.limitPoint i g) (run.actorPresentation.limitPoint i h) + (run.pointPresentation.limitPoint i v)) : + ActionAgreementBelow (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.order + (run.diagram.stage i).stage.action g h v := by + intro x hx y hy lower + have finalLower := (run.limitOrder_entry _ _).2 ((run.limitLE_at i hx hv).2 lower) + exact (run.limitAction_at i hg hx hy).symm.trans + ((agree _ (run.pointPresentation.limitPoint_mem hx) _ (run.pointPresentation.limitPoint_mem hy) + finalLower).trans (run.limitAction_at i hh hx hy)) + +theorem limitRectangle_reflect (i : I) {c b d g h : ZFSet.{u}} + (hc : c ∈ (run.diagram.stage i).stage.carrier) + (hb : b ∈ (run.diagram.stage i).stage.carrier) + (hd : d ∈ (run.diagram.stage i).stage.carrier) + (hg : g ∈ (run.diagram.stage i).stage.actors) + (hh : h ∈ (run.diagram.stage i).stage.actors) + (rectangle : ExternalRectangleCode run.limitPoints run.limitActors run.limitOrder + run.limitMeetGraph run.limitAction (run.pointPresentation.limitPoint i c) + (run.pointPresentation.limitPoint i b) (run.pointPresentation.limitPoint i d) + (run.actorPresentation.limitPoint i g) (run.actorPresentation.limitPoint i h)) : + ExternalRectangleCode (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.actors + (run.diagram.stage i).stage.order (run.diagram.stage i).stage.meetGraph + (run.diagram.stage i).stage.action c b d g h := by + obtain ⟨_, _, _, _, _, cd, bd, W, _, meetW, agree, separated⟩ := rectangle + obtain ⟨w, meetw, _⟩ := (run.diagram.stage i).stage.meet.operation.2 + (ZFSet.pair c b) (ZFSet.pair_mem_prod.2 ⟨hc, hb⟩) + have hw := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.meet.operation.1 meetw)).2 + have equal : W = run.pointPresentation.limitPoint i w := run.limitMeet_unique + ((run.limitMeetGraph_entry _ _ _).1 meetW) ((run.limitMeet_at i hc hb hw).2 meetw) + rw [equal] at agree separated + refine ⟨hc, hb, hd, hg, hh, (run.limitLE_at i hc hd).1 ((run.limitOrder_entry _ _).1 cd), + (run.limitLE_at i hb hd).1 ((run.limitOrder_entry _ _).1 bd), w, hw, meetw, + run.limitMaps_agreement_reflect i hg hh hw agree, ?_⟩ + intro y hy z hz v hv actions + exact (run.limitMeet_at i hy hz hv).1 ((run.limitMeetGraph_entry _ _ _).1 + (separated _ (run.pointPresentation.limitPoint_mem hy) _ (run.pointPresentation.limitPoint_mem hz) + _ (run.pointPresentation.limitPoint_mem hv) + ⟨(run.limitAction_at i hg hd hy).2 actions.1, (run.limitAction_at i hh hd hz).2 actions.2.1, + (run.limitAction_at i hg hw hv).2 actions.2.2⟩)) + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedStepTotality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedStepTotality.lean index 348b8d49498a2f9b715485526449a2cc5c075728..b82538d5fabbdb0632ec380bcdf629939e294240 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedStepTotality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedStepTotality.lean @@ -1,458 +1,458 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixRawCoveredAppend -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixSelectedSuccessors - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetFormula -universe u - -def MainPrefixRecursionIndexCode (Omega z : ZFSet.{u}) : Prop := - ∃ T S E, z = mainPrefixCode T S E ∧ T ∈ Omega ∧ T ≠ ∅ - -theorem mainPrefixRecursionIndexCode_iff {Omega T S E : ZFSet.{u}} : - MainPrefixRecursionIndexCode Omega (mainPrefixCode T S E) ↔ T ∈ Omega ∧ T ≠ ∅ := by - constructor - · rintro ⟨T', S', E', equal, member, nonempty⟩ - have same := (mainPrefixCode_inj.1 equal).1 - exact same.symm ▸ ⟨member, nonempty⟩ - · rintro ⟨member, nonempty⟩ - exact ⟨T, S, E, rfl, member, nonempty⟩ - -namespace SetFormula -def mainPrefixRecursionIndexFormula {n} (Omega z : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let field := prefixIndex n 3 - exBlock 3 (BoundedFormula.conj - (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)) - (.conj (.mem (field 0) (old Omega)) (.neg (BoundedFormula.emptyFormula (field 0))))).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixRecursionIndexFormula {n} (Omega z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixRecursionIndexFormula Omega z) env ↔ - MainPrefixRecursionIndexCode (env Omega) (env z) := by - rw [mainPrefixRecursionIndexFormula, realize_exBlock] - have actual (fields : Fin 3 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : - Realize M.sets (BoundedFormula.conj - (BoundedFormula.mainPrefixTupleFormula (suffixIndex n 3 z) - (prefixIndex n 3 0) (prefixIndex n 3 1) (prefixIndex n 3 2)) - (.conj (.mem (prefixIndex n 3 0) (suffixIndex n 3 Omega)) - (.neg (BoundedFormula.emptyFormula (prefixIndex n 3 0))))).toFormula - (extendMany 3 fields env) ↔ - env z = mainPrefixCode (fields 0) (fields 1) (fields 2) ∧ - fields 0 ∈ env Omega ∧ fields 0 ≠ ∅ := by - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 3 fields env ground members)] - simp only [BoundedFormula.Truth, BoundedFormula.truth_mainPrefixTupleFormula, - BoundedFormula.truth_emptyFormula, extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨fields, ground, recognized⟩ - exact ⟨fields 0, fields 1, fields 2, (actual fields ground).1 recognized⟩ - · rintro ⟨T, S, E, equal, member, nonempty⟩ - have ground := M.mainPrefixCode_fields_mem (equal ▸ members z) - let fields : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) - have grounds : ∀ j, fields j ∈ M.sets := - Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) - exact ⟨fields, grounds, (actual fields grounds).2 ⟨equal, member, nonempty⟩⟩ - -end TransitiveGround - -end - -section -open SetFormula -universe u v - -def MainPrefixSelectedStepCode (f old next : ZFSet.{u}) : Prop := - ∃ b S E S' E' a target z, - old = mainPrefixCode (insert b b) S E ∧ - next = mainPrefixCode (insert (insert b b) (insert b b)) S' E' ∧ - MainPrefixExtends old next ∧ - ZFSet.pair b a ∈ S ∧ ZFSet.pair a (ZFSet.pair target z) ∈ f ∧ - ZFSet.pair (insert b b) target ∈ S' ∧ - ZFSet.pair (ZFSet.pair (insert b b) b) z ∈ E' - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem appendLast_selectedStepCode (last : I) (greatest : ∀ i, i ≤ last) - (target : GroundLinkedMainStage M K Labels C D rD) - (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) - (covered : step.CoversOldBirths) {b f : ZFSet.{u}} - (indices : run.indices = insert b b) (lastKey : run.key last = b) - (selected : ZFSet.pair (run.linked last).code (ZFSet.pair target.code step.map.code) ∈ f) : - MainPrefixSelectedStepCode f run.code (run.appendLast last greatest target step covered).code := by - let extended := run.appendLast last greatest target step covered - refine ⟨b, run.stageGraph, run.transitionGraph, extended.stageGraph, extended.transitionGraph, - (run.linked last).code, target.code, step.map.code, ?_, ?_, ?_, ?_, selected, ?_, ?_⟩ - · change mainPrefixCode run.indices run.stageGraph run.transitionGraph = _ - rw [indices] - · change mainPrefixCode extended.indices extended.stageGraph extended.transitionGraph = _ - rw [run.appendLast_indices last greatest target step covered, indices] - · apply (mainPrefixExtends_iff_restrictions run.graph_code extended.graph_code).2 - refine ⟨?_, run.appendLast_stageGraph_restrict last greatest target step covered, - run.appendLast_transitionGraph_restrict last greatest target step covered⟩ - intro x hx - rw [run.appendLast_indices last greatest target step covered] - exact ZFSet.mem_insert_iff.2 (Or.inr hx) - · rw [← lastKey] - exact (run.stageGraph_entry last _).2 rfl - · rw [← indices, run.appendLast_stageGraph last greatest target step covered] - exact ZFSet.mem_insert_iff.2 (Or.inl rfl) - · have entry := (extended.transitionGraph_entry (show (last : WithTop I) ≤ ⊤ from le_top) - step.map.code).2 (congrArg (fun t => t.map.code) - (run.appendLast_transition_last last greatest target step covered)).symm - change ZFSet.pair (ZFSet.pair run.indices (run.key last)) step.map.code ∈ extended.transitionGraph at entry - rw [indices, lastKey] at entry - exact entry - -end GroundMainPrefix - -end - -section -open SetFormula SetRealization -universe u v - -namespace SetFormula -def mainPrefixRecursionDomainFormula {n} (B Omega z : Fin n) : SetFormula n := - .conj (.mem z B) (mainPrefixRecursionIndexFormula Omega z) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixRecursionDomainFormula {n} (B Omega z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - Realize M.sets (mainPrefixRecursionDomainFormula B Omega z) env ↔ - env z ∈ ZFSet.sep (MainPrefixRecursionIndexCode (env Omega)) (env B) := by - change (env z ∈ env B ∧ Realize M.sets (mainPrefixRecursionIndexFormula Omega z) env) ↔ _ - rw [ZFSet.mem_sep] - exact and_congr Iff.rfl (M.realize_mainPrefixRecursionIndexFormula Omega z env members) - -end TransitiveGround - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (level : GroundMainCandidateLevel M K) - -noncomputable def recursionPrefixes (Omega Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (MainPrefixRecursionIndexCode Omega) (level.preservedMainPrefixes Labels C D rD) - -theorem mem_recursionPrefixes {Omega Labels C D rD z : ZFSet.{u}} : - z ∈ level.recursionPrefixes Omega Labels C D rD ↔ - z ∈ level.preservedMainPrefixes Labels C D rD ∧ MainPrefixRecursionIndexCode Omega z := - ZFSet.mem_sep - -theorem recursionPrefixes_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) - {Omega Labels C D rD : ZFSet.{u}} (hOmega : Omega ∈ M.sets) - (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - level.recursionPrefixes Omega Labels C D rD ∈ M.sets := by - have hB := level.preservedMainPrefixes_ground pairing unions powers separation collection infinite - hK ordinal hLabels hC hD hrD - let params : Fin 1 → ZFSet.{u} := fun _ => Omega - have ground : ∀ j, params j ∈ M.sets := fun _ => hOmega - have separated := M.separation_mem separation (mainPrefixRecursionIndexFormula 1 0) params ground hB - have equal : ZFSet.sep (fun z => Realize M.sets (mainPrefixRecursionIndexFormula 1 0) - (extend z params)) (level.preservedMainPrefixes Labels C D rD) = - level.recursionPrefixes Omega Labels C D rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, level.mem_recursionPrefixes] - apply and_congr_right - intro hz - exact M.realize_mainPrefixRecursionIndexFormula 1 0 (extend z params) - (Fin.cases (M.transitive hB hz) ground) - exact equal ▸ separated - -theorem prefix_mem_recursionPrefixes - {pairing : Realize M.sets SetFormula.pairing Fin.elim0} - {unions : Realize M.sets SetFormula.union Fin.elim0} - {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} - {Omega Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (preserved : run.PreservesOldProfiles) (rank : ZFSet.rank run.code < ZFSet.rank K) - (indices : run.indices ∈ Omega) (nonempty : run.indices ≠ ∅) : - run.code ∈ level.recursionPrefixes Omega Labels C D rD := - level.mem_recursionPrefixes.2 ⟨level.prefix_mem_preservedMainPrefixes run preserved rank, - mainPrefixRecursionIndexCode_iff.2 ⟨indices, nonempty⟩⟩ - -theorem exists_prefix_of_mem_recursionPrefixes - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Omega Labels C D rD z : ZFSet.{u}} - (member : z ∈ level.recursionPrefixes Omega Labels C D rD) : - ∃ T ∈ M.sets, T ∈ Omega ∧ T ≠ ∅ ∧ Nonempty (SetMembers T) ∧ - ∃ ordinal : ordinalSetProperty T, - letI := ordinalMainIndexPreorder ordinal - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), - run.indices = T ∧ run.code = z ∧ run.PreservesOldProfiles ∧ - ZFSet.rank run.code < ZFSet.rank K := by - obtain ⟨candidate, indexCode⟩ := level.mem_recursionPrefixes.1 member - obtain ⟨T, hT, ordinal, run, indices, equal, preserved, rank⟩ := - level.exists_preservedPrefix_of_mem pairing unions powers separation candidate - let := ordinalMainIndexPreorder ordinal - have index : run.indices ∈ Omega ∧ run.indices ≠ ∅ := - mainPrefixRecursionIndexCode_iff.1 (equal.symm ▸ indexCode) - have actual : T ∈ Omega ∧ T ≠ ∅ := indices ▸ index - have inhabited : Nonempty (SetMembers T) := by - classical - by_contra empty - apply actual.2 - apply (ZFSet.eq_empty T).2 - intro x hx - exact empty ⟨SetMembers.ofMem x hx⟩ - exact ⟨T, hT, actual.1, actual.2, inhabited, ordinal, run, indices, equal, preserved, rank⟩ - -end GroundMainCandidateLevel -end - -namespace TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_initialRecursionSeed - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, - ∃ seed : GroundInitialMainSeedData M K C, - ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), - ∃ initial : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) pairing unions powers separation - {i : Fin 2 // run.key i ∈ natSetCode 1}, - level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ - initial.code ∈ level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - initial.indices = natSetCode 1 ∧ initial.PreservesOldProfiles ∧ - initial.code ∈ M.sets ∧ ZFSet.rank initial.code < ZFSet.rank K ∧ - initial.stageGraph = graphRestriction (natSetCode 1) run.stageGraph ∧ - initial.transitionGraph = graphRestriction (chronologyPairs (natSetCode 1)) run.transitionGraph ∧ - ∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = seed.source := by - dsimp only - obtain ⟨level, seed, _, run, _, _, indices, preserved, rank, first, _, _⟩ := - M.exists_initialPreservedPrefixCandidate pairing unions powers separation collection infinite choice hK standard - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨initial, initialIndices, profiles, initialRank, stages, transitions, _, i, key, stage⟩ := - run.exists_initialRestriction indices preserved - (conditions.rank_isLimit pairing unions powers separation infinite hK) rank - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - have indexMember : initial.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by - apply ((M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.2.1 _).2 - refine ⟨initial.indices_ground, initial.indices_ordinal, ?_⟩ - rw [initialIndices] - exact M.natSetCode_countable pairing unions powers separation infinite 1 - have nonempty : initial.indices ≠ ∅ := by - rw [initialIndices] - intro equal - have member := (natSetCode_mem_iff 0 1).2 (by decide) - rw [equal] at member - exact ZFSet.notMem_empty _ member - exact ⟨level, seed, run, initial, - level.recursionPrefixes_ground pairing unions powers separation collection infinite hK standard.1.1 - hC hC hC seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, - level.prefix_mem_recursionPrefixes initial profiles initialRank indexMember nonempty, - initialIndices, profiles, initial.code_ground, initialRank, stages, transitions, - i, key, stage.trans first⟩ - -end TransitiveGround - -namespace GroundMainPrefix -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_selectedStepCode - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) (hLabels : Labels ∈ M.sets) - (preserved : run.PreservesOldProfiles) (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (member : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) - {b f : ZFSet.{u}} (indices : run.indices = insert b b) - (level : GroundMainCandidateLevel M K) - (function : ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K Labels C D rD) - (ZFSet.prod level.carrier level.carrier) f) - (selected : f ⊆ M.taskBearingSuccessorRelation - (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) : - ∃ next ∈ M.sets, - next ∈ level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD ∧ - MainPrefixSelectedStepCode f run.code next := by - have lastMember : b ∈ run.indices := by - rw [indices] - exact ZFSet.mem_insert_iff.2 (Or.inl rfl) - obtain ⟨last, lastKey⟩ := ZFSet.mem_range.1 lastMember - have greatest : ∀ i, i ≤ last := by - intro i - apply (run.key_order i last).2 - rw [lastKey] - have hi : run.key i ∈ run.indices := ZFSet.mem_range.2 ⟨i, rfl⟩ - rw [indices] at hi - exact ZFSet.mem_insert_iff.1 hi - have sourceMember : (run.linked last).code ∈ - M.linkedMainStageCandidates level.carrier K Labels C D rD := - (M.mem_linkedMainStageCandidates level.carrier K Labels C D rD _).2 - ⟨(level.membership _).2 ⟨(run.linked last).code_ground pairing, - (run.linkedCode_rank_lt_code last).trans oldRank⟩, run.linked last, rfl⟩ - have graph : FunctionGraphOn (M.linkedMainStageCandidates level.carrier K Labels C D rD) f := - ⟨ZFSet.prod level.carrier level.carrier, function⟩ - obtain ⟨output, entry⟩ := graph.total sourceMember - obtain ⟨targetCode, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨target, step, covered, extended, equal, profiles, targetEqual, mapEqual, - _, ground, rank, _, extendedIndices, _⟩ := - run.exists_rankedAppendSelected collection infinite last greatest preserved oldRank hK standard - hLabels level selected entry - have chosen : ZFSet.pair (run.linked last).code (ZFSet.pair target.code step.map.code) ∈ f := by - rw [targetEqual, mapEqual] - exact entry - have branch := run.appendLast_selectedStepCode last greatest target step covered indices lastKey chosen - rw [← equal] at branch - have newMember : extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by - rw [extendedIndices] - exact M.groundOmegaOne_successor pairing unions powers separation collection infinite member - have nonempty : extended.indices ≠ ∅ := by - rw [extendedIndices] - exact setSuccessor_ne_empty run.indices - exact ⟨extended.code, ground, level.prefix_mem_recursionPrefixes extended profiles rank newMember nonempty, branch⟩ - -end GroundMainPrefix - -open SetFormula SetRealization -universe u v w - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitStepCode_of_fields {J : Type w} [Small.{u} J] [Preorder J] - (target : GroundLinkedMainStage M K Labels C D rD) - (extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation J) - (indices : extended.indices = insert run.indices run.indices) - (extension : MainPrefixExtends run.code extended.code) - (entry : ZFSet.pair run.indices target.code ∈ extended.stageGraph) - (coverage : MainLimitCoverageGraphCode run.indices run.stageGraph extended.transitionGraph - target.main.stage.carrier target.main.stage.actors target.main.stage.order - target.main.stage.top target.main.cutoff target.main.birth) : - MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega run.code extended.code := by - let fields : Fin 32 → ZFSet.{u} := Fin.cases run.indices (Fin.cases run.stageGraph - (Fin.cases run.transitionGraph (Fin.cases extended.stageGraph (Fin.cases extended.transitionGraph - (Fin.cases target.code (Fin.cases target.main.birth (Fin.cases extended.indices target.rawFields))))))) - have ground : ∀ j, fields j ∈ M.sets := Fin.cases run.indices_ground (Fin.cases run.stages_ground - (Fin.cases run.transitions_ground (Fin.cases extended.stages_ground (Fin.cases extended.transitions_ground - (Fin.cases (target.code_ground pairing) (Fin.cases target.main.birth_ground - (Fin.cases extended.indices_ground (target.rawFields_ground pairing)))))))) - have targetFields : mainPrefixLimitTargetFields fields = target.rawFields := by - funext j - have same : Fin.natAdd 8 j = j.succ.succ.succ.succ.succ.succ.succ.succ := by - apply Fin.ext - change 8 + j.val = j.val + 8 - exact Nat.add_comm 8 j.val - change fields (Fin.natAdd 8 j) = target.rawFields j - rw [same] - rfl - refine ⟨fields, ground, ?_⟩ - unfold MainPrefixLimitStepRawCode - rw [targetFields] - exact ⟨indices, rfl, rfl, extension, entry, target.rawFields_code, - target.rawFields_birth_entry, coverage⟩ - -theorem exists_limitStepCode (preserved : run.PreservesOldProfiles) (i₀ : I) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (indexMember : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) : - ∃ next ∈ M.sets, - next ∈ level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD ∧ - MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega run.code next := by - obtain ⟨data, chronology, target, extended, _, _, _, _, coverage, _, _, profiles, - _, _, _, _, indices, indexMember', ground, rank, _, _, _, _, stageGraph, - stageRestriction, transitionRestriction, _⟩ := - run.exists_rawCoveredPreservedAppendLimit preserved i₀ collection infinite choice columns_eq - indexMember oldRank hK standard level - have extension : MainPrefixExtends run.code extended.code := by - apply (mainPrefixExtends_iff_restrictions run.graph_code extended.graph_code).2 - refine ⟨?_, stageRestriction, transitionRestriction⟩ - intro x hx - rw [indices] - exact ZFSet.mem_insert_iff.2 (Or.inr hx) - have entry : ZFSet.pair run.indices target.code ∈ extended.stageGraph := by - rw [stageGraph] - exact ZFSet.mem_insert_iff.2 (Or.inl rfl) - have nonempty : extended.indices ≠ ∅ := by - rw [indices] - exact setSuccessor_ne_empty run.indices - exact ⟨extended.code, ground, - level.prefix_mem_recursionPrefixes extended profiles rank indexMember' nonempty, - run.limitStepCode_of_fields target extended indices extension entry coverage⟩ - -end GroundMainPrefix - -namespace GroundMainCandidateLevel -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} (level : GroundMainCandidateLevel M K) - -theorem exists_limitStepCode - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - {Labels C D rD old : ZFSet.{u}} - (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (member : old ∈ level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) : - ∃ next ∈ M.sets, - next ∈ level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD ∧ - MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega old next := by - obtain ⟨T, _, indexMember, _, inhabited, ordinal, decoded⟩ := - level.exists_prefix_of_mem_recursionPrefixes pairing unions powers separation member - let := ordinalMainIndexPreorder ordinal - obtain ⟨run, indices, equal, preserved, rank⟩ := decoded - obtain ⟨i₀⟩ := inhabited - obtain ⟨next, ground, nextMember, step⟩ := run.exists_limitStepCode preserved i₀ - collection infinite choice columns_eq (indices.symm ▸ indexMember) rank hK standard level - exact ⟨next, ground, nextMember, equal ▸ step⟩ - -end GroundMainCandidateLevel - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixRawCoveredAppend +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixSelectedSuccessors + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetFormula +universe u + +def MainPrefixRecursionIndexCode (Omega z : ZFSet.{u}) : Prop := + ∃ T S E, z = mainPrefixCode T S E ∧ T ∈ Omega ∧ T ≠ ∅ + +theorem mainPrefixRecursionIndexCode_iff {Omega T S E : ZFSet.{u}} : + MainPrefixRecursionIndexCode Omega (mainPrefixCode T S E) ↔ T ∈ Omega ∧ T ≠ ∅ := by + constructor + · rintro ⟨T', S', E', equal, member, nonempty⟩ + have same := (mainPrefixCode_inj.1 equal).1 + exact same.symm ▸ ⟨member, nonempty⟩ + · rintro ⟨member, nonempty⟩ + exact ⟨T, S, E, rfl, member, nonempty⟩ + +namespace SetFormula +def mainPrefixRecursionIndexFormula {n} (Omega z : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let field := prefixIndex n 3 + exBlock 3 (BoundedFormula.conj + (BoundedFormula.mainPrefixTupleFormula (old z) (field 0) (field 1) (field 2)) + (.conj (.mem (field 0) (old Omega)) (.neg (BoundedFormula.emptyFormula (field 0))))).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixRecursionIndexFormula {n} (Omega z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixRecursionIndexFormula Omega z) env ↔ + MainPrefixRecursionIndexCode (env Omega) (env z) := by + rw [mainPrefixRecursionIndexFormula, realize_exBlock] + have actual (fields : Fin 3 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : + Realize M.sets (BoundedFormula.conj + (BoundedFormula.mainPrefixTupleFormula (suffixIndex n 3 z) + (prefixIndex n 3 0) (prefixIndex n 3 1) (prefixIndex n 3 2)) + (.conj (.mem (prefixIndex n 3 0) (suffixIndex n 3 Omega)) + (.neg (BoundedFormula.emptyFormula (prefixIndex n 3 0))))).toFormula + (extendMany 3 fields env) ↔ + env z = mainPrefixCode (fields 0) (fields 1) (fields 2) ∧ + fields 0 ∈ env Omega ∧ fields 0 ≠ ∅ := by + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 3 fields env ground members)] + simp only [BoundedFormula.Truth, BoundedFormula.truth_mainPrefixTupleFormula, + BoundedFormula.truth_emptyFormula, extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨fields, ground, recognized⟩ + exact ⟨fields 0, fields 1, fields 2, (actual fields ground).1 recognized⟩ + · rintro ⟨T, S, E, equal, member, nonempty⟩ + have ground := M.mainPrefixCode_fields_mem (equal ▸ members z) + let fields : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) + have grounds : ∀ j, fields j ∈ M.sets := + Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) + exact ⟨fields, grounds, (actual fields grounds).2 ⟨equal, member, nonempty⟩⟩ + +end TransitiveGround + +end + +section +open SetFormula +universe u v + +def MainPrefixSelectedStepCode (f old next : ZFSet.{u}) : Prop := + ∃ b S E S' E' a target z, + old = mainPrefixCode (insert b b) S E ∧ + next = mainPrefixCode (insert (insert b b) (insert b b)) S' E' ∧ + MainPrefixExtends old next ∧ + ZFSet.pair b a ∈ S ∧ ZFSet.pair a (ZFSet.pair target z) ∈ f ∧ + ZFSet.pair (insert b b) target ∈ S' ∧ + ZFSet.pair (ZFSet.pair (insert b b) b) z ∈ E' + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem appendLast_selectedStepCode (last : I) (greatest : ∀ i, i ≤ last) + (target : GroundLinkedMainStage M K Labels C D rD) + (step : GroundChronologicalMainTransition (run.diagram.stage last) target.main) + (covered : step.CoversOldBirths) {b f : ZFSet.{u}} + (indices : run.indices = insert b b) (lastKey : run.key last = b) + (selected : ZFSet.pair (run.linked last).code (ZFSet.pair target.code step.map.code) ∈ f) : + MainPrefixSelectedStepCode f run.code (run.appendLast last greatest target step covered).code := by + let extended := run.appendLast last greatest target step covered + refine ⟨b, run.stageGraph, run.transitionGraph, extended.stageGraph, extended.transitionGraph, + (run.linked last).code, target.code, step.map.code, ?_, ?_, ?_, ?_, selected, ?_, ?_⟩ + · change mainPrefixCode run.indices run.stageGraph run.transitionGraph = _ + rw [indices] + · change mainPrefixCode extended.indices extended.stageGraph extended.transitionGraph = _ + rw [run.appendLast_indices last greatest target step covered, indices] + · apply (mainPrefixExtends_iff_restrictions run.graph_code extended.graph_code).2 + refine ⟨?_, run.appendLast_stageGraph_restrict last greatest target step covered, + run.appendLast_transitionGraph_restrict last greatest target step covered⟩ + intro x hx + rw [run.appendLast_indices last greatest target step covered] + exact ZFSet.mem_insert_iff.2 (Or.inr hx) + · rw [← lastKey] + exact (run.stageGraph_entry last _).2 rfl + · rw [← indices, run.appendLast_stageGraph last greatest target step covered] + exact ZFSet.mem_insert_iff.2 (Or.inl rfl) + · have entry := (extended.transitionGraph_entry (show (last : WithTop I) ≤ ⊤ from le_top) + step.map.code).2 (congrArg (fun t => t.map.code) + (run.appendLast_transition_last last greatest target step covered)).symm + change ZFSet.pair (ZFSet.pair run.indices (run.key last)) step.map.code ∈ extended.transitionGraph at entry + rw [indices, lastKey] at entry + exact entry + +end GroundMainPrefix + +end + +section +open SetFormula SetRealization +universe u v + +namespace SetFormula +def mainPrefixRecursionDomainFormula {n} (B Omega z : Fin n) : SetFormula n := + .conj (.mem z B) (mainPrefixRecursionIndexFormula Omega z) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixRecursionDomainFormula {n} (B Omega z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + Realize M.sets (mainPrefixRecursionDomainFormula B Omega z) env ↔ + env z ∈ ZFSet.sep (MainPrefixRecursionIndexCode (env Omega)) (env B) := by + change (env z ∈ env B ∧ Realize M.sets (mainPrefixRecursionIndexFormula Omega z) env) ↔ _ + rw [ZFSet.mem_sep] + exact and_congr Iff.rfl (M.realize_mainPrefixRecursionIndexFormula Omega z env members) + +end TransitiveGround + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (level : GroundMainCandidateLevel M K) + +noncomputable def recursionPrefixes (Omega Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (MainPrefixRecursionIndexCode Omega) (level.preservedMainPrefixes Labels C D rD) + +theorem mem_recursionPrefixes {Omega Labels C D rD z : ZFSet.{u}} : + z ∈ level.recursionPrefixes Omega Labels C D rD ↔ + z ∈ level.preservedMainPrefixes Labels C D rD ∧ MainPrefixRecursionIndexCode Omega z := + ZFSet.mem_sep + +theorem recursionPrefixes_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) + {Omega Labels C D rD : ZFSet.{u}} (hOmega : Omega ∈ M.sets) + (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + level.recursionPrefixes Omega Labels C D rD ∈ M.sets := by + have hB := level.preservedMainPrefixes_ground pairing unions powers separation collection infinite + hK ordinal hLabels hC hD hrD + let params : Fin 1 → ZFSet.{u} := fun _ => Omega + have ground : ∀ j, params j ∈ M.sets := fun _ => hOmega + have separated := M.separation_mem separation (mainPrefixRecursionIndexFormula 1 0) params ground hB + have equal : ZFSet.sep (fun z => Realize M.sets (mainPrefixRecursionIndexFormula 1 0) + (extend z params)) (level.preservedMainPrefixes Labels C D rD) = + level.recursionPrefixes Omega Labels C D rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, level.mem_recursionPrefixes] + apply and_congr_right + intro hz + exact M.realize_mainPrefixRecursionIndexFormula 1 0 (extend z params) + (Fin.cases (M.transitive hB hz) ground) + exact equal ▸ separated + +theorem prefix_mem_recursionPrefixes + {pairing : Realize M.sets SetFormula.pairing Fin.elim0} + {unions : Realize M.sets SetFormula.union Fin.elim0} + {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} + {Omega Labels C D rD : ZFSet.{u}} {I : Type v} [Small.{u} I] [Preorder I] + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (preserved : run.PreservesOldProfiles) (rank : ZFSet.rank run.code < ZFSet.rank K) + (indices : run.indices ∈ Omega) (nonempty : run.indices ≠ ∅) : + run.code ∈ level.recursionPrefixes Omega Labels C D rD := + level.mem_recursionPrefixes.2 ⟨level.prefix_mem_preservedMainPrefixes run preserved rank, + mainPrefixRecursionIndexCode_iff.2 ⟨indices, nonempty⟩⟩ + +theorem exists_prefix_of_mem_recursionPrefixes + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Omega Labels C D rD z : ZFSet.{u}} + (member : z ∈ level.recursionPrefixes Omega Labels C D rD) : + ∃ T ∈ M.sets, T ∈ Omega ∧ T ≠ ∅ ∧ Nonempty (SetMembers T) ∧ + ∃ ordinal : ordinalSetProperty T, + letI := ordinalMainIndexPreorder ordinal + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), + run.indices = T ∧ run.code = z ∧ run.PreservesOldProfiles ∧ + ZFSet.rank run.code < ZFSet.rank K := by + obtain ⟨candidate, indexCode⟩ := level.mem_recursionPrefixes.1 member + obtain ⟨T, hT, ordinal, run, indices, equal, preserved, rank⟩ := + level.exists_preservedPrefix_of_mem pairing unions powers separation candidate + let := ordinalMainIndexPreorder ordinal + have index : run.indices ∈ Omega ∧ run.indices ≠ ∅ := + mainPrefixRecursionIndexCode_iff.1 (equal.symm ▸ indexCode) + have actual : T ∈ Omega ∧ T ≠ ∅ := indices ▸ index + have inhabited : Nonempty (SetMembers T) := by + classical + by_contra empty + apply actual.2 + apply (ZFSet.eq_empty T).2 + intro x hx + exact empty ⟨SetMembers.ofMem x hx⟩ + exact ⟨T, hT, actual.1, actual.2, inhabited, ordinal, run, indices, equal, preserved, rank⟩ + +end GroundMainCandidateLevel +end + +namespace TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_initialRecursionSeed + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, + ∃ seed : GroundInitialMainSeedData M K C, + ∃ run : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation (Fin 2), + ∃ initial : GroundMainPrefix M K C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) pairing unions powers separation + {i : Fin 2 // run.key i ∈ natSetCode 1}, + level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ + initial.code ∈ level.recursionPrefixes C C C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + initial.indices = natSetCode 1 ∧ initial.PreservesOldProfiles ∧ + initial.code ∈ M.sets ∧ ZFSet.rank initial.code < ZFSet.rank K ∧ + initial.stageGraph = graphRestriction (natSetCode 1) run.stageGraph ∧ + initial.transitionGraph = graphRestriction (chronologyPairs (natSetCode 1)) run.transitionGraph ∧ + ∃ i, initial.key i = natSetCode 0 ∧ initial.diagram.stage i = seed.source := by + dsimp only + obtain ⟨level, seed, _, run, _, _, indices, preserved, rank, first, _, _⟩ := + M.exists_initialPreservedPrefixCandidate pairing unions powers separation collection infinite choice hK standard + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨initial, initialIndices, profiles, initialRank, stages, transitions, _, i, key, stage⟩ := + run.exists_initialRestriction indices preserved + (conditions.rank_isLimit pairing unions powers separation infinite hK) rank + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + have indexMember : initial.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by + apply ((M.groundOmegaOne_spec pairing unions powers separation collection infinite).2.2.1 _).2 + refine ⟨initial.indices_ground, initial.indices_ordinal, ?_⟩ + rw [initialIndices] + exact M.natSetCode_countable pairing unions powers separation infinite 1 + have nonempty : initial.indices ≠ ∅ := by + rw [initialIndices] + intro equal + have member := (natSetCode_mem_iff 0 1).2 (by decide) + rw [equal] at member + exact ZFSet.notMem_empty _ member + exact ⟨level, seed, run, initial, + level.recursionPrefixes_ground pairing unions powers separation collection infinite hK standard.1.1 + hC hC hC seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, + level.prefix_mem_recursionPrefixes initial profiles initialRank indexMember nonempty, + initialIndices, profiles, initial.code_ground, initialRank, stages, transitions, + i, key, stage.trans first⟩ + +end TransitiveGround + +namespace GroundMainPrefix +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_selectedStepCode + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) (hLabels : Labels ∈ M.sets) + (preserved : run.PreservesOldProfiles) (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (member : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) + {b f : ZFSet.{u}} (indices : run.indices = insert b b) + (level : GroundMainCandidateLevel M K) + (function : ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K Labels C D rD) + (ZFSet.prod level.carrier level.carrier) f) + (selected : f ⊆ M.taskBearingSuccessorRelation + (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) : + ∃ next ∈ M.sets, + next ∈ level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD ∧ + MainPrefixSelectedStepCode f run.code next := by + have lastMember : b ∈ run.indices := by + rw [indices] + exact ZFSet.mem_insert_iff.2 (Or.inl rfl) + obtain ⟨last, lastKey⟩ := ZFSet.mem_range.1 lastMember + have greatest : ∀ i, i ≤ last := by + intro i + apply (run.key_order i last).2 + rw [lastKey] + have hi : run.key i ∈ run.indices := ZFSet.mem_range.2 ⟨i, rfl⟩ + rw [indices] at hi + exact ZFSet.mem_insert_iff.1 hi + have sourceMember : (run.linked last).code ∈ + M.linkedMainStageCandidates level.carrier K Labels C D rD := + (M.mem_linkedMainStageCandidates level.carrier K Labels C D rD _).2 + ⟨(level.membership _).2 ⟨(run.linked last).code_ground pairing, + (run.linkedCode_rank_lt_code last).trans oldRank⟩, run.linked last, rfl⟩ + have graph : FunctionGraphOn (M.linkedMainStageCandidates level.carrier K Labels C D rD) f := + ⟨ZFSet.prod level.carrier level.carrier, function⟩ + obtain ⟨output, entry⟩ := graph.total sourceMember + obtain ⟨targetCode, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨target, step, covered, extended, equal, profiles, targetEqual, mapEqual, + _, ground, rank, _, extendedIndices, _⟩ := + run.exists_rankedAppendSelected collection infinite last greatest preserved oldRank hK standard + hLabels level selected entry + have chosen : ZFSet.pair (run.linked last).code (ZFSet.pair target.code step.map.code) ∈ f := by + rw [targetEqual, mapEqual] + exact entry + have branch := run.appendLast_selectedStepCode last greatest target step covered indices lastKey chosen + rw [← equal] at branch + have newMember : extended.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by + rw [extendedIndices] + exact M.groundOmegaOne_successor pairing unions powers separation collection infinite member + have nonempty : extended.indices ≠ ∅ := by + rw [extendedIndices] + exact setSuccessor_ne_empty run.indices + exact ⟨extended.code, ground, level.prefix_mem_recursionPrefixes extended profiles rank newMember nonempty, branch⟩ + +end GroundMainPrefix + +open SetFormula SetRealization +universe u v w + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitStepCode_of_fields {J : Type w} [Small.{u} J] [Preorder J] + (target : GroundLinkedMainStage M K Labels C D rD) + (extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation J) + (indices : extended.indices = insert run.indices run.indices) + (extension : MainPrefixExtends run.code extended.code) + (entry : ZFSet.pair run.indices target.code ∈ extended.stageGraph) + (coverage : MainLimitCoverageGraphCode run.indices run.stageGraph extended.transitionGraph + target.main.stage.carrier target.main.stage.actors target.main.stage.order + target.main.stage.top target.main.cutoff target.main.birth) : + MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega run.code extended.code := by + let fields : Fin 32 → ZFSet.{u} := Fin.cases run.indices (Fin.cases run.stageGraph + (Fin.cases run.transitionGraph (Fin.cases extended.stageGraph (Fin.cases extended.transitionGraph + (Fin.cases target.code (Fin.cases target.main.birth (Fin.cases extended.indices target.rawFields))))))) + have ground : ∀ j, fields j ∈ M.sets := Fin.cases run.indices_ground (Fin.cases run.stages_ground + (Fin.cases run.transitions_ground (Fin.cases extended.stages_ground (Fin.cases extended.transitions_ground + (Fin.cases (target.code_ground pairing) (Fin.cases target.main.birth_ground + (Fin.cases extended.indices_ground (target.rawFields_ground pairing)))))))) + have targetFields : mainPrefixLimitTargetFields fields = target.rawFields := by + funext j + have same : Fin.natAdd 8 j = j.succ.succ.succ.succ.succ.succ.succ.succ := by + apply Fin.ext + change 8 + j.val = j.val + 8 + exact Nat.add_comm 8 j.val + change fields (Fin.natAdd 8 j) = target.rawFields j + rw [same] + rfl + refine ⟨fields, ground, ?_⟩ + unfold MainPrefixLimitStepRawCode + rw [targetFields] + exact ⟨indices, rfl, rfl, extension, entry, target.rawFields_code, + target.rawFields_birth_entry, coverage⟩ + +theorem exists_limitStepCode (preserved : run.PreservesOldProfiles) (i₀ : I) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (indexMember : run.indices ∈ M.groundOmegaOne pairing unions powers separation collection infinite) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) : + ∃ next ∈ M.sets, + next ∈ level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD ∧ + MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega run.code next := by + obtain ⟨data, chronology, target, extended, _, _, _, _, coverage, _, _, profiles, + _, _, _, _, indices, indexMember', ground, rank, _, _, _, _, stageGraph, + stageRestriction, transitionRestriction, _⟩ := + run.exists_rawCoveredPreservedAppendLimit preserved i₀ collection infinite choice columns_eq + indexMember oldRank hK standard level + have extension : MainPrefixExtends run.code extended.code := by + apply (mainPrefixExtends_iff_restrictions run.graph_code extended.graph_code).2 + refine ⟨?_, stageRestriction, transitionRestriction⟩ + intro x hx + rw [indices] + exact ZFSet.mem_insert_iff.2 (Or.inr hx) + have entry : ZFSet.pair run.indices target.code ∈ extended.stageGraph := by + rw [stageGraph] + exact ZFSet.mem_insert_iff.2 (Or.inl rfl) + have nonempty : extended.indices ≠ ∅ := by + rw [indices] + exact setSuccessor_ne_empty run.indices + exact ⟨extended.code, ground, + level.prefix_mem_recursionPrefixes extended profiles rank indexMember' nonempty, + run.limitStepCode_of_fields target extended indices extension entry coverage⟩ + +end GroundMainPrefix + +namespace GroundMainCandidateLevel +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} (level : GroundMainCandidateLevel M K) + +theorem exists_limitStepCode + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + {Labels C D rD old : ZFSet.{u}} + (columns_eq : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (member : old ∈ level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) : + ∃ next ∈ M.sets, + next ∈ level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD ∧ + MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega old next := by + obtain ⟨T, _, indexMember, _, inhabited, ordinal, decoded⟩ := + level.exists_prefix_of_mem_recursionPrefixes pairing unions powers separation member + let := ordinalMainIndexPreorder ordinal + obtain ⟨run, indices, equal, preserved, rank⟩ := decoded + obtain ⟨i₀⟩ := inhabited + obtain ⟨next, ground, nextMember, step⟩ := run.exists_limitStepCode preserved i₀ + collection infinite choice columns_eq (indices.symm ▸ indexMember) rank hK standard level + exact ⟨next, ground, nextMember, equal ▸ step⟩ + +end GroundMainCandidateLevel + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedSuccessors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedSuccessors.lean index d58b8ed05b3879a95e4594d1349e495faf6151aa..793763729426b60b4864ff6a76007b2061a80025 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedSuccessors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSelectedSuccessors.lean @@ -1,75 +1,75 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem exists_rankedAppendSelected - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (last : I) (greatest : ∀ i, i ≤ last) (preserved : run.PreservesOldProfiles) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) (hLabels : Labels ∈ M.sets) - (level : GroundMainCandidateLevel M K) {f targetCode z : ZFSet.{u}} - (selected : f ⊆ M.taskBearingSuccessorRelation - (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) - (entry : ZFSet.pair (run.linked last).code (ZFSet.pair targetCode z) ∈ f) : - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ step : GroundChronologicalMainTransition (run.diagram.stage last) target.main, - ∃ covered : step.CoversOldBirths, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - extended = run.appendLast last greatest target step covered ∧ - extended.PreservesOldProfiles ∧ - target.code = targetCode ∧ step.map.code = z ∧ step.PreservesOldProfiles ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices targetCode) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = z ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.points = step.map.points ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.actors = step.map.actors ∧ - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - (run.linked last).code (extended.linked ⊤).code - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code := by - have hC := (run.linked last).main.stage.columns_ground - have hD := (run.linked last).main.stage.coordinates_ground - have hrD := (run.linked last).main.stage.coordinate_order_ground - have hS := M.linkedMainStageCandidates_mem pairing unions powers separation collection infinite - level.carrier_ground hK hLabels hC hD hrD standard.1.1 - have subset : M.linkedMainStageCandidates level.carrier K Labels C D rD ⊆ level.carrier := by - intro x hx - exact ((M.mem_linkedMainStageCandidates level.carrier K Labels C D rD x).1 hx).1 - obtain ⟨_, targetMember, _, code⟩ := - (M.taskBearingSuccessorRelation_entry pairing unions powers separation collection infinite - hS level.carrier_ground hK hLabels hC hD hrD standard.1.1 subset - (run.linked last).code targetCode z).1 (selected entry) - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨target, step, covered, extended, equal, targetEqual, mapEqual, stepPreserved, rest⟩ := - run.exists_rankedAppendTaskBearing last greatest oldRank - (conditions.rank_isLimit pairing unions powers separation infinite hK) level - ((level.membership targetCode).1 (subset targetMember)).2 code - refine ⟨target, step, covered, extended, equal, ?_, targetEqual, mapEqual, stepPreserved, rest⟩ - rw [equal] - exact run.appendLast_preservesOldProfiles preserved last greatest target step covered stepPreserved - -end PartitionPilot.Forcing.GroundMainPrefix - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem exists_rankedAppendSelected + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (last : I) (greatest : ∀ i, i ≤ last) (preserved : run.PreservesOldProfiles) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) (hLabels : Labels ∈ M.sets) + (level : GroundMainCandidateLevel M K) {f targetCode z : ZFSet.{u}} + (selected : f ⊆ M.taskBearingSuccessorRelation + (M.linkedMainStageCandidates level.carrier K Labels C D rD) level.carrier K Labels C D rD) + (entry : ZFSet.pair (run.linked last).code (ZFSet.pair targetCode z) ∈ f) : + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ step : GroundChronologicalMainTransition (run.diagram.stage last) target.main, + ∃ covered : step.CoversOldBirths, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + extended = run.appendLast last greatest target step covered ∧ + extended.PreservesOldProfiles ∧ + target.code = targetCode ∧ step.map.code = z ∧ step.PreservesOldProfiles ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices targetCode) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = z ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.points = step.map.points ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.actors = step.map.actors ∧ + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + (run.linked last).code (extended.linked ⊤).code + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code := by + have hC := (run.linked last).main.stage.columns_ground + have hD := (run.linked last).main.stage.coordinates_ground + have hrD := (run.linked last).main.stage.coordinate_order_ground + have hS := M.linkedMainStageCandidates_mem pairing unions powers separation collection infinite + level.carrier_ground hK hLabels hC hD hrD standard.1.1 + have subset : M.linkedMainStageCandidates level.carrier K Labels C D rD ⊆ level.carrier := by + intro x hx + exact ((M.mem_linkedMainStageCandidates level.carrier K Labels C D rD x).1 hx).1 + obtain ⟨_, targetMember, _, code⟩ := + (M.taskBearingSuccessorRelation_entry pairing unions powers separation collection infinite + hS level.carrier_ground hK hLabels hC hD hrD standard.1.1 subset + (run.linked last).code targetCode z).1 (selected entry) + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨target, step, covered, extended, equal, targetEqual, mapEqual, stepPreserved, rest⟩ := + run.exists_rankedAppendTaskBearing last greatest oldRank + (conditions.rank_isLimit pairing unions powers separation infinite hK) level + ((level.membership targetCode).1 (subset targetMember)).2 code + refine ⟨target, step, covered, extended, equal, ?_, targetEqual, mapEqual, stepPreserved, rest⟩ + rw [equal] + exact run.appendLast_preservesOldProfiles preserved last greatest target step covered stepPreserved + +end PartitionPilot.Forcing.GroundMainPrefix + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSuccessor.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSuccessor.lean index 62b9df187c143923a5aafded4dffbe194db78c81..fd36055b5a7b92a3f6906479fb27d44e85aa8c93 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSuccessor.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixSuccessor.lean @@ -1,93 +1,93 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix - -namespace OAI - - - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite - -include choice in -theorem exists_rankedAppendLast {K Labels D rD c : ZFSet.{u}} - {I : Type v} [Small.{u} I] [Preorder I] - (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - (last : I) (greatest : ∀ i, i ≤ last) - (oldRank : ZFSet.rank run.code < ZFSet.rank K) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (hLabels : Labels ∈ M.sets) (hc : c ∈ M.sets) - (dense : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) - (level : GroundMainCandidateLevel M K) : - ∃ certificate : GroundInitialMainSuccessorData M C D rD (run.linked last).main Labels, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), - target.main = certificate.target ∧ - target.serial.code ∈ level.validChronologies C D rD ∧ - extended.indices = insert run.indices run.indices ∧ - extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ - extended.code ∈ level.validMainPrefixes Labels C D rD ∧ - (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ - extended.linked ⊤ = target ∧ - extended.diagram.stage ⊤ = certificate.target ∧ - extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ - graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ - graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ - (∀ (i j : I) (before : i ≤ j), - (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = - (run.diagram.transition before).map.code) ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = - certificate.transition.map.code ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.points = - certificate.transition.map.points ∧ - (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.actors = - certificate.transition.map.actors := by - obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation - collection infinite choice (run.linked last).main hLabels hc dense above coordinateInjection - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨serial, _serialGround, serialRank, serialMember, agreement, _terminal⟩ := - certificate.exists_rankedTargetSerialization pairing unions powers separation collection infinite choice - hK conditions (run.linked last).invariant level (run.linked last).serial - (run.linked last).serial_rank (run.linked last).agreement - let target : GroundLinkedMainStage M K Labels C D rD := - ⟨certificate.target, serial, agreement, - certificate.target_invariant pairing unions powers separation collection infinite choice - hLabels hK standard (run.linked last).invariant, serialRank⟩ - let step : GroundChronologicalMainTransition (run.diagram.stage last) target.main := - certificate.transition.retargetEq (run.linked_main last) rfl - have covered : step.CoversOldBirths := - (certificate.transition.retargetEq_coversOldBirths_iff (run.linked_main last) rfl).2 - certificate.coversOldBirths - let extended := run.appendLast last greatest target step covered - have rank : ZFSet.rank extended.code < ZFSet.rank K := - run.appendLast_code_rank_lt last greatest target step covered - (conditions.rank_isLimit pairing unions powers separation infinite hK) oldRank - (target.code_rank_lt pairing unions powers separation infinite hK conditions) - refine ⟨certificate, target, extended, rfl, serialMember, - run.appendLast_indices last greatest target step covered, extended.code_ground, rank, - level.prefix_mem_validMainPrefixes extended rank, - run.appendLast_linked_old last greatest target step covered, - run.appendLast_linked_top last greatest target step covered, rfl, - run.appendLast_stageGraph last greatest target step covered, - run.appendLast_stageGraph_restrict last greatest target step covered, - run.appendLast_transitionGraph_restrict last greatest target step covered, ?_, ?_, ?_, ?_⟩ - · intro i j before - rfl - · rw [run.appendLast_transition_last last greatest target step covered] - exact certificate.transition.retargetEq_code (run.linked_main last) rfl - · rw [run.appendLast_transition_last last greatest target step covered] - exact certificate.transition.retargetEq_points (run.linked_main last) rfl - · rw [run.appendLast_transition_last last greatest target step covered] - exact certificate.transition.retargetEq_actors (run.linked_main last) rfl - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix + +namespace OAI + + + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite + +include choice in +theorem exists_rankedAppendLast {K Labels D rD c : ZFSet.{u}} + {I : Type v} [Small.{u} I] [Preorder I] + (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + (last : I) (greatest : ∀ i, i ≤ last) + (oldRank : ZFSet.rank run.code < ZFSet.rank K) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (hLabels : Labels ∈ M.sets) (hc : c ∈ M.sets) + (dense : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) + (level : GroundMainCandidateLevel M K) : + ∃ certificate : GroundInitialMainSuccessorData M C D rD (run.linked last).main Labels, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + ∃ extended : GroundMainPrefix M K Labels C D rD pairing unions powers separation (WithTop I), + target.main = certificate.target ∧ + target.serial.code ∈ level.validChronologies C D rD ∧ + extended.indices = insert run.indices run.indices ∧ + extended.code ∈ M.sets ∧ ZFSet.rank extended.code < ZFSet.rank K ∧ + extended.code ∈ level.validMainPrefixes Labels C D rD ∧ + (∀ i : I, extended.linked (i : WithTop I) = run.linked i) ∧ + extended.linked ⊤ = target ∧ + extended.diagram.stage ⊤ = certificate.target ∧ + extended.stageGraph = insert (ZFSet.pair run.indices target.code) run.stageGraph ∧ + graphRestriction run.indices extended.stageGraph = run.stageGraph ∧ + graphRestriction (chronologyPairs run.indices) extended.transitionGraph = run.transitionGraph ∧ + (∀ (i j : I) (before : i ≤ j), + (extended.diagram.transition (WithTop.coe_le_coe.mpr before)).map.code = + (run.diagram.transition before).map.code) ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.code = + certificate.transition.map.code ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.points = + certificate.transition.map.points ∧ + (extended.diagram.transition (show (last : WithTop I) ≤ ⊤ from le_top)).map.actors = + certificate.transition.map.actors := by + obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation + collection infinite choice (run.linked last).main hLabels hc dense above coordinateInjection + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨serial, _serialGround, serialRank, serialMember, agreement, _terminal⟩ := + certificate.exists_rankedTargetSerialization pairing unions powers separation collection infinite choice + hK conditions (run.linked last).invariant level (run.linked last).serial + (run.linked last).serial_rank (run.linked last).agreement + let target : GroundLinkedMainStage M K Labels C D rD := + ⟨certificate.target, serial, agreement, + certificate.target_invariant pairing unions powers separation collection infinite choice + hLabels hK standard (run.linked last).invariant, serialRank⟩ + let step : GroundChronologicalMainTransition (run.diagram.stage last) target.main := + certificate.transition.retargetEq (run.linked_main last) rfl + have covered : step.CoversOldBirths := + (certificate.transition.retargetEq_coversOldBirths_iff (run.linked_main last) rfl).2 + certificate.coversOldBirths + let extended := run.appendLast last greatest target step covered + have rank : ZFSet.rank extended.code < ZFSet.rank K := + run.appendLast_code_rank_lt last greatest target step covered + (conditions.rank_isLimit pairing unions powers separation infinite hK) oldRank + (target.code_rank_lt pairing unions powers separation infinite hK conditions) + refine ⟨certificate, target, extended, rfl, serialMember, + run.appendLast_indices last greatest target step covered, extended.code_ground, rank, + level.prefix_mem_validMainPrefixes extended rank, + run.appendLast_linked_old last greatest target step covered, + run.appendLast_linked_top last greatest target step covered, rfl, + run.appendLast_stageGraph last greatest target step covered, + run.appendLast_stageGraph_restrict last greatest target step covered, + run.appendLast_transitionGraph_restrict last greatest target step covered, ?_, ?_, ?_, ?_⟩ + · intro i j before + rfl + · rw [run.appendLast_transition_last last greatest target step covered] + exact certificate.transition.retargetEq_code (run.linked_main last) rfl + · rw [run.appendLast_transition_last last greatest target step covered] + exact certificate.transition.retargetEq_points (run.linked_main last) rfl + · rw [run.appendLast_transition_last last greatest target step covered] + exact certificate.transition.retargetEq_actors (run.linked_main last) rfl + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixTopColumns.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixTopColumns.lean index a4fb3c7a2e69866c2c40818a1c5f942d21213ab6..1f42d1e89d951961b212f43111c07c1a9974963a 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixTopColumns.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainPrefixTopColumns.lean @@ -1,245 +1,245 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitChronologyCore - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -noncomputable def heightRangeFamily : ZFSet.{u} := familyCodeGraph run.key - (fun i => functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height) - -noncomputable def heightRangeValues : ZFSet.{u} := ZFSet.range - (fun i => functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height) - -theorem heightRangeFamily_ground : run.heightRangeFamily ∈ M.sets := - M.familyCodeGraph_functionRanges_ground pairing unions powers separation run.key - (fun i => (run.diagram.stage i).stage.carrier) (fun i => (run.diagram.stage i).stage.height) - run.key_injective run.indices_ground run.carrierFamily_ground (run.stageFieldFamily_ground 10) - -theorem heightRangeFamily_function : FunctionGraphOn run.indices run.heightRangeFamily := - familyCodeGraph_function run.key _ run.key_injective - -theorem heightRangeFamily_entry (i : I) (R : ZFSet.{u}) : - ZFSet.pair (run.key i) R ∈ run.heightRangeFamily ↔ - R = functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height := - pair_mem_familyCodeGraph run.key _ run.key_injective i R - -theorem heightRange_stage_eq (i : I) : - functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height = - relationImage (run.diagram.stage i).stage.carrier (ZFSet.prod C D) (run.diagram.stage i).stage.height := by - apply ZFSet.ext - intro y - rw [mem_functionGraphRange, mem_relationImage] - constructor - · intro h - obtain ⟨x, hx, entry⟩ := h - exact ⟨(ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.height_code.function.1 entry)).2, x, hx, entry⟩ - · exact And.right - -theorem heightRangeFamily_stage_entry (i : I) (R : ZFSet.{u}) : - ZFSet.pair (run.key i) R ∈ run.heightRangeFamily ↔ - R = relationImage (run.diagram.stage i).stage.carrier (ZFSet.prod C D) (run.diagram.stage i).stage.height := by - rw [run.heightRangeFamily_entry, run.heightRange_stage_eq] - -theorem heightRangeValues_ground : run.heightRangeValues ∈ M.sets := - M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.heightRangeFamily_ground - -theorem heightRangeValues_union : ⋃₀ run.heightRangeValues = run.limitHeightRange := by - apply ZFSet.ext - intro t - rw [heightRangeValues, familyCodeGraph_valueUnion_mem_iff, run.limitHeightRange_mem] - simp only [mem_functionGraphRange] - -theorem heightRangeFamily_rank_le_code : ZFSet.rank run.heightRangeFamily ≤ ZFSet.rank run.code := - (familyCodeGraph_functionRanges_rank_le run.key - (fun i => (run.diagram.stage i).stage.carrier) (fun i => (run.diagram.stage i).stage.height)).trans - (run.stageFieldFamily_rank_le_code 10) - -theorem heightRangeValues_rank_le_code : ZFSet.rank run.heightRangeValues ≤ ZFSet.rank run.code := - (familyCodeGraph_valueRange_rank_le run.key _).trans run.heightRangeFamily_rank_le_code - -theorem limitHeightRange_rank_le_code : ZFSet.rank run.limitHeightRange ≤ ZFSet.rank run.code := by - rw [← run.heightRangeValues_union] - exact (ZFSet.rank_sUnion_le _).trans run.heightRangeValues_rank_le_code - -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (indices : M.groundEmbeddable run.indices ZFSet.omega) -include infinite choice indices - -theorem heightRangeValues_countable : M.groundEmbeddable run.heightRangeValues ZFSet.omega := by - rw [heightRangeValues, familyCodeGraph_valueRange_eq run.key _] - exact M.groundEmbeddable_function_image pairing unions powers separation choice - run.indices_ground (M.union_mem unions (M.union_mem unions run.heightRangeFamily_ground)) - (M.omega_mem separation infinite) run.heightRangeFamily_ground - run.heightRangeFamily_function.to_isFunc indices - -theorem limitHeightRange_countable : M.groundEmbeddable run.limitHeightRange ZFSet.omega := by - rw [← run.heightRangeValues_union] - apply M.groundCountable_family_union pairing unions powers separation infinite choice - run.heightRangeValues_ground (run.heightRangeValues_countable infinite choice indices) - intro R hR - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hR - change M.groundEmbeddable - (functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height) ZFSet.omega - rw [run.heightRange_stage_eq i] - exact (run.diagram.stage i).stage.height_range_countable - -end PartitionPilot.Forcing.GroundMainPrefix - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem limitHeight_relationImage_eq : - relationImage run.limitPoints (ZFSet.prod C D) run.limitHeight = run.limitHeightRange := by - apply ZFSet.ext - intro y - rw [limitHeightRange, mem_functionGraphRange, mem_relationImage] - exact ⟨And.right, fun h => - ⟨(ZFSet.pair_mem_prod.1 (run.limitHeight_function.1 h.choose_spec.2)).2, h⟩⟩ - -theorem limitHeight_relationImage_countable - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (indices : M.groundEmbeddable run.indices ZFSet.omega) : - M.groundEmbeddable (relationImage run.limitPoints (ZFSet.prod C D) run.limitHeight) ZFSet.omega := by - rw [run.limitHeight_relationImage_eq] - exact run.limitHeightRange_countable infinite choice indices - -noncomputable def stageTopHeight (i : I) : ZFSet.{u} := - ((run.diagram.stage i).stage.height_code.value - ⟨(run.diagram.stage i).stage.top, (run.diagram.stage i).stage.top_mem⟩).val - -noncomputable def stageTopColumn (i : I) : ZFSet.{u} := - (show FunctionGraphOn (ZFSet.prod C D) (productFirst C D) from ⟨C, productFirst_function C D⟩).value - ((run.diagram.stage i).stage.height_code.value - ⟨(run.diagram.stage i).stage.top, (run.diagram.stage i).stage.top_mem⟩) - -noncomputable def topHeightFamily : ZFSet.{u} := familyCodeGraph run.key run.stageTopHeight - -noncomputable def topColumnFamily : ZFSet.{u} := familyCodeGraph run.key run.stageTopColumn - -noncomputable def topColumnValues : ZFSet.{u} := ZFSet.range run.stageTopColumn - -theorem stageTopHeight_entry (i : I) : - ZFSet.pair (run.diagram.stage i).stage.top (run.stageTopHeight i) ∈ (run.diagram.stage i).stage.height := - (run.diagram.stage i).stage.height_code.value_entry _ - -theorem stageTopHeight_column (i : I) : - run.stageTopColumn i ∈ C ∧ ∃ q ∈ D, run.stageTopHeight i = ZFSet.pair (run.stageTopColumn i) q := by - have entry := (show FunctionGraphOn (ZFSet.prod C D) (productFirst C D) from - ⟨C, productFirst_function C D⟩).value_entry - ((run.diagram.stage i).stage.height_code.value - ⟨(run.diagram.stage i).stage.top, (run.diagram.stage i).stage.top_mem⟩) - obtain ⟨c, hc, q, hq, equal⟩ := (mem_productFirst C D _).1 entry - have eqs := ZFSet.pair_inj.1 equal - change run.stageTopHeight i = ZFSet.pair c q ∧ run.stageTopColumn i = c at eqs - exact ⟨eqs.2.symm ▸ hc, q, hq, by simpa only [eqs.2] using eqs.1⟩ - -theorem topHeightFamily_ground : run.topHeightFamily ∈ M.sets := by - apply M.familyCodeGraph_evaluation_ground pairing unions powers separation run.key - (fun i => (run.diagram.stage i).stage.top) (fun i => (run.diagram.stage i).stage.height) - run.stageTopHeight run.key_injective run.indices_ground (run.stageFieldFamily_ground 9) - (run.stageFieldFamily_ground 10) - intro i y - exact ⟨fun entry => ((run.diagram.stage i).stage.height_code.value_eq_of_entry _ entry).symm, - fun equal => equal.symm ▸ run.stageTopHeight_entry i⟩ - -theorem topColumnFamily_ground : run.topColumnFamily ∈ M.sets := by - classical - let coordinate (i : I) := (run.stageTopHeight_column i).2.choose - have equal (i : I) : run.stageTopHeight i = ZFSet.pair (run.stageTopColumn i) (coordinate i) := - (run.stageTopHeight_column i).2.choose_spec.2 - have whole : familyCodeGraph run.key - (fun i => ZFSet.pair (run.stageTopColumn i) (coordinate i)) ∈ M.sets := by - simpa only [topHeightFamily, ← equal] using run.topHeightFamily_ground - exact (M.familyCodeGraph_pair_projections pairing unions powers separation run.key - run.stageTopColumn coordinate run.key_injective run.indices_ground whole).1 - -theorem topHeightFamily_function : FunctionGraphOn run.indices run.topHeightFamily := - familyCodeGraph_function run.key _ run.key_injective - -theorem topColumnFamily_function : FunctionGraphOn run.indices run.topColumnFamily := - familyCodeGraph_function run.key _ run.key_injective - -theorem topHeightFamily_entry (i : I) (y : ZFSet.{u}) : - ZFSet.pair (run.key i) y ∈ run.topHeightFamily ↔ y = run.stageTopHeight i := - pair_mem_familyCodeGraph run.key _ run.key_injective i y - -theorem topColumnFamily_entry (i : I) (c : ZFSet.{u}) : - ZFSet.pair (run.key i) c ∈ run.topColumnFamily ↔ c = run.stageTopColumn i := - pair_mem_familyCodeGraph run.key _ run.key_injective i c - -theorem topColumnValues_ground : run.topColumnValues ∈ M.sets := - M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.topColumnFamily_ground - -theorem topColumnValues_subset : run.topColumnValues ⊆ C := by - intro c hc - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hc - exact (run.stageTopHeight_column i).1 - -theorem topHeightFamily_rank_le_code : ZFSet.rank run.topHeightFamily ≤ ZFSet.rank run.code := - (familyCodeGraph_evaluation_rank_le run.key (fun i => (run.diagram.stage i).stage.top) - (fun i => (run.diagram.stage i).stage.height) run.stageTopHeight run.stageTopHeight_entry).trans - (run.stageFieldFamily_rank_le_code 10) - -theorem topColumnFamily_rank_le_code : ZFSet.rank run.topColumnFamily ≤ ZFSet.rank run.code := by - apply (familyCodeGraph_rank_mono run.key run.stageTopColumn run.stageTopHeight ?_).trans - run.topHeightFamily_rank_le_code - intro i - obtain ⟨q, _, equal⟩ := (run.stageTopHeight_column i).2 - have member : run.stageTopColumn i ∈ ⋃₀ run.stageTopHeight i := by - rw [equal] - exact ZFSet.mem_sUnion.2 ⟨{run.stageTopColumn i}, by simp [ZFSet.pair], by simp⟩ - exact (ZFSet.rank_lt_of_mem member).le.trans (ZFSet.rank_sUnion_le _) - -theorem topColumnValues_rank_le_code : ZFSet.rank run.topColumnValues ≤ ZFSet.rank run.code := - (familyCodeGraph_valueRange_rank_le run.key _).trans run.topColumnFamily_rank_le_code - -theorem topColumnValues_countable - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (indices : M.groundEmbeddable run.indices ZFSet.omega) : - M.groundEmbeddable run.topColumnValues ZFSet.omega := by - rw [topColumnValues, familyCodeGraph_valueRange_eq run.key _] - exact M.groundEmbeddable_function_image pairing unions powers separation choice - run.indices_ground (M.union_mem unions (M.union_mem unions run.topColumnFamily_ground)) - (M.omega_mem separation infinite) run.topColumnFamily_ground - run.topColumnFamily_function.to_isFunc indices - -theorem height_column_below_topColumn (i : I) {x c q : ZFSet.{u}} - (entry : ZFSet.pair x (ZFSet.pair c q) ∈ (run.diagram.stage i).stage.height) : - c = run.stageTopColumn i ∨ c ∈ run.stageTopColumn i := by - have hx := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.height_code.function.1 entry)).1 - obtain ⟨d, _, equal⟩ := (run.stageTopHeight_column i).2 - have topEntry : ZFSet.pair (run.diagram.stage i).stage.top (ZFSet.pair (run.stageTopColumn i) d) ∈ - (run.diagram.stage i).stage.height := equal ▸ run.stageTopHeight_entry i - by_cases same : x = (run.diagram.stage i).stage.top - · have eq : ZFSet.pair c q = ZFSet.pair (run.stageTopColumn i) d := - (show FunctionGraphOn (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height from - ⟨ZFSet.prod C D, (run.diagram.stage i).stage.height_code.function⟩).unique (same ▸ entry) topEntry - exact Or.inl (ZFSet.pair_inj.1 eq).1 - · rcases (run.diagram.stage i).stage.height_code.strict x hx _ (run.diagram.stage i).stage.top_mem - c q (run.stageTopColumn i) d ((run.diagram.stage i).stage.greatest x hx) same entry topEntry with less | eq - · exact Or.inr less - · exact Or.inl eq.1 - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitChronologyCore + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +noncomputable def heightRangeFamily : ZFSet.{u} := familyCodeGraph run.key + (fun i => functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height) + +noncomputable def heightRangeValues : ZFSet.{u} := ZFSet.range + (fun i => functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height) + +theorem heightRangeFamily_ground : run.heightRangeFamily ∈ M.sets := + M.familyCodeGraph_functionRanges_ground pairing unions powers separation run.key + (fun i => (run.diagram.stage i).stage.carrier) (fun i => (run.diagram.stage i).stage.height) + run.key_injective run.indices_ground run.carrierFamily_ground (run.stageFieldFamily_ground 10) + +theorem heightRangeFamily_function : FunctionGraphOn run.indices run.heightRangeFamily := + familyCodeGraph_function run.key _ run.key_injective + +theorem heightRangeFamily_entry (i : I) (R : ZFSet.{u}) : + ZFSet.pair (run.key i) R ∈ run.heightRangeFamily ↔ + R = functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height := + pair_mem_familyCodeGraph run.key _ run.key_injective i R + +theorem heightRange_stage_eq (i : I) : + functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height = + relationImage (run.diagram.stage i).stage.carrier (ZFSet.prod C D) (run.diagram.stage i).stage.height := by + apply ZFSet.ext + intro y + rw [mem_functionGraphRange, mem_relationImage] + constructor + · intro h + obtain ⟨x, hx, entry⟩ := h + exact ⟨(ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.height_code.function.1 entry)).2, x, hx, entry⟩ + · exact And.right + +theorem heightRangeFamily_stage_entry (i : I) (R : ZFSet.{u}) : + ZFSet.pair (run.key i) R ∈ run.heightRangeFamily ↔ + R = relationImage (run.diagram.stage i).stage.carrier (ZFSet.prod C D) (run.diagram.stage i).stage.height := by + rw [run.heightRangeFamily_entry, run.heightRange_stage_eq] + +theorem heightRangeValues_ground : run.heightRangeValues ∈ M.sets := + M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.heightRangeFamily_ground + +theorem heightRangeValues_union : ⋃₀ run.heightRangeValues = run.limitHeightRange := by + apply ZFSet.ext + intro t + rw [heightRangeValues, familyCodeGraph_valueUnion_mem_iff, run.limitHeightRange_mem] + simp only [mem_functionGraphRange] + +theorem heightRangeFamily_rank_le_code : ZFSet.rank run.heightRangeFamily ≤ ZFSet.rank run.code := + (familyCodeGraph_functionRanges_rank_le run.key + (fun i => (run.diagram.stage i).stage.carrier) (fun i => (run.diagram.stage i).stage.height)).trans + (run.stageFieldFamily_rank_le_code 10) + +theorem heightRangeValues_rank_le_code : ZFSet.rank run.heightRangeValues ≤ ZFSet.rank run.code := + (familyCodeGraph_valueRange_rank_le run.key _).trans run.heightRangeFamily_rank_le_code + +theorem limitHeightRange_rank_le_code : ZFSet.rank run.limitHeightRange ≤ ZFSet.rank run.code := by + rw [← run.heightRangeValues_union] + exact (ZFSet.rank_sUnion_le _).trans run.heightRangeValues_rank_le_code + +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (indices : M.groundEmbeddable run.indices ZFSet.omega) +include infinite choice indices + +theorem heightRangeValues_countable : M.groundEmbeddable run.heightRangeValues ZFSet.omega := by + rw [heightRangeValues, familyCodeGraph_valueRange_eq run.key _] + exact M.groundEmbeddable_function_image pairing unions powers separation choice + run.indices_ground (M.union_mem unions (M.union_mem unions run.heightRangeFamily_ground)) + (M.omega_mem separation infinite) run.heightRangeFamily_ground + run.heightRangeFamily_function.to_isFunc indices + +theorem limitHeightRange_countable : M.groundEmbeddable run.limitHeightRange ZFSet.omega := by + rw [← run.heightRangeValues_union] + apply M.groundCountable_family_union pairing unions powers separation infinite choice + run.heightRangeValues_ground (run.heightRangeValues_countable infinite choice indices) + intro R hR + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hR + change M.groundEmbeddable + (functionGraphRange (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height) ZFSet.omega + rw [run.heightRange_stage_eq i] + exact (run.diagram.stage i).stage.height_range_countable + +end PartitionPilot.Forcing.GroundMainPrefix + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem limitHeight_relationImage_eq : + relationImage run.limitPoints (ZFSet.prod C D) run.limitHeight = run.limitHeightRange := by + apply ZFSet.ext + intro y + rw [limitHeightRange, mem_functionGraphRange, mem_relationImage] + exact ⟨And.right, fun h => + ⟨(ZFSet.pair_mem_prod.1 (run.limitHeight_function.1 h.choose_spec.2)).2, h⟩⟩ + +theorem limitHeight_relationImage_countable + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (indices : M.groundEmbeddable run.indices ZFSet.omega) : + M.groundEmbeddable (relationImage run.limitPoints (ZFSet.prod C D) run.limitHeight) ZFSet.omega := by + rw [run.limitHeight_relationImage_eq] + exact run.limitHeightRange_countable infinite choice indices + +noncomputable def stageTopHeight (i : I) : ZFSet.{u} := + ((run.diagram.stage i).stage.height_code.value + ⟨(run.diagram.stage i).stage.top, (run.diagram.stage i).stage.top_mem⟩).val + +noncomputable def stageTopColumn (i : I) : ZFSet.{u} := + (show FunctionGraphOn (ZFSet.prod C D) (productFirst C D) from ⟨C, productFirst_function C D⟩).value + ((run.diagram.stage i).stage.height_code.value + ⟨(run.diagram.stage i).stage.top, (run.diagram.stage i).stage.top_mem⟩) + +noncomputable def topHeightFamily : ZFSet.{u} := familyCodeGraph run.key run.stageTopHeight + +noncomputable def topColumnFamily : ZFSet.{u} := familyCodeGraph run.key run.stageTopColumn + +noncomputable def topColumnValues : ZFSet.{u} := ZFSet.range run.stageTopColumn + +theorem stageTopHeight_entry (i : I) : + ZFSet.pair (run.diagram.stage i).stage.top (run.stageTopHeight i) ∈ (run.diagram.stage i).stage.height := + (run.diagram.stage i).stage.height_code.value_entry _ + +theorem stageTopHeight_column (i : I) : + run.stageTopColumn i ∈ C ∧ ∃ q ∈ D, run.stageTopHeight i = ZFSet.pair (run.stageTopColumn i) q := by + have entry := (show FunctionGraphOn (ZFSet.prod C D) (productFirst C D) from + ⟨C, productFirst_function C D⟩).value_entry + ((run.diagram.stage i).stage.height_code.value + ⟨(run.diagram.stage i).stage.top, (run.diagram.stage i).stage.top_mem⟩) + obtain ⟨c, hc, q, hq, equal⟩ := (mem_productFirst C D _).1 entry + have eqs := ZFSet.pair_inj.1 equal + change run.stageTopHeight i = ZFSet.pair c q ∧ run.stageTopColumn i = c at eqs + exact ⟨eqs.2.symm ▸ hc, q, hq, by simpa only [eqs.2] using eqs.1⟩ + +theorem topHeightFamily_ground : run.topHeightFamily ∈ M.sets := by + apply M.familyCodeGraph_evaluation_ground pairing unions powers separation run.key + (fun i => (run.diagram.stage i).stage.top) (fun i => (run.diagram.stage i).stage.height) + run.stageTopHeight run.key_injective run.indices_ground (run.stageFieldFamily_ground 9) + (run.stageFieldFamily_ground 10) + intro i y + exact ⟨fun entry => ((run.diagram.stage i).stage.height_code.value_eq_of_entry _ entry).symm, + fun equal => equal.symm ▸ run.stageTopHeight_entry i⟩ + +theorem topColumnFamily_ground : run.topColumnFamily ∈ M.sets := by + classical + let coordinate (i : I) := (run.stageTopHeight_column i).2.choose + have equal (i : I) : run.stageTopHeight i = ZFSet.pair (run.stageTopColumn i) (coordinate i) := + (run.stageTopHeight_column i).2.choose_spec.2 + have whole : familyCodeGraph run.key + (fun i => ZFSet.pair (run.stageTopColumn i) (coordinate i)) ∈ M.sets := by + simpa only [topHeightFamily, ← equal] using run.topHeightFamily_ground + exact (M.familyCodeGraph_pair_projections pairing unions powers separation run.key + run.stageTopColumn coordinate run.key_injective run.indices_ground whole).1 + +theorem topHeightFamily_function : FunctionGraphOn run.indices run.topHeightFamily := + familyCodeGraph_function run.key _ run.key_injective + +theorem topColumnFamily_function : FunctionGraphOn run.indices run.topColumnFamily := + familyCodeGraph_function run.key _ run.key_injective + +theorem topHeightFamily_entry (i : I) (y : ZFSet.{u}) : + ZFSet.pair (run.key i) y ∈ run.topHeightFamily ↔ y = run.stageTopHeight i := + pair_mem_familyCodeGraph run.key _ run.key_injective i y + +theorem topColumnFamily_entry (i : I) (c : ZFSet.{u}) : + ZFSet.pair (run.key i) c ∈ run.topColumnFamily ↔ c = run.stageTopColumn i := + pair_mem_familyCodeGraph run.key _ run.key_injective i c + +theorem topColumnValues_ground : run.topColumnValues ∈ M.sets := + M.familyCodeGraph_valueRange_mem unions separation run.key _ run.indices_ground run.topColumnFamily_ground + +theorem topColumnValues_subset : run.topColumnValues ⊆ C := by + intro c hc + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hc + exact (run.stageTopHeight_column i).1 + +theorem topHeightFamily_rank_le_code : ZFSet.rank run.topHeightFamily ≤ ZFSet.rank run.code := + (familyCodeGraph_evaluation_rank_le run.key (fun i => (run.diagram.stage i).stage.top) + (fun i => (run.diagram.stage i).stage.height) run.stageTopHeight run.stageTopHeight_entry).trans + (run.stageFieldFamily_rank_le_code 10) + +theorem topColumnFamily_rank_le_code : ZFSet.rank run.topColumnFamily ≤ ZFSet.rank run.code := by + apply (familyCodeGraph_rank_mono run.key run.stageTopColumn run.stageTopHeight ?_).trans + run.topHeightFamily_rank_le_code + intro i + obtain ⟨q, _, equal⟩ := (run.stageTopHeight_column i).2 + have member : run.stageTopColumn i ∈ ⋃₀ run.stageTopHeight i := by + rw [equal] + exact ZFSet.mem_sUnion.2 ⟨{run.stageTopColumn i}, by simp [ZFSet.pair], by simp⟩ + exact (ZFSet.rank_lt_of_mem member).le.trans (ZFSet.rank_sUnion_le _) + +theorem topColumnValues_rank_le_code : ZFSet.rank run.topColumnValues ≤ ZFSet.rank run.code := + (familyCodeGraph_valueRange_rank_le run.key _).trans run.topColumnFamily_rank_le_code + +theorem topColumnValues_countable + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (indices : M.groundEmbeddable run.indices ZFSet.omega) : + M.groundEmbeddable run.topColumnValues ZFSet.omega := by + rw [topColumnValues, familyCodeGraph_valueRange_eq run.key _] + exact M.groundEmbeddable_function_image pairing unions powers separation choice + run.indices_ground (M.union_mem unions (M.union_mem unions run.topColumnFamily_ground)) + (M.omega_mem separation infinite) run.topColumnFamily_ground + run.topColumnFamily_function.to_isFunc indices + +theorem height_column_below_topColumn (i : I) {x c q : ZFSet.{u}} + (entry : ZFSet.pair x (ZFSet.pair c q) ∈ (run.diagram.stage i).stage.height) : + c = run.stageTopColumn i ∨ c ∈ run.stageTopColumn i := by + have hx := (ZFSet.pair_mem_prod.1 ((run.diagram.stage i).stage.height_code.function.1 entry)).1 + obtain ⟨d, _, equal⟩ := (run.stageTopHeight_column i).2 + have topEntry : ZFSet.pair (run.diagram.stage i).stage.top (ZFSet.pair (run.stageTopColumn i) d) ∈ + (run.diagram.stage i).stage.height := equal ▸ run.stageTopHeight_entry i + by_cases same : x = (run.diagram.stage i).stage.top + · have eq : ZFSet.pair c q = ZFSet.pair (run.stageTopColumn i) d := + (show FunctionGraphOn (run.diagram.stage i).stage.carrier (run.diagram.stage i).stage.height from + ⟨ZFSet.prod C D, (run.diagram.stage i).stage.height_code.function⟩).unique (same ▸ entry) topEntry + exact Or.inl (ZFSet.pair_inj.1 eq).1 + · rcases (run.diagram.stage i).stage.height_code.strict x hx _ (run.diagram.stage i).stage.top_mem + c q (run.stageTopColumn i) d ((run.diagram.stage i).stage.greatest x hx) same entry topEntry with less | eq + · exact Or.inr less + · exact Or.inl eq.1 + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageCandidates.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageCandidates.lean index 07b42a30b4b0efb6672391608fe31d8381c15455..f89790c63d578cd4af7fc3f25e1d4a7d1a4a0c38 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageCandidates.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageCandidates.lean @@ -1,325 +1,325 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BoundedMeetOrderCodes -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPowerImageGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.StrictLexHeightFormulas - -namespace OAI - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure MainStageLaws (P r μ G m inv one A b t height C D rD : ZFSet.{u}) : Prop where - meet : MeetOrderCode P r μ - group : GroupCode G m inv one - action : PosetActionCode G P m one r A - bottom_mem : b ∈ P - least : ∀ x ∈ P, ZFSet.pair b x ∈ r - top_mem : t ∈ P - greatest : ∀ x ∈ P, ZFSet.pair x t ∈ r - height_code : StrictLexHeightCode P C D r height rD - -def MainStageValidity (M : TransitiveGround.{u}) - (P r μ G m inv one A b t height C D rD : ZFSet.{u}) : Prop := - MainStageLaws P r μ G m inv one A b t height C D rD ∧ - M.groundEmbeddable (relationImage P (ZFSet.prod C D) height) ZFSet.omega - -namespace BoundedFormula - -def bottomFormula {n} (P r b : Fin n) : BoundedFormula n := - .conj (.mem b P) (.allMem P (pairMembershipFormula b.succ 0 r.succ)) - -theorem truth_bottomFormula {n} (P r b : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (bottomFormula P r b) env ↔ - env b ∈ env P ∧ ∀ x ∈ env P, ZFSet.pair (env b) x ∈ env r := by - simp only [bottomFormula, Truth, truth_pairMembershipFormula] - rfl - -def productEquationFormula {n} (B C D : Fin n) : BoundedFormula n := - .conj (.allMem B (productElementFormula 0 C.succ D.succ)) - (.allMem C (.allMem D.succ (pairMembershipFormula 1 0 B.succ.succ))) - -theorem truth_productEquationFormula {n} (B C D : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (productEquationFormula B C D) env ↔ env B = ZFSet.prod (env C) (env D) := by - simp only [productEquationFormula, Truth, truth_productElementFormula, - truth_pairMembershipFormula] - change ((∀ z ∈ env B, z ∈ ZFSet.prod (env C) (env D)) ∧ - ∀ c ∈ env C, ∀ d ∈ env D, ZFSet.pair c d ∈ env B) ↔ _ - constructor - · rintro ⟨subset, covers⟩ - apply ZFSet.ext - intro z - refine ⟨subset z, ?_⟩ - rintro hz - obtain ⟨c, hc, d, hd, rfl⟩ := ZFSet.mem_prod.1 hz - exact covers c hc d hd - · rintro equal - rw [equal] - exact ⟨fun _ h => h, fun _ hc _ hd => ZFSet.pair_mem_prod.2 ⟨hc, hd⟩⟩ - -def mainStageLawsFormula {n} (P r μ G m inv one A b t height C D rD : Fin n) : - BoundedFormula n := - .conj (meetOrderFormula P r μ) (.conj (groupFormula G m inv one) - (.conj (posetActionFormula G P m one r A) (.conj (bottomFormula P r b) - (.conj (topFormula P r t) (strictLexHeightFormula P C D r height rD))))) - -theorem truth_mainStageLawsFormula {n} - (P r μ G m inv one A b t height C D rD : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (mainStageLawsFormula P r μ G m inv one A b t height C D rD) env ↔ - MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) - (env A) (env b) (env t) (env height) (env C) (env D) (env rD) := by - simp only [mainStageLawsFormula, Truth, truth_meetOrderFormula, truth_groupFormula, - truth_posetActionFormula, truth_bottomFormula, truth_topFormula, truth_strictLexHeightFormula] - exact ⟨fun ⟨meet, group, action, ⟨hb, least⟩, ⟨ht, greatest⟩, height⟩ => - ⟨meet, group, action, hb, least, ht, greatest, height⟩, - fun h => ⟨h.meet, h.group, h.action, ⟨h.bottom_mem, h.least⟩, - ⟨h.top_mem, h.greatest⟩, h.height_code⟩⟩ - -def mainStageWitnessFormula {n} - (P r μ G m inv one A b t height C D rD B R N f : Fin n) : BoundedFormula n := - .conj (mainStageLawsFormula P r μ G m inv one A b t height C D rD) - (.conj (productEquationFormula B C D) - (.conj (imageSetFormula R P B height) (injectionFormula R N f))) - -theorem truth_mainStageWitnessFormula {n} - (P r μ G m inv one A b t height C D rD B R N f : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (mainStageWitnessFormula P r μ G m inv one A b t height C D rD B R N f) env ↔ - MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) - (env A) (env b) (env t) (env height) (env C) (env D) (env rD) ∧ - env B = ZFSet.prod (env C) (env D) ∧ - env R = relationImage (env P) (env B) (env height) ∧ - InjectionCode (env R) (env N) (env f) := by - simp only [mainStageWitnessFormula, Truth, truth_mainStageLawsFormula, - truth_productEquationFormula, truth_imageSetFormula, truth_injectionFormula] - -theorem realize_mainStageWitnessFormula (M : TransitiveGround.{u}) {n} - (P r μ G m inv one A b t height C D rD B R N f : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets - (mainStageWitnessFormula P r μ G m inv one A b t height C D rD B R N f).toFormula env ↔ - MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) - (env A) (env b) (env t) (env height) (env C) (env D) (env rD) ∧ - env B = ZFSet.prod (env C) (env D) ∧ - env R = relationImage (env P) (env B) (env height) ∧ - InjectionCode (env R) (env N) (env f) := - (realize_toFormula M _ env members).trans - (truth_mainStageWitnessFormula P r μ G m inv one A b t height C D rD B R N f env) - -end BoundedFormula - -namespace SetFormula - -def mainStageValidityFormula {n} - (P r μ G m inv one A b t height C D rD N : Fin n) : SetFormula n := - let lift (i : Fin n) := i.succ.succ.succ - ex (ex (ex ((BoundedFormula.mainStageWitnessFormula - (lift P) (lift r) (lift μ) (lift G) (lift m) (lift inv) (lift one) - (lift A) (lift b) (lift t) (lift height) (lift C) (lift D) (lift rD) - 2 1 (lift N) 0).toFormula))) - -def validMainStageCodeFormula {n} - (z P r μ G m inv one A b t height C D rD N : Fin n) : SetFormula n := - .conj (BoundedFormula.mainStageFormula z P r μ G m inv one A b t height).toFormula - (mainStageValidityFormula P r μ G m inv one A b t height C D rD N) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem realize_mainStageValidityFormula {n} - (P r μ G m inv one A b t height C D rD N : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : - Realize M.sets (mainStageValidityFormula P r μ G m inv one A b t height C D rD N) env ↔ - MainStageValidity M (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) - (env A) (env b) (env t) (env height) (env C) (env D) (env rD) := by - simp only [mainStageValidityFormula, realize_ex] - constructor - · rintro ⟨B, hB, R, hR, f, hf, realized⟩ - have code := (BoundedFormula.realize_mainStageWitnessFormula M - P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ G.succ.succ.succ - m.succ.succ.succ inv.succ.succ.succ one.succ.succ.succ A.succ.succ.succ - b.succ.succ.succ t.succ.succ.succ height.succ.succ.succ C.succ.succ.succ - D.succ.succ.succ rD.succ.succ.succ 2 1 N.succ.succ.succ 0 - (extend f (extend R (extend B env))) - (Fin.cases hf (Fin.cases hR (Fin.cases hB members)))).1 realized - change MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) - (env A) (env b) (env t) (env height) (env C) (env D) (env rD) ∧ - B = ZFSet.prod (env C) (env D) ∧ - R = relationImage (env P) B (env height) ∧ InjectionCode R (env N) f at code - obtain ⟨laws, rfl, rfl, injection⟩ := code - rw [omega] at injection - exact ⟨laws, f, hf, injection⟩ - · rintro ⟨laws, f, hf, injection⟩ - let B := ZFSet.prod (env C) (env D) - let R := relationImage (env P) B (env height) - have hB : B ∈ M.sets := M.prod_mem pairing unions powers separation (members C) (members D) - have hR : R ∈ M.sets := M.relationImage_mem separation (members P) hB (members height) - refine ⟨B, hB, R, hR, f, hf, ?_⟩ - apply (BoundedFormula.realize_mainStageWitnessFormula M - P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ G.succ.succ.succ - m.succ.succ.succ inv.succ.succ.succ one.succ.succ.succ A.succ.succ.succ - b.succ.succ.succ t.succ.succ.succ height.succ.succ.succ C.succ.succ.succ - D.succ.succ.succ rD.succ.succ.succ 2 1 N.succ.succ.succ 0 - (extend f (extend R (extend B env))) - (Fin.cases hf (Fin.cases hR (Fin.cases hB members)))).2 - refine ⟨laws, rfl, rfl, ?_⟩ - change InjectionCode R (env N) f - rw [omega] - exact injection - -theorem realize_validMainStageCodeFormula {n} - (z P r μ G m inv one A b t height C D rD N : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : - Realize M.sets (validMainStageCodeFormula z P r μ G m inv one A b t height C D rD N) env ↔ - env z = mainStageCode (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) - (env A) (env b) (env t) (env height) ∧ - MainStageValidity M (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) - (env A) (env b) (env t) (env height) (env C) (env D) (env rD) := - and_congr (BoundedFormula.realize_mainStageFormula M z P r μ G m inv one A b t height env members) - (M.realize_mainStageValidityFormula pairing unions powers separation - P r μ G m inv one A b t height C D rD N env members omega) - -end TransitiveGround - -namespace GroundMainStage -variable {M : TransitiveGround.{u}} - -theorem validity {C D rD : ZFSet.{u}} (stage : GroundMainStage M C D rD) : - MainStageValidity M stage.carrier stage.order stage.meetGraph stage.actors - stage.multiplication stage.inverse stage.identity stage.action stage.bottom stage.top - stage.height C D rD := - ⟨⟨stage.meet, stage.group_code, stage.action_code, stage.bottom_mem, stage.least, - stage.top_mem, stage.greatest, stage.height_code⟩, stage.height_range_countable⟩ - -noncomputable def ofValidity - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r μ G m inv one A b t height C D rD : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hG : G ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) (hA : A ∈ M.sets) (hHeight : height ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (valid : MainStageValidity M P r μ G m inv one A b t height C D rD) : - GroundMainStage M C D rD := - ofCodes pairing unions powers separation hP hG hr hμ hA hm hInv hC hD hrD hHeight - valid.1.meet valid.1.group valid.1.action valid.1.bottom_mem valid.1.least - valid.1.top_mem valid.1.greatest valid.1.height_code valid.2 - -theorem ofValidity_code - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P r μ G m inv one A b t height C D rD : ZFSet.{u}} - (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hG : G ∈ M.sets) - (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) (hA : A ∈ M.sets) (hHeight : height ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (valid : MainStageValidity M P r μ G m inv one A b t height C D rD) : - (ofValidity pairing unions powers separation hP hr hμ hG hm hInv hA hHeight hC hD hrD valid).code = - mainStageCode P r μ G m inv one A b t height := rfl - -end GroundMainStage - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_mainStage_of_realize - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) {n} - (z P r μ G m inv one A b t height C D rD N : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) - (recognized : Realize M.sets - (validMainStageCodeFormula z P r μ G m inv one A b t height C D rD N) env) : - ∃ stage : GroundMainStage M (env C) (env D) (env rD), stage.code = env z := by - obtain ⟨encoded, valid⟩ := (M.realize_validMainStageCodeFormula pairing unions powers separation - z P r μ G m inv one A b t height C D rD N env members omega).1 recognized - refine ⟨GroundMainStage.ofValidity pairing unions powers separation (members P) (members r) - (members μ) (members G) (members m) (members inv) (members A) (members height) - (members C) (members D) (members rD) valid, ?_⟩ - exact encoded.symm - -end TransitiveGround - -namespace SetFormula - -def mainStageCandidateFormula {n} (z C D rD N : Fin n) : SetFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ - ex (ex (ex (ex (ex (ex (ex (ex (ex (ex (ex (validMainStageCodeFormula (lift z) 10 9 8 7 6 5 4 3 2 1 0 - (lift C) (lift D) (lift rD) (lift N)))))))))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainStageCandidateFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) {n} - (z C D rD N : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : - Realize M.sets (mainStageCandidateFormula z C D rD N) env ↔ - ∃ stage : GroundMainStage M (env C) (env D) (env rD), stage.code = env z := by - simp only [mainStageCandidateFormula, realize_ex] - constructor - · rintro ⟨P, hP, r, hr, μ, hμ, G, hG, m, hm, inv, hInv, one, hOne, A, hA, b, hb, t, ht, height, hHeight, recognized⟩ - exact M.exists_mainStage_of_realize pairing unions powers separation - z.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 10 9 8 7 6 5 4 3 2 1 0 - C.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ D.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ rD.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ - (extend height (extend t (extend b (extend A (extend one (extend inv (extend m (extend G (extend μ (extend r (extend P (env)))))))))))) - (Fin.cases hHeight (Fin.cases ht (Fin.cases hb (Fin.cases hA (Fin.cases hOne (Fin.cases hInv (Fin.cases hm (Fin.cases hG (Fin.cases hμ (Fin.cases hr (Fin.cases hP (members)))))))))))) omega recognized - · rintro ⟨stage, equal⟩ - refine ⟨stage.carrier, stage.carrier_ground, stage.order, stage.order_ground, stage.meetGraph, stage.meet_ground, stage.actors, stage.actors_ground, stage.multiplication, stage.multiplication_ground, stage.inverse, stage.inverse_ground, stage.identity, stage.identity_ground, stage.action, stage.action_ground, stage.bottom, stage.bottom_ground, stage.top, stage.top_ground, stage.height, stage.height_ground, ?_⟩ - apply (M.realize_validMainStageCodeFormula pairing unions powers separation - z.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 10 9 8 7 6 5 4 3 2 1 0 - C.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ D.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ rD.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ - (extend stage.height (extend stage.top (extend stage.bottom (extend stage.action (extend stage.identity (extend stage.inverse (extend stage.multiplication (extend stage.actors (extend stage.meetGraph (extend stage.order (extend stage.carrier (env)))))))))))) - (Fin.cases stage.height_ground (Fin.cases stage.top_ground (Fin.cases stage.bottom_ground (Fin.cases stage.action_ground (Fin.cases stage.identity_ground (Fin.cases stage.inverse_ground (Fin.cases stage.multiplication_ground (Fin.cases stage.actors_ground (Fin.cases stage.meet_ground (Fin.cases stage.order_ground (Fin.cases stage.carrier_ground (members)))))))))))) omega).2 - exact ⟨equal.symm, stage.validity⟩ - -noncomputable def mainStageCandidates (V C D rD : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ stage : GroundMainStage M C D rD, stage.code = z) V - -theorem mem_mainStageCandidates (V C D rD z : ZFSet.{u}) : - z ∈ M.mainStageCandidates V C D rD ↔ - z ∈ V ∧ ∃ stage : GroundMainStage M C D rD, stage.code = z := by - rw [mainStageCandidates, ZFSet.mem_sep] - -theorem mainStageCandidates_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {V C D rD : ZFSet.{u}} (hV : V ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - M.mainStageCandidates V C D rD ∈ M.sets := by - let params := extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hC (Fin.cases hD (Fin.cases hrD - (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))) - have selected := M.separation_mem separation (mainStageCandidateFormula 0 1 2 3 4) - params members hV - have equal : ZFSet.sep (fun z => Realize M.sets (mainStageCandidateFormula 0 1 2 3 4) - (extend z params)) V = M.mainStageCandidates V C D rD := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, M.mem_mainStageCandidates] - apply and_congr_right - intro hz - exact M.realize_mainStageCandidateFormula pairing unions powers separation 0 1 2 3 4 - (extend z params) (Fin.cases (M.transitive hV hz) members) rfl - exact equal ▸ selected - -theorem mainStage_code_mem_candidates {V C D rD : ZFSet.{u}} - (stage : GroundMainStage M C D rD) (bound : stage.code ∈ V) : - stage.code ∈ M.mainStageCandidates V C D rD := - (M.mem_mainStageCandidates V C D rD stage.code).2 ⟨bound, stage, rfl⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BoundedMeetOrderCodes +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPowerImageGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.StrictLexHeightFormulas + +namespace OAI + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure MainStageLaws (P r μ G m inv one A b t height C D rD : ZFSet.{u}) : Prop where + meet : MeetOrderCode P r μ + group : GroupCode G m inv one + action : PosetActionCode G P m one r A + bottom_mem : b ∈ P + least : ∀ x ∈ P, ZFSet.pair b x ∈ r + top_mem : t ∈ P + greatest : ∀ x ∈ P, ZFSet.pair x t ∈ r + height_code : StrictLexHeightCode P C D r height rD + +def MainStageValidity (M : TransitiveGround.{u}) + (P r μ G m inv one A b t height C D rD : ZFSet.{u}) : Prop := + MainStageLaws P r μ G m inv one A b t height C D rD ∧ + M.groundEmbeddable (relationImage P (ZFSet.prod C D) height) ZFSet.omega + +namespace BoundedFormula + +def bottomFormula {n} (P r b : Fin n) : BoundedFormula n := + .conj (.mem b P) (.allMem P (pairMembershipFormula b.succ 0 r.succ)) + +theorem truth_bottomFormula {n} (P r b : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (bottomFormula P r b) env ↔ + env b ∈ env P ∧ ∀ x ∈ env P, ZFSet.pair (env b) x ∈ env r := by + simp only [bottomFormula, Truth, truth_pairMembershipFormula] + rfl + +def productEquationFormula {n} (B C D : Fin n) : BoundedFormula n := + .conj (.allMem B (productElementFormula 0 C.succ D.succ)) + (.allMem C (.allMem D.succ (pairMembershipFormula 1 0 B.succ.succ))) + +theorem truth_productEquationFormula {n} (B C D : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (productEquationFormula B C D) env ↔ env B = ZFSet.prod (env C) (env D) := by + simp only [productEquationFormula, Truth, truth_productElementFormula, + truth_pairMembershipFormula] + change ((∀ z ∈ env B, z ∈ ZFSet.prod (env C) (env D)) ∧ + ∀ c ∈ env C, ∀ d ∈ env D, ZFSet.pair c d ∈ env B) ↔ _ + constructor + · rintro ⟨subset, covers⟩ + apply ZFSet.ext + intro z + refine ⟨subset z, ?_⟩ + rintro hz + obtain ⟨c, hc, d, hd, rfl⟩ := ZFSet.mem_prod.1 hz + exact covers c hc d hd + · rintro equal + rw [equal] + exact ⟨fun _ h => h, fun _ hc _ hd => ZFSet.pair_mem_prod.2 ⟨hc, hd⟩⟩ + +def mainStageLawsFormula {n} (P r μ G m inv one A b t height C D rD : Fin n) : + BoundedFormula n := + .conj (meetOrderFormula P r μ) (.conj (groupFormula G m inv one) + (.conj (posetActionFormula G P m one r A) (.conj (bottomFormula P r b) + (.conj (topFormula P r t) (strictLexHeightFormula P C D r height rD))))) + +theorem truth_mainStageLawsFormula {n} + (P r μ G m inv one A b t height C D rD : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (mainStageLawsFormula P r μ G m inv one A b t height C D rD) env ↔ + MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) + (env A) (env b) (env t) (env height) (env C) (env D) (env rD) := by + simp only [mainStageLawsFormula, Truth, truth_meetOrderFormula, truth_groupFormula, + truth_posetActionFormula, truth_bottomFormula, truth_topFormula, truth_strictLexHeightFormula] + exact ⟨fun ⟨meet, group, action, ⟨hb, least⟩, ⟨ht, greatest⟩, height⟩ => + ⟨meet, group, action, hb, least, ht, greatest, height⟩, + fun h => ⟨h.meet, h.group, h.action, ⟨h.bottom_mem, h.least⟩, + ⟨h.top_mem, h.greatest⟩, h.height_code⟩⟩ + +def mainStageWitnessFormula {n} + (P r μ G m inv one A b t height C D rD B R N f : Fin n) : BoundedFormula n := + .conj (mainStageLawsFormula P r μ G m inv one A b t height C D rD) + (.conj (productEquationFormula B C D) + (.conj (imageSetFormula R P B height) (injectionFormula R N f))) + +theorem truth_mainStageWitnessFormula {n} + (P r μ G m inv one A b t height C D rD B R N f : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (mainStageWitnessFormula P r μ G m inv one A b t height C D rD B R N f) env ↔ + MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) + (env A) (env b) (env t) (env height) (env C) (env D) (env rD) ∧ + env B = ZFSet.prod (env C) (env D) ∧ + env R = relationImage (env P) (env B) (env height) ∧ + InjectionCode (env R) (env N) (env f) := by + simp only [mainStageWitnessFormula, Truth, truth_mainStageLawsFormula, + truth_productEquationFormula, truth_imageSetFormula, truth_injectionFormula] + +theorem realize_mainStageWitnessFormula (M : TransitiveGround.{u}) {n} + (P r μ G m inv one A b t height C D rD B R N f : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets + (mainStageWitnessFormula P r μ G m inv one A b t height C D rD B R N f).toFormula env ↔ + MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) + (env A) (env b) (env t) (env height) (env C) (env D) (env rD) ∧ + env B = ZFSet.prod (env C) (env D) ∧ + env R = relationImage (env P) (env B) (env height) ∧ + InjectionCode (env R) (env N) (env f) := + (realize_toFormula M _ env members).trans + (truth_mainStageWitnessFormula P r μ G m inv one A b t height C D rD B R N f env) + +end BoundedFormula + +namespace SetFormula + +def mainStageValidityFormula {n} + (P r μ G m inv one A b t height C D rD N : Fin n) : SetFormula n := + let lift (i : Fin n) := i.succ.succ.succ + ex (ex (ex ((BoundedFormula.mainStageWitnessFormula + (lift P) (lift r) (lift μ) (lift G) (lift m) (lift inv) (lift one) + (lift A) (lift b) (lift t) (lift height) (lift C) (lift D) (lift rD) + 2 1 (lift N) 0).toFormula))) + +def validMainStageCodeFormula {n} + (z P r μ G m inv one A b t height C D rD N : Fin n) : SetFormula n := + .conj (BoundedFormula.mainStageFormula z P r μ G m inv one A b t height).toFormula + (mainStageValidityFormula P r μ G m inv one A b t height C D rD N) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem realize_mainStageValidityFormula {n} + (P r μ G m inv one A b t height C D rD N : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : + Realize M.sets (mainStageValidityFormula P r μ G m inv one A b t height C D rD N) env ↔ + MainStageValidity M (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) + (env A) (env b) (env t) (env height) (env C) (env D) (env rD) := by + simp only [mainStageValidityFormula, realize_ex] + constructor + · rintro ⟨B, hB, R, hR, f, hf, realized⟩ + have code := (BoundedFormula.realize_mainStageWitnessFormula M + P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ G.succ.succ.succ + m.succ.succ.succ inv.succ.succ.succ one.succ.succ.succ A.succ.succ.succ + b.succ.succ.succ t.succ.succ.succ height.succ.succ.succ C.succ.succ.succ + D.succ.succ.succ rD.succ.succ.succ 2 1 N.succ.succ.succ 0 + (extend f (extend R (extend B env))) + (Fin.cases hf (Fin.cases hR (Fin.cases hB members)))).1 realized + change MainStageLaws (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) + (env A) (env b) (env t) (env height) (env C) (env D) (env rD) ∧ + B = ZFSet.prod (env C) (env D) ∧ + R = relationImage (env P) B (env height) ∧ InjectionCode R (env N) f at code + obtain ⟨laws, rfl, rfl, injection⟩ := code + rw [omega] at injection + exact ⟨laws, f, hf, injection⟩ + · rintro ⟨laws, f, hf, injection⟩ + let B := ZFSet.prod (env C) (env D) + let R := relationImage (env P) B (env height) + have hB : B ∈ M.sets := M.prod_mem pairing unions powers separation (members C) (members D) + have hR : R ∈ M.sets := M.relationImage_mem separation (members P) hB (members height) + refine ⟨B, hB, R, hR, f, hf, ?_⟩ + apply (BoundedFormula.realize_mainStageWitnessFormula M + P.succ.succ.succ r.succ.succ.succ μ.succ.succ.succ G.succ.succ.succ + m.succ.succ.succ inv.succ.succ.succ one.succ.succ.succ A.succ.succ.succ + b.succ.succ.succ t.succ.succ.succ height.succ.succ.succ C.succ.succ.succ + D.succ.succ.succ rD.succ.succ.succ 2 1 N.succ.succ.succ 0 + (extend f (extend R (extend B env))) + (Fin.cases hf (Fin.cases hR (Fin.cases hB members)))).2 + refine ⟨laws, rfl, rfl, ?_⟩ + change InjectionCode R (env N) f + rw [omega] + exact injection + +theorem realize_validMainStageCodeFormula {n} + (z P r μ G m inv one A b t height C D rD N : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : + Realize M.sets (validMainStageCodeFormula z P r μ G m inv one A b t height C D rD N) env ↔ + env z = mainStageCode (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) + (env A) (env b) (env t) (env height) ∧ + MainStageValidity M (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) + (env A) (env b) (env t) (env height) (env C) (env D) (env rD) := + and_congr (BoundedFormula.realize_mainStageFormula M z P r μ G m inv one A b t height env members) + (M.realize_mainStageValidityFormula pairing unions powers separation + P r μ G m inv one A b t height C D rD N env members omega) + +end TransitiveGround + +namespace GroundMainStage +variable {M : TransitiveGround.{u}} + +theorem validity {C D rD : ZFSet.{u}} (stage : GroundMainStage M C D rD) : + MainStageValidity M stage.carrier stage.order stage.meetGraph stage.actors + stage.multiplication stage.inverse stage.identity stage.action stage.bottom stage.top + stage.height C D rD := + ⟨⟨stage.meet, stage.group_code, stage.action_code, stage.bottom_mem, stage.least, + stage.top_mem, stage.greatest, stage.height_code⟩, stage.height_range_countable⟩ + +noncomputable def ofValidity + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r μ G m inv one A b t height C D rD : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hG : G ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) (hA : A ∈ M.sets) (hHeight : height ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (valid : MainStageValidity M P r μ G m inv one A b t height C D rD) : + GroundMainStage M C D rD := + ofCodes pairing unions powers separation hP hG hr hμ hA hm hInv hC hD hrD hHeight + valid.1.meet valid.1.group valid.1.action valid.1.bottom_mem valid.1.least + valid.1.top_mem valid.1.greatest valid.1.height_code valid.2 + +theorem ofValidity_code + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P r μ G m inv one A b t height C D rD : ZFSet.{u}} + (hP : P ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) (hG : G ∈ M.sets) + (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) (hA : A ∈ M.sets) (hHeight : height ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (valid : MainStageValidity M P r μ G m inv one A b t height C D rD) : + (ofValidity pairing unions powers separation hP hr hμ hG hm hInv hA hHeight hC hD hrD valid).code = + mainStageCode P r μ G m inv one A b t height := rfl + +end GroundMainStage + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_mainStage_of_realize + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) {n} + (z P r μ G m inv one A b t height C D rD N : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) + (recognized : Realize M.sets + (validMainStageCodeFormula z P r μ G m inv one A b t height C D rD N) env) : + ∃ stage : GroundMainStage M (env C) (env D) (env rD), stage.code = env z := by + obtain ⟨encoded, valid⟩ := (M.realize_validMainStageCodeFormula pairing unions powers separation + z P r μ G m inv one A b t height C D rD N env members omega).1 recognized + refine ⟨GroundMainStage.ofValidity pairing unions powers separation (members P) (members r) + (members μ) (members G) (members m) (members inv) (members A) (members height) + (members C) (members D) (members rD) valid, ?_⟩ + exact encoded.symm + +end TransitiveGround + +namespace SetFormula + +def mainStageCandidateFormula {n} (z C D rD N : Fin n) : SetFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ + ex (ex (ex (ex (ex (ex (ex (ex (ex (ex (ex (validMainStageCodeFormula (lift z) 10 9 8 7 6 5 4 3 2 1 0 + (lift C) (lift D) (lift rD) (lift N)))))))))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainStageCandidateFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) {n} + (z C D rD N : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (omega : env N = ZFSet.omega) : + Realize M.sets (mainStageCandidateFormula z C D rD N) env ↔ + ∃ stage : GroundMainStage M (env C) (env D) (env rD), stage.code = env z := by + simp only [mainStageCandidateFormula, realize_ex] + constructor + · rintro ⟨P, hP, r, hr, μ, hμ, G, hG, m, hm, inv, hInv, one, hOne, A, hA, b, hb, t, ht, height, hHeight, recognized⟩ + exact M.exists_mainStage_of_realize pairing unions powers separation + z.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 10 9 8 7 6 5 4 3 2 1 0 + C.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ D.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ rD.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ + (extend height (extend t (extend b (extend A (extend one (extend inv (extend m (extend G (extend μ (extend r (extend P (env)))))))))))) + (Fin.cases hHeight (Fin.cases ht (Fin.cases hb (Fin.cases hA (Fin.cases hOne (Fin.cases hInv (Fin.cases hm (Fin.cases hG (Fin.cases hμ (Fin.cases hr (Fin.cases hP (members)))))))))))) omega recognized + · rintro ⟨stage, equal⟩ + refine ⟨stage.carrier, stage.carrier_ground, stage.order, stage.order_ground, stage.meetGraph, stage.meet_ground, stage.actors, stage.actors_ground, stage.multiplication, stage.multiplication_ground, stage.inverse, stage.inverse_ground, stage.identity, stage.identity_ground, stage.action, stage.action_ground, stage.bottom, stage.bottom_ground, stage.top, stage.top_ground, stage.height, stage.height_ground, ?_⟩ + apply (M.realize_validMainStageCodeFormula pairing unions powers separation + z.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 10 9 8 7 6 5 4 3 2 1 0 + C.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ D.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ rD.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ + (extend stage.height (extend stage.top (extend stage.bottom (extend stage.action (extend stage.identity (extend stage.inverse (extend stage.multiplication (extend stage.actors (extend stage.meetGraph (extend stage.order (extend stage.carrier (env)))))))))))) + (Fin.cases stage.height_ground (Fin.cases stage.top_ground (Fin.cases stage.bottom_ground (Fin.cases stage.action_ground (Fin.cases stage.identity_ground (Fin.cases stage.inverse_ground (Fin.cases stage.multiplication_ground (Fin.cases stage.actors_ground (Fin.cases stage.meet_ground (Fin.cases stage.order_ground (Fin.cases stage.carrier_ground (members)))))))))))) omega).2 + exact ⟨equal.symm, stage.validity⟩ + +noncomputable def mainStageCandidates (V C D rD : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ stage : GroundMainStage M C D rD, stage.code = z) V + +theorem mem_mainStageCandidates (V C D rD z : ZFSet.{u}) : + z ∈ M.mainStageCandidates V C D rD ↔ + z ∈ V ∧ ∃ stage : GroundMainStage M C D rD, stage.code = z := by + rw [mainStageCandidates, ZFSet.mem_sep] + +theorem mainStageCandidates_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {V C D rD : ZFSet.{u}} (hV : V ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + M.mainStageCandidates V C D rD ∈ M.sets := by + let params := extend C (extend D (extend rD (extend ZFSet.omega Fin.elim0))) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hC (Fin.cases hD (Fin.cases hrD + (Fin.cases (M.omega_mem separation infinite) (fun i => Fin.elim0 i)))) + have selected := M.separation_mem separation (mainStageCandidateFormula 0 1 2 3 4) + params members hV + have equal : ZFSet.sep (fun z => Realize M.sets (mainStageCandidateFormula 0 1 2 3 4) + (extend z params)) V = M.mainStageCandidates V C D rD := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, M.mem_mainStageCandidates] + apply and_congr_right + intro hz + exact M.realize_mainStageCandidateFormula pairing unions powers separation 0 1 2 3 4 + (extend z params) (Fin.cases (M.transitive hV hz) members) rfl + exact equal ▸ selected + +theorem mainStage_code_mem_candidates {V C D rD : ZFSet.{u}} + (stage : GroundMainStage M C D rD) (bound : stage.code ∈ V) : + stage.code ∈ M.mainStageCandidates V C D rD := + (M.mem_mainStageCandidates V C D rD stage.code).2 ⟨bound, stage, rfl⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageFromCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageFromCodes.lean index 84b6dc4a368d55108b4fd38aa6dff0f37ab203d0..5575d65dd13a6056d320d6690cf4c39fe86cf602 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageFromCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageFromCodes.lean @@ -1,459 +1,459 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedExtensionCodes -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift - -namespace OAI - - -namespace PartitionPilot.Forcing - -section - -universe u - -structure MeetOrderCode (L r μ : ZFSet.{u}) : Prop where - order : PartialOrderCode L r - operation : ZFSet.IsFunc (ZFSet.prod L L) L μ - lower_left : ∀ x y z, ZFSet.pair (ZFSet.pair x y) z ∈ μ → ZFSet.pair z x ∈ r - lower_right : ∀ x y z, ZFSet.pair (ZFSet.pair x y) z ∈ μ → ZFSet.pair z y ∈ r - greatest : ∀ x y z w, w ∈ L → ZFSet.pair (ZFSet.pair x y) z ∈ μ → - ZFSet.pair w x ∈ r → ZFSet.pair w y ∈ r → ZFSet.pair w z ∈ r - -structure MeetFilterCode (L r μ F : ZFSet.{u}) : Prop where - subset : F ⊆ L - nonempty : F.Nonempty - upward : ∀ x ∈ F, ∀ y ∈ L, ZFSet.pair x y ∈ r → y ∈ F - closed_meet : ∀ x ∈ F, ∀ y ∈ F, ∀ z, - ZFSet.pair (ZFSet.pair x y) z ∈ μ → z ∈ F - -def OldMeetCode (r μ birth : ZFSet.{u}) : Prop := - ∀ x y z a b c, ZFSet.pair y a ∈ birth → ZFSet.pair x b ∈ birth → - a ∈ b → ZFSet.pair x y ∉ r → ZFSet.pair (ZFSet.pair x y) z ∈ μ → - ZFSet.pair z c ∈ birth → c ∈ b - -structure StrictLexHeightCode (L C Q r height qlt : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc L (ZFSet.prod C Q) height - strict : ∀ x ∈ L, ∀ y ∈ L, ∀ c q d v, - ZFSet.pair x y ∈ r → x ≠ y → - ZFSet.pair x (ZFSet.pair c q) ∈ height → - ZFSet.pair y (ZFSet.pair d v) ∈ height → - c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ qlt) - -theorem birthEssential_below_earlier {L F T r μ birth x y a b : ZFSet.{u}} - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (born : ZFSet.IsFunc L T birth) (oldMeet : OldMeetCode r μ birth) - (essential : x ∈ birthEssentialSet F T r birth) (positive : y ∈ F) - (bornY : ZFSet.pair y a ∈ birth) (bornX : ZFSet.pair x b ∈ birth) - (earlier : a ∈ b) : ZFSet.pair x y ∈ r ∧ x ≠ y := by - classical - have hx := (mem_birthEssentialSet F T r birth x).1 essential - have xL := filter.subset hx.1 - have yL := filter.subset positive - have bT := (ZFSet.pair_mem_prod.1 (born.1 bornX)).2 - have lower : ZFSet.pair x y ∈ r := by - by_contra notLower - obtain ⟨z, meetXY, _⟩ := meet.operation.2 (ZFSet.pair x y) - (ZFSet.pair_mem_prod.2 ⟨xL, yL⟩) - have zL := (ZFSet.pair_mem_prod.1 (meet.operation.1 meetXY)).2 - obtain ⟨c, bornZ, _⟩ := born.2 z zL - have cT := (ZFSet.pair_mem_prod.1 (born.1 bornZ)).2 - exact hx.2 z (filter.closed_meet x hx.1 y positive z meetXY) c cT b bT - (meet.lower_left x y z meetXY) bornZ bornX - (oldMeet x y z a b c bornY bornX earlier notLower meetXY bornZ) - refine ⟨lower, ?_⟩ - intro equal - subst y - obtain ⟨t, _, unique⟩ := born.2 x xL - have sameBirth : a = b := (unique a bornY).trans (unique b bornX).symm - exact ZFSet.mem_irrefl b (sameBirth ▸ earlier) - -theorem essentialHeightDescent_of_chronological_laws - {L F T C Q r μ birth height qlt : ZFSet.{u}} - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (born : ZFSet.IsFunc L T birth) (oldMeet : OldMeetCode r μ birth) - (strictHeight : StrictLexHeightCode L C Q r height qlt) : - EssentialHeightDescent (birthEssentialSet F T r birth) birth height qlt := by - intro x hx y hy i j c q d v bornX bornY earlier heightX heightY - have lower := birthEssential_below_earlier meet filter born oldMeet hy - (birthEssentialSet_subset F T r birth hx) bornX bornY earlier - exact strictHeight.strict y (filter.subset (birthEssentialSet_subset F T r birth hy)) - x (filter.subset (birthEssentialSet_subset F T r birth hx)) d v c q - lower.1 lower.2 heightY heightX - -end - - - -section - -universe u v - -noncomputable def essentialBirthFiber (F T r birth t : ZFSet.{u}) : ZFSet.{u} := - relationFiber (birthEssentialSet F T r birth) - (relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth) t - -theorem mem_essentialBirthFiber (F T r birth t x : ZFSet.{u}) : - x ∈ essentialBirthFiber F T r birth t ↔ - x ∈ birthEssentialSet F T r birth ∧ t ∈ T ∧ ZFSet.pair x t ∈ birth := by - rw [essentialBirthFiber, mem_relationFiber, pair_mem_relationConverse] - constructor - · rintro ⟨hx, _, ht, born⟩ - exact ⟨hx, ((mem_essentialBirthIndices F T r birth t).1 ht).1, born⟩ - · rintro ⟨hx, ht, born⟩ - exact ⟨hx, hx, (mem_essentialBirthIndices F T r birth t).2 ⟨ht, x, hx, born⟩, born⟩ - -theorem essentialBirthFiber_subset (F T r birth t : ZFSet.{u}) : - essentialBirthFiber F T r birth t ⊆ birthEssentialSet F T r birth := - fun _ hx => ((mem_essentialBirthFiber F T r birth t _).1 hx).1 - -def OldBridgeCode (L r μ birth t x y : ZFSet.{u}) : Prop := - (∃ z a, ZFSet.pair (ZFSet.pair x y) z ∈ μ ∧ ZFSet.pair z a ∈ birth ∧ a ∈ t) ∨ - (∃ z ∈ L, ∃ a, ZFSet.pair z a ∈ birth ∧ a ∈ t ∧ - ((ZFSet.pair x z ∈ r ∧ ZFSet.pair z y ∈ r) ∨ - (ZFSet.pair y z ∈ r ∧ ZFSet.pair z x ∈ r))) - -theorem birthEssentials_no_oldBridge {L F T r μ birth t x y : ZFSet.{u}} - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (born : ZFSet.IsFunc L T birth) - (hx : x ∈ birthEssentialSet F T r birth) (hy : y ∈ birthEssentialSet F T r birth) - (xt : ZFSet.pair x t ∈ birth) (yt : ZFSet.pair y t ∈ birth) : - ¬ OldBridgeCode L r μ birth t x y := by - have xE := (mem_birthEssentialSet F T r birth x).1 hx - have yE := (mem_birthEssentialSet F T r birth y).1 hy - have ht := (ZFSet.pair_mem_prod.1 (born.1 xt)).2 - intro bridge - rcases bridge with ⟨z, a, meetXY, za, old⟩ | ⟨z, hz, a, za, old, intermediate⟩ - · have ha := (ZFSet.pair_mem_prod.1 (born.1 za)).2 - exact xE.2 z (filter.closed_meet x xE.1 y yE.1 z meetXY) a ha t ht - (meet.lower_left x y z meetXY) za xt old - · have ha := (ZFSet.pair_mem_prod.1 (born.1 za)).2 - rcases intermediate with ⟨xz, zy⟩ | ⟨yz, zx⟩ - · exact yE.2 z (filter.upward x xE.1 z hz xz) a ha t ht zy za yt old - · exact xE.2 z (filter.upward y yE.1 z hz yz) a ha t ht zx za xt old - -theorem birthEssentials_same_component {L F T r μ birth t x y : ZFSet.{u}} - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (born : ZFSet.IsFunc L T birth) {I : Type v} (component : ZFSet.{u} → I) - (separated : ∀ x ∈ L, ∀ y ∈ L, - ZFSet.pair x t ∈ birth → ZFSet.pair y t ∈ birth → component x ≠ component y → - OldBridgeCode L r μ birth t x y) - (hx : x ∈ birthEssentialSet F T r birth) (hy : y ∈ birthEssentialSet F T r birth) - (xt : ZFSet.pair x t ∈ birth) (yt : ZFSet.pair y t ∈ birth) : - component x = component y := by - classical - by_contra different - exact birthEssentials_no_oldBridge meet filter born hx hy xt yt - (separated x (filter.subset (birthEssentialSet_subset F T r birth hx)) - y (filter.subset (birthEssentialSet_subset F T r birth hy)) xt yt different) - -theorem essentialBirthFiber_same_component {L F T r μ birth t x y : ZFSet.{u}} - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (born : ZFSet.IsFunc L T birth) {I : Type v} (component : ZFSet.{u} → I) - (separated : ∀ x ∈ L, ∀ y ∈ L, - ZFSet.pair x t ∈ birth → ZFSet.pair y t ∈ birth → component x ≠ component y → - OldBridgeCode L r μ birth t x y) - (hx : x ∈ essentialBirthFiber F T r birth t) (hy : y ∈ essentialBirthFiber F T r birth t) : - component x = component y := by - have xE := (mem_essentialBirthFiber F T r birth t x).1 hx - have yE := (mem_essentialBirthFiber F T r birth t y).1 hy - exact birthEssentials_same_component meet filter born component separated xE.1 yE.1 xE.2.2 yE.2.2 - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem essentialBirthFiber_mem (separation : SeparationSchema M.sets) - {F T r birth t : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) - (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) (ht : t ∈ M.sets) : - essentialBirthFiber F T r birth t ∈ M.sets := by - let E := birthEssentialSet F T r birth - let params := extend t (extend T (extend birth Fin.elim0)) - let φ : BoundedFormula 4 := .conj (.mem 1 2) (BoundedFormula.pairMembershipFormula 0 1 3) - have selected := M.bounded_separation_mem separation φ params - (Fin.cases ht (Fin.cases hT (Fin.cases hBirth (fun j => Fin.elim0 j)))) - (M.birthEssentialSet_mem separation hF hT hr hBirth) - have eq : ZFSet.sep (fun x => BoundedFormula.Truth φ (extend x params)) E = - essentialBirthFiber F T r birth t := by - apply ZFSet.ext - intro x - rw [ZFSet.mem_sep, mem_essentialBirthFiber] - exact and_congr Iff.rfl - (and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 0 1 3 _)) - exact eq ▸ selected - -end TransitiveGround - -end - - - -section -universe u - -structure GroundMainStage (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) where - carrier : ZFSet.{u} - order : ZFSet.{u} - meetGraph : ZFSet.{u} - actors : ZFSet.{u} - multiplication : ZFSet.{u} - inverse : ZFSet.{u} - identity : ZFSet.{u} - action : ZFSet.{u} - bottom : ZFSet.{u} - top : ZFSet.{u} - height : ZFSet.{u} - carrier_ground : carrier ∈ M.sets - order_ground : order ∈ M.sets - meet_ground : meetGraph ∈ M.sets - actors_ground : actors ∈ M.sets - multiplication_ground : multiplication ∈ M.sets - inverse_ground : inverse ∈ M.sets - action_ground : action ∈ M.sets - height_ground : height ∈ M.sets - columns_ground : C ∈ M.sets - coordinates_ground : D ∈ M.sets - coordinate_order_ground : rD ∈ M.sets - meet : MeetOrderCode carrier order meetGraph - group_code : GroupCode actors multiplication inverse identity - action_code : PosetActionCode actors carrier multiplication identity order action - bottom_mem : bottom ∈ carrier - least : ∀ x ∈ carrier, ZFSet.pair bottom x ∈ order - top_mem : top ∈ carrier - greatest : ∀ x ∈ carrier, ZFSet.pair x top ∈ order - height_code : StrictLexHeightCode carrier C D order height rD - height_range_ground : relationImage carrier (ZFSet.prod C D) height ∈ M.sets - height_range_countable : M.groundEmbeddable (relationImage carrier (ZFSet.prod C D) height) ZFSet.omega - -namespace GroundMainStage -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) - -theorem bottom_ground : stage.bottom ∈ M.sets := M.transitive stage.carrier_ground stage.bottom_mem -theorem top_ground : stage.top ∈ M.sets := M.transitive stage.carrier_ground stage.top_mem -theorem identity_ground : stage.identity ∈ M.sets := M.transitive stage.actors_ground stage.group_code.identity_mem - -end GroundMainStage - - - - - -noncomputable def taggedBirth (P N birth stamp : ZFSet.{u}) : ZFSet.{u} := - birth ∪ ZFSet.prod (ZFSet.prod {P} N) {stamp} - -theorem pair_mem_taggedBirth (P N birth stamp x t : ZFSet.{u}) : - ZFSet.pair x t ∈ taggedBirth P N birth stamp ↔ - ZFSet.pair x t ∈ birth ∨ (x ∈ ZFSet.prod {P} N ∧ t = stamp) := by - rw [taggedBirth, ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton] - -theorem taggedBirth_subset (P N birth stamp : ZFSet.{u}) : birth ⊆ taggedBirth P N birth stamp := - fun _ hx => ZFSet.mem_union.2 (Or.inl hx) - -theorem taggedBirth_old_iff {P N birth stamp x t : ZFSet.{u}} (hx : x ∈ P) : - ZFSet.pair x t ∈ taggedBirth P N birth stamp ↔ ZFSet.pair x t ∈ birth := by - rw [pair_mem_taggedBirth] - exact ⟨fun h => h.elim id (fun h => False.elim (taggedExtension_disjoint P N x hx h.1)), Or.inl⟩ - -theorem taggedBirth_fresh_iff {P N T birth stamp q t : ZFSet.{u}} - (born : ZFSet.IsFunc P T birth) (hq : q ∈ N) : - ZFSet.pair (ZFSet.pair P q) t ∈ taggedBirth P N birth stamp ↔ t = stamp := by - rw [pair_mem_taggedBirth] - constructor - · intro h - exact h.elim (fun old => False.elim - (pair_tag_not_mem P q (ZFSet.pair_mem_prod.1 (born.1 old)).1)) And.right - · intro equal - exact Or.inr ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hq⟩, equal⟩ - -theorem taggedBirth_function {P N T birth stamp : ZFSet.{u}} - (born : ZFSet.IsFunc P T birth) (hs : stamp ∈ T) : - ZFSet.IsFunc (taggedExtension P N) T (taggedBirth P N birth stamp) := by - refine ⟨?_, ?_⟩ - · intro z hz - rcases ZFSet.mem_union.1 hz with old | fresh - · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (born.1 old) - exact ZFSet.pair_mem_prod.2 ⟨old_mem_taggedExtension hx, ht⟩ - · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 fresh - exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_union.2 (Or.inr hx), (ZFSet.mem_singleton.1 ht).symm ▸ hs⟩ - · intro x hx - rcases mem_taggedExtension.1 hx with old | ⟨q, hq, rfl⟩ - · obtain ⟨t, entry, unique⟩ := born.2 x old - exact ⟨t, (taggedBirth_old_iff old).2 entry, fun s h => unique s ((taggedBirth_old_iff old).1 h)⟩ - · exact ⟨stamp, (taggedBirth_fresh_iff born hq).2 rfl, - fun s h => (taggedBirth_fresh_iff born hq).1 h⟩ - -theorem taggedBirth_bound {P N birth stamp : ZFSet.{u}} - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) : - ∀ x t, ZFSet.pair x t ∈ taggedBirth P N birth stamp → t = stamp ∨ t ∈ stamp := by - intro x t entry - exact ((pair_mem_taggedBirth P N birth stamp x t).1 entry).elim - (fun old => Or.inr (earlier x t old)) (fun fresh => Or.inl fresh.2) - -theorem taggedBirth_stamp_iff {P N birth stamp x : ZFSet.{u}} - (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) : - ZFSet.pair x stamp ∈ taggedBirth P N birth stamp ↔ x ∈ ZFSet.prod {P} N := by - rw [pair_mem_taggedBirth] - exact ⟨fun h => h.elim (fun old => False.elim (ZFSet.mem_irrefl stamp (earlier x stamp old))) And.left, - fun hx => Or.inr ⟨hx, rfl⟩⟩ - -theorem taggedBirth_earlier_iff {P N birth stamp x t : ZFSet.{u}} (before : t ∈ stamp) : - ZFSet.pair x t ∈ taggedBirth P N birth stamp ↔ ZFSet.pair x t ∈ birth := by - rw [pair_mem_taggedBirth] - exact ⟨fun h => h.elim id (fun fresh => False.elim (ZFSet.mem_irrefl stamp (fresh.2 ▸ before))), Or.inl⟩ - - - - - -noncomputable def mainStageCode (P r μ G m inv one A bottom top height : ZFSet.{u}) : ZFSet.{u} := - nonemptyTupleCode 10 (Fin.cases P (Fin.cases r (Fin.cases μ (Fin.cases G (Fin.cases m (Fin.cases inv (Fin.cases one (Fin.cases A (Fin.cases bottom (Fin.cases top (Fin.cases height (Fin.elim0)))))))))))) - -theorem mainStageCode_inj - {P r μ G m inv one A bottom top height P₂ r₂ μ₂ G₂ m₂ inv₂ one₂ A₂ bottom₂ top₂ height₂ : ZFSet.{u}} : - mainStageCode P r μ G m inv one A bottom top height = mainStageCode P₂ r₂ μ₂ G₂ m₂ inv₂ one₂ A₂ bottom₂ top₂ height₂ ↔ - P = P₂ ∧ r = r₂ ∧ μ = μ₂ ∧ G = G₂ ∧ m = m₂ ∧ inv = inv₂ ∧ one = one₂ ∧ A = A₂ ∧ bottom = bottom₂ ∧ top = top₂ ∧ height = height₂ := by - constructor - · intro equal - have fields := nonemptyTupleCode_injective 10 equal - exact ⟨congrFun fields (0 : Fin 11), congrFun fields (1 : Fin 11), congrFun fields (2 : Fin 11), congrFun fields (3 : Fin 11), congrFun fields (4 : Fin 11), congrFun fields (5 : Fin 11), congrFun fields (6 : Fin 11), congrFun fields (7 : Fin 11), congrFun fields (8 : Fin 11), congrFun fields (9 : Fin 11), congrFun fields (10 : Fin 11)⟩ - · rintro ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ - rfl - -namespace GroundMainStage -open SetFormula -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} - -def field (stage : GroundMainStage M C D rD) : Fin 11 → ZFSet.{u} := - Fin.cases stage.carrier (Fin.cases stage.order (Fin.cases stage.meetGraph (Fin.cases stage.actors (Fin.cases stage.multiplication (Fin.cases stage.inverse (Fin.cases stage.identity (Fin.cases stage.action (Fin.cases stage.bottom (Fin.cases stage.top (Fin.cases stage.height (Fin.elim0))))))))))) - -noncomputable def code (stage : GroundMainStage M C D rD) : ZFSet.{u} := - nonemptyTupleCode 10 stage.field - -@[ext] theorem ext {first second : GroundMainStage M C D rD} - (carrier : first.carrier = second.carrier) - (order : first.order = second.order) - (meetGraph : first.meetGraph = second.meetGraph) - (actors : first.actors = second.actors) - (multiplication : first.multiplication = second.multiplication) - (inverse : first.inverse = second.inverse) - (identity : first.identity = second.identity) - (action : first.action = second.action) - (bottom : first.bottom = second.bottom) - (top : first.top = second.top) - (height : first.height = second.height) : first = second := by - cases first - cases second - cases carrier - cases order - cases meetGraph - cases actors - cases multiplication - cases inverse - cases identity - cases action - cases bottom - cases top - cases height - rfl - -theorem field_injective : Function.Injective (field (M := M) (C := C) (D := D) (rD := rD)) := by - intro first second equal - exact ext (congrFun equal (0 : Fin 11)) (congrFun equal (1 : Fin 11)) (congrFun equal (2 : Fin 11)) (congrFun equal (3 : Fin 11)) (congrFun equal (4 : Fin 11)) (congrFun equal (5 : Fin 11)) (congrFun equal (6 : Fin 11)) (congrFun equal (7 : Fin 11)) (congrFun equal (8 : Fin 11)) (congrFun equal (9 : Fin 11)) (congrFun equal (10 : Fin 11)) - -theorem code_injective : Function.Injective (code (M := M) (C := C) (D := D) (rD := rD)) := by - intro first second equal - exact field_injective (nonemptyTupleCode_injective 10 equal) - -theorem field_ground (stage : GroundMainStage M C D rD) : ∀ j, stage.field j ∈ M.sets := - Fin.cases stage.carrier_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground (Fin.cases stage.actors_ground (Fin.cases stage.multiplication_ground (Fin.cases stage.inverse_ground (Fin.cases stage.identity_ground (Fin.cases stage.action_ground (Fin.cases stage.bottom_ground (Fin.cases stage.top_ground (Fin.cases stage.height_ground ((fun i => Fin.elim0 i)))))))))))) - -theorem code_mem (stage : GroundMainStage M C D rD) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : stage.code ∈ M.sets := - M.nonemptyTupleCode_mem pairing 10 stage.field stage.field_ground - -end GroundMainStage - -namespace BoundedFormula -open SetFormula - -def mainStageFormula {n} (z P r μ G m inv one A bottom top height : Fin n) : BoundedFormula n := - nonemptyTupleFormula 10 z (Fin.cases P (Fin.cases r (Fin.cases μ (Fin.cases G (Fin.cases m (Fin.cases inv (Fin.cases one (Fin.cases A (Fin.cases bottom (Fin.cases top (Fin.cases height (Fin.elim0)))))))))))) - -theorem truth_mainStageFormula {n} (z P r μ G m inv one A bottom top height : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (mainStageFormula z P r μ G m inv one A bottom top height) env ↔ - env z = mainStageCode (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) (env A) (env bottom) (env top) (env height) := by - rw [mainStageFormula, truth_nonemptyTupleFormula] - rfl - -theorem realize_mainStageFormula (M : TransitiveGround.{u}) {n} - (z P r μ G m inv one A bottom top height : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (mainStageFormula z P r μ G m inv one A bottom top height).toFormula env ↔ - env z = mainStageCode (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) (env A) (env bottom) (env top) (env height) := - (realize_toFormula M _ env members).trans (truth_mainStageFormula z P r μ G m inv one A bottom top height env) - -end BoundedFormula - -end - - - -namespace GroundMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} - -noncomputable def ofCodes - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A m inv one b t C D rD height : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hHeight : height ∈ M.sets) - (meet : MeetOrderCode P r μ) (group : GroupCode G m inv one) - (action : PosetActionCode G P m one r A) - (hb : b ∈ P) (least : ∀ x ∈ P, ZFSet.pair b x ∈ r) - (ht : t ∈ P) (greatest : ∀ x ∈ P, ZFSet.pair x t ∈ r) - (heightCode : StrictLexHeightCode P C D r height rD) - (heightSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) height) ZFSet.omega) : - GroundMainStage M C D rD where - carrier := P - order := r - meetGraph := μ - actors := G - multiplication := m - inverse := inv - identity := one - action := A - bottom := b - top := t - height := height - carrier_ground := hP - order_ground := hr - meet_ground := hμ - actors_ground := hG - multiplication_ground := hm - inverse_ground := hInv - action_ground := hA - height_ground := hHeight - columns_ground := hC - coordinates_ground := hD - coordinate_order_ground := hrD - meet := meet - group_code := group - action_code := action - bottom_mem := hb - least := least - top_mem := ht - greatest := greatest - height_code := heightCode - height_range_ground := M.relationImage_mem separation hP - (M.prod_mem pairing unions powers separation hC hD) hHeight - height_range_countable := heightSmall - -end GroundMainStage - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedExtensionCodes +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift + +namespace OAI + + +namespace PartitionPilot.Forcing + +section + +universe u + +structure MeetOrderCode (L r μ : ZFSet.{u}) : Prop where + order : PartialOrderCode L r + operation : ZFSet.IsFunc (ZFSet.prod L L) L μ + lower_left : ∀ x y z, ZFSet.pair (ZFSet.pair x y) z ∈ μ → ZFSet.pair z x ∈ r + lower_right : ∀ x y z, ZFSet.pair (ZFSet.pair x y) z ∈ μ → ZFSet.pair z y ∈ r + greatest : ∀ x y z w, w ∈ L → ZFSet.pair (ZFSet.pair x y) z ∈ μ → + ZFSet.pair w x ∈ r → ZFSet.pair w y ∈ r → ZFSet.pair w z ∈ r + +structure MeetFilterCode (L r μ F : ZFSet.{u}) : Prop where + subset : F ⊆ L + nonempty : F.Nonempty + upward : ∀ x ∈ F, ∀ y ∈ L, ZFSet.pair x y ∈ r → y ∈ F + closed_meet : ∀ x ∈ F, ∀ y ∈ F, ∀ z, + ZFSet.pair (ZFSet.pair x y) z ∈ μ → z ∈ F + +def OldMeetCode (r μ birth : ZFSet.{u}) : Prop := + ∀ x y z a b c, ZFSet.pair y a ∈ birth → ZFSet.pair x b ∈ birth → + a ∈ b → ZFSet.pair x y ∉ r → ZFSet.pair (ZFSet.pair x y) z ∈ μ → + ZFSet.pair z c ∈ birth → c ∈ b + +structure StrictLexHeightCode (L C Q r height qlt : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc L (ZFSet.prod C Q) height + strict : ∀ x ∈ L, ∀ y ∈ L, ∀ c q d v, + ZFSet.pair x y ∈ r → x ≠ y → + ZFSet.pair x (ZFSet.pair c q) ∈ height → + ZFSet.pair y (ZFSet.pair d v) ∈ height → + c ∈ d ∨ (c = d ∧ ZFSet.pair q v ∈ qlt) + +theorem birthEssential_below_earlier {L F T r μ birth x y a b : ZFSet.{u}} + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (born : ZFSet.IsFunc L T birth) (oldMeet : OldMeetCode r μ birth) + (essential : x ∈ birthEssentialSet F T r birth) (positive : y ∈ F) + (bornY : ZFSet.pair y a ∈ birth) (bornX : ZFSet.pair x b ∈ birth) + (earlier : a ∈ b) : ZFSet.pair x y ∈ r ∧ x ≠ y := by + classical + have hx := (mem_birthEssentialSet F T r birth x).1 essential + have xL := filter.subset hx.1 + have yL := filter.subset positive + have bT := (ZFSet.pair_mem_prod.1 (born.1 bornX)).2 + have lower : ZFSet.pair x y ∈ r := by + by_contra notLower + obtain ⟨z, meetXY, _⟩ := meet.operation.2 (ZFSet.pair x y) + (ZFSet.pair_mem_prod.2 ⟨xL, yL⟩) + have zL := (ZFSet.pair_mem_prod.1 (meet.operation.1 meetXY)).2 + obtain ⟨c, bornZ, _⟩ := born.2 z zL + have cT := (ZFSet.pair_mem_prod.1 (born.1 bornZ)).2 + exact hx.2 z (filter.closed_meet x hx.1 y positive z meetXY) c cT b bT + (meet.lower_left x y z meetXY) bornZ bornX + (oldMeet x y z a b c bornY bornX earlier notLower meetXY bornZ) + refine ⟨lower, ?_⟩ + intro equal + subst y + obtain ⟨t, _, unique⟩ := born.2 x xL + have sameBirth : a = b := (unique a bornY).trans (unique b bornX).symm + exact ZFSet.mem_irrefl b (sameBirth ▸ earlier) + +theorem essentialHeightDescent_of_chronological_laws + {L F T C Q r μ birth height qlt : ZFSet.{u}} + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (born : ZFSet.IsFunc L T birth) (oldMeet : OldMeetCode r μ birth) + (strictHeight : StrictLexHeightCode L C Q r height qlt) : + EssentialHeightDescent (birthEssentialSet F T r birth) birth height qlt := by + intro x hx y hy i j c q d v bornX bornY earlier heightX heightY + have lower := birthEssential_below_earlier meet filter born oldMeet hy + (birthEssentialSet_subset F T r birth hx) bornX bornY earlier + exact strictHeight.strict y (filter.subset (birthEssentialSet_subset F T r birth hy)) + x (filter.subset (birthEssentialSet_subset F T r birth hx)) d v c q + lower.1 lower.2 heightY heightX + +end + + + +section + +universe u v + +noncomputable def essentialBirthFiber (F T r birth t : ZFSet.{u}) : ZFSet.{u} := + relationFiber (birthEssentialSet F T r birth) + (relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth) t + +theorem mem_essentialBirthFiber (F T r birth t x : ZFSet.{u}) : + x ∈ essentialBirthFiber F T r birth t ↔ + x ∈ birthEssentialSet F T r birth ∧ t ∈ T ∧ ZFSet.pair x t ∈ birth := by + rw [essentialBirthFiber, mem_relationFiber, pair_mem_relationConverse] + constructor + · rintro ⟨hx, _, ht, born⟩ + exact ⟨hx, ((mem_essentialBirthIndices F T r birth t).1 ht).1, born⟩ + · rintro ⟨hx, ht, born⟩ + exact ⟨hx, hx, (mem_essentialBirthIndices F T r birth t).2 ⟨ht, x, hx, born⟩, born⟩ + +theorem essentialBirthFiber_subset (F T r birth t : ZFSet.{u}) : + essentialBirthFiber F T r birth t ⊆ birthEssentialSet F T r birth := + fun _ hx => ((mem_essentialBirthFiber F T r birth t _).1 hx).1 + +def OldBridgeCode (L r μ birth t x y : ZFSet.{u}) : Prop := + (∃ z a, ZFSet.pair (ZFSet.pair x y) z ∈ μ ∧ ZFSet.pair z a ∈ birth ∧ a ∈ t) ∨ + (∃ z ∈ L, ∃ a, ZFSet.pair z a ∈ birth ∧ a ∈ t ∧ + ((ZFSet.pair x z ∈ r ∧ ZFSet.pair z y ∈ r) ∨ + (ZFSet.pair y z ∈ r ∧ ZFSet.pair z x ∈ r))) + +theorem birthEssentials_no_oldBridge {L F T r μ birth t x y : ZFSet.{u}} + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (born : ZFSet.IsFunc L T birth) + (hx : x ∈ birthEssentialSet F T r birth) (hy : y ∈ birthEssentialSet F T r birth) + (xt : ZFSet.pair x t ∈ birth) (yt : ZFSet.pair y t ∈ birth) : + ¬ OldBridgeCode L r μ birth t x y := by + have xE := (mem_birthEssentialSet F T r birth x).1 hx + have yE := (mem_birthEssentialSet F T r birth y).1 hy + have ht := (ZFSet.pair_mem_prod.1 (born.1 xt)).2 + intro bridge + rcases bridge with ⟨z, a, meetXY, za, old⟩ | ⟨z, hz, a, za, old, intermediate⟩ + · have ha := (ZFSet.pair_mem_prod.1 (born.1 za)).2 + exact xE.2 z (filter.closed_meet x xE.1 y yE.1 z meetXY) a ha t ht + (meet.lower_left x y z meetXY) za xt old + · have ha := (ZFSet.pair_mem_prod.1 (born.1 za)).2 + rcases intermediate with ⟨xz, zy⟩ | ⟨yz, zx⟩ + · exact yE.2 z (filter.upward x xE.1 z hz xz) a ha t ht zy za yt old + · exact xE.2 z (filter.upward y yE.1 z hz yz) a ha t ht zx za xt old + +theorem birthEssentials_same_component {L F T r μ birth t x y : ZFSet.{u}} + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (born : ZFSet.IsFunc L T birth) {I : Type v} (component : ZFSet.{u} → I) + (separated : ∀ x ∈ L, ∀ y ∈ L, + ZFSet.pair x t ∈ birth → ZFSet.pair y t ∈ birth → component x ≠ component y → + OldBridgeCode L r μ birth t x y) + (hx : x ∈ birthEssentialSet F T r birth) (hy : y ∈ birthEssentialSet F T r birth) + (xt : ZFSet.pair x t ∈ birth) (yt : ZFSet.pair y t ∈ birth) : + component x = component y := by + classical + by_contra different + exact birthEssentials_no_oldBridge meet filter born hx hy xt yt + (separated x (filter.subset (birthEssentialSet_subset F T r birth hx)) + y (filter.subset (birthEssentialSet_subset F T r birth hy)) xt yt different) + +theorem essentialBirthFiber_same_component {L F T r μ birth t x y : ZFSet.{u}} + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (born : ZFSet.IsFunc L T birth) {I : Type v} (component : ZFSet.{u} → I) + (separated : ∀ x ∈ L, ∀ y ∈ L, + ZFSet.pair x t ∈ birth → ZFSet.pair y t ∈ birth → component x ≠ component y → + OldBridgeCode L r μ birth t x y) + (hx : x ∈ essentialBirthFiber F T r birth t) (hy : y ∈ essentialBirthFiber F T r birth t) : + component x = component y := by + have xE := (mem_essentialBirthFiber F T r birth t x).1 hx + have yE := (mem_essentialBirthFiber F T r birth t y).1 hy + exact birthEssentials_same_component meet filter born component separated xE.1 yE.1 xE.2.2 yE.2.2 + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem essentialBirthFiber_mem (separation : SeparationSchema M.sets) + {F T r birth t : ZFSet.{u}} (hF : F ∈ M.sets) (hT : T ∈ M.sets) + (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) (ht : t ∈ M.sets) : + essentialBirthFiber F T r birth t ∈ M.sets := by + let E := birthEssentialSet F T r birth + let params := extend t (extend T (extend birth Fin.elim0)) + let φ : BoundedFormula 4 := .conj (.mem 1 2) (BoundedFormula.pairMembershipFormula 0 1 3) + have selected := M.bounded_separation_mem separation φ params + (Fin.cases ht (Fin.cases hT (Fin.cases hBirth (fun j => Fin.elim0 j)))) + (M.birthEssentialSet_mem separation hF hT hr hBirth) + have eq : ZFSet.sep (fun x => BoundedFormula.Truth φ (extend x params)) E = + essentialBirthFiber F T r birth t := by + apply ZFSet.ext + intro x + rw [ZFSet.mem_sep, mem_essentialBirthFiber] + exact and_congr Iff.rfl + (and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 0 1 3 _)) + exact eq ▸ selected + +end TransitiveGround + +end + + + +section +universe u + +structure GroundMainStage (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) where + carrier : ZFSet.{u} + order : ZFSet.{u} + meetGraph : ZFSet.{u} + actors : ZFSet.{u} + multiplication : ZFSet.{u} + inverse : ZFSet.{u} + identity : ZFSet.{u} + action : ZFSet.{u} + bottom : ZFSet.{u} + top : ZFSet.{u} + height : ZFSet.{u} + carrier_ground : carrier ∈ M.sets + order_ground : order ∈ M.sets + meet_ground : meetGraph ∈ M.sets + actors_ground : actors ∈ M.sets + multiplication_ground : multiplication ∈ M.sets + inverse_ground : inverse ∈ M.sets + action_ground : action ∈ M.sets + height_ground : height ∈ M.sets + columns_ground : C ∈ M.sets + coordinates_ground : D ∈ M.sets + coordinate_order_ground : rD ∈ M.sets + meet : MeetOrderCode carrier order meetGraph + group_code : GroupCode actors multiplication inverse identity + action_code : PosetActionCode actors carrier multiplication identity order action + bottom_mem : bottom ∈ carrier + least : ∀ x ∈ carrier, ZFSet.pair bottom x ∈ order + top_mem : top ∈ carrier + greatest : ∀ x ∈ carrier, ZFSet.pair x top ∈ order + height_code : StrictLexHeightCode carrier C D order height rD + height_range_ground : relationImage carrier (ZFSet.prod C D) height ∈ M.sets + height_range_countable : M.groundEmbeddable (relationImage carrier (ZFSet.prod C D) height) ZFSet.omega + +namespace GroundMainStage +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) + +theorem bottom_ground : stage.bottom ∈ M.sets := M.transitive stage.carrier_ground stage.bottom_mem +theorem top_ground : stage.top ∈ M.sets := M.transitive stage.carrier_ground stage.top_mem +theorem identity_ground : stage.identity ∈ M.sets := M.transitive stage.actors_ground stage.group_code.identity_mem + +end GroundMainStage + + + + + +noncomputable def taggedBirth (P N birth stamp : ZFSet.{u}) : ZFSet.{u} := + birth ∪ ZFSet.prod (ZFSet.prod {P} N) {stamp} + +theorem pair_mem_taggedBirth (P N birth stamp x t : ZFSet.{u}) : + ZFSet.pair x t ∈ taggedBirth P N birth stamp ↔ + ZFSet.pair x t ∈ birth ∨ (x ∈ ZFSet.prod {P} N ∧ t = stamp) := by + rw [taggedBirth, ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton] + +theorem taggedBirth_subset (P N birth stamp : ZFSet.{u}) : birth ⊆ taggedBirth P N birth stamp := + fun _ hx => ZFSet.mem_union.2 (Or.inl hx) + +theorem taggedBirth_old_iff {P N birth stamp x t : ZFSet.{u}} (hx : x ∈ P) : + ZFSet.pair x t ∈ taggedBirth P N birth stamp ↔ ZFSet.pair x t ∈ birth := by + rw [pair_mem_taggedBirth] + exact ⟨fun h => h.elim id (fun h => False.elim (taggedExtension_disjoint P N x hx h.1)), Or.inl⟩ + +theorem taggedBirth_fresh_iff {P N T birth stamp q t : ZFSet.{u}} + (born : ZFSet.IsFunc P T birth) (hq : q ∈ N) : + ZFSet.pair (ZFSet.pair P q) t ∈ taggedBirth P N birth stamp ↔ t = stamp := by + rw [pair_mem_taggedBirth] + constructor + · intro h + exact h.elim (fun old => False.elim + (pair_tag_not_mem P q (ZFSet.pair_mem_prod.1 (born.1 old)).1)) And.right + · intro equal + exact Or.inr ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hq⟩, equal⟩ + +theorem taggedBirth_function {P N T birth stamp : ZFSet.{u}} + (born : ZFSet.IsFunc P T birth) (hs : stamp ∈ T) : + ZFSet.IsFunc (taggedExtension P N) T (taggedBirth P N birth stamp) := by + refine ⟨?_, ?_⟩ + · intro z hz + rcases ZFSet.mem_union.1 hz with old | fresh + · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (born.1 old) + exact ZFSet.pair_mem_prod.2 ⟨old_mem_taggedExtension hx, ht⟩ + · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 fresh + exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_union.2 (Or.inr hx), (ZFSet.mem_singleton.1 ht).symm ▸ hs⟩ + · intro x hx + rcases mem_taggedExtension.1 hx with old | ⟨q, hq, rfl⟩ + · obtain ⟨t, entry, unique⟩ := born.2 x old + exact ⟨t, (taggedBirth_old_iff old).2 entry, fun s h => unique s ((taggedBirth_old_iff old).1 h)⟩ + · exact ⟨stamp, (taggedBirth_fresh_iff born hq).2 rfl, + fun s h => (taggedBirth_fresh_iff born hq).1 h⟩ + +theorem taggedBirth_bound {P N birth stamp : ZFSet.{u}} + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) : + ∀ x t, ZFSet.pair x t ∈ taggedBirth P N birth stamp → t = stamp ∨ t ∈ stamp := by + intro x t entry + exact ((pair_mem_taggedBirth P N birth stamp x t).1 entry).elim + (fun old => Or.inr (earlier x t old)) (fun fresh => Or.inl fresh.2) + +theorem taggedBirth_stamp_iff {P N birth stamp x : ZFSet.{u}} + (earlier : ∀ x t, ZFSet.pair x t ∈ birth → t ∈ stamp) : + ZFSet.pair x stamp ∈ taggedBirth P N birth stamp ↔ x ∈ ZFSet.prod {P} N := by + rw [pair_mem_taggedBirth] + exact ⟨fun h => h.elim (fun old => False.elim (ZFSet.mem_irrefl stamp (earlier x stamp old))) And.left, + fun hx => Or.inr ⟨hx, rfl⟩⟩ + +theorem taggedBirth_earlier_iff {P N birth stamp x t : ZFSet.{u}} (before : t ∈ stamp) : + ZFSet.pair x t ∈ taggedBirth P N birth stamp ↔ ZFSet.pair x t ∈ birth := by + rw [pair_mem_taggedBirth] + exact ⟨fun h => h.elim id (fun fresh => False.elim (ZFSet.mem_irrefl stamp (fresh.2 ▸ before))), Or.inl⟩ + + + + + +noncomputable def mainStageCode (P r μ G m inv one A bottom top height : ZFSet.{u}) : ZFSet.{u} := + nonemptyTupleCode 10 (Fin.cases P (Fin.cases r (Fin.cases μ (Fin.cases G (Fin.cases m (Fin.cases inv (Fin.cases one (Fin.cases A (Fin.cases bottom (Fin.cases top (Fin.cases height (Fin.elim0)))))))))))) + +theorem mainStageCode_inj + {P r μ G m inv one A bottom top height P₂ r₂ μ₂ G₂ m₂ inv₂ one₂ A₂ bottom₂ top₂ height₂ : ZFSet.{u}} : + mainStageCode P r μ G m inv one A bottom top height = mainStageCode P₂ r₂ μ₂ G₂ m₂ inv₂ one₂ A₂ bottom₂ top₂ height₂ ↔ + P = P₂ ∧ r = r₂ ∧ μ = μ₂ ∧ G = G₂ ∧ m = m₂ ∧ inv = inv₂ ∧ one = one₂ ∧ A = A₂ ∧ bottom = bottom₂ ∧ top = top₂ ∧ height = height₂ := by + constructor + · intro equal + have fields := nonemptyTupleCode_injective 10 equal + exact ⟨congrFun fields (0 : Fin 11), congrFun fields (1 : Fin 11), congrFun fields (2 : Fin 11), congrFun fields (3 : Fin 11), congrFun fields (4 : Fin 11), congrFun fields (5 : Fin 11), congrFun fields (6 : Fin 11), congrFun fields (7 : Fin 11), congrFun fields (8 : Fin 11), congrFun fields (9 : Fin 11), congrFun fields (10 : Fin 11)⟩ + · rintro ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ + rfl + +namespace GroundMainStage +open SetFormula +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} + +def field (stage : GroundMainStage M C D rD) : Fin 11 → ZFSet.{u} := + Fin.cases stage.carrier (Fin.cases stage.order (Fin.cases stage.meetGraph (Fin.cases stage.actors (Fin.cases stage.multiplication (Fin.cases stage.inverse (Fin.cases stage.identity (Fin.cases stage.action (Fin.cases stage.bottom (Fin.cases stage.top (Fin.cases stage.height (Fin.elim0))))))))))) + +noncomputable def code (stage : GroundMainStage M C D rD) : ZFSet.{u} := + nonemptyTupleCode 10 stage.field + +@[ext] theorem ext {first second : GroundMainStage M C D rD} + (carrier : first.carrier = second.carrier) + (order : first.order = second.order) + (meetGraph : first.meetGraph = second.meetGraph) + (actors : first.actors = second.actors) + (multiplication : first.multiplication = second.multiplication) + (inverse : first.inverse = second.inverse) + (identity : first.identity = second.identity) + (action : first.action = second.action) + (bottom : first.bottom = second.bottom) + (top : first.top = second.top) + (height : first.height = second.height) : first = second := by + cases first + cases second + cases carrier + cases order + cases meetGraph + cases actors + cases multiplication + cases inverse + cases identity + cases action + cases bottom + cases top + cases height + rfl + +theorem field_injective : Function.Injective (field (M := M) (C := C) (D := D) (rD := rD)) := by + intro first second equal + exact ext (congrFun equal (0 : Fin 11)) (congrFun equal (1 : Fin 11)) (congrFun equal (2 : Fin 11)) (congrFun equal (3 : Fin 11)) (congrFun equal (4 : Fin 11)) (congrFun equal (5 : Fin 11)) (congrFun equal (6 : Fin 11)) (congrFun equal (7 : Fin 11)) (congrFun equal (8 : Fin 11)) (congrFun equal (9 : Fin 11)) (congrFun equal (10 : Fin 11)) + +theorem code_injective : Function.Injective (code (M := M) (C := C) (D := D) (rD := rD)) := by + intro first second equal + exact field_injective (nonemptyTupleCode_injective 10 equal) + +theorem field_ground (stage : GroundMainStage M C D rD) : ∀ j, stage.field j ∈ M.sets := + Fin.cases stage.carrier_ground (Fin.cases stage.order_ground (Fin.cases stage.meet_ground (Fin.cases stage.actors_ground (Fin.cases stage.multiplication_ground (Fin.cases stage.inverse_ground (Fin.cases stage.identity_ground (Fin.cases stage.action_ground (Fin.cases stage.bottom_ground (Fin.cases stage.top_ground (Fin.cases stage.height_ground ((fun i => Fin.elim0 i)))))))))))) + +theorem code_mem (stage : GroundMainStage M C D rD) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : stage.code ∈ M.sets := + M.nonemptyTupleCode_mem pairing 10 stage.field stage.field_ground + +end GroundMainStage + +namespace BoundedFormula +open SetFormula + +def mainStageFormula {n} (z P r μ G m inv one A bottom top height : Fin n) : BoundedFormula n := + nonemptyTupleFormula 10 z (Fin.cases P (Fin.cases r (Fin.cases μ (Fin.cases G (Fin.cases m (Fin.cases inv (Fin.cases one (Fin.cases A (Fin.cases bottom (Fin.cases top (Fin.cases height (Fin.elim0)))))))))))) + +theorem truth_mainStageFormula {n} (z P r μ G m inv one A bottom top height : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (mainStageFormula z P r μ G m inv one A bottom top height) env ↔ + env z = mainStageCode (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) (env A) (env bottom) (env top) (env height) := by + rw [mainStageFormula, truth_nonemptyTupleFormula] + rfl + +theorem realize_mainStageFormula (M : TransitiveGround.{u}) {n} + (z P r μ G m inv one A bottom top height : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (mainStageFormula z P r μ G m inv one A bottom top height).toFormula env ↔ + env z = mainStageCode (env P) (env r) (env μ) (env G) (env m) (env inv) (env one) (env A) (env bottom) (env top) (env height) := + (realize_toFormula M _ env members).trans (truth_mainStageFormula z P r μ G m inv one A bottom top height env) + +end BoundedFormula + +end + + + +namespace GroundMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} + +noncomputable def ofCodes + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A m inv one b t C D rD height : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hm : m ∈ M.sets) (hInv : inv ∈ M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hHeight : height ∈ M.sets) + (meet : MeetOrderCode P r μ) (group : GroupCode G m inv one) + (action : PosetActionCode G P m one r A) + (hb : b ∈ P) (least : ∀ x ∈ P, ZFSet.pair b x ∈ r) + (ht : t ∈ P) (greatest : ∀ x ∈ P, ZFSet.pair x t ∈ r) + (heightCode : StrictLexHeightCode P C D r height rD) + (heightSmall : M.groundEmbeddable (relationImage P (ZFSet.prod C D) height) ZFSet.omega) : + GroundMainStage M C D rD where + carrier := P + order := r + meetGraph := μ + actors := G + multiplication := m + inverse := inv + identity := one + action := A + bottom := b + top := t + height := height + carrier_ground := hP + order_ground := hr + meet_ground := hμ + actors_ground := hG + multiplication_ground := hm + inverse_ground := hInv + action_ground := hA + height_ground := hHeight + columns_ground := hC + coordinates_ground := hD + coordinate_order_ground := hrD + meet := meet + group_code := group + action_code := action + bottom_mem := hb + least := least + top_mem := ht + greatest := greatest + height_code := heightCode + height_range_ground := M.relationImage_mem separation hP + (M.prod_mem pairing unions powers separation hC hD) hHeight + height_range_countable := heightSmall + +end GroundMainStage + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageInvariant.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageInvariant.lean index 8546f2177600b73affc6be52bcb0eb9901a7233c..d18177740d30e48500b1f260f46454d3074ae6ed 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageInvariant.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainStageInvariant.lean @@ -1,245 +1,245 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowMainGraphs -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowExternalPoints -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorProfilePreservation - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable {P G r μ A Labels K : ZFSet.{u}} -variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) -variable (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) -variable (meet : MeetOrderCode P r μ) (conditions : GroundInaccessibleConditions M K) -variable (smallP : GroundBelow M P K) (smallG : GroundBelow M G K) (smallLabels : GroundBelow M Labels K) -include pairing unions powers separation infinite choice hP hG hr hμ hA hLabels hK meet conditions smallP smallG smallLabels - -theorem groundInitialExternalLetters_below : - GroundBelow M (externalChildLetters (M.groundEligibleTasks P G r μ A Labels) P - (externalRectangles P G r μ A)) K := by - have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet - have smallI := M.groundEligibleTasks_below pairing unions powers separation - hP hG hr hμ hA hLabels hK meet conditions.1 conditions.2.2.2 smallP smallLabels - have hRectangles := M.externalRectangles_mem pairing unions powers separation hP hG hr hμ hA - have rectangles := M.externalRectangles_below pairing unions powers separation hK conditions - hP hG hr hμ hA smallP smallG - exact M.externalChildLetters_below pairing unions powers separation infinite choice hK conditions - hI hP hRectangles smallI smallP rectangles - -theorem groundInitialExternalGroup_below {m one : ZFSet.{u}} - (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : - GroundBelow M (M.externalGroupCarrier G - (externalChildLetters (M.groundEligibleTasks P G r μ A Labels) P (externalRectangles P G r μ A)) m one) K := by - have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet - have hRectangles := M.externalRectangles_mem pairing unions powers separation hP hG hr hμ hA - have hLetters := M.externalChildLetters_mem pairing unions powers separation hI hP hRectangles - have letters := M.groundInitialExternalLetters_below pairing unions powers separation infinite choice - hP hG hr hμ hA hLabels hK meet conditions smallP smallG smallLabels - exact M.externalGroupCarrier_below_of_carriers pairing unions powers separation infinite choice - hK conditions hG hLetters hm hOne smallG letters - -end TransitiveGround - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) -variable (conditions : GroundInaccessibleConditions M K) -variable (points : GroundBelow M source.stage.carrier K) -variable (labels : GroundBelow M Labels K) -local notation "completion" => certificate.compression.born.profiled.heighted.completion -include certificate pairing unions powers separation collection infinite choice hLabels hK conditions points labels - -theorem compression_union_below : GroundBelow M ((completion).algebra.union.fields 0) K := by - exact M.initialCompressionUnion_below certificate.origin (completion).algebra.union - pairing unions powers separation collection infinite choice - source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground source.stage.meet_ground - source.stage.action_ground hLabels certificate.sources_ground certificate.representatives_ground - certificate.task_action_ground hK source.stage.meet conditions points labels - -theorem target_below (actors : GroundBelow M source.stage.actors K) : - GroundBelow M certificate.target.stage.carrier K ∧ - GroundBelow M certificate.target.stage.actors K := by - have groupSmall := M.groundInitialExternalGroup_below pairing unions powers separation infinite choice - source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground source.stage.meet_ground - source.stage.action_ground hLabels hK source.stage.meet conditions points actors labels - source.stage.multiplication_ground source.stage.identity_ground - have unionSmall := certificate.compression_union_below pairing unions powers separation collection infinite - choice hLabels hK conditions points labels - constructor - · rw [certificate.target_fields.1] - exact certificate.external.inputs.externalBoundedCarrier_below pairing unions powers separation infinite - source.stage.carrier_ground source.stage.actors_ground hK choice conditions groupSmall unionSmall - · rw [certificate.target_fields.2.2.2.1] - exact groupSmall - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hK : K ∈ M.sets) -include certificate pairing unions powers separation hK - -theorem transition_graphs_below (points : GroundBelow M source.stage.carrier K) - (actors : GroundBelow M source.stage.actors K) : - GroundBelow M certificate.transition.map.points K ∧ - GroundBelow M certificate.transition.map.actors K := - certificate.transition.map.graphs_below pairing unions powers separation hK points actors - -theorem target_graphs_below - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hLabels : Labels ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (points : GroundBelow M source.stage.carrier K) (actors : GroundBelow M source.stage.actors K) - (labels : GroundBelow M Labels K) : - GroundBelow M certificate.target.stage.order K ∧ - GroundBelow M certificate.target.stage.meetGraph K ∧ - GroundBelow M certificate.target.stage.multiplication K ∧ - GroundBelow M certificate.target.stage.inverse K ∧ - GroundBelow M certificate.target.stage.action K ∧ - GroundBelow M certificate.target.stage.height K ∧ - GroundBelow M certificate.target.birth K := by - obtain ⟨targetPoints, targetActors⟩ := certificate.target_below pairing unions powers separation - collection infinite choice hLabels hK conditions points labels actors - obtain ⟨order, meet, multiplication, inverse, action, height⟩ := - certificate.target.stage.graphs_below pairing unions powers separation hK - conditions.1 conditions.2.2.2 targetPoints targetActors - exact ⟨order, meet, multiplication, inverse, action, height, - certificate.target.birth_below pairing unions powers separation hK targetPoints⟩ - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} - -theorem standard_bounds (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (pointSize : GroundBelow M source.stage.carrier K) - (actorSize : GroundBelow M source.stage.actors K) (labelSize : GroundBelow M Labels K) - (pointRank : ZFSet.rank source.stage.carrier < ZFSet.rank K) - (actorRank : ZFSet.rank source.stage.actors < ZFSet.rank K) - (labelRank : ZFSet.rank Labels < ZFSet.rank K) (sourceTime : source.cutoff ∈ K) - (columnRank : ZFSet.rank C < ZFSet.rank K) (coordinateRank : ZFSet.rank D < ZFSet.rank K) : - GroundBelow M certificate.target.stage.carrier K ∧ - GroundBelow M certificate.target.stage.actors K ∧ - ZFSet.rank certificate.target.stage.carrier < ZFSet.rank K ∧ - ZFSet.rank certificate.target.stage.actors < ZFSet.rank K ∧ - ZFSet.rank certificate.target.stage.code < ZFSet.rank K ∧ - certificate.target.cutoff ∈ K ∧ - ZFSet.rank certificate.target.birth < ZFSet.rank K ∧ - GroundBelow M certificate.transition.map.points K ∧ - GroundBelow M certificate.transition.map.actors K ∧ - ZFSet.rank certificate.transition.map.code < ZFSet.rank K := by - have conditions := standard.to_conditions pairing unions powers separation hK - have sizes := certificate.target_below pairing unions powers separation collection infinite choice - hLabels hK conditions pointSize labelSize actorSize - have ranks := certificate.target_rank_lt pairing unions powers separation collection infinite - hK conditions pointRank labelRank actorRank - have maps := certificate.transition_graphs_below pairing unions powers separation hK pointSize actorSize - exact ⟨sizes.1, sizes.2, ranks.1, ranks.2, - certificate.target_code_rank_lt pairing unions powers separation collection infinite - hK conditions pointRank labelRank actorRank columnRank coordinateRank, - certificate.target_cutoff_mem pairing unions powers separation infinite hK conditions sourceTime, - certificate.target_birth_rank_lt pairing unions powers separation infinite hK conditions sourceTime ranks.1, - maps.1, maps.2, - certificate.transition_code_rank_lt pairing unions powers separation collection infinite - hK conditions pointRank labelRank actorRank⟩ - -end GroundInitialMainSuccessorData - -open SetFormula SetRealization -universe u - -namespace GroundChronologicalMainStage -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} - -structure Invariant (source : GroundChronologicalMainStage M C D rD) (K Labels : ZFSet.{u}) : Prop where - points_small : GroundBelow M source.stage.carrier K - actors_small : GroundBelow M source.stage.actors K - labels_small : GroundBelow M Labels K - points_rank : ZFSet.rank source.stage.carrier < ZFSet.rank K - actors_rank : ZFSet.rank source.stage.actors < ZFSet.rank K - labels_rank : ZFSet.rank Labels < ZFSet.rank K - cutoff_mem : source.cutoff ∈ K - columns_rank : ZFSet.rank C < ZFSet.rank K - coordinates_rank : ZFSet.rank D < ZFSet.rank K - -namespace Invariant -variable {source : GroundChronologicalMainStage M C D rD} {K Labels : ZFSet.{u}} -variable (invariant : source.Invariant K Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -include invariant pairing unions powers separation infinite hK conditions - -theorem code_rank_lt : ZFSet.rank source.stage.code < ZFSet.rank K := - source.stage.code_rank_lt_inaccessible pairing unions powers separation infinite hK conditions - invariant.points_rank invariant.actors_rank invariant.columns_rank invariant.coordinates_rank - -theorem birth_rank_lt : ZFSet.rank source.birth < ZFSet.rank K := - rank_functionGraph_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) - source.birth_function invariant.points_rank - (ZFSet.rank_lt_of_mem (conditions.successor_mem pairing unions powers separation infinite - hK invariant.cutoff_mem)) - -end Invariant - -end GroundChronologicalMainStage - -namespace GroundInitialMainSuccessorData -variable {M : TransitiveGround.{u}} {C D rD K Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} - -theorem target_invariant (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (invariant : source.Invariant K Labels) : certificate.target.Invariant K Labels := by - have bounds := certificate.standard_bounds pairing unions powers separation collection infinite choice - hLabels hK standard invariant.points_small invariant.actors_small invariant.labels_small - invariant.points_rank invariant.actors_rank invariant.labels_rank invariant.cutoff_mem - invariant.columns_rank invariant.coordinates_rank - exact ⟨bounds.1, bounds.2.1, invariant.labels_small, bounds.2.2.1, bounds.2.2.2.1, - invariant.labels_rank, bounds.2.2.2.2.2.1, invariant.columns_rank, invariant.coordinates_rank⟩ - -end GroundInitialMainSuccessorData - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowMainGraphs +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBelowExternalPoints +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorProfilePreservation + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable {P G r μ A Labels K : ZFSet.{u}} +variable (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) +variable (hμ : μ ∈ M.sets) (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) +variable (meet : MeetOrderCode P r μ) (conditions : GroundInaccessibleConditions M K) +variable (smallP : GroundBelow M P K) (smallG : GroundBelow M G K) (smallLabels : GroundBelow M Labels K) +include pairing unions powers separation infinite choice hP hG hr hμ hA hLabels hK meet conditions smallP smallG smallLabels + +theorem groundInitialExternalLetters_below : + GroundBelow M (externalChildLetters (M.groundEligibleTasks P G r μ A Labels) P + (externalRectangles P G r μ A)) K := by + have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet + have smallI := M.groundEligibleTasks_below pairing unions powers separation + hP hG hr hμ hA hLabels hK meet conditions.1 conditions.2.2.2 smallP smallLabels + have hRectangles := M.externalRectangles_mem pairing unions powers separation hP hG hr hμ hA + have rectangles := M.externalRectangles_below pairing unions powers separation hK conditions + hP hG hr hμ hA smallP smallG + exact M.externalChildLetters_below pairing unions powers separation infinite choice hK conditions + hI hP hRectangles smallI smallP rectangles + +theorem groundInitialExternalGroup_below {m one : ZFSet.{u}} + (hm : m ∈ M.sets) (hOne : one ∈ M.sets) : + GroundBelow M (M.externalGroupCarrier G + (externalChildLetters (M.groundEligibleTasks P G r μ A Labels) P (externalRectangles P G r μ A)) m one) K := by + have hI := M.groundEligibleTasks_mem pairing unions powers separation hP hG hr hμ hA hLabels meet + have hRectangles := M.externalRectangles_mem pairing unions powers separation hP hG hr hμ hA + have hLetters := M.externalChildLetters_mem pairing unions powers separation hI hP hRectangles + have letters := M.groundInitialExternalLetters_below pairing unions powers separation infinite choice + hP hG hr hμ hA hLabels hK meet conditions smallP smallG smallLabels + exact M.externalGroupCarrier_below_of_carriers pairing unions powers separation infinite choice + hK conditions hG hLetters hm hOne smallG letters + +end TransitiveGround + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) +variable (conditions : GroundInaccessibleConditions M K) +variable (points : GroundBelow M source.stage.carrier K) +variable (labels : GroundBelow M Labels K) +local notation "completion" => certificate.compression.born.profiled.heighted.completion +include certificate pairing unions powers separation collection infinite choice hLabels hK conditions points labels + +theorem compression_union_below : GroundBelow M ((completion).algebra.union.fields 0) K := by + exact M.initialCompressionUnion_below certificate.origin (completion).algebra.union + pairing unions powers separation collection infinite choice + source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground source.stage.meet_ground + source.stage.action_ground hLabels certificate.sources_ground certificate.representatives_ground + certificate.task_action_ground hK source.stage.meet conditions points labels + +theorem target_below (actors : GroundBelow M source.stage.actors K) : + GroundBelow M certificate.target.stage.carrier K ∧ + GroundBelow M certificate.target.stage.actors K := by + have groupSmall := M.groundInitialExternalGroup_below pairing unions powers separation infinite choice + source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground source.stage.meet_ground + source.stage.action_ground hLabels hK source.stage.meet conditions points actors labels + source.stage.multiplication_ground source.stage.identity_ground + have unionSmall := certificate.compression_union_below pairing unions powers separation collection infinite + choice hLabels hK conditions points labels + constructor + · rw [certificate.target_fields.1] + exact certificate.external.inputs.externalBoundedCarrier_below pairing unions powers separation infinite + source.stage.carrier_ground source.stage.actors_ground hK choice conditions groupSmall unionSmall + · rw [certificate.target_fields.2.2.2.1] + exact groupSmall + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hK : K ∈ M.sets) +include certificate pairing unions powers separation hK + +theorem transition_graphs_below (points : GroundBelow M source.stage.carrier K) + (actors : GroundBelow M source.stage.actors K) : + GroundBelow M certificate.transition.map.points K ∧ + GroundBelow M certificate.transition.map.actors K := + certificate.transition.map.graphs_below pairing unions powers separation hK points actors + +theorem target_graphs_below + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hLabels : Labels ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (points : GroundBelow M source.stage.carrier K) (actors : GroundBelow M source.stage.actors K) + (labels : GroundBelow M Labels K) : + GroundBelow M certificate.target.stage.order K ∧ + GroundBelow M certificate.target.stage.meetGraph K ∧ + GroundBelow M certificate.target.stage.multiplication K ∧ + GroundBelow M certificate.target.stage.inverse K ∧ + GroundBelow M certificate.target.stage.action K ∧ + GroundBelow M certificate.target.stage.height K ∧ + GroundBelow M certificate.target.birth K := by + obtain ⟨targetPoints, targetActors⟩ := certificate.target_below pairing unions powers separation + collection infinite choice hLabels hK conditions points labels actors + obtain ⟨order, meet, multiplication, inverse, action, height⟩ := + certificate.target.stage.graphs_below pairing unions powers separation hK + conditions.1 conditions.2.2.2 targetPoints targetActors + exact ⟨order, meet, multiplication, inverse, action, height, + certificate.target.birth_below pairing unions powers separation hK targetPoints⟩ + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} + +theorem standard_bounds (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (pointSize : GroundBelow M source.stage.carrier K) + (actorSize : GroundBelow M source.stage.actors K) (labelSize : GroundBelow M Labels K) + (pointRank : ZFSet.rank source.stage.carrier < ZFSet.rank K) + (actorRank : ZFSet.rank source.stage.actors < ZFSet.rank K) + (labelRank : ZFSet.rank Labels < ZFSet.rank K) (sourceTime : source.cutoff ∈ K) + (columnRank : ZFSet.rank C < ZFSet.rank K) (coordinateRank : ZFSet.rank D < ZFSet.rank K) : + GroundBelow M certificate.target.stage.carrier K ∧ + GroundBelow M certificate.target.stage.actors K ∧ + ZFSet.rank certificate.target.stage.carrier < ZFSet.rank K ∧ + ZFSet.rank certificate.target.stage.actors < ZFSet.rank K ∧ + ZFSet.rank certificate.target.stage.code < ZFSet.rank K ∧ + certificate.target.cutoff ∈ K ∧ + ZFSet.rank certificate.target.birth < ZFSet.rank K ∧ + GroundBelow M certificate.transition.map.points K ∧ + GroundBelow M certificate.transition.map.actors K ∧ + ZFSet.rank certificate.transition.map.code < ZFSet.rank K := by + have conditions := standard.to_conditions pairing unions powers separation hK + have sizes := certificate.target_below pairing unions powers separation collection infinite choice + hLabels hK conditions pointSize labelSize actorSize + have ranks := certificate.target_rank_lt pairing unions powers separation collection infinite + hK conditions pointRank labelRank actorRank + have maps := certificate.transition_graphs_below pairing unions powers separation hK pointSize actorSize + exact ⟨sizes.1, sizes.2, ranks.1, ranks.2, + certificate.target_code_rank_lt pairing unions powers separation collection infinite + hK conditions pointRank labelRank actorRank columnRank coordinateRank, + certificate.target_cutoff_mem pairing unions powers separation infinite hK conditions sourceTime, + certificate.target_birth_rank_lt pairing unions powers separation infinite hK conditions sourceTime ranks.1, + maps.1, maps.2, + certificate.transition_code_rank_lt pairing unions powers separation collection infinite + hK conditions pointRank labelRank actorRank⟩ + +end GroundInitialMainSuccessorData + +open SetFormula SetRealization +universe u + +namespace GroundChronologicalMainStage +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} + +structure Invariant (source : GroundChronologicalMainStage M C D rD) (K Labels : ZFSet.{u}) : Prop where + points_small : GroundBelow M source.stage.carrier K + actors_small : GroundBelow M source.stage.actors K + labels_small : GroundBelow M Labels K + points_rank : ZFSet.rank source.stage.carrier < ZFSet.rank K + actors_rank : ZFSet.rank source.stage.actors < ZFSet.rank K + labels_rank : ZFSet.rank Labels < ZFSet.rank K + cutoff_mem : source.cutoff ∈ K + columns_rank : ZFSet.rank C < ZFSet.rank K + coordinates_rank : ZFSet.rank D < ZFSet.rank K + +namespace Invariant +variable {source : GroundChronologicalMainStage M C D rD} {K Labels : ZFSet.{u}} +variable (invariant : source.Invariant K Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +include invariant pairing unions powers separation infinite hK conditions + +theorem code_rank_lt : ZFSet.rank source.stage.code < ZFSet.rank K := + source.stage.code_rank_lt_inaccessible pairing unions powers separation infinite hK conditions + invariant.points_rank invariant.actors_rank invariant.columns_rank invariant.coordinates_rank + +theorem birth_rank_lt : ZFSet.rank source.birth < ZFSet.rank K := + rank_functionGraph_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) + source.birth_function invariant.points_rank + (ZFSet.rank_lt_of_mem (conditions.successor_mem pairing unions powers separation infinite + hK invariant.cutoff_mem)) + +end Invariant + +end GroundChronologicalMainStage + +namespace GroundInitialMainSuccessorData +variable {M : TransitiveGround.{u}} {C D rD K Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} + +theorem target_invariant (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hLabels : Labels ∈ M.sets) (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (invariant : source.Invariant K Labels) : certificate.target.Invariant K Labels := by + have bounds := certificate.standard_bounds pairing unions powers separation collection infinite choice + hLabels hK standard invariant.points_small invariant.actors_small invariant.labels_small + invariant.points_rank invariant.actors_rank invariant.labels_rank invariant.cutoff_mem + invariant.columns_rank invariant.coordinates_rank + exact ⟨bounds.1, bounds.2.1, invariant.labels_small, bounds.2.2.1, bounds.2.2.2.1, + invariant.labels_rank, bounds.2.2.2.2.2.1, invariant.columns_rank, invariant.coordinates_rank⟩ + +end GroundInitialMainSuccessorData + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorCompressionActors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorCompressionActors.lean index dc5542b0fdcc4574e9675182ccef82699a975407..76cec39aa9816dc90185926d05863ee2edf35952 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorCompressionActors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorCompressionActors.lean @@ -1,79 +1,79 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTaskCapFulfillment - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -local notation "tasks" => source.stage.compressionTasks Labels -local notation "letters" => externalChildLetters tasks source.stage.carrier - (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action) -local notation "generators" => M.externalChildGenerators source.stage.actors letters source.stage.multiplication source.stage.identity -include certificate pairing unions powers separation infinite - -theorem compression_generator_full_agreement {i a g k g' a' : ZFSet.{u}} (hi : i ∈ tasks) - (sourceEntry : ZFSet.pair i a ∈ source.stage.compressionSources Labels) - (representative : ZFSet.pair i g ∈ certificate.Reps) - (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators) - (actor : ZFSet.pair g g' ∈ certificate.transition.map.actors) - (image : ZFSet.pair a a' ∈ certificate.transition.map.points) : - ActionAgreementBelow certificate.target.stage.carrier certificate.target.stage.order - certificate.target.stage.action k g' a' := by - rw [certificate.point_graph] at image - rw [certificate.actor_graph] at actor - rw [certificate.target_fields.1, certificate.target_fields.2.1, - certificate.target_fields.2.2.2.2.2.2.2.1] - exact certificate.external.inputs.bounded_compression_generator_agreement source.stage.group_code - source.stage.action_code pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground - (SetMembers.ofMem i hi) (by simpa only [SetMembers.raw_ofMem] using sourceEntry) - (by simpa only [SetMembers.raw_ofMem] using representative) - (by simpa only [SetMembers.raw_ofMem] using generator) actor image - -theorem compression_generator_cap_iff {i k τ' v : ZFSet.{u}} (hi : i ∈ tasks) - (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators) - (imageTop : ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points) : - ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ - ZFSet.pair i v ∈ certificate.compressionCapImages := by - rw [certificate.point_graph] at imageTop - rw [certificate.target_fields.2.2.2.2.2.2.2.1] - simpa only [SetMembers.raw_ofMem, compressionCapImages] using certificate.external.inputs.bounded_compression_generator_top_iff - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground (SetMembers.ofMem i hi) - (by simpa only [SetMembers.raw_ofMem] using generator) imageTop - -theorem exists_compression_actor {i : ZFSet.{u}} (hi : i ∈ tasks) : - ∃ k ∈ certificate.target.stage.actors, - (∀ a g g' a', ZFSet.pair i a ∈ source.stage.compressionSources Labels → - ZFSet.pair i g ∈ certificate.Reps → ZFSet.pair g g' ∈ certificate.transition.map.actors → - ZFSet.pair a a' ∈ certificate.transition.map.points → - ActionAgreementBelow certificate.target.stage.carrier certificate.target.stage.order - certificate.target.stage.action k g' a') ∧ - ∀ τ' v, ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points → - (ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ - ZFSet.pair i v ∈ certificate.compressionCapImages) := by - have letter := (compression_child_iff tasks source.stage.carrier - (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action) - i (natSetCode 0)).2 ⟨hi, rfl⟩ - obtain ⟨k, generator, _⟩ := certificate.external.inputs.generators_injection.function.2 _ letter - have hk := (ZFSet.pair_mem_prod.1 (certificate.external.inputs.generators_injection.function.1 generator)).2 - refine ⟨k, certificate.target_fields.2.2.2.1.symm ▸ hk, ?_, ?_⟩ - · intro a g g' a' sourceEntry representative actor image - exact certificate.compression_generator_full_agreement pairing unions powers separation infinite hi - sourceEntry representative generator actor image - · intro τ' v image - exact certificate.compression_generator_cap_iff pairing unions powers separation infinite hi generator image - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTaskCapFulfillment + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +local notation "tasks" => source.stage.compressionTasks Labels +local notation "letters" => externalChildLetters tasks source.stage.carrier + (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action) +local notation "generators" => M.externalChildGenerators source.stage.actors letters source.stage.multiplication source.stage.identity +include certificate pairing unions powers separation infinite + +theorem compression_generator_full_agreement {i a g k g' a' : ZFSet.{u}} (hi : i ∈ tasks) + (sourceEntry : ZFSet.pair i a ∈ source.stage.compressionSources Labels) + (representative : ZFSet.pair i g ∈ certificate.Reps) + (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators) + (actor : ZFSet.pair g g' ∈ certificate.transition.map.actors) + (image : ZFSet.pair a a' ∈ certificate.transition.map.points) : + ActionAgreementBelow certificate.target.stage.carrier certificate.target.stage.order + certificate.target.stage.action k g' a' := by + rw [certificate.point_graph] at image + rw [certificate.actor_graph] at actor + rw [certificate.target_fields.1, certificate.target_fields.2.1, + certificate.target_fields.2.2.2.2.2.2.2.1] + exact certificate.external.inputs.bounded_compression_generator_agreement source.stage.group_code + source.stage.action_code pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground + (SetMembers.ofMem i hi) (by simpa only [SetMembers.raw_ofMem] using sourceEntry) + (by simpa only [SetMembers.raw_ofMem] using representative) + (by simpa only [SetMembers.raw_ofMem] using generator) actor image + +theorem compression_generator_cap_iff {i k τ' v : ZFSet.{u}} (hi : i ∈ tasks) + (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 0) i) (natSetCode 0)) k ∈ generators) + (imageTop : ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points) : + ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ + ZFSet.pair i v ∈ certificate.compressionCapImages := by + rw [certificate.point_graph] at imageTop + rw [certificate.target_fields.2.2.2.2.2.2.2.1] + simpa only [SetMembers.raw_ofMem, compressionCapImages] using certificate.external.inputs.bounded_compression_generator_top_iff + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground (SetMembers.ofMem i hi) + (by simpa only [SetMembers.raw_ofMem] using generator) imageTop + +theorem exists_compression_actor {i : ZFSet.{u}} (hi : i ∈ tasks) : + ∃ k ∈ certificate.target.stage.actors, + (∀ a g g' a', ZFSet.pair i a ∈ source.stage.compressionSources Labels → + ZFSet.pair i g ∈ certificate.Reps → ZFSet.pair g g' ∈ certificate.transition.map.actors → + ZFSet.pair a a' ∈ certificate.transition.map.points → + ActionAgreementBelow certificate.target.stage.carrier certificate.target.stage.order + certificate.target.stage.action k g' a') ∧ + ∀ τ' v, ZFSet.pair source.stage.top τ' ∈ certificate.transition.map.points → + (ZFSet.pair (ZFSet.pair k τ') v ∈ certificate.target.stage.action ↔ + ZFSet.pair i v ∈ certificate.compressionCapImages) := by + have letter := (compression_child_iff tasks source.stage.carrier + (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action) + i (natSetCode 0)).2 ⟨hi, rfl⟩ + obtain ⟨k, generator, _⟩ := certificate.external.inputs.generators_injection.function.2 _ letter + have hk := (ZFSet.pair_mem_prod.1 (certificate.external.inputs.generators_injection.function.1 generator)).2 + refine ⟨k, certificate.target_fields.2.2.2.1.symm ▸ hk, ?_, ?_⟩ + · intro a g g' a' sourceEntry representative actor image + exact certificate.compression_generator_full_agreement pairing unions powers separation infinite hi + sourceEntry representative generator actor image + · intro τ' v image + exact certificate.compression_generator_cap_iff pairing unions powers separation infinite hi generator image + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorProfilePreservation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorProfilePreservation.lean index ad3f1c58b96518ea4e8f18c84ff551ac9533edd0..846b98fb4d5ade93801f27c98b03f4ee6269e371 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorProfilePreservation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorProfilePreservation.lean @@ -1,486 +1,486 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.ExternalStarCarrierRanks -import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainCodeRanks -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalMainTransition -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRawPriorLayers -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionCarrierRankBounds - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace GroundChronologicalMainStage -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (source : GroundChronologicalMainStage M C D rD) -variable {initial : RecursiveStateData.{u}} {I Sources Reps T Targets Separators Filters lo hi : ZFSet.{u}} -variable (compression : GroundChronologicalCompression M initial I Sources Reps source.stage.actors - source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier C D rD - source.stage.height Targets Separators Filters source.cutoff source.birth - (insert source.cutoff source.cutoff) source.history) -variable {births : GroundExternalBirthData M initial I Sources Reps source.stage.actors - source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order - source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth - compression.born.profiled.heighted.completion} -variable {heights : GroundExternalHeightData M initial I Sources Reps source.stage.actors - source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order - source.stage.meetGraph source.stage.action C D rD lo hi compression.born.profiled.heighted.heights.height - compression.born.profiled.heighted.completion} -variable (external : GroundChronologicalExternal M initial I Sources Reps source.stage.actors - source.stage.multiplication source.stage.inverse source.stage.identity T source.stage.top source.stage.carrier - source.stage.order source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth - C D rD lo hi compression.born.profiled.heighted.heights.height - (insert compression.born.births.limit compression.born.births.limit) - compression.born.profiled.heighted.completion births heights compression.history) -variable (origin : GroundCompressionOrigin M initial source.stage.carrier source.stage.order source.stage.meetGraph - source.stage.action source.stage.top I Sources Reps source.stage.actors source.stage.multiplication - source.stage.inverse source.stage.identity T Filters) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) -variable (initialDomain : initial.D = source.stage.carrier) (initialOrder : initial.rD = source.stage.order) -variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps source.stage.actors - source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order - source.stage.meetGraph source.stage.action C D rD lo hi compression.born.profiled.heighted.heights.height - compression.born.profiled.heighted.completion heights) -variable (boundedBirths : GroundBoundedExternalBirthData M initial I Sources Reps source.stage.actors - source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order - source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth - compression.born.profiled.heighted.completion births) -variable {b' : ZFSet.{u}} (image : ZFSet.pair source.stage.bottom b' ∈ - compression.born.profiled.heighted.completion.externalOriginalEmbedding - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action) - -include compression in -theorem external_cutoff_strict : source.cutoff ∈ births.limit := - births.times.ordinal.1 compression.born.births.limit births.times.base_mem_limit - source.cutoff compression.born.births.times.base_mem_limit - -noncomputable def externalTransition : - GroundChronologicalMainTransition source - (external.toMainStage origin source.stage.group_code source.stage.action_code pairing unions powers separation - infinite hI hSources hReps source.stage.actors_ground hT source.stage.carrier_ground - initialDomain initialOrder boundedHeights source.stage.columns_ground source.stage.coordinates_ground - source.stage.coordinate_order_ground source.stage.least image) where - map := source.stage.externalTransition external.inputs origin pairing unions powers separation infinite - hI hSources hReps hT initialDomain initialOrder compression.born.profiled.heighted.heights heights boundedHeights image - cutoff_le := Or.inr (source.external_cutoff_strict compression) - birth := by - intro x y t entry - rw [external.toMainStage_birth] - exact births.bounded_preserves_original compression.born.births boundedBirths initialDomain entry - history_prefix := by - intro s before - have first : s ∈ compression.born.births.limit := by - rcases before with rfl | before - · exact compression.born.births.times.base_mem_limit - · exact compression.born.births.times.ordinal.1 source.cutoff - compression.born.births.times.base_mem_limit s before - have final : s ∈ births.limit := births.times.ordinal.1 compression.born.births.limit - births.times.base_mem_limit s first - have a := compression.old_values s before.symm - have b := external.old_values s (Or.inl first) - have c := external.bounded_old_values s final - exact ⟨c.1.trans (b.1.trans a.1), c.2.1.trans (b.2.1.trans a.2.1), - c.2.2.1.trans (b.2.2.1.trans a.2.2.1), c.2.2.2.1.trans (b.2.2.2.1.trans a.2.2.2.1), - c.2.2.2.2.trans (b.2.2.2.2.trans a.2.2.2.2)⟩ - -theorem externalTransition_graphs : - let transition := source.externalTransition compression external origin pairing unions powers separation infinite - hI hSources hReps hT initialDomain initialOrder boundedHeights boundedBirths image - transition.map.points = compression.born.profiled.heighted.completion.externalOriginalEmbedding - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ - transition.map.actors = M.externalOldInclusion source.stage.actors - (externalChildLetters I source.stage.carrier - (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph - source.stage.action)) source.stage.multiplication source.stage.identity := ⟨rfl, rfl⟩ - -end GroundChronologicalMainStage - -section -universe u - -structure GroundInitialMainSuccessorData (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) - (source : GroundChronologicalMainStage M C D rD) (Labels : ZFSet.{u}) where - indices_ground : (source.stage.compressionTasks Labels) ∈ M.sets - sources_ground : (source.stage.compressionSources Labels) ∈ M.sets - filters_ground : (source.stage.compressionFilters Labels) ∈ M.sets - task_action_ground : (source.stage.compressionTaskAction Labels) ∈ M.sets - Reps : ZFSet.{u} - representatives_ground : Reps ∈ M.sets - origin : GroundCompressionOrigin M (source.stage.compressionInitial Labels) - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action source.stage.top - (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.inverse source.stage.identity (source.stage.compressionTaskAction Labels) (source.stage.compressionFilters Labels) - compression : GroundChronologicalCompression M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier C D rD source.stage.height (source.stage.compressionTargets Labels) (source.stage.compressionSeparators Labels) (source.stage.compressionFilters Labels) - source.cutoff source.birth (insert source.cutoff source.cutoff) source.history - geometry : GroundExternalGeometryData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action compression.born.profiled.heighted.completion - boundedGeometry : GroundExternalBoundedGeometryData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action compression.born.profiled.heighted.completion - lo : ZFSet.{u} - hi : ZFSet.{u} - lo_mem : lo ∈ D - hi_mem : hi ∈ D - interval : ZFSet.pair lo hi ∈ rD - heights : GroundExternalHeightData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion - boundedHeights : GroundBoundedExternalHeightData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action C D rD lo hi - compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights - births : GroundExternalBirthData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action - compression.born.births.limit compression.born.births.birth compression.born.profiled.heighted.completion - boundedBirths : GroundBoundedExternalBirthData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action - compression.born.births.limit compression.born.births.birth compression.born.profiled.heighted.completion births - external : GroundChronologicalExternal M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.inverse source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth - C D rD lo hi compression.born.profiled.heighted.heights.height (insert compression.born.births.limit compression.born.births.limit) - compression.born.profiled.heighted.completion births heights compression.history - bottomImage : ZFSet.{u} - bottom_ground : bottomImage ∈ M.sets - bottom_entry : ZFSet.pair source.stage.bottom bottomImage ∈ - compression.born.profiled.heighted.completion.externalOriginalEmbedding source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action - target : GroundChronologicalMainStage M C D rD - transition : GroundChronologicalMainTransition source target - cutoff_strict : source.cutoff ∈ target.cutoff - target_cutoff : target.cutoff = births.limit - target_history : HEq target.history external.bounded_history - target_fields : - target.stage.carrier = compression.born.profiled.heighted.completion.externalBoundedCarrier source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ - target.stage.order = compression.born.profiled.heighted.completion.externalBoundedOrder source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ - target.stage.meetGraph = compression.born.profiled.heighted.completion.externalBoundedMeet source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ - target.stage.actors = M.externalGroupCarrier source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity ∧ - target.stage.multiplication = M.externalGroupMultiplication source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity ∧ - target.stage.inverse = M.externalGroupInverse source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.inverse source.stage.identity ∧ - target.stage.identity = M.externalGroupIdentity source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity ∧ - target.stage.action = compression.born.profiled.heighted.completion.externalBoundedAction source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ - target.stage.bottom = bottomImage ∧ - target.stage.top = compression.born.profiled.heighted.completion.externalPointCarrier source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ - target.stage.height = heights.boundedHeight - target_birth : target.birth = births.boundedBirth - point_graph : transition.map.points = compression.born.profiled.heighted.completion.externalOriginalEmbedding - source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action - actor_graph : transition.map.actors = M.externalOldInclusion source.stage.actors - (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity - strict_new_top : ∀ x y, ZFSet.pair x y ∈ transition.map.points → - ZFSet.pair y target.stage.top ∈ target.stage.order ∧ - ZFSet.pair target.stage.top y ∉ target.stage.order - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) - -include choice in -theorem exists_groundInitialMainSuccessor {D rD Labels c : ZFSet.{u}} - (source : GroundChronologicalMainStage M - (M.groundOmegaOne pairing unions powers separation collection infinite) D rD) - (hLabels : Labels ∈ M.sets) (hc : c ∈ M.sets) - (dense : DenseOrderCode D rD) - (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) : - Nonempty (GroundInitialMainSuccessorData M - (M.groundOmegaOne pairing unions powers separation collection infinite) D rD source Labels) := by - obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, _data, geometry, - boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, boundedBirths, - ⟨external⟩⟩ := - M.exists_groundInitialExternalChronology pairing unions powers separation collection infinite choice - source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground source.stage.meet_ground - source.stage.action_ground hLabels source.stage.multiplication_ground source.stage.inverse_ground - source.stage.group_code source.stage.action_code source.stage.meet source.stage.top_mem source.stage.greatest - source.stage.coordinates_ground source.stage.coordinate_order_ground hc source.stage.height_ground - source.stage.height_code dense above coordinateInjection source.stage.height_range_countable - source.cutoff_ground source.history (ordinalSetProperty_succ source.cutoff_ordinal) - (ZFSet.mem_insert _ _) source.carrier_eq source.order_eq source.meet_eq rfl source.height_eq - obtain ⟨b', hb', image, _bottom⟩ := - external.inputs.exists_externalOriginal_bottom origin source.stage.group_code source.stage.action_code - pairing unions powers separation infinite hI hSources hReps source.stage.actors_ground hT - source.stage.carrier_ground rfl rfl source.stage.bottom_mem source.stage.least - let target := external.toMainStage origin source.stage.group_code source.stage.action_code - pairing unions powers separation infinite hI hSources hReps source.stage.actors_ground hT - source.stage.carrier_ground rfl rfl boundedHeights source.stage.columns_ground - source.stage.coordinates_ground source.stage.coordinate_order_ground source.stage.least image - let transition := source.externalTransition compression external origin pairing unions powers separation infinite - hI hSources hReps hT rfl rfl boundedHeights boundedBirths image - refine ⟨{ - indices_ground := hI - sources_ground := hSources - filters_ground := hFilters - task_action_ground := hT - Reps := Reps - representatives_ground := hReps - origin := origin - compression := compression - geometry := geometry - boundedGeometry := boundedGeometry - lo := lo - hi := hi - lo_mem := hlo - hi_mem := hhi - interval := gap - heights := heights - boundedHeights := boundedHeights - births := births - boundedBirths := boundedBirths - external := external - bottomImage := b' - bottom_ground := hb' - bottom_entry := image - target := target - transition := transition - cutoff_strict := source.external_cutoff_strict compression - target_cutoff := rfl - target_history := HEq.rfl - target_fields := ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ - target_birth := external.toMainStage_birth origin source.stage.group_code source.stage.action_code - pairing unions powers separation infinite hI hSources hReps source.stage.actors_ground hT - source.stage.carrier_ground rfl rfl boundedHeights source.stage.columns_ground - source.stage.coordinates_ground source.stage.coordinate_order_ground source.stage.least image - point_graph := rfl - actor_graph := rfl - strict_new_top := ?_ }⟩ - intro x y entry - exact external.inputs.externalOriginal_top_strict source.stage.group_code source.stage.action_code - pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground entry - -end TransitiveGround - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -local notation "completion" => certificate.compression.born.profiled.heighted.completion - -theorem target_rank_lt_of_components {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) - (omega : ZFSet.rank ZFSet.omega < o) - (indices : ZFSet.rank (source.stage.compressionTasks Labels) < o) - (points : ZFSet.rank source.stage.carrier < o) - (actors : ZFSet.rank source.stage.actors < o) - (completed : ZFSet.rank ((completion).algebra.union.fields 0) < o) : - ZFSet.rank certificate.target.stage.carrier < o ∧ - ZFSet.rank certificate.target.stage.actors < o := by - constructor - · rw [certificate.target_fields.1] - exact (completion).externalBoundedCarrier_rank_lt limit source.stage.order source.stage.meetGraph - source.stage.action omega indices points actors completed - · rw [certificate.target_fields.2.2.2.1] - exact M.externalRequestGroup_rank_lt limit source.stage.order source.stage.meetGraph - source.stage.action source.stage.multiplication source.stage.identity omega indices points actors - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (points : ZFSet.rank source.stage.carrier < ZFSet.rank K) -variable (labels : ZFSet.rank Labels < ZFSet.rank K) -include certificate pairing unions powers separation collection infinite hK conditions points labels - -theorem compression_union_rank_lt : - ZFSet.rank ((completion).algebra.union.fields 0) < ZFSet.rank K := - M.initialCompressionUnion_rank_lt (completion).algebra.union - pairing unions powers separation collection infinite hK conditions points labels - -theorem target_rank_lt (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) : - ZFSet.rank certificate.target.stage.carrier < ZFSet.rank K ∧ - ZFSet.rank certificate.target.stage.actors < ZFSet.rank K := by - have limit := conditions.rank_isLimit pairing unions powers separation infinite hK - have tasks := M.groundEligibleTasks_rank_lt limit source.stage.actors source.stage.order - source.stage.meetGraph source.stage.action points labels - exact certificate.target_rank_lt_of_components limit (ZFSet.rank_lt_of_mem conditions.2.1) - tasks points actors - (certificate.compression_union_rank_lt pairing unions powers separation collection infinite - hK conditions points labels) - -theorem target_code_rank_lt (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) - (columns : ZFSet.rank C < ZFSet.rank K) (coordinates : ZFSet.rank D < ZFSet.rank K) : - ZFSet.rank certificate.target.stage.code < ZFSet.rank K := by - have target := certificate.target_rank_lt pairing unions powers separation collection infinite - hK conditions points labels actors - exact certificate.target.stage.code_rank_lt - (conditions.rank_isLimit pairing unions powers separation infinite hK) - target.1 target.2 columns coordinates - -theorem target_code_rank_lt_omegaOne (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) - (actualColumns : C = M.groundOmegaOne pairing unions powers separation collection infinite) - (coordinates : ZFSet.rank D < ZFSet.rank K) : - ZFSet.rank certificate.target.stage.code < ZFSet.rank K := by - have columns : ZFSet.rank C < ZFSet.rank K := by - rw [actualColumns] - exact ZFSet.rank_lt_of_mem - (conditions.groundOmegaOne_mem pairing unions powers separation collection infinite hK) - exact certificate.target_code_rank_lt pairing unions powers separation collection infinite - hK conditions points labels actors columns coordinates - -theorem transition_code_rank_lt (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) : - ZFSet.rank certificate.transition.map.code < ZFSet.rank K := by - have target := certificate.target_rank_lt pairing unions powers separation collection infinite - hK conditions points labels actors - exact certificate.transition.map.code_rank_lt - (conditions.rank_isLimit pairing unions powers separation infinite hK) - points target.1 actors target.2 - -end GroundInitialMainSuccessorData - -namespace GroundInitialMainSuccessorData -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (sourceTime : source.cutoff ∈ K) -include certificate pairing unions powers separation infinite hK conditions sourceTime - -theorem compression_limit_mem : certificate.compression.born.births.limit ∈ K := - conditions.compressionStamp_limit_mem pairing unions powers separation infinite hK - certificate.compression.born.births.times sourceTime certificate.compression.born.births.stamps_ground - -theorem external_limit_mem : certificate.births.limit ∈ K := - conditions.compressionStamp_limit_mem pairing unions powers separation infinite hK - certificate.births.times - (certificate.compression_limit_mem pairing unions powers separation infinite hK conditions sourceTime) - certificate.births.stamps_ground - -theorem target_cutoff_mem : certificate.target.cutoff ∈ K := by - rw [certificate.target_cutoff] - exact certificate.external_limit_mem pairing unions powers separation infinite hK conditions sourceTime - -theorem target_time_domain_mem : insert certificate.target.cutoff certificate.target.cutoff ∈ K := - conditions.successor_mem pairing unions powers separation infinite hK - (certificate.target_cutoff_mem pairing unions powers separation infinite hK conditions sourceTime) - -theorem target_birth_rank_lt - (points : ZFSet.rank certificate.target.stage.carrier < ZFSet.rank K) : - ZFSet.rank certificate.target.birth < ZFSet.rank K := - rank_functionGraph_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) - certificate.target.birth_function points - (ZFSet.rank_lt_of_mem - (certificate.target_time_domain_mem pairing unions powers separation infinite hK conditions sourceTime)) - -end GroundInitialMainSuccessorData - -section -universe u - -namespace GroundCompressionBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T base old : ZFSet.{u}} -variable {union : GroundCompressionUnionData M initial I Sources Reps G m one T} - -theorem prior_entry (births : GroundCompressionBirthData M initial I Sources Reps G m one T union base old) - {x t : ZFSet.{u}} (before : t = base ∨ t ∈ base) (entry : ZFSet.pair x t ∈ births.birth) : - x ∈ initial.D ∧ ZFSet.pair x t ∈ old := by - rcases (births.extension.entries x t).1 entry with original | ⟨n, _, _, equal⟩ - · exact ⟨(ZFSet.pair_mem_prod.1 (births.initial_function.1 original)).1, original⟩ - · have absurd := compressionStamp_old_mem before.symm n - rw [← equal] at absurd - exact (ZFSet.mem_irrefl t absurd).elim - -end GroundCompressionBirthData - -namespace GroundExternalBirthData -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m one T τ P0 r0 μ0 A0 base old : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (compressionBirths : GroundCompressionBirthData M initial I Sources Reps G m one T - completion.algebra.union base old) -variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ - P0 r0 μ0 A0 compressionBirths.limit compressionBirths.birth completion) - -theorem originalFiber_image (initialDomain : initial.D = P0) {y t : ZFSet.{u}} - (before : t = base ∨ t ∈ base) (entry : ZFSet.pair y t ∈ births.birth) : - ∃ x ∈ P0, ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0 := by - have earlier : t ∈ compressionBirths.limit := before.elim - (fun equal => equal.symm ▸ compressionBirths.times.base_mem_limit) - (fun member => compressionBirths.times.ordinal.1 base compressionBirths.times.base_mem_limit t member) - obtain ⟨x, _, copied⟩ := births.priorFiber_image (Or.inl earlier) entry - have original := compressionBirths.prior_entry before ((births.preserves_seed x y t copied).1 entry) - have hx : x ∈ P0 := initialDomain ▸ original.1 - exact ⟨x, hx, (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).2 ⟨copied, hx⟩⟩ - -theorem boundedOriginalFiber_image (initialDomain : initial.D = P0) {y t : ZFSet.{u}} - (before : t = base ∨ t ∈ base) (entry : ZFSet.pair y t ∈ births.boundedBirth) : - ∃ x ∈ P0, ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0 := by - have earlier : t ∈ compressionBirths.limit := before.elim - (fun equal => equal.symm ▸ compressionBirths.times.base_mem_limit) - (fun member => compressionBirths.times.ordinal.1 base compressionBirths.times.base_mem_limit t member) - have final : t ∈ births.limit := births.times.ordinal.1 compressionBirths.limit - births.times.base_mem_limit t earlier - exact births.originalFiber_image compressionBirths initialDomain before - ((fixedTopBirth_earlier_iff final).1 entry) - -end GroundExternalBirthData - -namespace GroundInitialMainSuccessorData -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -theorem oldBirthFiberCoverage : OldBirthFiberCoverageCode source.stage.carrier - certificate.transition.map.points certificate.target.birth source.cutoff := by - intro y t entry before - rw [certificate.target_birth] at entry - rw [certificate.point_graph] - exact certificate.births.boundedOriginalFiber_image certificate.compression.born.births rfl before entry - -theorem coversOldBirths : certificate.transition.CoversOldBirths := - certificate.oldBirthFiberCoverage - -end GroundInitialMainSuccessorData -end - -namespace GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -theorem capProfile_preserved - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {c e K F c' e' K' : ZFSet.{u}} - (profile : CodedCapProfile source.stage.carrier source.stage.order source.stage.meetGraph c e K F) - (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) - (imageE : ZFSet.pair e e' ∈ certificate.transition.map.points) - (imageK : ZFSet.pair K K' ∈ certificate.transition.map.points) : - CodedCapProfile certificate.target.stage.carrier certificate.target.stage.order - certificate.target.stage.meetGraph c' e' K' - (relationImage F certificate.target.stage.carrier certificate.transition.map.points) := by - have inherited := certificate.origin.union_input_capProfile - certificate.compression.born.profiled.heighted.completion.algebra.union - pairing unions powers separation certificate.indices_ground certificate.sources_ground - certificate.representatives_ground source.stage.actors_ground certificate.task_action_ground profile - obtain ⟨points, order, meet, _⟩ := certificate.target_fields - rw [points, order, meet, certificate.point_graph] - rw [certificate.point_graph] at imageC imageE imageK - exact certificate.external.inputs.externalBounded_original_capProfile - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground inherited profile.filter_subset imageC imageE imageK - -end GroundInitialMainSuccessorData - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.ExternalStarCarrierRanks +import OAI.SetTheory.PartitionPrinciple.Definability.GroundMainCodeRanks +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalMainTransition +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRawPriorLayers +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionCarrierRankBounds + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace GroundChronologicalMainStage +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (source : GroundChronologicalMainStage M C D rD) +variable {initial : RecursiveStateData.{u}} {I Sources Reps T Targets Separators Filters lo hi : ZFSet.{u}} +variable (compression : GroundChronologicalCompression M initial I Sources Reps source.stage.actors + source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier C D rD + source.stage.height Targets Separators Filters source.cutoff source.birth + (insert source.cutoff source.cutoff) source.history) +variable {births : GroundExternalBirthData M initial I Sources Reps source.stage.actors + source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order + source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth + compression.born.profiled.heighted.completion} +variable {heights : GroundExternalHeightData M initial I Sources Reps source.stage.actors + source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order + source.stage.meetGraph source.stage.action C D rD lo hi compression.born.profiled.heighted.heights.height + compression.born.profiled.heighted.completion} +variable (external : GroundChronologicalExternal M initial I Sources Reps source.stage.actors + source.stage.multiplication source.stage.inverse source.stage.identity T source.stage.top source.stage.carrier + source.stage.order source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth + C D rD lo hi compression.born.profiled.heighted.heights.height + (insert compression.born.births.limit compression.born.births.limit) + compression.born.profiled.heighted.completion births heights compression.history) +variable (origin : GroundCompressionOrigin M initial source.stage.carrier source.stage.order source.stage.meetGraph + source.stage.action source.stage.top I Sources Reps source.stage.actors source.stage.multiplication + source.stage.inverse source.stage.identity T Filters) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) (hT : T ∈ M.sets) +variable (initialDomain : initial.D = source.stage.carrier) (initialOrder : initial.rD = source.stage.order) +variable (boundedHeights : GroundBoundedExternalHeightData M initial I Sources Reps source.stage.actors + source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order + source.stage.meetGraph source.stage.action C D rD lo hi compression.born.profiled.heighted.heights.height + compression.born.profiled.heighted.completion heights) +variable (boundedBirths : GroundBoundedExternalBirthData M initial I Sources Reps source.stage.actors + source.stage.multiplication source.stage.identity T source.stage.top source.stage.carrier source.stage.order + source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth + compression.born.profiled.heighted.completion births) +variable {b' : ZFSet.{u}} (image : ZFSet.pair source.stage.bottom b' ∈ + compression.born.profiled.heighted.completion.externalOriginalEmbedding + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action) + +include compression in +theorem external_cutoff_strict : source.cutoff ∈ births.limit := + births.times.ordinal.1 compression.born.births.limit births.times.base_mem_limit + source.cutoff compression.born.births.times.base_mem_limit + +noncomputable def externalTransition : + GroundChronologicalMainTransition source + (external.toMainStage origin source.stage.group_code source.stage.action_code pairing unions powers separation + infinite hI hSources hReps source.stage.actors_ground hT source.stage.carrier_ground + initialDomain initialOrder boundedHeights source.stage.columns_ground source.stage.coordinates_ground + source.stage.coordinate_order_ground source.stage.least image) where + map := source.stage.externalTransition external.inputs origin pairing unions powers separation infinite + hI hSources hReps hT initialDomain initialOrder compression.born.profiled.heighted.heights heights boundedHeights image + cutoff_le := Or.inr (source.external_cutoff_strict compression) + birth := by + intro x y t entry + rw [external.toMainStage_birth] + exact births.bounded_preserves_original compression.born.births boundedBirths initialDomain entry + history_prefix := by + intro s before + have first : s ∈ compression.born.births.limit := by + rcases before with rfl | before + · exact compression.born.births.times.base_mem_limit + · exact compression.born.births.times.ordinal.1 source.cutoff + compression.born.births.times.base_mem_limit s before + have final : s ∈ births.limit := births.times.ordinal.1 compression.born.births.limit + births.times.base_mem_limit s first + have a := compression.old_values s before.symm + have b := external.old_values s (Or.inl first) + have c := external.bounded_old_values s final + exact ⟨c.1.trans (b.1.trans a.1), c.2.1.trans (b.2.1.trans a.2.1), + c.2.2.1.trans (b.2.2.1.trans a.2.2.1), c.2.2.2.1.trans (b.2.2.2.1.trans a.2.2.2.1), + c.2.2.2.2.trans (b.2.2.2.2.trans a.2.2.2.2)⟩ + +theorem externalTransition_graphs : + let transition := source.externalTransition compression external origin pairing unions powers separation infinite + hI hSources hReps hT initialDomain initialOrder boundedHeights boundedBirths image + transition.map.points = compression.born.profiled.heighted.completion.externalOriginalEmbedding + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ + transition.map.actors = M.externalOldInclusion source.stage.actors + (externalChildLetters I source.stage.carrier + (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph + source.stage.action)) source.stage.multiplication source.stage.identity := ⟨rfl, rfl⟩ + +end GroundChronologicalMainStage + +section +universe u + +structure GroundInitialMainSuccessorData (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) + (source : GroundChronologicalMainStage M C D rD) (Labels : ZFSet.{u}) where + indices_ground : (source.stage.compressionTasks Labels) ∈ M.sets + sources_ground : (source.stage.compressionSources Labels) ∈ M.sets + filters_ground : (source.stage.compressionFilters Labels) ∈ M.sets + task_action_ground : (source.stage.compressionTaskAction Labels) ∈ M.sets + Reps : ZFSet.{u} + representatives_ground : Reps ∈ M.sets + origin : GroundCompressionOrigin M (source.stage.compressionInitial Labels) + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action source.stage.top + (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.inverse source.stage.identity (source.stage.compressionTaskAction Labels) (source.stage.compressionFilters Labels) + compression : GroundChronologicalCompression M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier C D rD source.stage.height (source.stage.compressionTargets Labels) (source.stage.compressionSeparators Labels) (source.stage.compressionFilters Labels) + source.cutoff source.birth (insert source.cutoff source.cutoff) source.history + geometry : GroundExternalGeometryData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action compression.born.profiled.heighted.completion + boundedGeometry : GroundExternalBoundedGeometryData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action compression.born.profiled.heighted.completion + lo : ZFSet.{u} + hi : ZFSet.{u} + lo_mem : lo ∈ D + hi_mem : hi ∈ D + interval : ZFSet.pair lo hi ∈ rD + heights : GroundExternalHeightData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion + boundedHeights : GroundBoundedExternalHeightData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action C D rD lo hi + compression.born.profiled.heighted.heights.height compression.born.profiled.heighted.completion heights + births : GroundExternalBirthData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action + compression.born.births.limit compression.born.births.birth compression.born.profiled.heighted.completion + boundedBirths : GroundBoundedExternalBirthData M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action + compression.born.births.limit compression.born.births.birth compression.born.profiled.heighted.completion births + external : GroundChronologicalExternal M (source.stage.compressionInitial Labels) (source.stage.compressionTasks Labels) (source.stage.compressionSources Labels) Reps source.stage.actors source.stage.multiplication source.stage.inverse source.stage.identity (source.stage.compressionTaskAction Labels) source.stage.top + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action compression.born.births.limit compression.born.births.birth + C D rD lo hi compression.born.profiled.heighted.heights.height (insert compression.born.births.limit compression.born.births.limit) + compression.born.profiled.heighted.completion births heights compression.history + bottomImage : ZFSet.{u} + bottom_ground : bottomImage ∈ M.sets + bottom_entry : ZFSet.pair source.stage.bottom bottomImage ∈ + compression.born.profiled.heighted.completion.externalOriginalEmbedding source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action + target : GroundChronologicalMainStage M C D rD + transition : GroundChronologicalMainTransition source target + cutoff_strict : source.cutoff ∈ target.cutoff + target_cutoff : target.cutoff = births.limit + target_history : HEq target.history external.bounded_history + target_fields : + target.stage.carrier = compression.born.profiled.heighted.completion.externalBoundedCarrier source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ + target.stage.order = compression.born.profiled.heighted.completion.externalBoundedOrder source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ + target.stage.meetGraph = compression.born.profiled.heighted.completion.externalBoundedMeet source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ + target.stage.actors = M.externalGroupCarrier source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity ∧ + target.stage.multiplication = M.externalGroupMultiplication source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity ∧ + target.stage.inverse = M.externalGroupInverse source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.inverse source.stage.identity ∧ + target.stage.identity = M.externalGroupIdentity source.stage.actors (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity ∧ + target.stage.action = compression.born.profiled.heighted.completion.externalBoundedAction source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ + target.stage.bottom = bottomImage ∧ + target.stage.top = compression.born.profiled.heighted.completion.externalPointCarrier source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action ∧ + target.stage.height = heights.boundedHeight + target_birth : target.birth = births.boundedBirth + point_graph : transition.map.points = compression.born.profiled.heighted.completion.externalOriginalEmbedding + source.stage.carrier source.stage.order source.stage.meetGraph source.stage.action + actor_graph : transition.map.actors = M.externalOldInclusion source.stage.actors + (externalChildLetters (source.stage.compressionTasks Labels) source.stage.carrier (externalRectangles source.stage.carrier source.stage.actors source.stage.order source.stage.meetGraph source.stage.action)) source.stage.multiplication source.stage.identity + strict_new_top : ∀ x y, ZFSet.pair x y ∈ transition.map.points → + ZFSet.pair y target.stage.top ∈ target.stage.order ∧ + ZFSet.pair target.stage.top y ∉ target.stage.order + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) + +include choice in +theorem exists_groundInitialMainSuccessor {D rD Labels c : ZFSet.{u}} + (source : GroundChronologicalMainStage M + (M.groundOmegaOne pairing unions powers separation collection infinite) D rD) + (hLabels : Labels ∈ M.sets) (hc : c ∈ M.sets) + (dense : DenseOrderCode D rD) + (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) : + Nonempty (GroundInitialMainSuccessorData M + (M.groundOmegaOne pairing unions powers separation collection infinite) D rD source Labels) := by + obtain ⟨hI, hSources, hFilters, hT, Reps, hReps, origin, compression, _data, geometry, + boundedGeometry, lo, hlo, hi, hhi, gap, heights, boundedHeights, births, boundedBirths, + ⟨external⟩⟩ := + M.exists_groundInitialExternalChronology pairing unions powers separation collection infinite choice + source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground source.stage.meet_ground + source.stage.action_ground hLabels source.stage.multiplication_ground source.stage.inverse_ground + source.stage.group_code source.stage.action_code source.stage.meet source.stage.top_mem source.stage.greatest + source.stage.coordinates_ground source.stage.coordinate_order_ground hc source.stage.height_ground + source.stage.height_code dense above coordinateInjection source.stage.height_range_countable + source.cutoff_ground source.history (ordinalSetProperty_succ source.cutoff_ordinal) + (ZFSet.mem_insert _ _) source.carrier_eq source.order_eq source.meet_eq rfl source.height_eq + obtain ⟨b', hb', image, _bottom⟩ := + external.inputs.exists_externalOriginal_bottom origin source.stage.group_code source.stage.action_code + pairing unions powers separation infinite hI hSources hReps source.stage.actors_ground hT + source.stage.carrier_ground rfl rfl source.stage.bottom_mem source.stage.least + let target := external.toMainStage origin source.stage.group_code source.stage.action_code + pairing unions powers separation infinite hI hSources hReps source.stage.actors_ground hT + source.stage.carrier_ground rfl rfl boundedHeights source.stage.columns_ground + source.stage.coordinates_ground source.stage.coordinate_order_ground source.stage.least image + let transition := source.externalTransition compression external origin pairing unions powers separation infinite + hI hSources hReps hT rfl rfl boundedHeights boundedBirths image + refine ⟨{ + indices_ground := hI + sources_ground := hSources + filters_ground := hFilters + task_action_ground := hT + Reps := Reps + representatives_ground := hReps + origin := origin + compression := compression + geometry := geometry + boundedGeometry := boundedGeometry + lo := lo + hi := hi + lo_mem := hlo + hi_mem := hhi + interval := gap + heights := heights + boundedHeights := boundedHeights + births := births + boundedBirths := boundedBirths + external := external + bottomImage := b' + bottom_ground := hb' + bottom_entry := image + target := target + transition := transition + cutoff_strict := source.external_cutoff_strict compression + target_cutoff := rfl + target_history := HEq.rfl + target_fields := ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ + target_birth := external.toMainStage_birth origin source.stage.group_code source.stage.action_code + pairing unions powers separation infinite hI hSources hReps source.stage.actors_ground hT + source.stage.carrier_ground rfl rfl boundedHeights source.stage.columns_ground + source.stage.coordinates_ground source.stage.coordinate_order_ground source.stage.least image + point_graph := rfl + actor_graph := rfl + strict_new_top := ?_ }⟩ + intro x y entry + exact external.inputs.externalOriginal_top_strict source.stage.group_code source.stage.action_code + pairing unions powers separation infinite source.stage.actors_ground source.stage.carrier_ground entry + +end TransitiveGround + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +local notation "completion" => certificate.compression.born.profiled.heighted.completion + +theorem target_rank_lt_of_components {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) + (omega : ZFSet.rank ZFSet.omega < o) + (indices : ZFSet.rank (source.stage.compressionTasks Labels) < o) + (points : ZFSet.rank source.stage.carrier < o) + (actors : ZFSet.rank source.stage.actors < o) + (completed : ZFSet.rank ((completion).algebra.union.fields 0) < o) : + ZFSet.rank certificate.target.stage.carrier < o ∧ + ZFSet.rank certificate.target.stage.actors < o := by + constructor + · rw [certificate.target_fields.1] + exact (completion).externalBoundedCarrier_rank_lt limit source.stage.order source.stage.meetGraph + source.stage.action omega indices points actors completed + · rw [certificate.target_fields.2.2.2.1] + exact M.externalRequestGroup_rank_lt limit source.stage.order source.stage.meetGraph + source.stage.action source.stage.multiplication source.stage.identity omega indices points actors + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (points : ZFSet.rank source.stage.carrier < ZFSet.rank K) +variable (labels : ZFSet.rank Labels < ZFSet.rank K) +include certificate pairing unions powers separation collection infinite hK conditions points labels + +theorem compression_union_rank_lt : + ZFSet.rank ((completion).algebra.union.fields 0) < ZFSet.rank K := + M.initialCompressionUnion_rank_lt (completion).algebra.union + pairing unions powers separation collection infinite hK conditions points labels + +theorem target_rank_lt (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) : + ZFSet.rank certificate.target.stage.carrier < ZFSet.rank K ∧ + ZFSet.rank certificate.target.stage.actors < ZFSet.rank K := by + have limit := conditions.rank_isLimit pairing unions powers separation infinite hK + have tasks := M.groundEligibleTasks_rank_lt limit source.stage.actors source.stage.order + source.stage.meetGraph source.stage.action points labels + exact certificate.target_rank_lt_of_components limit (ZFSet.rank_lt_of_mem conditions.2.1) + tasks points actors + (certificate.compression_union_rank_lt pairing unions powers separation collection infinite + hK conditions points labels) + +theorem target_code_rank_lt (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) + (columns : ZFSet.rank C < ZFSet.rank K) (coordinates : ZFSet.rank D < ZFSet.rank K) : + ZFSet.rank certificate.target.stage.code < ZFSet.rank K := by + have target := certificate.target_rank_lt pairing unions powers separation collection infinite + hK conditions points labels actors + exact certificate.target.stage.code_rank_lt + (conditions.rank_isLimit pairing unions powers separation infinite hK) + target.1 target.2 columns coordinates + +theorem target_code_rank_lt_omegaOne (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) + (actualColumns : C = M.groundOmegaOne pairing unions powers separation collection infinite) + (coordinates : ZFSet.rank D < ZFSet.rank K) : + ZFSet.rank certificate.target.stage.code < ZFSet.rank K := by + have columns : ZFSet.rank C < ZFSet.rank K := by + rw [actualColumns] + exact ZFSet.rank_lt_of_mem + (conditions.groundOmegaOne_mem pairing unions powers separation collection infinite hK) + exact certificate.target_code_rank_lt pairing unions powers separation collection infinite + hK conditions points labels actors columns coordinates + +theorem transition_code_rank_lt (actors : ZFSet.rank source.stage.actors < ZFSet.rank K) : + ZFSet.rank certificate.transition.map.code < ZFSet.rank K := by + have target := certificate.target_rank_lt pairing unions powers separation collection infinite + hK conditions points labels actors + exact certificate.transition.map.code_rank_lt + (conditions.rank_isLimit pairing unions powers separation infinite hK) + points target.1 actors target.2 + +end GroundInitialMainSuccessorData + +namespace GroundInitialMainSuccessorData +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (sourceTime : source.cutoff ∈ K) +include certificate pairing unions powers separation infinite hK conditions sourceTime + +theorem compression_limit_mem : certificate.compression.born.births.limit ∈ K := + conditions.compressionStamp_limit_mem pairing unions powers separation infinite hK + certificate.compression.born.births.times sourceTime certificate.compression.born.births.stamps_ground + +theorem external_limit_mem : certificate.births.limit ∈ K := + conditions.compressionStamp_limit_mem pairing unions powers separation infinite hK + certificate.births.times + (certificate.compression_limit_mem pairing unions powers separation infinite hK conditions sourceTime) + certificate.births.stamps_ground + +theorem target_cutoff_mem : certificate.target.cutoff ∈ K := by + rw [certificate.target_cutoff] + exact certificate.external_limit_mem pairing unions powers separation infinite hK conditions sourceTime + +theorem target_time_domain_mem : insert certificate.target.cutoff certificate.target.cutoff ∈ K := + conditions.successor_mem pairing unions powers separation infinite hK + (certificate.target_cutoff_mem pairing unions powers separation infinite hK conditions sourceTime) + +theorem target_birth_rank_lt + (points : ZFSet.rank certificate.target.stage.carrier < ZFSet.rank K) : + ZFSet.rank certificate.target.birth < ZFSet.rank K := + rank_functionGraph_lt (conditions.rank_isLimit pairing unions powers separation infinite hK) + certificate.target.birth_function points + (ZFSet.rank_lt_of_mem + (certificate.target_time_domain_mem pairing unions powers separation infinite hK conditions sourceTime)) + +end GroundInitialMainSuccessorData + +section +universe u + +namespace GroundCompressionBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T base old : ZFSet.{u}} +variable {union : GroundCompressionUnionData M initial I Sources Reps G m one T} + +theorem prior_entry (births : GroundCompressionBirthData M initial I Sources Reps G m one T union base old) + {x t : ZFSet.{u}} (before : t = base ∨ t ∈ base) (entry : ZFSet.pair x t ∈ births.birth) : + x ∈ initial.D ∧ ZFSet.pair x t ∈ old := by + rcases (births.extension.entries x t).1 entry with original | ⟨n, _, _, equal⟩ + · exact ⟨(ZFSet.pair_mem_prod.1 (births.initial_function.1 original)).1, original⟩ + · have absurd := compressionStamp_old_mem before.symm n + rw [← equal] at absurd + exact (ZFSet.mem_irrefl t absurd).elim + +end GroundCompressionBirthData + +namespace GroundExternalBirthData +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m one T τ P0 r0 μ0 A0 base old : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (compressionBirths : GroundCompressionBirthData M initial I Sources Reps G m one T + completion.algebra.union base old) +variable (births : GroundExternalBirthData M initial I Sources Reps G m one T τ + P0 r0 μ0 A0 compressionBirths.limit compressionBirths.birth completion) + +theorem originalFiber_image (initialDomain : initial.D = P0) {y t : ZFSet.{u}} + (before : t = base ∨ t ∈ base) (entry : ZFSet.pair y t ∈ births.birth) : + ∃ x ∈ P0, ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0 := by + have earlier : t ∈ compressionBirths.limit := before.elim + (fun equal => equal.symm ▸ compressionBirths.times.base_mem_limit) + (fun member => compressionBirths.times.ordinal.1 base compressionBirths.times.base_mem_limit t member) + obtain ⟨x, _, copied⟩ := births.priorFiber_image (Or.inl earlier) entry + have original := compressionBirths.prior_entry before ((births.preserves_seed x y t copied).1 entry) + have hx : x ∈ P0 := initialDomain ▸ original.1 + exact ⟨x, hx, (completion.externalOriginalEmbedding_entry_iff P0 r0 μ0 A0 x y).2 ⟨copied, hx⟩⟩ + +theorem boundedOriginalFiber_image (initialDomain : initial.D = P0) {y t : ZFSet.{u}} + (before : t = base ∨ t ∈ base) (entry : ZFSet.pair y t ∈ births.boundedBirth) : + ∃ x ∈ P0, ZFSet.pair x y ∈ completion.externalOriginalEmbedding P0 r0 μ0 A0 := by + have earlier : t ∈ compressionBirths.limit := before.elim + (fun equal => equal.symm ▸ compressionBirths.times.base_mem_limit) + (fun member => compressionBirths.times.ordinal.1 base compressionBirths.times.base_mem_limit t member) + have final : t ∈ births.limit := births.times.ordinal.1 compressionBirths.limit + births.times.base_mem_limit t earlier + exact births.originalFiber_image compressionBirths initialDomain before + ((fixedTopBirth_earlier_iff final).1 entry) + +end GroundExternalBirthData + +namespace GroundInitialMainSuccessorData +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +theorem oldBirthFiberCoverage : OldBirthFiberCoverageCode source.stage.carrier + certificate.transition.map.points certificate.target.birth source.cutoff := by + intro y t entry before + rw [certificate.target_birth] at entry + rw [certificate.point_graph] + exact certificate.births.boundedOriginalFiber_image certificate.compression.born.births rfl before entry + +theorem coversOldBirths : certificate.transition.CoversOldBirths := + certificate.oldBirthFiberCoverage + +end GroundInitialMainSuccessorData +end + +namespace GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +theorem capProfile_preserved + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {c e K F c' e' K' : ZFSet.{u}} + (profile : CodedCapProfile source.stage.carrier source.stage.order source.stage.meetGraph c e K F) + (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) + (imageE : ZFSet.pair e e' ∈ certificate.transition.map.points) + (imageK : ZFSet.pair K K' ∈ certificate.transition.map.points) : + CodedCapProfile certificate.target.stage.carrier certificate.target.stage.order + certificate.target.stage.meetGraph c' e' K' + (relationImage F certificate.target.stage.carrier certificate.transition.map.points) := by + have inherited := certificate.origin.union_input_capProfile + certificate.compression.born.profiled.heighted.completion.algebra.union + pairing unions powers separation certificate.indices_ground certificate.sources_ground + certificate.representatives_ground source.stage.actors_ground certificate.task_action_ground profile + obtain ⟨points, order, meet, _⟩ := certificate.target_fields + rw [points, order, meet, certificate.point_graph] + rw [certificate.point_graph] at imageC imageE imageK + exact certificate.external.inputs.externalBounded_original_capProfile + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground inherited profile.filter_subset imageC imageE imageK + +end GroundInitialMainSuccessorData + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorSeparation.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorSeparation.lean index 990858dd20c0d8d714a75b289a149073a107750a..24185a23b6f4774f9aa362f1c7eba52e46cdcd07 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorSeparation.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundMainSuccessorSeparation.lean @@ -1,111 +1,111 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorProfilePreservation - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -namespace GroundExternalGeometryInputs -variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} -variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} -variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} -variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) -variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) -include data group action pairing unions powers separation infinite hG hP -local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) -local notation "Q" => completion.externalPointCarrier P r μ A -local notation "U" => completion.algebra.union.fields 0 -local notation "e" => completion.externalOriginalEmbedding P r μ A - -theorem externalBounded_separation_actor {W k : ZFSet.{u}} (hW : W ∈ P) - (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 1) W) (natSetCode 0)) k ∈ - M.externalChildGenerators G letters m one) : - SeparationActorCode P r (completion.externalBoundedCarrier P r μ A) - (completion.externalBoundedOrder P r μ A) (completion.externalBoundedMeet P r μ A) - (completion.externalBoundedAction P r μ A) e W k := by - let := group.toGroup - have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP - intro w _ imageW - have hw : w ∈ Q := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP imageW - have copiedW := ((completion.externalOriginalEmbedding_entry_iff P r μ A W w).1 imageW).1 - have eqW := (data.external_identity_copy_value group action pairing unions powers separation infinite hG - (SetMembers.ofMem W (data.original.subset hW)) w).1 (by simpa only [SetMembers.raw_ofMem] using copiedW) - constructor - · intro z _ lower - have hz : z ∈ Q := fixedTopOrder_no_new_below geometry.meet.order hw lower - have oldLower := (fixedTopOrder_old_iff hw).1 lower - rw [eqW] at oldLower - exact (fixedTopAction_old_iff hz).2 (data.separation_generator_fixes group action - pairing unions powers separation infinite hG (SetMembers.ofMem W hW) k - (by simpa only [SetMembers.raw_ofMem] using generator) z hz - (by simpa only [SetMembers.raw_ofMem] using oldLower)) - · intro x hx y hy x' _ y' _ z _ wx wy imageX imageY acted - have hx' : x' ∈ Q := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP imageX - have hy' : y' ∈ Q := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP imageY - have oldAct := (fixedTopAction_old_iff hx').1 acted - have hz : z ∈ Q := (ZFSet.pair_mem_prod.1 (geometry.action.function.1 oldAct)).2 - have eqX := (data.external_identity_copy_value group action pairing unions powers separation infinite hG - (SetMembers.ofMem x (data.original.subset hx)) x').1 - (by simpa only [SetMembers.raw_ofMem] using - ((completion.externalOriginalEmbedding_entry_iff P r μ A x x').1 imageX).1) - have eqY := (data.external_identity_copy_value group action pairing unions powers separation infinite hG - (SetMembers.ofMem y (data.original.subset hy)) y').1 - (by simpa only [SetMembers.raw_ofMem] using - ((completion.externalOriginalEmbedding_entry_iff P r μ A y y').1 imageY).1) - have wx' := (data.original.order W hW x hx).2 wx - have wy' := (data.original.order W hW y hy).2 wy - rw [eqX] at oldAct - have meetEntry := data.separation_generator_meet group action pairing unions powers separation infinite hG - (SetMembers.ofMem W hW) (SetMembers.ofMem x (data.original.subset hx)) - (SetMembers.ofMem y (data.original.subset hy)) - (by simpa only [SetMembers.raw_ofMem] using wx') - (by simpa only [SetMembers.raw_ofMem] using wy') k - (by simpa only [SetMembers.raw_ofMem] using generator) z oldAct - apply (fixedTopMeet_old_iff geometry.meet hz hy').2 - simpa only [SetMembers.raw_ofMem, eqY, eqW] using meetEntry - -theorem externalBounded_separation_fulfillment : - SeparationFulfillmentCode P r (completion.externalBoundedCarrier P r μ A) - (completion.externalBoundedOrder P r μ A) (completion.externalBoundedMeet P r μ A) - (M.externalGroupCarrier G letters m one) (completion.externalBoundedAction P r μ A) e := by - intro W hW - have letter := (separation_child_iff I P (externalRectangles P G r μ A) W (natSetCode 0)).2 ⟨hW, rfl⟩ - obtain ⟨k, entry, _⟩ := data.generators_injection.function.2 _ letter - have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 entry)).2 - exact ⟨k, hk, data.externalBounded_separation_actor group action - pairing unions powers separation infinite hG hP hW entry⟩ - -end GroundExternalGeometryInputs - -namespace GroundInitialMainSuccessorData -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -theorem separation_fulfillment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) : - SeparationFulfillmentCode source.stage.carrier source.stage.order certificate.target.stage.carrier - certificate.target.stage.order certificate.target.stage.meetGraph certificate.target.stage.actors - certificate.target.stage.action certificate.transition.map.points := by - obtain ⟨points, order, meet, actors, _, _, _, action, _⟩ := certificate.target_fields - rw [points, order, meet, actors, action, certificate.point_graph] - exact certificate.external.inputs.externalBounded_separation_fulfillment - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground - -end GroundInitialMainSuccessorData -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainSuccessorProfilePreservation + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +namespace GroundExternalGeometryInputs +variable {M : TransitiveGround.{u}} {initial : RecursiveStateData.{u}} +variable {I Sources Reps G m inv one T τ P r μ A : ZFSet.{u}} +variable {completion : GroundCompressionCompletion M initial I Sources Reps G m one T τ} +variable (data : GroundExternalGeometryInputs M initial I Sources Reps G m inv one T τ P r μ A completion) +variable (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hG : G ∈ M.sets) (hP : P ∈ M.sets) +include data group action pairing unions powers separation infinite hG hP +local notation "letters" => externalChildLetters I P (externalRectangles P G r μ A) +local notation "Q" => completion.externalPointCarrier P r μ A +local notation "U" => completion.algebra.union.fields 0 +local notation "e" => completion.externalOriginalEmbedding P r μ A + +theorem externalBounded_separation_actor {W k : ZFSet.{u}} (hW : W ∈ P) + (generator : ZFSet.pair (ZFSet.pair (ZFSet.pair (natSetCode 1) W) (natSetCode 0)) k ∈ + M.externalChildGenerators G letters m one) : + SeparationActorCode P r (completion.externalBoundedCarrier P r μ A) + (completion.externalBoundedOrder P r μ A) (completion.externalBoundedMeet P r μ A) + (completion.externalBoundedAction P r μ A) e W k := by + let := group.toGroup + have geometry := data.externalGeometryData group action pairing unions powers separation infinite hG hP + intro w _ imageW + have hw : w ∈ Q := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP imageW + have copiedW := ((completion.externalOriginalEmbedding_entry_iff P r μ A W w).1 imageW).1 + have eqW := (data.external_identity_copy_value group action pairing unions powers separation infinite hG + (SetMembers.ofMem W (data.original.subset hW)) w).1 (by simpa only [SetMembers.raw_ofMem] using copiedW) + constructor + · intro z _ lower + have hz : z ∈ Q := fixedTopOrder_no_new_below geometry.meet.order hw lower + have oldLower := (fixedTopOrder_old_iff hw).1 lower + rw [eqW] at oldLower + exact (fixedTopAction_old_iff hz).2 (data.separation_generator_fixes group action + pairing unions powers separation infinite hG (SetMembers.ofMem W hW) k + (by simpa only [SetMembers.raw_ofMem] using generator) z hz + (by simpa only [SetMembers.raw_ofMem] using oldLower)) + · intro x hx y hy x' _ y' _ z _ wx wy imageX imageY acted + have hx' : x' ∈ Q := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP imageX + have hy' : y' ∈ Q := data.externalOriginal_image_mem group action pairing unions powers separation infinite hG hP imageY + have oldAct := (fixedTopAction_old_iff hx').1 acted + have hz : z ∈ Q := (ZFSet.pair_mem_prod.1 (geometry.action.function.1 oldAct)).2 + have eqX := (data.external_identity_copy_value group action pairing unions powers separation infinite hG + (SetMembers.ofMem x (data.original.subset hx)) x').1 + (by simpa only [SetMembers.raw_ofMem] using + ((completion.externalOriginalEmbedding_entry_iff P r μ A x x').1 imageX).1) + have eqY := (data.external_identity_copy_value group action pairing unions powers separation infinite hG + (SetMembers.ofMem y (data.original.subset hy)) y').1 + (by simpa only [SetMembers.raw_ofMem] using + ((completion.externalOriginalEmbedding_entry_iff P r μ A y y').1 imageY).1) + have wx' := (data.original.order W hW x hx).2 wx + have wy' := (data.original.order W hW y hy).2 wy + rw [eqX] at oldAct + have meetEntry := data.separation_generator_meet group action pairing unions powers separation infinite hG + (SetMembers.ofMem W hW) (SetMembers.ofMem x (data.original.subset hx)) + (SetMembers.ofMem y (data.original.subset hy)) + (by simpa only [SetMembers.raw_ofMem] using wx') + (by simpa only [SetMembers.raw_ofMem] using wy') k + (by simpa only [SetMembers.raw_ofMem] using generator) z oldAct + apply (fixedTopMeet_old_iff geometry.meet hz hy').2 + simpa only [SetMembers.raw_ofMem, eqY, eqW] using meetEntry + +theorem externalBounded_separation_fulfillment : + SeparationFulfillmentCode P r (completion.externalBoundedCarrier P r μ A) + (completion.externalBoundedOrder P r μ A) (completion.externalBoundedMeet P r μ A) + (M.externalGroupCarrier G letters m one) (completion.externalBoundedAction P r μ A) e := by + intro W hW + have letter := (separation_child_iff I P (externalRectangles P G r μ A) W (natSetCode 0)).2 ⟨hW, rfl⟩ + obtain ⟨k, entry, _⟩ := data.generators_injection.function.2 _ letter + have hk := (ZFSet.pair_mem_prod.1 (data.generators_injection.function.1 entry)).2 + exact ⟨k, hk, data.externalBounded_separation_actor group action + pairing unions powers separation infinite hG hP hW entry⟩ + +end GroundExternalGeometryInputs + +namespace GroundInitialMainSuccessorData +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +theorem separation_fulfillment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) : + SeparationFulfillmentCode source.stage.carrier source.stage.order certificate.target.stage.carrier + certificate.target.stage.order certificate.target.stage.meetGraph certificate.target.stage.actors + certificate.target.stage.action certificate.transition.map.points := by + obtain ⟨points, order, meet, actors, _, _, _, action, _⟩ := certificate.target_fields + rw [points, order, meet, actors, action, certificate.point_graph] + exact certificate.external.inputs.externalBounded_separation_fulfillment + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground + +end GroundInitialMainSuccessorData +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundNaturalRecursion.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundNaturalRecursion.lean index a3d9f0fa5e7628d22360dafcbe3c572199ed759a..61f74a824b27372fc34d1690c4d75bce6b0c3eb9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundNaturalRecursion.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundNaturalRecursion.lean @@ -1,136 +1,136 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.FiniteIterationTraces - -namespace OAI - -section - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def iterationTraceFormula {k} (n d b step base t zero : Fin k) : BoundedFormula k := - .conj (functionFormula d b t) (.conj (pairMembershipFormula zero base t) - (.allMem n (.allMem d.succ (.allMem b.succ.succ (.allMem b.succ.succ.succ - (imp (.conj (successorFormula 2 3) (.conj (pairMembershipFormula 3 1 t.succ.succ.succ.succ) - (pairMembershipFormula 2 0 t.succ.succ.succ.succ))) - (pairMembershipFormula 1 0 step.succ.succ.succ.succ))))))) - -theorem truth_iterationTraceFormula {k} (n d b step base t zero : Fin k) - (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : - Truth (iterationTraceFormula n d b step base t zero) env ↔ - IterationTraceCode (env n) (env d) (env b) (env step) (env base) (env t) := by - simp only [iterationTraceFormula, Truth, truth_functionFormula, truth_pairMembershipFormula, - truth_imp, truth_successorFormula] - change (ZFSet.IsFunc (env d) (env b) (env t) ∧ ZFSet.pair (env zero) (env base) ∈ env t ∧ - ∀ i ∈ env n, ∀ j ∈ env d, ∀ x ∈ env b, ∀ y ∈ env b, - (j = insert i i ∧ ZFSet.pair i x ∈ env t ∧ ZFSet.pair j y ∈ env t) → - ZFSet.pair x y ∈ env step) ↔ _ - rw [hzero] - exact ⟨fun ⟨func, seed, next⟩ => ⟨func, seed, - fun i hi j hj x hx y hy succ prev after => next i hi j hj x hx y hy ⟨succ, prev, after⟩⟩, - fun trace => ⟨trace.function, trace.seed, - fun i hi j hj x hx y hy h => trace.next i hi j hj x hx y hy h.1 h.2.1 h.2.2⟩⟩ - -def iterationEntryFormula {k} (z w b step base traces zero : Fin k) : BoundedFormula k := - exMem w (exMem b.succ (exMem w.succ.succ (exMem traces.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ 3 2) - (.conj (successorFormula 1 3) - (.conj (iterationTraceFormula 3 1 b.succ.succ.succ.succ step.succ.succ.succ.succ - base.succ.succ.succ.succ 0 zero.succ.succ.succ.succ) - (pairMembershipFormula 3 2 0))))))) - -theorem truth_iterationEntryFormula {k} (z w b step base traces zero : Fin k) - (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : - Truth (iterationEntryFormula z w b step base traces zero) env ↔ - ∃ n ∈ env w, ∃ y ∈ env b, ∃ d ∈ env w, ∃ t ∈ env traces, - env z = ZFSet.pair n y ∧ d = insert n n ∧ - IterationTraceCode n d (env b) (env step) (env base) t ∧ ZFSet.pair n y ∈ t := by - simp only [iterationEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_successorFormula, truth_pairMembershipFormula] - apply exists_congr - intro n - apply and_congr_right - intro _ - apply exists_congr - intro y - apply and_congr_right - intro _ - apply exists_congr - intro d - apply and_congr_right - intro _ - apply exists_congr - intro t - apply and_congr_right - intro _ - exact and_congr Iff.rfl (and_congr Iff.rfl (and_congr - (truth_iterationTraceFormula _ _ _ _ _ _ _ _ (by exact hzero)) Iff.rfl)) - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula SetRealization -universe u - -theorem natural_recursion_graph_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - {B : Type u} (s : Presentation B) (f : B → B) (b : B) - (hB : s.carrier ∈ M.sets) (hf : s.graph s f ∈ M.sets) : - natPresentation.graph s (fun n => natIterate f b n.down) ∈ M.sets := by - have hw := M.omega_mem separation infinite - have hb := M.transitive hB (s.encode_mem b) - have hzero := M.empty_mem ⟨s.carrier, hB⟩ - let P := ZFSet.prod ZFSet.omega s.carrier - have hP := M.prod_mem pairing unions powers separation hw hB - let T := M.groundPower P - have hT := M.groundPower_mem powers hP - let params := extend ZFSet.omega (extend s.carrier (extend (s.graph s f) - (extend (s.encode b) (extend T (extend ∅ Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) params - (Fin.cases hw (Fin.cases hB (Fin.cases hf (Fin.cases hb (Fin.cases hT - (Fin.cases hzero (fun i => Fin.elim0 i))))))) hP - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) (extend z params)) P = - natPresentation.graph s (fun n => natIterate f b n.down) := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_iterationEntryFormula _ _ _ _ _ _ _ _ rfl] - change (z ∈ P ∧ ∃ n ∈ ZFSet.omega, ∃ y ∈ s.carrier, ∃ d ∈ ZFSet.omega, ∃ t ∈ T, - z = ZFSet.pair n y ∧ d = insert n n ∧ - IterationTraceCode n d s.carrier (s.graph s f) (s.encode b) t ∧ ZFSet.pair n y ∈ t) ↔ _ - constructor - · rintro ⟨_, n, hn, y, _, d, _, t, _, eq, succ, trace, out⟩ - obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - have dcode : d = natSetCode (k + 1) := succ - have value := (dcode ▸ trace).output s f b out - rw [eq, value] - exact (natPresentation.pair_mem_graph s (fun n => natIterate f b n.down) ⟨k⟩ _).2 rfl - · intro hz - have shape := (natPresentation.graph_isFunc s (fun n => natIterate f b n.down)).1 hz - obtain ⟨k, eq⟩ := (natPresentation.mem_graph s (fun n => natIterate f b n.down) z).1 hz - let t := finiteIterationTrace s f b k.down - have ht := M.finiteIterationTrace_mem pairing unions separation infinite s f b k.down hB - have code := finiteIterationTrace_code s f b k.down - have bound : t ⊆ P := by - intro a ha - obtain ⟨i, hi, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 ha) - obtain ⟨m, _, rfl⟩ := (mem_natSetCode i (k.down + 1)).1 hi - exact ZFSet.pair_mem_prod.2 ⟨(mem_omega_iff_natSetCode _).2 ⟨m, rfl⟩, hy⟩ - exact ⟨shape, natSetCode k.down, natPresentation.encode_mem k, - s.encode (natIterate f b k.down), s.encode_mem _, natSetCode (k.down + 1), - (mem_omega_iff_natSetCode _).2 ⟨k.down + 1, rfl⟩, t, - (M.mem_groundPower P t).2 ⟨ht, bound⟩, eq.symm, rfl, code, - code.value s f b k.down (Nat.le_refl _)⟩ - exact eq ▸ selected - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.FiniteIterationTraces + +namespace OAI + +section + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def iterationTraceFormula {k} (n d b step base t zero : Fin k) : BoundedFormula k := + .conj (functionFormula d b t) (.conj (pairMembershipFormula zero base t) + (.allMem n (.allMem d.succ (.allMem b.succ.succ (.allMem b.succ.succ.succ + (imp (.conj (successorFormula 2 3) (.conj (pairMembershipFormula 3 1 t.succ.succ.succ.succ) + (pairMembershipFormula 2 0 t.succ.succ.succ.succ))) + (pairMembershipFormula 1 0 step.succ.succ.succ.succ))))))) + +theorem truth_iterationTraceFormula {k} (n d b step base t zero : Fin k) + (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : + Truth (iterationTraceFormula n d b step base t zero) env ↔ + IterationTraceCode (env n) (env d) (env b) (env step) (env base) (env t) := by + simp only [iterationTraceFormula, Truth, truth_functionFormula, truth_pairMembershipFormula, + truth_imp, truth_successorFormula] + change (ZFSet.IsFunc (env d) (env b) (env t) ∧ ZFSet.pair (env zero) (env base) ∈ env t ∧ + ∀ i ∈ env n, ∀ j ∈ env d, ∀ x ∈ env b, ∀ y ∈ env b, + (j = insert i i ∧ ZFSet.pair i x ∈ env t ∧ ZFSet.pair j y ∈ env t) → + ZFSet.pair x y ∈ env step) ↔ _ + rw [hzero] + exact ⟨fun ⟨func, seed, next⟩ => ⟨func, seed, + fun i hi j hj x hx y hy succ prev after => next i hi j hj x hx y hy ⟨succ, prev, after⟩⟩, + fun trace => ⟨trace.function, trace.seed, + fun i hi j hj x hx y hy h => trace.next i hi j hj x hx y hy h.1 h.2.1 h.2.2⟩⟩ + +def iterationEntryFormula {k} (z w b step base traces zero : Fin k) : BoundedFormula k := + exMem w (exMem b.succ (exMem w.succ.succ (exMem traces.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ 3 2) + (.conj (successorFormula 1 3) + (.conj (iterationTraceFormula 3 1 b.succ.succ.succ.succ step.succ.succ.succ.succ + base.succ.succ.succ.succ 0 zero.succ.succ.succ.succ) + (pairMembershipFormula 3 2 0))))))) + +theorem truth_iterationEntryFormula {k} (z w b step base traces zero : Fin k) + (env : Fin k → ZFSet.{u}) (hzero : env zero = ∅) : + Truth (iterationEntryFormula z w b step base traces zero) env ↔ + ∃ n ∈ env w, ∃ y ∈ env b, ∃ d ∈ env w, ∃ t ∈ env traces, + env z = ZFSet.pair n y ∧ d = insert n n ∧ + IterationTraceCode n d (env b) (env step) (env base) t ∧ ZFSet.pair n y ∈ t := by + simp only [iterationEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_successorFormula, truth_pairMembershipFormula] + apply exists_congr + intro n + apply and_congr_right + intro _ + apply exists_congr + intro y + apply and_congr_right + intro _ + apply exists_congr + intro d + apply and_congr_right + intro _ + apply exists_congr + intro t + apply and_congr_right + intro _ + exact and_congr Iff.rfl (and_congr Iff.rfl (and_congr + (truth_iterationTraceFormula _ _ _ _ _ _ _ _ (by exact hzero)) Iff.rfl)) + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula SetRealization +universe u + +theorem natural_recursion_graph_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + {B : Type u} (s : Presentation B) (f : B → B) (b : B) + (hB : s.carrier ∈ M.sets) (hf : s.graph s f ∈ M.sets) : + natPresentation.graph s (fun n => natIterate f b n.down) ∈ M.sets := by + have hw := M.omega_mem separation infinite + have hb := M.transitive hB (s.encode_mem b) + have hzero := M.empty_mem ⟨s.carrier, hB⟩ + let P := ZFSet.prod ZFSet.omega s.carrier + have hP := M.prod_mem pairing unions powers separation hw hB + let T := M.groundPower P + have hT := M.groundPower_mem powers hP + let params := extend ZFSet.omega (extend s.carrier (extend (s.graph s f) + (extend (s.encode b) (extend T (extend ∅ Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) params + (Fin.cases hw (Fin.cases hB (Fin.cases hf (Fin.cases hb (Fin.cases hT + (Fin.cases hzero (fun i => Fin.elim0 i))))))) hP + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.iterationEntryFormula 0 1 2 3 4 5 6) (extend z params)) P = + natPresentation.graph s (fun n => natIterate f b n.down) := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_iterationEntryFormula _ _ _ _ _ _ _ _ rfl] + change (z ∈ P ∧ ∃ n ∈ ZFSet.omega, ∃ y ∈ s.carrier, ∃ d ∈ ZFSet.omega, ∃ t ∈ T, + z = ZFSet.pair n y ∧ d = insert n n ∧ + IterationTraceCode n d s.carrier (s.graph s f) (s.encode b) t ∧ ZFSet.pair n y ∈ t) ↔ _ + constructor + · rintro ⟨_, n, hn, y, _, d, _, t, _, eq, succ, trace, out⟩ + obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + have dcode : d = natSetCode (k + 1) := succ + have value := (dcode ▸ trace).output s f b out + rw [eq, value] + exact (natPresentation.pair_mem_graph s (fun n => natIterate f b n.down) ⟨k⟩ _).2 rfl + · intro hz + have shape := (natPresentation.graph_isFunc s (fun n => natIterate f b n.down)).1 hz + obtain ⟨k, eq⟩ := (natPresentation.mem_graph s (fun n => natIterate f b n.down) z).1 hz + let t := finiteIterationTrace s f b k.down + have ht := M.finiteIterationTrace_mem pairing unions separation infinite s f b k.down hB + have code := finiteIterationTrace_code s f b k.down + have bound : t ⊆ P := by + intro a ha + obtain ⟨i, hi, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 ha) + obtain ⟨m, _, rfl⟩ := (mem_natSetCode i (k.down + 1)).1 hi + exact ZFSet.pair_mem_prod.2 ⟨(mem_omega_iff_natSetCode _).2 ⟨m, rfl⟩, hy⟩ + exact ⟨shape, natSetCode k.down, natPresentation.encode_mem k, + s.encode (natIterate f b k.down), s.encode_mem _, natSetCode (k.down + 1), + (mem_omega_iff_natSetCode _).2 ⟨k.down + 1, rfl⟩, t, + (M.mem_groundPower P t).2 ⟨ht, bound⟩, eq.symm, rfl, code, + code.value s f b k.down (Nat.le_refl _)⟩ + exact eq ▸ selected + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOmegaOneTaskBearingSuccessorFunction.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOmegaOneTaskBearingSuccessorFunction.lean index b412525b05919f64f89be536f18d7f2ca6e2d70d..d7f2ab92eb2b2f477e3de7556c7d225b6afd0003 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOmegaOneTaskBearingSuccessorFunction.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOmegaOneTaskBearingSuccessorFunction.lean @@ -1,386 +1,386 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRankedBoundedSerialization -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundTaskBearingSuccessorWitness -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRankedCompressionSerialization -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRankedExternalSerialization -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageLevels - -namespace OAI - - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (invariant : source.Invariant K Labels) (level : GroundMainCandidateLevel M K) -local notation "births" => certificate.births -include pairing unions powers separation collection infinite choice hK conditions invariant - -theorem exists_rankedTargetSerialization - (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) - (priorRank : ZFSet.rank prior.code < ZFSet.rank K) - (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → - prior.fields.value j s = source.history.fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert certificate.target.cutoff certificate.target.cutoff) C D rD, - serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ - serial.code ∈ level.validChronologies C D rD ∧ - (∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → - serial.fields.value j s = certificate.target.history.fieldValue j s) ∧ - serial.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ - serial.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ - serial.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ - serial.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ - serial.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by - obtain ⟨compressionSerial, _, compressionRank, _, compressionValues, _⟩ := certificate.exists_rankedCompressionSerialization - pairing unions powers separation collection infinite choice hK conditions invariant level prior priorRank agreement - obtain ⟨externalSerial, _, externalRank, _, externalValues, _⟩ := certificate.exists_rankedExternalSerialization - pairing unions powers separation collection infinite choice hK conditions invariant level - prior priorRank agreement compressionSerial compressionRank compressionValues - obtain ⟨bounded, _, boundedRank, _, values⟩ := certificate.exists_rankedBoundedSerialization - pairing unions powers separation collection infinite choice hK conditions invariant level - externalSerial externalRank externalValues - have times : insert (births).limit (births).limit = insert certificate.target.cutoff certificate.target.cutoff := - congrArg (fun t : ZFSet.{u} => insert t t) certificate.target_cutoff.symm - let serial := bounded.castTime times - have serialValues : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → - serial.fields.value j s = certificate.target.history.fieldValue j s := by - intro j s hs - rw [GroundSerializedChronology.castTime_value] - have old := values j s (times.symm ▸ hs) - have same := GroundChronologicalHistory.fieldValue_eq_of_heq times.symm certificate.target_history j s - exact old.trans same.symm - have rank : ZFSet.rank serial.code < ZFSet.rank K := by - rw [GroundSerializedChronology.castTime_code] - exact boundedRank - refine ⟨serial, serial.code_ground pairing, rank, - level.ranked_mem_validChronologies pairing serial rank, serialValues, ?_, ?_, ?_, ?_, ?_⟩ - · exact (serialValues 0 _ (ZFSet.mem_insert _ _)).trans certificate.target.carrier_eq - · exact (serialValues 1 _ (ZFSet.mem_insert _ _)).trans certificate.target.order_eq - · exact (serialValues 2 _ (ZFSet.mem_insert _ _)).trans certificate.target.meet_eq - · exact serialValues 3 _ (ZFSet.mem_insert _ _) - · exact (serialValues 4 _ (ZFSet.mem_insert _ _)).trans certificate.target.height_eq - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula - -def taskBearingSuccessorPairFormula {n} - (K Labels C D rD N S V source output : Fin n) : SetFormula n := - .ex (.conj (.mem 0 S.succ) (.ex (.conj (.mem 0 V.succ.succ) - (.conj (BoundedFormula.orderedPairFormula output.succ.succ 1 0).toFormula - (taskBearingMainSuccessorFormula K.succ.succ Labels.succ.succ C.succ.succ - D.succ.succ rD.succ.succ N.succ.succ source.succ.succ 1 0))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_taskBearingSuccessorPairFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} - (K Labels C D rD N S V source output : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) (omega : env N = ZFSet.omega) - (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (taskBearingSuccessorPairFormula K Labels C D rD N S V source output) env ↔ - ∃ target ∈ env S, ∃ z ∈ env V, env output = ZFSet.pair target z ∧ - TaskBearingMainSuccessorCode M (env K) (env Labels) (env C) (env D) (env rD) - (env N) (env source) target z := by - simp only [taskBearingSuccessorPairFormula, realize_ex, Realize] - have recognized (target z : ZFSet.{u}) (ht : target ∈ M.sets) (hz : z ∈ M.sets) := - M.realize_taskBearingMainSuccessorFormula pairing unions powers separation collection - K.succ.succ Labels.succ.succ C.succ.succ D.succ.succ rD.succ.succ N.succ.succ - source.succ.succ 1 0 (extend z (extend target env)) (Fin.cases hz (Fin.cases ht members)) omega ordinal - have pair (target z : ZFSet.{u}) (ht : target ∈ M.sets) (hz : z ∈ M.sets) := - (BoundedFormula.realize_toFormula M - (BoundedFormula.orderedPairFormula output.succ.succ 1 0) - (extend z (extend target env)) (Fin.cases hz (Fin.cases ht members))).trans - (BoundedFormula.truth_orderedPairFormula output.succ.succ 1 0 (extend z (extend target env))) - constructor - · rintro ⟨target, ht, inS, z, hz, inV, shape, code⟩ - exact ⟨target, inS, z, inV, (pair target z ht hz).1 shape, (recognized target z ht hz).1 code⟩ - · rintro ⟨target, inS, z, inV, shape, code⟩ - have ht := M.transitive (members S) inS - have hz := M.transitive (members V) inV - exact ⟨target, ht, inS, z, hz, inV, (pair target z ht hz).2 shape, (recognized target z ht hz).2 code⟩ - -def taskBearingSuccessorParams (S V K Labels C D rD : ZFSet.{u}) : Fin 8 → ZFSet.{u} := - extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega - (extend S (extend V Fin.elim0))))))) - -theorem taskBearingSuccessorParams_ground - (separation : SeparationSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) - (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - ∀ j, taskBearingSuccessorParams S V K Labels C D rD j ∈ M.sets := - Fin.cases hK (Fin.cases hLabels (Fin.cases hC (Fin.cases hD (Fin.cases hrD - (Fin.cases (M.omega_mem separation infinite) (Fin.cases hS (Fin.cases hV (fun j => Fin.elim0 j)))))))) - -noncomputable def taskBearingSuccessorRelation (S V K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := - M.definableRelation (taskBearingSuccessorPairFormula 2 3 4 5 6 7 8 9 (0 : Fin 10) 1) - (taskBearingSuccessorParams S V K Labels C D rD) S (ZFSet.prod V V) - -theorem taskBearingSuccessorRelation_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) - (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : - M.taskBearingSuccessorRelation S V K Labels C D rD ∈ M.sets := - M.definableRelation_mem pairing unions powers separation _ _ - (M.taskBearingSuccessorParams_ground separation infinite hS hV hK hLabels hC hD hrD) - hS (M.prod_mem pairing unions powers separation hV hV) - -theorem taskBearingSuccessorRelation_entry - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) - (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (ordinal : ordinalSetProperty K) - (subset : S ⊆ V) (source target z : ZFSet.{u}) : - ZFSet.pair source (ZFSet.pair target z) ∈ M.taskBearingSuccessorRelation S V K Labels C D rD ↔ - source ∈ S ∧ target ∈ S ∧ z ∈ V ∧ - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z := by - rw [taskBearingSuccessorRelation, M.pair_mem_definableRelation] - have params := M.taskBearingSuccessorParams_ground separation infinite hS hV hK hLabels hC hD hrD - have hVV := M.prod_mem pairing unions powers separation hV hV - have recognized (hs : source ∈ S) (hp : ZFSet.pair target z ∈ ZFSet.prod V V) := - M.realize_taskBearingSuccessorPairFormula pairing unions powers separation collection - 2 3 4 5 6 7 8 9 0 1 - (extend source (extend (ZFSet.pair target z) (taskBearingSuccessorParams S V K Labels C D rD))) - (Fin.cases (M.transitive hS hs) (Fin.cases (M.transitive hVV hp) params)) rfl ordinal - constructor - · rintro ⟨hs, hp, relation⟩ - obtain ⟨t, ht, w, hw, equal, code⟩ := (recognized hs hp).1 relation - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨hs, ht, hw, code⟩ - · rintro ⟨hs, ht, hz, code⟩ - have hp := ZFSet.pair_mem_prod.2 ⟨subset ht, hz⟩ - exact ⟨hs, hp, (recognized hs hp).2 ⟨target, ht, z, hz, rfl, code⟩⟩ - -theorem choose_taskBearingSuccessors - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) - (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (ordinal : ordinalSetProperty K) (subset : S ⊆ V) - (total : ∀ source ∈ S, ∃ target ∈ S, ∃ z ∈ V, - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) : - ∃ f ∈ M.sets, ZFSet.IsFunc S (ZFSet.prod V V) f ∧ - f ⊆ M.taskBearingSuccessorRelation S V K Labels C D rD ∧ - ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - target ∈ S ∧ z ∈ V ∧ - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z := by - have entries := M.taskBearingSuccessorRelation_entry pairing unions powers separation collection infinite - hS hV hK hLabels hC hD hrD ordinal subset - obtain ⟨f, hf, function, included⟩ := M.uniformize_relation pairing unions powers separation choice - hS (M.prod_mem pairing unions powers separation hV hV) - (M.taskBearingSuccessorRelation_ground pairing unions powers separation infinite hS hV hK hLabels hC hD hrD) - (by - intro source hs - obtain ⟨target, ht, z, hz, code⟩ := total source hs - exact ⟨ZFSet.pair target z, ZFSet.pair_mem_prod.2 ⟨subset ht, hz⟩, - (entries source target z).2 ⟨hs, ht, hz, code⟩⟩) - exact ⟨f, hf, function, included, fun source target z entry => - ((entries source target z).1 (included entry)).2⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialMainSeedSuccessorRanked - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : - let C := M.groundOmegaOne pairing unions powers separation collection infinite - ∃ level : GroundMainCandidateLevel M K, - ∃ seed : GroundInitialMainSeedData M K C, - ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) seed.source C, - ∃ initial : GroundSerializedChronology M (insert seed.source.cutoff seed.source.cutoff) - C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), - ∃ successor : GroundSerializedChronology M - (insert certificate.target.cutoff certificate.target.cutoff) - C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), - level.validChronologies C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ - initial.code ∈ M.sets ∧ ZFSet.rank initial.code < ZFSet.rank K ∧ - initial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - (∀ j t, t ∈ insert seed.source.cutoff seed.source.cutoff → - initial.fields.value j t = seed.source.history.fieldValue j t) ∧ - successor.code ∈ M.sets ∧ ZFSet.rank successor.code < ZFSet.rank K ∧ - successor.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) - (rationalLtGraph seed.fractionCode) ∧ - (∀ j t, t ∈ insert certificate.target.cutoff certificate.target.cutoff → - successor.fields.value j t = certificate.target.history.fieldValue j t) ∧ - certificate.target.Invariant K C ∧ - ZFSet.rank certificate.transition.map.code < ZFSet.rank K ∧ - successor.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ - successor.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ - successor.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ - successor.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ - successor.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by - dsimp only - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨level⟩ := M.exists_groundMainCandidateLevel pairing unions powers separation collection hK conditions.1 - obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite collection hK conditions - obtain ⟨initial, initialGround, initialRank, initialAgreement⟩ := - seed.exists_matchedInitialSerialization pairing unions powers separation infinite hK conditions - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation - collection infinite choice seed.source hC seed.injection_ground seed.dense - (fun lo hlo => (seed.no_endpoints lo hlo).2) seed.injection_code - obtain ⟨successor, successorGround, successorRank, successorMember, successorAgreement, terminal⟩ := - certificate.exists_rankedTargetSerialization pairing unions powers separation collection infinite choice - hK conditions seed.invariant level initial initialRank initialAgreement - have invariant := certificate.target_invariant pairing unions powers separation collection infinite - choice hC hK standard seed.invariant - have transitionRank := certificate.transition.map.code_rank_lt_inaccessible pairing unions powers separation infinite - hK conditions seed.invariant.points_rank invariant.points_rank seed.invariant.actors_rank invariant.actors_rank - exact ⟨level, seed, certificate, initial, successor, - level.validChronologies_ground pairing unions powers separation infinite seed.source.stage.columns_ground - seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, - initialGround, initialRank, level.ranked_mem_validChronologies pairing initial initialRank, initialAgreement, - successorGround, successorRank, successorMember, successorAgreement, invariant, transitionRank, terminal⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite - -include choice in -theorem exists_rankedTaskBearingSuccessor {K Labels D rD c : ZFSet.{u}} - (source : GroundLinkedMainStage M K Labels C D rD) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (hLabels : Labels ∈ M.sets) (hc : c ∈ M.sets) - (dense : DenseOrderCode D rD) (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) (level : GroundMainCandidateLevel M K) : - ∃ certificate : GroundInitialMainSuccessorData M C D rD source.main Labels, - ∃ target : GroundLinkedMainStage M K Labels C D rD, - target.main = certificate.target ∧ - target.code ∈ M.linkedMainStageCandidates level.carrier K Labels C D rD ∧ - certificate.transition.map.code ∈ level.carrier ∧ - TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code certificate.transition.map.code := by - obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation - collection infinite choice source.main hLabels hc dense above coordinateInjection - have conditions := standard.to_conditions pairing unions powers separation hK - obtain ⟨serial, _, serialRank, _, agreement, _⟩ := - certificate.exists_rankedTargetSerialization pairing unions powers separation collection infinite choice - hK conditions source.invariant level source.serial source.serial_rank source.agreement - have invariant := certificate.target_invariant pairing unions powers separation collection infinite choice - hLabels hK standard source.invariant - obtain ⟨target, same, code⟩ := certificate.exists_taskBearingLinkedTarget - pairing unions powers separation infinite hLabels serial agreement invariant serialRank - have targetBound : target.code ∈ level.carrier := (level.membership _).2 - ⟨target.code_ground pairing, target.code_rank_lt pairing unions powers separation infinite hK conditions⟩ - have transitionBound : certificate.transition.map.code ∈ level.carrier := (level.membership _).2 - ⟨certificate.transition.map.code_mem pairing, - certificate.transition_code_rank_lt pairing unions powers separation collection infinite - hK conditions source.invariant.points_rank source.invariant.labels_rank source.invariant.actors_rank⟩ - exact ⟨certificate, target, same, - (M.mem_linkedMainStageCandidates level.carrier K Labels C D rD target.code).2 - ⟨targetBound, target, rfl⟩, transitionBound, code⟩ - -include choice in -theorem omegaOne_taskBearingSuccessor_total {K D rD c : ZFSet.{u}} - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) (hc : c ∈ M.sets) - (dense : DenseOrderCode D rD) (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) (level : GroundMainCandidateLevel M K) - {s : ZFSet.{u}} (hs : s ∈ M.linkedMainStageCandidates level.carrier K C C D rD) : - ∃ t ∈ M.linkedMainStageCandidates level.carrier K C C D rD, ∃ z ∈ level.carrier, - TaskBearingMainSuccessorCode M K C C D rD ZFSet.omega s t z := by - obtain ⟨_, source, sourceEq⟩ := (M.mem_linkedMainStageCandidates level.carrier K C C D rD s).1 hs - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - obtain ⟨certificate, target, _, targetMember, mapMember, code⟩ := - M.exists_rankedTaskBearingSuccessor pairing unions powers separation collection infinite choice - source hK standard hC hc dense above coordinateInjection level - exact ⟨target.code, targetMember, certificate.transition.map.code, mapMember, sourceEq ▸ code⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite - -include choice in -theorem exists_groundOmegaOneTaskBearingSuccessorFunction {K D rD c : ZFSet.{u}} - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) - (dense : DenseOrderCode D rD) (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) - (coordinateInjection : InjectionCode D ZFSet.omega c) (level : GroundMainCandidateLevel M K) : - ∃ f ∈ M.sets, - ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K C C D rD) - (ZFSet.prod level.carrier level.carrier) f ∧ - f ⊆ M.taskBearingSuccessorRelation - (M.linkedMainStageCandidates level.carrier K C C D rD) level.carrier K C C D rD ∧ - ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → - target ∈ M.linkedMainStageCandidates level.carrier K C C D rD ∧ z ∈ level.carrier ∧ - TaskBearingMainSuccessorCode M K C C D rD ZFSet.omega source target z := by - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - have hS := M.linkedMainStageCandidates_mem pairing unions powers separation collection infinite - level.carrier_ground hK hC hC hD hrD standard.1.1 - apply M.choose_taskBearingSuccessors pairing unions powers separation collection infinite choice - hS level.carrier_ground hK hC hC hD hrD standard.1.1 - · intro s hs - exact ((M.mem_linkedMainStageCandidates level.carrier K C C D rD s).1 hs).1 - · intro s hs - exact M.omegaOne_taskBearingSuccessor_total pairing unions powers separation collection infinite choice - hK standard hc dense above coordinateInjection level hs - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRankedBoundedSerialization +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundTaskBearingSuccessorWitness +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRankedCompressionSerialization +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRankedExternalSerialization +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageLevels + +namespace OAI + + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels K : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (invariant : source.Invariant K Labels) (level : GroundMainCandidateLevel M K) +local notation "births" => certificate.births +include pairing unions powers separation collection infinite choice hK conditions invariant + +theorem exists_rankedTargetSerialization + (prior : GroundSerializedChronology M (insert source.cutoff source.cutoff) C D rD) + (priorRank : ZFSet.rank prior.code < ZFSet.rank K) + (agreement : ∀ j s, s ∈ insert source.cutoff source.cutoff → + prior.fields.value j s = source.history.fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert certificate.target.cutoff certificate.target.cutoff) C D rD, + serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ + serial.code ∈ level.validChronologies C D rD ∧ + (∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → + serial.fields.value j s = certificate.target.history.fieldValue j s) ∧ + serial.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ + serial.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ + serial.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ + serial.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ + serial.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by + obtain ⟨compressionSerial, _, compressionRank, _, compressionValues, _⟩ := certificate.exists_rankedCompressionSerialization + pairing unions powers separation collection infinite choice hK conditions invariant level prior priorRank agreement + obtain ⟨externalSerial, _, externalRank, _, externalValues, _⟩ := certificate.exists_rankedExternalSerialization + pairing unions powers separation collection infinite choice hK conditions invariant level + prior priorRank agreement compressionSerial compressionRank compressionValues + obtain ⟨bounded, _, boundedRank, _, values⟩ := certificate.exists_rankedBoundedSerialization + pairing unions powers separation collection infinite choice hK conditions invariant level + externalSerial externalRank externalValues + have times : insert (births).limit (births).limit = insert certificate.target.cutoff certificate.target.cutoff := + congrArg (fun t : ZFSet.{u} => insert t t) certificate.target_cutoff.symm + let serial := bounded.castTime times + have serialValues : ∀ j s, s ∈ insert certificate.target.cutoff certificate.target.cutoff → + serial.fields.value j s = certificate.target.history.fieldValue j s := by + intro j s hs + rw [GroundSerializedChronology.castTime_value] + have old := values j s (times.symm ▸ hs) + have same := GroundChronologicalHistory.fieldValue_eq_of_heq times.symm certificate.target_history j s + exact old.trans same.symm + have rank : ZFSet.rank serial.code < ZFSet.rank K := by + rw [GroundSerializedChronology.castTime_code] + exact boundedRank + refine ⟨serial, serial.code_ground pairing, rank, + level.ranked_mem_validChronologies pairing serial rank, serialValues, ?_, ?_, ?_, ?_, ?_⟩ + · exact (serialValues 0 _ (ZFSet.mem_insert _ _)).trans certificate.target.carrier_eq + · exact (serialValues 1 _ (ZFSet.mem_insert _ _)).trans certificate.target.order_eq + · exact (serialValues 2 _ (ZFSet.mem_insert _ _)).trans certificate.target.meet_eq + · exact serialValues 3 _ (ZFSet.mem_insert _ _) + · exact (serialValues 4 _ (ZFSet.mem_insert _ _)).trans certificate.target.height_eq + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula + +def taskBearingSuccessorPairFormula {n} + (K Labels C D rD N S V source output : Fin n) : SetFormula n := + .ex (.conj (.mem 0 S.succ) (.ex (.conj (.mem 0 V.succ.succ) + (.conj (BoundedFormula.orderedPairFormula output.succ.succ 1 0).toFormula + (taskBearingMainSuccessorFormula K.succ.succ Labels.succ.succ C.succ.succ + D.succ.succ rD.succ.succ N.succ.succ source.succ.succ 1 0))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_taskBearingSuccessorPairFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} + (K Labels C D rD N S V source output : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) (omega : env N = ZFSet.omega) + (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (taskBearingSuccessorPairFormula K Labels C D rD N S V source output) env ↔ + ∃ target ∈ env S, ∃ z ∈ env V, env output = ZFSet.pair target z ∧ + TaskBearingMainSuccessorCode M (env K) (env Labels) (env C) (env D) (env rD) + (env N) (env source) target z := by + simp only [taskBearingSuccessorPairFormula, realize_ex, Realize] + have recognized (target z : ZFSet.{u}) (ht : target ∈ M.sets) (hz : z ∈ M.sets) := + M.realize_taskBearingMainSuccessorFormula pairing unions powers separation collection + K.succ.succ Labels.succ.succ C.succ.succ D.succ.succ rD.succ.succ N.succ.succ + source.succ.succ 1 0 (extend z (extend target env)) (Fin.cases hz (Fin.cases ht members)) omega ordinal + have pair (target z : ZFSet.{u}) (ht : target ∈ M.sets) (hz : z ∈ M.sets) := + (BoundedFormula.realize_toFormula M + (BoundedFormula.orderedPairFormula output.succ.succ 1 0) + (extend z (extend target env)) (Fin.cases hz (Fin.cases ht members))).trans + (BoundedFormula.truth_orderedPairFormula output.succ.succ 1 0 (extend z (extend target env))) + constructor + · rintro ⟨target, ht, inS, z, hz, inV, shape, code⟩ + exact ⟨target, inS, z, inV, (pair target z ht hz).1 shape, (recognized target z ht hz).1 code⟩ + · rintro ⟨target, inS, z, inV, shape, code⟩ + have ht := M.transitive (members S) inS + have hz := M.transitive (members V) inV + exact ⟨target, ht, inS, z, hz, inV, (pair target z ht hz).2 shape, (recognized target z ht hz).2 code⟩ + +def taskBearingSuccessorParams (S V K Labels C D rD : ZFSet.{u}) : Fin 8 → ZFSet.{u} := + extend K (extend Labels (extend C (extend D (extend rD (extend ZFSet.omega + (extend S (extend V Fin.elim0))))))) + +theorem taskBearingSuccessorParams_ground + (separation : SeparationSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) + (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + ∀ j, taskBearingSuccessorParams S V K Labels C D rD j ∈ M.sets := + Fin.cases hK (Fin.cases hLabels (Fin.cases hC (Fin.cases hD (Fin.cases hrD + (Fin.cases (M.omega_mem separation infinite) (Fin.cases hS (Fin.cases hV (fun j => Fin.elim0 j)))))))) + +noncomputable def taskBearingSuccessorRelation (S V K Labels C D rD : ZFSet.{u}) : ZFSet.{u} := + M.definableRelation (taskBearingSuccessorPairFormula 2 3 4 5 6 7 8 9 (0 : Fin 10) 1) + (taskBearingSuccessorParams S V K Labels C D rD) S (ZFSet.prod V V) + +theorem taskBearingSuccessorRelation_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) + (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) : + M.taskBearingSuccessorRelation S V K Labels C D rD ∈ M.sets := + M.definableRelation_mem pairing unions powers separation _ _ + (M.taskBearingSuccessorParams_ground separation infinite hS hV hK hLabels hC hD hrD) + hS (M.prod_mem pairing unions powers separation hV hV) + +theorem taskBearingSuccessorRelation_entry + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) + (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (ordinal : ordinalSetProperty K) + (subset : S ⊆ V) (source target z : ZFSet.{u}) : + ZFSet.pair source (ZFSet.pair target z) ∈ M.taskBearingSuccessorRelation S V K Labels C D rD ↔ + source ∈ S ∧ target ∈ S ∧ z ∈ V ∧ + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z := by + rw [taskBearingSuccessorRelation, M.pair_mem_definableRelation] + have params := M.taskBearingSuccessorParams_ground separation infinite hS hV hK hLabels hC hD hrD + have hVV := M.prod_mem pairing unions powers separation hV hV + have recognized (hs : source ∈ S) (hp : ZFSet.pair target z ∈ ZFSet.prod V V) := + M.realize_taskBearingSuccessorPairFormula pairing unions powers separation collection + 2 3 4 5 6 7 8 9 0 1 + (extend source (extend (ZFSet.pair target z) (taskBearingSuccessorParams S V K Labels C D rD))) + (Fin.cases (M.transitive hS hs) (Fin.cases (M.transitive hVV hp) params)) rfl ordinal + constructor + · rintro ⟨hs, hp, relation⟩ + obtain ⟨t, ht, w, hw, equal, code⟩ := (recognized hs hp).1 relation + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨hs, ht, hw, code⟩ + · rintro ⟨hs, ht, hz, code⟩ + have hp := ZFSet.pair_mem_prod.2 ⟨subset ht, hz⟩ + exact ⟨hs, hp, (recognized hs hp).2 ⟨target, ht, z, hz, rfl, code⟩⟩ + +theorem choose_taskBearingSuccessors + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {S V K Labels C D rD : ZFSet.{u}} (hS : S ∈ M.sets) (hV : V ∈ M.sets) + (hK : K ∈ M.sets) (hLabels : Labels ∈ M.sets) (hC : C ∈ M.sets) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (ordinal : ordinalSetProperty K) (subset : S ⊆ V) + (total : ∀ source ∈ S, ∃ target ∈ S, ∃ z ∈ V, + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z) : + ∃ f ∈ M.sets, ZFSet.IsFunc S (ZFSet.prod V V) f ∧ + f ⊆ M.taskBearingSuccessorRelation S V K Labels C D rD ∧ + ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + target ∈ S ∧ z ∈ V ∧ + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source target z := by + have entries := M.taskBearingSuccessorRelation_entry pairing unions powers separation collection infinite + hS hV hK hLabels hC hD hrD ordinal subset + obtain ⟨f, hf, function, included⟩ := M.uniformize_relation pairing unions powers separation choice + hS (M.prod_mem pairing unions powers separation hV hV) + (M.taskBearingSuccessorRelation_ground pairing unions powers separation infinite hS hV hK hLabels hC hD hrD) + (by + intro source hs + obtain ⟨target, ht, z, hz, code⟩ := total source hs + exact ⟨ZFSet.pair target z, ZFSet.pair_mem_prod.2 ⟨subset ht, hz⟩, + (entries source target z).2 ⟨hs, ht, hz, code⟩⟩) + exact ⟨f, hf, function, included, fun source target z entry => + ((entries source target z).1 (included entry)).2⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialMainSeedSuccessorRanked + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) : + let C := M.groundOmegaOne pairing unions powers separation collection infinite + ∃ level : GroundMainCandidateLevel M K, + ∃ seed : GroundInitialMainSeedData M K C, + ∃ certificate : GroundInitialMainSuccessorData M C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) seed.source C, + ∃ initial : GroundSerializedChronology M (insert seed.source.cutoff seed.source.cutoff) + C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), + ∃ successor : GroundSerializedChronology M + (insert certificate.target.cutoff certificate.target.cutoff) + C (rationalCarrier seed.fractionCode) (rationalLtGraph seed.fractionCode), + level.validChronologies C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∈ M.sets ∧ + initial.code ∈ M.sets ∧ ZFSet.rank initial.code < ZFSet.rank K ∧ + initial.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + (∀ j t, t ∈ insert seed.source.cutoff seed.source.cutoff → + initial.fields.value j t = seed.source.history.fieldValue j t) ∧ + successor.code ∈ M.sets ∧ ZFSet.rank successor.code < ZFSet.rank K ∧ + successor.code ∈ level.validChronologies C (rationalCarrier seed.fractionCode) + (rationalLtGraph seed.fractionCode) ∧ + (∀ j t, t ∈ insert certificate.target.cutoff certificate.target.cutoff → + successor.fields.value j t = certificate.target.history.fieldValue j t) ∧ + certificate.target.Invariant K C ∧ + ZFSet.rank certificate.transition.map.code < ZFSet.rank K ∧ + successor.fields.value 0 certificate.target.cutoff = certificate.target.stage.carrier ∧ + successor.fields.value 1 certificate.target.cutoff = certificate.target.stage.order ∧ + successor.fields.value 2 certificate.target.cutoff = certificate.target.stage.meetGraph ∧ + successor.fields.value 3 certificate.target.cutoff = certificate.target.birth ∧ + successor.fields.value 4 certificate.target.cutoff = certificate.target.stage.height := by + dsimp only + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨level⟩ := M.exists_groundMainCandidateLevel pairing unions powers separation collection hK conditions.1 + obtain ⟨seed⟩ := M.exists_groundInitialMainSeed pairing unions powers separation infinite collection hK conditions + obtain ⟨initial, initialGround, initialRank, initialAgreement⟩ := + seed.exists_matchedInitialSerialization pairing unions powers separation infinite hK conditions + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation + collection infinite choice seed.source hC seed.injection_ground seed.dense + (fun lo hlo => (seed.no_endpoints lo hlo).2) seed.injection_code + obtain ⟨successor, successorGround, successorRank, successorMember, successorAgreement, terminal⟩ := + certificate.exists_rankedTargetSerialization pairing unions powers separation collection infinite choice + hK conditions seed.invariant level initial initialRank initialAgreement + have invariant := certificate.target_invariant pairing unions powers separation collection infinite + choice hC hK standard seed.invariant + have transitionRank := certificate.transition.map.code_rank_lt_inaccessible pairing unions powers separation infinite + hK conditions seed.invariant.points_rank invariant.points_rank seed.invariant.actors_rank invariant.actors_rank + exact ⟨level, seed, certificate, initial, successor, + level.validChronologies_ground pairing unions powers separation infinite seed.source.stage.columns_ground + seed.source.stage.coordinates_ground seed.source.stage.coordinate_order_ground, + initialGround, initialRank, level.ranked_mem_validChronologies pairing initial initialRank, initialAgreement, + successorGround, successorRank, successorMember, successorAgreement, invariant, transitionRank, terminal⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite + +include choice in +theorem exists_rankedTaskBearingSuccessor {K Labels D rD c : ZFSet.{u}} + (source : GroundLinkedMainStage M K Labels C D rD) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (hLabels : Labels ∈ M.sets) (hc : c ∈ M.sets) + (dense : DenseOrderCode D rD) (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) (level : GroundMainCandidateLevel M K) : + ∃ certificate : GroundInitialMainSuccessorData M C D rD source.main Labels, + ∃ target : GroundLinkedMainStage M K Labels C D rD, + target.main = certificate.target ∧ + target.code ∈ M.linkedMainStageCandidates level.carrier K Labels C D rD ∧ + certificate.transition.map.code ∈ level.carrier ∧ + TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code certificate.transition.map.code := by + obtain ⟨certificate⟩ := M.exists_groundInitialMainSuccessor pairing unions powers separation + collection infinite choice source.main hLabels hc dense above coordinateInjection + have conditions := standard.to_conditions pairing unions powers separation hK + obtain ⟨serial, _, serialRank, _, agreement, _⟩ := + certificate.exists_rankedTargetSerialization pairing unions powers separation collection infinite choice + hK conditions source.invariant level source.serial source.serial_rank source.agreement + have invariant := certificate.target_invariant pairing unions powers separation collection infinite choice + hLabels hK standard source.invariant + obtain ⟨target, same, code⟩ := certificate.exists_taskBearingLinkedTarget + pairing unions powers separation infinite hLabels serial agreement invariant serialRank + have targetBound : target.code ∈ level.carrier := (level.membership _).2 + ⟨target.code_ground pairing, target.code_rank_lt pairing unions powers separation infinite hK conditions⟩ + have transitionBound : certificate.transition.map.code ∈ level.carrier := (level.membership _).2 + ⟨certificate.transition.map.code_mem pairing, + certificate.transition_code_rank_lt pairing unions powers separation collection infinite + hK conditions source.invariant.points_rank source.invariant.labels_rank source.invariant.actors_rank⟩ + exact ⟨certificate, target, same, + (M.mem_linkedMainStageCandidates level.carrier K Labels C D rD target.code).2 + ⟨targetBound, target, rfl⟩, transitionBound, code⟩ + +include choice in +theorem omegaOne_taskBearingSuccessor_total {K D rD c : ZFSet.{u}} + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) (hc : c ∈ M.sets) + (dense : DenseOrderCode D rD) (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) (level : GroundMainCandidateLevel M K) + {s : ZFSet.{u}} (hs : s ∈ M.linkedMainStageCandidates level.carrier K C C D rD) : + ∃ t ∈ M.linkedMainStageCandidates level.carrier K C C D rD, ∃ z ∈ level.carrier, + TaskBearingMainSuccessorCode M K C C D rD ZFSet.omega s t z := by + obtain ⟨_, source, sourceEq⟩ := (M.mem_linkedMainStageCandidates level.carrier K C C D rD s).1 hs + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + obtain ⟨certificate, target, _, targetMember, mapMember, code⟩ := + M.exists_rankedTaskBearingSuccessor pairing unions powers separation collection infinite choice + source hK standard hC hc dense above coordinateInjection level + exact ⟨target.code, targetMember, certificate.transition.map.code, mapMember, sourceEq ▸ code⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +local notation "C" => M.groundOmegaOne pairing unions powers separation collection infinite + +include choice in +theorem exists_groundOmegaOneTaskBearingSuccessorFunction {K D rD c : ZFSet.{u}} + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (hc : c ∈ M.sets) + (dense : DenseOrderCode D rD) (above : ∀ lo ∈ D, ∃ hi ∈ D, ZFSet.pair lo hi ∈ rD) + (coordinateInjection : InjectionCode D ZFSet.omega c) (level : GroundMainCandidateLevel M K) : + ∃ f ∈ M.sets, + ZFSet.IsFunc (M.linkedMainStageCandidates level.carrier K C C D rD) + (ZFSet.prod level.carrier level.carrier) f ∧ + f ⊆ M.taskBearingSuccessorRelation + (M.linkedMainStageCandidates level.carrier K C C D rD) level.carrier K C C D rD ∧ + ∀ source target z, ZFSet.pair source (ZFSet.pair target z) ∈ f → + target ∈ M.linkedMainStageCandidates level.carrier K C C D rD ∧ z ∈ level.carrier ∧ + TaskBearingMainSuccessorCode M K C C D rD ZFSet.omega source target z := by + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + have hS := M.linkedMainStageCandidates_mem pairing unions powers separation collection infinite + level.carrier_ground hK hC hC hD hrD standard.1.1 + apply M.choose_taskBearingSuccessors pairing unions powers separation collection infinite choice + hS level.carrier_ground hK hC hC hD hrD standard.1.1 + · intro s hs + exact ((M.mem_linkedMainStageCandidates level.carrier K C C D rD s).1 hs).1 + · intro s hs + exact M.omegaOne_taskBearingSuccessor_total pairing unions powers separation collection infinite choice + hK standard hc dense above coordinateInjection level hs + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalEnumerationFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalEnumerationFamilies.lean index cf0f175a90c380b44f75a9c9aa4003fbb0618270..a5ab3a5bb7e2f45ffef7b36bb62e8055810ef8ee 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalEnumerationFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalEnumerationFamilies.lean @@ -1,213 +1,213 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift -import OAI.SetTheory.PartitionPrinciple.Models.GroundChoiceEnumerationSteps -import OAI.SetTheory.PartitionPrinciple.Models.GroundOrdinalPartitionInjectionAssembly - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem choiceEnumerationStep_fresh {A F c a p y : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) (step : ChoiceEnumerationStep A F c a p y) - (nonempty : (enumerationRemainder A a p).Nonempty) : - y ∈ enumerationRemainder A a p := by - rcases step with ⟨R, _, rfl, entry⟩ | ⟨empty, _⟩ - · exact choice.chosen _ _ entry - · exact False.elim (empty nonempty) - -theorem choiceEnumerationTrace_injection {A F c T f : ZFSet.{u}} - (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty T) - (trace : OrdinalRecursionTrace (ChoiceEnumerationStep A F c) T f) - (unused : ∀ a ∈ T, (enumerationRemainder A a (graphRestriction a f)).Nonempty) : - InjectionCode T A f := by - have fresh : ∀ a ∈ T, ∀ y, ZFSet.pair a y ∈ f → - y ∈ A ∧ ¬ ∃ b ∈ a, ZFSet.pair b y ∈ f := by - intro a ha y entry - have hy := (mem_enumerationRemainder A a (graphRestriction a f) y).1 - (choiceEnumerationStep_fresh choice (trace.2 a ha y entry) (unused a ha)) - exact ⟨hy.1, fun ⟨b, hb, byEntry⟩ => - hy.2 ⟨b, hb, pair_mem_graphRestriction.2 ⟨byEntry, hb⟩⟩⟩ - refine ⟨⟨?_, trace.1.to_isFunc.2⟩, ?_⟩ - · intro z hz - obtain ⟨a, ha, y, rfl⟩ := trace.1.shape z hz - exact ZFSet.pair_mem_prod.2 ⟨ha, (fresh a ha y hz).1⟩ - · intro a b y first second - have ha := trace.1.pair_source first - have hb := trace.1.pair_source second - rcases ordinalSetProperty_mem_compare ordinal ha hb with before | equal | after - · exact False.elim ((fresh b hb y second).2 ⟨a, before, first⟩) - · exact equal - · exact False.elim ((fresh a ha y first).2 ⟨b, after, second⟩) - -theorem exists_first_enumerationExhaustion {A T f : ZFSet.{u}} - (ordinal : ordinalSetProperty T) - (exhausted : ∃ a ∈ T, ¬ (enumerationRemainder A a (graphRestriction a f)).Nonempty) : - ∃ a ∈ T, ¬ (enumerationRemainder A a (graphRestriction a f)).Nonempty ∧ - ∀ b ∈ a, (enumerationRemainder A b (graphRestriction b f)).Nonempty := by - classical - obtain ⟨a, ha, exhausted⟩ := exhausted - induction a using ZFSet.inductionOn with - | h a ih => - by_cases earlier : ∃ b ∈ a, ¬ (enumerationRemainder A b (graphRestriction b f)).Nonempty - · obtain ⟨b, hb, empty⟩ := earlier - exact ih b hb (ordinal.1 a ha b hb) empty - · exact ⟨a, ha, exhausted, fun b hb => by - by_contra empty - exact earlier ⟨b, hb, empty⟩⟩ - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem exists_groundOrdinalEnumeration - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A : ZFSet.{u}} (hA : A ∈ M.sets) : - ∃ T ∈ M.sets, ∃ f ∈ M.sets, ordinalSetProperty T ∧ InjectionCode T A f ∧ - ∀ x ∈ A, ∃ a ∈ T, ZFSet.pair a x ∈ f := by - classical - let F := M.nonemptyGroundSubsets A - have hF := M.nonemptyGroundSubsets_mem powers separation hA - obtain ⟨c, hc, chooser⟩ := M.choice_witness choice hF - (fun R hR => ((M.mem_nonemptyGroundSubsets A R).1 hR).2.2) - obtain ⟨H, hH, ordinal, _, impossible⟩ := M.exists_groundHartogs - pairing unions powers separation collection hA - let params := extend A (extend F (extend c Fin.elim0)) - have members : ∀ i, params i ∈ M.sets := - Fin.cases hA (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))) - let φ : BoundedFormula 6 := BoundedFormula.choiceEnumerationStepFormula 3 4 5 0 1 2 - have recognize (a p y : ZFSet.{u}) (ha : a ∈ M.sets) (hp : p ∈ M.sets) - (hy : y ∈ M.sets) : - Realize M.sets φ.toFormula (extend a (extend p (extend y params))) ↔ - ChoiceEnumerationStep A F c a p y := - (BoundedFormula.realize_toFormula M φ _ - (Fin.cases ha (Fin.cases hp (Fin.cases hy members)))).trans - (BoundedFormula.truth_choiceEnumerationStepFormula 3 4 5 0 1 2 _) - have closure : GroundOrdinalStepClosure M H φ.toFormula params := by - intro a ha p hp _ - have haM := M.transitive hH ha - obtain ⟨y, hy, relation, unique⟩ := M.choiceEnumerationStep_exists_unique - separation hA haM hp chooser - exact ⟨y, hy, (recognize a p y haM hp hy).2 relation, - fun z hz step => unique z ((recognize a p z haM hp hz).1 step)⟩ - obtain ⟨f, hf, groundTrace⟩ := M.exists_ordinalRecursionTrace pairing unions separation - collection hH ordinal φ.toFormula params members closure - have trace : OrdinalRecursionTrace (ChoiceEnumerationStep A F c) H f := by - refine ⟨groundTrace.1, ?_⟩ - intro a ha y entry - have step := groundTrace.2 a ha y entry - exact (recognize a _ y (M.transitive hH ha) step.1 step.2.1).1 step.2.2 - have exhausted : ∃ a ∈ H, - ¬ (enumerationRemainder A a (graphRestriction a f)).Nonempty := by - by_contra none - apply impossible - exact ⟨f, hf, choiceEnumerationTrace_injection chooser ordinal trace (fun a ha => by - by_contra empty - exact none ⟨a, ha, empty⟩)⟩ - obtain ⟨T, hT, empty, unused⟩ := exists_first_enumerationExhaustion ordinal exhausted - have ordinalT := ordinalSetProperty_member ordinal hT - have subset : T ⊆ H := fun a ha => ordinal.1 T hT a ha - have hTM := M.transitive hH hT - have restricted := trace.restrict ordinalT subset - have injection : InjectionCode T A (graphRestriction T f) := - choiceEnumerationTrace_injection chooser ordinalT restricted (fun a ha => by - rw [graphRestriction_restrict (fun b hb => ordinalT.1 a ha b hb)] - exact unused a ha) - refine ⟨T, hTM, graphRestriction T f, - M.graphRestriction_mem unions separation hTM hf, ordinalT, injection, ?_⟩ - intro x hx - by_contra missing - apply empty - refine ⟨x, (mem_enumerationRemainder _ _ _ _).2 ⟨hx, ?_⟩⟩ - exact missing - -end TransitiveGround - -end PartitionPilot.Forcing - - - - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -namespace SetFormula -private def enumerationPairFormula : SetFormula 2 := - ex (ex (.conj (orderedPairFormula 3 1 0) - (.conj (BoundedFormula.ordinalFormula 1).toFormula - (.conj (BoundedFormula.injectionFormula 1 2 0).toFormula - (BoundedFormula.allMem 2 (BoundedFormula.exMem 2 - (BoundedFormula.pairMembershipFormula 0 1 2))).toFormula)))) -end SetFormula -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -include pairing - -private theorem enumerationPair_meaning (X z : ZFSet.{u}) (hX : X ∈ M.sets) (hz : z ∈ M.sets) : - Realize M.sets enumerationPairFormula (extend X (extend z Fin.elim0)) ↔ - ∃ delta ∈ M.sets, ∃ f ∈ M.sets, z = ZFSet.pair delta f ∧ - ordinalSetProperty delta ∧ InjectionCode delta X f ∧ - ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ f := by - rw [enumerationPairFormula, realize_ex] - apply exists_congr - intro delta - apply and_congr_right - intro hDelta - rw [realize_ex] - apply exists_congr - intro f - apply and_congr_right - intro hf - let env := extend f (extend delta (extend X (extend z Fin.elim0))) - have members : ∀ i, env i ∈ M.sets := - Fin.cases hf (Fin.cases hDelta (Fin.cases hX (Fin.cases hz (fun j => Fin.elim0 j)))) - change (Realize M.sets (orderedPairFormula 3 1 0) env ∧ - Realize M.sets (BoundedFormula.ordinalFormula 1).toFormula env ∧ - Realize M.sets (BoundedFormula.injectionFormula 1 2 0).toFormula env ∧ - Realize M.sets (BoundedFormula.allMem 2 (BoundedFormula.exMem 2 - (BoundedFormula.pairMembershipFormula 0 1 2))).toFormula env) ↔ _ - rw [M.realize_orderedPairFormula pairing 3 1 0 env hz hDelta hf, - BoundedFormula.realize_ordinalFormula M 1 env members, - ← ordinalSetProperty_iff, - BoundedFormula.realize_toFormula M _ env members, - BoundedFormula.truth_injectionFormula, - BoundedFormula.realize_toFormula M _ env members] - simp only [BoundedFormula.Truth, BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] - rfl - -theorem exists_groundOrdinalEnumerationFamily - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (W : ZFSet.{u}) (hW : W ∈ M.sets) : - ∃ B ∈ M.sets, ∃ selected ∈ M.sets, ZFSet.IsFunc W B selected ∧ - ∀ X z, ZFSet.pair X z ∈ selected → - ∃ delta ∈ M.sets, ∃ f ∈ M.sets, z = ZFSet.pair delta f ∧ - ordinalSetProperty delta ∧ InjectionCode delta X f ∧ - ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ f := by - have total : ∀ X ∈ W, ∃ z ∈ M.sets, - Realize M.sets enumerationPairFormula (extend X (extend z Fin.elim0)) := by - intro X member - have hX := M.transitive hW member - obtain ⟨delta, hDelta, f, hf, ordinal, injection, onto⟩ := - M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice hX - have hz := M.orderedPair_mem pairing hDelta hf - exact ⟨ZFSet.pair delta f, hz, (enumerationPair_meaning M pairing X _ hX hz).2 - ⟨delta, hDelta, f, hf, rfl, ordinal, injection, onto⟩⟩ - obtain ⟨B, hB, selected, ground, function, chosen⟩ := M.choose_definable_relation - pairing unions powers separation collection choice enumerationPairFormula Fin.elim0 - (fun j => Fin.elim0 j) hW total - refine ⟨B, hB, selected, ground, function, ?_⟩ - intro X z entry - have shape := ZFSet.pair_mem_prod.1 (function.1 entry) - exact (enumerationPair_meaning M pairing X z (M.transitive hW shape.1) - (M.transitive hB shape.2)).1 (chosen X z entry) - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift +import OAI.SetTheory.PartitionPrinciple.Models.GroundChoiceEnumerationSteps +import OAI.SetTheory.PartitionPrinciple.Models.GroundOrdinalPartitionInjectionAssembly + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem choiceEnumerationStep_fresh {A F c a p y : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) (step : ChoiceEnumerationStep A F c a p y) + (nonempty : (enumerationRemainder A a p).Nonempty) : + y ∈ enumerationRemainder A a p := by + rcases step with ⟨R, _, rfl, entry⟩ | ⟨empty, _⟩ + · exact choice.chosen _ _ entry + · exact False.elim (empty nonempty) + +theorem choiceEnumerationTrace_injection {A F c T f : ZFSet.{u}} + (choice : ChoiceFunctionCode F c) (ordinal : ordinalSetProperty T) + (trace : OrdinalRecursionTrace (ChoiceEnumerationStep A F c) T f) + (unused : ∀ a ∈ T, (enumerationRemainder A a (graphRestriction a f)).Nonempty) : + InjectionCode T A f := by + have fresh : ∀ a ∈ T, ∀ y, ZFSet.pair a y ∈ f → + y ∈ A ∧ ¬ ∃ b ∈ a, ZFSet.pair b y ∈ f := by + intro a ha y entry + have hy := (mem_enumerationRemainder A a (graphRestriction a f) y).1 + (choiceEnumerationStep_fresh choice (trace.2 a ha y entry) (unused a ha)) + exact ⟨hy.1, fun ⟨b, hb, byEntry⟩ => + hy.2 ⟨b, hb, pair_mem_graphRestriction.2 ⟨byEntry, hb⟩⟩⟩ + refine ⟨⟨?_, trace.1.to_isFunc.2⟩, ?_⟩ + · intro z hz + obtain ⟨a, ha, y, rfl⟩ := trace.1.shape z hz + exact ZFSet.pair_mem_prod.2 ⟨ha, (fresh a ha y hz).1⟩ + · intro a b y first second + have ha := trace.1.pair_source first + have hb := trace.1.pair_source second + rcases ordinalSetProperty_mem_compare ordinal ha hb with before | equal | after + · exact False.elim ((fresh b hb y second).2 ⟨a, before, first⟩) + · exact equal + · exact False.elim ((fresh a ha y first).2 ⟨b, after, second⟩) + +theorem exists_first_enumerationExhaustion {A T f : ZFSet.{u}} + (ordinal : ordinalSetProperty T) + (exhausted : ∃ a ∈ T, ¬ (enumerationRemainder A a (graphRestriction a f)).Nonempty) : + ∃ a ∈ T, ¬ (enumerationRemainder A a (graphRestriction a f)).Nonempty ∧ + ∀ b ∈ a, (enumerationRemainder A b (graphRestriction b f)).Nonempty := by + classical + obtain ⟨a, ha, exhausted⟩ := exhausted + induction a using ZFSet.inductionOn with + | h a ih => + by_cases earlier : ∃ b ∈ a, ¬ (enumerationRemainder A b (graphRestriction b f)).Nonempty + · obtain ⟨b, hb, empty⟩ := earlier + exact ih b hb (ordinal.1 a ha b hb) empty + · exact ⟨a, ha, exhausted, fun b hb => by + by_contra empty + exact earlier ⟨b, hb, empty⟩⟩ + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem exists_groundOrdinalEnumeration + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A : ZFSet.{u}} (hA : A ∈ M.sets) : + ∃ T ∈ M.sets, ∃ f ∈ M.sets, ordinalSetProperty T ∧ InjectionCode T A f ∧ + ∀ x ∈ A, ∃ a ∈ T, ZFSet.pair a x ∈ f := by + classical + let F := M.nonemptyGroundSubsets A + have hF := M.nonemptyGroundSubsets_mem powers separation hA + obtain ⟨c, hc, chooser⟩ := M.choice_witness choice hF + (fun R hR => ((M.mem_nonemptyGroundSubsets A R).1 hR).2.2) + obtain ⟨H, hH, ordinal, _, impossible⟩ := M.exists_groundHartogs + pairing unions powers separation collection hA + let params := extend A (extend F (extend c Fin.elim0)) + have members : ∀ i, params i ∈ M.sets := + Fin.cases hA (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))) + let φ : BoundedFormula 6 := BoundedFormula.choiceEnumerationStepFormula 3 4 5 0 1 2 + have recognize (a p y : ZFSet.{u}) (ha : a ∈ M.sets) (hp : p ∈ M.sets) + (hy : y ∈ M.sets) : + Realize M.sets φ.toFormula (extend a (extend p (extend y params))) ↔ + ChoiceEnumerationStep A F c a p y := + (BoundedFormula.realize_toFormula M φ _ + (Fin.cases ha (Fin.cases hp (Fin.cases hy members)))).trans + (BoundedFormula.truth_choiceEnumerationStepFormula 3 4 5 0 1 2 _) + have closure : GroundOrdinalStepClosure M H φ.toFormula params := by + intro a ha p hp _ + have haM := M.transitive hH ha + obtain ⟨y, hy, relation, unique⟩ := M.choiceEnumerationStep_exists_unique + separation hA haM hp chooser + exact ⟨y, hy, (recognize a p y haM hp hy).2 relation, + fun z hz step => unique z ((recognize a p z haM hp hz).1 step)⟩ + obtain ⟨f, hf, groundTrace⟩ := M.exists_ordinalRecursionTrace pairing unions separation + collection hH ordinal φ.toFormula params members closure + have trace : OrdinalRecursionTrace (ChoiceEnumerationStep A F c) H f := by + refine ⟨groundTrace.1, ?_⟩ + intro a ha y entry + have step := groundTrace.2 a ha y entry + exact (recognize a _ y (M.transitive hH ha) step.1 step.2.1).1 step.2.2 + have exhausted : ∃ a ∈ H, + ¬ (enumerationRemainder A a (graphRestriction a f)).Nonempty := by + by_contra none + apply impossible + exact ⟨f, hf, choiceEnumerationTrace_injection chooser ordinal trace (fun a ha => by + by_contra empty + exact none ⟨a, ha, empty⟩)⟩ + obtain ⟨T, hT, empty, unused⟩ := exists_first_enumerationExhaustion ordinal exhausted + have ordinalT := ordinalSetProperty_member ordinal hT + have subset : T ⊆ H := fun a ha => ordinal.1 T hT a ha + have hTM := M.transitive hH hT + have restricted := trace.restrict ordinalT subset + have injection : InjectionCode T A (graphRestriction T f) := + choiceEnumerationTrace_injection chooser ordinalT restricted (fun a ha => by + rw [graphRestriction_restrict (fun b hb => ordinalT.1 a ha b hb)] + exact unused a ha) + refine ⟨T, hTM, graphRestriction T f, + M.graphRestriction_mem unions separation hTM hf, ordinalT, injection, ?_⟩ + intro x hx + by_contra missing + apply empty + refine ⟨x, (mem_enumerationRemainder _ _ _ _).2 ⟨hx, ?_⟩⟩ + exact missing + +end TransitiveGround + +end PartitionPilot.Forcing + + + + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +namespace SetFormula +private def enumerationPairFormula : SetFormula 2 := + ex (ex (.conj (orderedPairFormula 3 1 0) + (.conj (BoundedFormula.ordinalFormula 1).toFormula + (.conj (BoundedFormula.injectionFormula 1 2 0).toFormula + (BoundedFormula.allMem 2 (BoundedFormula.exMem 2 + (BoundedFormula.pairMembershipFormula 0 1 2))).toFormula)))) +end SetFormula +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +include pairing + +private theorem enumerationPair_meaning (X z : ZFSet.{u}) (hX : X ∈ M.sets) (hz : z ∈ M.sets) : + Realize M.sets enumerationPairFormula (extend X (extend z Fin.elim0)) ↔ + ∃ delta ∈ M.sets, ∃ f ∈ M.sets, z = ZFSet.pair delta f ∧ + ordinalSetProperty delta ∧ InjectionCode delta X f ∧ + ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ f := by + rw [enumerationPairFormula, realize_ex] + apply exists_congr + intro delta + apply and_congr_right + intro hDelta + rw [realize_ex] + apply exists_congr + intro f + apply and_congr_right + intro hf + let env := extend f (extend delta (extend X (extend z Fin.elim0))) + have members : ∀ i, env i ∈ M.sets := + Fin.cases hf (Fin.cases hDelta (Fin.cases hX (Fin.cases hz (fun j => Fin.elim0 j)))) + change (Realize M.sets (orderedPairFormula 3 1 0) env ∧ + Realize M.sets (BoundedFormula.ordinalFormula 1).toFormula env ∧ + Realize M.sets (BoundedFormula.injectionFormula 1 2 0).toFormula env ∧ + Realize M.sets (BoundedFormula.allMem 2 (BoundedFormula.exMem 2 + (BoundedFormula.pairMembershipFormula 0 1 2))).toFormula env) ↔ _ + rw [M.realize_orderedPairFormula pairing 3 1 0 env hz hDelta hf, + BoundedFormula.realize_ordinalFormula M 1 env members, + ← ordinalSetProperty_iff, + BoundedFormula.realize_toFormula M _ env members, + BoundedFormula.truth_injectionFormula, + BoundedFormula.realize_toFormula M _ env members] + simp only [BoundedFormula.Truth, BoundedFormula.truth_exMem, BoundedFormula.truth_pairMembershipFormula] + rfl + +theorem exists_groundOrdinalEnumerationFamily + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (W : ZFSet.{u}) (hW : W ∈ M.sets) : + ∃ B ∈ M.sets, ∃ selected ∈ M.sets, ZFSet.IsFunc W B selected ∧ + ∀ X z, ZFSet.pair X z ∈ selected → + ∃ delta ∈ M.sets, ∃ f ∈ M.sets, z = ZFSet.pair delta f ∧ + ordinalSetProperty delta ∧ InjectionCode delta X f ∧ + ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ f := by + have total : ∀ X ∈ W, ∃ z ∈ M.sets, + Realize M.sets enumerationPairFormula (extend X (extend z Fin.elim0)) := by + intro X member + have hX := M.transitive hW member + obtain ⟨delta, hDelta, f, hf, ordinal, injection, onto⟩ := + M.exists_groundOrdinalEnumeration pairing unions powers separation collection choice hX + have hz := M.orderedPair_mem pairing hDelta hf + exact ⟨ZFSet.pair delta f, hz, (enumerationPair_meaning M pairing X _ hX hz).2 + ⟨delta, hDelta, f, hf, rfl, ordinal, injection, onto⟩⟩ + obtain ⟨B, hB, selected, ground, function, chosen⟩ := M.choose_definable_relation + pairing unions powers separation collection choice enumerationPairFormula Fin.elim0 + (fun j => Fin.elim0 j) hW total + refine ⟨B, hB, selected, ground, function, ?_⟩ + intro X z entry + have shape := ZFSet.pair_mem_prod.1 (function.1 entry) + exact (enumerationPair_meaning M pairing X z (M.transitive hW shape.1) + (M.transitive hB shape.2)).1 (chosen X z entry) + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalImagePartitions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalImagePartitions.lean index e7c2a7f2e8fdd71d8ffaec92bd217a0c1154b164..24e2f67d3b5a1517a24bc457b974b5d9efc44805 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalImagePartitions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalImagePartitions.lean @@ -1,204 +1,204 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def ordinalFirstRelation (delta Y R : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ i ∈ delta, ∃ y ∈ Y, - z = ZFSet.pair i y ∧ ∀ k ∈ i, ZFSet.pair k y ∉ R) R - -theorem pair_mem_ordinalFirstRelation (delta Y R i y : ZFSet.{u}) : - ZFSet.pair i y ∈ ordinalFirstRelation delta Y R ↔ - ZFSet.pair i y ∈ R ∧ i ∈ delta ∧ y ∈ Y ∧ ∀ k ∈ i, ZFSet.pair k y ∉ R := by - rw [ordinalFirstRelation, ZFSet.mem_sep] - constructor - · rintro ⟨entry, j, hj, z, hz, equal, least⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal - exact ⟨entry, hj, hz, least⟩ - · rintro ⟨entry, hi, hy, least⟩ - exact ⟨entry, i, hi, y, hy, rfl, least⟩ - -namespace BoundedFormula -private def firstRelationEntryFormula {n} (z delta Y R : Fin n) : BoundedFormula n := - exMem delta (exMem Y.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (.allMem 1 (.neg (pairMembershipFormula 0 1 R.succ.succ.succ))))) - -private theorem firstRelationEntry_meaning {n} (z delta Y R : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (firstRelationEntryFormula z delta Y R) env ↔ - ∃ i ∈ env delta, ∃ y ∈ env Y, env z = ZFSet.pair i y ∧ - ∀ k ∈ i, ZFSet.pair k y ∉ env R := by - simp only [firstRelationEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl -end BoundedFormula - -namespace TransitiveGround -variable (N : TransitiveGround.{u}) - -theorem ordinalFirstRelation_mem (separation : SeparationSchema N.sets) - {delta Y R : ZFSet.{u}} (hDelta : delta ∈ N.sets) (hY : Y ∈ N.sets) (hR : R ∈ N.sets) : - ordinalFirstRelation delta Y R ∈ N.sets := by - let params := extend delta (extend Y (extend R Fin.elim0)) - have ground := N.bounded_separation_mem separation - (BoundedFormula.firstRelationEntryFormula 0 1 2 3) params - (Fin.cases hDelta (Fin.cases hY (Fin.cases hR (fun j => Fin.elim0 j)))) hR - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.firstRelationEntryFormula 0 1 2 3) (extend z params)) R = - ordinalFirstRelation delta Y R := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, ordinalFirstRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.firstRelationEntry_meaning _ _ _ _ _) - exact equal ▸ ground - -theorem ordinal_image_partitions - (zf : ZFRealization N.sets) {delta X Y R f : ZFSet.{u}} - (hDelta : delta ∈ N.sets) (ordinal : ordinalSetProperty delta) - (hX : X ∈ N.sets) (hY : Y ∈ N.sets) (hR : R ∈ N.sets) (hf : f ∈ N.sets) - (relation : R ⊆ ZFSet.prod delta X) (function : ZFSet.IsFunc X Y f) - (onto : ∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) - (coverX : ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ R) : - ∃ p ∈ N.sets, ∃ q ∈ N.sets, - FunctionGraphOn delta p ∧ FunctionGraphOn delta q ∧ - (∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) ∧ - (∀ y ∈ Y, ∃ i ∈ delta, ∃ U, ZFSet.pair i U ∈ p ∧ y ∈ U) ∧ - (∀ i k U V y, ZFSet.pair i U ∈ p → ZFSet.pair k V ∈ p → y ∈ U → y ∈ V → i = k) ∧ - (∀ i k U V x, ZFSet.pair i U ∈ q → ZFSet.pair k V ∈ q → x ∈ U → x ∈ V → i = k) ∧ - ∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → - (∀ y, y ∈ U ↔ y ∈ Y ∧ - (∃ x ∈ X, ZFSet.pair i x ∈ R ∧ ZFSet.pair x y ∈ f) ∧ - ∀ k ∈ i, ¬ ∃ x ∈ X, ZFSet.pair k x ∈ R ∧ ZFSet.pair x y ∈ f) ∧ - (∀ x, x ∈ V ↔ ZFSet.pair i x ∈ R ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f) ∧ - graphRestriction V f ∈ N.sets ∧ ZFSet.IsFunc V U (graphRestriction V f) ∧ - ∀ y ∈ U, ∃ x ∈ V, ZFSet.pair x y ∈ graphRestriction V f := by - have pairing := zf.1.2.2.2.1 - have unions := zf.1.2.2.2.2.1 - have powers := zf.1.2.2.2.2.2.1 - have separation : SeparationSchema N.sets := zf.2.1 - let image := relationCompose delta X Y R f - have hImage : image ∈ N.sets := N.relationCompose_mem pairing unions powers separation hDelta hX hY hR hf - have imageEntries (i y : ZFSet.{u}) : ZFSet.pair i y ∈ image ↔ - i ∈ delta ∧ y ∈ Y ∧ ∃ x ∈ X, ZFSet.pair i x ∈ R ∧ ZFSet.pair x y ∈ f := - pair_mem_relationCompose _ _ _ _ _ _ _ - let first := ordinalFirstRelation delta Y image - have hFirst : first ∈ N.sets := N.ordinalFirstRelation_mem separation hDelta hY hImage - have firstUnique (i k y : ZFSet.{u}) (iy : ZFSet.pair i y ∈ first) - (ky : ZFSet.pair k y ∈ first) : i = k := by - have a := (pair_mem_ordinalFirstRelation delta Y image i y).1 iy - have b := (pair_mem_ordinalFirstRelation delta Y image k y).1 ky - rcases ordinalSetProperty_mem_compare ordinal a.2.1 b.2.1 with less | equal | greater - · exact (b.2.2.2 i less a.1).elim - · exact equal - · exact (a.2.2.2 k greater b.1).elim - let preimage := relationCompose delta Y X first (relationConverse X Y f) - have hPreimage : preimage ∈ N.sets := N.relationCompose_mem pairing unions powers separation hDelta hY hX - hFirst (N.relationConverse_mem pairing unions powers separation hX hY hf) - let selected := ZFSet.sep (fun z => z ∈ preimage) R - have hSelected : selected ∈ N.sets := by - exact N.bounded_separation_mem separation (.mem 0 1) (extend preimage Fin.elim0) - (Fin.cases hPreimage (fun j => Fin.elim0 j)) hR - let p := N.relationFiberFamily delta Y first - let q := N.relationFiberFamily delta X selected - have hp := N.relationFiberFamily_mem pairing unions powers separation hDelta hY hFirst - have hq := N.relationFiberFamily_mem pairing unions powers separation hDelta hX hSelected - have pFunction : FunctionGraphOn delta p := - ⟨N.groundPower Y, N.relationFiberFamily_function separation hDelta hY hFirst⟩ - have qFunction : FunctionGraphOn delta q := - ⟨N.groundPower X, N.relationFiberFamily_function separation hDelta hX hSelected⟩ - have pEntries (i U : ZFSet.{u}) (entry : ZFSet.pair i U ∈ p) (y : ZFSet.{u}) : - y ∈ U ↔ y ∈ Y ∧ ZFSet.pair i y ∈ first := by - have equal := ((N.pair_mem_relationFiberFamily delta Y first i U).1 entry).2.2 - rw [equal, mem_relationFiber] - have qEntries (i V : ZFSet.{u}) (entry : ZFSet.pair i V ∈ q) (x : ZFSet.{u}) : - x ∈ V ↔ x ∈ X ∧ ZFSet.pair i x ∈ selected := by - have equal := ((N.pair_mem_relationFiberFamily delta X selected i V).1 entry).2.2 - rw [equal, mem_relationFiber] - have sourceEntries (i U V : ZFSet.{u}) (ip : ZFSet.pair i U ∈ p) (iq : ZFSet.pair i V ∈ q) - (x : ZFSet.{u}) : x ∈ V ↔ ZFSet.pair i x ∈ R ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f := by - rw [qEntries i V iq x] - constructor - · rintro ⟨hx, entry⟩ - obtain ⟨ix, back⟩ := ZFSet.mem_sep.1 entry - obtain ⟨_, _, y, hy, firstEntry, converse⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 back - exact ⟨ix, y, (pEntries i U ip y).2 ⟨hy, firstEntry⟩, - ((pair_mem_relationConverse X Y f x y).1 converse).2.2⟩ - · rintro ⟨ix, y, hy, xy⟩ - have shape := ZFSet.pair_mem_prod.1 (relation ix) - have firstEntry := (pEntries i U ip y).1 hy - exact ⟨shape.2, ZFSet.mem_sep.2 ⟨ix, - (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨shape.1, shape.2, y, firstEntry.1, firstEntry.2, - (pair_mem_relationConverse X Y f x y).2 ⟨shape.2, firstEntry.1, xy⟩⟩⟩⟩ - refine ⟨p, hp, q, hq, pFunction, qFunction, ?_, ?_, ?_, ?_, ?_⟩ - · intro i U V ip iq - exact ⟨fun y hy => ((pEntries i U ip y).1 hy).1, - fun x hx => ((qEntries i V iq x).1 hx).1⟩ - · intro y hy - obtain ⟨x, hx, xy⟩ := onto y hy - obtain ⟨j, hj, jx⟩ := coverX x hx - let indices : Set ZFSet.{u} := {i | i ∈ delta ∧ ZFSet.pair i y ∈ image} - have inhabited : indices.Nonempty := ⟨j, hj, (imageEntries j y).2 ⟨hj, hy, x, hx, jx, xy⟩⟩ - obtain ⟨i, hi, least⟩ := ZFSet.mem_wf.has_min indices inhabited - obtain ⟨U, ip⟩ := pFunction.total hi.1 - refine ⟨i, hi.1, U, ip, (pEntries i U ip y).2 ⟨hy, ?_⟩⟩ - exact (pair_mem_ordinalFirstRelation delta Y image i y).2 - ⟨hi.2, hi.1, hy, fun k ki entry => least k ⟨ordinal.1 i hi.1 k ki, entry⟩ ki⟩ - · intro i k U V y ip kp hy hy' - exact firstUnique i k y ((pEntries i U ip y).1 hy).2 ((pEntries k V kp y).1 hy').2 - · intro i k U V x iq kq hx hx' - obtain ⟨A, ip⟩ := pFunction.total (qFunction.pair_source iq) - obtain ⟨B, kp⟩ := pFunction.total (qFunction.pair_source kq) - obtain ⟨_, y, hy, xy⟩ := (sourceEntries i A U ip iq x).1 hx - obtain ⟨_, z, hz, xz⟩ := (sourceEntries k B V kp kq x).1 hx' - obtain ⟨v, _, unique⟩ := function.2 x ((qEntries i U iq x).1 hx).1 - have equal : z = y := (unique z xz).trans (unique y xy).symm - subst z - exact firstUnique i k y ((pEntries i A ip y).1 hy).2 ((pEntries k B kp y).1 hz).2 - · intro i U V ip iq - have hi := pFunction.pair_source ip - have hV : V ∈ N.sets := N.transitive (N.union_mem unions (N.union_mem unions hq)) - (pair_second_mem_doubleUnion iq) - have maps (x y : ZFSet.{u}) (hx : x ∈ V) (xy : ZFSet.pair x y ∈ f) : y ∈ U := by - obtain ⟨_, z, hz, xz⟩ := (sourceEntries i U V ip iq x).1 hx - obtain ⟨v, _, unique⟩ := function.2 x ((qEntries i V iq x).1 hx).1 - have equal : y = z := (unique y xy).trans (unique z xz).symm - exact equal.symm ▸ hz - refine ⟨?_, sourceEntries i U V ip iq, N.graphRestriction_mem unions separation hV hf, ?_, ?_⟩ - · intro y - rw [pEntries i U ip y] - constructor - · rintro ⟨hy, entry⟩ - have firstEntry := (pair_mem_ordinalFirstRelation delta Y image i y).1 entry - exact ⟨hy, ((imageEntries i y).1 firstEntry.1).2.2, - fun k ki witness => firstEntry.2.2.2 k ki - ((imageEntries k y).2 ⟨ordinal.1 i hi k ki, hy, witness⟩)⟩ - · rintro ⟨hy, witness, least⟩ - exact ⟨hy, (pair_mem_ordinalFirstRelation delta Y image i y).2 - ⟨(imageEntries i y).2 ⟨hi, hy, witness⟩, hi, hy, - fun k ki entry => least k ki ((imageEntries k y).1 entry).2.2⟩⟩ - · refine ⟨?_, ?_⟩ - · intro z hz - obtain ⟨x, hx, y, rfl, xy⟩ := mem_graphRestriction.1 hz - exact ZFSet.pair_mem_prod.2 ⟨hx, maps x y hx xy⟩ - · intro x hx - obtain ⟨y, xy, unique⟩ := function.2 x ((qEntries i V iq x).1 hx).1 - exact ⟨y, pair_mem_graphRestriction.2 ⟨xy, hx⟩, - fun z xz => unique z (pair_mem_graphRestriction.1 xz).1⟩ - · intro y hy - have firstEntry := ((pEntries i U ip y).1 hy).2 - obtain ⟨x, hx, ix, xy⟩ := ((imageEntries i y).1 - ((pair_mem_ordinalFirstRelation delta Y image i y).1 firstEntry).1).2.2 - have inV := (sourceEntries i U V ip iq x).2 ⟨ix, y, hy, xy⟩ - exact ⟨x, inV, pair_mem_graphRestriction.2 ⟨xy, inV⟩⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNaturalFamilyShift + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def ordinalFirstRelation (delta Y R : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ i ∈ delta, ∃ y ∈ Y, + z = ZFSet.pair i y ∧ ∀ k ∈ i, ZFSet.pair k y ∉ R) R + +theorem pair_mem_ordinalFirstRelation (delta Y R i y : ZFSet.{u}) : + ZFSet.pair i y ∈ ordinalFirstRelation delta Y R ↔ + ZFSet.pair i y ∈ R ∧ i ∈ delta ∧ y ∈ Y ∧ ∀ k ∈ i, ZFSet.pair k y ∉ R := by + rw [ordinalFirstRelation, ZFSet.mem_sep] + constructor + · rintro ⟨entry, j, hj, z, hz, equal, least⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal + exact ⟨entry, hj, hz, least⟩ + · rintro ⟨entry, hi, hy, least⟩ + exact ⟨entry, i, hi, y, hy, rfl, least⟩ + +namespace BoundedFormula +private def firstRelationEntryFormula {n} (z delta Y R : Fin n) : BoundedFormula n := + exMem delta (exMem Y.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (.allMem 1 (.neg (pairMembershipFormula 0 1 R.succ.succ.succ))))) + +private theorem firstRelationEntry_meaning {n} (z delta Y R : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (firstRelationEntryFormula z delta Y R) env ↔ + ∃ i ∈ env delta, ∃ y ∈ env Y, env z = ZFSet.pair i y ∧ + ∀ k ∈ i, ZFSet.pair k y ∉ env R := by + simp only [firstRelationEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl +end BoundedFormula + +namespace TransitiveGround +variable (N : TransitiveGround.{u}) + +theorem ordinalFirstRelation_mem (separation : SeparationSchema N.sets) + {delta Y R : ZFSet.{u}} (hDelta : delta ∈ N.sets) (hY : Y ∈ N.sets) (hR : R ∈ N.sets) : + ordinalFirstRelation delta Y R ∈ N.sets := by + let params := extend delta (extend Y (extend R Fin.elim0)) + have ground := N.bounded_separation_mem separation + (BoundedFormula.firstRelationEntryFormula 0 1 2 3) params + (Fin.cases hDelta (Fin.cases hY (Fin.cases hR (fun j => Fin.elim0 j)))) hR + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.firstRelationEntryFormula 0 1 2 3) (extend z params)) R = + ordinalFirstRelation delta Y R := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, ordinalFirstRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.firstRelationEntry_meaning _ _ _ _ _) + exact equal ▸ ground + +theorem ordinal_image_partitions + (zf : ZFRealization N.sets) {delta X Y R f : ZFSet.{u}} + (hDelta : delta ∈ N.sets) (ordinal : ordinalSetProperty delta) + (hX : X ∈ N.sets) (hY : Y ∈ N.sets) (hR : R ∈ N.sets) (hf : f ∈ N.sets) + (relation : R ⊆ ZFSet.prod delta X) (function : ZFSet.IsFunc X Y f) + (onto : ∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) + (coverX : ∀ x ∈ X, ∃ i ∈ delta, ZFSet.pair i x ∈ R) : + ∃ p ∈ N.sets, ∃ q ∈ N.sets, + FunctionGraphOn delta p ∧ FunctionGraphOn delta q ∧ + (∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → U ⊆ Y ∧ V ⊆ X) ∧ + (∀ y ∈ Y, ∃ i ∈ delta, ∃ U, ZFSet.pair i U ∈ p ∧ y ∈ U) ∧ + (∀ i k U V y, ZFSet.pair i U ∈ p → ZFSet.pair k V ∈ p → y ∈ U → y ∈ V → i = k) ∧ + (∀ i k U V x, ZFSet.pair i U ∈ q → ZFSet.pair k V ∈ q → x ∈ U → x ∈ V → i = k) ∧ + ∀ i U V, ZFSet.pair i U ∈ p → ZFSet.pair i V ∈ q → + (∀ y, y ∈ U ↔ y ∈ Y ∧ + (∃ x ∈ X, ZFSet.pair i x ∈ R ∧ ZFSet.pair x y ∈ f) ∧ + ∀ k ∈ i, ¬ ∃ x ∈ X, ZFSet.pair k x ∈ R ∧ ZFSet.pair x y ∈ f) ∧ + (∀ x, x ∈ V ↔ ZFSet.pair i x ∈ R ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f) ∧ + graphRestriction V f ∈ N.sets ∧ ZFSet.IsFunc V U (graphRestriction V f) ∧ + ∀ y ∈ U, ∃ x ∈ V, ZFSet.pair x y ∈ graphRestriction V f := by + have pairing := zf.1.2.2.2.1 + have unions := zf.1.2.2.2.2.1 + have powers := zf.1.2.2.2.2.2.1 + have separation : SeparationSchema N.sets := zf.2.1 + let image := relationCompose delta X Y R f + have hImage : image ∈ N.sets := N.relationCompose_mem pairing unions powers separation hDelta hX hY hR hf + have imageEntries (i y : ZFSet.{u}) : ZFSet.pair i y ∈ image ↔ + i ∈ delta ∧ y ∈ Y ∧ ∃ x ∈ X, ZFSet.pair i x ∈ R ∧ ZFSet.pair x y ∈ f := + pair_mem_relationCompose _ _ _ _ _ _ _ + let first := ordinalFirstRelation delta Y image + have hFirst : first ∈ N.sets := N.ordinalFirstRelation_mem separation hDelta hY hImage + have firstUnique (i k y : ZFSet.{u}) (iy : ZFSet.pair i y ∈ first) + (ky : ZFSet.pair k y ∈ first) : i = k := by + have a := (pair_mem_ordinalFirstRelation delta Y image i y).1 iy + have b := (pair_mem_ordinalFirstRelation delta Y image k y).1 ky + rcases ordinalSetProperty_mem_compare ordinal a.2.1 b.2.1 with less | equal | greater + · exact (b.2.2.2 i less a.1).elim + · exact equal + · exact (a.2.2.2 k greater b.1).elim + let preimage := relationCompose delta Y X first (relationConverse X Y f) + have hPreimage : preimage ∈ N.sets := N.relationCompose_mem pairing unions powers separation hDelta hY hX + hFirst (N.relationConverse_mem pairing unions powers separation hX hY hf) + let selected := ZFSet.sep (fun z => z ∈ preimage) R + have hSelected : selected ∈ N.sets := by + exact N.bounded_separation_mem separation (.mem 0 1) (extend preimage Fin.elim0) + (Fin.cases hPreimage (fun j => Fin.elim0 j)) hR + let p := N.relationFiberFamily delta Y first + let q := N.relationFiberFamily delta X selected + have hp := N.relationFiberFamily_mem pairing unions powers separation hDelta hY hFirst + have hq := N.relationFiberFamily_mem pairing unions powers separation hDelta hX hSelected + have pFunction : FunctionGraphOn delta p := + ⟨N.groundPower Y, N.relationFiberFamily_function separation hDelta hY hFirst⟩ + have qFunction : FunctionGraphOn delta q := + ⟨N.groundPower X, N.relationFiberFamily_function separation hDelta hX hSelected⟩ + have pEntries (i U : ZFSet.{u}) (entry : ZFSet.pair i U ∈ p) (y : ZFSet.{u}) : + y ∈ U ↔ y ∈ Y ∧ ZFSet.pair i y ∈ first := by + have equal := ((N.pair_mem_relationFiberFamily delta Y first i U).1 entry).2.2 + rw [equal, mem_relationFiber] + have qEntries (i V : ZFSet.{u}) (entry : ZFSet.pair i V ∈ q) (x : ZFSet.{u}) : + x ∈ V ↔ x ∈ X ∧ ZFSet.pair i x ∈ selected := by + have equal := ((N.pair_mem_relationFiberFamily delta X selected i V).1 entry).2.2 + rw [equal, mem_relationFiber] + have sourceEntries (i U V : ZFSet.{u}) (ip : ZFSet.pair i U ∈ p) (iq : ZFSet.pair i V ∈ q) + (x : ZFSet.{u}) : x ∈ V ↔ ZFSet.pair i x ∈ R ∧ ∃ y ∈ U, ZFSet.pair x y ∈ f := by + rw [qEntries i V iq x] + constructor + · rintro ⟨hx, entry⟩ + obtain ⟨ix, back⟩ := ZFSet.mem_sep.1 entry + obtain ⟨_, _, y, hy, firstEntry, converse⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 back + exact ⟨ix, y, (pEntries i U ip y).2 ⟨hy, firstEntry⟩, + ((pair_mem_relationConverse X Y f x y).1 converse).2.2⟩ + · rintro ⟨ix, y, hy, xy⟩ + have shape := ZFSet.pair_mem_prod.1 (relation ix) + have firstEntry := (pEntries i U ip y).1 hy + exact ⟨shape.2, ZFSet.mem_sep.2 ⟨ix, + (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨shape.1, shape.2, y, firstEntry.1, firstEntry.2, + (pair_mem_relationConverse X Y f x y).2 ⟨shape.2, firstEntry.1, xy⟩⟩⟩⟩ + refine ⟨p, hp, q, hq, pFunction, qFunction, ?_, ?_, ?_, ?_, ?_⟩ + · intro i U V ip iq + exact ⟨fun y hy => ((pEntries i U ip y).1 hy).1, + fun x hx => ((qEntries i V iq x).1 hx).1⟩ + · intro y hy + obtain ⟨x, hx, xy⟩ := onto y hy + obtain ⟨j, hj, jx⟩ := coverX x hx + let indices : Set ZFSet.{u} := {i | i ∈ delta ∧ ZFSet.pair i y ∈ image} + have inhabited : indices.Nonempty := ⟨j, hj, (imageEntries j y).2 ⟨hj, hy, x, hx, jx, xy⟩⟩ + obtain ⟨i, hi, least⟩ := ZFSet.mem_wf.has_min indices inhabited + obtain ⟨U, ip⟩ := pFunction.total hi.1 + refine ⟨i, hi.1, U, ip, (pEntries i U ip y).2 ⟨hy, ?_⟩⟩ + exact (pair_mem_ordinalFirstRelation delta Y image i y).2 + ⟨hi.2, hi.1, hy, fun k ki entry => least k ⟨ordinal.1 i hi.1 k ki, entry⟩ ki⟩ + · intro i k U V y ip kp hy hy' + exact firstUnique i k y ((pEntries i U ip y).1 hy).2 ((pEntries k V kp y).1 hy').2 + · intro i k U V x iq kq hx hx' + obtain ⟨A, ip⟩ := pFunction.total (qFunction.pair_source iq) + obtain ⟨B, kp⟩ := pFunction.total (qFunction.pair_source kq) + obtain ⟨_, y, hy, xy⟩ := (sourceEntries i A U ip iq x).1 hx + obtain ⟨_, z, hz, xz⟩ := (sourceEntries k B V kp kq x).1 hx' + obtain ⟨v, _, unique⟩ := function.2 x ((qEntries i U iq x).1 hx).1 + have equal : z = y := (unique z xz).trans (unique y xy).symm + subst z + exact firstUnique i k y ((pEntries i A ip y).1 hy).2 ((pEntries k B kp y).1 hz).2 + · intro i U V ip iq + have hi := pFunction.pair_source ip + have hV : V ∈ N.sets := N.transitive (N.union_mem unions (N.union_mem unions hq)) + (pair_second_mem_doubleUnion iq) + have maps (x y : ZFSet.{u}) (hx : x ∈ V) (xy : ZFSet.pair x y ∈ f) : y ∈ U := by + obtain ⟨_, z, hz, xz⟩ := (sourceEntries i U V ip iq x).1 hx + obtain ⟨v, _, unique⟩ := function.2 x ((qEntries i V iq x).1 hx).1 + have equal : y = z := (unique y xy).trans (unique z xz).symm + exact equal.symm ▸ hz + refine ⟨?_, sourceEntries i U V ip iq, N.graphRestriction_mem unions separation hV hf, ?_, ?_⟩ + · intro y + rw [pEntries i U ip y] + constructor + · rintro ⟨hy, entry⟩ + have firstEntry := (pair_mem_ordinalFirstRelation delta Y image i y).1 entry + exact ⟨hy, ((imageEntries i y).1 firstEntry.1).2.2, + fun k ki witness => firstEntry.2.2.2 k ki + ((imageEntries k y).2 ⟨ordinal.1 i hi k ki, hy, witness⟩)⟩ + · rintro ⟨hy, witness, least⟩ + exact ⟨hy, (pair_mem_ordinalFirstRelation delta Y image i y).2 + ⟨(imageEntries i y).2 ⟨hi, hy, witness⟩, hi, hy, + fun k ki entry => least k ki ((imageEntries k y).1 entry).2.2⟩⟩ + · refine ⟨?_, ?_⟩ + · intro z hz + obtain ⟨x, hx, y, rfl, xy⟩ := mem_graphRestriction.1 hz + exact ZFSet.pair_mem_prod.2 ⟨hx, maps x y hx xy⟩ + · intro x hx + obtain ⟨y, xy, unique⟩ := function.2 x ((qEntries i V iq x).1 hx).1 + exact ⟨y, pair_mem_graphRestriction.2 ⟨xy, hx⟩, + fun z xz => unique z (pair_mem_graphRestriction.1 xz).1⟩ + · intro y hy + have firstEntry := ((pEntries i U ip y).1 hy).2 + obtain ⟨x, hx, ix, xy⟩ := ((imageEntries i y).1 + ((pair_mem_ordinalFirstRelation delta Y image i y).1 firstEntry).1).2.2 + have inV := (sourceEntries i U V ip iq x).2 ⟨ix, y, hy, xy⟩ + exact ⟨x, inV, pair_mem_graphRestriction.2 ⟨xy, inV⟩⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalOrderCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalOrderCodes.lean index 6dc43add50313583e6c81febbdac14e1cb965f4b..f93b3ba11fb06607705094c41d0b2c7a9bd3fa06 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalOrderCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalOrderCodes.lean @@ -1,269 +1,269 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -noncomputable def ordinalImageOrder (A N f : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ m ∈ N, ∃ n ∈ N, z = ZFSet.pair m n ∧ - ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y)) - (ZFSet.prod N N) - -theorem ordinalImageOrder_subset (A N f : ZFSet.{u}) : - ordinalImageOrder A N f ⊆ ZFSet.prod N N := fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem mem_ordinalImageOrder (A N f z : ZFSet.{u}) : - z ∈ ordinalImageOrder A N f ↔ ∃ m ∈ N, ∃ n ∈ N, z = ZFSet.pair m n ∧ - ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y) := by - rw [ordinalImageOrder, ZFSet.mem_sep] - exact ⟨And.right, fun h => ⟨by - obtain ⟨m, hm, n, hn, eq, _⟩ := h - exact eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨hm, hn⟩, h⟩⟩ - -theorem pair_mem_ordinalImageOrder {A N f : ZFSet.{u}} (injection : InjectionCode A N f) - (m n : ZFSet.{u}) : - ZFSet.pair m n ∈ ordinalImageOrder A N f ↔ - ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y) := by - rw [mem_ordinalImageOrder] - constructor - · rintro ⟨a, _, b, _, eq, witnesses⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact witnesses - · rintro ⟨x, hx, y, hy, xm, yn, order⟩ - exact ⟨m, (ZFSet.pair_mem_prod.1 (injection.function.1 xm)).2, - n, (ZFSet.pair_mem_prod.1 (injection.function.1 yn)).2, rfl, x, hx, y, hy, xm, yn, order⟩ - -structure OrdinalOrderCode (A N f r : ZFSet.{u}) : Prop where - ordinal : ordinalSetProperty A - injection : InjectionCode A N f - shape : r ⊆ ZFSet.prod N N - order : ∀ m n, ZFSet.pair m n ∈ r ↔ - ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y) - -theorem ordinalImageOrder_code {A N f : ZFSet.{u}} - (ordinal : ordinalSetProperty A) (injection : InjectionCode A N f) : - OrdinalOrderCode A N f (ordinalImageOrder A N f) := - ⟨ordinal, injection, ordinalImageOrder_subset A N f, pair_mem_ordinalImageOrder injection⟩ - -theorem OrdinalOrderCode.eq_image {A N f r : ZFSet.{u}} (code : OrdinalOrderCode A N f r) : - r = ordinalImageOrder A N f := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨m, _, n, _, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) - exact (pair_mem_ordinalImageOrder code.injection m n).2 ((code.order m n).1 hz) - · intro hz - obtain ⟨m, _, n, _, rfl⟩ := ZFSet.mem_prod.1 (ordinalImageOrder_subset A N f hz) - exact (code.order m n).2 ((pair_mem_ordinalImageOrder code.injection m n).1 hz) - -end PartitionPilot.Forcing - - -section - -namespace PartitionPilot.Forcing.OrdinalOrderCode - -universe u -variable {A B N f g r : ZFSet.{u}} - -theorem predecessor_exists (ha : OrdinalOrderCode A N f r) (hb : OrdinalOrderCode B N g r) - {x y m : ZFSet.{u}} (hx : x ∈ A) (hy : y ∈ B) - (fx : ZFSet.pair x m ∈ f) (gy : ZFSet.pair y m ∈ g) - (z : ZFSet.{u}) (hz : z ∈ x) : - ∃ w ∈ y, ∃ n, ZFSet.pair z n ∈ f ∧ ZFSet.pair w n ∈ g := by - have hzA : z ∈ A := ha.ordinal.1 x hx z hz - obtain ⟨n, fz, _⟩ := ha.injection.function.2 z hzA - have relation : ZFSet.pair n m ∈ r := - (ha.order n m).2 ⟨z, hzA, x, hx, fz, fx, Or.inr hz⟩ - obtain ⟨w, _, v, _, gw, gv, lower⟩ := (hb.order n m).1 relation - have vy : v = y := hb.injection.injective v y m gv gy - rw [vy] at lower - have different : w ≠ y := by - intro same - obtain ⟨k, _, unique⟩ := hb.injection.function.2 y hy - have nm : n = m := (unique n (same ▸ gw)).trans (unique m gy).symm - have zx : z = x := ha.injection.injective z x m (nm ▸ fz) fx - exact ZFSet.mem_irrefl x (zx ▸ hz) - exact ⟨w, lower.resolve_left different, n, fz, gw⟩ - -theorem matched_value_unique (ha : OrdinalOrderCode A N f r) (hb : OrdinalOrderCode B N g r) : - ∀ x ∈ A, ∀ y ∈ B, ∀ m, ZFSet.pair x m ∈ f → ZFSet.pair y m ∈ g → x = y := by - intro x - induction x using ZFSet.inductionOn with - | h x ih => - intro hx y hy m fx gy - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨w, hw, n, fz, gw⟩ := ha.predecessor_exists hb hx hy fx gy z hz - have same := ih z hz (ha.ordinal.1 x hx z hz) w (hb.ordinal.1 y hy w hw) n fz gw - exact same.symm ▸ hw - · intro hz - obtain ⟨w, hw, n, gz, fw⟩ := hb.predecessor_exists ha hy hx gy fx z hz - have same := ih w hw (ha.ordinal.1 x hx w hw) z (hb.ordinal.1 y hy z hz) n fw gz - exact same ▸ hw - -theorem domain_unique (ha : OrdinalOrderCode A N f r) (hb : OrdinalOrderCode B N g r) : A = B := by - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨m, fx, _⟩ := ha.injection.function.2 x hx - have diagonal : ZFSet.pair m m ∈ r := - (ha.order m m).2 ⟨x, hx, x, hx, fx, fx, Or.inl rfl⟩ - obtain ⟨y, hy, _, _, gy, _, _⟩ := (hb.order m m).1 diagonal - exact (ha.matched_value_unique hb x hx y hy m fx gy).symm ▸ hy - · intro hx - obtain ⟨m, gx, _⟩ := hb.injection.function.2 x hx - have diagonal : ZFSet.pair m m ∈ r := - (hb.order m m).2 ⟨x, hx, x, hx, gx, gx, Or.inl rfl⟩ - obtain ⟨y, hy, _, _, fy, _, _⟩ := (ha.order m m).1 diagonal - exact (hb.matched_value_unique ha x hx y hy m gx fy).symm ▸ hy - -end PartitionPilot.Forcing.OrdinalOrderCode - -namespace PartitionPilot.Forcing - -universe u - -theorem ordinalImageOrder_domain_unique {A B N f g : ZFSet.{u}} - (hA : ordinalSetProperty A) (hB : ordinalSetProperty B) - (hf : InjectionCode A N f) (hg : InjectionCode B N g) - (eq : ordinalImageOrder A N f = ordinalImageOrder B N g) : A = B := by - have right : OrdinalOrderCode B N g (ordinalImageOrder A N f) := - eq.symm ▸ ordinalImageOrder_code hB hg - exact (ordinalImageOrder_code hA hf).domain_unique right - -end PartitionPilot.Forcing - -end - - -namespace PartitionPilot.Forcing.BoundedFormula - -open SetFormula -universe u - -def ordinalImagePairFormula {k} (m n a f : Fin k) : BoundedFormula k := - exMem a (exMem a.succ (.conj (pairMembershipFormula 1 m.succ.succ f.succ.succ) - (.conj (pairMembershipFormula 0 n.succ.succ f.succ.succ) (disj (.equal 1 0) (.mem 1 0))))) - -theorem truth_ordinalImagePairFormula {k} (m n a f : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (ordinalImagePairFormula m n a f) env ↔ - ∃ x ∈ env a, ∃ y ∈ env a, ZFSet.pair x (env m) ∈ env f ∧ - ZFSet.pair y (env n) ∈ env f ∧ (x = y ∨ x ∈ y) := by - simp only [ordinalImagePairFormula, truth_exMem, Truth, truth_pairMembershipFormula, truth_disj] - rfl - -def ordinalImageEntryFormula {k} (z a n f : Fin k) : BoundedFormula k := - exMem n (exMem n.succ (.conj (orderedPairFormula z.succ.succ 1 0) - (ordinalImagePairFormula 1 0 a.succ.succ f.succ.succ))) - -theorem truth_ordinalImageEntryFormula {k} (z a n f : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (ordinalImageEntryFormula z a n f) env ↔ - env z ∈ ordinalImageOrder (env a) (env n) (env f) := by - simp only [ordinalImageEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_ordinalImagePairFormula] - exact (mem_ordinalImageOrder (env a) (env n) (env f) (env z)).symm - -def ordinalImageFormula {k} (r a n f : Fin k) : BoundedFormula k := - .conj (.allMem r (ordinalImageEntryFormula 0 a.succ n.succ f.succ)) - (.allMem n (.allMem n.succ (imp (ordinalImagePairFormula 1 0 a.succ.succ f.succ.succ) - (pairMembershipFormula 1 0 r.succ.succ)))) - -theorem truth_ordinalImageFormula {k} (r a n f : Fin k) (env : Fin k → ZFSet.{u}) : - Truth (ordinalImageFormula r a n f) env ↔ - env r = ordinalImageOrder (env a) (env n) (env f) := by - simp only [ordinalImageFormula, Truth, truth_ordinalImageEntryFormula, - truth_imp, truth_ordinalImagePairFormula, truth_pairMembershipFormula] - change ((∀ z ∈ env r, z ∈ ordinalImageOrder (env a) (env n) (env f)) ∧ - ∀ m ∈ env n, ∀ v ∈ env n, - (∃ x ∈ env a, ∃ y ∈ env a, ZFSet.pair x m ∈ env f ∧ - ZFSet.pair y v ∈ env f ∧ (x = y ∨ x ∈ y)) → ZFSet.pair m v ∈ env r) ↔ _ - constructor - · rintro ⟨subset, covers⟩ - apply ZFSet.ext - intro z - constructor - · exact subset z - · intro hz - obtain ⟨m, hm, n, hn, eq, witnesses⟩ := (mem_ordinalImageOrder _ _ _ z).1 hz - exact eq.symm ▸ covers m hm n hn witnesses - · intro eq - refine ⟨fun _ hz => eq ▸ hz, ?_⟩ - intro m hm n hn witnesses - rw [eq] - exact (mem_ordinalImageOrder _ _ _ _).2 ⟨m, hm, n, hn, rfl, witnesses⟩ - -end PartitionPilot.Forcing.BoundedFormula - -namespace PartitionPilot.Forcing.SetFormula - -def ordinalImageWitnessFormula : SetFormula 3 := - .conj (BoundedFormula.ordinalFormula 1).toFormula - (ex (.conj (BoundedFormula.injectionFormula 2 3 0).toFormula - (BoundedFormula.ordinalImageFormula 1 2 3 0).toFormula)) - -end PartitionPilot.Forcing.SetFormula - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem ordinalImageOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A N f : ZFSet.{u}} (hA : A ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) : - ordinalImageOrder A N f ∈ M.sets := by - let params := extend A (extend N (extend f Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.ordinalImageEntryFormula 0 1 2 3) params - (Fin.cases hA (Fin.cases hN (Fin.cases hf (fun j => Fin.elim0 j)))) - (M.prod_mem pairing unions powers separation hN hN) - have eq : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.ordinalImageEntryFormula 0 1 2 3) (extend z params)) (ZFSet.prod N N) = - ordinalImageOrder A N f := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, BoundedFormula.truth_ordinalImageEntryFormula] - exact ⟨And.right, fun hz => ⟨ordinalImageOrder_subset A N f hz, hz⟩⟩ - exact eq ▸ selected - -theorem realize_ordinalImageWitnessFormula {r A N : ZFSet.{u}} - (hr : r ∈ M.sets) (hA : A ∈ M.sets) (hN : N ∈ M.sets) : - Realize M.sets ordinalImageWitnessFormula (extend r (extend A (extend N Fin.elim0))) ↔ - ordinalSetProperty A ∧ ∃ f ∈ M.sets, - InjectionCode A N f ∧ r = ordinalImageOrder A N f := by - have members : ∀ j, (extend r (extend A (extend N Fin.elim0))) j ∈ M.sets := - Fin.cases hr (Fin.cases hA (Fin.cases hN (fun j => Fin.elim0 j))) - have ordinal : Realize M.sets (BoundedFormula.ordinalFormula 1).toFormula - (extend r (extend A (extend N Fin.elim0))) ↔ ordinalSetProperty A := - (BoundedFormula.realize_ordinalFormula M 1 _ members).trans (ordinalSetProperty_iff A).symm - change (Realize M.sets (BoundedFormula.ordinalFormula 1).toFormula _ ∧ - Realize M.sets (ex _) _) ↔ _ - rw [ordinal, realize_ex] - apply and_congr Iff.rfl - apply exists_congr - intro f - apply and_congr_right - intro hf - have extended : ∀ j, (extend f (extend r (extend A (extend N Fin.elim0)))) j ∈ M.sets := - Fin.cases hf members - change (Realize M.sets (BoundedFormula.injectionFormula 2 3 0).toFormula _ ∧ - Realize M.sets (BoundedFormula.ordinalImageFormula 1 2 3 0).toFormula _) ↔ _ - rw [BoundedFormula.realize_toFormula M _ _ extended, - BoundedFormula.realize_toFormula M _ _ extended, - BoundedFormula.truth_injectionFormula, BoundedFormula.truth_ordinalImageFormula] - rfl - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +noncomputable def ordinalImageOrder (A N f : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ m ∈ N, ∃ n ∈ N, z = ZFSet.pair m n ∧ + ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y)) + (ZFSet.prod N N) + +theorem ordinalImageOrder_subset (A N f : ZFSet.{u}) : + ordinalImageOrder A N f ⊆ ZFSet.prod N N := fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem mem_ordinalImageOrder (A N f z : ZFSet.{u}) : + z ∈ ordinalImageOrder A N f ↔ ∃ m ∈ N, ∃ n ∈ N, z = ZFSet.pair m n ∧ + ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y) := by + rw [ordinalImageOrder, ZFSet.mem_sep] + exact ⟨And.right, fun h => ⟨by + obtain ⟨m, hm, n, hn, eq, _⟩ := h + exact eq.symm ▸ ZFSet.pair_mem_prod.2 ⟨hm, hn⟩, h⟩⟩ + +theorem pair_mem_ordinalImageOrder {A N f : ZFSet.{u}} (injection : InjectionCode A N f) + (m n : ZFSet.{u}) : + ZFSet.pair m n ∈ ordinalImageOrder A N f ↔ + ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y) := by + rw [mem_ordinalImageOrder] + constructor + · rintro ⟨a, _, b, _, eq, witnesses⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact witnesses + · rintro ⟨x, hx, y, hy, xm, yn, order⟩ + exact ⟨m, (ZFSet.pair_mem_prod.1 (injection.function.1 xm)).2, + n, (ZFSet.pair_mem_prod.1 (injection.function.1 yn)).2, rfl, x, hx, y, hy, xm, yn, order⟩ + +structure OrdinalOrderCode (A N f r : ZFSet.{u}) : Prop where + ordinal : ordinalSetProperty A + injection : InjectionCode A N f + shape : r ⊆ ZFSet.prod N N + order : ∀ m n, ZFSet.pair m n ∈ r ↔ + ∃ x ∈ A, ∃ y ∈ A, ZFSet.pair x m ∈ f ∧ ZFSet.pair y n ∈ f ∧ (x = y ∨ x ∈ y) + +theorem ordinalImageOrder_code {A N f : ZFSet.{u}} + (ordinal : ordinalSetProperty A) (injection : InjectionCode A N f) : + OrdinalOrderCode A N f (ordinalImageOrder A N f) := + ⟨ordinal, injection, ordinalImageOrder_subset A N f, pair_mem_ordinalImageOrder injection⟩ + +theorem OrdinalOrderCode.eq_image {A N f r : ZFSet.{u}} (code : OrdinalOrderCode A N f r) : + r = ordinalImageOrder A N f := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨m, _, n, _, rfl⟩ := ZFSet.mem_prod.1 (code.shape hz) + exact (pair_mem_ordinalImageOrder code.injection m n).2 ((code.order m n).1 hz) + · intro hz + obtain ⟨m, _, n, _, rfl⟩ := ZFSet.mem_prod.1 (ordinalImageOrder_subset A N f hz) + exact (code.order m n).2 ((pair_mem_ordinalImageOrder code.injection m n).1 hz) + +end PartitionPilot.Forcing + + +section + +namespace PartitionPilot.Forcing.OrdinalOrderCode + +universe u +variable {A B N f g r : ZFSet.{u}} + +theorem predecessor_exists (ha : OrdinalOrderCode A N f r) (hb : OrdinalOrderCode B N g r) + {x y m : ZFSet.{u}} (hx : x ∈ A) (hy : y ∈ B) + (fx : ZFSet.pair x m ∈ f) (gy : ZFSet.pair y m ∈ g) + (z : ZFSet.{u}) (hz : z ∈ x) : + ∃ w ∈ y, ∃ n, ZFSet.pair z n ∈ f ∧ ZFSet.pair w n ∈ g := by + have hzA : z ∈ A := ha.ordinal.1 x hx z hz + obtain ⟨n, fz, _⟩ := ha.injection.function.2 z hzA + have relation : ZFSet.pair n m ∈ r := + (ha.order n m).2 ⟨z, hzA, x, hx, fz, fx, Or.inr hz⟩ + obtain ⟨w, _, v, _, gw, gv, lower⟩ := (hb.order n m).1 relation + have vy : v = y := hb.injection.injective v y m gv gy + rw [vy] at lower + have different : w ≠ y := by + intro same + obtain ⟨k, _, unique⟩ := hb.injection.function.2 y hy + have nm : n = m := (unique n (same ▸ gw)).trans (unique m gy).symm + have zx : z = x := ha.injection.injective z x m (nm ▸ fz) fx + exact ZFSet.mem_irrefl x (zx ▸ hz) + exact ⟨w, lower.resolve_left different, n, fz, gw⟩ + +theorem matched_value_unique (ha : OrdinalOrderCode A N f r) (hb : OrdinalOrderCode B N g r) : + ∀ x ∈ A, ∀ y ∈ B, ∀ m, ZFSet.pair x m ∈ f → ZFSet.pair y m ∈ g → x = y := by + intro x + induction x using ZFSet.inductionOn with + | h x ih => + intro hx y hy m fx gy + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨w, hw, n, fz, gw⟩ := ha.predecessor_exists hb hx hy fx gy z hz + have same := ih z hz (ha.ordinal.1 x hx z hz) w (hb.ordinal.1 y hy w hw) n fz gw + exact same.symm ▸ hw + · intro hz + obtain ⟨w, hw, n, gz, fw⟩ := hb.predecessor_exists ha hy hx gy fx z hz + have same := ih w hw (ha.ordinal.1 x hx w hw) z (hb.ordinal.1 y hy z hz) n fw gz + exact same ▸ hw + +theorem domain_unique (ha : OrdinalOrderCode A N f r) (hb : OrdinalOrderCode B N g r) : A = B := by + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨m, fx, _⟩ := ha.injection.function.2 x hx + have diagonal : ZFSet.pair m m ∈ r := + (ha.order m m).2 ⟨x, hx, x, hx, fx, fx, Or.inl rfl⟩ + obtain ⟨y, hy, _, _, gy, _, _⟩ := (hb.order m m).1 diagonal + exact (ha.matched_value_unique hb x hx y hy m fx gy).symm ▸ hy + · intro hx + obtain ⟨m, gx, _⟩ := hb.injection.function.2 x hx + have diagonal : ZFSet.pair m m ∈ r := + (hb.order m m).2 ⟨x, hx, x, hx, gx, gx, Or.inl rfl⟩ + obtain ⟨y, hy, _, _, fy, _, _⟩ := (ha.order m m).1 diagonal + exact (hb.matched_value_unique ha x hx y hy m gx fy).symm ▸ hy + +end PartitionPilot.Forcing.OrdinalOrderCode + +namespace PartitionPilot.Forcing + +universe u + +theorem ordinalImageOrder_domain_unique {A B N f g : ZFSet.{u}} + (hA : ordinalSetProperty A) (hB : ordinalSetProperty B) + (hf : InjectionCode A N f) (hg : InjectionCode B N g) + (eq : ordinalImageOrder A N f = ordinalImageOrder B N g) : A = B := by + have right : OrdinalOrderCode B N g (ordinalImageOrder A N f) := + eq.symm ▸ ordinalImageOrder_code hB hg + exact (ordinalImageOrder_code hA hf).domain_unique right + +end PartitionPilot.Forcing + +end + + +namespace PartitionPilot.Forcing.BoundedFormula + +open SetFormula +universe u + +def ordinalImagePairFormula {k} (m n a f : Fin k) : BoundedFormula k := + exMem a (exMem a.succ (.conj (pairMembershipFormula 1 m.succ.succ f.succ.succ) + (.conj (pairMembershipFormula 0 n.succ.succ f.succ.succ) (disj (.equal 1 0) (.mem 1 0))))) + +theorem truth_ordinalImagePairFormula {k} (m n a f : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (ordinalImagePairFormula m n a f) env ↔ + ∃ x ∈ env a, ∃ y ∈ env a, ZFSet.pair x (env m) ∈ env f ∧ + ZFSet.pair y (env n) ∈ env f ∧ (x = y ∨ x ∈ y) := by + simp only [ordinalImagePairFormula, truth_exMem, Truth, truth_pairMembershipFormula, truth_disj] + rfl + +def ordinalImageEntryFormula {k} (z a n f : Fin k) : BoundedFormula k := + exMem n (exMem n.succ (.conj (orderedPairFormula z.succ.succ 1 0) + (ordinalImagePairFormula 1 0 a.succ.succ f.succ.succ))) + +theorem truth_ordinalImageEntryFormula {k} (z a n f : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (ordinalImageEntryFormula z a n f) env ↔ + env z ∈ ordinalImageOrder (env a) (env n) (env f) := by + simp only [ordinalImageEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_ordinalImagePairFormula] + exact (mem_ordinalImageOrder (env a) (env n) (env f) (env z)).symm + +def ordinalImageFormula {k} (r a n f : Fin k) : BoundedFormula k := + .conj (.allMem r (ordinalImageEntryFormula 0 a.succ n.succ f.succ)) + (.allMem n (.allMem n.succ (imp (ordinalImagePairFormula 1 0 a.succ.succ f.succ.succ) + (pairMembershipFormula 1 0 r.succ.succ)))) + +theorem truth_ordinalImageFormula {k} (r a n f : Fin k) (env : Fin k → ZFSet.{u}) : + Truth (ordinalImageFormula r a n f) env ↔ + env r = ordinalImageOrder (env a) (env n) (env f) := by + simp only [ordinalImageFormula, Truth, truth_ordinalImageEntryFormula, + truth_imp, truth_ordinalImagePairFormula, truth_pairMembershipFormula] + change ((∀ z ∈ env r, z ∈ ordinalImageOrder (env a) (env n) (env f)) ∧ + ∀ m ∈ env n, ∀ v ∈ env n, + (∃ x ∈ env a, ∃ y ∈ env a, ZFSet.pair x m ∈ env f ∧ + ZFSet.pair y v ∈ env f ∧ (x = y ∨ x ∈ y)) → ZFSet.pair m v ∈ env r) ↔ _ + constructor + · rintro ⟨subset, covers⟩ + apply ZFSet.ext + intro z + constructor + · exact subset z + · intro hz + obtain ⟨m, hm, n, hn, eq, witnesses⟩ := (mem_ordinalImageOrder _ _ _ z).1 hz + exact eq.symm ▸ covers m hm n hn witnesses + · intro eq + refine ⟨fun _ hz => eq ▸ hz, ?_⟩ + intro m hm n hn witnesses + rw [eq] + exact (mem_ordinalImageOrder _ _ _ _).2 ⟨m, hm, n, hn, rfl, witnesses⟩ + +end PartitionPilot.Forcing.BoundedFormula + +namespace PartitionPilot.Forcing.SetFormula + +def ordinalImageWitnessFormula : SetFormula 3 := + .conj (BoundedFormula.ordinalFormula 1).toFormula + (ex (.conj (BoundedFormula.injectionFormula 2 3 0).toFormula + (BoundedFormula.ordinalImageFormula 1 2 3 0).toFormula)) + +end PartitionPilot.Forcing.SetFormula + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem ordinalImageOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A N f : ZFSet.{u}} (hA : A ∈ M.sets) (hN : N ∈ M.sets) (hf : f ∈ M.sets) : + ordinalImageOrder A N f ∈ M.sets := by + let params := extend A (extend N (extend f Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.ordinalImageEntryFormula 0 1 2 3) params + (Fin.cases hA (Fin.cases hN (Fin.cases hf (fun j => Fin.elim0 j)))) + (M.prod_mem pairing unions powers separation hN hN) + have eq : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.ordinalImageEntryFormula 0 1 2 3) (extend z params)) (ZFSet.prod N N) = + ordinalImageOrder A N f := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, BoundedFormula.truth_ordinalImageEntryFormula] + exact ⟨And.right, fun hz => ⟨ordinalImageOrder_subset A N f hz, hz⟩⟩ + exact eq ▸ selected + +theorem realize_ordinalImageWitnessFormula {r A N : ZFSet.{u}} + (hr : r ∈ M.sets) (hA : A ∈ M.sets) (hN : N ∈ M.sets) : + Realize M.sets ordinalImageWitnessFormula (extend r (extend A (extend N Fin.elim0))) ↔ + ordinalSetProperty A ∧ ∃ f ∈ M.sets, + InjectionCode A N f ∧ r = ordinalImageOrder A N f := by + have members : ∀ j, (extend r (extend A (extend N Fin.elim0))) j ∈ M.sets := + Fin.cases hr (Fin.cases hA (Fin.cases hN (fun j => Fin.elim0 j))) + have ordinal : Realize M.sets (BoundedFormula.ordinalFormula 1).toFormula + (extend r (extend A (extend N Fin.elim0))) ↔ ordinalSetProperty A := + (BoundedFormula.realize_ordinalFormula M 1 _ members).trans (ordinalSetProperty_iff A).symm + change (Realize M.sets (BoundedFormula.ordinalFormula 1).toFormula _ ∧ + Realize M.sets (ex _) _) ↔ _ + rw [ordinal, realize_ex] + apply and_congr Iff.rfl + apply exists_congr + intro f + apply and_congr_right + intro hf + have extended : ∀ j, (extend f (extend r (extend A (extend N Fin.elim0)))) j ∈ M.sets := + Fin.cases hf members + change (Realize M.sets (BoundedFormula.injectionFormula 2 3 0).toFormula _ ∧ + Realize M.sets (BoundedFormula.ordinalImageFormula 1 2 3 0).toFormula _) ↔ _ + rw [BoundedFormula.realize_toFormula M _ _ extended, + BoundedFormula.realize_toFormula M _ _ extended, + BoundedFormula.truth_injectionFormula, BoundedFormula.truth_ordinalImageFormula] + rfl + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalPartialMapCovers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalPartialMapCovers.lean index bfbc734710a542527d67eecb799360282a175c00..e787fb3327ee5c68539f155a0342ceb4173503f7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalPartialMapCovers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinalPartialMapCovers.lean @@ -1,69 +1,69 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProjectedRowChooserWitnesses - -namespace OAI - -open scoped ZFSet - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula Compression.RecursiveMaps -universe u -variable (M : TransitiveGround.{u}) {G P : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] - -theorem exists_ordinalPartialMapCover - (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) - {W f : ZFSet.{u}} (hW : W ∈ M.sets) (hf : f ∈ M.sets) - (function : FunctionGraphOn W f) (names : ∀ i, IsName s (function.value i)) - (fixed : ∀ g i, a.act s g ⟨function.value i, names i⟩ = ⟨function.value i, names i⟩) - (children : ∀ i, HereditarilySymmetric a s F ⟨function.value i, names i⟩) - (H : ConditionFilter P) (Trow X : ZFSet.{u}) - (partialMaps : ∀ i : W.toSet, - let hi := Name.eval {p | H.mem p} (⟨function.value i, names i⟩ : Name s) - PartialFunctionCode Trow (⋃₀ ⋃₀ hi) hi) - (covers : ∀ x ∈ X, ∃ i : W.toSet, ∃ u ∈ Trow, - ZFSet.pair u x ∈ Name.eval {p | H.mem p} (⟨function.value i, names i⟩ : Name s)) : - let N := M.symmetricExtension s a F H - ∃ delta ∈ N.sets, ordinalSetProperty delta ∧ - ∃ h ∈ N.sets, FunctionGraphOn delta h ∧ - (∀ i hi, ZFSet.pair i hi ∈ h → PartialFunctionCode Trow (⋃₀ ⋃₀ hi) hi) ∧ - ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ - ∃ u ∈ Trow, ZFSet.pair u x ∈ hi := by - intro N - obtain ⟨delta, hDelta, ordinal, q, _hq, qFunction, qNames, _fixed, _children, - forward, backward, sequences⟩ := M.exists_groundOrdinalFixedNameSequence s a F - pairing unions powers separation collection choice carrier hW hf function names fixed children - have sequenceData := sequences H - dsimp only at sequenceData - let sequence := Name.indexedGraphName (s := s) (⊤ : P) qFunction qNames - let h := Name.eval {p | H.mem p} sequence - have hFunction : FunctionGraphOn delta h := ⟨_, sequenceData.2.2.1⟩ - have groundSubset := M.ground_subset_symmetricExtension s a F - pairing unions powers separation collection carrier H - refine ⟨delta, groundSubset hDelta, ordinal, h, sequenceData.2.2.2, hFunction, ?_, ?_⟩ - · intro i hi entry - let j : delta.toSet := ⟨i, hFunction.pair_source entry⟩ - have value := (Name.pair_mem_eval_indexedTuple {p | H.mem p} (⊤ : P) H.top_mem delta - (fun j => ⟨qFunction.value j, qNames j⟩) j hi).1 entry - obtain ⟨k, same⟩ := backward j - have equal := (congrArg (Name.eval {p | H.mem p}) same).symm.trans value - exact Eq.mp (congrArg (fun v => PartialFunctionCode Trow (⋃₀ ⋃₀ v) v) equal) (partialMaps k) - · intro x member - obtain ⟨i, u, inRow, edge⟩ := covers x member - obtain ⟨j, same⟩ := forward i - let hi := Name.eval {p | H.mem p} (⟨qFunction.value j, qNames j⟩ : Name s) - refine ⟨j.val, j.property, hi, - (Name.pair_mem_eval_indexedTuple {p | H.mem p} (⊤ : P) H.top_mem delta - (fun j => ⟨qFunction.value j, qNames j⟩) j hi).2 rfl, u, inRow, ?_⟩ - exact Eq.mpr (congrArg (fun v => ZFSet.pair u x ∈ v) - (congrArg (Name.eval {p | H.mem p}) same)) edge - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProjectedRowChooserWitnesses + +namespace OAI + +open scoped ZFSet + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula Compression.RecursiveMaps +universe u +variable (M : TransitiveGround.{u}) {G P : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] + +theorem exists_ordinalPartialMapCover + (s : Presentation P) (a : PosetAction G P) (F : NormalSubgroupFamily G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) + {W f : ZFSet.{u}} (hW : W ∈ M.sets) (hf : f ∈ M.sets) + (function : FunctionGraphOn W f) (names : ∀ i, IsName s (function.value i)) + (fixed : ∀ g i, a.act s g ⟨function.value i, names i⟩ = ⟨function.value i, names i⟩) + (children : ∀ i, HereditarilySymmetric a s F ⟨function.value i, names i⟩) + (H : ConditionFilter P) (Trow X : ZFSet.{u}) + (partialMaps : ∀ i : W.toSet, + let hi := Name.eval {p | H.mem p} (⟨function.value i, names i⟩ : Name s) + PartialFunctionCode Trow (⋃₀ ⋃₀ hi) hi) + (covers : ∀ x ∈ X, ∃ i : W.toSet, ∃ u ∈ Trow, + ZFSet.pair u x ∈ Name.eval {p | H.mem p} (⟨function.value i, names i⟩ : Name s)) : + let N := M.symmetricExtension s a F H + ∃ delta ∈ N.sets, ordinalSetProperty delta ∧ + ∃ h ∈ N.sets, FunctionGraphOn delta h ∧ + (∀ i hi, ZFSet.pair i hi ∈ h → PartialFunctionCode Trow (⋃₀ ⋃₀ hi) hi) ∧ + ∀ x ∈ X, ∃ i ∈ delta, ∃ hi, ZFSet.pair i hi ∈ h ∧ + ∃ u ∈ Trow, ZFSet.pair u x ∈ hi := by + intro N + obtain ⟨delta, hDelta, ordinal, q, _hq, qFunction, qNames, _fixed, _children, + forward, backward, sequences⟩ := M.exists_groundOrdinalFixedNameSequence s a F + pairing unions powers separation collection choice carrier hW hf function names fixed children + have sequenceData := sequences H + dsimp only at sequenceData + let sequence := Name.indexedGraphName (s := s) (⊤ : P) qFunction qNames + let h := Name.eval {p | H.mem p} sequence + have hFunction : FunctionGraphOn delta h := ⟨_, sequenceData.2.2.1⟩ + have groundSubset := M.ground_subset_symmetricExtension s a F + pairing unions powers separation collection carrier H + refine ⟨delta, groundSubset hDelta, ordinal, h, sequenceData.2.2.2, hFunction, ?_, ?_⟩ + · intro i hi entry + let j : delta.toSet := ⟨i, hFunction.pair_source entry⟩ + have value := (Name.pair_mem_eval_indexedTuple {p | H.mem p} (⊤ : P) H.top_mem delta + (fun j => ⟨qFunction.value j, qNames j⟩) j hi).1 entry + obtain ⟨k, same⟩ := backward j + have equal := (congrArg (Name.eval {p | H.mem p}) same).symm.trans value + exact Eq.mp (congrArg (fun v => PartialFunctionCode Trow (⋃₀ ⋃₀ v) v) equal) (partialMaps k) + · intro x member + obtain ⟨i, u, inRow, edge⟩ := covers x member + obtain ⟨j, same⟩ := forward i + let hi := Name.eval {p | H.mem p} (⟨qFunction.value j, qNames j⟩ : Name s) + refine ⟨j.val, j.property, hi, + (Name.pair_mem_eval_indexedTuple {p | H.mem p} (⊤ : P) H.top_mem delta + (fun j => ⟨qFunction.value j, qNames j⟩) j hi).2 rfl, u, inRow, ?_⟩ + exact Eq.mpr (congrArg (fun v => ZFSet.pair u x ∈ v) + (congrArg (Name.eval {p | H.mem p}) same)) edge + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinaryCountableFunctions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinaryCountableFunctions.lean index 315a0b1f4879fb4ace1c953eaab717272d740b27..c5da0e7eac45d16bdcbc6938221c05874c318d71 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinaryCountableFunctions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundOrdinaryCountableFunctions.lean @@ -1,106 +1,106 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundSequenceReflection -open SetFormula -universe u -variable {M N : TransitiveGround.{u}} {U : ZFSet.{u}} - -theorem countable_domain_function (reflection : GroundSequenceReflection M N U) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) - (unionsN : Realize N.sets SetFormula.union Fin.elim0) - (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) - (included : M.sets ⊆ N.sets) {A f : ZFSet.{u}} - (hA : A ∈ M.sets) (hU : U ∈ M.sets) - (small : M.groundEmbeddable A ZFSet.omega) - (hf : f ∈ N.sets) (function : ZFSet.IsFunc A U f) : f ∈ M.sets := by - classical - by_cases nonempty : A.Nonempty - · obtain ⟨e, he, enumeration, onto⟩ := M.groundCountable_enumeration - pairing unions powers separation infinite hA nonempty small - have omega := M.omega_mem separation infinite - let sequence := relationCompose ZFSet.omega A U e f - have sequenceFunction : ZFSet.IsFunc ZFSet.omega U sequence := - relationCompose_function_of_subset enumeration function (fun _ member => member) - have sequenceGround := reflection sequence - (N.relationCompose_mem pairingN unionsN powersN separationN - (included omega) (included hA) (included hU) (included he) hf) sequenceFunction - have recovered : relationCompose A ZFSet.omega U - (relationConverse ZFSet.omega A e) sequence = f := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨a, ha, n, hn, v, _, rfl, inverse, value⟩ := - (mem_relationCompose _ _ _ _ _ z).1 member - have na := ((pair_mem_relationConverse ZFSet.omega A e n a).1 inverse).2.2 - obtain ⟨_, _, a', _, na', av⟩ := (pair_mem_relationCompose _ _ _ _ _ n v).1 value - obtain ⟨x, _, unique⟩ := enumeration.2 n hn - have equal : a' = a := (unique a' na').trans (unique a na).symm - exact equal ▸ av - · intro member - obtain ⟨a, ha, v, hv, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) - obtain ⟨n, hn, entry⟩ := onto a ha - exact (pair_mem_relationCompose _ _ _ _ _ a v).2 - ⟨ha, hv, n, hn, (pair_mem_relationConverse ZFSet.omega A e n a).2 ⟨hn, ha, entry⟩, - (pair_mem_relationCompose _ _ _ _ _ n v).2 ⟨hn, hv, a, ha, entry, member⟩⟩ - rw [← recovered] - exact M.relationCompose_mem pairing unions powers separation hA omega hU - (M.relationConverse_mem pairing unions powers separation omega hA he) sequenceGround - · have empty : f = ∅ := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨a, ha, _, _, _⟩ := ZFSet.mem_prod.1 (function.1 member) - exact False.elim (nonempty ⟨a, ha⟩) - · intro member - exact False.elim (ZFSet.notMem_empty z member) - rw [empty] - exact M.empty_mem ⟨A, hA⟩ - -end PartitionPilot.Forcing.GroundSequenceReflection - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] -variable (s : Presentation P) - -theorem ordinaryExtension_countableDomainFunction_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (small : M.sets.Countable) {A U : ZFSet.{u}} (hA : A ∈ M.sets) (hU : U ∈ M.sets) - (domainSmall : M.groundEmbeddable A ZFSet.omega) - (closed : InternallyCountablyClosed M s) - (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) - (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) - {f : ZFSet.{u}} (hf : f ∈ (M.ordinaryExtension s H).sets) - (function : ZFSet.IsFunc A U f) : f ∈ M.sets := by - have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation - collection infinite choice carrier order small hU closed H genericCoded genericFormula - have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order - infinite H genericFormula - exact reflection.countable_domain_function pairing unions powers separation infinite - zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 zf.2.1 - (M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H) - hA hU domainSmall hf function - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOrdinarySubmodelReflection + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundSequenceReflection +open SetFormula +universe u +variable {M N : TransitiveGround.{u}} {U : ZFSet.{u}} + +theorem countable_domain_function (reflection : GroundSequenceReflection M N U) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (pairingN : Realize N.sets SetFormula.pairing Fin.elim0) + (unionsN : Realize N.sets SetFormula.union Fin.elim0) + (powersN : Realize N.sets powerSet Fin.elim0) (separationN : SeparationSchema N.sets) + (included : M.sets ⊆ N.sets) {A f : ZFSet.{u}} + (hA : A ∈ M.sets) (hU : U ∈ M.sets) + (small : M.groundEmbeddable A ZFSet.omega) + (hf : f ∈ N.sets) (function : ZFSet.IsFunc A U f) : f ∈ M.sets := by + classical + by_cases nonempty : A.Nonempty + · obtain ⟨e, he, enumeration, onto⟩ := M.groundCountable_enumeration + pairing unions powers separation infinite hA nonempty small + have omega := M.omega_mem separation infinite + let sequence := relationCompose ZFSet.omega A U e f + have sequenceFunction : ZFSet.IsFunc ZFSet.omega U sequence := + relationCompose_function_of_subset enumeration function (fun _ member => member) + have sequenceGround := reflection sequence + (N.relationCompose_mem pairingN unionsN powersN separationN + (included omega) (included hA) (included hU) (included he) hf) sequenceFunction + have recovered : relationCompose A ZFSet.omega U + (relationConverse ZFSet.omega A e) sequence = f := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨a, ha, n, hn, v, _, rfl, inverse, value⟩ := + (mem_relationCompose _ _ _ _ _ z).1 member + have na := ((pair_mem_relationConverse ZFSet.omega A e n a).1 inverse).2.2 + obtain ⟨_, _, a', _, na', av⟩ := (pair_mem_relationCompose _ _ _ _ _ n v).1 value + obtain ⟨x, _, unique⟩ := enumeration.2 n hn + have equal : a' = a := (unique a' na').trans (unique a na).symm + exact equal ▸ av + · intro member + obtain ⟨a, ha, v, hv, rfl⟩ := ZFSet.mem_prod.1 (function.1 member) + obtain ⟨n, hn, entry⟩ := onto a ha + exact (pair_mem_relationCompose _ _ _ _ _ a v).2 + ⟨ha, hv, n, hn, (pair_mem_relationConverse ZFSet.omega A e n a).2 ⟨hn, ha, entry⟩, + (pair_mem_relationCompose _ _ _ _ _ n v).2 ⟨hn, hv, a, ha, entry, member⟩⟩ + rw [← recovered] + exact M.relationCompose_mem pairing unions powers separation hA omega hU + (M.relationConverse_mem pairing unions powers separation omega hA he) sequenceGround + · have empty : f = ∅ := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨a, ha, _, _, _⟩ := ZFSet.mem_prod.1 (function.1 member) + exact False.elim (nonempty ⟨a, ha⟩) + · intro member + exact False.elim (ZFSet.notMem_empty z member) + rw [empty] + exact M.empty_mem ⟨A, hA⟩ + +end PartitionPilot.Forcing.GroundSequenceReflection + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [PartialOrder P] [OrderTop P] +variable (s : Presentation P) + +theorem ordinaryExtension_countableDomainFunction_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (small : M.sets.Countable) {A U : ZFSet.{u}} (hA : A ∈ M.sets) (hU : U ∈ M.sets) + (domainSmall : M.groundEmbeddable A ZFSet.omega) + (closed : InternallyCountablyClosed M s) + (H : ConditionFilter P) (genericCoded : H.GenericFor (M.codedFamily s)) + (genericFormula : H.GenericFor (formulaFamily (M.nameDomain s))) + {f : ZFSet.{u}} (hf : f ∈ (M.ordinaryExtension s H).sets) + (function : ZFSet.IsFunc A U f) : f ∈ M.sets := by + have reflection := M.ordinaryExtension_sequenceReflection s pairing unions powers separation + collection infinite choice carrier order small hU closed H genericCoded genericFormula + have zf := M.ordinaryExtension_ZF s pairing unions powers separation collection carrier order + infinite H genericFormula + exact reflection.countable_domain_function pairing unions powers separation infinite + zf.1.2.2.2.1 zf.1.2.2.2.2.1 zf.1.2.2.2.2.2.1 zf.2.1 + (M.ground_subset_ordinaryExtension s pairing unions powers separation collection carrier H) + hA hU domainSmall hf function + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRankedSerializedChronology.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRankedSerializedChronology.lean index 64a3811c5c2c2437efa8990ae72287c8c65b2241..820cfe49aa4e1b233537ac242fb983698c1aae41 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRankedSerializedChronology.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRankedSerializedChronology.lean @@ -1,53 +1,53 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRankedLayerSelection -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerializedBoundNormalization -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerializedCandidateLevels - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundChronologyFields -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {T C D rD K : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) - -theorem exists_rankedSerialization - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (hT : T ∈ K) (level : GroundMainCandidateLevel M K) - (ordinal : ordinalSetProperty T) - (core : ChronologyCoreCode T fields.bound C D rD fields.graph) - (graphs : ∀ j, ZFSet.rank (fields.graph j) < ZFSet.rank K) - (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → - ∃ z ∈ M.sets, ZFSet.rank z < ZFSet.rank K ∧ - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) : - ∃ serial : GroundSerializedChronology M T C D rD, - serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ - serial.code ∈ level.validChronologies C D rD ∧ - serial.fields.graph = fields.graph ∧ - (∀ j s, serial.fields.value j s = fields.value j s) ∧ - serial.layerBound = functionGraphRange (chronologyPairs T) serial.layers := by - obtain ⟨layers, hLayers, function, layerRank, codes⟩ := - fields.choose_rankedLayerGraph pairing unions powers separation collection infinite choice - hK conditions hT level.carrier_ground level.membership core rawWitnesses - let selected : GroundSerializedChronology M T C D rD := - ⟨fields, ordinal, core, level.carrier, level.carrier_ground, layers, hLayers, function, codes⟩ - let serial := selected.normalizeBounds pairing unions powers separation - have rank : ZFSet.rank serial.code < ZFSet.rank K := - selected.normalizeBounds_code_rank_lt pairing unions powers separation - (conditions.rank_isLimit pairing unions powers separation infinite hK) - (ZFSet.rank_lt_of_mem hT) graphs layerRank - exact ⟨serial, serial.code_ground pairing, rank, - level.ranked_mem_validChronologies pairing serial rank, rfl, fun _ _ => rfl, rfl⟩ - -end PartitionPilot.Forcing.GroundChronologyFields - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRankedLayerSelection +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerializedBoundNormalization +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundSerializedCandidateLevels + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundChronologyFields +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {T C D rD K : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) + +theorem exists_rankedSerialization + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (hT : T ∈ K) (level : GroundMainCandidateLevel M K) + (ordinal : ordinalSetProperty T) + (core : ChronologyCoreCode T fields.bound C D rD fields.graph) + (graphs : ∀ j, ZFSet.rank (fields.graph j) < ZFSet.rank K) + (rawWitnesses : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → + ∃ z ∈ M.sets, ZFSet.rank z < ZFSet.rank K ∧ + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z) : + ∃ serial : GroundSerializedChronology M T C D rD, + serial.code ∈ M.sets ∧ ZFSet.rank serial.code < ZFSet.rank K ∧ + serial.code ∈ level.validChronologies C D rD ∧ + serial.fields.graph = fields.graph ∧ + (∀ j s, serial.fields.value j s = fields.value j s) ∧ + serial.layerBound = functionGraphRange (chronologyPairs T) serial.layers := by + obtain ⟨layers, hLayers, function, layerRank, codes⟩ := + fields.choose_rankedLayerGraph pairing unions powers separation collection infinite choice + hK conditions hT level.carrier_ground level.membership core rawWitnesses + let selected : GroundSerializedChronology M T C D rD := + ⟨fields, ordinal, core, level.carrier, level.carrier_ground, layers, hLayers, function, codes⟩ + let serial := selected.normalizeBounds pairing unions powers separation + have rank : ZFSet.rank serial.code < ZFSet.rank K := + selected.normalizeBounds_code_rank_lt pairing unions powers separation + (conditions.rank_isLimit pairing unions powers separation infinite hK) + (ZFSet.rank_lt_of_mem hT) graphs layerRank + exact ⟨serial, serial.code_ground pairing, rank, + level.ranked_mem_validChronologies pairing serial rank, rfl, fun _ _ => rfl, rfl⟩ + +end PartitionPilot.Forcing.GroundChronologyFields + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawFinitePowerStageSystems.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawFinitePowerStageSystems.lean index 994c4655fb02d7bd6a2fb7a2d95dd6081724b499..86b0d3dffac3c09f5d7b3e88075a8085be262635 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawFinitePowerStageSystems.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawFinitePowerStageSystems.lean @@ -1,56 +1,56 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementFinitePowerSystems - -namespace OAI - -section - -namespace PartitionPilot.Forcing.RawRefinementStageWitness -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {G L : Type u} [Group G] [PartialOrder L] -variable {t : Presentation G} {b : Presentation L} {d : PosetAction G L} -variable {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} -variable {T T2 level P order top action : ZFSet.{u}} - -theorem finitePower_systems (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : P ∈ M.sets) (groundOrder : order ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) (hT : T ∈ M.sets) : - ∃ (orderLaw : PartialOrderCode P order) (topMem : top ∈ P) - (greatest : ∀ p ∈ P, ZFSet.pair p top ∈ order), - letI := orderLaw.toPartialOrder - letI := orderLaw.toOrderTop top topMem greatest - ∃ e : PosetAction G (SetMembers P), - e.actionGraph (SetMembers.presentation P) t = action ∧ - RefinementStageSystem M e (SetMembers.presentation P) t b d base directed level T T2 ∧ - ∀ n : Nat, let X := iteratedPairNameFamily top T n - ∃ valid : ∀ z ∈ X, IsName (SetMembers.presentation P) z, - X ∈ M.sets ∧ - (∀ g (tau : Name (SetMembers.presentation P)), tau.val ∈ X → - (e.act (SetMembers.presentation P) g tau).val ∈ X) ∧ - (∀ tau : Name (SetMembers.presentation P), tau.val ∈ X → - HereditarilySymmetric e (SetMembers.presentation P) (d.principalSupportFamily base directed) tau) ∧ - NiceNameSystem M e (SetMembers.presentation P) b d base directed X valid := by - obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness - let := orderLaw.toPartialOrder - let := orderLaw.toOrderTop top topMem greatest - refine ⟨orderLaw, topMem, greatest, e, graph, system, ?_⟩ - intro n - have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by - rw [orderLaw.conditionOrder_eq] - exact groundOrder - have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem - have power := system.finitePower_system pairing unions powers separation collection - carrier nextOrder group nodes supports hT n - simpa only [topEq] using power - -end PartitionPilot.Forcing.RawRefinementStageWitness - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementFinitePowerSystems + +namespace OAI + +section + +namespace PartitionPilot.Forcing.RawRefinementStageWitness +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {G L : Type u} [Group G] [PartialOrder L] +variable {t : Presentation G} {b : Presentation L} {d : PosetAction G L} +variable {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} +variable {T T2 level P order top action : ZFSet.{u}} + +theorem finitePower_systems (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : P ∈ M.sets) (groundOrder : order ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) (hT : T ∈ M.sets) : + ∃ (orderLaw : PartialOrderCode P order) (topMem : top ∈ P) + (greatest : ∀ p ∈ P, ZFSet.pair p top ∈ order), + letI := orderLaw.toPartialOrder + letI := orderLaw.toOrderTop top topMem greatest + ∃ e : PosetAction G (SetMembers P), + e.actionGraph (SetMembers.presentation P) t = action ∧ + RefinementStageSystem M e (SetMembers.presentation P) t b d base directed level T T2 ∧ + ∀ n : Nat, let X := iteratedPairNameFamily top T n + ∃ valid : ∀ z ∈ X, IsName (SetMembers.presentation P) z, + X ∈ M.sets ∧ + (∀ g (tau : Name (SetMembers.presentation P)), tau.val ∈ X → + (e.act (SetMembers.presentation P) g tau).val ∈ X) ∧ + (∀ tau : Name (SetMembers.presentation P), tau.val ∈ X → + HereditarilySymmetric e (SetMembers.presentation P) (d.principalSupportFamily base directed) tau) ∧ + NiceNameSystem M e (SetMembers.presentation P) b d base directed X valid := by + obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness + let := orderLaw.toPartialOrder + let := orderLaw.toOrderTop top topMem greatest + refine ⟨orderLaw, topMem, greatest, e, graph, system, ?_⟩ + intro n + have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by + rw [orderLaw.conditionOrder_eq] + exact groundOrder + have topEq : (SetMembers.presentation P).encode ⊤ = top := SetMembers.raw_ofMem top topMem + have power := system.finitePower_system pairing unions powers separation collection + carrier nextOrder group nodes supports hT n + simpa only [topEq] using power + +end PartitionPilot.Forcing.RawRefinementStageWitness + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawRefinementStageZF.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawRefinementStageZF.lean index e1fd12ffe348efcad81122553ce8c8a3a3eb9af7..b1c2f710314a66608cf095af2982407684bd9e53 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawRefinementStageZF.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRawRefinementStageZF.lean @@ -1,69 +1,69 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable {G L : Type u} [Group G] [PartialOrder L] - -def RawRefinementStageZF (M : TransitiveGround.{u}) - (t : Presentation G) (b : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 level P order top action : ZFSet.{u}) : Prop := - ∃ (orderLaw : PartialOrderCode P order) (topMem : top ∈ P) - (greatest : ∀ p ∈ P, ZFSet.pair p top ∈ order), - letI := orderLaw.toPartialOrder - letI := orderLaw.toOrderTop top topMem greatest - ∃ e : PosetAction G (SetMembers P), - e.actionGraph (SetMembers.presentation P) t = action ∧ - RefinementStageSystem M e (SetMembers.presentation P) t b d base directed level T T2 ∧ - let s := SetMembers.presentation P - let F := d.principalSupportFamily base directed - ∀ p : SetMembers P, ∃ H : ConditionFilter (SetMembers P), - H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ - H.GenericFor (formulaFamily (M.nameDomain s)) ∧ - H.GenericFor (formulaFamily (e.symmetricDomain s (M.nameDomain s) F)) ∧ - M.sets ⊆ (e.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ - ZFRealization ((e.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) - -namespace RawRefinementStageWitness -variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} -variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} -variable {T T2 level P order top action : ZFSet.{u}} -variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) - -include witness - -theorem symmetricZF - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (small : M.sets.Countable) - (carrier : P ∈ M.sets) (groundOrder : order ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) : - RawRefinementStageZF M t b d base directed T T2 level P order top action := by - obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness - let := orderLaw.toPartialOrder - let := orderLaw.toOrderTop top topMem greatest - have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by - rw [orderLaw.conditionOrder_eq] - exact groundOrder - refine ⟨orderLaw, topMem, greatest, e, graph, system, ?_⟩ - dsimp only - intro p - exact M.exists_ZF_interpretation e (SetMembers.presentation P) t b - (d.principalSupportFamily base directed) d.principalFix - (d.principalSupportFamily_basis base directed) small pairing unions powers separation collection infinite - carrier nextOrder group nodes supports system.inputs.condition_maps p - -end RawRefinementStageWitness -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable {G L : Type u} [Group G] [PartialOrder L] + +def RawRefinementStageZF (M : TransitiveGround.{u}) + (t : Presentation G) (b : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 level P order top action : ZFSet.{u}) : Prop := + ∃ (orderLaw : PartialOrderCode P order) (topMem : top ∈ P) + (greatest : ∀ p ∈ P, ZFSet.pair p top ∈ order), + letI := orderLaw.toPartialOrder + letI := orderLaw.toOrderTop top topMem greatest + ∃ e : PosetAction G (SetMembers P), + e.actionGraph (SetMembers.presentation P) t = action ∧ + RefinementStageSystem M e (SetMembers.presentation P) t b d base directed level T T2 ∧ + let s := SetMembers.presentation P + let F := d.principalSupportFamily base directed + ∀ p : SetMembers P, ∃ H : ConditionFilter (SetMembers P), + H.mem p ∧ H.GenericFor (M.codedFamily s) ∧ + H.GenericFor (formulaFamily (M.nameDomain s)) ∧ + H.GenericFor (formulaFamily (e.symmetricDomain s (M.nameDomain s) F)) ∧ + M.sets ⊆ (e.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q} ∧ + ZFRealization ((e.symmetricDomain s (M.nameDomain s) F).values {q | H.mem q}) + +namespace RawRefinementStageWitness +variable {M : TransitiveGround.{u}} {t : Presentation G} {b : Presentation L} +variable {d : PosetAction G L} {base : L} {directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z} +variable {T T2 level P order top action : ZFSet.{u}} +variable (witness : RawRefinementStageWitness M t b d base directed T T2 level P order top action) + +include witness + +theorem symmetricZF + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (small : M.sets.Countable) + (carrier : P ∈ M.sets) (groundOrder : order ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) : + RawRefinementStageZF M t b d base directed T T2 level P order top action := by + obtain ⟨orderLaw, topMem, greatest, e, graph, system⟩ := witness + let := orderLaw.toPartialOrder + let := orderLaw.toOrderTop top topMem greatest + have nextOrder : (SetMembers.presentation P).conditionOrder ∈ M.sets := by + rw [orderLaw.conditionOrder_eq] + exact groundOrder + refine ⟨orderLaw, topMem, greatest, e, graph, system, ?_⟩ + dsimp only + intro p + exact M.exists_ZF_interpretation e (SetMembers.presentation P) t b + (d.principalSupportFamily base directed) d.principalFix + (d.principalSupportFamily_basis base directed) small pairing unions powers separation collection infinite + carrier nextOrder group nodes supports system.inputs.condition_maps p + +end RawRefinementStageWitness +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveOriginalRowFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveOriginalRowFamilies.lean index 0155dc90ad0ce59e73b14863c04ea813e014d3c2..6c3ea118afcb7a0342dda3098063775e6f818225 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveOriginalRowFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveOriginalRowFamilies.lean @@ -1,48 +1,48 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveRowNameActions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) -variable {T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) -variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) -local notation "upper" => SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history) -local notation "inclusion" => M.refinementHistoryRowInclusion c run ordinal carrier - -theorem refinementHistory_originalRowFamily_eq (X : ZFSet.{u}) - (valid : ∀ z ∈ X, IsName c z) : - Name.renamedFamily upper inclusion X valid = Name.renamedFamily c.pairEmpty id X valid := by - have codes (tau : Name c) : - (Name.rename upper inclusion tau).val = (Name.rename c.pairEmpty id tau).val := by - have unchanged := M.refinementHistoryRowNameLift_val c run ordinal carrier - (Name.rename c.pairEmpty id tau) - change (Name.rename upper inclusion (Name.rename c.pairEmpty id tau)).val = _ at unchanged - rw [Name.rename_comp] at unchanged - exact unchanged - apply ZFSet.ext - intro z - rw [Name.mem_renamedFamily, Name.mem_renamedFamily] - exact ⟨fun ⟨tau, member, equal⟩ => ⟨tau, member, equal.trans (codes tau)⟩, - fun ⟨tau, member, equal⟩ => ⟨tau, member, equal.trans (codes tau).symm⟩⟩ - -theorem refinementHistory_originalRowFamilySet_eq - (one : SetMembers (M.refinementHistoryForcing c.carrier T stages history)) - (X : ZFSet.{u}) (valid : ∀ z ∈ X, IsName c z) - (validDirect : ∀ z ∈ Name.renamedFamily upper inclusion X valid, IsName upper z) - (validPairEmpty : ∀ z ∈ Name.renamedFamily c.pairEmpty id X valid, IsName upper z) : - Name.familySet one (Name.renamedFamily upper inclusion X valid) validDirect = - Name.familySet one (Name.renamedFamily c.pairEmpty id X valid) validPairEmpty := by - apply Subtype.ext - rw [Name.familySet_code, Name.familySet_code, - M.refinementHistory_originalRowFamily_eq c run ordinal carrier] - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveRowNameActions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R : Type u} (c : Presentation R) +variable {T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) +variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) +local notation "upper" => SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history) +local notation "inclusion" => M.refinementHistoryRowInclusion c run ordinal carrier + +theorem refinementHistory_originalRowFamily_eq (X : ZFSet.{u}) + (valid : ∀ z ∈ X, IsName c z) : + Name.renamedFamily upper inclusion X valid = Name.renamedFamily c.pairEmpty id X valid := by + have codes (tau : Name c) : + (Name.rename upper inclusion tau).val = (Name.rename c.pairEmpty id tau).val := by + have unchanged := M.refinementHistoryRowNameLift_val c run ordinal carrier + (Name.rename c.pairEmpty id tau) + change (Name.rename upper inclusion (Name.rename c.pairEmpty id tau)).val = _ at unchanged + rw [Name.rename_comp] at unchanged + exact unchanged + apply ZFSet.ext + intro z + rw [Name.mem_renamedFamily, Name.mem_renamedFamily] + exact ⟨fun ⟨tau, member, equal⟩ => ⟨tau, member, equal.trans (codes tau)⟩, + fun ⟨tau, member, equal⟩ => ⟨tau, member, equal.trans (codes tau).symm⟩⟩ + +theorem refinementHistory_originalRowFamilySet_eq + (one : SetMembers (M.refinementHistoryForcing c.carrier T stages history)) + (X : ZFSet.{u}) (valid : ∀ z ∈ X, IsName c z) + (validDirect : ∀ z ∈ Name.renamedFamily upper inclusion X valid, IsName upper z) + (validPairEmpty : ∀ z ∈ Name.renamedFamily c.pairEmpty id X valid, IsName upper z) : + Name.familySet one (Name.renamedFamily upper inclusion X valid) validDirect = + Name.familySet one (Name.renamedFamily c.pairEmpty id X valid) validPairEmpty := by + apply Subtype.ext + rw [Name.familySet_code, Name.familySet_code, + M.refinementHistory_originalRowFamily_eq c run ordinal carrier] + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementBinaryUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementBinaryUnions.lean index da8bd3373f22e3d776c521891e6ea2c95186d863..bc2e838ec4823e603d306c0142e046812898f7eb 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementBinaryUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementBinaryUnions.lean @@ -1,587 +1,587 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundForcingHistoryOrders -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementVisibleLiftInsertions - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -structure RecursiveRefinementDataHistory (M : TransitiveGround.{u}) - (rows T stages history : ZFSet.{u}) : Prop where - data : RefinementDataHistory stages history T - carrier : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - d 7 = M.refinementHistoryForcing rows T beta (graphRestriction beta history) - -namespace RecursiveRefinementDataHistory -variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M rows T stages history) -include run - -theorem carrier_entry {beta Q : ZFSet.{u}} - (entry : ZFSet.pair beta Q ∈ refinementDataHistoryField stages history 7) : - Q = M.refinementHistoryForcing rows T beta (graphRestriction beta history) := by - obtain ⟨_, d, packed, rfl⟩ := (pair_mem_refinementDataHistoryField stages history beta Q 7).1 entry - exact run.carrier beta d packed - -theorem cut_mem {row A : ZFSet.{u}} - (member : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) - {beta : ZFSet.{u}} (hbeta : beta ∈ stages) : - ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) beta A) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history) := by - have checked := ((M.mem_refinementHistoryForcing rows T stages history _).1 member).2 - obtain ⟨code, entry, d, equal, tests⟩ := checked beta hbeta - rw [equal] at entry - have lower := (stageTwoConditionCode_pair_iff M d _ beta row A).1 tests |>.1 - exact run.carrier beta d entry ▸ lower - -theorem restrict {earlier : ZFSet.{u}} (ordinal : ordinalSetProperty earlier) - (subset : earlier ⊆ stages) : - RecursiveRefinementDataHistory M rows T earlier (graphRestriction earlier history) := by - refine ⟨run.data.restrict subset, ?_⟩ - intro beta d entry - have packed := (pair_mem_graphRestriction.1 entry).1 - have hbeta := (pair_mem_graphRestriction.1 entry).2 - rw [graphRestriction_restrict (ordinal.1 beta hbeta)] - exact run.carrier beta d packed - -end RecursiveRefinementDataHistory - - - - -namespace RecursiveRefinementDataHistory -variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M rows T stages history) -include run - -theorem condition_iff_cuts (ordinal : ordinalSetProperty stages) - (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) (row A : ZFSet.{u}) : - ForcingHistoryConditionCode M stages history (refinementDataHistoryLevels stages history T) - (ZFSet.pair row A) ↔ - FlatHistoryCuts stages (refinementDataHistoryField stages history 7) - (refinementDataHistoryLevels stages history T) row A := by - constructor - · intro valid - exact ((forcingHistoryConditionCode_pair_decomposition run.data.function run.data.decoded row A).1 valid).1 - · intro cuts beta hbeta - obtain ⟨code, entry⟩ := run.data.function.total hbeta - obtain ⟨d, rfl⟩ := run.data.decoded beta code entry - have hNext := successors beta hbeta - have nextSubset := ordinal.1 (insert beta beta) hNext - have below : beta ⊆ insert beta beta := fun _ member => ZFSet.mem_insert_of_mem beta member - obtain ⟨Q, qEntry, member⟩ := cuts (insert beta beta) hNext - rw [run.carrier_entry qEntry] at member - have prefixValid := ((M.mem_refinementHistoryForcing rows T (insert beta beta) - (graphRestriction (insert beta beta) history) _).1 member).2 - have prefixEntry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ - graphRestriction (insert beta beta) history := - pair_mem_graphRestriction.2 ⟨entry, ZFSet.mem_insert _ _⟩ - have current := (forcingHistoryConditionCode_lookup_iff - (run.data.function.restrict nextSubset)).1 prefixValid beta (ZFSet.mem_insert _ _) - (refinementFormulaDataCode d) prefixEntry - have currentGlobal := (packedSuccessorConditionCode_levels_congr M - (refinementDataHistoryLevels (insert beta beta) (graphRestriction (insert beta beta) history) T) - (refinementDataHistoryLevels stages history T) beta (refinementFormulaDataCode d) - (ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) (insert beta beta) A)) - (fun B => run.data.prefix_cut nextSubset below B)).1 current - have covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - ∃ xi ∈ insert beta beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ - refinementDataHistoryLevels stages history T := by - intro t ht u hu w hw - exact ⟨beta, ZFSet.mem_insert _ _, run.data.coverage beta hbeta d entry t ht u hu w hw⟩ - exact ⟨refinementFormulaDataCode d, entry, - (packedSuccessorConditionCode_cut_iff M d (refinementDataHistoryLevels stages history T) - beta (insert beta beta) row A below covered).1 currentGlobal⟩ - -theorem limit_eq (ordinal : ordinalSetProperty stages) - (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) : - M.refinementHistoryForcing rows T stages history = - M.flatLimitConditions rows (refinementDataHistoryIndices stages history) T stages - (refinementDataHistoryField stages history 7) (refinementDataHistoryLevels stages history T) := by - apply ZFSet.ext - intro z - rw [M.mem_refinementHistoryForcing, M.mem_flatLimitConditions] - apply and_congr_right - intro candidate - obtain ⟨row, _, A, _, _, _, equal⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 candidate - rw [equal, flatLimitConditionCode_pair] - exact run.condition_iff_cuts ordinal successors row A - -end RecursiveRefinementDataHistory - - - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem forcingHistoryConditions_levels_congr (rows I T stages history first second : ZFSet.{u}) - (cuts : ∀ beta ∈ stages, ∀ A, assignmentCut first beta A = assignmentCut second beta A) : - M.forcingHistoryConditions rows I T stages history first = - M.forcingHistoryConditions rows I T stages history second := by - apply ZFSet.ext - intro z - rw [M.mem_forcingHistoryConditions, M.mem_forcingHistoryConditions] - exact and_congr Iff.rfl (forcingHistoryConditionCode_levels_congr M stages history first second z cuts) - -end TransitiveGround -namespace RecursiveRefinementDataHistory -variable {M : TransitiveGround.{u}} {rows T alpha history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M rows T alpha history) -include run - -theorem append (ordinal : ordinalSetProperty alpha) (d : Fin 15 → ZFSet.{u}) - (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) - (lower : d 7 = M.refinementHistoryForcing rows T alpha history) : - RecursiveRefinementDataHistory M rows T (insert alpha alpha) - (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) := by - refine ⟨run.data.append (ZFSet.mem_irrefl alpha) d terms literal, ?_⟩ - intro beta fields entry - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal - have same := refinementFormulaDataCode_injective code - rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl beta), run.data.function.restriction_eq] - exact (congrFun same 7).trans lower - · have hbeta := run.data.function.pair_source old - have outside : alpha ∉ beta := fun member => - ZFSet.mem_irrefl alpha (ordinal.1 beta hbeta alpha member) - rw [graphRestriction_insert_of_not_mem outside] - exact run.carrier beta fields old - -theorem successor_eq (ordinal : ordinalSetProperty alpha) (d : Fin 15 → ZFSet.{u}) - (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) - (lower : d 7 = M.refinementHistoryForcing rows T alpha history) : - let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history - M.refinementHistoryForcing rows T (insert alpha alpha) next = - M.stageTwoConditions rows (refinementDataHistoryIndices (insert alpha alpha) next) - (refinementDataHistoryLevels (insert alpha alpha) next T) alpha d := by - let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history - let levels := refinementDataHistoryLevels (insert alpha alpha) next T - let oldI := refinementDataHistoryIndices alpha history - have extended := run.append ordinal d terms literal lower - have subset : alpha ⊆ insert alpha alpha := fun _ member => ZFSet.mem_insert_of_mem alpha member - have prefixHistory : graphRestriction alpha next = history := by - rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl alpha), run.data.function.restriction_eq] - have cuts : ∀ beta ∈ alpha, ∀ A, - assignmentCut (refinementDataHistoryLevels alpha history T) beta A = assignmentCut levels beta A := by - intro beta hbeta A - have equal := extended.data.prefix_cut subset (ordinal.1 beta hbeta) A - rw [prefixHistory] at equal - exact equal - have lowerGlobal : d 7 = M.forcingHistoryConditions rows oldI (d 6) alpha history levels := by - calc - d 7 = M.refinementHistoryForcing rows T alpha history := lower - _ = M.forcingHistoryConditions rows oldI T alpha history levels := - M.forcingHistoryConditions_levels_congr rows oldI T alpha history _ levels cuts - _ = M.forcingHistoryConditions rows oldI (d 6) alpha history levels := by rw [terms] - have coverage : ForcingHistoryLevelCoverage alpha history levels := by - intro beta hbeta fields entry t ht u hu w hw - exact extended.data.coverage beta (ZFSet.mem_insert_of_mem alpha hbeta) fields - (ZFSet.mem_insert_of_mem _ entry) t ht u hu w hw - simpa only [terms, TransitiveGround.refinementHistoryForcing, levels, next] using - (M.forcingHistoryConditions_successor_eq rows oldI (refinementDataHistoryIndices (insert alpha alpha) next) - alpha history levels d run.data.function ordinal coverage lowerGlobal) - -end RecursiveRefinementDataHistory -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.RecursiveRefinementDataHistory -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows T alpha history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M rows T alpha history) -include run - -theorem successor_insert_extension - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (ordinal : ordinalSetProperty alpha) (d : Fin 15 → ZFSet.{u}) - (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) - (lower : d 7 = M.refinementHistoryForcing rows T alpha history) - (hI : d 0 ∈ M.sets) (hT : T ∈ M.sets) - (rowOrder : ZFSet.{u}) (rowOrderLaw : PartialOrderCode rows rowOrder) - {row A t u w : ZFSet.{u}} (index : t ∈ d 0) (first : u ∈ T) (second : w ∈ T) : - let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history - let levels := refinementDataHistoryLevels (insert alpha alpha) next T - let P := M.refinementHistoryForcing rows T (insert alpha alpha) next - ZFSet.pair row A ∈ P → - stageOneRawSingle M d t u w (ZFSet.pair row (assignmentCut levels alpha A)) → - (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t v u z w (ZFSet.pair row (assignmentCut levels alpha A))) → - (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment t v z ∈ A → - stageOneRawCollision M d t u v w z (ZFSet.pair row (assignmentCut levels alpha A))) → - stageOneRawCollision M d t u u w w (ZFSet.pair row (assignmentCut levels alpha A)) → - ZFSet.pair row (insert (stageOneAssignment t u w) A) ∈ P ∧ - assignmentCut levels alpha (insert (stageOneAssignment t u w) A) = - assignmentCut levels alpha A ∧ - ZFSet.pair (ZFSet.pair row (insert (stageOneAssignment t u w) A)) (ZFSet.pair row A) ∈ - M.refinementHistoryOrder rows rowOrder T (insert alpha alpha) next := by - dsimp only - intro member single old_new new_old self - let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history - have extended := run.append ordinal d terms literal lower - have stored : ZFSet.pair alpha (refinementFormulaDataCode d) ∈ next := ZFSet.mem_insert _ _ - have level := extended.data.coverage alpha (ZFSet.mem_insert alpha alpha) d stored - t index u (terms.symm ▸ first) w (terms.symm ▸ second) - have function : ZFSet.IsFunc - (stageOneAssignments (refinementDataHistoryIndices (insert alpha alpha) next) (d 6)) - (insert alpha alpha) (refinementDataHistoryLevels (insert alpha alpha) next T) := by - simpa only [terms] using extended.data.levels_function - have ground := M.stageOneAssignment_mem pairing (M.transitive hI index) - (M.transitive hT first) (M.transitive hT second) - have successor := run.successor_eq ordinal d terms literal lower - have flat := successor ▸ member - have result := M.stageTwoConditions_insert pairing unions powers separation infinite d - function level ground flat single - (fun v hv z hz old => old_new v (terms ▸ hv) z (terms ▸ hz) old) - (fun v hv z hz old => new_old v (terms ▸ hv) z (terms ▸ hz) old) self - have inserted := successor.symm ▸ result.1 - have candidate := ((M.mem_refinementHistoryForcing rows T (insert alpha alpha) next _).1 member).1 - have rowMember := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate).1 - refine ⟨inserted, result.2, ?_⟩ - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T (insert alpha alpha) next _ _ _ _).2 - ⟨inserted, member, rowOrderLaw.refl row rowMember, fun _ h => ZFSet.mem_insert_of_mem _ h⟩ - -end PartitionPilot.Forcing.RecursiveRefinementDataHistory - - - -namespace PartitionPilot.Forcing -universe u - -structure RecursiveRefinementOrderHistory (M : TransitiveGround.{u}) - (rows rowOrder T stages history : ZFSet.{u}) : Prop where - carriers : RecursiveRefinementDataHistory M rows T stages history - order : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - d 8 = M.refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - -namespace RecursiveRefinementDataHistory -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} - -theorem cut_order (run : RecursiveRefinementDataHistory M rows T stages history) - {q A p D beta : ZFSet.{u}} - (below : ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ - M.refinementHistoryOrder rows rowOrder T stages history) (hbeta : beta ∈ stages) : - ZFSet.pair (ZFSet.pair q (assignmentCut (refinementDataHistoryLevels stages history T) beta A)) - (ZFSet.pair p (assignmentCut (refinementDataHistoryLevels stages history T) beta D)) ∈ - M.refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) := by - obtain ⟨hq, hp, rowsBelow, data⟩ := (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history q A p D).1 below - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) _ _ _ _).2 - ⟨run.cut_mem hq hbeta, run.cut_mem hp hbeta, rowsBelow, assignmentCut_mono data⟩ - -end RecursiveRefinementDataHistory -namespace RecursiveRefinementOrderHistory -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -include run - -theorem lower_order {q A p D beta : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) - (below : ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ - M.refinementHistoryOrder rows rowOrder T stages history) : - ZFSet.pair (ZFSet.pair q (assignmentCut (refinementDataHistoryLevels stages history T) beta A)) - (ZFSet.pair p (assignmentCut (refinementDataHistoryLevels stages history T) beta D)) ∈ d 8 := - (run.order beta d entry).symm ▸ run.carriers.cut_order below (run.carriers.data.function.pair_source entry) - -theorem restrict {earlier : ZFSet.{u}} (ordinal : ordinalSetProperty earlier) - (subset : earlier ⊆ stages) : - RecursiveRefinementOrderHistory M rows rowOrder T earlier (graphRestriction earlier history) := by - refine ⟨run.carriers.restrict ordinal subset, ?_⟩ - intro beta d entry - have packed := (pair_mem_graphRestriction.1 entry).1 - have hbeta := (pair_mem_graphRestriction.1 entry).2 - rw [graphRestriction_restrict (ordinal.1 beta hbeta)] - exact run.order beta d packed - -theorem append (ordinal : ordinalSetProperty stages) (d : Fin 15 → ZFSet.{u}) - (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) stages) - (lower : d 7 = M.refinementHistoryForcing rows T stages history) - (lowerOrder : d 8 = M.refinementHistoryOrder rows rowOrder T stages history) : - RecursiveRefinementOrderHistory M rows rowOrder T (insert stages stages) - (insert (ZFSet.pair stages (refinementFormulaDataCode d)) history) := by - refine ⟨run.carriers.append ordinal d terms literal lower, ?_⟩ - intro beta fields entry - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal - have same := refinementFormulaDataCode_injective code - rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl beta), run.carriers.data.function.restriction_eq] - exact (congrFun same 8).trans lowerOrder - · have hbeta := run.carriers.data.function.pair_source old - have outside : stages ∉ beta := fun member => - ZFSet.mem_irrefl stages (ordinal.1 beta hbeta stages member) - rw [graphRestriction_insert_of_not_mem outside] - exact run.order beta fields old - -end RecursiveRefinementOrderHistory - - - - - -namespace FunctionGraphOn - -theorem restriction_successor_entry {stages history alpha value : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (entry : ZFSet.pair alpha value ∈ history) : - graphRestriction (Insert.insert alpha alpha) history = - Insert.insert (ZFSet.pair alpha value) (graphRestriction alpha history) := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨beta, hbeta, code, rfl, stored⟩ := mem_graphRestriction.1 member - rcases ZFSet.mem_insert_iff.1 hbeta with equal | before - · subst beta - have same := function.unique stored entry - exact ZFSet.mem_insert_iff.2 (Or.inl (congrArg (ZFSet.pair alpha) same)) - · exact ZFSet.mem_insert_of_mem _ (pair_mem_graphRestriction.2 ⟨stored, before⟩) - · intro member - rcases ZFSet.mem_insert_iff.1 member with equal | before - · rw [equal] - exact pair_mem_graphRestriction.2 ⟨entry, ZFSet.mem_insert alpha alpha⟩ - · obtain ⟨beta, hbeta, code, rfl, stored⟩ := mem_graphRestriction.1 before - exact pair_mem_graphRestriction.2 ⟨stored, ZFSet.mem_insert_of_mem alpha hbeta⟩ - -end FunctionGraphOn - -namespace RecursiveRefinementDataHistory -open SetFormula -variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M rows T stages history) -include run - -theorem stored_successor_eq (ordinal : ordinalSetProperty stages) - {alpha : ZFSet.{u}} (member : alpha ∈ stages) (fields : Fin 15 → ZFSet.{u}) - (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) : - let next := graphRestriction (insert alpha alpha) history - M.refinementHistoryForcing rows T (insert alpha alpha) next = - M.stageTwoConditions rows (refinementDataHistoryIndices (insert alpha alpha) next) - (refinementDataHistoryLevels (insert alpha alpha) next T) alpha fields := by - dsimp only - rw [run.data.function.restriction_successor_entry stored] - exact (run.restrict (ordinalSetProperty_member ordinal member) (ordinal.1 alpha member)).successor_eq - (ordinalSetProperty_member ordinal member) fields (run.data.terms alpha fields stored) - (run.data.literal alpha fields stored) (run.carrier alpha fields stored) - -theorem stored_successor_insert_extension - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (ordinal : ordinalSetProperty stages) {alpha : ZFSet.{u}} (member : alpha ∈ stages) - (fields : Fin 15 → ZFSet.{u}) - (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) - (hI : fields 0 ∈ M.sets) (hT : T ∈ M.sets) - (rowOrder : ZFSet.{u}) (rowOrderLaw : PartialOrderCode rows rowOrder) - {row A idx u w : ZFSet.{u}} (index : idx ∈ fields 0) (first : u ∈ T) (second : w ∈ T) : - let next := graphRestriction (insert alpha alpha) history - let levels := refinementDataHistoryLevels (insert alpha alpha) next T - let P := M.refinementHistoryForcing rows T (insert alpha alpha) next - ZFSet.pair row A ∈ P → - stageOneRawSingle M fields idx u w (ZFSet.pair row (assignmentCut levels alpha A)) → - (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment idx v z ∈ A → - stageOneRawCollision M fields idx v u z w (ZFSet.pair row (assignmentCut levels alpha A))) → - (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment idx v z ∈ A → - stageOneRawCollision M fields idx u v w z (ZFSet.pair row (assignmentCut levels alpha A))) → - stageOneRawCollision M fields idx u u w w (ZFSet.pair row (assignmentCut levels alpha A)) → - ZFSet.pair row (insert (stageOneAssignment idx u w) A) ∈ P ∧ - assignmentCut levels alpha (insert (stageOneAssignment idx u w) A) = - assignmentCut levels alpha A ∧ - ZFSet.pair (ZFSet.pair row (insert (stageOneAssignment idx u w) A)) (ZFSet.pair row A) ∈ - M.refinementHistoryOrder rows rowOrder T (insert alpha alpha) next := by - dsimp only - rw [run.data.function.restriction_successor_entry stored] - exact (run.restrict (ordinalSetProperty_member ordinal member) (ordinal.1 alpha member)).successor_insert_extension - pairing unions powers separation infinite (ordinalSetProperty_member ordinal member) fields - (run.data.terms alpha fields stored) (run.data.literal alpha fields stored) - (run.carrier alpha fields stored) hI hT rowOrder rowOrderLaw index first second - -end RecursiveRefinementDataHistory -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable {row A B : ZFSet.{u}} -local notation "levels" => refinementDataHistoryLevels stages history T -include run - -theorem binary_union_mem_of_candidates (ordinal : ordinalSetProperty stages) - (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ C lower stronger, stageOneRawTests M d C lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) - (first : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) - (second : ZFSet.pair row B ∈ M.refinementHistoryForcing rows T stages history) - (rowSelf : ZFSet.pair row row ∈ rowOrder) (agreement : AssignmentIndexAgreement A B) - (candidate : ZFSet.pair row (A ∪ B) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) - (candidates : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ - M.stageOneCandidateBound rows - (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : - ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history := by - have subsetA : A ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inl h) - have subsetB : B ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inr h) - have firstTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).2 - have secondTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).2 - have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) - (proved : ZFSet.pair row (assignmentCut levels beta (A ∪ B)) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : - stageOneRawTests M d (A ∪ B) (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) := by - have storedA := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 firstTests - beta hbeta (refinementFormulaDataCode d) entry - have checkedA := (stageTwoConditionCode_pair_iff M d _ beta row A).1 - ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedA) - have storedB := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 secondTests - beta hbeta (refinementFormulaDataCode d) entry - have checkedB := (stageTwoConditionCode_pair_iff M d _ beta row B).1 - ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedB) - have belowA : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) - (ZFSet.pair row (assignmentCut levels beta A)) ∈ d 8 := by - rw [run.order beta d entry] - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - _ _ _ _).2 ⟨proved, run.carriers.cut_mem first hbeta, rowSelf, assignmentCut_mono subsetA⟩ - have belowB : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) - (ZFSet.pair row (assignmentCut levels beta B)) ∈ d 8 := by - rw [run.order beta d entry] - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - _ _ _ _).2 ⟨proved, run.carriers.cut_mem second hbeta, rowSelf, assignmentCut_mono subsetB⟩ - exact stageOneRawTests_binary_union M d agreement - (mono beta d entry A _ _ checkedA.2 belowA) (mono beta d entry B _ _ checkedB.2 belowB) - have earlier : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ - M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by - intro gamma - induction gamma using ZFSet.inductionOn with - | h gamma ih => - intro hgamma - apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 - refine ⟨candidates gamma hgamma, ?_⟩ - intro beta hbeta - have betaFull := ordinal.1 gamma hgamma beta hbeta - have betaSubset := ordinal.2 gamma hgamma beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - have proved := ih beta hbeta betaFull - have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset - (assignmentCut levels gamma (A ∪ B)) - refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 - rw [sameCut, assignmentCut_nested betaSubset] - refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ - exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) - (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma (A ∪ B) member) - apply (M.mem_refinementHistoryForcing rows T stages history _).2 - refine ⟨candidate, ?_⟩ - intro beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - refine ⟨refinementFormulaDataCode d, entry, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 - exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, - step beta hbeta d entry (earlier beta hbeta)⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - - - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -include run - -theorem tests_at_valid_larger_cut - {beta row sourceRow A largerA : ZFSet.{u}} (fields : Fin 15 → ZFSet.{u}) - (stored : ZFSet.pair beta (refinementFormulaDataCode fields) ∈ history) - (mono : ∀ C lower stronger, stageOneRawTests M fields C lower → - ZFSet.pair stronger lower ∈ fields 8 → stageOneRawTests M fields C stronger) - (source : ZFSet.pair sourceRow A ∈ M.refinementHistoryForcing rows T stages history) - (rowBelow : ZFSet.pair row sourceRow ∈ rowOrder) (subset : A ⊆ largerA) - (validCut : ZFSet.pair row - (assignmentCut (refinementDataHistoryLevels stages history T) beta largerA) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : - let levels := refinementDataHistoryLevels stages history T - let stronger := ZFSet.pair row (assignmentCut levels beta largerA) - let old := ZFSet.pair sourceRow (assignmentCut levels beta A) - ZFSet.pair stronger old ∈ fields 8 ∧ stageOneRawTests M fields A stronger := by - have member := run.carriers.data.function.pair_source stored - have originalTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 source).2 - have storedTests := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 originalTests - beta member (refinementFormulaDataCode fields) stored - have checked := (stageTwoConditionCode_pair_iff M fields _ beta sourceRow A).1 - ((packedSuccessorConditionCode_code_iff M _ beta fields _).1 storedTests) - have below : ZFSet.pair - (ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) beta largerA)) - (ZFSet.pair sourceRow (assignmentCut (refinementDataHistoryLevels stages history T) beta A)) ∈ fields 8 := by - rw [run.order beta fields stored] - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - _ _ _ _).2 ⟨validCut, run.carriers.cut_mem source member, rowBelow, assignmentCut_mono subset⟩ - exact ⟨below, mono A _ _ checked.2 below⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - - - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -include run pairing unions powers separation infinite choice hStages hHistory hT - -theorem binary_union_extension (ordinal : ordinalSetProperty stages) - (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ C lower stronger, stageOneRawTests M d C lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) - (rowOrderLaw : PartialOrderCode rows rowOrder) {row A B : ZFSet.{u}} - (first : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) - (second : ZFSet.pair row B ∈ M.refinementHistoryForcing rows T stages history) - (agreement : AssignmentIndexAgreement A B) : - ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history ∧ - ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair row A) ∈ - M.refinementHistoryOrder rows rowOrder T stages history ∧ - ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair row B) ∈ - M.refinementHistoryOrder rows rowOrder T stages history := by - have firstCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).1 - have secondCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).1 - obtain ⟨hrow, hA, subsetA, smallA⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 firstCandidate - obtain ⟨_, hB, subsetB, smallB⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 secondCandidate - have rowSelf := rowOrderLaw.refl row hrow - have candidate : ZFSet.pair row (A ∪ B) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by - apply (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 - refine ⟨hrow, M.binary_union_mem pairing unions hA hB, ?_, - M.groundCountable_binary_union pairing unions powers separation infinite choice hA hB smallA smallB⟩ - intro z member - exact (ZFSet.mem_union.1 member).elim (fun h => subsetA h) (fun h => subsetB h) - have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT - have member := run.binary_union_mem_of_candidates ordinal mono first second rowSelf agreement candidate - (fun beta hbeta => M.refinementDataHistoryCandidate_cut separation run.carriers.data - (ordinal.1 beta hbeta) hLevels (M.transitive hStages hbeta) (M.omega_mem separation infinite) candidate) - refine ⟨member, ?_, ?_⟩ - · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 - ⟨member, first, rowSelf, fun _ h => ZFSet.mem_union.2 (Or.inl h)⟩ - · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 - ⟨member, second, rowSelf, fun _ h => ZFSet.mem_union.2 (Or.inr h)⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundForcingHistoryOrders +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementVisibleLiftInsertions + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +structure RecursiveRefinementDataHistory (M : TransitiveGround.{u}) + (rows T stages history : ZFSet.{u}) : Prop where + data : RefinementDataHistory stages history T + carrier : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + d 7 = M.refinementHistoryForcing rows T beta (graphRestriction beta history) + +namespace RecursiveRefinementDataHistory +variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M rows T stages history) +include run + +theorem carrier_entry {beta Q : ZFSet.{u}} + (entry : ZFSet.pair beta Q ∈ refinementDataHistoryField stages history 7) : + Q = M.refinementHistoryForcing rows T beta (graphRestriction beta history) := by + obtain ⟨_, d, packed, rfl⟩ := (pair_mem_refinementDataHistoryField stages history beta Q 7).1 entry + exact run.carrier beta d packed + +theorem cut_mem {row A : ZFSet.{u}} + (member : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) + {beta : ZFSet.{u}} (hbeta : beta ∈ stages) : + ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) beta A) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history) := by + have checked := ((M.mem_refinementHistoryForcing rows T stages history _).1 member).2 + obtain ⟨code, entry, d, equal, tests⟩ := checked beta hbeta + rw [equal] at entry + have lower := (stageTwoConditionCode_pair_iff M d _ beta row A).1 tests |>.1 + exact run.carrier beta d entry ▸ lower + +theorem restrict {earlier : ZFSet.{u}} (ordinal : ordinalSetProperty earlier) + (subset : earlier ⊆ stages) : + RecursiveRefinementDataHistory M rows T earlier (graphRestriction earlier history) := by + refine ⟨run.data.restrict subset, ?_⟩ + intro beta d entry + have packed := (pair_mem_graphRestriction.1 entry).1 + have hbeta := (pair_mem_graphRestriction.1 entry).2 + rw [graphRestriction_restrict (ordinal.1 beta hbeta)] + exact run.carrier beta d packed + +end RecursiveRefinementDataHistory + + + + +namespace RecursiveRefinementDataHistory +variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M rows T stages history) +include run + +theorem condition_iff_cuts (ordinal : ordinalSetProperty stages) + (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) (row A : ZFSet.{u}) : + ForcingHistoryConditionCode M stages history (refinementDataHistoryLevels stages history T) + (ZFSet.pair row A) ↔ + FlatHistoryCuts stages (refinementDataHistoryField stages history 7) + (refinementDataHistoryLevels stages history T) row A := by + constructor + · intro valid + exact ((forcingHistoryConditionCode_pair_decomposition run.data.function run.data.decoded row A).1 valid).1 + · intro cuts beta hbeta + obtain ⟨code, entry⟩ := run.data.function.total hbeta + obtain ⟨d, rfl⟩ := run.data.decoded beta code entry + have hNext := successors beta hbeta + have nextSubset := ordinal.1 (insert beta beta) hNext + have below : beta ⊆ insert beta beta := fun _ member => ZFSet.mem_insert_of_mem beta member + obtain ⟨Q, qEntry, member⟩ := cuts (insert beta beta) hNext + rw [run.carrier_entry qEntry] at member + have prefixValid := ((M.mem_refinementHistoryForcing rows T (insert beta beta) + (graphRestriction (insert beta beta) history) _).1 member).2 + have prefixEntry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ + graphRestriction (insert beta beta) history := + pair_mem_graphRestriction.2 ⟨entry, ZFSet.mem_insert _ _⟩ + have current := (forcingHistoryConditionCode_lookup_iff + (run.data.function.restrict nextSubset)).1 prefixValid beta (ZFSet.mem_insert _ _) + (refinementFormulaDataCode d) prefixEntry + have currentGlobal := (packedSuccessorConditionCode_levels_congr M + (refinementDataHistoryLevels (insert beta beta) (graphRestriction (insert beta beta) history) T) + (refinementDataHistoryLevels stages history T) beta (refinementFormulaDataCode d) + (ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) (insert beta beta) A)) + (fun B => run.data.prefix_cut nextSubset below B)).1 current + have covered : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + ∃ xi ∈ insert beta beta, ZFSet.pair (stageOneAssignment t u w) xi ∈ + refinementDataHistoryLevels stages history T := by + intro t ht u hu w hw + exact ⟨beta, ZFSet.mem_insert _ _, run.data.coverage beta hbeta d entry t ht u hu w hw⟩ + exact ⟨refinementFormulaDataCode d, entry, + (packedSuccessorConditionCode_cut_iff M d (refinementDataHistoryLevels stages history T) + beta (insert beta beta) row A below covered).1 currentGlobal⟩ + +theorem limit_eq (ordinal : ordinalSetProperty stages) + (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) : + M.refinementHistoryForcing rows T stages history = + M.flatLimitConditions rows (refinementDataHistoryIndices stages history) T stages + (refinementDataHistoryField stages history 7) (refinementDataHistoryLevels stages history T) := by + apply ZFSet.ext + intro z + rw [M.mem_refinementHistoryForcing, M.mem_flatLimitConditions] + apply and_congr_right + intro candidate + obtain ⟨row, _, A, _, _, _, equal⟩ := (M.mem_stageOneCandidateBound _ _ _ _).1 candidate + rw [equal, flatLimitConditionCode_pair] + exact run.condition_iff_cuts ordinal successors row A + +end RecursiveRefinementDataHistory + + + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem forcingHistoryConditions_levels_congr (rows I T stages history first second : ZFSet.{u}) + (cuts : ∀ beta ∈ stages, ∀ A, assignmentCut first beta A = assignmentCut second beta A) : + M.forcingHistoryConditions rows I T stages history first = + M.forcingHistoryConditions rows I T stages history second := by + apply ZFSet.ext + intro z + rw [M.mem_forcingHistoryConditions, M.mem_forcingHistoryConditions] + exact and_congr Iff.rfl (forcingHistoryConditionCode_levels_congr M stages history first second z cuts) + +end TransitiveGround +namespace RecursiveRefinementDataHistory +variable {M : TransitiveGround.{u}} {rows T alpha history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M rows T alpha history) +include run + +theorem append (ordinal : ordinalSetProperty alpha) (d : Fin 15 → ZFSet.{u}) + (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) + (lower : d 7 = M.refinementHistoryForcing rows T alpha history) : + RecursiveRefinementDataHistory M rows T (insert alpha alpha) + (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) := by + refine ⟨run.data.append (ZFSet.mem_irrefl alpha) d terms literal, ?_⟩ + intro beta fields entry + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal + have same := refinementFormulaDataCode_injective code + rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl beta), run.data.function.restriction_eq] + exact (congrFun same 7).trans lower + · have hbeta := run.data.function.pair_source old + have outside : alpha ∉ beta := fun member => + ZFSet.mem_irrefl alpha (ordinal.1 beta hbeta alpha member) + rw [graphRestriction_insert_of_not_mem outside] + exact run.carrier beta fields old + +theorem successor_eq (ordinal : ordinalSetProperty alpha) (d : Fin 15 → ZFSet.{u}) + (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) + (lower : d 7 = M.refinementHistoryForcing rows T alpha history) : + let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history + M.refinementHistoryForcing rows T (insert alpha alpha) next = + M.stageTwoConditions rows (refinementDataHistoryIndices (insert alpha alpha) next) + (refinementDataHistoryLevels (insert alpha alpha) next T) alpha d := by + let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history + let levels := refinementDataHistoryLevels (insert alpha alpha) next T + let oldI := refinementDataHistoryIndices alpha history + have extended := run.append ordinal d terms literal lower + have subset : alpha ⊆ insert alpha alpha := fun _ member => ZFSet.mem_insert_of_mem alpha member + have prefixHistory : graphRestriction alpha next = history := by + rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl alpha), run.data.function.restriction_eq] + have cuts : ∀ beta ∈ alpha, ∀ A, + assignmentCut (refinementDataHistoryLevels alpha history T) beta A = assignmentCut levels beta A := by + intro beta hbeta A + have equal := extended.data.prefix_cut subset (ordinal.1 beta hbeta) A + rw [prefixHistory] at equal + exact equal + have lowerGlobal : d 7 = M.forcingHistoryConditions rows oldI (d 6) alpha history levels := by + calc + d 7 = M.refinementHistoryForcing rows T alpha history := lower + _ = M.forcingHistoryConditions rows oldI T alpha history levels := + M.forcingHistoryConditions_levels_congr rows oldI T alpha history _ levels cuts + _ = M.forcingHistoryConditions rows oldI (d 6) alpha history levels := by rw [terms] + have coverage : ForcingHistoryLevelCoverage alpha history levels := by + intro beta hbeta fields entry t ht u hu w hw + exact extended.data.coverage beta (ZFSet.mem_insert_of_mem alpha hbeta) fields + (ZFSet.mem_insert_of_mem _ entry) t ht u hu w hw + simpa only [terms, TransitiveGround.refinementHistoryForcing, levels, next] using + (M.forcingHistoryConditions_successor_eq rows oldI (refinementDataHistoryIndices (insert alpha alpha) next) + alpha history levels d run.data.function ordinal coverage lowerGlobal) + +end RecursiveRefinementDataHistory +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.RecursiveRefinementDataHistory +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows T alpha history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M rows T alpha history) +include run + +theorem successor_insert_extension + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (ordinal : ordinalSetProperty alpha) (d : Fin 15 → ZFSet.{u}) + (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) + (lower : d 7 = M.refinementHistoryForcing rows T alpha history) + (hI : d 0 ∈ M.sets) (hT : T ∈ M.sets) + (rowOrder : ZFSet.{u}) (rowOrderLaw : PartialOrderCode rows rowOrder) + {row A t u w : ZFSet.{u}} (index : t ∈ d 0) (first : u ∈ T) (second : w ∈ T) : + let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history + let levels := refinementDataHistoryLevels (insert alpha alpha) next T + let P := M.refinementHistoryForcing rows T (insert alpha alpha) next + ZFSet.pair row A ∈ P → + stageOneRawSingle M d t u w (ZFSet.pair row (assignmentCut levels alpha A)) → + (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t v u z w (ZFSet.pair row (assignmentCut levels alpha A))) → + (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment t v z ∈ A → + stageOneRawCollision M d t u v w z (ZFSet.pair row (assignmentCut levels alpha A))) → + stageOneRawCollision M d t u u w w (ZFSet.pair row (assignmentCut levels alpha A)) → + ZFSet.pair row (insert (stageOneAssignment t u w) A) ∈ P ∧ + assignmentCut levels alpha (insert (stageOneAssignment t u w) A) = + assignmentCut levels alpha A ∧ + ZFSet.pair (ZFSet.pair row (insert (stageOneAssignment t u w) A)) (ZFSet.pair row A) ∈ + M.refinementHistoryOrder rows rowOrder T (insert alpha alpha) next := by + dsimp only + intro member single old_new new_old self + let next := insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history + have extended := run.append ordinal d terms literal lower + have stored : ZFSet.pair alpha (refinementFormulaDataCode d) ∈ next := ZFSet.mem_insert _ _ + have level := extended.data.coverage alpha (ZFSet.mem_insert alpha alpha) d stored + t index u (terms.symm ▸ first) w (terms.symm ▸ second) + have function : ZFSet.IsFunc + (stageOneAssignments (refinementDataHistoryIndices (insert alpha alpha) next) (d 6)) + (insert alpha alpha) (refinementDataHistoryLevels (insert alpha alpha) next T) := by + simpa only [terms] using extended.data.levels_function + have ground := M.stageOneAssignment_mem pairing (M.transitive hI index) + (M.transitive hT first) (M.transitive hT second) + have successor := run.successor_eq ordinal d terms literal lower + have flat := successor ▸ member + have result := M.stageTwoConditions_insert pairing unions powers separation infinite d + function level ground flat single + (fun v hv z hz old => old_new v (terms ▸ hv) z (terms ▸ hz) old) + (fun v hv z hz old => new_old v (terms ▸ hv) z (terms ▸ hz) old) self + have inserted := successor.symm ▸ result.1 + have candidate := ((M.mem_refinementHistoryForcing rows T (insert alpha alpha) next _).1 member).1 + have rowMember := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate).1 + refine ⟨inserted, result.2, ?_⟩ + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T (insert alpha alpha) next _ _ _ _).2 + ⟨inserted, member, rowOrderLaw.refl row rowMember, fun _ h => ZFSet.mem_insert_of_mem _ h⟩ + +end PartitionPilot.Forcing.RecursiveRefinementDataHistory + + + +namespace PartitionPilot.Forcing +universe u + +structure RecursiveRefinementOrderHistory (M : TransitiveGround.{u}) + (rows rowOrder T stages history : ZFSet.{u}) : Prop where + carriers : RecursiveRefinementDataHistory M rows T stages history + order : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + d 8 = M.refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + +namespace RecursiveRefinementDataHistory +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} + +theorem cut_order (run : RecursiveRefinementDataHistory M rows T stages history) + {q A p D beta : ZFSet.{u}} + (below : ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ + M.refinementHistoryOrder rows rowOrder T stages history) (hbeta : beta ∈ stages) : + ZFSet.pair (ZFSet.pair q (assignmentCut (refinementDataHistoryLevels stages history T) beta A)) + (ZFSet.pair p (assignmentCut (refinementDataHistoryLevels stages history T) beta D)) ∈ + M.refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) := by + obtain ⟨hq, hp, rowsBelow, data⟩ := (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history q A p D).1 below + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) _ _ _ _).2 + ⟨run.cut_mem hq hbeta, run.cut_mem hp hbeta, rowsBelow, assignmentCut_mono data⟩ + +end RecursiveRefinementDataHistory +namespace RecursiveRefinementOrderHistory +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +include run + +theorem lower_order {q A p D beta : ZFSet.{u}} (d : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) + (below : ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ + M.refinementHistoryOrder rows rowOrder T stages history) : + ZFSet.pair (ZFSet.pair q (assignmentCut (refinementDataHistoryLevels stages history T) beta A)) + (ZFSet.pair p (assignmentCut (refinementDataHistoryLevels stages history T) beta D)) ∈ d 8 := + (run.order beta d entry).symm ▸ run.carriers.cut_order below (run.carriers.data.function.pair_source entry) + +theorem restrict {earlier : ZFSet.{u}} (ordinal : ordinalSetProperty earlier) + (subset : earlier ⊆ stages) : + RecursiveRefinementOrderHistory M rows rowOrder T earlier (graphRestriction earlier history) := by + refine ⟨run.carriers.restrict ordinal subset, ?_⟩ + intro beta d entry + have packed := (pair_mem_graphRestriction.1 entry).1 + have hbeta := (pair_mem_graphRestriction.1 entry).2 + rw [graphRestriction_restrict (ordinal.1 beta hbeta)] + exact run.order beta d packed + +theorem append (ordinal : ordinalSetProperty stages) (d : Fin 15 → ZFSet.{u}) + (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) stages) + (lower : d 7 = M.refinementHistoryForcing rows T stages history) + (lowerOrder : d 8 = M.refinementHistoryOrder rows rowOrder T stages history) : + RecursiveRefinementOrderHistory M rows rowOrder T (insert stages stages) + (insert (ZFSet.pair stages (refinementFormulaDataCode d)) history) := by + refine ⟨run.carriers.append ordinal d terms literal lower, ?_⟩ + intro beta fields entry + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal + have same := refinementFormulaDataCode_injective code + rw [graphRestriction_insert_of_not_mem (ZFSet.mem_irrefl beta), run.carriers.data.function.restriction_eq] + exact (congrFun same 8).trans lowerOrder + · have hbeta := run.carriers.data.function.pair_source old + have outside : stages ∉ beta := fun member => + ZFSet.mem_irrefl stages (ordinal.1 beta hbeta stages member) + rw [graphRestriction_insert_of_not_mem outside] + exact run.order beta fields old + +end RecursiveRefinementOrderHistory + + + + + +namespace FunctionGraphOn + +theorem restriction_successor_entry {stages history alpha value : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (entry : ZFSet.pair alpha value ∈ history) : + graphRestriction (Insert.insert alpha alpha) history = + Insert.insert (ZFSet.pair alpha value) (graphRestriction alpha history) := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨beta, hbeta, code, rfl, stored⟩ := mem_graphRestriction.1 member + rcases ZFSet.mem_insert_iff.1 hbeta with equal | before + · subst beta + have same := function.unique stored entry + exact ZFSet.mem_insert_iff.2 (Or.inl (congrArg (ZFSet.pair alpha) same)) + · exact ZFSet.mem_insert_of_mem _ (pair_mem_graphRestriction.2 ⟨stored, before⟩) + · intro member + rcases ZFSet.mem_insert_iff.1 member with equal | before + · rw [equal] + exact pair_mem_graphRestriction.2 ⟨entry, ZFSet.mem_insert alpha alpha⟩ + · obtain ⟨beta, hbeta, code, rfl, stored⟩ := mem_graphRestriction.1 before + exact pair_mem_graphRestriction.2 ⟨stored, ZFSet.mem_insert_of_mem alpha hbeta⟩ + +end FunctionGraphOn + +namespace RecursiveRefinementDataHistory +open SetFormula +variable {M : TransitiveGround.{u}} {rows T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M rows T stages history) +include run + +theorem stored_successor_eq (ordinal : ordinalSetProperty stages) + {alpha : ZFSet.{u}} (member : alpha ∈ stages) (fields : Fin 15 → ZFSet.{u}) + (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) : + let next := graphRestriction (insert alpha alpha) history + M.refinementHistoryForcing rows T (insert alpha alpha) next = + M.stageTwoConditions rows (refinementDataHistoryIndices (insert alpha alpha) next) + (refinementDataHistoryLevels (insert alpha alpha) next T) alpha fields := by + dsimp only + rw [run.data.function.restriction_successor_entry stored] + exact (run.restrict (ordinalSetProperty_member ordinal member) (ordinal.1 alpha member)).successor_eq + (ordinalSetProperty_member ordinal member) fields (run.data.terms alpha fields stored) + (run.data.literal alpha fields stored) (run.carrier alpha fields stored) + +theorem stored_successor_insert_extension + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (ordinal : ordinalSetProperty stages) {alpha : ZFSet.{u}} (member : alpha ∈ stages) + (fields : Fin 15 → ZFSet.{u}) + (stored : ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history) + (hI : fields 0 ∈ M.sets) (hT : T ∈ M.sets) + (rowOrder : ZFSet.{u}) (rowOrderLaw : PartialOrderCode rows rowOrder) + {row A idx u w : ZFSet.{u}} (index : idx ∈ fields 0) (first : u ∈ T) (second : w ∈ T) : + let next := graphRestriction (insert alpha alpha) history + let levels := refinementDataHistoryLevels (insert alpha alpha) next T + let P := M.refinementHistoryForcing rows T (insert alpha alpha) next + ZFSet.pair row A ∈ P → + stageOneRawSingle M fields idx u w (ZFSet.pair row (assignmentCut levels alpha A)) → + (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment idx v z ∈ A → + stageOneRawCollision M fields idx v u z w (ZFSet.pair row (assignmentCut levels alpha A))) → + (∀ v ∈ T, ∀ z ∈ T, stageOneAssignment idx v z ∈ A → + stageOneRawCollision M fields idx u v w z (ZFSet.pair row (assignmentCut levels alpha A))) → + stageOneRawCollision M fields idx u u w w (ZFSet.pair row (assignmentCut levels alpha A)) → + ZFSet.pair row (insert (stageOneAssignment idx u w) A) ∈ P ∧ + assignmentCut levels alpha (insert (stageOneAssignment idx u w) A) = + assignmentCut levels alpha A ∧ + ZFSet.pair (ZFSet.pair row (insert (stageOneAssignment idx u w) A)) (ZFSet.pair row A) ∈ + M.refinementHistoryOrder rows rowOrder T (insert alpha alpha) next := by + dsimp only + rw [run.data.function.restriction_successor_entry stored] + exact (run.restrict (ordinalSetProperty_member ordinal member) (ordinal.1 alpha member)).successor_insert_extension + pairing unions powers separation infinite (ordinalSetProperty_member ordinal member) fields + (run.data.terms alpha fields stored) (run.data.literal alpha fields stored) + (run.carrier alpha fields stored) hI hT rowOrder rowOrderLaw index first second + +end RecursiveRefinementDataHistory +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable {row A B : ZFSet.{u}} +local notation "levels" => refinementDataHistoryLevels stages history T +include run + +theorem binary_union_mem_of_candidates (ordinal : ordinalSetProperty stages) + (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ C lower stronger, stageOneRawTests M d C lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) + (first : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) + (second : ZFSet.pair row B ∈ M.refinementHistoryForcing rows T stages history) + (rowSelf : ZFSet.pair row row ∈ rowOrder) (agreement : AssignmentIndexAgreement A B) + (candidate : ZFSet.pair row (A ∪ B) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) + (candidates : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ + M.stageOneCandidateBound rows + (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : + ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history := by + have subsetA : A ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inl h) + have subsetB : B ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inr h) + have firstTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).2 + have secondTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).2 + have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) + (proved : ZFSet.pair row (assignmentCut levels beta (A ∪ B)) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : + stageOneRawTests M d (A ∪ B) (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) := by + have storedA := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 firstTests + beta hbeta (refinementFormulaDataCode d) entry + have checkedA := (stageTwoConditionCode_pair_iff M d _ beta row A).1 + ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedA) + have storedB := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 secondTests + beta hbeta (refinementFormulaDataCode d) entry + have checkedB := (stageTwoConditionCode_pair_iff M d _ beta row B).1 + ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedB) + have belowA : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) + (ZFSet.pair row (assignmentCut levels beta A)) ∈ d 8 := by + rw [run.order beta d entry] + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + _ _ _ _).2 ⟨proved, run.carriers.cut_mem first hbeta, rowSelf, assignmentCut_mono subsetA⟩ + have belowB : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) + (ZFSet.pair row (assignmentCut levels beta B)) ∈ d 8 := by + rw [run.order beta d entry] + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + _ _ _ _).2 ⟨proved, run.carriers.cut_mem second hbeta, rowSelf, assignmentCut_mono subsetB⟩ + exact stageOneRawTests_binary_union M d agreement + (mono beta d entry A _ _ checkedA.2 belowA) (mono beta d entry B _ _ checkedB.2 belowB) + have earlier : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ + M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by + intro gamma + induction gamma using ZFSet.inductionOn with + | h gamma ih => + intro hgamma + apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 + refine ⟨candidates gamma hgamma, ?_⟩ + intro beta hbeta + have betaFull := ordinal.1 gamma hgamma beta hbeta + have betaSubset := ordinal.2 gamma hgamma beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + have proved := ih beta hbeta betaFull + have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset + (assignmentCut levels gamma (A ∪ B)) + refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 + rw [sameCut, assignmentCut_nested betaSubset] + refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ + exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) + (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma (A ∪ B) member) + apply (M.mem_refinementHistoryForcing rows T stages history _).2 + refine ⟨candidate, ?_⟩ + intro beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + refine ⟨refinementFormulaDataCode d, entry, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 + exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, + step beta hbeta d entry (earlier beta hbeta)⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + + + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +include run + +theorem tests_at_valid_larger_cut + {beta row sourceRow A largerA : ZFSet.{u}} (fields : Fin 15 → ZFSet.{u}) + (stored : ZFSet.pair beta (refinementFormulaDataCode fields) ∈ history) + (mono : ∀ C lower stronger, stageOneRawTests M fields C lower → + ZFSet.pair stronger lower ∈ fields 8 → stageOneRawTests M fields C stronger) + (source : ZFSet.pair sourceRow A ∈ M.refinementHistoryForcing rows T stages history) + (rowBelow : ZFSet.pair row sourceRow ∈ rowOrder) (subset : A ⊆ largerA) + (validCut : ZFSet.pair row + (assignmentCut (refinementDataHistoryLevels stages history T) beta largerA) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : + let levels := refinementDataHistoryLevels stages history T + let stronger := ZFSet.pair row (assignmentCut levels beta largerA) + let old := ZFSet.pair sourceRow (assignmentCut levels beta A) + ZFSet.pair stronger old ∈ fields 8 ∧ stageOneRawTests M fields A stronger := by + have member := run.carriers.data.function.pair_source stored + have originalTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 source).2 + have storedTests := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 originalTests + beta member (refinementFormulaDataCode fields) stored + have checked := (stageTwoConditionCode_pair_iff M fields _ beta sourceRow A).1 + ((packedSuccessorConditionCode_code_iff M _ beta fields _).1 storedTests) + have below : ZFSet.pair + (ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) beta largerA)) + (ZFSet.pair sourceRow (assignmentCut (refinementDataHistoryLevels stages history T) beta A)) ∈ fields 8 := by + rw [run.order beta fields stored] + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + _ _ _ _).2 ⟨validCut, run.carriers.cut_mem source member, rowBelow, assignmentCut_mono subset⟩ + exact ⟨below, mono A _ _ checked.2 below⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + + + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +include run pairing unions powers separation infinite choice hStages hHistory hT + +theorem binary_union_extension (ordinal : ordinalSetProperty stages) + (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ C lower stronger, stageOneRawTests M d C lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) + (rowOrderLaw : PartialOrderCode rows rowOrder) {row A B : ZFSet.{u}} + (first : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) + (second : ZFSet.pair row B ∈ M.refinementHistoryForcing rows T stages history) + (agreement : AssignmentIndexAgreement A B) : + ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history ∧ + ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair row A) ∈ + M.refinementHistoryOrder rows rowOrder T stages history ∧ + ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair row B) ∈ + M.refinementHistoryOrder rows rowOrder T stages history := by + have firstCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).1 + have secondCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).1 + obtain ⟨hrow, hA, subsetA, smallA⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 firstCandidate + obtain ⟨_, hB, subsetB, smallB⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 secondCandidate + have rowSelf := rowOrderLaw.refl row hrow + have candidate : ZFSet.pair row (A ∪ B) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by + apply (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 + refine ⟨hrow, M.binary_union_mem pairing unions hA hB, ?_, + M.groundCountable_binary_union pairing unions powers separation infinite choice hA hB smallA smallB⟩ + intro z member + exact (ZFSet.mem_union.1 member).elim (fun h => subsetA h) (fun h => subsetB h) + have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT + have member := run.binary_union_mem_of_candidates ordinal mono first second rowSelf agreement candidate + (fun beta hbeta => M.refinementDataHistoryCandidate_cut separation run.carriers.data + (ordinal.1 beta hbeta) hLevels (M.transitive hStages hbeta) (M.omega_mem separation infinite) candidate) + refine ⟨member, ?_, ?_⟩ + · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 + ⟨member, first, rowSelf, fun _ h => ZFSet.mem_union.2 (Or.inl h)⟩ + · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 + ⟨member, second, rowSelf, fun _ h => ZFSet.mem_union.2 (Or.inr h)⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementInternalClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementInternalClosure.lean index b8bcd712bd709024a1c02d6849b5bc4f466eab1a..e12026a80b2c08371963967c86822081f8f303c8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementInternalClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementInternalClosure.lean @@ -1,101 +1,101 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCarrierSequences -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] -variable (c : Presentation R) (T stages history : ZFSet.{u}) -variable (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages history) -variable (ordinal : ordinalSetProperty stages) -variable (unionTests : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ (family lower : Nat → ZFSet.{u}) q, - (∀ n m, n ≤ m → family n ⊆ family m) → - (∀ n, ZFSet.pair q (lower n) ∈ d 8) → - (∀ n, stageOneRawTests M d (family n) (lower n)) → - stageOneRawTests M d (stageOneAssignmentUnion family) q) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (carrier : c.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) -variable (rowClosed : InternallyCountablyClosed M c) -local notation "Q" => M.refinementHistoryForcing c.carrier T stages history -local notation "J" => stageOneAssignments (refinementDataHistoryIndices stages history) T -local notation "B" => M.groundSmallSubsets J ZFSet.omega -local notation "shape" => M.refinementHistoryForcing_shape c.carrier T stages history -local notation "row" => flatCarrierRow c Q B shape -local notation "data" => flatCarrierData c Q B shape -include run ordinal unionTests pairing unions powers separation infinite choice carrier hT hStages hHistory rowClosed - -theorem refinementHistory_lower_bound : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - ∀ seq : Nat → SetMembers Q, groundSequenceGraph seq ∈ M.sets → Antitone seq → - ∃ q : R, (∀ n, q ≤ row (seq n)) ∧ ∃ p : SetMembers Q, - SetMembers.raw p = ZFSet.pair (c.encode q) - (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) ∧ ∀ n, p ≤ seq n := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - intro seq whole decreasing - have omega := M.omega_mem separation infinite - have hQ := M.refinementHistoryForcing_mem pairing unions powers separation carrier hT hStages hHistory omega - have hJ := M.stageOneAssignments_mem pairing unions powers separation - (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) hT - have hB := M.groundSmallSubsets_mem powers separation hJ omega - obtain ⟨rowGround, dataGround⟩ := M.flatCarrierSequence_projections_ground c Q B shape - pairing unions powers separation hQ carrier hB omega seq whole - have comparisons {n m : Nat} (less : n ≤ m) : - row (seq m) ≤ row (seq n) ∧ SetMembers.raw (data (seq n)) ⊆ SetMembers.raw (data (seq m)) := by - have below := decreasing less - change ZFSet.pair (SetMembers.raw (seq m)) (SetMembers.raw (seq n)) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder T stages history at below - rw [flatCarrier_coordinates c Q B shape (seq m), flatCarrier_coordinates c Q B shape (seq n)] at below - have checked := (M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages history _ _ _ _).1 below - exact ⟨(c.pair_mem_conditionOrder _ _).1 checked.2.2.1, checked.2.2.2⟩ - obtain ⟨q, belowRows⟩ := rowClosed (fun n => row (seq n)) rowGround (fun _ _ less => (comparisons less).1) - have small := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice hJ - (fun n => data (seq n)) dataGround - have candidate : ZFSet.pair (c.encode q) - (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) ∈ - M.stageOneCandidateBound c.carrier (refinementDataHistoryIndices stages history) T := - ZFSet.pair_mem_prod.2 ⟨c.encode_mem q, small⟩ - have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT - have members (n : Nat) : ZFSet.pair (c.encode (row (seq n))) (SetMembers.raw (data (seq n))) ∈ Q := by - rw [← flatCarrier_coordinates c Q B shape (seq n)] - exact SetMembers.raw_mem (seq n) - obtain ⟨member, below⟩ := run.union_lower_bound_of_candidates ordinal unionTests - (fun n => SetMembers.raw (data (seq n))) (fun n => c.encode (row (seq n))) (c.encode q) - members (fun _ _ less => (comparisons less).2) - (fun n => (c.pair_mem_conditionOrder _ _).2 (belowRows n)) candidate (by - intro gamma hgamma - exact M.refinementDataHistoryCandidate_cut separation run.carriers.data (ordinal.1 gamma hgamma) - hLevels (M.transitive hStages hgamma) omega candidate) - let p : SetMembers Q := SetMembers.ofMem _ member - have code : SetMembers.raw p = ZFSet.pair (c.encode q) - (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) := SetMembers.raw_ofMem _ _ - refine ⟨q, belowRows, p, code, ?_⟩ - intro n - change ZFSet.pair (SetMembers.raw p) (SetMembers.raw (seq n)) ∈ - M.refinementHistoryOrder c.carrier c.conditionOrder T stages history - rw [code, flatCarrier_coordinates c Q B shape (seq n)] - exact below n - -theorem refinementHistory_internally_closed : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - InternallyCountablyClosed M (SetMembers.presentation Q) := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - intro seq whole decreasing - obtain ⟨_, _, p, _, below⟩ := M.refinementHistory_lower_bound c T stages history run ordinal unionTests - pairing unions powers separation infinite choice carrier hT hStages hHistory rowClosed seq whole decreasing - exact ⟨p, below⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCarrierSequences +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] +variable (c : Presentation R) (T stages history : ZFSet.{u}) +variable (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages history) +variable (ordinal : ordinalSetProperty stages) +variable (unionTests : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ (family lower : Nat → ZFSet.{u}) q, + (∀ n m, n ≤ m → family n ⊆ family m) → + (∀ n, ZFSet.pair q (lower n) ∈ d 8) → + (∀ n, stageOneRawTests M d (family n) (lower n)) → + stageOneRawTests M d (stageOneAssignmentUnion family) q) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (carrier : c.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) +variable (rowClosed : InternallyCountablyClosed M c) +local notation "Q" => M.refinementHistoryForcing c.carrier T stages history +local notation "J" => stageOneAssignments (refinementDataHistoryIndices stages history) T +local notation "B" => M.groundSmallSubsets J ZFSet.omega +local notation "shape" => M.refinementHistoryForcing_shape c.carrier T stages history +local notation "row" => flatCarrierRow c Q B shape +local notation "data" => flatCarrierData c Q B shape +include run ordinal unionTests pairing unions powers separation infinite choice carrier hT hStages hHistory rowClosed + +theorem refinementHistory_lower_bound : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + ∀ seq : Nat → SetMembers Q, groundSequenceGraph seq ∈ M.sets → Antitone seq → + ∃ q : R, (∀ n, q ≤ row (seq n)) ∧ ∃ p : SetMembers Q, + SetMembers.raw p = ZFSet.pair (c.encode q) + (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) ∧ ∀ n, p ≤ seq n := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + intro seq whole decreasing + have omega := M.omega_mem separation infinite + have hQ := M.refinementHistoryForcing_mem pairing unions powers separation carrier hT hStages hHistory omega + have hJ := M.stageOneAssignments_mem pairing unions powers separation + (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) hT + have hB := M.groundSmallSubsets_mem powers separation hJ omega + obtain ⟨rowGround, dataGround⟩ := M.flatCarrierSequence_projections_ground c Q B shape + pairing unions powers separation hQ carrier hB omega seq whole + have comparisons {n m : Nat} (less : n ≤ m) : + row (seq m) ≤ row (seq n) ∧ SetMembers.raw (data (seq n)) ⊆ SetMembers.raw (data (seq m)) := by + have below := decreasing less + change ZFSet.pair (SetMembers.raw (seq m)) (SetMembers.raw (seq n)) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder T stages history at below + rw [flatCarrier_coordinates c Q B shape (seq m), flatCarrier_coordinates c Q B shape (seq n)] at below + have checked := (M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages history _ _ _ _).1 below + exact ⟨(c.pair_mem_conditionOrder _ _).1 checked.2.2.1, checked.2.2.2⟩ + obtain ⟨q, belowRows⟩ := rowClosed (fun n => row (seq n)) rowGround (fun _ _ less => (comparisons less).1) + have small := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice hJ + (fun n => data (seq n)) dataGround + have candidate : ZFSet.pair (c.encode q) + (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) ∈ + M.stageOneCandidateBound c.carrier (refinementDataHistoryIndices stages history) T := + ZFSet.pair_mem_prod.2 ⟨c.encode_mem q, small⟩ + have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT + have members (n : Nat) : ZFSet.pair (c.encode (row (seq n))) (SetMembers.raw (data (seq n))) ∈ Q := by + rw [← flatCarrier_coordinates c Q B shape (seq n)] + exact SetMembers.raw_mem (seq n) + obtain ⟨member, below⟩ := run.union_lower_bound_of_candidates ordinal unionTests + (fun n => SetMembers.raw (data (seq n))) (fun n => c.encode (row (seq n))) (c.encode q) + members (fun _ _ less => (comparisons less).2) + (fun n => (c.pair_mem_conditionOrder _ _).2 (belowRows n)) candidate (by + intro gamma hgamma + exact M.refinementDataHistoryCandidate_cut separation run.carriers.data (ordinal.1 gamma hgamma) + hLevels (M.transitive hStages hgamma) omega candidate) + let p : SetMembers Q := SetMembers.ofMem _ member + have code : SetMembers.raw p = ZFSet.pair (c.encode q) + (stageOneAssignmentUnion (fun n => SetMembers.raw (data (seq n)))) := SetMembers.raw_ofMem _ _ + refine ⟨q, belowRows, p, code, ?_⟩ + intro n + change ZFSet.pair (SetMembers.raw p) (SetMembers.raw (seq n)) ∈ + M.refinementHistoryOrder c.carrier c.conditionOrder T stages history + rw [code, flatCarrier_coordinates c Q B shape (seq n)] + exact below n + +theorem refinementHistory_internally_closed : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + InternallyCountablyClosed M (SetMembers.presentation Q) := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + intro seq whole decreasing + obtain ⟨_, _, p, _, below⟩ := M.refinementHistory_lower_bound c T stages history run ordinal unionTests + pairing unions powers separation infinite choice carrier hT hStages hHistory rowClosed seq whole decreasing + exact ⟨p, below⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementMixedUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementMixedUnions.lean index e4fd6dab8340f7c86eb1f7d85e60375e67ab7fd0..672a42c615450eb080126777b983dcc0aa4257ef 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementMixedUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRefinementMixedUnions.lean @@ -1,163 +1,163 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable {row rowA rowB A B : ZFSet.{u}} -local notation "levels" => refinementDataHistoryLevels stages history T -include run - -theorem mixed_union_mem_of_candidates (ordinal : ordinalSetProperty stages) - (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ C lower stronger, stageOneRawTests M d C lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) - (first : ZFSet.pair rowA A ∈ M.refinementHistoryForcing rows T stages history) - (second : ZFSet.pair rowB B ∈ M.refinementHistoryForcing rows T stages history) - (rowBelowA : ZFSet.pair row rowA ∈ rowOrder) - (rowBelowB : ZFSet.pair row rowB ∈ rowOrder) - (cross : ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ZFSet.pair row (assignmentCut levels beta (A ∪ B)) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history) → - stageOneRawCrossCollisions M d A B - (ZFSet.pair row (assignmentCut levels beta (A ∪ B)))) - (candidate : ZFSet.pair row (A ∪ B) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) - (candidates : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ - M.stageOneCandidateBound rows - (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : - ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history := by - have subsetA : A ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inl h) - have subsetB : B ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inr h) - have firstTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).2 - have secondTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).2 - have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) - (proved : ZFSet.pair row (assignmentCut levels beta (A ∪ B)) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : - stageOneRawTests M d (A ∪ B) (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) := by - have storedA := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 firstTests - beta hbeta (refinementFormulaDataCode d) entry - have checkedA := (stageTwoConditionCode_pair_iff M d _ beta rowA A).1 - ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedA) - have storedB := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 secondTests - beta hbeta (refinementFormulaDataCode d) entry - have checkedB := (stageTwoConditionCode_pair_iff M d _ beta rowB B).1 - ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedB) - have belowA : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) - (ZFSet.pair rowA (assignmentCut levels beta A)) ∈ d 8 := by - rw [run.order beta d entry] - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - _ _ _ _).2 ⟨proved, run.carriers.cut_mem first hbeta, rowBelowA, assignmentCut_mono subsetA⟩ - have belowB : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) - (ZFSet.pair rowB (assignmentCut levels beta B)) ∈ d 8 := by - rw [run.order beta d entry] - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) - _ _ _ _).2 ⟨proved, run.carriers.cut_mem second hbeta, rowBelowB, assignmentCut_mono subsetB⟩ - exact stageOneRawTests_mixed_union M d - (mono beta d entry A _ _ checkedA.2 belowA) (mono beta d entry B _ _ checkedB.2 belowB) - (cross beta hbeta d entry proved) - have earlier : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ - M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by - intro gamma - induction gamma using ZFSet.inductionOn with - | h gamma ih => - intro hgamma - apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 - refine ⟨candidates gamma hgamma, ?_⟩ - intro beta hbeta - have betaFull := ordinal.1 gamma hgamma beta hbeta - have betaSubset := ordinal.2 gamma hgamma beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - have proved := ih beta hbeta betaFull - have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset - (assignmentCut levels gamma (A ∪ B)) - refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 - rw [sameCut, assignmentCut_nested betaSubset] - refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ - exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) - (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma (A ∪ B) member) - apply (M.mem_refinementHistoryForcing rows T stages history _).2 - refine ⟨candidate, ?_⟩ - intro beta hbeta - obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta - obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry - refine ⟨refinementFormulaDataCode d, entry, ?_⟩ - apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 - apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 - exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, - step beta hbeta d entry (earlier beta hbeta)⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - - - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -include run pairing unions powers separation infinite choice hStages hHistory hT - -theorem mixed_union_extension (ordinal : ordinalSetProperty stages) - (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ C lower stronger, stageOneRawTests M d C lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) - (rowOrderLaw : PartialOrderCode rows rowOrder) {row rowA rowB A B : ZFSet.{u}} - (first : ZFSet.pair rowA A ∈ M.refinementHistoryForcing rows T stages history) - (second : ZFSet.pair rowB B ∈ M.refinementHistoryForcing rows T stages history) - (rowBelowA : ZFSet.pair row rowA ∈ rowOrder) - (rowBelowB : ZFSet.pair row rowB ∈ rowOrder) - (cross : ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) beta (A ∪ B)) ∈ - M.refinementHistoryForcing rows T beta (graphRestriction beta history) → - stageOneRawCrossCollisions M d A B (ZFSet.pair row - (assignmentCut (refinementDataHistoryLevels stages history T) beta (A ∪ B)))) : - ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history ∧ - ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair rowA A) ∈ - M.refinementHistoryOrder rows rowOrder T stages history ∧ - ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair rowB B) ∈ - M.refinementHistoryOrder rows rowOrder T stages history := by - have firstCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).1 - have secondCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).1 - obtain ⟨_, hA, subsetA, smallA⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 firstCandidate - obtain ⟨_, hB, subsetB, smallB⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 secondCandidate - have hrow := (ZFSet.pair_mem_prod.1 (rowOrderLaw.relation rowBelowA)).1 - have candidate : ZFSet.pair row (A ∪ B) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by - apply (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 - refine ⟨hrow, M.binary_union_mem pairing unions hA hB, ?_, - M.groundCountable_binary_union pairing unions powers separation infinite choice hA hB smallA smallB⟩ - intro z member - exact (ZFSet.mem_union.1 member).elim (fun h => subsetA h) (fun h => subsetB h) - have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT - have member := run.mixed_union_mem_of_candidates ordinal mono first second rowBelowA rowBelowB cross candidate - (fun beta hbeta => M.refinementDataHistoryCandidate_cut separation run.carriers.data - (ordinal.1 beta hbeta) hLevels (M.transitive hStages hbeta) (M.omega_mem separation infinite) candidate) - refine ⟨member, ?_, ?_⟩ - · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 - ⟨member, first, rowBelowA, fun _ h => ZFSet.mem_union.2 (Or.inl h)⟩ - · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 - ⟨member, second, rowBelowB, fun _ h => ZFSet.mem_union.2 (Or.inr h)⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable {row rowA rowB A B : ZFSet.{u}} +local notation "levels" => refinementDataHistoryLevels stages history T +include run + +theorem mixed_union_mem_of_candidates (ordinal : ordinalSetProperty stages) + (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ C lower stronger, stageOneRawTests M d C lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) + (first : ZFSet.pair rowA A ∈ M.refinementHistoryForcing rows T stages history) + (second : ZFSet.pair rowB B ∈ M.refinementHistoryForcing rows T stages history) + (rowBelowA : ZFSet.pair row rowA ∈ rowOrder) + (rowBelowB : ZFSet.pair row rowB ∈ rowOrder) + (cross : ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ZFSet.pair row (assignmentCut levels beta (A ∪ B)) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history) → + stageOneRawCrossCollisions M d A B + (ZFSet.pair row (assignmentCut levels beta (A ∪ B)))) + (candidate : ZFSet.pair row (A ∪ B) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) + (candidates : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ + M.stageOneCandidateBound rows + (refinementDataHistoryIndices gamma (graphRestriction gamma history)) T) : + ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history := by + have subsetA : A ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inl h) + have subsetB : B ⊆ A ∪ B := fun _ h => ZFSet.mem_union.2 (Or.inr h) + have firstTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).2 + have secondTests := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).2 + have step (beta : ZFSet.{u}) (hbeta : beta ∈ stages) (d : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) + (proved : ZFSet.pair row (assignmentCut levels beta (A ∪ B)) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history)) : + stageOneRawTests M d (A ∪ B) (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) := by + have storedA := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 firstTests + beta hbeta (refinementFormulaDataCode d) entry + have checkedA := (stageTwoConditionCode_pair_iff M d _ beta rowA A).1 + ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedA) + have storedB := (forcingHistoryConditionCode_lookup_iff run.carriers.data.function).1 secondTests + beta hbeta (refinementFormulaDataCode d) entry + have checkedB := (stageTwoConditionCode_pair_iff M d _ beta rowB B).1 + ((packedSuccessorConditionCode_code_iff M _ beta d _).1 storedB) + have belowA : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) + (ZFSet.pair rowA (assignmentCut levels beta A)) ∈ d 8 := by + rw [run.order beta d entry] + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + _ _ _ _).2 ⟨proved, run.carriers.cut_mem first hbeta, rowBelowA, assignmentCut_mono subsetA⟩ + have belowB : ZFSet.pair (ZFSet.pair row (assignmentCut levels beta (A ∪ B))) + (ZFSet.pair rowB (assignmentCut levels beta B)) ∈ d 8 := by + rw [run.order beta d entry] + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T beta (graphRestriction beta history) + _ _ _ _).2 ⟨proved, run.carriers.cut_mem second hbeta, rowBelowB, assignmentCut_mono subsetB⟩ + exact stageOneRawTests_mixed_union M d + (mono beta d entry A _ _ checkedA.2 belowA) (mono beta d entry B _ _ checkedB.2 belowB) + (cross beta hbeta d entry proved) + have earlier : ∀ gamma ∈ stages, ZFSet.pair row (assignmentCut levels gamma (A ∪ B)) ∈ + M.refinementHistoryForcing rows T gamma (graphRestriction gamma history) := by + intro gamma + induction gamma using ZFSet.inductionOn with + | h gamma ih => + intro hgamma + apply (M.mem_refinementHistoryForcing rows T gamma (graphRestriction gamma history) _).2 + refine ⟨candidates gamma hgamma, ?_⟩ + intro beta hbeta + have betaFull := ordinal.1 gamma hgamma beta hbeta + have betaSubset := ordinal.2 gamma hgamma beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total betaFull + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + have proved := ih beta hbeta betaFull + have sameCut := run.carriers.data.prefix_cut (ordinal.1 gamma hgamma) betaSubset + (assignmentCut levels gamma (A ∪ B)) + refine ⟨refinementFormulaDataCode d, pair_mem_graphRestriction.2 ⟨entry, hbeta⟩, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 + rw [sameCut, assignmentCut_nested betaSubset] + refine ⟨(run.carriers.carrier beta d entry).symm ▸ proved, ?_⟩ + exact stageOneRawTests_transfer M d _ (step beta betaFull d entry proved) + (fun _ _ _ _ _ _ member => assignmentCut_subset levels gamma (A ∪ B) member) + apply (M.mem_refinementHistoryForcing rows T stages history _).2 + refine ⟨candidate, ?_⟩ + intro beta hbeta + obtain ⟨data, entry⟩ := run.carriers.data.function.total hbeta + obtain ⟨d, rfl⟩ := run.carriers.data.decoded beta data entry + refine ⟨refinementFormulaDataCode d, entry, ?_⟩ + apply (packedSuccessorConditionCode_code_iff M _ beta d _).2 + apply (stageTwoConditionCode_pair_iff M d _ beta row _).2 + exact ⟨(run.carriers.carrier beta d entry).symm ▸ earlier beta hbeta, + step beta hbeta d entry (earlier beta hbeta)⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + + + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +include run pairing unions powers separation infinite choice hStages hHistory hT + +theorem mixed_union_extension (ordinal : ordinalSetProperty stages) + (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ C lower stronger, stageOneRawTests M d C lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d C stronger) + (rowOrderLaw : PartialOrderCode rows rowOrder) {row rowA rowB A B : ZFSet.{u}} + (first : ZFSet.pair rowA A ∈ M.refinementHistoryForcing rows T stages history) + (second : ZFSet.pair rowB B ∈ M.refinementHistoryForcing rows T stages history) + (rowBelowA : ZFSet.pair row rowA ∈ rowOrder) + (rowBelowB : ZFSet.pair row rowB ∈ rowOrder) + (cross : ∀ beta ∈ stages, ∀ d : Fin 15 → ZFSet.{u}, + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) beta (A ∪ B)) ∈ + M.refinementHistoryForcing rows T beta (graphRestriction beta history) → + stageOneRawCrossCollisions M d A B (ZFSet.pair row + (assignmentCut (refinementDataHistoryLevels stages history T) beta (A ∪ B)))) : + ZFSet.pair row (A ∪ B) ∈ M.refinementHistoryForcing rows T stages history ∧ + ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair rowA A) ∈ + M.refinementHistoryOrder rows rowOrder T stages history ∧ + ZFSet.pair (ZFSet.pair row (A ∪ B)) (ZFSet.pair rowB B) ∈ + M.refinementHistoryOrder rows rowOrder T stages history := by + have firstCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 first).1 + have secondCandidate := ((M.mem_refinementHistoryForcing rows T stages history _).1 second).1 + obtain ⟨_, hA, subsetA, smallA⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 firstCandidate + obtain ⟨_, hB, subsetB, smallB⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 secondCandidate + have hrow := (ZFSet.pair_mem_prod.1 (rowOrderLaw.relation rowBelowA)).1 + have candidate : ZFSet.pair row (A ∪ B) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by + apply (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 + refine ⟨hrow, M.binary_union_mem pairing unions hA hB, ?_, + M.groundCountable_binary_union pairing unions powers separation infinite choice hA hB smallA smallB⟩ + intro z member + exact (ZFSet.mem_union.1 member).elim (fun h => subsetA h) (fun h => subsetB h) + have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT + have member := run.mixed_union_mem_of_candidates ordinal mono first second rowBelowA rowBelowB cross candidate + (fun beta hbeta => M.refinementDataHistoryCandidate_cut separation run.carriers.data + (ordinal.1 beta hbeta) hLevels (M.transitive hStages hbeta) (M.omega_mem separation infinite) candidate) + refine ⟨member, ?_, ?_⟩ + · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 + ⟨member, first, rowBelowA, fun _ h => ZFSet.mem_union.2 (Or.inl h)⟩ + · exact (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 + ⟨member, second, rowBelowB, fun _ h => ZFSet.mem_union.2 (Or.inr h)⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRowCompleteProjection.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRowCompleteProjection.lean index ff1cbe42685aba0164c8f742252aa8878970ec72..4f659761250c341093503425e4d188cdf0255711 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRowCompleteProjection.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRecursiveRowCompleteProjection.lean @@ -1,820 +1,820 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveRowNameActions -import OAI.SetTheory.PartitionPrinciple.Forcing.RecursiveRefinementUnionConditions - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetRealization -universe u -namespace RecursiveRefinementDataHistory -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history top : ZFSet.{u}} - -theorem greatest (run : RecursiveRefinementDataHistory M rows T stages history) - (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) - (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) : - ∀ z ∈ M.refinementHistoryForcing rows T stages history, - ZFSet.pair z (ZFSet.pair top ∅) ∈ M.refinementHistoryOrder rows rowOrder T stages history := - rowAssignmentOrder_top (M.refinementHistoryForcing_shape rows T stages history) topRows - (run.empty_assignments ordinal hRows topMem) - -end RecursiveRefinementDataHistory -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {rows rowOrder : ZFSet.{u}} -variable (order : PartialOrderCode rows rowOrder) (T stages history : ZFSet.{u}) - -@[instance_reducible] noncomputable def refinementHistoryPartialOrder : - PartialOrder (SetMembers (M.refinementHistoryForcing rows T stages history)) := - (M.refinementHistoryOrder_partialOrder order T stages history).toPartialOrder - -theorem refinementHistoryDecodedOrder_eq : - letI := M.refinementHistoryPartialOrder order T stages history - (SetMembers.presentation (M.refinementHistoryForcing rows T stages history)).conditionOrder = - M.refinementHistoryOrder rows rowOrder T stages history := - (M.refinementHistoryOrder_partialOrder order T stages history).conditionOrder_eq - -@[instance_reducible] noncomputable def refinementHistoryOrderTop - (run : RecursiveRefinementDataHistory M rows T stages history) - (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) - (top : ZFSet.{u}) (topMem : top ∈ rows) - (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) : - letI := M.refinementHistoryPartialOrder order T stages history - OrderTop (SetMembers (M.refinementHistoryForcing rows T stages history)) := - (M.refinementHistoryOrder_partialOrder order T stages history).toOrderTop (ZFSet.pair top ∅) - (run.empty_assignments ordinal hRows topMem) (run.greatest ordinal hRows topMem topRows) - -theorem refinementHistoryDecodedTop_eq - (run : RecursiveRefinementDataHistory M rows T stages history) - (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) - (top : ZFSet.{u}) (topMem : top ∈ rows) - (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) : - letI := M.refinementHistoryPartialOrder order T stages history - letI := M.refinementHistoryOrderTop order T stages history run ordinal hRows top topMem topRows - (SetMembers.presentation (M.refinementHistoryForcing rows T stages history)).encode ⊤ = ZFSet.pair top ∅ := - SetMembers.raw_ofMem _ _ - -end TransitiveGround - -end - -namespace TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] (c : Presentation R) -variable {T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) -variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) -variable (rowTop : R) -variable (topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode rowTop) ∈ c.conditionOrder) -include run ordinal carrier topRows - -theorem refinementHistoryRowNameFamily_power_eq (X : ZFSet.{u}) - (valid : ∀ z ∈ X, IsName c.pairEmpty z) (n : Nat) : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - letI := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier - (c.encode rowTop) (c.encode_mem rowTop) topRows - Name.renamedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) - (M.refinementHistoryRowInclusion c run ordinal carrier) - (iteratedPairNameFamily (c.pairEmpty.encode rowTop) X n) - (iteratedPairNameFamily_valid rowTop valid n) = - iteratedPairNameFamily - ((SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).encode ⊤) X n := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - let := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier - (c.encode rowTop) (c.encode_mem rowTop) topRows - rw [M.refinementHistoryRowNameFamily_eq c run ordinal carrier, - M.refinementHistoryDecodedTop_eq] - rfl - -theorem refinementHistoryRowNameFamily_square_eq (X Y : ZFSet.{u}) - (validX : ∀ z ∈ X, IsName c.pairEmpty z) (validY : ∀ z ∈ Y, IsName c.pairEmpty z) : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - letI := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier - (c.encode rowTop) (c.encode_mem rowTop) topRows - Name.renamedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) - (M.refinementHistoryRowInclusion c run ordinal carrier) - (orderedPairNameFamily (c.pairEmpty.encode rowTop) X Y) - (orderedPairNameFamily_valid rowTop validX validY) = - orderedPairNameFamily - ((SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).encode ⊤) X Y := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - let := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier - (c.encode rowTop) (c.encode_mem rowTop) topRows - rw [M.refinementHistoryRowNameFamily_eq c run ordinal carrier, - M.refinementHistoryDecodedTop_eq] - rfl - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder L] - -theorem recursiveRefinementStageSystem - (c : Presentation R) (a : PosetAction G R) (t : Presentation G) - (b : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 stages history : ZFSet.{u}) - (run : RecursiveRefinementDataHistory M c.carrier T stages history) - (ordinal : ordinalSetProperty stages) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) - (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) - (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) - (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) - (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) - (symmetric1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) - (symmetric2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → - HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) - (top : ZFSet.{u}) (topMem : top ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row top ∈ c.conditionOrder) : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - letI := M.refinementHistoryOrderTop c.conditionOrder_code T stages history - run ordinal carrier top topMem topRows - ∀ (e : PosetAction G (SetMembers (M.refinementHistoryForcing c.carrier T stages history))) - (image : G → ZFSet.{u} → ZFSet.{u}), - (∀ g (q : SetMembers (M.refinementHistoryForcing c.carrier T stages history)) row A, - SetMembers.raw q = ZFSet.pair (c.encode row) A → - SetMembers.raw (e.iso g q) = ZFSet.pair (c.encode (a.iso g row)) (image g A)) → - (∀ g, image g ∅ = ∅) → - e.actionGraph (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) t ∈ M.sets → - RefinementStageSystem M e - (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) - t b d base directed stages T T2 := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - let := M.refinementHistoryOrderTop c.conditionOrder_code T stages history - run ordinal carrier top topMem topRows - intro e image coordinates emptyImage actionGround - have nextCarrier : (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).carrier ∈ M.sets := - M.refinementHistoryForcing_mem pairing unions powers separation carrier hT hStages hHistory omega - have nextOrder : (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).conditionOrder ∈ M.sets := by - rw [M.refinementHistoryDecodedOrder_eq] - exact M.refinementHistoryOrder_mem pairing unions powers separation carrier order hT hStages hHistory omega - have maps := M.conditionMapFamily_mem_of_actionGraph e - (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) t - pairing unions powers separation collection nextCarrier group actionGround - obtain ⟨nextValid1, nextClosed1, nextHS1⟩ := - M.refinementHistoryRowNameFamily_transport c run ordinal carrier a e image coordinates emptyImage - (d.principalSupportFamily base directed) T valid1 closed1 symmetric1 - obtain ⟨nextValid2, nextClosed2, nextHS2⟩ := - M.refinementHistoryRowNameFamily_transport c run ordinal carrier a e image coordinates emptyImage - (d.principalSupportFamily base directed) T2 valid2 closed2 symmetric2 - exact M.refinementStageSystem e - (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) t b d base directed - pairing unions powers separation collection nextCarrier nextOrder group nodes nodeOrder maps nodeMaps supports - hStages hT hT2 nextValid1 nextValid2 nextClosed1 nextClosed2 nextHS1 nextHS2 - -end TransitiveGround - -namespace RecursiveRefinementOrderHistory -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -variable {alpha p Ap q Aq : ZFSet.{u}} (hAlpha : alpha ∈ M.sets) -variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) -variable (cutSubset : alpha ⊆ stages) -variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ A lower stronger, stageOneRawTests M d A lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) -include run pairing unions powers separation infinite choice hStages hHistory hT hAlpha ordinal cutOrdinal cutSubset mono -local notation "levels" => refinementDataHistoryLevels stages history T -local notation "spliced" => assignmentSplice levels alpha Aq Ap - -theorem splice_mem - (upper : ZFSet.pair p Ap ∈ M.refinementHistoryForcing rows T stages history) - (lower : ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T alpha (graphRestriction alpha history)) - (rowsBelow : ZFSet.pair q p ∈ rowOrder) - (contains : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq) : - ZFSet.pair q spliced ∈ M.refinementHistoryForcing rows T stages history := by - have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT - have candidate := M.refinementDataHistoryCandidate_splice pairing unions powers separation infinite choice - cutSubset hLevels hAlpha - ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).1 - ((M.mem_refinementHistoryForcing rows T stages history _).1 upper).1 - exact run.splice_mem_of_candidates ordinal cutOrdinal cutSubset mono upper lower rowsBelow contains candidate - (fun beta hbeta => M.refinementDataHistoryCandidate_cut separation run.carriers.data - (ordinal.1 beta hbeta) hLevels (M.transitive hStages hbeta) (M.omega_mem separation infinite) candidate) - -theorem splice_lifting - (upper : ZFSet.pair p Ap ∈ M.refinementHistoryForcing rows T stages history) - (below : ZFSet.pair (ZFSet.pair q Aq) (ZFSet.pair p (assignmentCut levels alpha Ap)) ∈ - M.refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history)) : - ZFSet.pair q spliced ∈ M.refinementHistoryForcing rows T stages history ∧ - ZFSet.pair (ZFSet.pair q spliced) (ZFSet.pair p Ap) ∈ - M.refinementHistoryOrder rows rowOrder T stages history ∧ - assignmentCut levels alpha spliced = Aq := by - obtain ⟨lower, _, rowsBelow, contains⟩ := - (M.pair_mem_refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history) _ _ _ _).1 below - have lowerData := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 - ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).1).2.2.1 - have fullLower := run.carriers.data.prefix_assignments_cut cutSubset lowerData - have retained : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq := by - rw [fullLower] - exact contains - have member := run.splice_mem pairing unions powers separation infinite choice hStages hHistory hT hAlpha - ordinal cutOrdinal cutSubset mono upper lower rowsBelow retained - refine ⟨member, (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 - ⟨member, upper, rowsBelow, assignmentSplice_extends retained⟩, ?_⟩ - rw [assignmentCut_splice, fullLower] - -end RecursiveRefinementOrderHistory - -namespace RecursiveRefinementOrderHistory -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) -variable (subset : alpha ⊆ stages) -include run ordinal cutOrdinal subset - -theorem cut_mem_le {row A : ZFSet.{u}} - (member : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) : - ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) alpha A) ∈ - M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) := by - have compare : alpha ∈ stages ∨ alpha = stages := by - obtain ⟨a, ea⟩ := (ordinalSetProperty_iff alpha).1 cutOrdinal - obtain ⟨b, eb⟩ := (ordinalSetProperty_iff stages).1 ordinal - have below := (ordinalCode_subset_iff a b).1 (ea ▸ eb ▸ subset) - rcases lt_or_eq_of_le below with less | equal - · exact Or.inl (ea ▸ eb ▸ (mem_ordinalCode_iff a b).2 less) - · exact Or.inr (ea.trans ((congrArg ordinalCode equal).trans eb.symm)) - rcases compare with earlier | rfl - · exact run.carriers.cut_mem member earlier - · rw [run.carriers.data.function.restriction_eq] - have data := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 - ((M.mem_refinementHistoryForcing rows T _ history _).1 member).1).2.2.1 - rw [assignmentCut_full run.carriers.data.levels_function data] - exact member - -theorem cut_order_le {q A p D : ZFSet.{u}} - (below : ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ - M.refinementHistoryOrder rows rowOrder T stages history) : - ZFSet.pair - (ZFSet.pair q (assignmentCut (refinementDataHistoryLevels stages history T) alpha A)) - (ZFSet.pair p (assignmentCut (refinementDataHistoryLevels stages history T) alpha D)) ∈ - M.refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history) := by - obtain ⟨hq, hp, rowBelow, data⟩ := (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).1 below - exact (M.pair_mem_refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history) _ _ _ _).2 - ⟨run.cut_mem_le ordinal cutOrdinal subset hq, run.cut_mem_le ordinal cutOrdinal subset hp, - rowBelow, assignmentCut_mono data⟩ - -theorem include_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) - (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) - (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) - (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ A lower stronger, stageOneRawTests M d A lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) - {q Aq : ZFSet.{u}} - (lower : ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T alpha (graphRestriction alpha history)) : - ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T stages history := by - have lowerFacts := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 - ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).1 - have fullLower := run.carriers.data.prefix_assignments_cut subset lowerFacts.2.2.1 - have member := run.splice_mem pairing unions powers separation infinite choice hStages hHistory hT hAlpha - ordinal cutOrdinal subset mono (run.carriers.empty_assignments ordinal hRows topMem) lower - (topRows q lowerFacts.1) (by - rw [assignmentCut_empty_data] - exact fun z impossible => False.elim (ZFSet.notMem_empty z impossible)) - have equal : assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq ∅ = Aq := by - rw [assignmentSplice, fullLower] - apply ZFSet.ext - intro z - rw [ZFSet.mem_union, mem_assignmentUpper] - exact ⟨fun h => h.elim id (fun h => False.elim (ZFSet.notMem_empty z h.1)), Or.inl⟩ - exact equal ▸ member - -end RecursiveRefinementOrderHistory - -namespace RecursiveRefinementOrderHistory -open SetRealization -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) -variable (subset : alpha ⊆ stages) -local notation "U" => M.refinementHistoryForcing rows T stages history -local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) -local notation "levels" => refinementDataHistoryLevels stages history T -local notation "sU" => SetMembers.presentation U -local notation "sL" => SetMembers.presentation L -include run ordinal cutOrdinal subset - -theorem restrictionGraph_function : - ZFSet.IsFunc U L (rowAssignmentCutGraph U L levels alpha) := - rowAssignmentCutGraph_function U L levels alpha - (fun z member => by - obtain ⟨row, _, A, _, equal⟩ := ZFSet.mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history member) - exact ⟨row, A, equal⟩) - (fun _ _ member => run.cut_mem_le ordinal cutOrdinal subset member) - -noncomputable def restrictionFunction : SetMembers U → SetMembers L := - (sU).decodeFunction sL (rowAssignmentCutGraph U L levels alpha) - (run.restrictionGraph_function ordinal cutOrdinal subset) - -theorem restrictionFunction_raw (x : SetMembers U) (row A : ZFSet.{u}) - (code : SetMembers.raw x = ZFSet.pair row A) : - SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset x) = - ZFSet.pair row (assignmentCut levels alpha A) := by - have entry := (sU).decodeFunction_mem sL (rowAssignmentCutGraph U L levels alpha) - (run.restrictionGraph_function ordinal cutOrdinal subset) x - change ZFSet.pair (SetMembers.raw x) - (SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset x)) ∈ _ at entry - rw [code] at entry - exact ((pair_mem_rowAssignmentCutGraph U L levels alpha row A _).1 entry).2.2 - -noncomputable def restriction (order : PartialOrderCode rows rowOrder) : - letI := M.refinementHistoryPartialOrder order T stages history - letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) - SetMembers U →o SetMembers L := by - letI := M.refinementHistoryPartialOrder order T stages history - letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) - refine { toFun := run.restrictionFunction ordinal cutOrdinal subset, monotone' := ?_ } - intro x y below - obtain ⟨q, _, A, _, xCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem x)) - obtain ⟨p, _, D, _, yCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem y)) - change ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ _ at below - change ZFSet.pair (SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset x)) - (SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset y)) ∈ _ - rw [run.restrictionFunction_raw ordinal cutOrdinal subset x q A xCode, - run.restrictionFunction_raw ordinal cutOrdinal subset y p D yCode] - rw [xCode, yCode] at below - exact run.cut_order_le ordinal cutOrdinal subset below - -end RecursiveRefinementOrderHistory - -namespace RecursiveRefinementOrderHistory -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) -variable (subset : alpha ⊆ stages) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -variable (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) -variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) -variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ A lower stronger, stageOneRawTests M d A lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) -local notation "U" => M.refinementHistoryForcing rows T stages history -local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) -include run ordinal cutOrdinal subset pairing unions powers separation infinite choice hStages hHistory hT hAlpha hRows topMem topRows mono - -noncomputable def inclusionFunction (x : SetMembers L) : SetMembers U := - SetMembers.ofMem (SetMembers.raw x) (by - obtain ⟨row, _, A, _, equal⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem x)) - rw [equal] - exact run.include_mem ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono (equal ▸ SetMembers.raw_mem x)) - -local notation "inc" => run.inclusionFunction ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono - -theorem inclusionFunction_raw (x : SetMembers L) : SetMembers.raw (inc x) = SetMembers.raw x := - SetMembers.raw_ofMem _ _ - -noncomputable def inclusion (order : PartialOrderCode rows rowOrder) : - letI := M.refinementHistoryPartialOrder order T stages history - letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) - SetMembers L ↪o SetMembers U := by - letI := M.refinementHistoryPartialOrder order T stages history - letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) - have raw := run.inclusionFunction_raw ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono - refine { toFun := inc, inj' := ?_, map_rel_iff' := ?_ } - · intro x y equal - apply SetMembers.raw_injective L - exact (raw x).symm.trans ((congrArg SetMembers.raw equal).trans (raw y)) - · intro x y - change ZFSet.pair (SetMembers.raw (inc x)) (SetMembers.raw (inc y)) ∈ _ ↔ - ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ _ - rw [raw x, raw y] - have hx := SetMembers.raw_mem x - have hy := SetMembers.raw_mem y - have ux := SetMembers.raw_mem (inc x) - have uy := SetMembers.raw_mem (inc y) - rw [raw x] at ux - rw [raw y] at uy - obtain ⟨q, _, A, _, xCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) hx) - obtain ⟨p, _, D, _, yCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) hy) - rw [xCode] at hx ux - rw [yCode] at hy uy - rw [xCode, yCode, M.pair_mem_refinementHistoryOrder, M.pair_mem_refinementHistoryOrder] - simp only [hx, hy, ux, uy, true_and] - -end RecursiveRefinementOrderHistory - -namespace RecursiveRefinementOrderHistory -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) -variable (subset : alpha ⊆ stages) -local notation "U" => M.refinementHistoryForcing rows T stages history -local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) -local notation "sU" => SetMembers.presentation U -local notation "sL" => SetMembers.presentation L - -theorem restrictionFunction_graph : - (sU).graph sL (run.restrictionFunction ordinal cutOrdinal subset) = - rowAssignmentCutGraph U L (refinementDataHistoryLevels stages history T) alpha := - (sU).graph_decodeFunction sL _ (run.restrictionGraph_function ordinal cutOrdinal subset) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -variable (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) - -include pairing unions powers separation hStages hHistory hT hAlpha hRows in -theorem restrictionFunction_graph_mem (omega : ZFSet.omega ∈ M.sets) : - (sU).graph sL (run.restrictionFunction ordinal cutOrdinal subset) ∈ M.sets := by - rw [run.restrictionFunction_graph] - exact M.rowAssignmentCutGraph_mem pairing unions powers separation - (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega) - (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hAlpha - (M.graphRestriction_mem unions separation hAlpha hHistory) omega) - (M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT) hAlpha - -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) -variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ A lower stronger, stageOneRawTests M d A lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) -local notation "inc" => run.inclusionFunction ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono - -theorem inclusionFunction_graph : (sL).graph sU inc = identityFunctionGraph L := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph, mem_identityFunctionGraph] - have code := run.inclusionFunction_raw ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono - constructor - · rintro ⟨x, rfl⟩ - change ∃ y ∈ L, ZFSet.pair (SetMembers.raw x) (SetMembers.raw (inc x)) = ZFSet.pair y y - rw [code x] - exact ⟨SetMembers.raw x, SetMembers.raw_mem x, rfl⟩ - · rintro ⟨x, member, rfl⟩ - let q := SetMembers.ofMem x member - refine ⟨q, ?_⟩ - change ZFSet.pair (SetMembers.raw q) (SetMembers.raw (inc q)) = ZFSet.pair x x - rw [code q, SetMembers.raw_ofMem] - -include pairing unions powers separation hStages hHistory hT hAlpha hRows in -theorem inclusionFunction_graph_mem (omega : ZFSet.omega ∈ M.sets) : - (sL).graph sU inc ∈ M.sets := by - rw [run.inclusionFunction_graph] - exact M.identityFunctionGraph_mem pairing unions powers separation - (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hAlpha - (M.graphRestriction_mem unions separation hAlpha hHistory) omega) - -end RecursiveRefinementOrderHistory - -namespace RecursiveRefinementOrderHistory -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) -variable (subset : alpha ⊆ stages) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -variable (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) -variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) -variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → - ∀ A lower stronger, stageOneRawTests M d A lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) -local notation "U" => M.refinementHistoryForcing rows T stages history -local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) -local notation "levels" => refinementDataHistoryLevels stages history T -local notation "res" => run.restrictionFunction ordinal cutOrdinal subset -local notation "inc" => run.inclusionFunction ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono -include run ordinal cutOrdinal subset pairing unions powers separation infinite choice hStages hHistory hT hAlpha hRows topMem topRows mono - -theorem completeProjection (order : PartialOrderCode rows rowOrder) : - letI := M.refinementHistoryPartialOrder order T stages history - letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) - CompleteProjection (run.restriction ordinal cutOrdinal subset order) - (run.inclusion ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono order) := by - let := M.refinementHistoryPartialOrder order T stages history - let := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) - have incRaw := run.inclusionFunction_raw ordinal cutOrdinal subset pairing unions powers separation infinite choice - hStages hHistory hT hAlpha hRows top topMem topRows mono - have resRaw := run.restrictionFunction_raw ordinal cutOrdinal subset - have lowerFixed : ∀ (x : SetMembers L) row A, SetMembers.raw x = ZFSet.pair row A → - assignmentCut levels alpha A = A := by - intro x row A code - have member := SetMembers.raw_mem x - rw [code] at member - exact run.carriers.data.prefix_assignments_cut subset - (((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 - ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 member).1).2.2.1) - refine ⟨?_, ?_, ?_⟩ - · intro q - change res (inc q) = q - obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem q)) - apply SetMembers.raw_injective L - rw [resRaw (inc q) row A ((incRaw q).trans code), lowerFixed q row A code, code] - · intro p q - obtain ⟨rowP, _, Ap, _, pCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem p)) - obtain ⟨rowQ, _, Aq, _, qCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem q)) - have hp := SetMembers.raw_mem p - have hq := SetMembers.raw_mem q - have hinc := SetMembers.raw_mem (inc q) - have hres := SetMembers.raw_mem (res p) - rw [pCode] at hp - rw [qCode] at hq - rw [incRaw q, qCode] at hinc - rw [resRaw p rowP Ap pCode] at hres - change ZFSet.pair (SetMembers.raw p) (SetMembers.raw (inc q)) ∈ _ ↔ - ZFSet.pair (SetMembers.raw (res p)) (SetMembers.raw q) ∈ _ - rw [incRaw q, resRaw p rowP Ap pCode, pCode, qCode, - M.pair_mem_refinementHistoryOrder, M.pair_mem_refinementHistoryOrder] - simp only [hp, hq, hinc, hres, true_and] - constructor - · rintro ⟨rowsBelow, data⟩ - refine ⟨rowsBelow, ?_⟩ - have cutData : assignmentCut levels alpha Aq ⊆ assignmentCut levels alpha Ap := assignmentCut_mono data - rwa [lowerFixed q rowQ Aq qCode] at cutData - · rintro ⟨rowsBelow, data⟩ - exact ⟨rowsBelow, fun _ member => assignmentCut_subset levels alpha Ap (data member)⟩ - · intro p q below - obtain ⟨rowP, _, Ap, _, pCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem p)) - obtain ⟨rowQ, _, Aq, _, qCode⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem q)) - have hp := SetMembers.raw_mem p - rw [pCode] at hp - change ZFSet.pair (SetMembers.raw q) (SetMembers.raw (res p)) ∈ _ at below - rw [resRaw p rowP Ap pCode, qCode] at below - obtain ⟨member, stronger, exactCut⟩ := run.splice_lifting pairing unions powers separation infinite choice - hStages hHistory hT hAlpha ordinal cutOrdinal subset mono hp below - let r : SetMembers U := SetMembers.ofMem (ZFSet.pair rowQ (assignmentSplice levels alpha Aq Ap)) member - have rCode : SetMembers.raw r = ZFSet.pair rowQ (assignmentSplice levels alpha Aq Ap) := - SetMembers.raw_ofMem _ _ - refine ⟨r, ?_, ?_⟩ - · change ZFSet.pair (SetMembers.raw r) (SetMembers.raw p) ∈ _ - rwa [rCode, pCode] - · change res r = q - apply SetMembers.raw_injective L - rw [resRaw r rowQ (assignmentSplice levels alpha Aq Ap) rCode, exactCut, qCode] - -end RecursiveRefinementOrderHistory - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R : Type u} -variable (c : Presentation R) (T stages history : ZFSet.{u}) -local notation "Q" => M.refinementHistoryForcing c.carrier T stages history -local notation "upper" => SetMembers.presentation Q - -private theorem rowCarrier_shape : Q ⊆ ZFSet.prod c.carrier (Q).sUnion.sUnion := by - intro z hz - obtain ⟨row, hrow, A, _, code⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape c.carrier T stages history hz) - rw [code] at hz ⊢ - exact ZFSet.pair_mem_prod.2 ⟨hrow, pair_second_mem_doubleUnion hz⟩ - -noncomputable def refinementHistoryRowFunction : SetMembers Q → R := - (upper).decodeFunction c (rowAssignmentRows Q c.carrier (Q).sUnion.sUnion) - (rowAssignmentRows_function (M.rowCarrier_shape c T stages history)) - -theorem refinementHistoryRowFunction_code (p : SetMembers Q) (row : R) (A : ZFSet.{u}) - (code : SetMembers.raw p = ZFSet.pair (c.encode row) A) : - M.refinementHistoryRowFunction c T stages history p = row := by - have entry := (upper).decodeFunction_mem c (rowAssignmentRows Q c.carrier (Q).sUnion.sUnion) - (rowAssignmentRows_function (M.rowCarrier_shape c T stages history)) p - change ZFSet.pair (SetMembers.raw p) - (c.encode (M.refinementHistoryRowFunction c T stages history p)) ∈ _ at entry - rw [code] at entry - apply c.injective - exact ((rowAssignmentRows_entry Q c.carrier (Q).sUnion.sUnion (c.encode row) A _).1 entry).2.2.2 - -theorem refinementHistoryRowFunction_coordinates (p : SetMembers Q) : - ∃ A, SetMembers.raw p = - ZFSet.pair (c.encode (M.refinementHistoryRowFunction c T stages history p)) A := by - obtain ⟨row, hrow, A, _, code⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape c.carrier T stages history (SetMembers.raw_mem p)) - obtain ⟨r, rfl⟩ := (c.mem_carrier row).1 hrow - exact ⟨A, (M.refinementHistoryRowFunction_code c T stages history p r A code).symm ▸ code⟩ - -theorem refinementHistoryRowFunction_graph : - (upper).graph c (M.refinementHistoryRowFunction c T stages history) = - rowAssignmentRows Q c.carrier (Q).sUnion.sUnion := - (upper).graph_decodeFunction c _ _ - -variable [PartialOrder R] - -noncomputable def refinementHistoryRowRestriction : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - SetMembers Q →o R := by - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - refine { toFun := M.refinementHistoryRowFunction c T stages history, monotone' := ?_ } - intro p q below - obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history p - obtain ⟨B, qCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history q - change ZFSet.pair (SetMembers.raw p) (SetMembers.raw q) ∈ _ at below - rw [pCode, qCode] at below - exact (c.pair_mem_conditionOrder _ _).1 - ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages history _ _ _ _).1 below).2.2.1 - -variable (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages history) -variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) -local notation "incl" => M.refinementHistoryRowInclusion c run.carriers ordinal carrier -local notation "res" => M.refinementHistoryRowFunction c T stages history - -noncomputable def refinementHistoryRowEmbedding : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - R ↪o SetMembers Q := by - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - have incRaw : ∀ p : R, SetMembers.raw (incl p) = ZFSet.pair (c.encode p) ∅ := - M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier - refine { toFun := incl, inj' := ?_, map_rel_iff' := ?_ } - · intro p q equal - apply c.injective - have raw := congrArg SetMembers.raw equal - rw [incRaw p, incRaw q] at raw - exact (ZFSet.pair_injective raw).1 - · intro p q - change ZFSet.pair (SetMembers.raw (incl p)) (SetMembers.raw (incl q)) ∈ _ ↔ p ≤ q - rw [incRaw p, incRaw q, M.pair_mem_refinementHistoryOrder] - have hp := SetMembers.raw_mem (incl p) - have hq := SetMembers.raw_mem (incl q) - rw [incRaw p] at hp - rw [incRaw q] at hq - constructor - · intro below - exact (c.pair_mem_conditionOrder _ _).1 below.2.2.1 - · intro below - exact ⟨hp, hq, (c.pair_mem_conditionOrder _ _).2 below, fun _ hz => hz⟩ - -theorem refinementHistoryRow_retract (q : R) : res (incl q) = q := - M.refinementHistoryRowFunction_code c T stages history (incl q) q ∅ - (M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier q) - -theorem refinementHistoryRow_le_include : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - ∀ p : SetMembers Q, ∀ q : R, - p ≤ M.refinementHistoryRowEmbedding c T stages history run ordinal carrier q ↔ res p ≤ q := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - intro p q - obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history p - have incCode : SetMembers.raw (incl q) = ZFSet.pair (c.encode q) ∅ := - M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier q - have hp := SetMembers.raw_mem p - have hq := SetMembers.raw_mem (incl q) - rw [pCode] at hp - rw [incCode] at hq - change ZFSet.pair (SetMembers.raw p) (SetMembers.raw (incl q)) ∈ _ ↔ res p ≤ q - rw [pCode, incCode, M.pair_mem_refinementHistoryOrder] - constructor - · intro below - exact (c.pair_mem_conditionOrder _ _).1 below.2.2.1 - · intro below - exact ⟨hp, hq, (c.pair_mem_conditionOrder _ _).2 below, - fun z hz => (ZFSet.notMem_empty z hz).elim⟩ - -theorem refinementHistoryRowInclusion_graph : - c.graph upper incl = c.graph c.pairEmpty id := by - apply ZFSet.ext - intro z - rw [c.mem_graph, c.mem_graph] - constructor - · rintro ⟨p, rfl⟩ - rw [M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier] - exact ⟨p, rfl⟩ - · rintro ⟨p, rfl⟩ - refine ⟨p, ?_⟩ - rw [M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier] - rfl - -theorem refinementHistoryRowGraphs_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hQ : Q ∈ M.sets) : - (upper).graph c res ∈ M.sets ∧ c.graph upper incl ∈ M.sets := by - constructor - · rw [M.refinementHistoryRowFunction_graph] - exact M.rowAssignmentRows_mem pairing unions powers separation hQ carrier - (M.union_mem unions (M.union_mem unions hQ)) - · rw [M.refinementHistoryRowInclusion_graph c T stages history run ordinal carrier] - exact M.pairEmpty_forwardGraph_mem pairing unions powers separation c carrier - -private theorem assignmentCut_zero (levels A : ZFSet.{u}) : assignmentCut levels ∅ A = ∅ := by - apply ZFSet.ext - intro z - simp only [mem_assignmentCut, ZFSet.notMem_empty, false_and, exists_false, and_false] - -theorem refinementHistoryRow_completeProjection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) - (top : ZFSet.{u}) (topMem : top ∈ c.carrier) - (topRows : ∀ row ∈ c.carrier, ZFSet.pair row top ∈ c.conditionOrder) - (mono : ∀ beta (fields : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode fields) ∈ history → - ∀ A lower stronger, stageOneRawTests M fields A lower → - ZFSet.pair stronger lower ∈ fields 8 → stageOneRawTests M fields A stronger) : - letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - CompleteProjection (M.refinementHistoryRowRestriction c T stages history) - (M.refinementHistoryRowEmbedding c T stages history run ordinal carrier) := by - let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history - refine ⟨M.refinementHistoryRow_retract c T stages history run ordinal carrier, - M.refinementHistoryRow_le_include c T stages history run ordinal carrier, ?_⟩ - intro p q below - let Q0 := M.refinementHistoryForcing c.carrier T ∅ (graphRestriction ∅ history) - let := M.refinementHistoryPartialOrder c.conditionOrder_code T ∅ (graphRestriction ∅ history) - have zeroSubset : (∅ : ZFSet.{u}) ⊆ stages := fun z hz => (ZFSet.notMem_empty z hz).elim - have hEmpty : (∅ : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨c.carrier, carrier⟩ - let cut := run.restriction ordinal ordinalSetProperty_empty zeroSubset c.conditionOrder_code - have projection := run.completeProjection ordinal ordinalSetProperty_empty zeroSubset - pairing unions powers separation infinite choice hStages hHistory hT hEmpty carrier - top topMem topRows mono c.conditionOrder_code - have zeroCode : ZFSet.pair (c.encode q) ∅ ∈ Q0 := by - change ZFSet.pair (c.encode q) ∅ ∈ M.refinementHistoryForcing c.carrier T ∅ (graphRestriction ∅ history) - rw [M.refinementHistoryForcing_initial carrier T (graphRestriction ∅ history)] - exact ZFSet.pair_mem_prod.2 ⟨c.encode_mem q, ZFSet.mem_singleton.2 rfl⟩ - let q0 : SetMembers Q0 := SetMembers.ofMem (ZFSet.pair (c.encode q) ∅) zeroCode - have q0Code : SetMembers.raw q0 = ZFSet.pair (c.encode q) ∅ := SetMembers.raw_ofMem _ _ - obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history p - have cutCode : SetMembers.raw (cut p) = ZFSet.pair (c.encode (res p)) ∅ := by - change SetMembers.raw (run.restrictionFunction ordinal ordinalSetProperty_empty zeroSubset p) = _ - rw [run.restrictionFunction_raw ordinal ordinalSetProperty_empty zeroSubset p (c.encode (res p)) A pCode, - assignmentCut_zero] - have cutMember := SetMembers.raw_mem (cut p) - rw [cutCode] at cutMember - have belowZero : q0 ≤ cut p := by - change ZFSet.pair (SetMembers.raw q0) (SetMembers.raw (cut p)) ∈ _ - rw [q0Code, cutCode, M.pair_mem_refinementHistoryOrder] - exact ⟨zeroCode, cutMember, (c.pair_mem_conditionOrder _ _).2 below, fun _ hz => hz⟩ - obtain ⟨r, rp, exactCut⟩ := projection.lift p q0 belowZero - refine ⟨r, rp, ?_⟩ - obtain ⟨B, rCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history r - have cutR : SetMembers.raw (cut r) = ZFSet.pair (c.encode (res r)) ∅ := by - change SetMembers.raw (run.restrictionFunction ordinal ordinalSetProperty_empty zeroSubset r) = _ - rw [run.restrictionFunction_raw ordinal ordinalSetProperty_empty zeroSubset r (c.encode (res r)) B rCode, - assignmentCut_zero] - have equal := congrArg SetMembers.raw exactCut - change SetMembers.raw (cut r) = SetMembers.raw q0 at equal - rw [cutR, q0Code] at equal - exact c.injective (ZFSet.pair_injective equal).1 - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveRowNameActions +import OAI.SetTheory.PartitionPrinciple.Forcing.RecursiveRefinementUnionConditions + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetRealization +universe u +namespace RecursiveRefinementDataHistory +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history top : ZFSet.{u}} + +theorem greatest (run : RecursiveRefinementDataHistory M rows T stages history) + (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) + (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) : + ∀ z ∈ M.refinementHistoryForcing rows T stages history, + ZFSet.pair z (ZFSet.pair top ∅) ∈ M.refinementHistoryOrder rows rowOrder T stages history := + rowAssignmentOrder_top (M.refinementHistoryForcing_shape rows T stages history) topRows + (run.empty_assignments ordinal hRows topMem) + +end RecursiveRefinementDataHistory +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {rows rowOrder : ZFSet.{u}} +variable (order : PartialOrderCode rows rowOrder) (T stages history : ZFSet.{u}) + +@[instance_reducible] noncomputable def refinementHistoryPartialOrder : + PartialOrder (SetMembers (M.refinementHistoryForcing rows T stages history)) := + (M.refinementHistoryOrder_partialOrder order T stages history).toPartialOrder + +theorem refinementHistoryDecodedOrder_eq : + letI := M.refinementHistoryPartialOrder order T stages history + (SetMembers.presentation (M.refinementHistoryForcing rows T stages history)).conditionOrder = + M.refinementHistoryOrder rows rowOrder T stages history := + (M.refinementHistoryOrder_partialOrder order T stages history).conditionOrder_eq + +@[instance_reducible] noncomputable def refinementHistoryOrderTop + (run : RecursiveRefinementDataHistory M rows T stages history) + (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) + (top : ZFSet.{u}) (topMem : top ∈ rows) + (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) : + letI := M.refinementHistoryPartialOrder order T stages history + OrderTop (SetMembers (M.refinementHistoryForcing rows T stages history)) := + (M.refinementHistoryOrder_partialOrder order T stages history).toOrderTop (ZFSet.pair top ∅) + (run.empty_assignments ordinal hRows topMem) (run.greatest ordinal hRows topMem topRows) + +theorem refinementHistoryDecodedTop_eq + (run : RecursiveRefinementDataHistory M rows T stages history) + (ordinal : ordinalSetProperty stages) (hRows : rows ∈ M.sets) + (top : ZFSet.{u}) (topMem : top ∈ rows) + (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) : + letI := M.refinementHistoryPartialOrder order T stages history + letI := M.refinementHistoryOrderTop order T stages history run ordinal hRows top topMem topRows + (SetMembers.presentation (M.refinementHistoryForcing rows T stages history)).encode ⊤ = ZFSet.pair top ∅ := + SetMembers.raw_ofMem _ _ + +end TransitiveGround + +end + +namespace TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R : Type u} [PartialOrder R] (c : Presentation R) +variable {T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementDataHistory M c.carrier T stages history) +variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) +variable (rowTop : R) +variable (topRows : ∀ row ∈ c.carrier, ZFSet.pair row (c.encode rowTop) ∈ c.conditionOrder) +include run ordinal carrier topRows + +theorem refinementHistoryRowNameFamily_power_eq (X : ZFSet.{u}) + (valid : ∀ z ∈ X, IsName c.pairEmpty z) (n : Nat) : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + letI := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier + (c.encode rowTop) (c.encode_mem rowTop) topRows + Name.renamedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) + (M.refinementHistoryRowInclusion c run ordinal carrier) + (iteratedPairNameFamily (c.pairEmpty.encode rowTop) X n) + (iteratedPairNameFamily_valid rowTop valid n) = + iteratedPairNameFamily + ((SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).encode ⊤) X n := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + let := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier + (c.encode rowTop) (c.encode_mem rowTop) topRows + rw [M.refinementHistoryRowNameFamily_eq c run ordinal carrier, + M.refinementHistoryDecodedTop_eq] + rfl + +theorem refinementHistoryRowNameFamily_square_eq (X Y : ZFSet.{u}) + (validX : ∀ z ∈ X, IsName c.pairEmpty z) (validY : ∀ z ∈ Y, IsName c.pairEmpty z) : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + letI := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier + (c.encode rowTop) (c.encode_mem rowTop) topRows + Name.renamedFamily (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) + (M.refinementHistoryRowInclusion c run ordinal carrier) + (orderedPairNameFamily (c.pairEmpty.encode rowTop) X Y) + (orderedPairNameFamily_valid rowTop validX validY) = + orderedPairNameFamily + ((SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).encode ⊤) X Y := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + let := M.refinementHistoryOrderTop c.conditionOrder_code T stages history run ordinal carrier + (c.encode rowTop) (c.encode_mem rowTop) topRows + rw [M.refinementHistoryRowNameFamily_eq c run ordinal carrier, + M.refinementHistoryDecodedTop_eq] + rfl + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder L] + +theorem recursiveRefinementStageSystem + (c : Presentation R) (a : PosetAction G R) (t : Presentation G) + (b : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 stages history : ZFSet.{u}) + (run : RecursiveRefinementDataHistory M c.carrier T stages history) + (ordinal : ordinalSetProperty stages) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) + (valid1 : ∀ z ∈ T, IsName c.pairEmpty z) + (valid2 : ∀ z ∈ T2, IsName c.pairEmpty z) + (closed1 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T → (a.act c.pairEmpty g tau).val ∈ T) + (closed2 : ∀ g (tau : Name c.pairEmpty), tau.val ∈ T2 → (a.act c.pairEmpty g tau).val ∈ T2) + (symmetric1 : ∀ tau : Name c.pairEmpty, tau.val ∈ T → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) + (symmetric2 : ∀ tau : Name c.pairEmpty, tau.val ∈ T2 → + HereditarilySymmetric a c.pairEmpty (d.principalSupportFamily base directed) tau) + (top : ZFSet.{u}) (topMem : top ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row top ∈ c.conditionOrder) : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + letI := M.refinementHistoryOrderTop c.conditionOrder_code T stages history + run ordinal carrier top topMem topRows + ∀ (e : PosetAction G (SetMembers (M.refinementHistoryForcing c.carrier T stages history))) + (image : G → ZFSet.{u} → ZFSet.{u}), + (∀ g (q : SetMembers (M.refinementHistoryForcing c.carrier T stages history)) row A, + SetMembers.raw q = ZFSet.pair (c.encode row) A → + SetMembers.raw (e.iso g q) = ZFSet.pair (c.encode (a.iso g row)) (image g A)) → + (∀ g, image g ∅ = ∅) → + e.actionGraph (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) t ∈ M.sets → + RefinementStageSystem M e + (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) + t b d base directed stages T T2 := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + let := M.refinementHistoryOrderTop c.conditionOrder_code T stages history + run ordinal carrier top topMem topRows + intro e image coordinates emptyImage actionGround + have nextCarrier : (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).carrier ∈ M.sets := + M.refinementHistoryForcing_mem pairing unions powers separation carrier hT hStages hHistory omega + have nextOrder : (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)).conditionOrder ∈ M.sets := by + rw [M.refinementHistoryDecodedOrder_eq] + exact M.refinementHistoryOrder_mem pairing unions powers separation carrier order hT hStages hHistory omega + have maps := M.conditionMapFamily_mem_of_actionGraph e + (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) t + pairing unions powers separation collection nextCarrier group actionGround + obtain ⟨nextValid1, nextClosed1, nextHS1⟩ := + M.refinementHistoryRowNameFamily_transport c run ordinal carrier a e image coordinates emptyImage + (d.principalSupportFamily base directed) T valid1 closed1 symmetric1 + obtain ⟨nextValid2, nextClosed2, nextHS2⟩ := + M.refinementHistoryRowNameFamily_transport c run ordinal carrier a e image coordinates emptyImage + (d.principalSupportFamily base directed) T2 valid2 closed2 symmetric2 + exact M.refinementStageSystem e + (SetMembers.presentation (M.refinementHistoryForcing c.carrier T stages history)) t b d base directed + pairing unions powers separation collection nextCarrier nextOrder group nodes nodeOrder maps nodeMaps supports + hStages hT hT2 nextValid1 nextValid2 nextClosed1 nextClosed2 nextHS1 nextHS2 + +end TransitiveGround + +namespace RecursiveRefinementOrderHistory +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +variable {alpha p Ap q Aq : ZFSet.{u}} (hAlpha : alpha ∈ M.sets) +variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) +variable (cutSubset : alpha ⊆ stages) +variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ A lower stronger, stageOneRawTests M d A lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) +include run pairing unions powers separation infinite choice hStages hHistory hT hAlpha ordinal cutOrdinal cutSubset mono +local notation "levels" => refinementDataHistoryLevels stages history T +local notation "spliced" => assignmentSplice levels alpha Aq Ap + +theorem splice_mem + (upper : ZFSet.pair p Ap ∈ M.refinementHistoryForcing rows T stages history) + (lower : ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T alpha (graphRestriction alpha history)) + (rowsBelow : ZFSet.pair q p ∈ rowOrder) + (contains : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq) : + ZFSet.pair q spliced ∈ M.refinementHistoryForcing rows T stages history := by + have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT + have candidate := M.refinementDataHistoryCandidate_splice pairing unions powers separation infinite choice + cutSubset hLevels hAlpha + ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).1 + ((M.mem_refinementHistoryForcing rows T stages history _).1 upper).1 + exact run.splice_mem_of_candidates ordinal cutOrdinal cutSubset mono upper lower rowsBelow contains candidate + (fun beta hbeta => M.refinementDataHistoryCandidate_cut separation run.carriers.data + (ordinal.1 beta hbeta) hLevels (M.transitive hStages hbeta) (M.omega_mem separation infinite) candidate) + +theorem splice_lifting + (upper : ZFSet.pair p Ap ∈ M.refinementHistoryForcing rows T stages history) + (below : ZFSet.pair (ZFSet.pair q Aq) (ZFSet.pair p (assignmentCut levels alpha Ap)) ∈ + M.refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history)) : + ZFSet.pair q spliced ∈ M.refinementHistoryForcing rows T stages history ∧ + ZFSet.pair (ZFSet.pair q spliced) (ZFSet.pair p Ap) ∈ + M.refinementHistoryOrder rows rowOrder T stages history ∧ + assignmentCut levels alpha spliced = Aq := by + obtain ⟨lower, _, rowsBelow, contains⟩ := + (M.pair_mem_refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history) _ _ _ _).1 below + have lowerData := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 + ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).1).2.2.1 + have fullLower := run.carriers.data.prefix_assignments_cut cutSubset lowerData + have retained : assignmentCut levels alpha Ap ⊆ assignmentCut levels alpha Aq := by + rw [fullLower] + exact contains + have member := run.splice_mem pairing unions powers separation infinite choice hStages hHistory hT hAlpha + ordinal cutOrdinal cutSubset mono upper lower rowsBelow retained + refine ⟨member, (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).2 + ⟨member, upper, rowsBelow, assignmentSplice_extends retained⟩, ?_⟩ + rw [assignmentCut_splice, fullLower] + +end RecursiveRefinementOrderHistory + +namespace RecursiveRefinementOrderHistory +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) +variable (subset : alpha ⊆ stages) +include run ordinal cutOrdinal subset + +theorem cut_mem_le {row A : ZFSet.{u}} + (member : ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history) : + ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) alpha A) ∈ + M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) := by + have compare : alpha ∈ stages ∨ alpha = stages := by + obtain ⟨a, ea⟩ := (ordinalSetProperty_iff alpha).1 cutOrdinal + obtain ⟨b, eb⟩ := (ordinalSetProperty_iff stages).1 ordinal + have below := (ordinalCode_subset_iff a b).1 (ea ▸ eb ▸ subset) + rcases lt_or_eq_of_le below with less | equal + · exact Or.inl (ea ▸ eb ▸ (mem_ordinalCode_iff a b).2 less) + · exact Or.inr (ea.trans ((congrArg ordinalCode equal).trans eb.symm)) + rcases compare with earlier | rfl + · exact run.carriers.cut_mem member earlier + · rw [run.carriers.data.function.restriction_eq] + have data := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 + ((M.mem_refinementHistoryForcing rows T _ history _).1 member).1).2.2.1 + rw [assignmentCut_full run.carriers.data.levels_function data] + exact member + +theorem cut_order_le {q A p D : ZFSet.{u}} + (below : ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ + M.refinementHistoryOrder rows rowOrder T stages history) : + ZFSet.pair + (ZFSet.pair q (assignmentCut (refinementDataHistoryLevels stages history T) alpha A)) + (ZFSet.pair p (assignmentCut (refinementDataHistoryLevels stages history T) alpha D)) ∈ + M.refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history) := by + obtain ⟨hq, hp, rowBelow, data⟩ := (M.pair_mem_refinementHistoryOrder rows rowOrder T stages history _ _ _ _).1 below + exact (M.pair_mem_refinementHistoryOrder rows rowOrder T alpha (graphRestriction alpha history) _ _ _ _).2 + ⟨run.cut_mem_le ordinal cutOrdinal subset hq, run.cut_mem_le ordinal cutOrdinal subset hp, + rowBelow, assignmentCut_mono data⟩ + +theorem include_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) + (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) + (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) + (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ A lower stronger, stageOneRawTests M d A lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) + {q Aq : ZFSet.{u}} + (lower : ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T alpha (graphRestriction alpha history)) : + ZFSet.pair q Aq ∈ M.refinementHistoryForcing rows T stages history := by + have lowerFacts := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 + ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 lower).1 + have fullLower := run.carriers.data.prefix_assignments_cut subset lowerFacts.2.2.1 + have member := run.splice_mem pairing unions powers separation infinite choice hStages hHistory hT hAlpha + ordinal cutOrdinal subset mono (run.carriers.empty_assignments ordinal hRows topMem) lower + (topRows q lowerFacts.1) (by + rw [assignmentCut_empty_data] + exact fun z impossible => False.elim (ZFSet.notMem_empty z impossible)) + have equal : assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq ∅ = Aq := by + rw [assignmentSplice, fullLower] + apply ZFSet.ext + intro z + rw [ZFSet.mem_union, mem_assignmentUpper] + exact ⟨fun h => h.elim id (fun h => False.elim (ZFSet.notMem_empty z h.1)), Or.inl⟩ + exact equal ▸ member + +end RecursiveRefinementOrderHistory + +namespace RecursiveRefinementOrderHistory +open SetRealization +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) +variable (subset : alpha ⊆ stages) +local notation "U" => M.refinementHistoryForcing rows T stages history +local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) +local notation "levels" => refinementDataHistoryLevels stages history T +local notation "sU" => SetMembers.presentation U +local notation "sL" => SetMembers.presentation L +include run ordinal cutOrdinal subset + +theorem restrictionGraph_function : + ZFSet.IsFunc U L (rowAssignmentCutGraph U L levels alpha) := + rowAssignmentCutGraph_function U L levels alpha + (fun z member => by + obtain ⟨row, _, A, _, equal⟩ := ZFSet.mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history member) + exact ⟨row, A, equal⟩) + (fun _ _ member => run.cut_mem_le ordinal cutOrdinal subset member) + +noncomputable def restrictionFunction : SetMembers U → SetMembers L := + (sU).decodeFunction sL (rowAssignmentCutGraph U L levels alpha) + (run.restrictionGraph_function ordinal cutOrdinal subset) + +theorem restrictionFunction_raw (x : SetMembers U) (row A : ZFSet.{u}) + (code : SetMembers.raw x = ZFSet.pair row A) : + SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset x) = + ZFSet.pair row (assignmentCut levels alpha A) := by + have entry := (sU).decodeFunction_mem sL (rowAssignmentCutGraph U L levels alpha) + (run.restrictionGraph_function ordinal cutOrdinal subset) x + change ZFSet.pair (SetMembers.raw x) + (SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset x)) ∈ _ at entry + rw [code] at entry + exact ((pair_mem_rowAssignmentCutGraph U L levels alpha row A _).1 entry).2.2 + +noncomputable def restriction (order : PartialOrderCode rows rowOrder) : + letI := M.refinementHistoryPartialOrder order T stages history + letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) + SetMembers U →o SetMembers L := by + letI := M.refinementHistoryPartialOrder order T stages history + letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) + refine { toFun := run.restrictionFunction ordinal cutOrdinal subset, monotone' := ?_ } + intro x y below + obtain ⟨q, _, A, _, xCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem x)) + obtain ⟨p, _, D, _, yCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem y)) + change ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ _ at below + change ZFSet.pair (SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset x)) + (SetMembers.raw (run.restrictionFunction ordinal cutOrdinal subset y)) ∈ _ + rw [run.restrictionFunction_raw ordinal cutOrdinal subset x q A xCode, + run.restrictionFunction_raw ordinal cutOrdinal subset y p D yCode] + rw [xCode, yCode] at below + exact run.cut_order_le ordinal cutOrdinal subset below + +end RecursiveRefinementOrderHistory + +namespace RecursiveRefinementOrderHistory +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) +variable (subset : alpha ⊆ stages) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +variable (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) +variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) +variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ A lower stronger, stageOneRawTests M d A lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) +local notation "U" => M.refinementHistoryForcing rows T stages history +local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) +include run ordinal cutOrdinal subset pairing unions powers separation infinite choice hStages hHistory hT hAlpha hRows topMem topRows mono + +noncomputable def inclusionFunction (x : SetMembers L) : SetMembers U := + SetMembers.ofMem (SetMembers.raw x) (by + obtain ⟨row, _, A, _, equal⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem x)) + rw [equal] + exact run.include_mem ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono (equal ▸ SetMembers.raw_mem x)) + +local notation "inc" => run.inclusionFunction ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono + +theorem inclusionFunction_raw (x : SetMembers L) : SetMembers.raw (inc x) = SetMembers.raw x := + SetMembers.raw_ofMem _ _ + +noncomputable def inclusion (order : PartialOrderCode rows rowOrder) : + letI := M.refinementHistoryPartialOrder order T stages history + letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) + SetMembers L ↪o SetMembers U := by + letI := M.refinementHistoryPartialOrder order T stages history + letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) + have raw := run.inclusionFunction_raw ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono + refine { toFun := inc, inj' := ?_, map_rel_iff' := ?_ } + · intro x y equal + apply SetMembers.raw_injective L + exact (raw x).symm.trans ((congrArg SetMembers.raw equal).trans (raw y)) + · intro x y + change ZFSet.pair (SetMembers.raw (inc x)) (SetMembers.raw (inc y)) ∈ _ ↔ + ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ _ + rw [raw x, raw y] + have hx := SetMembers.raw_mem x + have hy := SetMembers.raw_mem y + have ux := SetMembers.raw_mem (inc x) + have uy := SetMembers.raw_mem (inc y) + rw [raw x] at ux + rw [raw y] at uy + obtain ⟨q, _, A, _, xCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) hx) + obtain ⟨p, _, D, _, yCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) hy) + rw [xCode] at hx ux + rw [yCode] at hy uy + rw [xCode, yCode, M.pair_mem_refinementHistoryOrder, M.pair_mem_refinementHistoryOrder] + simp only [hx, hy, ux, uy, true_and] + +end RecursiveRefinementOrderHistory + +namespace RecursiveRefinementOrderHistory +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) +variable (subset : alpha ⊆ stages) +local notation "U" => M.refinementHistoryForcing rows T stages history +local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) +local notation "sU" => SetMembers.presentation U +local notation "sL" => SetMembers.presentation L + +theorem restrictionFunction_graph : + (sU).graph sL (run.restrictionFunction ordinal cutOrdinal subset) = + rowAssignmentCutGraph U L (refinementDataHistoryLevels stages history T) alpha := + (sU).graph_decodeFunction sL _ (run.restrictionGraph_function ordinal cutOrdinal subset) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +variable (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) + +include pairing unions powers separation hStages hHistory hT hAlpha hRows in +theorem restrictionFunction_graph_mem (omega : ZFSet.omega ∈ M.sets) : + (sU).graph sL (run.restrictionFunction ordinal cutOrdinal subset) ∈ M.sets := by + rw [run.restrictionFunction_graph] + exact M.rowAssignmentCutGraph_mem pairing unions powers separation + (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega) + (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hAlpha + (M.graphRestriction_mem unions separation hAlpha hHistory) omega) + (M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT) hAlpha + +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) +variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ A lower stronger, stageOneRawTests M d A lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) +local notation "inc" => run.inclusionFunction ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono + +theorem inclusionFunction_graph : (sL).graph sU inc = identityFunctionGraph L := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph, mem_identityFunctionGraph] + have code := run.inclusionFunction_raw ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono + constructor + · rintro ⟨x, rfl⟩ + change ∃ y ∈ L, ZFSet.pair (SetMembers.raw x) (SetMembers.raw (inc x)) = ZFSet.pair y y + rw [code x] + exact ⟨SetMembers.raw x, SetMembers.raw_mem x, rfl⟩ + · rintro ⟨x, member, rfl⟩ + let q := SetMembers.ofMem x member + refine ⟨q, ?_⟩ + change ZFSet.pair (SetMembers.raw q) (SetMembers.raw (inc q)) = ZFSet.pair x x + rw [code q, SetMembers.raw_ofMem] + +include pairing unions powers separation hStages hHistory hT hAlpha hRows in +theorem inclusionFunction_graph_mem (omega : ZFSet.omega ∈ M.sets) : + (sL).graph sU inc ∈ M.sets := by + rw [run.inclusionFunction_graph] + exact M.identityFunctionGraph_mem pairing unions powers separation + (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hAlpha + (M.graphRestriction_mem unions separation hAlpha hHistory) omega) + +end RecursiveRefinementOrderHistory + +namespace RecursiveRefinementOrderHistory +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (ordinal : ordinalSetProperty stages) (cutOrdinal : ordinalSetProperty alpha) +variable (subset : alpha ⊆ stages) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +variable (hAlpha : alpha ∈ M.sets) (hRows : rows ∈ M.sets) +variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) +variable (mono : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → + ∀ A lower stronger, stageOneRawTests M d A lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) +local notation "U" => M.refinementHistoryForcing rows T stages history +local notation "L" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) +local notation "levels" => refinementDataHistoryLevels stages history T +local notation "res" => run.restrictionFunction ordinal cutOrdinal subset +local notation "inc" => run.inclusionFunction ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono +include run ordinal cutOrdinal subset pairing unions powers separation infinite choice hStages hHistory hT hAlpha hRows topMem topRows mono + +theorem completeProjection (order : PartialOrderCode rows rowOrder) : + letI := M.refinementHistoryPartialOrder order T stages history + letI := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) + CompleteProjection (run.restriction ordinal cutOrdinal subset order) + (run.inclusion ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono order) := by + let := M.refinementHistoryPartialOrder order T stages history + let := M.refinementHistoryPartialOrder order T alpha (graphRestriction alpha history) + have incRaw := run.inclusionFunction_raw ordinal cutOrdinal subset pairing unions powers separation infinite choice + hStages hHistory hT hAlpha hRows top topMem topRows mono + have resRaw := run.restrictionFunction_raw ordinal cutOrdinal subset + have lowerFixed : ∀ (x : SetMembers L) row A, SetMembers.raw x = ZFSet.pair row A → + assignmentCut levels alpha A = A := by + intro x row A code + have member := SetMembers.raw_mem x + rw [code] at member + exact run.carriers.data.prefix_assignments_cut subset + (((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 + ((M.mem_refinementHistoryForcing rows T alpha (graphRestriction alpha history) _).1 member).1).2.2.1) + refine ⟨?_, ?_, ?_⟩ + · intro q + change res (inc q) = q + obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem q)) + apply SetMembers.raw_injective L + rw [resRaw (inc q) row A ((incRaw q).trans code), lowerFixed q row A code, code] + · intro p q + obtain ⟨rowP, _, Ap, _, pCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem p)) + obtain ⟨rowQ, _, Aq, _, qCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem q)) + have hp := SetMembers.raw_mem p + have hq := SetMembers.raw_mem q + have hinc := SetMembers.raw_mem (inc q) + have hres := SetMembers.raw_mem (res p) + rw [pCode] at hp + rw [qCode] at hq + rw [incRaw q, qCode] at hinc + rw [resRaw p rowP Ap pCode] at hres + change ZFSet.pair (SetMembers.raw p) (SetMembers.raw (inc q)) ∈ _ ↔ + ZFSet.pair (SetMembers.raw (res p)) (SetMembers.raw q) ∈ _ + rw [incRaw q, resRaw p rowP Ap pCode, pCode, qCode, + M.pair_mem_refinementHistoryOrder, M.pair_mem_refinementHistoryOrder] + simp only [hp, hq, hinc, hres, true_and] + constructor + · rintro ⟨rowsBelow, data⟩ + refine ⟨rowsBelow, ?_⟩ + have cutData : assignmentCut levels alpha Aq ⊆ assignmentCut levels alpha Ap := assignmentCut_mono data + rwa [lowerFixed q rowQ Aq qCode] at cutData + · rintro ⟨rowsBelow, data⟩ + exact ⟨rowsBelow, fun _ member => assignmentCut_subset levels alpha Ap (data member)⟩ + · intro p q below + obtain ⟨rowP, _, Ap, _, pCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem p)) + obtain ⟨rowQ, _, Aq, _, qCode⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T alpha (graphRestriction alpha history) (SetMembers.raw_mem q)) + have hp := SetMembers.raw_mem p + rw [pCode] at hp + change ZFSet.pair (SetMembers.raw q) (SetMembers.raw (res p)) ∈ _ at below + rw [resRaw p rowP Ap pCode, qCode] at below + obtain ⟨member, stronger, exactCut⟩ := run.splice_lifting pairing unions powers separation infinite choice + hStages hHistory hT hAlpha ordinal cutOrdinal subset mono hp below + let r : SetMembers U := SetMembers.ofMem (ZFSet.pair rowQ (assignmentSplice levels alpha Aq Ap)) member + have rCode : SetMembers.raw r = ZFSet.pair rowQ (assignmentSplice levels alpha Aq Ap) := + SetMembers.raw_ofMem _ _ + refine ⟨r, ?_, ?_⟩ + · change ZFSet.pair (SetMembers.raw r) (SetMembers.raw p) ∈ _ + rwa [rCode, pCode] + · change res r = q + apply SetMembers.raw_injective L + rw [resRaw r rowQ (assignmentSplice levels alpha Aq Ap) rCode, exactCut, qCode] + +end RecursiveRefinementOrderHistory + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R : Type u} +variable (c : Presentation R) (T stages history : ZFSet.{u}) +local notation "Q" => M.refinementHistoryForcing c.carrier T stages history +local notation "upper" => SetMembers.presentation Q + +private theorem rowCarrier_shape : Q ⊆ ZFSet.prod c.carrier (Q).sUnion.sUnion := by + intro z hz + obtain ⟨row, hrow, A, _, code⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape c.carrier T stages history hz) + rw [code] at hz ⊢ + exact ZFSet.pair_mem_prod.2 ⟨hrow, pair_second_mem_doubleUnion hz⟩ + +noncomputable def refinementHistoryRowFunction : SetMembers Q → R := + (upper).decodeFunction c (rowAssignmentRows Q c.carrier (Q).sUnion.sUnion) + (rowAssignmentRows_function (M.rowCarrier_shape c T stages history)) + +theorem refinementHistoryRowFunction_code (p : SetMembers Q) (row : R) (A : ZFSet.{u}) + (code : SetMembers.raw p = ZFSet.pair (c.encode row) A) : + M.refinementHistoryRowFunction c T stages history p = row := by + have entry := (upper).decodeFunction_mem c (rowAssignmentRows Q c.carrier (Q).sUnion.sUnion) + (rowAssignmentRows_function (M.rowCarrier_shape c T stages history)) p + change ZFSet.pair (SetMembers.raw p) + (c.encode (M.refinementHistoryRowFunction c T stages history p)) ∈ _ at entry + rw [code] at entry + apply c.injective + exact ((rowAssignmentRows_entry Q c.carrier (Q).sUnion.sUnion (c.encode row) A _).1 entry).2.2.2 + +theorem refinementHistoryRowFunction_coordinates (p : SetMembers Q) : + ∃ A, SetMembers.raw p = + ZFSet.pair (c.encode (M.refinementHistoryRowFunction c T stages history p)) A := by + obtain ⟨row, hrow, A, _, code⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape c.carrier T stages history (SetMembers.raw_mem p)) + obtain ⟨r, rfl⟩ := (c.mem_carrier row).1 hrow + exact ⟨A, (M.refinementHistoryRowFunction_code c T stages history p r A code).symm ▸ code⟩ + +theorem refinementHistoryRowFunction_graph : + (upper).graph c (M.refinementHistoryRowFunction c T stages history) = + rowAssignmentRows Q c.carrier (Q).sUnion.sUnion := + (upper).graph_decodeFunction c _ _ + +variable [PartialOrder R] + +noncomputable def refinementHistoryRowRestriction : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + SetMembers Q →o R := by + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + refine { toFun := M.refinementHistoryRowFunction c T stages history, monotone' := ?_ } + intro p q below + obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history p + obtain ⟨B, qCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history q + change ZFSet.pair (SetMembers.raw p) (SetMembers.raw q) ∈ _ at below + rw [pCode, qCode] at below + exact (c.pair_mem_conditionOrder _ _).1 + ((M.pair_mem_refinementHistoryOrder c.carrier c.conditionOrder T stages history _ _ _ _).1 below).2.2.1 + +variable (run : RecursiveRefinementOrderHistory M c.carrier c.conditionOrder T stages history) +variable (ordinal : ordinalSetProperty stages) (carrier : c.carrier ∈ M.sets) +local notation "incl" => M.refinementHistoryRowInclusion c run.carriers ordinal carrier +local notation "res" => M.refinementHistoryRowFunction c T stages history + +noncomputable def refinementHistoryRowEmbedding : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + R ↪o SetMembers Q := by + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + have incRaw : ∀ p : R, SetMembers.raw (incl p) = ZFSet.pair (c.encode p) ∅ := + M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier + refine { toFun := incl, inj' := ?_, map_rel_iff' := ?_ } + · intro p q equal + apply c.injective + have raw := congrArg SetMembers.raw equal + rw [incRaw p, incRaw q] at raw + exact (ZFSet.pair_injective raw).1 + · intro p q + change ZFSet.pair (SetMembers.raw (incl p)) (SetMembers.raw (incl q)) ∈ _ ↔ p ≤ q + rw [incRaw p, incRaw q, M.pair_mem_refinementHistoryOrder] + have hp := SetMembers.raw_mem (incl p) + have hq := SetMembers.raw_mem (incl q) + rw [incRaw p] at hp + rw [incRaw q] at hq + constructor + · intro below + exact (c.pair_mem_conditionOrder _ _).1 below.2.2.1 + · intro below + exact ⟨hp, hq, (c.pair_mem_conditionOrder _ _).2 below, fun _ hz => hz⟩ + +theorem refinementHistoryRow_retract (q : R) : res (incl q) = q := + M.refinementHistoryRowFunction_code c T stages history (incl q) q ∅ + (M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier q) + +theorem refinementHistoryRow_le_include : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + ∀ p : SetMembers Q, ∀ q : R, + p ≤ M.refinementHistoryRowEmbedding c T stages history run ordinal carrier q ↔ res p ≤ q := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + intro p q + obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history p + have incCode : SetMembers.raw (incl q) = ZFSet.pair (c.encode q) ∅ := + M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier q + have hp := SetMembers.raw_mem p + have hq := SetMembers.raw_mem (incl q) + rw [pCode] at hp + rw [incCode] at hq + change ZFSet.pair (SetMembers.raw p) (SetMembers.raw (incl q)) ∈ _ ↔ res p ≤ q + rw [pCode, incCode, M.pair_mem_refinementHistoryOrder] + constructor + · intro below + exact (c.pair_mem_conditionOrder _ _).1 below.2.2.1 + · intro below + exact ⟨hp, hq, (c.pair_mem_conditionOrder _ _).2 below, + fun z hz => (ZFSet.notMem_empty z hz).elim⟩ + +theorem refinementHistoryRowInclusion_graph : + c.graph upper incl = c.graph c.pairEmpty id := by + apply ZFSet.ext + intro z + rw [c.mem_graph, c.mem_graph] + constructor + · rintro ⟨p, rfl⟩ + rw [M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier] + exact ⟨p, rfl⟩ + · rintro ⟨p, rfl⟩ + refine ⟨p, ?_⟩ + rw [M.refinementHistoryRowInclusion_encode c run.carriers ordinal carrier] + rfl + +theorem refinementHistoryRowGraphs_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hQ : Q ∈ M.sets) : + (upper).graph c res ∈ M.sets ∧ c.graph upper incl ∈ M.sets := by + constructor + · rw [M.refinementHistoryRowFunction_graph] + exact M.rowAssignmentRows_mem pairing unions powers separation hQ carrier + (M.union_mem unions (M.union_mem unions hQ)) + · rw [M.refinementHistoryRowInclusion_graph c T stages history run ordinal carrier] + exact M.pairEmpty_forwardGraph_mem pairing unions powers separation c carrier + +private theorem assignmentCut_zero (levels A : ZFSet.{u}) : assignmentCut levels ∅ A = ∅ := by + apply ZFSet.ext + intro z + simp only [mem_assignmentCut, ZFSet.notMem_empty, false_and, exists_false, and_false] + +theorem refinementHistoryRow_completeProjection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) + (top : ZFSet.{u}) (topMem : top ∈ c.carrier) + (topRows : ∀ row ∈ c.carrier, ZFSet.pair row top ∈ c.conditionOrder) + (mono : ∀ beta (fields : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode fields) ∈ history → + ∀ A lower stronger, stageOneRawTests M fields A lower → + ZFSet.pair stronger lower ∈ fields 8 → stageOneRawTests M fields A stronger) : + letI := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + CompleteProjection (M.refinementHistoryRowRestriction c T stages history) + (M.refinementHistoryRowEmbedding c T stages history run ordinal carrier) := by + let := M.refinementHistoryPartialOrder c.conditionOrder_code T stages history + refine ⟨M.refinementHistoryRow_retract c T stages history run ordinal carrier, + M.refinementHistoryRow_le_include c T stages history run ordinal carrier, ?_⟩ + intro p q below + let Q0 := M.refinementHistoryForcing c.carrier T ∅ (graphRestriction ∅ history) + let := M.refinementHistoryPartialOrder c.conditionOrder_code T ∅ (graphRestriction ∅ history) + have zeroSubset : (∅ : ZFSet.{u}) ⊆ stages := fun z hz => (ZFSet.notMem_empty z hz).elim + have hEmpty : (∅ : ZFSet.{u}) ∈ M.sets := M.empty_mem ⟨c.carrier, carrier⟩ + let cut := run.restriction ordinal ordinalSetProperty_empty zeroSubset c.conditionOrder_code + have projection := run.completeProjection ordinal ordinalSetProperty_empty zeroSubset + pairing unions powers separation infinite choice hStages hHistory hT hEmpty carrier + top topMem topRows mono c.conditionOrder_code + have zeroCode : ZFSet.pair (c.encode q) ∅ ∈ Q0 := by + change ZFSet.pair (c.encode q) ∅ ∈ M.refinementHistoryForcing c.carrier T ∅ (graphRestriction ∅ history) + rw [M.refinementHistoryForcing_initial carrier T (graphRestriction ∅ history)] + exact ZFSet.pair_mem_prod.2 ⟨c.encode_mem q, ZFSet.mem_singleton.2 rfl⟩ + let q0 : SetMembers Q0 := SetMembers.ofMem (ZFSet.pair (c.encode q) ∅) zeroCode + have q0Code : SetMembers.raw q0 = ZFSet.pair (c.encode q) ∅ := SetMembers.raw_ofMem _ _ + obtain ⟨A, pCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history p + have cutCode : SetMembers.raw (cut p) = ZFSet.pair (c.encode (res p)) ∅ := by + change SetMembers.raw (run.restrictionFunction ordinal ordinalSetProperty_empty zeroSubset p) = _ + rw [run.restrictionFunction_raw ordinal ordinalSetProperty_empty zeroSubset p (c.encode (res p)) A pCode, + assignmentCut_zero] + have cutMember := SetMembers.raw_mem (cut p) + rw [cutCode] at cutMember + have belowZero : q0 ≤ cut p := by + change ZFSet.pair (SetMembers.raw q0) (SetMembers.raw (cut p)) ∈ _ + rw [q0Code, cutCode, M.pair_mem_refinementHistoryOrder] + exact ⟨zeroCode, cutMember, (c.pair_mem_conditionOrder _ _).2 below, fun _ hz => hz⟩ + obtain ⟨r, rp, exactCut⟩ := projection.lift p q0 belowZero + refine ⟨r, rp, ?_⟩ + obtain ⟨B, rCode⟩ := M.refinementHistoryRowFunction_coordinates c T stages history r + have cutR : SetMembers.raw (cut r) = ZFSet.pair (c.encode (res r)) ∅ := by + change SetMembers.raw (run.restrictionFunction ordinal ordinalSetProperty_empty zeroSubset r) = _ + rw [run.restrictionFunction_raw ordinal ordinalSetProperty_empty zeroSubset r (c.encode (res r)) B rCode, + assignmentCut_zero] + have equal := congrArg SetMembers.raw exactCut + change SetMembers.raw (cut r) = SetMembers.raw q0 at equal + rw [cutR, q0Code] at equal + exact c.injective (ZFSet.pair_injective equal).1 + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementFullIndexSize.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementFullIndexSize.lean index 9ab67411072f66725ae3145ae4bee70a425eb23f..a1d5d148818b7ebe67b6a941311ce1ba10f6fc7b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementFullIndexSize.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementFullIndexSize.lean @@ -1,81 +1,81 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem refinementHistoryInitialIndexImage {K F : ZFSet.{u}} - (function : FunctionGraphOn K F) - (literal : ∀ beta I, ZFSet.pair beta I ∈ F → RefinementIndexLevelCode I beta) - (alpha : ZFSet.{u}) : - relationImage alpha (refinementHistoryIndices K F) - (relationConverse (refinementHistoryIndices K F) K (refinementHistoryLevels K F)) = - refinementHistoryIndices alpha F := by - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨_, beta, hb, entry⟩ := (mem_relationImage _ _ _ _).1 hx - have level := ((pair_mem_relationConverse _ _ _ x beta).1 entry).2.2 - obtain ⟨I, stored, member⟩ := (pair_mem_refinementHistoryLevels function literal x beta).1 level - exact (mem_refinementHistoryIndices _ _ _).2 ⟨beta, hb, I, stored, member⟩ - · intro hx - obtain ⟨beta, hb, I, stored, member⟩ := (mem_refinementHistoryIndices _ _ _).1 hx - have hBeta := function.pair_source stored - have full := (mem_refinementHistoryIndices K F x).2 ⟨beta, hBeta, I, stored, member⟩ - exact (mem_relationImage _ _ _ _).2 ⟨full, beta, hb, - (pair_mem_relationConverse _ _ _ x beta).2 ⟨full, hBeta, - (pair_mem_refinementHistoryLevels function literal x beta).2 ⟨I, stored, member⟩⟩⟩ - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem refinementDataHistoryIndices_embeds - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (collection : CollectionSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {K history T : ZFSet.{u}} (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) (valid : RefinementDataHistory K history T) - (prefixes : ∀ alpha ∈ K, - GroundBelow M (refinementDataHistoryIndices alpha (graphRestriction alpha history)) K) : - M.groundEmbeddable (refinementDataHistoryIndices K history) K := by - let F := refinementDataHistoryField K history 0 - let I := refinementHistoryIndices K F - let levels := refinementHistoryLevels K F - let e := relationConverse I K levels - have hF : F ∈ M.sets := M.refinementDataHistoryField_mem pairing unions powers separation hK hHistory 0 - have hI : I ∈ M.sets := M.refinementHistoryIndices_mem unions separation hK hF - have hLevels : levels ∈ M.sets := M.refinementHistoryLevels_mem pairing unions powers separation hK hF - have he : e ∈ M.sets := M.relationConverse_mem pairing unions powers separation hI hK hLevels - have cardinal : GroundCardinal M K := conditions.internal_cardinal pairing unions powers separation hK - apply M.ordinalRelation_embeds pairing unions powers separation collection choice (e := e) hI hK he cardinal - · intro x hx - have function := refinementHistoryLevels_function (alpha := K) valid.index_literal - obtain ⟨beta, entry, _⟩ := function.2 x hx - have hBeta := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - exact ⟨beta, hBeta, (pair_mem_relationConverse I K levels x beta).2 ⟨hx, hBeta, entry⟩⟩ - · intro beta hBeta - have successor := conditions.successor_mem pairing unions powers separation infinite hK hBeta - have subset := conditions.1.1 (insert beta beta) successor - have initial := prefixes (insert beta beta) successor - change GroundBelow M (refinementHistoryIndices (insert beta beta) - (refinementDataHistoryField (insert beta beta) (graphRestriction (insert beta beta) history) 0)) K at initial - rw [refinementDataHistoryIndices_prefix subset (fun _ h => h)] at initial - change GroundBelow M (relationImage (insert beta beta) (refinementHistoryIndices K F) - (relationConverse (refinementHistoryIndices K F) K (refinementHistoryLevels K F))) K - rw [refinementHistoryInitialIndexImage valid.index_function valid.index_literal] - exact initial - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem refinementHistoryInitialIndexImage {K F : ZFSet.{u}} + (function : FunctionGraphOn K F) + (literal : ∀ beta I, ZFSet.pair beta I ∈ F → RefinementIndexLevelCode I beta) + (alpha : ZFSet.{u}) : + relationImage alpha (refinementHistoryIndices K F) + (relationConverse (refinementHistoryIndices K F) K (refinementHistoryLevels K F)) = + refinementHistoryIndices alpha F := by + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨_, beta, hb, entry⟩ := (mem_relationImage _ _ _ _).1 hx + have level := ((pair_mem_relationConverse _ _ _ x beta).1 entry).2.2 + obtain ⟨I, stored, member⟩ := (pair_mem_refinementHistoryLevels function literal x beta).1 level + exact (mem_refinementHistoryIndices _ _ _).2 ⟨beta, hb, I, stored, member⟩ + · intro hx + obtain ⟨beta, hb, I, stored, member⟩ := (mem_refinementHistoryIndices _ _ _).1 hx + have hBeta := function.pair_source stored + have full := (mem_refinementHistoryIndices K F x).2 ⟨beta, hBeta, I, stored, member⟩ + exact (mem_relationImage _ _ _ _).2 ⟨full, beta, hb, + (pair_mem_relationConverse _ _ _ x beta).2 ⟨full, hBeta, + (pair_mem_refinementHistoryLevels function literal x beta).2 ⟨I, stored, member⟩⟩⟩ + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem refinementDataHistoryIndices_embeds + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (collection : CollectionSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {K history T : ZFSet.{u}} (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) (valid : RefinementDataHistory K history T) + (prefixes : ∀ alpha ∈ K, + GroundBelow M (refinementDataHistoryIndices alpha (graphRestriction alpha history)) K) : + M.groundEmbeddable (refinementDataHistoryIndices K history) K := by + let F := refinementDataHistoryField K history 0 + let I := refinementHistoryIndices K F + let levels := refinementHistoryLevels K F + let e := relationConverse I K levels + have hF : F ∈ M.sets := M.refinementDataHistoryField_mem pairing unions powers separation hK hHistory 0 + have hI : I ∈ M.sets := M.refinementHistoryIndices_mem unions separation hK hF + have hLevels : levels ∈ M.sets := M.refinementHistoryLevels_mem pairing unions powers separation hK hF + have he : e ∈ M.sets := M.relationConverse_mem pairing unions powers separation hI hK hLevels + have cardinal : GroundCardinal M K := conditions.internal_cardinal pairing unions powers separation hK + apply M.ordinalRelation_embeds pairing unions powers separation collection choice (e := e) hI hK he cardinal + · intro x hx + have function := refinementHistoryLevels_function (alpha := K) valid.index_literal + obtain ⟨beta, entry, _⟩ := function.2 x hx + have hBeta := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + exact ⟨beta, hBeta, (pair_mem_relationConverse I K levels x beta).2 ⟨hx, hBeta, entry⟩⟩ + · intro beta hBeta + have successor := conditions.successor_mem pairing unions powers separation infinite hK hBeta + have subset := conditions.1.1 (insert beta beta) successor + have initial := prefixes (insert beta beta) successor + change GroundBelow M (refinementHistoryIndices (insert beta beta) + (refinementDataHistoryField (insert beta beta) (graphRestriction (insert beta beta) history) 0)) K at initial + rw [refinementDataHistoryIndices_prefix subset (fun _ h => h)] at initial + change GroundBelow M (relationImage (insert beta beta) (refinementHistoryIndices K F) + (relationConverse (refinementHistoryIndices K F) K (refinementHistoryLevels K F))) K + rw [refinementHistoryInitialIndexImage valid.index_function valid.index_literal] + exact initial + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementHistorySpliceSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementHistorySpliceSteps.lean index 657119c945e26c990c71071cfccafad69bfaab4d..9e8daf3bc0fe04ebc5eae140e98a392d44716315 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementHistorySpliceSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundRefinementHistorySpliceSteps.lean @@ -1,65 +1,65 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (level : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -include pairing unions powers separation collection carrier order nodes hT indices system - -theorem refinementLevelRawTests_flat_mono {R : Type u} [PartialOrder R] - (c : Presentation R) (J : ZFSet.{u}) (F : FlatConditionSystem M c s J) - (A : ZFSet.{u}) {p q : P} - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) - (rows : F.row q ≤ F.row p) (assignments : F.assignments p ⊆ F.assignments q) : - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode q) := - M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system A tests ((F.le_iff q p).2 ⟨rows, assignments⟩) - -variable {stages history : ZFSet.{u}} (historyValid : RefinementDataHistory stages history T) -variable (entry : ZFSet.pair level (refinementFormulaDataCode - (M.refinementLevelFormulaData a s b d level T T2 valid)) ∈ history) -include historyValid entry - -theorem refinementLevelRawTests_history_splice_below (alpha Aq Ap : ZFSet.{u}) - {p q : ZFSet.{u}} (inside : level ∈ alpha) - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) Aq p) - (below : ZFSet.pair q p ∈ s.conditionOrder) : - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) - (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) q := - (historyValid.rawTests_splice_below entry M alpha Aq Ap q inside).2 - (M.refinementLevelRawTests_order_mono a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system Aq tests below) - -theorem refinementLevelRawTests_history_splice_above (alpha Aq Ap : ZFSet.{u}) - {p q : ZFSet.{u}} (outside : level ∉ alpha) - (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) Ap p) - (below : ZFSet.pair q p ∈ s.conditionOrder) : - stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) - (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) q := - (historyValid.rawTests_splice_above entry M alpha Aq Ap q outside).2 - (M.refinementLevelRawTests_order_mono a s b d level pairing unions powers separation collection - carrier order nodes hT valid indices base directed system Ap tests below) - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (level : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +include pairing unions powers separation collection carrier order nodes hT indices system + +theorem refinementLevelRawTests_flat_mono {R : Type u} [PartialOrder R] + (c : Presentation R) (J : ZFSet.{u}) (F : FlatConditionSystem M c s J) + (A : ZFSet.{u}) {p q : P} + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode p)) + (rows : F.row q ≤ F.row p) (assignments : F.assignments p ⊆ F.assignments q) : + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) A (s.encode q) := + M.refinementLevelRawTests_mono a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system A tests ((F.le_iff q p).2 ⟨rows, assignments⟩) + +variable {stages history : ZFSet.{u}} (historyValid : RefinementDataHistory stages history T) +variable (entry : ZFSet.pair level (refinementFormulaDataCode + (M.refinementLevelFormulaData a s b d level T T2 valid)) ∈ history) +include historyValid entry + +theorem refinementLevelRawTests_history_splice_below (alpha Aq Ap : ZFSet.{u}) + {p q : ZFSet.{u}} (inside : level ∈ alpha) + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) Aq p) + (below : ZFSet.pair q p ∈ s.conditionOrder) : + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) + (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) q := + (historyValid.rawTests_splice_below entry M alpha Aq Ap q inside).2 + (M.refinementLevelRawTests_order_mono a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system Aq tests below) + +theorem refinementLevelRawTests_history_splice_above (alpha Aq Ap : ZFSet.{u}) + {p q : ZFSet.{u}} (outside : level ∉ alpha) + (tests : stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) Ap p) + (below : ZFSet.pair q p ∈ s.conditionOrder) : + stageOneRawTests M (M.refinementLevelFormulaData a s b d level T T2 valid) + (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) q := + (historyValid.rawTests_splice_above entry M alpha Aq Ap q outside).2 + (M.refinementLevelRawTests_order_mono a s b d level pairing unions powers separation collection + carrier order nodes hT valid indices base directed system Ap tests below) + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSelectedMainLimitCoverage.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSelectedMainLimitCoverage.lean index 0589c04238f5066f075b56652a3eb5922b5b244b..c8c65b94d88de0b3e9f98cac4afd5727db051469 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSelectedMainLimitCoverage.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSelectedMainLimitCoverage.lean @@ -1,125 +1,125 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalStepCodes - -namespace OAI - -namespace PartitionPilot.Forcing.GroundMainPrefix -open SetFormula -universe u v w -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable {J : Type w} [Small.{u} J] [Preorder J] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) -variable (next : GroundMainPrefix M K Labels C D rD pairing unions powers separation J) - -theorem exists_extensionCone (extension : MainPrefixExtends run.code next.code) - (indices : next.indices = insert run.indices run.indices) : - ∃ j : J, next.key j = run.indices ∧ - ∃ cone : run.diagram.Cone (next.diagram.stage j), - (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ next.transitionGraph ↔ - z = (cone.leg i).map.code) ∧ - ∀ i, (cone.leg i).CoversOldBirths := by - classical - have included : run.indices ⊆ next.indices ∧ run.stageGraph ⊆ next.stageGraph ∧ - run.transitionGraph ⊆ next.transitionGraph := mainPrefixExtends_iff.1 extension - have topMember : run.indices ∈ next.indices := by - rw [indices] - exact ZFSet.mem_insert _ _ - obtain ⟨j, key⟩ := ZFSet.mem_range.1 topMember - have targetEntry : ZFSet.pair run.indices (next.linked j).code ∈ next.stageGraph := by - rw [← key] - exact (next.stageGraph_entry j _).2 rfl - have legs (i : I) : - ∃ step : GroundChronologicalMainTransition (run.diagram.stage i) (next.diagram.stage j), - ZFSet.pair (ZFSet.pair run.indices (run.key i)) step.map.code ∈ next.transitionGraph ∧ - step.CoversOldBirths := by - have oldMember : run.key i ∈ run.indices := ZFSet.mem_range.2 ⟨i, rfl⟩ - have pairMember : ZFSet.pair run.indices (run.key i) ∈ chronologyPairs next.indices := - (pair_mem_chronologyPairs _ _ _).2 ⟨topMember, included.1 oldMember, Or.inr oldMember⟩ - obtain ⟨z, entry⟩ := next.transitionGraph_function.total pairMember - have valid := next.graph_code.transition_valid (run.key i) run.indices - (run.linked i).code (next.linked j).code z - (included.2.1 ((run.stageGraph_entry i _).2 rfl)) targetEntry entry - obtain ⟨step, code, covered⟩ := valid.exists_at (run.linked i) (next.linked j) - let actual := step.retargetEq (run.linked_main i) (next.linked_main j) - refine ⟨actual, ?_, (step.retargetEq_coversOldBirths_iff - (run.linked_main i) (next.linked_main j)).2 covered⟩ - simpa only [actual, GroundChronologicalMainTransition.retargetEq_code, code] using entry - let leg := fun i => Classical.choose (legs i) - have entry (i : I) : - ZFSet.pair (ZFSet.pair run.indices (run.key i)) (leg i).map.code ∈ next.transitionGraph := - (Classical.choose_spec (legs i)).1 - have coherent : ∀ {i k : I} (before : i ≤ k), - (run.diagram.transition before).comp pairing unions powers separation (leg k) = leg i := by - intro i k before - have composition := next.graph_code.composition (run.key i) (run.key k) run.indices - _ _ _ _ _ _ (included.2.2 ((run.transitionGraph_entry before _).2 rfl)) (entry k) (entry i) - apply GroundChronologicalMainTransition.ext - apply GroundMainTransition.ext - · exact (composition.1.eq_relationCompose - (run.diagram.transition before).map.point_embedding.injection.function - (leg i).map.point_embedding.injection.function.1).symm - · exact (composition.2.eq_relationCompose - (run.diagram.transition before).map.group_embedding.injection.function - (leg i).map.group_embedding.injection.function.1).symm - let cone : run.diagram.Cone (next.diagram.stage j) := ⟨leg, coherent⟩ - refine ⟨j, key, cone, ?_, fun i => (Classical.choose_spec (legs i)).2⟩ - intro i z - exact ⟨fun given => next.transitionGraph_function.unique given (entry i), - fun equal => equal.symm ▸ entry i⟩ - -theorem exists_limitCone_of_limitStep - (code : MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega run.code next.code) : - ∃ j : J, next.key j = run.indices ∧ - ∃ cone : run.diagram.Cone (next.diagram.stage j), - (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ next.transitionGraph ↔ - z = (cone.leg i).map.code) ∧ - (∀ i, (cone.leg i).CoversOldBirths) ∧ - run.LimitCoverage (next.diagram.stage j) cone := by - have indices : next.indices = insert run.indices run.indices := code.indices_successor rfl rfl - obtain ⟨j, key, cone, entries, covered⟩ := run.exists_extensionCone next code.extension indices - obtain ⟨fields, _, successor, oldCode, nextCode, _, targetEntry, linked, birthEntry, coverage⟩ := code - have oldFields := mainPrefixCode_inj.1 (show mainPrefixCode run.indices run.stageGraph run.transitionGraph = - mainPrefixCode (fields 0) (fields 1) (fields 2) from oldCode) - have nextFields := mainPrefixCode_inj.1 (show mainPrefixCode next.indices next.stageGraph next.transitionGraph = - mainPrefixCode (fields 7) (fields 3) (fields 4) from nextCode) - have actualTarget : ZFSet.pair run.indices (fields 5) ∈ next.stageGraph := by - simpa only [← oldFields.1, ← nextFields.2.1] using targetEntry - have knownTarget : ZFSet.pair run.indices (next.linked j).code ∈ next.stageGraph := by - rw [← key] - exact (next.stageGraph_entry j _).2 rfl - have targetCode := next.stageGraph_function.unique actualTarget knownTarget - have actualLinked : LinkedMainStageRawCode M K Labels C D rD ZFSet.omega - (next.linked j).code (mainPrefixLimitTargetFields fields) := targetCode ▸ linked - have targetFields := actualLinked.fields_unique (next.linked j).rawFields_code - rw [targetFields] at birthEntry coverage - have birthEqual : fields 6 = (next.linked j).main.birth := - ((next.linked j).serial.fields.graphFunction 3).unique birthEntry (next.linked j).rawFields_birth_entry - have actualCoverage : MainLimitCoverageGraphCode run.indices run.stageGraph next.transitionGraph - (next.diagram.stage j).stage.carrier (next.diagram.stage j).stage.actors - (next.diagram.stage j).stage.order (next.diagram.stage j).stage.top - (next.diagram.stage j).cutoff (next.diagram.stage j).birth := by - change MainLimitCoverageGraphCode (fields 0) (fields 1) (fields 4) - (next.linked j).main.stage.carrier (next.linked j).main.stage.actors - (next.linked j).main.stage.order (next.linked j).main.stage.top - (next.linked j).main.cutoff (fields 6) at coverage - rw [← oldFields.1, ← oldFields.2.1, ← nextFields.2.2, birthEqual, next.linked_main j] at coverage - exact coverage - exact ⟨j, key, cone, entries, covered, (run.limitCoverage_graph_iff cone entries).1 actualCoverage⟩ - -theorem exists_limitCone_of_conditionalStep {f : ZFSet.{u}} - (code : MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f run.code next.code) - (nonzero : NonzeroLimitOrdinalCode run.indices) : - ∃ j : J, next.key j = run.indices ∧ - ∃ cone : run.diagram.Cone (next.diagram.stage j), - (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ next.transitionGraph ↔ - z = (cone.leg i).map.code) ∧ - (∀ i, (cone.leg i).CoversOldBirths) ∧ - run.LimitCoverage (next.diagram.stage j) cone := - run.exists_limitCone_of_limitStep next (code.limit_of_nonzeroLimit rfl nonzero) - -end PartitionPilot.Forcing.GroundMainPrefix - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalStepCodes + +namespace OAI + +namespace PartitionPilot.Forcing.GroundMainPrefix +open SetFormula +universe u v w +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable {J : Type w} [Small.{u} J] [Preorder J] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) +variable (next : GroundMainPrefix M K Labels C D rD pairing unions powers separation J) + +theorem exists_extensionCone (extension : MainPrefixExtends run.code next.code) + (indices : next.indices = insert run.indices run.indices) : + ∃ j : J, next.key j = run.indices ∧ + ∃ cone : run.diagram.Cone (next.diagram.stage j), + (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ next.transitionGraph ↔ + z = (cone.leg i).map.code) ∧ + ∀ i, (cone.leg i).CoversOldBirths := by + classical + have included : run.indices ⊆ next.indices ∧ run.stageGraph ⊆ next.stageGraph ∧ + run.transitionGraph ⊆ next.transitionGraph := mainPrefixExtends_iff.1 extension + have topMember : run.indices ∈ next.indices := by + rw [indices] + exact ZFSet.mem_insert _ _ + obtain ⟨j, key⟩ := ZFSet.mem_range.1 topMember + have targetEntry : ZFSet.pair run.indices (next.linked j).code ∈ next.stageGraph := by + rw [← key] + exact (next.stageGraph_entry j _).2 rfl + have legs (i : I) : + ∃ step : GroundChronologicalMainTransition (run.diagram.stage i) (next.diagram.stage j), + ZFSet.pair (ZFSet.pair run.indices (run.key i)) step.map.code ∈ next.transitionGraph ∧ + step.CoversOldBirths := by + have oldMember : run.key i ∈ run.indices := ZFSet.mem_range.2 ⟨i, rfl⟩ + have pairMember : ZFSet.pair run.indices (run.key i) ∈ chronologyPairs next.indices := + (pair_mem_chronologyPairs _ _ _).2 ⟨topMember, included.1 oldMember, Or.inr oldMember⟩ + obtain ⟨z, entry⟩ := next.transitionGraph_function.total pairMember + have valid := next.graph_code.transition_valid (run.key i) run.indices + (run.linked i).code (next.linked j).code z + (included.2.1 ((run.stageGraph_entry i _).2 rfl)) targetEntry entry + obtain ⟨step, code, covered⟩ := valid.exists_at (run.linked i) (next.linked j) + let actual := step.retargetEq (run.linked_main i) (next.linked_main j) + refine ⟨actual, ?_, (step.retargetEq_coversOldBirths_iff + (run.linked_main i) (next.linked_main j)).2 covered⟩ + simpa only [actual, GroundChronologicalMainTransition.retargetEq_code, code] using entry + let leg := fun i => Classical.choose (legs i) + have entry (i : I) : + ZFSet.pair (ZFSet.pair run.indices (run.key i)) (leg i).map.code ∈ next.transitionGraph := + (Classical.choose_spec (legs i)).1 + have coherent : ∀ {i k : I} (before : i ≤ k), + (run.diagram.transition before).comp pairing unions powers separation (leg k) = leg i := by + intro i k before + have composition := next.graph_code.composition (run.key i) (run.key k) run.indices + _ _ _ _ _ _ (included.2.2 ((run.transitionGraph_entry before _).2 rfl)) (entry k) (entry i) + apply GroundChronologicalMainTransition.ext + apply GroundMainTransition.ext + · exact (composition.1.eq_relationCompose + (run.diagram.transition before).map.point_embedding.injection.function + (leg i).map.point_embedding.injection.function.1).symm + · exact (composition.2.eq_relationCompose + (run.diagram.transition before).map.group_embedding.injection.function + (leg i).map.group_embedding.injection.function.1).symm + let cone : run.diagram.Cone (next.diagram.stage j) := ⟨leg, coherent⟩ + refine ⟨j, key, cone, ?_, fun i => (Classical.choose_spec (legs i)).2⟩ + intro i z + exact ⟨fun given => next.transitionGraph_function.unique given (entry i), + fun equal => equal.symm ▸ entry i⟩ + +theorem exists_limitCone_of_limitStep + (code : MainPrefixLimitStepCode M K Labels C D rD ZFSet.omega run.code next.code) : + ∃ j : J, next.key j = run.indices ∧ + ∃ cone : run.diagram.Cone (next.diagram.stage j), + (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ next.transitionGraph ↔ + z = (cone.leg i).map.code) ∧ + (∀ i, (cone.leg i).CoversOldBirths) ∧ + run.LimitCoverage (next.diagram.stage j) cone := by + have indices : next.indices = insert run.indices run.indices := code.indices_successor rfl rfl + obtain ⟨j, key, cone, entries, covered⟩ := run.exists_extensionCone next code.extension indices + obtain ⟨fields, _, successor, oldCode, nextCode, _, targetEntry, linked, birthEntry, coverage⟩ := code + have oldFields := mainPrefixCode_inj.1 (show mainPrefixCode run.indices run.stageGraph run.transitionGraph = + mainPrefixCode (fields 0) (fields 1) (fields 2) from oldCode) + have nextFields := mainPrefixCode_inj.1 (show mainPrefixCode next.indices next.stageGraph next.transitionGraph = + mainPrefixCode (fields 7) (fields 3) (fields 4) from nextCode) + have actualTarget : ZFSet.pair run.indices (fields 5) ∈ next.stageGraph := by + simpa only [← oldFields.1, ← nextFields.2.1] using targetEntry + have knownTarget : ZFSet.pair run.indices (next.linked j).code ∈ next.stageGraph := by + rw [← key] + exact (next.stageGraph_entry j _).2 rfl + have targetCode := next.stageGraph_function.unique actualTarget knownTarget + have actualLinked : LinkedMainStageRawCode M K Labels C D rD ZFSet.omega + (next.linked j).code (mainPrefixLimitTargetFields fields) := targetCode ▸ linked + have targetFields := actualLinked.fields_unique (next.linked j).rawFields_code + rw [targetFields] at birthEntry coverage + have birthEqual : fields 6 = (next.linked j).main.birth := + ((next.linked j).serial.fields.graphFunction 3).unique birthEntry (next.linked j).rawFields_birth_entry + have actualCoverage : MainLimitCoverageGraphCode run.indices run.stageGraph next.transitionGraph + (next.diagram.stage j).stage.carrier (next.diagram.stage j).stage.actors + (next.diagram.stage j).stage.order (next.diagram.stage j).stage.top + (next.diagram.stage j).cutoff (next.diagram.stage j).birth := by + change MainLimitCoverageGraphCode (fields 0) (fields 1) (fields 4) + (next.linked j).main.stage.carrier (next.linked j).main.stage.actors + (next.linked j).main.stage.order (next.linked j).main.stage.top + (next.linked j).main.cutoff (fields 6) at coverage + rw [← oldFields.1, ← oldFields.2.1, ← nextFields.2.2, birthEqual, next.linked_main j] at coverage + exact coverage + exact ⟨j, key, cone, entries, covered, (run.limitCoverage_graph_iff cone entries).1 actualCoverage⟩ + +theorem exists_limitCone_of_conditionalStep {f : ZFSet.{u}} + (code : MainPrefixConditionalStepCode M K Labels C D rD ZFSet.omega f run.code next.code) + (nonzero : NonzeroLimitOrdinalCode run.indices) : + ∃ j : J, next.key j = run.indices ∧ + ∃ cone : run.diagram.Cone (next.diagram.stage j), + (∀ i z, ZFSet.pair (ZFSet.pair run.indices (run.key i)) z ∈ next.transitionGraph ↔ + z = (cone.leg i).map.code) ∧ + (∀ i, (cone.leg i).CoversOldBirths) ∧ + run.LimitCoverage (next.diagram.stage j) cone := + run.exists_limitCone_of_limitStep next (code.limit_of_nonzeroLimit rfl nonzero) + +end PartitionPilot.Forcing.GroundMainPrefix + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyRestrictions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyRestrictions.lean index 9f732103971b0bfa4e0e09837131083a6d209fb7..56bf4ea315d7c6a7f47c7e1fdbf309bb870d46d9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyRestrictions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyRestrictions.lean @@ -1,93 +1,93 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GrowthLayerWitnessRestrictions -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundSerializedChronology -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {T S C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M T C D rD) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hS : S ∈ M.sets) (subset : S ⊆ T) (ordinal : ordinalSetProperty S) - -noncomputable def restrictTo : GroundSerializedChronology M S C D rD where - fields := serial.fields.restrictTo unions separation hS subset - ordinal := ordinal - core := serial.fields.restrictTo_core unions separation hS subset serial.core ordinal.1 - layerBound := serial.layerBound - layer_bound_ground := serial.layer_bound_ground - layers := graphRestriction (chronologyPairs S) serial.layers - layers_ground := M.graphRestriction_mem unions separation - (M.chronologyPairs_mem pairing unions powers separation hS) serial.layers_ground - layer_function := by - let function : FunctionGraphOn (chronologyPairs T) serial.layers := - ⟨serial.layerBound, serial.layer_function⟩ - refine ⟨?_, (function.restrict (chronologyPairs_mono subset)).to_isFunc.2⟩ - intro z hz - obtain ⟨p, hp, w, rfl, entry⟩ := mem_graphRestriction.1 hz - exact ZFSet.pair_mem_prod.2 ⟨hp, (ZFSet.pair_mem_prod.1 (serial.layer_function.1 entry)).2⟩ - layer_code := by - intro s hs t ht earlier z entry - change GrowthLayerWitnessCode (graphRestriction S (serial.fields.graph 0)) - (graphRestriction S (serial.fields.graph 1)) (graphRestriction S (serial.fields.graph 2)) - ((serial.fields.restrictTo unions separation hS subset).value 0 s) - ((serial.fields.restrictTo unions separation hS subset).value 1 s) - ((serial.fields.restrictTo unions separation hS subset).value 2 s) - ((serial.fields.restrictTo unions separation hS subset).value 3 s) t ZFSet.omega z - rw [serial.fields.restrictTo_value unions separation hS subset 0 hs, - serial.fields.restrictTo_value unions separation hS subset 1 hs, - serial.fields.restrictTo_value unions separation hS subset 2 hs, - serial.fields.restrictTo_value unions separation hS subset 3 hs] - exact (serial.layer_code s (subset hs) t (subset ht) earlier z - (pair_mem_graphRestriction.1 entry).1).restrict_sources ordinal.1 ht - -theorem restrictTo_graph (j : Fin 5) : - (serial.restrictTo pairing unions powers separation hS subset ordinal).fields.graph j = - graphRestriction S (serial.fields.graph j) := rfl - -theorem restrictTo_layers : - (serial.restrictTo pairing unions powers separation hS subset ordinal).layers = - graphRestriction (chronologyPairs S) serial.layers := rfl - -theorem restrictTo_value (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ S) : - (serial.restrictTo pairing unions powers separation hS subset ordinal).fields.value j s = - serial.fields.value j s := - serial.fields.restrictTo_value unions separation hS subset j hs - -theorem restrictTo_layerWitness {s t : ZFSet.{u}} (hs : s ∈ S) (ht : t ∈ S) - (earlier : t = s ∨ t ∈ s) : - (serial.restrictTo pairing unions powers separation hS subset ordinal).layerWitness s t = - serial.layerWitness s t := by - have entry := (serial.restrictTo pairing unions powers separation hS subset ordinal).layerWitness_entry - hs ht earlier - exact ((show FunctionGraphOn (chronologyPairs T) serial.layers from - ⟨serial.layerBound, serial.layer_function⟩).totalValue_eq_of_entry - (pair_mem_graphRestriction.1 entry).1).symm - -theorem restrictTo_history_values {s : ZFSet.{u}} (hs : s ∈ S) : - let restricted := serial.restrictTo pairing unions powers separation hS subset ordinal - restricted.toHistory.space s = serial.toHistory.space s ∧ - restricted.toHistory.order s = serial.toHistory.order s ∧ - restricted.toHistory.meetGraph s = serial.toHistory.meetGraph s ∧ - restricted.toHistory.birth s = serial.toHistory.birth s ∧ - restricted.toHistory.height s = serial.toHistory.height s := - ⟨serial.restrictTo_value pairing unions powers separation hS subset ordinal 0 hs, - serial.restrictTo_value pairing unions powers separation hS subset ordinal 1 hs, - serial.restrictTo_value pairing unions powers separation hS subset ordinal 2 hs, - serial.restrictTo_value pairing unions powers separation hS subset ordinal 3 hs, - serial.restrictTo_value pairing unions powers separation hS subset ordinal 4 hs⟩ - -theorem restrictTo_code_ground : - (serial.restrictTo pairing unions powers separation hS subset ordinal).code ∈ M.sets := - (serial.restrictTo pairing unions powers separation hS subset ordinal).code_ground pairing - -end PartitionPilot.Forcing.GroundSerializedChronology - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GrowthLayerWitnessRestrictions +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundSerializedChronology +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {T S C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M T C D rD) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hS : S ∈ M.sets) (subset : S ⊆ T) (ordinal : ordinalSetProperty S) + +noncomputable def restrictTo : GroundSerializedChronology M S C D rD where + fields := serial.fields.restrictTo unions separation hS subset + ordinal := ordinal + core := serial.fields.restrictTo_core unions separation hS subset serial.core ordinal.1 + layerBound := serial.layerBound + layer_bound_ground := serial.layer_bound_ground + layers := graphRestriction (chronologyPairs S) serial.layers + layers_ground := M.graphRestriction_mem unions separation + (M.chronologyPairs_mem pairing unions powers separation hS) serial.layers_ground + layer_function := by + let function : FunctionGraphOn (chronologyPairs T) serial.layers := + ⟨serial.layerBound, serial.layer_function⟩ + refine ⟨?_, (function.restrict (chronologyPairs_mono subset)).to_isFunc.2⟩ + intro z hz + obtain ⟨p, hp, w, rfl, entry⟩ := mem_graphRestriction.1 hz + exact ZFSet.pair_mem_prod.2 ⟨hp, (ZFSet.pair_mem_prod.1 (serial.layer_function.1 entry)).2⟩ + layer_code := by + intro s hs t ht earlier z entry + change GrowthLayerWitnessCode (graphRestriction S (serial.fields.graph 0)) + (graphRestriction S (serial.fields.graph 1)) (graphRestriction S (serial.fields.graph 2)) + ((serial.fields.restrictTo unions separation hS subset).value 0 s) + ((serial.fields.restrictTo unions separation hS subset).value 1 s) + ((serial.fields.restrictTo unions separation hS subset).value 2 s) + ((serial.fields.restrictTo unions separation hS subset).value 3 s) t ZFSet.omega z + rw [serial.fields.restrictTo_value unions separation hS subset 0 hs, + serial.fields.restrictTo_value unions separation hS subset 1 hs, + serial.fields.restrictTo_value unions separation hS subset 2 hs, + serial.fields.restrictTo_value unions separation hS subset 3 hs] + exact (serial.layer_code s (subset hs) t (subset ht) earlier z + (pair_mem_graphRestriction.1 entry).1).restrict_sources ordinal.1 ht + +theorem restrictTo_graph (j : Fin 5) : + (serial.restrictTo pairing unions powers separation hS subset ordinal).fields.graph j = + graphRestriction S (serial.fields.graph j) := rfl + +theorem restrictTo_layers : + (serial.restrictTo pairing unions powers separation hS subset ordinal).layers = + graphRestriction (chronologyPairs S) serial.layers := rfl + +theorem restrictTo_value (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ S) : + (serial.restrictTo pairing unions powers separation hS subset ordinal).fields.value j s = + serial.fields.value j s := + serial.fields.restrictTo_value unions separation hS subset j hs + +theorem restrictTo_layerWitness {s t : ZFSet.{u}} (hs : s ∈ S) (ht : t ∈ S) + (earlier : t = s ∨ t ∈ s) : + (serial.restrictTo pairing unions powers separation hS subset ordinal).layerWitness s t = + serial.layerWitness s t := by + have entry := (serial.restrictTo pairing unions powers separation hS subset ordinal).layerWitness_entry + hs ht earlier + exact ((show FunctionGraphOn (chronologyPairs T) serial.layers from + ⟨serial.layerBound, serial.layer_function⟩).totalValue_eq_of_entry + (pair_mem_graphRestriction.1 entry).1).symm + +theorem restrictTo_history_values {s : ZFSet.{u}} (hs : s ∈ S) : + let restricted := serial.restrictTo pairing unions powers separation hS subset ordinal + restricted.toHistory.space s = serial.toHistory.space s ∧ + restricted.toHistory.order s = serial.toHistory.order s ∧ + restricted.toHistory.meetGraph s = serial.toHistory.meetGraph s ∧ + restricted.toHistory.birth s = serial.toHistory.birth s ∧ + restricted.toHistory.height s = serial.toHistory.height s := + ⟨serial.restrictTo_value pairing unions powers separation hS subset ordinal 0 hs, + serial.restrictTo_value pairing unions powers separation hS subset ordinal 1 hs, + serial.restrictTo_value pairing unions powers separation hS subset ordinal 2 hs, + serial.restrictTo_value pairing unions powers separation hS subset ordinal 3 hs, + serial.restrictTo_value pairing unions powers separation hS subset ordinal 4 hs⟩ + +theorem restrictTo_code_ground : + (serial.restrictTo pairing unions powers separation hS subset ordinal).code ∈ M.sets := + (serial.restrictTo pairing unions powers separation hS subset ordinal).code_ground pairing + +end PartitionPilot.Forcing.GroundSerializedChronology + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyTimeEquality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyTimeEquality.lean index 89d6560f7ed114211bfba1a886e15391f726860a..3f38476fcef93d8a2471a16ba09cf854ca1b8bba 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyTimeEquality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedChronologyTimeEquality.lean @@ -1,586 +1,586 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.BoundedChronologyCodes -import OAI.SetTheory.PartitionPrinciple.Definability.BoundedMeetOrderCodes -import OAI.SetTheory.PartitionPrinciple.Definability.StrictLexHeightFormulas -import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionPrefixGraphs - -namespace OAI - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem internal_chronological_coinitiality - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {L F T C Q r μ birth height qlt : ZFSet.{u}} - (hF : F ∈ M.sets) (hT : T ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) - (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hHeight : height ∈ M.sets) - (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) - (born : ZFSet.IsFunc L T birth) (ordinal : ordinalSetProperty T) - (oldMeet : OldMeetCode r μ birth) - (strictHeight : StrictLexHeightCode L C Q r height qlt) - (smallQ : M.groundEmbeddable Q ZFSet.omega) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - (localBases : ∀ t ∈ essentialBirthIndices F T r birth, - M.InternalCountableBelow r F (relationFiber (birthEssentialSet F T r birth) - (relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth) t)) : - ∃ B ∈ M.sets, ∃ f ∈ M.sets, - InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ r := by - have descent := essentialHeightDescent_of_chronological_laws meet filter born oldMeet strictHeight - have small := M.essentialBirthIndices_countable pairing unions powers separation infinite choice - hF hT hr hBirth hC hQ hHeight filter.subset ordinal strictHeight.function smallQ irreflexive descent - obtain ⟨B, hB, ⟨f, hf, injection⟩, positive, below⟩ := - M.internal_countable_basis_of_birth_layers pairing unions powers separation infinite choice - hF hT hr hBirth meet.order filter.subset born small localBases - exact ⟨B, hB, f, hf, injection, positive, below⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -structure ChronologyPointCode (T C D rD s L r μ birth height : ZFSet.{u}) : Prop where - meet : MeetOrderCode L r μ - birth_function : ZFSet.IsFunc L T birth - birth_bound : ∀ x ∈ L, ∀ t, ZFSet.pair x t ∈ birth → t = s ∨ t ∈ s - old_meet : OldMeetCode r μ birth - strict_height : StrictLexHeightCode L C D r height rD - -namespace BoundedFormula - -def chronologyPointFormula {n} (T C D rD s L r μ birth height : Fin n) : BoundedFormula n := - .conj (meetOrderFormula L r μ) (.conj (functionFormula L T birth) - (.conj (birthBoundFormula L T birth s) (.conj (oldMeetFormula L T r μ birth) - (strictLexHeightFormula L C D r height rD)))) - -theorem truth_chronologyPointFormula {n} (T C D rD s L r μ birth height : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (chronologyPointFormula T C D rD s L r μ birth height) env ↔ - ChronologyPointCode (env T) (env C) (env D) (env rD) (env s) - (env L) (env r) (env μ) (env birth) (env height) := by - simp only [chronologyPointFormula, Truth, truth_meetOrderFormula, - truth_functionFormula, truth_strictLexHeightFormula] - constructor - · rintro ⟨meet, function, bound, old, strict⟩ - exact ⟨meet, function, (truth_birthBoundFormula L T birth s env function).1 bound, - (truth_oldMeetFormula L T r μ birth env function).1 old, strict⟩ - · intro code - exact ⟨code.meet, code.birth_function, - (truth_birthBoundFormula L T birth s env code.birth_function).2 code.birth_bound, - (truth_oldMeetFormula L T r μ birth env code.birth_function).2 code.old_meet, - code.strict_height⟩ - -theorem realize_chronologyPointFormula (M : TransitiveGround.{u}) {n} - (T C D rD s L r μ birth height : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (chronologyPointFormula T C D rD s L r μ birth height).toFormula env ↔ - ChronologyPointCode (env T) (env C) (env D) (env rD) (env s) - (env L) (env r) (env μ) (env birth) (env height) := - (realize_toFormula M _ env members).trans - (truth_chronologyPointFormula T C D rD s L r μ birth height env) - -end BoundedFormula - - - - - -structure GroundChronologicalHistory (M : TransitiveGround.{u}) (T C Q qlt : ZFSet.{u}) where - space : ZFSet.{u} → ZFSet.{u} - order : ZFSet.{u} → ZFSet.{u} - meetGraph : ZFSet.{u} → ZFSet.{u} - birth : ZFSet.{u} → ZFSet.{u} - height : ZFSet.{u} → ZFSet.{u} - space_mem : ∀ s ∈ T, space s ∈ M.sets - order_mem : ∀ s ∈ T, order s ∈ M.sets - meet_mem : ∀ s ∈ T, meetGraph s ∈ M.sets - birth_mem : ∀ s ∈ T, birth s ∈ M.sets - height_mem : ∀ s ∈ T, height s ∈ M.sets - meet_order : ∀ s ∈ T, MeetOrderCode (space s) (order s) (meetGraph s) - birth_function : ∀ s ∈ T, ZFSet.IsFunc (space s) T (birth s) - birth_bound : ∀ s ∈ T, ∀ x ∈ space s, ∀ t, - ZFSet.pair x t ∈ birth s → t = s ∨ t ∈ s - old_meet : ∀ s ∈ T, OldMeetCode (order s) (meetGraph s) (birth s) - strict_height : ∀ s ∈ T, StrictLexHeightCode (space s) C Q (order s) (height s) qlt - layer : ∀ cutoff ∈ T, ∀ t ∈ T, t = cutoff ∨ t ∈ cutoff → - CodedGrowthLayer M space order meetGraph (space cutoff) (order cutoff) - (meetGraph cutoff) (birth cutoff) t - -namespace GroundChronologicalHistory - -variable {M : TransitiveGround.{u}} {T C Q qlt : ZFSet.{u}} -variable (history : GroundChronologicalHistory M T C Q qlt) - -theorem all_filters_internal_countable - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) - (ordinal : ordinalSetProperty T) (smallQ : M.groundEmbeddable Q ZFSet.omega) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) : - ∀ cutoff ∈ T, ∀ F ∈ M.sets, - MeetFilterCode (history.space cutoff) (history.order cutoff) (history.meetGraph cutoff) F → - M.InternalCountableBelow (history.order cutoff) F F := by - intro cutoff - induction cutoff using ZFSet.inductionOn with - | h cutoff ih => - intro hc F hF filter - have localBases : ∀ t ∈ essentialBirthIndices F T (history.order cutoff) (history.birth cutoff), - M.InternalCountableBelow (history.order cutoff) F - (essentialBirthFiber F T (history.order cutoff) (history.birth cutoff) t) := by - intro t ht - obtain ⟨htT, x, hx, xt⟩ := - (mem_essentialBirthIndices F T (history.order cutoff) (history.birth cutoff) t).1 ht - have bounded := history.birth_bound cutoff hc x - (filter.subset (birthEssentialSet_subset F T (history.order cutoff) (history.birth cutoff) hx)) t xt - apply (history.layer cutoff hc t htT bounded).internal_countable_essentials - pairing unions powers separation infinite choice (history.space_mem cutoff hc) - (history.order_mem cutoff hc) (history.birth_mem cutoff hc) hF hT (M.transitive hT htT) - (history.meet_order cutoff hc) filter (history.birth_function cutoff hc) - intro s hs - have hsT : s ∈ T := ordinal.1 t htT s hs - have before : s ∈ cutoff := bounded.elim - (fun equal => equal ▸ hs) (fun earlier => ordinal.2 cutoff hc t earlier s hs) - exact ⟨history.space_mem s hsT, history.meet_order s hsT, ih s before hsT⟩ - obtain ⟨B, hB, f, hf, injection, positive, below⟩ := - M.internal_chronological_coinitiality pairing unions powers separation infinite choice - hF hT (history.order_mem cutoff hc) (history.birth_mem cutoff hc) - hC hQ (history.height_mem cutoff hc) (history.meet_order cutoff hc) filter - (history.birth_function cutoff hc) ordinal (history.old_meet cutoff hc) - (history.strict_height cutoff hc) smallQ irreflexive localBases - exact ⟨B, hB, ⟨f, hf, injection⟩, positive, below⟩ - -theorem exists_internal_basis - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) - (ordinal : ordinalSetProperty T) (smallQ : M.groundEmbeddable Q ZFSet.omega) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - {cutoff F : ZFSet.{u}} (hc : cutoff ∈ T) (hF : F ∈ M.sets) - (filter : MeetFilterCode (history.space cutoff) (history.order cutoff) (history.meetGraph cutoff) F) : - ∃ B ∈ M.sets, ∃ f ∈ M.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ history.order cutoff := by - obtain ⟨B, hB, ⟨f, hf, injection⟩, positive, below⟩ := - history.all_filters_internal_countable pairing unions powers separation infinite choice - hT hC hQ ordinal smallQ irreflexive cutoff hc F hF filter - exact ⟨B, hB, f, hf, injection, positive, below⟩ - -end GroundChronologicalHistory - - - - - -structure ChronologyCoreCode (T V C D rD : ZFSet.{u}) - (graphs : Fin 5 → ZFSet.{u}) : Prop where - function : ∀ j, ZFSet.IsFunc T V (graphs j) - point : ∀ s ∈ T, ∀ L r μ birth height, - ZFSet.pair s L ∈ graphs 0 → ZFSet.pair s r ∈ graphs 1 → - ZFSet.pair s μ ∈ graphs 2 → ZFSet.pair s birth ∈ graphs 3 → - ZFSet.pair s height ∈ graphs 4 → ChronologyPointCode T C D rD s L r μ birth height - -namespace BoundedFormula - -def chronologyFunctionsFormula {n} (T V : Fin n) (graphs : Fin 5 → Fin n) : BoundedFormula n := - .conj (functionFormula T V (graphs 0)) (.conj (functionFormula T V (graphs 1)) - (.conj (functionFormula T V (graphs 2)) (.conj (functionFormula T V (graphs 3)) - (functionFormula T V (graphs 4))))) - -theorem truth_chronologyFunctionsFormula {n} (T V : Fin n) (graphs : Fin 5 → Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (chronologyFunctionsFormula T V graphs) env ↔ - ∀ j, ZFSet.IsFunc (env T) (env V) (env (graphs j)) := by - simp only [chronologyFunctionsFormula, Truth, truth_functionFormula] - exact ⟨fun ⟨a, b, c, d, e⟩ => Fin.cases a (Fin.cases b (Fin.cases c - (Fin.cases d (Fin.cases e (fun i => Fin.elim0 i))))), - fun h => ⟨h 0, h 1, h 2, h 3, h 4⟩⟩ - -def chronologyPointsFormula {n} (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) : - BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ - .allMem T (.allMem V.succ (.allMem V.succ.succ - (.allMem V.succ.succ.succ (.allMem V.succ.succ.succ.succ - (.allMem V.succ.succ.succ.succ.succ (imp - (.conj (pairMembershipFormula 5 4 (lift (graphs 0))) - (.conj (pairMembershipFormula 5 3 (lift (graphs 1))) - (.conj (pairMembershipFormula 5 2 (lift (graphs 2))) - (.conj (pairMembershipFormula 5 1 (lift (graphs 3))) - (pairMembershipFormula 5 0 (lift (graphs 4))))))) - (chronologyPointFormula (lift T) (lift C) (lift D) (lift rD) 5 4 3 2 1 0))))))) - -def chronologyCoreFormula {n} (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) : - BoundedFormula n := - .conj (chronologyFunctionsFormula T V graphs) (chronologyPointsFormula T V C D rD graphs) - -theorem truth_chronologyCoreFormula {n} (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (chronologyCoreFormula T V C D rD graphs) env ↔ - ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j)) := by - simp only [chronologyCoreFormula, Truth, truth_chronologyFunctionsFormula, - chronologyPointsFormula, truth_imp, truth_pairMembershipFormula, truth_chronologyPointFormula] - constructor - · rintro ⟨function, point⟩ - refine ⟨function, ?_⟩ - intro s hs L r μ birth height eL er eμ eb eh - exact point s hs L (ZFSet.pair_mem_prod.1 ((function 0).1 eL)).2 - r (ZFSet.pair_mem_prod.1 ((function 1).1 er)).2 - μ (ZFSet.pair_mem_prod.1 ((function 2).1 eμ)).2 - birth (ZFSet.pair_mem_prod.1 ((function 3).1 eb)).2 - height (ZFSet.pair_mem_prod.1 ((function 4).1 eh)).2 ⟨eL, er, eμ, eb, eh⟩ - · intro code - exact ⟨code.function, fun s hs L _ r _ μ _ birth _ height _ ⟨eL, er, eμ, eb, eh⟩ => - code.point s hs L r μ birth height eL er eμ eb eh⟩ - -theorem realize_chronologyCoreFormula (M : TransitiveGround.{u}) {n} - (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (chronologyCoreFormula T V C D rD graphs).toFormula env ↔ - ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j)) := - (realize_toFormula M _ env members).trans (truth_chronologyCoreFormula T V C D rD graphs env) - -end BoundedFormula - -namespace GroundChronologyFields -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) -variable (core : ChronologyCoreCode T fields.bound C D rD fields.graph) -include core - -theorem decoded_point {s : ZFSet.{u}} (hs : s ∈ T) : - ChronologyPointCode T C D rD s (fields.value 0 s) (fields.value 1 s) - (fields.value 2 s) (fields.value 3 s) (fields.value 4 s) := - core.point s hs _ _ _ _ _ (fields.value_entry 0 hs) (fields.value_entry 1 hs) - (fields.value_entry 2 hs) (fields.value_entry 3 hs) (fields.value_entry 4 hs) - -noncomputable def toHistory - (layers : ∀ cutoff ∈ T, ∀ t ∈ T, t = cutoff ∨ t ∈ cutoff → - CodedGrowthLayer M (fields.value 0) (fields.value 1) (fields.value 2) - (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) - (fields.value 3 cutoff) t) : GroundChronologicalHistory M T C D rD where - space := fields.value 0 - order := fields.value 1 - meetGraph := fields.value 2 - birth := fields.value 3 - height := fields.value 4 - space_mem := fun s _ => fields.value_ground 0 s - order_mem := fun s _ => fields.value_ground 1 s - meet_mem := fun s _ => fields.value_ground 2 s - birth_mem := fun s _ => fields.value_ground 3 s - height_mem := fun s _ => fields.value_ground 4 s - meet_order := fun _ hs => (fields.decoded_point core hs).meet - birth_function := fun _ hs => (fields.decoded_point core hs).birth_function - birth_bound := fun _ hs => (fields.decoded_point core hs).birth_bound - old_meet := fun _ hs => (fields.decoded_point core hs).old_meet - strict_height := fun _ hs => (fields.decoded_point core hs).strict_height - layer := layers - -end GroundChronologyFields -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundChronologicalHistory - -open SetFormula -universe u -variable {M N : TransitiveGround.{u}} {T C Q qlt : ZFSet.{u}} -variable (history : GroundChronologicalHistory M T C Q qlt) - -def of_inclusion (includes : M.sets ⊆ N.sets) : GroundChronologicalHistory N T C Q qlt where - space := history.space - order := history.order - meetGraph := history.meetGraph - birth := history.birth - height := history.height - space_mem := fun s hs => includes (history.space_mem s hs) - order_mem := fun s hs => includes (history.order_mem s hs) - meet_mem := fun s hs => includes (history.meet_mem s hs) - birth_mem := fun s hs => includes (history.birth_mem s hs) - height_mem := fun s hs => includes (history.height_mem s hs) - meet_order := history.meet_order - birth_function := history.birth_function - birth_bound := history.birth_bound - old_meet := history.old_meet - strict_height := history.strict_height - layer := fun cutoff hc t ht bounded => (history.layer cutoff hc t ht bounded).of_inclusion includes - -theorem exists_extension_basis - (includes : M.sets ⊆ N.sets) - (pairing : Realize N.sets SetFormula.pairing Fin.elim0) - (unions : Realize N.sets SetFormula.union Fin.elim0) - (powers : Realize N.sets powerSet Fin.elim0) (separation : SeparationSchema N.sets) - (infinite : Realize N.sets SetFormula.infinity Fin.elim0) - (choice : Realize N.sets SetFormula.choice Fin.elim0) - (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) - (ordinal : ordinalSetProperty T) (smallQ : M.groundEmbeddable Q ZFSet.omega) - (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) - {cutoff F : ZFSet.{u}} (hc : cutoff ∈ T) (hF : F ∈ N.sets) - (filter : MeetFilterCode (history.space cutoff) (history.order cutoff) (history.meetGraph cutoff) F) : - ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ - ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ history.order cutoff := - (history.of_inclusion includes).exists_internal_basis pairing unions powers separation infinite - choice (includes hT) (includes hC) (includes hQ) ordinal - (M.groundEmbeddable_of_inclusion N includes smallQ) irreflexive hc hF filter - -end PartitionPilot.Forcing.GroundChronologicalHistory - - - -namespace PartitionPilot.Forcing.GroundChronologyFields -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) - -noncomputable def attainedBound : ZFSet.{u} := - ZFSet.sUnion (ZFSet.range (fun j : Fin 5 => functionGraphRange T (fields.graph j))) - -theorem mem_attainedBound (y : ZFSet.{u}) : - y ∈ fields.attainedBound ↔ ∃ j : Fin 5, ∃ s ∈ T, ZFSet.pair s y ∈ fields.graph j := by - constructor - · intro hy - obtain ⟨R, hR, hy⟩ := ZFSet.mem_sUnion.1 hy - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hR - exact ⟨j, (mem_functionGraphRange T (fields.graph j) y).1 hy⟩ - · rintro ⟨j, s, hs, entry⟩ - exact ZFSet.mem_sUnion.2 ⟨functionGraphRange T (fields.graph j), - ZFSet.mem_range.2 ⟨j, rfl⟩, - (mem_functionGraphRange T (fields.graph j) y).2 ⟨s, hs, entry⟩⟩ - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (separation : SeparationSchema M.sets) - -include pairing unions separation in -theorem attainedBound_ground : fields.attainedBound ∈ M.sets := - M.union_mem unions (M.finite_range_mem pairing unions ⟨T, fields.time_ground⟩ - (fun j : Fin 5 => functionGraphRange T (fields.graph j)) - (fun j => M.functionGraphRange_mem unions separation fields.time_ground (fields.graph_ground j))) - -noncomputable def normalizeBound : GroundChronologyFields M T where - time_ground := fields.time_ground - bound := fields.attainedBound - bound_ground := fields.attainedBound_ground pairing unions separation - graph := fields.graph - graph_ground := fields.graph_ground - function := by - intro j - refine ⟨?_, (fields.function j).2⟩ - intro z hz - obtain ⟨s, hs, y, rfl⟩ := (fields.graphFunction j).shape z hz - exact ZFSet.pair_mem_prod.2 ⟨hs, (fields.mem_attainedBound y).2 ⟨j, s, hs, hz⟩⟩ - -theorem normalizeBound_graph : - (fields.normalizeBound pairing unions separation).graph = fields.graph := rfl - -theorem normalizeBound_value (j : Fin 5) (s : ZFSet.{u}) : - (fields.normalizeBound pairing unions separation).value j s = fields.value j s := rfl - -theorem normalizeBound_core (core : ChronologyCoreCode T fields.bound C D rD fields.graph) : - ChronologyCoreCode T (fields.normalizeBound pairing unions separation).bound C D rD - (fields.normalizeBound pairing unions separation).graph := - ⟨(fields.normalizeBound pairing unions separation).function, core.point⟩ - -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) -include limit - -theorem attainedBound_rank_lt (graphs : ∀ j, ZFSet.rank (fields.graph j) < o) : - ZFSet.rank fields.attainedBound < o := - (ZFSet.rank_sUnion_le _).trans_lt (rank_finiteRange_lt limit 5 _ - (fun j => (functionGraphRange_rank_le T (fields.graph j)).trans_lt (graphs j))) - -theorem normalizeBound_code_rank_lt (time : ZFSet.rank T < o) - (graphs : ∀ j, ZFSet.rank (fields.graph j) < o) : - ZFSet.rank (fields.normalizeBound pairing unions separation).code < o := - rank_nonemptyTupleCode_lt limit 6 _ - (Fin.cases time (Fin.cases (fields.attainedBound_rank_lt limit graphs) graphs)) - -end PartitionPilot.Forcing.GroundChronologyFields - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace ChronologyPointCode -theorem retarget_time {T S C D rD s L r μ birth height : ZFSet.{u}} - (point : ChronologyPointCode T C D rD s L r μ birth height) - (transitive : ∀ x ∈ S, ∀ y ∈ x, y ∈ S) (hs : s ∈ S) : - ChronologyPointCode S C D rD s L r μ birth height := by - refine ⟨point.meet, ?_, point.birth_bound, point.old_meet, point.strict_height⟩ - refine ⟨?_, point.birth_function.2⟩ - intro z hz - obtain ⟨x, hx, t, _, equal⟩ := ZFSet.mem_prod.1 (point.birth_function.1 hz) - subst z - exact ZFSet.pair_mem_prod.2 ⟨hx, (point.birth_bound x hx t hz).elim - (fun equal => equal.symm ▸ hs) (fun earlier => transitive s hs t earlier)⟩ -end ChronologyPointCode - -namespace GroundChronologyFields -variable {M : TransitiveGround.{u}} {T S C D rD : ZFSet.{u}} -variable (fields : GroundChronologyFields M T) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (separation : SeparationSchema M.sets) (hS : S ∈ M.sets) (subset : S ⊆ T) - -noncomputable def restrictTo : GroundChronologyFields M S where - time_ground := hS - bound := fields.bound - bound_ground := fields.bound_ground - graph := fun j => graphRestriction S (fields.graph j) - graph_ground := fun j => M.graphRestriction_mem unions separation hS (fields.graph_ground j) - function := by - intro j - refine ⟨?_, ((fields.graphFunction j).restrict subset).to_isFunc.2⟩ - intro z hz - obtain ⟨s, hs, x, equal, entry⟩ := mem_graphRestriction.1 hz - subst z - exact ZFSet.pair_mem_prod.2 ⟨hs, (ZFSet.pair_mem_prod.1 ((fields.function j).1 entry)).2⟩ - -theorem restrictTo_value (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ S) : - (fields.restrictTo unions separation hS subset).value j s = fields.value j s := - (fields.restrictTo unions separation hS subset).value_eq_of_entry j - (pair_mem_graphRestriction.2 ⟨fields.value_entry j (subset hs), hs⟩) - -theorem restrictTo_graph (j : Fin 5) : - (fields.restrictTo unions separation hS subset).graph j = graphRestriction S (fields.graph j) := rfl - -theorem restrictTo_core (core : ChronologyCoreCode T fields.bound C D rD fields.graph) - (transitive : ∀ x ∈ S, ∀ y ∈ x, y ∈ S) : - ChronologyCoreCode S fields.bound C D rD - (fields.restrictTo unions separation hS subset).graph := by - refine ⟨(fields.restrictTo unions separation hS subset).function, ?_⟩ - intro s hs L r μ birth height eL er eμ eb eh - exact (core.point s (subset hs) L r μ birth height - (pair_mem_graphRestriction.1 eL).1 (pair_mem_graphRestriction.1 er).1 - (pair_mem_graphRestriction.1 eμ).1 (pair_mem_graphRestriction.1 eb).1 - (pair_mem_graphRestriction.1 eh).1).retarget_time transitive hs - -theorem restrictTo_code_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - (fields.restrictTo unions separation hS subset).code ∈ M.sets := - (fields.restrictTo unions separation hS subset).code_ground pairing - -end GroundChronologyFields - - - - - -structure GroundSerializedChronology (M : TransitiveGround.{u}) (T C D rD : ZFSet.{u}) where - fields : GroundChronologyFields M T - ordinal : ordinalSetProperty T - core : ChronologyCoreCode T fields.bound C D rD fields.graph - layerBound : ZFSet.{u} - layer_bound_ground : layerBound ∈ M.sets - layers : ZFSet.{u} - layers_ground : layers ∈ M.sets - layer_function : ZFSet.IsFunc (chronologyPairs T) layerBound layers - layer_code : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, - ZFSet.pair (ZFSet.pair s t) z ∈ layers → - GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) - (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z - -namespace GroundSerializedChronology -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M T C D rD) - -noncomputable def layerWitness (s t : ZFSet.{u}) : ZFSet.{u} := - (show FunctionGraphOn (chronologyPairs T) serial.layers from - ⟨serial.layerBound, serial.layer_function⟩).totalValue (ZFSet.pair s t) - -theorem layerWitness_entry {s t : ZFSet.{u}} (hs : s ∈ T) (ht : t ∈ T) - (earlier : t = s ∨ t ∈ s) : - ZFSet.pair (ZFSet.pair s t) (serial.layerWitness s t) ∈ serial.layers := - (show FunctionGraphOn (chronologyPairs T) serial.layers from - ⟨serial.layerBound, serial.layer_function⟩).totalValue_entry - ((pair_mem_chronologyPairs T s t).2 ⟨hs, ht, earlier⟩) - -theorem layerWitness_ground (s t : ZFSet.{u}) : serial.layerWitness s t ∈ M.sets := - (show FunctionGraphOn (chronologyPairs T) serial.layers from - ⟨serial.layerBound, serial.layer_function⟩).totalValue_ground M serial.layers_ground _ - -noncomputable def decodedLayer {s t : ZFSet.{u}} (hs : s ∈ T) (ht : t ∈ T) - (earlier : t = s ∨ t ∈ s) : - CodedGrowthLayer M (serial.fields.value 0) (serial.fields.value 1) (serial.fields.value 2) - (serial.fields.value 0 s) (serial.fields.value 1 s) (serial.fields.value 2 s) - (serial.fields.value 3 s) t := - (serial.layer_code s hs t ht earlier _ (serial.layerWitness_entry hs ht earlier)).toLayer - (serial.layerWitness_ground s t) (serial.fields.value 0) (serial.fields.value 1) - (serial.fields.value 2) rfl (fun a ha => - ⟨serial.fields.value_entry 0 (serial.ordinal.1 t ht a ha), - serial.fields.value_entry 1 (serial.ordinal.1 t ht a ha), - serial.fields.value_entry 2 (serial.ordinal.1 t ht a ha)⟩) - -noncomputable def toHistory : GroundChronologicalHistory M T C D rD := - serial.fields.toHistory serial.core (fun _ hs _ ht earlier => serial.decodedLayer hs ht earlier) - -noncomputable def codeFields : Fin 3 → ZFSet.{u} := - Fin.cases serial.fields.code (Fin.cases serial.layerBound (fun _ => serial.layers)) - -noncomputable def code : ZFSet.{u} := nonemptyTupleCode 2 serial.codeFields - -theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : - serial.code ∈ M.sets := - M.nonemptyTupleCode_mem pairing 2 serial.codeFields - (Fin.cases (serial.fields.code_ground pairing) - (Fin.cases serial.layer_bound_ground (fun _ => serial.layers_ground))) - -theorem toHistory_values (s : ZFSet.{u}) : - serial.toHistory.space s = serial.fields.value 0 s ∧ - serial.toHistory.order s = serial.fields.value 1 s ∧ - serial.toHistory.meetGraph s = serial.fields.value 2 s ∧ - serial.toHistory.birth s = serial.fields.value 3 s ∧ - serial.toHistory.height s = serial.fields.value 4 s := ⟨rfl, rfl, rfl, rfl, rfl⟩ - -end GroundSerializedChronology -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundSerializedChronology -universe u -variable {M : TransitiveGround.{u}} {T T' C D rD : ZFSet.{u}} -variable (serial : GroundSerializedChronology M T C D rD) - -def castTime (equal : T = T') : GroundSerializedChronology M T' C D rD := equal ▸ serial - -theorem castTime_code (equal : T = T') : (serial.castTime equal).code = serial.code := by - cases equal - rfl - -theorem castTime_graph (equal : T = T') (j : Fin 5) : - (serial.castTime equal).fields.graph j = serial.fields.graph j := by - cases equal - rfl - -theorem castTime_value (equal : T = T') (j : Fin 5) (s : ZFSet.{u}) : - (serial.castTime equal).fields.value j s = serial.fields.value j s := by - cases equal - rfl - -theorem castTime_layers (equal : T = T') : - (serial.castTime equal).layers = serial.layers ∧ - (serial.castTime equal).layerBound = serial.layerBound := by - cases equal - exact ⟨rfl,rfl⟩ - -end PartitionPilot.Forcing.GroundSerializedChronology - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.BoundedChronologyCodes +import OAI.SetTheory.PartitionPrinciple.Definability.BoundedMeetOrderCodes +import OAI.SetTheory.PartitionPrinciple.Definability.StrictLexHeightFormulas +import OAI.SetTheory.PartitionPrinciple.Definability.TaggedGrowthLayerFormulas +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundCompressionPrefixGraphs + +namespace OAI + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem internal_chronological_coinitiality + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {L F T C Q r μ birth height qlt : ZFSet.{u}} + (hF : F ∈ M.sets) (hT : T ∈ M.sets) (hr : r ∈ M.sets) (hBirth : birth ∈ M.sets) + (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) (hHeight : height ∈ M.sets) + (meet : MeetOrderCode L r μ) (filter : MeetFilterCode L r μ F) + (born : ZFSet.IsFunc L T birth) (ordinal : ordinalSetProperty T) + (oldMeet : OldMeetCode r μ birth) + (strictHeight : StrictLexHeightCode L C Q r height qlt) + (smallQ : M.groundEmbeddable Q ZFSet.omega) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + (localBases : ∀ t ∈ essentialBirthIndices F T r birth, + M.InternalCountableBelow r F (relationFiber (birthEssentialSet F T r birth) + (relationConverse (birthEssentialSet F T r birth) (essentialBirthIndices F T r birth) birth) t)) : + ∃ B ∈ M.sets, ∃ f ∈ M.sets, + InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ r := by + have descent := essentialHeightDescent_of_chronological_laws meet filter born oldMeet strictHeight + have small := M.essentialBirthIndices_countable pairing unions powers separation infinite choice + hF hT hr hBirth hC hQ hHeight filter.subset ordinal strictHeight.function smallQ irreflexive descent + obtain ⟨B, hB, ⟨f, hf, injection⟩, positive, below⟩ := + M.internal_countable_basis_of_birth_layers pairing unions powers separation infinite choice + hF hT hr hBirth meet.order filter.subset born small localBases + exact ⟨B, hB, f, hf, injection, positive, below⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +structure ChronologyPointCode (T C D rD s L r μ birth height : ZFSet.{u}) : Prop where + meet : MeetOrderCode L r μ + birth_function : ZFSet.IsFunc L T birth + birth_bound : ∀ x ∈ L, ∀ t, ZFSet.pair x t ∈ birth → t = s ∨ t ∈ s + old_meet : OldMeetCode r μ birth + strict_height : StrictLexHeightCode L C D r height rD + +namespace BoundedFormula + +def chronologyPointFormula {n} (T C D rD s L r μ birth height : Fin n) : BoundedFormula n := + .conj (meetOrderFormula L r μ) (.conj (functionFormula L T birth) + (.conj (birthBoundFormula L T birth s) (.conj (oldMeetFormula L T r μ birth) + (strictLexHeightFormula L C D r height rD)))) + +theorem truth_chronologyPointFormula {n} (T C D rD s L r μ birth height : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (chronologyPointFormula T C D rD s L r μ birth height) env ↔ + ChronologyPointCode (env T) (env C) (env D) (env rD) (env s) + (env L) (env r) (env μ) (env birth) (env height) := by + simp only [chronologyPointFormula, Truth, truth_meetOrderFormula, + truth_functionFormula, truth_strictLexHeightFormula] + constructor + · rintro ⟨meet, function, bound, old, strict⟩ + exact ⟨meet, function, (truth_birthBoundFormula L T birth s env function).1 bound, + (truth_oldMeetFormula L T r μ birth env function).1 old, strict⟩ + · intro code + exact ⟨code.meet, code.birth_function, + (truth_birthBoundFormula L T birth s env code.birth_function).2 code.birth_bound, + (truth_oldMeetFormula L T r μ birth env code.birth_function).2 code.old_meet, + code.strict_height⟩ + +theorem realize_chronologyPointFormula (M : TransitiveGround.{u}) {n} + (T C D rD s L r μ birth height : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (chronologyPointFormula T C D rD s L r μ birth height).toFormula env ↔ + ChronologyPointCode (env T) (env C) (env D) (env rD) (env s) + (env L) (env r) (env μ) (env birth) (env height) := + (realize_toFormula M _ env members).trans + (truth_chronologyPointFormula T C D rD s L r μ birth height env) + +end BoundedFormula + + + + + +structure GroundChronologicalHistory (M : TransitiveGround.{u}) (T C Q qlt : ZFSet.{u}) where + space : ZFSet.{u} → ZFSet.{u} + order : ZFSet.{u} → ZFSet.{u} + meetGraph : ZFSet.{u} → ZFSet.{u} + birth : ZFSet.{u} → ZFSet.{u} + height : ZFSet.{u} → ZFSet.{u} + space_mem : ∀ s ∈ T, space s ∈ M.sets + order_mem : ∀ s ∈ T, order s ∈ M.sets + meet_mem : ∀ s ∈ T, meetGraph s ∈ M.sets + birth_mem : ∀ s ∈ T, birth s ∈ M.sets + height_mem : ∀ s ∈ T, height s ∈ M.sets + meet_order : ∀ s ∈ T, MeetOrderCode (space s) (order s) (meetGraph s) + birth_function : ∀ s ∈ T, ZFSet.IsFunc (space s) T (birth s) + birth_bound : ∀ s ∈ T, ∀ x ∈ space s, ∀ t, + ZFSet.pair x t ∈ birth s → t = s ∨ t ∈ s + old_meet : ∀ s ∈ T, OldMeetCode (order s) (meetGraph s) (birth s) + strict_height : ∀ s ∈ T, StrictLexHeightCode (space s) C Q (order s) (height s) qlt + layer : ∀ cutoff ∈ T, ∀ t ∈ T, t = cutoff ∨ t ∈ cutoff → + CodedGrowthLayer M space order meetGraph (space cutoff) (order cutoff) + (meetGraph cutoff) (birth cutoff) t + +namespace GroundChronologicalHistory + +variable {M : TransitiveGround.{u}} {T C Q qlt : ZFSet.{u}} +variable (history : GroundChronologicalHistory M T C Q qlt) + +theorem all_filters_internal_countable + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) + (ordinal : ordinalSetProperty T) (smallQ : M.groundEmbeddable Q ZFSet.omega) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) : + ∀ cutoff ∈ T, ∀ F ∈ M.sets, + MeetFilterCode (history.space cutoff) (history.order cutoff) (history.meetGraph cutoff) F → + M.InternalCountableBelow (history.order cutoff) F F := by + intro cutoff + induction cutoff using ZFSet.inductionOn with + | h cutoff ih => + intro hc F hF filter + have localBases : ∀ t ∈ essentialBirthIndices F T (history.order cutoff) (history.birth cutoff), + M.InternalCountableBelow (history.order cutoff) F + (essentialBirthFiber F T (history.order cutoff) (history.birth cutoff) t) := by + intro t ht + obtain ⟨htT, x, hx, xt⟩ := + (mem_essentialBirthIndices F T (history.order cutoff) (history.birth cutoff) t).1 ht + have bounded := history.birth_bound cutoff hc x + (filter.subset (birthEssentialSet_subset F T (history.order cutoff) (history.birth cutoff) hx)) t xt + apply (history.layer cutoff hc t htT bounded).internal_countable_essentials + pairing unions powers separation infinite choice (history.space_mem cutoff hc) + (history.order_mem cutoff hc) (history.birth_mem cutoff hc) hF hT (M.transitive hT htT) + (history.meet_order cutoff hc) filter (history.birth_function cutoff hc) + intro s hs + have hsT : s ∈ T := ordinal.1 t htT s hs + have before : s ∈ cutoff := bounded.elim + (fun equal => equal ▸ hs) (fun earlier => ordinal.2 cutoff hc t earlier s hs) + exact ⟨history.space_mem s hsT, history.meet_order s hsT, ih s before hsT⟩ + obtain ⟨B, hB, f, hf, injection, positive, below⟩ := + M.internal_chronological_coinitiality pairing unions powers separation infinite choice + hF hT (history.order_mem cutoff hc) (history.birth_mem cutoff hc) + hC hQ (history.height_mem cutoff hc) (history.meet_order cutoff hc) filter + (history.birth_function cutoff hc) ordinal (history.old_meet cutoff hc) + (history.strict_height cutoff hc) smallQ irreflexive localBases + exact ⟨B, hB, ⟨f, hf, injection⟩, positive, below⟩ + +theorem exists_internal_basis + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) + (ordinal : ordinalSetProperty T) (smallQ : M.groundEmbeddable Q ZFSet.omega) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + {cutoff F : ZFSet.{u}} (hc : cutoff ∈ T) (hF : F ∈ M.sets) + (filter : MeetFilterCode (history.space cutoff) (history.order cutoff) (history.meetGraph cutoff) F) : + ∃ B ∈ M.sets, ∃ f ∈ M.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ history.order cutoff := by + obtain ⟨B, hB, ⟨f, hf, injection⟩, positive, below⟩ := + history.all_filters_internal_countable pairing unions powers separation infinite choice + hT hC hQ ordinal smallQ irreflexive cutoff hc F hF filter + exact ⟨B, hB, f, hf, injection, positive, below⟩ + +end GroundChronologicalHistory + + + + + +structure ChronologyCoreCode (T V C D rD : ZFSet.{u}) + (graphs : Fin 5 → ZFSet.{u}) : Prop where + function : ∀ j, ZFSet.IsFunc T V (graphs j) + point : ∀ s ∈ T, ∀ L r μ birth height, + ZFSet.pair s L ∈ graphs 0 → ZFSet.pair s r ∈ graphs 1 → + ZFSet.pair s μ ∈ graphs 2 → ZFSet.pair s birth ∈ graphs 3 → + ZFSet.pair s height ∈ graphs 4 → ChronologyPointCode T C D rD s L r μ birth height + +namespace BoundedFormula + +def chronologyFunctionsFormula {n} (T V : Fin n) (graphs : Fin 5 → Fin n) : BoundedFormula n := + .conj (functionFormula T V (graphs 0)) (.conj (functionFormula T V (graphs 1)) + (.conj (functionFormula T V (graphs 2)) (.conj (functionFormula T V (graphs 3)) + (functionFormula T V (graphs 4))))) + +theorem truth_chronologyFunctionsFormula {n} (T V : Fin n) (graphs : Fin 5 → Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (chronologyFunctionsFormula T V graphs) env ↔ + ∀ j, ZFSet.IsFunc (env T) (env V) (env (graphs j)) := by + simp only [chronologyFunctionsFormula, Truth, truth_functionFormula] + exact ⟨fun ⟨a, b, c, d, e⟩ => Fin.cases a (Fin.cases b (Fin.cases c + (Fin.cases d (Fin.cases e (fun i => Fin.elim0 i))))), + fun h => ⟨h 0, h 1, h 2, h 3, h 4⟩⟩ + +def chronologyPointsFormula {n} (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) : + BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ + .allMem T (.allMem V.succ (.allMem V.succ.succ + (.allMem V.succ.succ.succ (.allMem V.succ.succ.succ.succ + (.allMem V.succ.succ.succ.succ.succ (imp + (.conj (pairMembershipFormula 5 4 (lift (graphs 0))) + (.conj (pairMembershipFormula 5 3 (lift (graphs 1))) + (.conj (pairMembershipFormula 5 2 (lift (graphs 2))) + (.conj (pairMembershipFormula 5 1 (lift (graphs 3))) + (pairMembershipFormula 5 0 (lift (graphs 4))))))) + (chronologyPointFormula (lift T) (lift C) (lift D) (lift rD) 5 4 3 2 1 0))))))) + +def chronologyCoreFormula {n} (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) : + BoundedFormula n := + .conj (chronologyFunctionsFormula T V graphs) (chronologyPointsFormula T V C D rD graphs) + +theorem truth_chronologyCoreFormula {n} (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (chronologyCoreFormula T V C D rD graphs) env ↔ + ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j)) := by + simp only [chronologyCoreFormula, Truth, truth_chronologyFunctionsFormula, + chronologyPointsFormula, truth_imp, truth_pairMembershipFormula, truth_chronologyPointFormula] + constructor + · rintro ⟨function, point⟩ + refine ⟨function, ?_⟩ + intro s hs L r μ birth height eL er eμ eb eh + exact point s hs L (ZFSet.pair_mem_prod.1 ((function 0).1 eL)).2 + r (ZFSet.pair_mem_prod.1 ((function 1).1 er)).2 + μ (ZFSet.pair_mem_prod.1 ((function 2).1 eμ)).2 + birth (ZFSet.pair_mem_prod.1 ((function 3).1 eb)).2 + height (ZFSet.pair_mem_prod.1 ((function 4).1 eh)).2 ⟨eL, er, eμ, eb, eh⟩ + · intro code + exact ⟨code.function, fun s hs L _ r _ μ _ birth _ height _ ⟨eL, er, eμ, eb, eh⟩ => + code.point s hs L r μ birth height eL er eμ eb eh⟩ + +theorem realize_chronologyCoreFormula (M : TransitiveGround.{u}) {n} + (T V C D rD : Fin n) (graphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (chronologyCoreFormula T V C D rD graphs).toFormula env ↔ + ChronologyCoreCode (env T) (env V) (env C) (env D) (env rD) (fun j => env (graphs j)) := + (realize_toFormula M _ env members).trans (truth_chronologyCoreFormula T V C D rD graphs env) + +end BoundedFormula + +namespace GroundChronologyFields +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) +variable (core : ChronologyCoreCode T fields.bound C D rD fields.graph) +include core + +theorem decoded_point {s : ZFSet.{u}} (hs : s ∈ T) : + ChronologyPointCode T C D rD s (fields.value 0 s) (fields.value 1 s) + (fields.value 2 s) (fields.value 3 s) (fields.value 4 s) := + core.point s hs _ _ _ _ _ (fields.value_entry 0 hs) (fields.value_entry 1 hs) + (fields.value_entry 2 hs) (fields.value_entry 3 hs) (fields.value_entry 4 hs) + +noncomputable def toHistory + (layers : ∀ cutoff ∈ T, ∀ t ∈ T, t = cutoff ∨ t ∈ cutoff → + CodedGrowthLayer M (fields.value 0) (fields.value 1) (fields.value 2) + (fields.value 0 cutoff) (fields.value 1 cutoff) (fields.value 2 cutoff) + (fields.value 3 cutoff) t) : GroundChronologicalHistory M T C D rD where + space := fields.value 0 + order := fields.value 1 + meetGraph := fields.value 2 + birth := fields.value 3 + height := fields.value 4 + space_mem := fun s _ => fields.value_ground 0 s + order_mem := fun s _ => fields.value_ground 1 s + meet_mem := fun s _ => fields.value_ground 2 s + birth_mem := fun s _ => fields.value_ground 3 s + height_mem := fun s _ => fields.value_ground 4 s + meet_order := fun _ hs => (fields.decoded_point core hs).meet + birth_function := fun _ hs => (fields.decoded_point core hs).birth_function + birth_bound := fun _ hs => (fields.decoded_point core hs).birth_bound + old_meet := fun _ hs => (fields.decoded_point core hs).old_meet + strict_height := fun _ hs => (fields.decoded_point core hs).strict_height + layer := layers + +end GroundChronologyFields +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundChronologicalHistory + +open SetFormula +universe u +variable {M N : TransitiveGround.{u}} {T C Q qlt : ZFSet.{u}} +variable (history : GroundChronologicalHistory M T C Q qlt) + +def of_inclusion (includes : M.sets ⊆ N.sets) : GroundChronologicalHistory N T C Q qlt where + space := history.space + order := history.order + meetGraph := history.meetGraph + birth := history.birth + height := history.height + space_mem := fun s hs => includes (history.space_mem s hs) + order_mem := fun s hs => includes (history.order_mem s hs) + meet_mem := fun s hs => includes (history.meet_mem s hs) + birth_mem := fun s hs => includes (history.birth_mem s hs) + height_mem := fun s hs => includes (history.height_mem s hs) + meet_order := history.meet_order + birth_function := history.birth_function + birth_bound := history.birth_bound + old_meet := history.old_meet + strict_height := history.strict_height + layer := fun cutoff hc t ht bounded => (history.layer cutoff hc t ht bounded).of_inclusion includes + +theorem exists_extension_basis + (includes : M.sets ⊆ N.sets) + (pairing : Realize N.sets SetFormula.pairing Fin.elim0) + (unions : Realize N.sets SetFormula.union Fin.elim0) + (powers : Realize N.sets powerSet Fin.elim0) (separation : SeparationSchema N.sets) + (infinite : Realize N.sets SetFormula.infinity Fin.elim0) + (choice : Realize N.sets SetFormula.choice Fin.elim0) + (hT : T ∈ M.sets) (hC : C ∈ M.sets) (hQ : Q ∈ M.sets) + (ordinal : ordinalSetProperty T) (smallQ : M.groundEmbeddable Q ZFSet.omega) + (irreflexive : ∀ q ∈ Q, ZFSet.pair q q ∉ qlt) + {cutoff F : ZFSet.{u}} (hc : cutoff ∈ T) (hF : F ∈ N.sets) + (filter : MeetFilterCode (history.space cutoff) (history.order cutoff) (history.meetGraph cutoff) F) : + ∃ B ∈ N.sets, ∃ f ∈ N.sets, InjectionCode B ZFSet.omega f ∧ B ⊆ F ∧ + ∀ x ∈ F, ∃ b ∈ B, ZFSet.pair b x ∈ history.order cutoff := + (history.of_inclusion includes).exists_internal_basis pairing unions powers separation infinite + choice (includes hT) (includes hC) (includes hQ) ordinal + (M.groundEmbeddable_of_inclusion N includes smallQ) irreflexive hc hF filter + +end PartitionPilot.Forcing.GroundChronologicalHistory + + + +namespace PartitionPilot.Forcing.GroundChronologyFields +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) + +noncomputable def attainedBound : ZFSet.{u} := + ZFSet.sUnion (ZFSet.range (fun j : Fin 5 => functionGraphRange T (fields.graph j))) + +theorem mem_attainedBound (y : ZFSet.{u}) : + y ∈ fields.attainedBound ↔ ∃ j : Fin 5, ∃ s ∈ T, ZFSet.pair s y ∈ fields.graph j := by + constructor + · intro hy + obtain ⟨R, hR, hy⟩ := ZFSet.mem_sUnion.1 hy + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hR + exact ⟨j, (mem_functionGraphRange T (fields.graph j) y).1 hy⟩ + · rintro ⟨j, s, hs, entry⟩ + exact ZFSet.mem_sUnion.2 ⟨functionGraphRange T (fields.graph j), + ZFSet.mem_range.2 ⟨j, rfl⟩, + (mem_functionGraphRange T (fields.graph j) y).2 ⟨s, hs, entry⟩⟩ + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (separation : SeparationSchema M.sets) + +include pairing unions separation in +theorem attainedBound_ground : fields.attainedBound ∈ M.sets := + M.union_mem unions (M.finite_range_mem pairing unions ⟨T, fields.time_ground⟩ + (fun j : Fin 5 => functionGraphRange T (fields.graph j)) + (fun j => M.functionGraphRange_mem unions separation fields.time_ground (fields.graph_ground j))) + +noncomputable def normalizeBound : GroundChronologyFields M T where + time_ground := fields.time_ground + bound := fields.attainedBound + bound_ground := fields.attainedBound_ground pairing unions separation + graph := fields.graph + graph_ground := fields.graph_ground + function := by + intro j + refine ⟨?_, (fields.function j).2⟩ + intro z hz + obtain ⟨s, hs, y, rfl⟩ := (fields.graphFunction j).shape z hz + exact ZFSet.pair_mem_prod.2 ⟨hs, (fields.mem_attainedBound y).2 ⟨j, s, hs, hz⟩⟩ + +theorem normalizeBound_graph : + (fields.normalizeBound pairing unions separation).graph = fields.graph := rfl + +theorem normalizeBound_value (j : Fin 5) (s : ZFSet.{u}) : + (fields.normalizeBound pairing unions separation).value j s = fields.value j s := rfl + +theorem normalizeBound_core (core : ChronologyCoreCode T fields.bound C D rD fields.graph) : + ChronologyCoreCode T (fields.normalizeBound pairing unions separation).bound C D rD + (fields.normalizeBound pairing unions separation).graph := + ⟨(fields.normalizeBound pairing unions separation).function, core.point⟩ + +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) +include limit + +theorem attainedBound_rank_lt (graphs : ∀ j, ZFSet.rank (fields.graph j) < o) : + ZFSet.rank fields.attainedBound < o := + (ZFSet.rank_sUnion_le _).trans_lt (rank_finiteRange_lt limit 5 _ + (fun j => (functionGraphRange_rank_le T (fields.graph j)).trans_lt (graphs j))) + +theorem normalizeBound_code_rank_lt (time : ZFSet.rank T < o) + (graphs : ∀ j, ZFSet.rank (fields.graph j) < o) : + ZFSet.rank (fields.normalizeBound pairing unions separation).code < o := + rank_nonemptyTupleCode_lt limit 6 _ + (Fin.cases time (Fin.cases (fields.attainedBound_rank_lt limit graphs) graphs)) + +end PartitionPilot.Forcing.GroundChronologyFields + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace ChronologyPointCode +theorem retarget_time {T S C D rD s L r μ birth height : ZFSet.{u}} + (point : ChronologyPointCode T C D rD s L r μ birth height) + (transitive : ∀ x ∈ S, ∀ y ∈ x, y ∈ S) (hs : s ∈ S) : + ChronologyPointCode S C D rD s L r μ birth height := by + refine ⟨point.meet, ?_, point.birth_bound, point.old_meet, point.strict_height⟩ + refine ⟨?_, point.birth_function.2⟩ + intro z hz + obtain ⟨x, hx, t, _, equal⟩ := ZFSet.mem_prod.1 (point.birth_function.1 hz) + subst z + exact ZFSet.pair_mem_prod.2 ⟨hx, (point.birth_bound x hx t hz).elim + (fun equal => equal.symm ▸ hs) (fun earlier => transitive s hs t earlier)⟩ +end ChronologyPointCode + +namespace GroundChronologyFields +variable {M : TransitiveGround.{u}} {T S C D rD : ZFSet.{u}} +variable (fields : GroundChronologyFields M T) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (separation : SeparationSchema M.sets) (hS : S ∈ M.sets) (subset : S ⊆ T) + +noncomputable def restrictTo : GroundChronologyFields M S where + time_ground := hS + bound := fields.bound + bound_ground := fields.bound_ground + graph := fun j => graphRestriction S (fields.graph j) + graph_ground := fun j => M.graphRestriction_mem unions separation hS (fields.graph_ground j) + function := by + intro j + refine ⟨?_, ((fields.graphFunction j).restrict subset).to_isFunc.2⟩ + intro z hz + obtain ⟨s, hs, x, equal, entry⟩ := mem_graphRestriction.1 hz + subst z + exact ZFSet.pair_mem_prod.2 ⟨hs, (ZFSet.pair_mem_prod.1 ((fields.function j).1 entry)).2⟩ + +theorem restrictTo_value (j : Fin 5) {s : ZFSet.{u}} (hs : s ∈ S) : + (fields.restrictTo unions separation hS subset).value j s = fields.value j s := + (fields.restrictTo unions separation hS subset).value_eq_of_entry j + (pair_mem_graphRestriction.2 ⟨fields.value_entry j (subset hs), hs⟩) + +theorem restrictTo_graph (j : Fin 5) : + (fields.restrictTo unions separation hS subset).graph j = graphRestriction S (fields.graph j) := rfl + +theorem restrictTo_core (core : ChronologyCoreCode T fields.bound C D rD fields.graph) + (transitive : ∀ x ∈ S, ∀ y ∈ x, y ∈ S) : + ChronologyCoreCode S fields.bound C D rD + (fields.restrictTo unions separation hS subset).graph := by + refine ⟨(fields.restrictTo unions separation hS subset).function, ?_⟩ + intro s hs L r μ birth height eL er eμ eb eh + exact (core.point s (subset hs) L r μ birth height + (pair_mem_graphRestriction.1 eL).1 (pair_mem_graphRestriction.1 er).1 + (pair_mem_graphRestriction.1 eμ).1 (pair_mem_graphRestriction.1 eb).1 + (pair_mem_graphRestriction.1 eh).1).retarget_time transitive hs + +theorem restrictTo_code_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + (fields.restrictTo unions separation hS subset).code ∈ M.sets := + (fields.restrictTo unions separation hS subset).code_ground pairing + +end GroundChronologyFields + + + + + +structure GroundSerializedChronology (M : TransitiveGround.{u}) (T C D rD : ZFSet.{u}) where + fields : GroundChronologyFields M T + ordinal : ordinalSetProperty T + core : ChronologyCoreCode T fields.bound C D rD fields.graph + layerBound : ZFSet.{u} + layer_bound_ground : layerBound ∈ M.sets + layers : ZFSet.{u} + layers_ground : layers ∈ M.sets + layer_function : ZFSet.IsFunc (chronologyPairs T) layerBound layers + layer_code : ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ z, + ZFSet.pair (ZFSet.pair s t) z ∈ layers → + GrowthLayerWitnessCode (fields.graph 0) (fields.graph 1) (fields.graph 2) + (fields.value 0 s) (fields.value 1 s) (fields.value 2 s) (fields.value 3 s) t ZFSet.omega z + +namespace GroundSerializedChronology +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M T C D rD) + +noncomputable def layerWitness (s t : ZFSet.{u}) : ZFSet.{u} := + (show FunctionGraphOn (chronologyPairs T) serial.layers from + ⟨serial.layerBound, serial.layer_function⟩).totalValue (ZFSet.pair s t) + +theorem layerWitness_entry {s t : ZFSet.{u}} (hs : s ∈ T) (ht : t ∈ T) + (earlier : t = s ∨ t ∈ s) : + ZFSet.pair (ZFSet.pair s t) (serial.layerWitness s t) ∈ serial.layers := + (show FunctionGraphOn (chronologyPairs T) serial.layers from + ⟨serial.layerBound, serial.layer_function⟩).totalValue_entry + ((pair_mem_chronologyPairs T s t).2 ⟨hs, ht, earlier⟩) + +theorem layerWitness_ground (s t : ZFSet.{u}) : serial.layerWitness s t ∈ M.sets := + (show FunctionGraphOn (chronologyPairs T) serial.layers from + ⟨serial.layerBound, serial.layer_function⟩).totalValue_ground M serial.layers_ground _ + +noncomputable def decodedLayer {s t : ZFSet.{u}} (hs : s ∈ T) (ht : t ∈ T) + (earlier : t = s ∨ t ∈ s) : + CodedGrowthLayer M (serial.fields.value 0) (serial.fields.value 1) (serial.fields.value 2) + (serial.fields.value 0 s) (serial.fields.value 1 s) (serial.fields.value 2 s) + (serial.fields.value 3 s) t := + (serial.layer_code s hs t ht earlier _ (serial.layerWitness_entry hs ht earlier)).toLayer + (serial.layerWitness_ground s t) (serial.fields.value 0) (serial.fields.value 1) + (serial.fields.value 2) rfl (fun a ha => + ⟨serial.fields.value_entry 0 (serial.ordinal.1 t ht a ha), + serial.fields.value_entry 1 (serial.ordinal.1 t ht a ha), + serial.fields.value_entry 2 (serial.ordinal.1 t ht a ha)⟩) + +noncomputable def toHistory : GroundChronologicalHistory M T C D rD := + serial.fields.toHistory serial.core (fun _ hs _ ht earlier => serial.decodedLayer hs ht earlier) + +noncomputable def codeFields : Fin 3 → ZFSet.{u} := + Fin.cases serial.fields.code (Fin.cases serial.layerBound (fun _ => serial.layers)) + +noncomputable def code : ZFSet.{u} := nonemptyTupleCode 2 serial.codeFields + +theorem code_ground (pairing : Realize M.sets SetFormula.pairing Fin.elim0) : + serial.code ∈ M.sets := + M.nonemptyTupleCode_mem pairing 2 serial.codeFields + (Fin.cases (serial.fields.code_ground pairing) + (Fin.cases serial.layer_bound_ground (fun _ => serial.layers_ground))) + +theorem toHistory_values (s : ZFSet.{u}) : + serial.toHistory.space s = serial.fields.value 0 s ∧ + serial.toHistory.order s = serial.fields.value 1 s ∧ + serial.toHistory.meetGraph s = serial.fields.value 2 s ∧ + serial.toHistory.birth s = serial.fields.value 3 s ∧ + serial.toHistory.height s = serial.fields.value 4 s := ⟨rfl, rfl, rfl, rfl, rfl⟩ + +end GroundSerializedChronology +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundSerializedChronology +universe u +variable {M : TransitiveGround.{u}} {T T' C D rD : ZFSet.{u}} +variable (serial : GroundSerializedChronology M T C D rD) + +def castTime (equal : T = T') : GroundSerializedChronology M T' C D rD := equal ▸ serial + +theorem castTime_code (equal : T = T') : (serial.castTime equal).code = serial.code := by + cases equal + rfl + +theorem castTime_graph (equal : T = T') (j : Fin 5) : + (serial.castTime equal).fields.graph j = serial.fields.graph j := by + cases equal + rfl + +theorem castTime_value (equal : T = T') (j : Fin 5) (s : ZFSet.{u}) : + (serial.castTime equal).fields.value j s = serial.fields.value j s := by + cases equal + rfl + +theorem castTime_layers (equal : T = T') : + (serial.castTime equal).layers = serial.layers ∧ + (serial.castTime equal).layerBound = serial.layerBound := by + cases equal + exact ⟨rfl,rfl⟩ + +end PartitionPilot.Forcing.GroundSerializedChronology + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedCompressionChronology.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedCompressionChronology.lean index 11206370d49634e28fa9293aaee05ea52f7ff28f..c46dc4f435a75edc6c004ac1d71c997fef839807 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedCompressionChronology.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSerializedCompressionChronology.lean @@ -1,68 +1,68 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologyWitnessSelection -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRankedCompressionFieldsTransport - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundCompressionState -open SetFormula -universe u -variable {M : TransitiveGround.{u}} -variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} -variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} -variable (state : GroundCompressionState M seed) -variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) -variable {base old T0 C Q qlt original : ZFSet.{u}} -variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) -variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) -variable (prior : GroundSerializedChronology M T0 C Q qlt) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) -variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) -variable (hBase : base ∈ T0) -variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) -variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) -variable (initialMeet : state.data.μD = μ0) -variable (priorSpace : prior.fields.value 0 base = P0) (priorOrder : prior.fields.value 1 base = r0) -variable (priorMeet : prior.fields.value 2 base = μ0) (priorBirth : prior.fields.value 3 base = old) -include pairing unions powers separation collection infinite choice hI hSources hReps hG hT - hBase constant initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth - -theorem exists_serializedPrefix_of_fields - (fields : GroundChronologyFields M (insert births.limit births.limit)) - (core : ChronologyCoreCode (insert births.limit births.limit) fields.bound C Q qlt fields.graph) - (values : ∀ j s, s ∈ insert births.limit births.limit → - fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) : - ∃ serial : GroundSerializedChronology M (insert births.limit births.limit) C Q qlt, - serial.fields = fields ∧ serial.code ∈ M.sets := - fields.exists_serializedChronology pairing unions powers separation collection choice infinite core - (state.prefix_rawWitnesses data births heights prior fields pairing unions powers separation - hI hSources hReps hG hT hBase constant initialDomain initialOrder initialMeet - priorSpace priorOrder priorMeet priorBirth values) - (ordinalSetProperty_succ births.times.ordinal) - -theorem exists_serializedPrefix : - ∃ serial : GroundSerializedChronology M (insert births.limit births.limit) C Q qlt, - serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert births.limit births.limit → - serial.fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s := by - have agreement : ∀ j s, s ∈ T0 → prior.fields.value j s = prior.toHistory.fieldValue j s := by - intro j s _ - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j - obtain ⟨fields, _, core, values⟩ := state.exists_groundPrefixFields data births heights prior.fields prior.toHistory - pairing unions powers separation collection infinite hI hSources hReps hG hT prior.ordinal hBase agreement - obtain ⟨serial, same, ground⟩ := state.exists_serializedPrefix_of_fields data births heights prior - pairing unions powers separation collection infinite choice hI hSources hReps hG hT hBase - constant initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth fields core values - exact ⟨serial, ground, same.symm ▸ values⟩ - -end PartitionPilot.Forcing.GroundCompressionState - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundChronologyWitnessSelection +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRankedCompressionFieldsTransport + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundCompressionState +open SetFormula +universe u +variable {M : TransitiveGround.{u}} +variable {P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters : ZFSet.{u}} +variable {seed : FixedCompressionSeed P0 r0 μ0 A0 τ I Sources Reps G m inv one T Filters} +variable (state : GroundCompressionState M seed) +variable (data : GroundCompressionUnionData M state.data I Sources Reps G m one T) +variable {base old T0 C Q qlt original : ZFSet.{u}} +variable (births : GroundCompressionBirthData M state.data I Sources Reps G m one T data base old) +variable (heights : GroundCompressionHeightData M state.data I Sources Reps G m one T data P0 C Q qlt original) +variable (prior : GroundSerializedChronology M T0 C Q qlt) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI : I ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) +variable (hG : G ∈ M.sets) (hT : T ∈ M.sets) +variable (hBase : base ∈ T0) +variable (constant : RecursiveTemplateConstancy P0 r0 μ0 state.data) +variable (initialDomain : state.data.D = P0) (initialOrder : state.data.rD = r0) +variable (initialMeet : state.data.μD = μ0) +variable (priorSpace : prior.fields.value 0 base = P0) (priorOrder : prior.fields.value 1 base = r0) +variable (priorMeet : prior.fields.value 2 base = μ0) (priorBirth : prior.fields.value 3 base = old) +include pairing unions powers separation collection infinite choice hI hSources hReps hG hT + hBase constant initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth + +theorem exists_serializedPrefix_of_fields + (fields : GroundChronologyFields M (insert births.limit births.limit)) + (core : ChronologyCoreCode (insert births.limit births.limit) fields.bound C Q qlt fields.graph) + (values : ∀ j s, s ∈ insert births.limit births.limit → + fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s) : + ∃ serial : GroundSerializedChronology M (insert births.limit births.limit) C Q qlt, + serial.fields = fields ∧ serial.code ∈ M.sets := + fields.exists_serializedChronology pairing unions powers separation collection choice infinite core + (state.prefix_rawWitnesses data births heights prior fields pairing unions powers separation + hI hSources hReps hG hT hBase constant initialDomain initialOrder initialMeet + priorSpace priorOrder priorMeet priorBirth values) + (ordinalSetProperty_succ births.times.ordinal) + +theorem exists_serializedPrefix : + ∃ serial : GroundSerializedChronology M (insert births.limit births.limit) C Q qlt, + serial.code ∈ M.sets ∧ ∀ j s, s ∈ insert births.limit births.limit → + serial.fields.value j s = (state.prefixFields data births heights prior.toHistory).fieldValue j s := by + have agreement : ∀ j s, s ∈ T0 → prior.fields.value j s = prior.toHistory.fieldValue j s := by + intro j s _ + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (fun i => Fin.elim0 i))))) j + obtain ⟨fields, _, core, values⟩ := state.exists_groundPrefixFields data births heights prior.fields prior.toHistory + pairing unions powers separation collection infinite hI hSources hReps hG hT prior.ordinal hBase agreement + obtain ⟨serial, same, ground⟩ := state.exists_serializedPrefix_of_fields data births heights prior + pairing unions powers separation collection infinite choice hI hSources hReps hG hT hBase + constant initialDomain initialOrder initialMeet priorSpace priorOrder priorMeet priorBirth fields core values + exact ⟨serial, ground, same.symm ▸ values⟩ + +end PartitionPilot.Forcing.GroundCompressionState + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallAssignmentCuts.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallAssignmentCuts.lean index 28b85e386f52ea51b18f981c9ef5217aaf67adeb..312fac5fae7f0ccc6269ad10946cad3f3754d088 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallAssignmentCuts.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallAssignmentCuts.lean @@ -1,41 +1,41 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAssignmentIndexLevels - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem small_assignmentCuts_bounded - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {U J K levels : ZFSet.{u}} (hU : U ∈ M.sets) (hK : K ∈ M.sets) - (hLevels : levels ∈ M.sets) (regular : GroundRegular M K) - (small : GroundBelow M U K) (function : ZFSet.IsFunc J K levels) (subset : U ⊆ J) : - ∃ beta ∈ K, ∀ A, A ⊆ U → assignmentCut levels beta A = A := by - have restricted : ZFSet.IsFunc U K (graphRestriction U levels) := by - refine ⟨?_, ?_⟩ - · intro z member - obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 member - exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.pair_mem_prod.1 (function.1 entry)).2⟩ - · intro x hx - obtain ⟨y, entry, unique⟩ := function.2 x (subset hx) - exact ⟨y, pair_mem_graphRestriction.2 ⟨entry, hx⟩, - fun z hz => unique z (pair_mem_graphRestriction.1 hz).1⟩ - obtain ⟨beta, hBeta, bound⟩ := regular.bound_small_domain pairing unions powers separation - hU hK (M.graphRestriction_mem unions separation hU hLevels) small restricted - refine ⟨beta, hBeta, fun A contained => assignmentCut_eq_of_lower ?_⟩ - intro z hz - obtain ⟨level, entry, _⟩ := function.2 z (subset (contained hz)) - exact ⟨level, bound z level (pair_mem_graphRestriction.2 ⟨entry, contained hz⟩), entry⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAssignmentIndexLevels + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem small_assignmentCuts_bounded + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {U J K levels : ZFSet.{u}} (hU : U ∈ M.sets) (hK : K ∈ M.sets) + (hLevels : levels ∈ M.sets) (regular : GroundRegular M K) + (small : GroundBelow M U K) (function : ZFSet.IsFunc J K levels) (subset : U ⊆ J) : + ∃ beta ∈ K, ∀ A, A ⊆ U → assignmentCut levels beta A = A := by + have restricted : ZFSet.IsFunc U K (graphRestriction U levels) := by + refine ⟨?_, ?_⟩ + · intro z member + obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 member + exact ZFSet.pair_mem_prod.2 ⟨hx, (ZFSet.pair_mem_prod.1 (function.1 entry)).2⟩ + · intro x hx + obtain ⟨y, entry, unique⟩ := function.2 x (subset hx) + exact ⟨y, pair_mem_graphRestriction.2 ⟨entry, hx⟩, + fun z hz => unique z (pair_mem_graphRestriction.1 hz).1⟩ + obtain ⟨beta, hBeta, bound⟩ := regular.bound_small_domain pairing unions powers separation + hU hK (M.graphRestriction_mem unions separation hU hLevels) small restricted + refine ⟨beta, hBeta, fun A contained => assignmentCut_eq_of_lower ?_⟩ + intro z hz + obtain ⟨level, entry, _⟩ := function.2 z (subset (contained hz)) + exact ⟨level, bound z level (pair_mem_graphRestriction.2 ⟨entry, contained hz⟩), entry⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFamilyRangeRanks.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFamilyRangeRanks.lean index b478d8dc532c56d72e6045b6acd3cce794dae2c6..84184bc1ee3db79ce8076cb95d2ad2cb70ec8328 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFamilyRangeRanks.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFamilyRangeRanks.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFamilyValueUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundRegular -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (regular : GroundRegular M K) -include regular - -theorem familyCodeGraph_valueRange_rank_lt - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) - {I : Type v} [Small.{u} I] (key value : I → ZFSet.{u}) (injective : Function.Injective key) - (domain : ZFSet.range key ∈ M.sets) (whole : familyCodeGraph key value ∈ M.sets) - (small : GroundBelow M (ZFSet.range key) K) - (ranks : ∀ i, ZFSet.rank (value i) < ZFSet.rank K) : - ZFSet.rank (ZFSet.range value) < ZFSet.rank K := by - let R := ZFSet.range value - have hR : R ∈ M.sets := M.familyCodeGraph_valueRange_mem unions separation key value domain whole - have rankGround := M.cumulativeRankGraph_mem pairing unions powers separation collection hR hK - have rankFunction : ZFSet.IsFunc R K (cumulativeRankGraph R K) := by - apply cumulativeRankGraph_function ordinal - intro x hx - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx - exact ranks i - let graph := relationCompose (ZFSet.range key) R K (familyCodeGraph key value) (cumulativeRankGraph R K) - have ground : graph ∈ M.sets := M.relationCompose_mem pairing unions powers separation - domain hR hK whole rankGround - have function : ZFSet.IsFunc (ZFSet.range key) K graph := - relationCompose_function_of_subset (familyCodeGraph_isFunc key value injective) rankFunction (fun _ h => h) - obtain ⟨b, hb, bounded⟩ := regular.bound_small_domain pairing unions powers separation domain hK ground small function - have uniform : ∀ i, ZFSet.rank (value i) < ZFSet.rank b := by - intro i - have hi : value i ∈ R := ZFSet.mem_range.2 ⟨i, rfl⟩ - obtain ⟨a, entry, _⟩ := rankFunction.2 (value i) hi - have rankEntry := (pair_mem_cumulativeRankGraph R K (value i) a).1 entry - have composite : ZFSet.pair (key i) a ∈ graph := - (pair_mem_relationCompose _ _ _ _ _ _ _).2 - ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, rankEntry.2.1, value i, hi, - (pair_mem_familyCodeGraph key value injective i _).2 rfl, entry⟩ - have rank := ZFSet.rank_lt_of_mem (bounded (key i) a composite) - simpa only [rankEntry.2.2, rank_ordinalCode] using rank - apply (ZFSet.rank_le_iff.2 ?_).trans_lt (ZFSet.rank_lt_of_mem hb) - intro x hx - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx - exact uniform i - -end PartitionPilot.Forcing.GroundRegular - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRegularFormulas +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundFamilyValueUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundRegular +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (regular : GroundRegular M K) +include regular + +theorem familyCodeGraph_valueRange_rank_lt + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) + {I : Type v} [Small.{u} I] (key value : I → ZFSet.{u}) (injective : Function.Injective key) + (domain : ZFSet.range key ∈ M.sets) (whole : familyCodeGraph key value ∈ M.sets) + (small : GroundBelow M (ZFSet.range key) K) + (ranks : ∀ i, ZFSet.rank (value i) < ZFSet.rank K) : + ZFSet.rank (ZFSet.range value) < ZFSet.rank K := by + let R := ZFSet.range value + have hR : R ∈ M.sets := M.familyCodeGraph_valueRange_mem unions separation key value domain whole + have rankGround := M.cumulativeRankGraph_mem pairing unions powers separation collection hR hK + have rankFunction : ZFSet.IsFunc R K (cumulativeRankGraph R K) := by + apply cumulativeRankGraph_function ordinal + intro x hx + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx + exact ranks i + let graph := relationCompose (ZFSet.range key) R K (familyCodeGraph key value) (cumulativeRankGraph R K) + have ground : graph ∈ M.sets := M.relationCompose_mem pairing unions powers separation + domain hR hK whole rankGround + have function : ZFSet.IsFunc (ZFSet.range key) K graph := + relationCompose_function_of_subset (familyCodeGraph_isFunc key value injective) rankFunction (fun _ h => h) + obtain ⟨b, hb, bounded⟩ := regular.bound_small_domain pairing unions powers separation domain hK ground small function + have uniform : ∀ i, ZFSet.rank (value i) < ZFSet.rank b := by + intro i + have hi : value i ∈ R := ZFSet.mem_range.2 ⟨i, rfl⟩ + obtain ⟨a, entry, _⟩ := rankFunction.2 (value i) hi + have rankEntry := (pair_mem_cumulativeRankGraph R K (value i) a).1 entry + have composite : ZFSet.pair (key i) a ∈ graph := + (pair_mem_relationCompose _ _ _ _ _ _ _).2 + ⟨ZFSet.mem_range.2 ⟨i, rfl⟩, rankEntry.2.1, value i, hi, + (pair_mem_familyCodeGraph key value injective i _).2 rfl, entry⟩ + have rank := ZFSet.rank_lt_of_mem (bounded (key i) a composite) + simpa only [rankEntry.2.2, rank_ordinalCode] using rank + apply (ZFSet.rank_le_iff.2 ?_).trans_lt (ZFSet.rank_lt_of_mem hb) + intro x hx + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hx + exact uniform i + +end PartitionPilot.Forcing.GroundRegular + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFunctionSpaces.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFunctionSpaces.lean index 95f37af5725d76deb5faf7428c4cbec795389cd2..5d55534bc5e2892a5060b916dd55597bb1fa3762 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFunctionSpaces.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundSmallFunctionSpaces.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSizeWitnesses - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def smallPartialFunctions (X Y N : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun p => M.groundEmbeddable p N) (M.partialFunctions X Y) - -theorem mem_smallPartialFunctions (X Y N p : ZFSet.{u}) : - p ∈ M.smallPartialFunctions X Y N ↔ - p ∈ M.sets ∧ PartialFunctionCode X Y p ∧ M.groundEmbeddable p N := by - rw [smallPartialFunctions, ZFSet.mem_sep, M.mem_partialFunctions] - exact and_assoc - -theorem smallPartialFunctions_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {X Y N : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hN : N ∈ M.sets) : - M.smallPartialFunctions X Y N ∈ M.sets := by - have space := M.partialFunctions_mem pairing unions powers separation hX hY - let params := extend N Fin.elim0 - have selected := M.separation_mem separation (hasInjectionFormula 0 1) - params (Fin.cases hN (fun j => Fin.elim0 j)) space - have eq : ZFSet.sep (fun p => Realize M.sets (hasInjectionFormula 0 1) (extend p params)) - (M.partialFunctions X Y) = M.smallPartialFunctions X Y N := by - apply ZFSet.ext - intro p - rw [ZFSet.mem_sep, smallPartialFunctions, ZFSet.mem_sep] - constructor - · rintro ⟨hp, rel⟩ - exact ⟨hp, (M.realize_hasInjectionFormula 0 1 (extend p params) - (Fin.cases (M.transitive space hp) (Fin.cases hN (fun j => Fin.elim0 j)))).1 rel⟩ - · rintro ⟨hp, small⟩ - exact ⟨hp, (M.realize_hasInjectionFormula 0 1 (extend p params) - (Fin.cases (M.transitive space hp) (Fin.cases hN (fun j => Fin.elim0 j)))).2 small⟩ - exact eq ▸ selected - -theorem empty_mem_smallPartialFunctions (X Y N : ZFSet.{u}) (nonempty : M.sets.Nonempty) : - (∅ : ZFSet.{u}) ∈ M.smallPartialFunctions X Y N := - (M.mem_smallPartialFunctions X Y N ∅).2 - ⟨M.empty_mem nonempty, PartialFunctionCode.empty X Y, M.empty_groundEmbeddable N nonempty⟩ - -theorem smallPartialFunction_countable {X Y N p : ZFSet.{u}} - (hp : p ∈ M.smallPartialFunctions X Y N) [Countable (SetMembers N)] : Countable (SetMembers p) := - M.groundEmbeddable_countable ((M.mem_smallPartialFunctions X Y N p).1 hp).2.2 - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSizeWitnesses + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def smallPartialFunctions (X Y N : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun p => M.groundEmbeddable p N) (M.partialFunctions X Y) + +theorem mem_smallPartialFunctions (X Y N p : ZFSet.{u}) : + p ∈ M.smallPartialFunctions X Y N ↔ + p ∈ M.sets ∧ PartialFunctionCode X Y p ∧ M.groundEmbeddable p N := by + rw [smallPartialFunctions, ZFSet.mem_sep, M.mem_partialFunctions] + exact and_assoc + +theorem smallPartialFunctions_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {X Y N : ZFSet.{u}} (hX : X ∈ M.sets) (hY : Y ∈ M.sets) (hN : N ∈ M.sets) : + M.smallPartialFunctions X Y N ∈ M.sets := by + have space := M.partialFunctions_mem pairing unions powers separation hX hY + let params := extend N Fin.elim0 + have selected := M.separation_mem separation (hasInjectionFormula 0 1) + params (Fin.cases hN (fun j => Fin.elim0 j)) space + have eq : ZFSet.sep (fun p => Realize M.sets (hasInjectionFormula 0 1) (extend p params)) + (M.partialFunctions X Y) = M.smallPartialFunctions X Y N := by + apply ZFSet.ext + intro p + rw [ZFSet.mem_sep, smallPartialFunctions, ZFSet.mem_sep] + constructor + · rintro ⟨hp, rel⟩ + exact ⟨hp, (M.realize_hasInjectionFormula 0 1 (extend p params) + (Fin.cases (M.transitive space hp) (Fin.cases hN (fun j => Fin.elim0 j)))).1 rel⟩ + · rintro ⟨hp, small⟩ + exact ⟨hp, (M.realize_hasInjectionFormula 0 1 (extend p params) + (Fin.cases (M.transitive space hp) (Fin.cases hN (fun j => Fin.elim0 j)))).2 small⟩ + exact eq ▸ selected + +theorem empty_mem_smallPartialFunctions (X Y N : ZFSet.{u}) (nonempty : M.sets.Nonempty) : + (∅ : ZFSet.{u}) ∈ M.smallPartialFunctions X Y N := + (M.mem_smallPartialFunctions X Y N ∅).2 + ⟨M.empty_mem nonempty, PartialFunctionCode.empty X Y, M.empty_groundEmbeddable N nonempty⟩ + +theorem smallPartialFunction_countable {X Y N p : ZFSet.{u}} + (hp : p ∈ M.smallPartialFunctions X Y N) [Countable (SetMembers N)] : Countable (SetMembers p) := + M.groundEmbeddable_countable ((M.mem_smallPartialFunctions X Y N p).1 hp).2.2 + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentImages.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentImages.lean index aa12410c2b38d0e120ffc6ae91dc726a59cf801b..97fc2e71d2b31300f4f2c4bc894565d579d9ed25 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentImages.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentImages.lean @@ -1,98 +1,98 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementAssignmentActionFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) -local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid -local notation "J" => stageOneAssignments I T -local notation "graph" => M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 - -noncomputable def stageOneAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := - relationImage A J (graph g) - -theorem stageOneAssignmentImage_subset (g : G) (A : ZFSet.{u}) : - M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ⊆ J := - fun y h => ((mem_relationImage A J (graph g) y).1 h).1 - -theorem stageOneAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : - M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ⊆ - M.stageOneAssignmentImage a s b d T T2 valid valid2 g B := by - intro y hy - obtain ⟨hy, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy - exact (mem_relationImage B J (graph g) y).2 ⟨hy, x, subset hx, entry⟩ - -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (maps : a.conditionMapFamily s t ∈ M.sets) -variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) -variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) -variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) - -include pairing unions powers separation collection carrier order maps closed closed2 familyGround in -theorem stageOneAssignmentActionGraph_injection (g : G) : InjectionCode J J (graph g) := - relationProduct_injection - (M.niceRefinementIndexActionGraph_injection a s b d ∅ T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g) - (relationProduct_injection (stageOneTermAction_injection a s T valid closed g) - (stageOneTermAction_injection a s T valid closed g)) - -include pairing unions powers separation collection carrier order maps closed closed2 familyGround in -theorem stageOneAssignmentImage_entry (g : G) (C E : L) - (U Rf Rc : (M.nameDomain s).names) (u w : Name s) - (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) - (hu : u.val ∈ T) (hw : w.val ∈ T) (A : ZFSet.{u}) : - stageOneAssignment (refinementIndexCode ∅ (b.encode (d.iso g C)) (b.encode (d.iso g E)) - (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) - (a.act s g u).val (a.act s g w).val ∈ - M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ↔ - stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A := by - have entry := (M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t - pairing unions powers separation collection carrier order maps closed2 familyGround - g C E U Rf Rc u w index hu hw _).2 rfl - have injection := M.stageOneAssignmentActionGraph_injection a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g - constructor - · intro hy - obtain ⟨_, x, hx, xy⟩ := (mem_relationImage A J (graph g) _).1 hy - have equal := injection.injective _ _ _ xy entry - exact equal ▸ hx - · intro hx - exact (mem_relationImage A J (graph g) _).2 - ⟨(ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2, _, hx, entry⟩ - -include pairing unions powers separation collection carrier order maps closed closed2 familyGround in -theorem stageOneAssignmentImage_small - (nodeMaps : d.conditionMapFamily b t ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} - (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : - M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ∈ M.groundSmallSubsets J ZFSet.omega := by - obtain ⟨hA, subset, small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member - have hJ := M.stageOneAssignments_mem pairing unions powers separation hI hT - have hg := M.stageOneAssignmentActionGraph_mem a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier maps nodeMaps hT hT2 hI g - have injection := M.stageOneAssignmentActionGraph_injection a s b d T T2 valid valid2 t - pairing unions powers separation collection carrier order maps closed closed2 familyGround g - exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 - ⟨M.relationImage_mem separation hA hJ hg, - M.stageOneAssignmentImage_subset a s b d T T2 valid valid2 g A, - M.groundEmbeddable_image pairing unions powers separation hA hJ omega hg injection subset small⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRefinementAssignmentActionFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) +local notation "I" => M.niceRefinementIndices a s b d ∅ T T2 valid +local notation "J" => stageOneAssignments I T +local notation "graph" => M.stageOneAssignmentActionGraph a s b d T T2 valid valid2 + +noncomputable def stageOneAssignmentImage (g : G) (A : ZFSet.{u}) : ZFSet.{u} := + relationImage A J (graph g) + +theorem stageOneAssignmentImage_subset (g : G) (A : ZFSet.{u}) : + M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ⊆ J := + fun y h => ((mem_relationImage A J (graph g) y).1 h).1 + +theorem stageOneAssignmentImage_mono (g : G) {A B : ZFSet.{u}} (subset : A ⊆ B) : + M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ⊆ + M.stageOneAssignmentImage a s b d T T2 valid valid2 g B := by + intro y hy + obtain ⟨hy, x, hx, entry⟩ := (mem_relationImage A J (graph g) y).1 hy + exact (mem_relationImage B J (graph g) y).2 ⟨hy, x, subset hx, entry⟩ + +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (maps : a.conditionMapFamily s t ∈ M.sets) +variable (closed : ∀ g (w : Name s), w.val ∈ T → (a.act s g w).val ∈ T) +variable (closed2 : ∀ g (w : Name s), w.val ∈ T2 → (a.act s g w).val ∈ T2) +variable (familyGround : (Name.familySet ⊤ T valid).val ∈ M.sets) + +include pairing unions powers separation collection carrier order maps closed closed2 familyGround in +theorem stageOneAssignmentActionGraph_injection (g : G) : InjectionCode J J (graph g) := + relationProduct_injection + (M.niceRefinementIndexActionGraph_injection a s b d ∅ T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g) + (relationProduct_injection (stageOneTermAction_injection a s T valid closed g) + (stageOneTermAction_injection a s T valid closed g)) + +include pairing unions powers separation collection carrier order maps closed closed2 familyGround in +theorem stageOneAssignmentImage_entry (g : G) (C E : L) + (U Rf Rc : (M.nameDomain s).names) (u w : Name s) + (index : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ I) + (hu : u.val ∈ T) (hw : w.val ∈ T) (A : ZFSet.{u}) : + stageOneAssignment (refinementIndexCode ∅ (b.encode (d.iso g C)) (b.encode (d.iso g E)) + (a.act s g U.val).val (a.act s g Rf.val).val (a.act s g Rc.val).val) + (a.act s g u).val (a.act s g w).val ∈ + M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ↔ + stageOneAssignment (refinementIndexCode ∅ (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val) u.val w.val ∈ A := by + have entry := (M.stageOneAssignmentActionGraph_entry a s b d T T2 valid valid2 closed t + pairing unions powers separation collection carrier order maps closed2 familyGround + g C E U Rf Rc u w index hu hw _).2 rfl + have injection := M.stageOneAssignmentActionGraph_injection a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g + constructor + · intro hy + obtain ⟨_, x, hx, xy⟩ := (mem_relationImage A J (graph g) _).1 hy + have equal := injection.injective _ _ _ xy entry + exact equal ▸ hx + · intro hx + exact (mem_relationImage A J (graph g) _).2 + ⟨(ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2, _, hx, entry⟩ + +include pairing unions powers separation collection carrier order maps closed closed2 familyGround in +theorem stageOneAssignmentImage_small + (nodeMaps : d.conditionMapFamily b t ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI : I ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} + (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : + M.stageOneAssignmentImage a s b d T T2 valid valid2 g A ∈ M.groundSmallSubsets J ZFSet.omega := by + obtain ⟨hA, subset, small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member + have hJ := M.stageOneAssignments_mem pairing unions powers separation hI hT + have hg := M.stageOneAssignmentActionGraph_mem a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier maps nodeMaps hT hT2 hI g + have injection := M.stageOneAssignmentActionGraph_injection a s b d T T2 valid valid2 t + pairing unions powers separation collection carrier order maps closed closed2 familyGround g + exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 + ⟨M.relationImage_mem separation hA hJ hg, + M.stageOneAssignmentImage_subset a s b d T T2 valid valid2 g A, + M.groundEmbeddable_image pairing unions powers separation hA hJ omega hg injection subset small⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentUnions.lean index 5af341ba17b162a43288b67b500c694f5756817c..a48bf331b14d8f257bd665b02ff5da5d06fd601e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneAssignmentUnions.lean @@ -1,373 +1,373 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u -namespace BoundedFormula - -def refinementActivityFormula : BoundedFormula 3 := - .conj (.mem 0 2) (.mem 1 2) - -def refinementCollisionFormula : BoundedFormula 4 := - .conj (imp (.equal 0 1) (.equal 2 3)) (imp (.equal 2 3) (.equal 0 1)) - -def refinementProfileFormula : BoundedFormula 3 := - .conj (imp (.mem 0 2) (.mem 1 2)) (imp (.mem 1 2) (.mem 0 2)) - -def refinementCompatibilityFormula : BoundedFormula 4 := - imp (.mem 0 1) (pairMembershipFormula 0 2 3) - -theorem truth_refinementActivityFormula (env : Fin 3 → ZFSet.{u}) : - Truth refinementActivityFormula env ↔ env 0 ∈ env 2 ∧ env 1 ∈ env 2 := Iff.rfl - -theorem truth_refinementCollisionFormula (env : Fin 4 → ZFSet.{u}) : - Truth refinementCollisionFormula env ↔ (env 0 = env 1 ↔ env 2 = env 3) := by - simp only [refinementCollisionFormula, Truth, truth_imp] - exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩ - -theorem truth_refinementProfileFormula (env : Fin 3 → ZFSet.{u}) : - Truth refinementProfileFormula env ↔ (env 0 ∈ env 2 ↔ env 1 ∈ env 2) := by - simp only [refinementProfileFormula, Truth, truth_imp] - exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩ - -theorem truth_refinementCompatibilityFormula (env : Fin 4 → ZFSet.{u}) : - Truth refinementCompatibilityFormula env ↔ - (env 0 ∈ env 1 → ZFSet.pair (env 0) (env 2) ∈ env 3) := by - rw [refinementCompatibilityFormula, truth_imp, truth_pairMembershipFormula] - rfl - -end BoundedFormula -namespace SetFormula - -def refinementActivityFormula : SetFormula 3 := BoundedFormula.refinementActivityFormula.toFormula - -def refinementCollisionFormula : SetFormula 4 := BoundedFormula.refinementCollisionFormula.toFormula - -def refinementProfileFormula : SetFormula 3 := BoundedFormula.refinementProfileFormula.toFormula - -def refinementCompatibilityFormula : SetFormula 4 := BoundedFormula.refinementCompatibilityFormula.toFormula - -end SetFormula -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem realize_refinementActivityFormula (env : Fin 3 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets refinementActivityFormula env ↔ env 0 ∈ env 2 ∧ env 1 ∈ env 2 := - (BoundedFormula.realize_toFormula M _ _ members).trans - (BoundedFormula.truth_refinementActivityFormula env) - -theorem realize_refinementCollisionFormula (env : Fin 4 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets refinementCollisionFormula env ↔ (env 0 = env 1 ↔ env 2 = env 3) := - (BoundedFormula.realize_toFormula M _ _ members).trans - (BoundedFormula.truth_refinementCollisionFormula env) - -theorem realize_refinementProfileFormula (env : Fin 3 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets refinementProfileFormula env ↔ (env 0 ∈ env 2 ↔ env 1 ∈ env 2) := - (BoundedFormula.realize_toFormula M _ _ members).trans - (BoundedFormula.truth_refinementProfileFormula env) - -theorem realize_refinementCompatibilityFormula (env : Fin 4 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - Realize M.sets refinementCompatibilityFormula env ↔ - (env 0 ∈ env 1 → ZFSet.pair (env 0) (env 2) ∈ env 3) := - (BoundedFormula.realize_toFormula M _ _ members).trans - (BoundedFormula.truth_refinementCompatibilityFormula env) - -end TransitiveGround -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) - -theorem refinementTest_forcing_mono {n : Nat} (formula : SetFormula n) - (env : Assignment (M.nameDomain s) n) {p q : P} - (forced : Forces (M.nameDomain s) formula env p) (below : q ≤ p) : - Forces (M.nameDomain s) formula env q := - forces_mono (M.nameDomain s) formula env forced below - -theorem refinementActivity_eval (env : Assignment (M.nameDomain s) 3) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (forced : Forces (M.nameDomain s) refinementActivityFormula env p) : - Name.eval {q | H.mem q} (env 0).val ∈ Name.eval {q | H.mem q} (env 2).val ∧ - Name.eval {q | H.mem q} (env 1).val ∈ Name.eval {q | H.mem q} (env 2).val := by - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - exact (evaluated.realize_refinementActivityFormula (evalAssignment {q | H.mem q} env) - (fun j => ⟨env j, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic _ env hp forced) - -theorem refinementCollision_eval (env : Assignment (M.nameDomain s) 4) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (forced : Forces (M.nameDomain s) refinementCollisionFormula env p) : - (Name.eval {q | H.mem q} (env 0).val = Name.eval {q | H.mem q} (env 1).val ↔ - Name.eval {q | H.mem q} (env 2).val = Name.eval {q | H.mem q} (env 3).val) := by - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - exact (evaluated.realize_refinementCollisionFormula (evalAssignment {q | H.mem q} env) - (fun j => ⟨env j, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic _ env hp forced) - -theorem refinementProfile_eval (env : Assignment (M.nameDomain s) 3) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (forced : Forces (M.nameDomain s) refinementProfileFormula env p) : - (Name.eval {q | H.mem q} (env 0).val ∈ Name.eval {q | H.mem q} (env 2).val ↔ - Name.eval {q | H.mem q} (env 1).val ∈ Name.eval {q | H.mem q} (env 2).val) := by - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - exact (evaluated.realize_refinementProfileFormula (evalAssignment {q | H.mem q} env) - (fun j => ⟨env j, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic _ env hp forced) - -theorem refinementCompatibility_eval (env : Assignment (M.nameDomain s) 4) - (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) - {p : P} (hp : H.mem p) - (forced : Forces (M.nameDomain s) refinementCompatibilityFormula env p) : - Name.eval {q | H.mem q} (env 0).val ∈ Name.eval {q | H.mem q} (env 1).val → - ZFSet.pair (Name.eval {q | H.mem q} (env 0).val) - (Name.eval {q | H.mem q} (env 2).val) ∈ Name.eval {q | H.mem q} (env 3).val := by - let evaluated : TransitiveGround.{u} := - ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ - exact (evaluated.realize_refinementCompatibilityFormula (evalAssignment {q | H.mem q} env) - (fun j => ⟨env j, rfl⟩)).1 - (forces_sound (M.nameDomain s) H generic _ env hp forced) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -def stageOneCollisionTest (Rf Rc u u' w w' : (M.nameDomain s).names) (p : P) : Prop := - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - Forces (M.nameDomain s) refinementCollisionFormula ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] p - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -def stageOneSingleTests (C E : L) (U Rf Rc u w : (M.nameDomain s).names) (p : P) : Prop := - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let vis := M.stageOneVisibilityName s valid a b d base directed system - let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - Forces (M.nameDomain s) refinementActivityFormula ![u, w, U] p ∧ - (∀ v : L, E ≤ v → - Forces (M.nameDomain s) refinementProfileFormula ![cls Rc u, cls Rf w, vis v] p) ∧ - Forces (M.nameDomain s) refinementCompatibilityFormula ![cls Rf w, vis C, cls Rc u, map] p - -def stageOneTests (T2 A : ZFSet.{u}) (p : P) : Prop := - ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names), - let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - idx ∈ M.niceRefinementIndices a s b d ∅ T T2 valid → - (∀ u w : (M.nameDomain s).names, u.val.val ∈ T → w.val.val ∈ T → - stageOneAssignment idx u.val.val w.val.val ∈ A → - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p) ∧ - (∀ u u' w w' : (M.nameDomain s).names, - u.val.val ∈ T → u'.val.val ∈ T → w.val.val ∈ T → w'.val.val ∈ T → - stageOneAssignment idx u.val.val w.val.val ∈ A → - stageOneAssignment idx u'.val.val w'.val.val ∈ A → - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' p) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) - -theorem stageOneCollisionTest_mono (Rf Rc u u' w w' : (M.nameDomain s).names) - {p q : P} (forced : M.stageOneCollisionTest s pairing unions powers separation collection - carrier order hT valid Rf Rc u u' w w' p) (below : q ≤ p) : - M.stageOneCollisionTest s pairing unions powers separation collection - carrier order hT valid Rf Rc u u' w w' q := - forces_mono (M.nameDomain s) _ _ forced below - -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem stageOneSingleTests_mono (C E : L) (U Rf Rc u w : (M.nameDomain s).names) - {p q : P} (forced : M.stageOneSingleTests s pairing unions powers separation collection - carrier order hT valid a b d base directed system C E U Rf Rc u w p) (below : q ≤ p) : - M.stageOneSingleTests s pairing unions powers separation collection - carrier order hT valid a b d base directed system C E U Rf Rc u w q := - ⟨forces_mono (M.nameDomain s) _ _ forced.1 below, - fun v above => forces_mono (M.nameDomain s) _ _ (forced.2.1 v above) below, - forces_mono (M.nameDomain s) _ _ forced.2.2 below⟩ - -theorem stageOneTests_mono (T2 A : ZFSet.{u}) {p q : P} - (tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 A p) (below : q ≤ p) : - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 A q := by - intro C E U Rf Rc - dsimp only - intro member - obtain ⟨single, collision⟩ := tests C E U Rf Rc member - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w (single u w hu hw entry) below - · intro u u' w w' hu hu' hw hw' entry entry' - exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' (collision u u' w w' hu hu' hw hw' entry entry') below - -theorem stageOneTests_subset (T2 : ZFSet.{u}) {A B : ZFSet.{u}} (p : P) - (tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 A p) (subset : B ⊆ A) : - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 B p := by - intro C E U Rf Rc - dsimp only - intro member - obtain ⟨single, collision⟩ := tests C E U Rf Rc member - exact ⟨fun u w hu hw entry => single u w hu hw (subset entry), - fun u u' w w' hu hu' hw hw' entry entry' => - collision u u' w w' hu hu' hw hw' (subset entry) (subset entry')⟩ - -theorem stageOneTests_empty (T2 : ZFSet.{u}) (p : P) : - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 ∅ p := by - intro C E U Rf Rc - dsimp only - intro member - exact ⟨fun _ _ _ _ entry => False.elim (ZFSet.notMem_empty _ entry), - fun _ _ _ _ _ _ _ _ entry _ => False.elim (ZFSet.notMem_empty _ entry)⟩ - -end TransitiveGround - -open SetRealization SetFormula -universe u - -noncomputable def stageOneAssignmentUnion (family : Nat → ZFSet.{u}) : ZFSet.{u} := - (ZFSet.range family).sUnion - -theorem mem_stageOneAssignmentUnion (family : Nat → ZFSet.{u}) (z : ZFSet.{u}) : - z ∈ stageOneAssignmentUnion family ↔ ∃ n, z ∈ family n := by - rw [stageOneAssignmentUnion, ZFSet.mem_sUnion] - constructor - · rintro ⟨A, hA, member⟩ - obtain ⟨n, rfl⟩ := ZFSet.mem_range.1 hA - exact ⟨n, member⟩ - · rintro ⟨n, member⟩ - exact ⟨family n, ZFSet.mem_range.2 ⟨n, rfl⟩, member⟩ - -theorem stageOneAssignmentUnion_contains (family : Nat → ZFSet.{u}) (n : Nat) : - family n ⊆ stageOneAssignmentUnion family := - fun z member => (mem_stageOneAssignmentUnion family z).2 ⟨n, member⟩ - -theorem stageOneAssignmentUnion_subset {family : Nat → ZFSet.{u}} {J : ZFSet.{u}} - (subsets : ∀ n, family n ⊆ J) : stageOneAssignmentUnion family ⊆ J := by - intro z member - obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family z).1 member - exact subsets n hn - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem stageOneTests_union (T2 : ZFSet.{u}) (family : Nat → ZFSet.{u}) (rows : Nat → P) (p : P) - (increasing : ∀ n m, n ≤ m → family n ⊆ family m) - (below : ∀ n, p ≤ rows n) - (tests : ∀ n, M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 (family n) (rows n)) : - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 (stageOneAssignmentUnion family) p := by - intro C E U Rf Rc - dsimp only - intro index - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry - exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w ((tests n C E U Rf Rc index).1 u w hu hw hn) (below n) - · intro u u' w w' hu hu' hw hw' entry entry' - obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry - obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion family _).1 entry' - have first := increasing n (max n m) (Nat.le_max_left n m) hn - have second := increasing m (max n m) (Nat.le_max_right n m) hm - exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid - Rf Rc u u' w w' ((tests (max n m) C E U Rf Rc index).2 u u' w w' hu hu' hw hw' first second) - (below (max n m)) - -end TransitiveGround - -theorem stageOneAssignmentUnion_raw_eq {B : ZFSet.{u}} (seq : Nat → SetMembers B) : - stageOneAssignmentUnion (fun n => SetMembers.raw (seq n)) = groundSequenceUnion seq := by - apply ZFSet.ext - intro z - rw [mem_stageOneAssignmentUnion, mem_groundSequenceUnion] - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem groundSmallSubset_union_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {J : ZFSet.{u}} (hJ : J ∈ M.sets) - (seq : Nat → SetMembers (M.groundSmallSubsets J ZFSet.omega)) - (graph : groundSequenceGraph seq ∈ M.sets) : - stageOneAssignmentUnion (fun n => SetMembers.raw (seq n)) ∈ M.groundSmallSubsets J ZFSet.omega := by - have hB := M.groundSmallSubsets_mem powers separation hJ (M.omega_mem separation infinite) - have subsets (A : ZFSet.{u}) (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : A ⊆ J := - ((M.mem_groundSmallSubsets J ZFSet.omega A).1 member).2.1 - have small (A : ZFSet.{u}) (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : - M.groundEmbeddable A ZFSet.omega := - ((M.mem_groundSmallSubsets J ZFSet.omega A).1 member).2.2 - obtain ⟨ground, countable⟩ := M.countable_union_of_sequence_graph pairing unions powers separation - infinite choice hB hJ graph - (natPresentation.graph_isFunc (SetMembers.presentation (M.groundSmallSubsets J ZFSet.omega)) - (fun n => seq n.down)) subsets small - have equal := stageOneAssignmentUnion_raw_eq seq - apply (M.mem_groundSmallSubsets J ZFSet.omega _).2 - refine ⟨equal.symm ▸ ground, ?_, equal.symm ▸ countable⟩ - exact stageOneAssignmentUnion_subset (fun n => subsets _ (SetMembers.raw_mem (seq n))) - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u +namespace BoundedFormula + +def refinementActivityFormula : BoundedFormula 3 := + .conj (.mem 0 2) (.mem 1 2) + +def refinementCollisionFormula : BoundedFormula 4 := + .conj (imp (.equal 0 1) (.equal 2 3)) (imp (.equal 2 3) (.equal 0 1)) + +def refinementProfileFormula : BoundedFormula 3 := + .conj (imp (.mem 0 2) (.mem 1 2)) (imp (.mem 1 2) (.mem 0 2)) + +def refinementCompatibilityFormula : BoundedFormula 4 := + imp (.mem 0 1) (pairMembershipFormula 0 2 3) + +theorem truth_refinementActivityFormula (env : Fin 3 → ZFSet.{u}) : + Truth refinementActivityFormula env ↔ env 0 ∈ env 2 ∧ env 1 ∈ env 2 := Iff.rfl + +theorem truth_refinementCollisionFormula (env : Fin 4 → ZFSet.{u}) : + Truth refinementCollisionFormula env ↔ (env 0 = env 1 ↔ env 2 = env 3) := by + simp only [refinementCollisionFormula, Truth, truth_imp] + exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩ + +theorem truth_refinementProfileFormula (env : Fin 3 → ZFSet.{u}) : + Truth refinementProfileFormula env ↔ (env 0 ∈ env 2 ↔ env 1 ∈ env 2) := by + simp only [refinementProfileFormula, Truth, truth_imp] + exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩ + +theorem truth_refinementCompatibilityFormula (env : Fin 4 → ZFSet.{u}) : + Truth refinementCompatibilityFormula env ↔ + (env 0 ∈ env 1 → ZFSet.pair (env 0) (env 2) ∈ env 3) := by + rw [refinementCompatibilityFormula, truth_imp, truth_pairMembershipFormula] + rfl + +end BoundedFormula +namespace SetFormula + +def refinementActivityFormula : SetFormula 3 := BoundedFormula.refinementActivityFormula.toFormula + +def refinementCollisionFormula : SetFormula 4 := BoundedFormula.refinementCollisionFormula.toFormula + +def refinementProfileFormula : SetFormula 3 := BoundedFormula.refinementProfileFormula.toFormula + +def refinementCompatibilityFormula : SetFormula 4 := BoundedFormula.refinementCompatibilityFormula.toFormula + +end SetFormula +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem realize_refinementActivityFormula (env : Fin 3 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets refinementActivityFormula env ↔ env 0 ∈ env 2 ∧ env 1 ∈ env 2 := + (BoundedFormula.realize_toFormula M _ _ members).trans + (BoundedFormula.truth_refinementActivityFormula env) + +theorem realize_refinementCollisionFormula (env : Fin 4 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets refinementCollisionFormula env ↔ (env 0 = env 1 ↔ env 2 = env 3) := + (BoundedFormula.realize_toFormula M _ _ members).trans + (BoundedFormula.truth_refinementCollisionFormula env) + +theorem realize_refinementProfileFormula (env : Fin 3 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets refinementProfileFormula env ↔ (env 0 ∈ env 2 ↔ env 1 ∈ env 2) := + (BoundedFormula.realize_toFormula M _ _ members).trans + (BoundedFormula.truth_refinementProfileFormula env) + +theorem realize_refinementCompatibilityFormula (env : Fin 4 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + Realize M.sets refinementCompatibilityFormula env ↔ + (env 0 ∈ env 1 → ZFSet.pair (env 0) (env 2) ∈ env 3) := + (BoundedFormula.realize_toFormula M _ _ members).trans + (BoundedFormula.truth_refinementCompatibilityFormula env) + +end TransitiveGround +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} [Preorder P] (s : Presentation P) + +theorem refinementTest_forcing_mono {n : Nat} (formula : SetFormula n) + (env : Assignment (M.nameDomain s) n) {p q : P} + (forced : Forces (M.nameDomain s) formula env p) (below : q ≤ p) : + Forces (M.nameDomain s) formula env q := + forces_mono (M.nameDomain s) formula env forced below + +theorem refinementActivity_eval (env : Assignment (M.nameDomain s) 3) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (forced : Forces (M.nameDomain s) refinementActivityFormula env p) : + Name.eval {q | H.mem q} (env 0).val ∈ Name.eval {q | H.mem q} (env 2).val ∧ + Name.eval {q | H.mem q} (env 1).val ∈ Name.eval {q | H.mem q} (env 2).val := by + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + exact (evaluated.realize_refinementActivityFormula (evalAssignment {q | H.mem q} env) + (fun j => ⟨env j, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic _ env hp forced) + +theorem refinementCollision_eval (env : Assignment (M.nameDomain s) 4) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (forced : Forces (M.nameDomain s) refinementCollisionFormula env p) : + (Name.eval {q | H.mem q} (env 0).val = Name.eval {q | H.mem q} (env 1).val ↔ + Name.eval {q | H.mem q} (env 2).val = Name.eval {q | H.mem q} (env 3).val) := by + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + exact (evaluated.realize_refinementCollisionFormula (evalAssignment {q | H.mem q} env) + (fun j => ⟨env j, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic _ env hp forced) + +theorem refinementProfile_eval (env : Assignment (M.nameDomain s) 3) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (forced : Forces (M.nameDomain s) refinementProfileFormula env p) : + (Name.eval {q | H.mem q} (env 0).val ∈ Name.eval {q | H.mem q} (env 2).val ↔ + Name.eval {q | H.mem q} (env 1).val ∈ Name.eval {q | H.mem q} (env 2).val) := by + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + exact (evaluated.realize_refinementProfileFormula (evalAssignment {q | H.mem q} env) + (fun j => ⟨env j, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic _ env hp forced) + +theorem refinementCompatibility_eval (env : Assignment (M.nameDomain s) 4) + (H : ConditionFilter P) (generic : H.GenericFor (formulaFamily (M.nameDomain s))) + {p : P} (hp : H.mem p) + (forced : Forces (M.nameDomain s) refinementCompatibilityFormula env p) : + Name.eval {q | H.mem q} (env 0).val ∈ Name.eval {q | H.mem q} (env 1).val → + ZFSet.pair (Name.eval {q | H.mem q} (env 0).val) + (Name.eval {q | H.mem q} (env 2).val) ∈ Name.eval {q | H.mem q} (env 3).val := by + let evaluated : TransitiveGround.{u} := + ⟨(M.nameDomain s).values {q | H.mem q}, (M.nameDomain s).values_transitive {q | H.mem q}⟩ + exact (evaluated.realize_refinementCompatibilityFormula (evalAssignment {q | H.mem q} env) + (fun j => ⟨env j, rfl⟩)).1 + (forces_sound (M.nameDomain s) H generic _ env hp forced) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +def stageOneCollisionTest (Rf Rc u u' w w' : (M.nameDomain s).names) (p : P) : Prop := + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + Forces (M.nameDomain s) refinementCollisionFormula ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] p + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +def stageOneSingleTests (C E : L) (U Rf Rc u w : (M.nameDomain s).names) (p : P) : Prop := + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let vis := M.stageOneVisibilityName s valid a b d base directed system + let map := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + Forces (M.nameDomain s) refinementActivityFormula ![u, w, U] p ∧ + (∀ v : L, E ≤ v → + Forces (M.nameDomain s) refinementProfileFormula ![cls Rc u, cls Rf w, vis v] p) ∧ + Forces (M.nameDomain s) refinementCompatibilityFormula ![cls Rf w, vis C, cls Rc u, map] p + +def stageOneTests (T2 A : ZFSet.{u}) (p : P) : Prop := + ∀ (C E : L) (U Rf Rc : (M.nameDomain s).names), + let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + idx ∈ M.niceRefinementIndices a s b d ∅ T T2 valid → + (∀ u w : (M.nameDomain s).names, u.val.val ∈ T → w.val.val ∈ T → + stageOneAssignment idx u.val.val w.val.val ∈ A → + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p) ∧ + (∀ u u' w w' : (M.nameDomain s).names, + u.val.val ∈ T → u'.val.val ∈ T → w.val.val ∈ T → w'.val.val ∈ T → + stageOneAssignment idx u.val.val w.val.val ∈ A → + stageOneAssignment idx u'.val.val w'.val.val ∈ A → + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' p) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) + +theorem stageOneCollisionTest_mono (Rf Rc u u' w w' : (M.nameDomain s).names) + {p q : P} (forced : M.stageOneCollisionTest s pairing unions powers separation collection + carrier order hT valid Rf Rc u u' w w' p) (below : q ≤ p) : + M.stageOneCollisionTest s pairing unions powers separation collection + carrier order hT valid Rf Rc u u' w w' q := + forces_mono (M.nameDomain s) _ _ forced below + +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem stageOneSingleTests_mono (C E : L) (U Rf Rc u w : (M.nameDomain s).names) + {p q : P} (forced : M.stageOneSingleTests s pairing unions powers separation collection + carrier order hT valid a b d base directed system C E U Rf Rc u w p) (below : q ≤ p) : + M.stageOneSingleTests s pairing unions powers separation collection + carrier order hT valid a b d base directed system C E U Rf Rc u w q := + ⟨forces_mono (M.nameDomain s) _ _ forced.1 below, + fun v above => forces_mono (M.nameDomain s) _ _ (forced.2.1 v above) below, + forces_mono (M.nameDomain s) _ _ forced.2.2 below⟩ + +theorem stageOneTests_mono (T2 A : ZFSet.{u}) {p q : P} + (tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 A p) (below : q ≤ p) : + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 A q := by + intro C E U Rf Rc + dsimp only + intro member + obtain ⟨single, collision⟩ := tests C E U Rf Rc member + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w (single u w hu hw entry) below + · intro u u' w w' hu hu' hw hw' entry entry' + exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' (collision u u' w w' hu hu' hw hw' entry entry') below + +theorem stageOneTests_subset (T2 : ZFSet.{u}) {A B : ZFSet.{u}} (p : P) + (tests : M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 A p) (subset : B ⊆ A) : + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 B p := by + intro C E U Rf Rc + dsimp only + intro member + obtain ⟨single, collision⟩ := tests C E U Rf Rc member + exact ⟨fun u w hu hw entry => single u w hu hw (subset entry), + fun u u' w w' hu hu' hw hw' entry entry' => + collision u u' w w' hu hu' hw hw' (subset entry) (subset entry')⟩ + +theorem stageOneTests_empty (T2 : ZFSet.{u}) (p : P) : + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 ∅ p := by + intro C E U Rf Rc + dsimp only + intro member + exact ⟨fun _ _ _ _ entry => False.elim (ZFSet.notMem_empty _ entry), + fun _ _ _ _ _ _ _ _ entry _ => False.elim (ZFSet.notMem_empty _ entry)⟩ + +end TransitiveGround + +open SetRealization SetFormula +universe u + +noncomputable def stageOneAssignmentUnion (family : Nat → ZFSet.{u}) : ZFSet.{u} := + (ZFSet.range family).sUnion + +theorem mem_stageOneAssignmentUnion (family : Nat → ZFSet.{u}) (z : ZFSet.{u}) : + z ∈ stageOneAssignmentUnion family ↔ ∃ n, z ∈ family n := by + rw [stageOneAssignmentUnion, ZFSet.mem_sUnion] + constructor + · rintro ⟨A, hA, member⟩ + obtain ⟨n, rfl⟩ := ZFSet.mem_range.1 hA + exact ⟨n, member⟩ + · rintro ⟨n, member⟩ + exact ⟨family n, ZFSet.mem_range.2 ⟨n, rfl⟩, member⟩ + +theorem stageOneAssignmentUnion_contains (family : Nat → ZFSet.{u}) (n : Nat) : + family n ⊆ stageOneAssignmentUnion family := + fun z member => (mem_stageOneAssignmentUnion family z).2 ⟨n, member⟩ + +theorem stageOneAssignmentUnion_subset {family : Nat → ZFSet.{u}} {J : ZFSet.{u}} + (subsets : ∀ n, family n ⊆ J) : stageOneAssignmentUnion family ⊆ J := by + intro z member + obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family z).1 member + exact subsets n hn + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem stageOneTests_union (T2 : ZFSet.{u}) (family : Nat → ZFSet.{u}) (rows : Nat → P) (p : P) + (increasing : ∀ n m, n ≤ m → family n ⊆ family m) + (below : ∀ n, p ≤ rows n) + (tests : ∀ n, M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 (family n) (rows n)) : + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 (stageOneAssignmentUnion family) p := by + intro C E U Rf Rc + dsimp only + intro index + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry + exact M.stageOneSingleTests_mono s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w ((tests n C E U Rf Rc index).1 u w hu hw hn) (below n) + · intro u u' w w' hu hu' hw hw' entry entry' + obtain ⟨n, hn⟩ := (mem_stageOneAssignmentUnion family _).1 entry + obtain ⟨m, hm⟩ := (mem_stageOneAssignmentUnion family _).1 entry' + have first := increasing n (max n m) (Nat.le_max_left n m) hn + have second := increasing m (max n m) (Nat.le_max_right n m) hm + exact M.stageOneCollisionTest_mono s pairing unions powers separation collection carrier order hT valid + Rf Rc u u' w w' ((tests (max n m) C E U Rf Rc index).2 u u' w w' hu hu' hw hw' first second) + (below (max n m)) + +end TransitiveGround + +theorem stageOneAssignmentUnion_raw_eq {B : ZFSet.{u}} (seq : Nat → SetMembers B) : + stageOneAssignmentUnion (fun n => SetMembers.raw (seq n)) = groundSequenceUnion seq := by + apply ZFSet.ext + intro z + rw [mem_stageOneAssignmentUnion, mem_groundSequenceUnion] + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem groundSmallSubset_union_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {J : ZFSet.{u}} (hJ : J ∈ M.sets) + (seq : Nat → SetMembers (M.groundSmallSubsets J ZFSet.omega)) + (graph : groundSequenceGraph seq ∈ M.sets) : + stageOneAssignmentUnion (fun n => SetMembers.raw (seq n)) ∈ M.groundSmallSubsets J ZFSet.omega := by + have hB := M.groundSmallSubsets_mem powers separation hJ (M.omega_mem separation infinite) + have subsets (A : ZFSet.{u}) (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : A ⊆ J := + ((M.mem_groundSmallSubsets J ZFSet.omega A).1 member).2.1 + have small (A : ZFSet.{u}) (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : + M.groundEmbeddable A ZFSet.omega := + ((M.mem_groundSmallSubsets J ZFSet.omega A).1 member).2.2 + obtain ⟨ground, countable⟩ := M.countable_union_of_sequence_graph pairing unions powers separation + infinite choice hB hJ graph + (natPresentation.graph_isFunc (SetMembers.presentation (M.groundSmallSubsets J ZFSet.omega)) + (fun n => seq n.down)) subsets small + have equal := stageOneAssignmentUnion_raw_eq seq + apply (M.mem_groundSmallSubsets J ZFSet.omega _).2 + refine ⟨equal.symm ▸ ground, ?_, equal.symm ▸ countable⟩ + exact stageOneAssignmentUnion_subset (fun n => subsets _ (SetMembers.raw_mem (seq n))) + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneOrder.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneOrder.lean index a76e008307a41e04638532ed9f2d3523ccea9808..b12409d59e9dbfeae937ed2d0320595fde2347af 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneOrder.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneOrder.lean @@ -1,83 +1,83 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionHeightSteps - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -noncomputable def rowAssignmentOrder (Q C B r : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ q ∈ C, ∃ A ∈ B, ∃ p ∈ C, ∃ D ∈ B, - z = ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∧ ZFSet.pair q p ∈ r ∧ D ⊆ A) - (ZFSet.prod Q Q) - -theorem mem_rowAssignmentOrder (Q C B r z : ZFSet.{u}) : - z ∈ rowAssignmentOrder Q C B r ↔ z ∈ ZFSet.prod Q Q ∧ - ∃ q ∈ C, ∃ A ∈ B, ∃ p ∈ C, ∃ D ∈ B, - z = ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∧ ZFSet.pair q p ∈ r ∧ D ⊆ A := - ZFSet.mem_sep - -theorem pair_mem_rowAssignmentOrder (Q C B r q A p D : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ rowAssignmentOrder Q C B r ↔ - ZFSet.pair q A ∈ Q ∧ ZFSet.pair p D ∈ Q ∧ - q ∈ C ∧ A ∈ B ∧ p ∈ C ∧ D ∈ B ∧ ZFSet.pair q p ∈ r ∧ D ⊆ A := by - rw [mem_rowAssignmentOrder, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hqQ,hpQ⟩,q',hq,A',hA,p',hp,D',hD,equal,rows,subset⟩ - obtain ⟨left,right⟩ := ZFSet.pair_injective equal - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective left - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective right - exact ⟨hqQ,hpQ,hq,hA,hp,hD,rows,subset⟩ - · rintro ⟨hqQ,hpQ,hq,hA,hp,hD,rows,subset⟩ - exact ⟨⟨hqQ,hpQ⟩,q,hq,A,hA,p,hp,D,hD,rfl,rows,subset⟩ - -namespace BoundedFormula - -def rowAssignmentOrderFormula {n} (z C B r : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ - exMem C (exMem B.succ (exMem C.succ.succ (exMem B.succ.succ.succ - (.conj (pairOfPairsFormula (lift z) 3 2 1 0) - (.conj (pairMembershipFormula 3 1 (lift r)) (subsetFormula 0 2)))))) - -theorem truth_rowAssignmentOrderFormula {n} (z C B r : Fin n) (env : Fin n → ZFSet.{u}) : - Truth (rowAssignmentOrderFormula z C B r) env ↔ - ∃ q ∈ env C, ∃ A ∈ env B, ∃ p ∈ env C, ∃ D ∈ env B, - env z = ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∧ - ZFSet.pair q p ∈ env r ∧ D ⊆ A := by - simp only [rowAssignmentOrderFormula, truth_exMem, Truth, - truth_pairOfPairsFormula, truth_pairMembershipFormula, truth_subsetFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround - -theorem rowAssignmentOrder_mem (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Q C B r : ZFSet.{u}} (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) - (hB : B ∈ M.sets) (hr : r ∈ M.sets) : rowAssignmentOrder Q C B r ∈ M.sets := by - let params := extend C (extend B (extend r Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3) params - (Fin.cases hC (Fin.cases hB (Fin.cases hr (fun j => Fin.elim0 j)))) - (M.prod_mem pairing unions powers separation hQ hQ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3) (extend z params)) - (ZFSet.prod Q Q) = rowAssignmentOrder Q C B r := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, mem_rowAssignmentOrder] - exact and_congr Iff.rfl (BoundedFormula.truth_rowAssignmentOrderFormula 0 1 2 3 _) - exact equal ▸ selected - -end TransitiveGround - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionHeightSteps + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +noncomputable def rowAssignmentOrder (Q C B r : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ q ∈ C, ∃ A ∈ B, ∃ p ∈ C, ∃ D ∈ B, + z = ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∧ ZFSet.pair q p ∈ r ∧ D ⊆ A) + (ZFSet.prod Q Q) + +theorem mem_rowAssignmentOrder (Q C B r z : ZFSet.{u}) : + z ∈ rowAssignmentOrder Q C B r ↔ z ∈ ZFSet.prod Q Q ∧ + ∃ q ∈ C, ∃ A ∈ B, ∃ p ∈ C, ∃ D ∈ B, + z = ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∧ ZFSet.pair q p ∈ r ∧ D ⊆ A := + ZFSet.mem_sep + +theorem pair_mem_rowAssignmentOrder (Q C B r q A p D : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∈ rowAssignmentOrder Q C B r ↔ + ZFSet.pair q A ∈ Q ∧ ZFSet.pair p D ∈ Q ∧ + q ∈ C ∧ A ∈ B ∧ p ∈ C ∧ D ∈ B ∧ ZFSet.pair q p ∈ r ∧ D ⊆ A := by + rw [mem_rowAssignmentOrder, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hqQ,hpQ⟩,q',hq,A',hA,p',hp,D',hD,equal,rows,subset⟩ + obtain ⟨left,right⟩ := ZFSet.pair_injective equal + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective left + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective right + exact ⟨hqQ,hpQ,hq,hA,hp,hD,rows,subset⟩ + · rintro ⟨hqQ,hpQ,hq,hA,hp,hD,rows,subset⟩ + exact ⟨⟨hqQ,hpQ⟩,q,hq,A,hA,p,hp,D,hD,rfl,rows,subset⟩ + +namespace BoundedFormula + +def rowAssignmentOrderFormula {n} (z C B r : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ + exMem C (exMem B.succ (exMem C.succ.succ (exMem B.succ.succ.succ + (.conj (pairOfPairsFormula (lift z) 3 2 1 0) + (.conj (pairMembershipFormula 3 1 (lift r)) (subsetFormula 0 2)))))) + +theorem truth_rowAssignmentOrderFormula {n} (z C B r : Fin n) (env : Fin n → ZFSet.{u}) : + Truth (rowAssignmentOrderFormula z C B r) env ↔ + ∃ q ∈ env C, ∃ A ∈ env B, ∃ p ∈ env C, ∃ D ∈ env B, + env z = ZFSet.pair (ZFSet.pair q A) (ZFSet.pair p D) ∧ + ZFSet.pair q p ∈ env r ∧ D ⊆ A := by + simp only [rowAssignmentOrderFormula, truth_exMem, Truth, + truth_pairOfPairsFormula, truth_pairMembershipFormula, truth_subsetFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround + +theorem rowAssignmentOrder_mem (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Q C B r : ZFSet.{u}} (hQ : Q ∈ M.sets) (hC : C ∈ M.sets) + (hB : B ∈ M.sets) (hr : r ∈ M.sets) : rowAssignmentOrder Q C B r ∈ M.sets := by + let params := extend C (extend B (extend r Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3) params + (Fin.cases hC (Fin.cases hB (Fin.cases hr (fun j => Fin.elim0 j)))) + (M.prod_mem pairing unions powers separation hQ hQ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.rowAssignmentOrderFormula 0 1 2 3) (extend z params)) + (ZFSet.prod Q Q) = rowAssignmentOrder Q C B r := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, mem_rowAssignmentOrder] + exact and_congr Iff.rfl (BoundedFormula.truth_rowAssignmentOrderFormula 0 1 2 3 _) + exact equal ▸ selected + +end TransitiveGround + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneProjectedFilters.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneProjectedFilters.lean index 9e1c8062302c3ab0a7004833baa3cc37f791aedb..f6998988475eaa8a51d653b6f27b2519ca6d6051 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneProjectedFilters.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneProjectedFilters.lean @@ -1,221 +1,221 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneFlatConditions - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) - -namespace StageOneCondition -variable {M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2} -local notation "Condition" => StageOneCondition M s pairing unions powers separation collection - carrier order hT valid a b d base directed system T2 - -local notation "emptyRow" => empty M s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 - -theorem le_empty_iff (q : Condition) (p : P) : q ≤ emptyRow p ↔ q.row ≤ p := by - exact ⟨fun below => below.1, fun below => ⟨below, ZFSet.empty_subset _⟩⟩ - -theorem compatible_empty_iff (q : Condition) (p : P) : - Compatible q (emptyRow p) ↔ Compatible q.row p := by - constructor - · rintro ⟨r, below, included⟩ - exact ⟨r.row, below.1, included.1⟩ - · rintro ⟨row, below, included⟩ - exact ⟨q.withRow row below, q.withRow_le row below, (le_empty_iff _ p).2 included⟩ - -theorem dense_row_preimage {E : Set P} (dense : Dense E) : - Dense {q : Condition | q.row ∈ E} := by - intro q - obtain ⟨row, below, member⟩ := dense q.row - exact ⟨q.withRow row below, q.withRow_le row below, member⟩ - -noncomputable def rowFilter (H : ConditionFilter Condition) : ConditionFilter P where - mem p := H.mem (emptyRow p) - nonempty := by - obtain ⟨q, member⟩ := H.nonempty - exact ⟨q.row, H.upward member ((le_empty_iff q q.row).2 le_rfl)⟩ - upward := by - intro p q member below - exact H.upward member ⟨below, fun _ h => h⟩ - directed := by - intro p q hp hq - obtain ⟨r, member, rp, rq⟩ := H.directed hp hq - exact ⟨r.row, H.upward member ((le_empty_iff r r.row).2 le_rfl), rp.1, rq.1⟩ - -theorem rowFilter_mem_iff (H : ConditionFilter Condition) (p : P) : - (rowFilter H).mem p ↔ ∃ q : Condition, H.mem q ∧ q.row = p := by - constructor - · intro member - exact ⟨emptyRow p, member, rfl⟩ - · rintro ⟨q, member, rfl⟩ - exact H.upward member ((le_empty_iff q q.row).2 le_rfl) - -theorem rowFilter_meets_iff (H : ConditionFilter Condition) (E : Set P) : - (rowFilter H).Meets E ↔ H.Meets {q : Condition | q.row ∈ E} := by - constructor - · rintro ⟨p, member, hp⟩ - obtain ⟨q, hq, rfl⟩ := (rowFilter_mem_iff H p).1 member - exact ⟨q, hq, hp⟩ - · rintro ⟨q, member, hp⟩ - exact ⟨q.row, (rowFilter_mem_iff H q.row).2 ⟨q, member, rfl⟩, hp⟩ - -theorem rowFilter_generic (H : ConditionFilter Condition) (family : Set (Set P)) - (generic : H.GenericFor ((fun E : Set P => {q : Condition | q.row ∈ E}) '' family)) : - (rowFilter H).GenericFor family := by - intro E member dense - exact (rowFilter_meets_iff H E).2 - (generic _ ⟨E, member, rfl⟩ (dense_row_preimage dense)) - -end StageOneCondition -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid - -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection -local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 - -local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - -noncomputable def stageOneProjectedFilter - (H : @ConditionFilter (Shrink Condition) (smallOrder).toPreorder) : ConditionFilter P := by - let := smallOrder - let e := M.stageOneConditionOrderIso a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - let F : ConditionFilter Condition := { - mem p := H.mem (e p) - nonempty := by - obtain ⟨q, hq⟩ := H.nonempty - exact ⟨e.symm q, by simpa only [OrderIso.apply_symm_apply] using hq⟩ - upward := by - intro p q member below - exact H.upward member (e.monotone below) - directed := by - intro p q hp hq - obtain ⟨r, hr, rp, rq⟩ := H.directed hp hq - exact ⟨e.symm r, by simpa only [OrderIso.apply_symm_apply] using hr, - (e.symm.monotone rp).trans_eq (e.symm_apply_apply p), - (e.symm.monotone rq).trans_eq (e.symm_apply_apply q)⟩ } - exact StageOneCondition.rowFilter F - -theorem stageOneProjectedFilter_mem : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (p : P), - (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT - base directed system collection H).mem p ↔ H.mem (incl p) := by - let := smallOrder - intro H p - rfl - -theorem stageOneProjectedFilter_row : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (p : P), - (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT - base directed system collection H).mem p ↔ - ∃ q : Shrink Condition, H.mem q ∧ ((equivShrink Condition).symm q).row = p := by - let := smallOrder - intro H p - constructor - · intro member - refine ⟨incl p, member, ?_⟩ - change ((equivShrink Condition).symm (equivShrink Condition (emptyRow p))).row = p - rw [Equiv.symm_apply_apply] - rfl - · rintro ⟨q, member, rfl⟩ - apply H.upward member - change (equivShrink Condition).symm q ≤ - (equivShrink Condition).symm (equivShrink Condition (emptyRow ((equivShrink Condition).symm q).row)) - rw [Equiv.symm_apply_apply] - exact (StageOneCondition.le_empty_iff _ _).2 le_rfl - -theorem stageOneSmall_dense_row_preimage {E : Set P} (dense : Dense E) : - letI := smallOrder - Dense {q : Shrink Condition | ((equivShrink Condition).symm q).row ∈ E} := by - let := smallOrder - intro q - let q' := (equivShrink Condition).symm q - obtain ⟨row, below, member⟩ := dense q'.row - refine ⟨equivShrink Condition (q'.withRow row below), ?_, ?_⟩ - · change (equivShrink Condition).symm (equivShrink Condition (q'.withRow row below)) ≤ q' - rw [Equiv.symm_apply_apply] - exact q'.withRow_le row below - · change ((equivShrink Condition).symm (equivShrink Condition (q'.withRow row below))).row ∈ E - rw [Equiv.symm_apply_apply] - exact member - -theorem stageOneProjectedFilter_generic : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (family : Set (Set P)), - H.GenericFor - ((fun E : Set P => {q : Shrink Condition | ((equivShrink Condition).symm q).row ∈ E}) '' family) → - (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT - base directed system collection H).GenericFor family := by - let := smallOrder - intro H family generic E hE dense - obtain ⟨q, hq, member⟩ := generic _ ⟨E, hE, rfl⟩ - (M.stageOneSmall_dense_row_preimage a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection dense) - exact ⟨((equivShrink Condition).symm q).row, - (M.stageOneProjectedFilter_row a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection H _).2 ⟨q, hq, rfl⟩, member⟩ - -theorem stageOneNameLift_projected_eval : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (tau : Name c.pairEmpty), - Name.eval H.mem (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system collection tau) = - Name.eval (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT - base directed system collection H).mem tau := by - let := smallOrder - intro H tau - exact M.stageOneNameLift_eval a c b d T T2 valid pairing unions powers separation carrier order nodes hT - indices base directed system collection H.mem tau - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneFlatConditions + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) (T2 : ZFSet.{u}) + +namespace StageOneCondition +variable {M s pairing unions powers separation collection carrier order hT valid a b d base directed system T2} +local notation "Condition" => StageOneCondition M s pairing unions powers separation collection + carrier order hT valid a b d base directed system T2 + +local notation "emptyRow" => empty M s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 + +theorem le_empty_iff (q : Condition) (p : P) : q ≤ emptyRow p ↔ q.row ≤ p := by + exact ⟨fun below => below.1, fun below => ⟨below, ZFSet.empty_subset _⟩⟩ + +theorem compatible_empty_iff (q : Condition) (p : P) : + Compatible q (emptyRow p) ↔ Compatible q.row p := by + constructor + · rintro ⟨r, below, included⟩ + exact ⟨r.row, below.1, included.1⟩ + · rintro ⟨row, below, included⟩ + exact ⟨q.withRow row below, q.withRow_le row below, (le_empty_iff _ p).2 included⟩ + +theorem dense_row_preimage {E : Set P} (dense : Dense E) : + Dense {q : Condition | q.row ∈ E} := by + intro q + obtain ⟨row, below, member⟩ := dense q.row + exact ⟨q.withRow row below, q.withRow_le row below, member⟩ + +noncomputable def rowFilter (H : ConditionFilter Condition) : ConditionFilter P where + mem p := H.mem (emptyRow p) + nonempty := by + obtain ⟨q, member⟩ := H.nonempty + exact ⟨q.row, H.upward member ((le_empty_iff q q.row).2 le_rfl)⟩ + upward := by + intro p q member below + exact H.upward member ⟨below, fun _ h => h⟩ + directed := by + intro p q hp hq + obtain ⟨r, member, rp, rq⟩ := H.directed hp hq + exact ⟨r.row, H.upward member ((le_empty_iff r r.row).2 le_rfl), rp.1, rq.1⟩ + +theorem rowFilter_mem_iff (H : ConditionFilter Condition) (p : P) : + (rowFilter H).mem p ↔ ∃ q : Condition, H.mem q ∧ q.row = p := by + constructor + · intro member + exact ⟨emptyRow p, member, rfl⟩ + · rintro ⟨q, member, rfl⟩ + exact H.upward member ((le_empty_iff q q.row).2 le_rfl) + +theorem rowFilter_meets_iff (H : ConditionFilter Condition) (E : Set P) : + (rowFilter H).Meets E ↔ H.Meets {q : Condition | q.row ∈ E} := by + constructor + · rintro ⟨p, member, hp⟩ + obtain ⟨q, hq, rfl⟩ := (rowFilter_mem_iff H p).1 member + exact ⟨q, hq, hp⟩ + · rintro ⟨q, member, hp⟩ + exact ⟨q.row, (rowFilter_mem_iff H q.row).2 ⟨q, member, rfl⟩, hp⟩ + +theorem rowFilter_generic (H : ConditionFilter Condition) (family : Set (Set P)) + (generic : H.GenericFor ((fun E : Set P => {q : Condition | q.row ∈ E}) '' family)) : + (rowFilter H).GenericFor family := by + intro E member dense + exact (rowFilter_meets_iff H E).2 + (generic _ ⟨E, member, rfl⟩ (dense_row_preimage dense)) + +end StageOneCondition +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid + +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection +local notation "emptyRow" => StageOneCondition.empty M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 + +local notation "incl" => M.stageOneEmptyInclusion a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "smallOrder" => M.stageOneConditionSmallOrder a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + +noncomputable def stageOneProjectedFilter + (H : @ConditionFilter (Shrink Condition) (smallOrder).toPreorder) : ConditionFilter P := by + let := smallOrder + let e := M.stageOneConditionOrderIso a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + let F : ConditionFilter Condition := { + mem p := H.mem (e p) + nonempty := by + obtain ⟨q, hq⟩ := H.nonempty + exact ⟨e.symm q, by simpa only [OrderIso.apply_symm_apply] using hq⟩ + upward := by + intro p q member below + exact H.upward member (e.monotone below) + directed := by + intro p q hp hq + obtain ⟨r, hr, rp, rq⟩ := H.directed hp hq + exact ⟨e.symm r, by simpa only [OrderIso.apply_symm_apply] using hr, + (e.symm.monotone rp).trans_eq (e.symm_apply_apply p), + (e.symm.monotone rq).trans_eq (e.symm_apply_apply q)⟩ } + exact StageOneCondition.rowFilter F + +theorem stageOneProjectedFilter_mem : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (p : P), + (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT + base directed system collection H).mem p ↔ H.mem (incl p) := by + let := smallOrder + intro H p + rfl + +theorem stageOneProjectedFilter_row : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (p : P), + (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT + base directed system collection H).mem p ↔ + ∃ q : Shrink Condition, H.mem q ∧ ((equivShrink Condition).symm q).row = p := by + let := smallOrder + intro H p + constructor + · intro member + refine ⟨incl p, member, ?_⟩ + change ((equivShrink Condition).symm (equivShrink Condition (emptyRow p))).row = p + rw [Equiv.symm_apply_apply] + rfl + · rintro ⟨q, member, rfl⟩ + apply H.upward member + change (equivShrink Condition).symm q ≤ + (equivShrink Condition).symm (equivShrink Condition (emptyRow ((equivShrink Condition).symm q).row)) + rw [Equiv.symm_apply_apply] + exact (StageOneCondition.le_empty_iff _ _).2 le_rfl + +theorem stageOneSmall_dense_row_preimage {E : Set P} (dense : Dense E) : + letI := smallOrder + Dense {q : Shrink Condition | ((equivShrink Condition).symm q).row ∈ E} := by + let := smallOrder + intro q + let q' := (equivShrink Condition).symm q + obtain ⟨row, below, member⟩ := dense q'.row + refine ⟨equivShrink Condition (q'.withRow row below), ?_, ?_⟩ + · change (equivShrink Condition).symm (equivShrink Condition (q'.withRow row below)) ≤ q' + rw [Equiv.symm_apply_apply] + exact q'.withRow_le row below + · change ((equivShrink Condition).symm (equivShrink Condition (q'.withRow row below))).row ∈ E + rw [Equiv.symm_apply_apply] + exact member + +theorem stageOneProjectedFilter_generic : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (family : Set (Set P)), + H.GenericFor + ((fun E : Set P => {q : Shrink Condition | ((equivShrink Condition).symm q).row ∈ E}) '' family) → + (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT + base directed system collection H).GenericFor family := by + let := smallOrder + intro H family generic E hE dense + obtain ⟨q, hq, member⟩ := generic _ ⟨E, hE, rfl⟩ + (M.stageOneSmall_dense_row_preimage a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection dense) + exact ⟨((equivShrink Condition).symm q).row, + (M.stageOneProjectedFilter_row a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection H _).2 ⟨q, hq, rfl⟩, member⟩ + +theorem stageOneNameLift_projected_eval : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (tau : Name c.pairEmpty), + Name.eval H.mem (M.stageOneNameLift a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system collection tau) = + Name.eval (M.stageOneProjectedFilter a c b d T T2 valid pairing unions powers separation carrier order hT + base directed system collection H).mem tau := by + let := smallOrder + intro H tau + exact M.stageOneNameLift_eval a c b d T T2 valid pairing unions powers separation carrier order nodes hT + indices base directed system collection H.mem tau + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneSequenceProjections.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneSequenceProjections.lean index f524606b485ff05306bc837a2750cf86b45d9eb6..079c9cbd4aad3efcffdff741c907fa4126548f49 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneSequenceProjections.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneSequenceProjections.lean @@ -1,204 +1,204 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLifting - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -local notation "Q" => M.stageOneForcing a c b d T T2 valid -local notation "B" => M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega - -noncomputable def stageOneRowGraph : ZFSet.{u} := rowAssignmentRows Q c.carrier B -noncomputable def stageOneAssignmentGraph : ZFSet.{u} := rowAssignmentData Q c.carrier B - -private theorem subset_product : Q ⊆ ZFSet.prod c.carrier B := by - intro z hz - exact ((M.mem_stageOneConditions c.carrier _ z).1 hz).1 - -theorem stageOneRowGraph_entry (p : P) (A x : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (c.encode p) A) x ∈ M.stageOneRowGraph a c b d T T2 valid ↔ - ZFSet.pair (c.encode p) A ∈ Q ∧ x = c.encode p := by - rw [stageOneRowGraph, rowAssignmentRows_entry] - constructor - · rintro ⟨member,_,_,equal⟩ - exact ⟨member,equal⟩ - · rintro ⟨member,equal⟩ - have fields := ZFSet.pair_mem_prod.1 (subset_product M a c b d T T2 valid member) - exact ⟨member,fields.1,fields.2,equal⟩ - -theorem stageOneAssignmentGraph_entry (p : P) (A x : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (c.encode p) A) x ∈ M.stageOneAssignmentGraph a c b d T T2 valid ↔ - ZFSet.pair (c.encode p) A ∈ Q ∧ x = A := by - rw [stageOneAssignmentGraph, rowAssignmentData_entry] - constructor - · rintro ⟨member,_,_,equal⟩ - exact ⟨member,equal⟩ - · rintro ⟨member,equal⟩ - have fields := ZFSet.pair_mem_prod.1 (subset_product M a c b d T T2 valid member) - exact ⟨member,fields.1,fields.2,equal⟩ - -theorem stageOneRowGraph_function : ZFSet.IsFunc Q c.carrier (M.stageOneRowGraph a c b d T T2 valid) := - rowAssignmentRows_function (subset_product M a c b d T T2 valid) - -theorem stageOneAssignmentGraph_function : ZFSet.IsFunc Q B (M.stageOneAssignmentGraph a c b d T T2 valid) := - rowAssignmentData_function (subset_product M a c b d T T2 valid) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -include pairing unions powers separation carrier order nodes hT indices system - -theorem stageOneRowGraph_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.stageOneRowGraph a c b d T T2 valid ∈ M.sets := by - have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT - exact M.rowAssignmentRows_mem pairing unions powers separation conditions carrier - (M.groundSmallSubsets_mem powers separation assignments omega) - -theorem stageOneAssignmentGraph_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.stageOneAssignmentGraph a c b d T T2 valid ∈ M.sets := by - have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT - exact M.rowAssignmentData_mem pairing unions powers separation conditions carrier - (M.groundSmallSubsets_mem powers separation assignments omega) - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} -variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) -variable (collection : CollectionSchema M.sets) -local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier -local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order -local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection - pairedCarrier pairedOrder hT valid a b d base directed system T2 -local notation "Q" => M.stageOneForcing a c b d T T2 valid -local notation "B" => M.groundSmallSubsets - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega -local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection - -noncomputable def stageOneConditionRow (x : Shrink Condition) : P := - ((equivShrink Condition).symm x).row - -noncomputable def stageOneConditionData (x : Shrink Condition) : SetMembers B := - SetMembers.ofMem ((equivShrink Condition).symm x).assignments - ((equivShrink Condition).symm x).assignments_mem - -local notation "row" => M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection -local notation "data" => M.stageOneConditionData a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection - -theorem stageOneConditionData_raw (x : Shrink Condition) : - SetMembers.raw (data x) = ((equivShrink Condition).symm x).assignments := - SetMembers.raw_ofMem _ _ - -include nodes indices in -theorem stageOneRowGraph_eq_graph : - M.stageOneRowGraph a c b d T T2 valid = (pres).graph c row := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro member - obtain ⟨raw,hr,x,_,rfl⟩ := ZFSet.mem_prod.1 ((M.stageOneRowGraph_function a c b d T T2 valid).1 member) - obtain ⟨q,rfl⟩ := ((pres).mem_carrier raw).1 hr - have value := (M.stageOneRowGraph_entry a c b d T T2 valid - ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments x).1 member - refine ⟨q, ?_⟩ - change ZFSet.pair ((pres).encode q) (c.encode (row q)) = ZFSet.pair ((pres).encode q) x - rw [value.2] - rfl - · rintro ⟨q,rfl⟩ - exact (M.stageOneRowGraph_entry a c b d T T2 valid - ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments _).2 - ⟨(pres).encode_mem q,rfl⟩ - -include nodes indices in -theorem stageOneAssignmentGraph_eq_graph : - M.stageOneAssignmentGraph a c b d T T2 valid = (pres).graph (SetMembers.presentation B) data := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro member - obtain ⟨raw,hr,x,_,rfl⟩ := ZFSet.mem_prod.1 ((M.stageOneAssignmentGraph_function a c b d T T2 valid).1 member) - obtain ⟨q,rfl⟩ := ((pres).mem_carrier raw).1 hr - have value := (M.stageOneAssignmentGraph_entry a c b d T T2 valid - ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments x).1 member - refine ⟨q, ?_⟩ - change ZFSet.pair ((pres).encode q) (SetMembers.raw (data q)) = ZFSet.pair ((pres).encode q) x - rw [M.stageOneConditionData_raw, value.2] - · rintro ⟨q,rfl⟩ - exact (M.stageOneAssignmentGraph_entry a c b d T T2 valid - ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments _).2 - ⟨(pres).encode_mem q, M.stageOneConditionData_raw a c b d T T2 valid pairing unions powers separation - carrier order hT base directed system collection q⟩ - -include nodes indices in -theorem stageOneSequence_projections_ground - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (seq : Nat → Shrink Condition) - (whole : natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets) : - natPresentation.graph c (fun n => row (seq n.down)) ∈ M.sets ∧ - groundSequenceGraph (fun n => data (seq n)) ∈ M.sets := by - have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - have hB := M.groundSmallSubsets_mem powers separation - (M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT) omega - have first := M.stageOneRowGraph_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - have second := M.stageOneAssignmentGraph_mem a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system nodeOrder omega - rw [M.stageOneRowGraph_eq_graph a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] at first - rw [M.stageOneAssignmentGraph_eq_graph a c b d T T2 valid pairing unions powers separation - carrier order nodes hT indices base directed system collection] at second - have rowGraph := M.relationCompose_mem pairing unions powers separation omega conditions carrier whole first - have dataGraph := M.relationCompose_mem pairing unions powers separation omega conditions hB whole second - have rowEqual := natPresentation.relationCompose_graph (pres) c (fun n => seq n.down) row - have dataEqual := natPresentation.relationCompose_graph (pres) (SetMembers.presentation B) (fun n => seq n.down) data - change relationCompose ZFSet.omega Q c.carrier - (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph c row) = _ at rowEqual - change relationCompose ZFSet.omega Q B - (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph (SetMembers.presentation B) data) = _ at dataEqual - rw [rowEqual] at rowGraph - rw [dataEqual] at dataGraph - exact ⟨rowGraph,dataGraph⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneNameLifting + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +local notation "Q" => M.stageOneForcing a c b d T T2 valid +local notation "B" => M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega + +noncomputable def stageOneRowGraph : ZFSet.{u} := rowAssignmentRows Q c.carrier B +noncomputable def stageOneAssignmentGraph : ZFSet.{u} := rowAssignmentData Q c.carrier B + +private theorem subset_product : Q ⊆ ZFSet.prod c.carrier B := by + intro z hz + exact ((M.mem_stageOneConditions c.carrier _ z).1 hz).1 + +theorem stageOneRowGraph_entry (p : P) (A x : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (c.encode p) A) x ∈ M.stageOneRowGraph a c b d T T2 valid ↔ + ZFSet.pair (c.encode p) A ∈ Q ∧ x = c.encode p := by + rw [stageOneRowGraph, rowAssignmentRows_entry] + constructor + · rintro ⟨member,_,_,equal⟩ + exact ⟨member,equal⟩ + · rintro ⟨member,equal⟩ + have fields := ZFSet.pair_mem_prod.1 (subset_product M a c b d T T2 valid member) + exact ⟨member,fields.1,fields.2,equal⟩ + +theorem stageOneAssignmentGraph_entry (p : P) (A x : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (c.encode p) A) x ∈ M.stageOneAssignmentGraph a c b d T T2 valid ↔ + ZFSet.pair (c.encode p) A ∈ Q ∧ x = A := by + rw [stageOneAssignmentGraph, rowAssignmentData_entry] + constructor + · rintro ⟨member,_,_,equal⟩ + exact ⟨member,equal⟩ + · rintro ⟨member,equal⟩ + have fields := ZFSet.pair_mem_prod.1 (subset_product M a c b d T T2 valid member) + exact ⟨member,fields.1,fields.2,equal⟩ + +theorem stageOneRowGraph_function : ZFSet.IsFunc Q c.carrier (M.stageOneRowGraph a c b d T T2 valid) := + rowAssignmentRows_function (subset_product M a c b d T T2 valid) + +theorem stageOneAssignmentGraph_function : ZFSet.IsFunc Q B (M.stageOneAssignmentGraph a c b d T T2 valid) := + rowAssignmentData_function (subset_product M a c b d T T2 valid) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +include pairing unions powers separation carrier order nodes hT indices system + +theorem stageOneRowGraph_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.stageOneRowGraph a c b d T T2 valid ∈ M.sets := by + have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT + exact M.rowAssignmentRows_mem pairing unions powers separation conditions carrier + (M.groundSmallSubsets_mem powers separation assignments omega) + +theorem stageOneAssignmentGraph_mem (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.stageOneAssignmentGraph a c b d T T2 valid ∈ M.sets := by + have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT + exact M.rowAssignmentData_mem pairing unions powers separation conditions carrier + (M.groundSmallSubsets_mem powers separation assignments omega) + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (c : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (carrier : c.carrier ∈ M.sets) (order : c.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName c.pairEmpty z} +variable (indices : NiceRefinementIndexSystem M a c.pairEmpty b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a c.pairEmpty b d base directed T valid) +variable (collection : CollectionSchema M.sets) +local notation "pairedCarrier" => M.pairEmpty_carrier_mem pairing unions powers separation c carrier +local notation "pairedOrder" => M.pairEmpty_order_mem pairing unions powers separation c carrier order +local notation "Condition" => StageOneCondition M c.pairEmpty pairing unions powers separation collection + pairedCarrier pairedOrder hT valid a b d base directed system T2 +local notation "Q" => M.stageOneForcing a c b d T T2 valid +local notation "B" => M.groundSmallSubsets + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty b d ∅ T T2 valid) T) ZFSet.omega +local notation "pres" => M.stageOneConditionPresentation a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection + +noncomputable def stageOneConditionRow (x : Shrink Condition) : P := + ((equivShrink Condition).symm x).row + +noncomputable def stageOneConditionData (x : Shrink Condition) : SetMembers B := + SetMembers.ofMem ((equivShrink Condition).symm x).assignments + ((equivShrink Condition).symm x).assignments_mem + +local notation "row" => M.stageOneConditionRow a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection +local notation "data" => M.stageOneConditionData a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection + +theorem stageOneConditionData_raw (x : Shrink Condition) : + SetMembers.raw (data x) = ((equivShrink Condition).symm x).assignments := + SetMembers.raw_ofMem _ _ + +include nodes indices in +theorem stageOneRowGraph_eq_graph : + M.stageOneRowGraph a c b d T T2 valid = (pres).graph c row := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro member + obtain ⟨raw,hr,x,_,rfl⟩ := ZFSet.mem_prod.1 ((M.stageOneRowGraph_function a c b d T T2 valid).1 member) + obtain ⟨q,rfl⟩ := ((pres).mem_carrier raw).1 hr + have value := (M.stageOneRowGraph_entry a c b d T T2 valid + ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments x).1 member + refine ⟨q, ?_⟩ + change ZFSet.pair ((pres).encode q) (c.encode (row q)) = ZFSet.pair ((pres).encode q) x + rw [value.2] + rfl + · rintro ⟨q,rfl⟩ + exact (M.stageOneRowGraph_entry a c b d T T2 valid + ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments _).2 + ⟨(pres).encode_mem q,rfl⟩ + +include nodes indices in +theorem stageOneAssignmentGraph_eq_graph : + M.stageOneAssignmentGraph a c b d T T2 valid = (pres).graph (SetMembers.presentation B) data := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro member + obtain ⟨raw,hr,x,_,rfl⟩ := ZFSet.mem_prod.1 ((M.stageOneAssignmentGraph_function a c b d T T2 valid).1 member) + obtain ⟨q,rfl⟩ := ((pres).mem_carrier raw).1 hr + have value := (M.stageOneAssignmentGraph_entry a c b d T T2 valid + ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments x).1 member + refine ⟨q, ?_⟩ + change ZFSet.pair ((pres).encode q) (SetMembers.raw (data q)) = ZFSet.pair ((pres).encode q) x + rw [M.stageOneConditionData_raw, value.2] + · rintro ⟨q,rfl⟩ + exact (M.stageOneAssignmentGraph_entry a c b d T T2 valid + ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments _).2 + ⟨(pres).encode_mem q, M.stageOneConditionData_raw a c b d T T2 valid pairing unions powers separation + carrier order hT base directed system collection q⟩ + +include nodes indices in +theorem stageOneSequence_projections_ground + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (seq : Nat → Shrink Condition) + (whole : natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets) : + natPresentation.graph c (fun n => row (seq n.down)) ∈ M.sets ∧ + groundSequenceGraph (fun n => data (seq n)) ∈ M.sets := by + have conditions := M.stageOneForcing_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + have hB := M.groundSmallSubsets_mem powers separation + (M.stageOneAssignments_mem pairing unions powers separation indices.index_ground hT) omega + have first := M.stageOneRowGraph_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + have second := M.stageOneAssignmentGraph_mem a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system nodeOrder omega + rw [M.stageOneRowGraph_eq_graph a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] at first + rw [M.stageOneAssignmentGraph_eq_graph a c b d T T2 valid pairing unions powers separation + carrier order nodes hT indices base directed system collection] at second + have rowGraph := M.relationCompose_mem pairing unions powers separation omega conditions carrier whole first + have dataGraph := M.relationCompose_mem pairing unions powers separation omega conditions hB whole second + have rowEqual := natPresentation.relationCompose_graph (pres) c (fun n => seq n.down) row + have dataEqual := natPresentation.relationCompose_graph (pres) (SetMembers.presentation B) (fun n => seq n.down) data + change relationCompose ZFSet.omega Q c.carrier + (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph c row) = _ at rowEqual + change relationCompose ZFSet.omega Q B + (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph (SetMembers.presentation B) data) = _ at dataEqual + rw [rowEqual] at rowGraph + rw [dataEqual] at dataGraph + exact ⟨rowGraph,dataGraph⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneTestEquivalence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneTestEquivalence.lean index 8cb69b356f7a68038f803cf9a8e7a89a98c8193b..6e287dd9aad1d898e41737040870cb2136c3ea95 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneTestEquivalence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageOneTestEquivalence.lean @@ -1,331 +1,331 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneRawNames - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) - -include indices in -theorem stageOneRawCollision_iff (C E : L) (U Rf Rc u u' w w' : (M.nameDomain s).names) - (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid) (p : P) : - stageOneRawCollision M (M.stageOneFormulaData a s b d T T2 valid) - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val u'.val.val w.val.val w'.val.val (s.encode p) ↔ - M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid Rf Rc u u' w w' p := by - let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid - let env : Assignment (M.nameDomain s) 4 := ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] - have codes : (fun j => (env j).val.val) = - ![(cls Rc u).val.val, (cls Rc u').val.val, (cls Rf w).val.val, (cls Rf w').val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j - have forcing := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order - refinementCollisionFormula p env - rw [codes] at forcing - have fields := M.stageOneFormulaData_fields s valid a b d indices C E U Rf Rc member - constructor - · rintro ⟨f, ground, body⟩ - obtain ⟨_, _, _, _, ff, fr, bu, bu', aw, aw', forced⟩ := body - have ef := (fields.2.2.2.1 _).1 ff - have er := (fields.2.2.2.2 _).1 fr - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u.val.val (f 2) at bu - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u'.val.val (f 3) at bu' - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w.val.val (f 4) at aw - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w'.val.val (f 5) at aw' - rw [er] at bu bu' - rw [ef] at aw aw' - have eb := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (ground 2)).1 bu - have eb' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (ground 3)).1 bu' - have ea := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (ground 4)).1 aw - have ea' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (ground 5)).1 aw' - rw [eb, eb', ea, ea'] at forced - exact forcing.1 forced - · intro forced - refine ⟨![Rf.val.val, Rc.val.val, (cls Rc u).val.val, (cls Rc u').val.val, - (cls Rf w).val.val, (cls Rf w').val.val], ?_, ?_⟩ - · exact Fin.cases Rf.property (Fin.cases Rc.property (Fin.cases (cls Rc u).property - (Fin.cases (cls Rc u').property (Fin.cases (cls Rf w).property - (Fin.cases (cls Rf w').property (fun j => Fin.elim0 j)))))) - · refine ⟨M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u, - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u', - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w, - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w', - (fields.2.2.2.1 _).2 rfl, (fields.2.2.2.2 _).2 rfl, ?_, ?_, ?_, ?_, forcing.2 forced⟩ - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (cls Rc u).property).2 rfl - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (cls Rc u').property).2 rfl - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (cls Rf w).property).2 rfl - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (cls Rf w').property).2 rfl - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable {T2 : ZFSet.{u}} {valid2 : ∀ z ∈ T2, IsName s z} -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -include pairing unions powers separation collection carrier order - -omit [OrderTop P] in -private theorem raw_three (phi : SetFormula 3) (p : P) (x y z : (M.nameDomain s).names) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi ![x.val.val, y.val.val, z.val.val] ↔ - Forces (M.nameDomain s) phi ![x, y, z] p := by - have equal : (fun j : Fin 3 => ((![x, y, z] : Assignment (M.nameDomain s) 3) j).val.val) = - ![x.val.val, y.val.val, z.val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j - rw [← equal] - exact M.stageOneRawForces_iff s pairing unions powers separation collection carrier order phi p ![x, y, z] - -omit [OrderTop P] in -private theorem raw_four (phi : SetFormula 4) (p : P) (x y z w : (M.nameDomain s).names) : - stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi ![x.val.val, y.val.val, z.val.val, w.val.val] ↔ - Forces (M.nameDomain s) phi ![x, y, z, w] p := by - have equal : (fun j : Fin 4 => ((![x, y, z, w] : Assignment (M.nameDomain s) 4) j).val.val) = - ![x.val.val, y.val.val, z.val.val, w.val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j - rw [← equal] - exact M.stageOneRawForces_iff s pairing unions powers separation collection carrier order phi p ![x, y, z, w] - -theorem stageOneRawProfile_iff (E : L) (bu aw : (M.nameDomain s).names) (p : P) : - let data := M.stageOneFormulaData a s b d T T2 valid - stageOneRawProfile M (data 7) (data 8) (s.encode p) (data 10) (data 11) (data 13) - (b.encode E) bu.val.val aw.val.val ↔ - ∀ v : L, E ≤ v → Forces (M.nameDomain s) refinementProfileFormula - ![bu, aw, M.stageOneVisibilityName s valid a b d base directed system v] p := by - change stageOneRawProfile M s.carrier s.conditionOrder (s.encode p) b.carrier b.conditionOrder - (M.stageOneFormulaData a s b d T T2 valid 13) (b.encode E) bu.val.val aw.val.val ↔ _ - constructor - · intro raw v below - obtain ⟨V, hV, entry, forced⟩ := raw (b.encode v) (b.encode_mem v) - ((b.pair_mem_conditionOrder E v).2 below) - have equal := (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system v V).1 entry - subst V - exact (raw_three M s pairing unions powers separation collection carrier order - refinementProfileFormula p bu aw (M.stageOneVisibilityName s valid a b d base directed system v)).1 forced - · intro typed v hv below - obtain ⟨v, rfl⟩ := (b.mem_carrier v).1 hv - let V := M.stageOneVisibilityName s valid a b d base directed system v - refine ⟨V.val.val, V.property, ?_, ?_⟩ - · exact (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system v V.val.val).2 rfl - · exact (raw_three M s pairing unions powers separation collection carrier order - refinementProfileFormula p bu aw V).2 (typed v ((b.pair_mem_conditionOrder E v).1 below)) - -variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) - -include indices in -theorem stageOneRawCompatibility_iff (C E : L) (U Rf Rc bu aw : (M.nameDomain s).names) (p : P) - (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid) : - let data := M.stageOneFormulaData a s b d T T2 valid - let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - stageOneRawCompatibility M (data 7) (data 8) (s.encode p) (data 13) (data 12) - (b.encode C) idx bu.val.val aw.val.val ↔ - Forces (M.nameDomain s) refinementCompatibilityFormula - ![aw, M.stageOneVisibilityName s valid a b d base directed system C, bu, - M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc] p := by - change stageOneRawCompatibility M s.carrier s.conditionOrder (s.encode p) - (M.stageOneFormulaData a s b d T T2 valid 13) (M.stageOneFormulaData a s b d T T2 valid 12) - (b.encode C) (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - bu.val.val aw.val.val ↔ _ - constructor - · rintro ⟨V, hV, D, hD, visible, mapped, forced⟩ - have equalV := (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system C V).1 visible - have equalD := (M.stageOneFormulaData_map s pairing unions powers separation collection carrier order - hT valid a b d indices C E U Rf Rc member D).1 mapped - subst V - subst D - exact (raw_four M s pairing unions powers separation collection carrier order - refinementCompatibilityFormula p aw (M.stageOneVisibilityName s valid a b d base directed system C) bu - (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc)).1 forced - · intro forced - let V := M.stageOneVisibilityName s valid a b d base directed system C - let D := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc - refine ⟨V.val.val, V.property, D.val.val, D.property, ?_, ?_, ?_⟩ - · exact (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system C V.val.val).2 rfl - · exact (M.stageOneFormulaData_map s pairing unions powers separation collection carrier order - hT valid a b d indices C E U Rf Rc member D.val.val).2 rfl - · exact (raw_four M s pairing unions powers separation collection carrier order - refinementCompatibilityFormula p aw V bu D).2 forced - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) - -include nodes indices in -theorem stageOneRawSingle_codes (C E : L) (U Rf Rc u w : (M.nameDomain s).names) - (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid) (p : P) : - let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let data := M.stageOneFormulaData a s b d T T2 valid - let bu := (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u).val.val - let aw := (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w).val.val - stageOneRawSingle M data idx u.val.val w.val.val (s.encode p) ↔ - stageOneRawForces M (data 7) (data 8) (s.encode p) refinementActivityFormula ![u.val.val, w.val.val, U.val.val] ∧ - stageOneRawProfile M (data 7) (data 8) (s.encode p) (data 10) (data 11) (data 13) (b.encode E) bu aw ∧ - stageOneRawCompatibility M (data 7) (data 8) (s.encode p) (data 13) (data 12) (b.encode C) idx bu aw := by - let data := M.stageOneFormulaData a s b d T T2 valid - let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val - let bu := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u - let aw := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w - have fields := M.stageOneFormulaData_fields s valid a b d indices C E U Rf Rc member - dsimp only - constructor - · rintro ⟨f, ground, body⟩ - obtain ⟨_, _, _, _, fc, fe, fu, ff, fr, coarse, fine, active, profile, compatible⟩ := body - have ec := (fields.1 _).1 fc - have ee := (fields.2.1 _).1 fe - have eu := (fields.2.2.1 _).1 fu - have ef := (fields.2.2.2.1 _).1 ff - have er := (fields.2.2.2.2 _).1 fr - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 4) u.val.val (f 5) at coarse - change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 3) w.val.val (f 6) at fine - rw [er] at coarse - rw [ef] at fine - have eb := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid - Rc u (f 5) (ground 5)).1 coarse - have ea := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid - Rf w (f 6) (ground 6)).1 fine - rw [eu] at active - rw [ee, eb, ea] at profile - rw [ec, eb, ea] at compatible - exact ⟨active, profile, compatible⟩ - · rintro ⟨active, profile, compatible⟩ - refine ⟨![b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val, bu.val.val, aw.val.val], ?_, ?_⟩ - · exact Fin.cases (M.transitive nodes (b.encode_mem C)) - (Fin.cases (M.transitive nodes (b.encode_mem E)) (Fin.cases U.property - (Fin.cases Rf.property (Fin.cases Rc.property (Fin.cases bu.property - (Fin.cases aw.property (fun j => Fin.elim0 j))))))) - · refine ⟨b.encode_mem C, b.encode_mem E, - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u, - M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w, - (fields.1 _).2 rfl, (fields.2.1 _).2 rfl, (fields.2.2.1 _).2 rfl, - (fields.2.2.2.1 _).2 rfl, (fields.2.2.2.2 _).2 rfl, ?_, ?_, active, profile, compatible⟩ - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid - Rc u bu.val.val bu.property).2 rfl - · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid - Rf w aw.val.val aw.property).2 rfl - -end - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) -variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) -variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -include nodes indices in -theorem stageOneRawSingle_iff (C E : L) (U Rf Rc u w : (M.nameDomain s).names) - (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid) (p : P) : - stageOneRawSingle M (M.stageOneFormulaData a s b d T T2 valid) - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val w.val.val (s.encode p) ↔ - M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system C E U Rf Rc u w p := by - have meaning := M.stageOneRawSingle_codes a s b d pairing unions powers separation collection - carrier order nodes hT valid indices C E U Rf Rc u w member p - let bu := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u - let aw := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w - have codes : (fun j : Fin 3 => ((![u, w, U] : Assignment (M.nameDomain s) 3) j).val.val) = - ![u.val.val, w.val.val, U.val.val] := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j - have activity := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order - refinementActivityFormula p ![u, w, U] - rw [codes] at activity - have profile := M.stageOneRawProfile_iff s pairing unions powers separation collection carrier order - valid a b d (T2 := T2) base directed system E bu aw p - have compatible := M.stageOneRawCompatibility_iff s pairing unions powers separation collection carrier order - hT valid a b d base directed system indices C E U Rf Rc bu aw p member - exact meaning.trans (and_congr activity (and_congr profile compatible)) - -include nodes indices in -theorem stageOneRawTests_iff (A : ZFSet.{u}) (p : P) : - stageOneRawTests M (M.stageOneFormulaData a s b d T T2 valid) A (s.encode p) ↔ - M.stageOneTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system T2 A p := by - have single := M.stageOneRawSingle_iff a s b d pairing unions powers separation collection - carrier order nodes hT valid indices base directed system - have collision := M.stageOneRawCollision_iff a s b d pairing unions powers separation collection - carrier order hT valid indices - let lift (r : ZFSet.{u}) (hr : r ∈ T) : (M.nameDomain s).names := - ⟨⟨r, valid r hr⟩, M.transitive hT hr⟩ - constructor - · intro raw C E U Rf Rc - dsimp only - intro member - refine ⟨?_, ?_⟩ - · intro u w hu hw entry - exact (single C E U Rf Rc u w member p).1 - (raw.1 _ member u.val.val hu w.val.val hw entry) - · intro u u' w w' hu hu' hw hw' entry entry' - exact (collision C E U Rf Rc u u' w w' member p).1 - (raw.2 _ member u.val.val hu u'.val.val hu' w.val.val hw w'.val.val hw' entry entry') - · intro typed - refine ⟨?_, ?_⟩ - · intro t ht rawU hu rawW hw entry - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht - exact (single C E U Rf Rc (lift rawU hu) (lift rawW hw) ht p).2 - ((typed C E U Rf Rc ht).1 (lift rawU hu) (lift rawW hw) hu hw entry) - · intro t ht rawU hu rawU' hu' rawW hw rawW' hw' entry entry' - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht - exact (collision C E U Rf Rc (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') ht p).2 - ((typed C E U Rf Rc ht).2 (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') - hu hu' hw hw' entry entry') - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageOneRawNames + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) + +include indices in +theorem stageOneRawCollision_iff (C E : L) (U Rf Rc u u' w w' : (M.nameDomain s).names) + (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid) (p : P) : + stageOneRawCollision M (M.stageOneFormulaData a s b d T T2 valid) + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val u'.val.val w.val.val w'.val.val (s.encode p) ↔ + M.stageOneCollisionTest s pairing unions powers separation collection carrier order hT valid Rf Rc u u' w w' p := by + let cls := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid + let env : Assignment (M.nameDomain s) 4 := ![cls Rc u, cls Rc u', cls Rf w, cls Rf w'] + have codes : (fun j => (env j).val.val) = + ![(cls Rc u).val.val, (cls Rc u').val.val, (cls Rf w).val.val, (cls Rf w').val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j + have forcing := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order + refinementCollisionFormula p env + rw [codes] at forcing + have fields := M.stageOneFormulaData_fields s valid a b d indices C E U Rf Rc member + constructor + · rintro ⟨f, ground, body⟩ + obtain ⟨_, _, _, _, ff, fr, bu, bu', aw, aw', forced⟩ := body + have ef := (fields.2.2.2.1 _).1 ff + have er := (fields.2.2.2.2 _).1 fr + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u.val.val (f 2) at bu + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 1) u'.val.val (f 3) at bu' + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w.val.val (f 4) at aw + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 0) w'.val.val (f 5) at aw' + rw [er] at bu bu' + rw [ef] at aw aw' + have eb := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (ground 2)).1 bu + have eb' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (ground 3)).1 bu' + have ea := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (ground 4)).1 aw + have ea' := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (ground 5)).1 aw' + rw [eb, eb', ea, ea'] at forced + exact forcing.1 forced + · intro forced + refine ⟨![Rf.val.val, Rc.val.val, (cls Rc u).val.val, (cls Rc u').val.val, + (cls Rf w).val.val, (cls Rf w').val.val], ?_, ?_⟩ + · exact Fin.cases Rf.property (Fin.cases Rc.property (Fin.cases (cls Rc u).property + (Fin.cases (cls Rc u').property (Fin.cases (cls Rf w).property + (Fin.cases (cls Rf w').property (fun j => Fin.elim0 j)))))) + · refine ⟨M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u, + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u', + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w, + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w', + (fields.2.2.2.1 _).2 rfl, (fields.2.2.2.2 _).2 rfl, ?_, ?_, ?_, ?_, forcing.2 forced⟩ + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u _ (cls Rc u).property).2 rfl + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rc u' _ (cls Rc u').property).2 rfl + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w _ (cls Rf w).property).2 rfl + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid Rf w' _ (cls Rf w').property).2 rfl + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable {T2 : ZFSet.{u}} {valid2 : ∀ z ∈ T2, IsName s z} +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +include pairing unions powers separation collection carrier order + +omit [OrderTop P] in +private theorem raw_three (phi : SetFormula 3) (p : P) (x y z : (M.nameDomain s).names) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi ![x.val.val, y.val.val, z.val.val] ↔ + Forces (M.nameDomain s) phi ![x, y, z] p := by + have equal : (fun j : Fin 3 => ((![x, y, z] : Assignment (M.nameDomain s) 3) j).val.val) = + ![x.val.val, y.val.val, z.val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j + rw [← equal] + exact M.stageOneRawForces_iff s pairing unions powers separation collection carrier order phi p ![x, y, z] + +omit [OrderTop P] in +private theorem raw_four (phi : SetFormula 4) (p : P) (x y z w : (M.nameDomain s).names) : + stageOneRawForces M s.carrier s.conditionOrder (s.encode p) phi ![x.val.val, y.val.val, z.val.val, w.val.val] ↔ + Forces (M.nameDomain s) phi ![x, y, z, w] p := by + have equal : (fun j : Fin 4 => ((![x, y, z, w] : Assignment (M.nameDomain s) 4) j).val.val) = + ![x.val.val, y.val.val, z.val.val, w.val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k)))) j + rw [← equal] + exact M.stageOneRawForces_iff s pairing unions powers separation collection carrier order phi p ![x, y, z, w] + +theorem stageOneRawProfile_iff (E : L) (bu aw : (M.nameDomain s).names) (p : P) : + let data := M.stageOneFormulaData a s b d T T2 valid + stageOneRawProfile M (data 7) (data 8) (s.encode p) (data 10) (data 11) (data 13) + (b.encode E) bu.val.val aw.val.val ↔ + ∀ v : L, E ≤ v → Forces (M.nameDomain s) refinementProfileFormula + ![bu, aw, M.stageOneVisibilityName s valid a b d base directed system v] p := by + change stageOneRawProfile M s.carrier s.conditionOrder (s.encode p) b.carrier b.conditionOrder + (M.stageOneFormulaData a s b d T T2 valid 13) (b.encode E) bu.val.val aw.val.val ↔ _ + constructor + · intro raw v below + obtain ⟨V, hV, entry, forced⟩ := raw (b.encode v) (b.encode_mem v) + ((b.pair_mem_conditionOrder E v).2 below) + have equal := (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system v V).1 entry + subst V + exact (raw_three M s pairing unions powers separation collection carrier order + refinementProfileFormula p bu aw (M.stageOneVisibilityName s valid a b d base directed system v)).1 forced + · intro typed v hv below + obtain ⟨v, rfl⟩ := (b.mem_carrier v).1 hv + let V := M.stageOneVisibilityName s valid a b d base directed system v + refine ⟨V.val.val, V.property, ?_, ?_⟩ + · exact (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system v V.val.val).2 rfl + · exact (raw_three M s pairing unions powers separation collection carrier order + refinementProfileFormula p bu aw V).2 (typed v ((b.pair_mem_conditionOrder E v).1 below)) + +variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) + +include indices in +theorem stageOneRawCompatibility_iff (C E : L) (U Rf Rc bu aw : (M.nameDomain s).names) (p : P) + (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid) : + let data := M.stageOneFormulaData a s b d T T2 valid + let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + stageOneRawCompatibility M (data 7) (data 8) (s.encode p) (data 13) (data 12) + (b.encode C) idx bu.val.val aw.val.val ↔ + Forces (M.nameDomain s) refinementCompatibilityFormula + ![aw, M.stageOneVisibilityName s valid a b d base directed system C, bu, + M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc] p := by + change stageOneRawCompatibility M s.carrier s.conditionOrder (s.encode p) + (M.stageOneFormulaData a s b d T T2 valid 13) (M.stageOneFormulaData a s b d T T2 valid 12) + (b.encode C) (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + bu.val.val aw.val.val ↔ _ + constructor + · rintro ⟨V, hV, D, hD, visible, mapped, forced⟩ + have equalV := (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system C V).1 visible + have equalD := (M.stageOneFormulaData_map s pairing unions powers separation collection carrier order + hT valid a b d indices C E U Rf Rc member D).1 mapped + subst V + subst D + exact (raw_four M s pairing unions powers separation collection carrier order + refinementCompatibilityFormula p aw (M.stageOneVisibilityName s valid a b d base directed system C) bu + (M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc)).1 forced + · intro forced + let V := M.stageOneVisibilityName s valid a b d base directed system C + let D := M.stageOneMapName s pairing unions powers separation collection carrier order hT valid U Rf Rc + refine ⟨V.val.val, V.property, D.val.val, D.property, ?_, ?_, ?_⟩ + · exact (M.stageOneFormulaData_visibility s valid a b d (T2 := T2) base directed system C V.val.val).2 rfl + · exact (M.stageOneFormulaData_map s pairing unions powers separation collection carrier order + hT valid a b d indices C E U Rf Rc member D.val.val).2 rfl + · exact (raw_four M s pairing unions powers separation collection carrier order + refinementCompatibilityFormula p aw V bu D).2 forced + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) + +include nodes indices in +theorem stageOneRawSingle_codes (C E : L) (U Rf Rc u w : (M.nameDomain s).names) + (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid) (p : P) : + let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let data := M.stageOneFormulaData a s b d T T2 valid + let bu := (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u).val.val + let aw := (M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w).val.val + stageOneRawSingle M data idx u.val.val w.val.val (s.encode p) ↔ + stageOneRawForces M (data 7) (data 8) (s.encode p) refinementActivityFormula ![u.val.val, w.val.val, U.val.val] ∧ + stageOneRawProfile M (data 7) (data 8) (s.encode p) (data 10) (data 11) (data 13) (b.encode E) bu aw ∧ + stageOneRawCompatibility M (data 7) (data 8) (s.encode p) (data 13) (data 12) (b.encode C) idx bu aw := by + let data := M.stageOneFormulaData a s b d T T2 valid + let idx := refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val + let bu := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u + let aw := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w + have fields := M.stageOneFormulaData_fields s valid a b d indices C E U Rf Rc member + dsimp only + constructor + · rintro ⟨f, ground, body⟩ + obtain ⟨_, _, _, _, fc, fe, fu, ff, fr, coarse, fine, active, profile, compatible⟩ := body + have ec := (fields.1 _).1 fc + have ee := (fields.2.1 _).1 fe + have eu := (fields.2.2.1 _).1 fu + have ef := (fields.2.2.2.1 _).1 ff + have er := (fields.2.2.2.2 _).1 fr + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 4) u.val.val (f 5) at coarse + change stageOneRawClass M T s.carrier s.conditionOrder (s.encode ⊤) (f 3) w.val.val (f 6) at fine + rw [er] at coarse + rw [ef] at fine + have eb := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid + Rc u (f 5) (ground 5)).1 coarse + have ea := (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid + Rf w (f 6) (ground 6)).1 fine + rw [eu] at active + rw [ee, eb, ea] at profile + rw [ec, eb, ea] at compatible + exact ⟨active, profile, compatible⟩ + · rintro ⟨active, profile, compatible⟩ + refine ⟨![b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val, bu.val.val, aw.val.val], ?_, ?_⟩ + · exact Fin.cases (M.transitive nodes (b.encode_mem C)) + (Fin.cases (M.transitive nodes (b.encode_mem E)) (Fin.cases U.property + (Fin.cases Rf.property (Fin.cases Rc.property (Fin.cases bu.property + (Fin.cases aw.property (fun j => Fin.elim0 j))))))) + · refine ⟨b.encode_mem C, b.encode_mem E, + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rc u, + M.stageOneClassName_mem_bound s pairing unions powers separation collection carrier order hT valid Rf w, + (fields.1 _).2 rfl, (fields.2.1 _).2 rfl, (fields.2.2.1 _).2 rfl, + (fields.2.2.2.1 _).2 rfl, (fields.2.2.2.2 _).2 rfl, ?_, ?_, active, profile, compatible⟩ + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid + Rc u bu.val.val bu.property).2 rfl + · exact (M.stageOneRawClass_iff s pairing unions powers separation collection carrier order hT valid + Rf w aw.val.val aw.property).2 rfl + +end + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) +variable {T T2 : ZFSet.{u}} (hT : T ∈ M.sets) +variable (valid : ∀ z ∈ T, IsName s z) {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +include nodes indices in +theorem stageOneRawSingle_iff (C E : L) (U Rf Rc u w : (M.nameDomain s).names) + (member : refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid) (p : P) : + stageOneRawSingle M (M.stageOneFormulaData a s b d T T2 valid) + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val w.val.val (s.encode p) ↔ + M.stageOneSingleTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system C E U Rf Rc u w p := by + have meaning := M.stageOneRawSingle_codes a s b d pairing unions powers separation collection + carrier order nodes hT valid indices C E U Rf Rc u w member p + let bu := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rc u + let aw := M.stageOneClassName s pairing unions powers separation collection carrier order hT valid Rf w + have codes : (fun j : Fin 3 => ((![u, w, U] : Assignment (M.nameDomain s) 3) j).val.val) = + ![u.val.val, w.val.val, U.val.val] := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))) j + have activity := M.stageOneRawForces_iff s pairing unions powers separation collection carrier order + refinementActivityFormula p ![u, w, U] + rw [codes] at activity + have profile := M.stageOneRawProfile_iff s pairing unions powers separation collection carrier order + valid a b d (T2 := T2) base directed system E bu aw p + have compatible := M.stageOneRawCompatibility_iff s pairing unions powers separation collection carrier order + hT valid a b d base directed system indices C E U Rf Rc bu aw p member + exact meaning.trans (and_congr activity (and_congr profile compatible)) + +include nodes indices in +theorem stageOneRawTests_iff (A : ZFSet.{u}) (p : P) : + stageOneRawTests M (M.stageOneFormulaData a s b d T T2 valid) A (s.encode p) ↔ + M.stageOneTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system T2 A p := by + have single := M.stageOneRawSingle_iff a s b d pairing unions powers separation collection + carrier order nodes hT valid indices base directed system + have collision := M.stageOneRawCollision_iff a s b d pairing unions powers separation collection + carrier order hT valid indices + let lift (r : ZFSet.{u}) (hr : r ∈ T) : (M.nameDomain s).names := + ⟨⟨r, valid r hr⟩, M.transitive hT hr⟩ + constructor + · intro raw C E U Rf Rc + dsimp only + intro member + refine ⟨?_, ?_⟩ + · intro u w hu hw entry + exact (single C E U Rf Rc u w member p).1 + (raw.1 _ member u.val.val hu w.val.val hw entry) + · intro u u' w w' hu hu' hw hw' entry entry' + exact (collision C E U Rf Rc u u' w w' member p).1 + (raw.2 _ member u.val.val hu u'.val.val hu' w.val.val hw w'.val.val hw' entry entry') + · intro typed + refine ⟨?_, ?_⟩ + · intro t ht rawU hu rawW hw entry + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht + exact (single C E U Rf Rc (lift rawU hu) (lift rawW hw) ht p).2 + ((typed C E U Rf Rc ht).1 (lift rawU hu) (lift rawW hw) hu hw entry) + · intro t ht rawU hu rawU' hu' rawW hw rawW' hw' entry entry' + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := indices.decoded t ht + exact (collision C E U Rf Rc (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') ht p).2 + ((typed C E U Rf Rc ht).2 (lift rawU hu) (lift rawU' hu') (lift rawW hw) (lift rawW' hw') + hu hu' hw hw' entry entry') + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeAssignmentFamilies.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeAssignmentFamilies.lean index a857dce895ee5b49842c5af7fb619e435adc5e43..e6d8346476b2dea3140f2b3f63c3574e74300ac2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeAssignmentFamilies.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeAssignmentFamilies.lean @@ -1,525 +1,525 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.RefinementAssignmentActionLaws -import OAI.SetTheory.PartitionPrinciple.Forcing.RelationActionFamilies -import OAI.SetTheory.PartitionPrinciple.Forcing.StageThreeAssignmentTestActions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryUnionFamilies - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) - -theorem refinementAssignment_relationLaws {G P L : Type u} - [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) - (t : Presentation G) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) - (params : StageOneActionParameters M a s t b d T T2 valid) : - RelationActionLaws G (stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T) - (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2) := by - exact ⟨M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 params.terms_closed t - pairing unions powers separation collection carrier order params.condition_maps params.pairs_closed params.family_ground, - M.refinementAssignmentActionGraph_injection a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order params.condition_maps params.terms_closed params.pairs_closed params.family_ground, - fun _ hx => M.refinementAssignmentActionGraph_one a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order params.condition_maps params.terms_closed params.pairs_closed params.family_ground hx, - fun g h _ hx => M.refinementAssignmentActionGraph_mul a s b d level T T2 valid valid2 t - pairing unions powers separation collection carrier order params.condition_maps params.terms_closed params.pairs_closed params.family_ground g h hx⟩ - -variable {G P0 P1 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "J" => stageOneAssignments (I0 ∪ I1) T -local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t - pairing unions powers separation collection carrier0 order0 params0 -local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier1 order1 params1 -include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - -theorem stageTwoAssignmentImage_eq_relationImage (g : G) (A : ZFSet.{u}) : - image g A = relationImage A J (graph g) := by - rw [stageOneAssignments_union] - exact (relationImage_union_graph ((laws0).function g) ((laws1).function g) A).symm - -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -include first second - -theorem stageTwoAssignment_relationLaws : RelationActionLaws G J graph := by - rw [stageOneAssignments_union] - exact (laws0).union (laws1) (stageTwoAssignments_disjoint first second) - -theorem stageTwoAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by - rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] - exact (M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second).image_one subset - -theorem stageTwoAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : - image (g * h) A = image g (image h A) := by - simp only [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] - exact (M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second).image_mul g h subset - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable {G P0 P1 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "J" => stageOneAssignments (I0 ∪ I1) T -local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t - pairing unions powers separation collection carrier0 order0 params0 -local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier1 order1 params1 - -local notation "oldImage" => M.stageOneAssignmentImage a0 s0 b d T T2 v0 v02 -local notation "levels" => stageTwoAssignmentLevels I0 I1 T -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) - -include pairing unions powers separation collection carrier0 order0 params0 first second in -theorem stageTwoAssignmentImage_cut (g : G) (A : ZFSet.{u}) : - assignmentCut levels (natSetCode 1) (image g A) = - oldImage g (assignmentCut levels (natSetCode 1) A) := by - rw [stageTwoAssignmentCut_one first second, stageTwoAssignmentCut_one first second] - change ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) - (relationImage A (stageOneAssignments I0 T) - (M.refinementAssignmentActionGraph a0 s0 b d ∅ T T2 v0 v02 g) ∪ - relationImage A (stageOneAssignments I1 T) - (M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12 g)) = _ - rw [disjointRelationImage_selection (stageTwoAssignments_disjoint first second)] - exact relationImage_source_selection ((laws0).function g) A - -include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second in -theorem stageTwoAssignmentImage_on_old (g : G) {A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments I0 T) : image g A = oldImage g A := by - have only : image g A ⊆ stageOneAssignments I0 T := by - intro z member - rcases ZFSet.mem_union.1 member with left | right - · exact M.refinementAssignmentImage_subset a0 s0 b d ∅ T T2 v0 v02 g A left - · obtain ⟨_,x,hx,entry⟩ := (mem_relationImage A (stageOneAssignments I1 T) - (M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12 g) z).1 right - exact False.elim (stageTwoAssignments_disjoint first second x (subset hx) - (ZFSet.pair_mem_prod.1 (((laws1).function g).1 entry)).1) - rw [← stageTwoAssignmentCut_one_eq first second only, - M.stageTwoAssignmentImage_cut a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 params0 first second, - stageTwoAssignmentCut_one_eq first second subset] - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable {G P0 P1 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "J" => stageOneAssignments (I0 ∪ I1) T -local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t - pairing unions powers separation collection carrier0 order0 params0 -local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier1 order1 params1 - -noncomputable def stageTwoAssignmentActionFamily : ZFSet.{u} := familyCodeGraph t.encode graph - -theorem pair_mem_stageTwoAssignmentActionFamily (g : G) (F : ZFSet.{u}) : - ZFSet.pair (t.encode g) F ∈ M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ↔ - F = graph g := pair_mem_familyCodeGraph _ _ t.injective g F - -include pairing unions powers separation in -theorem stageTwoAssignmentActionFamily_mem - (group : t.carrier ∈ M.sets) - (whole0 : M.refinementAssignmentActionFamily a0 s0 t b d ∅ T T2 v0 v02 ∈ M.sets) - (whole1 : M.refinementAssignmentActionFamily a1 s1 t b d (natSetCode 1) T T2 v1 v12 ∈ M.sets) : - M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ∈ M.sets := - M.familyCodeGraph_binaryUnions_mem t - (M.refinementAssignmentActionGraph a0 s0 b d ∅ T T2 v0 v02) - (M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12) - pairing unions powers separation group whole0 whole1 - -include pairing unions powers separation collection carrier0 carrier1 params0 params1 in -theorem stageTwoAssignmentActionGraph_mem - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (g : G) : graph g ∈ M.sets := by - exact M.binary_union_mem pairing unions - (M.refinementAssignmentActionGraph_mem a0 s0 b d ∅ T T2 v0 v02 t - pairing unions powers separation collection carrier0 params0.condition_maps params0.node_maps - (M.empty_mem ⟨T,hT⟩) hT hT2 hI0 g) - (M.refinementAssignmentActionGraph_mem a1 s1 b d (natSetCode 1) T T2 v1 v12 t - pairing unions powers separation collection carrier1 params1.condition_maps params1.node_maps - (M.transitive omega (natSetCode_mem_omega 1)) hT hT2 hI1 g) - -include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 in -theorem stageTwoAssignmentActionFamily_mem_of_inputs - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ∈ M.sets := by - apply M.stageTwoAssignmentActionFamily_mem a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation group - · exact M.refinementAssignmentActionFamily_mem_of_inputs a0 s0 t b d ∅ T T2 v0 v02 - pairing unions powers separation collection carrier0 group nodes order0 params0.condition_maps params0.node_maps - (M.empty_mem ⟨T,hT⟩) hT hT2 hI0 params0.terms_closed params0.pairs_closed params0.family_ground - · exact M.refinementAssignmentActionFamily_mem_of_inputs a1 s1 t b d (natSetCode 1) T T2 v1 v12 - pairing unions powers separation collection carrier1 group nodes order1 params1.condition_maps params1.node_maps - (M.transitive omega (natSetCode_mem_omega 1)) hT hT2 hI1 params1.terms_closed params1.pairs_closed params1.family_ground - -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) - -include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second in -theorem stageTwoAssignmentImage_small - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} - (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : - image g A ∈ M.groundSmallSubsets J ZFSet.omega := by - obtain ⟨hA,subset,small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member - have hJ := M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions hI0 hI1) hT - have whole := M.stageTwoAssignmentActionGraph_mem a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 carrier1 params0 params1 hT hT2 hI0 hI1 omega g - have laws := M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second - rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] - exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 - ⟨M.relationImage_mem separation hA hJ whole, - fun z hz => ((mem_relationImage A J (graph g) z).1 hz).1, - M.groundEmbeddable_image pairing unions powers separation hA hJ omega whole (laws.injection g) subset small⟩ - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] -variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (a2 : PosetAction G P2) (s2 : Presentation P2) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 -local notation "Jold" => stageOneAssignments (I0 ∪ I1) T -local notation "Jnew" => stageOneAssignments I2 T -local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T -local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 -local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second -local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t - pairing unions powers separation collection carrier2 order2 params2 - -include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second in -theorem stageThreeAssignmentImage_eq_relationImage (g : G) (A : ZFSet.{u}) : - image g A = relationImage A J (graph g) := by - change oldImage g A ∪ newImage g A = _ - rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] - rw [stageOneAssignments_union (I0 ∪ I1) I2 T] - exact (relationImage_union_graph ((oldLaws).function g) ((newLaws).function g) A).symm - -variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) -include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third - -theorem stageThreeAssignment_relationLaws : RelationActionLaws G J graph := by - rw [stageOneAssignments_union (I0 ∪ I1) I2 T] - exact (oldLaws).union (newLaws) (stageThreeAssignments_disjoint first second third) - -theorem stageThreeAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by - rw [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second] - exact (M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third).image_one subset - -theorem stageThreeAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : - image (g * h) A = image g (image h A) := by - simp only [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second] - exact (M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third).image_mul g h subset - -end - -section -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] -variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (a2 : PosetAction G P2) (s2 : Presentation P2) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 -local notation "Jold" => stageOneAssignments (I0 ∪ I1) T -local notation "Jnew" => stageOneAssignments I2 T -local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T -local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 -local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second -local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t - pairing unions powers separation collection carrier2 order2 params2 - -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) - -include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - first second third in -theorem stageThreeAssignmentImage_cut (g : G) (A : ZFSet.{u}) : - assignmentCut levels (natSetCode 2) (image g A) = - oldImage g (assignmentCut levels (natSetCode 2) A) := by - rw [stageThreeAssignmentCut_two first second third, stageThreeAssignmentCut_two first second third] - change ZFSet.sep (fun z => z ∈ Jold) (oldImage g A ∪ newImage g A) = _ - simp only [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] - change ZFSet.sep (fun z => z ∈ Jold) - (relationImage A Jold (oldGraph g) ∪ relationImage A Jnew (newGraph g)) = _ - rw [disjointRelationImage_selection (stageThreeAssignments_disjoint first second third)] - exact relationImage_source_selection ((oldLaws).function g) A - -include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third in -theorem stageThreeAssignmentImage_on_old (g : G) {A : ZFSet.{u}} - (subset : A ⊆ Jold) : image g A = oldImage g A := by - have only : image g A ⊆ Jold := by - intro z member - rcases ZFSet.mem_union.1 member with old | new - · exact M.stageTwoAssignmentImage_subset a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A old - · obtain ⟨_,x,hx,entry⟩ := (mem_relationImage A Jnew (newGraph g) z).1 new - exact False.elim (stageThreeAssignments_disjoint first second third x (subset hx) - (ZFSet.pair_mem_prod.1 (((newLaws).function g).1 entry)).1) - rw [← stageThreeAssignmentCut_two_eq first second third only, - M.stageThreeAssignmentImage_cut a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second third, - stageThreeAssignmentCut_two_eq first second third subset] - -end - -open SetFormula SetRealization -universe u -variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] -variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) -variable (a2 : PosetAction G P2) (s2 : Presentation P2) -variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) -variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) -variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) -variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) -variable (t : Presentation G) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) -variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) -variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) -variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) -variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) -variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) -local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 -local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 -local notation "Jold" => stageOneAssignments (I0 ∪ I1) T -local notation "Jnew" => stageOneAssignments I2 T -local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T -local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 -local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 -local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 -local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 -variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) -variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) -local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second -local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t - pairing unions powers separation collection carrier2 order2 params2 - -noncomputable def stageThreeAssignmentActionFamily : ZFSet.{u} := familyCodeGraph t.encode graph - -theorem pair_mem_stageThreeAssignmentActionFamily (g : G) (F : ZFSet.{u}) : - ZFSet.pair (t.encode g) F ∈ M.stageThreeAssignmentActionFamily - a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t ↔ F = graph g := - pair_mem_familyCodeGraph _ _ t.injective g F - -include pairing unions powers separation in -theorem stageThreeAssignmentActionFamily_mem - (group : t.carrier ∈ M.sets) - (wholeOld : M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ∈ M.sets) - (wholeNew : M.refinementAssignmentActionFamily a2 s2 t b d (natSetCode 2) T T2 v2 v22 ∈ M.sets) : - M.stageThreeAssignmentActionFamily a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t ∈ M.sets := - M.familyCodeGraph_binaryUnions_mem t oldGraph newGraph - pairing unions powers separation group wholeOld wholeNew - -include pairing unions powers separation collection carrier0 carrier1 carrier2 params0 params1 params2 in -theorem stageThreeAssignmentActionGraph_mem - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (g : G) : graph g ∈ M.sets := - M.binary_union_mem pairing unions - (M.stageTwoAssignmentActionGraph_mem a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 carrier1 params0 params1 hT hT2 hI0 hI1 omega g) - (M.refinementAssignmentActionGraph_mem a2 s2 b d (natSetCode 2) T T2 v2 v22 t - pairing unions powers separation collection carrier2 params2.condition_maps params2.node_maps - (M.transitive omega (natSetCode_mem_omega 2)) hT hT2 hI2 g) - -include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 in -theorem stageThreeAssignmentActionFamily_mem_of_inputs - (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.stageThreeAssignmentActionFamily a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t ∈ M.sets := by - apply M.stageThreeAssignmentActionFamily_mem a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation group - · exact M.stageTwoAssignmentActionFamily_mem_of_inputs a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 - group nodes hT hT2 hI0 hI1 omega - · exact M.refinementAssignmentActionFamily_mem_of_inputs a2 s2 t b d (natSetCode 2) T T2 v2 v22 - pairing unions powers separation collection carrier2 group nodes order2 params2.condition_maps params2.node_maps - (M.transitive omega (natSetCode_mem_omega 2)) hT hT2 hI2 - params2.terms_closed params2.pairs_closed params2.family_ground - -variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) -include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third in -theorem stageThreeAssignmentImage_small - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} - (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : - image g A ∈ M.groundSmallSubsets J ZFSet.omega := by - obtain ⟨hA,subset,small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member - have hJ := M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) hT - have whole := M.stageThreeAssignmentActionGraph_mem a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 carrier1 carrier2 params0 params1 params2 - hT hT2 hI0 hI1 hI2 omega g - have laws := M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second third - rw [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t - pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 - params0 params1 params2 first second] - exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 - ⟨M.relationImage_mem separation hA hJ whole, - fun z hz => ((mem_relationImage A J (graph g) z).1 hz).1, - M.groundEmbeddable_image pairing unions powers separation hA hJ omega whole (laws.injection g) subset small⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.RefinementAssignmentActionLaws +import OAI.SetTheory.PartitionPrinciple.Forcing.RelationActionFamilies +import OAI.SetTheory.PartitionPrinciple.Forcing.StageThreeAssignmentTestActions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBinaryUnionFamilies + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) + +theorem refinementAssignment_relationLaws {G P L : Type u} + [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + (level T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) (valid2 : ∀ z ∈ T2, IsName s z) + (t : Presentation G) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) + (params : StageOneActionParameters M a s t b d T T2 valid) : + RelationActionLaws G (stageOneAssignments (M.niceRefinementIndices a s b d level T T2 valid) T) + (M.refinementAssignmentActionGraph a s b d level T T2 valid valid2) := by + exact ⟨M.refinementAssignmentActionGraph_function a s b d level T T2 valid valid2 params.terms_closed t + pairing unions powers separation collection carrier order params.condition_maps params.pairs_closed params.family_ground, + M.refinementAssignmentActionGraph_injection a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order params.condition_maps params.terms_closed params.pairs_closed params.family_ground, + fun _ hx => M.refinementAssignmentActionGraph_one a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order params.condition_maps params.terms_closed params.pairs_closed params.family_ground hx, + fun g h _ hx => M.refinementAssignmentActionGraph_mul a s b d level T T2 valid valid2 t + pairing unions powers separation collection carrier order params.condition_maps params.terms_closed params.pairs_closed params.family_ground g h hx⟩ + +variable {G P0 P1 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "J" => stageOneAssignments (I0 ∪ I1) T +local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t + pairing unions powers separation collection carrier0 order0 params0 +local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier1 order1 params1 +include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + +theorem stageTwoAssignmentImage_eq_relationImage (g : G) (A : ZFSet.{u}) : + image g A = relationImage A J (graph g) := by + rw [stageOneAssignments_union] + exact (relationImage_union_graph ((laws0).function g) ((laws1).function g) A).symm + +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +include first second + +theorem stageTwoAssignment_relationLaws : RelationActionLaws G J graph := by + rw [stageOneAssignments_union] + exact (laws0).union (laws1) (stageTwoAssignments_disjoint first second) + +theorem stageTwoAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by + rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] + exact (M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second).image_one subset + +theorem stageTwoAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : + image (g * h) A = image g (image h A) := by + simp only [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] + exact (M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second).image_mul g h subset + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable {G P0 P1 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "J" => stageOneAssignments (I0 ∪ I1) T +local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t + pairing unions powers separation collection carrier0 order0 params0 +local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier1 order1 params1 + +local notation "oldImage" => M.stageOneAssignmentImage a0 s0 b d T T2 v0 v02 +local notation "levels" => stageTwoAssignmentLevels I0 I1 T +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) + +include pairing unions powers separation collection carrier0 order0 params0 first second in +theorem stageTwoAssignmentImage_cut (g : G) (A : ZFSet.{u}) : + assignmentCut levels (natSetCode 1) (image g A) = + oldImage g (assignmentCut levels (natSetCode 1) A) := by + rw [stageTwoAssignmentCut_one first second, stageTwoAssignmentCut_one first second] + change ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) + (relationImage A (stageOneAssignments I0 T) + (M.refinementAssignmentActionGraph a0 s0 b d ∅ T T2 v0 v02 g) ∪ + relationImage A (stageOneAssignments I1 T) + (M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12 g)) = _ + rw [disjointRelationImage_selection (stageTwoAssignments_disjoint first second)] + exact relationImage_source_selection ((laws0).function g) A + +include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second in +theorem stageTwoAssignmentImage_on_old (g : G) {A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments I0 T) : image g A = oldImage g A := by + have only : image g A ⊆ stageOneAssignments I0 T := by + intro z member + rcases ZFSet.mem_union.1 member with left | right + · exact M.refinementAssignmentImage_subset a0 s0 b d ∅ T T2 v0 v02 g A left + · obtain ⟨_,x,hx,entry⟩ := (mem_relationImage A (stageOneAssignments I1 T) + (M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12 g) z).1 right + exact False.elim (stageTwoAssignments_disjoint first second x (subset hx) + (ZFSet.pair_mem_prod.1 (((laws1).function g).1 entry)).1) + rw [← stageTwoAssignmentCut_one_eq first second only, + M.stageTwoAssignmentImage_cut a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 params0 first second, + stageTwoAssignmentCut_one_eq first second subset] + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable {G P0 P1 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "J" => stageOneAssignments (I0 ∪ I1) T +local notation "graph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "image" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "laws0" => M.refinementAssignment_relationLaws a0 s0 b d ∅ T T2 v0 v02 t + pairing unions powers separation collection carrier0 order0 params0 +local notation "laws1" => M.refinementAssignment_relationLaws a1 s1 b d (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier1 order1 params1 + +noncomputable def stageTwoAssignmentActionFamily : ZFSet.{u} := familyCodeGraph t.encode graph + +theorem pair_mem_stageTwoAssignmentActionFamily (g : G) (F : ZFSet.{u}) : + ZFSet.pair (t.encode g) F ∈ M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ↔ + F = graph g := pair_mem_familyCodeGraph _ _ t.injective g F + +include pairing unions powers separation in +theorem stageTwoAssignmentActionFamily_mem + (group : t.carrier ∈ M.sets) + (whole0 : M.refinementAssignmentActionFamily a0 s0 t b d ∅ T T2 v0 v02 ∈ M.sets) + (whole1 : M.refinementAssignmentActionFamily a1 s1 t b d (natSetCode 1) T T2 v1 v12 ∈ M.sets) : + M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ∈ M.sets := + M.familyCodeGraph_binaryUnions_mem t + (M.refinementAssignmentActionGraph a0 s0 b d ∅ T T2 v0 v02) + (M.refinementAssignmentActionGraph a1 s1 b d (natSetCode 1) T T2 v1 v12) + pairing unions powers separation group whole0 whole1 + +include pairing unions powers separation collection carrier0 carrier1 params0 params1 in +theorem stageTwoAssignmentActionGraph_mem + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (g : G) : graph g ∈ M.sets := by + exact M.binary_union_mem pairing unions + (M.refinementAssignmentActionGraph_mem a0 s0 b d ∅ T T2 v0 v02 t + pairing unions powers separation collection carrier0 params0.condition_maps params0.node_maps + (M.empty_mem ⟨T,hT⟩) hT hT2 hI0 g) + (M.refinementAssignmentActionGraph_mem a1 s1 b d (natSetCode 1) T T2 v1 v12 t + pairing unions powers separation collection carrier1 params1.condition_maps params1.node_maps + (M.transitive omega (natSetCode_mem_omega 1)) hT hT2 hI1 g) + +include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 in +theorem stageTwoAssignmentActionFamily_mem_of_inputs + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ∈ M.sets := by + apply M.stageTwoAssignmentActionFamily_mem a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation group + · exact M.refinementAssignmentActionFamily_mem_of_inputs a0 s0 t b d ∅ T T2 v0 v02 + pairing unions powers separation collection carrier0 group nodes order0 params0.condition_maps params0.node_maps + (M.empty_mem ⟨T,hT⟩) hT hT2 hI0 params0.terms_closed params0.pairs_closed params0.family_ground + · exact M.refinementAssignmentActionFamily_mem_of_inputs a1 s1 t b d (natSetCode 1) T T2 v1 v12 + pairing unions powers separation collection carrier1 group nodes order1 params1.condition_maps params1.node_maps + (M.transitive omega (natSetCode_mem_omega 1)) hT hT2 hI1 params1.terms_closed params1.pairs_closed params1.family_ground + +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) + +include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second in +theorem stageTwoAssignmentImage_small + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} + (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : + image g A ∈ M.groundSmallSubsets J ZFSet.omega := by + obtain ⟨hA,subset,small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member + have hJ := M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions hI0 hI1) hT + have whole := M.stageTwoAssignmentActionGraph_mem a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 carrier1 params0 params1 hT hT2 hI0 hI1 omega g + have laws := M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second + rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] + exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 + ⟨M.relationImage_mem separation hA hJ whole, + fun z hz => ((mem_relationImage A J (graph g) z).1 hz).1, + M.groundEmbeddable_image pairing unions powers separation hA hJ omega whole (laws.injection g) subset small⟩ + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] +variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (a2 : PosetAction G P2) (s2 : Presentation P2) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 +local notation "Jold" => stageOneAssignments (I0 ∪ I1) T +local notation "Jnew" => stageOneAssignments I2 T +local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T +local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 +local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second +local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t + pairing unions powers separation collection carrier2 order2 params2 + +include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second in +theorem stageThreeAssignmentImage_eq_relationImage (g : G) (A : ZFSet.{u}) : + image g A = relationImage A J (graph g) := by + change oldImage g A ∪ newImage g A = _ + rw [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] + rw [stageOneAssignments_union (I0 ∪ I1) I2 T] + exact (relationImage_union_graph ((oldLaws).function g) ((newLaws).function g) A).symm + +variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) +include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third + +theorem stageThreeAssignment_relationLaws : RelationActionLaws G J graph := by + rw [stageOneAssignments_union (I0 ∪ I1) I2 T] + exact (oldLaws).union (newLaws) (stageThreeAssignments_disjoint first second third) + +theorem stageThreeAssignmentImage_one {A : ZFSet.{u}} (subset : A ⊆ J) : image 1 A = A := by + rw [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second] + exact (M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third).image_one subset + +theorem stageThreeAssignmentImage_mul (g h : G) {A : ZFSet.{u}} (subset : A ⊆ J) : + image (g * h) A = image g (image h A) := by + simp only [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second] + exact (M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third).image_mul g h subset + +end + +section +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] +variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (a2 : PosetAction G P2) (s2 : Presentation P2) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 +local notation "Jold" => stageOneAssignments (I0 ∪ I1) T +local notation "Jnew" => stageOneAssignments I2 T +local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T +local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 +local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second +local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t + pairing unions powers separation collection carrier2 order2 params2 + +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) + +include pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + first second third in +theorem stageThreeAssignmentImage_cut (g : G) (A : ZFSet.{u}) : + assignmentCut levels (natSetCode 2) (image g A) = + oldImage g (assignmentCut levels (natSetCode 2) A) := by + rw [stageThreeAssignmentCut_two first second third, stageThreeAssignmentCut_two first second third] + change ZFSet.sep (fun z => z ∈ Jold) (oldImage g A ∪ newImage g A) = _ + simp only [M.stageTwoAssignmentImage_eq_relationImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1] + change ZFSet.sep (fun z => z ∈ Jold) + (relationImage A Jold (oldGraph g) ∪ relationImage A Jnew (newGraph g)) = _ + rw [disjointRelationImage_selection (stageThreeAssignments_disjoint first second third)] + exact relationImage_source_selection ((oldLaws).function g) A + +include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third in +theorem stageThreeAssignmentImage_on_old (g : G) {A : ZFSet.{u}} + (subset : A ⊆ Jold) : image g A = oldImage g A := by + have only : image g A ⊆ Jold := by + intro z member + rcases ZFSet.mem_union.1 member with old | new + · exact M.stageTwoAssignmentImage_subset a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 g A old + · obtain ⟨_,x,hx,entry⟩ := (mem_relationImage A Jnew (newGraph g) z).1 new + exact False.elim (stageThreeAssignments_disjoint first second third x (subset hx) + (ZFSet.pair_mem_prod.1 (((newLaws).function g).1 entry)).1) + rw [← stageThreeAssignmentCut_two_eq first second third only, + M.stageThreeAssignmentImage_cut a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second third, + stageThreeAssignmentCut_two_eq first second third subset] + +end + +open SetFormula SetRealization +universe u +variable (M : TransitiveGround.{u}) {G P0 P1 P2 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] +variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable (a0 : PosetAction G P0) (s0 : Presentation P0) (a1 : PosetAction G P1) (s1 : Presentation P1) +variable (a2 : PosetAction G P2) (s2 : Presentation P2) +variable (b : Presentation L) (d : PosetAction G L) (T T2 : ZFSet.{u}) +variable (v0 : ∀ z ∈ T, IsName s0 z) (v02 : ∀ z ∈ T2, IsName s0 z) +variable (v1 : ∀ z ∈ T, IsName s1 z) (v12 : ∀ z ∈ T2, IsName s1 z) +variable (v2 : ∀ z ∈ T, IsName s2 z) (v22 : ∀ z ∈ T2, IsName s2 z) +variable (t : Presentation G) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier0 : s0.carrier ∈ M.sets) (order0 : s0.conditionOrder ∈ M.sets) +variable (carrier1 : s1.carrier ∈ M.sets) (order1 : s1.conditionOrder ∈ M.sets) +variable (carrier2 : s2.carrier ∈ M.sets) (order2 : s2.conditionOrder ∈ M.sets) +variable (params0 : StageOneActionParameters M a0 s0 t b d T T2 v0) +variable (params1 : StageOneActionParameters M a1 s1 t b d T T2 v1) +variable (params2 : StageOneActionParameters M a2 s2 t b d T T2 v2) +local notation "I0" => M.niceRefinementIndices a0 s0 b d ∅ T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1 +local notation "I2" => M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2 +local notation "Jold" => stageOneAssignments (I0 ∪ I1) T +local notation "Jnew" => stageOneAssignments I2 T +local notation "J" => stageOneAssignments ((I0 ∪ I1) ∪ I2) T +local notation "graph" => M.stageThreeAssignmentActionGraph a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "image" => M.stageThreeAssignmentImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 +local notation "oldGraph" => M.stageTwoAssignmentActionGraph a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "oldImage" => M.stageTwoAssignmentImage a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 +local notation "newGraph" => M.refinementAssignmentActionGraph a2 s2 b d (natSetCode 2) T T2 v2 v22 +local notation "newImage" => M.refinementAssignmentImage a2 s2 b d (natSetCode 2) T T2 v2 v22 +variable (first : RefinementIndexLevelCode (M.niceRefinementIndices a0 s0 b d ∅ T T2 v0) ∅) +variable (second : RefinementIndexLevelCode (M.niceRefinementIndices a1 s1 b d (natSetCode 1) T T2 v1) (natSetCode 1)) +local notation "oldLaws" => M.stageTwoAssignment_relationLaws a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 first second +local notation "newLaws" => M.refinementAssignment_relationLaws a2 s2 b d (natSetCode 2) T T2 v2 v22 t + pairing unions powers separation collection carrier2 order2 params2 + +noncomputable def stageThreeAssignmentActionFamily : ZFSet.{u} := familyCodeGraph t.encode graph + +theorem pair_mem_stageThreeAssignmentActionFamily (g : G) (F : ZFSet.{u}) : + ZFSet.pair (t.encode g) F ∈ M.stageThreeAssignmentActionFamily + a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t ↔ F = graph g := + pair_mem_familyCodeGraph _ _ t.injective g F + +include pairing unions powers separation in +theorem stageThreeAssignmentActionFamily_mem + (group : t.carrier ∈ M.sets) + (wholeOld : M.stageTwoAssignmentActionFamily a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t ∈ M.sets) + (wholeNew : M.refinementAssignmentActionFamily a2 s2 t b d (natSetCode 2) T T2 v2 v22 ∈ M.sets) : + M.stageThreeAssignmentActionFamily a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t ∈ M.sets := + M.familyCodeGraph_binaryUnions_mem t oldGraph newGraph + pairing unions powers separation group wholeOld wholeNew + +include pairing unions powers separation collection carrier0 carrier1 carrier2 params0 params1 params2 in +theorem stageThreeAssignmentActionGraph_mem + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (g : G) : graph g ∈ M.sets := + M.binary_union_mem pairing unions + (M.stageTwoAssignmentActionGraph_mem a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 carrier1 params0 params1 hT hT2 hI0 hI1 omega g) + (M.refinementAssignmentActionGraph_mem a2 s2 b d (natSetCode 2) T T2 v2 v22 t + pairing unions powers separation collection carrier2 params2.condition_maps params2.node_maps + (M.transitive omega (natSetCode_mem_omega 2)) hT hT2 hI2 g) + +include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 in +theorem stageThreeAssignmentActionFamily_mem_of_inputs + (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.stageThreeAssignmentActionFamily a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t ∈ M.sets := by + apply M.stageThreeAssignmentActionFamily_mem a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation group + · exact M.stageTwoAssignmentActionFamily_mem_of_inputs a0 s0 a1 s1 b d T T2 v0 v02 v1 v12 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 params0 params1 + group nodes hT hT2 hI0 hI1 omega + · exact M.refinementAssignmentActionFamily_mem_of_inputs a2 s2 t b d (natSetCode 2) T T2 v2 v22 + pairing unions powers separation collection carrier2 group nodes order2 params2.condition_maps params2.node_maps + (M.transitive omega (natSetCode_mem_omega 2)) hT hT2 hI2 + params2.terms_closed params2.pairs_closed params2.family_ground + +variable (third : RefinementIndexLevelCode (M.niceRefinementIndices a2 s2 b d (natSetCode 2) T T2 v2) (natSetCode 2)) +include pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third in +theorem stageThreeAssignmentImage_small + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) (hI2 : I2 ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (g : G) {A : ZFSet.{u}} + (member : A ∈ M.groundSmallSubsets J ZFSet.omega) : + image g A ∈ M.groundSmallSubsets J ZFSet.omega := by + obtain ⟨hA,subset,small⟩ := (M.mem_groundSmallSubsets J ZFSet.omega A).1 member + have hJ := M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) hI2) hT + have whole := M.stageThreeAssignmentActionGraph_mem a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 carrier1 carrier2 params0 params1 params2 + hT hT2 hI0 hI1 hI2 omega g + have laws := M.stageThreeAssignment_relationLaws a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second third + rw [M.stageThreeAssignmentImage_eq_relationImage a0 s0 a1 s1 a2 s2 b d T T2 v0 v02 v1 v12 v2 v22 t + pairing unions powers separation collection carrier0 order0 carrier1 order1 carrier2 order2 + params0 params1 params2 first second] + exact (M.mem_groundSmallSubsets J ZFSet.omega _).2 + ⟨M.relationImage_mem separation hA hJ whole, + fun z hz => ((mem_relationImage A J (graph g) z).1 hz).1, + M.groundEmbeddable_image pairing unions powers separation hA hJ omega whole (laws.injection g) subset small⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeClosureData.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeClosureData.lean index 573f2f44c20ed3d24942f138ddbab1eae4ef30c5..0d8173fcfe280d44e14d435a8734b90d41812735 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeClosureData.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeClosureData.lean @@ -1,488 +1,488 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageTwoNameLifting - -namespace OAI - -namespace PartitionPilot.Forcing - -section -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageThreeCarrierData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - name_lifting : StageTwoNameLiftingData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - construction : - let actionData := name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - let Q3 := M.stageThreeForcing c.carrier I0 I1 action pres nodes d T T2 next2.valid1 - ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, - T2 = orderedPairNameFamily (pres.encode ⊤) T T ∧ - (∀ n : Nat, iteratedPairNameFamily (pres.encode ⊤) T n = - iteratedPairNameFamily (s.encode ⊤) T n) ∧ - (∀ C E (U Rf Rc : (M.nameDomain pres).names), - refinementIndexCode (natSetCode 2) (nodes.encode C) (nodes.encode E) - U.val.val Rf.val.val Rc.val.val ∈ I2 → - RefinementObjectSystem M action pres (d.principalSupportFamily base directed) - (d.principalFix C) T next2.valid1 U.val Rf.val Rc.val) ∧ - (((I0 ∪ I1) ∪ I2) ∈ M.sets ∧ - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ∈ M.sets ∧ - levels ∈ M.sets ∧ - ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) (natSetCode 3) - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) ∧ - ZFSet.IsFunc (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (natSetCode 3) levels ∧ - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 = - (ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1}) ∪ ZFSet.prod I2 {natSetCode 2} ∧ - levels = (ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ - ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1}) ∪ - ZFSet.prod (stageOneAssignments I2 T) {natSetCode 2} ∧ - (∀ x, ¬ (x ∈ I0 ∧ x ∈ I1)) ∧ (∀ x, ¬ (x ∈ I0 ∧ x ∈ I2)) ∧ - (∀ x, ¬ (x ∈ I1 ∧ x ∈ I2))) ∧ - (∀ A, assignmentCut levels (natSetCode 1) A = - ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) A) ∧ - (∀ A, assignmentCut levels (natSetCode 2) A = - ZFSet.sep (fun z => z ∈ stageOneAssignments (I0 ∪ I1) T) A) ∧ - (∀ A, assignmentCut levels (natSetCode 1) (assignmentCut levels (natSetCode 2) A) = - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A) ∧ - (∀ Aq Ap, Aq ⊆ stageOneAssignments (I0 ∪ I1) T → - assignmentCut levels (natSetCode 2) (assignmentSplice levels (natSetCode 2) Aq Ap) = Aq) ∧ - Q3 ∈ M.sets ∧ - ZFSet.pair (c.encode ⊤) ∅ ∈ Q3 ∧ - (∀ row ∈ c.carrier, ZFSet.pair row ∅ ∈ pres.carrier → ZFSet.pair row ∅ ∈ Q3) ∧ - (∀ row A, ZFSet.pair row A ∈ Q3 ↔ - row ∈ c.carrier ∧ A ∈ M.groundSmallSubsets - (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ - ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∈ pres.carrier ∧ - stageOneRawTests M (M.refinementLevelFormulaData action pres nodes d - (natSetCode 2) T T2 next2.valid1) A (ZFSet.pair row (assignmentCut levels (natSetCode 2) A))) ∧ - (∀ row A, ZFSet.pair row A ∈ Q3 ↔ - row ∈ c.carrier ∧ A ∈ M.groundSmallSubsets - (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ - ∃ lower : Shrink Condition, pres.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∧ - M.refinementLevelTests pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 - action nodes d base directed next2.first (natSetCode 2) T2 A lower) - -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (M : TransitiveGround.{u}) -theorem stageThreeCarrierData - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (prior : StageTwoNameLiftingData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used) - (hT2 : T2 ∈ M.sets) - (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (group : actors.carrier ∈ M.sets) (nodeAction : d.actionGraph nodes actors ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - StageThreeCarrierData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used := by - let actionData := prior.support_data.action_data - let data := actionData.closure_data.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - let first := actionData.closure_data.projection_data.first_level - let second := next.indices.levelCode - let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first - obtain ⟨F, hNodes, inputs, _, _, _, maps, _⟩ := actionData.actions - let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs - have hCarrier : pres.carrier ∈ M.sets := data.carrier_ground - have hOrder : pres.conditionOrder ∈ M.sets := - M.stageTwoConditionOrder_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first - rows hI0 rowOrder nodeOrder (M.omega_mem separation infinite) - have supports := M.principalSupportBasis_mem d nodes actors pairing unions powers separation - hNodes group nodeOrder nodeAction - have next2 := M.stageTwoRefinementStageSystem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs - infinite choice hI0 next.indices.index_ground actors next.inputs hT2 rows rowOrder nodeOrder - group maps supports next.terms_hs next.pairs_hs - refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · rw [M.stageTwo_orderedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second] - exact data.index_data.square - · exact M.stageTwo_iteratedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T - · exact M.stageTwoRefinementObjects c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs - infinite hI0 actors next2 hT2 rows rowOrder nodeOrder - · exact M.stageThreeLevelData pairing unions powers separation hI0 next.indices.index_ground - next2.indices.index_ground data.terms_ground first second next2.indices.levelCode - · exact stageThreeAssignmentCut_one first second next2.indices.levelCode - · exact stageThreeAssignmentCut_two first second next2.indices.levelCode - · intro A - rw [stageThreeAssignmentCut_one_old first second next2.indices.levelCode, - stageThreeAssignmentCut_nested first second next2.indices.levelCode, - stageThreeAssignmentCut_one_old first second next2.indices.levelCode] - · intro Aq Ap old - exact stageThreeAssignmentSplice_lower_eq first second next2.indices.levelCode Ap old - · exact M.stageThreeForcing_mem c.carrier I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation rows hI0 next.indices.index_ground data.terms_ground - hCarrier hOrder hNodes nodeOrder next2.valid2 next2.indices base directed next2.first - (M.omega_mem separation infinite) - · exact M.stageThreeForcing_empty c.carrier I0 I1 action pres nodes d T T2 next2.valid1 - rows (c.encode_mem ⊤) data.empty_top - · intro row member lower - exact M.stageThreeForcing_empty c.carrier I0 I1 action pres nodes d T T2 next2.valid1 - rows member lower - · exact M.stageThreeForcing_raw_entry c.carrier I0 I1 action pres nodes d T T2 next2.valid1 - · exact M.stageThreeForcing_entry c.carrier I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageThreeProjectionData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - carrier_data : StageThreeCarrierData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - projections : - let actionData := carrier_data.name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - let Q3 := M.stageThreeForcing c.carrier I0 I1 action pres nodes d T T2 next2.valid1 - ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, - let tests := M.refinementLevelTests pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 - action nodes d base directed next2.first (natSetCode 2) T2 - let Condition3 := FlatSuccessorCondition M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 action nodes d base directed next2.first - actionData.closure_data.projection_data.first_level next.indices.levelCode next2.indices.levelCode - letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - letI := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let restriction := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 - let inclusion := M.flatSuccessorSmallInclusion c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - pres3.carrier = Q3 ∧ pres3.carrier ∈ M.sets ∧ - pres3.conditionOrder = rowAssignmentOrder pres3.carrier c.carrier - (M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega) c.conditionOrder ∧ - pres3.conditionOrder ∈ M.sets ∧ pres3.encode ⊤ = pres.encode ⊤ ∧ - CompleteProjection restriction inclusion ∧ - (∀ q : Shrink Condition, pres3.encode (inclusion q) = pres.encode q) ∧ - (∀ p : Shrink Condition3, pres.encode (restriction p) = - ZFSet.pair (c.encode ((equivShrink Condition3).symm p).row) - (assignmentCut levels (natSetCode 2) ((equivShrink Condition3).symm p).assignments)) ∧ - pres3.graph pres restriction = rowAssignmentCutGraph pres3.carrier pres.carrier levels (natSetCode 2) ∧ - pres3.graph pres restriction ∈ M.sets - -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (M : TransitiveGround.{u}) -theorem stageThreeProjectionData - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (prior : StageThreeCarrierData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used) - (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - StageThreeProjectionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used := by - let actionData := prior.name_lifting.support_data.action_data - let data := actionData.closure_data.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - let first := actionData.closure_data.projection_data.first_level - let second := next.indices.levelCode - let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first - obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _⟩ := prior.construction - let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder - data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first - let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection - hCarrier hOrder data.terms_ground next2.valid1 action nodes d base directed next2.first - first second next2.indices.levelCode - let := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - have omega := M.omega_mem separation infinite - refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact M.stageThreeFlatPresentation_carrier c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first - · exact M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder omega - · exact M.flatSuccessorConditionOrder_eq c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - · exact M.stageThreeFlatOrder_mem c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first rows hI0 next.indices.index_ground rowOrder nodeOrder omega - · exact M.flatSuccessorPresentation_top c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - · exact M.flatSuccessorSmallCompleteProjection c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - pairing unions powers separation infinite choice - (M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 next.indices.index_ground - next2.indices.index_ground data.terms_ground) - (M.transitive omega (natSetCode_mem_omega 2)) - · exact M.flatSuccessorSmallInclusion_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws - · exact M.flatSuccessorSmallRestriction_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 - · rw [M.stageThreeFlatPresentation_carrier c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first] - exact M.stageThreeSmallRestriction_graph c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first F2 - · exact M.stageThreeSmallRestriction_graph_mem c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first F2 rows hI0 next.indices.index_ground nodeOrder omega - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageThreeClosureData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - projection_data : StageThreeProjectionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used - closed : - let actionData := projection_data.carrier_data.name_lifting.support_data.action_data - let prior := actionData.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level - next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs - ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, - let tests := M.refinementLevelTests pres pairing unions powers separation collection - hCarrier hOrder prior.terms_ground next2.valid1 - action nodes d base directed next2.first (natSetCode 2) T2 - let Condition3 := FlatSuccessorCondition M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first - letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - let restriction := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 - InternallyCountablyClosed M pres3 ∧ - (∀ seq : Nat → Shrink Condition3, - natPresentation.graph pres3 (fun n => seq n.down) ∈ M.sets → Antitone seq → - ∃ q : Shrink Condition, (∀ n, q ≤ restriction (seq n)) ∧ ∃ p : Shrink Condition3, - ((equivShrink Condition3).symm p).lower = q ∧ - ((equivShrink Condition3).symm p).assignments = - assignmentSplice levels (natSetCode 2) (F2.assignments q) - (stageOneAssignmentUnion (fun n => ((equivShrink Condition3).symm (seq n)).assignments)) ∧ - ∀ n, p ≤ seq n) - -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (M : TransitiveGround.{u}) -theorem stageThreeClosureData - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (prior : StageThreeProjectionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used) - (rows : c.carrier ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - StageThreeClosureData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection S mu X tuples used := by - let actionData := prior.carrier_data.name_lifting.support_data.action_data - let data := actionData.closure_data.projection_data.carrier_data - let next := data.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid actionData.valid2 next.valid1 next.valid2 - let first := actionData.closure_data.projection_data.first_level - let second := next.indices.levelCode - let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first - obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _⟩ := prior.projections - let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first - let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs - let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 - let levels := stageThreeAssignmentLevels I0 I1 I2 T - let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder - data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 - let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first - obtain ⟨_, lowerClosed⟩ := actionData.closure_data.closed - refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ?_, ?_⟩ - · exact M.stageThreeCondition_internally_closed c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first F2 first second infinite choice rows hI0 - next.indices.index_ground nodeOrder lowerClosed - · exact M.stageThreeCondition_lower_bound c I0 I1 action pres nodes d T T2 next2.valid1 - pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground - next2.indices base directed next2.first F2 first second infinite choice rows hI0 - next.indices.index_ground nodeOrder lowerClosed - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundMainFinalStageTwoNameLifting + +namespace OAI + +namespace PartitionPilot.Forcing + +section +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageThreeCarrierData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + name_lifting : StageTwoNameLiftingData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + construction : + let actionData := name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + let Q3 := M.stageThreeForcing c.carrier I0 I1 action pres nodes d T T2 next2.valid1 + ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, + T2 = orderedPairNameFamily (pres.encode ⊤) T T ∧ + (∀ n : Nat, iteratedPairNameFamily (pres.encode ⊤) T n = + iteratedPairNameFamily (s.encode ⊤) T n) ∧ + (∀ C E (U Rf Rc : (M.nameDomain pres).names), + refinementIndexCode (natSetCode 2) (nodes.encode C) (nodes.encode E) + U.val.val Rf.val.val Rc.val.val ∈ I2 → + RefinementObjectSystem M action pres (d.principalSupportFamily base directed) + (d.principalFix C) T next2.valid1 U.val Rf.val Rc.val) ∧ + (((I0 ∪ I1) ∪ I2) ∈ M.sets ∧ + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 ∈ M.sets ∧ + levels ∈ M.sets ∧ + ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) (natSetCode 3) + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0) ∧ + ZFSet.IsFunc (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) (natSetCode 3) levels ∧ + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) (natSetCode 3) 0 = + (ZFSet.prod I0 {∅} ∪ ZFSet.prod I1 {natSetCode 1}) ∪ ZFSet.prod I2 {natSetCode 2} ∧ + levels = (ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ + ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1}) ∪ + ZFSet.prod (stageOneAssignments I2 T) {natSetCode 2} ∧ + (∀ x, ¬ (x ∈ I0 ∧ x ∈ I1)) ∧ (∀ x, ¬ (x ∈ I0 ∧ x ∈ I2)) ∧ + (∀ x, ¬ (x ∈ I1 ∧ x ∈ I2))) ∧ + (∀ A, assignmentCut levels (natSetCode 1) A = + ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) A) ∧ + (∀ A, assignmentCut levels (natSetCode 2) A = + ZFSet.sep (fun z => z ∈ stageOneAssignments (I0 ∪ I1) T) A) ∧ + (∀ A, assignmentCut levels (natSetCode 1) (assignmentCut levels (natSetCode 2) A) = + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A) ∧ + (∀ Aq Ap, Aq ⊆ stageOneAssignments (I0 ∪ I1) T → + assignmentCut levels (natSetCode 2) (assignmentSplice levels (natSetCode 2) Aq Ap) = Aq) ∧ + Q3 ∈ M.sets ∧ + ZFSet.pair (c.encode ⊤) ∅ ∈ Q3 ∧ + (∀ row ∈ c.carrier, ZFSet.pair row ∅ ∈ pres.carrier → ZFSet.pair row ∅ ∈ Q3) ∧ + (∀ row A, ZFSet.pair row A ∈ Q3 ↔ + row ∈ c.carrier ∧ A ∈ M.groundSmallSubsets + (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ + ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∈ pres.carrier ∧ + stageOneRawTests M (M.refinementLevelFormulaData action pres nodes d + (natSetCode 2) T T2 next2.valid1) A (ZFSet.pair row (assignmentCut levels (natSetCode 2) A))) ∧ + (∀ row A, ZFSet.pair row A ∈ Q3 ↔ + row ∈ c.carrier ∧ A ∈ M.groundSmallSubsets + (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ + ∃ lower : Shrink Condition, pres.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∧ + M.refinementLevelTests pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 + action nodes d base directed next2.first (natSetCode 2) T2 A lower) + +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (M : TransitiveGround.{u}) +theorem stageThreeCarrierData + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (prior : StageTwoNameLiftingData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used) + (hT2 : T2 ∈ M.sets) + (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (group : actors.carrier ∈ M.sets) (nodeAction : d.actionGraph nodes actors ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + StageThreeCarrierData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used := by + let actionData := prior.support_data.action_data + let data := actionData.closure_data.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + let first := actionData.closure_data.projection_data.first_level + let second := next.indices.levelCode + let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first + obtain ⟨F, hNodes, inputs, _, _, _, maps, _⟩ := actionData.actions + let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs + have hCarrier : pres.carrier ∈ M.sets := data.carrier_ground + have hOrder : pres.conditionOrder ∈ M.sets := + M.stageTwoConditionOrder_mem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first + rows hI0 rowOrder nodeOrder (M.omega_mem separation infinite) + have supports := M.principalSupportBasis_mem d nodes actors pairing unions powers separation + hNodes group nodeOrder nodeAction + have next2 := M.stageTwoRefinementStageSystem c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs + infinite choice hI0 next.indices.index_ground actors next.inputs hT2 rows rowOrder nodeOrder + group maps supports next.terms_hs next.pairs_hs + refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · rw [M.stageTwo_orderedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second] + exact data.index_data.square + · exact M.stageTwo_iteratedPairNameFamily c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second T + · exact M.stageTwoRefinementObjects c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first F first second a image inputs + infinite hI0 actors next2 hT2 rows rowOrder nodeOrder + · exact M.stageThreeLevelData pairing unions powers separation hI0 next.indices.index_ground + next2.indices.index_ground data.terms_ground first second next2.indices.levelCode + · exact stageThreeAssignmentCut_one first second next2.indices.levelCode + · exact stageThreeAssignmentCut_two first second next2.indices.levelCode + · intro A + rw [stageThreeAssignmentCut_one_old first second next2.indices.levelCode, + stageThreeAssignmentCut_nested first second next2.indices.levelCode, + stageThreeAssignmentCut_one_old first second next2.indices.levelCode] + · intro Aq Ap old + exact stageThreeAssignmentSplice_lower_eq first second next2.indices.levelCode Ap old + · exact M.stageThreeForcing_mem c.carrier I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation rows hI0 next.indices.index_ground data.terms_ground + hCarrier hOrder hNodes nodeOrder next2.valid2 next2.indices base directed next2.first + (M.omega_mem separation infinite) + · exact M.stageThreeForcing_empty c.carrier I0 I1 action pres nodes d T T2 next2.valid1 + rows (c.encode_mem ⊤) data.empty_top + · intro row member lower + exact M.stageThreeForcing_empty c.carrier I0 I1 action pres nodes d T T2 next2.valid1 + rows member lower + · exact M.stageThreeForcing_raw_entry c.carrier I0 I1 action pres nodes d T T2 next2.valid1 + · exact M.stageThreeForcing_entry c.carrier I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageThreeProjectionData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + carrier_data : StageThreeCarrierData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + projections : + let actionData := carrier_data.name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + let Q3 := M.stageThreeForcing c.carrier I0 I1 action pres nodes d T T2 next2.valid1 + ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, + let tests := M.refinementLevelTests pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 + action nodes d base directed next2.first (natSetCode 2) T2 + let Condition3 := FlatSuccessorCondition M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 action nodes d base directed next2.first + actionData.closure_data.projection_data.first_level next.indices.levelCode next2.indices.levelCode + letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + letI := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let restriction := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 + let inclusion := M.flatSuccessorSmallInclusion c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + pres3.carrier = Q3 ∧ pres3.carrier ∈ M.sets ∧ + pres3.conditionOrder = rowAssignmentOrder pres3.carrier c.carrier + (M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega) c.conditionOrder ∧ + pres3.conditionOrder ∈ M.sets ∧ pres3.encode ⊤ = pres.encode ⊤ ∧ + CompleteProjection restriction inclusion ∧ + (∀ q : Shrink Condition, pres3.encode (inclusion q) = pres.encode q) ∧ + (∀ p : Shrink Condition3, pres.encode (restriction p) = + ZFSet.pair (c.encode ((equivShrink Condition3).symm p).row) + (assignmentCut levels (natSetCode 2) ((equivShrink Condition3).symm p).assignments)) ∧ + pres3.graph pres restriction = rowAssignmentCutGraph pres3.carrier pres.carrier levels (natSetCode 2) ∧ + pres3.graph pres restriction ∈ M.sets + +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (M : TransitiveGround.{u}) +theorem stageThreeProjectionData + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (prior : StageThreeCarrierData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used) + (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + StageThreeProjectionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used := by + let actionData := prior.name_lifting.support_data.action_data + let data := actionData.closure_data.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + let first := actionData.closure_data.projection_data.first_level + let second := next.indices.levelCode + let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first + obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _⟩ := prior.construction + let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder + data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first + let laws := M.stageThreeFlatSuccessorLaws pres pairing unions powers separation collection + hCarrier hOrder data.terms_ground next2.valid1 action nodes d base directed next2.first + first second next2.indices.levelCode + let := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let := M.flatSuccessorSmallTop c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + have omega := M.omega_mem separation infinite + refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact M.stageThreeFlatPresentation_carrier c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first + · exact M.stageThreeFlatPresentation_carrier_mem c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first rows hI0 next.indices.index_ground nodeOrder omega + · exact M.flatSuccessorConditionOrder_eq c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + · exact M.stageThreeFlatOrder_mem c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first rows hI0 next.indices.index_ground rowOrder nodeOrder omega + · exact M.flatSuccessorPresentation_top c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + · exact M.flatSuccessorSmallCompleteProjection c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + pairing unions powers separation infinite choice + (M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 next.indices.index_ground + next2.indices.index_ground data.terms_ground) + (M.transitive omega (natSetCode_mem_omega 2)) + · exact M.flatSuccessorSmallInclusion_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 laws + · exact M.flatSuccessorSmallRestriction_encode c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 + · rw [M.stageThreeFlatPresentation_carrier c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first] + exact M.stageThreeSmallRestriction_graph c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first F2 + · exact M.stageThreeSmallRestriction_graph_mem c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first F2 rows hI0 next.indices.index_ground nodeOrder omega + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageThreeClosureData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + projection_data : StageThreeProjectionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used + closed : + let actionData := projection_data.carrier_data.name_lifting.support_data.action_data + let prior := actionData.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first F actionData.closure_data.projection_data.first_level + next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + ∃ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs + ∃ next2 : RefinementStageSystem M action pres actors nodes d base directed (natSetCode 2) T T2, + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + ∃ hCarrier : pres.carrier ∈ M.sets, ∃ hOrder : pres.conditionOrder ∈ M.sets, + let tests := M.refinementLevelTests pres pairing unions powers separation collection + hCarrier hOrder prior.terms_ground next2.valid1 + action nodes d base directed next2.first (natSetCode 2) T2 + let Condition3 := FlatSuccessorCondition M c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first + letI := M.flatSuccessorSmallOrder c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let pres3 := M.flatSuccessorPresentation c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + let restriction := M.flatSuccessorSmallRestriction c pres ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F2 + InternallyCountablyClosed M pres3 ∧ + (∀ seq : Nat → Shrink Condition3, + natPresentation.graph pres3 (fun n => seq n.down) ∈ M.sets → Antitone seq → + ∃ q : Shrink Condition, (∀ n, q ≤ restriction (seq n)) ∧ ∃ p : Shrink Condition3, + ((equivShrink Condition3).symm p).lower = q ∧ + ((equivShrink Condition3).symm p).assignments = + assignmentSplice levels (natSetCode 2) (F2.assignments q) + (stageOneAssignmentUnion (fun n => ((equivShrink Condition3).symm (seq n)).assignments)) ∧ + ∀ n, p ≤ seq n) + +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (M : TransitiveGround.{u}) +theorem stageThreeClosureData + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (prior : StageThreeProjectionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used) + (rows : c.carrier ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + StageThreeClosureData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection S mu X tuples used := by + let actionData := prior.carrier_data.name_lifting.support_data.action_data + let data := actionData.closure_data.projection_data.carrier_data + let next := data.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid actionData.valid2 next.valid1 next.valid2 + let first := actionData.closure_data.projection_data.first_level + let second := next.indices.levelCode + let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first + obtain ⟨F, hNodes, inputs, next2, hCarrier, hOrder, _⟩ := prior.projections + let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first F first second + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground hNodes data.terms_ground next.indices base directed next.first + let action := M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground data.terms_ground base directed next.first a image inputs + let I2 := M.niceRefinementIndices action pres nodes d (natSetCode 2) T T2 next2.valid1 + let levels := stageThreeAssignmentLevels I0 I1 I2 T + let tests := M.refinementLevelTests pres pairing unions powers separation collection hCarrier hOrder + data.terms_ground next2.valid1 action nodes d base directed next2.first (natSetCode 2) T2 + let F2 := M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first + obtain ⟨_, lowerClosed⟩ := actionData.closure_data.closed + refine ⟨prior, F, hNodes, inputs, next2, hCarrier, hOrder, ?_, ?_⟩ + · exact M.stageThreeCondition_internally_closed c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first F2 first second infinite choice rows hI0 + next.indices.index_ground nodeOrder lowerClosed + · exact M.stageThreeCondition_lower_bound c I0 I1 action pres nodes d T T2 next2.valid1 + pairing unions powers separation collection hCarrier hOrder hNodes data.terms_ground + next2.indices base directed next2.first F2 first second infinite choice rows hI0 + next.indices.index_ground nodeOrder lowerClosed + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeInternalClosure.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeInternalClosure.lean index 261c29860cb143c292c67d810e1c3d7da9433836..9a279723dd1427730b0b275a56f68ad01457adfe 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeInternalClosure.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeInternalClosure.lean @@ -1,426 +1,426 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.FlatSuccessorConditionUnions - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -section -open SetRealization -universe u -variable (M : TransitiveGround.{u}) -variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] - -theorem exists_stageOneAssignment_fields - (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) - {T T2 : ZFSet.{u}} {valid : ∀ z ∈ T, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} - (system : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) - (hT : T ∈ M.sets) {z : ZFSet.{u}} - (member : z ∈ stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) : - ∃ C E : L, ∃ U Rf Rc u w : (M.nameDomain s).names, - refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices a s b d ∅ T T2 valid ∧ - u.val.val ∈ T ∧ w.val.val ∈ T ∧ - z = stageOneAssignment - (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) - u.val.val w.val.val := by - obtain ⟨t, ht, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments _ T z).1 member - obtain ⟨C, E, U, Rf, Rc, rfl⟩ := system.decoded t ht - let u : (M.nameDomain s).names := ⟨⟨rawU, valid rawU hu⟩, M.transitive hT hu⟩ - let w : (M.nameDomain s).names := ⟨⟨rawW, valid rawW hw⟩, M.transitive hT hw⟩ - exact ⟨C, E, U, Rf, Rc, u, w, ht, hu, hw, rfl⟩ - -omit [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] in -theorem exists_stageOneCandidate_fields (c : Presentation P) (I T : ZFSet.{u}) - {z : ZFSet.{u}} (member : z ∈ M.stageOneCandidateBound c.carrier I T) : - ∃ p : P, ∃ A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega, - z = ZFSet.pair (c.encode p) A := by - obtain ⟨raw, hp, A, hA, equal⟩ := ZFSet.mem_prod.1 member - obtain ⟨p, rfl⟩ := (c.mem_carrier raw).1 hp - exact ⟨p, A, hA, equal⟩ - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (rawRowCarrier I0 I1 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T - -include nodes indices in -theorem stageThreeForcing_entry (row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid ↔ - row ∈ rawRowCarrier ∧ - A ∈ M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ - ∃ lower : P, s.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∧ - M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2 A lower := by - rw [M.stageThreeForcing_raw_entry] - constructor - · rintro ⟨rowMem, small, lowerMem, raw⟩ - obtain ⟨lower, equal⟩ := (s.mem_carrier _).1 lowerMem - refine ⟨rowMem, small, lower, equal, ?_⟩ - apply (M.refinementLevelRawTests_iff a s b d (natSetCode 2) - pairing unions powers separation collection carrier order nodes hT valid indices - base directed system A lower).1 - exact equal.symm ▸ raw - · rintro ⟨rowMem, small, lower, equal, tests⟩ - refine ⟨rowMem, small, equal ▸ s.encode_mem lower, ?_⟩ - have raw := (M.refinementLevelRawTests_iff a s b d (natSetCode 2) - pairing unions powers separation collection carrier order nodes hT valid indices - base directed system A lower).2 tests - exact equal ▸ raw - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 I1 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection - carrier order hT valid a b d base directed system (natSetCode 2) T2 -local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests -local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - -include nodes indices in -theorem stageThreeFlatCarrier_eq : - M.flatSuccessorCarrier c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests = - M.stageThreeForcing c.carrier I0 I1 a s b d T T2 valid := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨p, rfl⟩ := (M.mem_flatSuccessorCarrier c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests z).1 member - exact (M.stageThreeForcing_entry c.carrier I0 I1 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system (c.encode p.row) p.assignments).2 - ⟨c.encode_mem p.row, p.assignments_mem, p.lower, p.lower_code, p.tests⟩ - · intro member - have candidate := (M.mem_stageTwoConditions c.carrier ((I0 ∪ I1) ∪ I2) levels - (natSetCode 2) (M.refinementLevelFormulaData a s b d (natSetCode 2) T T2 valid) z).1 member - obtain ⟨row, A, small, equal⟩ := M.exists_stageOneCandidate_fields c _ _ candidate.1 - obtain ⟨_, _, lower, lowerCode, checked⟩ := - (M.stageThreeForcing_entry c.carrier I0 I1 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system (c.encode row) A).1 (equal ▸ member) - exact (M.mem_flatSuccessorCarrier c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests z).2 - ⟨⟨row, A, small, lower, lowerCode, checked⟩, equal.symm⟩ - -include nodes indices in -theorem stageThreeFlatPresentation_carrier : - (pres).carrier = M.stageThreeForcing c.carrier I0 I1 a s b d T T2 valid := - M.stageThreeFlatCarrier_eq c I0 I1 a s b d T T2 valid pairing unions powers separation collection - carrier order nodes hT indices base directed system - -include nodes indices in -theorem stageThreeFlatPresentation_carrier_mem - (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - (pres).carrier ∈ M.sets := by - rw [M.stageThreeFlatPresentation_carrier c I0 I1 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system] - exact M.stageThreeForcing_mem c.carrier I0 I1 a s b d T T2 valid pairing unions powers separation - rows hI0 hI1 hT carrier order nodes nodeOrder valid2 indices base directed system omega - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 I1 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection - carrier order hT valid a b d base directed system (natSetCode 2) T2 -local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests -local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - -local notation "smallOrder" => M.flatSuccessorSmallOrder c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - -theorem stageThreeFlatOrder_eq : - letI := smallOrder - (pres).conditionOrder = rowAssignmentOrder (pres).carrier c.carrier - (M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega) - c.conditionOrder := - M.flatSuccessorConditionOrder_eq c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - -include nodes indices in -theorem stageThreeFlatOrder_mem - (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (rowOrder : c.conditionOrder ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - letI := smallOrder - (pres).conditionOrder ∈ M.sets := by - let := smallOrder - have actual := M.stageThreeFlatPresentation_carrier_mem c I0 I1 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rows hI0 hI1 nodeOrder omega - exact M.flatSuccessorConditionOrder_mem c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - pairing unions powers separation rows actual - (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) - indices.index_ground) hT omega rowOrder - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 I1 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection - carrier order hT valid a b d base directed system (natSetCode 2) T2 -local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests -local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests -variable (F : FlatConditionSystem M c s (stageOneAssignments (I0 ∪ I1) T)) -local notation "restrict" => M.flatSuccessorSmallRestriction c s ((I0 ∪ I1) ∪ I2) T levels - (natSetCode 2) tests F - -include nodes indices in -theorem stageThreeSmallRestriction_graph : - letI := smallOrder - (pres).graph s restrict = rowAssignmentCutGraph - (M.stageThreeForcing c.carrier I0 I1 a s b d T T2 valid) s.carrier levels (natSetCode 2) := by - let := smallOrder - rw [← M.stageThreeFlatPresentation_carrier c I0 I1 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system] - exact (pres).graph_eq_rowAssignmentCutGraph s restrict - (fun p => c.encode ((equivShrink Condition).symm p).row) - (fun p => ((equivShrink Condition).symm p).assignments) levels (natSetCode 2) - (fun _ => rfl) - (M.flatSuccessorSmallRestriction_encode c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F) - -include nodes indices in -theorem stageThreeSmallRestriction_graph_mem - (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - letI := smallOrder - (pres).graph s restrict ∈ M.sets := by - let := smallOrder - exact M.presentedRowAssignmentCutGraph_mem pairing unions powers separation - pres s restrict (fun p => c.encode ((equivShrink Condition).symm p).row) - (fun p => ((equivShrink Condition).symm p).assignments) levels (natSetCode 2) - (fun _ => rfl) - (M.flatSuccessorSmallRestriction_encode c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F) - (M.stageThreeFlatPresentation_carrier_mem c I0 I1 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rows hI0 hI1 nodeOrder omega) - carrier (M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 indices.index_ground hT) - (M.transitive omega (natSetCode_mem_omega 2)) - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "data" => M.flatSuccessorConditionData c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -variable (unionLaws : FlatSuccessorUnionLaws tests) -local notation "restrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (rows : c.carrier ∈ M.sets) (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) (lower : s.carrier ∈ M.sets) -variable (hJ : stageOneAssignments I T ∈ M.sets) -variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) -variable (closed : InternallyCountablyClosed M s) - -include F laws unionLaws pairing unions powers separation infinite choice rows conditions lower hJ - hLevels hAlpha closed in -theorem flatSuccessor_lower_bound : - letI := smallOrder - ∀ seq : Nat → Shrink Condition, - natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → - ∃ q : P, (∀ n, q ≤ restrict (seq n)) ∧ ∃ p : Shrink Condition, - ((equivShrink Condition).symm p).lower = q ∧ - ((equivShrink Condition).symm p).assignments = - assignmentSplice levels alpha (F.assignments q) - (stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments)) ∧ - ∀ n, p ≤ seq n := by - let := smallOrder - intro seq whole decreasing - let typed : Nat → Condition := fun n => (equivShrink Condition).symm (seq n) - have typedDecreasing : Antitone typed := fun _ _ less => decreasing less - have lowerDecreasing : Antitone (fun n => restrict (seq n)) := - fun _ _ less => (restrict).monotone (decreasing less) - obtain ⟨lowerGround, dataGround⟩ := M.flatSuccessorSequence_projections_ground - c s I T levels alpha tests F pairing unions powers separation rows conditions lower hJ - hLevels hAlpha (M.omega_mem separation infinite) seq whole - obtain ⟨q, below⟩ := closed (fun n => restrict (seq n)) lowerGround lowerDecreasing - have smallRaw := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice - hJ (fun n => data (seq n)) dataGround - have small : stageOneAssignmentUnion (fun n => (typed n).assignments) ∈ B := by - simpa only [M.flatSuccessorConditionData_raw] using smallRaw - let bound : Condition := FlatSuccessorCondition.chainUnion M c s I T levels alpha tests - F laws unionLaws pairing unions powers separation infinite choice hLevels hAlpha - typed typedDecreasing q below small - refine ⟨q, below, equivShrink Condition bound, ?_, ?_, ?_⟩ - · rw [Equiv.symm_apply_apply] - rfl - · rw [Equiv.symm_apply_apply] - rfl - · intro n - change (equivShrink Condition).symm (equivShrink Condition bound) ≤ typed n - rw [Equiv.symm_apply_apply] - exact FlatSuccessorCondition.chainUnion_le M c s I T levels alpha tests - F laws unionLaws pairing unions powers separation infinite choice hLevels hAlpha - typed typedDecreasing q below small n - -include F laws unionLaws pairing unions powers separation infinite choice rows conditions lower hJ - hLevels hAlpha closed in -theorem flatSuccessor_internally_closed : - letI := smallOrder - InternallyCountablyClosed M (pres) := by - let := smallOrder - intro seq whole decreasing - obtain ⟨_, _, q, _, _, below⟩ := M.flatSuccessor_lower_bound c s I T levels alpha tests - F laws unionLaws pairing unions powers separation infinite choice rows conditions lower hJ - hLevels hAlpha closed seq whole decreasing - exact ⟨q, below⟩ - -end - -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 I1 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid -local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T -local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection - carrier order hT valid a b d base directed system (natSetCode 2) T2 -local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests -local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - -local notation "smallOrder" => M.flatSuccessorSmallOrder c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests - -variable (F : FlatConditionSystem M c s (stageOneAssignments (I0 ∪ I1) T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -local notation "laws" => M.stageThreeFlatSuccessorLaws s pairing unions powers separation collection - carrier order hT valid a b d base directed system first second indices.levelCode -local notation "unionLaws" => M.refinementLevelFlatSuccessorUnionLaws s pairing unions powers separation collection - carrier order hT valid a b d base directed system (natSetCode 2) T2 -local notation "restrict" => M.flatSuccessorSmallRestriction c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) -variable (nodeOrder : b.conditionOrder ∈ M.sets) -variable (closed : InternallyCountablyClosed M s) -include nodes indices F first second infinite choice rows hI0 hI1 nodeOrder closed - -theorem stageThreeCondition_lower_bound : - letI := smallOrder - ∀ seq : Nat → Shrink Condition, - natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → - ∃ q : P, (∀ n, q ≤ restrict (seq n)) ∧ ∃ p : Shrink Condition, - ((equivShrink Condition).symm p).lower = q ∧ - ((equivShrink Condition).symm p).assignments = - assignmentSplice levels (natSetCode 2) (F.assignments q) - (stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments)) ∧ - ∀ n, p ≤ seq n := by - let := smallOrder - exact M.flatSuccessor_lower_bound c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F laws unionLaws - pairing unions powers separation infinite choice rows - (M.stageThreeFlatPresentation_carrier_mem c I0 I1 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rows hI0 hI1 nodeOrder (M.omega_mem separation infinite)) - carrier - (M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) indices.index_ground) hT) - (M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 indices.index_ground hT) - (M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega 2)) closed - -theorem stageThreeCondition_internally_closed : - letI := smallOrder - InternallyCountablyClosed M (pres) := by - let := smallOrder - intro seq whole decreasing - obtain ⟨_, _, q, _, _, below⟩ := M.stageThreeCondition_lower_bound c I0 I1 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second infinite choice rows hI0 hI1 nodeOrder closed seq whole decreasing - exact ⟨q, below⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.FlatSuccessorConditionUnions + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +section +open SetRealization +universe u +variable (M : TransitiveGround.{u}) +variable {G P L : Type u} [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] + +theorem exists_stageOneAssignment_fields + (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) + {T T2 : ZFSet.{u}} {valid : ∀ z ∈ T, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} + (system : NiceRefinementIndexSystem M a s b d ∅ T T2 valid valid2) + (hT : T ∈ M.sets) {z : ZFSet.{u}} + (member : z ∈ stageOneAssignments (M.niceRefinementIndices a s b d ∅ T T2 valid) T) : + ∃ C E : L, ∃ U Rf Rc u w : (M.nameDomain s).names, + refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices a s b d ∅ T T2 valid ∧ + u.val.val ∈ T ∧ w.val.val ∈ T ∧ + z = stageOneAssignment + (refinementIndexCode ∅ (b.encode C) (b.encode E) U.val.val Rf.val.val Rc.val.val) + u.val.val w.val.val := by + obtain ⟨t, ht, rawU, hu, rawW, hw, rfl⟩ := (mem_stageOneAssignments _ T z).1 member + obtain ⟨C, E, U, Rf, Rc, rfl⟩ := system.decoded t ht + let u : (M.nameDomain s).names := ⟨⟨rawU, valid rawU hu⟩, M.transitive hT hu⟩ + let w : (M.nameDomain s).names := ⟨⟨rawW, valid rawW hw⟩, M.transitive hT hw⟩ + exact ⟨C, E, U, Rf, Rc, u, w, ht, hu, hw, rfl⟩ + +omit [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] in +theorem exists_stageOneCandidate_fields (c : Presentation P) (I T : ZFSet.{u}) + {z : ZFSet.{u}} (member : z ∈ M.stageOneCandidateBound c.carrier I T) : + ∃ p : P, ∃ A ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega, + z = ZFSet.pair (c.encode p) A := by + obtain ⟨raw, hp, A, hA, equal⟩ := ZFSet.mem_prod.1 member + obtain ⟨p, rfl⟩ := (c.mem_carrier raw).1 hp + exact ⟨p, A, hA, equal⟩ + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (rawRowCarrier I0 I1 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T + +include nodes indices in +theorem stageThreeForcing_entry (row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.stageThreeForcing rawRowCarrier I0 I1 a s b d T T2 valid ↔ + row ∈ rawRowCarrier ∧ + A ∈ M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega ∧ + ∃ lower : P, s.encode lower = ZFSet.pair row (assignmentCut levels (natSetCode 2) A) ∧ + M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2 A lower := by + rw [M.stageThreeForcing_raw_entry] + constructor + · rintro ⟨rowMem, small, lowerMem, raw⟩ + obtain ⟨lower, equal⟩ := (s.mem_carrier _).1 lowerMem + refine ⟨rowMem, small, lower, equal, ?_⟩ + apply (M.refinementLevelRawTests_iff a s b d (natSetCode 2) + pairing unions powers separation collection carrier order nodes hT valid indices + base directed system A lower).1 + exact equal.symm ▸ raw + · rintro ⟨rowMem, small, lower, equal, tests⟩ + refine ⟨rowMem, small, equal ▸ s.encode_mem lower, ?_⟩ + have raw := (M.refinementLevelRawTests_iff a s b d (natSetCode 2) + pairing unions powers separation collection carrier order nodes hT valid indices + base directed system A lower).2 tests + exact equal ▸ raw + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 I1 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection + carrier order hT valid a b d base directed system (natSetCode 2) T2 +local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests +local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + +include nodes indices in +theorem stageThreeFlatCarrier_eq : + M.flatSuccessorCarrier c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests = + M.stageThreeForcing c.carrier I0 I1 a s b d T T2 valid := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨p, rfl⟩ := (M.mem_flatSuccessorCarrier c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests z).1 member + exact (M.stageThreeForcing_entry c.carrier I0 I1 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system (c.encode p.row) p.assignments).2 + ⟨c.encode_mem p.row, p.assignments_mem, p.lower, p.lower_code, p.tests⟩ + · intro member + have candidate := (M.mem_stageTwoConditions c.carrier ((I0 ∪ I1) ∪ I2) levels + (natSetCode 2) (M.refinementLevelFormulaData a s b d (natSetCode 2) T T2 valid) z).1 member + obtain ⟨row, A, small, equal⟩ := M.exists_stageOneCandidate_fields c _ _ candidate.1 + obtain ⟨_, _, lower, lowerCode, checked⟩ := + (M.stageThreeForcing_entry c.carrier I0 I1 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system (c.encode row) A).1 (equal ▸ member) + exact (M.mem_flatSuccessorCarrier c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests z).2 + ⟨⟨row, A, small, lower, lowerCode, checked⟩, equal.symm⟩ + +include nodes indices in +theorem stageThreeFlatPresentation_carrier : + (pres).carrier = M.stageThreeForcing c.carrier I0 I1 a s b d T T2 valid := + M.stageThreeFlatCarrier_eq c I0 I1 a s b d T T2 valid pairing unions powers separation collection + carrier order nodes hT indices base directed system + +include nodes indices in +theorem stageThreeFlatPresentation_carrier_mem + (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + (pres).carrier ∈ M.sets := by + rw [M.stageThreeFlatPresentation_carrier c I0 I1 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system] + exact M.stageThreeForcing_mem c.carrier I0 I1 a s b d T T2 valid pairing unions powers separation + rows hI0 hI1 hT carrier order nodes nodeOrder valid2 indices base directed system omega + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 I1 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection + carrier order hT valid a b d base directed system (natSetCode 2) T2 +local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests +local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + +local notation "smallOrder" => M.flatSuccessorSmallOrder c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + +theorem stageThreeFlatOrder_eq : + letI := smallOrder + (pres).conditionOrder = rowAssignmentOrder (pres).carrier c.carrier + (M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) T) ZFSet.omega) + c.conditionOrder := + M.flatSuccessorConditionOrder_eq c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + +include nodes indices in +theorem stageThreeFlatOrder_mem + (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (rowOrder : c.conditionOrder ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + letI := smallOrder + (pres).conditionOrder ∈ M.sets := by + let := smallOrder + have actual := M.stageThreeFlatPresentation_carrier_mem c I0 I1 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rows hI0 hI1 nodeOrder omega + exact M.flatSuccessorConditionOrder_mem c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + pairing unions powers separation rows actual + (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) + indices.index_ground) hT omega rowOrder + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 I1 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection + carrier order hT valid a b d base directed system (natSetCode 2) T2 +local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests +local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests +variable (F : FlatConditionSystem M c s (stageOneAssignments (I0 ∪ I1) T)) +local notation "restrict" => M.flatSuccessorSmallRestriction c s ((I0 ∪ I1) ∪ I2) T levels + (natSetCode 2) tests F + +include nodes indices in +theorem stageThreeSmallRestriction_graph : + letI := smallOrder + (pres).graph s restrict = rowAssignmentCutGraph + (M.stageThreeForcing c.carrier I0 I1 a s b d T T2 valid) s.carrier levels (natSetCode 2) := by + let := smallOrder + rw [← M.stageThreeFlatPresentation_carrier c I0 I1 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system] + exact (pres).graph_eq_rowAssignmentCutGraph s restrict + (fun p => c.encode ((equivShrink Condition).symm p).row) + (fun p => ((equivShrink Condition).symm p).assignments) levels (natSetCode 2) + (fun _ => rfl) + (M.flatSuccessorSmallRestriction_encode c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F) + +include nodes indices in +theorem stageThreeSmallRestriction_graph_mem + (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + letI := smallOrder + (pres).graph s restrict ∈ M.sets := by + let := smallOrder + exact M.presentedRowAssignmentCutGraph_mem pairing unions powers separation + pres s restrict (fun p => c.encode ((equivShrink Condition).symm p).row) + (fun p => ((equivShrink Condition).symm p).assignments) levels (natSetCode 2) + (fun _ => rfl) + (M.flatSuccessorSmallRestriction_encode c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F) + (M.stageThreeFlatPresentation_carrier_mem c I0 I1 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rows hI0 hI1 nodeOrder omega) + carrier (M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 indices.index_ground hT) + (M.transitive omega (natSetCode_mem_omega 2)) + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "data" => M.flatSuccessorConditionData c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +variable (unionLaws : FlatSuccessorUnionLaws tests) +local notation "restrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (rows : c.carrier ∈ M.sets) (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) (lower : s.carrier ∈ M.sets) +variable (hJ : stageOneAssignments I T ∈ M.sets) +variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) +variable (closed : InternallyCountablyClosed M s) + +include F laws unionLaws pairing unions powers separation infinite choice rows conditions lower hJ + hLevels hAlpha closed in +theorem flatSuccessor_lower_bound : + letI := smallOrder + ∀ seq : Nat → Shrink Condition, + natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → + ∃ q : P, (∀ n, q ≤ restrict (seq n)) ∧ ∃ p : Shrink Condition, + ((equivShrink Condition).symm p).lower = q ∧ + ((equivShrink Condition).symm p).assignments = + assignmentSplice levels alpha (F.assignments q) + (stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments)) ∧ + ∀ n, p ≤ seq n := by + let := smallOrder + intro seq whole decreasing + let typed : Nat → Condition := fun n => (equivShrink Condition).symm (seq n) + have typedDecreasing : Antitone typed := fun _ _ less => decreasing less + have lowerDecreasing : Antitone (fun n => restrict (seq n)) := + fun _ _ less => (restrict).monotone (decreasing less) + obtain ⟨lowerGround, dataGround⟩ := M.flatSuccessorSequence_projections_ground + c s I T levels alpha tests F pairing unions powers separation rows conditions lower hJ + hLevels hAlpha (M.omega_mem separation infinite) seq whole + obtain ⟨q, below⟩ := closed (fun n => restrict (seq n)) lowerGround lowerDecreasing + have smallRaw := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice + hJ (fun n => data (seq n)) dataGround + have small : stageOneAssignmentUnion (fun n => (typed n).assignments) ∈ B := by + simpa only [M.flatSuccessorConditionData_raw] using smallRaw + let bound : Condition := FlatSuccessorCondition.chainUnion M c s I T levels alpha tests + F laws unionLaws pairing unions powers separation infinite choice hLevels hAlpha + typed typedDecreasing q below small + refine ⟨q, below, equivShrink Condition bound, ?_, ?_, ?_⟩ + · rw [Equiv.symm_apply_apply] + rfl + · rw [Equiv.symm_apply_apply] + rfl + · intro n + change (equivShrink Condition).symm (equivShrink Condition bound) ≤ typed n + rw [Equiv.symm_apply_apply] + exact FlatSuccessorCondition.chainUnion_le M c s I T levels alpha tests + F laws unionLaws pairing unions powers separation infinite choice hLevels hAlpha + typed typedDecreasing q below small n + +include F laws unionLaws pairing unions powers separation infinite choice rows conditions lower hJ + hLevels hAlpha closed in +theorem flatSuccessor_internally_closed : + letI := smallOrder + InternallyCountablyClosed M (pres) := by + let := smallOrder + intro seq whole decreasing + obtain ⟨_, _, q, _, _, below⟩ := M.flatSuccessor_lower_bound c s I T levels alpha tests + F laws unionLaws pairing unions powers separation infinite choice rows conditions lower hJ + hLevels hAlpha closed seq whole decreasing + exact ⟨q, below⟩ + +end + +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 I1 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 2) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "I2" => M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid +local notation "levels" => stageThreeAssignmentLevels I0 I1 I2 T +local notation "tests" => M.refinementLevelTests s pairing unions powers separation collection + carrier order hT valid a b d base directed system (natSetCode 2) T2 +local notation "Condition" => FlatSuccessorCondition M c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests +local notation "pres" => M.flatSuccessorPresentation c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + +local notation "smallOrder" => M.flatSuccessorSmallOrder c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests + +variable (F : FlatConditionSystem M c s (stageOneAssignments (I0 ∪ I1) T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +local notation "laws" => M.stageThreeFlatSuccessorLaws s pairing unions powers separation collection + carrier order hT valid a b d base directed system first second indices.levelCode +local notation "unionLaws" => M.refinementLevelFlatSuccessorUnionLaws s pairing unions powers separation collection + carrier order hT valid a b d base directed system (natSetCode 2) T2 +local notation "restrict" => M.flatSuccessorSmallRestriction c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) (hI1 : I1 ∈ M.sets) +variable (nodeOrder : b.conditionOrder ∈ M.sets) +variable (closed : InternallyCountablyClosed M s) +include nodes indices F first second infinite choice rows hI0 hI1 nodeOrder closed + +theorem stageThreeCondition_lower_bound : + letI := smallOrder + ∀ seq : Nat → Shrink Condition, + natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → + ∃ q : P, (∀ n, q ≤ restrict (seq n)) ∧ ∃ p : Shrink Condition, + ((equivShrink Condition).symm p).lower = q ∧ + ((equivShrink Condition).symm p).assignments = + assignmentSplice levels (natSetCode 2) (F.assignments q) + (stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments)) ∧ + ∀ n, p ≤ seq n := by + let := smallOrder + exact M.flatSuccessor_lower_bound c s ((I0 ∪ I1) ∪ I2) T levels (natSetCode 2) tests F laws unionLaws + pairing unions powers separation infinite choice rows + (M.stageThreeFlatPresentation_carrier_mem c I0 I1 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rows hI0 hI1 nodeOrder (M.omega_mem separation infinite)) + carrier + (M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions (M.binary_union_mem pairing unions hI0 hI1) indices.index_ground) hT) + (M.stageThreeAssignmentLevels_mem pairing unions powers separation hI0 hI1 indices.index_ground hT) + (M.transitive (M.omega_mem separation infinite) (natSetCode_mem_omega 2)) closed + +theorem stageThreeCondition_internally_closed : + letI := smallOrder + InternallyCountablyClosed M (pres) := by + let := smallOrder + intro seq whole decreasing + obtain ⟨_, _, q, _, _, below⟩ := M.stageThreeCondition_lower_bound c I0 I1 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second infinite choice rows hI0 hI1 nodeOrder closed seq whole decreasing + exact ⟨q, below⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeSuccessorLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeSuccessorLaws.lean index 763b2cf875ac07e1a8a2f613feaf66b1d0746676..bc7c32a1ceaa411fb80187258c10c81448ee7755 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeSuccessorLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageThreeSuccessorLaws.lean @@ -1,515 +1,515 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatRestrictionGraphs -import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementLevelThreeTestGuards - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u -variable {P : Type u} [PartialOrder P] - -structure FlatSuccessorLaws (Jold I T levels alpha : ZFSet.{u}) - (tests : ZFSet.{u} → P → Prop) : Prop where - old_subset : Jold ⊆ stageOneAssignments I T - cut_subset : ∀ A, A ⊆ stageOneAssignments I T → assignmentCut levels alpha A ⊆ Jold - cut_old : ∀ A, A ⊆ Jold → assignmentCut levels alpha A = A - tests_mono : ∀ {A p q}, tests A p → q ≤ p → tests A q - tests_splice : ∀ Aq Ap p, Aq ⊆ Jold → - (tests (assignmentSplice levels alpha Aq Ap) p ↔ tests Ap p) - tests_old : ∀ A p, A ⊆ Jold → tests A p - -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} [PartialOrder R] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests - -namespace FlatSuccessorCondition -instance partialOrder : PartialOrder Condition where - le p q := p.row ≤ q.row ∧ q.assignments ⊆ p.assignments - le_refl _ := ⟨le_rfl, fun _ h => h⟩ - le_trans _ _ _ first second := ⟨first.1.trans second.1, fun _ h => first.2 (second.2 h)⟩ - le_antisymm p q first second := by - apply ext M c s I T levels alpha tests (le_antisymm first.1 second.1) - apply ZFSet.ext - intro z - exact ⟨fun h => second.2 h, fun h => first.2 h⟩ - -theorem le_iff (p q : Condition) : - p ≤ q ↔ p.row ≤ q.row ∧ q.assignments ⊆ p.assignments := Iff.rfl - -def rowProjection : Condition →o R where - toFun p := p.row - monotone' _ _ below := below.1 - -end FlatSuccessorCondition - -namespace TransitiveGround -@[instance_reducible] -noncomputable def flatSuccessorSmallOrder : PartialOrder (Shrink Condition) where - le p q := (equivShrink Condition).symm p ≤ (equivShrink Condition).symm q - le_refl _ := le_rfl - le_trans _ _ _ first second := first.trans second - le_antisymm _ _ first second := (equivShrink Condition).symm.injective (le_antisymm first second) - -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests - -noncomputable def flatSuccessorOrderIso : - letI := smallOrder - Condition ≃o Shrink Condition := by - let := smallOrder - exact { - toEquiv := equivShrink Condition - map_rel_iff' := by - intro p q - change (equivShrink Condition).symm (equivShrink Condition p) ≤ - (equivShrink Condition).symm (equivShrink Condition q) ↔ p ≤ q - simp only [Equiv.symm_apply_apply] } - -noncomputable def flatSuccessorFlatConditionSystem : - letI := smallOrder - FlatConditionSystem M c pres (stageOneAssignments I T) := by - let := smallOrder - exact { - row := fun p => ((equivShrink Condition).symm p).row - assignments := fun p => ((equivShrink Condition).symm p).assignments - encode := fun _ => rfl - le_iff := fun _ _ => Iff.rfl - assignments_mem := fun p => ((equivShrink Condition).symm p).assignments_mem } - -theorem flatSuccessorConditionOrder_eq : - letI := smallOrder - (pres).conditionOrder = rowAssignmentOrder (pres).carrier c.carrier - (M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega) c.conditionOrder := by - let := smallOrder - exact (M.flatSuccessorFlatConditionSystem c s I T levels alpha tests).conditionOrder_eq - -theorem flatSuccessorConditionOrder_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (rows : c.carrier ∈ M.sets) - (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) - (hI : I ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (order : c.conditionOrder ∈ M.sets) : - letI := smallOrder - (pres).conditionOrder ∈ M.sets := by - let := smallOrder - exact (M.flatSuccessorFlatConditionSystem c s I T levels alpha tests).conditionOrder_mem - pairing unions powers separation rows conditions - (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega order - -end TransitiveGround -end - -section -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) - -namespace FlatSuccessorCondition -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) - -theorem lower_row (p : Condition) : F.row p.lower = p.row := - c.injective (ZFSet.pair_inj.1 ((F.encode p.lower).symm.trans p.lower_code)).1 - -theorem lower_assignments (p : Condition) : - F.assignments p.lower = assignmentCut levels alpha p.assignments := - (ZFSet.pair_inj.1 ((F.encode p.lower).symm.trans p.lower_code)).2 - -def restriction : Condition →o P where - toFun p := p.lower - monotone' := by - intro p q below - apply (F.le_iff p.lower q.lower).2 - constructor - · rw [lower_row M c s I T levels alpha tests F p, - lower_row M c s I T levels alpha tests F q] - exact below.1 - · rw [lower_assignments M c s I T levels alpha tests F p, - lower_assignments M c s I T levels alpha tests F q] - exact assignmentCut_mono below.2 - -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) - -noncomputable def includeLower (q : P) : Condition := by - have facts := (M.mem_groundSmallSubsets Jold ZFSet.omega _).1 (F.assignments_mem q) - have ground := facts.1 - have subsetOld := facts.2.1 - have small := facts.2.2 - refine ⟨F.row q, F.assignments q, ?_, q, ?_, ?_⟩ - · exact (M.mem_groundSmallSubsets _ _ _).2 - ⟨ground, fun _ hz => laws.old_subset (subsetOld hz), small⟩ - · rw [laws.cut_old _ subsetOld] - exact F.encode q - · exact laws.tests_old _ q subsetOld - -local notation "inc" => includeLower M c s I T levels alpha tests F laws -local notation "restrict" => restriction M c s I T levels alpha tests F - -theorem includeLower_lower (q : P) : (inc q).lower = q := rfl - -theorem includeLower_code (q : P) : - code M c s I T levels alpha tests (inc q) = s.encode q := (F.encode q).symm - -noncomputable def inclusion : P ↪o Condition where - toFun := inc - inj' _ _ equal := congrArg FlatSuccessorCondition.lower equal - map_rel_iff' := by - intro p q - exact (F.le_iff p q).symm - -theorem restriction_inclusion (q : P) : - restrict (inclusion M c s I T levels alpha tests F laws q) = q := rfl - -theorem le_inclusion_iff (p : Condition) (q : P) : - p ≤ inclusion M c s I T levels alpha tests F laws q ↔ restrict p ≤ q := by - change p.row ≤ F.row q ∧ F.assignments q ⊆ p.assignments ↔ p.lower ≤ q - rw [F.le_iff, lower_row M c s I T levels alpha tests F p, - lower_assignments M c s I T levels alpha tests F p] - apply and_congr_right - intro _ - have subsetOld := ((M.mem_groundSmallSubsets _ _ (F.assignments q)).1 - (F.assignments_mem q)).2.1 - constructor - · intro subset - have mono : assignmentCut levels alpha (F.assignments q) ⊆ - assignmentCut levels alpha p.assignments := assignmentCut_mono subset - rwa [laws.cut_old _ subsetOld] at mono - · intro subset - exact fun _ hz => assignmentCut_subset _ _ _ (subset hz) - -end FlatSuccessorCondition -end - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) - -namespace FlatSuccessorCondition -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) - -noncomputable def splice (p : Condition) (q : P) (below : q ≤ p.lower) : Condition := by - have old := ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1 - have memberq : F.assignments q ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega := - (includeLower M c s I T levels alpha tests F laws q).assignments_mem - exact { - row := F.row q - assignments := assignmentSplice levels alpha (F.assignments q) p.assignments - assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation - infinite choice hLevels hAlpha memberq p.assignments_mem - lower := q - lower_code := by rw [assignmentCut_splice, laws.cut_old _ old]; exact F.encode q - tests := (laws.tests_splice _ _ q old).2 (laws.tests_mono p.tests below) } - -local notation "lifted" => splice M c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - -theorem splice_row (p : Condition) (q : P) (below : q ≤ p.lower) : - (lifted p q below).row = F.row q := rfl - -theorem splice_assignments (p : Condition) (q : P) (below : q ≤ p.lower) : - (lifted p q below).assignments = - assignmentSplice levels alpha (F.assignments q) p.assignments := rfl - -theorem splice_lower (p : Condition) (q : P) (below : q ≤ p.lower) : - (lifted p q below).lower = q := rfl - -theorem splice_le (p : Condition) (q : P) (below : q ≤ p.lower) : lifted p q below ≤ p := by - obtain ⟨rows, data⟩ := (F.le_iff q p.lower).1 below - have lowerRow := lower_row M c s I T levels alpha tests F p - have lowerData := lower_assignments M c s I T levels alpha tests F p - refine ⟨rows.trans_eq lowerRow, ?_⟩ - change p.assignments ⊆ assignmentSplice levels alpha (F.assignments q) p.assignments - apply assignmentSplice_extends - rw [laws.cut_old _ ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1, - ← lowerData] - exact data - -include laws pairing unions powers separation infinite choice hLevels hAlpha in -theorem exists_lift_restriction (p : Condition) (q : P) (below : q ≤ p.lower) : - ∃ r : Condition, r ≤ p ∧ r.lower = q ∧ r.row = F.row q ∧ - r.assignments = assignmentSplice levels alpha (F.assignments q) p.assignments := - ⟨lifted p q below, splice_le M c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha p q below, rfl, rfl, rfl⟩ - -include laws pairing unions powers separation infinite choice hLevels hAlpha in -theorem completeProjection : - CompleteProjection (restriction M c s I T levels alpha tests F) - (inclusion M c s I T levels alpha tests F laws) := by - refine ⟨restriction_inclusion M c s I T levels alpha tests F laws, - le_inclusion_iff M c s I T levels alpha tests F laws, ?_⟩ - intro p q below - obtain ⟨r, rp, lower, _, _⟩ := exists_lift_restriction M c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha p q below - exact ⟨r, rp, lower⟩ - -end FlatSuccessorCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "restrict" => FlatSuccessorCondition.restriction M c s I T levels alpha tests F -local notation "inc" => FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws - -noncomputable def flatSuccessorSmallRestriction : - letI := smallOrder - Shrink Condition →o P := by - let := smallOrder - exact { - toFun := fun p => restrict ((equivShrink Condition).symm p) - monotone' := fun _ _ below => (restrict).monotone below } - -noncomputable def flatSuccessorSmallInclusion : - letI := smallOrder - P ↪o Shrink Condition := by - let := smallOrder - exact { - toFun := fun p => equivShrink Condition (inc p) - inj' := fun _ _ equal => (inc).injective ((equivShrink Condition).injective equal) - map_rel_iff' := by - intro p q - change (equivShrink Condition).symm (equivShrink Condition (inc p)) ≤ - (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ p ≤ q - simp only [Equiv.symm_apply_apply] - exact (inc).map_rel_iff } - -local notation "smallRestrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F -local notation "smallInc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws - -include laws in -theorem flatSuccessorSmallCompleteProjection - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) : - letI := smallOrder - CompleteProjection smallRestrict smallInc := by - let := smallOrder - have original := FlatSuccessorCondition.completeProjection M c s I T levels alpha tests F laws - pairing unions powers separation infinite choice hLevels hAlpha - refine ⟨?_, ?_, ?_⟩ - · intro q - change restrict ((equivShrink Condition).symm (equivShrink Condition (inc q))) = q - rw [Equiv.symm_apply_apply] - exact original.retract q - · intro p q - change (equivShrink Condition).symm p ≤ - (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ - restrict ((equivShrink Condition).symm p) ≤ q - rw [Equiv.symm_apply_apply] - exact original.le_include_iff _ q - · intro p q below - obtain ⟨r, rp, lower⟩ := original.lift ((equivShrink Condition).symm p) q below - refine ⟨equivShrink Condition r, ?_, ?_⟩ - · change (equivShrink Condition).symm (equivShrink Condition r) ≤ (equivShrink Condition).symm p - rw [Equiv.symm_apply_apply] - exact rp - · change restrict ((equivShrink Condition).symm (equivShrink Condition r)) = q - rw [Equiv.symm_apply_apply] - exact lower - -theorem flatSuccessorSmallInclusion_encode : - letI := smallOrder - ∀ q : P, (pres).encode (smallInc q) = s.encode q := by - let := smallOrder - intro q - change (pres).encode (equivShrink Condition (inc q)) = s.encode q - rw [M.flatSuccessorPresentation_encode] - exact FlatSuccessorCondition.includeLower_code M c s I T levels alpha tests F laws q - -theorem flatSuccessorSmallRestriction_encode : - letI := smallOrder - ∀ p : Shrink Condition, s.encode (smallRestrict p) = - ZFSet.pair (c.encode ((equivShrink Condition).symm p).row) - (assignmentCut levels alpha ((equivShrink Condition).symm p).assignments) := by - let := smallOrder - intro p - exact ((equivShrink Condition).symm p).lower_code - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "Q" => M.flatSuccessorCarrier c s I T levels alpha tests -local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "data" => M.flatSuccessorConditionData c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -local notation "restrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F - -theorem flatSuccessorSequence_projections_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (rows : c.carrier ∈ M.sets) (conditions : Q ∈ M.sets) (lower : s.carrier ∈ M.sets) - (assignments : stageOneAssignments I T ∈ M.sets) - (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (seq : Nat → Shrink Condition) - (whole : natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets) : - letI := smallOrder - natPresentation.graph s (fun n => restrict (seq n.down)) ∈ M.sets ∧ - groundSequenceGraph (fun n => data (seq n)) ∈ M.sets := by - let := smallOrder - have hB := M.groundSmallSubsets_mem powers separation assignments omega - have first := M.presentedRowAssignmentCutGraph_mem pairing unions powers separation - pres s restrict (fun p => c.encode ((equivShrink Condition).symm p).row) - (fun p => ((equivShrink Condition).symm p).assignments) levels alpha - (fun _ => rfl) (M.flatSuccessorSmallRestriction_encode c s I T levels alpha tests F) - conditions lower hLevels hAlpha - have second := M.flatSuccessorAssignmentGraph_mem c s I T levels alpha tests - pairing unions powers separation conditions rows assignments omega - rw [M.flatSuccessorAssignmentGraph_eq_graph c s I T levels alpha tests] at second - have lowerGraph := M.relationCompose_mem pairing unions powers separation omega conditions lower whole first - have dataGraph := M.relationCompose_mem pairing unions powers separation omega conditions hB whole second - have lowerEqual := natPresentation.relationCompose_graph pres s (fun n => seq n.down) restrict - have dataEqual := natPresentation.relationCompose_graph pres (SetMembers.presentation B) - (fun n => seq n.down) data - change relationCompose ZFSet.omega Q s.carrier - (natPresentation.graph pres (fun n => seq n.down)) ((pres).graph s restrict) = _ at lowerEqual - change relationCompose ZFSet.omega Q B - (natPresentation.graph pres (fun n => seq n.down)) ((pres).graph (SetMembers.presentation B) data) = _ at dataEqual - rw [lowerEqual] at lowerGraph - rw [dataEqual] at dataGraph - exact ⟨lowerGraph, dataGraph⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) {R P : Type u} -variable [PartialOrder R] [PartialOrder P] [OrderTop P] -variable (c : Presentation R) (s : Presentation P) -variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) -local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests -local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests -local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests -variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) -variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) -local notation "inc" => FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws - -@[instance_reducible] -noncomputable def flatSuccessorConditionTop : OrderTop Condition where - top := inc ⊤ - le_top p := (FlatSuccessorCondition.le_inclusion_iff M c s I T levels alpha tests F laws p ⊤).2 le_top - -@[instance_reducible] -noncomputable def flatSuccessorSmallTop : - letI := smallOrder - OrderTop (Shrink Condition) := by - let := smallOrder - exact { - top := equivShrink Condition (inc ⊤) - le_top := by - intro p - change (equivShrink Condition).symm p ≤ - (equivShrink Condition).symm (equivShrink Condition (inc ⊤)) - rw [Equiv.symm_apply_apply] - exact (FlatSuccessorCondition.le_inclusion_iff M c s I T levels alpha tests F laws _ ⊤).2 le_top } - -theorem flatSuccessorPresentation_top : - letI := smallOrder - letI := M.flatSuccessorSmallTop c s I T levels alpha tests F laws - (pres).encode ⊤ = s.encode ⊤ := by - let := smallOrder - let := M.flatSuccessorSmallTop c s I T levels alpha tests F laws - change (pres).encode (equivShrink Condition (inc ⊤)) = s.encode ⊤ - rw [M.flatSuccessorPresentation_encode] - exact FlatSuccessorCondition.includeLower_code M c s I T levels alpha tests F laws ⊤ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -variable {I0 I1 T2 : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) -variable (third : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) (natSetCode 2)) -include first second third - -theorem stageThreeFlatSuccessorLaws : - let I2 := M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid - FlatSuccessorLaws (stageOneAssignments (I0 ∪ I1) T) ((I0 ∪ I1) ∪ I2) T - (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) - (M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2) := by - refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ - · rw [stageOneAssignments_union (I0 ∪ I1) - (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) T] - exact fun _ hz => ZFSet.mem_union.2 (Or.inl hz) - · intro A _ z hz - rw [stageThreeAssignmentCut_two first second third] at hz - exact (ZFSet.mem_sep.1 hz).2 - · intro A subset - exact stageThreeAssignmentCut_two_eq first second third subset - · intro A p q tests below - exact M.refinementLevelTests_mono s pairing unions powers separation collection carrier order hT valid - a b d base directed system (natSetCode 2) T2 A tests below - · intro Aq Ap p _ - exact M.refinementLevelTests_stageThreeSplice s pairing unions powers separation collection - carrier order hT valid a b d base directed system first second third Aq Ap p - · intro A p subset - exact M.refinementLevelTests_stageThreeOld s pairing unions powers separation collection - carrier order hT valid a b d base directed system first second third p subset - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatRestrictionGraphs +import OAI.SetTheory.PartitionPrinciple.Geometry.RefinementLevelThreeTestGuards + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u +variable {P : Type u} [PartialOrder P] + +structure FlatSuccessorLaws (Jold I T levels alpha : ZFSet.{u}) + (tests : ZFSet.{u} → P → Prop) : Prop where + old_subset : Jold ⊆ stageOneAssignments I T + cut_subset : ∀ A, A ⊆ stageOneAssignments I T → assignmentCut levels alpha A ⊆ Jold + cut_old : ∀ A, A ⊆ Jold → assignmentCut levels alpha A = A + tests_mono : ∀ {A p q}, tests A p → q ≤ p → tests A q + tests_splice : ∀ Aq Ap p, Aq ⊆ Jold → + (tests (assignmentSplice levels alpha Aq Ap) p ↔ tests Ap p) + tests_old : ∀ A p, A ⊆ Jold → tests A p + +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} [PartialOrder R] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests + +namespace FlatSuccessorCondition +instance partialOrder : PartialOrder Condition where + le p q := p.row ≤ q.row ∧ q.assignments ⊆ p.assignments + le_refl _ := ⟨le_rfl, fun _ h => h⟩ + le_trans _ _ _ first second := ⟨first.1.trans second.1, fun _ h => first.2 (second.2 h)⟩ + le_antisymm p q first second := by + apply ext M c s I T levels alpha tests (le_antisymm first.1 second.1) + apply ZFSet.ext + intro z + exact ⟨fun h => second.2 h, fun h => first.2 h⟩ + +theorem le_iff (p q : Condition) : + p ≤ q ↔ p.row ≤ q.row ∧ q.assignments ⊆ p.assignments := Iff.rfl + +def rowProjection : Condition →o R where + toFun p := p.row + monotone' _ _ below := below.1 + +end FlatSuccessorCondition + +namespace TransitiveGround +@[instance_reducible] +noncomputable def flatSuccessorSmallOrder : PartialOrder (Shrink Condition) where + le p q := (equivShrink Condition).symm p ≤ (equivShrink Condition).symm q + le_refl _ := le_rfl + le_trans _ _ _ first second := first.trans second + le_antisymm _ _ first second := (equivShrink Condition).symm.injective (le_antisymm first second) + +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests + +noncomputable def flatSuccessorOrderIso : + letI := smallOrder + Condition ≃o Shrink Condition := by + let := smallOrder + exact { + toEquiv := equivShrink Condition + map_rel_iff' := by + intro p q + change (equivShrink Condition).symm (equivShrink Condition p) ≤ + (equivShrink Condition).symm (equivShrink Condition q) ↔ p ≤ q + simp only [Equiv.symm_apply_apply] } + +noncomputable def flatSuccessorFlatConditionSystem : + letI := smallOrder + FlatConditionSystem M c pres (stageOneAssignments I T) := by + let := smallOrder + exact { + row := fun p => ((equivShrink Condition).symm p).row + assignments := fun p => ((equivShrink Condition).symm p).assignments + encode := fun _ => rfl + le_iff := fun _ _ => Iff.rfl + assignments_mem := fun p => ((equivShrink Condition).symm p).assignments_mem } + +theorem flatSuccessorConditionOrder_eq : + letI := smallOrder + (pres).conditionOrder = rowAssignmentOrder (pres).carrier c.carrier + (M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega) c.conditionOrder := by + let := smallOrder + exact (M.flatSuccessorFlatConditionSystem c s I T levels alpha tests).conditionOrder_eq + +theorem flatSuccessorConditionOrder_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (rows : c.carrier ∈ M.sets) + (conditions : M.flatSuccessorCarrier c s I T levels alpha tests ∈ M.sets) + (hI : I ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (order : c.conditionOrder ∈ M.sets) : + letI := smallOrder + (pres).conditionOrder ∈ M.sets := by + let := smallOrder + exact (M.flatSuccessorFlatConditionSystem c s I T levels alpha tests).conditionOrder_mem + pairing unions powers separation rows conditions + (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega order + +end TransitiveGround +end + +section +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) + +namespace FlatSuccessorCondition +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) + +theorem lower_row (p : Condition) : F.row p.lower = p.row := + c.injective (ZFSet.pair_inj.1 ((F.encode p.lower).symm.trans p.lower_code)).1 + +theorem lower_assignments (p : Condition) : + F.assignments p.lower = assignmentCut levels alpha p.assignments := + (ZFSet.pair_inj.1 ((F.encode p.lower).symm.trans p.lower_code)).2 + +def restriction : Condition →o P where + toFun p := p.lower + monotone' := by + intro p q below + apply (F.le_iff p.lower q.lower).2 + constructor + · rw [lower_row M c s I T levels alpha tests F p, + lower_row M c s I T levels alpha tests F q] + exact below.1 + · rw [lower_assignments M c s I T levels alpha tests F p, + lower_assignments M c s I T levels alpha tests F q] + exact assignmentCut_mono below.2 + +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) + +noncomputable def includeLower (q : P) : Condition := by + have facts := (M.mem_groundSmallSubsets Jold ZFSet.omega _).1 (F.assignments_mem q) + have ground := facts.1 + have subsetOld := facts.2.1 + have small := facts.2.2 + refine ⟨F.row q, F.assignments q, ?_, q, ?_, ?_⟩ + · exact (M.mem_groundSmallSubsets _ _ _).2 + ⟨ground, fun _ hz => laws.old_subset (subsetOld hz), small⟩ + · rw [laws.cut_old _ subsetOld] + exact F.encode q + · exact laws.tests_old _ q subsetOld + +local notation "inc" => includeLower M c s I T levels alpha tests F laws +local notation "restrict" => restriction M c s I T levels alpha tests F + +theorem includeLower_lower (q : P) : (inc q).lower = q := rfl + +theorem includeLower_code (q : P) : + code M c s I T levels alpha tests (inc q) = s.encode q := (F.encode q).symm + +noncomputable def inclusion : P ↪o Condition where + toFun := inc + inj' _ _ equal := congrArg FlatSuccessorCondition.lower equal + map_rel_iff' := by + intro p q + exact (F.le_iff p q).symm + +theorem restriction_inclusion (q : P) : + restrict (inclusion M c s I T levels alpha tests F laws q) = q := rfl + +theorem le_inclusion_iff (p : Condition) (q : P) : + p ≤ inclusion M c s I T levels alpha tests F laws q ↔ restrict p ≤ q := by + change p.row ≤ F.row q ∧ F.assignments q ⊆ p.assignments ↔ p.lower ≤ q + rw [F.le_iff, lower_row M c s I T levels alpha tests F p, + lower_assignments M c s I T levels alpha tests F p] + apply and_congr_right + intro _ + have subsetOld := ((M.mem_groundSmallSubsets _ _ (F.assignments q)).1 + (F.assignments_mem q)).2.1 + constructor + · intro subset + have mono : assignmentCut levels alpha (F.assignments q) ⊆ + assignmentCut levels alpha p.assignments := assignmentCut_mono subset + rwa [laws.cut_old _ subsetOld] at mono + · intro subset + exact fun _ hz => assignmentCut_subset _ _ _ (subset hz) + +end FlatSuccessorCondition +end + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) + +namespace FlatSuccessorCondition +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) + +noncomputable def splice (p : Condition) (q : P) (below : q ≤ p.lower) : Condition := by + have old := ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1 + have memberq : F.assignments q ∈ M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega := + (includeLower M c s I T levels alpha tests F laws q).assignments_mem + exact { + row := F.row q + assignments := assignmentSplice levels alpha (F.assignments q) p.assignments + assignments_mem := M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation + infinite choice hLevels hAlpha memberq p.assignments_mem + lower := q + lower_code := by rw [assignmentCut_splice, laws.cut_old _ old]; exact F.encode q + tests := (laws.tests_splice _ _ q old).2 (laws.tests_mono p.tests below) } + +local notation "lifted" => splice M c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + +theorem splice_row (p : Condition) (q : P) (below : q ≤ p.lower) : + (lifted p q below).row = F.row q := rfl + +theorem splice_assignments (p : Condition) (q : P) (below : q ≤ p.lower) : + (lifted p q below).assignments = + assignmentSplice levels alpha (F.assignments q) p.assignments := rfl + +theorem splice_lower (p : Condition) (q : P) (below : q ≤ p.lower) : + (lifted p q below).lower = q := rfl + +theorem splice_le (p : Condition) (q : P) (below : q ≤ p.lower) : lifted p q below ≤ p := by + obtain ⟨rows, data⟩ := (F.le_iff q p.lower).1 below + have lowerRow := lower_row M c s I T levels alpha tests F p + have lowerData := lower_assignments M c s I T levels alpha tests F p + refine ⟨rows.trans_eq lowerRow, ?_⟩ + change p.assignments ⊆ assignmentSplice levels alpha (F.assignments q) p.assignments + apply assignmentSplice_extends + rw [laws.cut_old _ ((M.mem_groundSmallSubsets _ _ _).1 (F.assignments_mem q)).2.1, + ← lowerData] + exact data + +include laws pairing unions powers separation infinite choice hLevels hAlpha in +theorem exists_lift_restriction (p : Condition) (q : P) (below : q ≤ p.lower) : + ∃ r : Condition, r ≤ p ∧ r.lower = q ∧ r.row = F.row q ∧ + r.assignments = assignmentSplice levels alpha (F.assignments q) p.assignments := + ⟨lifted p q below, splice_le M c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha p q below, rfl, rfl, rfl⟩ + +include laws pairing unions powers separation infinite choice hLevels hAlpha in +theorem completeProjection : + CompleteProjection (restriction M c s I T levels alpha tests F) + (inclusion M c s I T levels alpha tests F laws) := by + refine ⟨restriction_inclusion M c s I T levels alpha tests F laws, + le_inclusion_iff M c s I T levels alpha tests F laws, ?_⟩ + intro p q below + obtain ⟨r, rp, lower, _, _⟩ := exists_lift_restriction M c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha p q below + exact ⟨r, rp, lower⟩ + +end FlatSuccessorCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "restrict" => FlatSuccessorCondition.restriction M c s I T levels alpha tests F +local notation "inc" => FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws + +noncomputable def flatSuccessorSmallRestriction : + letI := smallOrder + Shrink Condition →o P := by + let := smallOrder + exact { + toFun := fun p => restrict ((equivShrink Condition).symm p) + monotone' := fun _ _ below => (restrict).monotone below } + +noncomputable def flatSuccessorSmallInclusion : + letI := smallOrder + P ↪o Shrink Condition := by + let := smallOrder + exact { + toFun := fun p => equivShrink Condition (inc p) + inj' := fun _ _ equal => (inc).injective ((equivShrink Condition).injective equal) + map_rel_iff' := by + intro p q + change (equivShrink Condition).symm (equivShrink Condition (inc p)) ≤ + (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ p ≤ q + simp only [Equiv.symm_apply_apply] + exact (inc).map_rel_iff } + +local notation "smallRestrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F +local notation "smallInc" => M.flatSuccessorSmallInclusion c s I T levels alpha tests F laws + +include laws in +theorem flatSuccessorSmallCompleteProjection + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) : + letI := smallOrder + CompleteProjection smallRestrict smallInc := by + let := smallOrder + have original := FlatSuccessorCondition.completeProjection M c s I T levels alpha tests F laws + pairing unions powers separation infinite choice hLevels hAlpha + refine ⟨?_, ?_, ?_⟩ + · intro q + change restrict ((equivShrink Condition).symm (equivShrink Condition (inc q))) = q + rw [Equiv.symm_apply_apply] + exact original.retract q + · intro p q + change (equivShrink Condition).symm p ≤ + (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ + restrict ((equivShrink Condition).symm p) ≤ q + rw [Equiv.symm_apply_apply] + exact original.le_include_iff _ q + · intro p q below + obtain ⟨r, rp, lower⟩ := original.lift ((equivShrink Condition).symm p) q below + refine ⟨equivShrink Condition r, ?_, ?_⟩ + · change (equivShrink Condition).symm (equivShrink Condition r) ≤ (equivShrink Condition).symm p + rw [Equiv.symm_apply_apply] + exact rp + · change restrict ((equivShrink Condition).symm (equivShrink Condition r)) = q + rw [Equiv.symm_apply_apply] + exact lower + +theorem flatSuccessorSmallInclusion_encode : + letI := smallOrder + ∀ q : P, (pres).encode (smallInc q) = s.encode q := by + let := smallOrder + intro q + change (pres).encode (equivShrink Condition (inc q)) = s.encode q + rw [M.flatSuccessorPresentation_encode] + exact FlatSuccessorCondition.includeLower_code M c s I T levels alpha tests F laws q + +theorem flatSuccessorSmallRestriction_encode : + letI := smallOrder + ∀ p : Shrink Condition, s.encode (smallRestrict p) = + ZFSet.pair (c.encode ((equivShrink Condition).symm p).row) + (assignmentCut levels alpha ((equivShrink Condition).symm p).assignments) := by + let := smallOrder + intro p + exact ((equivShrink Condition).symm p).lower_code + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "Q" => M.flatSuccessorCarrier c s I T levels alpha tests +local notation "B" => M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "data" => M.flatSuccessorConditionData c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +local notation "restrict" => M.flatSuccessorSmallRestriction c s I T levels alpha tests F + +theorem flatSuccessorSequence_projections_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (rows : c.carrier ∈ M.sets) (conditions : Q ∈ M.sets) (lower : s.carrier ∈ M.sets) + (assignments : stageOneAssignments I T ∈ M.sets) + (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (seq : Nat → Shrink Condition) + (whole : natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets) : + letI := smallOrder + natPresentation.graph s (fun n => restrict (seq n.down)) ∈ M.sets ∧ + groundSequenceGraph (fun n => data (seq n)) ∈ M.sets := by + let := smallOrder + have hB := M.groundSmallSubsets_mem powers separation assignments omega + have first := M.presentedRowAssignmentCutGraph_mem pairing unions powers separation + pres s restrict (fun p => c.encode ((equivShrink Condition).symm p).row) + (fun p => ((equivShrink Condition).symm p).assignments) levels alpha + (fun _ => rfl) (M.flatSuccessorSmallRestriction_encode c s I T levels alpha tests F) + conditions lower hLevels hAlpha + have second := M.flatSuccessorAssignmentGraph_mem c s I T levels alpha tests + pairing unions powers separation conditions rows assignments omega + rw [M.flatSuccessorAssignmentGraph_eq_graph c s I T levels alpha tests] at second + have lowerGraph := M.relationCompose_mem pairing unions powers separation omega conditions lower whole first + have dataGraph := M.relationCompose_mem pairing unions powers separation omega conditions hB whole second + have lowerEqual := natPresentation.relationCompose_graph pres s (fun n => seq n.down) restrict + have dataEqual := natPresentation.relationCompose_graph pres (SetMembers.presentation B) + (fun n => seq n.down) data + change relationCompose ZFSet.omega Q s.carrier + (natPresentation.graph pres (fun n => seq n.down)) ((pres).graph s restrict) = _ at lowerEqual + change relationCompose ZFSet.omega Q B + (natPresentation.graph pres (fun n => seq n.down)) ((pres).graph (SetMembers.presentation B) data) = _ at dataEqual + rw [lowerEqual] at lowerGraph + rw [dataEqual] at dataGraph + exact ⟨lowerGraph, dataGraph⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) {R P : Type u} +variable [PartialOrder R] [PartialOrder P] [OrderTop P] +variable (c : Presentation R) (s : Presentation P) +variable (I T levels alpha : ZFSet.{u}) (tests : ZFSet.{u} → P → Prop) +local notation "Condition" => FlatSuccessorCondition M c s I T levels alpha tests +local notation "smallOrder" => M.flatSuccessorSmallOrder c s I T levels alpha tests +local notation "pres" => M.flatSuccessorPresentation c s I T levels alpha tests +variable {Jold : ZFSet.{u}} (F : FlatConditionSystem M c s Jold) +variable (laws : FlatSuccessorLaws Jold I T levels alpha tests) +local notation "inc" => FlatSuccessorCondition.inclusion M c s I T levels alpha tests F laws + +@[instance_reducible] +noncomputable def flatSuccessorConditionTop : OrderTop Condition where + top := inc ⊤ + le_top p := (FlatSuccessorCondition.le_inclusion_iff M c s I T levels alpha tests F laws p ⊤).2 le_top + +@[instance_reducible] +noncomputable def flatSuccessorSmallTop : + letI := smallOrder + OrderTop (Shrink Condition) := by + let := smallOrder + exact { + top := equivShrink Condition (inc ⊤) + le_top := by + intro p + change (equivShrink Condition).symm p ≤ + (equivShrink Condition).symm (equivShrink Condition (inc ⊤)) + rw [Equiv.symm_apply_apply] + exact (FlatSuccessorCondition.le_inclusion_iff M c s I T levels alpha tests F laws _ ⊤).2 le_top } + +theorem flatSuccessorPresentation_top : + letI := smallOrder + letI := M.flatSuccessorSmallTop c s I T levels alpha tests F laws + (pres).encode ⊤ = s.encode ⊤ := by + let := smallOrder + let := M.flatSuccessorSmallTop c s I T levels alpha tests F laws + change (pres).encode (equivShrink Condition (inc ⊤)) = s.encode ⊤ + rw [M.flatSuccessorPresentation_encode] + exact FlatSuccessorCondition.includeLower_code M c s I T levels alpha tests F laws ⊤ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +variable {I0 I1 T2 : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode I1 (natSetCode 1)) +variable (third : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) (natSetCode 2)) +include first second third + +theorem stageThreeFlatSuccessorLaws : + let I2 := M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid + FlatSuccessorLaws (stageOneAssignments (I0 ∪ I1) T) ((I0 ∪ I1) ∪ I2) T + (stageThreeAssignmentLevels I0 I1 I2 T) (natSetCode 2) + (M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2) := by + refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ + · rw [stageOneAssignments_union (I0 ∪ I1) + (M.niceRefinementIndices a s b d (natSetCode 2) T T2 valid) T] + exact fun _ hz => ZFSet.mem_union.2 (Or.inl hz) + · intro A _ z hz + rw [stageThreeAssignmentCut_two first second third] at hz + exact (ZFSet.mem_sep.1 hz).2 + · intro A subset + exact stageThreeAssignmentCut_two_eq first second third subset + · intro A p q tests below + exact M.refinementLevelTests_mono s pairing unions powers separation collection carrier order hT valid + a b d base directed system (natSetCode 2) T2 A tests below + · intro Aq Ap p _ + exact M.refinementLevelTests_stageThreeSplice s pairing unions powers separation collection + carrier order hT valid a b d base directed system first second third Aq Ap p + · intro A p subset + exact M.refinementLevelTests_stageThreeOld s pairing unions powers separation collection + carrier order hT valid a b d base directed system first second third p subset + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoAtomicLifting.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoAtomicLifting.lean index 95d98345e4fcce7cb55d0160fb7ff0ad9e527df5..0473f2a4c8e39feb146bbc1277ebdb748f2be2c2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoAtomicLifting.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoAtomicLifting.lean @@ -1,79 +1,79 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -local notation "restrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) -include infinite choice hI0 hI1 - -theorem stageTwoNameLift_forcesEq : - letI := smallOrder - ∀ (q : Shrink Condition) (σ τ : Name s), - Name.ForcesEq q (liftName σ) (liftName τ) ↔ Name.ForcesEq (restrict q) σ τ := by - let := smallOrder - intro q σ τ - exact Name.forcesEq_rename_completeProjection s (pres) restrict inc - (M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - infinite choice hI0 hI1) q σ τ - -theorem stageTwoNameLift_forcesMem : - letI := smallOrder - ∀ (q : Shrink Condition) (σ τ : Name s), - Name.ForcesMem q (liftName σ) (liftName τ) ↔ Name.ForcesMem (restrict q) σ τ := by - let := smallOrder - intro q σ τ - exact Name.forcesMem_rename_completeProjection s (pres) restrict inc - (M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - infinite choice hI0 hI1) q σ τ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +local notation "restrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) +include infinite choice hI0 hI1 + +theorem stageTwoNameLift_forcesEq : + letI := smallOrder + ∀ (q : Shrink Condition) (σ τ : Name s), + Name.ForcesEq q (liftName σ) (liftName τ) ↔ Name.ForcesEq (restrict q) σ τ := by + let := smallOrder + intro q σ τ + exact Name.forcesEq_rename_completeProjection s (pres) restrict inc + (M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + infinite choice hI0 hI1) q σ τ + +theorem stageTwoNameLift_forcesMem : + letI := smallOrder + ∀ (q : Shrink Condition) (σ τ : Name s), + Name.ForcesMem q (liftName σ) (liftName τ) ↔ Name.ForcesMem (restrict q) σ τ := by + let := smallOrder + intro q σ τ + exact Name.forcesMem_rename_completeProjection s (pres) restrict inc + (M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + infinite choice hI0 hI1) q σ τ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoIndexAnchors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoIndexAnchors.lean index b4d5f86a7ef10b0fc8c8137c5d917229bc424a9e..b5da60ce3a7cc59d112f55a69284f5dcbabf6c6c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoIndexAnchors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoIndexAnchors.lean @@ -1,88 +1,88 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -theorem refinementIndexFieldGraph_union (I J B : ZFSet.{u}) (j : Fin 6) : - refinementIndexFieldGraph (I ∪ J) B j = - refinementIndexFieldGraph I B j ∪ refinementIndexFieldGraph J B j := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hz).1) - obtain ⟨hx, hy, fields, ex, ey⟩ := - (pair_mem_refinementIndexFieldGraph (I ∪ J) B x y j).1 hz - rcases ZFSet.mem_union.1 hx with hi | hj - · exact ZFSet.mem_union.2 (Or.inl ((pair_mem_refinementIndexFieldGraph I B x y j).2 - ⟨hi, hy, fields, ex, ey⟩)) - · exact ZFSet.mem_union.2 (Or.inr ((pair_mem_refinementIndexFieldGraph J B x y j).2 - ⟨hj, hy, fields, ex, ey⟩)) - · intro hz - rcases ZFSet.mem_union.1 hz with hi | hj - · obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hi).1) - obtain ⟨hx, hy, fields, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph I B x y j).1 hi - exact (pair_mem_refinementIndexFieldGraph (I ∪ J) B x y j).2 - ⟨ZFSet.mem_union.2 (Or.inl hx), hy, fields, ex, ey⟩ - · obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hj).1) - obtain ⟨hx, hy, fields, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph J B x y j).1 hj - exact (pair_mem_refinementIndexFieldGraph (I ∪ J) B x y j).2 - ⟨ZFSet.mem_union.2 (Or.inr hx), hy, fields, ex, ey⟩ - -theorem refinementIndexAnchor_union_entry {L : Type u} (b : Presentation L) - (I J level : ZFSet.{u}) (C E : L) (U Rf Rc y : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) y ∈ - refinementIndexFieldGraph (I ∪ J) b.carrier 2 ↔ - refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc ∈ I ∪ J ∧ y = b.encode E := by - rw [refinementIndexCode, refinementIndexFieldGraph_entry] - change (_ ∈ I ∪ J ∧ y ∈ b.carrier ∧ y = b.encode E) ↔ (_ ∈ I ∪ J ∧ y = b.encode E) - constructor - · exact fun h => ⟨h.1, h.2.2⟩ - · rintro ⟨member, rfl⟩ - exact ⟨member, b.encode_mem E, rfl⟩ - -namespace NiceRefinementIndexSystem -variable {M : TransitiveGround.{u}} {G P Q L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] [PartialOrder L] -variable {a : PosetAction G P} {e : PosetAction G Q} -variable {s : Presentation P} {t : Presentation Q} {b : Presentation L} {d : PosetAction G L} -variable {level next T T2 U U2 : ZFSet.{u}} -variable {valid : ∀ z ∈ T, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} -variable {upperValid : ∀ z ∈ U, IsName t z} {upperValid2 : ∀ z ∈ U2, IsName t z} -local notation "I" => M.niceRefinementIndices a s b d level T T2 valid -local notation "J" => M.niceRefinementIndices e t b d next U U2 upperValid - -theorem union_anchor_data - (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) - (second : NiceRefinementIndexSystem M e t b d next U U2 upperValid upperValid2) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (nodes : b.carrier ∈ M.sets) : - I ∪ J ∈ M.sets ∧ refinementIndexFieldGraph (I ∪ J) b.carrier 2 ∈ M.sets ∧ - ZFSet.IsFunc (I ∪ J) b.carrier (refinementIndexFieldGraph (I ∪ J) b.carrier 2) ∧ - refinementIndexFieldGraph (I ∪ J) b.carrier 2 = - refinementIndexFieldGraph I b.carrier 2 ∪ refinementIndexFieldGraph J b.carrier 2 := by - have ground := M.binary_union_mem pairing unions first.index_ground second.index_ground - refine ⟨ground, M.refinementIndexFieldGraph_mem pairing unions powers separation ground nodes 2, - ?_, refinementIndexFieldGraph_union I J b.carrier 2⟩ - apply refinementIndexFieldGraph_function - intro z hz - rcases ZFSet.mem_union.1 hz with hi | hj - · obtain ⟨C, E, X, Rf, Rc, equal⟩ := first.decoded z hi - exact ⟨![level, b.encode C, b.encode E, X.val.val, Rf.val.val, Rc.val.val], equal, b.encode_mem E⟩ - · obtain ⟨C, E, X, Rf, Rc, equal⟩ := second.decoded z hj - exact ⟨![next, b.encode C, b.encode E, X.val.val, Rf.val.val, Rc.val.val], equal, b.encode_mem E⟩ - -end NiceRefinementIndexSystem - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +theorem refinementIndexFieldGraph_union (I J B : ZFSet.{u}) (j : Fin 6) : + refinementIndexFieldGraph (I ∪ J) B j = + refinementIndexFieldGraph I B j ∪ refinementIndexFieldGraph J B j := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hz).1) + obtain ⟨hx, hy, fields, ex, ey⟩ := + (pair_mem_refinementIndexFieldGraph (I ∪ J) B x y j).1 hz + rcases ZFSet.mem_union.1 hx with hi | hj + · exact ZFSet.mem_union.2 (Or.inl ((pair_mem_refinementIndexFieldGraph I B x y j).2 + ⟨hi, hy, fields, ex, ey⟩)) + · exact ZFSet.mem_union.2 (Or.inr ((pair_mem_refinementIndexFieldGraph J B x y j).2 + ⟨hj, hy, fields, ex, ey⟩)) + · intro hz + rcases ZFSet.mem_union.1 hz with hi | hj + · obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hi).1) + obtain ⟨hx, hy, fields, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph I B x y j).1 hi + exact (pair_mem_refinementIndexFieldGraph (I ∪ J) B x y j).2 + ⟨ZFSet.mem_union.2 (Or.inl hx), hy, fields, ex, ey⟩ + · obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 ((ZFSet.mem_sep.1 hj).1) + obtain ⟨hx, hy, fields, ex, ey⟩ := (pair_mem_refinementIndexFieldGraph J B x y j).1 hj + exact (pair_mem_refinementIndexFieldGraph (I ∪ J) B x y j).2 + ⟨ZFSet.mem_union.2 (Or.inr hx), hy, fields, ex, ey⟩ + +theorem refinementIndexAnchor_union_entry {L : Type u} (b : Presentation L) + (I J level : ZFSet.{u}) (C E : L) (U Rf Rc y : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) y ∈ + refinementIndexFieldGraph (I ∪ J) b.carrier 2 ↔ + refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc ∈ I ∪ J ∧ y = b.encode E := by + rw [refinementIndexCode, refinementIndexFieldGraph_entry] + change (_ ∈ I ∪ J ∧ y ∈ b.carrier ∧ y = b.encode E) ↔ (_ ∈ I ∪ J ∧ y = b.encode E) + constructor + · exact fun h => ⟨h.1, h.2.2⟩ + · rintro ⟨member, rfl⟩ + exact ⟨member, b.encode_mem E, rfl⟩ + +namespace NiceRefinementIndexSystem +variable {M : TransitiveGround.{u}} {G P Q L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] [PartialOrder L] +variable {a : PosetAction G P} {e : PosetAction G Q} +variable {s : Presentation P} {t : Presentation Q} {b : Presentation L} {d : PosetAction G L} +variable {level next T T2 U U2 : ZFSet.{u}} +variable {valid : ∀ z ∈ T, IsName s z} {valid2 : ∀ z ∈ T2, IsName s z} +variable {upperValid : ∀ z ∈ U, IsName t z} {upperValid2 : ∀ z ∈ U2, IsName t z} +local notation "I" => M.niceRefinementIndices a s b d level T T2 valid +local notation "J" => M.niceRefinementIndices e t b d next U U2 upperValid + +theorem union_anchor_data + (first : NiceRefinementIndexSystem M a s b d level T T2 valid valid2) + (second : NiceRefinementIndexSystem M e t b d next U U2 upperValid upperValid2) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (nodes : b.carrier ∈ M.sets) : + I ∪ J ∈ M.sets ∧ refinementIndexFieldGraph (I ∪ J) b.carrier 2 ∈ M.sets ∧ + ZFSet.IsFunc (I ∪ J) b.carrier (refinementIndexFieldGraph (I ∪ J) b.carrier 2) ∧ + refinementIndexFieldGraph (I ∪ J) b.carrier 2 = + refinementIndexFieldGraph I b.carrier 2 ∪ refinementIndexFieldGraph J b.carrier 2 := by + have ground := M.binary_union_mem pairing unions first.index_ground second.index_ground + refine ⟨ground, M.refinementIndexFieldGraph_mem pairing unions powers separation ground nodes 2, + ?_, refinementIndexFieldGraph_union I J b.carrier 2⟩ + apply refinementIndexFieldGraph_function + intro z hz + rcases ZFSet.mem_union.1 hz with hi | hj + · obtain ⟨C, E, X, Rf, Rc, equal⟩ := first.decoded z hi + exact ⟨![level, b.encode C, b.encode E, X.val.val, Rf.val.val, Rc.val.val], equal, b.encode_mem E⟩ + · obtain ⟨C, E, X, Rf, Rc, equal⟩ := second.decoded z hj + exact ⟨![next, b.encode C, b.encode E, X.val.val, Rf.val.val, Rc.val.val], equal, b.encode_mem E⟩ + +end NiceRefinementIndexSystem + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoProjectedFilters.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoProjectedFilters.lean index f4c1acd28d6133b03aaf298d621573c3e196ad12..a917653d66a1943dbc04b210d496bae2df0fc7b2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoProjectedFilters.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoProjectedFilters.lean @@ -1,103 +1,103 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) -local notation "projection" => M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - infinite choice hI0 hI1 -local notation "pi" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F - -noncomputable def stageTwoProjectedFilter : - letI := smallOrder - ConditionFilter (Shrink Condition) → ConditionFilter P := by - letI := smallOrder - exact (projection).projectedFilter - -local notation "project" => M.stageTwoProjectedFilter c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - infinite choice hI0 hI1 - -theorem stageTwoProjectedFilter_mem_iff : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (p : P), - (project H).mem p ↔ ∃ q : Shrink Condition, H.mem q ∧ pi q = p := by - let instProjectedFilterMemSmallOrder := smallOrder - exact (projection).projectedFilter_mem_iff - -theorem stageTwoProjectedFilter_codedGeneric - (rows : c.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)), H.GenericFor (M.codedFamily (pres)) → - (project H).GenericFor (M.codedFamily s) := by - let instProjectedFilterGenericSmallOrder := smallOrder - intro H generic - have upperCarrier : (pres).carrier ∈ M.sets := - M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation - rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega - have graph := M.stageTwoSmallRestriction_graph_mem c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F rows hI0 nodeOrder omega - exact M.completeProjection_codedGeneric (pres) s (projection) - pairing unions powers separation upperCarrier carrier graph H generic - -theorem stageTwoProjectedFilter_eval : - letI := smallOrder - ∀ (H : ConditionFilter (Shrink Condition)) (tau : Name s), - Name.eval H.mem (M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices - base directed system F first second tau) = Name.eval (project H).mem tau := by - let instProjectedFilterEvalSmallOrder := smallOrder - intro H tau - exact M.stageTwoNameLift_eval c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices - base directed system F first second H.mem tau - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) +local notation "projection" => M.stageTwoSmallCompleteProjection c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + infinite choice hI0 hI1 +local notation "pi" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F + +noncomputable def stageTwoProjectedFilter : + letI := smallOrder + ConditionFilter (Shrink Condition) → ConditionFilter P := by + letI := smallOrder + exact (projection).projectedFilter + +local notation "project" => M.stageTwoProjectedFilter c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + infinite choice hI0 hI1 + +theorem stageTwoProjectedFilter_mem_iff : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (p : P), + (project H).mem p ↔ ∃ q : Shrink Condition, H.mem q ∧ pi q = p := by + let instProjectedFilterMemSmallOrder := smallOrder + exact (projection).projectedFilter_mem_iff + +theorem stageTwoProjectedFilter_codedGeneric + (rows : c.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)), H.GenericFor (M.codedFamily (pres)) → + (project H).GenericFor (M.codedFamily s) := by + let instProjectedFilterGenericSmallOrder := smallOrder + intro H generic + have upperCarrier : (pres).carrier ∈ M.sets := + M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation + rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega + have graph := M.stageTwoSmallRestriction_graph_mem c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F rows hI0 nodeOrder omega + exact M.completeProjection_codedGeneric (pres) s (projection) + pairing unions powers separation upperCarrier carrier graph H generic + +theorem stageTwoProjectedFilter_eval : + letI := smallOrder + ∀ (H : ConditionFilter (Shrink Condition)) (tau : Name s), + Name.eval H.mem (M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices + base directed system F first second tau) = Name.eval (project H).mem tau := by + let instProjectedFilterEvalSmallOrder := smallOrder + intro H tau + exact M.stageTwoNameLift_eval c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices + base directed system F first second H.mem tau + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoRefinementObjects.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoRefinementObjects.lean index 5eb846e8299b978f280f8cf4e6ceabadc71285e7..9d434e9eef63b3f080f2a64b7fea4a12e8662ace 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoRefinementObjects.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStageTwoRefinementObjects.lean @@ -1,260 +1,260 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameLiftFamilies - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -local notation "smallTop" => M.stageTwoConditionSmallTop c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -theorem stageTwo_orderedPairNameFamily (X Y : ZFSet.{u}) : - letI := smallOrder - letI := smallTop - orderedPairNameFamily ((pres).encode ⊤) X Y = - orderedPairNameFamily (s.encode ⊤) X Y := by - let := smallOrder - let := smallTop - rw [M.stageTwoConditionPresentation_top c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second] - -theorem stageTwo_iteratedPairNameFamily (X : ZFSet.{u}) (n : Nat) : - letI := smallOrder - letI := smallTop - iteratedPairNameFamily ((pres).encode ⊤) X n = - iteratedPairNameFamily (s.encode ⊤) X n := by - let := smallOrder - let := smallTop - rw [M.stageTwoConditionPresentation_top c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second] - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -local notation "smallTop" => M.stageTwoConditionSmallTop c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -include F first second infinite choice hI0 hI1 in -theorem stageTwoRefinementStageSystem - (t : Presentation G) - (parameters : StageOneActionParameters M a s t b d T T2 valid) - (hT2 : T2 ∈ M.sets) - (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) - (maps : letI := smallOrder; (smallAct).conditionMapFamily (pres) t ∈ M.sets) - (supports : supportBasisCode b t d.principalFix ∈ M.sets) - (children1 : ∀ τ : Name s, τ.val ∈ T → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) - (children2 : ∀ τ : Name s, τ.val ∈ T2 → - HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) : - letI := smallOrder - letI := smallTop - RefinementStageSystem M (smallAct) (pres) t b d base directed (natSetCode 2) T T2 := by - let := smallOrder - let := smallTop - obtain ⟨nextValid1, nextClosed1, nextHS1⟩ := - M.stageTwoNameFamily_transport c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second - rowAction image inputs infinite choice hI0 hI1 - (d.principalSupportFamily base directed) T valid parameters.terms_closed children1 - obtain ⟨nextValid2, nextClosed2, nextHS2⟩ := - M.stageTwoNameFamily_transport c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F first second - rowAction image inputs infinite choice hI0 hI1 - (d.principalSupportFamily base directed) T2 valid2 parameters.pairs_closed children2 - have omega := M.omega_mem separation infinite - have nextCarrier : (pres).carrier ∈ M.sets := - M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation - rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega - have nextOrder := M.stageTwoConditionOrder_mem c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rows hI0 rowOrder nodeOrder omega - exact M.refinementStageSystem (smallAct) (pres) t b d base directed - pairing unions powers separation collection nextCarrier nextOrder group nodes nodeOrder maps - parameters.node_maps supports (M.natSetCode_mem separation infinite 2) hT hT2 - nextValid1 nextValid2 nextClosed1 nextClosed2 nextHS1 nextHS2 - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second -local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F first second -variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) -variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers - separation collection carrier order hT base directed system rowAction image) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) -local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system rowAction image inputs - -local notation "smallTop" => M.stageTwoConditionSmallTop c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -include infinite hI0 in -theorem stageTwoRefinementObjects - (t : Presentation G) - (next : - letI := M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - letI := M.stageTwoConditionSmallTop c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - RefinementStageSystem M - (M.stageTwoSmallAction c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system rowAction image inputs) - (M.stageTwoConditionPresentation c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system) - t b d base directed (natSetCode 2) T T2) - (hT2 : T2 ∈ M.sets) - (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) : - letI := smallOrder - letI := smallTop - ∀ C E (U Rf Rc : (M.nameDomain (pres)).names), - refinementIndexCode (natSetCode 2) (b.encode C) (b.encode E) - U.val.val Rf.val.val Rc.val.val ∈ - M.niceRefinementIndices (smallAct) (pres) b d (natSetCode 2) T T2 next.valid1 → - RefinementObjectSystem M (smallAct) (pres) (d.principalSupportFamily base directed) - (d.principalFix C) T next.valid1 U.val Rf.val Rc.val := by - let := smallOrder - let := smallTop - have omega := M.omega_mem separation infinite - have nextCarrier : (pres).carrier ∈ M.sets := - M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation - rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega - have nextOrder := M.stageTwoConditionOrder_mem c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - rows hI0 rowOrder nodeOrder omega - exact (M.niceRefinementObjects (smallAct) (pres) b d base directed - pairing unions powers separation collection (M.natSetCode_mem separation infinite 2) - hT hT2 nextCarrier nextOrder nodes nodeOrder next.inputs.terms_closed next.terms_hs - next.first next.second).2 - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNameLiftFamilies + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +local notation "smallTop" => M.stageTwoConditionSmallTop c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +theorem stageTwo_orderedPairNameFamily (X Y : ZFSet.{u}) : + letI := smallOrder + letI := smallTop + orderedPairNameFamily ((pres).encode ⊤) X Y = + orderedPairNameFamily (s.encode ⊤) X Y := by + let := smallOrder + let := smallTop + rw [M.stageTwoConditionPresentation_top c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second] + +theorem stageTwo_iteratedPairNameFamily (X : ZFSet.{u}) (n : Nat) : + letI := smallOrder + letI := smallTop + iteratedPairNameFamily ((pres).encode ⊤) X n = + iteratedPairNameFamily (s.encode ⊤) X n := by + let := smallOrder + let := smallTop + rw [M.stageTwoConditionPresentation_top c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second] + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +local notation "smallTop" => M.stageTwoConditionSmallTop c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +include F first second infinite choice hI0 hI1 in +theorem stageTwoRefinementStageSystem + (t : Presentation G) + (parameters : StageOneActionParameters M a s t b d T T2 valid) + (hT2 : T2 ∈ M.sets) + (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) (group : t.carrier ∈ M.sets) + (maps : letI := smallOrder; (smallAct).conditionMapFamily (pres) t ∈ M.sets) + (supports : supportBasisCode b t d.principalFix ∈ M.sets) + (children1 : ∀ τ : Name s, τ.val ∈ T → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) + (children2 : ∀ τ : Name s, τ.val ∈ T2 → + HereditarilySymmetric a s (d.principalSupportFamily base directed) τ) : + letI := smallOrder + letI := smallTop + RefinementStageSystem M (smallAct) (pres) t b d base directed (natSetCode 2) T T2 := by + let := smallOrder + let := smallTop + obtain ⟨nextValid1, nextClosed1, nextHS1⟩ := + M.stageTwoNameFamily_transport c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second + rowAction image inputs infinite choice hI0 hI1 + (d.principalSupportFamily base directed) T valid parameters.terms_closed children1 + obtain ⟨nextValid2, nextClosed2, nextHS2⟩ := + M.stageTwoNameFamily_transport c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F first second + rowAction image inputs infinite choice hI0 hI1 + (d.principalSupportFamily base directed) T2 valid2 parameters.pairs_closed children2 + have omega := M.omega_mem separation infinite + have nextCarrier : (pres).carrier ∈ M.sets := + M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation + rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega + have nextOrder := M.stageTwoConditionOrder_mem c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rows hI0 rowOrder nodeOrder omega + exact M.refinementStageSystem (smallAct) (pres) t b d base directed + pairing unions powers separation collection nextCarrier nextOrder group nodes nodeOrder maps + parameters.node_maps supports (M.natSetCode_mem separation infinite 2) hT hT2 + nextValid1 nextValid2 nextClosed1 nextClosed2 nextHS1 nextHS2 + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +local notation "incl" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second +local notation "liftName" => M.stageTwoNameLift c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F first second +variable (rowAction : PosetAction G R) (image : G → ZFSet.{u} → ZFSet.{u}) +variable (inputs : StageTwoConditionActionInputs M c I0 a s b d T T2 valid pairing unions powers + separation collection carrier order hT base directed system rowAction image) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) +local notation "smallAct" => M.stageTwoSmallAction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system rowAction image inputs + +local notation "smallTop" => M.stageTwoConditionSmallTop c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +include infinite hI0 in +theorem stageTwoRefinementObjects + (t : Presentation G) + (next : + letI := M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + letI := M.stageTwoConditionSmallTop c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + RefinementStageSystem M + (M.stageTwoSmallAction c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system rowAction image inputs) + (M.stageTwoConditionPresentation c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system) + t b d base directed (natSetCode 2) T T2) + (hT2 : T2 ∈ M.sets) + (rows : c.carrier ∈ M.sets) (rowOrder : c.conditionOrder ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) : + letI := smallOrder + letI := smallTop + ∀ C E (U Rf Rc : (M.nameDomain (pres)).names), + refinementIndexCode (natSetCode 2) (b.encode C) (b.encode E) + U.val.val Rf.val.val Rc.val.val ∈ + M.niceRefinementIndices (smallAct) (pres) b d (natSetCode 2) T T2 next.valid1 → + RefinementObjectSystem M (smallAct) (pres) (d.principalSupportFamily base directed) + (d.principalFix C) T next.valid1 U.val Rf.val Rc.val := by + let := smallOrder + let := smallTop + have omega := M.omega_mem separation infinite + have nextCarrier : (pres).carrier ∈ M.sets := + M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation + rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega + have nextOrder := M.stageTwoConditionOrder_mem c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + rows hI0 rowOrder nodeOrder omega + exact (M.niceRefinementObjects (smallAct) (pres) b d base directed + pairing unions powers separation collection (M.natSetCode_mem separation infinite 2) + hT hT2 nextCarrier nextOrder nodes nodeOrder next.inputs.terms_closed next.terms_hs + next.first next.second).2 + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStandardInaccessible.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStandardInaccessible.lean index f0dfd70d6bf07903af9addc3e1a921852da28f9f..4010b4163e96bb3b5bdccd3919d58f0a40abcb71 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStandardInaccessible.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStandardInaccessible.lean @@ -1,479 +1,479 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundInaccessibleConditions -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCantorDiagonal -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOmegaOneRowModel -import OAI.SetTheory.PartitionPrinciple.Models.GroundChoiceEnumerationTraces -import OAI.SetTheory.PartitionPrinciple.Models.GroundSupportedEqualityChoices - -namespace OAI - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem InjectionCode.retarget {A B C f : ZFSet.{u}} (code : InjectionCode A B f) - (subset : B ⊆ C) : InjectionCode A C f := by - refine ⟨⟨?_, code.function.2⟩, code.injective⟩ - intro z entry - obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 entry) - exact ZFSet.pair_mem_prod.2 ⟨hx, subset hy⟩ - -theorem TransitiveGround.groundEmbeddable_retarget {M : TransitiveGround.{u}} {A B C : ZFSet.{u}} - (small : M.groundEmbeddable A B) (subset : B ⊆ C) : M.groundEmbeddable A C := by - obtain ⟨f, hf, code⟩ := small - exact ⟨f, hf, code.retarget subset⟩ - -theorem ordinalSetProperty_pair_bound {K α β : ZFSet.{u}} - (ordinal : ordinalSetProperty K) (hα : α ∈ K) (hβ : β ∈ K) : - ∃ γ ∈ K, α ⊆ γ ∧ β ⊆ γ := by - rcases ordinalSetProperty_mem_compare ordinal hα hβ with lower | rfl | greater - · exact ⟨β, hβ, fun x hx => ordinal.2 β hβ α lower x hx, fun _ hx => hx⟩ - · exact ⟨α, hα, fun _ hx => hx, fun _ hx => hx⟩ - · exact ⟨α, hα, fun _ hx => hx, fun x hx => ordinal.2 α hα β greater x hx⟩ - -namespace GroundBelow -variable {M : TransitiveGround.{u}} {A B K : ZFSet.{u}} - -theorem common_bound (first : GroundBelow M A K) (second : GroundBelow M B K) - (ordinal : ordinalSetProperty K) : - ∃ γ ∈ K, M.groundEmbeddable A γ ∧ M.groundEmbeddable B γ := by - obtain ⟨α, hα, first⟩ := first - obtain ⟨β, hβ, second⟩ := second - obtain ⟨γ, hγ, left, right⟩ := ordinalSetProperty_pair_bound ordinal hα hβ - exact ⟨γ, hγ, TransitiveGround.groundEmbeddable_retarget first left, TransitiveGround.groundEmbeddable_retarget second right⟩ - -theorem of_member - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hK : K ∈ M.sets) (hA : A ∈ K) : GroundBelow M A K := - ⟨A, hA, identityFunctionGraph A, - M.identityFunctionGraph_mem pairing unions powers separation (M.transitive hK hA), - identityFunctionGraph_injection A⟩ - -end GroundBelow - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -namespace GroundCardinal -variable {M : TransitiveGround.{u}} {κ η : ZFSet.{u}} - -theorem subset_of_embeddable (cardinal : GroundCardinal M κ) - (ordinal : ordinalSetProperty η) (embedding : M.groundEmbeddable κ η) : κ ⊆ η := by - obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff κ).1 cardinal.1 - obtain ⟨b, eqB⟩ := (ordinalSetProperty_iff η).1 ordinal - by_cases lower : b < a - · have member : η ∈ κ := by rw [eqA, eqB, mem_ordinalCode_iff]; exact lower - exact False.elim (cardinal.2 η member embedding) - · rw [eqA, eqB, ordinalCode_subset_iff] - exact le_of_not_gt lower - -theorem embeddable_iff_subset (cardinal : GroundCardinal M κ) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hκ : κ ∈ M.sets) (ordinal : ordinalSetProperty η) : - M.groundEmbeddable κ η ↔ κ ⊆ η := by - refine ⟨cardinal.subset_of_embeddable ordinal, fun subset => ?_⟩ - exact ⟨identityFunctionGraph κ, M.identityFunctionGraph_mem pairing unions powers separation hκ, - (identityFunctionGraph_injection κ).retarget subset⟩ - -theorem eq_of_mutual (first : GroundCardinal M κ) (second : GroundCardinal M η) - (forward : M.groundEmbeddable κ η) (backward : M.groundEmbeddable η κ) : κ = η := - ZFSet.ext fun _ => ⟨fun hx => first.subset_of_embeddable second.1 forward hx, - fun hx => second.subset_of_embeddable first.1 backward hx⟩ - -end GroundCardinal - -theorem groundCardinal_iff_no_smaller_mutual - (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {κ : ZFSet.{u}} (hκ : κ ∈ M.sets) : - GroundCardinal M κ ↔ ordinalSetProperty κ ∧ ∀ β ∈ κ, - ¬ (M.groundEmbeddable κ β ∧ M.groundEmbeddable β κ) := by - constructor - · exact fun h => ⟨h.1, fun β hβ both => h.2 β hβ both.1⟩ - · rintro ⟨ordinal, minimal⟩ - refine ⟨ordinal, fun β hβ forward => minimal β hβ ⟨forward, ?_⟩⟩ - exact ⟨identityFunctionGraph β, - M.identityFunctionGraph_mem pairing unions powers separation (M.transitive hκ hβ), - (identityFunctionGraph_injection β).retarget (fun x hx => ordinal.1 β hβ x hx)⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -namespace GroundRegular -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} - -theorem cofinal_regular (regular : GroundRegular M K) : GroundCofinalRegular M K := by - intro α hα f hf cofinal - obtain ⟨δ, hδ, bounded⟩ := regular α hα f hf cofinal.1 - obtain ⟨x, _, y, _, entry, comparison⟩ := cofinal.2 δ hδ - have lower := bounded x y entry - rcases comparison with rfl | above - · exact ZFSet.mem_irrefl _ lower - · exact ZFSet.mem_asymm lower above - -end GroundRegular - -namespace GroundCofinalRegular -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} - -theorem regular (cofinalRegular : GroundCofinalRegular M K) (ordinal : ordinalSetProperty K) : - GroundRegular M K := by - classical - intro α hα f hf function - have missing : ∃ δ ∈ K, ¬ ∃ x ∈ α, ∃ y ∈ K, - ZFSet.pair x y ∈ f ∧ (δ = y ∨ δ ∈ y) := by - by_contra noMissing - apply cofinalRegular α hα f hf - refine ⟨function, ?_⟩ - intro β hβ - by_contra gap - exact noMissing ⟨β, hβ, gap⟩ - obtain ⟨δ, hδ, gap⟩ := missing - refine ⟨δ, hδ, ?_⟩ - intro x y entry - obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (function.1 entry) - rcases ordinalSetProperty_mem_compare ordinal hδ hy with above | equal | below - · exact False.elim (gap ⟨x, hx, y, hy, entry, Or.inr above⟩) - · exact False.elim (gap ⟨x, hx, y, hy, entry, Or.inl equal⟩) - · exact below - -theorem iff_regular (ordinal : ordinalSetProperty K) : - GroundCofinalRegular M K ↔ GroundRegular M K := - ⟨fun regularity => regularity.regular ordinal, GroundRegular.cofinal_regular⟩ - -end GroundCofinalRegular - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem exists_groundCardinalRepresentative {α : ZFSet.{u}} - (hα : α ∈ M.sets) (ordinal : ordinalSetProperty α) : - ∃ κ ∈ M.sets, GroundCardinal M κ ∧ (κ = α ∨ κ ∈ α) ∧ - ∃ f ∈ M.sets, InjectionCode α κ f ∧ - identityFunctionGraph κ ∈ M.sets ∧ InjectionCode κ α (identityFunctionGraph κ) := by - classical - let candidates : Set ZFSet.{u} := {κ | (κ = α ∨ κ ∈ α) ∧ M.groundEmbeddable α κ} - have present : candidates.Nonempty := ⟨α, Or.inl rfl, identityFunctionGraph α, - M.identityFunctionGraph_mem pairing unions powers separation hα, - identityFunctionGraph_injection α⟩ - obtain ⟨κ, member, minimal⟩ := ZFSet.mem_wf.has_min candidates present - have bound : κ = α ∨ κ ∈ α := member.1 - have hκ : κ ∈ M.sets := bound.elim (fun equal => equal ▸ hα) (M.transitive hα) - have ordκ : ordinalSetProperty κ := bound.elim (fun equal => equal ▸ ordinal) - (ordinalSetProperty_member ordinal) - have subset : κ ⊆ α := bound.elim (fun equal => equal ▸ (fun _ hx => hx)) - (fun smaller x hx => ordinal.1 κ smaller x hx) - obtain ⟨f, hf, forward⟩ := member.2 - have cardinal : GroundCardinal M κ := by - refine ⟨ordκ, fun β hβ smaller => ?_⟩ - obtain ⟨g, hg, injection⟩ := smaller - have hβM := M.transitive hκ hβ - have candidate : β ∈ candidates := ⟨Or.inr (subset hβ), - relationCompose α κ β f g, - M.relationCompose_mem pairing unions powers separation hα hκ hβM hf hg, - forward.compose injection⟩ - exact minimal β candidate hβ - exact ⟨κ, hκ, cardinal, bound, f, hf, forward, - M.identityFunctionGraph_mem pairing unions powers separation hκ, - (identityFunctionGraph_injection κ).retarget subset⟩ - -theorem groundCardinalRepresentative_least {α κ : ZFSet.{u}} - (hα : α ∈ M.sets) (hκ : κ ∈ M.sets) - (cardinal : GroundCardinal M κ) (backward : M.groundEmbeddable κ α) - {β : ZFSet.{u}} (hβ : β ∈ M.sets) (ordinal : ordinalSetProperty β) - (forward : M.groundEmbeddable α β) : κ ⊆ β := by - obtain ⟨f, hf, first⟩ := backward - obtain ⟨g, hg, second⟩ := forward - exact cardinal.subset_of_embeddable ordinal - ⟨relationCompose κ α β f g, - M.relationCompose_mem pairing unions powers separation hκ hα hβ hf hg, - first.compose second⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem ordinalRelation_embeds - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {A K e : ZFSet.{u}} (hA : A ∈ M.sets) (hK : K ∈ M.sets) (he : e ∈ M.sets) - (cardinal : GroundCardinal M K) - (covers : ∀ x ∈ A, ∃ beta ∈ K, ZFSet.pair beta x ∈ e) - (initial : ∀ beta ∈ K, GroundBelow M (relationImage (insert beta beta) A e) K) : - M.groundEmbeddable A K := by - classical - obtain ⟨c, hc, chooser, least⟩ := M.exists_ordinalRelationChoice pairing unions powers separation - choice hA hK he cardinal.1 covers - obtain ⟨f, hf, trace⟩ := M.exists_choiceEnumerationTrace pairing unions powers separation collection - hA hc hK cardinal.1 chooser - have onto : ∀ x ∈ A, ∃ a ∈ K, ZFSet.pair a x ∈ f := by - intro x hx - by_contra missing - obtain ⟨beta, hBeta, betaX⟩ := covers x hx - have unused : ∀ a ∈ K, (enumerationRemainder A a (graphRestriction a f)).Nonempty := by - intro a ha - refine ⟨x, (mem_enumerationRemainder _ _ _ _).2 ⟨hx, ?_⟩⟩ - rintro ⟨b, hb, entry⟩ - exact missing ⟨b, cardinal.1.1 a ha b hb, (pair_mem_graphRestriction.1 entry).1⟩ - have injection := choiceEnumerationTrace_injection chooser cardinal.1 trace unused - have bounded : InjectionCode K (relationImage (insert beta beta) A e) f := by - refine ⟨⟨?_, injection.function.2⟩, injection.injective⟩ - intro z hz - obtain ⟨a, ha, y, hy, rfl⟩ := ZFSet.mem_prod.1 (injection.function.1 hz) - have step := trace.2 a ha y hz - rcases step with ⟨R, _hR, rfl, selected⟩ | ⟨empty, _⟩ - · obtain ⟨i, hi, entry, minimal⟩ := least _ y selected - have ix : i ∈ insert beta beta := by - rcases ordinalSetProperty_mem_compare cardinal.1 hi hBeta with before | equal | after - · exact ZFSet.mem_insert_of_mem beta before - · exact equal ▸ ZFSet.mem_insert beta beta - · apply False.elim - apply minimal beta after x - · apply (mem_enumerationRemainder _ _ _ _).2 - refine ⟨hx, ?_⟩ - rintro ⟨b, hb, bx⟩ - exact missing ⟨b, cardinal.1.1 a ha b hb, (pair_mem_graphRestriction.1 bx).1⟩ - · exact betaX - exact ZFSet.pair_mem_prod.2 ⟨ha, - (mem_relationImage _ _ _ _).2 ⟨hy, i, ix, entry⟩⟩ - · exact False.elim (empty (unused a ha)) - obtain ⟨delta, hd, small⟩ := initial beta hBeta - have targetGround := M.relationImage_mem separation - (M.insert_mem pairing unions (M.transitive hK hBeta) (M.transitive hK hBeta)) hA he - obtain ⟨r, hr, code⟩ := small - have contradiction : M.groundEmbeddable K delta := - ⟨relationCompose K (relationImage (insert beta beta) A e) delta f r, - M.relationCompose_mem pairing unions powers separation hK targetGround - (M.transitive hK hd) hf hr, bounded.compose code⟩ - exact cardinal.2 delta hd contradiction - let g := ZFSet.sep (fun z => z ∈ ZFSet.prod K A) f - have hg : g ∈ M.sets := M.injection_restriction_mem separation hK hA hf - have partialCode : PartialFunctionCode K A g := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ - intro x y z first second - exact (functionCode_partial trace.1.to_isFunc).unique x y z - (ZFSet.mem_sep.1 first).1 (ZFSet.mem_sep.1 second).1 - apply M.groundEmbeddable_of_partial_surjection pairing unions powers separation choice hK hA hg partialCode - intro x hx - obtain ⟨a, ha, entry⟩ := onto x hx - exact ⟨a, ha, ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 ⟨ha, hx⟩⟩⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -theorem GroundStrongLimit.cardinal_strongLimit {M : TransitiveGround.{u}} {K : ZFSet.{u}} - (strong : GroundStrongLimit M K) : GroundCardinalStrongLimit M K := - fun κ hκ _ => strong κ hκ - -namespace GroundCardinalStrongLimit -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} - -theorem to_groundStrongLimit (strong : GroundCardinalStrongLimit M K) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) : GroundStrongLimit M K := by - intro α hα - have hαM := M.transitive hK hα - obtain ⟨κ, hκM, cardinal, bound, f, hf, injection, _, _⟩ := - M.exists_groundCardinalRepresentative pairing unions powers separation hαM - (ordinalSetProperty_member ordinal hα) - have hκ : κ ∈ K := bound.elim (fun equal => equal ▸ hα) (ordinal.1 α hα κ) - exact (strong κ hκ cardinal).of_embeddable pairing unions powers separation - (M.groundPower_mem powers hαM) (M.groundPower_mem powers hκM) hK - (M.groundEmbeddable_power pairing unions powers separation hαM hκM ⟨f, hf, injection⟩) - -theorem iff_groundStrongLimit - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) : - GroundCardinalStrongLimit M K ↔ GroundStrongLimit M K := - ⟨fun strong => strong.to_groundStrongLimit pairing unions powers separation hK ordinal, - GroundStrongLimit.cardinal_strongLimit⟩ - -end GroundCardinalStrongLimit - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) - -theorem groundOmegaOne_subset_of_not_countable {α : ZFSet.{u}} - (ordinal : ordinalSetProperty α) (uncountable : ¬ M.groundEmbeddable α ZFSet.omega) : - M.groundOmegaOne pairing unions powers separation collection infinite ⊆ α := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff α).1 ordinal - obtain ⟨c, eqC⟩ := (ordinalSetProperty_iff _).1 spec.2.1 - by_cases lower : a < c - · have inside : α ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by - rw [eqA, eqC, mem_ordinalCode_iff] - exact lower - exact False.elim (uncountable ((spec.2.2.1 α).1 inside).2.2) - · rw [eqC, eqA, ordinalCode_subset_iff] - exact le_of_not_gt lower - -end TransitiveGround - -namespace GroundInaccessibleConditions -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (conditions : GroundInaccessibleConditions M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (hK : K ∈ M.sets) -include conditions hK - -theorem groundOmegaOne_bound : - ∃ α ∈ K, M.groundOmegaOne pairing unions powers separation collection infinite ⊆ α := by - have hOmega := M.omega_mem separation infinite - have hPower := M.groundPower_mem powers hOmega - obtain ⟨α, hα, f, hf, injection⟩ := conditions.2.2.2 ZFSet.omega conditions.2.1 - have hAlpha := M.transitive hK hα - have uncountable : ¬ M.groundEmbeddable α ZFSet.omega := by - rintro ⟨g, hg, countable⟩ - apply M.groundPower_not_embeddable_self powers separation hOmega - exact ⟨relationCompose (M.groundPower ZFSet.omega) α ZFSet.omega f g, - M.relationCompose_mem pairing unions powers separation hPower hAlpha hOmega hf hg, - injection.compose countable⟩ - exact ⟨α, hα, M.groundOmegaOne_subset_of_not_countable pairing unions powers separation - collection infinite (ordinalSetProperty_member conditions.1 hα) uncountable⟩ - -theorem groundOmegaOne_below : - GroundBelow M (M.groundOmegaOne pairing unions powers separation collection infinite) K := by - obtain ⟨α, hα, subset⟩ := conditions.groundOmegaOne_bound pairing unions powers separation - collection infinite hK - let C := M.groundOmegaOne pairing unions powers separation collection infinite - exact ⟨α, hα, identityFunctionGraph C, - M.identityFunctionGraph_mem pairing unions powers separation - (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1, - (identityFunctionGraph_injection C).retarget subset⟩ - -theorem groundOmegaOne_mem : - M.groundOmegaOne pairing unions powers separation collection infinite ∈ K := by - obtain ⟨α, hα, subset⟩ := conditions.groundOmegaOne_bound pairing unions powers separation - collection infinite hK - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - obtain ⟨c, eqC⟩ := (ordinalSetProperty_iff _).1 spec.2.1 - obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff α).1 (ordinalSetProperty_member conditions.1 hα) - have bound : c ≤ a := by - rw [eqC, eqA] at subset - exact (ordinalCode_subset_iff c a).1 subset - rcases lt_or_eq_of_le bound with lower | same - · apply conditions.1.1 α hα - rw [eqC, eqA, mem_ordinalCode_iff] - exact lower - · rw [eqC, same, ← eqA] - exact hα - -end GroundInaccessibleConditions - - - - -namespace GroundStandardInaccessible -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} -variable (standard : GroundStandardInaccessible M K) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (hK : K ∈ M.sets) -include standard pairing unions powers separation hK - -theorem omega_mem : ZFSet.omega ∈ K := by - obtain ⟨k, eqK⟩ := (ordinalSetProperty_iff K).1 standard.1.1 - by_cases greater : Ordinal.omega0 < k - · rw [eqK, ← ordinalCode_omega, mem_ordinalCode_iff] - exact greater - · have subset : K ⊆ ZFSet.omega := by - rw [eqK, ← ordinalCode_omega, ordinalCode_subset_iff] - exact le_of_not_gt greater - exact False.elim (standard.2.1 ⟨identityFunctionGraph K, - M.identityFunctionGraph_mem pairing unions powers separation hK, - (identityFunctionGraph_injection K).retarget subset⟩) - -theorem to_conditions : GroundInaccessibleConditions M K := - ⟨standard.1.1, standard.omega_mem pairing unions powers separation hK, - standard.2.2.1.regular standard.1.1, - standard.2.2.2.to_groundStrongLimit pairing unions powers separation hK standard.1.1⟩ - -end GroundStandardInaccessible - -namespace GroundInaccessibleConditions -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} - -theorem to_standard (conditions : GroundInaccessibleConditions M K) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hK : K ∈ M.sets) : GroundStandardInaccessible M K := - ⟨conditions.internal_cardinal pairing unions powers separation hK, - conditions.not_countable pairing unions powers separation hK, - conditions.2.2.1.cofinal_regular, conditions.2.2.2.cardinal_strongLimit⟩ - -end GroundInaccessibleConditions - -theorem groundStandardInaccessible_iff_conditions - (M : TransitiveGround.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {K : ZFSet.{u}} (hK : K ∈ M.sets) : - GroundStandardInaccessible M K ↔ GroundInaccessibleConditions M K := - ⟨fun standard => standard.to_conditions pairing unions powers separation hK, - fun conditions => conditions.to_standard pairing unions powers separation hK⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundInaccessibleConditions +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCantorDiagonal +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundOmegaOneRowModel +import OAI.SetTheory.PartitionPrinciple.Models.GroundChoiceEnumerationTraces +import OAI.SetTheory.PartitionPrinciple.Models.GroundSupportedEqualityChoices + +namespace OAI + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem InjectionCode.retarget {A B C f : ZFSet.{u}} (code : InjectionCode A B f) + (subset : B ⊆ C) : InjectionCode A C f := by + refine ⟨⟨?_, code.function.2⟩, code.injective⟩ + intro z entry + obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 entry) + exact ZFSet.pair_mem_prod.2 ⟨hx, subset hy⟩ + +theorem TransitiveGround.groundEmbeddable_retarget {M : TransitiveGround.{u}} {A B C : ZFSet.{u}} + (small : M.groundEmbeddable A B) (subset : B ⊆ C) : M.groundEmbeddable A C := by + obtain ⟨f, hf, code⟩ := small + exact ⟨f, hf, code.retarget subset⟩ + +theorem ordinalSetProperty_pair_bound {K α β : ZFSet.{u}} + (ordinal : ordinalSetProperty K) (hα : α ∈ K) (hβ : β ∈ K) : + ∃ γ ∈ K, α ⊆ γ ∧ β ⊆ γ := by + rcases ordinalSetProperty_mem_compare ordinal hα hβ with lower | rfl | greater + · exact ⟨β, hβ, fun x hx => ordinal.2 β hβ α lower x hx, fun _ hx => hx⟩ + · exact ⟨α, hα, fun _ hx => hx, fun _ hx => hx⟩ + · exact ⟨α, hα, fun _ hx => hx, fun x hx => ordinal.2 α hα β greater x hx⟩ + +namespace GroundBelow +variable {M : TransitiveGround.{u}} {A B K : ZFSet.{u}} + +theorem common_bound (first : GroundBelow M A K) (second : GroundBelow M B K) + (ordinal : ordinalSetProperty K) : + ∃ γ ∈ K, M.groundEmbeddable A γ ∧ M.groundEmbeddable B γ := by + obtain ⟨α, hα, first⟩ := first + obtain ⟨β, hβ, second⟩ := second + obtain ⟨γ, hγ, left, right⟩ := ordinalSetProperty_pair_bound ordinal hα hβ + exact ⟨γ, hγ, TransitiveGround.groundEmbeddable_retarget first left, TransitiveGround.groundEmbeddable_retarget second right⟩ + +theorem of_member + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hK : K ∈ M.sets) (hA : A ∈ K) : GroundBelow M A K := + ⟨A, hA, identityFunctionGraph A, + M.identityFunctionGraph_mem pairing unions powers separation (M.transitive hK hA), + identityFunctionGraph_injection A⟩ + +end GroundBelow + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +namespace GroundCardinal +variable {M : TransitiveGround.{u}} {κ η : ZFSet.{u}} + +theorem subset_of_embeddable (cardinal : GroundCardinal M κ) + (ordinal : ordinalSetProperty η) (embedding : M.groundEmbeddable κ η) : κ ⊆ η := by + obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff κ).1 cardinal.1 + obtain ⟨b, eqB⟩ := (ordinalSetProperty_iff η).1 ordinal + by_cases lower : b < a + · have member : η ∈ κ := by rw [eqA, eqB, mem_ordinalCode_iff]; exact lower + exact False.elim (cardinal.2 η member embedding) + · rw [eqA, eqB, ordinalCode_subset_iff] + exact le_of_not_gt lower + +theorem embeddable_iff_subset (cardinal : GroundCardinal M κ) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hκ : κ ∈ M.sets) (ordinal : ordinalSetProperty η) : + M.groundEmbeddable κ η ↔ κ ⊆ η := by + refine ⟨cardinal.subset_of_embeddable ordinal, fun subset => ?_⟩ + exact ⟨identityFunctionGraph κ, M.identityFunctionGraph_mem pairing unions powers separation hκ, + (identityFunctionGraph_injection κ).retarget subset⟩ + +theorem eq_of_mutual (first : GroundCardinal M κ) (second : GroundCardinal M η) + (forward : M.groundEmbeddable κ η) (backward : M.groundEmbeddable η κ) : κ = η := + ZFSet.ext fun _ => ⟨fun hx => first.subset_of_embeddable second.1 forward hx, + fun hx => second.subset_of_embeddable first.1 backward hx⟩ + +end GroundCardinal + +theorem groundCardinal_iff_no_smaller_mutual + (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {κ : ZFSet.{u}} (hκ : κ ∈ M.sets) : + GroundCardinal M κ ↔ ordinalSetProperty κ ∧ ∀ β ∈ κ, + ¬ (M.groundEmbeddable κ β ∧ M.groundEmbeddable β κ) := by + constructor + · exact fun h => ⟨h.1, fun β hβ both => h.2 β hβ both.1⟩ + · rintro ⟨ordinal, minimal⟩ + refine ⟨ordinal, fun β hβ forward => minimal β hβ ⟨forward, ?_⟩⟩ + exact ⟨identityFunctionGraph β, + M.identityFunctionGraph_mem pairing unions powers separation (M.transitive hκ hβ), + (identityFunctionGraph_injection β).retarget (fun x hx => ordinal.1 β hβ x hx)⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +namespace GroundRegular +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} + +theorem cofinal_regular (regular : GroundRegular M K) : GroundCofinalRegular M K := by + intro α hα f hf cofinal + obtain ⟨δ, hδ, bounded⟩ := regular α hα f hf cofinal.1 + obtain ⟨x, _, y, _, entry, comparison⟩ := cofinal.2 δ hδ + have lower := bounded x y entry + rcases comparison with rfl | above + · exact ZFSet.mem_irrefl _ lower + · exact ZFSet.mem_asymm lower above + +end GroundRegular + +namespace GroundCofinalRegular +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} + +theorem regular (cofinalRegular : GroundCofinalRegular M K) (ordinal : ordinalSetProperty K) : + GroundRegular M K := by + classical + intro α hα f hf function + have missing : ∃ δ ∈ K, ¬ ∃ x ∈ α, ∃ y ∈ K, + ZFSet.pair x y ∈ f ∧ (δ = y ∨ δ ∈ y) := by + by_contra noMissing + apply cofinalRegular α hα f hf + refine ⟨function, ?_⟩ + intro β hβ + by_contra gap + exact noMissing ⟨β, hβ, gap⟩ + obtain ⟨δ, hδ, gap⟩ := missing + refine ⟨δ, hδ, ?_⟩ + intro x y entry + obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (function.1 entry) + rcases ordinalSetProperty_mem_compare ordinal hδ hy with above | equal | below + · exact False.elim (gap ⟨x, hx, y, hy, entry, Or.inr above⟩) + · exact False.elim (gap ⟨x, hx, y, hy, entry, Or.inl equal⟩) + · exact below + +theorem iff_regular (ordinal : ordinalSetProperty K) : + GroundCofinalRegular M K ↔ GroundRegular M K := + ⟨fun regularity => regularity.regular ordinal, GroundRegular.cofinal_regular⟩ + +end GroundCofinalRegular + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem exists_groundCardinalRepresentative {α : ZFSet.{u}} + (hα : α ∈ M.sets) (ordinal : ordinalSetProperty α) : + ∃ κ ∈ M.sets, GroundCardinal M κ ∧ (κ = α ∨ κ ∈ α) ∧ + ∃ f ∈ M.sets, InjectionCode α κ f ∧ + identityFunctionGraph κ ∈ M.sets ∧ InjectionCode κ α (identityFunctionGraph κ) := by + classical + let candidates : Set ZFSet.{u} := {κ | (κ = α ∨ κ ∈ α) ∧ M.groundEmbeddable α κ} + have present : candidates.Nonempty := ⟨α, Or.inl rfl, identityFunctionGraph α, + M.identityFunctionGraph_mem pairing unions powers separation hα, + identityFunctionGraph_injection α⟩ + obtain ⟨κ, member, minimal⟩ := ZFSet.mem_wf.has_min candidates present + have bound : κ = α ∨ κ ∈ α := member.1 + have hκ : κ ∈ M.sets := bound.elim (fun equal => equal ▸ hα) (M.transitive hα) + have ordκ : ordinalSetProperty κ := bound.elim (fun equal => equal ▸ ordinal) + (ordinalSetProperty_member ordinal) + have subset : κ ⊆ α := bound.elim (fun equal => equal ▸ (fun _ hx => hx)) + (fun smaller x hx => ordinal.1 κ smaller x hx) + obtain ⟨f, hf, forward⟩ := member.2 + have cardinal : GroundCardinal M κ := by + refine ⟨ordκ, fun β hβ smaller => ?_⟩ + obtain ⟨g, hg, injection⟩ := smaller + have hβM := M.transitive hκ hβ + have candidate : β ∈ candidates := ⟨Or.inr (subset hβ), + relationCompose α κ β f g, + M.relationCompose_mem pairing unions powers separation hα hκ hβM hf hg, + forward.compose injection⟩ + exact minimal β candidate hβ + exact ⟨κ, hκ, cardinal, bound, f, hf, forward, + M.identityFunctionGraph_mem pairing unions powers separation hκ, + (identityFunctionGraph_injection κ).retarget subset⟩ + +theorem groundCardinalRepresentative_least {α κ : ZFSet.{u}} + (hα : α ∈ M.sets) (hκ : κ ∈ M.sets) + (cardinal : GroundCardinal M κ) (backward : M.groundEmbeddable κ α) + {β : ZFSet.{u}} (hβ : β ∈ M.sets) (ordinal : ordinalSetProperty β) + (forward : M.groundEmbeddable α β) : κ ⊆ β := by + obtain ⟨f, hf, first⟩ := backward + obtain ⟨g, hg, second⟩ := forward + exact cardinal.subset_of_embeddable ordinal + ⟨relationCompose κ α β f g, + M.relationCompose_mem pairing unions powers separation hκ hα hβ hf hg, + first.compose second⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem ordinalRelation_embeds + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {A K e : ZFSet.{u}} (hA : A ∈ M.sets) (hK : K ∈ M.sets) (he : e ∈ M.sets) + (cardinal : GroundCardinal M K) + (covers : ∀ x ∈ A, ∃ beta ∈ K, ZFSet.pair beta x ∈ e) + (initial : ∀ beta ∈ K, GroundBelow M (relationImage (insert beta beta) A e) K) : + M.groundEmbeddable A K := by + classical + obtain ⟨c, hc, chooser, least⟩ := M.exists_ordinalRelationChoice pairing unions powers separation + choice hA hK he cardinal.1 covers + obtain ⟨f, hf, trace⟩ := M.exists_choiceEnumerationTrace pairing unions powers separation collection + hA hc hK cardinal.1 chooser + have onto : ∀ x ∈ A, ∃ a ∈ K, ZFSet.pair a x ∈ f := by + intro x hx + by_contra missing + obtain ⟨beta, hBeta, betaX⟩ := covers x hx + have unused : ∀ a ∈ K, (enumerationRemainder A a (graphRestriction a f)).Nonempty := by + intro a ha + refine ⟨x, (mem_enumerationRemainder _ _ _ _).2 ⟨hx, ?_⟩⟩ + rintro ⟨b, hb, entry⟩ + exact missing ⟨b, cardinal.1.1 a ha b hb, (pair_mem_graphRestriction.1 entry).1⟩ + have injection := choiceEnumerationTrace_injection chooser cardinal.1 trace unused + have bounded : InjectionCode K (relationImage (insert beta beta) A e) f := by + refine ⟨⟨?_, injection.function.2⟩, injection.injective⟩ + intro z hz + obtain ⟨a, ha, y, hy, rfl⟩ := ZFSet.mem_prod.1 (injection.function.1 hz) + have step := trace.2 a ha y hz + rcases step with ⟨R, _hR, rfl, selected⟩ | ⟨empty, _⟩ + · obtain ⟨i, hi, entry, minimal⟩ := least _ y selected + have ix : i ∈ insert beta beta := by + rcases ordinalSetProperty_mem_compare cardinal.1 hi hBeta with before | equal | after + · exact ZFSet.mem_insert_of_mem beta before + · exact equal ▸ ZFSet.mem_insert beta beta + · apply False.elim + apply minimal beta after x + · apply (mem_enumerationRemainder _ _ _ _).2 + refine ⟨hx, ?_⟩ + rintro ⟨b, hb, bx⟩ + exact missing ⟨b, cardinal.1.1 a ha b hb, (pair_mem_graphRestriction.1 bx).1⟩ + · exact betaX + exact ZFSet.pair_mem_prod.2 ⟨ha, + (mem_relationImage _ _ _ _).2 ⟨hy, i, ix, entry⟩⟩ + · exact False.elim (empty (unused a ha)) + obtain ⟨delta, hd, small⟩ := initial beta hBeta + have targetGround := M.relationImage_mem separation + (M.insert_mem pairing unions (M.transitive hK hBeta) (M.transitive hK hBeta)) hA he + obtain ⟨r, hr, code⟩ := small + have contradiction : M.groundEmbeddable K delta := + ⟨relationCompose K (relationImage (insert beta beta) A e) delta f r, + M.relationCompose_mem pairing unions powers separation hK targetGround + (M.transitive hK hd) hf hr, bounded.compose code⟩ + exact cardinal.2 delta hd contradiction + let g := ZFSet.sep (fun z => z ∈ ZFSet.prod K A) f + have hg : g ∈ M.sets := M.injection_restriction_mem separation hK hA hf + have partialCode : PartialFunctionCode K A g := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).2, ?_⟩ + intro x y z first second + exact (functionCode_partial trace.1.to_isFunc).unique x y z + (ZFSet.mem_sep.1 first).1 (ZFSet.mem_sep.1 second).1 + apply M.groundEmbeddable_of_partial_surjection pairing unions powers separation choice hK hA hg partialCode + intro x hx + obtain ⟨a, ha, entry⟩ := onto x hx + exact ⟨a, ha, ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2 ⟨ha, hx⟩⟩⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +theorem GroundStrongLimit.cardinal_strongLimit {M : TransitiveGround.{u}} {K : ZFSet.{u}} + (strong : GroundStrongLimit M K) : GroundCardinalStrongLimit M K := + fun κ hκ _ => strong κ hκ + +namespace GroundCardinalStrongLimit +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} + +theorem to_groundStrongLimit (strong : GroundCardinalStrongLimit M K) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) : GroundStrongLimit M K := by + intro α hα + have hαM := M.transitive hK hα + obtain ⟨κ, hκM, cardinal, bound, f, hf, injection, _, _⟩ := + M.exists_groundCardinalRepresentative pairing unions powers separation hαM + (ordinalSetProperty_member ordinal hα) + have hκ : κ ∈ K := bound.elim (fun equal => equal ▸ hα) (ordinal.1 α hα κ) + exact (strong κ hκ cardinal).of_embeddable pairing unions powers separation + (M.groundPower_mem powers hαM) (M.groundPower_mem powers hκM) hK + (M.groundEmbeddable_power pairing unions powers separation hαM hκM ⟨f, hf, injection⟩) + +theorem iff_groundStrongLimit + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hK : K ∈ M.sets) (ordinal : ordinalSetProperty K) : + GroundCardinalStrongLimit M K ↔ GroundStrongLimit M K := + ⟨fun strong => strong.to_groundStrongLimit pairing unions powers separation hK ordinal, + GroundStrongLimit.cardinal_strongLimit⟩ + +end GroundCardinalStrongLimit + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) + +theorem groundOmegaOne_subset_of_not_countable {α : ZFSet.{u}} + (ordinal : ordinalSetProperty α) (uncountable : ¬ M.groundEmbeddable α ZFSet.omega) : + M.groundOmegaOne pairing unions powers separation collection infinite ⊆ α := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff α).1 ordinal + obtain ⟨c, eqC⟩ := (ordinalSetProperty_iff _).1 spec.2.1 + by_cases lower : a < c + · have inside : α ∈ M.groundOmegaOne pairing unions powers separation collection infinite := by + rw [eqA, eqC, mem_ordinalCode_iff] + exact lower + exact False.elim (uncountable ((spec.2.2.1 α).1 inside).2.2) + · rw [eqC, eqA, ordinalCode_subset_iff] + exact le_of_not_gt lower + +end TransitiveGround + +namespace GroundInaccessibleConditions +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (conditions : GroundInaccessibleConditions M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (hK : K ∈ M.sets) +include conditions hK + +theorem groundOmegaOne_bound : + ∃ α ∈ K, M.groundOmegaOne pairing unions powers separation collection infinite ⊆ α := by + have hOmega := M.omega_mem separation infinite + have hPower := M.groundPower_mem powers hOmega + obtain ⟨α, hα, f, hf, injection⟩ := conditions.2.2.2 ZFSet.omega conditions.2.1 + have hAlpha := M.transitive hK hα + have uncountable : ¬ M.groundEmbeddable α ZFSet.omega := by + rintro ⟨g, hg, countable⟩ + apply M.groundPower_not_embeddable_self powers separation hOmega + exact ⟨relationCompose (M.groundPower ZFSet.omega) α ZFSet.omega f g, + M.relationCompose_mem pairing unions powers separation hPower hAlpha hOmega hf hg, + injection.compose countable⟩ + exact ⟨α, hα, M.groundOmegaOne_subset_of_not_countable pairing unions powers separation + collection infinite (ordinalSetProperty_member conditions.1 hα) uncountable⟩ + +theorem groundOmegaOne_below : + GroundBelow M (M.groundOmegaOne pairing unions powers separation collection infinite) K := by + obtain ⟨α, hα, subset⟩ := conditions.groundOmegaOne_bound pairing unions powers separation + collection infinite hK + let C := M.groundOmegaOne pairing unions powers separation collection infinite + exact ⟨α, hα, identityFunctionGraph C, + M.identityFunctionGraph_mem pairing unions powers separation + (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1, + (identityFunctionGraph_injection C).retarget subset⟩ + +theorem groundOmegaOne_mem : + M.groundOmegaOne pairing unions powers separation collection infinite ∈ K := by + obtain ⟨α, hα, subset⟩ := conditions.groundOmegaOne_bound pairing unions powers separation + collection infinite hK + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + obtain ⟨c, eqC⟩ := (ordinalSetProperty_iff _).1 spec.2.1 + obtain ⟨a, eqA⟩ := (ordinalSetProperty_iff α).1 (ordinalSetProperty_member conditions.1 hα) + have bound : c ≤ a := by + rw [eqC, eqA] at subset + exact (ordinalCode_subset_iff c a).1 subset + rcases lt_or_eq_of_le bound with lower | same + · apply conditions.1.1 α hα + rw [eqC, eqA, mem_ordinalCode_iff] + exact lower + · rw [eqC, same, ← eqA] + exact hα + +end GroundInaccessibleConditions + + + + +namespace GroundStandardInaccessible +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} +variable (standard : GroundStandardInaccessible M K) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (hK : K ∈ M.sets) +include standard pairing unions powers separation hK + +theorem omega_mem : ZFSet.omega ∈ K := by + obtain ⟨k, eqK⟩ := (ordinalSetProperty_iff K).1 standard.1.1 + by_cases greater : Ordinal.omega0 < k + · rw [eqK, ← ordinalCode_omega, mem_ordinalCode_iff] + exact greater + · have subset : K ⊆ ZFSet.omega := by + rw [eqK, ← ordinalCode_omega, ordinalCode_subset_iff] + exact le_of_not_gt greater + exact False.elim (standard.2.1 ⟨identityFunctionGraph K, + M.identityFunctionGraph_mem pairing unions powers separation hK, + (identityFunctionGraph_injection K).retarget subset⟩) + +theorem to_conditions : GroundInaccessibleConditions M K := + ⟨standard.1.1, standard.omega_mem pairing unions powers separation hK, + standard.2.2.1.regular standard.1.1, + standard.2.2.2.to_groundStrongLimit pairing unions powers separation hK standard.1.1⟩ + +end GroundStandardInaccessible + +namespace GroundInaccessibleConditions +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} + +theorem to_standard (conditions : GroundInaccessibleConditions M K) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hK : K ∈ M.sets) : GroundStandardInaccessible M K := + ⟨conditions.internal_cardinal pairing unions powers separation hK, + conditions.not_countable pairing unions powers separation hK, + conditions.2.2.1.cofinal_regular, conditions.2.2.2.cardinal_strongLimit⟩ + +end GroundInaccessibleConditions + +theorem groundStandardInaccessible_iff_conditions + (M : TransitiveGround.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {K : ZFSet.{u}} (hK : K ∈ M.sets) : + GroundStandardInaccessible M K ↔ GroundInaccessibleConditions M K := + ⟨fun standard => standard.to_conditions pairing unions powers separation hK, + fun conditions => conditions.to_standard pairing unions powers separation hK⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStrongLimitPowers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStrongLimitPowers.lean index e88f344130369601e60453a10e173838e864e0b2..6e251642104135e562937f9e79a75b4183e9d1f7 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStrongLimitPowers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStrongLimitPowers.lean @@ -1,59 +1,59 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPowerImageGraphs - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -def GroundStrongLimit (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := - ∀ α ∈ K, GroundBelow M (M.groundPower α) K - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem groundEmbeddable_power - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (embedding : M.groundEmbeddable A B) : - M.groundEmbeddable (M.groundPower A) (M.groundPower B) := by - obtain ⟨f, hf, injection⟩ := embedding - exact ⟨M.groundPowerImageGraph A B f, - M.groundPowerImageGraph_mem pairing unions powers separation hA hB hf, - M.groundPowerImageGraph_injection separation hB hf injection⟩ - -end TransitiveGround - -namespace GroundStrongLimit -variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} (strong : GroundStrongLimit M K) - -include strong in -theorem power_closed - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A : ZFSet.{u}} (hA : A ∈ M.sets) (hK : K ∈ M.sets) (small : GroundBelow M A K) : - GroundBelow M (M.groundPower A) K := by - obtain ⟨α, hα, embedding⟩ := small - have hAlpha := M.transitive hK hα - exact (strong α hα).of_embeddable pairing unions powers separation - (M.groundPower_mem powers hA) (M.groundPower_mem powers hAlpha) hK - (M.groundEmbeddable_power pairing unions powers separation hA hAlpha embedding) - -end GroundStrongLimit -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundBelowFunctionGraphs +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPowerImageGraphs + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +def GroundStrongLimit (M : TransitiveGround.{u}) (K : ZFSet.{u}) : Prop := + ∀ α ∈ K, GroundBelow M (M.groundPower α) K + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem groundEmbeddable_power + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A B : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (embedding : M.groundEmbeddable A B) : + M.groundEmbeddable (M.groundPower A) (M.groundPower B) := by + obtain ⟨f, hf, injection⟩ := embedding + exact ⟨M.groundPowerImageGraph A B f, + M.groundPowerImageGraph_mem pairing unions powers separation hA hB hf, + M.groundPowerImageGraph_injection separation hB hf injection⟩ + +end TransitiveGround + +namespace GroundStrongLimit +variable {M : TransitiveGround.{u}} {K : ZFSet.{u}} (strong : GroundStrongLimit M K) + +include strong in +theorem power_closed + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A : ZFSet.{u}} (hA : A ∈ M.sets) (hK : K ∈ M.sets) (small : GroundBelow M A K) : + GroundBelow M (M.groundPower A) K := by + obtain ⟨α, hα, embedding⟩ := small + have hAlpha := M.transitive hK hα + exact (strong α hα).of_embeddable pairing unions powers separation + (M.groundPower_mem powers hA) (M.groundPower_mem powers hAlpha) hK + (M.groundEmbeddable_power pairing unions powers separation hA hAlpha embedding) + +end GroundStrongLimit +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralBirthLevelSelectors.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralBirthLevelSelectors.lean index 38ce270be60a00e71306c0d164e9d59214449cb2..a14c05d97f616555862b32b1db3fe393991c450e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralBirthLevelSelectors.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralBirthLevelSelectors.lean @@ -1,52 +1,52 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem structuralForcingTrace_birthLevelEnumerations - (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {stages history : ZFSet.{u}} (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) - (hNodes : nodes ∈ M.sets) (hOrder : nodeOrder ∈ M.sets) (hBasis : basis ∈ M.sets) - (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) - (ordinal : ordinalSetProperty stages) - (trace : OrdinalRecursionTrace (fun level prior stage => stage = - M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction - basis T T2 level prior) stages history) : - let packed := M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history - let Q := M.refinementHistoryForcing rows T stages packed - let levels := refinementDataHistoryLevels stages packed T - Q ∈ M.sets ∧ M.groundRelations ZFSet.omega stages ∈ M.sets ∧ - M.birthLevelEnumerationRelation Q stages levels ∈ M.sets ∧ - ∃ selector ∈ M.sets, ZFSet.IsFunc Q (M.groundRelations ZFSet.omega stages) selector ∧ - selector ⊆ M.birthLevelEnumerationRelation Q stages levels ∧ - ∀ row A e, ZFSet.pair (ZFSet.pair row A) e ∈ selector → - BirthLevelEnumerationCode ZFSet.omega stages A levels e := by - have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![G, nodes, nodeOrder, basis, T, T2, stages, history] - (Fin.cases hG (Fin.cases hNodes (Fin.cases hOrder (Fin.cases hBasis - (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun i => Fin.elim0 i))))))))) - have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction - G nodes nodeOrder nodeAction basis T T2 ordinal trace - have omega := M.omega_mem separation infinite - exact ⟨M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hs packed omega, - M.groundRelations_mem pairing unions powers separation omega hs, - M.exists_refinementBirthLevelEnumerations pairing unions powers separation infinite choice - hRows hT hs packed run.carriers.data⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem structuralForcingTrace_birthLevelEnumerations + (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {stages history : ZFSet.{u}} (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) + (hNodes : nodes ∈ M.sets) (hOrder : nodeOrder ∈ M.sets) (hBasis : basis ∈ M.sets) + (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) (hs : stages ∈ M.sets) (hh : history ∈ M.sets) + (ordinal : ordinalSetProperty stages) + (trace : OrdinalRecursionTrace (fun level prior stage => stage = + M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction + basis T T2 level prior) stages history) : + let packed := M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history + let Q := M.refinementHistoryForcing rows T stages packed + let levels := refinementDataHistoryLevels stages packed T + Q ∈ M.sets ∧ M.groundRelations ZFSet.omega stages ∈ M.sets ∧ + M.birthLevelEnumerationRelation Q stages levels ∈ M.sets ∧ + ∃ selector ∈ M.sets, ZFSet.IsFunc Q (M.groundRelations ZFSet.omega stages) selector ∧ + selector ⊆ M.birthLevelEnumerationRelation Q stages levels ∧ + ∀ row A e, ZFSet.pair (ZFSet.pair row A) e ∈ selector → + BirthLevelEnumerationCode ZFSet.omega stages A levels e := by + have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![G, nodes, nodeOrder, basis, T, T2, stages, history] + (Fin.cases hG (Fin.cases hNodes (Fin.cases hOrder (Fin.cases hBasis + (Fin.cases hT (Fin.cases hT2 (Fin.cases hs (Fin.cases hh (fun i => Fin.elim0 i))))))))) + have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction + G nodes nodeOrder nodeAction basis T T2 ordinal trace + have omega := M.omega_mem separation infinite + exact ⟨M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hs packed omega, + M.groundRelations_mem pairing unions powers separation omega hs, + M.exists_refinementBirthLevelEnumerations pairing unions powers separation infinite choice + hRows hT hs packed run.carriers.data⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexSize.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexSize.lean index 722b5dda44fa77fa367294ef55edf29f424a9a49..41ad25513bec6ae0b8a42e793b55f0f94bb2ceba 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexSize.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexSize.lean @@ -1,479 +1,479 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRepresentativeIndexSteps -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRefinementFullIndexSize - -namespace OAI - -namespace PartitionPilot.Forcing.GroundBelow -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {A B N K : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem smallSubsets (hB : B ∈ M.sets) (hN : N ∈ M.sets) (hK : K ∈ M.sets) - (strong : GroundStrongLimit M K) (small : GroundBelow M B K) : - GroundBelow M (M.groundSmallSubsets B N) K := - (strong.power_closed pairing unions powers separation hB hK small).restrict - separation (M.groundSmallSubsets_mem powers separation hB hN) hK - (fun _ member => (ZFSet.mem_sep.1 member).1) - -theorem smallPartialFunctions (hA : A ∈ M.sets) (hB : B ∈ M.sets) - (hN : N ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (first : GroundBelow M A K) (second : GroundBelow M B K) : - GroundBelow M (M.smallPartialFunctions A B N) K := - (partialFunctions pairing unions powers separation hA hB hK ordinal strong first second).restrict - separation (M.smallPartialFunctions_mem pairing unions powers separation hA hB hN) hK - (fun _ member => (ZFSet.mem_sep.1 member).1) - -end PartitionPilot.Forcing.GroundBelow - -namespace PartitionPilot.Forcing.GroundBelow -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {I C K : ZFSet.{u}} - -theorem binaryRowCarrier - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hK : K ∈ M.sets) - (conditions : GroundInaccessibleConditions M K) - (indices : GroundBelow M I K) (columns : GroundBelow M C K) : - GroundBelow M (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) K := by - have hOmega := M.transitive hK conditions.2.1 - have hTwo := M.transitive hOmega (natSetCode_mem_omega 2) - have twoBelow := of_member pairing unions powers separation hK - (conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega 2)) - exact smallPartialFunctions pairing unions powers separation - (M.prod_mem pairing unions powers separation hI hC) hTwo hOmega hK - conditions.1 conditions.2.2.2 - (product pairing unions powers separation hI hC hK conditions.1 conditions.2.2.2 indices columns) - twoBelow - -end PartitionPilot.Forcing.GroundBelow - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) - -open scoped ZFSet - -include pairing unions powers separation in -theorem refinementDataHistoryIndexFamily {stages history T : ZFSet.{u}} - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (valid : RefinementDataHistory stages history T) : - let F := refinementDataHistoryField stages history 0 - F ∈ M.sets ∧ functionGraphRange stages F ∈ M.sets ∧ - ZFSet.IsFunc stages (⋃₀ ⋃₀ F) F ∧ - refinementDataHistoryIndices stages history = - ⋃₀ relationImage stages (⋃₀ ⋃₀ F) F := by - let F := refinementDataHistoryField stages history 0 - have hF : F ∈ M.sets := - M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0 - exact ⟨hF, M.functionGraphRange_mem unions separation hStages hF, - valid.index_function.to_isFunc, rfl⟩ - -include pairing unions powers separation in -theorem refinementDataHistoryIndices_below {stages history T K : ZFSet.{u}} - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (strong : GroundStrongLimit M K) (stageSize : GroundBelow M stages K) - (valid : RefinementDataHistory stages history T) - (fibers : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → GroundBelow M (d 0) K) : - GroundBelow M (refinementDataHistoryIndices stages history) K := by - obtain ⟨hF, _hRange, function, union_eq⟩ := - M.refinementDataHistoryIndexFamily pairing unions powers separation hStages hHistory valid - rw [union_eq] - apply GroundBelow.indexed_sUnion pairing unions powers separation choice hStages - (M.union_mem unions (M.union_mem unions hF)) hF hK ordinal regular strong stageSize function - intro beta A entry - obtain ⟨_, d, stored, rfl⟩ := - (pair_mem_refinementDataHistoryField stages history beta A 0).1 entry - exact fibers beta d stored - -include pairing unions powers separation in -theorem refinementDataHistoryIndices_below_of_mem {stages history T K : ZFSet.{u}} - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (strong : GroundStrongLimit M K) (stageMem : stages ∈ K) - (valid : RefinementDataHistory stages history T) - (fibers : ∀ beta (d : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → GroundBelow M (d 0) K) : - GroundBelow M (refinementDataHistoryIndices stages history) K := - M.refinementDataHistoryIndices_below pairing unions powers separation choice - (M.transitive hK stageMem) hHistory hK ordinal regular strong - (GroundBelow.of_member pairing unions powers separation hK stageMem) valid fibers - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.GroundBelow -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows I T stages history K : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem stageOneAssignments (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (indices : GroundBelow M I K) (terms : GroundBelow M T K) : - GroundBelow M (PartitionPilot.Forcing.stageOneAssignments I T) K := - product pairing unions powers separation hI - (M.prod_mem pairing unions powers separation hT hT) hK ordinal strong indices - (product pairing unions powers separation hT hT hK ordinal strong terms terms) - -theorem stageOneCandidateBound (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) - (hT : T ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (rowSize : GroundBelow M rows K) (indices : GroundBelow M I K) - (terms : GroundBelow M T K) : GroundBelow M (M.stageOneCandidateBound rows I T) K := - product pairing unions powers separation hRows - (M.groundSmallSubsets_mem powers separation - (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega) - hK ordinal strong rowSize - (smallSubsets pairing unions powers separation - (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega hK strong - (stageOneAssignments pairing unions powers separation hI hT hK ordinal strong indices terms)) - -theorem refinementHistoryForcing (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) - (rowSize : GroundBelow M rows K) - (indices : GroundBelow M (refinementDataHistoryIndices stages history) K) - (terms : GroundBelow M T K) : - GroundBelow M (M.refinementHistoryForcing rows T stages history) K := - (stageOneCandidateBound pairing unions powers separation hRows - (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) - hT hK omega ordinal strong rowSize indices terms).restrict separation - (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega) hK - (fun z member => ((M.mem_refinementHistoryForcing rows T stages history z).1 member).1) - -end PartitionPilot.Forcing.GroundBelow - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (collection : CollectionSchema M.sets) -variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) -variable (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) -variable (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) -variable (smallNodes : GroundBelow M nodes K) (smallT : GroundBelow M T K) -variable (smallT2 : GroundBelow M T2 K) -include pairing unions powers separation infinite collection hK conditions -include hG hn hno hb hT hT2 smallNodes smallT smallT2 - -theorem structuralRefinement_stored_indices_below - {history level P order top action : ZFSet.{u}} (hh : history ∈ M.sets) - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) - (smallP : GroundBelow M P K) : - M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0 ∈ M.sets ∧ - GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) K := by - have fields := M.nonemptyTupleCode_field_mem 4 ![level, P, order, top, action] - (M.transitive hh stored) - exact M.rawRefinementFormulaData_indices_below pairing unions powers separation infinite hK conditions collection - P order top action G nodes nodeOrder basis T T2 level - (fields 1) (fields 2) (fields 3) (fields 4) hG hn hno hb hT hT2 (fields 0) - smallP smallNodes smallT smallT2 - -theorem structuralRefinementHistory_indices_below - {stages history level : ZFSet.{u}} (hh : history ∈ M.sets) - (data : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair level (refinementFormulaDataCode data) ∈ - M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) - (smallCarrier : GroundBelow M (data 7) K) : - data 0 ∈ M.sets ∧ GroundBelow M (data 0) K := by - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - exact M.structuralRefinement_stored_indices_below pairing unions powers separation infinite collection hK conditions - G nodes nodeOrder basis T T2 hG hn hno hb hT hT2 smallNodes smallT smallT2 hh stored smallCarrier - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -open scoped ZFSet - -theorem representativeIndexStep_below - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows I T Q c D X K : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) - (hQ : Q ∈ M.sets) (hc : c ∈ M.sets) (hD : D ∈ M.sets) (hX : X ∈ M.sets) - (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) - (selector : ZFSet.IsFunc Q D c) - (queries : Q ⊆ M.stageOneCandidateBound rows I T) - (selected : D ⊆ M.stageOneCandidateBound rows I T) - (smallRows : GroundBelow M rows K) (smallT : GroundBelow M T K) - (smallX : GroundBelow M X K) : - GroundBelow M (representativeIndexStep I T Q c X) K := by - let QX := assignmentQueriesWithin Q X T - let E := relationImage QX D c - let J := stageOneAssignments I T - let S := M.groundSmallSubsets J ZFSet.omega - let projection := productSecond rows S - let R := relationImage E S projection - let U := ⋃₀ R - have omega := M.omega_mem separation infinite - have hQX : QX ∈ M.sets := M.assignmentQueriesWithin_mem separation hQ hX hT - have queryBound : QX ⊆ M.stageOneCandidateBound rows X T := by - intro q member - obtain ⟨hq, row, L, rfl, inside⟩ := (mem_assignmentQueriesWithin Q X T q).1 member - obtain ⟨hr, hL, _, countable⟩ := (M.pair_mem_stageOneCandidateBound rows I T row L).1 (queries hq) - exact (M.pair_mem_stageOneCandidateBound rows X T row L).2 ⟨hr, hL, inside, countable⟩ - have smallQX : GroundBelow M QX K := - (GroundBelow.stageOneCandidateBound pairing unions powers separation hRows hX hT hK omega - conditions.1 conditions.2.2.2 smallRows smallX smallT).restrict separation hQX hK queryBound - have hE : E ∈ M.sets := M.relationImage_mem separation hQX hD hc - have smallE : GroundBelow M E K := smallQX.function_image pairing unions powers separation choice - hQX hD hK hc selector - have hJ : J ∈ M.sets := M.stageOneAssignments_mem pairing unions powers separation hI hT - have hS : S ∈ M.sets := M.groundSmallSubsets_mem powers separation hJ omega - have hProjection : projection ∈ M.sets := M.productSecond_mem pairing unions powers separation hRows hS - have hR : R ∈ M.sets := M.relationImage_mem separation hE hS hProjection - have hU : U ∈ M.sets := M.union_mem unions hR - have smallR : GroundBelow M R K := smallE.function_image pairing unions powers separation choice - hE hS hK hProjection (productSecond_function rows S) - have smallU : GroundBelow M U K := GroundBelow.sUnion pairing unions powers separation choice - hR hK conditions.1 conditions.2.2.1 conditions.2.2.2 smallR (fun A member => - GroundBelow.of_countable conditions.2.1 ((M.mem_groundSmallSubsets J ZFSet.omega A).1 - ((mem_relationImage E S projection A).1 member).1).2.2) - have smallIndices : GroundBelow M (assignmentIndices I T U) K := - smallU.function_image pairing unions powers separation choice hU hI hK - (M.productFirst_mem pairing unions powers separation hI - (M.prod_mem pairing unions powers separation hT hT)) (productFirst_function I (ZFSet.prod T T)) - have additionsGround := M.representativeIndexAdditions_mem separation hI hT hQ hc hX - have additionsSubset : representativeIndexAdditions I T Q c X ⊆ assignmentIndices I T U := by - intro i member - obtain ⟨hi, q, hq, within, row, A, entry, v, hv, w, hw, inside⟩ := - (mem_representativeIndexAdditions I T Q c X i).1 member - have inD := (ZFSet.pair_mem_prod.1 (selector.1 entry)).2 - have candidate := selected inD - have pair : row ∈ rows ∧ A ∈ S := ZFSet.pair_mem_prod.1 candidate - have inE : ZFSet.pair row A ∈ E := (mem_relationImage QX D c _).2 - ⟨inD, q, (mem_assignmentQueriesWithin Q X T q).2 ⟨hq, within⟩, entry⟩ - have inR : A ∈ R := (mem_relationImage E S projection A).2 - ⟨pair.2, ZFSet.pair row A, inE, - (mem_productSecond rows S _).2 ⟨row, pair.1, A, pair.2, rfl⟩⟩ - exact (mem_assignmentIndices I T U i).2 - ⟨hi, v, hv, w, hw, ZFSet.mem_sUnion.2 ⟨A, inR, inside⟩⟩ - exact GroundBelow.binary_union pairing unions powers separation infinite choice hX additionsGround hK - conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 smallX - (smallIndices.restrict separation additionsGround hK additionsSubset) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem structuralIndexFamily_below - (G nodes nodeOrder basis T T2 : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hG : G ∈ M.sets) (hNodes : nodes ∈ M.sets) (hNodeOrder : nodeOrder ∈ M.sets) - (hBasis : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - {stages history K : ZFSet.{u}} (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (strong : GroundStrongLimit M K) (stageMem : stages ∈ K) - (valid : RefinementDataHistory stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) - (fibers : ∀ beta P order top action, - ZFSet.pair beta (forcingStageCode P order top action) ∈ history → - GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 beta 0) K) : - GroundBelow M (refinementDataHistoryIndices stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K := by - have hStages := M.transitive hK stageMem - have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![G, nodes, nodeOrder, basis, T, T2, stages, history] - (Fin.cases hG (Fin.cases hNodes (Fin.cases hNodeOrder (Fin.cases hBasis - (Fin.cases hT (Fin.cases hT2 (Fin.cases hStages (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) - apply M.refinementDataHistoryIndices_below_of_mem pairing unions powers separation choice - packed hK ordinal regular strong stageMem valid - intro beta data entry - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - exact fibers beta P order top action stored - -theorem structuralForcingTrace_indices_below - (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (hG : G ∈ M.sets) (hNodes : nodes ∈ M.sets) (hNodeOrder : nodeOrder ∈ M.sets) - (hBasis : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) - {stages history K : ZFSet.{u}} (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) - (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) - (strong : GroundStrongLimit M K) (stageMem : stages ∈ K) - (trace : OrdinalRecursionTrace - (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction - G nodes nodeOrder nodeAction basis T T2 level prior) stages history) - (fibers : ∀ beta P order top action, - ZFSet.pair beta (forcingStageCode P order top action) ∈ history → - GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 beta 0) K) : - GroundBelow M (refinementDataHistoryIndices stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K := by - have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 (ordinalSetProperty_member ordinal stageMem) trace - exact M.structuralIndexFamily_below G nodes nodeOrder basis T T2 pairing unions powers separation - collection choice hG hNodes hNodeOrder hBasis hT hT2 hHistory hK ordinal regular strong - stageMem run.carriers.data fibers - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (collection : CollectionSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) -variable (hno : nodeOrder ∈ M.sets) (hb : basis ∈ M.sets) -variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) -variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (smallRows : GroundBelow M rows K) (smallNodes : GroundBelow M nodes K) -variable (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) -include pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 - hK conditions smallRows smallNodes smallT smallT2 -local notation "step" => fun level prior stage => stage = - M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 level prior - -theorem structuralForcingTrace_below : - ∀ stages ∈ K, ∀ history ∈ M.sets, OrdinalRecursionTrace step stages history → - GroundBelow M (refinementDataHistoryIndices stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K ∧ - GroundBelow M (M.refinementHistoryForcing rows T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K := by - intro stages - induction stages using ZFSet.inductionOn with - | h stages ih => - intro stageMem history hh trace - have hs := M.transitive hK stageMem - have ordinal := ordinalSetProperty_member conditions.1 stageMem - have fibers : ∀ beta P order top action, - ZFSet.pair beta (forcingStageCode P order top action) ∈ history → - GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 beta 0) K := by - intro beta P order top action stored - have member := trace.1.pair_source stored - have hBeta := M.transitive hs member - have betaOrdinal := ordinalSetProperty_member ordinal member - have lower := ih beta member (conditions.1.1 stages stageMem beta member) - (graphRestriction beta history) (M.graphRestriction_mem unions separation hBeta hh) - (trace.restrict betaOrdinal (ordinal.1 beta member)) - have equal := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 - ((trace.2 beta member _ stored).trans - (M.structuralForcingStage_eq rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 - beta (graphRestriction beta history))) - have smallP : GroundBelow M P K := equal.1.symm ▸ lower.2 - exact (M.structuralRefinement_stored_indices_below pairing unions powers separation infinite collection - hK conditions G nodes nodeOrder basis T T2 hG hn hno hb hT hT2 smallNodes smallT smallT2 - hh stored smallP).2 - have indices := M.structuralForcingTrace_indices_below rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 pairing unions powers separation collection choice - hG hn hno hb hT hT2 hh hK conditions.1 conditions.2.2.1 conditions.2.2.2 stageMem trace fibers - have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![G, nodes, nodeOrder, basis, T, T2, stages, history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT (Fin.cases hT2 - (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) - exact ⟨indices, GroundBelow.refinementHistoryForcing pairing unions powers separation - hRows hT hs packed hK (M.omega_mem separation infinite) conditions.1 conditions.2.2.2 - smallRows indices smallT⟩ - -theorem structuralForcingTrace_prefix_below {history : ZFSet.{u}} (hh : history ∈ M.sets) - (trace : OrdinalRecursionTrace step K history) : - ∀ level ∈ K, - GroundBelow M (refinementDataHistoryIndices level - (graphRestriction level (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history))) K ∧ - GroundBelow M (M.refinementHistoryForcing rows T level - (graphRestriction level (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history))) K := by - intro level member - have hLevel := M.transitive hK member - have ordinal := ordinalSetProperty_member conditions.1 member - have result := M.structuralForcingTrace_below rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction - basis T T2 pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 - hK conditions smallRows smallNodes smallT smallT2 level member (graphRestriction level history) - (M.graphRestriction_mem unions separation hLevel hh) - (trace.restrict ordinal (conditions.1.1 level member)) - rw [M.structuralRefinementHistory_history_restrict, - M.structuralRefinementHistory_domain_restrict G nodes nodeOrder basis T T2 (conditions.1.1 level member)] at result - exact result - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (collection : CollectionSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) -variable (hno : nodeOrder ∈ M.sets) (hb : basis ∈ M.sets) -variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) -variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (smallRows : GroundBelow M rows K) (smallNodes : GroundBelow M nodes K) -variable (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) -include pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 - hK conditions smallRows smallNodes smallT smallT2 -local notation "step" => fun level prior stage => stage = - M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 level prior - -theorem structuralForcingTrace_indices_embeds {history : ZFSet.{u}} - (hh : history ∈ M.sets) (trace : OrdinalRecursionTrace step K history) : - M.groundEmbeddable (refinementDataHistoryIndices K - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history)) K := by - have prefixes := M.structuralForcingTrace_prefix_below rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 pairing unions powers separation infinite collection choice - hRows hG hn hno hb hT hT2 hK conditions smallRows smallNodes smallT smallT2 hh trace - have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 conditions.1 trace - have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![G, nodes, nodeOrder, basis, T, T2, K, history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT (Fin.cases hT2 - (Fin.cases hK (Fin.cases hh (fun j => Fin.elim0 j))))))))) - exact M.refinementDataHistoryIndices_embeds pairing unions powers separation infinite collection choice - hK packed conditions run.carriers.data (fun alpha member => (prefixes alpha member).1) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStructuralForcingHistoryConstruction +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRepresentativeIndexSteps +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRefinementFullIndexSize + +namespace OAI + +namespace PartitionPilot.Forcing.GroundBelow +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {A B N K : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem smallSubsets (hB : B ∈ M.sets) (hN : N ∈ M.sets) (hK : K ∈ M.sets) + (strong : GroundStrongLimit M K) (small : GroundBelow M B K) : + GroundBelow M (M.groundSmallSubsets B N) K := + (strong.power_closed pairing unions powers separation hB hK small).restrict + separation (M.groundSmallSubsets_mem powers separation hB hN) hK + (fun _ member => (ZFSet.mem_sep.1 member).1) + +theorem smallPartialFunctions (hA : A ∈ M.sets) (hB : B ∈ M.sets) + (hN : N ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (first : GroundBelow M A K) (second : GroundBelow M B K) : + GroundBelow M (M.smallPartialFunctions A B N) K := + (partialFunctions pairing unions powers separation hA hB hK ordinal strong first second).restrict + separation (M.smallPartialFunctions_mem pairing unions powers separation hA hB hN) hK + (fun _ member => (ZFSet.mem_sep.1 member).1) + +end PartitionPilot.Forcing.GroundBelow + +namespace PartitionPilot.Forcing.GroundBelow +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {I C K : ZFSet.{u}} + +theorem binaryRowCarrier + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hC : C ∈ M.sets) (hK : K ∈ M.sets) + (conditions : GroundInaccessibleConditions M K) + (indices : GroundBelow M I K) (columns : GroundBelow M C K) : + GroundBelow M (M.smallPartialFunctions (ZFSet.prod I C) (natSetCode 2) ZFSet.omega) K := by + have hOmega := M.transitive hK conditions.2.1 + have hTwo := M.transitive hOmega (natSetCode_mem_omega 2) + have twoBelow := of_member pairing unions powers separation hK + (conditions.1.1 ZFSet.omega conditions.2.1 _ (natSetCode_mem_omega 2)) + exact smallPartialFunctions pairing unions powers separation + (M.prod_mem pairing unions powers separation hI hC) hTwo hOmega hK + conditions.1 conditions.2.2.2 + (product pairing unions powers separation hI hC hK conditions.1 conditions.2.2.2 indices columns) + twoBelow + +end PartitionPilot.Forcing.GroundBelow + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) + +open scoped ZFSet + +include pairing unions powers separation in +theorem refinementDataHistoryIndexFamily {stages history T : ZFSet.{u}} + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (valid : RefinementDataHistory stages history T) : + let F := refinementDataHistoryField stages history 0 + F ∈ M.sets ∧ functionGraphRange stages F ∈ M.sets ∧ + ZFSet.IsFunc stages (⋃₀ ⋃₀ F) F ∧ + refinementDataHistoryIndices stages history = + ⋃₀ relationImage stages (⋃₀ ⋃₀ F) F := by + let F := refinementDataHistoryField stages history 0 + have hF : F ∈ M.sets := + M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0 + exact ⟨hF, M.functionGraphRange_mem unions separation hStages hF, + valid.index_function.to_isFunc, rfl⟩ + +include pairing unions powers separation in +theorem refinementDataHistoryIndices_below {stages history T K : ZFSet.{u}} + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (strong : GroundStrongLimit M K) (stageSize : GroundBelow M stages K) + (valid : RefinementDataHistory stages history T) + (fibers : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → GroundBelow M (d 0) K) : + GroundBelow M (refinementDataHistoryIndices stages history) K := by + obtain ⟨hF, _hRange, function, union_eq⟩ := + M.refinementDataHistoryIndexFamily pairing unions powers separation hStages hHistory valid + rw [union_eq] + apply GroundBelow.indexed_sUnion pairing unions powers separation choice hStages + (M.union_mem unions (M.union_mem unions hF)) hF hK ordinal regular strong stageSize function + intro beta A entry + obtain ⟨_, d, stored, rfl⟩ := + (pair_mem_refinementDataHistoryField stages history beta A 0).1 entry + exact fibers beta d stored + +include pairing unions powers separation in +theorem refinementDataHistoryIndices_below_of_mem {stages history T K : ZFSet.{u}} + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (strong : GroundStrongLimit M K) (stageMem : stages ∈ K) + (valid : RefinementDataHistory stages history T) + (fibers : ∀ beta (d : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode d) ∈ history → GroundBelow M (d 0) K) : + GroundBelow M (refinementDataHistoryIndices stages history) K := + M.refinementDataHistoryIndices_below pairing unions powers separation choice + (M.transitive hK stageMem) hHistory hK ordinal regular strong + (GroundBelow.of_member pairing unions powers separation hK stageMem) valid fibers + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.GroundBelow +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows I T stages history K : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem stageOneAssignments (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (indices : GroundBelow M I K) (terms : GroundBelow M T K) : + GroundBelow M (PartitionPilot.Forcing.stageOneAssignments I T) K := + product pairing unions powers separation hI + (M.prod_mem pairing unions powers separation hT hT) hK ordinal strong indices + (product pairing unions powers separation hT hT hK ordinal strong terms terms) + +theorem stageOneCandidateBound (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) + (hT : T ∈ M.sets) (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (rowSize : GroundBelow M rows K) (indices : GroundBelow M I K) + (terms : GroundBelow M T K) : GroundBelow M (M.stageOneCandidateBound rows I T) K := + product pairing unions powers separation hRows + (M.groundSmallSubsets_mem powers separation + (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega) + hK ordinal strong rowSize + (smallSubsets pairing unions powers separation + (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega hK strong + (stageOneAssignments pairing unions powers separation hI hT hK ordinal strong indices terms)) + +theorem refinementHistoryForcing (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (hK : K ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (ordinal : ordinalSetProperty K) (strong : GroundStrongLimit M K) + (rowSize : GroundBelow M rows K) + (indices : GroundBelow M (refinementDataHistoryIndices stages history) K) + (terms : GroundBelow M T K) : + GroundBelow M (M.refinementHistoryForcing rows T stages history) K := + (stageOneCandidateBound pairing unions powers separation hRows + (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) + hT hK omega ordinal strong rowSize indices terms).restrict separation + (M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega) hK + (fun z member => ((M.mem_refinementHistoryForcing rows T stages history z).1 member).1) + +end PartitionPilot.Forcing.GroundBelow + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (collection : CollectionSchema M.sets) +variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) +variable (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) (hno : nodeOrder ∈ M.sets) +variable (hb : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) +variable (smallNodes : GroundBelow M nodes K) (smallT : GroundBelow M T K) +variable (smallT2 : GroundBelow M T2 K) +include pairing unions powers separation infinite collection hK conditions +include hG hn hno hb hT hT2 smallNodes smallT smallT2 + +theorem structuralRefinement_stored_indices_below + {history level P order top action : ZFSet.{u}} (hh : history ∈ M.sets) + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) + (smallP : GroundBelow M P K) : + M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0 ∈ M.sets ∧ + GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) K := by + have fields := M.nonemptyTupleCode_field_mem 4 ![level, P, order, top, action] + (M.transitive hh stored) + exact M.rawRefinementFormulaData_indices_below pairing unions powers separation infinite hK conditions collection + P order top action G nodes nodeOrder basis T T2 level + (fields 1) (fields 2) (fields 3) (fields 4) hG hn hno hb hT hT2 (fields 0) + smallP smallNodes smallT smallT2 + +theorem structuralRefinementHistory_indices_below + {stages history level : ZFSet.{u}} (hh : history ∈ M.sets) + (data : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair level (refinementFormulaDataCode data) ∈ + M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) + (smallCarrier : GroundBelow M (data 7) K) : + data 0 ∈ M.sets ∧ GroundBelow M (data 0) K := by + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + exact M.structuralRefinement_stored_indices_below pairing unions powers separation infinite collection hK conditions + G nodes nodeOrder basis T T2 hG hn hno hb hT hT2 smallNodes smallT smallT2 hh stored smallCarrier + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +open scoped ZFSet + +theorem representativeIndexStep_below + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows I T Q c D X K : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) + (hQ : Q ∈ M.sets) (hc : c ∈ M.sets) (hD : D ∈ M.sets) (hX : X ∈ M.sets) + (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) + (selector : ZFSet.IsFunc Q D c) + (queries : Q ⊆ M.stageOneCandidateBound rows I T) + (selected : D ⊆ M.stageOneCandidateBound rows I T) + (smallRows : GroundBelow M rows K) (smallT : GroundBelow M T K) + (smallX : GroundBelow M X K) : + GroundBelow M (representativeIndexStep I T Q c X) K := by + let QX := assignmentQueriesWithin Q X T + let E := relationImage QX D c + let J := stageOneAssignments I T + let S := M.groundSmallSubsets J ZFSet.omega + let projection := productSecond rows S + let R := relationImage E S projection + let U := ⋃₀ R + have omega := M.omega_mem separation infinite + have hQX : QX ∈ M.sets := M.assignmentQueriesWithin_mem separation hQ hX hT + have queryBound : QX ⊆ M.stageOneCandidateBound rows X T := by + intro q member + obtain ⟨hq, row, L, rfl, inside⟩ := (mem_assignmentQueriesWithin Q X T q).1 member + obtain ⟨hr, hL, _, countable⟩ := (M.pair_mem_stageOneCandidateBound rows I T row L).1 (queries hq) + exact (M.pair_mem_stageOneCandidateBound rows X T row L).2 ⟨hr, hL, inside, countable⟩ + have smallQX : GroundBelow M QX K := + (GroundBelow.stageOneCandidateBound pairing unions powers separation hRows hX hT hK omega + conditions.1 conditions.2.2.2 smallRows smallX smallT).restrict separation hQX hK queryBound + have hE : E ∈ M.sets := M.relationImage_mem separation hQX hD hc + have smallE : GroundBelow M E K := smallQX.function_image pairing unions powers separation choice + hQX hD hK hc selector + have hJ : J ∈ M.sets := M.stageOneAssignments_mem pairing unions powers separation hI hT + have hS : S ∈ M.sets := M.groundSmallSubsets_mem powers separation hJ omega + have hProjection : projection ∈ M.sets := M.productSecond_mem pairing unions powers separation hRows hS + have hR : R ∈ M.sets := M.relationImage_mem separation hE hS hProjection + have hU : U ∈ M.sets := M.union_mem unions hR + have smallR : GroundBelow M R K := smallE.function_image pairing unions powers separation choice + hE hS hK hProjection (productSecond_function rows S) + have smallU : GroundBelow M U K := GroundBelow.sUnion pairing unions powers separation choice + hR hK conditions.1 conditions.2.2.1 conditions.2.2.2 smallR (fun A member => + GroundBelow.of_countable conditions.2.1 ((M.mem_groundSmallSubsets J ZFSet.omega A).1 + ((mem_relationImage E S projection A).1 member).1).2.2) + have smallIndices : GroundBelow M (assignmentIndices I T U) K := + smallU.function_image pairing unions powers separation choice hU hI hK + (M.productFirst_mem pairing unions powers separation hI + (M.prod_mem pairing unions powers separation hT hT)) (productFirst_function I (ZFSet.prod T T)) + have additionsGround := M.representativeIndexAdditions_mem separation hI hT hQ hc hX + have additionsSubset : representativeIndexAdditions I T Q c X ⊆ assignmentIndices I T U := by + intro i member + obtain ⟨hi, q, hq, within, row, A, entry, v, hv, w, hw, inside⟩ := + (mem_representativeIndexAdditions I T Q c X i).1 member + have inD := (ZFSet.pair_mem_prod.1 (selector.1 entry)).2 + have candidate := selected inD + have pair : row ∈ rows ∧ A ∈ S := ZFSet.pair_mem_prod.1 candidate + have inE : ZFSet.pair row A ∈ E := (mem_relationImage QX D c _).2 + ⟨inD, q, (mem_assignmentQueriesWithin Q X T q).2 ⟨hq, within⟩, entry⟩ + have inR : A ∈ R := (mem_relationImage E S projection A).2 + ⟨pair.2, ZFSet.pair row A, inE, + (mem_productSecond rows S _).2 ⟨row, pair.1, A, pair.2, rfl⟩⟩ + exact (mem_assignmentIndices I T U i).2 + ⟨hi, v, hv, w, hw, ZFSet.mem_sUnion.2 ⟨A, inR, inside⟩⟩ + exact GroundBelow.binary_union pairing unions powers separation infinite choice hX additionsGround hK + conditions.2.1 conditions.1 conditions.2.2.1 conditions.2.2.2 smallX + (smallIndices.restrict separation additionsGround hK additionsSubset) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem structuralIndexFamily_below + (G nodes nodeOrder basis T T2 : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hG : G ∈ M.sets) (hNodes : nodes ∈ M.sets) (hNodeOrder : nodeOrder ∈ M.sets) + (hBasis : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + {stages history K : ZFSet.{u}} (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (strong : GroundStrongLimit M K) (stageMem : stages ∈ K) + (valid : RefinementDataHistory stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T) + (fibers : ∀ beta P order top action, + ZFSet.pair beta (forcingStageCode P order top action) ∈ history → + GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 beta 0) K) : + GroundBelow M (refinementDataHistoryIndices stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K := by + have hStages := M.transitive hK stageMem + have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![G, nodes, nodeOrder, basis, T, T2, stages, history] + (Fin.cases hG (Fin.cases hNodes (Fin.cases hNodeOrder (Fin.cases hBasis + (Fin.cases hT (Fin.cases hT2 (Fin.cases hStages (Fin.cases hHistory (fun j => Fin.elim0 j))))))))) + apply M.refinementDataHistoryIndices_below_of_mem pairing unions powers separation choice + packed hK ordinal regular strong stageMem valid + intro beta data entry + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + exact fibers beta P order top action stored + +theorem structuralForcingTrace_indices_below + (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (hG : G ∈ M.sets) (hNodes : nodes ∈ M.sets) (hNodeOrder : nodeOrder ∈ M.sets) + (hBasis : basis ∈ M.sets) (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) + {stages history K : ZFSet.{u}} (hHistory : history ∈ M.sets) (hK : K ∈ M.sets) + (ordinal : ordinalSetProperty K) (regular : GroundRegular M K) + (strong : GroundStrongLimit M K) (stageMem : stages ∈ K) + (trace : OrdinalRecursionTrace + (fun level prior stage => stage = M.structuralForcingStage rows rowOrder rowTop rowAction + G nodes nodeOrder nodeAction basis T T2 level prior) stages history) + (fibers : ∀ beta P order top action, + ZFSet.pair beta (forcingStageCode P order top action) ∈ history → + GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 beta 0) K) : + GroundBelow M (refinementDataHistoryIndices stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K := by + have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 (ordinalSetProperty_member ordinal stageMem) trace + exact M.structuralIndexFamily_below G nodes nodeOrder basis T T2 pairing unions powers separation + collection choice hG hNodes hNodeOrder hBasis hT hT2 hHistory hK ordinal regular strong + stageMem run.carriers.data fibers + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (collection : CollectionSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) +variable (hno : nodeOrder ∈ M.sets) (hb : basis ∈ M.sets) +variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) +variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (smallRows : GroundBelow M rows K) (smallNodes : GroundBelow M nodes K) +variable (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) +include pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 + hK conditions smallRows smallNodes smallT smallT2 +local notation "step" => fun level prior stage => stage = + M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 level prior + +theorem structuralForcingTrace_below : + ∀ stages ∈ K, ∀ history ∈ M.sets, OrdinalRecursionTrace step stages history → + GroundBelow M (refinementDataHistoryIndices stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K ∧ + GroundBelow M (M.refinementHistoryForcing rows T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history)) K := by + intro stages + induction stages using ZFSet.inductionOn with + | h stages ih => + intro stageMem history hh trace + have hs := M.transitive hK stageMem + have ordinal := ordinalSetProperty_member conditions.1 stageMem + have fibers : ∀ beta P order top action, + ZFSet.pair beta (forcingStageCode P order top action) ∈ history → + GroundBelow M (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 beta 0) K := by + intro beta P order top action stored + have member := trace.1.pair_source stored + have hBeta := M.transitive hs member + have betaOrdinal := ordinalSetProperty_member ordinal member + have lower := ih beta member (conditions.1.1 stages stageMem beta member) + (graphRestriction beta history) (M.graphRestriction_mem unions separation hBeta hh) + (trace.restrict betaOrdinal (ordinal.1 beta member)) + have equal := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 + ((trace.2 beta member _ stored).trans + (M.structuralForcingStage_eq rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 + beta (graphRestriction beta history))) + have smallP : GroundBelow M P K := equal.1.symm ▸ lower.2 + exact (M.structuralRefinement_stored_indices_below pairing unions powers separation infinite collection + hK conditions G nodes nodeOrder basis T T2 hG hn hno hb hT hT2 smallNodes smallT smallT2 + hh stored smallP).2 + have indices := M.structuralForcingTrace_indices_below rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 pairing unions powers separation collection choice + hG hn hno hb hT hT2 hh hK conditions.1 conditions.2.2.1 conditions.2.2.2 stageMem trace fibers + have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![G, nodes, nodeOrder, basis, T, T2, stages, history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT (Fin.cases hT2 + (Fin.cases hs (Fin.cases hh (fun j => Fin.elim0 j))))))))) + exact ⟨indices, GroundBelow.refinementHistoryForcing pairing unions powers separation + hRows hT hs packed hK (M.omega_mem separation infinite) conditions.1 conditions.2.2.2 + smallRows indices smallT⟩ + +theorem structuralForcingTrace_prefix_below {history : ZFSet.{u}} (hh : history ∈ M.sets) + (trace : OrdinalRecursionTrace step K history) : + ∀ level ∈ K, + GroundBelow M (refinementDataHistoryIndices level + (graphRestriction level (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history))) K ∧ + GroundBelow M (M.refinementHistoryForcing rows T level + (graphRestriction level (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history))) K := by + intro level member + have hLevel := M.transitive hK member + have ordinal := ordinalSetProperty_member conditions.1 member + have result := M.structuralForcingTrace_below rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction + basis T T2 pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 + hK conditions smallRows smallNodes smallT smallT2 level member (graphRestriction level history) + (M.graphRestriction_mem unions separation hLevel hh) + (trace.restrict ordinal (conditions.1.1 level member)) + rw [M.structuralRefinementHistory_history_restrict, + M.structuralRefinementHistory_domain_restrict G nodes nodeOrder basis T T2 (conditions.1.1 level member)] at result + exact result + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (collection : CollectionSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) +variable (hno : nodeOrder ∈ M.sets) (hb : basis ∈ M.sets) +variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) +variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (smallRows : GroundBelow M rows K) (smallNodes : GroundBelow M nodes K) +variable (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) +include pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 + hK conditions smallRows smallNodes smallT smallT2 +local notation "step" => fun level prior stage => stage = + M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 level prior + +theorem structuralForcingTrace_indices_embeds {history : ZFSet.{u}} + (hh : history ∈ M.sets) (trace : OrdinalRecursionTrace step K history) : + M.groundEmbeddable (refinementDataHistoryIndices K + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history)) K := by + have prefixes := M.structuralForcingTrace_prefix_below rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 pairing unions powers separation infinite collection choice + hRows hG hn hno hb hT hT2 hK conditions smallRows smallNodes smallT smallT2 hh trace + have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 conditions.1 trace + have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![G, nodes, nodeOrder, basis, T, T2, K, history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT (Fin.cases hT2 + (Fin.cases hK (Fin.cases hh (fun j => Fin.elim0 j))))))))) + exact M.refinementDataHistoryIndices_embeds pairing unions powers separation infinite collection choice + hK packed conditions run.carriers.data (fun alpha member => (prefixes alpha member).1) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexWeakSize.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexWeakSize.lean index ad351d7bf8946e3432ba61334e7399af865c70ba..eaa76c880cc19b7dd290e2afe91cf2671064dc35 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexWeakSize.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralFullIndexWeakSize.lean @@ -1,104 +1,104 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize - -namespace OAI - -open scoped ZFSet - -section - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) -variable (separation : SeparationSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include pairing unions powers separation choice - -theorem indexed_union_embeds_square {K F : ZFSet.{u}} - (hK : K ∈ M.sets) (hF : F ∈ M.sets) - (ordinal : ordinalSetProperty K) (function : FunctionGraphOn K F) - (fibers : ∀ beta A, ZFSet.pair beta A ∈ F → GroundBelow M A K) : - M.groundEmbeddable (⋃₀ functionGraphRange K F) (ZFSet.prod K K) := by - let R := functionGraphRange K F - have hR : R ∈ M.sets := M.functionGraphRange_mem unions separation hK hF - apply M.enumerated_union_embeds_product pairing unions powers separation choice - hR (M.union_mem unions hR) hK hF (functionGraphRange_function function) - · intro A hA - exact (mem_functionGraphRange K F A).1 hA - · intro A hA x hx - exact ZFSet.mem_sUnion.2 ⟨A, hA, hx⟩ - · intro A hA - obtain ⟨beta, _, entry⟩ := (mem_functionGraphRange K F A).1 hA - obtain ⟨delta, hd, embedding⟩ := fibers beta A entry - exact TransitiveGround.groundEmbeddable_retarget embedding (ordinal.1 delta hd) - -theorem refinementDataHistoryIndices_embeds_square {history T K : ZFSet.{u}} - (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) - (ordinal : ordinalSetProperty K) (valid : RefinementDataHistory K history T) - (fibers : ∀ beta (data : Fin 15 → ZFSet.{u}), - ZFSet.pair beta (refinementFormulaDataCode data) ∈ history → GroundBelow M (data 0) K) : - M.groundEmbeddable (refinementDataHistoryIndices K history) (ZFSet.prod K K) := by - apply M.indexed_union_embeds_square pairing unions powers separation choice hK - (M.refinementDataHistoryField_mem pairing unions powers separation hK hHistory 0) - ordinal valid.index_function - intro beta A entry - obtain ⟨_, data, stored, rfl⟩ := (pair_mem_refinementDataHistoryField K history beta A 0).1 entry - exact fibers beta data stored - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (collection : CollectionSchema M.sets) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) -variable (hno : nodeOrder ∈ M.sets) (hb : basis ∈ M.sets) -variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) -variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) -variable (smallRows : GroundBelow M rows K) (smallNodes : GroundBelow M nodes K) -variable (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) -include pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 - hK conditions smallRows smallNodes smallT smallT2 -local notation "step" => fun level prior stage => stage = - M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 level prior - -theorem structuralForcingTrace_indices_embeds_square {history : ZFSet.{u}} - (hh : history ∈ M.sets) (trace : OrdinalRecursionTrace step K history) : - M.groundEmbeddable (refinementDataHistoryIndices K - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history)) (ZFSet.prod K K) := by - have prefixes := M.structuralForcingTrace_prefix_below rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 pairing unions powers separation infinite collection choice - hRows hG hn hno hb hT hT2 hK conditions smallRows smallNodes smallT smallT2 hh trace - have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes - nodeOrder nodeAction basis T T2 conditions.1 trace - have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection - ![G, nodes, nodeOrder, basis, T, T2, K, history] - (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT (Fin.cases hT2 - (Fin.cases hK (Fin.cases hh (fun j => Fin.elim0 j))))))))) - apply M.refinementDataHistoryIndices_embeds_square pairing unions powers separation choice - hK packed conditions.1 run.carriers.data - intro beta data entry - have member := run.carriers.data.function.pair_source entry - have smallCarrier : GroundBelow M (data 7) K := - (run.carriers.carrier beta data entry).symm ▸ (prefixes beta member).2 - exact (M.structuralRefinementHistory_indices_below pairing unions powers separation infinite collection - hK conditions G nodes nodeOrder basis T T2 hG hn hno hb hT hT2 smallNodes smallT smallT2 - hh data entry smallCarrier).2 - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralFullIndexSize + +namespace OAI + +open scoped ZFSet + +section + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) +variable (separation : SeparationSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include pairing unions powers separation choice + +theorem indexed_union_embeds_square {K F : ZFSet.{u}} + (hK : K ∈ M.sets) (hF : F ∈ M.sets) + (ordinal : ordinalSetProperty K) (function : FunctionGraphOn K F) + (fibers : ∀ beta A, ZFSet.pair beta A ∈ F → GroundBelow M A K) : + M.groundEmbeddable (⋃₀ functionGraphRange K F) (ZFSet.prod K K) := by + let R := functionGraphRange K F + have hR : R ∈ M.sets := M.functionGraphRange_mem unions separation hK hF + apply M.enumerated_union_embeds_product pairing unions powers separation choice + hR (M.union_mem unions hR) hK hF (functionGraphRange_function function) + · intro A hA + exact (mem_functionGraphRange K F A).1 hA + · intro A hA x hx + exact ZFSet.mem_sUnion.2 ⟨A, hA, hx⟩ + · intro A hA + obtain ⟨beta, _, entry⟩ := (mem_functionGraphRange K F A).1 hA + obtain ⟨delta, hd, embedding⟩ := fibers beta A entry + exact TransitiveGround.groundEmbeddable_retarget embedding (ordinal.1 delta hd) + +theorem refinementDataHistoryIndices_embeds_square {history T K : ZFSet.{u}} + (hK : K ∈ M.sets) (hHistory : history ∈ M.sets) + (ordinal : ordinalSetProperty K) (valid : RefinementDataHistory K history T) + (fibers : ∀ beta (data : Fin 15 → ZFSet.{u}), + ZFSet.pair beta (refinementFormulaDataCode data) ∈ history → GroundBelow M (data 0) K) : + M.groundEmbeddable (refinementDataHistoryIndices K history) (ZFSet.prod K K) := by + apply M.indexed_union_embeds_square pairing unions powers separation choice hK + (M.refinementDataHistoryField_mem pairing unions powers separation hK hHistory 0) + ordinal valid.index_function + intro beta A entry + obtain ⟨_, data, stored, rfl⟩ := (pair_mem_refinementDataHistoryField K history beta A 0).1 entry + exact fibers beta data stored + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (collection : CollectionSchema M.sets) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hRows : rows ∈ M.sets) (hG : G ∈ M.sets) (hn : nodes ∈ M.sets) +variable (hno : nodeOrder ∈ M.sets) (hb : basis ∈ M.sets) +variable (hT : T ∈ M.sets) (hT2 : T2 ∈ M.sets) +variable {K : ZFSet.{u}} (hK : K ∈ M.sets) (conditions : GroundInaccessibleConditions M K) +variable (smallRows : GroundBelow M rows K) (smallNodes : GroundBelow M nodes K) +variable (smallT : GroundBelow M T K) (smallT2 : GroundBelow M T2 K) +include pairing unions powers separation infinite collection choice hRows hG hn hno hb hT hT2 + hK conditions smallRows smallNodes smallT smallT2 +local notation "step" => fun level prior stage => stage = + M.structuralForcingStage rows rowOrder rowTop rowAction G nodes nodeOrder nodeAction basis T T2 level prior + +theorem structuralForcingTrace_indices_embeds_square {history : ZFSet.{u}} + (hh : history ∈ M.sets) (trace : OrdinalRecursionTrace step K history) : + M.groundEmbeddable (refinementDataHistoryIndices K + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 K history)) (ZFSet.prod K K) := by + have prefixes := M.structuralForcingTrace_prefix_below rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 pairing unions powers separation infinite collection choice + hRows hG hn hno hb hT hT2 hK conditions smallRows smallNodes smallT smallT2 hh trace + have run := M.structuralForcingTrace_recursiveOrder rows rowOrder rowTop rowAction G nodes + nodeOrder nodeAction basis T T2 conditions.1 trace + have packed := M.structuralRefinementHistory_mem pairing unions powers separation collection + ![G, nodes, nodeOrder, basis, T, T2, K, history] + (Fin.cases hG (Fin.cases hn (Fin.cases hno (Fin.cases hb (Fin.cases hT (Fin.cases hT2 + (Fin.cases hK (Fin.cases hh (fun j => Fin.elim0 j))))))))) + apply M.refinementDataHistoryIndices_embeds_square pairing unions powers separation choice + hK packed conditions.1 run.carriers.data + intro beta data entry + have member := run.carriers.data.function.pair_source entry + have smallCarrier : GroundBelow M (data 7) K := + (run.carriers.carrier beta data entry).symm ▸ (prefixes beta member).2 + exact (M.structuralRefinementHistory_indices_below pairing unions powers separation infinite collection + hK conditions G nodes nodeOrder basis T T2 hG hn hno hb hT hT2 smallNodes smallT smallT2 + hh data entry smallCarrier).2 + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralHistoryTestUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralHistoryTestUnions.lean index 67f5f7e4c7ca11b6d898af0d65cc95c10e994052..5cd2bf650d154e0784ded2d3ee51d445daff4cc9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralHistoryTestUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralHistoryTestUnions.lean @@ -1,492 +1,492 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def structuralRefinementHistory - (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := - ZFSet.range (fun x : {x : SetMembers history // - ∃ f : Fin 5 → ZFSet.{u}, SetMembers.raw x = nonemptyTupleCode 4 f ∧ f 0 ∈ stages} => - let f := Classical.choose x.property - ZFSet.pair (f 0) (M.rawRefinementFormulaDataCode (f 1) (f 2) (f 3) (f 4) - G nodes nodeOrder basis T T2 (f 0))) - -theorem mem_structuralRefinementHistory - (G nodes nodeOrder basis T T2 stages history z : ZFSet.{u}) : - z ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history ↔ - ∃ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - z = ZFSet.pair level (M.rawRefinementFormulaDataCode P order top action - G nodes nodeOrder basis T T2 level) := by - rw [structuralRefinementHistory, ZFSet.mem_range] - constructor - · rintro ⟨x, equal⟩ - let f := Classical.choose x.property - have shape := Classical.choose_spec x.property - refine ⟨f 0, shape.2, f 1, f 2, f 3, f 4, ?_, equal.symm⟩ - have tuple : nonemptyTupleCode 4 f = ZFSet.pair (f 0) - (forcingStageCode (f 1) (f 2) (f 3) (f 4)) := rfl - exact tuple ▸ shape.1 ▸ SetMembers.raw_mem x.val - · rintro ⟨level, hl, P, order, top, action, entry, rfl⟩ - let f : Fin 5 → ZFSet.{u} := ![level, P, order, top, action] - let x : {x : SetMembers history // ∃ f : Fin 5 → ZFSet.{u}, - SetMembers.raw x = nonemptyTupleCode 4 f ∧ f 0 ∈ stages} := - ⟨SetMembers.ofMem _ entry, f, SetMembers.raw_ofMem _ entry, hl⟩ - refine ⟨x, ?_⟩ - have same : Classical.choose x.property = f := nonemptyTupleCode_injective 4 - ((Classical.choose_spec x.property).1.symm.trans (SetMembers.raw_ofMem _ entry)) - dsimp only - rw [same] - rfl - -theorem pair_mem_structuralRefinementHistory - (G nodes nodeOrder basis T T2 stages history level output : ZFSet.{u}) : - ZFSet.pair level output ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history ↔ - level ∈ stages ∧ ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - output = M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level := by - rw [M.mem_structuralRefinementHistory] - constructor - · rintro ⟨l, hl, P, order, top, action, entry, equal⟩ - obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal - exact ⟨hl, P, order, top, action, entry, value⟩ - · rintro ⟨hl, P, order, top, action, entry, rfl⟩ - exact ⟨level, hl, P, order, top, action, entry, rfl⟩ - -theorem structuralRefinementHistory_entry - (G nodes nodeOrder basis T T2 stages history level P order top action output : ZFSet.{u}) - (function : FunctionGraphOn stages history) - (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) : - ZFSet.pair level output ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history ↔ - output = M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level := by - rw [M.pair_mem_structuralRefinementHistory] - constructor - · rintro ⟨_, P', order', top', action', entry, value⟩ - have same := function.unique entry stored - obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 same - exact value - · intro value - exact ⟨function.pair_source stored, P, order, top, action, stored, value⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) - - theorem structuralRefinementHistory_domain_restrict {stages earlier history : ZFSet.{u}} - (subset : earlier ⊆ stages) : - M.structuralRefinementHistory G nodes nodeOrder basis T T2 earlier history = - graphRestriction earlier (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨level, hl, P, order, top, action, stored, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 member - exact pair_mem_graphRestriction.2 ⟨(M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨subset hl, P, order, top, action, stored, rfl⟩, hl⟩ - · intro member - obtain ⟨level, hl, output, rfl, entry⟩ := mem_graphRestriction.1 member - obtain ⟨_, P, order, top, action, stored, value⟩ := (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).1 entry - exact (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨hl, P, order, top, action, stored, value⟩ - -theorem structuralRefinementHistory_history_restrict (stages history : ZFSet.{u}) : - M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages (graphRestriction stages history) = - M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history := by - apply ZFSet.ext - intro z - rw [M.mem_structuralRefinementHistory, M.mem_structuralRefinementHistory] - constructor - · rintro ⟨level, hl, P, order, top, action, stored, value⟩ - exact ⟨level, hl, P, order, top, action, (pair_mem_graphRestriction.1 stored).1, value⟩ - · rintro ⟨level, hl, P, order, top, action, stored, value⟩ - exact ⟨level, hl, P, order, top, action, pair_mem_graphRestriction.2 ⟨stored, hl⟩, value⟩ - -theorem structuralRefinementHistory_append {stages history level : ZFSet.{u}} - (function : FunctionGraphOn stages history) (P order top action : ZFSet.{u}) : - M.structuralRefinementHistory G nodes nodeOrder basis T T2 (insert level stages) - (insert (ZFSet.pair level (forcingStageCode P order top action)) history) = - insert (ZFSet.pair level (M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level)) - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨l, _, P', order', top', action', stored, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 member - rcases ZFSet.mem_insert_iff.1 stored with equal | old - · obtain ⟨rfl, same⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 same - exact ZFSet.mem_insert _ _ - · exact ZFSet.mem_insert_iff.2 (Or.inr ((M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨function.pair_source old, P', order', top', action', old, rfl⟩)) - · intro member - rcases ZFSet.mem_insert_iff.1 member with rfl | old - · exact (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨ZFSet.mem_insert _ _, P, order, top, action, ZFSet.mem_insert _ _, rfl⟩ - · obtain ⟨l, hl, P', order', top', action', stored, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 old - exact (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 - ⟨ZFSet.mem_insert_of_mem _ hl, P', order', top', action', ZFSet.mem_insert_of_mem _ stored, rfl⟩ - -theorem structuralRefinementHistory_function {stages history : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (shape : ∀ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history) : - FunctionGraphOn stages (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - let H := M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history - refine ⟨⋃₀ ⋃₀ H, ?_, ?_⟩ - · intro z hz - obtain ⟨level, hl, P, order, top, action, _, equal⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 hz - rw [equal] at hz ⊢ - exact ZFSet.pair_mem_prod.2 ⟨hl, pair_second_mem_doubleUnion hz⟩ - · intro level hl - obtain ⟨P, order, top, action, stored⟩ := shape level hl - have exactEntry := M.structuralRefinementHistory_entry G nodes nodeOrder basis T T2 stages history - level P order top action - refine ⟨_, (exactEntry _ function stored).2 rfl, ?_⟩ - intro y hy - exact (exactEntry y function stored).1 hy - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace BoundedFormula - -noncomputable def refinementDataHistoryFieldFormula {n : Nat} - (stages history z : Fin n) (j : Fin 15) : BoundedFormula n := - exPairFields z (.conj (.mem 1 stages.succ.succ) - (exGraphFields history.succ.succ - (.conj (.equal 1 3) (tupleFieldFormula 14 0 2 j)))) - -theorem truth_refinementDataHistoryFieldFormula {n : Nat} - (stages history z : Fin n) (j : Fin 15) (env : Fin n → ZFSet.{u}) : - Truth (refinementDataHistoryFieldFormula stages history z j) env ↔ - ∃ alpha ∈ env stages, ∃ d : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ env history ∧ - env z = ZFSet.pair alpha (d j) := by - simp only [refinementDataHistoryFieldFormula, truth_exPairFields, Truth, - truth_exGraphFields, truth_tupleFieldFormula] - change (∃ alpha y, env z = ZFSet.pair alpha y ∧ alpha ∈ env stages ∧ - ∃ key data, ZFSet.pair key data ∈ env history ∧ key = alpha ∧ - ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d ∧ y = d j) ↔ _ - constructor - · rintro ⟨alpha, y, pair, halpha, key, data, entry, rfl, d, rfl, rfl⟩ - exact ⟨key, halpha, d, entry, pair⟩ - · rintro ⟨alpha, halpha, d, entry, equal⟩ - exact ⟨alpha, d j, equal, halpha, alpha, refinementFormulaDataCode d, entry, rfl, d, rfl, rfl⟩ - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem refinementDataHistoryField_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (j : Fin 15) : refinementDataHistoryField stages history j ∈ M.sets := by - have bound := M.prod_mem pairing unions powers separation hStages - (M.tupleFieldBound_mem pairing unions 14 (M.union_mem unions (M.union_mem unions hHistory))) - let params := extend stages (extend history Fin.elim0) - have ground := M.bounded_separation_mem separation - (BoundedFormula.refinementDataHistoryFieldFormula 1 2 0 j) params - (Fin.cases hStages (Fin.cases hHistory (fun i => Fin.elim0 i))) bound - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.refinementDataHistoryFieldFormula 1 2 0 j) (extend z params)) - (ZFSet.prod stages (tupleFieldBound 14 (⋃₀ ⋃₀ history))) = - refinementDataHistoryField stages history j := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, refinementDataHistoryField, ZFSet.mem_sep] - exact and_congr_right (fun _ => BoundedFormula.truth_refinementDataHistoryFieldFormula 1 2 0 j _) - exact equal ▸ ground - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -structure RefinementDataHistory (stages history T : ZFSet.{u}) : Prop where - function : FunctionGraphOn stages history - decoded : ∀ alpha data, ZFSet.pair alpha data ∈ history → - ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d - terms : ∀ alpha (d : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → d 6 = T - literal : ∀ alpha (d : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) alpha - -noncomputable def refinementDataHistoryIndices (stages history : ZFSet.{u}) : ZFSet.{u} := - refinementHistoryIndices stages (refinementDataHistoryField stages history 0) - -noncomputable def refinementDataHistoryLevels (stages history T : ZFSet.{u}) : ZFSet.{u} := - refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T - -namespace RefinementDataHistory -variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) -include valid - -theorem index_function : FunctionGraphOn stages (refinementDataHistoryField stages history 0) := - refinementDataHistoryField_function valid.function valid.decoded 0 - -theorem index_literal : ∀ alpha I, ZFSet.pair alpha I ∈ refinementDataHistoryField stages history 0 → - RefinementIndexLevelCode I alpha := - refinementDataHistoryField_index_levels valid.literal - -theorem levels_function : - ZFSet.IsFunc (stageOneAssignments (refinementDataHistoryIndices stages history) T) stages - (refinementDataHistoryLevels stages history T) := - refinementHistoryAssignmentLevels_function valid.index_literal - -theorem coverage : ForcingHistoryLevelCoverage stages history (refinementDataHistoryLevels stages history T) := by - intro beta _ d entry t ht u hu w hw - apply (refinementHistoryAssignmentLevels_entry valid.index_function valid.index_literal T t u w beta).2 - have same := valid.terms beta d entry - exact ⟨d 0, (refinementDataHistoryField_entry valid.function d entry 0 _).2 rfl, - ht, same ▸ hu, same ▸ hw⟩ - -end RefinementDataHistory -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem refinementDataHistoryIndices_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) : - refinementDataHistoryIndices stages history ∈ M.sets := - M.refinementHistoryIndices_mem unions separation hStages - (M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0) - -theorem refinementDataHistoryLevels_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {stages history T : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (hT : T ∈ M.sets) : refinementDataHistoryLevels stages history T ∈ M.sets := - M.refinementHistoryAssignmentLevels_mem pairing unions powers separation hStages - (M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0) hT - -end TransitiveGround - - - - -namespace RefinementDataHistory -variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) -include valid - -theorem restrict {earlier : ZFSet.{u}} (subset : earlier ⊆ stages) : - RefinementDataHistory earlier (graphRestriction earlier history) T := by - refine ⟨valid.function.restrict subset, ?_, ?_, ?_⟩ - · intro alpha data entry - exact valid.decoded alpha data (pair_mem_graphRestriction.1 entry).1 - · intro alpha d entry - exact valid.terms alpha d (pair_mem_graphRestriction.1 entry).1 - · intro alpha d entry - exact valid.literal alpha d (pair_mem_graphRestriction.1 entry).1 - -theorem append {alpha : ZFSet.{u}} (outside : alpha ∉ stages) (d : Fin 15 → ZFSet.{u}) - (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) : - RefinementDataHistory (insert alpha stages) - (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) T := by - refine ⟨valid.function.insert outside _, ?_, ?_, ?_⟩ - · intro beta data entry - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · exact ⟨d, (ZFSet.pair_inj.1 equal).2⟩ - · exact valid.decoded beta data old - · intro beta fields entry - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · have same := refinementFormulaDataCode_injective (ZFSet.pair_inj.1 equal).2 - exact (congrFun same 6).trans terms - · exact valid.terms beta fields old - · intro beta fields entry - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal - have same := refinementFormulaDataCode_injective code - exact (congrFun same 0).symm ▸ literal - · exact valid.literal beta fields old - -theorem prefix_cut {alpha beta : ZFSet.{u}} (subset : alpha ⊆ stages) (below : beta ⊆ alpha) - (A : ZFSet.{u}) : - assignmentCut (refinementDataHistoryLevels alpha (graphRestriction alpha history) T) beta A = - assignmentCut (refinementDataHistoryLevels stages history T) beta A := - refinementDataHistoryAssignmentCut_prefix valid.function valid.decoded valid.literal subset below T A - -end RefinementDataHistory -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.RefinementDataHistory -universe u -variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) -variable {beta : ZFSet.{u}} {d : Fin 15 → ZFSet.{u}} -variable (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) -include valid entry - -theorem assignment_level_iff (t : ZFSet.{u}) (ht : t ∈ d 0) - (u : ZFSet.{u}) (hu : u ∈ d 6) (w : ZFSet.{u}) (hw : w ∈ d 6) (xi : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment t u w) xi ∈ refinementDataHistoryLevels stages history T ↔ - xi = beta := by - have actual := valid.coverage beta (valid.function.pair_source entry) d entry t ht u hu w hw - have source := (ZFSet.pair_mem_prod.1 (valid.levels_function.1 actual)).1 - obtain ⟨value, _, unique⟩ := valid.levels_function.2 _ source - exact ⟨fun member => (unique xi member).trans (unique beta actual).symm, - fun equal => equal.symm ▸ actual⟩ - -theorem rawTests_splice_below (M : TransitiveGround.{u}) (alpha Aq Ap lower : ZFSet.{u}) - (inside : beta ∈ alpha) : - stageOneRawTests M d (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) lower ↔ - stageOneRawTests M d Aq lower := by - apply stageOneRawTests_congr - intro t ht u hu w hw - have chosen : ∃ xi ∈ alpha, ZFSet.pair (stageOneAssignment t u w) xi ∈ - refinementDataHistoryLevels stages history T := - ⟨beta, inside, (valid.assignment_level_iff entry t ht u hu w hw beta).2 rfl⟩ - rw [mem_assignmentSplice] - exact ⟨fun h => h.elim And.left (fun upper => False.elim (upper.2 chosen)), - fun member => Or.inl ⟨member, chosen⟩⟩ - -theorem rawTests_splice_above (M : TransitiveGround.{u}) (alpha Aq Ap lower : ZFSet.{u}) - (outside : beta ∉ alpha) : - stageOneRawTests M d (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) lower ↔ - stageOneRawTests M d Ap lower := by - apply stageOneRawTests_congr - intro t ht u hu w hw - have absent : ¬ ∃ xi ∈ alpha, ZFSet.pair (stageOneAssignment t u w) xi ∈ - refinementDataHistoryLevels stages history T := by - rintro ⟨xi, hxi, member⟩ - exact outside ((valid.assignment_level_iff entry t ht u hu w hw xi).1 member ▸ hxi) - rw [mem_assignmentSplice] - exact ⟨fun h => h.elim (fun lower => False.elim (absent lower.2)) And.left, - fun member => Or.inr ⟨member, absent⟩⟩ - -theorem rawTests_on_earlier_cut (M : TransitiveGround.{u}) (alpha A lower : ZFSet.{u}) - (outside : beta ∉ alpha) : - stageOneRawTests M d (assignmentCut (refinementDataHistoryLevels stages history T) alpha A) lower := by - have absent : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, - stageOneAssignment t u w ∉ assignmentCut (refinementDataHistoryLevels stages history T) alpha A := by - intro t ht u hu w hw member - obtain ⟨_, xi, hxi, level⟩ := (mem_assignmentCut _ _ _ _).1 member - exact outside ((valid.assignment_level_iff entry t ht u hu w hw xi).1 level ▸ hxi) - exact ⟨fun t ht u hu w hw member => False.elim (absent t ht u hu w hw member), - fun t ht u hu _ _ w hw _ _ member _ => False.elim (absent t ht u hu w hw member)⟩ - -end PartitionPilot.Forcing.RefinementDataHistory - - - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) - - theorem rawRefinementFormulaData_level - (P order top action G nodes nodeOrder basis T T2 level : ZFSet.{u}) : - RefinementIndexLevelCode (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) level := by - intro z hz - obtain ⟨fields, equal, bound⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hz - exact ⟨fields, equal, ZFSet.mem_singleton.1 (bound 0)⟩ - -variable (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) - -theorem structuralRefinementHistory_decoded {level output : ZFSet.{u}} - (entry : ZFSet.pair level output ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) : - ∃ data : Fin 15 → ZFSet.{u}, output = refinementFormulaDataCode data := by - obtain ⟨_, P, order, top, action, _, equal⟩ := (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).1 entry - exact ⟨_, equal⟩ - -theorem structuralRefinementHistory_fields {level : ZFSet.{u}} (data : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair level (refinementFormulaDataCode data) ∈ - M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) : - level ∈ stages ∧ ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ - data = M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level := by - obtain ⟨hl, P, order, top, action, stored, equal⟩ := (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).1 entry - exact ⟨hl, P, order, top, action, stored, refinementFormulaDataCode_injective equal⟩ - -theorem structuralRefinementHistory_structural_fields {level : ZFSet.{u}} (data : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair level (refinementFormulaDataCode data) ∈ - M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) : - data 6 = T ∧ RefinementIndexLevelCode (data 0) level ∧ - ∃ action, ZFSet.pair level (forcingStageCode (data 7) (data 8) (data 9) action) ∈ history := by - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - exact ⟨rfl, M.rawRefinementFormulaData_level _ _ _ _ _ _ _ _ _ _ _, action, stored⟩ - -theorem structuralRefinementHistory_dataHistory - (function : FunctionGraphOn stages history) - (shape : ∀ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history) : - RefinementDataHistory stages (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T where - function := M.structuralRefinementHistory_function G nodes nodeOrder basis T T2 function shape - decoded := fun _ _ entry => M.structuralRefinementHistory_decoded G nodes nodeOrder basis T T2 stages history entry - terms := fun _ data entry => - (M.structuralRefinementHistory_structural_fields G nodes nodeOrder basis T T2 stages history data entry).1 - literal := fun _ data entry => - (M.structuralRefinementHistory_structural_fields G nodes nodeOrder basis T T2 stages history data entry).2.1 - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] -variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T T2 stages history : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) -variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) -variable (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -variable (witnesses : ∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - RawRefinementStageWitness M t b d base directed T T2 level P order top action) -include pairing unions powers separation collection group nodes supports hHistory hT witnesses - -theorem structuralHistory_rawTests_union : - ∀ level (data : Fin 15 → ZFSet.{u}), ZFSet.pair level (refinementFormulaDataCode data) ∈ - M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history → - ∀ (family lower : Nat → ZFSet.{u}) q, - (∀ n m, n ≤ m → family n ⊆ family m) → - (∀ n, ZFSet.pair q (lower n) ∈ data 8) → - (∀ n, stageOneRawTests M data (family n) (lower n)) → - stageOneRawTests M data (stageOneAssignmentUnion family) q := by - intro level data entry family lower q increasing below tests - obtain ⟨_, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields t.carrier b.carrier b.conditionOrder - (supportBasisCode b t d.principalFix) T T2 stages history data entry - have ground := M.forcingStageCode_fields - (M.transitive (M.union_mem unions (M.union_mem unions hHistory)) - (pair_second_mem_doubleUnion stored)) - exact (witnesses level P order top action stored).rawTests_union - pairing unions powers separation collection ground.1 group nodes ground.2.1 supports hT - family lower q increasing below tests - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def structuralRefinementHistory + (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) : ZFSet.{u} := + ZFSet.range (fun x : {x : SetMembers history // + ∃ f : Fin 5 → ZFSet.{u}, SetMembers.raw x = nonemptyTupleCode 4 f ∧ f 0 ∈ stages} => + let f := Classical.choose x.property + ZFSet.pair (f 0) (M.rawRefinementFormulaDataCode (f 1) (f 2) (f 3) (f 4) + G nodes nodeOrder basis T T2 (f 0))) + +theorem mem_structuralRefinementHistory + (G nodes nodeOrder basis T T2 stages history z : ZFSet.{u}) : + z ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history ↔ + ∃ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + z = ZFSet.pair level (M.rawRefinementFormulaDataCode P order top action + G nodes nodeOrder basis T T2 level) := by + rw [structuralRefinementHistory, ZFSet.mem_range] + constructor + · rintro ⟨x, equal⟩ + let f := Classical.choose x.property + have shape := Classical.choose_spec x.property + refine ⟨f 0, shape.2, f 1, f 2, f 3, f 4, ?_, equal.symm⟩ + have tuple : nonemptyTupleCode 4 f = ZFSet.pair (f 0) + (forcingStageCode (f 1) (f 2) (f 3) (f 4)) := rfl + exact tuple ▸ shape.1 ▸ SetMembers.raw_mem x.val + · rintro ⟨level, hl, P, order, top, action, entry, rfl⟩ + let f : Fin 5 → ZFSet.{u} := ![level, P, order, top, action] + let x : {x : SetMembers history // ∃ f : Fin 5 → ZFSet.{u}, + SetMembers.raw x = nonemptyTupleCode 4 f ∧ f 0 ∈ stages} := + ⟨SetMembers.ofMem _ entry, f, SetMembers.raw_ofMem _ entry, hl⟩ + refine ⟨x, ?_⟩ + have same : Classical.choose x.property = f := nonemptyTupleCode_injective 4 + ((Classical.choose_spec x.property).1.symm.trans (SetMembers.raw_ofMem _ entry)) + dsimp only + rw [same] + rfl + +theorem pair_mem_structuralRefinementHistory + (G nodes nodeOrder basis T T2 stages history level output : ZFSet.{u}) : + ZFSet.pair level output ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history ↔ + level ∈ stages ∧ ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + output = M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level := by + rw [M.mem_structuralRefinementHistory] + constructor + · rintro ⟨l, hl, P, order, top, action, entry, equal⟩ + obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal + exact ⟨hl, P, order, top, action, entry, value⟩ + · rintro ⟨hl, P, order, top, action, entry, rfl⟩ + exact ⟨level, hl, P, order, top, action, entry, rfl⟩ + +theorem structuralRefinementHistory_entry + (G nodes nodeOrder basis T T2 stages history level P order top action output : ZFSet.{u}) + (function : FunctionGraphOn stages history) + (stored : ZFSet.pair level (forcingStageCode P order top action) ∈ history) : + ZFSet.pair level output ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history ↔ + output = M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level := by + rw [M.pair_mem_structuralRefinementHistory] + constructor + · rintro ⟨_, P', order', top', action', entry, value⟩ + have same := function.unique entry stored + obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 same + exact value + · intro value + exact ⟨function.pair_source stored, P, order, top, action, stored, value⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder basis T T2 : ZFSet.{u}) + + theorem structuralRefinementHistory_domain_restrict {stages earlier history : ZFSet.{u}} + (subset : earlier ⊆ stages) : + M.structuralRefinementHistory G nodes nodeOrder basis T T2 earlier history = + graphRestriction earlier (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨level, hl, P, order, top, action, stored, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 member + exact pair_mem_graphRestriction.2 ⟨(M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨subset hl, P, order, top, action, stored, rfl⟩, hl⟩ + · intro member + obtain ⟨level, hl, output, rfl, entry⟩ := mem_graphRestriction.1 member + obtain ⟨_, P, order, top, action, stored, value⟩ := (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).1 entry + exact (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨hl, P, order, top, action, stored, value⟩ + +theorem structuralRefinementHistory_history_restrict (stages history : ZFSet.{u}) : + M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages (graphRestriction stages history) = + M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history := by + apply ZFSet.ext + intro z + rw [M.mem_structuralRefinementHistory, M.mem_structuralRefinementHistory] + constructor + · rintro ⟨level, hl, P, order, top, action, stored, value⟩ + exact ⟨level, hl, P, order, top, action, (pair_mem_graphRestriction.1 stored).1, value⟩ + · rintro ⟨level, hl, P, order, top, action, stored, value⟩ + exact ⟨level, hl, P, order, top, action, pair_mem_graphRestriction.2 ⟨stored, hl⟩, value⟩ + +theorem structuralRefinementHistory_append {stages history level : ZFSet.{u}} + (function : FunctionGraphOn stages history) (P order top action : ZFSet.{u}) : + M.structuralRefinementHistory G nodes nodeOrder basis T T2 (insert level stages) + (insert (ZFSet.pair level (forcingStageCode P order top action)) history) = + insert (ZFSet.pair level (M.rawRefinementFormulaDataCode P order top action G nodes nodeOrder basis T T2 level)) + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨l, _, P', order', top', action', stored, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 member + rcases ZFSet.mem_insert_iff.1 stored with equal | old + · obtain ⟨rfl, same⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl, rfl, rfl⟩ := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 same + exact ZFSet.mem_insert _ _ + · exact ZFSet.mem_insert_iff.2 (Or.inr ((M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨function.pair_source old, P', order', top', action', old, rfl⟩)) + · intro member + rcases ZFSet.mem_insert_iff.1 member with rfl | old + · exact (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨ZFSet.mem_insert _ _, P, order, top, action, ZFSet.mem_insert _ _, rfl⟩ + · obtain ⟨l, hl, P', order', top', action', stored, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 old + exact (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).2 + ⟨ZFSet.mem_insert_of_mem _ hl, P', order', top', action', ZFSet.mem_insert_of_mem _ stored, rfl⟩ + +theorem structuralRefinementHistory_function {stages history : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (shape : ∀ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history) : + FunctionGraphOn stages (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + let H := M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history + refine ⟨⋃₀ ⋃₀ H, ?_, ?_⟩ + · intro z hz + obtain ⟨level, hl, P, order, top, action, _, equal⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 hz + rw [equal] at hz ⊢ + exact ZFSet.pair_mem_prod.2 ⟨hl, pair_second_mem_doubleUnion hz⟩ + · intro level hl + obtain ⟨P, order, top, action, stored⟩ := shape level hl + have exactEntry := M.structuralRefinementHistory_entry G nodes nodeOrder basis T T2 stages history + level P order top action + refine ⟨_, (exactEntry _ function stored).2 rfl, ?_⟩ + intro y hy + exact (exactEntry y function stored).1 hy + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace BoundedFormula + +noncomputable def refinementDataHistoryFieldFormula {n : Nat} + (stages history z : Fin n) (j : Fin 15) : BoundedFormula n := + exPairFields z (.conj (.mem 1 stages.succ.succ) + (exGraphFields history.succ.succ + (.conj (.equal 1 3) (tupleFieldFormula 14 0 2 j)))) + +theorem truth_refinementDataHistoryFieldFormula {n : Nat} + (stages history z : Fin n) (j : Fin 15) (env : Fin n → ZFSet.{u}) : + Truth (refinementDataHistoryFieldFormula stages history z j) env ↔ + ∃ alpha ∈ env stages, ∃ d : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ env history ∧ + env z = ZFSet.pair alpha (d j) := by + simp only [refinementDataHistoryFieldFormula, truth_exPairFields, Truth, + truth_exGraphFields, truth_tupleFieldFormula] + change (∃ alpha y, env z = ZFSet.pair alpha y ∧ alpha ∈ env stages ∧ + ∃ key data, ZFSet.pair key data ∈ env history ∧ key = alpha ∧ + ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d ∧ y = d j) ↔ _ + constructor + · rintro ⟨alpha, y, pair, halpha, key, data, entry, rfl, d, rfl, rfl⟩ + exact ⟨key, halpha, d, entry, pair⟩ + · rintro ⟨alpha, halpha, d, entry, equal⟩ + exact ⟨alpha, d j, equal, halpha, alpha, refinementFormulaDataCode d, entry, rfl, d, rfl, rfl⟩ + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem refinementDataHistoryField_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (j : Fin 15) : refinementDataHistoryField stages history j ∈ M.sets := by + have bound := M.prod_mem pairing unions powers separation hStages + (M.tupleFieldBound_mem pairing unions 14 (M.union_mem unions (M.union_mem unions hHistory))) + let params := extend stages (extend history Fin.elim0) + have ground := M.bounded_separation_mem separation + (BoundedFormula.refinementDataHistoryFieldFormula 1 2 0 j) params + (Fin.cases hStages (Fin.cases hHistory (fun i => Fin.elim0 i))) bound + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.refinementDataHistoryFieldFormula 1 2 0 j) (extend z params)) + (ZFSet.prod stages (tupleFieldBound 14 (⋃₀ ⋃₀ history))) = + refinementDataHistoryField stages history j := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, refinementDataHistoryField, ZFSet.mem_sep] + exact and_congr_right (fun _ => BoundedFormula.truth_refinementDataHistoryFieldFormula 1 2 0 j _) + exact equal ▸ ground + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +structure RefinementDataHistory (stages history T : ZFSet.{u}) : Prop where + function : FunctionGraphOn stages history + decoded : ∀ alpha data, ZFSet.pair alpha data ∈ history → + ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d + terms : ∀ alpha (d : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → d 6 = T + literal : ∀ alpha (d : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) alpha + +noncomputable def refinementDataHistoryIndices (stages history : ZFSet.{u}) : ZFSet.{u} := + refinementHistoryIndices stages (refinementDataHistoryField stages history 0) + +noncomputable def refinementDataHistoryLevels (stages history T : ZFSet.{u}) : ZFSet.{u} := + refinementHistoryAssignmentLevels stages (refinementDataHistoryField stages history 0) T + +namespace RefinementDataHistory +variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) +include valid + +theorem index_function : FunctionGraphOn stages (refinementDataHistoryField stages history 0) := + refinementDataHistoryField_function valid.function valid.decoded 0 + +theorem index_literal : ∀ alpha I, ZFSet.pair alpha I ∈ refinementDataHistoryField stages history 0 → + RefinementIndexLevelCode I alpha := + refinementDataHistoryField_index_levels valid.literal + +theorem levels_function : + ZFSet.IsFunc (stageOneAssignments (refinementDataHistoryIndices stages history) T) stages + (refinementDataHistoryLevels stages history T) := + refinementHistoryAssignmentLevels_function valid.index_literal + +theorem coverage : ForcingHistoryLevelCoverage stages history (refinementDataHistoryLevels stages history T) := by + intro beta _ d entry t ht u hu w hw + apply (refinementHistoryAssignmentLevels_entry valid.index_function valid.index_literal T t u w beta).2 + have same := valid.terms beta d entry + exact ⟨d 0, (refinementDataHistoryField_entry valid.function d entry 0 _).2 rfl, + ht, same ▸ hu, same ▸ hw⟩ + +end RefinementDataHistory +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem refinementDataHistoryIndices_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {stages history : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) : + refinementDataHistoryIndices stages history ∈ M.sets := + M.refinementHistoryIndices_mem unions separation hStages + (M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0) + +theorem refinementDataHistoryLevels_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {stages history T : ZFSet.{u}} (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (hT : T ∈ M.sets) : refinementDataHistoryLevels stages history T ∈ M.sets := + M.refinementHistoryAssignmentLevels_mem pairing unions powers separation hStages + (M.refinementDataHistoryField_mem pairing unions powers separation hStages hHistory 0) hT + +end TransitiveGround + + + + +namespace RefinementDataHistory +variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) +include valid + +theorem restrict {earlier : ZFSet.{u}} (subset : earlier ⊆ stages) : + RefinementDataHistory earlier (graphRestriction earlier history) T := by + refine ⟨valid.function.restrict subset, ?_, ?_, ?_⟩ + · intro alpha data entry + exact valid.decoded alpha data (pair_mem_graphRestriction.1 entry).1 + · intro alpha d entry + exact valid.terms alpha d (pair_mem_graphRestriction.1 entry).1 + · intro alpha d entry + exact valid.literal alpha d (pair_mem_graphRestriction.1 entry).1 + +theorem append {alpha : ZFSet.{u}} (outside : alpha ∉ stages) (d : Fin 15 → ZFSet.{u}) + (terms : d 6 = T) (literal : RefinementIndexLevelCode (d 0) alpha) : + RefinementDataHistory (insert alpha stages) + (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) T := by + refine ⟨valid.function.insert outside _, ?_, ?_, ?_⟩ + · intro beta data entry + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · exact ⟨d, (ZFSet.pair_inj.1 equal).2⟩ + · exact valid.decoded beta data old + · intro beta fields entry + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · have same := refinementFormulaDataCode_injective (ZFSet.pair_inj.1 equal).2 + exact (congrFun same 6).trans terms + · exact valid.terms beta fields old + · intro beta fields entry + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal + have same := refinementFormulaDataCode_injective code + exact (congrFun same 0).symm ▸ literal + · exact valid.literal beta fields old + +theorem prefix_cut {alpha beta : ZFSet.{u}} (subset : alpha ⊆ stages) (below : beta ⊆ alpha) + (A : ZFSet.{u}) : + assignmentCut (refinementDataHistoryLevels alpha (graphRestriction alpha history) T) beta A = + assignmentCut (refinementDataHistoryLevels stages history T) beta A := + refinementDataHistoryAssignmentCut_prefix valid.function valid.decoded valid.literal subset below T A + +end RefinementDataHistory +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.RefinementDataHistory +universe u +variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) +variable {beta : ZFSet.{u}} {d : Fin 15 → ZFSet.{u}} +variable (entry : ZFSet.pair beta (refinementFormulaDataCode d) ∈ history) +include valid entry + +theorem assignment_level_iff (t : ZFSet.{u}) (ht : t ∈ d 0) + (u : ZFSet.{u}) (hu : u ∈ d 6) (w : ZFSet.{u}) (hw : w ∈ d 6) (xi : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment t u w) xi ∈ refinementDataHistoryLevels stages history T ↔ + xi = beta := by + have actual := valid.coverage beta (valid.function.pair_source entry) d entry t ht u hu w hw + have source := (ZFSet.pair_mem_prod.1 (valid.levels_function.1 actual)).1 + obtain ⟨value, _, unique⟩ := valid.levels_function.2 _ source + exact ⟨fun member => (unique xi member).trans (unique beta actual).symm, + fun equal => equal.symm ▸ actual⟩ + +theorem rawTests_splice_below (M : TransitiveGround.{u}) (alpha Aq Ap lower : ZFSet.{u}) + (inside : beta ∈ alpha) : + stageOneRawTests M d (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) lower ↔ + stageOneRawTests M d Aq lower := by + apply stageOneRawTests_congr + intro t ht u hu w hw + have chosen : ∃ xi ∈ alpha, ZFSet.pair (stageOneAssignment t u w) xi ∈ + refinementDataHistoryLevels stages history T := + ⟨beta, inside, (valid.assignment_level_iff entry t ht u hu w hw beta).2 rfl⟩ + rw [mem_assignmentSplice] + exact ⟨fun h => h.elim And.left (fun upper => False.elim (upper.2 chosen)), + fun member => Or.inl ⟨member, chosen⟩⟩ + +theorem rawTests_splice_above (M : TransitiveGround.{u}) (alpha Aq Ap lower : ZFSet.{u}) + (outside : beta ∉ alpha) : + stageOneRawTests M d (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) lower ↔ + stageOneRawTests M d Ap lower := by + apply stageOneRawTests_congr + intro t ht u hu w hw + have absent : ¬ ∃ xi ∈ alpha, ZFSet.pair (stageOneAssignment t u w) xi ∈ + refinementDataHistoryLevels stages history T := by + rintro ⟨xi, hxi, member⟩ + exact outside ((valid.assignment_level_iff entry t ht u hu w hw xi).1 member ▸ hxi) + rw [mem_assignmentSplice] + exact ⟨fun h => h.elim (fun lower => False.elim (absent lower.2)) And.left, + fun member => Or.inr ⟨member, absent⟩⟩ + +theorem rawTests_on_earlier_cut (M : TransitiveGround.{u}) (alpha A lower : ZFSet.{u}) + (outside : beta ∉ alpha) : + stageOneRawTests M d (assignmentCut (refinementDataHistoryLevels stages history T) alpha A) lower := by + have absent : ∀ t ∈ d 0, ∀ u ∈ d 6, ∀ w ∈ d 6, + stageOneAssignment t u w ∉ assignmentCut (refinementDataHistoryLevels stages history T) alpha A := by + intro t ht u hu w hw member + obtain ⟨_, xi, hxi, level⟩ := (mem_assignmentCut _ _ _ _).1 member + exact outside ((valid.assignment_level_iff entry t ht u hu w hw xi).1 level ▸ hxi) + exact ⟨fun t ht u hu w hw member => False.elim (absent t ht u hu w hw member), + fun t ht u hu _ _ w hw _ _ member _ => False.elim (absent t ht u hu w hw member)⟩ + +end PartitionPilot.Forcing.RefinementDataHistory + + + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) + + theorem rawRefinementFormulaData_level + (P order top action G nodes nodeOrder basis T T2 level : ZFSet.{u}) : + RefinementIndexLevelCode (M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level 0) level := by + intro z hz + obtain ⟨fields, equal, bound⟩ := M.refinementIndices_fields _ _ _ _ _ _ _ _ _ _ _ hz + exact ⟨fields, equal, ZFSet.mem_singleton.1 (bound 0)⟩ + +variable (G nodes nodeOrder basis T T2 stages history : ZFSet.{u}) + +theorem structuralRefinementHistory_decoded {level output : ZFSet.{u}} + (entry : ZFSet.pair level output ∈ M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) : + ∃ data : Fin 15 → ZFSet.{u}, output = refinementFormulaDataCode data := by + obtain ⟨_, P, order, top, action, _, equal⟩ := (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).1 entry + exact ⟨_, equal⟩ + +theorem structuralRefinementHistory_fields {level : ZFSet.{u}} (data : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair level (refinementFormulaDataCode data) ∈ + M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) : + level ∈ stages ∧ ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history ∧ + data = M.rawRefinementFormulaData P order top action G nodes nodeOrder basis T T2 level := by + obtain ⟨hl, P, order, top, action, stored, equal⟩ := (M.pair_mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _ _).1 entry + exact ⟨hl, P, order, top, action, stored, refinementFormulaDataCode_injective equal⟩ + +theorem structuralRefinementHistory_structural_fields {level : ZFSet.{u}} (data : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair level (refinementFormulaDataCode data) ∈ + M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) : + data 6 = T ∧ RefinementIndexLevelCode (data 0) level ∧ + ∃ action, ZFSet.pair level (forcingStageCode (data 7) (data 8) (data 9) action) ∈ history := by + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + exact ⟨rfl, M.rawRefinementFormulaData_level _ _ _ _ _ _ _ _ _ _ _, action, stored⟩ + +theorem structuralRefinementHistory_dataHistory + (function : FunctionGraphOn stages history) + (shape : ∀ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history) : + RefinementDataHistory stages (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) T where + function := M.structuralRefinementHistory_function G nodes nodeOrder basis T T2 function shape + decoded := fun _ _ entry => M.structuralRefinementHistory_decoded G nodes nodeOrder basis T T2 stages history entry + terms := fun _ data entry => + (M.structuralRefinementHistory_structural_fields G nodes nodeOrder basis T T2 stages history data entry).1 + literal := fun _ data entry => + (M.structuralRefinementHistory_structural_fields G nodes nodeOrder basis T T2 stages history data entry).2.1 + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G L : Type u} [Group G] [PartialOrder L] +variable (t : Presentation G) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T T2 stages history : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (group : t.carrier ∈ M.sets) (nodes : b.carrier ∈ M.sets) +variable (supports : supportBasisCode b t d.principalFix ∈ M.sets) +variable (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +variable (witnesses : ∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + RawRefinementStageWitness M t b d base directed T T2 level P order top action) +include pairing unions powers separation collection group nodes supports hHistory hT witnesses + +theorem structuralHistory_rawTests_union : + ∀ level (data : Fin 15 → ZFSet.{u}), ZFSet.pair level (refinementFormulaDataCode data) ∈ + M.structuralRefinementHistory t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history → + ∀ (family lower : Nat → ZFSet.{u}) q, + (∀ n m, n ≤ m → family n ⊆ family m) → + (∀ n, ZFSet.pair q (lower n) ∈ data 8) → + (∀ n, stageOneRawTests M data (family n) (lower n)) → + stageOneRawTests M data (stageOneAssignmentUnion family) q := by + intro level data entry family lower q increasing below tests + obtain ⟨_, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields t.carrier b.carrier b.conditionOrder + (supportBasisCode b t d.principalFix) T T2 stages history data entry + have ground := M.forcingStageCode_fields + (M.transitive (M.union_mem unions (M.union_mem unions hHistory)) + (pair_second_mem_doubleUnion stored)) + exact (witnesses level P order top action stored).rawTests_union + pairing unions powers separation collection ground.1 group nodes ground.2.1 supports hT + family lower q increasing below tests + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralRefinementHistories.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralRefinementHistories.lean index 1ad973d8d866f21db2d416c5b6d88254ecba6dd4..9f299cec2c74a69a4ad62092f1b62efaec6717dd 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralRefinementHistories.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundStructuralRefinementHistories.lean @@ -1,123 +1,123 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.StructuralRefinementHistoryFormulas - -namespace OAI - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) - -private theorem imageMeaning (env : Fin 8 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (y : ZFSet.{u}) (hy : y ∈ M.sets) : - y ∈ M.structuralRefinementHistory (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) ↔ - ∃ x ∈ env 7, Realize M.sets (M.structuralRefinementEntryFormula pairing unions powers separation collection) - (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5])) := by - rw [M.mem_structuralRefinementHistory] - have meaning (x : ZFSet.{u}) (hx : x ∈ env 7) := - M.realize_structuralRefinementEntryFormula pairing unions powers separation collection - (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5])) - (Fin.cases (M.transitive (members 7) hx) (Fin.cases hy - (Fin.cases (members 6) (Fin.cases (members 0) (Fin.cases (members 1) - (Fin.cases (members 2) (Fin.cases (members 3) (Fin.cases (members 4) - (Fin.cases (members 5) (fun j => Fin.elim0 j)))))))))) - constructor - · rintro ⟨level, hl, P, order, top, action, entry, equal⟩ - exact ⟨_, entry, (meaning _ entry).2 ⟨![level, P, order, top, action], rfl, hl, equal⟩⟩ - · rintro ⟨x, hx, holds⟩ - obtain ⟨f, shape, level, value⟩ := (meaning x hx).1 holds - change x = ZFSet.pair (f 0) (forcingStageCode (f 1) (f 2) (f 3) (f 4)) at shape - exact ⟨f 0, level, f 1, f 2, f 3, f 4, shape ▸ hx, value⟩ - -include pairing unions powers separation collection in - theorem structuralRefinementHistory_mem (env : Fin 8 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) : - M.structuralRefinementHistory (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) ∈ M.sets := by - let params : Fin 7 → ZFSet.{u} := ![env 6, env 0, env 1, env 2, env 3, env 4, env 5] - have paramGround : ∀ j, params j ∈ M.sets := Fin.cases (members 6) (Fin.cases (members 0) - (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) - (Fin.cases (members 4) (Fin.cases (members 5) (fun j => Fin.elim0 j))))))) - apply M.definable_image_mem separation collection - (M.structuralRefinementEntryFormula pairing unions powers separation collection) params paramGround (members 7) - · intro y hy - obtain ⟨level, _, P, order, top, action, entry, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 hy - have fields := M.nonemptyTupleCode_field_mem 4 (![level, P, order, top, action]) - (M.transitive (members 7) entry) - exact (M.definable_structuralRefinementEntry pairing unions powers separation collection).closed - ![level, P, order, top, action, env 0, env 1, env 2, env 3, env 4, env 5] - (Fin.cases (fields 0) (Fin.cases (fields 1) (Fin.cases (fields 2) (Fin.cases (fields 3) - (Fin.cases (fields 4) (Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) - (Fin.cases (members 3) (Fin.cases (members 4) (Fin.cases (members 5) (fun j => Fin.elim0 j)))))))))))) - · exact imageMeaning M pairing unions powers separation collection env members - · intro x hx y hy z hz first second - have meaning (w : ZFSet.{u}) (hw : w ∈ M.sets) := - M.realize_structuralRefinementEntryFormula pairing unions powers separation collection - (extend x (extend w params)) - (Fin.cases (M.transitive (members 7) hx) (Fin.cases hw paramGround)) - obtain ⟨f, shape, _, value⟩ := (meaning y hy).1 first - obtain ⟨g, shape', _, value'⟩ := (meaning z hz).1 second - have same := nonemptyTupleCode_injective 4 (shape.symm.trans shape') - exact value.trans (same ▸ value'.symm) - -noncomputable def structuralRefinementHistoryFormula : SetFormula 9 := - exactSetFormula 0 (.ex (.conj (.mem 0 10) - (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] - (M.structuralRefinementEntryFormula pairing unions powers separation collection)))) - -private theorem realizeHistoryReindex (U : Set ZFSet.{u}) (φ : SetFormula 9) - (env : Fin 8 → ZFSet.{u}) (z y x : ZFSet.{u}) : - Realize U (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] φ) - (extend x (extend y (extend z env))) ↔ - Realize U φ (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5])) := by - rw [realize_reindex] - have args : (fun j : Fin 9 => - extend x (extend y (extend z env)) (![0, 1, 9, 3, 4, 5, 6, 7, 8] j)) = - extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5]) := by - funext j - exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl - (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))) j - exact args ▸ Iff.rfl - -private theorem historyFormula_correct (φ : SetFormula 9) (env : Fin 8 → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) (target : ZFSet.{u}) (target_mem : target ∈ M.sets) - (meaning : ∀ y ∈ M.sets, y ∈ target ↔ - ∃ x ∈ env 7, Realize M.sets φ - (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5]))) - (z : ZFSet.{u}) (hz : z ∈ M.sets) : - Realize M.sets - (exactSetFormula 0 (.ex (.conj (.mem 0 10) - (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] φ)))) - (extend z env) ↔ z = target := by - apply M.realize_exactSetFormula 0 _ (extend z env) hz - (fun _ h => M.transitive target_mem h) - intro y hy - refine (realize_ex M.sets _ _).trans ?_ - change (∃ x ∈ M.sets, x ∈ env 7 ∧ Realize M.sets - (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] φ) - (extend x (extend y (extend z env)))) ↔ y ∈ target - refine Iff.trans ?_ (meaning y hy).symm - constructor - · rintro ⟨x, _, hx, holds⟩ - exact ⟨x, hx, (realizeHistoryReindex M.sets φ env z y x).mp holds⟩ - · rintro ⟨x, hx, holds⟩ - refine ⟨x, M.transitive (members 7) hx, hx, ?_⟩ - exact (realizeHistoryReindex M.sets φ env z y x).mpr holds - -noncomputable def definable_structuralRefinementHistory : - GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => - M.structuralRefinementHistory (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) where - formula := M.structuralRefinementHistoryFormula pairing unions powers separation collection - closed := M.structuralRefinementHistory_mem pairing unions powers separation collection - correct := fun env members => historyFormula_correct M - (M.structuralRefinementEntryFormula pairing unions powers separation collection) env members _ - (M.structuralRefinementHistory_mem pairing unions powers separation collection env members) - (imageMeaning M pairing unions powers separation collection env members) - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.StructuralRefinementHistoryFormulas + +namespace OAI + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) + +private theorem imageMeaning (env : Fin 8 → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (y : ZFSet.{u}) (hy : y ∈ M.sets) : + y ∈ M.structuralRefinementHistory (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) ↔ + ∃ x ∈ env 7, Realize M.sets (M.structuralRefinementEntryFormula pairing unions powers separation collection) + (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5])) := by + rw [M.mem_structuralRefinementHistory] + have meaning (x : ZFSet.{u}) (hx : x ∈ env 7) := + M.realize_structuralRefinementEntryFormula pairing unions powers separation collection + (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5])) + (Fin.cases (M.transitive (members 7) hx) (Fin.cases hy + (Fin.cases (members 6) (Fin.cases (members 0) (Fin.cases (members 1) + (Fin.cases (members 2) (Fin.cases (members 3) (Fin.cases (members 4) + (Fin.cases (members 5) (fun j => Fin.elim0 j)))))))))) + constructor + · rintro ⟨level, hl, P, order, top, action, entry, equal⟩ + exact ⟨_, entry, (meaning _ entry).2 ⟨![level, P, order, top, action], rfl, hl, equal⟩⟩ + · rintro ⟨x, hx, holds⟩ + obtain ⟨f, shape, level, value⟩ := (meaning x hx).1 holds + change x = ZFSet.pair (f 0) (forcingStageCode (f 1) (f 2) (f 3) (f 4)) at shape + exact ⟨f 0, level, f 1, f 2, f 3, f 4, shape ▸ hx, value⟩ + +include pairing unions powers separation collection in + theorem structuralRefinementHistory_mem (env : Fin 8 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) : + M.structuralRefinementHistory (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7) ∈ M.sets := by + let params : Fin 7 → ZFSet.{u} := ![env 6, env 0, env 1, env 2, env 3, env 4, env 5] + have paramGround : ∀ j, params j ∈ M.sets := Fin.cases (members 6) (Fin.cases (members 0) + (Fin.cases (members 1) (Fin.cases (members 2) (Fin.cases (members 3) + (Fin.cases (members 4) (Fin.cases (members 5) (fun j => Fin.elim0 j))))))) + apply M.definable_image_mem separation collection + (M.structuralRefinementEntryFormula pairing unions powers separation collection) params paramGround (members 7) + · intro y hy + obtain ⟨level, _, P, order, top, action, entry, rfl⟩ := (M.mem_structuralRefinementHistory _ _ _ _ _ _ _ _ _).1 hy + have fields := M.nonemptyTupleCode_field_mem 4 (![level, P, order, top, action]) + (M.transitive (members 7) entry) + exact (M.definable_structuralRefinementEntry pairing unions powers separation collection).closed + ![level, P, order, top, action, env 0, env 1, env 2, env 3, env 4, env 5] + (Fin.cases (fields 0) (Fin.cases (fields 1) (Fin.cases (fields 2) (Fin.cases (fields 3) + (Fin.cases (fields 4) (Fin.cases (members 0) (Fin.cases (members 1) (Fin.cases (members 2) + (Fin.cases (members 3) (Fin.cases (members 4) (Fin.cases (members 5) (fun j => Fin.elim0 j)))))))))))) + · exact imageMeaning M pairing unions powers separation collection env members + · intro x hx y hy z hz first second + have meaning (w : ZFSet.{u}) (hw : w ∈ M.sets) := + M.realize_structuralRefinementEntryFormula pairing unions powers separation collection + (extend x (extend w params)) + (Fin.cases (M.transitive (members 7) hx) (Fin.cases hw paramGround)) + obtain ⟨f, shape, _, value⟩ := (meaning y hy).1 first + obtain ⟨g, shape', _, value'⟩ := (meaning z hz).1 second + have same := nonemptyTupleCode_injective 4 (shape.symm.trans shape') + exact value.trans (same ▸ value'.symm) + +noncomputable def structuralRefinementHistoryFormula : SetFormula 9 := + exactSetFormula 0 (.ex (.conj (.mem 0 10) + (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] + (M.structuralRefinementEntryFormula pairing unions powers separation collection)))) + +private theorem realizeHistoryReindex (U : Set ZFSet.{u}) (φ : SetFormula 9) + (env : Fin 8 → ZFSet.{u}) (z y x : ZFSet.{u}) : + Realize U (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] φ) + (extend x (extend y (extend z env))) ↔ + Realize U φ (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5])) := by + rw [realize_reindex] + have args : (fun j : Fin 9 => + extend x (extend y (extend z env)) (![0, 1, 9, 3, 4, 5, 6, 7, 8] j)) = + extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5]) := by + funext j + exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl + (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun k => Fin.elim0 k))))))))) j + exact args ▸ Iff.rfl + +private theorem historyFormula_correct (φ : SetFormula 9) (env : Fin 8 → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) (target : ZFSet.{u}) (target_mem : target ∈ M.sets) + (meaning : ∀ y ∈ M.sets, y ∈ target ↔ + ∃ x ∈ env 7, Realize M.sets φ + (extend x (extend y ![env 6, env 0, env 1, env 2, env 3, env 4, env 5]))) + (z : ZFSet.{u}) (hz : z ∈ M.sets) : + Realize M.sets + (exactSetFormula 0 (.ex (.conj (.mem 0 10) + (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] φ)))) + (extend z env) ↔ z = target := by + apply M.realize_exactSetFormula 0 _ (extend z env) hz + (fun _ h => M.transitive target_mem h) + intro y hy + refine (realize_ex M.sets _ _).trans ?_ + change (∃ x ∈ M.sets, x ∈ env 7 ∧ Realize M.sets + (SetFormula.reindex ![0, 1, 9, 3, 4, 5, 6, 7, 8] φ) + (extend x (extend y (extend z env)))) ↔ y ∈ target + refine Iff.trans ?_ (meaning y hy).symm + constructor + · rintro ⟨x, _, hx, holds⟩ + exact ⟨x, hx, (realizeHistoryReindex M.sets φ env z y x).mp holds⟩ + · rintro ⟨x, hx, holds⟩ + refine ⟨x, M.transitive (members 7) hx, hx, ?_⟩ + exact (realizeHistoryReindex M.sets φ env z y x).mpr holds + +noncomputable def definable_structuralRefinementHistory : + GroundDefinableFunction M (fun env : Fin 8 → ZFSet.{u} => + M.structuralRefinementHistory (env 0) (env 1) (env 2) (env 3) (env 4) (env 5) (env 6) (env 7)) where + formula := M.structuralRefinementHistoryFormula pairing unions powers separation collection + closed := M.structuralRefinementHistory_mem pairing unions powers separation collection + correct := fun env members => historyFormula_correct M + (M.structuralRefinementEntryFormula pairing unions powers separation collection) env members _ + (M.structuralRefinementHistory_mem pairing unions powers separation collection env members) + (imageMeaning M pairing unions powers separation collection env members) + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTaskBearingSuccessorDecoding.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTaskBearingSuccessorDecoding.lean index da9bfa05c7d695784655cf8720fb83bd2456a962..7cb4e246fe4d391b8356382cb031573eff65998f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTaskBearingSuccessorDecoding.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTaskBearingSuccessorDecoding.lean @@ -1,634 +1,634 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRectangleFulfillment -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedTransitionRetarget -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainCompressionActorCode - -namespace OAI - - -namespace PartitionPilot.Forcing -universe u - -def StrictSuccessorTopCode (P Q R e top : ZFSet.{u}) : Prop := - ∀ x ∈ P, ∀ y ∈ Q, ZFSet.pair x y ∈ e → - ZFSet.pair y top ∈ R ∧ ZFSet.pair top y ∉ R - -namespace BoundedFormula - -def strictSuccessorTopFormula {n} (P Q R e top : Fin n) : BoundedFormula n := - .allMem P (.allMem Q.succ (imp (pairMembershipFormula 1 0 e.succ.succ) - (.conj (pairMembershipFormula 0 top.succ.succ R.succ.succ) - (.neg (pairMembershipFormula top.succ.succ 0 R.succ.succ))))) - -theorem truth_strictSuccessorTopFormula {n} (P Q R e top : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (strictSuccessorTopFormula P Q R e top) env ↔ - StrictSuccessorTopCode (env P) (env Q) (env R) (env e) (env top) := by - simp only [strictSuccessorTopFormula, Truth, truth_imp, truth_pairMembershipFormula] - rfl - -theorem realize_strictSuccessorTopFormula (M : TransitiveGround.{u}) {n} - (P Q R e top : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - SetFormula.Realize M.sets (strictSuccessorTopFormula P Q R e top).toFormula env ↔ - StrictSuccessorTopCode (env P) (env Q) (env R) (env e) (env top) := - (realize_toFormula M _ env members).trans (truth_strictSuccessorTopFormula P Q R e top env) - -end BoundedFormula - - - - - -structure MainSuccessorOutputCode (f : Fin 30 → ZFSet.{u}) : Prop where - transition : MainTransitionLaws (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) - (f 8) (f 9) (f 10) (f 11) (f 12) (f 13) (f 14) (f 15) (f 16) (f 17) (f 18) (f 19) - strict_top : StrictSuccessorTopCode (f 0) (f 1) (f 3) (f 18) (f 29) - separation : SeparationFulfillmentCode (f 0) (f 2) (f 1) (f 3) (f 5) (f 7) (f 13) (f 18) - rectangles : RectangleFulfillmentCode (f 0) (f 6) (f 2) (f 4) (f 12) - (f 1) (f 7) (f 3) (f 5) (f 13) (f 18) (f 19) - old_profiles : OldProfilePreservationCode (f 0) (f 2) (f 4) (f 1) (f 3) (f 5) (f 18) (f 26) - task_caps : TaskCapFamilyCode (f 21) (f 0) (f 1) (f 3) (f 5) (f 18) - (f 23) (f 24) (f 25) (f 26) (f 28) - compression_actors : CompressionActorFulfillmentCode (f 21) (f 0) (f 6) (f 1) (f 7) - (f 3) (f 13) (f 18) (f 19) (f 22) (f 27) (f 20) (f 28) - -namespace BoundedFormula - -def mainSuccessorOutputFormula {n} (f : Fin 30 → Fin n) : BoundedFormula n := - .conj (mainTransitionLawsFormula (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) - (f 8) (f 9) (f 10) (f 11) (f 12) (f 13) (f 14) (f 15) (f 16) (f 17) (f 18) (f 19)) - (.conj (strictSuccessorTopFormula (f 0) (f 1) (f 3) (f 18) (f 29)) - (.conj (separationFulfillmentFormula (f 0) (f 2) (f 1) (f 3) (f 5) (f 7) (f 13) (f 18)) - (.conj (rectangleFulfillmentFormula (f 0) (f 6) (f 2) (f 4) (f 12) - (f 1) (f 7) (f 3) (f 5) (f 13) (f 18) (f 19)) - (.conj (oldProfilePreservationFormula (f 0) (f 2) (f 4) (f 1) (f 3) (f 5) (f 18) (f 26)) - (.conj (taskCapFamilyFormula (f 21) (f 0) (f 1) (f 3) (f 5) (f 18) - (f 23) (f 24) (f 25) (f 26) (f 28)) - (compressionActorFulfillmentFormula (f 21) (f 0) (f 6) (f 1) (f 7) - (f 3) (f 13) (f 18) (f 19) (f 22) (f 27) (f 20) (f 28))))))) - -theorem truth_mainSuccessorOutputFormula {n} (f : Fin 30 → Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (mainSuccessorOutputFormula f) env ↔ MainSuccessorOutputCode (fun j => env (f j)) := by - simp only [mainSuccessorOutputFormula, Truth, truth_mainTransitionLawsFormula, - truth_strictSuccessorTopFormula, truth_separationFulfillmentFormula, - truth_rectangleFulfillmentFormula, truth_oldProfilePreservationFormula, - truth_taskCapFamilyFormula, truth_compressionActorFulfillmentFormula] - exact ⟨fun ⟨t, g, s, r, p, c, a⟩ => ⟨t, g, s, r, p, c, a⟩, - fun code => ⟨code.transition, code.strict_top, code.separation, code.rectangles, - code.old_profiles, code.task_caps, code.compression_actors⟩⟩ - -theorem realize_mainSuccessorOutputFormula (M : TransitiveGround.{u}) {n} - (f : Fin 30 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : - SetFormula.Realize M.sets (mainSuccessorOutputFormula f).toFormula env ↔ - MainSuccessorOutputCode (fun j => env (f j)) := - (realize_toFormula M _ env members).trans (truth_mainSuccessorOutputFormula f env) - -end BoundedFormula - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def MainSuccessorTaskBindingsCode (M : TransitiveGround.{u}) (Labels : ZFSet.{u}) - (f : Fin 30 → ZFSet.{u}) : Prop := - f 21 = M.groundEligibleTasks (f 0) (f 6) (f 2) (f 4) (f 12) Labels ∧ - f 22 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) - (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 0 ∧ - f 23 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) - (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 1 ∧ - f 24 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) - (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 3 ∧ - f 25 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) - (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 4 ∧ - f 26 = M.groundPower (f 0) ∧ - TaskRepresentativesCode (f 27) - (M.groundEligibleTasks (f 0) (f 6) (f 2) (f 4) (f 12) Labels) - (f 0) (f 6) (f 2) (f 12) (M.groundRelations (f 0) (f 0)) - (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels - -namespace SetFormula - -def mainSuccessorTaskBindingsFormula {n} (Labels : Fin n) (f : Fin 30 → Fin n) : SetFormula n := - .conj (groundEligibleTasksFormula (f 21) (f 0) (f 6) (f 2) (f 4) (f 12) Labels) - (.conj (groundLiteralTaskFieldFormula 0 (f 22) (f 21) (f 0) (f 2) (f 4) Labels) - (.conj (groundLiteralTaskFieldFormula 1 (f 23) (f 21) (f 0) (f 2) (f 4) Labels) - (.conj (groundLiteralTaskFieldFormula 3 (f 24) (f 21) (f 0) (f 2) (f 4) Labels) - (.conj (groundLiteralTaskFieldFormula 4 (f 25) (f 21) (f 0) (f 2) (f 4) Labels) - (.conj (relativePowerFormula (f 0) (f 26)) - (groundTaskRepresentativesFormula (f 27) (f 0) (f 6) (f 2) (f 4) (f 12) Labels)))))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainSuccessorTaskBindingsFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {n} (Labels : Fin n) (f : Fin 30 → Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ j, env j ∈ M.sets) (meet : MeetOrderCode (env (f 0)) (env (f 2)) (env (f 4))) : - Realize M.sets (mainSuccessorTaskBindingsFormula Labels f) env ↔ - MainSuccessorTaskBindingsCode M (env Labels) (fun j => env (f j)) := - (M.realize_groundEligibleTasksFormula pairing unions powers separation - (f 21) (f 0) (f 6) (f 2) (f 4) (f 12) Labels env members meet).and - ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation - 0 (f 22) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and - ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation - 1 (f 23) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and - ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation - 3 (f 24) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and - ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation - 4 (f 25) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and - ((M.realize_relativePowerFormula (f 0) (f 26) env members).and - (M.realize_groundTaskRepresentativesFormula pairing unions powers separation - (f 27) (f 0) (f 6) (f 2) (f 4) (f 12) Labels env members meet)))))) - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -include certificate pairing unions powers separation infinite - -theorem oldProfilePreservation (Filters : ZFSet.{u}) : - OldProfilePreservationCode source.stage.carrier source.stage.order source.stage.meetGraph - certificate.target.stage.carrier certificate.target.stage.order certificate.target.stage.meetGraph - certificate.transition.map.points Filters := by - intro F _ c _ e _ K _ profile c' _ e' _ K' _ imageC imageE imageK - exact certificate.capProfile_preserved pairing unions powers separation infinite - profile imageC imageE imageK - -theorem ground_capProfile_preserved - {c e K F c' e' K' : ZFSet.{u}} (hF : F ∈ M.sets) - (profile : CodedCapProfile source.stage.carrier source.stage.order source.stage.meetGraph c e K F) - (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) - (imageE : ZFSet.pair e e' ∈ certificate.transition.map.points) - (imageK : ZFSet.pair K K' ∈ certificate.transition.map.points) : - relationImage F certificate.target.stage.carrier certificate.transition.map.points ∈ M.sets ∧ - CodedCapProfile certificate.target.stage.carrier certificate.target.stage.order - certificate.target.stage.meetGraph c' e' K' - (relationImage F certificate.target.stage.carrier certificate.transition.map.points) := - ⟨M.relationImage_mem separation hF certificate.target.stage.carrier_ground - certificate.transition.map.points_ground, - certificate.capProfile_preserved pairing unions powers separation infinite profile imageC imageE imageK⟩ - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - - - -namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -theorem rectangle_fulfillment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) : - RectangleFulfillmentCode source.stage.carrier source.stage.actors source.stage.order - source.stage.meetGraph source.stage.action certificate.target.stage.carrier certificate.target.stage.actors - certificate.target.stage.order certificate.target.stage.meetGraph certificate.target.stage.action - certificate.transition.map.points certificate.transition.map.actors := by - obtain ⟨points, order, meet, actors, _, _, _, action, _⟩ := certificate.target_fields - rw [points, order, meet, actors, action, certificate.point_graph, certificate.actor_graph] - exact certificate.external.inputs.externalBounded_rectangle_fulfillment - source.stage.group_code source.stage.action_code pairing unions powers separation infinite - source.stage.actors_ground source.stage.carrier_ground - - - - - -noncomputable def successorOutputValues : Fin 30 → ZFSet.{u} := - extend (source.stage.carrier) - (extend (certificate.target.stage.carrier) - (extend (source.stage.order) - (extend (certificate.target.stage.order) - (extend (source.stage.meetGraph) - (extend (certificate.target.stage.meetGraph) - (extend (source.stage.actors) - (extend (certificate.target.stage.actors) - (extend (source.stage.multiplication) - (extend (certificate.target.stage.multiplication) - (extend (source.stage.identity) - (extend (certificate.target.stage.identity) - (extend (source.stage.action) - (extend (certificate.target.stage.action) - (extend (source.stage.bottom) - (extend (certificate.target.stage.bottom) - (extend (source.stage.height) - (extend (certificate.target.stage.height) - (extend (certificate.transition.map.points) - (extend (certificate.transition.map.actors) - (extend (source.stage.top) - (extend (source.stage.compressionTasks Labels) - (extend (source.stage.compressionSources Labels) - (extend (source.stage.compressionTargets Labels) - (extend (source.stage.compressionSeparators Labels) - (extend (source.stage.compressionFilters Labels) - (extend (M.groundPower source.stage.carrier) - (extend (certificate.Reps) - (extend (certificate.compressionCapImages) - (extend (certificate.target.stage.top) - (Fin.elim0)))))))))))))))))))))))))))))) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) -include pairing unions powers separation infinite hLabels - -theorem successorOutputValues_ground : ∀ j, certificate.successorOutputValues j ∈ M.sets := by - obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation - source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground - source.stage.meet_ground source.stage.action_ground hLabels source.stage.meet - exact Fin.cases (source.stage.carrier_ground) - (Fin.cases (certificate.target.stage.carrier_ground) - (Fin.cases (source.stage.order_ground) - (Fin.cases (certificate.target.stage.order_ground) - (Fin.cases (source.stage.meet_ground) - (Fin.cases (certificate.target.stage.meet_ground) - (Fin.cases (source.stage.actors_ground) - (Fin.cases (certificate.target.stage.actors_ground) - (Fin.cases (source.stage.multiplication_ground) - (Fin.cases (certificate.target.stage.multiplication_ground) - (Fin.cases (source.stage.identity_ground) - (Fin.cases (certificate.target.stage.identity_ground) - (Fin.cases (source.stage.action_ground) - (Fin.cases (certificate.target.stage.action_ground) - (Fin.cases (source.stage.bottom_ground) - (Fin.cases (certificate.target.stage.bottom_ground) - (Fin.cases (source.stage.height_ground) - (Fin.cases (certificate.target.stage.height_ground) - (Fin.cases (certificate.transition.map.points_ground) - (Fin.cases (certificate.transition.map.actors_ground) - (Fin.cases (source.stage.top_ground) - (Fin.cases (certificate.indices_ground) - (Fin.cases (certificate.sources_ground) - (Fin.cases ((fields 1).1) - (Fin.cases ((fields 3).1) - (Fin.cases (certificate.filters_ground) - (Fin.cases (M.groundPower_mem powers source.stage.carrier_ground) - (Fin.cases (certificate.representatives_ground) - (Fin.cases (certificate.compressionCapImages_ground pairing unions powers separation infinite) - (Fin.cases (certificate.target.stage.top_ground) - ((fun j => Fin.elim0 j))))))))))))))))))))))))))))))) - -theorem successorOutput : MainSuccessorOutputCode certificate.successorOutputValues := by - refine ⟨certificate.transition.map.laws, ?_, - certificate.separation_fulfillment pairing unions powers separation infinite, - certificate.rectangle_fulfillment pairing unions powers separation infinite, - certificate.oldProfilePreservation pairing unions powers separation infinite (M.groundPower source.stage.carrier), - certificate.taskCapFamily pairing unions powers separation infinite hLabels, - certificate.compressionActorFulfillment pairing unions powers separation infinite⟩ - intro x _ y _ image - exact certificate.strict_new_top x y image - -theorem realize_successorOutput : - Realize M.sets (BoundedFormula.mainSuccessorOutputFormula (fun j => j)).toFormula - certificate.successorOutputValues := - (BoundedFormula.realize_mainSuccessorOutputFormula M (fun j => j) - certificate.successorOutputValues - (certificate.successorOutputValues_ground pairing unions powers separation infinite hLabels)).2 - (certificate.successorOutput pairing unions powers separation infinite hLabels) - -end PartitionPilot.Forcing.GroundInitialMainSuccessorData - - - -namespace PartitionPilot.Forcing -universe u - -namespace GroundLinkedMainStage -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable (linked : GroundLinkedMainStage M K Labels C D rD) - -theorem rawFields_stage_projections : - linked.rawFields 0 = linked.main.stage.carrier ∧ - linked.rawFields 1 = linked.main.stage.order ∧ - linked.rawFields 2 = linked.main.stage.meetGraph ∧ - linked.rawFields 3 = linked.main.stage.actors ∧ - linked.rawFields 4 = linked.main.stage.multiplication ∧ - linked.rawFields 5 = linked.main.stage.inverse ∧ - linked.rawFields 6 = linked.main.stage.identity ∧ - linked.rawFields 7 = linked.main.stage.action ∧ - linked.rawFields 8 = linked.main.stage.bottom ∧ - linked.rawFields 9 = linked.main.stage.top ∧ - linked.rawFields 10 = linked.main.stage.height := - ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ - -end GroundLinkedMainStage - -namespace GroundInitialMainSuccessorData -variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} -variable {source : GroundChronologicalMainStage M C D rD} -variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) - -theorem successorOutputValues_projections : - certificate.successorOutputValues 0 = source.stage.carrier ∧ - certificate.successorOutputValues 1 = certificate.target.stage.carrier ∧ - certificate.successorOutputValues 2 = source.stage.order ∧ - certificate.successorOutputValues 3 = certificate.target.stage.order ∧ - certificate.successorOutputValues 4 = source.stage.meetGraph ∧ - certificate.successorOutputValues 5 = certificate.target.stage.meetGraph ∧ - certificate.successorOutputValues 6 = source.stage.actors ∧ - certificate.successorOutputValues 7 = certificate.target.stage.actors ∧ - certificate.successorOutputValues 8 = source.stage.multiplication ∧ - certificate.successorOutputValues 9 = certificate.target.stage.multiplication ∧ - certificate.successorOutputValues 10 = source.stage.identity ∧ - certificate.successorOutputValues 11 = certificate.target.stage.identity ∧ - certificate.successorOutputValues 12 = source.stage.action ∧ - certificate.successorOutputValues 13 = certificate.target.stage.action ∧ - certificate.successorOutputValues 14 = source.stage.bottom ∧ - certificate.successorOutputValues 15 = certificate.target.stage.bottom ∧ - certificate.successorOutputValues 16 = source.stage.height ∧ - certificate.successorOutputValues 17 = certificate.target.stage.height ∧ - certificate.successorOutputValues 18 = certificate.transition.map.points ∧ - certificate.successorOutputValues 19 = certificate.transition.map.actors ∧ - certificate.successorOutputValues 20 = source.stage.top ∧ - certificate.successorOutputValues 21 = source.stage.compressionTasks Labels ∧ - certificate.successorOutputValues 22 = source.stage.compressionSources Labels ∧ - certificate.successorOutputValues 23 = source.stage.compressionTargets Labels ∧ - certificate.successorOutputValues 24 = source.stage.compressionSeparators Labels ∧ - certificate.successorOutputValues 25 = source.stage.compressionFilters Labels ∧ - certificate.successorOutputValues 26 = M.groundPower source.stage.carrier ∧ - certificate.successorOutputValues 27 = certificate.Reps ∧ - certificate.successorOutputValues 28 = certificate.compressionCapImages ∧ - certificate.successorOutputValues 29 = certificate.target.stage.top := - ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ - -end GroundInitialMainSuccessorData -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u v w - -def linkedSuccessorOutputFields {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : Fin 30 → A := - Fin.cases (s 0) (Fin.cases (t 0) (Fin.cases (s 1) (Fin.cases (t 1) (Fin.cases (s 2) (Fin.cases (t 2) (Fin.cases (s 3) (Fin.cases (t 3) (Fin.cases (s 4) (Fin.cases (t 4) (Fin.cases (s 6) (Fin.cases (t 6) (Fin.cases (s 7) (Fin.cases (t 7) (Fin.cases (s 8) (Fin.cases (t 8) (Fin.cases (s 10) (Fin.cases (t 10) (Fin.cases (points) (Fin.cases (actors) (Fin.cases (s 9) (Fin.cases (extra 0) (Fin.cases (extra 1) (Fin.cases (extra 2) (Fin.cases (extra 3) (Fin.cases (extra 4) (Fin.cases (extra 5) (Fin.cases (extra 6) (Fin.cases (extra 7) ((fun _ => t 9)))))))))))))))))))))))))))))) - -theorem linkedSuccessorOutputFields_map {A : Type v} {B : Type w} - (map : A → B) (s t : Fin 24 → A) (points actors : A) (extra : Fin 8 → A) : - (fun j => map (linkedSuccessorOutputFields s t points actors extra j)) = - linkedSuccessorOutputFields (fun j => map (s j)) (fun j => map (t j)) - (map points) (map actors) (fun j => map (extra j)) := by - funext j - exact Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) ((fun k => Fin.elim0 k))))))))))))))))))))))))))))))) j - -def TaskBearingMainSuccessorRawCode (M : TransitiveGround.{u}) - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u}) - (source target : Fin 24 → ZFSet.{u}) (extra : Fin 8 → ZFSet.{u}) : Prop := - LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors - sourceBirth targetBirth source target ∧ - source 11 ∈ target 11 ∧ - MainSuccessorOutputCode (linkedSuccessorOutputFields source target points actors extra) ∧ - MainSuccessorTaskBindingsCode M Labels (linkedSuccessorOutputFields source target points actors extra) - -namespace SetFormula - -def taskBearingMainSuccessorRawFormula {n} - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) - (source target : Fin 24 → Fin n) (extra : Fin 8 → Fin n) : SetFormula n := - .conj (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z - points actors sourceBirth targetBirth source target) - (.conj (.mem (source 11) (target 11)) - (.conj (BoundedFormula.mainSuccessorOutputFormula - (linkedSuccessorOutputFields source target points actors extra)).toFormula - (mainSuccessorTaskBindingsFormula Labels - (linkedSuccessorOutputFields source target points actors extra)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_taskBearingMainSuccessorRawFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} - (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) - (source target : Fin 24 → Fin n) (extra : Fin 8 → Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (taskBearingMainSuccessorRawFormula K Labels C D rD N - sourceCode targetCode z points actors sourceBirth targetBirth source target extra) env ↔ - TaskBearingMainSuccessorRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env sourceCode) (env targetCode) (env z) (env points) (env actors) - (env sourceBirth) (env targetBirth) (fun j => env (source j)) - (fun j => env (target j)) (fun j => env (extra j)) := by - have links := M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection - K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth - source target env members omega ordinal - have outputs := BoundedFormula.realize_mainSuccessorOutputFormula M - (linkedSuccessorOutputFields source target points actors extra) env members - rw [linkedSuccessorOutputFields_map] at outputs - change (Realize M.sets (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z - points actors sourceBirth targetBirth source target) env ∧ - env (source 11) ∈ env (target 11) ∧ - Realize M.sets (BoundedFormula.mainSuccessorOutputFormula - (linkedSuccessorOutputFields source target points actors extra)).toFormula env ∧ - Realize M.sets (mainSuccessorTaskBindingsFormula Labels - (linkedSuccessorOutputFields source target points actors extra)) env) ↔ _ - rw [links, outputs] - have bindings (raw : LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) - (env N) (env sourceCode) (env targetCode) (env z) (env points) (env actors) - (env sourceBirth) (env targetBirth) (fun j => env (source j)) (fun j => env (target j))) : - Realize M.sets (mainSuccessorTaskBindingsFormula Labels - (linkedSuccessorOutputFields source target points actors extra)) env ↔ - MainSuccessorTaskBindingsCode M (env Labels) - (linkedSuccessorOutputFields (fun j => env (source j)) (fun j => env (target j)) - (env points) (env actors) (fun j => env (extra j))) := by - have recognized := M.realize_mainSuccessorTaskBindingsFormula pairing unions powers separation - Labels (linkedSuccessorOutputFields source target points actors extra) env members - raw.1.2.2.1.1.meet - rwa [linkedSuccessorOutputFields_map] at recognized - exact ⟨fun ⟨raw, cutoff, out, bound⟩ => ⟨raw, cutoff, out, (bindings raw).1 bound⟩, - fun ⟨raw, cutoff, out, bound⟩ => ⟨raw, cutoff, out, (bindings raw).2 bound⟩⟩ - -end TransitiveGround - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -def TaskBearingMainSuccessorCode (M : TransitiveGround.{u}) - (K Labels C D rD N sourceCode targetCode z : ZFSet.{u}) : Prop := - ∃ fields : Fin 60 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ - TaskBearingMainSuccessorRawCode M K Labels C D rD N sourceCode targetCode z - (fields 48) (fields 49) (fields 50) (fields 51) - (fun j => fields (j.castAdd 36)) - (fun j => fields (Fin.natAdd 24 (j.castAdd 12))) - (fun j => fields (Fin.natAdd 52 j)) - -namespace SetFormula - -def taskBearingMainSuccessorFormula {n} - (K Labels C D rD N sourceCode targetCode z : Fin n) : SetFormula n := - let old := suffixIndex n 60 - let fresh := prefixIndex n 60 - exBlock 60 (taskBearingMainSuccessorRawFormula (old K) (old Labels) (old C) (old D) - (old rD) (old N) (old sourceCode) (old targetCode) (old z) - (fresh 48) (fresh 49) (fresh 50) (fresh 51) - (fun j => fresh (j.castAdd 36)) - (fun j => fresh (Fin.natAdd 24 (j.castAdd 12))) - (fun j => fresh (Fin.natAdd 52 j))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_taskBearingMainSuccessorFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} - (K Labels C D rD N sourceCode targetCode z : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (taskBearingMainSuccessorFormula K Labels C D rD N sourceCode targetCode z) env ↔ - TaskBearingMainSuccessorCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) - (env sourceCode) (env targetCode) (env z) := by - rw [taskBearingMainSuccessorFormula, realize_exBlock] - have actual (fields : Fin 60 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := - M.realize_taskBearingMainSuccessorRawFormula pairing unions powers separation collection - (suffixIndex n 60 K) (suffixIndex n 60 Labels) (suffixIndex n 60 C) (suffixIndex n 60 D) - (suffixIndex n 60 rD) (suffixIndex n 60 N) (suffixIndex n 60 sourceCode) - (suffixIndex n 60 targetCode) (suffixIndex n 60 z) - (prefixIndex n 60 48) (prefixIndex n 60 49) (prefixIndex n 60 50) (prefixIndex n 60 51) - (fun j => prefixIndex n 60 (j.castAdd 36)) - (fun j => prefixIndex n 60 (Fin.natAdd 24 (j.castAdd 12))) - (fun j => prefixIndex n 60 (Fin.natAdd 52 j)) - (extendMany 60 fields env) (extendMany_members 60 fields env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal) - simp only [extendMany_prefix, extendMany_suffix] at actual - exact ⟨fun ⟨fields, ground, recognized⟩ => ⟨fields, ground, (actual fields ground).1 recognized⟩, - fun ⟨fields, ground, raw⟩ => ⟨fields, ground, (actual fields ground).2 raw⟩⟩ - -end TransitiveGround - -namespace TaskBearingMainSuccessorCode -variable {M : TransitiveGround.{u}} {K Labels C D rD N sourceCode targetCode z : ZFSet.{u}} - -theorem linked_transition - (code : TaskBearingMainSuccessorCode M K Labels C D rD N sourceCode targetCode z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) : - LinkedMainTransitionCode M K Labels C D rD sourceCode targetCode z := by - obtain ⟨fields, ground, raw⟩ := code - exact raw.1.exists_transition pairing unions powers separation - (fun j => ground (j.castAdd 36)) (fun j => ground (Fin.natAdd 24 (j.castAdd 12))) - (ground 48) (ground 49) hC hD hrD omega - -end TaskBearingMainSuccessorCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TaskBearingMainSuccessorCode -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {source target : GroundLinkedMainStage M K Labels C D rD} -variable {transition : GroundChronologicalMainTransition source.main target.main} - -theorem output_on_linked - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) : - ∃ extra : Fin 8 → ZFSet.{u}, (∀ j, extra j ∈ M.sets) ∧ - MainSuccessorOutputCode (linkedSuccessorOutputFields source.rawFields target.rawFields - transition.map.points transition.map.actors extra) ∧ - MainSuccessorTaskBindingsCode M Labels (linkedSuccessorOutputFields source.rawFields target.rawFields - transition.map.points transition.map.actors extra) := by - obtain ⟨fields, ground, raw⟩ := code - have sourceEq := source.rawFields_code.fields_unique raw.1.1 - have targetEq := target.rawFields_code.fields_unique raw.1.2.1 - have pairEq : ZFSet.pair transition.map.points transition.map.actors = - ZFSet.pair (fields 48) (fields 49) := raw.1.2.2.2.2.1.1 - have maps := ZFSet.pair_inj.1 pairEq - have output := raw.2.2.1 - have bindings := raw.2.2.2 - rw [← sourceEq, ← targetEq, ← maps.1, ← maps.2] at output bindings - exact ⟨(fun j => fields (Fin.natAdd 52 j)), - (fun j => ground (Fin.natAdd 52 j)), output, bindings⟩ - -theorem old_profiles_on_linked - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code) : - OldProfilePreservationCode source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph - target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph - transition.map.points (M.groundPower source.main.stage.carrier) := by - obtain ⟨extra, _, output, bindings⟩ := code.output_on_linked - have families := bindings.2.2.2.2.2.1 - have preservation := output.old_profiles - rw [families] at preservation - exact preservation - -end PartitionPilot.Forcing.TaskBearingMainSuccessorCode - - - -namespace PartitionPilot.Forcing.TaskBearingMainSuccessorCode -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD targetCode z : ZFSet.{u}} -variable {source : GroundLinkedMainStage M K Labels C D rD} - -theorem exists_from_linked - (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source.code targetCode z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : - ∃ target : GroundLinkedMainStage M K Labels C D rD, target.code = targetCode ∧ - ∃ transition : GroundChronologicalMainTransition source.main target.main, - transition.map.code = z ∧ transition.CoversOldBirths ∧ - OldProfilePreservationCode source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph - target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph - transition.map.points (M.groundPower source.main.stage.carrier) := by - obtain ⟨first, target, sourceEqual, targetEqual, decoded, mapEqual, covered⟩ := - code.linked_transition pairing unions powers separation source.main.stage.columns_ground - source.main.stage.coordinates_ground source.main.stage.coordinate_order_ground rfl - let transition := decoded.retargetLinked sourceEqual (rfl : target.code = target.code) - have exactMap : transition.map.code = z := - (decoded.retargetLinked_code sourceEqual rfl).trans mapEqual - have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega - source.code target.code transition.map.code := by - rw [targetEqual, exactMap] - exact code - exact ⟨target, targetEqual, transition, exactMap, - decoded.retargetLinked_coversOldBirths sourceEqual rfl covered, - actual.old_profiles_on_linked⟩ - -end PartitionPilot.Forcing.TaskBearingMainSuccessorCode - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundExternalRectangleFulfillment +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedTransitionRetarget +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainCompressionActorCode + +namespace OAI + + +namespace PartitionPilot.Forcing +universe u + +def StrictSuccessorTopCode (P Q R e top : ZFSet.{u}) : Prop := + ∀ x ∈ P, ∀ y ∈ Q, ZFSet.pair x y ∈ e → + ZFSet.pair y top ∈ R ∧ ZFSet.pair top y ∉ R + +namespace BoundedFormula + +def strictSuccessorTopFormula {n} (P Q R e top : Fin n) : BoundedFormula n := + .allMem P (.allMem Q.succ (imp (pairMembershipFormula 1 0 e.succ.succ) + (.conj (pairMembershipFormula 0 top.succ.succ R.succ.succ) + (.neg (pairMembershipFormula top.succ.succ 0 R.succ.succ))))) + +theorem truth_strictSuccessorTopFormula {n} (P Q R e top : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (strictSuccessorTopFormula P Q R e top) env ↔ + StrictSuccessorTopCode (env P) (env Q) (env R) (env e) (env top) := by + simp only [strictSuccessorTopFormula, Truth, truth_imp, truth_pairMembershipFormula] + rfl + +theorem realize_strictSuccessorTopFormula (M : TransitiveGround.{u}) {n} + (P Q R e top : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + SetFormula.Realize M.sets (strictSuccessorTopFormula P Q R e top).toFormula env ↔ + StrictSuccessorTopCode (env P) (env Q) (env R) (env e) (env top) := + (realize_toFormula M _ env members).trans (truth_strictSuccessorTopFormula P Q R e top env) + +end BoundedFormula + + + + + +structure MainSuccessorOutputCode (f : Fin 30 → ZFSet.{u}) : Prop where + transition : MainTransitionLaws (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) + (f 8) (f 9) (f 10) (f 11) (f 12) (f 13) (f 14) (f 15) (f 16) (f 17) (f 18) (f 19) + strict_top : StrictSuccessorTopCode (f 0) (f 1) (f 3) (f 18) (f 29) + separation : SeparationFulfillmentCode (f 0) (f 2) (f 1) (f 3) (f 5) (f 7) (f 13) (f 18) + rectangles : RectangleFulfillmentCode (f 0) (f 6) (f 2) (f 4) (f 12) + (f 1) (f 7) (f 3) (f 5) (f 13) (f 18) (f 19) + old_profiles : OldProfilePreservationCode (f 0) (f 2) (f 4) (f 1) (f 3) (f 5) (f 18) (f 26) + task_caps : TaskCapFamilyCode (f 21) (f 0) (f 1) (f 3) (f 5) (f 18) + (f 23) (f 24) (f 25) (f 26) (f 28) + compression_actors : CompressionActorFulfillmentCode (f 21) (f 0) (f 6) (f 1) (f 7) + (f 3) (f 13) (f 18) (f 19) (f 22) (f 27) (f 20) (f 28) + +namespace BoundedFormula + +def mainSuccessorOutputFormula {n} (f : Fin 30 → Fin n) : BoundedFormula n := + .conj (mainTransitionLawsFormula (f 0) (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) + (f 8) (f 9) (f 10) (f 11) (f 12) (f 13) (f 14) (f 15) (f 16) (f 17) (f 18) (f 19)) + (.conj (strictSuccessorTopFormula (f 0) (f 1) (f 3) (f 18) (f 29)) + (.conj (separationFulfillmentFormula (f 0) (f 2) (f 1) (f 3) (f 5) (f 7) (f 13) (f 18)) + (.conj (rectangleFulfillmentFormula (f 0) (f 6) (f 2) (f 4) (f 12) + (f 1) (f 7) (f 3) (f 5) (f 13) (f 18) (f 19)) + (.conj (oldProfilePreservationFormula (f 0) (f 2) (f 4) (f 1) (f 3) (f 5) (f 18) (f 26)) + (.conj (taskCapFamilyFormula (f 21) (f 0) (f 1) (f 3) (f 5) (f 18) + (f 23) (f 24) (f 25) (f 26) (f 28)) + (compressionActorFulfillmentFormula (f 21) (f 0) (f 6) (f 1) (f 7) + (f 3) (f 13) (f 18) (f 19) (f 22) (f 27) (f 20) (f 28))))))) + +theorem truth_mainSuccessorOutputFormula {n} (f : Fin 30 → Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (mainSuccessorOutputFormula f) env ↔ MainSuccessorOutputCode (fun j => env (f j)) := by + simp only [mainSuccessorOutputFormula, Truth, truth_mainTransitionLawsFormula, + truth_strictSuccessorTopFormula, truth_separationFulfillmentFormula, + truth_rectangleFulfillmentFormula, truth_oldProfilePreservationFormula, + truth_taskCapFamilyFormula, truth_compressionActorFulfillmentFormula] + exact ⟨fun ⟨t, g, s, r, p, c, a⟩ => ⟨t, g, s, r, p, c, a⟩, + fun code => ⟨code.transition, code.strict_top, code.separation, code.rectangles, + code.old_profiles, code.task_caps, code.compression_actors⟩⟩ + +theorem realize_mainSuccessorOutputFormula (M : TransitiveGround.{u}) {n} + (f : Fin 30 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) : + SetFormula.Realize M.sets (mainSuccessorOutputFormula f).toFormula env ↔ + MainSuccessorOutputCode (fun j => env (f j)) := + (realize_toFormula M _ env members).trans (truth_mainSuccessorOutputFormula f env) + +end BoundedFormula + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def MainSuccessorTaskBindingsCode (M : TransitiveGround.{u}) (Labels : ZFSet.{u}) + (f : Fin 30 → ZFSet.{u}) : Prop := + f 21 = M.groundEligibleTasks (f 0) (f 6) (f 2) (f 4) (f 12) Labels ∧ + f 22 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) + (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 0 ∧ + f 23 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) + (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 1 ∧ + f 24 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) + (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 3 ∧ + f 25 = literalTaskFieldGraph (f 21) (f 0) (M.groundRelations (f 0) (f 0)) + (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels 4 ∧ + f 26 = M.groundPower (f 0) ∧ + TaskRepresentativesCode (f 27) + (M.groundEligibleTasks (f 0) (f 6) (f 2) (f 4) (f 12) Labels) + (f 0) (f 6) (f 2) (f 12) (M.groundRelations (f 0) (f 0)) + (M.groundMeetFilters (f 0) (f 2) (f 4)) Labels + +namespace SetFormula + +def mainSuccessorTaskBindingsFormula {n} (Labels : Fin n) (f : Fin 30 → Fin n) : SetFormula n := + .conj (groundEligibleTasksFormula (f 21) (f 0) (f 6) (f 2) (f 4) (f 12) Labels) + (.conj (groundLiteralTaskFieldFormula 0 (f 22) (f 21) (f 0) (f 2) (f 4) Labels) + (.conj (groundLiteralTaskFieldFormula 1 (f 23) (f 21) (f 0) (f 2) (f 4) Labels) + (.conj (groundLiteralTaskFieldFormula 3 (f 24) (f 21) (f 0) (f 2) (f 4) Labels) + (.conj (groundLiteralTaskFieldFormula 4 (f 25) (f 21) (f 0) (f 2) (f 4) Labels) + (.conj (relativePowerFormula (f 0) (f 26)) + (groundTaskRepresentativesFormula (f 27) (f 0) (f 6) (f 2) (f 4) (f 12) Labels)))))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainSuccessorTaskBindingsFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {n} (Labels : Fin n) (f : Fin 30 → Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ j, env j ∈ M.sets) (meet : MeetOrderCode (env (f 0)) (env (f 2)) (env (f 4))) : + Realize M.sets (mainSuccessorTaskBindingsFormula Labels f) env ↔ + MainSuccessorTaskBindingsCode M (env Labels) (fun j => env (f j)) := + (M.realize_groundEligibleTasksFormula pairing unions powers separation + (f 21) (f 0) (f 6) (f 2) (f 4) (f 12) Labels env members meet).and + ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation + 0 (f 22) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and + ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation + 1 (f 23) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and + ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation + 3 (f 24) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and + ((M.realize_groundLiteralTaskFieldFormula pairing unions powers separation + 4 (f 25) (f 21) (f 0) (f 2) (f 4) Labels env members meet).and + ((M.realize_relativePowerFormula (f 0) (f 26) env members).and + (M.realize_groundTaskRepresentativesFormula pairing unions powers separation + (f 27) (f 0) (f 6) (f 2) (f 4) (f 12) Labels env members meet)))))) + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +include certificate pairing unions powers separation infinite + +theorem oldProfilePreservation (Filters : ZFSet.{u}) : + OldProfilePreservationCode source.stage.carrier source.stage.order source.stage.meetGraph + certificate.target.stage.carrier certificate.target.stage.order certificate.target.stage.meetGraph + certificate.transition.map.points Filters := by + intro F _ c _ e _ K _ profile c' _ e' _ K' _ imageC imageE imageK + exact certificate.capProfile_preserved pairing unions powers separation infinite + profile imageC imageE imageK + +theorem ground_capProfile_preserved + {c e K F c' e' K' : ZFSet.{u}} (hF : F ∈ M.sets) + (profile : CodedCapProfile source.stage.carrier source.stage.order source.stage.meetGraph c e K F) + (imageC : ZFSet.pair c c' ∈ certificate.transition.map.points) + (imageE : ZFSet.pair e e' ∈ certificate.transition.map.points) + (imageK : ZFSet.pair K K' ∈ certificate.transition.map.points) : + relationImage F certificate.target.stage.carrier certificate.transition.map.points ∈ M.sets ∧ + CodedCapProfile certificate.target.stage.carrier certificate.target.stage.order + certificate.target.stage.meetGraph c' e' K' + (relationImage F certificate.target.stage.carrier certificate.transition.map.points) := + ⟨M.relationImage_mem separation hF certificate.target.stage.carrier_ground + certificate.transition.map.points_ground, + certificate.capProfile_preserved pairing unions powers separation infinite profile imageC imageE imageK⟩ + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + + + +namespace PartitionPilot.Forcing.GroundInitialMainSuccessorData +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +theorem rectangle_fulfillment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) : + RectangleFulfillmentCode source.stage.carrier source.stage.actors source.stage.order + source.stage.meetGraph source.stage.action certificate.target.stage.carrier certificate.target.stage.actors + certificate.target.stage.order certificate.target.stage.meetGraph certificate.target.stage.action + certificate.transition.map.points certificate.transition.map.actors := by + obtain ⟨points, order, meet, actors, _, _, _, action, _⟩ := certificate.target_fields + rw [points, order, meet, actors, action, certificate.point_graph, certificate.actor_graph] + exact certificate.external.inputs.externalBounded_rectangle_fulfillment + source.stage.group_code source.stage.action_code pairing unions powers separation infinite + source.stage.actors_ground source.stage.carrier_ground + + + + + +noncomputable def successorOutputValues : Fin 30 → ZFSet.{u} := + extend (source.stage.carrier) + (extend (certificate.target.stage.carrier) + (extend (source.stage.order) + (extend (certificate.target.stage.order) + (extend (source.stage.meetGraph) + (extend (certificate.target.stage.meetGraph) + (extend (source.stage.actors) + (extend (certificate.target.stage.actors) + (extend (source.stage.multiplication) + (extend (certificate.target.stage.multiplication) + (extend (source.stage.identity) + (extend (certificate.target.stage.identity) + (extend (source.stage.action) + (extend (certificate.target.stage.action) + (extend (source.stage.bottom) + (extend (certificate.target.stage.bottom) + (extend (source.stage.height) + (extend (certificate.target.stage.height) + (extend (certificate.transition.map.points) + (extend (certificate.transition.map.actors) + (extend (source.stage.top) + (extend (source.stage.compressionTasks Labels) + (extend (source.stage.compressionSources Labels) + (extend (source.stage.compressionTargets Labels) + (extend (source.stage.compressionSeparators Labels) + (extend (source.stage.compressionFilters Labels) + (extend (M.groundPower source.stage.carrier) + (extend (certificate.Reps) + (extend (certificate.compressionCapImages) + (extend (certificate.target.stage.top) + (Fin.elim0)))))))))))))))))))))))))))))) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (hLabels : Labels ∈ M.sets) +include pairing unions powers separation infinite hLabels + +theorem successorOutputValues_ground : ∀ j, certificate.successorOutputValues j ∈ M.sets := by + obtain ⟨_, _, _, _, fields⟩ := M.groundEligibleTaskFields pairing unions powers separation + source.stage.carrier_ground source.stage.actors_ground source.stage.order_ground + source.stage.meet_ground source.stage.action_ground hLabels source.stage.meet + exact Fin.cases (source.stage.carrier_ground) + (Fin.cases (certificate.target.stage.carrier_ground) + (Fin.cases (source.stage.order_ground) + (Fin.cases (certificate.target.stage.order_ground) + (Fin.cases (source.stage.meet_ground) + (Fin.cases (certificate.target.stage.meet_ground) + (Fin.cases (source.stage.actors_ground) + (Fin.cases (certificate.target.stage.actors_ground) + (Fin.cases (source.stage.multiplication_ground) + (Fin.cases (certificate.target.stage.multiplication_ground) + (Fin.cases (source.stage.identity_ground) + (Fin.cases (certificate.target.stage.identity_ground) + (Fin.cases (source.stage.action_ground) + (Fin.cases (certificate.target.stage.action_ground) + (Fin.cases (source.stage.bottom_ground) + (Fin.cases (certificate.target.stage.bottom_ground) + (Fin.cases (source.stage.height_ground) + (Fin.cases (certificate.target.stage.height_ground) + (Fin.cases (certificate.transition.map.points_ground) + (Fin.cases (certificate.transition.map.actors_ground) + (Fin.cases (source.stage.top_ground) + (Fin.cases (certificate.indices_ground) + (Fin.cases (certificate.sources_ground) + (Fin.cases ((fields 1).1) + (Fin.cases ((fields 3).1) + (Fin.cases (certificate.filters_ground) + (Fin.cases (M.groundPower_mem powers source.stage.carrier_ground) + (Fin.cases (certificate.representatives_ground) + (Fin.cases (certificate.compressionCapImages_ground pairing unions powers separation infinite) + (Fin.cases (certificate.target.stage.top_ground) + ((fun j => Fin.elim0 j))))))))))))))))))))))))))))))) + +theorem successorOutput : MainSuccessorOutputCode certificate.successorOutputValues := by + refine ⟨certificate.transition.map.laws, ?_, + certificate.separation_fulfillment pairing unions powers separation infinite, + certificate.rectangle_fulfillment pairing unions powers separation infinite, + certificate.oldProfilePreservation pairing unions powers separation infinite (M.groundPower source.stage.carrier), + certificate.taskCapFamily pairing unions powers separation infinite hLabels, + certificate.compressionActorFulfillment pairing unions powers separation infinite⟩ + intro x _ y _ image + exact certificate.strict_new_top x y image + +theorem realize_successorOutput : + Realize M.sets (BoundedFormula.mainSuccessorOutputFormula (fun j => j)).toFormula + certificate.successorOutputValues := + (BoundedFormula.realize_mainSuccessorOutputFormula M (fun j => j) + certificate.successorOutputValues + (certificate.successorOutputValues_ground pairing unions powers separation infinite hLabels)).2 + (certificate.successorOutput pairing unions powers separation infinite hLabels) + +end PartitionPilot.Forcing.GroundInitialMainSuccessorData + + + +namespace PartitionPilot.Forcing +universe u + +namespace GroundLinkedMainStage +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable (linked : GroundLinkedMainStage M K Labels C D rD) + +theorem rawFields_stage_projections : + linked.rawFields 0 = linked.main.stage.carrier ∧ + linked.rawFields 1 = linked.main.stage.order ∧ + linked.rawFields 2 = linked.main.stage.meetGraph ∧ + linked.rawFields 3 = linked.main.stage.actors ∧ + linked.rawFields 4 = linked.main.stage.multiplication ∧ + linked.rawFields 5 = linked.main.stage.inverse ∧ + linked.rawFields 6 = linked.main.stage.identity ∧ + linked.rawFields 7 = linked.main.stage.action ∧ + linked.rawFields 8 = linked.main.stage.bottom ∧ + linked.rawFields 9 = linked.main.stage.top ∧ + linked.rawFields 10 = linked.main.stage.height := + ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ + +end GroundLinkedMainStage + +namespace GroundInitialMainSuccessorData +variable {M : TransitiveGround.{u}} {C D rD Labels : ZFSet.{u}} +variable {source : GroundChronologicalMainStage M C D rD} +variable (certificate : GroundInitialMainSuccessorData M C D rD source Labels) + +theorem successorOutputValues_projections : + certificate.successorOutputValues 0 = source.stage.carrier ∧ + certificate.successorOutputValues 1 = certificate.target.stage.carrier ∧ + certificate.successorOutputValues 2 = source.stage.order ∧ + certificate.successorOutputValues 3 = certificate.target.stage.order ∧ + certificate.successorOutputValues 4 = source.stage.meetGraph ∧ + certificate.successorOutputValues 5 = certificate.target.stage.meetGraph ∧ + certificate.successorOutputValues 6 = source.stage.actors ∧ + certificate.successorOutputValues 7 = certificate.target.stage.actors ∧ + certificate.successorOutputValues 8 = source.stage.multiplication ∧ + certificate.successorOutputValues 9 = certificate.target.stage.multiplication ∧ + certificate.successorOutputValues 10 = source.stage.identity ∧ + certificate.successorOutputValues 11 = certificate.target.stage.identity ∧ + certificate.successorOutputValues 12 = source.stage.action ∧ + certificate.successorOutputValues 13 = certificate.target.stage.action ∧ + certificate.successorOutputValues 14 = source.stage.bottom ∧ + certificate.successorOutputValues 15 = certificate.target.stage.bottom ∧ + certificate.successorOutputValues 16 = source.stage.height ∧ + certificate.successorOutputValues 17 = certificate.target.stage.height ∧ + certificate.successorOutputValues 18 = certificate.transition.map.points ∧ + certificate.successorOutputValues 19 = certificate.transition.map.actors ∧ + certificate.successorOutputValues 20 = source.stage.top ∧ + certificate.successorOutputValues 21 = source.stage.compressionTasks Labels ∧ + certificate.successorOutputValues 22 = source.stage.compressionSources Labels ∧ + certificate.successorOutputValues 23 = source.stage.compressionTargets Labels ∧ + certificate.successorOutputValues 24 = source.stage.compressionSeparators Labels ∧ + certificate.successorOutputValues 25 = source.stage.compressionFilters Labels ∧ + certificate.successorOutputValues 26 = M.groundPower source.stage.carrier ∧ + certificate.successorOutputValues 27 = certificate.Reps ∧ + certificate.successorOutputValues 28 = certificate.compressionCapImages ∧ + certificate.successorOutputValues 29 = certificate.target.stage.top := + ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ + +end GroundInitialMainSuccessorData +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u v w + +def linkedSuccessorOutputFields {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : Fin 30 → A := + Fin.cases (s 0) (Fin.cases (t 0) (Fin.cases (s 1) (Fin.cases (t 1) (Fin.cases (s 2) (Fin.cases (t 2) (Fin.cases (s 3) (Fin.cases (t 3) (Fin.cases (s 4) (Fin.cases (t 4) (Fin.cases (s 6) (Fin.cases (t 6) (Fin.cases (s 7) (Fin.cases (t 7) (Fin.cases (s 8) (Fin.cases (t 8) (Fin.cases (s 10) (Fin.cases (t 10) (Fin.cases (points) (Fin.cases (actors) (Fin.cases (s 9) (Fin.cases (extra 0) (Fin.cases (extra 1) (Fin.cases (extra 2) (Fin.cases (extra 3) (Fin.cases (extra 4) (Fin.cases (extra 5) (Fin.cases (extra 6) (Fin.cases (extra 7) ((fun _ => t 9)))))))))))))))))))))))))))))) + +theorem linkedSuccessorOutputFields_map {A : Type v} {B : Type w} + (map : A → B) (s t : Fin 24 → A) (points actors : A) (extra : Fin 8 → A) : + (fun j => map (linkedSuccessorOutputFields s t points actors extra j)) = + linkedSuccessorOutputFields (fun j => map (s j)) (fun j => map (t j)) + (map points) (map actors) (fun j => map (extra j)) := by + funext j + exact Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) (Fin.cases (rfl) ((fun k => Fin.elim0 k))))))))))))))))))))))))))))))) j + +def TaskBearingMainSuccessorRawCode (M : TransitiveGround.{u}) + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u}) + (source target : Fin 24 → ZFSet.{u}) (extra : Fin 8 → ZFSet.{u}) : Prop := + LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors + sourceBirth targetBirth source target ∧ + source 11 ∈ target 11 ∧ + MainSuccessorOutputCode (linkedSuccessorOutputFields source target points actors extra) ∧ + MainSuccessorTaskBindingsCode M Labels (linkedSuccessorOutputFields source target points actors extra) + +namespace SetFormula + +def taskBearingMainSuccessorRawFormula {n} + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) + (source target : Fin 24 → Fin n) (extra : Fin 8 → Fin n) : SetFormula n := + .conj (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z + points actors sourceBirth targetBirth source target) + (.conj (.mem (source 11) (target 11)) + (.conj (BoundedFormula.mainSuccessorOutputFormula + (linkedSuccessorOutputFields source target points actors extra)).toFormula + (mainSuccessorTaskBindingsFormula Labels + (linkedSuccessorOutputFields source target points actors extra)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_taskBearingMainSuccessorRawFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} + (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n) + (source target : Fin 24 → Fin n) (extra : Fin 8 → Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (taskBearingMainSuccessorRawFormula K Labels C D rD N + sourceCode targetCode z points actors sourceBirth targetBirth source target extra) env ↔ + TaskBearingMainSuccessorRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env sourceCode) (env targetCode) (env z) (env points) (env actors) + (env sourceBirth) (env targetBirth) (fun j => env (source j)) + (fun j => env (target j)) (fun j => env (extra j)) := by + have links := M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection + K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth + source target env members omega ordinal + have outputs := BoundedFormula.realize_mainSuccessorOutputFormula M + (linkedSuccessorOutputFields source target points actors extra) env members + rw [linkedSuccessorOutputFields_map] at outputs + change (Realize M.sets (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z + points actors sourceBirth targetBirth source target) env ∧ + env (source 11) ∈ env (target 11) ∧ + Realize M.sets (BoundedFormula.mainSuccessorOutputFormula + (linkedSuccessorOutputFields source target points actors extra)).toFormula env ∧ + Realize M.sets (mainSuccessorTaskBindingsFormula Labels + (linkedSuccessorOutputFields source target points actors extra)) env) ↔ _ + rw [links, outputs] + have bindings (raw : LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) + (env N) (env sourceCode) (env targetCode) (env z) (env points) (env actors) + (env sourceBirth) (env targetBirth) (fun j => env (source j)) (fun j => env (target j))) : + Realize M.sets (mainSuccessorTaskBindingsFormula Labels + (linkedSuccessorOutputFields source target points actors extra)) env ↔ + MainSuccessorTaskBindingsCode M (env Labels) + (linkedSuccessorOutputFields (fun j => env (source j)) (fun j => env (target j)) + (env points) (env actors) (fun j => env (extra j))) := by + have recognized := M.realize_mainSuccessorTaskBindingsFormula pairing unions powers separation + Labels (linkedSuccessorOutputFields source target points actors extra) env members + raw.1.2.2.1.1.meet + rwa [linkedSuccessorOutputFields_map] at recognized + exact ⟨fun ⟨raw, cutoff, out, bound⟩ => ⟨raw, cutoff, out, (bindings raw).1 bound⟩, + fun ⟨raw, cutoff, out, bound⟩ => ⟨raw, cutoff, out, (bindings raw).2 bound⟩⟩ + +end TransitiveGround + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +def TaskBearingMainSuccessorCode (M : TransitiveGround.{u}) + (K Labels C D rD N sourceCode targetCode z : ZFSet.{u}) : Prop := + ∃ fields : Fin 60 → ZFSet.{u}, (∀ j, fields j ∈ M.sets) ∧ + TaskBearingMainSuccessorRawCode M K Labels C D rD N sourceCode targetCode z + (fields 48) (fields 49) (fields 50) (fields 51) + (fun j => fields (j.castAdd 36)) + (fun j => fields (Fin.natAdd 24 (j.castAdd 12))) + (fun j => fields (Fin.natAdd 52 j)) + +namespace SetFormula + +def taskBearingMainSuccessorFormula {n} + (K Labels C D rD N sourceCode targetCode z : Fin n) : SetFormula n := + let old := suffixIndex n 60 + let fresh := prefixIndex n 60 + exBlock 60 (taskBearingMainSuccessorRawFormula (old K) (old Labels) (old C) (old D) + (old rD) (old N) (old sourceCode) (old targetCode) (old z) + (fresh 48) (fresh 49) (fresh 50) (fresh 51) + (fun j => fresh (j.castAdd 36)) + (fun j => fresh (Fin.natAdd 24 (j.castAdd 12))) + (fun j => fresh (Fin.natAdd 52 j))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_taskBearingMainSuccessorFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} + (K Labels C D rD N sourceCode targetCode z : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (taskBearingMainSuccessorFormula K Labels C D rD N sourceCode targetCode z) env ↔ + TaskBearingMainSuccessorCode M (env K) (env Labels) (env C) (env D) (env rD) (env N) + (env sourceCode) (env targetCode) (env z) := by + rw [taskBearingMainSuccessorFormula, realize_exBlock] + have actual (fields : Fin 60 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) := + M.realize_taskBearingMainSuccessorRawFormula pairing unions powers separation collection + (suffixIndex n 60 K) (suffixIndex n 60 Labels) (suffixIndex n 60 C) (suffixIndex n 60 D) + (suffixIndex n 60 rD) (suffixIndex n 60 N) (suffixIndex n 60 sourceCode) + (suffixIndex n 60 targetCode) (suffixIndex n 60 z) + (prefixIndex n 60 48) (prefixIndex n 60 49) (prefixIndex n 60 50) (prefixIndex n 60 51) + (fun j => prefixIndex n 60 (j.castAdd 36)) + (fun j => prefixIndex n 60 (Fin.natAdd 24 (j.castAdd 12))) + (fun j => prefixIndex n 60 (Fin.natAdd 52 j)) + (extendMany 60 fields env) (extendMany_members 60 fields env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal) + simp only [extendMany_prefix, extendMany_suffix] at actual + exact ⟨fun ⟨fields, ground, recognized⟩ => ⟨fields, ground, (actual fields ground).1 recognized⟩, + fun ⟨fields, ground, raw⟩ => ⟨fields, ground, (actual fields ground).2 raw⟩⟩ + +end TransitiveGround + +namespace TaskBearingMainSuccessorCode +variable {M : TransitiveGround.{u}} {K Labels C D rD N sourceCode targetCode z : ZFSet.{u}} + +theorem linked_transition + (code : TaskBearingMainSuccessorCode M K Labels C D rD N sourceCode targetCode z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) : + LinkedMainTransitionCode M K Labels C D rD sourceCode targetCode z := by + obtain ⟨fields, ground, raw⟩ := code + exact raw.1.exists_transition pairing unions powers separation + (fun j => ground (j.castAdd 36)) (fun j => ground (Fin.natAdd 24 (j.castAdd 12))) + (ground 48) (ground 49) hC hD hrD omega + +end TaskBearingMainSuccessorCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TaskBearingMainSuccessorCode +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {source target : GroundLinkedMainStage M K Labels C D rD} +variable {transition : GroundChronologicalMainTransition source.main target.main} + +theorem output_on_linked + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) : + ∃ extra : Fin 8 → ZFSet.{u}, (∀ j, extra j ∈ M.sets) ∧ + MainSuccessorOutputCode (linkedSuccessorOutputFields source.rawFields target.rawFields + transition.map.points transition.map.actors extra) ∧ + MainSuccessorTaskBindingsCode M Labels (linkedSuccessorOutputFields source.rawFields target.rawFields + transition.map.points transition.map.actors extra) := by + obtain ⟨fields, ground, raw⟩ := code + have sourceEq := source.rawFields_code.fields_unique raw.1.1 + have targetEq := target.rawFields_code.fields_unique raw.1.2.1 + have pairEq : ZFSet.pair transition.map.points transition.map.actors = + ZFSet.pair (fields 48) (fields 49) := raw.1.2.2.2.2.1.1 + have maps := ZFSet.pair_inj.1 pairEq + have output := raw.2.2.1 + have bindings := raw.2.2.2 + rw [← sourceEq, ← targetEq, ← maps.1, ← maps.2] at output bindings + exact ⟨(fun j => fields (Fin.natAdd 52 j)), + (fun j => ground (Fin.natAdd 52 j)), output, bindings⟩ + +theorem old_profiles_on_linked + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code) : + OldProfilePreservationCode source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph + target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph + transition.map.points (M.groundPower source.main.stage.carrier) := by + obtain ⟨extra, _, output, bindings⟩ := code.output_on_linked + have families := bindings.2.2.2.2.2.1 + have preservation := output.old_profiles + rw [families] at preservation + exact preservation + +end PartitionPilot.Forcing.TaskBearingMainSuccessorCode + + + +namespace PartitionPilot.Forcing.TaskBearingMainSuccessorCode +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD targetCode z : ZFSet.{u}} +variable {source : GroundLinkedMainStage M K Labels C D rD} + +theorem exists_from_linked + (code : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega source.code targetCode z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) : + ∃ target : GroundLinkedMainStage M K Labels C D rD, target.code = targetCode ∧ + ∃ transition : GroundChronologicalMainTransition source.main target.main, + transition.map.code = z ∧ transition.CoversOldBirths ∧ + OldProfilePreservationCode source.main.stage.carrier source.main.stage.order source.main.stage.meetGraph + target.main.stage.carrier target.main.stage.order target.main.stage.meetGraph + transition.map.points (M.groundPower source.main.stage.carrier) := by + obtain ⟨first, target, sourceEqual, targetEqual, decoded, mapEqual, covered⟩ := + code.linked_transition pairing unions powers separation source.main.stage.columns_ground + source.main.stage.coordinates_ground source.main.stage.coordinate_order_ground rfl + let transition := decoded.retargetLinked sourceEqual (rfl : target.code = target.code) + have exactMap : transition.map.code = z := + (decoded.retargetLinked_code sourceEqual rfl).trans mapEqual + have actual : TaskBearingMainSuccessorCode M K Labels C D rD ZFSet.omega + source.code target.code transition.map.code := by + rw [targetEqual, exactMap] + exact code + exact ⟨target, targetEqual, transition, exactMap, + decoded.retargetLinked_coversOldBirths sourceEqual rfl covered, + actual.old_profiles_on_linked⟩ + +end PartitionPilot.Forcing.TaskBearingMainSuccessorCode + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTwoStageMainDiagram.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTwoStageMainDiagram.lean index c2628f6ffa365f07550d4e801a7bfc6b42e114fa..120bf69339b6178bb69bef25957a3851d6168282 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTwoStageMainDiagram.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/GroundTwoStageMainDiagram.lean @@ -1,470 +1,470 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTransitionValidity -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u - -def OldBirthFiberCoverageCode (P e born cutoff : ZFSet.{u}) : Prop := - ∀ y t, ZFSet.pair y t ∈ born → (t = cutoff ∨ t ∈ cutoff) → - ∃ x ∈ P, ZFSet.pair x y ∈ e - -namespace OldBirthFiberCoverageCode -variable {P e old born cutoff : ZFSet.{u}} -variable (coverage : OldBirthFiberCoverageCode P e born cutoff) -include coverage - -theorem fiber_entry_iff - (preserves : ∀ x y t, ZFSet.pair x y ∈ e → - (ZFSet.pair y t ∈ born ↔ ZFSet.pair x t ∈ old)) - {t : ZFSet.{u}} (before : t = cutoff ∨ t ∈ cutoff) (y : ZFSet.{u}) : - ZFSet.pair y t ∈ born ↔ ∃ x ∈ P, ZFSet.pair x y ∈ e ∧ ZFSet.pair x t ∈ old := by - constructor - · intro entry - obtain ⟨x, hx, image⟩ := coverage y t entry before - exact ⟨x, hx, image, (preserves x y t image).1 entry⟩ - · rintro ⟨x, _, image, entry⟩ - exact (preserves x y t image).2 entry - -theorem mono_cutoff {earlier : ZFSet.{u}} (ordinal : ordinalSetProperty cutoff) - (before : earlier = cutoff ∨ earlier ∈ cutoff) : - OldBirthFiberCoverageCode P e born earlier := by - intro y t entry oldTime - apply coverage y t entry - rcases before with rfl | before - · exact oldTime - · exact Or.inr (oldTime.elim (fun equal => equal.symm ▸ before) - (fun member => ordinal.1 earlier before t member)) - -end OldBirthFiberCoverageCode - -structure GroundChronologicalMainStage (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) where - stage : GroundMainStage M C D rD - cutoff : ZFSet.{u} - cutoff_ground : cutoff ∈ M.sets - cutoff_ordinal : ordinalSetProperty cutoff - history : GroundChronologicalHistory M (insert cutoff cutoff) C D rD - carrier_eq : history.space cutoff = stage.carrier - order_eq : history.order cutoff = stage.order - meet_eq : history.meetGraph cutoff = stage.meetGraph - height_eq : history.height cutoff = stage.height - -namespace GroundChronologicalMainStage -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundChronologicalMainStage M C D rD) - -def birth : ZFSet.{u} := stage.history.birth stage.cutoff - -theorem birth_ground : stage.birth ∈ M.sets := - stage.history.birth_mem stage.cutoff (ZFSet.mem_insert _ _) - -theorem birth_function : ZFSet.IsFunc stage.stage.carrier (insert stage.cutoff stage.cutoff) stage.birth := by - rw [← stage.carrier_eq] - exact stage.history.birth_function stage.cutoff (ZFSet.mem_insert _ _) - -theorem birth_bound {x t : ZFSet.{u}} (entry : ZFSet.pair x t ∈ stage.birth) : - t = stage.cutoff ∨ t ∈ stage.cutoff := by - have hx := (ZFSet.pair_mem_prod.1 (stage.birth_function.1 entry)).1 - rw [← stage.carrier_eq] at hx - exact stage.history.birth_bound stage.cutoff (ZFSet.mem_insert _ _) x hx t entry - -theorem old_meet : OldMeetCode stage.stage.order stage.stage.meetGraph stage.birth := by - rw [← stage.order_eq, ← stage.meet_eq] - exact stage.history.old_meet stage.cutoff (ZFSet.mem_insert _ _) - -def ofHistory (main : GroundMainStage M C D rD) {T t : ZFSet.{u}} - (prior : GroundChronologicalHistory M T C D rD) (ordinal : ordinalSetProperty T) - (ht : t ∈ T) (htGround : t ∈ M.sets) - (carrier : prior.space t = main.carrier) (order : prior.order t = main.order) - (meet : prior.meetGraph t = main.meetGraph) (height : prior.height t = main.height) : - GroundChronologicalMainStage M C D rD where - stage := main - cutoff := t - cutoff_ground := htGround - cutoff_ordinal := ordinalSetProperty_member ordinal ht - history := prior.restrictToCutoff ordinal ht - carrier_eq := carrier - order_eq := order - meet_eq := meet - height_eq := height - -end GroundChronologicalMainStage - -structure GroundChronologicalMainTransition {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} - (source target : GroundChronologicalMainStage M C D rD) where - map : GroundMainTransition source.stage target.stage - cutoff_le : source.cutoff = target.cutoff ∨ source.cutoff ∈ target.cutoff - birth : ∀ x y t, ZFSet.pair x y ∈ map.points → - (ZFSet.pair y t ∈ target.birth ↔ ZFSet.pair x t ∈ source.birth) - history_prefix : ∀ s, s = source.cutoff ∨ s ∈ source.cutoff → - target.history.space s = source.history.space s ∧ - target.history.order s = source.history.order s ∧ - target.history.meetGraph s = source.history.meetGraph s ∧ - target.history.birth s = source.history.birth s ∧ - target.history.height s = source.history.height s - -namespace GroundChronologicalMainTransition -open SetFormula -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -theorem prefix_bound {source target : GroundChronologicalMainStage M C D rD} - (transition : GroundChronologicalMainTransition source target) {s : ZFSet.{u}} - (before : s = source.cutoff ∨ s ∈ source.cutoff) : s = target.cutoff ∨ s ∈ target.cutoff := by - rcases transition.cutoff_le with equal | lower - · exact equal ▸ before - · right - rcases before with rfl | before - · exact lower - · exact target.cutoff_ordinal.1 source.cutoff lower s before - -noncomputable def identity (stage : GroundChronologicalMainStage M C D rD) : - GroundChronologicalMainTransition stage stage where - map := GroundMainTransition.identity pairing unions powers separation stage.stage - cutoff_le := Or.inl rfl - birth := by - intro x y t entry - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 entry - exact Iff.rfl - history_prefix := fun _ _ => ⟨rfl, rfl, rfl, rfl, rfl⟩ - -noncomputable def comp {source middle target : GroundChronologicalMainStage M C D rD} - (first : GroundChronologicalMainTransition source middle) - (second : GroundChronologicalMainTransition middle target) : - GroundChronologicalMainTransition source target where - map := first.map.comp pairing unions powers separation second.map - cutoff_le := second.prefix_bound first.cutoff_le - birth := by - intro x y t entry - obtain ⟨_, _, z, _, xz, zy⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry - exact (second.birth z y t zy).trans (first.birth x z t xz) - history_prefix := by - intro s before - have a := first.history_prefix s before - have b := second.history_prefix s (first.prefix_bound before) - exact ⟨b.1.trans a.1, b.2.1.trans a.2.1, b.2.2.1.trans a.2.2.1, - b.2.2.2.1.trans a.2.2.2.1, b.2.2.2.2.trans a.2.2.2.2⟩ - -@[ext] theorem ext {source target : GroundChronologicalMainStage M C D rD} - {first second : GroundChronologicalMainTransition source target} (same : first.map = second.map) : - first = second := by - cases first - cases second - cases same - rfl - -end GroundChronologicalMainTransition - -end - -section -open SetFormula -universe u - -def ChronologyGraphPrefixCode (cutoff : ZFSet.{u}) (source target : Fin 5 → ZFSet.{u}) : Prop := - ∀ j s, s = cutoff ∨ s ∈ cutoff → ∀ x, - ZFSet.pair s x ∈ source j ↔ ZFSet.pair s x ∈ target j - -structure ChronologicalTransitionLaws (points sourceCutoff targetCutoff sourceBirth targetBirth : ZFSet.{u}) - (sourceGraphs targetGraphs : Fin 5 → ZFSet.{u}) : Prop where - cutoff_le : sourceCutoff = targetCutoff ∨ sourceCutoff ∈ targetCutoff - birth : ∀ x y t, ZFSet.pair x y ∈ points → - (ZFSet.pair y t ∈ targetBirth ↔ ZFSet.pair x t ∈ sourceBirth) - history_prefix : ChronologyGraphPrefixCode sourceCutoff sourceGraphs targetGraphs - -namespace BoundedFormula - -def graphCutoffEqualityFormula {n} (cutoff source target : Fin n) : BoundedFormula n := - .conj (graphFiberEqualityFormula cutoff cutoff source target) - (.allMem cutoff (graphFiberEqualityFormula 0 0 source.succ target.succ)) - -theorem truth_graphCutoffEqualityFormula {n} (cutoff source target : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (graphCutoffEqualityFormula cutoff source target) env ↔ - ∀ s, s = env cutoff ∨ s ∈ env cutoff → ∀ x, - ZFSet.pair s x ∈ env source ↔ ZFSet.pair s x ∈ env target := by - simp only [graphCutoffEqualityFormula, Truth, truth_graphFiberEqualityFormula] - constructor - · rintro ⟨terminal, earlier⟩ s (rfl | hs) x - · exact terminal x - · exact earlier s hs x - · intro h - exact ⟨h _ (Or.inl rfl), fun s hs => h s (Or.inr hs)⟩ - -def chronologyGraphPrefixFormula {n} (cutoff : Fin n) (source target : Fin 5 → Fin n) : - BoundedFormula n := - .conj (graphCutoffEqualityFormula cutoff (source 0) (target 0)) - (.conj (graphCutoffEqualityFormula cutoff (source 1) (target 1)) - (.conj (graphCutoffEqualityFormula cutoff (source 2) (target 2)) - (.conj (graphCutoffEqualityFormula cutoff (source 3) (target 3)) - (graphCutoffEqualityFormula cutoff (source 4) (target 4))))) - -theorem truth_chronologyGraphPrefixFormula {n} (cutoff : Fin n) (source target : Fin 5 → Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (chronologyGraphPrefixFormula cutoff source target) env ↔ - ChronologyGraphPrefixCode (env cutoff) (fun j => env (source j)) (fun j => env (target j)) := by - simp only [chronologyGraphPrefixFormula, Truth, truth_graphCutoffEqualityFormula] - exact ⟨fun ⟨a, b, c, d, e⟩ => Fin.cases a (Fin.cases b (Fin.cases c - (Fin.cases d (Fin.cases e (fun i => Fin.elim0 i))))), - fun h => ⟨h 0, h 1, h 2, h 3, h 4⟩⟩ - -def chronologicalTransitionExtraFormula {n} - (P Q points sourceCutoff targetCutoff sourceBirth targetBirth : Fin n) - (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n := - .conj (disj (.equal sourceCutoff targetCutoff) (.mem sourceCutoff targetCutoff)) - (.conj (transitionHeightFormula P Q sourceBirth targetBirth points) - (chronologyGraphPrefixFormula sourceCutoff sourceGraphs targetGraphs)) - -theorem truth_chronologicalTransitionExtraFormula {n} - (P Q points sourceCutoff targetCutoff sourceBirth targetBirth : Fin n) - (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) - (shape : env points ⊆ ZFSet.prod (env P) (env Q)) : - Truth (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff - sourceBirth targetBirth sourceGraphs targetGraphs) env ↔ - ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) - (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) - (fun j => env (targetGraphs j)) := by - simp only [chronologicalTransitionExtraFormula, Truth, truth_disj, transitionHeightFormula, - truth_imp, truth_pairMembershipFormula, truth_graphFiberEqualityFormula, - truth_chronologyGraphPrefixFormula] - constructor - · rintro ⟨cutoff, birth, history⟩ - refine ⟨cutoff, ?_, history⟩ - intro x y t entry - have bounds := ZFSet.pair_mem_prod.1 (shape entry) - exact birth x bounds.1 y bounds.2 entry t - · intro h - exact ⟨h.cutoff_le, fun x _ y _ entry t => h.birth x y t entry, h.history_prefix⟩ - -theorem realize_chronologicalTransitionExtraFormula (M : TransitiveGround.{u}) {n} - (P Q points sourceCutoff targetCutoff sourceBirth targetBirth : Fin n) - (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) (shape : env points ⊆ ZFSet.prod (env P) (env Q)) : - Realize M.sets (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff - sourceBirth targetBirth sourceGraphs targetGraphs).toFormula env ↔ - ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) - (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) - (fun j => env (targetGraphs j)) := - (realize_toFormula M _ env members).trans - (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff - sourceBirth targetBirth sourceGraphs targetGraphs env shape) - -def oldBirthFiberCoverageFormula {n} (P points birth cutoff : Fin n) : BoundedFormula n := - let lift (i : Fin n) := i.succ.succ.succ.succ.succ - .allMem birth (.allMem 0 (.allMem 0 (.allMem 2 (.allMem 0 - (imp (.conj (orderedPairFormula 4 2 0) - (disj (.equal 0 (lift cutoff)) (.mem 0 (lift cutoff)))) - (exMem (lift P) (pairMembershipFormula 0 3 (lift points).succ))))))) - -theorem truth_oldBirthFiberCoverageFormula {n} (P points birth cutoff : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (oldBirthFiberCoverageFormula P points birth cutoff) env ↔ - OldBirthFiberCoverageCode (env P) (env points) (env birth) (env cutoff) := by - simp only [oldBirthFiberCoverageFormula, Truth, truth_imp, truth_orderedPairFormula, - truth_disj, truth_exMem, truth_pairMembershipFormula] - change (∀ p ∈ env birth, ∀ a ∈ p, ∀ y ∈ a, ∀ b ∈ p, ∀ t ∈ b, - (p = ZFSet.pair y t ∧ (t = env cutoff ∨ t ∈ env cutoff)) → - ∃ x ∈ env P, ZFSet.pair x y ∈ env points) ↔ _ - constructor - · intro h y t entry before - exact h (ZFSet.pair y t) entry {y, t} (ZFSet.mem_pair.2 (Or.inr rfl)) y - (ZFSet.mem_pair.2 (Or.inl rfl)) {y, t} (ZFSet.mem_pair.2 (Or.inr rfl)) t - (ZFSet.mem_pair.2 (Or.inr rfl)) ⟨rfl, before⟩ - · intro h p hp a _ y _ b _ t _ data - exact h y t (data.1 ▸ hp) data.2 - -end BoundedFormula - -end - -namespace GroundChronologicalMainTransition -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {source middle target : GroundChronologicalMainStage M C D rD} - -def CoversOldBirths (transition : GroundChronologicalMainTransition source target) : Prop := - OldBirthFiberCoverageCode source.stage.carrier transition.map.points target.birth source.cutoff - -theorem CoversOldBirths.fiber_entry_iff - {transition : GroundChronologicalMainTransition source target} (coverage : transition.CoversOldBirths) - {t : ZFSet.{u}} (before : t = source.cutoff ∨ t ∈ source.cutoff) (y : ZFSet.{u}) : - ZFSet.pair y t ∈ target.birth ↔ ∃ x ∈ source.stage.carrier, - ZFSet.pair x y ∈ transition.map.points ∧ ZFSet.pair x t ∈ source.birth := - OldBirthFiberCoverageCode.fiber_entry_iff coverage transition.birth before y - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -theorem identity_coversOldBirths (stage : GroundChronologicalMainStage M C D rD) : - (identity pairing unions powers separation stage).CoversOldBirths := by - intro y t entry _ - have hy := (ZFSet.pair_mem_prod.1 (stage.birth_function.1 entry)).1 - exact ⟨y, hy, (pair_mem_identityFunctionGraph _ _ _).2 ⟨rfl, hy⟩⟩ - -theorem CoversOldBirths.comp - {first : GroundChronologicalMainTransition source middle} - {second : GroundChronologicalMainTransition middle target} - (firstCoverage : first.CoversOldBirths) (secondCoverage : second.CoversOldBirths) : - (first.comp pairing unions powers separation second).CoversOldBirths := by - intro y t entry before - have middleTime := first.prefix_bound before - obtain ⟨z, hz, zy⟩ := secondCoverage y t entry middleTime - have intermediate := (second.birth z y t zy).1 entry - obtain ⟨x, hx, xz⟩ := firstCoverage z t intermediate before - have hy := (ZFSet.pair_mem_prod.1 (target.birth_function.1 entry)).1 - exact ⟨x, hx, (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hx, hy, z, hz, xz, zy⟩⟩ - -end GroundChronologicalMainTransition - -namespace GroundChronologicalMainTransition -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - -@[simp] theorem identity_comp {source target : GroundChronologicalMainStage M C D rD} - (f : GroundChronologicalMainTransition source target) : - comp pairing unions powers separation (identity pairing unions powers separation source) f = f := by - apply ext - exact GroundMainTransition.identity_comp pairing unions powers separation f.map - -@[simp] theorem comp_identity {source target : GroundChronologicalMainStage M C D rD} - (f : GroundChronologicalMainTransition source target) : - comp pairing unions powers separation f (identity pairing unions powers separation target) = f := by - apply ext - exact GroundMainTransition.comp_identity pairing unions powers separation f.map - -theorem comp_assoc {source first second target : GroundChronologicalMainStage M C D rD} - (f : GroundChronologicalMainTransition source first) - (g : GroundChronologicalMainTransition first second) - (h : GroundChronologicalMainTransition second target) : - comp pairing unions powers separation (comp pairing unions powers separation f g) h = - comp pairing unions powers separation f (comp pairing unions powers separation g h) := by - apply ext - exact GroundMainTransition.comp_assoc pairing unions powers separation f.map g.map h.map - -end GroundChronologicalMainTransition - -section -open SetFormula -universe u v - -structure GroundChronologicalMainDiagram (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (I : Type v) [Preorder I] where - stage : I → GroundChronologicalMainStage M C D rD - transition : ∀ {i j}, i ≤ j → GroundChronologicalMainTransition (stage i) (stage j) - self : ∀ i, transition (le_refl i) = - GroundChronologicalMainTransition.identity pairing unions powers separation (stage i) - comp : ∀ {i j k} (hij : i ≤ j) (hjk : j ≤ k), transition (le_trans hij hjk) = - (transition hij).comp pairing unions powers separation (transition hjk) - -namespace GroundChronologicalMainDiagram -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Preorder I] - -def CoversOldBirths (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) : Prop := - ∀ {i j} (before : i ≤ j), (diagram.transition before).CoversOldBirths - -end GroundChronologicalMainDiagram - -end - -namespace GroundChronologicalMainDiagram -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable {source target : GroundChronologicalMainStage M C D rD} -variable (step : GroundChronologicalMainTransition source target) - -def twoStageStage (source target : GroundChronologicalMainStage M C D rD) : - Fin 2 → GroundChronologicalMainStage M C D rD := - Fin.cases source (fun _ => target) - -noncomputable def twoStageTransition : ∀ {i j : Fin 2}, i ≤ j → - GroundChronologicalMainTransition (twoStageStage source target i) (twoStageStage source target j) := by - intro i j before - cases i using Fin.cases with - | zero => - cases j using Fin.cases with - | zero => exact GroundChronologicalMainTransition.identity pairing unions powers separation source - | succ j => exact step - | succ i => - cases j using Fin.cases with - | zero => exact False.elim (Nat.not_succ_le_zero i.val before) - | succ j => exact GroundChronologicalMainTransition.identity pairing unions powers separation target - -theorem twoStage_index_cases (i : Fin 2) : i = 0 ∨ i = 1 := by - obtain ⟨n, bound⟩ := i - cases n with - | zero => exact Or.inl rfl - | succ n => - have zero : n = 0 := Nat.eq_zero_of_le_zero (Nat.le_of_lt_succ (Nat.lt_of_succ_lt_succ bound)) - subst n - exact Or.inr rfl - -theorem twoStageTransition_self (i : Fin 2) : - twoStageTransition pairing unions powers separation step (le_refl i) = - GroundChronologicalMainTransition.identity pairing unions powers separation (twoStageStage source target i) := by - rcases twoStage_index_cases i with rfl | rfl <;> rfl - -theorem twoStageTransition_comp {i j k : Fin 2} (hij : i ≤ j) (hjk : j ≤ k) : - twoStageTransition pairing unions powers separation step (le_trans hij hjk) = - (twoStageTransition pairing unions powers separation step hij).comp pairing unions powers separation - (twoStageTransition pairing unions powers separation step hjk) := by - rcases twoStage_index_cases i with rfl | rfl <;> - rcases twoStage_index_cases j with rfl | rfl <;> - rcases twoStage_index_cases k with rfl | rfl - · exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation _).symm - · exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation step).symm - · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hjk) - · exact (GroundChronologicalMainTransition.comp_identity pairing unions powers separation step).symm - · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hij) - · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hij) - · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hjk) - · exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation _).symm - -noncomputable def twoStage : GroundChronologicalMainDiagram M C D rD pairing unions powers separation (Fin 2) where - stage := twoStageStage source target - transition := twoStageTransition pairing unions powers separation step - self := twoStageTransition_self pairing unions powers separation step - comp := twoStageTransition_comp pairing unions powers separation step - -theorem twoStage_stage_zero : (twoStage pairing unions powers separation step).stage 0 = source := rfl - -theorem twoStage_stage_one : (twoStage pairing unions powers separation step).stage 1 = target := rfl - -theorem twoStage_transition_zero_one : - (twoStage pairing unions powers separation step).transition (show (0 : Fin 2) ≤ 1 from by decide) = step := rfl - -theorem twoStage_coversOldBirths (coverage : step.CoversOldBirths) : - (twoStage pairing unions powers separation step).CoversOldBirths := by - intro i j before - rcases twoStage_index_cases i with rfl | rfl <;> rcases twoStage_index_cases j with rfl | rfl - · exact GroundChronologicalMainTransition.identity_coversOldBirths pairing unions powers separation source - · exact coverage - · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) before) - · exact GroundChronologicalMainTransition.identity_coversOldBirths pairing unions powers separation target - -end GroundChronologicalMainDiagram - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTransitionValidity +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundChronologyFieldAppend + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u + +def OldBirthFiberCoverageCode (P e born cutoff : ZFSet.{u}) : Prop := + ∀ y t, ZFSet.pair y t ∈ born → (t = cutoff ∨ t ∈ cutoff) → + ∃ x ∈ P, ZFSet.pair x y ∈ e + +namespace OldBirthFiberCoverageCode +variable {P e old born cutoff : ZFSet.{u}} +variable (coverage : OldBirthFiberCoverageCode P e born cutoff) +include coverage + +theorem fiber_entry_iff + (preserves : ∀ x y t, ZFSet.pair x y ∈ e → + (ZFSet.pair y t ∈ born ↔ ZFSet.pair x t ∈ old)) + {t : ZFSet.{u}} (before : t = cutoff ∨ t ∈ cutoff) (y : ZFSet.{u}) : + ZFSet.pair y t ∈ born ↔ ∃ x ∈ P, ZFSet.pair x y ∈ e ∧ ZFSet.pair x t ∈ old := by + constructor + · intro entry + obtain ⟨x, hx, image⟩ := coverage y t entry before + exact ⟨x, hx, image, (preserves x y t image).1 entry⟩ + · rintro ⟨x, _, image, entry⟩ + exact (preserves x y t image).2 entry + +theorem mono_cutoff {earlier : ZFSet.{u}} (ordinal : ordinalSetProperty cutoff) + (before : earlier = cutoff ∨ earlier ∈ cutoff) : + OldBirthFiberCoverageCode P e born earlier := by + intro y t entry oldTime + apply coverage y t entry + rcases before with rfl | before + · exact oldTime + · exact Or.inr (oldTime.elim (fun equal => equal.symm ▸ before) + (fun member => ordinal.1 earlier before t member)) + +end OldBirthFiberCoverageCode + +structure GroundChronologicalMainStage (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) where + stage : GroundMainStage M C D rD + cutoff : ZFSet.{u} + cutoff_ground : cutoff ∈ M.sets + cutoff_ordinal : ordinalSetProperty cutoff + history : GroundChronologicalHistory M (insert cutoff cutoff) C D rD + carrier_eq : history.space cutoff = stage.carrier + order_eq : history.order cutoff = stage.order + meet_eq : history.meetGraph cutoff = stage.meetGraph + height_eq : history.height cutoff = stage.height + +namespace GroundChronologicalMainStage +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundChronologicalMainStage M C D rD) + +def birth : ZFSet.{u} := stage.history.birth stage.cutoff + +theorem birth_ground : stage.birth ∈ M.sets := + stage.history.birth_mem stage.cutoff (ZFSet.mem_insert _ _) + +theorem birth_function : ZFSet.IsFunc stage.stage.carrier (insert stage.cutoff stage.cutoff) stage.birth := by + rw [← stage.carrier_eq] + exact stage.history.birth_function stage.cutoff (ZFSet.mem_insert _ _) + +theorem birth_bound {x t : ZFSet.{u}} (entry : ZFSet.pair x t ∈ stage.birth) : + t = stage.cutoff ∨ t ∈ stage.cutoff := by + have hx := (ZFSet.pair_mem_prod.1 (stage.birth_function.1 entry)).1 + rw [← stage.carrier_eq] at hx + exact stage.history.birth_bound stage.cutoff (ZFSet.mem_insert _ _) x hx t entry + +theorem old_meet : OldMeetCode stage.stage.order stage.stage.meetGraph stage.birth := by + rw [← stage.order_eq, ← stage.meet_eq] + exact stage.history.old_meet stage.cutoff (ZFSet.mem_insert _ _) + +def ofHistory (main : GroundMainStage M C D rD) {T t : ZFSet.{u}} + (prior : GroundChronologicalHistory M T C D rD) (ordinal : ordinalSetProperty T) + (ht : t ∈ T) (htGround : t ∈ M.sets) + (carrier : prior.space t = main.carrier) (order : prior.order t = main.order) + (meet : prior.meetGraph t = main.meetGraph) (height : prior.height t = main.height) : + GroundChronologicalMainStage M C D rD where + stage := main + cutoff := t + cutoff_ground := htGround + cutoff_ordinal := ordinalSetProperty_member ordinal ht + history := prior.restrictToCutoff ordinal ht + carrier_eq := carrier + order_eq := order + meet_eq := meet + height_eq := height + +end GroundChronologicalMainStage + +structure GroundChronologicalMainTransition {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} + (source target : GroundChronologicalMainStage M C D rD) where + map : GroundMainTransition source.stage target.stage + cutoff_le : source.cutoff = target.cutoff ∨ source.cutoff ∈ target.cutoff + birth : ∀ x y t, ZFSet.pair x y ∈ map.points → + (ZFSet.pair y t ∈ target.birth ↔ ZFSet.pair x t ∈ source.birth) + history_prefix : ∀ s, s = source.cutoff ∨ s ∈ source.cutoff → + target.history.space s = source.history.space s ∧ + target.history.order s = source.history.order s ∧ + target.history.meetGraph s = source.history.meetGraph s ∧ + target.history.birth s = source.history.birth s ∧ + target.history.height s = source.history.height s + +namespace GroundChronologicalMainTransition +open SetFormula +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +theorem prefix_bound {source target : GroundChronologicalMainStage M C D rD} + (transition : GroundChronologicalMainTransition source target) {s : ZFSet.{u}} + (before : s = source.cutoff ∨ s ∈ source.cutoff) : s = target.cutoff ∨ s ∈ target.cutoff := by + rcases transition.cutoff_le with equal | lower + · exact equal ▸ before + · right + rcases before with rfl | before + · exact lower + · exact target.cutoff_ordinal.1 source.cutoff lower s before + +noncomputable def identity (stage : GroundChronologicalMainStage M C D rD) : + GroundChronologicalMainTransition stage stage where + map := GroundMainTransition.identity pairing unions powers separation stage.stage + cutoff_le := Or.inl rfl + birth := by + intro x y t entry + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph _ _ _).1 entry + exact Iff.rfl + history_prefix := fun _ _ => ⟨rfl, rfl, rfl, rfl, rfl⟩ + +noncomputable def comp {source middle target : GroundChronologicalMainStage M C D rD} + (first : GroundChronologicalMainTransition source middle) + (second : GroundChronologicalMainTransition middle target) : + GroundChronologicalMainTransition source target where + map := first.map.comp pairing unions powers separation second.map + cutoff_le := second.prefix_bound first.cutoff_le + birth := by + intro x y t entry + obtain ⟨_, _, z, _, xz, zy⟩ := (pair_mem_relationCompose _ _ _ _ _ _ _).1 entry + exact (second.birth z y t zy).trans (first.birth x z t xz) + history_prefix := by + intro s before + have a := first.history_prefix s before + have b := second.history_prefix s (first.prefix_bound before) + exact ⟨b.1.trans a.1, b.2.1.trans a.2.1, b.2.2.1.trans a.2.2.1, + b.2.2.2.1.trans a.2.2.2.1, b.2.2.2.2.trans a.2.2.2.2⟩ + +@[ext] theorem ext {source target : GroundChronologicalMainStage M C D rD} + {first second : GroundChronologicalMainTransition source target} (same : first.map = second.map) : + first = second := by + cases first + cases second + cases same + rfl + +end GroundChronologicalMainTransition + +end + +section +open SetFormula +universe u + +def ChronologyGraphPrefixCode (cutoff : ZFSet.{u}) (source target : Fin 5 → ZFSet.{u}) : Prop := + ∀ j s, s = cutoff ∨ s ∈ cutoff → ∀ x, + ZFSet.pair s x ∈ source j ↔ ZFSet.pair s x ∈ target j + +structure ChronologicalTransitionLaws (points sourceCutoff targetCutoff sourceBirth targetBirth : ZFSet.{u}) + (sourceGraphs targetGraphs : Fin 5 → ZFSet.{u}) : Prop where + cutoff_le : sourceCutoff = targetCutoff ∨ sourceCutoff ∈ targetCutoff + birth : ∀ x y t, ZFSet.pair x y ∈ points → + (ZFSet.pair y t ∈ targetBirth ↔ ZFSet.pair x t ∈ sourceBirth) + history_prefix : ChronologyGraphPrefixCode sourceCutoff sourceGraphs targetGraphs + +namespace BoundedFormula + +def graphCutoffEqualityFormula {n} (cutoff source target : Fin n) : BoundedFormula n := + .conj (graphFiberEqualityFormula cutoff cutoff source target) + (.allMem cutoff (graphFiberEqualityFormula 0 0 source.succ target.succ)) + +theorem truth_graphCutoffEqualityFormula {n} (cutoff source target : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (graphCutoffEqualityFormula cutoff source target) env ↔ + ∀ s, s = env cutoff ∨ s ∈ env cutoff → ∀ x, + ZFSet.pair s x ∈ env source ↔ ZFSet.pair s x ∈ env target := by + simp only [graphCutoffEqualityFormula, Truth, truth_graphFiberEqualityFormula] + constructor + · rintro ⟨terminal, earlier⟩ s (rfl | hs) x + · exact terminal x + · exact earlier s hs x + · intro h + exact ⟨h _ (Or.inl rfl), fun s hs => h s (Or.inr hs)⟩ + +def chronologyGraphPrefixFormula {n} (cutoff : Fin n) (source target : Fin 5 → Fin n) : + BoundedFormula n := + .conj (graphCutoffEqualityFormula cutoff (source 0) (target 0)) + (.conj (graphCutoffEqualityFormula cutoff (source 1) (target 1)) + (.conj (graphCutoffEqualityFormula cutoff (source 2) (target 2)) + (.conj (graphCutoffEqualityFormula cutoff (source 3) (target 3)) + (graphCutoffEqualityFormula cutoff (source 4) (target 4))))) + +theorem truth_chronologyGraphPrefixFormula {n} (cutoff : Fin n) (source target : Fin 5 → Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (chronologyGraphPrefixFormula cutoff source target) env ↔ + ChronologyGraphPrefixCode (env cutoff) (fun j => env (source j)) (fun j => env (target j)) := by + simp only [chronologyGraphPrefixFormula, Truth, truth_graphCutoffEqualityFormula] + exact ⟨fun ⟨a, b, c, d, e⟩ => Fin.cases a (Fin.cases b (Fin.cases c + (Fin.cases d (Fin.cases e (fun i => Fin.elim0 i))))), + fun h => ⟨h 0, h 1, h 2, h 3, h 4⟩⟩ + +def chronologicalTransitionExtraFormula {n} + (P Q points sourceCutoff targetCutoff sourceBirth targetBirth : Fin n) + (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n := + .conj (disj (.equal sourceCutoff targetCutoff) (.mem sourceCutoff targetCutoff)) + (.conj (transitionHeightFormula P Q sourceBirth targetBirth points) + (chronologyGraphPrefixFormula sourceCutoff sourceGraphs targetGraphs)) + +theorem truth_chronologicalTransitionExtraFormula {n} + (P Q points sourceCutoff targetCutoff sourceBirth targetBirth : Fin n) + (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) + (shape : env points ⊆ ZFSet.prod (env P) (env Q)) : + Truth (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff + sourceBirth targetBirth sourceGraphs targetGraphs) env ↔ + ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) + (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) + (fun j => env (targetGraphs j)) := by + simp only [chronologicalTransitionExtraFormula, Truth, truth_disj, transitionHeightFormula, + truth_imp, truth_pairMembershipFormula, truth_graphFiberEqualityFormula, + truth_chronologyGraphPrefixFormula] + constructor + · rintro ⟨cutoff, birth, history⟩ + refine ⟨cutoff, ?_, history⟩ + intro x y t entry + have bounds := ZFSet.pair_mem_prod.1 (shape entry) + exact birth x bounds.1 y bounds.2 entry t + · intro h + exact ⟨h.cutoff_le, fun x _ y _ entry t => h.birth x y t entry, h.history_prefix⟩ + +theorem realize_chronologicalTransitionExtraFormula (M : TransitiveGround.{u}) {n} + (P Q points sourceCutoff targetCutoff sourceBirth targetBirth : Fin n) + (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) (shape : env points ⊆ ZFSet.prod (env P) (env Q)) : + Realize M.sets (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff + sourceBirth targetBirth sourceGraphs targetGraphs).toFormula env ↔ + ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff) + (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j)) + (fun j => env (targetGraphs j)) := + (realize_toFormula M _ env members).trans + (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff + sourceBirth targetBirth sourceGraphs targetGraphs env shape) + +def oldBirthFiberCoverageFormula {n} (P points birth cutoff : Fin n) : BoundedFormula n := + let lift (i : Fin n) := i.succ.succ.succ.succ.succ + .allMem birth (.allMem 0 (.allMem 0 (.allMem 2 (.allMem 0 + (imp (.conj (orderedPairFormula 4 2 0) + (disj (.equal 0 (lift cutoff)) (.mem 0 (lift cutoff)))) + (exMem (lift P) (pairMembershipFormula 0 3 (lift points).succ))))))) + +theorem truth_oldBirthFiberCoverageFormula {n} (P points birth cutoff : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (oldBirthFiberCoverageFormula P points birth cutoff) env ↔ + OldBirthFiberCoverageCode (env P) (env points) (env birth) (env cutoff) := by + simp only [oldBirthFiberCoverageFormula, Truth, truth_imp, truth_orderedPairFormula, + truth_disj, truth_exMem, truth_pairMembershipFormula] + change (∀ p ∈ env birth, ∀ a ∈ p, ∀ y ∈ a, ∀ b ∈ p, ∀ t ∈ b, + (p = ZFSet.pair y t ∧ (t = env cutoff ∨ t ∈ env cutoff)) → + ∃ x ∈ env P, ZFSet.pair x y ∈ env points) ↔ _ + constructor + · intro h y t entry before + exact h (ZFSet.pair y t) entry {y, t} (ZFSet.mem_pair.2 (Or.inr rfl)) y + (ZFSet.mem_pair.2 (Or.inl rfl)) {y, t} (ZFSet.mem_pair.2 (Or.inr rfl)) t + (ZFSet.mem_pair.2 (Or.inr rfl)) ⟨rfl, before⟩ + · intro h p hp a _ y _ b _ t _ data + exact h y t (data.1 ▸ hp) data.2 + +end BoundedFormula + +end + +namespace GroundChronologicalMainTransition +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {source middle target : GroundChronologicalMainStage M C D rD} + +def CoversOldBirths (transition : GroundChronologicalMainTransition source target) : Prop := + OldBirthFiberCoverageCode source.stage.carrier transition.map.points target.birth source.cutoff + +theorem CoversOldBirths.fiber_entry_iff + {transition : GroundChronologicalMainTransition source target} (coverage : transition.CoversOldBirths) + {t : ZFSet.{u}} (before : t = source.cutoff ∨ t ∈ source.cutoff) (y : ZFSet.{u}) : + ZFSet.pair y t ∈ target.birth ↔ ∃ x ∈ source.stage.carrier, + ZFSet.pair x y ∈ transition.map.points ∧ ZFSet.pair x t ∈ source.birth := + OldBirthFiberCoverageCode.fiber_entry_iff coverage transition.birth before y + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +theorem identity_coversOldBirths (stage : GroundChronologicalMainStage M C D rD) : + (identity pairing unions powers separation stage).CoversOldBirths := by + intro y t entry _ + have hy := (ZFSet.pair_mem_prod.1 (stage.birth_function.1 entry)).1 + exact ⟨y, hy, (pair_mem_identityFunctionGraph _ _ _).2 ⟨rfl, hy⟩⟩ + +theorem CoversOldBirths.comp + {first : GroundChronologicalMainTransition source middle} + {second : GroundChronologicalMainTransition middle target} + (firstCoverage : first.CoversOldBirths) (secondCoverage : second.CoversOldBirths) : + (first.comp pairing unions powers separation second).CoversOldBirths := by + intro y t entry before + have middleTime := first.prefix_bound before + obtain ⟨z, hz, zy⟩ := secondCoverage y t entry middleTime + have intermediate := (second.birth z y t zy).1 entry + obtain ⟨x, hx, xz⟩ := firstCoverage z t intermediate before + have hy := (ZFSet.pair_mem_prod.1 (target.birth_function.1 entry)).1 + exact ⟨x, hx, (pair_mem_relationCompose _ _ _ _ _ _ _).2 ⟨hx, hy, z, hz, xz, zy⟩⟩ + +end GroundChronologicalMainTransition + +namespace GroundChronologicalMainTransition +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + +@[simp] theorem identity_comp {source target : GroundChronologicalMainStage M C D rD} + (f : GroundChronologicalMainTransition source target) : + comp pairing unions powers separation (identity pairing unions powers separation source) f = f := by + apply ext + exact GroundMainTransition.identity_comp pairing unions powers separation f.map + +@[simp] theorem comp_identity {source target : GroundChronologicalMainStage M C D rD} + (f : GroundChronologicalMainTransition source target) : + comp pairing unions powers separation f (identity pairing unions powers separation target) = f := by + apply ext + exact GroundMainTransition.comp_identity pairing unions powers separation f.map + +theorem comp_assoc {source first second target : GroundChronologicalMainStage M C D rD} + (f : GroundChronologicalMainTransition source first) + (g : GroundChronologicalMainTransition first second) + (h : GroundChronologicalMainTransition second target) : + comp pairing unions powers separation (comp pairing unions powers separation f g) h = + comp pairing unions powers separation f (comp pairing unions powers separation g h) := by + apply ext + exact GroundMainTransition.comp_assoc pairing unions powers separation f.map g.map h.map + +end GroundChronologicalMainTransition + +section +open SetFormula +universe u v + +structure GroundChronologicalMainDiagram (M : TransitiveGround.{u}) (C D rD : ZFSet.{u}) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (I : Type v) [Preorder I] where + stage : I → GroundChronologicalMainStage M C D rD + transition : ∀ {i j}, i ≤ j → GroundChronologicalMainTransition (stage i) (stage j) + self : ∀ i, transition (le_refl i) = + GroundChronologicalMainTransition.identity pairing unions powers separation (stage i) + comp : ∀ {i j k} (hij : i ≤ j) (hjk : j ≤ k), transition (le_trans hij hjk) = + (transition hij).comp pairing unions powers separation (transition hjk) + +namespace GroundChronologicalMainDiagram +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Preorder I] + +def CoversOldBirths (diagram : GroundChronologicalMainDiagram M C D rD pairing unions powers separation I) : Prop := + ∀ {i j} (before : i ≤ j), (diagram.transition before).CoversOldBirths + +end GroundChronologicalMainDiagram + +end + +namespace GroundChronologicalMainDiagram +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable {source target : GroundChronologicalMainStage M C D rD} +variable (step : GroundChronologicalMainTransition source target) + +def twoStageStage (source target : GroundChronologicalMainStage M C D rD) : + Fin 2 → GroundChronologicalMainStage M C D rD := + Fin.cases source (fun _ => target) + +noncomputable def twoStageTransition : ∀ {i j : Fin 2}, i ≤ j → + GroundChronologicalMainTransition (twoStageStage source target i) (twoStageStage source target j) := by + intro i j before + cases i using Fin.cases with + | zero => + cases j using Fin.cases with + | zero => exact GroundChronologicalMainTransition.identity pairing unions powers separation source + | succ j => exact step + | succ i => + cases j using Fin.cases with + | zero => exact False.elim (Nat.not_succ_le_zero i.val before) + | succ j => exact GroundChronologicalMainTransition.identity pairing unions powers separation target + +theorem twoStage_index_cases (i : Fin 2) : i = 0 ∨ i = 1 := by + obtain ⟨n, bound⟩ := i + cases n with + | zero => exact Or.inl rfl + | succ n => + have zero : n = 0 := Nat.eq_zero_of_le_zero (Nat.le_of_lt_succ (Nat.lt_of_succ_lt_succ bound)) + subst n + exact Or.inr rfl + +theorem twoStageTransition_self (i : Fin 2) : + twoStageTransition pairing unions powers separation step (le_refl i) = + GroundChronologicalMainTransition.identity pairing unions powers separation (twoStageStage source target i) := by + rcases twoStage_index_cases i with rfl | rfl <;> rfl + +theorem twoStageTransition_comp {i j k : Fin 2} (hij : i ≤ j) (hjk : j ≤ k) : + twoStageTransition pairing unions powers separation step (le_trans hij hjk) = + (twoStageTransition pairing unions powers separation step hij).comp pairing unions powers separation + (twoStageTransition pairing unions powers separation step hjk) := by + rcases twoStage_index_cases i with rfl | rfl <;> + rcases twoStage_index_cases j with rfl | rfl <;> + rcases twoStage_index_cases k with rfl | rfl + · exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation _).symm + · exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation step).symm + · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hjk) + · exact (GroundChronologicalMainTransition.comp_identity pairing unions powers separation step).symm + · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hij) + · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hij) + · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) hjk) + · exact (GroundChronologicalMainTransition.identity_comp pairing unions powers separation _).symm + +noncomputable def twoStage : GroundChronologicalMainDiagram M C D rD pairing unions powers separation (Fin 2) where + stage := twoStageStage source target + transition := twoStageTransition pairing unions powers separation step + self := twoStageTransition_self pairing unions powers separation step + comp := twoStageTransition_comp pairing unions powers separation step + +theorem twoStage_stage_zero : (twoStage pairing unions powers separation step).stage 0 = source := rfl + +theorem twoStage_stage_one : (twoStage pairing unions powers separation step).stage 1 = target := rfl + +theorem twoStage_transition_zero_one : + (twoStage pairing unions powers separation step).transition (show (0 : Fin 2) ≤ 1 from by decide) = step := rfl + +theorem twoStage_coversOldBirths (coverage : step.CoversOldBirths) : + (twoStage pairing unions powers separation step).CoversOldBirths := by + intro i j before + rcases twoStage_index_cases i with rfl | rfl <;> rcases twoStage_index_cases j with rfl | rfl + · exact GroundChronologicalMainTransition.identity_coversOldBirths pairing unions powers separation source + · exact coverage + · exact False.elim ((by decide : ¬ (1 : Fin 2) ≤ 0) before) + · exact GroundChronologicalMainTransition.identity_coversOldBirths pairing unions powers separation target + +end GroundChronologicalMainDiagram + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/HeightTower.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/HeightTower.lean index 69140e5c84066cbdcdcaa0a5eae51454a0fd0af8..3fcf80a82d818ce3db04c60f5a976af0fe7b7753 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/HeightTower.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/HeightTower.lean @@ -1,140 +1,140 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.HeightAttachment - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u v w - -structure IntervalHeights {A : Type u} {Column : Type v} {Coord : Type w} (P : MeetOrder A) - (R : HeightOrder (Column × Coord)) where - assign : ∀ lo hi, R.lt lo hi → StrictHeight P R - lower : ∀ lo hi (gap : R.lt lo hi) x, R.lt lo ((assign lo hi gap).value x) - upper : ∀ lo hi (gap : R.lt lo hi) x, R.lt ((assign lo hi gap).value x) hi - column : ∀ lo hi (gap : R.lt lo hi) x, ((assign lo hi gap).value x).1 = lo.1 - -def CountableRange {A : Type u} {B : Type v} (value : A → B) : Prop := - ∃ code : A → Nat, ∀ x y, code x = code y → value x = value y - -namespace TaskSystem - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - {Column : Type v} {Coord : Type w} {R : HeightOrder (Column × Coord)} - (intervals : IntervalHeights P R) - -theorem height_gap (n : Nat) (old : StrictHeight (f.order n) R) - (i : (f.stages n).Components) : - R.lt (old.value ((f.stages n).batch.base i)) (old.value ((f.stages n).batch.separator i)) := by - apply old.strict _ _ ((f.stages n).batch.base_le_separator i) - intro eq - apply (f.stages n).batch.separator_not_le_base i - rw [eq] - exact (f.order n).refl _ - -noncomputable def componentHeight (n : Nat) (old : StrictHeight (f.order n) R) - (i : (f.stages n).Components) : StrictHeight ((f.stages n).batch.order i) R := - (intervals.assign (old.value ((f.stages n).batch.base i)) - (old.value ((f.stages n).batch.separator i)) (f.height_gap n old i)).precompose - (f.templateOriginal n i).toMeetEmbedding - -noncomputable def nextHeight (n : Nat) (old : StrictHeight (f.order n) R) : - StrictHeight (f.order (n + 1)) R := - AttachmentHeight.extend (f.stages n).batch old (f.componentHeight intervals n old) - (fun x => intervals.lower _ _ (f.height_gap n old x.1) ((f.templateOriginal n x.1).toFun x.2.val)) - (fun x => intervals.upper _ _ (f.height_gap n old x.1) ((f.templateOriginal n x.1).toFun x.2.val)) - -theorem nextHeight_old (n : Nat) (old : StrictHeight (f.order n) R) (x : f.Point n) : - (f.nextHeight intervals n old).value ((f.step n).toFun x) = old.value x := rfl - -theorem nextHeight_column (n : Nat) (old : StrictHeight (f.order n) R) - (x : (f.stages n).batch.Fresh) : - ((f.nextHeight intervals n old).value (.inr x)).1 = - (old.value ((f.stages n).batch.base x.1)).1 := - intervals.column _ _ (f.height_gap n old x.1) ((f.templateOriginal n x.1).toFun x.2.val) - -noncomputable def heightStages (seed : StrictHeight P R) : - (n : Nat) → StrictHeight (f.order n) R - | 0 => seed - | n + 1 => f.nextHeight intervals n (heightStages seed n) - -theorem heightStages_step (seed : StrictHeight P R) (n : Nat) (x : f.Point n) : - (f.heightStages intervals seed (n + 1)).value ((f.step n).toFun x) = - (f.heightStages intervals seed n).value x := rfl - -theorem heightStages_original (seed : StrictHeight P R) (n : Nat) (x : A) : - (f.heightStages intervals seed n).value ((f.origin n).toFun x) = seed.value x := by - induction n with - | zero => rfl - | succ n ih => rw [← f.origins_coherent, f.heightStages_step, ih] - -theorem heightStages_column (seed : StrictHeight P R) (n : Nat) (x : f.Point n) : - ∃ a : A, ((f.heightStages intervals seed n).value x).1 = (seed.value a).1 := by - induction n with - | zero => exact ⟨x, rfl⟩ - | succ n ih => - cases x with - | inl x => exact ih x - | inr x => - rcases ih ((f.stages n).batch.base x.1) with ⟨a, ha⟩ - exact ⟨a, (f.nextHeight_column intervals n _ x).trans ha⟩ - -noncomputable def unionHeightValue (seed : StrictHeight P R) : f.Union → Column × Coord - | .inl a => seed.value a - | .inr ⟨n, x⟩ => (f.heightStages intervals seed (n + 1)).value (.inr x) - -theorem unionHeight_inclusion (seed : StrictHeight P R) (n : Nat) (x : f.Point n) : - f.unionHeightValue intervals seed (f.inclusion n x) = - (f.heightStages intervals seed n).value x := by - induction n with - | zero => rfl - | succ n ih => - cases x with - | inl x => exact ih x - | inr x => rfl - -noncomputable def unionHeight (seed : StrictHeight P R) : StrictHeight f.unionOrder R where - value := f.unionHeightValue intervals seed - strict x y lower different := by - rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ - rw [f.unionHeight_inclusion, f.unionHeight_inclusion] - exact (f.heightStages intervals seed n).strict a b - (((f.inclusionEmbedding n).le_iff a b).mp lower) - (fun eq => different (congrArg (f.inclusion n) eq)) - -theorem unionHeight_original (seed : StrictHeight P R) (x : A) : - (f.unionHeight intervals seed).value (f.originalEmbedding.toFun x) = seed.value x := rfl - -theorem unionHeight_bounded (seed : StrictHeight P R) (x : f.Union) : - R.Weak ((f.unionHeight intervals seed).value x) (seed.value f.top) := - (f.unionHeight intervals seed).mono (f.union_top x) - -theorem unionHeight_column (seed : StrictHeight P R) (x : f.Union) : - ∃ a : A, ((f.unionHeight intervals seed).value x).1 = (seed.value a).1 := by - rcases f.union_cover x with ⟨n, a, rfl⟩ - change ∃ b, (f.unionHeightValue intervals seed (f.inclusion n a)).1 = (seed.value b).1 - rw [f.unionHeight_inclusion] - exact f.heightStages_column intervals seed n a - -theorem unionHeight_countable (seed : StrictHeight P R) (seed_countable : CountableRange seed.value) - (coordCode : Coord → Nat) (coord_injective : ∀ x y, coordCode x = coordCode y → x = y) : - CountableRange (f.unionHeight intervals seed).value := by - classical - rcases seed_countable with ⟨seedCode, seed_equal⟩ - let source : f.Union → A := fun x => Classical.choose (f.unionHeight_column intervals seed x) - have column : ∀ x, ((f.unionHeight intervals seed).value x).1 = (seed.value (source x)).1 := - fun x => Classical.choose_spec (f.unionHeight_column intervals seed x) - refine ⟨fun x => natPair (seedCode (source x)) (coordCode ((f.unionHeight intervals seed).value x).2), ?_⟩ - intro x y eq - have parts := natPair_injective eq - apply Prod.ext - · exact (column x).trans ((congrArg Prod.fst (seed_equal _ _ parts.1)).trans (column y).symm) - · exact coord_injective _ _ parts.2 - -end TaskSystem -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.HeightAttachment + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u v w + +structure IntervalHeights {A : Type u} {Column : Type v} {Coord : Type w} (P : MeetOrder A) + (R : HeightOrder (Column × Coord)) where + assign : ∀ lo hi, R.lt lo hi → StrictHeight P R + lower : ∀ lo hi (gap : R.lt lo hi) x, R.lt lo ((assign lo hi gap).value x) + upper : ∀ lo hi (gap : R.lt lo hi) x, R.lt ((assign lo hi gap).value x) hi + column : ∀ lo hi (gap : R.lt lo hi) x, ((assign lo hi gap).value x).1 = lo.1 + +def CountableRange {A : Type u} {B : Type v} (value : A → B) : Prop := + ∃ code : A → Nat, ∀ x y, code x = code y → value x = value y + +namespace TaskSystem + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + {Column : Type v} {Coord : Type w} {R : HeightOrder (Column × Coord)} + (intervals : IntervalHeights P R) + +theorem height_gap (n : Nat) (old : StrictHeight (f.order n) R) + (i : (f.stages n).Components) : + R.lt (old.value ((f.stages n).batch.base i)) (old.value ((f.stages n).batch.separator i)) := by + apply old.strict _ _ ((f.stages n).batch.base_le_separator i) + intro eq + apply (f.stages n).batch.separator_not_le_base i + rw [eq] + exact (f.order n).refl _ + +noncomputable def componentHeight (n : Nat) (old : StrictHeight (f.order n) R) + (i : (f.stages n).Components) : StrictHeight ((f.stages n).batch.order i) R := + (intervals.assign (old.value ((f.stages n).batch.base i)) + (old.value ((f.stages n).batch.separator i)) (f.height_gap n old i)).precompose + (f.templateOriginal n i).toMeetEmbedding + +noncomputable def nextHeight (n : Nat) (old : StrictHeight (f.order n) R) : + StrictHeight (f.order (n + 1)) R := + AttachmentHeight.extend (f.stages n).batch old (f.componentHeight intervals n old) + (fun x => intervals.lower _ _ (f.height_gap n old x.1) ((f.templateOriginal n x.1).toFun x.2.val)) + (fun x => intervals.upper _ _ (f.height_gap n old x.1) ((f.templateOriginal n x.1).toFun x.2.val)) + +theorem nextHeight_old (n : Nat) (old : StrictHeight (f.order n) R) (x : f.Point n) : + (f.nextHeight intervals n old).value ((f.step n).toFun x) = old.value x := rfl + +theorem nextHeight_column (n : Nat) (old : StrictHeight (f.order n) R) + (x : (f.stages n).batch.Fresh) : + ((f.nextHeight intervals n old).value (.inr x)).1 = + (old.value ((f.stages n).batch.base x.1)).1 := + intervals.column _ _ (f.height_gap n old x.1) ((f.templateOriginal n x.1).toFun x.2.val) + +noncomputable def heightStages (seed : StrictHeight P R) : + (n : Nat) → StrictHeight (f.order n) R + | 0 => seed + | n + 1 => f.nextHeight intervals n (heightStages seed n) + +theorem heightStages_step (seed : StrictHeight P R) (n : Nat) (x : f.Point n) : + (f.heightStages intervals seed (n + 1)).value ((f.step n).toFun x) = + (f.heightStages intervals seed n).value x := rfl + +theorem heightStages_original (seed : StrictHeight P R) (n : Nat) (x : A) : + (f.heightStages intervals seed n).value ((f.origin n).toFun x) = seed.value x := by + induction n with + | zero => rfl + | succ n ih => rw [← f.origins_coherent, f.heightStages_step, ih] + +theorem heightStages_column (seed : StrictHeight P R) (n : Nat) (x : f.Point n) : + ∃ a : A, ((f.heightStages intervals seed n).value x).1 = (seed.value a).1 := by + induction n with + | zero => exact ⟨x, rfl⟩ + | succ n ih => + cases x with + | inl x => exact ih x + | inr x => + rcases ih ((f.stages n).batch.base x.1) with ⟨a, ha⟩ + exact ⟨a, (f.nextHeight_column intervals n _ x).trans ha⟩ + +noncomputable def unionHeightValue (seed : StrictHeight P R) : f.Union → Column × Coord + | .inl a => seed.value a + | .inr ⟨n, x⟩ => (f.heightStages intervals seed (n + 1)).value (.inr x) + +theorem unionHeight_inclusion (seed : StrictHeight P R) (n : Nat) (x : f.Point n) : + f.unionHeightValue intervals seed (f.inclusion n x) = + (f.heightStages intervals seed n).value x := by + induction n with + | zero => rfl + | succ n ih => + cases x with + | inl x => exact ih x + | inr x => rfl + +noncomputable def unionHeight (seed : StrictHeight P R) : StrictHeight f.unionOrder R where + value := f.unionHeightValue intervals seed + strict x y lower different := by + rcases f.pair_cover x y with ⟨n, a, b, rfl, rfl⟩ + rw [f.unionHeight_inclusion, f.unionHeight_inclusion] + exact (f.heightStages intervals seed n).strict a b + (((f.inclusionEmbedding n).le_iff a b).mp lower) + (fun eq => different (congrArg (f.inclusion n) eq)) + +theorem unionHeight_original (seed : StrictHeight P R) (x : A) : + (f.unionHeight intervals seed).value (f.originalEmbedding.toFun x) = seed.value x := rfl + +theorem unionHeight_bounded (seed : StrictHeight P R) (x : f.Union) : + R.Weak ((f.unionHeight intervals seed).value x) (seed.value f.top) := + (f.unionHeight intervals seed).mono (f.union_top x) + +theorem unionHeight_column (seed : StrictHeight P R) (x : f.Union) : + ∃ a : A, ((f.unionHeight intervals seed).value x).1 = (seed.value a).1 := by + rcases f.union_cover x with ⟨n, a, rfl⟩ + change ∃ b, (f.unionHeightValue intervals seed (f.inclusion n a)).1 = (seed.value b).1 + rw [f.unionHeight_inclusion] + exact f.heightStages_column intervals seed n a + +theorem unionHeight_countable (seed : StrictHeight P R) (seed_countable : CountableRange seed.value) + (coordCode : Coord → Nat) (coord_injective : ∀ x y, coordCode x = coordCode y → x = y) : + CountableRange (f.unionHeight intervals seed).value := by + classical + rcases seed_countable with ⟨seedCode, seed_equal⟩ + let source : f.Union → A := fun x => Classical.choose (f.unionHeight_column intervals seed x) + have column : ∀ x, ((f.unionHeight intervals seed).value x).1 = (seed.value (source x)).1 := + fun x => Classical.choose_spec (f.unionHeight_column intervals seed x) + refine ⟨fun x => natPair (seedCode (source x)) (coordCode ((f.unionHeight intervals seed).value x).2), ?_⟩ + intro x y eq + have parts := natPair_injective eq + apply Prod.ext + · exact (column x).trans ((congrArg Prod.fst (seed_equal _ _ parts.1)).trans (column y).symm) + · exact coord_injective _ _ parts.2 + +end TaskSystem +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InaccessibleBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InaccessibleBounds.lean index 39ab2771fb60631332ecacf8104b961ba8943a47..caffd31a3c7c5acc0c8d91f403815a5a4d8ac50c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InaccessibleBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InaccessibleBounds.lean @@ -1,202 +1,202 @@ -import Mathlib.SetTheory.Cardinal.Arithmetic -import Mathlib.SetTheory.Cardinal.Regular -import OAI.SetTheory.PartitionPrinciple.Geometry.RationalOrderBounds - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u v w - -namespace LinearHeightOrder - -variable {Column : Type v} {Coord : Type w} - -def lex (C : LinearHeightOrder Column) (D : LinearHeightOrder Coord) : - LinearHeightOrder (Column × Coord) where - lt x y := C.lt x.1 y.1 ∨ x.1 = y.1 ∧ D.lt x.2 y.2 - irrefl x h := by - rcases h with h | ⟨_, h⟩ - · exact C.irrefl x.1 h - · exact D.irrefl x.2 h - trans h h' := by - rcases h with h | ⟨eq, h⟩ - · rcases h' with h' | ⟨eq, _⟩ - · exact Or.inl (C.trans h h') - · exact Or.inl (eq ▸ h) - · rcases h' with h' | ⟨eq', h'⟩ - · exact Or.inl (eq ▸ h') - · exact Or.inr ⟨eq.trans eq', D.trans h h'⟩ - compare x y := by - rcases C.compare x.1 y.1 with h | eq | h - · exact Or.inl (Or.inl h) - · rcases D.compare x.2 y.2 with h | eq' | h - · exact Or.inl (Or.inr ⟨eq, h⟩) - · exact Or.inr (Or.inl (Prod.ext eq eq')) - · exact Or.inr (Or.inr (Or.inr ⟨eq.symm, h⟩)) - · exact Or.inr (Or.inr (Or.inl h)) - -end LinearHeightOrder - -namespace RationalHeights - -variable {A : Type u} {Column : Type v} {P : MeetOrder A} - (C : LinearHeightOrder Column) - -def lexOrder : LinearHeightOrder (Column × Rational) := C.lex Rational.order.toLinearHeightOrder - -theorem local_assignment (seed : StrictHeight P (lexOrder C).toHeightOrder) - (base : A) (countable : CountableRange seed.value) - (lo hi : Column × Rational) (gap : (lexOrder C).lt lo hi) : - ∃ height : StrictHeight P (lexOrder C).toHeightOrder, - (∀ x, (lexOrder C).lt lo (height.value x)) ∧ - (∀ x, (lexOrder C).lt (height.value x) hi) ∧ - (∀ x, (height.value x).1 = lo.1) := by - have construct (upper : Rational) (qgap : Rational.lt lo.2 upper) - (upper_ok : ∀ q, Rational.lt q upper → (lexOrder C).lt (lo.1, q) hi) : - ∃ height : StrictHeight P (lexOrder C).toHeightOrder, - (∀ x, (lexOrder C).lt lo (height.value x)) ∧ - (∀ x, (lexOrder C).lt (height.value x) hi) ∧ - (∀ x, (height.value x).1 = lo.1) := by - rcases countable_range_interpolation (lexOrder C) Rational.order seed.value - base countable lo.2 upper qgap with ⟨assign, bounds, strict, _⟩ - let height : StrictHeight P (lexOrder C).toHeightOrder := { - value := fun x => (lo.1, assign x) - strict := fun x y lower different => Or.inr ⟨rfl, strict x y (seed.strict x y lower different)⟩ } - exact ⟨height, fun x => Or.inr ⟨rfl, (bounds x).1⟩, - fun x => upper_ok (assign x) (bounds x).2, fun _ => rfl⟩ - rcases gap with columns | ⟨same, coordinates⟩ - · rcases Rational.unbounded_above lo.2 with ⟨upper, qupper⟩ - exact construct upper qupper (fun _ _ => Or.inl columns) - · exact construct hi.2 coordinates (fun _ h => Or.inr ⟨same, h⟩) - -noncomputable def intervalHeights (seed : StrictHeight P (lexOrder C).toHeightOrder) - (base : A) (countable : CountableRange seed.value) : - IntervalHeights P (lexOrder C).toHeightOrder where - assign lo hi gap := Classical.choose (local_assignment C seed base countable lo hi gap) - lower lo hi gap := (Classical.choose_spec (local_assignment C seed base countable lo hi gap)).1 - upper lo hi gap := (Classical.choose_spec (local_assignment C seed base countable lo hi gap)).2.1 - column lo hi gap := (Classical.choose_spec (local_assignment C seed base countable lo hi gap)).2.2 - -end RationalHeights - -namespace TaskSystem - -open RationalHeights - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - {Column : Type v} (C : LinearHeightOrder Column) - (seed : StrictHeight P (lexOrder C).toHeightOrder) (countable : CountableRange seed.value) - -noncomputable def rationalUnionHeight : StrictHeight f.unionOrder (lexOrder C).toHeightOrder := - f.unionHeight (intervalHeights C seed f.top countable) seed - -theorem rationalUnionHeight_original (x : A) : - (f.rationalUnionHeight C seed countable).value (f.originalEmbedding.toFun x) = seed.value x := rfl - -theorem rationalUnionHeight_bounded (x : f.Union) : - (lexOrder C).Weak ((f.rationalUnionHeight C seed countable).value x) (seed.value f.top) := - f.unionHeight_bounded (intervalHeights C seed f.top countable) seed x - -theorem rationalUnionHeight_countable : CountableRange (f.rationalUnionHeight C seed countable).value := - f.unionHeight_countable (intervalHeights C seed f.top countable) seed countable - Rational.code Rational.code_injective - -include countable in - -theorem rational_height_extension : - ∃ height : StrictHeight f.unionOrder (lexOrder C).toHeightOrder, - (∀ x, height.value (f.originalEmbedding.toFun x) = seed.value x) ∧ - CountableRange height.value ∧ - (∀ x, (lexOrder C).Weak (height.value x) (seed.value f.top)) := - ⟨f.rationalUnionHeight C seed countable, f.rationalUnionHeight_original C seed countable, - f.rationalUnionHeight_countable C seed countable, f.rationalUnionHeight_bounded C seed countable⟩ - -end TaskSystem - -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem - -open Cardinal -open scoped Cardinal - -universe u - -variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) - -theorem union_cardinal_bound : #f.Union ≤ max ℵ₀ (max #Task #A) := by - let bound : Cardinal.{u} := max ℵ₀ (max #Task #A) - have infinite : ℵ₀ ≤ bound := le_max_left _ _ - have task : #Task ≤ bound := (le_max_left _ _).trans (le_max_right _ _) - have original : #A ≤ bound := (le_max_right _ _).trans (le_max_right _ _) - have words : #(List Task) ≤ bound := (mk_list_le_max Task).trans (max_le infinite task) - have code : #f.Union ≤ #(List Task × A) := - mk_le_of_injective (fun {x y} h => f.nodeCode_injective x y h) - calc - #f.Union ≤ #(List Task × A) := code - _ = #(List Task) * #A := by simp only [mk_prod, lift_id] - _ ≤ bound * bound := mul_le_mul' words original - _ = bound := mul_eq_self infinite - -theorem union_cardinal_lt (κ : Cardinal.{u}) (uncountable : ℵ₀ < κ) - (original : #A < κ) (tasks : #Task < κ) : #f.Union < κ := - (f.union_cardinal_bound).trans_lt (max_lt uncountable (max_lt tasks original)) - -end PartitionPilot.Compression.RecursiveMaps.TaskSystem - - - -namespace PartitionPilot.Compression.RecursiveMaps.SizeBounds - -open Cardinal -open scoped Cardinal -universe u -variable (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) -variable {A B I : Type u} -include inaccessible - -theorem countable_lt [Countable A] : #A < κ := (mk_le_aleph0 (α := A)).trans_lt inaccessible.1 - -theorem prod_lt (left : #A < κ) (right : #B < κ) : #(A × B) < κ := by - rw [mk_prod, lift_id, lift_id] - exact mul_lt_of_lt inaccessible.1.le left right - -theorem sum_lt (left : #A < κ) (right : #B < κ) : #(A ⊕ B) < κ := by - rw [mk_sum, lift_id, lift_id] - exact add_lt_of_lt inaccessible.1.le left right - -theorem option_lt (small : #A < κ) : #(Option A) < κ := by - rw [mk_option] - exact add_lt_of_lt inaccessible.1.le small (one_lt_aleph0.trans inaccessible.1) - -theorem list_lt (small : #A < κ) : #(List A) < κ := - (mk_list_le_max A).trans_lt (max_lt inaccessible.1 small) - -theorem sets_lt (small : #A < κ) : #(Set A) < κ := by - rw [mk_set] - exact inaccessible.isStrongPrelimit small - -omit inaccessible in -theorem subtype_lt (small : #A < κ) (p : A → Prop) : #(Subtype p) < κ := - (mk_subtype_le p).trans_lt small - -theorem sigma_lt (small : #I < κ) (B : I → Type u) (fibers : ∀ i, #(B i) < κ) : - #(Sigma B) < κ := by - rw [mk_sigma] - exact sum_lt_of_isRegular inaccessible.isRegular small fibers - -theorem image_cover_lt (small : #I < κ) (B : I → Type u) (fibers : ∀ i, #(B i) < κ) - (map : ∀ i, B i → A) (cover : ∀ x, ∃ i y, map i y = x) : #A < κ := by - have onto : Function.Surjective (fun x : Sigma B => map x.1 x.2) := by - intro x - rcases cover x with ⟨i, y, eq⟩ - exact ⟨⟨i, y⟩, eq⟩ - exact (mk_le_of_surjective onto).trans_lt (sigma_lt κ inaccessible small B fibers) - -end PartitionPilot.Compression.RecursiveMaps.SizeBounds - -end OAI +import Mathlib.SetTheory.Cardinal.Arithmetic +import Mathlib.SetTheory.Cardinal.Regular +import OAI.SetTheory.PartitionPrinciple.Geometry.RationalOrderBounds + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u v w + +namespace LinearHeightOrder + +variable {Column : Type v} {Coord : Type w} + +def lex (C : LinearHeightOrder Column) (D : LinearHeightOrder Coord) : + LinearHeightOrder (Column × Coord) where + lt x y := C.lt x.1 y.1 ∨ x.1 = y.1 ∧ D.lt x.2 y.2 + irrefl x h := by + rcases h with h | ⟨_, h⟩ + · exact C.irrefl x.1 h + · exact D.irrefl x.2 h + trans h h' := by + rcases h with h | ⟨eq, h⟩ + · rcases h' with h' | ⟨eq, _⟩ + · exact Or.inl (C.trans h h') + · exact Or.inl (eq ▸ h) + · rcases h' with h' | ⟨eq', h'⟩ + · exact Or.inl (eq ▸ h') + · exact Or.inr ⟨eq.trans eq', D.trans h h'⟩ + compare x y := by + rcases C.compare x.1 y.1 with h | eq | h + · exact Or.inl (Or.inl h) + · rcases D.compare x.2 y.2 with h | eq' | h + · exact Or.inl (Or.inr ⟨eq, h⟩) + · exact Or.inr (Or.inl (Prod.ext eq eq')) + · exact Or.inr (Or.inr (Or.inr ⟨eq.symm, h⟩)) + · exact Or.inr (Or.inr (Or.inl h)) + +end LinearHeightOrder + +namespace RationalHeights + +variable {A : Type u} {Column : Type v} {P : MeetOrder A} + (C : LinearHeightOrder Column) + +def lexOrder : LinearHeightOrder (Column × Rational) := C.lex Rational.order.toLinearHeightOrder + +theorem local_assignment (seed : StrictHeight P (lexOrder C).toHeightOrder) + (base : A) (countable : CountableRange seed.value) + (lo hi : Column × Rational) (gap : (lexOrder C).lt lo hi) : + ∃ height : StrictHeight P (lexOrder C).toHeightOrder, + (∀ x, (lexOrder C).lt lo (height.value x)) ∧ + (∀ x, (lexOrder C).lt (height.value x) hi) ∧ + (∀ x, (height.value x).1 = lo.1) := by + have construct (upper : Rational) (qgap : Rational.lt lo.2 upper) + (upper_ok : ∀ q, Rational.lt q upper → (lexOrder C).lt (lo.1, q) hi) : + ∃ height : StrictHeight P (lexOrder C).toHeightOrder, + (∀ x, (lexOrder C).lt lo (height.value x)) ∧ + (∀ x, (lexOrder C).lt (height.value x) hi) ∧ + (∀ x, (height.value x).1 = lo.1) := by + rcases countable_range_interpolation (lexOrder C) Rational.order seed.value + base countable lo.2 upper qgap with ⟨assign, bounds, strict, _⟩ + let height : StrictHeight P (lexOrder C).toHeightOrder := { + value := fun x => (lo.1, assign x) + strict := fun x y lower different => Or.inr ⟨rfl, strict x y (seed.strict x y lower different)⟩ } + exact ⟨height, fun x => Or.inr ⟨rfl, (bounds x).1⟩, + fun x => upper_ok (assign x) (bounds x).2, fun _ => rfl⟩ + rcases gap with columns | ⟨same, coordinates⟩ + · rcases Rational.unbounded_above lo.2 with ⟨upper, qupper⟩ + exact construct upper qupper (fun _ _ => Or.inl columns) + · exact construct hi.2 coordinates (fun _ h => Or.inr ⟨same, h⟩) + +noncomputable def intervalHeights (seed : StrictHeight P (lexOrder C).toHeightOrder) + (base : A) (countable : CountableRange seed.value) : + IntervalHeights P (lexOrder C).toHeightOrder where + assign lo hi gap := Classical.choose (local_assignment C seed base countable lo hi gap) + lower lo hi gap := (Classical.choose_spec (local_assignment C seed base countable lo hi gap)).1 + upper lo hi gap := (Classical.choose_spec (local_assignment C seed base countable lo hi gap)).2.1 + column lo hi gap := (Classical.choose_spec (local_assignment C seed base countable lo hi gap)).2.2 + +end RationalHeights + +namespace TaskSystem + +open RationalHeights + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + {Column : Type v} (C : LinearHeightOrder Column) + (seed : StrictHeight P (lexOrder C).toHeightOrder) (countable : CountableRange seed.value) + +noncomputable def rationalUnionHeight : StrictHeight f.unionOrder (lexOrder C).toHeightOrder := + f.unionHeight (intervalHeights C seed f.top countable) seed + +theorem rationalUnionHeight_original (x : A) : + (f.rationalUnionHeight C seed countable).value (f.originalEmbedding.toFun x) = seed.value x := rfl + +theorem rationalUnionHeight_bounded (x : f.Union) : + (lexOrder C).Weak ((f.rationalUnionHeight C seed countable).value x) (seed.value f.top) := + f.unionHeight_bounded (intervalHeights C seed f.top countable) seed x + +theorem rationalUnionHeight_countable : CountableRange (f.rationalUnionHeight C seed countable).value := + f.unionHeight_countable (intervalHeights C seed f.top countable) seed countable + Rational.code Rational.code_injective + +include countable in + +theorem rational_height_extension : + ∃ height : StrictHeight f.unionOrder (lexOrder C).toHeightOrder, + (∀ x, height.value (f.originalEmbedding.toFun x) = seed.value x) ∧ + CountableRange height.value ∧ + (∀ x, (lexOrder C).Weak (height.value x) (seed.value f.top)) := + ⟨f.rationalUnionHeight C seed countable, f.rationalUnionHeight_original C seed countable, + f.rationalUnionHeight_countable C seed countable, f.rationalUnionHeight_bounded C seed countable⟩ + +end TaskSystem + +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps.TaskSystem + +open Cardinal +open scoped Cardinal + +universe u + +variable {A G Task Label : Type u} {P : MeetOrder A} (f : TaskSystem P G Task Label) + +theorem union_cardinal_bound : #f.Union ≤ max ℵ₀ (max #Task #A) := by + let bound : Cardinal.{u} := max ℵ₀ (max #Task #A) + have infinite : ℵ₀ ≤ bound := le_max_left _ _ + have task : #Task ≤ bound := (le_max_left _ _).trans (le_max_right _ _) + have original : #A ≤ bound := (le_max_right _ _).trans (le_max_right _ _) + have words : #(List Task) ≤ bound := (mk_list_le_max Task).trans (max_le infinite task) + have code : #f.Union ≤ #(List Task × A) := + mk_le_of_injective (fun {x y} h => f.nodeCode_injective x y h) + calc + #f.Union ≤ #(List Task × A) := code + _ = #(List Task) * #A := by simp only [mk_prod, lift_id] + _ ≤ bound * bound := mul_le_mul' words original + _ = bound := mul_eq_self infinite + +theorem union_cardinal_lt (κ : Cardinal.{u}) (uncountable : ℵ₀ < κ) + (original : #A < κ) (tasks : #Task < κ) : #f.Union < κ := + (f.union_cardinal_bound).trans_lt (max_lt uncountable (max_lt tasks original)) + +end PartitionPilot.Compression.RecursiveMaps.TaskSystem + + + +namespace PartitionPilot.Compression.RecursiveMaps.SizeBounds + +open Cardinal +open scoped Cardinal +universe u +variable (κ : Cardinal.{u}) (inaccessible : κ.IsInaccessible) +variable {A B I : Type u} +include inaccessible + +theorem countable_lt [Countable A] : #A < κ := (mk_le_aleph0 (α := A)).trans_lt inaccessible.1 + +theorem prod_lt (left : #A < κ) (right : #B < κ) : #(A × B) < κ := by + rw [mk_prod, lift_id, lift_id] + exact mul_lt_of_lt inaccessible.1.le left right + +theorem sum_lt (left : #A < κ) (right : #B < κ) : #(A ⊕ B) < κ := by + rw [mk_sum, lift_id, lift_id] + exact add_lt_of_lt inaccessible.1.le left right + +theorem option_lt (small : #A < κ) : #(Option A) < κ := by + rw [mk_option] + exact add_lt_of_lt inaccessible.1.le small (one_lt_aleph0.trans inaccessible.1) + +theorem list_lt (small : #A < κ) : #(List A) < κ := + (mk_list_le_max A).trans_lt (max_lt inaccessible.1 small) + +theorem sets_lt (small : #A < κ) : #(Set A) < κ := by + rw [mk_set] + exact inaccessible.isStrongPrelimit small + +omit inaccessible in +theorem subtype_lt (small : #A < κ) (p : A → Prop) : #(Subtype p) < κ := + (mk_subtype_le p).trans_lt small + +theorem sigma_lt (small : #I < κ) (B : I → Type u) (fibers : ∀ i, #(B i) < κ) : + #(Sigma B) < κ := by + rw [mk_sigma] + exact sum_lt_of_isRegular inaccessible.isRegular small fibers + +theorem image_cover_lt (small : #I < κ) (B : I → Type u) (fibers : ∀ i, #(B i) < κ) + (map : ∀ i, B i → A) (cover : ∀ x, ∃ i y, map i y = x) : #A < κ := by + have onto : Function.Surjective (fun x : Sigma B => map x.1 x.2) := by + intro x + rcases cover x with ⟨i, y, eq⟩ + exact ⟨⟨i, y⟩, eq⟩ + exact (mk_le_of_surjective onto).trans_lt (sigma_lt κ inaccessible small B fibers) + +end PartitionPilot.Compression.RecursiveMaps.SizeBounds + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InitialRecursiveTaskLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InitialRecursiveTaskLaws.lean index dadde8db698cd8f6f60c323eb2e71ba0c6b13a41..32728a5fcb113ab7f833e62a5fa40fe960c8dbbc 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InitialRecursiveTaskLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/InitialRecursiveTaskLaws.lean @@ -1,182 +1,182 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.InitialRepresentativeAgreement - -namespace OAI - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem exists_groundInitialRecursiveInputs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {P G r μ A Labels m inv one : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) - As (literalTaskBaseGraph I P R U Labels) - let B := M.groundEligibleBatchAction P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - I ∈ M.sets ∧ As ∈ M.sets ∧ Maps ∈ M.sets ∧ B ∈ M.sets ∧ - ∃ representatives ∈ M.sets, - CodedRecursiveMapInputs d I Maps As representatives G m inv one B := by - obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨hMaps, maps, valid, hB, currentAction, - representatives, ground, function, _, agreement⟩ := - M.exists_groundInitialRepresentatives pairing unions powers separation choice - hP hG hr hμ hA hLabels group action meet - exact ⟨hI, (fields 0).1, hMaps, hB, representatives, ground, - ⟨maps, (fields 0).2, function, group, currentAction, valid, agreement⟩⟩ - -theorem groundInitialMap_cap_base - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one T i S a c : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hT : T ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → - ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → - ZFSet.IsFunc P d.batchCarrier S ∧ - ZFSet.pair T (eligibleTaskCap P T i) ∈ S ∧ ZFSet.pair a c ∈ S := by - dsimp only - intro mapEntry source target - let I := M.groundEligibleTasks P G r μ A Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨_, _, entries⟩ := M.batchEmbeddingFamily_spec - pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 - obtain ⟨hi, mapEq⟩ := (entries i S).1 mapEntry - rw [mapEq] - let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 - have function : ZFSet.IsFunc P d.batchCarrier - (batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) - (literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) - (literalTaskBaseGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) i) := by - simpa only [spaceEq] using d.batch_template_fiber_function j - refine ⟨function, (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 - (M.groundEligibleTask_cap_entry group action meet hT top hi), ?_⟩ - obtain ⟨a', ha, c', hc, base, hb, s, hs, F, hF, label, hl, equal, code⟩ := - (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi - have aEq : a = a' := - ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2 - have cEq : c = c' := - ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 1).1 (equal ▸ target)).2 - have baseEntry : ZFSet.pair i base ∈ literalTaskBaseGraph I P - (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels := by - rw [equal] - exact (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).2 ⟨equal ▸ hi, rfl⟩ - have baseEq : d.embed j = base := d.embeddings.unique (d.embed_entry j) baseEntry - obtain ⟨g, _, represented⟩ := code.representative - have entry : ZFSet.pair a' c' ∈ base := - (represented.entries a' ha c' hc).2 ⟨meet.order.refl a' ha, represented.target_entry⟩ - rw [aEq, cEq] - exact (d.batch_template_old_agreement j (baseEq.symm ▸ entry)).1 - -theorem groundInitialMap_negative_cap - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one T i S a c F K b v w : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) (hT : T ∈ P) - (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → - ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → - ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels → - ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → v ∈ P → v ∉ F → - ZFSet.pair (ZFSet.pair K v) w ∈ d.batchMeetGraph → ZFSet.pair w b ∈ d.batchOrder := by - dsimp only - intro mapEntry source target filter cap base hv negative entry - obtain ⟨function, capEntry, baseEntry⟩ := M.groundInitialMap_cap_base - pairing unions powers separation hP hG hr hμ hA hLabels group action meet hT top - mapEntry source target - obtain ⟨_, _, uniqueCap⟩ := function.2 T hT - have capEq : K = eligibleTaskCap P T i := - (uniqueCap K cap).trans (uniqueCap _ capEntry).symm - have sourceShape := (ZFSet.mem_sep.1 source).1 - have ha := (ZFSet.pair_mem_prod.1 sourceShape).2 - obtain ⟨_, _, uniqueBase⟩ := function.2 a ha - have baseEq : b = c := (uniqueBase b base).trans (uniqueBase c baseEntry).symm - have hi := (ZFSet.pair_mem_prod.1 sourceShape).1 - exact baseEq.symm ▸ (M.groundEligibleTask_negative_cap group action meet hT top hi - target filter hv negative (capEq ▸ entry)).2.2 - -theorem groundInitialTask_source - {P G r μ A Labels δ i j a b : ZFSet.{u}} - (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) - (first : ZFSet.pair i a ∈ literalTaskSourceGraph - (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels) - (second : ZFSet.pair j b ∈ literalTaskSourceGraph - (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels) : a = b := by - have transport := ((triple_mem_taskTransportGraph G - (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) - (M.groundMeetFilters P r μ) Labels A δ i j).1 task).2.2.2 - exact transport.source_eq first second - -theorem groundInitialTask_intertwine - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one δ i j S S' q x y : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) - (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) - (constantFamilyGraph I r) (literalTaskSourceGraph I P R U Labels) - (literalTaskBaseGraph I P R U Labels) - ZFSet.pair i S ∈ Maps → ZFSet.pair j S' ∈ Maps → - ZFSet.pair q x ∈ S → ZFSet.pair q y ∈ S' → - ZFSet.pair (ZFSet.pair δ x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by - dsimp only - intro first second image image' - obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - obtain ⟨_, _, entries⟩ := M.batchEmbeddingFamily_spec - pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 - have firstEq := ((entries i S).1 first).2 - have secondEq := ((entries j S').1 second).2 - exact M.groundEligibleBatchAction_equivariant group action meet task - (firstEq ▸ image) (secondEq ▸ image') - -end PartitionPilot.Forcing.TransitiveGround - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.InitialRepresentativeAgreement + +namespace OAI + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem exists_groundInitialRecursiveInputs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {P G r μ A Labels m inv one : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) + As (literalTaskBaseGraph I P R U Labels) + let B := M.groundEligibleBatchAction P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + I ∈ M.sets ∧ As ∈ M.sets ∧ Maps ∈ M.sets ∧ B ∈ M.sets ∧ + ∃ representatives ∈ M.sets, + CodedRecursiveMapInputs d I Maps As representatives G m inv one B := by + obtain ⟨hI, _, _, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨hMaps, maps, valid, hB, currentAction, + representatives, ground, function, _, agreement⟩ := + M.exists_groundInitialRepresentatives pairing unions powers separation choice + hP hG hr hμ hA hLabels group action meet + exact ⟨hI, (fields 0).1, hMaps, hB, representatives, ground, + ⟨maps, (fields 0).2, function, group, currentAction, valid, agreement⟩⟩ + +theorem groundInitialMap_cap_base + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one T i S a c : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hT : T ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → + ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → + ZFSet.IsFunc P d.batchCarrier S ∧ + ZFSet.pair T (eligibleTaskCap P T i) ∈ S ∧ ZFSet.pair a c ∈ S := by + dsimp only + intro mapEntry source target + let I := M.groundEligibleTasks P G r μ A Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨_, _, entries⟩ := M.batchEmbeddingFamily_spec + pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 + obtain ⟨hi, mapEq⟩ := (entries i S).1 mapEntry + rw [mapEq] + let j : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have spaceEq : d.space j = P := ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry j)).2 + have function : ZFSet.IsFunc P d.batchCarrier + (batchTemplateGraph I P (constantFamilyGraph I P) (constantFamilyGraph I r) + (literalTaskSourceGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) + (literalTaskBaseGraph I P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels) i) := by + simpa only [spaceEq] using d.batch_template_fiber_function j + refine ⟨function, (pair_mem_batchTemplateGraph _ _ _ _ _ _ _ _ _).2 + (M.groundEligibleTask_cap_entry group action meet hT top hi), ?_⟩ + obtain ⟨a', ha, c', hc, base, hb, s, hs, F, hF, label, hl, equal, code⟩ := + (mem_eligibleTaskSet P G r μ A _ _ Labels i).1 hi + have aEq : a = a' := + ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2 + have cEq : c = c' := + ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 1).1 (equal ▸ target)).2 + have baseEntry : ZFSet.pair i base ∈ literalTaskBaseGraph I P + (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels := by + rw [equal] + exact (literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 2).2 ⟨equal ▸ hi, rfl⟩ + have baseEq : d.embed j = base := d.embeddings.unique (d.embed_entry j) baseEntry + obtain ⟨g, _, represented⟩ := code.representative + have entry : ZFSet.pair a' c' ∈ base := + (represented.entries a' ha c' hc).2 ⟨meet.order.refl a' ha, represented.target_entry⟩ + rw [aEq, cEq] + exact (d.batch_template_old_agreement j (baseEq.symm ▸ entry)).1 + +theorem groundInitialMap_negative_cap + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one T i S a c F K b v w : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) (hT : T ∈ P) + (top : ∀ x ∈ P, ZFSet.pair x T ∈ r) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) (constantFamilyGraph I r) As Es + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + ZFSet.pair i S ∈ Maps → ZFSet.pair i a ∈ As → + ZFSet.pair i c ∈ literalTaskTargetGraph I P R U Labels → + ZFSet.pair i F ∈ literalTaskFilterGraph I P R U Labels → + ZFSet.pair T K ∈ S → ZFSet.pair a b ∈ S → v ∈ P → v ∉ F → + ZFSet.pair (ZFSet.pair K v) w ∈ d.batchMeetGraph → ZFSet.pair w b ∈ d.batchOrder := by + dsimp only + intro mapEntry source target filter cap base hv negative entry + obtain ⟨function, capEntry, baseEntry⟩ := M.groundInitialMap_cap_base + pairing unions powers separation hP hG hr hμ hA hLabels group action meet hT top + mapEntry source target + obtain ⟨_, _, uniqueCap⟩ := function.2 T hT + have capEq : K = eligibleTaskCap P T i := + (uniqueCap K cap).trans (uniqueCap _ capEntry).symm + have sourceShape := (ZFSet.mem_sep.1 source).1 + have ha := (ZFSet.pair_mem_prod.1 sourceShape).2 + obtain ⟨_, _, uniqueBase⟩ := function.2 a ha + have baseEq : b = c := (uniqueBase b base).trans (uniqueBase c baseEntry).symm + have hi := (ZFSet.pair_mem_prod.1 sourceShape).1 + exact baseEq.symm ▸ (M.groundEligibleTask_negative_cap group action meet hT top hi + target filter hv negative (capEq ▸ entry)).2.2 + +theorem groundInitialTask_source + {P G r μ A Labels δ i j a b : ZFSet.{u}} + (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) + (first : ZFSet.pair i a ∈ literalTaskSourceGraph + (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels) + (second : ZFSet.pair j b ∈ literalTaskSourceGraph + (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels) : a = b := by + have transport := ((triple_mem_taskTransportGraph G + (M.groundEligibleTasks P G r μ A Labels) P (M.groundRelations P P) + (M.groundMeetFilters P r μ) Labels A δ i j).1 task).2.2.2 + exact transport.source_eq first second + +theorem groundInitialTask_intertwine + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one δ i j S S' q x y : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) + (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Maps := M.batchEmbeddingFamily I P (constantFamilyGraph I P) + (constantFamilyGraph I r) (literalTaskSourceGraph I P R U Labels) + (literalTaskBaseGraph I P R U Labels) + ZFSet.pair i S ∈ Maps → ZFSet.pair j S' ∈ Maps → + ZFSet.pair q x ∈ S → ZFSet.pair q y ∈ S' → + ZFSet.pair (ZFSet.pair δ x) y ∈ M.groundEligibleBatchAction P G r μ A Labels := by + dsimp only + intro first second image image' + obtain ⟨hI, hQs, hrs, _, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + obtain ⟨_, _, entries⟩ := M.batchEmbeddingFamily_spec + pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 + have firstEq := ((entries i S).1 first).2 + have secondEq := ((entries j S').1 second).2 + exact M.groundEligibleBatchAction_equivariant group action meet task + (firstEq ▸ image) (secondEq ▸ image') + +end PartitionPilot.Forcing.TransitiveGround + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitGroup.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitGroup.lean index 521160f00560334e28f0d44d06a2fcbbdc95c920..a7808ba00ba00625b178189986b56173b7d3041e 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitGroup.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitGroup.lean @@ -1,172 +1,172 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.DirectSystem - -namespace OAI - -namespace PartitionPilot.Compression.RecursiveMaps -universe u - -structure MeetSystem (I : Type u) [LinearOrder I] where - system : DirectSystem I - order : ∀ i, MeetOrder (system.Point i) - map_le : ∀ {i j} (h : i ≤ j) x y, - (order j).le (system.map h x) (system.map h y) ↔ (order i).le x y - map_meet : ∀ {i j} (h : i ≤ j) x y, - system.map h ((order i).meet x y) = (order j).meet (system.map h x) (system.map h y) - -namespace MeetSystem -variable {I : Type u} [LinearOrder I] (c : MeetSystem I) - -def transition {i j : I} (h : i ≤ j) : MeetEmbedding (c.order i) (c.order j) where - toFun := c.system.map h - le_iff := c.map_le h - map_meet := c.map_meet h - -def Le (x y : c.system.Union) : Prop := - ∃ i a b, c.system.point i a = x ∧ c.system.point i b = y ∧ (c.order i).le a b - -theorem le_stage (i : I) (a b : c.system.Point i) : - c.Le (c.system.point i a) (c.system.point i b) ↔ (c.order i).le a b := by - constructor - · rintro ⟨j, x, y, hx, hy, lower⟩ - have ex : c.system.map (le_max_right i j) x = c.system.map (le_max_left i j) a := by - apply c.system.point_injective (max i j) - rw [c.system.point_map, c.system.point_map] - exact hx - have ey : c.system.map (le_max_right i j) y = c.system.map (le_max_left i j) b := by - apply c.system.point_injective (max i j) - rw [c.system.point_map, c.system.point_map] - exact hy - have raised := (c.map_le (le_max_right i j) x y).mpr lower - rw [ex, ey] at raised - exact (c.map_le (le_max_left i j) a b).mp raised - · intro lower - exact ⟨i, a, b, rfl, rfl, lower⟩ - -def meet : c.system.Union → c.system.Union → c.system.Union := - c.system.binary c.system c.system (fun i => (c.order i).meet) c.map_meet - -theorem meet_stage (i : I) (a b : c.system.Point i) : - c.meet (c.system.point i a) (c.system.point i b) = c.system.point i ((c.order i).meet a b) := - c.system.binary_point c.system c.system (fun i => (c.order i).meet) c.map_meet i a b - -def unionOrder : MeetOrder c.system.Union where - le := c.Le - meet := c.meet - refl x := by - rcases c.system.cover x with ⟨i, a, rfl⟩ - exact (c.le_stage i a a).mpr ((c.order i).refl a) - trans {x y z} hxy hyz := by - rcases c.system.triple_cover c.system c.system x y z with ⟨i, a, b, t, rfl, rfl, rfl⟩ - exact (c.le_stage i a t).mpr ((c.order i).trans - ((c.le_stage i a b).mp hxy) ((c.le_stage i b t).mp hyz)) - antisymm {x y} hxy hyx := by - rcases c.system.pair_cover c.system x y with ⟨i, a, b, rfl, rfl⟩ - exact congrArg (c.system.point i) ((c.order i).antisymm - ((c.le_stage i a b).mp hxy) ((c.le_stage i b a).mp hyx)) - meet_le_left x y := by - rcases c.system.pair_cover c.system x y with ⟨i, a, b, rfl, rfl⟩ - rw [c.meet_stage] - exact (c.le_stage i _ a).mpr ((c.order i).meet_le_left a b) - meet_le_right x y := by - rcases c.system.pair_cover c.system x y with ⟨i, a, b, rfl, rfl⟩ - rw [c.meet_stage] - exact (c.le_stage i _ b).mpr ((c.order i).meet_le_right a b) - le_meet {z x y} hzx hzy := by - rcases c.system.triple_cover c.system c.system z x y with ⟨i, a, b, t, rfl, rfl, rfl⟩ - rw [c.meet_stage] - exact (c.le_stage i a _).mpr ((c.order i).le_meet - ((c.le_stage i a b).mp hzx) ((c.le_stage i a t).mp hzy)) - -def inclusion (i : I) : MeetEmbedding (c.order i) c.unionOrder where - toFun := c.system.point i - le_iff := c.le_stage i - map_meet x y := (c.meet_stage i x y).symm - -def boundedOrder : MeetOrder (Option c.system.Union) := FixedTop.order c.unionOrder - -def boundedInclusion (i : I) : MeetEmbedding (c.order i) c.boundedOrder := - compose (c.inclusion i) (FixedTop.embedding c.unionOrder).toMeetEmbedding - -theorem bounded_strict_top (i : I) (x : c.system.Point i) : - c.boundedOrder.le ((c.boundedInclusion i).toFun x) none ∧ - ¬ c.boundedOrder.le none ((c.boundedInclusion i).toFun x) := - FixedTop.strict_top c.unionOrder (c.system.point i x) - -end MeetSystem - -structure GroupSystem (I : Type u) [LinearOrder I] where - system : DirectSystem I - [group : ∀ i, Group (system.Point i)] - map_one : ∀ {i j} (h : i ≤ j), system.map h 1 = 1 - map_mul : ∀ {i j} (h : i ≤ j) x y, system.map h (x * y) = system.map h x * system.map h y - -attribute [instance] GroupSystem.group - -namespace GroupSystem -variable {I : Type u} [LinearOrder I] (g : GroupSystem I) - -def transition {i j : I} (h : i ≤ j) : g.system.Point i →* g.system.Point j where - toFun := g.system.map h - map_one' := g.map_one h - map_mul' := g.map_mul h - -theorem map_inv {i j : I} (h : i ≤ j) (x : g.system.Point i) : - g.system.map h x⁻¹ = (g.system.map h x)⁻¹ := (g.transition h).map_inv x - -def mul : g.system.Union → g.system.Union → g.system.Union := - g.system.binary g.system g.system (fun _ x y => x * y) g.map_mul - -theorem mul_point (i : I) (x y : g.system.Point i) : - g.mul (g.system.point i x) (g.system.point i y) = g.system.point i (x * y) := - g.system.binary_point g.system g.system (fun _ x y => x * y) g.map_mul i x y - -def inv : g.system.Union → g.system.Union := - g.system.descend (fun i x => g.system.point i x⁻¹) (by - intro i j h x - rw [← g.map_inv h, g.system.point_map]) - -theorem inv_point (i : I) (x : g.system.Point i) : - g.inv (g.system.point i x) = g.system.point i x⁻¹ := rfl - -variable [Nonempty I] - -noncomputable def one : g.system.Union := g.system.point (Classical.arbitrary I) 1 - -theorem one_point (i : I) : g.one = g.system.point i 1 := by - apply Quotient.sound - exact ⟨max (Classical.arbitrary I) i, le_max_left _ _, le_max_right _ _, - (g.map_one _).trans (g.map_one _).symm⟩ - -noncomputable instance unionGroup : Group g.system.Union where - one := g.one - mul := g.mul - inv := g.inv - mul_assoc x y z := by - change g.mul (g.mul x y) z = g.mul x (g.mul y z) - rcases g.system.triple_cover g.system g.system x y z with ⟨i, a, b, c, rfl, rfl, rfl⟩ - rw [g.mul_point, g.mul_point, g.mul_point, g.mul_point, mul_assoc] - one_mul x := by - change g.mul g.one x = x - rcases g.system.cover x with ⟨i, a, rfl⟩ - rw [g.one_point i, g.mul_point, one_mul] - mul_one x := by - change g.mul x g.one = x - rcases g.system.cover x with ⟨i, a, rfl⟩ - rw [g.one_point i, g.mul_point, mul_one] - inv_mul_cancel x := by - change g.mul (g.inv x) x = g.one - rcases g.system.cover x with ⟨i, a, rfl⟩ - rw [g.inv_point, g.mul_point, inv_mul_cancel, g.one_point i] - -noncomputable def inclusion (i : I) : g.system.Point i →* g.system.Union where - toFun := g.system.point i - map_one' := (g.one_point i).symm - map_mul' x y := (g.mul_point i x y).symm - -theorem inclusion_injective (i : I) : Function.Injective (g.inclusion i) := - g.system.point_injective i - -end GroupSystem -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.DirectSystem + +namespace OAI + +namespace PartitionPilot.Compression.RecursiveMaps +universe u + +structure MeetSystem (I : Type u) [LinearOrder I] where + system : DirectSystem I + order : ∀ i, MeetOrder (system.Point i) + map_le : ∀ {i j} (h : i ≤ j) x y, + (order j).le (system.map h x) (system.map h y) ↔ (order i).le x y + map_meet : ∀ {i j} (h : i ≤ j) x y, + system.map h ((order i).meet x y) = (order j).meet (system.map h x) (system.map h y) + +namespace MeetSystem +variable {I : Type u} [LinearOrder I] (c : MeetSystem I) + +def transition {i j : I} (h : i ≤ j) : MeetEmbedding (c.order i) (c.order j) where + toFun := c.system.map h + le_iff := c.map_le h + map_meet := c.map_meet h + +def Le (x y : c.system.Union) : Prop := + ∃ i a b, c.system.point i a = x ∧ c.system.point i b = y ∧ (c.order i).le a b + +theorem le_stage (i : I) (a b : c.system.Point i) : + c.Le (c.system.point i a) (c.system.point i b) ↔ (c.order i).le a b := by + constructor + · rintro ⟨j, x, y, hx, hy, lower⟩ + have ex : c.system.map (le_max_right i j) x = c.system.map (le_max_left i j) a := by + apply c.system.point_injective (max i j) + rw [c.system.point_map, c.system.point_map] + exact hx + have ey : c.system.map (le_max_right i j) y = c.system.map (le_max_left i j) b := by + apply c.system.point_injective (max i j) + rw [c.system.point_map, c.system.point_map] + exact hy + have raised := (c.map_le (le_max_right i j) x y).mpr lower + rw [ex, ey] at raised + exact (c.map_le (le_max_left i j) a b).mp raised + · intro lower + exact ⟨i, a, b, rfl, rfl, lower⟩ + +def meet : c.system.Union → c.system.Union → c.system.Union := + c.system.binary c.system c.system (fun i => (c.order i).meet) c.map_meet + +theorem meet_stage (i : I) (a b : c.system.Point i) : + c.meet (c.system.point i a) (c.system.point i b) = c.system.point i ((c.order i).meet a b) := + c.system.binary_point c.system c.system (fun i => (c.order i).meet) c.map_meet i a b + +def unionOrder : MeetOrder c.system.Union where + le := c.Le + meet := c.meet + refl x := by + rcases c.system.cover x with ⟨i, a, rfl⟩ + exact (c.le_stage i a a).mpr ((c.order i).refl a) + trans {x y z} hxy hyz := by + rcases c.system.triple_cover c.system c.system x y z with ⟨i, a, b, t, rfl, rfl, rfl⟩ + exact (c.le_stage i a t).mpr ((c.order i).trans + ((c.le_stage i a b).mp hxy) ((c.le_stage i b t).mp hyz)) + antisymm {x y} hxy hyx := by + rcases c.system.pair_cover c.system x y with ⟨i, a, b, rfl, rfl⟩ + exact congrArg (c.system.point i) ((c.order i).antisymm + ((c.le_stage i a b).mp hxy) ((c.le_stage i b a).mp hyx)) + meet_le_left x y := by + rcases c.system.pair_cover c.system x y with ⟨i, a, b, rfl, rfl⟩ + rw [c.meet_stage] + exact (c.le_stage i _ a).mpr ((c.order i).meet_le_left a b) + meet_le_right x y := by + rcases c.system.pair_cover c.system x y with ⟨i, a, b, rfl, rfl⟩ + rw [c.meet_stage] + exact (c.le_stage i _ b).mpr ((c.order i).meet_le_right a b) + le_meet {z x y} hzx hzy := by + rcases c.system.triple_cover c.system c.system z x y with ⟨i, a, b, t, rfl, rfl, rfl⟩ + rw [c.meet_stage] + exact (c.le_stage i a _).mpr ((c.order i).le_meet + ((c.le_stage i a b).mp hzx) ((c.le_stage i a t).mp hzy)) + +def inclusion (i : I) : MeetEmbedding (c.order i) c.unionOrder where + toFun := c.system.point i + le_iff := c.le_stage i + map_meet x y := (c.meet_stage i x y).symm + +def boundedOrder : MeetOrder (Option c.system.Union) := FixedTop.order c.unionOrder + +def boundedInclusion (i : I) : MeetEmbedding (c.order i) c.boundedOrder := + compose (c.inclusion i) (FixedTop.embedding c.unionOrder).toMeetEmbedding + +theorem bounded_strict_top (i : I) (x : c.system.Point i) : + c.boundedOrder.le ((c.boundedInclusion i).toFun x) none ∧ + ¬ c.boundedOrder.le none ((c.boundedInclusion i).toFun x) := + FixedTop.strict_top c.unionOrder (c.system.point i x) + +end MeetSystem + +structure GroupSystem (I : Type u) [LinearOrder I] where + system : DirectSystem I + [group : ∀ i, Group (system.Point i)] + map_one : ∀ {i j} (h : i ≤ j), system.map h 1 = 1 + map_mul : ∀ {i j} (h : i ≤ j) x y, system.map h (x * y) = system.map h x * system.map h y + +attribute [instance] GroupSystem.group + +namespace GroupSystem +variable {I : Type u} [LinearOrder I] (g : GroupSystem I) + +def transition {i j : I} (h : i ≤ j) : g.system.Point i →* g.system.Point j where + toFun := g.system.map h + map_one' := g.map_one h + map_mul' := g.map_mul h + +theorem map_inv {i j : I} (h : i ≤ j) (x : g.system.Point i) : + g.system.map h x⁻¹ = (g.system.map h x)⁻¹ := (g.transition h).map_inv x + +def mul : g.system.Union → g.system.Union → g.system.Union := + g.system.binary g.system g.system (fun _ x y => x * y) g.map_mul + +theorem mul_point (i : I) (x y : g.system.Point i) : + g.mul (g.system.point i x) (g.system.point i y) = g.system.point i (x * y) := + g.system.binary_point g.system g.system (fun _ x y => x * y) g.map_mul i x y + +def inv : g.system.Union → g.system.Union := + g.system.descend (fun i x => g.system.point i x⁻¹) (by + intro i j h x + rw [← g.map_inv h, g.system.point_map]) + +theorem inv_point (i : I) (x : g.system.Point i) : + g.inv (g.system.point i x) = g.system.point i x⁻¹ := rfl + +variable [Nonempty I] + +noncomputable def one : g.system.Union := g.system.point (Classical.arbitrary I) 1 + +theorem one_point (i : I) : g.one = g.system.point i 1 := by + apply Quotient.sound + exact ⟨max (Classical.arbitrary I) i, le_max_left _ _, le_max_right _ _, + (g.map_one _).trans (g.map_one _).symm⟩ + +noncomputable instance unionGroup : Group g.system.Union where + one := g.one + mul := g.mul + inv := g.inv + mul_assoc x y z := by + change g.mul (g.mul x y) z = g.mul x (g.mul y z) + rcases g.system.triple_cover g.system g.system x y z with ⟨i, a, b, c, rfl, rfl, rfl⟩ + rw [g.mul_point, g.mul_point, g.mul_point, g.mul_point, mul_assoc] + one_mul x := by + change g.mul g.one x = x + rcases g.system.cover x with ⟨i, a, rfl⟩ + rw [g.one_point i, g.mul_point, one_mul] + mul_one x := by + change g.mul x g.one = x + rcases g.system.cover x with ⟨i, a, rfl⟩ + rw [g.one_point i, g.mul_point, mul_one] + inv_mul_cancel x := by + change g.mul (g.inv x) x = g.one + rcases g.system.cover x with ⟨i, a, rfl⟩ + rw [g.inv_point, g.mul_point, inv_mul_cancel, g.one_point i] + +noncomputable def inclusion (i : I) : g.system.Point i →* g.system.Union where + toFun := g.system.point i + map_one' := (g.one_point i).symm + map_mul' x y := (g.mul_point i x y).symm + +theorem inclusion_injective (i : I) : Function.Injective (g.inclusion i) := + g.system.point_injective i + +end GroupSystem +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitProfilePersistence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitProfilePersistence.lean index f00c91ffaeda6a08c27747e417e162039269b4fe..1197555818ed48314acf8bd8737f0ac7b7190e41 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitProfilePersistence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LimitProfilePersistence.lean @@ -1,145 +1,145 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.MainDiagrams -import OAI.SetTheory.PartitionPrinciple.Geometry.MainProfilePersistence - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram - -open RationalHeights -universe u -variable {I : Type u} [LinearOrder I] (d : Diagram I) - -def lastCone (last : I) (greatest : ∀ i, i ≤ last) : d.Cone where - apex := d.stage last - leg i := d.transition (greatest i) - coherent h := (d.comp h (greatest _)).symm - -theorem union_bottom_same (i j : I) : - d.orders.system.point i (d.stage i).bottom = - d.orders.system.point j (d.stage j).bottom := by - have raised (k : I) (h : k ≤ max i j) : - d.orders.system.point k (d.stage k).bottom = - d.orders.system.point (max i j) (d.stage (max i j)).bottom := - (d.orders.system.point_map h (d.stage k).bottom).symm.trans - (congrArg (d.orders.system.point (max i j)) (d.transition h).bottom) - exact (raised i (le_max_left i j)).trans (raised j (le_max_right i j)).symm - -variable [Nonempty I] - -noncomputable def unionBottom : d.orders.system.Union := - d.orders.system.point (Classical.choice ‹Nonempty I›) - (d.stage (Classical.choice ‹Nonempty I›)).bottom - -theorem unionBottom_at (i : I) : - d.orders.system.point i (d.stage i).bottom = d.unionBottom := - d.union_bottom_same i _ - -theorem unionBottom_least (x : d.orders.system.Union) : - d.orders.unionOrder.le d.unionBottom x := by - rcases d.orders.system.cover x with ⟨i, x, rfl⟩ - rw [← d.unionBottom_at i] - exact (d.orders.le_stage i _ x).mpr ((d.stage i).least x) - -variable [Countable I] - -noncomputable def limitHeight : StrictHeight d.orders.boundedOrder - (lexOrder CountableColumns.order).toHeightOrder := - d.heights.limitHeight (fun i => ((d.stage i).height.value (d.stage i).top).1) - (d.heights.stage_bound_from_top (fun i => (d.stage i).top) (fun i => (d.stage i).greatest)) - -noncomputable def limit : MainStage.{u} where - Point := Option d.orders.system.Union - order := d.orders.boundedOrder - Actor := d.groups.system.Union - action := d.actions.topAction - bottom := some d.unionBottom - least x := by - cases x with - | none => exact True.intro - | some x => exact d.unionBottom_least x - top := none - greatest := FixedTop.greatest d.orders.unionOrder - height := d.limitHeight - countable_height := d.heights.limitHeight_countable _ _ (fun i => (d.stage i).countable_height) - -noncomputable def limitTransition (i : I) : Transition (d.stage i) d.limit where - points := d.orders.boundedInclusion i - actors := d.groups.inclusion i - actors_injective := d.groups.inclusion_injective i - equivariant := d.actions.topAction_stage i - bottom := congrArg some (d.unionBottom_at i) - height _ := rfl - agreement := d.actions.top_agreement d.agreements i - -noncomputable def limitCone : d.Cone where - apex := d.limit - leg := d.limitTransition - coherent h := Transition.ext _ _ - (fun x => congrArg some (d.orders.system.point_map h x)) - (fun g => d.groups.system.point_map h g) - -theorem limit_strict_top (i : I) (x : (d.stage i).Point) : - ¬ d.limit.order.le d.limit.top ((d.limitTransition i).points.toFun x) := - (d.orders.bounded_strict_top i x).2 - -theorem limit_point_cover (x : d.limit.Point) : - x = d.limit.top ∨ ∃ i y, (d.limitTransition i).points.toFun y = x := by - cases x with - | none => exact Or.inl rfl - | some x => - rcases d.orders.system.cover x with ⟨i, y, rfl⟩ - exact Or.inr ⟨i, y, rfl⟩ - -theorem limit_actor_cover (g : d.limit.Actor) : - ∃ i h, (d.limitTransition i).actors h = g := d.groups.system.cover g - -theorem limit_height_stage (i : I) (x : (d.stage i).Point) : - d.limit.height.value ((d.limitTransition i).points.toFun x) = (d.stage i).height.value x := rfl - -end PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram - - - -namespace PartitionPilot.Compression.RecursiveMaps - -universe u - -theorem FixedTop.preservesProfiles {A : Type u} (P : MeetOrder A) : - PreservesProfiles (FixedTop.embedding P).toMeetEmbedding := by - intro c v K F nonempty separate profile - apply profile_persists_one_step _ c v K F nonempty profile separate - intro x - cases x with - | none => exact Or.inr (Or.inr (FixedTop.greatest P)) - | some x => exact Or.inl ⟨x, rfl⟩ - -namespace MainStage.Diagram -variable {I : Type u} [LinearOrder I] (d : Diagram I) - -theorem union_preservesProfiles - (preserves : ∀ {i j} (h : i ≤ j), PreservesProfiles (d.transition h).points) - (i : I) : PreservesProfiles (d.orders.inclusion i) := by - intro c v K F nonempty separate profile x above - rcases d.orders.system.cover x with ⟨j, x, rfl⟩ - have eq := d.orders.system.point_map (le_max_right i j) x - rw [← eq] at above ⊢ - exact profileOver_at_embedding (d.transition (le_max_left i j)).points - (d.orders.inclusion (max i j)) (d.orders.inclusion i) - (d.orders.system.point_map (le_max_left i j)) c v K F - (preserves (le_max_left i j) c v K F nonempty separate profile) _ above - -theorem limit_preservesProfiles [Nonempty I] [Countable I] - (preserves : ∀ {i j} (h : i ≤ j), PreservesProfiles (d.transition h).points) - (i : I) : PreservesProfiles (d.limitTransition i).points := - preservesProfiles_comp (d.orders.inclusion i) (FixedTop.embedding d.orders.unionOrder).toMeetEmbedding - (d.union_preservesProfiles preserves i) (FixedTop.preservesProfiles d.orders.unionOrder) - -end MainStage.Diagram - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.MainDiagrams +import OAI.SetTheory.PartitionPrinciple.Geometry.MainProfilePersistence + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram + +open RationalHeights +universe u +variable {I : Type u} [LinearOrder I] (d : Diagram I) + +def lastCone (last : I) (greatest : ∀ i, i ≤ last) : d.Cone where + apex := d.stage last + leg i := d.transition (greatest i) + coherent h := (d.comp h (greatest _)).symm + +theorem union_bottom_same (i j : I) : + d.orders.system.point i (d.stage i).bottom = + d.orders.system.point j (d.stage j).bottom := by + have raised (k : I) (h : k ≤ max i j) : + d.orders.system.point k (d.stage k).bottom = + d.orders.system.point (max i j) (d.stage (max i j)).bottom := + (d.orders.system.point_map h (d.stage k).bottom).symm.trans + (congrArg (d.orders.system.point (max i j)) (d.transition h).bottom) + exact (raised i (le_max_left i j)).trans (raised j (le_max_right i j)).symm + +variable [Nonempty I] + +noncomputable def unionBottom : d.orders.system.Union := + d.orders.system.point (Classical.choice ‹Nonempty I›) + (d.stage (Classical.choice ‹Nonempty I›)).bottom + +theorem unionBottom_at (i : I) : + d.orders.system.point i (d.stage i).bottom = d.unionBottom := + d.union_bottom_same i _ + +theorem unionBottom_least (x : d.orders.system.Union) : + d.orders.unionOrder.le d.unionBottom x := by + rcases d.orders.system.cover x with ⟨i, x, rfl⟩ + rw [← d.unionBottom_at i] + exact (d.orders.le_stage i _ x).mpr ((d.stage i).least x) + +variable [Countable I] + +noncomputable def limitHeight : StrictHeight d.orders.boundedOrder + (lexOrder CountableColumns.order).toHeightOrder := + d.heights.limitHeight (fun i => ((d.stage i).height.value (d.stage i).top).1) + (d.heights.stage_bound_from_top (fun i => (d.stage i).top) (fun i => (d.stage i).greatest)) + +noncomputable def limit : MainStage.{u} where + Point := Option d.orders.system.Union + order := d.orders.boundedOrder + Actor := d.groups.system.Union + action := d.actions.topAction + bottom := some d.unionBottom + least x := by + cases x with + | none => exact True.intro + | some x => exact d.unionBottom_least x + top := none + greatest := FixedTop.greatest d.orders.unionOrder + height := d.limitHeight + countable_height := d.heights.limitHeight_countable _ _ (fun i => (d.stage i).countable_height) + +noncomputable def limitTransition (i : I) : Transition (d.stage i) d.limit where + points := d.orders.boundedInclusion i + actors := d.groups.inclusion i + actors_injective := d.groups.inclusion_injective i + equivariant := d.actions.topAction_stage i + bottom := congrArg some (d.unionBottom_at i) + height _ := rfl + agreement := d.actions.top_agreement d.agreements i + +noncomputable def limitCone : d.Cone where + apex := d.limit + leg := d.limitTransition + coherent h := Transition.ext _ _ + (fun x => congrArg some (d.orders.system.point_map h x)) + (fun g => d.groups.system.point_map h g) + +theorem limit_strict_top (i : I) (x : (d.stage i).Point) : + ¬ d.limit.order.le d.limit.top ((d.limitTransition i).points.toFun x) := + (d.orders.bounded_strict_top i x).2 + +theorem limit_point_cover (x : d.limit.Point) : + x = d.limit.top ∨ ∃ i y, (d.limitTransition i).points.toFun y = x := by + cases x with + | none => exact Or.inl rfl + | some x => + rcases d.orders.system.cover x with ⟨i, y, rfl⟩ + exact Or.inr ⟨i, y, rfl⟩ + +theorem limit_actor_cover (g : d.limit.Actor) : + ∃ i h, (d.limitTransition i).actors h = g := d.groups.system.cover g + +theorem limit_height_stage (i : I) (x : (d.stage i).Point) : + d.limit.height.value ((d.limitTransition i).points.toFun x) = (d.stage i).height.value x := rfl + +end PartitionPilot.Compression.RecursiveMaps.MainStage.Diagram + + + +namespace PartitionPilot.Compression.RecursiveMaps + +universe u + +theorem FixedTop.preservesProfiles {A : Type u} (P : MeetOrder A) : + PreservesProfiles (FixedTop.embedding P).toMeetEmbedding := by + intro c v K F nonempty separate profile + apply profile_persists_one_step _ c v K F nonempty profile separate + intro x + cases x with + | none => exact Or.inr (Or.inr (FixedTop.greatest P)) + | some x => exact Or.inl ⟨x, rfl⟩ + +namespace MainStage.Diagram +variable {I : Type u} [LinearOrder I] (d : Diagram I) + +theorem union_preservesProfiles + (preserves : ∀ {i j} (h : i ≤ j), PreservesProfiles (d.transition h).points) + (i : I) : PreservesProfiles (d.orders.inclusion i) := by + intro c v K F nonempty separate profile x above + rcases d.orders.system.cover x with ⟨j, x, rfl⟩ + have eq := d.orders.system.point_map (le_max_right i j) x + rw [← eq] at above ⊢ + exact profileOver_at_embedding (d.transition (le_max_left i j)).points + (d.orders.inclusion (max i j)) (d.orders.inclusion i) + (d.orders.system.point_map (le_max_left i j)) c v K F + (preserves (le_max_left i j) c v K F nonempty separate profile) _ above + +theorem limit_preservesProfiles [Nonempty I] [Countable I] + (preserves : ∀ {i j} (h : i ≤ j), PreservesProfiles (d.transition h).points) + (i : I) : PreservesProfiles (d.limitTransition i).points := + preservesProfiles_comp (d.orders.inclusion i) (FixedTop.embedding d.orders.unionOrder).toMeetEmbedding + (d.union_preservesProfiles preserves i) (FixedTop.preservesProfiles d.orders.unionOrder) + +end MainStage.Diagram + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LinkedSuccessorOutputFieldEquality.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LinkedSuccessorOutputFieldEquality.lean index 8f828274e46f8422270c8092d940ef692ba08f31..9b0e384a300d7915b0d0dd45f8ff5a323a645de2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LinkedSuccessorOutputFieldEquality.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/LinkedSuccessorOutputFieldEquality.lean @@ -1,257 +1,257 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTaskBearingSuccessorDecoding - -namespace OAI - -namespace PartitionPilot.Forcing -universe v - -theorem linkedSuccessorOutputFields_0 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 0 = s 0 := rfl - -theorem linkedSuccessorOutputFields_1 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 1 = t 0 := rfl - -theorem linkedSuccessorOutputFields_2 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 2 = s 1 := rfl - -theorem linkedSuccessorOutputFields_3 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 3 = t 1 := rfl - -theorem linkedSuccessorOutputFields_4 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 4 = s 2 := rfl - -theorem linkedSuccessorOutputFields_5 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 5 = t 2 := rfl - -theorem linkedSuccessorOutputFields_6 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 6 = s 3 := rfl - -theorem linkedSuccessorOutputFields_7 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 7 = t 3 := rfl - -theorem linkedSuccessorOutputFields_8 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 8 = s 4 := rfl - -theorem linkedSuccessorOutputFields_9 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 9 = t 4 := rfl - -theorem linkedSuccessorOutputFields_10 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 10 = s 6 := rfl - -theorem linkedSuccessorOutputFields_11 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 11 = t 6 := rfl - -theorem linkedSuccessorOutputFields_12 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 12 = s 7 := rfl - -theorem linkedSuccessorOutputFields_13 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 13 = t 7 := rfl - -theorem linkedSuccessorOutputFields_14 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 14 = s 8 := rfl - -theorem linkedSuccessorOutputFields_15 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 15 = t 8 := rfl - -theorem linkedSuccessorOutputFields_16 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 16 = s 10 := rfl - -theorem linkedSuccessorOutputFields_17 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 17 = t 10 := rfl - -theorem linkedSuccessorOutputFields_18 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 18 = points := rfl - -theorem linkedSuccessorOutputFields_19 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 19 = actors := rfl - -theorem linkedSuccessorOutputFields_20 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 20 = s 9 := rfl - -theorem linkedSuccessorOutputFields_21 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 21 = extra 0 := rfl - -theorem linkedSuccessorOutputFields_22 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 22 = extra 1 := rfl - -theorem linkedSuccessorOutputFields_23 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 23 = extra 2 := rfl - -theorem linkedSuccessorOutputFields_24 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 24 = extra 3 := rfl - -theorem linkedSuccessorOutputFields_25 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 25 = extra 4 := rfl - -theorem linkedSuccessorOutputFields_26 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 26 = extra 5 := rfl - -theorem linkedSuccessorOutputFields_27 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 27 = extra 6 := rfl - -theorem linkedSuccessorOutputFields_28 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 28 = extra 7 := rfl - -theorem linkedSuccessorOutputFields_29 {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) : - linkedSuccessorOutputFields s t points actors extra 29 = t 9 := rfl - -theorem linkedSuccessorOutputFields_eq {A : Type v} (s t : Fin 24 → A) - (points actors : A) (extra : Fin 8 → A) (v : Fin 30 → A) - (fields : s 0 = v 0 ∧ - t 0 = v 1 ∧ - s 1 = v 2 ∧ - t 1 = v 3 ∧ - s 2 = v 4 ∧ - t 2 = v 5 ∧ - s 3 = v 6 ∧ - t 3 = v 7 ∧ - s 4 = v 8 ∧ - t 4 = v 9 ∧ - s 6 = v 10 ∧ - t 6 = v 11 ∧ - s 7 = v 12 ∧ - t 7 = v 13 ∧ - s 8 = v 14 ∧ - t 8 = v 15 ∧ - s 10 = v 16 ∧ - t 10 = v 17 ∧ - points = v 18 ∧ - actors = v 19 ∧ - s 9 = v 20 ∧ - extra 0 = v 21 ∧ - extra 1 = v 22 ∧ - extra 2 = v 23 ∧ - extra 3 = v 24 ∧ - extra 4 = v 25 ∧ - extra 5 = v 26 ∧ - extra 6 = v 27 ∧ - extra 7 = v 28 ∧ - t 9 = v 29) : - linkedSuccessorOutputFields s t points actors extra = v := by - obtain ⟨h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12, h13, h14, h15, h16, h17, h18, h19, h20, h21, h22, h23, h24, h25, h26, h27, h28, h29⟩ := fields - funext j - refine Fin.cases ?_ (fun j => ?_) j - · simpa only [linkedSuccessorOutputFields_0] using h0 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_1 s t points actors extra).trans h1 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_2 s t points actors extra).trans h2 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_3 s t points actors extra).trans h3 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_4 s t points actors extra).trans h4 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_5 s t points actors extra).trans h5 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_6 s t points actors extra).trans h6 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_7 s t points actors extra).trans h7 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_8 s t points actors extra).trans h8 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_9 s t points actors extra).trans h9 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_10 s t points actors extra).trans h10 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_11 s t points actors extra).trans h11 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_12 s t points actors extra).trans h12 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_13 s t points actors extra).trans h13 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_14 s t points actors extra).trans h14 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_15 s t points actors extra).trans h15 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_16 s t points actors extra).trans h16 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_17 s t points actors extra).trans h17 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_18 s t points actors extra).trans h18 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_19 s t points actors extra).trans h19 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_20 s t points actors extra).trans h20 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_21 s t points actors extra).trans h21 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_22 s t points actors extra).trans h22 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_23 s t points actors extra).trans h23 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_24 s t points actors extra).trans h24 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_25 s t points actors extra).trans h25 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_26 s t points actors extra).trans h26 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_27 s t points actors extra).trans h27 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_28 s t points actors extra).trans h28 - · - refine Fin.cases ?_ (fun j => ?_) j - · exact (linkedSuccessorOutputFields_29 s t points actors extra).trans h29 - · - exact Fin.elim0 j - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundTaskBearingSuccessorDecoding + +namespace OAI + +namespace PartitionPilot.Forcing +universe v + +theorem linkedSuccessorOutputFields_0 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 0 = s 0 := rfl + +theorem linkedSuccessorOutputFields_1 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 1 = t 0 := rfl + +theorem linkedSuccessorOutputFields_2 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 2 = s 1 := rfl + +theorem linkedSuccessorOutputFields_3 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 3 = t 1 := rfl + +theorem linkedSuccessorOutputFields_4 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 4 = s 2 := rfl + +theorem linkedSuccessorOutputFields_5 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 5 = t 2 := rfl + +theorem linkedSuccessorOutputFields_6 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 6 = s 3 := rfl + +theorem linkedSuccessorOutputFields_7 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 7 = t 3 := rfl + +theorem linkedSuccessorOutputFields_8 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 8 = s 4 := rfl + +theorem linkedSuccessorOutputFields_9 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 9 = t 4 := rfl + +theorem linkedSuccessorOutputFields_10 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 10 = s 6 := rfl + +theorem linkedSuccessorOutputFields_11 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 11 = t 6 := rfl + +theorem linkedSuccessorOutputFields_12 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 12 = s 7 := rfl + +theorem linkedSuccessorOutputFields_13 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 13 = t 7 := rfl + +theorem linkedSuccessorOutputFields_14 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 14 = s 8 := rfl + +theorem linkedSuccessorOutputFields_15 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 15 = t 8 := rfl + +theorem linkedSuccessorOutputFields_16 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 16 = s 10 := rfl + +theorem linkedSuccessorOutputFields_17 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 17 = t 10 := rfl + +theorem linkedSuccessorOutputFields_18 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 18 = points := rfl + +theorem linkedSuccessorOutputFields_19 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 19 = actors := rfl + +theorem linkedSuccessorOutputFields_20 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 20 = s 9 := rfl + +theorem linkedSuccessorOutputFields_21 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 21 = extra 0 := rfl + +theorem linkedSuccessorOutputFields_22 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 22 = extra 1 := rfl + +theorem linkedSuccessorOutputFields_23 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 23 = extra 2 := rfl + +theorem linkedSuccessorOutputFields_24 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 24 = extra 3 := rfl + +theorem linkedSuccessorOutputFields_25 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 25 = extra 4 := rfl + +theorem linkedSuccessorOutputFields_26 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 26 = extra 5 := rfl + +theorem linkedSuccessorOutputFields_27 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 27 = extra 6 := rfl + +theorem linkedSuccessorOutputFields_28 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 28 = extra 7 := rfl + +theorem linkedSuccessorOutputFields_29 {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) : + linkedSuccessorOutputFields s t points actors extra 29 = t 9 := rfl + +theorem linkedSuccessorOutputFields_eq {A : Type v} (s t : Fin 24 → A) + (points actors : A) (extra : Fin 8 → A) (v : Fin 30 → A) + (fields : s 0 = v 0 ∧ + t 0 = v 1 ∧ + s 1 = v 2 ∧ + t 1 = v 3 ∧ + s 2 = v 4 ∧ + t 2 = v 5 ∧ + s 3 = v 6 ∧ + t 3 = v 7 ∧ + s 4 = v 8 ∧ + t 4 = v 9 ∧ + s 6 = v 10 ∧ + t 6 = v 11 ∧ + s 7 = v 12 ∧ + t 7 = v 13 ∧ + s 8 = v 14 ∧ + t 8 = v 15 ∧ + s 10 = v 16 ∧ + t 10 = v 17 ∧ + points = v 18 ∧ + actors = v 19 ∧ + s 9 = v 20 ∧ + extra 0 = v 21 ∧ + extra 1 = v 22 ∧ + extra 2 = v 23 ∧ + extra 3 = v 24 ∧ + extra 4 = v 25 ∧ + extra 5 = v 26 ∧ + extra 6 = v 27 ∧ + extra 7 = v 28 ∧ + t 9 = v 29) : + linkedSuccessorOutputFields s t points actors extra = v := by + obtain ⟨h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12, h13, h14, h15, h16, h17, h18, h19, h20, h21, h22, h23, h24, h25, h26, h27, h28, h29⟩ := fields + funext j + refine Fin.cases ?_ (fun j => ?_) j + · simpa only [linkedSuccessorOutputFields_0] using h0 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_1 s t points actors extra).trans h1 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_2 s t points actors extra).trans h2 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_3 s t points actors extra).trans h3 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_4 s t points actors extra).trans h4 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_5 s t points actors extra).trans h5 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_6 s t points actors extra).trans h6 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_7 s t points actors extra).trans h7 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_8 s t points actors extra).trans h8 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_9 s t points actors extra).trans h9 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_10 s t points actors extra).trans h10 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_11 s t points actors extra).trans h11 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_12 s t points actors extra).trans h12 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_13 s t points actors extra).trans h13 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_14 s t points actors extra).trans h14 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_15 s t points actors extra).trans h15 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_16 s t points actors extra).trans h16 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_17 s t points actors extra).trans h17 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_18 s t points actors extra).trans h18 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_19 s t points actors extra).trans h19 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_20 s t points actors extra).trans h20 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_21 s t points actors extra).trans h21 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_22 s t points actors extra).trans h22 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_23 s t points actors extra).trans h23 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_24 s t points actors extra).trans h24 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_25 s t points actors extra).trans h25 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_26 s t points actors extra).trans h26 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_27 s t points actors extra).trans h27 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_28 s t points actors extra).trans h28 + · + refine Fin.cases ?_ (fun j => ?_) j + · exact (linkedSuccessorOutputFields_29 s t points actors extra).trans h29 + · + exact Fin.elim0 j + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthExtensions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthExtensions.lean index 6bbf48417189efae2275e5c3f72a30cda4caa36a..842fd62335fc34a56bbb64c35088cceeb66c78e9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthExtensions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthExtensions.lean @@ -1,532 +1,532 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.MainDiagramGluing - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps.MainStage - -section - -universe u -namespace Diagram -variable {I : Type u} [LinearOrder I] - -theorem ext_of_prefixes (d e : Diagram I) - (same : ∀ i, d.reindex (fun j : Set.Iic i => j.val) (fun _ _ h => h) = - e.reindex (fun j : Set.Iic i => j.val) (fun _ _ h => h)) : d = e := by - apply ext_of_transport _ _ - (fun i => congrArg (fun d => d.stage ⟨i, le_refl i⟩) (same i)) - intro i j h - exact transition_of_eq _ _ (same j) (i := ⟨i, h⟩) (j := ⟨j, le_refl j⟩) h - -theorem Cone.append_prefix {a b : I} {d : Diagram (Set.Iio a)} (c : d.Cone) (h : b < a) : - c.append.restrictLE h.le = - d.reindex (fun i : Set.Iic b => ⟨i.val, lt_of_le_of_lt i.property h⟩) (fun _ _ h => h) := by - exact congrArg (fun e : Diagram (Set.Iio a) => - e.reindex (fun i : Set.Iic b => ⟨i.val, lt_of_le_of_lt i.property h⟩) (fun _ _ h => h)) - c.append_restrict - -end Diagram - -namespace Transfinite -variable {I : Type u} [LinearOrder I] - -def pastFamily (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) - (i : Set.Iio a) : Diagram (Set.Iic i) := - (past i.val i.property).reindex - (fun j : Set.Iic i => (⟨j.val.val, j.property⟩ : Set.Iic i.val)) (fun _ _ h => h) - -theorem pastCompatible (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) - (coherent : ∀ i j (hi : i < a) (hj : j < a) (h : i ≤ j), - (past j hj).restrictLE h = past i hi) : Diagram.Compatible (pastFamily a past) := by - intro i j h - exact congrArg (fun d : Diagram (Set.Iic i.val) => - d.reindex (fun k : Set.Iic i => (⟨k.val.val, k.property⟩ : Set.Iic i.val)) - (fun _ _ h => h)) (coherent i.val j.val i.property j.property h) - -theorem past_glue_prefix (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) - (compatible : Diagram.Compatible (pastFamily a past)) (b : I) (h : b < a) : - compatible.glue.reindex - (fun i : Set.Iic b => (⟨i.val, lt_of_le_of_lt i.property h⟩ : Set.Iio a)) - (fun _ _ h => h) = past b h := by - exact congrArg (fun d : Diagram (Set.Iic (⟨b, h⟩ : Set.Iio a)) => - d.reindex (fun i : Set.Iic b => - (⟨⟨i.val, lt_of_le_of_lt i.property h⟩, i.property⟩ : Set.Iic (⟨b, h⟩ : Set.Iio a))) - (fun _ _ h => h)) (compatible.glue_restrict ⟨b, h⟩) - -variable (extend : ∀ a : I, (d : Diagram (Set.Iio a)) → d.Cone) - -noncomputable def runStep (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) : - Diagram (Set.Iic a) := by - classical - exact if compatible : Diagram.Compatible (pastFamily a past) then - (extend a compatible.glue).append - else Diagram.constant initial - -variable [WellFoundedLT I] - -noncomputable def run : ∀ a : I, Diagram (Set.Iic a) := - wellFounded_lt.fix (runStep extend) - -theorem run_eq (a : I) : - run extend a = runStep extend a (fun b _ => run extend b) := wellFounded_lt.fix_eq _ a - -theorem coherent_at (a : I) : ∀ b (h : b ≤ a), (run extend a).restrictLE h = run extend b := by - refine (show WellFounded ((· < ·) : I → I → Prop) from wellFounded_lt).induction - (C := fun a => ∀ b (h : b ≤ a), (run extend a).restrictLE h = run extend b) a ?_ - intro a ih - have compatible : Diagram.Compatible (pastFamily a (fun b _ => run extend b)) := - pastCompatible a _ (fun i j _ hj h => ih j hj i h) - have generated : run extend a = (extend a compatible.glue).append := - (run_eq extend a).trans - (dite_eq_left (c := Diagram.Compatible (pastFamily a (fun b _ => run extend b))) compatible) - intro b h - rcases lt_or_eq_of_le h with lower | rfl - · rw [generated, Diagram.Cone.append_prefix _ lower] - exact past_glue_prefix a _ compatible b lower - · exact Diagram.restrictLE_self _ - -theorem compatible : Diagram.Compatible (run extend) := fun {_ j} h => coherent_at extend j _ h - -noncomputable def diagram : Diagram I := Diagram.Compatible.glue (f := run extend) (compatible extend) - -theorem diagram_prefix (a : I) : - (diagram extend).reindex (fun i : Set.Iic a => i.val) (fun _ _ h => h) = run extend a := - Diagram.Compatible.glue_restrict (f := run extend) (compatible extend) a - -noncomputable def before (a : I) : Diagram (Set.Iio a) := - (diagram extend).reindex (fun i : Set.Iio a => i.val) (fun _ _ h => h) - -theorem before_prefix {a b : I} (h : b < a) : - (before extend a).reindex - (fun i : Set.Iic b => (⟨i.val, lt_of_le_of_lt i.property h⟩ : Set.Iio a)) - (fun _ _ h => h) = run extend b := diagram_prefix extend b - -theorem past_glue_before (a : I) - (coherent : Diagram.Compatible (pastFamily a (fun b _ => run extend b))) : - coherent.glue = before extend a := by - apply Diagram.ext_of_prefixes - intro i - have old := before_prefix extend i.property - have built := past_glue_prefix a _ coherent i.val i.property - have eq := built.trans old.symm - exact congrArg (fun d : Diagram (Set.Iic i.val) => - d.reindex (fun j : Set.Iic i => (⟨j.val.val, j.property⟩ : Set.Iic i.val)) - (fun _ _ h => h)) eq - -theorem run_generated (a : I) : run extend a = (extend a (before extend a)).append := by - have coherent : Diagram.Compatible (pastFamily a (fun b _ => run extend b)) := - pastCompatible a _ (fun i j _ _ h => coherent_at extend j i h) - have generated : run extend a = (extend a coherent.glue).append := - (run_eq extend a).trans (dite_eq_left (c := Diagram.Compatible (pastFamily a (fun b _ => run extend b))) coherent) - rw [generated, past_glue_before extend a coherent] - -theorem stage_generated (a : I) : - (diagram extend).stage a = (extend a (before extend a)).apex := by - have eq := congrArg (fun d : Diagram (Set.Iic a) => d.stage ⟨a, le_refl a⟩) - (run_generated extend a) - exact eq.trans ((extend a (before extend a)).append_stage_top) - -end Transfinite - - - - - -namespace Diagram -variable {I : Type u} [LinearOrder I] - -theorem transition_indices (d : Diagram I) {i j i' j' : I} (h : i ≤ j) (h' : i' ≤ j') - (hi : i = i') (hj : j = j') : - (d.transition h).transport (congrArg d.stage hi) (congrArg d.stage hj) = d.transition h' := by - cases hi; cases hj; rfl - -theorem Cone.append_leg {a : I} {d : Diagram (Set.Iio a)} (c : d.Cone) (i : Set.Iio a) : - (c.append.transition (i := ⟨i.val, i.property.le⟩) (j := ⟨a, le_refl a⟩) i.property.le).transport - (c.append_stage_old i) c.append_stage_top = c.leg i := by - exact transition_indices c.augmented - (Cone.endIndex_mono (show (⟨i.val, i.property.le⟩ : Set.Iic a) ≤ ⟨a, le_refl a⟩ from i.property.le)) - (show (i : WithTop (Set.Iio a)) ≤ ⊤ from le_top) - (Cone.endIndex_old i) Cone.endIndex_top - -end Diagram - -namespace Transfinite -variable {I : Type u} [LinearOrder I] [WellFoundedLT I] - (extend : ∀ a : I, (d : Diagram (Set.Iio a)) → d.Cone) - -theorem transition_generated (a : I) (i : Set.Iio a) : - ((diagram extend).transition i.property.le).transport rfl (stage_generated extend a) = - (extend a (before extend a)).leg i := by - let c := extend a (before extend a) - have eq : (diagram extend).reindex (fun j : Set.Iic a => j.val) (fun _ _ h => h) = c.append := - (diagram_prefix extend a).trans (run_generated extend a) - have maps := Diagram.transition_of_eq _ _ eq - (i := ⟨i.val, i.property.le⟩) (j := ⟨a, le_refl a⟩) i.property.le - have lifted := congrArg (fun f => f.transport (c.append_stage_old i) c.append_stage_top) maps - erw [Transition.transport_twice] at lifted - exact lifted.trans (c.append_leg i) - -end Transfinite - -namespace Transition - -theorem strict_top_of_transport {s t t' : MainStage.{u}} (f : Transition s t) (eq : t = t') - (strict : ∀ x, ¬ t'.order.le t'.top ((f.transport rfl eq).points.toFun x)) : - ∀ x, ¬ t.order.le t.top (f.points.toFun x) := by cases eq; exact strict - -end Transition - -end - - - -namespace OrdinalRun - -open CountableColumns -variable (Label : Type 1) - -noncomputable def diagram : Diagram Column := Transfinite.diagram (ordinalStep Label) - -noncomputable def stage (a : Column) : MainStage.{1} := (diagram Label).stage a - -noncomputable def transition {a b : Column} (h : a ≤ b) : Transition (stage Label a) (stage Label b) := - (diagram Label).transition h - -noncomputable def before (a : Column) : Diagram (Set.Iio a) := Transfinite.before (ordinalStep Label) a - -theorem stage_zero : stage Label (natural 0) = initial := - (Transfinite.stage_generated (ordinalStep Label) (natural 0)).trans (ordinalStep_zero Label _) - -theorem stage_successor (a : Column) : stage Label (start a) = (stage Label a).next Label := - (Transfinite.stage_generated (ordinalStep Label) (start a)).trans (ordinalStep_successor Label a _) - -theorem stage_limit (a : Column) (limit : Order.IsSuccLimit a.val) : - letI : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ - stage Label a = (before Label a).limit := by - let : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ - exact (Transfinite.stage_generated (ordinalStep Label) a).trans (ordinalStep_limit Label a _ limit) - -theorem transition_self (a : Column) : transition Label (le_refl a) = Transition.identity (stage Label a) := - (diagram Label).self a - -theorem transition_comp {a b c : Column} (hab : a ≤ b) (hbc : b ≤ c) : - transition Label (le_trans hab hbc) = (transition Label hab).comp (transition Label hbc) := - (diagram Label).comp hab hbc - -theorem strict_top {a b : Column} (h : a < b) (x : (stage Label a).Point) : - ¬ (stage Label b).order.le (stage Label b).top ((transition Label h.le).points.toFun x) := by - apply Transition.strict_top_of_transport (transition Label h.le) - (Transfinite.stage_generated (ordinalStep Label) b) _ x - intro y - have maps : (transition Label h.le).transport rfl - (Transfinite.stage_generated (ordinalStep Label) b) = - (ordinalStep Label b (before Label b)).leg ⟨a, h⟩ := - Transfinite.transition_generated (ordinalStep Label) b ⟨a, h⟩ - rw [maps] - exact ordinalStep_strict_top Label b (before Label b) ⟨a, h⟩ y - -theorem transition_height {a b : Column} (h : a ≤ b) (x : (stage Label a).Point) : - (stage Label b).height.value ((transition Label h).points.toFun x) = (stage Label a).height.value x := - (transition Label h).height x - -theorem transition_bottom {a b : Column} (h : a ≤ b) : - (transition Label h).points.toFun (stage Label a).bottom = (stage Label b).bottom := - (transition Label h).bottom - -theorem transition_agreement {a b : Column} (h : a ≤ b) (g k : (stage Label a).Actor) - (v : (stage Label a).Point) - (agree : ∀ x, (stage Label a).order.le x v → - ((stage Label a).action.iso g).toFun x = ((stage Label a).action.iso k).toFun x) : - ∀ x, (stage Label b).order.le x ((transition Label h).points.toFun v) → - ((stage Label b).action.iso ((transition Label h).actors g)).toFun x = - ((stage Label b).action.iso ((transition Label h).actors k)).toFun x := - (transition Label h).agreement g k v agree - -noncomputable def countableOrdinalLabels : Diagram Column := diagram Column - -end OrdinalRun - - - -section - -open Chronological CountableColumns BirthLabels - -structure BirthRecord (s : MainStage.{1}) (a : Column) where - birth : s.Point → Index - bounded : ∀ x, birth x ≤ BirthLabels.top a - old_meet : OldMeet (P := s.order) birth - -namespace BirthRecord -variable {s t q : MainStage.{1}} {a b : Column} - -def constant (s : MainStage.{1}) (a : Column) : BirthRecord s a where - birth _ := BirthLabels.top a - bounded _ := le_rfl - old_meet _ _ earlier _ := False.elim (lt_irrefl _ earlier) - -def transport (r : BirthRecord s a) (eq : s = t) : BirthRecord t a := eq ▸ r - -theorem transport_back_apply (r : BirthRecord t a) (eq : s = t) - (f : Transition q s) (x : q.Point) : - (r.transport eq.symm).birth (f.points.toFun x) = - r.birth ((f.transport rfl eq).points.toFun x) := by cases eq; rfl - -noncomputable def successor (r : BirthRecord s b) (Label : Type 1) (h : b < a) : - BirthRecord (s.next Label) a where - birth := s.nextBirth Label r.birth (inside a) (outside a) (BirthLabels.top a) - bounded := s.nextBirth_le Label r.birth (inside a) (outside a) (BirthLabels.top a) - (fun x n => lt_of_le_of_lt (r.bounded x) (top_before h n)) - (inside_before a) (outside_top a) - old_meet := s.nextBirth_old_meet Label r.birth (inside a) (outside a) (BirthLabels.top a) - (fun x n => lt_of_le_of_lt (r.bounded x) (top_before h n)) - (inside_before a) (outside_top a) (inside_increasing a) (outside_increasing a) r.old_meet - -theorem successor_original (r : BirthRecord s b) (Label : Type 1) (h : b < a) (x : s.Point) : - (r.successor Label h).birth ((s.nextTransition Label).points.toFun x) = r.birth x := - s.nextBirth_original Label r.birth (inside a) (outside a) (BirthLabels.top a) x - -theorem successor_source (r : BirthRecord s b) (Label : Type 1) (h : b < a) - (x : (s.next Label).Point) : - (∃ y, (s.nextTransition Label).points.toFun y = x ∧ - (r.successor Label h).birth x = r.birth y) ∨ main ((r.successor Label h).birth x) = a := - s.nextBirth_source Label a r.birth x - -end BirthRecord - -namespace Diagram -variable {a : Column} (d : Diagram (Set.Iio a)) - (seed : ∀ i, BirthRecord (d.stage i) i.val) - -def BirthCoherent : Prop := ∀ {i j} (h : i ≤ j) x, - (seed j).birth ((d.transition h).points.toFun x) = (seed i).birth x - -variable (coherent : d.BirthCoherent seed) - -noncomputable def unionRecordedBirth : d.orders.system.Union → Index := - d.orders.system.descend (fun i => (seed i).birth) coherent - -theorem unionRecordedBirth_stage (i : Set.Iio a) (x : (d.stage i).Point) : - d.unionRecordedBirth seed coherent (d.orders.system.point i x) = (seed i).birth x := rfl - -theorem unionRecordedBirth_before (x : d.orders.system.Union) : - d.unionRecordedBirth seed coherent x < BirthLabels.top a := by - rcases d.orders.system.cover x with ⟨i, x, rfl⟩ - apply lt_of_le_of_lt ((seed i).bounded x) - exact Prod.Lex.toLex_lt_toLex.mpr (Or.inl i.property) - -theorem unionRecordedBirth_old_meet : - OldMeet (P := d.orders.unionOrder) (d.unionRecordedBirth seed coherent) := - oldMeet_of_covered_stages (fun i => (d.stage i).order) - (d.unionRecordedBirth seed coherent) (fun i => (seed i).birth) d.orders.inclusion - (fun _ _ => rfl) (d.orders.system.pair_cover d.orders.system) (fun i => (seed i).old_meet) - -variable [Nonempty (Set.Iio a)] - -noncomputable def limitBirthRecord : BirthRecord d.limit a where - birth := FixedTop.birth (d.unionRecordedBirth seed coherent) (BirthLabels.top a) - bounded := FixedTop.birth_le _ _ (d.unionRecordedBirth_before seed coherent) - old_meet := FixedTop.old_meet_preserved d.orders.unionOrder _ _ - (d.unionRecordedBirth_before seed coherent) (d.unionRecordedBirth_old_meet seed coherent) - -theorem limitBirthRecord_stage (i : Set.Iio a) (x : (d.stage i).Point) : - (d.limitBirthRecord seed coherent).birth ((d.limitTransition i).points.toFun x) = - (seed i).birth x := rfl - -theorem limitBirthRecord_source (x : d.limit.Point) : - (∃ i y, (d.limitTransition i).points.toFun y = x ∧ - (d.limitBirthRecord seed coherent).birth x = (seed i).birth y) ∨ - main ((d.limitBirthRecord seed coherent).birth x) = a := by - cases x with - | none => exact Or.inr rfl - | some x => - rcases d.orders.system.cover x with ⟨i, y, rfl⟩ - exact Or.inl ⟨i, y, rfl, rfl⟩ - -end Diagram -end - - - -section - -open CountableColumns -universe u - -namespace Diagram.Cone -variable {I : Type u} [LinearOrder I] {d : Diagram I} - -theorem leg_transport {c e : d.Cone} (eq : c = e) (i : I) : - (c.leg i).transport rfl (congrArg Diagram.Cone.apex eq) = e.leg i := by cases eq; rfl - -end Diagram.Cone - -theorem ordinalStep_last_leg (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (last : Set.Iio a) (greatest : ∀ i, i ≤ last) : - ((ordinalStep Label a d).leg last).transport rfl (ordinalStep_last Label a d last greatest) = - (d.stage last).nextTransition Label := by - classical - have inhabited : Nonempty (Set.Iio a) := ⟨last⟩ - have hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last := ⟨last, greatest⟩ - have chosen : hasLast.choose = last := le_antisymm (greatest _) (hasLast.choose_spec last) - have eq : ordinalStep Label a d = - (d.lastCone last greatest).extend (d := d) ((d.stage last).nextTransition Label) := by - simp only [ordinalStep, dite_eq_left inhabited, dite_eq_left hasLast] - let build (p : {last : Set.Iio a // ∀ i, i ≤ last}) : d.Cone := - (d.lastCone p.val p.property).extend (d := d) ((d.stage p.val).nextTransition Label) - change build ⟨hasLast.choose, hasLast.choose_spec⟩ = build ⟨last, greatest⟩ - exact congrArg build (Subtype.ext chosen) - have maps := Diagram.Cone.leg_transport eq last - have same : (((d.lastCone last greatest).extend (d := d) - ((d.stage last).nextTransition Label)).leg last) = (d.stage last).nextTransition Label := by - change (d.transition (greatest last)).comp ((d.stage last).nextTransition Label) = _ - rw [d.self, Transition.identity_comp] - exact maps.trans same - -namespace OrdinalRun -variable (Label : Type 1) - -theorem transition_successor (a : Column) : - (transition Label (lt_start a).le).transport rfl (stage_successor Label a) = - (stage Label a).nextTransition Label := by - have maps := Transfinite.transition_generated (ordinalStep Label) (start a) (predecessor a) - have lifted := congrArg (fun f => f.transport rfl - (ordinalStep_successor Label a (before Label (start a)))) maps - erw [Transition.transport_twice] at lifted - exact lifted.trans (ordinalStep_last_leg Label (start a) (before Label (start a)) - (predecessor a) (predecessor_greatest a)) - -end OrdinalRun - -end - - - - -open CountableColumns BirthLabels - -namespace Diagram -variable {a : Column} (d : Diagram (Set.Iio a)) (c : d.Cone) - (seed : ∀ i, BirthRecord (d.stage i) i.val) - -structure ConeBirth where - record : BirthRecord c.apex a - preserves : ∀ i x, record.birth ((c.leg i).points.toFun x) = (seed i).birth x - source : ∀ x, - (∃ i y, (c.leg i).points.toFun y = x ∧ record.birth x = (seed i).birth y) ∨ - main (record.birth x) = a - -variable (coherent : d.BirthCoherent seed) - -noncomputable def nextConeBirth (Label : Type 1) (last : Set.Iio a) (greatest : ∀ i, i ≤ last) : - d.ConeBirth ((d.lastCone last greatest).extend (d := d) - ((d.stage last).nextTransition Label)) seed where - record := (seed last).successor Label last.property - preserves i x := ((seed last).successor_original Label last.property - ((d.transition (greatest i)).points.toFun x)).trans (coherent (greatest i) x) - source x := by - rcases (seed last).successor_source Label last.property x with ⟨y, eq, born⟩ | fresh - · left - refine ⟨last, y, ?_, born⟩ - change ((d.stage last).nextTransition Label).points.toFun - ((d.transition (greatest last)).points.toFun y) = x - rw [d.self] - exact eq - · exact Or.inr fresh - -noncomputable def limitConeBirth [Nonempty (Set.Iio a)] : d.ConeBirth d.limitCone seed where - record := d.limitBirthRecord seed coherent - preserves := d.limitBirthRecord_stage seed coherent - source := d.limitBirthRecord_source seed coherent - -end Diagram - -noncomputable def ordinalConeBirth (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (seed : ∀ i, BirthRecord (d.stage i) i.val) (coherent : d.BirthCoherent seed) : - d.ConeBirth (ordinalStep Label a d) seed := by - classical - unfold ordinalStep - split - · rename_i inhabited - split - · rename_i hasLast - exact d.nextConeBirth seed coherent Label hasLast.choose hasLast.choose_spec - · letI := inhabited - exact d.limitConeBirth seed coherent - · rename_i empty - exact { - record := BirthRecord.constant initial a - preserves := fun i => False.elim (empty ⟨i⟩) - source := fun _ => Or.inr rfl } - - - - - - -namespace Diagram.ConeBirth -variable {a : Column} {d : Diagram (Set.Iio a)} {c : d.Cone} - {seed : ∀ i, BirthRecord (d.stage i) i.val} (r : d.ConeBirth c seed) - -include r in -theorem pullback (t : MainStage.{1}) (eq : t = c.apex) - (leg : ∀ i, Transition (d.stage i) t) - (same : ∀ i, (leg i).transport rfl eq = c.leg i) : - ∃ q : BirthRecord t a, - (∀ i x, q.birth ((leg i).points.toFun x) = (seed i).birth x) ∧ - (∀ x, (∃ i y, (leg i).points.toFun y = x ∧ q.birth x = (seed i).birth y) ∨ - main (q.birth x) = a) := by - cases eq - have maps (i : Set.Iio a) : leg i = c.leg i := same i - refine ⟨r.record, ?_, ?_⟩ - · intro i x - rw [maps] - exact r.preserves i x - · intro x - rcases r.source x with ⟨i, y, eq, born⟩ | fresh - · exact Or.inl ⟨i, y, (congrArg (fun f => f.points.toFun y) (maps i)).trans eq, born⟩ - · exact Or.inr fresh - -end Diagram.ConeBirth - -namespace OrdinalRun -variable (Label : Type 1) (a : Column) - -abbrev EarlierBirths := ∀ i : Set.Iio a, BirthRecord (stage Label i.val) i.val - -def EarlierCoherent (seed : EarlierBirths Label a) : Prop := - (before Label a).BirthCoherent seed - -variable (seed : EarlierBirths Label a) (coherent : EarlierCoherent Label a seed) - -include coherent in -theorem birth_extension_exists : - ∃ q : BirthRecord (stage Label a) a, - (∀ i x, q.birth ((transition Label i.property.le).points.toFun x) = (seed i).birth x) ∧ - (∀ x, (∃ i y, (transition Label i.property.le).points.toFun y = x ∧ - q.birth x = (seed i).birth y) ∨ main (q.birth x) = a) := - (ordinalConeBirth Label a (before Label a) seed coherent).pullback (stage Label a) - (Transfinite.stage_generated (ordinalStep Label) a) - (fun i => transition Label i.property.le) - (Transfinite.transition_generated (ordinalStep Label) a) - -noncomputable def extendBirths : BirthRecord (stage Label a) a := - Classical.choose (birth_extension_exists Label a seed coherent) - -theorem extendBirths_preserves (i : Set.Iio a) (x : (stage Label i.val).Point) : - (extendBirths Label a seed coherent).birth ((transition Label i.property.le).points.toFun x) = - (seed i).birth x := - (Classical.choose_spec (birth_extension_exists Label a seed coherent)).1 i x - -theorem extendBirths_source (x : (stage Label a).Point) : - (∃ i y, (transition Label i.property.le).points.toFun y = x ∧ - (extendBirths Label a seed coherent).birth x = (seed i).birth y) ∨ - main ((extendBirths Label a seed coherent).birth x) = a := - (Classical.choose_spec (birth_extension_exists Label a seed coherent)).2 x - -end OrdinalRun - -end PartitionPilot.Compression.RecursiveMaps.MainStage - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.MainDiagramGluing + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps.MainStage + +section + +universe u +namespace Diagram +variable {I : Type u} [LinearOrder I] + +theorem ext_of_prefixes (d e : Diagram I) + (same : ∀ i, d.reindex (fun j : Set.Iic i => j.val) (fun _ _ h => h) = + e.reindex (fun j : Set.Iic i => j.val) (fun _ _ h => h)) : d = e := by + apply ext_of_transport _ _ + (fun i => congrArg (fun d => d.stage ⟨i, le_refl i⟩) (same i)) + intro i j h + exact transition_of_eq _ _ (same j) (i := ⟨i, h⟩) (j := ⟨j, le_refl j⟩) h + +theorem Cone.append_prefix {a b : I} {d : Diagram (Set.Iio a)} (c : d.Cone) (h : b < a) : + c.append.restrictLE h.le = + d.reindex (fun i : Set.Iic b => ⟨i.val, lt_of_le_of_lt i.property h⟩) (fun _ _ h => h) := by + exact congrArg (fun e : Diagram (Set.Iio a) => + e.reindex (fun i : Set.Iic b => ⟨i.val, lt_of_le_of_lt i.property h⟩) (fun _ _ h => h)) + c.append_restrict + +end Diagram + +namespace Transfinite +variable {I : Type u} [LinearOrder I] + +def pastFamily (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) + (i : Set.Iio a) : Diagram (Set.Iic i) := + (past i.val i.property).reindex + (fun j : Set.Iic i => (⟨j.val.val, j.property⟩ : Set.Iic i.val)) (fun _ _ h => h) + +theorem pastCompatible (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) + (coherent : ∀ i j (hi : i < a) (hj : j < a) (h : i ≤ j), + (past j hj).restrictLE h = past i hi) : Diagram.Compatible (pastFamily a past) := by + intro i j h + exact congrArg (fun d : Diagram (Set.Iic i.val) => + d.reindex (fun k : Set.Iic i => (⟨k.val.val, k.property⟩ : Set.Iic i.val)) + (fun _ _ h => h)) (coherent i.val j.val i.property j.property h) + +theorem past_glue_prefix (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) + (compatible : Diagram.Compatible (pastFamily a past)) (b : I) (h : b < a) : + compatible.glue.reindex + (fun i : Set.Iic b => (⟨i.val, lt_of_le_of_lt i.property h⟩ : Set.Iio a)) + (fun _ _ h => h) = past b h := by + exact congrArg (fun d : Diagram (Set.Iic (⟨b, h⟩ : Set.Iio a)) => + d.reindex (fun i : Set.Iic b => + (⟨⟨i.val, lt_of_le_of_lt i.property h⟩, i.property⟩ : Set.Iic (⟨b, h⟩ : Set.Iio a))) + (fun _ _ h => h)) (compatible.glue_restrict ⟨b, h⟩) + +variable (extend : ∀ a : I, (d : Diagram (Set.Iio a)) → d.Cone) + +noncomputable def runStep (a : I) (past : ∀ b, b < a → Diagram (Set.Iic b)) : + Diagram (Set.Iic a) := by + classical + exact if compatible : Diagram.Compatible (pastFamily a past) then + (extend a compatible.glue).append + else Diagram.constant initial + +variable [WellFoundedLT I] + +noncomputable def run : ∀ a : I, Diagram (Set.Iic a) := + wellFounded_lt.fix (runStep extend) + +theorem run_eq (a : I) : + run extend a = runStep extend a (fun b _ => run extend b) := wellFounded_lt.fix_eq _ a + +theorem coherent_at (a : I) : ∀ b (h : b ≤ a), (run extend a).restrictLE h = run extend b := by + refine (show WellFounded ((· < ·) : I → I → Prop) from wellFounded_lt).induction + (C := fun a => ∀ b (h : b ≤ a), (run extend a).restrictLE h = run extend b) a ?_ + intro a ih + have compatible : Diagram.Compatible (pastFamily a (fun b _ => run extend b)) := + pastCompatible a _ (fun i j _ hj h => ih j hj i h) + have generated : run extend a = (extend a compatible.glue).append := + (run_eq extend a).trans + (dite_eq_left (c := Diagram.Compatible (pastFamily a (fun b _ => run extend b))) compatible) + intro b h + rcases lt_or_eq_of_le h with lower | rfl + · rw [generated, Diagram.Cone.append_prefix _ lower] + exact past_glue_prefix a _ compatible b lower + · exact Diagram.restrictLE_self _ + +theorem compatible : Diagram.Compatible (run extend) := fun {_ j} h => coherent_at extend j _ h + +noncomputable def diagram : Diagram I := Diagram.Compatible.glue (f := run extend) (compatible extend) + +theorem diagram_prefix (a : I) : + (diagram extend).reindex (fun i : Set.Iic a => i.val) (fun _ _ h => h) = run extend a := + Diagram.Compatible.glue_restrict (f := run extend) (compatible extend) a + +noncomputable def before (a : I) : Diagram (Set.Iio a) := + (diagram extend).reindex (fun i : Set.Iio a => i.val) (fun _ _ h => h) + +theorem before_prefix {a b : I} (h : b < a) : + (before extend a).reindex + (fun i : Set.Iic b => (⟨i.val, lt_of_le_of_lt i.property h⟩ : Set.Iio a)) + (fun _ _ h => h) = run extend b := diagram_prefix extend b + +theorem past_glue_before (a : I) + (coherent : Diagram.Compatible (pastFamily a (fun b _ => run extend b))) : + coherent.glue = before extend a := by + apply Diagram.ext_of_prefixes + intro i + have old := before_prefix extend i.property + have built := past_glue_prefix a _ coherent i.val i.property + have eq := built.trans old.symm + exact congrArg (fun d : Diagram (Set.Iic i.val) => + d.reindex (fun j : Set.Iic i => (⟨j.val.val, j.property⟩ : Set.Iic i.val)) + (fun _ _ h => h)) eq + +theorem run_generated (a : I) : run extend a = (extend a (before extend a)).append := by + have coherent : Diagram.Compatible (pastFamily a (fun b _ => run extend b)) := + pastCompatible a _ (fun i j _ _ h => coherent_at extend j i h) + have generated : run extend a = (extend a coherent.glue).append := + (run_eq extend a).trans (dite_eq_left (c := Diagram.Compatible (pastFamily a (fun b _ => run extend b))) coherent) + rw [generated, past_glue_before extend a coherent] + +theorem stage_generated (a : I) : + (diagram extend).stage a = (extend a (before extend a)).apex := by + have eq := congrArg (fun d : Diagram (Set.Iic a) => d.stage ⟨a, le_refl a⟩) + (run_generated extend a) + exact eq.trans ((extend a (before extend a)).append_stage_top) + +end Transfinite + + + + + +namespace Diagram +variable {I : Type u} [LinearOrder I] + +theorem transition_indices (d : Diagram I) {i j i' j' : I} (h : i ≤ j) (h' : i' ≤ j') + (hi : i = i') (hj : j = j') : + (d.transition h).transport (congrArg d.stage hi) (congrArg d.stage hj) = d.transition h' := by + cases hi; cases hj; rfl + +theorem Cone.append_leg {a : I} {d : Diagram (Set.Iio a)} (c : d.Cone) (i : Set.Iio a) : + (c.append.transition (i := ⟨i.val, i.property.le⟩) (j := ⟨a, le_refl a⟩) i.property.le).transport + (c.append_stage_old i) c.append_stage_top = c.leg i := by + exact transition_indices c.augmented + (Cone.endIndex_mono (show (⟨i.val, i.property.le⟩ : Set.Iic a) ≤ ⟨a, le_refl a⟩ from i.property.le)) + (show (i : WithTop (Set.Iio a)) ≤ ⊤ from le_top) + (Cone.endIndex_old i) Cone.endIndex_top + +end Diagram + +namespace Transfinite +variable {I : Type u} [LinearOrder I] [WellFoundedLT I] + (extend : ∀ a : I, (d : Diagram (Set.Iio a)) → d.Cone) + +theorem transition_generated (a : I) (i : Set.Iio a) : + ((diagram extend).transition i.property.le).transport rfl (stage_generated extend a) = + (extend a (before extend a)).leg i := by + let c := extend a (before extend a) + have eq : (diagram extend).reindex (fun j : Set.Iic a => j.val) (fun _ _ h => h) = c.append := + (diagram_prefix extend a).trans (run_generated extend a) + have maps := Diagram.transition_of_eq _ _ eq + (i := ⟨i.val, i.property.le⟩) (j := ⟨a, le_refl a⟩) i.property.le + have lifted := congrArg (fun f => f.transport (c.append_stage_old i) c.append_stage_top) maps + erw [Transition.transport_twice] at lifted + exact lifted.trans (c.append_leg i) + +end Transfinite + +namespace Transition + +theorem strict_top_of_transport {s t t' : MainStage.{u}} (f : Transition s t) (eq : t = t') + (strict : ∀ x, ¬ t'.order.le t'.top ((f.transport rfl eq).points.toFun x)) : + ∀ x, ¬ t.order.le t.top (f.points.toFun x) := by cases eq; exact strict + +end Transition + +end + + + +namespace OrdinalRun + +open CountableColumns +variable (Label : Type 1) + +noncomputable def diagram : Diagram Column := Transfinite.diagram (ordinalStep Label) + +noncomputable def stage (a : Column) : MainStage.{1} := (diagram Label).stage a + +noncomputable def transition {a b : Column} (h : a ≤ b) : Transition (stage Label a) (stage Label b) := + (diagram Label).transition h + +noncomputable def before (a : Column) : Diagram (Set.Iio a) := Transfinite.before (ordinalStep Label) a + +theorem stage_zero : stage Label (natural 0) = initial := + (Transfinite.stage_generated (ordinalStep Label) (natural 0)).trans (ordinalStep_zero Label _) + +theorem stage_successor (a : Column) : stage Label (start a) = (stage Label a).next Label := + (Transfinite.stage_generated (ordinalStep Label) (start a)).trans (ordinalStep_successor Label a _) + +theorem stage_limit (a : Column) (limit : Order.IsSuccLimit a.val) : + letI : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ + stage Label a = (before Label a).limit := by + let : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ + exact (Transfinite.stage_generated (ordinalStep Label) a).trans (ordinalStep_limit Label a _ limit) + +theorem transition_self (a : Column) : transition Label (le_refl a) = Transition.identity (stage Label a) := + (diagram Label).self a + +theorem transition_comp {a b c : Column} (hab : a ≤ b) (hbc : b ≤ c) : + transition Label (le_trans hab hbc) = (transition Label hab).comp (transition Label hbc) := + (diagram Label).comp hab hbc + +theorem strict_top {a b : Column} (h : a < b) (x : (stage Label a).Point) : + ¬ (stage Label b).order.le (stage Label b).top ((transition Label h.le).points.toFun x) := by + apply Transition.strict_top_of_transport (transition Label h.le) + (Transfinite.stage_generated (ordinalStep Label) b) _ x + intro y + have maps : (transition Label h.le).transport rfl + (Transfinite.stage_generated (ordinalStep Label) b) = + (ordinalStep Label b (before Label b)).leg ⟨a, h⟩ := + Transfinite.transition_generated (ordinalStep Label) b ⟨a, h⟩ + rw [maps] + exact ordinalStep_strict_top Label b (before Label b) ⟨a, h⟩ y + +theorem transition_height {a b : Column} (h : a ≤ b) (x : (stage Label a).Point) : + (stage Label b).height.value ((transition Label h).points.toFun x) = (stage Label a).height.value x := + (transition Label h).height x + +theorem transition_bottom {a b : Column} (h : a ≤ b) : + (transition Label h).points.toFun (stage Label a).bottom = (stage Label b).bottom := + (transition Label h).bottom + +theorem transition_agreement {a b : Column} (h : a ≤ b) (g k : (stage Label a).Actor) + (v : (stage Label a).Point) + (agree : ∀ x, (stage Label a).order.le x v → + ((stage Label a).action.iso g).toFun x = ((stage Label a).action.iso k).toFun x) : + ∀ x, (stage Label b).order.le x ((transition Label h).points.toFun v) → + ((stage Label b).action.iso ((transition Label h).actors g)).toFun x = + ((stage Label b).action.iso ((transition Label h).actors k)).toFun x := + (transition Label h).agreement g k v agree + +noncomputable def countableOrdinalLabels : Diagram Column := diagram Column + +end OrdinalRun + + + +section + +open Chronological CountableColumns BirthLabels + +structure BirthRecord (s : MainStage.{1}) (a : Column) where + birth : s.Point → Index + bounded : ∀ x, birth x ≤ BirthLabels.top a + old_meet : OldMeet (P := s.order) birth + +namespace BirthRecord +variable {s t q : MainStage.{1}} {a b : Column} + +def constant (s : MainStage.{1}) (a : Column) : BirthRecord s a where + birth _ := BirthLabels.top a + bounded _ := le_rfl + old_meet _ _ earlier _ := False.elim (lt_irrefl _ earlier) + +def transport (r : BirthRecord s a) (eq : s = t) : BirthRecord t a := eq ▸ r + +theorem transport_back_apply (r : BirthRecord t a) (eq : s = t) + (f : Transition q s) (x : q.Point) : + (r.transport eq.symm).birth (f.points.toFun x) = + r.birth ((f.transport rfl eq).points.toFun x) := by cases eq; rfl + +noncomputable def successor (r : BirthRecord s b) (Label : Type 1) (h : b < a) : + BirthRecord (s.next Label) a where + birth := s.nextBirth Label r.birth (inside a) (outside a) (BirthLabels.top a) + bounded := s.nextBirth_le Label r.birth (inside a) (outside a) (BirthLabels.top a) + (fun x n => lt_of_le_of_lt (r.bounded x) (top_before h n)) + (inside_before a) (outside_top a) + old_meet := s.nextBirth_old_meet Label r.birth (inside a) (outside a) (BirthLabels.top a) + (fun x n => lt_of_le_of_lt (r.bounded x) (top_before h n)) + (inside_before a) (outside_top a) (inside_increasing a) (outside_increasing a) r.old_meet + +theorem successor_original (r : BirthRecord s b) (Label : Type 1) (h : b < a) (x : s.Point) : + (r.successor Label h).birth ((s.nextTransition Label).points.toFun x) = r.birth x := + s.nextBirth_original Label r.birth (inside a) (outside a) (BirthLabels.top a) x + +theorem successor_source (r : BirthRecord s b) (Label : Type 1) (h : b < a) + (x : (s.next Label).Point) : + (∃ y, (s.nextTransition Label).points.toFun y = x ∧ + (r.successor Label h).birth x = r.birth y) ∨ main ((r.successor Label h).birth x) = a := + s.nextBirth_source Label a r.birth x + +end BirthRecord + +namespace Diagram +variable {a : Column} (d : Diagram (Set.Iio a)) + (seed : ∀ i, BirthRecord (d.stage i) i.val) + +def BirthCoherent : Prop := ∀ {i j} (h : i ≤ j) x, + (seed j).birth ((d.transition h).points.toFun x) = (seed i).birth x + +variable (coherent : d.BirthCoherent seed) + +noncomputable def unionRecordedBirth : d.orders.system.Union → Index := + d.orders.system.descend (fun i => (seed i).birth) coherent + +theorem unionRecordedBirth_stage (i : Set.Iio a) (x : (d.stage i).Point) : + d.unionRecordedBirth seed coherent (d.orders.system.point i x) = (seed i).birth x := rfl + +theorem unionRecordedBirth_before (x : d.orders.system.Union) : + d.unionRecordedBirth seed coherent x < BirthLabels.top a := by + rcases d.orders.system.cover x with ⟨i, x, rfl⟩ + apply lt_of_le_of_lt ((seed i).bounded x) + exact Prod.Lex.toLex_lt_toLex.mpr (Or.inl i.property) + +theorem unionRecordedBirth_old_meet : + OldMeet (P := d.orders.unionOrder) (d.unionRecordedBirth seed coherent) := + oldMeet_of_covered_stages (fun i => (d.stage i).order) + (d.unionRecordedBirth seed coherent) (fun i => (seed i).birth) d.orders.inclusion + (fun _ _ => rfl) (d.orders.system.pair_cover d.orders.system) (fun i => (seed i).old_meet) + +variable [Nonempty (Set.Iio a)] + +noncomputable def limitBirthRecord : BirthRecord d.limit a where + birth := FixedTop.birth (d.unionRecordedBirth seed coherent) (BirthLabels.top a) + bounded := FixedTop.birth_le _ _ (d.unionRecordedBirth_before seed coherent) + old_meet := FixedTop.old_meet_preserved d.orders.unionOrder _ _ + (d.unionRecordedBirth_before seed coherent) (d.unionRecordedBirth_old_meet seed coherent) + +theorem limitBirthRecord_stage (i : Set.Iio a) (x : (d.stage i).Point) : + (d.limitBirthRecord seed coherent).birth ((d.limitTransition i).points.toFun x) = + (seed i).birth x := rfl + +theorem limitBirthRecord_source (x : d.limit.Point) : + (∃ i y, (d.limitTransition i).points.toFun y = x ∧ + (d.limitBirthRecord seed coherent).birth x = (seed i).birth y) ∨ + main ((d.limitBirthRecord seed coherent).birth x) = a := by + cases x with + | none => exact Or.inr rfl + | some x => + rcases d.orders.system.cover x with ⟨i, y, rfl⟩ + exact Or.inl ⟨i, y, rfl, rfl⟩ + +end Diagram +end + + + +section + +open CountableColumns +universe u + +namespace Diagram.Cone +variable {I : Type u} [LinearOrder I] {d : Diagram I} + +theorem leg_transport {c e : d.Cone} (eq : c = e) (i : I) : + (c.leg i).transport rfl (congrArg Diagram.Cone.apex eq) = e.leg i := by cases eq; rfl + +end Diagram.Cone + +theorem ordinalStep_last_leg (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (last : Set.Iio a) (greatest : ∀ i, i ≤ last) : + ((ordinalStep Label a d).leg last).transport rfl (ordinalStep_last Label a d last greatest) = + (d.stage last).nextTransition Label := by + classical + have inhabited : Nonempty (Set.Iio a) := ⟨last⟩ + have hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last := ⟨last, greatest⟩ + have chosen : hasLast.choose = last := le_antisymm (greatest _) (hasLast.choose_spec last) + have eq : ordinalStep Label a d = + (d.lastCone last greatest).extend (d := d) ((d.stage last).nextTransition Label) := by + simp only [ordinalStep, dite_eq_left inhabited, dite_eq_left hasLast] + let build (p : {last : Set.Iio a // ∀ i, i ≤ last}) : d.Cone := + (d.lastCone p.val p.property).extend (d := d) ((d.stage p.val).nextTransition Label) + change build ⟨hasLast.choose, hasLast.choose_spec⟩ = build ⟨last, greatest⟩ + exact congrArg build (Subtype.ext chosen) + have maps := Diagram.Cone.leg_transport eq last + have same : (((d.lastCone last greatest).extend (d := d) + ((d.stage last).nextTransition Label)).leg last) = (d.stage last).nextTransition Label := by + change (d.transition (greatest last)).comp ((d.stage last).nextTransition Label) = _ + rw [d.self, Transition.identity_comp] + exact maps.trans same + +namespace OrdinalRun +variable (Label : Type 1) + +theorem transition_successor (a : Column) : + (transition Label (lt_start a).le).transport rfl (stage_successor Label a) = + (stage Label a).nextTransition Label := by + have maps := Transfinite.transition_generated (ordinalStep Label) (start a) (predecessor a) + have lifted := congrArg (fun f => f.transport rfl + (ordinalStep_successor Label a (before Label (start a)))) maps + erw [Transition.transport_twice] at lifted + exact lifted.trans (ordinalStep_last_leg Label (start a) (before Label (start a)) + (predecessor a) (predecessor_greatest a)) + +end OrdinalRun + +end + + + + +open CountableColumns BirthLabels + +namespace Diagram +variable {a : Column} (d : Diagram (Set.Iio a)) (c : d.Cone) + (seed : ∀ i, BirthRecord (d.stage i) i.val) + +structure ConeBirth where + record : BirthRecord c.apex a + preserves : ∀ i x, record.birth ((c.leg i).points.toFun x) = (seed i).birth x + source : ∀ x, + (∃ i y, (c.leg i).points.toFun y = x ∧ record.birth x = (seed i).birth y) ∨ + main (record.birth x) = a + +variable (coherent : d.BirthCoherent seed) + +noncomputable def nextConeBirth (Label : Type 1) (last : Set.Iio a) (greatest : ∀ i, i ≤ last) : + d.ConeBirth ((d.lastCone last greatest).extend (d := d) + ((d.stage last).nextTransition Label)) seed where + record := (seed last).successor Label last.property + preserves i x := ((seed last).successor_original Label last.property + ((d.transition (greatest i)).points.toFun x)).trans (coherent (greatest i) x) + source x := by + rcases (seed last).successor_source Label last.property x with ⟨y, eq, born⟩ | fresh + · left + refine ⟨last, y, ?_, born⟩ + change ((d.stage last).nextTransition Label).points.toFun + ((d.transition (greatest last)).points.toFun y) = x + rw [d.self] + exact eq + · exact Or.inr fresh + +noncomputable def limitConeBirth [Nonempty (Set.Iio a)] : d.ConeBirth d.limitCone seed where + record := d.limitBirthRecord seed coherent + preserves := d.limitBirthRecord_stage seed coherent + source := d.limitBirthRecord_source seed coherent + +end Diagram + +noncomputable def ordinalConeBirth (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (seed : ∀ i, BirthRecord (d.stage i) i.val) (coherent : d.BirthCoherent seed) : + d.ConeBirth (ordinalStep Label a d) seed := by + classical + unfold ordinalStep + split + · rename_i inhabited + split + · rename_i hasLast + exact d.nextConeBirth seed coherent Label hasLast.choose hasLast.choose_spec + · letI := inhabited + exact d.limitConeBirth seed coherent + · rename_i empty + exact { + record := BirthRecord.constant initial a + preserves := fun i => False.elim (empty ⟨i⟩) + source := fun _ => Or.inr rfl } + + + + + + +namespace Diagram.ConeBirth +variable {a : Column} {d : Diagram (Set.Iio a)} {c : d.Cone} + {seed : ∀ i, BirthRecord (d.stage i) i.val} (r : d.ConeBirth c seed) + +include r in +theorem pullback (t : MainStage.{1}) (eq : t = c.apex) + (leg : ∀ i, Transition (d.stage i) t) + (same : ∀ i, (leg i).transport rfl eq = c.leg i) : + ∃ q : BirthRecord t a, + (∀ i x, q.birth ((leg i).points.toFun x) = (seed i).birth x) ∧ + (∀ x, (∃ i y, (leg i).points.toFun y = x ∧ q.birth x = (seed i).birth y) ∨ + main (q.birth x) = a) := by + cases eq + have maps (i : Set.Iio a) : leg i = c.leg i := same i + refine ⟨r.record, ?_, ?_⟩ + · intro i x + rw [maps] + exact r.preserves i x + · intro x + rcases r.source x with ⟨i, y, eq, born⟩ | fresh + · exact Or.inl ⟨i, y, (congrArg (fun f => f.points.toFun y) (maps i)).trans eq, born⟩ + · exact Or.inr fresh + +end Diagram.ConeBirth + +namespace OrdinalRun +variable (Label : Type 1) (a : Column) + +abbrev EarlierBirths := ∀ i : Set.Iio a, BirthRecord (stage Label i.val) i.val + +def EarlierCoherent (seed : EarlierBirths Label a) : Prop := + (before Label a).BirthCoherent seed + +variable (seed : EarlierBirths Label a) (coherent : EarlierCoherent Label a seed) + +include coherent in +theorem birth_extension_exists : + ∃ q : BirthRecord (stage Label a) a, + (∀ i x, q.birth ((transition Label i.property.le).points.toFun x) = (seed i).birth x) ∧ + (∀ x, (∃ i y, (transition Label i.property.le).points.toFun y = x ∧ + q.birth x = (seed i).birth y) ∨ main (q.birth x) = a) := + (ordinalConeBirth Label a (before Label a) seed coherent).pullback (stage Label a) + (Transfinite.stage_generated (ordinalStep Label) a) + (fun i => transition Label i.property.le) + (Transfinite.transition_generated (ordinalStep Label) a) + +noncomputable def extendBirths : BirthRecord (stage Label a) a := + Classical.choose (birth_extension_exists Label a seed coherent) + +theorem extendBirths_preserves (i : Set.Iio a) (x : (stage Label i.val).Point) : + (extendBirths Label a seed coherent).birth ((transition Label i.property.le).points.toFun x) = + (seed i).birth x := + (Classical.choose_spec (birth_extension_exists Label a seed coherent)).1 i x + +theorem extendBirths_source (x : (stage Label a).Point) : + (∃ i y, (transition Label i.property.le).points.toFun y = x ∧ + (extendBirths Label a seed coherent).birth x = (seed i).birth y) ∨ + main ((extendBirths Label a seed coherent).birth x) = a := + (Classical.choose_spec (birth_extension_exists Label a seed coherent)).2 x + +end OrdinalRun + +end PartitionPilot.Compression.RecursiveMaps.MainStage + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthOrigins.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthOrigins.lean index bc83d0a94d65e4c9592173a6f0067d2ff8d1a6fd..9479bcaecb304f4585f1668592bb5283e6f5f5a3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthOrigins.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainBirthOrigins.lean @@ -1,411 +1,411 @@ -import Mathlib.Data.Prod.Lex -import OAI.SetTheory.PartitionPrinciple.Geometry.MainRectangles - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps - -section - -open CosetGeometry RationalHeights -universe u - -theorem IdealEmbedding.preserves_bottom {A B : Type u} {P : MeetOrder A} {Q : MeetOrder B} - (e : IdealEmbedding P Q) (bottom : A) (least : ∀ x, P.le bottom x) (y : B) : - Q.le (e.toFun bottom) y := by - rcases e.ideal bottom (Q.meet (e.toFun bottom) y) (Q.meet_le_left _ _) with ⟨x, eq⟩ - have lower := (e.le_iff bottom x).mpr (least x) - rw [eq] at lower - exact Q.trans lower (Q.meet_le_right _ _) - -structure MainStage where - Point : Type u - order : MeetOrder Point - Actor : Type u - [group : Group Actor] - action : OrderAction Actor order - bottom : Point - least : ∀ x, order.le bottom x - top : Point - greatest : ∀ x, order.le x top - height : StrictHeight order (lexOrder CountableColumns.order).toHeightOrder - countable_height : CountableRange height.value - -attribute [instance] MainStage.group - -namespace MainStage - -structure Transition (s t : MainStage.{u}) where - points : MeetEmbedding s.order t.order - actors : s.Actor →* t.Actor - actors_injective : Function.Injective actors - equivariant : ∀ g x, (t.action.iso (actors g)).toFun (points.toFun x) = - points.toFun ((s.action.iso g).toFun x) - bottom : points.toFun s.bottom = t.bottom - height : ∀ x, t.height.value (points.toFun x) = s.height.value x - agreement : ∀ g h v, - (∀ x, s.order.le x v → (s.action.iso g).toFun x = (s.action.iso h).toFun x) → - ∀ x, t.order.le x (points.toFun v) → - (t.action.iso (actors g)).toFun x = (t.action.iso (actors h)).toFun x - -namespace Transition -variable {s t r : MainStage.{u}} - -def identity (s : MainStage.{u}) : Transition s s where - points := (identityIso s.order).toMeetEmbedding - actors := MonoidHom.id s.Actor - actors_injective := Function.injective_id - equivariant _ _ := rfl - bottom := rfl - height _ := rfl - agreement _ _ _ agree := agree - -def comp (f : Transition s t) (g : Transition t r) : Transition s r where - points := compose f.points g.points - actors := g.actors.comp f.actors - actors_injective := g.actors_injective.comp f.actors_injective - equivariant a x := by - change (r.action.iso (g.actors (f.actors a))).toFun (g.points.toFun (f.points.toFun x)) = _ - rw [g.equivariant, f.equivariant] - rfl - bottom := by - change g.points.toFun (f.points.toFun s.bottom) = r.bottom - rw [f.bottom, g.bottom] - height x := (g.height (f.points.toFun x)).trans (f.height x) - agreement a b v agree := - g.agreement (f.actors a) (f.actors b) (f.points.toFun v) (f.agreement a b v agree) - -end Transition -end MainStage - -end - - - -namespace MainStage - -open CosetGeometry RationalHeights -universe u -variable (s : MainStage.{u}) (Label : Type u) - -noncomputable def tasks : TaskSystem s.order s.Actor (s.action.AllTasks Label) Label := - s.action.allTaskSystem s.top s.greatest Label - -noncomputable def internal : MainStage.{u} where - Point := (s.tasks Label).Union - order := (s.tasks Label).unionOrder - Actor := s.Actor - action := { - iso := (s.tasks Label).unionAutomorphism - one := (s.tasks Label).unionAction_one - mul := (s.tasks Label).unionAction_mul } - bottom := (s.tasks Label).originalEmbedding.toFun s.bottom - least := (s.tasks Label).union_bottom s.bottom s.least - top := (s.tasks Label).originalEmbedding.toFun s.top - greatest := (s.tasks Label).union_top - height := (s.tasks Label).rationalUnionHeight CountableColumns.order s.height s.countable_height - countable_height := (s.tasks Label).rationalUnionHeight_countable - CountableColumns.order s.height s.countable_height - -noncomputable def internalTransition : Transition s (s.internal Label) where - points := (s.tasks Label).originalEmbedding - actors := MonoidHom.id s.Actor - actors_injective := Function.injective_id - equivariant _ _ := rfl - bottom := rfl - height := (s.tasks Label).rationalUnionHeight_original - CountableColumns.order s.height s.countable_height - agreement := (s.tasks Label).union_agreement - -inductive RequestIndex where - | compression (task : s.action.AllTasks Label) - | separation (W : s.Point) - | rectangle (data : ActionRectangle s.order s.action.iso) - -noncomputable def request : s.RequestIndex Label → TileRequests.Request (s.internal Label).order - | .compression i => .compression ((s.tasks Label).unionCap i) ((s.tasks Label).unionCompressionIso i) - | .separation W => .separation ((s.internalTransition Label).points.toFun W) - | .rectangle r => .rectangle - (((s.tasks Label).compressionAlgebra.liftRectangle r).toInput - (s.internal Label).top (s.internal Label).greatest) - -noncomputable def requests : TileRequests.Family (s.internal Label).order (s.RequestIndex Label) where - top := (s.internal Label).top - greatest := (s.internal Label).greatest - request := s.request Label - -noncomputable def next : MainStage.{u} where - Point := (s.requests Label).Extension (s.internal Label).action - order := (s.requests Label).extensionOrder (s.internal Label).action - Actor := External s.Actor (s.requests Label).Letters - action := (s.requests Label).extensionAction (s.internal Label).action - bottom := ((s.requests Label).extensionCopy (s.internal Label).action 1).toFun (s.internal Label).bottom - least := ((s.requests Label).extensionCopy (s.internal Label).action 1).preserves_bottom - (s.internal Label).bottom (s.internal Label).least - top := none - greatest := (s.requests Label).extension_greatest (s.internal Label).action - height := (s.requests Label).ordinalExtensionHeight (s.internal Label).action - (s.internal Label).height (s.internal Label).countable_height - countable_height := (s.requests Label).ordinalExtensionHeight_countable (s.internal Label).action - (s.internal Label).height (s.internal Label).countable_height - -noncomputable def externalTransition : Transition (s.internal Label) (s.next Label) where - points := ((s.requests Label).extensionCopy (s.internal Label).action 1).toMeetEmbedding - actors := old s.Actor (s.requests Label).Letters - actors_injective := old_injective s.Actor (s.requests Label).Letters - equivariant := (s.requests Label).extension_extends_old (s.internal Label).action - bottom := rfl - height := (s.requests Label).ordinalExtensionHeight_original (s.internal Label).action - (s.internal Label).height (s.internal Label).countable_height - agreement := by - intro g h v agree x lower - rcases ((s.requests Label).extensionCopy (s.internal Label).action 1).ideal v x lower with ⟨y, rfl⟩ - have eq := agree y - (((s.requests Label).extensionCopy (s.internal Label).action 1).le_iff y v |>.mp lower) - exact ((s.requests Label).extension_extends_old (s.internal Label).action g y).trans - ((congrArg ((s.requests Label).extensionCopy (s.internal Label).action 1).toFun eq).trans - ((s.requests Label).extension_extends_old (s.internal Label).action h y).symm) - -noncomputable def nextTransition : Transition s (s.next Label) := - (s.internalTransition Label).comp (s.externalTransition Label) - -theorem next_strict_top (x : s.Point) : - ¬ (s.next Label).order.le (s.next Label).top ((s.nextTransition Label).points.toFun x) := - ((s.requests Label).extension_strict_top (s.internal Label).action 1 - ((s.internalTransition Label).points.toFun x)).2 - -theorem compression_requested (i : s.action.AllTasks Label) : - (s.requests Label).request (.compression i) = - .compression ((s.tasks Label).unionCap i) ((s.tasks Label).unionCompressionIso i) := rfl - -theorem separation_requested (W : s.Point) : - (s.requests Label).request (.separation W) = - .separation ((s.internalTransition Label).points.toFun W) := rfl - -theorem rectangle_requested (r : ActionRectangle s.order s.action.iso) : - (s.requests Label).request (.rectangle r) = - .rectangle (((s.tasks Label).compressionAlgebra.liftRectangle r).toInput - (s.internal Label).top (s.internal Label).greatest) := rfl - -end MainStage - - - -namespace MainStage - -open Chronological -universe u -variable (s : MainStage.{u}) (Label : Type u) {Stage : Type u} - (seed : s.Point → Stage) (inside outside : Nat → Stage) (topStamp : Stage) - -noncomputable def internalBirth : (s.internal Label).Point → Stage := - (s.tasks Label).recordedUnionBirth seed inside - -noncomputable def nextBirth : (s.next Label).Point → Stage := - FixedTop.birth ((s.requests Label).externalBirth (s.internal Label).action - (s.internalBirth Label seed inside) (fun n _ => outside n)) topStamp - -theorem nextBirth_original (x : s.Point) : - s.nextBirth Label seed inside outside topStamp ((s.nextTransition Label).points.toFun x) = - seed x := by - change (s.requests Label).externalBirth (s.internal Label).action - (s.internalBirth Label seed inside) (fun n _ => outside n) - (((s.requests Label).copy (s.internal Label).action 1).toFun - ((s.tasks Label).originalEmbedding.toFun x)) = seed x - erw [(s.requests Label).externalBirth_original] - rfl - -theorem nextBirth_top : - s.nextBirth Label seed inside outside topStamp (s.next Label).top = topStamp := rfl - -theorem nextBirth_cases (x : (s.next Label).Point) : - (∃ y, s.nextBirth Label seed inside outside topStamp x = seed y) ∨ - (∃ n, s.nextBirth Label seed inside outside topStamp x = inside n) ∨ - (∃ n, s.nextBirth Label seed inside outside topStamp x = outside n) ∨ - s.nextBirth Label seed inside outside topStamp x = topStamp := by - cases x with - | none => exact Or.inr (Or.inr (Or.inr rfl)) - | some x => - rcases (s.requests Label).externalBirth_cases (s.internal Label).action - (s.internalBirth Label seed inside) (fun n _ => outside n) x with ⟨y, eq⟩ | ⟨n, _, eq⟩ - · rcases (s.tasks Label).recordedBirth_cases seed inside y with ⟨z, hz⟩ | ⟨n, hn⟩ - · exact Or.inl ⟨z, eq.trans hz⟩ - · exact Or.inr (Or.inl ⟨n, eq.trans hn⟩) - · exact Or.inr (Or.inr (Or.inl ⟨n, eq⟩)) - -variable [LinearOrder Stage] (seed_before : ∀ x n, seed x < inside n) - (internal_before : ∀ n m, inside n < outside m) - -include seed_before internal_before in -theorem internalBirth_before_external (x : (s.internal Label).Point) (n : Nat) : - s.internalBirth Label seed inside x < outside n := by - change (s.tasks Label).recordedUnionBirth seed inside x < outside n - rcases (s.tasks Label).recordedBirth_cases seed inside x with ⟨y, eq⟩ | ⟨m, eq⟩ - · exact eq ▸ lt_trans (seed_before y 0) (internal_before 0 n) - · exact eq ▸ internal_before m n - -variable (external_top : ∀ n, outside n < topStamp) - -include seed_before internal_before external_top in -theorem nextBirth_le (x : (s.next Label).Point) : - s.nextBirth Label seed inside outside topStamp x ≤ topStamp := by - rcases s.nextBirth_cases Label seed inside outside topStamp x with - ⟨y, eq⟩ | ⟨n, eq⟩ | ⟨n, eq⟩ | eq - · exact eq ▸ (lt_trans (seed_before y 0) - (lt_trans (internal_before 0 0) (external_top 0))).le - · exact eq ▸ (lt_trans (internal_before n 0) (external_top 0)).le - · exact eq ▸ (external_top n).le - · exact eq.le - -include seed_before internal_before external_top in -theorem nextBirth_old_meet - (inside_increasing : ∀ n m, n < m → inside n < inside m) - (outside_increasing : ∀ n m, n < m → outside n < outside m) - (initial : OldMeet (P := s.order) seed) : - OldMeet (P := (s.next Label).order) (s.nextBirth Label seed inside outside topStamp) := by - apply FixedTop.old_meet_preserved - · intro x - rcases (s.requests Label).externalBirth_cases (s.internal Label).action - (s.internalBirth Label seed inside) (fun n _ => outside n) x with ⟨y, eq⟩ | ⟨n, _, eq⟩ - · exact eq ▸ lt_trans - (s.internalBirth_before_external Label seed inside outside seed_before internal_before y 0) - (external_top 0) - · exact eq ▸ external_top n - · apply (s.requests Label).externalBirth_old_meet (s.internal Label).action - (s.internalBirth Label seed inside) (fun n _ => outside n) - · intro x n _ - exact s.internalBirth_before_external Label seed inside outside seed_before internal_before x n - · intro n m _ _ lower - exact outside_increasing n m lower - · exact (s.tasks Label).recordedUnionBirth_old_meet seed inside seed_before inside_increasing initial - -end MainStage - - - -namespace MainStage.BirthLabels - -open CountableColumns - -abbrev Index := Column ×ₗ (Nat ×ₗ Nat) - -def main (t : Index) : Column := (ofLex t).1 -def inside (a : Column) (n : Nat) : Index := toLex (a, toLex (0, n)) -def outside (a : Column) (n : Nat) : Index := toLex (a, toLex (1, n)) -def top (a : Column) : Index := toLex (a, toLex (2, 0)) - -theorem main_inside (a : Column) (n : Nat) : main (inside a n) = a := rfl -theorem main_outside (a : Column) (n : Nat) : main (outside a n) = a := rfl -theorem main_top (a : Column) : main (top a) = a := rfl - -theorem top_before {a b : Column} (h : a < b) (n : Nat) : top a < inside b n := - Prod.Lex.toLex_lt_toLex.mpr (Or.inl h) - -theorem inside_before (a : Column) (n m : Nat) : inside a n < outside a m := - Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, - Prod.Lex.toLex_lt_toLex.mpr (Or.inl Nat.zero_lt_one)⟩) - -theorem outside_top (a : Column) (n : Nat) : outside a n < top a := - Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, - Prod.Lex.toLex_lt_toLex.mpr (Or.inl (Nat.lt_succ_self 1))⟩) - -theorem inside_increasing (a : Column) (n m : Nat) (h : n < m) : inside a n < inside a m := - Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, - Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, h⟩)⟩) - -theorem outside_increasing (a : Column) (n m : Nat) (h : n < m) : outside a n < outside a m := - Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, - Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, h⟩)⟩) - -theorem top_mono {a b : Column} (h : a ≤ b) : top a ≤ top b := by - rcases lt_or_eq_of_le h with h | rfl - · exact Prod.Lex.toLex_le_toLex.mpr (Or.inl h) - · exact le_rfl - -theorem main_le {t : Index} {a : Column} (h : t ≤ top a) : main t ≤ a := - Prod.Lex.monotone_fst t (top a) h - -end MainStage.BirthLabels - - - - -universe u -namespace RootedGluing.Scheme -variable {V Stage : Type u} (d : Scheme V) - (seed : d.Space d.root → Stage) (stamp : ∀ n, (d.stages n).Layer → Stage) - -theorem stageBirth_source (n : Nat) (x : (d.stages n).Point) : - (∃ y, (d.vertex d.root).toFun y = d.chain.point n x ∧ - d.stageBirth seed stamp n x = seed y) ∨ - ∃ m v, d.stageBirth seed stamp n x = stamp m v := by - induction n with - | zero => - left - refine ⟨x, ?_, rfl⟩ - erw [d.vertex_at d.root 0 d.depth_root.le] - rfl - | succ n ih => - cases x with - | inl x => - rcases ih x with ⟨y, eq, born⟩ | fresh - · left - refine ⟨y, ?_, born⟩ - have keep := d.chain.include_up (Nat.le_succ n) x - erw [d.chain.up_succ (le_refl n), d.chain.up_self] at keep - exact eq.trans keep.symm - · exact Or.inr fresh - | inr x => exact Or.inr ⟨n, x.1, rfl⟩ - -theorem unionBirth_source (x : d.Node) : - (∃ y, (d.vertex d.root).toFun y = x ∧ d.unionBirth seed stamp x = seed y) ∨ - ∃ n v, d.unionBirth seed stamp x = stamp n v := by - rcases d.chain.cover x with ⟨n, x, rfl⟩ - exact d.stageBirth_source seed stamp n x - -end RootedGluing.Scheme - -namespace TileRequests.Family -open CosetGeometry -variable {A J R Stage : Type u} [Group J] {P : MeetOrder A} - (f : Family P R) (a : OrderAction J P) - (seed : A → Stage) (stamp : ∀ n, f.Layer a n → Stage) - -theorem externalBirth_source (x : f.Node a) : - (∃ y, (f.copy a 1).toFun y = x ∧ f.externalBirth a seed stamp x = seed y) ∨ - ∃ n v, f.externalBirth a seed stamp x = stamp n v := by - rcases (f.diagram a).scheme.unionBirth_source seed stamp x with ⟨y, eq, born⟩ | fresh - · exact Or.inl ⟨y, (f.copy_one a y).trans eq, born⟩ - · exact Or.inr fresh - -end TileRequests.Family - -namespace MainStage -open BirthLabels CountableColumns -variable (s : MainStage.{1}) (Label : Type 1) (a : Column) (seed : s.Point → Index) - -theorem nextBirth_source (x : (s.next Label).Point) : - (∃ y, (s.nextTransition Label).points.toFun y = x ∧ - s.nextBirth Label seed (inside a) (outside a) (BirthLabels.top a) x = seed y) ∨ - main (s.nextBirth Label seed (inside a) (outside a) (BirthLabels.top a) x) = a := by - cases x with - | none => exact Or.inr rfl - | some x => - rcases (s.requests Label).externalBirth_source (s.internal Label).action - (s.internalBirth Label seed (inside a)) (fun n _ => outside a n) x with - ⟨y, eq, born⟩ | ⟨n, _, born⟩ - · cases y with - | inl y => exact Or.inl ⟨y, congrArg some eq, born⟩ - | inr y => - right - exact congrArg main born - · right - exact congrArg main born - -end MainStage - - -end PartitionPilot.Compression.RecursiveMaps - -end OAI +import Mathlib.Data.Prod.Lex +import OAI.SetTheory.PartitionPrinciple.Geometry.MainRectangles + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps + +section + +open CosetGeometry RationalHeights +universe u + +theorem IdealEmbedding.preserves_bottom {A B : Type u} {P : MeetOrder A} {Q : MeetOrder B} + (e : IdealEmbedding P Q) (bottom : A) (least : ∀ x, P.le bottom x) (y : B) : + Q.le (e.toFun bottom) y := by + rcases e.ideal bottom (Q.meet (e.toFun bottom) y) (Q.meet_le_left _ _) with ⟨x, eq⟩ + have lower := (e.le_iff bottom x).mpr (least x) + rw [eq] at lower + exact Q.trans lower (Q.meet_le_right _ _) + +structure MainStage where + Point : Type u + order : MeetOrder Point + Actor : Type u + [group : Group Actor] + action : OrderAction Actor order + bottom : Point + least : ∀ x, order.le bottom x + top : Point + greatest : ∀ x, order.le x top + height : StrictHeight order (lexOrder CountableColumns.order).toHeightOrder + countable_height : CountableRange height.value + +attribute [instance] MainStage.group + +namespace MainStage + +structure Transition (s t : MainStage.{u}) where + points : MeetEmbedding s.order t.order + actors : s.Actor →* t.Actor + actors_injective : Function.Injective actors + equivariant : ∀ g x, (t.action.iso (actors g)).toFun (points.toFun x) = + points.toFun ((s.action.iso g).toFun x) + bottom : points.toFun s.bottom = t.bottom + height : ∀ x, t.height.value (points.toFun x) = s.height.value x + agreement : ∀ g h v, + (∀ x, s.order.le x v → (s.action.iso g).toFun x = (s.action.iso h).toFun x) → + ∀ x, t.order.le x (points.toFun v) → + (t.action.iso (actors g)).toFun x = (t.action.iso (actors h)).toFun x + +namespace Transition +variable {s t r : MainStage.{u}} + +def identity (s : MainStage.{u}) : Transition s s where + points := (identityIso s.order).toMeetEmbedding + actors := MonoidHom.id s.Actor + actors_injective := Function.injective_id + equivariant _ _ := rfl + bottom := rfl + height _ := rfl + agreement _ _ _ agree := agree + +def comp (f : Transition s t) (g : Transition t r) : Transition s r where + points := compose f.points g.points + actors := g.actors.comp f.actors + actors_injective := g.actors_injective.comp f.actors_injective + equivariant a x := by + change (r.action.iso (g.actors (f.actors a))).toFun (g.points.toFun (f.points.toFun x)) = _ + rw [g.equivariant, f.equivariant] + rfl + bottom := by + change g.points.toFun (f.points.toFun s.bottom) = r.bottom + rw [f.bottom, g.bottom] + height x := (g.height (f.points.toFun x)).trans (f.height x) + agreement a b v agree := + g.agreement (f.actors a) (f.actors b) (f.points.toFun v) (f.agreement a b v agree) + +end Transition +end MainStage + +end + + + +namespace MainStage + +open CosetGeometry RationalHeights +universe u +variable (s : MainStage.{u}) (Label : Type u) + +noncomputable def tasks : TaskSystem s.order s.Actor (s.action.AllTasks Label) Label := + s.action.allTaskSystem s.top s.greatest Label + +noncomputable def internal : MainStage.{u} where + Point := (s.tasks Label).Union + order := (s.tasks Label).unionOrder + Actor := s.Actor + action := { + iso := (s.tasks Label).unionAutomorphism + one := (s.tasks Label).unionAction_one + mul := (s.tasks Label).unionAction_mul } + bottom := (s.tasks Label).originalEmbedding.toFun s.bottom + least := (s.tasks Label).union_bottom s.bottom s.least + top := (s.tasks Label).originalEmbedding.toFun s.top + greatest := (s.tasks Label).union_top + height := (s.tasks Label).rationalUnionHeight CountableColumns.order s.height s.countable_height + countable_height := (s.tasks Label).rationalUnionHeight_countable + CountableColumns.order s.height s.countable_height + +noncomputable def internalTransition : Transition s (s.internal Label) where + points := (s.tasks Label).originalEmbedding + actors := MonoidHom.id s.Actor + actors_injective := Function.injective_id + equivariant _ _ := rfl + bottom := rfl + height := (s.tasks Label).rationalUnionHeight_original + CountableColumns.order s.height s.countable_height + agreement := (s.tasks Label).union_agreement + +inductive RequestIndex where + | compression (task : s.action.AllTasks Label) + | separation (W : s.Point) + | rectangle (data : ActionRectangle s.order s.action.iso) + +noncomputable def request : s.RequestIndex Label → TileRequests.Request (s.internal Label).order + | .compression i => .compression ((s.tasks Label).unionCap i) ((s.tasks Label).unionCompressionIso i) + | .separation W => .separation ((s.internalTransition Label).points.toFun W) + | .rectangle r => .rectangle + (((s.tasks Label).compressionAlgebra.liftRectangle r).toInput + (s.internal Label).top (s.internal Label).greatest) + +noncomputable def requests : TileRequests.Family (s.internal Label).order (s.RequestIndex Label) where + top := (s.internal Label).top + greatest := (s.internal Label).greatest + request := s.request Label + +noncomputable def next : MainStage.{u} where + Point := (s.requests Label).Extension (s.internal Label).action + order := (s.requests Label).extensionOrder (s.internal Label).action + Actor := External s.Actor (s.requests Label).Letters + action := (s.requests Label).extensionAction (s.internal Label).action + bottom := ((s.requests Label).extensionCopy (s.internal Label).action 1).toFun (s.internal Label).bottom + least := ((s.requests Label).extensionCopy (s.internal Label).action 1).preserves_bottom + (s.internal Label).bottom (s.internal Label).least + top := none + greatest := (s.requests Label).extension_greatest (s.internal Label).action + height := (s.requests Label).ordinalExtensionHeight (s.internal Label).action + (s.internal Label).height (s.internal Label).countable_height + countable_height := (s.requests Label).ordinalExtensionHeight_countable (s.internal Label).action + (s.internal Label).height (s.internal Label).countable_height + +noncomputable def externalTransition : Transition (s.internal Label) (s.next Label) where + points := ((s.requests Label).extensionCopy (s.internal Label).action 1).toMeetEmbedding + actors := old s.Actor (s.requests Label).Letters + actors_injective := old_injective s.Actor (s.requests Label).Letters + equivariant := (s.requests Label).extension_extends_old (s.internal Label).action + bottom := rfl + height := (s.requests Label).ordinalExtensionHeight_original (s.internal Label).action + (s.internal Label).height (s.internal Label).countable_height + agreement := by + intro g h v agree x lower + rcases ((s.requests Label).extensionCopy (s.internal Label).action 1).ideal v x lower with ⟨y, rfl⟩ + have eq := agree y + (((s.requests Label).extensionCopy (s.internal Label).action 1).le_iff y v |>.mp lower) + exact ((s.requests Label).extension_extends_old (s.internal Label).action g y).trans + ((congrArg ((s.requests Label).extensionCopy (s.internal Label).action 1).toFun eq).trans + ((s.requests Label).extension_extends_old (s.internal Label).action h y).symm) + +noncomputable def nextTransition : Transition s (s.next Label) := + (s.internalTransition Label).comp (s.externalTransition Label) + +theorem next_strict_top (x : s.Point) : + ¬ (s.next Label).order.le (s.next Label).top ((s.nextTransition Label).points.toFun x) := + ((s.requests Label).extension_strict_top (s.internal Label).action 1 + ((s.internalTransition Label).points.toFun x)).2 + +theorem compression_requested (i : s.action.AllTasks Label) : + (s.requests Label).request (.compression i) = + .compression ((s.tasks Label).unionCap i) ((s.tasks Label).unionCompressionIso i) := rfl + +theorem separation_requested (W : s.Point) : + (s.requests Label).request (.separation W) = + .separation ((s.internalTransition Label).points.toFun W) := rfl + +theorem rectangle_requested (r : ActionRectangle s.order s.action.iso) : + (s.requests Label).request (.rectangle r) = + .rectangle (((s.tasks Label).compressionAlgebra.liftRectangle r).toInput + (s.internal Label).top (s.internal Label).greatest) := rfl + +end MainStage + + + +namespace MainStage + +open Chronological +universe u +variable (s : MainStage.{u}) (Label : Type u) {Stage : Type u} + (seed : s.Point → Stage) (inside outside : Nat → Stage) (topStamp : Stage) + +noncomputable def internalBirth : (s.internal Label).Point → Stage := + (s.tasks Label).recordedUnionBirth seed inside + +noncomputable def nextBirth : (s.next Label).Point → Stage := + FixedTop.birth ((s.requests Label).externalBirth (s.internal Label).action + (s.internalBirth Label seed inside) (fun n _ => outside n)) topStamp + +theorem nextBirth_original (x : s.Point) : + s.nextBirth Label seed inside outside topStamp ((s.nextTransition Label).points.toFun x) = + seed x := by + change (s.requests Label).externalBirth (s.internal Label).action + (s.internalBirth Label seed inside) (fun n _ => outside n) + (((s.requests Label).copy (s.internal Label).action 1).toFun + ((s.tasks Label).originalEmbedding.toFun x)) = seed x + erw [(s.requests Label).externalBirth_original] + rfl + +theorem nextBirth_top : + s.nextBirth Label seed inside outside topStamp (s.next Label).top = topStamp := rfl + +theorem nextBirth_cases (x : (s.next Label).Point) : + (∃ y, s.nextBirth Label seed inside outside topStamp x = seed y) ∨ + (∃ n, s.nextBirth Label seed inside outside topStamp x = inside n) ∨ + (∃ n, s.nextBirth Label seed inside outside topStamp x = outside n) ∨ + s.nextBirth Label seed inside outside topStamp x = topStamp := by + cases x with + | none => exact Or.inr (Or.inr (Or.inr rfl)) + | some x => + rcases (s.requests Label).externalBirth_cases (s.internal Label).action + (s.internalBirth Label seed inside) (fun n _ => outside n) x with ⟨y, eq⟩ | ⟨n, _, eq⟩ + · rcases (s.tasks Label).recordedBirth_cases seed inside y with ⟨z, hz⟩ | ⟨n, hn⟩ + · exact Or.inl ⟨z, eq.trans hz⟩ + · exact Or.inr (Or.inl ⟨n, eq.trans hn⟩) + · exact Or.inr (Or.inr (Or.inl ⟨n, eq⟩)) + +variable [LinearOrder Stage] (seed_before : ∀ x n, seed x < inside n) + (internal_before : ∀ n m, inside n < outside m) + +include seed_before internal_before in +theorem internalBirth_before_external (x : (s.internal Label).Point) (n : Nat) : + s.internalBirth Label seed inside x < outside n := by + change (s.tasks Label).recordedUnionBirth seed inside x < outside n + rcases (s.tasks Label).recordedBirth_cases seed inside x with ⟨y, eq⟩ | ⟨m, eq⟩ + · exact eq ▸ lt_trans (seed_before y 0) (internal_before 0 n) + · exact eq ▸ internal_before m n + +variable (external_top : ∀ n, outside n < topStamp) + +include seed_before internal_before external_top in +theorem nextBirth_le (x : (s.next Label).Point) : + s.nextBirth Label seed inside outside topStamp x ≤ topStamp := by + rcases s.nextBirth_cases Label seed inside outside topStamp x with + ⟨y, eq⟩ | ⟨n, eq⟩ | ⟨n, eq⟩ | eq + · exact eq ▸ (lt_trans (seed_before y 0) + (lt_trans (internal_before 0 0) (external_top 0))).le + · exact eq ▸ (lt_trans (internal_before n 0) (external_top 0)).le + · exact eq ▸ (external_top n).le + · exact eq.le + +include seed_before internal_before external_top in +theorem nextBirth_old_meet + (inside_increasing : ∀ n m, n < m → inside n < inside m) + (outside_increasing : ∀ n m, n < m → outside n < outside m) + (initial : OldMeet (P := s.order) seed) : + OldMeet (P := (s.next Label).order) (s.nextBirth Label seed inside outside topStamp) := by + apply FixedTop.old_meet_preserved + · intro x + rcases (s.requests Label).externalBirth_cases (s.internal Label).action + (s.internalBirth Label seed inside) (fun n _ => outside n) x with ⟨y, eq⟩ | ⟨n, _, eq⟩ + · exact eq ▸ lt_trans + (s.internalBirth_before_external Label seed inside outside seed_before internal_before y 0) + (external_top 0) + · exact eq ▸ external_top n + · apply (s.requests Label).externalBirth_old_meet (s.internal Label).action + (s.internalBirth Label seed inside) (fun n _ => outside n) + · intro x n _ + exact s.internalBirth_before_external Label seed inside outside seed_before internal_before x n + · intro n m _ _ lower + exact outside_increasing n m lower + · exact (s.tasks Label).recordedUnionBirth_old_meet seed inside seed_before inside_increasing initial + +end MainStage + + + +namespace MainStage.BirthLabels + +open CountableColumns + +abbrev Index := Column ×ₗ (Nat ×ₗ Nat) + +def main (t : Index) : Column := (ofLex t).1 +def inside (a : Column) (n : Nat) : Index := toLex (a, toLex (0, n)) +def outside (a : Column) (n : Nat) : Index := toLex (a, toLex (1, n)) +def top (a : Column) : Index := toLex (a, toLex (2, 0)) + +theorem main_inside (a : Column) (n : Nat) : main (inside a n) = a := rfl +theorem main_outside (a : Column) (n : Nat) : main (outside a n) = a := rfl +theorem main_top (a : Column) : main (top a) = a := rfl + +theorem top_before {a b : Column} (h : a < b) (n : Nat) : top a < inside b n := + Prod.Lex.toLex_lt_toLex.mpr (Or.inl h) + +theorem inside_before (a : Column) (n m : Nat) : inside a n < outside a m := + Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, + Prod.Lex.toLex_lt_toLex.mpr (Or.inl Nat.zero_lt_one)⟩) + +theorem outside_top (a : Column) (n : Nat) : outside a n < top a := + Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, + Prod.Lex.toLex_lt_toLex.mpr (Or.inl (Nat.lt_succ_self 1))⟩) + +theorem inside_increasing (a : Column) (n m : Nat) (h : n < m) : inside a n < inside a m := + Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, + Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, h⟩)⟩) + +theorem outside_increasing (a : Column) (n m : Nat) (h : n < m) : outside a n < outside a m := + Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, + Prod.Lex.toLex_lt_toLex.mpr (Or.inr ⟨rfl, h⟩)⟩) + +theorem top_mono {a b : Column} (h : a ≤ b) : top a ≤ top b := by + rcases lt_or_eq_of_le h with h | rfl + · exact Prod.Lex.toLex_le_toLex.mpr (Or.inl h) + · exact le_rfl + +theorem main_le {t : Index} {a : Column} (h : t ≤ top a) : main t ≤ a := + Prod.Lex.monotone_fst t (top a) h + +end MainStage.BirthLabels + + + + +universe u +namespace RootedGluing.Scheme +variable {V Stage : Type u} (d : Scheme V) + (seed : d.Space d.root → Stage) (stamp : ∀ n, (d.stages n).Layer → Stage) + +theorem stageBirth_source (n : Nat) (x : (d.stages n).Point) : + (∃ y, (d.vertex d.root).toFun y = d.chain.point n x ∧ + d.stageBirth seed stamp n x = seed y) ∨ + ∃ m v, d.stageBirth seed stamp n x = stamp m v := by + induction n with + | zero => + left + refine ⟨x, ?_, rfl⟩ + erw [d.vertex_at d.root 0 d.depth_root.le] + rfl + | succ n ih => + cases x with + | inl x => + rcases ih x with ⟨y, eq, born⟩ | fresh + · left + refine ⟨y, ?_, born⟩ + have keep := d.chain.include_up (Nat.le_succ n) x + erw [d.chain.up_succ (le_refl n), d.chain.up_self] at keep + exact eq.trans keep.symm + · exact Or.inr fresh + | inr x => exact Or.inr ⟨n, x.1, rfl⟩ + +theorem unionBirth_source (x : d.Node) : + (∃ y, (d.vertex d.root).toFun y = x ∧ d.unionBirth seed stamp x = seed y) ∨ + ∃ n v, d.unionBirth seed stamp x = stamp n v := by + rcases d.chain.cover x with ⟨n, x, rfl⟩ + exact d.stageBirth_source seed stamp n x + +end RootedGluing.Scheme + +namespace TileRequests.Family +open CosetGeometry +variable {A J R Stage : Type u} [Group J] {P : MeetOrder A} + (f : Family P R) (a : OrderAction J P) + (seed : A → Stage) (stamp : ∀ n, f.Layer a n → Stage) + +theorem externalBirth_source (x : f.Node a) : + (∃ y, (f.copy a 1).toFun y = x ∧ f.externalBirth a seed stamp x = seed y) ∨ + ∃ n v, f.externalBirth a seed stamp x = stamp n v := by + rcases (f.diagram a).scheme.unionBirth_source seed stamp x with ⟨y, eq, born⟩ | fresh + · exact Or.inl ⟨y, (f.copy_one a y).trans eq, born⟩ + · exact Or.inr fresh + +end TileRequests.Family + +namespace MainStage +open BirthLabels CountableColumns +variable (s : MainStage.{1}) (Label : Type 1) (a : Column) (seed : s.Point → Index) + +theorem nextBirth_source (x : (s.next Label).Point) : + (∃ y, (s.nextTransition Label).points.toFun y = x ∧ + s.nextBirth Label seed (inside a) (outside a) (BirthLabels.top a) x = seed y) ∨ + main (s.nextBirth Label seed (inside a) (outside a) (BirthLabels.top a) x) = a := by + cases x with + | none => exact Or.inr rfl + | some x => + rcases (s.requests Label).externalBirth_source (s.internal Label).action + (s.internalBirth Label seed (inside a)) (fun n _ => outside a n) x with + ⟨y, eq, born⟩ | ⟨n, _, born⟩ + · cases y with + | inl y => exact Or.inl ⟨y, congrArg some eq, born⟩ + | inr y => + right + exact congrArg main born + · right + exact congrArg main born + +end MainStage + + +end PartitionPilot.Compression.RecursiveMaps + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainOrdinalSteps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainOrdinalSteps.lean index 3ea63bd7f7e6f8b066d15f3c53710a7b6313262e..f54cbacb61c576d9488bde7c0770804f5b5ac2d3 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainOrdinalSteps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainOrdinalSteps.lean @@ -1,129 +1,129 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.MainEndpoints - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -namespace CountableColumns - -instance below_countable (a : Column) : Countable (Set.Iio a) := by - let : Countable (Set.Iio a.val) := (initialSegment_countable a).to_subtype - let f : Set.Iio a → Set.Iio a.val := fun i => ⟨i.val.val, i.property⟩ - have injective : Function.Injective f := by - intro i j eq - apply Subtype.ext - apply Subtype.ext - exact congrArg (fun k : Set.Iio a.val => k.val) eq - exact injective.countable - -theorem start_val (a : Column) : (start a).val = Order.succ a.val := by - change a.val + (1 : Nat) = _ - rw [Nat.cast_one, Order.succ_eq_add_one] - -def predecessor (a : Column) : Set.Iio (start a) := ⟨a, lt_start a⟩ - -theorem predecessor_greatest (a : Column) (i : Set.Iio (start a)) : i ≤ predecessor a := by - change i.val.val ≤ a.val - have h := i.property - change i.val.val < (start a).val at h - rw [start_val] at h - exact Order.lt_succ_iff.mp h - -theorem limit_no_last (a : Column) (limit : Order.IsSuccLimit a.val) : - ¬ ∃ last : Set.Iio a, ∀ i, i ≤ last := by - rintro ⟨last, greatest⟩ - have small : start last.val < a := by - change (start last.val).val < a.val - rw [start_val] - exact limit.succ_lt last.property - exact (not_le_of_gt (lt_start last.val)) (greatest ⟨start last.val, small⟩) - -end CountableColumns - -namespace MainStage -open CountableColumns - -noncomputable def ordinalStep (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) : d.Cone := by - classical - exact if inhabited : Nonempty (Set.Iio a) then - if hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last then - (d.lastCone hasLast.choose hasLast.choose_spec).extend (d := d) - ((d.stage hasLast.choose).nextTransition Label) - else - letI := inhabited - d.limitCone - else { - apex := initial - leg := fun i => False.elim (inhabited ⟨i⟩) - coherent := fun {i} => False.elim (inhabited ⟨i⟩) } - -theorem ordinalStep_empty (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (empty : ¬ Nonempty (Set.Iio a)) : (ordinalStep Label a d).apex = initial := by - simp only [ordinalStep, dite_eq_right empty] - -theorem ordinalStep_last (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (last : Set.Iio a) (greatest : ∀ i, i ≤ last) : - (ordinalStep Label a d).apex = (d.stage last).next Label := by - have inhabited : Nonempty (Set.Iio a) := ⟨last⟩ - have hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last := ⟨last, greatest⟩ - have eq : hasLast.choose = last := le_antisymm (greatest _) (hasLast.choose_spec last) - simp only [ordinalStep, dite_eq_left inhabited, dite_eq_left hasLast, - Diagram.Cone.extend, Diagram.lastCone] - rw [eq] - -theorem ordinalStep_limit (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (limit : Order.IsSuccLimit a.val) : - letI : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ - (ordinalStep Label a d).apex = d.limit := by - let : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ - simp only [ordinalStep, dite_eq_left (inferInstance : Nonempty (Set.Iio a)), - dite_eq_right (limit_no_last a limit), Diagram.limitCone] - -theorem ordinalStep_zero (Label : Type 1) (d : Diagram (Set.Iio (natural 0))) : - (ordinalStep Label (natural 0) d).apex = initial := by - apply ordinalStep_empty - rintro ⟨i⟩ - exact (not_lt_of_ge (zero_le : 0 ≤ i.val.val)) i.property - -theorem ordinalStep_successor (Label : Type 1) (a : Column) - (d : Diagram (Set.Iio (start a))) : - (ordinalStep Label (start a) d).apex = (d.stage (predecessor a)).next Label := - ordinalStep_last Label (start a) d (predecessor a) (predecessor_greatest a) - -theorem ordinalStep_strict_top (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (i : Set.Iio a) (x : (d.stage i).Point) : - ¬ (ordinalStep Label a d).apex.order.le (ordinalStep Label a d).apex.top - (((ordinalStep Label a d).leg i).points.toFun x) := by - classical - have inhabited : Nonempty (Set.Iio a) := ⟨i⟩ - by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last - · have eq : ordinalStep Label a d = - (d.lastCone hasLast.choose hasLast.choose_spec).extend (d := d) - ((d.stage hasLast.choose).nextTransition Label) := - (dite_eq_left inhabited).trans (dite_eq_left hasLast) - rw [eq] - exact (d.stage _).next_strict_top Label ((d.transition _).points.toFun x) - · let := inhabited - have eq : ordinalStep Label a d = d.limitCone := - (dite_eq_left inhabited).trans (dite_eq_right hasLast) - rw [eq] - exact d.limit_strict_top i x - -noncomputable def ordinalAppend (Label : Type 1) (a : Column) - (d : Diagram (Set.Iio a)) : Diagram (Set.Iic a) := (ordinalStep Label a d).append - -theorem ordinalAppend_restrict (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) : - (ordinalAppend Label a d).reindex - (fun i : Set.Iio a => (⟨i.val, (show i.val < a from i.property).le⟩ : Set.Iic a)) - (fun _ _ h => h) = d := - (ordinalStep Label a d).append_restrict - -end MainStage - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.MainEndpoints + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +namespace CountableColumns + +instance below_countable (a : Column) : Countable (Set.Iio a) := by + let : Countable (Set.Iio a.val) := (initialSegment_countable a).to_subtype + let f : Set.Iio a → Set.Iio a.val := fun i => ⟨i.val.val, i.property⟩ + have injective : Function.Injective f := by + intro i j eq + apply Subtype.ext + apply Subtype.ext + exact congrArg (fun k : Set.Iio a.val => k.val) eq + exact injective.countable + +theorem start_val (a : Column) : (start a).val = Order.succ a.val := by + change a.val + (1 : Nat) = _ + rw [Nat.cast_one, Order.succ_eq_add_one] + +def predecessor (a : Column) : Set.Iio (start a) := ⟨a, lt_start a⟩ + +theorem predecessor_greatest (a : Column) (i : Set.Iio (start a)) : i ≤ predecessor a := by + change i.val.val ≤ a.val + have h := i.property + change i.val.val < (start a).val at h + rw [start_val] at h + exact Order.lt_succ_iff.mp h + +theorem limit_no_last (a : Column) (limit : Order.IsSuccLimit a.val) : + ¬ ∃ last : Set.Iio a, ∀ i, i ≤ last := by + rintro ⟨last, greatest⟩ + have small : start last.val < a := by + change (start last.val).val < a.val + rw [start_val] + exact limit.succ_lt last.property + exact (not_le_of_gt (lt_start last.val)) (greatest ⟨start last.val, small⟩) + +end CountableColumns + +namespace MainStage +open CountableColumns + +noncomputable def ordinalStep (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) : d.Cone := by + classical + exact if inhabited : Nonempty (Set.Iio a) then + if hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last then + (d.lastCone hasLast.choose hasLast.choose_spec).extend (d := d) + ((d.stage hasLast.choose).nextTransition Label) + else + letI := inhabited + d.limitCone + else { + apex := initial + leg := fun i => False.elim (inhabited ⟨i⟩) + coherent := fun {i} => False.elim (inhabited ⟨i⟩) } + +theorem ordinalStep_empty (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (empty : ¬ Nonempty (Set.Iio a)) : (ordinalStep Label a d).apex = initial := by + simp only [ordinalStep, dite_eq_right empty] + +theorem ordinalStep_last (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (last : Set.Iio a) (greatest : ∀ i, i ≤ last) : + (ordinalStep Label a d).apex = (d.stage last).next Label := by + have inhabited : Nonempty (Set.Iio a) := ⟨last⟩ + have hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last := ⟨last, greatest⟩ + have eq : hasLast.choose = last := le_antisymm (greatest _) (hasLast.choose_spec last) + simp only [ordinalStep, dite_eq_left inhabited, dite_eq_left hasLast, + Diagram.Cone.extend, Diagram.lastCone] + rw [eq] + +theorem ordinalStep_limit (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (limit : Order.IsSuccLimit a.val) : + letI : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ + (ordinalStep Label a d).apex = d.limit := by + let : Nonempty (Set.Iio a) := ⟨⟨natural 0, limit.pos⟩⟩ + simp only [ordinalStep, dite_eq_left (inferInstance : Nonempty (Set.Iio a)), + dite_eq_right (limit_no_last a limit), Diagram.limitCone] + +theorem ordinalStep_zero (Label : Type 1) (d : Diagram (Set.Iio (natural 0))) : + (ordinalStep Label (natural 0) d).apex = initial := by + apply ordinalStep_empty + rintro ⟨i⟩ + exact (not_lt_of_ge (zero_le : 0 ≤ i.val.val)) i.property + +theorem ordinalStep_successor (Label : Type 1) (a : Column) + (d : Diagram (Set.Iio (start a))) : + (ordinalStep Label (start a) d).apex = (d.stage (predecessor a)).next Label := + ordinalStep_last Label (start a) d (predecessor a) (predecessor_greatest a) + +theorem ordinalStep_strict_top (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (i : Set.Iio a) (x : (d.stage i).Point) : + ¬ (ordinalStep Label a d).apex.order.le (ordinalStep Label a d).apex.top + (((ordinalStep Label a d).leg i).points.toFun x) := by + classical + have inhabited : Nonempty (Set.Iio a) := ⟨i⟩ + by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last + · have eq : ordinalStep Label a d = + (d.lastCone hasLast.choose hasLast.choose_spec).extend (d := d) + ((d.stage hasLast.choose).nextTransition Label) := + (dite_eq_left inhabited).trans (dite_eq_left hasLast) + rw [eq] + exact (d.stage _).next_strict_top Label ((d.transition _).points.toFun x) + · let := inhabited + have eq : ordinalStep Label a d = d.limitCone := + (dite_eq_left inhabited).trans (dite_eq_right hasLast) + rw [eq] + exact d.limit_strict_top i x + +noncomputable def ordinalAppend (Label : Type 1) (a : Column) + (d : Diagram (Set.Iio a)) : Diagram (Set.Iic a) := (ordinalStep Label a d).append + +theorem ordinalAppend_restrict (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) : + (ordinalAppend Label a d).reindex + (fun i : Set.Iio a => (⟨i.val, (show i.val < a from i.property).le⟩ : Set.Iic a)) + (fun _ _ h => h) = d := + (ordinalStep Label a d).append_restrict + +end MainStage + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixHistoryUnionRecognition.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixHistoryUnionRecognition.lean index 1bf55ecda1884e51fd91d535a14016860cd26e3a..30835a1e0b4f63cbd908e9c7bdeb668906cf1236 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixHistoryUnionRecognition.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixHistoryUnionRecognition.lean @@ -1,831 +1,831 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedProfileTransitionRecognition - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -universe u v - -structure MainPrefixGraphFamily (M : TransitiveGround.{u}) - (K Labels C D rD : ZFSet.{u}) (I : Type v) where - indices : I → ZFSet.{u} - stages : I → ZFSet.{u} - transitions : I → ZFSet.{u} - valid : ∀ i, MainPrefixGraphCode M K Labels C D rD (indices i) (stages i) (transitions i) - mono : ∀ i j, indices i ⊆ indices j → stages i ⊆ stages j ∧ transitions i ⊆ transitions j - -namespace MainPrefixGraphFamily -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {I : Type v} [Small.{u} I] -variable (family : MainPrefixGraphFamily M K Labels C D rD I) - -noncomputable def indexUnion : ZFSet.{u} := ⋃₀ ZFSet.range family.indices -noncomputable def stageUnion : ZFSet.{u} := ⋃₀ ZFSet.range family.stages -noncomputable def transitionUnion : ZFSet.{u} := ⋃₀ ZFSet.range family.transitions - -noncomputable def code (i : I) : ZFSet.{u} := - mainPrefixCode (family.indices i) (family.stages i) (family.transitions i) - -noncomputable def unionCode : ZFSet.{u} := - mainPrefixCode family.indexUnion family.stageUnion family.transitionUnion - -theorem indexUnion_mem (x : ZFSet.{u}) : x ∈ family.indexUnion ↔ ∃ i, x ∈ family.indices i := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem stageUnion_mem (x : ZFSet.{u}) : x ∈ family.stageUnion ↔ ∃ i, x ∈ family.stages i := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem transitionUnion_mem (x : ZFSet.{u}) : - x ∈ family.transitionUnion ↔ ∃ i, x ∈ family.transitions i := - familyCodeGraph_valueUnion_mem_iff _ x - -theorem indexUnion_ordinal : ordinalSetProperty family.indexUnion := by - apply ordinalSetProperty_sUnion - intro T hT - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hT - exact (family.valid i).ordinal - -omit [Small.{u} I] in -theorem common_upper (i j : I) : - ∃ k, family.indices i ⊆ family.indices k ∧ family.indices j ⊆ family.indices k := by - have first := ordinalSetProperty_eq_code_rank (family.indices i) (family.valid i).ordinal - have second := ordinalSetProperty_eq_code_rank (family.indices j) (family.valid j).ordinal - rcases le_total (ZFSet.rank (family.indices i)) (ZFSet.rank (family.indices j)) with ij | ji - · refine ⟨j, ?_, fun _ h => h⟩ - have subset := (SetRealization.ordinalCode_subset_iff _ _).2 ij - simpa only [← first, ← second] using subset - · refine ⟨i, fun _ h => h, ?_⟩ - have subset := (SetRealization.ordinalCode_subset_iff _ _).2 ji - simpa only [← first, ← second] using subset - -theorem chronologyPairs_indexUnion_mem (x : ZFSet.{u}) : - x ∈ chronologyPairs family.indexUnion ↔ ∃ i, x ∈ chronologyPairs (family.indices i) := by - constructor - · intro hx - obtain ⟨target, ht, source, _, rfl, before⟩ := (mem_chronologyPairs _ _).1 hx - obtain ⟨i, hi⟩ := (family.indexUnion_mem target).1 ht - have sourceMem : source ∈ family.indices i := by - rcases before with rfl | before - · exact hi - · exact (family.valid i).ordinal.1 target hi source before - exact ⟨i, (pair_mem_chronologyPairs _ _ _).2 ⟨hi, sourceMem, before⟩⟩ - · rintro ⟨i, hi⟩ - obtain ⟨target, ht, source, hs, rfl, before⟩ := (mem_chronologyPairs _ _).1 hi - exact (pair_mem_chronologyPairs _ _ _).2 - ⟨(family.indexUnion_mem target).2 ⟨i, ht⟩, (family.indexUnion_mem source).2 ⟨i, hs⟩, before⟩ - -theorem stageUnion_function : FunctionGraphOn family.indexUnion family.stageUnion := by - apply functionGraphOn_sUnion - · intro f hf - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf - exact ⟨family.indices i, fun x hx => (family.indexUnion_mem x).2 ⟨i, hx⟩, (family.valid i).stages⟩ - · intro x hx - obtain ⟨i, hi⟩ := (family.indexUnion_mem x).1 hx - obtain ⟨y, entry⟩ := (family.valid i).stages.total hi - exact ⟨family.stages i, ZFSet.mem_range.2 ⟨i, rfl⟩, y, entry⟩ - · intro f hf g hg x y z first second - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hg - obtain ⟨k, ik, jk⟩ := family.common_upper i j - exact (family.valid k).stages.unique ((family.mono i k ik).1 first) ((family.mono j k jk).1 second) - -theorem transitionUnion_function : - FunctionGraphOn (chronologyPairs family.indexUnion) family.transitionUnion := by - apply functionGraphOn_sUnion - · intro f hf - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf - exact ⟨chronologyPairs (family.indices i), - fun x hx => (family.chronologyPairs_indexUnion_mem x).2 ⟨i, hx⟩, (family.valid i).transitions⟩ - · intro x hx - obtain ⟨i, hi⟩ := (family.chronologyPairs_indexUnion_mem x).1 hx - obtain ⟨y, entry⟩ := (family.valid i).transitions.total hi - exact ⟨family.transitions i, ZFSet.mem_range.2 ⟨i, rfl⟩, y, entry⟩ - · intro f hf g hg x y z first second - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hg - obtain ⟨k, ik, jk⟩ := family.common_upper i j - exact (family.valid k).transitions.unique - ((family.mono i k ik).2 first) ((family.mono j k jk).2 second) - -theorem stageUnion_restrict (i : I) : - graphRestriction (family.indices i) family.stageUnion = family.stages i := by - apply (family.stageUnion_function.restrict - (fun x hx => (family.indexUnion_mem x).2 ⟨i, hx⟩)).eq_of_agree (family.valid i).stages - intro x y z first second - exact family.stageUnion_function.unique (pair_mem_graphRestriction.1 first).1 - ((family.stageUnion_mem _).2 ⟨i, second⟩) - -theorem transitionUnion_restrict (i : I) : - graphRestriction (chronologyPairs (family.indices i)) family.transitionUnion = family.transitions i := by - apply (family.transitionUnion_function.restrict - (fun x hx => (family.chronologyPairs_indexUnion_mem x).2 ⟨i, hx⟩)).eq_of_agree (family.valid i).transitions - intro x y z first second - exact family.transitionUnion_function.unique (pair_mem_graphRestriction.1 first).1 - ((family.transitionUnion_mem _).2 ⟨i, second⟩) - -theorem union_valid : - MainPrefixGraphCode M K Labels C D rD family.indexUnion family.stageUnion family.transitionUnion := by - refine ⟨family.indexUnion_ordinal, family.stageUnion_function, family.transitionUnion_function, - ?_, ?_, ?_, ?_⟩ - · intro i a entry - obtain ⟨k, hk⟩ := (family.stageUnion_mem _).1 entry - exact (family.valid k).stage_valid i a hk - · intro i j a b z first second step - obtain ⟨k, hk⟩ := (family.transitionUnion_mem _).1 step - have indices := (pair_mem_chronologyPairs _ _ _).1 ((family.valid k).transitions.pair_source hk) - have firstOld : ZFSet.pair i a ∈ family.stages k := by - rw [← family.stageUnion_restrict k] - exact pair_mem_graphRestriction.2 ⟨first, indices.2.1⟩ - have secondOld : ZFSet.pair j b ∈ family.stages k := by - rw [← family.stageUnion_restrict k] - exact pair_mem_graphRestriction.2 ⟨second, indices.1⟩ - exact (family.valid k).transition_valid i j a b z firstOld secondOld hk - · intro i p a entry - obtain ⟨k, hk⟩ := (family.transitionUnion_mem _).1 entry - exact (family.valid k).identity i p a hk - · intro i j k p₁ a₁ p₂ a₂ p₃ a₃ first second third - obtain ⟨b, hb⟩ := (family.transitionUnion_mem _).1 first - obtain ⟨c, hc⟩ := (family.transitionUnion_mem _).1 second - obtain ⟨d, hd⟩ := (family.transitionUnion_mem _).1 third - obtain ⟨e, be, ce⟩ := family.common_upper b c - obtain ⟨f, ef, df⟩ := family.common_upper e d - exact (family.valid f).composition i j k p₁ a₁ p₂ a₂ p₃ a₃ - ((family.mono e f ef).2 ((family.mono b e be).2 hb)) - ((family.mono e f ef).2 ((family.mono c e ce).2 hc)) ((family.mono d f df).2 hd) - -theorem unionCode_valid : MainPrefixCode M K Labels C D rD family.unionCode := - ⟨family.indexUnion, family.stageUnion, family.transitionUnion, rfl, family.union_valid⟩ - -end MainPrefixGraphFamily - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.MainPrefixGraphFamily -open SetFormula -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {I : Type v} [Small.{u} I] -variable (family : MainPrefixGraphFamily M K Labels C D rD I) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (key : I → ZFSet.{u}) (injective : Function.Injective key) -variable (domain : ZFSet.range key ∈ M.sets) -variable (whole : familyCodeGraph key family.code ∈ M.sets) -include pairing unions powers separation injective domain whole - -theorem fieldFamilies_ground : - familyCodeGraph key family.indices ∈ M.sets ∧ familyCodeGraph key family.stages ∈ M.sets ∧ - familyCodeGraph key family.transitions ∈ M.sets := by - have encoded : familyCodeGraph key (fun i => ZFSet.pair (family.indices i) - (ZFSet.pair (family.stages i) (family.transitions i))) ∈ M.sets := by - change familyCodeGraph key family.code ∈ M.sets - exact whole - have first := M.familyCodeGraph_pair_projections pairing unions powers separation key family.indices - (fun i => ZFSet.pair (family.stages i) (family.transitions i)) injective domain encoded - have second := M.familyCodeGraph_pair_projections pairing unions powers separation key family.stages - family.transitions injective domain first.2 - exact ⟨first.1, second.1, second.2⟩ - -theorem fieldRanges_ground : - ZFSet.range family.indices ∈ M.sets ∧ ZFSet.range family.stages ∈ M.sets ∧ - ZFSet.range family.transitions ∈ M.sets := by - have fields := family.fieldFamilies_ground pairing unions powers separation key injective domain whole - exact ⟨M.familyCodeGraph_valueRange_mem unions separation key family.indices domain fields.1, - M.familyCodeGraph_valueRange_mem unions separation key family.stages domain fields.2.1, - M.familyCodeGraph_valueRange_mem unions separation key family.transitions domain fields.2.2⟩ - -theorem fieldUnions_ground : - family.indexUnion ∈ M.sets ∧ family.stageUnion ∈ M.sets ∧ family.transitionUnion ∈ M.sets := by - have ranges := family.fieldRanges_ground pairing unions powers separation key injective domain whole - exact ⟨M.union_mem unions ranges.1, M.union_mem unions ranges.2.1, M.union_mem unions ranges.2.2⟩ - -theorem unionCode_ground : family.unionCode ∈ M.sets := by - have grounds := family.fieldUnions_ground pairing unions powers separation key injective domain whole - exact M.mainPrefixCode_mem pairing grounds.1 grounds.2.1 grounds.2.2 - -omit pairing unions powers separation injective domain whole in -theorem code_extends_union (i : I) : MainPrefixExtends (family.code i) family.unionCode := by - apply mainPrefixExtends_iff.2 - exact ⟨fun x hx => (family.indexUnion_mem x).2 ⟨i, hx⟩, - fun x hx => (family.stageUnion_mem x).2 ⟨i, hx⟩, - fun x hx => (family.transitionUnion_mem x).2 ⟨i, hx⟩⟩ - -end PartitionPilot.Forcing.MainPrefixGraphFamily - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u v - -def MainPrefixProfileGraphCode (M : TransitiveGround.{u}) - (K Labels C D rD S E : ZFSet.{u}) : Prop := - ∀ i j a b z, ZFSet.pair i a ∈ S → ZFSet.pair j b ∈ S → - ZFSet.pair (ZFSet.pair j i) z ∈ E → - LinkedProfilePreservingTransitionCode M K Labels C D rD a b z - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem linked_profile_code (preserved : run.PreservesOldProfiles) {i j : I} (before : i ≤ j) : - LinkedProfilePreservingTransitionCode M K Labels C D rD - (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code := by - refine ⟨run.linked i, run.linked j, rfl, rfl, ?_⟩ - rw [run.linked_main i, run.linked_main j] - exact ⟨run.diagram.transition before, rfl, run.coverage before, preserved i j before⟩ - -theorem profile_graph_code (preserved : run.PreservesOldProfiles) : - MainPrefixProfileGraphCode M K Labels C D rD run.stageGraph run.transitionGraph := by - intro i j a b z first second entry - obtain ⟨s, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source first) - obtain ⟨t, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source second) - have order := ((pair_mem_chronologyPairs _ _ _).1 - (run.transitionGraph_function.pair_source entry)).2.2 - have before := (run.key_order s t).2 order - rw [(run.stageGraph_entry s a).1 first, (run.stageGraph_entry t b).1 second, - (run.transitionGraph_entry before z).1 entry] - exact run.linked_profile_code preserved before - -theorem preservesOldProfiles_of_graph_code - (code : MainPrefixProfileGraphCode M K Labels C D rD run.stageGraph run.transitionGraph) : - run.PreservesOldProfiles := by - intro i j before - have entry := code (run.key i) (run.key j) (run.linked i).code (run.linked j).code - (run.diagram.transition before).map.code - ((run.stageGraph_entry i _).2 rfl) ((run.stageGraph_entry j _).2 rfl) - ((run.transitionGraph_entry before _).2 rfl) - let step := (run.diagram.transition before).retargetEq - (run.linked_main i).symm (run.linked_main j).symm - have stepCode : step.map.code = (run.diagram.transition before).map.code := - (run.diagram.transition before).retargetEq_code (run.linked_main i).symm (run.linked_main j).symm - have actual : LinkedProfilePreservingTransitionCode M K Labels C D rD - (run.linked i).code (run.linked j).code step.map.code := stepCode.symm ▸ entry - exact ((run.diagram.transition before).retargetEq_preservesOldProfiles_iff - (run.linked_main i).symm (run.linked_main j).symm).1 (actual.preserves_at step) - -theorem preservesOldProfiles_iff_graph_code : run.PreservesOldProfiles ↔ - MainPrefixProfileGraphCode M K Labels C D rD run.stageGraph run.transitionGraph := - ⟨run.profile_graph_code, run.preservesOldProfiles_of_graph_code⟩ - -end GroundMainPrefix - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.MainPrefixGraphFamily -open SetFormula SetRealization -universe u v -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {I : Type v} [Small.{u} I] -variable (family : MainPrefixGraphFamily M K Labels C D rD I) - -theorem union_profile_graph_code - (preserved : ∀ k, MainPrefixProfileGraphCode M K Labels C D rD (family.stages k) (family.transitions k)) : - MainPrefixProfileGraphCode M K Labels C D rD family.stageUnion family.transitionUnion := by - intro i j a b z first second entry - obtain ⟨k, hk⟩ := (family.transitionUnion_mem _).1 entry - have indices := (pair_mem_chronologyPairs _ _ _).1 ((family.valid k).transitions.pair_source hk) - have firstOld : ZFSet.pair i a ∈ family.stages k := by - rw [← family.stageUnion_restrict k] - exact pair_mem_graphRestriction.2 ⟨first, indices.2.1⟩ - have secondOld : ZFSet.pair j b ∈ family.stages k := by - rw [← family.stageUnion_restrict k] - exact pair_mem_graphRestriction.2 ⟨second, indices.1⟩ - exact preserved k i j a b z firstOld secondOld hk - -theorem exists_preservedUnionPrefix - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (key : I → ZFSet.{u}) (injective : Function.Injective key) - (domain : ZFSet.range key ∈ M.sets) (whole : familyCodeGraph key family.code ∈ M.sets) - (preserved : ∀ k, MainPrefixProfileGraphCode M K Labels C D rD (family.stages k) (family.transitions k)) : - letI := ordinalMainIndexPreorder family.indexUnion_ordinal - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers family.indexUnion), - run.indices = family.indexUnion ∧ run.stageGraph = family.stageUnion ∧ - run.transitionGraph = family.transitionUnion ∧ run.code = family.unionCode ∧ - run.PreservesOldProfiles := by - let := ordinalMainIndexPreorder family.indexUnion_ordinal - have grounds := family.fieldUnions_ground pairing unions powers separation key injective domain whole - let run := family.union_valid.decodedPrefix pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 - have indices : run.indices = family.indexUnion := - family.union_valid.decodedPrefix_indices pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 - have stages : run.stageGraph = family.stageUnion := - family.union_valid.decodedPrefix_stageGraph pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 - have transitions : run.transitionGraph = family.transitionUnion := - family.union_valid.decodedPrefix_transitionGraph pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 - have code : run.code = family.unionCode := - family.union_valid.decodedPrefix_code pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 - refine ⟨run, indices, stages, transitions, code, ?_⟩ - apply run.preservesOldProfiles_of_graph_code - rw [stages, transitions] - exact family.union_profile_graph_code preserved - -end PartitionPilot.Forcing.MainPrefixGraphFamily - - - -namespace PartitionPilot.Forcing -open SetFormula SetRealization -universe u v - -def PreservedMainPrefixCode (M : TransitiveGround.{u}) (K Labels C D rD z : ZFSet.{u}) : Prop := - ∃ T S E, z = mainPrefixCode T S E ∧ MainPrefixGraphCode M K Labels C D rD T S E ∧ - MainPrefixProfileGraphCode M K Labels C D rD S E - -namespace PreservedMainPrefixCode -variable {M : TransitiveGround.{u}} {K Labels C D rD z : ZFSet.{u}} - -theorem valid (code : PreservedMainPrefixCode M K Labels C D rD z) : - MainPrefixCode M K Labels C D rD z := by - obtain ⟨T, S, E, equal, raw, _⟩ := code - exact ⟨T, S, E, equal, raw⟩ - -theorem exists_decodedPrefix (code : PreservedMainPrefixCode M K Labels C D rD z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (ground : z ∈ M.sets) : - ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, - letI := ordinalMainIndexPreorder ordinal - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), - run.indices = T ∧ run.code = z ∧ run.PreservesOldProfiles := by - obtain ⟨T, S, E, equal, raw, preserved⟩ := code - obtain ⟨hT, hS, hE⟩ := M.mainPrefixCode_fields_mem (equal ▸ ground) - let := ordinalMainIndexPreorder raw.ordinal - let run := raw.decodedPrefix pairing unions powers separation hT hS hE - refine ⟨T, hT, raw.ordinal, run, - raw.decodedPrefix_indices pairing unions powers separation hT hS hE, - (raw.decodedPrefix_code pairing unions powers separation hT hS hE).trans equal.symm, ?_⟩ - apply run.preservesOldProfiles_of_graph_code - change MainPrefixProfileGraphCode M K Labels C D rD - (raw.decodedPrefix pairing unions powers separation hT hS hE).stageGraph - (raw.decodedPrefix pairing unions powers separation hT hS hE).transitionGraph - rw [raw.decodedPrefix_stageGraph, raw.decodedPrefix_transitionGraph] - exact preserved - -end PreservedMainPrefixCode - -namespace GroundMainPrefix -variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} -variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} -variable {unions : Realize M.sets SetFormula.union Fin.elim0} -variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} -variable {I : Type v} [Small.{u} I] [Preorder I] -variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) - -theorem preserved_code (preserved : run.PreservesOldProfiles) : - PreservedMainPrefixCode M K Labels C D rD run.code := - ⟨run.indices, run.stageGraph, run.transitionGraph, rfl, run.graph_code, run.profile_graph_code preserved⟩ - -theorem preserved_code_iff : PreservedMainPrefixCode M K Labels C D rD run.code ↔ run.PreservesOldProfiles := by - constructor - · rintro ⟨T, S, E, equal, _, preserved⟩ - have fields := mainPrefixCode_inj.1 equal - apply run.preservesOldProfiles_of_graph_code - rw [fields.2.1, fields.2.2] - exact preserved - · exact run.preserved_code - -end GroundMainPrefix - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u -namespace SetFormula - -def mainPrefixProfileGraphFormula {n} (K Labels C D rD N S E : Fin n) : SetFormula n := - let old := suffixIndex n 5 - let v := prefixIndex n 5 - allBlock 5 (imp (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old S)) - (.conj (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old S)) - (BoundedFormula.tripleMembershipFormula (v 1) (v 0) (v 4) (old E)))).toFormula - (linkedProfilePreservingTransitionFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (v 2) (v 3) (v 4))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -include pairing unions powers separation collection - -theorem realize_mainPrefixProfileGraphFormula {n} (K Labels C D rD N S E : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (mainPrefixProfileGraphFormula K Labels C D rD N S E) env ↔ - MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (env S) (env E) := by - rw [mainPrefixProfileGraphFormula, realize_allBlock] - have actual (fields : Fin 5 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : - Realize M.sets - (imp (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (prefixIndex n 5 0) (prefixIndex n 5 2) (suffixIndex n 5 S)) - (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 3) (suffixIndex n 5 S)) - (BoundedFormula.tripleMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 0) (prefixIndex n 5 4) - (suffixIndex n 5 E)))).toFormula - (linkedProfilePreservingTransitionFormula (suffixIndex n 5 K) (suffixIndex n 5 Labels) (suffixIndex n 5 C) - (suffixIndex n 5 D) (suffixIndex n 5 rD) (suffixIndex n 5 N) - (prefixIndex n 5 2) (prefixIndex n 5 3) (prefixIndex n 5 4))) (extendMany 5 fields env) ↔ - (ZFSet.pair (fields 0) (fields 2) ∈ env S ∧ ZFSet.pair (fields 1) (fields 3) ∈ env S ∧ - ZFSet.pair (ZFSet.pair (fields 1) (fields 0)) (fields 4) ∈ env E) → - LinkedProfilePreservingTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) - (fields 2) (fields 3) (fields 4) := by - rw [realize_imp, BoundedFormula.realize_toFormula M _ _ - (extendMany_members 5 fields env ground members)] - simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, - BoundedFormula.truth_tripleMembershipFormula] - rw [M.realize_linkedProfilePreservingTransitionFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ _ _ - (extendMany_members 5 fields env ground members) - (by simpa only [extendMany_suffix] using omega) - (by simpa only [extendMany_suffix] using ordinal)] - simp only [extendMany_prefix, extendMany_suffix] - constructor - · intro recognized i j a b z first second third - have h₁ := M.transitive (members S) first - have h₂ := M.transitive (members S) second - have h₃ := M.transitive (members E) third - let fields : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases a (Fin.cases b (fun _ => z)))) - have ground : ∀ k, fields k ∈ M.sets := Fin.cases (M.pair_left h₁) - (Fin.cases (M.pair_left h₂) (Fin.cases (M.pair_right h₁) - (Fin.cases (M.pair_right h₂) (fun _ => M.pair_right h₃)))) - exact (actual fields ground).1 (recognized fields ground) ⟨first, second, third⟩ - · intro law fields ground - exact (actual fields ground).2 (fun entries => - law (fields 0) (fields 1) (fields 2) (fields 3) (fields 4) entries.1 entries.2.1 entries.2.2) - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -structure PreservedMainPrefixHistoryCode (M : TransitiveGround.{u}) - (K Labels C D rD A p : ZFSet.{u}) : Prop where - function : FunctionGraphOn A p - values : ∀ i q, ZFSet.pair i q ∈ p → - ∃ S E, q = mainPrefixCode (insert i i) S E ∧ - MainPrefixGraphCode M K Labels C D rD (insert i i) S E ∧ - MainPrefixProfileGraphCode M K Labels C D rD S E - compatible : ∀ i j q r, ZFSet.pair i q ∈ p → ZFSet.pair j r ∈ p → - (i = j ∨ i ∈ j) → MainPrefixExtends q r - -namespace PreservedMainPrefixHistoryCode -variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} -variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) - -private theorem exists_fields (i : SetMembers A) : - ∃ fields : ZFSet.{u} × ZFSet.{u}, - decodedFamilyValue history.function i = mainPrefixCode (insert (SetMembers.raw i) (SetMembers.raw i)) - fields.1 fields.2 ∧ - MainPrefixGraphCode M K Labels C D rD (insert (SetMembers.raw i) (SetMembers.raw i)) fields.1 fields.2 ∧ - MainPrefixProfileGraphCode M K Labels C D rD fields.1 fields.2 := by - obtain ⟨S, E, equal, valid, profiles⟩ := history.values _ _ - (decodedFamilyValue_entry history.function i) - exact ⟨(S, E), equal, valid, profiles⟩ - -noncomputable def fields (i : SetMembers A) : ZFSet.{u} × ZFSet.{u} := - Classical.choose (history.exists_fields i) - -theorem fields_spec (i : SetMembers A) : - decodedFamilyValue history.function i = mainPrefixCode (insert (SetMembers.raw i) (SetMembers.raw i)) - (history.fields i).1 (history.fields i).2 ∧ - MainPrefixGraphCode M K Labels C D rD (insert (SetMembers.raw i) (SetMembers.raw i)) - (history.fields i).1 (history.fields i).2 ∧ - MainPrefixProfileGraphCode M K Labels C D rD (history.fields i).1 (history.fields i).2 := - Classical.choose_spec (history.exists_fields i) - -noncomputable def graphFamily : MainPrefixGraphFamily M K Labels C D rD (SetMembers A) where - indices i := insert (SetMembers.raw i) (SetMembers.raw i) - stages i := (history.fields i).1 - transitions i := (history.fields i).2 - valid i := (history.fields_spec i).2.1 - mono i j subset := by - have before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j := - ZFSet.mem_insert_iff.1 (subset (ZFSet.mem_insert_iff.2 (Or.inl rfl))) - have extension := history.compatible _ _ _ _ - (decodedFamilyValue_entry history.function i) (decodedFamilyValue_entry history.function j) before - rw [(history.fields_spec i).1, (history.fields_spec j).1] at extension - exact (mainPrefixExtends_iff.1 extension).2 - -theorem graphFamily_code_entry (i : SetMembers A) : - ZFSet.pair (SetMembers.raw i) (history.graphFamily.code i) ∈ p := by - change ZFSet.pair (SetMembers.raw i) - (mainPrefixCode (insert (SetMembers.raw i) (SetMembers.raw i)) - (history.fields i).1 (history.fields i).2) ∈ p - rw [← (history.fields_spec i).1] - exact decodedFamilyValue_entry history.function i - -theorem graphFamily_codeGraph_eq : - familyCodeGraph (@SetMembers.raw A) history.graphFamily.code = p := - familyCodeGraph_eq_of_entries history.function _ _ (ordinalMainIndex_key_range A) - history.graphFamily_code_entry - -theorem graphFamily_profiles (i : SetMembers A) : - MainPrefixProfileGraphCode M K Labels C D rD - (history.graphFamily.stages i) (history.graphFamily.transitions i) := - (history.fields_spec i).2.2 - -theorem graphFamily_indexUnion (ordinal : ordinalSetProperty A) : - history.graphFamily.indexUnion = A := by - apply ZFSet.ext - intro x - rw [history.graphFamily.indexUnion_mem] - constructor - · rintro ⟨i, hi⟩ - rcases ZFSet.mem_insert_iff.1 hi with equal | below - · exact equal.symm ▸ SetMembers.raw_mem i - · exact ordinal.1 _ (SetMembers.raw_mem i) x below - · intro hx - refine ⟨SetMembers.ofMem x hx, ?_⟩ - change x ∈ insert (SetMembers.raw (SetMembers.ofMem x hx)) (SetMembers.raw (SetMembers.ofMem x hx)) - rw [SetMembers.raw_ofMem] - exact ZFSet.mem_insert_iff.2 (Or.inl rfl) - -end PreservedMainPrefixHistoryCode - - - - - -def MainPrefixHistoryFieldMem (p x : ZFSet.{u}) (j : Fin 3) : Prop := - ∃ i T S E, ZFSet.pair i (mainPrefixCode T S E) ∈ p ∧ - x ∈ (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) j - -def MainPrefixHistoryUnionCode (p q : ZFSet.{u}) : Prop := - ∃ T S E, q = mainPrefixCode T S E ∧ - ∀ (j : Fin 3) x, x ∈ (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) j ↔ - MainPrefixHistoryFieldMem p x j - -theorem MainPrefixHistoryUnionCode.unique {p q r : ZFSet.{u}} - (first : MainPrefixHistoryUnionCode p q) (second : MainPrefixHistoryUnionCode p r) : q = r := by - obtain ⟨T, S, E, rfl, fields⟩ := first - obtain ⟨U, F, G, rfl, fields'⟩ := second - apply mainPrefixCode_inj.2 - exact ⟨ZFSet.ext (fun x => (fields 0 x).trans (fields' 0 x).symm), - ZFSet.ext (fun x => (fields 1 x).trans (fields' 1 x).symm), - ZFSet.ext (fun x => (fields 2 x).trans (fields' 2 x).symm)⟩ - -namespace PreservedMainPrefixHistoryCode -variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} -variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) - -theorem field_mem_iff (j : Fin 3) (x : ZFSet.{u}) : - MainPrefixHistoryFieldMem p x j ↔ - ∃ i : SetMembers A, x ∈ (Fin.cases (history.graphFamily.indices i) - (Fin.cases (history.graphFamily.stages i) (fun _ => history.graphFamily.transitions i)) : - Fin 3 → ZFSet.{u}) j := by - constructor - · rintro ⟨i, T, S, E, entry, member⟩ - have hi := history.function.pair_source entry - let k := SetMembers.ofMem i hi - have actual : ZFSet.pair i (history.graphFamily.code k) ∈ p := by - have actual := history.graphFamily_code_entry k - simpa only [k, SetMembers.raw_ofMem] using actual - have equal := history.function.unique entry actual - have fields := mainPrefixCode_inj.1 equal - refine ⟨k, ?_⟩ - rw [fields.1, fields.2.1, fields.2.2] at member - exact member - · rintro ⟨i, member⟩ - exact ⟨SetMembers.raw i, history.graphFamily.indices i, history.graphFamily.stages i, - history.graphFamily.transitions i, history.graphFamily_code_entry i, member⟩ - -theorem union_code : MainPrefixHistoryUnionCode p history.graphFamily.unionCode := by - refine ⟨history.graphFamily.indexUnion, history.graphFamily.stageUnion, - history.graphFamily.transitionUnion, rfl, ?_⟩ - intro j - refine Fin.cases ?_ (Fin.cases ?_ (fun _ => ?_)) j - · intro x - exact (history.graphFamily.indexUnion_mem x).trans (history.field_mem_iff 0 x).symm - · intro x - exact (history.graphFamily.stageUnion_mem x).trans (history.field_mem_iff 1 x).symm - · intro x - exact (history.graphFamily.transitionUnion_mem x).trans (history.field_mem_iff 2 x).symm - -end PreservedMainPrefixHistoryCode - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def mainPrefixHistoryFieldMemFormula {n} (p x : Fin n) (j : Fin 3) : SetFormula n := - let old := suffixIndex n 5 - let field := prefixIndex n 5 - let selected : Fin 3 → Fin (n + 5) := Fin.cases (field 1) (Fin.cases (field 2) (fun _ => field 3)) - exBlock 5 (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (field 0) (field 4) (old p)) - (.conj (BoundedFormula.mainPrefixTupleFormula (field 4) (field 1) (field 2) (field 3)) - (.mem (old x) (selected j)))).toFormula - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem mainPrefixHistoryFieldMem_ground {p x : ZFSet.{u}} {j : Fin 3} - (hp : p ∈ M.sets) (member : MainPrefixHistoryFieldMem p x j) : x ∈ M.sets := by - obtain ⟨i, T, S, E, entry, member⟩ := member - have fields := M.mainPrefixCode_fields_mem (M.pair_right (M.transitive hp entry)) - have ground : ∀ k, (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) k ∈ M.sets := - Fin.cases fields.1 (Fin.cases fields.2.1 (fun _ => fields.2.2)) - exact M.transitive (ground j) member - -theorem realize_mainPrefixHistoryFieldMemFormula {n} (p x : Fin n) (j : Fin 3) - (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : - Realize M.sets (mainPrefixHistoryFieldMemFormula p x j) env ↔ - MainPrefixHistoryFieldMem (env p) (env x) j := by - rw [mainPrefixHistoryFieldMemFormula, realize_exBlock] - let old := suffixIndex n 5 - let field := prefixIndex n 5 - let selected : Fin 3 → Fin (n + 5) := Fin.cases (field 1) (Fin.cases (field 2) (fun _ => field 3)) - have actual (f : Fin 5 → ZFSet.{u}) (ground : ∀ k, f k ∈ M.sets) : - Realize M.sets (BoundedFormula.conj - (BoundedFormula.pairMembershipFormula (field 0) (field 4) (old p)) - (.conj (BoundedFormula.mainPrefixTupleFormula (field 4) (field 1) (field 2) (field 3)) - (.mem (old x) (selected j)))).toFormula (extendMany 5 f env) ↔ - ZFSet.pair (f 0) (f 4) ∈ env p ∧ f 4 = mainPrefixCode (f 1) (f 2) (f 3) ∧ - env x ∈ (Fin.cases (f 1) (Fin.cases (f 2) (fun _ => f 3)) : Fin 3 → ZFSet.{u}) j := by - rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members)] - simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, - BoundedFormula.truth_mainPrefixTupleFormula, old, field, extendMany_prefix, extendMany_suffix] - refine Fin.cases ?_ (Fin.cases ?_ (fun _ => ?_)) j <;> rfl - constructor - · rintro ⟨f, ground, recognized⟩ - obtain ⟨entry, equal, member⟩ := (actual f ground).1 recognized - exact ⟨f 0, f 1, f 2, f 3, equal ▸ entry, member⟩ - · rintro ⟨i, T, S, E, entry, member⟩ - have pairGround := M.transitive (members p) entry - have fieldsGround := M.mainPrefixCode_fields_mem (M.pair_right pairGround) - let f : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases T (Fin.cases S - (Fin.cases E (fun _ => mainPrefixCode T S E)))) - have ground : ∀ k, f k ∈ M.sets := Fin.cases (M.pair_left pairGround) - (Fin.cases fieldsGround.1 (Fin.cases fieldsGround.2.1 - (Fin.cases fieldsGround.2.2 (fun _ => M.pair_right pairGround)))) - exact ⟨f, ground, (actual f ground).2 ⟨entry, rfl, member⟩⟩ - -end TransitiveGround -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u - -def MainPrefixAtIndex (T q : ZFSet.{u}) : Prop := - ∃ S E, q = mainPrefixCode T S E - -def MainPrefixHistoryExtends (p q : ZFSet.{u}) : Prop := - ∀ i old, ZFSet.pair i old ∈ p → MainPrefixExtends old q - -def MainPrefixTraceStepCode (B seed g α p y : ZFSet.{u}) : Prop := - y ∈ B ∧ MainPrefixAtIndex (insert α α) y ∧ MainPrefixHistoryExtends p y ∧ - ((α = ∅ ∧ y = seed) ∨ - (α ≠ ∅ ∧ ∃ input, MainPrefixHistoryUnionCode p input ∧ ZFSet.pair input y ∈ g)) - -theorem MainPrefixAtIndex.unique {T U q : ZFSet.{u}} - (first : MainPrefixAtIndex T q) (second : MainPrefixAtIndex U q) : T = U := by - obtain ⟨S, E, a⟩ := first - obtain ⟨F, G, b⟩ := second - exact (mainPrefixCode_inj.1 (a.symm.trans b)).1 - -theorem MainPrefixAtIndex.refl {T q : ZFSet.{u}} (code : MainPrefixAtIndex T q) : - MainPrefixExtends q q := by - obtain ⟨S, E, rfl⟩ := code - exact MainPrefixExtends.refl T S E - -theorem MainPrefixTraceStepCode.unique {B seed g α p y z : ZFSet.{u}} - (function : FunctionGraphOn B g) - (first : MainPrefixTraceStepCode B seed g α p y) - (second : MainPrefixTraceStepCode B seed g α p z) : y = z := by - rcases first.2.2.2 with ⟨zero, hy⟩ | ⟨nonzero, a, unionA, entryA⟩ - · rcases second.2.2.2 with ⟨_, hz⟩ | ⟨nonzero, _⟩ - · exact hy.trans hz.symm - · exact False.elim (nonzero zero) - · rcases second.2.2.2 with ⟨zero, _⟩ | ⟨_, b, unionB, entryB⟩ - · exact False.elim (nonzero zero) - · have equal := unionA.unique unionB - exact function.unique entryA (equal.symm ▸ entryB) - -theorem MainPrefixHistoryExtends.trans {p q r : ZFSet.{u}} - (history : MainPrefixHistoryExtends p q) (extension : MainPrefixExtends q r) : - MainPrefixHistoryExtends p r := - fun i old entry => (history i old entry).trans extension - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def mainPrefixHistoryFieldUnionFormula {n} (p output : Fin n) (j : Fin 3) : SetFormula n := - exactSetFormula output (mainPrefixHistoryFieldMemFormula p.succ 0 j) - -def mainPrefixHistoryUnionFormula {n} (p q : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let field := prefixIndex n 3 - exBlock 3 (.conj (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2)).toFormula - (conjBlock 3 (fun j => mainPrefixHistoryFieldUnionFormula (old p) (field j) j))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_mainPrefixHistoryFieldUnionFormula {n} (p output : Fin n) (j : Fin 3) - (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : - Realize M.sets (mainPrefixHistoryFieldUnionFormula p output j) env ↔ - ∀ x, x ∈ env output ↔ MainPrefixHistoryFieldMem (env p) x j := by - change (∀ x ∈ M.sets, Realize M.sets - (.conj (imp (.mem 0 output.succ) (mainPrefixHistoryFieldMemFormula p.succ 0 j)) - (imp (mainPrefixHistoryFieldMemFormula p.succ 0 j) (.mem 0 output.succ))) (extend x env)) ↔ _ - simp only [Realize, realize_imp] - have meaning (x : ZFSet.{u}) (hx : x ∈ M.sets) : - Realize M.sets (mainPrefixHistoryFieldMemFormula p.succ 0 j) (extend x env) ↔ - MainPrefixHistoryFieldMem (env p) x j := - M.realize_mainPrefixHistoryFieldMemFormula p.succ 0 j (extend x env) (Fin.cases hx members) - constructor - · intro recognized x - constructor - · intro member - have hx := M.transitive (members output) member - exact (meaning x hx).1 ((recognized x hx).1 member) - · intro member - have hx := M.mainPrefixHistoryFieldMem_ground (members p) member - exact (recognized x hx).2 ((meaning x hx).2 member) - · intro exactFields x hx - exact ⟨fun member => (meaning x hx).2 ((exactFields x).1 member), - fun recognized => (exactFields x).2 ((meaning x hx).1 recognized)⟩ - -theorem realize_mainPrefixHistoryUnionFormula {n} (p q : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : - Realize M.sets (mainPrefixHistoryUnionFormula p q) env ↔ - MainPrefixHistoryUnionCode (env p) (env q) := by - rw [mainPrefixHistoryUnionFormula, realize_exBlock] - let old := suffixIndex n 3 - let field := prefixIndex n 3 - have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ k, f k ∈ M.sets) : - (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2)).toFormula - (extendMany 3 f env) ∧ - Realize M.sets (conjBlock 3 (fun j => mainPrefixHistoryFieldUnionFormula (old p) (field j) j)) - (extendMany 3 f env)) ↔ - env q = mainPrefixCode (f 0) (f 1) (f 2) ∧ - ∀ j x, x ∈ f j ↔ MainPrefixHistoryFieldMem (env p) x j := by - have mems := extendMany_members 3 f env ground members - rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, realize_conjBlock] - apply and_congr - · simp only [old, field, extendMany_prefix, extendMany_suffix] - · apply forall_congr' - intro j - simpa only [old, field, extendMany_prefix, extendMany_suffix] using - M.realize_mainPrefixHistoryFieldUnionFormula (old p) (field j) j (extendMany 3 f env) mems - constructor - · rintro ⟨f, ground, recognized⟩ - obtain ⟨encoded, fields⟩ := (actual f ground).1 recognized - have same : (Fin.cases (f 0) (Fin.cases (f 1) (fun _ => f 2)) : Fin 3 → ZFSet.{u}) = f := by - funext j - refine Fin.cases rfl (Fin.cases rfl (fun k => ?_)) j - rw [Fin.eq_zero k] - rfl - refine ⟨f 0, f 1, f 2, encoded, ?_⟩ - rw [same] - exact fields - · rintro ⟨T, S, E, encoded, fields⟩ - have grounds := M.mainPrefixCode_fields_mem (encoded ▸ members q) - let f : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) - have ground : ∀ k, f k ∈ M.sets := Fin.cases grounds.1 (Fin.cases grounds.2.1 (fun _ => grounds.2.2)) - exact ⟨f, ground, (actual f ground).2 ⟨encoded, fields⟩⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedProfileTransitionRecognition + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +universe u v + +structure MainPrefixGraphFamily (M : TransitiveGround.{u}) + (K Labels C D rD : ZFSet.{u}) (I : Type v) where + indices : I → ZFSet.{u} + stages : I → ZFSet.{u} + transitions : I → ZFSet.{u} + valid : ∀ i, MainPrefixGraphCode M K Labels C D rD (indices i) (stages i) (transitions i) + mono : ∀ i j, indices i ⊆ indices j → stages i ⊆ stages j ∧ transitions i ⊆ transitions j + +namespace MainPrefixGraphFamily +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {I : Type v} [Small.{u} I] +variable (family : MainPrefixGraphFamily M K Labels C D rD I) + +noncomputable def indexUnion : ZFSet.{u} := ⋃₀ ZFSet.range family.indices +noncomputable def stageUnion : ZFSet.{u} := ⋃₀ ZFSet.range family.stages +noncomputable def transitionUnion : ZFSet.{u} := ⋃₀ ZFSet.range family.transitions + +noncomputable def code (i : I) : ZFSet.{u} := + mainPrefixCode (family.indices i) (family.stages i) (family.transitions i) + +noncomputable def unionCode : ZFSet.{u} := + mainPrefixCode family.indexUnion family.stageUnion family.transitionUnion + +theorem indexUnion_mem (x : ZFSet.{u}) : x ∈ family.indexUnion ↔ ∃ i, x ∈ family.indices i := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem stageUnion_mem (x : ZFSet.{u}) : x ∈ family.stageUnion ↔ ∃ i, x ∈ family.stages i := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem transitionUnion_mem (x : ZFSet.{u}) : + x ∈ family.transitionUnion ↔ ∃ i, x ∈ family.transitions i := + familyCodeGraph_valueUnion_mem_iff _ x + +theorem indexUnion_ordinal : ordinalSetProperty family.indexUnion := by + apply ordinalSetProperty_sUnion + intro T hT + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hT + exact (family.valid i).ordinal + +omit [Small.{u} I] in +theorem common_upper (i j : I) : + ∃ k, family.indices i ⊆ family.indices k ∧ family.indices j ⊆ family.indices k := by + have first := ordinalSetProperty_eq_code_rank (family.indices i) (family.valid i).ordinal + have second := ordinalSetProperty_eq_code_rank (family.indices j) (family.valid j).ordinal + rcases le_total (ZFSet.rank (family.indices i)) (ZFSet.rank (family.indices j)) with ij | ji + · refine ⟨j, ?_, fun _ h => h⟩ + have subset := (SetRealization.ordinalCode_subset_iff _ _).2 ij + simpa only [← first, ← second] using subset + · refine ⟨i, fun _ h => h, ?_⟩ + have subset := (SetRealization.ordinalCode_subset_iff _ _).2 ji + simpa only [← first, ← second] using subset + +theorem chronologyPairs_indexUnion_mem (x : ZFSet.{u}) : + x ∈ chronologyPairs family.indexUnion ↔ ∃ i, x ∈ chronologyPairs (family.indices i) := by + constructor + · intro hx + obtain ⟨target, ht, source, _, rfl, before⟩ := (mem_chronologyPairs _ _).1 hx + obtain ⟨i, hi⟩ := (family.indexUnion_mem target).1 ht + have sourceMem : source ∈ family.indices i := by + rcases before with rfl | before + · exact hi + · exact (family.valid i).ordinal.1 target hi source before + exact ⟨i, (pair_mem_chronologyPairs _ _ _).2 ⟨hi, sourceMem, before⟩⟩ + · rintro ⟨i, hi⟩ + obtain ⟨target, ht, source, hs, rfl, before⟩ := (mem_chronologyPairs _ _).1 hi + exact (pair_mem_chronologyPairs _ _ _).2 + ⟨(family.indexUnion_mem target).2 ⟨i, ht⟩, (family.indexUnion_mem source).2 ⟨i, hs⟩, before⟩ + +theorem stageUnion_function : FunctionGraphOn family.indexUnion family.stageUnion := by + apply functionGraphOn_sUnion + · intro f hf + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf + exact ⟨family.indices i, fun x hx => (family.indexUnion_mem x).2 ⟨i, hx⟩, (family.valid i).stages⟩ + · intro x hx + obtain ⟨i, hi⟩ := (family.indexUnion_mem x).1 hx + obtain ⟨y, entry⟩ := (family.valid i).stages.total hi + exact ⟨family.stages i, ZFSet.mem_range.2 ⟨i, rfl⟩, y, entry⟩ + · intro f hf g hg x y z first second + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hg + obtain ⟨k, ik, jk⟩ := family.common_upper i j + exact (family.valid k).stages.unique ((family.mono i k ik).1 first) ((family.mono j k jk).1 second) + +theorem transitionUnion_function : + FunctionGraphOn (chronologyPairs family.indexUnion) family.transitionUnion := by + apply functionGraphOn_sUnion + · intro f hf + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf + exact ⟨chronologyPairs (family.indices i), + fun x hx => (family.chronologyPairs_indexUnion_mem x).2 ⟨i, hx⟩, (family.valid i).transitions⟩ + · intro x hx + obtain ⟨i, hi⟩ := (family.chronologyPairs_indexUnion_mem x).1 hx + obtain ⟨y, entry⟩ := (family.valid i).transitions.total hi + exact ⟨family.transitions i, ZFSet.mem_range.2 ⟨i, rfl⟩, y, entry⟩ + · intro f hf g hg x y z first second + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hf + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 hg + obtain ⟨k, ik, jk⟩ := family.common_upper i j + exact (family.valid k).transitions.unique + ((family.mono i k ik).2 first) ((family.mono j k jk).2 second) + +theorem stageUnion_restrict (i : I) : + graphRestriction (family.indices i) family.stageUnion = family.stages i := by + apply (family.stageUnion_function.restrict + (fun x hx => (family.indexUnion_mem x).2 ⟨i, hx⟩)).eq_of_agree (family.valid i).stages + intro x y z first second + exact family.stageUnion_function.unique (pair_mem_graphRestriction.1 first).1 + ((family.stageUnion_mem _).2 ⟨i, second⟩) + +theorem transitionUnion_restrict (i : I) : + graphRestriction (chronologyPairs (family.indices i)) family.transitionUnion = family.transitions i := by + apply (family.transitionUnion_function.restrict + (fun x hx => (family.chronologyPairs_indexUnion_mem x).2 ⟨i, hx⟩)).eq_of_agree (family.valid i).transitions + intro x y z first second + exact family.transitionUnion_function.unique (pair_mem_graphRestriction.1 first).1 + ((family.transitionUnion_mem _).2 ⟨i, second⟩) + +theorem union_valid : + MainPrefixGraphCode M K Labels C D rD family.indexUnion family.stageUnion family.transitionUnion := by + refine ⟨family.indexUnion_ordinal, family.stageUnion_function, family.transitionUnion_function, + ?_, ?_, ?_, ?_⟩ + · intro i a entry + obtain ⟨k, hk⟩ := (family.stageUnion_mem _).1 entry + exact (family.valid k).stage_valid i a hk + · intro i j a b z first second step + obtain ⟨k, hk⟩ := (family.transitionUnion_mem _).1 step + have indices := (pair_mem_chronologyPairs _ _ _).1 ((family.valid k).transitions.pair_source hk) + have firstOld : ZFSet.pair i a ∈ family.stages k := by + rw [← family.stageUnion_restrict k] + exact pair_mem_graphRestriction.2 ⟨first, indices.2.1⟩ + have secondOld : ZFSet.pair j b ∈ family.stages k := by + rw [← family.stageUnion_restrict k] + exact pair_mem_graphRestriction.2 ⟨second, indices.1⟩ + exact (family.valid k).transition_valid i j a b z firstOld secondOld hk + · intro i p a entry + obtain ⟨k, hk⟩ := (family.transitionUnion_mem _).1 entry + exact (family.valid k).identity i p a hk + · intro i j k p₁ a₁ p₂ a₂ p₃ a₃ first second third + obtain ⟨b, hb⟩ := (family.transitionUnion_mem _).1 first + obtain ⟨c, hc⟩ := (family.transitionUnion_mem _).1 second + obtain ⟨d, hd⟩ := (family.transitionUnion_mem _).1 third + obtain ⟨e, be, ce⟩ := family.common_upper b c + obtain ⟨f, ef, df⟩ := family.common_upper e d + exact (family.valid f).composition i j k p₁ a₁ p₂ a₂ p₃ a₃ + ((family.mono e f ef).2 ((family.mono b e be).2 hb)) + ((family.mono e f ef).2 ((family.mono c e ce).2 hc)) ((family.mono d f df).2 hd) + +theorem unionCode_valid : MainPrefixCode M K Labels C D rD family.unionCode := + ⟨family.indexUnion, family.stageUnion, family.transitionUnion, rfl, family.union_valid⟩ + +end MainPrefixGraphFamily + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.MainPrefixGraphFamily +open SetFormula +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {I : Type v} [Small.{u} I] +variable (family : MainPrefixGraphFamily M K Labels C D rD I) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (key : I → ZFSet.{u}) (injective : Function.Injective key) +variable (domain : ZFSet.range key ∈ M.sets) +variable (whole : familyCodeGraph key family.code ∈ M.sets) +include pairing unions powers separation injective domain whole + +theorem fieldFamilies_ground : + familyCodeGraph key family.indices ∈ M.sets ∧ familyCodeGraph key family.stages ∈ M.sets ∧ + familyCodeGraph key family.transitions ∈ M.sets := by + have encoded : familyCodeGraph key (fun i => ZFSet.pair (family.indices i) + (ZFSet.pair (family.stages i) (family.transitions i))) ∈ M.sets := by + change familyCodeGraph key family.code ∈ M.sets + exact whole + have first := M.familyCodeGraph_pair_projections pairing unions powers separation key family.indices + (fun i => ZFSet.pair (family.stages i) (family.transitions i)) injective domain encoded + have second := M.familyCodeGraph_pair_projections pairing unions powers separation key family.stages + family.transitions injective domain first.2 + exact ⟨first.1, second.1, second.2⟩ + +theorem fieldRanges_ground : + ZFSet.range family.indices ∈ M.sets ∧ ZFSet.range family.stages ∈ M.sets ∧ + ZFSet.range family.transitions ∈ M.sets := by + have fields := family.fieldFamilies_ground pairing unions powers separation key injective domain whole + exact ⟨M.familyCodeGraph_valueRange_mem unions separation key family.indices domain fields.1, + M.familyCodeGraph_valueRange_mem unions separation key family.stages domain fields.2.1, + M.familyCodeGraph_valueRange_mem unions separation key family.transitions domain fields.2.2⟩ + +theorem fieldUnions_ground : + family.indexUnion ∈ M.sets ∧ family.stageUnion ∈ M.sets ∧ family.transitionUnion ∈ M.sets := by + have ranges := family.fieldRanges_ground pairing unions powers separation key injective domain whole + exact ⟨M.union_mem unions ranges.1, M.union_mem unions ranges.2.1, M.union_mem unions ranges.2.2⟩ + +theorem unionCode_ground : family.unionCode ∈ M.sets := by + have grounds := family.fieldUnions_ground pairing unions powers separation key injective domain whole + exact M.mainPrefixCode_mem pairing grounds.1 grounds.2.1 grounds.2.2 + +omit pairing unions powers separation injective domain whole in +theorem code_extends_union (i : I) : MainPrefixExtends (family.code i) family.unionCode := by + apply mainPrefixExtends_iff.2 + exact ⟨fun x hx => (family.indexUnion_mem x).2 ⟨i, hx⟩, + fun x hx => (family.stageUnion_mem x).2 ⟨i, hx⟩, + fun x hx => (family.transitionUnion_mem x).2 ⟨i, hx⟩⟩ + +end PartitionPilot.Forcing.MainPrefixGraphFamily + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u v + +def MainPrefixProfileGraphCode (M : TransitiveGround.{u}) + (K Labels C D rD S E : ZFSet.{u}) : Prop := + ∀ i j a b z, ZFSet.pair i a ∈ S → ZFSet.pair j b ∈ S → + ZFSet.pair (ZFSet.pair j i) z ∈ E → + LinkedProfilePreservingTransitionCode M K Labels C D rD a b z + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem linked_profile_code (preserved : run.PreservesOldProfiles) {i j : I} (before : i ≤ j) : + LinkedProfilePreservingTransitionCode M K Labels C D rD + (run.linked i).code (run.linked j).code (run.diagram.transition before).map.code := by + refine ⟨run.linked i, run.linked j, rfl, rfl, ?_⟩ + rw [run.linked_main i, run.linked_main j] + exact ⟨run.diagram.transition before, rfl, run.coverage before, preserved i j before⟩ + +theorem profile_graph_code (preserved : run.PreservesOldProfiles) : + MainPrefixProfileGraphCode M K Labels C D rD run.stageGraph run.transitionGraph := by + intro i j a b z first second entry + obtain ⟨s, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source first) + obtain ⟨t, rfl⟩ := ZFSet.mem_range.1 (run.stageGraph_function.pair_source second) + have order := ((pair_mem_chronologyPairs _ _ _).1 + (run.transitionGraph_function.pair_source entry)).2.2 + have before := (run.key_order s t).2 order + rw [(run.stageGraph_entry s a).1 first, (run.stageGraph_entry t b).1 second, + (run.transitionGraph_entry before z).1 entry] + exact run.linked_profile_code preserved before + +theorem preservesOldProfiles_of_graph_code + (code : MainPrefixProfileGraphCode M K Labels C D rD run.stageGraph run.transitionGraph) : + run.PreservesOldProfiles := by + intro i j before + have entry := code (run.key i) (run.key j) (run.linked i).code (run.linked j).code + (run.diagram.transition before).map.code + ((run.stageGraph_entry i _).2 rfl) ((run.stageGraph_entry j _).2 rfl) + ((run.transitionGraph_entry before _).2 rfl) + let step := (run.diagram.transition before).retargetEq + (run.linked_main i).symm (run.linked_main j).symm + have stepCode : step.map.code = (run.diagram.transition before).map.code := + (run.diagram.transition before).retargetEq_code (run.linked_main i).symm (run.linked_main j).symm + have actual : LinkedProfilePreservingTransitionCode M K Labels C D rD + (run.linked i).code (run.linked j).code step.map.code := stepCode.symm ▸ entry + exact ((run.diagram.transition before).retargetEq_preservesOldProfiles_iff + (run.linked_main i).symm (run.linked_main j).symm).1 (actual.preserves_at step) + +theorem preservesOldProfiles_iff_graph_code : run.PreservesOldProfiles ↔ + MainPrefixProfileGraphCode M K Labels C D rD run.stageGraph run.transitionGraph := + ⟨run.profile_graph_code, run.preservesOldProfiles_of_graph_code⟩ + +end GroundMainPrefix + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.MainPrefixGraphFamily +open SetFormula SetRealization +universe u v +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {I : Type v} [Small.{u} I] +variable (family : MainPrefixGraphFamily M K Labels C D rD I) + +theorem union_profile_graph_code + (preserved : ∀ k, MainPrefixProfileGraphCode M K Labels C D rD (family.stages k) (family.transitions k)) : + MainPrefixProfileGraphCode M K Labels C D rD family.stageUnion family.transitionUnion := by + intro i j a b z first second entry + obtain ⟨k, hk⟩ := (family.transitionUnion_mem _).1 entry + have indices := (pair_mem_chronologyPairs _ _ _).1 ((family.valid k).transitions.pair_source hk) + have firstOld : ZFSet.pair i a ∈ family.stages k := by + rw [← family.stageUnion_restrict k] + exact pair_mem_graphRestriction.2 ⟨first, indices.2.1⟩ + have secondOld : ZFSet.pair j b ∈ family.stages k := by + rw [← family.stageUnion_restrict k] + exact pair_mem_graphRestriction.2 ⟨second, indices.1⟩ + exact preserved k i j a b z firstOld secondOld hk + +theorem exists_preservedUnionPrefix + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (key : I → ZFSet.{u}) (injective : Function.Injective key) + (domain : ZFSet.range key ∈ M.sets) (whole : familyCodeGraph key family.code ∈ M.sets) + (preserved : ∀ k, MainPrefixProfileGraphCode M K Labels C D rD (family.stages k) (family.transitions k)) : + letI := ordinalMainIndexPreorder family.indexUnion_ordinal + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers family.indexUnion), + run.indices = family.indexUnion ∧ run.stageGraph = family.stageUnion ∧ + run.transitionGraph = family.transitionUnion ∧ run.code = family.unionCode ∧ + run.PreservesOldProfiles := by + let := ordinalMainIndexPreorder family.indexUnion_ordinal + have grounds := family.fieldUnions_ground pairing unions powers separation key injective domain whole + let run := family.union_valid.decodedPrefix pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 + have indices : run.indices = family.indexUnion := + family.union_valid.decodedPrefix_indices pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 + have stages : run.stageGraph = family.stageUnion := + family.union_valid.decodedPrefix_stageGraph pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 + have transitions : run.transitionGraph = family.transitionUnion := + family.union_valid.decodedPrefix_transitionGraph pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 + have code : run.code = family.unionCode := + family.union_valid.decodedPrefix_code pairing unions powers separation grounds.1 grounds.2.1 grounds.2.2 + refine ⟨run, indices, stages, transitions, code, ?_⟩ + apply run.preservesOldProfiles_of_graph_code + rw [stages, transitions] + exact family.union_profile_graph_code preserved + +end PartitionPilot.Forcing.MainPrefixGraphFamily + + + +namespace PartitionPilot.Forcing +open SetFormula SetRealization +universe u v + +def PreservedMainPrefixCode (M : TransitiveGround.{u}) (K Labels C D rD z : ZFSet.{u}) : Prop := + ∃ T S E, z = mainPrefixCode T S E ∧ MainPrefixGraphCode M K Labels C D rD T S E ∧ + MainPrefixProfileGraphCode M K Labels C D rD S E + +namespace PreservedMainPrefixCode +variable {M : TransitiveGround.{u}} {K Labels C D rD z : ZFSet.{u}} + +theorem valid (code : PreservedMainPrefixCode M K Labels C D rD z) : + MainPrefixCode M K Labels C D rD z := by + obtain ⟨T, S, E, equal, raw, _⟩ := code + exact ⟨T, S, E, equal, raw⟩ + +theorem exists_decodedPrefix (code : PreservedMainPrefixCode M K Labels C D rD z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (ground : z ∈ M.sets) : + ∃ T ∈ M.sets, ∃ ordinal : ordinalSetProperty T, + letI := ordinalMainIndexPreorder ordinal + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers T), + run.indices = T ∧ run.code = z ∧ run.PreservesOldProfiles := by + obtain ⟨T, S, E, equal, raw, preserved⟩ := code + obtain ⟨hT, hS, hE⟩ := M.mainPrefixCode_fields_mem (equal ▸ ground) + let := ordinalMainIndexPreorder raw.ordinal + let run := raw.decodedPrefix pairing unions powers separation hT hS hE + refine ⟨T, hT, raw.ordinal, run, + raw.decodedPrefix_indices pairing unions powers separation hT hS hE, + (raw.decodedPrefix_code pairing unions powers separation hT hS hE).trans equal.symm, ?_⟩ + apply run.preservesOldProfiles_of_graph_code + change MainPrefixProfileGraphCode M K Labels C D rD + (raw.decodedPrefix pairing unions powers separation hT hS hE).stageGraph + (raw.decodedPrefix pairing unions powers separation hT hS hE).transitionGraph + rw [raw.decodedPrefix_stageGraph, raw.decodedPrefix_transitionGraph] + exact preserved + +end PreservedMainPrefixCode + +namespace GroundMainPrefix +variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} +variable {pairing : Realize M.sets SetFormula.pairing Fin.elim0} +variable {unions : Realize M.sets SetFormula.union Fin.elim0} +variable {powers : Realize M.sets powerSet Fin.elim0} {separation : SeparationSchema M.sets} +variable {I : Type v} [Small.{u} I] [Preorder I] +variable (run : GroundMainPrefix M K Labels C D rD pairing unions powers separation I) + +theorem preserved_code (preserved : run.PreservesOldProfiles) : + PreservedMainPrefixCode M K Labels C D rD run.code := + ⟨run.indices, run.stageGraph, run.transitionGraph, rfl, run.graph_code, run.profile_graph_code preserved⟩ + +theorem preserved_code_iff : PreservedMainPrefixCode M K Labels C D rD run.code ↔ run.PreservesOldProfiles := by + constructor + · rintro ⟨T, S, E, equal, _, preserved⟩ + have fields := mainPrefixCode_inj.1 equal + apply run.preservesOldProfiles_of_graph_code + rw [fields.2.1, fields.2.2] + exact preserved + · exact run.preserved_code + +end GroundMainPrefix + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u +namespace SetFormula + +def mainPrefixProfileGraphFormula {n} (K Labels C D rD N S E : Fin n) : SetFormula n := + let old := suffixIndex n 5 + let v := prefixIndex n 5 + allBlock 5 (imp (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old S)) + (.conj (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old S)) + (BoundedFormula.tripleMembershipFormula (v 1) (v 0) (v 4) (old E)))).toFormula + (linkedProfilePreservingTransitionFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (v 2) (v 3) (v 4))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +include pairing unions powers separation collection + +theorem realize_mainPrefixProfileGraphFormula {n} (K Labels C D rD N S E : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (mainPrefixProfileGraphFormula K Labels C D rD N S E) env ↔ + MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (env S) (env E) := by + rw [mainPrefixProfileGraphFormula, realize_allBlock] + have actual (fields : Fin 5 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) : + Realize M.sets + (imp (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (prefixIndex n 5 0) (prefixIndex n 5 2) (suffixIndex n 5 S)) + (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 3) (suffixIndex n 5 S)) + (BoundedFormula.tripleMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 0) (prefixIndex n 5 4) + (suffixIndex n 5 E)))).toFormula + (linkedProfilePreservingTransitionFormula (suffixIndex n 5 K) (suffixIndex n 5 Labels) (suffixIndex n 5 C) + (suffixIndex n 5 D) (suffixIndex n 5 rD) (suffixIndex n 5 N) + (prefixIndex n 5 2) (prefixIndex n 5 3) (prefixIndex n 5 4))) (extendMany 5 fields env) ↔ + (ZFSet.pair (fields 0) (fields 2) ∈ env S ∧ ZFSet.pair (fields 1) (fields 3) ∈ env S ∧ + ZFSet.pair (ZFSet.pair (fields 1) (fields 0)) (fields 4) ∈ env E) → + LinkedProfilePreservingTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) + (fields 2) (fields 3) (fields 4) := by + rw [realize_imp, BoundedFormula.realize_toFormula M _ _ + (extendMany_members 5 fields env ground members)] + simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, + BoundedFormula.truth_tripleMembershipFormula] + rw [M.realize_linkedProfilePreservingTransitionFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ _ _ + (extendMany_members 5 fields env ground members) + (by simpa only [extendMany_suffix] using omega) + (by simpa only [extendMany_suffix] using ordinal)] + simp only [extendMany_prefix, extendMany_suffix] + constructor + · intro recognized i j a b z first second third + have h₁ := M.transitive (members S) first + have h₂ := M.transitive (members S) second + have h₃ := M.transitive (members E) third + let fields : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases a (Fin.cases b (fun _ => z)))) + have ground : ∀ k, fields k ∈ M.sets := Fin.cases (M.pair_left h₁) + (Fin.cases (M.pair_left h₂) (Fin.cases (M.pair_right h₁) + (Fin.cases (M.pair_right h₂) (fun _ => M.pair_right h₃)))) + exact (actual fields ground).1 (recognized fields ground) ⟨first, second, third⟩ + · intro law fields ground + exact (actual fields ground).2 (fun entries => + law (fields 0) (fields 1) (fields 2) (fields 3) (fields 4) entries.1 entries.2.1 entries.2.2) + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +structure PreservedMainPrefixHistoryCode (M : TransitiveGround.{u}) + (K Labels C D rD A p : ZFSet.{u}) : Prop where + function : FunctionGraphOn A p + values : ∀ i q, ZFSet.pair i q ∈ p → + ∃ S E, q = mainPrefixCode (insert i i) S E ∧ + MainPrefixGraphCode M K Labels C D rD (insert i i) S E ∧ + MainPrefixProfileGraphCode M K Labels C D rD S E + compatible : ∀ i j q r, ZFSet.pair i q ∈ p → ZFSet.pair j r ∈ p → + (i = j ∨ i ∈ j) → MainPrefixExtends q r + +namespace PreservedMainPrefixHistoryCode +variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} +variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) + +private theorem exists_fields (i : SetMembers A) : + ∃ fields : ZFSet.{u} × ZFSet.{u}, + decodedFamilyValue history.function i = mainPrefixCode (insert (SetMembers.raw i) (SetMembers.raw i)) + fields.1 fields.2 ∧ + MainPrefixGraphCode M K Labels C D rD (insert (SetMembers.raw i) (SetMembers.raw i)) fields.1 fields.2 ∧ + MainPrefixProfileGraphCode M K Labels C D rD fields.1 fields.2 := by + obtain ⟨S, E, equal, valid, profiles⟩ := history.values _ _ + (decodedFamilyValue_entry history.function i) + exact ⟨(S, E), equal, valid, profiles⟩ + +noncomputable def fields (i : SetMembers A) : ZFSet.{u} × ZFSet.{u} := + Classical.choose (history.exists_fields i) + +theorem fields_spec (i : SetMembers A) : + decodedFamilyValue history.function i = mainPrefixCode (insert (SetMembers.raw i) (SetMembers.raw i)) + (history.fields i).1 (history.fields i).2 ∧ + MainPrefixGraphCode M K Labels C D rD (insert (SetMembers.raw i) (SetMembers.raw i)) + (history.fields i).1 (history.fields i).2 ∧ + MainPrefixProfileGraphCode M K Labels C D rD (history.fields i).1 (history.fields i).2 := + Classical.choose_spec (history.exists_fields i) + +noncomputable def graphFamily : MainPrefixGraphFamily M K Labels C D rD (SetMembers A) where + indices i := insert (SetMembers.raw i) (SetMembers.raw i) + stages i := (history.fields i).1 + transitions i := (history.fields i).2 + valid i := (history.fields_spec i).2.1 + mono i j subset := by + have before : SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j := + ZFSet.mem_insert_iff.1 (subset (ZFSet.mem_insert_iff.2 (Or.inl rfl))) + have extension := history.compatible _ _ _ _ + (decodedFamilyValue_entry history.function i) (decodedFamilyValue_entry history.function j) before + rw [(history.fields_spec i).1, (history.fields_spec j).1] at extension + exact (mainPrefixExtends_iff.1 extension).2 + +theorem graphFamily_code_entry (i : SetMembers A) : + ZFSet.pair (SetMembers.raw i) (history.graphFamily.code i) ∈ p := by + change ZFSet.pair (SetMembers.raw i) + (mainPrefixCode (insert (SetMembers.raw i) (SetMembers.raw i)) + (history.fields i).1 (history.fields i).2) ∈ p + rw [← (history.fields_spec i).1] + exact decodedFamilyValue_entry history.function i + +theorem graphFamily_codeGraph_eq : + familyCodeGraph (@SetMembers.raw A) history.graphFamily.code = p := + familyCodeGraph_eq_of_entries history.function _ _ (ordinalMainIndex_key_range A) + history.graphFamily_code_entry + +theorem graphFamily_profiles (i : SetMembers A) : + MainPrefixProfileGraphCode M K Labels C D rD + (history.graphFamily.stages i) (history.graphFamily.transitions i) := + (history.fields_spec i).2.2 + +theorem graphFamily_indexUnion (ordinal : ordinalSetProperty A) : + history.graphFamily.indexUnion = A := by + apply ZFSet.ext + intro x + rw [history.graphFamily.indexUnion_mem] + constructor + · rintro ⟨i, hi⟩ + rcases ZFSet.mem_insert_iff.1 hi with equal | below + · exact equal.symm ▸ SetMembers.raw_mem i + · exact ordinal.1 _ (SetMembers.raw_mem i) x below + · intro hx + refine ⟨SetMembers.ofMem x hx, ?_⟩ + change x ∈ insert (SetMembers.raw (SetMembers.ofMem x hx)) (SetMembers.raw (SetMembers.ofMem x hx)) + rw [SetMembers.raw_ofMem] + exact ZFSet.mem_insert_iff.2 (Or.inl rfl) + +end PreservedMainPrefixHistoryCode + + + + + +def MainPrefixHistoryFieldMem (p x : ZFSet.{u}) (j : Fin 3) : Prop := + ∃ i T S E, ZFSet.pair i (mainPrefixCode T S E) ∈ p ∧ + x ∈ (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) j + +def MainPrefixHistoryUnionCode (p q : ZFSet.{u}) : Prop := + ∃ T S E, q = mainPrefixCode T S E ∧ + ∀ (j : Fin 3) x, x ∈ (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) j ↔ + MainPrefixHistoryFieldMem p x j + +theorem MainPrefixHistoryUnionCode.unique {p q r : ZFSet.{u}} + (first : MainPrefixHistoryUnionCode p q) (second : MainPrefixHistoryUnionCode p r) : q = r := by + obtain ⟨T, S, E, rfl, fields⟩ := first + obtain ⟨U, F, G, rfl, fields'⟩ := second + apply mainPrefixCode_inj.2 + exact ⟨ZFSet.ext (fun x => (fields 0 x).trans (fields' 0 x).symm), + ZFSet.ext (fun x => (fields 1 x).trans (fields' 1 x).symm), + ZFSet.ext (fun x => (fields 2 x).trans (fields' 2 x).symm)⟩ + +namespace PreservedMainPrefixHistoryCode +variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} +variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) + +theorem field_mem_iff (j : Fin 3) (x : ZFSet.{u}) : + MainPrefixHistoryFieldMem p x j ↔ + ∃ i : SetMembers A, x ∈ (Fin.cases (history.graphFamily.indices i) + (Fin.cases (history.graphFamily.stages i) (fun _ => history.graphFamily.transitions i)) : + Fin 3 → ZFSet.{u}) j := by + constructor + · rintro ⟨i, T, S, E, entry, member⟩ + have hi := history.function.pair_source entry + let k := SetMembers.ofMem i hi + have actual : ZFSet.pair i (history.graphFamily.code k) ∈ p := by + have actual := history.graphFamily_code_entry k + simpa only [k, SetMembers.raw_ofMem] using actual + have equal := history.function.unique entry actual + have fields := mainPrefixCode_inj.1 equal + refine ⟨k, ?_⟩ + rw [fields.1, fields.2.1, fields.2.2] at member + exact member + · rintro ⟨i, member⟩ + exact ⟨SetMembers.raw i, history.graphFamily.indices i, history.graphFamily.stages i, + history.graphFamily.transitions i, history.graphFamily_code_entry i, member⟩ + +theorem union_code : MainPrefixHistoryUnionCode p history.graphFamily.unionCode := by + refine ⟨history.graphFamily.indexUnion, history.graphFamily.stageUnion, + history.graphFamily.transitionUnion, rfl, ?_⟩ + intro j + refine Fin.cases ?_ (Fin.cases ?_ (fun _ => ?_)) j + · intro x + exact (history.graphFamily.indexUnion_mem x).trans (history.field_mem_iff 0 x).symm + · intro x + exact (history.graphFamily.stageUnion_mem x).trans (history.field_mem_iff 1 x).symm + · intro x + exact (history.graphFamily.transitionUnion_mem x).trans (history.field_mem_iff 2 x).symm + +end PreservedMainPrefixHistoryCode + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def mainPrefixHistoryFieldMemFormula {n} (p x : Fin n) (j : Fin 3) : SetFormula n := + let old := suffixIndex n 5 + let field := prefixIndex n 5 + let selected : Fin 3 → Fin (n + 5) := Fin.cases (field 1) (Fin.cases (field 2) (fun _ => field 3)) + exBlock 5 (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (field 0) (field 4) (old p)) + (.conj (BoundedFormula.mainPrefixTupleFormula (field 4) (field 1) (field 2) (field 3)) + (.mem (old x) (selected j)))).toFormula + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem mainPrefixHistoryFieldMem_ground {p x : ZFSet.{u}} {j : Fin 3} + (hp : p ∈ M.sets) (member : MainPrefixHistoryFieldMem p x j) : x ∈ M.sets := by + obtain ⟨i, T, S, E, entry, member⟩ := member + have fields := M.mainPrefixCode_fields_mem (M.pair_right (M.transitive hp entry)) + have ground : ∀ k, (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) k ∈ M.sets := + Fin.cases fields.1 (Fin.cases fields.2.1 (fun _ => fields.2.2)) + exact M.transitive (ground j) member + +theorem realize_mainPrefixHistoryFieldMemFormula {n} (p x : Fin n) (j : Fin 3) + (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : + Realize M.sets (mainPrefixHistoryFieldMemFormula p x j) env ↔ + MainPrefixHistoryFieldMem (env p) (env x) j := by + rw [mainPrefixHistoryFieldMemFormula, realize_exBlock] + let old := suffixIndex n 5 + let field := prefixIndex n 5 + let selected : Fin 3 → Fin (n + 5) := Fin.cases (field 1) (Fin.cases (field 2) (fun _ => field 3)) + have actual (f : Fin 5 → ZFSet.{u}) (ground : ∀ k, f k ∈ M.sets) : + Realize M.sets (BoundedFormula.conj + (BoundedFormula.pairMembershipFormula (field 0) (field 4) (old p)) + (.conj (BoundedFormula.mainPrefixTupleFormula (field 4) (field 1) (field 2) (field 3)) + (.mem (old x) (selected j)))).toFormula (extendMany 5 f env) ↔ + ZFSet.pair (f 0) (f 4) ∈ env p ∧ f 4 = mainPrefixCode (f 1) (f 2) (f 3) ∧ + env x ∈ (Fin.cases (f 1) (Fin.cases (f 2) (fun _ => f 3)) : Fin 3 → ZFSet.{u}) j := by + rw [BoundedFormula.realize_toFormula M _ _ (extendMany_members 5 f env ground members)] + simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, + BoundedFormula.truth_mainPrefixTupleFormula, old, field, extendMany_prefix, extendMany_suffix] + refine Fin.cases ?_ (Fin.cases ?_ (fun _ => ?_)) j <;> rfl + constructor + · rintro ⟨f, ground, recognized⟩ + obtain ⟨entry, equal, member⟩ := (actual f ground).1 recognized + exact ⟨f 0, f 1, f 2, f 3, equal ▸ entry, member⟩ + · rintro ⟨i, T, S, E, entry, member⟩ + have pairGround := M.transitive (members p) entry + have fieldsGround := M.mainPrefixCode_fields_mem (M.pair_right pairGround) + let f : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases T (Fin.cases S + (Fin.cases E (fun _ => mainPrefixCode T S E)))) + have ground : ∀ k, f k ∈ M.sets := Fin.cases (M.pair_left pairGround) + (Fin.cases fieldsGround.1 (Fin.cases fieldsGround.2.1 + (Fin.cases fieldsGround.2.2 (fun _ => M.pair_right pairGround)))) + exact ⟨f, ground, (actual f ground).2 ⟨entry, rfl, member⟩⟩ + +end TransitiveGround +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u + +def MainPrefixAtIndex (T q : ZFSet.{u}) : Prop := + ∃ S E, q = mainPrefixCode T S E + +def MainPrefixHistoryExtends (p q : ZFSet.{u}) : Prop := + ∀ i old, ZFSet.pair i old ∈ p → MainPrefixExtends old q + +def MainPrefixTraceStepCode (B seed g α p y : ZFSet.{u}) : Prop := + y ∈ B ∧ MainPrefixAtIndex (insert α α) y ∧ MainPrefixHistoryExtends p y ∧ + ((α = ∅ ∧ y = seed) ∨ + (α ≠ ∅ ∧ ∃ input, MainPrefixHistoryUnionCode p input ∧ ZFSet.pair input y ∈ g)) + +theorem MainPrefixAtIndex.unique {T U q : ZFSet.{u}} + (first : MainPrefixAtIndex T q) (second : MainPrefixAtIndex U q) : T = U := by + obtain ⟨S, E, a⟩ := first + obtain ⟨F, G, b⟩ := second + exact (mainPrefixCode_inj.1 (a.symm.trans b)).1 + +theorem MainPrefixAtIndex.refl {T q : ZFSet.{u}} (code : MainPrefixAtIndex T q) : + MainPrefixExtends q q := by + obtain ⟨S, E, rfl⟩ := code + exact MainPrefixExtends.refl T S E + +theorem MainPrefixTraceStepCode.unique {B seed g α p y z : ZFSet.{u}} + (function : FunctionGraphOn B g) + (first : MainPrefixTraceStepCode B seed g α p y) + (second : MainPrefixTraceStepCode B seed g α p z) : y = z := by + rcases first.2.2.2 with ⟨zero, hy⟩ | ⟨nonzero, a, unionA, entryA⟩ + · rcases second.2.2.2 with ⟨_, hz⟩ | ⟨nonzero, _⟩ + · exact hy.trans hz.symm + · exact False.elim (nonzero zero) + · rcases second.2.2.2 with ⟨zero, _⟩ | ⟨_, b, unionB, entryB⟩ + · exact False.elim (nonzero zero) + · have equal := unionA.unique unionB + exact function.unique entryA (equal.symm ▸ entryB) + +theorem MainPrefixHistoryExtends.trans {p q r : ZFSet.{u}} + (history : MainPrefixHistoryExtends p q) (extension : MainPrefixExtends q r) : + MainPrefixHistoryExtends p r := + fun i old entry => (history i old entry).trans extension + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def mainPrefixHistoryFieldUnionFormula {n} (p output : Fin n) (j : Fin 3) : SetFormula n := + exactSetFormula output (mainPrefixHistoryFieldMemFormula p.succ 0 j) + +def mainPrefixHistoryUnionFormula {n} (p q : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let field := prefixIndex n 3 + exBlock 3 (.conj (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2)).toFormula + (conjBlock 3 (fun j => mainPrefixHistoryFieldUnionFormula (old p) (field j) j))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_mainPrefixHistoryFieldUnionFormula {n} (p output : Fin n) (j : Fin 3) + (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : + Realize M.sets (mainPrefixHistoryFieldUnionFormula p output j) env ↔ + ∀ x, x ∈ env output ↔ MainPrefixHistoryFieldMem (env p) x j := by + change (∀ x ∈ M.sets, Realize M.sets + (.conj (imp (.mem 0 output.succ) (mainPrefixHistoryFieldMemFormula p.succ 0 j)) + (imp (mainPrefixHistoryFieldMemFormula p.succ 0 j) (.mem 0 output.succ))) (extend x env)) ↔ _ + simp only [Realize, realize_imp] + have meaning (x : ZFSet.{u}) (hx : x ∈ M.sets) : + Realize M.sets (mainPrefixHistoryFieldMemFormula p.succ 0 j) (extend x env) ↔ + MainPrefixHistoryFieldMem (env p) x j := + M.realize_mainPrefixHistoryFieldMemFormula p.succ 0 j (extend x env) (Fin.cases hx members) + constructor + · intro recognized x + constructor + · intro member + have hx := M.transitive (members output) member + exact (meaning x hx).1 ((recognized x hx).1 member) + · intro member + have hx := M.mainPrefixHistoryFieldMem_ground (members p) member + exact (recognized x hx).2 ((meaning x hx).2 member) + · intro exactFields x hx + exact ⟨fun member => (meaning x hx).2 ((exactFields x).1 member), + fun recognized => (exactFields x).2 ((meaning x hx).1 recognized)⟩ + +theorem realize_mainPrefixHistoryUnionFormula {n} (p q : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) : + Realize M.sets (mainPrefixHistoryUnionFormula p q) env ↔ + MainPrefixHistoryUnionCode (env p) (env q) := by + rw [mainPrefixHistoryUnionFormula, realize_exBlock] + let old := suffixIndex n 3 + let field := prefixIndex n 3 + have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ k, f k ∈ M.sets) : + (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2)).toFormula + (extendMany 3 f env) ∧ + Realize M.sets (conjBlock 3 (fun j => mainPrefixHistoryFieldUnionFormula (old p) (field j) j)) + (extendMany 3 f env)) ↔ + env q = mainPrefixCode (f 0) (f 1) (f 2) ∧ + ∀ j x, x ∈ f j ↔ MainPrefixHistoryFieldMem (env p) x j := by + have mems := extendMany_members 3 f env ground members + rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems, realize_conjBlock] + apply and_congr + · simp only [old, field, extendMany_prefix, extendMany_suffix] + · apply forall_congr' + intro j + simpa only [old, field, extendMany_prefix, extendMany_suffix] using + M.realize_mainPrefixHistoryFieldUnionFormula (old p) (field j) j (extendMany 3 f env) mems + constructor + · rintro ⟨f, ground, recognized⟩ + obtain ⟨encoded, fields⟩ := (actual f ground).1 recognized + have same : (Fin.cases (f 0) (Fin.cases (f 1) (fun _ => f 2)) : Fin 3 → ZFSet.{u}) = f := by + funext j + refine Fin.cases rfl (Fin.cases rfl (fun k => ?_)) j + rw [Fin.eq_zero k] + rfl + refine ⟨f 0, f 1, f 2, encoded, ?_⟩ + rw [same] + exact fields + · rintro ⟨T, S, E, encoded, fields⟩ + have grounds := M.mainPrefixCode_fields_mem (encoded ▸ members q) + let f : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E)) + have ground : ∀ k, f k ∈ M.sets := Fin.cases grounds.1 (Fin.cases grounds.2.1 (fun _ => grounds.2.2)) + exact ⟨f, ground, (actual f ground).2 ⟨encoded, fields⟩⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixSelectedTraceLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixSelectedTraceLaws.lean index ca5ff54cbc373db0239048e1415b749780f87ab1..83fd1783e4538a3206af35d3e4de848054e19646 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixSelectedTraceLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainPrefixSelectedTraceLaws.lean @@ -1,515 +1,515 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.MainPrefixTraceStepFormulas - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace OrdinalRecursionTrace -universe u -variable {B seed g A p : ZFSet.{u}} -variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) -include trace - -theorem mainPrefix_values {i q : ZFSet.{u}} (entry : ZFSet.pair i q ∈ p) : - q ∈ B ∧ MainPrefixAtIndex (insert i i) q := by - have step := trace.2 i (trace.1.pair_source entry) q entry - exact ⟨step.1, step.2.1⟩ - -theorem mainPrefix_extends {i j q r : ZFSet.{u}} - (first : ZFSet.pair i q ∈ p) (second : ZFSet.pair j r ∈ p) - (before : i = j ∨ i ∈ j) : MainPrefixExtends q r := by - rcases before with rfl | before - · have equal := trace.1.unique first second - rw [equal] - exact (trace.mainPrefix_values second).2.refl - · have step := trace.2 j (trace.1.pair_source second) r second - exact step.2.2.1 i q (pair_mem_graphRestriction.2 ⟨first, before⟩) - -theorem preservedMainPrefixHistory {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} - (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) : - PreservedMainPrefixHistoryCode M K Labels C D rD A p := by - refine ⟨trace.1, ?_, ?_⟩ - · intro i q entry - obtain ⟨member, S, E, equal⟩ := trace.mainPrefix_values entry - obtain ⟨T, F, G, encoded, valid, preserved⟩ := candidates q member - obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 (encoded.symm.trans equal) - exact ⟨_, _, equal, valid, preserved⟩ - · intro i j q r first second before - exact trace.mainPrefix_extends first second before - -end OrdinalRecursionTrace - -namespace PreservedMainPrefixHistoryCode -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} -variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) - -theorem unionCode_ground - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (domain : A ∈ M.sets) (whole : p ∈ M.sets) : - history.graphFamily.unionCode ∈ M.sets := by - apply history.graphFamily.unionCode_ground pairing unions powers separation - (@SetMembers.raw A) (SetMembers.raw_injective A) - · rw [ordinalMainIndex_key_range] - exact domain - · rw [history.graphFamily_codeGraph_eq] - exact whole - -theorem ranked_union_candidate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) - (ordinalK : ordinalSetProperty K) (regular : GroundRegular M K) - (limit : Order.IsSuccLimit (ZFSet.rank K)) - (domain : A ∈ M.sets) (whole : p ∈ M.sets) (small : GroundBelow M A K) - (level : GroundMainCandidateLevel M K) - (candidates : ∀ i q, ZFSet.pair i q ∈ p → q ∈ level.preservedMainPrefixes Labels C D rD) : - history.graphFamily.unionCode ∈ M.sets ∧ - ZFSet.rank history.graphFamily.unionCode < ZFSet.rank K ∧ - history.graphFamily.unionCode ∈ level.preservedMainPrefixes Labels C D rD := by - have ranks : ∀ i, ZFSet.rank (history.graphFamily.code i) < ZFSet.rank K := by - intro i - exact ((level.membership _).1 - ((level.mem_preservedMainPrefixes).1 (candidates _ _ (history.graphFamily_code_entry i))).1).2 - have domainRange : ZFSet.range (@SetMembers.raw A) ∈ M.sets := by - rw [ordinalMainIndex_key_range] - exact domain - have wholeFamily : familyCodeGraph (@SetMembers.raw A) history.graphFamily.code ∈ M.sets := by - rw [history.graphFamily_codeGraph_eq] - exact whole - have smallRange : GroundBelow M (ZFSet.range (@SetMembers.raw A)) K := by - rw [ordinalMainIndex_key_range] - exact small - have rank := history.graphFamily.unionCode_rank_lt_small pairing unions powers separation collection - hK ordinalK regular limit (@SetMembers.raw A) (SetMembers.raw_injective A) domainRange wholeFamily smallRange ranks - have ground := history.unionCode_ground pairing unions powers separation domain whole - refine ⟨ground, rank, level.mem_preservedMainPrefixes.2 ⟨(level.membership _).2 ⟨ground, rank⟩, ?_⟩⟩ - exact ⟨history.graphFamily.indexUnion, history.graphFamily.stageUnion, history.graphFamily.transitionUnion, - rfl, history.graphFamily.union_valid, - history.graphFamily.union_profile_graph_code history.graphFamily_profiles⟩ - -theorem union_mem_recursionPrefixes - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) - (ordinalK : ordinalSetProperty K) (regular : GroundRegular M K) - (limit : Order.IsSuccLimit (ZFSet.rank K)) - (domain : A ∈ M.sets) (whole : p ∈ M.sets) (small : GroundBelow M A K) - (level : GroundMainCandidateLevel M K) - (candidates : ∀ i q, ZFSet.pair i q ∈ p → q ∈ level.preservedMainPrefixes Labels C D rD) - {Omega : ZFSet.{u}} (member : A ∈ Omega) (nonempty : A ≠ ∅) - (ordinalA : ordinalSetProperty A) : - history.graphFamily.unionCode ∈ level.recursionPrefixes Omega Labels C D rD := by - have candidate := (history.ranked_union_candidate pairing unions powers separation collection - hK ordinalK regular limit domain whole small level candidates).2.2 - refine level.mem_recursionPrefixes.2 ⟨candidate, mainPrefixRecursionIndexCode_iff.2 ?_⟩ - rw [history.graphFamily_indexUnion ordinalA] - exact ⟨member, nonempty⟩ - -end PreservedMainPrefixHistoryCode - -section -universe u - -theorem MainPrefixHistoryExtends.union_code {p q T i : ZFSet.{u}} - (history : MainPrefixHistoryExtends p q) (code : MainPrefixAtIndex T q) - (last : ZFSet.pair i q ∈ p) : MainPrefixHistoryUnionCode p q := by - obtain ⟨S, E, rfl⟩ := code - refine ⟨T, S, E, rfl, ?_⟩ - intro j x - constructor - · intro member - exact ⟨i, T, S, E, last, member⟩ - · rintro ⟨k, U, F, G, entry, member⟩ - have extension := mainPrefixExtends_iff.1 (history k _ entry) - have subset : (Fin.cases U (Fin.cases F (fun _ => G)) : Fin 3 → ZFSet.{u}) j ⊆ - (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) j := - Fin.cases extension.1 (Fin.cases extension.2.1 (fun _ => extension.2.2)) j - exact subset member - -theorem OrdinalRecursionTrace.mainPrefix_successor_union {B seed g β p q : ZFSet.{u}} - (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) (insert β β) p) - (last : ZFSet.pair β q ∈ p) : MainPrefixHistoryUnionCode p q := by - have history : MainPrefixHistoryExtends p q := by - intro i old entry - exact trace.mainPrefix_extends entry last (ZFSet.mem_insert_iff.1 (trace.1.pair_source entry)) - exact history.union_code (trace.mainPrefix_values last).2 last - -end - -namespace PreservedMainPrefixHistoryCode -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} -variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) -include history - -theorem exists_unique_groundUnionCode - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (member : A ∈ M.groundOmegaOne pairing unions powers separation collection infinite) - (nonempty : A ≠ ∅) (whole : p ∈ M.sets) - (level : GroundMainCandidateLevel M K) - (candidates : ∀ i q, ZFSet.pair i q ∈ p → q ∈ level.preservedMainPrefixes Labels C D rD) : - ∃ q ∈ M.sets, MainPrefixHistoryUnionCode p q ∧ - q ∈ level.recursionPrefixes (M.groundOmegaOne pairing unions powers separation collection infinite) - Labels C D rD ∧ - (∃ S E, q = mainPrefixCode A S E) ∧ - (∀ i old, ZFSet.pair i old ∈ p → MainPrefixExtends old q) ∧ - ∀ r, MainPrefixHistoryUnionCode p r → r = q := by - have conditions := standard.to_conditions pairing unions powers separation hK - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have domain := M.transitive spec.1 member - have ordinalA := ordinalSetProperty_member spec.2.1 member - have small : GroundBelow M A K := - ⟨ZFSet.omega, conditions.2.1, - M.groundOmegaOne_member_countable pairing unions powers separation collection infinite member⟩ - have ground := history.unionCode_ground pairing unions powers separation domain whole - have candidate := history.union_mem_recursionPrefixes pairing unions powers separation collection - hK conditions.1 conditions.2.2.1 - (conditions.rank_isLimit pairing unions powers separation infinite hK) - domain whole small level candidates member nonempty ordinalA - refine ⟨history.graphFamily.unionCode, ground, history.union_code, candidate, ?_, ?_, ?_⟩ - · refine ⟨history.graphFamily.stageUnion, history.graphFamily.transitionUnion, ?_⟩ - unfold MainPrefixGraphFamily.unionCode - rw [history.graphFamily_indexUnion ordinalA] - · intro i old entry - let k := SetMembers.ofMem i (history.function.pair_source entry) - have actual : ZFSet.pair i (history.graphFamily.code k) ∈ p := by - simpa only [k, SetMembers.raw_ofMem] using history.graphFamily_code_entry k - have equal := history.function.unique entry actual - rw [equal] - exact history.graphFamily.code_extends_union k - · intro r code - exact code.unique history.union_code - -end PreservedMainPrefixHistoryCode - -section -open SetFormula -universe u - -def mainPrefixTraceParams (B seed g : ZFSet.{u}) : Fin 3 → ZFSet.{u} := - Fin.cases B (Fin.cases seed (fun _ => g)) - -def mainPrefixRecursionFormula : SetFormula 6 := - mainPrefixTraceStepFormula 3 4 5 0 1 2 - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem mainPrefixTraceParams_ground {B seed g : ZFSet.{u}} - (hB : B ∈ M.sets) (hSeed : seed ∈ M.sets) (hg : g ∈ M.sets) : - ∀ j, mainPrefixTraceParams B seed g j ∈ M.sets := - Fin.cases hB (Fin.cases hSeed (fun _ => hg)) - -theorem realize_mainPrefixRecursionFormula {B seed g α p y : ZFSet.{u}} - (hB : B ∈ M.sets) (hSeed : seed ∈ M.sets) (hg : g ∈ M.sets) - (hα : α ∈ M.sets) (hp : p ∈ M.sets) (hy : y ∈ M.sets) : - Realize M.sets mainPrefixRecursionFormula - (extend α (extend p (extend y (mainPrefixTraceParams B seed g)))) ↔ - MainPrefixTraceStepCode B seed g α p y := - M.realize_mainPrefixTraceStepFormula 3 4 5 0 1 2 _ - (Fin.cases hα (Fin.cases hp (Fin.cases hy (M.mainPrefixTraceParams_ground hB hSeed hg)))) - -theorem mainPrefix_codeTrace {B seed g A p : ZFSet.{u}} - (hB : B ∈ M.sets) (hSeed : seed ∈ M.sets) (hg : g ∈ M.sets) (hA : A ∈ M.sets) - (trace : OrdinalRecursionTrace - (groundRecursionStep M mainPrefixRecursionFormula (mainPrefixTraceParams B seed g)) A p) : - OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p := by - refine ⟨trace.1, ?_⟩ - intro α member y entry - have step := trace.2 α member y entry - exact (M.realize_mainPrefixRecursionFormula hB hSeed hg (M.transitive hA member) step.1 step.2.1).1 - step.2.2 - -end TransitiveGround - -end - -section -universe u - -theorem MainPrefixTraceStepCode.selected_of_nonzero {B seed g α p y : ZFSet.{u}} - (step : MainPrefixTraceStepCode B seed g α p y) (nonzero : α ≠ ∅) : - ∃ input, MainPrefixHistoryUnionCode p input ∧ ZFSet.pair input y ∈ g := by - rcases step.2.2.2 with ⟨zero, _⟩ | ⟨_, chosen⟩ - · exact False.elim (nonzero zero) - · exact chosen - -namespace OrdinalRecursionTrace -variable {B seed g A p : ZFSet.{u}} -variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) -include trace - -theorem mainPrefix_zero_entry (zero : (∅ : ZFSet.{u}) ∈ A) : ZFSet.pair ∅ seed ∈ p := by - obtain ⟨y, entry⟩ := trace.1.total zero - have step := trace.2 ∅ zero y entry - rcases step.2.2.2 with ⟨_, equal⟩ | ⟨nonzero, _⟩ - · exact equal ▸ entry - · exact False.elim (nonzero rfl) - -theorem mainPrefix_successor_entry (ordinal : ordinalSetProperty A) - {β old next : ZFSet.{u}} (member : insert β β ∈ A) - (oldEntry : ZFSet.pair β old ∈ p) (nextEntry : ZFSet.pair (insert β β) next ∈ p) : - ZFSet.pair old next ∈ g := by - have ordinalIndex := ordinalSetProperty_member ordinal member - have subset : insert β β ⊆ A := fun x hx => ordinal.1 _ member x hx - have earlier := trace.restrict ordinalIndex subset - have oldRestricted : ZFSet.pair β old ∈ graphRestriction (insert β β) p := - pair_mem_graphRestriction.2 ⟨oldEntry, ZFSet.mem_insert _ _⟩ - have unionOld := earlier.mainPrefix_successor_union oldRestricted - have nonzero : insert β β ≠ ∅ := by - intro zero - exact ZFSet.notMem_empty β (zero ▸ ZFSet.mem_insert β β) - obtain ⟨input, unionInput, entry⟩ := - (trace.2 _ member next nextEntry).selected_of_nonzero nonzero - exact unionInput.unique unionOld ▸ entry - -end OrdinalRecursionTrace - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem mainPrefixTraceStepClosure - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) {Labels C D rD B seed g : ZFSet.{u}} - (domain : B = level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) - (hB : B ∈ M.sets) (seedMember : seed ∈ B) - (seedIndex : MainPrefixAtIndex (insert ∅ ∅) seed) (hg : g ∈ M.sets) - (function : ZFSet.IsFunc B B g) - (advance : ∀ old next T, ZFSet.pair old next ∈ g → MainPrefixAtIndex T old → - MainPrefixAtIndex (insert T T) next ∧ MainPrefixExtends old next) : - GroundOrdinalStepClosure M - (M.groundOmegaOne pairing unions powers separation collection infinite) - mainPrefixRecursionFormula (mainPrefixTraceParams B seed g) := by - have hSeed := M.transitive hB seedMember - have hOmega := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - have graph : FunctionGraphOn B g := ⟨B, function⟩ - have candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q := by - intro q member - rw [domain] at member - exact (level.mem_preservedMainPrefixes.1 (level.mem_recursionPrefixes.1 member).1).2 - intro α member p hp trace - have hα := M.transitive hOmega member - have actual := M.mainPrefix_codeTrace hB hSeed hg hα trace - have finish : ∀ y ∈ M.sets, MainPrefixTraceStepCode B seed g α p y → - ∃ y ∈ M.sets, Realize M.sets mainPrefixRecursionFormula - (extend α (extend p (extend y (mainPrefixTraceParams B seed g)))) ∧ - ∀ z ∈ M.sets, Realize M.sets mainPrefixRecursionFormula - (extend α (extend p (extend z (mainPrefixTraceParams B seed g)))) → z = y := by - intro y hy code - refine ⟨y, hy, (M.realize_mainPrefixRecursionFormula hB hSeed hg hα hp hy).2 code, ?_⟩ - intro z hz recognized - exact ((M.realize_mainPrefixRecursionFormula hB hSeed hg hα hp hz).1 recognized).unique graph code - by_cases zero : α = ∅ - · apply finish seed hSeed - refine ⟨seedMember, zero.symm ▸ seedIndex, ?_, Or.inl ⟨zero, rfl⟩⟩ - intro i old entry - have impossible := trace.1.pair_source entry - rw [zero] at impossible - exact False.elim (ZFSet.notMem_empty i impossible) - · have history := actual.preservedMainPrefixHistory candidates - have storedCandidates : ∀ i q, ZFSet.pair i q ∈ p → - q ∈ level.preservedMainPrefixes Labels C D rD := by - intro i q entry - have member := (actual.mainPrefix_values entry).1 - rw [domain] at member - exact (level.mem_recursionPrefixes.1 member).1 - obtain ⟨input, _, unionCode, inputMember, inputIndex, extension, _⟩ := - history.exists_unique_groundUnionCode pairing unions powers separation collection infinite - hK standard member zero hp level storedCandidates - have inputB : input ∈ B := domain.symm ▸ inputMember - obtain ⟨y, entry⟩ := graph.total inputB - have yB := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨index, stepExtension⟩ := advance input y α entry inputIndex - apply finish y (M.transitive hB yB) - exact ⟨yB, index, fun i old oldEntry => (extension i old oldEntry).trans stepExtension, - Or.inr ⟨zero, input, unionCode, entry⟩⟩ - -theorem exists_unique_selectedMainPrefixTrace - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (level : GroundMainCandidateLevel M K) {Labels C D rD B seed g : ZFSet.{u}} - (domain : B = level.recursionPrefixes - (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) - (hB : B ∈ M.sets) (seedMember : seed ∈ B) - (seedIndex : MainPrefixAtIndex (insert ∅ ∅) seed) (hg : g ∈ M.sets) - (function : ZFSet.IsFunc B B g) - (advance : ∀ old next T, ZFSet.pair old next ∈ g → MainPrefixAtIndex T old → - MainPrefixAtIndex (insert T T) next ∧ MainPrefixExtends old next) : - ∃ p ∈ M.sets, - OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) - (M.groundOmegaOne pairing unions powers separation collection infinite) p ∧ - ∀ q, OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) - (M.groundOmegaOne pairing unions powers separation collection infinite) q → q = p := by - have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite - have hSeed := M.transitive hB seedMember - have closure := M.mainPrefixTraceStepClosure pairing unions powers separation collection infinite - hK standard level domain hB seedMember seedIndex hg function advance - obtain ⟨p, hp, trace, _, _⟩ := M.exists_unique_ordinalRecursionTrace pairing unions separation - collection spec.1 spec.2.1 mainPrefixRecursionFormula (mainPrefixTraceParams B seed g) - (M.mainPrefixTraceParams_ground hB hSeed hg) closure - have actual := M.mainPrefix_codeTrace hB hSeed hg spec.1 trace - refine ⟨p, hp, actual, ?_⟩ - intro q other - exact other.unique actual spec.2.1 (fun _ hx => hx) - (fun _ _ _ _ _ _ first second => first.unique ⟨B, function⟩ second) - -end TransitiveGround - -namespace OrdinalRecursionTrace -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD B seed g A p : ZFSet.{u}} -variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) -include trace - -theorem exists_groundTerminalPrefixCode - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (ordinal : ordinalSetProperty A) (whole : p ∈ M.sets) - (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) : - ∃ q ∈ M.sets, MainPrefixHistoryUnionCode p q ∧ MainPrefixAtIndex A q ∧ - PreservedMainPrefixCode M K Labels C D rD q ∧ MainPrefixHistoryExtends p q ∧ - ∀ r, MainPrefixHistoryUnionCode p r → r = q := by - have history := trace.preservedMainPrefixHistory candidates - let family := history.graphFamily - have index := history.graphFamily_indexUnion ordinal - have ground := history.unionCode_ground pairing unions powers separation hA whole - refine ⟨family.unionCode, ground, history.union_code, ?_, ?_, ?_, ?_⟩ - · refine ⟨family.stageUnion, family.transitionUnion, ?_⟩ - change mainPrefixCode family.indexUnion family.stageUnion family.transitionUnion = _ - rw [index] - · exact ⟨family.indexUnion, family.stageUnion, family.transitionUnion, rfl, - family.union_valid, family.union_profile_graph_code history.graphFamily_profiles⟩ - · intro i old entry - let k := SetMembers.ofMem i (trace.1.pair_source entry) - have actual : ZFSet.pair i (family.code k) ∈ p := by - simpa only [k, family, SetMembers.raw_ofMem] using history.graphFamily_code_entry k - have equal := trace.1.unique entry actual - rw [equal] - exact family.code_extends_union k - · intro r recognized - exact recognized.unique history.union_code - -end OrdinalRecursionTrace - -namespace OrdinalRecursionTrace -open SetFormula SetRealization -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD B seed g A p : ZFSet.{u}} -variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) -include trace - -theorem exists_groundTerminalPrefix - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hA : A ∈ M.sets) (ordinal : ordinalSetProperty A) (whole : p ∈ M.sets) - (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) : - ∃ ordinalA : ordinalSetProperty A, - letI := ordinalMainIndexPreorder ordinalA - ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers A), - run.indices = A ∧ run.PreservesOldProfiles ∧ MainPrefixHistoryUnionCode p run.code ∧ - MainPrefixHistoryExtends p run.code ∧ - ∀ q, MainPrefixHistoryUnionCode p q → q = run.code := by - obtain ⟨q, hq, union, index, preserved, extension, unique⟩ := - trace.exists_groundTerminalPrefixCode pairing unions powers separation hA ordinal whole candidates - obtain ⟨T, _, ordinalT, run, indices, equal, profiles⟩ := - preserved.exists_decodedPrefix pairing unions powers separation hq - let := ordinalMainIndexPreorder ordinalT - have indexT : MainPrefixAtIndex T q := by - refine ⟨run.stageGraph, run.transitionGraph, ?_⟩ - rw [← equal] - change mainPrefixCode run.indices _ _ = _ - rw [indices] - have same := indexT.unique index - subst T - refine ⟨ordinalT, run, indices, profiles, ?_, ?_, ?_⟩ - · exact equal.symm ▸ union - · exact equal.symm ▸ extension - · intro r recognized - exact (unique r recognized).trans equal.symm - -end OrdinalRecursionTrace - -namespace OrdinalRecursionTrace -open SetFormula -universe u -variable {M : TransitiveGround.{u}} {K Labels C D rD B seed g A p q : ZFSet.{u}} -variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) -include trace - -theorem terminalCode_ranked_candidate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) - (ordinalK : ordinalSetProperty K) (regular : GroundRegular M K) - (limit : Order.IsSuccLimit (ZFSet.rank K)) (hA : A ∈ M.sets) (whole : p ∈ M.sets) - (small : GroundBelow M A K) (level : GroundMainCandidateLevel M K) - (candidates : ∀ z ∈ B, z ∈ level.preservedMainPrefixes Labels C D rD) - (terminal : MainPrefixHistoryUnionCode p q) : - q ∈ M.sets ∧ ZFSet.rank q < ZFSet.rank K ∧ - q ∈ level.preservedMainPrefixes Labels C D rD := by - have preserved : ∀ z ∈ B, PreservedMainPrefixCode M K Labels C D rD z := by - intro z member - exact (level.mem_preservedMainPrefixes.1 (candidates z member)).2 - have history := trace.preservedMainPrefixHistory preserved - have ranked := history.ranked_union_candidate pairing unions powers separation collection - hK ordinalK regular limit hA whole small level - (fun _ z entry => candidates z (trace.mainPrefix_values entry).1) - exact (terminal.unique history.union_code).symm ▸ ranked - -theorem groundOmegaOne_terminalCode_ranked_candidate - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) - (domain : A = M.groundOmegaOne pairing unions powers separation collection infinite) - (whole : p ∈ M.sets) (level : GroundMainCandidateLevel M K) - (candidateDomain : B = level.recursionPrefixes A Labels C D rD) - (terminal : MainPrefixHistoryUnionCode p q) : - GroundBelow M A K ∧ q ∈ M.sets ∧ ZFSet.rank q < ZFSet.rank K ∧ - q ∈ level.preservedMainPrefixes Labels C D rD := by - have conditions := standard.to_conditions pairing unions powers separation hK - have hA : A ∈ M.sets := domain.symm ▸ - (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - have member : A ∈ K := domain.symm ▸ - standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK - have small := GroundBelow.of_member pairing unions powers separation hK member - refine ⟨small, trace.terminalCode_ranked_candidate pairing unions powers separation collection - hK conditions.1 conditions.2.2.1 (conditions.rank_isLimit pairing unions powers separation infinite hK) - hA whole small level ?_ terminal⟩ - intro z hz - rw [candidateDomain] at hz - exact (level.mem_recursionPrefixes.1 hz).1 - -end OrdinalRecursionTrace - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.MainPrefixTraceStepFormulas + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace OrdinalRecursionTrace +universe u +variable {B seed g A p : ZFSet.{u}} +variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) +include trace + +theorem mainPrefix_values {i q : ZFSet.{u}} (entry : ZFSet.pair i q ∈ p) : + q ∈ B ∧ MainPrefixAtIndex (insert i i) q := by + have step := trace.2 i (trace.1.pair_source entry) q entry + exact ⟨step.1, step.2.1⟩ + +theorem mainPrefix_extends {i j q r : ZFSet.{u}} + (first : ZFSet.pair i q ∈ p) (second : ZFSet.pair j r ∈ p) + (before : i = j ∨ i ∈ j) : MainPrefixExtends q r := by + rcases before with rfl | before + · have equal := trace.1.unique first second + rw [equal] + exact (trace.mainPrefix_values second).2.refl + · have step := trace.2 j (trace.1.pair_source second) r second + exact step.2.2.1 i q (pair_mem_graphRestriction.2 ⟨first, before⟩) + +theorem preservedMainPrefixHistory {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}} + (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) : + PreservedMainPrefixHistoryCode M K Labels C D rD A p := by + refine ⟨trace.1, ?_, ?_⟩ + · intro i q entry + obtain ⟨member, S, E, equal⟩ := trace.mainPrefix_values entry + obtain ⟨T, F, G, encoded, valid, preserved⟩ := candidates q member + obtain ⟨rfl, rfl, rfl⟩ := mainPrefixCode_inj.1 (encoded.symm.trans equal) + exact ⟨_, _, equal, valid, preserved⟩ + · intro i j q r first second before + exact trace.mainPrefix_extends first second before + +end OrdinalRecursionTrace + +namespace PreservedMainPrefixHistoryCode +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} +variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) + +theorem unionCode_ground + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (domain : A ∈ M.sets) (whole : p ∈ M.sets) : + history.graphFamily.unionCode ∈ M.sets := by + apply history.graphFamily.unionCode_ground pairing unions powers separation + (@SetMembers.raw A) (SetMembers.raw_injective A) + · rw [ordinalMainIndex_key_range] + exact domain + · rw [history.graphFamily_codeGraph_eq] + exact whole + +theorem ranked_union_candidate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) + (ordinalK : ordinalSetProperty K) (regular : GroundRegular M K) + (limit : Order.IsSuccLimit (ZFSet.rank K)) + (domain : A ∈ M.sets) (whole : p ∈ M.sets) (small : GroundBelow M A K) + (level : GroundMainCandidateLevel M K) + (candidates : ∀ i q, ZFSet.pair i q ∈ p → q ∈ level.preservedMainPrefixes Labels C D rD) : + history.graphFamily.unionCode ∈ M.sets ∧ + ZFSet.rank history.graphFamily.unionCode < ZFSet.rank K ∧ + history.graphFamily.unionCode ∈ level.preservedMainPrefixes Labels C D rD := by + have ranks : ∀ i, ZFSet.rank (history.graphFamily.code i) < ZFSet.rank K := by + intro i + exact ((level.membership _).1 + ((level.mem_preservedMainPrefixes).1 (candidates _ _ (history.graphFamily_code_entry i))).1).2 + have domainRange : ZFSet.range (@SetMembers.raw A) ∈ M.sets := by + rw [ordinalMainIndex_key_range] + exact domain + have wholeFamily : familyCodeGraph (@SetMembers.raw A) history.graphFamily.code ∈ M.sets := by + rw [history.graphFamily_codeGraph_eq] + exact whole + have smallRange : GroundBelow M (ZFSet.range (@SetMembers.raw A)) K := by + rw [ordinalMainIndex_key_range] + exact small + have rank := history.graphFamily.unionCode_rank_lt_small pairing unions powers separation collection + hK ordinalK regular limit (@SetMembers.raw A) (SetMembers.raw_injective A) domainRange wholeFamily smallRange ranks + have ground := history.unionCode_ground pairing unions powers separation domain whole + refine ⟨ground, rank, level.mem_preservedMainPrefixes.2 ⟨(level.membership _).2 ⟨ground, rank⟩, ?_⟩⟩ + exact ⟨history.graphFamily.indexUnion, history.graphFamily.stageUnion, history.graphFamily.transitionUnion, + rfl, history.graphFamily.union_valid, + history.graphFamily.union_profile_graph_code history.graphFamily_profiles⟩ + +theorem union_mem_recursionPrefixes + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) + (ordinalK : ordinalSetProperty K) (regular : GroundRegular M K) + (limit : Order.IsSuccLimit (ZFSet.rank K)) + (domain : A ∈ M.sets) (whole : p ∈ M.sets) (small : GroundBelow M A K) + (level : GroundMainCandidateLevel M K) + (candidates : ∀ i q, ZFSet.pair i q ∈ p → q ∈ level.preservedMainPrefixes Labels C D rD) + {Omega : ZFSet.{u}} (member : A ∈ Omega) (nonempty : A ≠ ∅) + (ordinalA : ordinalSetProperty A) : + history.graphFamily.unionCode ∈ level.recursionPrefixes Omega Labels C D rD := by + have candidate := (history.ranked_union_candidate pairing unions powers separation collection + hK ordinalK regular limit domain whole small level candidates).2.2 + refine level.mem_recursionPrefixes.2 ⟨candidate, mainPrefixRecursionIndexCode_iff.2 ?_⟩ + rw [history.graphFamily_indexUnion ordinalA] + exact ⟨member, nonempty⟩ + +end PreservedMainPrefixHistoryCode + +section +universe u + +theorem MainPrefixHistoryExtends.union_code {p q T i : ZFSet.{u}} + (history : MainPrefixHistoryExtends p q) (code : MainPrefixAtIndex T q) + (last : ZFSet.pair i q ∈ p) : MainPrefixHistoryUnionCode p q := by + obtain ⟨S, E, rfl⟩ := code + refine ⟨T, S, E, rfl, ?_⟩ + intro j x + constructor + · intro member + exact ⟨i, T, S, E, last, member⟩ + · rintro ⟨k, U, F, G, entry, member⟩ + have extension := mainPrefixExtends_iff.1 (history k _ entry) + have subset : (Fin.cases U (Fin.cases F (fun _ => G)) : Fin 3 → ZFSet.{u}) j ⊆ + (Fin.cases T (Fin.cases S (fun _ => E)) : Fin 3 → ZFSet.{u}) j := + Fin.cases extension.1 (Fin.cases extension.2.1 (fun _ => extension.2.2)) j + exact subset member + +theorem OrdinalRecursionTrace.mainPrefix_successor_union {B seed g β p q : ZFSet.{u}} + (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) (insert β β) p) + (last : ZFSet.pair β q ∈ p) : MainPrefixHistoryUnionCode p q := by + have history : MainPrefixHistoryExtends p q := by + intro i old entry + exact trace.mainPrefix_extends entry last (ZFSet.mem_insert_iff.1 (trace.1.pair_source entry)) + exact history.union_code (trace.mainPrefix_values last).2 last + +end + +namespace PreservedMainPrefixHistoryCode +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD A p : ZFSet.{u}} +variable (history : PreservedMainPrefixHistoryCode M K Labels C D rD A p) +include history + +theorem exists_unique_groundUnionCode + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (member : A ∈ M.groundOmegaOne pairing unions powers separation collection infinite) + (nonempty : A ≠ ∅) (whole : p ∈ M.sets) + (level : GroundMainCandidateLevel M K) + (candidates : ∀ i q, ZFSet.pair i q ∈ p → q ∈ level.preservedMainPrefixes Labels C D rD) : + ∃ q ∈ M.sets, MainPrefixHistoryUnionCode p q ∧ + q ∈ level.recursionPrefixes (M.groundOmegaOne pairing unions powers separation collection infinite) + Labels C D rD ∧ + (∃ S E, q = mainPrefixCode A S E) ∧ + (∀ i old, ZFSet.pair i old ∈ p → MainPrefixExtends old q) ∧ + ∀ r, MainPrefixHistoryUnionCode p r → r = q := by + have conditions := standard.to_conditions pairing unions powers separation hK + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have domain := M.transitive spec.1 member + have ordinalA := ordinalSetProperty_member spec.2.1 member + have small : GroundBelow M A K := + ⟨ZFSet.omega, conditions.2.1, + M.groundOmegaOne_member_countable pairing unions powers separation collection infinite member⟩ + have ground := history.unionCode_ground pairing unions powers separation domain whole + have candidate := history.union_mem_recursionPrefixes pairing unions powers separation collection + hK conditions.1 conditions.2.2.1 + (conditions.rank_isLimit pairing unions powers separation infinite hK) + domain whole small level candidates member nonempty ordinalA + refine ⟨history.graphFamily.unionCode, ground, history.union_code, candidate, ?_, ?_, ?_⟩ + · refine ⟨history.graphFamily.stageUnion, history.graphFamily.transitionUnion, ?_⟩ + unfold MainPrefixGraphFamily.unionCode + rw [history.graphFamily_indexUnion ordinalA] + · intro i old entry + let k := SetMembers.ofMem i (history.function.pair_source entry) + have actual : ZFSet.pair i (history.graphFamily.code k) ∈ p := by + simpa only [k, SetMembers.raw_ofMem] using history.graphFamily_code_entry k + have equal := history.function.unique entry actual + rw [equal] + exact history.graphFamily.code_extends_union k + · intro r code + exact code.unique history.union_code + +end PreservedMainPrefixHistoryCode + +section +open SetFormula +universe u + +def mainPrefixTraceParams (B seed g : ZFSet.{u}) : Fin 3 → ZFSet.{u} := + Fin.cases B (Fin.cases seed (fun _ => g)) + +def mainPrefixRecursionFormula : SetFormula 6 := + mainPrefixTraceStepFormula 3 4 5 0 1 2 + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem mainPrefixTraceParams_ground {B seed g : ZFSet.{u}} + (hB : B ∈ M.sets) (hSeed : seed ∈ M.sets) (hg : g ∈ M.sets) : + ∀ j, mainPrefixTraceParams B seed g j ∈ M.sets := + Fin.cases hB (Fin.cases hSeed (fun _ => hg)) + +theorem realize_mainPrefixRecursionFormula {B seed g α p y : ZFSet.{u}} + (hB : B ∈ M.sets) (hSeed : seed ∈ M.sets) (hg : g ∈ M.sets) + (hα : α ∈ M.sets) (hp : p ∈ M.sets) (hy : y ∈ M.sets) : + Realize M.sets mainPrefixRecursionFormula + (extend α (extend p (extend y (mainPrefixTraceParams B seed g)))) ↔ + MainPrefixTraceStepCode B seed g α p y := + M.realize_mainPrefixTraceStepFormula 3 4 5 0 1 2 _ + (Fin.cases hα (Fin.cases hp (Fin.cases hy (M.mainPrefixTraceParams_ground hB hSeed hg)))) + +theorem mainPrefix_codeTrace {B seed g A p : ZFSet.{u}} + (hB : B ∈ M.sets) (hSeed : seed ∈ M.sets) (hg : g ∈ M.sets) (hA : A ∈ M.sets) + (trace : OrdinalRecursionTrace + (groundRecursionStep M mainPrefixRecursionFormula (mainPrefixTraceParams B seed g)) A p) : + OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p := by + refine ⟨trace.1, ?_⟩ + intro α member y entry + have step := trace.2 α member y entry + exact (M.realize_mainPrefixRecursionFormula hB hSeed hg (M.transitive hA member) step.1 step.2.1).1 + step.2.2 + +end TransitiveGround + +end + +section +universe u + +theorem MainPrefixTraceStepCode.selected_of_nonzero {B seed g α p y : ZFSet.{u}} + (step : MainPrefixTraceStepCode B seed g α p y) (nonzero : α ≠ ∅) : + ∃ input, MainPrefixHistoryUnionCode p input ∧ ZFSet.pair input y ∈ g := by + rcases step.2.2.2 with ⟨zero, _⟩ | ⟨_, chosen⟩ + · exact False.elim (nonzero zero) + · exact chosen + +namespace OrdinalRecursionTrace +variable {B seed g A p : ZFSet.{u}} +variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) +include trace + +theorem mainPrefix_zero_entry (zero : (∅ : ZFSet.{u}) ∈ A) : ZFSet.pair ∅ seed ∈ p := by + obtain ⟨y, entry⟩ := trace.1.total zero + have step := trace.2 ∅ zero y entry + rcases step.2.2.2 with ⟨_, equal⟩ | ⟨nonzero, _⟩ + · exact equal ▸ entry + · exact False.elim (nonzero rfl) + +theorem mainPrefix_successor_entry (ordinal : ordinalSetProperty A) + {β old next : ZFSet.{u}} (member : insert β β ∈ A) + (oldEntry : ZFSet.pair β old ∈ p) (nextEntry : ZFSet.pair (insert β β) next ∈ p) : + ZFSet.pair old next ∈ g := by + have ordinalIndex := ordinalSetProperty_member ordinal member + have subset : insert β β ⊆ A := fun x hx => ordinal.1 _ member x hx + have earlier := trace.restrict ordinalIndex subset + have oldRestricted : ZFSet.pair β old ∈ graphRestriction (insert β β) p := + pair_mem_graphRestriction.2 ⟨oldEntry, ZFSet.mem_insert _ _⟩ + have unionOld := earlier.mainPrefix_successor_union oldRestricted + have nonzero : insert β β ≠ ∅ := by + intro zero + exact ZFSet.notMem_empty β (zero ▸ ZFSet.mem_insert β β) + obtain ⟨input, unionInput, entry⟩ := + (trace.2 _ member next nextEntry).selected_of_nonzero nonzero + exact unionInput.unique unionOld ▸ entry + +end OrdinalRecursionTrace + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem mainPrefixTraceStepClosure + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) {Labels C D rD B seed g : ZFSet.{u}} + (domain : B = level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) + (hB : B ∈ M.sets) (seedMember : seed ∈ B) + (seedIndex : MainPrefixAtIndex (insert ∅ ∅) seed) (hg : g ∈ M.sets) + (function : ZFSet.IsFunc B B g) + (advance : ∀ old next T, ZFSet.pair old next ∈ g → MainPrefixAtIndex T old → + MainPrefixAtIndex (insert T T) next ∧ MainPrefixExtends old next) : + GroundOrdinalStepClosure M + (M.groundOmegaOne pairing unions powers separation collection infinite) + mainPrefixRecursionFormula (mainPrefixTraceParams B seed g) := by + have hSeed := M.transitive hB seedMember + have hOmega := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + have graph : FunctionGraphOn B g := ⟨B, function⟩ + have candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q := by + intro q member + rw [domain] at member + exact (level.mem_preservedMainPrefixes.1 (level.mem_recursionPrefixes.1 member).1).2 + intro α member p hp trace + have hα := M.transitive hOmega member + have actual := M.mainPrefix_codeTrace hB hSeed hg hα trace + have finish : ∀ y ∈ M.sets, MainPrefixTraceStepCode B seed g α p y → + ∃ y ∈ M.sets, Realize M.sets mainPrefixRecursionFormula + (extend α (extend p (extend y (mainPrefixTraceParams B seed g)))) ∧ + ∀ z ∈ M.sets, Realize M.sets mainPrefixRecursionFormula + (extend α (extend p (extend z (mainPrefixTraceParams B seed g)))) → z = y := by + intro y hy code + refine ⟨y, hy, (M.realize_mainPrefixRecursionFormula hB hSeed hg hα hp hy).2 code, ?_⟩ + intro z hz recognized + exact ((M.realize_mainPrefixRecursionFormula hB hSeed hg hα hp hz).1 recognized).unique graph code + by_cases zero : α = ∅ + · apply finish seed hSeed + refine ⟨seedMember, zero.symm ▸ seedIndex, ?_, Or.inl ⟨zero, rfl⟩⟩ + intro i old entry + have impossible := trace.1.pair_source entry + rw [zero] at impossible + exact False.elim (ZFSet.notMem_empty i impossible) + · have history := actual.preservedMainPrefixHistory candidates + have storedCandidates : ∀ i q, ZFSet.pair i q ∈ p → + q ∈ level.preservedMainPrefixes Labels C D rD := by + intro i q entry + have member := (actual.mainPrefix_values entry).1 + rw [domain] at member + exact (level.mem_recursionPrefixes.1 member).1 + obtain ⟨input, _, unionCode, inputMember, inputIndex, extension, _⟩ := + history.exists_unique_groundUnionCode pairing unions powers separation collection infinite + hK standard member zero hp level storedCandidates + have inputB : input ∈ B := domain.symm ▸ inputMember + obtain ⟨y, entry⟩ := graph.total inputB + have yB := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨index, stepExtension⟩ := advance input y α entry inputIndex + apply finish y (M.transitive hB yB) + exact ⟨yB, index, fun i old oldEntry => (extension i old oldEntry).trans stepExtension, + Or.inr ⟨zero, input, unionCode, entry⟩⟩ + +theorem exists_unique_selectedMainPrefixTrace + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + {K : ZFSet.{u}} (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (level : GroundMainCandidateLevel M K) {Labels C D rD B seed g : ZFSet.{u}} + (domain : B = level.recursionPrefixes + (M.groundOmegaOne pairing unions powers separation collection infinite) Labels C D rD) + (hB : B ∈ M.sets) (seedMember : seed ∈ B) + (seedIndex : MainPrefixAtIndex (insert ∅ ∅) seed) (hg : g ∈ M.sets) + (function : ZFSet.IsFunc B B g) + (advance : ∀ old next T, ZFSet.pair old next ∈ g → MainPrefixAtIndex T old → + MainPrefixAtIndex (insert T T) next ∧ MainPrefixExtends old next) : + ∃ p ∈ M.sets, + OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) + (M.groundOmegaOne pairing unions powers separation collection infinite) p ∧ + ∀ q, OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) + (M.groundOmegaOne pairing unions powers separation collection infinite) q → q = p := by + have spec := M.groundOmegaOne_spec pairing unions powers separation collection infinite + have hSeed := M.transitive hB seedMember + have closure := M.mainPrefixTraceStepClosure pairing unions powers separation collection infinite + hK standard level domain hB seedMember seedIndex hg function advance + obtain ⟨p, hp, trace, _, _⟩ := M.exists_unique_ordinalRecursionTrace pairing unions separation + collection spec.1 spec.2.1 mainPrefixRecursionFormula (mainPrefixTraceParams B seed g) + (M.mainPrefixTraceParams_ground hB hSeed hg) closure + have actual := M.mainPrefix_codeTrace hB hSeed hg spec.1 trace + refine ⟨p, hp, actual, ?_⟩ + intro q other + exact other.unique actual spec.2.1 (fun _ hx => hx) + (fun _ _ _ _ _ _ first second => first.unique ⟨B, function⟩ second) + +end TransitiveGround + +namespace OrdinalRecursionTrace +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD B seed g A p : ZFSet.{u}} +variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) +include trace + +theorem exists_groundTerminalPrefixCode + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (ordinal : ordinalSetProperty A) (whole : p ∈ M.sets) + (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) : + ∃ q ∈ M.sets, MainPrefixHistoryUnionCode p q ∧ MainPrefixAtIndex A q ∧ + PreservedMainPrefixCode M K Labels C D rD q ∧ MainPrefixHistoryExtends p q ∧ + ∀ r, MainPrefixHistoryUnionCode p r → r = q := by + have history := trace.preservedMainPrefixHistory candidates + let family := history.graphFamily + have index := history.graphFamily_indexUnion ordinal + have ground := history.unionCode_ground pairing unions powers separation hA whole + refine ⟨family.unionCode, ground, history.union_code, ?_, ?_, ?_, ?_⟩ + · refine ⟨family.stageUnion, family.transitionUnion, ?_⟩ + change mainPrefixCode family.indexUnion family.stageUnion family.transitionUnion = _ + rw [index] + · exact ⟨family.indexUnion, family.stageUnion, family.transitionUnion, rfl, + family.union_valid, family.union_profile_graph_code history.graphFamily_profiles⟩ + · intro i old entry + let k := SetMembers.ofMem i (trace.1.pair_source entry) + have actual : ZFSet.pair i (family.code k) ∈ p := by + simpa only [k, family, SetMembers.raw_ofMem] using history.graphFamily_code_entry k + have equal := trace.1.unique entry actual + rw [equal] + exact family.code_extends_union k + · intro r recognized + exact recognized.unique history.union_code + +end OrdinalRecursionTrace + +namespace OrdinalRecursionTrace +open SetFormula SetRealization +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD B seed g A p : ZFSet.{u}} +variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) +include trace + +theorem exists_groundTerminalPrefix + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hA : A ∈ M.sets) (ordinal : ordinalSetProperty A) (whole : p ∈ M.sets) + (candidates : ∀ q ∈ B, PreservedMainPrefixCode M K Labels C D rD q) : + ∃ ordinalA : ordinalSetProperty A, + letI := ordinalMainIndexPreorder ordinalA + ∃ run : GroundMainPrefix M K Labels C D rD pairing unions powers separation (SetMembers A), + run.indices = A ∧ run.PreservesOldProfiles ∧ MainPrefixHistoryUnionCode p run.code ∧ + MainPrefixHistoryExtends p run.code ∧ + ∀ q, MainPrefixHistoryUnionCode p q → q = run.code := by + obtain ⟨q, hq, union, index, preserved, extension, unique⟩ := + trace.exists_groundTerminalPrefixCode pairing unions powers separation hA ordinal whole candidates + obtain ⟨T, _, ordinalT, run, indices, equal, profiles⟩ := + preserved.exists_decodedPrefix pairing unions powers separation hq + let := ordinalMainIndexPreorder ordinalT + have indexT : MainPrefixAtIndex T q := by + refine ⟨run.stageGraph, run.transitionGraph, ?_⟩ + rw [← equal] + change mainPrefixCode run.indices _ _ = _ + rw [indices] + have same := indexT.unique index + subst T + refine ⟨ordinalT, run, indices, profiles, ?_, ?_, ?_⟩ + · exact equal.symm ▸ union + · exact equal.symm ▸ extension + · intro r recognized + exact (unique r recognized).trans equal.symm + +end OrdinalRecursionTrace + +namespace OrdinalRecursionTrace +open SetFormula +universe u +variable {M : TransitiveGround.{u}} {K Labels C D rD B seed g A p q : ZFSet.{u}} +variable (trace : OrdinalRecursionTrace (MainPrefixTraceStepCode B seed g) A p) +include trace + +theorem terminalCode_ranked_candidate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (hK : K ∈ M.sets) + (ordinalK : ordinalSetProperty K) (regular : GroundRegular M K) + (limit : Order.IsSuccLimit (ZFSet.rank K)) (hA : A ∈ M.sets) (whole : p ∈ M.sets) + (small : GroundBelow M A K) (level : GroundMainCandidateLevel M K) + (candidates : ∀ z ∈ B, z ∈ level.preservedMainPrefixes Labels C D rD) + (terminal : MainPrefixHistoryUnionCode p q) : + q ∈ M.sets ∧ ZFSet.rank q < ZFSet.rank K ∧ + q ∈ level.preservedMainPrefixes Labels C D rD := by + have preserved : ∀ z ∈ B, PreservedMainPrefixCode M K Labels C D rD z := by + intro z member + exact (level.mem_preservedMainPrefixes.1 (candidates z member)).2 + have history := trace.preservedMainPrefixHistory preserved + have ranked := history.ranked_union_candidate pairing unions powers separation collection + hK ordinalK regular limit hA whole small level + (fun _ z entry => candidates z (trace.mainPrefix_values entry).1) + exact (terminal.unique history.union_code).symm ▸ ranked + +theorem groundOmegaOne_terminalCode_ranked_candidate + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (hK : K ∈ M.sets) (standard : GroundStandardInaccessible M K) + (domain : A = M.groundOmegaOne pairing unions powers separation collection infinite) + (whole : p ∈ M.sets) (level : GroundMainCandidateLevel M K) + (candidateDomain : B = level.recursionPrefixes A Labels C D rD) + (terminal : MainPrefixHistoryUnionCode p q) : + GroundBelow M A K ∧ q ∈ M.sets ∧ ZFSet.rank q < ZFSet.rank K ∧ + q ∈ level.preservedMainPrefixes Labels C D rD := by + have conditions := standard.to_conditions pairing unions powers separation hK + have hA : A ∈ M.sets := domain.symm ▸ + (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + have member : A ∈ K := domain.symm ▸ + standard.groundOmegaOne_mem pairing unions powers separation collection infinite hK + have small := GroundBelow.of_member pairing unions powers separation hK member + refine ⟨small, trace.terminalCode_ranked_candidate pairing unions powers separation collection + hK conditions.1 conditions.2.2.1 (conditions.rank_isLimit pairing unions powers separation infinite hK) + hA whole small level ?_ terminal⟩ + intro z hz + rw [candidateDomain] at hz + exact (level.mem_recursionPrefixes.1 hz).1 + +end OrdinalRecursionTrace + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageFilterBases.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageFilterBases.lean index 98993efcbeb8dbeae61bdd699f7ecdc459c95850..2aa526aec6d3fde6342688518cb4c5699d8b5356 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageFilterBases.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageFilterBases.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.ExternalFilterBases - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Chronological -universe u - -namespace MainStage - -theorem all_filters_of_eq {s t : MainStage.{u}} (eq : s = t) - (small : AllFiltersCountable t.order) : AllFiltersCountable s.order := by cases eq; exact small - -theorem initial_all_filters_countable : AllFiltersCountable initial.{u}.order := by - let : Countable initial.{u}.Point := inferInstanceAs (Countable (ULift.{u} Bool)) - exact all_filters_of_countable initial.order - -theorem internal_all_filters_countable (s : MainStage.{u}) (Label : Type u) - (small : AllFiltersCountable s.order) : AllFiltersCountable (s.internal Label).order := - (s.tasks Label).union_all_filters_countable small - -theorem next_all_filters_countable (s : MainStage.{u}) (Label : Type u) - (small : AllFiltersCountable s.order) : AllFiltersCountable (s.next Label).order := - (s.requests Label).extension_all_filters_countable (s.internal Label).action - (s.internal_all_filters_countable Label small) - -namespace Diagram -variable {I : Type u} [LinearOrder I] [Countable I] (d : Diagram I) - -theorem countable_union_all_filters_countable (small : ∀ i, AllFiltersCountable (d.stage i).order) : - AllFiltersCountable d.orders.unionOrder := - all_filters_of_countable_cover d.orders.system.Point d.orders.order d.orders.inclusion - d.orders.system.cover small - -theorem limit_all_filters_countable [Nonempty I] - (small : ∀ i, AllFiltersCountable (d.stage i).order) : AllFiltersCountable d.limit.order := - FixedTop.all_filters_countable _ (d.countable_union_all_filters_countable small) - -end Diagram - -open CountableColumns - -theorem ordinalStep_all_filters_countable (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) - (small : ∀ i, AllFiltersCountable (d.stage i).order) : - AllFiltersCountable (ordinalStep Label a d).apex.order := by - classical - by_cases inhabited : Nonempty (Set.Iio a) - · by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last - · exact all_filters_of_eq (ordinalStep_last Label a d hasLast.choose hasLast.choose_spec) - ((d.stage hasLast.choose).next_all_filters_countable Label (small hasLast.choose)) - · let := inhabited - have eq : ordinalStep Label a d = d.limitCone := - (dite_eq_left inhabited).trans (dite_eq_right hasLast) - exact all_filters_of_eq (congrArg Diagram.Cone.apex eq) (d.limit_all_filters_countable small) - · exact all_filters_of_eq (ordinalStep_empty Label a d inhabited) initial_all_filters_countable - -namespace OrdinalRun -variable (Label : Type 1) - -theorem stage_all_filters_countable (a : Column) : AllFiltersCountable (stage Label a).order := by - have wf : WellFounded ((· < ·) : Column → Column → Prop) := wellFounded_lt - induction a using wf.induction with - | h a ih => - apply all_filters_of_eq (Transfinite.stage_generated (ordinalStep Label) a) - exact ordinalStep_all_filters_countable Label a (before Label a) (fun i => ih i.val i.property) - -theorem stage_filter_basis (a : Column) (F : MeetFilter (stage Label a).order) : CountableBasis F := - stage_all_filters_countable Label a F - -theorem countableOrdinalLabels_stage_filter_basis (a : Column) - (F : MeetFilter (countableOrdinalLabels.stage a).order) : CountableBasis F := - stage_filter_basis Column a F - -end OrdinalRun - -end MainStage -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.ExternalFilterBases + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Chronological +universe u + +namespace MainStage + +theorem all_filters_of_eq {s t : MainStage.{u}} (eq : s = t) + (small : AllFiltersCountable t.order) : AllFiltersCountable s.order := by cases eq; exact small + +theorem initial_all_filters_countable : AllFiltersCountable initial.{u}.order := by + let : Countable initial.{u}.Point := inferInstanceAs (Countable (ULift.{u} Bool)) + exact all_filters_of_countable initial.order + +theorem internal_all_filters_countable (s : MainStage.{u}) (Label : Type u) + (small : AllFiltersCountable s.order) : AllFiltersCountable (s.internal Label).order := + (s.tasks Label).union_all_filters_countable small + +theorem next_all_filters_countable (s : MainStage.{u}) (Label : Type u) + (small : AllFiltersCountable s.order) : AllFiltersCountable (s.next Label).order := + (s.requests Label).extension_all_filters_countable (s.internal Label).action + (s.internal_all_filters_countable Label small) + +namespace Diagram +variable {I : Type u} [LinearOrder I] [Countable I] (d : Diagram I) + +theorem countable_union_all_filters_countable (small : ∀ i, AllFiltersCountable (d.stage i).order) : + AllFiltersCountable d.orders.unionOrder := + all_filters_of_countable_cover d.orders.system.Point d.orders.order d.orders.inclusion + d.orders.system.cover small + +theorem limit_all_filters_countable [Nonempty I] + (small : ∀ i, AllFiltersCountable (d.stage i).order) : AllFiltersCountable d.limit.order := + FixedTop.all_filters_countable _ (d.countable_union_all_filters_countable small) + +end Diagram + +open CountableColumns + +theorem ordinalStep_all_filters_countable (Label : Type 1) (a : Column) (d : Diagram (Set.Iio a)) + (small : ∀ i, AllFiltersCountable (d.stage i).order) : + AllFiltersCountable (ordinalStep Label a d).apex.order := by + classical + by_cases inhabited : Nonempty (Set.Iio a) + · by_cases hasLast : ∃ last : Set.Iio a, ∀ i, i ≤ last + · exact all_filters_of_eq (ordinalStep_last Label a d hasLast.choose hasLast.choose_spec) + ((d.stage hasLast.choose).next_all_filters_countable Label (small hasLast.choose)) + · let := inhabited + have eq : ordinalStep Label a d = d.limitCone := + (dite_eq_left inhabited).trans (dite_eq_right hasLast) + exact all_filters_of_eq (congrArg Diagram.Cone.apex eq) (d.limit_all_filters_countable small) + · exact all_filters_of_eq (ordinalStep_empty Label a d inhabited) initial_all_filters_countable + +namespace OrdinalRun +variable (Label : Type 1) + +theorem stage_all_filters_countable (a : Column) : AllFiltersCountable (stage Label a).order := by + have wf : WellFounded ((· < ·) : Column → Column → Prop) := wellFounded_lt + induction a using wf.induction with + | h a ih => + apply all_filters_of_eq (Transfinite.stage_generated (ordinalStep Label) a) + exact ordinalStep_all_filters_countable Label a (before Label a) (fun i => ih i.val i.property) + +theorem stage_filter_basis (a : Column) (F : MeetFilter (stage Label a).order) : CountableBasis F := + stage_all_filters_countable Label a F + +theorem countableOrdinalLabels_stage_filter_basis (a : Column) + (F : MeetFilter (countableOrdinalLabels.stage a).order) : CountableBasis F := + stage_filter_basis Column a F + +end OrdinalRun + +end MainStage +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageTaskCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageTaskCodes.lean index e8de3ed335318e64284c529ca4e92b8759fe53bd..011cc6246ca0e3bfe685a3ef4c308eb0dece85df 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageTaskCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/MainStageTaskCodes.lean @@ -1,45 +1,45 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.InitialCompressionAccounting - -namespace OAI - -section - -namespace PartitionPilot.Forcing.GroundMainStage -universe u -variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} -variable (stage : GroundMainStage M C D rD) (Labels : ZFSet.{u}) - -noncomputable def compressionInitial : RecursiveStateData.{u} := - M.initialCompressionData stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels - -noncomputable def compressionTasks : ZFSet.{u} := - M.groundEligibleTasks stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels - -noncomputable def compressionSources : ZFSet.{u} := - literalTaskSourceGraph (stage.compressionTasks Labels) stage.carrier - (M.groundRelations stage.carrier stage.carrier) - (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels - -noncomputable def compressionFilters : ZFSet.{u} := - literalTaskFilterGraph (stage.compressionTasks Labels) stage.carrier - (M.groundRelations stage.carrier stage.carrier) - (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels - -noncomputable def compressionTargets : ZFSet.{u} := - literalTaskTargetGraph (stage.compressionTasks Labels) stage.carrier - (M.groundRelations stage.carrier stage.carrier) - (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels - -noncomputable def compressionSeparators : ZFSet.{u} := - literalTaskSeparatorGraph (stage.compressionTasks Labels) stage.carrier - (M.groundRelations stage.carrier stage.carrier) - (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels - -noncomputable def compressionTaskAction : ZFSet.{u} := - M.groundTaskTransport stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels - -end PartitionPilot.Forcing.GroundMainStage - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.InitialCompressionAccounting + +namespace OAI + +section + +namespace PartitionPilot.Forcing.GroundMainStage +universe u +variable {M : TransitiveGround.{u}} {C D rD : ZFSet.{u}} +variable (stage : GroundMainStage M C D rD) (Labels : ZFSet.{u}) + +noncomputable def compressionInitial : RecursiveStateData.{u} := + M.initialCompressionData stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels + +noncomputable def compressionTasks : ZFSet.{u} := + M.groundEligibleTasks stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels + +noncomputable def compressionSources : ZFSet.{u} := + literalTaskSourceGraph (stage.compressionTasks Labels) stage.carrier + (M.groundRelations stage.carrier stage.carrier) + (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels + +noncomputable def compressionFilters : ZFSet.{u} := + literalTaskFilterGraph (stage.compressionTasks Labels) stage.carrier + (M.groundRelations stage.carrier stage.carrier) + (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels + +noncomputable def compressionTargets : ZFSet.{u} := + literalTaskTargetGraph (stage.compressionTasks Labels) stage.carrier + (M.groundRelations stage.carrier stage.carrier) + (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels + +noncomputable def compressionSeparators : ZFSet.{u} := + literalTaskSeparatorGraph (stage.compressionTasks Labels) stage.carrier + (M.groundRelations stage.carrier stage.carrier) + (M.groundMeetFilters stage.carrier stage.order stage.meetGraph) Labels + +noncomputable def compressionTaskAction : ZFSet.{u} := + M.groundTaskTransport stage.carrier stage.actors stage.order stage.meetGraph stage.action Labels + +end PartitionPilot.Forcing.GroundMainStage + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NaturalRecursionTraceValues.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NaturalRecursionTraceValues.lean index 2b060b4d2d31ef07f695f77af05549c13800f93e..5f2321c6e769ff79107d5e6a71a5846aad3ad336 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NaturalRecursionTraceValues.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NaturalRecursionTraceValues.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.FiniteIterationTraces - -namespace OAI - -section - -namespace PartitionPilot.Forcing.OrdinalRecursionTrace - -universe u v -variable {B : Type v} {R : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} -variable (encode : B → ZFSet.{u}) (step : B → B) (base : B) -variable (zero : ∀ p y, R (natSetCode 0) p y → y = encode base) -variable (successor : ∀ n p b y, - ZFSet.pair (natSetCode n) (encode b) ∈ p → R (natSetCode (n + 1)) p y → - y = encode (step b)) - -include zero successor - -theorem natural_entry_value {N t : ZFSet.{u}} (ordinal : ordinalSetProperty N) - (trace : OrdinalRecursionTrace R N t) : - ∀ n, natSetCode n ∈ N → ∀ y, ZFSet.pair (natSetCode n) y ∈ t → - y = encode (natIterate step base n) := by - intro n - induction n with - | zero => - intro hn y entry - exact zero _ y (trace.2 _ hn y entry) - | succ n ih => - intro hn y entry - have previous : natSetCode n ∈ natSetCode (n + 1) := - (natSetCode_mem_iff n (n + 1)).2 (Nat.lt_succ_self n) - have hnN := ordinal.1 (natSetCode (n + 1)) hn (natSetCode n) previous - obtain ⟨b, oldEntry⟩ := trace.1.total hnN - have equal := ih hnN b oldEntry - exact successor n (graphRestriction (natSetCode (n + 1)) t) - (natIterate step base n) y - (pair_mem_graphRestriction.2 ⟨equal ▸ oldEntry, previous⟩) - (trace.2 _ hn y entry) - -theorem natural_entry_iff {N t : ZFSet.{u}} (ordinal : ordinalSetProperty N) - (trace : OrdinalRecursionTrace R N t) (n : Nat) (hn : natSetCode n ∈ N) (y : ZFSet.{u}) : - ZFSet.pair (natSetCode n) y ∈ t ↔ y = encode (natIterate step base n) := by - constructor - · exact natural_entry_value encode step base zero successor ordinal trace n hn y - · intro equal - obtain ⟨z, entry⟩ := trace.1.total hn - have value := natural_entry_value encode step base zero successor ordinal trace n hn z entry - exact equal.symm ▸ (value ▸ entry) - -end PartitionPilot.Forcing.OrdinalRecursionTrace - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.FiniteIterationTraces + +namespace OAI + +section + +namespace PartitionPilot.Forcing.OrdinalRecursionTrace + +universe u v +variable {B : Type v} {R : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} +variable (encode : B → ZFSet.{u}) (step : B → B) (base : B) +variable (zero : ∀ p y, R (natSetCode 0) p y → y = encode base) +variable (successor : ∀ n p b y, + ZFSet.pair (natSetCode n) (encode b) ∈ p → R (natSetCode (n + 1)) p y → + y = encode (step b)) + +include zero successor + +theorem natural_entry_value {N t : ZFSet.{u}} (ordinal : ordinalSetProperty N) + (trace : OrdinalRecursionTrace R N t) : + ∀ n, natSetCode n ∈ N → ∀ y, ZFSet.pair (natSetCode n) y ∈ t → + y = encode (natIterate step base n) := by + intro n + induction n with + | zero => + intro hn y entry + exact zero _ y (trace.2 _ hn y entry) + | succ n ih => + intro hn y entry + have previous : natSetCode n ∈ natSetCode (n + 1) := + (natSetCode_mem_iff n (n + 1)).2 (Nat.lt_succ_self n) + have hnN := ordinal.1 (natSetCode (n + 1)) hn (natSetCode n) previous + obtain ⟨b, oldEntry⟩ := trace.1.total hnN + have equal := ih hnN b oldEntry + exact successor n (graphRestriction (natSetCode (n + 1)) t) + (natIterate step base n) y + (pair_mem_graphRestriction.2 ⟨equal ▸ oldEntry, previous⟩) + (trace.2 _ hn y entry) + +theorem natural_entry_iff {N t : ZFSet.{u}} (ordinal : ordinalSetProperty N) + (trace : OrdinalRecursionTrace R N t) (n : Nat) (hn : natSetCode n ∈ N) (y : ZFSet.{u}) : + ZFSet.pair (natSetCode n) y ∈ t ↔ y = encode (natIterate step base n) := by + constructor + · exact natural_entry_value encode step base zero successor ordinal trace n hn y + · intro equal + obtain ⟨z, entry⟩ := trace.1.total hn + have value := natural_entry_value encode step base zero successor ordinal trace n hn z entry + exact equal.symm ▸ (value ▸ entry) + +end PartitionPilot.Forcing.OrdinalRecursionTrace + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NonzeroLimitOrdinalCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NonzeroLimitOrdinalCodes.lean index 3a4294ef5e080df84517c7f62d4b61a369a2f1cd..58261dfa8c23c2fe58f672e9674ca40069e3aa14 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NonzeroLimitOrdinalCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/NonzeroLimitOrdinalCodes.lean @@ -1,211 +1,211 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs - -namespace OAI - -namespace PartitionPilot.Forcing -open SetRealization -universe u v - -abbrev MainTransitionIndex (I : Type v) [Preorder I] := {p : I × I // p.1 ≤ p.2} - -def mainTransitionIndexKey {I : Type v} [Preorder I] (key : I → ZFSet.{u}) - (p : MainTransitionIndex I) : ZFSet.{u} := ZFSet.pair (key p.val.2) (key p.val.1) - -theorem mainTransitionIndexKey_injective {I : Type v} [Preorder I] - (key : I → ZFSet.{u}) (injective : Function.Injective key) : - Function.Injective (mainTransitionIndexKey key) := by - intro p q equal - obtain ⟨target, source⟩ := ZFSet.pair_inj.1 equal - exact Subtype.ext (Prod.ext (injective source) (injective target)) - -theorem mainTransitionIndex_range {I : Type v} [Small.{u} I] [Preorder I] - (key : I → ZFSet.{u}) - (order : ∀ i j, i ≤ j ↔ key i = key j ∨ key i ∈ key j) : - ZFSet.range (mainTransitionIndexKey key) = chronologyPairs (ZFSet.range key) := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨p, rfl⟩ := ZFSet.mem_range.1 hz - exact (pair_mem_chronologyPairs _ _ _).2 - ⟨ZFSet.mem_range.2 ⟨p.val.2, rfl⟩, ZFSet.mem_range.2 ⟨p.val.1, rfl⟩, - (order _ _).1 p.property⟩ - · intro hz - obtain ⟨target, ht, source, hs, rfl, before⟩ := (mem_chronologyPairs _ z).1 hz - obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 ht - obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hs - exact ZFSet.mem_range.2 ⟨⟨(i, j), (order i j).2 before⟩, rfl⟩ - -def finiteMainIndexKey {n : Nat} (i : Fin n) : ZFSet.{u} := natSetCode i.val - -theorem finiteMainIndexKey_injective (n : Nat) : - Function.Injective (@finiteMainIndexKey.{u} n) := - fun _ _ equal => Fin.ext (natSetCode_injective equal) - -theorem finiteMainIndexKey_order {n : Nat} (i j : Fin n) : - i ≤ j ↔ finiteMainIndexKey i = finiteMainIndexKey j ∨ finiteMainIndexKey i ∈ finiteMainIndexKey j := by - change i.val ≤ j.val ↔ natSetCode i.val = natSetCode j.val ∨ natSetCode i.val ∈ natSetCode j.val - rw [natSetCode_injective.eq_iff, natSetCode_mem_iff] - omega - -theorem finiteMainIndexKey_range (n : Nat) : - ZFSet.range (@finiteMainIndexKey.{u} n) = natSetCode n := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_range, mem_natSetCode] - exact ⟨fun ⟨i, hi⟩ => ⟨i.val, i.isLt, hi.symm⟩, - fun ⟨i, hi, equal⟩ => ⟨⟨i, hi⟩, equal.symm⟩⟩ - -theorem finiteMainTransitionIndex_range (n : Nat) : - ZFSet.range (mainTransitionIndexKey (@finiteMainIndexKey.{u} n)) = - chronologyPairs (natSetCode n) := by - exact (mainTransitionIndex_range (@finiteMainIndexKey.{u} n) - (fun i j => finiteMainIndexKey_order i j)).trans - (congrArg chronologyPairs (finiteMainIndexKey_range n)) - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing -open SetRealization -universe u - -@[instance_reducible] -noncomputable def ordinalMainIndexPreorder {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) : - Preorder (SetMembers T) where - le i j := SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j - le_refl _ := Or.inl rfl - le_trans i j k first second := by - rcases first with equal | earlier - · exact equal.symm ▸ second - · rcases second with equal | later - · exact Or.inr (equal ▸ earlier) - · exact Or.inr (ordinal.2 (SetMembers.raw k) (SetMembers.raw_mem k) - (SetMembers.raw j) later (SetMembers.raw i) earlier) - -theorem ordinalMainIndex_le_iff {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) - (i j : SetMembers T) : - @LE.le _ (ordinalMainIndexPreorder ordinal).toLE i j ↔ - SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j := Iff.rfl - -theorem ordinalMainIndex_key_range (T : ZFSet.{u}) : - ZFSet.range (@SetMembers.raw T) = T := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_range] - constructor - · rintro ⟨i, rfl⟩ - exact SetMembers.raw_mem i - · intro hz - exact ⟨SetMembers.ofMem z hz, SetMembers.raw_ofMem z hz⟩ - -theorem ordinalMainTransitionIndex_range {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) : - letI := ordinalMainIndexPreorder ordinal - ZFSet.range (mainTransitionIndexKey (@SetMembers.raw T)) = chronologyPairs T := by - let := ordinalMainIndexPreorder ordinal - exact (mainTransitionIndex_range (@SetMembers.raw T) - (fun i j => ordinalMainIndex_le_iff ordinal i j)).trans - (congrArg chronologyPairs (ordinalMainIndex_key_range T)) - -theorem ordinalMainIndex_rank_le_iff {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) - (i j : SetMembers T) : - ZFSet.rank (SetMembers.raw i) ≤ ZFSet.rank (SetMembers.raw j) ↔ - SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j := by - have hi := ordinalSetProperty_eq_code_rank (SetMembers.raw i) - (ordinalSetProperty_member ordinal (SetMembers.raw_mem i)) - have hj := ordinalSetProperty_eq_code_rank (SetMembers.raw j) - (ordinalSetProperty_member ordinal (SetMembers.raw_mem j)) - constructor - · intro before - rcases lt_or_eq_of_le before with earlier | equal - · exact Or.inr (by rw [hi, hj]; exact (mem_ordinalCode_iff _ _).2 earlier) - · exact Or.inl (hi.trans ((congrArg ordinalCode equal).trans hj.symm)) - · rintro (equal | earlier) - · exact le_of_eq (congrArg ZFSet.rank equal) - · exact le_of_lt (ZFSet.rank_lt_of_mem earlier) - -theorem ordinalMainIndex_total {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) - (i j : SetMembers T) : - letI := ordinalMainIndexPreorder ordinal - i ≤ j ∨ j ≤ i := by - let := ordinalMainIndexPreorder ordinal - rcases le_total (ZFSet.rank (SetMembers.raw i)) (ZFSet.rank (SetMembers.raw j)) with first | second - · exact Or.inl ((ordinalMainIndex_rank_le_iff ordinal i j).1 first) - · exact Or.inr ((ordinalMainIndex_rank_le_iff ordinal j i).1 second) - -theorem ordinalMainIndex_antisymm {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) - (i j : SetMembers T) : - letI := ordinalMainIndexPreorder ordinal - i ≤ j → j ≤ i → i = j := by - let := ordinalMainIndexPreorder ordinal - intro first second - apply SetMembers.raw_injective T - rcases first with equal | earlier - · exact equal - · rcases second with equal | later - · exact equal.symm - · exact False.elim ((lt_irrefl (ZFSet.rank (SetMembers.raw i))) - ((ZFSet.rank_lt_of_mem earlier).trans (ZFSet.rank_lt_of_mem later))) - -theorem ordinalMainIndex_common_upper {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) - (i j : SetMembers T) : - letI := ordinalMainIndexPreorder ordinal - ∃ k : SetMembers T, i ≤ k ∧ j ≤ k := by - let := ordinalMainIndexPreorder ordinal - rcases ordinalMainIndex_total ordinal i j with before | after - · exact ⟨j, before, le_refl j⟩ - · exact ⟨i, le_refl i, after⟩ - -def NonzeroLimitOrdinalCode (T : ZFSet.{u}) : Prop := - T ≠ ∅ ∧ ∀ b ∈ T, ∃ c ∈ T, b ∈ c - -theorem not_nonzeroLimitOrdinalCode_successor (b : ZFSet.{u}) : - ¬ NonzeroLimitOrdinalCode (insert b b) := by - intro limit - obtain ⟨c, member, later⟩ := limit.2 b (ZFSet.mem_insert b b) - rcases ZFSet.mem_insert_iff.1 member with equal | earlier - · subst c - exact (lt_irrefl (ZFSet.rank b)) (ZFSet.rank_lt_of_mem later) - · exact (lt_irrefl (ZFSet.rank b)) - ((ZFSet.rank_lt_of_mem later).trans (ZFSet.rank_lt_of_mem earlier)) - -theorem ordinal_successor_or_nonzeroLimit {T : ZFSet.{u}} - (ordinal : ordinalSetProperty T) (nonempty : T ≠ ∅) : - (∃ b ∈ T, T = insert b b) ∨ NonzeroLimitOrdinalCode T := by - classical - by_cases further : ∀ b ∈ T, ∃ c ∈ T, b ∈ c - · exact Or.inr ⟨nonempty, further⟩ - · push Not at further - obtain ⟨b, member, maximal⟩ := further - refine Or.inl ⟨b, member, ?_⟩ - apply ZFSet.ext - intro x - rw [ZFSet.mem_insert_iff] - constructor - · intro hx - have comparison := ordinalMainIndex_total ordinal - (SetMembers.ofMem x hx) (SetMembers.ofMem b member) - simp only [ordinalMainIndex_le_iff, SetMembers.raw_ofMem] at comparison - rcases comparison with before | after - · exact before - · rcases after with equal | later - · exact Or.inl equal.symm - · exact False.elim (maximal x hx later) - · rintro (equal | earlier) - · exact equal.symm ▸ member - · exact ordinal.1 b member x earlier - -theorem nonzeroLimitOrdinalCode_iff_not_successor {T : ZFSet.{u}} - (ordinal : ordinalSetProperty T) (nonempty : T ≠ ∅) : - NonzeroLimitOrdinalCode T ↔ ¬ ∃ b, T = insert b b := by - constructor - · rintro limit ⟨b, rfl⟩ - exact not_nonzeroLimitOrdinalCode_successor b limit - · intro noSuccessor - rcases ordinal_successor_or_nonzeroLimit ordinal nonempty with successor | limit - · obtain ⟨b, _, equal⟩ := successor - exact False.elim (noSuccessor ⟨b, equal⟩) - · exact limit - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundRefinementPairClassGraphs + +namespace OAI + +namespace PartitionPilot.Forcing +open SetRealization +universe u v + +abbrev MainTransitionIndex (I : Type v) [Preorder I] := {p : I × I // p.1 ≤ p.2} + +def mainTransitionIndexKey {I : Type v} [Preorder I] (key : I → ZFSet.{u}) + (p : MainTransitionIndex I) : ZFSet.{u} := ZFSet.pair (key p.val.2) (key p.val.1) + +theorem mainTransitionIndexKey_injective {I : Type v} [Preorder I] + (key : I → ZFSet.{u}) (injective : Function.Injective key) : + Function.Injective (mainTransitionIndexKey key) := by + intro p q equal + obtain ⟨target, source⟩ := ZFSet.pair_inj.1 equal + exact Subtype.ext (Prod.ext (injective source) (injective target)) + +theorem mainTransitionIndex_range {I : Type v} [Small.{u} I] [Preorder I] + (key : I → ZFSet.{u}) + (order : ∀ i j, i ≤ j ↔ key i = key j ∨ key i ∈ key j) : + ZFSet.range (mainTransitionIndexKey key) = chronologyPairs (ZFSet.range key) := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨p, rfl⟩ := ZFSet.mem_range.1 hz + exact (pair_mem_chronologyPairs _ _ _).2 + ⟨ZFSet.mem_range.2 ⟨p.val.2, rfl⟩, ZFSet.mem_range.2 ⟨p.val.1, rfl⟩, + (order _ _).1 p.property⟩ + · intro hz + obtain ⟨target, ht, source, hs, rfl, before⟩ := (mem_chronologyPairs _ z).1 hz + obtain ⟨j, rfl⟩ := ZFSet.mem_range.1 ht + obtain ⟨i, rfl⟩ := ZFSet.mem_range.1 hs + exact ZFSet.mem_range.2 ⟨⟨(i, j), (order i j).2 before⟩, rfl⟩ + +def finiteMainIndexKey {n : Nat} (i : Fin n) : ZFSet.{u} := natSetCode i.val + +theorem finiteMainIndexKey_injective (n : Nat) : + Function.Injective (@finiteMainIndexKey.{u} n) := + fun _ _ equal => Fin.ext (natSetCode_injective equal) + +theorem finiteMainIndexKey_order {n : Nat} (i j : Fin n) : + i ≤ j ↔ finiteMainIndexKey i = finiteMainIndexKey j ∨ finiteMainIndexKey i ∈ finiteMainIndexKey j := by + change i.val ≤ j.val ↔ natSetCode i.val = natSetCode j.val ∨ natSetCode i.val ∈ natSetCode j.val + rw [natSetCode_injective.eq_iff, natSetCode_mem_iff] + omega + +theorem finiteMainIndexKey_range (n : Nat) : + ZFSet.range (@finiteMainIndexKey.{u} n) = natSetCode n := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_range, mem_natSetCode] + exact ⟨fun ⟨i, hi⟩ => ⟨i.val, i.isLt, hi.symm⟩, + fun ⟨i, hi, equal⟩ => ⟨⟨i, hi⟩, equal.symm⟩⟩ + +theorem finiteMainTransitionIndex_range (n : Nat) : + ZFSet.range (mainTransitionIndexKey (@finiteMainIndexKey.{u} n)) = + chronologyPairs (natSetCode n) := by + exact (mainTransitionIndex_range (@finiteMainIndexKey.{u} n) + (fun i j => finiteMainIndexKey_order i j)).trans + (congrArg chronologyPairs (finiteMainIndexKey_range n)) + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing +open SetRealization +universe u + +@[instance_reducible] +noncomputable def ordinalMainIndexPreorder {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) : + Preorder (SetMembers T) where + le i j := SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j + le_refl _ := Or.inl rfl + le_trans i j k first second := by + rcases first with equal | earlier + · exact equal.symm ▸ second + · rcases second with equal | later + · exact Or.inr (equal ▸ earlier) + · exact Or.inr (ordinal.2 (SetMembers.raw k) (SetMembers.raw_mem k) + (SetMembers.raw j) later (SetMembers.raw i) earlier) + +theorem ordinalMainIndex_le_iff {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) + (i j : SetMembers T) : + @LE.le _ (ordinalMainIndexPreorder ordinal).toLE i j ↔ + SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j := Iff.rfl + +theorem ordinalMainIndex_key_range (T : ZFSet.{u}) : + ZFSet.range (@SetMembers.raw T) = T := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_range] + constructor + · rintro ⟨i, rfl⟩ + exact SetMembers.raw_mem i + · intro hz + exact ⟨SetMembers.ofMem z hz, SetMembers.raw_ofMem z hz⟩ + +theorem ordinalMainTransitionIndex_range {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) : + letI := ordinalMainIndexPreorder ordinal + ZFSet.range (mainTransitionIndexKey (@SetMembers.raw T)) = chronologyPairs T := by + let := ordinalMainIndexPreorder ordinal + exact (mainTransitionIndex_range (@SetMembers.raw T) + (fun i j => ordinalMainIndex_le_iff ordinal i j)).trans + (congrArg chronologyPairs (ordinalMainIndex_key_range T)) + +theorem ordinalMainIndex_rank_le_iff {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) + (i j : SetMembers T) : + ZFSet.rank (SetMembers.raw i) ≤ ZFSet.rank (SetMembers.raw j) ↔ + SetMembers.raw i = SetMembers.raw j ∨ SetMembers.raw i ∈ SetMembers.raw j := by + have hi := ordinalSetProperty_eq_code_rank (SetMembers.raw i) + (ordinalSetProperty_member ordinal (SetMembers.raw_mem i)) + have hj := ordinalSetProperty_eq_code_rank (SetMembers.raw j) + (ordinalSetProperty_member ordinal (SetMembers.raw_mem j)) + constructor + · intro before + rcases lt_or_eq_of_le before with earlier | equal + · exact Or.inr (by rw [hi, hj]; exact (mem_ordinalCode_iff _ _).2 earlier) + · exact Or.inl (hi.trans ((congrArg ordinalCode equal).trans hj.symm)) + · rintro (equal | earlier) + · exact le_of_eq (congrArg ZFSet.rank equal) + · exact le_of_lt (ZFSet.rank_lt_of_mem earlier) + +theorem ordinalMainIndex_total {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) + (i j : SetMembers T) : + letI := ordinalMainIndexPreorder ordinal + i ≤ j ∨ j ≤ i := by + let := ordinalMainIndexPreorder ordinal + rcases le_total (ZFSet.rank (SetMembers.raw i)) (ZFSet.rank (SetMembers.raw j)) with first | second + · exact Or.inl ((ordinalMainIndex_rank_le_iff ordinal i j).1 first) + · exact Or.inr ((ordinalMainIndex_rank_le_iff ordinal j i).1 second) + +theorem ordinalMainIndex_antisymm {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) + (i j : SetMembers T) : + letI := ordinalMainIndexPreorder ordinal + i ≤ j → j ≤ i → i = j := by + let := ordinalMainIndexPreorder ordinal + intro first second + apply SetMembers.raw_injective T + rcases first with equal | earlier + · exact equal + · rcases second with equal | later + · exact equal.symm + · exact False.elim ((lt_irrefl (ZFSet.rank (SetMembers.raw i))) + ((ZFSet.rank_lt_of_mem earlier).trans (ZFSet.rank_lt_of_mem later))) + +theorem ordinalMainIndex_common_upper {T : ZFSet.{u}} (ordinal : ordinalSetProperty T) + (i j : SetMembers T) : + letI := ordinalMainIndexPreorder ordinal + ∃ k : SetMembers T, i ≤ k ∧ j ≤ k := by + let := ordinalMainIndexPreorder ordinal + rcases ordinalMainIndex_total ordinal i j with before | after + · exact ⟨j, before, le_refl j⟩ + · exact ⟨i, le_refl i, after⟩ + +def NonzeroLimitOrdinalCode (T : ZFSet.{u}) : Prop := + T ≠ ∅ ∧ ∀ b ∈ T, ∃ c ∈ T, b ∈ c + +theorem not_nonzeroLimitOrdinalCode_successor (b : ZFSet.{u}) : + ¬ NonzeroLimitOrdinalCode (insert b b) := by + intro limit + obtain ⟨c, member, later⟩ := limit.2 b (ZFSet.mem_insert b b) + rcases ZFSet.mem_insert_iff.1 member with equal | earlier + · subst c + exact (lt_irrefl (ZFSet.rank b)) (ZFSet.rank_lt_of_mem later) + · exact (lt_irrefl (ZFSet.rank b)) + ((ZFSet.rank_lt_of_mem later).trans (ZFSet.rank_lt_of_mem earlier)) + +theorem ordinal_successor_or_nonzeroLimit {T : ZFSet.{u}} + (ordinal : ordinalSetProperty T) (nonempty : T ≠ ∅) : + (∃ b ∈ T, T = insert b b) ∨ NonzeroLimitOrdinalCode T := by + classical + by_cases further : ∀ b ∈ T, ∃ c ∈ T, b ∈ c + · exact Or.inr ⟨nonempty, further⟩ + · push Not at further + obtain ⟨b, member, maximal⟩ := further + refine Or.inl ⟨b, member, ?_⟩ + apply ZFSet.ext + intro x + rw [ZFSet.mem_insert_iff] + constructor + · intro hx + have comparison := ordinalMainIndex_total ordinal + (SetMembers.ofMem x hx) (SetMembers.ofMem b member) + simp only [ordinalMainIndex_le_iff, SetMembers.raw_ofMem] at comparison + rcases comparison with before | after + · exact before + · rcases after with equal | later + · exact Or.inl equal.symm + · exact False.elim (maximal x hx later) + · rintro (equal | earlier) + · exact equal.symm ▸ member + · exact ordinal.1 b member x earlier + +theorem nonzeroLimitOrdinalCode_iff_not_successor {T : ZFSet.{u}} + (ordinal : ordinalSetProperty T) (nonempty : T ≠ ∅) : + NonzeroLimitOrdinalCode T ↔ ¬ ∃ b, T = insert b b := by + constructor + · rintro limit ⟨b, rfl⟩ + exact not_nonzeroLimitOrdinalCode_successor b limit + · intro noSuccessor + rcases ordinal_successor_or_nonzeroLimit ordinal nonempty with successor | limit + · obtain ⟨b, _, equal⟩ := successor + exact False.elim (noSuccessor ⟨b, equal⟩) + · exact limit + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalExternalHeights.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalExternalHeights.lean index 7b1766a4f2981ed1167486f17b4037a2906c5b56..8cce4c07dccbcd7f4025e282b4d288a12000a196 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalExternalHeights.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalExternalHeights.lean @@ -1,106 +1,106 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalHeights - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open RationalHeights -open scoped Cardinal Ordinal -universe u - -namespace CountableColumns - -def Column := {o : Ordinal.{0} // o.card ≤ Cardinal.aleph0} - -theorem membership_iff (o : Ordinal.{0}) : - o.card ≤ Cardinal.aleph0 ↔ o < (Cardinal.aleph 1).ord := by - rw [Cardinal.lt_ord, ← Cardinal.succ_aleph0, Order.lt_succ_iff] - -noncomputable def order : LinearHeightOrder Column where - lt x y := x.val < y.val - irrefl x := lt_irrefl x.val - trans := lt_trans - compare x y := by - rcases lt_trichotomy x.val y.val with lower | eq | lower - · exact Or.inl lower - · exact Or.inr (Or.inl (Subtype.ext eq)) - · exact Or.inr (Or.inr lower) - -def add (a b : Column) : Column := - ⟨a.val + b.val, by rw [Ordinal.card_add]; exact Cardinal.add_le_aleph0.mpr ⟨a.property, b.property⟩⟩ - -def natural (n : Nat) : Column := - ⟨n, by rw [Ordinal.card_nat]; exact Cardinal.natCast_le_aleph0⟩ - -def omega : Column := ⟨Ordinal.omega0, by rw [Ordinal.card_omega0]⟩ - -def start (old : Column) : Column := add old (natural 1) -def layer (old : Column) (n : Nat) : Column := add (start old) (natural n) -def cap (old : Column) : Column := add (start old) omega - -theorem layer_increasing (old : Column) (n : Nat) : - order.lt (layer old n) (layer old (n + 1)) := by - change (start old).val + (n : Ordinal) < (start old).val + ((n + 1 : Nat) : Ordinal) - exact (add_lt_add_iff_left (start old).val).2 (Nat.cast_lt.mpr (Nat.lt_succ_self n)) - -theorem starts_above (old : Column) : order.lt old (layer old 0) := by - change old.val < (old.val + (1 : Nat)) + (0 : Nat) - simpa only [Nat.cast_zero, Nat.cast_one, add_zero, Order.succ_eq_add_one] using - (Order.lt_succ old.val) - -theorem below_cap (old : Column) (n : Nat) : order.lt (layer old n) (cap old) := - add_lt_add_right (Ordinal.natCast_lt_omega0 n) (start old).val - -noncomputable def room (old : Column) : ColumnRoom order old where - column := layer old - increasing := layer_increasing old - starts_above := starts_above old - cap := cap old - below_cap := below_cap old - -end CountableColumns - -namespace TileRequests.Family - -open CosetGeometry CountableColumns -variable {A J R : Type u} [Group J] {P : MeetOrder A} - (f : Family P R) (a : OrderAction J P) - (seed : StrictHeight P (lexOrder CountableColumns.order).toHeightOrder) - (countable : CountableRange seed.value) - -noncomputable def ordinalExtensionHeight : - StrictHeight (f.extensionOrder a) (lexOrder CountableColumns.order).toHeightOrder := - f.extensionHeight a CountableColumns.order seed countable (room (seed.value f.top).1) - -theorem ordinalExtensionHeight_original (x : A) : - (f.ordinalExtensionHeight a seed countable).value ((f.extensionCopy a 1).toFun x) = - seed.value x := - f.extensionHeight_original a CountableColumns.order seed countable (room (seed.value f.top).1) x - -theorem ordinalExtensionHeight_countable : - CountableRange (f.ordinalExtensionHeight a seed countable).value := - f.extensionHeight_countable a CountableColumns.order seed countable (room (seed.value f.top).1) - -theorem ordinalExtensionHeight_top : - (f.ordinalExtensionHeight a seed countable).value none = (cap (seed.value f.top).1, zero) := rfl - -include countable in - -theorem ordinal_external_height_extension : - ∃ height : StrictHeight (f.extensionOrder a) (lexOrder CountableColumns.order).toHeightOrder, - (∀ x, height.value ((f.extensionCopy a 1).toFun x) = seed.value x) ∧ - CountableRange height.value ∧ - height.value none = (cap (seed.value f.top).1, zero) ∧ - (∀ x, (lexOrder CountableColumns.order).Weak - (height.value x) (cap (seed.value f.top).1, zero)) := - f.external_height_extension a CountableColumns.order seed countable (room (seed.value f.top).1) - -end TileRequests.Family - -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.ExternalHeights + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open RationalHeights +open scoped Cardinal Ordinal +universe u + +namespace CountableColumns + +def Column := {o : Ordinal.{0} // o.card ≤ Cardinal.aleph0} + +theorem membership_iff (o : Ordinal.{0}) : + o.card ≤ Cardinal.aleph0 ↔ o < (Cardinal.aleph 1).ord := by + rw [Cardinal.lt_ord, ← Cardinal.succ_aleph0, Order.lt_succ_iff] + +noncomputable def order : LinearHeightOrder Column where + lt x y := x.val < y.val + irrefl x := lt_irrefl x.val + trans := lt_trans + compare x y := by + rcases lt_trichotomy x.val y.val with lower | eq | lower + · exact Or.inl lower + · exact Or.inr (Or.inl (Subtype.ext eq)) + · exact Or.inr (Or.inr lower) + +def add (a b : Column) : Column := + ⟨a.val + b.val, by rw [Ordinal.card_add]; exact Cardinal.add_le_aleph0.mpr ⟨a.property, b.property⟩⟩ + +def natural (n : Nat) : Column := + ⟨n, by rw [Ordinal.card_nat]; exact Cardinal.natCast_le_aleph0⟩ + +def omega : Column := ⟨Ordinal.omega0, by rw [Ordinal.card_omega0]⟩ + +def start (old : Column) : Column := add old (natural 1) +def layer (old : Column) (n : Nat) : Column := add (start old) (natural n) +def cap (old : Column) : Column := add (start old) omega + +theorem layer_increasing (old : Column) (n : Nat) : + order.lt (layer old n) (layer old (n + 1)) := by + change (start old).val + (n : Ordinal) < (start old).val + ((n + 1 : Nat) : Ordinal) + exact (add_lt_add_iff_left (start old).val).2 (Nat.cast_lt.mpr (Nat.lt_succ_self n)) + +theorem starts_above (old : Column) : order.lt old (layer old 0) := by + change old.val < (old.val + (1 : Nat)) + (0 : Nat) + simpa only [Nat.cast_zero, Nat.cast_one, add_zero, Order.succ_eq_add_one] using + (Order.lt_succ old.val) + +theorem below_cap (old : Column) (n : Nat) : order.lt (layer old n) (cap old) := + add_lt_add_right (Ordinal.natCast_lt_omega0 n) (start old).val + +noncomputable def room (old : Column) : ColumnRoom order old where + column := layer old + increasing := layer_increasing old + starts_above := starts_above old + cap := cap old + below_cap := below_cap old + +end CountableColumns + +namespace TileRequests.Family + +open CosetGeometry CountableColumns +variable {A J R : Type u} [Group J] {P : MeetOrder A} + (f : Family P R) (a : OrderAction J P) + (seed : StrictHeight P (lexOrder CountableColumns.order).toHeightOrder) + (countable : CountableRange seed.value) + +noncomputable def ordinalExtensionHeight : + StrictHeight (f.extensionOrder a) (lexOrder CountableColumns.order).toHeightOrder := + f.extensionHeight a CountableColumns.order seed countable (room (seed.value f.top).1) + +theorem ordinalExtensionHeight_original (x : A) : + (f.ordinalExtensionHeight a seed countable).value ((f.extensionCopy a 1).toFun x) = + seed.value x := + f.extensionHeight_original a CountableColumns.order seed countable (room (seed.value f.top).1) x + +theorem ordinalExtensionHeight_countable : + CountableRange (f.ordinalExtensionHeight a seed countable).value := + f.extensionHeight_countable a CountableColumns.order seed countable (room (seed.value f.top).1) + +theorem ordinalExtensionHeight_top : + (f.ordinalExtensionHeight a seed countable).value none = (cap (seed.value f.top).1, zero) := rfl + +include countable in + +theorem ordinal_external_height_extension : + ∃ height : StrictHeight (f.extensionOrder a) (lexOrder CountableColumns.order).toHeightOrder, + (∀ x, height.value ((f.extensionCopy a 1).toFun x) = seed.value x) ∧ + CountableRange height.value ∧ + height.value none = (cap (seed.value f.top).1, zero) ∧ + (∀ x, (lexOrder CountableColumns.order).Weak + (height.value x) (cap (seed.value f.top).1, zero)) := + f.external_height_extension a CountableColumns.order seed countable (room (seed.value f.top).1) + +end TileRequests.Family + +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalRecursionTraces.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalRecursionTraces.lean index 99c67d0850e660da56d5d5ededb4100858e4b2cd..d74cce6adf3e83ead9f171c1827d93086dfc0c73 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalRecursionTraces.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalRecursionTraces.lean @@ -1,380 +1,380 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.NaturalSetCodes -import OAI.SetTheory.PartitionPrinciple.Forcing.FlatLimitConditionCodes - -namespace OAI - -section - -namespace PartitionPilot.SetRealization - -universe u - -theorem ordinalCode_zero : ordinalCode (0 : Ordinal.{u}) = ∅ := by - apply ZFSet.ext - intro x - rw [mem_ordinalCode] - exact ⟨fun ⟨_, lower, _⟩ => False.elim (not_lt_of_ge bot_le lower), - fun h => False.elim (ZFSet.notMem_empty x h)⟩ - -theorem ordinalCode_succ (o : Ordinal.{u}) : - ordinalCode (Order.succ o) = insert (ordinalCode o) (ordinalCode o) := by - apply ZFSet.ext - intro x - rw [mem_ordinalCode, ZFSet.mem_insert_iff] - constructor - · rintro ⟨a, ha, rfl⟩ - rcases lt_or_eq_of_le (Order.lt_succ_iff.1 ha) with lower | eq - · exact Or.inr ((mem_ordinalCode_iff a o).2 lower) - · exact Or.inl (congrArg ordinalCode eq) - · rintro (rfl | member) - · exact ⟨o, Order.lt_succ o, rfl⟩ - · obtain ⟨a, ha, eq⟩ := mem_ordinalCode.1 member - exact ⟨a, ha.trans (Order.lt_succ o), eq⟩ - -theorem ordinalCode_subset_iff (a b : Ordinal.{u}) : ordinalCode a ⊆ ordinalCode b ↔ a ≤ b := by - constructor - · intro subset - have ranks := ZFSet.rank_mono subset - simpa only [rank_ordinalCode] using ranks - · intro lower x hx - obtain ⟨o, ho, rfl⟩ := mem_ordinalCode.1 hx - exact (mem_ordinalCode_iff o b).2 (ho.trans_le lower) - -theorem ordinalCode_nat (n : Nat) : ordinalCode (n : Ordinal.{u}) = Forcing.natSetCode n := by - induction n with - | zero => exact ordinalCode_zero - | succ n ih => - rw [Nat.cast_add_one, ← Order.succ_eq_add_one, ordinalCode_succ, ih] - rfl - -theorem ordinalCode_omega : ordinalCode Ordinal.omega0 = ZFSet.omega.{u} := by - apply ZFSet.ext - intro x - rw [mem_ordinalCode, Forcing.mem_omega_iff_natSetCode] - constructor - · rintro ⟨o, ho, eq⟩ - obtain ⟨n, rfl⟩ := Ordinal.lt_omega0.1 ho - exact ⟨n, eq.symm.trans (ordinalCode_nat n)⟩ - · rintro ⟨n, rfl⟩ - exact ⟨n, Ordinal.natCast_lt_omega0 n, ordinalCode_nat n⟩ - -end PartitionPilot.SetRealization - -namespace PartitionPilot.Forcing - -open SetRealization -open scoped ZFSet -universe u - -theorem ordinalSetProperty_member {x y : ZFSet.{u}} - (hx : ordinalSetProperty x) (hy : y ∈ x) : ordinalSetProperty y := - ⟨hx.2 y hy, fun z hz => hx.2 z (hx.1 y hy z hz)⟩ - -theorem setTransitive_ordinalCode (o : Ordinal.{u}) : setTransitive (ordinalCode o) := by - intro y hy z hz - obtain ⟨b, hb, rfl⟩ := mem_ordinalCode.1 hy - obtain ⟨a, ha, rfl⟩ := mem_ordinalCode.1 hz - exact (mem_ordinalCode_iff a o).2 (ha.trans hb) - -theorem ordinalSetProperty_ordinalCode (o : Ordinal.{u}) : ordinalSetProperty (ordinalCode o) := by - refine ⟨setTransitive_ordinalCode o, ?_⟩ - intro y hy - obtain ⟨a, _, rfl⟩ := mem_ordinalCode.1 hy - exact setTransitive_ordinalCode a - -theorem ordinalSetProperty_eq_code_rank (x : ZFSet.{u}) : - ordinalSetProperty x → x = ordinalCode (ZFSet.rank x) := by - induction x using ZFSet.inductionOn with - | h x ih => - intro hx - apply ZFSet.ext - intro y - constructor - · intro hy - have child := ih y hy (ordinalSetProperty_member hx hy) - rw [child] - exact (mem_ordinalCode_iff (ZFSet.rank y) (ZFSet.rank x)).2 (ZFSet.rank_lt_of_mem hy) - · intro hy - obtain ⟨o, ho, eq⟩ := mem_ordinalCode.1 hy - obtain ⟨z, hz, lower⟩ := ZFSet.lt_rank_iff.1 ho - have child := ih z hz (ordinalSetProperty_member hx hz) - rcases lt_or_eq_of_le lower with less | equal - · have member : y ∈ z := by - rw [child, ← eq] - exact (mem_ordinalCode_iff o (ZFSet.rank z)).2 less - exact hx.1 z hz y member - · have same : z = y := child.trans ((congrArg ordinalCode equal).symm.trans eq) - exact same ▸ hz - -theorem ordinalSetProperty_iff (x : ZFSet.{u}) : - ordinalSetProperty x ↔ ∃ o : Ordinal.{u}, x = ordinalCode o := by - constructor - · intro hx - exact ⟨ZFSet.rank x, ordinalSetProperty_eq_code_rank x hx⟩ - · rintro ⟨o, rfl⟩ - exact ordinalSetProperty_ordinalCode o - -theorem ordinalSetProperty_empty : ordinalSetProperty (∅ : ZFSet.{u}) := by - rw [← ordinalCode_zero] - exact ordinalSetProperty_ordinalCode 0 - -theorem ordinalSetProperty_succ {x : ZFSet.{u}} (hx : ordinalSetProperty x) : - ordinalSetProperty (insert x x) := by - obtain ⟨o, rfl⟩ := (ordinalSetProperty_iff x).1 hx - rw [← ordinalCode_succ] - exact ordinalSetProperty_ordinalCode (Order.succ o) - -theorem ordinalSetProperty_sUnion {x : ZFSet.{u}} - (members : ∀ y ∈ x, ordinalSetProperty y) : ordinalSetProperty (⋃₀ x) := by - constructor - · intro y hy z hz - obtain ⟨a, ha, ya⟩ := ZFSet.mem_sUnion.1 hy - exact ZFSet.mem_sUnion.2 ⟨a, ha, (members a ha).1 y ya z hz⟩ - · intro y hy - obtain ⟨a, ha, ya⟩ := ZFSet.mem_sUnion.1 hy - exact (members a ha).2 y ya - -end PartitionPilot.Forcing - -end - - -namespace PartitionPilot.Forcing -universe u - -structure FlatOrdinalCarrierRecursion (stages history levels : ZFSet.{u}) - (candidate tests : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop) : Prop where - function : FunctionGraphOn stages history - zero : ∅ ∈ stages → ∀ Q, ZFSet.pair ∅ Q ∈ history → ∀ row A, - ZFSet.pair row A ∈ Q ↔ candidate ∅ row A - successor : ∀ beta, insert beta beta ∈ stages → ∀ Q Qnext, - ZFSet.pair beta Q ∈ history → ZFSet.pair (insert beta beta) Qnext ∈ history → ∀ row A, - ZFSet.pair row A ∈ Qnext ↔ candidate (insert beta beta) row A ∧ - ZFSet.pair row (assignmentCut levels beta A) ∈ Q ∧ tests beta row A - limit : ∀ beta ∈ stages, beta ≠ ∅ → (∀ gamma, beta ≠ insert gamma gamma) → - ∀ Q, ZFSet.pair beta Q ∈ history → ∀ row A, - ZFSet.pair row A ∈ Q ↔ candidate beta row A ∧ FlatHistoryCuts beta history levels row A - -namespace FlatOrdinalCarrierRecursion -variable {stages history levels : ZFSet.{u}} -variable {candidate tests : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} -variable (recursion : FlatOrdinalCarrierRecursion stages history levels candidate tests) -variable (ordinal : ordinalSetProperty stages) -variable (locality : ∀ beta ∈ stages, ∀ row A, - tests beta row (assignmentCut levels (insert beta beta) A) ↔ tests beta row A) - -include recursion locality - -include ordinal in -theorem cuts_of_tests (row A : ZFSet.{u}) - (candidates : ∀ beta ∈ stages, candidate beta row (assignmentCut levels beta A)) - (allTests : ∀ beta ∈ stages, tests beta row A) : - FlatHistoryCuts stages history levels row A := by - apply (flatHistoryCuts_lookup_iff recursion.function).2 - intro beta - induction beta using ZFSet.inductionOn with - | h beta ih => - intro hbeta Q entry - by_cases zero : beta = ∅ - · subst beta - exact (recursion.zero hbeta Q entry row _).2 (candidates ∅ hbeta) - · by_cases successor : ∃ gamma, beta = insert gamma gamma - · obtain ⟨gamma, rfl⟩ := successor - have hgamma : gamma ∈ stages := ordinal.1 _ hbeta _ (ZFSet.mem_insert _ _) - obtain ⟨Qprev, prev⟩ := recursion.function.total hgamma - apply (recursion.successor gamma hbeta Qprev Q prev entry row _).2 - refine ⟨candidates _ hbeta, ?_, (locality gamma hgamma row A).2 (allTests gamma hgamma)⟩ - rw [assignmentCut_nested (fun _ h => ZFSet.mem_insert_of_mem gamma h)] - exact ih gamma (ZFSet.mem_insert _ _) hgamma Qprev prev - · apply (recursion.limit beta hbeta zero (fun gamma equal => successor ⟨gamma, equal⟩) - Q entry row _).2 - refine ⟨candidates beta hbeta, ?_⟩ - intro gamma hgamma - have member : gamma ∈ stages := ordinal.1 beta hbeta gamma hgamma - obtain ⟨Qprev, prev⟩ := recursion.function.total member - refine ⟨Qprev, prev, ?_⟩ - rw [assignmentCut_nested (ordinal.2 beta hbeta gamma hgamma)] - exact ih gamma hgamma member Qprev prev - -theorem tests_of_cuts - (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) - (row A : ZFSet.{u}) (cuts : FlatHistoryCuts stages history levels row A) : - ∀ beta ∈ stages, tests beta row A := by - intro beta hbeta - obtain ⟨Q, entry⟩ := recursion.function.total hbeta - obtain ⟨Qnext, next, member⟩ := cuts (insert beta beta) (successors beta hbeta) - exact (locality beta hbeta row A).1 - ((recursion.successor beta (successors beta hbeta) Q Qnext entry next row _).1 member).2.2 - -include ordinal in -theorem cuts_iff_tests - (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) - (row A : ZFSet.{u}) - (candidates : ∀ beta ∈ stages, candidate beta row (assignmentCut levels beta A)) : - FlatHistoryCuts stages history levels row A ↔ ∀ beta ∈ stages, tests beta row A := - ⟨recursion.tests_of_cuts locality successors row A, - recursion.cuts_of_tests ordinal locality row A candidates⟩ - -end FlatOrdinalCarrierRecursion - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing - -open scoped ZFSet -universe u - -def OrdinalRecursionTrace (R : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop) - (A f : ZFSet.{u}) : Prop := - FunctionGraphOn A f ∧ ∀ β ∈ A, ∀ y, ZFSet.pair β y ∈ f → R β (graphRestriction β f) y - -namespace OrdinalRecursionTrace - -variable {R : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} - -theorem restriction_eq_of_common_values {A B C f g : ZFSet.{u}} - (first : FunctionGraphOn A f) (second : FunctionGraphOn B g) - (left : C ⊆ A) (right : C ⊆ B) - (agree : ∀ x ∈ C, ∀ y z, ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : - graphRestriction C f = graphRestriction C g := by - apply ZFSet.ext - intro w - constructor - · intro hw - obtain ⟨V, function⟩ := first.restrict left - obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (function.1 hw) - obtain ⟨xy, hx⟩ := pair_mem_graphRestriction.1 hw - obtain ⟨z, xz⟩ := second.total (right hx) - exact pair_mem_graphRestriction.2 ⟨agree x hx y z xy xz ▸ xz, hx⟩ - · intro hw - obtain ⟨V, function⟩ := second.restrict right - obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (function.1 hw) - obtain ⟨xz, hx⟩ := pair_mem_graphRestriction.1 hw - obtain ⟨y, xy⟩ := first.total (left hx) - exact pair_mem_graphRestriction.2 ⟨agree x hx y z xy xz ▸ xy, hx⟩ - -theorem restrict {A B f : ZFSet.{u}} (trace : OrdinalRecursionTrace R A f) - (ordinalB : ordinalSetProperty B) (subset : B ⊆ A) : - OrdinalRecursionTrace R B (graphRestriction B f) := by - refine ⟨trace.1.restrict subset, ?_⟩ - intro β hβ y hy - have earlier : β ⊆ B := fun x hx => ordinalB.1 β hβ x hx - rw [graphRestriction_restrict earlier] - exact trace.2 β (subset hβ) y (pair_mem_graphRestriction.1 hy).1 - -theorem overlap {A B T f g : ZFSet.{u}} - (first : OrdinalRecursionTrace R A f) (second : OrdinalRecursionTrace R B g) - (ordinalA : ordinalSetProperty A) (ordinalB : ordinalSetProperty B) - (left : A ⊆ T) (_right : B ⊆ T) - (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → - ∀ y z, R β p y → R β p z → y = z) : - ∀ β ∈ A, β ∈ B → ∀ y z, ZFSet.pair β y ∈ f → ZFSet.pair β z ∈ g → y = z := by - intro β - induction β using ZFSet.inductionOn with - | h β ih => - intro hβA hβB y z hy hz - have beforeA : β ⊆ A := fun x hx => ordinalA.1 β hβA x hx - have beforeB : β ⊆ B := fun x hx => ordinalB.1 β hβB x hx - have prefixes : graphRestriction β f = graphRestriction β g := - restriction_eq_of_common_values first.1 second.1 beforeA beforeB - (fun x hx a b xa xb => ih x hx (beforeA hx) (beforeB hx) a b xa xb) - have prefixTrace := first.restrict (ordinalSetProperty_member ordinalA hβA) beforeA - have firstStep := first.2 β hβA y hy - have secondStep := second.2 β hβB z hz - rw [← prefixes] at secondStep - exact stepUnique β (left hβA) (graphRestriction β f) prefixTrace y z firstStep secondStep - -theorem unique {A T f g : ZFSet.{u}} - (first : OrdinalRecursionTrace R A f) (second : OrdinalRecursionTrace R A g) - (ordinalA : ordinalSetProperty A) (subset : A ⊆ T) - (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → - ∀ y z, R β p y → R β p z → y = z) : f = g := by - have eq := restriction_eq_of_common_values first.1 second.1 (fun _ hx => hx) (fun _ hx => hx) - (fun x hx y z xy xz => first.overlap second ordinalA ordinalA subset subset stepUnique x hx hx y z xy xz) - simpa only [first.1.restriction_eq, second.1.restriction_eq] using eq - -theorem restriction_insert_last {A B f : ZFSet.{u}} (function : FunctionGraphOn A f) - (subset : B ⊆ A) (y : ZFSet.{u}) : - graphRestriction B (insert (ZFSet.pair A y) f) = graphRestriction B f := by - apply restriction_eq_of_common_values (function.insert (ZFSet.mem_irrefl A) y) function - (fun _ hx => ZFSet.mem_insert_of_mem A (subset hx)) subset - intro x hx z w xz xw - rcases ZFSet.mem_insert_iff.1 xz with eq | xz - · have same : x = A := (ZFSet.pair_inj.1 eq).1 - exact False.elim (ZFSet.mem_irrefl A (same ▸ subset hx)) - · exact function.unique xz xw - -theorem succ {A f y : ZFSet.{u}} (trace : OrdinalRecursionTrace R A f) - (ordinalA : ordinalSetProperty A) (step : R A f y) : - OrdinalRecursionTrace R (insert A A) (insert (ZFSet.pair A y) f) := by - refine ⟨trace.1.insert (ZFSet.mem_irrefl A) y, ?_⟩ - intro β hβ z hz - rcases ZFSet.mem_insert_iff.1 hβ with eq | hβ - · subst β - have value : z = y := (trace.1.insert (ZFSet.mem_irrefl A) y).unique hz - (ZFSet.mem_insert _ _) - rw [restriction_insert_last trace.1 (fun _ hx => hx) y, trace.1.restriction_eq, value] - exact step - · rw [restriction_insert_last trace.1 (fun x hx => ordinalA.1 β hβ x hx) y] - rcases ZFSet.mem_insert_iff.1 hz with eq | hz - · have same : β = A := (ZFSet.pair_inj.1 eq).1 - exact False.elim (ZFSet.mem_irrefl A (same ▸ hβ)) - · exact trace.2 β hβ z hz - -theorem sUnion {A T W : ZFSet.{u}} (subset : A ⊆ T) - (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → - ∀ y z, R β p y → R β p z → y = z) - (members : ∀ f ∈ W, ∃ B, ordinalSetProperty B ∧ B ⊆ A ∧ OrdinalRecursionTrace R B f) - (cover : ∀ β ∈ A, ∃ f ∈ W, ∃ y, ZFSet.pair β y ∈ f) : - OrdinalRecursionTrace R A (⋃₀ W) := by - have agree : ∀ f ∈ W, ∀ g ∈ W, ∀ x y z, - ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z := by - intro f hf g hg x y z xy xz - obtain ⟨B, ordinalB, boundB, first⟩ := members f hf - obtain ⟨C, ordinalC, boundC, second⟩ := members g hg - exact first.overlap second ordinalB ordinalC (fun _ hx => subset (boundB hx)) - (fun _ hx => subset (boundC hx)) stepUnique x - (first.1.pair_source xy) (second.1.pair_source xz) y z xy xz - have function : FunctionGraphOn A (⋃₀ W) := functionGraphOn_sUnion - (fun f hf => by - obtain ⟨B, _, bound, trace⟩ := members f hf - exact ⟨B, bound, trace.1⟩) cover agree - refine ⟨function, ?_⟩ - intro β _ y hy - obtain ⟨f, hf, βy⟩ := ZFSet.mem_sUnion.1 hy - obtain ⟨B, ordinalB, boundB, trace⟩ := members f hf - have βB := trace.1.pair_source βy - have beforeB : β ⊆ B := fun x hx => ordinalB.1 β βB x hx - have prefixes : graphRestriction β (⋃₀ W) = graphRestriction β f := by - apply restriction_eq_of_common_values function trace.1 (fun _ hx => boundB (beforeB hx)) beforeB - intro x _ z w xz xw - obtain ⟨g, hg, xz⟩ := ZFSet.mem_sUnion.1 xz - exact agree g hg f hf x z w xz xw - rw [prefixes] - exact trace.2 β βB y βy - -theorem sUnion_successors {A T W : ZFSet.{u}} (ordinalA : ordinalSetProperty A) - (subset : A ⊆ T) - (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → - ∀ y z, R β p y → R β p z → y = z) - (members : ∀ f ∈ W, ∃ β ∈ A, OrdinalRecursionTrace R (insert β β) f) - (cover : ∀ β ∈ A, ∃ f ∈ W, OrdinalRecursionTrace R (insert β β) f) : - OrdinalRecursionTrace R A (⋃₀ W) := by - apply sUnion subset stepUnique - · intro f hf - obtain ⟨β, hβ, trace⟩ := members f hf - refine ⟨insert β β, ordinalSetProperty_succ (ordinalSetProperty_member ordinalA hβ), ?_, trace⟩ - intro x hx - exact (ZFSet.mem_insert_iff.1 hx).elim (fun eq => eq ▸ hβ) (fun hx => ordinalA.1 β hβ x hx) - · intro β hβ - obtain ⟨f, hf, trace⟩ := cover β hβ - obtain ⟨y, βy⟩ := trace.1.total (ZFSet.mem_insert β β) - exact ⟨f, hf, y, βy⟩ - -end OrdinalRecursionTrace - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.NaturalSetCodes +import OAI.SetTheory.PartitionPrinciple.Forcing.FlatLimitConditionCodes + +namespace OAI + +section + +namespace PartitionPilot.SetRealization + +universe u + +theorem ordinalCode_zero : ordinalCode (0 : Ordinal.{u}) = ∅ := by + apply ZFSet.ext + intro x + rw [mem_ordinalCode] + exact ⟨fun ⟨_, lower, _⟩ => False.elim (not_lt_of_ge bot_le lower), + fun h => False.elim (ZFSet.notMem_empty x h)⟩ + +theorem ordinalCode_succ (o : Ordinal.{u}) : + ordinalCode (Order.succ o) = insert (ordinalCode o) (ordinalCode o) := by + apply ZFSet.ext + intro x + rw [mem_ordinalCode, ZFSet.mem_insert_iff] + constructor + · rintro ⟨a, ha, rfl⟩ + rcases lt_or_eq_of_le (Order.lt_succ_iff.1 ha) with lower | eq + · exact Or.inr ((mem_ordinalCode_iff a o).2 lower) + · exact Or.inl (congrArg ordinalCode eq) + · rintro (rfl | member) + · exact ⟨o, Order.lt_succ o, rfl⟩ + · obtain ⟨a, ha, eq⟩ := mem_ordinalCode.1 member + exact ⟨a, ha.trans (Order.lt_succ o), eq⟩ + +theorem ordinalCode_subset_iff (a b : Ordinal.{u}) : ordinalCode a ⊆ ordinalCode b ↔ a ≤ b := by + constructor + · intro subset + have ranks := ZFSet.rank_mono subset + simpa only [rank_ordinalCode] using ranks + · intro lower x hx + obtain ⟨o, ho, rfl⟩ := mem_ordinalCode.1 hx + exact (mem_ordinalCode_iff o b).2 (ho.trans_le lower) + +theorem ordinalCode_nat (n : Nat) : ordinalCode (n : Ordinal.{u}) = Forcing.natSetCode n := by + induction n with + | zero => exact ordinalCode_zero + | succ n ih => + rw [Nat.cast_add_one, ← Order.succ_eq_add_one, ordinalCode_succ, ih] + rfl + +theorem ordinalCode_omega : ordinalCode Ordinal.omega0 = ZFSet.omega.{u} := by + apply ZFSet.ext + intro x + rw [mem_ordinalCode, Forcing.mem_omega_iff_natSetCode] + constructor + · rintro ⟨o, ho, eq⟩ + obtain ⟨n, rfl⟩ := Ordinal.lt_omega0.1 ho + exact ⟨n, eq.symm.trans (ordinalCode_nat n)⟩ + · rintro ⟨n, rfl⟩ + exact ⟨n, Ordinal.natCast_lt_omega0 n, ordinalCode_nat n⟩ + +end PartitionPilot.SetRealization + +namespace PartitionPilot.Forcing + +open SetRealization +open scoped ZFSet +universe u + +theorem ordinalSetProperty_member {x y : ZFSet.{u}} + (hx : ordinalSetProperty x) (hy : y ∈ x) : ordinalSetProperty y := + ⟨hx.2 y hy, fun z hz => hx.2 z (hx.1 y hy z hz)⟩ + +theorem setTransitive_ordinalCode (o : Ordinal.{u}) : setTransitive (ordinalCode o) := by + intro y hy z hz + obtain ⟨b, hb, rfl⟩ := mem_ordinalCode.1 hy + obtain ⟨a, ha, rfl⟩ := mem_ordinalCode.1 hz + exact (mem_ordinalCode_iff a o).2 (ha.trans hb) + +theorem ordinalSetProperty_ordinalCode (o : Ordinal.{u}) : ordinalSetProperty (ordinalCode o) := by + refine ⟨setTransitive_ordinalCode o, ?_⟩ + intro y hy + obtain ⟨a, _, rfl⟩ := mem_ordinalCode.1 hy + exact setTransitive_ordinalCode a + +theorem ordinalSetProperty_eq_code_rank (x : ZFSet.{u}) : + ordinalSetProperty x → x = ordinalCode (ZFSet.rank x) := by + induction x using ZFSet.inductionOn with + | h x ih => + intro hx + apply ZFSet.ext + intro y + constructor + · intro hy + have child := ih y hy (ordinalSetProperty_member hx hy) + rw [child] + exact (mem_ordinalCode_iff (ZFSet.rank y) (ZFSet.rank x)).2 (ZFSet.rank_lt_of_mem hy) + · intro hy + obtain ⟨o, ho, eq⟩ := mem_ordinalCode.1 hy + obtain ⟨z, hz, lower⟩ := ZFSet.lt_rank_iff.1 ho + have child := ih z hz (ordinalSetProperty_member hx hz) + rcases lt_or_eq_of_le lower with less | equal + · have member : y ∈ z := by + rw [child, ← eq] + exact (mem_ordinalCode_iff o (ZFSet.rank z)).2 less + exact hx.1 z hz y member + · have same : z = y := child.trans ((congrArg ordinalCode equal).symm.trans eq) + exact same ▸ hz + +theorem ordinalSetProperty_iff (x : ZFSet.{u}) : + ordinalSetProperty x ↔ ∃ o : Ordinal.{u}, x = ordinalCode o := by + constructor + · intro hx + exact ⟨ZFSet.rank x, ordinalSetProperty_eq_code_rank x hx⟩ + · rintro ⟨o, rfl⟩ + exact ordinalSetProperty_ordinalCode o + +theorem ordinalSetProperty_empty : ordinalSetProperty (∅ : ZFSet.{u}) := by + rw [← ordinalCode_zero] + exact ordinalSetProperty_ordinalCode 0 + +theorem ordinalSetProperty_succ {x : ZFSet.{u}} (hx : ordinalSetProperty x) : + ordinalSetProperty (insert x x) := by + obtain ⟨o, rfl⟩ := (ordinalSetProperty_iff x).1 hx + rw [← ordinalCode_succ] + exact ordinalSetProperty_ordinalCode (Order.succ o) + +theorem ordinalSetProperty_sUnion {x : ZFSet.{u}} + (members : ∀ y ∈ x, ordinalSetProperty y) : ordinalSetProperty (⋃₀ x) := by + constructor + · intro y hy z hz + obtain ⟨a, ha, ya⟩ := ZFSet.mem_sUnion.1 hy + exact ZFSet.mem_sUnion.2 ⟨a, ha, (members a ha).1 y ya z hz⟩ + · intro y hy + obtain ⟨a, ha, ya⟩ := ZFSet.mem_sUnion.1 hy + exact (members a ha).2 y ya + +end PartitionPilot.Forcing + +end + + +namespace PartitionPilot.Forcing +universe u + +structure FlatOrdinalCarrierRecursion (stages history levels : ZFSet.{u}) + (candidate tests : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop) : Prop where + function : FunctionGraphOn stages history + zero : ∅ ∈ stages → ∀ Q, ZFSet.pair ∅ Q ∈ history → ∀ row A, + ZFSet.pair row A ∈ Q ↔ candidate ∅ row A + successor : ∀ beta, insert beta beta ∈ stages → ∀ Q Qnext, + ZFSet.pair beta Q ∈ history → ZFSet.pair (insert beta beta) Qnext ∈ history → ∀ row A, + ZFSet.pair row A ∈ Qnext ↔ candidate (insert beta beta) row A ∧ + ZFSet.pair row (assignmentCut levels beta A) ∈ Q ∧ tests beta row A + limit : ∀ beta ∈ stages, beta ≠ ∅ → (∀ gamma, beta ≠ insert gamma gamma) → + ∀ Q, ZFSet.pair beta Q ∈ history → ∀ row A, + ZFSet.pair row A ∈ Q ↔ candidate beta row A ∧ FlatHistoryCuts beta history levels row A + +namespace FlatOrdinalCarrierRecursion +variable {stages history levels : ZFSet.{u}} +variable {candidate tests : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} +variable (recursion : FlatOrdinalCarrierRecursion stages history levels candidate tests) +variable (ordinal : ordinalSetProperty stages) +variable (locality : ∀ beta ∈ stages, ∀ row A, + tests beta row (assignmentCut levels (insert beta beta) A) ↔ tests beta row A) + +include recursion locality + +include ordinal in +theorem cuts_of_tests (row A : ZFSet.{u}) + (candidates : ∀ beta ∈ stages, candidate beta row (assignmentCut levels beta A)) + (allTests : ∀ beta ∈ stages, tests beta row A) : + FlatHistoryCuts stages history levels row A := by + apply (flatHistoryCuts_lookup_iff recursion.function).2 + intro beta + induction beta using ZFSet.inductionOn with + | h beta ih => + intro hbeta Q entry + by_cases zero : beta = ∅ + · subst beta + exact (recursion.zero hbeta Q entry row _).2 (candidates ∅ hbeta) + · by_cases successor : ∃ gamma, beta = insert gamma gamma + · obtain ⟨gamma, rfl⟩ := successor + have hgamma : gamma ∈ stages := ordinal.1 _ hbeta _ (ZFSet.mem_insert _ _) + obtain ⟨Qprev, prev⟩ := recursion.function.total hgamma + apply (recursion.successor gamma hbeta Qprev Q prev entry row _).2 + refine ⟨candidates _ hbeta, ?_, (locality gamma hgamma row A).2 (allTests gamma hgamma)⟩ + rw [assignmentCut_nested (fun _ h => ZFSet.mem_insert_of_mem gamma h)] + exact ih gamma (ZFSet.mem_insert _ _) hgamma Qprev prev + · apply (recursion.limit beta hbeta zero (fun gamma equal => successor ⟨gamma, equal⟩) + Q entry row _).2 + refine ⟨candidates beta hbeta, ?_⟩ + intro gamma hgamma + have member : gamma ∈ stages := ordinal.1 beta hbeta gamma hgamma + obtain ⟨Qprev, prev⟩ := recursion.function.total member + refine ⟨Qprev, prev, ?_⟩ + rw [assignmentCut_nested (ordinal.2 beta hbeta gamma hgamma)] + exact ih gamma hgamma member Qprev prev + +theorem tests_of_cuts + (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) + (row A : ZFSet.{u}) (cuts : FlatHistoryCuts stages history levels row A) : + ∀ beta ∈ stages, tests beta row A := by + intro beta hbeta + obtain ⟨Q, entry⟩ := recursion.function.total hbeta + obtain ⟨Qnext, next, member⟩ := cuts (insert beta beta) (successors beta hbeta) + exact (locality beta hbeta row A).1 + ((recursion.successor beta (successors beta hbeta) Q Qnext entry next row _).1 member).2.2 + +include ordinal in +theorem cuts_iff_tests + (successors : ∀ beta ∈ stages, insert beta beta ∈ stages) + (row A : ZFSet.{u}) + (candidates : ∀ beta ∈ stages, candidate beta row (assignmentCut levels beta A)) : + FlatHistoryCuts stages history levels row A ↔ ∀ beta ∈ stages, tests beta row A := + ⟨recursion.tests_of_cuts locality successors row A, + recursion.cuts_of_tests ordinal locality row A candidates⟩ + +end FlatOrdinalCarrierRecursion + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing + +open scoped ZFSet +universe u + +def OrdinalRecursionTrace (R : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop) + (A f : ZFSet.{u}) : Prop := + FunctionGraphOn A f ∧ ∀ β ∈ A, ∀ y, ZFSet.pair β y ∈ f → R β (graphRestriction β f) y + +namespace OrdinalRecursionTrace + +variable {R : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} + +theorem restriction_eq_of_common_values {A B C f g : ZFSet.{u}} + (first : FunctionGraphOn A f) (second : FunctionGraphOn B g) + (left : C ⊆ A) (right : C ⊆ B) + (agree : ∀ x ∈ C, ∀ y z, ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : + graphRestriction C f = graphRestriction C g := by + apply ZFSet.ext + intro w + constructor + · intro hw + obtain ⟨V, function⟩ := first.restrict left + obtain ⟨x, _, y, _, rfl⟩ := ZFSet.mem_prod.1 (function.1 hw) + obtain ⟨xy, hx⟩ := pair_mem_graphRestriction.1 hw + obtain ⟨z, xz⟩ := second.total (right hx) + exact pair_mem_graphRestriction.2 ⟨agree x hx y z xy xz ▸ xz, hx⟩ + · intro hw + obtain ⟨V, function⟩ := second.restrict right + obtain ⟨x, _, z, _, rfl⟩ := ZFSet.mem_prod.1 (function.1 hw) + obtain ⟨xz, hx⟩ := pair_mem_graphRestriction.1 hw + obtain ⟨y, xy⟩ := first.total (left hx) + exact pair_mem_graphRestriction.2 ⟨agree x hx y z xy xz ▸ xy, hx⟩ + +theorem restrict {A B f : ZFSet.{u}} (trace : OrdinalRecursionTrace R A f) + (ordinalB : ordinalSetProperty B) (subset : B ⊆ A) : + OrdinalRecursionTrace R B (graphRestriction B f) := by + refine ⟨trace.1.restrict subset, ?_⟩ + intro β hβ y hy + have earlier : β ⊆ B := fun x hx => ordinalB.1 β hβ x hx + rw [graphRestriction_restrict earlier] + exact trace.2 β (subset hβ) y (pair_mem_graphRestriction.1 hy).1 + +theorem overlap {A B T f g : ZFSet.{u}} + (first : OrdinalRecursionTrace R A f) (second : OrdinalRecursionTrace R B g) + (ordinalA : ordinalSetProperty A) (ordinalB : ordinalSetProperty B) + (left : A ⊆ T) (_right : B ⊆ T) + (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → + ∀ y z, R β p y → R β p z → y = z) : + ∀ β ∈ A, β ∈ B → ∀ y z, ZFSet.pair β y ∈ f → ZFSet.pair β z ∈ g → y = z := by + intro β + induction β using ZFSet.inductionOn with + | h β ih => + intro hβA hβB y z hy hz + have beforeA : β ⊆ A := fun x hx => ordinalA.1 β hβA x hx + have beforeB : β ⊆ B := fun x hx => ordinalB.1 β hβB x hx + have prefixes : graphRestriction β f = graphRestriction β g := + restriction_eq_of_common_values first.1 second.1 beforeA beforeB + (fun x hx a b xa xb => ih x hx (beforeA hx) (beforeB hx) a b xa xb) + have prefixTrace := first.restrict (ordinalSetProperty_member ordinalA hβA) beforeA + have firstStep := first.2 β hβA y hy + have secondStep := second.2 β hβB z hz + rw [← prefixes] at secondStep + exact stepUnique β (left hβA) (graphRestriction β f) prefixTrace y z firstStep secondStep + +theorem unique {A T f g : ZFSet.{u}} + (first : OrdinalRecursionTrace R A f) (second : OrdinalRecursionTrace R A g) + (ordinalA : ordinalSetProperty A) (subset : A ⊆ T) + (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → + ∀ y z, R β p y → R β p z → y = z) : f = g := by + have eq := restriction_eq_of_common_values first.1 second.1 (fun _ hx => hx) (fun _ hx => hx) + (fun x hx y z xy xz => first.overlap second ordinalA ordinalA subset subset stepUnique x hx hx y z xy xz) + simpa only [first.1.restriction_eq, second.1.restriction_eq] using eq + +theorem restriction_insert_last {A B f : ZFSet.{u}} (function : FunctionGraphOn A f) + (subset : B ⊆ A) (y : ZFSet.{u}) : + graphRestriction B (insert (ZFSet.pair A y) f) = graphRestriction B f := by + apply restriction_eq_of_common_values (function.insert (ZFSet.mem_irrefl A) y) function + (fun _ hx => ZFSet.mem_insert_of_mem A (subset hx)) subset + intro x hx z w xz xw + rcases ZFSet.mem_insert_iff.1 xz with eq | xz + · have same : x = A := (ZFSet.pair_inj.1 eq).1 + exact False.elim (ZFSet.mem_irrefl A (same ▸ subset hx)) + · exact function.unique xz xw + +theorem succ {A f y : ZFSet.{u}} (trace : OrdinalRecursionTrace R A f) + (ordinalA : ordinalSetProperty A) (step : R A f y) : + OrdinalRecursionTrace R (insert A A) (insert (ZFSet.pair A y) f) := by + refine ⟨trace.1.insert (ZFSet.mem_irrefl A) y, ?_⟩ + intro β hβ z hz + rcases ZFSet.mem_insert_iff.1 hβ with eq | hβ + · subst β + have value : z = y := (trace.1.insert (ZFSet.mem_irrefl A) y).unique hz + (ZFSet.mem_insert _ _) + rw [restriction_insert_last trace.1 (fun _ hx => hx) y, trace.1.restriction_eq, value] + exact step + · rw [restriction_insert_last trace.1 (fun x hx => ordinalA.1 β hβ x hx) y] + rcases ZFSet.mem_insert_iff.1 hz with eq | hz + · have same : β = A := (ZFSet.pair_inj.1 eq).1 + exact False.elim (ZFSet.mem_irrefl A (same ▸ hβ)) + · exact trace.2 β hβ z hz + +theorem sUnion {A T W : ZFSet.{u}} (subset : A ⊆ T) + (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → + ∀ y z, R β p y → R β p z → y = z) + (members : ∀ f ∈ W, ∃ B, ordinalSetProperty B ∧ B ⊆ A ∧ OrdinalRecursionTrace R B f) + (cover : ∀ β ∈ A, ∃ f ∈ W, ∃ y, ZFSet.pair β y ∈ f) : + OrdinalRecursionTrace R A (⋃₀ W) := by + have agree : ∀ f ∈ W, ∀ g ∈ W, ∀ x y z, + ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z := by + intro f hf g hg x y z xy xz + obtain ⟨B, ordinalB, boundB, first⟩ := members f hf + obtain ⟨C, ordinalC, boundC, second⟩ := members g hg + exact first.overlap second ordinalB ordinalC (fun _ hx => subset (boundB hx)) + (fun _ hx => subset (boundC hx)) stepUnique x + (first.1.pair_source xy) (second.1.pair_source xz) y z xy xz + have function : FunctionGraphOn A (⋃₀ W) := functionGraphOn_sUnion + (fun f hf => by + obtain ⟨B, _, bound, trace⟩ := members f hf + exact ⟨B, bound, trace.1⟩) cover agree + refine ⟨function, ?_⟩ + intro β _ y hy + obtain ⟨f, hf, βy⟩ := ZFSet.mem_sUnion.1 hy + obtain ⟨B, ordinalB, boundB, trace⟩ := members f hf + have βB := trace.1.pair_source βy + have beforeB : β ⊆ B := fun x hx => ordinalB.1 β βB x hx + have prefixes : graphRestriction β (⋃₀ W) = graphRestriction β f := by + apply restriction_eq_of_common_values function trace.1 (fun _ hx => boundB (beforeB hx)) beforeB + intro x _ z w xz xw + obtain ⟨g, hg, xz⟩ := ZFSet.mem_sUnion.1 xz + exact agree g hg f hf x z w xz xw + rw [prefixes] + exact trace.2 β βB y βy + +theorem sUnion_successors {A T W : ZFSet.{u}} (ordinalA : ordinalSetProperty A) + (subset : A ⊆ T) + (stepUnique : ∀ β ∈ T, ∀ p, OrdinalRecursionTrace R β p → + ∀ y z, R β p y → R β p z → y = z) + (members : ∀ f ∈ W, ∃ β ∈ A, OrdinalRecursionTrace R (insert β β) f) + (cover : ∀ β ∈ A, ∃ f ∈ W, OrdinalRecursionTrace R (insert β β) f) : + OrdinalRecursionTrace R A (⋃₀ W) := by + apply sUnion subset stepUnique + · intro f hf + obtain ⟨β, hβ, trace⟩ := members f hf + refine ⟨insert β β, ordinalSetProperty_succ (ordinalSetProperty_member ordinalA hβ), ?_, trace⟩ + intro x hx + exact (ZFSet.mem_insert_iff.1 hx).elim (fun eq => eq ▸ hβ) (fun hx => ordinalA.1 β hβ x hx) + · intro β hβ + obtain ⟨f, hf, trace⟩ := cover β hβ + obtain ⟨y, βy⟩ := trace.1.total (ZFSet.mem_insert β β) + exact ⟨f, hf, y, βy⟩ + +end OrdinalRecursionTrace + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalSetCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalSetCodes.lean index 28f9ae72640dd86b72b1fc299f85354cd93e79e2..0c6091f98ef560efdac51a4abcdec4f87513798b 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalSetCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OrdinalSetCodes.lean @@ -1,62 +1,62 @@ -import Mathlib.SetTheory.ZFC.Rank - -namespace OAI - -section - -namespace PartitionPilot.SetRealization - -universe u - -noncomputable def ordinalCode (o : Ordinal.{u}) : ZFSet.{u} := - ZFSet.range (fun i : Set.Iio o => ordinalCode i.val) -termination_by o -decreasing_by exact i.property - -theorem ordinalCode_eq (o : Ordinal.{u}) : - ordinalCode o = ZFSet.range (fun i : Set.Iio o => ordinalCode i.val) := by - exact ordinalCode.eq_def o - -theorem rank_ordinalCode (o : Ordinal.{u}) : ZFSet.rank (ordinalCode o) = o := by - have wf : WellFounded ((· < ·) : Ordinal.{u} → Ordinal.{u} → Prop) := wellFounded_lt - induction o using wf.induction with - | h o ih => - rw [ordinalCode_eq, ZFSet.rank_range] - have ranks : (fun i : Set.Iio o => Order.succ (ZFSet.rank (ordinalCode i.val))) = - (fun i : Set.Iio o => Order.succ i.val) := by - funext i - rw [ih i.val i.property] - simp_rw [ranks, Order.succ_eq_add_one] - apply le_antisymm (Ordinal.iSup_add_one_le fun index => index.property) - by_contra! smaller - exact lt_irrefl _ (Ordinal.lt_iSup_add_one - (fun index : Set.Iio o => index.val) ⟨_, smaller⟩) - -theorem ordinalCode_injective : Function.Injective (ordinalCode.{u}) := by - intro a b eq - have ranks := congrArg ZFSet.rank eq - simpa only [rank_ordinalCode] using ranks - -theorem mem_ordinalCode_iff (a b : Ordinal.{u}) : - ordinalCode a ∈ ordinalCode b ↔ a < b := by - rw [ordinalCode_eq b, ZFSet.mem_range] - constructor - · rintro ⟨i, eq⟩ - exact (ordinalCode_injective eq) ▸ i.property - · intro h - exact ⟨⟨a, h⟩, rfl⟩ - -theorem mem_ordinalCode {x : ZFSet.{u}} {o : Ordinal.{u}} : - x ∈ ordinalCode o ↔ ∃ a < o, ordinalCode a = x := by - rw [ordinalCode_eq o, ZFSet.mem_range] - constructor - · rintro ⟨i, eq⟩ - exact ⟨i.val, i.property, eq⟩ - · rintro ⟨a, h, eq⟩ - exact ⟨⟨a, h⟩, eq⟩ - -end PartitionPilot.SetRealization - -end - -end OAI +import Mathlib.SetTheory.ZFC.Rank + +namespace OAI + +section + +namespace PartitionPilot.SetRealization + +universe u + +noncomputable def ordinalCode (o : Ordinal.{u}) : ZFSet.{u} := + ZFSet.range (fun i : Set.Iio o => ordinalCode i.val) +termination_by o +decreasing_by exact i.property + +theorem ordinalCode_eq (o : Ordinal.{u}) : + ordinalCode o = ZFSet.range (fun i : Set.Iio o => ordinalCode i.val) := by + exact ordinalCode.eq_def o + +theorem rank_ordinalCode (o : Ordinal.{u}) : ZFSet.rank (ordinalCode o) = o := by + have wf : WellFounded ((· < ·) : Ordinal.{u} → Ordinal.{u} → Prop) := wellFounded_lt + induction o using wf.induction with + | h o ih => + rw [ordinalCode_eq, ZFSet.rank_range] + have ranks : (fun i : Set.Iio o => Order.succ (ZFSet.rank (ordinalCode i.val))) = + (fun i : Set.Iio o => Order.succ i.val) := by + funext i + rw [ih i.val i.property] + simp_rw [ranks, Order.succ_eq_add_one] + apply le_antisymm (Ordinal.iSup_add_one_le fun index => index.property) + by_contra! smaller + exact lt_irrefl _ (Ordinal.lt_iSup_add_one + (fun index : Set.Iio o => index.val) ⟨_, smaller⟩) + +theorem ordinalCode_injective : Function.Injective (ordinalCode.{u}) := by + intro a b eq + have ranks := congrArg ZFSet.rank eq + simpa only [rank_ordinalCode] using ranks + +theorem mem_ordinalCode_iff (a b : Ordinal.{u}) : + ordinalCode a ∈ ordinalCode b ↔ a < b := by + rw [ordinalCode_eq b, ZFSet.mem_range] + constructor + · rintro ⟨i, eq⟩ + exact (ordinalCode_injective eq) ▸ i.property + · intro h + exact ⟨⟨a, h⟩, rfl⟩ + +theorem mem_ordinalCode {x : ZFSet.{u}} {o : Ordinal.{u}} : + x ∈ ordinalCode o ↔ ∃ a < o, ordinalCode a = x := by + rw [ordinalCode_eq o, ZFSet.mem_range] + constructor + · rintro ⟨i, eq⟩ + exact ⟨i.val, i.property, eq⟩ + · rintro ⟨a, h, eq⟩ + exact ⟨⟨a, h⟩, eq⟩ + +end PartitionPilot.SetRealization + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OwnerBirthLayers.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OwnerBirthLayers.lean index 8b26224db86b57e9069bba41522c15f9b4f2092b..c302b5ed16ed3efee9a33594c303f7f2faba7e91 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OwnerBirthLayers.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/OwnerBirthLayers.lean @@ -1,275 +1,275 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds -import OAI.SetTheory.PartitionPrinciple.Geometry.GrowthLayerSourceCongruence - -namespace OAI - -namespace PartitionPilot.Forcing -universe u - -noncomputable def ownerFresh (P B : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun x => x ∉ P) B - -theorem mem_ownerFresh (P B x : ZFSet.{u}) : - x ∈ ownerFresh P B ↔ x ∈ B ∧ x ∉ P := ZFSet.mem_sep - -noncomputable def ownerBirthGraph (P B T old levels stamps : ZFSet.{u}) : ZFSet.{u} := - old ∪ relationCompose (ownerFresh P B) ZFSet.omega T levels stamps - -theorem pair_mem_ownerBirthGraph (P B T old levels stamps x t : ZFSet.{u}) : - ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ - ZFSet.pair x t ∈ old ∨ - x ∈ B ∧ x ∉ P ∧ t ∈ T ∧ ∃ n ∈ ZFSet.omega, - ZFSet.pair x n ∈ levels ∧ ZFSet.pair n t ∈ stamps := by - rw [ownerBirthGraph, ZFSet.mem_union, pair_mem_relationCompose, mem_ownerFresh] - tauto - -theorem ownerBirthGraph_old_subset (P B T old levels stamps : ZFSet.{u}) : - old ⊆ ownerBirthGraph P B T old levels stamps := - fun _ h => ZFSet.mem_union.2 (Or.inl h) - -theorem ownerBirthGraph_old_iff {P B T old levels stamps x t : ZFSet.{u}} - (hx : x ∈ P) : - ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ ZFSet.pair x t ∈ old := by - rw [pair_mem_ownerBirthGraph] - exact ⟨fun h => h.elim id (fun h => (h.2.1 hx).elim), Or.inl⟩ - -theorem ownerBirthGraph_fresh_iff {P B T T0 old levels stamps x t : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P T0 old) (hx : x ∉ P) : - ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ - x ∈ B ∧ t ∈ T ∧ ∃ n ∈ ZFSet.omega, - ZFSet.pair x n ∈ levels ∧ ZFSet.pair n t ∈ stamps := by - rw [pair_mem_ownerBirthGraph] - constructor - · rintro (oldEntry | fresh) - · exact (hx (ZFSet.pair_mem_prod.1 (oldFunction.1 oldEntry)).1).elim - · exact ⟨fresh.1, fresh.2.2⟩ - · rintro ⟨hB, ht, n, hn, level, stamp⟩ - exact Or.inr ⟨hB, hx, ht, n, hn, level, stamp⟩ - -theorem ownerBirthGraph_function {P B T T0 old levels stamps : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P T0 old) (oldSubset : P ⊆ B) (times : T0 ⊆ T) - (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) - (stampFunction : ZFSet.IsFunc ZFSet.omega T stamps) : - ZFSet.IsFunc B T (ownerBirthGraph P B T old levels stamps) := by - have freshFunction := relationCompose_function_of_subset levelFunction stampFunction (fun _ h => h) - constructor - · intro z hz - rcases ZFSet.mem_union.1 hz with oldEntry | freshEntry - · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 oldEntry) - exact ZFSet.pair_mem_prod.2 ⟨oldSubset hx, times ht⟩ - · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (freshFunction.1 freshEntry) - exact ZFSet.pair_mem_prod.2 ⟨(mem_ownerFresh P B x).1 hx |>.1, ht⟩ - · intro x hx - by_cases oldPoint : x ∈ P - · obtain ⟨t, entry, unique⟩ := oldFunction.2 x oldPoint - exact ⟨t, (ownerBirthGraph_old_iff oldPoint).2 entry, - fun y hy => unique y ((ownerBirthGraph_old_iff oldPoint).1 hy)⟩ - · have freshPoint := (mem_ownerFresh P B x).2 ⟨hx, oldPoint⟩ - obtain ⟨t, entry, unique⟩ := freshFunction.2 x freshPoint - refine ⟨t, ZFSet.mem_union.2 (Or.inr entry), ?_⟩ - intro y hy - rcases ZFSet.mem_union.1 hy with oldEntry | freshEntry - · exact (oldPoint (ZFSet.pair_mem_prod.1 (oldFunction.1 oldEntry)).1).elim - · exact unique y freshEntry - -theorem ownerBirthGraph_restriction {P B T T0 old levels stamps : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P T0 old) : - graphRestriction P (ownerBirthGraph P B T old levels stamps) = old := by - apply ZFSet.ext - intro z - constructor - · intro h - obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 h - exact (ownerBirthGraph_old_iff hx).1 entry - · intro h - obtain ⟨x, hx, t, _, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 h) - exact pair_mem_graphRestriction.2 ⟨(ownerBirthGraph_old_iff hx).2 h, hx⟩ - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem ownerFresh_mem (separation : SeparationSchema M.sets) - {P B : ZFSet.{u}} (hP : P ∈ M.sets) (hB : B ∈ M.sets) : - ownerFresh P B ∈ M.sets := by - let params := extend P Fin.elim0 - let formula : BoundedFormula 2 := .neg (.mem 0 1) - exact M.bounded_separation_mem separation formula params - (Fin.cases hP (fun j => Fin.elim0 j)) hB - -theorem ownerBirthGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P B T old levels stamps : ZFSet.{u}} - (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hT : T ∈ M.sets) - (hOld : old ∈ M.sets) (hLevels : levels ∈ M.sets) (hStamps : stamps ∈ M.sets) - (hOmega : ZFSet.omega ∈ M.sets) : - ownerBirthGraph P B T old levels stamps ∈ M.sets := by - exact M.binary_union_mem pairing unions hOld - (M.relationCompose_mem pairing unions powers separation - (M.ownerFresh_mem separation hP hB) hOmega hT hLevels hStamps) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -universe u - -structure OwnerStampCode (T stamps : ZFSet.{u}) : Prop where - function : ZFSet.IsFunc ZFSet.omega T stamps - strict : ∀ n m a b, - ZFSet.pair (natSetCode n) a ∈ stamps → ZFSet.pair (natSetCode m) b ∈ stamps → - (a ∈ b ↔ n < m) - -theorem CompressionStampCode.ownerStampCode {base stamps T : ZFSet.{u}} - (code : CompressionStampCode base stamps T) : OwnerStampCode T stamps := by - refine ⟨code.function, ?_⟩ - intro n m a b first second - rw [(code.entries n a).1 first, (code.entries m b).1 second] - exact compressionStamp_mem_iff base n m - -theorem OwnerStampCode.injective {T stamps : ZFSet.{u}} - (code : OwnerStampCode T stamps) {n m : Nat} {t : ZFSet.{u}} - (first : ZFSet.pair (natSetCode n) t ∈ stamps) - (second : ZFSet.pair (natSetCode m) t ∈ stamps) : n = m := by - have notBefore : ¬ n < m := fun h => ZFSet.mem_irrefl t ((code.strict n m t t first second).2 h) - have notAfter : ¬ m < n := fun h => ZFSet.mem_irrefl t ((code.strict m n t t second first).2 h) - omega - -theorem ownerBirthGraph_fresh_nat_iff {P B T T0 old levels stamps x t : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P T0 old) (hx : x ∉ P) : - ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ - x ∈ B ∧ t ∈ T ∧ ∃ n : Nat, - ZFSet.pair x (natSetCode n) ∈ levels ∧ ZFSet.pair (natSetCode n) t ∈ stamps := by - rw [ownerBirthGraph_fresh_iff oldFunction hx] - apply and_congr_right - intro _ - apply and_congr_right - intro _ - constructor - · rintro ⟨i, hi, level, stamp⟩ - obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 hi - exact ⟨n, level, stamp⟩ - · rintro ⟨n, level, stamp⟩ - exact ⟨natSetCode n, (mem_omega_iff_natSetCode _).2 ⟨n, rfl⟩, level, stamp⟩ - -theorem ownerBirthGraph_oldMeet {P B r μ T T0 old levels stamps : ZFSet.{u}} - (meet : MeetOrderCode B r μ) (oldFunction : ZFSet.IsFunc P T0 old) - (oldSubset : P ⊆ B) (times : T0 ⊆ T) - (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) - (stampCode : OwnerStampCode T stamps) - (oldMeet : OldMeetCode r μ old) - (oldIdeal : ∀ x ∈ B, ∀ y ∈ P, ZFSet.pair x y ∈ r → x ∈ P) - (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → - ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) - (levelMono : ∀ x ∈ ownerFresh P B, ∀ y ∈ ownerFresh P B, ∀ n m, - ZFSet.pair x (natSetCode n) ∈ levels → ZFSet.pair y (natSetCode m) ∈ levels → - ZFSet.pair x y ∈ r → n ≤ m) : - OldMeetCode r μ (ownerBirthGraph P B T old levels stamps) := by - have born := ownerBirthGraph_function oldFunction oldSubset times levelFunction stampCode.function - intro x y z a b c ya xb before notLower xy zc - have hy := (ZFSet.pair_mem_prod.1 (born.1 ya)).1 - have hz := (ZFSet.pair_mem_prod.1 (born.1 zc)).1 - by_cases xOld : x ∈ P - · have xbOld := (ownerBirthGraph_old_iff xOld).1 xb - by_cases yOld : y ∈ P - · have zOld := oldIdeal z hz x xOld (meet.lower_left x y z xy) - exact oldMeet x y z a b c ((ownerBirthGraph_old_iff yOld).1 ya) xbOld before notLower xy - ((ownerBirthGraph_old_iff zOld).1 zc) - · obtain ⟨_, _, m, _, stampY⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction yOld).1 ya - exact (ZFSet.mem_asymm before (oldBefore x b m a xbOld stampY)).elim - · obtain ⟨_, _, n, _, stampX⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction xOld).1 xb - by_cases zOld : z ∈ P - · exact oldBefore z c n b ((ownerBirthGraph_old_iff zOld).1 zc) stampX - · have yOld : y ∉ P := fun member => zOld (oldIdeal z hz y member (meet.lower_right x y z xy)) - obtain ⟨_, _, m, levelY, stampY⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction yOld).1 ya - obtain ⟨_, _, k, levelZ, stampZ⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction zOld).1 zc - have lowerLevels := levelMono z ((mem_ownerFresh P B z).2 ⟨hz, zOld⟩) - y ((mem_ownerFresh P B y).2 ⟨hy, yOld⟩) k m levelZ levelY (meet.lower_right x y z xy) - exact (stampCode.strict k n c b stampZ stampX).2 - (Nat.lt_of_le_of_lt lowerLevels ((stampCode.strict m n a b stampY stampX).1 before)) - -theorem ownerBirthGraph_stamp_fiber {P B T T0 old levels stamps : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P T0 old) - (stampCode : OwnerStampCode T stamps) - (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → - ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) - {n : Nat} {t x : ZFSet.{u}} (stamp : ZFSet.pair (natSetCode n) t ∈ stamps) : - ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ - x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode n) ∈ levels := by - constructor - · intro entry - have fresh : x ∉ P := by - intro oldPoint - exact ZFSet.mem_irrefl t (oldBefore x t n t ((ownerBirthGraph_old_iff oldPoint).1 entry) stamp) - obtain ⟨hx, _, k, level, value⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction fresh).1 entry - have equal := stampCode.injective value stamp - exact ⟨(mem_ownerFresh P B x).2 ⟨hx, fresh⟩, equal ▸ level⟩ - · rintro ⟨fresh, level⟩ - have hx := (mem_ownerFresh P B x).1 fresh - exact (ownerBirthGraph_fresh_nat_iff oldFunction hx.2).2 - ⟨hx.1, (ZFSet.pair_mem_prod.1 (stampCode.function.1 stamp)).2, n, level, stamp⟩ - -theorem ownerBirthGraph_earlier_of_level {P B T T0 old levels stamps : ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P T0 old) - (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) - (stampCode : OwnerStampCode T stamps) - (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → - ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) - {n : Nat} {t x a : ZFSet.{u}} (stamp : ZFSet.pair (natSetCode n) t ∈ stamps) - (entry : ZFSet.pair x a ∈ ownerBirthGraph P B T old levels stamps) - (earlier : x ∈ P ∨ ∃ k < n, ZFSet.pair x (natSetCode k) ∈ levels) : a ∈ t := by - rcases earlier with oldPoint | ⟨k, before, level⟩ - · exact oldBefore x a n t ((ownerBirthGraph_old_iff oldPoint).1 entry) stamp - · have fresh := (ZFSet.pair_mem_prod.1 (levelFunction.1 level)).1 - have hx := (mem_ownerFresh P B x).1 fresh - obtain ⟨_, _, j, actualLevel, actualStamp⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction hx.2).1 entry - obtain ⟨_, _, unique⟩ := levelFunction.2 x fresh - have equal : j = k := natSetCode_injective - ((unique _ actualLevel).trans (unique _ level).symm) - exact (stampCode.strict j n a t actualStamp stamp).2 (equal.symm ▸ before) - -noncomputable def ownerBirthGraph_separated - {M : TransitiveGround.{u}} {P B L r μ T T0 old levels stamps : ZFSet.{u}} - {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} - (oldFunction : ZFSet.IsFunc P T0 old) (oldSubset : P ⊆ B) (times : T0 ⊆ T) - (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) - (stampCode : OwnerStampCode T stamps) - (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → - ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) - {n : Nat} {t : ZFSet.{u}} (stamp : ZFSet.pair (natSetCode n) t ∈ stamps) - (I : Type u) (index e : I → ZFSet.{u}) - (copyEarlier : ∀ i, index i ∈ t) (groundCopy : ∀ i, e i ∈ M.sets) - (embedding : ∀ i, MeetEmbeddingCode (Space (index i)) L - (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i)) - (component : {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ - ZFSet.pair x (natSetCode n) ∈ levels} → I) - (cover : ∀ x : {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ - ZFSet.pair x (natSetCode n) ∈ levels}, x.val ∈ L → - x.val ∈ relationImage (Space (index (component x))) L (e (component x))) - (separated : ∀ x y : {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ - ZFSet.pair x (natSetCode n) ∈ levels}, x.val ∈ L → y.val ∈ L → - component x ≠ component y → ∃ z ∈ B, ZFSet.pair (ZFSet.pair x.val y.val) z ∈ μ ∧ - (z ∈ P ∨ ∃ k < n, ZFSet.pair z (natSetCode k) ∈ levels)) : - CodedGrowthLayer M Space sourceOrder sourceMeet L r μ - (ownerBirthGraph P B T old levels stamps) t := by - let born := ownerBirthGraph_function oldFunction oldSubset times levelFunction stampCode.function - let fresh (x : {x : ZFSet.{u} // x ∈ L ∧ - ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps}) : - {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode n) ∈ levels} := - ⟨x.val, (ownerBirthGraph_stamp_fiber oldFunction stampCode oldBefore stamp).1 x.property.2⟩ - refine .separated I index e copyEarlier groundCopy embedding (fun x => component (fresh x)) ?_ ?_ - · intro x - exact cover (fresh x) x.property.1 - · intro x y different - obtain ⟨z, hz, meet, earlier⟩ := separated (fresh x) (fresh y) x.property.1 y.property.1 different - obtain ⟨a, entry, _⟩ := born.2 z hz - exact Or.inl ⟨z, a, meet, entry, - ownerBirthGraph_earlier_of_level oldFunction levelFunction stampCode oldBefore stamp entry earlier⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCompressionStampBounds +import OAI.SetTheory.PartitionPrinciple.Geometry.GrowthLayerSourceCongruence + +namespace OAI + +namespace PartitionPilot.Forcing +universe u + +noncomputable def ownerFresh (P B : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun x => x ∉ P) B + +theorem mem_ownerFresh (P B x : ZFSet.{u}) : + x ∈ ownerFresh P B ↔ x ∈ B ∧ x ∉ P := ZFSet.mem_sep + +noncomputable def ownerBirthGraph (P B T old levels stamps : ZFSet.{u}) : ZFSet.{u} := + old ∪ relationCompose (ownerFresh P B) ZFSet.omega T levels stamps + +theorem pair_mem_ownerBirthGraph (P B T old levels stamps x t : ZFSet.{u}) : + ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ + ZFSet.pair x t ∈ old ∨ + x ∈ B ∧ x ∉ P ∧ t ∈ T ∧ ∃ n ∈ ZFSet.omega, + ZFSet.pair x n ∈ levels ∧ ZFSet.pair n t ∈ stamps := by + rw [ownerBirthGraph, ZFSet.mem_union, pair_mem_relationCompose, mem_ownerFresh] + tauto + +theorem ownerBirthGraph_old_subset (P B T old levels stamps : ZFSet.{u}) : + old ⊆ ownerBirthGraph P B T old levels stamps := + fun _ h => ZFSet.mem_union.2 (Or.inl h) + +theorem ownerBirthGraph_old_iff {P B T old levels stamps x t : ZFSet.{u}} + (hx : x ∈ P) : + ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ ZFSet.pair x t ∈ old := by + rw [pair_mem_ownerBirthGraph] + exact ⟨fun h => h.elim id (fun h => (h.2.1 hx).elim), Or.inl⟩ + +theorem ownerBirthGraph_fresh_iff {P B T T0 old levels stamps x t : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P T0 old) (hx : x ∉ P) : + ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ + x ∈ B ∧ t ∈ T ∧ ∃ n ∈ ZFSet.omega, + ZFSet.pair x n ∈ levels ∧ ZFSet.pair n t ∈ stamps := by + rw [pair_mem_ownerBirthGraph] + constructor + · rintro (oldEntry | fresh) + · exact (hx (ZFSet.pair_mem_prod.1 (oldFunction.1 oldEntry)).1).elim + · exact ⟨fresh.1, fresh.2.2⟩ + · rintro ⟨hB, ht, n, hn, level, stamp⟩ + exact Or.inr ⟨hB, hx, ht, n, hn, level, stamp⟩ + +theorem ownerBirthGraph_function {P B T T0 old levels stamps : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P T0 old) (oldSubset : P ⊆ B) (times : T0 ⊆ T) + (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) + (stampFunction : ZFSet.IsFunc ZFSet.omega T stamps) : + ZFSet.IsFunc B T (ownerBirthGraph P B T old levels stamps) := by + have freshFunction := relationCompose_function_of_subset levelFunction stampFunction (fun _ h => h) + constructor + · intro z hz + rcases ZFSet.mem_union.1 hz with oldEntry | freshEntry + · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 oldEntry) + exact ZFSet.pair_mem_prod.2 ⟨oldSubset hx, times ht⟩ + · obtain ⟨x, hx, t, ht, rfl⟩ := ZFSet.mem_prod.1 (freshFunction.1 freshEntry) + exact ZFSet.pair_mem_prod.2 ⟨(mem_ownerFresh P B x).1 hx |>.1, ht⟩ + · intro x hx + by_cases oldPoint : x ∈ P + · obtain ⟨t, entry, unique⟩ := oldFunction.2 x oldPoint + exact ⟨t, (ownerBirthGraph_old_iff oldPoint).2 entry, + fun y hy => unique y ((ownerBirthGraph_old_iff oldPoint).1 hy)⟩ + · have freshPoint := (mem_ownerFresh P B x).2 ⟨hx, oldPoint⟩ + obtain ⟨t, entry, unique⟩ := freshFunction.2 x freshPoint + refine ⟨t, ZFSet.mem_union.2 (Or.inr entry), ?_⟩ + intro y hy + rcases ZFSet.mem_union.1 hy with oldEntry | freshEntry + · exact (oldPoint (ZFSet.pair_mem_prod.1 (oldFunction.1 oldEntry)).1).elim + · exact unique y freshEntry + +theorem ownerBirthGraph_restriction {P B T T0 old levels stamps : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P T0 old) : + graphRestriction P (ownerBirthGraph P B T old levels stamps) = old := by + apply ZFSet.ext + intro z + constructor + · intro h + obtain ⟨x, hx, t, rfl, entry⟩ := mem_graphRestriction.1 h + exact (ownerBirthGraph_old_iff hx).1 entry + · intro h + obtain ⟨x, hx, t, _, rfl⟩ := ZFSet.mem_prod.1 (oldFunction.1 h) + exact pair_mem_graphRestriction.2 ⟨(ownerBirthGraph_old_iff hx).2 h, hx⟩ + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem ownerFresh_mem (separation : SeparationSchema M.sets) + {P B : ZFSet.{u}} (hP : P ∈ M.sets) (hB : B ∈ M.sets) : + ownerFresh P B ∈ M.sets := by + let params := extend P Fin.elim0 + let formula : BoundedFormula 2 := .neg (.mem 0 1) + exact M.bounded_separation_mem separation formula params + (Fin.cases hP (fun j => Fin.elim0 j)) hB + +theorem ownerBirthGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P B T old levels stamps : ZFSet.{u}} + (hP : P ∈ M.sets) (hB : B ∈ M.sets) (hT : T ∈ M.sets) + (hOld : old ∈ M.sets) (hLevels : levels ∈ M.sets) (hStamps : stamps ∈ M.sets) + (hOmega : ZFSet.omega ∈ M.sets) : + ownerBirthGraph P B T old levels stamps ∈ M.sets := by + exact M.binary_union_mem pairing unions hOld + (M.relationCompose_mem pairing unions powers separation + (M.ownerFresh_mem separation hP hB) hOmega hT hLevels hStamps) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +universe u + +structure OwnerStampCode (T stamps : ZFSet.{u}) : Prop where + function : ZFSet.IsFunc ZFSet.omega T stamps + strict : ∀ n m a b, + ZFSet.pair (natSetCode n) a ∈ stamps → ZFSet.pair (natSetCode m) b ∈ stamps → + (a ∈ b ↔ n < m) + +theorem CompressionStampCode.ownerStampCode {base stamps T : ZFSet.{u}} + (code : CompressionStampCode base stamps T) : OwnerStampCode T stamps := by + refine ⟨code.function, ?_⟩ + intro n m a b first second + rw [(code.entries n a).1 first, (code.entries m b).1 second] + exact compressionStamp_mem_iff base n m + +theorem OwnerStampCode.injective {T stamps : ZFSet.{u}} + (code : OwnerStampCode T stamps) {n m : Nat} {t : ZFSet.{u}} + (first : ZFSet.pair (natSetCode n) t ∈ stamps) + (second : ZFSet.pair (natSetCode m) t ∈ stamps) : n = m := by + have notBefore : ¬ n < m := fun h => ZFSet.mem_irrefl t ((code.strict n m t t first second).2 h) + have notAfter : ¬ m < n := fun h => ZFSet.mem_irrefl t ((code.strict m n t t second first).2 h) + omega + +theorem ownerBirthGraph_fresh_nat_iff {P B T T0 old levels stamps x t : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P T0 old) (hx : x ∉ P) : + ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ + x ∈ B ∧ t ∈ T ∧ ∃ n : Nat, + ZFSet.pair x (natSetCode n) ∈ levels ∧ ZFSet.pair (natSetCode n) t ∈ stamps := by + rw [ownerBirthGraph_fresh_iff oldFunction hx] + apply and_congr_right + intro _ + apply and_congr_right + intro _ + constructor + · rintro ⟨i, hi, level, stamp⟩ + obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode i).1 hi + exact ⟨n, level, stamp⟩ + · rintro ⟨n, level, stamp⟩ + exact ⟨natSetCode n, (mem_omega_iff_natSetCode _).2 ⟨n, rfl⟩, level, stamp⟩ + +theorem ownerBirthGraph_oldMeet {P B r μ T T0 old levels stamps : ZFSet.{u}} + (meet : MeetOrderCode B r μ) (oldFunction : ZFSet.IsFunc P T0 old) + (oldSubset : P ⊆ B) (times : T0 ⊆ T) + (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) + (stampCode : OwnerStampCode T stamps) + (oldMeet : OldMeetCode r μ old) + (oldIdeal : ∀ x ∈ B, ∀ y ∈ P, ZFSet.pair x y ∈ r → x ∈ P) + (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → + ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) + (levelMono : ∀ x ∈ ownerFresh P B, ∀ y ∈ ownerFresh P B, ∀ n m, + ZFSet.pair x (natSetCode n) ∈ levels → ZFSet.pair y (natSetCode m) ∈ levels → + ZFSet.pair x y ∈ r → n ≤ m) : + OldMeetCode r μ (ownerBirthGraph P B T old levels stamps) := by + have born := ownerBirthGraph_function oldFunction oldSubset times levelFunction stampCode.function + intro x y z a b c ya xb before notLower xy zc + have hy := (ZFSet.pair_mem_prod.1 (born.1 ya)).1 + have hz := (ZFSet.pair_mem_prod.1 (born.1 zc)).1 + by_cases xOld : x ∈ P + · have xbOld := (ownerBirthGraph_old_iff xOld).1 xb + by_cases yOld : y ∈ P + · have zOld := oldIdeal z hz x xOld (meet.lower_left x y z xy) + exact oldMeet x y z a b c ((ownerBirthGraph_old_iff yOld).1 ya) xbOld before notLower xy + ((ownerBirthGraph_old_iff zOld).1 zc) + · obtain ⟨_, _, m, _, stampY⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction yOld).1 ya + exact (ZFSet.mem_asymm before (oldBefore x b m a xbOld stampY)).elim + · obtain ⟨_, _, n, _, stampX⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction xOld).1 xb + by_cases zOld : z ∈ P + · exact oldBefore z c n b ((ownerBirthGraph_old_iff zOld).1 zc) stampX + · have yOld : y ∉ P := fun member => zOld (oldIdeal z hz y member (meet.lower_right x y z xy)) + obtain ⟨_, _, m, levelY, stampY⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction yOld).1 ya + obtain ⟨_, _, k, levelZ, stampZ⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction zOld).1 zc + have lowerLevels := levelMono z ((mem_ownerFresh P B z).2 ⟨hz, zOld⟩) + y ((mem_ownerFresh P B y).2 ⟨hy, yOld⟩) k m levelZ levelY (meet.lower_right x y z xy) + exact (stampCode.strict k n c b stampZ stampX).2 + (Nat.lt_of_le_of_lt lowerLevels ((stampCode.strict m n a b stampY stampX).1 before)) + +theorem ownerBirthGraph_stamp_fiber {P B T T0 old levels stamps : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P T0 old) + (stampCode : OwnerStampCode T stamps) + (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → + ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) + {n : Nat} {t x : ZFSet.{u}} (stamp : ZFSet.pair (natSetCode n) t ∈ stamps) : + ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps ↔ + x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode n) ∈ levels := by + constructor + · intro entry + have fresh : x ∉ P := by + intro oldPoint + exact ZFSet.mem_irrefl t (oldBefore x t n t ((ownerBirthGraph_old_iff oldPoint).1 entry) stamp) + obtain ⟨hx, _, k, level, value⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction fresh).1 entry + have equal := stampCode.injective value stamp + exact ⟨(mem_ownerFresh P B x).2 ⟨hx, fresh⟩, equal ▸ level⟩ + · rintro ⟨fresh, level⟩ + have hx := (mem_ownerFresh P B x).1 fresh + exact (ownerBirthGraph_fresh_nat_iff oldFunction hx.2).2 + ⟨hx.1, (ZFSet.pair_mem_prod.1 (stampCode.function.1 stamp)).2, n, level, stamp⟩ + +theorem ownerBirthGraph_earlier_of_level {P B T T0 old levels stamps : ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P T0 old) + (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) + (stampCode : OwnerStampCode T stamps) + (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → + ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) + {n : Nat} {t x a : ZFSet.{u}} (stamp : ZFSet.pair (natSetCode n) t ∈ stamps) + (entry : ZFSet.pair x a ∈ ownerBirthGraph P B T old levels stamps) + (earlier : x ∈ P ∨ ∃ k < n, ZFSet.pair x (natSetCode k) ∈ levels) : a ∈ t := by + rcases earlier with oldPoint | ⟨k, before, level⟩ + · exact oldBefore x a n t ((ownerBirthGraph_old_iff oldPoint).1 entry) stamp + · have fresh := (ZFSet.pair_mem_prod.1 (levelFunction.1 level)).1 + have hx := (mem_ownerFresh P B x).1 fresh + obtain ⟨_, _, j, actualLevel, actualStamp⟩ := (ownerBirthGraph_fresh_nat_iff oldFunction hx.2).1 entry + obtain ⟨_, _, unique⟩ := levelFunction.2 x fresh + have equal : j = k := natSetCode_injective + ((unique _ actualLevel).trans (unique _ level).symm) + exact (stampCode.strict j n a t actualStamp stamp).2 (equal.symm ▸ before) + +noncomputable def ownerBirthGraph_separated + {M : TransitiveGround.{u}} {P B L r μ T T0 old levels stamps : ZFSet.{u}} + {Space sourceOrder sourceMeet : ZFSet.{u} → ZFSet.{u}} + (oldFunction : ZFSet.IsFunc P T0 old) (oldSubset : P ⊆ B) (times : T0 ⊆ T) + (levelFunction : ZFSet.IsFunc (ownerFresh P B) ZFSet.omega levels) + (stampCode : OwnerStampCode T stamps) + (oldBefore : ∀ x a n t, ZFSet.pair x a ∈ old → + ZFSet.pair (natSetCode n) t ∈ stamps → a ∈ t) + {n : Nat} {t : ZFSet.{u}} (stamp : ZFSet.pair (natSetCode n) t ∈ stamps) + (I : Type u) (index e : I → ZFSet.{u}) + (copyEarlier : ∀ i, index i ∈ t) (groundCopy : ∀ i, e i ∈ M.sets) + (embedding : ∀ i, MeetEmbeddingCode (Space (index i)) L + (sourceOrder (index i)) r (sourceMeet (index i)) μ (e i)) + (component : {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ + ZFSet.pair x (natSetCode n) ∈ levels} → I) + (cover : ∀ x : {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ + ZFSet.pair x (natSetCode n) ∈ levels}, x.val ∈ L → + x.val ∈ relationImage (Space (index (component x))) L (e (component x))) + (separated : ∀ x y : {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ + ZFSet.pair x (natSetCode n) ∈ levels}, x.val ∈ L → y.val ∈ L → + component x ≠ component y → ∃ z ∈ B, ZFSet.pair (ZFSet.pair x.val y.val) z ∈ μ ∧ + (z ∈ P ∨ ∃ k < n, ZFSet.pair z (natSetCode k) ∈ levels)) : + CodedGrowthLayer M Space sourceOrder sourceMeet L r μ + (ownerBirthGraph P B T old levels stamps) t := by + let born := ownerBirthGraph_function oldFunction oldSubset times levelFunction stampCode.function + let fresh (x : {x : ZFSet.{u} // x ∈ L ∧ + ZFSet.pair x t ∈ ownerBirthGraph P B T old levels stamps}) : + {x : ZFSet.{u} // x ∈ ownerFresh P B ∧ ZFSet.pair x (natSetCode n) ∈ levels} := + ⟨x.val, (ownerBirthGraph_stamp_fiber oldFunction stampCode oldBefore stamp).1 x.property.2⟩ + refine .separated I index e copyEarlier groundCopy embedding (fun x => component (fresh x)) ?_ ?_ + · intro x + exact cover (fresh x) x.property.1 + · intro x y different + obtain ⟨z, hz, meet, earlier⟩ := separated (fresh x) (fresh y) x.property.1 y.property.1 different + obtain ⟨a, entry, _⟩ := born.2 z hz + exact Or.inl ⟨z, a, meet, entry, + ownerBirthGraph_earlier_of_level oldFunction levelFunction stampCode oldBefore stamp entry earlier⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PartialBatchLimits.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PartialBatchLimits.lean index 1c1a3287aa6739de97342ada7e0cd3e55a15db78..72b6712a703a6fc992ab6948bfcd28d609e1dd07 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PartialBatchLimits.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PartialBatchLimits.lean @@ -1,88 +1,88 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.PartialBatchStep - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family - -universe u -variable {A I K : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) - -theorem present_union [Nonempty K] (U : K → I → Prop) (x : b.Node) : - b.Present (fun i => ∃ k, U k i) x ↔ ∃ k, b.Present (U k) x := by - cases x with - | inl x => - constructor - · intro _ - exact ⟨Classical.choice inferInstance, True.intro⟩ - · intro _ - exact True.intro - | inr x => exact Iff.rfl - -theorem cutoff_union_cover [Nonempty K] (U : K → I → Prop) - (x : b.Cutoff (fun i => ∃ k, U k i)) : - ∃ k, ∃ y : b.Cutoff (U k), - (b.cutoffInclusion (fun _ h => ⟨k, h⟩ : ∀ i, U k i → ∃ l, U l i)).toFun y = x := by - rcases (b.present_union U x.val).mp x.property with ⟨k, hx⟩ - exact ⟨k, ⟨x.val, hx⟩, rfl⟩ - -theorem cutoff_union_pair [Nonempty K] (U : K → I → Prop) - (directed : ∀ k l, ∃ m, (∀ i, U k i → U m i) ∧ ∀ i, U l i → U m i) - (x y : b.Cutoff (fun i => ∃ k, U k i)) : - ∃ k, b.Present (U k) x.val ∧ b.Present (U k) y.val := by - rcases (b.present_union U x.val).mp x.property with ⟨k, hx⟩ - rcases (b.present_union U y.val).mp y.property with ⟨l, hy⟩ - rcases directed k l with ⟨m, hkm, hlm⟩ - exact ⟨m, b.present_mono hkm hx, b.present_mono hlm hy⟩ - -theorem cutoff_union_meet [Nonempty K] (U : K → I → Prop) - (directed : ∀ k l, ∃ m, (∀ i, U k i → U m i) ∧ ∀ i, U l i → U m i) - (x y : b.Cutoff (fun i => ∃ k, U k i)) : - ∃ k, ∃ a c : b.Cutoff (U k), a.val = x.val ∧ c.val = y.val ∧ - ((b.cutoffOrder (U k)).meet a c).val = - ((b.cutoffOrder (fun i => ∃ k, U k i)).meet x y).val := by - rcases b.cutoff_union_pair U directed x y with ⟨k, hx, hy⟩ - exact ⟨k, ⟨x.val, hx⟩, ⟨y.val, hy⟩, rfl, rfl, rfl⟩ - -section Ordered -variable [LinearOrder I] - -def before (t : I) (i : I) : Prop := i < t - -theorem before_mono {s t : I} (h : s ≤ t) : ∀ i, before s i → before t i := - fun _ hi => lt_of_lt_of_le hi h - -theorem through_iff (t i : I) : addComponent (before t) t i ↔ i ≤ t := - le_iff_lt_or_eq.symm - -noncomputable def orderedStep (t : I) : - MeetIso (b.stepInput (before t) t).order (b.cutoffOrder (addComponent (before t) t)) := - b.stepIso (before t) t (lt_irrefl t) - -theorem before_limit (t : I) (earlier : ∃ s, s < t) - (limit : ∀ i, i < t → ∃ s, i < s ∧ s < t) (x : b.Node) : - b.Present (before t) x ↔ ∃ s, s < t ∧ b.Present (before s) x := by - cases x with - | inl x => - constructor - · intro _ - rcases earlier with ⟨s, hs⟩ - exact ⟨s, hs, True.intro⟩ - · intro _ - exact True.intro - | inr x => - constructor - · intro hx - rcases limit x.1 hx with ⟨s, his, hst⟩ - exact ⟨s, hst, his⟩ - · rintro ⟨s, hst, his⟩ - exact lt_trans his hst - -end Ordered - -end PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.PartialBatchStep + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family + +universe u +variable {A I K : Type u} {P : MeetOrder A} (b : PrincipalBatch.Family P I) + +theorem present_union [Nonempty K] (U : K → I → Prop) (x : b.Node) : + b.Present (fun i => ∃ k, U k i) x ↔ ∃ k, b.Present (U k) x := by + cases x with + | inl x => + constructor + · intro _ + exact ⟨Classical.choice inferInstance, True.intro⟩ + · intro _ + exact True.intro + | inr x => exact Iff.rfl + +theorem cutoff_union_cover [Nonempty K] (U : K → I → Prop) + (x : b.Cutoff (fun i => ∃ k, U k i)) : + ∃ k, ∃ y : b.Cutoff (U k), + (b.cutoffInclusion (fun _ h => ⟨k, h⟩ : ∀ i, U k i → ∃ l, U l i)).toFun y = x := by + rcases (b.present_union U x.val).mp x.property with ⟨k, hx⟩ + exact ⟨k, ⟨x.val, hx⟩, rfl⟩ + +theorem cutoff_union_pair [Nonempty K] (U : K → I → Prop) + (directed : ∀ k l, ∃ m, (∀ i, U k i → U m i) ∧ ∀ i, U l i → U m i) + (x y : b.Cutoff (fun i => ∃ k, U k i)) : + ∃ k, b.Present (U k) x.val ∧ b.Present (U k) y.val := by + rcases (b.present_union U x.val).mp x.property with ⟨k, hx⟩ + rcases (b.present_union U y.val).mp y.property with ⟨l, hy⟩ + rcases directed k l with ⟨m, hkm, hlm⟩ + exact ⟨m, b.present_mono hkm hx, b.present_mono hlm hy⟩ + +theorem cutoff_union_meet [Nonempty K] (U : K → I → Prop) + (directed : ∀ k l, ∃ m, (∀ i, U k i → U m i) ∧ ∀ i, U l i → U m i) + (x y : b.Cutoff (fun i => ∃ k, U k i)) : + ∃ k, ∃ a c : b.Cutoff (U k), a.val = x.val ∧ c.val = y.val ∧ + ((b.cutoffOrder (U k)).meet a c).val = + ((b.cutoffOrder (fun i => ∃ k, U k i)).meet x y).val := by + rcases b.cutoff_union_pair U directed x y with ⟨k, hx, hy⟩ + exact ⟨k, ⟨x.val, hx⟩, ⟨y.val, hy⟩, rfl, rfl, rfl⟩ + +section Ordered +variable [LinearOrder I] + +def before (t : I) (i : I) : Prop := i < t + +theorem before_mono {s t : I} (h : s ≤ t) : ∀ i, before s i → before t i := + fun _ hi => lt_of_lt_of_le hi h + +theorem through_iff (t i : I) : addComponent (before t) t i ↔ i ≤ t := + le_iff_lt_or_eq.symm + +noncomputable def orderedStep (t : I) : + MeetIso (b.stepInput (before t) t).order (b.cutoffOrder (addComponent (before t) t)) := + b.stepIso (before t) t (lt_irrefl t) + +theorem before_limit (t : I) (earlier : ∃ s, s < t) + (limit : ∀ i, i < t → ∃ s, i < s ∧ s < t) (x : b.Node) : + b.Present (before t) x ↔ ∃ s, s < t ∧ b.Present (before s) x := by + cases x with + | inl x => + constructor + · intro _ + rcases earlier with ⟨s, hs⟩ + exact ⟨s, hs, True.intro⟩ + · intro _ + exact True.intro + | inr x => + constructor + · intro hx + rcases limit x.1 hx with ⟨s, his, hst⟩ + exact ⟨s, hst, his⟩ + · rintro ⟨s, hst, his⟩ + exact lt_trans his hst + +end Ordered + +end PartitionPilot.Compression.RecursiveMaps.PrincipalBatch.Family + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PreservedMainPrefixHistoryValues.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PreservedMainPrefixHistoryValues.lean index a78e44a7db9fb15466caf2fdabe5f466ab6fc24c..4756717c31b10a23c01b776fa826befe47845571 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PreservedMainPrefixHistoryValues.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/PreservedMainPrefixHistoryValues.lean @@ -1,83 +1,83 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetFormula -universe u - -namespace SetFormula -def preservedMainPrefixHistoryValueFormula {n} (K Labels C D rD N i q : Fin n) : SetFormula n := - let old := suffixIndex n 3 - let field := prefixIndex n 3 - exBlock 3 (.conj - (BoundedFormula.conj (BoundedFormula.successorFormula (field 0) (old i)) - (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2))).toFormula - (.conj (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 0) (field 1) (field 2)) - (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 1) (field 2)))) - -end SetFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem realize_preservedMainPrefixHistoryValueFormula - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) {n} (K Labels C D rD N i q : Fin n) - (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) - (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : - Realize M.sets (preservedMainPrefixHistoryValueFormula K Labels C D rD N i q) env ↔ - ∃ S E, env q = mainPrefixCode (insert (env i) (env i)) S E ∧ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) - (insert (env i) (env i)) S E ∧ - MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E := by - rw [preservedMainPrefixHistoryValueFormula, realize_exBlock] - let old := suffixIndex n 3 - let field := prefixIndex n 3 - have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : - (Realize M.sets - (BoundedFormula.conj (BoundedFormula.successorFormula (field 0) (old i)) - (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2))).toFormula - (extendMany 3 f env) ∧ - Realize M.sets (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) - (field 0) (field 1) (field 2)) (extendMany 3 f env) ∧ - Realize M.sets (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) - (old rD) (old N) (field 1) (field 2)) (extendMany 3 f env)) ↔ - (f 0 = insert (env i) (env i) ∧ env q = mainPrefixCode (f 0) (f 1) (f 2)) ∧ - MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 0) (f 1) (f 2) ∧ - MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 1) (f 2) := by - have mems := extendMany_members 3 f env ground members - rw [BoundedFormula.realize_toFormula M _ _ mems] - simp only [BoundedFormula.Truth, BoundedFormula.truth_successorFormula, - BoundedFormula.truth_mainPrefixTupleFormula] - rw [M.realize_mainPrefixGraphFormula pairing unions powers separation collection - _ _ _ _ _ _ _ _ _ _ mems - (by simpa only [old, extendMany_suffix] using omega) - (by simpa only [old, extendMany_suffix] using ordinal)] - rw [M.realize_mainPrefixProfileGraphFormula pairing unions powers separation collection - _ _ _ _ _ _ _ _ _ mems - (by simpa only [old, extendMany_suffix] using omega) - (by simpa only [old, extendMany_suffix] using ordinal)] - simp only [old, field, extendMany_prefix, extendMany_suffix] - constructor - · rintro ⟨f, ground, recognized⟩ - obtain ⟨⟨index, encoded⟩, valid, profiles⟩ := (actual f ground).1 recognized - exact ⟨f 1, f 2, index ▸ encoded, index ▸ valid, profiles⟩ - · rintro ⟨S, E, encoded, valid, profiles⟩ - have ground := M.mainPrefixCode_fields_mem (encoded ▸ members q) - let f : Fin 3 → ZFSet.{u} := Fin.cases (insert (env i) (env i)) (Fin.cases S (fun _ => E)) - have grounds : ∀ j, f j ∈ M.sets := Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) - exact ⟨f, grounds, (actual f grounds).2 ⟨⟨rfl, encoded⟩, valid, profiles⟩⟩ - -end TransitiveGround -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInitialPreservedMainPrefix + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetFormula +universe u + +namespace SetFormula +def preservedMainPrefixHistoryValueFormula {n} (K Labels C D rD N i q : Fin n) : SetFormula n := + let old := suffixIndex n 3 + let field := prefixIndex n 3 + exBlock 3 (.conj + (BoundedFormula.conj (BoundedFormula.successorFormula (field 0) (old i)) + (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2))).toFormula + (.conj (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 0) (field 1) (field 2)) + (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 1) (field 2)))) + +end SetFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem realize_preservedMainPrefixHistoryValueFormula + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) {n} (K Labels C D rD N i q : Fin n) + (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) + (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) : + Realize M.sets (preservedMainPrefixHistoryValueFormula K Labels C D rD N i q) env ↔ + ∃ S E, env q = mainPrefixCode (insert (env i) (env i)) S E ∧ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) + (insert (env i) (env i)) S E ∧ + MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E := by + rw [preservedMainPrefixHistoryValueFormula, realize_exBlock] + let old := suffixIndex n 3 + let field := prefixIndex n 3 + have actual (f : Fin 3 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) : + (Realize M.sets + (BoundedFormula.conj (BoundedFormula.successorFormula (field 0) (old i)) + (BoundedFormula.mainPrefixTupleFormula (old q) (field 0) (field 1) (field 2))).toFormula + (extendMany 3 f env) ∧ + Realize M.sets (mainPrefixGraphFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) + (field 0) (field 1) (field 2)) (extendMany 3 f env) ∧ + Realize M.sets (mainPrefixProfileGraphFormula (old K) (old Labels) (old C) (old D) + (old rD) (old N) (field 1) (field 2)) (extendMany 3 f env)) ↔ + (f 0 = insert (env i) (env i) ∧ env q = mainPrefixCode (f 0) (f 1) (f 2)) ∧ + MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 0) (f 1) (f 2) ∧ + MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (f 1) (f 2) := by + have mems := extendMany_members 3 f env ground members + rw [BoundedFormula.realize_toFormula M _ _ mems] + simp only [BoundedFormula.Truth, BoundedFormula.truth_successorFormula, + BoundedFormula.truth_mainPrefixTupleFormula] + rw [M.realize_mainPrefixGraphFormula pairing unions powers separation collection + _ _ _ _ _ _ _ _ _ _ mems + (by simpa only [old, extendMany_suffix] using omega) + (by simpa only [old, extendMany_suffix] using ordinal)] + rw [M.realize_mainPrefixProfileGraphFormula pairing unions powers separation collection + _ _ _ _ _ _ _ _ _ mems + (by simpa only [old, extendMany_suffix] using omega) + (by simpa only [old, extendMany_suffix] using ordinal)] + simp only [old, field, extendMany_prefix, extendMany_suffix] + constructor + · rintro ⟨f, ground, recognized⟩ + obtain ⟨⟨index, encoded⟩, valid, profiles⟩ := (actual f ground).1 recognized + exact ⟨f 1, f 2, index ▸ encoded, index ▸ valid, profiles⟩ + · rintro ⟨S, E, encoded, valid, profiles⟩ + have ground := M.mainPrefixCode_fields_mem (encoded ▸ members q) + let f : Fin 3 → ZFSet.{u} := Fin.cases (insert (env i) (env i)) (Fin.cases S (fun _ => E)) + have grounds : ∀ j, f j ∈ M.sets := Fin.cases ground.1 (Fin.cases ground.2.1 (fun _ => ground.2.2)) + exact ⟨f, grounds, (actual f grounds).2 ⟨⟨rfl, encoded⟩, valid, profiles⟩⟩ + +end TransitiveGround +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveLiftAgreement.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveLiftAgreement.lean index 8b7bde5681034e012f0d60bca06b861b88232f83..3a01ebfce7a27be7b314cb2ed4a89365be2a2c19 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveLiftAgreement.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveLiftAgreement.lean @@ -1,765 +1,765 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.CodedBatchDecoding -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPushFilterFamilyFormulas -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundVaryingFamilyEvaluation -import OAI.SetTheory.PartitionPrinciple.Geometry.DecodedMeetMaps -import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionFunctions - -namespace OAI - - -namespace PartitionPilot.Forcing - -universe u - -def recursiveAttachmentIndices (I J P U As Fs : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun k => ∃ i ∈ I, ∃ j ∈ J, ∃ a ∈ P, ∃ F ∈ U, - k = ZFSet.pair i j ∧ ZFSet.pair i a ∈ As ∧ ZFSet.pair j F ∈ Fs ∧ a ∉ F) - (ZFSet.prod I J) - -theorem recursiveAttachmentIndices_subset (I J P U As Fs : ZFSet.{u}) : - recursiveAttachmentIndices I J P U As Fs ⊆ ZFSet.prod I J := - fun _ hz => (ZFSet.mem_sep.1 hz).1 - -theorem pair_mem_recursiveAttachmentIndices (I J P U As Fs i j : ZFSet.{u}) : - ZFSet.pair i j ∈ recursiveAttachmentIndices I J P U As Fs ↔ - i ∈ I ∧ j ∈ J ∧ ∃ a ∈ P, ∃ F ∈ U, - ZFSet.pair i a ∈ As ∧ ZFSet.pair j F ∈ Fs ∧ a ∉ F := by - rw [recursiveAttachmentIndices, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hi, hj⟩, i', _, j', _, a, ha, F, hF, eq, ai, Fj, neg⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hi, hj, a, ha, F, hF, ai, Fj, neg⟩ - · rintro ⟨hi, hj, a, ha, F, hF, ai, Fj, neg⟩ - exact ⟨⟨hi, hj⟩, i, hi, j, hj, a, ha, F, hF, rfl, ai, Fj, neg⟩ - -def pairFieldGraph (left : Bool) (I J K B H : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ k ∈ K, ∃ i ∈ I, ∃ j ∈ J, ∃ x ∈ B, - z = ZFSet.pair k x ∧ k = ZFSet.pair i j ∧ - ZFSet.pair (if left then i else j) x ∈ H) (ZFSet.prod K B) - -theorem pair_mem_pairFieldGraph (left : Bool) (I J K B H k x : ZFSet.{u}) : - ZFSet.pair k x ∈ pairFieldGraph left I J K B H ↔ - k ∈ K ∧ x ∈ B ∧ ∃ i ∈ I, ∃ j ∈ J, - k = ZFSet.pair i j ∧ ZFSet.pair (if left then i else j) x ∈ H := by - rw [pairFieldGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hk, hx⟩, k', _, i, hi, j, hj, x', _, eq, kij, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hk, hx, i, hi, j, hj, kij, entry⟩ - · rintro ⟨hk, hx, i, hi, j, hj, kij, entry⟩ - exact ⟨⟨hk, hx⟩, k, hk, i, hi, j, hj, x, hx, rfl, kij, entry⟩ - -theorem pairFieldGraph_entry_iff (left : Bool) {I J K B H i j x : ZFSet.{u}} - (hi : i ∈ I) (hj : j ∈ J) : - ZFSet.pair (ZFSet.pair i j) x ∈ pairFieldGraph left I J K B H ↔ - ZFSet.pair i j ∈ K ∧ x ∈ B ∧ ZFSet.pair (if left then i else j) x ∈ H := by - rw [pair_mem_pairFieldGraph] - constructor - · rintro ⟨hk, hx, i', _, j', _, eq, entry⟩ - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq - exact ⟨hk, hx, entry⟩ - · rintro ⟨hk, hx, entry⟩ - exact ⟨hk, hx, i, hi, j, hj, rfl, entry⟩ - -theorem pairFieldGraph_function (left : Bool) {I J K B H : ZFSet.{u}} - (subset : K ⊆ ZFSet.prod I J) - (function : ZFSet.IsFunc (if left then I else J) B H) : - ZFSet.IsFunc K B (pairFieldGraph left I J K B H) := by - refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ - intro k hk - obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) - have hs : (if left then i else j) ∈ (if left then I else J) := by - cases left <;> assumption - obtain ⟨x, entry, unique⟩ := function.2 _ hs - have hx := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - refine ⟨x, (pairFieldGraph_entry_iff left hi hj).2 ⟨hk, hx, entry⟩, ?_⟩ - intro y hy - exact unique y ((pairFieldGraph_entry_iff left hi hj).1 hy).2.2 - - - - - - -namespace BoundedFormula - -open SetFormula - -def recursiveAttachmentIndexFormula {n} (k i j p u a f : Fin n) : BoundedFormula n := - exMem i (exMem j.succ (exMem p.succ.succ (exMem u.succ.succ.succ - (.conj (orderedPairFormula k.succ.succ.succ.succ 3 2) - (.conj (pairMembershipFormula 3 1 a.succ.succ.succ.succ) - (.conj (pairMembershipFormula 2 0 f.succ.succ.succ.succ) (.neg (.mem 1 0)))))))) - -theorem truth_recursiveAttachmentIndexFormula {n} (k i j p u a f : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (recursiveAttachmentIndexFormula k i j p u a f) env ↔ - ∃ x ∈ env i, ∃ y ∈ env j, ∃ b ∈ env p, ∃ F ∈ env u, - env k = ZFSet.pair x y ∧ ZFSet.pair x b ∈ env a ∧ - ZFSet.pair y F ∈ env f ∧ b ∉ F := by - simp only [recursiveAttachmentIndexFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula] - rfl - -def pairFieldEntryFormula {n} (left : Bool) (z k i j b h : Fin n) : BoundedFormula n := - exMem k (exMem i.succ (exMem j.succ.succ (exMem b.succ.succ.succ - (.conj (orderedPairFormula z.succ.succ.succ.succ 3 0) - (.conj (orderedPairFormula 3 2 1) - (pairMembershipFormula (if left then 2 else 1) 0 h.succ.succ.succ.succ)))))) - -theorem truth_pairFieldEntryFormula {n} (left : Bool) (z k i j b h : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (pairFieldEntryFormula left z k i j b h) env ↔ - ∃ t ∈ env k, ∃ x ∈ env i, ∃ y ∈ env j, ∃ v ∈ env b, - env z = ZFSet.pair t v ∧ t = ZFSet.pair x y ∧ - ZFSet.pair (if left then x else y) v ∈ env h := by - cases left <;> - simp only [pairFieldEntryFormula, truth_exMem, Truth, - truth_orderedPairFormula, truth_pairMembershipFormula, Bool.false_eq_true, ↓reduceIte] <;> rfl - -end BoundedFormula - -namespace TransitiveGround - -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem recursiveAttachmentIndices_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I J P U As Fs : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) - (hP : P ∈ M.sets) (hU : U ∈ M.sets) (hAs : As ∈ M.sets) (hFs : Fs ∈ M.sets) : - recursiveAttachmentIndices I J P U As Fs ∈ M.sets := by - let params := extend I (extend J (extend P (extend U (extend As (extend Fs Fin.elim0))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.recursiveAttachmentIndexFormula 0 1 2 3 4 5 6) params - (Fin.cases hI (Fin.cases hJ (Fin.cases hP (Fin.cases hU (Fin.cases hAs - (Fin.cases hFs (fun i => Fin.elim0 i))))))) - (M.prod_mem pairing unions powers separation hI hJ) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.recursiveAttachmentIndexFormula 0 1 2 3 4 5 6) (extend z params)) - (ZFSet.prod I J) = recursiveAttachmentIndices I J P U As Fs := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, recursiveAttachmentIndices, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_recursiveAttachmentIndexFormula 0 1 2 3 4 5 6 _) - exact equal ▸ selected - -theorem pairFieldGraph_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (left : Bool) {I J K B H : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) - (hK : K ∈ M.sets) (hB : B ∈ M.sets) (hH : H ∈ M.sets) : - pairFieldGraph left I J K B H ∈ M.sets := by - let params := extend K (extend I (extend J (extend B (extend H Fin.elim0)))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.pairFieldEntryFormula left 0 1 2 3 4 5) params - (Fin.cases hK (Fin.cases hI (Fin.cases hJ (Fin.cases hB - (Fin.cases hH (fun i => Fin.elim0 i)))))) - (M.prod_mem pairing unions powers separation hK hB) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.pairFieldEntryFormula left 0 1 2 3 4 5) (extend z params)) - (ZFSet.prod K B) = pairFieldGraph left I J K B H := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, pairFieldGraph, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_pairFieldEntryFormula left 0 1 2 3 4 5 _) - exact equal ▸ selected - -theorem pairFieldGraph_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (left : Bool) {I J K H : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) - (hK : K ∈ M.sets) (hH : H ∈ M.sets) (subset : K ⊆ ZFSet.prod I J) - (function : FunctionGraphOn (if left then I else J) H) : - pairFieldGraph left I J K (ZFSet.sUnion (ZFSet.sUnion H)) H ∈ M.sets ∧ - FunctionGraphOn K (pairFieldGraph left I J K (ZFSet.sUnion (ZFSet.sUnion H)) H) ∧ - ∀ i ∈ I, ∀ j ∈ J, ∀ x, - ZFSet.pair (ZFSet.pair i j) x ∈ pairFieldGraph left I J K (ZFSet.sUnion (ZFSet.sUnion H)) H ↔ - ZFSet.pair i j ∈ K ∧ ZFSet.pair (if left then i else j) x ∈ H := by - refine ⟨M.pairFieldGraph_mem pairing unions powers separation left hI hJ hK - (M.union_mem unions (M.union_mem unions hH)) hH, - ⟨_, pairFieldGraph_function left subset function.to_isFunc⟩, ?_⟩ - intro i hi j hj x - rw [pairFieldGraph_entry_iff left hi hj] - exact ⟨fun h => ⟨h.1, h.2.2⟩, - fun h => ⟨h.1, pair_second_mem_doubleUnion h.2, h.2⟩⟩ - -end TransitiveGround - - - - - - -def pairSecondField (I J K H : ZFSet.{u}) : ZFSet.{u} := - pairFieldGraph false I J K (ZFSet.sUnion (ZFSet.sUnion H)) H - -def pairFirstField (I J K H : ZFSet.{u}) : ZFSet.{u} := - pairFieldGraph true I J K (ZFSet.sUnion (ZFSet.sUnion H)) H - -def recursiveSeparatorFamily (K I J D L Maps Ss : ZFSet.{u}) : ZFSet.{u} := - familyEvaluationGraph K D L (ZFSet.sUnion (ZFSet.sUnion Maps)) - (pairFirstField I J K Maps) (pairFieldGraph false I J K D Ss) - -theorem pairSecondField_entry_iff {I J K H i j x : ZFSet.{u}} - (hi : i ∈ I) (hj : j ∈ J) : - ZFSet.pair (ZFSet.pair i j) x ∈ pairSecondField I J K H ↔ - ZFSet.pair i j ∈ K ∧ ZFSet.pair j x ∈ H := by - rw [pairSecondField, pairFieldGraph_entry_iff false hi hj] - exact ⟨fun h => ⟨h.1, h.2.2⟩, - fun h => ⟨h.1, pair_second_mem_doubleUnion h.2, h.2⟩⟩ - -theorem pairFirstField_entry_iff {I J K H i j x : ZFSet.{u}} - (hi : i ∈ I) (hj : j ∈ J) : - ZFSet.pair (ZFSet.pair i j) x ∈ pairFirstField I J K H ↔ - ZFSet.pair i j ∈ K ∧ ZFSet.pair i x ∈ H := by - rw [pairFirstField, pairFieldGraph_entry_iff true hi hj] - exact ⟨fun h => ⟨h.1, h.2.2⟩, - fun h => ⟨h.1, pair_second_mem_doubleUnion h.2, h.2⟩⟩ - -theorem AttachmentBatchInputs.separator_function - {D rD μD J Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) : ZFSet.IsFunc J D Ss := by - refine ⟨?_, d.separators.to_isFunc.2⟩ - intro z hz - obtain ⟨j, hj, e, rfl⟩ := d.separators.shape z hz - have equal := d.separators.value_eq_of_entry ⟨j, hj⟩ hz - exact ZFSet.pair_mem_prod.2 ⟨hj, equal ▸ (d.fiber ⟨j, hj⟩).separator_mem⟩ - -theorem recursiveSeparatorFamily_function {K I J D L Maps Ss : ZFSet.{u}} - (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Maps) - (separators : ZFSet.IsFunc J D Ss) - (valid : ∀ i S, ZFSet.pair i S ∈ Maps → ZFSet.IsFunc D L S) : - ZFSet.IsFunc K L (recursiveSeparatorFamily K I J D L Maps Ss) := by - apply familyEvaluationGraph_function (pairFieldGraph_function true subset maps.to_isFunc) - (pairFieldGraph_function false subset separators) - intro k S entry - obtain ⟨_, _, i, hi, j, hj, rfl, selected⟩ := (pair_mem_pairFieldGraph true _ _ _ _ _ _ _).1 entry - exact valid i S selected - -theorem recursiveSeparatorFamily_entry_iff {K I J D L Maps Ss i j S e y : ZFSet.{u}} - (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Maps) - (separators : ZFSet.IsFunc J D Ss) (hk : ZFSet.pair i j ∈ K) - (mapEntry : ZFSet.pair i S ∈ Maps) (sepEntry : ZFSet.pair j e ∈ Ss) : - ZFSet.pair (ZFSet.pair i j) y ∈ recursiveSeparatorFamily K I J D L Maps Ss ↔ - y ∈ L ∧ ZFSet.pair e y ∈ S := by - have shape := ZFSet.pair_mem_prod.1 (subset hk) - exact familyEvaluationGraph_entry_iff - (pairFieldGraph_function true subset maps.to_isFunc) - (pairFieldGraph_function false subset separators) - ((pairFirstField_entry_iff shape.1 shape.2).2 ⟨hk, mapEntry⟩) - ((pairFieldGraph_entry_iff false shape.1 shape.2).2 - ⟨hk, (ZFSet.pair_mem_prod.1 (separators.1 sepEntry)).2, sepEntry⟩) - -theorem recursiveAttachmentIndices_entry_iff {I J D U Sources Fs i j a F : ZFSet.{u}} - (sources : ZFSet.IsFunc I D Sources) (filters : ZFSet.IsFunc J U Fs) - (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) : - ZFSet.pair i j ∈ recursiveAttachmentIndices I J D U Sources Fs ↔ a ∉ F := by - rw [pair_mem_recursiveAttachmentIndices] - constructor - · rintro ⟨_, _, b, _, V, _, ib, jV, negative⟩ - have equalA := (show FunctionGraphOn I Sources from ⟨D, sources⟩).unique ib source - have equalF := (show FunctionGraphOn J Fs from ⟨U, filters⟩).unique jV filter - exact equalA ▸ equalF ▸ negative - · intro negative - have sa := ZFSet.pair_mem_prod.1 (sources.1 source) - have sf := ZFSet.pair_mem_prod.1 (filters.1 filter) - exact ⟨sa.1, sf.1, a, sa.2, F, sf.2, source, filter, negative⟩ - - - - - - -theorem recursiveFresh_iff {I J K Qs rs As i j q : ZFSet.{u}} - (hi : i ∈ I) (hj : j ∈ J) : - ZFSet.pair (ZFSet.pair i j) q ∈ indexedAttachmentFresh K - (pairSecondField I J K Qs) (pairSecondField I J K rs) (pairSecondField I J K As) ↔ - ZFSet.pair i j ∈ K ∧ ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As := by - rw [pair_mem_indexedAttachmentFresh, pair_mem_indexedAttachmentFresh] - constructor - · rintro ⟨hk, Q, r, a, eq, er, ea, hq, fresh⟩ - exact ⟨hk, hj, Q, r, a, ((pairSecondField_entry_iff hi hj).1 eq).2, - ((pairSecondField_entry_iff hi hj).1 er).2, - ((pairSecondField_entry_iff hi hj).1 ea).2, hq, fresh⟩ - · rintro ⟨hk, _, Q, r, a, eq, er, ea, hq, fresh⟩ - exact ⟨hk, Q, r, a, (pairSecondField_entry_iff hi hj).2 ⟨hk, eq⟩, - (pairSecondField_entry_iff hi hj).2 ⟨hk, er⟩, - (pairSecondField_entry_iff hi hj).2 ⟨hk, ea⟩, hq, fresh⟩ - -theorem recursiveFresh_shape {I J K Qs rs As z : ZFSet.{u}} - (subset : K ⊆ ZFSet.prod I J) - (fresh : z ∈ indexedAttachmentFresh K - (pairSecondField I J K Qs) (pairSecondField I J K rs) (pairSecondField I J K As)) : - ∃ i ∈ I, ∃ j ∈ J, ∃ q, z = ZFSet.pair (ZFSet.pair i j) q ∧ - ZFSet.pair i j ∈ K ∧ ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As := by - obtain ⟨k, hk, q, rfl, _⟩ := (mem_indexedAttachmentFresh _ _ _ _ z).1 fresh - obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) - exact ⟨i, hi, j, hj, q, rfl, (recursiveFresh_iff hi hj).1 fresh⟩ - -theorem negativeRecursiveFresh_mem - {I J D L Qs rs As Sources Fs i j q a F : ZFSet.{u}} - (sources : ZFSet.IsFunc I D Sources) (filters : FunctionGraphOn J Fs) - (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) - (fresh : ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As) (negative : a ∉ F) : - let K := recursiveAttachmentIndices I J D (ZFSet.sUnion (ZFSet.sUnion Fs)) Sources Fs - ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q) ∈ taggedExtension L - (indexedAttachmentFresh K (pairSecondField I J K Qs) - (pairSecondField I J K rs) (pairSecondField I J K As)) := by - apply pair_mem_taggedExtension.2 - apply (recursiveFresh_iff (ZFSet.pair_mem_prod.1 (sources.1 source)).1 (filters.pair_source filter)).2 - exact ⟨(recursiveAttachmentIndices_entry_iff sources filters.to_isFunc source filter).2 negative, fresh⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem recursiveSeparatorFamily_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {K I J D L Maps Ss : ZFSet.{u}} (hK : K ∈ M.sets) (hI : I ∈ M.sets) - (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hL : L ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSs : Ss ∈ M.sets) : - recursiveSeparatorFamily K I J D L Maps Ss ∈ M.sets := by - have bound := M.union_mem unions (M.union_mem unions hMaps) - exact M.familyEvaluationGraph_mem pairing unions powers separation hK hD hL bound - (M.pairFieldGraph_mem pairing unions powers separation true hI hJ hK bound hMaps) - (M.pairFieldGraph_mem pairing unions powers separation false hI hJ hK hD hSs) - -theorem groundRecursiveBatchInputs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {K I J D L rD rL μD μL Qs rs μs As Es Fs Ss Maps : ZFSet.{u}} - (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) - (target : MeetOrderCode L rL μL) (maps : FunctionGraphOn I Maps) - (valid : ∀ i S, ZFSet.pair i S ∈ Maps → MeetEmbeddingCode D L rD rL μD μL S) - (subset : K ⊆ ZFSet.prod I J) - (hK : K ∈ M.sets) (hI : I ∈ M.sets) (hJ : J ∈ M.sets) - (hD : D ∈ M.sets) (hL : L ∈ M.sets) (hrL : rL ∈ M.sets) - (hQs : Qs ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) - (hMaps : Maps ∈ M.sets) : - AttachmentBatchInputs L rL μL K - (pairSecondField I J K Qs) (pairSecondField I J K rs) - (pairSecondField I J K μs) (pairSecondField I J K As) - (M.groundPairCompositions K I J (familyPointBound Qs) D L Es Maps) - (M.groundPairPushFilters K I J L rL Maps Fs) - (recursiveSeparatorFamily K I J D L Maps Ss) := by - obtain ⟨_, composites, compositeEntries⟩ := M.groundPairCompositions_spec - pairing unions powers separation hK hI hJ (M.familyPointBound_mem unions hQs) - hD hL hEs hMaps d.embeddings maps subset - obtain ⟨_, filters, filterEntries⟩ := M.groundPairPushFilters_spec - pairing unions powers separation hK hI hJ hL hrL hMaps hFs maps d.filters subset - refine ⟨target, ⟨_, pairFieldGraph_function false subset d.spaces.to_isFunc⟩, - ⟨_, pairFieldGraph_function false subset d.relations.to_isFunc⟩, - ⟨_, pairFieldGraph_function false subset d.meets.to_isFunc⟩, - ⟨_, pairFieldGraph_function false subset d.anchors.to_isFunc⟩, - ⟨_, composites⟩, ⟨_, filters⟩, - ⟨_, recursiveSeparatorFamily_function subset maps d.separator_function - (fun i S entry => (valid i S entry).injection.function)⟩, ?_⟩ - intro k hk Q r μ a ell' F' e' qEntry rEntry μEntry aEntry ellEntry FEntry eEntry - obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) - have qOriginal := ((pairSecondField_entry_iff hi hj).1 qEntry).2 - have rOriginal := ((pairSecondField_entry_iff hi hj).1 rEntry).2 - have μOriginal := ((pairSecondField_entry_iff hi hj).1 μEntry).2 - have aOriginal := ((pairSecondField_entry_iff hi hj).1 aEntry).2 - obtain ⟨ell, oldEll⟩ := d.embeddings.total hj - obtain ⟨F, oldF⟩ := d.filters.total hj - obtain ⟨e, oldE⟩ := d.separators.total hj - obtain ⟨S, oldS⟩ := maps.total hi - have old := d.valid j hj Q r μ a ell F e qOriginal rOriginal μOriginal aOriginal oldEll oldF oldE - have ellEq := ((compositeEntries i j ell S ell' oldEll oldS).1 ellEntry).2 - have filterEq := ((filterEntries i j S F F' oldS oldF).1 FEntry).2 - have image := ((recursiveSeparatorFamily_entry_iff subset maps d.separator_function hk oldS oldE).1 eEntry).2 - have domainEq : relationCompose (familyPointBound Qs) D L ell S = - relationCompose (attachmentIdeal Q r a) D L ell S := - relationCompose_domain_eq - (fun _ hz => mem_familyPointBound_of_entry qOriginal ((mem_attachmentIdeal Q r a _).1 hz).1) - old.base_function.1 - rw [ellEq, domainEq, filterEq] - exact old.pushforward target (valid i S oldS) image - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing - -open Compression.RecursiveMaps -universe u - -structure CodedRecursiveMapInputs - {D rD μD J Qs rs μs As Es Fs Ss : ZFSet.{u}} - (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) - (I Maps Sources Reps G m inv one A : ZFSet.{u}) : Prop where - maps : FunctionGraphOn I Maps - sources : ZFSet.IsFunc I D Sources - representatives : ZFSet.IsFunc I G Reps - group : GroupCode G m inv one - action : PosetActionCode G d.batchCarrier m one d.batchOrder A - valid : ∀ i S, ZFSet.pair i S ∈ Maps → - MeetEmbeddingCode D d.batchCarrier rD d.batchOrder μD d.batchMeetGraph S - agreement : ∀ i a g S x y, ZFSet.pair i a ∈ Sources → ZFSet.pair i g ∈ Reps → - ZFSet.pair i S ∈ Maps → x ∈ D → ZFSet.pair x a ∈ rD → - (ZFSet.pair x y ∈ S ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A) - -namespace CodedRecursiveMapInputs - -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) - -noncomputable def source (i : {i : ZFSet.{u} // i ∈ I}) : {x : ZFSet.{u} // x ∈ D} := - let graph : FunctionGraphOn I Sources := ⟨D, h.sources⟩ - ⟨graph.value i, (ZFSet.pair_mem_prod.1 (h.sources.1 (graph.value_entry i))).2⟩ - -theorem source_entry (i : {i : ZFSet.{u} // i ∈ I}) : - ZFSet.pair i.val (h.source i).val ∈ Sources := - (show FunctionGraphOn I Sources from ⟨D, h.sources⟩).value_entry i - -noncomputable def actor (i : {i : ZFSet.{u} // i ∈ I}) : {g : ZFSet.{u} // g ∈ G} := - let graph : FunctionGraphOn I Reps := ⟨G, h.representatives⟩ - ⟨graph.value i, (ZFSet.pair_mem_prod.1 (h.representatives.1 (graph.value_entry i))).2⟩ - -theorem actor_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (h.actor i).val ∈ Reps := - (show FunctionGraphOn I Reps from ⟨G, h.representatives⟩).value_entry i - -noncomputable def previous (i : {i : ZFSet.{u} // i ∈ I}) : - MeetEmbedding d.oldOrder.toMeetOrder d.templates.extension := - compose ((h.valid i.val _ (h.maps.value_entry i)).toMeetEmbedding d.oldOrder d.batch_meetOrder) - d.coding.decodingIso.toMeetEmbedding - -theorem previous_entry (i : {i : ZFSet.{u} // i ∈ I}) (x : {x : ZFSet.{u} // x ∈ D}) : - ZFSet.pair x.val (d.coding.encode ((h.previous i).toFun x)) ∈ h.maps.value i := by - change ZFSet.pair x.val (d.coding.encode (d.coding.decodingIso.toFun - (((h.valid i.val _ (h.maps.value_entry i)).toMeetEmbedding d.oldOrder d.batch_meetOrder).toFun x))) ∈ _ - rw [d.coding.decodingIso_encode] - exact (h.valid i.val _ (h.maps.value_entry i)).toMeetEmbedding_entry d.oldOrder d.batch_meetOrder x - -noncomputable def representative (i : {i : ZFSet.{u} // i ∈ I}) : - Compression.MeetIso d.templates.extension d.templates.extension := by - let encoding := d.coding.encodingIso - let acted := h.action.toMeetIso h.group d.batch_meetOrder (h.actor i) - refine isoOfOrder - (fun x => encoding.inverse (acted.toFun (encoding.toFun x))) - (fun x => encoding.inverse (acted.inverse (encoding.toFun x))) ?_ ?_ ?_ - · intro x - rw [encoding.right_inverse, acted.left_inverse, encoding.left_inverse] - · intro x - rw [encoding.right_inverse, acted.right_inverse, encoding.left_inverse] - · intro x y - exact ((inverseIso encoding).le_iff _ _).trans - ((acted.le_iff _ _).trans (encoding.le_iff x y)) - -theorem representative_entry (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - ZFSet.pair (ZFSet.pair (h.actor i).val (d.coding.encode x)) - (d.coding.encode ((h.representative i).toFun x)) ∈ A := by - change ZFSet.pair (ZFSet.pair (h.actor i).val (d.coding.encode x)) - (d.coding.encode (d.coding.decode - ((h.action.toMeetIso h.group d.batch_meetOrder (h.actor i)).toFun - ⟨d.coding.encode x, d.coding.encode_mem x⟩))) ∈ A - rw [d.coding.encode_decode] - exact h.action.toMeetIso_entry h.group d.batch_meetOrder (h.actor i) - ⟨d.coding.encode x, d.coding.encode_mem x⟩ - -noncomputable def toInputs : Inputs d.templates {i : ZFSet.{u} // i ∈ I} where - source := h.source - previous := h.previous - representative := h.representative - agree := by - intro i x lower - apply d.coding.encode_injective - have previous := (h.agreement i.val (h.source i).val (h.actor i).val (h.maps.value i) - x.val _ (h.source_entry i) (h.actor_entry i) (h.maps.value_entry i) x.property lower).1 - (h.previous_entry i x) - exact (show FunctionGraphOn (ZFSet.prod G d.batchCarrier) A from - ⟨d.batchCarrier, h.action.function⟩).unique previous (h.representative_entry i (.inl x)) - -theorem toInputs_source (i : {i : ZFSet.{u} // i ∈ I}) : h.toInputs.source i = h.source i := rfl - -theorem toInputs_previous_entry (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D}) : - ZFSet.pair x.val (d.coding.encode ((h.toInputs.previous i).toFun x)) ∈ h.maps.value i := - h.previous_entry i x - -theorem toInputs_representative_entry (i : {i : ZFSet.{u} // i ∈ I}) - (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : - ZFSet.pair (ZFSet.pair (h.actor i).val (d.coding.encode x)) - (d.coding.encode ((h.toInputs.representative i).toFun x)) ∈ A := - h.representative_entry i x - -end CodedRecursiveMapInputs - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -open Compression.RecursiveMaps -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) - -noncomputable abbrev nextIndices (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) := - recursiveAttachmentIndices I J D (ZFSet.sUnion (ZFSet.sUnion Fs)) Sources Fs - -noncomputable abbrev NextInputs (M : TransitiveGround.{u}) := - AttachmentBatchInputs d.batchCarrier d.batchOrder d.batchMeetGraph h.nextIndices - (pairSecondField I J h.nextIndices Qs) (pairSecondField I J h.nextIndices rs) - (pairSecondField I J h.nextIndices μs) (pairSecondField I J h.nextIndices As) - (M.groundPairCompositions h.nextIndices I J (familyPointBound Qs) D d.batchCarrier Es Maps) - (M.groundPairPushFilters h.nextIndices I J d.batchCarrier d.batchOrder Maps Fs) - (recursiveSeparatorFamily h.nextIndices I J D d.batchCarrier Maps Ss) - -noncomputable def nextIndex (label : h.toInputs.Labels) : - {k : ZFSet.{u} // k ∈ h.nextIndices} := - ⟨ZFSet.pair label.1.val label.2.val.val, - (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc - (h.source_entry label.1) (d.filter_entry label.2.val)).2 label.2.property⟩ - -theorem nextIndex_injective : Function.Injective h.nextIndex := by - rintro ⟨i, j⟩ ⟨i', j'⟩ equal - have parts := ZFSet.pair_inj.1 (congrArg Subtype.val equal) - have left : i = i' := Subtype.ext parts.1 - subst i' - have right : j = j' := Subtype.ext (Subtype.ext parts.2) - subst j' - rfl - -theorem nextIndex_surjective : Function.Surjective h.nextIndex := by - intro k - obtain ⟨i, hi, j, hj, equal⟩ := ZFSet.mem_prod.1 - (recursiveAttachmentIndices_subset I J D (ZFSet.sUnion (ZFSet.sUnion Fs)) Sources Fs k.property) - let i' : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - let j' : {j : ZFSet.{u} // j ∈ J} := ⟨j, hj⟩ - have negative : ¬ d.templates.upper j' (h.toInputs.source i') := - (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc - (h.source_entry i') (d.filter_entry j')).1 (equal ▸ k.property) - exact ⟨⟨i', ⟨j', negative⟩⟩, Subtype.ext equal.symm⟩ - -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -theorem next_space (label : h.toInputs.Labels) : - next.space (h.nextIndex label) = d.space label.2.val := - d.spaces.unique - ((pairSecondField_entry_iff label.1.property label.2.val.property).1 - (next.space_entry (h.nextIndex label))).2 (d.space_entry label.2.val) - -theorem next_rel (label : h.toInputs.Labels) : - next.rel (h.nextIndex label) = d.rel label.2.val := - d.relations.unique - ((pairSecondField_entry_iff label.1.property label.2.val.property).1 - (next.rel_entry (h.nextIndex label))).2 (d.rel_entry label.2.val) - -theorem next_meet (label : h.toInputs.Labels) : - next.meet (h.nextIndex label) = d.meet label.2.val := - d.meets.unique - ((pairSecondField_entry_iff label.1.property label.2.val.property).1 - (next.meet_entry (h.nextIndex label))).2 (d.meet_entry label.2.val) - -theorem next_anchor (label : h.toInputs.Labels) : - next.anchor (h.nextIndex label) = d.anchor label.2.val := - d.anchors.unique - ((pairSecondField_entry_iff label.1.property label.2.val.property).1 - (next.anchor_entry (h.nextIndex label))).2 (d.anchor_entry label.2.val) - -theorem next_embed (label : h.toInputs.Labels) : - next.embed (h.nextIndex label) = relationCompose (familyPointBound Qs) D d.batchCarrier - (d.embed label.2.val) (h.maps.value label.1) := - ((pairCompositionFamily_entry_iff d.embeddings h.maps - (d.embed_entry label.2.val) (h.maps.value_entry label.1)).1 - (next.embed_entry (h.nextIndex label))).2.2 - -theorem next_filter (label : h.toInputs.Labels) : - next.filter (h.nextIndex label) = pushFilterCode d.batchCarrier d.batchOrder - (h.maps.value label.1) (d.filter label.2.val) := - ((pairPushFilterFamily_entry_iff h.maps d.filters - (h.maps.value_entry label.1) (d.filter_entry label.2.val)).1 - (next.filter_entry (h.nextIndex label))).2.2 - -noncomputable def nextFresh (q : h.toInputs.nextBatch.Fresh) : next.templates.Fresh := - ⟨h.nextIndex q.1, ⟨⟨q.2.val.val, (h.next_space M next q.1).symm ▸ q.2.val.property⟩, - fun lower => q.2.property (by - change ZFSet.pair q.2.val.val (next.anchor (h.nextIndex q.1)) ∈ - next.rel (h.nextIndex q.1) at lower - rwa [h.next_anchor M next, h.next_rel M next] at lower)⟩⟩ - -theorem nextFresh_injective : Function.Injective (h.nextFresh M next) := by - rintro ⟨a, q⟩ ⟨b, t⟩ equal - have same : a = b := h.nextIndex_injective (congrArg Sigma.fst equal) - subst b - have values : q.val.val = t.val.val := - congrArg (fun z : next.templates.Fresh => z.2.val.val) equal - exact congrArg (Sigma.mk a) (Subtype.ext (Subtype.ext values)) - -theorem nextFresh_surjective : Function.Surjective (h.nextFresh M next) := by - rintro ⟨k, q⟩ - obtain ⟨label, equal⟩ := h.nextIndex_surjective k - subst k - have member : q.val.val ∈ d.space label.2.val := - h.next_space M next label ▸ q.val.property - have outside : ZFSet.pair q.val.val (d.anchor label.2.val) ∉ d.rel label.2.val := by - intro lower - apply q.property - change ZFSet.pair q.val.val (next.anchor (h.nextIndex label)) ∈ next.rel (h.nextIndex label) - rwa [h.next_anchor M next, h.next_rel M next] - exact ⟨⟨label, ⟨⟨q.val.val, member⟩, outside⟩⟩, rfl⟩ - -theorem nextFresh_inside_iff (q t : h.toInputs.nextBatch.Fresh) : - next.templates.Inside (h.nextFresh M next q) (h.nextFresh M next t) ↔ - h.toInputs.nextBatch.Inside q t := by - rcases q with ⟨a, q⟩ - rcases t with ⟨b, t⟩ - constructor - · rintro ⟨same, lower⟩ - have eq : a = b := h.nextIndex_injective same - subst b - refine ⟨rfl, ?_⟩ - change ZFSet.pair q.val.val t.val.val ∈ next.rel (h.nextIndex a) at lower - change ZFSet.pair q.val.val t.val.val ∈ d.rel a.2.val - rwa [h.next_rel M next] at lower - · rintro ⟨same, lower⟩ - change a = b at same - subst b - refine ⟨rfl, ?_⟩ - change ZFSet.pair q.val.val t.val.val ∈ next.rel (h.nextIndex a) - rw [h.next_rel M next] - exact lower - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - - - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -noncomputable abbrev liftGraph := - liftedCompressionGraph I J D d.batchCarrier next.batchCarrier - (indexedAttachmentFresh J Qs rs As) (familyPointBound Qs) Maps Sources Fs Reps G A - -noncomputable abbrev liftSection (i : ZFSet.{u}) := - indexedRelationSection d.batchCarrier next.batchCarrier (h.liftGraph M next) i - -theorem liftGraph_function : - ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) := - liftedCompressionGraph_function rfl - (fun _ hz => indexedAttachmentDomain_subset J Qs (indexedAttachmentFresh_subset J Qs rs As hz)) - (fun _ hz => old_mem_taggedExtension hz) h.maps - (fun i S entry => (h.valid i S entry).injection.function) - h.sources d.filters h.representatives h.action.function - (fun _ _ _ _ _ _ _ _ fresh source filter negative => - negativeRecursiveFresh_mem h.sources d.filters source filter fresh negative) - -theorem liftSection_function {i : ZFSet.{u}} (hi : i ∈ I) : - ZFSet.IsFunc d.batchCarrier next.batchCarrier (h.liftSection M next i) := - indexedRelationSection_function (h.liftGraph_function M next) hi - -theorem liftGraph_old_iff {i S x y : ZFSet.{u}} - (mapEntry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : - ZFSet.pair (ZFSet.pair i x) y ∈ h.liftGraph M next ↔ ZFSet.pair x y ∈ S := by - rw [liftGraph, liftedCompressionGraph_old_iff h.maps mapEntry hx] - constructor - · exact fun entry => entry.2.2 - · intro entry - exact ⟨old_mem_taggedExtension hx, old_mem_taggedExtension - (ZFSet.pair_mem_prod.1 ((h.valid i S mapEntry).injection.function.1 entry)).2, entry⟩ - -theorem liftGraph_positive_iff {i j q a F g y : ZFSet.{u}} - (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) - (representative : ZFSet.pair i g ∈ Reps) - (fresh : ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As) (positive : a ∈ F) : - ZFSet.pair (ZFSet.pair i (ZFSet.pair D (ZFSet.pair j q))) y ∈ h.liftGraph M next ↔ - ZFSet.pair (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) y ∈ A := by - have bounds := ZFSet.pair_mem_prod.1 (indexedAttachmentDomain_subset J Qs - (indexedAttachmentFresh_subset J Qs rs As fresh)) - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - have sourceFunc : FunctionGraphOn I Sources := ⟨D, h.sources⟩ - rw [liftGraph, liftedCompressionGraph_fresh_iff sourceFunc d.filters source filter - bounds.1 bounds.2 ha fresh] - constructor - · rintro ⟨_, _, ⟨_, g', _, representative', acted⟩ | ⟨negative, _⟩⟩ - · exact (show FunctionGraphOn I Reps from ⟨G, h.representatives⟩).unique - representative' representative ▸ acted - · exact False.elim (negative positive) - · intro acted - have hy := (ZFSet.pair_mem_prod.1 (h.action.function.1 acted)).2 - exact ⟨pair_mem_taggedExtension.2 fresh, old_mem_taggedExtension hy, - Or.inl ⟨positive, g, (ZFSet.pair_mem_prod.1 (h.representatives.1 representative)).2, - representative, acted⟩⟩ - -theorem liftGraph_negative_iff {i j q a F y : ZFSet.{u}} - (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) - (fresh : ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As) (negative : a ∉ F) : - ZFSet.pair (ZFSet.pair i (ZFSet.pair D (ZFSet.pair j q))) y ∈ h.liftGraph M next ↔ - y = ZFSet.pair d.batchCarrier (ZFSet.pair (ZFSet.pair i j) q) := by - have bounds := ZFSet.pair_mem_prod.1 (indexedAttachmentDomain_subset J Qs - (indexedAttachmentFresh_subset J Qs rs As fresh)) - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - have sourceFunc : FunctionGraphOn I Sources := ⟨D, h.sources⟩ - rw [liftGraph, liftedCompressionGraph_fresh_iff sourceFunc d.filters source filter - bounds.1 bounds.2 ha fresh] - constructor - · rintro ⟨_, _, ⟨positive, _⟩ | ⟨_, equal⟩⟩ - · exact False.elim (negative positive) - · exact equal - · intro equal - exact ⟨pair_mem_taggedExtension.2 fresh, - equal.symm ▸ negativeRecursiveFresh_mem h.sources d.filters source filter fresh negative, - Or.inr ⟨negative, equal⟩⟩ - - - - - - -theorem liftGraph_agrees_on_base {i a g x y : ZFSet.{u}} - (source : ZFSet.pair i a ∈ Sources) (representative : ZFSet.pair i g ∈ Reps) - (hx : x ∈ d.batchCarrier) (below : ZFSet.pair x a ∈ d.batchOrder) : - ZFSet.pair (ZFSet.pair i x) y ∈ h.liftGraph M next ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A := by - have hi := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).1 - have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 - obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx - have lower := (d.coding.le_encode X (.inl ⟨a, ha⟩)).1 below - cases X with - | inl p => - obtain ⟨S, mapEntry⟩ := h.maps.total hi - exact (h.liftGraph_old_iff M next mapEntry p.property).trans - (h.agreement i a g S p.val y source representative mapEntry p.property lower) - | inr q => - exact h.liftGraph_positive_iff M next source (d.filter_entry q.1) representative - (d.freshCode_mem q) lower - -theorem liftSection_agrees_on_base {i a g x y : ZFSet.{u}} - (source : ZFSet.pair i a ∈ Sources) (representative : ZFSet.pair i g ∈ Reps) - (hx : x ∈ d.batchCarrier) (below : ZFSet.pair x a ∈ d.batchOrder) : - ZFSet.pair x y ∈ h.liftSection M next i ↔ - ZFSet.pair (ZFSet.pair g x) y ∈ A := by - rw [liftSection, pair_mem_indexedRelationSection, h.liftGraph_agrees_on_base M next source representative hx below] - constructor - · exact fun h => h.2.2 - · intro acted - exact ⟨hx, old_mem_taggedExtension (ZFSet.pair_mem_prod.1 (h.action.function.1 acted)).2, acted⟩ - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.CodedBatchDecoding +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPushFilterFamilyFormulas +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundVaryingFamilyEvaluation +import OAI.SetTheory.PartitionPrinciple.Geometry.DecodedMeetMaps +import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionFunctions + +namespace OAI + + +namespace PartitionPilot.Forcing + +universe u + +def recursiveAttachmentIndices (I J P U As Fs : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun k => ∃ i ∈ I, ∃ j ∈ J, ∃ a ∈ P, ∃ F ∈ U, + k = ZFSet.pair i j ∧ ZFSet.pair i a ∈ As ∧ ZFSet.pair j F ∈ Fs ∧ a ∉ F) + (ZFSet.prod I J) + +theorem recursiveAttachmentIndices_subset (I J P U As Fs : ZFSet.{u}) : + recursiveAttachmentIndices I J P U As Fs ⊆ ZFSet.prod I J := + fun _ hz => (ZFSet.mem_sep.1 hz).1 + +theorem pair_mem_recursiveAttachmentIndices (I J P U As Fs i j : ZFSet.{u}) : + ZFSet.pair i j ∈ recursiveAttachmentIndices I J P U As Fs ↔ + i ∈ I ∧ j ∈ J ∧ ∃ a ∈ P, ∃ F ∈ U, + ZFSet.pair i a ∈ As ∧ ZFSet.pair j F ∈ Fs ∧ a ∉ F := by + rw [recursiveAttachmentIndices, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hi, hj⟩, i', _, j', _, a, ha, F, hF, eq, ai, Fj, neg⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hi, hj, a, ha, F, hF, ai, Fj, neg⟩ + · rintro ⟨hi, hj, a, ha, F, hF, ai, Fj, neg⟩ + exact ⟨⟨hi, hj⟩, i, hi, j, hj, a, ha, F, hF, rfl, ai, Fj, neg⟩ + +def pairFieldGraph (left : Bool) (I J K B H : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ k ∈ K, ∃ i ∈ I, ∃ j ∈ J, ∃ x ∈ B, + z = ZFSet.pair k x ∧ k = ZFSet.pair i j ∧ + ZFSet.pair (if left then i else j) x ∈ H) (ZFSet.prod K B) + +theorem pair_mem_pairFieldGraph (left : Bool) (I J K B H k x : ZFSet.{u}) : + ZFSet.pair k x ∈ pairFieldGraph left I J K B H ↔ + k ∈ K ∧ x ∈ B ∧ ∃ i ∈ I, ∃ j ∈ J, + k = ZFSet.pair i j ∧ ZFSet.pair (if left then i else j) x ∈ H := by + rw [pairFieldGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hk, hx⟩, k', _, i, hi, j, hj, x', _, eq, kij, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hk, hx, i, hi, j, hj, kij, entry⟩ + · rintro ⟨hk, hx, i, hi, j, hj, kij, entry⟩ + exact ⟨⟨hk, hx⟩, k, hk, i, hi, j, hj, x, hx, rfl, kij, entry⟩ + +theorem pairFieldGraph_entry_iff (left : Bool) {I J K B H i j x : ZFSet.{u}} + (hi : i ∈ I) (hj : j ∈ J) : + ZFSet.pair (ZFSet.pair i j) x ∈ pairFieldGraph left I J K B H ↔ + ZFSet.pair i j ∈ K ∧ x ∈ B ∧ ZFSet.pair (if left then i else j) x ∈ H := by + rw [pair_mem_pairFieldGraph] + constructor + · rintro ⟨hk, hx, i', _, j', _, eq, entry⟩ + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq + exact ⟨hk, hx, entry⟩ + · rintro ⟨hk, hx, entry⟩ + exact ⟨hk, hx, i, hi, j, hj, rfl, entry⟩ + +theorem pairFieldGraph_function (left : Bool) {I J K B H : ZFSet.{u}} + (subset : K ⊆ ZFSet.prod I J) + (function : ZFSet.IsFunc (if left then I else J) B H) : + ZFSet.IsFunc K B (pairFieldGraph left I J K B H) := by + refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩ + intro k hk + obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) + have hs : (if left then i else j) ∈ (if left then I else J) := by + cases left <;> assumption + obtain ⟨x, entry, unique⟩ := function.2 _ hs + have hx := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + refine ⟨x, (pairFieldGraph_entry_iff left hi hj).2 ⟨hk, hx, entry⟩, ?_⟩ + intro y hy + exact unique y ((pairFieldGraph_entry_iff left hi hj).1 hy).2.2 + + + + + + +namespace BoundedFormula + +open SetFormula + +def recursiveAttachmentIndexFormula {n} (k i j p u a f : Fin n) : BoundedFormula n := + exMem i (exMem j.succ (exMem p.succ.succ (exMem u.succ.succ.succ + (.conj (orderedPairFormula k.succ.succ.succ.succ 3 2) + (.conj (pairMembershipFormula 3 1 a.succ.succ.succ.succ) + (.conj (pairMembershipFormula 2 0 f.succ.succ.succ.succ) (.neg (.mem 1 0)))))))) + +theorem truth_recursiveAttachmentIndexFormula {n} (k i j p u a f : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (recursiveAttachmentIndexFormula k i j p u a f) env ↔ + ∃ x ∈ env i, ∃ y ∈ env j, ∃ b ∈ env p, ∃ F ∈ env u, + env k = ZFSet.pair x y ∧ ZFSet.pair x b ∈ env a ∧ + ZFSet.pair y F ∈ env f ∧ b ∉ F := by + simp only [recursiveAttachmentIndexFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula] + rfl + +def pairFieldEntryFormula {n} (left : Bool) (z k i j b h : Fin n) : BoundedFormula n := + exMem k (exMem i.succ (exMem j.succ.succ (exMem b.succ.succ.succ + (.conj (orderedPairFormula z.succ.succ.succ.succ 3 0) + (.conj (orderedPairFormula 3 2 1) + (pairMembershipFormula (if left then 2 else 1) 0 h.succ.succ.succ.succ)))))) + +theorem truth_pairFieldEntryFormula {n} (left : Bool) (z k i j b h : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (pairFieldEntryFormula left z k i j b h) env ↔ + ∃ t ∈ env k, ∃ x ∈ env i, ∃ y ∈ env j, ∃ v ∈ env b, + env z = ZFSet.pair t v ∧ t = ZFSet.pair x y ∧ + ZFSet.pair (if left then x else y) v ∈ env h := by + cases left <;> + simp only [pairFieldEntryFormula, truth_exMem, Truth, + truth_orderedPairFormula, truth_pairMembershipFormula, Bool.false_eq_true, ↓reduceIte] <;> rfl + +end BoundedFormula + +namespace TransitiveGround + +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem recursiveAttachmentIndices_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I J P U As Fs : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) + (hP : P ∈ M.sets) (hU : U ∈ M.sets) (hAs : As ∈ M.sets) (hFs : Fs ∈ M.sets) : + recursiveAttachmentIndices I J P U As Fs ∈ M.sets := by + let params := extend I (extend J (extend P (extend U (extend As (extend Fs Fin.elim0))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.recursiveAttachmentIndexFormula 0 1 2 3 4 5 6) params + (Fin.cases hI (Fin.cases hJ (Fin.cases hP (Fin.cases hU (Fin.cases hAs + (Fin.cases hFs (fun i => Fin.elim0 i))))))) + (M.prod_mem pairing unions powers separation hI hJ) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.recursiveAttachmentIndexFormula 0 1 2 3 4 5 6) (extend z params)) + (ZFSet.prod I J) = recursiveAttachmentIndices I J P U As Fs := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, recursiveAttachmentIndices, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_recursiveAttachmentIndexFormula 0 1 2 3 4 5 6 _) + exact equal ▸ selected + +theorem pairFieldGraph_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (left : Bool) {I J K B H : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) + (hK : K ∈ M.sets) (hB : B ∈ M.sets) (hH : H ∈ M.sets) : + pairFieldGraph left I J K B H ∈ M.sets := by + let params := extend K (extend I (extend J (extend B (extend H Fin.elim0)))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.pairFieldEntryFormula left 0 1 2 3 4 5) params + (Fin.cases hK (Fin.cases hI (Fin.cases hJ (Fin.cases hB + (Fin.cases hH (fun i => Fin.elim0 i)))))) + (M.prod_mem pairing unions powers separation hK hB) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.pairFieldEntryFormula left 0 1 2 3 4 5) (extend z params)) + (ZFSet.prod K B) = pairFieldGraph left I J K B H := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, pairFieldGraph, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_pairFieldEntryFormula left 0 1 2 3 4 5 _) + exact equal ▸ selected + +theorem pairFieldGraph_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (left : Bool) {I J K H : ZFSet.{u}} (hI : I ∈ M.sets) (hJ : J ∈ M.sets) + (hK : K ∈ M.sets) (hH : H ∈ M.sets) (subset : K ⊆ ZFSet.prod I J) + (function : FunctionGraphOn (if left then I else J) H) : + pairFieldGraph left I J K (ZFSet.sUnion (ZFSet.sUnion H)) H ∈ M.sets ∧ + FunctionGraphOn K (pairFieldGraph left I J K (ZFSet.sUnion (ZFSet.sUnion H)) H) ∧ + ∀ i ∈ I, ∀ j ∈ J, ∀ x, + ZFSet.pair (ZFSet.pair i j) x ∈ pairFieldGraph left I J K (ZFSet.sUnion (ZFSet.sUnion H)) H ↔ + ZFSet.pair i j ∈ K ∧ ZFSet.pair (if left then i else j) x ∈ H := by + refine ⟨M.pairFieldGraph_mem pairing unions powers separation left hI hJ hK + (M.union_mem unions (M.union_mem unions hH)) hH, + ⟨_, pairFieldGraph_function left subset function.to_isFunc⟩, ?_⟩ + intro i hi j hj x + rw [pairFieldGraph_entry_iff left hi hj] + exact ⟨fun h => ⟨h.1, h.2.2⟩, + fun h => ⟨h.1, pair_second_mem_doubleUnion h.2, h.2⟩⟩ + +end TransitiveGround + + + + + + +def pairSecondField (I J K H : ZFSet.{u}) : ZFSet.{u} := + pairFieldGraph false I J K (ZFSet.sUnion (ZFSet.sUnion H)) H + +def pairFirstField (I J K H : ZFSet.{u}) : ZFSet.{u} := + pairFieldGraph true I J K (ZFSet.sUnion (ZFSet.sUnion H)) H + +def recursiveSeparatorFamily (K I J D L Maps Ss : ZFSet.{u}) : ZFSet.{u} := + familyEvaluationGraph K D L (ZFSet.sUnion (ZFSet.sUnion Maps)) + (pairFirstField I J K Maps) (pairFieldGraph false I J K D Ss) + +theorem pairSecondField_entry_iff {I J K H i j x : ZFSet.{u}} + (hi : i ∈ I) (hj : j ∈ J) : + ZFSet.pair (ZFSet.pair i j) x ∈ pairSecondField I J K H ↔ + ZFSet.pair i j ∈ K ∧ ZFSet.pair j x ∈ H := by + rw [pairSecondField, pairFieldGraph_entry_iff false hi hj] + exact ⟨fun h => ⟨h.1, h.2.2⟩, + fun h => ⟨h.1, pair_second_mem_doubleUnion h.2, h.2⟩⟩ + +theorem pairFirstField_entry_iff {I J K H i j x : ZFSet.{u}} + (hi : i ∈ I) (hj : j ∈ J) : + ZFSet.pair (ZFSet.pair i j) x ∈ pairFirstField I J K H ↔ + ZFSet.pair i j ∈ K ∧ ZFSet.pair i x ∈ H := by + rw [pairFirstField, pairFieldGraph_entry_iff true hi hj] + exact ⟨fun h => ⟨h.1, h.2.2⟩, + fun h => ⟨h.1, pair_second_mem_doubleUnion h.2, h.2⟩⟩ + +theorem AttachmentBatchInputs.separator_function + {D rD μD J Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) : ZFSet.IsFunc J D Ss := by + refine ⟨?_, d.separators.to_isFunc.2⟩ + intro z hz + obtain ⟨j, hj, e, rfl⟩ := d.separators.shape z hz + have equal := d.separators.value_eq_of_entry ⟨j, hj⟩ hz + exact ZFSet.pair_mem_prod.2 ⟨hj, equal ▸ (d.fiber ⟨j, hj⟩).separator_mem⟩ + +theorem recursiveSeparatorFamily_function {K I J D L Maps Ss : ZFSet.{u}} + (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Maps) + (separators : ZFSet.IsFunc J D Ss) + (valid : ∀ i S, ZFSet.pair i S ∈ Maps → ZFSet.IsFunc D L S) : + ZFSet.IsFunc K L (recursiveSeparatorFamily K I J D L Maps Ss) := by + apply familyEvaluationGraph_function (pairFieldGraph_function true subset maps.to_isFunc) + (pairFieldGraph_function false subset separators) + intro k S entry + obtain ⟨_, _, i, hi, j, hj, rfl, selected⟩ := (pair_mem_pairFieldGraph true _ _ _ _ _ _ _).1 entry + exact valid i S selected + +theorem recursiveSeparatorFamily_entry_iff {K I J D L Maps Ss i j S e y : ZFSet.{u}} + (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Maps) + (separators : ZFSet.IsFunc J D Ss) (hk : ZFSet.pair i j ∈ K) + (mapEntry : ZFSet.pair i S ∈ Maps) (sepEntry : ZFSet.pair j e ∈ Ss) : + ZFSet.pair (ZFSet.pair i j) y ∈ recursiveSeparatorFamily K I J D L Maps Ss ↔ + y ∈ L ∧ ZFSet.pair e y ∈ S := by + have shape := ZFSet.pair_mem_prod.1 (subset hk) + exact familyEvaluationGraph_entry_iff + (pairFieldGraph_function true subset maps.to_isFunc) + (pairFieldGraph_function false subset separators) + ((pairFirstField_entry_iff shape.1 shape.2).2 ⟨hk, mapEntry⟩) + ((pairFieldGraph_entry_iff false shape.1 shape.2).2 + ⟨hk, (ZFSet.pair_mem_prod.1 (separators.1 sepEntry)).2, sepEntry⟩) + +theorem recursiveAttachmentIndices_entry_iff {I J D U Sources Fs i j a F : ZFSet.{u}} + (sources : ZFSet.IsFunc I D Sources) (filters : ZFSet.IsFunc J U Fs) + (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) : + ZFSet.pair i j ∈ recursiveAttachmentIndices I J D U Sources Fs ↔ a ∉ F := by + rw [pair_mem_recursiveAttachmentIndices] + constructor + · rintro ⟨_, _, b, _, V, _, ib, jV, negative⟩ + have equalA := (show FunctionGraphOn I Sources from ⟨D, sources⟩).unique ib source + have equalF := (show FunctionGraphOn J Fs from ⟨U, filters⟩).unique jV filter + exact equalA ▸ equalF ▸ negative + · intro negative + have sa := ZFSet.pair_mem_prod.1 (sources.1 source) + have sf := ZFSet.pair_mem_prod.1 (filters.1 filter) + exact ⟨sa.1, sf.1, a, sa.2, F, sf.2, source, filter, negative⟩ + + + + + + +theorem recursiveFresh_iff {I J K Qs rs As i j q : ZFSet.{u}} + (hi : i ∈ I) (hj : j ∈ J) : + ZFSet.pair (ZFSet.pair i j) q ∈ indexedAttachmentFresh K + (pairSecondField I J K Qs) (pairSecondField I J K rs) (pairSecondField I J K As) ↔ + ZFSet.pair i j ∈ K ∧ ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As := by + rw [pair_mem_indexedAttachmentFresh, pair_mem_indexedAttachmentFresh] + constructor + · rintro ⟨hk, Q, r, a, eq, er, ea, hq, fresh⟩ + exact ⟨hk, hj, Q, r, a, ((pairSecondField_entry_iff hi hj).1 eq).2, + ((pairSecondField_entry_iff hi hj).1 er).2, + ((pairSecondField_entry_iff hi hj).1 ea).2, hq, fresh⟩ + · rintro ⟨hk, _, Q, r, a, eq, er, ea, hq, fresh⟩ + exact ⟨hk, Q, r, a, (pairSecondField_entry_iff hi hj).2 ⟨hk, eq⟩, + (pairSecondField_entry_iff hi hj).2 ⟨hk, er⟩, + (pairSecondField_entry_iff hi hj).2 ⟨hk, ea⟩, hq, fresh⟩ + +theorem recursiveFresh_shape {I J K Qs rs As z : ZFSet.{u}} + (subset : K ⊆ ZFSet.prod I J) + (fresh : z ∈ indexedAttachmentFresh K + (pairSecondField I J K Qs) (pairSecondField I J K rs) (pairSecondField I J K As)) : + ∃ i ∈ I, ∃ j ∈ J, ∃ q, z = ZFSet.pair (ZFSet.pair i j) q ∧ + ZFSet.pair i j ∈ K ∧ ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As := by + obtain ⟨k, hk, q, rfl, _⟩ := (mem_indexedAttachmentFresh _ _ _ _ z).1 fresh + obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) + exact ⟨i, hi, j, hj, q, rfl, (recursiveFresh_iff hi hj).1 fresh⟩ + +theorem negativeRecursiveFresh_mem + {I J D L Qs rs As Sources Fs i j q a F : ZFSet.{u}} + (sources : ZFSet.IsFunc I D Sources) (filters : FunctionGraphOn J Fs) + (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) + (fresh : ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As) (negative : a ∉ F) : + let K := recursiveAttachmentIndices I J D (ZFSet.sUnion (ZFSet.sUnion Fs)) Sources Fs + ZFSet.pair L (ZFSet.pair (ZFSet.pair i j) q) ∈ taggedExtension L + (indexedAttachmentFresh K (pairSecondField I J K Qs) + (pairSecondField I J K rs) (pairSecondField I J K As)) := by + apply pair_mem_taggedExtension.2 + apply (recursiveFresh_iff (ZFSet.pair_mem_prod.1 (sources.1 source)).1 (filters.pair_source filter)).2 + exact ⟨(recursiveAttachmentIndices_entry_iff sources filters.to_isFunc source filter).2 negative, fresh⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem recursiveSeparatorFamily_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {K I J D L Maps Ss : ZFSet.{u}} (hK : K ∈ M.sets) (hI : I ∈ M.sets) + (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hL : L ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSs : Ss ∈ M.sets) : + recursiveSeparatorFamily K I J D L Maps Ss ∈ M.sets := by + have bound := M.union_mem unions (M.union_mem unions hMaps) + exact M.familyEvaluationGraph_mem pairing unions powers separation hK hD hL bound + (M.pairFieldGraph_mem pairing unions powers separation true hI hJ hK bound hMaps) + (M.pairFieldGraph_mem pairing unions powers separation false hI hJ hK hD hSs) + +theorem groundRecursiveBatchInputs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {K I J D L rD rL μD μL Qs rs μs As Es Fs Ss Maps : ZFSet.{u}} + (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) + (target : MeetOrderCode L rL μL) (maps : FunctionGraphOn I Maps) + (valid : ∀ i S, ZFSet.pair i S ∈ Maps → MeetEmbeddingCode D L rD rL μD μL S) + (subset : K ⊆ ZFSet.prod I J) + (hK : K ∈ M.sets) (hI : I ∈ M.sets) (hJ : J ∈ M.sets) + (hD : D ∈ M.sets) (hL : L ∈ M.sets) (hrL : rL ∈ M.sets) + (hQs : Qs ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) + (hMaps : Maps ∈ M.sets) : + AttachmentBatchInputs L rL μL K + (pairSecondField I J K Qs) (pairSecondField I J K rs) + (pairSecondField I J K μs) (pairSecondField I J K As) + (M.groundPairCompositions K I J (familyPointBound Qs) D L Es Maps) + (M.groundPairPushFilters K I J L rL Maps Fs) + (recursiveSeparatorFamily K I J D L Maps Ss) := by + obtain ⟨_, composites, compositeEntries⟩ := M.groundPairCompositions_spec + pairing unions powers separation hK hI hJ (M.familyPointBound_mem unions hQs) + hD hL hEs hMaps d.embeddings maps subset + obtain ⟨_, filters, filterEntries⟩ := M.groundPairPushFilters_spec + pairing unions powers separation hK hI hJ hL hrL hMaps hFs maps d.filters subset + refine ⟨target, ⟨_, pairFieldGraph_function false subset d.spaces.to_isFunc⟩, + ⟨_, pairFieldGraph_function false subset d.relations.to_isFunc⟩, + ⟨_, pairFieldGraph_function false subset d.meets.to_isFunc⟩, + ⟨_, pairFieldGraph_function false subset d.anchors.to_isFunc⟩, + ⟨_, composites⟩, ⟨_, filters⟩, + ⟨_, recursiveSeparatorFamily_function subset maps d.separator_function + (fun i S entry => (valid i S entry).injection.function)⟩, ?_⟩ + intro k hk Q r μ a ell' F' e' qEntry rEntry μEntry aEntry ellEntry FEntry eEntry + obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk) + have qOriginal := ((pairSecondField_entry_iff hi hj).1 qEntry).2 + have rOriginal := ((pairSecondField_entry_iff hi hj).1 rEntry).2 + have μOriginal := ((pairSecondField_entry_iff hi hj).1 μEntry).2 + have aOriginal := ((pairSecondField_entry_iff hi hj).1 aEntry).2 + obtain ⟨ell, oldEll⟩ := d.embeddings.total hj + obtain ⟨F, oldF⟩ := d.filters.total hj + obtain ⟨e, oldE⟩ := d.separators.total hj + obtain ⟨S, oldS⟩ := maps.total hi + have old := d.valid j hj Q r μ a ell F e qOriginal rOriginal μOriginal aOriginal oldEll oldF oldE + have ellEq := ((compositeEntries i j ell S ell' oldEll oldS).1 ellEntry).2 + have filterEq := ((filterEntries i j S F F' oldS oldF).1 FEntry).2 + have image := ((recursiveSeparatorFamily_entry_iff subset maps d.separator_function hk oldS oldE).1 eEntry).2 + have domainEq : relationCompose (familyPointBound Qs) D L ell S = + relationCompose (attachmentIdeal Q r a) D L ell S := + relationCompose_domain_eq + (fun _ hz => mem_familyPointBound_of_entry qOriginal ((mem_attachmentIdeal Q r a _).1 hz).1) + old.base_function.1 + rw [ellEq, domainEq, filterEq] + exact old.pushforward target (valid i S oldS) image + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing + +open Compression.RecursiveMaps +universe u + +structure CodedRecursiveMapInputs + {D rD μD J Qs rs μs As Es Fs Ss : ZFSet.{u}} + (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) + (I Maps Sources Reps G m inv one A : ZFSet.{u}) : Prop where + maps : FunctionGraphOn I Maps + sources : ZFSet.IsFunc I D Sources + representatives : ZFSet.IsFunc I G Reps + group : GroupCode G m inv one + action : PosetActionCode G d.batchCarrier m one d.batchOrder A + valid : ∀ i S, ZFSet.pair i S ∈ Maps → + MeetEmbeddingCode D d.batchCarrier rD d.batchOrder μD d.batchMeetGraph S + agreement : ∀ i a g S x y, ZFSet.pair i a ∈ Sources → ZFSet.pair i g ∈ Reps → + ZFSet.pair i S ∈ Maps → x ∈ D → ZFSet.pair x a ∈ rD → + (ZFSet.pair x y ∈ S ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A) + +namespace CodedRecursiveMapInputs + +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) + +noncomputable def source (i : {i : ZFSet.{u} // i ∈ I}) : {x : ZFSet.{u} // x ∈ D} := + let graph : FunctionGraphOn I Sources := ⟨D, h.sources⟩ + ⟨graph.value i, (ZFSet.pair_mem_prod.1 (h.sources.1 (graph.value_entry i))).2⟩ + +theorem source_entry (i : {i : ZFSet.{u} // i ∈ I}) : + ZFSet.pair i.val (h.source i).val ∈ Sources := + (show FunctionGraphOn I Sources from ⟨D, h.sources⟩).value_entry i + +noncomputable def actor (i : {i : ZFSet.{u} // i ∈ I}) : {g : ZFSet.{u} // g ∈ G} := + let graph : FunctionGraphOn I Reps := ⟨G, h.representatives⟩ + ⟨graph.value i, (ZFSet.pair_mem_prod.1 (h.representatives.1 (graph.value_entry i))).2⟩ + +theorem actor_entry (i : {i : ZFSet.{u} // i ∈ I}) : ZFSet.pair i.val (h.actor i).val ∈ Reps := + (show FunctionGraphOn I Reps from ⟨G, h.representatives⟩).value_entry i + +noncomputable def previous (i : {i : ZFSet.{u} // i ∈ I}) : + MeetEmbedding d.oldOrder.toMeetOrder d.templates.extension := + compose ((h.valid i.val _ (h.maps.value_entry i)).toMeetEmbedding d.oldOrder d.batch_meetOrder) + d.coding.decodingIso.toMeetEmbedding + +theorem previous_entry (i : {i : ZFSet.{u} // i ∈ I}) (x : {x : ZFSet.{u} // x ∈ D}) : + ZFSet.pair x.val (d.coding.encode ((h.previous i).toFun x)) ∈ h.maps.value i := by + change ZFSet.pair x.val (d.coding.encode (d.coding.decodingIso.toFun + (((h.valid i.val _ (h.maps.value_entry i)).toMeetEmbedding d.oldOrder d.batch_meetOrder).toFun x))) ∈ _ + rw [d.coding.decodingIso_encode] + exact (h.valid i.val _ (h.maps.value_entry i)).toMeetEmbedding_entry d.oldOrder d.batch_meetOrder x + +noncomputable def representative (i : {i : ZFSet.{u} // i ∈ I}) : + Compression.MeetIso d.templates.extension d.templates.extension := by + let encoding := d.coding.encodingIso + let acted := h.action.toMeetIso h.group d.batch_meetOrder (h.actor i) + refine isoOfOrder + (fun x => encoding.inverse (acted.toFun (encoding.toFun x))) + (fun x => encoding.inverse (acted.inverse (encoding.toFun x))) ?_ ?_ ?_ + · intro x + rw [encoding.right_inverse, acted.left_inverse, encoding.left_inverse] + · intro x + rw [encoding.right_inverse, acted.right_inverse, encoding.left_inverse] + · intro x y + exact ((inverseIso encoding).le_iff _ _).trans + ((acted.le_iff _ _).trans (encoding.le_iff x y)) + +theorem representative_entry (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + ZFSet.pair (ZFSet.pair (h.actor i).val (d.coding.encode x)) + (d.coding.encode ((h.representative i).toFun x)) ∈ A := by + change ZFSet.pair (ZFSet.pair (h.actor i).val (d.coding.encode x)) + (d.coding.encode (d.coding.decode + ((h.action.toMeetIso h.group d.batch_meetOrder (h.actor i)).toFun + ⟨d.coding.encode x, d.coding.encode_mem x⟩))) ∈ A + rw [d.coding.encode_decode] + exact h.action.toMeetIso_entry h.group d.batch_meetOrder (h.actor i) + ⟨d.coding.encode x, d.coding.encode_mem x⟩ + +noncomputable def toInputs : Inputs d.templates {i : ZFSet.{u} // i ∈ I} where + source := h.source + previous := h.previous + representative := h.representative + agree := by + intro i x lower + apply d.coding.encode_injective + have previous := (h.agreement i.val (h.source i).val (h.actor i).val (h.maps.value i) + x.val _ (h.source_entry i) (h.actor_entry i) (h.maps.value_entry i) x.property lower).1 + (h.previous_entry i x) + exact (show FunctionGraphOn (ZFSet.prod G d.batchCarrier) A from + ⟨d.batchCarrier, h.action.function⟩).unique previous (h.representative_entry i (.inl x)) + +theorem toInputs_source (i : {i : ZFSet.{u} // i ∈ I}) : h.toInputs.source i = h.source i := rfl + +theorem toInputs_previous_entry (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D}) : + ZFSet.pair x.val (d.coding.encode ((h.toInputs.previous i).toFun x)) ∈ h.maps.value i := + h.previous_entry i x + +theorem toInputs_representative_entry (i : {i : ZFSet.{u} // i ∈ I}) + (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) : + ZFSet.pair (ZFSet.pair (h.actor i).val (d.coding.encode x)) + (d.coding.encode ((h.toInputs.representative i).toFun x)) ∈ A := + h.representative_entry i x + +end CodedRecursiveMapInputs + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +open Compression.RecursiveMaps +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) + +noncomputable abbrev nextIndices (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) := + recursiveAttachmentIndices I J D (ZFSet.sUnion (ZFSet.sUnion Fs)) Sources Fs + +noncomputable abbrev NextInputs (M : TransitiveGround.{u}) := + AttachmentBatchInputs d.batchCarrier d.batchOrder d.batchMeetGraph h.nextIndices + (pairSecondField I J h.nextIndices Qs) (pairSecondField I J h.nextIndices rs) + (pairSecondField I J h.nextIndices μs) (pairSecondField I J h.nextIndices As) + (M.groundPairCompositions h.nextIndices I J (familyPointBound Qs) D d.batchCarrier Es Maps) + (M.groundPairPushFilters h.nextIndices I J d.batchCarrier d.batchOrder Maps Fs) + (recursiveSeparatorFamily h.nextIndices I J D d.batchCarrier Maps Ss) + +noncomputable def nextIndex (label : h.toInputs.Labels) : + {k : ZFSet.{u} // k ∈ h.nextIndices} := + ⟨ZFSet.pair label.1.val label.2.val.val, + (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc + (h.source_entry label.1) (d.filter_entry label.2.val)).2 label.2.property⟩ + +theorem nextIndex_injective : Function.Injective h.nextIndex := by + rintro ⟨i, j⟩ ⟨i', j'⟩ equal + have parts := ZFSet.pair_inj.1 (congrArg Subtype.val equal) + have left : i = i' := Subtype.ext parts.1 + subst i' + have right : j = j' := Subtype.ext (Subtype.ext parts.2) + subst j' + rfl + +theorem nextIndex_surjective : Function.Surjective h.nextIndex := by + intro k + obtain ⟨i, hi, j, hj, equal⟩ := ZFSet.mem_prod.1 + (recursiveAttachmentIndices_subset I J D (ZFSet.sUnion (ZFSet.sUnion Fs)) Sources Fs k.property) + let i' : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + let j' : {j : ZFSet.{u} // j ∈ J} := ⟨j, hj⟩ + have negative : ¬ d.templates.upper j' (h.toInputs.source i') := + (recursiveAttachmentIndices_entry_iff h.sources d.filters.to_isFunc + (h.source_entry i') (d.filter_entry j')).1 (equal ▸ k.property) + exact ⟨⟨i', ⟨j', negative⟩⟩, Subtype.ext equal.symm⟩ + +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +theorem next_space (label : h.toInputs.Labels) : + next.space (h.nextIndex label) = d.space label.2.val := + d.spaces.unique + ((pairSecondField_entry_iff label.1.property label.2.val.property).1 + (next.space_entry (h.nextIndex label))).2 (d.space_entry label.2.val) + +theorem next_rel (label : h.toInputs.Labels) : + next.rel (h.nextIndex label) = d.rel label.2.val := + d.relations.unique + ((pairSecondField_entry_iff label.1.property label.2.val.property).1 + (next.rel_entry (h.nextIndex label))).2 (d.rel_entry label.2.val) + +theorem next_meet (label : h.toInputs.Labels) : + next.meet (h.nextIndex label) = d.meet label.2.val := + d.meets.unique + ((pairSecondField_entry_iff label.1.property label.2.val.property).1 + (next.meet_entry (h.nextIndex label))).2 (d.meet_entry label.2.val) + +theorem next_anchor (label : h.toInputs.Labels) : + next.anchor (h.nextIndex label) = d.anchor label.2.val := + d.anchors.unique + ((pairSecondField_entry_iff label.1.property label.2.val.property).1 + (next.anchor_entry (h.nextIndex label))).2 (d.anchor_entry label.2.val) + +theorem next_embed (label : h.toInputs.Labels) : + next.embed (h.nextIndex label) = relationCompose (familyPointBound Qs) D d.batchCarrier + (d.embed label.2.val) (h.maps.value label.1) := + ((pairCompositionFamily_entry_iff d.embeddings h.maps + (d.embed_entry label.2.val) (h.maps.value_entry label.1)).1 + (next.embed_entry (h.nextIndex label))).2.2 + +theorem next_filter (label : h.toInputs.Labels) : + next.filter (h.nextIndex label) = pushFilterCode d.batchCarrier d.batchOrder + (h.maps.value label.1) (d.filter label.2.val) := + ((pairPushFilterFamily_entry_iff h.maps d.filters + (h.maps.value_entry label.1) (d.filter_entry label.2.val)).1 + (next.filter_entry (h.nextIndex label))).2.2 + +noncomputable def nextFresh (q : h.toInputs.nextBatch.Fresh) : next.templates.Fresh := + ⟨h.nextIndex q.1, ⟨⟨q.2.val.val, (h.next_space M next q.1).symm ▸ q.2.val.property⟩, + fun lower => q.2.property (by + change ZFSet.pair q.2.val.val (next.anchor (h.nextIndex q.1)) ∈ + next.rel (h.nextIndex q.1) at lower + rwa [h.next_anchor M next, h.next_rel M next] at lower)⟩⟩ + +theorem nextFresh_injective : Function.Injective (h.nextFresh M next) := by + rintro ⟨a, q⟩ ⟨b, t⟩ equal + have same : a = b := h.nextIndex_injective (congrArg Sigma.fst equal) + subst b + have values : q.val.val = t.val.val := + congrArg (fun z : next.templates.Fresh => z.2.val.val) equal + exact congrArg (Sigma.mk a) (Subtype.ext (Subtype.ext values)) + +theorem nextFresh_surjective : Function.Surjective (h.nextFresh M next) := by + rintro ⟨k, q⟩ + obtain ⟨label, equal⟩ := h.nextIndex_surjective k + subst k + have member : q.val.val ∈ d.space label.2.val := + h.next_space M next label ▸ q.val.property + have outside : ZFSet.pair q.val.val (d.anchor label.2.val) ∉ d.rel label.2.val := by + intro lower + apply q.property + change ZFSet.pair q.val.val (next.anchor (h.nextIndex label)) ∈ next.rel (h.nextIndex label) + rwa [h.next_anchor M next, h.next_rel M next] + exact ⟨⟨label, ⟨⟨q.val.val, member⟩, outside⟩⟩, rfl⟩ + +theorem nextFresh_inside_iff (q t : h.toInputs.nextBatch.Fresh) : + next.templates.Inside (h.nextFresh M next q) (h.nextFresh M next t) ↔ + h.toInputs.nextBatch.Inside q t := by + rcases q with ⟨a, q⟩ + rcases t with ⟨b, t⟩ + constructor + · rintro ⟨same, lower⟩ + have eq : a = b := h.nextIndex_injective same + subst b + refine ⟨rfl, ?_⟩ + change ZFSet.pair q.val.val t.val.val ∈ next.rel (h.nextIndex a) at lower + change ZFSet.pair q.val.val t.val.val ∈ d.rel a.2.val + rwa [h.next_rel M next] at lower + · rintro ⟨same, lower⟩ + change a = b at same + subst b + refine ⟨rfl, ?_⟩ + change ZFSet.pair q.val.val t.val.val ∈ next.rel (h.nextIndex a) + rw [h.next_rel M next] + exact lower + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + + + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +noncomputable abbrev liftGraph := + liftedCompressionGraph I J D d.batchCarrier next.batchCarrier + (indexedAttachmentFresh J Qs rs As) (familyPointBound Qs) Maps Sources Fs Reps G A + +noncomputable abbrev liftSection (i : ZFSet.{u}) := + indexedRelationSection d.batchCarrier next.batchCarrier (h.liftGraph M next) i + +theorem liftGraph_function : + ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) := + liftedCompressionGraph_function rfl + (fun _ hz => indexedAttachmentDomain_subset J Qs (indexedAttachmentFresh_subset J Qs rs As hz)) + (fun _ hz => old_mem_taggedExtension hz) h.maps + (fun i S entry => (h.valid i S entry).injection.function) + h.sources d.filters h.representatives h.action.function + (fun _ _ _ _ _ _ _ _ fresh source filter negative => + negativeRecursiveFresh_mem h.sources d.filters source filter fresh negative) + +theorem liftSection_function {i : ZFSet.{u}} (hi : i ∈ I) : + ZFSet.IsFunc d.batchCarrier next.batchCarrier (h.liftSection M next i) := + indexedRelationSection_function (h.liftGraph_function M next) hi + +theorem liftGraph_old_iff {i S x y : ZFSet.{u}} + (mapEntry : ZFSet.pair i S ∈ Maps) (hx : x ∈ D) : + ZFSet.pair (ZFSet.pair i x) y ∈ h.liftGraph M next ↔ ZFSet.pair x y ∈ S := by + rw [liftGraph, liftedCompressionGraph_old_iff h.maps mapEntry hx] + constructor + · exact fun entry => entry.2.2 + · intro entry + exact ⟨old_mem_taggedExtension hx, old_mem_taggedExtension + (ZFSet.pair_mem_prod.1 ((h.valid i S mapEntry).injection.function.1 entry)).2, entry⟩ + +theorem liftGraph_positive_iff {i j q a F g y : ZFSet.{u}} + (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) + (representative : ZFSet.pair i g ∈ Reps) + (fresh : ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As) (positive : a ∈ F) : + ZFSet.pair (ZFSet.pair i (ZFSet.pair D (ZFSet.pair j q))) y ∈ h.liftGraph M next ↔ + ZFSet.pair (ZFSet.pair g (ZFSet.pair D (ZFSet.pair j q))) y ∈ A := by + have bounds := ZFSet.pair_mem_prod.1 (indexedAttachmentDomain_subset J Qs + (indexedAttachmentFresh_subset J Qs rs As fresh)) + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + have sourceFunc : FunctionGraphOn I Sources := ⟨D, h.sources⟩ + rw [liftGraph, liftedCompressionGraph_fresh_iff sourceFunc d.filters source filter + bounds.1 bounds.2 ha fresh] + constructor + · rintro ⟨_, _, ⟨_, g', _, representative', acted⟩ | ⟨negative, _⟩⟩ + · exact (show FunctionGraphOn I Reps from ⟨G, h.representatives⟩).unique + representative' representative ▸ acted + · exact False.elim (negative positive) + · intro acted + have hy := (ZFSet.pair_mem_prod.1 (h.action.function.1 acted)).2 + exact ⟨pair_mem_taggedExtension.2 fresh, old_mem_taggedExtension hy, + Or.inl ⟨positive, g, (ZFSet.pair_mem_prod.1 (h.representatives.1 representative)).2, + representative, acted⟩⟩ + +theorem liftGraph_negative_iff {i j q a F y : ZFSet.{u}} + (source : ZFSet.pair i a ∈ Sources) (filter : ZFSet.pair j F ∈ Fs) + (fresh : ZFSet.pair j q ∈ indexedAttachmentFresh J Qs rs As) (negative : a ∉ F) : + ZFSet.pair (ZFSet.pair i (ZFSet.pair D (ZFSet.pair j q))) y ∈ h.liftGraph M next ↔ + y = ZFSet.pair d.batchCarrier (ZFSet.pair (ZFSet.pair i j) q) := by + have bounds := ZFSet.pair_mem_prod.1 (indexedAttachmentDomain_subset J Qs + (indexedAttachmentFresh_subset J Qs rs As fresh)) + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + have sourceFunc : FunctionGraphOn I Sources := ⟨D, h.sources⟩ + rw [liftGraph, liftedCompressionGraph_fresh_iff sourceFunc d.filters source filter + bounds.1 bounds.2 ha fresh] + constructor + · rintro ⟨_, _, ⟨positive, _⟩ | ⟨_, equal⟩⟩ + · exact False.elim (negative positive) + · exact equal + · intro equal + exact ⟨pair_mem_taggedExtension.2 fresh, + equal.symm ▸ negativeRecursiveFresh_mem h.sources d.filters source filter fresh negative, + Or.inr ⟨negative, equal⟩⟩ + + + + + + +theorem liftGraph_agrees_on_base {i a g x y : ZFSet.{u}} + (source : ZFSet.pair i a ∈ Sources) (representative : ZFSet.pair i g ∈ Reps) + (hx : x ∈ d.batchCarrier) (below : ZFSet.pair x a ∈ d.batchOrder) : + ZFSet.pair (ZFSet.pair i x) y ∈ h.liftGraph M next ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A := by + have hi := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).1 + have ha := (ZFSet.pair_mem_prod.1 (h.sources.1 source)).2 + obtain ⟨X, rfl⟩ := d.coding.encode_surjective x hx + have lower := (d.coding.le_encode X (.inl ⟨a, ha⟩)).1 below + cases X with + | inl p => + obtain ⟨S, mapEntry⟩ := h.maps.total hi + exact (h.liftGraph_old_iff M next mapEntry p.property).trans + (h.agreement i a g S p.val y source representative mapEntry p.property lower) + | inr q => + exact h.liftGraph_positive_iff M next source (d.filter_entry q.1) representative + (d.freshCode_mem q) lower + +theorem liftSection_agrees_on_base {i a g x y : ZFSet.{u}} + (source : ZFSet.pair i a ∈ Sources) (representative : ZFSet.pair i g ∈ Reps) + (hx : x ∈ d.batchCarrier) (below : ZFSet.pair x a ∈ d.batchOrder) : + ZFSet.pair x y ∈ h.liftSection M next i ↔ + ZFSet.pair (ZFSet.pair g x) y ∈ A := by + rw [liftSection, pair_mem_indexedRelationSection, h.liftGraph_agrees_on_base M next source representative hx below] + constructor + · exact fun h => h.2.2 + · intro acted + exact ⟨hx, old_mem_taggedExtension (ZFSet.pair_mem_prod.1 (h.action.function.1 acted)).2, acted⟩ + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveMaps.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveMaps.lean index 97813e35d0c28dc505a2f5f3b4233657c59b1713..06e8fe3cb5da1d4d536449d3fec09d56419c0a15 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveMaps.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveMaps.lean @@ -1,379 +1,379 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.Compression - -namespace OAI - -section - -namespace PartitionPilot.Compression.RecursiveMaps - -open Attachment - -universe u v w z - -def compose {A : Type u} {B : Type v} {C : Type w} - {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} - (f : MeetEmbedding P Q) (g : MeetEmbedding Q R) : MeetEmbedding P R where - toFun x := g.toFun (f.toFun x) - le_iff x y := (g.le_iff _ _).trans (f.le_iff x y) - map_meet x y := by rw [f.map_meet, g.map_meet] - -def componentFilter {O : Type u} {I : Type w} {P : MeetOrder O} - (b : Templates.{u,v,w} P I) (h : I) : MeetFilter P where - mem := b.upper h - nonempty := b.upper_nonempty h - upward := b.upper_up h - closed_meet := b.upper_meet h - -structure Inputs {O : Type u} {I : Type w} {P : MeetOrder O} - (b : Templates.{u,v,w} P I) (Task : Type z) where - source : Task → O - previous : Task → MeetEmbedding P b.extension - representative : Task → MeetIso b.extension b.extension - agree : ∀ i p, P.le p (source i) → - (previous i).toFun p = (representative i).toFun (.inl p) - -namespace Inputs - -variable {O : Type u} {I : Type w} {P : MeetOrder O} - {b : Templates.{u,v,w} P I} {Task : Type z} (d : Inputs b Task) - -def Eligible (i : Task) := {h : I // ¬ b.upper h (d.source i)} -def Labels := (i : Task) × d.Eligible i - -noncomputable def nextBatch : Templates b.extension d.Labels where - Space label := b.Space label.2.val - order label := b.order label.2.val - anchor label := b.anchor label.2.val - embed label := compose (b.embed label.2.val) (d.previous label.1) - upper label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).mem - upper_nonempty label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).nonempty - upper_up label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).upward - upper_meet label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).closed_meet - separator label := (d.previous label.1).toFun (b.separator label.2.val) - base_le_separator label := ((d.previous label.1).le_iff _ _).mpr (b.base_le_separator label.2.val) - separator_not_le_base label h := - b.separator_not_le_base label.2.val (((d.previous label.1).le_iff _ _).mp h) - separator_le_upper label y h := - pushFilter_lower_bound (d.previous label.1) (componentFilter b label.2.val) - (b.separator label.2.val) (b.separator_le_upper label.2.val) y h - -def freshImage (i : Task) (x : b.Fresh) (eligible : ¬ b.upper x.1 (d.source i)) : - d.nextBatch.Fresh := ⟨⟨i, ⟨x.1, eligible⟩⟩, x.2⟩ - -noncomputable def lift (i : Task) : O ⊕ b.Fresh → (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh := by - classical - exact fun x => match x with - | .inl p => .inl ((d.previous i).toFun p) - | .inr y => if h : b.upper y.1 (d.source i) then - .inl ((d.representative i).toFun (.inr y)) - else .inr (d.freshImage i y h) - -theorem lift_old (i : Task) (p : O) : - d.lift i (.inl p) = .inl ((d.previous i).toFun p) := rfl - -theorem lift_new_inside (i : Task) (x : b.Fresh) (h : b.upper x.1 (d.source i)) : - d.lift i (.inr x) = .inl ((d.representative i).toFun (.inr x)) := by - simp only [lift, dite_eq_left h] - -theorem lift_new_outside (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) : - d.lift i (.inr x) = .inr (d.freshImage i x h) := by - simp only [lift, dite_eq_right h] - -theorem fresh_shadow (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) : - d.nextBatch.shadow (d.freshImage i x h) = (d.previous i).toFun (b.shadow x) := rfl - -theorem fresh_old_iff (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) (p : O) : - d.nextBatch.extension.le (.inr (d.freshImage i x h)) (.inl ((d.previous i).toFun p)) ↔ - b.extension.le (.inr x) (.inl p) := - pushFilter_trace (d.previous i) (componentFilter b x.1) p - -theorem old_fresh_iff (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) (p : O) : - d.nextBatch.extension.le (.inl ((d.previous i).toFun p)) (.inr (d.freshImage i x h)) ↔ - b.extension.le (.inl p) (.inr x) := - (d.previous i).le_iff p (b.shadow x) - -theorem lift_agrees_on_base (i : Task) (x : O ⊕ b.Fresh) - (h : b.extension.le x (.inl (d.source i))) : - d.lift i x = .inl ((d.representative i).toFun x) := by - cases x with - | inl p => exact congrArg Sum.inl (d.agree i p h) - | inr x => exact d.lift_new_inside i x h - -theorem lift_template (i : Task) (h : I) (eligible : ¬ b.upper h (d.source i)) - (y : b.Space h) : - d.lift i (b.represent h y) = d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ y := by - classical - by_cases old : (b.order h).le y (b.anchor h) - · rw [b.represent_old h y old, d.lift_old, - d.nextBatch.represent_old ⟨i, ⟨h, eligible⟩⟩ y old] - rfl - · rw [b.represent_new h y old, d.lift_new_outside i ⟨h, ⟨y, old⟩⟩ eligible, - d.nextBatch.represent_new ⟨i, ⟨h, eligible⟩⟩ y old] - rfl - -theorem fresh_pair_iff (i : Task) (x y : b.Fresh) - (hx : ¬ b.upper x.1 (d.source i)) (hy : ¬ b.upper y.1 (d.source i)) : - d.nextBatch.extension.le (.inr (d.freshImage i x hx)) (.inr (d.freshImage i y hy)) ↔ - b.extension.le (.inr x) (.inr y) := by - classical - by_cases same : x.1 = y.1 - · rcases x with ⟨h, x, xout⟩ - rcases y with ⟨k, y, yout⟩ - change h = k at same - cases same - have tx := d.nextBatch.represent_new ⟨i, ⟨h, hx⟩⟩ x xout - have ty := d.nextBatch.represent_new ⟨i, ⟨h, hy⟩⟩ y yout - have sx := b.represent_new h x xout - have sy := b.represent_new h y yout - change d.nextBatch.extension.le (Sum.inr ⟨⟨i, ⟨h, hx⟩⟩, ⟨x, xout⟩⟩) - (Sum.inr ⟨⟨i, ⟨h, hy⟩⟩, ⟨y, yout⟩⟩) ↔ _ - rw [← tx, ← ty, ← sx, ← sy] - exact (d.nextBatch.represent_le_iff ⟨i, ⟨h, hx⟩⟩ x y).trans - (b.represent_le_iff h x y).symm - · have different : (d.freshImage i x hx).1 ≠ (d.freshImage i y hy).1 := by - intro h - exact same (congrArg (fun label : d.Labels => label.2.val) h) - rw [d.nextBatch.cross_le_iff _ _ different, b.cross_le_iff x y same] - exact pushFilter_trace (d.previous i) (componentFilter b x.1) (b.shadow y) - -theorem meet_lift_old_old (i : Task) (p q : O) : - d.nextBatch.extension.meet (d.lift i (.inl p)) (d.lift i (.inl q)) = - d.lift i (b.extension.meet (.inl p) (.inl q)) := by - calc - d.nextBatch.extension.meet (d.lift i (.inl p)) (d.lift i (.inl q)) = - .inl (b.extension.meet ((d.previous i).toFun p) ((d.previous i).toFun q)) := - (d.nextBatch.oldEmbedding.map_meet _ _).symm - _ = .inl ((d.previous i).toFun (P.meet p q)) := - congrArg Sum.inl ((d.previous i).map_meet p q).symm - _ = d.lift i (.inl (P.meet p q)) := rfl - _ = d.lift i (b.extension.meet (.inl p) (.inl q)) := - congrArg (d.lift i) (b.oldEmbedding.map_meet p q) - -theorem meet_lift_fresh_old (i : Task) (x : b.Fresh) - (eligible : ¬ b.upper x.1 (d.source i)) (p : O) : - d.nextBatch.extension.meet (d.lift i (.inr x)) (d.lift i (.inl p)) = - d.lift i (b.extension.meet (.inr x) (.inl p)) := by - classical - by_cases hp : b.upper x.1 p - · rw [meet_eq_left_of_le b.extension (x := .inr x) (y := .inl p) hp, - d.lift_new_outside i x eligible, d.lift_old] - exact meet_eq_left_of_le d.nextBatch.extension ((d.fresh_old_iff i x eligible p).mpr hp) - · have target_not : ¬ d.nextBatch.extension.le (.inr (d.freshImage i x eligible)) - (.inl ((d.previous i).toFun p)) := - fun h => hp ((d.fresh_old_iff i x eligible p).mp h) - rw [d.lift_new_outside i x eligible, d.lift_old] - calc - d.nextBatch.extension.meet (.inr (d.freshImage i x eligible)) - (.inl ((d.previous i).toFun p)) = - .inl (b.extension.meet ((d.previous i).toFun (b.shadow x)) ((d.previous i).toFun p)) := - d.nextBatch.shadow_meet_eq _ _ target_not - _ = .inl ((d.previous i).toFun (P.meet (b.shadow x) p)) := - congrArg Sum.inl ((d.previous i).map_meet _ _).symm - _ = d.lift i (.inl (P.meet (b.shadow x) p)) := rfl - _ = d.lift i (b.extension.meet (.inr x) (.inl p)) := - congrArg (d.lift i) (b.shadow_meet_eq x p hp).symm - -theorem meet_lift_template (i : Task) (h : I) (eligible : ¬ b.upper h (d.source i)) - (x y : b.Space h) : - d.nextBatch.extension.meet (d.lift i (b.represent h x)) (d.lift i (b.represent h y)) = - d.lift i (b.extension.meet (b.represent h x) (b.represent h y)) := by - rw [d.lift_template i h eligible x, d.lift_template i h eligible y] - calc - d.nextBatch.extension.meet (d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ x) - (d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ y) = - d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ ((b.order h).meet x y) := - ((d.nextBatch.templateEmbedding ⟨i, ⟨h, eligible⟩⟩).map_meet x y).symm - _ = d.lift i (b.represent h ((b.order h).meet x y)) := - (d.lift_template i h eligible _).symm - _ = d.lift i (b.extension.meet (b.represent h x) (b.represent h y)) := - congrArg (d.lift i) ((b.templateEmbedding h).map_meet x y) - -theorem meet_lift_fresh_pair (i : Task) (x y : b.Fresh) - (hx : ¬ b.upper x.1 (d.source i)) (hy : ¬ b.upper y.1 (d.source i)) : - d.nextBatch.extension.meet (d.lift i (.inr x)) (d.lift i (.inr y)) = - d.lift i (b.extension.meet (.inr x) (.inr y)) := by - classical - by_cases same : x.1 = y.1 - · rcases x with ⟨h, x, xout⟩ - rcases y with ⟨k, y, yout⟩ - change h = k at same - cases same - rw [← b.represent_new h x xout, ← b.represent_new h y yout] - exact d.meet_lift_template i h hx x y - · by_cases hxy : b.extension.le (.inr x) (.inr y) - · rw [meet_eq_left_of_le b.extension hxy, d.lift_new_outside i x hx, - d.lift_new_outside i y hy] - exact meet_eq_left_of_le d.nextBatch.extension ((d.fresh_pair_iff i x y hx hy).mpr hxy) - · by_cases hyx : b.extension.le (.inr y) (.inr x) - · rw [meet_comm b.extension (.inr x) (.inr y), meet_eq_left_of_le b.extension hyx, - d.lift_new_outside i x hx, d.lift_new_outside i y hy, - meet_comm d.nextBatch.extension] - exact meet_eq_left_of_le d.nextBatch.extension ((d.fresh_pair_iff i y x hy hx).mpr hyx) - · have different : (d.freshImage i x hx).1 ≠ (d.freshImage i y hy).1 := by - intro h - exact same (congrArg (fun label : d.Labels => label.2.val) h) - have target_xy := fun h => hxy ((d.fresh_pair_iff i x y hx hy).mp h) - have target_yx := fun h => hyx ((d.fresh_pair_iff i y x hy hx).mp h) - rw [d.lift_new_outside i x hx, d.lift_new_outside i y hy] - calc - d.nextBatch.extension.meet (.inr (d.freshImage i x hx)) (.inr (d.freshImage i y hy)) = - .inl (b.extension.meet ((d.previous i).toFun (b.shadow x)) - ((d.previous i).toFun (b.shadow y))) := - d.nextBatch.cross_meet_eq _ _ different target_xy target_yx - _ = .inl ((d.previous i).toFun (P.meet (b.shadow x) (b.shadow y))) := - congrArg Sum.inl ((d.previous i).map_meet _ _).symm - _ = d.lift i (.inl (P.meet (b.shadow x) (b.shadow y))) := rfl - _ = d.lift i (b.extension.meet (.inr x) (.inr y)) := - congrArg (d.lift i) (b.cross_meet_eq x y same hxy hyx).symm - -theorem image_base_iff (i : Task) (x : O ⊕ b.Fresh) : - d.nextBatch.extension.le (d.lift i x) (.inl ((d.previous i).toFun (d.source i))) ↔ - b.extension.le x (.inl (d.source i)) := by - classical - cases x with - | inl p => exact (d.previous i).le_iff p (d.source i) - | inr x => - by_cases hx : b.upper x.1 (d.source i) - · rw [d.lift_new_inside i x hx] - constructor - · intro _ - exact hx - · intro _ - change b.extension.le ((d.representative i).toFun (.inr x)) - ((d.previous i).toFun (d.source i)) - rw [d.agree i (d.source i) (P.refl _)] - exact ((d.representative i).le_iff _ _).mpr hx - · rw [d.lift_new_outside i x hx] - exact d.fresh_old_iff i x hx (d.source i) - -theorem cut_identity (i : Task) (x : O ⊕ b.Fresh) : - d.nextBatch.extension.meet (d.lift i x) (.inl ((d.previous i).toFun (d.source i))) = - d.lift i (b.extension.meet x (.inl (d.source i))) := by - classical - cases x with - | inl p => exact d.meet_lift_old_old i p (d.source i) - | inr x => - by_cases hx : b.upper x.1 (d.source i) - · rw [meet_eq_left_of_le b.extension (x := .inr x) (y := .inl (d.source i)) hx] - exact meet_eq_left_of_le d.nextBatch.extension ((d.image_base_iff i (.inr x)).mpr hx) - · exact d.meet_lift_fresh_old i x hx (d.source i) - -noncomputable def baseEmbedding (i : Task) : MeetEmbedding b.extension d.nextBatch.extension := - compose (d.representative i).toMeetEmbedding d.nextBatch.oldEmbedding - -theorem meet_lift_with_base (i : Task) (x y : O ⊕ b.Fresh) - (hy : b.extension.le y (.inl (d.source i))) : - d.nextBatch.extension.meet (d.lift i x) (d.lift i y) = d.lift i (b.extension.meet x y) := by - apply base_meet_patch b.extension d.nextBatch.extension (d.lift i) (d.baseEmbedding i) - (.inl (d.source i)) (.inl ((d.previous i).toFun (d.source i))) - · exact congrArg Sum.inl (d.agree i (d.source i) (P.refl _)).symm - · exact d.lift_agrees_on_base i - · exact d.cut_identity i - · exact hy - -theorem lift_preserves_meets (i : Task) (x y : O ⊕ b.Fresh) : - d.nextBatch.extension.meet (d.lift i x) (d.lift i y) = d.lift i (b.extension.meet x y) := by - classical - by_cases hy : b.extension.le y (.inl (d.source i)) - · exact d.meet_lift_with_base i x y hy - · by_cases hx : b.extension.le x (.inl (d.source i)) - · calc - d.nextBatch.extension.meet (d.lift i x) (d.lift i y) = - d.nextBatch.extension.meet (d.lift i y) (d.lift i x) := meet_comm _ _ _ - _ = d.lift i (b.extension.meet y x) := d.meet_lift_with_base i y x hx - _ = d.lift i (b.extension.meet x y) := congrArg (d.lift i) (meet_comm _ _ _) - · cases x with - | inl p => - cases y with - | inl q => exact d.meet_lift_old_old i p q - | inr y => - calc - d.nextBatch.extension.meet (d.lift i (.inl p)) (d.lift i (.inr y)) = - d.nextBatch.extension.meet (d.lift i (.inr y)) (d.lift i (.inl p)) := meet_comm _ _ _ - _ = d.lift i (b.extension.meet (.inr y) (.inl p)) := d.meet_lift_fresh_old i y hy p - _ = d.lift i (b.extension.meet (.inl p) (.inr y)) := congrArg (d.lift i) (meet_comm _ _ _) - | inr x => - cases y with - | inl q => exact d.meet_lift_fresh_old i x hx q - | inr y => exact d.meet_lift_fresh_pair i x y hx hy - -theorem lift_monotone (i : Task) {x y : O ⊕ b.Fresh} - (h : b.extension.le x y) : d.nextBatch.extension.le (d.lift i x) (d.lift i y) := by - have hm := (d.lift_preserves_meets i x y).trans - (congrArg (d.lift i) (meet_eq_left_of_le b.extension h)) - have lower := d.nextBatch.extension.meet_le_right (d.lift i x) (d.lift i y) - rw [hm] at lower - exact lower - -theorem lift_reflects_order (i : Task) {x y : O ⊕ b.Fresh} - (h : d.nextBatch.extension.le (d.lift i x) (d.lift i y)) : b.extension.le x y := by - classical - by_cases hx : b.extension.le x (.inl (d.source i)) - · have hxc := (d.image_base_iff i x).mpr hx - have hcut : d.nextBatch.extension.le (d.lift i x) - (d.lift i (b.extension.meet y (.inl (d.source i)))) := by - rw [← d.cut_identity i y] - exact d.nextBatch.extension.le_meet h hxc - rw [d.lift_agrees_on_base i x hx, - d.lift_agrees_on_base i _ (b.extension.meet_le_right y (.inl (d.source i)))] at hcut - have source_cut := ((d.representative i).le_iff x (b.extension.meet y (.inl (d.source i)))).mp hcut - exact b.extension.trans source_cut (b.extension.meet_le_left _ _) - · by_cases hy : b.extension.le y (.inl (d.source i)) - · exact False.elim (hx ((d.image_base_iff i x).mp - (d.nextBatch.extension.trans h ((d.image_base_iff i y).mpr hy)))) - · cases x with - | inl p => - cases y with - | inl q => exact ((d.previous i).le_iff p q).mp h - | inr y => - rw [d.lift_old, d.lift_new_outside i y hy] at h - exact (d.old_fresh_iff i y hy p).mp h - | inr x => - cases y with - | inl q => - rw [d.lift_new_outside i x hx, d.lift_old] at h - exact (d.fresh_old_iff i x hx q).mp h - | inr y => - rw [d.lift_new_outside i x hx, d.lift_new_outside i y hy] at h - exact (d.fresh_pair_iff i x y hx hy).mp h - -noncomputable def liftedEmbedding (i : Task) : MeetEmbedding b.extension d.nextBatch.extension where - toFun := d.lift i - le_iff _ _ := ⟨d.lift_reflects_order i, d.lift_monotone i⟩ - map_meet x y := (d.lift_preserves_meets i x y).symm - -theorem lift_injective (i : Task) {x y : O ⊕ b.Fresh} (h : d.lift i x = d.lift i y) : x = y := - embedding_injective (d.liftedEmbedding i) h - -theorem fresh_below_cap (i : Task) (x : b.Fresh) (eligible : ¬ b.upper x.1 (d.source i)) - (T : O) (top : ∀ p, P.le p T) : - d.nextBatch.extension.le (.inr (d.freshImage i x eligible)) (.inl ((d.previous i).toFun T)) := by - apply (d.fresh_old_iff i x eligible T).mpr - rcases b.upper_nonempty x.1 with ⟨p, hp⟩ - exact b.upper_up x.1 hp (top p) - -theorem fresh_outside_base (i : Task) (x : b.Fresh) (eligible : ¬ b.upper x.1 (d.source i)) : - ¬ d.nextBatch.extension.le (.inr (d.freshImage i x eligible)) - (.inl ((d.previous i).toFun (d.source i))) := - fun h => eligible ((d.fresh_old_iff i x eligible (d.source i)).mp h) - -theorem range_below_cap (i : Task) (T : O) (top : ∀ p, P.le p T) : - ∀ x, d.nextBatch.extension.le (d.lift i x) (.inl ((d.previous i).toFun T)) := by - intro x - exact d.lift_monotone i (b.greatest_preserved T top x) - -theorem fresh_accounting (T : O) (top : ∀ p, P.le p T) (z : d.nextBatch.Fresh) : - ∃ i x, d.lift i x = .inr z ∧ - d.nextBatch.extension.le (.inr z) (.inl ((d.previous i).toFun T)) ∧ - ¬ d.nextBatch.extension.le (.inr z) (.inl ((d.previous i).toFun (d.source i))) := by - rcases z with ⟨⟨i, ⟨h, eligible⟩⟩, y⟩ - refine ⟨i, .inr ⟨h, y⟩, d.lift_new_outside i ⟨h, y⟩ eligible, ?_, ?_⟩ - · exact d.fresh_below_cap i ⟨h, y⟩ eligible T top - · exact d.fresh_outside_base i ⟨h, y⟩ eligible - -end Inputs -end PartitionPilot.Compression.RecursiveMaps - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.Compression + +namespace OAI + +section + +namespace PartitionPilot.Compression.RecursiveMaps + +open Attachment + +universe u v w z + +def compose {A : Type u} {B : Type v} {C : Type w} + {P : MeetOrder A} {Q : MeetOrder B} {R : MeetOrder C} + (f : MeetEmbedding P Q) (g : MeetEmbedding Q R) : MeetEmbedding P R where + toFun x := g.toFun (f.toFun x) + le_iff x y := (g.le_iff _ _).trans (f.le_iff x y) + map_meet x y := by rw [f.map_meet, g.map_meet] + +def componentFilter {O : Type u} {I : Type w} {P : MeetOrder O} + (b : Templates.{u,v,w} P I) (h : I) : MeetFilter P where + mem := b.upper h + nonempty := b.upper_nonempty h + upward := b.upper_up h + closed_meet := b.upper_meet h + +structure Inputs {O : Type u} {I : Type w} {P : MeetOrder O} + (b : Templates.{u,v,w} P I) (Task : Type z) where + source : Task → O + previous : Task → MeetEmbedding P b.extension + representative : Task → MeetIso b.extension b.extension + agree : ∀ i p, P.le p (source i) → + (previous i).toFun p = (representative i).toFun (.inl p) + +namespace Inputs + +variable {O : Type u} {I : Type w} {P : MeetOrder O} + {b : Templates.{u,v,w} P I} {Task : Type z} (d : Inputs b Task) + +def Eligible (i : Task) := {h : I // ¬ b.upper h (d.source i)} +def Labels := (i : Task) × d.Eligible i + +noncomputable def nextBatch : Templates b.extension d.Labels where + Space label := b.Space label.2.val + order label := b.order label.2.val + anchor label := b.anchor label.2.val + embed label := compose (b.embed label.2.val) (d.previous label.1) + upper label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).mem + upper_nonempty label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).nonempty + upper_up label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).upward + upper_meet label := (pushFilter (d.previous label.1) (componentFilter b label.2.val)).closed_meet + separator label := (d.previous label.1).toFun (b.separator label.2.val) + base_le_separator label := ((d.previous label.1).le_iff _ _).mpr (b.base_le_separator label.2.val) + separator_not_le_base label h := + b.separator_not_le_base label.2.val (((d.previous label.1).le_iff _ _).mp h) + separator_le_upper label y h := + pushFilter_lower_bound (d.previous label.1) (componentFilter b label.2.val) + (b.separator label.2.val) (b.separator_le_upper label.2.val) y h + +def freshImage (i : Task) (x : b.Fresh) (eligible : ¬ b.upper x.1 (d.source i)) : + d.nextBatch.Fresh := ⟨⟨i, ⟨x.1, eligible⟩⟩, x.2⟩ + +noncomputable def lift (i : Task) : O ⊕ b.Fresh → (O ⊕ b.Fresh) ⊕ d.nextBatch.Fresh := by + classical + exact fun x => match x with + | .inl p => .inl ((d.previous i).toFun p) + | .inr y => if h : b.upper y.1 (d.source i) then + .inl ((d.representative i).toFun (.inr y)) + else .inr (d.freshImage i y h) + +theorem lift_old (i : Task) (p : O) : + d.lift i (.inl p) = .inl ((d.previous i).toFun p) := rfl + +theorem lift_new_inside (i : Task) (x : b.Fresh) (h : b.upper x.1 (d.source i)) : + d.lift i (.inr x) = .inl ((d.representative i).toFun (.inr x)) := by + simp only [lift, dite_eq_left h] + +theorem lift_new_outside (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) : + d.lift i (.inr x) = .inr (d.freshImage i x h) := by + simp only [lift, dite_eq_right h] + +theorem fresh_shadow (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) : + d.nextBatch.shadow (d.freshImage i x h) = (d.previous i).toFun (b.shadow x) := rfl + +theorem fresh_old_iff (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) (p : O) : + d.nextBatch.extension.le (.inr (d.freshImage i x h)) (.inl ((d.previous i).toFun p)) ↔ + b.extension.le (.inr x) (.inl p) := + pushFilter_trace (d.previous i) (componentFilter b x.1) p + +theorem old_fresh_iff (i : Task) (x : b.Fresh) (h : ¬ b.upper x.1 (d.source i)) (p : O) : + d.nextBatch.extension.le (.inl ((d.previous i).toFun p)) (.inr (d.freshImage i x h)) ↔ + b.extension.le (.inl p) (.inr x) := + (d.previous i).le_iff p (b.shadow x) + +theorem lift_agrees_on_base (i : Task) (x : O ⊕ b.Fresh) + (h : b.extension.le x (.inl (d.source i))) : + d.lift i x = .inl ((d.representative i).toFun x) := by + cases x with + | inl p => exact congrArg Sum.inl (d.agree i p h) + | inr x => exact d.lift_new_inside i x h + +theorem lift_template (i : Task) (h : I) (eligible : ¬ b.upper h (d.source i)) + (y : b.Space h) : + d.lift i (b.represent h y) = d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ y := by + classical + by_cases old : (b.order h).le y (b.anchor h) + · rw [b.represent_old h y old, d.lift_old, + d.nextBatch.represent_old ⟨i, ⟨h, eligible⟩⟩ y old] + rfl + · rw [b.represent_new h y old, d.lift_new_outside i ⟨h, ⟨y, old⟩⟩ eligible, + d.nextBatch.represent_new ⟨i, ⟨h, eligible⟩⟩ y old] + rfl + +theorem fresh_pair_iff (i : Task) (x y : b.Fresh) + (hx : ¬ b.upper x.1 (d.source i)) (hy : ¬ b.upper y.1 (d.source i)) : + d.nextBatch.extension.le (.inr (d.freshImage i x hx)) (.inr (d.freshImage i y hy)) ↔ + b.extension.le (.inr x) (.inr y) := by + classical + by_cases same : x.1 = y.1 + · rcases x with ⟨h, x, xout⟩ + rcases y with ⟨k, y, yout⟩ + change h = k at same + cases same + have tx := d.nextBatch.represent_new ⟨i, ⟨h, hx⟩⟩ x xout + have ty := d.nextBatch.represent_new ⟨i, ⟨h, hy⟩⟩ y yout + have sx := b.represent_new h x xout + have sy := b.represent_new h y yout + change d.nextBatch.extension.le (Sum.inr ⟨⟨i, ⟨h, hx⟩⟩, ⟨x, xout⟩⟩) + (Sum.inr ⟨⟨i, ⟨h, hy⟩⟩, ⟨y, yout⟩⟩) ↔ _ + rw [← tx, ← ty, ← sx, ← sy] + exact (d.nextBatch.represent_le_iff ⟨i, ⟨h, hx⟩⟩ x y).trans + (b.represent_le_iff h x y).symm + · have different : (d.freshImage i x hx).1 ≠ (d.freshImage i y hy).1 := by + intro h + exact same (congrArg (fun label : d.Labels => label.2.val) h) + rw [d.nextBatch.cross_le_iff _ _ different, b.cross_le_iff x y same] + exact pushFilter_trace (d.previous i) (componentFilter b x.1) (b.shadow y) + +theorem meet_lift_old_old (i : Task) (p q : O) : + d.nextBatch.extension.meet (d.lift i (.inl p)) (d.lift i (.inl q)) = + d.lift i (b.extension.meet (.inl p) (.inl q)) := by + calc + d.nextBatch.extension.meet (d.lift i (.inl p)) (d.lift i (.inl q)) = + .inl (b.extension.meet ((d.previous i).toFun p) ((d.previous i).toFun q)) := + (d.nextBatch.oldEmbedding.map_meet _ _).symm + _ = .inl ((d.previous i).toFun (P.meet p q)) := + congrArg Sum.inl ((d.previous i).map_meet p q).symm + _ = d.lift i (.inl (P.meet p q)) := rfl + _ = d.lift i (b.extension.meet (.inl p) (.inl q)) := + congrArg (d.lift i) (b.oldEmbedding.map_meet p q) + +theorem meet_lift_fresh_old (i : Task) (x : b.Fresh) + (eligible : ¬ b.upper x.1 (d.source i)) (p : O) : + d.nextBatch.extension.meet (d.lift i (.inr x)) (d.lift i (.inl p)) = + d.lift i (b.extension.meet (.inr x) (.inl p)) := by + classical + by_cases hp : b.upper x.1 p + · rw [meet_eq_left_of_le b.extension (x := .inr x) (y := .inl p) hp, + d.lift_new_outside i x eligible, d.lift_old] + exact meet_eq_left_of_le d.nextBatch.extension ((d.fresh_old_iff i x eligible p).mpr hp) + · have target_not : ¬ d.nextBatch.extension.le (.inr (d.freshImage i x eligible)) + (.inl ((d.previous i).toFun p)) := + fun h => hp ((d.fresh_old_iff i x eligible p).mp h) + rw [d.lift_new_outside i x eligible, d.lift_old] + calc + d.nextBatch.extension.meet (.inr (d.freshImage i x eligible)) + (.inl ((d.previous i).toFun p)) = + .inl (b.extension.meet ((d.previous i).toFun (b.shadow x)) ((d.previous i).toFun p)) := + d.nextBatch.shadow_meet_eq _ _ target_not + _ = .inl ((d.previous i).toFun (P.meet (b.shadow x) p)) := + congrArg Sum.inl ((d.previous i).map_meet _ _).symm + _ = d.lift i (.inl (P.meet (b.shadow x) p)) := rfl + _ = d.lift i (b.extension.meet (.inr x) (.inl p)) := + congrArg (d.lift i) (b.shadow_meet_eq x p hp).symm + +theorem meet_lift_template (i : Task) (h : I) (eligible : ¬ b.upper h (d.source i)) + (x y : b.Space h) : + d.nextBatch.extension.meet (d.lift i (b.represent h x)) (d.lift i (b.represent h y)) = + d.lift i (b.extension.meet (b.represent h x) (b.represent h y)) := by + rw [d.lift_template i h eligible x, d.lift_template i h eligible y] + calc + d.nextBatch.extension.meet (d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ x) + (d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ y) = + d.nextBatch.represent ⟨i, ⟨h, eligible⟩⟩ ((b.order h).meet x y) := + ((d.nextBatch.templateEmbedding ⟨i, ⟨h, eligible⟩⟩).map_meet x y).symm + _ = d.lift i (b.represent h ((b.order h).meet x y)) := + (d.lift_template i h eligible _).symm + _ = d.lift i (b.extension.meet (b.represent h x) (b.represent h y)) := + congrArg (d.lift i) ((b.templateEmbedding h).map_meet x y) + +theorem meet_lift_fresh_pair (i : Task) (x y : b.Fresh) + (hx : ¬ b.upper x.1 (d.source i)) (hy : ¬ b.upper y.1 (d.source i)) : + d.nextBatch.extension.meet (d.lift i (.inr x)) (d.lift i (.inr y)) = + d.lift i (b.extension.meet (.inr x) (.inr y)) := by + classical + by_cases same : x.1 = y.1 + · rcases x with ⟨h, x, xout⟩ + rcases y with ⟨k, y, yout⟩ + change h = k at same + cases same + rw [← b.represent_new h x xout, ← b.represent_new h y yout] + exact d.meet_lift_template i h hx x y + · by_cases hxy : b.extension.le (.inr x) (.inr y) + · rw [meet_eq_left_of_le b.extension hxy, d.lift_new_outside i x hx, + d.lift_new_outside i y hy] + exact meet_eq_left_of_le d.nextBatch.extension ((d.fresh_pair_iff i x y hx hy).mpr hxy) + · by_cases hyx : b.extension.le (.inr y) (.inr x) + · rw [meet_comm b.extension (.inr x) (.inr y), meet_eq_left_of_le b.extension hyx, + d.lift_new_outside i x hx, d.lift_new_outside i y hy, + meet_comm d.nextBatch.extension] + exact meet_eq_left_of_le d.nextBatch.extension ((d.fresh_pair_iff i y x hy hx).mpr hyx) + · have different : (d.freshImage i x hx).1 ≠ (d.freshImage i y hy).1 := by + intro h + exact same (congrArg (fun label : d.Labels => label.2.val) h) + have target_xy := fun h => hxy ((d.fresh_pair_iff i x y hx hy).mp h) + have target_yx := fun h => hyx ((d.fresh_pair_iff i y x hy hx).mp h) + rw [d.lift_new_outside i x hx, d.lift_new_outside i y hy] + calc + d.nextBatch.extension.meet (.inr (d.freshImage i x hx)) (.inr (d.freshImage i y hy)) = + .inl (b.extension.meet ((d.previous i).toFun (b.shadow x)) + ((d.previous i).toFun (b.shadow y))) := + d.nextBatch.cross_meet_eq _ _ different target_xy target_yx + _ = .inl ((d.previous i).toFun (P.meet (b.shadow x) (b.shadow y))) := + congrArg Sum.inl ((d.previous i).map_meet _ _).symm + _ = d.lift i (.inl (P.meet (b.shadow x) (b.shadow y))) := rfl + _ = d.lift i (b.extension.meet (.inr x) (.inr y)) := + congrArg (d.lift i) (b.cross_meet_eq x y same hxy hyx).symm + +theorem image_base_iff (i : Task) (x : O ⊕ b.Fresh) : + d.nextBatch.extension.le (d.lift i x) (.inl ((d.previous i).toFun (d.source i))) ↔ + b.extension.le x (.inl (d.source i)) := by + classical + cases x with + | inl p => exact (d.previous i).le_iff p (d.source i) + | inr x => + by_cases hx : b.upper x.1 (d.source i) + · rw [d.lift_new_inside i x hx] + constructor + · intro _ + exact hx + · intro _ + change b.extension.le ((d.representative i).toFun (.inr x)) + ((d.previous i).toFun (d.source i)) + rw [d.agree i (d.source i) (P.refl _)] + exact ((d.representative i).le_iff _ _).mpr hx + · rw [d.lift_new_outside i x hx] + exact d.fresh_old_iff i x hx (d.source i) + +theorem cut_identity (i : Task) (x : O ⊕ b.Fresh) : + d.nextBatch.extension.meet (d.lift i x) (.inl ((d.previous i).toFun (d.source i))) = + d.lift i (b.extension.meet x (.inl (d.source i))) := by + classical + cases x with + | inl p => exact d.meet_lift_old_old i p (d.source i) + | inr x => + by_cases hx : b.upper x.1 (d.source i) + · rw [meet_eq_left_of_le b.extension (x := .inr x) (y := .inl (d.source i)) hx] + exact meet_eq_left_of_le d.nextBatch.extension ((d.image_base_iff i (.inr x)).mpr hx) + · exact d.meet_lift_fresh_old i x hx (d.source i) + +noncomputable def baseEmbedding (i : Task) : MeetEmbedding b.extension d.nextBatch.extension := + compose (d.representative i).toMeetEmbedding d.nextBatch.oldEmbedding + +theorem meet_lift_with_base (i : Task) (x y : O ⊕ b.Fresh) + (hy : b.extension.le y (.inl (d.source i))) : + d.nextBatch.extension.meet (d.lift i x) (d.lift i y) = d.lift i (b.extension.meet x y) := by + apply base_meet_patch b.extension d.nextBatch.extension (d.lift i) (d.baseEmbedding i) + (.inl (d.source i)) (.inl ((d.previous i).toFun (d.source i))) + · exact congrArg Sum.inl (d.agree i (d.source i) (P.refl _)).symm + · exact d.lift_agrees_on_base i + · exact d.cut_identity i + · exact hy + +theorem lift_preserves_meets (i : Task) (x y : O ⊕ b.Fresh) : + d.nextBatch.extension.meet (d.lift i x) (d.lift i y) = d.lift i (b.extension.meet x y) := by + classical + by_cases hy : b.extension.le y (.inl (d.source i)) + · exact d.meet_lift_with_base i x y hy + · by_cases hx : b.extension.le x (.inl (d.source i)) + · calc + d.nextBatch.extension.meet (d.lift i x) (d.lift i y) = + d.nextBatch.extension.meet (d.lift i y) (d.lift i x) := meet_comm _ _ _ + _ = d.lift i (b.extension.meet y x) := d.meet_lift_with_base i y x hx + _ = d.lift i (b.extension.meet x y) := congrArg (d.lift i) (meet_comm _ _ _) + · cases x with + | inl p => + cases y with + | inl q => exact d.meet_lift_old_old i p q + | inr y => + calc + d.nextBatch.extension.meet (d.lift i (.inl p)) (d.lift i (.inr y)) = + d.nextBatch.extension.meet (d.lift i (.inr y)) (d.lift i (.inl p)) := meet_comm _ _ _ + _ = d.lift i (b.extension.meet (.inr y) (.inl p)) := d.meet_lift_fresh_old i y hy p + _ = d.lift i (b.extension.meet (.inl p) (.inr y)) := congrArg (d.lift i) (meet_comm _ _ _) + | inr x => + cases y with + | inl q => exact d.meet_lift_fresh_old i x hx q + | inr y => exact d.meet_lift_fresh_pair i x y hx hy + +theorem lift_monotone (i : Task) {x y : O ⊕ b.Fresh} + (h : b.extension.le x y) : d.nextBatch.extension.le (d.lift i x) (d.lift i y) := by + have hm := (d.lift_preserves_meets i x y).trans + (congrArg (d.lift i) (meet_eq_left_of_le b.extension h)) + have lower := d.nextBatch.extension.meet_le_right (d.lift i x) (d.lift i y) + rw [hm] at lower + exact lower + +theorem lift_reflects_order (i : Task) {x y : O ⊕ b.Fresh} + (h : d.nextBatch.extension.le (d.lift i x) (d.lift i y)) : b.extension.le x y := by + classical + by_cases hx : b.extension.le x (.inl (d.source i)) + · have hxc := (d.image_base_iff i x).mpr hx + have hcut : d.nextBatch.extension.le (d.lift i x) + (d.lift i (b.extension.meet y (.inl (d.source i)))) := by + rw [← d.cut_identity i y] + exact d.nextBatch.extension.le_meet h hxc + rw [d.lift_agrees_on_base i x hx, + d.lift_agrees_on_base i _ (b.extension.meet_le_right y (.inl (d.source i)))] at hcut + have source_cut := ((d.representative i).le_iff x (b.extension.meet y (.inl (d.source i)))).mp hcut + exact b.extension.trans source_cut (b.extension.meet_le_left _ _) + · by_cases hy : b.extension.le y (.inl (d.source i)) + · exact False.elim (hx ((d.image_base_iff i x).mp + (d.nextBatch.extension.trans h ((d.image_base_iff i y).mpr hy)))) + · cases x with + | inl p => + cases y with + | inl q => exact ((d.previous i).le_iff p q).mp h + | inr y => + rw [d.lift_old, d.lift_new_outside i y hy] at h + exact (d.old_fresh_iff i y hy p).mp h + | inr x => + cases y with + | inl q => + rw [d.lift_new_outside i x hx, d.lift_old] at h + exact (d.fresh_old_iff i x hx q).mp h + | inr y => + rw [d.lift_new_outside i x hx, d.lift_new_outside i y hy] at h + exact (d.fresh_pair_iff i x y hx hy).mp h + +noncomputable def liftedEmbedding (i : Task) : MeetEmbedding b.extension d.nextBatch.extension where + toFun := d.lift i + le_iff _ _ := ⟨d.lift_reflects_order i, d.lift_monotone i⟩ + map_meet x y := (d.lift_preserves_meets i x y).symm + +theorem lift_injective (i : Task) {x y : O ⊕ b.Fresh} (h : d.lift i x = d.lift i y) : x = y := + embedding_injective (d.liftedEmbedding i) h + +theorem fresh_below_cap (i : Task) (x : b.Fresh) (eligible : ¬ b.upper x.1 (d.source i)) + (T : O) (top : ∀ p, P.le p T) : + d.nextBatch.extension.le (.inr (d.freshImage i x eligible)) (.inl ((d.previous i).toFun T)) := by + apply (d.fresh_old_iff i x eligible T).mpr + rcases b.upper_nonempty x.1 with ⟨p, hp⟩ + exact b.upper_up x.1 hp (top p) + +theorem fresh_outside_base (i : Task) (x : b.Fresh) (eligible : ¬ b.upper x.1 (d.source i)) : + ¬ d.nextBatch.extension.le (.inr (d.freshImage i x eligible)) + (.inl ((d.previous i).toFun (d.source i))) := + fun h => eligible ((d.fresh_old_iff i x eligible (d.source i)).mp h) + +theorem range_below_cap (i : Task) (T : O) (top : ∀ p, P.le p T) : + ∀ x, d.nextBatch.extension.le (d.lift i x) (.inl ((d.previous i).toFun T)) := by + intro x + exact d.lift_monotone i (b.greatest_preserved T top x) + +theorem fresh_accounting (T : O) (top : ∀ p, P.le p T) (z : d.nextBatch.Fresh) : + ∃ i x, d.lift i x = .inr z ∧ + d.nextBatch.extension.le (.inr z) (.inl ((d.previous i).toFun T)) ∧ + ¬ d.nextBatch.extension.le (.inr z) (.inl ((d.previous i).toFun (d.source i))) := by + rcases z with ⟨⟨i, ⟨h, eligible⟩⟩, y⟩ + refine ⟨i, .inr ⟨h, y⟩, d.lift_new_outside i ⟨h, y⟩ eligible, ?_, ?_⟩ + · exact d.fresh_below_cap i ⟨h, y⟩ eligible T top + · exact d.fresh_outside_base i ⟨h, y⟩ eligible + +end Inputs +end PartitionPilot.Compression.RecursiveMaps + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveNextMapInputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveNextMapInputs.lean index 2b588286a2e90e4f31b9713d53486b5c0c14489d..e668d1aeeab8d07adf48be38edfe359f3e3dc224 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveNextMapInputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveNextMapInputs.lean @@ -1,316 +1,316 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchEmbeddingRecognition -import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionEmbeddings - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundRecursiveAttachment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I J D L rD rL μD μL Qs rs μs As Es Fs Ss Maps Sources : ZFSet.{u}} - (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) - (target : MeetOrderCode L rL μL) (maps : FunctionGraphOn I Maps) - (sources : ZFSet.IsFunc I D Sources) - (valid : ∀ i S, ZFSet.pair i S ∈ Maps → MeetEmbeddingCode D L rD rL μD μL S) - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hL : L ∈ M.sets) (hrL : rL ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) - (hSs : Ss ∈ M.sets) (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) : - let K := recursiveAttachmentIndices I J D (⋃₀ ⋃₀ Fs) Sources Fs - K ∈ M.sets ∧ - (∀ i j a F, ZFSet.pair i a ∈ Sources → ZFSet.pair j F ∈ Fs → - (ZFSet.pair i j ∈ K ↔ a ∉ F)) ∧ - ∃ next : AttachmentBatchInputs L rL μL K - (pairSecondField I J K Qs) (pairSecondField I J K rs) - (pairSecondField I J K μs) (pairSecondField I J K As) - (M.groundPairCompositions K I J (familyPointBound Qs) D L Es Maps) - (M.groundPairPushFilters K I J L rL Maps Fs) - (recursiveSeparatorFamily K I J D L Maps Ss), - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ - ∃ family ∈ M.sets, FunctionGraphOn K family ∧ - (∀ i f, ZFSet.pair i f ∈ family ↔ i ∈ K ∧ - f = batchTemplateGraph K L (pairSecondField I J K Qs) - (pairSecondField I J K rs) (pairSecondField I J K As) - (M.groundPairCompositions K I J (familyPointBound Qs) D L Es Maps) i) ∧ - ∀ (i : {i : ZFSet.{u} // i ∈ K}) f, ZFSet.pair i.val f ∈ family → - MeetEmbeddingCode (next.space i) next.batchCarrier (next.rel i) next.batchOrder - (next.meet i) next.batchMeetGraph f := by - dsimp only - let K := recursiveAttachmentIndices I J D (⋃₀ ⋃₀ Fs) Sources Fs - have hK : K ∈ M.sets := M.recursiveAttachmentIndices_mem pairing unions powers separation - hI hJ hD (M.union_mem unions (M.union_mem unions hFs)) hSources hFs - have subset : K ⊆ ZFSet.prod I J := recursiveAttachmentIndices_subset _ _ _ _ _ _ - have fields {H : ZFSet.{u}} (hH : H ∈ M.sets) : pairSecondField I J K H ∈ M.sets := - M.pairFieldGraph_mem pairing unions powers separation false hI hJ hK - (M.union_mem unions (M.union_mem unions hH)) hH - have composites := M.groundPairCompositions_spec pairing unions powers separation hK hI hJ - (M.familyPointBound_mem unions hQs) hD hL hEs hMaps d.embeddings maps subset - have filters := M.groundPairPushFilters_spec pairing unions powers separation - hK hI hJ hL hrL hMaps hFs maps d.filters subset - let next := M.groundRecursiveBatchInputs pairing unions powers separation d target maps valid subset - hK hI hJ hD hL hrL hQs hEs hFs hMaps - refine ⟨hK, ?_, next, ?_⟩ - · intro i j a F source filter - exact recursiveAttachmentIndices_entry_iff sources d.filters.to_isFunc source filter - · exact M.exists_batchAttachment_embedding_family pairing unions powers separation next - hL hrL hK (fields hQs) (fields hrs) (fields hμs) (fields hAs) - composites.1 filters.1 - (M.recursiveSeparatorFamily_mem pairing unions powers separation hK hI hJ hD hL hMaps hSs) - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -open SetFormula -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) - -noncomputable abbrev groundLiftFamily (next : h.NextInputs M) := - M.groundLiftedCompressionFamily I J D d.batchCarrier next.batchCarrier - (indexedAttachmentFresh J Qs rs As) (familyPointBound Qs) Maps Sources Fs Reps G A - -theorem groundLiftFamily_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (next : h.NextInputs M) (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hL : d.batchCarrier ∈ M.sets) (hC : next.batchCarrier ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) - (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : - h.liftGraph M next ∈ M.sets ∧ h.groundLiftFamily M next ∈ M.sets ∧ - FunctionGraphOn I (h.groundLiftFamily M next) ∧ - (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ - ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → - ZFSet.IsFunc d.batchCarrier next.batchCarrier f := by - have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hJ hQs hrs hAs - have hB := M.familyPointBound_mem unions hQs - have graph := M.liftedCompressionGraph_mem pairing unions powers separation - hI hJ hD hL hC hN hB hMaps hSources hFs hReps hG hA - obtain ⟨member, function, entries⟩ := M.groundLiftedCompressionFamily_spec - pairing unions powers separation hI hJ hD hL hC hN hB hMaps hSources hFs hReps hG hA - refine ⟨graph, member, function, entries, ?_⟩ - intro i f entry - obtain ⟨hi, rfl⟩ := (entries i f).1 entry - exact h.liftSection_function M next hi - -theorem exists_groundLiftGraphs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) (hSs : Ss ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hA : A ∈ M.sets) : - ∃ next : h.NextInputs M, - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ - h.liftGraph M next ∈ M.sets ∧ - ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ - h.groundLiftFamily M next ∈ M.sets ∧ FunctionGraphOn I (h.groundLiftFamily M next) ∧ - (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ - ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → - ZFSet.IsFunc d.batchCarrier next.batchCarrier f := by - obtain ⟨hL, hrL, _, _, _, _⟩ := M.batchAttachment_ground_codes - pairing unions powers separation d hD hrD hJ hQs hrs hμs hAs hEs hFs - obtain ⟨_, _, next, hC, hrC, hμC, meet, _⟩ := M.groundRecursiveAttachment - pairing unions powers separation d d.batch_meetOrder h.maps h.sources h.valid - hI hJ hD hL hrL hQs hrs hμs hAs hEs hFs hSs hMaps hSources - obtain ⟨graph, family, function, entries, functions⟩ := h.groundLiftFamily_spec M - pairing unions powers separation next hI hJ hD hL hC hQs hrs hAs - hMaps hSources hFs hReps hG hA - exact ⟨next, hC, hrC, hμC, meet, graph, h.liftGraph_function M next, - family, function, entries, functions⟩ - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem groundEligibleRecursiveAttachment - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {P G r μ A Labels m inv one : ZFSet.{u}} - (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) - (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Qs := constantFamilyGraph I P - let rs := constantFamilyGraph I r - let μs := constantFamilyGraph I μ - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Fs := literalTaskFilterGraph I P R U Labels - let Ss := literalTaskSeparatorGraph I P R U Labels - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - let Maps := M.batchEmbeddingFamily I P Qs rs As Es - let K := recursiveAttachmentIndices I I P (⋃₀ ⋃₀ Fs) As Fs - K ∈ M.sets ∧ - (∀ i j a F, ZFSet.pair i a ∈ As → ZFSet.pair j F ∈ Fs → - (ZFSet.pair i j ∈ K ↔ a ∉ F)) ∧ - ∃ next : AttachmentBatchInputs d.batchCarrier d.batchOrder d.batchMeetGraph K - (pairSecondField I I K Qs) (pairSecondField I I K rs) - (pairSecondField I I K μs) (pairSecondField I I K As) - (M.groundPairCompositions K I I (familyPointBound Qs) P d.batchCarrier Es Maps) - (M.groundPairPushFilters K I I d.batchCarrier d.batchOrder Maps Fs) - (recursiveSeparatorFamily K I I P d.batchCarrier Maps Ss), - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ - ∃ family ∈ M.sets, FunctionGraphOn K family ∧ - (∀ i f, ZFSet.pair i f ∈ family ↔ i ∈ K ∧ - f = batchTemplateGraph K d.batchCarrier (pairSecondField I I K Qs) - (pairSecondField I I K rs) (pairSecondField I I K As) - (M.groundPairCompositions K I I (familyPointBound Qs) P d.batchCarrier Es Maps) i) ∧ - ∀ (i : {i : ZFSet.{u} // i ∈ K}) f, ZFSet.pair i.val f ∈ family → - MeetEmbeddingCode (next.space i) next.batchCarrier (next.rel i) next.batchOrder - (next.meet i) next.batchMeetGraph f := by - let I := M.groundEligibleTasks P G r μ A Labels - let R := M.groundRelations P P - let U := M.groundMeetFilters P r μ - let Qs := constantFamilyGraph I P - let rs := constantFamilyGraph I r - let As := literalTaskSourceGraph I P R U Labels - let Es := literalTaskBaseGraph I P R U Labels - let Maps := M.batchEmbeddingFamily I P Qs rs As Es - let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet - obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields - pairing unions powers separation hP hG hr hμ hA hLabels meet - have initial := M.groundEligibleTaskAttachment pairing unions powers separation - hP hG hr hμ hA hLabels group action meet - obtain ⟨hMaps, maps, entries⟩ := M.batchEmbeddingFamily_spec - pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 - have valid : ∀ i S, ZFSet.pair i S ∈ Maps → - MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph S := by - intro i S entry - obtain ⟨hi, equal⟩ := (entries i S).1 entry - let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ - have spaceEq : d.space index = P := - ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry index)).2 - have relEq : d.rel index = r := - ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry index)).2 - have meetEq : d.meet index = μ := - ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry index)).2 - rw [equal] - simpa only [spaceEq, relEq, meetEq] using d.batch_template_embedding_code index - exact M.groundRecursiveAttachment pairing unions powers separation d d.batch_meetOrder maps - (fields 0).2 valid hI hI hP initial.1 initial.2.1 hQs hrs hμs - (fields 0).1 (fields 2).1 (fields 4).1 (fields 3).1 hMaps (fields 0).1 - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs - -open SetFormula -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) - -theorem exists_groundLiftEmbeddings - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) (hSs : Ss ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) - (hG : G ∈ M.sets) (hA : A ∈ M.sets) : - ∃ next : h.NextInputs M, - next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ - MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ - h.liftGraph M next ∈ M.sets ∧ - ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ - h.groundLiftFamily M next ∈ M.sets ∧ FunctionGraphOn I (h.groundLiftFamily M next) ∧ - (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ - ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → - MeetEmbeddingCode d.batchCarrier next.batchCarrier d.batchOrder next.batchOrder - d.batchMeetGraph next.batchMeetGraph f ∧ - ∀ a g x y, ZFSet.pair i a ∈ Sources → ZFSet.pair i g ∈ Reps → - x ∈ d.batchCarrier → ZFSet.pair x a ∈ d.batchOrder → - (ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A) := by - obtain ⟨next, hC, hrC, hμC, meet, graph, func, family, famFunc, entries, _⟩ := - h.exists_groundLiftGraphs M pairing unions powers separation hI hJ hD hrD - hQs hrs hμs hAs hEs hFs hSs hMaps hSources hReps hG hA - refine ⟨next, hC, hrC, hμC, meet, graph, func, family, famFunc, entries, ?_⟩ - intro i f entry - obtain ⟨hi, rfl⟩ := (entries i f).1 entry - refine ⟨h.liftSection_embedding M next ⟨i, hi⟩, ?_⟩ - intro a g x y source representative hx below - exact h.liftSection_agrees_on_base M next source representative hx below - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - -namespace PartitionPilot.Forcing.CodedRecursiveMapInputs -open SetFormula -universe u -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -include h in -theorem sources_on_current : ZFSet.IsFunc I d.batchCarrier Sources := by - refine ⟨?_, h.sources.2⟩ - intro z hz - obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (h.sources.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hi, old_mem_taggedExtension ha⟩ - -theorem nextMapInputs_of_family - (family : FunctionGraphOn I (h.groundLiftFamily M next)) - (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ - i ∈ I ∧ f = h.liftSection M next i) - (action : PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T)) : - CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T) := by - refine ⟨family, h.sources_on_current, h.representatives, h.group, action, ?_, ?_⟩ - · intro i f entry - obtain ⟨hi, rfl⟩ := (entries i f).1 entry - exact h.liftSection_embedding M next ⟨i, hi⟩ - · intro i a g f x y source representative entry hx lower - obtain ⟨_, rfl⟩ := (entries i f).1 entry - exact (h.liftSection_agrees_on_base M next source representative hx lower).trans - (h.nextAction_old_iff hx).symm - -theorem ground_nextMapInputs - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) - (hL : d.batchCarrier ∈ M.sets) (hC : next.batchCarrier ∈ M.sets) - (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) - (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) - (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) - (action : PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T)) : - h.groundLiftFamily M next ∈ M.sets ∧ - CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T) := by - obtain ⟨_, ground, family, entries, _⟩ := h.groundLiftFamily_spec M - pairing unions powers separation next hI hJ hD hL hC hQs hrs hAs - hMaps hSources hFs hReps hG hA - exact ⟨ground, h.nextMapInputs_of_family M next family entries action⟩ - -end PartitionPilot.Forcing.CodedRecursiveMapInputs - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundBatchEmbeddingRecognition +import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionEmbeddings + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundRecursiveAttachment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I J D L rD rL μD μL Qs rs μs As Es Fs Ss Maps Sources : ZFSet.{u}} + (d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss) + (target : MeetOrderCode L rL μL) (maps : FunctionGraphOn I Maps) + (sources : ZFSet.IsFunc I D Sources) + (valid : ∀ i S, ZFSet.pair i S ∈ Maps → MeetEmbeddingCode D L rD rL μD μL S) + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hL : L ∈ M.sets) (hrL : rL ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) + (hSs : Ss ∈ M.sets) (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) : + let K := recursiveAttachmentIndices I J D (⋃₀ ⋃₀ Fs) Sources Fs + K ∈ M.sets ∧ + (∀ i j a F, ZFSet.pair i a ∈ Sources → ZFSet.pair j F ∈ Fs → + (ZFSet.pair i j ∈ K ↔ a ∉ F)) ∧ + ∃ next : AttachmentBatchInputs L rL μL K + (pairSecondField I J K Qs) (pairSecondField I J K rs) + (pairSecondField I J K μs) (pairSecondField I J K As) + (M.groundPairCompositions K I J (familyPointBound Qs) D L Es Maps) + (M.groundPairPushFilters K I J L rL Maps Fs) + (recursiveSeparatorFamily K I J D L Maps Ss), + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ + ∃ family ∈ M.sets, FunctionGraphOn K family ∧ + (∀ i f, ZFSet.pair i f ∈ family ↔ i ∈ K ∧ + f = batchTemplateGraph K L (pairSecondField I J K Qs) + (pairSecondField I J K rs) (pairSecondField I J K As) + (M.groundPairCompositions K I J (familyPointBound Qs) D L Es Maps) i) ∧ + ∀ (i : {i : ZFSet.{u} // i ∈ K}) f, ZFSet.pair i.val f ∈ family → + MeetEmbeddingCode (next.space i) next.batchCarrier (next.rel i) next.batchOrder + (next.meet i) next.batchMeetGraph f := by + dsimp only + let K := recursiveAttachmentIndices I J D (⋃₀ ⋃₀ Fs) Sources Fs + have hK : K ∈ M.sets := M.recursiveAttachmentIndices_mem pairing unions powers separation + hI hJ hD (M.union_mem unions (M.union_mem unions hFs)) hSources hFs + have subset : K ⊆ ZFSet.prod I J := recursiveAttachmentIndices_subset _ _ _ _ _ _ + have fields {H : ZFSet.{u}} (hH : H ∈ M.sets) : pairSecondField I J K H ∈ M.sets := + M.pairFieldGraph_mem pairing unions powers separation false hI hJ hK + (M.union_mem unions (M.union_mem unions hH)) hH + have composites := M.groundPairCompositions_spec pairing unions powers separation hK hI hJ + (M.familyPointBound_mem unions hQs) hD hL hEs hMaps d.embeddings maps subset + have filters := M.groundPairPushFilters_spec pairing unions powers separation + hK hI hJ hL hrL hMaps hFs maps d.filters subset + let next := M.groundRecursiveBatchInputs pairing unions powers separation d target maps valid subset + hK hI hJ hD hL hrL hQs hEs hFs hMaps + refine ⟨hK, ?_, next, ?_⟩ + · intro i j a F source filter + exact recursiveAttachmentIndices_entry_iff sources d.filters.to_isFunc source filter + · exact M.exists_batchAttachment_embedding_family pairing unions powers separation next + hL hrL hK (fields hQs) (fields hrs) (fields hμs) (fields hAs) + composites.1 filters.1 + (M.recursiveSeparatorFamily_mem pairing unions powers separation hK hI hJ hD hL hMaps hSs) + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +open SetFormula +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) + +noncomputable abbrev groundLiftFamily (next : h.NextInputs M) := + M.groundLiftedCompressionFamily I J D d.batchCarrier next.batchCarrier + (indexedAttachmentFresh J Qs rs As) (familyPointBound Qs) Maps Sources Fs Reps G A + +theorem groundLiftFamily_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (next : h.NextInputs M) (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hL : d.batchCarrier ∈ M.sets) (hC : next.batchCarrier ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) + (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) : + h.liftGraph M next ∈ M.sets ∧ h.groundLiftFamily M next ∈ M.sets ∧ + FunctionGraphOn I (h.groundLiftFamily M next) ∧ + (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ + ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → + ZFSet.IsFunc d.batchCarrier next.batchCarrier f := by + have hN := M.indexedAttachmentFresh_mem pairing unions powers separation hJ hQs hrs hAs + have hB := M.familyPointBound_mem unions hQs + have graph := M.liftedCompressionGraph_mem pairing unions powers separation + hI hJ hD hL hC hN hB hMaps hSources hFs hReps hG hA + obtain ⟨member, function, entries⟩ := M.groundLiftedCompressionFamily_spec + pairing unions powers separation hI hJ hD hL hC hN hB hMaps hSources hFs hReps hG hA + refine ⟨graph, member, function, entries, ?_⟩ + intro i f entry + obtain ⟨hi, rfl⟩ := (entries i f).1 entry + exact h.liftSection_function M next hi + +theorem exists_groundLiftGraphs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) (hSs : Ss ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hA : A ∈ M.sets) : + ∃ next : h.NextInputs M, + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ + h.liftGraph M next ∈ M.sets ∧ + ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ + h.groundLiftFamily M next ∈ M.sets ∧ FunctionGraphOn I (h.groundLiftFamily M next) ∧ + (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ + ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → + ZFSet.IsFunc d.batchCarrier next.batchCarrier f := by + obtain ⟨hL, hrL, _, _, _, _⟩ := M.batchAttachment_ground_codes + pairing unions powers separation d hD hrD hJ hQs hrs hμs hAs hEs hFs + obtain ⟨_, _, next, hC, hrC, hμC, meet, _⟩ := M.groundRecursiveAttachment + pairing unions powers separation d d.batch_meetOrder h.maps h.sources h.valid + hI hJ hD hL hrL hQs hrs hμs hAs hEs hFs hSs hMaps hSources + obtain ⟨graph, family, function, entries, functions⟩ := h.groundLiftFamily_spec M + pairing unions powers separation next hI hJ hD hL hC hQs hrs hAs + hMaps hSources hFs hReps hG hA + exact ⟨next, hC, hrC, hμC, meet, graph, h.liftGraph_function M next, + family, function, entries, functions⟩ + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem groundEligibleRecursiveAttachment + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {P G r μ A Labels m inv one : ZFSet.{u}} + (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hr : r ∈ M.sets) (hμ : μ ∈ M.sets) + (hA : A ∈ M.sets) (hLabels : Labels ∈ M.sets) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Qs := constantFamilyGraph I P + let rs := constantFamilyGraph I r + let μs := constantFamilyGraph I μ + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Fs := literalTaskFilterGraph I P R U Labels + let Ss := literalTaskSeparatorGraph I P R U Labels + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + let Maps := M.batchEmbeddingFamily I P Qs rs As Es + let K := recursiveAttachmentIndices I I P (⋃₀ ⋃₀ Fs) As Fs + K ∈ M.sets ∧ + (∀ i j a F, ZFSet.pair i a ∈ As → ZFSet.pair j F ∈ Fs → + (ZFSet.pair i j ∈ K ↔ a ∉ F)) ∧ + ∃ next : AttachmentBatchInputs d.batchCarrier d.batchOrder d.batchMeetGraph K + (pairSecondField I I K Qs) (pairSecondField I I K rs) + (pairSecondField I I K μs) (pairSecondField I I K As) + (M.groundPairCompositions K I I (familyPointBound Qs) P d.batchCarrier Es Maps) + (M.groundPairPushFilters K I I d.batchCarrier d.batchOrder Maps Fs) + (recursiveSeparatorFamily K I I P d.batchCarrier Maps Ss), + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ + ∃ family ∈ M.sets, FunctionGraphOn K family ∧ + (∀ i f, ZFSet.pair i f ∈ family ↔ i ∈ K ∧ + f = batchTemplateGraph K d.batchCarrier (pairSecondField I I K Qs) + (pairSecondField I I K rs) (pairSecondField I I K As) + (M.groundPairCompositions K I I (familyPointBound Qs) P d.batchCarrier Es Maps) i) ∧ + ∀ (i : {i : ZFSet.{u} // i ∈ K}) f, ZFSet.pair i.val f ∈ family → + MeetEmbeddingCode (next.space i) next.batchCarrier (next.rel i) next.batchOrder + (next.meet i) next.batchMeetGraph f := by + let I := M.groundEligibleTasks P G r μ A Labels + let R := M.groundRelations P P + let U := M.groundMeetFilters P r μ + let Qs := constantFamilyGraph I P + let rs := constantFamilyGraph I r + let As := literalTaskSourceGraph I P R U Labels + let Es := literalTaskBaseGraph I P R U Labels + let Maps := M.batchEmbeddingFamily I P Qs rs As Es + let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet + obtain ⟨hI, hQs, hrs, hμs, fields⟩ := M.groundEligibleTaskFields + pairing unions powers separation hP hG hr hμ hA hLabels meet + have initial := M.groundEligibleTaskAttachment pairing unions powers separation + hP hG hr hμ hA hLabels group action meet + obtain ⟨hMaps, maps, entries⟩ := M.batchEmbeddingFamily_spec + pairing unions powers separation hI hP hQs hrs (fields 0).1 (fields 2).1 + have valid : ∀ i S, ZFSet.pair i S ∈ Maps → + MeetEmbeddingCode P d.batchCarrier r d.batchOrder μ d.batchMeetGraph S := by + intro i S entry + obtain ⟨hi, equal⟩ := (entries i S).1 entry + let index : {i : ZFSet.{u} // i ∈ I} := ⟨i, hi⟩ + have spaceEq : d.space index = P := + ((pair_mem_constantFamilyGraph I P _ _).1 (d.space_entry index)).2 + have relEq : d.rel index = r := + ((pair_mem_constantFamilyGraph I r _ _).1 (d.rel_entry index)).2 + have meetEq : d.meet index = μ := + ((pair_mem_constantFamilyGraph I μ _ _).1 (d.meet_entry index)).2 + rw [equal] + simpa only [spaceEq, relEq, meetEq] using d.batch_template_embedding_code index + exact M.groundRecursiveAttachment pairing unions powers separation d d.batch_meetOrder maps + (fields 0).2 valid hI hI hP initial.1 initial.2.1 hQs hrs hμs + (fields 0).1 (fields 2).1 (fields 4).1 (fields 3).1 hMaps (fields 0).1 + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs + +open SetFormula +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) + +theorem exists_groundLiftEmbeddings + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) (hEs : Es ∈ M.sets) (hFs : Fs ∈ M.sets) (hSs : Ss ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hReps : Reps ∈ M.sets) + (hG : G ∈ M.sets) (hA : A ∈ M.sets) : + ∃ next : h.NextInputs M, + next.batchCarrier ∈ M.sets ∧ next.batchOrder ∈ M.sets ∧ next.batchMeetGraph ∈ M.sets ∧ + MeetOrderCode next.batchCarrier next.batchOrder next.batchMeetGraph ∧ + h.liftGraph M next ∈ M.sets ∧ + ZFSet.IsFunc (ZFSet.prod I d.batchCarrier) next.batchCarrier (h.liftGraph M next) ∧ + h.groundLiftFamily M next ∈ M.sets ∧ FunctionGraphOn I (h.groundLiftFamily M next) ∧ + (∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) ∧ + ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next → + MeetEmbeddingCode d.batchCarrier next.batchCarrier d.batchOrder next.batchOrder + d.batchMeetGraph next.batchMeetGraph f ∧ + ∀ a g x y, ZFSet.pair i a ∈ Sources → ZFSet.pair i g ∈ Reps → + x ∈ d.batchCarrier → ZFSet.pair x a ∈ d.batchOrder → + (ZFSet.pair x y ∈ f ↔ ZFSet.pair (ZFSet.pair g x) y ∈ A) := by + obtain ⟨next, hC, hrC, hμC, meet, graph, func, family, famFunc, entries, _⟩ := + h.exists_groundLiftGraphs M pairing unions powers separation hI hJ hD hrD + hQs hrs hμs hAs hEs hFs hSs hMaps hSources hReps hG hA + refine ⟨next, hC, hrC, hμC, meet, graph, func, family, famFunc, entries, ?_⟩ + intro i f entry + obtain ⟨hi, rfl⟩ := (entries i f).1 entry + refine ⟨h.liftSection_embedding M next ⟨i, hi⟩, ?_⟩ + intro a g x y source representative hx below + exact h.liftSection_agrees_on_base M next source representative hx below + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + +namespace PartitionPilot.Forcing.CodedRecursiveMapInputs +open SetFormula +universe u +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +include h in +theorem sources_on_current : ZFSet.IsFunc I d.batchCarrier Sources := by + refine ⟨?_, h.sources.2⟩ + intro z hz + obtain ⟨i, hi, a, ha, rfl⟩ := ZFSet.mem_prod.1 (h.sources.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hi, old_mem_taggedExtension ha⟩ + +theorem nextMapInputs_of_family + (family : FunctionGraphOn I (h.groundLiftFamily M next)) + (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ + i ∈ I ∧ f = h.liftSection M next i) + (action : PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T)) : + CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T) := by + refine ⟨family, h.sources_on_current, h.representatives, h.group, action, ?_, ?_⟩ + · intro i f entry + obtain ⟨hi, rfl⟩ := (entries i f).1 entry + exact h.liftSection_embedding M next ⟨i, hi⟩ + · intro i a g f x y source representative entry hx lower + obtain ⟨_, rfl⟩ := (entries i f).1 entry + exact (h.liftSection_agrees_on_base M next source representative hx lower).trans + (h.nextAction_old_iff hx).symm + +theorem ground_nextMapInputs + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (hI : I ∈ M.sets) (hJ : J ∈ M.sets) (hD : D ∈ M.sets) + (hL : d.batchCarrier ∈ M.sets) (hC : next.batchCarrier ∈ M.sets) + (hQs : Qs ∈ M.sets) (hrs : rs ∈ M.sets) (hAs : As ∈ M.sets) + (hMaps : Maps ∈ M.sets) (hSources : Sources ∈ M.sets) (hFs : Fs ∈ M.sets) + (hReps : Reps ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets) + (action : PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T)) : + h.groundLiftFamily M next ∈ M.sets ∧ + CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T) := by + obtain ⟨_, ground, family, entries, _⟩ := h.groundLiftFamily_spec M + pairing unions powers separation next hI hJ hD hL hC hQs hrs hAs + hMaps hSources hFs hReps hG hA + exact ⟨ground, h.nextMapInputs_of_family M next family entries action⟩ + +end PartitionPilot.Forcing.CodedRecursiveMapInputs + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementInclusionCoherence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementInclusionCoherence.lean index 773a009b55bcc451ee4812ec4705ea5a7dd15b53..df99b797a3a3b16a6cb62d60b80d4f8b86428780 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementInclusionCoherence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementInclusionCoherence.lean @@ -1,77 +1,77 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection - -namespace OAI - -section - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -open SetRealization SetFormula -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha beta : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (ordinal : ordinalSetProperty stages) (middleOrdinal : ordinalSetProperty alpha) -variable (lowerOrdinal : ordinalSetProperty beta) (subset : alpha ⊆ stages) (below : beta ⊆ alpha) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) -variable (hAlpha : alpha ∈ M.sets) (hBeta : beta ∈ M.sets) (hRows : rows ∈ M.sets) -variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) -variable (mono : ∀ level (d : Fin 15 → ZFSet.{u}), - ZFSet.pair level (refinementFormulaDataCode d) ∈ history → - ∀ A lower stronger, stageOneRawTests M d A lower → - ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) -local notation "U" => M.refinementHistoryForcing rows T stages history -local notation "V" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) -local notation "W" => M.refinementHistoryForcing rows T beta (graphRestriction beta history) -local notation "nestedW" => M.refinementHistoryForcing rows T beta (graphRestriction beta (graphRestriction alpha history)) -local notation "first" => inclusionFunction (run.restrict middleOrdinal subset) middleOrdinal lowerOrdinal below - pairing unions powers separation infinite choice hAlpha (M.graphRestriction_mem unions separation hAlpha hHistory) - hT hBeta hRows top topMem topRows - (fun level d entry => mono level d (And.left (Iff.mp pair_mem_graphRestriction entry))) -local notation "second" => run.inclusionFunction ordinal middleOrdinal subset - pairing unions powers separation infinite choice hStages hHistory hT hAlpha hRows top topMem topRows mono -local notation "direct" => run.inclusionFunction ordinal lowerOrdinal (fun _ h => subset (below h)) - pairing unions powers separation infinite choice hStages hHistory hT hBeta hRows top topMem topRows mono - -theorem inclusionFunction_graph_comp : - relationCompose W V U - ((SetMembers.presentation nestedW).graph (SetMembers.presentation V) first) - ((SetMembers.presentation V).graph (SetMembers.presentation U) second) = - (SetMembers.presentation W).graph (SetMembers.presentation U) direct := by - have firstCode := (run.restrict middleOrdinal subset).inclusionFunction_raw middleOrdinal lowerOrdinal below - pairing unions powers separation infinite choice hAlpha (M.graphRestriction_mem unions separation hAlpha hHistory) - hT hBeta hRows top topMem topRows - (fun level d entry => mono level d (And.left (Iff.mp pair_mem_graphRestriction entry))) - have directCode := run.inclusionFunction_raw ordinal lowerOrdinal (fun _ h => subset (below h)) - pairing unions powers separation infinite choice hStages hHistory hT hBeta hRows top topMem topRows mono - have intoMiddle (x : ZFSet.{u}) (member : x ∈ W) : x ∈ V := by - have nested : x ∈ nestedW := by rwa [graphRestriction_restrict below] - let p := SetMembers.ofMem x nested - have mem := SetMembers.raw_mem (first p) - rwa [firstCode p, SetMembers.raw_ofMem] at mem - have intoUpper (x : ZFSet.{u}) (member : x ∈ W) : x ∈ U := by - let p := SetMembers.ofMem x member - have mem := SetMembers.raw_mem (direct p) - rwa [directCode p, SetMembers.raw_ofMem] at mem - rw [(run.restrict middleOrdinal subset).inclusionFunction_graph, run.inclusionFunction_graph, - run.inclusionFunction_graph, graphRestriction_restrict below] - apply ZFSet.ext - intro z - rw [mem_relationCompose, mem_identityFunctionGraph] - constructor - · rintro ⟨x, hx, y, _, w, _, rfl, firstEdge, secondEdge⟩ - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph W x y).1 firstEdge - obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph V x w).1 secondEdge - exact ⟨x, hx, rfl⟩ - · rintro ⟨x, hx, rfl⟩ - exact ⟨x, hx, x, intoMiddle x hx, x, intoUpper x hx, rfl, - (pair_mem_identityFunctionGraph W x x).2 ⟨rfl, hx⟩, - (pair_mem_identityFunctionGraph V x x).2 ⟨rfl, intoMiddle x hx⟩⟩ - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection + +namespace OAI + +section + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +open SetRealization SetFormula +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history alpha beta : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (ordinal : ordinalSetProperty stages) (middleOrdinal : ordinalSetProperty alpha) +variable (lowerOrdinal : ordinalSetProperty beta) (subset : alpha ⊆ stages) (below : beta ⊆ alpha) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) +variable (hAlpha : alpha ∈ M.sets) (hBeta : beta ∈ M.sets) (hRows : rows ∈ M.sets) +variable (top : ZFSet.{u}) (topMem : top ∈ rows) (topRows : ∀ row ∈ rows, ZFSet.pair row top ∈ rowOrder) +variable (mono : ∀ level (d : Fin 15 → ZFSet.{u}), + ZFSet.pair level (refinementFormulaDataCode d) ∈ history → + ∀ A lower stronger, stageOneRawTests M d A lower → + ZFSet.pair stronger lower ∈ d 8 → stageOneRawTests M d A stronger) +local notation "U" => M.refinementHistoryForcing rows T stages history +local notation "V" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) +local notation "W" => M.refinementHistoryForcing rows T beta (graphRestriction beta history) +local notation "nestedW" => M.refinementHistoryForcing rows T beta (graphRestriction beta (graphRestriction alpha history)) +local notation "first" => inclusionFunction (run.restrict middleOrdinal subset) middleOrdinal lowerOrdinal below + pairing unions powers separation infinite choice hAlpha (M.graphRestriction_mem unions separation hAlpha hHistory) + hT hBeta hRows top topMem topRows + (fun level d entry => mono level d (And.left (Iff.mp pair_mem_graphRestriction entry))) +local notation "second" => run.inclusionFunction ordinal middleOrdinal subset + pairing unions powers separation infinite choice hStages hHistory hT hAlpha hRows top topMem topRows mono +local notation "direct" => run.inclusionFunction ordinal lowerOrdinal (fun _ h => subset (below h)) + pairing unions powers separation infinite choice hStages hHistory hT hBeta hRows top topMem topRows mono + +theorem inclusionFunction_graph_comp : + relationCompose W V U + ((SetMembers.presentation nestedW).graph (SetMembers.presentation V) first) + ((SetMembers.presentation V).graph (SetMembers.presentation U) second) = + (SetMembers.presentation W).graph (SetMembers.presentation U) direct := by + have firstCode := (run.restrict middleOrdinal subset).inclusionFunction_raw middleOrdinal lowerOrdinal below + pairing unions powers separation infinite choice hAlpha (M.graphRestriction_mem unions separation hAlpha hHistory) + hT hBeta hRows top topMem topRows + (fun level d entry => mono level d (And.left (Iff.mp pair_mem_graphRestriction entry))) + have directCode := run.inclusionFunction_raw ordinal lowerOrdinal (fun _ h => subset (below h)) + pairing unions powers separation infinite choice hStages hHistory hT hBeta hRows top topMem topRows mono + have intoMiddle (x : ZFSet.{u}) (member : x ∈ W) : x ∈ V := by + have nested : x ∈ nestedW := by rwa [graphRestriction_restrict below] + let p := SetMembers.ofMem x nested + have mem := SetMembers.raw_mem (first p) + rwa [firstCode p, SetMembers.raw_ofMem] at mem + have intoUpper (x : ZFSet.{u}) (member : x ∈ W) : x ∈ U := by + let p := SetMembers.ofMem x member + have mem := SetMembers.raw_mem (direct p) + rwa [directCode p, SetMembers.raw_ofMem] at mem + rw [(run.restrict middleOrdinal subset).inclusionFunction_graph, run.inclusionFunction_graph, + run.inclusionFunction_graph, graphRestriction_restrict below] + apply ZFSet.ext + intro z + rw [mem_relationCompose, mem_identityFunctionGraph] + constructor + · rintro ⟨x, hx, y, _, w, _, rfl, firstEdge, secondEdge⟩ + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph W x y).1 firstEdge + obtain ⟨rfl, _⟩ := (pair_mem_identityFunctionGraph V x w).1 secondEdge + exact ⟨x, hx, rfl⟩ + · rintro ⟨x, hx, rfl⟩ + exact ⟨x, hx, x, intoMiddle x hx, x, intoUpper x hx, rfl, + (pair_mem_identityFunctionGraph W x x).2 ⟨rfl, hx⟩, + (pair_mem_identityFunctionGraph V x x).2 ⟨rfl, intoMiddle x hx⟩⟩ + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementMapCoherence.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementMapCoherence.lean index b2df0ddbbe9820cc2f84880f6224e01e7f3ad01e..d8fc9b89e88ef295966fb0fe30e98bfd2621bbc0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementMapCoherence.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveRefinementMapCoherence.lean @@ -1,78 +1,78 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection - -namespace OAI - -section - -namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory -open SetRealization -universe u -variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} -variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) -variable (ordinal : ordinalSetProperty stages) -local notation "U" => M.refinementHistoryForcing rows T stages history -local notation "levels" => refinementDataHistoryLevels stages history T - -theorem restrictionFunction_self_raw (x : SetMembers U) : - SetMembers.raw (run.restrictionFunction ordinal ordinal (fun _ h => h) x) = SetMembers.raw x := by - obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem x)) - have member := code ▸ SetMembers.raw_mem x - have data := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 - ((M.mem_refinementHistoryForcing rows T stages history _).1 member).1).2.2.1 - rw [run.restrictionFunction_raw ordinal ordinal (fun _ h => h) x row A code, - assignmentCut_full run.carriers.data.levels_function data, code] - -theorem restrictionFunction_graph_self : - (SetMembers.presentation U).graph - (SetMembers.presentation (M.refinementHistoryForcing rows T stages (graphRestriction stages history))) - (run.restrictionFunction ordinal ordinal (fun _ h => h)) = identityFunctionGraph U := by - rw [run.restrictionFunction_graph, run.carriers.data.function.restriction_eq] - apply rowAssignmentCutGraph_identity - · intro p member - obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history member) - exact ⟨row, A, code⟩ - · intro row A member - have data := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 - ((M.mem_refinementHistoryForcing rows T stages history _).1 member).1).2.2.1 - exact assignmentCut_full run.carriers.data.levels_function data - -variable {alpha beta : ZFSet.{u}} (middleOrdinal : ordinalSetProperty alpha) -variable (lowerOrdinal : ordinalSetProperty beta) (subset : alpha ⊆ stages) (below : beta ⊆ alpha) -local notation "middleRun" => run.restrict middleOrdinal subset -local notation "V" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) -local notation "W" => M.refinementHistoryForcing rows T beta (graphRestriction beta history) -local notation "nestedW" => M.refinementHistoryForcing rows T beta - (graphRestriction beta (graphRestriction alpha history)) -local notation "direct" => run.restrictionFunction ordinal lowerOrdinal (fun _ h => subset (below h)) -local notation "first" => run.restrictionFunction ordinal middleOrdinal subset -local notation "second" => restrictionFunction (run.restrict middleOrdinal subset) middleOrdinal lowerOrdinal below - -theorem restrictionFunction_comp_raw (x : SetMembers U) : - SetMembers.raw (second (first x)) = SetMembers.raw (direct x) := by - obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 - (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem x)) - have firstCode := run.restrictionFunction_raw ordinal middleOrdinal subset x row A code - rw [(middleRun).restrictionFunction_raw middleOrdinal lowerOrdinal below (first x) row - (assignmentCut levels alpha A) firstCode, - run.restrictionFunction_raw ordinal lowerOrdinal (fun _ h => subset (below h)) x row A code, - run.carriers.data.prefix_cut subset below, assignmentCut_nested below] - -theorem restrictionFunction_graph_comp : - relationCompose U V W - ((SetMembers.presentation U).graph (SetMembers.presentation V) first) - ((SetMembers.presentation V).graph (SetMembers.presentation nestedW) second) = - (SetMembers.presentation U).graph (SetMembers.presentation W) direct := by - rw [run.restrictionFunction_graph, (middleRun).restrictionFunction_graph, - run.restrictionFunction_graph, graphRestriction_restrict below] - apply rowAssignmentCutGraph_compose - · intro row A member - exact run.cut_mem_le ordinal middleOrdinal subset member - · intro row A _ - rw [run.carriers.data.prefix_cut subset below, assignmentCut_nested below] - -end PartitionPilot.Forcing.RecursiveRefinementOrderHistory - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRowCompleteProjection + +namespace OAI + +section + +namespace PartitionPilot.Forcing.RecursiveRefinementOrderHistory +open SetRealization +universe u +variable {M : TransitiveGround.{u}} {rows rowOrder T stages history : ZFSet.{u}} +variable (run : RecursiveRefinementOrderHistory M rows rowOrder T stages history) +variable (ordinal : ordinalSetProperty stages) +local notation "U" => M.refinementHistoryForcing rows T stages history +local notation "levels" => refinementDataHistoryLevels stages history T + +theorem restrictionFunction_self_raw (x : SetMembers U) : + SetMembers.raw (run.restrictionFunction ordinal ordinal (fun _ h => h) x) = SetMembers.raw x := by + obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem x)) + have member := code ▸ SetMembers.raw_mem x + have data := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 + ((M.mem_refinementHistoryForcing rows T stages history _).1 member).1).2.2.1 + rw [run.restrictionFunction_raw ordinal ordinal (fun _ h => h) x row A code, + assignmentCut_full run.carriers.data.levels_function data, code] + +theorem restrictionFunction_graph_self : + (SetMembers.presentation U).graph + (SetMembers.presentation (M.refinementHistoryForcing rows T stages (graphRestriction stages history))) + (run.restrictionFunction ordinal ordinal (fun _ h => h)) = identityFunctionGraph U := by + rw [run.restrictionFunction_graph, run.carriers.data.function.restriction_eq] + apply rowAssignmentCutGraph_identity + · intro p member + obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 (M.refinementHistoryForcing_shape rows T stages history member) + exact ⟨row, A, code⟩ + · intro row A member + have data := ((M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 + ((M.mem_refinementHistoryForcing rows T stages history _).1 member).1).2.2.1 + exact assignmentCut_full run.carriers.data.levels_function data + +variable {alpha beta : ZFSet.{u}} (middleOrdinal : ordinalSetProperty alpha) +variable (lowerOrdinal : ordinalSetProperty beta) (subset : alpha ⊆ stages) (below : beta ⊆ alpha) +local notation "middleRun" => run.restrict middleOrdinal subset +local notation "V" => M.refinementHistoryForcing rows T alpha (graphRestriction alpha history) +local notation "W" => M.refinementHistoryForcing rows T beta (graphRestriction beta history) +local notation "nestedW" => M.refinementHistoryForcing rows T beta + (graphRestriction beta (graphRestriction alpha history)) +local notation "direct" => run.restrictionFunction ordinal lowerOrdinal (fun _ h => subset (below h)) +local notation "first" => run.restrictionFunction ordinal middleOrdinal subset +local notation "second" => restrictionFunction (run.restrict middleOrdinal subset) middleOrdinal lowerOrdinal below + +theorem restrictionFunction_comp_raw (x : SetMembers U) : + SetMembers.raw (second (first x)) = SetMembers.raw (direct x) := by + obtain ⟨row, _, A, _, code⟩ := ZFSet.mem_prod.1 + (M.refinementHistoryForcing_shape rows T stages history (SetMembers.raw_mem x)) + have firstCode := run.restrictionFunction_raw ordinal middleOrdinal subset x row A code + rw [(middleRun).restrictionFunction_raw middleOrdinal lowerOrdinal below (first x) row + (assignmentCut levels alpha A) firstCode, + run.restrictionFunction_raw ordinal lowerOrdinal (fun _ h => subset (below h)) x row A code, + run.carriers.data.prefix_cut subset below, assignmentCut_nested below] + +theorem restrictionFunction_graph_comp : + relationCompose U V W + ((SetMembers.presentation U).graph (SetMembers.presentation V) first) + ((SetMembers.presentation V).graph (SetMembers.presentation nestedW) second) = + (SetMembers.presentation U).graph (SetMembers.presentation W) direct := by + rw [run.restrictionFunction_graph, (middleRun).restrictionFunction_graph, + run.restrictionFunction_graph, graphRestriction_restrict below] + apply rowAssignmentCutGraph_compose + · intro row A member + exact run.cut_mem_le ordinal middleOrdinal subset member + · intro row A _ + rw [run.carriers.data.prefix_cut subset below, assignmentCut_nested below] + +end PartitionPilot.Forcing.RecursiveRefinementOrderHistory + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStateFieldEnvironments.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStateFieldEnvironments.lean index 4ff979bcf48ef662c387a7af3da0801410c1d7ac..c80191874d4706cf50f5d4b138cced42251ab3df 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStateFieldEnvironments.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStateFieldEnvironments.lean @@ -1,368 +1,368 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInvariantSuccessors - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing - -universe u - -structure RecursiveStateData where - D : ZFSet.{u} - rD : ZFSet.{u} - μD : ZFSet.{u} - J : ZFSet.{u} - Qs : ZFSet.{u} - rs : ZFSet.{u} - μs : ZFSet.{u} - As : ZFSet.{u} - Es : ZFSet.{u} - Fs : ZFSet.{u} - Ss : ZFSet.{u} - Maps : ZFSet.{u} - A : ZFSet.{u} - -namespace RecursiveStateData - -def field (state : RecursiveStateData.{u}) : Fin 13 → ZFSet.{u} := - Fin.cases state.D (Fin.cases state.rD (Fin.cases state.μD (Fin.cases state.J (Fin.cases state.Qs (Fin.cases state.rs (Fin.cases state.μs (Fin.cases state.As (Fin.cases state.Es (Fin.cases state.Fs (Fin.cases state.Ss (Fin.cases state.Maps (Fin.cases state.A (Fin.elim0))))))))))))) - -noncomputable def code (state : RecursiveStateData.{u}) : ZFSet.{u} := - nonemptyTupleCode 12 state.field - -theorem field_injective : Function.Injective field.{u} := by - intro first second equal - cases first - cases second - congr 1 - · exact congrFun equal (0 : Fin 13) - · exact congrFun equal (1 : Fin 13) - · exact congrFun equal (2 : Fin 13) - · exact congrFun equal (3 : Fin 13) - · exact congrFun equal (4 : Fin 13) - · exact congrFun equal (5 : Fin 13) - · exact congrFun equal (6 : Fin 13) - · exact congrFun equal (7 : Fin 13) - · exact congrFun equal (8 : Fin 13) - · exact congrFun equal (9 : Fin 13) - · exact congrFun equal (10 : Fin 13) - · exact congrFun equal (11 : Fin 13) - · exact congrFun equal (12 : Fin 13) - -theorem code_injective : Function.Injective code.{u} := by - intro first second equal - exact field_injective (nonemptyTupleCode_injective 12 equal) - -noncomputable def decode (z : ZFSet.{u}) (valid : ∃ state : RecursiveStateData.{u}, state.code = z) : - RecursiveStateData.{u} := Classical.choose valid - -theorem code_decode (z : ZFSet.{u}) (valid : ∃ state : RecursiveStateData.{u}, state.code = z) : - (decode z valid).code = z := Classical.choose_spec valid - -theorem decode_code (state : RecursiveStateData.{u}) : - decode state.code ⟨state, rfl⟩ = state := code_injective (code_decode _ _) - -theorem decode_field (state : RecursiveStateData.{u}) (j : Fin 13) : - (decode state.code ⟨state, rfl⟩).field j = state.field j := by rw [decode_code] - -end RecursiveStateData - -noncomputable def recursiveStateCode (D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}) : ZFSet.{u} := - (RecursiveStateData.mk D rD μD J Qs rs μs As Es Fs Ss Maps A).code - -theorem recursiveStateCode_inj - {D rD μD J Qs rs μs As Es Fs Ss Maps A D' rD' μD' J' Qs' rs' μs' As' Es' Fs' Ss' Maps' A' : ZFSet.{u}} : - recursiveStateCode D rD μD J Qs rs μs As Es Fs Ss Maps A = recursiveStateCode D' rD' μD' J' Qs' rs' μs' As' Es' Fs' Ss' Maps' A' ↔ - D = D' ∧ rD = rD' ∧ μD = μD' ∧ J = J' ∧ Qs = Qs' ∧ rs = rs' ∧ μs = μs' ∧ As = As' ∧ Es = Es' ∧ Fs = Fs' ∧ Ss = Ss' ∧ Maps = Maps' ∧ A = A' := by - constructor - · intro equal - exact RecursiveStateData.mk.inj (RecursiveStateData.code_injective equal) - · rintro ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ - rfl - -namespace BoundedFormula - -open SetFormula - -def recursiveStateFormula {n} (z D rD μD J Qs rs μs As Es Fs Ss Maps A : Fin n) : BoundedFormula n := - nonemptyTupleFormula 12 z - (Fin.cases D (Fin.cases rD (Fin.cases μD (Fin.cases J (Fin.cases Qs (Fin.cases rs (Fin.cases μs (Fin.cases As (Fin.cases Es (Fin.cases Fs (Fin.cases Ss (Fin.cases Maps (Fin.cases A (Fin.elim0)))))))))))))) - -theorem truth_recursiveStateFormula {n} (z D rD μD J Qs rs μs As Es Fs Ss Maps A : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (recursiveStateFormula z D rD μD J Qs rs μs As Es Fs Ss Maps A) env ↔ - env z = recursiveStateCode (env D) (env rD) (env μD) (env J) (env Qs) (env rs) (env μs) (env As) (env Es) (env Fs) (env Ss) (env Maps) (env A) := by - rw [recursiveStateFormula, truth_nonemptyTupleFormula] - rfl - -theorem realize_recursiveStateFormula (M : TransitiveGround.{u}) {n} - (z D rD μD J Qs rs μs As Es Fs Ss Maps A : Fin n) (env : Fin n → ZFSet.{u}) - (members : ∀ i, env i ∈ M.sets) : - Realize M.sets (recursiveStateFormula z D rD μD J Qs rs μs As Es Fs Ss Maps A).toFormula env ↔ - env z = recursiveStateCode (env D) (env rD) (env μD) (env J) (env Qs) (env rs) (env μs) (env As) (env Es) (env Fs) (env Ss) (env Maps) (env A) := - (realize_toFormula M _ env members).trans (truth_recursiveStateFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ env) - -end BoundedFormula - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem recursiveStateData_code_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (state : RecursiveStateData.{u}) (ground : ∀ j, state.field j ∈ M.sets) : - state.code ∈ M.sets := M.nonemptyTupleCode_mem pairing 12 state.field ground - -theorem recursiveStateData_field_mem (state : RecursiveStateData.{u}) - (ground : state.code ∈ M.sets) : ∀ j, state.field j ∈ M.sets := - M.nonemptyTupleCode_field_mem 12 state.field ground - -theorem recursiveStateData_code_mem_iff - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (state : RecursiveStateData.{u}) : - state.code ∈ M.sets ↔ ∀ j, state.field j ∈ M.sets := - ⟨M.recursiveStateData_field_mem state, M.recursiveStateData_code_mem pairing state⟩ - -theorem recursiveStateCode_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} - (hD : D ∈ M.sets) - (hrD : rD ∈ M.sets) - (hμD : μD ∈ M.sets) - (hJ : J ∈ M.sets) - (hQs : Qs ∈ M.sets) - (hrs : rs ∈ M.sets) - (hμs : μs ∈ M.sets) - (hAs : As ∈ M.sets) - (hEs : Es ∈ M.sets) - (hFs : Fs ∈ M.sets) - (hSs : Ss ∈ M.sets) - (hMaps : Maps ∈ M.sets) - (hA : A ∈ M.sets) - : recursiveStateCode D rD μD J Qs rs μs As Es Fs Ss Maps A ∈ M.sets := - M.recursiveStateData_code_mem pairing ⟨D, rD, μD, J, Qs, rs, μs, As, Es, Fs, Ss, Maps, A⟩ - (Fin.cases hD (Fin.cases hrD (Fin.cases hμD (Fin.cases hJ (Fin.cases hQs (Fin.cases hrs (Fin.cases hμs (Fin.cases hAs (Fin.cases hEs (Fin.cases hFs (Fin.cases hSs (Fin.cases hMaps (Fin.cases hA ((fun i => Fin.elim0 i))))))))))))))) - -theorem recursiveStateCode_mem_iff - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}) : - recursiveStateCode D rD μD J Qs rs μs As Es Fs Ss Maps A ∈ M.sets ↔ - D ∈ M.sets ∧ rD ∈ M.sets ∧ μD ∈ M.sets ∧ J ∈ M.sets ∧ Qs ∈ M.sets ∧ rs ∈ M.sets ∧ μs ∈ M.sets ∧ As ∈ M.sets ∧ Es ∈ M.sets ∧ Fs ∈ M.sets ∧ Ss ∈ M.sets ∧ Maps ∈ M.sets ∧ A ∈ M.sets := by - constructor - · intro ground - have fields := M.recursiveStateData_field_mem ⟨D, rD, μD, J, Qs, rs, μs, As, Es, Fs, Ss, Maps, A⟩ ground - exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, fields 7, fields 8, fields 9, fields 10, fields 11, fields 12⟩ - · rintro ⟨hD, hrD, hμD, hJ, hQs, hrs, hμs, hAs, hEs, hFs, hSs, hMaps, hA⟩ - exact M.recursiveStateCode_mem pairing hD hrD hμD hJ hQs hrs hμs hAs hEs hFs hSs hMaps hA - -end PartitionPilot.Forcing.TransitiveGround - -namespace PartitionPilot.Forcing -universe u - -namespace CodedRecursiveMapInputs -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} - -def toState (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) : RecursiveStateData := - ⟨D, rD, μD, J, Qs, rs, μs, As, Es, Fs, Ss, Maps, A⟩ - -end CodedRecursiveMapInputs - -namespace RecursiveStateData -noncomputable def fresh (state : RecursiveStateData.{u}) := - indexedAttachmentFresh state.J state.Qs state.rs state.As - -noncomputable def currentCarrier (state : RecursiveStateData.{u}) := - taggedExtension state.D state.fresh - -noncomputable def currentOrder (state : RecursiveStateData.{u}) := - codedAttachmentOrder state.D state.fresh state.rD - (batchAttachmentInsideGraph state.J state.Qs state.rs) - (batchAttachmentShadowGraph state.J state.D state.Qs state.μs state.As state.Es) - (batchAttachmentUpperGraph state.J state.D state.Qs state.Fs) - -noncomputable def currentMeet (state : RecursiveStateData.{u}) := - canonicalMeetGraph state.currentCarrier state.currentOrder - -noncomputable def successor (state : RecursiveStateData.{u}) (M : TransitiveGround.{u}) - (I Sources Reps G T : ZFSet.{u}) : RecursiveStateData.{u} := - let K := recursiveAttachmentIndices I state.J state.D (⋃₀ ⋃₀ state.Fs) Sources state.Fs - let Qs := pairSecondField I state.J K state.Qs - let rs := pairSecondField I state.J K state.rs - let μs := pairSecondField I state.J K state.μs - let As := pairSecondField I state.J K state.As - let N := indexedAttachmentFresh K Qs rs As - let C := taggedExtension state.currentCarrier N - { D := state.currentCarrier - rD := state.currentOrder - μD := state.currentMeet - J := K - Qs := Qs - rs := rs - μs := μs - As := As - Es := M.groundPairCompositions K I state.J (familyPointBound state.Qs) - state.D state.currentCarrier state.Es state.Maps - Fs := M.groundPairPushFilters K I state.J state.currentCarrier state.currentOrder state.Maps state.Fs - Ss := recursiveSeparatorFamily K I state.J state.D state.currentCarrier state.Maps state.Ss - Maps := M.groundLiftedCompressionFamily I state.J state.D state.currentCarrier C state.fresh - (familyPointBound state.Qs) state.Maps Sources state.Fs Reps G state.A - A := taggedActionGraph G state.currentCarrier N state.A - (indexedTaskActionGraph G K (familyPointBound state.Qs) N - (indexedTaskActionGraph G I state.J K T)) } - -end RecursiveStateData - -namespace CodedRecursiveMapInputs -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) - -theorem toState_currentCarrier : h.toState.currentCarrier = d.batchCarrier := rfl -theorem toState_currentOrder : h.toState.currentOrder = d.batchOrder := rfl -theorem toState_currentMeet : h.toState.currentMeet = d.batchMeetGraph := rfl - -theorem toState_successor (M : TransitiveGround.{u}) (next : h.NextInputs M) - (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T)) : - inputs.toState = h.toState.successor M I Sources Reps G T := rfl - -end CodedRecursiveMapInputs - -structure RecursiveStateCoherence (I : ZFSet.{u}) (first second : RecursiveStateData.{u}) : Prop where - carrier : first.D ⊆ second.D - order : ∀ x ∈ first.D, ∀ y ∈ first.D, - ZFSet.pair x y ∈ second.rD ↔ ZFSet.pair x y ∈ first.rD - meet : ∀ x ∈ first.D, ∀ y ∈ first.D, ∀ z, - ZFSet.pair (ZFSet.pair x y) z ∈ second.μD ↔ ZFSet.pair (ZFSet.pair x y) z ∈ first.μD - currentCarrier : first.currentCarrier ⊆ second.currentCarrier - currentOrder : ∀ x ∈ first.currentCarrier, ∀ y ∈ first.currentCarrier, - ZFSet.pair x y ∈ second.currentOrder ↔ ZFSet.pair x y ∈ first.currentOrder - currentMeet : ∀ x ∈ first.currentCarrier, ∀ y ∈ first.currentCarrier, ∀ z, - ZFSet.pair (ZFSet.pair x y) z ∈ second.currentMeet ↔ - ZFSet.pair (ZFSet.pair x y) z ∈ first.currentMeet - action : ∀ g x, x ∈ first.currentCarrier → ∀ y, - ZFSet.pair (ZFSet.pair g x) y ∈ second.A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ first.A - maps : ∀ i ∈ I, ∀ S S', ZFSet.pair i S ∈ first.Maps → ZFSet.pair i S' ∈ second.Maps → - ∀ x ∈ first.D, ∀ y, ZFSet.pair x y ∈ S' ↔ ZFSet.pair x y ∈ S - -namespace RecursiveStateCoherence -variable {I : ZFSet.{u}} {first middle last : RecursiveStateData.{u}} - -theorem refl (maps : FunctionGraphOn I first.Maps) : RecursiveStateCoherence I first first where - carrier := fun _ hx => hx - order := fun _ _ _ _ => Iff.rfl - meet := fun _ _ _ _ _ => Iff.rfl - currentCarrier := fun _ hx => hx - currentOrder := fun _ _ _ _ => Iff.rfl - currentMeet := fun _ _ _ _ _ => Iff.rfl - action := fun _ _ _ _ => Iff.rfl - maps := by - intro _ _ S S' firstEntry secondEntry _ _ _ - exact maps.unique firstEntry secondEntry ▸ Iff.rfl - -theorem trans (left : RecursiveStateCoherence I first middle) - (right : RecursiveStateCoherence I middle last) (middleMaps : FunctionGraphOn I middle.Maps) : - RecursiveStateCoherence I first last where - carrier := fun _ hx => right.carrier (left.carrier hx) - order := fun _ hx _ hy => (right.order _ (left.carrier hx) _ (left.carrier hy)).trans (left.order _ hx _ hy) - meet := fun _ hx _ hy _ => (right.meet _ (left.carrier hx) _ (left.carrier hy) _).trans (left.meet _ hx _ hy _) - currentCarrier := fun _ hx => right.currentCarrier (left.currentCarrier hx) - currentOrder := fun _ hx _ hy => - (right.currentOrder _ (left.currentCarrier hx) _ (left.currentCarrier hy)).trans (left.currentOrder _ hx _ hy) - currentMeet := fun _ hx _ hy _ => - (right.currentMeet _ (left.currentCarrier hx) _ (left.currentCarrier hy) _).trans (left.currentMeet _ hx _ hy _) - action := fun _ _ hx _ => (right.action _ _ (left.currentCarrier hx) _).trans (left.action _ _ hx _) - maps := by - intro i hi S S' oldEntry newEntry x hx y - obtain ⟨B, middleEntry⟩ := middleMaps.total hi - exact (right.maps i hi B S' middleEntry newEntry x (left.carrier hx) y).trans - (left.maps i hi S B oldEntry middleEntry x hx y) - -end RecursiveStateCoherence - -namespace CodedRecursiveMapInputs -variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} -variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} -variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) -variable (M : TransitiveGround.{u}) (next : h.NextInputs M) - -theorem next_coherent - (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) - (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps - G m inv one (h.nextActionGraph T)) : RecursiveStateCoherence I h.toState inputs.toState where - carrier := fun _ hx => old_mem_taggedExtension hx - order := fun _ hx _ hy => d.old_order_iff hx hy - meet := fun _ hx _ hy _ => d.old_meet_iff hx hy - currentCarrier := fun _ hx => old_mem_taggedExtension hx - currentOrder := fun _ hx _ hy => next.old_order_iff hx hy - currentMeet := fun _ hx _ hy _ => next.old_meet_iff hx hy - action := fun _ _ hx _ => h.nextAction_old_iff hx - maps := by - intro i _ S S' oldEntry newEntry x hx y - obtain ⟨_, rfl⟩ := (entries i S').1 newEntry - exact h.liftSection_old_iff M next oldEntry hx - -end CodedRecursiveMapInputs - -end PartitionPilot.Forcing - -namespace PartitionPilot.Forcing.RecursiveStateData -universe u - -def ofFields (fields : Fin 13 → ZFSet.{u}) : RecursiveStateData.{u} := - ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, - fields 7, fields 8, fields 9, fields 10, fields 11, fields 12⟩ - -theorem ofFields_field (state : RecursiveStateData.{u}) : ofFields state.field = state := by - cases state - rfl - -theorem field_ofFields (fields : Fin 13 → ZFSet.{u}) : (ofFields fields).field = fields := by - funext j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - refine Fin.cases rfl (fun j => ?_) j - exact Fin.elim0 j - -theorem code_ofFields (fields : Fin 13 → ZFSet.{u}) : - (ofFields fields).code = nonemptyTupleCode 12 fields := by - rw [code, field_ofFields] - -def successorEnvironment (state : RecursiveStateData.{u}) (I Sources Reps G T : ZFSet.{u}) : - Fin 18 → ZFSet.{u} := - Fin.addCases (m := 13) (n := 5) state.field (SetFormula.extend I (SetFormula.extend Sources - (SetFormula.extend Reps (SetFormula.extend G (SetFormula.extend T Fin.elim0))))) - -noncomputable def successorCodeFromEnvironment (M : TransitiveGround.{u}) - (env : Fin 18 → ZFSet.{u}) : ZFSet.{u} := - ((ofFields (fun j => env (j.castAdd 5))).successor M - (env 13) (env 14) (env 15) (env 16) (env 17)).code - -theorem successorCodeFromEnvironment_spec (state : RecursiveStateData.{u}) - (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) : - successorCodeFromEnvironment M (state.successorEnvironment I Sources Reps G T) = - (state.successor M I Sources Reps G T).code := by - simp only [successorCodeFromEnvironment, successorEnvironment, Fin.addCases_left] - rw [ofFields_field] - rfl - -end PartitionPilot.Forcing.RecursiveStateData - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundInvariantSuccessors + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing + +universe u + +structure RecursiveStateData where + D : ZFSet.{u} + rD : ZFSet.{u} + μD : ZFSet.{u} + J : ZFSet.{u} + Qs : ZFSet.{u} + rs : ZFSet.{u} + μs : ZFSet.{u} + As : ZFSet.{u} + Es : ZFSet.{u} + Fs : ZFSet.{u} + Ss : ZFSet.{u} + Maps : ZFSet.{u} + A : ZFSet.{u} + +namespace RecursiveStateData + +def field (state : RecursiveStateData.{u}) : Fin 13 → ZFSet.{u} := + Fin.cases state.D (Fin.cases state.rD (Fin.cases state.μD (Fin.cases state.J (Fin.cases state.Qs (Fin.cases state.rs (Fin.cases state.μs (Fin.cases state.As (Fin.cases state.Es (Fin.cases state.Fs (Fin.cases state.Ss (Fin.cases state.Maps (Fin.cases state.A (Fin.elim0))))))))))))) + +noncomputable def code (state : RecursiveStateData.{u}) : ZFSet.{u} := + nonemptyTupleCode 12 state.field + +theorem field_injective : Function.Injective field.{u} := by + intro first second equal + cases first + cases second + congr 1 + · exact congrFun equal (0 : Fin 13) + · exact congrFun equal (1 : Fin 13) + · exact congrFun equal (2 : Fin 13) + · exact congrFun equal (3 : Fin 13) + · exact congrFun equal (4 : Fin 13) + · exact congrFun equal (5 : Fin 13) + · exact congrFun equal (6 : Fin 13) + · exact congrFun equal (7 : Fin 13) + · exact congrFun equal (8 : Fin 13) + · exact congrFun equal (9 : Fin 13) + · exact congrFun equal (10 : Fin 13) + · exact congrFun equal (11 : Fin 13) + · exact congrFun equal (12 : Fin 13) + +theorem code_injective : Function.Injective code.{u} := by + intro first second equal + exact field_injective (nonemptyTupleCode_injective 12 equal) + +noncomputable def decode (z : ZFSet.{u}) (valid : ∃ state : RecursiveStateData.{u}, state.code = z) : + RecursiveStateData.{u} := Classical.choose valid + +theorem code_decode (z : ZFSet.{u}) (valid : ∃ state : RecursiveStateData.{u}, state.code = z) : + (decode z valid).code = z := Classical.choose_spec valid + +theorem decode_code (state : RecursiveStateData.{u}) : + decode state.code ⟨state, rfl⟩ = state := code_injective (code_decode _ _) + +theorem decode_field (state : RecursiveStateData.{u}) (j : Fin 13) : + (decode state.code ⟨state, rfl⟩).field j = state.field j := by rw [decode_code] + +end RecursiveStateData + +noncomputable def recursiveStateCode (D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}) : ZFSet.{u} := + (RecursiveStateData.mk D rD μD J Qs rs μs As Es Fs Ss Maps A).code + +theorem recursiveStateCode_inj + {D rD μD J Qs rs μs As Es Fs Ss Maps A D' rD' μD' J' Qs' rs' μs' As' Es' Fs' Ss' Maps' A' : ZFSet.{u}} : + recursiveStateCode D rD μD J Qs rs μs As Es Fs Ss Maps A = recursiveStateCode D' rD' μD' J' Qs' rs' μs' As' Es' Fs' Ss' Maps' A' ↔ + D = D' ∧ rD = rD' ∧ μD = μD' ∧ J = J' ∧ Qs = Qs' ∧ rs = rs' ∧ μs = μs' ∧ As = As' ∧ Es = Es' ∧ Fs = Fs' ∧ Ss = Ss' ∧ Maps = Maps' ∧ A = A' := by + constructor + · intro equal + exact RecursiveStateData.mk.inj (RecursiveStateData.code_injective equal) + · rintro ⟨rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl⟩ + rfl + +namespace BoundedFormula + +open SetFormula + +def recursiveStateFormula {n} (z D rD μD J Qs rs μs As Es Fs Ss Maps A : Fin n) : BoundedFormula n := + nonemptyTupleFormula 12 z + (Fin.cases D (Fin.cases rD (Fin.cases μD (Fin.cases J (Fin.cases Qs (Fin.cases rs (Fin.cases μs (Fin.cases As (Fin.cases Es (Fin.cases Fs (Fin.cases Ss (Fin.cases Maps (Fin.cases A (Fin.elim0)))))))))))))) + +theorem truth_recursiveStateFormula {n} (z D rD μD J Qs rs μs As Es Fs Ss Maps A : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (recursiveStateFormula z D rD μD J Qs rs μs As Es Fs Ss Maps A) env ↔ + env z = recursiveStateCode (env D) (env rD) (env μD) (env J) (env Qs) (env rs) (env μs) (env As) (env Es) (env Fs) (env Ss) (env Maps) (env A) := by + rw [recursiveStateFormula, truth_nonemptyTupleFormula] + rfl + +theorem realize_recursiveStateFormula (M : TransitiveGround.{u}) {n} + (z D rD μD J Qs rs μs As Es Fs Ss Maps A : Fin n) (env : Fin n → ZFSet.{u}) + (members : ∀ i, env i ∈ M.sets) : + Realize M.sets (recursiveStateFormula z D rD μD J Qs rs μs As Es Fs Ss Maps A).toFormula env ↔ + env z = recursiveStateCode (env D) (env rD) (env μD) (env J) (env Qs) (env rs) (env μs) (env As) (env Es) (env Fs) (env Ss) (env Maps) (env A) := + (realize_toFormula M _ env members).trans (truth_recursiveStateFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ env) + +end BoundedFormula + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem recursiveStateData_code_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (state : RecursiveStateData.{u}) (ground : ∀ j, state.field j ∈ M.sets) : + state.code ∈ M.sets := M.nonemptyTupleCode_mem pairing 12 state.field ground + +theorem recursiveStateData_field_mem (state : RecursiveStateData.{u}) + (ground : state.code ∈ M.sets) : ∀ j, state.field j ∈ M.sets := + M.nonemptyTupleCode_field_mem 12 state.field ground + +theorem recursiveStateData_code_mem_iff + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (state : RecursiveStateData.{u}) : + state.code ∈ M.sets ↔ ∀ j, state.field j ∈ M.sets := + ⟨M.recursiveStateData_field_mem state, M.recursiveStateData_code_mem pairing state⟩ + +theorem recursiveStateCode_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}} + (hD : D ∈ M.sets) + (hrD : rD ∈ M.sets) + (hμD : μD ∈ M.sets) + (hJ : J ∈ M.sets) + (hQs : Qs ∈ M.sets) + (hrs : rs ∈ M.sets) + (hμs : μs ∈ M.sets) + (hAs : As ∈ M.sets) + (hEs : Es ∈ M.sets) + (hFs : Fs ∈ M.sets) + (hSs : Ss ∈ M.sets) + (hMaps : Maps ∈ M.sets) + (hA : A ∈ M.sets) + : recursiveStateCode D rD μD J Qs rs μs As Es Fs Ss Maps A ∈ M.sets := + M.recursiveStateData_code_mem pairing ⟨D, rD, μD, J, Qs, rs, μs, As, Es, Fs, Ss, Maps, A⟩ + (Fin.cases hD (Fin.cases hrD (Fin.cases hμD (Fin.cases hJ (Fin.cases hQs (Fin.cases hrs (Fin.cases hμs (Fin.cases hAs (Fin.cases hEs (Fin.cases hFs (Fin.cases hSs (Fin.cases hMaps (Fin.cases hA ((fun i => Fin.elim0 i))))))))))))))) + +theorem recursiveStateCode_mem_iff + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (D rD μD J Qs rs μs As Es Fs Ss Maps A : ZFSet.{u}) : + recursiveStateCode D rD μD J Qs rs μs As Es Fs Ss Maps A ∈ M.sets ↔ + D ∈ M.sets ∧ rD ∈ M.sets ∧ μD ∈ M.sets ∧ J ∈ M.sets ∧ Qs ∈ M.sets ∧ rs ∈ M.sets ∧ μs ∈ M.sets ∧ As ∈ M.sets ∧ Es ∈ M.sets ∧ Fs ∈ M.sets ∧ Ss ∈ M.sets ∧ Maps ∈ M.sets ∧ A ∈ M.sets := by + constructor + · intro ground + have fields := M.recursiveStateData_field_mem ⟨D, rD, μD, J, Qs, rs, μs, As, Es, Fs, Ss, Maps, A⟩ ground + exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, fields 7, fields 8, fields 9, fields 10, fields 11, fields 12⟩ + · rintro ⟨hD, hrD, hμD, hJ, hQs, hrs, hμs, hAs, hEs, hFs, hSs, hMaps, hA⟩ + exact M.recursiveStateCode_mem pairing hD hrD hμD hJ hQs hrs hμs hAs hEs hFs hSs hMaps hA + +end PartitionPilot.Forcing.TransitiveGround + +namespace PartitionPilot.Forcing +universe u + +namespace CodedRecursiveMapInputs +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} + +def toState (_h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) : RecursiveStateData := + ⟨D, rD, μD, J, Qs, rs, μs, As, Es, Fs, Ss, Maps, A⟩ + +end CodedRecursiveMapInputs + +namespace RecursiveStateData +noncomputable def fresh (state : RecursiveStateData.{u}) := + indexedAttachmentFresh state.J state.Qs state.rs state.As + +noncomputable def currentCarrier (state : RecursiveStateData.{u}) := + taggedExtension state.D state.fresh + +noncomputable def currentOrder (state : RecursiveStateData.{u}) := + codedAttachmentOrder state.D state.fresh state.rD + (batchAttachmentInsideGraph state.J state.Qs state.rs) + (batchAttachmentShadowGraph state.J state.D state.Qs state.μs state.As state.Es) + (batchAttachmentUpperGraph state.J state.D state.Qs state.Fs) + +noncomputable def currentMeet (state : RecursiveStateData.{u}) := + canonicalMeetGraph state.currentCarrier state.currentOrder + +noncomputable def successor (state : RecursiveStateData.{u}) (M : TransitiveGround.{u}) + (I Sources Reps G T : ZFSet.{u}) : RecursiveStateData.{u} := + let K := recursiveAttachmentIndices I state.J state.D (⋃₀ ⋃₀ state.Fs) Sources state.Fs + let Qs := pairSecondField I state.J K state.Qs + let rs := pairSecondField I state.J K state.rs + let μs := pairSecondField I state.J K state.μs + let As := pairSecondField I state.J K state.As + let N := indexedAttachmentFresh K Qs rs As + let C := taggedExtension state.currentCarrier N + { D := state.currentCarrier + rD := state.currentOrder + μD := state.currentMeet + J := K + Qs := Qs + rs := rs + μs := μs + As := As + Es := M.groundPairCompositions K I state.J (familyPointBound state.Qs) + state.D state.currentCarrier state.Es state.Maps + Fs := M.groundPairPushFilters K I state.J state.currentCarrier state.currentOrder state.Maps state.Fs + Ss := recursiveSeparatorFamily K I state.J state.D state.currentCarrier state.Maps state.Ss + Maps := M.groundLiftedCompressionFamily I state.J state.D state.currentCarrier C state.fresh + (familyPointBound state.Qs) state.Maps Sources state.Fs Reps G state.A + A := taggedActionGraph G state.currentCarrier N state.A + (indexedTaskActionGraph G K (familyPointBound state.Qs) N + (indexedTaskActionGraph G I state.J K T)) } + +end RecursiveStateData + +namespace CodedRecursiveMapInputs +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) + +theorem toState_currentCarrier : h.toState.currentCarrier = d.batchCarrier := rfl +theorem toState_currentOrder : h.toState.currentOrder = d.batchOrder := rfl +theorem toState_currentMeet : h.toState.currentMeet = d.batchMeetGraph := rfl + +theorem toState_successor (M : TransitiveGround.{u}) (next : h.NextInputs M) + (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T)) : + inputs.toState = h.toState.successor M I Sources Reps G T := rfl + +end CodedRecursiveMapInputs + +structure RecursiveStateCoherence (I : ZFSet.{u}) (first second : RecursiveStateData.{u}) : Prop where + carrier : first.D ⊆ second.D + order : ∀ x ∈ first.D, ∀ y ∈ first.D, + ZFSet.pair x y ∈ second.rD ↔ ZFSet.pair x y ∈ first.rD + meet : ∀ x ∈ first.D, ∀ y ∈ first.D, ∀ z, + ZFSet.pair (ZFSet.pair x y) z ∈ second.μD ↔ ZFSet.pair (ZFSet.pair x y) z ∈ first.μD + currentCarrier : first.currentCarrier ⊆ second.currentCarrier + currentOrder : ∀ x ∈ first.currentCarrier, ∀ y ∈ first.currentCarrier, + ZFSet.pair x y ∈ second.currentOrder ↔ ZFSet.pair x y ∈ first.currentOrder + currentMeet : ∀ x ∈ first.currentCarrier, ∀ y ∈ first.currentCarrier, ∀ z, + ZFSet.pair (ZFSet.pair x y) z ∈ second.currentMeet ↔ + ZFSet.pair (ZFSet.pair x y) z ∈ first.currentMeet + action : ∀ g x, x ∈ first.currentCarrier → ∀ y, + ZFSet.pair (ZFSet.pair g x) y ∈ second.A ↔ ZFSet.pair (ZFSet.pair g x) y ∈ first.A + maps : ∀ i ∈ I, ∀ S S', ZFSet.pair i S ∈ first.Maps → ZFSet.pair i S' ∈ second.Maps → + ∀ x ∈ first.D, ∀ y, ZFSet.pair x y ∈ S' ↔ ZFSet.pair x y ∈ S + +namespace RecursiveStateCoherence +variable {I : ZFSet.{u}} {first middle last : RecursiveStateData.{u}} + +theorem refl (maps : FunctionGraphOn I first.Maps) : RecursiveStateCoherence I first first where + carrier := fun _ hx => hx + order := fun _ _ _ _ => Iff.rfl + meet := fun _ _ _ _ _ => Iff.rfl + currentCarrier := fun _ hx => hx + currentOrder := fun _ _ _ _ => Iff.rfl + currentMeet := fun _ _ _ _ _ => Iff.rfl + action := fun _ _ _ _ => Iff.rfl + maps := by + intro _ _ S S' firstEntry secondEntry _ _ _ + exact maps.unique firstEntry secondEntry ▸ Iff.rfl + +theorem trans (left : RecursiveStateCoherence I first middle) + (right : RecursiveStateCoherence I middle last) (middleMaps : FunctionGraphOn I middle.Maps) : + RecursiveStateCoherence I first last where + carrier := fun _ hx => right.carrier (left.carrier hx) + order := fun _ hx _ hy => (right.order _ (left.carrier hx) _ (left.carrier hy)).trans (left.order _ hx _ hy) + meet := fun _ hx _ hy _ => (right.meet _ (left.carrier hx) _ (left.carrier hy) _).trans (left.meet _ hx _ hy _) + currentCarrier := fun _ hx => right.currentCarrier (left.currentCarrier hx) + currentOrder := fun _ hx _ hy => + (right.currentOrder _ (left.currentCarrier hx) _ (left.currentCarrier hy)).trans (left.currentOrder _ hx _ hy) + currentMeet := fun _ hx _ hy _ => + (right.currentMeet _ (left.currentCarrier hx) _ (left.currentCarrier hy) _).trans (left.currentMeet _ hx _ hy _) + action := fun _ _ hx _ => (right.action _ _ (left.currentCarrier hx) _).trans (left.action _ _ hx _) + maps := by + intro i hi S S' oldEntry newEntry x hx y + obtain ⟨B, middleEntry⟩ := middleMaps.total hi + exact (right.maps i hi B S' middleEntry newEntry x (left.carrier hx) y).trans + (left.maps i hi S B oldEntry middleEntry x hx y) + +end RecursiveStateCoherence + +namespace CodedRecursiveMapInputs +variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}} +variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss} +variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A) +variable (M : TransitiveGround.{u}) (next : h.NextInputs M) + +theorem next_coherent + (entries : ∀ i f, ZFSet.pair i f ∈ h.groundLiftFamily M next ↔ i ∈ I ∧ f = h.liftSection M next i) + (inputs : CodedRecursiveMapInputs next I (h.groundLiftFamily M next) Sources Reps + G m inv one (h.nextActionGraph T)) : RecursiveStateCoherence I h.toState inputs.toState where + carrier := fun _ hx => old_mem_taggedExtension hx + order := fun _ hx _ hy => d.old_order_iff hx hy + meet := fun _ hx _ hy _ => d.old_meet_iff hx hy + currentCarrier := fun _ hx => old_mem_taggedExtension hx + currentOrder := fun _ hx _ hy => next.old_order_iff hx hy + currentMeet := fun _ hx _ hy _ => next.old_meet_iff hx hy + action := fun _ _ hx _ => h.nextAction_old_iff hx + maps := by + intro i _ S S' oldEntry newEntry x hx y + obtain ⟨_, rfl⟩ := (entries i S').1 newEntry + exact h.liftSection_old_iff M next oldEntry hx + +end CodedRecursiveMapInputs + +end PartitionPilot.Forcing + +namespace PartitionPilot.Forcing.RecursiveStateData +universe u + +def ofFields (fields : Fin 13 → ZFSet.{u}) : RecursiveStateData.{u} := + ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5, fields 6, + fields 7, fields 8, fields 9, fields 10, fields 11, fields 12⟩ + +theorem ofFields_field (state : RecursiveStateData.{u}) : ofFields state.field = state := by + cases state + rfl + +theorem field_ofFields (fields : Fin 13 → ZFSet.{u}) : (ofFields fields).field = fields := by + funext j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + refine Fin.cases rfl (fun j => ?_) j + exact Fin.elim0 j + +theorem code_ofFields (fields : Fin 13 → ZFSet.{u}) : + (ofFields fields).code = nonemptyTupleCode 12 fields := by + rw [code, field_ofFields] + +def successorEnvironment (state : RecursiveStateData.{u}) (I Sources Reps G T : ZFSet.{u}) : + Fin 18 → ZFSet.{u} := + Fin.addCases (m := 13) (n := 5) state.field (SetFormula.extend I (SetFormula.extend Sources + (SetFormula.extend Reps (SetFormula.extend G (SetFormula.extend T Fin.elim0))))) + +noncomputable def successorCodeFromEnvironment (M : TransitiveGround.{u}) + (env : Fin 18 → ZFSet.{u}) : ZFSet.{u} := + ((ofFields (fun j => env (j.castAdd 5))).successor M + (env 13) (env 14) (env 15) (env 16) (env 17)).code + +theorem successorCodeFromEnvironment_spec (state : RecursiveStateData.{u}) + (M : TransitiveGround.{u}) (I Sources Reps G T : ZFSet.{u}) : + successorCodeFromEnvironment M (state.successorEnvironment I Sources Reps G T) = + (state.successor M I Sources Reps G T).code := by + simp only [successorCodeFromEnvironment, successorEnvironment, Fin.addCases_left] + rw [ofFields_field] + rfl + +end PartitionPilot.Forcing.RecursiveStateData + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStructuralRefinementHistories.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStructuralRefinementHistories.lean index ec010175ab71fe641312e77d924e6bcc3fcca904..424654bfc4fcc2425359043d515d9b0b041a1c0c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStructuralRefinementHistories.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RecursiveStructuralRefinementHistories.lean @@ -1,67 +1,67 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions - -namespace OAI - -section - -namespace PartitionPilot.Forcing.TransitiveGround -universe u -variable (M : TransitiveGround.{u}) -variable (G nodes nodeOrder basis T T2 rows rowOrder stages history : ZFSet.{u}) - - theorem structuralRefinementHistory_recursiveOrder - (ordinal : ordinalSetProperty stages) (function : FunctionGraphOn stages history) - (shape : ∀ level ∈ stages, ∃ P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history) - (equations : ∀ level P order top action, - ZFSet.pair level (forcingStageCode P order top action) ∈ history → - P = M.refinementHistoryForcing rows T level - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level (graphRestriction level history)) ∧ - order = M.refinementHistoryOrder rows rowOrder T level - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level (graphRestriction level history))) : - RecursiveRefinementOrderHistory M rows rowOrder T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - have prefixes {level : ZFSet.{u}} (hl : level ∈ stages) : - M.structuralRefinementHistory G nodes nodeOrder basis T T2 level (graphRestriction level history) = - graphRestriction level (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - rw [M.structuralRefinementHistory_history_restrict, - M.structuralRefinementHistory_domain_restrict G nodes nodeOrder basis T T2 (ordinal.1 level hl)] - refine ⟨⟨M.structuralRefinementHistory_dataHistory G nodes nodeOrder basis T T2 stages history function shape, ?_⟩, ?_⟩ - · intro level data entry - obtain ⟨hl, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - exact (equations level P order top action stored).1.trans - (congrArg (M.refinementHistoryForcing rows T level) (prefixes hl)) - · intro level data entry - obtain ⟨hl, P, order, top, action, stored, rfl⟩ := - M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry - exact (equations level P order top action stored).2.trans - (congrArg (M.refinementHistoryOrder rows rowOrder T level) (prefixes hl)) - -theorem structuralRefinementHistory_recursiveOrder_of_trace - {step : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} - (ordinal : ordinalSetProperty stages) (trace : OrdinalRecursionTrace step stages history) - (correct : ∀ level prior stage, step level prior stage → ∃ top action, - stage = forcingStageCode - (M.refinementHistoryForcing rows T level - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level prior)) - (M.refinementHistoryOrder rows rowOrder T level - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level prior)) top action) : - RecursiveRefinementOrderHistory M rows rowOrder T stages - (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by - apply M.structuralRefinementHistory_recursiveOrder G nodes nodeOrder basis T T2 rows rowOrder stages history ordinal trace.1 - · intro level hl - obtain ⟨stage, stored⟩ := trace.1.total hl - obtain ⟨top, action, equal⟩ := correct level _ stage (trace.2 level hl stage stored) - exact ⟨_, _, top, action, equal ▸ stored⟩ - · intro level P order top action stored - obtain ⟨top', action', equal⟩ := correct level _ _ - (trace.2 level (trace.1.pair_source stored) _ stored) - have fields := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal - exact ⟨fields.1, fields.2.1⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundRecursiveRefinementBinaryUnions + +namespace OAI + +section + +namespace PartitionPilot.Forcing.TransitiveGround +universe u +variable (M : TransitiveGround.{u}) +variable (G nodes nodeOrder basis T T2 rows rowOrder stages history : ZFSet.{u}) + + theorem structuralRefinementHistory_recursiveOrder + (ordinal : ordinalSetProperty stages) (function : FunctionGraphOn stages history) + (shape : ∀ level ∈ stages, ∃ P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history) + (equations : ∀ level P order top action, + ZFSet.pair level (forcingStageCode P order top action) ∈ history → + P = M.refinementHistoryForcing rows T level + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level (graphRestriction level history)) ∧ + order = M.refinementHistoryOrder rows rowOrder T level + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level (graphRestriction level history))) : + RecursiveRefinementOrderHistory M rows rowOrder T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + have prefixes {level : ZFSet.{u}} (hl : level ∈ stages) : + M.structuralRefinementHistory G nodes nodeOrder basis T T2 level (graphRestriction level history) = + graphRestriction level (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + rw [M.structuralRefinementHistory_history_restrict, + M.structuralRefinementHistory_domain_restrict G nodes nodeOrder basis T T2 (ordinal.1 level hl)] + refine ⟨⟨M.structuralRefinementHistory_dataHistory G nodes nodeOrder basis T T2 stages history function shape, ?_⟩, ?_⟩ + · intro level data entry + obtain ⟨hl, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + exact (equations level P order top action stored).1.trans + (congrArg (M.refinementHistoryForcing rows T level) (prefixes hl)) + · intro level data entry + obtain ⟨hl, P, order, top, action, stored, rfl⟩ := + M.structuralRefinementHistory_fields G nodes nodeOrder basis T T2 stages history data entry + exact (equations level P order top action stored).2.trans + (congrArg (M.refinementHistoryOrder rows rowOrder T level) (prefixes hl)) + +theorem structuralRefinementHistory_recursiveOrder_of_trace + {step : ZFSet.{u} → ZFSet.{u} → ZFSet.{u} → Prop} + (ordinal : ordinalSetProperty stages) (trace : OrdinalRecursionTrace step stages history) + (correct : ∀ level prior stage, step level prior stage → ∃ top action, + stage = forcingStageCode + (M.refinementHistoryForcing rows T level + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level prior)) + (M.refinementHistoryOrder rows rowOrder T level + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 level prior)) top action) : + RecursiveRefinementOrderHistory M rows rowOrder T stages + (M.structuralRefinementHistory G nodes nodeOrder basis T T2 stages history) := by + apply M.structuralRefinementHistory_recursiveOrder G nodes nodeOrder basis T T2 rows rowOrder stages history ordinal trace.1 + · intro level hl + obtain ⟨stage, stored⟩ := trace.1.total hl + obtain ⟨top, action, equal⟩ := correct level _ stage (trace.2 level hl stage stored) + exact ⟨_, _, top, action, equal ▸ stored⟩ + · intro level P order top action stored + obtain ⟨top', action', equal⟩ := correct level _ _ + (trace.2 level (trace.1.pair_source stored) _ stored) + have fields := (forcingStageCode_eq_iff _ _ _ _ _ _ _ _).1 equal + exact ⟨fields.1, fields.2.1⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthEnumerationFairness.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthEnumerationFairness.lean index e27f08dd1454ba31615603c593af77290f94f080..469f00128fb99bd465c329be56501fc97d2fbc2c 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthEnumerationFairness.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthEnumerationFairness.lean @@ -1,460 +1,460 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundForcingHistoryLimitConnection -import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementBirthSchedules - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u - -def BirthLevelEnumerationCode (omega stages A levels e : ZFSet.{u}) : Prop := - (relationImage A stages levels = ∅ ∧ e = ∅) ∨ - (ZFSet.IsFunc omega stages e ∧ ∀ alpha ∈ stages, - (∃ n ∈ omega, ZFSet.pair n alpha ∈ e) ↔ - ∃ x ∈ A, ZFSet.pair x alpha ∈ levels) - -theorem BirthLevelEnumerationCode.enumerates {omega stages A levels e : ZFSet.{u}} - (code : BirthLevelEnumerationCode omega stages A levels e) - (active : (relationImage A stages levels).Nonempty) : - ZFSet.IsFunc omega (relationImage A stages levels) e ∧ - ∀ alpha ∈ relationImage A stages levels, ∃ n ∈ omega, ZFSet.pair n alpha ∈ e := by - rcases code with ⟨empty, _⟩ | ⟨function, range⟩ - · obtain ⟨alpha, ha⟩ := active - exact False.elim (ZFSet.notMem_empty alpha (empty ▸ ha)) - · refine ⟨⟨?_, function.2⟩, ?_⟩ - · intro z hz - obtain ⟨n, hn, alpha, ha, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hn, - (mem_relationImage A stages levels alpha).2 ⟨ha, (range alpha ha).1 ⟨n, hn, hz⟩⟩⟩ - · intro alpha ha - obtain ⟨hs, witness⟩ := (mem_relationImage A stages levels alpha).1 ha - exact (range alpha hs).2 witness - -theorem BirthLevelEnumerationCode.idle {omega stages A levels e : ZFSet.{u}} - (code : BirthLevelEnumerationCode omega stages A levels e) - (nonempty : omega.Nonempty) (empty : relationImage A stages levels = ∅) : e = ∅ := by - rcases code with ⟨_, idle⟩ | ⟨function, range⟩ - · exact idle - · obtain ⟨n, hn⟩ := nonempty - obtain ⟨alpha, edge, _⟩ := function.2 n hn - have ha := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 - have attained := (mem_relationImage A stages levels alpha).2 - ⟨ha, (range alpha ha).1 ⟨n, hn, edge⟩⟩ - exact False.elim (ZFSet.notMem_empty alpha (empty ▸ attained)) - -namespace BoundedFormula -open SetFormula - -def birthLevelEnumerationFormula {n} (omega stages A levels e : Fin n) : BoundedFormula n := - disj (.conj (.allMem A (.allMem stages.succ - (.neg (pairMembershipFormula 1 0 levels.succ.succ)))) (emptyFormula e)) - (.conj (functionFormula omega stages e) - (.allMem stages (.conj - (imp (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ)) - (exMem A.succ (pairMembershipFormula 0 1 levels.succ.succ))) - (imp (exMem A.succ (pairMembershipFormula 0 1 levels.succ.succ)) - (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ)))))) - -theorem truth_birthLevelEnumerationFormula {n} (omega stages A levels e : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (birthLevelEnumerationFormula omega stages A levels e) env ↔ - BirthLevelEnumerationCode (env omega) (env stages) (env A) (env levels) (env e) := by - simp only [birthLevelEnumerationFormula, truth_disj, Truth, truth_emptyFormula, - truth_functionFormula, truth_imp, truth_exMem, truth_pairMembershipFormula, ← iff_def] - change (((∀ x ∈ env A, ∀ alpha ∈ env stages, ¬ ZFSet.pair x alpha ∈ env levels) ∧ - env e = ∅) ∨ (ZFSet.IsFunc (env omega) (env stages) (env e) ∧ - ∀ alpha ∈ env stages, (∃ k ∈ env omega, ZFSet.pair k alpha ∈ env e) ↔ - ∃ x ∈ env A, ZFSet.pair x alpha ∈ env levels)) ↔ _ - have empty : (∀ x ∈ env A, ∀ alpha ∈ env stages, ¬ ZFSet.pair x alpha ∈ env levels) ↔ - relationImage (env A) (env stages) (env levels) = ∅ := by - constructor - · intro no - apply ZFSet.ext - intro alpha - simp only [mem_relationImage, ZFSet.notMem_empty, iff_false] - rintro ⟨ha, x, hx, edge⟩ - exact no x hx alpha ha edge - · intro eq x hx alpha ha edge - have member := (mem_relationImage (env A) (env stages) (env levels) alpha).2 - ⟨ha, x, hx, edge⟩ - exact ZFSet.notMem_empty alpha (eq ▸ member) - exact or_congr (and_congr empty Iff.rfl) Iff.rfl - -def birthLevelEnumerationEntryFormula {n} (entry omega stages levels : Fin n) : BoundedFormula n := - exPairFields entry (exPairFields 1 - (birthLevelEnumerationFormula omega.succ.succ.succ.succ - stages.succ.succ.succ.succ 0 levels.succ.succ.succ.succ 2)) - -theorem truth_birthLevelEnumerationEntryFormula {n} (entry omega stages levels : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (birthLevelEnumerationEntryFormula entry omega stages levels) env ↔ - ∃ row A e, env entry = ZFSet.pair (ZFSet.pair row A) e ∧ - BirthLevelEnumerationCode (env omega) (env stages) A (env levels) e := by - simp only [birthLevelEnumerationEntryFormula, truth_exPairFields, - truth_birthLevelEnumerationFormula] - change (∃ p e, env entry = ZFSet.pair p e ∧ ∃ row A, p = ZFSet.pair row A ∧ - BirthLevelEnumerationCode (env omega) (env stages) A (env levels) e) ↔ _ - constructor - · rintro ⟨p, e, eq, row, A, rfl, code⟩ - exact ⟨row, A, e, eq, code⟩ - · rintro ⟨row, A, e, eq, code⟩ - exact ⟨_, e, eq, row, A, rfl, code⟩ - -end BoundedFormula - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def refinementHistoryForcing (rows T stages history : ZFSet.{u}) : ZFSet.{u} := - M.forcingHistoryConditions rows (refinementDataHistoryIndices stages history) T stages history - (refinementDataHistoryLevels stages history T) - -theorem mem_refinementHistoryForcing (rows T stages history z : ZFSet.{u}) : - z ∈ M.refinementHistoryForcing rows T stages history ↔ - z ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T ∧ - ForcingHistoryConditionCode M stages history (refinementDataHistoryLevels stages history T) z := - M.mem_forcingHistoryConditions _ _ _ _ _ _ _ - -theorem refinementHistoryForcing_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {rows T stages history : ZFSet.{u}} - (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) : - M.refinementHistoryForcing rows T stages history ∈ M.sets := - M.forcingHistoryConditions_mem pairing unions powers separation hRows - (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) hT - hStages hHistory (M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT) omega - -theorem refinementHistoryForcing_initial {rows : ZFSet.{u}} (hRows : rows ∈ M.sets) - (T history : ZFSet.{u}) : M.refinementHistoryForcing rows T ∅ history = ZFSet.prod rows {∅} := by - have indices : refinementDataHistoryIndices ∅ history = ∅ := by - apply ZFSet.ext - intro x - constructor - · intro member - obtain ⟨alpha, impossible, _⟩ := (mem_refinementHistoryIndices ∅ _ x).1 member - exact False.elim (ZFSet.notMem_empty alpha impossible) - · intro member - exact False.elim (ZFSet.notMem_empty x member) - rw [refinementHistoryForcing, indices] - exact M.forcingHistoryConditions_initial hRows T history _ - -theorem refinementHistoryForcing_level_function {stages history T : ZFSet.{u}} - (valid : RefinementDataHistory stages history T) : - ZFSet.IsFunc (stageOneAssignments (refinementDataHistoryIndices stages history) T) stages - (refinementDataHistoryLevels stages history T) := - valid.levels_function - -theorem refinementHistoryForcing_pair_decomposition {stages history T : ZFSet.{u}} - (valid : RefinementDataHistory stages history T) (rows row A : ZFSet.{u}) : - ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history ↔ - ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T ∧ - FlatHistoryCuts stages (refinementDataHistoryField stages history 7) - (refinementDataHistoryLevels stages history T) row A ∧ - ∀ beta ∈ stages, forcingHistoryRawTests M history - (refinementDataHistoryLevels stages history T) beta row A := by - rw [M.mem_refinementHistoryForcing] - exact and_congr Iff.rfl (forcingHistoryConditionCode_pair_decomposition valid.function valid.decoded row A) - -noncomputable def birthLevelEnumerationRelation (Q stages levels : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ row A e, z = ZFSet.pair (ZFSet.pair row A) e ∧ - BirthLevelEnumerationCode ZFSet.omega stages A levels e) - (ZFSet.prod Q (M.groundRelations ZFSet.omega stages)) - -theorem pair_mem_birthLevelEnumerationRelation (Q stages levels row A e : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair row A) e ∈ M.birthLevelEnumerationRelation Q stages levels ↔ - ZFSet.pair row A ∈ Q ∧ e ∈ M.groundRelations ZFSet.omega stages ∧ - BirthLevelEnumerationCode ZFSet.omega stages A levels e := by - rw [birthLevelEnumerationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] - constructor - · rintro ⟨⟨hp, he⟩, row', A', e', equal, code⟩ - obtain ⟨pair, rfl⟩ := ZFSet.pair_inj.1 equal - obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pair - exact ⟨hp, he, code⟩ - · rintro ⟨hp, he, code⟩ - exact ⟨⟨hp, he⟩, row, A, e, rfl, code⟩ - -theorem birthLevelEnumerationRelation_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Q stages levels : ZFSet.{u}} (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) - (hLevels : levels ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.birthLevelEnumerationRelation Q stages levels ∈ M.sets := by - let params := extend ZFSet.omega (extend stages (extend levels Fin.elim0)) - have selected := M.bounded_separation_mem separation - (BoundedFormula.birthLevelEnumerationEntryFormula 0 1 2 3) params - (Fin.cases omega (Fin.cases hStages (Fin.cases hLevels (fun i => Fin.elim0 i)))) - (M.prod_mem pairing unions powers separation hQ - (M.groundRelations_mem pairing unions powers separation omega hStages)) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.birthLevelEnumerationEntryFormula 0 1 2 3) (extend z params)) - (ZFSet.prod Q (M.groundRelations ZFSet.omega stages)) = - M.birthLevelEnumerationRelation Q stages levels := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, birthLevelEnumerationRelation, ZFSet.mem_sep] - exact and_congr Iff.rfl (BoundedFormula.truth_birthLevelEnumerationEntryFormula 0 1 2 3 _) - exact equal ▸ selected - -theorem exists_refinementBirthLevelEnumerations - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {rows T stages history : ZFSet.{u}} (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) - (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) - (valid : RefinementDataHistory stages history T) : - let Q := M.refinementHistoryForcing rows T stages history - let levels := refinementDataHistoryLevels stages history T - M.birthLevelEnumerationRelation Q stages levels ∈ M.sets ∧ - ∃ selector ∈ M.sets, ZFSet.IsFunc Q (M.groundRelations ZFSet.omega stages) selector ∧ - selector ⊆ M.birthLevelEnumerationRelation Q stages levels ∧ - ∀ row A e, ZFSet.pair (ZFSet.pair row A) e ∈ selector → - BirthLevelEnumerationCode ZFSet.omega stages A levels e := by - classical - dsimp only - let Q := M.refinementHistoryForcing rows T stages history - let levels := refinementDataHistoryLevels stages history T - have omega := M.omega_mem separation infinite - have hQ := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega - have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT - have bound := M.groundRelations_mem pairing unions powers separation omega hStages - have ground := M.birthLevelEnumerationRelation_mem pairing unions powers separation hQ hStages hLevels omega - have total : ∀ p ∈ Q, ∃ e ∈ M.groundRelations ZFSet.omega stages, - ZFSet.pair p e ∈ M.birthLevelEnumerationRelation Q stages levels := by - intro p hp - have candidate := ((M.mem_refinementHistoryForcing rows T stages history p).1 hp).1 - obtain ⟨row, _, A, hA, _, smallA, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ p).1 candidate - have hAttained := M.relationImage_mem separation hA hStages hLevels - have small := M.groundEmbeddable_function_image pairing unions powers separation choice - hA hStages omega hLevels valid.levels_function smallA - by_cases active : (relationImage A stages levels).Nonempty - · obtain ⟨e, he, function, onto⟩ := M.groundCountable_enumeration - pairing unions powers separation infinite hAttained active small - have upperFunction : ZFSet.IsFunc ZFSet.omega stages e := by - refine ⟨?_, function.2⟩ - intro z hz - obtain ⟨n, hn, alpha, ha, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) - exact ZFSet.pair_mem_prod.2 ⟨hn, ((mem_relationImage A stages levels alpha).1 ha).1⟩ - have heBound := (M.mem_groundRelations ZFSet.omega stages e).2 ⟨he, upperFunction.1⟩ - refine ⟨e, heBound, (M.pair_mem_birthLevelEnumerationRelation Q stages levels row A e).2 - ⟨hp, heBound, Or.inr ⟨upperFunction, ?_⟩⟩⟩ - intro alpha ha - constructor - · rintro ⟨n, _, edge⟩ - exact ((mem_relationImage A stages levels alpha).1 - (ZFSet.pair_mem_prod.1 (function.1 edge)).2).2 - · intro witness - exact onto alpha ((mem_relationImage A stages levels alpha).2 ⟨ha, witness⟩) - · have empty : relationImage A stages levels = ∅ := by - apply ZFSet.ext - intro alpha - exact ⟨fun ha => False.elim (active ⟨alpha, ha⟩), - fun ha => False.elim (ZFSet.notMem_empty alpha ha)⟩ - have emptyBound := (M.mem_groundRelations ZFSet.omega stages ∅).2 - ⟨M.empty_mem ⟨stages, hStages⟩, ZFSet.empty_subset _⟩ - exact ⟨∅, emptyBound, (M.pair_mem_birthLevelEnumerationRelation Q stages levels row A ∅).2 - ⟨hp, emptyBound, Or.inl ⟨empty, rfl⟩⟩⟩ - obtain ⟨selector, hs, function, selected⟩ := - M.uniformize_relation pairing unions powers separation choice hQ bound ground total - exact ⟨ground, selector, hs, function, selected, fun row A e entry => - ((M.pair_mem_birthLevelEnumerationRelation Q stages levels row A e).1 (selected entry)).2.2⟩ - -end TransitiveGround - -section -universe u - -theorem refinementDataHistoryIndices_subset {stages alpha history : ZFSet.{u}} - (subset : alpha ⊆ stages) : - refinementDataHistoryIndices alpha (graphRestriction alpha history) ⊆ - refinementDataHistoryIndices stages history := by - change refinementHistoryIndices alpha - (refinementDataHistoryField alpha (graphRestriction alpha history) 0) ⊆ _ - rw [refinementDataHistoryIndices_prefix subset (fun _ h => h)] - exact refinementHistoryIndices_mono subset - -theorem refinementDataHistoryAssignments_subset {stages alpha history : ZFSet.{u}} - (subset : alpha ⊆ stages) (T : ZFSet.{u}) : - stageOneAssignments (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T ⊆ - stageOneAssignments (refinementDataHistoryIndices stages history) T := by - intro z member - obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ z).1 member - exact (mem_stageOneAssignments _ _ _).2 - ⟨t, refinementDataHistoryIndices_subset subset ht, u, hu, w, hw, rfl⟩ - -theorem RefinementDataHistory.prefix_assignments_cut {stages history T alpha A : ZFSet.{u}} - (valid : RefinementDataHistory stages history T) (subset : alpha ⊆ stages) - (data : A ⊆ stageOneAssignments (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T) : - assignmentCut (refinementDataHistoryLevels stages history T) alpha A = A := by - rw [← valid.prefix_cut subset (fun _ h => h) A] - exact assignmentCut_full (valid.restrict subset).levels_function data - -namespace TransitiveGround -open SetFormula -variable (M : TransitiveGround.{u}) - -theorem refinementDataHistoryCandidate_prefix {stages history rows T alpha row A : ZFSet.{u}} - (subset : alpha ⊆ stages) - (candidate : ZFSet.pair row A ∈ M.stageOneCandidateBound rows - (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T) : - ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by - obtain ⟨hrow, ground, data, small⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate - exact (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 - ⟨hrow, ground, fun _ h => refinementDataHistoryAssignments_subset subset T (data h), small⟩ - -theorem refinementDataHistoryCandidate_cut (separation : SeparationSchema M.sets) - {stages history rows T alpha row A : ZFSet.{u}} - (valid : RefinementDataHistory stages history T) (subset : alpha ⊆ stages) - (hLevels : refinementDataHistoryLevels stages history T ∈ M.sets) - (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (candidate : ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) : - ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) alpha A) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T := by - have checked := M.refinementHistoryCandidate_cut separation valid.index_function valid.index_literal - subset hLevels hAlpha omega candidate - change ZFSet.pair row _ ∈ M.stageOneCandidateBound rows - (refinementHistoryIndices alpha (refinementDataHistoryField alpha (graphRestriction alpha history) 0)) T - rw [refinementDataHistoryIndices_prefix subset (fun _ h => h)] - exact checked - -theorem refinementDataHistoryCandidate_splice - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) - {stages history rows T alpha q Aq p Ap : ZFSet.{u}} - (subset : alpha ⊆ stages) (hLevels : refinementDataHistoryLevels stages history T ∈ M.sets) - (hAlpha : alpha ∈ M.sets) - (lower : ZFSet.pair q Aq ∈ M.stageOneCandidateBound rows - (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T) - (upper : ZFSet.pair p Ap ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) : - ZFSet.pair q (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) ∈ - M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by - have first := ZFSet.pair_mem_prod.1 (M.refinementDataHistoryCandidate_prefix subset lower) - have second := ZFSet.pair_mem_prod.1 upper - exact ZFSet.pair_mem_prod.2 ⟨first.1, - M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation infinite choice - hLevels hAlpha first.2 second.2⟩ - -end TransitiveGround - -end - -namespace TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem birthEnumerationRange_spec - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {Q stages levels selector : ZFSet.{u}} (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) - (omega : ZFSet.omega ∈ M.sets) (hSelector : selector ∈ M.sets) - (function : ZFSet.IsFunc Q (M.groundRelations ZFSet.omega stages) selector) - (selected : selector ⊆ M.birthLevelEnumerationRelation Q stages levels) : - let E0 := relationImage Q (M.groundRelations ZFSet.omega stages) selector - E0 ∈ M.sets ∧ E0 ⊆ M.groundRelations ZFSet.omega stages ∧ - (∀ e ∈ E0, e = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages e) ∧ - ∀ row A, ZFSet.pair row A ∈ Q → - ∃ e ∈ E0, ZFSet.pair (ZFSet.pair row A) e ∈ selector ∧ - BirthLevelEnumerationCode ZFSet.omega stages A levels e := by - dsimp only - refine ⟨M.relationImage_mem separation hQ - (M.groundRelations_mem pairing unions powers separation omega hStages) hSelector, - fun e he => ((mem_relationImage _ _ _ e).1 he).1, ?_, ?_⟩ - · intro e he - obtain ⟨_, p, _, edge⟩ := (mem_relationImage _ _ _ e).1 he - have member := selected edge - obtain ⟨_, row, A, e', equal, code⟩ := ZFSet.mem_sep.1 member - obtain ⟨_, rfl⟩ := ZFSet.pair_inj.1 equal - exact code.elim (fun idle => Or.inl idle.2) (fun active => Or.inr active.1) - · intro row A hp - obtain ⟨e, edge, _⟩ := function.2 _ hp - have bound := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 - exact ⟨e, (mem_relationImage _ _ _ e).2 ⟨bound, _, hp, edge⟩, edge, - ((M.pair_mem_birthLevelEnumerationRelation Q stages levels row A e).1 (selected edge)).2.2⟩ - -end TransitiveGround - -namespace RefinementDataHistory -universe u -variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) -include valid - -theorem birthEnumeration_idle_iff {A e : ZFSet.{u}} - (shape : A ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) - (code : BirthLevelEnumerationCode ZFSet.omega stages A - (refinementDataHistoryLevels stages history T) e) : e = ∅ ↔ A = ∅ := by - constructor - · intro idle - apply ZFSet.ext - intro x - constructor - · intro hx - obtain ⟨alpha, edge, _⟩ := valid.levels_function.2 x (shape hx) - have hAlpha := (ZFSet.pair_mem_prod.1 (valid.levels_function.1 edge)).2 - have attained := (mem_relationImage A stages _ alpha).2 ⟨hAlpha, x, hx, edge⟩ - obtain ⟨n, _, scheduled⟩ := (code.enumerates ⟨alpha, attained⟩).2 alpha attained - exact False.elim (ZFSet.notMem_empty _ (idle ▸ scheduled)) - · intro hx - exact False.elim (ZFSet.notMem_empty x hx) - · intro empty - have emptyLevels : relationImage A stages (refinementDataHistoryLevels stages history T) = ∅ := by - apply ZFSet.ext - intro alpha - constructor - · intro ha - obtain ⟨_, x, hx, _⟩ := (mem_relationImage _ _ _ _).1 ha - exact False.elim (ZFSet.notMem_empty x (empty ▸ hx)) - · intro ha - exact False.elim (ZFSet.notMem_empty alpha ha) - exact code.idle ⟨natSetCode 0, natSetCode_mem_omega 0⟩ emptyLevels - -theorem birthEnumeration_assignment_visit (assignments enumerations : Nat → ZFSet.{u}) - (shape : ∀ i, assignments i ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) - (retained : ∀ i k, i ≤ k → assignments i ⊆ assignments k) - (coded : ∀ i, BirthLevelEnumerationCode ZFSet.omega stages (assignments i) - (refinementDataHistoryLevels stages history T) (enumerations i)) - {x : ZFSet.{u}} (member : x ∈ stageOneAssignmentUnion assignments) : - ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ - x ∈ assignments i ∧ - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ - ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ - alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) ∧ - ZFSet.pair (natSetCode j) alpha ∈ enumerations i ∧ - ∀ k, Nat.pair i j ≤ k → x ∈ assignmentOnIndices (fields 0) T (assignments k) := by - have onto : ∀ i alpha, - alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) → - ∃ j : Nat, ZFSet.pair (natSetCode j) alpha ∈ enumerations i := by - intro i alpha attained - obtain ⟨n, hn, entry⟩ := ((coded i).enumerates ⟨alpha, attained⟩).2 alpha attained - obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn - exact ⟨j, entry⟩ - obtain ⟨i, j, alpha, hAlpha, fields, scheduled, before, born, stored, - level, attained, enumeration, visited⟩ := - valid.birthList_assignment_visit assignments enumerations shape retained onto member - refine ⟨i, j, alpha, hAlpha, fields, scheduled, before, born, stored, - level, attained, enumeration, ?_⟩ - intro k after - have parts := (mem_assignmentOnIndices _ _ _ _).1 visited - exact (mem_assignmentOnIndices _ _ _ _).2 - ⟨retained (Nat.pair i j) k after parts.1, parts.2⟩ - -end RefinementDataHistory - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundForcingHistoryLimitConnection +import OAI.SetTheory.PartitionPrinciple.Transfinite.RefinementBirthSchedules + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u + +def BirthLevelEnumerationCode (omega stages A levels e : ZFSet.{u}) : Prop := + (relationImage A stages levels = ∅ ∧ e = ∅) ∨ + (ZFSet.IsFunc omega stages e ∧ ∀ alpha ∈ stages, + (∃ n ∈ omega, ZFSet.pair n alpha ∈ e) ↔ + ∃ x ∈ A, ZFSet.pair x alpha ∈ levels) + +theorem BirthLevelEnumerationCode.enumerates {omega stages A levels e : ZFSet.{u}} + (code : BirthLevelEnumerationCode omega stages A levels e) + (active : (relationImage A stages levels).Nonempty) : + ZFSet.IsFunc omega (relationImage A stages levels) e ∧ + ∀ alpha ∈ relationImage A stages levels, ∃ n ∈ omega, ZFSet.pair n alpha ∈ e := by + rcases code with ⟨empty, _⟩ | ⟨function, range⟩ + · obtain ⟨alpha, ha⟩ := active + exact False.elim (ZFSet.notMem_empty alpha (empty ▸ ha)) + · refine ⟨⟨?_, function.2⟩, ?_⟩ + · intro z hz + obtain ⟨n, hn, alpha, ha, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hn, + (mem_relationImage A stages levels alpha).2 ⟨ha, (range alpha ha).1 ⟨n, hn, hz⟩⟩⟩ + · intro alpha ha + obtain ⟨hs, witness⟩ := (mem_relationImage A stages levels alpha).1 ha + exact (range alpha hs).2 witness + +theorem BirthLevelEnumerationCode.idle {omega stages A levels e : ZFSet.{u}} + (code : BirthLevelEnumerationCode omega stages A levels e) + (nonempty : omega.Nonempty) (empty : relationImage A stages levels = ∅) : e = ∅ := by + rcases code with ⟨_, idle⟩ | ⟨function, range⟩ + · exact idle + · obtain ⟨n, hn⟩ := nonempty + obtain ⟨alpha, edge, _⟩ := function.2 n hn + have ha := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 + have attained := (mem_relationImage A stages levels alpha).2 + ⟨ha, (range alpha ha).1 ⟨n, hn, edge⟩⟩ + exact False.elim (ZFSet.notMem_empty alpha (empty ▸ attained)) + +namespace BoundedFormula +open SetFormula + +def birthLevelEnumerationFormula {n} (omega stages A levels e : Fin n) : BoundedFormula n := + disj (.conj (.allMem A (.allMem stages.succ + (.neg (pairMembershipFormula 1 0 levels.succ.succ)))) (emptyFormula e)) + (.conj (functionFormula omega stages e) + (.allMem stages (.conj + (imp (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ)) + (exMem A.succ (pairMembershipFormula 0 1 levels.succ.succ))) + (imp (exMem A.succ (pairMembershipFormula 0 1 levels.succ.succ)) + (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ)))))) + +theorem truth_birthLevelEnumerationFormula {n} (omega stages A levels e : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (birthLevelEnumerationFormula omega stages A levels e) env ↔ + BirthLevelEnumerationCode (env omega) (env stages) (env A) (env levels) (env e) := by + simp only [birthLevelEnumerationFormula, truth_disj, Truth, truth_emptyFormula, + truth_functionFormula, truth_imp, truth_exMem, truth_pairMembershipFormula, ← iff_def] + change (((∀ x ∈ env A, ∀ alpha ∈ env stages, ¬ ZFSet.pair x alpha ∈ env levels) ∧ + env e = ∅) ∨ (ZFSet.IsFunc (env omega) (env stages) (env e) ∧ + ∀ alpha ∈ env stages, (∃ k ∈ env omega, ZFSet.pair k alpha ∈ env e) ↔ + ∃ x ∈ env A, ZFSet.pair x alpha ∈ env levels)) ↔ _ + have empty : (∀ x ∈ env A, ∀ alpha ∈ env stages, ¬ ZFSet.pair x alpha ∈ env levels) ↔ + relationImage (env A) (env stages) (env levels) = ∅ := by + constructor + · intro no + apply ZFSet.ext + intro alpha + simp only [mem_relationImage, ZFSet.notMem_empty, iff_false] + rintro ⟨ha, x, hx, edge⟩ + exact no x hx alpha ha edge + · intro eq x hx alpha ha edge + have member := (mem_relationImage (env A) (env stages) (env levels) alpha).2 + ⟨ha, x, hx, edge⟩ + exact ZFSet.notMem_empty alpha (eq ▸ member) + exact or_congr (and_congr empty Iff.rfl) Iff.rfl + +def birthLevelEnumerationEntryFormula {n} (entry omega stages levels : Fin n) : BoundedFormula n := + exPairFields entry (exPairFields 1 + (birthLevelEnumerationFormula omega.succ.succ.succ.succ + stages.succ.succ.succ.succ 0 levels.succ.succ.succ.succ 2)) + +theorem truth_birthLevelEnumerationEntryFormula {n} (entry omega stages levels : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (birthLevelEnumerationEntryFormula entry omega stages levels) env ↔ + ∃ row A e, env entry = ZFSet.pair (ZFSet.pair row A) e ∧ + BirthLevelEnumerationCode (env omega) (env stages) A (env levels) e := by + simp only [birthLevelEnumerationEntryFormula, truth_exPairFields, + truth_birthLevelEnumerationFormula] + change (∃ p e, env entry = ZFSet.pair p e ∧ ∃ row A, p = ZFSet.pair row A ∧ + BirthLevelEnumerationCode (env omega) (env stages) A (env levels) e) ↔ _ + constructor + · rintro ⟨p, e, eq, row, A, rfl, code⟩ + exact ⟨row, A, e, eq, code⟩ + · rintro ⟨row, A, e, eq, code⟩ + exact ⟨_, e, eq, row, A, rfl, code⟩ + +end BoundedFormula + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def refinementHistoryForcing (rows T stages history : ZFSet.{u}) : ZFSet.{u} := + M.forcingHistoryConditions rows (refinementDataHistoryIndices stages history) T stages history + (refinementDataHistoryLevels stages history T) + +theorem mem_refinementHistoryForcing (rows T stages history z : ZFSet.{u}) : + z ∈ M.refinementHistoryForcing rows T stages history ↔ + z ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T ∧ + ForcingHistoryConditionCode M stages history (refinementDataHistoryLevels stages history T) z := + M.mem_forcingHistoryConditions _ _ _ _ _ _ _ + +theorem refinementHistoryForcing_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {rows T stages history : ZFSet.{u}} + (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) : + M.refinementHistoryForcing rows T stages history ∈ M.sets := + M.forcingHistoryConditions_mem pairing unions powers separation hRows + (M.refinementDataHistoryIndices_mem pairing unions powers separation hStages hHistory) hT + hStages hHistory (M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT) omega + +theorem refinementHistoryForcing_initial {rows : ZFSet.{u}} (hRows : rows ∈ M.sets) + (T history : ZFSet.{u}) : M.refinementHistoryForcing rows T ∅ history = ZFSet.prod rows {∅} := by + have indices : refinementDataHistoryIndices ∅ history = ∅ := by + apply ZFSet.ext + intro x + constructor + · intro member + obtain ⟨alpha, impossible, _⟩ := (mem_refinementHistoryIndices ∅ _ x).1 member + exact False.elim (ZFSet.notMem_empty alpha impossible) + · intro member + exact False.elim (ZFSet.notMem_empty x member) + rw [refinementHistoryForcing, indices] + exact M.forcingHistoryConditions_initial hRows T history _ + +theorem refinementHistoryForcing_level_function {stages history T : ZFSet.{u}} + (valid : RefinementDataHistory stages history T) : + ZFSet.IsFunc (stageOneAssignments (refinementDataHistoryIndices stages history) T) stages + (refinementDataHistoryLevels stages history T) := + valid.levels_function + +theorem refinementHistoryForcing_pair_decomposition {stages history T : ZFSet.{u}} + (valid : RefinementDataHistory stages history T) (rows row A : ZFSet.{u}) : + ZFSet.pair row A ∈ M.refinementHistoryForcing rows T stages history ↔ + ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T ∧ + FlatHistoryCuts stages (refinementDataHistoryField stages history 7) + (refinementDataHistoryLevels stages history T) row A ∧ + ∀ beta ∈ stages, forcingHistoryRawTests M history + (refinementDataHistoryLevels stages history T) beta row A := by + rw [M.mem_refinementHistoryForcing] + exact and_congr Iff.rfl (forcingHistoryConditionCode_pair_decomposition valid.function valid.decoded row A) + +noncomputable def birthLevelEnumerationRelation (Q stages levels : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ row A e, z = ZFSet.pair (ZFSet.pair row A) e ∧ + BirthLevelEnumerationCode ZFSet.omega stages A levels e) + (ZFSet.prod Q (M.groundRelations ZFSet.omega stages)) + +theorem pair_mem_birthLevelEnumerationRelation (Q stages levels row A e : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair row A) e ∈ M.birthLevelEnumerationRelation Q stages levels ↔ + ZFSet.pair row A ∈ Q ∧ e ∈ M.groundRelations ZFSet.omega stages ∧ + BirthLevelEnumerationCode ZFSet.omega stages A levels e := by + rw [birthLevelEnumerationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod] + constructor + · rintro ⟨⟨hp, he⟩, row', A', e', equal, code⟩ + obtain ⟨pair, rfl⟩ := ZFSet.pair_inj.1 equal + obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pair + exact ⟨hp, he, code⟩ + · rintro ⟨hp, he, code⟩ + exact ⟨⟨hp, he⟩, row, A, e, rfl, code⟩ + +theorem birthLevelEnumerationRelation_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Q stages levels : ZFSet.{u}} (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) + (hLevels : levels ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.birthLevelEnumerationRelation Q stages levels ∈ M.sets := by + let params := extend ZFSet.omega (extend stages (extend levels Fin.elim0)) + have selected := M.bounded_separation_mem separation + (BoundedFormula.birthLevelEnumerationEntryFormula 0 1 2 3) params + (Fin.cases omega (Fin.cases hStages (Fin.cases hLevels (fun i => Fin.elim0 i)))) + (M.prod_mem pairing unions powers separation hQ + (M.groundRelations_mem pairing unions powers separation omega hStages)) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.birthLevelEnumerationEntryFormula 0 1 2 3) (extend z params)) + (ZFSet.prod Q (M.groundRelations ZFSet.omega stages)) = + M.birthLevelEnumerationRelation Q stages levels := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, birthLevelEnumerationRelation, ZFSet.mem_sep] + exact and_congr Iff.rfl (BoundedFormula.truth_birthLevelEnumerationEntryFormula 0 1 2 3 _) + exact equal ▸ selected + +theorem exists_refinementBirthLevelEnumerations + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {rows T stages history : ZFSet.{u}} (hRows : rows ∈ M.sets) (hT : T ∈ M.sets) + (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) + (valid : RefinementDataHistory stages history T) : + let Q := M.refinementHistoryForcing rows T stages history + let levels := refinementDataHistoryLevels stages history T + M.birthLevelEnumerationRelation Q stages levels ∈ M.sets ∧ + ∃ selector ∈ M.sets, ZFSet.IsFunc Q (M.groundRelations ZFSet.omega stages) selector ∧ + selector ⊆ M.birthLevelEnumerationRelation Q stages levels ∧ + ∀ row A e, ZFSet.pair (ZFSet.pair row A) e ∈ selector → + BirthLevelEnumerationCode ZFSet.omega stages A levels e := by + classical + dsimp only + let Q := M.refinementHistoryForcing rows T stages history + let levels := refinementDataHistoryLevels stages history T + have omega := M.omega_mem separation infinite + have hQ := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega + have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hHistory hT + have bound := M.groundRelations_mem pairing unions powers separation omega hStages + have ground := M.birthLevelEnumerationRelation_mem pairing unions powers separation hQ hStages hLevels omega + have total : ∀ p ∈ Q, ∃ e ∈ M.groundRelations ZFSet.omega stages, + ZFSet.pair p e ∈ M.birthLevelEnumerationRelation Q stages levels := by + intro p hp + have candidate := ((M.mem_refinementHistoryForcing rows T stages history p).1 hp).1 + obtain ⟨row, _, A, hA, _, smallA, rfl⟩ := (M.mem_stageOneCandidateBound _ _ _ p).1 candidate + have hAttained := M.relationImage_mem separation hA hStages hLevels + have small := M.groundEmbeddable_function_image pairing unions powers separation choice + hA hStages omega hLevels valid.levels_function smallA + by_cases active : (relationImage A stages levels).Nonempty + · obtain ⟨e, he, function, onto⟩ := M.groundCountable_enumeration + pairing unions powers separation infinite hAttained active small + have upperFunction : ZFSet.IsFunc ZFSet.omega stages e := by + refine ⟨?_, function.2⟩ + intro z hz + obtain ⟨n, hn, alpha, ha, rfl⟩ := ZFSet.mem_prod.1 (function.1 hz) + exact ZFSet.pair_mem_prod.2 ⟨hn, ((mem_relationImage A stages levels alpha).1 ha).1⟩ + have heBound := (M.mem_groundRelations ZFSet.omega stages e).2 ⟨he, upperFunction.1⟩ + refine ⟨e, heBound, (M.pair_mem_birthLevelEnumerationRelation Q stages levels row A e).2 + ⟨hp, heBound, Or.inr ⟨upperFunction, ?_⟩⟩⟩ + intro alpha ha + constructor + · rintro ⟨n, _, edge⟩ + exact ((mem_relationImage A stages levels alpha).1 + (ZFSet.pair_mem_prod.1 (function.1 edge)).2).2 + · intro witness + exact onto alpha ((mem_relationImage A stages levels alpha).2 ⟨ha, witness⟩) + · have empty : relationImage A stages levels = ∅ := by + apply ZFSet.ext + intro alpha + exact ⟨fun ha => False.elim (active ⟨alpha, ha⟩), + fun ha => False.elim (ZFSet.notMem_empty alpha ha)⟩ + have emptyBound := (M.mem_groundRelations ZFSet.omega stages ∅).2 + ⟨M.empty_mem ⟨stages, hStages⟩, ZFSet.empty_subset _⟩ + exact ⟨∅, emptyBound, (M.pair_mem_birthLevelEnumerationRelation Q stages levels row A ∅).2 + ⟨hp, emptyBound, Or.inl ⟨empty, rfl⟩⟩⟩ + obtain ⟨selector, hs, function, selected⟩ := + M.uniformize_relation pairing unions powers separation choice hQ bound ground total + exact ⟨ground, selector, hs, function, selected, fun row A e entry => + ((M.pair_mem_birthLevelEnumerationRelation Q stages levels row A e).1 (selected entry)).2.2⟩ + +end TransitiveGround + +section +universe u + +theorem refinementDataHistoryIndices_subset {stages alpha history : ZFSet.{u}} + (subset : alpha ⊆ stages) : + refinementDataHistoryIndices alpha (graphRestriction alpha history) ⊆ + refinementDataHistoryIndices stages history := by + change refinementHistoryIndices alpha + (refinementDataHistoryField alpha (graphRestriction alpha history) 0) ⊆ _ + rw [refinementDataHistoryIndices_prefix subset (fun _ h => h)] + exact refinementHistoryIndices_mono subset + +theorem refinementDataHistoryAssignments_subset {stages alpha history : ZFSet.{u}} + (subset : alpha ⊆ stages) (T : ZFSet.{u}) : + stageOneAssignments (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T ⊆ + stageOneAssignments (refinementDataHistoryIndices stages history) T := by + intro z member + obtain ⟨t, ht, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments _ _ z).1 member + exact (mem_stageOneAssignments _ _ _).2 + ⟨t, refinementDataHistoryIndices_subset subset ht, u, hu, w, hw, rfl⟩ + +theorem RefinementDataHistory.prefix_assignments_cut {stages history T alpha A : ZFSet.{u}} + (valid : RefinementDataHistory stages history T) (subset : alpha ⊆ stages) + (data : A ⊆ stageOneAssignments (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T) : + assignmentCut (refinementDataHistoryLevels stages history T) alpha A = A := by + rw [← valid.prefix_cut subset (fun _ h => h) A] + exact assignmentCut_full (valid.restrict subset).levels_function data + +namespace TransitiveGround +open SetFormula +variable (M : TransitiveGround.{u}) + +theorem refinementDataHistoryCandidate_prefix {stages history rows T alpha row A : ZFSet.{u}} + (subset : alpha ⊆ stages) + (candidate : ZFSet.pair row A ∈ M.stageOneCandidateBound rows + (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T) : + ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by + obtain ⟨hrow, ground, data, small⟩ := (M.pair_mem_stageOneCandidateBound _ _ _ _ _).1 candidate + exact (M.pair_mem_stageOneCandidateBound _ _ _ _ _).2 + ⟨hrow, ground, fun _ h => refinementDataHistoryAssignments_subset subset T (data h), small⟩ + +theorem refinementDataHistoryCandidate_cut (separation : SeparationSchema M.sets) + {stages history rows T alpha row A : ZFSet.{u}} + (valid : RefinementDataHistory stages history T) (subset : alpha ⊆ stages) + (hLevels : refinementDataHistoryLevels stages history T ∈ M.sets) + (hAlpha : alpha ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (candidate : ZFSet.pair row A ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) : + ZFSet.pair row (assignmentCut (refinementDataHistoryLevels stages history T) alpha A) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T := by + have checked := M.refinementHistoryCandidate_cut separation valid.index_function valid.index_literal + subset hLevels hAlpha omega candidate + change ZFSet.pair row _ ∈ M.stageOneCandidateBound rows + (refinementHistoryIndices alpha (refinementDataHistoryField alpha (graphRestriction alpha history) 0)) T + rw [refinementDataHistoryIndices_prefix subset (fun _ h => h)] + exact checked + +theorem refinementDataHistoryCandidate_splice + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (infinite : Realize M.sets infinity Fin.elim0) (choice : Realize M.sets SetFormula.choice Fin.elim0) + {stages history rows T alpha q Aq p Ap : ZFSet.{u}} + (subset : alpha ⊆ stages) (hLevels : refinementDataHistoryLevels stages history T ∈ M.sets) + (hAlpha : alpha ∈ M.sets) + (lower : ZFSet.pair q Aq ∈ M.stageOneCandidateBound rows + (refinementDataHistoryIndices alpha (graphRestriction alpha history)) T) + (upper : ZFSet.pair p Ap ∈ M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T) : + ZFSet.pair q (assignmentSplice (refinementDataHistoryLevels stages history T) alpha Aq Ap) ∈ + M.stageOneCandidateBound rows (refinementDataHistoryIndices stages history) T := by + have first := ZFSet.pair_mem_prod.1 (M.refinementDataHistoryCandidate_prefix subset lower) + have second := ZFSet.pair_mem_prod.1 upper + exact ZFSet.pair_mem_prod.2 ⟨first.1, + M.assignmentSplice_mem_groundSmallSubsets pairing unions powers separation infinite choice + hLevels hAlpha first.2 second.2⟩ + +end TransitiveGround + +end + +namespace TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem birthEnumerationRange_spec + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {Q stages levels selector : ZFSet.{u}} (hQ : Q ∈ M.sets) (hStages : stages ∈ M.sets) + (omega : ZFSet.omega ∈ M.sets) (hSelector : selector ∈ M.sets) + (function : ZFSet.IsFunc Q (M.groundRelations ZFSet.omega stages) selector) + (selected : selector ⊆ M.birthLevelEnumerationRelation Q stages levels) : + let E0 := relationImage Q (M.groundRelations ZFSet.omega stages) selector + E0 ∈ M.sets ∧ E0 ⊆ M.groundRelations ZFSet.omega stages ∧ + (∀ e ∈ E0, e = ∅ ∨ ZFSet.IsFunc ZFSet.omega stages e) ∧ + ∀ row A, ZFSet.pair row A ∈ Q → + ∃ e ∈ E0, ZFSet.pair (ZFSet.pair row A) e ∈ selector ∧ + BirthLevelEnumerationCode ZFSet.omega stages A levels e := by + dsimp only + refine ⟨M.relationImage_mem separation hQ + (M.groundRelations_mem pairing unions powers separation omega hStages) hSelector, + fun e he => ((mem_relationImage _ _ _ e).1 he).1, ?_, ?_⟩ + · intro e he + obtain ⟨_, p, _, edge⟩ := (mem_relationImage _ _ _ e).1 he + have member := selected edge + obtain ⟨_, row, A, e', equal, code⟩ := ZFSet.mem_sep.1 member + obtain ⟨_, rfl⟩ := ZFSet.pair_inj.1 equal + exact code.elim (fun idle => Or.inl idle.2) (fun active => Or.inr active.1) + · intro row A hp + obtain ⟨e, edge, _⟩ := function.2 _ hp + have bound := (ZFSet.pair_mem_prod.1 (function.1 edge)).2 + exact ⟨e, (mem_relationImage _ _ _ e).2 ⟨bound, _, hp, edge⟩, edge, + ((M.pair_mem_birthLevelEnumerationRelation Q stages levels row A e).1 (selected edge)).2.2⟩ + +end TransitiveGround + +namespace RefinementDataHistory +universe u +variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) +include valid + +theorem birthEnumeration_idle_iff {A e : ZFSet.{u}} + (shape : A ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) + (code : BirthLevelEnumerationCode ZFSet.omega stages A + (refinementDataHistoryLevels stages history T) e) : e = ∅ ↔ A = ∅ := by + constructor + · intro idle + apply ZFSet.ext + intro x + constructor + · intro hx + obtain ⟨alpha, edge, _⟩ := valid.levels_function.2 x (shape hx) + have hAlpha := (ZFSet.pair_mem_prod.1 (valid.levels_function.1 edge)).2 + have attained := (mem_relationImage A stages _ alpha).2 ⟨hAlpha, x, hx, edge⟩ + obtain ⟨n, _, scheduled⟩ := (code.enumerates ⟨alpha, attained⟩).2 alpha attained + exact False.elim (ZFSet.notMem_empty _ (idle ▸ scheduled)) + · intro hx + exact False.elim (ZFSet.notMem_empty x hx) + · intro empty + have emptyLevels : relationImage A stages (refinementDataHistoryLevels stages history T) = ∅ := by + apply ZFSet.ext + intro alpha + constructor + · intro ha + obtain ⟨_, x, hx, _⟩ := (mem_relationImage _ _ _ _).1 ha + exact False.elim (ZFSet.notMem_empty x (empty ▸ hx)) + · intro ha + exact False.elim (ZFSet.notMem_empty alpha ha) + exact code.idle ⟨natSetCode 0, natSetCode_mem_omega 0⟩ emptyLevels + +theorem birthEnumeration_assignment_visit (assignments enumerations : Nat → ZFSet.{u}) + (shape : ∀ i, assignments i ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) + (retained : ∀ i k, i ≤ k → assignments i ⊆ assignments k) + (coded : ∀ i, BirthLevelEnumerationCode ZFSet.omega stages (assignments i) + (refinementDataHistoryLevels stages history T) (enumerations i)) + {x : ZFSet.{u}} (member : x ∈ stageOneAssignmentUnion assignments) : + ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ + x ∈ assignments i ∧ + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ + ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ + alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) ∧ + ZFSet.pair (natSetCode j) alpha ∈ enumerations i ∧ + ∀ k, Nat.pair i j ≤ k → x ∈ assignmentOnIndices (fields 0) T (assignments k) := by + have onto : ∀ i alpha, + alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) → + ∃ j : Nat, ZFSet.pair (natSetCode j) alpha ∈ enumerations i := by + intro i alpha attained + obtain ⟨n, hn, entry⟩ := ((coded i).enumerates ⟨alpha, attained⟩).2 alpha attained + obtain ⟨j, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn + exact ⟨j, entry⟩ + obtain ⟨i, j, alpha, hAlpha, fields, scheduled, before, born, stored, + level, attained, enumeration, visited⟩ := + valid.birthList_assignment_visit assignments enumerations shape retained onto member + refine ⟨i, j, alpha, hAlpha, fields, scheduled, before, born, stored, + level, attained, enumeration, ?_⟩ + intro k after + have parts := (mem_assignmentOnIndices _ _ _ _).1 visited + exact (mem_assignmentOnIndices _ _ _ _).2 + ⟨retained (Nat.pair i j) k after parts.1, parts.2⟩ + +end RefinementDataHistory + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthSchedules.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthSchedules.lean index 0571d5b2d8288efbf27a5a4346944a018cafd80a..74445193125d750dfc12c2614daeb6a1755f8ef9 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthSchedules.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementBirthSchedules.lean @@ -1,63 +1,63 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -theorem birthHistory_scheduled_lookup (k : Nat) {W history : ZFSet.{u}} - (function : ZFSet.IsFunc (natSetCode (k + 1)) W history) : - ∃ record ∈ W, - ZFSet.pair (natSetCode (Nat.unpair k).1) record ∈ history ∧ - ∀ other, ZFSet.pair (natSetCode (Nat.unpair k).1) other ∈ history → other = record := by - have before : (natSetCode (Nat.unpair k).1 : ZFSet.{u}) ∈ natSetCode (k + 1) := - (natSetCode_mem_iff _ _).2 (Nat.lt_succ_of_le (Nat.unpair_left_le k)) - obtain ⟨record, entry, unique⟩ := function.2 _ before - exact ⟨record, (ZFSet.pair_mem_prod.1 (function.1 entry)).2, entry, unique⟩ - -namespace RefinementDataHistory -variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) -include valid - -theorem birthList_assignment_visit (assignments enumerations : Nat → ZFSet.{u}) - (shape : ∀ i, assignments i ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) - (retained : ∀ i k, i ≤ k → assignments i ⊆ assignments k) - (onto : ∀ i alpha, - alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) → - ∃ j : Nat, ZFSet.pair (natSetCode j) alpha ∈ enumerations i) - {x : ZFSet.{u}} (member : x ∈ stageOneAssignmentUnion assignments) : - ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, - Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ - x ∈ assignments i ∧ - ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ - ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ - alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) ∧ - ZFSet.pair (natSetCode j) alpha ∈ enumerations i ∧ - x ∈ assignmentOnIndices (fields 0) T (assignments (Nat.pair i j)) := by - obtain ⟨i, born⟩ := (mem_stageOneAssignmentUnion assignments x).1 member - obtain ⟨t, ht, first, hFirst, second, hSecond, rfl⟩ := - (mem_stageOneAssignments _ _ _).1 (shape i born) - obtain ⟨alpha, hAlpha, fields, stored, index⟩ := - (mem_refinementDataHistoryIndices _ _ _).1 ht - have terms := valid.terms alpha fields stored - have level := valid.coverage alpha hAlpha fields stored t index - first (terms.symm ▸ hFirst) second (terms.symm ▸ hSecond) - have attained : alpha ∈ relationImage (assignments i) stages - (refinementDataHistoryLevels stages history T) := - (mem_relationImage _ _ _ _).2 ⟨hAlpha, _, born, level⟩ - obtain ⟨j, scheduled⟩ := onto i alpha attained - have before := Nat.left_le_pair i j - exact ⟨i, j, alpha, hAlpha, fields, Nat.unpair_pair i j, before, born, stored, - level, attained, scheduled, - (assignmentOnIndices_entry _ _ _ _ _ _).2 - ⟨retained i (Nat.pair i j) before born, index, hFirst, hSecond⟩⟩ - -end RefinementDataHistory - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.RefinementDataHistoryEntryFormulas + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +theorem birthHistory_scheduled_lookup (k : Nat) {W history : ZFSet.{u}} + (function : ZFSet.IsFunc (natSetCode (k + 1)) W history) : + ∃ record ∈ W, + ZFSet.pair (natSetCode (Nat.unpair k).1) record ∈ history ∧ + ∀ other, ZFSet.pair (natSetCode (Nat.unpair k).1) other ∈ history → other = record := by + have before : (natSetCode (Nat.unpair k).1 : ZFSet.{u}) ∈ natSetCode (k + 1) := + (natSetCode_mem_iff _ _).2 (Nat.lt_succ_of_le (Nat.unpair_left_le k)) + obtain ⟨record, entry, unique⟩ := function.2 _ before + exact ⟨record, (ZFSet.pair_mem_prod.1 (function.1 entry)).2, entry, unique⟩ + +namespace RefinementDataHistory +variable {stages history T : ZFSet.{u}} (valid : RefinementDataHistory stages history T) +include valid + +theorem birthList_assignment_visit (assignments enumerations : Nat → ZFSet.{u}) + (shape : ∀ i, assignments i ⊆ stageOneAssignments (refinementDataHistoryIndices stages history) T) + (retained : ∀ i k, i ≤ k → assignments i ⊆ assignments k) + (onto : ∀ i alpha, + alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) → + ∃ j : Nat, ZFSet.pair (natSetCode j) alpha ∈ enumerations i) + {x : ZFSet.{u}} (member : x ∈ stageOneAssignmentUnion assignments) : + ∃ i j : Nat, ∃ alpha ∈ stages, ∃ fields : Fin 15 → ZFSet.{u}, + Nat.unpair (Nat.pair i j) = (i, j) ∧ i ≤ Nat.pair i j ∧ + x ∈ assignments i ∧ + ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ history ∧ + ZFSet.pair x alpha ∈ refinementDataHistoryLevels stages history T ∧ + alpha ∈ relationImage (assignments i) stages (refinementDataHistoryLevels stages history T) ∧ + ZFSet.pair (natSetCode j) alpha ∈ enumerations i ∧ + x ∈ assignmentOnIndices (fields 0) T (assignments (Nat.pair i j)) := by + obtain ⟨i, born⟩ := (mem_stageOneAssignmentUnion assignments x).1 member + obtain ⟨t, ht, first, hFirst, second, hSecond, rfl⟩ := + (mem_stageOneAssignments _ _ _).1 (shape i born) + obtain ⟨alpha, hAlpha, fields, stored, index⟩ := + (mem_refinementDataHistoryIndices _ _ _).1 ht + have terms := valid.terms alpha fields stored + have level := valid.coverage alpha hAlpha fields stored t index + first (terms.symm ▸ hFirst) second (terms.symm ▸ hSecond) + have attained : alpha ∈ relationImage (assignments i) stages + (refinementDataHistoryLevels stages history T) := + (mem_relationImage _ _ _ _).2 ⟨hAlpha, _, born, level⟩ + obtain ⟨j, scheduled⟩ := onto i alpha attained + have before := Nat.left_le_pair i j + exact ⟨i, j, alpha, hAlpha, fields, Nat.unpair_pair i j, before, born, stored, + level, attained, scheduled, + (assignmentOnIndices_entry _ _ _ _ _ _).2 + ⟨retained i (Nat.pair i j) before born, index, hFirst, hSecond⟩⟩ + +end RefinementDataHistory + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementFlatSuccessorUnions.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementFlatSuccessorUnions.lean index 778d2d9b5596e22839c41f1d5dbb34c6b77cfe50..10c1922fe8e94b7e55be508801ca75671fc9b4a2 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementFlatSuccessorUnions.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementFlatSuccessorUnions.lean @@ -1,48 +1,48 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementRawTestMonotonicity - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u -variable {P : Type u} [PartialOrder P] - -structure FlatSuccessorUnionLaws (tests : ZFSet.{u} → P → Prop) : Prop where - tests_union : ∀ (family : Nat → ZFSet.{u}) (rows : Nat → P) (p : P), - (∀ n m, n ≤ m → family n ⊆ family m) → - (∀ n, p ≤ rows n) → (∀ n, tests (family n) (rows n)) → - tests (stageOneAssignmentUnion family) p - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {P : Type u} -variable [PartialOrder P] [OrderTop P] (s : Presentation P) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) -variable {G L : Type u} [Group G] [PartialOrder L] -variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -theorem refinementLevelFlatSuccessorUnionLaws (level T2 : ZFSet.{u}) : - FlatSuccessorUnionLaws - (M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2) := - ⟨M.refinementLevelTests_union s pairing unions powers separation collection carrier order hT valid - a b d base directed system level T2⟩ - -end PartitionPilot.Forcing.TransitiveGround - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRefinementRawTestMonotonicity + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u +variable {P : Type u} [PartialOrder P] + +structure FlatSuccessorUnionLaws (tests : ZFSet.{u} → P → Prop) : Prop where + tests_union : ∀ (family : Nat → ZFSet.{u}) (rows : Nat → P) (p : P), + (∀ n m, n ≤ m → family n ⊆ family m) → + (∀ n, p ≤ rows n) → (∀ n, tests (family n) (rows n)) → + tests (stageOneAssignmentUnion family) p + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {P : Type u} +variable [PartialOrder P] [OrderTop P] (s : Presentation P) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable {T : ZFSet.{u}} (hT : T ∈ M.sets) (valid : ∀ z ∈ T, IsName s z) +variable {G L : Type u} [Group G] [PartialOrder L] +variable (a : PosetAction G P) (b : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +theorem refinementLevelFlatSuccessorUnionLaws (level T2 : ZFSet.{u}) : + FlatSuccessorUnionLaws + (M.refinementLevelTests s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2) := + ⟨M.refinementLevelTests_union s pairing unions powers separation collection carrier order hT valid + a b d base directed system level T2⟩ + +end PartitionPilot.Forcing.TransitiveGround + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementHistoryPrefixLevels.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementHistoryPrefixLevels.lean index 0bd0728c81bf5440200a2e35ebfebde9fb43603c..14838423798716db4a92509820ba58dd2e292109 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementHistoryPrefixLevels.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/RefinementHistoryPrefixLevels.lean @@ -1,511 +1,511 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData - -namespace OAI - -open scoped ZFSet - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def refinementHistoryIndices (alpha history : ZFSet.{u}) : ZFSet.{u} := - ⋃₀ functionGraphRange alpha history - -theorem mem_refinementHistoryIndices (alpha history x : ZFSet.{u}) : - x ∈ refinementHistoryIndices alpha history ↔ - ∃ xi ∈ alpha, ∃ I, ZFSet.pair xi I ∈ history ∧ x ∈ I := by - rw [refinementHistoryIndices, ZFSet.mem_sUnion] - constructor - · rintro ⟨I, hI, hx⟩ - obtain ⟨xi, hxi, entry⟩ := (mem_functionGraphRange alpha history I).1 hI - exact ⟨xi, hxi, I, entry, hx⟩ - · rintro ⟨xi, hxi, I, entry, hx⟩ - exact ⟨I, (mem_functionGraphRange alpha history I).2 ⟨xi, hxi, entry⟩, hx⟩ - -theorem refinementHistoryIndices_mono {alpha beta history : ZFSet.{u}} - (subset : alpha ⊆ beta) : - refinementHistoryIndices alpha history ⊆ refinementHistoryIndices beta history := by - intro x hx - obtain ⟨xi, hxi, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx - exact (mem_refinementHistoryIndices beta history x).2 ⟨xi, subset hxi, I, entry, hi⟩ - -noncomputable def refinementHistoryLevels (alpha history : ZFSet.{u}) : ZFSet.{u} := - refinementIndexFieldGraph (refinementHistoryIndices alpha history) alpha 0 - -theorem pair_mem_refinementHistoryLevels {alpha history : ZFSet.{u}} - (function : FunctionGraphOn alpha history) - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) - (x xi : ZFSet.{u}) : - ZFSet.pair x xi ∈ refinementHistoryLevels alpha history ↔ - ∃ I, ZFSet.pair xi I ∈ history ∧ x ∈ I := by - rw [refinementHistoryLevels, pair_mem_refinementIndexFieldGraph] - constructor - · rintro ⟨hx, _, v, eqv, hxi⟩ - obtain ⟨eta, _, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx - obtain ⟨w, eqw, hw⟩ := literal eta I entry x hi - have same := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) - have equal : xi = eta := hxi.trans ((congrFun same 0).trans hw) - exact ⟨I, equal.symm ▸ entry, hi⟩ - · rintro ⟨I, entry, hi⟩ - obtain ⟨v, eqv, hv⟩ := literal xi I entry x hi - exact ⟨(mem_refinementHistoryIndices alpha history x).2 - ⟨xi, function.pair_source entry, I, entry, hi⟩, - function.pair_source entry, v, eqv, hv.symm⟩ - -theorem refinementHistoryLevels_function {alpha history : ZFSet.{u}} - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) : - ZFSet.IsFunc (refinementHistoryIndices alpha history) alpha - (refinementHistoryLevels alpha history) := by - apply refinementIndexFieldGraph_function - intro x hx - obtain ⟨xi, hxi, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx - obtain ⟨v, eqv, hv⟩ := literal xi I entry x hi - exact ⟨v, eqv, hv.symm ▸ hxi⟩ - -theorem refinementHistory_fibers_disjoint {history xi eta I J : ZFSet.{u}} - (literal : ∀ level K, ZFSet.pair level K ∈ history → RefinementIndexLevelCode K level) - (first : ZFSet.pair xi I ∈ history) (second : ZFSet.pair eta J ∈ history) - (different : xi ≠ eta) : ∀ x, ¬ (x ∈ I ∧ x ∈ J) := - (literal xi I first).disjoint (literal eta J second) different - -theorem refinementHistoryAnchor_entry (alpha history B : ZFSet.{u}) - (v : Fin 6 → ZFSet.{u}) (y : ZFSet.{u}) : - ZFSet.pair (nonemptyTupleCode 5 v) y ∈ - refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2 ↔ - (∃ xi ∈ alpha, ∃ I, ZFSet.pair xi I ∈ history ∧ nonemptyTupleCode 5 v ∈ I) ∧ - y ∈ B ∧ y = v 2 := by - rw [refinementIndexFieldGraph_entry, mem_refinementHistoryIndices] - -theorem refinementHistoryAnchor_function {alpha history B : ZFSet.{u}} - (decoded : ∀ xi I, ZFSet.pair xi I ∈ history → - ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v 2 ∈ B) : - ZFSet.IsFunc (refinementHistoryIndices alpha history) B - (refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2) := by - apply refinementIndexFieldGraph_function - intro x hx - obtain ⟨xi, _, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx - exact decoded xi I entry x hi - - - - - -noncomputable def refinementHistoryAssignmentLevels (alpha history T : ZFSet.{u}) : ZFSet.{u} := - assignmentIndexLevels (refinementHistoryIndices alpha history) T alpha - (refinementHistoryLevels alpha history) - -theorem mem_refinementHistoryAssignments (alpha history T z : ZFSet.{u}) : - z ∈ stageOneAssignments (refinementHistoryIndices alpha history) T ↔ - ∃ xi ∈ alpha, ∃ I, ZFSet.pair xi I ∈ history ∧ z ∈ stageOneAssignments I T := by - rw [mem_stageOneAssignments] - constructor - · rintro ⟨i, hi, u, hu, w, hw, rfl⟩ - obtain ⟨xi, hxi, I, entry, member⟩ := (mem_refinementHistoryIndices alpha history i).1 hi - exact ⟨xi, hxi, I, entry, - (stageOneAssignment_mem_assignments I T i u w).2 ⟨member, hu, hw⟩⟩ - · rintro ⟨xi, hxi, I, entry, member⟩ - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 member - exact ⟨i, (mem_refinementHistoryIndices alpha history i).2 ⟨xi, hxi, I, entry, hi⟩, - u, hu, w, hw, rfl⟩ - -theorem pair_mem_refinementHistoryAssignmentLevels {alpha history : ZFSet.{u}} - (function : FunctionGraphOn alpha history) - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) - (T z xi : ZFSet.{u}) : - ZFSet.pair z xi ∈ refinementHistoryAssignmentLevels alpha history T ↔ - ∃ I, ZFSet.pair xi I ∈ history ∧ z ∈ stageOneAssignments I T := by - rw [refinementHistoryAssignmentLevels, pair_mem_assignmentIndexLevels] - constructor - · rintro ⟨i, _, u, hu, w, hw, rfl, _, entry⟩ - obtain ⟨I, hI, hi⟩ := (pair_mem_refinementHistoryLevels function literal i xi).1 entry - exact ⟨I, hI, (stageOneAssignment_mem_assignments I T i u w).2 ⟨hi, hu, hw⟩⟩ - · rintro ⟨I, entry, member⟩ - obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 member - exact ⟨i, (mem_refinementHistoryIndices alpha history i).2 - ⟨xi, function.pair_source entry, I, entry, hi⟩, - u, hu, w, hw, rfl, function.pair_source entry, - (pair_mem_refinementHistoryLevels function literal i xi).2 ⟨I, entry, hi⟩⟩ - -theorem refinementHistoryAssignmentLevels_entry {alpha history : ZFSet.{u}} - (function : FunctionGraphOn alpha history) - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) - (T i u w xi : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment i u w) xi ∈ refinementHistoryAssignmentLevels alpha history T ↔ - ∃ I, ZFSet.pair xi I ∈ history ∧ i ∈ I ∧ u ∈ T ∧ w ∈ T := by - rw [pair_mem_refinementHistoryAssignmentLevels function literal] - simp only [stageOneAssignment_mem_assignments] - -theorem refinementHistoryAssignmentLevels_function {alpha history T : ZFSet.{u}} - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) : - ZFSet.IsFunc (stageOneAssignments (refinementHistoryIndices alpha history) T) alpha - (refinementHistoryAssignmentLevels alpha history T) := - assignmentIndexLevels_function (refinementHistoryLevels_function literal) - -theorem refinementHistoryAssignmentCut_eq {alpha beta history : ZFSet.{u}} - (function : FunctionGraphOn alpha history) - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) - (subset : beta ⊆ alpha) (T A : ZFSet.{u}) : - assignmentCut (refinementHistoryAssignmentLevels alpha history T) beta A = - ZFSet.sep (fun z => z ∈ stageOneAssignments (refinementHistoryIndices beta history) T) A := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut, ZFSet.mem_sep] - apply and_congr_right - intro _ - rw [mem_refinementHistoryAssignments] - constructor - · rintro ⟨xi, hxi, entry⟩ - obtain ⟨I, hI, member⟩ := (pair_mem_refinementHistoryAssignmentLevels function literal T z xi).1 entry - exact ⟨xi, hxi, I, hI, member⟩ - · rintro ⟨xi, hxi, I, entry, member⟩ - have _ : xi ∈ alpha := subset hxi - exact ⟨xi, hxi, (pair_mem_refinementHistoryAssignmentLevels function literal T z xi).2 - ⟨I, entry, member⟩⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -theorem refinementHistoryIndices_mem - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) - {alpha history : ZFSet.{u}} (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) : - refinementHistoryIndices alpha history ∈ M.sets := - M.union_mem unions (M.functionGraphRange_mem unions separation hAlpha hHistory) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -include pairing unions powers separation - -theorem refinementHistoryLevels_mem {alpha history : ZFSet.{u}} - (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) : - refinementHistoryLevels alpha history ∈ M.sets := - M.refinementIndexFieldGraph_mem pairing unions powers separation - (M.refinementHistoryIndices_mem unions separation hAlpha hHistory) hAlpha 0 - -theorem refinementHistoryAssignmentLevels_mem {alpha history T : ZFSet.{u}} - (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) : - refinementHistoryAssignmentLevels alpha history T ∈ M.sets := - M.assignmentIndexLevels_mem pairing unions powers separation - (M.refinementHistoryIndices_mem unions separation hAlpha hHistory) hT hAlpha - (M.refinementHistoryLevels_mem pairing unions powers separation hAlpha hHistory) - -theorem refinementHistoryAnchors_mem {alpha history B : ZFSet.{u}} - (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) (hB : B ∈ M.sets) : - refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2 ∈ M.sets := - M.refinementIndexFieldGraph_mem pairing unions powers separation - (M.refinementHistoryIndices_mem unions separation hAlpha hHistory) hB 2 - -theorem refinementHistoryData {alpha history T B : ZFSet.{u}} - (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) (hB : B ∈ M.sets) - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) - (decoded : ∀ xi I, ZFSet.pair xi I ∈ history → - ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v 2 ∈ B) : - refinementHistoryIndices alpha history ∈ M.sets ∧ - refinementHistoryLevels alpha history ∈ M.sets ∧ - refinementHistoryAssignmentLevels alpha history T ∈ M.sets ∧ - refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2 ∈ M.sets ∧ - ZFSet.IsFunc (refinementHistoryIndices alpha history) alpha (refinementHistoryLevels alpha history) ∧ - ZFSet.IsFunc (stageOneAssignments (refinementHistoryIndices alpha history) T) alpha - (refinementHistoryAssignmentLevels alpha history T) ∧ - ZFSet.IsFunc (refinementHistoryIndices alpha history) B - (refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2) := - ⟨M.refinementHistoryIndices_mem unions separation hAlpha hHistory, - M.refinementHistoryLevels_mem pairing unions powers separation hAlpha hHistory, - M.refinementHistoryAssignmentLevels_mem pairing unions powers separation hAlpha hHistory hT, - M.refinementHistoryAnchors_mem pairing unions powers separation hAlpha hHistory hB, - refinementHistoryLevels_function literal, refinementHistoryAssignmentLevels_function literal, - refinementHistoryAnchor_function decoded⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing.TransitiveGround -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def definable_historyUnion - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (separation : SeparationSchema M.sets) : - GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => - refinementHistoryIndices (env 0) (env 1)) where - formula := exactSetFormula 0 (.ex (.ex - (.conj (.mem 1 4) (.conj (pairMembershipFormula 1 0 5) (.mem 2 0))))) - closed := fun _ members => M.refinementHistoryIndices_mem unions separation (members 0) (members 1) - correct := by - intro env members z hz - have ground := M.refinementHistoryIndices_mem unions separation (members 0) (members 1) - apply M.realize_exactSetFormula 0 _ (extend z env) hz (fun _ h => M.transitive ground h) - intro w _ - simp only [realize_ex] - change (∃ a ∈ M.sets, ∃ Y ∈ M.sets, a ∈ env 0 ∧ - Realize M.sets (pairMembershipFormula 1 0 5) - (extend Y (extend a (extend w (extend z env)))) ∧ w ∈ Y) ↔ _ - rw [mem_refinementHistoryIndices] - constructor - · rintro ⟨a, ha, Y, hY, member, entry, inside⟩ - exact ⟨a, member, Y, - (M.realize_pairMembershipFormula pairing 1 0 5 (extend Y (extend a (extend w (extend z env)))) ha hY (members 1)).1 entry, inside⟩ - · rintro ⟨a, member, Y, entry, inside⟩ - have ha := M.transitive (members 0) member - have hY := M.transitive (M.union_mem unions (M.union_mem unions (members 1))) - (pair_second_mem_doubleUnion entry) - exact ⟨a, ha, Y, hY, member, - (M.realize_pairMembershipFormula pairing 1 0 5 (extend Y (extend a (extend w (extend z env)))) ha hY (members 1)).2 entry, inside⟩ - - - - - -theorem historyUnion_countable_capture - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - {history B : ZFSet.{u}} (hh : history ∈ M.sets) (hB : B ∈ M.sets) - (small : M.groundEmbeddable B ZFSet.omega) - (subset : B ⊆ refinementHistoryIndices - (M.groundOmegaOne pairing unions powers separation collection infinite) history) : - ∃ beta ∈ M.groundOmegaOne pairing unions powers separation collection infinite, - B ⊆ refinementHistoryIndices beta history := by - let C := M.groundOmegaOne pairing unions powers separation collection infinite - have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 - let formula : SetFormula 3 := .ex (.conj (pairMembershipFormula 2 0 3) (.mem 1 0)) - let params : Fin 1 → ZFSet.{u} := ![history] - have members : ∀ j, params j ∈ M.sets := Fin.cases hh (fun j => Fin.elim0 j) - have recognize (x alpha : ZFSet.{u}) (ha : alpha ∈ M.sets) : - Realize M.sets formula (extend x (extend alpha params)) ↔ - ∃ Y, ZFSet.pair alpha Y ∈ history ∧ x ∈ Y := by - rw [show formula = .ex (.conj (pairMembershipFormula 2 0 3) (.mem 1 0)) from rfl, realize_ex] - constructor - · rintro ⟨Y, hY, entry, inside⟩ - exact ⟨Y, (M.realize_pairMembershipFormula pairing 2 0 3 - (extend Y (extend x (extend alpha params))) ha hY hh).1 entry, inside⟩ - · rintro ⟨Y, entry, inside⟩ - have hY := M.transitive (M.union_mem unions (M.union_mem unions hh)) - (pair_second_mem_doubleUnion entry) - exact ⟨Y, hY, (M.realize_pairMembershipFormula pairing 2 0 3 - (extend Y (extend x (extend alpha params))) ha hY hh).2 entry, inside⟩ - let relation := M.definableRelation formula params B C - have relationGround := M.definableRelation_mem pairing unions powers separation formula params members hB hC - have total : ∀ x ∈ B, ∃ alpha ∈ C, ZFSet.pair x alpha ∈ relation := by - intro x hx - obtain ⟨alpha, ha, Y, entry, inside⟩ := (mem_refinementHistoryIndices C history x).1 (subset hx) - exact ⟨alpha, ha, (M.pair_mem_definableRelation formula params B C x alpha).2 - ⟨hx, ha, (recognize x alpha (M.transitive hC ha)).2 ⟨Y, entry, inside⟩⟩⟩ - obtain ⟨selection, ground, function, selected⟩ := - M.uniformize_relation pairing unions powers separation choice hB hC relationGround total - have rangeGround := M.relationImage_mem separation hB hC ground - have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice - hB hC (M.omega_mem separation infinite) ground function small - obtain ⟨beta, hBeta, bounds⟩ := M.groundOmegaOne_countable_bound - pairing unions powers separation collection infinite choice rangeGround - (fun _ h => ((mem_relationImage B C selection _).1 h).1) rangeSmall - refine ⟨beta, hBeta, ?_⟩ - intro x hx - obtain ⟨alpha, entry, _⟩ := function.2 x hx - have ha := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨Y, stored, inside⟩ := (recognize x alpha (M.transitive hC ha)).1 - ((M.pair_mem_definableRelation formula params B C x alpha).1 (selected entry)).2.2 - exact (mem_refinementHistoryIndices beta history x).2 - ⟨alpha, bounds alpha ((mem_relationImage B C selection alpha).2 ⟨ha, x, hx, entry⟩), Y, stored, inside⟩ - -end PartitionPilot.Forcing.TransitiveGround - - - -namespace PartitionPilot.Forcing -universe u - -noncomputable def refinementDataHistoryField (stages history : ZFSet.{u}) (j : Fin 15) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ z = ZFSet.pair alpha (d j)) - (ZFSet.prod stages (tupleFieldBound 14 (⋃₀ ⋃₀ history))) - -theorem mem_refinementDataHistoryField (stages history z : ZFSet.{u}) (j : Fin 15) : - z ∈ refinementDataHistoryField stages history j ↔ - ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ z = ZFSet.pair alpha (d j) := by - rw [refinementDataHistoryField, ZFSet.mem_sep] - constructor - · exact And.right - · rintro ⟨alpha, halpha, d, entry, rfl⟩ - exact ⟨ZFSet.pair_mem_prod.2 ⟨halpha, - nonemptyTupleCode_field_mem_bound 14 d (pair_second_mem_doubleUnion entry) j⟩, - alpha, halpha, d, entry, rfl⟩ - -theorem pair_mem_refinementDataHistoryField (stages history alpha y : ZFSet.{u}) (j : Fin 15) : - ZFSet.pair alpha y ∈ refinementDataHistoryField stages history j ↔ - alpha ∈ stages ∧ ∃ d : Fin 15 → ZFSet.{u}, - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ y = d j := by - rw [mem_refinementDataHistoryField] - constructor - · rintro ⟨beta, hbeta, d, entry, equal⟩ - obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal - exact ⟨hbeta, d, entry, value⟩ - · rintro ⟨halpha, d, entry, rfl⟩ - exact ⟨alpha, halpha, d, entry, rfl⟩ - -theorem refinementDataHistoryField_entry {stages history alpha : ZFSet.{u}} - (function : FunctionGraphOn stages history) (d : Fin 15 → ZFSet.{u}) - (entry : ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history) (j : Fin 15) (y : ZFSet.{u}) : - ZFSet.pair alpha y ∈ refinementDataHistoryField stages history j ↔ y = d j := by - rw [pair_mem_refinementDataHistoryField] - constructor - · rintro ⟨_, fields, stored, value⟩ - have same := refinementFormulaDataCode_injective (function.unique stored entry) - exact value.trans (congrFun same j) - · intro equal - exact ⟨function.pair_source entry, d, entry, equal⟩ - -theorem refinementDataHistoryField_function {stages history : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (decoded : ∀ alpha data, ZFSet.pair alpha data ∈ history → - ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) (j : Fin 15) : - FunctionGraphOn stages (refinementDataHistoryField stages history j) := by - refine ⟨tupleFieldBound 14 (⋃₀ ⋃₀ history), fun _ member => (ZFSet.mem_sep.1 member).1, ?_⟩ - intro alpha halpha - obtain ⟨data, entry⟩ := function.total halpha - obtain ⟨d, rfl⟩ := decoded alpha data entry - refine ⟨d j, (refinementDataHistoryField_entry function d entry j _).2 rfl, ?_⟩ - intro y member - exact (refinementDataHistoryField_entry function d entry j y).1 member - -theorem refinementDataHistoryField_index_levels {stages history : ZFSet.{u}} - (literal : ∀ alpha (d : Fin 15 → ZFSet.{u}), - ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) alpha) : - ∀ alpha I, ZFSet.pair alpha I ∈ refinementDataHistoryField stages history 0 → - RefinementIndexLevelCode I alpha := by - intro alpha I entry - obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField stages history alpha I 0).1 entry - exact literal alpha d stored - - - - - -theorem refinementDataHistoryField_domain_restrict {stages earlier history : ZFSet.{u}} - (subset : earlier ⊆ stages) (j : Fin 15) : - refinementDataHistoryField earlier history j = - graphRestriction earlier (refinementDataHistoryField stages history j) := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨alpha, halpha, d, entry, rfl⟩ := (mem_refinementDataHistoryField _ _ _ _).1 member - exact pair_mem_graphRestriction.2 - ⟨(pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨subset halpha, d, entry, rfl⟩, halpha⟩ - · intro member - obtain ⟨alpha, halpha, y, rfl, entry⟩ := mem_graphRestriction.1 member - obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField _ _ _ _ _).1 entry - exact (pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨halpha, d, stored, rfl⟩ - -theorem refinementDataHistoryField_history_restrict (stages history : ZFSet.{u}) (j : Fin 15) : - refinementDataHistoryField stages (graphRestriction stages history) j = - refinementDataHistoryField stages history j := by - apply ZFSet.ext - intro z - rw [mem_refinementDataHistoryField, mem_refinementDataHistoryField] - constructor - · rintro ⟨alpha, halpha, d, entry, equal⟩ - exact ⟨alpha, halpha, d, (pair_mem_graphRestriction.1 entry).1, equal⟩ - · rintro ⟨alpha, halpha, d, entry, equal⟩ - exact ⟨alpha, halpha, d, pair_mem_graphRestriction.2 ⟨entry, halpha⟩, equal⟩ - -theorem refinementDataHistoryField_restrict {stages earlier history : ZFSet.{u}} - (subset : earlier ⊆ stages) (j : Fin 15) : - refinementDataHistoryField earlier (graphRestriction earlier history) j = - graphRestriction earlier (refinementDataHistoryField stages history j) := by - rw [refinementDataHistoryField_history_restrict, refinementDataHistoryField_domain_restrict subset] - -theorem refinementDataHistoryField_append {stages history alpha : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (d : Fin 15 → ZFSet.{u}) (j : Fin 15) : - refinementDataHistoryField (insert alpha stages) - (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) j = - insert (ZFSet.pair alpha (d j)) (refinementDataHistoryField stages history j) := by - apply ZFSet.ext - intro z - constructor - · intro member - obtain ⟨beta, _, fields, entry, rfl⟩ := (mem_refinementDataHistoryField _ _ _ _).1 member - rcases ZFSet.mem_insert_iff.1 entry with equal | old - · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal - have same := refinementFormulaDataCode_injective code - exact ZFSet.mem_insert_iff.2 (Or.inl (congrArg (ZFSet.pair beta) (congrFun same j))) - · exact ZFSet.mem_insert_iff.2 (Or.inr - ((pair_mem_refinementDataHistoryField _ _ _ _ _).2 - ⟨function.pair_source old, fields, old, rfl⟩)) - · intro member - rcases ZFSet.mem_insert_iff.1 member with rfl | old - · exact (pair_mem_refinementDataHistoryField _ _ _ _ _).2 - ⟨ZFSet.mem_insert _ _, d, ZFSet.mem_insert _ _, rfl⟩ - · obtain ⟨beta, hbeta, fields, entry, rfl⟩ := (mem_refinementDataHistoryField _ _ _ _).1 old - exact (pair_mem_refinementDataHistoryField _ _ _ _ _).2 - ⟨ZFSet.mem_insert_of_mem alpha hbeta, fields, - ZFSet.mem_insert_of_mem _ entry, rfl⟩ - - - - - -theorem refinementHistoryIndices_restrict {alpha beta history : ZFSet.{u}} - (below : beta ⊆ alpha) : - refinementHistoryIndices beta (graphRestriction alpha history) = - refinementHistoryIndices beta history := by - apply ZFSet.ext - intro x - rw [mem_refinementHistoryIndices, mem_refinementHistoryIndices] - constructor - · rintro ⟨xi, hxi, I, entry, member⟩ - exact ⟨xi, hxi, I, (pair_mem_graphRestriction.1 entry).1, member⟩ - · rintro ⟨xi, hxi, I, entry, member⟩ - exact ⟨xi, hxi, I, pair_mem_graphRestriction.2 ⟨entry, below hxi⟩, member⟩ - -theorem refinementHistoryAssignmentCut_restrict {stages alpha beta history : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) - (subset : alpha ⊆ stages) (below : beta ⊆ alpha) (T A : ZFSet.{u}) : - assignmentCut (refinementHistoryAssignmentLevels alpha (graphRestriction alpha history) T) beta A = - assignmentCut (refinementHistoryAssignmentLevels stages history T) beta A := by - rw [refinementHistoryAssignmentCut_eq (function.restrict subset) - (fun xi I entry => literal xi I (pair_mem_graphRestriction.1 entry).1) below] - rw [refinementHistoryAssignmentCut_eq function literal (fun _ h => subset (below h))] - rw [refinementHistoryIndices_restrict below] - -theorem refinementDataHistoryIndices_prefix {stages alpha beta history : ZFSet.{u}} - (subset : alpha ⊆ stages) (below : beta ⊆ alpha) : - refinementHistoryIndices beta - (refinementDataHistoryField alpha (graphRestriction alpha history) 0) = - refinementHistoryIndices beta (refinementDataHistoryField stages history 0) := by - rw [refinementDataHistoryField_restrict subset, refinementHistoryIndices_restrict below] - -theorem refinementDataHistoryAssignmentCut_prefix {stages alpha beta history : ZFSet.{u}} - (function : FunctionGraphOn stages history) - (decoded : ∀ xi data, ZFSet.pair xi data ∈ history → - ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) - (literal : ∀ xi (d : Fin 15 → ZFSet.{u}), - ZFSet.pair xi (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) xi) - (subset : alpha ⊆ stages) (below : beta ⊆ alpha) (T A : ZFSet.{u}) : - assignmentCut (refinementHistoryAssignmentLevels alpha - (refinementDataHistoryField alpha (graphRestriction alpha history) 0) T) beta A = - assignmentCut (refinementHistoryAssignmentLevels stages - (refinementDataHistoryField stages history 0) T) beta A := by - rw [refinementDataHistoryField_restrict subset] - exact refinementHistoryAssignmentCut_restrict - (refinementDataHistoryField_function function decoded 0) - (refinementDataHistoryField_index_levels literal) subset below T A - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundPackedRefinementFormulaData + +namespace OAI + +open scoped ZFSet + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def refinementHistoryIndices (alpha history : ZFSet.{u}) : ZFSet.{u} := + ⋃₀ functionGraphRange alpha history + +theorem mem_refinementHistoryIndices (alpha history x : ZFSet.{u}) : + x ∈ refinementHistoryIndices alpha history ↔ + ∃ xi ∈ alpha, ∃ I, ZFSet.pair xi I ∈ history ∧ x ∈ I := by + rw [refinementHistoryIndices, ZFSet.mem_sUnion] + constructor + · rintro ⟨I, hI, hx⟩ + obtain ⟨xi, hxi, entry⟩ := (mem_functionGraphRange alpha history I).1 hI + exact ⟨xi, hxi, I, entry, hx⟩ + · rintro ⟨xi, hxi, I, entry, hx⟩ + exact ⟨I, (mem_functionGraphRange alpha history I).2 ⟨xi, hxi, entry⟩, hx⟩ + +theorem refinementHistoryIndices_mono {alpha beta history : ZFSet.{u}} + (subset : alpha ⊆ beta) : + refinementHistoryIndices alpha history ⊆ refinementHistoryIndices beta history := by + intro x hx + obtain ⟨xi, hxi, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx + exact (mem_refinementHistoryIndices beta history x).2 ⟨xi, subset hxi, I, entry, hi⟩ + +noncomputable def refinementHistoryLevels (alpha history : ZFSet.{u}) : ZFSet.{u} := + refinementIndexFieldGraph (refinementHistoryIndices alpha history) alpha 0 + +theorem pair_mem_refinementHistoryLevels {alpha history : ZFSet.{u}} + (function : FunctionGraphOn alpha history) + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) + (x xi : ZFSet.{u}) : + ZFSet.pair x xi ∈ refinementHistoryLevels alpha history ↔ + ∃ I, ZFSet.pair xi I ∈ history ∧ x ∈ I := by + rw [refinementHistoryLevels, pair_mem_refinementIndexFieldGraph] + constructor + · rintro ⟨hx, _, v, eqv, hxi⟩ + obtain ⟨eta, _, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx + obtain ⟨w, eqw, hw⟩ := literal eta I entry x hi + have same := nonemptyTupleCode_injective 5 (eqv.symm.trans eqw) + have equal : xi = eta := hxi.trans ((congrFun same 0).trans hw) + exact ⟨I, equal.symm ▸ entry, hi⟩ + · rintro ⟨I, entry, hi⟩ + obtain ⟨v, eqv, hv⟩ := literal xi I entry x hi + exact ⟨(mem_refinementHistoryIndices alpha history x).2 + ⟨xi, function.pair_source entry, I, entry, hi⟩, + function.pair_source entry, v, eqv, hv.symm⟩ + +theorem refinementHistoryLevels_function {alpha history : ZFSet.{u}} + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) : + ZFSet.IsFunc (refinementHistoryIndices alpha history) alpha + (refinementHistoryLevels alpha history) := by + apply refinementIndexFieldGraph_function + intro x hx + obtain ⟨xi, hxi, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx + obtain ⟨v, eqv, hv⟩ := literal xi I entry x hi + exact ⟨v, eqv, hv.symm ▸ hxi⟩ + +theorem refinementHistory_fibers_disjoint {history xi eta I J : ZFSet.{u}} + (literal : ∀ level K, ZFSet.pair level K ∈ history → RefinementIndexLevelCode K level) + (first : ZFSet.pair xi I ∈ history) (second : ZFSet.pair eta J ∈ history) + (different : xi ≠ eta) : ∀ x, ¬ (x ∈ I ∧ x ∈ J) := + (literal xi I first).disjoint (literal eta J second) different + +theorem refinementHistoryAnchor_entry (alpha history B : ZFSet.{u}) + (v : Fin 6 → ZFSet.{u}) (y : ZFSet.{u}) : + ZFSet.pair (nonemptyTupleCode 5 v) y ∈ + refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2 ↔ + (∃ xi ∈ alpha, ∃ I, ZFSet.pair xi I ∈ history ∧ nonemptyTupleCode 5 v ∈ I) ∧ + y ∈ B ∧ y = v 2 := by + rw [refinementIndexFieldGraph_entry, mem_refinementHistoryIndices] + +theorem refinementHistoryAnchor_function {alpha history B : ZFSet.{u}} + (decoded : ∀ xi I, ZFSet.pair xi I ∈ history → + ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v 2 ∈ B) : + ZFSet.IsFunc (refinementHistoryIndices alpha history) B + (refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2) := by + apply refinementIndexFieldGraph_function + intro x hx + obtain ⟨xi, _, I, entry, hi⟩ := (mem_refinementHistoryIndices alpha history x).1 hx + exact decoded xi I entry x hi + + + + + +noncomputable def refinementHistoryAssignmentLevels (alpha history T : ZFSet.{u}) : ZFSet.{u} := + assignmentIndexLevels (refinementHistoryIndices alpha history) T alpha + (refinementHistoryLevels alpha history) + +theorem mem_refinementHistoryAssignments (alpha history T z : ZFSet.{u}) : + z ∈ stageOneAssignments (refinementHistoryIndices alpha history) T ↔ + ∃ xi ∈ alpha, ∃ I, ZFSet.pair xi I ∈ history ∧ z ∈ stageOneAssignments I T := by + rw [mem_stageOneAssignments] + constructor + · rintro ⟨i, hi, u, hu, w, hw, rfl⟩ + obtain ⟨xi, hxi, I, entry, member⟩ := (mem_refinementHistoryIndices alpha history i).1 hi + exact ⟨xi, hxi, I, entry, + (stageOneAssignment_mem_assignments I T i u w).2 ⟨member, hu, hw⟩⟩ + · rintro ⟨xi, hxi, I, entry, member⟩ + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 member + exact ⟨i, (mem_refinementHistoryIndices alpha history i).2 ⟨xi, hxi, I, entry, hi⟩, + u, hu, w, hw, rfl⟩ + +theorem pair_mem_refinementHistoryAssignmentLevels {alpha history : ZFSet.{u}} + (function : FunctionGraphOn alpha history) + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) + (T z xi : ZFSet.{u}) : + ZFSet.pair z xi ∈ refinementHistoryAssignmentLevels alpha history T ↔ + ∃ I, ZFSet.pair xi I ∈ history ∧ z ∈ stageOneAssignments I T := by + rw [refinementHistoryAssignmentLevels, pair_mem_assignmentIndexLevels] + constructor + · rintro ⟨i, _, u, hu, w, hw, rfl, _, entry⟩ + obtain ⟨I, hI, hi⟩ := (pair_mem_refinementHistoryLevels function literal i xi).1 entry + exact ⟨I, hI, (stageOneAssignment_mem_assignments I T i u w).2 ⟨hi, hu, hw⟩⟩ + · rintro ⟨I, entry, member⟩ + obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I T z).1 member + exact ⟨i, (mem_refinementHistoryIndices alpha history i).2 + ⟨xi, function.pair_source entry, I, entry, hi⟩, + u, hu, w, hw, rfl, function.pair_source entry, + (pair_mem_refinementHistoryLevels function literal i xi).2 ⟨I, entry, hi⟩⟩ + +theorem refinementHistoryAssignmentLevels_entry {alpha history : ZFSet.{u}} + (function : FunctionGraphOn alpha history) + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) + (T i u w xi : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment i u w) xi ∈ refinementHistoryAssignmentLevels alpha history T ↔ + ∃ I, ZFSet.pair xi I ∈ history ∧ i ∈ I ∧ u ∈ T ∧ w ∈ T := by + rw [pair_mem_refinementHistoryAssignmentLevels function literal] + simp only [stageOneAssignment_mem_assignments] + +theorem refinementHistoryAssignmentLevels_function {alpha history T : ZFSet.{u}} + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) : + ZFSet.IsFunc (stageOneAssignments (refinementHistoryIndices alpha history) T) alpha + (refinementHistoryAssignmentLevels alpha history T) := + assignmentIndexLevels_function (refinementHistoryLevels_function literal) + +theorem refinementHistoryAssignmentCut_eq {alpha beta history : ZFSet.{u}} + (function : FunctionGraphOn alpha history) + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) + (subset : beta ⊆ alpha) (T A : ZFSet.{u}) : + assignmentCut (refinementHistoryAssignmentLevels alpha history T) beta A = + ZFSet.sep (fun z => z ∈ stageOneAssignments (refinementHistoryIndices beta history) T) A := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut, ZFSet.mem_sep] + apply and_congr_right + intro _ + rw [mem_refinementHistoryAssignments] + constructor + · rintro ⟨xi, hxi, entry⟩ + obtain ⟨I, hI, member⟩ := (pair_mem_refinementHistoryAssignmentLevels function literal T z xi).1 entry + exact ⟨xi, hxi, I, hI, member⟩ + · rintro ⟨xi, hxi, I, entry, member⟩ + have _ : xi ∈ alpha := subset hxi + exact ⟨xi, hxi, (pair_mem_refinementHistoryAssignmentLevels function literal T z xi).2 + ⟨I, entry, member⟩⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +theorem refinementHistoryIndices_mem + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) + {alpha history : ZFSet.{u}} (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) : + refinementHistoryIndices alpha history ∈ M.sets := + M.union_mem unions (M.functionGraphRange_mem unions separation hAlpha hHistory) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +include pairing unions powers separation + +theorem refinementHistoryLevels_mem {alpha history : ZFSet.{u}} + (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) : + refinementHistoryLevels alpha history ∈ M.sets := + M.refinementIndexFieldGraph_mem pairing unions powers separation + (M.refinementHistoryIndices_mem unions separation hAlpha hHistory) hAlpha 0 + +theorem refinementHistoryAssignmentLevels_mem {alpha history T : ZFSet.{u}} + (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) : + refinementHistoryAssignmentLevels alpha history T ∈ M.sets := + M.assignmentIndexLevels_mem pairing unions powers separation + (M.refinementHistoryIndices_mem unions separation hAlpha hHistory) hT hAlpha + (M.refinementHistoryLevels_mem pairing unions powers separation hAlpha hHistory) + +theorem refinementHistoryAnchors_mem {alpha history B : ZFSet.{u}} + (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) (hB : B ∈ M.sets) : + refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2 ∈ M.sets := + M.refinementIndexFieldGraph_mem pairing unions powers separation + (M.refinementHistoryIndices_mem unions separation hAlpha hHistory) hB 2 + +theorem refinementHistoryData {alpha history T B : ZFSet.{u}} + (hAlpha : alpha ∈ M.sets) (hHistory : history ∈ M.sets) (hT : T ∈ M.sets) (hB : B ∈ M.sets) + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) + (decoded : ∀ xi I, ZFSet.pair xi I ∈ history → + ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v 2 ∈ B) : + refinementHistoryIndices alpha history ∈ M.sets ∧ + refinementHistoryLevels alpha history ∈ M.sets ∧ + refinementHistoryAssignmentLevels alpha history T ∈ M.sets ∧ + refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2 ∈ M.sets ∧ + ZFSet.IsFunc (refinementHistoryIndices alpha history) alpha (refinementHistoryLevels alpha history) ∧ + ZFSet.IsFunc (stageOneAssignments (refinementHistoryIndices alpha history) T) alpha + (refinementHistoryAssignmentLevels alpha history T) ∧ + ZFSet.IsFunc (refinementHistoryIndices alpha history) B + (refinementIndexFieldGraph (refinementHistoryIndices alpha history) B 2) := + ⟨M.refinementHistoryIndices_mem unions separation hAlpha hHistory, + M.refinementHistoryLevels_mem pairing unions powers separation hAlpha hHistory, + M.refinementHistoryAssignmentLevels_mem pairing unions powers separation hAlpha hHistory hT, + M.refinementHistoryAnchors_mem pairing unions powers separation hAlpha hHistory hB, + refinementHistoryLevels_function literal, refinementHistoryAssignmentLevels_function literal, + refinementHistoryAnchor_function decoded⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing.TransitiveGround +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def definable_historyUnion + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (separation : SeparationSchema M.sets) : + GroundDefinableFunction M (fun env : Fin 2 → ZFSet.{u} => + refinementHistoryIndices (env 0) (env 1)) where + formula := exactSetFormula 0 (.ex (.ex + (.conj (.mem 1 4) (.conj (pairMembershipFormula 1 0 5) (.mem 2 0))))) + closed := fun _ members => M.refinementHistoryIndices_mem unions separation (members 0) (members 1) + correct := by + intro env members z hz + have ground := M.refinementHistoryIndices_mem unions separation (members 0) (members 1) + apply M.realize_exactSetFormula 0 _ (extend z env) hz (fun _ h => M.transitive ground h) + intro w _ + simp only [realize_ex] + change (∃ a ∈ M.sets, ∃ Y ∈ M.sets, a ∈ env 0 ∧ + Realize M.sets (pairMembershipFormula 1 0 5) + (extend Y (extend a (extend w (extend z env)))) ∧ w ∈ Y) ↔ _ + rw [mem_refinementHistoryIndices] + constructor + · rintro ⟨a, ha, Y, hY, member, entry, inside⟩ + exact ⟨a, member, Y, + (M.realize_pairMembershipFormula pairing 1 0 5 (extend Y (extend a (extend w (extend z env)))) ha hY (members 1)).1 entry, inside⟩ + · rintro ⟨a, member, Y, entry, inside⟩ + have ha := M.transitive (members 0) member + have hY := M.transitive (M.union_mem unions (M.union_mem unions (members 1))) + (pair_second_mem_doubleUnion entry) + exact ⟨a, ha, Y, hY, member, + (M.realize_pairMembershipFormula pairing 1 0 5 (extend Y (extend a (extend w (extend z env)))) ha hY (members 1)).2 entry, inside⟩ + + + + + +theorem historyUnion_countable_capture + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + {history B : ZFSet.{u}} (hh : history ∈ M.sets) (hB : B ∈ M.sets) + (small : M.groundEmbeddable B ZFSet.omega) + (subset : B ⊆ refinementHistoryIndices + (M.groundOmegaOne pairing unions powers separation collection infinite) history) : + ∃ beta ∈ M.groundOmegaOne pairing unions powers separation collection infinite, + B ⊆ refinementHistoryIndices beta history := by + let C := M.groundOmegaOne pairing unions powers separation collection infinite + have hC := (M.groundOmegaOne_spec pairing unions powers separation collection infinite).1 + let formula : SetFormula 3 := .ex (.conj (pairMembershipFormula 2 0 3) (.mem 1 0)) + let params : Fin 1 → ZFSet.{u} := ![history] + have members : ∀ j, params j ∈ M.sets := Fin.cases hh (fun j => Fin.elim0 j) + have recognize (x alpha : ZFSet.{u}) (ha : alpha ∈ M.sets) : + Realize M.sets formula (extend x (extend alpha params)) ↔ + ∃ Y, ZFSet.pair alpha Y ∈ history ∧ x ∈ Y := by + rw [show formula = .ex (.conj (pairMembershipFormula 2 0 3) (.mem 1 0)) from rfl, realize_ex] + constructor + · rintro ⟨Y, hY, entry, inside⟩ + exact ⟨Y, (M.realize_pairMembershipFormula pairing 2 0 3 + (extend Y (extend x (extend alpha params))) ha hY hh).1 entry, inside⟩ + · rintro ⟨Y, entry, inside⟩ + have hY := M.transitive (M.union_mem unions (M.union_mem unions hh)) + (pair_second_mem_doubleUnion entry) + exact ⟨Y, hY, (M.realize_pairMembershipFormula pairing 2 0 3 + (extend Y (extend x (extend alpha params))) ha hY hh).2 entry, inside⟩ + let relation := M.definableRelation formula params B C + have relationGround := M.definableRelation_mem pairing unions powers separation formula params members hB hC + have total : ∀ x ∈ B, ∃ alpha ∈ C, ZFSet.pair x alpha ∈ relation := by + intro x hx + obtain ⟨alpha, ha, Y, entry, inside⟩ := (mem_refinementHistoryIndices C history x).1 (subset hx) + exact ⟨alpha, ha, (M.pair_mem_definableRelation formula params B C x alpha).2 + ⟨hx, ha, (recognize x alpha (M.transitive hC ha)).2 ⟨Y, entry, inside⟩⟩⟩ + obtain ⟨selection, ground, function, selected⟩ := + M.uniformize_relation pairing unions powers separation choice hB hC relationGround total + have rangeGround := M.relationImage_mem separation hB hC ground + have rangeSmall := M.groundEmbeddable_function_image pairing unions powers separation choice + hB hC (M.omega_mem separation infinite) ground function small + obtain ⟨beta, hBeta, bounds⟩ := M.groundOmegaOne_countable_bound + pairing unions powers separation collection infinite choice rangeGround + (fun _ h => ((mem_relationImage B C selection _).1 h).1) rangeSmall + refine ⟨beta, hBeta, ?_⟩ + intro x hx + obtain ⟨alpha, entry, _⟩ := function.2 x hx + have ha := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨Y, stored, inside⟩ := (recognize x alpha (M.transitive hC ha)).1 + ((M.pair_mem_definableRelation formula params B C x alpha).1 (selected entry)).2.2 + exact (mem_refinementHistoryIndices beta history x).2 + ⟨alpha, bounds alpha ((mem_relationImage B C selection alpha).2 ⟨ha, x, hx, entry⟩), Y, stored, inside⟩ + +end PartitionPilot.Forcing.TransitiveGround + + + +namespace PartitionPilot.Forcing +universe u + +noncomputable def refinementDataHistoryField (stages history : ZFSet.{u}) (j : Fin 15) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ z = ZFSet.pair alpha (d j)) + (ZFSet.prod stages (tupleFieldBound 14 (⋃₀ ⋃₀ history))) + +theorem mem_refinementDataHistoryField (stages history z : ZFSet.{u}) (j : Fin 15) : + z ∈ refinementDataHistoryField stages history j ↔ + ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ z = ZFSet.pair alpha (d j) := by + rw [refinementDataHistoryField, ZFSet.mem_sep] + constructor + · exact And.right + · rintro ⟨alpha, halpha, d, entry, rfl⟩ + exact ⟨ZFSet.pair_mem_prod.2 ⟨halpha, + nonemptyTupleCode_field_mem_bound 14 d (pair_second_mem_doubleUnion entry) j⟩, + alpha, halpha, d, entry, rfl⟩ + +theorem pair_mem_refinementDataHistoryField (stages history alpha y : ZFSet.{u}) (j : Fin 15) : + ZFSet.pair alpha y ∈ refinementDataHistoryField stages history j ↔ + alpha ∈ stages ∧ ∃ d : Fin 15 → ZFSet.{u}, + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ y = d j := by + rw [mem_refinementDataHistoryField] + constructor + · rintro ⟨beta, hbeta, d, entry, equal⟩ + obtain ⟨rfl, value⟩ := ZFSet.pair_inj.1 equal + exact ⟨hbeta, d, entry, value⟩ + · rintro ⟨halpha, d, entry, rfl⟩ + exact ⟨alpha, halpha, d, entry, rfl⟩ + +theorem refinementDataHistoryField_entry {stages history alpha : ZFSet.{u}} + (function : FunctionGraphOn stages history) (d : Fin 15 → ZFSet.{u}) + (entry : ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history) (j : Fin 15) (y : ZFSet.{u}) : + ZFSet.pair alpha y ∈ refinementDataHistoryField stages history j ↔ y = d j := by + rw [pair_mem_refinementDataHistoryField] + constructor + · rintro ⟨_, fields, stored, value⟩ + have same := refinementFormulaDataCode_injective (function.unique stored entry) + exact value.trans (congrFun same j) + · intro equal + exact ⟨function.pair_source entry, d, entry, equal⟩ + +theorem refinementDataHistoryField_function {stages history : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (decoded : ∀ alpha data, ZFSet.pair alpha data ∈ history → + ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) (j : Fin 15) : + FunctionGraphOn stages (refinementDataHistoryField stages history j) := by + refine ⟨tupleFieldBound 14 (⋃₀ ⋃₀ history), fun _ member => (ZFSet.mem_sep.1 member).1, ?_⟩ + intro alpha halpha + obtain ⟨data, entry⟩ := function.total halpha + obtain ⟨d, rfl⟩ := decoded alpha data entry + refine ⟨d j, (refinementDataHistoryField_entry function d entry j _).2 rfl, ?_⟩ + intro y member + exact (refinementDataHistoryField_entry function d entry j y).1 member + +theorem refinementDataHistoryField_index_levels {stages history : ZFSet.{u}} + (literal : ∀ alpha (d : Fin 15 → ZFSet.{u}), + ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) alpha) : + ∀ alpha I, ZFSet.pair alpha I ∈ refinementDataHistoryField stages history 0 → + RefinementIndexLevelCode I alpha := by + intro alpha I entry + obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField stages history alpha I 0).1 entry + exact literal alpha d stored + + + + + +theorem refinementDataHistoryField_domain_restrict {stages earlier history : ZFSet.{u}} + (subset : earlier ⊆ stages) (j : Fin 15) : + refinementDataHistoryField earlier history j = + graphRestriction earlier (refinementDataHistoryField stages history j) := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨alpha, halpha, d, entry, rfl⟩ := (mem_refinementDataHistoryField _ _ _ _).1 member + exact pair_mem_graphRestriction.2 + ⟨(pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨subset halpha, d, entry, rfl⟩, halpha⟩ + · intro member + obtain ⟨alpha, halpha, y, rfl, entry⟩ := mem_graphRestriction.1 member + obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField _ _ _ _ _).1 entry + exact (pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨halpha, d, stored, rfl⟩ + +theorem refinementDataHistoryField_history_restrict (stages history : ZFSet.{u}) (j : Fin 15) : + refinementDataHistoryField stages (graphRestriction stages history) j = + refinementDataHistoryField stages history j := by + apply ZFSet.ext + intro z + rw [mem_refinementDataHistoryField, mem_refinementDataHistoryField] + constructor + · rintro ⟨alpha, halpha, d, entry, equal⟩ + exact ⟨alpha, halpha, d, (pair_mem_graphRestriction.1 entry).1, equal⟩ + · rintro ⟨alpha, halpha, d, entry, equal⟩ + exact ⟨alpha, halpha, d, pair_mem_graphRestriction.2 ⟨entry, halpha⟩, equal⟩ + +theorem refinementDataHistoryField_restrict {stages earlier history : ZFSet.{u}} + (subset : earlier ⊆ stages) (j : Fin 15) : + refinementDataHistoryField earlier (graphRestriction earlier history) j = + graphRestriction earlier (refinementDataHistoryField stages history j) := by + rw [refinementDataHistoryField_history_restrict, refinementDataHistoryField_domain_restrict subset] + +theorem refinementDataHistoryField_append {stages history alpha : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (d : Fin 15 → ZFSet.{u}) (j : Fin 15) : + refinementDataHistoryField (insert alpha stages) + (insert (ZFSet.pair alpha (refinementFormulaDataCode d)) history) j = + insert (ZFSet.pair alpha (d j)) (refinementDataHistoryField stages history j) := by + apply ZFSet.ext + intro z + constructor + · intro member + obtain ⟨beta, _, fields, entry, rfl⟩ := (mem_refinementDataHistoryField _ _ _ _).1 member + rcases ZFSet.mem_insert_iff.1 entry with equal | old + · obtain ⟨rfl, code⟩ := ZFSet.pair_inj.1 equal + have same := refinementFormulaDataCode_injective code + exact ZFSet.mem_insert_iff.2 (Or.inl (congrArg (ZFSet.pair beta) (congrFun same j))) + · exact ZFSet.mem_insert_iff.2 (Or.inr + ((pair_mem_refinementDataHistoryField _ _ _ _ _).2 + ⟨function.pair_source old, fields, old, rfl⟩)) + · intro member + rcases ZFSet.mem_insert_iff.1 member with rfl | old + · exact (pair_mem_refinementDataHistoryField _ _ _ _ _).2 + ⟨ZFSet.mem_insert _ _, d, ZFSet.mem_insert _ _, rfl⟩ + · obtain ⟨beta, hbeta, fields, entry, rfl⟩ := (mem_refinementDataHistoryField _ _ _ _).1 old + exact (pair_mem_refinementDataHistoryField _ _ _ _ _).2 + ⟨ZFSet.mem_insert_of_mem alpha hbeta, fields, + ZFSet.mem_insert_of_mem _ entry, rfl⟩ + + + + + +theorem refinementHistoryIndices_restrict {alpha beta history : ZFSet.{u}} + (below : beta ⊆ alpha) : + refinementHistoryIndices beta (graphRestriction alpha history) = + refinementHistoryIndices beta history := by + apply ZFSet.ext + intro x + rw [mem_refinementHistoryIndices, mem_refinementHistoryIndices] + constructor + · rintro ⟨xi, hxi, I, entry, member⟩ + exact ⟨xi, hxi, I, (pair_mem_graphRestriction.1 entry).1, member⟩ + · rintro ⟨xi, hxi, I, entry, member⟩ + exact ⟨xi, hxi, I, pair_mem_graphRestriction.2 ⟨entry, below hxi⟩, member⟩ + +theorem refinementHistoryAssignmentCut_restrict {stages alpha beta history : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (literal : ∀ xi I, ZFSet.pair xi I ∈ history → RefinementIndexLevelCode I xi) + (subset : alpha ⊆ stages) (below : beta ⊆ alpha) (T A : ZFSet.{u}) : + assignmentCut (refinementHistoryAssignmentLevels alpha (graphRestriction alpha history) T) beta A = + assignmentCut (refinementHistoryAssignmentLevels stages history T) beta A := by + rw [refinementHistoryAssignmentCut_eq (function.restrict subset) + (fun xi I entry => literal xi I (pair_mem_graphRestriction.1 entry).1) below] + rw [refinementHistoryAssignmentCut_eq function literal (fun _ h => subset (below h))] + rw [refinementHistoryIndices_restrict below] + +theorem refinementDataHistoryIndices_prefix {stages alpha beta history : ZFSet.{u}} + (subset : alpha ⊆ stages) (below : beta ⊆ alpha) : + refinementHistoryIndices beta + (refinementDataHistoryField alpha (graphRestriction alpha history) 0) = + refinementHistoryIndices beta (refinementDataHistoryField stages history 0) := by + rw [refinementDataHistoryField_restrict subset, refinementHistoryIndices_restrict below] + +theorem refinementDataHistoryAssignmentCut_prefix {stages alpha beta history : ZFSet.{u}} + (function : FunctionGraphOn stages history) + (decoded : ∀ xi data, ZFSet.pair xi data ∈ history → + ∃ d : Fin 15 → ZFSet.{u}, data = refinementFormulaDataCode d) + (literal : ∀ xi (d : Fin 15 → ZFSet.{u}), + ZFSet.pair xi (refinementFormulaDataCode d) ∈ history → RefinementIndexLevelCode (d 0) xi) + (subset : alpha ⊆ stages) (below : beta ⊆ alpha) (T A : ZFSet.{u}) : + assignmentCut (refinementHistoryAssignmentLevels alpha + (refinementDataHistoryField alpha (graphRestriction alpha history) 0) T) beta A = + assignmentCut (refinementHistoryAssignmentLevels stages + (refinementDataHistoryField stages history 0) T) beta A := by + rw [refinementDataHistoryField_restrict subset] + exact refinementHistoryAssignmentCut_restrict + (refinementDataHistoryField_function function decoded 0) + (refinementDataHistoryField_index_levels literal) subset below T A + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SerializedChronologyCodes.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SerializedChronologyCodes.lean index 03230d49b56c981ce0e6117dcbf819efdad946de..3844f54f1a00a7ba6e13d9e09f0787c167194af5 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SerializedChronologyCodes.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SerializedChronologyCodes.lean @@ -1,84 +1,84 @@ -import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -def ChronologyLayerEntries (T N : ZFSet.{u}) (graphs : Fin 5 → ZFSet.{u}) - (layers : ZFSet.{u}) : Prop := - ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ L r μ birth z, - ZFSet.pair s L ∈ graphs 0 → ZFSet.pair s r ∈ graphs 1 → - ZFSet.pair s μ ∈ graphs 2 → ZFSet.pair s birth ∈ graphs 3 → - ZFSet.pair (ZFSet.pair s t) z ∈ layers → - GrowthLayerWitnessCode (graphs 0) (graphs 1) (graphs 2) L r μ birth t N z - -structure SerializedChronologyCode (T V C D rD N : ZFSet.{u}) - (graphs : Fin 5 → ZFSet.{u}) (W layers : ZFSet.{u}) : Prop where - ordinal : ordinalSetProperty T - core : ChronologyCoreCode T V C D rD graphs - function : ZFSet.IsFunc (chronologyPairs T) W layers - entries : ChronologyLayerEntries T N graphs layers - -namespace ChronologyCoreCode -theorem meet_of_entries {T V C D rD s L r μ birth : ZFSet.{u}} - {graphs : Fin 5 → ZFSet.{u}} (core : ChronologyCoreCode T V C D rD graphs) - (hs : s ∈ T) (eL : ZFSet.pair s L ∈ graphs 0) (er : ZFSet.pair s r ∈ graphs 1) - (eμ : ZFSet.pair s μ ∈ graphs 2) (eb : ZFSet.pair s birth ∈ graphs 3) : - MeetOrderCode L r μ := by - obtain ⟨height, entry, _⟩ := (core.function 4).2 s hs - exact (core.point s hs L r μ birth height eL er eμ eb entry).meet -end ChronologyCoreCode - -namespace GroundSerializedChronology -variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} - -theorem raw_code (serial : GroundSerializedChronology M T C D rD) : - SerializedChronologyCode T serial.fields.bound C D rD ZFSet.omega - serial.fields.graph serial.layerBound serial.layers := by - refine ⟨serial.ordinal, serial.core, serial.layer_function, ?_⟩ - intro s hs t ht earlier L r μ birth z eL er eμ eb entry - have code := serial.layer_code s hs t ht earlier z entry - rw [serial.fields.value_eq_of_entry 0 eL, serial.fields.value_eq_of_entry 1 er, - serial.fields.value_eq_of_entry 2 eμ, serial.fields.value_eq_of_entry 3 eb] at code - exact code -end GroundSerializedChronology - -namespace SerializedChronologyCode -variable {M : TransitiveGround.{u}} {T V C D rD N W layers : ZFSet.{u}} -variable {graphs : Fin 5 → ZFSet.{u}} - -noncomputable def toGround (code : SerializedChronologyCode T V C D rD N graphs W layers) - (hT : T ∈ M.sets) (hV : V ∈ M.sets) (hGraphs : ∀ j, graphs j ∈ M.sets) - (hW : W ∈ M.sets) (hLayers : layers ∈ M.sets) (omega : N = ZFSet.omega) : - GroundSerializedChronology M T C D rD where - fields := ⟨hT, V, hV, graphs, hGraphs, code.core.function⟩ - ordinal := code.ordinal - core := code.core - layerBound := W - layer_bound_ground := hW - layers := layers - layers_ground := hLayers - layer_function := code.function - layer_code := by - intro s hs t ht earlier z entry - let fields : GroundChronologyFields M T := ⟨hT, V, hV, graphs, hGraphs, code.core.function⟩ - exact omega ▸ code.entries s hs t ht earlier _ _ _ _ z - (fields.value_entry 0 hs) (fields.value_entry 1 hs) - (fields.value_entry 2 hs) (fields.value_entry 3 hs) entry - -theorem toGround_fields (code : SerializedChronologyCode T V C D rD N graphs W layers) - (hT : T ∈ M.sets) (hV : V ∈ M.sets) (hGraphs : ∀ j, graphs j ∈ M.sets) - (hW : W ∈ M.sets) (hLayers : layers ∈ M.sets) (omega : N = ZFSet.omega) : - let serial := code.toGround hT hV hGraphs hW hLayers omega - serial.fields.bound = V ∧ serial.fields.graph = graphs ∧ - serial.layerBound = W ∧ serial.layers = layers := ⟨rfl, rfl, rfl, rfl⟩ -end SerializedChronologyCode - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundSerializedChronologyTimeEquality + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +def ChronologyLayerEntries (T N : ZFSet.{u}) (graphs : Fin 5 → ZFSet.{u}) + (layers : ZFSet.{u}) : Prop := + ∀ s ∈ T, ∀ t ∈ T, t = s ∨ t ∈ s → ∀ L r μ birth z, + ZFSet.pair s L ∈ graphs 0 → ZFSet.pair s r ∈ graphs 1 → + ZFSet.pair s μ ∈ graphs 2 → ZFSet.pair s birth ∈ graphs 3 → + ZFSet.pair (ZFSet.pair s t) z ∈ layers → + GrowthLayerWitnessCode (graphs 0) (graphs 1) (graphs 2) L r μ birth t N z + +structure SerializedChronologyCode (T V C D rD N : ZFSet.{u}) + (graphs : Fin 5 → ZFSet.{u}) (W layers : ZFSet.{u}) : Prop where + ordinal : ordinalSetProperty T + core : ChronologyCoreCode T V C D rD graphs + function : ZFSet.IsFunc (chronologyPairs T) W layers + entries : ChronologyLayerEntries T N graphs layers + +namespace ChronologyCoreCode +theorem meet_of_entries {T V C D rD s L r μ birth : ZFSet.{u}} + {graphs : Fin 5 → ZFSet.{u}} (core : ChronologyCoreCode T V C D rD graphs) + (hs : s ∈ T) (eL : ZFSet.pair s L ∈ graphs 0) (er : ZFSet.pair s r ∈ graphs 1) + (eμ : ZFSet.pair s μ ∈ graphs 2) (eb : ZFSet.pair s birth ∈ graphs 3) : + MeetOrderCode L r μ := by + obtain ⟨height, entry, _⟩ := (core.function 4).2 s hs + exact (core.point s hs L r μ birth height eL er eμ eb entry).meet +end ChronologyCoreCode + +namespace GroundSerializedChronology +variable {M : TransitiveGround.{u}} {T C D rD : ZFSet.{u}} + +theorem raw_code (serial : GroundSerializedChronology M T C D rD) : + SerializedChronologyCode T serial.fields.bound C D rD ZFSet.omega + serial.fields.graph serial.layerBound serial.layers := by + refine ⟨serial.ordinal, serial.core, serial.layer_function, ?_⟩ + intro s hs t ht earlier L r μ birth z eL er eμ eb entry + have code := serial.layer_code s hs t ht earlier z entry + rw [serial.fields.value_eq_of_entry 0 eL, serial.fields.value_eq_of_entry 1 er, + serial.fields.value_eq_of_entry 2 eμ, serial.fields.value_eq_of_entry 3 eb] at code + exact code +end GroundSerializedChronology + +namespace SerializedChronologyCode +variable {M : TransitiveGround.{u}} {T V C D rD N W layers : ZFSet.{u}} +variable {graphs : Fin 5 → ZFSet.{u}} + +noncomputable def toGround (code : SerializedChronologyCode T V C D rD N graphs W layers) + (hT : T ∈ M.sets) (hV : V ∈ M.sets) (hGraphs : ∀ j, graphs j ∈ M.sets) + (hW : W ∈ M.sets) (hLayers : layers ∈ M.sets) (omega : N = ZFSet.omega) : + GroundSerializedChronology M T C D rD where + fields := ⟨hT, V, hV, graphs, hGraphs, code.core.function⟩ + ordinal := code.ordinal + core := code.core + layerBound := W + layer_bound_ground := hW + layers := layers + layers_ground := hLayers + layer_function := code.function + layer_code := by + intro s hs t ht earlier z entry + let fields : GroundChronologyFields M T := ⟨hT, V, hV, graphs, hGraphs, code.core.function⟩ + exact omega ▸ code.entries s hs t ht earlier _ _ _ _ z + (fields.value_entry 0 hs) (fields.value_entry 1 hs) + (fields.value_entry 2 hs) (fields.value_entry 3 hs) entry + +theorem toGround_fields (code : SerializedChronologyCode T V C D rD N graphs W layers) + (hT : T ∈ M.sets) (hV : V ∈ M.sets) (hGraphs : ∀ j, graphs j ∈ M.sets) + (hW : W ∈ M.sets) (hLayers : layers ∈ M.sets) (omega : N = ZFSet.omega) : + let serial := code.toGround hT hV hGraphs hW hLayers omega + serial.fields.bound = V ∧ serial.fields.graph = graphs ∧ + serial.layerBound = W ∧ serial.layers = layers := ⟨rfl, rfl, rfl, rfl⟩ +end SerializedChronologyCode + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SetRankBounds.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SetRankBounds.lean index 5c815ee0c9c239ba568b13e9547c55ba2f9f4d67..b058a75810bd001ee699bcdf8380825fdf11d8a0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SetRankBounds.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SetRankBounds.lean @@ -1,54 +1,54 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.SetPresentations - -namespace OAI - -section - -namespace PartitionPilot.SetRealization - -universe u -variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) {x y : ZFSet.{u}} -include limit - -theorem rank_singleton_lt (hx : ZFSet.rank x < o) : ZFSet.rank {x} < o := by - rw [ZFSet.rank_singleton] - exact limit.succ_lt hx - -theorem rank_unorderedPair_lt (hx : ZFSet.rank x < o) (hy : ZFSet.rank y < o) : - ZFSet.rank {x, y} < o := by - rw [ZFSet.rank_pair] - exact max_lt (limit.succ_lt hx) (limit.succ_lt hy) - -theorem rank_orderedPair_lt (hx : ZFSet.rank x < o) (hy : ZFSet.rank y < o) : - ZFSet.rank (ZFSet.pair x y) < o := - rank_unorderedPair_lt limit (rank_singleton_lt limit hx) (rank_unorderedPair_lt limit hx hy) - -theorem rank_product_lt (hx : ZFSet.rank x < o) (hy : ZFSet.rank y < o) : - ZFSet.rank (ZFSet.prod x y) < o := by - have sub : ZFSet.prod x y ⊆ ZFSet.powerset (ZFSet.powerset (x ∪ y)) := by - intro z hz - rw [ZFSet.prod, ZFSet.pairSep] at hz - exact (ZFSet.mem_sep.1 hz).1 - have bound := ZFSet.rank_mono sub - rw [ZFSet.rank_powerset, ZFSet.rank_powerset, ZFSet.rank_union] at bound - exact bound.trans_lt (limit.succ_lt (limit.succ_lt (max_lt hx hy))) - -namespace Presentation -variable {A B : Type u} (s : Presentation A) (t : Presentation B) - -theorem product_rank_lt (hs : ZFSet.rank s.carrier < o) (ht : ZFSet.rank t.carrier < o) : - ZFSet.rank (s.product t).carrier < o := - rank_product_lt limit hs ht - -omit limit in -theorem subset_rank_lt (hs : ZFSet.rank s.carrier < o) (p : A → Prop) : - ZFSet.rank (s.subset p) < o := - (s.rank_subset_le p).trans_lt hs - -end Presentation - -end PartitionPilot.SetRealization - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.SetPresentations + +namespace OAI + +section + +namespace PartitionPilot.SetRealization + +universe u +variable {o : Ordinal.{u}} (limit : Order.IsSuccLimit o) {x y : ZFSet.{u}} +include limit + +theorem rank_singleton_lt (hx : ZFSet.rank x < o) : ZFSet.rank {x} < o := by + rw [ZFSet.rank_singleton] + exact limit.succ_lt hx + +theorem rank_unorderedPair_lt (hx : ZFSet.rank x < o) (hy : ZFSet.rank y < o) : + ZFSet.rank {x, y} < o := by + rw [ZFSet.rank_pair] + exact max_lt (limit.succ_lt hx) (limit.succ_lt hy) + +theorem rank_orderedPair_lt (hx : ZFSet.rank x < o) (hy : ZFSet.rank y < o) : + ZFSet.rank (ZFSet.pair x y) < o := + rank_unorderedPair_lt limit (rank_singleton_lt limit hx) (rank_unorderedPair_lt limit hx hy) + +theorem rank_product_lt (hx : ZFSet.rank x < o) (hy : ZFSet.rank y < o) : + ZFSet.rank (ZFSet.prod x y) < o := by + have sub : ZFSet.prod x y ⊆ ZFSet.powerset (ZFSet.powerset (x ∪ y)) := by + intro z hz + rw [ZFSet.prod, ZFSet.pairSep] at hz + exact (ZFSet.mem_sep.1 hz).1 + have bound := ZFSet.rank_mono sub + rw [ZFSet.rank_powerset, ZFSet.rank_powerset, ZFSet.rank_union] at bound + exact bound.trans_lt (limit.succ_lt (limit.succ_lt (max_lt hx hy))) + +namespace Presentation +variable {A B : Type u} (s : Presentation A) (t : Presentation B) + +theorem product_rank_lt (hs : ZFSet.rank s.carrier < o) (ht : ZFSet.rank t.carrier < o) : + ZFSet.rank (s.product t).carrier < o := + rank_product_lt limit hs ht + +omit limit in +theorem subset_rank_lt (hs : ZFSet.rank s.carrier < o) (p : A → Prop) : + ZFSet.rank (s.subset p) < o := + (s.rank_subset_le p).trans_lt hs + +end Presentation + +end PartitionPilot.SetRealization + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SmallTileHeightInputs.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SmallTileHeightInputs.lean index 274d34ad05ac803c3d995fbbab780055fdb9d76a..50b258bf9d021846d9d8aa796a0a4fd65ca7ff45 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SmallTileHeightInputs.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SmallTileHeightInputs.lean @@ -1,180 +1,180 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound - -namespace OAI - -section - -namespace PartitionPilot.Forcing -open SetRealization Compression Compression.RecursiveMaps -universe u - -namespace MeetEmbeddingCode -variable {P Q rP rQ μP μQ f : ZFSet.{u}} -variable (embedding : MeetEmbeddingCode P Q rP rQ μP μQ f) - -noncomputable def smallValue (x : SetMembers P) : SetMembers Q := - (SetMembers.presentation P).decodeFunction (SetMembers.presentation Q) f - embedding.injection.function x - -theorem smallValue_entry (x : SetMembers P) : - ZFSet.pair (SetMembers.raw x) (SetMembers.raw (embedding.smallValue x)) ∈ f := - (SetMembers.presentation P).decodeFunction_mem (SetMembers.presentation Q) f - embedding.injection.function x - -theorem smallValue_eq_iff (x : SetMembers P) (y : SetMembers Q) : - embedding.smallValue x = y ↔ ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ f := - (SetMembers.presentation P).decodeFunction_iff (SetMembers.presentation Q) f - embedding.injection.function x y - -noncomputable def toSmallMeetEmbedding (source : MeetOrderCode P rP μP) - (target : MeetOrderCode Q rQ μQ) : - MeetEmbedding source.toSmallMeetOrder target.toSmallMeetOrder where - toFun := embedding.smallValue - le_iff x y := embedding.order_iff source target - (embedding.smallValue_entry x) (embedding.smallValue_entry y) - map_meet x y := by - symm - apply (target.smallMeet_eq_iff _ _ _).2 - exact embedding.map_meet _ _ _ _ _ _ (source.smallMeet_entry x y) - (embedding.smallValue_entry x) (embedding.smallValue_entry y) - (embedding.smallValue_entry (source.smallMeet x y)) - -end MeetEmbeddingCode - -noncomputable def smallCompressionTileIso {P r μ f : ZFSet.{u}} - (meet : MeetOrderCode P r μ) (embedding : MeetEmbeddingCode P P r r μ μ f) - (K : SetMembers P) - (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ - z ∈ P ∧ ZFSet.pair z (SetMembers.raw K) ∈ r) : - MeetIso meet.toSmallMeetOrder (Attachment.idealOrder meet.toSmallMeetOrder K) := by - apply isoOntoIdeal meet.toSmallMeetOrder (embedding.toSmallMeetEmbedding meet meet) K - · intro x - exact ((range _).1 ⟨SetMembers.raw x, SetMembers.raw_mem x, embedding.smallValue_entry x⟩).2 - · intro z hz - obtain ⟨x, hx, entry⟩ := (range (SetMembers.raw z)).2 ⟨SetMembers.raw_mem z, hz⟩ - refine ⟨SetMembers.ofMem x hx, (embedding.smallValue_eq_iff _ z).2 ?_⟩ - simpa only [SetMembers.raw_ofMem] using entry - -theorem smallCompressionTileIso_entry {P r μ f : ZFSet.{u}} - (meet : MeetOrderCode P r μ) (embedding : MeetEmbeddingCode P P r r μ μ f) - (K : SetMembers P) - (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ - z ∈ P ∧ ZFSet.pair z (SetMembers.raw K) ∈ r) (x : SetMembers P) : - ZFSet.pair (SetMembers.raw x) - (SetMembers.raw ((smallCompressionTileIso meet embedding K range).toFun x).val) ∈ f := - embedding.smallValue_entry x - -variable {P G r μ A m inv one c b d g h : ZFSet.{u}} - -noncomputable def ExternalRectangleCode.toSmallActionRectangle - (code : ExternalRectangleCode P G r μ A c b d g h) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - ActionRectangle meet.toSmallMeetOrder (action.toSmallMeetIso group meet) := by - obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code - let w := Classical.choose witness - have mw := (Classical.choose_spec witness).2.1 - have agree := (Classical.choose_spec witness).2.2.1 - have separated := (Classical.choose_spec witness).2.2.2 - let C := SetMembers.ofMem c hc - let B := SetMembers.ofMem b hb - let D := SetMembers.ofMem d hd - let first := SetMembers.ofMem g hg - let second := SetMembers.ofMem h hh - have meetValue : SetMembers.raw (meet.smallMeet C B) = w := by - apply (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique - (meet.smallMeet_entry C B) - simpa only [C, B, SetMembers.raw_ofMem] using mw - refine { - C := C - B := B - D := D - first := first - second := second - C_le_D := ?_ - B_le_D := ?_ - agree := ?_ - separated := ?_ } - · simpa only [MeetOrderCode.toSmallMeetOrder, C, D, SetMembers.raw_ofMem] using cd - · simpa only [MeetOrderCode.toSmallMeetOrder, B, D, SetMembers.raw_ofMem] using bd - · intro x lower - apply SetMembers.raw_injective P - have lowerW : ZFSet.pair (SetMembers.raw x) w ∈ r := meetValue ▸ lower - apply agree.entry_eq action hh (SetMembers.raw_mem x) lowerW - · simpa only [first, SetMembers.raw_ofMem, PosetActionCode.toSmallMeetIso] using action.act_mem first x - · simpa only [second, SetMembers.raw_ofMem, PosetActionCode.toSmallMeetIso] using action.act_mem second x - · apply SetMembers.raw_injective P - let y := action.act first D - let z := action.act second D - let v := action.act first (meet.smallMeet C B) - have actMeet : ZFSet.pair (ZFSet.pair g w) (SetMembers.raw v) ∈ A := by - rw [← meetValue] - simpa only [first, SetMembers.raw_ofMem] using action.act_mem first (meet.smallMeet C B) - have value := separated (SetMembers.raw y) (SetMembers.raw_mem y) - (SetMembers.raw z) (SetMembers.raw_mem z) (SetMembers.raw v) (SetMembers.raw_mem v) - ⟨by simpa only [first, D, SetMembers.raw_ofMem] using action.act_mem first D, - by simpa only [second, D, SetMembers.raw_ofMem] using action.act_mem second D, actMeet⟩ - exact (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique - (meet.smallMeet_entry y z) value - -theorem ExternalRectangleCode.toSmallActionRectangle_fields - (code : ExternalRectangleCode P G r μ A c b d g h) - (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) - (meet : MeetOrderCode P r μ) : - let request := code.toSmallActionRectangle group action meet - SetMembers.raw request.C = c ∧ SetMembers.raw request.B = b ∧ - SetMembers.raw request.D = d ∧ SetMembers.raw request.first = g ∧ SetMembers.raw request.second = h := by - obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code - exact ⟨SetMembers.raw_ofMem _ _, SetMembers.raw_ofMem _ _, SetMembers.raw_ofMem _ _, - SetMembers.raw_ofMem _ _, SetMembers.raw_ofMem _ _⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -open SetRealization Compression.RecursiveMaps -universe u -variable {P L r μ v ν f : ZFSet.{u}} - -noncomputable def MeetEmbeddingCode.smallIdealEmbedding - (embedding : MeetEmbeddingCode P L r v μ ν f) - (source : MeetOrderCode P r μ) (target : MeetOrderCode L v ν) - (ideal : ∀ x y z, ZFSet.pair x y ∈ f → z ∈ L → ZFSet.pair z y ∈ v → - ∃ a ∈ P, ZFSet.pair a z ∈ f) : - IdealEmbedding source.toSmallMeetOrder target.toSmallMeetOrder where - toMeetEmbedding := embedding.toSmallMeetEmbedding source target - ideal a z lower := by - obtain ⟨x, hx, entry⟩ := ideal _ _ _ (embedding.smallValue_entry a) (SetMembers.raw_mem z) lower - refine ⟨SetMembers.ofMem x hx, (embedding.smallValue_eq_iff _ z).2 ?_⟩ - simpa only [SetMembers.raw_ofMem] using entry - -theorem MeetEmbeddingCode.smallValue_graph (embedding : MeetEmbeddingCode P L r v μ ν f) : - (SetMembers.presentation P).graph (SetMembers.presentation L) embedding.smallValue = f := - (SetMembers.presentation P).graph_decodeFunction (SetMembers.presentation L) f embedding.injection.function - -noncomputable def binaryTileOfCodes {first second : ZFSet.{u}} - (source : MeetOrderCode P r μ) (target : MeetOrderCode L v ν) - (left : MeetEmbeddingCode P L r v μ ν first) (right : MeetEmbeddingCode P L r v μ ν second) - (leftIdeal : ∀ x y z, ZFSet.pair x y ∈ first → z ∈ L → ZFSet.pair z y ∈ v → - ∃ a ∈ P, ZFSet.pair a z ∈ first) - (rightIdeal : ∀ x y z, ZFSet.pair x y ∈ second → z ∈ L → ZFSet.pair z y ∈ v → - ∃ a ∈ P, ZFSet.pair a z ∈ second) - (cover : ∀ z ∈ L, (∃ x ∈ P, ZFSet.pair x z ∈ first) ∨ ∃ x ∈ P, ZFSet.pair x z ∈ second) : - TileRequests.Tile source.toSmallMeetOrder (ULift.{u} Unit) where - Space := SetMembers L - order := target.toSmallMeetOrder - root := left.smallIdealEmbedding source target leftIdeal - child _ := right.smallIdealEmbedding source target rightIdeal - cover z := by - rcases cover (SetMembers.raw z) (SetMembers.raw_mem z) with ⟨x, hx, entry⟩ | ⟨x, hx, entry⟩ - · refine Or.inl ⟨SetMembers.ofMem x hx, (left.smallValue_eq_iff _ z).2 ?_⟩ - simpa only [SetMembers.raw_ofMem] using entry - · refine Or.inr ⟨⟨()⟩, SetMembers.ofMem x hx, (right.smallValue_eq_iff _ z).2 ?_⟩ - simpa only [SetMembers.raw_ofMem] using entry - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound + +namespace OAI + +section + +namespace PartitionPilot.Forcing +open SetRealization Compression Compression.RecursiveMaps +universe u + +namespace MeetEmbeddingCode +variable {P Q rP rQ μP μQ f : ZFSet.{u}} +variable (embedding : MeetEmbeddingCode P Q rP rQ μP μQ f) + +noncomputable def smallValue (x : SetMembers P) : SetMembers Q := + (SetMembers.presentation P).decodeFunction (SetMembers.presentation Q) f + embedding.injection.function x + +theorem smallValue_entry (x : SetMembers P) : + ZFSet.pair (SetMembers.raw x) (SetMembers.raw (embedding.smallValue x)) ∈ f := + (SetMembers.presentation P).decodeFunction_mem (SetMembers.presentation Q) f + embedding.injection.function x + +theorem smallValue_eq_iff (x : SetMembers P) (y : SetMembers Q) : + embedding.smallValue x = y ↔ ZFSet.pair (SetMembers.raw x) (SetMembers.raw y) ∈ f := + (SetMembers.presentation P).decodeFunction_iff (SetMembers.presentation Q) f + embedding.injection.function x y + +noncomputable def toSmallMeetEmbedding (source : MeetOrderCode P rP μP) + (target : MeetOrderCode Q rQ μQ) : + MeetEmbedding source.toSmallMeetOrder target.toSmallMeetOrder where + toFun := embedding.smallValue + le_iff x y := embedding.order_iff source target + (embedding.smallValue_entry x) (embedding.smallValue_entry y) + map_meet x y := by + symm + apply (target.smallMeet_eq_iff _ _ _).2 + exact embedding.map_meet _ _ _ _ _ _ (source.smallMeet_entry x y) + (embedding.smallValue_entry x) (embedding.smallValue_entry y) + (embedding.smallValue_entry (source.smallMeet x y)) + +end MeetEmbeddingCode + +noncomputable def smallCompressionTileIso {P r μ f : ZFSet.{u}} + (meet : MeetOrderCode P r μ) (embedding : MeetEmbeddingCode P P r r μ μ f) + (K : SetMembers P) + (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ + z ∈ P ∧ ZFSet.pair z (SetMembers.raw K) ∈ r) : + MeetIso meet.toSmallMeetOrder (Attachment.idealOrder meet.toSmallMeetOrder K) := by + apply isoOntoIdeal meet.toSmallMeetOrder (embedding.toSmallMeetEmbedding meet meet) K + · intro x + exact ((range _).1 ⟨SetMembers.raw x, SetMembers.raw_mem x, embedding.smallValue_entry x⟩).2 + · intro z hz + obtain ⟨x, hx, entry⟩ := (range (SetMembers.raw z)).2 ⟨SetMembers.raw_mem z, hz⟩ + refine ⟨SetMembers.ofMem x hx, (embedding.smallValue_eq_iff _ z).2 ?_⟩ + simpa only [SetMembers.raw_ofMem] using entry + +theorem smallCompressionTileIso_entry {P r μ f : ZFSet.{u}} + (meet : MeetOrderCode P r μ) (embedding : MeetEmbeddingCode P P r r μ μ f) + (K : SetMembers P) + (range : ∀ z, (∃ x ∈ P, ZFSet.pair x z ∈ f) ↔ + z ∈ P ∧ ZFSet.pair z (SetMembers.raw K) ∈ r) (x : SetMembers P) : + ZFSet.pair (SetMembers.raw x) + (SetMembers.raw ((smallCompressionTileIso meet embedding K range).toFun x).val) ∈ f := + embedding.smallValue_entry x + +variable {P G r μ A m inv one c b d g h : ZFSet.{u}} + +noncomputable def ExternalRectangleCode.toSmallActionRectangle + (code : ExternalRectangleCode P G r μ A c b d g h) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + ActionRectangle meet.toSmallMeetOrder (action.toSmallMeetIso group meet) := by + obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code + let w := Classical.choose witness + have mw := (Classical.choose_spec witness).2.1 + have agree := (Classical.choose_spec witness).2.2.1 + have separated := (Classical.choose_spec witness).2.2.2 + let C := SetMembers.ofMem c hc + let B := SetMembers.ofMem b hb + let D := SetMembers.ofMem d hd + let first := SetMembers.ofMem g hg + let second := SetMembers.ofMem h hh + have meetValue : SetMembers.raw (meet.smallMeet C B) = w := by + apply (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique + (meet.smallMeet_entry C B) + simpa only [C, B, SetMembers.raw_ofMem] using mw + refine { + C := C + B := B + D := D + first := first + second := second + C_le_D := ?_ + B_le_D := ?_ + agree := ?_ + separated := ?_ } + · simpa only [MeetOrderCode.toSmallMeetOrder, C, D, SetMembers.raw_ofMem] using cd + · simpa only [MeetOrderCode.toSmallMeetOrder, B, D, SetMembers.raw_ofMem] using bd + · intro x lower + apply SetMembers.raw_injective P + have lowerW : ZFSet.pair (SetMembers.raw x) w ∈ r := meetValue ▸ lower + apply agree.entry_eq action hh (SetMembers.raw_mem x) lowerW + · simpa only [first, SetMembers.raw_ofMem, PosetActionCode.toSmallMeetIso] using action.act_mem first x + · simpa only [second, SetMembers.raw_ofMem, PosetActionCode.toSmallMeetIso] using action.act_mem second x + · apply SetMembers.raw_injective P + let y := action.act first D + let z := action.act second D + let v := action.act first (meet.smallMeet C B) + have actMeet : ZFSet.pair (ZFSet.pair g w) (SetMembers.raw v) ∈ A := by + rw [← meetValue] + simpa only [first, SetMembers.raw_ofMem] using action.act_mem first (meet.smallMeet C B) + have value := separated (SetMembers.raw y) (SetMembers.raw_mem y) + (SetMembers.raw z) (SetMembers.raw_mem z) (SetMembers.raw v) (SetMembers.raw_mem v) + ⟨by simpa only [first, D, SetMembers.raw_ofMem] using action.act_mem first D, + by simpa only [second, D, SetMembers.raw_ofMem] using action.act_mem second D, actMeet⟩ + exact (show FunctionGraphOn (ZFSet.prod P P) μ from ⟨P, meet.operation⟩).unique + (meet.smallMeet_entry y z) value + +theorem ExternalRectangleCode.toSmallActionRectangle_fields + (code : ExternalRectangleCode P G r μ A c b d g h) + (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A) + (meet : MeetOrderCode P r μ) : + let request := code.toSmallActionRectangle group action meet + SetMembers.raw request.C = c ∧ SetMembers.raw request.B = b ∧ + SetMembers.raw request.D = d ∧ SetMembers.raw request.first = g ∧ SetMembers.raw request.second = h := by + obtain ⟨hc, hb, hd, hg, hh, cd, bd, witness⟩ := code + exact ⟨SetMembers.raw_ofMem _ _, SetMembers.raw_ofMem _ _, SetMembers.raw_ofMem _ _, + SetMembers.raw_ofMem _ _, SetMembers.raw_ofMem _ _⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +open SetRealization Compression.RecursiveMaps +universe u +variable {P L r μ v ν f : ZFSet.{u}} + +noncomputable def MeetEmbeddingCode.smallIdealEmbedding + (embedding : MeetEmbeddingCode P L r v μ ν f) + (source : MeetOrderCode P r μ) (target : MeetOrderCode L v ν) + (ideal : ∀ x y z, ZFSet.pair x y ∈ f → z ∈ L → ZFSet.pair z y ∈ v → + ∃ a ∈ P, ZFSet.pair a z ∈ f) : + IdealEmbedding source.toSmallMeetOrder target.toSmallMeetOrder where + toMeetEmbedding := embedding.toSmallMeetEmbedding source target + ideal a z lower := by + obtain ⟨x, hx, entry⟩ := ideal _ _ _ (embedding.smallValue_entry a) (SetMembers.raw_mem z) lower + refine ⟨SetMembers.ofMem x hx, (embedding.smallValue_eq_iff _ z).2 ?_⟩ + simpa only [SetMembers.raw_ofMem] using entry + +theorem MeetEmbeddingCode.smallValue_graph (embedding : MeetEmbeddingCode P L r v μ ν f) : + (SetMembers.presentation P).graph (SetMembers.presentation L) embedding.smallValue = f := + (SetMembers.presentation P).graph_decodeFunction (SetMembers.presentation L) f embedding.injection.function + +noncomputable def binaryTileOfCodes {first second : ZFSet.{u}} + (source : MeetOrderCode P r μ) (target : MeetOrderCode L v ν) + (left : MeetEmbeddingCode P L r v μ ν first) (right : MeetEmbeddingCode P L r v μ ν second) + (leftIdeal : ∀ x y z, ZFSet.pair x y ∈ first → z ∈ L → ZFSet.pair z y ∈ v → + ∃ a ∈ P, ZFSet.pair a z ∈ first) + (rightIdeal : ∀ x y z, ZFSet.pair x y ∈ second → z ∈ L → ZFSet.pair z y ∈ v → + ∃ a ∈ P, ZFSet.pair a z ∈ second) + (cover : ∀ z ∈ L, (∃ x ∈ P, ZFSet.pair x z ∈ first) ∨ ∃ x ∈ P, ZFSet.pair x z ∈ second) : + TileRequests.Tile source.toSmallMeetOrder (ULift.{u} Unit) where + Space := SetMembers L + order := target.toSmallMeetOrder + root := left.smallIdealEmbedding source target leftIdeal + child _ := right.smallIdealEmbedding source target rightIdeal + cover z := by + rcases cover (SetMembers.raw z) (SetMembers.raw_mem z) with ⟨x, hx, entry⟩ | ⟨x, hx, entry⟩ + · refine Or.inl ⟨SetMembers.ofMem x hx, (left.smallValue_eq_iff _ z).2 ?_⟩ + simpa only [SetMembers.raw_ofMem] using entry + · refine Or.inr ⟨⟨()⟩, SetMembers.ofMem x hx, (right.smallValue_eq_iff _ z).2 ?_⟩ + simpa only [SetMembers.raw_ofMem] using entry + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageOneDataBoundLaws.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageOneDataBoundLaws.lean index 54e50ed9fcb7b229ca74dae0ec687f8febb550cf..b585ebc564faec464827b084681477be1be46bd8 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageOneDataBoundLaws.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageOneDataBoundLaws.lean @@ -1,353 +1,353 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.RowPositionBounds - -namespace OAI - -namespace PartitionPilot.Forcing - -section -universe u - -noncomputable def stageOneAssignment (t u w : ZFSet.{u}) : ZFSet.{u} := - ZFSet.pair t (ZFSet.pair u w) - -noncomputable def stageOneAssignments (I T : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod I (ZFSet.prod T T) - -theorem stageOneAssignment_eq_iff (t u w t' u' w' : ZFSet.{u}) : - stageOneAssignment t u w = stageOneAssignment t' u' w' ↔ - t = t' ∧ u = u' ∧ w = w' := by - simp only [stageOneAssignment, ZFSet.pair_inj] - -theorem stageOneAssignment_mem_assignments (I T t u w : ZFSet.{u}) : - stageOneAssignment t u w ∈ stageOneAssignments I T ↔ - t ∈ I ∧ u ∈ T ∧ w ∈ T := by - simp only [stageOneAssignment, stageOneAssignments, ZFSet.pair_mem_prod] - -theorem mem_stageOneAssignments (I T z : ZFSet.{u}) : - z ∈ stageOneAssignments I T ↔ - ∃ t ∈ I, ∃ u ∈ T, ∃ w ∈ T, z = stageOneAssignment t u w := by - constructor - · intro member - obtain ⟨t, ht, rest, hr, rfl⟩ := ZFSet.mem_prod.1 member - obtain ⟨u, hu, w, hw, rfl⟩ := ZFSet.mem_prod.1 hr - exact ⟨t, ht, u, hu, w, hw, rfl⟩ - · rintro ⟨t, ht, u, hu, w, hw, rfl⟩ - exact (stageOneAssignment_mem_assignments I T t u w).2 ⟨ht, hu, hw⟩ - -noncomputable def stageOneAssignmentLevels (I T : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod (stageOneAssignments I T) {∅} - -theorem pair_mem_stageOneAssignmentLevels (I T z level : ZFSet.{u}) : - ZFSet.pair z level ∈ stageOneAssignmentLevels I T ↔ - z ∈ stageOneAssignments I T ∧ level = ∅ := by - simp only [stageOneAssignmentLevels, ZFSet.pair_mem_prod, ZFSet.mem_singleton] - -theorem stageOneAssignmentLevels_function (I T : ZFSet.{u}) : - ZFSet.IsFunc (stageOneAssignments I T) {∅} (stageOneAssignmentLevels I T) := by - refine ⟨fun _ hz => hz, ?_⟩ - intro z hz - exact ⟨∅, (pair_mem_stageOneAssignmentLevels I T z ∅).2 ⟨hz, rfl⟩, - fun level entry => ((pair_mem_stageOneAssignmentLevels I T z level).1 entry).2⟩ - -theorem stageOneAssignmentCut_zero (I T A : ZFSet.{u}) : - assignmentCut (stageOneAssignmentLevels I T) (natSetCode 0) A = ∅ := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut, natSetCode_zero] - constructor - · rintro ⟨_, xi, hxi, _⟩ - exact False.elim (ZFSet.notMem_empty xi hxi) - · intro hz - exact False.elim (ZFSet.notMem_empty z hz) - -theorem stageOneAssignmentCut_one (I T : ZFSet.{u}) {A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments I T) : - assignmentCut (stageOneAssignmentLevels I T) (natSetCode 1) A = A := by - apply assignmentCut_eq_of_lower - intro z hz - exact ⟨∅, ZFSet.mem_insert ∅ ∅, - (pair_mem_stageOneAssignmentLevels I T z ∅).2 ⟨subset hz, rfl⟩⟩ - -namespace BoundedFormula - -def stageOneAssignmentFormula {n : Nat} (z t u w : Fin n) : BoundedFormula n := - nonemptyTupleFormula 2 z ![t, u, w] - -theorem truth_stageOneAssignmentFormula {n : Nat} (z t u w : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (stageOneAssignmentFormula z t u w) env ↔ - env z = stageOneAssignment (env t) (env u) (env w) := - truth_nonemptyTupleFormula 2 z ![t, u, w] env - -end BoundedFormula - -end - -namespace TransitiveGround - -open SetFormula -universe u -variable (M : TransitiveGround.{u}) - -noncomputable def groundSmallSubsets (B N : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun D => M.groundEmbeddable D N) (M.groundPower B) - -theorem mem_groundSmallSubsets (B N D : ZFSet.{u}) : - D ∈ M.groundSmallSubsets B N ↔ D ∈ M.sets ∧ D ⊆ B ∧ M.groundEmbeddable D N := by - rw [groundSmallSubsets, ZFSet.mem_sep, M.mem_groundPower] - exact and_assoc - -theorem groundSmallSubsets_mem (powers : Realize M.sets powerSet Fin.elim0) - (separation : SeparationSchema M.sets) - {B N : ZFSet.{u}} (hB : B ∈ M.sets) (hN : N ∈ M.sets) : - M.groundSmallSubsets B N ∈ M.sets := by - have hW := M.groundPower_mem powers hB - have selected := M.separation_mem separation (hasInjectionFormula 0 1) - (extend N Fin.elim0) (Fin.cases hN (fun i => Fin.elim0 i)) hW - have eq : ZFSet.sep (fun D => Realize M.sets (hasInjectionFormula 0 1) - (extend D (extend N Fin.elim0))) (M.groundPower B) = M.groundSmallSubsets B N := by - apply ZFSet.ext - intro D - rw [ZFSet.mem_sep, groundSmallSubsets, ZFSet.mem_sep] - apply and_congr_right - intro hD - exact M.realize_hasInjectionFormula 0 1 _ - (Fin.cases (M.transitive hW hD) (Fin.cases hN (fun i => Fin.elim0 i))) - exact eq ▸ selected - -theorem stageOneAssignment_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - {t u w : ZFSet.{u}} (ht : t ∈ M.sets) (hu : u ∈ M.sets) (hw : w ∈ M.sets) : - stageOneAssignment t u w ∈ M.sets := - M.orderedPair_mem pairing ht (M.orderedPair_mem pairing hu hw) - -theorem stageOneAssignment_fields_mem {t u w : ZFSet.{u}} - (ground : stageOneAssignment t u w ∈ M.sets) : - t ∈ M.sets ∧ u ∈ M.sets ∧ w ∈ M.sets := - ⟨M.pair_left ground, M.pair_left (M.pair_right ground), M.pair_right (M.pair_right ground)⟩ - -theorem stageOneAssignments_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I T : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) : - stageOneAssignments I T ∈ M.sets := - M.prod_mem pairing unions powers separation hI (M.prod_mem pairing unions powers separation hT hT) - -theorem stageOneAssignmentLevels_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {I T : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) : - stageOneAssignmentLevels I T ∈ M.sets := by - have hz := M.empty_mem ⟨I, hI⟩ - have one : ({∅} : ZFSet.{u}) ∈ M.sets := by - simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hz hz - exact M.prod_mem pairing unions powers separation - (M.stageOneAssignments_mem pairing unions powers separation hI hT) one - -noncomputable def stageOneCandidateBound (rawRowCarrier I T : ZFSet.{u}) : ZFSet.{u} := - ZFSet.prod rawRowCarrier (M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega) - -theorem pair_mem_stageOneCandidateBound (rawRowCarrier I T p A : ZFSet.{u}) : - ZFSet.pair p A ∈ M.stageOneCandidateBound rawRowCarrier I T ↔ - p ∈ rawRowCarrier ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I T ∧ - M.groundEmbeddable A ZFSet.omega := by - rw [stageOneCandidateBound, ZFSet.pair_mem_prod, M.mem_groundSmallSubsets] - -theorem mem_stageOneCandidateBound (rawRowCarrier I T z : ZFSet.{u}) : - z ∈ M.stageOneCandidateBound rawRowCarrier I T ↔ - ∃ p ∈ rawRowCarrier, ∃ A ∈ M.sets, A ⊆ stageOneAssignments I T ∧ - M.groundEmbeddable A ZFSet.omega ∧ z = ZFSet.pair p A := by - constructor - · intro member - obtain ⟨p, hp, A, hA, equal⟩ := ZFSet.mem_prod.1 member - obtain ⟨ground, subset, small⟩ := (M.mem_groundSmallSubsets (stageOneAssignments I T) ZFSet.omega A).1 hA - exact ⟨p, hp, A, ground, subset, small, equal⟩ - · rintro ⟨p, hp, A, ground, subset, small, rfl⟩ - exact (M.pair_mem_stageOneCandidateBound rawRowCarrier I T p A).2 ⟨hp, ground, subset, small⟩ - -theorem stageOneCandidateBound_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {rawRowCarrier I T : ZFSet.{u}} (hRow : rawRowCarrier ∈ M.sets) - (hI : I ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - M.stageOneCandidateBound rawRowCarrier I T ∈ M.sets := - M.prod_mem pairing unions powers separation hRow (M.groundSmallSubsets_mem powers separation - (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega) - -theorem stageOneCandidateBound_empty {rawRowCarrier I T p : ZFSet.{u}} - (hRow : rawRowCarrier ∈ M.sets) (hp : p ∈ rawRowCarrier) : - ZFSet.pair p ∅ ∈ M.stageOneCandidateBound rawRowCarrier I T := - (M.pair_mem_stageOneCandidateBound rawRowCarrier I T p ∅).2 - ⟨hp, M.empty_mem ⟨rawRowCarrier, hRow⟩, - fun z hz => False.elim (ZFSet.notMem_empty z hz), - M.empty_groundEmbeddable ZFSet.omega ⟨rawRowCarrier, hRow⟩⟩ - -end TransitiveGround - -section -open SetRealization SetFormula -universe u - -noncomputable def stageOneDataBounds (A I T S L mu X r anchors tuples : ZFSet.{u}) : ZFSet.{u} := - ZFSet.sep (fun z => ∃ v ∈ A, ∃ D ∈ L, ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, ∃ E ∈ L, - ∃ fu ∈ S, ∃ fw ∈ S, z = ZFSet.pair v D ∧ v = stageOneAssignment i u w ∧ - ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ - ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ - RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D) - (ZFSet.prod A L) - -theorem mem_stageOneDataBounds (A I T S L mu X r anchors tuples z : ZFSet.{u}) : - z ∈ stageOneDataBounds A I T S L mu X r anchors tuples ↔ - ∃ v ∈ A, ∃ D ∈ L, ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, ∃ E ∈ L, - ∃ fu ∈ S, ∃ fw ∈ S, z = ZFSet.pair v D ∧ v = stageOneAssignment i u w ∧ - ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ - ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ - RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D := by - rw [stageOneDataBounds, ZFSet.mem_sep] - constructor - · exact And.right - · rintro ⟨v,hv,D,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ - exact ⟨equal.symm ▸ ZFSet.pair_mem_prod.2 ⟨hv,hD⟩, - v,hv,D,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ - -theorem pair_mem_stageOneDataBounds (A I T S L mu X r anchors tuples v D : ZFSet.{u}) : - ZFSet.pair v D ∈ stageOneDataBounds A I T S L mu X r anchors tuples ↔ - v ∈ A ∧ D ∈ L ∧ ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, ∃ E ∈ L, ∃ fu ∈ S, ∃ fw ∈ S, - v = stageOneAssignment i u w ∧ ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ - ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ - RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D := by - rw [mem_stageOneDataBounds] - constructor - · rintro ⟨v',hv,D',hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ - obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective equal - exact ⟨hv,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rest⟩ - · rintro ⟨hv,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rest⟩ - exact ⟨v,hv,D,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rfl,rest⟩ - -namespace BoundedFormula - -def stageOneDataBoundEntryFormula {n} (z A I T S L mu X r anchors tuples : Fin n) : BoundedFormula n := - let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ.succ.succ - exMem A (exMem L.succ (exMem I.succ.succ (exMem T.succ.succ.succ - (exMem T.succ.succ.succ.succ (exMem L.succ.succ.succ.succ.succ - (exMem S.succ.succ.succ.succ.succ.succ (exMem S.succ.succ.succ.succ.succ.succ.succ - (.conj (orderedPairFormula (lift z) 7 6) - (.conj (stageOneAssignmentFormula 7 5 4 3) - (.conj (pairMembershipFormula 5 2 (lift anchors)) - (.conj (pairMembershipFormula 2 6 (lift r)) - (.conj (pairMembershipFormula 1 4 (lift tuples)) - (.conj (pairMembershipFormula 0 3 (lift tuples)) - (.conj (rowPositionBoundFormula (lift mu) (lift X) (lift r) 1 6) - (rowPositionBoundFormula (lift mu) (lift X) (lift r) 0 6))))))))))))))) - -theorem truth_stageOneDataBoundEntryFormula {n} (z A I T S L mu X r anchors tuples : Fin n) - (env : Fin n → ZFSet.{u}) : - Truth (stageOneDataBoundEntryFormula z A I T S L mu X r anchors tuples) env ↔ - ∃ v ∈ env A, ∃ D ∈ env L, ∃ i ∈ env I, ∃ u ∈ env T, ∃ w ∈ env T, ∃ E ∈ env L, - ∃ fu ∈ env S, ∃ fw ∈ env S, env z = ZFSet.pair v D ∧ v = stageOneAssignment i u w ∧ - ZFSet.pair i E ∈ env anchors ∧ ZFSet.pair E D ∈ env r ∧ - ZFSet.pair fu u ∈ env tuples ∧ ZFSet.pair fw w ∈ env tuples ∧ - RowPositionBound (env mu) (env X) (env r) fu D ∧ - RowPositionBound (env mu) (env X) (env r) fw D := by - simp only [stageOneDataBoundEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, - truth_stageOneAssignmentFormula, truth_pairMembershipFormula, truth_rowPositionBoundFormula] - rfl - -end BoundedFormula - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) - -theorem stageOneDataBounds_mem - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - {A I T S L mu X r anchors tuples : ZFSet.{u}} - (hA : A ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hS : S ∈ M.sets) - (hL : L ∈ M.sets) (hmu : mu ∈ M.sets) (hX : X ∈ M.sets) (hr : r ∈ M.sets) - (hAnchors : anchors ∈ M.sets) (hTuples : tuples ∈ M.sets) : - stageOneDataBounds A I T S L mu X r anchors tuples ∈ M.sets := by - let params : Fin 10 → ZFSet.{u} := ![A,I,T,S,L,mu,X,r,anchors,tuples] - have members : ∀ j, params j ∈ M.sets := Fin.cases hA (Fin.cases hI (Fin.cases hT - (Fin.cases hS (Fin.cases hL (Fin.cases hmu (Fin.cases hX (Fin.cases hr - (Fin.cases hAnchors (Fin.cases hTuples (fun j => Fin.elim0 j)))))))))) - have selected := M.bounded_separation_mem separation - (BoundedFormula.stageOneDataBoundEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params members - (M.prod_mem pairing unions powers separation hA hL) - have equal : ZFSet.sep (fun z => BoundedFormula.Truth - (BoundedFormula.stageOneDataBoundEntryFormula 0 1 2 3 4 5 6 7 8 9 10) (extend z params)) - (ZFSet.prod A L) = stageOneDataBounds A I T S L mu X r anchors tuples := by - apply ZFSet.ext - intro z - rw [ZFSet.mem_sep, stageOneDataBounds, ZFSet.mem_sep, - BoundedFormula.truth_stageOneDataBoundEntryFormula] - rfl - exact equal ▸ selected - -end TransitiveGround - -end - -open SetRealization -universe u - -theorem stageOneDataBounds_assignment_entry (A I T S L mu X r anchors tuples i u w D : ZFSet.{u}) : - ZFSet.pair (stageOneAssignment i u w) D ∈ stageOneDataBounds A I T S L mu X r anchors tuples ↔ - stageOneAssignment i u w ∈ A ∧ D ∈ L ∧ i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ - ∃ E ∈ L, ∃ fu ∈ S, ∃ fw ∈ S, - ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ - ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ - RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D := by - rw [pair_mem_stageOneDataBounds] - constructor - · rintro ⟨member,hD,i',hi,u',hu,w',hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ - obtain ⟨rfl,rfl,rfl⟩ := (stageOneAssignment_eq_iff i u w i' u' w').1 equal - exact ⟨member,hD,hi,hu,hw,E,hE,fu,hfu,fw,hfw,rest⟩ - · rintro ⟨member,hD,hi,hu,hw,E,hE,fu,hfu,fw,hfw,rest⟩ - exact ⟨member,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rfl,rest⟩ - -theorem stageOneDataBounds_mono {L : Type u} [Preorder L] (b : Presentation L) - {A I T S mu X anchors tuples v : ZFSet.{u}} {D E : L} - (member : ZFSet.pair v (b.encode D) ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) (le : D ≤ E) : - ZFSet.pair v (b.encode E) ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples := by - obtain ⟨hv,_,i,hi,u,hu,w,hw,anchor,hAnchor,fu,hfu,fw,hfw,equal,edge,below,tupleU,tupleW,boundU,boundW⟩ := - (pair_mem_stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples v (b.encode D)).1 member - obtain ⟨anchor,rfl⟩ := (b.mem_carrier anchor).1 hAnchor - exact (pair_mem_stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples v (b.encode E)).2 - ⟨hv,b.encode_mem E,i,hi,u,hu,w,hw,b.encode anchor,b.encode_mem anchor,fu,hfu,fw,hfw,equal,edge, - (b.pair_mem_conditionOrder anchor E).2 (le_trans ((b.pair_mem_conditionOrder anchor D).1 below) le), - tupleU,tupleW,boundU.mono b le,boundW.mono b le⟩ - -theorem stageOneDataBounds_total {L : Type u} [Preorder L] (b : Presentation L) - (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - {A I T S mu X anchors tuples : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments I T) (anchorFunction : ZFSet.IsFunc I b.carrier anchors) - (provenance : ∀ u ∈ T, ∃ f ∈ S, ZFSet.pair f u ∈ tuples) - (positionBounds : ∀ f ∈ S, ∃ D : L, RowPositionBound mu X b.conditionOrder f (b.encode D)) : - ∀ v ∈ A, ∃ D ∈ b.carrier, ZFSet.pair v D ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples := by - intro v hv - obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I T v).1 (subset hv) - obtain ⟨anchor,edge,_⟩ := anchorFunction.2 i hi - have hAnchor := (ZFSet.pair_mem_prod.1 (anchorFunction.1 edge)).2 - obtain ⟨anchor,rfl⟩ := (b.mem_carrier anchor).1 hAnchor - obtain ⟨fu,hfu,tupleU⟩ := provenance u hu - obtain ⟨fw,hfw,tupleW⟩ := provenance w hw - obtain ⟨Du,boundU⟩ := positionBounds fu hfu - obtain ⟨Dw,boundW⟩ := positionBounds fw hfw - obtain ⟨middle,anchorBelow,uBelow⟩ := directed anchor Du - obtain ⟨D,middleBelow,wBelow⟩ := directed middle Dw - refine ⟨b.encode D,b.encode_mem D,?_⟩ - exact (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder anchors tuples - i u w (b.encode D)).2 - ⟨hv,b.encode_mem D,hi,hu,hw,b.encode anchor,b.encode_mem anchor,fu,hfu,fw,hfw,edge, - (b.pair_mem_conditionOrder anchor D).2 (le_trans anchorBelow middleBelow),tupleU,tupleW, - boundU.mono b (le_trans uBelow middleBelow),boundW.mono b wBelow⟩ - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.RowPositionBounds + +namespace OAI + +namespace PartitionPilot.Forcing + +section +universe u + +noncomputable def stageOneAssignment (t u w : ZFSet.{u}) : ZFSet.{u} := + ZFSet.pair t (ZFSet.pair u w) + +noncomputable def stageOneAssignments (I T : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod I (ZFSet.prod T T) + +theorem stageOneAssignment_eq_iff (t u w t' u' w' : ZFSet.{u}) : + stageOneAssignment t u w = stageOneAssignment t' u' w' ↔ + t = t' ∧ u = u' ∧ w = w' := by + simp only [stageOneAssignment, ZFSet.pair_inj] + +theorem stageOneAssignment_mem_assignments (I T t u w : ZFSet.{u}) : + stageOneAssignment t u w ∈ stageOneAssignments I T ↔ + t ∈ I ∧ u ∈ T ∧ w ∈ T := by + simp only [stageOneAssignment, stageOneAssignments, ZFSet.pair_mem_prod] + +theorem mem_stageOneAssignments (I T z : ZFSet.{u}) : + z ∈ stageOneAssignments I T ↔ + ∃ t ∈ I, ∃ u ∈ T, ∃ w ∈ T, z = stageOneAssignment t u w := by + constructor + · intro member + obtain ⟨t, ht, rest, hr, rfl⟩ := ZFSet.mem_prod.1 member + obtain ⟨u, hu, w, hw, rfl⟩ := ZFSet.mem_prod.1 hr + exact ⟨t, ht, u, hu, w, hw, rfl⟩ + · rintro ⟨t, ht, u, hu, w, hw, rfl⟩ + exact (stageOneAssignment_mem_assignments I T t u w).2 ⟨ht, hu, hw⟩ + +noncomputable def stageOneAssignmentLevels (I T : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod (stageOneAssignments I T) {∅} + +theorem pair_mem_stageOneAssignmentLevels (I T z level : ZFSet.{u}) : + ZFSet.pair z level ∈ stageOneAssignmentLevels I T ↔ + z ∈ stageOneAssignments I T ∧ level = ∅ := by + simp only [stageOneAssignmentLevels, ZFSet.pair_mem_prod, ZFSet.mem_singleton] + +theorem stageOneAssignmentLevels_function (I T : ZFSet.{u}) : + ZFSet.IsFunc (stageOneAssignments I T) {∅} (stageOneAssignmentLevels I T) := by + refine ⟨fun _ hz => hz, ?_⟩ + intro z hz + exact ⟨∅, (pair_mem_stageOneAssignmentLevels I T z ∅).2 ⟨hz, rfl⟩, + fun level entry => ((pair_mem_stageOneAssignmentLevels I T z level).1 entry).2⟩ + +theorem stageOneAssignmentCut_zero (I T A : ZFSet.{u}) : + assignmentCut (stageOneAssignmentLevels I T) (natSetCode 0) A = ∅ := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut, natSetCode_zero] + constructor + · rintro ⟨_, xi, hxi, _⟩ + exact False.elim (ZFSet.notMem_empty xi hxi) + · intro hz + exact False.elim (ZFSet.notMem_empty z hz) + +theorem stageOneAssignmentCut_one (I T : ZFSet.{u}) {A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments I T) : + assignmentCut (stageOneAssignmentLevels I T) (natSetCode 1) A = A := by + apply assignmentCut_eq_of_lower + intro z hz + exact ⟨∅, ZFSet.mem_insert ∅ ∅, + (pair_mem_stageOneAssignmentLevels I T z ∅).2 ⟨subset hz, rfl⟩⟩ + +namespace BoundedFormula + +def stageOneAssignmentFormula {n : Nat} (z t u w : Fin n) : BoundedFormula n := + nonemptyTupleFormula 2 z ![t, u, w] + +theorem truth_stageOneAssignmentFormula {n : Nat} (z t u w : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (stageOneAssignmentFormula z t u w) env ↔ + env z = stageOneAssignment (env t) (env u) (env w) := + truth_nonemptyTupleFormula 2 z ![t, u, w] env + +end BoundedFormula + +end + +namespace TransitiveGround + +open SetFormula +universe u +variable (M : TransitiveGround.{u}) + +noncomputable def groundSmallSubsets (B N : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun D => M.groundEmbeddable D N) (M.groundPower B) + +theorem mem_groundSmallSubsets (B N D : ZFSet.{u}) : + D ∈ M.groundSmallSubsets B N ↔ D ∈ M.sets ∧ D ⊆ B ∧ M.groundEmbeddable D N := by + rw [groundSmallSubsets, ZFSet.mem_sep, M.mem_groundPower] + exact and_assoc + +theorem groundSmallSubsets_mem (powers : Realize M.sets powerSet Fin.elim0) + (separation : SeparationSchema M.sets) + {B N : ZFSet.{u}} (hB : B ∈ M.sets) (hN : N ∈ M.sets) : + M.groundSmallSubsets B N ∈ M.sets := by + have hW := M.groundPower_mem powers hB + have selected := M.separation_mem separation (hasInjectionFormula 0 1) + (extend N Fin.elim0) (Fin.cases hN (fun i => Fin.elim0 i)) hW + have eq : ZFSet.sep (fun D => Realize M.sets (hasInjectionFormula 0 1) + (extend D (extend N Fin.elim0))) (M.groundPower B) = M.groundSmallSubsets B N := by + apply ZFSet.ext + intro D + rw [ZFSet.mem_sep, groundSmallSubsets, ZFSet.mem_sep] + apply and_congr_right + intro hD + exact M.realize_hasInjectionFormula 0 1 _ + (Fin.cases (M.transitive hW hD) (Fin.cases hN (fun i => Fin.elim0 i))) + exact eq ▸ selected + +theorem stageOneAssignment_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + {t u w : ZFSet.{u}} (ht : t ∈ M.sets) (hu : u ∈ M.sets) (hw : w ∈ M.sets) : + stageOneAssignment t u w ∈ M.sets := + M.orderedPair_mem pairing ht (M.orderedPair_mem pairing hu hw) + +theorem stageOneAssignment_fields_mem {t u w : ZFSet.{u}} + (ground : stageOneAssignment t u w ∈ M.sets) : + t ∈ M.sets ∧ u ∈ M.sets ∧ w ∈ M.sets := + ⟨M.pair_left ground, M.pair_left (M.pair_right ground), M.pair_right (M.pair_right ground)⟩ + +theorem stageOneAssignments_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I T : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) : + stageOneAssignments I T ∈ M.sets := + M.prod_mem pairing unions powers separation hI (M.prod_mem pairing unions powers separation hT hT) + +theorem stageOneAssignmentLevels_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {I T : ZFSet.{u}} (hI : I ∈ M.sets) (hT : T ∈ M.sets) : + stageOneAssignmentLevels I T ∈ M.sets := by + have hz := M.empty_mem ⟨I, hI⟩ + have one : ({∅} : ZFSet.{u}) ∈ M.sets := by + simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hz hz + exact M.prod_mem pairing unions powers separation + (M.stageOneAssignments_mem pairing unions powers separation hI hT) one + +noncomputable def stageOneCandidateBound (rawRowCarrier I T : ZFSet.{u}) : ZFSet.{u} := + ZFSet.prod rawRowCarrier (M.groundSmallSubsets (stageOneAssignments I T) ZFSet.omega) + +theorem pair_mem_stageOneCandidateBound (rawRowCarrier I T p A : ZFSet.{u}) : + ZFSet.pair p A ∈ M.stageOneCandidateBound rawRowCarrier I T ↔ + p ∈ rawRowCarrier ∧ A ∈ M.sets ∧ A ⊆ stageOneAssignments I T ∧ + M.groundEmbeddable A ZFSet.omega := by + rw [stageOneCandidateBound, ZFSet.pair_mem_prod, M.mem_groundSmallSubsets] + +theorem mem_stageOneCandidateBound (rawRowCarrier I T z : ZFSet.{u}) : + z ∈ M.stageOneCandidateBound rawRowCarrier I T ↔ + ∃ p ∈ rawRowCarrier, ∃ A ∈ M.sets, A ⊆ stageOneAssignments I T ∧ + M.groundEmbeddable A ZFSet.omega ∧ z = ZFSet.pair p A := by + constructor + · intro member + obtain ⟨p, hp, A, hA, equal⟩ := ZFSet.mem_prod.1 member + obtain ⟨ground, subset, small⟩ := (M.mem_groundSmallSubsets (stageOneAssignments I T) ZFSet.omega A).1 hA + exact ⟨p, hp, A, ground, subset, small, equal⟩ + · rintro ⟨p, hp, A, ground, subset, small, rfl⟩ + exact (M.pair_mem_stageOneCandidateBound rawRowCarrier I T p A).2 ⟨hp, ground, subset, small⟩ + +theorem stageOneCandidateBound_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {rawRowCarrier I T : ZFSet.{u}} (hRow : rawRowCarrier ∈ M.sets) + (hI : I ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + M.stageOneCandidateBound rawRowCarrier I T ∈ M.sets := + M.prod_mem pairing unions powers separation hRow (M.groundSmallSubsets_mem powers separation + (M.stageOneAssignments_mem pairing unions powers separation hI hT) omega) + +theorem stageOneCandidateBound_empty {rawRowCarrier I T p : ZFSet.{u}} + (hRow : rawRowCarrier ∈ M.sets) (hp : p ∈ rawRowCarrier) : + ZFSet.pair p ∅ ∈ M.stageOneCandidateBound rawRowCarrier I T := + (M.pair_mem_stageOneCandidateBound rawRowCarrier I T p ∅).2 + ⟨hp, M.empty_mem ⟨rawRowCarrier, hRow⟩, + fun z hz => False.elim (ZFSet.notMem_empty z hz), + M.empty_groundEmbeddable ZFSet.omega ⟨rawRowCarrier, hRow⟩⟩ + +end TransitiveGround + +section +open SetRealization SetFormula +universe u + +noncomputable def stageOneDataBounds (A I T S L mu X r anchors tuples : ZFSet.{u}) : ZFSet.{u} := + ZFSet.sep (fun z => ∃ v ∈ A, ∃ D ∈ L, ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, ∃ E ∈ L, + ∃ fu ∈ S, ∃ fw ∈ S, z = ZFSet.pair v D ∧ v = stageOneAssignment i u w ∧ + ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ + ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ + RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D) + (ZFSet.prod A L) + +theorem mem_stageOneDataBounds (A I T S L mu X r anchors tuples z : ZFSet.{u}) : + z ∈ stageOneDataBounds A I T S L mu X r anchors tuples ↔ + ∃ v ∈ A, ∃ D ∈ L, ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, ∃ E ∈ L, + ∃ fu ∈ S, ∃ fw ∈ S, z = ZFSet.pair v D ∧ v = stageOneAssignment i u w ∧ + ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ + ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ + RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D := by + rw [stageOneDataBounds, ZFSet.mem_sep] + constructor + · exact And.right + · rintro ⟨v,hv,D,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ + exact ⟨equal.symm ▸ ZFSet.pair_mem_prod.2 ⟨hv,hD⟩, + v,hv,D,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ + +theorem pair_mem_stageOneDataBounds (A I T S L mu X r anchors tuples v D : ZFSet.{u}) : + ZFSet.pair v D ∈ stageOneDataBounds A I T S L mu X r anchors tuples ↔ + v ∈ A ∧ D ∈ L ∧ ∃ i ∈ I, ∃ u ∈ T, ∃ w ∈ T, ∃ E ∈ L, ∃ fu ∈ S, ∃ fw ∈ S, + v = stageOneAssignment i u w ∧ ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ + ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ + RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D := by + rw [mem_stageOneDataBounds] + constructor + · rintro ⟨v',hv,D',hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ + obtain ⟨rfl,rfl⟩ := ZFSet.pair_injective equal + exact ⟨hv,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rest⟩ + · rintro ⟨hv,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rest⟩ + exact ⟨v,hv,D,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rfl,rest⟩ + +namespace BoundedFormula + +def stageOneDataBoundEntryFormula {n} (z A I T S L mu X r anchors tuples : Fin n) : BoundedFormula n := + let lift (j : Fin n) := j.succ.succ.succ.succ.succ.succ.succ.succ + exMem A (exMem L.succ (exMem I.succ.succ (exMem T.succ.succ.succ + (exMem T.succ.succ.succ.succ (exMem L.succ.succ.succ.succ.succ + (exMem S.succ.succ.succ.succ.succ.succ (exMem S.succ.succ.succ.succ.succ.succ.succ + (.conj (orderedPairFormula (lift z) 7 6) + (.conj (stageOneAssignmentFormula 7 5 4 3) + (.conj (pairMembershipFormula 5 2 (lift anchors)) + (.conj (pairMembershipFormula 2 6 (lift r)) + (.conj (pairMembershipFormula 1 4 (lift tuples)) + (.conj (pairMembershipFormula 0 3 (lift tuples)) + (.conj (rowPositionBoundFormula (lift mu) (lift X) (lift r) 1 6) + (rowPositionBoundFormula (lift mu) (lift X) (lift r) 0 6))))))))))))))) + +theorem truth_stageOneDataBoundEntryFormula {n} (z A I T S L mu X r anchors tuples : Fin n) + (env : Fin n → ZFSet.{u}) : + Truth (stageOneDataBoundEntryFormula z A I T S L mu X r anchors tuples) env ↔ + ∃ v ∈ env A, ∃ D ∈ env L, ∃ i ∈ env I, ∃ u ∈ env T, ∃ w ∈ env T, ∃ E ∈ env L, + ∃ fu ∈ env S, ∃ fw ∈ env S, env z = ZFSet.pair v D ∧ v = stageOneAssignment i u w ∧ + ZFSet.pair i E ∈ env anchors ∧ ZFSet.pair E D ∈ env r ∧ + ZFSet.pair fu u ∈ env tuples ∧ ZFSet.pair fw w ∈ env tuples ∧ + RowPositionBound (env mu) (env X) (env r) fu D ∧ + RowPositionBound (env mu) (env X) (env r) fw D := by + simp only [stageOneDataBoundEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, + truth_stageOneAssignmentFormula, truth_pairMembershipFormula, truth_rowPositionBoundFormula] + rfl + +end BoundedFormula + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) + +theorem stageOneDataBounds_mem + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + {A I T S L mu X r anchors tuples : ZFSet.{u}} + (hA : A ∈ M.sets) (hI : I ∈ M.sets) (hT : T ∈ M.sets) (hS : S ∈ M.sets) + (hL : L ∈ M.sets) (hmu : mu ∈ M.sets) (hX : X ∈ M.sets) (hr : r ∈ M.sets) + (hAnchors : anchors ∈ M.sets) (hTuples : tuples ∈ M.sets) : + stageOneDataBounds A I T S L mu X r anchors tuples ∈ M.sets := by + let params : Fin 10 → ZFSet.{u} := ![A,I,T,S,L,mu,X,r,anchors,tuples] + have members : ∀ j, params j ∈ M.sets := Fin.cases hA (Fin.cases hI (Fin.cases hT + (Fin.cases hS (Fin.cases hL (Fin.cases hmu (Fin.cases hX (Fin.cases hr + (Fin.cases hAnchors (Fin.cases hTuples (fun j => Fin.elim0 j)))))))))) + have selected := M.bounded_separation_mem separation + (BoundedFormula.stageOneDataBoundEntryFormula 0 1 2 3 4 5 6 7 8 9 10) params members + (M.prod_mem pairing unions powers separation hA hL) + have equal : ZFSet.sep (fun z => BoundedFormula.Truth + (BoundedFormula.stageOneDataBoundEntryFormula 0 1 2 3 4 5 6 7 8 9 10) (extend z params)) + (ZFSet.prod A L) = stageOneDataBounds A I T S L mu X r anchors tuples := by + apply ZFSet.ext + intro z + rw [ZFSet.mem_sep, stageOneDataBounds, ZFSet.mem_sep, + BoundedFormula.truth_stageOneDataBoundEntryFormula] + rfl + exact equal ▸ selected + +end TransitiveGround + +end + +open SetRealization +universe u + +theorem stageOneDataBounds_assignment_entry (A I T S L mu X r anchors tuples i u w D : ZFSet.{u}) : + ZFSet.pair (stageOneAssignment i u w) D ∈ stageOneDataBounds A I T S L mu X r anchors tuples ↔ + stageOneAssignment i u w ∈ A ∧ D ∈ L ∧ i ∈ I ∧ u ∈ T ∧ w ∈ T ∧ + ∃ E ∈ L, ∃ fu ∈ S, ∃ fw ∈ S, + ZFSet.pair i E ∈ anchors ∧ ZFSet.pair E D ∈ r ∧ + ZFSet.pair fu u ∈ tuples ∧ ZFSet.pair fw w ∈ tuples ∧ + RowPositionBound mu X r fu D ∧ RowPositionBound mu X r fw D := by + rw [pair_mem_stageOneDataBounds] + constructor + · rintro ⟨member,hD,i',hi,u',hu,w',hw,E,hE,fu,hfu,fw,hfw,equal,rest⟩ + obtain ⟨rfl,rfl,rfl⟩ := (stageOneAssignment_eq_iff i u w i' u' w').1 equal + exact ⟨member,hD,hi,hu,hw,E,hE,fu,hfu,fw,hfw,rest⟩ + · rintro ⟨member,hD,hi,hu,hw,E,hE,fu,hfu,fw,hfw,rest⟩ + exact ⟨member,hD,i,hi,u,hu,w,hw,E,hE,fu,hfu,fw,hfw,rfl,rest⟩ + +theorem stageOneDataBounds_mono {L : Type u} [Preorder L] (b : Presentation L) + {A I T S mu X anchors tuples v : ZFSet.{u}} {D E : L} + (member : ZFSet.pair v (b.encode D) ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) (le : D ≤ E) : + ZFSet.pair v (b.encode E) ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples := by + obtain ⟨hv,_,i,hi,u,hu,w,hw,anchor,hAnchor,fu,hfu,fw,hfw,equal,edge,below,tupleU,tupleW,boundU,boundW⟩ := + (pair_mem_stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples v (b.encode D)).1 member + obtain ⟨anchor,rfl⟩ := (b.mem_carrier anchor).1 hAnchor + exact (pair_mem_stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples v (b.encode E)).2 + ⟨hv,b.encode_mem E,i,hi,u,hu,w,hw,b.encode anchor,b.encode_mem anchor,fu,hfu,fw,hfw,equal,edge, + (b.pair_mem_conditionOrder anchor E).2 (le_trans ((b.pair_mem_conditionOrder anchor D).1 below) le), + tupleU,tupleW,boundU.mono b le,boundW.mono b le⟩ + +theorem stageOneDataBounds_total {L : Type u} [Preorder L] (b : Presentation L) + (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + {A I T S mu X anchors tuples : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments I T) (anchorFunction : ZFSet.IsFunc I b.carrier anchors) + (provenance : ∀ u ∈ T, ∃ f ∈ S, ZFSet.pair f u ∈ tuples) + (positionBounds : ∀ f ∈ S, ∃ D : L, RowPositionBound mu X b.conditionOrder f (b.encode D)) : + ∀ v ∈ A, ∃ D ∈ b.carrier, ZFSet.pair v D ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples := by + intro v hv + obtain ⟨i,hi,u,hu,w,hw,rfl⟩ := (mem_stageOneAssignments I T v).1 (subset hv) + obtain ⟨anchor,edge,_⟩ := anchorFunction.2 i hi + have hAnchor := (ZFSet.pair_mem_prod.1 (anchorFunction.1 edge)).2 + obtain ⟨anchor,rfl⟩ := (b.mem_carrier anchor).1 hAnchor + obtain ⟨fu,hfu,tupleU⟩ := provenance u hu + obtain ⟨fw,hfw,tupleW⟩ := provenance w hw + obtain ⟨Du,boundU⟩ := positionBounds fu hfu + obtain ⟨Dw,boundW⟩ := positionBounds fw hfw + obtain ⟨middle,anchorBelow,uBelow⟩ := directed anchor Du + obtain ⟨D,middleBelow,wBelow⟩ := directed middle Dw + refine ⟨b.encode D,b.encode_mem D,?_⟩ + exact (stageOneDataBounds_assignment_entry A I T S b.carrier mu X b.conditionOrder anchors tuples + i u w (b.encode D)).2 + ⟨hv,b.encode_mem D,hi,hu,hw,b.encode anchor,b.encode_mem anchor,fu,hfu,fw,hfw,edge, + (b.pair_mem_conditionOrder anchor D).2 (le_trans anchorBelow middleBelow),tupleU,tupleW, + boundU.mono b (le_trans uBelow middleBelow),boundW.mono b wBelow⟩ + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoAssignmentSplices.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoAssignmentSplices.lean index 2e249767bc3eae8540ae79e49b82d18783b7e585..05920c15adb55da2e8e1249195630a8b1f7f6a0d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoAssignmentSplices.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoAssignmentSplices.lean @@ -1,174 +1,174 @@ -import OAI.SetTheory.PartitionPrinciple.Geometry.AssignmentIndexLevels -import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility - -namespace OAI - -section - -namespace PartitionPilot.Forcing -universe u - -noncomputable def stageTwoAssignmentLevels (I0 I1 T : ZFSet.{u}) : ZFSet.{u} := - assignmentIndexLevels (I0 ∪ I1) T {∅, natSetCode 1} - (refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0) - -theorem stageTwoAssignmentCut_zero (I0 I1 T A : ZFSet.{u}) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 0) A = ∅ := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut, natSetCode_zero] - exact ⟨fun h => False.elim (ZFSet.notMem_empty _ h.2.choose_spec.1), - fun hz => False.elim (ZFSet.notMem_empty z hz)⟩ - -variable {I0 I1 T : ZFSet.{u}} - (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) -include first second - -theorem pair_mem_stageTwoAssignmentLevels (z level : ZFSet.{u}) : - ZFSet.pair z level ∈ stageTwoAssignmentLevels I0 I1 T ↔ - (z ∈ stageOneAssignments I0 T ∧ level = ∅) ∨ - (z ∈ stageOneAssignments I1 T ∧ level = natSetCode 1) := by - rw [stageTwoAssignmentLevels, pair_mem_assignmentIndexLevels] - constructor - · rintro ⟨i, _, u, hu, w, hw, rfl, _, entry⟩ - rcases (first.union_level_entry second i level).1 entry with lower | upper - · exact Or.inl ⟨(stageOneAssignment_mem_assignments I0 T i u w).2 - ⟨lower.1, hu, hw⟩, lower.2⟩ - · exact Or.inr ⟨(stageOneAssignment_mem_assignments I1 T i u w).2 - ⟨upper.1, hu, hw⟩, upper.2⟩ - · rintro (⟨hz, rfl⟩ | ⟨hz, rfl⟩) - · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 hz - refine ⟨i, ZFSet.mem_union.2 (Or.inl hi), u, hu, w, hw, rfl, - ZFSet.mem_insert _ _, ?_⟩ - exact (first.union_level_entry second i ∅).2 (Or.inl ⟨hi, rfl⟩) - · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I1 T z).1 hz - refine ⟨i, ZFSet.mem_union.2 (Or.inr hi), u, hu, w, hw, rfl, - ZFSet.mem_insert_of_mem _ (ZFSet.mem_singleton.2 rfl), ?_⟩ - exact (first.union_level_entry second i (natSetCode 1)).2 (Or.inr ⟨hi, rfl⟩) - -theorem stageTwoAssignmentLevels_function : - ZFSet.IsFunc (stageOneAssignments (I0 ∪ I1) T) {∅, natSetCode 1} - (stageTwoAssignmentLevels I0 I1 T) := - assignmentIndexLevels_function (first.union_level_function second) - -theorem stageTwoAssignmentLevels_eq : - stageTwoAssignmentLevels I0 I1 T = - ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ - ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1} := by - apply ZFSet.ext - intro z - constructor - · intro hz - obtain ⟨x, _, level, _, rfl⟩ := ZFSet.mem_prod.1 - ((stageTwoAssignmentLevels_function first second).1 hz) - simpa only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton] using - (pair_mem_stageTwoAssignmentLevels first second x level).1 hz - · intro hz - rcases ZFSet.mem_union.1 hz with lower | upper - · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 lower - exact (pair_mem_stageTwoAssignmentLevels first second x level).2 - (Or.inl ⟨hx, ZFSet.mem_singleton.1 hl⟩) - · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 upper - exact (pair_mem_stageTwoAssignmentLevels first second x level).2 - (Or.inr ⟨hx, ZFSet.mem_singleton.1 hl⟩) - -theorem stageTwoAssignmentCut_one (A : ZFSet.{u}) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A = - ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) A := by - apply ZFSet.ext - intro z - rw [mem_assignmentCut, ZFSet.mem_sep] - constructor - · rintro ⟨hz, level, hl, entry⟩ - have equal : level = ∅ := by - change level ∈ insert (∅ : ZFSet.{u}) ∅ at hl - simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using hl - subst level - rcases (pair_mem_stageTwoAssignmentLevels first second z ∅).1 entry with lower | upper - · exact ⟨hz, lower.1⟩ - · exact False.elim (Nat.zero_ne_one (natSetCode_injective upper.2)) - · rintro ⟨hz, lower⟩ - exact ⟨hz, ∅, ZFSet.mem_insert ∅ ∅, - (pair_mem_stageTwoAssignmentLevels first second z ∅).2 (Or.inl ⟨lower, rfl⟩)⟩ - -theorem stageTwoAssignmentCut_two {A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments (I0 ∪ I1) T) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 2) A = A := by - apply assignmentCut_eq_of_lower - intro z hz - obtain ⟨level, entry, _⟩ := (stageTwoAssignmentLevels_function first second).2 z (subset hz) - refine ⟨level, ?_, entry⟩ - rcases (pair_mem_stageTwoAssignmentLevels first second z level).1 entry with lower | upper - · rw [lower.2] - exact ZFSet.mem_insert_of_mem (natSetCode 1) (ZFSet.mem_insert ∅ ∅) - · rw [upper.2] - exact ZFSet.mem_insert (natSetCode 1) (natSetCode 1) - -theorem stageTwoAssignmentCut_one_subset (A : ZFSet.{u}) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A ⊆ - stageOneAssignments I0 T := by - rw [stageTwoAssignmentCut_one first second] - exact fun _ hz => (ZFSet.mem_sep.1 hz).2 - -theorem stageTwoAssignmentCut_one_eq {A : ZFSet.{u}} - (subset : A ⊆ stageOneAssignments I0 T) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A = A := by - rw [stageTwoAssignmentCut_one first second] - apply ZFSet.ext - intro z - exact ⟨fun hz => (ZFSet.mem_sep.1 hz).1, fun hz => ZFSet.mem_sep.2 ⟨hz, subset hz⟩⟩ - -end PartitionPilot.Forcing - - - -namespace PartitionPilot.Forcing -universe u -variable {I0 I1 T : ZFSet.{u}} -variable (first : RefinementIndexLevelCode I0 ∅) - (second : RefinementIndexLevelCode I1 (natSetCode 1)) -include first second - -theorem stageTwoAssignment_upper_not_lower {t u w : ZFSet.{u}} (upperIndex : t ∈ I1) : - stageOneAssignment t u w ∉ stageOneAssignments I0 T := by - intro member - have lowerIndex := ((stageOneAssignment_mem_assignments I0 T t u w).1 member).1 - exact first.disjoint second (fun h => Nat.zero_ne_one (natSetCode_injective h)) t - ⟨lowerIndex, upperIndex⟩ - -theorem stageTwoAssignment_upper_not_cut (A : ZFSet.{u}) {t u w : ZFSet.{u}} - (upperIndex : t ∈ I1) : - stageOneAssignment t u w ∉ - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A := by - intro member - exact stageTwoAssignment_upper_not_lower first second upperIndex - (stageTwoAssignmentCut_one_subset first second A member) - -theorem stageTwoAssignmentSplice_upper_iff (Aq Ap : ZFSet.{u}) {t u w : ZFSet.{u}} - (upperIndex : t ∈ I1) : - stageOneAssignment t u w ∈ - assignmentSplice (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq Ap ↔ - stageOneAssignment t u w ∈ Ap := by - rw [assignmentSplice, ZFSet.mem_union, assignmentUpper, ZFSet.mem_sep] - have noLower := stageTwoAssignment_upper_not_cut (T := T) first second Aq (u := u) (w := w) upperIndex - have noOldCut := stageTwoAssignment_upper_not_cut (T := T) first second Ap (u := u) (w := w) upperIndex - exact ⟨fun h => h.elim (fun lower => False.elim (noLower lower)) And.left, - fun member => Or.inr ⟨member, noOldCut⟩⟩ - -theorem stageTwoAssignment_old_no_upper {A t u w : ZFSet.{u}} - (subsetOld : A ⊆ stageOneAssignments I0 T) (upperIndex : t ∈ I1) : - stageOneAssignment t u w ∉ A := - fun member => stageTwoAssignment_upper_not_lower first second upperIndex (subsetOld member) - -theorem stageTwoAssignmentSplice_lower_eq {Aq : ZFSet.{u}} (Ap : ZFSet.{u}) - (subsetOld : Aq ⊆ stageOneAssignments I0 T) : - assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) - (assignmentSplice (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq Ap) = Aq := by - rw [assignmentCut_splice, stageTwoAssignmentCut_one_eq first second subsetOld] - -end PartitionPilot.Forcing - -end - -end OAI +import OAI.SetTheory.PartitionPrinciple.Geometry.AssignmentIndexLevels +import OAI.SetTheory.PartitionPrinciple.Geometry.GroundNiceRefinementVisibility + +namespace OAI + +section + +namespace PartitionPilot.Forcing +universe u + +noncomputable def stageTwoAssignmentLevels (I0 I1 T : ZFSet.{u}) : ZFSet.{u} := + assignmentIndexLevels (I0 ∪ I1) T {∅, natSetCode 1} + (refinementIndexFieldGraph (I0 ∪ I1) {∅, natSetCode 1} 0) + +theorem stageTwoAssignmentCut_zero (I0 I1 T A : ZFSet.{u}) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 0) A = ∅ := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut, natSetCode_zero] + exact ⟨fun h => False.elim (ZFSet.notMem_empty _ h.2.choose_spec.1), + fun hz => False.elim (ZFSet.notMem_empty z hz)⟩ + +variable {I0 I1 T : ZFSet.{u}} + (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) +include first second + +theorem pair_mem_stageTwoAssignmentLevels (z level : ZFSet.{u}) : + ZFSet.pair z level ∈ stageTwoAssignmentLevels I0 I1 T ↔ + (z ∈ stageOneAssignments I0 T ∧ level = ∅) ∨ + (z ∈ stageOneAssignments I1 T ∧ level = natSetCode 1) := by + rw [stageTwoAssignmentLevels, pair_mem_assignmentIndexLevels] + constructor + · rintro ⟨i, _, u, hu, w, hw, rfl, _, entry⟩ + rcases (first.union_level_entry second i level).1 entry with lower | upper + · exact Or.inl ⟨(stageOneAssignment_mem_assignments I0 T i u w).2 + ⟨lower.1, hu, hw⟩, lower.2⟩ + · exact Or.inr ⟨(stageOneAssignment_mem_assignments I1 T i u w).2 + ⟨upper.1, hu, hw⟩, upper.2⟩ + · rintro (⟨hz, rfl⟩ | ⟨hz, rfl⟩) + · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I0 T z).1 hz + refine ⟨i, ZFSet.mem_union.2 (Or.inl hi), u, hu, w, hw, rfl, + ZFSet.mem_insert _ _, ?_⟩ + exact (first.union_level_entry second i ∅).2 (Or.inl ⟨hi, rfl⟩) + · obtain ⟨i, hi, u, hu, w, hw, rfl⟩ := (mem_stageOneAssignments I1 T z).1 hz + refine ⟨i, ZFSet.mem_union.2 (Or.inr hi), u, hu, w, hw, rfl, + ZFSet.mem_insert_of_mem _ (ZFSet.mem_singleton.2 rfl), ?_⟩ + exact (first.union_level_entry second i (natSetCode 1)).2 (Or.inr ⟨hi, rfl⟩) + +theorem stageTwoAssignmentLevels_function : + ZFSet.IsFunc (stageOneAssignments (I0 ∪ I1) T) {∅, natSetCode 1} + (stageTwoAssignmentLevels I0 I1 T) := + assignmentIndexLevels_function (first.union_level_function second) + +theorem stageTwoAssignmentLevels_eq : + stageTwoAssignmentLevels I0 I1 T = + ZFSet.prod (stageOneAssignments I0 T) {∅} ∪ + ZFSet.prod (stageOneAssignments I1 T) {natSetCode 1} := by + apply ZFSet.ext + intro z + constructor + · intro hz + obtain ⟨x, _, level, _, rfl⟩ := ZFSet.mem_prod.1 + ((stageTwoAssignmentLevels_function first second).1 hz) + simpa only [ZFSet.mem_union, ZFSet.pair_mem_prod, ZFSet.mem_singleton] using + (pair_mem_stageTwoAssignmentLevels first second x level).1 hz + · intro hz + rcases ZFSet.mem_union.1 hz with lower | upper + · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 lower + exact (pair_mem_stageTwoAssignmentLevels first second x level).2 + (Or.inl ⟨hx, ZFSet.mem_singleton.1 hl⟩) + · obtain ⟨x, hx, level, hl, rfl⟩ := ZFSet.mem_prod.1 upper + exact (pair_mem_stageTwoAssignmentLevels first second x level).2 + (Or.inr ⟨hx, ZFSet.mem_singleton.1 hl⟩) + +theorem stageTwoAssignmentCut_one (A : ZFSet.{u}) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A = + ZFSet.sep (fun z => z ∈ stageOneAssignments I0 T) A := by + apply ZFSet.ext + intro z + rw [mem_assignmentCut, ZFSet.mem_sep] + constructor + · rintro ⟨hz, level, hl, entry⟩ + have equal : level = ∅ := by + change level ∈ insert (∅ : ZFSet.{u}) ∅ at hl + simpa only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false] using hl + subst level + rcases (pair_mem_stageTwoAssignmentLevels first second z ∅).1 entry with lower | upper + · exact ⟨hz, lower.1⟩ + · exact False.elim (Nat.zero_ne_one (natSetCode_injective upper.2)) + · rintro ⟨hz, lower⟩ + exact ⟨hz, ∅, ZFSet.mem_insert ∅ ∅, + (pair_mem_stageTwoAssignmentLevels first second z ∅).2 (Or.inl ⟨lower, rfl⟩)⟩ + +theorem stageTwoAssignmentCut_two {A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments (I0 ∪ I1) T) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 2) A = A := by + apply assignmentCut_eq_of_lower + intro z hz + obtain ⟨level, entry, _⟩ := (stageTwoAssignmentLevels_function first second).2 z (subset hz) + refine ⟨level, ?_, entry⟩ + rcases (pair_mem_stageTwoAssignmentLevels first second z level).1 entry with lower | upper + · rw [lower.2] + exact ZFSet.mem_insert_of_mem (natSetCode 1) (ZFSet.mem_insert ∅ ∅) + · rw [upper.2] + exact ZFSet.mem_insert (natSetCode 1) (natSetCode 1) + +theorem stageTwoAssignmentCut_one_subset (A : ZFSet.{u}) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A ⊆ + stageOneAssignments I0 T := by + rw [stageTwoAssignmentCut_one first second] + exact fun _ hz => (ZFSet.mem_sep.1 hz).2 + +theorem stageTwoAssignmentCut_one_eq {A : ZFSet.{u}} + (subset : A ⊆ stageOneAssignments I0 T) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A = A := by + rw [stageTwoAssignmentCut_one first second] + apply ZFSet.ext + intro z + exact ⟨fun hz => (ZFSet.mem_sep.1 hz).1, fun hz => ZFSet.mem_sep.2 ⟨hz, subset hz⟩⟩ + +end PartitionPilot.Forcing + + + +namespace PartitionPilot.Forcing +universe u +variable {I0 I1 T : ZFSet.{u}} +variable (first : RefinementIndexLevelCode I0 ∅) + (second : RefinementIndexLevelCode I1 (natSetCode 1)) +include first second + +theorem stageTwoAssignment_upper_not_lower {t u w : ZFSet.{u}} (upperIndex : t ∈ I1) : + stageOneAssignment t u w ∉ stageOneAssignments I0 T := by + intro member + have lowerIndex := ((stageOneAssignment_mem_assignments I0 T t u w).1 member).1 + exact first.disjoint second (fun h => Nat.zero_ne_one (natSetCode_injective h)) t + ⟨lowerIndex, upperIndex⟩ + +theorem stageTwoAssignment_upper_not_cut (A : ZFSet.{u}) {t u w : ZFSet.{u}} + (upperIndex : t ∈ I1) : + stageOneAssignment t u w ∉ + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) A := by + intro member + exact stageTwoAssignment_upper_not_lower first second upperIndex + (stageTwoAssignmentCut_one_subset first second A member) + +theorem stageTwoAssignmentSplice_upper_iff (Aq Ap : ZFSet.{u}) {t u w : ZFSet.{u}} + (upperIndex : t ∈ I1) : + stageOneAssignment t u w ∈ + assignmentSplice (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq Ap ↔ + stageOneAssignment t u w ∈ Ap := by + rw [assignmentSplice, ZFSet.mem_union, assignmentUpper, ZFSet.mem_sep] + have noLower := stageTwoAssignment_upper_not_cut (T := T) first second Aq (u := u) (w := w) upperIndex + have noOldCut := stageTwoAssignment_upper_not_cut (T := T) first second Ap (u := u) (w := w) upperIndex + exact ⟨fun h => h.elim (fun lower => False.elim (noLower lower)) And.left, + fun member => Or.inr ⟨member, noOldCut⟩⟩ + +theorem stageTwoAssignment_old_no_upper {A t u w : ZFSet.{u}} + (subsetOld : A ⊆ stageOneAssignments I0 T) (upperIndex : t ∈ I1) : + stageOneAssignment t u w ∉ A := + fun member => stageTwoAssignment_upper_not_lower first second upperIndex (subsetOld member) + +theorem stageTwoAssignmentSplice_lower_eq {Aq : ZFSet.{u}} (Ap : ZFSet.{u}) + (subsetOld : Aq ⊆ stageOneAssignments I0 T) : + assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) + (assignmentSplice (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) Aq Ap) = Aq := by + rw [assignmentCut_splice, stageTwoAssignmentCut_one_eq first second subsetOld] + +end PartitionPilot.Forcing + +end + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoClosureData.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoClosureData.lean index 113607a18f51e05aeedda112d6ccf43e7f89c390..49218939924e9a0fe1c8882414071ff1d59e5ae0 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoClosureData.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoClosureData.lean @@ -1,714 +1,714 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.StageTwoConditionUnions - -namespace OAI - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid -local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega - -noncomputable def stageTwoAssignmentGraph : ZFSet.{u} := rowAssignmentData Q c.carrier B - -private theorem subset_product : Q ⊆ ZFSet.prod c.carrier B := by - intro z hz - exact ((M.mem_stageTwoConditions c.carrier (I0 ∪ I1) (stageTwoAssignmentLevels I0 I1 T) - (natSetCode 1) (M.refinementLevelFormulaData a s b d (natSetCode 1) T T2 valid) z).1 hz).1 - -theorem stageTwoAssignmentGraph_entry (p : R) (A x : ZFSet.{u}) : - ZFSet.pair (ZFSet.pair (c.encode p) A) x ∈ M.stageTwoAssignmentGraph c I0 a s b d T T2 valid ↔ - ZFSet.pair (c.encode p) A ∈ Q ∧ x = A := by - rw [stageTwoAssignmentGraph, rowAssignmentData_entry] - constructor - · rintro ⟨member, _, _, equal⟩ - exact ⟨member, equal⟩ - · rintro ⟨member, equal⟩ - have fields := ZFSet.pair_mem_prod.1 (subset_product M c I0 a s b d T T2 valid member) - exact ⟨member, fields.1, fields.2, equal⟩ - -theorem stageTwoAssignmentGraph_function : - ZFSet.IsFunc Q B (M.stageTwoAssignmentGraph c I0 a s b d T T2 valid) := - rowAssignmentData_function (subset_product M c I0 a s b d T T2 valid) - -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) -variable (hT : T ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -include pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder indices system - -theorem stageTwoAssignmentGraph_mem (omega : ZFSet.omega ∈ M.sets) : - M.stageTwoAssignmentGraph c I0 a s b d T T2 valid ∈ M.sets := by - have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid - pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions hI0 indices.index_ground) hT - exact M.rowAssignmentData_mem pairing unions powers separation conditions rows - (M.groundSmallSubsets_mem powers separation assignments omega) - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) - -namespace StageTwoCondition -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -local notation "levels" => stageTwoAssignmentLevels I0 - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T - -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) - -local notation "restrict" => restriction M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "inc" => inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -include infinite choice hI0 hI1 in -theorem completeProjection : CompleteProjection restrict inc := by - refine ⟨?_, ?_, ?_⟩ - · exact restriction_inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - · exact le_inclusion_iff M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - · intro p q below - obtain ⟨r, rp, lower, _, _⟩ := exists_lift_restriction M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - infinite choice hI0 hI1 p q below - exact ⟨r, rp, lower⟩ - -end StageTwoCondition -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "restrict" => StageTwoCondition.restriction M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -noncomputable def stageTwoSmallRestriction : - letI := smallOrder - Shrink Condition →o P := by - letI := smallOrder - exact { - toFun := fun p => restrict ((equivShrink Condition).symm p) - monotone' := fun _ _ below => (restrict).monotone below } - -noncomputable def stageTwoSmallInclusion : - letI := smallOrder - P ↪o Shrink Condition := by - letI := smallOrder - exact { - toFun := fun p => equivShrink Condition (inc p) - inj' := fun _ _ equal => (inc).injective ((equivShrink Condition).injective equal) - map_rel_iff' := by - intro p q - change (equivShrink Condition).symm (equivShrink Condition (inc p)) ≤ - (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ p ≤ q - simp only [Equiv.symm_apply_apply] - exact (inc).map_rel_iff } - -local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "smallInc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hI0 : I0 ∈ M.sets) -variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) - -include infinite choice hI0 hI1 in -theorem stageTwoSmallCompleteProjection : - letI := smallOrder - CompleteProjection smallRestrict smallInc := by - let := smallOrder - have original := StageTwoCondition.completeProjection M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second - infinite choice hI0 hI1 - refine ⟨?_, ?_, ?_⟩ - · intro q - change restrict ((equivShrink Condition).symm (equivShrink Condition (inc q))) = q - rw [Equiv.symm_apply_apply] - exact original.retract q - · intro p q - change (equivShrink Condition).symm p ≤ - (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ - restrict ((equivShrink Condition).symm p) ≤ q - rw [Equiv.symm_apply_apply] - exact original.le_include_iff _ q - · intro p q below - obtain ⟨r, rp, lower⟩ := original.lift ((equivShrink Condition).symm p) q below - refine ⟨equivShrink Condition r, ?_, ?_⟩ - · change (equivShrink Condition).symm (equivShrink Condition r) ≤ (equivShrink Condition).symm p - rw [Equiv.symm_apply_apply] - exact rp - · change restrict ((equivShrink Condition).symm (equivShrink Condition r)) = q - rw [Equiv.symm_apply_apply] - exact lower - -theorem stageTwoSmallInclusion_encode : - letI := smallOrder - ∀ q : P, (pres).encode (smallInc q) = s.encode q := by - let := smallOrder - intro q - change (pres).encode (equivShrink Condition (inc q)) = s.encode q - rw [M.stageTwoConditionPresentation_encode] - exact StageTwoCondition.includeLower_code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F first second q - -theorem stageTwoSmallRestriction_encode : - letI := smallOrder - ∀ p : Shrink Condition, s.encode (smallRestrict p) = - ZFSet.pair (c.encode ((equivShrink Condition).symm p).row) - (assignmentCut (stageTwoAssignmentLevels I0 - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) - (natSetCode 1) ((equivShrink Condition).symm p).assignments) := by - let := smallOrder - intro p - exact ((equivShrink Condition).symm p).lower_code - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "levels" => stageTwoAssignmentLevels I0 - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T - -theorem stageTwoSmallRestriction_graph : - letI := smallOrder - (pres).graph s smallRestrict = rowAssignmentCutGraph Q s.carrier levels (natSetCode 1) := by - let := smallOrder - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · rintro ⟨p, rfl⟩ - let decoded := (equivShrink Condition).symm p - change ZFSet.pair (ZFSet.pair (c.encode decoded.row) decoded.assignments) - (s.encode (smallRestrict p)) ∈ _ - exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 - ⟨(pres).encode_mem p, s.encode_mem (smallRestrict p), - M.stageTwoSmallRestriction_encode c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system F p⟩ - · intro member - obtain ⟨upper, hu, lower, _, equal⟩ := ZFSet.mem_prod.1 - ((mem_rowAssignmentCutGraph _ _ _ _ z).1 member).1 - obtain ⟨p, ep⟩ := ((pres).mem_carrier upper).1 hu - have entry : ZFSet.pair ((pres).encode p) lower ∈ - rowAssignmentCutGraph Q s.carrier levels (natSetCode 1) := by - rw [ep, ← equal] - exact member - let decoded := (equivShrink Condition).symm p - change ZFSet.pair (ZFSet.pair (c.encode decoded.row) decoded.assignments) lower ∈ _ at entry - have parts := (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 entry - have lowerEqual : s.encode (smallRestrict p) = lower := - (M.stageTwoSmallRestriction_encode c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order hT base directed system F p).trans parts.2.2.symm - refine ⟨p, ?_⟩ - change ZFSet.pair ((pres).encode p) (s.encode (smallRestrict p)) = z - rw [ep, lowerEqual] - exact equal.symm - -theorem stageTwoSmallRestriction_graph_mem - (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : - letI := smallOrder - (pres).graph s smallRestrict ∈ M.sets := by - let := smallOrder - rw [M.stageTwoSmallRestriction_graph c I0 a s b d T T2 valid pairing unions powers separation - collection carrier order nodes hT indices base directed system F] - exact M.rowAssignmentCutGraph_mem pairing unions powers separation - (M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation - rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega) - carrier (M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 indices.index_ground hT) - (M.transitive omega (natSetCode_mem_omega 1)) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid -local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -noncomputable def stageTwoConditionData (x : Shrink Condition) : SetMembers B := - SetMembers.ofMem ((equivShrink Condition).symm x).assignments - ((equivShrink Condition).symm x).assignments_mem - -local notation "data" => M.stageTwoConditionData c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - -omit [PartialOrder R] in -theorem stageTwoConditionData_raw (x : Shrink Condition) : - SetMembers.raw (data x) = ((equivShrink Condition).symm x).assignments := - SetMembers.raw_ofMem _ _ - -include nodes indices in -omit [PartialOrder R] in -theorem stageTwoAssignmentGraph_eq_graph : - M.stageTwoAssignmentGraph c I0 a s b d T T2 valid = (pres).graph (SetMembers.presentation B) data := by - apply ZFSet.ext - intro z - rw [Presentation.mem_graph] - constructor - · intro member - obtain ⟨raw, hr, x, _, rfl⟩ := ZFSet.mem_prod.1 - ((M.stageTwoAssignmentGraph_function c I0 a s b d T T2 valid).1 member) - obtain ⟨q, rfl⟩ := ((pres).mem_carrier raw).1 hr - have value := (M.stageTwoAssignmentGraph_entry c I0 a s b d T T2 valid - ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments x).1 member - refine ⟨q, ?_⟩ - change ZFSet.pair ((pres).encode q) (SetMembers.raw (data q)) = ZFSet.pair ((pres).encode q) x - rw [M.stageTwoConditionData_raw, value.2] - · rintro ⟨q, rfl⟩ - exact (M.stageTwoAssignmentGraph_entry c I0 a s b d T T2 valid - ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments _).2 - ⟨(pres).encode_mem q, M.stageTwoConditionData_raw c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system q⟩ - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -local notation "restrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F - -include nodes indices in -theorem stageTwoSequence_projections_ground - (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) - (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) - (seq : Nat → Shrink Condition) - (whole : natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets) : - letI := smallOrder - natPresentation.graph s (fun n => (restrict) (seq n.down)) ∈ M.sets ∧ - groundSequenceGraph (fun n => data (seq n)) ∈ M.sets := by - let := smallOrder - have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid - pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega - have assignments := M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions hI0 indices.index_ground) hT - have hB := M.groundSmallSubsets_mem powers separation assignments omega - have first := M.stageTwoSmallRestriction_graph_mem c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system F - rows hI0 nodeOrder omega - have second := M.stageTwoAssignmentGraph_mem c I0 a s b d T T2 valid - pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder indices base directed system omega - rw [M.stageTwoAssignmentGraph_eq_graph c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system] at second - have lowerGraph := M.relationCompose_mem pairing unions powers separation omega conditions carrier whole first - have dataGraph := M.relationCompose_mem pairing unions powers separation omega conditions hB whole second - have lowerEqual := natPresentation.relationCompose_graph (pres) s (fun n => seq n.down) (restrict) - have dataEqual := natPresentation.relationCompose_graph (pres) (SetMembers.presentation B) - (fun n => seq n.down) data - change relationCompose ZFSet.omega Q s.carrier - (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph s (restrict)) = _ at lowerEqual - change relationCompose ZFSet.omega Q B - (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph (SetMembers.presentation B) data) = _ at dataEqual - rw [lowerEqual] at lowerGraph - rw [dataEqual] at dataGraph - exact ⟨lowerGraph, dataGraph⟩ - -end TransitiveGround - -section -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageTwoProjectionData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : Prop where - carrier_data : StageTwoCarrierData M c.carrier (c.encode ⊤) a c.pairEmpty e s actors nodes d - base directed T T2 valid pairing unions powers separation collection - first_level : RefinementIndexLevelCode (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) ∅ - projections : - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let next := carrier_data.index_data.next - let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 - let hT := carrier_data.terms_ground - let hP := carrier_data.lower_carrier_ground - let hOrder := carrier_data.lower_order_ground - ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), - let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first - letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first - F first_level next.indices.levelCode - ∃ hNodes : nodes.carrier ∈ M.sets, - let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first - let restriction := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first F - let inclusion := M.stageTwoSmallInclusion c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first - F first_level next.indices.levelCode - pres.carrier = M.stageTwoForcing c.carrier I0 e s nodes d T T2 next.valid1 ∧ - pres.carrier ∈ M.sets ∧ - pres.conditionOrder = rowAssignmentOrder pres.carrier c.carrier - (M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega) c.conditionOrder ∧ - pres.conditionOrder ∈ M.sets ∧ pres.encode ⊤ = s.encode ⊤ ∧ - CompleteProjection restriction inclusion ∧ - (∀ q : P, pres.encode (inclusion q) = s.encode q) ∧ - (∀ p : Shrink Condition, s.encode (restriction p) = - ZFSet.pair (c.encode ((equivShrink Condition).symm p).row) - (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) - ((equivShrink Condition).symm p).assignments)) ∧ - pres.graph s restriction = rowAssignmentCutGraph pres.carrier s.carrier - (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) ∧ - pres.graph s restriction ∈ M.sets - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) -variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - -theorem stageTwoProjectionData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (prior : StageTwoCarrierData M c.carrier (c.encode ⊤) a c.pairEmpty e s actors nodes d - base directed T T2 valid pairing unions powers separation collection) - (F : FlatConditionSystem M c s - (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) T)) - (first : RefinementIndexLevelCode (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) ∅) - (rows : c.carrier ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (rowOrder : c.conditionOrder ∈ M.sets) (hNodes : nodes.carrier ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) : - StageTwoProjectionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection := by - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let next := prior.index_data.next - let hT := prior.terms_ground - let hP := prior.lower_carrier_ground - let hOrder := prior.lower_order_ground - refine ⟨prior, first, F, ?_⟩ - let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first - let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first F first next.indices.levelCode - refine ⟨hNodes, rfl, prior.carrier_ground, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ - · exact (M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hNodes hT next.indices - base directed next.first).conditionOrder_eq - · exact M.stageTwoConditionOrder_mem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first - rows hI0 rowOrder nodeOrder (M.omega_mem separation infinite) - · exact M.stageTwoConditionPresentation_top c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first - F first next.indices.levelCode - · exact M.stageTwoSmallCompleteProjection c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first - F first next.indices.levelCode infinite choice hI0 next.indices.index_ground - · exact M.stageTwoSmallInclusion_encode c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first - F first next.indices.levelCode - · exact M.stageTwoSmallRestriction_encode c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hT base directed next.first F - · exact M.stageTwoSmallRestriction_graph c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first F - · exact M.stageTwoSmallRestriction_graph_mem c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first F - rows hI0 nodeOrder (M.omega_mem separation infinite) - -end TransitiveGround -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) -variable {valid2 : ∀ z ∈ T2, IsName s z} -variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid - -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - -variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) -variable (first : RefinementIndexLevelCode I0 ∅) -variable (second : RefinementIndexLevelCode - (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) -local notation "restrict" => StageTwoCondition.restriction M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system F -local notation "data" => M.stageTwoConditionData c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid -local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega -local notation "levels" => stageTwoAssignmentLevels I0 I1 T -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) -variable (nodeOrder : b.conditionOrder ∈ M.sets) -variable (closed : InternallyCountablyClosed M s) - -include F first second infinite choice rows hI0 nodeOrder closed in -theorem stageTwoCondition_lower_bound : - letI := smallOrder - ∀ seq : Nat → Shrink Condition, - natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → - ∃ q : P, (∀ n, q ≤ smallRestrict (seq n)) ∧ ∃ p : Shrink Condition, - ((equivShrink Condition).symm p).lower = q ∧ - ((equivShrink Condition).symm p).assignments = - assignmentSplice levels (natSetCode 1) (F.assignments q) - (stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments)) ∧ - ∀ n, p ≤ seq n := by - let := smallOrder - intro seq whole decreasing - let typed : Nat → Condition := fun n => (equivShrink Condition).symm (seq n) - have typedDecreasing : Antitone typed := fun _ _ less => decreasing less - have lowerDecreasing : Antitone (fun n => smallRestrict (seq n)) := - fun _ _ less => (smallRestrict).monotone (decreasing less) - obtain ⟨lowerGround, dataGround⟩ := M.stageTwoSequence_projections_ground c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F rows hI0 nodeOrder (M.omega_mem separation infinite) seq whole - obtain ⟨q, below⟩ := closed (fun n => smallRestrict (seq n)) lowerGround lowerDecreasing - have hJ := M.stageOneAssignments_mem pairing unions powers separation - (M.binary_union_mem pairing unions hI0 indices.index_ground) hT - have smallRaw := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice - hJ (fun n => data (seq n)) dataGround - have small : stageOneAssignmentUnion (fun n => (typed n).assignments) ∈ B := by - simpa only [M.stageTwoConditionData_raw] using smallRaw - let lower : Condition := StageTwoCondition.chainUnion M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - F first second infinite choice hI0 indices.index_ground typed typedDecreasing q below small - refine ⟨q, below, equivShrink Condition lower, ?_, ?_, ?_⟩ - · rw [Equiv.symm_apply_apply] - rfl - · rw [Equiv.symm_apply_apply] - rfl - · intro n - change (equivShrink Condition).symm (equivShrink Condition lower) ≤ typed n - rw [Equiv.symm_apply_apply] - exact StageTwoCondition.chainUnion_le M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system - F first second infinite choice hI0 indices.index_ground typed typedDecreasing q below small n - -include F first second infinite choice rows hI0 nodeOrder closed in -theorem stageTwoCondition_internally_closed : - letI := smallOrder - InternallyCountablyClosed M (pres) := by - let := smallOrder - intro seq whole decreasing - obtain ⟨_, _, q, _, _, below⟩ := M.stageTwoCondition_lower_bound c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order nodes hT indices base directed system - F first second infinite choice rows hI0 nodeOrder closed seq whole decreasing - exact ⟨q, below⟩ - -end TransitiveGround - -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageTwoClosureData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) : Prop where - projection_data : StageTwoProjectionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection - closed : - let prior := projection_data.carrier_data - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let next := prior.index_data.next - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - ∃ hNodes : nodes.carrier ∈ M.sets, - InternallyCountablyClosed M - (M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - hNodes prior.terms_ground next.indices base directed next.first) - -namespace TransitiveGround -variable (M : TransitiveGround.{u}) -variable (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) -variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - -theorem stageTwoClosureData - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (prior : StageTwoProjectionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection) - (rows : c.carrier ∈ M.sets) - (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) - (nodeOrder : nodes.conditionOrder ∈ M.sets) - (infinite : Realize M.sets infinity Fin.elim0) - (choice : Realize M.sets SetFormula.choice Fin.elim0) - (lowerClosed : InternallyCountablyClosed M s) : - StageTwoClosureData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection := by - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let data := prior.carrier_data - let next := data.index_data.next - obtain ⟨F, hNodes, _⟩ := prior.projections - refine ⟨prior, hNodes, ?_⟩ - exact M.stageTwoCondition_internally_closed c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground - hNodes data.terms_ground next.indices base directed next.first F prior.first_level next.indices.levelCode - infinite choice rows hI0 nodeOrder lowerClosed - -end TransitiveGround - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.StageTwoConditionUnions + +namespace OAI + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid +local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega + +noncomputable def stageTwoAssignmentGraph : ZFSet.{u} := rowAssignmentData Q c.carrier B + +private theorem subset_product : Q ⊆ ZFSet.prod c.carrier B := by + intro z hz + exact ((M.mem_stageTwoConditions c.carrier (I0 ∪ I1) (stageTwoAssignmentLevels I0 I1 T) + (natSetCode 1) (M.refinementLevelFormulaData a s b d (natSetCode 1) T T2 valid) z).1 hz).1 + +theorem stageTwoAssignmentGraph_entry (p : R) (A x : ZFSet.{u}) : + ZFSet.pair (ZFSet.pair (c.encode p) A) x ∈ M.stageTwoAssignmentGraph c I0 a s b d T T2 valid ↔ + ZFSet.pair (c.encode p) A ∈ Q ∧ x = A := by + rw [stageTwoAssignmentGraph, rowAssignmentData_entry] + constructor + · rintro ⟨member, _, _, equal⟩ + exact ⟨member, equal⟩ + · rintro ⟨member, equal⟩ + have fields := ZFSet.pair_mem_prod.1 (subset_product M c I0 a s b d T T2 valid member) + exact ⟨member, fields.1, fields.2, equal⟩ + +theorem stageTwoAssignmentGraph_function : + ZFSet.IsFunc Q B (M.stageTwoAssignmentGraph c I0 a s b d T T2 valid) := + rowAssignmentData_function (subset_product M c I0 a s b d T T2 valid) + +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) +variable (hT : T ∈ M.sets) (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (nodeOrder : b.conditionOrder ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +include pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder indices system + +theorem stageTwoAssignmentGraph_mem (omega : ZFSet.omega ∈ M.sets) : + M.stageTwoAssignmentGraph c I0 a s b d T T2 valid ∈ M.sets := by + have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid + pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions hI0 indices.index_ground) hT + exact M.rowAssignmentData_mem pairing unions powers separation conditions rows + (M.groundSmallSubsets_mem powers separation assignments omega) + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) + +namespace StageTwoCondition +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +local notation "levels" => stageTwoAssignmentLevels I0 + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T + +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) + +local notation "restrict" => restriction M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "inc" => inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +include infinite choice hI0 hI1 in +theorem completeProjection : CompleteProjection restrict inc := by + refine ⟨?_, ?_, ?_⟩ + · exact restriction_inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + · exact le_inclusion_iff M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + · intro p q below + obtain ⟨r, rp, lower, _, _⟩ := exists_lift_restriction M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + infinite choice hI0 hI1 p q below + exact ⟨r, rp, lower⟩ + +end StageTwoCondition +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "restrict" => StageTwoCondition.restriction M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "inc" => StageTwoCondition.inclusion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +noncomputable def stageTwoSmallRestriction : + letI := smallOrder + Shrink Condition →o P := by + letI := smallOrder + exact { + toFun := fun p => restrict ((equivShrink Condition).symm p) + monotone' := fun _ _ below => (restrict).monotone below } + +noncomputable def stageTwoSmallInclusion : + letI := smallOrder + P ↪o Shrink Condition := by + letI := smallOrder + exact { + toFun := fun p => equivShrink Condition (inc p) + inj' := fun _ _ equal => (inc).injective ((equivShrink Condition).injective equal) + map_rel_iff' := by + intro p q + change (equivShrink Condition).symm (equivShrink Condition (inc p)) ≤ + (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ p ≤ q + simp only [Equiv.symm_apply_apply] + exact (inc).map_rel_iff } + +local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "smallInc" => M.stageTwoSmallInclusion c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hI0 : I0 ∈ M.sets) +variable (hI1 : M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid ∈ M.sets) + +include infinite choice hI0 hI1 in +theorem stageTwoSmallCompleteProjection : + letI := smallOrder + CompleteProjection smallRestrict smallInc := by + let := smallOrder + have original := StageTwoCondition.completeProjection M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second + infinite choice hI0 hI1 + refine ⟨?_, ?_, ?_⟩ + · intro q + change restrict ((equivShrink Condition).symm (equivShrink Condition (inc q))) = q + rw [Equiv.symm_apply_apply] + exact original.retract q + · intro p q + change (equivShrink Condition).symm p ≤ + (equivShrink Condition).symm (equivShrink Condition (inc q)) ↔ + restrict ((equivShrink Condition).symm p) ≤ q + rw [Equiv.symm_apply_apply] + exact original.le_include_iff _ q + · intro p q below + obtain ⟨r, rp, lower⟩ := original.lift ((equivShrink Condition).symm p) q below + refine ⟨equivShrink Condition r, ?_, ?_⟩ + · change (equivShrink Condition).symm (equivShrink Condition r) ≤ (equivShrink Condition).symm p + rw [Equiv.symm_apply_apply] + exact rp + · change restrict ((equivShrink Condition).symm (equivShrink Condition r)) = q + rw [Equiv.symm_apply_apply] + exact lower + +theorem stageTwoSmallInclusion_encode : + letI := smallOrder + ∀ q : P, (pres).encode (smallInc q) = s.encode q := by + let := smallOrder + intro q + change (pres).encode (equivShrink Condition (inc q)) = s.encode q + rw [M.stageTwoConditionPresentation_encode] + exact StageTwoCondition.includeLower_code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F first second q + +theorem stageTwoSmallRestriction_encode : + letI := smallOrder + ∀ p : Shrink Condition, s.encode (smallRestrict p) = + ZFSet.pair (c.encode ((equivShrink Condition).symm p).row) + (assignmentCut (stageTwoAssignmentLevels I0 + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T) + (natSetCode 1) ((equivShrink Condition).symm p).assignments) := by + let := smallOrder + intro p + exact ((equivShrink Condition).symm p).lower_code + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "code" => StageTwoCondition.code M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "levels" => stageTwoAssignmentLevels I0 + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) T + +theorem stageTwoSmallRestriction_graph : + letI := smallOrder + (pres).graph s smallRestrict = rowAssignmentCutGraph Q s.carrier levels (natSetCode 1) := by + let := smallOrder + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · rintro ⟨p, rfl⟩ + let decoded := (equivShrink Condition).symm p + change ZFSet.pair (ZFSet.pair (c.encode decoded.row) decoded.assignments) + (s.encode (smallRestrict p)) ∈ _ + exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 + ⟨(pres).encode_mem p, s.encode_mem (smallRestrict p), + M.stageTwoSmallRestriction_encode c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system F p⟩ + · intro member + obtain ⟨upper, hu, lower, _, equal⟩ := ZFSet.mem_prod.1 + ((mem_rowAssignmentCutGraph _ _ _ _ z).1 member).1 + obtain ⟨p, ep⟩ := ((pres).mem_carrier upper).1 hu + have entry : ZFSet.pair ((pres).encode p) lower ∈ + rowAssignmentCutGraph Q s.carrier levels (natSetCode 1) := by + rw [ep, ← equal] + exact member + let decoded := (equivShrink Condition).symm p + change ZFSet.pair (ZFSet.pair (c.encode decoded.row) decoded.assignments) lower ∈ _ at entry + have parts := (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 entry + have lowerEqual : s.encode (smallRestrict p) = lower := + (M.stageTwoSmallRestriction_encode c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order hT base directed system F p).trans parts.2.2.symm + refine ⟨p, ?_⟩ + change ZFSet.pair ((pres).encode p) (s.encode (smallRestrict p)) = z + rw [ep, lowerEqual] + exact equal.symm + +theorem stageTwoSmallRestriction_graph_mem + (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) : + letI := smallOrder + (pres).graph s smallRestrict ∈ M.sets := by + let := smallOrder + rw [M.stageTwoSmallRestriction_graph c I0 a s b d T T2 valid pairing unions powers separation + collection carrier order nodes hT indices base directed system F] + exact M.rowAssignmentCutGraph_mem pairing unions powers separation + (M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid pairing unions powers separation + rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega) + carrier (M.stageTwoAssignmentLevels_mem pairing unions powers separation hI0 indices.index_ground hT) + (M.transitive omega (natSetCode_mem_omega 1)) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid +local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +noncomputable def stageTwoConditionData (x : Shrink Condition) : SetMembers B := + SetMembers.ofMem ((equivShrink Condition).symm x).assignments + ((equivShrink Condition).symm x).assignments_mem + +local notation "data" => M.stageTwoConditionData c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + +omit [PartialOrder R] in +theorem stageTwoConditionData_raw (x : Shrink Condition) : + SetMembers.raw (data x) = ((equivShrink Condition).symm x).assignments := + SetMembers.raw_ofMem _ _ + +include nodes indices in +omit [PartialOrder R] in +theorem stageTwoAssignmentGraph_eq_graph : + M.stageTwoAssignmentGraph c I0 a s b d T T2 valid = (pres).graph (SetMembers.presentation B) data := by + apply ZFSet.ext + intro z + rw [Presentation.mem_graph] + constructor + · intro member + obtain ⟨raw, hr, x, _, rfl⟩ := ZFSet.mem_prod.1 + ((M.stageTwoAssignmentGraph_function c I0 a s b d T T2 valid).1 member) + obtain ⟨q, rfl⟩ := ((pres).mem_carrier raw).1 hr + have value := (M.stageTwoAssignmentGraph_entry c I0 a s b d T T2 valid + ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments x).1 member + refine ⟨q, ?_⟩ + change ZFSet.pair ((pres).encode q) (SetMembers.raw (data q)) = ZFSet.pair ((pres).encode q) x + rw [M.stageTwoConditionData_raw, value.2] + · rintro ⟨q, rfl⟩ + exact (M.stageTwoAssignmentGraph_entry c I0 a s b d T T2 valid + ((equivShrink Condition).symm q).row ((equivShrink Condition).symm q).assignments _).2 + ⟨(pres).encode_mem q, M.stageTwoConditionData_raw c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system q⟩ + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +local notation "restrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F + +include nodes indices in +theorem stageTwoSequence_projections_ground + (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) + (nodeOrder : b.conditionOrder ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) + (seq : Nat → Shrink Condition) + (whole : natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets) : + letI := smallOrder + natPresentation.graph s (fun n => (restrict) (seq n.down)) ∈ M.sets ∧ + groundSequenceGraph (fun n => data (seq n)) ∈ M.sets := by + let := smallOrder + have conditions := M.stageTwoForcing_mem c.carrier I0 a s b d T T2 valid + pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder valid2 indices base directed system omega + have assignments := M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions hI0 indices.index_ground) hT + have hB := M.groundSmallSubsets_mem powers separation assignments omega + have first := M.stageTwoSmallRestriction_graph_mem c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system F + rows hI0 nodeOrder omega + have second := M.stageTwoAssignmentGraph_mem c I0 a s b d T T2 valid + pairing unions powers separation rows hI0 hT carrier order nodes nodeOrder indices base directed system omega + rw [M.stageTwoAssignmentGraph_eq_graph c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system] at second + have lowerGraph := M.relationCompose_mem pairing unions powers separation omega conditions carrier whole first + have dataGraph := M.relationCompose_mem pairing unions powers separation omega conditions hB whole second + have lowerEqual := natPresentation.relationCompose_graph (pres) s (fun n => seq n.down) (restrict) + have dataEqual := natPresentation.relationCompose_graph (pres) (SetMembers.presentation B) + (fun n => seq n.down) data + change relationCompose ZFSet.omega Q s.carrier + (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph s (restrict)) = _ at lowerEqual + change relationCompose ZFSet.omega Q B + (natPresentation.graph (pres) (fun n => seq n.down)) ((pres).graph (SetMembers.presentation B) data) = _ at dataEqual + rw [lowerEqual] at lowerGraph + rw [dataEqual] at dataGraph + exact ⟨lowerGraph, dataGraph⟩ + +end TransitiveGround + +section +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageTwoProjectionData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : Prop where + carrier_data : StageTwoCarrierData M c.carrier (c.encode ⊤) a c.pairEmpty e s actors nodes d + base directed T T2 valid pairing unions powers separation collection + first_level : RefinementIndexLevelCode (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) ∅ + projections : + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let next := carrier_data.index_data.next + let I1 := M.niceRefinementIndices e s nodes d (natSetCode 1) T T2 next.valid1 + let hT := carrier_data.terms_ground + let hP := carrier_data.lower_carrier_ground + let hOrder := carrier_data.lower_order_ground + ∃ F : FlatConditionSystem M c s (stageOneAssignments I0 T), + let Condition := StageTwoCondition M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first + letI := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first + F first_level next.indices.levelCode + ∃ hNodes : nodes.carrier ∈ M.sets, + let pres := M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first + let restriction := M.stageTwoSmallRestriction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first F + let inclusion := M.stageTwoSmallInclusion c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first + F first_level next.indices.levelCode + pres.carrier = M.stageTwoForcing c.carrier I0 e s nodes d T T2 next.valid1 ∧ + pres.carrier ∈ M.sets ∧ + pres.conditionOrder = rowAssignmentOrder pres.carrier c.carrier + (M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega) c.conditionOrder ∧ + pres.conditionOrder ∈ M.sets ∧ pres.encode ⊤ = s.encode ⊤ ∧ + CompleteProjection restriction inclusion ∧ + (∀ q : P, pres.encode (inclusion q) = s.encode q) ∧ + (∀ p : Shrink Condition, s.encode (restriction p) = + ZFSet.pair (c.encode ((equivShrink Condition).symm p).row) + (assignmentCut (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) + ((equivShrink Condition).symm p).assignments)) ∧ + pres.graph s restriction = rowAssignmentCutGraph pres.carrier s.carrier + (stageTwoAssignmentLevels I0 I1 T) (natSetCode 1) ∧ + pres.graph s restriction ∈ M.sets + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) +variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + +theorem stageTwoProjectionData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (prior : StageTwoCarrierData M c.carrier (c.encode ⊤) a c.pairEmpty e s actors nodes d + base directed T T2 valid pairing unions powers separation collection) + (F : FlatConditionSystem M c s + (stageOneAssignments (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) T)) + (first : RefinementIndexLevelCode (M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid) ∅) + (rows : c.carrier ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (rowOrder : c.conditionOrder ∈ M.sets) (hNodes : nodes.carrier ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) : + StageTwoProjectionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection := by + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let next := prior.index_data.next + let hT := prior.terms_ground + let hP := prior.lower_carrier_ground + let hOrder := prior.lower_order_ground + refine ⟨prior, first, F, ?_⟩ + let := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first + let := M.stageTwoConditionSmallTop c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first F first next.indices.levelCode + refine ⟨hNodes, rfl, prior.carrier_ground, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · exact (M.stageTwoFlatConditionSystem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hNodes hT next.indices + base directed next.first).conditionOrder_eq + · exact M.stageTwoConditionOrder_mem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first + rows hI0 rowOrder nodeOrder (M.omega_mem separation infinite) + · exact M.stageTwoConditionPresentation_top c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first + F first next.indices.levelCode + · exact M.stageTwoSmallCompleteProjection c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first + F first next.indices.levelCode infinite choice hI0 next.indices.index_ground + · exact M.stageTwoSmallInclusion_encode c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first + F first next.indices.levelCode + · exact M.stageTwoSmallRestriction_encode c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hT base directed next.first F + · exact M.stageTwoSmallRestriction_graph c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first F + · exact M.stageTwoSmallRestriction_graph_mem c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection hP hOrder hNodes hT next.indices base directed next.first F + rows hI0 nodeOrder (M.omega_mem separation infinite) + +end TransitiveGround +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (nodes : b.carrier ∈ M.sets) (hT : T ∈ M.sets) +variable {valid2 : ∀ z ∈ T2, IsName s z} +variable (indices : NiceRefinementIndexSystem M a s b d (natSetCode 1) T T2 valid valid2) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "Q" => M.stageTwoForcing c.carrier I0 a s b d T T2 valid + +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "pres" => M.stageTwoConditionPresentation c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + +variable (F : FlatConditionSystem M c s (stageOneAssignments I0 T)) +variable (first : RefinementIndexLevelCode I0 ∅) +variable (second : RefinementIndexLevelCode + (M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid) (natSetCode 1)) +local notation "restrict" => StageTwoCondition.restriction M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "smallRestrict" => M.stageTwoSmallRestriction c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system F +local notation "data" => M.stageTwoConditionData c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "I1" => M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid +local notation "B" => M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) T) ZFSet.omega +local notation "levels" => stageTwoAssignmentLevels I0 I1 T +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (rows : c.carrier ∈ M.sets) (hI0 : I0 ∈ M.sets) +variable (nodeOrder : b.conditionOrder ∈ M.sets) +variable (closed : InternallyCountablyClosed M s) + +include F first second infinite choice rows hI0 nodeOrder closed in +theorem stageTwoCondition_lower_bound : + letI := smallOrder + ∀ seq : Nat → Shrink Condition, + natPresentation.graph (pres) (fun n => seq n.down) ∈ M.sets → Antitone seq → + ∃ q : P, (∀ n, q ≤ smallRestrict (seq n)) ∧ ∃ p : Shrink Condition, + ((equivShrink Condition).symm p).lower = q ∧ + ((equivShrink Condition).symm p).assignments = + assignmentSplice levels (natSetCode 1) (F.assignments q) + (stageOneAssignmentUnion (fun n => ((equivShrink Condition).symm (seq n)).assignments)) ∧ + ∀ n, p ≤ seq n := by + let := smallOrder + intro seq whole decreasing + let typed : Nat → Condition := fun n => (equivShrink Condition).symm (seq n) + have typedDecreasing : Antitone typed := fun _ _ less => decreasing less + have lowerDecreasing : Antitone (fun n => smallRestrict (seq n)) := + fun _ _ less => (smallRestrict).monotone (decreasing less) + obtain ⟨lowerGround, dataGround⟩ := M.stageTwoSequence_projections_ground c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F rows hI0 nodeOrder (M.omega_mem separation infinite) seq whole + obtain ⟨q, below⟩ := closed (fun n => smallRestrict (seq n)) lowerGround lowerDecreasing + have hJ := M.stageOneAssignments_mem pairing unions powers separation + (M.binary_union_mem pairing unions hI0 indices.index_ground) hT + have smallRaw := M.groundSmallSubset_union_mem pairing unions powers separation infinite choice + hJ (fun n => data (seq n)) dataGround + have small : stageOneAssignmentUnion (fun n => (typed n).assignments) ∈ B := by + simpa only [M.stageTwoConditionData_raw] using smallRaw + let lower : Condition := StageTwoCondition.chainUnion M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + F first second infinite choice hI0 indices.index_ground typed typedDecreasing q below small + refine ⟨q, below, equivShrink Condition lower, ?_, ?_, ?_⟩ + · rw [Equiv.symm_apply_apply] + rfl + · rw [Equiv.symm_apply_apply] + rfl + · intro n + change (equivShrink Condition).symm (equivShrink Condition lower) ≤ typed n + rw [Equiv.symm_apply_apply] + exact StageTwoCondition.chainUnion_le M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system + F first second infinite choice hI0 indices.index_ground typed typedDecreasing q below small n + +include F first second infinite choice rows hI0 nodeOrder closed in +theorem stageTwoCondition_internally_closed : + letI := smallOrder + InternallyCountablyClosed M (pres) := by + let := smallOrder + intro seq whole decreasing + obtain ⟨_, _, q, _, _, below⟩ := M.stageTwoCondition_lower_bound c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order nodes hT indices base directed system + F first second infinite choice rows hI0 nodeOrder closed seq whole decreasing + exact ⟨q, below⟩ + +end TransitiveGround + +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageTwoClosureData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) : Prop where + projection_data : StageTwoProjectionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection + closed : + let prior := projection_data.carrier_data + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let next := prior.index_data.next + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + ∃ hNodes : nodes.carrier ∈ M.sets, + InternallyCountablyClosed M + (M.stageTwoConditionPresentation c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + hNodes prior.terms_ground next.indices base directed next.first) + +namespace TransitiveGround +variable (M : TransitiveGround.{u}) +variable (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) +variable (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + +theorem stageTwoClosureData + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (prior : StageTwoProjectionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection) + (rows : c.carrier ∈ M.sets) + (hI0 : M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid ∈ M.sets) + (nodeOrder : nodes.conditionOrder ∈ M.sets) + (infinite : Realize M.sets infinity Fin.elim0) + (choice : Realize M.sets SetFormula.choice Fin.elim0) + (lowerClosed : InternallyCountablyClosed M s) : + StageTwoClosureData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection := by + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let data := prior.carrier_data + let next := data.index_data.next + obtain ⟨F, hNodes, _⟩ := prior.projections + refine ⟨prior, hNodes, ?_⟩ + exact M.stageTwoCondition_internally_closed c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection data.lower_carrier_ground data.lower_order_ground + hNodes data.terms_ground next.indices base directed next.first F prior.first_level next.indices.levelCode + infinite choice rows hI0 nodeOrder lowerClosed + +end TransitiveGround + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoSupportData.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoSupportData.lean index 85f591c5876eded27f70cdf16d2bc1c5317b71c3..406355e2c182245b73d76bd83ca13dc18a02397d 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoSupportData.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/StageTwoSupportData.lean @@ -1,497 +1,497 @@ -import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleSupports -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageThreeDataBoundFixation -import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNamePositionSupports - -namespace OAI - -open scoped ZFSet - -namespace PartitionPilot.Forcing - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L : Type u} [Preorder L] (b : Presentation L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -include pairing unions powers separation infinite choice - -theorem exists_stageOneDataBound {A I T S mu X anchors tuples used extra : ZFSet.{u}} - (hA : A ∈ M.sets) (nodes : b.carrier ∈ M.sets) - (whole : stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples ∈ M.sets) - (smallA : M.groundEmbeddable A ZFSet.omega) - (total : ∀ z ∈ A, ∃ E ∈ b.carrier, ZFSet.pair z E ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) - (hUsed : used ∈ M.sets) (hExtra : extra ∈ M.sets) - (usedSubset : used ⊆ b.carrier) (extraSubset : extra ⊆ b.carrier) - (smallUsed : M.groundEmbeddable used ZFSet.omega) - (smallExtra : M.groundEmbeddable extra ZFSet.omega) - (countable_bound : ∀ W ∈ M.sets, W ⊆ b.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, b.encode x ∈ W → x ≤ D) : - ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, - ZFSet.IsFunc A b.carrier f ∧ - f ⊆ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples ∧ - W = (relationImage A b.carrier f ∪ used) ∪ extra ∧ - W ⊆ b.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ - (∀ x : L, b.encode x ∈ W → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ - stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) ∧ - (∀ x : L, b.encode x ∈ used → x ≤ D) ∧ - (∀ x : L, b.encode x ∈ extra → x ≤ D) := by - obtain ⟨f,hf,W,hW,function,selected,equal,subset,small,included,usedIn,extraIn⟩ := - M.exists_countableNodeSelection pairing unions powers separation infinite choice - hA nodes whole smallA total hUsed hExtra usedSubset extraSubset smallUsed smallExtra - obtain ⟨D,bound⟩ := countable_bound W hW subset small - refine ⟨D,f,hf,W,hW,function,selected,equal,subset,small,bound,?_,?_,?_⟩ - · intro z hz - obtain ⟨E,entry,_⟩ := function.2 z hz - have hE := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 - obtain ⟨E,rfl⟩ := (b.mem_carrier E).1 hE - exact stageOneDataBounds_mono b (selected entry) (bound E (included z (b.encode E) entry)) - · intro x hx - exact bound x (usedIn hx) - · intro x hx - exact bound x (extraIn hx) - -end TransitiveGround - -section -open SetFormula SetRealization -universe u - -theorem refinementIndexFieldGraph_three_union (I0 I1 I2 B : ZFSet.{u}) (j : Fin 6) : - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) B j = - (refinementIndexFieldGraph I0 B j ∪ refinementIndexFieldGraph I1 B j) ∪ - refinementIndexFieldGraph I2 B j := by - rw [refinementIndexFieldGraph_union, refinementIndexFieldGraph_union] - -theorem refinementIndexAnchor_three_entry {L : Type u} (b : Presentation L) - (I0 I1 I2 level : ZFSet.{u}) (C E : L) (U Rf Rc y : ZFSet.{u}) : - ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) y ∈ - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2 ↔ - refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc ∈ (I0 ∪ I1) ∪ I2 ∧ - y = b.encode E := - refinementIndexAnchor_union_entry b (I0 ∪ I1) I2 level C E U Rf Rc y - -namespace NiceRefinementIndexSystem -variable {M : TransitiveGround.{u}} {G P0 P1 P2 L : Type u} -variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] -variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] -variable {a0 : PosetAction G P0} {a1 : PosetAction G P1} {a2 : PosetAction G P2} -variable {s0 : Presentation P0} {s1 : Presentation P1} {s2 : Presentation P2} -variable {b : Presentation L} {d : PosetAction G L} -variable {level0 level1 level2 T T2 : ZFSet.{u}} -variable {v0 : ∀ z ∈ T, IsName s0 z} {v02 : ∀ z ∈ T2, IsName s0 z} -variable {v1 : ∀ z ∈ T, IsName s1 z} {v12 : ∀ z ∈ T2, IsName s1 z} -variable {v2 : ∀ z ∈ T, IsName s2 z} {v22 : ∀ z ∈ T2, IsName s2 z} -local notation "I0" => M.niceRefinementIndices a0 s0 b d level0 T T2 v0 -local notation "I1" => M.niceRefinementIndices a1 s1 b d level1 T T2 v1 -local notation "I2" => M.niceRefinementIndices a2 s2 b d level2 T T2 v2 - -theorem three_anchor_data - (first : NiceRefinementIndexSystem M a0 s0 b d level0 T T2 v0 v02) - (second : NiceRefinementIndexSystem M a1 s1 b d level1 T T2 v1 v12) - (third : NiceRefinementIndexSystem M a2 s2 b d level2 T T2 v2 v22) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (nodes : b.carrier ∈ M.sets) : - (I0 ∪ I1) ∪ I2 ∈ M.sets ∧ - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2 ∈ M.sets ∧ - ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) b.carrier - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2) ∧ - refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2 = - (refinementIndexFieldGraph I0 b.carrier 2 ∪ refinementIndexFieldGraph I1 b.carrier 2) ∪ - refinementIndexFieldGraph I2 b.carrier 2 := by - obtain ⟨oldGround, _, oldFunction, _⟩ := - first.union_anchor_data second pairing unions powers separation nodes - have ground := M.binary_union_mem pairing unions oldGround third.index_ground - refine ⟨ground, M.refinementIndexFieldGraph_mem pairing unions powers separation ground nodes 2, - refinementIndexFieldGraph_function_union 2 oldFunction ?_, - refinementIndexFieldGraph_three_union I0 I1 I2 b.carrier 2⟩ - apply refinementIndexFieldGraph_function - intro z hz - obtain ⟨C, E, U, Rf, Rc, equal⟩ := third.decoded z hz - exact ⟨![level2, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val], equal, b.encode_mem E⟩ - -end NiceRefinementIndexSystem - -end - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] -variable (s : Presentation L) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include pairing unions powers separation collection infinite choice hL order hC directed countable_bound - -theorem binaryRowStageOneDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (I anchors : ZFSet.{u}), - I ∈ M.sets → anchors ∈ M.sets → ZFSet.IsFunc I s.carrier anchors → - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - A ∈ M.groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega → - ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → - M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ - (∀ x : L, s.encode x ∈ extra → x ≤ D) := by - intro c rows S T valid lifted tuples hLifted I anchors hI hAnchors anchorFunction p A member extra hExtra extraSubset smallExtra - have nonbottom := M.nonbottom_carrier_mem s separation hL - have hS := M.rowPositionSequences_mem pairing unions powers separation hL order nonbottom hmu - have hTuples := M.binaryLiftedRowTupleFamily_mem pairing unions powers separation collection infinite - hL order nonbottom hC hmu one valid - obtain ⟨hA,subset,smallA⟩ := (M.mem_groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega A).1 member - have whole := M.stageOneDataBounds_mem pairing unions powers separation hA hI hLifted hS hL - hmu nonbottom order hAnchors hTuples - have total := stageOneDataBounds_total s directed subset anchorFunction - (liftedRowTupleFamily_surjective c (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) - (fun f hf => by - obtain ⟨D,hD,bound⟩ := M.rowPositionSequence_bound hf - obtain ⟨D,rfl⟩ := (s.mem_carrier D).1 hD - exact ⟨D,bound⟩) - obtain ⟨hUsed,smallUsed⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation - infinite choice nonbottom hC (M.natSetCode_mem separation infinite 2) (SetMembers.raw_mem p) - have usedSubset : rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) ⊆ s.carrier := by - intro x hx - exact ((s.mem_nonbottom_carrier x).1 (rowUsedRows_subset _ _ _ _ hx)).1 - obtain ⟨D,_,_,_,_,_,_,_,_,_,_,bounds,usedBound,extraBound⟩ := - M.exists_stageOneDataBound s pairing unions powers separation infinite choice hA hL whole smallA total - hUsed hExtra usedSubset extraSubset smallUsed smallExtra countable_bound - exact ⟨D,usedBound,bounds,extraBound⟩ - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G P Q : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] -variable (s : Presentation L) (C : ZFSet.{u}) -variable (e : PosetAction G P) (t : Presentation P) -variable (e2 : PosetAction G Q) (t2 : Presentation Q) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include pairing unions powers separation collection infinite choice hL order hC directed countable_bound - -theorem binaryRowStageThreeDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (a : PosetAction G (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) (T2 : ZFSet.{u}) - (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ T2, IsName c.pairEmpty z) - (valid1 : ∀ z ∈ lifted, IsName t z) (valid12 : ∀ z ∈ T2, IsName t z) - (valid2 : ∀ z ∈ lifted, IsName t2 z) (valid22 : ∀ z ∈ T2, IsName t2 z) - (_first : NiceRefinementIndexSystem M a c.pairEmpty s d ∅ lifted T2 valid0 valid02) - (_second : NiceRefinementIndexSystem M e t s d (natSetCode 1) lifted T2 valid1 valid12) - (_third : NiceRefinementIndexSystem M e2 t2 s d (natSetCode 2) lifted T2 valid2 valid22), - let I0 := M.niceRefinementIndices a c.pairEmpty s d ∅ lifted T2 valid0 - let I1 := M.niceRefinementIndices e t s d (natSetCode 1) lifted T2 valid1 - let I2 := M.niceRefinementIndices e2 t2 s d (natSetCode 2) lifted T2 valid2 - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - A ∈ M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) lifted) ZFSet.omega → - ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → - M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A ((I0 ∪ I1) ∪ I2) lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) s.carrier 2) tuples) ∧ - (∀ x : L, s.encode x ∈ extra → x ≤ D) := by - let instSmallFunctionOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let instSmallFunctionTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro c rows S T valid lifted tuples hLifted a T2 valid0 valid02 valid1 valid12 valid2 valid22 first second third I0 I1 I2 - p A member extra hExtra extraSubset extraSmall - obtain ⟨indexGround, anchorGround, anchorFunction, _⟩ := - first.three_anchor_data second third pairing unions powers separation hL - exact M.binaryRowStageOneDataBound s C pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu one valid hLifted ((I0 ∪ I1) ∪ I2) - (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) s.carrier 2) indexGround anchorGround anchorFunction - p A member extra hExtra extraSubset extraSmall - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] [PartialOrder P] [OrderTop P] -variable (s : Presentation L) (C : ZFSet.{u}) -variable (e : PosetAction G P) (t : Presentation P) (d : PosetAction G L) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include pairing unions powers separation collection infinite choice hL order hC directed countable_bound - -theorem binaryRowStageTwoDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (one : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C one - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier - (⋃₀ ⋃₀ rows) rows S valid - ∀ (_hLifted : lifted ∈ M.sets) (a : PosetAction G (SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) (T2 : ZFSet.{u}) - (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ T2, IsName c.pairEmpty z) - (valid1 : ∀ z ∈ lifted, IsName t z) (valid12 : ∀ z ∈ T2, IsName t z) - (_first : NiceRefinementIndexSystem M a c.pairEmpty s d ∅ lifted T2 valid0 valid02) - (_second : NiceRefinementIndexSystem M e t s d (natSetCode 1) lifted T2 valid1 valid12), - let I0 := M.niceRefinementIndices a c.pairEmpty s d ∅ lifted T2 valid0 - let I1 := M.niceRefinementIndices e t s d (natSetCode 1) lifted T2 valid1 - ∀ (p : SetMembers (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), - A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) lifted) ZFSet.omega → - ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → - M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, - (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ - (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ - stageOneDataBounds A (I0 ∪ I1) lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder - (refinementIndexFieldGraph (I0 ∪ I1) s.carrier 2) tuples) ∧ - (∀ x : L, s.encode x ∈ extra → x ≤ D) := by - let instSmallFunctionOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let instSmallFunctionTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro c rows S T valid lifted tuples hLifted a T2 valid0 valid02 valid1 valid12 first second I0 I1 - p A member extra hExtra extraSubset extraSmall - obtain ⟨indexGround, anchorGround, anchorFunction, _⟩ := - first.union_anchor_data second pairing unions powers separation hL - exact M.binaryRowStageOneDataBound s C pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu one valid hLifted (I0 ∪ I1) - (refinementIndexFieldGraph (I0 ∪ I1) s.carrier 2) indexGround anchorGround anchorFunction - p A member extra hExtra extraSubset extraSmall - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {G R P L : Type u} -variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] -variable (c : Presentation R) (I0 : ZFSet.{u}) -variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) -variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) -variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (system : NiceNameSystem M a s b d base directed T valid) -local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid - pairing unions powers separation collection carrier order hT base directed system -local notation "I" => I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid - -structure StageTwoPositionSupport (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) - (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where - bounds : letI := smallOrder - ∀ (q : Shrink Condition) (extra : ZFSet.{u}), - extra ∈ M.sets → extra ⊆ b.carrier → M.groundEmbeddable extra ZFSet.omega → - ∃ D : L, - (∀ x : L, b.encode x ∈ used ((equivShrink Condition).symm q).row → x ≤ D) ∧ - (∀ z ∈ ((equivShrink Condition).symm q).assignments, - ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments - I T S b.carrier mu X b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) ∧ - (∀ x : L, b.encode x ∈ extra → x ≤ D) ∧ - (∀ g ∈ d.principalFix D, action.iso g q = q) - -end TransitiveGround - -namespace TransitiveGround -open SetRealization SetFormula -universe u -variable (M : TransitiveGround.{u}) {L G P : Type u} -variable [PartialOrder L] [OrderBot L] [Group G] [PartialOrder P] [OrderTop P] -variable (e : PosetAction G P) (t : Presentation P) -variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) -variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) -variable (unions : Realize M.sets SetFormula.union Fin.elim0) -variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) -variable (collection : CollectionSchema M.sets) -variable (infinite : Realize M.sets infinity Fin.elim0) -variable (choice : Realize M.sets SetFormula.choice Fin.elim0) -variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) -variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) -variable (graph : a.actionGraph s b ∈ M.sets) -variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) -variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → - ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) -include order choice countable_bound - -theorem binaryRowStageTwoPositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) - (ordinal : ordinalSetProperty mu) : - letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph - let c := SetMembers.presentation (M.smallPartialFunctions - (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) - let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ - let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu - let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S - ∀ valid : ∀ z ∈ T, IsName c z, - let lifted := Name.renamedFamily c.pairEmpty id T valid - let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted - let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid - ∀ (hLifted : lifted ∈ M.sets) - (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ squared, IsName c.pairEmpty z) - (valid1 : ∀ z ∈ lifted, IsName t z) (valid12 : ∀ z ∈ squared, IsName t z) - (_indices0 : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid0 valid02) - (_indices1 : NiceRefinementIndexSystem M e t s a (natSetCode 1) lifted squared valid1 valid12) - (_params0 : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid0) - (_params1 : StageOneActionParameters M e t b s a lifted squared valid1) - (system1 : NiceNameSystem M e t s a ⊥ directed lifted valid1) - (carrier1 : t.carrier ∈ M.sets) (order1 : t.conditionOrder ∈ M.sets), - let I0 := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid0 - let image := M.stageTwoAssignmentImage act c.pairEmpty e t s a lifted squared valid0 valid02 valid1 valid12 - ∀ inputs : StageTwoConditionActionInputs M c I0 e t s a lifted squared valid1 - pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 act image, - (∀ (D : L), ∀ f ∈ S, ∀ u : Name t, ZFSet.pair f u.val ∈ tuples → - RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → - a.principalFix D ≤ e.stabilizer t u) → - StageTwoPositionSupport M c I0 e t s a lifted squared valid1 - pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 - S mu s.nonbottom.carrier tuples - (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) - (M.stageTwoSmallAction c I0 e t s a lifted squared valid1 - pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 act image inputs) := by - let instSmallFunctionOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - let instSmallFunctionTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega - ⟨s.carrier, hL⟩ - intro act c rows S T valid lifted squared tuples hLifted valid0 valid02 valid1 valid12 - indices0 indices1 params0 params1 system1 carrier1 order1 I0 image inputs support1 - let instStageTwoConditionSmallOrder := M.stageTwoConditionSmallOrder c I0 e t s a lifted squared valid1 - pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 - refine ⟨?_⟩ - intro q extra hExtra extraSubset extraSmall - let p := (equivShrink _).symm q - obtain ⟨D, rowBound, dataBound, extraBound⟩ := - M.binaryRowStageTwoDataBound s C e t a pairing unions powers separation collection infinite choice - hL order hC directed countable_bound hmu ⊤ valid hLifted act squared valid0 valid02 valid1 valid12 - indices0 indices1 p.row p.assignments p.assignments_mem extra hExtra extraSubset extraSmall - refine ⟨D, rowBound, dataBound, extraBound, ?_⟩ - intro g actor - have coordinates := M.prod_mem pairing unions powers separation - (M.nonbottom_carrier_mem s separation hL) hC - have two := M.natSetCode_mem separation infinite 2 - have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two - have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two - apply M.stageTwoSmallAction_fixed_of_dataBound act c.pairEmpty c e t s a lifted squared - valid0 valid02 valid1 valid12 b pairing unions powers separation collection - (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) - (M.pairEmpty_order_mem pairing unions powers separation c carrier forcingOrder) - carrier1 order1 params0 params1 hLifted ⊥ directed system1 indices0.levelCode indices1.levelCode inputs - S mu s.nonbottom.carrier tuples D - (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation - infinite hL hC hG graph hmu ordinal valid f u D entry bound.2) - (support1 D) g actor q - · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite - hL hC hG graph g p.row D (fun i used => rowBound i.val used) actor - · exact dataBound - -end TransitiveGround - -open SetRealization SetFormula -universe u -variable {G R P L : Type u} [Group G] -variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] - -structure StageTwoSupportData (M : TransitiveGround.{u}) - (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) - (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) - (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) - (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) - (pairing : Realize M.sets SetFormula.pairing Fin.elim0) - (unions : Realize M.sets SetFormula.union Fin.elim0) - (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) - (collection : CollectionSchema M.sets) - (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where - action_data : StageTwoActionData M a c e s actors nodes d base directed T T2 valid - pairing unions powers separation collection - support : - let prior := action_data.closure_data.projection_data.carrier_data - let next := prior.index_data.next - let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid - let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 - valid action_data.valid2 next.valid1 next.valid2 - letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first - ∀ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image, - TransitiveGround.StageTwoPositionSupport M c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first S mu X tuples used - (M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 - pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground - prior.terms_ground base directed next.first a image inputs) - -end PartitionPilot.Forcing - -end OAI +import OAI.SetTheory.PartitionPrinciple.Definability.GroundLiftedRowTupleSupports +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageThreeDataBoundFixation +import OAI.SetTheory.PartitionPrinciple.Forcing.GroundStageTwoNamePositionSupports + +namespace OAI + +open scoped ZFSet + +namespace PartitionPilot.Forcing + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L : Type u} [Preorder L] (b : Presentation L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (infinite : Realize M.sets SetFormula.infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +include pairing unions powers separation infinite choice + +theorem exists_stageOneDataBound {A I T S mu X anchors tuples used extra : ZFSet.{u}} + (hA : A ∈ M.sets) (nodes : b.carrier ∈ M.sets) + (whole : stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples ∈ M.sets) + (smallA : M.groundEmbeddable A ZFSet.omega) + (total : ∀ z ∈ A, ∃ E ∈ b.carrier, ZFSet.pair z E ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) + (hUsed : used ∈ M.sets) (hExtra : extra ∈ M.sets) + (usedSubset : used ⊆ b.carrier) (extraSubset : extra ⊆ b.carrier) + (smallUsed : M.groundEmbeddable used ZFSet.omega) + (smallExtra : M.groundEmbeddable extra ZFSet.omega) + (countable_bound : ∀ W ∈ M.sets, W ⊆ b.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, b.encode x ∈ W → x ≤ D) : + ∃ D : L, ∃ f ∈ M.sets, ∃ W ∈ M.sets, + ZFSet.IsFunc A b.carrier f ∧ + f ⊆ stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples ∧ + W = (relationImage A b.carrier f ∪ used) ∪ extra ∧ + W ⊆ b.carrier ∧ M.groundEmbeddable W ZFSet.omega ∧ + (∀ x : L, b.encode x ∈ W → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (b.encode D) ∈ + stageOneDataBounds A I T S b.carrier mu X b.conditionOrder anchors tuples) ∧ + (∀ x : L, b.encode x ∈ used → x ≤ D) ∧ + (∀ x : L, b.encode x ∈ extra → x ≤ D) := by + obtain ⟨f,hf,W,hW,function,selected,equal,subset,small,included,usedIn,extraIn⟩ := + M.exists_countableNodeSelection pairing unions powers separation infinite choice + hA nodes whole smallA total hUsed hExtra usedSubset extraSubset smallUsed smallExtra + obtain ⟨D,bound⟩ := countable_bound W hW subset small + refine ⟨D,f,hf,W,hW,function,selected,equal,subset,small,bound,?_,?_,?_⟩ + · intro z hz + obtain ⟨E,entry,_⟩ := function.2 z hz + have hE := (ZFSet.pair_mem_prod.1 (function.1 entry)).2 + obtain ⟨E,rfl⟩ := (b.mem_carrier E).1 hE + exact stageOneDataBounds_mono b (selected entry) (bound E (included z (b.encode E) entry)) + · intro x hx + exact bound x (usedIn hx) + · intro x hx + exact bound x (extraIn hx) + +end TransitiveGround + +section +open SetFormula SetRealization +universe u + +theorem refinementIndexFieldGraph_three_union (I0 I1 I2 B : ZFSet.{u}) (j : Fin 6) : + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) B j = + (refinementIndexFieldGraph I0 B j ∪ refinementIndexFieldGraph I1 B j) ∪ + refinementIndexFieldGraph I2 B j := by + rw [refinementIndexFieldGraph_union, refinementIndexFieldGraph_union] + +theorem refinementIndexAnchor_three_entry {L : Type u} (b : Presentation L) + (I0 I1 I2 level : ZFSet.{u}) (C E : L) (U Rf Rc y : ZFSet.{u}) : + ZFSet.pair (refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc) y ∈ + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2 ↔ + refinementIndexCode level (b.encode C) (b.encode E) U Rf Rc ∈ (I0 ∪ I1) ∪ I2 ∧ + y = b.encode E := + refinementIndexAnchor_union_entry b (I0 ∪ I1) I2 level C E U Rf Rc y + +namespace NiceRefinementIndexSystem +variable {M : TransitiveGround.{u}} {G P0 P1 P2 L : Type u} +variable [Group G] [PartialOrder P0] [OrderTop P0] [PartialOrder P1] [OrderTop P1] +variable [PartialOrder P2] [OrderTop P2] [PartialOrder L] +variable {a0 : PosetAction G P0} {a1 : PosetAction G P1} {a2 : PosetAction G P2} +variable {s0 : Presentation P0} {s1 : Presentation P1} {s2 : Presentation P2} +variable {b : Presentation L} {d : PosetAction G L} +variable {level0 level1 level2 T T2 : ZFSet.{u}} +variable {v0 : ∀ z ∈ T, IsName s0 z} {v02 : ∀ z ∈ T2, IsName s0 z} +variable {v1 : ∀ z ∈ T, IsName s1 z} {v12 : ∀ z ∈ T2, IsName s1 z} +variable {v2 : ∀ z ∈ T, IsName s2 z} {v22 : ∀ z ∈ T2, IsName s2 z} +local notation "I0" => M.niceRefinementIndices a0 s0 b d level0 T T2 v0 +local notation "I1" => M.niceRefinementIndices a1 s1 b d level1 T T2 v1 +local notation "I2" => M.niceRefinementIndices a2 s2 b d level2 T T2 v2 + +theorem three_anchor_data + (first : NiceRefinementIndexSystem M a0 s0 b d level0 T T2 v0 v02) + (second : NiceRefinementIndexSystem M a1 s1 b d level1 T T2 v1 v12) + (third : NiceRefinementIndexSystem M a2 s2 b d level2 T T2 v2 v22) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (nodes : b.carrier ∈ M.sets) : + (I0 ∪ I1) ∪ I2 ∈ M.sets ∧ + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2 ∈ M.sets ∧ + ZFSet.IsFunc ((I0 ∪ I1) ∪ I2) b.carrier + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2) ∧ + refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) b.carrier 2 = + (refinementIndexFieldGraph I0 b.carrier 2 ∪ refinementIndexFieldGraph I1 b.carrier 2) ∪ + refinementIndexFieldGraph I2 b.carrier 2 := by + obtain ⟨oldGround, _, oldFunction, _⟩ := + first.union_anchor_data second pairing unions powers separation nodes + have ground := M.binary_union_mem pairing unions oldGround third.index_ground + refine ⟨ground, M.refinementIndexFieldGraph_mem pairing unions powers separation ground nodes 2, + refinementIndexFieldGraph_function_union 2 oldFunction ?_, + refinementIndexFieldGraph_three_union I0 I1 I2 b.carrier 2⟩ + apply refinementIndexFieldGraph_function + intro z hz + obtain ⟨C, E, U, Rf, Rc, equal⟩ := third.decoded z hz + exact ⟨![level2, b.encode C, b.encode E, U.val.val, Rf.val.val, Rc.val.val], equal, b.encode_mem E⟩ + +end NiceRefinementIndexSystem + +end + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L : Type u} [PartialOrder L] [OrderBot L] +variable (s : Presentation L) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include pairing unions powers separation collection infinite choice hL order hC directed countable_bound + +theorem binaryRowStageOneDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (I anchors : ZFSet.{u}), + I ∈ M.sets → anchors ∈ M.sets → ZFSet.IsFunc I s.carrier anchors → + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + A ∈ M.groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega → + ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → + M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A I lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder anchors tuples) ∧ + (∀ x : L, s.encode x ∈ extra → x ≤ D) := by + intro c rows S T valid lifted tuples hLifted I anchors hI hAnchors anchorFunction p A member extra hExtra extraSubset smallExtra + have nonbottom := M.nonbottom_carrier_mem s separation hL + have hS := M.rowPositionSequences_mem pairing unions powers separation hL order nonbottom hmu + have hTuples := M.binaryLiftedRowTupleFamily_mem pairing unions powers separation collection infinite + hL order nonbottom hC hmu one valid + obtain ⟨hA,subset,smallA⟩ := (M.mem_groundSmallSubsets (stageOneAssignments I lifted) ZFSet.omega A).1 member + have whole := M.stageOneDataBounds_mem pairing unions powers separation hA hI hLifted hS hL + hmu nonbottom order hAnchors hTuples + have total := stageOneDataBounds_total s directed subset anchorFunction + (liftedRowTupleFamily_surjective c (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid) + (fun f hf => by + obtain ⟨D,hD,bound⟩ := M.rowPositionSequence_bound hf + obtain ⟨D,rfl⟩ := (s.mem_carrier D).1 hD + exact ⟨D,bound⟩) + obtain ⟨hUsed,smallUsed⟩ := M.countablePartialFunctions_rowSupport pairing unions powers separation + infinite choice nonbottom hC (M.natSetCode_mem separation infinite 2) (SetMembers.raw_mem p) + have usedSubset : rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) ⊆ s.carrier := by + intro x hx + exact ((s.mem_nonbottom_carrier x).1 (rowUsedRows_subset _ _ _ _ hx)).1 + obtain ⟨D,_,_,_,_,_,_,_,_,_,_,bounds,usedBound,extraBound⟩ := + M.exists_stageOneDataBound s pairing unions powers separation infinite choice hA hL whole smallA total + hUsed hExtra usedSubset extraSubset smallUsed smallExtra countable_bound + exact ⟨D,usedBound,bounds,extraBound⟩ + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G P Q : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] [PartialOrder P] [OrderTop P] [PartialOrder Q] [OrderTop Q] +variable (s : Presentation L) (C : ZFSet.{u}) +variable (e : PosetAction G P) (t : Presentation P) +variable (e2 : PosetAction G Q) (t2 : Presentation Q) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include pairing unions powers separation collection infinite choice hL order hC directed countable_bound + +theorem binaryRowStageThreeDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (a : PosetAction G (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) (T2 : ZFSet.{u}) + (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ T2, IsName c.pairEmpty z) + (valid1 : ∀ z ∈ lifted, IsName t z) (valid12 : ∀ z ∈ T2, IsName t z) + (valid2 : ∀ z ∈ lifted, IsName t2 z) (valid22 : ∀ z ∈ T2, IsName t2 z) + (_first : NiceRefinementIndexSystem M a c.pairEmpty s d ∅ lifted T2 valid0 valid02) + (_second : NiceRefinementIndexSystem M e t s d (natSetCode 1) lifted T2 valid1 valid12) + (_third : NiceRefinementIndexSystem M e2 t2 s d (natSetCode 2) lifted T2 valid2 valid22), + let I0 := M.niceRefinementIndices a c.pairEmpty s d ∅ lifted T2 valid0 + let I1 := M.niceRefinementIndices e t s d (natSetCode 1) lifted T2 valid1 + let I2 := M.niceRefinementIndices e2 t2 s d (natSetCode 2) lifted T2 valid2 + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + A ∈ M.groundSmallSubsets (stageOneAssignments ((I0 ∪ I1) ∪ I2) lifted) ZFSet.omega → + ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → + M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A ((I0 ∪ I1) ∪ I2) lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) s.carrier 2) tuples) ∧ + (∀ x : L, s.encode x ∈ extra → x ≤ D) := by + let instSmallFunctionOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let instSmallFunctionTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro c rows S T valid lifted tuples hLifted a T2 valid0 valid02 valid1 valid12 valid2 valid22 first second third I0 I1 I2 + p A member extra hExtra extraSubset extraSmall + obtain ⟨indexGround, anchorGround, anchorFunction, _⟩ := + first.three_anchor_data second third pairing unions powers separation hL + exact M.binaryRowStageOneDataBound s C pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu one valid hLifted ((I0 ∪ I1) ∪ I2) + (refinementIndexFieldGraph ((I0 ∪ I1) ∪ I2) s.carrier 2) indexGround anchorGround anchorFunction + p A member extra hExtra extraSubset extraSmall + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] [PartialOrder P] [OrderTop P] +variable (s : Presentation L) (C : ZFSet.{u}) +variable (e : PosetAction G P) (t : Presentation P) (d : PosetAction G L) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hC : C ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include pairing unions powers separation collection infinite choice hL order hC directed countable_bound + +theorem binaryRowStageTwoDataBound {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (one : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C one + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode one) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let tuples := liftedRowTupleFamily c (c.encode one) mu s.nonbottom.carrier + (⋃₀ ⋃₀ rows) rows S valid + ∀ (_hLifted : lifted ∈ M.sets) (a : PosetAction G (SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega))) (T2 : ZFSet.{u}) + (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ T2, IsName c.pairEmpty z) + (valid1 : ∀ z ∈ lifted, IsName t z) (valid12 : ∀ z ∈ T2, IsName t z) + (_first : NiceRefinementIndexSystem M a c.pairEmpty s d ∅ lifted T2 valid0 valid02) + (_second : NiceRefinementIndexSystem M e t s d (natSetCode 1) lifted T2 valid1 valid12), + let I0 := M.niceRefinementIndices a c.pairEmpty s d ∅ lifted T2 valid0 + let I1 := M.niceRefinementIndices e t s d (natSetCode 1) lifted T2 valid1 + ∀ (p : SetMembers (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega)) (A : ZFSet.{u}), + A ∈ M.groundSmallSubsets (stageOneAssignments (I0 ∪ I1) lifted) ZFSet.omega → + ∀ (extra : ZFSet.{u}), extra ∈ M.sets → extra ⊆ s.carrier → + M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, + (∀ x : L, s.encode x ∈ rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p) → x ≤ D) ∧ + (∀ z ∈ A, ZFSet.pair z (s.encode D) ∈ + stageOneDataBounds A (I0 ∪ I1) lifted S s.carrier mu s.nonbottom.carrier s.conditionOrder + (refinementIndexFieldGraph (I0 ∪ I1) s.carrier 2) tuples) ∧ + (∀ x : L, s.encode x ∈ extra → x ≤ D) := by + let instSmallFunctionOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let instSmallFunctionTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro c rows S T valid lifted tuples hLifted a T2 valid0 valid02 valid1 valid12 first second I0 I1 + p A member extra hExtra extraSubset extraSmall + obtain ⟨indexGround, anchorGround, anchorFunction, _⟩ := + first.union_anchor_data second pairing unions powers separation hL + exact M.binaryRowStageOneDataBound s C pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu one valid hLifted (I0 ∪ I1) + (refinementIndexFieldGraph (I0 ∪ I1) s.carrier 2) indexGround anchorGround anchorFunction + p A member extra hExtra extraSubset extraSmall + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {G R P L : Type u} +variable [Group G] [PartialOrder R] [PartialOrder P] [OrderTop P] [PartialOrder L] +variable (c : Presentation R) (I0 : ZFSet.{u}) +variable (a : PosetAction G P) (s : Presentation P) (b : Presentation L) (d : PosetAction G L) +variable (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName s z) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (carrier : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) (hT : T ∈ M.sets) +variable (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (system : NiceNameSystem M a s b d base directed T valid) +local notation "Condition" => StageTwoCondition M c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "smallOrder" => M.stageTwoConditionSmallOrder c I0 a s b d T T2 valid + pairing unions powers separation collection carrier order hT base directed system +local notation "I" => I0 ∪ M.niceRefinementIndices a s b d (natSetCode 1) T T2 valid + +structure StageTwoPositionSupport (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) + (action : letI := smallOrder; PosetAction G (Shrink Condition)) : Prop where + bounds : letI := smallOrder + ∀ (q : Shrink Condition) (extra : ZFSet.{u}), + extra ∈ M.sets → extra ⊆ b.carrier → M.groundEmbeddable extra ZFSet.omega → + ∃ D : L, + (∀ x : L, b.encode x ∈ used ((equivShrink Condition).symm q).row → x ≤ D) ∧ + (∀ z ∈ ((equivShrink Condition).symm q).assignments, + ZFSet.pair z (b.encode D) ∈ stageOneDataBounds ((equivShrink Condition).symm q).assignments + I T S b.carrier mu X b.conditionOrder (refinementIndexFieldGraph I b.carrier 2) tuples) ∧ + (∀ x : L, b.encode x ∈ extra → x ≤ D) ∧ + (∀ g ∈ d.principalFix D, action.iso g q = q) + +end TransitiveGround + +namespace TransitiveGround +open SetRealization SetFormula +universe u +variable (M : TransitiveGround.{u}) {L G P : Type u} +variable [PartialOrder L] [OrderBot L] [Group G] [PartialOrder P] [OrderTop P] +variable (e : PosetAction G P) (t : Presentation P) +variable (a : PosetAction G L) (s : Presentation L) (b : Presentation G) (C : ZFSet.{u}) +variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0) +variable (unions : Realize M.sets SetFormula.union Fin.elim0) +variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) +variable (collection : CollectionSchema M.sets) +variable (infinite : Realize M.sets infinity Fin.elim0) +variable (choice : Realize M.sets SetFormula.choice Fin.elim0) +variable (hL : s.carrier ∈ M.sets) (order : s.conditionOrder ∈ M.sets) +variable (hC : C ∈ M.sets) (hG : b.carrier ∈ M.sets) +variable (graph : a.actionGraph s b ∈ M.sets) +variable (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) +variable (countable_bound : ∀ W ∈ M.sets, W ⊆ s.carrier → M.groundEmbeddable W ZFSet.omega → + ∃ D : L, ∀ x : L, s.encode x ∈ W → x ≤ D) +include order choice countable_bound + +theorem binaryRowStageTwoPositionSupport {mu : ZFSet.{u}} (hmu : mu ∈ M.sets) + (ordinal : ordinalSetProperty mu) : + letI := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + letI := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + let act := M.internalRowAction a s b C pairing unions powers separation infinite hL hC hG graph + let c := SetMembers.presentation (M.smallPartialFunctions + (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega) + let rows := M.binaryRowNameGraph s.nonbottom.carrier C ⊤ + let S := M.rowPositionSequences s.carrier s.conditionOrder s.nonbottom.carrier mu + let T := rowTupleTerms (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S + ∀ valid : ∀ z ∈ T, IsName c z, + let lifted := Name.renamedFamily c.pairEmpty id T valid + let squared := orderedPairNameFamily (c.pairEmpty.encode ⊤) lifted lifted + let tuples := liftedRowTupleFamily c (c.encode ⊤) mu s.nonbottom.carrier (⋃₀ ⋃₀ rows) rows S valid + ∀ (hLifted : lifted ∈ M.sets) + (valid0 : ∀ z ∈ lifted, IsName c.pairEmpty z) (valid02 : ∀ z ∈ squared, IsName c.pairEmpty z) + (valid1 : ∀ z ∈ lifted, IsName t z) (valid12 : ∀ z ∈ squared, IsName t z) + (_indices0 : NiceRefinementIndexSystem M act c.pairEmpty s a ∅ lifted squared valid0 valid02) + (_indices1 : NiceRefinementIndexSystem M e t s a (natSetCode 1) lifted squared valid1 valid12) + (_params0 : StageOneActionParameters M act c.pairEmpty b s a lifted squared valid0) + (_params1 : StageOneActionParameters M e t b s a lifted squared valid1) + (system1 : NiceNameSystem M e t s a ⊥ directed lifted valid1) + (carrier1 : t.carrier ∈ M.sets) (order1 : t.conditionOrder ∈ M.sets), + let I0 := M.niceRefinementIndices act c.pairEmpty s a ∅ lifted squared valid0 + let image := M.stageTwoAssignmentImage act c.pairEmpty e t s a lifted squared valid0 valid02 valid1 valid12 + ∀ inputs : StageTwoConditionActionInputs M c I0 e t s a lifted squared valid1 + pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 act image, + (∀ (D : L), ∀ f ∈ S, ∀ u : Name t, ZFSet.pair f u.val ∈ tuples → + RowPositionBound mu s.nonbottom.carrier s.conditionOrder f (s.encode D) → + a.principalFix D ≤ e.stabilizer t u) → + StageTwoPositionSupport M c I0 e t s a lifted squared valid1 + pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 + S mu s.nonbottom.carrier tuples + (fun p => rowUsedRows s.nonbottom.carrier C (natSetCode 2) (SetMembers.raw p)) + (M.stageTwoSmallAction c I0 e t s a lifted squared valid1 + pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 act image inputs) := by + let instSmallFunctionOrder := M.smallFunctionOrder (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + let instSmallFunctionTop := M.smallFunctionTop (ZFSet.prod s.nonbottom.carrier C) (natSetCode 2) ZFSet.omega + ⟨s.carrier, hL⟩ + intro act c rows S T valid lifted squared tuples hLifted valid0 valid02 valid1 valid12 + indices0 indices1 params0 params1 system1 carrier1 order1 I0 image inputs support1 + let instStageTwoConditionSmallOrder := M.stageTwoConditionSmallOrder c I0 e t s a lifted squared valid1 + pairing unions powers separation collection carrier1 order1 hLifted ⊥ directed system1 + refine ⟨?_⟩ + intro q extra hExtra extraSubset extraSmall + let p := (equivShrink _).symm q + obtain ⟨D, rowBound, dataBound, extraBound⟩ := + M.binaryRowStageTwoDataBound s C e t a pairing unions powers separation collection infinite choice + hL order hC directed countable_bound hmu ⊤ valid hLifted act squared valid0 valid02 valid1 valid12 + indices0 indices1 p.row p.assignments p.assignments_mem extra hExtra extraSubset extraSmall + refine ⟨D, rowBound, dataBound, extraBound, ?_⟩ + intro g actor + have coordinates := M.prod_mem pairing unions powers separation + (M.nonbottom_carrier_mem s separation hL) hC + have two := M.natSetCode_mem separation infinite 2 + have carrier := M.countablePartialFunctions_mem pairing unions powers separation infinite coordinates two + have forcingOrder := M.countableFunctionOrder_mem pairing unions powers separation infinite coordinates two + apply M.stageTwoSmallAction_fixed_of_dataBound act c.pairEmpty c e t s a lifted squared + valid0 valid02 valid1 valid12 b pairing unions powers separation collection + (M.pairEmpty_carrier_mem pairing unions powers separation c carrier) + (M.pairEmpty_order_mem pairing unions powers separation c carrier forcingOrder) + carrier1 order1 params0 params1 hLifted ⊥ directed system1 indices0.levelCode indices1.levelCode inputs + S mu s.nonbottom.carrier tuples D + (fun f _ u entry bound => M.liftedRowTuple_supported a s b C pairing unions powers separation + infinite hL hC hG graph hmu ordinal valid f u D entry bound.2) + (support1 D) g actor q + · exact M.internalRowAction_eq_of_principalFix a s b C pairing unions powers separation infinite + hL hC hG graph g p.row D (fun i used => rowBound i.val used) actor + · exact dataBound + +end TransitiveGround + +open SetRealization SetFormula +universe u +variable {G R P L : Type u} [Group G] +variable [PartialOrder R] [OrderTop R] [PartialOrder P] [OrderTop P] [PartialOrder L] + +structure StageTwoSupportData (M : TransitiveGround.{u}) + (a : PosetAction G R) (c : Presentation R) (e : PosetAction G P) (s : Presentation P) + (actors : Presentation G) (nodes : Presentation L) (d : PosetAction G L) + (base : L) (directed : ∀ x y : L, ∃ z, x ≤ z ∧ y ≤ z) + (T T2 : ZFSet.{u}) (valid : ∀ z ∈ T, IsName c.pairEmpty z) + (pairing : Realize M.sets SetFormula.pairing Fin.elim0) + (unions : Realize M.sets SetFormula.union Fin.elim0) + (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets) + (collection : CollectionSchema M.sets) + (S mu X tuples : ZFSet.{u}) (used : R → ZFSet.{u}) : Prop where + action_data : StageTwoActionData M a c e s actors nodes d base directed T T2 valid + pairing unions powers separation collection + support : + let prior := action_data.closure_data.projection_data.carrier_data + let next := prior.index_data.next + let I0 := M.niceRefinementIndices a c.pairEmpty nodes d ∅ T T2 valid + let image := M.stageTwoAssignmentImage a c.pairEmpty e s nodes d T T2 + valid action_data.valid2 next.valid1 next.valid2 + letI := M.stageTwoConditionSmallOrder c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first + ∀ inputs : StageTwoConditionActionInputs M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image, + TransitiveGround.StageTwoPositionSupport M c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first S mu X tuples used + (M.stageTwoSmallAction c I0 e s nodes d T T2 next.valid1 + pairing unions powers separation collection prior.lower_carrier_ground prior.lower_order_ground + prior.terms_ground base directed next.first a image inputs) + +end PartitionPilot.Forcing + +end OAI diff --git a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SuccessorBirths.lean b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SuccessorBirths.lean index 24de31c269e2ff972d5af02ac52a6432a7889e9e..a2a4d2b62a15c0ab68f824b78ab1b103efde395f 100644 --- a/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SuccessorBirths.lean +++ b/lean/OAI/SetTheory/PartitionPrinciple/Transfinite/SuccessorBirths.lean @@ -1,728 +1,728 @@ -import OAI.SetTheory.PartitionPrinciple.Forcing.LimitAction - -namespace OAI - - -namespace PartitionPilot.Compression.RecursiveMaps.CountableColumns - -open scoped Cardinal -universe u - -theorem initialSegment_countable (a : Column) : (Set.Iio a.val).Countable := by - have : Countable a.val.ToType := Cardinal.mk_le_aleph0_iff.mp (by - rw [Cardinal.mk_toType] - exact a.property) - exact (Ordinal.ToType.mk (o := a.val)).injective.countable - -theorem sequenceSup_countable (f : Nat → Column) : - (iSup (fun n => (f n).val)).card ≤ Cardinal.aleph0 := by - have same : Set.Iio (iSup (fun n => (f n).val)) = ⋃ n, Set.Iio (f n).val := by - ext a - simp only [Set.mem_Iio, Set.mem_iUnion, Ordinal.lt_iSup_iff] - have small : (Set.Iio (iSup (fun n => (f n).val))).Countable := by - rw [same] - exact Set.countable_iUnion (fun n => initialSegment_countable (f n)) - let := small.to_subtype - let : Countable (iSup (fun n => (f n).val)).ToType := - (Ordinal.ToType.mk (o := iSup (fun n => (f n).val))).symm.injective.countable - simpa only [Cardinal.mk_toType] using - (Cardinal.mk_le_aleph0 (α := (iSup (fun n => (f n).val)).ToType)) - -noncomputable def sequenceSup (f : Nat → Column) : Column := - ⟨iSup (fun n => (f n).val), sequenceSup_countable f⟩ - -theorem lt_start (a : Column) : order.lt a (start a) := by - change a.val < a.val + (1 : Nat) - rw [Nat.cast_one, ← Order.succ_eq_add_one] - exact Order.lt_succ _ - -noncomputable def upperBound {I : Type u} [Countable I] (f : I → Column) : Column := - start (sequenceSup (Set.enumerateCountable (Set.countable_range f) (natural 0))) - -theorem upperBound_above {I : Type u} [Countable I] (f : I → Column) (i : I) : - order.lt (f i) (upperBound f) := by - let seq := Set.enumerateCountable (Set.countable_range f) (natural 0) - have below : (f i).val ≤ (sequenceSup seq).val := by - rcases Set.subset_range_enumerate (Set.countable_range f) (natural 0) - (Set.mem_range_self i) with ⟨n, eq⟩ - change (f i).val ≤ iSup (fun n => (seq n).val) - rw [← eq] - exact Ordinal.le_iSup (fun n => (seq n).val) n - exact lt_of_le_of_lt below (lt_start (sequenceSup seq)) - -end PartitionPilot.Compression.RecursiveMaps.CountableColumns - - - -namespace PartitionPilot.Compression.RecursiveMaps - -open RationalHeights -universe u v - -namespace DirectSystem -variable {I : Type u} [LinearOrder I] [Countable I] (c : DirectSystem I) - {H : Type v} (value : ∀ i, c.Point i → H) - (coherent : ∀ {i j} (h : i ≤ j) x, value j (c.map h x) = value i x) - -theorem descend_countable (countable : ∀ i, CountableRange (value i)) : - CountableRange (c.descend value coherent) := by - classical - rcases exists_injective_nat I with ⟨indexCode, index_injective⟩ - let code (i : I) : c.Point i → Nat := Classical.choose (countable i) - have equal (i : I) := Classical.choose_spec (countable i) - let labelValue (x : c.Label) := value x.1 x.2 - have label_equal (x y : c.Label) - (eq : natPair (indexCode x.1) (code x.1 x.2) = natPair (indexCode y.1) (code y.1 y.2)) : - labelValue x = labelValue y := by - rcases x with ⟨i, x⟩ - rcases y with ⟨j, y⟩ - rcases natPair_injective eq with ⟨same, codes⟩ - have same := index_injective same - cases same - exact equal i x y codes - have out_value (x : c.Union) : labelValue (Quotient.out x) = c.descend value coherent x := - congrArg (c.descend value coherent) (Quotient.out_eq x) - refine ⟨fun x => natPair (indexCode (Quotient.out x).1) - (code (Quotient.out x).1 (Quotient.out x).2), ?_⟩ - intro x y eq - exact (out_value x).symm.trans ((label_equal _ _ eq).trans (out_value y)) - -end DirectSystem - -namespace MeetSystem -variable {I : Type u} [LinearOrder I] (p : MeetSystem I) {H : Type v} (R : HeightOrder H) - -structure Heights where - height : ∀ i, StrictHeight (p.order i) R - coherent : ∀ {i j} (h : i ≤ j) x, (height j).value (p.system.map h x) = (height i).value x - -namespace Heights -variable {p R} (h : Heights p R) - -def unionHeight : StrictHeight p.unionOrder R where - value := p.system.descend (fun i => (h.height i).value) h.coherent - strict x y lower different := by - rcases p.system.pair_cover p.system x y with ⟨i, x, y, rfl, rfl⟩ - exact (h.height i).strict x y ((p.le_stage i x y).mp lower) - (fun eq => different (congrArg (p.system.point i) eq)) - -theorem unionHeight_stage (i : I) (x : p.system.Point i) : - h.unionHeight.value ((p.inclusion i).toFun x) = (h.height i).value x := rfl - -theorem unionHeight_countable [Countable I] (countable : ∀ i, CountableRange (h.height i).value) : - CountableRange h.unionHeight.value := - p.system.descend_countable (fun i => (h.height i).value) h.coherent countable - -end Heights -end MeetSystem - -namespace MeetSystem.Heights -open CountableColumns - -variable {I : Type u} [LinearOrder I] [Countable I] {p : MeetSystem I} - (h : p.Heights (lexOrder CountableColumns.order).toHeightOrder) - (bound : I → Column) - (bounded : ∀ i x, ((h.height i).value x).1.val ≤ (bound i).val) - -include bounded in -theorem union_column_bound (x : p.system.Union) : - CountableColumns.order.lt (h.unionHeight.value x).1 (upperBound bound) := by - rcases p.system.cover x with ⟨i, x, rfl⟩ - exact lt_of_le_of_lt (bounded i x) (upperBound_above bound i) - -noncomputable def limitHeight : - StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder := - FixedTop.extendHeight h.unionHeight (upperBound bound, zero) - (fun x => Or.inl (h.union_column_bound bound bounded x)) - -theorem limitHeight_stage (i : I) (x : p.system.Point i) : - (h.limitHeight bound bounded).value ((p.boundedInclusion i).toFun x) = - (h.height i).value x := rfl - -theorem limitHeight_countable (countable : ∀ i, CountableRange (h.height i).value) : - CountableRange (h.limitHeight bound bounded).value := - FixedTop.extendHeight_countable _ _ _ (h.unionHeight_countable countable) - -theorem limitHeight_top : (h.limitHeight bound bounded).value none = (upperBound bound, zero) := rfl - -theorem limitHeight_bounded (x : Option p.system.Union) : - (lexOrder CountableColumns.order).Weak ((h.limitHeight bound bounded).value x) - (upperBound bound, zero) := - (h.limitHeight bound bounded).mono (FixedTop.greatest p.unionOrder x) - -include bounded in -theorem countable_limit_height (countable : ∀ i, CountableRange (h.height i).value) : - ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, - (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ - CountableRange height.value ∧ height.value none = (upperBound bound, zero) ∧ - (∀ x, (lexOrder CountableColumns.order).Weak (height.value x) (upperBound bound, zero)) := - ⟨h.limitHeight bound bounded, h.limitHeight_stage bound bounded, - h.limitHeight_countable bound bounded countable, h.limitHeight_top bound bounded, - h.limitHeight_bounded bound bounded⟩ - -omit [Countable I] in -theorem stage_bound_from_top (top : ∀ i, p.system.Point i) - (greatest : ∀ i x, (p.order i).le x (top i)) (i : I) (x : p.system.Point i) : - ((h.height i).value x).1.val ≤ ((h.height i).value (top i)).1.val := by - have weak := CountableColumns.order.first_weak Rational.order.toLinearHeightOrder - ((h.height i).mono (greatest i x)) - rcases weak with eq | lower - · exact (congrArg Subtype.val eq).le - · exact lower.le - -theorem bounded_countable_limit (top : ∀ i, p.system.Point i) - (greatest : ∀ i x, (p.order i).le x (top i)) - (countable : ∀ i, CountableRange (h.height i).value) : - ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, - (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ - CountableRange height.value := by - rcases h.countable_limit_height (fun i => ((h.height i).value (top i)).1) - (h.stage_bound_from_top top greatest) countable with ⟨height, fixed, small, _⟩ - exact ⟨height, fixed, small⟩ - -end MeetSystem.Heights - -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps - -open RationalHeights CountableColumns - -theorem countable_ordinal_limit - (α : Column) (positive : 0 < α.val) - (p : MeetSystem (Set.Iio α.val)) (g : GroupSystem (Set.Iio α.val)) - (a : ActionSystem g p) - (h : p.Heights (lexOrder CountableColumns.order).toHeightOrder) - (top : ∀ i, p.system.Point i) - (greatest : ∀ i x, (p.order i).le x (top i)) - (countable : ∀ i, CountableRange (h.height i).value) : - letI : Nonempty (Set.Iio α.val) := ⟨⟨0, positive⟩⟩ - ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, - (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ - CountableRange height.value ∧ - (∀ x, (lexOrder CountableColumns.order).Weak (height.value x) (height.value none)) ∧ - (∀ i s x, (a.topAction.iso ((g.inclusion i) s)).toFun ((p.boundedInclusion i).toFun x) = - (p.boundedInclusion i).toFun (((a.action i).iso s).toFun x)) ∧ - (∀ s, (a.topAction.iso s).toFun none = none) ∧ - (∀ i x, p.boundedOrder.le ((p.boundedInclusion i).toFun x) none ∧ - ¬ p.boundedOrder.le none ((p.boundedInclusion i).toFun x)) := by - let : Nonempty (Set.Iio α.val) := ⟨⟨0, positive⟩⟩ - let : Countable (Set.Iio α.val) := (initialSegment_countable α).to_subtype - rcases h.bounded_countable_limit top greatest countable with ⟨height, fixed, small⟩ - exact ⟨height, fixed, small, - fun x => height.mono (FixedTop.greatest p.unionOrder x), - a.topAction_stage, a.top_fixed, p.bounded_strict_top⟩ - -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps.DirectSystem - -universe u -variable {I : Type u} [LinearOrder I] [WellFoundedLT I] (c : DirectSystem I) - -def Present (x : c.Union) : Set I := {i | ∃ a, c.point i a = x} - -omit [WellFoundedLT I] in -theorem present_nonempty (x : c.Union) : (c.Present x).Nonempty := c.cover x - -noncomputable def birth (x : c.Union) : I := - wellFounded_lt.min (c.Present x) (c.present_nonempty x) - -theorem present_birth (x : c.Union) : ∃ a, c.point (c.birth x) a = x := - wellFounded_lt.min_mem (c.Present x) (c.present_nonempty x) - -theorem birth_le_iff (x : c.Union) (i : I) : c.birth x ≤ i ↔ ∃ a, c.point i a = x := by - constructor - · intro lower - rcases c.present_birth x with ⟨a, eq⟩ - exact ⟨c.map lower a, (c.point_map lower a).trans eq⟩ - · intro present - exact le_of_not_gt (wellFounded_lt.not_lt_min (c.Present x) present) - -noncomputable def stageBirth (i : I) (x : c.Point i) : I := c.birth (c.point i x) - -theorem stageBirth_le (i : I) (x : c.Point i) : c.stageBirth i x ≤ i := - (c.birth_le_iff _ i).mpr ⟨x, rfl⟩ - -theorem stageBirth_map {i j : I} (lower : i ≤ j) (x : c.Point i) : - c.stageBirth j (c.map lower x) = c.stageBirth i x := - congrArg c.birth (c.point_map lower x) - -theorem stageBirth_le_iff {i j : I} (lower : i ≤ j) (x : c.Point j) : - c.stageBirth j x ≤ i ↔ ∃ a, c.map lower a = x := by - constructor - · intro old - rcases (c.birth_le_iff (c.point j x) i).mp old with ⟨a, eq⟩ - exact ⟨a, c.point_injective j ((c.point_map lower a).trans eq)⟩ - · rintro ⟨a, rfl⟩ - rw [c.stageBirth_map] - exact c.stageBirth_le i a - -theorem born_stage_cover {i j : I} (lower : i ≤ j) (x : c.Point j) - (born : c.stageBirth j x = i) : ∃ a, c.map lower a = x := - (c.stageBirth_le_iff lower x).mp born.le - -theorem union_born_cover (i : I) (x : c.Union) (born : c.birth x = i) : - ∃ a, c.point i a = x := (c.birth_le_iff x i).mp born.le - -theorem stageBirth_eq_iff (j : I) (x : c.Point j) (i : I) : - c.stageBirth j x = i ↔ - (∃ lower : i ≤ j, ∃ a, c.map lower a = x) ∧ - (∀ k, k < i → ∀ lower : k ≤ j, ¬ ∃ a, c.map lower a = x) := by - constructor - · intro eq - have lower : i ≤ j := eq ▸ c.stageBirth_le j x - refine ⟨⟨lower, c.born_stage_cover lower x eq⟩, ?_⟩ - intro k earlier lower present - have old := (c.stageBirth_le_iff lower x).mpr present - rw [eq] at old - exact (not_lt_of_ge old) earlier - · rintro ⟨⟨lower, present⟩, first⟩ - apply le_antisymm ((c.stageBirth_le_iff lower x).mpr present) - apply le_of_not_gt - intro earlier - exact first (c.stageBirth j x) earlier (c.stageBirth_le j x) - (c.born_stage_cover (c.stageBirth_le j x) x rfl) - -include c in - -theorem continuous_stage_no_birth (j : I) - (cover : ∀ x : c.Point j, ∃ i, ∃ lower : i < j, ∃ a, c.map lower.le a = x) - (x : c.Point j) : c.stageBirth j x < j := by - rcases cover x with ⟨i, lower, a, rfl⟩ - rw [c.stageBirth_map] - exact lt_of_le_of_lt (c.stageBirth_le i a) lower - -theorem stageBirth_eq_of_records (record : ∀ i, c.Point i → I) - (bounded : ∀ i x, record i x ≤ i) - (coherent : ∀ {i j} (lower : i ≤ j) x, record j (c.map lower x) = record i x) - (origin : ∀ j x, ∃ a, c.map (bounded j x) a = x) - (j : I) (x : c.Point j) : c.stageBirth j x = record j x := by - apply le_antisymm ((c.stageBirth_le_iff (bounded j x) x).mpr (origin j x)) - rcases c.born_stage_cover (c.stageBirth_le j x) x rfl with ⟨a, eq⟩ - calc - record j x = record (c.stageBirth j x) a := - (congrArg (record j) eq).symm.trans (coherent (c.stageBirth_le j x) a) - _ ≤ c.stageBirth j x := bounded _ a - -theorem birth_eq_of_records (record : ∀ i, c.Point i → I) - (bounded : ∀ i x, record i x ≤ i) - (coherent : ∀ {i j} (lower : i ≤ j) x, record j (c.map lower x) = record i x) - (origin : ∀ j x, ∃ a, c.map (bounded j x) a = x) - (x : c.Union) : c.birth x = c.descend record coherent x := by - rcases c.cover x with ⟨j, x, rfl⟩ - exact c.stageBirth_eq_of_records record bounded coherent origin j x - -end PartitionPilot.Compression.RecursiveMaps.DirectSystem - - - -namespace PartitionPilot.Compression.RecursiveMaps.MeetSystem - -open Chronological -universe u v -variable {I : Type u} [LinearOrder I] [WellFoundedLT I] (p : MeetSystem I) - -def LocalOldMeet : Prop := ∀ i (x y : p.system.Point i), - p.system.stageBirth i x = i → p.system.stageBirth i y < i → ¬ (p.order i).le x y → - p.system.stageBirth i ((p.order i).meet x y) < i - -theorem old_meet_at (localMeet : p.LocalOldMeet) (j : I) : - OldMeet (P := p.order j) (p.system.stageBirth j) := by - intro x y earlier notLower - let i := p.system.stageBirth j x - have present : i ≤ j := p.system.stageBirth_le j x - rcases p.system.born_stage_cover present x rfl with ⟨a, ha⟩ - rcases (p.system.stageBirth_le_iff present y).mp earlier.le with ⟨b, hb⟩ - have a_birth : p.system.stageBirth i a = i := by - rw [← p.system.stageBirth_map present, ha] - have b_birth : p.system.stageBirth i b < i := by - rw [← p.system.stageBirth_map present, hb] - exact earlier - have notLower' : ¬ (p.order i).le a b := by - intro lower - have raised := (p.map_le present a b).mpr lower - rw [ha, hb] at raised - exact notLower raised - have old := localMeet i a b a_birth b_birth notLower' - have meet_birth : p.system.stageBirth j ((p.order j).meet x y) = - p.system.stageBirth i ((p.order i).meet a b) := by - rw [← ha, ← hb, ← p.map_meet, p.system.stageBirth_map] - rw [meet_birth] - exact old - -theorem union_old_meet (localMeet : p.LocalOldMeet) : - OldMeet (P := p.unionOrder) p.system.birth := - oldMeet_of_covered_stages p.order p.system.birth p.system.stageBirth p.inclusion - (fun _ _ => rfl) (p.system.pair_cover p.system) (p.old_meet_at localMeet) - -def OwnLayers : Type (u + 1) := - ∀ i, GrowthLayer p.system.Point p.order (p.order i) (p.system.stageBirth i) i - -noncomputable def laterLayer (own : p.OwnLayers) (i j : I) (lower : i ≤ j) : - GrowthLayer p.system.Point p.order (p.order j) (p.system.stageBirth j) i := - (own i).transport (p.transition lower) (p.system.stageBirth_map lower) - (p.system.born_stage_cover lower) - -noncomputable def unionLayer (own : p.OwnLayers) (i : I) : - GrowthLayer p.system.Point p.order p.unionOrder p.system.birth i := - (own i).transport (p.inclusion i) (fun _ => rfl) (p.system.union_born_cover i) - -noncomputable def history {H : Type v} {R : HeightOrder H} - (heights : p.Heights R) (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : History I R where - Space := p.system.Point - order := p.order - birth := p.system.stageBirth - birth_le := p.system.stageBirth_le - old_meet := p.old_meet_at localMeet - height := heights.height - layer cutoff i lower := p.laterLayer own i cutoff lower - -theorem stages_all_filters_countable {H : Type v} {R : HeightOrder H} - (heights : p.Heights R) (localMeet : p.LocalOldMeet) (own : p.OwnLayers) - (descending : DescendingCountable (Stage := I) R) : ∀ i, AllFiltersCountable (p.order i) := - (p.history heights localMeet own).all_filters_countable descending - -theorem union_all_filters_countable {H : Type v} {R : HeightOrder H} - (heights : p.Heights R) (localMeet : p.LocalOldMeet) (own : p.OwnLayers) - (descending : DescendingCountable (Stage := I) R) : AllFiltersCountable p.unionOrder := by - intro F - apply countable_basis_of_layers p.system.birth F - · exact essential_stages_countable p.system.birth heights.unionHeight descending - (p.union_old_meet localMeet) F - · intro i - apply (p.unionLayer own i).countable_essentials F - intro j _ - exact p.stages_all_filters_countable heights localMeet own descending j - -end PartitionPilot.Compression.RecursiveMaps.MeetSystem - - - -namespace PartitionPilot.Compression.RecursiveMaps.FixedTop - -open Chronological -universe u v -variable {A : Type u} {Stage : Type v} [LinearOrder Stage] - -def birth (oldBirth : A → Stage) (s : Stage) : Option A → Stage - | none => s - | some x => oldBirth x - -theorem birth_le (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (x : Option A) : birth oldBirth s x ≤ s := by - cases x with - | none => exact le_rfl - | some x => exact (old x).le - -theorem birth_at_top_iff (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (x : Option A) : birth oldBirth s x = s ↔ x = none := by - cases x with - | none => exact ⟨fun _ => rfl, fun _ => rfl⟩ - | some x => - constructor - · intro eq - exact False.elim ((ne_of_lt (old x)) eq) - · intro eq - cases eq - -theorem old_meet_preserved (P : MeetOrder A) (oldBirth : A → Stage) (s : Stage) - (old : ∀ x, oldBirth x < s) (previous : OldMeet (P := P) oldBirth) : - OldMeet (P := order P) (birth oldBirth s) := by - intro x y earlier notLower - cases x with - | none => - cases y with - | none => exact False.elim (lt_irrefl s earlier) - | some y => exact old y - | some x => - cases y with - | none => exact False.elim (lt_asymm earlier (old x)) - | some y => exact previous x y earlier notLower - -section Layers -variable {Stage : Type u} [LinearOrder Stage] (P : MeetOrder A) - (Space : Stage → Type u) (orders : ∀ i, MeetOrder (Space i)) - -noncomputable def earlier_layer (oldBirth : A → Stage) (s t : Stage) - (earlier : t < s) (layer : GrowthLayer Space orders P oldBirth t) : - GrowthLayer Space orders (order P) (birth oldBirth s) t := by - apply layer.transport (embedding P).toMeetEmbedding (fun _ => rfl) - intro x hx - cases x with - | none => - change s = t at hx - exact False.elim ((ne_of_lt earlier) hx.symm) - | some x => exact ⟨x, rfl⟩ - -def incoming_layer (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : - GrowthLayer Space orders (order P) (birth oldBirth s) s := by - apply finiteLayer Space orders - apply (Set.finite_singleton (none : Option A)).subset - intro x hx - exact (birth_at_top_iff oldBirth s old x).mp hx - -end Layers - -omit [LinearOrder Stage] in - -theorem all_filters_countable (P : MeetOrder A) (previous : AllFiltersCountable P) : - AllFiltersCountable (order P) := by - intro F - have topPositive : F.mem none := by - rcases F.nonempty with ⟨x, positive⟩ - exact F.upward positive (greatest P x) - rcases countableBelow_copy (embedding P).toMeetEmbedding F previous with ⟨B, small, positive, below⟩ - refine ⟨insert none B, small.insert none, ?_, ?_⟩ - · intro x hx - rcases Set.mem_insert_iff.mp hx with eq | hx - · exact eq ▸ topPositive - · exact positive x hx - · intro x hx - cases x with - | none => exact ⟨none, Set.mem_insert _ _, True.intro⟩ - | some x => - rcases below (some x) ⟨hx, x, rfl⟩ with ⟨y, hy, lower⟩ - exact ⟨y, Set.mem_insert_of_mem _ hy, lower⟩ - -end PartitionPilot.Compression.RecursiveMaps.FixedTop - - - -namespace PartitionPilot.Compression.RecursiveMaps - -namespace CountableColumns - -noncomputable instance columnLinearOrder : LinearOrder Column := - inferInstanceAs (LinearOrder {o : Ordinal.{0} // o.card ≤ Cardinal.aleph0}) - -instance columnWellFoundedLT : WellFoundedLT Column := - inferInstanceAs (WellFoundedLT {o : Ordinal.{0} // o.card ≤ Cardinal.aleph0}) - -universe u - -theorem descending_property {I : Type u} [LinearOrder I] [WellFoundedLT I] : - Chronological.DescendingCountable (Stage := I) - (RationalHeights.lexOrder order).toHeightOrder := - Chronological.rational_descending_property - -end CountableColumns - -namespace MeetSystem - -open Chronological -universe u -variable {I : Type u} [LinearOrder I] [WellFoundedLT I] (p : MeetSystem I) - -theorem rational_stages_all_filters_countable - (heights : p.Heights (RationalHeights.lexOrder CountableColumns.order).toHeightOrder) - (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : ∀ i, AllFiltersCountable (p.order i) := - p.stages_all_filters_countable heights localMeet own CountableColumns.descending_property - -theorem rational_union_all_filters_countable - (heights : p.Heights (RationalHeights.lexOrder CountableColumns.order).toHeightOrder) - (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : AllFiltersCountable p.unionOrder := - p.union_all_filters_countable heights localMeet own CountableColumns.descending_property - -theorem rational_bounded_all_filters_countable - (heights : p.Heights (RationalHeights.lexOrder CountableColumns.order).toHeightOrder) - (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : AllFiltersCountable p.boundedOrder := - FixedTop.all_filters_countable p.unionOrder - (p.rational_union_all_filters_countable heights localMeet own) - -end MeetSystem - - - - - -open RationalHeights CountableColumns Chronological - -namespace MeetSystem -variable {α : Column} (p : MeetSystem (Set.Iio α.val)) - -noncomputable def ordinalBirth (x : p.system.Union) : Ordinal.{0} := - (p.system.birth x).val - -noncomputable def boundedBirth : Option p.system.Union → Ordinal.{0} := - FixedTop.birth p.ordinalBirth α.val - -theorem ordinalBirth_lt (x : p.system.Union) : p.ordinalBirth x < α.val := - (p.system.birth x).property - -theorem boundedBirth_le (x : Option p.system.Union) : p.boundedBirth x ≤ α.val := - FixedTop.birth_le p.ordinalBirth α.val p.ordinalBirth_lt x - -theorem boundedBirth_stage (i : Set.Iio α.val) (x : p.system.Point i) : - p.boundedBirth ((p.boundedInclusion i).toFun x) = (p.system.stageBirth i x).val := rfl - -theorem boundedBirth_stage_le (i : Set.Iio α.val) (x : p.system.Point i) : - p.boundedBirth ((p.boundedInclusion i).toFun x) ≤ i.val := - p.system.stageBirth_le i x - -theorem boundedBirth_at_limit_iff (x : Option p.system.Union) : - p.boundedBirth x = α.val ↔ x = none := - FixedTop.birth_at_top_iff p.ordinalBirth α.val p.ordinalBirth_lt x - -theorem ordinalBirth_old_meet (localMeet : p.LocalOldMeet) : - OldMeet (P := p.unionOrder) p.ordinalBirth := - p.union_old_meet localMeet - -theorem boundedBirth_old_meet (localMeet : p.LocalOldMeet) : - OldMeet (P := p.boundedOrder) p.boundedBirth := - FixedTop.old_meet_preserved p.unionOrder p.ordinalBirth α.val p.ordinalBirth_lt - (p.ordinalBirth_old_meet localMeet) - -noncomputable def boundedBirth_incoming_layer - (Space : Ordinal.{0} → Type 1) (orders : ∀ i, MeetOrder (Space i)) : - GrowthLayer Space orders p.boundedOrder p.boundedBirth α.val := - FixedTop.incoming_layer p.unionOrder Space orders p.ordinalBirth α.val p.ordinalBirth_lt - -theorem countable_ordinal_chronological_limit - (h : p.Heights (lexOrder CountableColumns.order).toHeightOrder) - (top : ∀ i, p.system.Point i) - (greatest : ∀ i x, (p.order i).le x (top i)) - (countable : ∀ i, CountableRange (h.height i).value) - (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : - ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, - (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ - CountableRange height.value ∧ - AllFiltersCountable p.boundedOrder ∧ - OldMeet (P := p.boundedOrder) p.boundedBirth ∧ - (∀ i x, p.boundedBirth ((p.boundedInclusion i).toFun x) = - (p.system.stageBirth i x).val) ∧ - (∀ x, p.boundedBirth x = α.val ↔ x = none) := by - let : Countable (Set.Iio α.val) := (initialSegment_countable α).to_subtype - rcases h.bounded_countable_limit top greatest countable with ⟨height, fixed, small⟩ - exact ⟨height, fixed, small, p.rational_bounded_all_filters_countable h localMeet own, - p.boundedBirth_old_meet localMeet, p.boundedBirth_stage, p.boundedBirth_at_limit_iff⟩ - -end MeetSystem -end PartitionPilot.Compression.RecursiveMaps - - - -namespace PartitionPilot.Compression.RecursiveMaps.Chronological - -universe u -variable {A B Stage : Type u} [LinearOrder Stage] - {P : MeetOrder A} {Q : MeetOrder B} - -def NewOldMeet (birth : A → Stage) (s : Stage) : Prop := - ∀ x y, birth x = s → birth y < s → ¬ P.le x y → birth (P.meet x y) < s - -theorem NewOldMeet.transport {birthA : A → Stage} {birthB : B → Stage} {s : Stage} - (localMeet : NewOldMeet (P := P) birthA s) (e : MeetEmbedding P Q) - (preserves : ∀ x, birthB (e.toFun x) = birthA x) - (cover : ∀ y, ∃ x, e.toFun x = y) : NewOldMeet (P := Q) birthB s := by - intro x y born earlier notLower - rcases cover x with ⟨a, rfl⟩ - rcases cover y with ⟨b, rfl⟩ - rw [preserves] at born earlier - have old := localMeet a b born earlier (fun lower => notLower ((e.le_iff a b).mpr lower)) - rw [← e.map_meet, preserves] - exact old - -theorem OldMeet.transport {birthA : A → Stage} {birthB : B → Stage} - (previous : OldMeet (P := P) birthA) (e : MeetEmbedding P Q) - (preserves : ∀ x, birthB (e.toFun x) = birthA x) - (cover : ∀ y, ∃ x, e.toFun x = y) : OldMeet (P := Q) birthB := by - intro x y earlier notLower - rcases cover x with ⟨a, rfl⟩ - rcases cover y with ⟨b, rfl⟩ - rw [preserves, preserves] at earlier - have old := previous a b earlier (fun lower => notLower ((e.le_iff a b).mpr lower)) - rw [← e.map_meet, preserves, preserves] - exact old - -end PartitionPilot.Compression.RecursiveMaps.Chronological - -namespace PartitionPilot.Attachment.Templates - -open Compression Compression.RecursiveMaps Compression.RecursiveMaps.Chronological -universe u -variable {A I Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} - (b : Templates.{u,u,u} P I) - -def birth (oldBirth : A → Stage) (s : Stage) : A ⊕ b.Fresh → Stage - | .inl a => oldBirth a - | .inr _ => s - -theorem birth_le (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (x : A ⊕ b.Fresh) : b.birth oldBirth s x ≤ s := by - cases x with - | inl a => exact (old a).le - | inr _ => exact le_rfl - -theorem birth_at_step_iff (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (x : A ⊕ b.Fresh) : b.birth oldBirth s x = s ↔ ∃ y, x = .inr y := by - cases x with - | inl a => - constructor - · intro eq - exact False.elim ((ne_of_lt (old a)) eq) - · rintro ⟨y, eq⟩ - cases eq - | inr y => exact ⟨fun _ => ⟨y, rfl⟩, fun _ => rfl⟩ - -theorem old_meet_preserved (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (previous : OldMeet (P := P) oldBirth) : OldMeet (P := b.extension) (b.birth oldBirth s) := - attachment_old_meet b (b.birth oldBirth s) s old (fun _ => rfl) previous - -theorem new_old_meet (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : - NewOldMeet (P := b.extension) (b.birth oldBirth s) s := by - intro x y born earlier notLower - rcases (b.birth_at_step_iff oldBirth s old x).mp born with ⟨x, rfl⟩ - cases y with - | inl a => - rw [b.shadow_meet_eq x a notLower] - exact old _ - | inr y => exact False.elim (lt_irrefl s earlier) - -noncomputable def earlier_layer {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} - (oldBirth : A → Stage) (s t : Stage) (earlier : t < s) - (layer : GrowthLayer Space orders P oldBirth t) : - GrowthLayer Space orders b.extension (b.birth oldBirth s) t := by - apply layer.transport b.oldEmbedding (fun _ => rfl) - intro x hx - cases x with - | inl a => exact ⟨a, rfl⟩ - | inr y => - change s = t at hx - exact False.elim ((ne_of_lt earlier) hx.symm) - -noncomputable def incoming_layer (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) - (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) - (index : I → Stage) (earlier : ∀ i, index i < s) - (template : ∀ i, MeetIso (orders (index i)) (b.order i)) : - GrowthLayer Space orders b.extension (b.birth oldBirth s) s := - attachmentLayer b Space orders (b.birth oldBirth s) s old index earlier template - -end PartitionPilot.Attachment.Templates - -namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input - -open Chronological -universe u -variable {A B Stage : Type u} [LinearOrder Stage] - {P : MeetOrder A} {Q : MeetOrder B} (g : Input P Q) - -theorem new_old_meet (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : - NewOldMeet (P := g.order) (g.birth oldBirth s) s := by - intro x y born earlier _ - cases x with - | inl a => exact False.elim ((ne_of_lt (old a)) born) - | inr x => - cases y with - | inl a => - rw [g.new_shadow_meet] - exact old _ - | inr y => exact False.elim (lt_irrefl s earlier) - -end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input - -end OAI +import OAI.SetTheory.PartitionPrinciple.Forcing.LimitAction + +namespace OAI + + +namespace PartitionPilot.Compression.RecursiveMaps.CountableColumns + +open scoped Cardinal +universe u + +theorem initialSegment_countable (a : Column) : (Set.Iio a.val).Countable := by + have : Countable a.val.ToType := Cardinal.mk_le_aleph0_iff.mp (by + rw [Cardinal.mk_toType] + exact a.property) + exact (Ordinal.ToType.mk (o := a.val)).injective.countable + +theorem sequenceSup_countable (f : Nat → Column) : + (iSup (fun n => (f n).val)).card ≤ Cardinal.aleph0 := by + have same : Set.Iio (iSup (fun n => (f n).val)) = ⋃ n, Set.Iio (f n).val := by + ext a + simp only [Set.mem_Iio, Set.mem_iUnion, Ordinal.lt_iSup_iff] + have small : (Set.Iio (iSup (fun n => (f n).val))).Countable := by + rw [same] + exact Set.countable_iUnion (fun n => initialSegment_countable (f n)) + let := small.to_subtype + let : Countable (iSup (fun n => (f n).val)).ToType := + (Ordinal.ToType.mk (o := iSup (fun n => (f n).val))).symm.injective.countable + simpa only [Cardinal.mk_toType] using + (Cardinal.mk_le_aleph0 (α := (iSup (fun n => (f n).val)).ToType)) + +noncomputable def sequenceSup (f : Nat → Column) : Column := + ⟨iSup (fun n => (f n).val), sequenceSup_countable f⟩ + +theorem lt_start (a : Column) : order.lt a (start a) := by + change a.val < a.val + (1 : Nat) + rw [Nat.cast_one, ← Order.succ_eq_add_one] + exact Order.lt_succ _ + +noncomputable def upperBound {I : Type u} [Countable I] (f : I → Column) : Column := + start (sequenceSup (Set.enumerateCountable (Set.countable_range f) (natural 0))) + +theorem upperBound_above {I : Type u} [Countable I] (f : I → Column) (i : I) : + order.lt (f i) (upperBound f) := by + let seq := Set.enumerateCountable (Set.countable_range f) (natural 0) + have below : (f i).val ≤ (sequenceSup seq).val := by + rcases Set.subset_range_enumerate (Set.countable_range f) (natural 0) + (Set.mem_range_self i) with ⟨n, eq⟩ + change (f i).val ≤ iSup (fun n => (seq n).val) + rw [← eq] + exact Ordinal.le_iSup (fun n => (seq n).val) n + exact lt_of_le_of_lt below (lt_start (sequenceSup seq)) + +end PartitionPilot.Compression.RecursiveMaps.CountableColumns + + + +namespace PartitionPilot.Compression.RecursiveMaps + +open RationalHeights +universe u v + +namespace DirectSystem +variable {I : Type u} [LinearOrder I] [Countable I] (c : DirectSystem I) + {H : Type v} (value : ∀ i, c.Point i → H) + (coherent : ∀ {i j} (h : i ≤ j) x, value j (c.map h x) = value i x) + +theorem descend_countable (countable : ∀ i, CountableRange (value i)) : + CountableRange (c.descend value coherent) := by + classical + rcases exists_injective_nat I with ⟨indexCode, index_injective⟩ + let code (i : I) : c.Point i → Nat := Classical.choose (countable i) + have equal (i : I) := Classical.choose_spec (countable i) + let labelValue (x : c.Label) := value x.1 x.2 + have label_equal (x y : c.Label) + (eq : natPair (indexCode x.1) (code x.1 x.2) = natPair (indexCode y.1) (code y.1 y.2)) : + labelValue x = labelValue y := by + rcases x with ⟨i, x⟩ + rcases y with ⟨j, y⟩ + rcases natPair_injective eq with ⟨same, codes⟩ + have same := index_injective same + cases same + exact equal i x y codes + have out_value (x : c.Union) : labelValue (Quotient.out x) = c.descend value coherent x := + congrArg (c.descend value coherent) (Quotient.out_eq x) + refine ⟨fun x => natPair (indexCode (Quotient.out x).1) + (code (Quotient.out x).1 (Quotient.out x).2), ?_⟩ + intro x y eq + exact (out_value x).symm.trans ((label_equal _ _ eq).trans (out_value y)) + +end DirectSystem + +namespace MeetSystem +variable {I : Type u} [LinearOrder I] (p : MeetSystem I) {H : Type v} (R : HeightOrder H) + +structure Heights where + height : ∀ i, StrictHeight (p.order i) R + coherent : ∀ {i j} (h : i ≤ j) x, (height j).value (p.system.map h x) = (height i).value x + +namespace Heights +variable {p R} (h : Heights p R) + +def unionHeight : StrictHeight p.unionOrder R where + value := p.system.descend (fun i => (h.height i).value) h.coherent + strict x y lower different := by + rcases p.system.pair_cover p.system x y with ⟨i, x, y, rfl, rfl⟩ + exact (h.height i).strict x y ((p.le_stage i x y).mp lower) + (fun eq => different (congrArg (p.system.point i) eq)) + +theorem unionHeight_stage (i : I) (x : p.system.Point i) : + h.unionHeight.value ((p.inclusion i).toFun x) = (h.height i).value x := rfl + +theorem unionHeight_countable [Countable I] (countable : ∀ i, CountableRange (h.height i).value) : + CountableRange h.unionHeight.value := + p.system.descend_countable (fun i => (h.height i).value) h.coherent countable + +end Heights +end MeetSystem + +namespace MeetSystem.Heights +open CountableColumns + +variable {I : Type u} [LinearOrder I] [Countable I] {p : MeetSystem I} + (h : p.Heights (lexOrder CountableColumns.order).toHeightOrder) + (bound : I → Column) + (bounded : ∀ i x, ((h.height i).value x).1.val ≤ (bound i).val) + +include bounded in +theorem union_column_bound (x : p.system.Union) : + CountableColumns.order.lt (h.unionHeight.value x).1 (upperBound bound) := by + rcases p.system.cover x with ⟨i, x, rfl⟩ + exact lt_of_le_of_lt (bounded i x) (upperBound_above bound i) + +noncomputable def limitHeight : + StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder := + FixedTop.extendHeight h.unionHeight (upperBound bound, zero) + (fun x => Or.inl (h.union_column_bound bound bounded x)) + +theorem limitHeight_stage (i : I) (x : p.system.Point i) : + (h.limitHeight bound bounded).value ((p.boundedInclusion i).toFun x) = + (h.height i).value x := rfl + +theorem limitHeight_countable (countable : ∀ i, CountableRange (h.height i).value) : + CountableRange (h.limitHeight bound bounded).value := + FixedTop.extendHeight_countable _ _ _ (h.unionHeight_countable countable) + +theorem limitHeight_top : (h.limitHeight bound bounded).value none = (upperBound bound, zero) := rfl + +theorem limitHeight_bounded (x : Option p.system.Union) : + (lexOrder CountableColumns.order).Weak ((h.limitHeight bound bounded).value x) + (upperBound bound, zero) := + (h.limitHeight bound bounded).mono (FixedTop.greatest p.unionOrder x) + +include bounded in +theorem countable_limit_height (countable : ∀ i, CountableRange (h.height i).value) : + ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, + (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ + CountableRange height.value ∧ height.value none = (upperBound bound, zero) ∧ + (∀ x, (lexOrder CountableColumns.order).Weak (height.value x) (upperBound bound, zero)) := + ⟨h.limitHeight bound bounded, h.limitHeight_stage bound bounded, + h.limitHeight_countable bound bounded countable, h.limitHeight_top bound bounded, + h.limitHeight_bounded bound bounded⟩ + +omit [Countable I] in +theorem stage_bound_from_top (top : ∀ i, p.system.Point i) + (greatest : ∀ i x, (p.order i).le x (top i)) (i : I) (x : p.system.Point i) : + ((h.height i).value x).1.val ≤ ((h.height i).value (top i)).1.val := by + have weak := CountableColumns.order.first_weak Rational.order.toLinearHeightOrder + ((h.height i).mono (greatest i x)) + rcases weak with eq | lower + · exact (congrArg Subtype.val eq).le + · exact lower.le + +theorem bounded_countable_limit (top : ∀ i, p.system.Point i) + (greatest : ∀ i x, (p.order i).le x (top i)) + (countable : ∀ i, CountableRange (h.height i).value) : + ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, + (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ + CountableRange height.value := by + rcases h.countable_limit_height (fun i => ((h.height i).value (top i)).1) + (h.stage_bound_from_top top greatest) countable with ⟨height, fixed, small, _⟩ + exact ⟨height, fixed, small⟩ + +end MeetSystem.Heights + +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps + +open RationalHeights CountableColumns + +theorem countable_ordinal_limit + (α : Column) (positive : 0 < α.val) + (p : MeetSystem (Set.Iio α.val)) (g : GroupSystem (Set.Iio α.val)) + (a : ActionSystem g p) + (h : p.Heights (lexOrder CountableColumns.order).toHeightOrder) + (top : ∀ i, p.system.Point i) + (greatest : ∀ i x, (p.order i).le x (top i)) + (countable : ∀ i, CountableRange (h.height i).value) : + letI : Nonempty (Set.Iio α.val) := ⟨⟨0, positive⟩⟩ + ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, + (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ + CountableRange height.value ∧ + (∀ x, (lexOrder CountableColumns.order).Weak (height.value x) (height.value none)) ∧ + (∀ i s x, (a.topAction.iso ((g.inclusion i) s)).toFun ((p.boundedInclusion i).toFun x) = + (p.boundedInclusion i).toFun (((a.action i).iso s).toFun x)) ∧ + (∀ s, (a.topAction.iso s).toFun none = none) ∧ + (∀ i x, p.boundedOrder.le ((p.boundedInclusion i).toFun x) none ∧ + ¬ p.boundedOrder.le none ((p.boundedInclusion i).toFun x)) := by + let : Nonempty (Set.Iio α.val) := ⟨⟨0, positive⟩⟩ + let : Countable (Set.Iio α.val) := (initialSegment_countable α).to_subtype + rcases h.bounded_countable_limit top greatest countable with ⟨height, fixed, small⟩ + exact ⟨height, fixed, small, + fun x => height.mono (FixedTop.greatest p.unionOrder x), + a.topAction_stage, a.top_fixed, p.bounded_strict_top⟩ + +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps.DirectSystem + +universe u +variable {I : Type u} [LinearOrder I] [WellFoundedLT I] (c : DirectSystem I) + +def Present (x : c.Union) : Set I := {i | ∃ a, c.point i a = x} + +omit [WellFoundedLT I] in +theorem present_nonempty (x : c.Union) : (c.Present x).Nonempty := c.cover x + +noncomputable def birth (x : c.Union) : I := + wellFounded_lt.min (c.Present x) (c.present_nonempty x) + +theorem present_birth (x : c.Union) : ∃ a, c.point (c.birth x) a = x := + wellFounded_lt.min_mem (c.Present x) (c.present_nonempty x) + +theorem birth_le_iff (x : c.Union) (i : I) : c.birth x ≤ i ↔ ∃ a, c.point i a = x := by + constructor + · intro lower + rcases c.present_birth x with ⟨a, eq⟩ + exact ⟨c.map lower a, (c.point_map lower a).trans eq⟩ + · intro present + exact le_of_not_gt (wellFounded_lt.not_lt_min (c.Present x) present) + +noncomputable def stageBirth (i : I) (x : c.Point i) : I := c.birth (c.point i x) + +theorem stageBirth_le (i : I) (x : c.Point i) : c.stageBirth i x ≤ i := + (c.birth_le_iff _ i).mpr ⟨x, rfl⟩ + +theorem stageBirth_map {i j : I} (lower : i ≤ j) (x : c.Point i) : + c.stageBirth j (c.map lower x) = c.stageBirth i x := + congrArg c.birth (c.point_map lower x) + +theorem stageBirth_le_iff {i j : I} (lower : i ≤ j) (x : c.Point j) : + c.stageBirth j x ≤ i ↔ ∃ a, c.map lower a = x := by + constructor + · intro old + rcases (c.birth_le_iff (c.point j x) i).mp old with ⟨a, eq⟩ + exact ⟨a, c.point_injective j ((c.point_map lower a).trans eq)⟩ + · rintro ⟨a, rfl⟩ + rw [c.stageBirth_map] + exact c.stageBirth_le i a + +theorem born_stage_cover {i j : I} (lower : i ≤ j) (x : c.Point j) + (born : c.stageBirth j x = i) : ∃ a, c.map lower a = x := + (c.stageBirth_le_iff lower x).mp born.le + +theorem union_born_cover (i : I) (x : c.Union) (born : c.birth x = i) : + ∃ a, c.point i a = x := (c.birth_le_iff x i).mp born.le + +theorem stageBirth_eq_iff (j : I) (x : c.Point j) (i : I) : + c.stageBirth j x = i ↔ + (∃ lower : i ≤ j, ∃ a, c.map lower a = x) ∧ + (∀ k, k < i → ∀ lower : k ≤ j, ¬ ∃ a, c.map lower a = x) := by + constructor + · intro eq + have lower : i ≤ j := eq ▸ c.stageBirth_le j x + refine ⟨⟨lower, c.born_stage_cover lower x eq⟩, ?_⟩ + intro k earlier lower present + have old := (c.stageBirth_le_iff lower x).mpr present + rw [eq] at old + exact (not_lt_of_ge old) earlier + · rintro ⟨⟨lower, present⟩, first⟩ + apply le_antisymm ((c.stageBirth_le_iff lower x).mpr present) + apply le_of_not_gt + intro earlier + exact first (c.stageBirth j x) earlier (c.stageBirth_le j x) + (c.born_stage_cover (c.stageBirth_le j x) x rfl) + +include c in + +theorem continuous_stage_no_birth (j : I) + (cover : ∀ x : c.Point j, ∃ i, ∃ lower : i < j, ∃ a, c.map lower.le a = x) + (x : c.Point j) : c.stageBirth j x < j := by + rcases cover x with ⟨i, lower, a, rfl⟩ + rw [c.stageBirth_map] + exact lt_of_le_of_lt (c.stageBirth_le i a) lower + +theorem stageBirth_eq_of_records (record : ∀ i, c.Point i → I) + (bounded : ∀ i x, record i x ≤ i) + (coherent : ∀ {i j} (lower : i ≤ j) x, record j (c.map lower x) = record i x) + (origin : ∀ j x, ∃ a, c.map (bounded j x) a = x) + (j : I) (x : c.Point j) : c.stageBirth j x = record j x := by + apply le_antisymm ((c.stageBirth_le_iff (bounded j x) x).mpr (origin j x)) + rcases c.born_stage_cover (c.stageBirth_le j x) x rfl with ⟨a, eq⟩ + calc + record j x = record (c.stageBirth j x) a := + (congrArg (record j) eq).symm.trans (coherent (c.stageBirth_le j x) a) + _ ≤ c.stageBirth j x := bounded _ a + +theorem birth_eq_of_records (record : ∀ i, c.Point i → I) + (bounded : ∀ i x, record i x ≤ i) + (coherent : ∀ {i j} (lower : i ≤ j) x, record j (c.map lower x) = record i x) + (origin : ∀ j x, ∃ a, c.map (bounded j x) a = x) + (x : c.Union) : c.birth x = c.descend record coherent x := by + rcases c.cover x with ⟨j, x, rfl⟩ + exact c.stageBirth_eq_of_records record bounded coherent origin j x + +end PartitionPilot.Compression.RecursiveMaps.DirectSystem + + + +namespace PartitionPilot.Compression.RecursiveMaps.MeetSystem + +open Chronological +universe u v +variable {I : Type u} [LinearOrder I] [WellFoundedLT I] (p : MeetSystem I) + +def LocalOldMeet : Prop := ∀ i (x y : p.system.Point i), + p.system.stageBirth i x = i → p.system.stageBirth i y < i → ¬ (p.order i).le x y → + p.system.stageBirth i ((p.order i).meet x y) < i + +theorem old_meet_at (localMeet : p.LocalOldMeet) (j : I) : + OldMeet (P := p.order j) (p.system.stageBirth j) := by + intro x y earlier notLower + let i := p.system.stageBirth j x + have present : i ≤ j := p.system.stageBirth_le j x + rcases p.system.born_stage_cover present x rfl with ⟨a, ha⟩ + rcases (p.system.stageBirth_le_iff present y).mp earlier.le with ⟨b, hb⟩ + have a_birth : p.system.stageBirth i a = i := by + rw [← p.system.stageBirth_map present, ha] + have b_birth : p.system.stageBirth i b < i := by + rw [← p.system.stageBirth_map present, hb] + exact earlier + have notLower' : ¬ (p.order i).le a b := by + intro lower + have raised := (p.map_le present a b).mpr lower + rw [ha, hb] at raised + exact notLower raised + have old := localMeet i a b a_birth b_birth notLower' + have meet_birth : p.system.stageBirth j ((p.order j).meet x y) = + p.system.stageBirth i ((p.order i).meet a b) := by + rw [← ha, ← hb, ← p.map_meet, p.system.stageBirth_map] + rw [meet_birth] + exact old + +theorem union_old_meet (localMeet : p.LocalOldMeet) : + OldMeet (P := p.unionOrder) p.system.birth := + oldMeet_of_covered_stages p.order p.system.birth p.system.stageBirth p.inclusion + (fun _ _ => rfl) (p.system.pair_cover p.system) (p.old_meet_at localMeet) + +def OwnLayers : Type (u + 1) := + ∀ i, GrowthLayer p.system.Point p.order (p.order i) (p.system.stageBirth i) i + +noncomputable def laterLayer (own : p.OwnLayers) (i j : I) (lower : i ≤ j) : + GrowthLayer p.system.Point p.order (p.order j) (p.system.stageBirth j) i := + (own i).transport (p.transition lower) (p.system.stageBirth_map lower) + (p.system.born_stage_cover lower) + +noncomputable def unionLayer (own : p.OwnLayers) (i : I) : + GrowthLayer p.system.Point p.order p.unionOrder p.system.birth i := + (own i).transport (p.inclusion i) (fun _ => rfl) (p.system.union_born_cover i) + +noncomputable def history {H : Type v} {R : HeightOrder H} + (heights : p.Heights R) (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : History I R where + Space := p.system.Point + order := p.order + birth := p.system.stageBirth + birth_le := p.system.stageBirth_le + old_meet := p.old_meet_at localMeet + height := heights.height + layer cutoff i lower := p.laterLayer own i cutoff lower + +theorem stages_all_filters_countable {H : Type v} {R : HeightOrder H} + (heights : p.Heights R) (localMeet : p.LocalOldMeet) (own : p.OwnLayers) + (descending : DescendingCountable (Stage := I) R) : ∀ i, AllFiltersCountable (p.order i) := + (p.history heights localMeet own).all_filters_countable descending + +theorem union_all_filters_countable {H : Type v} {R : HeightOrder H} + (heights : p.Heights R) (localMeet : p.LocalOldMeet) (own : p.OwnLayers) + (descending : DescendingCountable (Stage := I) R) : AllFiltersCountable p.unionOrder := by + intro F + apply countable_basis_of_layers p.system.birth F + · exact essential_stages_countable p.system.birth heights.unionHeight descending + (p.union_old_meet localMeet) F + · intro i + apply (p.unionLayer own i).countable_essentials F + intro j _ + exact p.stages_all_filters_countable heights localMeet own descending j + +end PartitionPilot.Compression.RecursiveMaps.MeetSystem + + + +namespace PartitionPilot.Compression.RecursiveMaps.FixedTop + +open Chronological +universe u v +variable {A : Type u} {Stage : Type v} [LinearOrder Stage] + +def birth (oldBirth : A → Stage) (s : Stage) : Option A → Stage + | none => s + | some x => oldBirth x + +theorem birth_le (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (x : Option A) : birth oldBirth s x ≤ s := by + cases x with + | none => exact le_rfl + | some x => exact (old x).le + +theorem birth_at_top_iff (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (x : Option A) : birth oldBirth s x = s ↔ x = none := by + cases x with + | none => exact ⟨fun _ => rfl, fun _ => rfl⟩ + | some x => + constructor + · intro eq + exact False.elim ((ne_of_lt (old x)) eq) + · intro eq + cases eq + +theorem old_meet_preserved (P : MeetOrder A) (oldBirth : A → Stage) (s : Stage) + (old : ∀ x, oldBirth x < s) (previous : OldMeet (P := P) oldBirth) : + OldMeet (P := order P) (birth oldBirth s) := by + intro x y earlier notLower + cases x with + | none => + cases y with + | none => exact False.elim (lt_irrefl s earlier) + | some y => exact old y + | some x => + cases y with + | none => exact False.elim (lt_asymm earlier (old x)) + | some y => exact previous x y earlier notLower + +section Layers +variable {Stage : Type u} [LinearOrder Stage] (P : MeetOrder A) + (Space : Stage → Type u) (orders : ∀ i, MeetOrder (Space i)) + +noncomputable def earlier_layer (oldBirth : A → Stage) (s t : Stage) + (earlier : t < s) (layer : GrowthLayer Space orders P oldBirth t) : + GrowthLayer Space orders (order P) (birth oldBirth s) t := by + apply layer.transport (embedding P).toMeetEmbedding (fun _ => rfl) + intro x hx + cases x with + | none => + change s = t at hx + exact False.elim ((ne_of_lt earlier) hx.symm) + | some x => exact ⟨x, rfl⟩ + +def incoming_layer (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : + GrowthLayer Space orders (order P) (birth oldBirth s) s := by + apply finiteLayer Space orders + apply (Set.finite_singleton (none : Option A)).subset + intro x hx + exact (birth_at_top_iff oldBirth s old x).mp hx + +end Layers + +omit [LinearOrder Stage] in + +theorem all_filters_countable (P : MeetOrder A) (previous : AllFiltersCountable P) : + AllFiltersCountable (order P) := by + intro F + have topPositive : F.mem none := by + rcases F.nonempty with ⟨x, positive⟩ + exact F.upward positive (greatest P x) + rcases countableBelow_copy (embedding P).toMeetEmbedding F previous with ⟨B, small, positive, below⟩ + refine ⟨insert none B, small.insert none, ?_, ?_⟩ + · intro x hx + rcases Set.mem_insert_iff.mp hx with eq | hx + · exact eq ▸ topPositive + · exact positive x hx + · intro x hx + cases x with + | none => exact ⟨none, Set.mem_insert _ _, True.intro⟩ + | some x => + rcases below (some x) ⟨hx, x, rfl⟩ with ⟨y, hy, lower⟩ + exact ⟨y, Set.mem_insert_of_mem _ hy, lower⟩ + +end PartitionPilot.Compression.RecursiveMaps.FixedTop + + + +namespace PartitionPilot.Compression.RecursiveMaps + +namespace CountableColumns + +noncomputable instance columnLinearOrder : LinearOrder Column := + inferInstanceAs (LinearOrder {o : Ordinal.{0} // o.card ≤ Cardinal.aleph0}) + +instance columnWellFoundedLT : WellFoundedLT Column := + inferInstanceAs (WellFoundedLT {o : Ordinal.{0} // o.card ≤ Cardinal.aleph0}) + +universe u + +theorem descending_property {I : Type u} [LinearOrder I] [WellFoundedLT I] : + Chronological.DescendingCountable (Stage := I) + (RationalHeights.lexOrder order).toHeightOrder := + Chronological.rational_descending_property + +end CountableColumns + +namespace MeetSystem + +open Chronological +universe u +variable {I : Type u} [LinearOrder I] [WellFoundedLT I] (p : MeetSystem I) + +theorem rational_stages_all_filters_countable + (heights : p.Heights (RationalHeights.lexOrder CountableColumns.order).toHeightOrder) + (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : ∀ i, AllFiltersCountable (p.order i) := + p.stages_all_filters_countable heights localMeet own CountableColumns.descending_property + +theorem rational_union_all_filters_countable + (heights : p.Heights (RationalHeights.lexOrder CountableColumns.order).toHeightOrder) + (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : AllFiltersCountable p.unionOrder := + p.union_all_filters_countable heights localMeet own CountableColumns.descending_property + +theorem rational_bounded_all_filters_countable + (heights : p.Heights (RationalHeights.lexOrder CountableColumns.order).toHeightOrder) + (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : AllFiltersCountable p.boundedOrder := + FixedTop.all_filters_countable p.unionOrder + (p.rational_union_all_filters_countable heights localMeet own) + +end MeetSystem + + + + + +open RationalHeights CountableColumns Chronological + +namespace MeetSystem +variable {α : Column} (p : MeetSystem (Set.Iio α.val)) + +noncomputable def ordinalBirth (x : p.system.Union) : Ordinal.{0} := + (p.system.birth x).val + +noncomputable def boundedBirth : Option p.system.Union → Ordinal.{0} := + FixedTop.birth p.ordinalBirth α.val + +theorem ordinalBirth_lt (x : p.system.Union) : p.ordinalBirth x < α.val := + (p.system.birth x).property + +theorem boundedBirth_le (x : Option p.system.Union) : p.boundedBirth x ≤ α.val := + FixedTop.birth_le p.ordinalBirth α.val p.ordinalBirth_lt x + +theorem boundedBirth_stage (i : Set.Iio α.val) (x : p.system.Point i) : + p.boundedBirth ((p.boundedInclusion i).toFun x) = (p.system.stageBirth i x).val := rfl + +theorem boundedBirth_stage_le (i : Set.Iio α.val) (x : p.system.Point i) : + p.boundedBirth ((p.boundedInclusion i).toFun x) ≤ i.val := + p.system.stageBirth_le i x + +theorem boundedBirth_at_limit_iff (x : Option p.system.Union) : + p.boundedBirth x = α.val ↔ x = none := + FixedTop.birth_at_top_iff p.ordinalBirth α.val p.ordinalBirth_lt x + +theorem ordinalBirth_old_meet (localMeet : p.LocalOldMeet) : + OldMeet (P := p.unionOrder) p.ordinalBirth := + p.union_old_meet localMeet + +theorem boundedBirth_old_meet (localMeet : p.LocalOldMeet) : + OldMeet (P := p.boundedOrder) p.boundedBirth := + FixedTop.old_meet_preserved p.unionOrder p.ordinalBirth α.val p.ordinalBirth_lt + (p.ordinalBirth_old_meet localMeet) + +noncomputable def boundedBirth_incoming_layer + (Space : Ordinal.{0} → Type 1) (orders : ∀ i, MeetOrder (Space i)) : + GrowthLayer Space orders p.boundedOrder p.boundedBirth α.val := + FixedTop.incoming_layer p.unionOrder Space orders p.ordinalBirth α.val p.ordinalBirth_lt + +theorem countable_ordinal_chronological_limit + (h : p.Heights (lexOrder CountableColumns.order).toHeightOrder) + (top : ∀ i, p.system.Point i) + (greatest : ∀ i x, (p.order i).le x (top i)) + (countable : ∀ i, CountableRange (h.height i).value) + (localMeet : p.LocalOldMeet) (own : p.OwnLayers) : + ∃ height : StrictHeight p.boundedOrder (lexOrder CountableColumns.order).toHeightOrder, + (∀ i x, height.value ((p.boundedInclusion i).toFun x) = (h.height i).value x) ∧ + CountableRange height.value ∧ + AllFiltersCountable p.boundedOrder ∧ + OldMeet (P := p.boundedOrder) p.boundedBirth ∧ + (∀ i x, p.boundedBirth ((p.boundedInclusion i).toFun x) = + (p.system.stageBirth i x).val) ∧ + (∀ x, p.boundedBirth x = α.val ↔ x = none) := by + let : Countable (Set.Iio α.val) := (initialSegment_countable α).to_subtype + rcases h.bounded_countable_limit top greatest countable with ⟨height, fixed, small⟩ + exact ⟨height, fixed, small, p.rational_bounded_all_filters_countable h localMeet own, + p.boundedBirth_old_meet localMeet, p.boundedBirth_stage, p.boundedBirth_at_limit_iff⟩ + +end MeetSystem +end PartitionPilot.Compression.RecursiveMaps + + + +namespace PartitionPilot.Compression.RecursiveMaps.Chronological + +universe u +variable {A B Stage : Type u} [LinearOrder Stage] + {P : MeetOrder A} {Q : MeetOrder B} + +def NewOldMeet (birth : A → Stage) (s : Stage) : Prop := + ∀ x y, birth x = s → birth y < s → ¬ P.le x y → birth (P.meet x y) < s + +theorem NewOldMeet.transport {birthA : A → Stage} {birthB : B → Stage} {s : Stage} + (localMeet : NewOldMeet (P := P) birthA s) (e : MeetEmbedding P Q) + (preserves : ∀ x, birthB (e.toFun x) = birthA x) + (cover : ∀ y, ∃ x, e.toFun x = y) : NewOldMeet (P := Q) birthB s := by + intro x y born earlier notLower + rcases cover x with ⟨a, rfl⟩ + rcases cover y with ⟨b, rfl⟩ + rw [preserves] at born earlier + have old := localMeet a b born earlier (fun lower => notLower ((e.le_iff a b).mpr lower)) + rw [← e.map_meet, preserves] + exact old + +theorem OldMeet.transport {birthA : A → Stage} {birthB : B → Stage} + (previous : OldMeet (P := P) birthA) (e : MeetEmbedding P Q) + (preserves : ∀ x, birthB (e.toFun x) = birthA x) + (cover : ∀ y, ∃ x, e.toFun x = y) : OldMeet (P := Q) birthB := by + intro x y earlier notLower + rcases cover x with ⟨a, rfl⟩ + rcases cover y with ⟨b, rfl⟩ + rw [preserves, preserves] at earlier + have old := previous a b earlier (fun lower => notLower ((e.le_iff a b).mpr lower)) + rw [← e.map_meet, preserves, preserves] + exact old + +end PartitionPilot.Compression.RecursiveMaps.Chronological + +namespace PartitionPilot.Attachment.Templates + +open Compression Compression.RecursiveMaps Compression.RecursiveMaps.Chronological +universe u +variable {A I Stage : Type u} [LinearOrder Stage] {P : MeetOrder A} + (b : Templates.{u,u,u} P I) + +def birth (oldBirth : A → Stage) (s : Stage) : A ⊕ b.Fresh → Stage + | .inl a => oldBirth a + | .inr _ => s + +theorem birth_le (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (x : A ⊕ b.Fresh) : b.birth oldBirth s x ≤ s := by + cases x with + | inl a => exact (old a).le + | inr _ => exact le_rfl + +theorem birth_at_step_iff (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (x : A ⊕ b.Fresh) : b.birth oldBirth s x = s ↔ ∃ y, x = .inr y := by + cases x with + | inl a => + constructor + · intro eq + exact False.elim ((ne_of_lt (old a)) eq) + · rintro ⟨y, eq⟩ + cases eq + | inr y => exact ⟨fun _ => ⟨y, rfl⟩, fun _ => rfl⟩ + +theorem old_meet_preserved (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (previous : OldMeet (P := P) oldBirth) : OldMeet (P := b.extension) (b.birth oldBirth s) := + attachment_old_meet b (b.birth oldBirth s) s old (fun _ => rfl) previous + +theorem new_old_meet (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : + NewOldMeet (P := b.extension) (b.birth oldBirth s) s := by + intro x y born earlier notLower + rcases (b.birth_at_step_iff oldBirth s old x).mp born with ⟨x, rfl⟩ + cases y with + | inl a => + rw [b.shadow_meet_eq x a notLower] + exact old _ + | inr y => exact False.elim (lt_irrefl s earlier) + +noncomputable def earlier_layer {Space : Stage → Type u} {orders : ∀ t, MeetOrder (Space t)} + (oldBirth : A → Stage) (s t : Stage) (earlier : t < s) + (layer : GrowthLayer Space orders P oldBirth t) : + GrowthLayer Space orders b.extension (b.birth oldBirth s) t := by + apply layer.transport b.oldEmbedding (fun _ => rfl) + intro x hx + cases x with + | inl a => exact ⟨a, rfl⟩ + | inr y => + change s = t at hx + exact False.elim ((ne_of_lt earlier) hx.symm) + +noncomputable def incoming_layer (Space : Stage → Type u) (orders : ∀ t, MeetOrder (Space t)) + (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) + (index : I → Stage) (earlier : ∀ i, index i < s) + (template : ∀ i, MeetIso (orders (index i)) (b.order i)) : + GrowthLayer Space orders b.extension (b.birth oldBirth s) s := + attachmentLayer b Space orders (b.birth oldBirth s) s old index earlier template + +end PartitionPilot.Attachment.Templates + +namespace PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input + +open Chronological +universe u +variable {A B Stage : Type u} [LinearOrder Stage] + {P : MeetOrder A} {Q : MeetOrder B} (g : Input P Q) + +theorem new_old_meet (oldBirth : A → Stage) (s : Stage) (old : ∀ x, oldBirth x < s) : + NewOldMeet (P := g.order) (g.birth oldBirth s) s := by + intro x y born earlier _ + cases x with + | inl a => exact False.elim ((ne_of_lt (old a)) born) + | inr x => + cases y with + | inl a => + rw [g.new_shadow_meet] + exact old _ + | inr y => exact False.elim (lt_irrefl s earlier) + +end PartitionPilot.Compression.RecursiveMaps.PrincipalAmalgamation.Input + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/BlockPivot.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/BlockPivot.lean index 77af2e11dd7c0474b21f14b47b57491d88b8a036..9684080dda8cc2b3a63a45070f33a4931eb398df 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/BlockPivot.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/BlockPivot.lean @@ -1,221 +1,221 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] - [DecidableEq I] [DecidableEq J] - -structure BlockPivot (E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)) where - coefficient : K - nonzero : coefficient ≠ 0 - color : ∀ j, (E.placement (.inr (.inl j))).color = (E.placement (.inl j)).color - cochain : ∀ j, (E.placement (.inr (.inl j))).cochain = - (E.placement (.inl j)).cochain + 1 - internal : ∀ j, (E.placement (.inr (.inl j))).internal = - (E.placement (.inl j)).internal - entry : ∀ i j, E.differential (.inl i) (.inr (.inl j)) = - coefficient • projectiveIdentity Q (fun j => E.placement (.inl j)) i j - -namespace BlockPivot - -variable {E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)} (p : BlockPivot Q E) - -noncomputable def homotopy : Matrix (J ⊕ J ⊕ I) (J ⊕ J ⊕ I) (Q.Zigzag K) - | .inr (.inl i), .inl j => - p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j - | _, _ => 0 - -omit [DecidableEq I] in -lemma homotopy_entries : ProjectiveEntries Q E.placement E.placement (p.homotopy Q) := by - constructor - · intro i j - rcases i with i | i | i <;> rcases j with j | j | j - all_goals try exact MulZeroClass.mul_zero _ - change vertexId Q (E.placement (.inr (.inl i))).color * - (p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j) = _ - rw [p.color, mul_smul] - exact congrArg (p.coefficient⁻¹ • ·) - ((projectiveEntries_identity Q (p := fun j => E.placement (.inl j))).1 i j) - · intro i j - rcases i with i | i | i <;> rcases j with j | j | j - all_goals try exact MulZeroClass.zero_mul _ - change (p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j) * - vertexId Q (E.placement (.inl j)).color = _ - rw [smul_mul] - exact congrArg (p.coefficient⁻¹ • ·) - ((projectiveEntries_identity Q (p := fun j => E.placement (.inl j))).2 i j) - -omit [DecidableEq I] in -lemma homotopy_degree : MapDegree Q E.placement E.placement (-1) 0 (p.homotopy Q) := by - intro i j - rcases i with i | i | i <;> rcases j with j | j | j - all_goals try exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - by_cases hij : i = j - · subst j - change ( (E.placement (.inl i)).cochain ≠ (E.placement (.inr (.inl i))).cochain + -1 → - p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i i = 0) ∧ _ - refine ⟨fun h => (h (by rw [p.cochain]; omega)).elim, ?_⟩ - change Homogeneous Q (0 + (E.placement (.inr (.inl i))).internal - - (E.placement (.inl i)).internal) (p.coefficient⁻¹ • projectiveIdentity Q - (fun j => E.placement (.inl j)) i i) - rw [p.internal] - simp only [projectiveIdentity, Matrix.diagonal_apply, ite_true] - simpa only [zero_add, sub_self] using homogeneous_smul Q (r := p.coefficient⁻¹) - (hx := homogeneous_vertexId Q (K := K) (E.placement (.inl i)).color) - · change (_ → p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j = 0) ∧ _ - change (_ → p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j = 0) ∧ - Homogeneous Q _ (p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j) - rw [show projectiveIdentity Q (fun j => E.placement (.inl j)) i j = 0 by - simp only [projectiveIdentity, Matrix.diagonal_apply, ite_eq_right hij], smul_zero] - exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - -omit [DecidableEq I] in -lemma homotopy_mul {L : Type*} (M : Matrix (J ⊕ J ⊕ I) L (Q.Zigzag K)) - {q : L → GeneratorPlacement V} (hM : ProjectiveEntries Q E.placement q M) - (i : J ⊕ J ⊕ I) (j : L) : - (p.homotopy Q * M) i j = match i with - | .inr (.inl k) => p.coefficient⁻¹ • M (.inl k) j - | _ => 0 := by - rcases i with i | i | i - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, homotopy, - MulZeroClass.zero_mul, Finset.sum_const_zero, add_zero] - simp only [projectiveIdentity, Matrix.diagonal_apply, smul_ite, smul_zero, - ite_mul, MulZeroClass.zero_mul, Finset.sum_ite_eq, Finset.mem_univ, ite_true, - smul_mul, hM.1] - -omit [DecidableEq I] in -lemma mul_homotopy {L : Type*} [Fintype L] - (M : Matrix L (J ⊕ J ⊕ I) (Q.Zigzag K)) - {q : L → GeneratorPlacement V} (hM : ProjectiveEntries Q q E.placement M) - (i : L) (j : J ⊕ J ⊕ I) : - (M * p.homotopy Q) i j = match j with - | .inl k => p.coefficient⁻¹ • M i (.inr (.inl k)) - | _ => 0 := by - rcases j with j | j | j - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, homotopy, - MulZeroClass.mul_zero, Finset.sum_const_zero, add_zero, zero_add] - simp only [projectiveIdentity, Matrix.diagonal_apply, smul_ite, smul_zero, - mul_ite, MulZeroClass.mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true, - mul_smul] - rw [← p.color] - exact congrArg (p.coefficient⁻¹ • ·) (hM.2 i (.inr (.inl j))) - -omit [DecidableEq I] in -lemma homotopy_square : p.homotopy Q * p.homotopy Q = 0 := by - apply Matrix.ext - intro i j - rw [p.homotopy_mul Q _ (p.homotopy_entries Q)] - rcases i with i | i | i - · rfl - · exact smul_zero _ - · rfl - -omit [DecidableEq I] in -lemma homotopy_retract : p.homotopy Q * E.differential * p.homotopy Q = p.homotopy Q := by - apply Matrix.ext - intro i j - rw [p.mul_homotopy Q _ (projectiveEntries_mul Q (p.homotopy_entries Q) E.entries)] - rcases j with j | j | j - · change p.coefficient⁻¹ • (p.homotopy Q * E.differential) i (.inr (.inl j)) = _ - rw [p.homotopy_mul Q _ E.entries] - rcases i with i | i | i - · exact smul_zero _ - · dsimp only - rw [p.entry] - change p.coefficient⁻¹ • (p.coefficient⁻¹ • (p.coefficient • _)) = p.coefficient⁻¹ • _ - congr 1 - rw [smul_smul, inv_mul_cancel₀ p.nonzero, one_smul] - · exact smul_zero _ - · rcases i with i | i | i <;> rfl - · rcases i with i | i | i <;> rfl - -noncomputable def remainder : Matrix (J ⊕ J ⊕ I) (J ⊕ J ⊕ I) (Q.Zigzag K) := - GaussianCancellation.cornerRemainder (projectiveIdentity Q E.placement) - E.differential (p.homotopy Q) - -lemma remainder_entries : ProjectiveEntries Q E.placement E.placement (p.remainder Q) := by - unfold remainder GaussianCancellation.cornerRemainder - simp only [sub_eq_add_neg] - exact projectiveEntries_add Q - (projectiveEntries_add Q (projectiveEntries_identity Q) - (projectiveEntries_neg Q (projectiveEntries_mul Q E.entries (p.homotopy_entries Q)))) - (projectiveEntries_neg Q (projectiveEntries_mul Q (p.homotopy_entries Q) E.entries)) - -lemma remainder_degree : MapDegree Q E.placement E.placement 0 0 (p.remainder Q) := by - have h₁ := mapDegree_mul Q E.degree (p.homotopy_degree Q) - have h₂ := mapDegree_mul Q (p.homotopy_degree Q) E.degree - norm_num at h₁ h₂ - unfold remainder GaussianCancellation.cornerRemainder - simp only [sub_eq_add_neg] - exact mapDegree_add Q (mapDegree_add Q (mapDegree_identity Q) (mapDegree_neg Q h₁)) - (mapDegree_neg Q h₂) - -lemma remainder_commutes : p.remainder Q * E.differential = E.differential * p.remainder Q := - GaussianCancellation.cornerRemainder_commutes _ _ _ - (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero - -lemma remainder_square : p.remainder Q * p.remainder Q = p.remainder Q := - GaussianCancellation.cornerRemainder_idempotent _ _ _ - (projectiveIdentity_mul Q (projectiveEntries_identity Q)) - (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) - (projectiveIdentity_mul Q (p.homotopy_entries Q)) - (mul_projectiveIdentity Q (p.homotopy_entries Q)) - E.square_zero (p.homotopy_square Q) (p.homotopy_retract Q) - -lemma remainder_source_row (i : J) (k : J ⊕ J ⊕ I) : p.remainder Q (.inl i) k = 0 := by - change (projectiveIdentity Q E.placement) (.inl i) k - - (E.differential * p.homotopy Q) (.inl i) k - - (p.homotopy Q * E.differential) (.inl i) k = 0 - rw [p.homotopy_mul Q _ E.entries, sub_zero, p.mul_homotopy Q _ E.entries] - rcases k with k | k | k - · dsimp only - rw [p.entry, smul_smul, inv_mul_cancel₀ p.nonzero, one_smul] - simp only [projectiveIdentity, Matrix.diagonal_apply, Sum.inl.injEq, sub_self] - · simp [projectiveIdentity] - · simp [projectiveIdentity] - -lemma remainder_target_column (k : J ⊕ J ⊕ I) (j : J) : - p.remainder Q k (.inr (.inl j)) = 0 := by - change (projectiveIdentity Q E.placement) k (.inr (.inl j)) - - (E.differential * p.homotopy Q) k (.inr (.inl j)) - - (p.homotopy Q * E.differential) k (.inr (.inl j)) = 0 - rw [p.mul_homotopy Q _ E.entries, sub_zero, p.homotopy_mul Q _ E.entries] - rcases k with k | k | k - · simp [projectiveIdentity] - · dsimp only - rw [p.entry, smul_smul, inv_mul_cancel₀ p.nonzero, one_smul] - simp only [projectiveIdentity, Matrix.diagonal_apply, Sum.inr.injEq, Sum.inl.injEq] - by_cases h : k = j - · subst j - simp only [ite_true, p.color, sub_self] - · simp only [ite_eq_right h, sub_self] - · simp [projectiveIdentity] - -lemma remainder_retained (i j : I) : p.remainder Q (.inr (.inr i)) (.inr (.inr j)) = - projectiveIdentity Q (fun k => E.placement (.inr (.inr k))) i j := by - change (projectiveIdentity Q E.placement) (.inr (.inr i)) (.inr (.inr j)) - - (E.differential * p.homotopy Q) (.inr (.inr i)) (.inr (.inr j)) - - (p.homotopy Q * E.differential) (.inr (.inr i)) (.inr (.inr j)) = _ - rw [p.mul_homotopy Q _ E.entries, p.homotopy_mul Q _ E.entries] - by_cases hij : i = j - · subst j - simp [projectiveIdentity] - · simp [projectiveIdentity, hij] - -omit [DecidableEq I] [DecidableEq J] in -lemma retained_sum {X Y : Type*} (U : Matrix X (J ⊕ J ⊕ I) (Q.Zigzag K)) - (M : Matrix (J ⊕ J ⊕ I) Y (Q.Zigzag K)) - (hU : ∀ i j, U i (.inr (.inl j)) = 0) (hM : ∀ i j, M (.inl i) j = 0) - (i : X) (j : Y) : - (∑ k : I, U i (.inr (.inr k)) * M (.inr (.inr k)) j) = (U * M) i j := by - simp only [Matrix.mul_apply, Fintype.sum_sum_type, hU, hM, MulZeroClass.mul_zero, - MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add] - -end BlockPivot -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] + [DecidableEq I] [DecidableEq J] + +structure BlockPivot (E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)) where + coefficient : K + nonzero : coefficient ≠ 0 + color : ∀ j, (E.placement (.inr (.inl j))).color = (E.placement (.inl j)).color + cochain : ∀ j, (E.placement (.inr (.inl j))).cochain = + (E.placement (.inl j)).cochain + 1 + internal : ∀ j, (E.placement (.inr (.inl j))).internal = + (E.placement (.inl j)).internal + entry : ∀ i j, E.differential (.inl i) (.inr (.inl j)) = + coefficient • projectiveIdentity Q (fun j => E.placement (.inl j)) i j + +namespace BlockPivot + +variable {E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)} (p : BlockPivot Q E) + +noncomputable def homotopy : Matrix (J ⊕ J ⊕ I) (J ⊕ J ⊕ I) (Q.Zigzag K) + | .inr (.inl i), .inl j => + p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j + | _, _ => 0 + +omit [DecidableEq I] in +lemma homotopy_entries : ProjectiveEntries Q E.placement E.placement (p.homotopy Q) := by + constructor + · intro i j + rcases i with i | i | i <;> rcases j with j | j | j + all_goals try exact MulZeroClass.mul_zero _ + change vertexId Q (E.placement (.inr (.inl i))).color * + (p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j) = _ + rw [p.color, mul_smul] + exact congrArg (p.coefficient⁻¹ • ·) + ((projectiveEntries_identity Q (p := fun j => E.placement (.inl j))).1 i j) + · intro i j + rcases i with i | i | i <;> rcases j with j | j | j + all_goals try exact MulZeroClass.zero_mul _ + change (p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j) * + vertexId Q (E.placement (.inl j)).color = _ + rw [smul_mul] + exact congrArg (p.coefficient⁻¹ • ·) + ((projectiveEntries_identity Q (p := fun j => E.placement (.inl j))).2 i j) + +omit [DecidableEq I] in +lemma homotopy_degree : MapDegree Q E.placement E.placement (-1) 0 (p.homotopy Q) := by + intro i j + rcases i with i | i | i <;> rcases j with j | j | j + all_goals try exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + by_cases hij : i = j + · subst j + change ( (E.placement (.inl i)).cochain ≠ (E.placement (.inr (.inl i))).cochain + -1 → + p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i i = 0) ∧ _ + refine ⟨fun h => (h (by rw [p.cochain]; omega)).elim, ?_⟩ + change Homogeneous Q (0 + (E.placement (.inr (.inl i))).internal - + (E.placement (.inl i)).internal) (p.coefficient⁻¹ • projectiveIdentity Q + (fun j => E.placement (.inl j)) i i) + rw [p.internal] + simp only [projectiveIdentity, Matrix.diagonal_apply, ite_true] + simpa only [zero_add, sub_self] using homogeneous_smul Q (r := p.coefficient⁻¹) + (hx := homogeneous_vertexId Q (K := K) (E.placement (.inl i)).color) + · change (_ → p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j = 0) ∧ _ + change (_ → p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j = 0) ∧ + Homogeneous Q _ (p.coefficient⁻¹ • projectiveIdentity Q (fun j => E.placement (.inl j)) i j) + rw [show projectiveIdentity Q (fun j => E.placement (.inl j)) i j = 0 by + simp only [projectiveIdentity, Matrix.diagonal_apply, ite_eq_right hij], smul_zero] + exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + +omit [DecidableEq I] in +lemma homotopy_mul {L : Type*} (M : Matrix (J ⊕ J ⊕ I) L (Q.Zigzag K)) + {q : L → GeneratorPlacement V} (hM : ProjectiveEntries Q E.placement q M) + (i : J ⊕ J ⊕ I) (j : L) : + (p.homotopy Q * M) i j = match i with + | .inr (.inl k) => p.coefficient⁻¹ • M (.inl k) j + | _ => 0 := by + rcases i with i | i | i + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, homotopy, + MulZeroClass.zero_mul, Finset.sum_const_zero, add_zero] + simp only [projectiveIdentity, Matrix.diagonal_apply, smul_ite, smul_zero, + ite_mul, MulZeroClass.zero_mul, Finset.sum_ite_eq, Finset.mem_univ, ite_true, + smul_mul, hM.1] + +omit [DecidableEq I] in +lemma mul_homotopy {L : Type*} [Fintype L] + (M : Matrix L (J ⊕ J ⊕ I) (Q.Zigzag K)) + {q : L → GeneratorPlacement V} (hM : ProjectiveEntries Q q E.placement M) + (i : L) (j : J ⊕ J ⊕ I) : + (M * p.homotopy Q) i j = match j with + | .inl k => p.coefficient⁻¹ • M i (.inr (.inl k)) + | _ => 0 := by + rcases j with j | j | j + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, homotopy, + MulZeroClass.mul_zero, Finset.sum_const_zero, add_zero, zero_add] + simp only [projectiveIdentity, Matrix.diagonal_apply, smul_ite, smul_zero, + mul_ite, MulZeroClass.mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true, + mul_smul] + rw [← p.color] + exact congrArg (p.coefficient⁻¹ • ·) (hM.2 i (.inr (.inl j))) + +omit [DecidableEq I] in +lemma homotopy_square : p.homotopy Q * p.homotopy Q = 0 := by + apply Matrix.ext + intro i j + rw [p.homotopy_mul Q _ (p.homotopy_entries Q)] + rcases i with i | i | i + · rfl + · exact smul_zero _ + · rfl + +omit [DecidableEq I] in +lemma homotopy_retract : p.homotopy Q * E.differential * p.homotopy Q = p.homotopy Q := by + apply Matrix.ext + intro i j + rw [p.mul_homotopy Q _ (projectiveEntries_mul Q (p.homotopy_entries Q) E.entries)] + rcases j with j | j | j + · change p.coefficient⁻¹ • (p.homotopy Q * E.differential) i (.inr (.inl j)) = _ + rw [p.homotopy_mul Q _ E.entries] + rcases i with i | i | i + · exact smul_zero _ + · dsimp only + rw [p.entry] + change p.coefficient⁻¹ • (p.coefficient⁻¹ • (p.coefficient • _)) = p.coefficient⁻¹ • _ + congr 1 + rw [smul_smul, inv_mul_cancel₀ p.nonzero, one_smul] + · exact smul_zero _ + · rcases i with i | i | i <;> rfl + · rcases i with i | i | i <;> rfl + +noncomputable def remainder : Matrix (J ⊕ J ⊕ I) (J ⊕ J ⊕ I) (Q.Zigzag K) := + GaussianCancellation.cornerRemainder (projectiveIdentity Q E.placement) + E.differential (p.homotopy Q) + +lemma remainder_entries : ProjectiveEntries Q E.placement E.placement (p.remainder Q) := by + unfold remainder GaussianCancellation.cornerRemainder + simp only [sub_eq_add_neg] + exact projectiveEntries_add Q + (projectiveEntries_add Q (projectiveEntries_identity Q) + (projectiveEntries_neg Q (projectiveEntries_mul Q E.entries (p.homotopy_entries Q)))) + (projectiveEntries_neg Q (projectiveEntries_mul Q (p.homotopy_entries Q) E.entries)) + +lemma remainder_degree : MapDegree Q E.placement E.placement 0 0 (p.remainder Q) := by + have h₁ := mapDegree_mul Q E.degree (p.homotopy_degree Q) + have h₂ := mapDegree_mul Q (p.homotopy_degree Q) E.degree + norm_num at h₁ h₂ + unfold remainder GaussianCancellation.cornerRemainder + simp only [sub_eq_add_neg] + exact mapDegree_add Q (mapDegree_add Q (mapDegree_identity Q) (mapDegree_neg Q h₁)) + (mapDegree_neg Q h₂) + +lemma remainder_commutes : p.remainder Q * E.differential = E.differential * p.remainder Q := + GaussianCancellation.cornerRemainder_commutes _ _ _ + (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero + +lemma remainder_square : p.remainder Q * p.remainder Q = p.remainder Q := + GaussianCancellation.cornerRemainder_idempotent _ _ _ + (projectiveIdentity_mul Q (projectiveEntries_identity Q)) + (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) + (projectiveIdentity_mul Q (p.homotopy_entries Q)) + (mul_projectiveIdentity Q (p.homotopy_entries Q)) + E.square_zero (p.homotopy_square Q) (p.homotopy_retract Q) + +lemma remainder_source_row (i : J) (k : J ⊕ J ⊕ I) : p.remainder Q (.inl i) k = 0 := by + change (projectiveIdentity Q E.placement) (.inl i) k - + (E.differential * p.homotopy Q) (.inl i) k - + (p.homotopy Q * E.differential) (.inl i) k = 0 + rw [p.homotopy_mul Q _ E.entries, sub_zero, p.mul_homotopy Q _ E.entries] + rcases k with k | k | k + · dsimp only + rw [p.entry, smul_smul, inv_mul_cancel₀ p.nonzero, one_smul] + simp only [projectiveIdentity, Matrix.diagonal_apply, Sum.inl.injEq, sub_self] + · simp [projectiveIdentity] + · simp [projectiveIdentity] + +lemma remainder_target_column (k : J ⊕ J ⊕ I) (j : J) : + p.remainder Q k (.inr (.inl j)) = 0 := by + change (projectiveIdentity Q E.placement) k (.inr (.inl j)) - + (E.differential * p.homotopy Q) k (.inr (.inl j)) - + (p.homotopy Q * E.differential) k (.inr (.inl j)) = 0 + rw [p.mul_homotopy Q _ E.entries, sub_zero, p.homotopy_mul Q _ E.entries] + rcases k with k | k | k + · simp [projectiveIdentity] + · dsimp only + rw [p.entry, smul_smul, inv_mul_cancel₀ p.nonzero, one_smul] + simp only [projectiveIdentity, Matrix.diagonal_apply, Sum.inr.injEq, Sum.inl.injEq] + by_cases h : k = j + · subst j + simp only [ite_true, p.color, sub_self] + · simp only [ite_eq_right h, sub_self] + · simp [projectiveIdentity] + +lemma remainder_retained (i j : I) : p.remainder Q (.inr (.inr i)) (.inr (.inr j)) = + projectiveIdentity Q (fun k => E.placement (.inr (.inr k))) i j := by + change (projectiveIdentity Q E.placement) (.inr (.inr i)) (.inr (.inr j)) - + (E.differential * p.homotopy Q) (.inr (.inr i)) (.inr (.inr j)) - + (p.homotopy Q * E.differential) (.inr (.inr i)) (.inr (.inr j)) = _ + rw [p.mul_homotopy Q _ E.entries, p.homotopy_mul Q _ E.entries] + by_cases hij : i = j + · subst j + simp [projectiveIdentity] + · simp [projectiveIdentity, hij] + +omit [DecidableEq I] [DecidableEq J] in +lemma retained_sum {X Y : Type*} (U : Matrix X (J ⊕ J ⊕ I) (Q.Zigzag K)) + (M : Matrix (J ⊕ J ⊕ I) Y (Q.Zigzag K)) + (hU : ∀ i j, U i (.inr (.inl j)) = 0) (hM : ∀ i j, M (.inl i) j = 0) + (i : X) (j : Y) : + (∑ k : I, U i (.inr (.inr k)) * M (.inr (.inr k)) j) = (U * M) i j := by + simp only [Matrix.mul_apply, Fintype.sum_sum_type, hU, hM, MulZeroClass.mul_zero, + MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add] + +end BlockPivot +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/CornerInverse.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/CornerInverse.lean index d4d6f224cd39c5917f945b110ba42d8e67c76664..9a69966f886ce95b2795c0294d57362e9ef62748 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/CornerInverse.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/CornerInverse.lean @@ -1,19 +1,19 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ReversibleQuiver - -namespace OAI - -namespace HarmonicArtin.GaussianCancellation - -lemma corner_inverse {R : Type*} [Ring R] - (e n : R) (he : e * e = e) - (hen : e * n = n) (hne : n * e = n) (hn : n * n * n = 0) : - (e + n) * (e - n + n * n) = e ∧ - (e - n + n * n) * (e + n) = e := by - have henn : e * (n * n) = n * n := by rw [← mul_assoc, hen] - have hnnn : n * (n * n) = 0 := by rwa [← mul_assoc] - constructor <;> noncomm_ring [he, hen, hne, henn, hnnn] - -end HarmonicArtin.GaussianCancellation - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ReversibleQuiver + +namespace OAI + +namespace HarmonicArtin.GaussianCancellation + +lemma corner_inverse {R : Type*} [Ring R] + (e n : R) (he : e * e = e) + (hen : e * n = n) (hne : n * e = n) (hn : n * n * n = 0) : + (e + n) * (e - n + n * n) = e ∧ + (e - n + n * n) * (e + n) = e := by + have henn : e * (n * n) = n * n := by rw [← mul_assoc, hen] + have hnnn : n * (n * n) = 0 := by rwa [← mul_assoc] + constructor <;> noncomm_ring [he, hen, hne, henn, hnnn] + +end HarmonicArtin.GaussianCancellation + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/CornerRemainder.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/CornerRemainder.lean index 8adc77fdb30ab95b68632fed404eb0b44195b436..8d01a9bb8ed6b41657b94a17b88a64ccf80513bb 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/CornerRemainder.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/CornerRemainder.lean @@ -1,77 +1,77 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ReversibleQuiver - -namespace OAI - -namespace HarmonicArtin.GaussianCancellation - -variable {R : Type*} [Ring R] - -def cornerRemainder (e d h : R) : R := e - d * h - h * d - -variable (e d h : R) - (hee : e * e = e) (hed : e * d = d) (hde : d * e = d) - (heh : e * h = h) (hhe : h * e = h) - (hd : d * d = 0) (hh : h * h = 0) (hhdh : h * d * h = h) - -include hed hd in -lemma cornerRemainder_mul_d : cornerRemainder e d h * d = d - d * h * d := by - simp only [cornerRemainder, sub_mul, hed, mul_assoc, hd, mul_zero, sub_zero] - -include hde hd in -lemma d_mul_cornerRemainder : d * cornerRemainder e d h = d - d * h * d := by - simp only [cornerRemainder, mul_sub, hde, ← mul_assoc, hd, zero_mul, sub_zero] - -include hed hde hd in -lemma cornerRemainder_commutes : - cornerRemainder e d h * d = d * cornerRemainder e d h := by - rw [cornerRemainder_mul_d e d h hed hd, d_mul_cornerRemainder e d h hde hd] - -include hhe hh hhdh in -lemma h_mul_cornerRemainder : h * cornerRemainder e d h = 0 := by - simp only [cornerRemainder, mul_sub, hhe, ← mul_assoc, hh, zero_mul, hhdh] - abel - -include heh hh hhdh in -lemma cornerRemainder_mul_h : cornerRemainder e d h * h = 0 := by - have hdsh : d * h * h = 0 := by rw [mul_assoc, hh, mul_zero] - simp only [cornerRemainder, sub_mul, heh, hdsh, hhdh] - abel - -include hee hed heh in -lemma e_mul_cornerRemainder : e * cornerRemainder e d h = cornerRemainder e d h := by - simp only [cornerRemainder, mul_sub, hee, ← mul_assoc, hed, heh] - -include hee hde hhe in -lemma cornerRemainder_mul_e : cornerRemainder e d h * e = cornerRemainder e d h := by - simp only [cornerRemainder, sub_mul, hee, mul_assoc, hde, hhe] - -include hee hed hde heh hhe hd hh hhdh in -lemma cornerRemainder_idempotent : - cornerRemainder e d h * cornerRemainder e d h = cornerRemainder e d h := by - calc - cornerRemainder e d h * cornerRemainder e d h = - e * cornerRemainder e d h - d * (h * cornerRemainder e d h) - - h * (d * cornerRemainder e d h) := by - conv_lhs => lhs; unfold cornerRemainder - noncomm_ring - _ = cornerRemainder e d h := by - rw [e_mul_cornerRemainder e d h hee hed heh, - h_mul_cornerRemainder e d h hhe hh hhdh, mul_zero, sub_zero, - ← cornerRemainder_commutes e d h hed hde hd, ← mul_assoc, - h_mul_cornerRemainder e d h hhe hh hhdh, zero_mul, sub_zero] - -include hed hde hd in -lemma cornerReduced_square : - (cornerRemainder e d h * d) * (cornerRemainder e d h * d) = 0 := by - rw [mul_assoc, ← mul_assoc d, ← cornerRemainder_commutes e d h hed hde hd, - mul_assoc _ d d, hd, mul_zero, mul_zero] - -lemma cornerRemainder_homotopy : - cornerRemainder e d h = e + (d * (-h) + (-h) * d) := by - simp only [cornerRemainder, mul_neg, neg_mul] - abel - -end HarmonicArtin.GaussianCancellation - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ReversibleQuiver + +namespace OAI + +namespace HarmonicArtin.GaussianCancellation + +variable {R : Type*} [Ring R] + +def cornerRemainder (e d h : R) : R := e - d * h - h * d + +variable (e d h : R) + (hee : e * e = e) (hed : e * d = d) (hde : d * e = d) + (heh : e * h = h) (hhe : h * e = h) + (hd : d * d = 0) (hh : h * h = 0) (hhdh : h * d * h = h) + +include hed hd in +lemma cornerRemainder_mul_d : cornerRemainder e d h * d = d - d * h * d := by + simp only [cornerRemainder, sub_mul, hed, mul_assoc, hd, mul_zero, sub_zero] + +include hde hd in +lemma d_mul_cornerRemainder : d * cornerRemainder e d h = d - d * h * d := by + simp only [cornerRemainder, mul_sub, hde, ← mul_assoc, hd, zero_mul, sub_zero] + +include hed hde hd in +lemma cornerRemainder_commutes : + cornerRemainder e d h * d = d * cornerRemainder e d h := by + rw [cornerRemainder_mul_d e d h hed hd, d_mul_cornerRemainder e d h hde hd] + +include hhe hh hhdh in +lemma h_mul_cornerRemainder : h * cornerRemainder e d h = 0 := by + simp only [cornerRemainder, mul_sub, hhe, ← mul_assoc, hh, zero_mul, hhdh] + abel + +include heh hh hhdh in +lemma cornerRemainder_mul_h : cornerRemainder e d h * h = 0 := by + have hdsh : d * h * h = 0 := by rw [mul_assoc, hh, mul_zero] + simp only [cornerRemainder, sub_mul, heh, hdsh, hhdh] + abel + +include hee hed heh in +lemma e_mul_cornerRemainder : e * cornerRemainder e d h = cornerRemainder e d h := by + simp only [cornerRemainder, mul_sub, hee, ← mul_assoc, hed, heh] + +include hee hde hhe in +lemma cornerRemainder_mul_e : cornerRemainder e d h * e = cornerRemainder e d h := by + simp only [cornerRemainder, sub_mul, hee, mul_assoc, hde, hhe] + +include hee hed hde heh hhe hd hh hhdh in +lemma cornerRemainder_idempotent : + cornerRemainder e d h * cornerRemainder e d h = cornerRemainder e d h := by + calc + cornerRemainder e d h * cornerRemainder e d h = + e * cornerRemainder e d h - d * (h * cornerRemainder e d h) - + h * (d * cornerRemainder e d h) := by + conv_lhs => lhs; unfold cornerRemainder + noncomm_ring + _ = cornerRemainder e d h := by + rw [e_mul_cornerRemainder e d h hee hed heh, + h_mul_cornerRemainder e d h hhe hh hhdh, mul_zero, sub_zero, + ← cornerRemainder_commutes e d h hed hde hd, ← mul_assoc, + h_mul_cornerRemainder e d h hhe hh hhdh, zero_mul, sub_zero] + +include hed hde hd in +lemma cornerReduced_square : + (cornerRemainder e d h * d) * (cornerRemainder e d h * d) = 0 := by + rw [mul_assoc, ← mul_assoc d, ← cornerRemainder_commutes e d h hed hde hd, + mul_assoc _ d d, hd, mul_zero, mul_zero] + +lemma cornerRemainder_homotopy : + cornerRemainder e d h = e + (d * (-h) + (-h) * d) := by + simp only [cornerRemainder, mul_neg, neg_mul] + abel + +end HarmonicArtin.GaussianCancellation + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential.lean index 65de18709d510a126d0230018b34f7d2e5695739..dd387f8a40d5feffc93934623df75ccdd2d28fd0 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential.lean @@ -1,131 +1,131 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Cancellation.BlockPivot - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] - [DecidableEq I] [DecidableEq J] - {E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)} (p : BlockPivot Q E) - -noncomputable def reducedDifferential : Matrix (J ⊕ J ⊕ I) (J ⊕ J ⊕ I) (Q.Zigzag K) := - p.remainder Q * E.differential - -lemma reducedDifferential_entries : - ProjectiveEntries Q E.placement E.placement (p.reducedDifferential Q) := - projectiveEntries_mul Q (p.remainder_entries Q) E.entries - -lemma reducedDifferential_degree : - MapDegree Q E.placement E.placement 1 0 (p.reducedDifferential Q) := by - exact mapDegree_mul Q (p.remainder_degree Q) E.degree - -lemma reducedDifferential_square : p.reducedDifferential Q * p.reducedDifferential Q = 0 := - GaussianCancellation.cornerReduced_square _ _ _ - (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero - -lemma reducedDifferential_source_row (i : J) (k : J ⊕ J ⊕ I) : - p.reducedDifferential Q (.inl i) k = 0 := by - change (∑ j, p.remainder Q (.inl i) j * E.differential j k) = 0 - simp only [p.remainder_source_row Q, MulZeroClass.zero_mul, Finset.sum_const_zero] - -lemma reducedDifferential_target_column (k : J ⊕ J ⊕ I) (j : J) : - p.reducedDifferential Q k (.inr (.inl j)) = 0 := by - unfold reducedDifferential - rw [p.remainder_commutes Q] - change (∑ l, E.differential k l * p.remainder Q l (.inr (.inl j))) = 0 - simp only [p.remainder_target_column Q, MulZeroClass.mul_zero, Finset.sum_const_zero] - -lemma remainder_mul_reduced : p.remainder Q * p.reducedDifferential Q = p.reducedDifferential Q := by - unfold reducedDifferential - rw [← _root_.mul_assoc, p.remainder_square Q] - -lemma reduced_mul_remainder : p.reducedDifferential Q * p.remainder Q = p.reducedDifferential Q := by - unfold reducedDifferential - rw [_root_.mul_assoc, ← p.remainder_commutes Q, ← _root_.mul_assoc, p.remainder_square Q] - -noncomputable def reduced : BasedComplex Q (K := K) I where - placement := fun i => E.placement (.inr (.inr i)) - differential := fun i j => p.reducedDifferential Q (.inr (.inr i)) (.inr (.inr j)) - entries := ⟨fun i j => (p.reducedDifferential_entries Q).1 _ _, - fun i j => (p.reducedDifferential_entries Q).2 _ _⟩ - degree := fun i j => p.reducedDifferential_degree Q _ _ - square_zero := by - apply Matrix.ext - intro i j - change (∑ k : I, - p.reducedDifferential Q (.inr (.inr i)) (.inr (.inr k)) * - p.reducedDifferential Q (.inr (.inr k)) (.inr (.inr j))) = 0 - rw [retained_sum Q _ _ (p.reducedDifferential_target_column Q) - (p.reducedDifferential_source_row Q), p.reducedDifferential_square Q] - rfl - -noncomputable def reductionMap : Map Q E (p.reduced Q) where - matrix := fun i j => p.remainder Q i (.inr (.inr j)) - entries := ⟨fun i j => (p.remainder_entries Q).1 _ _, - fun i j => (p.remainder_entries Q).2 _ _⟩ - degree := fun i j => p.remainder_degree Q _ _ - commute := by - apply Matrix.ext - intro i j - change (E.differential * p.remainder Q) i (.inr (.inr j)) = - ∑ k : I, p.remainder Q i (.inr (.inr k)) * - p.reducedDifferential Q (.inr (.inr k)) (.inr (.inr j)) - rw [retained_sum Q _ _ (p.remainder_target_column Q) - (p.reducedDifferential_source_row Q), p.remainder_mul_reduced Q, - ← p.remainder_commutes Q] - rfl - -noncomputable def inclusionMap : Map Q (p.reduced Q) E where - matrix := fun i j => p.remainder Q (.inr (.inr i)) j - entries := ⟨fun i j => (p.remainder_entries Q).1 _ _, - fun i j => (p.remainder_entries Q).2 _ _⟩ - degree := fun i j => p.remainder_degree Q _ _ - commute := by - apply Matrix.ext - intro i j - change (∑ k : I, p.reducedDifferential Q (.inr (.inr i)) (.inr (.inr k)) * - p.remainder Q (.inr (.inr k)) j) = - (p.remainder Q * E.differential) (.inr (.inr i)) j - rw [retained_sum Q _ _ (p.reducedDifferential_target_column Q) - (p.remainder_source_row Q), p.reduced_mul_remainder Q] - rfl - -lemma reduction_inclusion : - (p.reductionMap Q).matrix * (p.inclusionMap Q).matrix = p.remainder Q := by - apply Matrix.ext - intro i j - change (∑ k : I, p.remainder Q i (.inr (.inr k)) * - p.remainder Q (.inr (.inr k)) j) = p.remainder Q i j - rw [retained_sum Q _ _ (p.remainder_target_column Q) - (p.remainder_source_row Q), p.remainder_square Q] - -lemma inclusion_reduction : - (p.inclusionMap Q).matrix * (p.reductionMap Q).matrix = - projectiveIdentity Q (p.reduced Q).placement := by - apply Matrix.ext - intro i j - change (p.remainder Q * p.remainder Q) (.inr (.inr i)) (.inr (.inr j)) = _ - rw [p.remainder_square Q, p.remainder_retained Q] - rfl - -noncomputable def reductionEquivalence : HomotopyEquivalence Q E (p.reduced Q) where - forward := p.reductionMap Q - backward := p.inclusionMap Q - sourceHomotopy := -p.homotopy Q - targetHomotopy := 0 - sourceEntries := projectiveEntries_neg Q (p.homotopy_entries Q) - targetEntries := projectiveEntries_zero Q - sourceDegree := mapDegree_neg Q (p.homotopy_degree Q) - targetDegree := mapDegree_zero Q (-1) 0 - sourceEquation := by - rw [p.reduction_inclusion Q] - exact GaussianCancellation.cornerRemainder_homotopy _ _ _ - targetEquation := by - rw [p.inclusion_reduction Q, Matrix.mul_zero, Matrix.zero_mul, add_zero, add_zero] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Cancellation.BlockPivot + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] + [DecidableEq I] [DecidableEq J] + {E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)} (p : BlockPivot Q E) + +noncomputable def reducedDifferential : Matrix (J ⊕ J ⊕ I) (J ⊕ J ⊕ I) (Q.Zigzag K) := + p.remainder Q * E.differential + +lemma reducedDifferential_entries : + ProjectiveEntries Q E.placement E.placement (p.reducedDifferential Q) := + projectiveEntries_mul Q (p.remainder_entries Q) E.entries + +lemma reducedDifferential_degree : + MapDegree Q E.placement E.placement 1 0 (p.reducedDifferential Q) := by + exact mapDegree_mul Q (p.remainder_degree Q) E.degree + +lemma reducedDifferential_square : p.reducedDifferential Q * p.reducedDifferential Q = 0 := + GaussianCancellation.cornerReduced_square _ _ _ + (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero + +lemma reducedDifferential_source_row (i : J) (k : J ⊕ J ⊕ I) : + p.reducedDifferential Q (.inl i) k = 0 := by + change (∑ j, p.remainder Q (.inl i) j * E.differential j k) = 0 + simp only [p.remainder_source_row Q, MulZeroClass.zero_mul, Finset.sum_const_zero] + +lemma reducedDifferential_target_column (k : J ⊕ J ⊕ I) (j : J) : + p.reducedDifferential Q k (.inr (.inl j)) = 0 := by + unfold reducedDifferential + rw [p.remainder_commutes Q] + change (∑ l, E.differential k l * p.remainder Q l (.inr (.inl j))) = 0 + simp only [p.remainder_target_column Q, MulZeroClass.mul_zero, Finset.sum_const_zero] + +lemma remainder_mul_reduced : p.remainder Q * p.reducedDifferential Q = p.reducedDifferential Q := by + unfold reducedDifferential + rw [← _root_.mul_assoc, p.remainder_square Q] + +lemma reduced_mul_remainder : p.reducedDifferential Q * p.remainder Q = p.reducedDifferential Q := by + unfold reducedDifferential + rw [_root_.mul_assoc, ← p.remainder_commutes Q, ← _root_.mul_assoc, p.remainder_square Q] + +noncomputable def reduced : BasedComplex Q (K := K) I where + placement := fun i => E.placement (.inr (.inr i)) + differential := fun i j => p.reducedDifferential Q (.inr (.inr i)) (.inr (.inr j)) + entries := ⟨fun i j => (p.reducedDifferential_entries Q).1 _ _, + fun i j => (p.reducedDifferential_entries Q).2 _ _⟩ + degree := fun i j => p.reducedDifferential_degree Q _ _ + square_zero := by + apply Matrix.ext + intro i j + change (∑ k : I, + p.reducedDifferential Q (.inr (.inr i)) (.inr (.inr k)) * + p.reducedDifferential Q (.inr (.inr k)) (.inr (.inr j))) = 0 + rw [retained_sum Q _ _ (p.reducedDifferential_target_column Q) + (p.reducedDifferential_source_row Q), p.reducedDifferential_square Q] + rfl + +noncomputable def reductionMap : Map Q E (p.reduced Q) where + matrix := fun i j => p.remainder Q i (.inr (.inr j)) + entries := ⟨fun i j => (p.remainder_entries Q).1 _ _, + fun i j => (p.remainder_entries Q).2 _ _⟩ + degree := fun i j => p.remainder_degree Q _ _ + commute := by + apply Matrix.ext + intro i j + change (E.differential * p.remainder Q) i (.inr (.inr j)) = + ∑ k : I, p.remainder Q i (.inr (.inr k)) * + p.reducedDifferential Q (.inr (.inr k)) (.inr (.inr j)) + rw [retained_sum Q _ _ (p.remainder_target_column Q) + (p.reducedDifferential_source_row Q), p.remainder_mul_reduced Q, + ← p.remainder_commutes Q] + rfl + +noncomputable def inclusionMap : Map Q (p.reduced Q) E where + matrix := fun i j => p.remainder Q (.inr (.inr i)) j + entries := ⟨fun i j => (p.remainder_entries Q).1 _ _, + fun i j => (p.remainder_entries Q).2 _ _⟩ + degree := fun i j => p.remainder_degree Q _ _ + commute := by + apply Matrix.ext + intro i j + change (∑ k : I, p.reducedDifferential Q (.inr (.inr i)) (.inr (.inr k)) * + p.remainder Q (.inr (.inr k)) j) = + (p.remainder Q * E.differential) (.inr (.inr i)) j + rw [retained_sum Q _ _ (p.reducedDifferential_target_column Q) + (p.remainder_source_row Q), p.reduced_mul_remainder Q] + rfl + +lemma reduction_inclusion : + (p.reductionMap Q).matrix * (p.inclusionMap Q).matrix = p.remainder Q := by + apply Matrix.ext + intro i j + change (∑ k : I, p.remainder Q i (.inr (.inr k)) * + p.remainder Q (.inr (.inr k)) j) = p.remainder Q i j + rw [retained_sum Q _ _ (p.remainder_target_column Q) + (p.remainder_source_row Q), p.remainder_square Q] + +lemma inclusion_reduction : + (p.inclusionMap Q).matrix * (p.reductionMap Q).matrix = + projectiveIdentity Q (p.reduced Q).placement := by + apply Matrix.ext + intro i j + change (p.remainder Q * p.remainder Q) (.inr (.inr i)) (.inr (.inr j)) = _ + rw [p.remainder_square Q, p.remainder_retained Q] + rfl + +noncomputable def reductionEquivalence : HomotopyEquivalence Q E (p.reduced Q) where + forward := p.reductionMap Q + backward := p.inclusionMap Q + sourceHomotopy := -p.homotopy Q + targetHomotopy := 0 + sourceEntries := projectiveEntries_neg Q (p.homotopy_entries Q) + targetEntries := projectiveEntries_zero Q + sourceDegree := mapDegree_neg Q (p.homotopy_degree Q) + targetDegree := mapDegree_zero Q (-1) 0 + sourceEquation := by + rw [p.reduction_inclusion Q] + exact GaussianCancellation.cornerRemainder_homotopy _ _ _ + targetEquation := by + rw [p.inclusion_reduction Q, Matrix.mul_zero, Matrix.zero_mul, add_zero, add_zero] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential2.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential2.lean index ed792645ae0f975fda34b4f7d91bdfe7f4ef1d2b..4c767987f2cf28f1539cb9191736363177d41fbf 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential2.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/ReducedDifferential2.lean @@ -1,33 +1,33 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Cancellation.BlockPivot -import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] - [DecidableEq I] [DecidableEq J] - {E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)} (p : BlockPivot Q E) - -lemma reduced_differential (i j : I) : - (p.reduced Q).differential i j = - E.differential (.inr (.inr i)) (.inr (.inr j)) - - ∑ k : J, (p.coefficient⁻¹ • E.differential (.inr (.inr i)) (.inr (.inl k))) * - E.differential (.inl k) (.inr (.inr j)) := by - change (p.remainder Q * E.differential) (.inr (.inr i)) (.inr (.inr j)) = _ - rw [show p.remainder Q * E.differential = E.differential - - E.differential * p.homotopy Q * E.differential from - GaussianCancellation.cornerRemainder_mul_d _ _ _ - (projectiveIdentity_mul Q E.entries) E.square_zero] - change E.differential (.inr (.inr i)) (.inr (.inr j)) - - (∑ k, (E.differential * p.homotopy Q) (.inr (.inr i)) k * - E.differential k (.inr (.inr j))) = _ - congr 1 - simp only [Fintype.sum_sum_type, p.mul_homotopy Q _ E.entries, - MulZeroClass.zero_mul, Finset.sum_const_zero, add_zero] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Cancellation.BlockPivot +import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] + [DecidableEq I] [DecidableEq J] + {E : BasedComplex Q (K := K) (J ⊕ J ⊕ I)} (p : BlockPivot Q E) + +lemma reduced_differential (i j : I) : + (p.reduced Q).differential i j = + E.differential (.inr (.inr i)) (.inr (.inr j)) - + ∑ k : J, (p.coefficient⁻¹ • E.differential (.inr (.inr i)) (.inr (.inl k))) * + E.differential (.inl k) (.inr (.inr j)) := by + change (p.remainder Q * E.differential) (.inr (.inr i)) (.inr (.inr j)) = _ + rw [show p.remainder Q * E.differential = E.differential - + E.differential * p.homotopy Q * E.differential from + GaussianCancellation.cornerRemainder_mul_d _ _ _ + (projectiveIdentity_mul Q E.entries) E.square_zero] + change E.differential (.inr (.inr i)) (.inr (.inr j)) - + (∑ k, (E.differential * p.homotopy Q) (.inr (.inr i)) k * + E.differential k (.inr (.inr j))) = _ + congr 1 + simp only [Fintype.sum_sum_type, p.mul_homotopy Q _ E.entries, + MulZeroClass.zero_mul, Finset.sum_const_zero, add_zero] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.BlockPivot + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/Remainder.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/Remainder.lean index 7c2b518835bbacdd747fdfcc1c0a6e2950729c03..d5c78fd395113c6e261abf3618de47a8ca94bf82 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/Remainder.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/Remainder.lean @@ -1,123 +1,123 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ReversibleQuiver - -namespace OAI - -namespace HarmonicArtin.GaussianCancellation - -variable {R : Type*} [Ring R] - -def remainder (d h : R) : R := 1 - d * h - h * d - -theorem remainder_commutes (d h : R) (hd : d * d = 0) : - d * remainder d h = remainder d h * d := by - simp only [remainder, mul_sub, sub_mul, mul_one, one_mul] - simp only [← mul_assoc, hd, zero_mul] - simp only [mul_assoc, hd, mul_zero, sub_zero] - -theorem h_mul_remainder (d h : R) (hh : h * h = 0) (hhdh : h * d * h = h) : - h * remainder d h = 0 := by - simp only [remainder, mul_sub, mul_one, ← mul_assoc, hh, zero_mul, hhdh] - abel - -theorem remainder_mul_h (d h : R) (hh : h * h = 0) (hhdh : h * d * h = h) : - remainder d h * h = 0 := by - have hdsh : d * h * h = 0 := by rw [mul_assoc, hh, mul_zero] - simp only [remainder, sub_mul, one_mul, hdsh, hhdh] - abel - -theorem remainder_idempotent (d h : R) (hd : d * d = 0) - (hh : h * h = 0) (hhdh : h * d * h = h) : - remainder d h * remainder d h = remainder d h := by - calc - remainder d h * remainder d h = - remainder d h - d * (h * remainder d h) - h * (d * remainder d h) := by - conv_lhs => lhs; unfold remainder - noncomm_ring - _ = remainder d h := by - rw [h_mul_remainder d h hh hhdh, mul_zero, sub_zero, - remainder_commutes d h hd, ← mul_assoc, - h_mul_remainder d h hh hhdh, zero_mul, sub_zero] - -theorem remainder_homotopy (d h : R) : - 1 - remainder d h = d * h + h * d := by - unfold remainder - abel - -section Linear - -variable {K V A B : Type*} [Field K] - [AddCommGroup V] [Module K V] - [AddCommGroup A] [Module K A] - [AddCommGroup B] [Module K B] - -def pivotHomotopy (ι : A →ₗ[K] V) (π : V →ₗ[K] B) (e : A ≃ₗ[K] B) : - Module.End K V := ι.comp (e.symm.toLinearMap.comp π) - -theorem pivotHomotopy_square (ι : A →ₗ[K] V) (π : V →ₗ[K] B) - (e : A ≃ₗ[K] B) (hπι : π.comp ι = 0) : - pivotHomotopy ι π e * pivotHomotopy ι π e = 0 := by - apply LinearMap.ext - intro x - have hz : π (ι (e.symm (π x))) = 0 := LinearMap.congr_fun hπι _ - change ι (e.symm (π (ι (e.symm (π x))))) = 0 - rw [hz, map_zero, map_zero] - -theorem pivotHomotopy_retract (d : Module.End K V) - (ι : A →ₗ[K] V) (π : V →ₗ[K] B) (e : A ≃ₗ[K] B) - (hpivot : π.comp (d.comp ι) = e.toLinearMap) : - pivotHomotopy ι π e * d * pivotHomotopy ι π e = pivotHomotopy ι π e := by - apply LinearMap.ext - intro x - have he : π (d (ι (e.symm (π x)))) = e (e.symm (π x)) := - LinearMap.congr_fun hpivot _ - change ι (e.symm (π (d (ι (e.symm (π x)))))) = ι (e.symm (π x)) - rw [he, e.apply_symm_apply] - -abbrev Reduced (d h : Module.End K V) := LinearMap.range (remainder d h) - -variable (d h : Module.End K V) (hd : d * d = 0) - (hh : h * h = 0) (hhdh : h * d * h = h) - -def reducedDifferential : Module.End K (Reduced d h) := - d.restrict (fun _ hx => by - obtain ⟨x, rfl⟩ := hx - refine ⟨d x, ?_⟩ - exact (LinearMap.congr_fun (remainder_commutes d h hd) x).symm) - -theorem reducedDifferential_square : - reducedDifferential d h hd * reducedDifferential d h hd = 0 := by - apply LinearMap.ext - intro x - apply Subtype.ext - exact LinearMap.congr_fun hd x - -def projectReduced : V →ₗ[K] Reduced d h := (remainder d h).rangeRestrict - -theorem projection_inclusion (hd : d * d = 0) (hh : h * h = 0) - (hhdh : h * d * h = h) : - (projectReduced d h).comp (Reduced d h).subtype = LinearMap.id := by - apply LinearMap.ext - rintro ⟨_, x, rfl⟩ - apply Subtype.ext - exact LinearMap.congr_fun (remainder_idempotent d h hd hh hhdh) x - -theorem inclusion_projection : - (Reduced d h).subtype.comp (projectReduced d h) = remainder d h := rfl - -theorem inclusion_chainMap : - (Reduced d h).subtype.comp (reducedDifferential d h hd) = - d.comp (Reduced d h).subtype := rfl - -theorem projection_chainMap : - (projectReduced d h).comp d = - (reducedDifferential d h hd).comp (projectReduced d h) := by - apply LinearMap.ext - intro x - apply Subtype.ext - exact (LinearMap.congr_fun (remainder_commutes d h hd) x).symm - -end Linear -end HarmonicArtin.GaussianCancellation - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ReversibleQuiver + +namespace OAI + +namespace HarmonicArtin.GaussianCancellation + +variable {R : Type*} [Ring R] + +def remainder (d h : R) : R := 1 - d * h - h * d + +theorem remainder_commutes (d h : R) (hd : d * d = 0) : + d * remainder d h = remainder d h * d := by + simp only [remainder, mul_sub, sub_mul, mul_one, one_mul] + simp only [← mul_assoc, hd, zero_mul] + simp only [mul_assoc, hd, mul_zero, sub_zero] + +theorem h_mul_remainder (d h : R) (hh : h * h = 0) (hhdh : h * d * h = h) : + h * remainder d h = 0 := by + simp only [remainder, mul_sub, mul_one, ← mul_assoc, hh, zero_mul, hhdh] + abel + +theorem remainder_mul_h (d h : R) (hh : h * h = 0) (hhdh : h * d * h = h) : + remainder d h * h = 0 := by + have hdsh : d * h * h = 0 := by rw [mul_assoc, hh, mul_zero] + simp only [remainder, sub_mul, one_mul, hdsh, hhdh] + abel + +theorem remainder_idempotent (d h : R) (hd : d * d = 0) + (hh : h * h = 0) (hhdh : h * d * h = h) : + remainder d h * remainder d h = remainder d h := by + calc + remainder d h * remainder d h = + remainder d h - d * (h * remainder d h) - h * (d * remainder d h) := by + conv_lhs => lhs; unfold remainder + noncomm_ring + _ = remainder d h := by + rw [h_mul_remainder d h hh hhdh, mul_zero, sub_zero, + remainder_commutes d h hd, ← mul_assoc, + h_mul_remainder d h hh hhdh, zero_mul, sub_zero] + +theorem remainder_homotopy (d h : R) : + 1 - remainder d h = d * h + h * d := by + unfold remainder + abel + +section Linear + +variable {K V A B : Type*} [Field K] + [AddCommGroup V] [Module K V] + [AddCommGroup A] [Module K A] + [AddCommGroup B] [Module K B] + +def pivotHomotopy (ι : A →ₗ[K] V) (π : V →ₗ[K] B) (e : A ≃ₗ[K] B) : + Module.End K V := ι.comp (e.symm.toLinearMap.comp π) + +theorem pivotHomotopy_square (ι : A →ₗ[K] V) (π : V →ₗ[K] B) + (e : A ≃ₗ[K] B) (hπι : π.comp ι = 0) : + pivotHomotopy ι π e * pivotHomotopy ι π e = 0 := by + apply LinearMap.ext + intro x + have hz : π (ι (e.symm (π x))) = 0 := LinearMap.congr_fun hπι _ + change ι (e.symm (π (ι (e.symm (π x))))) = 0 + rw [hz, map_zero, map_zero] + +theorem pivotHomotopy_retract (d : Module.End K V) + (ι : A →ₗ[K] V) (π : V →ₗ[K] B) (e : A ≃ₗ[K] B) + (hpivot : π.comp (d.comp ι) = e.toLinearMap) : + pivotHomotopy ι π e * d * pivotHomotopy ι π e = pivotHomotopy ι π e := by + apply LinearMap.ext + intro x + have he : π (d (ι (e.symm (π x)))) = e (e.symm (π x)) := + LinearMap.congr_fun hpivot _ + change ι (e.symm (π (d (ι (e.symm (π x)))))) = ι (e.symm (π x)) + rw [he, e.apply_symm_apply] + +abbrev Reduced (d h : Module.End K V) := LinearMap.range (remainder d h) + +variable (d h : Module.End K V) (hd : d * d = 0) + (hh : h * h = 0) (hhdh : h * d * h = h) + +def reducedDifferential : Module.End K (Reduced d h) := + d.restrict (fun _ hx => by + obtain ⟨x, rfl⟩ := hx + refine ⟨d x, ?_⟩ + exact (LinearMap.congr_fun (remainder_commutes d h hd) x).symm) + +theorem reducedDifferential_square : + reducedDifferential d h hd * reducedDifferential d h hd = 0 := by + apply LinearMap.ext + intro x + apply Subtype.ext + exact LinearMap.congr_fun hd x + +def projectReduced : V →ₗ[K] Reduced d h := (remainder d h).rangeRestrict + +theorem projection_inclusion (hd : d * d = 0) (hh : h * h = 0) + (hhdh : h * d * h = h) : + (projectReduced d h).comp (Reduced d h).subtype = LinearMap.id := by + apply LinearMap.ext + rintro ⟨_, x, rfl⟩ + apply Subtype.ext + exact LinearMap.congr_fun (remainder_idempotent d h hd hh hhdh) x + +theorem inclusion_projection : + (Reduced d h).subtype.comp (projectReduced d h) = remainder d h := rfl + +theorem inclusion_chainMap : + (Reduced d h).subtype.comp (reducedDifferential d h hd) = + d.comp (Reduced d h).subtype := rfl + +theorem projection_chainMap : + (projectReduced d h).comp d = + (reducedDifferential d h hd).comp (projectReduced d h) := by + apply LinearMap.ext + intro x + apply Subtype.ext + exact (LinearMap.congr_fun (remainder_commutes d h hd) x).symm + +end Linear +end HarmonicArtin.GaussianCancellation + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/Retained.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/Retained.lean index 59fad74d3930a67d42d0a07ec1daf93bbcd3026e..c079479030bb9e96f738da35f08b5cba1574d79c 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/Retained.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/Retained.lean @@ -1,156 +1,156 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.ScalarPivot - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [DecidableEq I] - {E : BasedComplex Q (K := K) I} (p : ScalarPivot Q E) - -abbrev Retained := {k : I // k ≠ p.source ∧ k ≠ p.target} - -lemma retained_sum {X Y : Type*} (U : Matrix X I (Q.Zigzag K)) - (V : Matrix I Y (Q.Zigzag K)) (hU : ∀ i, U i p.target = 0) - (hV : ∀ j, V p.source j = 0) (i : X) (j : Y) : - (∑ k : p.Retained Q, U i k * V k j) = (U * V) i j := by - apply Fintype.sum_of_injective (Subtype.val : p.Retained Q → I) Subtype.val_injective - · intro k hk - change U i k * V k j = 0 - by_cases hs : k = p.source - · subst k - rw [hV, MulZeroClass.mul_zero] - · by_cases ht : k = p.target - · subst k - rw [hU, MulZeroClass.zero_mul] - · exact (hk ⟨⟨k, hs, ht⟩, rfl⟩).elim - · intro k - rfl - -noncomputable def reducedDifferential : Matrix I I (Q.Zigzag K) := - p.remainder Q * E.differential - -lemma reducedDifferential_entries : - ProjectiveEntries Q E.placement E.placement (p.reducedDifferential Q) := - projectiveEntries_mul Q (p.remainder_entries Q) E.entries - -lemma reducedDifferential_degree : - MapDegree Q E.placement E.placement 1 0 (p.reducedDifferential Q) := by - exact mapDegree_mul Q (p.remainder_degree Q) E.degree - -lemma reducedDifferential_square : p.reducedDifferential Q * p.reducedDifferential Q = 0 := - GaussianCancellation.cornerReduced_square _ _ _ - (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero - -lemma reducedDifferential_source_row (k : I) : p.reducedDifferential Q p.source k = 0 := by - change (∑ j, p.remainder Q p.source j * E.differential j k) = 0 - simp only [p.remainder_source_row Q, MulZeroClass.zero_mul, Finset.sum_const_zero] - -lemma reducedDifferential_target_column (k : I) : p.reducedDifferential Q k p.target = 0 := by - unfold reducedDifferential - rw [p.remainder_commutes Q] - change (∑ j, E.differential k j * p.remainder Q j p.target) = 0 - simp only [p.remainder_target_column Q, MulZeroClass.mul_zero, Finset.sum_const_zero] - -lemma remainder_mul_reduced : p.remainder Q * p.reducedDifferential Q = p.reducedDifferential Q := by - unfold reducedDifferential - rw [← _root_.mul_assoc, p.remainder_square Q] - -lemma reduced_mul_remainder : p.reducedDifferential Q * p.remainder Q = p.reducedDifferential Q := by - unfold reducedDifferential - rw [_root_.mul_assoc, ← p.remainder_commutes Q, ← _root_.mul_assoc, p.remainder_square Q] - -noncomputable def reduced : BasedComplex Q (K := K) (p.Retained Q) where - placement := fun i => E.placement i - differential := fun i j => p.reducedDifferential Q i j - entries := ⟨fun i j => (p.reducedDifferential_entries Q).1 i j, - fun i j => (p.reducedDifferential_entries Q).2 i j⟩ - degree := fun i j => p.reducedDifferential_degree Q i j - square_zero := by - apply Matrix.ext - intro i j - change (∑ k : p.Retained Q, - p.reducedDifferential Q i k * p.reducedDifferential Q k j) = 0 - rw [p.retained_sum Q _ _ (p.reducedDifferential_target_column Q) - (p.reducedDifferential_source_row Q), p.reducedDifferential_square Q] - rfl - -noncomputable def reductionMap : Map Q E (p.reduced Q) where - matrix := fun i j => p.remainder Q i j - entries := ⟨fun i j => (p.remainder_entries Q).1 i j, - fun i j => (p.remainder_entries Q).2 i j⟩ - degree := fun i j => p.remainder_degree Q i j - commute := by - apply Matrix.ext - intro i j - change (E.differential * p.remainder Q) i j = - ∑ k : p.Retained Q, p.remainder Q i k * p.reducedDifferential Q k j - rw [p.retained_sum Q _ _ (p.remainder_target_column Q) - (p.reducedDifferential_source_row Q), p.remainder_mul_reduced Q, - ← p.remainder_commutes Q] - rfl - -noncomputable def inclusionMap : Map Q (p.reduced Q) E where - matrix := fun i j => p.remainder Q i j - entries := ⟨fun i j => (p.remainder_entries Q).1 i j, - fun i j => (p.remainder_entries Q).2 i j⟩ - degree := fun i j => p.remainder_degree Q i j - commute := by - apply Matrix.ext - intro i j - change (∑ k : p.Retained Q, p.reducedDifferential Q i k * p.remainder Q k j) = - (p.remainder Q * E.differential) i j - rw [p.retained_sum Q _ _ (p.reducedDifferential_target_column Q) - (p.remainder_source_row Q), p.reduced_mul_remainder Q] - rfl - -lemma reduction_inclusion : - (p.reductionMap Q).matrix * (p.inclusionMap Q).matrix = p.remainder Q := by - apply Matrix.ext - intro i j - change (∑ k : p.Retained Q, p.remainder Q i k * p.remainder Q k j) = p.remainder Q i j - rw [p.retained_sum Q _ _ (p.remainder_target_column Q) - (p.remainder_source_row Q), p.remainder_square Q] - -lemma inclusion_reduction : - (p.inclusionMap Q).matrix * (p.reductionMap Q).matrix = - projectiveIdentity Q (p.reduced Q).placement := by - apply Matrix.ext - intro i j - change (p.remainder Q * p.remainder Q) i j = _ - rw [p.remainder_square Q, p.remainder_retained Q i j i.property.2 j.property.1] - change (Matrix.diagonal (fun k => vertexId Q (E.placement k).color)) i.val j.val = - (Matrix.diagonal (fun k : p.Retained Q => vertexId Q (E.placement k).color)) i j - by_cases h : i = j - · subst j - simp - · have hv : i.val ≠ j.val := fun he => h (Subtype.ext he) - simp [Matrix.diagonal, h, hv] - -noncomputable def reductionEquivalence : HomotopyEquivalence Q E (p.reduced Q) where - forward := p.reductionMap Q - backward := p.inclusionMap Q - sourceHomotopy := -p.homotopy Q - targetHomotopy := 0 - sourceEntries := projectiveEntries_neg Q (p.homotopy_entries Q) - targetEntries := projectiveEntries_zero Q - sourceDegree := mapDegree_neg Q (p.homotopy_degree Q) - targetDegree := mapDegree_zero Q (-1) 0 - sourceEquation := by - rw [p.reduction_inclusion Q] - exact GaussianCancellation.cornerRemainder_homotopy _ _ _ - targetEquation := by - rw [p.inclusion_reduction Q, Matrix.mul_zero, Matrix.zero_mul, add_zero, add_zero] - -lemma retained_card_lt : Fintype.card (p.Retained Q) < Fintype.card I := by - apply Fintype.card_lt_of_injective_not_surjective (Subtype.val : p.Retained Q → I) - Subtype.val_injective - intro h - obtain ⟨k, hk⟩ := h p.source - exact k.property.1 hk - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.ScalarPivot - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.ScalarPivot + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [DecidableEq I] + {E : BasedComplex Q (K := K) I} (p : ScalarPivot Q E) + +abbrev Retained := {k : I // k ≠ p.source ∧ k ≠ p.target} + +lemma retained_sum {X Y : Type*} (U : Matrix X I (Q.Zigzag K)) + (V : Matrix I Y (Q.Zigzag K)) (hU : ∀ i, U i p.target = 0) + (hV : ∀ j, V p.source j = 0) (i : X) (j : Y) : + (∑ k : p.Retained Q, U i k * V k j) = (U * V) i j := by + apply Fintype.sum_of_injective (Subtype.val : p.Retained Q → I) Subtype.val_injective + · intro k hk + change U i k * V k j = 0 + by_cases hs : k = p.source + · subst k + rw [hV, MulZeroClass.mul_zero] + · by_cases ht : k = p.target + · subst k + rw [hU, MulZeroClass.zero_mul] + · exact (hk ⟨⟨k, hs, ht⟩, rfl⟩).elim + · intro k + rfl + +noncomputable def reducedDifferential : Matrix I I (Q.Zigzag K) := + p.remainder Q * E.differential + +lemma reducedDifferential_entries : + ProjectiveEntries Q E.placement E.placement (p.reducedDifferential Q) := + projectiveEntries_mul Q (p.remainder_entries Q) E.entries + +lemma reducedDifferential_degree : + MapDegree Q E.placement E.placement 1 0 (p.reducedDifferential Q) := by + exact mapDegree_mul Q (p.remainder_degree Q) E.degree + +lemma reducedDifferential_square : p.reducedDifferential Q * p.reducedDifferential Q = 0 := + GaussianCancellation.cornerReduced_square _ _ _ + (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero + +lemma reducedDifferential_source_row (k : I) : p.reducedDifferential Q p.source k = 0 := by + change (∑ j, p.remainder Q p.source j * E.differential j k) = 0 + simp only [p.remainder_source_row Q, MulZeroClass.zero_mul, Finset.sum_const_zero] + +lemma reducedDifferential_target_column (k : I) : p.reducedDifferential Q k p.target = 0 := by + unfold reducedDifferential + rw [p.remainder_commutes Q] + change (∑ j, E.differential k j * p.remainder Q j p.target) = 0 + simp only [p.remainder_target_column Q, MulZeroClass.mul_zero, Finset.sum_const_zero] + +lemma remainder_mul_reduced : p.remainder Q * p.reducedDifferential Q = p.reducedDifferential Q := by + unfold reducedDifferential + rw [← _root_.mul_assoc, p.remainder_square Q] + +lemma reduced_mul_remainder : p.reducedDifferential Q * p.remainder Q = p.reducedDifferential Q := by + unfold reducedDifferential + rw [_root_.mul_assoc, ← p.remainder_commutes Q, ← _root_.mul_assoc, p.remainder_square Q] + +noncomputable def reduced : BasedComplex Q (K := K) (p.Retained Q) where + placement := fun i => E.placement i + differential := fun i j => p.reducedDifferential Q i j + entries := ⟨fun i j => (p.reducedDifferential_entries Q).1 i j, + fun i j => (p.reducedDifferential_entries Q).2 i j⟩ + degree := fun i j => p.reducedDifferential_degree Q i j + square_zero := by + apply Matrix.ext + intro i j + change (∑ k : p.Retained Q, + p.reducedDifferential Q i k * p.reducedDifferential Q k j) = 0 + rw [p.retained_sum Q _ _ (p.reducedDifferential_target_column Q) + (p.reducedDifferential_source_row Q), p.reducedDifferential_square Q] + rfl + +noncomputable def reductionMap : Map Q E (p.reduced Q) where + matrix := fun i j => p.remainder Q i j + entries := ⟨fun i j => (p.remainder_entries Q).1 i j, + fun i j => (p.remainder_entries Q).2 i j⟩ + degree := fun i j => p.remainder_degree Q i j + commute := by + apply Matrix.ext + intro i j + change (E.differential * p.remainder Q) i j = + ∑ k : p.Retained Q, p.remainder Q i k * p.reducedDifferential Q k j + rw [p.retained_sum Q _ _ (p.remainder_target_column Q) + (p.reducedDifferential_source_row Q), p.remainder_mul_reduced Q, + ← p.remainder_commutes Q] + rfl + +noncomputable def inclusionMap : Map Q (p.reduced Q) E where + matrix := fun i j => p.remainder Q i j + entries := ⟨fun i j => (p.remainder_entries Q).1 i j, + fun i j => (p.remainder_entries Q).2 i j⟩ + degree := fun i j => p.remainder_degree Q i j + commute := by + apply Matrix.ext + intro i j + change (∑ k : p.Retained Q, p.reducedDifferential Q i k * p.remainder Q k j) = + (p.remainder Q * E.differential) i j + rw [p.retained_sum Q _ _ (p.reducedDifferential_target_column Q) + (p.remainder_source_row Q), p.reduced_mul_remainder Q] + rfl + +lemma reduction_inclusion : + (p.reductionMap Q).matrix * (p.inclusionMap Q).matrix = p.remainder Q := by + apply Matrix.ext + intro i j + change (∑ k : p.Retained Q, p.remainder Q i k * p.remainder Q k j) = p.remainder Q i j + rw [p.retained_sum Q _ _ (p.remainder_target_column Q) + (p.remainder_source_row Q), p.remainder_square Q] + +lemma inclusion_reduction : + (p.inclusionMap Q).matrix * (p.reductionMap Q).matrix = + projectiveIdentity Q (p.reduced Q).placement := by + apply Matrix.ext + intro i j + change (p.remainder Q * p.remainder Q) i j = _ + rw [p.remainder_square Q, p.remainder_retained Q i j i.property.2 j.property.1] + change (Matrix.diagonal (fun k => vertexId Q (E.placement k).color)) i.val j.val = + (Matrix.diagonal (fun k : p.Retained Q => vertexId Q (E.placement k).color)) i j + by_cases h : i = j + · subst j + simp + · have hv : i.val ≠ j.val := fun he => h (Subtype.ext he) + simp [Matrix.diagonal, h, hv] + +noncomputable def reductionEquivalence : HomotopyEquivalence Q E (p.reduced Q) where + forward := p.reductionMap Q + backward := p.inclusionMap Q + sourceHomotopy := -p.homotopy Q + targetHomotopy := 0 + sourceEntries := projectiveEntries_neg Q (p.homotopy_entries Q) + targetEntries := projectiveEntries_zero Q + sourceDegree := mapDegree_neg Q (p.homotopy_degree Q) + targetDegree := mapDegree_zero Q (-1) 0 + sourceEquation := by + rw [p.reduction_inclusion Q] + exact GaussianCancellation.cornerRemainder_homotopy _ _ _ + targetEquation := by + rw [p.inclusion_reduction Q, Matrix.mul_zero, Matrix.zero_mul, add_zero, add_zero] + +lemma retained_card_lt : Fintype.card (p.Retained Q) < Fintype.card I := by + apply Fintype.card_lt_of_injective_not_surjective (Subtype.val : p.Retained Q → I) + Subtype.val_injective + intro h + obtain ⟨k, hk⟩ := h p.source + exact k.property.1 hk + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.ScalarPivot + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/ScalarPivot.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/ScalarPivot.lean index 8528503400fe75fb19262e101a16b1e48f747788..4016f51836be64100bdc35943d5472969ea80f5d 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/ScalarPivot.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/ScalarPivot.lean @@ -1,190 +1,190 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.CornerScalar -import OAI.Topology.ArtinGroups.Quivers.SmulMul -import OAI.Topology.ArtinGroups.Cancellation.CornerRemainder - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag - -variable {V A K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - -lemma homogeneous_smul {a : ℤ} {x : Q.Zigzag K} (hx : Homogeneous Q a x) (r : K) : - Homogeneous Q a (r • x) := by - exact ⟨fun h => by simp [hx.1 h], fun h => by simp [hx.2.1 h], - fun h => by simp [hx.2.2 h]⟩ - -variable {I J : Type*} [DecidableEq I] [DecidableEq J] - -lemma projectiveEntries_single (p : I → GeneratorPlacement V) - (q : J → GeneratorPlacement V) (i : I) (j : J) (x : Q.Zigzag K) - (hl : vertexId Q (p i).color * x = x) - (hr : x * vertexId Q (q j).color = x) : - ProjectiveEntries Q p q (Matrix.single i j x) := by - constructor <;> intro k l <;> by_cases hk : i = k <;> by_cases hl' : j = l - all_goals subst_vars - all_goals simp_all [Matrix.single] - -lemma mapDegree_single (p : I → GeneratorPlacement V) - (q : J → GeneratorPlacement V) (i : I) (j : J) (x : Q.Zigzag K) - (n v : ℤ) (hc : (q j).cochain = (p i).cochain + n) - (hx : Homogeneous Q (v + (p i).internal - (q j).internal) x) : - MapDegree Q p q n v (Matrix.single i j x) := by - intro k l - by_cases hk : k = i - · subst k - by_cases hl : l = j - · subst l - simp only [Matrix.single_apply_same] - exact ⟨fun h => (h hc).elim, hx⟩ - · have hz : Matrix.single i j x i l = 0 := by simp [Matrix.single, Ne.symm hl] - rw [hz] - exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · have hz : Matrix.single i j x k l = 0 := by simp [Matrix.single, Ne.symm hk] - rw [hz] - exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - -namespace BasedComplex - -variable [Fintype I] - -structure ScalarPivot (E : BasedComplex Q (K := K) I) where - source : I - target : I - coefficient : K - distinct : source ≠ target - nonzero : coefficient ≠ 0 - color : (E.placement target).color = (E.placement source).color - cochain : (E.placement target).cochain = (E.placement source).cochain + 1 - internal : (E.placement target).internal = (E.placement source).internal - entry : E.differential source target = coefficient • vertexId Q (E.placement source).color - -omit [DecidableEq I] in -lemma scalarPivot_of_not_minimal (E : BasedComplex Q (K := K) I) (hE : ¬E.IsMinimal Q) : - Nonempty (ScalarPivot Q E) := by - obtain ⟨i, j, a, hij, ha, hc, hn, hu, he⟩ := E.exists_pivot_of_not_minimal Q hE - exact ⟨⟨i, j, a, hij, ha, hc, hn, hu, he⟩⟩ - -namespace ScalarPivot - -variable {E : BasedComplex Q (K := K) I} (p : ScalarPivot Q E) - -def inverseValue : Q.Zigzag K := - p.coefficient⁻¹ • vertexId Q (E.placement p.source).color - -def homotopy : Matrix I I (Q.Zigzag K) := - Matrix.single p.target p.source (p.inverseValue Q) - -omit [DecidableEq I] in -lemma inverseValue_left : vertexId Q (E.placement p.target).color * p.inverseValue Q = - p.inverseValue Q := by - dsimp only [inverseValue] - rw [p.color, mul_smul_comm, vertexId_mul_self] - -omit [DecidableEq I] in -lemma inverseValue_right : p.inverseValue Q * vertexId Q (E.placement p.source).color = - p.inverseValue Q := by - dsimp only [inverseValue] - rw [smul_mul_assoc, vertexId_mul_self] - -omit [DecidableEq I] in -lemma inverseValue_entry : p.inverseValue Q * E.differential p.source p.target = - vertexId Q (E.placement p.target).color := by - rw [inverseValue, p.entry, smul_mul_assoc, mul_smul_comm, vertexId_mul_self, - smul_smul, inv_mul_cancel₀ p.nonzero, one_smul, p.color] - -omit [DecidableEq I] in -lemma entry_inverseValue : E.differential p.source p.target * p.inverseValue Q = - vertexId Q (E.placement p.source).color := by - rw [inverseValue, p.entry, smul_mul_assoc, mul_smul_comm, vertexId_mul_self, - smul_smul, mul_inv_cancel₀ p.nonzero, one_smul] - -lemma homotopy_entries : ProjectiveEntries Q E.placement E.placement (p.homotopy Q) := - projectiveEntries_single Q _ _ _ _ _ (p.inverseValue_left Q) (p.inverseValue_right Q) - -lemma homotopy_degree : MapDegree Q E.placement E.placement (-1) 0 (p.homotopy Q) := by - apply mapDegree_single Q - · have hc := p.cochain - omega - · have hh := homogeneous_smul Q - (homogeneous_vertexId Q (K := K) (E.placement p.source).color) p.coefficient⁻¹ - simpa only [inverseValue, p.internal, zero_add, sub_self] using hh - -lemma homotopy_square : p.homotopy Q * p.homotopy Q = 0 := by - exact Matrix.single_mul_single_of_ne _ _ _ _ p.distinct _ - -lemma homotopy_retract : p.homotopy Q * E.differential * p.homotopy Q = p.homotopy Q := by - rw [homotopy, Matrix.single_mul_mul_single, p.inverseValue_entry Q, - p.inverseValue_left Q] - -noncomputable def remainder : Matrix I I (Q.Zigzag K) := - GaussianCancellation.cornerRemainder (projectiveIdentity Q E.placement) - E.differential (p.homotopy Q) - -lemma remainder_entries : ProjectiveEntries Q E.placement E.placement (p.remainder Q) := by - unfold remainder GaussianCancellation.cornerRemainder - simp only [sub_eq_add_neg] - exact projectiveEntries_add Q - (projectiveEntries_add Q (projectiveEntries_identity Q) - (projectiveEntries_neg Q (projectiveEntries_mul Q E.entries (p.homotopy_entries Q)))) - (projectiveEntries_neg Q (projectiveEntries_mul Q (p.homotopy_entries Q) E.entries)) - -lemma remainder_degree : MapDegree Q E.placement E.placement 0 0 (p.remainder Q) := by - have h₁ := mapDegree_mul Q E.degree (p.homotopy_degree Q) - have h₂ := mapDegree_mul Q (p.homotopy_degree Q) E.degree - norm_num at h₁ h₂ - unfold remainder GaussianCancellation.cornerRemainder - simp only [sub_eq_add_neg] - exact mapDegree_add Q (mapDegree_add Q (mapDegree_identity Q) (mapDegree_neg Q h₁)) - (mapDegree_neg Q h₂) - -lemma remainder_commutes : p.remainder Q * E.differential = E.differential * p.remainder Q := - GaussianCancellation.cornerRemainder_commutes _ _ _ - (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero - -lemma remainder_square : p.remainder Q * p.remainder Q = p.remainder Q := - GaussianCancellation.cornerRemainder_idempotent _ _ _ - (projectiveIdentity_mul Q (projectiveEntries_identity Q)) - (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) - (projectiveIdentity_mul Q (p.homotopy_entries Q)) - (mul_projectiveIdentity Q (p.homotopy_entries Q)) - E.square_zero (p.homotopy_square Q) (p.homotopy_retract Q) - -lemma remainder_source_row (k : I) : p.remainder Q p.source k = 0 := by - change (projectiveIdentity Q E.placement) p.source k - - (E.differential * p.homotopy Q) p.source k - - (p.homotopy Q * E.differential) p.source k = 0 - rw [homotopy, Matrix.single_mul_apply_of_ne _ _ _ _ _ p.distinct] - by_cases hk : k = p.source - · subst k - rw [Matrix.mul_single_apply_same, p.entry_inverseValue Q] - simp [projectiveIdentity] - · rw [Matrix.mul_single_apply_of_ne _ _ _ _ _ hk] - simp [projectiveIdentity, Ne.symm hk] - -lemma remainder_target_column (k : I) : p.remainder Q k p.target = 0 := by - change (projectiveIdentity Q E.placement) k p.target - - (E.differential * p.homotopy Q) k p.target - - (p.homotopy Q * E.differential) k p.target = 0 - rw [homotopy, Matrix.mul_single_apply_of_ne _ _ _ _ _ (Ne.symm p.distinct)] - by_cases hk : k = p.target - · subst k - rw [Matrix.single_mul_apply_same, p.inverseValue_entry Q] - simp [projectiveIdentity] - · rw [Matrix.single_mul_apply_of_ne _ _ _ _ _ hk] - simp [projectiveIdentity, hk] - -lemma remainder_retained (k l : I) (hk : k ≠ p.target) (hl : l ≠ p.source) : - p.remainder Q k l = (projectiveIdentity Q E.placement) k l := by - change (projectiveIdentity Q E.placement) k l - - (E.differential * p.homotopy Q) k l - - (p.homotopy Q * E.differential) k l = _ - rw [homotopy, Matrix.mul_single_apply_of_ne _ _ _ _ _ hl, - Matrix.single_mul_apply_of_ne _ _ _ _ _ hk, sub_zero, sub_zero] - -end ScalarPivot -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.CornerScalar +import OAI.Topology.ArtinGroups.Quivers.SmulMul +import OAI.Topology.ArtinGroups.Cancellation.CornerRemainder + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag + +variable {V A K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + +lemma homogeneous_smul {a : ℤ} {x : Q.Zigzag K} (hx : Homogeneous Q a x) (r : K) : + Homogeneous Q a (r • x) := by + exact ⟨fun h => by simp [hx.1 h], fun h => by simp [hx.2.1 h], + fun h => by simp [hx.2.2 h]⟩ + +variable {I J : Type*} [DecidableEq I] [DecidableEq J] + +lemma projectiveEntries_single (p : I → GeneratorPlacement V) + (q : J → GeneratorPlacement V) (i : I) (j : J) (x : Q.Zigzag K) + (hl : vertexId Q (p i).color * x = x) + (hr : x * vertexId Q (q j).color = x) : + ProjectiveEntries Q p q (Matrix.single i j x) := by + constructor <;> intro k l <;> by_cases hk : i = k <;> by_cases hl' : j = l + all_goals subst_vars + all_goals simp_all [Matrix.single] + +lemma mapDegree_single (p : I → GeneratorPlacement V) + (q : J → GeneratorPlacement V) (i : I) (j : J) (x : Q.Zigzag K) + (n v : ℤ) (hc : (q j).cochain = (p i).cochain + n) + (hx : Homogeneous Q (v + (p i).internal - (q j).internal) x) : + MapDegree Q p q n v (Matrix.single i j x) := by + intro k l + by_cases hk : k = i + · subst k + by_cases hl : l = j + · subst l + simp only [Matrix.single_apply_same] + exact ⟨fun h => (h hc).elim, hx⟩ + · have hz : Matrix.single i j x i l = 0 := by simp [Matrix.single, Ne.symm hl] + rw [hz] + exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · have hz : Matrix.single i j x k l = 0 := by simp [Matrix.single, Ne.symm hk] + rw [hz] + exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + +namespace BasedComplex + +variable [Fintype I] + +structure ScalarPivot (E : BasedComplex Q (K := K) I) where + source : I + target : I + coefficient : K + distinct : source ≠ target + nonzero : coefficient ≠ 0 + color : (E.placement target).color = (E.placement source).color + cochain : (E.placement target).cochain = (E.placement source).cochain + 1 + internal : (E.placement target).internal = (E.placement source).internal + entry : E.differential source target = coefficient • vertexId Q (E.placement source).color + +omit [DecidableEq I] in +lemma scalarPivot_of_not_minimal (E : BasedComplex Q (K := K) I) (hE : ¬E.IsMinimal Q) : + Nonempty (ScalarPivot Q E) := by + obtain ⟨i, j, a, hij, ha, hc, hn, hu, he⟩ := E.exists_pivot_of_not_minimal Q hE + exact ⟨⟨i, j, a, hij, ha, hc, hn, hu, he⟩⟩ + +namespace ScalarPivot + +variable {E : BasedComplex Q (K := K) I} (p : ScalarPivot Q E) + +def inverseValue : Q.Zigzag K := + p.coefficient⁻¹ • vertexId Q (E.placement p.source).color + +def homotopy : Matrix I I (Q.Zigzag K) := + Matrix.single p.target p.source (p.inverseValue Q) + +omit [DecidableEq I] in +lemma inverseValue_left : vertexId Q (E.placement p.target).color * p.inverseValue Q = + p.inverseValue Q := by + dsimp only [inverseValue] + rw [p.color, mul_smul_comm, vertexId_mul_self] + +omit [DecidableEq I] in +lemma inverseValue_right : p.inverseValue Q * vertexId Q (E.placement p.source).color = + p.inverseValue Q := by + dsimp only [inverseValue] + rw [smul_mul_assoc, vertexId_mul_self] + +omit [DecidableEq I] in +lemma inverseValue_entry : p.inverseValue Q * E.differential p.source p.target = + vertexId Q (E.placement p.target).color := by + rw [inverseValue, p.entry, smul_mul_assoc, mul_smul_comm, vertexId_mul_self, + smul_smul, inv_mul_cancel₀ p.nonzero, one_smul, p.color] + +omit [DecidableEq I] in +lemma entry_inverseValue : E.differential p.source p.target * p.inverseValue Q = + vertexId Q (E.placement p.source).color := by + rw [inverseValue, p.entry, smul_mul_assoc, mul_smul_comm, vertexId_mul_self, + smul_smul, mul_inv_cancel₀ p.nonzero, one_smul] + +lemma homotopy_entries : ProjectiveEntries Q E.placement E.placement (p.homotopy Q) := + projectiveEntries_single Q _ _ _ _ _ (p.inverseValue_left Q) (p.inverseValue_right Q) + +lemma homotopy_degree : MapDegree Q E.placement E.placement (-1) 0 (p.homotopy Q) := by + apply mapDegree_single Q + · have hc := p.cochain + omega + · have hh := homogeneous_smul Q + (homogeneous_vertexId Q (K := K) (E.placement p.source).color) p.coefficient⁻¹ + simpa only [inverseValue, p.internal, zero_add, sub_self] using hh + +lemma homotopy_square : p.homotopy Q * p.homotopy Q = 0 := by + exact Matrix.single_mul_single_of_ne _ _ _ _ p.distinct _ + +lemma homotopy_retract : p.homotopy Q * E.differential * p.homotopy Q = p.homotopy Q := by + rw [homotopy, Matrix.single_mul_mul_single, p.inverseValue_entry Q, + p.inverseValue_left Q] + +noncomputable def remainder : Matrix I I (Q.Zigzag K) := + GaussianCancellation.cornerRemainder (projectiveIdentity Q E.placement) + E.differential (p.homotopy Q) + +lemma remainder_entries : ProjectiveEntries Q E.placement E.placement (p.remainder Q) := by + unfold remainder GaussianCancellation.cornerRemainder + simp only [sub_eq_add_neg] + exact projectiveEntries_add Q + (projectiveEntries_add Q (projectiveEntries_identity Q) + (projectiveEntries_neg Q (projectiveEntries_mul Q E.entries (p.homotopy_entries Q)))) + (projectiveEntries_neg Q (projectiveEntries_mul Q (p.homotopy_entries Q) E.entries)) + +lemma remainder_degree : MapDegree Q E.placement E.placement 0 0 (p.remainder Q) := by + have h₁ := mapDegree_mul Q E.degree (p.homotopy_degree Q) + have h₂ := mapDegree_mul Q (p.homotopy_degree Q) E.degree + norm_num at h₁ h₂ + unfold remainder GaussianCancellation.cornerRemainder + simp only [sub_eq_add_neg] + exact mapDegree_add Q (mapDegree_add Q (mapDegree_identity Q) (mapDegree_neg Q h₁)) + (mapDegree_neg Q h₂) + +lemma remainder_commutes : p.remainder Q * E.differential = E.differential * p.remainder Q := + GaussianCancellation.cornerRemainder_commutes _ _ _ + (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) E.square_zero + +lemma remainder_square : p.remainder Q * p.remainder Q = p.remainder Q := + GaussianCancellation.cornerRemainder_idempotent _ _ _ + (projectiveIdentity_mul Q (projectiveEntries_identity Q)) + (projectiveIdentity_mul Q E.entries) (mul_projectiveIdentity Q E.entries) + (projectiveIdentity_mul Q (p.homotopy_entries Q)) + (mul_projectiveIdentity Q (p.homotopy_entries Q)) + E.square_zero (p.homotopy_square Q) (p.homotopy_retract Q) + +lemma remainder_source_row (k : I) : p.remainder Q p.source k = 0 := by + change (projectiveIdentity Q E.placement) p.source k - + (E.differential * p.homotopy Q) p.source k - + (p.homotopy Q * E.differential) p.source k = 0 + rw [homotopy, Matrix.single_mul_apply_of_ne _ _ _ _ _ p.distinct] + by_cases hk : k = p.source + · subst k + rw [Matrix.mul_single_apply_same, p.entry_inverseValue Q] + simp [projectiveIdentity] + · rw [Matrix.mul_single_apply_of_ne _ _ _ _ _ hk] + simp [projectiveIdentity, Ne.symm hk] + +lemma remainder_target_column (k : I) : p.remainder Q k p.target = 0 := by + change (projectiveIdentity Q E.placement) k p.target - + (E.differential * p.homotopy Q) k p.target - + (p.homotopy Q * E.differential) k p.target = 0 + rw [homotopy, Matrix.mul_single_apply_of_ne _ _ _ _ _ (Ne.symm p.distinct)] + by_cases hk : k = p.target + · subst k + rw [Matrix.single_mul_apply_same, p.inverseValue_entry Q] + simp [projectiveIdentity] + · rw [Matrix.single_mul_apply_of_ne _ _ _ _ _ hk] + simp [projectiveIdentity, hk] + +lemma remainder_retained (k l : I) (hk : k ≠ p.target) (hl : l ≠ p.source) : + p.remainder Q k l = (projectiveIdentity Q E.placement) k l := by + change (projectiveIdentity Q E.placement) k l - + (E.differential * p.homotopy Q) k l - + (p.homotopy Q * E.differential) k l = _ + rw [homotopy, Matrix.mul_single_apply_of_ne _ _ _ _ _ hl, + Matrix.single_mul_apply_of_ne _ _ _ _ _ hk, sub_zero, sub_zero] + +end ScalarPivot +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelLeft.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelLeft.lean index 46ef95bd52d879839f56eb418add81a4bdf1fe63..10c1d4f4f80264e1be5c299ea76865fae1d23a06 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelLeft.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelLeft.lean @@ -1,46 +1,46 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Harmonic.PositiveReverseHom -import OAI.Topology.ArtinGroups.Cancellation.SphericalPositiveCancelMonoid - -namespace OAI - -namespace HarmonicArtin -open CoxeterExchange Geometric - -attribute [local instance] Classical.decEq Classical.propDecidable -variable {S:Type} [Fintype S] [LinearOrder S] (M:CoxeterMatrix S) - -lemma spherical_positive_cancel_left (T:Set S) (hT:IsSpherical M T) - (a b c:PositiveArtin (restrictedMatrix M T)) (h:a*b=a*c) : b=c := by - let := sphericalPositiveCancelMonoid M T hT - exact mul_left_cancel h - -theorem spherical_positive_head (T:Set S) (hT:IsSpherical M T) - (a:PositiveArtin (restrictedMatrix M T)) : HasPositiveHead (restrictedMatrix M T) a := by - let:Finite (restrictedMatrix M T).Group:=restricted_finite M T hT - obtain ⟨z,hz⟩:=exists_longest (restrictedMatrix M T).toCoxeterSystem - exact positive_greedy_head _ (spherical_positive_cancel_left M T hT) z hz a - -theorem spherical_positive_gcd_left (T:Set S) (hT:IsSpherical M T) - (a b:PositiveArtin (restrictedMatrix M T)) : - ∃g:PositiveArtin (restrictedMatrix M T), - PositivePrefix (restrictedMatrix M T) g a ∧ PositivePrefix (restrictedMatrix M T) g b ∧ - ∀e:PositiveArtin (restrictedMatrix M T),PositivePrefix (restrictedMatrix M T) e a→ - PositivePrefix (restrictedMatrix M T) e b→PositivePrefix (restrictedMatrix M T) e g := by - let:Finite (restrictedMatrix M T).Group:=restricted_finite M T hT - obtain ⟨z,hz⟩:=exists_longest (restrictedMatrix M T).toCoxeterSystem - exact positive_greatest_common_left_divisor _ (spherical_positive_cancel_left M T hT) z hz a b - -theorem spherical_positive_gcd_right (T:Set S) (hT:IsSpherical M T) - (a b:PositiveArtin (restrictedMatrix M T)) : - ∃g:PositiveArtin (restrictedMatrix M T), - PositiveSuffix (restrictedMatrix M T) g a ∧ PositiveSuffix (restrictedMatrix M T) g b ∧ - ∀e:PositiveArtin (restrictedMatrix M T),PositiveSuffix (restrictedMatrix M T) e a→ - PositiveSuffix (restrictedMatrix M T) e b→PositiveSuffix (restrictedMatrix M T) e g := by - let:Finite (restrictedMatrix M T).Group:=restricted_finite M T hT - obtain ⟨z,hz⟩:=exists_longest (restrictedMatrix M T).toCoxeterSystem - exact positive_greatest_common_right_divisor _ z hz (spherical_positive_cancel_left M T hT) a b - -end HarmonicArtin - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Harmonic.PositiveReverseHom +import OAI.Topology.ArtinGroups.Cancellation.SphericalPositiveCancelMonoid + +namespace OAI + +namespace HarmonicArtin +open CoxeterExchange Geometric + +attribute [local instance] Classical.decEq Classical.propDecidable +variable {S:Type} [Fintype S] [LinearOrder S] (M:CoxeterMatrix S) + +lemma spherical_positive_cancel_left (T:Set S) (hT:IsSpherical M T) + (a b c:PositiveArtin (restrictedMatrix M T)) (h:a*b=a*c) : b=c := by + let := sphericalPositiveCancelMonoid M T hT + exact mul_left_cancel h + +theorem spherical_positive_head (T:Set S) (hT:IsSpherical M T) + (a:PositiveArtin (restrictedMatrix M T)) : HasPositiveHead (restrictedMatrix M T) a := by + let:Finite (restrictedMatrix M T).Group:=restricted_finite M T hT + obtain ⟨z,hz⟩:=exists_longest (restrictedMatrix M T).toCoxeterSystem + exact positive_greedy_head _ (spherical_positive_cancel_left M T hT) z hz a + +theorem spherical_positive_gcd_left (T:Set S) (hT:IsSpherical M T) + (a b:PositiveArtin (restrictedMatrix M T)) : + ∃g:PositiveArtin (restrictedMatrix M T), + PositivePrefix (restrictedMatrix M T) g a ∧ PositivePrefix (restrictedMatrix M T) g b ∧ + ∀e:PositiveArtin (restrictedMatrix M T),PositivePrefix (restrictedMatrix M T) e a→ + PositivePrefix (restrictedMatrix M T) e b→PositivePrefix (restrictedMatrix M T) e g := by + let:Finite (restrictedMatrix M T).Group:=restricted_finite M T hT + obtain ⟨z,hz⟩:=exists_longest (restrictedMatrix M T).toCoxeterSystem + exact positive_greatest_common_left_divisor _ (spherical_positive_cancel_left M T hT) z hz a b + +theorem spherical_positive_gcd_right (T:Set S) (hT:IsSpherical M T) + (a b:PositiveArtin (restrictedMatrix M T)) : + ∃g:PositiveArtin (restrictedMatrix M T), + PositiveSuffix (restrictedMatrix M T) g a ∧ PositiveSuffix (restrictedMatrix M T) g b ∧ + ∀e:PositiveArtin (restrictedMatrix M T),PositiveSuffix (restrictedMatrix M T) e a→ + PositiveSuffix (restrictedMatrix M T) e b→PositiveSuffix (restrictedMatrix M T) e g := by + let:Finite (restrictedMatrix M T).Group:=restricted_finite M T hT + obtain ⟨z,hz⟩:=exists_longest (restrictedMatrix M T).toCoxeterSystem + exact positive_greatest_common_right_divisor _ z hz (spherical_positive_cancel_left M T hT) a b + +end HarmonicArtin + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelMonoid.lean b/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelMonoid.lean index 7ee0efd7553f57fa9b4251d3c352082692d18930..6f94f011b738919a50e5426ae0ebdd53fba7be8a 100644 --- a/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelMonoid.lean +++ b/lean/OAI/Topology/ArtinGroups/Cancellation/SphericalPositiveCancelMonoid.lean @@ -1,40 +1,40 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Harmonic.FiniteArtinPositiveLeft -import OAI.Topology.ArtinGroups.Harmonic.ProbePositiveWordMonoid - -namespace OAI - -namespace HarmonicArtin -open CoxeterExchange Geometric - -attribute [local instance] Classical.decEq Classical.propDecidable -variable {S:Type} [Fintype S] [LinearOrder S] (M:CoxeterMatrix S) - -noncomputable abbrev sphericalPositiveCancelMonoid (T:Set S) (hT:IsSpherical M T) : - CancelMonoid (PositiveArtin (restrictedMatrix M T)) := by - let f:PositiveArtin (restrictedMatrix M T) →* Artin M := - (restrictedArtinHom M T).comp (positiveToArtin (restrictedMatrix M T)) - exact Function.Injective.cancelMonoid f (spherical_positiveToAmbient_injective M T hT) - f.map_one f.map_mul f.map_pow - -theorem spherical_positiveToArtin_injective (T:Set S) (hT:IsSpherical M T) : - Function.Injective (positiveToArtin (restrictedMatrix M T)) := by - intro a b h - apply spherical_positiveToAmbient_injective M T hT - exact congrArg (restrictedArtinHom M T) h - -omit [LinearOrder S] in -theorem spherical_positive_monoid_fractions (T:Set S) (hT:IsSpherical M T) - (g:Artin (restrictedMatrix M T)) : - (∃a b:PositiveArtin (restrictedMatrix M T),g=positiveToArtin _ a*(positiveToArtin _ b)⁻¹) ∧ - (∃c d:PositiveArtin (restrictedMatrix M T),g=(positiveToArtin _ c)⁻¹*positiveToArtin _ d) := by - have : Finite (restrictedMatrix M T).Group := restricted_finite M T hT - constructor - · obtain ⟨a,b,h⟩:=finiteArtin_positive_fraction (restrictedMatrix M T) g - exact ⟨wordPositive _ a,wordPositive _ b,by simpa only [positiveToArtin_word] using h⟩ - · obtain ⟨a,b,h⟩:=finiteArtin_positive_left_fraction (restrictedMatrix M T) g - exact ⟨wordPositive _ a,wordPositive _ b,by simpa only [positiveToArtin_word] using h⟩ - -end HarmonicArtin - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Harmonic.FiniteArtinPositiveLeft +import OAI.Topology.ArtinGroups.Harmonic.ProbePositiveWordMonoid + +namespace OAI + +namespace HarmonicArtin +open CoxeterExchange Geometric + +attribute [local instance] Classical.decEq Classical.propDecidable +variable {S:Type} [Fintype S] [LinearOrder S] (M:CoxeterMatrix S) + +noncomputable abbrev sphericalPositiveCancelMonoid (T:Set S) (hT:IsSpherical M T) : + CancelMonoid (PositiveArtin (restrictedMatrix M T)) := by + let f:PositiveArtin (restrictedMatrix M T) →* Artin M := + (restrictedArtinHom M T).comp (positiveToArtin (restrictedMatrix M T)) + exact Function.Injective.cancelMonoid f (spherical_positiveToAmbient_injective M T hT) + f.map_one f.map_mul f.map_pow + +theorem spherical_positiveToArtin_injective (T:Set S) (hT:IsSpherical M T) : + Function.Injective (positiveToArtin (restrictedMatrix M T)) := by + intro a b h + apply spherical_positiveToAmbient_injective M T hT + exact congrArg (restrictedArtinHom M T) h + +omit [LinearOrder S] in +theorem spherical_positive_monoid_fractions (T:Set S) (hT:IsSpherical M T) + (g:Artin (restrictedMatrix M T)) : + (∃a b:PositiveArtin (restrictedMatrix M T),g=positiveToArtin _ a*(positiveToArtin _ b)⁻¹) ∧ + (∃c d:PositiveArtin (restrictedMatrix M T),g=(positiveToArtin _ c)⁻¹*positiveToArtin _ d) := by + have : Finite (restrictedMatrix M T).Group := restricted_finite M T hT + constructor + · obtain ⟨a,b,h⟩:=finiteArtin_positive_fraction (restrictedMatrix M T) g + exact ⟨wordPositive _ a,wordPositive _ b,by simpa only [positiveToArtin_word] using h⟩ + · obtain ⟨a,b,h⟩:=finiteArtin_positive_left_fraction (restrictedMatrix M T) g + exact ⟨wordPositive _ a,wordPositive _ b,by simpa only [positiveToArtin_word] using h⟩ + +end HarmonicArtin + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ActedIndex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ActedIndex.lean index 7b349c278649f389947c82ea73706e85366052ee..a99d88ffc6dca33549aef1ff41150692e5d1d434 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ActedIndex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ActedIndex.lean @@ -1,133 +1,133 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.TestPlacement -import OAI.Topology.ArtinGroups.Complexes.Reindex -import OAI.Topology.ArtinGroups.Cancellation.BlockPivot -import OAI.Topology.ArtinGroups.Complexes.CoconePlacement -import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential -import OAI.Topology.ArtinGroups.Complexes.Identity - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -abbrev ActedIndex (E : BasedComplex Q (K := K) I) (α : V) := - {i : I // (E.placement i).color = α} - -abbrev AmplitudeCoreIndex (E : BasedComplex Q (K := K) I) (α : V) := - {u : TestIndex Q E.placement α // Path.length u.2.val ≠ 0} ⊕ - {i : I // (E.placement i).color ≠ α} - -noncomputable instance amplitudeCoreFintype (E : BasedComplex Q (K := K) I) (α : V) : - Fintype (AmplitudeCoreIndex Q E α) := by - classical - unfold AmplitudeCoreIndex - infer_instance - -noncomputable instance amplitudeCoreDecidable (E : BasedComplex Q (K := K) I) (α : V) : - DecidableEq (AmplitudeCoreIndex Q E α) := fun a b => instDecidableEqSum a b - -def unitTest (E : BasedComplex Q (K := K) I) (α : V) (i : ActedIndex Q E α) : - TestIndex Q E.placement α := - ⟨i.val, ⟨.inl α, rfl, i.property.symm⟩⟩ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma unitTest_injective (E : BasedComplex Q (K := K) I) (α : V) : - Function.Injective (unitTest Q E α) := by - intro i j h - exact Subtype.ext (congrArg Sigma.fst h) - -def amplitudeIndexMap (E : BasedComplex Q (K := K) I) (α : V) : - ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ AmplitudeCoreIndex Q E α → - TestIndex Q E.placement α ⊕ I - | .inl i => .inl (unitTest Q E α i) - | .inr (.inl i) => .inr i.val - | .inr (.inr (.inl u)) => .inl u.val - | .inr (.inr (.inr i)) => .inr i.val - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma amplitudeIndexMap_injective (E : BasedComplex Q (K := K) I) (α : V) : - Function.Injective (amplitudeIndexMap Q E α) := by - intro i j h - rcases i with i | i | u | i <;> rcases j with j | j | v | j - all_goals dsimp only [amplitudeIndexMap] at h - all_goals try cases h - · exact congrArg Sum.inl (unitTest_injective Q E α (Sum.inl.inj h)) - · have hv := v.property - rw [← Sum.inl.inj h] at hv - exact (hv rfl).elim - · exact congrArg (fun x => Sum.inr (Sum.inl x)) (Subtype.ext (Sum.inr.inj h)) - · exact (j.property ((Sum.inr.inj h) ▸ i.property)).elim - · have hu := u.property - rw [Sum.inl.inj h] at hu - exact (hu rfl).elim - · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inl x))) (Subtype.ext (Sum.inl.inj h)) - · exact (i.property ((Sum.inr.inj h).symm ▸ j.property)).elim - · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inr x))) (Subtype.ext (Sum.inr.inj h)) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma amplitudeIndexMap_surjective (E : BasedComplex Q (K := K) I) (α : V) : - Function.Surjective (amplitudeIndexMap Q E α) := by - intro u - rcases u with ⟨i, ⟨v | a | v, hs, ht⟩⟩ | i - · dsimp only [Path.source, Path.target] at hs ht - subst v - exact ⟨.inl ⟨i, ht.symm⟩, rfl⟩ - · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inr (.inl a), hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ - · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inr (.inr v), hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ - · by_cases hi : (E.placement i).color = α - · exact ⟨.inr (.inl ⟨i, hi⟩), rfl⟩ - · exact ⟨.inr (.inr (.inr ⟨i, hi⟩)), rfl⟩ - -noncomputable def amplitudeIndexEquiv (E : BasedComplex Q (K := K) I) (α : V) : - ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ AmplitudeCoreIndex Q E α ≃ - TestIndex Q E.placement α ⊕ I := - Equiv.ofBijective (amplitudeIndexMap Q E α) - ⟨amplitudeIndexMap_injective Q E α, amplitudeIndexMap_surjective Q E α⟩ - -noncomputable def normalizedAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) - (ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ AmplitudeCoreIndex Q E α) := - (E.positiveTwist Q α).reindex Q (amplitudeIndexEquiv Q E α) - -noncomputable def amplitudePivot (E : BasedComplex Q (K := K) I) (α : V) : - BlockPivot Q (normalizedAmplitudeTwist Q E α) where - coefficient := 1 - nonzero := one_ne_zero - color i := i.property - cochain i := by change (E.placement i.val).cochain = (E.placement i.val).cochain - 1 + 1; omega - internal i := by change (E.placement i.val).internal = (E.placement i.val).internal + 0; omega - entry i j := by - change evaluationMatrix Q E.placement α (unitTest Q E α i) j.val = - (1 : K) • projectiveIdentity Q - (fun j => (normalizedAmplitudeTwist Q E α).placement (.inl j)) i j - simp only [evaluationMatrix, unitTest, pathBasis_vertex, one_smul, - projectiveIdentity, Matrix.diagonal_apply] - change (if i.val = j.val then vertexId Q (K := K) α else 0) = - (if i = j then vertexId Q (K := K) α else 0) - simp only [Subtype.val_inj] - -noncomputable def reducedAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) (AmplitudeCoreIndex Q E α) := - (amplitudePivot Q E α).reduced Q - -noncomputable def amplitudeTwistReduction (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q (E.positiveTwist Q α) (reducedAmplitudeTwist Q E α) := - ((E.positiveTwist Q α).reindexHomotopyEquivalence Q (amplitudeIndexEquiv Q E α)).trans Q - ((amplitudePivot Q E α).reductionEquivalence Q) - -lemma reducedAmplitudeTwist_placement (E : BasedComplex Q (K := K) I) (α : V) : - (reducedAmplitudeTwist Q E α).placement = - fun i => match i with - | .inl u => ⟨α, (E.placement u.val.1).cochain - 1, - (E.placement u.val.1).internal + Path.length u.val.2.val⟩ - | .inr i => E.placement i.val := by - funext i - cases i <;> rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.TestPlacement +import OAI.Topology.ArtinGroups.Complexes.Reindex +import OAI.Topology.ArtinGroups.Cancellation.BlockPivot +import OAI.Topology.ArtinGroups.Complexes.CoconePlacement +import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential +import OAI.Topology.ArtinGroups.Complexes.Identity + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +abbrev ActedIndex (E : BasedComplex Q (K := K) I) (α : V) := + {i : I // (E.placement i).color = α} + +abbrev AmplitudeCoreIndex (E : BasedComplex Q (K := K) I) (α : V) := + {u : TestIndex Q E.placement α // Path.length u.2.val ≠ 0} ⊕ + {i : I // (E.placement i).color ≠ α} + +noncomputable instance amplitudeCoreFintype (E : BasedComplex Q (K := K) I) (α : V) : + Fintype (AmplitudeCoreIndex Q E α) := by + classical + unfold AmplitudeCoreIndex + infer_instance + +noncomputable instance amplitudeCoreDecidable (E : BasedComplex Q (K := K) I) (α : V) : + DecidableEq (AmplitudeCoreIndex Q E α) := fun a b => instDecidableEqSum a b + +def unitTest (E : BasedComplex Q (K := K) I) (α : V) (i : ActedIndex Q E α) : + TestIndex Q E.placement α := + ⟨i.val, ⟨.inl α, rfl, i.property.symm⟩⟩ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma unitTest_injective (E : BasedComplex Q (K := K) I) (α : V) : + Function.Injective (unitTest Q E α) := by + intro i j h + exact Subtype.ext (congrArg Sigma.fst h) + +def amplitudeIndexMap (E : BasedComplex Q (K := K) I) (α : V) : + ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ AmplitudeCoreIndex Q E α → + TestIndex Q E.placement α ⊕ I + | .inl i => .inl (unitTest Q E α i) + | .inr (.inl i) => .inr i.val + | .inr (.inr (.inl u)) => .inl u.val + | .inr (.inr (.inr i)) => .inr i.val + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma amplitudeIndexMap_injective (E : BasedComplex Q (K := K) I) (α : V) : + Function.Injective (amplitudeIndexMap Q E α) := by + intro i j h + rcases i with i | i | u | i <;> rcases j with j | j | v | j + all_goals dsimp only [amplitudeIndexMap] at h + all_goals try cases h + · exact congrArg Sum.inl (unitTest_injective Q E α (Sum.inl.inj h)) + · have hv := v.property + rw [← Sum.inl.inj h] at hv + exact (hv rfl).elim + · exact congrArg (fun x => Sum.inr (Sum.inl x)) (Subtype.ext (Sum.inr.inj h)) + · exact (j.property ((Sum.inr.inj h) ▸ i.property)).elim + · have hu := u.property + rw [Sum.inl.inj h] at hu + exact (hu rfl).elim + · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inl x))) (Subtype.ext (Sum.inl.inj h)) + · exact (i.property ((Sum.inr.inj h).symm ▸ j.property)).elim + · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inr x))) (Subtype.ext (Sum.inr.inj h)) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma amplitudeIndexMap_surjective (E : BasedComplex Q (K := K) I) (α : V) : + Function.Surjective (amplitudeIndexMap Q E α) := by + intro u + rcases u with ⟨i, ⟨v | a | v, hs, ht⟩⟩ | i + · dsimp only [Path.source, Path.target] at hs ht + subst v + exact ⟨.inl ⟨i, ht.symm⟩, rfl⟩ + · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inr (.inl a), hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ + · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inr (.inr v), hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ + · by_cases hi : (E.placement i).color = α + · exact ⟨.inr (.inl ⟨i, hi⟩), rfl⟩ + · exact ⟨.inr (.inr (.inr ⟨i, hi⟩)), rfl⟩ + +noncomputable def amplitudeIndexEquiv (E : BasedComplex Q (K := K) I) (α : V) : + ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ AmplitudeCoreIndex Q E α ≃ + TestIndex Q E.placement α ⊕ I := + Equiv.ofBijective (amplitudeIndexMap Q E α) + ⟨amplitudeIndexMap_injective Q E α, amplitudeIndexMap_surjective Q E α⟩ + +noncomputable def normalizedAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) + (ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ AmplitudeCoreIndex Q E α) := + (E.positiveTwist Q α).reindex Q (amplitudeIndexEquiv Q E α) + +noncomputable def amplitudePivot (E : BasedComplex Q (K := K) I) (α : V) : + BlockPivot Q (normalizedAmplitudeTwist Q E α) where + coefficient := 1 + nonzero := one_ne_zero + color i := i.property + cochain i := by change (E.placement i.val).cochain = (E.placement i.val).cochain - 1 + 1; omega + internal i := by change (E.placement i.val).internal = (E.placement i.val).internal + 0; omega + entry i j := by + change evaluationMatrix Q E.placement α (unitTest Q E α i) j.val = + (1 : K) • projectiveIdentity Q + (fun j => (normalizedAmplitudeTwist Q E α).placement (.inl j)) i j + simp only [evaluationMatrix, unitTest, pathBasis_vertex, one_smul, + projectiveIdentity, Matrix.diagonal_apply] + change (if i.val = j.val then vertexId Q (K := K) α else 0) = + (if i = j then vertexId Q (K := K) α else 0) + simp only [Subtype.val_inj] + +noncomputable def reducedAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) (AmplitudeCoreIndex Q E α) := + (amplitudePivot Q E α).reduced Q + +noncomputable def amplitudeTwistReduction (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q (E.positiveTwist Q α) (reducedAmplitudeTwist Q E α) := + ((E.positiveTwist Q α).reindexHomotopyEquivalence Q (amplitudeIndexEquiv Q E α)).trans Q + ((amplitudePivot Q E α).reductionEquivalence Q) + +lemma reducedAmplitudeTwist_placement (E : BasedComplex Q (K := K) I) (α : V) : + (reducedAmplitudeTwist Q E α).placement = + fun i => match i with + | .inl u => ⟨α, (E.placement u.val.1).cochain - 1, + (E.placement u.val.1).internal + Path.length u.val.2.val⟩ + | .inr i => E.placement i.val := by + funext i + cases i <;> rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ArrowShift.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ArrowShift.lean index ae01a10f106605f474336569fe1b7ef8e8da86ef..05a4a6e67e4bf1989953c4e829612758d09d8117 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ArrowShift.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ArrowShift.lean @@ -1,195 +1,195 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Coxeter.BraidCoreFirstTarget -import OAI.Topology.ArtinGroups.Complexes.TokenShift - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -noncomputable def arrowShift (E:BasedComplex Q (K:=K) I) : BasedComplex Q (K:=K) I where - placement i := ⟨(E.placement i).color,(E.placement i).cochain-1,(E.placement i).internal+1⟩ - differential := -E.differential - entries := projectiveEntries_neg Q E.entries - degree i j := by - constructor - · intro h - change -E.differential i j=0 - rw [(E.degree i j).1 (by dsimp only at h; omega),neg_zero] - · change Homogeneous Q (0+((E.placement i).internal+1)-((E.placement j).internal+1)) (-E.differential i j) - convert homogeneous_neg Q (E.degree i j).2 using 1; omega - square_zero := by rw [Matrix.neg_mul,Matrix.mul_neg,neg_neg,E.square_zero] - -abbrev AdjacentTestIndex (E:BasedComplex Q (K:=K) I) (α β:V) := - TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ - TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ TestIndex Q E.placement α - -noncomputable def adjacentTestIndexEquiv (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : - AdjacentTestIndex Q E α β ≃ - TestIndex Q ((E.positiveTwist Q β).positiveTwist Q α).placement β where - toFun - | .inl u => ⟨.inr (.inl u),selfCornerEquiv Q hn β false⟩ - | .inr (.inl u) => ⟨.inr (.inr u.1),u.2⟩ - | .inr (.inr (.inl u)) => ⟨.inl ⟨.inl u,e.corner Q⟩,(e.reverse Q).corner Q⟩ - | .inr (.inr (.inr (.inl u))) => ⟨.inr (.inl u),selfCornerEquiv Q hn β true⟩ - | .inr (.inr (.inr (.inr u))) => ⟨.inl ⟨.inr u.1,u.2⟩,(e.reverse Q).corner Q⟩ - invFun - | ⟨.inl ⟨.inl u,_⟩,_⟩ => .inr (.inr (.inl u)) - | ⟨.inl ⟨.inr i,p⟩,_⟩ => .inr (.inr (.inr (.inr ⟨i,p⟩))) - | ⟨.inr (.inl u),p⟩ => if (selfCornerEquiv Q hn β).symm p then - .inr (.inr (.inr (.inl u))) else .inl u - | ⟨.inr (.inr i),p⟩ => .inr (.inl ⟨i,p⟩) - left_inv u := by rcases u with u|u|u|u|u <;> rfl - right_inv u := by - rcases u with ⟨⟨u|i,p⟩|(u|i),q⟩ - · have hp:p=e.corner Q:=e.corner_unique Q p - have hq:q=(e.reverse Q).corner Q := (e.reverse Q).corner_unique Q q - cases hp; cases hq; rfl - · have hq:q=(e.reverse Q).corner Q := (e.reverse Q).corner_unique Q q - cases hq; rfl - · have he:=(selfCornerEquiv Q hn β).apply_symm_apply q - cases h:(selfCornerEquiv Q hn β).symm q - · simp only [h,Bool.false_eq_true,↓reduceIte] - congr 1 - change (selfCornerEquiv Q hn β false : Zigzag.CornerPath Q β β)=q - simpa only [h] using he - · simp only [h,↓reduceIte] - congr 1 - change (selfCornerEquiv Q hn β true : Zigzag.CornerPath Q β β)=q - simpa only [h] using he - · rfl - -noncomputable def normalizedAdjacentTest (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) := - (((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β).reindex Q - (adjacentTestIndexEquiv Q hn E e) - -lemma adjacentTest_first_pivot_entry (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) - (u v:TestIndex Q E.placement β) : - (normalizedAdjacentTest Q hn E e).differential (.inl u) (.inr (.inl v))= - projectiveIdentity Q (testPlacement Q E.placement β) u v := by - exact normalizedTestTwist_pivot_entry Q hn E β u v - -noncomputable def adjacentTestFirstPivot (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : - BlockPivot Q (normalizedAdjacentTest Q hn E e) where - coefficient := 1 - nonzero := one_ne_zero - color _ := rfl - cochain i := by change (E.placement i.1).cochain=(E.placement i.1).cochain-1+1; omega - internal i := by - change (E.placement i.1).internal+Path.length i.2.val= - (E.placement i.1).internal+Path.length i.2.val+0 - omega - entry i j := by rw [adjacentTest_first_pivot_entry]; simp only [one_smul]; rfl - -omit [DecidableEq I] in -lemma adjacentTest_first_source_retained (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) - (u:TestIndex Q E.placement β) - (v:TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ TestIndex Q E.placement α) : - (normalizedAdjacentTest Q hn E e).differential (.inl u) (.inr (.inr v))=0 := by - rcases v with v|v|v - · change (pathCoordinates Q (K:=K) (_ * 0) _) • vertexId Q β=0 - rw [MulZeroClass.mul_zero,coordinates_zero,zero_smul] - · exact normalizedTestTwist_unit_token Q hn E β u v - · change (pathCoordinates Q (K:=K) (_ * 0) _) • vertexId Q β=0 - rw [MulZeroClass.mul_zero,coordinates_zero,zero_smul] - -lemma adjacentTest_first_reduced_entry (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) - (u v:TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ TestIndex Q E.placement α) : - ((adjacentTestFirstPivot Q hn E e).reduced Q).differential u v= - (normalizedAdjacentTest Q hn E e).differential (.inr (.inr u)) (.inr (.inr v)) := by - rw [BlockPivot.reduced_differential] - simp only [adjacentTest_first_source_retained,MulZeroClass.mul_zero,Finset.sum_const_zero,sub_zero] - -omit [DecidableEq I] in -lemma adjacentTest_second_pivot_entry (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) - (u v:TestIndex Q E.placement β) : - (normalizedAdjacentTest Q hn E e).differential - (.inr (.inr (.inl u))) (.inr (.inr (.inr (.inl v))))= - projectiveIdentity Q (testPlacement Q E.placement β) u v := by - change (pathCoordinates Q (K:=K) (pathBasis Q (e.reverse Q).corner.val * - evaluationMatrix Q (E.positiveTwist Q β).placement α ⟨.inl u,e.corner Q⟩ (.inl v)) - (Sum.inr (Sum.inr β))) • vertexId Q β=_ - simp only [evaluationMatrix,SimpleEdge.corner_val,pathBasis_arrow, - Sum.inl.injEq,projectiveIdentity,Matrix.diagonal_apply,testPlacement, - SimpleEdge.reverse_arrow] - by_cases h:u=v - · simp only [ite_eq_left h] - have harr : arrowBasis Q (K:=K) (Q.reverse e.arrow) * arrowBasis Q e.arrow=tokenBasis Q β := by - simpa only [Q.reverse_reverse,Q.source_reverse,e.target] using - (arrowBasis_reverse Q (K:=K) (Q.reverse e.arrow)) - rw [harr] - rw [← pathBasis_token,pathBasis_coordinates,ite_eq_left rfl,one_smul] - · simp only [ite_eq_right h,MulZeroClass.mul_zero,coordinates_zero,zero_smul] - -noncomputable def adjacentTestSecondPivot (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : - BlockPivot Q ((adjacentTestFirstPivot Q hn E e).reduced Q) where - coefficient := 1 - nonzero := one_ne_zero - color _ := rfl - cochain u := by - change (E.placement u.1).cochain-1=(E.placement u.1).cochain-1-1+1 - omega - internal u := by - change (E.placement u.1).internal+Path.length u.2.val+2= - (E.placement u.1).internal+Path.length u.2.val+1+1 - omega - entry u v := by - rw [adjacentTest_first_reduced_entry,adjacentTest_second_pivot_entry] - simp only [one_smul] - rfl - -omit [DecidableEq I] in -lemma adjacentTest_retained_to_second_target (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) - (u:TestIndex Q E.placement α) (v:TestIndex Q E.placement β) : - (normalizedAdjacentTest Q hn E e).differential - (.inr (.inr (.inr (.inr u)))) (.inr (.inr (.inr (.inl v))))=0 := by - change (pathCoordinates Q (K:=K) (_ * evaluationMatrix Q (E.positiveTwist Q β).placement α - ⟨.inr u.1,u.2⟩ (.inl v)) _) • vertexId Q β=0 - simp only [evaluationMatrix,Sum.inr_ne_inl,↓reduceIte,MulZeroClass.mul_zero,coordinates_zero,zero_smul] - -omit [DecidableEq I] in -lemma adjacentTest_retained_entry (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) - (u v:TestIndex Q E.placement α) : - (normalizedAdjacentTest Q hn E e).differential - (.inr (.inr (.inr (.inr u)))) (.inr (.inr (.inr (.inr v))))= - -(testMatrix Q E.placement E.placement α E.differential u v • vertexId Q (K:=K) β) := by - change (pathCoordinates Q (K:=K) (pathBasis Q (e.reverse Q).corner.val * - (-(testMatrix Q E.placement E.placement α E.differential u v • vertexId Q (K:=K) α))) - (e.reverse Q).corner.val) • vertexId Q β=_ - rw [_root_.mul_neg,mul_smul,cornerPath_right] - simp only [map_neg,Pi.neg_apply,coordinates_smul,pathBasis_coordinates,ite_true, - _root_.mul_one,neg_smul] - -lemma adjacentTest_second_reduced_differential (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) - (u v:TestIndex Q E.placement α) : - ((adjacentTestSecondPivot Q hn E e).reduced Q).differential u v= - -(testMatrix Q E.placement E.placement α E.differential u v • vertexId Q (K:=K) β) := by - rw [BlockPivot.reduced_differential] - simp only [adjacentTest_first_reduced_entry,adjacentTest_retained_to_second_target, - smul_zero,MulZeroClass.zero_mul,Finset.sum_const_zero,sub_zero,adjacentTest_retained_entry] - -noncomputable def adjacentTestReduction (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : - HomotopyEquivalence Q (((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β) - ((adjacentTestSecondPivot Q hn E e).reduced Q) := - ((((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β).reindexHomotopyEquivalence Q - (adjacentTestIndexEquiv Q hn E e)).trans Q - (((adjacentTestFirstPivot Q hn E e).reductionEquivalence Q).trans Q - ((adjacentTestSecondPivot Q hn E e).reductionEquivalence Q)) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Coxeter.BraidCoreFirstTarget +import OAI.Topology.ArtinGroups.Complexes.TokenShift + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +noncomputable def arrowShift (E:BasedComplex Q (K:=K) I) : BasedComplex Q (K:=K) I where + placement i := ⟨(E.placement i).color,(E.placement i).cochain-1,(E.placement i).internal+1⟩ + differential := -E.differential + entries := projectiveEntries_neg Q E.entries + degree i j := by + constructor + · intro h + change -E.differential i j=0 + rw [(E.degree i j).1 (by dsimp only at h; omega),neg_zero] + · change Homogeneous Q (0+((E.placement i).internal+1)-((E.placement j).internal+1)) (-E.differential i j) + convert homogeneous_neg Q (E.degree i j).2 using 1; omega + square_zero := by rw [Matrix.neg_mul,Matrix.mul_neg,neg_neg,E.square_zero] + +abbrev AdjacentTestIndex (E:BasedComplex Q (K:=K) I) (α β:V) := + TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ + TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ TestIndex Q E.placement α + +noncomputable def adjacentTestIndexEquiv (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : + AdjacentTestIndex Q E α β ≃ + TestIndex Q ((E.positiveTwist Q β).positiveTwist Q α).placement β where + toFun + | .inl u => ⟨.inr (.inl u),selfCornerEquiv Q hn β false⟩ + | .inr (.inl u) => ⟨.inr (.inr u.1),u.2⟩ + | .inr (.inr (.inl u)) => ⟨.inl ⟨.inl u,e.corner Q⟩,(e.reverse Q).corner Q⟩ + | .inr (.inr (.inr (.inl u))) => ⟨.inr (.inl u),selfCornerEquiv Q hn β true⟩ + | .inr (.inr (.inr (.inr u))) => ⟨.inl ⟨.inr u.1,u.2⟩,(e.reverse Q).corner Q⟩ + invFun + | ⟨.inl ⟨.inl u,_⟩,_⟩ => .inr (.inr (.inl u)) + | ⟨.inl ⟨.inr i,p⟩,_⟩ => .inr (.inr (.inr (.inr ⟨i,p⟩))) + | ⟨.inr (.inl u),p⟩ => if (selfCornerEquiv Q hn β).symm p then + .inr (.inr (.inr (.inl u))) else .inl u + | ⟨.inr (.inr i),p⟩ => .inr (.inl ⟨i,p⟩) + left_inv u := by rcases u with u|u|u|u|u <;> rfl + right_inv u := by + rcases u with ⟨⟨u|i,p⟩|(u|i),q⟩ + · have hp:p=e.corner Q:=e.corner_unique Q p + have hq:q=(e.reverse Q).corner Q := (e.reverse Q).corner_unique Q q + cases hp; cases hq; rfl + · have hq:q=(e.reverse Q).corner Q := (e.reverse Q).corner_unique Q q + cases hq; rfl + · have he:=(selfCornerEquiv Q hn β).apply_symm_apply q + cases h:(selfCornerEquiv Q hn β).symm q + · simp only [h,Bool.false_eq_true,↓reduceIte] + congr 1 + change (selfCornerEquiv Q hn β false : Zigzag.CornerPath Q β β)=q + simpa only [h] using he + · simp only [h,↓reduceIte] + congr 1 + change (selfCornerEquiv Q hn β true : Zigzag.CornerPath Q β β)=q + simpa only [h] using he + · rfl + +noncomputable def normalizedAdjacentTest (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) := + (((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β).reindex Q + (adjacentTestIndexEquiv Q hn E e) + +lemma adjacentTest_first_pivot_entry (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) + (u v:TestIndex Q E.placement β) : + (normalizedAdjacentTest Q hn E e).differential (.inl u) (.inr (.inl v))= + projectiveIdentity Q (testPlacement Q E.placement β) u v := by + exact normalizedTestTwist_pivot_entry Q hn E β u v + +noncomputable def adjacentTestFirstPivot (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : + BlockPivot Q (normalizedAdjacentTest Q hn E e) where + coefficient := 1 + nonzero := one_ne_zero + color _ := rfl + cochain i := by change (E.placement i.1).cochain=(E.placement i.1).cochain-1+1; omega + internal i := by + change (E.placement i.1).internal+Path.length i.2.val= + (E.placement i.1).internal+Path.length i.2.val+0 + omega + entry i j := by rw [adjacentTest_first_pivot_entry]; simp only [one_smul]; rfl + +omit [DecidableEq I] in +lemma adjacentTest_first_source_retained (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) + (u:TestIndex Q E.placement β) + (v:TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ TestIndex Q E.placement α) : + (normalizedAdjacentTest Q hn E e).differential (.inl u) (.inr (.inr v))=0 := by + rcases v with v|v|v + · change (pathCoordinates Q (K:=K) (_ * 0) _) • vertexId Q β=0 + rw [MulZeroClass.mul_zero,coordinates_zero,zero_smul] + · exact normalizedTestTwist_unit_token Q hn E β u v + · change (pathCoordinates Q (K:=K) (_ * 0) _) • vertexId Q β=0 + rw [MulZeroClass.mul_zero,coordinates_zero,zero_smul] + +lemma adjacentTest_first_reduced_entry (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) + (u v:TestIndex Q E.placement β ⊕ TestIndex Q E.placement β ⊕ TestIndex Q E.placement α) : + ((adjacentTestFirstPivot Q hn E e).reduced Q).differential u v= + (normalizedAdjacentTest Q hn E e).differential (.inr (.inr u)) (.inr (.inr v)) := by + rw [BlockPivot.reduced_differential] + simp only [adjacentTest_first_source_retained,MulZeroClass.mul_zero,Finset.sum_const_zero,sub_zero] + +omit [DecidableEq I] in +lemma adjacentTest_second_pivot_entry (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) + (u v:TestIndex Q E.placement β) : + (normalizedAdjacentTest Q hn E e).differential + (.inr (.inr (.inl u))) (.inr (.inr (.inr (.inl v))))= + projectiveIdentity Q (testPlacement Q E.placement β) u v := by + change (pathCoordinates Q (K:=K) (pathBasis Q (e.reverse Q).corner.val * + evaluationMatrix Q (E.positiveTwist Q β).placement α ⟨.inl u,e.corner Q⟩ (.inl v)) + (Sum.inr (Sum.inr β))) • vertexId Q β=_ + simp only [evaluationMatrix,SimpleEdge.corner_val,pathBasis_arrow, + Sum.inl.injEq,projectiveIdentity,Matrix.diagonal_apply,testPlacement, + SimpleEdge.reverse_arrow] + by_cases h:u=v + · simp only [ite_eq_left h] + have harr : arrowBasis Q (K:=K) (Q.reverse e.arrow) * arrowBasis Q e.arrow=tokenBasis Q β := by + simpa only [Q.reverse_reverse,Q.source_reverse,e.target] using + (arrowBasis_reverse Q (K:=K) (Q.reverse e.arrow)) + rw [harr] + rw [← pathBasis_token,pathBasis_coordinates,ite_eq_left rfl,one_smul] + · simp only [ite_eq_right h,MulZeroClass.mul_zero,coordinates_zero,zero_smul] + +noncomputable def adjacentTestSecondPivot (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : + BlockPivot Q ((adjacentTestFirstPivot Q hn E e).reduced Q) where + coefficient := 1 + nonzero := one_ne_zero + color _ := rfl + cochain u := by + change (E.placement u.1).cochain-1=(E.placement u.1).cochain-1-1+1 + omega + internal u := by + change (E.placement u.1).internal+Path.length u.2.val+2= + (E.placement u.1).internal+Path.length u.2.val+1+1 + omega + entry u v := by + rw [adjacentTest_first_reduced_entry,adjacentTest_second_pivot_entry] + simp only [one_smul] + rfl + +omit [DecidableEq I] in +lemma adjacentTest_retained_to_second_target (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) + (u:TestIndex Q E.placement α) (v:TestIndex Q E.placement β) : + (normalizedAdjacentTest Q hn E e).differential + (.inr (.inr (.inr (.inr u)))) (.inr (.inr (.inr (.inl v))))=0 := by + change (pathCoordinates Q (K:=K) (_ * evaluationMatrix Q (E.positiveTwist Q β).placement α + ⟨.inr u.1,u.2⟩ (.inl v)) _) • vertexId Q β=0 + simp only [evaluationMatrix,Sum.inr_ne_inl,↓reduceIte,MulZeroClass.mul_zero,coordinates_zero,zero_smul] + +omit [DecidableEq I] in +lemma adjacentTest_retained_entry (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) + (u v:TestIndex Q E.placement α) : + (normalizedAdjacentTest Q hn E e).differential + (.inr (.inr (.inr (.inr u)))) (.inr (.inr (.inr (.inr v))))= + -(testMatrix Q E.placement E.placement α E.differential u v • vertexId Q (K:=K) β) := by + change (pathCoordinates Q (K:=K) (pathBasis Q (e.reverse Q).corner.val * + (-(testMatrix Q E.placement E.placement α E.differential u v • vertexId Q (K:=K) α))) + (e.reverse Q).corner.val) • vertexId Q β=_ + rw [_root_.mul_neg,mul_smul,cornerPath_right] + simp only [map_neg,Pi.neg_apply,coordinates_smul,pathBasis_coordinates,ite_true, + _root_.mul_one,neg_smul] + +lemma adjacentTest_second_reduced_differential (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) + (u v:TestIndex Q E.placement α) : + ((adjacentTestSecondPivot Q hn E e).reduced Q).differential u v= + -(testMatrix Q E.placement E.placement α E.differential u v • vertexId Q (K:=K) β) := by + rw [BlockPivot.reduced_differential] + simp only [adjacentTest_first_reduced_entry,adjacentTest_retained_to_second_target, + smul_zero,MulZeroClass.zero_mul,Finset.sum_const_zero,sub_zero,adjacentTest_retained_entry] + +noncomputable def adjacentTestReduction (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) : + HomotopyEquivalence Q (((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β) + ((adjacentTestSecondPivot Q hn E e).reduced Q) := + ((((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β).reindexHomotopyEquivalence Q + (adjacentTestIndexEquiv Q hn E e)).trans Q + (((adjacentTestFirstPivot Q hn E e).reductionEquivalence Q).trans Q + ((adjacentTestSecondPivot Q hn E e).reductionEquivalence Q)) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/BasedComplexComplex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/BasedComplexComplex.lean index 491be15e9e2b9d4adf9c1052c3374d4a3aeb1a34..96b21bed2db60c2218332e4f0a4dbe19ab231229 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/BasedComplexComplex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/BasedComplexComplex.lean @@ -1,101 +1,101 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid -import OAI.Topology.ArtinGroups.Complexes.PacketConsEquiv - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def classOfComplex {I : Type u} [Fintype I] [DecidableEq I] - (E : BasedComplex Q (K := K) I) : FiniteHomotopyClass Q (K := K) := - Quotient.mk (finiteHomotopySetoid Q) (FiniteModel.ofComplex Q E) - -omit [Fintype V] [DecidableEq A] in -lemma classOfComplex_eq {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (e : HomotopyEquivalence Q E F) : classOfComplex Q E = classOfComplex Q F := - Quotient.sound ⟨e⟩ - -omit [Fintype V] [DecidableEq A] in -lemma classOfComplex_reindex {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - (E : BasedComplex Q (K := K) I) (e : J ≃ I) : - classOfComplex Q E = classOfComplex Q (E.reindex Q e) := - classOfComplex_eq Q (E.reindexHomotopyEquivalence Q e) - -lemma classOfComplex_packet_reindex {I J L : Type u} - [Fintype I] [Fintype J] [Fintype L] [DecidableEq I] [DecidableEq J] [DecidableEq L] - (E : BasedComplex Q (K := K) I) (v:J → V) (e:L ≃ J) : - classOfComplex Q (E.packetTwist Q v) = classOfComplex Q (E.packetTwist Q (v ∘ e)) := by - rw [classOfComplex_reindex Q _ (packetReindexEquiv Q E v e),packetReindex_eq] - -lemma classOfComplex_packet_cons {I J : Type u} - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - (E : BasedComplex Q (K := K) I) (α:V) (v:J → V) - (h : ∀ a, OrthogonalVertices Q α (v a)) : - classOfComplex Q (E.packetTwist Q (fun z : Option J => z.elim α v)) = - classPositiveTwist Q α (classOfComplex Q (E.packetTwist Q v)) := by - change _ = classOfComplex Q ((E.packetTwist Q v).positiveTwist Q α) - rw [classOfComplex_reindex Q _ (packetConsEquiv Q E α v h),packetCons_eq] - -theorem exists_packetPerm (hn : ∀ a, Q.source a ≠ Q.target a) - {J : Type u} [Fintype J] (v : J → V) - (hv : Pairwise (fun a b => OrthogonalVertices Q (v a) (v b))) : - ∃ π : Equiv.Perm (FiniteHomotopyClass Q (K := K)), - ∀ E : FiniteModel.{u} Q (K := K), classOfComplex Q (E.complex.packetTwist Q v) = - π (Quotient.mk (finiteHomotopySetoid Q) E) := by - classical - suffices hh : ∀ (J : Type u) [Fintype J] (v:J → V), - Pairwise (fun a b => OrthogonalVertices Q (v a) (v b)) → - ∃ π : Equiv.Perm (FiniteHomotopyClass Q (K := K)), - ∀ E : FiniteModel.{u} Q (K := K), classOfComplex Q (E.complex.packetTwist Q v) = - π (Quotient.mk (finiteHomotopySetoid Q) E) from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P := fun J _ => ∀ v:J → V, - Pairwise (fun a b => OrthogonalVertices Q (v a) (v b)) → - ∃ π : Equiv.Perm (FiniteHomotopyClass Q (K := K)), - ∀ E : FiniteModel.{u} Q (K := K), classOfComplex Q (E.complex.packetTwist Q v) = - π (Quotient.mk (finiteHomotopySetoid Q) E)) _ _ _ J - · intro J L instL e ih - let := Fintype.ofEquiv L e.symm - intro v hv - obtain ⟨π,hπ⟩ := ih (v ∘ e) (fun a b hab => hv (fun he => hab (e.injective he))) - refine ⟨π,fun E => ?_⟩ - rw [classOfComplex_packet_reindex Q E.complex v e] - exact hπ E - · - intro v hv - refine ⟨Equiv.refl _,fun E => ?_⟩ - convert (classOfComplex_reindex Q _ (packetEmptyEquiv Q E.complex v)).trans - (congrArg (classOfComplex Q) (packetEmpty_eq Q E.complex v)) using 1 <;> (congr 2 <;> exact Subsingleton.elim _ _) - · intro J instJ ih v hv - obtain ⟨π,hπ⟩ := ih (v ∘ some) (fun a b hab => hv (fun he => hab (Option.some.inj he))) - refine ⟨classTwistPerm Q hn (v none) * π,fun E => ?_⟩ - have hv' : v = fun z : Option J => z.elim (v none) (v ∘ some) := by - funext z; cases z <;> rfl - conv_lhs => rw [hv'] - convert (classOfComplex_packet_cons Q E.complex (v none) (v ∘ some) - (fun a => hv (by simp))).trans (congrArg (classPositiveTwist Q (v none)) (hπ E)) using 1 <;> (congr 2 <;> exact Subsingleton.elim _ _) - -noncomputable def classPacketPerm (hn : ∀ a, Q.source a ≠ Q.target a) - {J : Type u} [Fintype J] (v : J → V) - (hv : Pairwise (fun a b => OrthogonalVertices Q (v a) (v b))) : - Equiv.Perm (FiniteHomotopyClass Q (K := K)) := - (exists_packetPerm Q (K := K) hn v hv).choose - -lemma classPacketPerm_apply (hn : ∀ a, Q.source a ≠ Q.target a) - {J : Type u} [Fintype J] [DecidableEq J] (v : J → V) - (hv : Pairwise (fun a b => OrthogonalVertices Q (v a) (v b))) - (E : FiniteModel.{u} Q (K := K)) : - classPacketPerm Q hn v hv (Quotient.mk (finiteHomotopySetoid Q) E) = - classOfComplex Q (E.complex.packetTwist Q v) := -by - convert ((exists_packetPerm Q (K := K) hn v hv).choose_spec E).symm using 1 <;> - (congr 2 <;> exact Subsingleton.elim _ _) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid +import OAI.Topology.ArtinGroups.Complexes.PacketConsEquiv + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def classOfComplex {I : Type u} [Fintype I] [DecidableEq I] + (E : BasedComplex Q (K := K) I) : FiniteHomotopyClass Q (K := K) := + Quotient.mk (finiteHomotopySetoid Q) (FiniteModel.ofComplex Q E) + +omit [Fintype V] [DecidableEq A] in +lemma classOfComplex_eq {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (e : HomotopyEquivalence Q E F) : classOfComplex Q E = classOfComplex Q F := + Quotient.sound ⟨e⟩ + +omit [Fintype V] [DecidableEq A] in +lemma classOfComplex_reindex {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + (E : BasedComplex Q (K := K) I) (e : J ≃ I) : + classOfComplex Q E = classOfComplex Q (E.reindex Q e) := + classOfComplex_eq Q (E.reindexHomotopyEquivalence Q e) + +lemma classOfComplex_packet_reindex {I J L : Type u} + [Fintype I] [Fintype J] [Fintype L] [DecidableEq I] [DecidableEq J] [DecidableEq L] + (E : BasedComplex Q (K := K) I) (v:J → V) (e:L ≃ J) : + classOfComplex Q (E.packetTwist Q v) = classOfComplex Q (E.packetTwist Q (v ∘ e)) := by + rw [classOfComplex_reindex Q _ (packetReindexEquiv Q E v e),packetReindex_eq] + +lemma classOfComplex_packet_cons {I J : Type u} + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + (E : BasedComplex Q (K := K) I) (α:V) (v:J → V) + (h : ∀ a, OrthogonalVertices Q α (v a)) : + classOfComplex Q (E.packetTwist Q (fun z : Option J => z.elim α v)) = + classPositiveTwist Q α (classOfComplex Q (E.packetTwist Q v)) := by + change _ = classOfComplex Q ((E.packetTwist Q v).positiveTwist Q α) + rw [classOfComplex_reindex Q _ (packetConsEquiv Q E α v h),packetCons_eq] + +theorem exists_packetPerm (hn : ∀ a, Q.source a ≠ Q.target a) + {J : Type u} [Fintype J] (v : J → V) + (hv : Pairwise (fun a b => OrthogonalVertices Q (v a) (v b))) : + ∃ π : Equiv.Perm (FiniteHomotopyClass Q (K := K)), + ∀ E : FiniteModel.{u} Q (K := K), classOfComplex Q (E.complex.packetTwist Q v) = + π (Quotient.mk (finiteHomotopySetoid Q) E) := by + classical + suffices hh : ∀ (J : Type u) [Fintype J] (v:J → V), + Pairwise (fun a b => OrthogonalVertices Q (v a) (v b)) → + ∃ π : Equiv.Perm (FiniteHomotopyClass Q (K := K)), + ∀ E : FiniteModel.{u} Q (K := K), classOfComplex Q (E.complex.packetTwist Q v) = + π (Quotient.mk (finiteHomotopySetoid Q) E) from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P := fun J _ => ∀ v:J → V, + Pairwise (fun a b => OrthogonalVertices Q (v a) (v b)) → + ∃ π : Equiv.Perm (FiniteHomotopyClass Q (K := K)), + ∀ E : FiniteModel.{u} Q (K := K), classOfComplex Q (E.complex.packetTwist Q v) = + π (Quotient.mk (finiteHomotopySetoid Q) E)) _ _ _ J + · intro J L instL e ih + let := Fintype.ofEquiv L e.symm + intro v hv + obtain ⟨π,hπ⟩ := ih (v ∘ e) (fun a b hab => hv (fun he => hab (e.injective he))) + refine ⟨π,fun E => ?_⟩ + rw [classOfComplex_packet_reindex Q E.complex v e] + exact hπ E + · + intro v hv + refine ⟨Equiv.refl _,fun E => ?_⟩ + convert (classOfComplex_reindex Q _ (packetEmptyEquiv Q E.complex v)).trans + (congrArg (classOfComplex Q) (packetEmpty_eq Q E.complex v)) using 1 <;> (congr 2 <;> exact Subsingleton.elim _ _) + · intro J instJ ih v hv + obtain ⟨π,hπ⟩ := ih (v ∘ some) (fun a b hab => hv (fun he => hab (Option.some.inj he))) + refine ⟨classTwistPerm Q hn (v none) * π,fun E => ?_⟩ + have hv' : v = fun z : Option J => z.elim (v none) (v ∘ some) := by + funext z; cases z <;> rfl + conv_lhs => rw [hv'] + convert (classOfComplex_packet_cons Q E.complex (v none) (v ∘ some) + (fun a => hv (by simp))).trans (congrArg (classPositiveTwist Q (v none)) (hπ E)) using 1 <;> (congr 2 <;> exact Subsingleton.elim _ _) + +noncomputable def classPacketPerm (hn : ∀ a, Q.source a ≠ Q.target a) + {J : Type u} [Fintype J] (v : J → V) + (hv : Pairwise (fun a b => OrthogonalVertices Q (v a) (v b))) : + Equiv.Perm (FiniteHomotopyClass Q (K := K)) := + (exists_packetPerm Q (K := K) hn v hv).choose + +lemma classPacketPerm_apply (hn : ∀ a, Q.source a ≠ Q.target a) + {J : Type u} [Fintype J] [DecidableEq J] (v : J → V) + (hv : Pairwise (fun a b => OrthogonalVertices Q (v a) (v b))) + (E : FiniteModel.{u} Q (K := K)) : + classPacketPerm Q hn v hv (Quotient.mk (finiteHomotopySetoid Q) E) = + classOfComplex Q (E.complex.packetTwist Q v) := +by + convert ((exists_packetPerm Q (K := K) hn v hv).choose_spec E).symm using 1 <;> + (congr 2 <;> exact Subsingleton.elim _ _) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/BlockClosed.lean b/lean/OAI/Topology/ArtinGroups/Complexes/BlockClosed.lean index 021d8526c5105801627dae995adc7f668793b4de..f1a8c1a8eacacef941de23df579a8991e3a136f6 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/BlockClosed.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/BlockClosed.lean @@ -1,138 +1,138 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.SmulMul - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type*} [Fintype I] [DecidableEq I] -attribute [local instance] Classical.decEq -attribute [local instance] Classical.propDecidable - -def BlockClosed (E:BasedComplex Q (K:=K) I) (T:Set I) : Prop := - ∀ i j, E.differential i j ≠ 0 → (i∈T ↔ j∈T) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma BlockClosed.restrict_condition {E:BasedComplex Q (K:=K) I} {T:Set I} - (h:BlockClosed Q E T) : ∀ i∈T,∀ j∈T,∀ k∉T,E.differential i k*E.differential k j=0 := by - intro i hi j _ k hk - have hz:E.differential i k=0 := by - by_contra hh - exact hk ((h i k hh).mp hi) - rw [hz,zero_mul] - -noncomputable def blockRestriction (E:BasedComplex Q (K:=K) I) (T:Set I) - (h:BlockClosed Q E T) : BasedComplex Q (K:=K) T := - E.restrict Q T h.restrict_condition - -noncomputable def blockInclusion (E:BasedComplex Q (K:=K) I) (T:Set I) : Matrix T I (Q.Zigzag K) := - (projectiveIdentity Q E.placement).submatrix Subtype.val id -noncomputable def blockProjection (E:BasedComplex Q (K:=K) I) (T:Set I) : Matrix I T (Q.Zigzag K) := - (projectiveIdentity Q E.placement).submatrix id Subtype.val - -omit [Fintype V] [DecidableEq A] in -lemma blockInclusion_entries (E:BasedComplex Q (K:=K) I) (T:Set I) : - ProjectiveEntries Q (fun i:T=>E.placement i) E.placement (blockInclusion Q E T) := - ⟨fun i j=>(projectiveEntries_identity Q).1 (i:I) j, - fun i j=>(projectiveEntries_identity Q).2 (i:I) j⟩ -omit [Fintype V] [DecidableEq A] in -lemma blockProjection_entries (E:BasedComplex Q (K:=K) I) (T:Set I) : - ProjectiveEntries Q E.placement (fun i:T=>E.placement i) (blockProjection Q E T) := - ⟨fun i j=>(projectiveEntries_identity Q).1 i (j:I), - fun i j=>(projectiveEntries_identity Q).2 i (j:I)⟩ - -omit [Fintype V] [DecidableEq A] in -lemma blockInclusion_mul (E:BasedComplex Q (K:=K) I) (T:Set I) - {J:Type*} (p:J → GeneratorPlacement V) (M:Matrix I J (Q.Zigzag K)) - (hM:ProjectiveEntries Q E.placement p M) : - blockInclusion Q E T*M=M.submatrix Subtype.val id := by - apply Matrix.ext - intro i j - change (∑ k,(if (i:I)=k then vertexId Q (K:=K) (E.placement i).color else 0)*M k j)=M i j - simp only [ite_mul,zero_mul,Fintype.sum_ite_eq] - exact hM.1 i j - -omit [Fintype V] [DecidableEq A] in -lemma mul_blockProjection (E:BasedComplex Q (K:=K) I) (T:Set I) - {J:Type*} (p:J → GeneratorPlacement V) (M:Matrix J I (Q.Zigzag K)) - (hM:ProjectiveEntries Q p E.placement M) : - M*blockProjection Q E T=M.submatrix id Subtype.val := by - apply Matrix.ext - intro i j - change (∑ k,M i k*(if k=(j:I) then vertexId Q (K:=K) (E.placement k).color else 0))=M i j - simp only [mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] - exact hM.2 i j - -omit [Fintype V] [DecidableEq A] in -lemma block_inclusion_projection (E:BasedComplex Q (K:=K) I) (T:Set I) : - blockInclusion Q E T*blockProjection Q E T=projectiveIdentity Q (fun i:T=>E.placement i) := by - rw [blockInclusion_mul Q E T _ _ (blockProjection_entries Q E T)] - apply Matrix.ext - intro i j - change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= - (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) - simp only [Subtype.val_inj] - -omit [Fintype V] [DecidableEq A] in -lemma blockInclusion_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : - (blockRestriction Q E T h).differential*blockInclusion Q E T= - blockInclusion Q E T*E.differential := by - rw [blockInclusion_mul Q E T _ _ E.entries] - apply Matrix.ext - intro i j - change (∑ k:T,E.differential i k*(if (k:I)=j then vertexId Q (K:=K) (E.placement k).color else 0))=E.differential i j - by_cases hj:j∈T - · let j':T:=⟨j,hj⟩ - have he (k:T) : ((k:I)=j) ↔ k=j' := by simp only [j',Subtype.ext_iff] - simp only [he,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] - exact E.entries.2 i j - · have hz:E.differential i j=0 := by - by_contra hh - exact hj ((h i j hh).mp i.property) - rw [hz] - apply Finset.sum_eq_zero - intro k _ - have hne:(k:I)≠j := by intro he; exact hj (he ▸ k.property) - rw [ite_eq_right hne,MulZeroClass.mul_zero] - -omit [Fintype V] [DecidableEq A] in -lemma blockProjection_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : - E.differential*blockProjection Q E T= - blockProjection Q E T*(blockRestriction Q E T h).differential := by - rw [mul_blockProjection Q E T _ _ E.entries] - apply Matrix.ext - intro i j - change E.differential i j=(∑ k:T,(if i=(k:I) then vertexId Q (K:=K) (E.placement i).color else 0)*E.differential k j) - by_cases hi:i∈T - · let i':T:=⟨i,hi⟩ - have he (k:T) : (i=(k:I)) ↔ i'=k := by simp only [i',Subtype.ext_iff] - simp only [he,ite_mul,zero_mul,Fintype.sum_ite_eq] - exact (E.entries.1 i j).symm - · have hz:E.differential i j=0 := by - by_contra hh - exact hi ((h i j hh).mpr j.property) - rw [hz] - symm - apply Finset.sum_eq_zero - intro k _ - have hne:i≠(k:I) := by intro he; exact hi (he.symm ▸ k.property) - rw [ite_eq_right hne,zero_mul] - -noncomputable def blockInclusionMap (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : - Map Q (blockRestriction Q E T h) E where - matrix:=blockInclusion Q E T - entries:=blockInclusion_entries Q E T - degree:=fun i j=>mapDegree_identity Q (i:I) j - commute:=blockInclusion_commute Q E T h - -noncomputable def blockProjectionMap (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : - Map Q E (blockRestriction Q E T h) where - matrix:=blockProjection Q E T - entries:=blockProjection_entries Q E T - degree:=fun i j=>mapDegree_identity Q i (j:I) - commute:=blockProjection_commute Q E T h - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.SmulMul + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type*} [Fintype I] [DecidableEq I] +attribute [local instance] Classical.decEq +attribute [local instance] Classical.propDecidable + +def BlockClosed (E:BasedComplex Q (K:=K) I) (T:Set I) : Prop := + ∀ i j, E.differential i j ≠ 0 → (i∈T ↔ j∈T) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma BlockClosed.restrict_condition {E:BasedComplex Q (K:=K) I} {T:Set I} + (h:BlockClosed Q E T) : ∀ i∈T,∀ j∈T,∀ k∉T,E.differential i k*E.differential k j=0 := by + intro i hi j _ k hk + have hz:E.differential i k=0 := by + by_contra hh + exact hk ((h i k hh).mp hi) + rw [hz,zero_mul] + +noncomputable def blockRestriction (E:BasedComplex Q (K:=K) I) (T:Set I) + (h:BlockClosed Q E T) : BasedComplex Q (K:=K) T := + E.restrict Q T h.restrict_condition + +noncomputable def blockInclusion (E:BasedComplex Q (K:=K) I) (T:Set I) : Matrix T I (Q.Zigzag K) := + (projectiveIdentity Q E.placement).submatrix Subtype.val id +noncomputable def blockProjection (E:BasedComplex Q (K:=K) I) (T:Set I) : Matrix I T (Q.Zigzag K) := + (projectiveIdentity Q E.placement).submatrix id Subtype.val + +omit [Fintype V] [DecidableEq A] in +lemma blockInclusion_entries (E:BasedComplex Q (K:=K) I) (T:Set I) : + ProjectiveEntries Q (fun i:T=>E.placement i) E.placement (blockInclusion Q E T) := + ⟨fun i j=>(projectiveEntries_identity Q).1 (i:I) j, + fun i j=>(projectiveEntries_identity Q).2 (i:I) j⟩ +omit [Fintype V] [DecidableEq A] in +lemma blockProjection_entries (E:BasedComplex Q (K:=K) I) (T:Set I) : + ProjectiveEntries Q E.placement (fun i:T=>E.placement i) (blockProjection Q E T) := + ⟨fun i j=>(projectiveEntries_identity Q).1 i (j:I), + fun i j=>(projectiveEntries_identity Q).2 i (j:I)⟩ + +omit [Fintype V] [DecidableEq A] in +lemma blockInclusion_mul (E:BasedComplex Q (K:=K) I) (T:Set I) + {J:Type*} (p:J → GeneratorPlacement V) (M:Matrix I J (Q.Zigzag K)) + (hM:ProjectiveEntries Q E.placement p M) : + blockInclusion Q E T*M=M.submatrix Subtype.val id := by + apply Matrix.ext + intro i j + change (∑ k,(if (i:I)=k then vertexId Q (K:=K) (E.placement i).color else 0)*M k j)=M i j + simp only [ite_mul,zero_mul,Fintype.sum_ite_eq] + exact hM.1 i j + +omit [Fintype V] [DecidableEq A] in +lemma mul_blockProjection (E:BasedComplex Q (K:=K) I) (T:Set I) + {J:Type*} (p:J → GeneratorPlacement V) (M:Matrix J I (Q.Zigzag K)) + (hM:ProjectiveEntries Q p E.placement M) : + M*blockProjection Q E T=M.submatrix id Subtype.val := by + apply Matrix.ext + intro i j + change (∑ k,M i k*(if k=(j:I) then vertexId Q (K:=K) (E.placement k).color else 0))=M i j + simp only [mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] + exact hM.2 i j + +omit [Fintype V] [DecidableEq A] in +lemma block_inclusion_projection (E:BasedComplex Q (K:=K) I) (T:Set I) : + blockInclusion Q E T*blockProjection Q E T=projectiveIdentity Q (fun i:T=>E.placement i) := by + rw [blockInclusion_mul Q E T _ _ (blockProjection_entries Q E T)] + apply Matrix.ext + intro i j + change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= + (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) + simp only [Subtype.val_inj] + +omit [Fintype V] [DecidableEq A] in +lemma blockInclusion_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : + (blockRestriction Q E T h).differential*blockInclusion Q E T= + blockInclusion Q E T*E.differential := by + rw [blockInclusion_mul Q E T _ _ E.entries] + apply Matrix.ext + intro i j + change (∑ k:T,E.differential i k*(if (k:I)=j then vertexId Q (K:=K) (E.placement k).color else 0))=E.differential i j + by_cases hj:j∈T + · let j':T:=⟨j,hj⟩ + have he (k:T) : ((k:I)=j) ↔ k=j' := by simp only [j',Subtype.ext_iff] + simp only [he,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] + exact E.entries.2 i j + · have hz:E.differential i j=0 := by + by_contra hh + exact hj ((h i j hh).mp i.property) + rw [hz] + apply Finset.sum_eq_zero + intro k _ + have hne:(k:I)≠j := by intro he; exact hj (he ▸ k.property) + rw [ite_eq_right hne,MulZeroClass.mul_zero] + +omit [Fintype V] [DecidableEq A] in +lemma blockProjection_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : + E.differential*blockProjection Q E T= + blockProjection Q E T*(blockRestriction Q E T h).differential := by + rw [mul_blockProjection Q E T _ _ E.entries] + apply Matrix.ext + intro i j + change E.differential i j=(∑ k:T,(if i=(k:I) then vertexId Q (K:=K) (E.placement i).color else 0)*E.differential k j) + by_cases hi:i∈T + · let i':T:=⟨i,hi⟩ + have he (k:T) : (i=(k:I)) ↔ i'=k := by simp only [i',Subtype.ext_iff] + simp only [he,ite_mul,zero_mul,Fintype.sum_ite_eq] + exact (E.entries.1 i j).symm + · have hz:E.differential i j=0 := by + by_contra hh + exact hi ((h i j hh).mpr j.property) + rw [hz] + symm + apply Finset.sum_eq_zero + intro k _ + have hne:i≠(k:I) := by intro he; exact hi (he.symm ▸ k.property) + rw [ite_eq_right hne,zero_mul] + +noncomputable def blockInclusionMap (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : + Map Q (blockRestriction Q E T h) E where + matrix:=blockInclusion Q E T + entries:=blockInclusion_entries Q E T + degree:=fun i j=>mapDegree_identity Q (i:I) j + commute:=blockInclusion_commute Q E T h + +noncomputable def blockProjectionMap (E:BasedComplex Q (K:=K) I) (T:Set I) (h:BlockClosed Q E T) : + Map Q E (blockRestriction Q E T h) where + matrix:=blockProjection Q E T + entries:=blockProjection_entries Q E T + degree:=fun i j=>mapDegree_identity Q i (j:I) + commute:=blockProjection_commute Q E T h + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleInjective.lean b/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleInjective.lean index fc75365a33cacf07d356334a2103f55a52a54282..1478322367fdacf1ef18800104f0a0bcdc516253 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleInjective.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleInjective.lean @@ -1,82 +1,82 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Harmonic.Level -import OAI.Topology.ArtinGroups.Quivers.CornerScalar - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -theorem bottom_scalar_cycle_injective - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (e:HomotopyEquivalence Q E F) (α:V) {l:ℤ} - (hcolor:∀ i,(E.placement i).color=α) - (hE:∀ i,l≤(E.placement i).level) - (x:I→K) (hs:∀ i,(E.placement i).level≠l → x i=0) - (hx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0) - (hxf:Matrix.vecMul x (e.forward.matrix.map (vertexHom Q α))=0) : x=0 := by - have hxh:Matrix.vecMul x (e.sourceHomotopy.map (vertexHom Q α))=0 := by - funext j - apply Finset.sum_eq_zero - intro i hi - change x i * (e.sourceHomotopy i j).vertex α = 0 - by_cases hxi:x i=0 - · rw [hxi,MulZeroClass.zero_mul] - by_cases hm:(e.sourceHomotopy i j).vertex α=0 - · exact mul_eq_zero.mpr (Or.inr hm) - have hp: (E.placement i).level=l := Classical.not_not.mp (fun h=>hxi (hs i h)) - obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q e.sourceEntries e.sourceDegree i j α hm - have hh:=hE j - dsimp only [GeneratorPlacement.level] at hp hh - omega - have hid:(projectiveIdentity Q (K:=K) E.placement).map (vertexHom Q α)=1 := by - apply Matrix.ext - intro i j - by_cases he:i=j - · subst j - simp only [Matrix.one_apply,Matrix.map_apply,projectiveIdentity,Matrix.diagonal_apply] - change (vertexId Q (K:=K) (E.placement i).color).vertex α = 1 - simp [hcolor i,vertexId_eval] - · simp [projectiveIdentity,Matrix.map_apply,he,vertexHom] - have he:=congrArg (fun M:Matrix I I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.sourceEquation - simp only [Matrix.map_mul,Matrix.map_add _ (map_add _),hid] at he - have he':=congrArg (Matrix.vecMul x) he - simp only [Matrix.vecMul_add,← Matrix.vecMul_vecMul,hxf,hx,hxh, - Matrix.zero_vecMul,Matrix.vecMul_one,add_zero] at he' - exact he'.symm - -theorem bottom_scalar_cycle_transport - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (e:HomotopyEquivalence Q E F) (α:V) {l c:ℤ} - (hcolor:∀ i,(E.placement i).color=α) - (hE:∀ i,l≤(E.placement i).level) - (hF:∀ y:J→K, - (∀ j,¬ ((F.placement j).level=l ∧ (F.placement j).cochain=c)→y j=0)→ - Matrix.vecMul y (F.differential.map (vertexHom Q α))=0→y=0) - (x:I→K) (hs:∀ i,¬ ((E.placement i).level=l ∧ (E.placement i).cochain=c)→x i=0) - (hx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0) : x=0 := by - apply bottom_scalar_cycle_injective Q E F e α hcolor hE x - (fun i hi=>hs i (fun h=>hi h.1)) hx - apply hF - · intro j hj - apply Finset.sum_eq_zero - intro i hi - change x i * (e.forward.matrix i j).vertex α=0 - by_cases hx0:x i=0 - · rw [hx0,MulZeroClass.zero_mul] - by_cases hm:(e.forward.matrix i j).vertex α=0 - · rw [hm,MulZeroClass.mul_zero] - have hp:= (reduction_support Q e.forward.entries e.forward.degree i j α hm).1 - have hi':(E.placement i).level=l ∧ (E.placement i).cochain=c := - Classical.not_not.mp (fun h=>hx0 (hs i h)) - exact (hj (by simpa only [← hp] using hi')).elim - · have hc:=congrArg (fun M:Matrix I J (Q.Zigzag K)=>M.map (vertexHom Q α)) e.forward.commute - simp only [Matrix.map_mul] at hc - rw [Matrix.vecMul_vecMul,← hc,← Matrix.vecMul_vecMul,hx,Matrix.zero_vecMul] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Harmonic.Level +import OAI.Topology.ArtinGroups.Quivers.CornerScalar + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +theorem bottom_scalar_cycle_injective + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (e:HomotopyEquivalence Q E F) (α:V) {l:ℤ} + (hcolor:∀ i,(E.placement i).color=α) + (hE:∀ i,l≤(E.placement i).level) + (x:I→K) (hs:∀ i,(E.placement i).level≠l → x i=0) + (hx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0) + (hxf:Matrix.vecMul x (e.forward.matrix.map (vertexHom Q α))=0) : x=0 := by + have hxh:Matrix.vecMul x (e.sourceHomotopy.map (vertexHom Q α))=0 := by + funext j + apply Finset.sum_eq_zero + intro i hi + change x i * (e.sourceHomotopy i j).vertex α = 0 + by_cases hxi:x i=0 + · rw [hxi,MulZeroClass.zero_mul] + by_cases hm:(e.sourceHomotopy i j).vertex α=0 + · exact mul_eq_zero.mpr (Or.inr hm) + have hp: (E.placement i).level=l := Classical.not_not.mp (fun h=>hxi (hs i h)) + obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q e.sourceEntries e.sourceDegree i j α hm + have hh:=hE j + dsimp only [GeneratorPlacement.level] at hp hh + omega + have hid:(projectiveIdentity Q (K:=K) E.placement).map (vertexHom Q α)=1 := by + apply Matrix.ext + intro i j + by_cases he:i=j + · subst j + simp only [Matrix.one_apply,Matrix.map_apply,projectiveIdentity,Matrix.diagonal_apply] + change (vertexId Q (K:=K) (E.placement i).color).vertex α = 1 + simp [hcolor i,vertexId_eval] + · simp [projectiveIdentity,Matrix.map_apply,he,vertexHom] + have he:=congrArg (fun M:Matrix I I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.sourceEquation + simp only [Matrix.map_mul,Matrix.map_add _ (map_add _),hid] at he + have he':=congrArg (Matrix.vecMul x) he + simp only [Matrix.vecMul_add,← Matrix.vecMul_vecMul,hxf,hx,hxh, + Matrix.zero_vecMul,Matrix.vecMul_one,add_zero] at he' + exact he'.symm + +theorem bottom_scalar_cycle_transport + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (e:HomotopyEquivalence Q E F) (α:V) {l c:ℤ} + (hcolor:∀ i,(E.placement i).color=α) + (hE:∀ i,l≤(E.placement i).level) + (hF:∀ y:J→K, + (∀ j,¬ ((F.placement j).level=l ∧ (F.placement j).cochain=c)→y j=0)→ + Matrix.vecMul y (F.differential.map (vertexHom Q α))=0→y=0) + (x:I→K) (hs:∀ i,¬ ((E.placement i).level=l ∧ (E.placement i).cochain=c)→x i=0) + (hx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0) : x=0 := by + apply bottom_scalar_cycle_injective Q E F e α hcolor hE x + (fun i hi=>hs i (fun h=>hi h.1)) hx + apply hF + · intro j hj + apply Finset.sum_eq_zero + intro i hi + change x i * (e.forward.matrix i j).vertex α=0 + by_cases hx0:x i=0 + · rw [hx0,MulZeroClass.zero_mul] + by_cases hm:(e.forward.matrix i j).vertex α=0 + · rw [hm,MulZeroClass.mul_zero] + have hp:= (reduction_support Q e.forward.entries e.forward.degree i j α hm).1 + have hi':(E.placement i).level=l ∧ (E.placement i).cochain=c := + Classical.not_not.mp (fun h=>hx0 (hs i h)) + exact (hj (by simpa only [← hp] using hi')).elim + · have hc:=congrArg (fun M:Matrix I J (Q.Zigzag K)=>M.map (vertexHom Q α)) e.forward.commute + simp only [Matrix.map_mul] at hc + rw [Matrix.vecMul_vecMul,← hc,← Matrix.vecMul_vecMul,hx,Matrix.zero_vecMul] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleZero.lean b/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleZero.lean index f685ac475d27e3ca9b4258f1952a6295e211bc4d..71d9785b66885128b8b6697f93969b7fc5f7dc4d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleZero.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/BottomScalarCycleZero.lean @@ -1,65 +1,65 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Harmonic.Level -import OAI.Topology.ArtinGroups.Quivers.CornerScalar - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -theorem bottom_scalar_cycle_zero - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (e:HomotopyEquivalence Q E F) (α:V) {l:ℤ} - (hcolor:∀ i,(E.placement i).color=α) - (hE:∀ i,l≤(E.placement i).level) (hF:∀ j,l<(F.placement j).level) - (x:I→K) (hs:∀ i,(E.placement i).level≠l → x i=0) - (hx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0) : x=0 := by - have hxf:Matrix.vecMul x (e.forward.matrix.map (vertexHom Q α))=0 := by - funext j - apply Finset.sum_eq_zero - intro i hi - change x i * (e.forward.matrix i j).vertex α = 0 - by_cases hxi:x i=0 - · rw [hxi,MulZeroClass.zero_mul] - by_cases hm:(e.forward.matrix i j).vertex α=0 - · exact mul_eq_zero.mpr (Or.inr hm) - have hp: (E.placement i).level=l := Classical.not_not.mp (fun h=>hxi (hs i h)) - have he:=congrArg GeneratorPlacement.level (reduction_support Q e.forward.entries e.forward.degree i j α hm).1 - have hh:=hF j - omega - have hxh:Matrix.vecMul x (e.sourceHomotopy.map (vertexHom Q α))=0 := by - funext j - apply Finset.sum_eq_zero - intro i hi - change x i * (e.sourceHomotopy i j).vertex α = 0 - by_cases hxi:x i=0 - · rw [hxi,MulZeroClass.zero_mul] - by_cases hm:(e.sourceHomotopy i j).vertex α=0 - · exact mul_eq_zero.mpr (Or.inr hm) - have hp: (E.placement i).level=l := Classical.not_not.mp (fun h=>hxi (hs i h)) - obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q e.sourceEntries e.sourceDegree i j α hm - have hh:=hE j - dsimp only [GeneratorPlacement.level] at hp hh - omega - have hid:(projectiveIdentity Q (K:=K) E.placement).map (vertexHom Q α)=1 := by - apply Matrix.ext - intro i j - by_cases he:i=j - · subst j - simp only [Matrix.one_apply,Matrix.map_apply,projectiveIdentity,Matrix.diagonal_apply] - change (vertexId Q (K:=K) (E.placement i).color).vertex α = 1 - simp [hcolor i,vertexId_eval] - · simp [projectiveIdentity,Matrix.map_apply,he,vertexHom] - have he:=congrArg (fun M:Matrix I I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.sourceEquation - simp only [Matrix.map_mul,Matrix.map_add _ (map_add _),hid] at he - have he':=congrArg (Matrix.vecMul x) he - simp only [Matrix.vecMul_add,← Matrix.vecMul_vecMul,hxf,hx,hxh, - Matrix.zero_vecMul,Matrix.vecMul_one,add_zero] at he' - exact he'.symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Harmonic.Level +import OAI.Topology.ArtinGroups.Quivers.CornerScalar + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +theorem bottom_scalar_cycle_zero + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (e:HomotopyEquivalence Q E F) (α:V) {l:ℤ} + (hcolor:∀ i,(E.placement i).color=α) + (hE:∀ i,l≤(E.placement i).level) (hF:∀ j,l<(F.placement j).level) + (x:I→K) (hs:∀ i,(E.placement i).level≠l → x i=0) + (hx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0) : x=0 := by + have hxf:Matrix.vecMul x (e.forward.matrix.map (vertexHom Q α))=0 := by + funext j + apply Finset.sum_eq_zero + intro i hi + change x i * (e.forward.matrix i j).vertex α = 0 + by_cases hxi:x i=0 + · rw [hxi,MulZeroClass.zero_mul] + by_cases hm:(e.forward.matrix i j).vertex α=0 + · exact mul_eq_zero.mpr (Or.inr hm) + have hp: (E.placement i).level=l := Classical.not_not.mp (fun h=>hxi (hs i h)) + have he:=congrArg GeneratorPlacement.level (reduction_support Q e.forward.entries e.forward.degree i j α hm).1 + have hh:=hF j + omega + have hxh:Matrix.vecMul x (e.sourceHomotopy.map (vertexHom Q α))=0 := by + funext j + apply Finset.sum_eq_zero + intro i hi + change x i * (e.sourceHomotopy i j).vertex α = 0 + by_cases hxi:x i=0 + · rw [hxi,MulZeroClass.zero_mul] + by_cases hm:(e.sourceHomotopy i j).vertex α=0 + · exact mul_eq_zero.mpr (Or.inr hm) + have hp: (E.placement i).level=l := Classical.not_not.mp (fun h=>hxi (hs i h)) + obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q e.sourceEntries e.sourceDegree i j α hm + have hh:=hE j + dsimp only [GeneratorPlacement.level] at hp hh + omega + have hid:(projectiveIdentity Q (K:=K) E.placement).map (vertexHom Q α)=1 := by + apply Matrix.ext + intro i j + by_cases he:i=j + · subst j + simp only [Matrix.one_apply,Matrix.map_apply,projectiveIdentity,Matrix.diagonal_apply] + change (vertexId Q (K:=K) (E.placement i).color).vertex α = 1 + simp [hcolor i,vertexId_eval] + · simp [projectiveIdentity,Matrix.map_apply,he,vertexHom] + have he:=congrArg (fun M:Matrix I I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.sourceEquation + simp only [Matrix.map_mul,Matrix.map_add _ (map_add _),hid] at he + have he':=congrArg (Matrix.vecMul x) he + simp only [Matrix.vecMul_add,← Matrix.vecMul_vecMul,hxf,hx,hxh, + Matrix.zero_vecMul,Matrix.vecMul_one,add_zero] at he' + exact he'.symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZero.lean b/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZero.lean index 591317da6cd85dd72f3082a97b261a98168f1f95..d77cbc5f27c009550d71efb8b64fa75c9e26c73e 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZero.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZero.lean @@ -1,47 +1,47 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistOtherTest - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -def ClassBottomSocleZero (d:ℤ) (J:Set V) (x:FiniteHomotopyClass Q (K:=K)) : Prop := - ∀ α∈J,∀ c,classLayerSocleDimension Q d α c x=0 - -theorem classPositiveTwist_other_bottom_socle_zero - (α β:V) (hne:β≠α) (x:FiniteHomotopyClass Q (K:=K)) {d c:ℤ} - (hx:ClassLowerBound Q d x) - (hα:classLayerSocleDimension Q d α (c+1) x=0) - (hβ:classLayerSocleDimension Q d β c x=0) : - classLayerSocleDimension Q d β c (classPositiveTwist Q α x)=0 := by - let E:=minimalClassModel Q x - let y:=classPositiveTwist Q α x - let F:=minimalClassModel Q y - have he:classOfComplex Q (E.complex.positiveTwist Q α)=classOfComplex Q F.complex := by - change classPositiveTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex - have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x - have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y - rw [hE,hF] - obtain ⟨e⟩:=Quotient.exact he - apply Submodule.finrank_eq_zero.mpr - exact positiveTwist_other_bottom_socle_zero Q E.complex (minimalClassModel_minimal Q x) - F.complex (minimalClassModel_minimal Q y) hx α β hne - (Submodule.finrank_eq_zero.mp hα) (Submodule.finrank_eq_zero.mp hβ) e - -theorem classPositiveTwist_preserves_open_socle - (hn:∀ a,Q.source a≠Q.target a) (α:V) (J:Set V) (hα:α∈J) - (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) - (hJ:ClassBottomSocleZero Q d J x) : - ClassBottomSocleZero Q d J (classPositiveTwist Q α x) := by - intro β hβ c - by_cases he:β=α - · subst β - exact classPositiveTwist_bottom_socle_zero Q hn α x hx c - · exact classPositiveTwist_other_bottom_socle_zero Q α β he x hx (hJ α hα (c+1)) (hJ β hβ c) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistOtherTest + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +def ClassBottomSocleZero (d:ℤ) (J:Set V) (x:FiniteHomotopyClass Q (K:=K)) : Prop := + ∀ α∈J,∀ c,classLayerSocleDimension Q d α c x=0 + +theorem classPositiveTwist_other_bottom_socle_zero + (α β:V) (hne:β≠α) (x:FiniteHomotopyClass Q (K:=K)) {d c:ℤ} + (hx:ClassLowerBound Q d x) + (hα:classLayerSocleDimension Q d α (c+1) x=0) + (hβ:classLayerSocleDimension Q d β c x=0) : + classLayerSocleDimension Q d β c (classPositiveTwist Q α x)=0 := by + let E:=minimalClassModel Q x + let y:=classPositiveTwist Q α x + let F:=minimalClassModel Q y + have he:classOfComplex Q (E.complex.positiveTwist Q α)=classOfComplex Q F.complex := by + change classPositiveTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex + have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x + have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y + rw [hE,hF] + obtain ⟨e⟩:=Quotient.exact he + apply Submodule.finrank_eq_zero.mpr + exact positiveTwist_other_bottom_socle_zero Q E.complex (minimalClassModel_minimal Q x) + F.complex (minimalClassModel_minimal Q y) hx α β hne + (Submodule.finrank_eq_zero.mp hα) (Submodule.finrank_eq_zero.mp hβ) e + +theorem classPositiveTwist_preserves_open_socle + (hn:∀ a,Q.source a≠Q.target a) (α:V) (J:Set V) (hα:α∈J) + (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) + (hJ:ClassBottomSocleZero Q d J x) : + ClassBottomSocleZero Q d J (classPositiveTwist Q α x) := by + intro β hβ c + by_cases he:β=α + · subst β + exact classPositiveTwist_bottom_socle_zero Q hn α x hx c + · exact classPositiveTwist_other_bottom_socle_zero Q α β he x hx (hJ α hα (c+1)) (hJ β hβ c) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZeroTest.lean b/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZeroTest.lean index bc5beeebe9ca116fe7b852f5b43dd6f0d000d71d..adfce910a07e9d2d4003f590b60f11df6578de29 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZeroTest.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/BottomSocleZeroTest.lean @@ -1,61 +1,61 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.LayerVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -omit [DecidableEq I] in -theorem bottomSocle_zero_of_test_cycle_zero - (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d c:ℤ} - (hfloor:∀ i,d≤(E.placement i).level) (α:V) - (hzero:∀ y:TestIndex Q E.placement α→K, - (∀ i,¬ (((E.testComplex Q α).placement i).level=d ∧ - ((E.testComplex Q α).placement i).cochain=c)→y i=0)→ - Matrix.vecMul y ((E.testComplex Q α).differential.map (vertexHom Q α))=0→y=0) : - coefficientSocle Q (E.pureLayer Q hE d) α c=⊥ := by - classical - apply le_antisymm _ bot_le - intro x hx - change x=0 - let y:=layerVector Q E d x - have hy:y∈coefficientSocle Q E α c:=layerVector_socle Q E hE d α c hx - have hs:∀ i,(E.placement i).level≠d→y i=0:=layerVector_support Q E d x - have hts:∀ i,¬ (((E.testComplex Q α).placement i).level=d ∧ - ((E.testComplex Q α).placement i).cochain=c)→ - unitTestVector Q E.placement α y i=0 := by - intro i hi - change y i.1 * pathCoordinates Q (vertexId Q α) i.2.val=0 - by_cases hp:Sum.inl α=i.2.val - · rw [vertex_coordinates,ite_eq_left hp,_root_.mul_one] - by_cases hl:(E.placement i.1).level=d - · apply hy.1 - right - intro hc - apply hi - constructor - · change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=d - rw [← hp] - simpa [Path.length,GeneratorPlacement.level] using hl - · exact hc - · exact hs i.1 hl - · rw [vertex_coordinates,ite_eq_right hp,MulZeroClass.mul_zero] - have hz:=hzero (unitTestVector Q E.placement α y) hts - (unitTestVector_bottom_cycle Q E hE d hfloor α c hy hs) - have hy0:y=0 := by - have hh:=congrArg (sumUnitTest Q E.placement α) hz - rw [sumUnitTest_unit Q E.placement α y (fun i h=>hy.1 i (Or.inl h)),map_zero] at hh - exact hh - funext i - have hh:=congrFun hy0 i.val - change (if h:(E.placement i.val).level=d then x ⟨i.val,h⟩ else 0)=0 at hh - split_ifs at hh with hi - · exact hh - · exact (hi i.property).elim - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.LayerVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +omit [DecidableEq I] in +theorem bottomSocle_zero_of_test_cycle_zero + (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d c:ℤ} + (hfloor:∀ i,d≤(E.placement i).level) (α:V) + (hzero:∀ y:TestIndex Q E.placement α→K, + (∀ i,¬ (((E.testComplex Q α).placement i).level=d ∧ + ((E.testComplex Q α).placement i).cochain=c)→y i=0)→ + Matrix.vecMul y ((E.testComplex Q α).differential.map (vertexHom Q α))=0→y=0) : + coefficientSocle Q (E.pureLayer Q hE d) α c=⊥ := by + classical + apply le_antisymm _ bot_le + intro x hx + change x=0 + let y:=layerVector Q E d x + have hy:y∈coefficientSocle Q E α c:=layerVector_socle Q E hE d α c hx + have hs:∀ i,(E.placement i).level≠d→y i=0:=layerVector_support Q E d x + have hts:∀ i,¬ (((E.testComplex Q α).placement i).level=d ∧ + ((E.testComplex Q α).placement i).cochain=c)→ + unitTestVector Q E.placement α y i=0 := by + intro i hi + change y i.1 * pathCoordinates Q (vertexId Q α) i.2.val=0 + by_cases hp:Sum.inl α=i.2.val + · rw [vertex_coordinates,ite_eq_left hp,_root_.mul_one] + by_cases hl:(E.placement i.1).level=d + · apply hy.1 + right + intro hc + apply hi + constructor + · change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=d + rw [← hp] + simpa [Path.length,GeneratorPlacement.level] using hl + · exact hc + · exact hs i.1 hl + · rw [vertex_coordinates,ite_eq_right hp,MulZeroClass.mul_zero] + have hz:=hzero (unitTestVector Q E.placement α y) hts + (unitTestVector_bottom_cycle Q E hE d hfloor α c hy hs) + have hy0:y=0 := by + have hh:=congrArg (sumUnitTest Q E.placement α) hz + rw [sumUnitTest_unit Q E.placement α y (fun i h=>hy.1 i (Or.inl h)),map_zero] at hh + exact hh + funext i + have hh:=congrFun hy0 i.val + change (if h:(E.placement i.val).level=d then x ⟨i.val,h⟩ else 0)=0 at hh + split_ifs at hh with hi + · exact hh + · exact (hi i.property).elim + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalLowReflectedHigh.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalLowReflectedHigh.lean index 336a084c56de7ab212fdaaa6db8456c107cec01e..b25db2f1fa364a7aaebafdd19cffc062b9f9d73e 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalLowReflectedHigh.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalLowReflectedHigh.lean @@ -1,33 +1,33 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TotalVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -theorem canonicalLow_reflected_high (hn:∀ a,Q.source a≠Q.target a) - (w:List V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) - (hlo:ClassLowerBound Q q x) (hhi:ClassUpperBound Q q x) - (hl:ClassLowerBound Q q (canonicalWordLow Q w q x)) - (hh:ClassUpperBound Q q (canonicalWordLow Q w q x)) : - classTotalVector Q (classLayer Q q (inverseWordAction Q w x))= - rowReflectWord (unfoldedCartan Q) w.reverse - (classTotalVector Q x-classTotalVector Q (canonicalWordLow Q w q x)) := by - have h:=canonicalLow_reflected_high_signed Q hn w q x hhi - have lower : ClassLowerBound Q q (classLayer Q q (inverseWordAction Q w x)) := - classLowerBound_of_representative Q _ (fun index => le_of_eq index.property.symm) - have upper : ClassUpperBound Q q (classLayer Q q (inverseWordAction Q w x)) := - classUpperBound_of_representative Q _ (fun index => le_of_eq index.property) - rw [classSignedVector_pure Q _ q lower upper, - classSignedVector_pure Q x q hlo hhi,classSignedVector_pure Q _ q hl hh, - ← smul_sub,rowReflectWord_smul] at h - have h':=congrArg (fun z:V→ℝ=>cochainSign (K:=ℝ) q • z) h - simpa only [smul_smul,cochainSign_mul_self,one_smul] using h' - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TotalVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +theorem canonicalLow_reflected_high (hn:∀ a,Q.source a≠Q.target a) + (w:List V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) + (hlo:ClassLowerBound Q q x) (hhi:ClassUpperBound Q q x) + (hl:ClassLowerBound Q q (canonicalWordLow Q w q x)) + (hh:ClassUpperBound Q q (canonicalWordLow Q w q x)) : + classTotalVector Q (classLayer Q q (inverseWordAction Q w x))= + rowReflectWord (unfoldedCartan Q) w.reverse + (classTotalVector Q x-classTotalVector Q (canonicalWordLow Q w q x)) := by + have h:=canonicalLow_reflected_high_signed Q hn w q x hhi + have lower : ClassLowerBound Q q (classLayer Q q (inverseWordAction Q w x)) := + classLowerBound_of_representative Q _ (fun index => le_of_eq index.property.symm) + have upper : ClassUpperBound Q q (classLayer Q q (inverseWordAction Q w x)) := + classUpperBound_of_representative Q _ (fun index => le_of_eq index.property) + rw [classSignedVector_pure Q _ q lower upper, + classSignedVector_pure Q x q hlo hhi,classSignedVector_pure Q _ q hl hh, + ← smul_sub,rowReflectWord_smul] at h + have h':=congrArg (fun z:V→ℝ=>cochainSign (K:=ℝ) q • z) h + simpa only [smul_smul,cochainSign_mul_self,one_smul] using h' + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalWordLow.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalWordLow.lean index b2414a2a129daded86c60802e89183da73fab92e..bf31adad98fd61063d330d3174c3cef8abc65612 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalWordLow.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CanonicalWordLow.lean @@ -1,68 +1,68 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseWordAction -import OAI.Topology.ArtinGroups.Complexes.TargetLow - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def canonicalWordLow (w:List V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : - FiniteHomotopyClass Q (K:=K) := - positiveWordAction Q w (classLowerTruncation Q (q-1) (inverseWordAction Q w x)) - -lemma canonicalWordLow_floor (hn:∀ a,Q.source a≠Q.target a) - (w:List V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) - (hx:ClassLowerBound Q q x) : ClassLowerBound Q q (canonicalWordLow Q w q x) := by - apply classLowerBound_of_placed_vanishing Q _ q - intro p hp - let P:=classOfComplex Q (placedProjective Q (K:=K) p) - let R:=inverseWordAction Q w P - let N:=inverseWordAction Q w x - have hP:ClassUpperBound Q p.level P:= - classUpperBound_of_representative Q _ (fun _=>le_rfl) - have hR:ClassUpperBound Q ((q-1)+1) R := by - have hb:=inverseWord_upper_bound Q w P hP - intro i - exact le_trans (hb i) (by omega) - have hz:classHomDimension Q 0 0 R N=0 := by - rw [← positiveWord_homDimension Q hn w R N 0 0] - change classHomDimension Q 0 0 - (positiveWordAction Q w (inverseWordAction Q w P)) - (positiveWordAction Q w (inverseWordAction Q w x))=0 - rw [positive_inverseWord Q hn,positive_inverseWord Q hn] - exact classHomDimension_zero_of_layer_gap Q P x p.level q hP hx hp - have ht:=classLowerTruncation_homDimension_zero Q R N (q-1) hR hz - have ht':classHomDimension Q 0 0 (positiveWordAction Q w R) - (positiveWordAction Q w (classLowerTruncation Q (q-1) N))=0 := by - rw [positiveWord_homDimension Q hn] - exact ht - change classHomDimension Q 0 0 P (canonicalWordLow Q w q x)=0 - simpa only [R,N,positive_inverseWord Q hn,canonicalWordLow] using ht' - -theorem canonicalReducedWordLow_pure (hn:∀ a,Q.source a≠Q.target a) - (U:Set V) - (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) - (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) - (hlo:ClassLowerBound Q q x) (hhi:ClassUpperBound Q q x) - (w:List V) (hw:∀ s∈w,s∈U) - (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : - ClassLowerBound Q q (canonicalWordLow Q w q x) ∧ - ClassUpperBound Q q (canonicalWordLow Q w q x) := by - refine ⟨canonicalWordLow_floor Q hn w q x hlo,?_⟩ - have hN:ClassLowerBound Q (q-1) (inverseWordAction Q w x):= - (inverseReducedWord_layer_bounds Q hn U hU x q q hlo hhi w hw hr).1 - have hlow:=classLowerTruncation_floor Q (q-1) (q-1) (inverseWordAction Q w x) hN - have hcap:=classLowerTruncation_cap Q (q-1) (inverseWordAction Q w x) - have h:= (reducedWord_layer_bounds Q hn U hU - (classLowerTruncation Q (q-1) (inverseWordAction Q w x)) (q-1) (q-1) - hlow hcap w hw hr).2 - have he:q-1+1=q:=by omega - rw [he] at h - exact h - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseWordAction +import OAI.Topology.ArtinGroups.Complexes.TargetLow + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def canonicalWordLow (w:List V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : + FiniteHomotopyClass Q (K:=K) := + positiveWordAction Q w (classLowerTruncation Q (q-1) (inverseWordAction Q w x)) + +lemma canonicalWordLow_floor (hn:∀ a,Q.source a≠Q.target a) + (w:List V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) + (hx:ClassLowerBound Q q x) : ClassLowerBound Q q (canonicalWordLow Q w q x) := by + apply classLowerBound_of_placed_vanishing Q _ q + intro p hp + let P:=classOfComplex Q (placedProjective Q (K:=K) p) + let R:=inverseWordAction Q w P + let N:=inverseWordAction Q w x + have hP:ClassUpperBound Q p.level P:= + classUpperBound_of_representative Q _ (fun _=>le_rfl) + have hR:ClassUpperBound Q ((q-1)+1) R := by + have hb:=inverseWord_upper_bound Q w P hP + intro i + exact le_trans (hb i) (by omega) + have hz:classHomDimension Q 0 0 R N=0 := by + rw [← positiveWord_homDimension Q hn w R N 0 0] + change classHomDimension Q 0 0 + (positiveWordAction Q w (inverseWordAction Q w P)) + (positiveWordAction Q w (inverseWordAction Q w x))=0 + rw [positive_inverseWord Q hn,positive_inverseWord Q hn] + exact classHomDimension_zero_of_layer_gap Q P x p.level q hP hx hp + have ht:=classLowerTruncation_homDimension_zero Q R N (q-1) hR hz + have ht':classHomDimension Q 0 0 (positiveWordAction Q w R) + (positiveWordAction Q w (classLowerTruncation Q (q-1) N))=0 := by + rw [positiveWord_homDimension Q hn] + exact ht + change classHomDimension Q 0 0 P (canonicalWordLow Q w q x)=0 + simpa only [R,N,positive_inverseWord Q hn,canonicalWordLow] using ht' + +theorem canonicalReducedWordLow_pure (hn:∀ a,Q.source a≠Q.target a) + (U:Set V) + (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) + (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) + (hlo:ClassLowerBound Q q x) (hhi:ClassUpperBound Q q x) + (w:List V) (hw:∀ s∈w,s∈U) + (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : + ClassLowerBound Q q (canonicalWordLow Q w q x) ∧ + ClassUpperBound Q q (canonicalWordLow Q w q x) := by + refine ⟨canonicalWordLow_floor Q hn w q x hlo,?_⟩ + have hN:ClassLowerBound Q (q-1) (inverseWordAction Q w x):= + (inverseReducedWord_layer_bounds Q hn U hU x q q hlo hhi w hw hr).1 + have hlow:=classLowerTruncation_floor Q (q-1) (q-1) (inverseWordAction Q w x) hN + have hcap:=classLowerTruncation_cap Q (q-1) (inverseWordAction Q w x) + have h:= (reducedWord_layer_bounds Q hn U hU + (classLowerTruncation Q (q-1) (inverseWordAction Q w x)) (q-1) (q-1) + hlow hcap w hw hr).2 + have he:q-1+1=q:=by omega + rw [he] at h + exact h + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Capped.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Capped.lean index 14accf7874de5742efb1a75e259553595655ed59..40c655ef36ca97498cf5eb16efd77d27817d7a48 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Capped.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Capped.lean @@ -1,148 +1,148 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.RestrictLayer -import OAI.Topology.ArtinGroups.Quivers.PathTwoSelf - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J : Type*} - -lemma degree_token_support {p : I → GeneratorPlacement V} - {q : J → GeneratorPlacement V} {M : Matrix I J (Q.Zigzag K)} - {n v : ℤ} (hc : ProjectiveEntries Q p q M) (hd : MapDegree Q p q n v M) - (i : I) (j : J) (w : V) (hne : (M i j).token w ≠ 0) : - (p i).color = w ∧ (q j).color = w ∧ - (q j).cochain = (p i).cochain + n ∧ - (q j).internal = (p i).internal + v - 2 := by - have hleft := congrArg (fun x : Q.Zigzag K => x.token w) (hc.1 i j) - have hright := congrArg (fun x : Q.Zigzag K => x.token w) (hc.2 i j) - have hpv : (p i).color = w := by - by_contra h - have hh : w ≠ (p i).color := Ne.symm h - change (vertexId Q (p i).color * M i j).token w = (M i j).token w at hleft - rw [token_mul] at hleft - simp only [token_vertexId, arrow_vertexId, MulZeroClass.zero_mul, - backtrack_zero_left, Pi.add_apply, Pi.zero_apply, add_zero] at hleft - change (vertexId Q (p i).color).vertex w * (M i j).token w = _ at hleft - rw [vertexId_eval, ite_eq_right hh, MulZeroClass.zero_mul] at hleft - exact hne hleft.symm - have hqv : (q j).color = w := by - by_contra h - have hh : w ≠ (q j).color := Ne.symm h - change (M i j * vertexId Q (q j).color).token w = (M i j).token w at hright - rw [token_mul] at hright - simp only [token_vertexId, arrow_vertexId, MulZeroClass.mul_zero, - backtrack_zero_right, Pi.add_apply, Pi.zero_apply, zero_add, add_zero] at hright - change (M i j).token w * (vertexId Q (q j).color).vertex w = _ at hright - rw [vertexId_eval, ite_eq_right hh, MulZeroClass.mul_zero] at hright - exact hne hright.symm - have hcq : (q j).cochain = (p i).cochain + n := by - by_contra h - have hz := (hd i j).1 h - exact hne (by rw [hz]; rfl) - have hiq : (q j).internal = (p i).internal + v - 2 := by - by_contra h - have hh : v + (p i).internal - (q j).internal ≠ 2 := by omega - have hz := (hd i j).2.2.2 hh - exact hne (by rw [hz]; rfl) - exact ⟨hpv, hqv, hcq, hiq⟩ - -namespace BasedComplex -variable [Fintype I] [Fintype J] - -def CappedOn (E : BasedComplex Q (K := K) I) (U : Set V) (q : ℤ) : Prop := - ∀ i, (E.placement i).color ∈ U → (E.placement i).level ≤ q - -lemma differential_token_level (E : BasedComplex Q (K := K) I) {i j : I} - (h : (E.placement j).level ≠ (E.placement i).level - 1) : - (E.differential i j).token = 0 := by - by_cases hc : (E.placement j).cochain = (E.placement i).cochain + 1 - · apply (E.degree i j).2.2.2 - dsimp only [GeneratorPlacement.level] at h - omega - · rw [(E.degree i j).1 hc] - rfl - -lemma capped_incoming_token (E : BasedComplex Q (K := K) I) (U : Set V) (q : ℤ) - (hcap : E.CappedOn Q U q) (j : I) (hj : (E.placement j).level = q) - (hU : (E.placement j).color ∈ U) (i : I) : - pathTwo Q (E.differential i j) = 0 := by - apply pathTwo_eq_zero Q - ext w - by_contra hw - obtain ⟨hi, hjc, hc, hu⟩ := degree_token_support Q E.entries E.degree i j w hw - have h : (E.placement i).color ∈ U := by simpa only [hi, hjc] using hU - have hb := hcap i h - dsimp only [GeneratorPlacement.level] at hb hj - omega - -lemma extendLayer_coefficient (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (l k : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hf : CoefficientMatrix Q f) : CoefficientMatrix Q (extendLayer Q E F l k f) := by - intro i j - simp only [extendLayer_entry] - split_ifs with hi hj - · exact hf ⟨i, hi⟩ ⟨j, hj⟩ - · exact ⟨rfl, rfl⟩ - · exact ⟨rfl, rfl⟩ - -lemma capped_matrixTwo_mul_extend (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (U : Set V) (q d : ℤ) - (hcap : E.CappedOn Q U q) - {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} - (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) : - matrixTwo Q E.differential * extendLayer Q E F q d f = 0 := by - classical - apply Matrix.ext - intro i j - rw [Matrix.mul_apply] - apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry] - split_ifs with ht hj - · by_cases hU : (E.placement t).color ∈ U - · change pathTwo Q (E.differential i t) * f ⟨t, ht⟩ ⟨j, hj⟩ = 0 - rw [capped_incoming_token Q E U q hcap t ht hU i, MulZeroClass.zero_mul] - · rw [hs ⟨t, ht⟩ ⟨j, hj⟩ hU, MulZeroClass.mul_zero] - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - -lemma extend_restrictLayer (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (l k : ℤ) {f : Matrix I J (Q.Zigzag K)} - (hs : ∀ i j, (E.placement i).level ≠ l ∨ (F.placement j).level ≠ k → f i j = 0) : - extendLayer Q E F l k (restrictLayer Q E F l k f) = f := by - apply Matrix.ext - intro i j - rw [extendLayer_entry] - split_ifs with hi hj - · rfl - · exact (hs i j (Or.inr hj)).symm - · exact (hs i j (Or.inl hi)).symm - -lemma extend_mul_matrixTwo_support (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (q d : ℤ) - (f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)) - (i : I) (j : J) (h : (E.placement i).level ≠ q ∨ (F.placement j).level ≠ d-1) : - (extendLayer Q E F q d f * matrixTwo Q F.differential) i j = 0 := by - classical - rw [Matrix.mul_apply] - apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry] - split_ifs with hi ht - · have hj : (F.placement j).level ≠ (F.placement t).level - 1 := by - rcases h with hh | hh - · exact (hh hi).elim - · simpa only [ht] using hh - change f ⟨i, hi⟩ ⟨t, ht⟩ * pathTwo Q (F.differential t j) = 0 - rw [pathTwo_eq_zero Q (differential_token_level Q F hj), MulZeroClass.mul_zero] - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.RestrictLayer +import OAI.Topology.ArtinGroups.Quivers.PathTwoSelf + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J : Type*} + +lemma degree_token_support {p : I → GeneratorPlacement V} + {q : J → GeneratorPlacement V} {M : Matrix I J (Q.Zigzag K)} + {n v : ℤ} (hc : ProjectiveEntries Q p q M) (hd : MapDegree Q p q n v M) + (i : I) (j : J) (w : V) (hne : (M i j).token w ≠ 0) : + (p i).color = w ∧ (q j).color = w ∧ + (q j).cochain = (p i).cochain + n ∧ + (q j).internal = (p i).internal + v - 2 := by + have hleft := congrArg (fun x : Q.Zigzag K => x.token w) (hc.1 i j) + have hright := congrArg (fun x : Q.Zigzag K => x.token w) (hc.2 i j) + have hpv : (p i).color = w := by + by_contra h + have hh : w ≠ (p i).color := Ne.symm h + change (vertexId Q (p i).color * M i j).token w = (M i j).token w at hleft + rw [token_mul] at hleft + simp only [token_vertexId, arrow_vertexId, MulZeroClass.zero_mul, + backtrack_zero_left, Pi.add_apply, Pi.zero_apply, add_zero] at hleft + change (vertexId Q (p i).color).vertex w * (M i j).token w = _ at hleft + rw [vertexId_eval, ite_eq_right hh, MulZeroClass.zero_mul] at hleft + exact hne hleft.symm + have hqv : (q j).color = w := by + by_contra h + have hh : w ≠ (q j).color := Ne.symm h + change (M i j * vertexId Q (q j).color).token w = (M i j).token w at hright + rw [token_mul] at hright + simp only [token_vertexId, arrow_vertexId, MulZeroClass.mul_zero, + backtrack_zero_right, Pi.add_apply, Pi.zero_apply, zero_add, add_zero] at hright + change (M i j).token w * (vertexId Q (q j).color).vertex w = _ at hright + rw [vertexId_eval, ite_eq_right hh, MulZeroClass.mul_zero] at hright + exact hne hright.symm + have hcq : (q j).cochain = (p i).cochain + n := by + by_contra h + have hz := (hd i j).1 h + exact hne (by rw [hz]; rfl) + have hiq : (q j).internal = (p i).internal + v - 2 := by + by_contra h + have hh : v + (p i).internal - (q j).internal ≠ 2 := by omega + have hz := (hd i j).2.2.2 hh + exact hne (by rw [hz]; rfl) + exact ⟨hpv, hqv, hcq, hiq⟩ + +namespace BasedComplex +variable [Fintype I] [Fintype J] + +def CappedOn (E : BasedComplex Q (K := K) I) (U : Set V) (q : ℤ) : Prop := + ∀ i, (E.placement i).color ∈ U → (E.placement i).level ≤ q + +lemma differential_token_level (E : BasedComplex Q (K := K) I) {i j : I} + (h : (E.placement j).level ≠ (E.placement i).level - 1) : + (E.differential i j).token = 0 := by + by_cases hc : (E.placement j).cochain = (E.placement i).cochain + 1 + · apply (E.degree i j).2.2.2 + dsimp only [GeneratorPlacement.level] at h + omega + · rw [(E.degree i j).1 hc] + rfl + +lemma capped_incoming_token (E : BasedComplex Q (K := K) I) (U : Set V) (q : ℤ) + (hcap : E.CappedOn Q U q) (j : I) (hj : (E.placement j).level = q) + (hU : (E.placement j).color ∈ U) (i : I) : + pathTwo Q (E.differential i j) = 0 := by + apply pathTwo_eq_zero Q + ext w + by_contra hw + obtain ⟨hi, hjc, hc, hu⟩ := degree_token_support Q E.entries E.degree i j w hw + have h : (E.placement i).color ∈ U := by simpa only [hi, hjc] using hU + have hb := hcap i h + dsimp only [GeneratorPlacement.level] at hb hj + omega + +lemma extendLayer_coefficient (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (l k : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hf : CoefficientMatrix Q f) : CoefficientMatrix Q (extendLayer Q E F l k f) := by + intro i j + simp only [extendLayer_entry] + split_ifs with hi hj + · exact hf ⟨i, hi⟩ ⟨j, hj⟩ + · exact ⟨rfl, rfl⟩ + · exact ⟨rfl, rfl⟩ + +lemma capped_matrixTwo_mul_extend (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (U : Set V) (q d : ℤ) + (hcap : E.CappedOn Q U q) + {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} + (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) : + matrixTwo Q E.differential * extendLayer Q E F q d f = 0 := by + classical + apply Matrix.ext + intro i j + rw [Matrix.mul_apply] + apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry] + split_ifs with ht hj + · by_cases hU : (E.placement t).color ∈ U + · change pathTwo Q (E.differential i t) * f ⟨t, ht⟩ ⟨j, hj⟩ = 0 + rw [capped_incoming_token Q E U q hcap t ht hU i, MulZeroClass.zero_mul] + · rw [hs ⟨t, ht⟩ ⟨j, hj⟩ hU, MulZeroClass.mul_zero] + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + +lemma extend_restrictLayer (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (l k : ℤ) {f : Matrix I J (Q.Zigzag K)} + (hs : ∀ i j, (E.placement i).level ≠ l ∨ (F.placement j).level ≠ k → f i j = 0) : + extendLayer Q E F l k (restrictLayer Q E F l k f) = f := by + apply Matrix.ext + intro i j + rw [extendLayer_entry] + split_ifs with hi hj + · rfl + · exact (hs i j (Or.inr hj)).symm + · exact (hs i j (Or.inl hi)).symm + +lemma extend_mul_matrixTwo_support (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (q d : ℤ) + (f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)) + (i : I) (j : J) (h : (E.placement i).level ≠ q ∨ (F.placement j).level ≠ d-1) : + (extendLayer Q E F q d f * matrixTwo Q F.differential) i j = 0 := by + classical + rw [Matrix.mul_apply] + apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry] + split_ifs with hi ht + · have hj : (F.placement j).level ≠ (F.placement t).level - 1 := by + rcases h with hh | hh + · exact (hh hi).elim + · simpa only [ht] using hh + change f ⟨i, hi⟩ ⟨t, ht⟩ * pathTwo Q (F.differential t j) = 0 + rw [pathTwo_eq_zero Q (differential_token_level Q F hj), MulZeroClass.mul_zero] + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CochainSignSubOne.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CochainSignSubOne.lean index 36efdc3aded6ab003ecf319a58a1901e1a0745d7..a680bcea07cee1bb9f991a8ce67bb6ac9b2c8a56 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CochainSignSubOne.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CochainSignSubOne.lean @@ -1,175 +1,175 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.GeneratorVector -import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel -import OAI.Topology.ArtinGroups.Harmonic.RowReflect -import OAI.Topology.ArtinGroups.Complexes.PlacementSignedWeight - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -open Matrix -open scoped BigOperators - -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -lemma cochainSign_sub_one (n : ℤ) : cochainSign (K:=ℝ) (n-1)= -cochainSign n := by - have h:=cochainSign_add_one (K:=ℝ) (n-1) - rw [sub_add_cancel] at h - linarith - -lemma cochainSign_sub_two (n : ℤ) : cochainSign (K:=ℝ) (n-2)=cochainSign n := by - rw [show n-2=(n-1)-1 by omega,cochainSign_sub_one,cochainSign_sub_one,neg_neg] - -omit [DecidableEq A] in -lemma signedCorner_sum (α β : V) : - (∑ p : Zigzag.CornerPath Q α β, cochainSign (K:=ℝ) (Path.length p.val))= - unfoldedCartan Q α β := by - have hs := Finset.sum_subtype (p:=fun p : Path V A => Path.source Q p=α ∧ Path.target Q p=β) (F:=inferInstance) - ((Finset.univ : Finset (Path V A)).filter (fun p => Path.source Q p=α ∧ Path.target Q p=β)) - (by intro p; simp) (fun p => cochainSign (K:=ℝ) (Path.length p)) - rw [← hs,Finset.sum_filter] - simp only [Fintype.sum_sum_type,Path.source,Path.target,Path.length] - simp [cochainSign,unfoldedCartan,Nat.card_eq_fintype_card,Fintype.card_subtype, - ← Finset.sum_boole,eq_comm] - have hv : (∑ x : V, if α=x ∧ β=x then (1:ℝ) else 0)=if α=β then 1 else 0 := by - simp [ite_and, eq_comm] - have ha : (∑ x : A, if α=Q.source x ∧ β=Q.target x then (-1:ℝ) else 0)= - -(∑ x : A, if α=Q.source x ∧ β=Q.target x then (1:ℝ) else 0) := by - rw [← Finset.sum_neg_distrib] - apply Finset.sum_congr rfl - intro a _ - split_ifs <;> ring - rw [hv,ha] - split_ifs <;> ring - -omit [DecidableEq A] in -lemma signedGeneratorVector_mulVec {I : Type u} [Fintype I] - (E : BasedComplex Q (K:=K) I) (α : V) : - (unfoldedCartan Q *ᵥ signedGeneratorVector Q E) α= - ∑ i, cochainSign (K:=ℝ) (E.placement i).level * unfoldedCartan Q α (E.placement i).color := by - simp only [Matrix.mulVec,dotProduct,signedGeneratorVector,Finset.mul_sum] - rw [Finset.sum_comm] - apply Finset.sum_congr rfl - intro i _ - simp [placementSignedWeight,mul_comm] - -lemma signedGeneratorVector_test {I : Type u} [Fintype I] [DecidableEq I] - (E : BasedComplex Q (K:=K) I) (α β : V) : - signedGeneratorVector Q (E.testComplex Q α) β= - if α=β then (unfoldedCartan Q *ᵥ signedGeneratorVector Q E) α else 0 := by - by_cases h : α=β - · subst β - rw [ite_eq_left rfl,signedGeneratorVector_mulVec] - change (∑ t : TestIndex Q E.placement α, - if α=α then cochainSign (K:=ℝ) ((E.placement t.1).cochain+ - ((E.placement t.1).internal+Path.length t.2.val)) else 0)=_ - simp only [ite_true,Fintype.sum_sigma] - apply Finset.sum_congr rfl - intro i _ - have hlev (p : Zigzag.CornerPath Q α (E.placement i).color) : - (E.placement i).cochain+((E.placement i).internal+Path.length p.val)= - (E.placement i).level+Path.length p.val := by - simp only [GeneratorPlacement.level]; ring - simp_rw [hlev,cochainSign_add] - rw [← Finset.mul_sum,signedCorner_sum] - - · simp [signedGeneratorVector,placementSignedWeight,testComplex,testPlacement,h] - -omit [Fintype V] in -lemma placementSignedWeight_lower (a : GeneratorPlacement V) (v : V) : - placementSignedWeight ⟨a.color,a.cochain-1,a.internal⟩ v= -placementSignedWeight a v := by - have hh : a.cochain-1+a.internal=a.level-1 := by dsimp [GeneratorPlacement.level]; omega - simp only [placementSignedWeight,GeneratorPlacement.level,hh,cochainSign_sub_one] - split_ifs <;> simp - -omit [DecidableEq A] [Fintype V] in -lemma Map.signedGeneratorVector_cone {I J : Type u} [Fintype I] [Fintype J] - {E : BasedComplex Q (K:=K) I} {F : BasedComplex Q (K:=K) J} (f : Map Q E F) : - signedGeneratorVector Q (f.cone Q)=signedGeneratorVector Q F-signedGeneratorVector Q E := by - funext v - simp only [signedGeneratorVector,Map.cone,Map.conePlacement,Fintype.sum_sum_type, - placementSignedWeight_lower,Finset.sum_neg_distrib,Pi.sub_apply] - ring - -theorem signedGeneratorVector_positiveTwist {I : Type u} [Fintype I] [DecidableEq I] - (E : BasedComplex Q (K:=K) I) (α : V) : - signedGeneratorVector Q (E.positiveTwist Q α)=rowReflect (unfoldedCartan Q) α - (signedGeneratorVector Q E) := by - unfold positiveTwist - rw [Map.signedGeneratorVector_cone] - funext β - simp only [Pi.sub_apply,signedGeneratorVector_test,rowReflect,Pi.smul_apply,smul_eq_mul, - Pi.single_apply] - by_cases h : α=β - · subst β; simp - · simp [h,Ne.symm h] - -lemma classSignedVector_positiveTwist (x : FiniteHomotopyClass Q (K:=K)) (α : V) : - classSignedVector Q (classPositiveTwist Q α x)= - rowReflect (unfoldedCartan Q) α (classSignedVector Q x) := by - induction x using Quotient.inductionOn with | _ E => - exact signedGeneratorVector_positiveTwist Q E.complex α - -omit [Fintype V] in -lemma placementSignedWeight_raise (a : GeneratorPlacement V) (v : V) : - placementSignedWeight ⟨a.color,a.cochain+1,a.internal⟩ v= -placementSignedWeight a v := by - have hh : a.cochain+1+a.internal=a.level+1 := by dsimp [GeneratorPlacement.level]; omega - simp only [placementSignedWeight,GeneratorPlacement.level,hh,cochainSign_add_one] - split_ifs <;> simp - -omit [DecidableEq A] [Fintype V] in -lemma Map.signedGeneratorVector_cocone {I J : Type u} [Fintype I] [Fintype J] - {E : BasedComplex Q (K:=K) I} {F : BasedComplex Q (K:=K) J} (f : Map Q E F) : - signedGeneratorVector Q (f.cocone Q)=signedGeneratorVector Q E-signedGeneratorVector Q F := by - funext v - simp only [signedGeneratorVector,Map.cocone,Map.coconePlacement,Fintype.sum_sum_type, - placementSignedWeight_raise,Finset.sum_neg_distrib,Pi.sub_apply] - ring - -lemma signedGeneratorVector_cotest {I : Type u} [Fintype I] [DecidableEq I] - (E : BasedComplex Q (K:=K) I) (α : V) : - signedGeneratorVector Q (E.cotestComplex Q α)=signedGeneratorVector Q (E.testComplex Q α) := by - funext β - apply Finset.sum_congr rfl - intro t _ - change (if α=β then cochainSign (K:=ℝ) ((E.placement t.1).cochain+ - ((E.placement t.1).internal+Path.length t.2.val-2)) else 0)= - (if α=β then cochainSign (K:=ℝ) ((E.placement t.1).cochain+ - ((E.placement t.1).internal+Path.length t.2.val)) else 0) - rw [← add_sub_assoc,cochainSign_sub_two] - -theorem signedGeneratorVector_negativeTwist {I : Type u} [Fintype I] [DecidableEq I] - (E : BasedComplex Q (K:=K) I) (α : V) : - signedGeneratorVector Q (E.negativeTwist Q α)=rowReflect (unfoldedCartan Q) α - (signedGeneratorVector Q E) := by - unfold negativeTwist - rw [Map.signedGeneratorVector_cocone,signedGeneratorVector_cotest] - funext β - simp only [Pi.sub_apply,signedGeneratorVector_test,rowReflect,Pi.smul_apply,smul_eq_mul, - Pi.single_apply] - by_cases h : α=β - · subst β; simp - · simp [h,Ne.symm h] - -lemma classSignedVector_negativeTwist (x : FiniteHomotopyClass Q (K:=K)) (α : V) : - classSignedVector Q (classNegativeTwist Q α x)= - rowReflect (unfoldedCartan Q) α (classSignedVector Q x) := by - induction x using Quotient.inductionOn with | _ E => - exact signedGeneratorVector_negativeTwist Q E.complex α - -lemma classSignedVector_positiveWord (w : List V) (x : FiniteHomotopyClass Q (K:=K)) : - classSignedVector Q (positiveWordAction Q w x)= - rowReflectWord (unfoldedCartan Q) w (classSignedVector Q x) := by - induction w with - | nil => rfl - | cons α w ih => - change classSignedVector Q (classPositiveTwist Q α (positiveWordAction Q w x))=_ - rw [classSignedVector_positiveTwist,ih] - rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.GeneratorVector +import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel +import OAI.Topology.ArtinGroups.Harmonic.RowReflect +import OAI.Topology.ArtinGroups.Complexes.PlacementSignedWeight + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +open Matrix +open scoped BigOperators + +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +lemma cochainSign_sub_one (n : ℤ) : cochainSign (K:=ℝ) (n-1)= -cochainSign n := by + have h:=cochainSign_add_one (K:=ℝ) (n-1) + rw [sub_add_cancel] at h + linarith + +lemma cochainSign_sub_two (n : ℤ) : cochainSign (K:=ℝ) (n-2)=cochainSign n := by + rw [show n-2=(n-1)-1 by omega,cochainSign_sub_one,cochainSign_sub_one,neg_neg] + +omit [DecidableEq A] in +lemma signedCorner_sum (α β : V) : + (∑ p : Zigzag.CornerPath Q α β, cochainSign (K:=ℝ) (Path.length p.val))= + unfoldedCartan Q α β := by + have hs := Finset.sum_subtype (p:=fun p : Path V A => Path.source Q p=α ∧ Path.target Q p=β) (F:=inferInstance) + ((Finset.univ : Finset (Path V A)).filter (fun p => Path.source Q p=α ∧ Path.target Q p=β)) + (by intro p; simp) (fun p => cochainSign (K:=ℝ) (Path.length p)) + rw [← hs,Finset.sum_filter] + simp only [Fintype.sum_sum_type,Path.source,Path.target,Path.length] + simp [cochainSign,unfoldedCartan,Nat.card_eq_fintype_card,Fintype.card_subtype, + ← Finset.sum_boole,eq_comm] + have hv : (∑ x : V, if α=x ∧ β=x then (1:ℝ) else 0)=if α=β then 1 else 0 := by + simp [ite_and, eq_comm] + have ha : (∑ x : A, if α=Q.source x ∧ β=Q.target x then (-1:ℝ) else 0)= + -(∑ x : A, if α=Q.source x ∧ β=Q.target x then (1:ℝ) else 0) := by + rw [← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl + intro a _ + split_ifs <;> ring + rw [hv,ha] + split_ifs <;> ring + +omit [DecidableEq A] in +lemma signedGeneratorVector_mulVec {I : Type u} [Fintype I] + (E : BasedComplex Q (K:=K) I) (α : V) : + (unfoldedCartan Q *ᵥ signedGeneratorVector Q E) α= + ∑ i, cochainSign (K:=ℝ) (E.placement i).level * unfoldedCartan Q α (E.placement i).color := by + simp only [Matrix.mulVec,dotProduct,signedGeneratorVector,Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + simp [placementSignedWeight,mul_comm] + +lemma signedGeneratorVector_test {I : Type u} [Fintype I] [DecidableEq I] + (E : BasedComplex Q (K:=K) I) (α β : V) : + signedGeneratorVector Q (E.testComplex Q α) β= + if α=β then (unfoldedCartan Q *ᵥ signedGeneratorVector Q E) α else 0 := by + by_cases h : α=β + · subst β + rw [ite_eq_left rfl,signedGeneratorVector_mulVec] + change (∑ t : TestIndex Q E.placement α, + if α=α then cochainSign (K:=ℝ) ((E.placement t.1).cochain+ + ((E.placement t.1).internal+Path.length t.2.val)) else 0)=_ + simp only [ite_true,Fintype.sum_sigma] + apply Finset.sum_congr rfl + intro i _ + have hlev (p : Zigzag.CornerPath Q α (E.placement i).color) : + (E.placement i).cochain+((E.placement i).internal+Path.length p.val)= + (E.placement i).level+Path.length p.val := by + simp only [GeneratorPlacement.level]; ring + simp_rw [hlev,cochainSign_add] + rw [← Finset.mul_sum,signedCorner_sum] + + · simp [signedGeneratorVector,placementSignedWeight,testComplex,testPlacement,h] + +omit [Fintype V] in +lemma placementSignedWeight_lower (a : GeneratorPlacement V) (v : V) : + placementSignedWeight ⟨a.color,a.cochain-1,a.internal⟩ v= -placementSignedWeight a v := by + have hh : a.cochain-1+a.internal=a.level-1 := by dsimp [GeneratorPlacement.level]; omega + simp only [placementSignedWeight,GeneratorPlacement.level,hh,cochainSign_sub_one] + split_ifs <;> simp + +omit [DecidableEq A] [Fintype V] in +lemma Map.signedGeneratorVector_cone {I J : Type u} [Fintype I] [Fintype J] + {E : BasedComplex Q (K:=K) I} {F : BasedComplex Q (K:=K) J} (f : Map Q E F) : + signedGeneratorVector Q (f.cone Q)=signedGeneratorVector Q F-signedGeneratorVector Q E := by + funext v + simp only [signedGeneratorVector,Map.cone,Map.conePlacement,Fintype.sum_sum_type, + placementSignedWeight_lower,Finset.sum_neg_distrib,Pi.sub_apply] + ring + +theorem signedGeneratorVector_positiveTwist {I : Type u} [Fintype I] [DecidableEq I] + (E : BasedComplex Q (K:=K) I) (α : V) : + signedGeneratorVector Q (E.positiveTwist Q α)=rowReflect (unfoldedCartan Q) α + (signedGeneratorVector Q E) := by + unfold positiveTwist + rw [Map.signedGeneratorVector_cone] + funext β + simp only [Pi.sub_apply,signedGeneratorVector_test,rowReflect,Pi.smul_apply,smul_eq_mul, + Pi.single_apply] + by_cases h : α=β + · subst β; simp + · simp [h,Ne.symm h] + +lemma classSignedVector_positiveTwist (x : FiniteHomotopyClass Q (K:=K)) (α : V) : + classSignedVector Q (classPositiveTwist Q α x)= + rowReflect (unfoldedCartan Q) α (classSignedVector Q x) := by + induction x using Quotient.inductionOn with | _ E => + exact signedGeneratorVector_positiveTwist Q E.complex α + +omit [Fintype V] in +lemma placementSignedWeight_raise (a : GeneratorPlacement V) (v : V) : + placementSignedWeight ⟨a.color,a.cochain+1,a.internal⟩ v= -placementSignedWeight a v := by + have hh : a.cochain+1+a.internal=a.level+1 := by dsimp [GeneratorPlacement.level]; omega + simp only [placementSignedWeight,GeneratorPlacement.level,hh,cochainSign_add_one] + split_ifs <;> simp + +omit [DecidableEq A] [Fintype V] in +lemma Map.signedGeneratorVector_cocone {I J : Type u} [Fintype I] [Fintype J] + {E : BasedComplex Q (K:=K) I} {F : BasedComplex Q (K:=K) J} (f : Map Q E F) : + signedGeneratorVector Q (f.cocone Q)=signedGeneratorVector Q E-signedGeneratorVector Q F := by + funext v + simp only [signedGeneratorVector,Map.cocone,Map.coconePlacement,Fintype.sum_sum_type, + placementSignedWeight_raise,Finset.sum_neg_distrib,Pi.sub_apply] + ring + +lemma signedGeneratorVector_cotest {I : Type u} [Fintype I] [DecidableEq I] + (E : BasedComplex Q (K:=K) I) (α : V) : + signedGeneratorVector Q (E.cotestComplex Q α)=signedGeneratorVector Q (E.testComplex Q α) := by + funext β + apply Finset.sum_congr rfl + intro t _ + change (if α=β then cochainSign (K:=ℝ) ((E.placement t.1).cochain+ + ((E.placement t.1).internal+Path.length t.2.val-2)) else 0)= + (if α=β then cochainSign (K:=ℝ) ((E.placement t.1).cochain+ + ((E.placement t.1).internal+Path.length t.2.val)) else 0) + rw [← add_sub_assoc,cochainSign_sub_two] + +theorem signedGeneratorVector_negativeTwist {I : Type u} [Fintype I] [DecidableEq I] + (E : BasedComplex Q (K:=K) I) (α : V) : + signedGeneratorVector Q (E.negativeTwist Q α)=rowReflect (unfoldedCartan Q) α + (signedGeneratorVector Q E) := by + unfold negativeTwist + rw [Map.signedGeneratorVector_cocone,signedGeneratorVector_cotest] + funext β + simp only [Pi.sub_apply,signedGeneratorVector_test,rowReflect,Pi.smul_apply,smul_eq_mul, + Pi.single_apply] + by_cases h : α=β + · subst β; simp + · simp [h,Ne.symm h] + +lemma classSignedVector_negativeTwist (x : FiniteHomotopyClass Q (K:=K)) (α : V) : + classSignedVector Q (classNegativeTwist Q α x)= + rowReflect (unfoldedCartan Q) α (classSignedVector Q x) := by + induction x using Quotient.inductionOn with | _ E => + exact signedGeneratorVector_negativeTwist Q E.complex α + +lemma classSignedVector_positiveWord (w : List V) (x : FiniteHomotopyClass Q (K:=K)) : + classSignedVector Q (positiveWordAction Q w x)= + rowReflectWord (unfoldedCartan Q) w (classSignedVector Q x) := by + induction w with + | nil => rfl + | cons α w ih => + change classSignedVector Q (classPositiveTwist Q α (positiveWordAction Q w x))=_ + rw [classSignedVector_positiveTwist,ih] + rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CoconePlacement.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CoconePlacement.lean index 4b91fff6a087f86572ca08ce500bc91c2a57056c..36769410c8170f58bb7d26dc1dc64c5f1b0015fa 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CoconePlacement.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CoconePlacement.lean @@ -1,99 +1,99 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.TestIndex -import OAI.Topology.ArtinGroups.Quivers.CotestPlacement -import OAI.Topology.ArtinGroups.Complexes.ConePlacement - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - -namespace Map - -def coconePlacement (_f : Map Q E F) : I ⊕ J → GeneratorPlacement V - | .inl i => E.placement i - | .inr j => ⟨(F.placement j).color, (F.placement j).cochain + 1, - (F.placement j).internal⟩ - -noncomputable def coconeDifferential (f : Map Q E F) : - Matrix (I ⊕ J) (I ⊕ J) (Q.Zigzag K) := - Matrix.fromBlocks E.differential f.matrix 0 (-F.differential) - -lemma cocone_entries (f : Map Q E F) : - ProjectiveEntries Q (f.coconePlacement Q) (f.coconePlacement Q) - (f.coconeDifferential Q) := by - constructor - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact E.entries.1 i j - · exact f.entries.1 i j - · exact MulZeroClass.mul_zero _ - · exact (projectiveEntries_neg Q F.entries).1 i j - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact E.entries.2 i j - · exact f.entries.2 i j - · exact MulZeroClass.zero_mul _ - · exact (projectiveEntries_neg Q F.entries).2 i j - -lemma cocone_degree (f : Map Q E F) : - MapDegree Q (f.coconePlacement Q) (f.coconePlacement Q) 1 0 - (f.coconeDifferential Q) := by - intro i j - rcases i with i | i <;> rcases j with j | j - · exact E.degree i j - · constructor - · intro hc - apply (f.degree i j).1 - intro he - apply hc - dsimp only [coconePlacement] - omega - · exact (f.degree i j).2 - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · constructor - · intro hc - have hd : (F.placement j).cochain ≠ (F.placement i).cochain + 1 := by - intro he - apply hc - dsimp only [coconePlacement] - omega - change -F.differential i j = 0 - rw [(F.degree i j).1 hd, neg_zero] - · exact homogeneous_neg Q (F.degree i j).2 - -lemma cocone_square (f : Map Q E F) : - f.coconeDifferential Q * f.coconeDifferential Q = 0 := by - unfold coconeDifferential - rw [Matrix.fromBlocks_multiply] - simp only [Matrix.neg_mul, Matrix.mul_neg, E.square_zero, F.square_zero, - Matrix.mul_zero, Matrix.zero_mul, add_zero, f.commute, add_neg_cancel, neg_zero] - apply Matrix.ext - intro i j - rcases i with i | i <;> rcases j with j | j <;> rfl - -noncomputable def cocone (f : Map Q E F) : BasedComplex Q (K := K) (I ⊕ J) where - placement := f.coconePlacement Q - differential := f.coconeDifferential Q - entries := f.cocone_entries Q - degree := f.cocone_degree Q - square_zero := f.cocone_square Q - -end Map - -variable [Fintype V] [DecidableEq A] - -noncomputable def positiveTwist (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) (TestIndex Q E.placement α ⊕ I) := - (E.evaluation Q α).cone Q - -noncomputable def negativeTwist (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) (I ⊕ TestIndex Q E.placement α) := - (E.coevaluation Q α).cocone Q - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.TestIndex +import OAI.Topology.ArtinGroups.Quivers.CotestPlacement +import OAI.Topology.ArtinGroups.Complexes.ConePlacement + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + +namespace Map + +def coconePlacement (_f : Map Q E F) : I ⊕ J → GeneratorPlacement V + | .inl i => E.placement i + | .inr j => ⟨(F.placement j).color, (F.placement j).cochain + 1, + (F.placement j).internal⟩ + +noncomputable def coconeDifferential (f : Map Q E F) : + Matrix (I ⊕ J) (I ⊕ J) (Q.Zigzag K) := + Matrix.fromBlocks E.differential f.matrix 0 (-F.differential) + +lemma cocone_entries (f : Map Q E F) : + ProjectiveEntries Q (f.coconePlacement Q) (f.coconePlacement Q) + (f.coconeDifferential Q) := by + constructor + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact E.entries.1 i j + · exact f.entries.1 i j + · exact MulZeroClass.mul_zero _ + · exact (projectiveEntries_neg Q F.entries).1 i j + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact E.entries.2 i j + · exact f.entries.2 i j + · exact MulZeroClass.zero_mul _ + · exact (projectiveEntries_neg Q F.entries).2 i j + +lemma cocone_degree (f : Map Q E F) : + MapDegree Q (f.coconePlacement Q) (f.coconePlacement Q) 1 0 + (f.coconeDifferential Q) := by + intro i j + rcases i with i | i <;> rcases j with j | j + · exact E.degree i j + · constructor + · intro hc + apply (f.degree i j).1 + intro he + apply hc + dsimp only [coconePlacement] + omega + · exact (f.degree i j).2 + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · constructor + · intro hc + have hd : (F.placement j).cochain ≠ (F.placement i).cochain + 1 := by + intro he + apply hc + dsimp only [coconePlacement] + omega + change -F.differential i j = 0 + rw [(F.degree i j).1 hd, neg_zero] + · exact homogeneous_neg Q (F.degree i j).2 + +lemma cocone_square (f : Map Q E F) : + f.coconeDifferential Q * f.coconeDifferential Q = 0 := by + unfold coconeDifferential + rw [Matrix.fromBlocks_multiply] + simp only [Matrix.neg_mul, Matrix.mul_neg, E.square_zero, F.square_zero, + Matrix.mul_zero, Matrix.zero_mul, add_zero, f.commute, add_neg_cancel, neg_zero] + apply Matrix.ext + intro i j + rcases i with i | i <;> rcases j with j | j <;> rfl + +noncomputable def cocone (f : Map Q E F) : BasedComplex Q (K := K) (I ⊕ J) where + placement := f.coconePlacement Q + differential := f.coconeDifferential Q + entries := f.cocone_entries Q + degree := f.cocone_degree Q + square_zero := f.cocone_square Q + +end Map + +variable [Fintype V] [DecidableEq A] + +noncomputable def positiveTwist (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) (TestIndex Q E.placement α ⊕ I) := + (E.evaluation Q α).cone Q + +noncomputable def negativeTwist (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) (I ⊕ TestIndex Q E.placement α) := + (E.coevaluation Q α).cocone Q + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientIncoming.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientIncoming.lean index 98202684da5e6c3716c9076a0f59c83fa306de7c..ca57c90754b35e7436c76002f9a9bd592cc21df5 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientIncoming.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientIncoming.lean @@ -1,88 +1,88 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] - -def coefficientIncoming (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : - Submodule K (I → K) := - Submodule.span K (Set.range (fun ia : I × A => fun j => (E.differential ia.1 j).arrow ia.2) ∪ - {v | ∃ i, ((E.placement i).color ≠ α ∨ (E.placement i).cochain ≠ c) ∧ v = Pi.single i 1}) - -abbrev CoefficientTop (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) := - (I → K) ⧸ coefficientIncoming Q E α c - -omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in -lemma coefficientPairing_apply (x y : I → K) : - (Pi.basisFun K I).toDualEquiv x y = ∑ i, y i * x i := by - rw [Module.Basis.toDualEquiv_apply] - calc - _ = (Pi.basisFun K I).toDual x (∑ i, ((Pi.basisFun K I).repr y) i • (Pi.basisFun K I) i) := - congrArg ((Pi.basisFun K I).toDual x) ((Pi.basisFun K I).sum_repr y).symm - _ = _ := by simp only [map_sum, map_smul, smul_eq_mul, - Module.Basis.toDual_apply_left, Pi.basisFun_repr] - -omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in -lemma coefficientPairing_single (x : I → K) (i : I) : - (Pi.basisFun K I).toDualEquiv x (Pi.single i 1) = x i := by - rw [coefficientPairing_apply] - simp [Pi.single_apply] - -omit [Fintype V] [DecidableEq A] in -lemma coefficientTopDual_eq_annihilator (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : - coefficientTopDual Q E α c = - (coefficientIncoming Q E α c).dualAnnihilator.comap - (Pi.basisFun K I).toDualEquiv.toLinearMap := by - ext x - simp only [Submodule.mem_comap, LinearEquiv.coe_coe, Submodule.mem_dualAnnihilator] - constructor - · rintro ⟨hx,hxd⟩ - have hle : coefficientIncoming Q E α c ≤ - LinearMap.ker ((Pi.basisFun K I).toDualEquiv x) := by - apply Submodule.span_le.mpr - rintro v (⟨⟨i,a⟩,rfl⟩ | ⟨i,hi,rfl⟩) - · exact (coefficientPairing_apply (fun j => x j) (fun j => (E.differential i j).arrow a)).trans - (hxd i a) - · change (Pi.basisFun K I).toDualEquiv x (Pi.single i 1) = 0 - simpa only [coefficientPairing_single] using hx i hi - intro v hv - exact hle hv - · intro hx - constructor - · intro i hi - have h := hx (Pi.single i 1) (Submodule.subset_span (Or.inr ⟨i,hi,rfl⟩)) - simpa only [coefficientPairing_single] using h - · intro i a - exact (coefficientPairing_apply x (fun j => (E.differential i j).arrow a)).symm.trans - (hx _ (Submodule.subset_span (Or.inl ⟨(i,a),rfl⟩))) - -noncomputable def coefficientTopEquivDual (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : - CoefficientTop Q E α c ≃ₗ[K] coefficientTopDual Q E α c := - (Subspace.quotEquivAnnihilator (coefficientIncoming Q E α c)).trans - ((LinearEquiv.ofSubmodule' (Pi.basisFun K I).toDualEquiv - (coefficientIncoming Q E α c).dualAnnihilator).symm.trans - (LinearEquiv.ofEq _ _ (coefficientTopDual_eq_annihilator Q E α c).symm)) - -omit [Fintype V] [DecidableEq A] in -lemma coefficientTop_nontrivial_iff (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : - Nontrivial (CoefficientTop Q E α c) ↔ coefficientTopDual Q E α c ≠ ⊥ := by - rw [← Submodule.nontrivial_iff_ne_bot] - exact (coefficientTopEquivDual Q E α c).toEquiv.nontrivial_congr - -omit [DecidableEq A] in -lemma pure_quotientTop_socle_totalHomDimension_pos (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (α : V) (c d : ℤ) [Nontrivial (CoefficientTop Q E α c)] - (hs : coefficientSocle Q F α d ≠ ⊥) : - 0 < totalHomDimension Q E F (k-l) := - pure_top_socle_totalHomDimension_pos Q E F hE hF α c d - ((coefficientTop_nontrivial_iff Q E α c).mp inferInstance) hs - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] + +def coefficientIncoming (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : + Submodule K (I → K) := + Submodule.span K (Set.range (fun ia : I × A => fun j => (E.differential ia.1 j).arrow ia.2) ∪ + {v | ∃ i, ((E.placement i).color ≠ α ∨ (E.placement i).cochain ≠ c) ∧ v = Pi.single i 1}) + +abbrev CoefficientTop (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) := + (I → K) ⧸ coefficientIncoming Q E α c + +omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in +lemma coefficientPairing_apply (x y : I → K) : + (Pi.basisFun K I).toDualEquiv x y = ∑ i, y i * x i := by + rw [Module.Basis.toDualEquiv_apply] + calc + _ = (Pi.basisFun K I).toDual x (∑ i, ((Pi.basisFun K I).repr y) i • (Pi.basisFun K I) i) := + congrArg ((Pi.basisFun K I).toDual x) ((Pi.basisFun K I).sum_repr y).symm + _ = _ := by simp only [map_sum, map_smul, smul_eq_mul, + Module.Basis.toDual_apply_left, Pi.basisFun_repr] + +omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in +lemma coefficientPairing_single (x : I → K) (i : I) : + (Pi.basisFun K I).toDualEquiv x (Pi.single i 1) = x i := by + rw [coefficientPairing_apply] + simp [Pi.single_apply] + +omit [Fintype V] [DecidableEq A] in +lemma coefficientTopDual_eq_annihilator (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : + coefficientTopDual Q E α c = + (coefficientIncoming Q E α c).dualAnnihilator.comap + (Pi.basisFun K I).toDualEquiv.toLinearMap := by + ext x + simp only [Submodule.mem_comap, LinearEquiv.coe_coe, Submodule.mem_dualAnnihilator] + constructor + · rintro ⟨hx,hxd⟩ + have hle : coefficientIncoming Q E α c ≤ + LinearMap.ker ((Pi.basisFun K I).toDualEquiv x) := by + apply Submodule.span_le.mpr + rintro v (⟨⟨i,a⟩,rfl⟩ | ⟨i,hi,rfl⟩) + · exact (coefficientPairing_apply (fun j => x j) (fun j => (E.differential i j).arrow a)).trans + (hxd i a) + · change (Pi.basisFun K I).toDualEquiv x (Pi.single i 1) = 0 + simpa only [coefficientPairing_single] using hx i hi + intro v hv + exact hle hv + · intro hx + constructor + · intro i hi + have h := hx (Pi.single i 1) (Submodule.subset_span (Or.inr ⟨i,hi,rfl⟩)) + simpa only [coefficientPairing_single] using h + · intro i a + exact (coefficientPairing_apply x (fun j => (E.differential i j).arrow a)).symm.trans + (hx _ (Submodule.subset_span (Or.inl ⟨(i,a),rfl⟩))) + +noncomputable def coefficientTopEquivDual (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : + CoefficientTop Q E α c ≃ₗ[K] coefficientTopDual Q E α c := + (Subspace.quotEquivAnnihilator (coefficientIncoming Q E α c)).trans + ((LinearEquiv.ofSubmodule' (Pi.basisFun K I).toDualEquiv + (coefficientIncoming Q E α c).dualAnnihilator).symm.trans + (LinearEquiv.ofEq _ _ (coefficientTopDual_eq_annihilator Q E α c).symm)) + +omit [Fintype V] [DecidableEq A] in +lemma coefficientTop_nontrivial_iff (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : + Nontrivial (CoefficientTop Q E α c) ↔ coefficientTopDual Q E α c ≠ ⊥ := by + rw [← Submodule.nontrivial_iff_ne_bot] + exact (coefficientTopEquivDual Q E α c).toEquiv.nontrivial_congr + +omit [DecidableEq A] in +lemma pure_quotientTop_socle_totalHomDimension_pos (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (α : V) (c d : ℤ) [Nontrivial (CoefficientTop Q E α c)] + (hs : coefficientSocle Q F α d ≠ ⊥) : + 0 < totalHomDimension Q E F (k-l) := + pure_top_socle_totalHomDimension_pos Q E F hE hF α c d + ((coefficientTop_nontrivial_iff Q E α c).mp inferInstance) hs + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocle.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocle.lean index d0a49a4adf490894058d386295c53451ada6fd9f..beeb399f0abfc33a2bc977c826cf578255b52cf8 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocle.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocle.lean @@ -1,188 +1,188 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PureHomSpaceHomogeneous -import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -def coefficientSocle (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : - Submodule K (I → K) where - carrier := {x | (∀ i, (E.placement i).color ≠ α ∨ (E.placement i).cochain ≠ c → x i = 0) ∧ - ∀ j a, Q.source a = α → ∑ i, x i * (E.differential i j).arrow a = 0} - zero_mem' := by constructor <;> simp - add_mem' := by - rintro x y ⟨hx,hxd⟩ ⟨hy,hyd⟩ - constructor - · intro i hi; simp only [Pi.add_apply, hx i hi, hy i hi, add_zero] - · intro j a ha - simp only [Pi.add_apply, _root_.add_mul, Finset.sum_add_distrib, hxd j a ha, hyd j a ha, add_zero] - smul_mem' := by - rintro r x ⟨hx,hxd⟩ - constructor - · intro i hi; simp only [Pi.smul_apply, hx i hi, smul_zero] - · intro j a ha - simp only [Pi.smul_apply, smul_eq_mul, _root_.mul_assoc, ← Finset.mul_sum, hxd j a ha, - MulZeroClass.mul_zero] - -omit [Fintype V] [DecidableEq A] [Fintype I] [Fintype J] in -lemma entry_vertex_left_support {p : I → GeneratorPlacement V} {q : J → GeneratorPlacement V} - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q p q f) - (i : I) (j : J) (α : V) (hα : α ≠ (p i).color) : (f i j).vertex α = 0 := by - have hh := congrArg (fun z : Q.Zigzag K => z.vertex α) (hf.1 i j) - change (vertexId Q (p i).color).vertex α * (f i j).vertex α = _ at hh - rw [vertexId_eval, ite_eq_right hα, MulZeroClass.zero_mul] at hh - exact hh.symm - -omit [Fintype V] [DecidableEq A] [Fintype I] [Fintype J] in -lemma entry_vertex_right_support {p : I → GeneratorPlacement V} {q : J → GeneratorPlacement V} - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q p q f) - (i : I) (j : J) (α : V) (hα : α ≠ (q j).color) : (f i j).vertex α = 0 := by - have hh := congrArg (fun z : Q.Zigzag K => z.vertex α) (hf.2 i j) - change (f i j).vertex α * (vertexId Q (q j).color).vertex α = _ at hh - rw [vertexId_eval, ite_eq_right hα, MulZeroClass.mul_zero] at hh - exact hh.symm - -omit [Fintype V] [DecidableEq A] in -lemma coefficient_row_zero {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) - (hc : CoefficientMatrix Q f) (i : I) - (hz : ∀ j, (f i j).vertex (E.placement i).color = 0) : ∀ j, f i j = 0 := by - intro j - apply ext - · funext α - by_cases ha : α = (E.placement i).color - · subst α; exact hz j - · exact entry_vertex_left_support Q hf i j α ha - · exact (hc i j).1 - · exact (hc i j).2 - -omit [Fintype V] [DecidableEq A] in - -lemma coefficient_cocycle_zero_of_socle_zero - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (n v : ℤ) (active : Set V) - (hE : ∀ i, (E.placement i).color ∈ active) - (hF : ∀ α ∈ active, ∀ c, coefficientSocle Q F α c = ⊥) - {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) - (hc : CoefficientMatrix Q f) : f = 0 := by - classical - by_contra hne - let support : Finset I := Finset.univ.filter fun i => ∃ j, f i j ≠ 0 - have hs : support.Nonempty := by - by_contra hh - apply hne - apply Matrix.ext - intro i j - by_contra hz - exact hh ⟨i, by simp only [support, Finset.mem_filter, Finset.mem_univ, true_and]; exact ⟨j,hz⟩⟩ - obtain ⟨i, hi, hmax⟩ := Finset.exists_max_image support (fun i => (E.placement i).cochain) hs - have hrow : ∀ j, (E.differential * f) i j = 0 := by - intro j - rw [Matrix.mul_apply] - apply Finset.sum_eq_zero - intro t _ - by_cases ht : t ∈ support - · have htdeg := hmax t ht - have hz := (E.degree i t).1 (by omega) - rw [hz, MulZeroClass.zero_mul] - · have hz : f t j = 0 := by - by_contra hh - exact ht (by simp only [support, Finset.mem_filter, Finset.mem_univ, true_and]; exact ⟨j,hh⟩) - rw [hz, MulZeroClass.mul_zero] - have hout : ∀ j, (f * F.differential) i j = 0 := by - intro j - have hh := congrArg (fun m : Matrix I J (Q.Zigzag K) => m i j) hf.2 - change (E.differential*f) i j - cochainSign (K := K) n • (f*F.differential) i j = 0 at hh - rw [hrow j, zero_sub, neg_eq_zero] at hh - exact (smul_eq_zero.mp hh).resolve_left (cochainSign_ne_zero (K := K) n) - let x : J → K := fun j => (f i j).vertex (E.placement i).color - have hx : x ∈ coefficientSocle Q F (E.placement i).color ((E.placement i).cochain+n) := by - constructor - · intro j hj - rcases hj with hj | hj - · exact entry_vertex_right_support Q hf.1.1 i j _ (Ne.symm hj) - · change (f i j).vertex _ = 0 - rw [(hf.1.2 i j).1 hj] - rfl - · intro j a ha - have hh := congrArg (fun z : Q.Zigzag K => z.arrow a) (hout j) - rw [Matrix.mul_apply, arrow_sum] at hh - simp only [Finset.sum_apply, arrow_mul, Pi.add_apply, leftScale, rightScale, - (hc i _).1, Pi.zero_apply, MulZeroClass.zero_mul, add_zero, ha] at hh - exact hh - have hxzero : x = 0 := by - simpa only [hF _ (hE i) _, Submodule.mem_bot] using hx - obtain ⟨j,hj⟩ := (Finset.mem_filter.mp hi).2 - apply hj - exact coefficient_row_zero Q hf.1.1 hc i (fun j => congrFun hxzero j) j - -omit [Fintype V] [DecidableEq A] in -lemma pure_coefficient_homDimension_zero_of_socle_zero - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - {l k n v : ℤ} (hE : ∀ i, (E.placement i).level = l) - (hF : ∀ j, (F.placement j).level = k) (h : n+v=k-l) - (active : Set V) (hsE : ∀ i, (E.placement i).color ∈ active) - (hsF : ∀ α ∈ active, ∀ c, coefficientSocle Q F α c = ⊥) : - homDimension Q E F n v = 0 := by - have hz : homCycles Q E F n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - exact coefficient_cocycle_zero_of_socle_zero Q E F n v active hsE hsF hf - (pure_homSpace_coefficient Q E F hE hF h hf.1) - unfold homDimension - have : Subsingleton (homCycles Q E F n v) := by rw [hz]; infer_instance - have : Subsingleton (homCohomology Q E F n v) := inferInstance - exact Module.finrank_zero_of_subsingleton - -omit [Fintype V] [DecidableEq A] in -lemma pure_total_coefficient_homDimension_zero_of_socle_zero - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - {l k : ℤ} (hE : ∀ i, (E.placement i).level = l) - (hF : ∀ j, (F.placement j).level = k) - (active : Set V) (hsE : ∀ i, (E.placement i).color ∈ active) - (hsF : ∀ α ∈ active, ∀ c, coefficientSocle Q F α c = ⊥) : - totalHomDimension Q E F (k-l) = 0 := by - unfold totalHomDimension - apply Finset.sum_eq_zero - intro v _ - exact pure_coefficient_homDimension_zero_of_socle_zero Q E F hE hF (by omega) - active hsE hsF - -omit [Fintype V] [DecidableEq A] in - -lemma coefficientSocle_nonzero_at_max (E : BasedComplex Q (K := K) I) - (i : I) (hi : ∀ j, (E.placement j).cochain ≤ (E.placement i).cochain) : - coefficientSocle Q E (E.placement i).color (E.placement i).cochain ≠ ⊥ := by - classical - let x : I → K := Pi.single i 1 - have hx : x ∈ coefficientSocle Q E (E.placement i).color (E.placement i).cochain := by - constructor - · intro j hj - have hji : j ≠ i := by rintro rfl; simp at hj - simp [x, hji] - · intro j a _ - change ∑ t, Pi.single (M := fun _ : I => K) i (1 : K) t * (E.differential t j).arrow a = 0 - simp only [Pi.single_apply, ite_mul, _root_.one_mul, MulZeroClass.zero_mul, - Finset.sum_ite_eq', Finset.mem_univ, ite_true] - have hd := (E.degree i j).1 (by have := hi j; omega) - rw [hd] - rfl - intro hs - have hz : x = 0 := by simpa only [hs, Submodule.mem_bot] using hx - have hh := congrFun hz i - simp [x] at hh - -omit [Fintype V] [DecidableEq A] in -lemma exists_coefficientSocle_nonzero (E : BasedComplex Q (K := K) I) [Nonempty I] : - ∃ α c, coefficientSocle Q E α c ≠ ⊥ := by - obtain ⟨i, _, hi⟩ := Finset.exists_max_image Finset.univ - (fun i => (E.placement i).cochain) Finset.univ_nonempty - exact ⟨_,_,coefficientSocle_nonzero_at_max Q E i (fun j => hi j (Finset.mem_univ j))⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PureHomSpaceHomogeneous +import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +def coefficientSocle (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : + Submodule K (I → K) where + carrier := {x | (∀ i, (E.placement i).color ≠ α ∨ (E.placement i).cochain ≠ c → x i = 0) ∧ + ∀ j a, Q.source a = α → ∑ i, x i * (E.differential i j).arrow a = 0} + zero_mem' := by constructor <;> simp + add_mem' := by + rintro x y ⟨hx,hxd⟩ ⟨hy,hyd⟩ + constructor + · intro i hi; simp only [Pi.add_apply, hx i hi, hy i hi, add_zero] + · intro j a ha + simp only [Pi.add_apply, _root_.add_mul, Finset.sum_add_distrib, hxd j a ha, hyd j a ha, add_zero] + smul_mem' := by + rintro r x ⟨hx,hxd⟩ + constructor + · intro i hi; simp only [Pi.smul_apply, hx i hi, smul_zero] + · intro j a ha + simp only [Pi.smul_apply, smul_eq_mul, _root_.mul_assoc, ← Finset.mul_sum, hxd j a ha, + MulZeroClass.mul_zero] + +omit [Fintype V] [DecidableEq A] [Fintype I] [Fintype J] in +lemma entry_vertex_left_support {p : I → GeneratorPlacement V} {q : J → GeneratorPlacement V} + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q p q f) + (i : I) (j : J) (α : V) (hα : α ≠ (p i).color) : (f i j).vertex α = 0 := by + have hh := congrArg (fun z : Q.Zigzag K => z.vertex α) (hf.1 i j) + change (vertexId Q (p i).color).vertex α * (f i j).vertex α = _ at hh + rw [vertexId_eval, ite_eq_right hα, MulZeroClass.zero_mul] at hh + exact hh.symm + +omit [Fintype V] [DecidableEq A] [Fintype I] [Fintype J] in +lemma entry_vertex_right_support {p : I → GeneratorPlacement V} {q : J → GeneratorPlacement V} + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q p q f) + (i : I) (j : J) (α : V) (hα : α ≠ (q j).color) : (f i j).vertex α = 0 := by + have hh := congrArg (fun z : Q.Zigzag K => z.vertex α) (hf.2 i j) + change (f i j).vertex α * (vertexId Q (q j).color).vertex α = _ at hh + rw [vertexId_eval, ite_eq_right hα, MulZeroClass.mul_zero] at hh + exact hh.symm + +omit [Fintype V] [DecidableEq A] in +lemma coefficient_row_zero {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) + (hc : CoefficientMatrix Q f) (i : I) + (hz : ∀ j, (f i j).vertex (E.placement i).color = 0) : ∀ j, f i j = 0 := by + intro j + apply ext + · funext α + by_cases ha : α = (E.placement i).color + · subst α; exact hz j + · exact entry_vertex_left_support Q hf i j α ha + · exact (hc i j).1 + · exact (hc i j).2 + +omit [Fintype V] [DecidableEq A] in + +lemma coefficient_cocycle_zero_of_socle_zero + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (n v : ℤ) (active : Set V) + (hE : ∀ i, (E.placement i).color ∈ active) + (hF : ∀ α ∈ active, ∀ c, coefficientSocle Q F α c = ⊥) + {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) + (hc : CoefficientMatrix Q f) : f = 0 := by + classical + by_contra hne + let support : Finset I := Finset.univ.filter fun i => ∃ j, f i j ≠ 0 + have hs : support.Nonempty := by + by_contra hh + apply hne + apply Matrix.ext + intro i j + by_contra hz + exact hh ⟨i, by simp only [support, Finset.mem_filter, Finset.mem_univ, true_and]; exact ⟨j,hz⟩⟩ + obtain ⟨i, hi, hmax⟩ := Finset.exists_max_image support (fun i => (E.placement i).cochain) hs + have hrow : ∀ j, (E.differential * f) i j = 0 := by + intro j + rw [Matrix.mul_apply] + apply Finset.sum_eq_zero + intro t _ + by_cases ht : t ∈ support + · have htdeg := hmax t ht + have hz := (E.degree i t).1 (by omega) + rw [hz, MulZeroClass.zero_mul] + · have hz : f t j = 0 := by + by_contra hh + exact ht (by simp only [support, Finset.mem_filter, Finset.mem_univ, true_and]; exact ⟨j,hh⟩) + rw [hz, MulZeroClass.mul_zero] + have hout : ∀ j, (f * F.differential) i j = 0 := by + intro j + have hh := congrArg (fun m : Matrix I J (Q.Zigzag K) => m i j) hf.2 + change (E.differential*f) i j - cochainSign (K := K) n • (f*F.differential) i j = 0 at hh + rw [hrow j, zero_sub, neg_eq_zero] at hh + exact (smul_eq_zero.mp hh).resolve_left (cochainSign_ne_zero (K := K) n) + let x : J → K := fun j => (f i j).vertex (E.placement i).color + have hx : x ∈ coefficientSocle Q F (E.placement i).color ((E.placement i).cochain+n) := by + constructor + · intro j hj + rcases hj with hj | hj + · exact entry_vertex_right_support Q hf.1.1 i j _ (Ne.symm hj) + · change (f i j).vertex _ = 0 + rw [(hf.1.2 i j).1 hj] + rfl + · intro j a ha + have hh := congrArg (fun z : Q.Zigzag K => z.arrow a) (hout j) + rw [Matrix.mul_apply, arrow_sum] at hh + simp only [Finset.sum_apply, arrow_mul, Pi.add_apply, leftScale, rightScale, + (hc i _).1, Pi.zero_apply, MulZeroClass.zero_mul, add_zero, ha] at hh + exact hh + have hxzero : x = 0 := by + simpa only [hF _ (hE i) _, Submodule.mem_bot] using hx + obtain ⟨j,hj⟩ := (Finset.mem_filter.mp hi).2 + apply hj + exact coefficient_row_zero Q hf.1.1 hc i (fun j => congrFun hxzero j) j + +omit [Fintype V] [DecidableEq A] in +lemma pure_coefficient_homDimension_zero_of_socle_zero + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + {l k n v : ℤ} (hE : ∀ i, (E.placement i).level = l) + (hF : ∀ j, (F.placement j).level = k) (h : n+v=k-l) + (active : Set V) (hsE : ∀ i, (E.placement i).color ∈ active) + (hsF : ∀ α ∈ active, ∀ c, coefficientSocle Q F α c = ⊥) : + homDimension Q E F n v = 0 := by + have hz : homCycles Q E F n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + exact coefficient_cocycle_zero_of_socle_zero Q E F n v active hsE hsF hf + (pure_homSpace_coefficient Q E F hE hF h hf.1) + unfold homDimension + have : Subsingleton (homCycles Q E F n v) := by rw [hz]; infer_instance + have : Subsingleton (homCohomology Q E F n v) := inferInstance + exact Module.finrank_zero_of_subsingleton + +omit [Fintype V] [DecidableEq A] in +lemma pure_total_coefficient_homDimension_zero_of_socle_zero + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + {l k : ℤ} (hE : ∀ i, (E.placement i).level = l) + (hF : ∀ j, (F.placement j).level = k) + (active : Set V) (hsE : ∀ i, (E.placement i).color ∈ active) + (hsF : ∀ α ∈ active, ∀ c, coefficientSocle Q F α c = ⊥) : + totalHomDimension Q E F (k-l) = 0 := by + unfold totalHomDimension + apply Finset.sum_eq_zero + intro v _ + exact pure_coefficient_homDimension_zero_of_socle_zero Q E F hE hF (by omega) + active hsE hsF + +omit [Fintype V] [DecidableEq A] in + +lemma coefficientSocle_nonzero_at_max (E : BasedComplex Q (K := K) I) + (i : I) (hi : ∀ j, (E.placement j).cochain ≤ (E.placement i).cochain) : + coefficientSocle Q E (E.placement i).color (E.placement i).cochain ≠ ⊥ := by + classical + let x : I → K := Pi.single i 1 + have hx : x ∈ coefficientSocle Q E (E.placement i).color (E.placement i).cochain := by + constructor + · intro j hj + have hji : j ≠ i := by rintro rfl; simp at hj + simp [x, hji] + · intro j a _ + change ∑ t, Pi.single (M := fun _ : I => K) i (1 : K) t * (E.differential t j).arrow a = 0 + simp only [Pi.single_apply, ite_mul, _root_.one_mul, MulZeroClass.zero_mul, + Finset.sum_ite_eq', Finset.mem_univ, ite_true] + have hd := (E.degree i j).1 (by have := hi j; omega) + rw [hd] + rfl + intro hs + have hz : x = 0 := by simpa only [hs, Submodule.mem_bot] using hx + have hh := congrFun hz i + simp [x] at hh + +omit [Fintype V] [DecidableEq A] in +lemma exists_coefficientSocle_nonzero (E : BasedComplex Q (K := K) I) [Nonempty I] : + ∃ α c, coefficientSocle Q E α c ≠ ⊥ := by + obtain ⟨i, _, hi⟩ := Finset.exists_max_image Finset.univ + (fun i => (E.placement i).cochain) Finset.univ_nonempty + exact ⟨_,_,coefficientSocle_nonzero_at_max Q E i (fun j => hi j (Finset.mem_univ j))⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocleRestrictLayer.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocleRestrictLayer.lean index 1c22f4cfb280e951fb093c5501e95b81e8304153..3f45206bdf5b16a47ab65beb207cd15154fae5a8 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocleRestrictLayer.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientSocleRestrictLayer.lean @@ -1,31 +1,31 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.CoefficientSocle - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma coefficientSocle_restrict_layer - (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) (d:ℤ) (α:V) (c:ℤ) - {x : I → K} (hx : x ∈ coefficientSocle Q E α c) - (hs : ∀ i, (E.placement i).level≠d → x i=0) : - (fun i : {i // (E.placement i).level=d} => x i.val) ∈ - coefficientSocle Q (E.pureLayer Q hE d) α c := by - constructor - · intro i hi; exact hx.1 i.val hi - · intro j a ha - change (∑ i : {i // (E.placement i).level=d}, x i.val * (E.differential i.val j.val).arrow a)=0 - rw [← hx.2 j.val a ha] - apply Fintype.sum_of_injective (Subtype.val : {i // (E.placement i).level=d} → I) - Subtype.val_injective - · intro i hi - rw [hs i (fun h => hi ⟨⟨i,h⟩,rfl⟩),MulZeroClass.zero_mul] - · intro i; rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.CoefficientSocle + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma coefficientSocle_restrict_layer + (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) (d:ℤ) (α:V) (c:ℤ) + {x : I → K} (hx : x ∈ coefficientSocle Q E α c) + (hs : ∀ i, (E.placement i).level≠d → x i=0) : + (fun i : {i // (E.placement i).level=d} => x i.val) ∈ + coefficientSocle Q (E.pureLayer Q hE d) α c := by + constructor + · intro i hi; exact hx.1 i.val hi + · intro j a ha + change (∑ i : {i // (E.placement i).level=d}, x i.val * (E.differential i.val j.val).arrow a)=0 + rw [← hx.2 j.val a ha] + apply Fintype.sum_of_injective (Subtype.val : {i // (E.placement i).level=d} → I) + Subtype.val_injective + · intro i hi + rw [hs i (fun h => hi ⟨⟨i,h⟩,rfl⟩),MulZeroClass.zero_mul] + · intro i; rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDual.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDual.lean index c5f431591c4b098f4f3f654eff24b43ee01de5ab..058b6958d08bcfeda8eb17329181cd03ac4e927f 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDual.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDual.lean @@ -1,232 +1,232 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PureCoefficientCohomology -import OAI.Topology.ArtinGroups.Complexes.CoefficientSocle - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -def coefficientTopDual (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : - Submodule K (I → K) where - carrier := {x | (∀ i, (E.placement i).color ≠ α ∨ (E.placement i).cochain ≠ c → x i = 0) ∧ - ∀ i a, ∑ j, (E.differential i j).arrow a * x j = 0} - zero_mem' := by constructor <;> simp - add_mem' := by - rintro x y ⟨hx,hxd⟩ ⟨hy,hyd⟩ - constructor - · intro i hi; simp only [Pi.add_apply, hx i hi, hy i hi, add_zero] - · intro i a - simp only [Pi.add_apply, _root_.mul_add, Finset.sum_add_distrib, hxd i a, hyd i a, add_zero] - smul_mem' := by - rintro r x ⟨hx,hxd⟩ - constructor - · intro i hi; simp only [Pi.smul_apply, hx i hi, smul_zero] - · intro i a - simp only [Pi.smul_apply, smul_eq_mul, mul_left_comm _ r, ← Finset.mul_sum, hxd i a, - MulZeroClass.mul_zero] - -noncomputable def topSocleMatrix (α : V) (x : I → K) (y : J → K) : - Matrix I J (Q.Zigzag K) := fun i j => (x i * y j) • vertexId Q α - -omit [Fintype V] [DecidableEq A] in -lemma topSocleMatrix_mem_homSpace (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (α : V) (c d : ℤ) {x : I → K} {y : J → K} - (hx : x ∈ coefficientTopDual Q E α c) (hy : y ∈ coefficientSocle Q F α d) : - topSocleMatrix Q α x y ∈ homSpace Q E F (d-c) (k-l-(d-c)) := by - have hs i j : x i * y j ≠ 0 → - (E.placement i).color = α ∧ (E.placement i).cochain = c ∧ - (F.placement j).color = α ∧ (F.placement j).cochain = d := by - intro h - obtain ⟨hi,hj⟩ := mul_ne_zero_iff.mp h - exact ⟨not_ne_iff.mp (fun hh => hi (hx.1 i (Or.inl hh))), - not_ne_iff.mp (fun hh => hi (hx.1 i (Or.inr hh))), - not_ne_iff.mp (fun hh => hj (hy.1 j (Or.inl hh))), - not_ne_iff.mp (fun hh => hj (hy.1 j (Or.inr hh)))⟩ - constructor - · constructor - · intro i j - by_cases hh : x i * y j = 0 - · simp only [topSocleMatrix, hh, zero_smul, MulZeroClass.mul_zero] - · rw [(hs i j hh).1] - simp only [topSocleMatrix, mul_smul, vertexId_mul_self] - · intro i j - by_cases hh : x i * y j = 0 - · simp only [topSocleMatrix, hh, zero_smul, MulZeroClass.zero_mul] - · rw [(hs i j hh).2.2.1] - simp only [topSocleMatrix, smul_mul_assoc, vertexId_mul_self] - · intro i j - by_cases hh : x i * y j = 0 - · simp only [topSocleMatrix, hh, zero_smul] - exact ⟨fun _ => trivial, ⟨fun _ => rfl, fun _ => rfl, fun _ => rfl⟩⟩ - · obtain ⟨_,hi,_,hj⟩ := hs i j hh - constructor - · intro h; exact (h (by omega)).elim - · have hl := hE i - have hk := hF j - dsimp only [GeneratorPlacement.level] at hl hk - have heq : k-l-(d-c)+(E.placement i).internal-(F.placement j).internal = 0 := by omega - rw [heq] - exact homogeneous_smul Q (homogeneous_vertexId Q α) _ - -omit [Fintype V] [DecidableEq A] in -lemma pure_differential_linear (E : BasedComplex Q (K := K) I) {l : ℤ} - (hE : ∀ i, (E.placement i).level = l) : LinearMatrix Q E.differential := - pure_homSpace_linear Q E E hE hE (by omega) ⟨E.entries,E.degree⟩ - -omit [Fintype V] [DecidableEq A] in -lemma token_sum {T : Type*} (s : Finset T) (f : T → Q.Zigzag K) : - (∑ t ∈ s, f t).token = ∑ t ∈ s, (f t).token := - map_sum ({ toFun := token - map_add' := fun _ _ => rfl - map_smul' := fun _ _ => rfl } : Q.Zigzag K →ₗ[K] (V → K)) f s - -omit [Fintype V] [DecidableEq A] [Fintype J] in -lemma differential_topSocleMatrix (E : BasedComplex Q (K := K) I) {l : ℤ} - (hE : ∀ i, (E.placement i).level = l) (α : V) (c : ℤ) - {x : I → K} (hx : x ∈ coefficientTopDual Q E α c) (y : J → K) : - E.differential * topSocleMatrix Q α x y = 0 := by - have hlin := pure_differential_linear Q E hE - apply Matrix.ext - intro i j - apply ext - · ext β - simp only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, - (hlin i _).1, Pi.zero_apply, MulZeroClass.zero_mul, Finset.sum_const_zero] - rfl - · ext a - simp only [Matrix.mul_apply, arrow_sum, Finset.sum_apply, arrow_mul, Pi.add_apply, - leftScale, rightScale, (hlin i _).1, Pi.zero_apply, MulZeroClass.zero_mul, zero_add, - topSocleMatrix, vertex_smul, Pi.smul_apply, smul_eq_mul, vertexId_eval] - by_cases ha : Q.target a = α - · simp only [ha, ← _root_.mul_assoc, ← Finset.sum_mul, hx.2 i a, - MulZeroClass.zero_mul] - rfl - · simp only [ite_eq_right ha, MulZeroClass.mul_zero, Finset.sum_const_zero] - rfl - · ext β - simp only [Matrix.mul_apply, token_sum, Finset.sum_apply, token_mul, - (hlin i _).1, (hlin i _).2, Pi.zero_apply, MulZeroClass.zero_mul, - zero_add, topSocleMatrix, arrow_smul, arrow_vertexId, smul_zero, backtrack, - Pi.zero_apply, MulZeroClass.mul_zero, ite_self, Finset.sum_const_zero] - rfl - -omit [Fintype V] [DecidableEq A] [Fintype I] in -lemma topSocleMatrix_differential (F : BasedComplex Q (K := K) J) {k : ℤ} - (hF : ∀ j, (F.placement j).level = k) (α : V) (d : ℤ) - (x : I → K) {y : J → K} (hy : y ∈ coefficientSocle Q F α d) : - topSocleMatrix Q α x y * F.differential = 0 := by - have hlin := pure_differential_linear Q F hF - apply Matrix.ext - intro i j - apply ext - · ext β - simp only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, - (hlin _ j).1, Pi.zero_apply, MulZeroClass.mul_zero, Finset.sum_const_zero] - rfl - · ext a - simp only [Matrix.mul_apply, arrow_sum, Finset.sum_apply, arrow_mul, Pi.add_apply, - leftScale, rightScale, (hlin _ j).1, Pi.zero_apply, MulZeroClass.mul_zero, add_zero, - topSocleMatrix, vertex_smul, Pi.smul_apply, smul_eq_mul, vertexId_eval] - by_cases ha : Q.source a = α - · simp only [ite_eq_left ha, _root_.mul_one, _root_.mul_assoc, ← Finset.mul_sum, hy.2 j a ha, - MulZeroClass.mul_zero] - rfl - · simp only [ite_eq_right ha, MulZeroClass.mul_zero, MulZeroClass.zero_mul, Finset.sum_const_zero] - rfl - · ext β - simp only [Matrix.mul_apply, token_sum, Finset.sum_apply, token_mul, - (hlin _ j).1, (hlin _ j).2, Pi.zero_apply, MulZeroClass.mul_zero, - zero_add, topSocleMatrix, arrow_smul, arrow_vertexId, smul_zero, backtrack, - Pi.zero_apply, MulZeroClass.zero_mul, ite_self, Finset.sum_const_zero] - rfl - -omit [Fintype V] [DecidableEq A] in -lemma topSocleMatrix_mem_homCycles (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (α : V) (c d : ℤ) {x : I → K} {y : J → K} - (hx : x ∈ coefficientTopDual Q E α c) (hy : y ∈ coefficientSocle Q F α d) : - topSocleMatrix Q α x y ∈ homCycles Q E F (d-c) (k-l-(d-c)) := by - refine ⟨topSocleMatrix_mem_homSpace Q E F hE hF α c d hx hy, ?_⟩ - change E.differential * topSocleMatrix Q α x y - - cochainSign (K := K) (d-c) • (topSocleMatrix Q α x y * F.differential) = 0 - rw [differential_topSocleMatrix Q E hE α c hx, - topSocleMatrix_differential Q F hF α d x hy, smul_zero, sub_self] - -omit [Fintype V] [DecidableEq A] [Fintype I] [Fintype J] in -lemma topSocleMatrix_ne_zero (α : V) {x : I → K} {y : J → K} - (hx : x ≠ 0) (hy : y ≠ 0) : topSocleMatrix Q α x y ≠ 0 := by - obtain ⟨i,hi⟩ : ∃ i, x i ≠ 0 := by - by_contra hn - push Not at hn - exact hx (funext hn) - obtain ⟨j,hj⟩ : ∃ j, y j ≠ 0 := by - by_contra hn - push Not at hn - exact hy (funext hn) - intro hz - have he := congrArg (fun f : Matrix I J (Q.Zigzag K) => (f i j).vertex α) hz - have h : x i * y j = 0 := by - simpa [topSocleMatrix, vertexId_eval] using he - exact (mul_ne_zero hi hj) h - -omit [DecidableEq A] in -lemma pure_top_socle_homDimension_pos (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (α : V) (c d : ℤ) (ht : coefficientTopDual Q E α c ≠ ⊥) - (hs : coefficientSocle Q F α d ≠ ⊥) : - 0 < homDimension Q E F (d-c) (k-l-(d-c)) := by - obtain ⟨x,hx,hx0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot ht - obtain ⟨y,hy,hy0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hs - let f : homCycles Q E F (d-c) (k-l-(d-c)) := - ⟨topSocleMatrix Q α x y, topSocleMatrix_mem_homCycles Q E F hE hF α c d hx hy⟩ - have hf : f ≠ 0 := fun h => topSocleMatrix_ne_zero Q α hx0 hy0 (congrArg Subtype.val h) - unfold homDimension - rw [(pureCoefficientCohomology Q E F hE hF (by omega)).finrank_eq] - exact Module.finrank_pos_iff.mpr ⟨⟨f,0,hf⟩⟩ - -omit [Fintype V] [DecidableEq A] in -lemma homDimension_le_totalHomDimension (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homDimension Q E F n v ≤ totalHomDimension Q E F (n+v) := by - classical - by_cases hv : v ∈ homInternalSupport Q E F - · unfold totalHomDimension - have h' := Finset.single_le_sum (f := fun w => homDimension Q E F (n+v-w) w) - (fun _ _ => Nat.zero_le _) hv - simpa only [add_sub_cancel_right] using h' - · rw [homDimension_off_internal_support Q E F n v hv] - exact Nat.zero_le _ - -omit [DecidableEq A] in -lemma pure_top_socle_totalHomDimension_pos (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (α : V) (c d : ℤ) (ht : coefficientTopDual Q E α c ≠ ⊥) - (hs : coefficientSocle Q F α d ≠ ⊥) : - 0 < totalHomDimension Q E F (k-l) := by - have h := lt_of_lt_of_le (pure_top_socle_homDimension_pos Q E F hE hF α c d ht hs) - (homDimension_le_totalHomDimension Q E F (d-c) (k-l-(d-c))) - convert h using 1 - congr 1 - omega - -omit [DecidableEq A] in -lemma pure_top_zero_of_socle_hom_zero (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (α : V) (c d : ℤ) (hs : coefficientSocle Q F α d ≠ ⊥) - (hh : totalHomDimension Q E F (k-l) = 0) : coefficientTopDual Q E α c = ⊥ := by - by_contra ht - have h := pure_top_socle_totalHomDimension_pos Q E F hE hF α c d ht hs - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PureCoefficientCohomology +import OAI.Topology.ArtinGroups.Complexes.CoefficientSocle + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +def coefficientTopDual (E : BasedComplex Q (K := K) I) (α : V) (c : ℤ) : + Submodule K (I → K) where + carrier := {x | (∀ i, (E.placement i).color ≠ α ∨ (E.placement i).cochain ≠ c → x i = 0) ∧ + ∀ i a, ∑ j, (E.differential i j).arrow a * x j = 0} + zero_mem' := by constructor <;> simp + add_mem' := by + rintro x y ⟨hx,hxd⟩ ⟨hy,hyd⟩ + constructor + · intro i hi; simp only [Pi.add_apply, hx i hi, hy i hi, add_zero] + · intro i a + simp only [Pi.add_apply, _root_.mul_add, Finset.sum_add_distrib, hxd i a, hyd i a, add_zero] + smul_mem' := by + rintro r x ⟨hx,hxd⟩ + constructor + · intro i hi; simp only [Pi.smul_apply, hx i hi, smul_zero] + · intro i a + simp only [Pi.smul_apply, smul_eq_mul, mul_left_comm _ r, ← Finset.mul_sum, hxd i a, + MulZeroClass.mul_zero] + +noncomputable def topSocleMatrix (α : V) (x : I → K) (y : J → K) : + Matrix I J (Q.Zigzag K) := fun i j => (x i * y j) • vertexId Q α + +omit [Fintype V] [DecidableEq A] in +lemma topSocleMatrix_mem_homSpace (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (α : V) (c d : ℤ) {x : I → K} {y : J → K} + (hx : x ∈ coefficientTopDual Q E α c) (hy : y ∈ coefficientSocle Q F α d) : + topSocleMatrix Q α x y ∈ homSpace Q E F (d-c) (k-l-(d-c)) := by + have hs i j : x i * y j ≠ 0 → + (E.placement i).color = α ∧ (E.placement i).cochain = c ∧ + (F.placement j).color = α ∧ (F.placement j).cochain = d := by + intro h + obtain ⟨hi,hj⟩ := mul_ne_zero_iff.mp h + exact ⟨not_ne_iff.mp (fun hh => hi (hx.1 i (Or.inl hh))), + not_ne_iff.mp (fun hh => hi (hx.1 i (Or.inr hh))), + not_ne_iff.mp (fun hh => hj (hy.1 j (Or.inl hh))), + not_ne_iff.mp (fun hh => hj (hy.1 j (Or.inr hh)))⟩ + constructor + · constructor + · intro i j + by_cases hh : x i * y j = 0 + · simp only [topSocleMatrix, hh, zero_smul, MulZeroClass.mul_zero] + · rw [(hs i j hh).1] + simp only [topSocleMatrix, mul_smul, vertexId_mul_self] + · intro i j + by_cases hh : x i * y j = 0 + · simp only [topSocleMatrix, hh, zero_smul, MulZeroClass.zero_mul] + · rw [(hs i j hh).2.2.1] + simp only [topSocleMatrix, smul_mul_assoc, vertexId_mul_self] + · intro i j + by_cases hh : x i * y j = 0 + · simp only [topSocleMatrix, hh, zero_smul] + exact ⟨fun _ => trivial, ⟨fun _ => rfl, fun _ => rfl, fun _ => rfl⟩⟩ + · obtain ⟨_,hi,_,hj⟩ := hs i j hh + constructor + · intro h; exact (h (by omega)).elim + · have hl := hE i + have hk := hF j + dsimp only [GeneratorPlacement.level] at hl hk + have heq : k-l-(d-c)+(E.placement i).internal-(F.placement j).internal = 0 := by omega + rw [heq] + exact homogeneous_smul Q (homogeneous_vertexId Q α) _ + +omit [Fintype V] [DecidableEq A] in +lemma pure_differential_linear (E : BasedComplex Q (K := K) I) {l : ℤ} + (hE : ∀ i, (E.placement i).level = l) : LinearMatrix Q E.differential := + pure_homSpace_linear Q E E hE hE (by omega) ⟨E.entries,E.degree⟩ + +omit [Fintype V] [DecidableEq A] in +lemma token_sum {T : Type*} (s : Finset T) (f : T → Q.Zigzag K) : + (∑ t ∈ s, f t).token = ∑ t ∈ s, (f t).token := + map_sum ({ toFun := token + map_add' := fun _ _ => rfl + map_smul' := fun _ _ => rfl } : Q.Zigzag K →ₗ[K] (V → K)) f s + +omit [Fintype V] [DecidableEq A] [Fintype J] in +lemma differential_topSocleMatrix (E : BasedComplex Q (K := K) I) {l : ℤ} + (hE : ∀ i, (E.placement i).level = l) (α : V) (c : ℤ) + {x : I → K} (hx : x ∈ coefficientTopDual Q E α c) (y : J → K) : + E.differential * topSocleMatrix Q α x y = 0 := by + have hlin := pure_differential_linear Q E hE + apply Matrix.ext + intro i j + apply ext + · ext β + simp only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, + (hlin i _).1, Pi.zero_apply, MulZeroClass.zero_mul, Finset.sum_const_zero] + rfl + · ext a + simp only [Matrix.mul_apply, arrow_sum, Finset.sum_apply, arrow_mul, Pi.add_apply, + leftScale, rightScale, (hlin i _).1, Pi.zero_apply, MulZeroClass.zero_mul, zero_add, + topSocleMatrix, vertex_smul, Pi.smul_apply, smul_eq_mul, vertexId_eval] + by_cases ha : Q.target a = α + · simp only [ha, ← _root_.mul_assoc, ← Finset.sum_mul, hx.2 i a, + MulZeroClass.zero_mul] + rfl + · simp only [ite_eq_right ha, MulZeroClass.mul_zero, Finset.sum_const_zero] + rfl + · ext β + simp only [Matrix.mul_apply, token_sum, Finset.sum_apply, token_mul, + (hlin i _).1, (hlin i _).2, Pi.zero_apply, MulZeroClass.zero_mul, + zero_add, topSocleMatrix, arrow_smul, arrow_vertexId, smul_zero, backtrack, + Pi.zero_apply, MulZeroClass.mul_zero, ite_self, Finset.sum_const_zero] + rfl + +omit [Fintype V] [DecidableEq A] [Fintype I] in +lemma topSocleMatrix_differential (F : BasedComplex Q (K := K) J) {k : ℤ} + (hF : ∀ j, (F.placement j).level = k) (α : V) (d : ℤ) + (x : I → K) {y : J → K} (hy : y ∈ coefficientSocle Q F α d) : + topSocleMatrix Q α x y * F.differential = 0 := by + have hlin := pure_differential_linear Q F hF + apply Matrix.ext + intro i j + apply ext + · ext β + simp only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, + (hlin _ j).1, Pi.zero_apply, MulZeroClass.mul_zero, Finset.sum_const_zero] + rfl + · ext a + simp only [Matrix.mul_apply, arrow_sum, Finset.sum_apply, arrow_mul, Pi.add_apply, + leftScale, rightScale, (hlin _ j).1, Pi.zero_apply, MulZeroClass.mul_zero, add_zero, + topSocleMatrix, vertex_smul, Pi.smul_apply, smul_eq_mul, vertexId_eval] + by_cases ha : Q.source a = α + · simp only [ite_eq_left ha, _root_.mul_one, _root_.mul_assoc, ← Finset.mul_sum, hy.2 j a ha, + MulZeroClass.mul_zero] + rfl + · simp only [ite_eq_right ha, MulZeroClass.mul_zero, MulZeroClass.zero_mul, Finset.sum_const_zero] + rfl + · ext β + simp only [Matrix.mul_apply, token_sum, Finset.sum_apply, token_mul, + (hlin _ j).1, (hlin _ j).2, Pi.zero_apply, MulZeroClass.mul_zero, + zero_add, topSocleMatrix, arrow_smul, arrow_vertexId, smul_zero, backtrack, + Pi.zero_apply, MulZeroClass.zero_mul, ite_self, Finset.sum_const_zero] + rfl + +omit [Fintype V] [DecidableEq A] in +lemma topSocleMatrix_mem_homCycles (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (α : V) (c d : ℤ) {x : I → K} {y : J → K} + (hx : x ∈ coefficientTopDual Q E α c) (hy : y ∈ coefficientSocle Q F α d) : + topSocleMatrix Q α x y ∈ homCycles Q E F (d-c) (k-l-(d-c)) := by + refine ⟨topSocleMatrix_mem_homSpace Q E F hE hF α c d hx hy, ?_⟩ + change E.differential * topSocleMatrix Q α x y - + cochainSign (K := K) (d-c) • (topSocleMatrix Q α x y * F.differential) = 0 + rw [differential_topSocleMatrix Q E hE α c hx, + topSocleMatrix_differential Q F hF α d x hy, smul_zero, sub_self] + +omit [Fintype V] [DecidableEq A] [Fintype I] [Fintype J] in +lemma topSocleMatrix_ne_zero (α : V) {x : I → K} {y : J → K} + (hx : x ≠ 0) (hy : y ≠ 0) : topSocleMatrix Q α x y ≠ 0 := by + obtain ⟨i,hi⟩ : ∃ i, x i ≠ 0 := by + by_contra hn + push Not at hn + exact hx (funext hn) + obtain ⟨j,hj⟩ : ∃ j, y j ≠ 0 := by + by_contra hn + push Not at hn + exact hy (funext hn) + intro hz + have he := congrArg (fun f : Matrix I J (Q.Zigzag K) => (f i j).vertex α) hz + have h : x i * y j = 0 := by + simpa [topSocleMatrix, vertexId_eval] using he + exact (mul_ne_zero hi hj) h + +omit [DecidableEq A] in +lemma pure_top_socle_homDimension_pos (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (α : V) (c d : ℤ) (ht : coefficientTopDual Q E α c ≠ ⊥) + (hs : coefficientSocle Q F α d ≠ ⊥) : + 0 < homDimension Q E F (d-c) (k-l-(d-c)) := by + obtain ⟨x,hx,hx0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot ht + obtain ⟨y,hy,hy0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hs + let f : homCycles Q E F (d-c) (k-l-(d-c)) := + ⟨topSocleMatrix Q α x y, topSocleMatrix_mem_homCycles Q E F hE hF α c d hx hy⟩ + have hf : f ≠ 0 := fun h => topSocleMatrix_ne_zero Q α hx0 hy0 (congrArg Subtype.val h) + unfold homDimension + rw [(pureCoefficientCohomology Q E F hE hF (by omega)).finrank_eq] + exact Module.finrank_pos_iff.mpr ⟨⟨f,0,hf⟩⟩ + +omit [Fintype V] [DecidableEq A] in +lemma homDimension_le_totalHomDimension (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homDimension Q E F n v ≤ totalHomDimension Q E F (n+v) := by + classical + by_cases hv : v ∈ homInternalSupport Q E F + · unfold totalHomDimension + have h' := Finset.single_le_sum (f := fun w => homDimension Q E F (n+v-w) w) + (fun _ _ => Nat.zero_le _) hv + simpa only [add_sub_cancel_right] using h' + · rw [homDimension_off_internal_support Q E F n v hv] + exact Nat.zero_le _ + +omit [DecidableEq A] in +lemma pure_top_socle_totalHomDimension_pos (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (α : V) (c d : ℤ) (ht : coefficientTopDual Q E α c ≠ ⊥) + (hs : coefficientSocle Q F α d ≠ ⊥) : + 0 < totalHomDimension Q E F (k-l) := by + have h := lt_of_lt_of_le (pure_top_socle_homDimension_pos Q E F hE hF α c d ht hs) + (homDimension_le_totalHomDimension Q E F (d-c) (k-l-(d-c))) + convert h using 1 + congr 1 + omega + +omit [DecidableEq A] in +lemma pure_top_zero_of_socle_hom_zero (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (α : V) (c d : ℤ) (hs : coefficientSocle Q F α d ≠ ⊥) + (hh : totalHomDimension Q E F (k-l) = 0) : coefficientTopDual Q E α c = ⊥ := by + by_contra ht + have h := pure_top_socle_totalHomDimension_pos Q E F hE hF α c d ht hs + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDualRestrict.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDualRestrict.lean index 375fefa1ec54d989b7ded920a7a6e5b910e04ecb..291dd1a29fac551063d55990b0d26fb0cce4a6dc 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDualRestrict.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CoefficientTopDualRestrict.lean @@ -1,41 +1,41 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] - -lemma coefficientTopDual_restrict_layer - (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) (d:ℤ) (α:V) (c:ℤ) - {x : I → K} (hx : x ∈ coefficientTopDual Q E α c) - (hs : ∀ i, (E.placement i).level≠d → x i=0) : - (fun i : {i // (E.placement i).level=d} => x i.val) ∈ - coefficientTopDual Q (E.pureLayer Q hE d) α c := by - constructor - · intro i hi; exact hx.1 i.val hi - · intro i a - change (∑ j : {i // (E.placement i).level=d}, (E.differential i.val j.val).arrow a * x j.val)=0 - rw [← hx.2 i.val a] - apply Fintype.sum_of_injective (Subtype.val : {i // (E.placement i).level=d} → I) - Subtype.val_injective - · intro j hj - rw [hs j (fun h => hj ⟨⟨j,h⟩,rfl⟩),MulZeroClass.mul_zero] - · intro j; rfl - -lemma coefficientTopDual_restrict_layer_ne_zero - (E : BasedComplex Q (K := K) I) (d:ℤ) {x : I → K} - (hx : x≠0) (hs : ∀ i, (E.placement i).level≠d → x i=0) : - (fun i : {i // (E.placement i).level=d} => x i.val) ≠ 0 := by - intro hz - apply hx - funext i - by_cases hi : (E.placement i).level=d - · exact congrFun hz ⟨i,hi⟩ - · exact hs i hi - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] + +lemma coefficientTopDual_restrict_layer + (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) (d:ℤ) (α:V) (c:ℤ) + {x : I → K} (hx : x ∈ coefficientTopDual Q E α c) + (hs : ∀ i, (E.placement i).level≠d → x i=0) : + (fun i : {i // (E.placement i).level=d} => x i.val) ∈ + coefficientTopDual Q (E.pureLayer Q hE d) α c := by + constructor + · intro i hi; exact hx.1 i.val hi + · intro i a + change (∑ j : {i // (E.placement i).level=d}, (E.differential i.val j.val).arrow a * x j.val)=0 + rw [← hx.2 i.val a] + apply Fintype.sum_of_injective (Subtype.val : {i // (E.placement i).level=d} → I) + Subtype.val_injective + · intro j hj + rw [hs j (fun h => hj ⟨⟨j,h⟩,rfl⟩),MulZeroClass.mul_zero] + · intro j; rfl + +lemma coefficientTopDual_restrict_layer_ne_zero + (E : BasedComplex Q (K := K) I) (d:ℤ) {x : I → K} + (hx : x≠0) (hs : ∀ i, (E.placement i).level≠d → x i=0) : + (fun i : {i // (E.placement i).level=d} => x i.val) ≠ 0 := by + intro hz + apply hx + funext i + by_cases hi : (E.placement i).level=d + · exact congrFun hz ⟨i,hi⟩ + · exact hs i hi + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ColorBoundary.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ColorBoundary.lean index 5289ee9dbbd716ccb86b53e114e6bf2cb3847985..8d95535f9be6d7eb8bc7f4f1b533fe992b9251de 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ColorBoundary.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ColorBoundary.lean @@ -1,98 +1,98 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.GeneratorVector -import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual -import OAI.Topology.ArtinGroups.Complexes.BlockClosed - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type*} [Fintype I] [DecidableEq I] -attribute [local instance] Classical.decEq -attribute [local instance] Classical.propDecidable - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma pure_differential_arrow (E:BasedComplex Q (K:=K) I) {q:ℤ} - (hp:∀ i,(E.placement i).level=q) {i j:I} (hne:E.differential i j≠0) : - ∃ a:A,Q.source a=(E.placement i).color ∧ Q.target a=(E.placement j).color := by - have hl:=pure_differential_linear Q E hp i j - have ha:∃ a,(E.differential i j).arrow a≠0 := by - by_contra hn - push Not at hn - apply hne - apply ext - · exact hl.1 - · exact funext hn - · exact hl.2 - obtain ⟨a,ha⟩:=ha - exact ⟨a,coordinates_corner Q (E.entries.1 i j) (E.entries.2 i j) - (p:=.inr (.inl a)) ha⟩ - -def colorBoundary (U:Set V) : Set V := - {v | v∉U ∧ ∃ a:A,Q.source a∈U ∧ Q.target a=v} - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma pure_color_block (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) - (hp:∀ i,(E.placement i).level=q) - (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : - BlockClosed Q E {i | (E.placement i).color∈U} := by - intro i j hn - obtain ⟨a,hs,ht⟩:=pure_differential_arrow Q E hp hn - change ((E.placement i).color∈U ↔ (E.placement j).color∈U) - constructor - · intro hi - by_contra hj - exact hb j ⟨hj,a,hs ▸ hi,ht⟩ - · intro hj - by_contra hi - apply hb i - exact ⟨hi,Q.reverse a,by simpa only [Q.source_reverse,ht] using hj, - by simpa only [Q.target_reverse] using hs⟩ - -noncomputable def colorRestriction (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) - (hp:∀ i,(E.placement i).level=q) - (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : - BasedComplex Q (K:=K) {i // (E.placement i).color∈U} := - blockRestriction Q E _ (pure_color_block Q E U hp hb) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma colorRestriction_pure (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) - (hp:∀ i,(E.placement i).level=q) - (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : - ∀ i,((colorRestriction Q E U hp hb).placement i).level=q := fun i=>hp i - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma colorRestriction_supported (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) - (hp:∀ i,(E.placement i).level=q) - (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : - ∀ i,((colorRestriction Q E U hp hb).placement i).color∈U := fun i=>i.property - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma colorRestriction_generatorVector (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) - (hp:∀ i,(E.placement i).level=q) - (hb:∀ i,(E.placement i).color∉colorBoundary Q U) (v:V) : - generatorVector Q (colorRestriction Q E U hp hb) v= - if v∈U then generatorVector Q E v else 0 := by - rw [generatorVector_sum] - change (∑ i:{i // (E.placement i).color∈U}, - if (E.placement i).color=v then (1:ℝ) else 0)=_ - rw [← Finset.sum_subtype (Finset.univ.filter fun i:I=>(E.placement i).color∈U) - (by simp) (fun i:I=>if (E.placement i).color=v then (1:ℝ) else 0), - Finset.sum_filter] - split_ifs with hv - · rw [generatorVector_sum] - apply Finset.sum_congr rfl - intro i _ - by_cases he:(E.placement i).color=v - · simp only [he,hv,ite_true] - · simp only [he,ite_false,ite_self] - · apply Finset.sum_eq_zero - intro i _ - by_cases he:(E.placement i).color=v - · simp only [he,hv,ite_false] - · simp only [he,ite_false,ite_self] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.GeneratorVector +import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual +import OAI.Topology.ArtinGroups.Complexes.BlockClosed + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type*} [Fintype I] [DecidableEq I] +attribute [local instance] Classical.decEq +attribute [local instance] Classical.propDecidable + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma pure_differential_arrow (E:BasedComplex Q (K:=K) I) {q:ℤ} + (hp:∀ i,(E.placement i).level=q) {i j:I} (hne:E.differential i j≠0) : + ∃ a:A,Q.source a=(E.placement i).color ∧ Q.target a=(E.placement j).color := by + have hl:=pure_differential_linear Q E hp i j + have ha:∃ a,(E.differential i j).arrow a≠0 := by + by_contra hn + push Not at hn + apply hne + apply ext + · exact hl.1 + · exact funext hn + · exact hl.2 + obtain ⟨a,ha⟩:=ha + exact ⟨a,coordinates_corner Q (E.entries.1 i j) (E.entries.2 i j) + (p:=.inr (.inl a)) ha⟩ + +def colorBoundary (U:Set V) : Set V := + {v | v∉U ∧ ∃ a:A,Q.source a∈U ∧ Q.target a=v} + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma pure_color_block (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) + (hp:∀ i,(E.placement i).level=q) + (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : + BlockClosed Q E {i | (E.placement i).color∈U} := by + intro i j hn + obtain ⟨a,hs,ht⟩:=pure_differential_arrow Q E hp hn + change ((E.placement i).color∈U ↔ (E.placement j).color∈U) + constructor + · intro hi + by_contra hj + exact hb j ⟨hj,a,hs ▸ hi,ht⟩ + · intro hj + by_contra hi + apply hb i + exact ⟨hi,Q.reverse a,by simpa only [Q.source_reverse,ht] using hj, + by simpa only [Q.target_reverse] using hs⟩ + +noncomputable def colorRestriction (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) + (hp:∀ i,(E.placement i).level=q) + (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : + BasedComplex Q (K:=K) {i // (E.placement i).color∈U} := + blockRestriction Q E _ (pure_color_block Q E U hp hb) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma colorRestriction_pure (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) + (hp:∀ i,(E.placement i).level=q) + (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : + ∀ i,((colorRestriction Q E U hp hb).placement i).level=q := fun i=>hp i + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma colorRestriction_supported (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) + (hp:∀ i,(E.placement i).level=q) + (hb:∀ i,(E.placement i).color∉colorBoundary Q U) : + ∀ i,((colorRestriction Q E U hp hb).placement i).color∈U := fun i=>i.property + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma colorRestriction_generatorVector (E:BasedComplex Q (K:=K) I) {q:ℤ} (U:Set V) + (hp:∀ i,(E.placement i).level=q) + (hb:∀ i,(E.placement i).color∉colorBoundary Q U) (v:V) : + generatorVector Q (colorRestriction Q E U hp hb) v= + if v∈U then generatorVector Q E v else 0 := by + rw [generatorVector_sum] + change (∑ i:{i // (E.placement i).color∈U}, + if (E.placement i).color=v then (1:ℝ) else 0)=_ + rw [← Finset.sum_subtype (Finset.univ.filter fun i:I=>(E.placement i).color∈U) + (by simp) (fun i:I=>if (E.placement i).color=v then (1:ℝ) else 0), + Finset.sum_filter] + split_ifs with hv + · rw [generatorVector_sum] + apply Finset.sum_congr rfl + intro i _ + by_cases he:(E.placement i).color=v + · simp only [he,hv,ite_true] + · simp only [he,ite_false,ite_self] + · apply Finset.sum_eq_zero + intro i _ + by_cases he:(E.placement i).color=v + · simp only [he,hv,ite_false] + · simp only [he,ite_false,ite_self] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ColorReduction.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ColorReduction.lean index 7f715bb230395a0f4d6f86c46b2a4f8db4b85704..c3e9c5a6f462d5ec53eade2e22e8b43398b7be7b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ColorReduction.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ColorReduction.lean @@ -1,77 +1,77 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -lemma matrix_right_inverse_card_le {R:Matrix I J K} {S:Matrix J I K} (h:R*S=1) : - Nat.card I≤Nat.card J := by - have hi:Function.Injective R.toLinearMapRight' := by - intro x y he - have hh:=congrArg S.toLinearMapRight' he - simpa only [← Matrix.toLinearMapRight'_mul_apply,h,Matrix.toLinearMapRight'_one, - LinearMap.id_apply] using hh - have hh:=LinearMap.finrank_le_finrank_of_injective hi - simpa only [Module.finrank_fintype_fun_eq_card,Nat.card_eq_fintype_card] using hh - -omit [Fintype V] [DecidableEq A] in -lemma TermwiseSplitInjection.multiplicity_le {E:BasedComplex Q (K:=K) I} - {F:BasedComplex Q (K:=K) J} (f:TermwiseSplitInjection Q E F) (p:GeneratorPlacement V) : - multiplicity Q E p ≤ multiplicity Q F p := by - apply matrix_right_inverse_card_le (K:=K) - (R:=reductionAt Q E.placement F.placement f.inclusion.matrix p) - (S:=reductionAt Q F.placement E.placement f.retraction p) - rw [← reductionAt_mul Q _ _ _ _ _ _ f.inclusion.entries f.inclusion.degree, - f.split,reductionAt_identity] - -def colorReduction (p:I→GeneratorPlacement V) (q:J→GeneratorPlacement V) - (N:Matrix I J (Q.Zigzag K)) (α:V) : - Matrix {i//(p i).color=α} {j//(q j).color=α} K := fun i j=>(N i.val j.val).vertex α - -omit [Fintype V] [DecidableEq A] [Fintype I] in -lemma colorReduction_identity (p:I→GeneratorPlacement V) (α:V) : - colorReduction Q p p (projectiveIdentity Q (K:=K) p) α=1 := by - ext i j - by_cases h:i=j - · subst j - simp [colorReduction,projectiveIdentity,i.property] - · have h':(i:I)≠(j:I):=fun he=>h (Subtype.ext he) - simp [colorReduction,projectiveIdentity,h,h'] - -omit [Fintype V] [DecidableEq A] [Fintype I] [DecidableEq I] [DecidableEq J] in -lemma colorReduction_mul {T:Type u} [Fintype T] (p:I→GeneratorPlacement V) - (q:J→GeneratorPlacement V) (r:T→GeneratorPlacement V) - (M:Matrix I J (Q.Zigzag K)) (N:Matrix J T (Q.Zigzag K)) (α:V) - (hc:ProjectiveEntries Q p q M) : - colorReduction Q p r (M*N) α=colorReduction Q p q M α*colorReduction Q q r N α := by - apply Matrix.ext - intro i z - change (vertexHom Q (K:=K) α) ((M*N) i.val z.val)=_ - simp only [Matrix.mul_apply,map_sum,map_mul] - apply Finset.sum_congr_set {j|(q j).color=α} - · intro j hj - rfl - · intro j hj - change (M i.val j).vertex α*(N j z.val).vertex α=0 - rw [entry_vertex_right_support Q hc i.val j α (Ne.symm hj),MulZeroClass.zero_mul] - -omit [Fintype V] [DecidableEq A] in -lemma TermwiseSplitInjection.generatorVector_le {E:BasedComplex Q (K:=K) I} - {F:BasedComplex Q (K:=K) J} (f:TermwiseSplitInjection Q E F) (α:V) : - generatorVector Q E α≤generatorVector Q F α := by - have h:colorReduction Q E.placement F.placement f.inclusion.matrix α* - colorReduction Q F.placement E.placement f.retraction α=1 := by - rw [← colorReduction_mul Q _ _ _ _ _ _ f.inclusion.entries,f.split,colorReduction_identity] - have hn:=matrix_right_inverse_card_le h - unfold generatorVector - exact_mod_cast hn - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +lemma matrix_right_inverse_card_le {R:Matrix I J K} {S:Matrix J I K} (h:R*S=1) : + Nat.card I≤Nat.card J := by + have hi:Function.Injective R.toLinearMapRight' := by + intro x y he + have hh:=congrArg S.toLinearMapRight' he + simpa only [← Matrix.toLinearMapRight'_mul_apply,h,Matrix.toLinearMapRight'_one, + LinearMap.id_apply] using hh + have hh:=LinearMap.finrank_le_finrank_of_injective hi + simpa only [Module.finrank_fintype_fun_eq_card,Nat.card_eq_fintype_card] using hh + +omit [Fintype V] [DecidableEq A] in +lemma TermwiseSplitInjection.multiplicity_le {E:BasedComplex Q (K:=K) I} + {F:BasedComplex Q (K:=K) J} (f:TermwiseSplitInjection Q E F) (p:GeneratorPlacement V) : + multiplicity Q E p ≤ multiplicity Q F p := by + apply matrix_right_inverse_card_le (K:=K) + (R:=reductionAt Q E.placement F.placement f.inclusion.matrix p) + (S:=reductionAt Q F.placement E.placement f.retraction p) + rw [← reductionAt_mul Q _ _ _ _ _ _ f.inclusion.entries f.inclusion.degree, + f.split,reductionAt_identity] + +def colorReduction (p:I→GeneratorPlacement V) (q:J→GeneratorPlacement V) + (N:Matrix I J (Q.Zigzag K)) (α:V) : + Matrix {i//(p i).color=α} {j//(q j).color=α} K := fun i j=>(N i.val j.val).vertex α + +omit [Fintype V] [DecidableEq A] [Fintype I] in +lemma colorReduction_identity (p:I→GeneratorPlacement V) (α:V) : + colorReduction Q p p (projectiveIdentity Q (K:=K) p) α=1 := by + ext i j + by_cases h:i=j + · subst j + simp [colorReduction,projectiveIdentity,i.property] + · have h':(i:I)≠(j:I):=fun he=>h (Subtype.ext he) + simp [colorReduction,projectiveIdentity,h,h'] + +omit [Fintype V] [DecidableEq A] [Fintype I] [DecidableEq I] [DecidableEq J] in +lemma colorReduction_mul {T:Type u} [Fintype T] (p:I→GeneratorPlacement V) + (q:J→GeneratorPlacement V) (r:T→GeneratorPlacement V) + (M:Matrix I J (Q.Zigzag K)) (N:Matrix J T (Q.Zigzag K)) (α:V) + (hc:ProjectiveEntries Q p q M) : + colorReduction Q p r (M*N) α=colorReduction Q p q M α*colorReduction Q q r N α := by + apply Matrix.ext + intro i z + change (vertexHom Q (K:=K) α) ((M*N) i.val z.val)=_ + simp only [Matrix.mul_apply,map_sum,map_mul] + apply Finset.sum_congr_set {j|(q j).color=α} + · intro j hj + rfl + · intro j hj + change (M i.val j).vertex α*(N j z.val).vertex α=0 + rw [entry_vertex_right_support Q hc i.val j α (Ne.symm hj),MulZeroClass.zero_mul] + +omit [Fintype V] [DecidableEq A] in +lemma TermwiseSplitInjection.generatorVector_le {E:BasedComplex Q (K:=K) I} + {F:BasedComplex Q (K:=K) J} (f:TermwiseSplitInjection Q E F) (α:V) : + generatorVector Q E α≤generatorVector Q F α := by + have h:colorReduction Q E.placement F.placement f.inclusion.matrix α* + colorReduction Q F.placement E.placement f.retraction α=1 := by + rw [← colorReduction_mul Q _ _ _ _ _ _ f.inclusion.entries,f.split,colorReduction_identity] + have hn:=matrix_right_inverse_card_le h + unfold generatorVector + exact_mod_cast hn + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ColorRestrictionTopZero.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ColorRestrictionTopZero.lean index 60faff9e250a15d21628fefecc43d011d0649359..d33eea1f86763dce597e509c44e6d8e1d8c645c1 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ColorRestrictionTopZero.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ColorRestrictionTopZero.lean @@ -1,50 +1,50 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ColorBoundary - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype I] [DecidableEq I] -attribute [local instance] Classical.decEq Classical.propDecidable - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma colorRestriction_top_zero (E:BasedComplex Q (K:=K) I) (q:ℤ) (U:Set V) - (hp:∀ i,(E.placement i).level=q) - (hb:∀ i,(E.placement i).color∉colorBoundary Q U) - (α:V) (hα:α∈U) (c:ℤ) - (hz:coefficientTopDual Q (colorRestriction Q E U hp hb) α c=⊥) : - coefficientTopDual Q E α c=⊥ := by - apply eq_bot_iff.mpr - intro x hx - change x=0 - let y:{i:I // (E.placement i).color∈U}→K:=fun i=>x i - have hxo (i:I) (hi:(E.placement i).color∉U):x i=0 := by - apply hx.1 i - left - intro h - exact hi (h ▸ hα) - have hy:y∈coefficientTopDual Q (colorRestriction Q E U hp hb) α c := by - constructor - · intro i hi - exact hx.1 i hi - · intro i a - change (∑ j:{i:I //(E.placement i).color∈U},(E.differential i.val j.val).arrow a*x j.val)=0 - rw [← Finset.sum_subtype (Finset.univ.filter fun j:I=>(E.placement j).color∈U) - (by simp) (fun j:I=>(E.differential i.val j).arrow a*x j),Finset.sum_filter] - convert hx.2 i.val a using 1 - apply Finset.sum_congr rfl - intro j _ - by_cases hj:(E.placement j).color∈U - · rw [ite_eq_left hj] - · rw [ite_eq_right hj,hxo j hj,MulZeroClass.mul_zero] - rw [hz] at hy - have hy0:y=0:=(Submodule.mem_bot K).mp hy - funext i - by_cases hi:(E.placement i).color∈U - · exact congrFun hy0 ⟨i,hi⟩ - · exact hxo i hi - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ColorBoundary + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype I] [DecidableEq I] +attribute [local instance] Classical.decEq Classical.propDecidable + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma colorRestriction_top_zero (E:BasedComplex Q (K:=K) I) (q:ℤ) (U:Set V) + (hp:∀ i,(E.placement i).level=q) + (hb:∀ i,(E.placement i).color∉colorBoundary Q U) + (α:V) (hα:α∈U) (c:ℤ) + (hz:coefficientTopDual Q (colorRestriction Q E U hp hb) α c=⊥) : + coefficientTopDual Q E α c=⊥ := by + apply eq_bot_iff.mpr + intro x hx + change x=0 + let y:{i:I // (E.placement i).color∈U}→K:=fun i=>x i + have hxo (i:I) (hi:(E.placement i).color∉U):x i=0 := by + apply hx.1 i + left + intro h + exact hi (h ▸ hα) + have hy:y∈coefficientTopDual Q (colorRestriction Q E U hp hb) α c := by + constructor + · intro i hi + exact hx.1 i hi + · intro i a + change (∑ j:{i:I //(E.placement i).color∈U},(E.differential i.val j.val).arrow a*x j.val)=0 + rw [← Finset.sum_subtype (Finset.univ.filter fun j:I=>(E.placement j).color∈U) + (by simp) (fun j:I=>(E.differential i.val j).arrow a*x j),Finset.sum_filter] + convert hx.2 i.val a using 1 + apply Finset.sum_congr rfl + intro j _ + by_cases hj:(E.placement j).color∈U + · rw [ite_eq_left hj] + · rw [ite_eq_right hj,hxo j hj,MulZeroClass.mul_zero] + rw [hz] at hy + have hy0:y=0:=(Submodule.mem_bot K).mp hy + funext i + by_cases hi:(E.placement i).color∈U + · exact congrFun hy0 ⟨i,hi⟩ + · exact hxo i hi + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ColorSupport.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ColorSupport.lean index c6bcf5e55ffa33a31f35f9dcbf1cdebc82c986f9..64ece7b6144e73490d469b53114337b619a12c0e 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ColorSupport.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ColorSupport.lean @@ -1,131 +1,131 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.WordInverseModel -import OAI.Topology.ArtinGroups.Complexes.Shift - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -def ClassColorSupport (U:Set V) (x:FiniteHomotopyClass Q (K:=K)) : Prop := - ∀ i,((minimalClassModel Q x).complex.placement i).color∈U - -def ClassOutsideFloor (U:Set V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : Prop := - ∀ i,((minimalClassModel Q x).complex.placement i).color∉U→ - q≤((minimalClassModel Q x).complex.placement i).level - -lemma classNegativeTwist_outside_floor (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (α:V) (hα:α∈U) (h:ClassOutsideFloor Q U q x) : - ClassOutsideFloor Q U q (classNegativeTwist Q α x) := by - let E:=minimalClassModel Q x - let F:=E.complex.negativeTwist Q α - have hx:classOfComplex Q F=classNegativeTwist Q α x := by - change classNegativeTwist Q α (classOfComplex Q E.complex)=_ - exact congrArg (classNegativeTwist Q α) (minimalClassModel_class Q x) - rw [← hx] - apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) - ((minimalClassModelEquivalence Q F).symm Q) (fun p=>p.color∉U→q≤p.level) - intro i hi - rcases i with j|j - · exact h j hi - · exact (hi hα).elim - -lemma inverseWord_outside_floor (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (hw:∀ s∈w,s∈U) (h:ClassOutsideFloor Q U q x) : - ClassOutsideFloor Q U q (inverseWordAction Q w x) := by - induction w generalizing x with - | nil => exact h - | cons α w ih => - exact ih _ (fun s hs=>hw s (List.mem_cons_of_mem _ hs)) - (classNegativeTwist_outside_floor Q x U q α (hw α (by simp)) h) - -lemma classPositiveTwist_colorSupport (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (α:V) (hα:α∈U) (h:ClassColorSupport Q U x) : - ClassColorSupport Q U (classPositiveTwist Q α x) := by - let E:=minimalClassModel Q x - let F:=E.complex.positiveTwist Q α - have hx:classOfComplex Q F=classPositiveTwist Q α x := by - change classPositiveTwist Q α (classOfComplex Q E.complex)=_ - exact congrArg (classPositiveTwist Q α) (minimalClassModel_class Q x) - rw [← hx] - apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) - ((minimalClassModelEquivalence Q F).symm Q) (fun p=>p.color∈U) - intro i - rcases i with j|j - · exact hα - · exact h j - -lemma positiveWord_colorSupport (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (hw:∀ s∈w,s∈U) (h:ClassColorSupport Q U x) : - ClassColorSupport Q U (positiveWordAction Q w x) := by - induction w with - | nil => exact h - | cons α w ih => - exact classPositiveTwist_colorSupport Q _ U α (hw α (by simp)) - (ih (fun s hs=>hw s (List.mem_cons_of_mem _ hs))) - -lemma canonicalWordLow_colorSupport (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (hw:∀ s∈w,s∈U) (hx:ClassLowerBound Q q x) : - ClassColorSupport Q U (canonicalWordLow Q w q x) := by - apply positiveWord_colorSupport Q w _ U hw - have hf:=inverseWord_outside_floor Q w x U q hw (fun i _=>hx i) - apply minimal_bound_transport Q _ _ (minimalClassModel_minimal Q _) - ((minimalClassModelEquivalence Q - (lowerTruncation Q (minimalClassModel Q (inverseWordAction Q w x)).complex - (minimalClassModel_minimal Q _) (q-1))).symm Q) (fun p=>p.color∈U) - intro i - by_contra hi - have hh:=hf i hi - have hl:=i.property - change ((minimalClassModel Q (inverseWordAction Q w x)).complex.placement i).level≤q-1 at hl - omega - -lemma canonicalReducedWordLow_monic (hn:∀ a,Q.source a≠Q.target a) - (U:Set V) - (_hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) - (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) - (_hlo:ClassLowerBound Q q x) (_hhi:ClassUpperBound Q q x) - (w:List V) (_hw:∀ s∈w,s∈U) - (_hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : - ∃ f:Map Q (minimalClassModel Q (canonicalWordLow Q w q x)).complex (minimalClassModel Q x).complex, - ∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ - HomMonoFrom Q T.complex f := by - let E:=minimalClassModel Q (canonicalWordLow Q w q x) - let F:=minimalClassModel Q x - have he:classOfComplex Q E.complex=classOfComplex Q (canonicalLowSource Q w q x).complex := - (minimalClassModel_class Q _).trans (canonicalLowSource_class Q w q x).symm - have hf:classOfComplex Q (canonicalLowTarget Q w x).complex=classOfComplex Q F.complex := - (canonicalLowTarget_class Q hn w x).trans (minimalClassModel_class Q x).symm - obtain ⟨e⟩:=Quotient.exact he - obtain ⟨f⟩:=Quotient.exact hf - refine ⟨(e.forward.comp Q (canonicalLowMap Q w q x)).comp Q f.forward,?_⟩ - intro T hT - exact ((e.homMonoFrom Q T.complex).comp Q - (canonicalLowMap_homMono Q hn w q x T hT)).comp Q (f.homMonoFrom Q T.complex) - -theorem canonicalReducedWordLow_halfspace (hn:∀ a,Q.source a≠Q.target a) - (U:Set V) - (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) - (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) - (hlo:ClassLowerBound Q q x) (hhi:ClassUpperBound Q q x) - (w:List V) (hw:∀ s∈w,s∈U) - (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) - (Y:FiniteModel.{u} Q (K:=K)) (d:ℤ) (hY:∀ i,(Y.complex.placement i).level=d) - (hsY:∀ α∈U,∀ c,coefficientSocle Q Y.complex α c=⊥) - (hmid:totalHomDimension Q (minimalClassModel Q x).complex Y.complex (d-q+1)=0) : - (totalHomDimension Q (minimalClassModel Q x).complex Y.complex (d-q):ℝ)≤ - (generatorVector Q (minimalClassModel Q x).complex- - generatorVector Q (minimalClassModel Q (canonicalWordLow Q w q x)).complex) ⬝ᵥ - ((unfoldedCartan Q).mulVec (generatorVector Q Y.complex)) := by - obtain ⟨f,hm⟩:=canonicalReducedWordLow_monic Q hn U hU x q hlo hhi w hw hr - have hp:=canonicalReducedWordLow_pure Q hn U hU x q hlo hhi w hw hr - exact derivedSubobject_cartan_inequality Q _ _ Y.complex - (fun i=>le_antisymm (hhi i) (hlo i)) (fun i=>le_antisymm (hp.2 i) (hp.1 i)) hY f hm U - (canonicalWordLow_colorSupport Q w x U q hw hlo) hsY hmid - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.WordInverseModel +import OAI.Topology.ArtinGroups.Complexes.Shift + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +def ClassColorSupport (U:Set V) (x:FiniteHomotopyClass Q (K:=K)) : Prop := + ∀ i,((minimalClassModel Q x).complex.placement i).color∈U + +def ClassOutsideFloor (U:Set V) (q:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : Prop := + ∀ i,((minimalClassModel Q x).complex.placement i).color∉U→ + q≤((minimalClassModel Q x).complex.placement i).level + +lemma classNegativeTwist_outside_floor (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (α:V) (hα:α∈U) (h:ClassOutsideFloor Q U q x) : + ClassOutsideFloor Q U q (classNegativeTwist Q α x) := by + let E:=minimalClassModel Q x + let F:=E.complex.negativeTwist Q α + have hx:classOfComplex Q F=classNegativeTwist Q α x := by + change classNegativeTwist Q α (classOfComplex Q E.complex)=_ + exact congrArg (classNegativeTwist Q α) (minimalClassModel_class Q x) + rw [← hx] + apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) + ((minimalClassModelEquivalence Q F).symm Q) (fun p=>p.color∉U→q≤p.level) + intro i hi + rcases i with j|j + · exact h j hi + · exact (hi hα).elim + +lemma inverseWord_outside_floor (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (hw:∀ s∈w,s∈U) (h:ClassOutsideFloor Q U q x) : + ClassOutsideFloor Q U q (inverseWordAction Q w x) := by + induction w generalizing x with + | nil => exact h + | cons α w ih => + exact ih _ (fun s hs=>hw s (List.mem_cons_of_mem _ hs)) + (classNegativeTwist_outside_floor Q x U q α (hw α (by simp)) h) + +lemma classPositiveTwist_colorSupport (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (α:V) (hα:α∈U) (h:ClassColorSupport Q U x) : + ClassColorSupport Q U (classPositiveTwist Q α x) := by + let E:=minimalClassModel Q x + let F:=E.complex.positiveTwist Q α + have hx:classOfComplex Q F=classPositiveTwist Q α x := by + change classPositiveTwist Q α (classOfComplex Q E.complex)=_ + exact congrArg (classPositiveTwist Q α) (minimalClassModel_class Q x) + rw [← hx] + apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) + ((minimalClassModelEquivalence Q F).symm Q) (fun p=>p.color∈U) + intro i + rcases i with j|j + · exact hα + · exact h j + +lemma positiveWord_colorSupport (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (hw:∀ s∈w,s∈U) (h:ClassColorSupport Q U x) : + ClassColorSupport Q U (positiveWordAction Q w x) := by + induction w with + | nil => exact h + | cons α w ih => + exact classPositiveTwist_colorSupport Q _ U α (hw α (by simp)) + (ih (fun s hs=>hw s (List.mem_cons_of_mem _ hs))) + +lemma canonicalWordLow_colorSupport (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (hw:∀ s∈w,s∈U) (hx:ClassLowerBound Q q x) : + ClassColorSupport Q U (canonicalWordLow Q w q x) := by + apply positiveWord_colorSupport Q w _ U hw + have hf:=inverseWord_outside_floor Q w x U q hw (fun i _=>hx i) + apply minimal_bound_transport Q _ _ (minimalClassModel_minimal Q _) + ((minimalClassModelEquivalence Q + (lowerTruncation Q (minimalClassModel Q (inverseWordAction Q w x)).complex + (minimalClassModel_minimal Q _) (q-1))).symm Q) (fun p=>p.color∈U) + intro i + by_contra hi + have hh:=hf i hi + have hl:=i.property + change ((minimalClassModel Q (inverseWordAction Q w x)).complex.placement i).level≤q-1 at hl + omega + +lemma canonicalReducedWordLow_monic (hn:∀ a,Q.source a≠Q.target a) + (U:Set V) + (_hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) + (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) + (_hlo:ClassLowerBound Q q x) (_hhi:ClassUpperBound Q q x) + (w:List V) (_hw:∀ s∈w,s∈U) + (_hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : + ∃ f:Map Q (minimalClassModel Q (canonicalWordLow Q w q x)).complex (minimalClassModel Q x).complex, + ∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ + HomMonoFrom Q T.complex f := by + let E:=minimalClassModel Q (canonicalWordLow Q w q x) + let F:=minimalClassModel Q x + have he:classOfComplex Q E.complex=classOfComplex Q (canonicalLowSource Q w q x).complex := + (minimalClassModel_class Q _).trans (canonicalLowSource_class Q w q x).symm + have hf:classOfComplex Q (canonicalLowTarget Q w x).complex=classOfComplex Q F.complex := + (canonicalLowTarget_class Q hn w x).trans (minimalClassModel_class Q x).symm + obtain ⟨e⟩:=Quotient.exact he + obtain ⟨f⟩:=Quotient.exact hf + refine ⟨(e.forward.comp Q (canonicalLowMap Q w q x)).comp Q f.forward,?_⟩ + intro T hT + exact ((e.homMonoFrom Q T.complex).comp Q + (canonicalLowMap_homMono Q hn w q x T hT)).comp Q (f.homMonoFrom Q T.complex) + +theorem canonicalReducedWordLow_halfspace (hn:∀ a,Q.source a≠Q.target a) + (U:Set V) + (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) + (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) + (hlo:ClassLowerBound Q q x) (hhi:ClassUpperBound Q q x) + (w:List V) (hw:∀ s∈w,s∈U) + (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) + (Y:FiniteModel.{u} Q (K:=K)) (d:ℤ) (hY:∀ i,(Y.complex.placement i).level=d) + (hsY:∀ α∈U,∀ c,coefficientSocle Q Y.complex α c=⊥) + (hmid:totalHomDimension Q (minimalClassModel Q x).complex Y.complex (d-q+1)=0) : + (totalHomDimension Q (minimalClassModel Q x).complex Y.complex (d-q):ℝ)≤ + (generatorVector Q (minimalClassModel Q x).complex- + generatorVector Q (minimalClassModel Q (canonicalWordLow Q w q x)).complex) ⬝ᵥ + ((unfoldedCartan Q).mulVec (generatorVector Q Y.complex)) := by + obtain ⟨f,hm⟩:=canonicalReducedWordLow_monic Q hn U hU x q hlo hhi w hw hr + have hp:=canonicalReducedWordLow_pure Q hn U hU x q hlo hhi w hw hr + exact derivedSubobject_cartan_inequality Q _ _ Y.complex + (fun i=>le_antisymm (hhi i) (hlo i)) (fun i=>le_antisymm (hp.2 i) (hp.1 i)) hY f hm U + (canonicalWordLow_colorSupport Q w x U q hw hlo) hsY hmid + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CommuteTwistSwap.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CommuteTwistSwap.lean index 7ca75827642ca8bc9a5381c2d92d2c1db1034e62..71d4687a66a92677fd82371bc02b0476befb3350 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CommuteTwistSwap.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CommuteTwistSwap.lean @@ -1,61 +1,61 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -def commuteTwistSwap (E : BasedComplex Q (K := K) I) (α β : V) : - CommuteTwistIndex Q E α β ≃ CommuteTwistIndex Q E β α where - toFun - | .inl u => .inr (.inl u) - | .inr (.inl u) => .inl u - | .inr (.inr i) => .inr (.inr i) - invFun - | .inl u => .inr (.inl u) - | .inr (.inl u) => .inl u - | .inr (.inr i) => .inr (.inr i) - left_inv u := by rcases u with u | u | i <;> rfl - right_inv u := by rcases u with u | u | i <;> rfl - -omit [DecidableEq I] in -lemma normalizedCommuteTwist_swap (E : BasedComplex Q (K := K) I) - {α β : V} (h : OrthogonalVertices Q α β) : - (normalizedCommuteTwist Q E (h.symm Q)).reindex Q (commuteTwistSwap Q E α β) = - normalizedCommuteTwist Q E h := by - apply ext_placement_differential Q - · change (normalizedCommuteTwist Q E (h.symm Q)).placement ∘ _ = _ - rw [normalizedCommuteTwist_placement, normalizedCommuteTwist_placement] - funext i - rcases i with u | u | i <;> rfl - · change (normalizedCommuteTwist Q E (h.symm Q)).differential.submatrix _ _ = _ - rw [normalizedCommuteTwist_differential, normalizedCommuteTwist_differential] - apply Matrix.ext - intro i j - rcases i with u | u | i <;> rcases j with v | v | j <;> rfl - -noncomputable def orthogonal_positiveTwists (E : BasedComplex Q (K := K) I) - {α β : V} (h : OrthogonalVertices Q α β) : - HomotopyEquivalence Q ((E.positiveTwist Q β).positiveTwist Q α) - ((E.positiveTwist Q α).positiveTwist Q β) := by - classical - let f := ((E.positiveTwist Q β).positiveTwist Q α).reindexHomotopyEquivalence Q - (commuteTwistIndexEquiv Q E h) - let g := ((E.positiveTwist Q α).positiveTwist Q β).reindexHomotopyEquivalence Q - (commuteTwistIndexEquiv Q E (h.symm Q)) - let k := (normalizedCommuteTwist Q E (h.symm Q)).reindexHomotopyEquivalence Q - (commuteTwistSwap Q E α β) - have k' : HomotopyEquivalence Q (normalizedCommuteTwist Q E (h.symm Q)) - (normalizedCommuteTwist Q E h) := by - rw [← normalizedCommuteTwist_swap Q E h] - exact k - exact (f.trans Q (k'.symm Q)).trans Q (g.symm Q) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +def commuteTwistSwap (E : BasedComplex Q (K := K) I) (α β : V) : + CommuteTwistIndex Q E α β ≃ CommuteTwistIndex Q E β α where + toFun + | .inl u => .inr (.inl u) + | .inr (.inl u) => .inl u + | .inr (.inr i) => .inr (.inr i) + invFun + | .inl u => .inr (.inl u) + | .inr (.inl u) => .inl u + | .inr (.inr i) => .inr (.inr i) + left_inv u := by rcases u with u | u | i <;> rfl + right_inv u := by rcases u with u | u | i <;> rfl + +omit [DecidableEq I] in +lemma normalizedCommuteTwist_swap (E : BasedComplex Q (K := K) I) + {α β : V} (h : OrthogonalVertices Q α β) : + (normalizedCommuteTwist Q E (h.symm Q)).reindex Q (commuteTwistSwap Q E α β) = + normalizedCommuteTwist Q E h := by + apply ext_placement_differential Q + · change (normalizedCommuteTwist Q E (h.symm Q)).placement ∘ _ = _ + rw [normalizedCommuteTwist_placement, normalizedCommuteTwist_placement] + funext i + rcases i with u | u | i <;> rfl + · change (normalizedCommuteTwist Q E (h.symm Q)).differential.submatrix _ _ = _ + rw [normalizedCommuteTwist_differential, normalizedCommuteTwist_differential] + apply Matrix.ext + intro i j + rcases i with u | u | i <;> rcases j with v | v | j <;> rfl + +noncomputable def orthogonal_positiveTwists (E : BasedComplex Q (K := K) I) + {α β : V} (h : OrthogonalVertices Q α β) : + HomotopyEquivalence Q ((E.positiveTwist Q β).positiveTwist Q α) + ((E.positiveTwist Q α).positiveTwist Q β) := by + classical + let f := ((E.positiveTwist Q β).positiveTwist Q α).reindexHomotopyEquivalence Q + (commuteTwistIndexEquiv Q E h) + let g := ((E.positiveTwist Q α).positiveTwist Q β).reindexHomotopyEquivalence Q + (commuteTwistIndexEquiv Q E (h.symm Q)) + let k := (normalizedCommuteTwist Q E (h.symm Q)).reindexHomotopyEquivalence Q + (commuteTwistSwap Q E α β) + have k' : HomotopyEquivalence Q (normalizedCommuteTwist Q E (h.symm Q)) + (normalizedCommuteTwist Q E h) := by + rw [← normalizedCommuteTwist_swap Q E h] + exact k + exact (f.trans Q (k'.symm Q)).trans Q (g.symm Q) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketLowerBound.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketLowerBound.lean index 0fd9339b61e06fafa8da6af88ded1a26621126b1..24512f2f337c51080a9a178d5f719da85980d4af 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketLowerBound.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketLowerBound.lean @@ -1,89 +1,89 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistLowerBound - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] - -theorem classOfComplex_packet_lower_bound - (E:BasedComplex Q (K:=K) I) {d:ℤ} (hE:∀ i,d≤(E.placement i).level) - (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : - ClassLowerBound Q d (classOfComplex Q (E.packetTwist Q v)) := by - suffices hh:∀ (J:Type u) [Fintype J] (v:J→V), - Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b)) → - ClassLowerBound Q d (classOfComplex Q (E.packetTwist Q v)) from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P:=fun J _=>∀ v:J→V, - Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b)) → - ClassLowerBound Q d (classOfComplex Q (E.packetTwist Q v))) _ _ _ J - · intro J L instL e ih - let:=Fintype.ofEquiv L e.symm - intro v hv - rw [classOfComplex_packet_reindex Q E v e] - exact ih (v ∘ e) (fun a b hab=>hv (fun h=>hab (e.injective h))) - · let : DecidableEq PEmpty := Classical.decEq _ - intro v hv - apply classLowerBound_of_representative Q - intro j - rcases j with u|i - · exact isEmptyElim u.1 - · exact hE i - · intro J instJ ih - let : DecidableEq J := Classical.decEq _ - let : DecidableEq (Option J) := Classical.decEq _ - intro v hv - have hv':v=fun z:Option J=>z.elim (v none) (v ∘ some) := by - funext z; cases z <;> rfl - have he:classOfComplex Q (E.packetTwist Q v)= - classPositiveTwist Q (v none) (classOfComplex Q (E.packetTwist Q (v ∘ some))) := by - conv_lhs => rw [hv'] - convert classOfComplex_packet_cons Q E (v none) (v ∘ some) (fun a=>hv (by simp)) using 1 - congr 2 - exact Subsingleton.elim _ _ - rw [he] - exact classPositiveTwist_lower_bound Q (v none) _ - (ih (v ∘ some) (fun a b hab=>hv (fun h=>hab (Option.some.inj h)))) - -theorem classPacketPerm_lower_bound - (hn:∀ a,Q.source a≠Q.target a) (v:J→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) : - ClassLowerBound Q d (classPacketPerm Q hn v hv x) := by - have he:classPacketPerm Q hn v hv x= - classOfComplex Q ((minimalClassModel Q x).complex.packetTwist Q v) := by - conv_lhs => rw [← minimalClassModel_class Q x,classPacketPerm_apply] - rw [he] - exact classOfComplex_packet_lower_bound Q _ hx v hv - -theorem classPacketPerm_bottom_socle_zero - (hn:∀ a,Q.source a≠Q.target a) (v:J→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) (a:J) (c:ℤ) : - classLayerSocleDimension Q d (v a) c (classPacketPerm Q hn v hv x)=0 := by - let : DecidableEq {b:J // b≠a} := Classical.decEq _ - let E:=minimalClassModel Q x - let vr:{b:J // b≠a}→V:=fun b=>v b.val - have hvr:Pairwise fun b b'=>OrthogonalVertices Q (vr b) (vr b') := by - intro b b' h - apply hv - intro he - exact h (Subtype.ext he) - have he:classPacketPerm Q hn v hv x= - classPositiveTwist Q (v a) (classOfComplex Q (E.complex.packetTwist Q vr)) := by - rw [← minimalClassModel_class Q x,classPacketPerm_apply, - classOfComplex_packet_reindex Q E.complex v (Equiv.optionSubtypeNe a)] - have hf:v ∘ Equiv.optionSubtypeNe a=fun z:Option {b:J // b≠a}=>z.elim (v a) vr := by - funext z; cases z <;> rfl - rw [hf,classOfComplex_packet_cons Q E.complex (v a) vr (fun b=>hv (Ne.symm b.property))] - rw [he] - exact classPositiveTwist_bottom_socle_zero Q hn (v a) _ - (classOfComplex_packet_lower_bound Q E.complex hx vr hvr) c - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistLowerBound + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] + +theorem classOfComplex_packet_lower_bound + (E:BasedComplex Q (K:=K) I) {d:ℤ} (hE:∀ i,d≤(E.placement i).level) + (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : + ClassLowerBound Q d (classOfComplex Q (E.packetTwist Q v)) := by + suffices hh:∀ (J:Type u) [Fintype J] (v:J→V), + Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b)) → + ClassLowerBound Q d (classOfComplex Q (E.packetTwist Q v)) from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P:=fun J _=>∀ v:J→V, + Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b)) → + ClassLowerBound Q d (classOfComplex Q (E.packetTwist Q v))) _ _ _ J + · intro J L instL e ih + let:=Fintype.ofEquiv L e.symm + intro v hv + rw [classOfComplex_packet_reindex Q E v e] + exact ih (v ∘ e) (fun a b hab=>hv (fun h=>hab (e.injective h))) + · let : DecidableEq PEmpty := Classical.decEq _ + intro v hv + apply classLowerBound_of_representative Q + intro j + rcases j with u|i + · exact isEmptyElim u.1 + · exact hE i + · intro J instJ ih + let : DecidableEq J := Classical.decEq _ + let : DecidableEq (Option J) := Classical.decEq _ + intro v hv + have hv':v=fun z:Option J=>z.elim (v none) (v ∘ some) := by + funext z; cases z <;> rfl + have he:classOfComplex Q (E.packetTwist Q v)= + classPositiveTwist Q (v none) (classOfComplex Q (E.packetTwist Q (v ∘ some))) := by + conv_lhs => rw [hv'] + convert classOfComplex_packet_cons Q E (v none) (v ∘ some) (fun a=>hv (by simp)) using 1 + congr 2 + exact Subsingleton.elim _ _ + rw [he] + exact classPositiveTwist_lower_bound Q (v none) _ + (ih (v ∘ some) (fun a b hab=>hv (fun h=>hab (Option.some.inj h)))) + +theorem classPacketPerm_lower_bound + (hn:∀ a,Q.source a≠Q.target a) (v:J→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) : + ClassLowerBound Q d (classPacketPerm Q hn v hv x) := by + have he:classPacketPerm Q hn v hv x= + classOfComplex Q ((minimalClassModel Q x).complex.packetTwist Q v) := by + conv_lhs => rw [← minimalClassModel_class Q x,classPacketPerm_apply] + rw [he] + exact classOfComplex_packet_lower_bound Q _ hx v hv + +theorem classPacketPerm_bottom_socle_zero + (hn:∀ a,Q.source a≠Q.target a) (v:J→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) (a:J) (c:ℤ) : + classLayerSocleDimension Q d (v a) c (classPacketPerm Q hn v hv x)=0 := by + let : DecidableEq {b:J // b≠a} := Classical.decEq _ + let E:=minimalClassModel Q x + let vr:{b:J // b≠a}→V:=fun b=>v b.val + have hvr:Pairwise fun b b'=>OrthogonalVertices Q (vr b) (vr b') := by + intro b b' h + apply hv + intro he + exact h (Subtype.ext he) + have he:classPacketPerm Q hn v hv x= + classPositiveTwist Q (v a) (classOfComplex Q (E.complex.packetTwist Q vr)) := by + rw [← minimalClassModel_class Q x,classPacketPerm_apply, + classOfComplex_packet_reindex Q E.complex v (Equiv.optionSubtypeNe a)] + have hf:v ∘ Equiv.optionSubtypeNe a=fun z:Option {b:J // b≠a}=>z.elim (v a) vr := by + funext z; cases z <;> rfl + rw [hf,classOfComplex_packet_cons Q E.complex (v a) vr (fun b=>hv (Ne.symm b.property))] + rw [he] + exact classPositiveTwist_bottom_socle_zero Q hn (v a) _ + (classOfComplex_packet_lower_bound Q E.complex hx vr hvr) c + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketPreserves.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketPreserves.lean index 0c11dbde4570924bd2eb4df62b348392afcd0387..e35ade381fc28a927e08855cc7b6ff08eeb0cfdc 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketPreserves.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ComplexPacketPreserves.lean @@ -1,73 +1,73 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModel -import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -theorem classOfComplex_packet_preserves - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] - (E:BasedComplex Q (K:=K) I) (P:FiniteHomotopyClass Q (K:=K)→Prop) - (hE:P (classOfComplex Q E)) (v:J→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (hstep:∀ a x,P x→P (classPositiveTwist Q (v a) x)) : - P (classOfComplex Q (E.packetTwist Q v)) := by - have hs:=hstep - suffices hh:∀ (J:Type u) [Fintype J] (v:J→V), - Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b))→ - (∀ a x,P x→P (classPositiveTwist Q (v a) x))→ - P (classOfComplex Q (E.packetTwist Q v)) from hh J v hv hs - intro J inst - apply Fintype.induction_empty_option (P:=fun J _=>∀ v:J→V, - Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b))→ - (∀ a x,P x→P (classPositiveTwist Q (v a) x))→ - P (classOfComplex Q (E.packetTwist Q v))) _ _ _ J - · intro J L instL e ih - let:=Fintype.ofEquiv L e.symm - intro v hv hs - rw [classOfComplex_packet_reindex Q E v e] - exact ih (v ∘ e) (fun a b hab=>hv (fun h=>hab (e.injective h))) (fun a=>hs (e a)) - · let : DecidableEq PEmpty := Classical.decEq _ - intro v hv hs - have he:classOfComplex Q (E.packetTwist Q v)=classOfComplex Q E := by - convert (classOfComplex_reindex Q _ (packetEmptyEquiv Q E v)).trans - (congrArg (classOfComplex Q) (packetEmpty_eq Q E v)) using 1 - rw [he] - exact hE - · intro J instJ ih - let : DecidableEq J := Classical.decEq _ - let : DecidableEq (Option J) := Classical.decEq _ - intro v hv hs - have hv':v=fun z:Option J=>z.elim (v none) (v ∘ some) := by - funext z; cases z <;> rfl - have he:classOfComplex Q (E.packetTwist Q v)= - classPositiveTwist Q (v none) (classOfComplex Q (E.packetTwist Q (v ∘ some))) := by - conv_lhs => rw [hv'] - convert classOfComplex_packet_cons Q E (v none) (v ∘ some) (fun a=>hv (by simp)) using 1 - congr 2 - exact Subsingleton.elim _ _ - rw [he] - exact hs none _ (ih (v ∘ some) (fun a b hab=>hv (fun h=>hab (Option.some.inj h))) - (fun a=>hs (some a))) - -theorem classPacketPerm_preserves - (hn:∀ a,Q.source a≠Q.target a) {J:Type u} [Fintype J] - (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (P:FiniteHomotopyClass Q (K:=K)→Prop) - (hstep:∀ a x,P x→P (classPositiveTwist Q (v a) x)) - (x:FiniteHomotopyClass Q (K:=K)) (hx:P x) : P (classPacketPerm Q hn v hv x) := by - have he:classPacketPerm Q hn v hv x= - classOfComplex Q ((minimalClassModel Q x).complex.packetTwist Q v) := by - conv_lhs => rw [← minimalClassModel_class Q x,classPacketPerm_apply] - rw [he] - have hxx:classOfComplex Q (minimalClassModel Q x).complex=x:=minimalClassModel_class Q x - exact classOfComplex_packet_preserves Q _ P (by rwa [hxx]) v hv hstep - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModel +import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +theorem classOfComplex_packet_preserves + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] + (E:BasedComplex Q (K:=K) I) (P:FiniteHomotopyClass Q (K:=K)→Prop) + (hE:P (classOfComplex Q E)) (v:J→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (hstep:∀ a x,P x→P (classPositiveTwist Q (v a) x)) : + P (classOfComplex Q (E.packetTwist Q v)) := by + have hs:=hstep + suffices hh:∀ (J:Type u) [Fintype J] (v:J→V), + Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b))→ + (∀ a x,P x→P (classPositiveTwist Q (v a) x))→ + P (classOfComplex Q (E.packetTwist Q v)) from hh J v hv hs + intro J inst + apply Fintype.induction_empty_option (P:=fun J _=>∀ v:J→V, + Pairwise (fun a b=>OrthogonalVertices Q (v a) (v b))→ + (∀ a x,P x→P (classPositiveTwist Q (v a) x))→ + P (classOfComplex Q (E.packetTwist Q v))) _ _ _ J + · intro J L instL e ih + let:=Fintype.ofEquiv L e.symm + intro v hv hs + rw [classOfComplex_packet_reindex Q E v e] + exact ih (v ∘ e) (fun a b hab=>hv (fun h=>hab (e.injective h))) (fun a=>hs (e a)) + · let : DecidableEq PEmpty := Classical.decEq _ + intro v hv hs + have he:classOfComplex Q (E.packetTwist Q v)=classOfComplex Q E := by + convert (classOfComplex_reindex Q _ (packetEmptyEquiv Q E v)).trans + (congrArg (classOfComplex Q) (packetEmpty_eq Q E v)) using 1 + rw [he] + exact hE + · intro J instJ ih + let : DecidableEq J := Classical.decEq _ + let : DecidableEq (Option J) := Classical.decEq _ + intro v hv hs + have hv':v=fun z:Option J=>z.elim (v none) (v ∘ some) := by + funext z; cases z <;> rfl + have he:classOfComplex Q (E.packetTwist Q v)= + classPositiveTwist Q (v none) (classOfComplex Q (E.packetTwist Q (v ∘ some))) := by + conv_lhs => rw [hv'] + convert classOfComplex_packet_cons Q E (v none) (v ∘ some) (fun a=>hv (by simp)) using 1 + congr 2 + exact Subsingleton.elim _ _ + rw [he] + exact hs none _ (ih (v ∘ some) (fun a b hab=>hv (fun h=>hab (Option.some.inj h))) + (fun a=>hs (some a))) + +theorem classPacketPerm_preserves + (hn:∀ a,Q.source a≠Q.target a) {J:Type u} [Fintype J] + (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (P:FiniteHomotopyClass Q (K:=K)→Prop) + (hstep:∀ a x,P x→P (classPositiveTwist Q (v a) x)) + (x:FiniteHomotopyClass Q (K:=K)) (hx:P x) : P (classPacketPerm Q hn v hv x) := by + have he:classPacketPerm Q hn v hv x= + classOfComplex Q ((minimalClassModel Q x).complex.packetTwist Q v) := by + conv_lhs => rw [← minimalClassModel_class Q x,classPacketPerm_apply] + rw [he] + have hxx:classOfComplex Q (minimalClassModel Q x).complex=x:=minimalClassModel_class Q x + exact classOfComplex_packet_preserves Q _ P (by rwa [hxx]) v hv hstep + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Cone.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Cone.lean index a6303d3dbf8cc6077d53a77113fc933171f30c4b..aeca79fe5dcbd4c97fc5f7ae5fe8f4d0998d03bb 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Cone.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Cone.lean @@ -1,182 +1,182 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomotopyConeMap - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -open Matrix - -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] - [DecidableEq I] [DecidableEq J] [DecidableEq L] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - {G:BasedComplex Q (K:=K) L} - -omit [Fintype V] [DecidableEq A] in -lemma cone_source_replace_backward_square (e:HomotopyEquivalence Q E G) (f:Map Q G F) : - f.matrix*projectiveIdentity Q F.placement = - e.backward.matrix*(e.forward.matrix*f.matrix)+ - (G.differential*(-(e.targetHomotopy*f.matrix))+ - (-(e.targetHomotopy*f.matrix))*F.differential) := by - have hid : f.matrix*projectiveIdentity Q F.placement=f.matrix := - mul_projectiveIdentity Q f.entries - have hid' : projectiveIdentity Q G.placement*f.matrix=f.matrix := - projectiveIdentity_mul Q f.entries - rw [hid] - simp only [Matrix.mul_neg,Matrix.neg_mul,← Matrix.mul_assoc] - rw [e.targetEquation,Matrix.add_mul] - erw [hid'] - simp only [Matrix.add_mul,Matrix.mul_assoc] - rw [← f.commute] - abel - -omit [Fintype V] [DecidableEq A] [DecidableEq J] in -lemma cone_source_replace_correction (e:HomotopyEquivalence Q E G) (f:Map Q G F) - (k:Matrix I L (Q.Zigzag K)) - (hk:k=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy) - (hkc:E.differential*k+k*G.differential=0) : - -(E.differential*(-(k*e.targetHomotopy*f.matrix)))+ - (-(e.sourceHomotopy-k*e.backward.matrix))*(e.forward.matrix*f.matrix)+ - (-(k*e.targetHomotopy*f.matrix))*F.differential = - e.forward.matrix*(-(e.targetHomotopy*f.matrix)) := by - have kc:E.differential*k=-(k*G.differential) := eq_neg_of_add_eq_zero_left hkc - have hs:G.differential*e.targetHomotopy+e.targetHomotopy*G.differential = - e.backward.matrix*e.forward.matrix-projectiveIdentity Q G.placement := by - rw [e.targetEquation] - abel - have ke:ProjectiveEntries Q E.placement G.placement k := by - rw [hk] - simpa only [sub_eq_add_neg] using projectiveEntries_add Q - (projectiveEntries_mul Q e.sourceEntries e.forward.entries) - (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) - have hid:k*projectiveIdentity Q G.placement=k := mul_projectiveIdentity Q ke - have hb : -(E.differential*(-(k*e.targetHomotopy*f.matrix)))+ - (-(k*e.targetHomotopy*f.matrix))*F.differential = - k*f.matrix-(k*e.backward.matrix)*(e.forward.matrix*f.matrix) := by - calc - _ = -(k*(G.differential*e.targetHomotopy+e.targetHomotopy*G.differential)*f.matrix) := by - simp only [Matrix.mul_neg,Matrix.neg_mul,neg_neg,← Matrix.mul_assoc] - rw [kc] - simp only [Matrix.neg_mul,Matrix.mul_add,Matrix.add_mul,Matrix.mul_assoc] - rw [← f.commute] - abel - _ = _ := by - rw [hs,Matrix.mul_sub,Matrix.sub_mul] - erw [hid] - simp only [Matrix.mul_assoc] - abel - calc - _ = (-(E.differential*(-(k*e.targetHomotopy*f.matrix)))+ - (-(k*e.targetHomotopy*f.matrix))*F.differential)+ - (-(e.sourceHomotopy-k*e.backward.matrix))*(e.forward.matrix*f.matrix) := by abel - _ = _ := by - rw [hb] - simp only [Matrix.neg_mul,Matrix.sub_mul,Matrix.mul_assoc] - calc - _ = (k-e.sourceHomotopy*e.forward.matrix)*f.matrix := by - simp only [Matrix.sub_mul,Matrix.mul_assoc] - abel - _ = _ := by - rw [hk] - simp only [Matrix.sub_mul,Matrix.mul_neg,Matrix.mul_assoc] - abel - -noncomputable def HomotopyEquivalence.coneSource (e:HomotopyEquivalence Q E G) (f:Map Q G F) : - HomotopyEquivalence Q ((e.forward.comp Q f).cone Q) (f.cone Q) := by - let g:=e.forward.comp Q f - let k:=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy - have ke:ProjectiveEntries Q E.placement G.placement k := by - simpa only [k,sub_eq_add_neg] using projectiveEntries_add Q - (projectiveEntries_mul Q e.sourceEntries e.forward.entries) - (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) - have kd:MapDegree Q E.placement G.placement (-1) 0 k := by - have h₁:=mapDegree_mul Q e.sourceDegree e.forward.degree - have h₂:=mapDegree_mul Q e.forward.degree e.targetDegree - simp only [add_zero,zero_add] at h₁ h₂ - simpa only [k,sub_eq_add_neg] using mapDegree_add Q h₁ (mapDegree_neg Q h₂) - have kc:E.differential*k+k*G.differential=0 := homotopy_coherence_closed Q e - let h:=e.sourceHomotopy-k*e.backward.matrix - have he:ProjectiveEntries Q E.placement E.placement h := by - simpa only [h,sub_eq_add_neg] using projectiveEntries_add Q e.sourceEntries - (projectiveEntries_neg Q (projectiveEntries_mul Q ke e.backward.entries)) - have hd:MapDegree Q E.placement E.placement (-1) 0 h := by - simpa only [h,sub_eq_add_neg] using mapDegree_add Q e.sourceDegree - (mapDegree_neg Q (mapDegree_mul Q kd e.backward.degree)) - have hc:E.differential*h+h*E.differential= - E.differential*e.sourceHomotopy+e.sourceHomotopy*E.differential := by - have hz:E.differential*(k*e.backward.matrix)+(k*e.backward.matrix)*E.differential=0 := by - simp only [Matrix.mul_assoc] - rw [← e.backward.commute] - simpa only [Matrix.add_mul,Matrix.mul_assoc,Matrix.zero_mul] using - congrArg (fun m=>m*e.backward.matrix) kc - dsimp only [h] - simp only [Matrix.mul_sub,Matrix.sub_mul] - calc - _ = (E.differential*e.sourceHomotopy+e.sourceHomotopy*E.differential)- - (E.differential*(k*e.backward.matrix)+(k*e.backward.matrix)*E.differential) := by abel - _ = _ := by rw [hz,sub_zero] - have pe:ProjectiveEntries Q G.placement F.placement (-(e.targetHomotopy*f.matrix)) := - projectiveEntries_neg Q (projectiveEntries_mul Q e.targetEntries f.entries) - have pd:MapDegree Q G.placement F.placement (-1) 0 (-(e.targetHomotopy*f.matrix)) := - mapDegree_neg Q (mapDegree_mul Q e.targetDegree f.degree) - let a:Map Q (g.cone Q) (f.cone Q):=g.coneMap Q f e.forward (Map.identity Q F) (by - change _=(e.forward.matrix*f.matrix)*projectiveIdentity Q F.placement - exact (mul_projectiveIdentity Q (projectiveEntries_mul Q e.forward.entries f.entries)).symm) - let b:Map Q (f.cone Q) (g.cone Q):=f.homotopyConeMap Q g e.backward (Map.identity Q F) - (-(e.targetHomotopy*f.matrix)) pe pd (cone_source_replace_backward_square Q e f) - let s:=Matrix.fromBlocks (-h) (-(k*e.targetHomotopy*f.matrix)) - (0:Matrix J I (Q.Zigzag K)) (0:Matrix J J (Q.Zigzag K)) - let t:=Matrix.fromBlocks (-e.targetHomotopy) (0:Matrix L J (Q.Zigzag K)) - (0:Matrix J L (Q.Zigzag K)) (0:Matrix J J (Q.Zigzag K)) - refine ⟨a,b,s,t,?_,?_,?_,?_,?_,?_⟩ - · exact cone_block_entries Q g g _ _ _ _ (projectiveEntries_neg Q he) - (projectiveEntries_neg Q (projectiveEntries_mul Q (projectiveEntries_mul Q ke e.targetEntries) f.entries)) - (projectiveEntries_zero Q) (projectiveEntries_zero Q) - · exact cone_block_entries Q f f _ _ _ _ (projectiveEntries_neg Q e.targetEntries) - (projectiveEntries_zero Q) (projectiveEntries_zero Q) (projectiveEntries_zero Q) - · exact cone_block_degree Q g g _ _ _ _ (-1) 0 (mapDegree_neg Q hd) - (mapDegree_neg Q (mapDegree_mul Q (mapDegree_mul Q kd e.targetDegree) f.degree)) - (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) - · exact cone_block_degree Q f f _ _ _ _ (-1) 0 (mapDegree_neg Q e.targetDegree) - (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) - · change Matrix.fromBlocks e.forward.matrix 0 0 (projectiveIdentity Q F.placement) * - Matrix.fromBlocks e.backward.matrix (-(e.targetHomotopy*f.matrix)) 0 (projectiveIdentity Q F.placement) = - projectiveIdentity Q (g.cone Q).placement+ - (Matrix.fromBlocks (-E.differential) g.matrix 0 F.differential*s+ - s*Matrix.fromBlocks (-E.differential) g.matrix 0 F.differential) - dsimp only [s] - rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, - Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] - simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add,Matrix.neg_mul,Matrix.mul_neg,neg_neg] - have hi:projectiveIdentity Q F.placement*projectiveIdentity Q F.placement= - projectiveIdentity Q F.placement := - projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=F.placement)) - erw [hi,hc,← e.sourceEquation] - simp only [neg_zero,zero_add,add_zero] - congr 1 - simpa only [h,g,Map.comp,Matrix.neg_mul,Matrix.mul_neg,neg_neg,add_assoc] using - (cone_source_replace_correction Q e f k rfl kc).symm - · change Matrix.fromBlocks e.backward.matrix (-(e.targetHomotopy*f.matrix)) 0 (projectiveIdentity Q F.placement) * - Matrix.fromBlocks e.forward.matrix 0 0 (projectiveIdentity Q F.placement) = - projectiveIdentity Q (f.cone Q).placement+ - (Matrix.fromBlocks (-G.differential) f.matrix 0 F.differential*t+ - t*Matrix.fromBlocks (-G.differential) f.matrix 0 F.differential) - dsimp only [t] - rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, - Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] - simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add,Matrix.neg_mul,Matrix.mul_neg,neg_neg] - have hi:projectiveIdentity Q F.placement*projectiveIdentity Q F.placement= - projectiveIdentity Q F.placement := - projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=F.placement)) - have hp:(e.targetHomotopy*f.matrix)*projectiveIdentity Q F.placement= - e.targetHomotopy*f.matrix := - mul_projectiveIdentity Q (projectiveEntries_mul Q e.targetEntries f.entries) - erw [hi,hp,e.targetEquation] - simp only [neg_zero,zero_add] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomotopyConeMap + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +open Matrix + +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] + [DecidableEq I] [DecidableEq J] [DecidableEq L] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + {G:BasedComplex Q (K:=K) L} + +omit [Fintype V] [DecidableEq A] in +lemma cone_source_replace_backward_square (e:HomotopyEquivalence Q E G) (f:Map Q G F) : + f.matrix*projectiveIdentity Q F.placement = + e.backward.matrix*(e.forward.matrix*f.matrix)+ + (G.differential*(-(e.targetHomotopy*f.matrix))+ + (-(e.targetHomotopy*f.matrix))*F.differential) := by + have hid : f.matrix*projectiveIdentity Q F.placement=f.matrix := + mul_projectiveIdentity Q f.entries + have hid' : projectiveIdentity Q G.placement*f.matrix=f.matrix := + projectiveIdentity_mul Q f.entries + rw [hid] + simp only [Matrix.mul_neg,Matrix.neg_mul,← Matrix.mul_assoc] + rw [e.targetEquation,Matrix.add_mul] + erw [hid'] + simp only [Matrix.add_mul,Matrix.mul_assoc] + rw [← f.commute] + abel + +omit [Fintype V] [DecidableEq A] [DecidableEq J] in +lemma cone_source_replace_correction (e:HomotopyEquivalence Q E G) (f:Map Q G F) + (k:Matrix I L (Q.Zigzag K)) + (hk:k=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy) + (hkc:E.differential*k+k*G.differential=0) : + -(E.differential*(-(k*e.targetHomotopy*f.matrix)))+ + (-(e.sourceHomotopy-k*e.backward.matrix))*(e.forward.matrix*f.matrix)+ + (-(k*e.targetHomotopy*f.matrix))*F.differential = + e.forward.matrix*(-(e.targetHomotopy*f.matrix)) := by + have kc:E.differential*k=-(k*G.differential) := eq_neg_of_add_eq_zero_left hkc + have hs:G.differential*e.targetHomotopy+e.targetHomotopy*G.differential = + e.backward.matrix*e.forward.matrix-projectiveIdentity Q G.placement := by + rw [e.targetEquation] + abel + have ke:ProjectiveEntries Q E.placement G.placement k := by + rw [hk] + simpa only [sub_eq_add_neg] using projectiveEntries_add Q + (projectiveEntries_mul Q e.sourceEntries e.forward.entries) + (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) + have hid:k*projectiveIdentity Q G.placement=k := mul_projectiveIdentity Q ke + have hb : -(E.differential*(-(k*e.targetHomotopy*f.matrix)))+ + (-(k*e.targetHomotopy*f.matrix))*F.differential = + k*f.matrix-(k*e.backward.matrix)*(e.forward.matrix*f.matrix) := by + calc + _ = -(k*(G.differential*e.targetHomotopy+e.targetHomotopy*G.differential)*f.matrix) := by + simp only [Matrix.mul_neg,Matrix.neg_mul,neg_neg,← Matrix.mul_assoc] + rw [kc] + simp only [Matrix.neg_mul,Matrix.mul_add,Matrix.add_mul,Matrix.mul_assoc] + rw [← f.commute] + abel + _ = _ := by + rw [hs,Matrix.mul_sub,Matrix.sub_mul] + erw [hid] + simp only [Matrix.mul_assoc] + abel + calc + _ = (-(E.differential*(-(k*e.targetHomotopy*f.matrix)))+ + (-(k*e.targetHomotopy*f.matrix))*F.differential)+ + (-(e.sourceHomotopy-k*e.backward.matrix))*(e.forward.matrix*f.matrix) := by abel + _ = _ := by + rw [hb] + simp only [Matrix.neg_mul,Matrix.sub_mul,Matrix.mul_assoc] + calc + _ = (k-e.sourceHomotopy*e.forward.matrix)*f.matrix := by + simp only [Matrix.sub_mul,Matrix.mul_assoc] + abel + _ = _ := by + rw [hk] + simp only [Matrix.sub_mul,Matrix.mul_neg,Matrix.mul_assoc] + abel + +noncomputable def HomotopyEquivalence.coneSource (e:HomotopyEquivalence Q E G) (f:Map Q G F) : + HomotopyEquivalence Q ((e.forward.comp Q f).cone Q) (f.cone Q) := by + let g:=e.forward.comp Q f + let k:=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy + have ke:ProjectiveEntries Q E.placement G.placement k := by + simpa only [k,sub_eq_add_neg] using projectiveEntries_add Q + (projectiveEntries_mul Q e.sourceEntries e.forward.entries) + (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) + have kd:MapDegree Q E.placement G.placement (-1) 0 k := by + have h₁:=mapDegree_mul Q e.sourceDegree e.forward.degree + have h₂:=mapDegree_mul Q e.forward.degree e.targetDegree + simp only [add_zero,zero_add] at h₁ h₂ + simpa only [k,sub_eq_add_neg] using mapDegree_add Q h₁ (mapDegree_neg Q h₂) + have kc:E.differential*k+k*G.differential=0 := homotopy_coherence_closed Q e + let h:=e.sourceHomotopy-k*e.backward.matrix + have he:ProjectiveEntries Q E.placement E.placement h := by + simpa only [h,sub_eq_add_neg] using projectiveEntries_add Q e.sourceEntries + (projectiveEntries_neg Q (projectiveEntries_mul Q ke e.backward.entries)) + have hd:MapDegree Q E.placement E.placement (-1) 0 h := by + simpa only [h,sub_eq_add_neg] using mapDegree_add Q e.sourceDegree + (mapDegree_neg Q (mapDegree_mul Q kd e.backward.degree)) + have hc:E.differential*h+h*E.differential= + E.differential*e.sourceHomotopy+e.sourceHomotopy*E.differential := by + have hz:E.differential*(k*e.backward.matrix)+(k*e.backward.matrix)*E.differential=0 := by + simp only [Matrix.mul_assoc] + rw [← e.backward.commute] + simpa only [Matrix.add_mul,Matrix.mul_assoc,Matrix.zero_mul] using + congrArg (fun m=>m*e.backward.matrix) kc + dsimp only [h] + simp only [Matrix.mul_sub,Matrix.sub_mul] + calc + _ = (E.differential*e.sourceHomotopy+e.sourceHomotopy*E.differential)- + (E.differential*(k*e.backward.matrix)+(k*e.backward.matrix)*E.differential) := by abel + _ = _ := by rw [hz,sub_zero] + have pe:ProjectiveEntries Q G.placement F.placement (-(e.targetHomotopy*f.matrix)) := + projectiveEntries_neg Q (projectiveEntries_mul Q e.targetEntries f.entries) + have pd:MapDegree Q G.placement F.placement (-1) 0 (-(e.targetHomotopy*f.matrix)) := + mapDegree_neg Q (mapDegree_mul Q e.targetDegree f.degree) + let a:Map Q (g.cone Q) (f.cone Q):=g.coneMap Q f e.forward (Map.identity Q F) (by + change _=(e.forward.matrix*f.matrix)*projectiveIdentity Q F.placement + exact (mul_projectiveIdentity Q (projectiveEntries_mul Q e.forward.entries f.entries)).symm) + let b:Map Q (f.cone Q) (g.cone Q):=f.homotopyConeMap Q g e.backward (Map.identity Q F) + (-(e.targetHomotopy*f.matrix)) pe pd (cone_source_replace_backward_square Q e f) + let s:=Matrix.fromBlocks (-h) (-(k*e.targetHomotopy*f.matrix)) + (0:Matrix J I (Q.Zigzag K)) (0:Matrix J J (Q.Zigzag K)) + let t:=Matrix.fromBlocks (-e.targetHomotopy) (0:Matrix L J (Q.Zigzag K)) + (0:Matrix J L (Q.Zigzag K)) (0:Matrix J J (Q.Zigzag K)) + refine ⟨a,b,s,t,?_,?_,?_,?_,?_,?_⟩ + · exact cone_block_entries Q g g _ _ _ _ (projectiveEntries_neg Q he) + (projectiveEntries_neg Q (projectiveEntries_mul Q (projectiveEntries_mul Q ke e.targetEntries) f.entries)) + (projectiveEntries_zero Q) (projectiveEntries_zero Q) + · exact cone_block_entries Q f f _ _ _ _ (projectiveEntries_neg Q e.targetEntries) + (projectiveEntries_zero Q) (projectiveEntries_zero Q) (projectiveEntries_zero Q) + · exact cone_block_degree Q g g _ _ _ _ (-1) 0 (mapDegree_neg Q hd) + (mapDegree_neg Q (mapDegree_mul Q (mapDegree_mul Q kd e.targetDegree) f.degree)) + (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) + · exact cone_block_degree Q f f _ _ _ _ (-1) 0 (mapDegree_neg Q e.targetDegree) + (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) + · change Matrix.fromBlocks e.forward.matrix 0 0 (projectiveIdentity Q F.placement) * + Matrix.fromBlocks e.backward.matrix (-(e.targetHomotopy*f.matrix)) 0 (projectiveIdentity Q F.placement) = + projectiveIdentity Q (g.cone Q).placement+ + (Matrix.fromBlocks (-E.differential) g.matrix 0 F.differential*s+ + s*Matrix.fromBlocks (-E.differential) g.matrix 0 F.differential) + dsimp only [s] + rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, + Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] + simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add,Matrix.neg_mul,Matrix.mul_neg,neg_neg] + have hi:projectiveIdentity Q F.placement*projectiveIdentity Q F.placement= + projectiveIdentity Q F.placement := + projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=F.placement)) + erw [hi,hc,← e.sourceEquation] + simp only [neg_zero,zero_add,add_zero] + congr 1 + simpa only [h,g,Map.comp,Matrix.neg_mul,Matrix.mul_neg,neg_neg,add_assoc] using + (cone_source_replace_correction Q e f k rfl kc).symm + · change Matrix.fromBlocks e.backward.matrix (-(e.targetHomotopy*f.matrix)) 0 (projectiveIdentity Q F.placement) * + Matrix.fromBlocks e.forward.matrix 0 0 (projectiveIdentity Q F.placement) = + projectiveIdentity Q (f.cone Q).placement+ + (Matrix.fromBlocks (-G.differential) f.matrix 0 F.differential*t+ + t*Matrix.fromBlocks (-G.differential) f.matrix 0 F.differential) + dsimp only [t] + rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, + Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] + simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add,Matrix.neg_mul,Matrix.mul_neg,neg_neg] + have hi:projectiveIdentity Q F.placement*projectiveIdentity Q F.placement= + projectiveIdentity Q F.placement := + projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=F.placement)) + have hp:(e.targetHomotopy*f.matrix)*projectiveIdentity Q F.placement= + e.targetHomotopy*f.matrix := + mul_projectiveIdentity Q (projectiveEntries_mul Q e.targetEntries f.entries) + erw [hi,hp,e.targetEquation] + simp only [neg_zero,zero_add] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Cone2.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Cone2.lean index a386bd369baf08f69f40f6785a68f6f1bdb0a5de..8386c33732ccdbbfbf0454f9f64aab220fb75ee2 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Cone2.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Cone2.lean @@ -1,65 +1,65 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveWordActionAppend -import OAI.Topology.ArtinGroups.Complexes.LayerConeEquivalence -import OAI.Topology.ArtinGroups.Complexes.PositiveConeIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -def ClassCone (x y z:FiniteHomotopyClass Q (K:=K)) : Prop := - ∃ E F:FiniteModel Q (K:=K), ∃ f:Map Q E.complex F.complex, - classOfComplex Q E.complex=x ∧ classOfComplex Q F.complex=y ∧ - classOfComplex Q (f.cone Q)=z - -omit [Fintype V] [DecidableEq A] in -lemma ClassCone.ofMap {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} (f:Map Q E F) : - ClassCone Q (classOfComplex Q E) (classOfComplex Q F) (classOfComplex Q (f.cone Q)) := - ⟨FiniteModel.ofComplex Q E,FiniteModel.ofComplex Q F,f,rfl,rfl,rfl⟩ - -lemma ClassCone.positive {x y z:FiniteHomotopyClass Q (K:=K)} (h:ClassCone Q x y z) (α:V) : - ClassCone Q (classPositiveTwist Q α x) (classPositiveTwist Q α y) (classPositiveTwist Q α z) := by - obtain ⟨E,F,f,rfl,rfl,rfl⟩:=h - refine ⟨FiniteModel.ofComplex Q (E.complex.positiveTwist Q α), - FiniteModel.ofComplex Q (F.complex.positiveTwist Q α),f.positiveTwist Q α,rfl,rfl,?_⟩ - have coneIso : ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) - ((f.positiveTwist Q α).cone Q) := by - convert positiveTwistCone Q f α using 1 - exact (classOfComplex_eq Q (coneIso.toHomotopyEquivalence Q)).symm - -lemma ClassCone.positiveWord {x y z:FiniteHomotopyClass Q (K:=K)} - (h:ClassCone Q x y z) (w:List V) : - ClassCone Q (positiveWordAction Q w x) (positiveWordAction Q w y) (positiveWordAction Q w z) := by - induction w with - | nil=>exact h - | cons α w ih=>exact ih.positive Q α - -lemma ClassCone.packet {x y z:FiniteHomotopyClass Q (K:=K)} - (h:ClassCone Q x y z) (hn:∀ a,Q.source a≠Q.target a) - {P:Type u} [Fintype P] (v:P→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : - ClassCone Q (classPacketPerm Q hn v hv x) (classPacketPerm Q hn v hv y) - (classPacketPerm Q hn v hv z) := by - obtain ⟨w,_,hw⟩:=classPacketPerm_positiveWord Q (K:=K) hn v hv - simpa only [hw] using h.positiveWord Q w - -omit [Fintype V] [DecidableEq A] in -lemma ClassCone.layer_eq {x y z:FiniteHomotopyClass Q (K:=K)} - (h:ClassCone Q x y z) (q:ℤ) - (hz:∀ i,((minimalClassModel Q z).complex.placement i).level≠q-1 ∧ - ((minimalClassModel Q z).complex.placement i).level≠q) : - classLayer Q q x=classLayer Q q y := by - obtain ⟨E,F,f,hE,hF,hz'⟩:=h - have he:classOfComplex Q (f.cone Q)=classOfComplex Q (minimalClassModel Q z).complex:= - hz'.trans (minimalClassModel_class Q z).symm - obtain ⟨e⟩:=Quotient.exact he - rw [← hE,← hF] - exact classLayer_eq_of_cone_equivalence Q f _ e q hz - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveWordActionAppend +import OAI.Topology.ArtinGroups.Complexes.LayerConeEquivalence +import OAI.Topology.ArtinGroups.Complexes.PositiveConeIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +def ClassCone (x y z:FiniteHomotopyClass Q (K:=K)) : Prop := + ∃ E F:FiniteModel Q (K:=K), ∃ f:Map Q E.complex F.complex, + classOfComplex Q E.complex=x ∧ classOfComplex Q F.complex=y ∧ + classOfComplex Q (f.cone Q)=z + +omit [Fintype V] [DecidableEq A] in +lemma ClassCone.ofMap {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} (f:Map Q E F) : + ClassCone Q (classOfComplex Q E) (classOfComplex Q F) (classOfComplex Q (f.cone Q)) := + ⟨FiniteModel.ofComplex Q E,FiniteModel.ofComplex Q F,f,rfl,rfl,rfl⟩ + +lemma ClassCone.positive {x y z:FiniteHomotopyClass Q (K:=K)} (h:ClassCone Q x y z) (α:V) : + ClassCone Q (classPositiveTwist Q α x) (classPositiveTwist Q α y) (classPositiveTwist Q α z) := by + obtain ⟨E,F,f,rfl,rfl,rfl⟩:=h + refine ⟨FiniteModel.ofComplex Q (E.complex.positiveTwist Q α), + FiniteModel.ofComplex Q (F.complex.positiveTwist Q α),f.positiveTwist Q α,rfl,rfl,?_⟩ + have coneIso : ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) + ((f.positiveTwist Q α).cone Q) := by + convert positiveTwistCone Q f α using 1 + exact (classOfComplex_eq Q (coneIso.toHomotopyEquivalence Q)).symm + +lemma ClassCone.positiveWord {x y z:FiniteHomotopyClass Q (K:=K)} + (h:ClassCone Q x y z) (w:List V) : + ClassCone Q (positiveWordAction Q w x) (positiveWordAction Q w y) (positiveWordAction Q w z) := by + induction w with + | nil=>exact h + | cons α w ih=>exact ih.positive Q α + +lemma ClassCone.packet {x y z:FiniteHomotopyClass Q (K:=K)} + (h:ClassCone Q x y z) (hn:∀ a,Q.source a≠Q.target a) + {P:Type u} [Fintype P] (v:P→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : + ClassCone Q (classPacketPerm Q hn v hv x) (classPacketPerm Q hn v hv y) + (classPacketPerm Q hn v hv z) := by + obtain ⟨w,_,hw⟩:=classPacketPerm_positiveWord Q (K:=K) hn v hv + simpa only [hw] using h.positiveWord Q w + +omit [Fintype V] [DecidableEq A] in +lemma ClassCone.layer_eq {x y z:FiniteHomotopyClass Q (K:=K)} + (h:ClassCone Q x y z) (q:ℤ) + (hz:∀ i,((minimalClassModel Q z).complex.placement i).level≠q-1 ∧ + ((minimalClassModel Q z).complex.placement i).level≠q) : + classLayer Q q x=classLayer Q q y := by + obtain ⟨E,F,f,hE,hF,hz'⟩:=h + have he:classOfComplex Q (f.cone Q)=classOfComplex Q (minimalClassModel Q z).complex:= + hz'.trans (minimalClassModel_class Q z).symm + obtain ⟨e⟩:=Quotient.exact he + rw [← hE,← hF] + exact classLayer_eq_of_cone_equivalence Q f _ e q hz + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ConeMap.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ConeMap.lean index 29cfc6662431d2462e3435cf8984e81b25cabb71..f147fc735ae40b25e25bdfcdd04bf7996d6a4789 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ConeMap.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ConeMap.lean @@ -1,129 +1,129 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.CoconePlacement -import OAI.Topology.ArtinGroups.Quivers.TestTransform - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.Map - -variable {V A K I J L N : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [Fintype L] [Fintype N] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - {G : BasedComplex Q (K := K) L} {H : BasedComplex Q (K := K) N} - -lemma coneMap_entries (f : Map Q E F) (g : Map Q G H) - (a : Map Q E G) (b : Map Q F H) : - ProjectiveEntries Q (f.conePlacement Q) (g.conePlacement Q) - (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by - constructor - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact a.entries.1 i j - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact b.entries.1 i j - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact a.entries.2 i j - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact b.entries.2 i j - -lemma coneMap_degree (f : Map Q E F) (g : Map Q G H) - (a : Map Q E G) (b : Map Q F H) : - MapDegree Q (f.conePlacement Q) (g.conePlacement Q) 0 0 - (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by - intro i j - rcases i with i | i <;> rcases j with j | j - · constructor - · intro hc - apply (a.degree i j).1 - intro he - apply hc - dsimp only [conePlacement] - omega - · exact (a.degree i j).2 - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact b.degree i j - -noncomputable def coneMap (f : Map Q E F) (g : Map Q G H) - (a : Map Q E G) (b : Map Q F H) - (comm : a.matrix * g.matrix = f.matrix * b.matrix) : - Map Q (f.cone Q) (g.cone Q) where - matrix := Matrix.fromBlocks a.matrix 0 0 b.matrix - entries := coneMap_entries Q f g a b - degree := coneMap_degree Q f g a b - commute := by - change f.coneDifferential Q * _ = _ * g.coneDifferential Q - unfold coneDifferential - rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply] - simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_zero, Matrix.zero_mul, - zero_add, add_zero, neg_zero, a.commute, b.commute, comm] - -lemma coconeMap_entries (f : Map Q E F) (g : Map Q G H) - (a : Map Q E G) (b : Map Q F H) : - ProjectiveEntries Q (f.coconePlacement Q) (g.coconePlacement Q) - (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by - constructor - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact a.entries.1 i j - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact b.entries.1 i j - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact a.entries.2 i j - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact b.entries.2 i j - -lemma coconeMap_degree (f : Map Q E F) (g : Map Q G H) - (a : Map Q E G) (b : Map Q F H) : - MapDegree Q (f.coconePlacement Q) (g.coconePlacement Q) 0 0 - (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by - intro i j - rcases i with i | i <;> rcases j with j | j - · exact a.degree i j - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · constructor - · intro hc - apply (b.degree i j).1 - intro he - apply hc - dsimp only [coconePlacement] - omega - · exact (b.degree i j).2 - -noncomputable def coconeMap (f : Map Q E F) (g : Map Q G H) - (a : Map Q E G) (b : Map Q F H) - (comm : a.matrix * g.matrix = f.matrix * b.matrix) : - Map Q (f.cocone Q) (g.cocone Q) where - matrix := Matrix.fromBlocks a.matrix 0 0 b.matrix - entries := coconeMap_entries Q f g a b - degree := coconeMap_degree Q f g a b - commute := by - change f.coconeDifferential Q * _ = _ * g.coconeDifferential Q - unfold coconeDifferential - rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply] - simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_zero, Matrix.zero_mul, - zero_add, add_zero, neg_zero, a.commute, b.commute, comm] - -variable [Fintype V] [DecidableEq A] - -noncomputable def positiveTwist (f : Map Q E F) (α : V) : - Map Q (E.positiveTwist Q α) (F.positiveTwist Q α) := - coneMap Q (E.evaluation Q α) (F.evaluation Q α) (f.test Q α) f - (evaluation_natural Q α f.entries) - -noncomputable def negativeTwist (f : Map Q E F) (α : V) : - Map Q (E.negativeTwist Q α) (F.negativeTwist Q α) := - coconeMap Q (E.coevaluation Q α) (F.coevaluation Q α) f (f.cotest Q α) - (coevaluation_natural Q α f.entries).symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.Map - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.CoconePlacement +import OAI.Topology.ArtinGroups.Quivers.TestTransform + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.Map + +variable {V A K I J L N : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [Fintype L] [Fintype N] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + {G : BasedComplex Q (K := K) L} {H : BasedComplex Q (K := K) N} + +lemma coneMap_entries (f : Map Q E F) (g : Map Q G H) + (a : Map Q E G) (b : Map Q F H) : + ProjectiveEntries Q (f.conePlacement Q) (g.conePlacement Q) + (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by + constructor + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact a.entries.1 i j + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact b.entries.1 i j + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact a.entries.2 i j + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact b.entries.2 i j + +lemma coneMap_degree (f : Map Q E F) (g : Map Q G H) + (a : Map Q E G) (b : Map Q F H) : + MapDegree Q (f.conePlacement Q) (g.conePlacement Q) 0 0 + (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by + intro i j + rcases i with i | i <;> rcases j with j | j + · constructor + · intro hc + apply (a.degree i j).1 + intro he + apply hc + dsimp only [conePlacement] + omega + · exact (a.degree i j).2 + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact b.degree i j + +noncomputable def coneMap (f : Map Q E F) (g : Map Q G H) + (a : Map Q E G) (b : Map Q F H) + (comm : a.matrix * g.matrix = f.matrix * b.matrix) : + Map Q (f.cone Q) (g.cone Q) where + matrix := Matrix.fromBlocks a.matrix 0 0 b.matrix + entries := coneMap_entries Q f g a b + degree := coneMap_degree Q f g a b + commute := by + change f.coneDifferential Q * _ = _ * g.coneDifferential Q + unfold coneDifferential + rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply] + simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_zero, Matrix.zero_mul, + zero_add, add_zero, neg_zero, a.commute, b.commute, comm] + +lemma coconeMap_entries (f : Map Q E F) (g : Map Q G H) + (a : Map Q E G) (b : Map Q F H) : + ProjectiveEntries Q (f.coconePlacement Q) (g.coconePlacement Q) + (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by + constructor + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact a.entries.1 i j + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact b.entries.1 i j + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact a.entries.2 i j + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact b.entries.2 i j + +lemma coconeMap_degree (f : Map Q E F) (g : Map Q G H) + (a : Map Q E G) (b : Map Q F H) : + MapDegree Q (f.coconePlacement Q) (g.coconePlacement Q) 0 0 + (Matrix.fromBlocks a.matrix 0 0 b.matrix) := by + intro i j + rcases i with i | i <;> rcases j with j | j + · exact a.degree i j + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · constructor + · intro hc + apply (b.degree i j).1 + intro he + apply hc + dsimp only [coconePlacement] + omega + · exact (b.degree i j).2 + +noncomputable def coconeMap (f : Map Q E F) (g : Map Q G H) + (a : Map Q E G) (b : Map Q F H) + (comm : a.matrix * g.matrix = f.matrix * b.matrix) : + Map Q (f.cocone Q) (g.cocone Q) where + matrix := Matrix.fromBlocks a.matrix 0 0 b.matrix + entries := coconeMap_entries Q f g a b + degree := coconeMap_degree Q f g a b + commute := by + change f.coconeDifferential Q * _ = _ * g.coconeDifferential Q + unfold coconeDifferential + rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply] + simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_zero, Matrix.zero_mul, + zero_add, add_zero, neg_zero, a.commute, b.commute, comm] + +variable [Fintype V] [DecidableEq A] + +noncomputable def positiveTwist (f : Map Q E F) (α : V) : + Map Q (E.positiveTwist Q α) (F.positiveTwist Q α) := + coneMap Q (E.evaluation Q α) (F.evaluation Q α) (f.test Q α) f + (evaluation_natural Q α f.entries) + +noncomputable def negativeTwist (f : Map Q E F) (α : V) : + Map Q (E.negativeTwist Q α) (F.negativeTwist Q α) := + coconeMap Q (E.coevaluation Q α) (F.coevaluation Q α) f (f.cotest Q α) + (coevaluation_natural Q α f.entries).symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.Map + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ConePlacement.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ConePlacement.lean index 79491b02da2a0ceeab3666b80e0183be799c10a7..d5a52a4def70c0fd11c36c00af028defe3fce0db 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ConePlacement.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ConePlacement.lean @@ -1,82 +1,82 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.SmulMul - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - -namespace Map - -def conePlacement (_f : Map Q E F) : I ⊕ J → GeneratorPlacement V - | .inl i => ⟨(E.placement i).color, (E.placement i).cochain - 1, - (E.placement i).internal⟩ - | .inr j => F.placement j - -noncomputable def coneDifferential (f : Map Q E F) : Matrix (I ⊕ J) (I ⊕ J) (Q.Zigzag K) := - Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential - -lemma cone_entries (f : Map Q E F) : - ProjectiveEntries Q (f.conePlacement Q) (f.conePlacement Q) (f.coneDifferential Q) := by - constructor - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact (projectiveEntries_neg Q E.entries).1 i j - · exact f.entries.1 i j - · exact MulZeroClass.mul_zero _ - · exact F.entries.1 i j - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact (projectiveEntries_neg Q E.entries).2 i j - · exact f.entries.2 i j - · exact MulZeroClass.zero_mul _ - · exact F.entries.2 i j - -lemma cone_degree (f : Map Q E F) : - MapDegree Q (f.conePlacement Q) (f.conePlacement Q) 1 0 (f.coneDifferential Q) := by - intro i j - rcases i with i | i <;> rcases j with j | j - · constructor - · intro hc - have hd : (E.placement j).cochain ≠ (E.placement i).cochain + 1 := by - intro he - apply hc - dsimp only [conePlacement] - omega - change -E.differential i j = 0 - rw [(E.degree i j).1 hd, neg_zero] - · exact homogeneous_neg Q (E.degree i j).2 - · constructor - · intro hc - apply (f.degree i j).1 - intro he - apply hc - dsimp only [conePlacement] - omega - · exact (f.degree i j).2 - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact F.degree i j - -lemma cone_square (f : Map Q E F) : f.coneDifferential Q * f.coneDifferential Q = 0 := by - unfold coneDifferential - rw [Matrix.fromBlocks_multiply] - simp only [Matrix.neg_mul, Matrix.mul_neg, E.square_zero, F.square_zero, - Matrix.mul_zero, Matrix.zero_mul, add_zero, f.commute, neg_add_cancel, neg_zero] - apply Matrix.ext - intro i j - rcases i with i | i <;> rcases j with j | j <;> rfl - -noncomputable def cone (f : Map Q E F) : BasedComplex Q (K := K) (I ⊕ J) where - placement := f.conePlacement Q - differential := f.coneDifferential Q - entries := f.cone_entries Q - degree := f.cone_degree Q - square_zero := f.cone_square Q - -end Map -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.SmulMul + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + +namespace Map + +def conePlacement (_f : Map Q E F) : I ⊕ J → GeneratorPlacement V + | .inl i => ⟨(E.placement i).color, (E.placement i).cochain - 1, + (E.placement i).internal⟩ + | .inr j => F.placement j + +noncomputable def coneDifferential (f : Map Q E F) : Matrix (I ⊕ J) (I ⊕ J) (Q.Zigzag K) := + Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential + +lemma cone_entries (f : Map Q E F) : + ProjectiveEntries Q (f.conePlacement Q) (f.conePlacement Q) (f.coneDifferential Q) := by + constructor + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact (projectiveEntries_neg Q E.entries).1 i j + · exact f.entries.1 i j + · exact MulZeroClass.mul_zero _ + · exact F.entries.1 i j + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact (projectiveEntries_neg Q E.entries).2 i j + · exact f.entries.2 i j + · exact MulZeroClass.zero_mul _ + · exact F.entries.2 i j + +lemma cone_degree (f : Map Q E F) : + MapDegree Q (f.conePlacement Q) (f.conePlacement Q) 1 0 (f.coneDifferential Q) := by + intro i j + rcases i with i | i <;> rcases j with j | j + · constructor + · intro hc + have hd : (E.placement j).cochain ≠ (E.placement i).cochain + 1 := by + intro he + apply hc + dsimp only [conePlacement] + omega + change -E.differential i j = 0 + rw [(E.degree i j).1 hd, neg_zero] + · exact homogeneous_neg Q (E.degree i j).2 + · constructor + · intro hc + apply (f.degree i j).1 + intro he + apply hc + dsimp only [conePlacement] + omega + · exact (f.degree i j).2 + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact F.degree i j + +lemma cone_square (f : Map Q E F) : f.coneDifferential Q * f.coneDifferential Q = 0 := by + unfold coneDifferential + rw [Matrix.fromBlocks_multiply] + simp only [Matrix.neg_mul, Matrix.mul_neg, E.square_zero, F.square_zero, + Matrix.mul_zero, Matrix.zero_mul, add_zero, f.commute, neg_add_cancel, neg_zero] + apply Matrix.ext + intro i j + rcases i with i | i <;> rcases j with j | j <;> rfl + +noncomputable def cone (f : Map Q E F) : BasedComplex Q (K := K) (I ⊕ J) where + placement := f.conePlacement Q + differential := f.coneDifferential Q + entries := f.cone_entries Q + degree := f.cone_degree Q + square_zero := f.cone_square Q + +end Map +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CornerPath.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CornerPath.lean index df6108af3b6d981fe3fa8a5369b7c4610511be0e..6b13ec45f4921797a47575071587b0be34bb2ccb 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CornerPath.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CornerPath.lean @@ -1,88 +1,88 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomPath -import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -abbrev CornerPath (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (r : ℤ) := - {t : I × J × Path V A // - Path.source Q t.2.2 = (E.placement t.1).color ∧ - Path.target Q t.2.2 = (F.placement t.2.1).color ∧ Path.length t.2.2 = r} - -noncomputable def purePathForget (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : - (Σ v : {v // v ∈ homInternalSupport Q E F}, HomPath Q E F (k-l+r-v.val) v.val) → - CornerPath Q E F r := fun x => ⟨x.2.val, x.2.property.1, x.2.property.2.1, by - have hh := x.2.property.2.2 - have he := hE x.2.val.1 - have hf := hF x.2.val.2.1 - dsimp only [GeneratorPlacement.level] at he hf - omega⟩ - -omit [Fintype V] [DecidableEq A] in -lemma purePathForget_injective (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : - Function.Injective (purePathForget Q E F hE hF r) := by - rintro ⟨⟨a,ha⟩,⟨ta,hta⟩⟩ ⟨⟨b,hb⟩,⟨tb,htb⟩⟩ hh - have ht : ta=tb := congrArg Subtype.val hh - subst tb - have hab : a=b := by - have h₁ := hta.2.2.2 - have h₂ := htb.2.2.2 - dsimp only at h₁ h₂ - omega - subst b - rfl - -omit [Fintype V] [DecidableEq A] in -lemma purePathForget_surjective (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : - Function.Surjective (purePathForget Q E F hE hF r) := by - rintro ⟨⟨i,j,p⟩,hpt⟩ - let v := (F.placement j).internal - (E.placement i).internal + Path.length p - have hv : v ∈ homInternalSupport Q E F := by - rw [mem_homInternalSupport] - rcases p with p | p | p - · exact ⟨i,j,0,rfl⟩ - · exact ⟨i,j,1,rfl⟩ - · exact ⟨i,j,2,rfl⟩ - refine ⟨⟨⟨v,hv⟩, ⟨(i,j,p),hpt.1,hpt.2.1,?_,?check⟩⟩, rfl⟩ - · have he := hE i - have hf := hF j - have hp := hpt.2.2 - dsimp only [GeneratorPlacement.level] at he hf - dsimp only at hp ⊢ - dsimp only [v] - omega - case check => - dsimp only [v] - omega - -noncomputable def purePathEquiv (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : - (Σ v : {v // v ∈ homInternalSupport Q E F}, HomPath Q E F (k-l+r-v.val) v.val) ≃ - CornerPath Q E F r := Equiv.ofBijective (purePathForget Q E F hE hF r) - ⟨purePathForget_injective Q E F hE hF r, purePathForget_surjective Q E F hE hF r⟩ - -lemma totalChainDimension_eq_card (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : - totalChainDimension Q E F (k-l+r) = Nat.card (CornerPath Q E F r) := by - classical - unfold totalChainDimension - simp_rw [homSpace_finrank, Nat.card_eq_fintype_card] - rw [← Finset.sum_coe_sort, ← Fintype.card_sigma] - exact Fintype.card_congr (purePathEquiv Q E F hE hF r) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomPath +import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +abbrev CornerPath (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (r : ℤ) := + {t : I × J × Path V A // + Path.source Q t.2.2 = (E.placement t.1).color ∧ + Path.target Q t.2.2 = (F.placement t.2.1).color ∧ Path.length t.2.2 = r} + +noncomputable def purePathForget (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : + (Σ v : {v // v ∈ homInternalSupport Q E F}, HomPath Q E F (k-l+r-v.val) v.val) → + CornerPath Q E F r := fun x => ⟨x.2.val, x.2.property.1, x.2.property.2.1, by + have hh := x.2.property.2.2 + have he := hE x.2.val.1 + have hf := hF x.2.val.2.1 + dsimp only [GeneratorPlacement.level] at he hf + omega⟩ + +omit [Fintype V] [DecidableEq A] in +lemma purePathForget_injective (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : + Function.Injective (purePathForget Q E F hE hF r) := by + rintro ⟨⟨a,ha⟩,⟨ta,hta⟩⟩ ⟨⟨b,hb⟩,⟨tb,htb⟩⟩ hh + have ht : ta=tb := congrArg Subtype.val hh + subst tb + have hab : a=b := by + have h₁ := hta.2.2.2 + have h₂ := htb.2.2.2 + dsimp only at h₁ h₂ + omega + subst b + rfl + +omit [Fintype V] [DecidableEq A] in +lemma purePathForget_surjective (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : + Function.Surjective (purePathForget Q E F hE hF r) := by + rintro ⟨⟨i,j,p⟩,hpt⟩ + let v := (F.placement j).internal - (E.placement i).internal + Path.length p + have hv : v ∈ homInternalSupport Q E F := by + rw [mem_homInternalSupport] + rcases p with p | p | p + · exact ⟨i,j,0,rfl⟩ + · exact ⟨i,j,1,rfl⟩ + · exact ⟨i,j,2,rfl⟩ + refine ⟨⟨⟨v,hv⟩, ⟨(i,j,p),hpt.1,hpt.2.1,?_,?check⟩⟩, rfl⟩ + · have he := hE i + have hf := hF j + have hp := hpt.2.2 + dsimp only [GeneratorPlacement.level] at he hf + dsimp only at hp ⊢ + dsimp only [v] + omega + case check => + dsimp only [v] + omega + +noncomputable def purePathEquiv (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : + (Σ v : {v // v ∈ homInternalSupport Q E F}, HomPath Q E F (k-l+r-v.val) v.val) ≃ + CornerPath Q E F r := Equiv.ofBijective (purePathForget Q E F hE hF r) + ⟨purePathForget_injective Q E F hE hF r, purePathForget_surjective Q E F hE hF r⟩ + +lemma totalChainDimension_eq_card (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) (r : ℤ) : + totalChainDimension Q E F (k-l+r) = Nat.card (CornerPath Q E F r) := by + classical + unfold totalChainDimension + simp_rw [homSpace_finrank, Nat.card_eq_fintype_card] + rw [← Finset.sum_coe_sort, ← Fintype.card_sigma] + exact Fintype.card_congr (purePathEquiv Q E F hE hF r) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/CorrectionBoundary.lean b/lean/OAI/Topology/ArtinGroups/Complexes/CorrectionBoundary.lean index 1746e8b7aace43c37081069bf22f230ccab4d9a9..a59a32033c0c7ecb2d21995b9daa5a9787f19879 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/CorrectionBoundary.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/CorrectionBoundary.lean @@ -1,64 +1,64 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ReindexHomOperator -import OAI.Topology.ArtinGroups.Complexes.HomSpaceMul - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J I' J' : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] - [DecidableEq I] [DecidableEq J] [DecidableEq I'] [DecidableEq J'] - -lemma HomotopyEquivalence.sourceCorrection_boundary {E : BasedComplex Q (K := K) I} - {E' : BasedComplex Q (K := K) I'} (e : HomotopyEquivalence Q E E') : - e.forward.matrix * e.backward.matrix - projectiveIdentity Q E.placement ∈ - homBoundaries Q E E 0 0 := by - apply homotopyEquation_boundary Q ⟨e.sourceEntries, e.sourceDegree⟩ - rw [e.sourceEquation] - abel - -lemma HomotopyEquivalence.sandwichCorrection_boundary {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} - {F' : BasedComplex Q (K := K) J'} - (e : HomotopyEquivalence Q E E') (f : HomotopyEquivalence Q F F') - (n v : ℤ) {g : Matrix I J (Q.Zigzag K)} (hg : g ∈ homCycles Q E F n v) : - e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - g ∈ - homBoundaries Q E F n v := by - have hl := homBoundary_mul_cycle Q (e.sourceCorrection_boundary Q) hg - have hr := homCycle_mul_boundary Q hg (f.sourceCorrection_boundary Q) - have hc := homCycles_mul Q (map_mem_homCycles Q f.forward) (map_mem_homCycles Q f.backward) - have hll := homBoundary_mul_cycle Q hl hc - simp only [zero_add, add_zero] at hll hr - have hb := (homBoundaries Q E F n v).add_mem hll hr - have heq : (e.forward.matrix * e.backward.matrix - projectiveIdentity Q E.placement) * - g * (f.forward.matrix * f.backward.matrix) + - g * (f.forward.matrix * f.backward.matrix - projectiveIdentity Q F.placement) = - e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - g := by - have hi : projectiveIdentity Q E.placement * g = g := projectiveIdentity_mul Q hg.1.1 - have hj : g * projectiveIdentity Q F.placement = g := mul_projectiveIdentity Q hg.1.1 - rw [Matrix.sub_mul, Matrix.sub_mul, Matrix.mul_sub] - erw [hi, hj] - simp only [Matrix.mul_assoc] - abel - rw [heq] at hb - exact hb - -lemma HomotopyEquivalence.sandwich_injective {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} - {F' : BasedComplex Q (K := K) J'} - (e : HomotopyEquivalence Q E E') (f : HomotopyEquivalence Q F F') (n v : ℤ) : - Function.Injective ((sandwichHomOperator Q e.backward f.forward).onCohomology n v) := by - apply HomOperator.onCohomology_injective - intro g hg hb - have hb' := (sandwichHomOperator Q e.forward f.backward).map_boundaries n v hb - have hc := e.sandwichCorrection_boundary Q f n v hg - have hd := (homBoundaries Q E F n v).sub_mem hb' hc - change e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - - (e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - g) ∈ - homBoundaries Q E F n v at hd - simpa only [sub_sub_cancel] using hd - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ReindexHomOperator +import OAI.Topology.ArtinGroups.Complexes.HomSpaceMul + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J I' J' : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] + [DecidableEq I] [DecidableEq J] [DecidableEq I'] [DecidableEq J'] + +lemma HomotopyEquivalence.sourceCorrection_boundary {E : BasedComplex Q (K := K) I} + {E' : BasedComplex Q (K := K) I'} (e : HomotopyEquivalence Q E E') : + e.forward.matrix * e.backward.matrix - projectiveIdentity Q E.placement ∈ + homBoundaries Q E E 0 0 := by + apply homotopyEquation_boundary Q ⟨e.sourceEntries, e.sourceDegree⟩ + rw [e.sourceEquation] + abel + +lemma HomotopyEquivalence.sandwichCorrection_boundary {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} + {F' : BasedComplex Q (K := K) J'} + (e : HomotopyEquivalence Q E E') (f : HomotopyEquivalence Q F F') + (n v : ℤ) {g : Matrix I J (Q.Zigzag K)} (hg : g ∈ homCycles Q E F n v) : + e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - g ∈ + homBoundaries Q E F n v := by + have hl := homBoundary_mul_cycle Q (e.sourceCorrection_boundary Q) hg + have hr := homCycle_mul_boundary Q hg (f.sourceCorrection_boundary Q) + have hc := homCycles_mul Q (map_mem_homCycles Q f.forward) (map_mem_homCycles Q f.backward) + have hll := homBoundary_mul_cycle Q hl hc + simp only [zero_add, add_zero] at hll hr + have hb := (homBoundaries Q E F n v).add_mem hll hr + have heq : (e.forward.matrix * e.backward.matrix - projectiveIdentity Q E.placement) * + g * (f.forward.matrix * f.backward.matrix) + + g * (f.forward.matrix * f.backward.matrix - projectiveIdentity Q F.placement) = + e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - g := by + have hi : projectiveIdentity Q E.placement * g = g := projectiveIdentity_mul Q hg.1.1 + have hj : g * projectiveIdentity Q F.placement = g := mul_projectiveIdentity Q hg.1.1 + rw [Matrix.sub_mul, Matrix.sub_mul, Matrix.mul_sub] + erw [hi, hj] + simp only [Matrix.mul_assoc] + abel + rw [heq] at hb + exact hb + +lemma HomotopyEquivalence.sandwich_injective {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} + {F' : BasedComplex Q (K := K) J'} + (e : HomotopyEquivalence Q E E') (f : HomotopyEquivalence Q F F') (n v : ℤ) : + Function.Injective ((sandwichHomOperator Q e.backward f.forward).onCohomology n v) := by + apply HomOperator.onCohomology_injective + intro g hg hb + have hb' := (sandwichHomOperator Q e.forward f.backward).map_boundaries n v hb + have hc := e.sandwichCorrection_boundary Q f n v hg + have hd := (homBoundaries Q E F n v).sub_mem hb' hc + change e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - + (e.forward.matrix * (e.backward.matrix * g * f.forward.matrix) * f.backward.matrix - g) ∈ + homBoundaries Q E F n v at hd + simpa only [sub_sub_cancel] using hd + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/DiagonalVertex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/DiagonalVertex.lean index 138785af75e0a8798486a7c5c18a380623b47a02..524955782e562775490ee9ce05eddc2664a67867 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/DiagonalVertex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/DiagonalVertex.lean @@ -1,182 +1,182 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Quivers.Path -import OAI.Topology.ArtinGroups.Complexes.HomSpaceMul - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] - -omit [Fintype V] in -lemma tokenBasis_mul_positive (α : V) (x : Q.Zigzag K) (hx : x.vertex = 0) : - tokenBasis Q α * x = 0 := by - apply ext - · change (tokenBasis Q α * x).vertex = 0 - rw [vertex_mul] - change (0 : V → K) * x.vertex = 0 - exact MulZeroClass.zero_mul _ - · change (tokenBasis Q α * x).arrow = 0 - rw [arrow_mul] - change Q.leftScale 0 x.arrow + Q.rightScale 0 x.vertex = 0 - ext a - simp [leftScale, rightScale] - · change (tokenBasis Q α * x).token = 0 - rw [token_mul] - change (0 : V → K) * x.token + (Pi.single α (1 : K)) * x.vertex + Q.backtrack 0 x.arrow = 0 - rw [hx] - ext a - simp - -omit [Fintype V] in -lemma positive_mul_tokenBasis (α : V) (x : Q.Zigzag K) (hx : x.vertex = 0) : - x * tokenBasis Q α = 0 := by - apply ext - · change (x * tokenBasis Q α).vertex = 0 - rw [vertex_mul] - change x.vertex * (0 : V → K) = 0 - exact MulZeroClass.mul_zero _ - · change (x * tokenBasis Q α).arrow = 0 - rw [arrow_mul] - change Q.leftScale x.vertex 0 + Q.rightScale x.arrow 0 = 0 - ext a - simp [leftScale, rightScale] - · change (x * tokenBasis Q α).token = 0 - rw [token_mul] - change x.vertex * (Pi.single α (1 : K)) + x.token * (0 : V → K) + Q.backtrack x.arrow 0 = 0 - rw [hx] - ext a - simp - -omit [Fintype A] in -lemma trace_tokenBasis (α : V) : trace Q (tokenBasis Q (K := K) α) = 1 := by - change (∑ j, (Pi.single α (1 : K)) j) = 1 - simp - -namespace BasedComplex -variable {I J : Type*} [Fintype I] [Fintype J] - -omit [Fintype V] in -lemma homBoundary_positive (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (n v : ℤ) {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homBoundaries Q E F n v) : - PositiveMatrix Q f := by - obtain ⟨g, _, rfl⟩ := hf - have hl := positiveMatrix_mul_right Q hE g - have hr := positiveMatrix_mul_left Q g hF - intro i j - change ((E.differential * g) i j - cochainSign (K := K) (n - 1) • (g * F.differential) i j).vertex = 0 - change ((E.differential * g) i j).vertex - cochainSign (K := K) (n - 1) • - ((g * F.differential) i j).vertex = 0 - rw [hl, hr, smul_zero, sub_zero] - -def diagonalVertex (E : BasedComplex Q (K := K) I) (i : I) : - Matrix I I (Q.Zigzag K) →ₗ[K] K where - toFun f := (f i i).vertex (E.placement i).color - map_add' _ _ := rfl - map_smul' _ _ := rfl - -omit [Fintype V] in -lemma diagonalVertex_boundary (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) - (i : I) (n v : ℤ) {f : Matrix I I (Q.Zigzag K)} - (hf : f ∈ homBoundaries Q E E n v) : diagonalVertex Q E i f = 0 := by - exact congrFun (homBoundary_positive Q E E hE hE n v hf i i) (E.placement i).color - -variable [DecidableEq I] - -omit [Fintype V] in -lemma identity_mem_homCycles (E : BasedComplex Q (K := K) I) : - projectiveIdentity Q E.placement ∈ homCycles Q E E 0 0 := by - exact map_mem_homCycles Q (HomotopyEquivalence.refl Q E).forward - -omit [Fintype V] in -lemma diagonalVertex_identity (E : BasedComplex Q (K := K) I) (i : I) : - diagonalVertex Q E i (projectiveIdentity Q E.placement) = 1 := by - change (projectiveIdentity Q (K := K) E.placement i i).vertex (E.placement i).color = 1 - rw [projectiveIdentity, Matrix.diagonal_apply_eq, vertexId_eval, ite_eq_left rfl] - -def diagonalToken (E : BasedComplex Q (K := K) I) (i : I) : Matrix I I (Q.Zigzag K) := - Matrix.diagonal (fun j => if j = i then tokenBasis Q (E.placement i).color else 0) - -lemma diagonalToken_entries (E : BasedComplex Q (K := K) I) (i : I) : - ProjectiveEntries Q E.placement E.placement (diagonalToken Q E i) := by - classical - have hl : vertexId Q (K := K) (E.placement i).color * tokenBasis Q (E.placement i).color = - tokenBasis Q (E.placement i).color := by - simpa only [Path.source, pathBasis_token] using - (pathBasis_left Q (K := K) (.inr (.inr (E.placement i).color))) - have hr : tokenBasis Q (K := K) (E.placement i).color * vertexId Q (E.placement i).color = - tokenBasis Q (E.placement i).color := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr (E.placement i).color))) - constructor <;> intro j k - · by_cases hjk : j = k - · subst k - by_cases hji : j = i - · subst j; simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true, hl] - · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji, MulZeroClass.mul_zero] - · simp only [diagonalToken, Matrix.diagonal_apply_ne _ hjk, MulZeroClass.mul_zero] - · by_cases hjk : j = k - · subst k - by_cases hji : j = i - · subst j; simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true, hr] - · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji, MulZeroClass.zero_mul] - · simp only [diagonalToken, Matrix.diagonal_apply_ne _ hjk, MulZeroClass.zero_mul] - -omit [Fintype V] in -lemma diagonalToken_degree (E : BasedComplex Q (K := K) I) (i : I) : - MapDegree Q E.placement E.placement 0 2 (diagonalToken Q E i) := by - intro j k - by_cases hjk : j = k - · subst k - constructor - · intro h; exact (h (by omega)).elim - · by_cases hji : j = i - · subst j - simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true] - rw [add_sub_cancel_right] - exact ⟨fun _ => rfl, fun _ => rfl, fun h => (h rfl).elim⟩ - · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji] - exact homogeneous_zero Q _ - · have hz : diagonalToken Q E i j k = 0 := Matrix.diagonal_apply_ne _ hjk - rw [hz] - exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - -lemma diagonalToken_mem_homCycles (E : BasedComplex Q (K := K) I) - (hE : E.IsMinimal Q) (i : I) : diagonalToken Q E i ∈ homCycles Q E E 0 2 := by - refine ⟨⟨diagonalToken_entries Q E i, diagonalToken_degree Q E i⟩, ?_⟩ - have hl : E.differential * diagonalToken Q E i = 0 := by - apply Matrix.ext - intro j k - rw [diagonalToken, Matrix.mul_diagonal] - by_cases hki : k = i - · simp only [ite_eq_left hki, Matrix.zero_apply] - exact positive_mul_tokenBasis Q _ _ (hE j k) - · simp only [ite_eq_right hki, MulZeroClass.mul_zero, Matrix.zero_apply] - have hr : diagonalToken Q E i * E.differential = 0 := by - apply Matrix.ext - intro j k - rw [diagonalToken, Matrix.diagonal_mul] - by_cases hji : j = i - · simp only [ite_eq_left hji, Matrix.zero_apply] - exact tokenBasis_mul_positive Q _ _ (hE j k) - · simp only [ite_eq_right hji, MulZeroClass.zero_mul, Matrix.zero_apply] - change E.differential * diagonalToken Q E i - - cochainSign (K := K) 0 • (diagonalToken Q E i * E.differential) = 0 - rw [hl, hr, smul_zero, sub_zero] - -lemma supertrace_diagonalToken (E : BasedComplex Q (K := K) I) (i : I) : - supertrace Q E (diagonalToken Q E i) = cochainSign (K := K) (E.placement i).cochain := by - change (∑ j, cochainSign (K := K) (E.placement j).cochain * - trace Q (diagonalToken Q E i j j)) = _ - rw [Finset.sum_eq_single i] - · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true, trace_tokenBasis, _root_.mul_one] - · intro j _ hji - simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji, trace_zero, MulZeroClass.mul_zero] - · simp only [Finset.mem_univ, not_true_eq_false, false_implies] - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Quivers.Path +import OAI.Topology.ArtinGroups.Complexes.HomSpaceMul + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] + +omit [Fintype V] in +lemma tokenBasis_mul_positive (α : V) (x : Q.Zigzag K) (hx : x.vertex = 0) : + tokenBasis Q α * x = 0 := by + apply ext + · change (tokenBasis Q α * x).vertex = 0 + rw [vertex_mul] + change (0 : V → K) * x.vertex = 0 + exact MulZeroClass.zero_mul _ + · change (tokenBasis Q α * x).arrow = 0 + rw [arrow_mul] + change Q.leftScale 0 x.arrow + Q.rightScale 0 x.vertex = 0 + ext a + simp [leftScale, rightScale] + · change (tokenBasis Q α * x).token = 0 + rw [token_mul] + change (0 : V → K) * x.token + (Pi.single α (1 : K)) * x.vertex + Q.backtrack 0 x.arrow = 0 + rw [hx] + ext a + simp + +omit [Fintype V] in +lemma positive_mul_tokenBasis (α : V) (x : Q.Zigzag K) (hx : x.vertex = 0) : + x * tokenBasis Q α = 0 := by + apply ext + · change (x * tokenBasis Q α).vertex = 0 + rw [vertex_mul] + change x.vertex * (0 : V → K) = 0 + exact MulZeroClass.mul_zero _ + · change (x * tokenBasis Q α).arrow = 0 + rw [arrow_mul] + change Q.leftScale x.vertex 0 + Q.rightScale x.arrow 0 = 0 + ext a + simp [leftScale, rightScale] + · change (x * tokenBasis Q α).token = 0 + rw [token_mul] + change x.vertex * (Pi.single α (1 : K)) + x.token * (0 : V → K) + Q.backtrack x.arrow 0 = 0 + rw [hx] + ext a + simp + +omit [Fintype A] in +lemma trace_tokenBasis (α : V) : trace Q (tokenBasis Q (K := K) α) = 1 := by + change (∑ j, (Pi.single α (1 : K)) j) = 1 + simp + +namespace BasedComplex +variable {I J : Type*} [Fintype I] [Fintype J] + +omit [Fintype V] in +lemma homBoundary_positive (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (n v : ℤ) {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homBoundaries Q E F n v) : + PositiveMatrix Q f := by + obtain ⟨g, _, rfl⟩ := hf + have hl := positiveMatrix_mul_right Q hE g + have hr := positiveMatrix_mul_left Q g hF + intro i j + change ((E.differential * g) i j - cochainSign (K := K) (n - 1) • (g * F.differential) i j).vertex = 0 + change ((E.differential * g) i j).vertex - cochainSign (K := K) (n - 1) • + ((g * F.differential) i j).vertex = 0 + rw [hl, hr, smul_zero, sub_zero] + +def diagonalVertex (E : BasedComplex Q (K := K) I) (i : I) : + Matrix I I (Q.Zigzag K) →ₗ[K] K where + toFun f := (f i i).vertex (E.placement i).color + map_add' _ _ := rfl + map_smul' _ _ := rfl + +omit [Fintype V] in +lemma diagonalVertex_boundary (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) + (i : I) (n v : ℤ) {f : Matrix I I (Q.Zigzag K)} + (hf : f ∈ homBoundaries Q E E n v) : diagonalVertex Q E i f = 0 := by + exact congrFun (homBoundary_positive Q E E hE hE n v hf i i) (E.placement i).color + +variable [DecidableEq I] + +omit [Fintype V] in +lemma identity_mem_homCycles (E : BasedComplex Q (K := K) I) : + projectiveIdentity Q E.placement ∈ homCycles Q E E 0 0 := by + exact map_mem_homCycles Q (HomotopyEquivalence.refl Q E).forward + +omit [Fintype V] in +lemma diagonalVertex_identity (E : BasedComplex Q (K := K) I) (i : I) : + diagonalVertex Q E i (projectiveIdentity Q E.placement) = 1 := by + change (projectiveIdentity Q (K := K) E.placement i i).vertex (E.placement i).color = 1 + rw [projectiveIdentity, Matrix.diagonal_apply_eq, vertexId_eval, ite_eq_left rfl] + +def diagonalToken (E : BasedComplex Q (K := K) I) (i : I) : Matrix I I (Q.Zigzag K) := + Matrix.diagonal (fun j => if j = i then tokenBasis Q (E.placement i).color else 0) + +lemma diagonalToken_entries (E : BasedComplex Q (K := K) I) (i : I) : + ProjectiveEntries Q E.placement E.placement (diagonalToken Q E i) := by + classical + have hl : vertexId Q (K := K) (E.placement i).color * tokenBasis Q (E.placement i).color = + tokenBasis Q (E.placement i).color := by + simpa only [Path.source, pathBasis_token] using + (pathBasis_left Q (K := K) (.inr (.inr (E.placement i).color))) + have hr : tokenBasis Q (K := K) (E.placement i).color * vertexId Q (E.placement i).color = + tokenBasis Q (E.placement i).color := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr (E.placement i).color))) + constructor <;> intro j k + · by_cases hjk : j = k + · subst k + by_cases hji : j = i + · subst j; simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true, hl] + · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji, MulZeroClass.mul_zero] + · simp only [diagonalToken, Matrix.diagonal_apply_ne _ hjk, MulZeroClass.mul_zero] + · by_cases hjk : j = k + · subst k + by_cases hji : j = i + · subst j; simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true, hr] + · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji, MulZeroClass.zero_mul] + · simp only [diagonalToken, Matrix.diagonal_apply_ne _ hjk, MulZeroClass.zero_mul] + +omit [Fintype V] in +lemma diagonalToken_degree (E : BasedComplex Q (K := K) I) (i : I) : + MapDegree Q E.placement E.placement 0 2 (diagonalToken Q E i) := by + intro j k + by_cases hjk : j = k + · subst k + constructor + · intro h; exact (h (by omega)).elim + · by_cases hji : j = i + · subst j + simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true] + rw [add_sub_cancel_right] + exact ⟨fun _ => rfl, fun _ => rfl, fun h => (h rfl).elim⟩ + · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji] + exact homogeneous_zero Q _ + · have hz : diagonalToken Q E i j k = 0 := Matrix.diagonal_apply_ne _ hjk + rw [hz] + exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + +lemma diagonalToken_mem_homCycles (E : BasedComplex Q (K := K) I) + (hE : E.IsMinimal Q) (i : I) : diagonalToken Q E i ∈ homCycles Q E E 0 2 := by + refine ⟨⟨diagonalToken_entries Q E i, diagonalToken_degree Q E i⟩, ?_⟩ + have hl : E.differential * diagonalToken Q E i = 0 := by + apply Matrix.ext + intro j k + rw [diagonalToken, Matrix.mul_diagonal] + by_cases hki : k = i + · simp only [ite_eq_left hki, Matrix.zero_apply] + exact positive_mul_tokenBasis Q _ _ (hE j k) + · simp only [ite_eq_right hki, MulZeroClass.mul_zero, Matrix.zero_apply] + have hr : diagonalToken Q E i * E.differential = 0 := by + apply Matrix.ext + intro j k + rw [diagonalToken, Matrix.diagonal_mul] + by_cases hji : j = i + · simp only [ite_eq_left hji, Matrix.zero_apply] + exact tokenBasis_mul_positive Q _ _ (hE j k) + · simp only [ite_eq_right hji, MulZeroClass.zero_mul, Matrix.zero_apply] + change E.differential * diagonalToken Q E i - + cochainSign (K := K) 0 • (diagonalToken Q E i * E.differential) = 0 + rw [hl, hr, smul_zero, sub_zero] + +lemma supertrace_diagonalToken (E : BasedComplex Q (K := K) I) (i : I) : + supertrace Q E (diagonalToken Q E i) = cochainSign (K := K) (E.placement i).cochain := by + change (∑ j, cochainSign (K := K) (E.placement j).cochain * + trace Q (diagonalToken Q E i j j)) = _ + rw [Finset.sum_eq_single i] + · simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_true, trace_tokenBasis, _root_.mul_one] + · intro j _ hji + simp only [diagonalToken, Matrix.diagonal_apply_eq, ite_eq_right hji, trace_zero, MulZeroClass.mul_zero] + · simp only [Finset.mem_univ, not_true_eq_false, false_implies] + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Differential.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Differential.lean index a499f4425089f8c9b5345a0974ea250badd6f371..df707b93a7cf955ffc55a72dae4b445f7de3164c 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Differential.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Differential.lean @@ -1,83 +1,83 @@ -import Mathlib - -namespace OAI - -namespace HarmonicArtin.LinearLayers - -variable {K V₀ V₁ V₂ : Type*} [Field K] - [AddCommGroup V₀] [Module K V₀] - [AddCommGroup V₁] [Module K V₁] - [AddCommGroup V₂] [Module K V₂] - -def differential (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) : - (V₀ × V₁ × V₂) →ₗ[K] (V₀ × V₁ × V₂) where - toFun x := (0, f x.1, a x.1 + g x.2.1) - map_add' x y := by simp [add_assoc, add_left_comm, add_comm] - map_smul' k x := by simp - -@[simp] theorem differential_apply (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) - (a : V₀ →ₗ[K] V₂) (x : V₀ × V₁ × V₂) : - differential f g a x = (0, f x.1, a x.1 + g x.2.1) := rfl - -theorem differential_squared (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) - (a : V₀ →ₗ[K] V₂) (h : g.comp f = 0) : - (differential f g a).comp (differential f g a) = 0 := by - apply LinearMap.ext - intro x - have hx : g (f x.1) = 0 := LinearMap.congr_fun h x.1 - simp [LinearMap.comp_apply, hx] - -theorem middle_exact_of_identity_token - (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) - (idCycle : V₀ × V₁ × V₂) (token : V₂) (hid : idCycle.1 ≠ 0) - (span_cycles : ∀ c, differential f g a c = 0 → - ∃ k l : K, ∃ b, c = k • idCycle + l • (0, 0, token) + differential f g a b) : - LinearMap.ker g ≤ LinearMap.range f := by - intro y hy - have hc : differential f g a (0, y, 0) = 0 := by - simp [LinearMap.mem_ker.mp hy] - obtain ⟨k, l, b, hb⟩ := span_cycles (0, y, 0) hc - have hk : k = 0 := by - have he := congrArg Prod.fst hb - have he' : k • idCycle.1 = 0 := by simpa using he.symm - exact (smul_eq_zero.mp he').resolve_right hid - refine ⟨b.1, ?_⟩ - have he := congrArg (fun x : V₀ × V₁ × V₂ => x.2.1) hb - simpa [hk] using he.symm - -def secondary (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) (U : Submodule K V₀) : - U →ₗ[K] V₂ ⧸ LinearMap.range g := - (LinearMap.range g).mkQ.comp (a.comp U.subtype) - -theorem secondary_injective - (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) - (idCycle : V₀ × V₁ × V₂) (token : V₂) - (span_cycles : ∀ c, differential f g a c = 0 → - ∃ k l : K, ∃ b, c = k • idCycle + l • (0, 0, token) + differential f g a b) - (U : Submodule K V₀) (hU : U ≤ LinearMap.ker f) - (hdisjoint : Disjoint U (Submodule.span K {idCycle.1})) : - Function.Injective (secondary g a U) := by - apply (LinearMap.ker_eq_bot).mp - apply eq_bot_iff.mpr - intro x hx - have hax : a x ∈ LinearMap.range g := by - have hz : (LinearMap.range g).mkQ (a x) = 0 := hx - exact (Submodule.Quotient.mk_eq_zero _).mp hz - obtain ⟨y, hy⟩ := hax - have hc : differential f g a (x, -y, 0) = 0 := by - have hfx : f x = 0 := hU x.property - simp [hfx, ← hy] - obtain ⟨k, l, b, hb⟩ := span_cycles (x, -y, 0) hc - have he : (x : V₀) = k • idCycle.1 := by - have he := congrArg Prod.fst hb - simpa using he - have hxspan : (x : V₀) ∈ Submodule.span K {idCycle.1} := by - rw [he] - exact Submodule.smul_mem _ _ (Submodule.subset_span (Set.mem_singleton _)) - have hxzero : (x : V₀) = 0 := - (Submodule.disjoint_def.mp hdisjoint) _ x.property hxspan - exact Subtype.ext hxzero - -end HarmonicArtin.LinearLayers - -end OAI +import Mathlib + +namespace OAI + +namespace HarmonicArtin.LinearLayers + +variable {K V₀ V₁ V₂ : Type*} [Field K] + [AddCommGroup V₀] [Module K V₀] + [AddCommGroup V₁] [Module K V₁] + [AddCommGroup V₂] [Module K V₂] + +def differential (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) : + (V₀ × V₁ × V₂) →ₗ[K] (V₀ × V₁ × V₂) where + toFun x := (0, f x.1, a x.1 + g x.2.1) + map_add' x y := by simp [add_assoc, add_left_comm, add_comm] + map_smul' k x := by simp + +@[simp] theorem differential_apply (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) + (a : V₀ →ₗ[K] V₂) (x : V₀ × V₁ × V₂) : + differential f g a x = (0, f x.1, a x.1 + g x.2.1) := rfl + +theorem differential_squared (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) + (a : V₀ →ₗ[K] V₂) (h : g.comp f = 0) : + (differential f g a).comp (differential f g a) = 0 := by + apply LinearMap.ext + intro x + have hx : g (f x.1) = 0 := LinearMap.congr_fun h x.1 + simp [LinearMap.comp_apply, hx] + +theorem middle_exact_of_identity_token + (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) + (idCycle : V₀ × V₁ × V₂) (token : V₂) (hid : idCycle.1 ≠ 0) + (span_cycles : ∀ c, differential f g a c = 0 → + ∃ k l : K, ∃ b, c = k • idCycle + l • (0, 0, token) + differential f g a b) : + LinearMap.ker g ≤ LinearMap.range f := by + intro y hy + have hc : differential f g a (0, y, 0) = 0 := by + simp [LinearMap.mem_ker.mp hy] + obtain ⟨k, l, b, hb⟩ := span_cycles (0, y, 0) hc + have hk : k = 0 := by + have he := congrArg Prod.fst hb + have he' : k • idCycle.1 = 0 := by simpa using he.symm + exact (smul_eq_zero.mp he').resolve_right hid + refine ⟨b.1, ?_⟩ + have he := congrArg (fun x : V₀ × V₁ × V₂ => x.2.1) hb + simpa [hk] using he.symm + +def secondary (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) (U : Submodule K V₀) : + U →ₗ[K] V₂ ⧸ LinearMap.range g := + (LinearMap.range g).mkQ.comp (a.comp U.subtype) + +theorem secondary_injective + (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (a : V₀ →ₗ[K] V₂) + (idCycle : V₀ × V₁ × V₂) (token : V₂) + (span_cycles : ∀ c, differential f g a c = 0 → + ∃ k l : K, ∃ b, c = k • idCycle + l • (0, 0, token) + differential f g a b) + (U : Submodule K V₀) (hU : U ≤ LinearMap.ker f) + (hdisjoint : Disjoint U (Submodule.span K {idCycle.1})) : + Function.Injective (secondary g a U) := by + apply (LinearMap.ker_eq_bot).mp + apply eq_bot_iff.mpr + intro x hx + have hax : a x ∈ LinearMap.range g := by + have hz : (LinearMap.range g).mkQ (a x) = 0 := hx + exact (Submodule.Quotient.mk_eq_zero _).mp hz + obtain ⟨y, hy⟩ := hax + have hc : differential f g a (x, -y, 0) = 0 := by + have hfx : f x = 0 := hU x.property + simp [hfx, ← hy] + obtain ⟨k, l, b, hb⟩ := span_cycles (x, -y, 0) hc + have he : (x : V₀) = k • idCycle.1 := by + have he := congrArg Prod.fst hb + simpa using he + have hxspan : (x : V₀) ∈ Submodule.span K {idCycle.1} := by + rw [he] + exact Submodule.smul_mem _ _ (Submodule.subset_span (Set.mem_singleton _)) + have hxzero : (x : V₀) = 0 := + (Submodule.disjoint_def.mp hdisjoint) _ x.property hxspan + exact Subtype.ext hxzero + +end HarmonicArtin.LinearLayers + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/DifferentialMulExtendLayer.lean b/lean/OAI/Topology/ArtinGroups/Complexes/DifferentialMulExtendLayer.lean index 882dff50af9a11938c1d4b65a688b5d095819423..1b262962d2c0d8c3c8f77fece2aa3a43966e0388 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/DifferentialMulExtendLayer.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/DifferentialMulExtendLayer.lean @@ -1,106 +1,106 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ExtendLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J : Type*} [Fintype I] [Fintype J] - -lemma differential_mul_extendLayer (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (l k : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hf : LinearMatrix Q f) : - E.differential * extendLayer Q E F l k f = - extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f) := by - classical - apply Matrix.ext - intro i j - rw [Matrix.mul_apply, extendLayer_entry] - split_ifs with hi hj - · change (∑ t, E.differential i t * extendLayer Q E F l k f t j) = - ∑ t : {i // (E.placement i).level = l}, E.differential i t * f t ⟨j, hj⟩ - symm - apply Fintype.sum_of_injective Subtype.val Subtype.val_injective - · intro t ht - have hh : (E.placement t).level ≠ l := fun h => ht ⟨⟨t, h⟩, rfl⟩ - rw [extendLayer_entry, dite_eq_right hh, MulZeroClass.mul_zero] - · intro t - rw [extendLayer_entry, dite_eq_left t.property, dite_eq_left hj] - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry] - split_ifs <;> exact MulZeroClass.mul_zero _ - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry] - split_ifs with ht hj - · apply tokenOnly_mul_positive Q (hE i t) _ (hf ⟨t, ht⟩ ⟨j, hj⟩).1 - apply differential_arrow_level Q E - intro he - exact hi (he ▸ ht) - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - -lemma extendLayer_mul_differential (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hF : F.IsMinimal Q) (l k : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hf : LinearMatrix Q f) : - extendLayer Q E F l k f * F.differential = - extendLayer Q E F l k (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential)) := by - classical - apply Matrix.ext - intro i j - rw [Matrix.mul_apply, extendLayer_entry] - split_ifs with hi hj - · change (∑ t, extendLayer Q E F l k f i t * F.differential t j) = - ∑ t : {j // (F.placement j).level = k}, f ⟨i, hi⟩ t * F.differential t j - symm - apply Fintype.sum_of_injective Subtype.val Subtype.val_injective - · intro t ht - have hh : (F.placement t).level ≠ k := fun h => ht ⟨⟨t, h⟩, rfl⟩ - rw [extendLayer_entry, dite_eq_left hi, dite_eq_right hh, MulZeroClass.zero_mul] - · intro t - rw [extendLayer_entry, dite_eq_left hi, dite_eq_left t.property] - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry, dite_eq_left hi] - split_ifs with ht - · apply positive_mul_tokenOnly Q (hf ⟨i, hi⟩ ⟨t, ht⟩).1 (hF t j) - apply differential_arrow_level Q F - intro he - exact hj (he.trans ht) - · exact MulZeroClass.zero_mul _ - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry, dite_eq_right hi, MulZeroClass.zero_mul] - -lemma homDifferential_extendLayer (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (l k n : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hf : LinearMatrix Q f) : - homDifferential Q E F n (extendLayer Q E F l k f) = extendLayer Q E F l k - (homDifferential Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n f) := by - change E.differential * extendLayer Q E F l k f - - cochainSign (K := K) n • (extendLayer Q E F l k f * F.differential) = - extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f - - cochainSign (K := K) n • (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential))) - rw [map_sub, map_smul, differential_mul_extendLayer Q E F hE l k hf, - extendLayer_mul_differential Q E F hF l k hf] - -lemma extendLayer_cycle (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (l k n v : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hf : f ∈ homCycles Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v) - (hlin : LinearMatrix Q f) : - extendLayer Q E F l k f ∈ homCycles Q E F n v := by - refine ⟨extendLayer_homSpace Q E F hE hF l k n v hf.1, ?_⟩ - change homDifferential Q E F n (extendLayer Q E F l k f) = 0 - rw [homDifferential_extendLayer Q E F hE hF l k n hlin, hf.2, map_zero] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ExtendLayer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J : Type*} [Fintype I] [Fintype J] + +lemma differential_mul_extendLayer (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (l k : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hf : LinearMatrix Q f) : + E.differential * extendLayer Q E F l k f = + extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f) := by + classical + apply Matrix.ext + intro i j + rw [Matrix.mul_apply, extendLayer_entry] + split_ifs with hi hj + · change (∑ t, E.differential i t * extendLayer Q E F l k f t j) = + ∑ t : {i // (E.placement i).level = l}, E.differential i t * f t ⟨j, hj⟩ + symm + apply Fintype.sum_of_injective Subtype.val Subtype.val_injective + · intro t ht + have hh : (E.placement t).level ≠ l := fun h => ht ⟨⟨t, h⟩, rfl⟩ + rw [extendLayer_entry, dite_eq_right hh, MulZeroClass.mul_zero] + · intro t + rw [extendLayer_entry, dite_eq_left t.property, dite_eq_left hj] + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry] + split_ifs <;> exact MulZeroClass.mul_zero _ + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry] + split_ifs with ht hj + · apply tokenOnly_mul_positive Q (hE i t) _ (hf ⟨t, ht⟩ ⟨j, hj⟩).1 + apply differential_arrow_level Q E + intro he + exact hi (he ▸ ht) + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + +lemma extendLayer_mul_differential (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hF : F.IsMinimal Q) (l k : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hf : LinearMatrix Q f) : + extendLayer Q E F l k f * F.differential = + extendLayer Q E F l k (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential)) := by + classical + apply Matrix.ext + intro i j + rw [Matrix.mul_apply, extendLayer_entry] + split_ifs with hi hj + · change (∑ t, extendLayer Q E F l k f i t * F.differential t j) = + ∑ t : {j // (F.placement j).level = k}, f ⟨i, hi⟩ t * F.differential t j + symm + apply Fintype.sum_of_injective Subtype.val Subtype.val_injective + · intro t ht + have hh : (F.placement t).level ≠ k := fun h => ht ⟨⟨t, h⟩, rfl⟩ + rw [extendLayer_entry, dite_eq_left hi, dite_eq_right hh, MulZeroClass.zero_mul] + · intro t + rw [extendLayer_entry, dite_eq_left hi, dite_eq_left t.property] + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry, dite_eq_left hi] + split_ifs with ht + · apply positive_mul_tokenOnly Q (hf ⟨i, hi⟩ ⟨t, ht⟩).1 (hF t j) + apply differential_arrow_level Q F + intro he + exact hj (he.trans ht) + · exact MulZeroClass.zero_mul _ + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry, dite_eq_right hi, MulZeroClass.zero_mul] + +lemma homDifferential_extendLayer (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (l k n : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hf : LinearMatrix Q f) : + homDifferential Q E F n (extendLayer Q E F l k f) = extendLayer Q E F l k + (homDifferential Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n f) := by + change E.differential * extendLayer Q E F l k f - + cochainSign (K := K) n • (extendLayer Q E F l k f * F.differential) = + extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f - + cochainSign (K := K) n • (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential))) + rw [map_sub, map_smul, differential_mul_extendLayer Q E F hE l k hf, + extendLayer_mul_differential Q E F hF l k hf] + +lemma extendLayer_cycle (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (l k n v : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hf : f ∈ homCycles Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v) + (hlin : LinearMatrix Q f) : + extendLayer Q E F l k f ∈ homCycles Q E F n v := by + refine ⟨extendLayer_homSpace Q E F hE hF l k n v hf.1, ?_⟩ + change homDifferential Q E F n (extendLayer Q E F l k f) = 0 + rw [homDifferential_extendLayer Q E F hE hF l k n hlin, hf.2, map_zero] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/DownClosed.lean b/lean/OAI/Topology/ArtinGroups/Complexes/DownClosed.lean index f33efbf00758844b46aee42f7a5f308d16fa0de1..4323877f4d62ae98fd387ad307901afee9a06c25 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/DownClosed.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/DownClosed.lean @@ -1,161 +1,161 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices -import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential2 -import OAI.Topology.ArtinGroups.Complexes.BlockClosed -import OAI.Topology.ArtinGroups.Complexes.Identity - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] -attribute [local instance] Classical.decEq -attribute [local instance] Classical.propDecidable - -def DownClosed (E:BasedComplex Q (K:=K) I) (T:Set I) : Prop := - ∀ i∈T,∀ j,E.differential i j≠0→j∈T - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma DownClosed.low_condition {E:BasedComplex Q (K:=K) I} {T:Set I} - (h:DownClosed Q E T) : ∀ i∈T,∀ j∈T,∀ k∉T,E.differential i k*E.differential k j=0 := by - intro i hi j _ k hk - have hz:E.differential i k=0 := Classical.not_not.mp (fun hn=>hk (h i hi k hn)) - rw [hz,zero_mul] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma DownClosed.high_condition {E:BasedComplex Q (K:=K) I} {T:Set I} - (h:DownClosed Q E T) : ∀ i∈Tᶜ,∀ j∈Tᶜ,∀ k∉Tᶜ,E.differential i k*E.differential k j=0 := by - intro i _ j hj k hk - have hk':k∈T:=Classical.not_not.mp hk - have hz:E.differential k j=0 := Classical.not_not.mp (fun hn=>hj (h k hk' j hn)) - rw [hz,MulZeroClass.mul_zero] - -noncomputable def lowRestriction (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - BasedComplex Q (K:=K) T := E.restrict Q T h.low_condition -noncomputable def highRestriction (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - BasedComplex Q (K:=K) (Tᶜ:Set I) := E.restrict Q Tᶜ h.high_condition - -omit [Fintype V] [DecidableEq A] in -lemma lowInclusion_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - (lowRestriction Q E T h).differential*blockInclusion Q E T= - blockInclusion Q E T*E.differential := by - rw [blockInclusion_mul Q E T _ _ E.entries] - apply Matrix.ext - intro i j - change (∑ k:T,E.differential i k*(if (k:I)=j then vertexId Q (K:=K) (E.placement k).color else 0))=E.differential i j - by_cases hj:j∈T - · let j':T:=⟨j,hj⟩ - have he (k:T) : ((k:I)=j) ↔ k=j' := by simp only [j',Subtype.ext_iff] - simp only [he,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] - exact E.entries.2 i j - · have hz:E.differential i j=0 := Classical.not_not.mp (fun hh=>hj (h i i.property j hh)) - rw [hz] - apply Finset.sum_eq_zero - intro k _ - have hne:(k:I)≠j := by intro he; exact hj (he ▸ k.property) - rw [ite_eq_right hne,MulZeroClass.mul_zero] - -omit [Fintype V] [DecidableEq A] in -lemma highProjection_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - E.differential*blockProjection Q E Tᶜ= - blockProjection Q E Tᶜ*(highRestriction Q E T h).differential := by - rw [mul_blockProjection Q E Tᶜ _ _ E.entries] - apply Matrix.ext - intro i j - change E.differential i j=(∑ k:(Tᶜ:Set I),(if i=(k:I) then vertexId Q (K:=K) (E.placement i).color else 0)*E.differential k j) - by_cases hi:i∈Tᶜ - · let i':(Tᶜ:Set I):=⟨i,hi⟩ - have he (k:(Tᶜ:Set I)) : (i=(k:I)) ↔ i'=k := by simp only [i',Subtype.ext_iff] - simp only [he,ite_mul,zero_mul,Fintype.sum_ite_eq] - exact (E.entries.1 i j).symm - · have hi':i∈T:=Classical.not_not.mp hi - have hz:E.differential i j=0 := Classical.not_not.mp (fun hh=>j.property (h i hi' j hh)) - rw [hz] - symm - apply Finset.sum_eq_zero - intro k _ - have hne:i≠(k:I) := by intro he; exact hi (he.symm ▸ k.property) - rw [ite_eq_right hne,zero_mul] - -noncomputable def lowInclusion (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - Map Q (lowRestriction Q E T h) E where - matrix:=blockInclusion Q E T - entries:=blockInclusion_entries Q E T - degree:=fun i j=>mapDegree_identity Q (i:I) j - commute:=lowInclusion_commute Q E T h - -noncomputable def highProjection (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - Map Q E (highRestriction Q E T h) where - matrix:=blockProjection Q E Tᶜ - entries:=blockProjection_entries Q E Tᶜ - degree:=fun i j=>mapDegree_identity Q i (j:I) - commute:=highProjection_commute Q E T h - -def lowerLevelSet (E:BasedComplex Q (K:=K) I) (d:ℤ) : Set I := {i|(E.placement i).level≤d} - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma levelDownClosed (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : - DownClosed Q E (lowerLevelSet Q E d) := by - intro i hi j hij - have h:=differential_level Q E hE hij - change (E.placement j).level≤d - change (E.placement i).level≤d at hi - rcases h with h|h <;> omega - -noncomputable def lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) := - lowRestriction Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d) -noncomputable def upperTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) := - highRestriction Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma lowerTruncation_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : - (lowerTruncation Q E hE d).IsMinimal Q := fun i j=>hE i j -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma upperTruncation_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : - (upperTruncation Q E hE d).IsMinimal Q := fun i j=>hE i j - -noncomputable def lowConeNormalized (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) := - ((lowInclusion Q E T h).cone Q).reindex Q (Equiv.sumCongr (Equiv.refl T) (Equiv.Set.sumCompl T)) - -noncomputable def lowConePivot (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - BlockPivot Q (lowConeNormalized Q E T h) where - coefficient:=1 - nonzero:=one_ne_zero - color _:=rfl - cochain i:=by change (E.placement i).cochain=(E.placement i).cochain-1+1; omega - internal _:=rfl - entry i j:=by - change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= - 1 • (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) - simp only [one_smul,Subtype.val_inj] - -omit [Fintype V] [DecidableEq A] in -lemma lowCone_source_retained (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) - (i:T) (j:(Tᶜ:Set I)) : (lowConeNormalized Q E T h).differential (.inl i) (.inr (.inr j))=0 := by - change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)=0 - have hn:(i:I)≠(j:I):=fun he=>j.property (he ▸ i.property) - rw [ite_eq_right hn] - -omit [Fintype V] [DecidableEq A] in -lemma lowCone_reduced_eq (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - (lowConePivot Q E T h).reduced Q=highRestriction Q E T h := by - apply ext_placement_differential Q - · rfl - · apply Matrix.ext - intro i j - rw [BlockPivot.reduced_differential] - simp only [lowCone_source_retained,MulZeroClass.mul_zero,Finset.sum_const_zero,sub_zero] - rfl - -noncomputable def lowConeReduction (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : - HomotopyEquivalence Q ((lowInclusion Q E T h).cone Q) (highRestriction Q E T h) := by - have e:=(((lowInclusion Q E T h).cone Q).reindexHomotopyEquivalence Q - (Equiv.sumCongr (Equiv.refl T) (Equiv.Set.sumCompl T))).trans Q - ((lowConePivot Q E T h).reductionEquivalence Q) - rw [lowCone_reduced_eq] at e - exact e - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices +import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential2 +import OAI.Topology.ArtinGroups.Complexes.BlockClosed +import OAI.Topology.ArtinGroups.Complexes.Identity + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] +attribute [local instance] Classical.decEq +attribute [local instance] Classical.propDecidable + +def DownClosed (E:BasedComplex Q (K:=K) I) (T:Set I) : Prop := + ∀ i∈T,∀ j,E.differential i j≠0→j∈T + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma DownClosed.low_condition {E:BasedComplex Q (K:=K) I} {T:Set I} + (h:DownClosed Q E T) : ∀ i∈T,∀ j∈T,∀ k∉T,E.differential i k*E.differential k j=0 := by + intro i hi j _ k hk + have hz:E.differential i k=0 := Classical.not_not.mp (fun hn=>hk (h i hi k hn)) + rw [hz,zero_mul] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma DownClosed.high_condition {E:BasedComplex Q (K:=K) I} {T:Set I} + (h:DownClosed Q E T) : ∀ i∈Tᶜ,∀ j∈Tᶜ,∀ k∉Tᶜ,E.differential i k*E.differential k j=0 := by + intro i _ j hj k hk + have hk':k∈T:=Classical.not_not.mp hk + have hz:E.differential k j=0 := Classical.not_not.mp (fun hn=>hj (h k hk' j hn)) + rw [hz,MulZeroClass.mul_zero] + +noncomputable def lowRestriction (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + BasedComplex Q (K:=K) T := E.restrict Q T h.low_condition +noncomputable def highRestriction (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + BasedComplex Q (K:=K) (Tᶜ:Set I) := E.restrict Q Tᶜ h.high_condition + +omit [Fintype V] [DecidableEq A] in +lemma lowInclusion_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + (lowRestriction Q E T h).differential*blockInclusion Q E T= + blockInclusion Q E T*E.differential := by + rw [blockInclusion_mul Q E T _ _ E.entries] + apply Matrix.ext + intro i j + change (∑ k:T,E.differential i k*(if (k:I)=j then vertexId Q (K:=K) (E.placement k).color else 0))=E.differential i j + by_cases hj:j∈T + · let j':T:=⟨j,hj⟩ + have he (k:T) : ((k:I)=j) ↔ k=j' := by simp only [j',Subtype.ext_iff] + simp only [he,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] + exact E.entries.2 i j + · have hz:E.differential i j=0 := Classical.not_not.mp (fun hh=>hj (h i i.property j hh)) + rw [hz] + apply Finset.sum_eq_zero + intro k _ + have hne:(k:I)≠j := by intro he; exact hj (he ▸ k.property) + rw [ite_eq_right hne,MulZeroClass.mul_zero] + +omit [Fintype V] [DecidableEq A] in +lemma highProjection_commute (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + E.differential*blockProjection Q E Tᶜ= + blockProjection Q E Tᶜ*(highRestriction Q E T h).differential := by + rw [mul_blockProjection Q E Tᶜ _ _ E.entries] + apply Matrix.ext + intro i j + change E.differential i j=(∑ k:(Tᶜ:Set I),(if i=(k:I) then vertexId Q (K:=K) (E.placement i).color else 0)*E.differential k j) + by_cases hi:i∈Tᶜ + · let i':(Tᶜ:Set I):=⟨i,hi⟩ + have he (k:(Tᶜ:Set I)) : (i=(k:I)) ↔ i'=k := by simp only [i',Subtype.ext_iff] + simp only [he,ite_mul,zero_mul,Fintype.sum_ite_eq] + exact (E.entries.1 i j).symm + · have hi':i∈T:=Classical.not_not.mp hi + have hz:E.differential i j=0 := Classical.not_not.mp (fun hh=>j.property (h i hi' j hh)) + rw [hz] + symm + apply Finset.sum_eq_zero + intro k _ + have hne:i≠(k:I) := by intro he; exact hi (he.symm ▸ k.property) + rw [ite_eq_right hne,zero_mul] + +noncomputable def lowInclusion (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + Map Q (lowRestriction Q E T h) E where + matrix:=blockInclusion Q E T + entries:=blockInclusion_entries Q E T + degree:=fun i j=>mapDegree_identity Q (i:I) j + commute:=lowInclusion_commute Q E T h + +noncomputable def highProjection (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + Map Q E (highRestriction Q E T h) where + matrix:=blockProjection Q E Tᶜ + entries:=blockProjection_entries Q E Tᶜ + degree:=fun i j=>mapDegree_identity Q i (j:I) + commute:=highProjection_commute Q E T h + +def lowerLevelSet (E:BasedComplex Q (K:=K) I) (d:ℤ) : Set I := {i|(E.placement i).level≤d} + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma levelDownClosed (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : + DownClosed Q E (lowerLevelSet Q E d) := by + intro i hi j hij + have h:=differential_level Q E hE hij + change (E.placement j).level≤d + change (E.placement i).level≤d at hi + rcases h with h|h <;> omega + +noncomputable def lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) := + lowRestriction Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d) +noncomputable def upperTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) := + highRestriction Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma lowerTruncation_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : + (lowerTruncation Q E hE d).IsMinimal Q := fun i j=>hE i j +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma upperTruncation_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : + (upperTruncation Q E hE d).IsMinimal Q := fun i j=>hE i j + +noncomputable def lowConeNormalized (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) := + ((lowInclusion Q E T h).cone Q).reindex Q (Equiv.sumCongr (Equiv.refl T) (Equiv.Set.sumCompl T)) + +noncomputable def lowConePivot (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + BlockPivot Q (lowConeNormalized Q E T h) where + coefficient:=1 + nonzero:=one_ne_zero + color _:=rfl + cochain i:=by change (E.placement i).cochain=(E.placement i).cochain-1+1; omega + internal _:=rfl + entry i j:=by + change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= + 1 • (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) + simp only [one_smul,Subtype.val_inj] + +omit [Fintype V] [DecidableEq A] in +lemma lowCone_source_retained (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) + (i:T) (j:(Tᶜ:Set I)) : (lowConeNormalized Q E T h).differential (.inl i) (.inr (.inr j))=0 := by + change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)=0 + have hn:(i:I)≠(j:I):=fun he=>j.property (he ▸ i.property) + rw [ite_eq_right hn] + +omit [Fintype V] [DecidableEq A] in +lemma lowCone_reduced_eq (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + (lowConePivot Q E T h).reduced Q=highRestriction Q E T h := by + apply ext_placement_differential Q + · rfl + · apply Matrix.ext + intro i j + rw [BlockPivot.reduced_differential] + simp only [lowCone_source_retained,MulZeroClass.mul_zero,Finset.sum_const_zero,sub_zero] + rfl + +noncomputable def lowConeReduction (E:BasedComplex Q (K:=K) I) (T:Set I) (h:DownClosed Q E T) : + HomotopyEquivalence Q ((lowInclusion Q E T h).cone Q) (highRestriction Q E T h) := by + have e:=(((lowInclusion Q E T h).cone Q).reindexHomotopyEquivalence Q + (Equiv.sumCongr (Equiv.refl T) (Equiv.Set.sumCompl T))).trans Q + ((lowConePivot Q E T h).reductionEquivalence Q) + rw [lowCone_reduced_eq] at e + exact e + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/EmptyTestIndex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/EmptyTestIndex.lean index 324490f909646aa66ce2c89bafc5fd02b3229917..3d80b69281ae38f62230dbee071adbed06ae731b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/EmptyTestIndex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/EmptyTestIndex.lean @@ -1,63 +1,63 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseWordAction -import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type u} [Fintype I] [DecidableEq I] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma far_test_empty (E:BasedComplex Q (K:=K) I) (U:Set V) - (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) - (α:V) (hα:α∈U) : IsEmpty (TestIndex Q E.placement α) := - ⟨fun p=>hE p.1 (Q.corner_target_mem_neighborhood hα p.2)⟩ - -def emptyTestIndex (E:BasedComplex Q (K:=K) I) (α:V) - (h:IsEmpty (TestIndex Q E.placement α)) : I ≃ I ⊕ TestIndex Q E.placement α where - toFun:=Sum.inl - invFun - | .inl i=>i - | .inr p=>h.false p |>.elim - left_inv _:=rfl - right_inv k:=by cases k with - | inl i=>rfl - | inr p=>exact (h.false p).elim - -omit [DecidableEq I] in -lemma negativeTwist_empty_reindex (E:BasedComplex Q (K:=K) I) (α:V) - (h:IsEmpty (TestIndex Q E.placement α)) : - (E.negativeTwist Q α).reindex Q (emptyTestIndex Q E α h)=E := by - apply ext_placement_differential Q <;> rfl - -noncomputable def negativeTwistFar (E:BasedComplex Q (K:=K) I) (U:Set V) - (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) - (α:V) (hα:α∈U) : HomotopyEquivalence Q (E.negativeTwist Q α) E := by - let h:=far_test_empty Q E U hE α hα - have e:=(E.negativeTwist Q α).reindexHomotopyEquivalence Q (emptyTestIndex Q E α h) - rw [negativeTwist_empty_reindex] at e - exact e - -lemma classNegativeTwist_far (E:BasedComplex Q (K:=K) I) (U:Set V) - (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) - (α:V) (hα:α∈U) : - classNegativeTwist Q α (classOfComplex Q E)=classOfComplex Q E := - classOfComplex_eq Q (negativeTwistFar Q E U hE α hα) - -lemma inverseWord_far (E:BasedComplex Q (K:=K) I) (U:Set V) - (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) - (w:List V) (hw:∀ α∈w,α∈U) : - inverseWordAction Q w (classOfComplex Q E)=classOfComplex Q E := by - induction w with - | nil=>rfl - | cons α w ih=> - rw [inverseWordAction,classNegativeTwist_far Q E U hE α (hw α (by simp))] - exact ih (fun β hβ=>hw β (by simp [hβ])) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseWordAction +import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma far_test_empty (E:BasedComplex Q (K:=K) I) (U:Set V) + (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) + (α:V) (hα:α∈U) : IsEmpty (TestIndex Q E.placement α) := + ⟨fun p=>hE p.1 (Q.corner_target_mem_neighborhood hα p.2)⟩ + +def emptyTestIndex (E:BasedComplex Q (K:=K) I) (α:V) + (h:IsEmpty (TestIndex Q E.placement α)) : I ≃ I ⊕ TestIndex Q E.placement α where + toFun:=Sum.inl + invFun + | .inl i=>i + | .inr p=>h.false p |>.elim + left_inv _:=rfl + right_inv k:=by cases k with + | inl i=>rfl + | inr p=>exact (h.false p).elim + +omit [DecidableEq I] in +lemma negativeTwist_empty_reindex (E:BasedComplex Q (K:=K) I) (α:V) + (h:IsEmpty (TestIndex Q E.placement α)) : + (E.negativeTwist Q α).reindex Q (emptyTestIndex Q E α h)=E := by + apply ext_placement_differential Q <;> rfl + +noncomputable def negativeTwistFar (E:BasedComplex Q (K:=K) I) (U:Set V) + (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) + (α:V) (hα:α∈U) : HomotopyEquivalence Q (E.negativeTwist Q α) E := by + let h:=far_test_empty Q E U hE α hα + have e:=(E.negativeTwist Q α).reindexHomotopyEquivalence Q (emptyTestIndex Q E α h) + rw [negativeTwist_empty_reindex] at e + exact e + +lemma classNegativeTwist_far (E:BasedComplex Q (K:=K) I) (U:Set V) + (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) + (α:V) (hα:α∈U) : + classNegativeTwist Q α (classOfComplex Q E)=classOfComplex Q E := + classOfComplex_eq Q (negativeTwistFar Q E U hE α hα) + +lemma inverseWord_far (E:BasedComplex Q (K:=K) I) (U:Set V) + (hE:∀ i,(E.placement i).color∉Q.closedNeighborhood U) + (w:List V) (hw:∀ α∈w,α∈U) : + inverseWordAction Q w (classOfComplex Q E)=classOfComplex Q E := by + induction w with + | nil=>rfl + | cons α w ih=> + rw [inverseWordAction,classNegativeTwist_far Q E U hE α (hw α (by simp))] + exact ih (fun β hβ=>hw β (by simp [hβ])) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/EqualColorPair.lean b/lean/OAI/Topology/ArtinGroups/Complexes/EqualColorPair.lean index 2b09798518057c78a67507d8a78e99575fbcb21a..62a915df3c65098d216d12a1a60245740615df89 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/EqualColorPair.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/EqualColorPair.lean @@ -1,98 +1,98 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PureTotalHomEuler -import OAI.Topology.ArtinGroups.Complexes.CornerPath - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -abbrev EqualColorPair (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) := - {ij : I × J // (E.placement ij.1).color = (F.placement ij.2).color} - -abbrev ArrowPair (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) := - {t : I × J × A // Q.source t.2.2 = (E.placement t.1).color ∧ - Q.target t.2.2 = (F.placement t.2.1).color} - -noncomputable def zeroCornerEquiv (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) : CornerPath Q E F 0 ≃ EqualColorPair Q E F where - toFun x := ⟨(x.val.1,x.val.2.1), by - rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ - rcases p with p | p | p - · exact hs.symm.trans ht - · simp only [Path.length] at hl; omega - · simp only [Path.length] at hl; omega⟩ - invFun x := ⟨(x.val.1,x.val.2,Sum.inl (E.placement x.val.1).color),rfl,x.property,rfl⟩ - left_inv x := by - apply Subtype.ext - rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ - dsimp only - rcases p with p | p | p - · dsimp only [Path.source] at hs - subst p - rfl - · simp only [Path.length] at hl; omega - · simp only [Path.length] at hl; omega - right_inv x := by rfl - -noncomputable def tokenCornerEquiv (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) : CornerPath Q E F 2 ≃ EqualColorPair Q E F where - toFun x := ⟨(x.val.1,x.val.2.1), by - rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ - rcases p with p | p | p - · simp only [Path.length] at hl; omega - · simp only [Path.length] at hl; omega - · exact hs.symm.trans ht⟩ - invFun x := ⟨(x.val.1,x.val.2,Sum.inr (Sum.inr (E.placement x.val.1).color)),rfl,x.property,rfl⟩ - left_inv x := by - apply Subtype.ext - rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ - dsimp only - rcases p with p | p | p - · simp only [Path.length] at hl; omega - · simp only [Path.length] at hl; omega - · dsimp only [Path.source] at hs - subst p - rfl - right_inv x := by rfl - -noncomputable def arrowCornerEquiv (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) : CornerPath Q E F 1 ≃ ArrowPair Q E F where - toFun x := by - rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ - rcases p with p | p | p - · simp only [Path.length] at hl; omega - · exact ⟨(i,j,p),hs,ht⟩ - · simp only [Path.length] at hl; omega - invFun x := ⟨(x.val.1,x.val.2.1,Sum.inr (Sum.inl x.val.2.2)),x.property.1,x.property.2,rfl⟩ - left_inv x := by - apply Subtype.ext - rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ - rcases p with p | p | p - · simp only [Path.length] at hl; omega - · rfl - · simp only [Path.length] at hl; omega - right_inv x := by rfl - -lemma pure_generator_euler (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) : - 2 * Nat.card (EqualColorPair Q E F) + totalHomDimension Q E F (k-l+1) = - Nat.card (ArrowPair Q E F) + totalHomDimension Q E F (k-l) + - totalHomDimension Q F E (l-k) := by - have hh := pure_total_hom_euler Q E F hE hF - have h₀ := totalChainDimension_eq_card Q E F hE hF 0 - have h₁ := totalChainDimension_eq_card Q E F hE hF 1 - have h₂ := totalChainDimension_eq_card Q E F hE hF 2 - rw [Nat.card_congr (zeroCornerEquiv Q E F)] at h₀ - rw [Nat.card_congr (arrowCornerEquiv Q E F)] at h₁ - rw [Nat.card_congr (tokenCornerEquiv Q E F)] at h₂ - simp only [add_zero] at h₀ - rw [h₀,h₁,h₂] at hh - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PureTotalHomEuler +import OAI.Topology.ArtinGroups.Complexes.CornerPath + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +abbrev EqualColorPair (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) := + {ij : I × J // (E.placement ij.1).color = (F.placement ij.2).color} + +abbrev ArrowPair (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) := + {t : I × J × A // Q.source t.2.2 = (E.placement t.1).color ∧ + Q.target t.2.2 = (F.placement t.2.1).color} + +noncomputable def zeroCornerEquiv (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) : CornerPath Q E F 0 ≃ EqualColorPair Q E F where + toFun x := ⟨(x.val.1,x.val.2.1), by + rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ + rcases p with p | p | p + · exact hs.symm.trans ht + · simp only [Path.length] at hl; omega + · simp only [Path.length] at hl; omega⟩ + invFun x := ⟨(x.val.1,x.val.2,Sum.inl (E.placement x.val.1).color),rfl,x.property,rfl⟩ + left_inv x := by + apply Subtype.ext + rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ + dsimp only + rcases p with p | p | p + · dsimp only [Path.source] at hs + subst p + rfl + · simp only [Path.length] at hl; omega + · simp only [Path.length] at hl; omega + right_inv x := by rfl + +noncomputable def tokenCornerEquiv (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) : CornerPath Q E F 2 ≃ EqualColorPair Q E F where + toFun x := ⟨(x.val.1,x.val.2.1), by + rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ + rcases p with p | p | p + · simp only [Path.length] at hl; omega + · simp only [Path.length] at hl; omega + · exact hs.symm.trans ht⟩ + invFun x := ⟨(x.val.1,x.val.2,Sum.inr (Sum.inr (E.placement x.val.1).color)),rfl,x.property,rfl⟩ + left_inv x := by + apply Subtype.ext + rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ + dsimp only + rcases p with p | p | p + · simp only [Path.length] at hl; omega + · simp only [Path.length] at hl; omega + · dsimp only [Path.source] at hs + subst p + rfl + right_inv x := by rfl + +noncomputable def arrowCornerEquiv (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) : CornerPath Q E F 1 ≃ ArrowPair Q E F where + toFun x := by + rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ + rcases p with p | p | p + · simp only [Path.length] at hl; omega + · exact ⟨(i,j,p),hs,ht⟩ + · simp only [Path.length] at hl; omega + invFun x := ⟨(x.val.1,x.val.2.1,Sum.inr (Sum.inl x.val.2.2)),x.property.1,x.property.2,rfl⟩ + left_inv x := by + apply Subtype.ext + rcases x with ⟨⟨i,j,p⟩,hs,ht,hl⟩ + rcases p with p | p | p + · simp only [Path.length] at hl; omega + · rfl + · simp only [Path.length] at hl; omega + right_inv x := by rfl + +lemma pure_generator_euler (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) : + 2 * Nat.card (EqualColorPair Q E F) + totalHomDimension Q E F (k-l+1) = + Nat.card (ArrowPair Q E F) + totalHomDimension Q E F (k-l) + + totalHomDimension Q F E (l-k) := by + have hh := pure_total_hom_euler Q E F hE hF + have h₀ := totalChainDimension_eq_card Q E F hE hF 0 + have h₁ := totalChainDimension_eq_card Q E F hE hF 1 + have h₂ := totalChainDimension_eq_card Q E F hE hF 2 + rw [Nat.card_congr (zeroCornerEquiv Q E F)] at h₀ + rw [Nat.card_congr (arrowCornerEquiv Q E F)] at h₁ + rw [Nat.card_congr (tokenCornerEquiv Q E F)] at h₂ + simp only [add_zero] at h₀ + rw [h₀,h₁,h₂] at hh + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ExtendLayer.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ExtendLayer.lean index 0241c659cc86e9a3579da151c24401b84f0bff04..a1217835ef5819251c6c4618c5bca987cec8e073 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ExtendLayer.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ExtendLayer.lean @@ -1,129 +1,129 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.LinearMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] - -lemma tokenOnly_mul_positive {x y : Q.Zigzag K} - (hx : x.vertex = 0) (ha : x.arrow = 0) (hy : y.vertex = 0) : x * y = 0 := by - apply ext - · change (x * y).vertex = 0 - rw [vertex_mul, hx, MulZeroClass.zero_mul] - · change (x * y).arrow = 0 - rw [arrow_mul, hx, ha] - ext a - simp [leftScale, rightScale] - · change (x * y).token = 0 - rw [token_mul, hx, ha, hy, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - backtrack_zero_left, add_zero, add_zero] - -lemma positive_mul_tokenOnly {x y : Q.Zigzag K} - (hx : x.vertex = 0) (hy : y.vertex = 0) (ha : y.arrow = 0) : x * y = 0 := by - apply ext - · change (x * y).vertex = 0 - rw [vertex_mul, hx, MulZeroClass.zero_mul] - · change (x * y).arrow = 0 - rw [arrow_mul, hx, hy] - ext a - simp [leftScale, rightScale] - · change (x * y).token = 0 - rw [token_mul, hx, hy, ha, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - backtrack_zero_right, add_zero, add_zero] - -namespace BasedComplex -variable {I J : Type*} [Fintype I] [Fintype J] - -lemma differential_arrow_level (E : BasedComplex Q (K := K) I) {i j : I} - (h : (E.placement j).level ≠ (E.placement i).level) : - (E.differential i j).arrow = 0 := by - by_cases hc : (E.placement j).cochain = (E.placement i).cochain + 1 - · apply (E.degree i j).2.2.1 - dsimp only [GeneratorPlacement.level] at h - omega - · rw [(E.degree i j).1 hc] - rfl - -def extendLayer (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (l k : ℤ) : - Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K) →ₗ[K] - Matrix I J (Q.Zigzag K) where - toFun f i j := if hi : (E.placement i).level = l then - if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0 - map_add' f g := by - apply Matrix.ext - intro i j - change (if hi : (E.placement i).level = l then - if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ + g ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) = - (if hi : (E.placement i).level = l then - if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) + - (if hi : (E.placement i).level = l then - if hj : (F.placement j).level = k then g ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) - split_ifs <;> simp only [add_zero] - map_smul' r f := by - apply Matrix.ext - intro i j - change (if hi : (E.placement i).level = l then - if hj : (F.placement j).level = k then r • f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) = - r • (if hi : (E.placement i).level = l then - if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) - split_ifs <;> simp only [smul_zero] - -lemma extendLayer_entry (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (l k : ℤ) - (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) - (i : I) (j : J) : - extendLayer Q E F l k f i j = if hi : (E.placement i).level = l then - if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0 := rfl - -lemma extendLayer_apply (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (l k : ℤ) - (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) - (i : {i // (E.placement i).level = l}) (j : {j // (F.placement j).level = k}) : - extendLayer Q E F l k f i j = f i j := by - change (if hi : (E.placement i.val).level = l then - if hj : (F.placement j.val).level = k then f ⟨i.val, hi⟩ ⟨j.val, hj⟩ else 0 else 0) = f i j - rw [dite_eq_left i.property, dite_eq_left j.property] - -lemma extendLayer_linear (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (l k : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hf : LinearMatrix Q f) : LinearMatrix Q (extendLayer Q E F l k f) := by - intro i j - simp only [extendLayer_entry] - split_ifs with hi hj - · exact hf ⟨i, hi⟩ ⟨j, hj⟩ - · exact ⟨rfl, rfl⟩ - · exact ⟨rfl, rfl⟩ - -lemma extendLayer_homSpace (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (l k n v : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hf : f ∈ homSpace Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v) : - extendLayer Q E F l k f ∈ homSpace Q E F n v := by - constructor - · constructor <;> intro i j - · simp only [extendLayer_entry] - split_ifs with hi hj - · exact hf.1.1 ⟨i, hi⟩ ⟨j, hj⟩ - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · simp only [extendLayer_entry] - split_ifs with hi hj - · exact hf.1.2 ⟨i, hi⟩ ⟨j, hj⟩ - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · intro i j - simp only [extendLayer_entry] - split_ifs with hi hj - · exact hf.2 ⟨i, hi⟩ ⟨j, hj⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.LinearMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] + +lemma tokenOnly_mul_positive {x y : Q.Zigzag K} + (hx : x.vertex = 0) (ha : x.arrow = 0) (hy : y.vertex = 0) : x * y = 0 := by + apply ext + · change (x * y).vertex = 0 + rw [vertex_mul, hx, MulZeroClass.zero_mul] + · change (x * y).arrow = 0 + rw [arrow_mul, hx, ha] + ext a + simp [leftScale, rightScale] + · change (x * y).token = 0 + rw [token_mul, hx, ha, hy, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + backtrack_zero_left, add_zero, add_zero] + +lemma positive_mul_tokenOnly {x y : Q.Zigzag K} + (hx : x.vertex = 0) (hy : y.vertex = 0) (ha : y.arrow = 0) : x * y = 0 := by + apply ext + · change (x * y).vertex = 0 + rw [vertex_mul, hx, MulZeroClass.zero_mul] + · change (x * y).arrow = 0 + rw [arrow_mul, hx, hy] + ext a + simp [leftScale, rightScale] + · change (x * y).token = 0 + rw [token_mul, hx, hy, ha, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + backtrack_zero_right, add_zero, add_zero] + +namespace BasedComplex +variable {I J : Type*} [Fintype I] [Fintype J] + +lemma differential_arrow_level (E : BasedComplex Q (K := K) I) {i j : I} + (h : (E.placement j).level ≠ (E.placement i).level) : + (E.differential i j).arrow = 0 := by + by_cases hc : (E.placement j).cochain = (E.placement i).cochain + 1 + · apply (E.degree i j).2.2.1 + dsimp only [GeneratorPlacement.level] at h + omega + · rw [(E.degree i j).1 hc] + rfl + +def extendLayer (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (l k : ℤ) : + Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K) →ₗ[K] + Matrix I J (Q.Zigzag K) where + toFun f i j := if hi : (E.placement i).level = l then + if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0 + map_add' f g := by + apply Matrix.ext + intro i j + change (if hi : (E.placement i).level = l then + if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ + g ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) = + (if hi : (E.placement i).level = l then + if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) + + (if hi : (E.placement i).level = l then + if hj : (F.placement j).level = k then g ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) + split_ifs <;> simp only [add_zero] + map_smul' r f := by + apply Matrix.ext + intro i j + change (if hi : (E.placement i).level = l then + if hj : (F.placement j).level = k then r • f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) = + r • (if hi : (E.placement i).level = l then + if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0) + split_ifs <;> simp only [smul_zero] + +lemma extendLayer_entry (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (l k : ℤ) + (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) + (i : I) (j : J) : + extendLayer Q E F l k f i j = if hi : (E.placement i).level = l then + if hj : (F.placement j).level = k then f ⟨i, hi⟩ ⟨j, hj⟩ else 0 else 0 := rfl + +lemma extendLayer_apply (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (l k : ℤ) + (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) + (i : {i // (E.placement i).level = l}) (j : {j // (F.placement j).level = k}) : + extendLayer Q E F l k f i j = f i j := by + change (if hi : (E.placement i.val).level = l then + if hj : (F.placement j.val).level = k then f ⟨i.val, hi⟩ ⟨j.val, hj⟩ else 0 else 0) = f i j + rw [dite_eq_left i.property, dite_eq_left j.property] + +lemma extendLayer_linear (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (l k : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hf : LinearMatrix Q f) : LinearMatrix Q (extendLayer Q E F l k f) := by + intro i j + simp only [extendLayer_entry] + split_ifs with hi hj + · exact hf ⟨i, hi⟩ ⟨j, hj⟩ + · exact ⟨rfl, rfl⟩ + · exact ⟨rfl, rfl⟩ + +lemma extendLayer_homSpace (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (l k n v : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hf : f ∈ homSpace Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v) : + extendLayer Q E F l k f ∈ homSpace Q E F n v := by + constructor + · constructor <;> intro i j + · simp only [extendLayer_entry] + split_ifs with hi hj + · exact hf.1.1 ⟨i, hi⟩ ⟨j, hj⟩ + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · simp only [extendLayer_entry] + split_ifs with hi hj + · exact hf.1.2 ⟨i, hi⟩ ⟨j, hj⟩ + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · intro i j + simp only [extendLayer_entry] + split_ifs with hi hj + · exact hf.2 ⟨i, hi⟩ ⟨j, hj⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FamilySubobjectMiddleLower.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FamilySubobjectMiddleLower.lean index f695b64c12a286d22e1b31c39eb134b3291fc431..2c6762f30c9e120fa111d7684b05b356bd50eee3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FamilySubobjectMiddleLower.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FamilySubobjectMiddleLower.lean @@ -1,49 +1,49 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.SubobjectMiddleLowerBound - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -open Matrix - -variable {V A T K:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype T] -attribute [local instance] Classical.decEq Classical.propDecidable - -lemma family_subobject_middle_lower_bound {B H:Type*} [Fintype H] - (M:H→FiniteModel Q (K:=K)) (Y:BasedComplex Q (K:=K) T) - {q d:ℤ} (hM:∀h i,((M h).complex.placement i).level=q) - (hY:∀i,(Y.placement i).level=d) - (F:B→H→FiniteModel Q (K:=K)) (hF:∀b h i,((F b h).complex.placement i).level=q) - (ι:∀b h,TermwiseSplitInjection Q (F b h).complex (M h).complex) - (active:Set V) (hsF:∀b h i,((F b h).complex.placement i).color∈active) - (hsY:∀α∈active,∀c,coefficientSocle Q Y α c=⊥) - (ω:H→ℝ) (hω:∀h,0≤ω h) (e:V→ℝ) - (he:e∈convexHull ℝ (Set.range fun b=>∑h,ω h • generatorVector Q (F b h).complex)) : - generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec - (e-∑h,ω h • generatorVector Q (M h).complex))≤ - ∑h,ω h*(totalHomDimension Q Y (M h).complex (q-d+1):ℝ) := by - let L:(V→ℝ)→ₗ[ℝ]ℝ:= - { toFun:=fun x=>generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec x) - map_add':=fun x y=>by simp only [mulVec_add,dotProduct_add] - map_smul':=fun r x=>by simp only [mulVec_smul,dotProduct_smul,smul_eq_mul,RingHom.id_apply] } - let m:V→ℝ:=∑h,ω h • generatorVector Q (M h).complex - let D:ℝ:=∑h,ω h*(totalHomDimension Q Y (M h).complex (q-d+1):ℝ) - have hbound (b:B):L (∑h,ω h • generatorVector Q (F b h).complex)-L m≤D := by - have hh:=Finset.sum_le_sum (s:=Finset.univ) (fun h _=>mul_le_mul_of_nonneg_left - (subobject_middle_lower_bound Q (M h).complex (F b h).complex Y - (hM h) (hF b h) hY (ι b h) active (hsF b h) hsY) (hω h)) - change (∑h,ω h*L (generatorVector Q (F b h).complex-generatorVector Q (M h).complex))≤D at hh - simp only [map_sub,mul_sub,Finset.sum_sub_distrib] at hh - simpa only [m,map_sum,map_smul,smul_eq_mul,RingHom.id_apply] using hh - have hinc:Set.range (fun b=>∑h,ω h • generatorVector Q (F b h).complex)⊆L ⁻¹' Set.Iic (D+L m) := by - rintro x ⟨b,rfl⟩ - exact sub_le_iff_le_add.mp (hbound b) - have hh:=convexHull_min hinc ((convex_Iic (D+L m)).linear_preimage L) he - change L (e-m)≤D - rw [map_sub] - exact sub_le_iff_le_add.mpr hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.SubobjectMiddleLowerBound + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +open Matrix + +variable {V A T K:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype T] +attribute [local instance] Classical.decEq Classical.propDecidable + +lemma family_subobject_middle_lower_bound {B H:Type*} [Fintype H] + (M:H→FiniteModel Q (K:=K)) (Y:BasedComplex Q (K:=K) T) + {q d:ℤ} (hM:∀h i,((M h).complex.placement i).level=q) + (hY:∀i,(Y.placement i).level=d) + (F:B→H→FiniteModel Q (K:=K)) (hF:∀b h i,((F b h).complex.placement i).level=q) + (ι:∀b h,TermwiseSplitInjection Q (F b h).complex (M h).complex) + (active:Set V) (hsF:∀b h i,((F b h).complex.placement i).color∈active) + (hsY:∀α∈active,∀c,coefficientSocle Q Y α c=⊥) + (ω:H→ℝ) (hω:∀h,0≤ω h) (e:V→ℝ) + (he:e∈convexHull ℝ (Set.range fun b=>∑h,ω h • generatorVector Q (F b h).complex)) : + generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec + (e-∑h,ω h • generatorVector Q (M h).complex))≤ + ∑h,ω h*(totalHomDimension Q Y (M h).complex (q-d+1):ℝ) := by + let L:(V→ℝ)→ₗ[ℝ]ℝ:= + { toFun:=fun x=>generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec x) + map_add':=fun x y=>by simp only [mulVec_add,dotProduct_add] + map_smul':=fun r x=>by simp only [mulVec_smul,dotProduct_smul,smul_eq_mul,RingHom.id_apply] } + let m:V→ℝ:=∑h,ω h • generatorVector Q (M h).complex + let D:ℝ:=∑h,ω h*(totalHomDimension Q Y (M h).complex (q-d+1):ℝ) + have hbound (b:B):L (∑h,ω h • generatorVector Q (F b h).complex)-L m≤D := by + have hh:=Finset.sum_le_sum (s:=Finset.univ) (fun h _=>mul_le_mul_of_nonneg_left + (subobject_middle_lower_bound Q (M h).complex (F b h).complex Y + (hM h) (hF b h) hY (ι b h) active (hsF b h) hsY) (hω h)) + change (∑h,ω h*L (generatorVector Q (F b h).complex-generatorVector Q (M h).complex))≤D at hh + simp only [map_sub,mul_sub,Finset.sum_sub_distrib] at hh + simpa only [m,map_sum,map_smul,smul_eq_mul,RingHom.id_apply] using hh + have hinc:Set.range (fun b=>∑h,ω h • generatorVector Q (F b h).complex)⊆L ⁻¹' Set.Iic (D+L m) := by + rintro x ⟨b,rfl⟩ + exact sub_le_iff_le_add.mp (hbound b) + have hh:=convexHull_min hinc ((convex_Iic (D+L m)).linear_preimage L) he + change L (e-m)≤D + rw [map_sub] + exact sub_le_iff_le_add.mpr hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteFamilyLevelSupport.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteFamilyLevelSupport.lean index 822b09312cd74078c9111480b351309e40f2f387..620f97ff152e9c8edbbd1d05b134089c10f827a5 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteFamilyLevelSupport.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteFamilyLevelSupport.lean @@ -1,30 +1,30 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.LevelArrayMinimalApply - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in -lemma finiteFamily_level_support {R:Type} [Finite R] - (x:R→FiniteHomotopyClass Q (K:=K)) : - {k:ℤ | ∃ r α,classLevelArray Q (x r) (α,k)≠0}.Finite := by - let F : Set ℤ := Set.range (fun z:Σ r:R,(minimalClassModel Q (x r)).Index=> - ((minimalClassModel Q (x z.1)).complex.placement z.2).level) - have hF:F.Finite:=Set.finite_range _ - apply hF.subset - rintro k ⟨r,α,hk⟩ - rw [classLevelArray_minimal_apply] at hk - have hn:Nonempty {i:(minimalClassModel Q (x r)).Index // - ((minimalClassModel Q (x r)).complex.placement i).color=α ∧ - ((minimalClassModel Q (x r)).complex.placement i).level=k} := - Nat.card_ne_zero.mp hk |>.1 - obtain ⟨i⟩:=hn - exact ⟨⟨r,i.val⟩,i.property.2⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.LevelArrayMinimalApply + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [Fintype V] [DecidableEq A] in +lemma finiteFamily_level_support {R:Type} [Finite R] + (x:R→FiniteHomotopyClass Q (K:=K)) : + {k:ℤ | ∃ r α,classLevelArray Q (x r) (α,k)≠0}.Finite := by + let F : Set ℤ := Set.range (fun z:Σ r:R,(minimalClassModel Q (x r)).Index=> + ((minimalClassModel Q (x z.1)).complex.placement z.2).level) + have hF:F.Finite:=Set.finite_range _ + apply hF.subset + rintro k ⟨r,α,hk⟩ + rw [classLevelArray_minimal_apply] at hk + have hn:Nonempty {i:(minimalClassModel Q (x r)).Index // + ((minimalClassModel Q (x r)).complex.placement i).color=α ∧ + ((minimalClassModel Q (x r)).complex.placement i).level=k} := + Nat.card_ne_zero.mp hk |>.1 + obtain ⟨i⟩:=hn + exact ⟨⟨r,i.val⟩,i.property.2⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteHomotopySetoid.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteHomotopySetoid.lean index 1e1e2483e73735a79cf65736d2f0b466a6c18b52..c7919f301d9fd9262da82c9177e88a422268a5ea 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteHomotopySetoid.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteHomotopySetoid.lean @@ -1,118 +1,118 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistHomotopy -import OAI.Topology.ArtinGroups.Complexes.NormalizedInverseTwistHomotopy -import OAI.Topology.ArtinGroups.Complexes.NormalizedReverseTwistHomotopy -import OAI.Topology.ArtinGroups.Complexes.CommuteTwistSwap -import OAI.Topology.ArtinGroups.Coxeter.BraidCorePlacement - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -universe u - -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -def finiteHomotopySetoid : Setoid (FiniteModel.{u} Q (K := K)) where - r E F := Nonempty (HomotopyEquivalence Q E.complex F.complex) - iseqv := { - refl E := ⟨HomotopyEquivalence.refl Q E.complex⟩ - symm := fun ⟨e⟩ => ⟨e.symm Q⟩ - trans := fun ⟨e⟩ ⟨f⟩ => ⟨e.trans Q f⟩ } - -abbrev FiniteHomotopyClass := Quotient (finiteHomotopySetoid Q (K := K)) - -noncomputable def classPositiveTwist (α : V) : - FiniteHomotopyClass Q (K := K) → FiniteHomotopyClass Q (K := K) := - Quotient.map (fun E => FiniteModel.ofComplex Q (E.complex.positiveTwist Q α)) - (by - intro E F ⟨e⟩ - change Nonempty (HomotopyEquivalence Q (E.complex.positiveTwist Q α) - (F.complex.positiveTwist Q α)) - refine ⟨?_⟩ - convert e.positiveTwist Q α using 1) - -noncomputable def classNegativeTwist (α : V) : - FiniteHomotopyClass Q (K := K) → FiniteHomotopyClass Q (K := K) := - Quotient.map (fun E => FiniteModel.ofComplex Q (E.complex.negativeTwist Q α)) - (by - intro E F ⟨e⟩ - change Nonempty (HomotopyEquivalence Q (E.complex.negativeTwist Q α) - (F.complex.negativeTwist Q α)) - refine ⟨?_⟩ - convert e.negativeTwist Q α using 1) - -noncomputable def classTwistPerm (hn : ∀ a, Q.source a ≠ Q.target a) (α : V) : - Equiv.Perm (FiniteHomotopyClass Q (K := K)) where - toFun := classPositiveTwist Q α - invFun := classNegativeTwist Q α - left_inv := by - intro x - induction x using Quotient.inductionOn with | _ E => - apply Quotient.sound - exact ⟨negative_positive_homotopyEquivalence Q hn E.complex α⟩ - right_inv := by - intro x - induction x using Quotient.inductionOn with | _ E => - apply Quotient.sound - exact ⟨positive_negative_homotopyEquivalence Q hn E.complex α⟩ - -lemma classTwistPerm_orthogonal (hn : ∀ a, Q.source a ≠ Q.target a) - {α β : V} (h : OrthogonalVertices Q α β) : - classTwistPerm Q (K := K) hn α * classTwistPerm Q hn β = - classTwistPerm Q hn β * classTwistPerm Q hn α := by - apply Equiv.ext - intro x - induction x using Quotient.inductionOn with | _ E => - apply Quotient.sound - exact ⟨orthogonal_positiveTwists Q E.complex h⟩ - -lemma classTwistPerm_adjacent (hn : ∀ a, Q.source a ≠ Q.target a) - {α β : V} (e : SimpleEdge Q α β) : - classTwistPerm Q (K := K) hn α * classTwistPerm Q hn β * classTwistPerm Q hn α = - classTwistPerm Q hn β * classTwistPerm Q hn α * classTwistPerm Q hn β := by - apply Equiv.ext - intro x - induction x using Quotient.inductionOn with | _ E => - apply Quotient.sound - exact ⟨adjacent_positiveTwists Q hn E.complex e⟩ - -namespace FiniteModel - -noncomputable def minimalRepresentative (E : FiniteModel.{u} Q (K := K)) : - FiniteModel.{u} Q (K := K) := (E.exists_minimal Q).choose - -omit [Fintype V] [DecidableEq A] in -lemma minimalRepresentative_minimal (E : FiniteModel.{u} Q (K := K)) : - (E.minimalRepresentative Q).complex.IsMinimal Q := (E.exists_minimal Q).choose_spec.1 - -noncomputable def minimalRepresentativeEquivalence (E : FiniteModel.{u} Q (K := K)) : - HomotopyEquivalence Q E.complex (E.minimalRepresentative Q).complex := - (E.exists_minimal Q).choose_spec.2.some - -end FiniteModel - -noncomputable def classMultiplicity (a : GeneratorPlacement V) : - FiniteHomotopyClass Q (K := K) → ℕ := - Quotient.lift (fun E => (E.minimalRepresentative Q).complex.multiplicity Q a) - (by - intro E F h - obtain ⟨e⟩ := h - exact multiplicity_eq_of_minimal_homotopyEquivalence Q _ _ - (E.minimalRepresentative_minimal Q) (F.minimalRepresentative_minimal Q) - (((E.minimalRepresentativeEquivalence Q).symm Q).trans Q - (e.trans Q (F.minimalRepresentativeEquivalence Q))) a) - -omit [Fintype V] [DecidableEq A] in -lemma classMultiplicity_of_minimal (E : FiniteModel.{u} Q (K := K)) - (hE : E.complex.IsMinimal Q) (a : GeneratorPlacement V) : - classMultiplicity Q a (Quotient.mk (finiteHomotopySetoid Q) E) = - E.complex.multiplicity Q a := by - exact (multiplicity_eq_of_minimal_homotopyEquivalence Q _ _ hE - (E.minimalRepresentative_minimal Q) (E.minimalRepresentativeEquivalence Q) a).symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistHomotopy +import OAI.Topology.ArtinGroups.Complexes.NormalizedInverseTwistHomotopy +import OAI.Topology.ArtinGroups.Complexes.NormalizedReverseTwistHomotopy +import OAI.Topology.ArtinGroups.Complexes.CommuteTwistSwap +import OAI.Topology.ArtinGroups.Coxeter.BraidCorePlacement + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +universe u + +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +def finiteHomotopySetoid : Setoid (FiniteModel.{u} Q (K := K)) where + r E F := Nonempty (HomotopyEquivalence Q E.complex F.complex) + iseqv := { + refl E := ⟨HomotopyEquivalence.refl Q E.complex⟩ + symm := fun ⟨e⟩ => ⟨e.symm Q⟩ + trans := fun ⟨e⟩ ⟨f⟩ => ⟨e.trans Q f⟩ } + +abbrev FiniteHomotopyClass := Quotient (finiteHomotopySetoid Q (K := K)) + +noncomputable def classPositiveTwist (α : V) : + FiniteHomotopyClass Q (K := K) → FiniteHomotopyClass Q (K := K) := + Quotient.map (fun E => FiniteModel.ofComplex Q (E.complex.positiveTwist Q α)) + (by + intro E F ⟨e⟩ + change Nonempty (HomotopyEquivalence Q (E.complex.positiveTwist Q α) + (F.complex.positiveTwist Q α)) + refine ⟨?_⟩ + convert e.positiveTwist Q α using 1) + +noncomputable def classNegativeTwist (α : V) : + FiniteHomotopyClass Q (K := K) → FiniteHomotopyClass Q (K := K) := + Quotient.map (fun E => FiniteModel.ofComplex Q (E.complex.negativeTwist Q α)) + (by + intro E F ⟨e⟩ + change Nonempty (HomotopyEquivalence Q (E.complex.negativeTwist Q α) + (F.complex.negativeTwist Q α)) + refine ⟨?_⟩ + convert e.negativeTwist Q α using 1) + +noncomputable def classTwistPerm (hn : ∀ a, Q.source a ≠ Q.target a) (α : V) : + Equiv.Perm (FiniteHomotopyClass Q (K := K)) where + toFun := classPositiveTwist Q α + invFun := classNegativeTwist Q α + left_inv := by + intro x + induction x using Quotient.inductionOn with | _ E => + apply Quotient.sound + exact ⟨negative_positive_homotopyEquivalence Q hn E.complex α⟩ + right_inv := by + intro x + induction x using Quotient.inductionOn with | _ E => + apply Quotient.sound + exact ⟨positive_negative_homotopyEquivalence Q hn E.complex α⟩ + +lemma classTwistPerm_orthogonal (hn : ∀ a, Q.source a ≠ Q.target a) + {α β : V} (h : OrthogonalVertices Q α β) : + classTwistPerm Q (K := K) hn α * classTwistPerm Q hn β = + classTwistPerm Q hn β * classTwistPerm Q hn α := by + apply Equiv.ext + intro x + induction x using Quotient.inductionOn with | _ E => + apply Quotient.sound + exact ⟨orthogonal_positiveTwists Q E.complex h⟩ + +lemma classTwistPerm_adjacent (hn : ∀ a, Q.source a ≠ Q.target a) + {α β : V} (e : SimpleEdge Q α β) : + classTwistPerm Q (K := K) hn α * classTwistPerm Q hn β * classTwistPerm Q hn α = + classTwistPerm Q hn β * classTwistPerm Q hn α * classTwistPerm Q hn β := by + apply Equiv.ext + intro x + induction x using Quotient.inductionOn with | _ E => + apply Quotient.sound + exact ⟨adjacent_positiveTwists Q hn E.complex e⟩ + +namespace FiniteModel + +noncomputable def minimalRepresentative (E : FiniteModel.{u} Q (K := K)) : + FiniteModel.{u} Q (K := K) := (E.exists_minimal Q).choose + +omit [Fintype V] [DecidableEq A] in +lemma minimalRepresentative_minimal (E : FiniteModel.{u} Q (K := K)) : + (E.minimalRepresentative Q).complex.IsMinimal Q := (E.exists_minimal Q).choose_spec.1 + +noncomputable def minimalRepresentativeEquivalence (E : FiniteModel.{u} Q (K := K)) : + HomotopyEquivalence Q E.complex (E.minimalRepresentative Q).complex := + (E.exists_minimal Q).choose_spec.2.some + +end FiniteModel + +noncomputable def classMultiplicity (a : GeneratorPlacement V) : + FiniteHomotopyClass Q (K := K) → ℕ := + Quotient.lift (fun E => (E.minimalRepresentative Q).complex.multiplicity Q a) + (by + intro E F h + obtain ⟨e⟩ := h + exact multiplicity_eq_of_minimal_homotopyEquivalence Q _ _ + (E.minimalRepresentative_minimal Q) (F.minimalRepresentative_minimal Q) + (((E.minimalRepresentativeEquivalence Q).symm Q).trans Q + (e.trans Q (F.minimalRepresentativeEquivalence Q))) a) + +omit [Fintype V] [DecidableEq A] in +lemma classMultiplicity_of_minimal (E : FiniteModel.{u} Q (K := K)) + (hE : E.complex.IsMinimal Q) (a : GeneratorPlacement V) : + classMultiplicity Q a (Quotient.mk (finiteHomotopySetoid Q) E) = + E.complex.multiplicity Q a := by + exact (multiplicity_eq_of_minimal_homotopyEquivalence Q _ _ hE + (E.minimalRepresentative_minimal Q) (E.minimalRepresentativeEquivalence Q) a).symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum.lean index 2e65b69dd6e697eace317991f3c781c82284e6c9..fb94ff15fb06bcd72c6a51daef69d65f6f82e5fa 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum.lean @@ -1,114 +1,114 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.SmulMul -import OAI.Topology.ArtinGroups.Quivers.Level - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [DecidableEq I] - {T R : I → Type*} [∀ i, Fintype (T i)] [∀ i, Fintype (R i)] - -noncomputable def finiteSum (E : (i:I) → BasedComplex Q (K := K) (T i)) : - BasedComplex Q (K := K) (Sigma T) where - placement := fun x => (E x.1).placement x.2 - differential := Matrix.blockDiagonal' (fun i => (E i).differential) - entries := by - constructor - · rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - exact (E i).entries.1 x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,mul_zero] - · rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - exact (E i).entries.2 x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,zero_mul] - degree := by - rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - exact (E i).degree x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] - exact ⟨fun _ => rfl,homogeneous_zero Q _⟩ - square_zero := by - rw [← Matrix.blockDiagonal'_mul] - simp only [(E _).square_zero] - exact Matrix.blockDiagonal'_zero - -noncomputable def Map.finiteSum - {E : (i:I) → BasedComplex Q (K := K) (T i)} - {F : (i:I) → BasedComplex Q (K := K) (R i)} (f : (i:I) → Map Q (E i) (F i)) : - Map Q (finiteSum Q E) (finiteSum Q F) where - matrix := Matrix.blockDiagonal' (fun i => (f i).matrix) - entries := by - constructor - · rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - exact (f i).entries.1 x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,mul_zero] - · rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - exact (f i).entries.2 x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,zero_mul] - degree := by - rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - exact (f i).degree x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] - exact ⟨fun _ => rfl,homogeneous_zero Q _⟩ - commute := by - change Matrix.blockDiagonal' (fun i => (E i).differential) * Matrix.blockDiagonal' (fun i => (f i).matrix) = - Matrix.blockDiagonal' (fun i => (f i).matrix) * Matrix.blockDiagonal' (fun i => (F i).differential) - rw [← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul] - congr 1 - funext i - exact (f i).commute - -lemma finiteSum_identity [∀ i, DecidableEq (T i)] - (E : (i:I) → BasedComplex Q (K := K) (T i)) : - Matrix.blockDiagonal' (fun i => projectiveIdentity Q (K := K) (E i).placement) = - projectiveIdentity Q (finiteSum Q E).placement := by - classical - apply Matrix.ext - rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - simp only [projectiveIdentity,Matrix.diagonal_apply,Sigma.mk.inj_iff,heq_eq_eq, - true_and,finiteSum] - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] - have he : (⟨i,x⟩ : Sigma T) ≠ ⟨j,y⟩ := fun he => h (congrArg Sigma.fst he) - simp only [projectiveIdentity,Matrix.diagonal_apply,ite_eq_right he] - -noncomputable def ChainIsomorphism.finiteSum [∀ i, DecidableEq (T i)] [∀ i, DecidableEq (R i)] - {E : (i:I) → BasedComplex Q (K := K) (T i)} - {F : (i:I) → BasedComplex Q (K := K) (R i)} - (f : (i:I) → ChainIsomorphism Q (E i) (F i)) : - ChainIsomorphism Q (finiteSum Q E) (finiteSum Q F) where - forward := Map.finiteSum Q (fun i => (f i).forward) - backward := Map.finiteSum Q (fun i => (f i).backward) - sourceEquation := by - change Matrix.blockDiagonal' (fun i => (f i).forward.matrix) * Matrix.blockDiagonal' (fun i => (f i).backward.matrix) = _ - rw [← Matrix.blockDiagonal'_mul] - simp only [(f _).sourceEquation] - exact finiteSum_identity Q E - targetEquation := by - change Matrix.blockDiagonal' (fun i => (f i).backward.matrix) * Matrix.blockDiagonal' (fun i => (f i).forward.matrix) = _ - rw [← Matrix.blockDiagonal'_mul] - simp only [(f _).targetEquation] - exact finiteSum_identity Q F - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.SmulMul +import OAI.Topology.ArtinGroups.Quivers.Level + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [DecidableEq I] + {T R : I → Type*} [∀ i, Fintype (T i)] [∀ i, Fintype (R i)] + +noncomputable def finiteSum (E : (i:I) → BasedComplex Q (K := K) (T i)) : + BasedComplex Q (K := K) (Sigma T) where + placement := fun x => (E x.1).placement x.2 + differential := Matrix.blockDiagonal' (fun i => (E i).differential) + entries := by + constructor + · rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + exact (E i).entries.1 x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,mul_zero] + · rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + exact (E i).entries.2 x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,zero_mul] + degree := by + rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + exact (E i).degree x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] + exact ⟨fun _ => rfl,homogeneous_zero Q _⟩ + square_zero := by + rw [← Matrix.blockDiagonal'_mul] + simp only [(E _).square_zero] + exact Matrix.blockDiagonal'_zero + +noncomputable def Map.finiteSum + {E : (i:I) → BasedComplex Q (K := K) (T i)} + {F : (i:I) → BasedComplex Q (K := K) (R i)} (f : (i:I) → Map Q (E i) (F i)) : + Map Q (finiteSum Q E) (finiteSum Q F) where + matrix := Matrix.blockDiagonal' (fun i => (f i).matrix) + entries := by + constructor + · rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + exact (f i).entries.1 x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,mul_zero] + · rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + exact (f i).entries.2 x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,zero_mul] + degree := by + rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + exact (f i).degree x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] + exact ⟨fun _ => rfl,homogeneous_zero Q _⟩ + commute := by + change Matrix.blockDiagonal' (fun i => (E i).differential) * Matrix.blockDiagonal' (fun i => (f i).matrix) = + Matrix.blockDiagonal' (fun i => (f i).matrix) * Matrix.blockDiagonal' (fun i => (F i).differential) + rw [← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul] + congr 1 + funext i + exact (f i).commute + +lemma finiteSum_identity [∀ i, DecidableEq (T i)] + (E : (i:I) → BasedComplex Q (K := K) (T i)) : + Matrix.blockDiagonal' (fun i => projectiveIdentity Q (K := K) (E i).placement) = + projectiveIdentity Q (finiteSum Q E).placement := by + classical + apply Matrix.ext + rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + simp only [projectiveIdentity,Matrix.diagonal_apply,Sigma.mk.inj_iff,heq_eq_eq, + true_and,finiteSum] + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] + have he : (⟨i,x⟩ : Sigma T) ≠ ⟨j,y⟩ := fun he => h (congrArg Sigma.fst he) + simp only [projectiveIdentity,Matrix.diagonal_apply,ite_eq_right he] + +noncomputable def ChainIsomorphism.finiteSum [∀ i, DecidableEq (T i)] [∀ i, DecidableEq (R i)] + {E : (i:I) → BasedComplex Q (K := K) (T i)} + {F : (i:I) → BasedComplex Q (K := K) (R i)} + (f : (i:I) → ChainIsomorphism Q (E i) (F i)) : + ChainIsomorphism Q (finiteSum Q E) (finiteSum Q F) where + forward := Map.finiteSum Q (fun i => (f i).forward) + backward := Map.finiteSum Q (fun i => (f i).backward) + sourceEquation := by + change Matrix.blockDiagonal' (fun i => (f i).forward.matrix) * Matrix.blockDiagonal' (fun i => (f i).backward.matrix) = _ + rw [← Matrix.blockDiagonal'_mul] + simp only [(f _).sourceEquation] + exact finiteSum_identity Q E + targetEquation := by + change Matrix.blockDiagonal' (fun i => (f i).backward.matrix) * Matrix.blockDiagonal' (fun i => (f i).forward.matrix) = _ + rw [← Matrix.blockDiagonal'_mul] + simp only [(f _).targetEquation] + exact finiteSum_identity Q F + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum2.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum2.lean index 8955ee97b8821968211ba212f3ff8f6af13454c9..286634b099a6c90dec25f6e7d9d40d498a08d848 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum2.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FiniteSum2.lean @@ -1,118 +1,118 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices -import OAI.Topology.ArtinGroups.Complexes.FiniteSum - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - {T R : I → Type*} [∀ i, Fintype (T i)] [∀ i, Fintype (R i)] - [∀ i, DecidableEq (T i)] [∀ i, DecidableEq (R i)] - -omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in -lemma finiteSum_entries (E : (i:I) → BasedComplex Q (K := K) (T i)) - (M : (i:I) → Matrix (T i) (T i) (Zigzag Q K)) - (hM : ∀ i, ProjectiveEntries Q (E i).placement (E i).placement (M i)) : - ProjectiveEntries Q (finiteSum Q E).placement (finiteSum Q E).placement - (Matrix.blockDiagonal' M) := by - constructor - all_goals - rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - first | exact (hM i).1 x y | exact (hM i).2 x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] - first | exact MulZeroClass.mul_zero _ | exact MulZeroClass.zero_mul _ - -omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in -lemma finiteSum_degree (E : (i:I) → BasedComplex Q (K := K) (T i)) - (M : (i:I) → Matrix (T i) (T i) (Zigzag Q K)) {n v : ℤ} - (hM : ∀ i, MapDegree Q (E i).placement (E i).placement n v (M i)) : - MapDegree Q (finiteSum Q E).placement (finiteSum Q E).placement n v - (Matrix.blockDiagonal' M) := by - rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j - rw [Matrix.blockDiagonal'_apply_eq] - exact hM i x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] - exact ⟨fun _ => rfl,homogeneous_zero Q _⟩ - -noncomputable def HomotopyEquivalence.finiteSum - {E : (i:I) → BasedComplex Q (K := K) (T i)} - {F : (i:I) → BasedComplex Q (K := K) (R i)} - (f : (i:I) → HomotopyEquivalence Q (E i) (F i)) : - HomotopyEquivalence Q (finiteSum Q E) (finiteSum Q F) where - forward := Map.finiteSum Q (fun i => (f i).forward) - backward := Map.finiteSum Q (fun i => (f i).backward) - sourceHomotopy := Matrix.blockDiagonal' (fun i => (f i).sourceHomotopy) - targetHomotopy := Matrix.blockDiagonal' (fun i => (f i).targetHomotopy) - sourceEntries := finiteSum_entries Q E _ (fun i => (f i).sourceEntries) - targetEntries := finiteSum_entries Q F _ (fun i => (f i).targetEntries) - sourceDegree := finiteSum_degree Q E _ (fun i => (f i).sourceDegree) - targetDegree := finiteSum_degree Q F _ (fun i => (f i).targetDegree) - sourceEquation := by - change Matrix.blockDiagonal' (fun i => (f i).forward.matrix) * Matrix.blockDiagonal' (fun i => (f i).backward.matrix) = _ - rw [← finiteSum_identity Q E] - change _ = Matrix.blockDiagonal' (fun i => projectiveIdentity Q (E i).placement) + - (Matrix.blockDiagonal' (fun i => (E i).differential) * Matrix.blockDiagonal' (fun i => (f i).sourceHomotopy) + - Matrix.blockDiagonal' (fun i => (f i).sourceHomotopy) * Matrix.blockDiagonal' (fun i => (E i).differential)) - rw [← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul, - ← Matrix.blockDiagonal'_add,← Matrix.blockDiagonal'_add] - congr 1 - funext i - exact (f i).sourceEquation - targetEquation := by - change Matrix.blockDiagonal' (fun i => (f i).backward.matrix) * Matrix.blockDiagonal' (fun i => (f i).forward.matrix) = _ - rw [← finiteSum_identity Q F] - change _ = Matrix.blockDiagonal' (fun i => projectiveIdentity Q (F i).placement) + - (Matrix.blockDiagonal' (fun i => (F i).differential) * Matrix.blockDiagonal' (fun i => (f i).targetHomotopy) + - Matrix.blockDiagonal' (fun i => (f i).targetHomotopy) * Matrix.blockDiagonal' (fun i => (F i).differential)) - rw [← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul, - ← Matrix.blockDiagonal'_add,← Matrix.blockDiagonal'_add] - congr 1 - funext i - exact (f i).targetEquation - -def sumTwistEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) (α:V) : - (Σ i, TestIndex Q (E i).placement α ⊕ T i) ≃ - (TestIndex Q (finiteSum Q E).placement α ⊕ Sigma T) where - toFun - | ⟨i,.inl ⟨x,p⟩⟩ => .inl ⟨⟨i,x⟩,p⟩ - | ⟨i,.inr x⟩ => .inr ⟨i,x⟩ - invFun - | .inl ⟨⟨i,x⟩,p⟩ => ⟨i,.inl ⟨x,p⟩⟩ - | .inr ⟨i,x⟩ => ⟨i,.inr x⟩ - left_inv z := by rcases z with ⟨i,⟨x,p⟩|x⟩ <;> rfl - right_inv z := by rcases z with ⟨⟨i,x⟩,p⟩|⟨i,x⟩ <;> rfl - -lemma sumTwist_eq (E : (i:I) → BasedComplex Q (K := K) (T i)) (α:V) : - ((finiteSum Q E).positiveTwist Q α).reindex Q (sumTwistEquiv Q E α) = - finiteSum Q (fun i => (E i).positiveTwist Q α) := by - classical - apply ext_placement_differential Q - · funext z - rcases z with ⟨i,⟨x,p⟩|x⟩ <;> rfl - · apply Matrix.ext - rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases hij : i=j - · subst j - rcases x with ⟨x,p⟩|x <;> rcases y with ⟨y,q⟩|y - all_goals dsimp only [reindex,Matrix.submatrix_apply,sumTwistEquiv,Equiv.coe_fn_mk] - all_goals simp only [finiteSum,positiveTwist_differential,Matrix.blockDiagonal'_apply_eq, - Matrix.fromBlocks,Matrix.of_apply,Sum.elim_inl,Sum.elim_inr,testTransform,scalarCornerMatrix,testMatrix, - evaluationMatrix,Matrix.neg_apply,Matrix.zero_apply,Sigma.mk.inj_iff,heq_eq_eq,true_and] - · have hs (x:T i) (y:T j) : (⟨i,x⟩ : Sigma T) ≠ ⟨j,y⟩ := fun h => hij (congrArg Sigma.fst h) - rcases x with ⟨x,p⟩|x <;> rcases y with ⟨y,q⟩|y - all_goals dsimp only [reindex,Matrix.submatrix_apply,sumTwistEquiv,Equiv.coe_fn_mk] - all_goals simp only [finiteSum,positiveTwist_differential,Matrix.blockDiagonal'_apply_ne _ _ _ hij, - Matrix.fromBlocks,Matrix.of_apply,Sum.elim_inl,Sum.elim_inr,testTransform,scalarCornerMatrix,testMatrix, - evaluationMatrix,Matrix.neg_apply,Matrix.zero_apply,ite_eq_right (hs _ _),MulZeroClass.mul_zero, - coordinates_zero,zero_smul,neg_zero] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices +import OAI.Topology.ArtinGroups.Complexes.FiniteSum + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + {T R : I → Type*} [∀ i, Fintype (T i)] [∀ i, Fintype (R i)] + [∀ i, DecidableEq (T i)] [∀ i, DecidableEq (R i)] + +omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in +lemma finiteSum_entries (E : (i:I) → BasedComplex Q (K := K) (T i)) + (M : (i:I) → Matrix (T i) (T i) (Zigzag Q K)) + (hM : ∀ i, ProjectiveEntries Q (E i).placement (E i).placement (M i)) : + ProjectiveEntries Q (finiteSum Q E).placement (finiteSum Q E).placement + (Matrix.blockDiagonal' M) := by + constructor + all_goals + rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + first | exact (hM i).1 x y | exact (hM i).2 x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] + first | exact MulZeroClass.mul_zero _ | exact MulZeroClass.zero_mul _ + +omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in +lemma finiteSum_degree (E : (i:I) → BasedComplex Q (K := K) (T i)) + (M : (i:I) → Matrix (T i) (T i) (Zigzag Q K)) {n v : ℤ} + (hM : ∀ i, MapDegree Q (E i).placement (E i).placement n v (M i)) : + MapDegree Q (finiteSum Q E).placement (finiteSum Q E).placement n v + (Matrix.blockDiagonal' M) := by + rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j + rw [Matrix.blockDiagonal'_apply_eq] + exact hM i x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h] + exact ⟨fun _ => rfl,homogeneous_zero Q _⟩ + +noncomputable def HomotopyEquivalence.finiteSum + {E : (i:I) → BasedComplex Q (K := K) (T i)} + {F : (i:I) → BasedComplex Q (K := K) (R i)} + (f : (i:I) → HomotopyEquivalence Q (E i) (F i)) : + HomotopyEquivalence Q (finiteSum Q E) (finiteSum Q F) where + forward := Map.finiteSum Q (fun i => (f i).forward) + backward := Map.finiteSum Q (fun i => (f i).backward) + sourceHomotopy := Matrix.blockDiagonal' (fun i => (f i).sourceHomotopy) + targetHomotopy := Matrix.blockDiagonal' (fun i => (f i).targetHomotopy) + sourceEntries := finiteSum_entries Q E _ (fun i => (f i).sourceEntries) + targetEntries := finiteSum_entries Q F _ (fun i => (f i).targetEntries) + sourceDegree := finiteSum_degree Q E _ (fun i => (f i).sourceDegree) + targetDegree := finiteSum_degree Q F _ (fun i => (f i).targetDegree) + sourceEquation := by + change Matrix.blockDiagonal' (fun i => (f i).forward.matrix) * Matrix.blockDiagonal' (fun i => (f i).backward.matrix) = _ + rw [← finiteSum_identity Q E] + change _ = Matrix.blockDiagonal' (fun i => projectiveIdentity Q (E i).placement) + + (Matrix.blockDiagonal' (fun i => (E i).differential) * Matrix.blockDiagonal' (fun i => (f i).sourceHomotopy) + + Matrix.blockDiagonal' (fun i => (f i).sourceHomotopy) * Matrix.blockDiagonal' (fun i => (E i).differential)) + rw [← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul, + ← Matrix.blockDiagonal'_add,← Matrix.blockDiagonal'_add] + congr 1 + funext i + exact (f i).sourceEquation + targetEquation := by + change Matrix.blockDiagonal' (fun i => (f i).backward.matrix) * Matrix.blockDiagonal' (fun i => (f i).forward.matrix) = _ + rw [← finiteSum_identity Q F] + change _ = Matrix.blockDiagonal' (fun i => projectiveIdentity Q (F i).placement) + + (Matrix.blockDiagonal' (fun i => (F i).differential) * Matrix.blockDiagonal' (fun i => (f i).targetHomotopy) + + Matrix.blockDiagonal' (fun i => (f i).targetHomotopy) * Matrix.blockDiagonal' (fun i => (F i).differential)) + rw [← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul,← Matrix.blockDiagonal'_mul, + ← Matrix.blockDiagonal'_add,← Matrix.blockDiagonal'_add] + congr 1 + funext i + exact (f i).targetEquation + +def sumTwistEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) (α:V) : + (Σ i, TestIndex Q (E i).placement α ⊕ T i) ≃ + (TestIndex Q (finiteSum Q E).placement α ⊕ Sigma T) where + toFun + | ⟨i,.inl ⟨x,p⟩⟩ => .inl ⟨⟨i,x⟩,p⟩ + | ⟨i,.inr x⟩ => .inr ⟨i,x⟩ + invFun + | .inl ⟨⟨i,x⟩,p⟩ => ⟨i,.inl ⟨x,p⟩⟩ + | .inr ⟨i,x⟩ => ⟨i,.inr x⟩ + left_inv z := by rcases z with ⟨i,⟨x,p⟩|x⟩ <;> rfl + right_inv z := by rcases z with ⟨⟨i,x⟩,p⟩|⟨i,x⟩ <;> rfl + +lemma sumTwist_eq (E : (i:I) → BasedComplex Q (K := K) (T i)) (α:V) : + ((finiteSum Q E).positiveTwist Q α).reindex Q (sumTwistEquiv Q E α) = + finiteSum Q (fun i => (E i).positiveTwist Q α) := by + classical + apply ext_placement_differential Q + · funext z + rcases z with ⟨i,⟨x,p⟩|x⟩ <;> rfl + · apply Matrix.ext + rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases hij : i=j + · subst j + rcases x with ⟨x,p⟩|x <;> rcases y with ⟨y,q⟩|y + all_goals dsimp only [reindex,Matrix.submatrix_apply,sumTwistEquiv,Equiv.coe_fn_mk] + all_goals simp only [finiteSum,positiveTwist_differential,Matrix.blockDiagonal'_apply_eq, + Matrix.fromBlocks,Matrix.of_apply,Sum.elim_inl,Sum.elim_inr,testTransform,scalarCornerMatrix,testMatrix, + evaluationMatrix,Matrix.neg_apply,Matrix.zero_apply,Sigma.mk.inj_iff,heq_eq_eq,true_and] + · have hs (x:T i) (y:T j) : (⟨i,x⟩ : Sigma T) ≠ ⟨j,y⟩ := fun h => hij (congrArg Sigma.fst h) + rcases x with ⟨x,p⟩|x <;> rcases y with ⟨y,q⟩|y + all_goals dsimp only [reindex,Matrix.submatrix_apply,sumTwistEquiv,Equiv.coe_fn_mk] + all_goals simp only [finiteSum,positiveTwist_differential,Matrix.blockDiagonal'_apply_ne _ _ _ hij, + Matrix.fromBlocks,Matrix.of_apply,Sum.elim_inl,Sum.elim_inr,testTransform,scalarCornerMatrix,testMatrix, + evaluationMatrix,Matrix.neg_apply,Matrix.zero_apply,ite_eq_right (hs _ _),MulZeroClass.mul_zero, + coordinates_zero,zero_smul,neg_zero] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FrameCappedInjection.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FrameCappedInjection.lean index 37f71604a12e2d5843ed60fd7c7973c1900e0c22..9b4586b2e7f0e48d1396d30873bb857ce93380b0 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FrameCappedInjection.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FrameCappedInjection.lean @@ -1,36 +1,36 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InitialHomSpaceNegative -import OAI.Topology.ArtinGroups.Complexes.PureCoefficientCohomology - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def frameCappedInjection (hn : ∀ a, Q.source a ≠ Q.target a) - (C : CoxeterMatrix V) (hC : UnfoldedPresentation Q C) (x : Artin C) (α β : V) - {T : Type*} [Fintype T] [DecidableEq T] - (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) - (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) - (ι : Map Q M ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q - (frameModel_minimal Q hn C hC x α) q)) - (π : Map Q ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q - (frameModel_minimal Q hn C hC x α) q) M) - (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) - (hcap : (frameModel Q (K := K) hn C hC x α).complex.CappedOn Q U q) - (hd : d < q) (hdeg : n+v = d-q) : - {f : homCohomology Q M ((frameModel Q (K := K) hn C hC x β).complex.pureLayer Q - (frameModel_minimal Q hn C hC x β) d) n v →ₗ[K] - homCohomology Q M ((frameModel Q (K := K) hn C hC x β).complex.pureLayer Q - (frameModel_minimal Q hn C hC x β) (d-1)) (n+1) v // Function.Injective f} := - cappedSummandInjection Q (frameModel Q (K := K) hn C hC x α).complex - (frameModel Q (K := K) hn C hC x β).complex - (frameModel_minimal Q hn C hC x α) (frameModel_minimal Q hn C hC x β) - M U q d n v hM hU ι π hret hcap - (frameModel_negative_pair_homDimension Q hn C hC x α β n v (by omega)) hdeg - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InitialHomSpaceNegative +import OAI.Topology.ArtinGroups.Complexes.PureCoefficientCohomology + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def frameCappedInjection (hn : ∀ a, Q.source a ≠ Q.target a) + (C : CoxeterMatrix V) (hC : UnfoldedPresentation Q C) (x : Artin C) (α β : V) + {T : Type*} [Fintype T] [DecidableEq T] + (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) + (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) + (ι : Map Q M ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q + (frameModel_minimal Q hn C hC x α) q)) + (π : Map Q ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q + (frameModel_minimal Q hn C hC x α) q) M) + (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) + (hcap : (frameModel Q (K := K) hn C hC x α).complex.CappedOn Q U q) + (hd : d < q) (hdeg : n+v = d-q) : + {f : homCohomology Q M ((frameModel Q (K := K) hn C hC x β).complex.pureLayer Q + (frameModel_minimal Q hn C hC x β) d) n v →ₗ[K] + homCohomology Q M ((frameModel Q (K := K) hn C hC x β).complex.pureLayer Q + (frameModel_minimal Q hn C hC x β) (d-1)) (n+1) v // Function.Injective f} := + cappedSummandInjection Q (frameModel Q (K := K) hn C hC x α).complex + (frameModel Q (K := K) hn C hC x β).complex + (frameModel_minimal Q hn C hC x α) (frameModel_minimal Q hn C hC x β) + M U q d n v hM hU ι π hret hcap + (frameModel_negative_pair_homDimension Q hn C hC x α β n v (by omega)) hdeg + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelLayerMiddle.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelLayerMiddle.lean index 290e4d1ec28b9e47ba91570e5cb3ca6ab046d1ad..9db9104376118f21ba5e4e1976e9212332de129b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelLayerMiddle.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelLayerMiddle.lean @@ -1,52 +1,52 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModel -import OAI.Topology.ArtinGroups.Complexes.DifferentialMulExtendLayer -import OAI.Topology.ArtinGroups.Complexes.RestrictLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -lemma frameModel_layer_middle_vanishing (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) - (l k n v : ℤ) - {f : Matrix {i // ((frameModel Q (K := K) hn M hM x α).complex.placement i).level = l} - {j // ((frameModel Q (K := K) hn M hM x α).complex.placement j).level = k} (Q.Zigzag K)} - (hf : f ∈ homCycles Q - ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) - ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) k) n v) - (hlin : LinearMatrix Q f) : - f ∈ homBoundaries Q - ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) - ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) k) n v := by - apply layer_boundary_of_extended_boundary Q _ _ - (frameModel_minimal Q hn M hM x α) (frameModel_minimal Q hn M hM x α) l k n v hlin - apply frameModel_linear_cycle_boundary Q hn M hM x α n v - · exact extendLayer_cycle Q _ _ (frameModel_minimal Q hn M hM x α) - (frameModel_minimal Q hn M hM x α) l k n v hf hlin - · exact extendLayer_linear Q _ _ l k hlin - -lemma frameModel_orthogonal_layer_middle_vanishing (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) - {α β : V} (h : OrthogonalVertices Q α β) (l k n v : ℤ) - {f : Matrix {i // ((frameModel Q (K := K) hn M hM x α).complex.placement i).level = l} - {j // ((frameModel Q (K := K) hn M hM x β).complex.placement j).level = k} (Q.Zigzag K)} - (hf : f ∈ homCycles Q - ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) - ((frameModel Q hn M hM x β).complex.pureLayer Q (frameModel_minimal Q hn M hM x β) k) n v) - (hlin : LinearMatrix Q f) : - f ∈ homBoundaries Q - ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) - ((frameModel Q hn M hM x β).complex.pureLayer Q (frameModel_minimal Q hn M hM x β) k) n v := by - apply layer_boundary_of_extended_boundary Q _ _ - (frameModel_minimal Q hn M hM x α) (frameModel_minimal Q hn M hM x β) l k n v hlin - apply frameModel_orthogonal_cycle_boundary Q hn M hM x h n v - exact extendLayer_cycle Q _ _ (frameModel_minimal Q hn M hM x α) - (frameModel_minimal Q hn M hM x β) l k n v hf hlin - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModel +import OAI.Topology.ArtinGroups.Complexes.DifferentialMulExtendLayer +import OAI.Topology.ArtinGroups.Complexes.RestrictLayer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +lemma frameModel_layer_middle_vanishing (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) + (l k n v : ℤ) + {f : Matrix {i // ((frameModel Q (K := K) hn M hM x α).complex.placement i).level = l} + {j // ((frameModel Q (K := K) hn M hM x α).complex.placement j).level = k} (Q.Zigzag K)} + (hf : f ∈ homCycles Q + ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) + ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) k) n v) + (hlin : LinearMatrix Q f) : + f ∈ homBoundaries Q + ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) + ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) k) n v := by + apply layer_boundary_of_extended_boundary Q _ _ + (frameModel_minimal Q hn M hM x α) (frameModel_minimal Q hn M hM x α) l k n v hlin + apply frameModel_linear_cycle_boundary Q hn M hM x α n v + · exact extendLayer_cycle Q _ _ (frameModel_minimal Q hn M hM x α) + (frameModel_minimal Q hn M hM x α) l k n v hf hlin + · exact extendLayer_linear Q _ _ l k hlin + +lemma frameModel_orthogonal_layer_middle_vanishing (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) + {α β : V} (h : OrthogonalVertices Q α β) (l k n v : ℤ) + {f : Matrix {i // ((frameModel Q (K := K) hn M hM x α).complex.placement i).level = l} + {j // ((frameModel Q (K := K) hn M hM x β).complex.placement j).level = k} (Q.Zigzag K)} + (hf : f ∈ homCycles Q + ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) + ((frameModel Q hn M hM x β).complex.pureLayer Q (frameModel_minimal Q hn M hM x β) k) n v) + (hlin : LinearMatrix Q f) : + f ∈ homBoundaries Q + ((frameModel Q hn M hM x α).complex.pureLayer Q (frameModel_minimal Q hn M hM x α) l) + ((frameModel Q hn M hM x β).complex.pureLayer Q (frameModel_minimal Q hn M hM x β) k) n v := by + apply layer_boundary_of_extended_boundary Q _ _ + (frameModel_minimal Q hn M hM x α) (frameModel_minimal Q hn M hM x β) l k n v hlin + apply frameModel_orthogonal_cycle_boundary Q hn M hM x h n v + exact extendLayer_cycle Q _ _ (frameModel_minimal Q hn M hM x α) + (frameModel_minimal Q hn M hM x β) l k n v hf hlin + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelNegativeHom.lean b/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelNegativeHom.lean index e7597e4a551aa7308ac8e2630291b5dec3018571..dd22052f20ed0072aacebba4d2344e7ecf29455b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelNegativeHom.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/FrameModelNegativeHom.lean @@ -1,43 +1,43 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModel -import OAI.Topology.ArtinGroups.Quivers.CoefficientMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -lemma frameModel_negative_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) - (n v : ℤ) (h : n + v < 0) : - homDimension Q (frameModel Q (K := K) hn M hM x α).complex - (frameModel Q hn M hM x α).complex n v = 0 := by - rw [frameModel, minimalClassModel_homDimension] - apply unfoldedFrame_self_support Q hn M hM x α n v - by_cases hn : n = 0 - · exact Or.inr ⟨by omega, by omega⟩ - · exact Or.inl hn - -lemma frameModel_negative_coefficient_injection (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) - (n v : ℤ) (h : n + v < 0) - {f g : Matrix (frameModel Q (K := K) hn M hM x α).Index - (frameModel Q hn M hM x α).Index (Q.Zigzag K)} - (hf : f ∈ homSpace Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x α).complex n v) - (hg : g ∈ homSpace Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x α).complex n v) - (h₀ : CoefficientMatrix Q f) (h₁ : LinearMatrix Q g) - (he : homDifferential Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x α).complex n f = - homDifferential Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x α).complex n g) : f = 0 := by - exact coefficient_eq_zero_of_same_differential Q _ _ - (frameModel_minimal Q hn M hM x α) (frameModel_minimal Q hn M hM x α) n v - (frameModel_negative_homDimension Q hn M hM x α n v h) hf hg h₀ h₁ he - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModel +import OAI.Topology.ArtinGroups.Quivers.CoefficientMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +lemma frameModel_negative_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) + (n v : ℤ) (h : n + v < 0) : + homDimension Q (frameModel Q (K := K) hn M hM x α).complex + (frameModel Q hn M hM x α).complex n v = 0 := by + rw [frameModel, minimalClassModel_homDimension] + apply unfoldedFrame_self_support Q hn M hM x α n v + by_cases hn : n = 0 + · exact Or.inr ⟨by omega, by omega⟩ + · exact Or.inl hn + +lemma frameModel_negative_coefficient_injection (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) + (n v : ℤ) (h : n + v < 0) + {f g : Matrix (frameModel Q (K := K) hn M hM x α).Index + (frameModel Q hn M hM x α).Index (Q.Zigzag K)} + (hf : f ∈ homSpace Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x α).complex n v) + (hg : g ∈ homSpace Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x α).complex n v) + (h₀ : CoefficientMatrix Q f) (h₁ : LinearMatrix Q g) + (he : homDifferential Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x α).complex n f = + homDifferential Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x α).complex n g) : f = 0 := by + exact coefficient_eq_zero_of_same_differential Q _ _ + (frameModel_minimal Q hn M hM x α) (frameModel_minimal Q hn M hM x α) n v + (frameModel_negative_homDimension Q hn M hM x α n v h) hf hg h₀ h₁ he + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray.lean b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray.lean index d1f8dda185607a0d2fc34425465a0afc42cd1b05..a718730dbab373571c1836a3960b4e81357ff576 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray.lean @@ -1,56 +1,56 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Harmonic.Level -import OAI.Topology.ArtinGroups.Quivers.Reduction - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] - -noncomputable def generatorArray (E : BasedComplex Q (K := K) I) : - GeneratorPlacement V →₀ ℕ := ∑ i, Finsupp.single (E.placement i) 1 - -lemma generatorArray_apply (E : BasedComplex Q (K := K) I) (a : GeneratorPlacement V) : - E.generatorArray Q a = E.multiplicity Q a := by - classical - simp only [generatorArray, Finsupp.finsetSum_apply, Finsupp.single_apply, - multiplicity, Nat.card_eq_fintype_card, Fintype.card_subtype] - simp only [Finset.sum_boole, Nat.cast_id] - -noncomputable def levelArray (E : BasedComplex Q (K := K) I) : V × ℤ →₀ ℕ := - (E.generatorArray Q).mapDomain (fun a => (a.color, a.level)) - -lemma levelArray_eq_sum (E : BasedComplex Q (K := K) I) : - E.levelArray Q = ∑ i, Finsupp.single ((E.placement i).color, (E.placement i).level) 1 := by - simp only [levelArray, generatorArray, Finsupp.mapDomain_finsetSum, Finsupp.mapDomain_single] - -lemma levelArray_apply (E : BasedComplex Q (K := K) I) (v : V) (d : ℤ) : - E.levelArray Q (v, d) = Nat.card {i : I // - (E.placement i).color = v ∧ (E.placement i).level = d} := by - classical - simp only [levelArray_eq_sum, Finsupp.finsetSum_apply, Finsupp.single_apply, - Prod.mk.injEq, Nat.card_eq_fintype_card, Fintype.card_subtype] - simp only [Finset.sum_boole, Nat.cast_id] - -variable [DecidableEq I] [DecidableEq J] - -lemma generatorArray_eq_of_minimal_homotopyEquivalence - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) : - E.generatorArray Q = F.generatorArray Q := by - ext a - simp only [generatorArray_apply] - exact multiplicity_eq_of_minimal_homotopyEquivalence Q E F hE hF e a - -lemma levelArray_eq_of_minimal_homotopyEquivalence - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) : - E.levelArray Q = F.levelArray Q := by - unfold levelArray - rw [generatorArray_eq_of_minimal_homotopyEquivalence Q E F hE hF e] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Harmonic.Level +import OAI.Topology.ArtinGroups.Quivers.Reduction + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] + +noncomputable def generatorArray (E : BasedComplex Q (K := K) I) : + GeneratorPlacement V →₀ ℕ := ∑ i, Finsupp.single (E.placement i) 1 + +lemma generatorArray_apply (E : BasedComplex Q (K := K) I) (a : GeneratorPlacement V) : + E.generatorArray Q a = E.multiplicity Q a := by + classical + simp only [generatorArray, Finsupp.finsetSum_apply, Finsupp.single_apply, + multiplicity, Nat.card_eq_fintype_card, Fintype.card_subtype] + simp only [Finset.sum_boole, Nat.cast_id] + +noncomputable def levelArray (E : BasedComplex Q (K := K) I) : V × ℤ →₀ ℕ := + (E.generatorArray Q).mapDomain (fun a => (a.color, a.level)) + +lemma levelArray_eq_sum (E : BasedComplex Q (K := K) I) : + E.levelArray Q = ∑ i, Finsupp.single ((E.placement i).color, (E.placement i).level) 1 := by + simp only [levelArray, generatorArray, Finsupp.mapDomain_finsetSum, Finsupp.mapDomain_single] + +lemma levelArray_apply (E : BasedComplex Q (K := K) I) (v : V) (d : ℤ) : + E.levelArray Q (v, d) = Nat.card {i : I // + (E.placement i).color = v ∧ (E.placement i).level = d} := by + classical + simp only [levelArray_eq_sum, Finsupp.finsetSum_apply, Finsupp.single_apply, + Prod.mk.injEq, Nat.card_eq_fintype_card, Fintype.card_subtype] + simp only [Finset.sum_boole, Nat.cast_id] + +variable [DecidableEq I] [DecidableEq J] + +lemma generatorArray_eq_of_minimal_homotopyEquivalence + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) : + E.generatorArray Q = F.generatorArray Q := by + ext a + simp only [generatorArray_apply] + exact multiplicity_eq_of_minimal_homotopyEquivalence Q E F hE hF e a + +lemma levelArray_eq_of_minimal_homotopyEquivalence + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) : + E.levelArray Q = F.levelArray Q := by + unfold levelArray + rw [generatorArray_eq_of_minimal_homotopyEquivalence Q E F hE hF e] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray2.lean b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray2.lean index 94b2ed73ff2acf4161827f3db3b7c1abe3ef27ee..7f02ce15e05ffc7e5338c947411e342536eb2bfa 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray2.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArray2.lean @@ -1,94 +1,94 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistFiberEquiv -import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid -import OAI.Topology.ArtinGroups.Complexes.GeneratorArray - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -universe u - -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def classGeneratorArray : - FiniteHomotopyClass Q (K := K) → (GeneratorPlacement V →₀ ℕ) := - Quotient.lift (fun E => (E.minimalRepresentative Q).complex.generatorArray Q) - (by - intro E F h - obtain ⟨e⟩ := h - exact generatorArray_eq_of_minimal_homotopyEquivalence Q _ _ - (E.minimalRepresentative_minimal Q) (F.minimalRepresentative_minimal Q) - (((E.minimalRepresentativeEquivalence Q).symm Q).trans Q - (e.trans Q (F.minimalRepresentativeEquivalence Q)))) - -noncomputable def classLevelArray (x : FiniteHomotopyClass Q (K := K)) : V × ℤ →₀ ℕ := - (classGeneratorArray Q x).mapDomain (fun a => (a.color, a.level)) - -omit [Fintype V] [DecidableEq A] in -lemma classGeneratorArray_of_minimal (E : FiniteModel.{u} Q (K := K)) - (hE : E.complex.IsMinimal Q) : - classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) E) = - E.complex.generatorArray Q := by - exact (generatorArray_eq_of_minimal_homotopyEquivalence Q _ _ hE - (E.minimalRepresentative_minimal Q) (E.minimalRepresentativeEquivalence Q)).symm - -omit [Fintype V] [DecidableEq A] in -lemma classLevelArray_of_minimal (E : FiniteModel.{u} Q (K := K)) - (hE : E.complex.IsMinimal Q) : - classLevelArray Q (Quotient.mk (finiteHomotopySetoid Q) E) = - E.complex.levelArray Q := by - unfold classLevelArray levelArray - rw [classGeneratorArray_of_minimal Q E hE] - -omit [Fintype V] [DecidableEq A] in -lemma classGeneratorArray_apply (x : FiniteHomotopyClass Q (K := K)) - (a : GeneratorPlacement V) : - classGeneratorArray Q x a = classMultiplicity Q a x := by - induction x using Quotient.inductionOn with | _ E => - exact generatorArray_apply Q (E.minimalRepresentative Q).complex a - -omit [Fintype V] [DecidableEq A] in -lemma class_eq_minimalRepresentative (E : FiniteModel.{u} Q (K := K)) : - Quotient.mk (finiteHomotopySetoid Q) E = - Quotient.mk (finiteHomotopySetoid Q) (E.minimalRepresentative Q) := by - exact Quotient.sound ⟨E.minimalRepresentativeEquivalence Q⟩ - -lemma classPositiveTwist_exterior (x : FiniteHomotopyClass Q (K := K)) - (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : - classGeneratorArray Q (classPositiveTwist Q α x) a = classGeneratorArray Q x a := by - induction x using Quotient.inductionOn with | _ E => - rw [class_eq_minimalRepresentative Q E] - let M := E.minimalRepresentative Q - let T := FiniteModel.ofComplex Q (M.complex.positiveTwist Q α) - change classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) T) a = - classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) M) a - rw [classGeneratorArray_of_minimal Q M (E.minimalRepresentative_minimal Q)] - change (T.minimalRepresentative Q).complex.generatorArray Q a = M.complex.generatorArray Q a - simp only [generatorArray_apply] - refine positiveTwist_exterior_multiplicity Q M.complex _ - (E.minimalRepresentative_minimal Q) (T.minimalRepresentative_minimal Q) α - ?_ a hα - convert T.minimalRepresentativeEquivalence Q using 1 <;> rfl - -lemma classNegativeTwist_exterior (x : FiniteHomotopyClass Q (K := K)) - (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : - classGeneratorArray Q (classNegativeTwist Q α x) a = classGeneratorArray Q x a := by - induction x using Quotient.inductionOn with | _ E => - rw [class_eq_minimalRepresentative Q E] - let M := E.minimalRepresentative Q - let T := FiniteModel.ofComplex Q (M.complex.negativeTwist Q α) - change classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) T) a = - classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) M) a - rw [classGeneratorArray_of_minimal Q M (E.minimalRepresentative_minimal Q)] - change (T.minimalRepresentative Q).complex.generatorArray Q a = M.complex.generatorArray Q a - simp only [generatorArray_apply] - refine negativeTwist_exterior_multiplicity Q M.complex _ - (E.minimalRepresentative_minimal Q) (T.minimalRepresentative_minimal Q) α - ?_ a hα - convert T.minimalRepresentativeEquivalence Q using 1 <;> rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistFiberEquiv +import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid +import OAI.Topology.ArtinGroups.Complexes.GeneratorArray + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +universe u + +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def classGeneratorArray : + FiniteHomotopyClass Q (K := K) → (GeneratorPlacement V →₀ ℕ) := + Quotient.lift (fun E => (E.minimalRepresentative Q).complex.generatorArray Q) + (by + intro E F h + obtain ⟨e⟩ := h + exact generatorArray_eq_of_minimal_homotopyEquivalence Q _ _ + (E.minimalRepresentative_minimal Q) (F.minimalRepresentative_minimal Q) + (((E.minimalRepresentativeEquivalence Q).symm Q).trans Q + (e.trans Q (F.minimalRepresentativeEquivalence Q)))) + +noncomputable def classLevelArray (x : FiniteHomotopyClass Q (K := K)) : V × ℤ →₀ ℕ := + (classGeneratorArray Q x).mapDomain (fun a => (a.color, a.level)) + +omit [Fintype V] [DecidableEq A] in +lemma classGeneratorArray_of_minimal (E : FiniteModel.{u} Q (K := K)) + (hE : E.complex.IsMinimal Q) : + classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) E) = + E.complex.generatorArray Q := by + exact (generatorArray_eq_of_minimal_homotopyEquivalence Q _ _ hE + (E.minimalRepresentative_minimal Q) (E.minimalRepresentativeEquivalence Q)).symm + +omit [Fintype V] [DecidableEq A] in +lemma classLevelArray_of_minimal (E : FiniteModel.{u} Q (K := K)) + (hE : E.complex.IsMinimal Q) : + classLevelArray Q (Quotient.mk (finiteHomotopySetoid Q) E) = + E.complex.levelArray Q := by + unfold classLevelArray levelArray + rw [classGeneratorArray_of_minimal Q E hE] + +omit [Fintype V] [DecidableEq A] in +lemma classGeneratorArray_apply (x : FiniteHomotopyClass Q (K := K)) + (a : GeneratorPlacement V) : + classGeneratorArray Q x a = classMultiplicity Q a x := by + induction x using Quotient.inductionOn with | _ E => + exact generatorArray_apply Q (E.minimalRepresentative Q).complex a + +omit [Fintype V] [DecidableEq A] in +lemma class_eq_minimalRepresentative (E : FiniteModel.{u} Q (K := K)) : + Quotient.mk (finiteHomotopySetoid Q) E = + Quotient.mk (finiteHomotopySetoid Q) (E.minimalRepresentative Q) := by + exact Quotient.sound ⟨E.minimalRepresentativeEquivalence Q⟩ + +lemma classPositiveTwist_exterior (x : FiniteHomotopyClass Q (K := K)) + (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : + classGeneratorArray Q (classPositiveTwist Q α x) a = classGeneratorArray Q x a := by + induction x using Quotient.inductionOn with | _ E => + rw [class_eq_minimalRepresentative Q E] + let M := E.minimalRepresentative Q + let T := FiniteModel.ofComplex Q (M.complex.positiveTwist Q α) + change classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) T) a = + classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) M) a + rw [classGeneratorArray_of_minimal Q M (E.minimalRepresentative_minimal Q)] + change (T.minimalRepresentative Q).complex.generatorArray Q a = M.complex.generatorArray Q a + simp only [generatorArray_apply] + refine positiveTwist_exterior_multiplicity Q M.complex _ + (E.minimalRepresentative_minimal Q) (T.minimalRepresentative_minimal Q) α + ?_ a hα + convert T.minimalRepresentativeEquivalence Q using 1 <;> rfl + +lemma classNegativeTwist_exterior (x : FiniteHomotopyClass Q (K := K)) + (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : + classGeneratorArray Q (classNegativeTwist Q α x) a = classGeneratorArray Q x a := by + induction x using Quotient.inductionOn with | _ E => + rw [class_eq_minimalRepresentative Q E] + let M := E.minimalRepresentative Q + let T := FiniteModel.ofComplex Q (M.complex.negativeTwist Q α) + change classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) T) a = + classGeneratorArray Q (Quotient.mk (finiteHomotopySetoid Q) M) a + rw [classGeneratorArray_of_minimal Q M (E.minimalRepresentative_minimal Q)] + change (T.minimalRepresentative Q).complex.generatorArray Q a = M.complex.generatorArray Q a + simp only [generatorArray_apply] + refine negativeTwist_exterior_multiplicity Q M.complex _ + (E.minimalRepresentative_minimal Q) (T.minimalRepresentative_minimal Q) α + ?_ a hα + convert T.minimalRepresentativeEquivalence Q using 1 <;> rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroCap.lean b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroCap.lean index 3ff18c26f9729048d139aabc85eb2d286718125b..c0fe271340795ebb78f0baecdf412adabbdc1afb 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroCap.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroCap.lean @@ -1,57 +1,57 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.GeneratorArray2 -import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood -import OAI.Topology.ArtinGroups.Realizations.QuotientFinrankKer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in -lemma classGeneratorArray_zero_of_cap (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (hx:ClassCapOn Q x U q) (p:GeneratorPlacement V) - (hp:p.color∈U) (hd:qi.property) (fun i=>i.property) α c d ht hs - have hd:=homDimension_dual Q (E.pureLayer Q hE l) (F.pureLayer Q hF q) - (c-d) (q-l-(c-d)+2) - have hp':0 omega - have hl:=tokenLayer_homDimension_le Q E F hE hF l q - (c-d) (q-l-(c-d)+2) (by omega) hb - rw [hz _ _ (by omega)] at hl - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.GeneratorArray2 +import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood +import OAI.Topology.ArtinGroups.Realizations.QuotientFinrankKer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [Fintype V] [DecidableEq A] in +lemma classGeneratorArray_zero_of_cap (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (hx:ClassCapOn Q x U q) (p:GeneratorPlacement V) + (hp:p.color∈U) (hd:qi.property) (fun i=>i.property) α c d ht hs + have hd:=homDimension_dual Q (E.pureLayer Q hE l) (F.pureLayer Q hF q) + (c-d) (q-l-(c-d)+2) + have hp':0 omega + have hl:=tokenLayer_homDimension_le Q E F hE hF l q + (c-d) (q-l-(c-d)+2) (by omega) hb + rw [hz _ _ (by omega)] at hl + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroLevel.lean b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroLevel.lean index fa82c0d2836af57ca439df89d0b3b54409f4ff30..9351ed175d09e8e10278e4e34d1b760c92d0f61d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroLevel.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorArrayZeroLevel.lean @@ -1,31 +1,31 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.LevelArrayMinimalApply - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] - (Q:ReversibleQuiver V A) [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in -lemma classGeneratorArray_zero_of_level (x:FiniteHomotopyClass Q (K:=K)) - (p:GeneratorPlacement V) (h:classLevelArray Q x (p.color,p.level)=0) : - classGeneratorArray Q x p=0 := by - rw [classLevelArray_minimal_apply] at h - rw [← minimalClassModel_class Q x, - classGeneratorArray_of_minimal Q _ (minimalClassModel_minimal Q x),generatorArray_apply] - let E:=minimalClassModel Q x - change Nat.card {i:E.Index // E.complex.placement i=p}=0 - have : IsEmpty {i:E.Index // E.complex.placement i=p}:=⟨by - rintro ⟨i,hi⟩ - have : Nonempty {j:E.Index // (E.complex.placement j).color=p.color ∧ - (E.complex.placement j).level=p.level}:=⟨⟨i,by rw [hi]; exact ⟨rfl,rfl⟩⟩⟩ - have hp:0 Nat.card {i : I // (E.placement i).color = α} - -noncomputable def unfoldedCartan : Matrix V V ℝ := fun α β => - (if α = β then 2 else 0) - Nat.card {a : A // Q.source a = α ∧ Q.target a = β} - -omit [Fintype V] [DecidableEq A] in -lemma generatorVector_sum (E : BasedComplex Q (K := K) I) (α : V) : - generatorVector Q E α = ∑ i, if (E.placement i).color = α then (1 : ℝ) else 0 := by - classical - simp only [generatorVector, Nat.card_eq_fintype_card, Fintype.card_subtype, - ← Finset.sum_boole] - -omit [DecidableEq A] in -lemma sum_generatorVector (E : BasedComplex Q (K := K) I) (f : V → ℝ) : - ∑ α, generatorVector Q E α * f α = ∑ i, f (E.placement i).color := by - classical - simp only [generatorVector_sum, Finset.sum_mul, ite_mul, _root_.one_mul, MulZeroClass.zero_mul] - rw [Finset.sum_comm] - apply Finset.sum_congr rfl - intro i _ - simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true] - -omit [Fintype V] [DecidableEq A] in -lemma equalColorPair_card (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) : - (Nat.card (EqualColorPair Q E F) : ℝ) = - ∑ i, ∑ j, if (E.placement i).color = (F.placement j).color then (1 : ℝ) else 0 := by - classical - simp only [EqualColorPair, Nat.card_eq_fintype_card, Fintype.card_subtype, - ← Finset.sum_boole, - Fintype.sum_prod_type] - -omit [Fintype V] [DecidableEq A] in -lemma arrowPair_card (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) : - (Nat.card (ArrowPair Q E F) : ℝ) = - ∑ i, ∑ j, (Nat.card {a : A // Q.source a = (E.placement i).color ∧ - Q.target a = (F.placement j).color} : ℝ) := by - classical - simp only [ArrowPair, Nat.card_eq_fintype_card, Fintype.card_subtype, - ← Finset.sum_boole, - Fintype.sum_prod_type] - -omit [DecidableEq A] in -lemma generator_cartan_pairing (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) : - (generatorVector Q E) ⬝ᵥ ((unfoldedCartan Q).mulVec (generatorVector Q F)) = - 2 * (Nat.card (EqualColorPair Q E F) : ℝ) - Nat.card (ArrowPair Q E F) := by - classical - rw [dotProduct, sum_generatorVector] - simp only [Matrix.mulVec, dotProduct] - have hs (i : I) : - ∑ α, unfoldedCartan Q (E.placement i).color α * generatorVector Q F α = - ∑ j, unfoldedCartan Q (E.placement i).color (F.placement j).color := by - simpa only [_root_.mul_comm] using - sum_generatorVector Q F (fun α => unfoldedCartan Q (E.placement i).color α) - simp_rw [hs, unfoldedCartan] - rw [equalColorPair_card, arrowPair_card] - simp only [Finset.sum_sub_distrib, Finset.mul_sum] - congr 1 - apply Finset.sum_congr rfl - intro i _ - apply Finset.sum_congr rfl - intro j _ - split_ifs <;> norm_num - -lemma pure_cartan_euler (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) : - (generatorVector Q E) ⬝ᵥ ((unfoldedCartan Q).mulVec (generatorVector Q F)) = - (totalHomDimension Q E F (k-l) : ℝ) - totalHomDimension Q E F (k-l+1) + - totalHomDimension Q F E (l-k) := by - rw [generator_cartan_pairing] - have hh := pure_generator_euler Q E F hE hF - have hh' : (2 : ℝ) * Nat.card (EqualColorPair Q E F) + totalHomDimension Q E F (k-l+1) = - Nat.card (ArrowPair Q E F) + totalHomDimension Q E F (k-l) + - totalHomDimension Q F E (l-k) := by exact_mod_cast hh - linarith - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.EqualColorPair + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +noncomputable def generatorVector (E : BasedComplex Q (K := K) I) : V → ℝ := + fun α => Nat.card {i : I // (E.placement i).color = α} + +noncomputable def unfoldedCartan : Matrix V V ℝ := fun α β => + (if α = β then 2 else 0) - Nat.card {a : A // Q.source a = α ∧ Q.target a = β} + +omit [Fintype V] [DecidableEq A] in +lemma generatorVector_sum (E : BasedComplex Q (K := K) I) (α : V) : + generatorVector Q E α = ∑ i, if (E.placement i).color = α then (1 : ℝ) else 0 := by + classical + simp only [generatorVector, Nat.card_eq_fintype_card, Fintype.card_subtype, + ← Finset.sum_boole] + +omit [DecidableEq A] in +lemma sum_generatorVector (E : BasedComplex Q (K := K) I) (f : V → ℝ) : + ∑ α, generatorVector Q E α * f α = ∑ i, f (E.placement i).color := by + classical + simp only [generatorVector_sum, Finset.sum_mul, ite_mul, _root_.one_mul, MulZeroClass.zero_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true] + +omit [Fintype V] [DecidableEq A] in +lemma equalColorPair_card (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) : + (Nat.card (EqualColorPair Q E F) : ℝ) = + ∑ i, ∑ j, if (E.placement i).color = (F.placement j).color then (1 : ℝ) else 0 := by + classical + simp only [EqualColorPair, Nat.card_eq_fintype_card, Fintype.card_subtype, + ← Finset.sum_boole, + Fintype.sum_prod_type] + +omit [Fintype V] [DecidableEq A] in +lemma arrowPair_card (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) : + (Nat.card (ArrowPair Q E F) : ℝ) = + ∑ i, ∑ j, (Nat.card {a : A // Q.source a = (E.placement i).color ∧ + Q.target a = (F.placement j).color} : ℝ) := by + classical + simp only [ArrowPair, Nat.card_eq_fintype_card, Fintype.card_subtype, + ← Finset.sum_boole, + Fintype.sum_prod_type] + +omit [DecidableEq A] in +lemma generator_cartan_pairing (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) : + (generatorVector Q E) ⬝ᵥ ((unfoldedCartan Q).mulVec (generatorVector Q F)) = + 2 * (Nat.card (EqualColorPair Q E F) : ℝ) - Nat.card (ArrowPair Q E F) := by + classical + rw [dotProduct, sum_generatorVector] + simp only [Matrix.mulVec, dotProduct] + have hs (i : I) : + ∑ α, unfoldedCartan Q (E.placement i).color α * generatorVector Q F α = + ∑ j, unfoldedCartan Q (E.placement i).color (F.placement j).color := by + simpa only [_root_.mul_comm] using + sum_generatorVector Q F (fun α => unfoldedCartan Q (E.placement i).color α) + simp_rw [hs, unfoldedCartan] + rw [equalColorPair_card, arrowPair_card] + simp only [Finset.sum_sub_distrib, Finset.mul_sum] + congr 1 + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + split_ifs <;> norm_num + +lemma pure_cartan_euler (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) : + (generatorVector Q E) ⬝ᵥ ((unfoldedCartan Q).mulVec (generatorVector Q F)) = + (totalHomDimension Q E F (k-l) : ℝ) - totalHomDimension Q E F (k-l+1) + + totalHomDimension Q F E (l-k) := by + rw [generator_cartan_pairing] + have hh := pure_generator_euler Q E F hE hF + have hh' : (2 : ℝ) * Nat.card (EqualColorPair Q E F) + totalHomDimension Q E F (k-l+1) = + Nat.card (ArrowPair Q E F) + totalHomDimension Q E F (k-l) + + totalHomDimension Q F E (l-k) := by exact_mod_cast hh + linarith + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorVectorPos.lean b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorVectorPos.lean index 4ad317cdede27e4878c71e5e46b4033d00815ea8..cadc03f375d03763aa50c944783cd107a17d601c 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorVectorPos.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/GeneratorVectorPos.lean @@ -1,16 +1,16 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.GeneratorVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A I K:Type*} (Q:ReversibleQuiver V A) [Field K] [Fintype A] [Fintype I] [DecidableEq V] [DecidableEq A] -omit [DecidableEq A] in -lemma generatorVector_pos_at (E:BasedComplex Q (K:=K) I) (i:I) : - 0⟨i.val.val,i.property,i.val.property⟩ - invFun := fun i=>⟨⟨i.val,i.property.2⟩,i.property.1⟩ - left_inv := fun _=>rfl - right_inv := fun _=>rfl } - -lemma generatorVector_minimalLayer (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) : - generatorVector Q ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q) α = - (classLevelArray Q x (α,q):ℝ) := by - rw [generatorVector_pureLayer,← classLevelArray_of_minimal Q _ (minimalClassModel_minimal Q x), - minimalClassModel_class] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.GeneratorArray2 +import OAI.Topology.ArtinGroups.Complexes.MinimalModel +import OAI.Topology.ArtinGroups.Complexes.GeneratorVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K I:Type*} [Fintype I] [Field K] + (Q:ReversibleQuiver V A) [Fintype A] [DecidableEq V] + +lemma generatorVector_pureLayer (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (α:V) : generatorVector Q (E.pureLayer Q hE q) α = (E.levelArray Q (α,q):ℝ) := by + classical + rw [levelArray_apply] + unfold generatorVector + congr 1 + apply Nat.card_congr + exact + { toFun := fun i=>⟨i.val.val,i.property,i.val.property⟩ + invFun := fun i=>⟨⟨i.val,i.property.2⟩,i.property.1⟩ + left_inv := fun _=>rfl + right_inv := fun _=>rfl } + +lemma generatorVector_minimalLayer (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) : + generatorVector Q ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q) α = + (classLevelArray Q x (α,q):ℝ) := by + rw [generatorVector_pureLayer,← classLevelArray_of_minimal Q _ (minimalClassModel_minimal Q x), + minimalClassModel_class] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HighConeIndex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HighConeIndex.lean index f4fb3e28beeb4a2c669c476518cedb9c0ed1c334..4f1586a5bbd6a72caf0076446f38229ab0ca8743 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HighConeIndex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HighConeIndex.lean @@ -1,90 +1,90 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModelEquivalence -import OAI.Topology.ArtinGroups.Complexes.DownClosed - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type u} [Fintype I] [DecidableEq I] - -noncomputable def highConeIndex (T:Set I) : - ((Tᶜ:Set I) ⊕ ((Tᶜ:Set I) ⊕ T)) ≃ (I ⊕ (Tᶜ:Set I)) where - toFun - | .inl i=>.inl i.val - | .inr (.inl j)=>.inr j - | .inr (.inr k)=>.inl k.val - invFun - | .inl i=>if h:i∈T then .inr (.inr ⟨i,h⟩) else .inl ⟨i,h⟩ - | .inr j=>.inr (.inl j) - left_inv k:=by - rcases k with i|(j|k) - · simp only [dite_eq_right i.property] - · rfl - · simp only [dite_eq_left k.property] - right_inv k:=by - rcases k with i|j - · dsimp only - split_ifs <;> rfl - · rfl - -noncomputable def highConeNormalized (E:BasedComplex Q (K:=K) I) (T:Set I) - (h:DownClosed Q E T) := - ((highProjection Q E T h).cone Q).reindex Q (highConeIndex T) - -noncomputable def highConePivot (E:BasedComplex Q (K:=K) I) (T:Set I) - (h:DownClosed Q E T) : BlockPivot Q (highConeNormalized Q E T h) where - coefficient:=1 - nonzero:=one_ne_zero - color _:=rfl - cochain i:=by change (E.placement i).cochain=(E.placement i).cochain-1+1; omega - internal _:=rfl - entry i j:=by - change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= - 1 • (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) - simp only [one_smul,Subtype.val_inj] - -noncomputable def highConeReduction (E:BasedComplex Q (K:=K) I) (T:Set I) - (h:DownClosed Q E T) : HomotopyEquivalence Q ((highProjection Q E T h).cone Q) - ((highConePivot Q E T h).reduced Q) := - (((highProjection Q E T h).cone Q).reindexHomotopyEquivalence Q (highConeIndex T)).trans Q - ((highConePivot Q E T h).reductionEquivalence Q) - -omit [Fintype V] [DecidableEq A] in -lemma highConeRetained_level (E:BasedComplex Q (K:=K) I) (T:Set I) - (h:DownClosed Q E T) (i:T) : - (((highConePivot Q E T h).reduced Q).placement i).level=(E.placement i).level-1 := by - change (E.placement i).cochain-1+(E.placement i).internal= - (E.placement i).cochain+(E.placement i).internal-1 - omega - -noncomputable def highPureIndex (E:BasedComplex Q (K:=K) I) (q:ℤ) - (hE:∀ i,(E.placement i).level≤q) : - {i:I // (E.placement i).level=q} ≃ ((lowerLevelSet Q E (q-1))ᶜ:Set I) where - toFun i:=⟨i.val,by change ¬(E.placement i.val).level≤q-1; have hi:=i.property; omega⟩ - invFun i:=⟨i.val,by - have hi:=i.property - have hu:=hE i.val - change ¬(E.placement i.val).level≤q-1 at hi - omega⟩ - left_inv _:=rfl - right_inv _:=rfl - -omit [Fintype V] [DecidableEq A] in -lemma highRestriction_top_eq_layer (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) : - classOfComplex Q (upperTruncation Q E hE (q-1))= - classLayer Q q (classOfComplex Q E) := by - have he:(upperTruncation Q E hE (q-1)).reindex Q (highPureIndex Q E q hhi)= - E.pureLayer Q hE q := by - apply ext_placement_differential Q <;> rfl - rw [classLayer_minimal] - exact (classOfComplex_reindex Q _ (highPureIndex Q E q hhi)).trans - (by rw [he]) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModelEquivalence +import OAI.Topology.ArtinGroups.Complexes.DownClosed + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] + +noncomputable def highConeIndex (T:Set I) : + ((Tᶜ:Set I) ⊕ ((Tᶜ:Set I) ⊕ T)) ≃ (I ⊕ (Tᶜ:Set I)) where + toFun + | .inl i=>.inl i.val + | .inr (.inl j)=>.inr j + | .inr (.inr k)=>.inl k.val + invFun + | .inl i=>if h:i∈T then .inr (.inr ⟨i,h⟩) else .inl ⟨i,h⟩ + | .inr j=>.inr (.inl j) + left_inv k:=by + rcases k with i|(j|k) + · simp only [dite_eq_right i.property] + · rfl + · simp only [dite_eq_left k.property] + right_inv k:=by + rcases k with i|j + · dsimp only + split_ifs <;> rfl + · rfl + +noncomputable def highConeNormalized (E:BasedComplex Q (K:=K) I) (T:Set I) + (h:DownClosed Q E T) := + ((highProjection Q E T h).cone Q).reindex Q (highConeIndex T) + +noncomputable def highConePivot (E:BasedComplex Q (K:=K) I) (T:Set I) + (h:DownClosed Q E T) : BlockPivot Q (highConeNormalized Q E T h) where + coefficient:=1 + nonzero:=one_ne_zero + color _:=rfl + cochain i:=by change (E.placement i).cochain=(E.placement i).cochain-1+1; omega + internal _:=rfl + entry i j:=by + change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= + 1 • (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) + simp only [one_smul,Subtype.val_inj] + +noncomputable def highConeReduction (E:BasedComplex Q (K:=K) I) (T:Set I) + (h:DownClosed Q E T) : HomotopyEquivalence Q ((highProjection Q E T h).cone Q) + ((highConePivot Q E T h).reduced Q) := + (((highProjection Q E T h).cone Q).reindexHomotopyEquivalence Q (highConeIndex T)).trans Q + ((highConePivot Q E T h).reductionEquivalence Q) + +omit [Fintype V] [DecidableEq A] in +lemma highConeRetained_level (E:BasedComplex Q (K:=K) I) (T:Set I) + (h:DownClosed Q E T) (i:T) : + (((highConePivot Q E T h).reduced Q).placement i).level=(E.placement i).level-1 := by + change (E.placement i).cochain-1+(E.placement i).internal= + (E.placement i).cochain+(E.placement i).internal-1 + omega + +noncomputable def highPureIndex (E:BasedComplex Q (K:=K) I) (q:ℤ) + (hE:∀ i,(E.placement i).level≤q) : + {i:I // (E.placement i).level=q} ≃ ((lowerLevelSet Q E (q-1))ᶜ:Set I) where + toFun i:=⟨i.val,by change ¬(E.placement i.val).level≤q-1; have hi:=i.property; omega⟩ + invFun i:=⟨i.val,by + have hi:=i.property + have hu:=hE i.val + change ¬(E.placement i.val).level≤q-1 at hi + omega⟩ + left_inv _:=rfl + right_inv _:=rfl + +omit [Fintype V] [DecidableEq A] in +lemma highRestriction_top_eq_layer (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) : + classOfComplex Q (upperTruncation Q E hE (q-1))= + classLayer Q q (classOfComplex Q E) := by + have he:(upperTruncation Q E hE (q-1)).reindex Q (highPureIndex Q E q hhi)= + E.pureLayer Q hE q := by + apply ext_placement_differential Q <;> rfl + rw [classLayer_minimal] + exact (classOfComplex_reindex Q _ (highPureIndex Q E q hhi)).trans + (by rw [he]) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HighConeRetainedPure.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HighConeRetainedPure.lean index cdd8b0706947546d2756250c13ad7f569675f5fd..c28b8db715a15c86f75707bbf2046849a65e33d9 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HighConeRetainedPure.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HighConeRetainedPure.lean @@ -1,148 +1,148 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistRaisedGenerator -import OAI.Topology.ArtinGroups.Complexes.LayerConeEquivalence -import OAI.Topology.ArtinGroups.Complexes.HighConeIndex -import OAI.Topology.ArtinGroups.Complexes.PositiveConeIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma top_zero_regraded (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (e:I≃J) (n:ℤ) (r:K) (hr:r≠0) - (hc:∀ i,(F.placement (e i)).color=(E.placement i).color) - (hd:∀ i,(F.placement (e i)).cochain=(E.placement i).cochain+n) - (hf:∀ i j a,(F.differential (e i) (e j)).arrow a=r*(E.differential i j).arrow a) - (α:V) (hz:∀ c,coefficientTopDual Q E α c=⊥) : - ∀ c,coefficientTopDual Q F α c=⊥ := by - intro c - apply le_antisymm _ bot_le - intro x hx - have hy:(fun i=>x (e i))∈coefficientTopDual Q E α (c-n) := by - constructor - · intro i hi - apply hx.1 (e i) - rcases hi with hi|hi - · exact Or.inl (by rwa [hc]) - · exact Or.inr (by rw [hd]; omega) - · intro i a - apply (mul_eq_zero.mp (show r*(∑ j:I,(E.differential i j).arrow a*x (e j))=0 from ?_)).resolve_left hr - calc - r*(∑ j:I,(E.differential i j).arrow a*x (e j))= - ∑ j:I,(F.differential (e i) (e j)).arrow a*x (e j) := by - rw [Finset.mul_sum] - apply Finset.sum_congr rfl - intro j _ - rw [hf i j a] - ring - _ = ∑ j:J,(F.differential (e i) j).arrow a*x j := e.sum_comp (fun j:J=>(F.differential (e i) j).arrow a*x j) - _ = 0 := hx.2 (e i) a - rw [hz] at hy - have hy':(fun i=>x (e i))=0:=(Submodule.mem_bot K).mp hy - apply (Submodule.mem_bot K).mpr - funext j - obtain ⟨i,rfl⟩:=e.surjective j - exact congrFun hy' i - -omit [Fintype V] [DecidableEq A] in -lemma highConeRetained_differential (E:BasedComplex Q (K:=K) I) (T:Set I) - (h:DownClosed Q E T) (i j:T) : - ((highConePivot Q E T h).reduced Q).differential i j= -E.differential i j := by - rw [BlockPivot.reduced_differential] - have hz (k:(Tᶜ:Set I)) : - (highConeNormalized Q E T h).differential (.inr (.inr i)) (.inr (.inl k))=0 := by - change (highProjection Q E T h).matrix i k=0 - change (if (i:I)=(k:I) then vertexId Q (K:=K) (E.placement i).color else 0)=0 - have hne:(i:I)≠(k:I):=fun he=>k.property (he ▸ i.property) - exact ite_eq_right hne - simp only [hz,smul_zero,zero_mul,Finset.sum_const_zero,sub_zero] - rfl - -omit [Fintype V] [DecidableEq A] in -lemma highConeRetained_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (T:Set I) (h:DownClosed Q E T) : - ((highConePivot Q E T h).reduced Q).IsMinimal Q := by - intro i j - funext α - rw [highConeRetained_differential] - change -(E.differential i j).vertex α=0 - have hh:=congrFun (hE i j) α - change (E.differential i j).vertex α=0 at hh - rw [hh,neg_zero] - -noncomputable def highConeRetainedPureIndex (E:BasedComplex Q (K:=K) I) - (hE:E.IsMinimal Q) (q:ℤ) : - {i:I // (E.placement i).level=q-1} ≃ - {i:lowerLevelSet Q E (q-1) // - (((highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q).placement i).level=q-2} where - toFun i:=⟨⟨i.val,le_of_eq i.property⟩,by - rw [highConeRetained_level] - have hi:=i.property - change (E.placement i.val).level-1=q-2 - omega⟩ - invFun i:=⟨i.val.val,by - have hi:=i.property - rw [highConeRetained_level] at hi - omega⟩ - left_inv _:=rfl - right_inv _:=rfl - -omit [Fintype V] [DecidableEq A] in -lemma highConeRetained_top_zero (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (α:V) - (ht:∀ c,coefficientTopDual Q (E.pureLayer Q hE (q-1)) α c=⊥) : - ∀ c,coefficientTopDual Q - (((highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q).pureLayer Q - (highConeRetained_minimal Q E hE _ _) (q-2)) α c=⊥ := by - apply top_zero_regraded Q (E.pureLayer Q hE (q-1)) _ - (highConeRetainedPureIndex Q E hE q) (-1) (-1) (neg_ne_zero.mpr one_ne_zero) - (fun _=>rfl) (fun i=>by - change (E.placement i).cochain-1=(E.placement i).cochain+ -1 - omega) _ α ht - intro i j a - change (((highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q).differential - (highConeRetainedPureIndex Q E hE q i).val - (highConeRetainedPureIndex Q E hE q j).val).arrow a= -1*(E.differential i j).arrow a - rw [highConeRetained_differential] - change -(E.differential i j).arrow a= -1*(E.differential i j).arrow a - ring - -lemma positiveLayer_top (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) (α:V) - (ht:∀ c,coefficientTopDual Q (E.pureLayer Q hE (q-1)) α c=⊥) : - classLayer Q q (classPositiveTwist Q α (classOfComplex Q E))= - classLayer Q q (classPositiveTwist Q α (classLayer Q q (classOfComplex Q E))) := by - let f:=highProjection Q E _ (levelDownClosed Q E hE (q-1)) - let D:=(highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q - have hd:∀ i,(D.placement i).level≤q-2 := by - intro i - rw [highConeRetained_level] - have hi:=i.property - change (E.placement i).level≤q-1 at hi - omega - obtain ⟨G,hG,⟨eg⟩,hg⟩:=positiveTwist_cap_of_top_zero Q D - (highConeRetained_minimal Q E hE _ _) hd α (highConeRetained_top_zero Q E hE q α ht) - have coneIso : ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) - ((f.positiveTwist Q α).cone Q) := by - convert positiveTwistCone Q f α using 1 - have twistedReduction : HomotopyEquivalence Q ((f.cone Q).positiveTwist Q α) - (D.positiveTwist Q α) := by - convert (highConeReduction Q E _ (levelDownClosed Q E hE (q-1))).positiveTwist Q α using 1 - let e:HomotopyEquivalence Q ((f.positiveTwist Q α).cone Q) G.complex:= - ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q - (twistedReduction.trans Q eg) - have hh:=classLayer_eq_of_cone_equivalence Q (f.positiveTwist Q α) G.complex e q - (fun i=>by have hi:=hg i; constructor <;> omega) - change classLayer Q q (classPositiveTwist Q α (classOfComplex Q E))= - classLayer Q q (classPositiveTwist Q α (classOfComplex Q (upperTruncation Q E hE (q-1)))) at hh - rwa [highRestriction_top_eq_layer Q E hE q hhi] at hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistRaisedGenerator +import OAI.Topology.ArtinGroups.Complexes.LayerConeEquivalence +import OAI.Topology.ArtinGroups.Complexes.HighConeIndex +import OAI.Topology.ArtinGroups.Complexes.PositiveConeIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma top_zero_regraded (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (e:I≃J) (n:ℤ) (r:K) (hr:r≠0) + (hc:∀ i,(F.placement (e i)).color=(E.placement i).color) + (hd:∀ i,(F.placement (e i)).cochain=(E.placement i).cochain+n) + (hf:∀ i j a,(F.differential (e i) (e j)).arrow a=r*(E.differential i j).arrow a) + (α:V) (hz:∀ c,coefficientTopDual Q E α c=⊥) : + ∀ c,coefficientTopDual Q F α c=⊥ := by + intro c + apply le_antisymm _ bot_le + intro x hx + have hy:(fun i=>x (e i))∈coefficientTopDual Q E α (c-n) := by + constructor + · intro i hi + apply hx.1 (e i) + rcases hi with hi|hi + · exact Or.inl (by rwa [hc]) + · exact Or.inr (by rw [hd]; omega) + · intro i a + apply (mul_eq_zero.mp (show r*(∑ j:I,(E.differential i j).arrow a*x (e j))=0 from ?_)).resolve_left hr + calc + r*(∑ j:I,(E.differential i j).arrow a*x (e j))= + ∑ j:I,(F.differential (e i) (e j)).arrow a*x (e j) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + rw [hf i j a] + ring + _ = ∑ j:J,(F.differential (e i) j).arrow a*x j := e.sum_comp (fun j:J=>(F.differential (e i) j).arrow a*x j) + _ = 0 := hx.2 (e i) a + rw [hz] at hy + have hy':(fun i=>x (e i))=0:=(Submodule.mem_bot K).mp hy + apply (Submodule.mem_bot K).mpr + funext j + obtain ⟨i,rfl⟩:=e.surjective j + exact congrFun hy' i + +omit [Fintype V] [DecidableEq A] in +lemma highConeRetained_differential (E:BasedComplex Q (K:=K) I) (T:Set I) + (h:DownClosed Q E T) (i j:T) : + ((highConePivot Q E T h).reduced Q).differential i j= -E.differential i j := by + rw [BlockPivot.reduced_differential] + have hz (k:(Tᶜ:Set I)) : + (highConeNormalized Q E T h).differential (.inr (.inr i)) (.inr (.inl k))=0 := by + change (highProjection Q E T h).matrix i k=0 + change (if (i:I)=(k:I) then vertexId Q (K:=K) (E.placement i).color else 0)=0 + have hne:(i:I)≠(k:I):=fun he=>k.property (he ▸ i.property) + exact ite_eq_right hne + simp only [hz,smul_zero,zero_mul,Finset.sum_const_zero,sub_zero] + rfl + +omit [Fintype V] [DecidableEq A] in +lemma highConeRetained_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (T:Set I) (h:DownClosed Q E T) : + ((highConePivot Q E T h).reduced Q).IsMinimal Q := by + intro i j + funext α + rw [highConeRetained_differential] + change -(E.differential i j).vertex α=0 + have hh:=congrFun (hE i j) α + change (E.differential i j).vertex α=0 at hh + rw [hh,neg_zero] + +noncomputable def highConeRetainedPureIndex (E:BasedComplex Q (K:=K) I) + (hE:E.IsMinimal Q) (q:ℤ) : + {i:I // (E.placement i).level=q-1} ≃ + {i:lowerLevelSet Q E (q-1) // + (((highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q).placement i).level=q-2} where + toFun i:=⟨⟨i.val,le_of_eq i.property⟩,by + rw [highConeRetained_level] + have hi:=i.property + change (E.placement i.val).level-1=q-2 + omega⟩ + invFun i:=⟨i.val.val,by + have hi:=i.property + rw [highConeRetained_level] at hi + omega⟩ + left_inv _:=rfl + right_inv _:=rfl + +omit [Fintype V] [DecidableEq A] in +lemma highConeRetained_top_zero (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (α:V) + (ht:∀ c,coefficientTopDual Q (E.pureLayer Q hE (q-1)) α c=⊥) : + ∀ c,coefficientTopDual Q + (((highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q).pureLayer Q + (highConeRetained_minimal Q E hE _ _) (q-2)) α c=⊥ := by + apply top_zero_regraded Q (E.pureLayer Q hE (q-1)) _ + (highConeRetainedPureIndex Q E hE q) (-1) (-1) (neg_ne_zero.mpr one_ne_zero) + (fun _=>rfl) (fun i=>by + change (E.placement i).cochain-1=(E.placement i).cochain+ -1 + omega) _ α ht + intro i j a + change (((highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q).differential + (highConeRetainedPureIndex Q E hE q i).val + (highConeRetainedPureIndex Q E hE q j).val).arrow a= -1*(E.differential i j).arrow a + rw [highConeRetained_differential] + change -(E.differential i j).arrow a= -1*(E.differential i j).arrow a + ring + +lemma positiveLayer_top (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) (α:V) + (ht:∀ c,coefficientTopDual Q (E.pureLayer Q hE (q-1)) α c=⊥) : + classLayer Q q (classPositiveTwist Q α (classOfComplex Q E))= + classLayer Q q (classPositiveTwist Q α (classLayer Q q (classOfComplex Q E))) := by + let f:=highProjection Q E _ (levelDownClosed Q E hE (q-1)) + let D:=(highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q + have hd:∀ i,(D.placement i).level≤q-2 := by + intro i + rw [highConeRetained_level] + have hi:=i.property + change (E.placement i).level≤q-1 at hi + omega + obtain ⟨G,hG,⟨eg⟩,hg⟩:=positiveTwist_cap_of_top_zero Q D + (highConeRetained_minimal Q E hE _ _) hd α (highConeRetained_top_zero Q E hE q α ht) + have coneIso : ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) + ((f.positiveTwist Q α).cone Q) := by + convert positiveTwistCone Q f α using 1 + have twistedReduction : HomotopyEquivalence Q ((f.cone Q).positiveTwist Q α) + (D.positiveTwist Q α) := by + convert (highConeReduction Q E _ (levelDownClosed Q E hE (q-1))).positiveTwist Q α using 1 + let e:HomotopyEquivalence Q ((f.positiveTwist Q α).cone Q) G.complex:= + ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q + (twistedReduction.trans Q eg) + have hh:=classLayer_eq_of_cone_equivalence Q (f.positiveTwist Q α) G.complex e q + (fun i=>by have hi:=hg i; constructor <;> omega) + change classLayer Q q (classPositiveTwist Q α (classOfComplex Q E))= + classLayer Q q (classPositiveTwist Q α (classOfComplex Q (upperTruncation Q E hE (q-1)))) at hh + rwa [highRestriction_top_eq_layer Q E hE q hhi] at hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HighDualCycleZero.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HighDualCycleZero.lean index add29e77f5b5b894a26d165b40b6ae98d1e250d8..250bd0e247dee391b874fdc9e79172089a415565 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HighDualCycleZero.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HighDualCycleZero.lean @@ -1,142 +1,142 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.CornerScalar -import OAI.Topology.ArtinGroups.Quivers.LengthCases -import OAI.Topology.ArtinGroups.Quivers.TokenTestVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -omit [Fintype V] [DecidableEq A] in -lemma high_dual_cycle_zero (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (e:HomotopyEquivalence Q E F) (α:V) (l:ℤ) - (hE:∀ i,(E.placement i).level≤l) (hF:∀ j,(F.placement j).levelM.map (vertexHom Q α)) e.sourceEquation - have hz:=congrArg (fun M:Matrix I I K=>M.mulVec x) he - rw [← Matrix.mulVec_mulVec, hb,Matrix.mulVec_zero,Matrix.add_mulVec,Matrix.add_mulVec, - hid,← Matrix.mulVec_mulVec,hh,Matrix.mulVec_zero,← Matrix.mulVec_mulVec,hd, - Matrix.mulVec_zero,_root_.add_zero,_root_.add_zero] at hz - exact hz.symm - -theorem positiveTwist_top_zero_of_cap - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (q:ℤ) (hE:∀ i,(E.placement i).level=q) (α:V) - (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) - (hF:∀ j,(F.placement j).level≤q) : - ∀ c,coefficientTopDual Q E α c=⊥ := by - intro c - apply eq_bot_iff.mpr - intro x hx - change x=0 - let t:=tokenTestVector Q E.placement α x - have ht:t∈topTestCycles Q E α c:=tokenTestVector_top Q E hE α c hx - let y:TestIndex Q E.placement α⊕I→K:=Sum.elim t (fun _=>0) - have hy:y=0 := by - apply high_dual_cycle_zero Q (E.positiveTwist Q α) F e α (q+1) - · intro i - rcases i with i|i - · change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)≤q+1 - have hi:=hE i.1 - have hl:Path.length i.2.val≤2:=by rcases Path.length_cases i.2.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hi - omega - · change (E.placement i).level≤q+1 - rw [hE]; omega - · intro j - have hj:=hF j - omega - · intro i hi - rcases i with i|i - · change t i=0 - apply ht.1 - intro hh - apply hi.elim - · intro h - apply h - change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)=q+1 - have hq:=hE i.1 - dsimp only [GeneratorPlacement.level] at hq - omega - · intro h - exact h rfl - · rfl - · funext i - rcases i with i|i - · change (∑ j:TestIndex Q E.placement α⊕I, - ((E.positiveTwist Q α).differential (.inl i) j).vertex α*y j)=0 - rw [Fintype.sum_sum_type] - have hh:=congrFun ht.2 i - change (∑ j,t j * testMatrix Q E.placement E.placement α E.differential i j)=0 at hh - simp only [y,Sum.elim_inl,Sum.elim_inr,MulZeroClass.mul_zero,Finset.sum_const_zero,_root_.add_zero] - have hm j:((E.positiveTwist Q α).differential (.inl i) (.inl j)).vertex α = - -testMatrix Q E.placement E.placement α E.differential i j := by - change (-((testMatrix Q E.placement E.placement α E.differential i j) • vertexId Q α)).vertex α=_ - change -(testMatrix Q E.placement E.placement α E.differential i j * - (vertexId Q (K:=K) α).vertex α) = _ - rw [vertexId_eval,ite_eq_left rfl,_root_.mul_one] - simp only [hm,_root_.neg_mul,Finset.sum_neg_distrib] - rw [show (∑ j,testMatrix Q E.placement E.placement α E.differential i j*t j)=0 from by - simpa only [_root_.mul_comm] using hh,_root_.neg_zero] - · change (∑ j:TestIndex Q E.placement α⊕I, - ((E.positiveTwist Q α).differential (.inr i) j).vertex α*y j)=0 - rw [Fintype.sum_sum_type] - simp [y,BasedComplex.positiveTwist,Map.cone,Map.coneDifferential,Matrix.fromBlocks] - have ht0:t=0:=funext fun i=>congrFun hy (.inl i) - have hr:=sumTokenTest_unit Q E.placement α x (fun i hi=>hx.1 i (Or.inl hi)) - change sumTokenTest Q E.placement α t=x at hr - rw [ht0,map_zero] at hr - exact hr.symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.CornerScalar +import OAI.Topology.ArtinGroups.Quivers.LengthCases +import OAI.Topology.ArtinGroups.Quivers.TokenTestVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +omit [Fintype V] [DecidableEq A] in +lemma high_dual_cycle_zero (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (e:HomotopyEquivalence Q E F) (α:V) (l:ℤ) + (hE:∀ i,(E.placement i).level≤l) (hF:∀ j,(F.placement j).levelM.map (vertexHom Q α)) e.sourceEquation + have hz:=congrArg (fun M:Matrix I I K=>M.mulVec x) he + rw [← Matrix.mulVec_mulVec, hb,Matrix.mulVec_zero,Matrix.add_mulVec,Matrix.add_mulVec, + hid,← Matrix.mulVec_mulVec,hh,Matrix.mulVec_zero,← Matrix.mulVec_mulVec,hd, + Matrix.mulVec_zero,_root_.add_zero,_root_.add_zero] at hz + exact hz.symm + +theorem positiveTwist_top_zero_of_cap + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (q:ℤ) (hE:∀ i,(E.placement i).level=q) (α:V) + (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) + (hF:∀ j,(F.placement j).level≤q) : + ∀ c,coefficientTopDual Q E α c=⊥ := by + intro c + apply eq_bot_iff.mpr + intro x hx + change x=0 + let t:=tokenTestVector Q E.placement α x + have ht:t∈topTestCycles Q E α c:=tokenTestVector_top Q E hE α c hx + let y:TestIndex Q E.placement α⊕I→K:=Sum.elim t (fun _=>0) + have hy:y=0 := by + apply high_dual_cycle_zero Q (E.positiveTwist Q α) F e α (q+1) + · intro i + rcases i with i|i + · change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)≤q+1 + have hi:=hE i.1 + have hl:Path.length i.2.val≤2:=by rcases Path.length_cases i.2.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hi + omega + · change (E.placement i).level≤q+1 + rw [hE]; omega + · intro j + have hj:=hF j + omega + · intro i hi + rcases i with i|i + · change t i=0 + apply ht.1 + intro hh + apply hi.elim + · intro h + apply h + change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)=q+1 + have hq:=hE i.1 + dsimp only [GeneratorPlacement.level] at hq + omega + · intro h + exact h rfl + · rfl + · funext i + rcases i with i|i + · change (∑ j:TestIndex Q E.placement α⊕I, + ((E.positiveTwist Q α).differential (.inl i) j).vertex α*y j)=0 + rw [Fintype.sum_sum_type] + have hh:=congrFun ht.2 i + change (∑ j,t j * testMatrix Q E.placement E.placement α E.differential i j)=0 at hh + simp only [y,Sum.elim_inl,Sum.elim_inr,MulZeroClass.mul_zero,Finset.sum_const_zero,_root_.add_zero] + have hm j:((E.positiveTwist Q α).differential (.inl i) (.inl j)).vertex α = + -testMatrix Q E.placement E.placement α E.differential i j := by + change (-((testMatrix Q E.placement E.placement α E.differential i j) • vertexId Q α)).vertex α=_ + change -(testMatrix Q E.placement E.placement α E.differential i j * + (vertexId Q (K:=K) α).vertex α) = _ + rw [vertexId_eval,ite_eq_left rfl,_root_.mul_one] + simp only [hm,_root_.neg_mul,Finset.sum_neg_distrib] + rw [show (∑ j,testMatrix Q E.placement E.placement α E.differential i j*t j)=0 from by + simpa only [_root_.mul_comm] using hh,_root_.neg_zero] + · change (∑ j:TestIndex Q E.placement α⊕I, + ((E.positiveTwist Q α).differential (.inr i) j).vertex α*y j)=0 + rw [Fintype.sum_sum_type] + simp [y,BasedComplex.positiveTwist,Map.cone,Map.coneDifferential,Matrix.fromBlocks] + have ht0:t=0:=funext fun i=>congrFun hy (.inl i) + have hr:=sumTokenTest_unit Q E.placement α x (fun i hi=>hx.1 i (Or.inl hi)) + change sumTokenTest Q E.placement α t=x at hr + rw [ht0,map_zero] at hr + exact hr.symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HighestLocalGeneratorTest.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HighestLocalGeneratorTest.lean index 643cd655c0f3ad3971b49abfb82e710622bbe588..922bf393a180684cf394bb542cf9b3959b4283c3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HighestLocalGeneratorTest.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HighestLocalGeneratorTest.lean @@ -1,167 +1,167 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -open Matrix -open scoped BigOperators - -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I : Type u} [Fintype I] [DecidableEq I] - -omit [DecidableEq I] in -theorem highest_local_generator_test_not_exact - (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (U:Set V) (i:I) - (hiU:(E.placement i).color∈U) - (hcap:∀ j,(E.placement j).color∈Q.closedNeighborhood U → (E.placement j).level≤(E.placement i).level) - (hfirst:∀ j,(E.placement j).color∈Q.closedNeighborhood U → (E.placement j).level=(E.placement i).level→ - (E.placement i).cochain≤(E.placement j).cochain) : - ¬ ScalarExactAt Q (E.testComplex Q (E.placement i).color) (E.placement i).color - ((E.placement i).level+2) (E.placement i).cochain := by - classical - let α:=(E.placement i).color - let T:=E.testComplex Q α - let t:TestIndex Q E.placement α:=generatorTokenTest Q E i - let D:=testMatrix Q E.placement E.placement α E.differential - have ht:Path.length t.2.val=2:=rfl - have hcol:∀ u,D u t=0 := by - intro u - by_contra hm - have hm':(T.differential u t).vertex α≠0 := by - change ((D u t) • vertexId Q (K:=K) α).vertex α≠0 - simpa [vertexId_eval] using hm - obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q T.entries T.degree u t α hm' - change (E.placement i).cochain=(E.placement u.1).cochain+1 at hc - change (E.placement i).internal+2= - (E.placement u.1).internal+Path.length u.2.val+0 at hu - have hmem := Q.corner_target_mem_neighborhood hiU u.2 - have hh:=hcap u.1 hmem - rcases hp:u.2.val with v|a|v - · have hl:Path.length u.2.val=0:=by rw [hp]; rfl - dsimp only [GeneratorPlacement.level] at hh - omega - · have hl:Path.length u.2.val=1:=by rw [hp]; rfl - have he:(E.placement u.1).level=(E.placement i).level := by - dsimp only [GeneratorPlacement.level]; omega - have hm:=hfirst u.1 hmem he - omega - · exact hm (test_token_row_zero Q E hE α u t (by rw [hp]; rfl)) - intro he - change ScalarExactAt Q T α ((E.placement i).level+2) (E.placement i).cochain at he - let x:TestIndex Q E.placement α→K:=Pi.single t 1 - have hxs:ScalarSupported Q T ((E.placement i).level+2) (E.placement i).cochain x := by - intro u hu - have hut:u≠t := by - intro hh - subst u - apply hu - constructor - · change (E.placement i).cochain+((E.placement i).internal+2)= - (E.placement i).cochain+(E.placement i).internal+2 - omega - · rfl - exact Pi.single_eq_of_ne hut _ - have hxd:Matrix.vecMul x (T.differential.map (vertexHom Q α))=0 := by - rw [testComplex_vertex_differential Q E α] - funext u - change (∑ v,x v * D v u)=0 - rw [Finset.sum_eq_single t] - · exact mul_eq_zero.mpr (Or.inr (test_token_row_zero Q E hE α t u ht)) - · intro v hv hvt - rw [show x v=0 from Pi.single_eq_of_ne hvt _,MulZeroClass.zero_mul] - · simp - obtain ⟨z,hzs,hzd⟩:=he x hxs hxd - have hh:=congrFun hzd t - rw [testComplex_vertex_differential Q E α] at hh - have hz:Matrix.vecMul z D t=0 := by - apply Finset.sum_eq_zero - intro u hu - exact mul_eq_zero.mpr (Or.inr (hcol u)) - change Matrix.vecMul z D t=x t at hh - rw [hz] at hh - have hx:x t=1:=Pi.single_eq_same _ _ - rw [hx] at hh - exact zero_ne_one hh - -omit [DecidableEq I] in -theorem local_generatorBound_of_test_and_boundary - (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (U:Set V) (d:ℤ) - (h:TestUpperBound Q E U (d+2)) - (hout:∀ i,(E.placement i).color∈Q.closedNeighborhood U → - (E.placement i).color∉U → (E.placement i).level≤d) : - ∀ i,(E.placement i).color∈U → (E.placement i).level≤d := by - classical - intro i hiU - by_contra hi - let G:Finset I:=Finset.univ.filter (fun k=>(E.placement k).color∈U) - have hiG:i∈G := by simp [G,hiU] - obtain ⟨j,hj,hmax⟩:=Finset.exists_max_image G - (fun j:I=>(E.placement j).level) ⟨i,hiG⟩ - have hm:∀ k,(E.placement k).color∈U → (E.placement k).level≤(E.placement j).level:= - fun k hk=>hmax k (by simp [G,hk]) - let F:=G.filter (fun k:I=>(E.placement k).level=(E.placement j).level) - have hjF:j∈F:=by simp [F,hj] - obtain ⟨k,hk,hmin⟩:=Finset.exists_min_image F (fun k:I=>(E.placement k).cochain) ⟨j,hjF⟩ - have hlev:(E.placement k).level=(E.placement j).level:= (Finset.mem_filter.mp hk).2 - have hkd:d<(E.placement k).level := by have hh:=hm i hiU; omega - have hku:(E.placement k).color∈U := - (Finset.mem_filter.mp (Finset.mem_filter.mp hk).1).2 - apply highest_local_generator_test_not_exact Q E hE U k hku - · intro z hz - by_cases hzU:(E.placement z).color∈U - · rw [hlev]; exact hm z hzU - · have hh:=hout z hz hzU; omega - · intro z hz hzlev - have hzU:(E.placement z).color∈U := by - by_contra hzU - have hh:=hout z hz hzU - omega - exact hmin z (by simp [F,G,hzU,hzlev,hlev]) - · exact h (E.placement k).color hku ((E.placement k).level+2) (by omega) - (E.placement k).cochain - -lemma classCapOn_of_test_and_boundary (x : FiniteHomotopyClass Q (K:=K)) - (U:Set V) (d:ℤ) (h:ClassTestUpper Q x U (d+2)) - (hb:ClassCapOn Q x (Q.closedNeighborhood U \ U) d) : ClassCapOn Q x U d := by - let E:=minimalClassModel Q x - have hx : (⟦E⟧:FiniteHomotopyClass Q (K:=K))=x := minimalClassModel_class Q x - have ht : TestUpperBound Q E.complex U (d+2) := by - rw [← classTestUpper_model,hx]; exact h - exact local_generatorBound_of_test_and_boundary Q E.complex - (minimalClassModel_minimal Q x) U d ht (fun i hi hni=>hb i ⟨hi,hni⟩) - -lemma classPositiveNegative_cancel (hn:∀ a,Q.source a≠Q.target a) - (x:FiniteHomotopyClass Q (K:=K)) (α:V) : - classPositiveTwist Q α (classNegativeTwist Q α x)=x := - (classTwistPerm Q hn α).apply_symm_apply x - -lemma classTestExact_negative_self (hn:∀ a,Q.source a≠Q.target a) - (x:FiniteHomotopyClass Q (K:=K)) (α:V) (l c:ℤ) : - ClassTestExact Q α l c (classNegativeTwist Q α x) ↔ - ClassTestExact Q α (l+1) (c-1) x := by - have h:=classTestExact_positive_self Q hn (classNegativeTwist Q α x) α (l+1) (c-1) - rw [classPositiveNegative_cancel Q hn] at h - simpa only [add_sub_cancel_right,sub_add_cancel] using h.symm - -lemma classNegativeTwist_testUpper (hn:∀ a,Q.source a≠Q.target a) - (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} - (h:ClassTestUpper Q x U t) : ClassTestUpper Q (classNegativeTwist Q α x) U t := by - apply classPositiveTwist_testUpper_reflect Q hn _ U α hα - simpa only [classPositiveNegative_cancel Q hn] using h - -lemma inverseWord_testUpper (hn:∀ a,Q.source a≠Q.target a) - (w:List V) (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) {t:ℤ} - (h:ClassTestUpper Q x U t) (hw:∀ α∈w,α∈U) : - ClassTestUpper Q (inverseWordAction Q w x) U t := by - induction w generalizing x with - | nil => exact h - | cons α w ih => - exact ih _ (classNegativeTwist_testUpper Q hn x U α (hw α (by simp)) h) - (fun β hβ=>hw β (by simp [hβ])) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +open Matrix +open scoped BigOperators + +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I : Type u} [Fintype I] [DecidableEq I] + +omit [DecidableEq I] in +theorem highest_local_generator_test_not_exact + (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (U:Set V) (i:I) + (hiU:(E.placement i).color∈U) + (hcap:∀ j,(E.placement j).color∈Q.closedNeighborhood U → (E.placement j).level≤(E.placement i).level) + (hfirst:∀ j,(E.placement j).color∈Q.closedNeighborhood U → (E.placement j).level=(E.placement i).level→ + (E.placement i).cochain≤(E.placement j).cochain) : + ¬ ScalarExactAt Q (E.testComplex Q (E.placement i).color) (E.placement i).color + ((E.placement i).level+2) (E.placement i).cochain := by + classical + let α:=(E.placement i).color + let T:=E.testComplex Q α + let t:TestIndex Q E.placement α:=generatorTokenTest Q E i + let D:=testMatrix Q E.placement E.placement α E.differential + have ht:Path.length t.2.val=2:=rfl + have hcol:∀ u,D u t=0 := by + intro u + by_contra hm + have hm':(T.differential u t).vertex α≠0 := by + change ((D u t) • vertexId Q (K:=K) α).vertex α≠0 + simpa [vertexId_eval] using hm + obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q T.entries T.degree u t α hm' + change (E.placement i).cochain=(E.placement u.1).cochain+1 at hc + change (E.placement i).internal+2= + (E.placement u.1).internal+Path.length u.2.val+0 at hu + have hmem := Q.corner_target_mem_neighborhood hiU u.2 + have hh:=hcap u.1 hmem + rcases hp:u.2.val with v|a|v + · have hl:Path.length u.2.val=0:=by rw [hp]; rfl + dsimp only [GeneratorPlacement.level] at hh + omega + · have hl:Path.length u.2.val=1:=by rw [hp]; rfl + have he:(E.placement u.1).level=(E.placement i).level := by + dsimp only [GeneratorPlacement.level]; omega + have hm:=hfirst u.1 hmem he + omega + · exact hm (test_token_row_zero Q E hE α u t (by rw [hp]; rfl)) + intro he + change ScalarExactAt Q T α ((E.placement i).level+2) (E.placement i).cochain at he + let x:TestIndex Q E.placement α→K:=Pi.single t 1 + have hxs:ScalarSupported Q T ((E.placement i).level+2) (E.placement i).cochain x := by + intro u hu + have hut:u≠t := by + intro hh + subst u + apply hu + constructor + · change (E.placement i).cochain+((E.placement i).internal+2)= + (E.placement i).cochain+(E.placement i).internal+2 + omega + · rfl + exact Pi.single_eq_of_ne hut _ + have hxd:Matrix.vecMul x (T.differential.map (vertexHom Q α))=0 := by + rw [testComplex_vertex_differential Q E α] + funext u + change (∑ v,x v * D v u)=0 + rw [Finset.sum_eq_single t] + · exact mul_eq_zero.mpr (Or.inr (test_token_row_zero Q E hE α t u ht)) + · intro v hv hvt + rw [show x v=0 from Pi.single_eq_of_ne hvt _,MulZeroClass.zero_mul] + · simp + obtain ⟨z,hzs,hzd⟩:=he x hxs hxd + have hh:=congrFun hzd t + rw [testComplex_vertex_differential Q E α] at hh + have hz:Matrix.vecMul z D t=0 := by + apply Finset.sum_eq_zero + intro u hu + exact mul_eq_zero.mpr (Or.inr (hcol u)) + change Matrix.vecMul z D t=x t at hh + rw [hz] at hh + have hx:x t=1:=Pi.single_eq_same _ _ + rw [hx] at hh + exact zero_ne_one hh + +omit [DecidableEq I] in +theorem local_generatorBound_of_test_and_boundary + (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (U:Set V) (d:ℤ) + (h:TestUpperBound Q E U (d+2)) + (hout:∀ i,(E.placement i).color∈Q.closedNeighborhood U → + (E.placement i).color∉U → (E.placement i).level≤d) : + ∀ i,(E.placement i).color∈U → (E.placement i).level≤d := by + classical + intro i hiU + by_contra hi + let G:Finset I:=Finset.univ.filter (fun k=>(E.placement k).color∈U) + have hiG:i∈G := by simp [G,hiU] + obtain ⟨j,hj,hmax⟩:=Finset.exists_max_image G + (fun j:I=>(E.placement j).level) ⟨i,hiG⟩ + have hm:∀ k,(E.placement k).color∈U → (E.placement k).level≤(E.placement j).level:= + fun k hk=>hmax k (by simp [G,hk]) + let F:=G.filter (fun k:I=>(E.placement k).level=(E.placement j).level) + have hjF:j∈F:=by simp [F,hj] + obtain ⟨k,hk,hmin⟩:=Finset.exists_min_image F (fun k:I=>(E.placement k).cochain) ⟨j,hjF⟩ + have hlev:(E.placement k).level=(E.placement j).level:= (Finset.mem_filter.mp hk).2 + have hkd:d<(E.placement k).level := by have hh:=hm i hiU; omega + have hku:(E.placement k).color∈U := + (Finset.mem_filter.mp (Finset.mem_filter.mp hk).1).2 + apply highest_local_generator_test_not_exact Q E hE U k hku + · intro z hz + by_cases hzU:(E.placement z).color∈U + · rw [hlev]; exact hm z hzU + · have hh:=hout z hz hzU; omega + · intro z hz hzlev + have hzU:(E.placement z).color∈U := by + by_contra hzU + have hh:=hout z hz hzU + omega + exact hmin z (by simp [F,G,hzU,hzlev,hlev]) + · exact h (E.placement k).color hku ((E.placement k).level+2) (by omega) + (E.placement k).cochain + +lemma classCapOn_of_test_and_boundary (x : FiniteHomotopyClass Q (K:=K)) + (U:Set V) (d:ℤ) (h:ClassTestUpper Q x U (d+2)) + (hb:ClassCapOn Q x (Q.closedNeighborhood U \ U) d) : ClassCapOn Q x U d := by + let E:=minimalClassModel Q x + have hx : (⟦E⟧:FiniteHomotopyClass Q (K:=K))=x := minimalClassModel_class Q x + have ht : TestUpperBound Q E.complex U (d+2) := by + rw [← classTestUpper_model,hx]; exact h + exact local_generatorBound_of_test_and_boundary Q E.complex + (minimalClassModel_minimal Q x) U d ht (fun i hi hni=>hb i ⟨hi,hni⟩) + +lemma classPositiveNegative_cancel (hn:∀ a,Q.source a≠Q.target a) + (x:FiniteHomotopyClass Q (K:=K)) (α:V) : + classPositiveTwist Q α (classNegativeTwist Q α x)=x := + (classTwistPerm Q hn α).apply_symm_apply x + +lemma classTestExact_negative_self (hn:∀ a,Q.source a≠Q.target a) + (x:FiniteHomotopyClass Q (K:=K)) (α:V) (l c:ℤ) : + ClassTestExact Q α l c (classNegativeTwist Q α x) ↔ + ClassTestExact Q α (l+1) (c-1) x := by + have h:=classTestExact_positive_self Q hn (classNegativeTwist Q α x) α (l+1) (c-1) + rw [classPositiveNegative_cancel Q hn] at h + simpa only [add_sub_cancel_right,sub_add_cancel] using h.symm + +lemma classNegativeTwist_testUpper (hn:∀ a,Q.source a≠Q.target a) + (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} + (h:ClassTestUpper Q x U t) : ClassTestUpper Q (classNegativeTwist Q α x) U t := by + apply classPositiveTwist_testUpper_reflect Q hn _ U α hα + simpa only [classPositiveNegative_cancel Q hn] using h + +lemma inverseWord_testUpper (hn:∀ a,Q.source a≠Q.target a) + (w:List V) (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) {t:ℤ} + (h:ClassTestUpper Q x U t) (hw:∀ α∈w,α∈U) : + ClassTestUpper Q (inverseWordAction Q w x) U t := by + induction w generalizing x with + | nil => exact h + | cons α w ih => + exact ih _ (classNegativeTwist_testUpper Q hn x U α (hw α (by simp)) h) + (fun β hβ=>hw β (by simp [hβ])) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomDetector.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomDetector.lean index 218ad7cdcb6d61b925331724e9780d23fd1abe37..67273dbed7044209e8663f14a8b066321866fe89 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomDetector.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomDetector.lean @@ -1,55 +1,55 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomDimension -import OAI.Topology.ArtinGroups.Harmonic.InjectiveFinrankOne - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] -variable {I J : Type*} [Fintype I] [Fintype J] - -lemma boundary_of_homDimension_zero (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) - (hd : homDimension Q E F n v = 0) - {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) : - f ∈ homBoundaries Q E F n v := by - have : Subsingleton (homCohomology Q E F n v) := - (Module.finrank_zero_iff.mp hd) - have hz : (Submodule.Quotient.mk (⟨f, hf⟩ : homCycles Q E F n v) : - homCohomology Q E F n v) = 0 := Subsingleton.elim _ _ - exact (Submodule.Quotient.mk_eq_zero - ((homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype)).mp hz - -noncomputable def homDetector (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) - (L : Matrix I J (Q.Zigzag K) →ₗ[K] K) - (hL : ∀ f ∈ homBoundaries Q E F n v, L f = 0) : - homCohomology Q E F n v →ₗ[K] K := - Submodule.liftQ _ (L.comp (homCycles Q E F n v).subtype) (by - intro f hf - exact hL f hf) - -lemma boundary_of_homDimension_le_one (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) - (hd : homDimension Q E F n v ≤ 1) - (L : Matrix I J (Q.Zigzag K) →ₗ[K] K) - (hL : ∀ f ∈ homBoundaries Q E F n v, L f = 0) - {u : Matrix I J (Q.Zigzag K)} (hu : u ∈ homCycles Q E F n v) (huL : L u ≠ 0) - {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) (hfL : L f = 0) : - f ∈ homBoundaries Q E F n v := by - let T := homDetector Q E F n v L hL - have hin := injective_of_finrank_le_one hd T - (Submodule.Quotient.mk (⟨u, hu⟩ : homCycles Q E F n v)) huL - have hz : (Submodule.Quotient.mk (⟨f, hf⟩ : homCycles Q E F n v) : - homCohomology Q E F n v) = 0 := by - apply hin - change L f = T 0 - rw [map_zero] - exact hfL - exact (Submodule.Quotient.mk_eq_zero - ((homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype)).mp hz - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomDimension +import OAI.Topology.ArtinGroups.Harmonic.InjectiveFinrankOne + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] +variable {I J : Type*} [Fintype I] [Fintype J] + +lemma boundary_of_homDimension_zero (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) + (hd : homDimension Q E F n v = 0) + {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) : + f ∈ homBoundaries Q E F n v := by + have : Subsingleton (homCohomology Q E F n v) := + (Module.finrank_zero_iff.mp hd) + have hz : (Submodule.Quotient.mk (⟨f, hf⟩ : homCycles Q E F n v) : + homCohomology Q E F n v) = 0 := Subsingleton.elim _ _ + exact (Submodule.Quotient.mk_eq_zero + ((homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype)).mp hz + +noncomputable def homDetector (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) + (L : Matrix I J (Q.Zigzag K) →ₗ[K] K) + (hL : ∀ f ∈ homBoundaries Q E F n v, L f = 0) : + homCohomology Q E F n v →ₗ[K] K := + Submodule.liftQ _ (L.comp (homCycles Q E F n v).subtype) (by + intro f hf + exact hL f hf) + +lemma boundary_of_homDimension_le_one (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) + (hd : homDimension Q E F n v ≤ 1) + (L : Matrix I J (Q.Zigzag K) →ₗ[K] K) + (hL : ∀ f ∈ homBoundaries Q E F n v, L f = 0) + {u : Matrix I J (Q.Zigzag K)} (hu : u ∈ homCycles Q E F n v) (huL : L u ≠ 0) + {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) (hfL : L f = 0) : + f ∈ homBoundaries Q E F n v := by + let T := homDetector Q E F n v L hL + have hin := injective_of_finrank_le_one hd T + (Submodule.Quotient.mk (⟨u, hu⟩ : homCycles Q E F n v)) huL + have hz : (Submodule.Quotient.mk (⟨f, hf⟩ : homCycles Q E F n v) : + homCohomology Q E F n v) = 0 := by + apply hin + change L f = T 0 + rw [map_zero] + exact hfL + exact (Submodule.Quotient.mk_eq_zero + ((homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype)).mp hz + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension.lean index 031c12203694ce6f7557ffb99d76597764d1f3c6..28e674a00660e6b98af975f3fd9e774eaf50dff9 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension.lean @@ -1,67 +1,67 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.CorrectionBoundary -import OAI.Topology.ArtinGroups.Complexes.NegativeHomTransformReflect -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag -universe u -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -instance finiteDimensional : FiniteDimensional K (Q.Zigzag K) := - (pathBasis Q (K := K)).finiteDimensional_of_finite - -namespace BasedComplex -variable {I J I' J' : Type*} [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] - [DecidableEq I] [DecidableEq J] [DecidableEq I'] [DecidableEq J'] - -noncomputable def homDimension (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : ℕ := - Module.finrank K (homCohomology Q E F n v) - -omit [DecidableEq A] in -lemma HomotopyEquivalence.homDimension_eq {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} - {F' : BasedComplex Q (K := K) J'} - (e : HomotopyEquivalence Q E E') (f : HomotopyEquivalence Q F F') (n v : ℤ) : - homDimension Q E F n v = homDimension Q E' F' n v := by - apply le_antisymm - · exact LinearMap.finrank_le_finrank_of_injective (e.sandwich_injective Q f n v) - · exact LinearMap.finrank_le_finrank_of_injective ((e.symm Q).sandwich_injective Q (f.symm Q) n v) - -lemma positiveTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n v : ℤ) : - homDimension Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v = homDimension Q E F n v := by - apply le_antisymm - · have h := LinearMap.finrank_le_finrank_of_injective - (negativeHomCohomology_injective Q hn (E.positiveTwist Q α) (F.positiveTwist Q α) α n v) - change homDimension Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v ≤ - homDimension Q ((E.positiveTwist Q α).negativeTwist Q α) - ((F.positiveTwist Q α).negativeTwist Q α) n v at h - rw [(negative_positive_homotopyEquivalence Q hn E α).homDimension_eq Q - (negative_positive_homotopyEquivalence Q hn F α)] at h - exact h - · exact LinearMap.finrank_le_finrank_of_injective (positiveHomCohomology_injective Q hn E F α n v) - -lemma negativeTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n v : ℤ) : - homDimension Q (E.negativeTwist Q α) (F.negativeTwist Q α) n v = homDimension Q E F n v := by - apply le_antisymm - · have h := LinearMap.finrank_le_finrank_of_injective - (positiveHomCohomology_injective Q hn (E.negativeTwist Q α) (F.negativeTwist Q α) α n v) - change homDimension Q (E.negativeTwist Q α) (F.negativeTwist Q α) n v ≤ - homDimension Q ((E.negativeTwist Q α).positiveTwist Q α) - ((F.negativeTwist Q α).positiveTwist Q α) n v at h - rw [(positive_negative_homotopyEquivalence Q hn E α).homDimension_eq Q - (positive_negative_homotopyEquivalence Q hn F α)] at h - exact h - · exact LinearMap.finrank_le_finrank_of_injective (negativeHomCohomology_injective Q hn E F α n v) - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.CorrectionBoundary +import OAI.Topology.ArtinGroups.Complexes.NegativeHomTransformReflect +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag +universe u +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +instance finiteDimensional : FiniteDimensional K (Q.Zigzag K) := + (pathBasis Q (K := K)).finiteDimensional_of_finite + +namespace BasedComplex +variable {I J I' J' : Type*} [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] + [DecidableEq I] [DecidableEq J] [DecidableEq I'] [DecidableEq J'] + +noncomputable def homDimension (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : ℕ := + Module.finrank K (homCohomology Q E F n v) + +omit [DecidableEq A] in +lemma HomotopyEquivalence.homDimension_eq {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} + {F' : BasedComplex Q (K := K) J'} + (e : HomotopyEquivalence Q E E') (f : HomotopyEquivalence Q F F') (n v : ℤ) : + homDimension Q E F n v = homDimension Q E' F' n v := by + apply le_antisymm + · exact LinearMap.finrank_le_finrank_of_injective (e.sandwich_injective Q f n v) + · exact LinearMap.finrank_le_finrank_of_injective ((e.symm Q).sandwich_injective Q (f.symm Q) n v) + +lemma positiveTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n v : ℤ) : + homDimension Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v = homDimension Q E F n v := by + apply le_antisymm + · have h := LinearMap.finrank_le_finrank_of_injective + (negativeHomCohomology_injective Q hn (E.positiveTwist Q α) (F.positiveTwist Q α) α n v) + change homDimension Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v ≤ + homDimension Q ((E.positiveTwist Q α).negativeTwist Q α) + ((F.positiveTwist Q α).negativeTwist Q α) n v at h + rw [(negative_positive_homotopyEquivalence Q hn E α).homDimension_eq Q + (negative_positive_homotopyEquivalence Q hn F α)] at h + exact h + · exact LinearMap.finrank_le_finrank_of_injective (positiveHomCohomology_injective Q hn E F α n v) + +lemma negativeTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n v : ℤ) : + homDimension Q (E.negativeTwist Q α) (F.negativeTwist Q α) n v = homDimension Q E F n v := by + apply le_antisymm + · have h := LinearMap.finrank_le_finrank_of_injective + (positiveHomCohomology_injective Q hn (E.negativeTwist Q α) (F.negativeTwist Q α) α n v) + change homDimension Q (E.negativeTwist Q α) (F.negativeTwist Q α) n v ≤ + homDimension Q ((E.negativeTwist Q α).positiveTwist Q α) + ((F.negativeTwist Q α).positiveTwist Q α) n v at h + rw [(positive_negative_homotopyEquivalence Q hn E α).homDimension_eq Q + (positive_negative_homotopyEquivalence Q hn F α)] at h + exact h + · exact LinearMap.finrank_le_finrank_of_injective (negativeHomCohomology_injective Q hn E F α n v) + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension2.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension2.lean index b594a655e2fc7d92e85daf9e4b0de984284f504d..9e65c98c6ef67026d5fe73815fc707cfffc26946 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension2.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimension2.lean @@ -1,69 +1,69 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.UnfoldedPresentation -import OAI.Topology.ArtinGroups.Complexes.HomDimension - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def classHomDimension (n v : ℤ) : - FiniteHomotopyClass Q (K := K) → FiniteHomotopyClass Q (K := K) → ℕ := - Quotient.lift₂ (fun E F => homDimension Q E.complex F.complex n v) - (by - intro E E' F F' ⟨e⟩ ⟨f⟩ - exact e.homDimension_eq Q f n v) - -lemma classPositiveTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (α : V) (n v : ℤ) (E F : FiniteHomotopyClass Q (K := K)) : - classHomDimension Q n v (classPositiveTwist Q α E) (classPositiveTwist Q α F) = - classHomDimension Q n v E F := by - induction E using Quotient.inductionOn with | _ E => - induction F using Quotient.inductionOn with | _ F => - exact positiveTwist_homDimension Q hn E.complex F.complex α n v - -lemma classNegativeTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (α : V) (n v : ℤ) (E F : FiniteHomotopyClass Q (K := K)) : - classHomDimension Q n v (classNegativeTwist Q α E) (classNegativeTwist Q α F) = - classHomDimension Q n v E F := by - induction E using Quotient.inductionOn with | _ E => - induction F using Quotient.inductionOn with | _ F => - exact negativeTwist_homDimension Q hn E.complex F.complex α n v - -lemma unfoldedArtinAction_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) - (x : Artin M) (n v : ℤ) (E F : FiniteHomotopyClass Q (K := K)) : - classHomDimension Q n v (unfoldedArtinAction Q hn M hM x E) - (unfoldedArtinAction Q hn M hM x F) = classHomDimension Q n v E F := by - let H : Subgroup (Artin M) := { - carrier := {x | ∀ E F : FiniteHomotopyClass Q (K := K), - classHomDimension Q n v (unfoldedArtinAction Q hn M hM x E) - (unfoldedArtinAction Q hn M hM x F) = classHomDimension Q n v E F} - one_mem' := by intro E F; simp only [map_one, Equiv.Perm.one_apply] - mul_mem' := by - intro x y hx hy E F - rw [map_mul] - change classHomDimension Q n v - (unfoldedArtinAction Q hn M hM x (unfoldedArtinAction Q hn M hM y E)) - (unfoldedArtinAction Q hn M hM x (unfoldedArtinAction Q hn M hM y F)) = _ - rw [hx, hy] - inv_mem' := by - intro x hx E F - have h := hx (unfoldedArtinAction Q hn M hM x⁻¹ E) - (unfoldedArtinAction Q hn M hM x⁻¹ F) - rw [map_inv] at h ⊢ - simpa only [Equiv.Perm.inv_def, Equiv.apply_symm_apply] using h.symm } - have h := PresentedGroup.generated_by (braidRelators M) H (by - intro α E F - change classHomDimension Q n v - (unfoldedArtinAction Q hn M hM (generator M α) E) - (unfoldedArtinAction Q hn M hM (generator M α) F) = _ - rw [unfoldedArtinAction_generator] - exact classPositiveTwist_homDimension Q hn α n v E F) x - exact h E F - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.UnfoldedPresentation +import OAI.Topology.ArtinGroups.Complexes.HomDimension + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def classHomDimension (n v : ℤ) : + FiniteHomotopyClass Q (K := K) → FiniteHomotopyClass Q (K := K) → ℕ := + Quotient.lift₂ (fun E F => homDimension Q E.complex F.complex n v) + (by + intro E E' F F' ⟨e⟩ ⟨f⟩ + exact e.homDimension_eq Q f n v) + +lemma classPositiveTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (α : V) (n v : ℤ) (E F : FiniteHomotopyClass Q (K := K)) : + classHomDimension Q n v (classPositiveTwist Q α E) (classPositiveTwist Q α F) = + classHomDimension Q n v E F := by + induction E using Quotient.inductionOn with | _ E => + induction F using Quotient.inductionOn with | _ F => + exact positiveTwist_homDimension Q hn E.complex F.complex α n v + +lemma classNegativeTwist_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (α : V) (n v : ℤ) (E F : FiniteHomotopyClass Q (K := K)) : + classHomDimension Q n v (classNegativeTwist Q α E) (classNegativeTwist Q α F) = + classHomDimension Q n v E F := by + induction E using Quotient.inductionOn with | _ E => + induction F using Quotient.inductionOn with | _ F => + exact negativeTwist_homDimension Q hn E.complex F.complex α n v + +lemma unfoldedArtinAction_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) + (x : Artin M) (n v : ℤ) (E F : FiniteHomotopyClass Q (K := K)) : + classHomDimension Q n v (unfoldedArtinAction Q hn M hM x E) + (unfoldedArtinAction Q hn M hM x F) = classHomDimension Q n v E F := by + let H : Subgroup (Artin M) := { + carrier := {x | ∀ E F : FiniteHomotopyClass Q (K := K), + classHomDimension Q n v (unfoldedArtinAction Q hn M hM x E) + (unfoldedArtinAction Q hn M hM x F) = classHomDimension Q n v E F} + one_mem' := by intro E F; simp only [map_one, Equiv.Perm.one_apply] + mul_mem' := by + intro x y hx hy E F + rw [map_mul] + change classHomDimension Q n v + (unfoldedArtinAction Q hn M hM x (unfoldedArtinAction Q hn M hM y E)) + (unfoldedArtinAction Q hn M hM x (unfoldedArtinAction Q hn M hM y F)) = _ + rw [hx, hy] + inv_mem' := by + intro x hx E F + have h := hx (unfoldedArtinAction Q hn M hM x⁻¹ E) + (unfoldedArtinAction Q hn M hM x⁻¹ F) + rw [map_inv] at h ⊢ + simpa only [Equiv.Perm.inv_def, Equiv.apply_symm_apply] using h.symm } + have h := PresentedGroup.generated_by (braidRelators M) H (by + intro α E F + change classHomDimension Q n v + (unfoldedArtinAction Q hn M hM (generator M α) E) + (unfoldedArtinAction Q hn M hM (generator M α) F) = _ + rw [unfoldedArtinAction_generator] + exact classPositiveTwist_homDimension Q hn α n v E F) x + exact h E F + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionDual.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionDual.lean index a4bfce0c7e24c9cfc73cb77d19d2504253319832..7dc3ce909516748d1ed1b3d383a2625fa4331dbb 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionDual.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionDual.lean @@ -1,89 +1,89 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ProbeSwapIso - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] - (Q:ReversibleQuiver V A) -attribute [local instance] Classical.decEq Classical.propDecidable - -lemma classHomDimension_dual [DecidableEq V] (x y:FiniteHomotopyClass Q (K:=K)) (n v:ℤ) : - classHomDimension Q n v x y=classHomDimension Q (-n) (2-v) y x := by - induction x using Quotient.inductionOn with | _ E => - induction y using Quotient.inductionOn with | _ F => - exact homDimension_dual Q E.complex F.complex n v - -local notation "R" => probeQuiver Q - -lemma probeHomDimension_generatorArray {I:Type} [Fintype I] - (E:BasedComplex R (K:=K) I) (hE:E.IsMinimal R) - (α:V) (b:Bool) (ha:∀i,(E.placement i).color≠.inr (α,b)) (n v:ℤ) : - homDimension R ((initialProjective R (.inr (α,b)) : BasedComplex R (K:=K) PUnit.{1})) E n v= - E.generatorArray R ⟨.inl α,n,v-1⟩ := by - rw [probeHomDimension Q E hE α b ha,generatorArray_apply] - apply Nat.card_congr - exact Equiv.subtypeEquivRight fun i => by - cases E.placement i - simp only [GeneratorPlacement.mk.injEq] - -lemma probeClassHomDimension_generatorArray (x:FiniteHomotopyClass R (K:=K)) - (α:V) (b:Bool) - (ha:∀i,((minimalClassModel R x).complex.placement i).color≠.inr (α,b)) (n v:ℤ) : - classHomDimension R n v (initialClass R (.inr (α,b))) x= - classGeneratorArray R x ⟨.inl α,n,v-1⟩ := by - rw [← minimalClassModel_class R x, classGeneratorArray_of_minimal R _ - (minimalClassModel_minimal R x)] - exact probeHomDimension_generatorArray Q _ (minimalClassModel_minimal R x) α b ha n v - -variable (hn:∀a,Q.source a≠Q.target a) - -lemma probeWordPerm_append (w z:List (V×Bool)) : - probeWordPerm Q (K:=K) hn (w++z)=probeWordPerm Q hn w*probeWordPerm Q hn z := by - induction w with - | nil => exact (_root_.one_mul _).symm - | cons a w ih => simp only [List.cons_append,probeWordPerm,ih,_root_.mul_assoc] - -lemma probeSignedPerm_inverse (a:V×Bool) : - probeSignedPerm Q (K:=K) hn (a.1,!a.2)=(probeSignedPerm Q hn a)⁻¹ := by - cases a with | mk v b => cases b <;> rfl - -lemma probeWordPerm_inverse (w:List (V×Bool)) : - probeWordPerm Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2))=(probeWordPerm Q hn w)⁻¹ := by - induction w with - | nil => rfl - | cons a w ih => - simp only [List.reverse_cons,List.map_append,List.map_cons,List.map_nil, - probeWordPerm_append,probeWordPerm,_root_.mul_one,ih, - probeSignedPerm_inverse,mul_inv_rev] - -lemma probeOrbit_generator_dual (w:List (V×Bool)) (α β:V) (n u:ℤ) : - classGeneratorArray R (probeOrbit Q (K:=K) hn w α false) ⟨.inl β,n,u⟩= - classGeneratorArray R - (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β true) ⟨.inl α,-n,-u⟩ := by - have h₁:=probeClassHomDimension_generatorArray Q (probeOrbit Q (K:=K) hn w α false) β true - (probeOrbit_absent Q (K:=K) hn w α β false true (by decide)) n (u+1) - have h₂:=probeClassHomDimension_generatorArray Q - (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β true) α false - (probeOrbit_absent Q (K:=K) hn _ β α true false (by decide)) (-n) (1-u) - have hu:(u+1)-1=u:=by omega - have hv:(1-u)-1= -u:=by omega - rw [hu] at h₁ - rw [hv] at h₂ - rw [← h₁,← h₂] - have hd:=classHomDimension_dual R (K:=K) (initialClass R (.inr (β,true))) - (probeOrbit Q (K:=K) hn w α false) n (u+1) - apply hd.trans - have hsh:2-(u+1)=1-u:=by omega - rw [hsh] - unfold probeOrbit - rw [probeWordPerm_inverse] - have he:=probeWordPerm_homDimension Q (K:=K) hn w - (initialClass R (.inr (α,false))) - ((probeWordPerm Q hn w).symm (initialClass R (.inr (β,true)))) (-n) (1-u) - rw [Equiv.apply_symm_apply] at he - exact he - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ProbeSwapIso + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] + (Q:ReversibleQuiver V A) +attribute [local instance] Classical.decEq Classical.propDecidable + +lemma classHomDimension_dual [DecidableEq V] (x y:FiniteHomotopyClass Q (K:=K)) (n v:ℤ) : + classHomDimension Q n v x y=classHomDimension Q (-n) (2-v) y x := by + induction x using Quotient.inductionOn with | _ E => + induction y using Quotient.inductionOn with | _ F => + exact homDimension_dual Q E.complex F.complex n v + +local notation "R" => probeQuiver Q + +lemma probeHomDimension_generatorArray {I:Type} [Fintype I] + (E:BasedComplex R (K:=K) I) (hE:E.IsMinimal R) + (α:V) (b:Bool) (ha:∀i,(E.placement i).color≠.inr (α,b)) (n v:ℤ) : + homDimension R ((initialProjective R (.inr (α,b)) : BasedComplex R (K:=K) PUnit.{1})) E n v= + E.generatorArray R ⟨.inl α,n,v-1⟩ := by + rw [probeHomDimension Q E hE α b ha,generatorArray_apply] + apply Nat.card_congr + exact Equiv.subtypeEquivRight fun i => by + cases E.placement i + simp only [GeneratorPlacement.mk.injEq] + +lemma probeClassHomDimension_generatorArray (x:FiniteHomotopyClass R (K:=K)) + (α:V) (b:Bool) + (ha:∀i,((minimalClassModel R x).complex.placement i).color≠.inr (α,b)) (n v:ℤ) : + classHomDimension R n v (initialClass R (.inr (α,b))) x= + classGeneratorArray R x ⟨.inl α,n,v-1⟩ := by + rw [← minimalClassModel_class R x, classGeneratorArray_of_minimal R _ + (minimalClassModel_minimal R x)] + exact probeHomDimension_generatorArray Q _ (minimalClassModel_minimal R x) α b ha n v + +variable (hn:∀a,Q.source a≠Q.target a) + +lemma probeWordPerm_append (w z:List (V×Bool)) : + probeWordPerm Q (K:=K) hn (w++z)=probeWordPerm Q hn w*probeWordPerm Q hn z := by + induction w with + | nil => exact (_root_.one_mul _).symm + | cons a w ih => simp only [List.cons_append,probeWordPerm,ih,_root_.mul_assoc] + +lemma probeSignedPerm_inverse (a:V×Bool) : + probeSignedPerm Q (K:=K) hn (a.1,!a.2)=(probeSignedPerm Q hn a)⁻¹ := by + cases a with | mk v b => cases b <;> rfl + +lemma probeWordPerm_inverse (w:List (V×Bool)) : + probeWordPerm Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2))=(probeWordPerm Q hn w)⁻¹ := by + induction w with + | nil => rfl + | cons a w ih => + simp only [List.reverse_cons,List.map_append,List.map_cons,List.map_nil, + probeWordPerm_append,probeWordPerm,_root_.mul_one,ih, + probeSignedPerm_inverse,mul_inv_rev] + +lemma probeOrbit_generator_dual (w:List (V×Bool)) (α β:V) (n u:ℤ) : + classGeneratorArray R (probeOrbit Q (K:=K) hn w α false) ⟨.inl β,n,u⟩= + classGeneratorArray R + (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β true) ⟨.inl α,-n,-u⟩ := by + have h₁:=probeClassHomDimension_generatorArray Q (probeOrbit Q (K:=K) hn w α false) β true + (probeOrbit_absent Q (K:=K) hn w α β false true (by decide)) n (u+1) + have h₂:=probeClassHomDimension_generatorArray Q + (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β true) α false + (probeOrbit_absent Q (K:=K) hn _ β α true false (by decide)) (-n) (1-u) + have hu:(u+1)-1=u:=by omega + have hv:(1-u)-1= -u:=by omega + rw [hu] at h₁ + rw [hv] at h₂ + rw [← h₁,← h₂] + have hd:=classHomDimension_dual R (K:=K) (initialClass R (.inr (β,true))) + (probeOrbit Q (K:=K) hn w α false) n (u+1) + apply hd.trans + have hsh:2-(u+1)=1-u:=by omega + rw [hsh] + unfold probeOrbit + rw [probeWordPerm_inverse] + have he:=probeWordPerm_homDimension Q (K:=K) hn w + (initialClass R (.inr (α,false))) + ((probeWordPerm Q hn w).symm (initialClass R (.inr (β,true)))) (-n) (1-u) + rw [Equiv.apply_symm_apply] at he + exact he + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionRetract.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionRetract.lean index 05bd60735bb86cf30c7a0aebdd1c8291643806b8..ac45bdce27a632689dfd6c19df22b19379c1b823 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionRetract.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionRetract.lean @@ -1,81 +1,81 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J T:Type*} [Fintype I] [Fintype J] [Fintype T] - [DecidableEq I] [DecidableEq J] [DecidableEq T] - -omit [DecidableEq A] [DecidableEq I] in -lemma homDimension_retract_source (M:BasedComplex Q (K:=K) T) - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (ι:Map Q M E) (π:Map Q E M) - (hret:ι.matrix*π.matrix=projectiveIdentity Q M.placement) (n v:ℤ) : - homDimension Q M F n v ≤ homDimension Q E F n v := by - let U:=sandwichHomOperator Q π (Map.identity Q F) - let W:=sandwichHomOperator Q ι (Map.identity Q F) - apply LinearMap.finrank_le_finrank_of_injective (f:=U.onCohomology n v) - apply U.onCohomology_injective - intro f hf hUf - have h:=W.map_boundaries n v hUf - have hcancel:W.component n (U.component n f)=f := by - change ι.matrix*(π.matrix*f*projectiveIdentity Q (K:=K) F.placement)* - projectiveIdentity Q (K:=K) F.placement=f - erw [mul_projectiveIdentity Q (projectiveEntries_mul Q π.entries hf.1.1), - ← Matrix.mul_assoc,hret,projectiveIdentity_mul Q hf.1.1, - mul_projectiveIdentity Q hf.1.1] - rwa [hcancel] at h - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] [DecidableEq T] in -lemma totalHomDimension_le_of_pointwise (M:BasedComplex Q (K:=K) T) - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (a b:ℤ) - (h:∀ v,homDimension Q M E (a-v) v ≤ homDimension Q M F (b-v) v) : - totalHomDimension Q M E a ≤ totalHomDimension Q M F b := by - classical - let D:=homInternalSupport Q M E ∪ homInternalSupport Q M F - rw [totalHomDimension_eq_sum_of_subset Q M E a D Finset.subset_union_left, - totalHomDimension_eq_sum_of_subset Q M F b D Finset.subset_union_right] - exact Finset.sum_le_sum (fun v _=>h v) - -omit [DecidableEq A] [DecidableEq I] in -lemma totalHomDimension_retract_source (M:BasedComplex Q (K:=K) T) - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (ι:Map Q M E) (π:Map Q E M) - (hret:ι.matrix*π.matrix=projectiveIdentity Q M.placement) (t:ℤ) : - totalHomDimension Q M F t ≤ totalHomDimension Q E F t := by - classical - let D:=homInternalSupport Q M F ∪ homInternalSupport Q E F - rw [totalHomDimension_eq_sum_of_subset Q M F t D Finset.subset_union_left, - totalHomDimension_eq_sum_of_subset Q E F t D Finset.subset_union_right] - exact Finset.sum_le_sum (fun v _=>homDimension_retract_source Q M E F ι π hret _ _) - -omit [DecidableEq I] [DecidableEq J] in -lemma cappedSummand_total_bound (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) - (M:BasedComplex Q (K:=K) T) (U:Set V) (q d:ℤ) - (hM:∀ i,(M.placement i).level=q) (hU:∀ i,(M.placement i).color∈U) - (ι:Map Q M (E.pureLayer Q hE q)) (π:Map Q (E.pureLayer Q hE q) M) - (hret:ι.matrix*π.matrix=projectiveIdentity Q M.placement) - (hcap:E.CappedOn Q U q) - (hzero:∀ n v,n+v=d-q → homDimension Q E F n v=0) : - totalHomDimension Q M (F.pureLayer Q hF d) (d-q) ≤ - totalHomDimension Q (F.pureLayer Q hF (d-1)) M (q-d+1) := by - have hb:totalHomDimension Q M (F.pureLayer Q hF d) (d-q) ≤ - totalHomDimension Q M (F.pureLayer Q hF (d-1)) (d-q+1) := by - apply totalHomDimension_le_of_pointwise Q - intro v - have f:=cappedSummandInjection Q E F hE hF M U q d (d-q-v) v hM hU ι π - hret hcap (hzero _ _ (by omega)) (by omega) - have h:=LinearMap.finrank_le_finrank_of_injective f.property - change homDimension Q M (F.pureLayer Q hF d) (d-q-v) v ≤ - homDimension Q M (F.pureLayer Q hF (d-1)) (d-q-v+1) v at h - simpa only [show d-q-v+1=d-q+1-v by omega] using h - rw [totalHomDimension_dual Q M (F.pureLayer Q hF (d-1)) (d-q+1)] at hb - simpa only [show 2-(d-q+1)=q-d+1 by omega] using hb - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J T:Type*} [Fintype I] [Fintype J] [Fintype T] + [DecidableEq I] [DecidableEq J] [DecidableEq T] + +omit [DecidableEq A] [DecidableEq I] in +lemma homDimension_retract_source (M:BasedComplex Q (K:=K) T) + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (ι:Map Q M E) (π:Map Q E M) + (hret:ι.matrix*π.matrix=projectiveIdentity Q M.placement) (n v:ℤ) : + homDimension Q M F n v ≤ homDimension Q E F n v := by + let U:=sandwichHomOperator Q π (Map.identity Q F) + let W:=sandwichHomOperator Q ι (Map.identity Q F) + apply LinearMap.finrank_le_finrank_of_injective (f:=U.onCohomology n v) + apply U.onCohomology_injective + intro f hf hUf + have h:=W.map_boundaries n v hUf + have hcancel:W.component n (U.component n f)=f := by + change ι.matrix*(π.matrix*f*projectiveIdentity Q (K:=K) F.placement)* + projectiveIdentity Q (K:=K) F.placement=f + erw [mul_projectiveIdentity Q (projectiveEntries_mul Q π.entries hf.1.1), + ← Matrix.mul_assoc,hret,projectiveIdentity_mul Q hf.1.1, + mul_projectiveIdentity Q hf.1.1] + rwa [hcancel] at h + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] [DecidableEq T] in +lemma totalHomDimension_le_of_pointwise (M:BasedComplex Q (K:=K) T) + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (a b:ℤ) + (h:∀ v,homDimension Q M E (a-v) v ≤ homDimension Q M F (b-v) v) : + totalHomDimension Q M E a ≤ totalHomDimension Q M F b := by + classical + let D:=homInternalSupport Q M E ∪ homInternalSupport Q M F + rw [totalHomDimension_eq_sum_of_subset Q M E a D Finset.subset_union_left, + totalHomDimension_eq_sum_of_subset Q M F b D Finset.subset_union_right] + exact Finset.sum_le_sum (fun v _=>h v) + +omit [DecidableEq A] [DecidableEq I] in +lemma totalHomDimension_retract_source (M:BasedComplex Q (K:=K) T) + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (ι:Map Q M E) (π:Map Q E M) + (hret:ι.matrix*π.matrix=projectiveIdentity Q M.placement) (t:ℤ) : + totalHomDimension Q M F t ≤ totalHomDimension Q E F t := by + classical + let D:=homInternalSupport Q M F ∪ homInternalSupport Q E F + rw [totalHomDimension_eq_sum_of_subset Q M F t D Finset.subset_union_left, + totalHomDimension_eq_sum_of_subset Q E F t D Finset.subset_union_right] + exact Finset.sum_le_sum (fun v _=>homDimension_retract_source Q M E F ι π hret _ _) + +omit [DecidableEq I] [DecidableEq J] in +lemma cappedSummand_total_bound (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) + (M:BasedComplex Q (K:=K) T) (U:Set V) (q d:ℤ) + (hM:∀ i,(M.placement i).level=q) (hU:∀ i,(M.placement i).color∈U) + (ι:Map Q M (E.pureLayer Q hE q)) (π:Map Q (E.pureLayer Q hE q) M) + (hret:ι.matrix*π.matrix=projectiveIdentity Q M.placement) + (hcap:E.CappedOn Q U q) + (hzero:∀ n v,n+v=d-q → homDimension Q E F n v=0) : + totalHomDimension Q M (F.pureLayer Q hF d) (d-q) ≤ + totalHomDimension Q (F.pureLayer Q hF (d-1)) M (q-d+1) := by + have hb:totalHomDimension Q M (F.pureLayer Q hF d) (d-q) ≤ + totalHomDimension Q M (F.pureLayer Q hF (d-1)) (d-q+1) := by + apply totalHomDimension_le_of_pointwise Q + intro v + have f:=cappedSummandInjection Q E F hE hF M U q d (d-q-v) v hM hU ι π + hret hcap (hzero _ _ (by omega)) (by omega) + have h:=LinearMap.finrank_le_finrank_of_injective f.property + change homDimension Q M (F.pureLayer Q hF d) (d-q-v) v ≤ + homDimension Q M (F.pureLayer Q hF (d-1)) (d-q-v+1) v at h + simpa only [show d-q-v+1=d-q+1-v by omega] using h + rw [totalHomDimension_dual Q M (F.pureLayer Q hF (d-1)) (d-q+1)] at hb + simpa only [show 2-(d-q+1)=q-d+1 by omega] using hb + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroCycles.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroCycles.lean index d595682927dbc993fa3749c24e947d9bf3290861..d30a7a7723c0d9e2f5e5dfca26779bd85071b12b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroCycles.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroCycles.lean @@ -1,54 +1,54 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.FrameModelLayerMiddle -import OAI.Topology.ArtinGroups.Complexes.GeneratorVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in - -lemma homDimension_zero_of_cycles_boundary {I J : Type*} [Fintype I] [Fintype J] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (n v : ℤ) - (h : ∀ f ∈ homCycles Q E F n v, f ∈ homBoundaries Q E F n v) : - homDimension Q E F n v = 0 := by - have hb : (homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype = ⊤ := by - apply eq_top_iff.mpr - intro f _ - exact h f.val f.property - unfold homDimension homCohomology - rw [hb] - exact Module.finrank_zero_of_subsingleton - -lemma frameModel_pure_middle_dimension (hn : ∀ a, Q.source a ≠ Q.target a) - (C : CoxeterMatrix V) (hC : UnfoldedPresentation Q C) (x : Artin C) (α : V) - (l k : ℤ) : - totalHomDimension Q - ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) l) - ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) k) - (k-l+1) = 0 := by - unfold totalHomDimension - apply Finset.sum_eq_zero - intro v _ - apply homDimension_zero_of_cycles_boundary Q - intro f hf - apply frameModel_layer_middle_vanishing Q hn C hC x α l k _ v hf - exact pure_homSpace_linear Q _ _ (fun i => i.property) (fun j => j.property) (by omega) hf.1 - -lemma frameModel_pure_cartan_nonneg (hn : ∀ a, Q.source a ≠ Q.target a) - (C : CoxeterMatrix V) (hC : UnfoldedPresentation Q C) (x : Artin C) (α : V) - (l k : ℤ) : - 0 ≤ generatorVector Q - ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) l) ⬝ᵥ - ((unfoldedCartan Q).mulVec (generatorVector Q - ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) k))) := by - rw [pure_cartan_euler Q _ _ (fun i => i.property) (fun j => j.property), - frameModel_pure_middle_dimension Q hn C hC x α l k, Nat.cast_zero, sub_zero] - positivity - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.FrameModelLayerMiddle +import OAI.Topology.ArtinGroups.Complexes.GeneratorVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [Fintype V] [DecidableEq A] in + +lemma homDimension_zero_of_cycles_boundary {I J : Type*} [Fintype I] [Fintype J] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (n v : ℤ) + (h : ∀ f ∈ homCycles Q E F n v, f ∈ homBoundaries Q E F n v) : + homDimension Q E F n v = 0 := by + have hb : (homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype = ⊤ := by + apply eq_top_iff.mpr + intro f _ + exact h f.val f.property + unfold homDimension homCohomology + rw [hb] + exact Module.finrank_zero_of_subsingleton + +lemma frameModel_pure_middle_dimension (hn : ∀ a, Q.source a ≠ Q.target a) + (C : CoxeterMatrix V) (hC : UnfoldedPresentation Q C) (x : Artin C) (α : V) + (l k : ℤ) : + totalHomDimension Q + ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) l) + ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) k) + (k-l+1) = 0 := by + unfold totalHomDimension + apply Finset.sum_eq_zero + intro v _ + apply homDimension_zero_of_cycles_boundary Q + intro f hf + apply frameModel_layer_middle_vanishing Q hn C hC x α l k _ v hf + exact pure_homSpace_linear Q _ _ (fun i => i.property) (fun j => j.property) (by omega) hf.1 + +lemma frameModel_pure_cartan_nonneg (hn : ∀ a, Q.source a ≠ Q.target a) + (C : CoxeterMatrix V) (hC : UnfoldedPresentation Q C) (x : Artin C) (α : V) + (l k : ℤ) : + 0 ≤ generatorVector Q + ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) l) ⬝ᵥ + ((unfoldedCartan Q).mulVec (generatorVector Q + ((frameModel Q (K := K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) k))) := by + rw [pure_cartan_euler Q _ _ (fun i => i.property) (fun j => j.property), + frameModel_pure_middle_dimension Q hn C hC x α l k, Nat.cast_zero, sub_zero] + positivity + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroHom.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroHom.lean index 11b959bb4240c08e92c0a0cec4b04501fcd4cfd3..0f32d27abc03713982387ded970babd9c1f8e5fc 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroHom.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomDimensionZeroHom.lean @@ -1,38 +1,38 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InitialProjective - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [DecidableEq A] in -lemma homDimension_zero_of_homSpace_zero {I J : Type*} [Fintype I] [Fintype J] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (n v : ℤ) - (h : homSpace Q E F n v = ⊥) : homDimension Q E F n v = 0 := by - have hd := homDimension_le_homSpace Q E F n v - rw [h] at hd - simp only [finrank_bot] at hd - exact Nat.eq_zero_of_le_zero hd - -omit [DecidableEq A] in -lemma initial_homDimension_nonzero_cochain (α β : V) (n v : ℤ) (hn : n ≠ 0) : - homDimension Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = 0 := - homDimension_zero_of_homSpace_zero Q _ _ n v - (initial_homSpace_nonzero_cochain Q α β n v hn) - -omit [DecidableEq A] in -lemma initial_homDimension_orthogonal {α β : V} (h : OrthogonalVertices Q α β) (n v : ℤ) : - homDimension Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = 0 := - homDimension_zero_of_homSpace_zero Q _ _ n v (initial_homSpace_orthogonal Q h n v) - -lemma initial_homDimension_other_internal (hn : ∀ a, Q.source a ≠ Q.target a) - (α : V) (n v : ℤ) (hv₀ : v ≠ 0) (hv₂ : v ≠ 2) : - homDimension Q (initialProjective Q (K := K) α) (initialProjective Q α) n v = 0 := - homDimension_zero_of_homSpace_zero Q _ _ n v - (initial_homSpace_other_internal Q hn α n v hv₀ hv₂) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InitialProjective + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [DecidableEq A] in +lemma homDimension_zero_of_homSpace_zero {I J : Type*} [Fintype I] [Fintype J] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (n v : ℤ) + (h : homSpace Q E F n v = ⊥) : homDimension Q E F n v = 0 := by + have hd := homDimension_le_homSpace Q E F n v + rw [h] at hd + simp only [finrank_bot] at hd + exact Nat.eq_zero_of_le_zero hd + +omit [DecidableEq A] in +lemma initial_homDimension_nonzero_cochain (α β : V) (n v : ℤ) (hn : n ≠ 0) : + homDimension Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = 0 := + homDimension_zero_of_homSpace_zero Q _ _ n v + (initial_homSpace_nonzero_cochain Q α β n v hn) + +omit [DecidableEq A] in +lemma initial_homDimension_orthogonal {α β : V} (h : OrthogonalVertices Q α β) (n v : ℤ) : + homDimension Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = 0 := + homDimension_zero_of_homSpace_zero Q _ _ n v (initial_homSpace_orthogonal Q h n v) + +lemma initial_homDimension_other_internal (hn : ∀ a, Q.source a ≠ Q.target a) + (α : V) (n v : ℤ) (hv₀ : v ≠ 0) (hv₂ : v ≠ 2) : + homDimension Q (initialProjective Q (K := K) α) (initialProjective Q α) n v = 0 := + homDimension_zero_of_homSpace_zero Q _ _ n v + (initial_homSpace_other_internal Q hn α n v hv₀ hv₂) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomInternalSupport.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomInternalSupport.lean index 814fd7b2dd4adb5c64c5d4a2c548875669529143..8065ca00f440107043ce40d3ca9f67f1884ad475 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomInternalSupport.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomInternalSupport.lean @@ -1,101 +1,101 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomStep - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -noncomputable def homInternalSupport (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) : Finset ℤ := - Finset.univ.image fun t : I × J × Fin 3 => - (F.placement t.2.1).internal - (E.placement t.1).internal + (t.2.2.val : ℤ) - -omit [Fintype V] [DecidableEq A] in -lemma mem_homInternalSupport (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (v : ℤ) : - v ∈ homInternalSupport Q E F ↔ ∃ (i : I) (j : J) (r : Fin 3), - v = (F.placement j).internal - (E.placement i).internal + (r.val : ℤ) := by - classical - simp only [homInternalSupport, Finset.mem_image, Finset.mem_univ, true_and, - Prod.exists, eq_comm] - -omit [Fintype V] [DecidableEq A] in -lemma homInternalSupport_dual (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (v : ℤ) : - v ∈ homInternalSupport Q E F ↔ 2-v ∈ homInternalSupport Q F E := by - rw [mem_homInternalSupport, mem_homInternalSupport] - constructor - · rintro ⟨i,j,r,h⟩ - refine ⟨j,i,r.rev, ?_⟩ - have hr := r.isLt - simp only [Fin.val_rev] - omega - · rintro ⟨j,i,r,h⟩ - refine ⟨i,j,r.rev, ?_⟩ - have hr := r.isLt - simp only [Fin.val_rev] - omega - -omit [Fintype V] [DecidableEq A] in -lemma homSpace_off_internal_support (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) (hv : v ∉ homInternalSupport Q E F) : - homSpace Q E F n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Matrix.ext - intro i j - by_contra hh - have ha := homogeneous_nonzero_degree Q (hf.2 i j).2 hh - rw [mem_homInternalSupport] at hv - apply hv - refine ⟨i,j,⟨(v + (E.placement i).internal - (F.placement j).internal).toNat, ?_⟩, ?_⟩ - · omega - · simp only - omega - -omit [Fintype V] [DecidableEq A] in -lemma homDimension_off_internal_support (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) (hv : v ∉ homInternalSupport Q E F) : - homDimension Q E F n v = 0 := by - have hs := homSpace_off_internal_support Q E F n v hv - have hz : homCycles Q E F n v = ⊥ := by - change homSpace Q E F n v ⊓ _ = _ - rw [hs, bot_inf_eq] - unfold homDimension - have : Subsingleton (homCycles Q E F n v) := by rw [hz]; infer_instance - have : Subsingleton (homCohomology Q E F n v) := inferInstance - exact Module.finrank_zero_of_subsingleton - -noncomputable def totalHomDimension (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (t : ℤ) : ℕ := - ∑ v ∈ homInternalSupport Q E F, homDimension Q E F (t-v) v - -noncomputable def totalChainDimension (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (t : ℤ) : ℕ := - ∑ v ∈ homInternalSupport Q E F, Module.finrank K (homSpace Q E F (t-v) v) - -lemma totalHomDimension_dual (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (t : ℤ) : - totalHomDimension Q E F t = totalHomDimension Q F E (2-t) := by - classical - unfold totalHomDimension - refine Finset.sum_bij (fun v _ => 2-v) ?_ ?_ ?_ ?_ - · intro v hv - exact (homInternalSupport_dual Q E F v).mp hv - · intro a _ b _ h - omega - · intro b hb - have hh := (homInternalSupport_dual Q F E b).mp hb - exact ⟨2-b, hh, by omega⟩ - · intro v _ - rw [homDimension_dual Q E F (t-v) v] - congr 1 - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomStep + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +noncomputable def homInternalSupport (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) : Finset ℤ := + Finset.univ.image fun t : I × J × Fin 3 => + (F.placement t.2.1).internal - (E.placement t.1).internal + (t.2.2.val : ℤ) + +omit [Fintype V] [DecidableEq A] in +lemma mem_homInternalSupport (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (v : ℤ) : + v ∈ homInternalSupport Q E F ↔ ∃ (i : I) (j : J) (r : Fin 3), + v = (F.placement j).internal - (E.placement i).internal + (r.val : ℤ) := by + classical + simp only [homInternalSupport, Finset.mem_image, Finset.mem_univ, true_and, + Prod.exists, eq_comm] + +omit [Fintype V] [DecidableEq A] in +lemma homInternalSupport_dual (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (v : ℤ) : + v ∈ homInternalSupport Q E F ↔ 2-v ∈ homInternalSupport Q F E := by + rw [mem_homInternalSupport, mem_homInternalSupport] + constructor + · rintro ⟨i,j,r,h⟩ + refine ⟨j,i,r.rev, ?_⟩ + have hr := r.isLt + simp only [Fin.val_rev] + omega + · rintro ⟨j,i,r,h⟩ + refine ⟨i,j,r.rev, ?_⟩ + have hr := r.isLt + simp only [Fin.val_rev] + omega + +omit [Fintype V] [DecidableEq A] in +lemma homSpace_off_internal_support (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) (hv : v ∉ homInternalSupport Q E F) : + homSpace Q E F n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Matrix.ext + intro i j + by_contra hh + have ha := homogeneous_nonzero_degree Q (hf.2 i j).2 hh + rw [mem_homInternalSupport] at hv + apply hv + refine ⟨i,j,⟨(v + (E.placement i).internal - (F.placement j).internal).toNat, ?_⟩, ?_⟩ + · omega + · simp only + omega + +omit [Fintype V] [DecidableEq A] in +lemma homDimension_off_internal_support (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) (hv : v ∉ homInternalSupport Q E F) : + homDimension Q E F n v = 0 := by + have hs := homSpace_off_internal_support Q E F n v hv + have hz : homCycles Q E F n v = ⊥ := by + change homSpace Q E F n v ⊓ _ = _ + rw [hs, bot_inf_eq] + unfold homDimension + have : Subsingleton (homCycles Q E F n v) := by rw [hz]; infer_instance + have : Subsingleton (homCohomology Q E F n v) := inferInstance + exact Module.finrank_zero_of_subsingleton + +noncomputable def totalHomDimension (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (t : ℤ) : ℕ := + ∑ v ∈ homInternalSupport Q E F, homDimension Q E F (t-v) v + +noncomputable def totalChainDimension (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (t : ℤ) : ℕ := + ∑ v ∈ homInternalSupport Q E F, Module.finrank K (homSpace Q E F (t-v) v) + +lemma totalHomDimension_dual (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (t : ℤ) : + totalHomDimension Q E F t = totalHomDimension Q F E (2-t) := by + classical + unfold totalHomDimension + refine Finset.sum_bij (fun v _ => 2-v) ?_ ?_ ?_ ?_ + · intro v hv + exact (homInternalSupport_dual Q E F v).mp hv + · intro a _ b _ h + omega + · intro b hb + have hh := (homInternalSupport_dual Q F E b).mp hb + exact ⟨2-b, hh, by omega⟩ + · intro v _ + rw [homDimension_dual Q E F (t-v) v] + congr 1 + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomMono.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomMono.lean index 7733dba12a81d6d2dbab8cc1840d7825f39f2631..7afca8a7079653ee2f1cc099b7656b5569c957bf 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomMono.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomMono.lean @@ -1,86 +1,86 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TargetLow - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] - [DecidableEq I] [DecidableEq J] [DecidableEq L] - -def HomMonoFrom (T:BasedComplex Q (K:=K) I) {E:BasedComplex Q (K:=K) J} - {F:BasedComplex Q (K:=K) L} (f:Map Q E F) : Prop := - ∀ g, g∈homCycles Q T E 0 0 → g*f.matrix∈homBoundaries Q T F 0 0 → - g∈homBoundaries Q T E 0 0 - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma lowInclusion_homMono (T:BasedComplex Q (K:=K) I) - (E:BasedComplex Q (K:=K) J) (hE:E.IsMinimal Q) (d:ℤ) - (hT:∀ i,(T.placement i).level≤d+1) : - HomMonoFrom Q T (lowInclusion Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d)) := by - intro g hg hb - exact low_boundary_of_inclusion_boundary Q T E hE d hT hg.1.1 hb - -lemma positiveHomCohomology_surjective (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (α:V) (n v:ℤ) : - Function.Surjective ((positiveHomOperator Q E F α).onCohomology n v) := - (LinearMap.injective_iff_surjective_of_finrank_eq_finrank - (positiveTwist_homDimension Q hn E F α n v).symm).mp - (positiveHomCohomology_injective Q hn E F α n v) - -lemma positiveHom_cycle_lift (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (α:V) (n v:ℤ) - {g:Matrix _ _ (Q.Zigzag K)} - (hg:g∈homCycles Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v) : - ∃ f, f∈homCycles Q E F n v ∧ - positiveHomTransform Q E F α n f-g∈homBoundaries Q - (E.positiveTwist Q α) (F.positiveTwist Q α) n v := by - obtain ⟨x,hx⟩:=positiveHomCohomology_surjective Q hn E F α n v - (Submodule.Quotient.mk ⟨g,hg⟩) - obtain ⟨f,rfl⟩:=Submodule.Quotient.mk_surjective _ x - refine ⟨f,f.property,?_⟩ - have hh:= (Submodule.Quotient.eq - ((homBoundaries Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v).comap - (homCycles Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v).subtype)).mp hx - exact hh - -omit [DecidableEq I] [DecidableEq J] [DecidableEq L] in -lemma positiveHom_zero_mul (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) (α:V) - (f:Matrix I J (Q.Zigzag K)) (hf:ProjectiveEntries Q E.placement F.placement f) - (g:Map Q F G) : - positiveHomTransform Q E F α 0 f*(g.positiveTwist Q α).matrix= - positiveHomTransform Q E G α 0 (f*g.matrix) := by - change Matrix.fromBlocks _ 0 0 f * Matrix.fromBlocks _ 0 0 g.matrix=_ - simp only [positiveHomTransform,cochainSign_zero,one_smul,Matrix.fromBlocks_multiply, - Matrix.mul_zero,Matrix.zero_mul,zero_add,add_zero,Map.test,testTransform_mul Q α _ hf] - -lemma HomMonoFrom.positiveTwist (hn:∀ a,Q.source a≠Q.target a) - {T:BasedComplex Q (K:=K) I} {E:BasedComplex Q (K:=K) J} - {F:BasedComplex Q (K:=K) L} {f:Map Q E F} - (h:HomMonoFrom Q T f) (α:V) : - HomMonoFrom Q (T.positiveTwist Q α) (f.positiveTwist Q α) := by - intro g hg hb - obtain ⟨k,hk,hkg⟩:=positiveHom_cycle_lift Q hn T E α 0 0 hg - have hh:=homBoundary_mul_cycle Q hkg (map_mem_homCycles Q (f.positiveTwist Q α)) - simp only [zero_add] at hh - rw [Matrix.sub_mul,positiveHom_zero_mul Q T E F α k hk.1.1 f] at hh - have hb':positiveHomTransform Q T F α 0 (k*f.matrix)∈homBoundaries Q - (T.positiveTwist Q α) (F.positiveTwist Q α) 0 0 := by - have hz:=(homBoundaries Q _ _ 0 0).add_mem hh hb - simpa only [sub_add_cancel] using hz - have hkf:ProjectiveEntries Q T.placement F.placement (k*f.matrix):= - projectiveEntries_mul Q hk.1.1 f.entries - have hk':=h k hk (positiveHomTransform_reflect_boundary Q hn T F α 0 0 hkf hb') - have hkb:positiveHomTransform Q T E α 0 k∈homBoundaries Q - (T.positiveTwist Q α) (E.positiveTwist Q α) 0 0 := - (positiveHomOperator Q T E α).map_boundaries 0 0 hk' - have hz:=(homBoundaries Q (T.positiveTwist Q α) (E.positiveTwist Q α) 0 0).sub_mem hkb hkg - simpa only [sub_sub_cancel] using hz - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TargetLow + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] + [DecidableEq I] [DecidableEq J] [DecidableEq L] + +def HomMonoFrom (T:BasedComplex Q (K:=K) I) {E:BasedComplex Q (K:=K) J} + {F:BasedComplex Q (K:=K) L} (f:Map Q E F) : Prop := + ∀ g, g∈homCycles Q T E 0 0 → g*f.matrix∈homBoundaries Q T F 0 0 → + g∈homBoundaries Q T E 0 0 + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma lowInclusion_homMono (T:BasedComplex Q (K:=K) I) + (E:BasedComplex Q (K:=K) J) (hE:E.IsMinimal Q) (d:ℤ) + (hT:∀ i,(T.placement i).level≤d+1) : + HomMonoFrom Q T (lowInclusion Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d)) := by + intro g hg hb + exact low_boundary_of_inclusion_boundary Q T E hE d hT hg.1.1 hb + +lemma positiveHomCohomology_surjective (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (α:V) (n v:ℤ) : + Function.Surjective ((positiveHomOperator Q E F α).onCohomology n v) := + (LinearMap.injective_iff_surjective_of_finrank_eq_finrank + (positiveTwist_homDimension Q hn E F α n v).symm).mp + (positiveHomCohomology_injective Q hn E F α n v) + +lemma positiveHom_cycle_lift (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (α:V) (n v:ℤ) + {g:Matrix _ _ (Q.Zigzag K)} + (hg:g∈homCycles Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v) : + ∃ f, f∈homCycles Q E F n v ∧ + positiveHomTransform Q E F α n f-g∈homBoundaries Q + (E.positiveTwist Q α) (F.positiveTwist Q α) n v := by + obtain ⟨x,hx⟩:=positiveHomCohomology_surjective Q hn E F α n v + (Submodule.Quotient.mk ⟨g,hg⟩) + obtain ⟨f,rfl⟩:=Submodule.Quotient.mk_surjective _ x + refine ⟨f,f.property,?_⟩ + have hh:= (Submodule.Quotient.eq + ((homBoundaries Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v).comap + (homCycles Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v).subtype)).mp hx + exact hh + +omit [DecidableEq I] [DecidableEq J] [DecidableEq L] in +lemma positiveHom_zero_mul (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) (α:V) + (f:Matrix I J (Q.Zigzag K)) (hf:ProjectiveEntries Q E.placement F.placement f) + (g:Map Q F G) : + positiveHomTransform Q E F α 0 f*(g.positiveTwist Q α).matrix= + positiveHomTransform Q E G α 0 (f*g.matrix) := by + change Matrix.fromBlocks _ 0 0 f * Matrix.fromBlocks _ 0 0 g.matrix=_ + simp only [positiveHomTransform,cochainSign_zero,one_smul,Matrix.fromBlocks_multiply, + Matrix.mul_zero,Matrix.zero_mul,zero_add,add_zero,Map.test,testTransform_mul Q α _ hf] + +lemma HomMonoFrom.positiveTwist (hn:∀ a,Q.source a≠Q.target a) + {T:BasedComplex Q (K:=K) I} {E:BasedComplex Q (K:=K) J} + {F:BasedComplex Q (K:=K) L} {f:Map Q E F} + (h:HomMonoFrom Q T f) (α:V) : + HomMonoFrom Q (T.positiveTwist Q α) (f.positiveTwist Q α) := by + intro g hg hb + obtain ⟨k,hk,hkg⟩:=positiveHom_cycle_lift Q hn T E α 0 0 hg + have hh:=homBoundary_mul_cycle Q hkg (map_mem_homCycles Q (f.positiveTwist Q α)) + simp only [zero_add] at hh + rw [Matrix.sub_mul,positiveHom_zero_mul Q T E F α k hk.1.1 f] at hh + have hb':positiveHomTransform Q T F α 0 (k*f.matrix)∈homBoundaries Q + (T.positiveTwist Q α) (F.positiveTwist Q α) 0 0 := by + have hz:=(homBoundaries Q _ _ 0 0).add_mem hh hb + simpa only [sub_add_cancel] using hz + have hkf:ProjectiveEntries Q T.placement F.placement (k*f.matrix):= + projectiveEntries_mul Q hk.1.1 f.entries + have hk':=h k hk (positiveHomTransform_reflect_boundary Q hn T F α 0 0 hkf hb') + have hkb:positiveHomTransform Q T E α 0 k∈homBoundaries Q + (T.positiveTwist Q α) (E.positiveTwist Q α) 0 0 := + (positiveHomOperator Q T E α).map_boundaries 0 0 hk' + have hz:=(homBoundaries Q (T.positiveTwist Q α) (E.positiveTwist Q α) 0 0).sub_mem hkb hkg + simpa only [sub_sub_cancel] using hz + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomOperator.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomOperator.lean index 0f96ced2729301f0c7b8af12368fc1a2b850bf90..4ded154940f5c91c807d89f58d13a204edd87303 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomOperator.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomOperator.lean @@ -1,90 +1,90 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.TraceLinear - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J I' J' : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] - -structure HomOperator (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (E' : BasedComplex Q (K := K) I') - (F' : BasedComplex Q (K := K) J') where - component : ℤ → Matrix I J (Q.Zigzag K) →ₗ[K] Matrix I' J' (Q.Zigzag K) - preserves : ∀ n v f, f ∈ homSpace Q E F n v → component n f ∈ homSpace Q E' F' n v - commute : ∀ n v f, f ∈ homSpace Q E F n v → - homDifferential Q E' F' n (component n f) = - component (n + 1) (homDifferential Q E F n f) - -namespace HomOperator -variable {Q} {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - {E' : BasedComplex Q (K := K) I'} {F' : BasedComplex Q (K := K) J'} - -lemma map_cycles (T : HomOperator Q E F E' F') (n v : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) : - T.component n f ∈ homCycles Q E' F' n v := by - constructor - · exact T.preserves n v f hf.1 - · change homDifferential Q E' F' n (T.component n f) = 0 - rw [T.commute n v f hf.1, show homDifferential Q E F n f = 0 from hf.2, map_zero] - -lemma map_boundaries (T : HomOperator Q E F E' F') (n v : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homBoundaries Q E F n v) : - T.component n f ∈ homBoundaries Q E' F' n v := by - obtain ⟨g, hg, rfl⟩ := hf - refine ⟨T.component (n - 1) g, T.preserves (n - 1) v g hg, ?_⟩ - simpa only [sub_add_cancel] using T.commute (n - 1) v g hg - -noncomputable def onCycles (T : HomOperator Q E F E' F') (n v : ℤ) : - homCycles Q E F n v →ₗ[K] homCycles Q E' F' n v := - (T.component n).restrict (fun _ hf => T.map_cycles n v hf) - -noncomputable def onCohomology (T : HomOperator Q E F E' F') (n v : ℤ) : - homCohomology Q E F n v →ₗ[K] homCohomology Q E' F' n v := - Submodule.mapQ _ _ (T.onCycles n v) (by - intro f hf - exact T.map_boundaries n v hf) - -lemma onCohomology_mk (T : HomOperator Q E F E' F') (n v : ℤ) - (f : homCycles Q E F n v) : - T.onCohomology n v (Submodule.Quotient.mk f) = - Submodule.Quotient.mk (T.onCycles n v f) := rfl - -lemma onCohomology_injective (T : HomOperator Q E F E' F') (n v : ℤ) - (hr : ∀ f, f ∈ homCycles Q E F n v → - T.component n f ∈ homBoundaries Q E' F' n v → f ∈ homBoundaries Q E F n v) : - Function.Injective (T.onCohomology n v) := by - apply (LinearMap.ker_eq_bot).mp - apply le_antisymm - · intro x hx - obtain ⟨f, rfl⟩ := Submodule.Quotient.mk_surjective _ x - change Submodule.Quotient.mk (T.onCycles n v f) = 0 at hx - have hb := (Submodule.Quotient.mk_eq_zero _).mp hx - have hf := hr f f.property hb - change Submodule.Quotient.mk f = 0 - exact (Submodule.Quotient.mk_eq_zero _).mpr hf - · exact bot_le - -end HomOperator - -lemma homDifferential_sandwich {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} - {F' : BasedComplex Q (K := K) J'} (a : Map Q E' E) (b : Map Q F F') - (n : ℤ) (f : Matrix I J (Q.Zigzag K)) : - homDifferential Q E' F' n (a.matrix * f * b.matrix) = - a.matrix * homDifferential Q E F n f * b.matrix := by - change E'.differential * (a.matrix * f * b.matrix) - - cochainSign (K := K) n • (a.matrix * f * b.matrix * F'.differential) = - a.matrix * (E.differential * f - - cochainSign (K := K) n • (f * F.differential)) * b.matrix - rw [Matrix.mul_sub, Matrix.sub_mul, Matrix.mul_smul, Matrix.smul_mul] - congr 1 - · rw [← Matrix.mul_assoc, ← Matrix.mul_assoc, a.commute] - simp only [Matrix.mul_assoc] - · rw [Matrix.mul_assoc, Matrix.mul_assoc, ← b.commute] - simp only [Matrix.mul_assoc] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.TraceLinear + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J I' J' : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] + +structure HomOperator (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (E' : BasedComplex Q (K := K) I') + (F' : BasedComplex Q (K := K) J') where + component : ℤ → Matrix I J (Q.Zigzag K) →ₗ[K] Matrix I' J' (Q.Zigzag K) + preserves : ∀ n v f, f ∈ homSpace Q E F n v → component n f ∈ homSpace Q E' F' n v + commute : ∀ n v f, f ∈ homSpace Q E F n v → + homDifferential Q E' F' n (component n f) = + component (n + 1) (homDifferential Q E F n f) + +namespace HomOperator +variable {Q} {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + {E' : BasedComplex Q (K := K) I'} {F' : BasedComplex Q (K := K) J'} + +lemma map_cycles (T : HomOperator Q E F E' F') (n v : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homCycles Q E F n v) : + T.component n f ∈ homCycles Q E' F' n v := by + constructor + · exact T.preserves n v f hf.1 + · change homDifferential Q E' F' n (T.component n f) = 0 + rw [T.commute n v f hf.1, show homDifferential Q E F n f = 0 from hf.2, map_zero] + +lemma map_boundaries (T : HomOperator Q E F E' F') (n v : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homBoundaries Q E F n v) : + T.component n f ∈ homBoundaries Q E' F' n v := by + obtain ⟨g, hg, rfl⟩ := hf + refine ⟨T.component (n - 1) g, T.preserves (n - 1) v g hg, ?_⟩ + simpa only [sub_add_cancel] using T.commute (n - 1) v g hg + +noncomputable def onCycles (T : HomOperator Q E F E' F') (n v : ℤ) : + homCycles Q E F n v →ₗ[K] homCycles Q E' F' n v := + (T.component n).restrict (fun _ hf => T.map_cycles n v hf) + +noncomputable def onCohomology (T : HomOperator Q E F E' F') (n v : ℤ) : + homCohomology Q E F n v →ₗ[K] homCohomology Q E' F' n v := + Submodule.mapQ _ _ (T.onCycles n v) (by + intro f hf + exact T.map_boundaries n v hf) + +lemma onCohomology_mk (T : HomOperator Q E F E' F') (n v : ℤ) + (f : homCycles Q E F n v) : + T.onCohomology n v (Submodule.Quotient.mk f) = + Submodule.Quotient.mk (T.onCycles n v f) := rfl + +lemma onCohomology_injective (T : HomOperator Q E F E' F') (n v : ℤ) + (hr : ∀ f, f ∈ homCycles Q E F n v → + T.component n f ∈ homBoundaries Q E' F' n v → f ∈ homBoundaries Q E F n v) : + Function.Injective (T.onCohomology n v) := by + apply (LinearMap.ker_eq_bot).mp + apply le_antisymm + · intro x hx + obtain ⟨f, rfl⟩ := Submodule.Quotient.mk_surjective _ x + change Submodule.Quotient.mk (T.onCycles n v f) = 0 at hx + have hb := (Submodule.Quotient.mk_eq_zero _).mp hx + have hf := hr f f.property hb + change Submodule.Quotient.mk f = 0 + exact (Submodule.Quotient.mk_eq_zero _).mpr hf + · exact bot_le + +end HomOperator + +lemma homDifferential_sandwich {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} + {F' : BasedComplex Q (K := K) J'} (a : Map Q E' E) (b : Map Q F F') + (n : ℤ) (f : Matrix I J (Q.Zigzag K)) : + homDifferential Q E' F' n (a.matrix * f * b.matrix) = + a.matrix * homDifferential Q E F n f * b.matrix := by + change E'.differential * (a.matrix * f * b.matrix) - + cochainSign (K := K) n • (a.matrix * f * b.matrix * F'.differential) = + a.matrix * (E.differential * f - + cochainSign (K := K) n • (f * F.differential)) * b.matrix + rw [Matrix.mul_sub, Matrix.sub_mul, Matrix.mul_smul, Matrix.smul_mul] + congr 1 + · rw [← Matrix.mul_assoc, ← Matrix.mul_assoc, a.commute] + simp only [Matrix.mul_assoc] + · rw [Matrix.mul_assoc, Matrix.mul_assoc, ← b.commute] + simp only [Matrix.mul_assoc] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomPath.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomPath.lean index 986ee0a4795b67a6f9cb7f7a3c29554627368e4d..1872ff6f315334a2fbb97fbd7cfdcad9f3bec682 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomPath.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomPath.lean @@ -1,125 +1,125 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.CornerPath -import OAI.Topology.ArtinGroups.Complexes.HomSpace - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -abbrev HomPath (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (n v : ℤ) := - {t : I × J × Path V A // - Path.source Q t.2.2 = (E.placement t.1).color ∧ - Path.target Q t.2.2 = (F.placement t.2.1).color ∧ - (F.placement t.2.1).cochain = (E.placement t.1).cochain + n ∧ - Path.length t.2.2 = v + (E.placement t.1).internal - (F.placement t.2.1).internal} - -omit [Fintype V] [DecidableEq A] in -lemma homPath_of_coordinate_ne_zero (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) (f : homSpace Q E F n v) - (i : I) (j : J) (p : Path V A) (hp : pathCoordinates Q (f.val i j) p ≠ 0) : - Path.source Q p = (E.placement i).color ∧ Path.target Q p = (F.placement j).color ∧ - (F.placement j).cochain = (E.placement i).cochain+n ∧ - Path.length p = v+(E.placement i).internal-(F.placement j).internal := by - have hc := coordinates_corner Q (f.property.1.1 i j) (f.property.1.2 i j) hp - refine ⟨hc.1, hc.2, ?_, ?_⟩ - · by_contra hh - exact hp (by rw [(f.property.2 i j).1 hh, coordinates_zero]) - · by_contra hh - exact hp ((coordinates_homogeneous Q _ _).mp (f.property.2 i j).2 p hh) - -noncomputable def homPathBasis [DecidableEq I] [DecidableEq J] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (n v : ℤ) (t : HomPath Q E F n v) : homSpace Q E F n v := - ⟨Matrix.single t.val.1 t.val.2.1 (pathBasis Q t.val.2.2), by - constructor - · apply projectiveEntries_single Q - · simpa only [t.property.1] using pathBasis_left Q (K := K) t.val.2.2 - · simpa only [t.property.2.1] using pathBasis_right Q (K := K) t.val.2.2 - · apply mapDegree_single Q _ _ _ _ _ _ _ t.property.2.2.1 - simpa only [t.property.2.2.2] using pathBasis_homogeneous Q (K := K) t.val.2.2⟩ - -noncomputable def homCoordinates (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homSpace Q E F n v →ₗ[K] (HomPath Q E F n v → K) where - toFun f t := pathCoordinates Q (f.val t.val.1 t.val.2.1) t.val.2.2 - map_add' f g := by - funext t - exact congrFun ((pathCoordinates Q).map_add (f.val t.val.1 t.val.2.1) (g.val t.val.1 t.val.2.1)) t.val.2.2 - map_smul' c f := by - funext t - exact (pathCoordinates Q).map_smul c (f.val t.val.1 t.val.2.1) |> congrFun <| t.val.2.2 - -omit [Fintype V] [DecidableEq A] in -lemma homCoordinates_injective (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : Function.Injective (homCoordinates Q E F n v) := by - apply LinearMap.ker_eq_bot.mp - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Subtype.ext - apply Matrix.ext - intro i j - apply (pathCoordinates Q).injective - funext p - change pathCoordinates Q (f.val i j) p = pathCoordinates Q 0 p - rw [coordinates_zero] - by_contra hp - let t : HomPath Q E F n v := ⟨(i,j,p), homPath_of_coordinate_ne_zero Q E F n v f i j p hp⟩ - have hh := congrFun hf t - dsimp only [homCoordinates, LinearMap.coe_mk, AddHom.coe_mk, Pi.zero_apply, t] at hh - exact hp hh - -lemma homPathBasis_coordinates [DecidableEq I] [DecidableEq J] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (n v : ℤ) (s t : HomPath Q E F n v) : - homCoordinates Q E F n v (homPathBasis Q E F n v s) t = if s=t then 1 else 0 := by - classical - dsimp only [homCoordinates, homPathBasis, LinearMap.coe_mk, AddHom.coe_mk] - change pathCoordinates Q (Matrix.single s.val.1 s.val.2.1 (pathBasis Q (K := K) s.val.2.2) - t.val.1 t.val.2.1) t.val.2.2 = _ - by_cases hi : s.val.1=t.val.1 - · by_cases hj : s.val.2.1=t.val.2.1 - · rw [hi, hj, Matrix.single_apply_same, pathBasis_coordinates] - congr 1 - apply propext - constructor - · intro hp - apply Subtype.ext - exact Prod.ext hi (Prod.ext hj hp) - · intro h - exact congrArg (fun x : HomPath Q E F n v => x.val.2.2) h - · have hs : s ≠ t := fun h => hj (congrArg (fun x : HomPath Q E F n v => x.val.2.1) h) - simp only [Matrix.single_apply, hi, true_and, ite_eq_right hj, coordinates_zero, - ite_eq_right hs] - · have hs : s ≠ t := fun h => hi (congrArg (fun x : HomPath Q E F n v => x.val.1) h) - simp only [Matrix.single_apply, hi, false_and, ite_false, coordinates_zero, ite_eq_right hs] - -lemma homCoordinates_surjective (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : Function.Surjective (homCoordinates Q E F n v) := by - classical - intro f - refine ⟨∑ t, f t • homPathBasis Q E F n v t, ?_⟩ - ext t - simp only [map_sum, map_smul, Finset.sum_apply, Pi.smul_apply, smul_eq_mul, - homPathBasis_coordinates] - simp - -noncomputable def homCoordinatesEquiv (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homSpace Q E F n v ≃ₗ[K] (HomPath Q E F n v → K) := - LinearEquiv.ofBijective (homCoordinates Q E F n v) - ⟨homCoordinates_injective Q E F n v, homCoordinates_surjective Q E F n v⟩ - -lemma homSpace_finrank (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - Module.finrank K (homSpace Q E F n v) = Nat.card (HomPath Q E F n v) := by - classical - rw [(homCoordinatesEquiv Q E F n v).finrank_eq, Module.finrank_pi, Nat.card_eq_fintype_card] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.CornerPath +import OAI.Topology.ArtinGroups.Complexes.HomSpace + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +abbrev HomPath (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (n v : ℤ) := + {t : I × J × Path V A // + Path.source Q t.2.2 = (E.placement t.1).color ∧ + Path.target Q t.2.2 = (F.placement t.2.1).color ∧ + (F.placement t.2.1).cochain = (E.placement t.1).cochain + n ∧ + Path.length t.2.2 = v + (E.placement t.1).internal - (F.placement t.2.1).internal} + +omit [Fintype V] [DecidableEq A] in +lemma homPath_of_coordinate_ne_zero (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) (f : homSpace Q E F n v) + (i : I) (j : J) (p : Path V A) (hp : pathCoordinates Q (f.val i j) p ≠ 0) : + Path.source Q p = (E.placement i).color ∧ Path.target Q p = (F.placement j).color ∧ + (F.placement j).cochain = (E.placement i).cochain+n ∧ + Path.length p = v+(E.placement i).internal-(F.placement j).internal := by + have hc := coordinates_corner Q (f.property.1.1 i j) (f.property.1.2 i j) hp + refine ⟨hc.1, hc.2, ?_, ?_⟩ + · by_contra hh + exact hp (by rw [(f.property.2 i j).1 hh, coordinates_zero]) + · by_contra hh + exact hp ((coordinates_homogeneous Q _ _).mp (f.property.2 i j).2 p hh) + +noncomputable def homPathBasis [DecidableEq I] [DecidableEq J] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (n v : ℤ) (t : HomPath Q E F n v) : homSpace Q E F n v := + ⟨Matrix.single t.val.1 t.val.2.1 (pathBasis Q t.val.2.2), by + constructor + · apply projectiveEntries_single Q + · simpa only [t.property.1] using pathBasis_left Q (K := K) t.val.2.2 + · simpa only [t.property.2.1] using pathBasis_right Q (K := K) t.val.2.2 + · apply mapDegree_single Q _ _ _ _ _ _ _ t.property.2.2.1 + simpa only [t.property.2.2.2] using pathBasis_homogeneous Q (K := K) t.val.2.2⟩ + +noncomputable def homCoordinates (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homSpace Q E F n v →ₗ[K] (HomPath Q E F n v → K) where + toFun f t := pathCoordinates Q (f.val t.val.1 t.val.2.1) t.val.2.2 + map_add' f g := by + funext t + exact congrFun ((pathCoordinates Q).map_add (f.val t.val.1 t.val.2.1) (g.val t.val.1 t.val.2.1)) t.val.2.2 + map_smul' c f := by + funext t + exact (pathCoordinates Q).map_smul c (f.val t.val.1 t.val.2.1) |> congrFun <| t.val.2.2 + +omit [Fintype V] [DecidableEq A] in +lemma homCoordinates_injective (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : Function.Injective (homCoordinates Q E F n v) := by + apply LinearMap.ker_eq_bot.mp + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Subtype.ext + apply Matrix.ext + intro i j + apply (pathCoordinates Q).injective + funext p + change pathCoordinates Q (f.val i j) p = pathCoordinates Q 0 p + rw [coordinates_zero] + by_contra hp + let t : HomPath Q E F n v := ⟨(i,j,p), homPath_of_coordinate_ne_zero Q E F n v f i j p hp⟩ + have hh := congrFun hf t + dsimp only [homCoordinates, LinearMap.coe_mk, AddHom.coe_mk, Pi.zero_apply, t] at hh + exact hp hh + +lemma homPathBasis_coordinates [DecidableEq I] [DecidableEq J] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (n v : ℤ) (s t : HomPath Q E F n v) : + homCoordinates Q E F n v (homPathBasis Q E F n v s) t = if s=t then 1 else 0 := by + classical + dsimp only [homCoordinates, homPathBasis, LinearMap.coe_mk, AddHom.coe_mk] + change pathCoordinates Q (Matrix.single s.val.1 s.val.2.1 (pathBasis Q (K := K) s.val.2.2) + t.val.1 t.val.2.1) t.val.2.2 = _ + by_cases hi : s.val.1=t.val.1 + · by_cases hj : s.val.2.1=t.val.2.1 + · rw [hi, hj, Matrix.single_apply_same, pathBasis_coordinates] + congr 1 + apply propext + constructor + · intro hp + apply Subtype.ext + exact Prod.ext hi (Prod.ext hj hp) + · intro h + exact congrArg (fun x : HomPath Q E F n v => x.val.2.2) h + · have hs : s ≠ t := fun h => hj (congrArg (fun x : HomPath Q E F n v => x.val.2.1) h) + simp only [Matrix.single_apply, hi, true_and, ite_eq_right hj, coordinates_zero, + ite_eq_right hs] + · have hs : s ≠ t := fun h => hi (congrArg (fun x : HomPath Q E F n v => x.val.1) h) + simp only [Matrix.single_apply, hi, false_and, ite_false, coordinates_zero, ite_eq_right hs] + +lemma homCoordinates_surjective (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : Function.Surjective (homCoordinates Q E F n v) := by + classical + intro f + refine ⟨∑ t, f t • homPathBasis Q E F n v t, ?_⟩ + ext t + simp only [map_sum, map_smul, Finset.sum_apply, Pi.smul_apply, smul_eq_mul, + homPathBasis_coordinates] + simp + +noncomputable def homCoordinatesEquiv (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homSpace Q E F n v ≃ₗ[K] (HomPath Q E F n v → K) := + LinearEquiv.ofBijective (homCoordinates Q E F n v) + ⟨homCoordinates_injective Q E F n v, homCoordinates_surjective Q E F n v⟩ + +lemma homSpace_finrank (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + Module.finrank K (homSpace Q E F n v) = Nat.card (HomPath Q E F n v) := by + classical + rw [(homCoordinatesEquiv Q E F n v).finrank_eq, Module.finrank_pi, Nat.card_eq_fintype_card] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpace.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpace.lean index a0b31ba9523f03f4dbe9b04d937dc50e41825284..49b2745473041bf0c998a79a4179517c6c075cc5 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpace.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpace.lean @@ -1,154 +1,154 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot -import OAI.Topology.ArtinGroups.Quivers.Level - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] - -lemma projectiveEntries_smul {p : I → GeneratorPlacement V} - {q : J → GeneratorPlacement V} {M : Matrix I J (Q.Zigzag K)} - (r : K) (h : ProjectiveEntries Q p q M) : - ProjectiveEntries Q p q (r • M) := by - constructor - · intro i j - change vertexId Q _ * (r • M i j) = r • M i j - rw [mul_smul, h.1] - · intro i j - change (r • M i j) * vertexId Q _ = r • M i j - rw [smul_mul, h.2] - -lemma mapDegree_smul {p : I → GeneratorPlacement V} - {q : J → GeneratorPlacement V} {M : Matrix I J (Q.Zigzag K)} - {n v : ℤ} (r : K) (h : MapDegree Q p q n v M) : - MapDegree Q p q n v (r • M) := by - intro i j - exact ⟨fun hc => by change r • M i j = 0; rw [(h i j).1 hc, smul_zero], - homogeneous_smul Q (h i j).2 r⟩ - -namespace BasedComplex - -variable [Fintype I] [Fintype J] - -def homSpace (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (n v : ℤ) : Submodule K (Matrix I J (Q.Zigzag K)) where - carrier := {f | ProjectiveEntries Q E.placement F.placement f ∧ - MapDegree Q E.placement F.placement n v f} - zero_mem' := ⟨projectiveEntries_zero Q, mapDegree_zero Q n v⟩ - add_mem' hf hg := ⟨projectiveEntries_add Q hf.1 hg.1, mapDegree_add Q hf.2 hg.2⟩ - smul_mem' r _ hf := ⟨projectiveEntries_smul Q r hf.1, mapDegree_smul Q r hf.2⟩ - -def cochainSign (n : ℤ) : K := (n.negOnePow.val : K) - -lemma cochainSign_zero : cochainSign (K := K) 0 = 1 := by - simp [cochainSign] - -lemma cochainSign_add_one (n : ℤ) : cochainSign (K := K) (n + 1) = -cochainSign n := by - simp [cochainSign, Int.negOnePow_add] - -lemma cochainSign_add (n m : ℤ) : - cochainSign (K := K) (n + m) = cochainSign n * cochainSign m := by - simp [cochainSign, Int.negOnePow_add] - -lemma cochainSign_neg (n : ℤ) : cochainSign (K := K) (-n) = cochainSign n := by - simp only [cochainSign, Int.negOnePow_neg] - -lemma cochainSign_mul_self (n : ℤ) : cochainSign (K := K) n * cochainSign n = 1 := by - conv_lhs => lhs; rw [← cochainSign_neg (K := K) n] - rw [← cochainSign_add, neg_add_cancel, cochainSign_zero] - -noncomputable def homDifferential (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n : ℤ) : - Matrix I J (Q.Zigzag K) →ₗ[K] Matrix I J (Q.Zigzag K) where - toFun f := E.differential * f - cochainSign (K := K) n • (f * F.differential) - map_add' f g := by - simp only [Matrix.mul_add, Matrix.add_mul, smul_add] - abel - map_smul' r f := by - simp only [Matrix.mul_smul, Matrix.smul_mul, smul_sub] - simp only [RingHom.id_apply] - rw [smul_comm] - -lemma homDifferential_mem (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homSpace Q E F n v) : - homDifferential Q E F n f ∈ homSpace Q E F (n + 1) v := by - change ProjectiveEntries Q E.placement F.placement - (E.differential * f - cochainSign (K := K) n • (f * F.differential)) ∧ - MapDegree Q E.placement F.placement (n + 1) v - (E.differential * f - cochainSign (K := K) n • (f * F.differential)) - rw [sub_eq_add_neg] - constructor - · exact projectiveEntries_add Q (projectiveEntries_mul Q E.entries hf.1) - (projectiveEntries_neg Q (projectiveEntries_smul Q _ - (projectiveEntries_mul Q hf.1 F.entries))) - · have h₁ := mapDegree_mul Q E.degree hf.2 - have h₂ := mapDegree_mul Q hf.2 F.degree - simp only [zero_add, add_zero] at h₁ h₂ - rw [add_comm 1 n] at h₁ - exact mapDegree_add Q h₁ (mapDegree_neg Q (mapDegree_smul Q _ h₂)) - -lemma homDifferential_square_zero (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n : ℤ) - (f : Matrix I J (Q.Zigzag K)) : - homDifferential Q E F (n + 1) (homDifferential Q E F n f) = 0 := by - change E.differential * (E.differential * f - cochainSign n • (f * F.differential)) - - cochainSign (n + 1) • ((E.differential * f - cochainSign n • (f * F.differential)) * - F.differential) = 0 - have h₁ : E.differential * (E.differential * f) = 0 := by - rw [← Matrix.mul_assoc, E.square_zero, Matrix.zero_mul] - have h₂ : (f * F.differential) * F.differential = 0 := by - rw [Matrix.mul_assoc, F.square_zero, Matrix.mul_zero] - rw [cochainSign_add_one] - simp only [Matrix.mul_sub, Matrix.sub_mul, Matrix.mul_smul, Matrix.smul_mul, - h₁, h₂, neg_smul, smul_zero, sub_zero, zero_sub, Matrix.mul_assoc] - abel - -noncomputable def gradedHomDifferential (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homSpace Q E F n v →ₗ[K] homSpace Q E F (n + 1) v := - (homDifferential Q E F n).restrict - (fun _ hf => homDifferential_mem Q E F n v hf) - -lemma homSpace_pure_total_degree_lower (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) - (hF : ∀ j, (F.placement j).level = k) - (h : n + v < k - l) : homSpace Q E F n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Matrix.ext - intro i j - by_contra he - have hh := mapDegree_level_bound Q hf.2 he - rw [hE i, hF j] at hh - omega - -lemma homSpace_pure_total_degree_upper (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) - (hF : ∀ j, (F.placement j).level = k) - (h : k - l + 2 < n + v) : homSpace Q E F n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Matrix.ext - intro i j - by_contra he - have hc : (F.placement j).cochain = (E.placement i).cochain + n := by - by_contra hc - exact he ((hf.2 i j).1 hc) - have ha := homogeneous_nonzero_degree Q (hf.2 i j).2 he - have he' := hE i - have hf' := hF j - dsimp only [GeneratorPlacement.level] at he' hf' - omega - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot +import OAI.Topology.ArtinGroups.Quivers.Level + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] + +lemma projectiveEntries_smul {p : I → GeneratorPlacement V} + {q : J → GeneratorPlacement V} {M : Matrix I J (Q.Zigzag K)} + (r : K) (h : ProjectiveEntries Q p q M) : + ProjectiveEntries Q p q (r • M) := by + constructor + · intro i j + change vertexId Q _ * (r • M i j) = r • M i j + rw [mul_smul, h.1] + · intro i j + change (r • M i j) * vertexId Q _ = r • M i j + rw [smul_mul, h.2] + +lemma mapDegree_smul {p : I → GeneratorPlacement V} + {q : J → GeneratorPlacement V} {M : Matrix I J (Q.Zigzag K)} + {n v : ℤ} (r : K) (h : MapDegree Q p q n v M) : + MapDegree Q p q n v (r • M) := by + intro i j + exact ⟨fun hc => by change r • M i j = 0; rw [(h i j).1 hc, smul_zero], + homogeneous_smul Q (h i j).2 r⟩ + +namespace BasedComplex + +variable [Fintype I] [Fintype J] + +def homSpace (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (n v : ℤ) : Submodule K (Matrix I J (Q.Zigzag K)) where + carrier := {f | ProjectiveEntries Q E.placement F.placement f ∧ + MapDegree Q E.placement F.placement n v f} + zero_mem' := ⟨projectiveEntries_zero Q, mapDegree_zero Q n v⟩ + add_mem' hf hg := ⟨projectiveEntries_add Q hf.1 hg.1, mapDegree_add Q hf.2 hg.2⟩ + smul_mem' r _ hf := ⟨projectiveEntries_smul Q r hf.1, mapDegree_smul Q r hf.2⟩ + +def cochainSign (n : ℤ) : K := (n.negOnePow.val : K) + +lemma cochainSign_zero : cochainSign (K := K) 0 = 1 := by + simp [cochainSign] + +lemma cochainSign_add_one (n : ℤ) : cochainSign (K := K) (n + 1) = -cochainSign n := by + simp [cochainSign, Int.negOnePow_add] + +lemma cochainSign_add (n m : ℤ) : + cochainSign (K := K) (n + m) = cochainSign n * cochainSign m := by + simp [cochainSign, Int.negOnePow_add] + +lemma cochainSign_neg (n : ℤ) : cochainSign (K := K) (-n) = cochainSign n := by + simp only [cochainSign, Int.negOnePow_neg] + +lemma cochainSign_mul_self (n : ℤ) : cochainSign (K := K) n * cochainSign n = 1 := by + conv_lhs => lhs; rw [← cochainSign_neg (K := K) n] + rw [← cochainSign_add, neg_add_cancel, cochainSign_zero] + +noncomputable def homDifferential (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n : ℤ) : + Matrix I J (Q.Zigzag K) →ₗ[K] Matrix I J (Q.Zigzag K) where + toFun f := E.differential * f - cochainSign (K := K) n • (f * F.differential) + map_add' f g := by + simp only [Matrix.mul_add, Matrix.add_mul, smul_add] + abel + map_smul' r f := by + simp only [Matrix.mul_smul, Matrix.smul_mul, smul_sub] + simp only [RingHom.id_apply] + rw [smul_comm] + +lemma homDifferential_mem (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homSpace Q E F n v) : + homDifferential Q E F n f ∈ homSpace Q E F (n + 1) v := by + change ProjectiveEntries Q E.placement F.placement + (E.differential * f - cochainSign (K := K) n • (f * F.differential)) ∧ + MapDegree Q E.placement F.placement (n + 1) v + (E.differential * f - cochainSign (K := K) n • (f * F.differential)) + rw [sub_eq_add_neg] + constructor + · exact projectiveEntries_add Q (projectiveEntries_mul Q E.entries hf.1) + (projectiveEntries_neg Q (projectiveEntries_smul Q _ + (projectiveEntries_mul Q hf.1 F.entries))) + · have h₁ := mapDegree_mul Q E.degree hf.2 + have h₂ := mapDegree_mul Q hf.2 F.degree + simp only [zero_add, add_zero] at h₁ h₂ + rw [add_comm 1 n] at h₁ + exact mapDegree_add Q h₁ (mapDegree_neg Q (mapDegree_smul Q _ h₂)) + +lemma homDifferential_square_zero (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n : ℤ) + (f : Matrix I J (Q.Zigzag K)) : + homDifferential Q E F (n + 1) (homDifferential Q E F n f) = 0 := by + change E.differential * (E.differential * f - cochainSign n • (f * F.differential)) - + cochainSign (n + 1) • ((E.differential * f - cochainSign n • (f * F.differential)) * + F.differential) = 0 + have h₁ : E.differential * (E.differential * f) = 0 := by + rw [← Matrix.mul_assoc, E.square_zero, Matrix.zero_mul] + have h₂ : (f * F.differential) * F.differential = 0 := by + rw [Matrix.mul_assoc, F.square_zero, Matrix.mul_zero] + rw [cochainSign_add_one] + simp only [Matrix.mul_sub, Matrix.sub_mul, Matrix.mul_smul, Matrix.smul_mul, + h₁, h₂, neg_smul, smul_zero, sub_zero, zero_sub, Matrix.mul_assoc] + abel + +noncomputable def gradedHomDifferential (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homSpace Q E F n v →ₗ[K] homSpace Q E F (n + 1) v := + (homDifferential Q E F n).restrict + (fun _ hf => homDifferential_mem Q E F n v hf) + +lemma homSpace_pure_total_degree_lower (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) + (hF : ∀ j, (F.placement j).level = k) + (h : n + v < k - l) : homSpace Q E F n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Matrix.ext + intro i j + by_contra he + have hh := mapDegree_level_bound Q hf.2 he + rw [hE i, hF j] at hh + omega + +lemma homSpace_pure_total_degree_upper (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) + (hF : ∀ j, (F.placement j).level = k) + (h : k - l + 2 < n + v) : homSpace Q E F n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Matrix.ext + intro i j + by_contra he + have hc : (F.placement j).cochain = (E.placement i).cochain + n := by + by_contra hc + exact he ((hf.2 i j).1 hc) + have ha := homogeneous_nonzero_degree Q (hf.2 i j).2 he + have he' := hE i + have hf' := hF j + dsimp only [GeneratorPlacement.level] at he' hf' + omega + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceDuality.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceDuality.lean index e3ea83a11426bef02d6d34d3aaed52c3590d0a19..d179266d8a3d2a41b7a0c7991aabc39c01361017 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceDuality.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceDuality.lean @@ -1,94 +1,94 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomSpacePairing - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -local instance zigzagFiniteDimensional : FiniteDimensional K (Q.Zigzag K) := - (pathBasis Q (K := K)).finiteDimensional_of_finite - -lemma homSpacePairing_separatingRight (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) - (g : homSpace Q F E (-n) (2-v)) - (h : ∀ f, homSpacePairing Q E F n v f g = 0) : g = 0 := by - apply homSpacePairing_separatingLeft Q F E (-n) (2-v) g - intro f - have hf : f.val ∈ homSpace Q E F n v := by - simpa only [neg_neg, sub_sub_cancel] using f.property - have hh := h ⟨f.val, hf⟩ - change supertrace Q E (f.val * g.val) = 0 at hh - change supertrace Q F (g.val * f.val) = 0 - rw [supertrace_mul Q E F hf.2 g.val, hh, MulZeroClass.mul_zero] - -instance homSpacePairing_perfect (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - (homSpacePairing Q E F n v).IsPerfPair := by - apply LinearMap.IsPerfPair.of_injective - · apply LinearMap.ker_eq_bot.mp - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply homSpacePairing_separatingLeft Q E F n v f - intro g - exact LinearMap.congr_fun hf g - · apply LinearMap.ker_eq_bot.mp - apply le_antisymm _ bot_le - intro g hg - change g = 0 - apply homSpacePairing_separatingRight Q E F n v g - intro f - exact LinearMap.congr_fun hg f - -noncomputable def homSpaceDuality (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homSpace Q F E (-n) (2-v) ≃ₗ[K] Module.Dual K (homSpace Q E F n v) := - (homSpacePairing Q E F n v).flip.toPerfPair - -lemma homSpaceDuality_apply (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) - (g : homSpace Q F E (-n) (2-v)) (f : homSpace Q E F n v) : - homSpaceDuality Q E F n v g f = supertrace Q E (f.val * g.val) := rfl - -lemma homSpace_finrank_dual (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - Module.finrank K (homSpace Q F E (-n) (2-v)) = Module.finrank K (homSpace Q E F n v) := - (homSpaceDuality Q E F n v).finrank_eq.trans Subspace.dual_finrank_eq - -omit [DecidableEq A] in - -lemma homDifferential_adjoint (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n : ℤ) - (f : Matrix I J (Q.Zigzag K)) (g : Matrix J I (Q.Zigzag K)) : - supertrace Q E (homDifferential Q E F (n-1) f * g) = - cochainSign (K := K) n * supertrace Q E (f * homDifferential Q F E (-n) g) := by - have hcyc := supertrace_mul Q E E E.degree (f*g) - have hs := cochainSign_mul_self (K := K) n - have hn : cochainSign (K := K) (n-1) = -cochainSign n := by - have hh := cochainSign_add_one (K := K) (n-1) - rw [sub_add_cancel] at hh - linear_combination hh - change supertrace Q E ((E.differential*f - cochainSign (K := K) (n-1) • (f*F.differential))*g) = - cochainSign (K := K) n * supertrace Q E (f*(F.differential*g - cochainSign (K := K) (-n) • (g*E.differential))) - rw [Matrix.sub_mul, Matrix.mul_sub, Matrix.smul_mul, Matrix.mul_smul, - map_sub, map_sub, map_smul, map_smul] - change supertrace Q E (E.differential*f*g) - cochainSign (K := K) (n-1) * - supertrace Q E (f*F.differential*g) = cochainSign (K := K) n * - (supertrace Q E (f*(F.differential*g)) - cochainSign (K := K) (-n) * - supertrace Q E (f*(g*E.differential))) - rw [cochainSign_neg, hn, Matrix.mul_assoc f F.differential g, - Matrix.mul_assoc E.differential f g] - have h1 : cochainSign (K := K) 1 = -1 := by - simpa only [zero_add, cochainSign_zero] using cochainSign_add_one (K := K) 0 - rw [h1, neg_one_mul, Matrix.mul_assoc] at hcyc - have hh : supertrace Q E (E.differential*(f*g)) = -supertrace Q E (f*(g*E.differential)) := by - linear_combination hcyc - rw [hh] - linear_combination (supertrace Q E (f*(g*E.differential))) * hs - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomSpacePairing + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +local instance zigzagFiniteDimensional : FiniteDimensional K (Q.Zigzag K) := + (pathBasis Q (K := K)).finiteDimensional_of_finite + +lemma homSpacePairing_separatingRight (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) + (g : homSpace Q F E (-n) (2-v)) + (h : ∀ f, homSpacePairing Q E F n v f g = 0) : g = 0 := by + apply homSpacePairing_separatingLeft Q F E (-n) (2-v) g + intro f + have hf : f.val ∈ homSpace Q E F n v := by + simpa only [neg_neg, sub_sub_cancel] using f.property + have hh := h ⟨f.val, hf⟩ + change supertrace Q E (f.val * g.val) = 0 at hh + change supertrace Q F (g.val * f.val) = 0 + rw [supertrace_mul Q E F hf.2 g.val, hh, MulZeroClass.mul_zero] + +instance homSpacePairing_perfect (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + (homSpacePairing Q E F n v).IsPerfPair := by + apply LinearMap.IsPerfPair.of_injective + · apply LinearMap.ker_eq_bot.mp + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply homSpacePairing_separatingLeft Q E F n v f + intro g + exact LinearMap.congr_fun hf g + · apply LinearMap.ker_eq_bot.mp + apply le_antisymm _ bot_le + intro g hg + change g = 0 + apply homSpacePairing_separatingRight Q E F n v g + intro f + exact LinearMap.congr_fun hg f + +noncomputable def homSpaceDuality (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homSpace Q F E (-n) (2-v) ≃ₗ[K] Module.Dual K (homSpace Q E F n v) := + (homSpacePairing Q E F n v).flip.toPerfPair + +lemma homSpaceDuality_apply (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) + (g : homSpace Q F E (-n) (2-v)) (f : homSpace Q E F n v) : + homSpaceDuality Q E F n v g f = supertrace Q E (f.val * g.val) := rfl + +lemma homSpace_finrank_dual (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + Module.finrank K (homSpace Q F E (-n) (2-v)) = Module.finrank K (homSpace Q E F n v) := + (homSpaceDuality Q E F n v).finrank_eq.trans Subspace.dual_finrank_eq + +omit [DecidableEq A] in + +lemma homDifferential_adjoint (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n : ℤ) + (f : Matrix I J (Q.Zigzag K)) (g : Matrix J I (Q.Zigzag K)) : + supertrace Q E (homDifferential Q E F (n-1) f * g) = + cochainSign (K := K) n * supertrace Q E (f * homDifferential Q F E (-n) g) := by + have hcyc := supertrace_mul Q E E E.degree (f*g) + have hs := cochainSign_mul_self (K := K) n + have hn : cochainSign (K := K) (n-1) = -cochainSign n := by + have hh := cochainSign_add_one (K := K) (n-1) + rw [sub_add_cancel] at hh + linear_combination hh + change supertrace Q E ((E.differential*f - cochainSign (K := K) (n-1) • (f*F.differential))*g) = + cochainSign (K := K) n * supertrace Q E (f*(F.differential*g - cochainSign (K := K) (-n) • (g*E.differential))) + rw [Matrix.sub_mul, Matrix.mul_sub, Matrix.smul_mul, Matrix.mul_smul, + map_sub, map_sub, map_smul, map_smul] + change supertrace Q E (E.differential*f*g) - cochainSign (K := K) (n-1) * + supertrace Q E (f*F.differential*g) = cochainSign (K := K) n * + (supertrace Q E (f*(F.differential*g)) - cochainSign (K := K) (-n) * + supertrace Q E (f*(g*E.differential))) + rw [cochainSign_neg, hn, Matrix.mul_assoc f F.differential g, + Matrix.mul_assoc E.differential f g] + have h1 : cochainSign (K := K) 1 = -1 := by + simpa only [zero_add, cochainSign_zero] using cochainSign_add_one (K := K) 0 + rw [h1, neg_one_mul, Matrix.mul_assoc] at hcyc + have hh : supertrace Q E (E.differential*(f*g)) = -supertrace Q E (f*(g*E.differential)) := by + linear_combination hcyc + rw [hh] + linear_combination (supertrace Q E (f*(g*E.differential))) * hs + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceMul.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceMul.lean index edfff76956a9210ad2b98e2792564e171cb748ea..a39edcd0874db13086f0639ba577ce5c66e4bf21 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceMul.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpaceMul.lean @@ -1,100 +1,100 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.TraceLinear - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J L : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype L] - -lemma homSpace_mul {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - {G : BasedComplex Q (K := K) L} {n m v w : ℤ} - {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} - (hf : f ∈ homSpace Q E F n v) (hg : g ∈ homSpace Q F G m w) : - f * g ∈ homSpace Q E G (n + m) (v + w) := - ⟨projectiveEntries_mul Q hf.1 hg.1, mapDegree_mul Q hf.2 hg.2⟩ - -lemma homDifferential_mul (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (G : BasedComplex Q (K := K) L) - (n m : ℤ) (f : Matrix I J (Q.Zigzag K)) (g : Matrix J L (Q.Zigzag K)) : - homDifferential Q E G (n + m) (f * g) = - homDifferential Q E F n f * g + - cochainSign (K := K) n • (f * homDifferential Q F G m g) := by - change E.differential * (f * g) - cochainSign (K := K) (n + m) • (f * g * G.differential) = - (E.differential * f - cochainSign (K := K) n • (f * F.differential)) * g + - cochainSign (K := K) n • (f * (F.differential * g - cochainSign (K := K) m • (g * G.differential))) - simp only [Matrix.sub_mul, Matrix.mul_sub, Matrix.smul_mul, Matrix.mul_smul, - smul_sub, smul_smul, cochainSign_add, Matrix.mul_assoc] - abel - -lemma homCycles_mul {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - {G : BasedComplex Q (K := K) L} {n m v w : ℤ} - {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} - (hf : f ∈ homCycles Q E F n v) (hg : g ∈ homCycles Q F G m w) : - f * g ∈ homCycles Q E G (n + m) (v + w) := by - refine ⟨homSpace_mul Q hf.1 hg.1, ?_⟩ - change homDifferential Q E G (n + m) (f * g) = 0 - rw [homDifferential_mul Q E F G n m, - show homDifferential Q E F n f = 0 from hf.2, - show homDifferential Q F G m g = 0 from hg.2, - Matrix.zero_mul, Matrix.mul_zero, smul_zero, add_zero] - -lemma homBoundary_mul_cycle {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {G : BasedComplex Q (K := K) L} - {n m v w : ℤ} {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} - (hf : f ∈ homBoundaries Q E F n v) (hg : g ∈ homCycles Q F G m w) : - f * g ∈ homBoundaries Q E G (n + m) (v + w) := by - obtain ⟨h, hh, rfl⟩ := hf - refine ⟨h * g, ?_, ?_⟩ - · have hm := homSpace_mul Q hh hg.1 - have he : n + m - 1 = n - 1 + m := by omega - change h * g ∈ homSpace Q E G (n + m - 1) (v + w) - rw [he] - exact hm - · convert homDifferential_mul Q E F G (n - 1) m h g using 1 - · congr 2; omega - · rw [show homDifferential Q F G m g = 0 from hg.2, - Matrix.mul_zero, smul_zero, add_zero] - -lemma homCycle_mul_boundary {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {G : BasedComplex Q (K := K) L} - {n m v w : ℤ} {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} - (hf : f ∈ homCycles Q E F n v) (hg : g ∈ homBoundaries Q F G m w) : - f * g ∈ homBoundaries Q E G (n + m) (v + w) := by - obtain ⟨h, hh, rfl⟩ := hg - refine ⟨cochainSign (K := K) n • (f * h), ?_, ?_⟩ - · have hm := (homSpace Q E G (n + (m - 1)) (v + w)).smul_mem - (cochainSign (K := K) n) (homSpace_mul Q hf.1 hh) - have he : n + m - 1 = n + (m - 1) := by omega - change cochainSign (K := K) n • (f * h) ∈ homSpace Q E G (n + m - 1) (v + w) - rw [he] - exact hm - · rw [map_smul] - have hm := homDifferential_mul Q E F G n (m - 1) f h - have he : n + m - 1 = n + (m - 1) := by omega - rw [he, hm, show homDifferential Q E F n f = 0 from hf.2, - Matrix.zero_mul, zero_add, smul_smul, cochainSign_mul_self, one_smul] - -lemma map_mem_homCycles {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) : - f.matrix ∈ homCycles Q E F 0 0 := by - refine ⟨⟨f.entries, f.degree⟩, ?_⟩ - change E.differential * f.matrix - cochainSign (K := K) 0 • - (f.matrix * F.differential) = 0 - rw [cochainSign_zero, one_smul, f.commute, sub_self] - -lemma homotopyEquation_boundary {E : BasedComplex Q (K := K) I} - {f : Matrix I I (Q.Zigzag K)} {h : Matrix I I (Q.Zigzag K)} - (hh : h ∈ homSpace Q E E (-1) 0) - (he : f = E.differential * h + h * E.differential) : - f ∈ homBoundaries Q E E 0 0 := by - refine ⟨h, hh, ?_⟩ - change E.differential * h - cochainSign (K := K) (-1) • (h * E.differential) = f - have hs : cochainSign (K := K) (-1) = -1 := by - rw [cochainSign_neg, show (1 : ℤ) = 0 + 1 by rfl, cochainSign_add_one, cochainSign_zero] - rw [hs, neg_one_smul, sub_neg_eq_add, he] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.TraceLinear + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J L : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype L] + +lemma homSpace_mul {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + {G : BasedComplex Q (K := K) L} {n m v w : ℤ} + {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} + (hf : f ∈ homSpace Q E F n v) (hg : g ∈ homSpace Q F G m w) : + f * g ∈ homSpace Q E G (n + m) (v + w) := + ⟨projectiveEntries_mul Q hf.1 hg.1, mapDegree_mul Q hf.2 hg.2⟩ + +lemma homDifferential_mul (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (G : BasedComplex Q (K := K) L) + (n m : ℤ) (f : Matrix I J (Q.Zigzag K)) (g : Matrix J L (Q.Zigzag K)) : + homDifferential Q E G (n + m) (f * g) = + homDifferential Q E F n f * g + + cochainSign (K := K) n • (f * homDifferential Q F G m g) := by + change E.differential * (f * g) - cochainSign (K := K) (n + m) • (f * g * G.differential) = + (E.differential * f - cochainSign (K := K) n • (f * F.differential)) * g + + cochainSign (K := K) n • (f * (F.differential * g - cochainSign (K := K) m • (g * G.differential))) + simp only [Matrix.sub_mul, Matrix.mul_sub, Matrix.smul_mul, Matrix.mul_smul, + smul_sub, smul_smul, cochainSign_add, Matrix.mul_assoc] + abel + +lemma homCycles_mul {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + {G : BasedComplex Q (K := K) L} {n m v w : ℤ} + {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} + (hf : f ∈ homCycles Q E F n v) (hg : g ∈ homCycles Q F G m w) : + f * g ∈ homCycles Q E G (n + m) (v + w) := by + refine ⟨homSpace_mul Q hf.1 hg.1, ?_⟩ + change homDifferential Q E G (n + m) (f * g) = 0 + rw [homDifferential_mul Q E F G n m, + show homDifferential Q E F n f = 0 from hf.2, + show homDifferential Q F G m g = 0 from hg.2, + Matrix.zero_mul, Matrix.mul_zero, smul_zero, add_zero] + +lemma homBoundary_mul_cycle {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {G : BasedComplex Q (K := K) L} + {n m v w : ℤ} {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} + (hf : f ∈ homBoundaries Q E F n v) (hg : g ∈ homCycles Q F G m w) : + f * g ∈ homBoundaries Q E G (n + m) (v + w) := by + obtain ⟨h, hh, rfl⟩ := hf + refine ⟨h * g, ?_, ?_⟩ + · have hm := homSpace_mul Q hh hg.1 + have he : n + m - 1 = n - 1 + m := by omega + change h * g ∈ homSpace Q E G (n + m - 1) (v + w) + rw [he] + exact hm + · convert homDifferential_mul Q E F G (n - 1) m h g using 1 + · congr 2; omega + · rw [show homDifferential Q F G m g = 0 from hg.2, + Matrix.mul_zero, smul_zero, add_zero] + +lemma homCycle_mul_boundary {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {G : BasedComplex Q (K := K) L} + {n m v w : ℤ} {f : Matrix I J (Q.Zigzag K)} {g : Matrix J L (Q.Zigzag K)} + (hf : f ∈ homCycles Q E F n v) (hg : g ∈ homBoundaries Q F G m w) : + f * g ∈ homBoundaries Q E G (n + m) (v + w) := by + obtain ⟨h, hh, rfl⟩ := hg + refine ⟨cochainSign (K := K) n • (f * h), ?_, ?_⟩ + · have hm := (homSpace Q E G (n + (m - 1)) (v + w)).smul_mem + (cochainSign (K := K) n) (homSpace_mul Q hf.1 hh) + have he : n + m - 1 = n + (m - 1) := by omega + change cochainSign (K := K) n • (f * h) ∈ homSpace Q E G (n + m - 1) (v + w) + rw [he] + exact hm + · rw [map_smul] + have hm := homDifferential_mul Q E F G n (m - 1) f h + have he : n + m - 1 = n + (m - 1) := by omega + rw [he, hm, show homDifferential Q E F n f = 0 from hf.2, + Matrix.zero_mul, zero_add, smul_smul, cochainSign_mul_self, one_smul] + +lemma map_mem_homCycles {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) : + f.matrix ∈ homCycles Q E F 0 0 := by + refine ⟨⟨f.entries, f.degree⟩, ?_⟩ + change E.differential * f.matrix - cochainSign (K := K) 0 • + (f.matrix * F.differential) = 0 + rw [cochainSign_zero, one_smul, f.commute, sub_self] + +lemma homotopyEquation_boundary {E : BasedComplex Q (K := K) I} + {f : Matrix I I (Q.Zigzag K)} {h : Matrix I I (Q.Zigzag K)} + (hh : h ∈ homSpace Q E E (-1) 0) + (he : f = E.differential * h + h * E.differential) : + f ∈ homBoundaries Q E E 0 0 := by + refine ⟨h, hh, ?_⟩ + change E.differential * h - cochainSign (K := K) (-1) • (h * E.differential) = f + have hs : cochainSign (K := K) (-1) = -1 := by + rw [cochainSign_neg, show (1 : ℤ) = 0 + 1 by rfl, cochainSign_add_one, cochainSign_zero] + rw [hs, neg_one_smul, sub_neg_eq_add, he] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpacePairing.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpacePairing.lean index 23ef9d369b6f2fab04d2fe5021dc62028645d9e2..7d37b6e730be66e3e51096d0a22775d1f912e669 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomSpacePairing.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomSpacePairing.lean @@ -1,94 +1,94 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Dual -import OAI.Topology.ArtinGroups.Quivers.TraceLinear - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -noncomputable def homSpacePairing (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homSpace Q E F n v →ₗ[K] homSpace Q F E (-n) (2-v) →ₗ[K] K where - toFun f := - { toFun := fun g => supertrace Q E (f.val * g.val) - map_add' g h := by - change supertrace Q E (f.val * (g.val+h.val)) = _ - rw [Matrix.mul_add, map_add] - map_smul' r g := by - change supertrace Q E (f.val * (r • g.val)) = _ - rw [Matrix.mul_smul, map_smul]; rfl } - map_add' f g := by - ext h - change supertrace Q E ((f.val+g.val)*h.val) = _ - rw [Matrix.add_mul, map_add] - rfl - map_smul' r f := by - ext g - change supertrace Q E ((r • f.val)*g.val) = _ - rw [Matrix.smul_mul, map_smul] - rfl - -omit [DecidableEq A] in -lemma supertrace_mul_single [DecidableEq I] [DecidableEq J] - (E : BasedComplex Q (K := K) I) (f : Matrix I J (Q.Zigzag K)) (i : I) (j : J) - (z : Q.Zigzag K) : - supertrace Q E (f * Matrix.single j i z) = - cochainSign (K := K) (E.placement i).cochain * trace Q (f i j * z) := by - unfold supertrace - change (∑ k, cochainSign (K := K) (E.placement k).cochain * - trace Q ((f * Matrix.single j i z) k k)) = _ - rw [Finset.sum_eq_single i] - · rw [Matrix.mul_single_apply_same] - · intro k _ hk - rw [Matrix.mul_single_apply_of_ne _ _ _ _ _ hk, trace_zero, MulZeroClass.mul_zero] - · intro h - exact (h (Finset.mem_univ i)).elim - -lemma homSpacePairing_separatingLeft (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) - (f : homSpace Q E F n v) (h : ∀ g, homSpacePairing Q E F n v f g = 0) : f = 0 := by - classical - apply Subtype.ext - apply Matrix.ext - intro i j - apply (pathCoordinates Q).injective - funext p - change pathCoordinates Q (f.val i j) p = pathCoordinates Q 0 p - rw [coordinates_zero] - by_contra hp - have hcorner := coordinates_corner Q (f.property.1.1 i j) (f.property.1.2 i j) hp - have hc : (F.placement j).cochain = (E.placement i).cochain + n := by - by_contra hh - exact hp (by rw [(f.property.2 i j).1 hh, coordinates_zero]) - have hl : Path.length p = v + (E.placement i).internal - (F.placement j).internal := by - by_contra hh - exact hp ((coordinates_homogeneous Q _ _).mp (f.property.2 i j).2 p hh) - let z := pathBasis Q (K := K) (Path.dual Q p) - have hz : Matrix.single j i z ∈ homSpace Q F E (-n) (2-v) := by - constructor - · apply projectiveEntries_single Q - · simpa only [z, ← hcorner.2, ← Path.source_dual Q p] using - pathBasis_left Q (K := K) (Path.dual Q p) - · simpa only [z, ← hcorner.1, ← Path.target_dual Q p] using - pathBasis_right Q (K := K) (Path.dual Q p) - · apply mapDegree_single Q - · omega - · have hh := pathBasis_homogeneous Q (K := K) (Path.dual Q p) - rw [Path.length_dual Q, hl] at hh - convert hh using 1; omega - have hh := h ⟨_, hz⟩ - change supertrace Q E (f.val * Matrix.single j i z) = 0 at hh - rw [supertrace_mul_single Q, ← coordinates_trace Q (f.val i j) p] at hh - have hs : cochainSign (K := K) (E.placement i).cochain ≠ 0 := by - intro he - have := cochainSign_mul_self (K := K) (E.placement i).cochain - rw [he, MulZeroClass.zero_mul] at this - exact zero_ne_one this - exact hp ((mul_eq_zero.mp hh).resolve_left hs) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Dual +import OAI.Topology.ArtinGroups.Quivers.TraceLinear + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +noncomputable def homSpacePairing (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homSpace Q E F n v →ₗ[K] homSpace Q F E (-n) (2-v) →ₗ[K] K where + toFun f := + { toFun := fun g => supertrace Q E (f.val * g.val) + map_add' g h := by + change supertrace Q E (f.val * (g.val+h.val)) = _ + rw [Matrix.mul_add, map_add] + map_smul' r g := by + change supertrace Q E (f.val * (r • g.val)) = _ + rw [Matrix.mul_smul, map_smul]; rfl } + map_add' f g := by + ext h + change supertrace Q E ((f.val+g.val)*h.val) = _ + rw [Matrix.add_mul, map_add] + rfl + map_smul' r f := by + ext g + change supertrace Q E ((r • f.val)*g.val) = _ + rw [Matrix.smul_mul, map_smul] + rfl + +omit [DecidableEq A] in +lemma supertrace_mul_single [DecidableEq I] [DecidableEq J] + (E : BasedComplex Q (K := K) I) (f : Matrix I J (Q.Zigzag K)) (i : I) (j : J) + (z : Q.Zigzag K) : + supertrace Q E (f * Matrix.single j i z) = + cochainSign (K := K) (E.placement i).cochain * trace Q (f i j * z) := by + unfold supertrace + change (∑ k, cochainSign (K := K) (E.placement k).cochain * + trace Q ((f * Matrix.single j i z) k k)) = _ + rw [Finset.sum_eq_single i] + · rw [Matrix.mul_single_apply_same] + · intro k _ hk + rw [Matrix.mul_single_apply_of_ne _ _ _ _ _ hk, trace_zero, MulZeroClass.mul_zero] + · intro h + exact (h (Finset.mem_univ i)).elim + +lemma homSpacePairing_separatingLeft (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) + (f : homSpace Q E F n v) (h : ∀ g, homSpacePairing Q E F n v f g = 0) : f = 0 := by + classical + apply Subtype.ext + apply Matrix.ext + intro i j + apply (pathCoordinates Q).injective + funext p + change pathCoordinates Q (f.val i j) p = pathCoordinates Q 0 p + rw [coordinates_zero] + by_contra hp + have hcorner := coordinates_corner Q (f.property.1.1 i j) (f.property.1.2 i j) hp + have hc : (F.placement j).cochain = (E.placement i).cochain + n := by + by_contra hh + exact hp (by rw [(f.property.2 i j).1 hh, coordinates_zero]) + have hl : Path.length p = v + (E.placement i).internal - (F.placement j).internal := by + by_contra hh + exact hp ((coordinates_homogeneous Q _ _).mp (f.property.2 i j).2 p hh) + let z := pathBasis Q (K := K) (Path.dual Q p) + have hz : Matrix.single j i z ∈ homSpace Q F E (-n) (2-v) := by + constructor + · apply projectiveEntries_single Q + · simpa only [z, ← hcorner.2, ← Path.source_dual Q p] using + pathBasis_left Q (K := K) (Path.dual Q p) + · simpa only [z, ← hcorner.1, ← Path.target_dual Q p] using + pathBasis_right Q (K := K) (Path.dual Q p) + · apply mapDegree_single Q + · omega + · have hh := pathBasis_homogeneous Q (K := K) (Path.dual Q p) + rw [Path.length_dual Q, hl] at hh + convert hh using 1; omega + have hh := h ⟨_, hz⟩ + change supertrace Q E (f.val * Matrix.single j i z) = 0 at hh + rw [supertrace_mul_single Q, ← coordinates_trace Q (f.val i j) p] at hh + have hs : cochainSign (K := K) (E.placement i).cochain ≠ 0 := by + intro he + have := cochainSign_mul_self (K := K) (E.placement i).cochain + rw [he, MulZeroClass.zero_mul] at this + exact zero_ne_one this + exact hp ((mul_eq_zero.mp hh).resolve_left hs) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomStep.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomStep.lean index d19b634ad8a75a0d53e9da078bee3626bc44342d..2993a9613da72461fc6445045d2fe286897dcee2 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomStep.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomStep.lean @@ -1,116 +1,116 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.LinearMatrix -import OAI.Topology.ArtinGroups.Complexes.HomSpaceDuality - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -noncomputable def homStep (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : - homSpace Q E F n v →ₗ[K] homSpace Q E F m v := - (homDifferential Q E F n).restrict fun _ hf => - hm ▸ homDifferential_mem Q E F n v hf - -omit [Fintype V] [DecidableEq A] in -lemma homStep_range (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : - (LinearMap.range (homStep Q E F n m v hm)).map (homSpace Q E F m v).subtype = - homBoundaries Q E F m v := by - subst m - ext f - change (∃ g, (∃ h, homStep Q E F n (n+1) v rfl h = g) ∧ g.val = f) ↔ _ - constructor - · rintro ⟨_, ⟨h, rfl⟩, rfl⟩ - change ∃ g, g ∈ homSpace Q E F (n+1-1) v ∧ - homDifferential Q E F (n+1-1) g = homDifferential Q E F n h.val - simpa only [add_sub_cancel_right] using - (show ∃ g, g ∈ homSpace Q E F n v ∧ homDifferential Q E F n g = - homDifferential Q E F n h.val from ⟨h.val, h.property, rfl⟩) - · rintro ⟨g, hg, rfl⟩ - have hg' : g ∈ homSpace Q E F n v := by - change g ∈ homSpace Q E F (n+1-1) v at hg - rwa [add_sub_cancel_right] at hg - refine ⟨homStep Q E F n (n+1) v rfl ⟨g, hg'⟩, ⟨⟨g, hg'⟩, rfl⟩, ?_⟩ - dsimp only [homStep, LinearMap.restrict_apply] - simp only [add_sub_cancel_right] - -omit [Fintype V] [DecidableEq A] in -lemma homStep_range_finrank (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : - Module.finrank K (LinearMap.range (homStep Q E F n m v hm)) = - Module.finrank K (homBoundaries Q E F m v) := by - rw [← homStep_range Q E F n m v hm, Submodule.finrank_map_subtype_eq] - -noncomputable def homCycleKernelEquiv (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : - homCycles Q E F n v ≃ₗ[K] LinearMap.ker (homStep Q E F n m v hm) where - toFun f := ⟨⟨f.val, f.property.1⟩, Subtype.ext f.property.2⟩ - invFun f := ⟨f.val.val, f.val.property, congrArg Subtype.val f.property⟩ - left_inv _ := rfl - right_inv _ := rfl - map_add' _ _ := rfl - map_smul' _ _ := rfl - -omit [DecidableEq A] in - -lemma hom_exact_dimension (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homDimension Q E F n v + Module.finrank K (homBoundaries Q E F n v) + - Module.finrank K (homBoundaries Q E F (n+1) v) = - Module.finrank K (homSpace Q E F n v) := by - have hq := ((homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype).finrank_quotient_add_finrank - have hc := (Submodule.comapSubtypeEquivOfLe (homBoundaries_le_homCycles Q E F n v)).finrank_eq - have hk := (homCycleKernelEquiv Q E F n (n+1) v rfl).finrank_eq - have hr := homStep_range_finrank Q E F n (n+1) v rfl - have he := (homStep Q E F n (n+1) v rfl).finrank_range_add_finrank_ker - change homDimension Q E F n v + _ = _ at hq - omega - -lemma homStep_rank_dual (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : - Module.finrank K (homBoundaries Q E F m v) = - Module.finrank K (homBoundaries Q F E (-n) (2-v)) := by - have hneg : -n = -m+1 := by omega - let d := homStep Q E F n m v hm - let d' := homStep Q F E (-m) (-n) (2-v) hneg - let e₀ := homSpaceDuality Q E F m v - let e₁ := (homSpaceDuality Q E F n v).trans - (LinearEquiv.smulOfNeZero K (Module.Dual K (homSpace Q E F n v)) - (cochainSign (K := K) m) (cochainSign_ne_zero m)) - have ha : e₁.toLinearMap.comp d' = d.dualMap.comp e₀.toLinearMap := by - ext g f - change cochainSign (K := K) m * - supertrace Q E (f.val * homDifferential Q F E (-m) g.val) = - supertrace Q E (homDifferential Q E F n f.val * g.val) - have hh := homDifferential_adjoint Q E F m f.val g.val - have he : m-1=n := by omega - rw [he] at hh - exact hh.symm - have hr := congrArg (fun l : homSpace Q F E (-m) (2-v) →ₗ[K] Module.Dual K (homSpace Q E F n v) => - Module.finrank K (LinearMap.range l)) ha - rw [LinearMap.range_comp, LinearMap.range_comp, - LinearEquiv.range, Submodule.map_top] at hr - rw [e₁.finrank_map_eq, LinearMap.finrank_range_dualMap_eq_finrank_range] at hr - rw [homStep_range_finrank Q F E (-m) (-n) (2-v) hneg, - homStep_range_finrank Q E F n m v hm] at hr - exact hr.symm - -lemma homDimension_dual (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homDimension Q E F n v = homDimension Q F E (-n) (2-v) := by - have he := hom_exact_dimension Q E F n v - have hf := hom_exact_dimension Q F E (-n) (2-v) - have hs := homSpace_finrank_dual Q E F n v - have h₁ := homStep_rank_dual Q E F (n-1) n v (by omega) - have h₂ := homStep_rank_dual Q E F n (n+1) v rfl - have hh : -(n-1) = -n+1 := by omega - rw [hh] at h₁ - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.LinearMatrix +import OAI.Topology.ArtinGroups.Complexes.HomSpaceDuality + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +noncomputable def homStep (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : + homSpace Q E F n v →ₗ[K] homSpace Q E F m v := + (homDifferential Q E F n).restrict fun _ hf => + hm ▸ homDifferential_mem Q E F n v hf + +omit [Fintype V] [DecidableEq A] in +lemma homStep_range (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : + (LinearMap.range (homStep Q E F n m v hm)).map (homSpace Q E F m v).subtype = + homBoundaries Q E F m v := by + subst m + ext f + change (∃ g, (∃ h, homStep Q E F n (n+1) v rfl h = g) ∧ g.val = f) ↔ _ + constructor + · rintro ⟨_, ⟨h, rfl⟩, rfl⟩ + change ∃ g, g ∈ homSpace Q E F (n+1-1) v ∧ + homDifferential Q E F (n+1-1) g = homDifferential Q E F n h.val + simpa only [add_sub_cancel_right] using + (show ∃ g, g ∈ homSpace Q E F n v ∧ homDifferential Q E F n g = + homDifferential Q E F n h.val from ⟨h.val, h.property, rfl⟩) + · rintro ⟨g, hg, rfl⟩ + have hg' : g ∈ homSpace Q E F n v := by + change g ∈ homSpace Q E F (n+1-1) v at hg + rwa [add_sub_cancel_right] at hg + refine ⟨homStep Q E F n (n+1) v rfl ⟨g, hg'⟩, ⟨⟨g, hg'⟩, rfl⟩, ?_⟩ + dsimp only [homStep, LinearMap.restrict_apply] + simp only [add_sub_cancel_right] + +omit [Fintype V] [DecidableEq A] in +lemma homStep_range_finrank (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : + Module.finrank K (LinearMap.range (homStep Q E F n m v hm)) = + Module.finrank K (homBoundaries Q E F m v) := by + rw [← homStep_range Q E F n m v hm, Submodule.finrank_map_subtype_eq] + +noncomputable def homCycleKernelEquiv (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : + homCycles Q E F n v ≃ₗ[K] LinearMap.ker (homStep Q E F n m v hm) where + toFun f := ⟨⟨f.val, f.property.1⟩, Subtype.ext f.property.2⟩ + invFun f := ⟨f.val.val, f.val.property, congrArg Subtype.val f.property⟩ + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +omit [DecidableEq A] in + +lemma hom_exact_dimension (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homDimension Q E F n v + Module.finrank K (homBoundaries Q E F n v) + + Module.finrank K (homBoundaries Q E F (n+1) v) = + Module.finrank K (homSpace Q E F n v) := by + have hq := ((homBoundaries Q E F n v).comap (homCycles Q E F n v).subtype).finrank_quotient_add_finrank + have hc := (Submodule.comapSubtypeEquivOfLe (homBoundaries_le_homCycles Q E F n v)).finrank_eq + have hk := (homCycleKernelEquiv Q E F n (n+1) v rfl).finrank_eq + have hr := homStep_range_finrank Q E F n (n+1) v rfl + have he := (homStep Q E F n (n+1) v rfl).finrank_range_add_finrank_ker + change homDimension Q E F n v + _ = _ at hq + omega + +lemma homStep_rank_dual (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n m v : ℤ) (hm : m = n+1) : + Module.finrank K (homBoundaries Q E F m v) = + Module.finrank K (homBoundaries Q F E (-n) (2-v)) := by + have hneg : -n = -m+1 := by omega + let d := homStep Q E F n m v hm + let d' := homStep Q F E (-m) (-n) (2-v) hneg + let e₀ := homSpaceDuality Q E F m v + let e₁ := (homSpaceDuality Q E F n v).trans + (LinearEquiv.smulOfNeZero K (Module.Dual K (homSpace Q E F n v)) + (cochainSign (K := K) m) (cochainSign_ne_zero m)) + have ha : e₁.toLinearMap.comp d' = d.dualMap.comp e₀.toLinearMap := by + ext g f + change cochainSign (K := K) m * + supertrace Q E (f.val * homDifferential Q F E (-m) g.val) = + supertrace Q E (homDifferential Q E F n f.val * g.val) + have hh := homDifferential_adjoint Q E F m f.val g.val + have he : m-1=n := by omega + rw [he] at hh + exact hh.symm + have hr := congrArg (fun l : homSpace Q F E (-m) (2-v) →ₗ[K] Module.Dual K (homSpace Q E F n v) => + Module.finrank K (LinearMap.range l)) ha + rw [LinearMap.range_comp, LinearMap.range_comp, + LinearEquiv.range, Submodule.map_top] at hr + rw [e₁.finrank_map_eq, LinearMap.finrank_range_dualMap_eq_finrank_range] at hr + rw [homStep_range_finrank Q F E (-m) (-n) (2-v) hneg, + homStep_range_finrank Q E F n m v hm] at hr + exact hr.symm + +lemma homDimension_dual (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homDimension Q E F n v = homDimension Q F E (-n) (2-v) := by + have he := hom_exact_dimension Q E F n v + have hf := hom_exact_dimension Q F E (-n) (2-v) + have hs := homSpace_finrank_dual Q E F n v + have h₁ := homStep_rank_dual Q E F (n-1) n v (by omega) + have h₂ := homStep_rank_dual Q E F n (n+1) v rfl + have hh : -(n-1) = -n+1 := by omega + rw [hh] at h₁ + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/HomotopyConeMap.lean b/lean/OAI/Topology/ArtinGroups/Complexes/HomotopyConeMap.lean index 307c1ab3461bfdabf6dcd2d81d7d8bd3763b98be..d0887abd6763e3e76beca37715f4fd60da22e82d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/HomotopyConeMap.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/HomotopyConeMap.lean @@ -1,270 +1,270 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -open Matrix - -attribute [local instance] Classical.propDecidable -attribute [local instance 2000] Matrix.instHMulOfFintypeOfMulOfAddCommMonoid -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J L N:Type u} [Fintype I] [Fintype J] [Fintype L] [Fintype N] - [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - {G:BasedComplex Q (K:=K) L} {D:BasedComplex Q (K:=K) N} - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] - [DecidableEq L] [DecidableEq N] in -lemma cone_block_entries (f:Map Q E F) (g:Map Q G D) - (a:Matrix I L (Q.Zigzag K)) (b:Matrix I N (Q.Zigzag K)) - (c:Matrix J L (Q.Zigzag K)) (d:Matrix J N (Q.Zigzag K)) - (ha:ProjectiveEntries Q E.placement G.placement a) - (hb:ProjectiveEntries Q E.placement D.placement b) - (hc:ProjectiveEntries Q F.placement G.placement c) - (hd:ProjectiveEntries Q F.placement D.placement d) : - ProjectiveEntries Q (f.cone Q).placement (g.cone Q).placement - (Matrix.fromBlocks a b c d) := by - constructor <;> intro i j <;> rcases i with i|i <;> rcases j with j|j - · exact ha.1 i j - · exact hb.1 i j - · exact hc.1 i j - · exact hd.1 i j - · exact ha.2 i j - · exact hb.2 i j - · exact hc.2 i j - · exact hd.2 i j - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] - [DecidableEq L] [DecidableEq N] in -lemma cone_block_degree (f:Map Q E F) (g:Map Q G D) - (a:Matrix I L (Q.Zigzag K)) (b:Matrix I N (Q.Zigzag K)) - (c:Matrix J L (Q.Zigzag K)) (d:Matrix J N (Q.Zigzag K)) (n v:ℤ) - (ha:MapDegree Q E.placement G.placement n v a) - (hb:MapDegree Q E.placement D.placement (n-1) v b) - (hc:MapDegree Q F.placement G.placement (n+1) v c) - (hd:MapDegree Q F.placement D.placement n v d) : - MapDegree Q (f.cone Q).placement (g.cone Q).placement n v - (Matrix.fromBlocks a b c d) := by - intro i j - rcases i with i|i <;> rcases j with j|j - · refine ⟨?_,(ha i j).2⟩ - intro h - apply (ha i j).1 - change (G.placement j).cochain-1≠(E.placement i).cochain-1+n at h - omega - · refine ⟨?_,(hb i j).2⟩ - intro h - apply (hb i j).1 - change (D.placement j).cochain≠(E.placement i).cochain-1+n at h - omega - · refine ⟨?_,(hc i j).2⟩ - intro h - apply (hc i j).1 - change (G.placement j).cochain-1≠(F.placement i).cochain+n at h - omega - · exact hd i j - -noncomputable def Map.homotopyConeMap (f:Map Q E F) (g:Map Q G D) - (a:Map Q E G) (b:Map Q F D) (h:Matrix I N (Q.Zigzag K)) - (he:ProjectiveEntries Q E.placement D.placement h) - (hd:MapDegree Q E.placement D.placement (-1) 0 h) - (hc:f.matrix*b.matrix=a.matrix*g.matrix+(E.differential*h+h*D.differential)) : - Map Q (f.cone Q) (g.cone Q) where - matrix:=Matrix.fromBlocks a.matrix h 0 b.matrix - entries:=cone_block_entries Q f g _ _ _ _ a.entries he (projectiveEntries_zero Q) b.entries - degree:=cone_block_degree Q f g _ _ _ _ 0 0 a.degree hd (mapDegree_zero Q _ _) b.degree - commute:=by - change Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential * - Matrix.fromBlocks a.matrix h 0 b.matrix = - Matrix.fromBlocks a.matrix h 0 b.matrix * - Matrix.fromBlocks (-G.differential) g.matrix 0 D.differential - rw [Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply] - simp only [Matrix.neg_mul,Matrix.mul_neg,Matrix.mul_zero,Matrix.zero_mul, - add_zero,zero_add,neg_zero,a.commute,b.commute] - congr 1 - rw [hc] - abel - -omit [Fintype V] [DecidableEq A] in -lemma homotopy_coherence_closed (e:HomotopyEquivalence Q F G) : - F.differential*(e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)+ - (e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)*G.differential=0 := by - have hs:=congrArg (fun m=>m*e.forward.matrix) e.sourceEquation - have ht:=congrArg (fun m=>e.forward.matrix*m) e.targetEquation - have hid₁ : projectiveIdentity Q F.placement*e.forward.matrix=e.forward.matrix := - projectiveIdentity_mul Q e.forward.entries - have hid₂ : e.forward.matrix*projectiveIdentity Q G.placement=e.forward.matrix := - mul_projectiveIdentity Q e.forward.entries - erw [Matrix.add_mul,hid₁] at hs - erw [Matrix.mul_add,hid₂] at ht - have hh:(F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential)*e.forward.matrix= - e.forward.matrix*(G.differential*e.targetHomotopy+e.targetHomotopy*G.differential) := by - apply add_left_cancel (a:=e.forward.matrix) - rw [← hs,← ht,Matrix.mul_assoc] - have hc₁ : (e.sourceHomotopy*e.forward.matrix)*G.differential= - (e.sourceHomotopy*F.differential)*e.forward.matrix := by - rw [Matrix.mul_assoc,← e.forward.commute,← Matrix.mul_assoc] - have hc₂ : F.differential*(e.forward.matrix*e.targetHomotopy)= - (e.forward.matrix*G.differential)*e.targetHomotopy := by - rw [← Matrix.mul_assoc,e.forward.commute] - have hr : F.differential*(e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)+ - (e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)*G.differential = - (F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential)*e.forward.matrix- - e.forward.matrix*(G.differential*e.targetHomotopy+e.targetHomotopy*G.differential) := by - simp only [Matrix.mul_sub,Matrix.sub_mul,Matrix.add_mul,Matrix.mul_add] - rw [hc₁,hc₂] - simp only [← Matrix.mul_assoc] - abel - rw [hr,hh,sub_self] - -omit [Fintype V] [DecidableEq A] in -lemma cone_target_replace_backward_square (f:Map Q E F) (e:HomotopyEquivalence Q F G) : - (f.matrix*e.forward.matrix)*e.backward.matrix = - projectiveIdentity Q E.placement*f.matrix+ - (E.differential*(f.matrix*e.sourceHomotopy)+(f.matrix*e.sourceHomotopy)*F.differential) := by - have hid : projectiveIdentity Q E.placement*f.matrix=f.matrix := - projectiveIdentity_mul Q f.entries - have hid' : f.matrix*projectiveIdentity Q F.placement=f.matrix := - mul_projectiveIdentity Q f.entries - erw [hid,Matrix.mul_assoc,e.sourceEquation,Matrix.mul_add,hid',Matrix.mul_add] - simp only [← Matrix.mul_assoc] - rw [f.commute] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma cone_target_replace_correction (f:Map Q E F) (e:HomotopyEquivalence Q F G) - (k:Matrix J L (Q.Zigzag K)) - (hk:k=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy) - (hkc:F.differential*k+k*G.differential=0) : - -(E.differential*(f.matrix*e.sourceHomotopy*k))+ - (f.matrix*e.forward.matrix)*(e.targetHomotopy+e.backward.matrix*k)+ - (f.matrix*e.sourceHomotopy*k)*G.differential = - (f.matrix*e.sourceHomotopy)*e.forward.matrix := by - have hb : -(E.differential*(f.matrix*e.sourceHomotopy*k))+ - (f.matrix*e.sourceHomotopy*k)*G.differential = - f.matrix*k-(f.matrix*e.forward.matrix)*(e.backward.matrix*k) := by - have hkc' : k*G.differential=-(F.differential*k) := - eq_neg_of_add_eq_zero_right hkc - have hs : F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential = - e.forward.matrix*e.backward.matrix-projectiveIdentity Q F.placement := by - rw [e.sourceEquation] - abel - calc - _ = -(f.matrix*((F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential)*k)) := by - simp only [Matrix.mul_add,Matrix.add_mul,Matrix.mul_assoc] - rw [hkc'] - simp only [Matrix.mul_neg,← Matrix.mul_assoc,neg_add_rev] - rw [f.commute] - abel - _ = f.matrix*k-(f.matrix*e.forward.matrix)*(e.backward.matrix*k) := by - rw [hs,Matrix.sub_mul,Matrix.mul_sub] - have hid : projectiveIdentity Q F.placement*k=k := by - rw [hk] - apply projectiveIdentity_mul Q - simpa only [sub_eq_add_neg] using projectiveEntries_add Q - (projectiveEntries_mul Q e.sourceEntries e.forward.entries) - (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) - erw [hid] - simp only [Matrix.mul_assoc] - abel - have hsum : (f.matrix*e.forward.matrix)*(e.targetHomotopy+e.backward.matrix*k) = - (f.matrix*e.forward.matrix)*e.targetHomotopy+ - (f.matrix*e.forward.matrix)*(e.backward.matrix*k) := Matrix.mul_add _ _ _ - rw [hsum] - calc - _ = (-(E.differential*(f.matrix*e.sourceHomotopy*k))+ - (f.matrix*e.sourceHomotopy*k)*G.differential)+ - ((f.matrix*e.forward.matrix)*e.targetHomotopy+ - (f.matrix*e.forward.matrix)*(e.backward.matrix*k)) := by abel - _ = (f.matrix*e.sourceHomotopy)*e.forward.matrix := by - rw [hb,hk,Matrix.mul_sub] - simp only [Matrix.mul_assoc] - abel - -noncomputable def HomotopyEquivalence.coneTarget (e:HomotopyEquivalence Q F G) (f:Map Q E F) : - HomotopyEquivalence Q (f.cone Q) ((f.comp Q e.forward).cone Q) := by - let g:=f.comp Q e.forward - let k:=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy - have ke:ProjectiveEntries Q F.placement G.placement k := by - simpa only [k,sub_eq_add_neg] using projectiveEntries_add Q - (projectiveEntries_mul Q e.sourceEntries e.forward.entries) - (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) - have kd:MapDegree Q F.placement G.placement (-1) 0 k := by - have h₁:=mapDegree_mul Q e.sourceDegree e.forward.degree - have h₂:=mapDegree_mul Q e.forward.degree e.targetDegree - simp only [add_zero,zero_add] at h₁ h₂ - simpa only [k,sub_eq_add_neg] using mapDegree_add Q h₁ (mapDegree_neg Q h₂) - have kc:F.differential*k+k*G.differential=0 := homotopy_coherence_closed Q e - let j:=e.targetHomotopy+e.backward.matrix*k - have je:ProjectiveEntries Q G.placement G.placement j := - projectiveEntries_add Q e.targetEntries (projectiveEntries_mul Q e.backward.entries ke) - have jd:MapDegree Q G.placement G.placement (-1) 0 j := - mapDegree_add Q e.targetDegree (mapDegree_mul Q e.backward.degree kd) - have jc:G.differential*j+j*G.differential= - G.differential*e.targetHomotopy+e.targetHomotopy*G.differential := by - have hz:G.differential*(e.backward.matrix*k)+(e.backward.matrix*k)*G.differential=0 := by - rw [← Matrix.mul_assoc,e.backward.commute] - simpa only [Matrix.mul_add,Matrix.mul_assoc,Matrix.mul_zero] using - congrArg (fun m=>e.backward.matrix*m) kc - dsimp only [j] - simp only [Matrix.mul_add,Matrix.add_mul] - calc - _ = (G.differential*e.targetHomotopy+e.targetHomotopy*G.differential)+ - (G.differential*(e.backward.matrix*k)+(e.backward.matrix*k)*G.differential) := by abel - _ = _ := by rw [hz,add_zero] - have pe:ProjectiveEntries Q E.placement F.placement (f.matrix*e.sourceHomotopy) := - projectiveEntries_mul Q f.entries e.sourceEntries - have pd:MapDegree Q E.placement F.placement (-1) 0 (f.matrix*e.sourceHomotopy) := - mapDegree_mul Q f.degree e.sourceDegree - let a:Map Q (f.cone Q) (g.cone Q):=f.coneMap Q g (Map.identity Q E) e.forward (by - change projectiveIdentity Q E.placement*(f.matrix*e.forward.matrix)=_ - exact projectiveIdentity_mul Q (projectiveEntries_mul Q f.entries e.forward.entries)) - let b:Map Q (g.cone Q) (f.cone Q):=g.homotopyConeMap Q f (Map.identity Q E) e.backward - (f.matrix*e.sourceHomotopy) pe pd (cone_target_replace_backward_square Q f e) - let h:=Matrix.fromBlocks (0:Matrix I I (Q.Zigzag K)) (0:Matrix I J (Q.Zigzag K)) - (0:Matrix J I (Q.Zigzag K)) e.sourceHomotopy - let t:=Matrix.fromBlocks (0:Matrix I I (Q.Zigzag K)) (f.matrix*e.sourceHomotopy*k) - (0:Matrix L I (Q.Zigzag K)) j - refine ⟨a,b,h,t,?_,?_,?_,?_,?_,?_⟩ - · exact cone_block_entries Q f f _ _ _ _ (projectiveEntries_zero Q) - (projectiveEntries_zero Q) (projectiveEntries_zero Q) e.sourceEntries - · exact cone_block_entries Q g g _ _ _ _ (projectiveEntries_zero Q) - (projectiveEntries_mul Q pe ke) (projectiveEntries_zero Q) je - · exact cone_block_degree Q f f _ _ _ _ (-1) 0 (mapDegree_zero Q _ _) - (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) e.sourceDegree - · exact cone_block_degree Q g g _ _ _ _ (-1) 0 (mapDegree_zero Q _ _) - (mapDegree_mul Q pd kd) (mapDegree_zero Q _ _) jd - · change Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 e.forward.matrix * - Matrix.fromBlocks (projectiveIdentity Q E.placement) (f.matrix*e.sourceHomotopy) 0 e.backward.matrix = - projectiveIdentity Q (f.cone Q).placement+ - (Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential*h+ - h*Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential) - dsimp only [h] - rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, - Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] - simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add] - have hi:projectiveIdentity Q E.placement*projectiveIdentity Q E.placement= - projectiveIdentity Q E.placement :=projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=E.placement)) - have hp:projectiveIdentity Q E.placement*(f.matrix*e.sourceHomotopy)= - f.matrix*e.sourceHomotopy := projectiveIdentity_mul Q pe - erw [hi,hp,e.sourceEquation] - · change Matrix.fromBlocks (projectiveIdentity Q E.placement) (f.matrix*e.sourceHomotopy) 0 e.backward.matrix * - Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 e.forward.matrix = - projectiveIdentity Q (g.cone Q).placement+ - (Matrix.fromBlocks (-E.differential) g.matrix 0 G.differential*t+ - t*Matrix.fromBlocks (-E.differential) g.matrix 0 G.differential) - dsimp only [t] - rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, - Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] - simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add,Matrix.neg_mul] - have hi:projectiveIdentity Q E.placement*projectiveIdentity Q E.placement= - projectiveIdentity Q E.placement :=projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=E.placement)) - erw [hi,jc,← e.targetEquation] - congr 1 - exact (cone_target_replace_correction Q f e k rfl kc).symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +open Matrix + +attribute [local instance] Classical.propDecidable +attribute [local instance 2000] Matrix.instHMulOfFintypeOfMulOfAddCommMonoid +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J L N:Type u} [Fintype I] [Fintype J] [Fintype L] [Fintype N] + [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + {G:BasedComplex Q (K:=K) L} {D:BasedComplex Q (K:=K) N} + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] + [DecidableEq L] [DecidableEq N] in +lemma cone_block_entries (f:Map Q E F) (g:Map Q G D) + (a:Matrix I L (Q.Zigzag K)) (b:Matrix I N (Q.Zigzag K)) + (c:Matrix J L (Q.Zigzag K)) (d:Matrix J N (Q.Zigzag K)) + (ha:ProjectiveEntries Q E.placement G.placement a) + (hb:ProjectiveEntries Q E.placement D.placement b) + (hc:ProjectiveEntries Q F.placement G.placement c) + (hd:ProjectiveEntries Q F.placement D.placement d) : + ProjectiveEntries Q (f.cone Q).placement (g.cone Q).placement + (Matrix.fromBlocks a b c d) := by + constructor <;> intro i j <;> rcases i with i|i <;> rcases j with j|j + · exact ha.1 i j + · exact hb.1 i j + · exact hc.1 i j + · exact hd.1 i j + · exact ha.2 i j + · exact hb.2 i j + · exact hc.2 i j + · exact hd.2 i j + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] + [DecidableEq L] [DecidableEq N] in +lemma cone_block_degree (f:Map Q E F) (g:Map Q G D) + (a:Matrix I L (Q.Zigzag K)) (b:Matrix I N (Q.Zigzag K)) + (c:Matrix J L (Q.Zigzag K)) (d:Matrix J N (Q.Zigzag K)) (n v:ℤ) + (ha:MapDegree Q E.placement G.placement n v a) + (hb:MapDegree Q E.placement D.placement (n-1) v b) + (hc:MapDegree Q F.placement G.placement (n+1) v c) + (hd:MapDegree Q F.placement D.placement n v d) : + MapDegree Q (f.cone Q).placement (g.cone Q).placement n v + (Matrix.fromBlocks a b c d) := by + intro i j + rcases i with i|i <;> rcases j with j|j + · refine ⟨?_,(ha i j).2⟩ + intro h + apply (ha i j).1 + change (G.placement j).cochain-1≠(E.placement i).cochain-1+n at h + omega + · refine ⟨?_,(hb i j).2⟩ + intro h + apply (hb i j).1 + change (D.placement j).cochain≠(E.placement i).cochain-1+n at h + omega + · refine ⟨?_,(hc i j).2⟩ + intro h + apply (hc i j).1 + change (G.placement j).cochain-1≠(F.placement i).cochain+n at h + omega + · exact hd i j + +noncomputable def Map.homotopyConeMap (f:Map Q E F) (g:Map Q G D) + (a:Map Q E G) (b:Map Q F D) (h:Matrix I N (Q.Zigzag K)) + (he:ProjectiveEntries Q E.placement D.placement h) + (hd:MapDegree Q E.placement D.placement (-1) 0 h) + (hc:f.matrix*b.matrix=a.matrix*g.matrix+(E.differential*h+h*D.differential)) : + Map Q (f.cone Q) (g.cone Q) where + matrix:=Matrix.fromBlocks a.matrix h 0 b.matrix + entries:=cone_block_entries Q f g _ _ _ _ a.entries he (projectiveEntries_zero Q) b.entries + degree:=cone_block_degree Q f g _ _ _ _ 0 0 a.degree hd (mapDegree_zero Q _ _) b.degree + commute:=by + change Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential * + Matrix.fromBlocks a.matrix h 0 b.matrix = + Matrix.fromBlocks a.matrix h 0 b.matrix * + Matrix.fromBlocks (-G.differential) g.matrix 0 D.differential + rw [Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply] + simp only [Matrix.neg_mul,Matrix.mul_neg,Matrix.mul_zero,Matrix.zero_mul, + add_zero,zero_add,neg_zero,a.commute,b.commute] + congr 1 + rw [hc] + abel + +omit [Fintype V] [DecidableEq A] in +lemma homotopy_coherence_closed (e:HomotopyEquivalence Q F G) : + F.differential*(e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)+ + (e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)*G.differential=0 := by + have hs:=congrArg (fun m=>m*e.forward.matrix) e.sourceEquation + have ht:=congrArg (fun m=>e.forward.matrix*m) e.targetEquation + have hid₁ : projectiveIdentity Q F.placement*e.forward.matrix=e.forward.matrix := + projectiveIdentity_mul Q e.forward.entries + have hid₂ : e.forward.matrix*projectiveIdentity Q G.placement=e.forward.matrix := + mul_projectiveIdentity Q e.forward.entries + erw [Matrix.add_mul,hid₁] at hs + erw [Matrix.mul_add,hid₂] at ht + have hh:(F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential)*e.forward.matrix= + e.forward.matrix*(G.differential*e.targetHomotopy+e.targetHomotopy*G.differential) := by + apply add_left_cancel (a:=e.forward.matrix) + rw [← hs,← ht,Matrix.mul_assoc] + have hc₁ : (e.sourceHomotopy*e.forward.matrix)*G.differential= + (e.sourceHomotopy*F.differential)*e.forward.matrix := by + rw [Matrix.mul_assoc,← e.forward.commute,← Matrix.mul_assoc] + have hc₂ : F.differential*(e.forward.matrix*e.targetHomotopy)= + (e.forward.matrix*G.differential)*e.targetHomotopy := by + rw [← Matrix.mul_assoc,e.forward.commute] + have hr : F.differential*(e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)+ + (e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy)*G.differential = + (F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential)*e.forward.matrix- + e.forward.matrix*(G.differential*e.targetHomotopy+e.targetHomotopy*G.differential) := by + simp only [Matrix.mul_sub,Matrix.sub_mul,Matrix.add_mul,Matrix.mul_add] + rw [hc₁,hc₂] + simp only [← Matrix.mul_assoc] + abel + rw [hr,hh,sub_self] + +omit [Fintype V] [DecidableEq A] in +lemma cone_target_replace_backward_square (f:Map Q E F) (e:HomotopyEquivalence Q F G) : + (f.matrix*e.forward.matrix)*e.backward.matrix = + projectiveIdentity Q E.placement*f.matrix+ + (E.differential*(f.matrix*e.sourceHomotopy)+(f.matrix*e.sourceHomotopy)*F.differential) := by + have hid : projectiveIdentity Q E.placement*f.matrix=f.matrix := + projectiveIdentity_mul Q f.entries + have hid' : f.matrix*projectiveIdentity Q F.placement=f.matrix := + mul_projectiveIdentity Q f.entries + erw [hid,Matrix.mul_assoc,e.sourceEquation,Matrix.mul_add,hid',Matrix.mul_add] + simp only [← Matrix.mul_assoc] + rw [f.commute] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma cone_target_replace_correction (f:Map Q E F) (e:HomotopyEquivalence Q F G) + (k:Matrix J L (Q.Zigzag K)) + (hk:k=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy) + (hkc:F.differential*k+k*G.differential=0) : + -(E.differential*(f.matrix*e.sourceHomotopy*k))+ + (f.matrix*e.forward.matrix)*(e.targetHomotopy+e.backward.matrix*k)+ + (f.matrix*e.sourceHomotopy*k)*G.differential = + (f.matrix*e.sourceHomotopy)*e.forward.matrix := by + have hb : -(E.differential*(f.matrix*e.sourceHomotopy*k))+ + (f.matrix*e.sourceHomotopy*k)*G.differential = + f.matrix*k-(f.matrix*e.forward.matrix)*(e.backward.matrix*k) := by + have hkc' : k*G.differential=-(F.differential*k) := + eq_neg_of_add_eq_zero_right hkc + have hs : F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential = + e.forward.matrix*e.backward.matrix-projectiveIdentity Q F.placement := by + rw [e.sourceEquation] + abel + calc + _ = -(f.matrix*((F.differential*e.sourceHomotopy+e.sourceHomotopy*F.differential)*k)) := by + simp only [Matrix.mul_add,Matrix.add_mul,Matrix.mul_assoc] + rw [hkc'] + simp only [Matrix.mul_neg,← Matrix.mul_assoc,neg_add_rev] + rw [f.commute] + abel + _ = f.matrix*k-(f.matrix*e.forward.matrix)*(e.backward.matrix*k) := by + rw [hs,Matrix.sub_mul,Matrix.mul_sub] + have hid : projectiveIdentity Q F.placement*k=k := by + rw [hk] + apply projectiveIdentity_mul Q + simpa only [sub_eq_add_neg] using projectiveEntries_add Q + (projectiveEntries_mul Q e.sourceEntries e.forward.entries) + (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) + erw [hid] + simp only [Matrix.mul_assoc] + abel + have hsum : (f.matrix*e.forward.matrix)*(e.targetHomotopy+e.backward.matrix*k) = + (f.matrix*e.forward.matrix)*e.targetHomotopy+ + (f.matrix*e.forward.matrix)*(e.backward.matrix*k) := Matrix.mul_add _ _ _ + rw [hsum] + calc + _ = (-(E.differential*(f.matrix*e.sourceHomotopy*k))+ + (f.matrix*e.sourceHomotopy*k)*G.differential)+ + ((f.matrix*e.forward.matrix)*e.targetHomotopy+ + (f.matrix*e.forward.matrix)*(e.backward.matrix*k)) := by abel + _ = (f.matrix*e.sourceHomotopy)*e.forward.matrix := by + rw [hb,hk,Matrix.mul_sub] + simp only [Matrix.mul_assoc] + abel + +noncomputable def HomotopyEquivalence.coneTarget (e:HomotopyEquivalence Q F G) (f:Map Q E F) : + HomotopyEquivalence Q (f.cone Q) ((f.comp Q e.forward).cone Q) := by + let g:=f.comp Q e.forward + let k:=e.sourceHomotopy*e.forward.matrix-e.forward.matrix*e.targetHomotopy + have ke:ProjectiveEntries Q F.placement G.placement k := by + simpa only [k,sub_eq_add_neg] using projectiveEntries_add Q + (projectiveEntries_mul Q e.sourceEntries e.forward.entries) + (projectiveEntries_neg Q (projectiveEntries_mul Q e.forward.entries e.targetEntries)) + have kd:MapDegree Q F.placement G.placement (-1) 0 k := by + have h₁:=mapDegree_mul Q e.sourceDegree e.forward.degree + have h₂:=mapDegree_mul Q e.forward.degree e.targetDegree + simp only [add_zero,zero_add] at h₁ h₂ + simpa only [k,sub_eq_add_neg] using mapDegree_add Q h₁ (mapDegree_neg Q h₂) + have kc:F.differential*k+k*G.differential=0 := homotopy_coherence_closed Q e + let j:=e.targetHomotopy+e.backward.matrix*k + have je:ProjectiveEntries Q G.placement G.placement j := + projectiveEntries_add Q e.targetEntries (projectiveEntries_mul Q e.backward.entries ke) + have jd:MapDegree Q G.placement G.placement (-1) 0 j := + mapDegree_add Q e.targetDegree (mapDegree_mul Q e.backward.degree kd) + have jc:G.differential*j+j*G.differential= + G.differential*e.targetHomotopy+e.targetHomotopy*G.differential := by + have hz:G.differential*(e.backward.matrix*k)+(e.backward.matrix*k)*G.differential=0 := by + rw [← Matrix.mul_assoc,e.backward.commute] + simpa only [Matrix.mul_add,Matrix.mul_assoc,Matrix.mul_zero] using + congrArg (fun m=>e.backward.matrix*m) kc + dsimp only [j] + simp only [Matrix.mul_add,Matrix.add_mul] + calc + _ = (G.differential*e.targetHomotopy+e.targetHomotopy*G.differential)+ + (G.differential*(e.backward.matrix*k)+(e.backward.matrix*k)*G.differential) := by abel + _ = _ := by rw [hz,add_zero] + have pe:ProjectiveEntries Q E.placement F.placement (f.matrix*e.sourceHomotopy) := + projectiveEntries_mul Q f.entries e.sourceEntries + have pd:MapDegree Q E.placement F.placement (-1) 0 (f.matrix*e.sourceHomotopy) := + mapDegree_mul Q f.degree e.sourceDegree + let a:Map Q (f.cone Q) (g.cone Q):=f.coneMap Q g (Map.identity Q E) e.forward (by + change projectiveIdentity Q E.placement*(f.matrix*e.forward.matrix)=_ + exact projectiveIdentity_mul Q (projectiveEntries_mul Q f.entries e.forward.entries)) + let b:Map Q (g.cone Q) (f.cone Q):=g.homotopyConeMap Q f (Map.identity Q E) e.backward + (f.matrix*e.sourceHomotopy) pe pd (cone_target_replace_backward_square Q f e) + let h:=Matrix.fromBlocks (0:Matrix I I (Q.Zigzag K)) (0:Matrix I J (Q.Zigzag K)) + (0:Matrix J I (Q.Zigzag K)) e.sourceHomotopy + let t:=Matrix.fromBlocks (0:Matrix I I (Q.Zigzag K)) (f.matrix*e.sourceHomotopy*k) + (0:Matrix L I (Q.Zigzag K)) j + refine ⟨a,b,h,t,?_,?_,?_,?_,?_,?_⟩ + · exact cone_block_entries Q f f _ _ _ _ (projectiveEntries_zero Q) + (projectiveEntries_zero Q) (projectiveEntries_zero Q) e.sourceEntries + · exact cone_block_entries Q g g _ _ _ _ (projectiveEntries_zero Q) + (projectiveEntries_mul Q pe ke) (projectiveEntries_zero Q) je + · exact cone_block_degree Q f f _ _ _ _ (-1) 0 (mapDegree_zero Q _ _) + (mapDegree_zero Q _ _) (mapDegree_zero Q _ _) e.sourceDegree + · exact cone_block_degree Q g g _ _ _ _ (-1) 0 (mapDegree_zero Q _ _) + (mapDegree_mul Q pd kd) (mapDegree_zero Q _ _) jd + · change Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 e.forward.matrix * + Matrix.fromBlocks (projectiveIdentity Q E.placement) (f.matrix*e.sourceHomotopy) 0 e.backward.matrix = + projectiveIdentity Q (f.cone Q).placement+ + (Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential*h+ + h*Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential) + dsimp only [h] + rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, + Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] + simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add] + have hi:projectiveIdentity Q E.placement*projectiveIdentity Q E.placement= + projectiveIdentity Q E.placement :=projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=E.placement)) + have hp:projectiveIdentity Q E.placement*(f.matrix*e.sourceHomotopy)= + f.matrix*e.sourceHomotopy := projectiveIdentity_mul Q pe + erw [hi,hp,e.sourceEquation] + · change Matrix.fromBlocks (projectiveIdentity Q E.placement) (f.matrix*e.sourceHomotopy) 0 e.backward.matrix * + Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 e.forward.matrix = + projectiveIdentity Q (g.cone Q).placement+ + (Matrix.fromBlocks (-E.differential) g.matrix 0 G.differential*t+ + t*Matrix.fromBlocks (-E.differential) g.matrix 0 G.differential) + dsimp only [t] + rw [cone_identity_blocks,Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply, + Matrix.fromBlocks_multiply,Matrix.fromBlocks_add,Matrix.fromBlocks_add] + simp only [Matrix.zero_mul,Matrix.mul_zero,add_zero,zero_add,Matrix.neg_mul] + have hi:projectiveIdentity Q E.placement*projectiveIdentity Q E.placement= + projectiveIdentity Q E.placement :=projectiveIdentity_mul Q (projectiveEntries_identity Q (K:=K) (p:=E.placement)) + erw [hi,jc,← e.targetEquation] + congr 1 + exact (cone_target_replace_correction Q f e k rfl kc).symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Identity.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Identity.lean index a4f058153814905c0e2efe54a446ab1c9309a7f3..065645e13951af56b11ed8c4fc71af0f9f8e9bd3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Identity.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Identity.lean @@ -1,174 +1,174 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot -import OAI.Topology.ArtinGroups.Cancellation.Retained - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -universe u -variable {V A K I J L : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [Fintype L] - [DecidableEq I] [DecidableEq J] [DecidableEq L] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - {G : BasedComplex Q (K := K) L} - -namespace Map - -noncomputable def identity (E : BasedComplex Q (K := K) I) : Map Q E E where - matrix := projectiveIdentity Q E.placement - entries := projectiveEntries_identity Q - degree := mapDegree_identity Q - commute := (mul_projectiveIdentity Q E.entries).trans (projectiveIdentity_mul Q E.entries).symm - -omit [DecidableEq I] [DecidableEq J] [DecidableEq L] in -noncomputable def comp (f : Map Q E F) (g : Map Q F G) : Map Q E G where - matrix := f.matrix * g.matrix - entries := projectiveEntries_mul Q f.entries g.entries - degree := mapDegree_mul Q f.degree g.degree - commute := by - rw [← Matrix.mul_assoc, f.commute, Matrix.mul_assoc, g.commute, Matrix.mul_assoc] - -omit [DecidableEq I] [DecidableEq J] in -lemma conjugateBoundary (f : Map Q E F) (g : Map Q F E) - (h : Matrix J J (Q.Zigzag K)) : - f.matrix * (F.differential * h + h * F.differential) * g.matrix = - E.differential * (f.matrix * h * g.matrix) + - (f.matrix * h * g.matrix) * E.differential := by - rw [Matrix.mul_add, Matrix.add_mul] - congr 1 - · rw [← Matrix.mul_assoc f.matrix F.differential, ← f.commute] - simp only [Matrix.mul_assoc] - · simp only [Matrix.mul_assoc] - rw [g.commute] - -end Map - -namespace HomotopyEquivalence - -noncomputable def refl (E : BasedComplex Q (K := K) I) : HomotopyEquivalence Q E E where - forward := Map.identity Q E - backward := Map.identity Q E - sourceHomotopy := 0 - targetHomotopy := 0 - sourceEntries := projectiveEntries_zero Q - targetEntries := projectiveEntries_zero Q - sourceDegree := mapDegree_zero Q (-1) 0 - targetDegree := mapDegree_zero Q (-1) 0 - sourceEquation := by - change projectiveIdentity Q E.placement * projectiveIdentity Q E.placement = _ - simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] - exact projectiveIdentity_mul Q (projectiveEntries_identity Q) - targetEquation := by - change projectiveIdentity Q E.placement * projectiveIdentity Q E.placement = _ - simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] - exact projectiveIdentity_mul Q (projectiveEntries_identity Q) - -noncomputable def trans (f : HomotopyEquivalence Q E F) (g : HomotopyEquivalence Q F G) : - HomotopyEquivalence Q E G where - forward := f.forward.comp Q g.forward - backward := g.backward.comp Q f.backward - sourceHomotopy := f.sourceHomotopy + f.forward.matrix * g.sourceHomotopy * f.backward.matrix - targetHomotopy := g.targetHomotopy + g.backward.matrix * f.targetHomotopy * g.forward.matrix - sourceEntries := projectiveEntries_add Q f.sourceEntries - (projectiveEntries_mul Q (projectiveEntries_mul Q f.forward.entries g.sourceEntries) - f.backward.entries) - targetEntries := projectiveEntries_add Q g.targetEntries - (projectiveEntries_mul Q (projectiveEntries_mul Q g.backward.entries f.targetEntries) - g.forward.entries) - sourceDegree := by - have h := mapDegree_mul Q (mapDegree_mul Q f.forward.degree g.sourceDegree) f.backward.degree - norm_num at h - exact mapDegree_add Q f.sourceDegree h - targetDegree := by - have h := mapDegree_mul Q (mapDegree_mul Q g.backward.degree f.targetDegree) g.forward.degree - norm_num at h - exact mapDegree_add Q g.targetDegree h - sourceEquation := by - change (f.forward.matrix * g.forward.matrix) * (g.backward.matrix * f.backward.matrix) = _ - calc - _ = f.forward.matrix * (g.forward.matrix * g.backward.matrix) * f.backward.matrix := by - simp only [Matrix.mul_assoc] - _ = f.forward.matrix * (projectiveIdentity Q F.placement + - (F.differential * g.sourceHomotopy + g.sourceHomotopy * F.differential)) * - f.backward.matrix := by rw [g.sourceEquation] - _ = f.forward.matrix * f.backward.matrix + f.forward.matrix * - (F.differential * g.sourceHomotopy + g.sourceHomotopy * F.differential) * - f.backward.matrix := by - rw [Matrix.mul_add, Matrix.add_mul] - exact congrArg (fun M => M * f.backward.matrix + - f.forward.matrix * (F.differential * g.sourceHomotopy + - g.sourceHomotopy * F.differential) * f.backward.matrix) - (mul_projectiveIdentity Q f.forward.entries) - _ = _ := by - rw [f.sourceEquation, Map.conjugateBoundary Q f.forward f.backward] - simp only [Matrix.mul_add, Matrix.add_mul] - abel - targetEquation := by - change (g.backward.matrix * f.backward.matrix) * (f.forward.matrix * g.forward.matrix) = _ - calc - _ = g.backward.matrix * (f.backward.matrix * f.forward.matrix) * g.forward.matrix := by - simp only [Matrix.mul_assoc] - _ = g.backward.matrix * (projectiveIdentity Q F.placement + - (F.differential * f.targetHomotopy + f.targetHomotopy * F.differential)) * - g.forward.matrix := by rw [f.targetEquation] - _ = g.backward.matrix * g.forward.matrix + g.backward.matrix * - (F.differential * f.targetHomotopy + f.targetHomotopy * F.differential) * - g.forward.matrix := by - rw [Matrix.mul_add, Matrix.add_mul] - exact congrArg (fun M => M * g.forward.matrix + - g.backward.matrix * (F.differential * f.targetHomotopy + - f.targetHomotopy * F.differential) * g.forward.matrix) - (mul_projectiveIdentity Q g.backward.entries) - _ = _ := by - rw [g.targetEquation, Map.conjugateBoundary Q g.backward g.forward] - simp only [Matrix.mul_add, Matrix.add_mul] - abel - -end HomotopyEquivalence - -structure FiniteModel where - Index : Type u - fintype : Fintype Index - decidableEq : DecidableEq Index - complex : @BasedComplex V A K Q _ _ _ Index fintype - -attribute [instance] FiniteModel.fintype FiniteModel.decidableEq - -namespace FiniteModel - -noncomputable def ofComplex {I : Type u} [Fintype I] [DecidableEq I] - (E : BasedComplex Q (K := K) I) : FiniteModel.{u} Q (K := K) where - Index := I - fintype := inferInstance - decidableEq := inferInstance - complex := E - -theorem exists_minimal (E : FiniteModel.{u} Q (K := K)) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q E.complex F.complex) := by - have h : ∀ n (B : FiniteModel.{u} Q (K := K)), Fintype.card B.Index = n → - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q B.complex F.complex) := by - intro n - induction n using Nat.strong_induction_on with - | h n ih => - intro B hn - by_cases hm : B.complex.IsMinimal Q - · exact ⟨B, hm, ⟨HomotopyEquivalence.refl Q B.complex⟩⟩ - · obtain ⟨p⟩ := scalarPivot_of_not_minimal Q B.complex hm - let C := ofComplex Q (p.reduced Q) - have hc : Fintype.card C.Index < n := by - dsimp only [C, ofComplex] - rw [← hn] - exact p.retained_card_lt Q - obtain ⟨F, hF, ⟨e⟩⟩ := ih (Fintype.card C.Index) hc C rfl - exact ⟨F, hF, ⟨(p.reductionEquivalence Q).trans Q e⟩⟩ - exact h (Fintype.card E.Index) E rfl - -end FiniteModel -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Cancellation.ScalarPivot +import OAI.Topology.ArtinGroups.Cancellation.Retained + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +universe u +variable {V A K I J L : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [Fintype L] + [DecidableEq I] [DecidableEq J] [DecidableEq L] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + {G : BasedComplex Q (K := K) L} + +namespace Map + +noncomputable def identity (E : BasedComplex Q (K := K) I) : Map Q E E where + matrix := projectiveIdentity Q E.placement + entries := projectiveEntries_identity Q + degree := mapDegree_identity Q + commute := (mul_projectiveIdentity Q E.entries).trans (projectiveIdentity_mul Q E.entries).symm + +omit [DecidableEq I] [DecidableEq J] [DecidableEq L] in +noncomputable def comp (f : Map Q E F) (g : Map Q F G) : Map Q E G where + matrix := f.matrix * g.matrix + entries := projectiveEntries_mul Q f.entries g.entries + degree := mapDegree_mul Q f.degree g.degree + commute := by + rw [← Matrix.mul_assoc, f.commute, Matrix.mul_assoc, g.commute, Matrix.mul_assoc] + +omit [DecidableEq I] [DecidableEq J] in +lemma conjugateBoundary (f : Map Q E F) (g : Map Q F E) + (h : Matrix J J (Q.Zigzag K)) : + f.matrix * (F.differential * h + h * F.differential) * g.matrix = + E.differential * (f.matrix * h * g.matrix) + + (f.matrix * h * g.matrix) * E.differential := by + rw [Matrix.mul_add, Matrix.add_mul] + congr 1 + · rw [← Matrix.mul_assoc f.matrix F.differential, ← f.commute] + simp only [Matrix.mul_assoc] + · simp only [Matrix.mul_assoc] + rw [g.commute] + +end Map + +namespace HomotopyEquivalence + +noncomputable def refl (E : BasedComplex Q (K := K) I) : HomotopyEquivalence Q E E where + forward := Map.identity Q E + backward := Map.identity Q E + sourceHomotopy := 0 + targetHomotopy := 0 + sourceEntries := projectiveEntries_zero Q + targetEntries := projectiveEntries_zero Q + sourceDegree := mapDegree_zero Q (-1) 0 + targetDegree := mapDegree_zero Q (-1) 0 + sourceEquation := by + change projectiveIdentity Q E.placement * projectiveIdentity Q E.placement = _ + simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] + exact projectiveIdentity_mul Q (projectiveEntries_identity Q) + targetEquation := by + change projectiveIdentity Q E.placement * projectiveIdentity Q E.placement = _ + simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] + exact projectiveIdentity_mul Q (projectiveEntries_identity Q) + +noncomputable def trans (f : HomotopyEquivalence Q E F) (g : HomotopyEquivalence Q F G) : + HomotopyEquivalence Q E G where + forward := f.forward.comp Q g.forward + backward := g.backward.comp Q f.backward + sourceHomotopy := f.sourceHomotopy + f.forward.matrix * g.sourceHomotopy * f.backward.matrix + targetHomotopy := g.targetHomotopy + g.backward.matrix * f.targetHomotopy * g.forward.matrix + sourceEntries := projectiveEntries_add Q f.sourceEntries + (projectiveEntries_mul Q (projectiveEntries_mul Q f.forward.entries g.sourceEntries) + f.backward.entries) + targetEntries := projectiveEntries_add Q g.targetEntries + (projectiveEntries_mul Q (projectiveEntries_mul Q g.backward.entries f.targetEntries) + g.forward.entries) + sourceDegree := by + have h := mapDegree_mul Q (mapDegree_mul Q f.forward.degree g.sourceDegree) f.backward.degree + norm_num at h + exact mapDegree_add Q f.sourceDegree h + targetDegree := by + have h := mapDegree_mul Q (mapDegree_mul Q g.backward.degree f.targetDegree) g.forward.degree + norm_num at h + exact mapDegree_add Q g.targetDegree h + sourceEquation := by + change (f.forward.matrix * g.forward.matrix) * (g.backward.matrix * f.backward.matrix) = _ + calc + _ = f.forward.matrix * (g.forward.matrix * g.backward.matrix) * f.backward.matrix := by + simp only [Matrix.mul_assoc] + _ = f.forward.matrix * (projectiveIdentity Q F.placement + + (F.differential * g.sourceHomotopy + g.sourceHomotopy * F.differential)) * + f.backward.matrix := by rw [g.sourceEquation] + _ = f.forward.matrix * f.backward.matrix + f.forward.matrix * + (F.differential * g.sourceHomotopy + g.sourceHomotopy * F.differential) * + f.backward.matrix := by + rw [Matrix.mul_add, Matrix.add_mul] + exact congrArg (fun M => M * f.backward.matrix + + f.forward.matrix * (F.differential * g.sourceHomotopy + + g.sourceHomotopy * F.differential) * f.backward.matrix) + (mul_projectiveIdentity Q f.forward.entries) + _ = _ := by + rw [f.sourceEquation, Map.conjugateBoundary Q f.forward f.backward] + simp only [Matrix.mul_add, Matrix.add_mul] + abel + targetEquation := by + change (g.backward.matrix * f.backward.matrix) * (f.forward.matrix * g.forward.matrix) = _ + calc + _ = g.backward.matrix * (f.backward.matrix * f.forward.matrix) * g.forward.matrix := by + simp only [Matrix.mul_assoc] + _ = g.backward.matrix * (projectiveIdentity Q F.placement + + (F.differential * f.targetHomotopy + f.targetHomotopy * F.differential)) * + g.forward.matrix := by rw [f.targetEquation] + _ = g.backward.matrix * g.forward.matrix + g.backward.matrix * + (F.differential * f.targetHomotopy + f.targetHomotopy * F.differential) * + g.forward.matrix := by + rw [Matrix.mul_add, Matrix.add_mul] + exact congrArg (fun M => M * g.forward.matrix + + g.backward.matrix * (F.differential * f.targetHomotopy + + f.targetHomotopy * F.differential) * g.forward.matrix) + (mul_projectiveIdentity Q g.backward.entries) + _ = _ := by + rw [g.targetEquation, Map.conjugateBoundary Q g.backward g.forward] + simp only [Matrix.mul_add, Matrix.add_mul] + abel + +end HomotopyEquivalence + +structure FiniteModel where + Index : Type u + fintype : Fintype Index + decidableEq : DecidableEq Index + complex : @BasedComplex V A K Q _ _ _ Index fintype + +attribute [instance] FiniteModel.fintype FiniteModel.decidableEq + +namespace FiniteModel + +noncomputable def ofComplex {I : Type u} [Fintype I] [DecidableEq I] + (E : BasedComplex Q (K := K) I) : FiniteModel.{u} Q (K := K) where + Index := I + fintype := inferInstance + decidableEq := inferInstance + complex := E + +theorem exists_minimal (E : FiniteModel.{u} Q (K := K)) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q E.complex F.complex) := by + have h : ∀ n (B : FiniteModel.{u} Q (K := K)), Fintype.card B.Index = n → + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q B.complex F.complex) := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro B hn + by_cases hm : B.complex.IsMinimal Q + · exact ⟨B, hm, ⟨HomotopyEquivalence.refl Q B.complex⟩⟩ + · obtain ⟨p⟩ := scalarPivot_of_not_minimal Q B.complex hm + let C := ofComplex Q (p.reduced Q) + have hc : Fintype.card C.Index < n := by + dsimp only [C, ofComplex] + rw [← hn] + exact p.retained_card_lt Q + obtain ⟨F, hF, ⟨e⟩⟩ := ih (Fintype.card C.Index) hc C rfl + exact ⟨F, hF, ⟨(p.reductionEquivalence Q).trans Q e⟩⟩ + exact h (Fintype.card E.Index) E rfl + +end FiniteModel +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Initial.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Initial.lean index f7ac758c2da7ce62a8bde45ba7d0416d27e61eaf..1cbad044e953837dc6ace0ca4007f3702869b65e 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Initial.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Initial.lean @@ -1,57 +1,57 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomDimension2 -import OAI.Topology.ArtinGroups.Complexes.HomDimensionZeroHom - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def initialClass (α : V) : FiniteHomotopyClass Q (K := K) := - Quotient.mk (finiteHomotopySetoid Q) (FiniteModel.ofComplex Q (initialProjective Q α)) - -noncomputable def unfoldedFrame (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) : - FiniteHomotopyClass Q (K := K) := - unfoldedArtinAction Q hn M hM x (initialClass Q α) - -lemma unfoldedFrame_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) - (α β : V) (n v : ℤ) : - classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) - (unfoldedFrame Q hn M hM x β) = - homDimension Q (initialProjective Q α : BasedComplex Q (K := K) PUnit.{u+1}) - (initialProjective Q β : BasedComplex Q (K := K) PUnit.{u+1}) n v := - unfoldedArtinAction_homDimension Q hn M hM x n v (initialClass Q α) (initialClass Q β) - -lemma unfoldedFrame_self_bound (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) - (α : V) (n v : ℤ) : - classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) - (unfoldedFrame Q hn M hM x α) ≤ 1 := by - rw [unfoldedFrame_homDimension] - exact initial_homDimension_le_one Q hn α n v - -lemma unfoldedFrame_self_support (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) - (α : V) (n v : ℤ) (h : n ≠ 0 ∨ (v ≠ 0 ∧ v ≠ 2)) : - classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) - (unfoldedFrame Q hn M hM x α) = 0 := by - rw [unfoldedFrame_homDimension] - rcases h with hn' | ⟨h₀, h₂⟩ - · exact initial_homDimension_nonzero_cochain Q α α n v hn' - · exact initial_homDimension_other_internal Q hn α n v h₀ h₂ - -lemma unfoldedFrame_orthogonal (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) - {α β : V} (h : OrthogonalVertices Q α β) (n v : ℤ) : - classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) - (unfoldedFrame Q hn M hM x β) = 0 := by - rw [unfoldedFrame_homDimension] - exact initial_homDimension_orthogonal Q h n v - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomDimension2 +import OAI.Topology.ArtinGroups.Complexes.HomDimensionZeroHom + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def initialClass (α : V) : FiniteHomotopyClass Q (K := K) := + Quotient.mk (finiteHomotopySetoid Q) (FiniteModel.ofComplex Q (initialProjective Q α)) + +noncomputable def unfoldedFrame (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) : + FiniteHomotopyClass Q (K := K) := + unfoldedArtinAction Q hn M hM x (initialClass Q α) + +lemma unfoldedFrame_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) + (α β : V) (n v : ℤ) : + classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) + (unfoldedFrame Q hn M hM x β) = + homDimension Q (initialProjective Q α : BasedComplex Q (K := K) PUnit.{u+1}) + (initialProjective Q β : BasedComplex Q (K := K) PUnit.{u+1}) n v := + unfoldedArtinAction_homDimension Q hn M hM x n v (initialClass Q α) (initialClass Q β) + +lemma unfoldedFrame_self_bound (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) + (α : V) (n v : ℤ) : + classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) + (unfoldedFrame Q hn M hM x α) ≤ 1 := by + rw [unfoldedFrame_homDimension] + exact initial_homDimension_le_one Q hn α n v + +lemma unfoldedFrame_self_support (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) + (α : V) (n v : ℤ) (h : n ≠ 0 ∨ (v ≠ 0 ∧ v ≠ 2)) : + classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) + (unfoldedFrame Q hn M hM x α) = 0 := by + rw [unfoldedFrame_homDimension] + rcases h with hn' | ⟨h₀, h₂⟩ + · exact initial_homDimension_nonzero_cochain Q α α n v hn' + · exact initial_homDimension_other_internal Q hn α n v h₀ h₂ + +lemma unfoldedFrame_orthogonal (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) + {α β : V} (h : OrthogonalVertices Q α β) (n v : ℤ) : + classHomDimension Q n v (unfoldedFrame Q (K := K) hn M hM x α) + (unfoldedFrame Q hn M hM x β) = 0 := by + rw [unfoldedFrame_homDimension] + exact initial_homDimension_orthogonal Q h n v + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InitialHomSpaceNegative.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InitialHomSpaceNegative.lean index 975556e4193144274cab9fbd1980442b0a0d8cb7..49a1ba1ae8d3378d55ebaee6fb46ff7d3668a0b6 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InitialHomSpaceNegative.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InitialHomSpaceNegative.lean @@ -1,39 +1,39 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModel - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in -lemma initial_homSpace_negative (α β : V) (n v : ℤ) (h : n + v < 0) : - homSpace Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = ⊥ := by - by_cases hn : n = 0 - · apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Matrix.ext - intro i j - have hh : Homogeneous Q v (f i j) := by - simpa only [initialProjective, add_zero, sub_zero] using (hf.2 i j).2 - have hv : v < 0 := by omega - apply Zigzag.ext - · exact hh.1 (by omega) - · exact hh.2.1 (by omega) - · exact hh.2.2 (by omega) - · exact initial_homSpace_nonzero_cochain Q α β n v hn - -lemma frameModel_negative_pair_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α β : V) - (n v : ℤ) (h : n + v < 0) : - homDimension Q (frameModel Q (K := K) hn M hM x α).complex - (frameModel Q hn M hM x β).complex n v = 0 := by - rw [frameModel, frameModel, minimalClassModel_homDimension, unfoldedFrame_homDimension] - exact homDimension_zero_of_homSpace_zero Q _ _ n v (initial_homSpace_negative Q α β n v h) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModel + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [Fintype V] [DecidableEq A] in +lemma initial_homSpace_negative (α β : V) (n v : ℤ) (h : n + v < 0) : + homSpace Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = ⊥ := by + by_cases hn : n = 0 + · apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Matrix.ext + intro i j + have hh : Homogeneous Q v (f i j) := by + simpa only [initialProjective, add_zero, sub_zero] using (hf.2 i j).2 + have hv : v < 0 := by omega + apply Zigzag.ext + · exact hh.1 (by omega) + · exact hh.2.1 (by omega) + · exact hh.2.2 (by omega) + · exact initial_homSpace_nonzero_cochain Q α β n v hn + +lemma frameModel_negative_pair_homDimension (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α β : V) + (n v : ℤ) (h : n + v < 0) : + homDimension Q (frameModel Q (K := K) hn M hM x α).complex + (frameModel Q hn M hM x β).complex n v = 0 := by + rw [frameModel, frameModel, minimalClassModel_homDimension, unfoldedFrame_homDimension] + exact homDimension_zero_of_homSpace_zero Q _ _ n v (initial_homSpace_negative Q α β n v h) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InitialProbeTestUpper.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InitialProbeTestUpper.lean index 0704087c138b6eef14aa7158156ee718855cf83f..7d3f65b279bc60b46685a59b36df55012ef94404 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InitialProbeTestUpper.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InitialProbeTestUpper.lean @@ -1,47 +1,47 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.OutsideCap -import OAI.Topology.ArtinGroups.Quivers.ProbeVertex -import OAI.Topology.ArtinGroups.Complexes.ScalarExactNotZero - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] - [DecidableEq (ProbeVertex V)] [DecidableEq (ProbeArrow V A)] -local notation "R" => probeQuiver Q - -lemma initialProbe_test_upper (α:V) (b:Bool) (U:Set (ProbeVertex V)) - (hU:U⊆Set.range (Sum.inl:V→ProbeVertex V)) : - ClassTestUpper R (initialClass R (K:=K) (.inr (α,b))) U 1 := by - intro β hβ l hl c - obtain ⟨β,rfl⟩:=hU hβ - change ScalarExactAt R ((initialProjective R (.inr (α,b))).testComplex R (.inl β)) _ _ _ - apply scalarExact_of_absent_degree R - rintro ⟨i,⟨p,hs,ht⟩⟩ he - change Path.target R p=Sum.inr (α,b) at ht - dsimp only [testComplex,testPlacement,initialProjective,GeneratorPlacement.level] at he - rcases p with a|a|a - · exact Sum.inl_ne_inr ((hs.symm.trans ht)) - · norm_num [Path.length] at he; omega - · exact Sum.inl_ne_inr ((hs.symm.trans ht)) - -lemma initialProbe_top_not_exact (α:V) (b:Bool) : - ¬ClassTestExact R (.inl α) 1 0 (initialClass R (K:=K) (.inr (α,b))) := - initialClass_test_not_exact R (.inl α) (.inr (α,b)) - ⟨.inr (.inl (.inr (α,b,false))),rfl,rfl⟩ - -omit [Fintype V] [Fintype A] [DecidableEq (ProbeVertex V)] - [DecidableEq (ProbeArrow V A)] in -lemma probe_core_leaf_orthogonal {α β:V} (h:α≠β) (b:Bool) : - OrthogonalVertices R (.inl α) (.inr (β,b)) := by - refine ⟨Sum.inl_ne_inr,?_⟩ - intro a hs ht - have ha: a=.inr (β,b,false):=(probe_target_iff Q β b a).mp ht - rw [ha] at hs - exact h (Sum.inl.inj hs).symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.OutsideCap +import OAI.Topology.ArtinGroups.Quivers.ProbeVertex +import OAI.Topology.ArtinGroups.Complexes.ScalarExactNotZero + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] + [DecidableEq (ProbeVertex V)] [DecidableEq (ProbeArrow V A)] +local notation "R" => probeQuiver Q + +lemma initialProbe_test_upper (α:V) (b:Bool) (U:Set (ProbeVertex V)) + (hU:U⊆Set.range (Sum.inl:V→ProbeVertex V)) : + ClassTestUpper R (initialClass R (K:=K) (.inr (α,b))) U 1 := by + intro β hβ l hl c + obtain ⟨β,rfl⟩:=hU hβ + change ScalarExactAt R ((initialProjective R (.inr (α,b))).testComplex R (.inl β)) _ _ _ + apply scalarExact_of_absent_degree R + rintro ⟨i,⟨p,hs,ht⟩⟩ he + change Path.target R p=Sum.inr (α,b) at ht + dsimp only [testComplex,testPlacement,initialProjective,GeneratorPlacement.level] at he + rcases p with a|a|a + · exact Sum.inl_ne_inr ((hs.symm.trans ht)) + · norm_num [Path.length] at he; omega + · exact Sum.inl_ne_inr ((hs.symm.trans ht)) + +lemma initialProbe_top_not_exact (α:V) (b:Bool) : + ¬ClassTestExact R (.inl α) 1 0 (initialClass R (K:=K) (.inr (α,b))) := + initialClass_test_not_exact R (.inl α) (.inr (α,b)) + ⟨.inr (.inl (.inr (α,b,false))),rfl,rfl⟩ + +omit [Fintype V] [Fintype A] [DecidableEq (ProbeVertex V)] + [DecidableEq (ProbeArrow V A)] in +lemma probe_core_leaf_orthogonal {α β:V} (h:α≠β) (b:Bool) : + OrthogonalVertices R (.inl α) (.inr (β,b)) := by + refine ⟨Sum.inl_ne_inr,?_⟩ + intro a hs ht + have ha: a=.inr (β,b,false):=(probe_target_iff Q β b a).mp ht + rw [ha] at hs + exact h (Sum.inl.inj hs).symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InitialProjective.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InitialProjective.lean index af18bcf70cefdd2616f4536e7ba4ff3151ca3edd..8bb8c5d7a1e2373c6173878d1fd82ee008d048a0 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InitialProjective.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InitialProjective.lean @@ -1,124 +1,124 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices -import OAI.Topology.ArtinGroups.Complexes.HomDimension - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def initialProjective (α : V) : BasedComplex Q (K := K) PUnit where - placement _ := ⟨α, 0, 0⟩ - differential := 0 - entries := projectiveEntries_zero Q - degree := mapDegree_zero Q 1 0 - square_zero := Matrix.zero_mul _ - -omit [DecidableEq A] in -lemma homDimension_le_homSpace {I J : Type*} [Fintype I] [Fintype J] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (n v : ℤ) : - homDimension Q E F n v ≤ Module.finrank K (homSpace Q E F n v) := by - apply le_trans (Submodule.finrank_quotient_le _) - exact Submodule.finrank_mono inf_le_left - -omit [Fintype V] [DecidableEq A] in -lemma initial_homSpace_nonzero_cochain (α β : V) (n v : ℤ) (hn : n ≠ 0) : - homSpace Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Matrix.ext - intro i j - apply (hf.2 i j).1 - change (0 : ℤ) ≠ 0 + n - omega - -omit [DecidableEq A] in -lemma initial_homSpace_orthogonal {α β : V} (h : OrthogonalVertices Q α β) (n v : ℤ) : - homSpace Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Matrix.ext - intro i j - have he := sum_cornerPath Q (f i j) (hf.1.1 i j) (hf.1.2 i j) - have hz : ∑ p : CornerPath Q α β, pathCoordinates Q (f i j) p.val • pathBasis Q (K := K) p.val = 0 := by - apply Finset.sum_eq_zero - intro p _ - exact (no_corner_of_orthogonal Q h p).elim - exact he.symm.trans hz - -lemma initial_self_entry_decomposition (hn : ∀ a, Q.source a ≠ Q.target a) - (α : V) (n v : ℤ) - {f : Matrix PUnit PUnit (Q.Zigzag K)} - (hf : f ∈ homSpace Q (initialProjective Q α) (initialProjective Q α) n v) - (i j : PUnit) : - f i j = (f i j).vertex α • vertexId Q α + (f i j).token α • tokenBasis Q α := - diagonal_corner_decomposition Q hn α (f i j) (hf.1.1 i j) (hf.1.2 i j) - -omit [Fintype V] [DecidableEq A] in -lemma initial_self_entry_homogeneous (α : V) (n v : ℤ) - {f : Matrix PUnit PUnit (Q.Zigzag K)} - (hf : f ∈ homSpace Q (initialProjective Q α) (initialProjective Q α) n v) - (i j : PUnit) : Homogeneous Q v (f i j) := by - simpa only [initialProjective, add_zero, sub_zero] using (hf.2 i j).2 - -lemma initial_homSpace_other_internal (hn : ∀ a, Q.source a ≠ Q.target a) - (α : V) (n v : ℤ) (hv₀ : v ≠ 0) (hv₂ : v ≠ 2) : - homSpace Q (initialProjective Q (K := K) α) (initialProjective Q α) n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - change f = 0 - apply Matrix.ext - intro i j - rw [initial_self_entry_decomposition Q hn α n v hf i j] - have hh := initial_self_entry_homogeneous Q α n v hf i j - rw [hh.1 hv₀, hh.2.2 hv₂] - simp only [Pi.zero_apply, zero_smul, add_zero, Matrix.zero_apply] - -noncomputable def initialCoordinate (α : V) (n v : ℤ) : - homSpace Q (initialProjective Q (K := K) α) (initialProjective Q α) n v →ₗ[K] K where - toFun f := if v = 0 then (f.val PUnit.unit PUnit.unit).vertex α - else (f.val PUnit.unit PUnit.unit).token α - map_add' f g := by split_ifs <;> rfl - map_smul' r f := by split_ifs <;> rfl - -lemma initialCoordinate_injective (hn : ∀ a, Q.source a ≠ Q.target a) - (α : V) (n v : ℤ) : Function.Injective (initialCoordinate Q (K := K) α n v) := by - apply LinearMap.ker_eq_bot.mp - apply le_antisymm _ bot_le - intro f hf - change (initialCoordinate Q α n v) f = 0 at hf - change f = 0 - apply Subtype.ext - apply Matrix.ext - intro i j - have hi : i = PUnit.unit := Subsingleton.elim _ _ - have hj : j = PUnit.unit := Subsingleton.elim _ _ - subst i - subst j - rw [initial_self_entry_decomposition Q hn α n v f.property PUnit.unit PUnit.unit] - have hh := initial_self_entry_homogeneous Q α n v f.property PUnit.unit PUnit.unit - by_cases hv : v = 0 - · have hzero : (f.val PUnit.unit PUnit.unit).vertex α = 0 := by - simpa only [initialCoordinate, LinearMap.coe_mk, AddHom.coe_mk, ite_eq_left hv] using hf - rw [hzero, hh.2.2 (by omega)] - simp only [Pi.zero_apply, zero_smul, add_zero] - rfl - · have hzero : (f.val PUnit.unit PUnit.unit).token α = 0 := by - simpa only [initialCoordinate, LinearMap.coe_mk, AddHom.coe_mk, ite_eq_right hv] using hf - rw [hzero, hh.1 hv] - simp only [Pi.zero_apply, zero_smul, add_zero] - rfl - -lemma initial_homDimension_le_one (hn : ∀ a, Q.source a ≠ Q.target a) - (α : V) (n v : ℤ) : - homDimension Q (initialProjective Q (K := K) α) (initialProjective Q α) n v ≤ 1 := by - apply le_trans (homDimension_le_homSpace Q _ _ n v) - simpa only [Module.finrank_self] using LinearMap.finrank_le_finrank_of_injective - (initialCoordinate_injective Q (K := K) hn α n v) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices +import OAI.Topology.ArtinGroups.Complexes.HomDimension + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def initialProjective (α : V) : BasedComplex Q (K := K) PUnit where + placement _ := ⟨α, 0, 0⟩ + differential := 0 + entries := projectiveEntries_zero Q + degree := mapDegree_zero Q 1 0 + square_zero := Matrix.zero_mul _ + +omit [DecidableEq A] in +lemma homDimension_le_homSpace {I J : Type*} [Fintype I] [Fintype J] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) (n v : ℤ) : + homDimension Q E F n v ≤ Module.finrank K (homSpace Q E F n v) := by + apply le_trans (Submodule.finrank_quotient_le _) + exact Submodule.finrank_mono inf_le_left + +omit [Fintype V] [DecidableEq A] in +lemma initial_homSpace_nonzero_cochain (α β : V) (n v : ℤ) (hn : n ≠ 0) : + homSpace Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Matrix.ext + intro i j + apply (hf.2 i j).1 + change (0 : ℤ) ≠ 0 + n + omega + +omit [DecidableEq A] in +lemma initial_homSpace_orthogonal {α β : V} (h : OrthogonalVertices Q α β) (n v : ℤ) : + homSpace Q (initialProjective Q (K := K) α) (initialProjective Q β) n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Matrix.ext + intro i j + have he := sum_cornerPath Q (f i j) (hf.1.1 i j) (hf.1.2 i j) + have hz : ∑ p : CornerPath Q α β, pathCoordinates Q (f i j) p.val • pathBasis Q (K := K) p.val = 0 := by + apply Finset.sum_eq_zero + intro p _ + exact (no_corner_of_orthogonal Q h p).elim + exact he.symm.trans hz + +lemma initial_self_entry_decomposition (hn : ∀ a, Q.source a ≠ Q.target a) + (α : V) (n v : ℤ) + {f : Matrix PUnit PUnit (Q.Zigzag K)} + (hf : f ∈ homSpace Q (initialProjective Q α) (initialProjective Q α) n v) + (i j : PUnit) : + f i j = (f i j).vertex α • vertexId Q α + (f i j).token α • tokenBasis Q α := + diagonal_corner_decomposition Q hn α (f i j) (hf.1.1 i j) (hf.1.2 i j) + +omit [Fintype V] [DecidableEq A] in +lemma initial_self_entry_homogeneous (α : V) (n v : ℤ) + {f : Matrix PUnit PUnit (Q.Zigzag K)} + (hf : f ∈ homSpace Q (initialProjective Q α) (initialProjective Q α) n v) + (i j : PUnit) : Homogeneous Q v (f i j) := by + simpa only [initialProjective, add_zero, sub_zero] using (hf.2 i j).2 + +lemma initial_homSpace_other_internal (hn : ∀ a, Q.source a ≠ Q.target a) + (α : V) (n v : ℤ) (hv₀ : v ≠ 0) (hv₂ : v ≠ 2) : + homSpace Q (initialProjective Q (K := K) α) (initialProjective Q α) n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + change f = 0 + apply Matrix.ext + intro i j + rw [initial_self_entry_decomposition Q hn α n v hf i j] + have hh := initial_self_entry_homogeneous Q α n v hf i j + rw [hh.1 hv₀, hh.2.2 hv₂] + simp only [Pi.zero_apply, zero_smul, add_zero, Matrix.zero_apply] + +noncomputable def initialCoordinate (α : V) (n v : ℤ) : + homSpace Q (initialProjective Q (K := K) α) (initialProjective Q α) n v →ₗ[K] K where + toFun f := if v = 0 then (f.val PUnit.unit PUnit.unit).vertex α + else (f.val PUnit.unit PUnit.unit).token α + map_add' f g := by split_ifs <;> rfl + map_smul' r f := by split_ifs <;> rfl + +lemma initialCoordinate_injective (hn : ∀ a, Q.source a ≠ Q.target a) + (α : V) (n v : ℤ) : Function.Injective (initialCoordinate Q (K := K) α n v) := by + apply LinearMap.ker_eq_bot.mp + apply le_antisymm _ bot_le + intro f hf + change (initialCoordinate Q α n v) f = 0 at hf + change f = 0 + apply Subtype.ext + apply Matrix.ext + intro i j + have hi : i = PUnit.unit := Subsingleton.elim _ _ + have hj : j = PUnit.unit := Subsingleton.elim _ _ + subst i + subst j + rw [initial_self_entry_decomposition Q hn α n v f.property PUnit.unit PUnit.unit] + have hh := initial_self_entry_homogeneous Q α n v f.property PUnit.unit PUnit.unit + by_cases hv : v = 0 + · have hzero : (f.val PUnit.unit PUnit.unit).vertex α = 0 := by + simpa only [initialCoordinate, LinearMap.coe_mk, AddHom.coe_mk, ite_eq_left hv] using hf + rw [hzero, hh.2.2 (by omega)] + simp only [Pi.zero_apply, zero_smul, add_zero] + rfl + · have hzero : (f.val PUnit.unit PUnit.unit).token α = 0 := by + simpa only [initialCoordinate, LinearMap.coe_mk, AddHom.coe_mk, ite_eq_right hv] using hf + rw [hzero, hh.1 hv] + simp only [Pi.zero_apply, zero_smul, add_zero] + rfl + +lemma initial_homDimension_le_one (hn : ∀ a, Q.source a ≠ Q.target a) + (α : V) (n v : ℤ) : + homDimension Q (initialProjective Q (K := K) α) (initialProjective Q α) n v ≤ 1 := by + apply le_trans (homDimension_le_homSpace Q _ _ n v) + simpa only [Module.finrank_self] using LinearMap.finrank_le_finrank_of_injective + (initialCoordinate_injective Q (K := K) hn α n v) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseHomMatrix.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseHomMatrix.lean index cc9c94b0d1aa05284a3dcc51495743bae00eda17..9dd61c60e466dcd97a960eec1e5fa2cf4fce6fa0 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseHomMatrix.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseHomMatrix.lean @@ -1,147 +1,147 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ReverseTwistProjectionCommute -import OAI.Topology.ArtinGroups.Complexes.PositiveHomTransform - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -noncomputable def inverseHomMatrix (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - (f : Matrix I J (Q.Zigzag K)) : - Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q F α) (Q.Zigzag K) := - Matrix.fromBlocks (cochainSign (K := K) n • testTransform Q E.placement F.placement α f) 0 0 - (Matrix.fromBlocks (testTransform Q E.placement F.placement α f) 0 0 - (Matrix.fromBlocks (testTransform Q E.placement F.placement α f) 0 0 - (Matrix.fromBlocks f 0 0 - (cochainSign (K := K) n • testTransform Q E.placement F.placement α f)))) - -omit [DecidableEq I] [DecidableEq J] in -lemma inverseHomMatrix_normalized (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n : ℤ) (f : Matrix I J (Q.Zigzag K)) : - (positiveHomTransform Q (E.negativeTwist Q α) (F.negativeTwist Q α) α n - (negativeHomTransform Q E F α n f)).submatrix - (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α) = - inverseHomMatrix Q E F α n f := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals simp only [Matrix.submatrix_apply, inverseTwistIndexEquiv, Equiv.coe_fn_mk, - inverseHomMatrix, positiveHomTransform, negativeHomTransform, Matrix.fromBlocks, - Matrix.smul_apply, - testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - coordinates_zero, zero_smul, smul_zero, selfCornerEquiv_false, selfCornerEquiv_true] - all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token, smul_smul] - all_goals ( - have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] - have hv : (vertexId Q (K := K) α).vertex α = 1 := by - simp only [vertex_vertexId, Pi.single_eq_same] - have htv : (tokenBasis Q (K := K) α).vertex α = 0 := rfl - have htt : (tokenBasis Q (K := K) α).token α = 1 := by - change (Pi.single α (1 : K) : V → K) α = 1 - exact Pi.single_eq_same α 1 - simp only [hv, htv, htt, token_vertexId, Pi.zero_apply, - _root_.mul_one, MulZeroClass.mul_zero]) - all_goals first - | exact zero_smul K (vertexId Q α) - | exact congrArg (fun c : K => c • vertexId Q α) - (by rw [← _root_.mul_assoc, cochainSign_mul_self]; exact _root_.one_mul _) - -omit [DecidableEq I] [DecidableEq J] in -lemma reverseHomMatrix_normalized (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n : ℤ) (f : Matrix I J (Q.Zigzag K)) : - (negativeHomTransform Q (E.positiveTwist Q α) (F.positiveTwist Q α) α n - (positiveHomTransform Q E F α n f)).submatrix - (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α) = - inverseHomMatrix Q E F α n f := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals simp only [Matrix.submatrix_apply, reverseTwistIndexEquiv, Equiv.coe_fn_mk, - inverseHomMatrix, positiveHomTransform, negativeHomTransform, Matrix.fromBlocks, - Matrix.smul_apply, - testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - coordinates_zero, zero_smul, smul_zero, selfCornerEquiv_false, selfCornerEquiv_true] - all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token, smul_smul] - all_goals ( - have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] - have hv : (vertexId Q (K := K) α).vertex α = 1 := by - simp only [vertex_vertexId, Pi.single_eq_same] - have htv : (tokenBasis Q (K := K) α).vertex α = 0 := rfl - have htt : (tokenBasis Q (K := K) α).token α = 1 := by - change (Pi.single α (1 : K) : V → K) α = 1 - exact Pi.single_eq_same α 1 - simp only [hv, htv, htt, token_vertexId, Pi.zero_apply, - _root_.mul_one, MulZeroClass.mul_zero]) - all_goals first - | exact zero_smul K (vertexId Q α) - | exact congrArg (fun c : K => c • vertexId Q α) - (by rw [← _root_.mul_assoc, cochainSign_mul_self]; exact _root_.one_mul _) - -lemma inverseHomMatrix_projection (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - inverseHomMatrix Q E F α n f * inverseTwistProjection Q F α = - inverseTwistProjection Q E α * f := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, - inverseHomMatrix, inverseTwistProjection, Matrix.fromBlocks, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero] - · exact congrArg (fun a => a u j) (evaluation_natural Q α hf) - · exact congrArg (fun a => a i j) - ((projectiveIdentity_mul Q hf).trans (mul_projectiveIdentity Q hf).symm).symm - -lemma inverseHomMatrix_extract (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - inverseTwistInjection Q E α * inverseHomMatrix Q E F α n f * - inverseTwistProjection Q F α = f := by - rw [Matrix.mul_assoc, inverseHomMatrix_projection Q E F α n hf, - ← Matrix.mul_assoc, inverseTwist_targetEquation] - exact projectiveIdentity_mul Q hf - -lemma reverseHomMatrix_projection (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - inverseHomMatrix Q E F α n f * reverseTwistProjection Q F α = - reverseTwistProjection Q E α * f := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, - inverseHomMatrix, reverseTwistProjection, Matrix.fromBlocks, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero, mul_neg, neg_mul, Finset.sum_neg_distrib, neg_zero] - · exact congrArg (fun a => -a u j) (evaluation_natural Q α hf) - · exact congrArg (fun a => a i j) - ((projectiveIdentity_mul Q hf).trans (mul_projectiveIdentity Q hf).symm).symm - -lemma reverseHomMatrix_extract (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - reverseTwistInjection Q E α * inverseHomMatrix Q E F α n f * - reverseTwistProjection Q F α = f := by - rw [Matrix.mul_assoc, reverseHomMatrix_projection Q E F α n hf, - ← Matrix.mul_assoc, reverseTwist_targetEquation] - exact projectiveIdentity_mul Q hf - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ReverseTwistProjectionCommute +import OAI.Topology.ArtinGroups.Complexes.PositiveHomTransform + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +noncomputable def inverseHomMatrix (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + (f : Matrix I J (Q.Zigzag K)) : + Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q F α) (Q.Zigzag K) := + Matrix.fromBlocks (cochainSign (K := K) n • testTransform Q E.placement F.placement α f) 0 0 + (Matrix.fromBlocks (testTransform Q E.placement F.placement α f) 0 0 + (Matrix.fromBlocks (testTransform Q E.placement F.placement α f) 0 0 + (Matrix.fromBlocks f 0 0 + (cochainSign (K := K) n • testTransform Q E.placement F.placement α f)))) + +omit [DecidableEq I] [DecidableEq J] in +lemma inverseHomMatrix_normalized (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n : ℤ) (f : Matrix I J (Q.Zigzag K)) : + (positiveHomTransform Q (E.negativeTwist Q α) (F.negativeTwist Q α) α n + (negativeHomTransform Q E F α n f)).submatrix + (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α) = + inverseHomMatrix Q E F α n f := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals simp only [Matrix.submatrix_apply, inverseTwistIndexEquiv, Equiv.coe_fn_mk, + inverseHomMatrix, positiveHomTransform, negativeHomTransform, Matrix.fromBlocks, + Matrix.smul_apply, + testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + coordinates_zero, zero_smul, smul_zero, selfCornerEquiv_false, selfCornerEquiv_true] + all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token, smul_smul] + all_goals ( + have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] + have hv : (vertexId Q (K := K) α).vertex α = 1 := by + simp only [vertex_vertexId, Pi.single_eq_same] + have htv : (tokenBasis Q (K := K) α).vertex α = 0 := rfl + have htt : (tokenBasis Q (K := K) α).token α = 1 := by + change (Pi.single α (1 : K) : V → K) α = 1 + exact Pi.single_eq_same α 1 + simp only [hv, htv, htt, token_vertexId, Pi.zero_apply, + _root_.mul_one, MulZeroClass.mul_zero]) + all_goals first + | exact zero_smul K (vertexId Q α) + | exact congrArg (fun c : K => c • vertexId Q α) + (by rw [← _root_.mul_assoc, cochainSign_mul_self]; exact _root_.one_mul _) + +omit [DecidableEq I] [DecidableEq J] in +lemma reverseHomMatrix_normalized (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n : ℤ) (f : Matrix I J (Q.Zigzag K)) : + (negativeHomTransform Q (E.positiveTwist Q α) (F.positiveTwist Q α) α n + (positiveHomTransform Q E F α n f)).submatrix + (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α) = + inverseHomMatrix Q E F α n f := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals simp only [Matrix.submatrix_apply, reverseTwistIndexEquiv, Equiv.coe_fn_mk, + inverseHomMatrix, positiveHomTransform, negativeHomTransform, Matrix.fromBlocks, + Matrix.smul_apply, + testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + coordinates_zero, zero_smul, smul_zero, selfCornerEquiv_false, selfCornerEquiv_true] + all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token, smul_smul] + all_goals ( + have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] + have hv : (vertexId Q (K := K) α).vertex α = 1 := by + simp only [vertex_vertexId, Pi.single_eq_same] + have htv : (tokenBasis Q (K := K) α).vertex α = 0 := rfl + have htt : (tokenBasis Q (K := K) α).token α = 1 := by + change (Pi.single α (1 : K) : V → K) α = 1 + exact Pi.single_eq_same α 1 + simp only [hv, htv, htt, token_vertexId, Pi.zero_apply, + _root_.mul_one, MulZeroClass.mul_zero]) + all_goals first + | exact zero_smul K (vertexId Q α) + | exact congrArg (fun c : K => c • vertexId Q α) + (by rw [← _root_.mul_assoc, cochainSign_mul_self]; exact _root_.one_mul _) + +lemma inverseHomMatrix_projection (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + inverseHomMatrix Q E F α n f * inverseTwistProjection Q F α = + inverseTwistProjection Q E α * f := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, + inverseHomMatrix, inverseTwistProjection, Matrix.fromBlocks, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero] + · exact congrArg (fun a => a u j) (evaluation_natural Q α hf) + · exact congrArg (fun a => a i j) + ((projectiveIdentity_mul Q hf).trans (mul_projectiveIdentity Q hf).symm).symm + +lemma inverseHomMatrix_extract (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + inverseTwistInjection Q E α * inverseHomMatrix Q E F α n f * + inverseTwistProjection Q F α = f := by + rw [Matrix.mul_assoc, inverseHomMatrix_projection Q E F α n hf, + ← Matrix.mul_assoc, inverseTwist_targetEquation] + exact projectiveIdentity_mul Q hf + +lemma reverseHomMatrix_projection (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + inverseHomMatrix Q E F α n f * reverseTwistProjection Q F α = + reverseTwistProjection Q E α * f := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, + inverseHomMatrix, reverseTwistProjection, Matrix.fromBlocks, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero, mul_neg, neg_mul, Finset.sum_neg_distrib, neg_zero] + · exact congrArg (fun a => -a u j) (evaluation_natural Q α hf) + · exact congrArg (fun a => a i j) + ((projectiveIdentity_mul Q hf).trans (mul_projectiveIdentity Q hf).symm).symm + +lemma reverseHomMatrix_extract (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + reverseTwistInjection Q E α * inverseHomMatrix Q E F α n f * + reverseTwistProjection Q F α = f := by + rw [Matrix.mul_assoc, reverseHomMatrix_projection Q E F α n hf, + ← Matrix.mul_assoc, reverseTwist_targetEquation] + exact projectiveIdentity_mul Q hf + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseMatrix.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseMatrix.lean index c0f8f6b2a30499040cd8447bccec7eb94f8ca674..e1fa230fe16fd0c82cba34f2c6c84b3daf6e007b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseMatrix.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseMatrix.lean @@ -1,224 +1,224 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModelEquivalence - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -open Matrix - -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] - [DecidableEq I] [DecidableEq J] [DecidableEq L] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma cone_homotopy_degree11 (f:Map Q E F) - (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) - (hH:MapDegree Q (f.cone Q).placement (f.cone Q).placement (-1) 0 H) : - MapDegree Q E.placement E.placement (-1) 0 H.toBlocks₁₁ := by - intro i j - refine ⟨?_,(hH (.inl i) (.inl j)).2⟩ - intro h - apply (hH (.inl i) (.inl j)).1 - change (E.placement j).cochain-1≠(E.placement i).cochain-1+(-1) - omega - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma cone_homotopy_degree22 (f:Map Q E F) - (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) - (hH:MapDegree Q (f.cone Q).placement (f.cone Q).placement (-1) 0 H) : - MapDegree Q F.placement F.placement (-1) 0 H.toBlocks₂₂ := - fun i j=>hH (.inr i) (.inr j) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma cone_homotopy_degree21 (f:Map Q E F) - (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) - (hH:MapDegree Q (f.cone Q).placement (f.cone Q).placement (-1) 0 H) : - MapDegree Q F.placement E.placement 0 0 H.toBlocks₂₁ := by - intro i j - refine ⟨?_,(hH (.inr i) (.inl j)).2⟩ - intro h - apply (hH (.inr i) (.inl j)).1 - change (E.placement j).cochain-1≠(F.placement i).cochain+(-1) - omega - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma through_absent_level_zero {C:BasedComplex Q (K:=K) I} - (D:BasedComplex Q (K:=K) J) (f:Map Q C D) (g:Map Q D C) - (q:ℤ) (hD:∀ j,(D.placement j).level≠q) - (i k:I) (hi:(C.placement i).level=q) (hk:(C.placement k).level=q) : - (f.matrix*g.matrix) i k=0 := by - apply Finset.sum_eq_zero - intro j _ - change f.matrix i j*g.matrix j k=0 - by_cases hf:f.matrix i j=0 - · rw [hf,zero_mul] - by_cases hg:g.matrix j k=0 - · rw [hg,mul_zero] - have hl:=map_level_bound Q f i j hf - have hu:=map_level_bound Q g j k hg - exact (hD j (by omega)).elim - -omit [Fintype V] [DecidableEq A] in -lemma cone_identity_blocks (f:Map Q E F) : - projectiveIdentity Q (K:=K) (f.cone Q).placement= - Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 - (projectiveIdentity Q F.placement) := by - apply Matrix.ext - intro i j - rcases i with i|i <;> rcases j with j|j <;> simp [projectiveIdentity,Matrix.diagonal,Map.cone,Map.conePlacement] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma cone_homotopy_source_block (f:Map Q E F) - (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) : - ((f.cone Q).differential*H+H*(f.cone Q).differential).toBlocks₁₁= - -(E.differential*H.toBlocks₁₁+H.toBlocks₁₁*E.differential)+f.matrix*H.toBlocks₂₁ := by - conv_lhs => rw [← Matrix.fromBlocks_toBlocks H] - change ((Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential)* - Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂+ - Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂* - Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential).toBlocks₁₁=_ - rw [Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply] - change (-E.differential*H.toBlocks₁₁+f.matrix*H.toBlocks₂₁)+ - (H.toBlocks₁₁*(-E.differential)+H.toBlocks₁₂*(0 : Matrix J I (Q.Zigzag K)))=_ - simp only [Matrix.mul_zero,add_zero,Matrix.neg_mul,Matrix.mul_neg] - abel - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma cone_homotopy_target_block (f:Map Q E F) - (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) : - ((f.cone Q).differential*H+H*(f.cone Q).differential).toBlocks₂₂= - (F.differential*H.toBlocks₂₂+H.toBlocks₂₂*F.differential)+H.toBlocks₂₁*f.matrix := by - conv_lhs => rw [← Matrix.fromBlocks_toBlocks H] - change ((Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential)* - Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂+ - Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂* - Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential).toBlocks₂₂=_ - rw [Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply] - change ((0 : Matrix J I (Q.Zigzag K))*H.toBlocks₁₂+F.differential*H.toBlocks₂₂)+ - (H.toBlocks₂₁*f.matrix+H.toBlocks₂₂*F.differential)=_ - simp only [Matrix.zero_mul,zero_add] - abel - -omit [Fintype V] [DecidableEq A] in -lemma cone_layer_inverse_equations (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) - (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) - (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : - atLevel Q E.placement F.placement f.matrix q * - atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q= - projectiveIdentity Q (E.pureLayer Q hE q).placement ∧ - atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q * - atLevel Q E.placement F.placement f.matrix q= - projectiveIdentity Q (F.pureLayer Q hF q).placement := by - have hdeg:=cone_homotopy_degree21 Q f e.sourceHomotopy e.sourceDegree - have hb:∀ i j,e.sourceHomotopy.toBlocks₂₁ i j≠0→ - (E.placement j).level≤(F.placement i).level := by - intro i j hij - simpa using mapDegree_level_bound Q hdeg hij - have hs:=congrArg (fun m=>atLevel Q E.placement E.placement m.toBlocks₁₁ q) e.sourceEquation - have ht:=congrArg (fun m=>atLevel Q F.placement F.placement m.toBlocks₂₂ q) e.sourceEquation - have hz₁:atLevel Q E.placement E.placement - (e.forward.matrix*e.backward.matrix).toBlocks₁₁ q=0 := by - apply Matrix.ext - intro i j - apply through_absent_level_zero Q D e.forward e.backward (q-1) (fun k=>(hD k).1) (.inl i.val) (.inl j.val) - · change (E.placement i.val).cochain-1+(E.placement i.val).internal=q-1 - have hh:=i.property; dsimp [GeneratorPlacement.level] at hh; omega - · change (E.placement j.val).cochain-1+(E.placement j.val).internal=q-1 - have hh:=j.property; dsimp [GeneratorPlacement.level] at hh; omega - have hz₂:atLevel Q F.placement F.placement - (e.forward.matrix*e.backward.matrix).toBlocks₂₂ q=0 := by - apply Matrix.ext - intro i j - exact through_absent_level_zero Q D e.forward e.backward q (fun k=>(hD k).2) - (.inr i.val) (.inr j.val) i.property j.property - rw [hz₁] at hs - rw [hz₂] at ht - change 0=atLevel Q E.placement E.placement - ((projectiveIdentity Q (f.cone Q).placement).toBlocks₁₁+ - ((f.cone Q).differential*e.sourceHomotopy+ - e.sourceHomotopy*(f.cone Q).differential).toBlocks₁₁) q at hs - change 0=atLevel Q F.placement F.placement - ((projectiveIdentity Q (f.cone Q).placement).toBlocks₂₂+ - ((f.cone Q).differential*e.sourceHomotopy+ - e.sourceHomotopy*(f.cone Q).differential).toBlocks₂₂) q at ht - rw [cone_identity_blocks,Matrix.toBlocks_fromBlocks₁₁,cone_homotopy_source_block, - atLevel_add,atLevel_add,atLevel_identity] at hs - rw [cone_identity_blocks,Matrix.toBlocks_fromBlocks₂₂,cone_homotopy_target_block, - atLevel_add,atLevel_add,atLevel_identity] at ht - have he₁:=atLevel_homotopy_boundary Q E hE e.sourceHomotopy.toBlocks₁₁ - (cone_homotopy_degree11 Q f _ e.sourceDegree) q - have he₂:=atLevel_homotopy_boundary Q F hF e.sourceHomotopy.toBlocks₂₂ - (cone_homotopy_degree22 Q f _ e.sourceDegree) q - change 0=projectiveIdentity Q _+(-atLevel Q E.placement E.placement - (E.differential*e.sourceHomotopy.toBlocks₁₁+e.sourceHomotopy.toBlocks₁₁*E.differential) q+ - atLevel Q E.placement E.placement (f.matrix*e.sourceHomotopy.toBlocks₂₁) q) at hs - rw [he₁,neg_zero,zero_add,atLevel_mul Q _ _ _ _ _ q (map_level_bound Q f) hb] at hs - rw [he₂,zero_add,atLevel_mul Q _ _ _ _ _ q hb (map_level_bound Q f)] at ht - have hn : atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q = - -atLevel Q F.placement E.placement e.sourceHomotopy.toBlocks₂₁ q := by - apply Matrix.ext - intro i j - rfl - rw [hn] - constructor - · - rw [Matrix.mul_neg] - exact (neg_eq_iff_eq_neg).mpr (eq_neg_of_add_eq_zero_right hs.symm) - · - rw [Matrix.neg_mul] - exact (neg_eq_iff_eq_neg).mpr (eq_neg_of_add_eq_zero_right ht.symm) - -noncomputable def Map.inverseMatrix (f:Map Q E F) (g:Matrix J I (Q.Zigzag K)) - (hg:ProjectiveEntries Q F.placement E.placement g) - (hd:MapDegree Q F.placement E.placement 0 0 g) - (hfg:f.matrix*g=projectiveIdentity Q E.placement) - (hgf:g*f.matrix=projectiveIdentity Q F.placement) : Map Q F E where - matrix:=g - entries:=hg - degree:=hd - commute:=by - calc - F.differential*g=(projectiveIdentity Q F.placement*F.differential)*g := by - exact congrArg (fun m=>m*g) (projectiveIdentity_mul Q F.entries).symm - _=((g*f.matrix)*F.differential)*g := by rw [hgf] - _=(g*(f.matrix*F.differential))*g := by simp only [Matrix.mul_assoc] - _=(g*(E.differential*f.matrix))*g := by rw [f.commute] - _=(g*E.differential)*(f.matrix*g) := by simp only [Matrix.mul_assoc] - _=(g*E.differential)*projectiveIdentity Q E.placement := - congrArg (fun m=>(g*E.differential)*m) hfg - _=g*E.differential := mul_projectiveIdentity Q (projectiveEntries_mul Q hg E.entries) - -noncomputable def coneLayerIsomorphism (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) - (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) - (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : - ChainIsomorphism Q (E.pureLayer Q hE q) (F.pureLayer Q hF q) := by - let a:=f.pureLayer Q hE hF q - let b:=atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q - have he:ProjectiveEntries Q F.placement E.placement e.sourceHomotopy.toBlocks₂₁ := - ⟨fun i j=>e.sourceEntries.1 (.inr i) (.inl j), - fun i j=>e.sourceEntries.2 (.inr i) (.inl j)⟩ - have heb:=projectiveEntries_neg Q he - have hb:ProjectiveEntries Q (F.pureLayer Q hF q).placement - (E.pureLayer Q hE q).placement b := - ⟨fun i j=>heb.1 i.val j.val,fun i j=>heb.2 i.val j.val⟩ - have hdeg:=mapDegree_neg Q (cone_homotopy_degree21 Q f _ e.sourceDegree) - have hd:MapDegree Q (F.pureLayer Q hF q).placement - (E.pureLayer Q hE q).placement 0 0 b :=fun i j=>hdeg i.val j.val - have hh:=cone_layer_inverse_equations Q f hE hF D e q hD - exact ⟨a,a.inverseMatrix Q b hb hd hh.1 hh.2,hh.1,hh.2⟩ - -omit [Fintype V] [DecidableEq A] in -theorem classLayer_eq_of_cone_gap (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) - (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) - (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : - classLayer Q q (classOfComplex Q E)=classLayer Q q (classOfComplex Q F) := by - rw [classLayer_minimal Q E hE,classLayer_minimal Q F hF] - exact Quotient.sound ⟨(coneLayerIsomorphism Q f hE hF D e q hD).toHomotopyEquivalence Q⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModelEquivalence + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +open Matrix + +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] + [DecidableEq I] [DecidableEq J] [DecidableEq L] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma cone_homotopy_degree11 (f:Map Q E F) + (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) + (hH:MapDegree Q (f.cone Q).placement (f.cone Q).placement (-1) 0 H) : + MapDegree Q E.placement E.placement (-1) 0 H.toBlocks₁₁ := by + intro i j + refine ⟨?_,(hH (.inl i) (.inl j)).2⟩ + intro h + apply (hH (.inl i) (.inl j)).1 + change (E.placement j).cochain-1≠(E.placement i).cochain-1+(-1) + omega + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma cone_homotopy_degree22 (f:Map Q E F) + (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) + (hH:MapDegree Q (f.cone Q).placement (f.cone Q).placement (-1) 0 H) : + MapDegree Q F.placement F.placement (-1) 0 H.toBlocks₂₂ := + fun i j=>hH (.inr i) (.inr j) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma cone_homotopy_degree21 (f:Map Q E F) + (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) + (hH:MapDegree Q (f.cone Q).placement (f.cone Q).placement (-1) 0 H) : + MapDegree Q F.placement E.placement 0 0 H.toBlocks₂₁ := by + intro i j + refine ⟨?_,(hH (.inr i) (.inl j)).2⟩ + intro h + apply (hH (.inr i) (.inl j)).1 + change (E.placement j).cochain-1≠(F.placement i).cochain+(-1) + omega + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma through_absent_level_zero {C:BasedComplex Q (K:=K) I} + (D:BasedComplex Q (K:=K) J) (f:Map Q C D) (g:Map Q D C) + (q:ℤ) (hD:∀ j,(D.placement j).level≠q) + (i k:I) (hi:(C.placement i).level=q) (hk:(C.placement k).level=q) : + (f.matrix*g.matrix) i k=0 := by + apply Finset.sum_eq_zero + intro j _ + change f.matrix i j*g.matrix j k=0 + by_cases hf:f.matrix i j=0 + · rw [hf,zero_mul] + by_cases hg:g.matrix j k=0 + · rw [hg,mul_zero] + have hl:=map_level_bound Q f i j hf + have hu:=map_level_bound Q g j k hg + exact (hD j (by omega)).elim + +omit [Fintype V] [DecidableEq A] in +lemma cone_identity_blocks (f:Map Q E F) : + projectiveIdentity Q (K:=K) (f.cone Q).placement= + Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 + (projectiveIdentity Q F.placement) := by + apply Matrix.ext + intro i j + rcases i with i|i <;> rcases j with j|j <;> simp [projectiveIdentity,Matrix.diagonal,Map.cone,Map.conePlacement] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma cone_homotopy_source_block (f:Map Q E F) + (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) : + ((f.cone Q).differential*H+H*(f.cone Q).differential).toBlocks₁₁= + -(E.differential*H.toBlocks₁₁+H.toBlocks₁₁*E.differential)+f.matrix*H.toBlocks₂₁ := by + conv_lhs => rw [← Matrix.fromBlocks_toBlocks H] + change ((Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential)* + Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂+ + Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂* + Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential).toBlocks₁₁=_ + rw [Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply] + change (-E.differential*H.toBlocks₁₁+f.matrix*H.toBlocks₂₁)+ + (H.toBlocks₁₁*(-E.differential)+H.toBlocks₁₂*(0 : Matrix J I (Q.Zigzag K)))=_ + simp only [Matrix.mul_zero,add_zero,Matrix.neg_mul,Matrix.mul_neg] + abel + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma cone_homotopy_target_block (f:Map Q E F) + (H:Matrix (I⊕J) (I⊕J) (Q.Zigzag K)) : + ((f.cone Q).differential*H+H*(f.cone Q).differential).toBlocks₂₂= + (F.differential*H.toBlocks₂₂+H.toBlocks₂₂*F.differential)+H.toBlocks₂₁*f.matrix := by + conv_lhs => rw [← Matrix.fromBlocks_toBlocks H] + change ((Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential)* + Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂+ + Matrix.fromBlocks H.toBlocks₁₁ H.toBlocks₁₂ H.toBlocks₂₁ H.toBlocks₂₂* + Matrix.fromBlocks (-E.differential) f.matrix 0 F.differential).toBlocks₂₂=_ + rw [Matrix.fromBlocks_multiply,Matrix.fromBlocks_multiply] + change ((0 : Matrix J I (Q.Zigzag K))*H.toBlocks₁₂+F.differential*H.toBlocks₂₂)+ + (H.toBlocks₂₁*f.matrix+H.toBlocks₂₂*F.differential)=_ + simp only [Matrix.zero_mul,zero_add] + abel + +omit [Fintype V] [DecidableEq A] in +lemma cone_layer_inverse_equations (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) + (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) + (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : + atLevel Q E.placement F.placement f.matrix q * + atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q= + projectiveIdentity Q (E.pureLayer Q hE q).placement ∧ + atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q * + atLevel Q E.placement F.placement f.matrix q= + projectiveIdentity Q (F.pureLayer Q hF q).placement := by + have hdeg:=cone_homotopy_degree21 Q f e.sourceHomotopy e.sourceDegree + have hb:∀ i j,e.sourceHomotopy.toBlocks₂₁ i j≠0→ + (E.placement j).level≤(F.placement i).level := by + intro i j hij + simpa using mapDegree_level_bound Q hdeg hij + have hs:=congrArg (fun m=>atLevel Q E.placement E.placement m.toBlocks₁₁ q) e.sourceEquation + have ht:=congrArg (fun m=>atLevel Q F.placement F.placement m.toBlocks₂₂ q) e.sourceEquation + have hz₁:atLevel Q E.placement E.placement + (e.forward.matrix*e.backward.matrix).toBlocks₁₁ q=0 := by + apply Matrix.ext + intro i j + apply through_absent_level_zero Q D e.forward e.backward (q-1) (fun k=>(hD k).1) (.inl i.val) (.inl j.val) + · change (E.placement i.val).cochain-1+(E.placement i.val).internal=q-1 + have hh:=i.property; dsimp [GeneratorPlacement.level] at hh; omega + · change (E.placement j.val).cochain-1+(E.placement j.val).internal=q-1 + have hh:=j.property; dsimp [GeneratorPlacement.level] at hh; omega + have hz₂:atLevel Q F.placement F.placement + (e.forward.matrix*e.backward.matrix).toBlocks₂₂ q=0 := by + apply Matrix.ext + intro i j + exact through_absent_level_zero Q D e.forward e.backward q (fun k=>(hD k).2) + (.inr i.val) (.inr j.val) i.property j.property + rw [hz₁] at hs + rw [hz₂] at ht + change 0=atLevel Q E.placement E.placement + ((projectiveIdentity Q (f.cone Q).placement).toBlocks₁₁+ + ((f.cone Q).differential*e.sourceHomotopy+ + e.sourceHomotopy*(f.cone Q).differential).toBlocks₁₁) q at hs + change 0=atLevel Q F.placement F.placement + ((projectiveIdentity Q (f.cone Q).placement).toBlocks₂₂+ + ((f.cone Q).differential*e.sourceHomotopy+ + e.sourceHomotopy*(f.cone Q).differential).toBlocks₂₂) q at ht + rw [cone_identity_blocks,Matrix.toBlocks_fromBlocks₁₁,cone_homotopy_source_block, + atLevel_add,atLevel_add,atLevel_identity] at hs + rw [cone_identity_blocks,Matrix.toBlocks_fromBlocks₂₂,cone_homotopy_target_block, + atLevel_add,atLevel_add,atLevel_identity] at ht + have he₁:=atLevel_homotopy_boundary Q E hE e.sourceHomotopy.toBlocks₁₁ + (cone_homotopy_degree11 Q f _ e.sourceDegree) q + have he₂:=atLevel_homotopy_boundary Q F hF e.sourceHomotopy.toBlocks₂₂ + (cone_homotopy_degree22 Q f _ e.sourceDegree) q + change 0=projectiveIdentity Q _+(-atLevel Q E.placement E.placement + (E.differential*e.sourceHomotopy.toBlocks₁₁+e.sourceHomotopy.toBlocks₁₁*E.differential) q+ + atLevel Q E.placement E.placement (f.matrix*e.sourceHomotopy.toBlocks₂₁) q) at hs + rw [he₁,neg_zero,zero_add,atLevel_mul Q _ _ _ _ _ q (map_level_bound Q f) hb] at hs + rw [he₂,zero_add,atLevel_mul Q _ _ _ _ _ q hb (map_level_bound Q f)] at ht + have hn : atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q = + -atLevel Q F.placement E.placement e.sourceHomotopy.toBlocks₂₁ q := by + apply Matrix.ext + intro i j + rfl + rw [hn] + constructor + · + rw [Matrix.mul_neg] + exact (neg_eq_iff_eq_neg).mpr (eq_neg_of_add_eq_zero_right hs.symm) + · + rw [Matrix.neg_mul] + exact (neg_eq_iff_eq_neg).mpr (eq_neg_of_add_eq_zero_right ht.symm) + +noncomputable def Map.inverseMatrix (f:Map Q E F) (g:Matrix J I (Q.Zigzag K)) + (hg:ProjectiveEntries Q F.placement E.placement g) + (hd:MapDegree Q F.placement E.placement 0 0 g) + (hfg:f.matrix*g=projectiveIdentity Q E.placement) + (hgf:g*f.matrix=projectiveIdentity Q F.placement) : Map Q F E where + matrix:=g + entries:=hg + degree:=hd + commute:=by + calc + F.differential*g=(projectiveIdentity Q F.placement*F.differential)*g := by + exact congrArg (fun m=>m*g) (projectiveIdentity_mul Q F.entries).symm + _=((g*f.matrix)*F.differential)*g := by rw [hgf] + _=(g*(f.matrix*F.differential))*g := by simp only [Matrix.mul_assoc] + _=(g*(E.differential*f.matrix))*g := by rw [f.commute] + _=(g*E.differential)*(f.matrix*g) := by simp only [Matrix.mul_assoc] + _=(g*E.differential)*projectiveIdentity Q E.placement := + congrArg (fun m=>(g*E.differential)*m) hfg + _=g*E.differential := mul_projectiveIdentity Q (projectiveEntries_mul Q hg E.entries) + +noncomputable def coneLayerIsomorphism (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) + (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) + (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : + ChainIsomorphism Q (E.pureLayer Q hE q) (F.pureLayer Q hF q) := by + let a:=f.pureLayer Q hE hF q + let b:=atLevel Q F.placement E.placement (-e.sourceHomotopy.toBlocks₂₁) q + have he:ProjectiveEntries Q F.placement E.placement e.sourceHomotopy.toBlocks₂₁ := + ⟨fun i j=>e.sourceEntries.1 (.inr i) (.inl j), + fun i j=>e.sourceEntries.2 (.inr i) (.inl j)⟩ + have heb:=projectiveEntries_neg Q he + have hb:ProjectiveEntries Q (F.pureLayer Q hF q).placement + (E.pureLayer Q hE q).placement b := + ⟨fun i j=>heb.1 i.val j.val,fun i j=>heb.2 i.val j.val⟩ + have hdeg:=mapDegree_neg Q (cone_homotopy_degree21 Q f _ e.sourceDegree) + have hd:MapDegree Q (F.pureLayer Q hF q).placement + (E.pureLayer Q hE q).placement 0 0 b :=fun i j=>hdeg i.val j.val + have hh:=cone_layer_inverse_equations Q f hE hF D e q hD + exact ⟨a,a.inverseMatrix Q b hb hd hh.1 hh.2,hh.1,hh.2⟩ + +omit [Fintype V] [DecidableEq A] in +theorem classLayer_eq_of_cone_gap (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) + (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) + (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : + classLayer Q q (classOfComplex Q E)=classLayer Q q (classOfComplex Q F) := by + rw [classLayer_minimal Q E hE,classLayer_minimal Q F hF] + exact Quotient.sound ⟨(coneLayerIsomorphism Q f hE hF D e q hD).toHomotopyEquivalence Q⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistDifferential.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistDifferential.lean index 355645c49fc8797b7f6e4397eed8aa7651374766..7315691ca0c993ac013c54ed1f1778f6f71abcf2 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistDifferential.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistDifferential.lean @@ -1,103 +1,103 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.TestTransform -import OAI.Topology.ArtinGroups.Complexes.InverseTwistIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -noncomputable def inverseTwistDifferential (E : BasedComplex Q (K := K) I) (α : V) : - Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) := - fun i j => match i, j with - | .inl u, .inl v => -testTransform Q E.placement E.placement α E.differential u v - | .inl u, .inr (.inl v) => -unitContraction Q E.placement α u v - | .inl u, .inr (.inr (.inl v)) => -projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inl u, .inr (.inr (.inr (.inl j))) => evaluationMatrix Q E.placement α u j - | .inr (.inl u), .inr (.inl v) => testTransform Q E.placement E.placement α E.differential u v - | .inr (.inl u), .inr (.inr (.inr (.inr v))) => - projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inr (.inr (.inl u)), .inr (.inr (.inl v)) => - testTransform Q E.placement E.placement α E.differential u v - | .inr (.inr (.inl u)), .inr (.inr (.inr (.inr v))) => testToken Q E.placement α u v - | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inl j))) => E.differential i j - | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inr v))) => coevaluationMatrix Q E.placement α i v - | .inr (.inr (.inr (.inr u))), .inr (.inr (.inr (.inr v))) => - -testTransform Q E.placement E.placement α E.differential u v - | _, _ => 0 - -omit [DecidableEq I] in -lemma positiveTwist_differential (E : BasedComplex Q (K := K) I) (α : V) : - (E.positiveTwist Q α).differential = - Matrix.fromBlocks (-testTransform Q E.placement E.placement α E.differential) - (evaluationMatrix Q E.placement α) 0 E.differential := rfl - -omit [DecidableEq I] in -lemma negativeTwist_differential (E : BasedComplex Q (K := K) I) (α : V) : - (E.negativeTwist Q α).differential = - Matrix.fromBlocks E.differential (coevaluationMatrix Q E.placement α) - 0 (-testTransform Q E.placement E.placement α E.differential) := rfl - -lemma normalizedInverseTwist_differential (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - (normalizedInverseTwist Q hn E α).differential = inverseTwistDifferential Q E α := by - change ((E.negativeTwist Q α).positiveTwist Q α).differential.submatrix - (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn E α) = _ - rw [positiveTwist_differential] - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals simp only [Matrix.submatrix_apply, inverseTwistIndexEquiv, Equiv.coe_fn_mk, - Matrix.of_apply, - inverseTwistDifferential, Matrix.fromBlocks, testTransform, scalarCornerMatrix, testMatrix] - all_goals simp only [negativeTwist_differential, Matrix.fromBlocks, Matrix.neg_apply, - Matrix.zero_apply, Matrix.of_apply, testTransform, scalarCornerMatrix, testMatrix, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - coordinates_zero, zero_smul, neg_zero, selfCornerEquiv_false, selfCornerEquiv_true] - all_goals try simp only [evaluationMatrix, Sum.inl.injEq, Sum.inr.injEq, - Sum.inl_ne_inr, Sum.inr_ne_inl, ↓reduceIte, selfCornerEquiv_false, - selfCornerEquiv_true, pathBasis_vertex, pathBasis_token, projectiveIdentity, - Matrix.diagonal_apply, testPlacement, testToken] - all_goals try simp only [_root_.mul_neg, mul_smul, map_neg, Pi.neg_apply, - coordinates_smul, neg_smul, neg_neg] - all_goals try simp only [vertexId_mul_self] - · simp only [coevaluationMatrix, unitContraction, pathCoordinates_vertex] - split_ifs <;> simp_all - · apply congrArg Neg.neg - change (pathBasis Q (K := K) u.2.val * coevaluationMatrix Q E.placement α u.1 v).token α • - vertexId Q α = if u = v then vertexId Q α else 0 - by_cases hi : u.1 = v.1 - · rcases u with ⟨i, u⟩ - rcases v with ⟨j, v⟩ - dsimp only at hi - subst j - simp only [coevaluationMatrix, ite_true, cornerPath_basis_dual_token] - by_cases hp : u = v - · subst v - simp - · simp [hp] - · have huv : u ≠ v := fun h => hi (congrArg Sigma.fst h) - simp only [coevaluationMatrix, ite_eq_right hi, MulZeroClass.mul_zero, - token_zero, Pi.zero_apply, zero_smul, ite_eq_right huv] - all_goals - have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - try simp only [ht, pathCoordinates_vertex, pathCoordinates_token] - try simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, - Pi.zero_apply] - first - | rfl - | exact congrArg (fun k : K => k • vertexId Q (K := K) α) - (_root_.mul_one (pathCoordinates Q (pathBasis Q (K := K) u.2.val * - E.differential u.1 v.1) v.2.val)) - | exact (congrArg (fun k : K => k • vertexId Q (K := K) α) - (MulZeroClass.mul_zero (pathCoordinates Q (pathBasis Q (K := K) u.2.val * - E.differential u.1 v.1) v.2.val))).trans (zero_smul K _) - | refine @ite_cond_congr _ _ _ ?_ ?_ _ _ rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.TestTransform +import OAI.Topology.ArtinGroups.Complexes.InverseTwistIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +noncomputable def inverseTwistDifferential (E : BasedComplex Q (K := K) I) (α : V) : + Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) := + fun i j => match i, j with + | .inl u, .inl v => -testTransform Q E.placement E.placement α E.differential u v + | .inl u, .inr (.inl v) => -unitContraction Q E.placement α u v + | .inl u, .inr (.inr (.inl v)) => -projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inl u, .inr (.inr (.inr (.inl j))) => evaluationMatrix Q E.placement α u j + | .inr (.inl u), .inr (.inl v) => testTransform Q E.placement E.placement α E.differential u v + | .inr (.inl u), .inr (.inr (.inr (.inr v))) => + projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inr (.inr (.inl u)), .inr (.inr (.inl v)) => + testTransform Q E.placement E.placement α E.differential u v + | .inr (.inr (.inl u)), .inr (.inr (.inr (.inr v))) => testToken Q E.placement α u v + | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inl j))) => E.differential i j + | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inr v))) => coevaluationMatrix Q E.placement α i v + | .inr (.inr (.inr (.inr u))), .inr (.inr (.inr (.inr v))) => + -testTransform Q E.placement E.placement α E.differential u v + | _, _ => 0 + +omit [DecidableEq I] in +lemma positiveTwist_differential (E : BasedComplex Q (K := K) I) (α : V) : + (E.positiveTwist Q α).differential = + Matrix.fromBlocks (-testTransform Q E.placement E.placement α E.differential) + (evaluationMatrix Q E.placement α) 0 E.differential := rfl + +omit [DecidableEq I] in +lemma negativeTwist_differential (E : BasedComplex Q (K := K) I) (α : V) : + (E.negativeTwist Q α).differential = + Matrix.fromBlocks E.differential (coevaluationMatrix Q E.placement α) + 0 (-testTransform Q E.placement E.placement α E.differential) := rfl + +lemma normalizedInverseTwist_differential (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + (normalizedInverseTwist Q hn E α).differential = inverseTwistDifferential Q E α := by + change ((E.negativeTwist Q α).positiveTwist Q α).differential.submatrix + (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn E α) = _ + rw [positiveTwist_differential] + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals simp only [Matrix.submatrix_apply, inverseTwistIndexEquiv, Equiv.coe_fn_mk, + Matrix.of_apply, + inverseTwistDifferential, Matrix.fromBlocks, testTransform, scalarCornerMatrix, testMatrix] + all_goals simp only [negativeTwist_differential, Matrix.fromBlocks, Matrix.neg_apply, + Matrix.zero_apply, Matrix.of_apply, testTransform, scalarCornerMatrix, testMatrix, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + coordinates_zero, zero_smul, neg_zero, selfCornerEquiv_false, selfCornerEquiv_true] + all_goals try simp only [evaluationMatrix, Sum.inl.injEq, Sum.inr.injEq, + Sum.inl_ne_inr, Sum.inr_ne_inl, ↓reduceIte, selfCornerEquiv_false, + selfCornerEquiv_true, pathBasis_vertex, pathBasis_token, projectiveIdentity, + Matrix.diagonal_apply, testPlacement, testToken] + all_goals try simp only [_root_.mul_neg, mul_smul, map_neg, Pi.neg_apply, + coordinates_smul, neg_smul, neg_neg] + all_goals try simp only [vertexId_mul_self] + · simp only [coevaluationMatrix, unitContraction, pathCoordinates_vertex] + split_ifs <;> simp_all + · apply congrArg Neg.neg + change (pathBasis Q (K := K) u.2.val * coevaluationMatrix Q E.placement α u.1 v).token α • + vertexId Q α = if u = v then vertexId Q α else 0 + by_cases hi : u.1 = v.1 + · rcases u with ⟨i, u⟩ + rcases v with ⟨j, v⟩ + dsimp only at hi + subst j + simp only [coevaluationMatrix, ite_true, cornerPath_basis_dual_token] + by_cases hp : u = v + · subst v + simp + · simp [hp] + · have huv : u ≠ v := fun h => hi (congrArg Sigma.fst h) + simp only [coevaluationMatrix, ite_eq_right hi, MulZeroClass.mul_zero, + token_zero, Pi.zero_apply, zero_smul, ite_eq_right huv] + all_goals + have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + try simp only [ht, pathCoordinates_vertex, pathCoordinates_token] + try simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, + Pi.zero_apply] + first + | rfl + | exact congrArg (fun k : K => k • vertexId Q (K := K) α) + (_root_.mul_one (pathCoordinates Q (pathBasis Q (K := K) u.2.val * + E.differential u.1 v.1) v.2.val)) + | exact (congrArg (fun k : K => k • vertexId Q (K := K) α) + (MulZeroClass.mul_zero (pathCoordinates Q (pathBasis Q (K := K) u.2.val * + E.differential u.1 v.1) v.2.val))).trans (zero_smul K _) + | refine @ite_cond_congr _ _ _ ?_ ?_ _ _ rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIdentity.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIdentity.lean index c52514ba36605c570873326374ab08f9b8a6b4c5..960fed4b0e9101e914c10bd3eb63a1713a528528 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIdentity.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIdentity.lean @@ -1,160 +1,160 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseTwistDifferential -import OAI.Topology.ArtinGroups.Complexes.InverseTwistPlacement -import OAI.Topology.ArtinGroups.Diagrams.Index - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -lemma inverseTwistProjection_commute (E : BasedComplex Q (K := K) I) (α : V) : - inverseTwistDifferential Q E α * inverseTwistProjection Q E α = - inverseTwistProjection Q E α * E.differential := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, inverseTwistDifferential, - inverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - Finset.sum_const_zero, _root_.neg_mul, Finset.sum_neg_distrib, add_zero, zero_add] - · exact (congrArg₂ (fun a b : Q.Zigzag K => -a + b) - (congrFun (congrFun (projectiveIdentity_mul Q - (evaluation_entries Q E.placement α)) u) j) - (congrFun (congrFun (mul_projectiveIdentity Q - (evaluation_entries Q E.placement α)) u) j)).trans (neg_add_cancel _) - · exact congrFun (congrFun (evaluation_natural Q α E.entries) u) j - · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans - (projectiveIdentity_mul Q E.entries).symm) i) j - -lemma inverseTwistInjection_commute (E : BasedComplex Q (K := K) I) (α : V) : - E.differential * inverseTwistInjection Q E α = - inverseTwistInjection Q E α * inverseTwistDifferential Q E α := by - apply Matrix.ext - intro i j - rcases j with u | u | u | j | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, inverseTwistDifferential, - inverseTwistInjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - Finset.sum_const_zero, _root_.neg_mul, _root_.mul_neg, Finset.sum_neg_distrib, - add_zero, zero_add, neg_zero] - · exact congrArg Neg.neg (congrFun (congrFun (coevaluation_natural Q α E.entries).symm i) u) - · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans - (projectiveIdentity_mul Q E.entries).symm) i) j - · exact ((congrArg₂ (fun a b : Q.Zigzag K => -a + b) - (congrFun (congrFun (mul_projectiveIdentity Q - (coevaluation_entries Q E.placement α)) i) u) - (congrFun (congrFun (projectiveIdentity_mul Q - (coevaluation_entries Q E.placement α)) i) u)).trans (neg_add_cancel _)).symm - -omit [DecidableEq A] in -lemma inverseTwist_targetEquation (E : BasedComplex Q (K := K) I) (α : V) : - inverseTwistInjection Q E α * inverseTwistProjection Q E α = - projectiveIdentity Q (K := K) E.placement := by - apply Matrix.ext - intro i j - simp only [Matrix.mul_apply, Fintype.sum_sum_type, inverseTwistInjection, - inverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - Finset.sum_const_zero, add_zero, zero_add] - exact congrFun (congrFun (projectiveIdentity_mul Q - (projectiveEntries_identity Q (K := K) (p := E.placement))) i) j - -noncomputable def inverseTwistIdentity (E : BasedComplex Q (K := K) I) (α : V) : - Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) - | .inl u, .inl v => projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inr (.inl u), .inr (.inl v) => projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inr (.inr (.inl u)), .inr (.inr (.inl v)) => - projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inl j))) => - projectiveIdentity Q E.placement i j - | .inr (.inr (.inr (.inr u))), .inr (.inr (.inr (.inr v))) => - projectiveIdentity Q (testPlacement Q E.placement α) u v - | _, _ => 0 - -omit [Fintype V] [DecidableEq A] in -lemma inverseTwistIdentity_eq (E : BasedComplex Q (K := K) I) (α : V) : - projectiveIdentity Q (K := K) (inverseTwistPlacement Q E α) = - inverseTwistIdentity Q E α := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals simp [projectiveIdentity, Matrix.diagonal_apply, - inverseTwistIdentity, inverseTwistPlacement, testPlacement] - -omit [DecidableEq A] in -lemma unitContraction_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q (testPlacement Q E.placement α) (testPlacement Q E.placement α) - (unitContraction Q E.placement α (K := K)) := by - constructor - · intro u v - dsimp only [unitContraction, testPlacement] - split_ifs <;> simp only [mul_smul, vertexId_mul_self, MulZeroClass.mul_zero] - · intro u v - dsimp only [unitContraction, testPlacement] - split_ifs <;> simp only [smul_mul, vertexId_mul_self, MulZeroClass.zero_mul] - -lemma testToken_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q (testPlacement Q E.placement α) (testPlacement Q E.placement α) - (testToken Q E.placement α (K := K)) := by - have hl : vertexId Q (K := K) α * tokenBasis Q α = tokenBasis Q α := by - simpa only [Path.source, pathBasis_token] using - (pathBasis_left Q (K := K) (.inr (.inr α))) - have hr : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - constructor - · intro u v - dsimp only [testToken, Matrix.diagonal_apply, testPlacement] - split_ifs <;> simp only [hl, MulZeroClass.mul_zero] - · intro u v - dsimp only [testToken, Matrix.diagonal_apply, testPlacement] - split_ifs <;> simp only [hr, MulZeroClass.zero_mul] - -lemma inverseTwist_sourceEquation (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - inverseTwistProjection Q E α * inverseTwistInjection Q E α = - projectiveIdentity Q (inverseTwistPlacement Q E α) + - (inverseTwistDifferential Q E α * inverseTwistHomotopy Q E α + - inverseTwistHomotopy Q E α * inverseTwistDifferential Q E α) := by - rw [inverseTwistIdentity_eq] - let t := testTransform Q E.placement E.placement α E.differential - let r := unitContraction Q E.placement α (K := K) - let θ := testToken Q E.placement α (K := K) - let ι := projectiveIdentity Q (K := K) (testPlacement Q E.placement α) - let e := evaluationMatrix Q E.placement α (K := K) - let η := projectiveIdentity Q (K := K) E.placement - let c := coevaluationMatrix Q E.placement α (K := K) - have hf : inverseTwistProjection Q E α = FiveBlock.projection e η := by - funext i j - rcases i with u | u | u | i | u <;> rfl - have hg : inverseTwistInjection Q E α = FiveBlock.injection c η := by - funext i j - rcases j with v | v | v | j | v <;> rfl - have hh : inverseTwistHomotopy Q E α = FiveBlock.homotopy ι := by - funext i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl - have hd : inverseTwistDifferential Q E α = - FiveBlock.differential t r θ ι e E.differential c := by - funext i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl - have hId : inverseTwistIdentity Q E α = FiveBlock.identity ι η := by - funext i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl - rw [hf, hg, hh, hd, hId] - apply FiveBlock.contraction - · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) - · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) - · exact projectiveIdentity_mul Q (E.testComplex Q α).entries - · exact mul_projectiveIdentity Q (E.testComplex Q α).entries - · exact projectiveIdentity_mul Q (unitContraction_entries Q E α) - · exact mul_projectiveIdentity Q (testToken_entries Q E α) - · exact projectiveIdentity_mul Q (evaluation_entries Q E.placement α) - · exact mul_projectiveIdentity Q (evaluation_entries Q E.placement α) - · exact mul_projectiveIdentity Q (coevaluation_entries Q E.placement α) - · exact projectiveIdentity_mul Q (coevaluation_entries Q E.placement α) - · exact evaluation_coevaluation Q hn E.placement α - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseTwistDifferential +import OAI.Topology.ArtinGroups.Complexes.InverseTwistPlacement +import OAI.Topology.ArtinGroups.Diagrams.Index + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +lemma inverseTwistProjection_commute (E : BasedComplex Q (K := K) I) (α : V) : + inverseTwistDifferential Q E α * inverseTwistProjection Q E α = + inverseTwistProjection Q E α * E.differential := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, inverseTwistDifferential, + inverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + Finset.sum_const_zero, _root_.neg_mul, Finset.sum_neg_distrib, add_zero, zero_add] + · exact (congrArg₂ (fun a b : Q.Zigzag K => -a + b) + (congrFun (congrFun (projectiveIdentity_mul Q + (evaluation_entries Q E.placement α)) u) j) + (congrFun (congrFun (mul_projectiveIdentity Q + (evaluation_entries Q E.placement α)) u) j)).trans (neg_add_cancel _) + · exact congrFun (congrFun (evaluation_natural Q α E.entries) u) j + · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans + (projectiveIdentity_mul Q E.entries).symm) i) j + +lemma inverseTwistInjection_commute (E : BasedComplex Q (K := K) I) (α : V) : + E.differential * inverseTwistInjection Q E α = + inverseTwistInjection Q E α * inverseTwistDifferential Q E α := by + apply Matrix.ext + intro i j + rcases j with u | u | u | j | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, inverseTwistDifferential, + inverseTwistInjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + Finset.sum_const_zero, _root_.neg_mul, _root_.mul_neg, Finset.sum_neg_distrib, + add_zero, zero_add, neg_zero] + · exact congrArg Neg.neg (congrFun (congrFun (coevaluation_natural Q α E.entries).symm i) u) + · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans + (projectiveIdentity_mul Q E.entries).symm) i) j + · exact ((congrArg₂ (fun a b : Q.Zigzag K => -a + b) + (congrFun (congrFun (mul_projectiveIdentity Q + (coevaluation_entries Q E.placement α)) i) u) + (congrFun (congrFun (projectiveIdentity_mul Q + (coevaluation_entries Q E.placement α)) i) u)).trans (neg_add_cancel _)).symm + +omit [DecidableEq A] in +lemma inverseTwist_targetEquation (E : BasedComplex Q (K := K) I) (α : V) : + inverseTwistInjection Q E α * inverseTwistProjection Q E α = + projectiveIdentity Q (K := K) E.placement := by + apply Matrix.ext + intro i j + simp only [Matrix.mul_apply, Fintype.sum_sum_type, inverseTwistInjection, + inverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + Finset.sum_const_zero, add_zero, zero_add] + exact congrFun (congrFun (projectiveIdentity_mul Q + (projectiveEntries_identity Q (K := K) (p := E.placement))) i) j + +noncomputable def inverseTwistIdentity (E : BasedComplex Q (K := K) I) (α : V) : + Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) + | .inl u, .inl v => projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inr (.inl u), .inr (.inl v) => projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inr (.inr (.inl u)), .inr (.inr (.inl v)) => + projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inl j))) => + projectiveIdentity Q E.placement i j + | .inr (.inr (.inr (.inr u))), .inr (.inr (.inr (.inr v))) => + projectiveIdentity Q (testPlacement Q E.placement α) u v + | _, _ => 0 + +omit [Fintype V] [DecidableEq A] in +lemma inverseTwistIdentity_eq (E : BasedComplex Q (K := K) I) (α : V) : + projectiveIdentity Q (K := K) (inverseTwistPlacement Q E α) = + inverseTwistIdentity Q E α := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals simp [projectiveIdentity, Matrix.diagonal_apply, + inverseTwistIdentity, inverseTwistPlacement, testPlacement] + +omit [DecidableEq A] in +lemma unitContraction_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q (testPlacement Q E.placement α) (testPlacement Q E.placement α) + (unitContraction Q E.placement α (K := K)) := by + constructor + · intro u v + dsimp only [unitContraction, testPlacement] + split_ifs <;> simp only [mul_smul, vertexId_mul_self, MulZeroClass.mul_zero] + · intro u v + dsimp only [unitContraction, testPlacement] + split_ifs <;> simp only [smul_mul, vertexId_mul_self, MulZeroClass.zero_mul] + +lemma testToken_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q (testPlacement Q E.placement α) (testPlacement Q E.placement α) + (testToken Q E.placement α (K := K)) := by + have hl : vertexId Q (K := K) α * tokenBasis Q α = tokenBasis Q α := by + simpa only [Path.source, pathBasis_token] using + (pathBasis_left Q (K := K) (.inr (.inr α))) + have hr : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + constructor + · intro u v + dsimp only [testToken, Matrix.diagonal_apply, testPlacement] + split_ifs <;> simp only [hl, MulZeroClass.mul_zero] + · intro u v + dsimp only [testToken, Matrix.diagonal_apply, testPlacement] + split_ifs <;> simp only [hr, MulZeroClass.zero_mul] + +lemma inverseTwist_sourceEquation (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + inverseTwistProjection Q E α * inverseTwistInjection Q E α = + projectiveIdentity Q (inverseTwistPlacement Q E α) + + (inverseTwistDifferential Q E α * inverseTwistHomotopy Q E α + + inverseTwistHomotopy Q E α * inverseTwistDifferential Q E α) := by + rw [inverseTwistIdentity_eq] + let t := testTransform Q E.placement E.placement α E.differential + let r := unitContraction Q E.placement α (K := K) + let θ := testToken Q E.placement α (K := K) + let ι := projectiveIdentity Q (K := K) (testPlacement Q E.placement α) + let e := evaluationMatrix Q E.placement α (K := K) + let η := projectiveIdentity Q (K := K) E.placement + let c := coevaluationMatrix Q E.placement α (K := K) + have hf : inverseTwistProjection Q E α = FiveBlock.projection e η := by + funext i j + rcases i with u | u | u | i | u <;> rfl + have hg : inverseTwistInjection Q E α = FiveBlock.injection c η := by + funext i j + rcases j with v | v | v | j | v <;> rfl + have hh : inverseTwistHomotopy Q E α = FiveBlock.homotopy ι := by + funext i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl + have hd : inverseTwistDifferential Q E α = + FiveBlock.differential t r θ ι e E.differential c := by + funext i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl + have hId : inverseTwistIdentity Q E α = FiveBlock.identity ι η := by + funext i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl + rw [hf, hg, hh, hd, hId] + apply FiveBlock.contraction + · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) + · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) + · exact projectiveIdentity_mul Q (E.testComplex Q α).entries + · exact mul_projectiveIdentity Q (E.testComplex Q α).entries + · exact projectiveIdentity_mul Q (unitContraction_entries Q E α) + · exact mul_projectiveIdentity Q (testToken_entries Q E α) + · exact projectiveIdentity_mul Q (evaluation_entries Q E.placement α) + · exact mul_projectiveIdentity Q (evaluation_entries Q E.placement α) + · exact mul_projectiveIdentity Q (coevaluation_entries Q E.placement α) + · exact projectiveIdentity_mul Q (coevaluation_entries Q E.placement α) + · exact evaluation_coevaluation Q hn E.placement α + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIndex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIndex.lean index 08ea36b8a5f5a25b762c95fa2adef3ad9be6d4ae..d9158245c9091080091a88c017bd8ce93a26d9b6 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIndex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistIndex.lean @@ -1,66 +1,66 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.CoconePlacement -import OAI.Topology.ArtinGroups.Quivers.SelfCornerEquiv -import OAI.Topology.ArtinGroups.Complexes.Reindex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] - -noncomputable instance testIndexDecidableEq (p : I → GeneratorPlacement V) (α : V) : - DecidableEq (TestIndex Q p α) := Classical.decEq _ - -abbrev InverseTwistIndex (E : BasedComplex Q (K := K) I) (α : V) := - TestIndex Q E.placement α ⊕ TestIndex Q E.placement α ⊕ - TestIndex Q E.placement α ⊕ I ⊕ TestIndex Q E.placement α - -noncomputable instance inverseTwistIndexDecidableEq - (E : BasedComplex Q (K := K) I) (α : V) : DecidableEq (InverseTwistIndex Q E α) := - Classical.decEq _ - -noncomputable def inverseTwistIndexEquiv (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - InverseTwistIndex Q E α ≃ - (TestIndex Q (E.negativeTwist Q α).placement α ⊕ (I ⊕ TestIndex Q E.placement α)) where - toFun - | .inl u => .inl ⟨.inl u.1, u.2⟩ - | .inr (.inl u) => .inl ⟨.inr u, selfCornerEquiv Q hn α false⟩ - | .inr (.inr (.inl u)) => .inl ⟨.inr u, selfCornerEquiv Q hn α true⟩ - | .inr (.inr (.inr (.inl i))) => .inr (.inl i) - | .inr (.inr (.inr (.inr u))) => .inr (.inr u) - invFun - | .inl ⟨.inl i, p⟩ => .inl ⟨i, p⟩ - | .inl ⟨.inr u, p⟩ => if (selfCornerEquiv Q hn α).symm p then - .inr (.inr (.inl u)) else .inr (.inl u) - | .inr (.inl i) => .inr (.inr (.inr (.inl i))) - | .inr (.inr u) => .inr (.inr (.inr (.inr u))) - left_inv u := by - rcases u with u | u | u | i | u <;> rfl - right_inv u := by - rcases u with ⟨i | u, p⟩ | i | u - · rfl - · have he := (selfCornerEquiv Q hn α).apply_symm_apply p - cases h : (selfCornerEquiv Q hn α).symm p - · simp only [h, Bool.false_eq_true, ↓reduceIte] - congr 2 - change (selfCornerEquiv Q hn α false : CornerPath Q α α) = p - simpa only [h] using he - · simp only [h, ↓reduceIte] - congr 2 - change (selfCornerEquiv Q hn α true : CornerPath Q α α) = p - simpa only [h] using he - · rfl - · rfl - -noncomputable def normalizedInverseTwist (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) (InverseTwistIndex Q E α) := - ((E.negativeTwist Q α).positiveTwist Q α).reindex Q (inverseTwistIndexEquiv Q hn E α) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.CoconePlacement +import OAI.Topology.ArtinGroups.Quivers.SelfCornerEquiv +import OAI.Topology.ArtinGroups.Complexes.Reindex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] + +noncomputable instance testIndexDecidableEq (p : I → GeneratorPlacement V) (α : V) : + DecidableEq (TestIndex Q p α) := Classical.decEq _ + +abbrev InverseTwistIndex (E : BasedComplex Q (K := K) I) (α : V) := + TestIndex Q E.placement α ⊕ TestIndex Q E.placement α ⊕ + TestIndex Q E.placement α ⊕ I ⊕ TestIndex Q E.placement α + +noncomputable instance inverseTwistIndexDecidableEq + (E : BasedComplex Q (K := K) I) (α : V) : DecidableEq (InverseTwistIndex Q E α) := + Classical.decEq _ + +noncomputable def inverseTwistIndexEquiv (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + InverseTwistIndex Q E α ≃ + (TestIndex Q (E.negativeTwist Q α).placement α ⊕ (I ⊕ TestIndex Q E.placement α)) where + toFun + | .inl u => .inl ⟨.inl u.1, u.2⟩ + | .inr (.inl u) => .inl ⟨.inr u, selfCornerEquiv Q hn α false⟩ + | .inr (.inr (.inl u)) => .inl ⟨.inr u, selfCornerEquiv Q hn α true⟩ + | .inr (.inr (.inr (.inl i))) => .inr (.inl i) + | .inr (.inr (.inr (.inr u))) => .inr (.inr u) + invFun + | .inl ⟨.inl i, p⟩ => .inl ⟨i, p⟩ + | .inl ⟨.inr u, p⟩ => if (selfCornerEquiv Q hn α).symm p then + .inr (.inr (.inl u)) else .inr (.inl u) + | .inr (.inl i) => .inr (.inr (.inr (.inl i))) + | .inr (.inr u) => .inr (.inr (.inr (.inr u))) + left_inv u := by + rcases u with u | u | u | i | u <;> rfl + right_inv u := by + rcases u with ⟨i | u, p⟩ | i | u + · rfl + · have he := (selfCornerEquiv Q hn α).apply_symm_apply p + cases h : (selfCornerEquiv Q hn α).symm p + · simp only [h, Bool.false_eq_true, ↓reduceIte] + congr 2 + change (selfCornerEquiv Q hn α false : CornerPath Q α α) = p + simpa only [h] using he + · simp only [h, ↓reduceIte] + congr 2 + change (selfCornerEquiv Q hn α true : CornerPath Q α α) = p + simpa only [h] using he + · rfl + · rfl + +noncomputable def normalizedInverseTwist (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) (InverseTwistIndex Q E α) := + ((E.negativeTwist Q α).positiveTwist Q α).reindex Q (inverseTwistIndexEquiv Q hn E α) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistMap.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistMap.lean index f75eb93ae2489440790aa2177179e2c88cf90c40..15af2c5f50ebe17a412993d743b0c00150feef8f 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistMap.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistMap.lean @@ -1,107 +1,107 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ConeMap -import OAI.Topology.ArtinGroups.Complexes.ReverseTwistIndexEquiv - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -noncomputable def inverseTwistMap {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) (α : V) : - Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q F α) (Q.Zigzag K) := - Matrix.fromBlocks (testTransform Q E.placement F.placement α f.matrix) 0 0 - (Matrix.fromBlocks (testTransform Q E.placement F.placement α f.matrix) 0 0 - (Matrix.fromBlocks (testTransform Q E.placement F.placement α f.matrix) 0 0 - (Matrix.fromBlocks f.matrix 0 0 - (testTransform Q E.placement F.placement α f.matrix)))) - -omit [DecidableEq I] [DecidableEq J] in -lemma inverseTwistMap_normalized (hn : ∀ a, Q.source a ≠ Q.target a) - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : Map Q E F) (α : V) : - ((f.negativeTwist Q α).positiveTwist Q α).matrix.submatrix - (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α) = - inverseTwistMap Q f α := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals simp only [Matrix.submatrix_apply, inverseTwistIndexEquiv, Equiv.coe_fn_mk, - inverseTwistMap, Map.positiveTwist, Map.negativeTwist, Map.coneMap, - Map.coconeMap, Map.test, Map.cotest, Matrix.fromBlocks, - testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - coordinates_zero, zero_smul, selfCornerEquiv_false, selfCornerEquiv_true] - all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token] - all_goals ( - have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] - simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, Pi.zero_apply, - _root_.mul_one, MulZeroClass.mul_zero]) - all_goals exact zero_smul K _ - -omit [DecidableEq I] [DecidableEq J] in -lemma reverseTwistMap_normalized (hn : ∀ a, Q.source a ≠ Q.target a) - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : Map Q E F) (α : V) : - ((f.positiveTwist Q α).negativeTwist Q α).matrix.submatrix - (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α) = - inverseTwistMap Q f α := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals simp only [Matrix.submatrix_apply, reverseTwistIndexEquiv, Equiv.coe_fn_mk, - inverseTwistMap, Map.positiveTwist, Map.negativeTwist, Map.coneMap, - Map.coconeMap, Map.test, Map.cotest, Matrix.fromBlocks, - testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - coordinates_zero, zero_smul, selfCornerEquiv_false, selfCornerEquiv_true] - all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token] - all_goals ( - have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] - simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, Pi.zero_apply, - _root_.mul_one, MulZeroClass.mul_zero]) - all_goals exact zero_smul K _ - -lemma inverseTwistProjection_natural {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) (α : V) : - inverseTwistMap Q f α * inverseTwistProjection Q F α = - inverseTwistProjection Q E α * f.matrix := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, - inverseTwistMap, inverseTwistProjection, Matrix.fromBlocks, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero] - · exact congrArg (fun a => a u j) (evaluation_natural Q α f.entries) - · exact congrArg (fun a => a i j) - ((projectiveIdentity_mul Q f.entries).trans (mul_projectiveIdentity Q f.entries).symm).symm - -lemma inverseTwistInjection_natural {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) (α : V) : - f.matrix * inverseTwistInjection Q F α = - inverseTwistInjection Q E α * inverseTwistMap Q f α := by - apply Matrix.ext - intro i j - rcases j with u | u | u | j | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, - inverseTwistMap, inverseTwistInjection, Matrix.fromBlocks, Matrix.of_apply, - Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, - MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero, mul_neg, neg_mul, - Finset.sum_neg_distrib] - · exact congrArg (fun a => -a i u) (coevaluation_natural Q α f.entries).symm - · exact congrArg (fun a => a i j) - ((mul_projectiveIdentity Q f.entries).trans (projectiveIdentity_mul Q f.entries).symm) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ConeMap +import OAI.Topology.ArtinGroups.Complexes.ReverseTwistIndexEquiv + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +noncomputable def inverseTwistMap {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) (α : V) : + Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q F α) (Q.Zigzag K) := + Matrix.fromBlocks (testTransform Q E.placement F.placement α f.matrix) 0 0 + (Matrix.fromBlocks (testTransform Q E.placement F.placement α f.matrix) 0 0 + (Matrix.fromBlocks (testTransform Q E.placement F.placement α f.matrix) 0 0 + (Matrix.fromBlocks f.matrix 0 0 + (testTransform Q E.placement F.placement α f.matrix)))) + +omit [DecidableEq I] [DecidableEq J] in +lemma inverseTwistMap_normalized (hn : ∀ a, Q.source a ≠ Q.target a) + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : Map Q E F) (α : V) : + ((f.negativeTwist Q α).positiveTwist Q α).matrix.submatrix + (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α) = + inverseTwistMap Q f α := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals simp only [Matrix.submatrix_apply, inverseTwistIndexEquiv, Equiv.coe_fn_mk, + inverseTwistMap, Map.positiveTwist, Map.negativeTwist, Map.coneMap, + Map.coconeMap, Map.test, Map.cotest, Matrix.fromBlocks, + testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + coordinates_zero, zero_smul, selfCornerEquiv_false, selfCornerEquiv_true] + all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token] + all_goals ( + have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] + simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, Pi.zero_apply, + _root_.mul_one, MulZeroClass.mul_zero]) + all_goals exact zero_smul K _ + +omit [DecidableEq I] [DecidableEq J] in +lemma reverseTwistMap_normalized (hn : ∀ a, Q.source a ≠ Q.target a) + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : Map Q E F) (α : V) : + ((f.positiveTwist Q α).negativeTwist Q α).matrix.submatrix + (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α) = + inverseTwistMap Q f α := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals simp only [Matrix.submatrix_apply, reverseTwistIndexEquiv, Equiv.coe_fn_mk, + inverseTwistMap, Map.positiveTwist, Map.negativeTwist, Map.coneMap, + Map.coconeMap, Map.test, Map.cotest, Matrix.fromBlocks, + testTransform, scalarCornerMatrix, testMatrix, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + coordinates_zero, zero_smul, selfCornerEquiv_false, selfCornerEquiv_true] + all_goals simp only [mul_smul, coordinates_smul, pathBasis_vertex, pathBasis_token] + all_goals ( + have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + simp only [vertexId_mul_self, ht, pathCoordinates_vertex, pathCoordinates_token] + simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, Pi.zero_apply, + _root_.mul_one, MulZeroClass.mul_zero]) + all_goals exact zero_smul K _ + +lemma inverseTwistProjection_natural {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) (α : V) : + inverseTwistMap Q f α * inverseTwistProjection Q F α = + inverseTwistProjection Q E α * f.matrix := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, + inverseTwistMap, inverseTwistProjection, Matrix.fromBlocks, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero] + · exact congrArg (fun a => a u j) (evaluation_natural Q α f.entries) + · exact congrArg (fun a => a i j) + ((projectiveIdentity_mul Q f.entries).trans (mul_projectiveIdentity Q f.entries).symm).symm + +lemma inverseTwistInjection_natural {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) (α : V) : + f.matrix * inverseTwistInjection Q F α = + inverseTwistInjection Q E α * inverseTwistMap Q f α := by + apply Matrix.ext + intro i j + rcases j with u | u | u | j | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, + inverseTwistMap, inverseTwistInjection, Matrix.fromBlocks, Matrix.of_apply, + Matrix.zero_apply, Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, + MulZeroClass.zero_mul, Finset.sum_const_zero, zero_add, add_zero, mul_neg, neg_mul, + Finset.sum_neg_distrib] + · exact congrArg (fun a => -a i u) (coevaluation_natural Q α f.entries).symm + · exact congrArg (fun a => a i j) + ((mul_projectiveIdentity Q f.entries).trans (projectiveIdentity_mul Q f.entries).symm) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistPlacement.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistPlacement.lean index d668020a4135852b17a0c9643fcd54f153a9f1ba..83d9c1d3689598463ca93e07abe4286b6b5a335b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistPlacement.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseTwistPlacement.lean @@ -1,179 +1,179 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseTwistIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -def inverseTwistPlacement (E : BasedComplex Q (K := K) I) (α : V) : - InverseTwistIndex Q E α → GeneratorPlacement V - | .inl u => ⟨α, (E.placement u.1).cochain - 1, - (E.placement u.1).internal + Path.length u.2.val⟩ - | .inr (.inl u) => ⟨α, (E.placement u.1).cochain, - (E.placement u.1).internal + Path.length u.2.val - 2⟩ - | .inr (.inr (.inl u)) => testPlacement Q E.placement α u - | .inr (.inr (.inr (.inl i))) => E.placement i - | .inr (.inr (.inr (.inr u))) => ⟨α, (E.placement u.1).cochain + 1, - (E.placement u.1).internal + Path.length u.2.val - 2⟩ - -omit [DecidableEq I] in -lemma normalizedInverseTwist_placement (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - (normalizedInverseTwist Q hn E α).placement = inverseTwistPlacement Q E α := by - funext i - rcases i with u | u | u | i | u - · rfl - · change (⟨α, (E.placement u.1).cochain + 1 - 1, - (E.placement u.1).internal + Path.length u.2.val - 2 + 0⟩ : GeneratorPlacement V) = _ - simp only [add_sub_cancel_right, add_zero] - rfl - · change (⟨α, (E.placement u.1).cochain + 1 - 1, - (E.placement u.1).internal + Path.length u.2.val - 2 + 2⟩ : GeneratorPlacement V) = _ - simp only [add_sub_cancel_right, sub_add_cancel] - rfl - · rfl - · rfl - -noncomputable def inverseTwistProjection (E : BasedComplex Q (K := K) I) (α : V) : - Matrix (InverseTwistIndex Q E α) I (Q.Zigzag K) - | .inr (.inr (.inl u)), j => evaluationMatrix Q E.placement α u j - | .inr (.inr (.inr (.inl i))), j => projectiveIdentity Q E.placement i j - | _, _ => 0 - -noncomputable def inverseTwistInjection (E : BasedComplex Q (K := K) I) (α : V) : - Matrix I (InverseTwistIndex Q E α) (Q.Zigzag K) - | i, .inr (.inl u) => -coevaluationMatrix Q E.placement α i u - | i, .inr (.inr (.inr (.inl j))) => projectiveIdentity Q E.placement i j - | _, _ => 0 - -noncomputable def inverseTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) : - Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) - | .inr (.inr (.inl u)), .inl v => projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inr (.inr (.inr (.inr u))), .inr (.inl v) => - -projectiveIdentity Q (testPlacement Q E.placement α) u v - | _, _ => 0 - -lemma inverseTwistProjection_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q (inverseTwistPlacement Q E α) E.placement - (inverseTwistProjection Q E α) := by - constructor - · intro i j - rcases i with u | u | u | i | u - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact (evaluation_entries Q E.placement α).1 u j - · exact (projectiveEntries_identity Q).1 i j - · exact MulZeroClass.mul_zero _ - · intro i j - rcases i with u | u | u | i | u - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact (evaluation_entries Q E.placement α).2 u j - · exact (projectiveEntries_identity Q).2 i j - · exact MulZeroClass.zero_mul _ - -lemma inverseTwistProjection_degree (E : BasedComplex Q (K := K) I) (α : V) : - MapDegree Q (inverseTwistPlacement Q E α) E.placement 0 0 - (inverseTwistProjection Q E α) := by - intro i j - rcases i with u | u | u | i | u - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact evaluation_degree Q E.placement α u j - · exact mapDegree_identity Q i j - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - -lemma inverseTwistInjection_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q E.placement (inverseTwistPlacement Q E α) - (inverseTwistInjection Q E α) := by - constructor - · intro i j - rcases j with u | u | u | j | u - · exact MulZeroClass.mul_zero _ - · exact (projectiveEntries_neg Q (coevaluation_entries Q E.placement α)).1 i u - · exact MulZeroClass.mul_zero _ - · exact (projectiveEntries_identity Q).1 i j - · exact MulZeroClass.mul_zero _ - · intro i j - rcases j with u | u | u | j | u - · exact MulZeroClass.zero_mul _ - · exact (projectiveEntries_neg Q (coevaluation_entries Q E.placement α)).2 i u - · exact MulZeroClass.zero_mul _ - · exact (projectiveEntries_identity Q).2 i j - · exact MulZeroClass.zero_mul _ - -lemma inverseTwistInjection_degree (E : BasedComplex Q (K := K) I) (α : V) : - MapDegree Q E.placement (inverseTwistPlacement Q E α) 0 0 - (inverseTwistInjection Q E α) := by - intro i j - rcases j with u | u | u | j | u - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact mapDegree_neg Q (coevaluation_degree Q E.placement α) i u - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact mapDegree_identity Q i j - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - -omit [Fintype V] in -omit [DecidableEq A] [DecidableEq I] in -lemma inverseTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) - (inverseTwistHomotopy Q E α) := by - constructor - · intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals first - | exact MulZeroClass.mul_zero _ - | exact (projectiveEntries_identity Q (K := K) - (p := testPlacement Q E.placement α)).1 u v - | exact (projectiveEntries_neg Q (projectiveEntries_identity Q (K := K) - (p := testPlacement Q E.placement α))).1 u v - · intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals first - | exact MulZeroClass.zero_mul _ - | exact (projectiveEntries_identity Q (K := K) - (p := testPlacement Q E.placement α)).2 u v - | exact (projectiveEntries_neg Q (projectiveEntries_identity Q (K := K) - (p := testPlacement Q E.placement α))).2 u v - -omit [Fintype V] in -omit [DecidableEq A] [DecidableEq I] in -lemma inverseTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) : - MapDegree Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) (-1) 0 - (inverseTwistHomotopy Q E α) := by - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals try exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · by_cases h : u = v - · subst v - simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_true] - constructor - · intro hc - apply (hc _).elim - dsimp only [inverseTwistPlacement, testPlacement] - omega - · convert homogeneous_vertexId Q (K := K) α using 1 <;> - simp [inverseTwistPlacement, testPlacement] - · simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_eq_right h] - exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · by_cases h : u = v - · subst v - simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_true] - constructor - · intro hc - apply (hc _).elim - dsimp only [inverseTwistPlacement, testPlacement] - omega - · convert homogeneous_neg Q (homogeneous_vertexId Q (K := K) α) using 1 <;> - simp [inverseTwistPlacement, testPlacement] - · simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_eq_right h, - neg_zero] - exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseTwistIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +def inverseTwistPlacement (E : BasedComplex Q (K := K) I) (α : V) : + InverseTwistIndex Q E α → GeneratorPlacement V + | .inl u => ⟨α, (E.placement u.1).cochain - 1, + (E.placement u.1).internal + Path.length u.2.val⟩ + | .inr (.inl u) => ⟨α, (E.placement u.1).cochain, + (E.placement u.1).internal + Path.length u.2.val - 2⟩ + | .inr (.inr (.inl u)) => testPlacement Q E.placement α u + | .inr (.inr (.inr (.inl i))) => E.placement i + | .inr (.inr (.inr (.inr u))) => ⟨α, (E.placement u.1).cochain + 1, + (E.placement u.1).internal + Path.length u.2.val - 2⟩ + +omit [DecidableEq I] in +lemma normalizedInverseTwist_placement (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + (normalizedInverseTwist Q hn E α).placement = inverseTwistPlacement Q E α := by + funext i + rcases i with u | u | u | i | u + · rfl + · change (⟨α, (E.placement u.1).cochain + 1 - 1, + (E.placement u.1).internal + Path.length u.2.val - 2 + 0⟩ : GeneratorPlacement V) = _ + simp only [add_sub_cancel_right, add_zero] + rfl + · change (⟨α, (E.placement u.1).cochain + 1 - 1, + (E.placement u.1).internal + Path.length u.2.val - 2 + 2⟩ : GeneratorPlacement V) = _ + simp only [add_sub_cancel_right, sub_add_cancel] + rfl + · rfl + · rfl + +noncomputable def inverseTwistProjection (E : BasedComplex Q (K := K) I) (α : V) : + Matrix (InverseTwistIndex Q E α) I (Q.Zigzag K) + | .inr (.inr (.inl u)), j => evaluationMatrix Q E.placement α u j + | .inr (.inr (.inr (.inl i))), j => projectiveIdentity Q E.placement i j + | _, _ => 0 + +noncomputable def inverseTwistInjection (E : BasedComplex Q (K := K) I) (α : V) : + Matrix I (InverseTwistIndex Q E α) (Q.Zigzag K) + | i, .inr (.inl u) => -coevaluationMatrix Q E.placement α i u + | i, .inr (.inr (.inr (.inl j))) => projectiveIdentity Q E.placement i j + | _, _ => 0 + +noncomputable def inverseTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) : + Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) + | .inr (.inr (.inl u)), .inl v => projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inr (.inr (.inr (.inr u))), .inr (.inl v) => + -projectiveIdentity Q (testPlacement Q E.placement α) u v + | _, _ => 0 + +lemma inverseTwistProjection_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q (inverseTwistPlacement Q E α) E.placement + (inverseTwistProjection Q E α) := by + constructor + · intro i j + rcases i with u | u | u | i | u + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact (evaluation_entries Q E.placement α).1 u j + · exact (projectiveEntries_identity Q).1 i j + · exact MulZeroClass.mul_zero _ + · intro i j + rcases i with u | u | u | i | u + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact (evaluation_entries Q E.placement α).2 u j + · exact (projectiveEntries_identity Q).2 i j + · exact MulZeroClass.zero_mul _ + +lemma inverseTwistProjection_degree (E : BasedComplex Q (K := K) I) (α : V) : + MapDegree Q (inverseTwistPlacement Q E α) E.placement 0 0 + (inverseTwistProjection Q E α) := by + intro i j + rcases i with u | u | u | i | u + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact evaluation_degree Q E.placement α u j + · exact mapDegree_identity Q i j + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + +lemma inverseTwistInjection_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q E.placement (inverseTwistPlacement Q E α) + (inverseTwistInjection Q E α) := by + constructor + · intro i j + rcases j with u | u | u | j | u + · exact MulZeroClass.mul_zero _ + · exact (projectiveEntries_neg Q (coevaluation_entries Q E.placement α)).1 i u + · exact MulZeroClass.mul_zero _ + · exact (projectiveEntries_identity Q).1 i j + · exact MulZeroClass.mul_zero _ + · intro i j + rcases j with u | u | u | j | u + · exact MulZeroClass.zero_mul _ + · exact (projectiveEntries_neg Q (coevaluation_entries Q E.placement α)).2 i u + · exact MulZeroClass.zero_mul _ + · exact (projectiveEntries_identity Q).2 i j + · exact MulZeroClass.zero_mul _ + +lemma inverseTwistInjection_degree (E : BasedComplex Q (K := K) I) (α : V) : + MapDegree Q E.placement (inverseTwistPlacement Q E α) 0 0 + (inverseTwistInjection Q E α) := by + intro i j + rcases j with u | u | u | j | u + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact mapDegree_neg Q (coevaluation_degree Q E.placement α) i u + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact mapDegree_identity Q i j + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + +omit [Fintype V] in +omit [DecidableEq A] [DecidableEq I] in +lemma inverseTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) + (inverseTwistHomotopy Q E α) := by + constructor + · intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals first + | exact MulZeroClass.mul_zero _ + | exact (projectiveEntries_identity Q (K := K) + (p := testPlacement Q E.placement α)).1 u v + | exact (projectiveEntries_neg Q (projectiveEntries_identity Q (K := K) + (p := testPlacement Q E.placement α))).1 u v + · intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals first + | exact MulZeroClass.zero_mul _ + | exact (projectiveEntries_identity Q (K := K) + (p := testPlacement Q E.placement α)).2 u v + | exact (projectiveEntries_neg Q (projectiveEntries_identity Q (K := K) + (p := testPlacement Q E.placement α))).2 u v + +omit [Fintype V] in +omit [DecidableEq A] [DecidableEq I] in +lemma inverseTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) : + MapDegree Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) (-1) 0 + (inverseTwistHomotopy Q E α) := by + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals try exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · by_cases h : u = v + · subst v + simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_true] + constructor + · intro hc + apply (hc _).elim + dsimp only [inverseTwistPlacement, testPlacement] + omega + · convert homogeneous_vertexId Q (K := K) α using 1 <;> + simp [inverseTwistPlacement, testPlacement] + · simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_eq_right h] + exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · by_cases h : u = v + · subst v + simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_true] + constructor + · intro hc + apply (hc _).elim + dsimp only [inverseTwistPlacement, testPlacement] + omega + · convert homogeneous_neg Q (homogeneous_vertexId Q (K := K) α) using 1 <;> + simp [inverseTwistPlacement, testPlacement] + · simp only [inverseTwistHomotopy, projectiveIdentity, Matrix.diagonal_apply, ite_eq_right h, + neg_zero] + exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordAction.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordAction.lean index c4792c63898a0bb4c473f4db3bfa6e54d73ea2c7..02f42d37d19788f0b0b946d4247f10a550b9a1b3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordAction.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordAction.lean @@ -1,107 +1,107 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveWordLowerBound -import OAI.Topology.ArtinGroups.Complexes.PlacedProjective - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -lemma negativeTwist_upper_bound - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - {d:ℤ} (hE:∀ i,(E.placement i).level≤d) (α:V) (hF:F.IsMinimal Q) - (e:HomotopyEquivalence Q (E.negativeTwist Q α) F) : - ∀ j,(F.placement j).level≤d := by - have reduction : HomotopyEquivalence Q (E.negativeTwist Q α) - (reducedNegativeAmplitudeTwist Q E α) := by - convert negativeAmplitudeTwistReduction Q E α using 1 - apply minimal_bound_transport Q (reducedNegativeAmplitudeTwist Q E α) F hF - ((reduction.symm Q).trans Q e) (fun p=>p.level≤d) - intro k - obtain ⟨i,hi⟩:=reducedNegativeAmplitudeTwist_level Q E α k - have hh:=hE i - rcases hi with hi|⟨hi,_⟩ <;> omega - -lemma classNegativeTwist_upper_bound (α:V) (x:FiniteHomotopyClass Q (K:=K)) - {d:ℤ} (hx:ClassUpperBound Q d x) : ClassUpperBound Q d (classNegativeTwist Q α x) := by - let E:=minimalClassModel Q x - let y:=classNegativeTwist Q α x - let F:=minimalClassModel Q y - have he:classOfComplex Q (E.complex.negativeTwist Q α)=classOfComplex Q F.complex := by - change classNegativeTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex - have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x - have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y - rw [hE,hF] - obtain ⟨e⟩:=Quotient.exact he - exact negativeTwist_upper_bound Q E.complex F.complex hx α (minimalClassModel_minimal Q y) e - -noncomputable def inverseWordAction : List V→FiniteHomotopyClass Q (K:=K)→FiniteHomotopyClass Q (K:=K) - | [],x=>x - | α::w,x=>inverseWordAction w (classNegativeTwist Q α x) - -lemma positive_inverseWord (hn:∀ a,Q.source a≠Q.target a) - (w:List V) (x:FiniteHomotopyClass Q (K:=K)) : - positiveWordAction Q w (inverseWordAction Q w x)=x := by - induction w generalizing x with - | nil => rfl - | cons α w ih => - change classPositiveTwist Q α (positiveWordAction Q w - (inverseWordAction Q w (classNegativeTwist Q α x)))=x - rw [ih] - exact (classTwistPerm Q hn α).apply_symm_apply x - -lemma inverse_positiveWord (hn:∀ a,Q.source a≠Q.target a) - (w:List V) (x:FiniteHomotopyClass Q (K:=K)) : - inverseWordAction Q w (positiveWordAction Q w x)=x := by - induction w generalizing x with - | nil => rfl - | cons α w ih => - change inverseWordAction Q w ((classTwistPerm Q hn α).symm - ((classTwistPerm Q hn α) (positiveWordAction Q w x)))=x - rw [Equiv.symm_apply_apply,ih] - -lemma positiveWord_homDimension (hn:∀ a,Q.source a≠Q.target a) - (w:List V) (x y:FiniteHomotopyClass Q (K:=K)) (n v:ℤ) : - classHomDimension Q n v (positiveWordAction Q w x) (positiveWordAction Q w y)= - classHomDimension Q n v x y := by - induction w with - | nil => rfl - | cons α w ih => - change classHomDimension Q n v (classPositiveTwist Q α _) (classPositiveTwist Q α _)=_ - rw [classPositiveTwist_homDimension Q hn,ih] - -lemma inverseWord_upper_bound (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - {d:ℤ} (hx:ClassUpperBound Q d x) : ClassUpperBound Q d (inverseWordAction Q w x) := by - induction w generalizing x with - | nil => exact hx - | cons α w ih => exact ih _ (classNegativeTwist_upper_bound Q α x hx) - -theorem inverseReducedWord_layer_bounds (hn:∀ a,Q.source a≠Q.target a) - (U:Set V) - (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) - (x:FiniteHomotopyClass Q (K:=K)) (a b:ℤ) - (hlo:ClassLowerBound Q a x) (hhi:ClassUpperBound Q b x) - (w:List V) (hw:∀ s∈w,s∈U) - (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : - ClassLowerBound Q (a-1) (inverseWordAction Q w x) ∧ - ClassUpperBound Q b (inverseWordAction Q w x) := by - refine ⟨?_,inverseWord_upper_bound Q w x hhi⟩ - apply classLowerBound_of_placed_vanishing Q _ (a-1) - intro p hp - let P:=classOfComplex Q (placedProjective Q (K:=K) p) - have hPlo:ClassLowerBound Q p.level P := - classLowerBound_of_representative Q _ (fun _=>le_rfl) - have hPhi:ClassUpperBound Q p.level P := - classUpperBound_of_representative Q _ (fun _=>le_rfl) - have hcap:ClassUpperBound Q (p.level+1) (positiveWordAction Q w P) := - (reducedWord_layer_bounds Q hn U hU P p.level p.level hPlo hPhi w hw hr).2 - rw [← positiveWord_homDimension Q hn w P (inverseWordAction Q w x) 0 0, - positive_inverseWord Q hn] - exact classHomDimension_zero_of_layer_gap Q _ x (p.level+1) a hcap hlo (by omega) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveWordLowerBound +import OAI.Topology.ArtinGroups.Complexes.PlacedProjective + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +lemma negativeTwist_upper_bound + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + {d:ℤ} (hE:∀ i,(E.placement i).level≤d) (α:V) (hF:F.IsMinimal Q) + (e:HomotopyEquivalence Q (E.negativeTwist Q α) F) : + ∀ j,(F.placement j).level≤d := by + have reduction : HomotopyEquivalence Q (E.negativeTwist Q α) + (reducedNegativeAmplitudeTwist Q E α) := by + convert negativeAmplitudeTwistReduction Q E α using 1 + apply minimal_bound_transport Q (reducedNegativeAmplitudeTwist Q E α) F hF + ((reduction.symm Q).trans Q e) (fun p=>p.level≤d) + intro k + obtain ⟨i,hi⟩:=reducedNegativeAmplitudeTwist_level Q E α k + have hh:=hE i + rcases hi with hi|⟨hi,_⟩ <;> omega + +lemma classNegativeTwist_upper_bound (α:V) (x:FiniteHomotopyClass Q (K:=K)) + {d:ℤ} (hx:ClassUpperBound Q d x) : ClassUpperBound Q d (classNegativeTwist Q α x) := by + let E:=minimalClassModel Q x + let y:=classNegativeTwist Q α x + let F:=minimalClassModel Q y + have he:classOfComplex Q (E.complex.negativeTwist Q α)=classOfComplex Q F.complex := by + change classNegativeTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex + have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x + have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y + rw [hE,hF] + obtain ⟨e⟩:=Quotient.exact he + exact negativeTwist_upper_bound Q E.complex F.complex hx α (minimalClassModel_minimal Q y) e + +noncomputable def inverseWordAction : List V→FiniteHomotopyClass Q (K:=K)→FiniteHomotopyClass Q (K:=K) + | [],x=>x + | α::w,x=>inverseWordAction w (classNegativeTwist Q α x) + +lemma positive_inverseWord (hn:∀ a,Q.source a≠Q.target a) + (w:List V) (x:FiniteHomotopyClass Q (K:=K)) : + positiveWordAction Q w (inverseWordAction Q w x)=x := by + induction w generalizing x with + | nil => rfl + | cons α w ih => + change classPositiveTwist Q α (positiveWordAction Q w + (inverseWordAction Q w (classNegativeTwist Q α x)))=x + rw [ih] + exact (classTwistPerm Q hn α).apply_symm_apply x + +lemma inverse_positiveWord (hn:∀ a,Q.source a≠Q.target a) + (w:List V) (x:FiniteHomotopyClass Q (K:=K)) : + inverseWordAction Q w (positiveWordAction Q w x)=x := by + induction w generalizing x with + | nil => rfl + | cons α w ih => + change inverseWordAction Q w ((classTwistPerm Q hn α).symm + ((classTwistPerm Q hn α) (positiveWordAction Q w x)))=x + rw [Equiv.symm_apply_apply,ih] + +lemma positiveWord_homDimension (hn:∀ a,Q.source a≠Q.target a) + (w:List V) (x y:FiniteHomotopyClass Q (K:=K)) (n v:ℤ) : + classHomDimension Q n v (positiveWordAction Q w x) (positiveWordAction Q w y)= + classHomDimension Q n v x y := by + induction w with + | nil => rfl + | cons α w ih => + change classHomDimension Q n v (classPositiveTwist Q α _) (classPositiveTwist Q α _)=_ + rw [classPositiveTwist_homDimension Q hn,ih] + +lemma inverseWord_upper_bound (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + {d:ℤ} (hx:ClassUpperBound Q d x) : ClassUpperBound Q d (inverseWordAction Q w x) := by + induction w generalizing x with + | nil => exact hx + | cons α w ih => exact ih _ (classNegativeTwist_upper_bound Q α x hx) + +theorem inverseReducedWord_layer_bounds (hn:∀ a,Q.source a≠Q.target a) + (U:Set V) + (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) + (x:FiniteHomotopyClass Q (K:=K)) (a b:ℤ) + (hlo:ClassLowerBound Q a x) (hhi:ClassUpperBound Q b x) + (w:List V) (hw:∀ s∈w,s∈U) + (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : + ClassLowerBound Q (a-1) (inverseWordAction Q w x) ∧ + ClassUpperBound Q b (inverseWordAction Q w x) := by + refine ⟨?_,inverseWord_upper_bound Q w x hhi⟩ + apply classLowerBound_of_placed_vanishing Q _ (a-1) + intro p hp + let P:=classOfComplex Q (placedProjective Q (K:=K) p) + have hPlo:ClassLowerBound Q p.level P := + classLowerBound_of_representative Q _ (fun _=>le_rfl) + have hPhi:ClassUpperBound Q p.level P := + classUpperBound_of_representative Q _ (fun _=>le_rfl) + have hcap:ClassUpperBound Q (p.level+1) (positiveWordAction Q w P) := + (reducedWord_layer_bounds Q hn U hU P p.level p.level hPlo hPhi w hw hr).2 + rw [← positiveWord_homDimension Q hn w P (inverseWordAction Q w x) 0 0, + positive_inverseWord Q hn] + exact classHomDimension_zero_of_layer_gap Q _ x (p.level+1) a hcap hlo (by omega) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordActionAppend.lean b/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordActionAppend.lean index f205b5d118aaeb40cebbd99c758b5a2b0d682c0f..af0857e79fb936d2a08e2c292162f14928ceec24 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordActionAppend.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/InverseWordActionAppend.lean @@ -1,88 +1,88 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Coxeter.ReducedWordProperty -import OAI.Topology.ArtinGroups.Complexes.PacketPermEnumeration -import OAI.Topology.ArtinGroups.Coxeter.AltListMap -import OAI.Topology.ArtinGroups.Coxeter.OrdinaryTwistBraid -import OAI.Topology.ArtinGroups.Complexes.HighestLocalGeneratorTest - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u v -open CoxeterExchange - -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn : ∀ a,Q.source a≠Q.target a) - -lemma inverseWordAction_append (w v : List V) (x : FiniteHomotopyClass Q (K:=K)) : - inverseWordAction Q (w++v) x=inverseWordAction Q v (inverseWordAction Q w x) := by - induction w generalizing x with - | nil => rfl - | cons α w ih => exact ih (classNegativeTwist Q α x) - -include hn in -lemma inverseWordAction_eq_of_positive (w v : List V) - (h : ∀ x : FiniteHomotopyClass Q (K:=K),positiveWordAction Q w x=positiveWordAction Q v x) - (x : FiniteHomotopyClass Q (K:=K)) : - inverseWordAction Q w x=inverseWordAction Q v x := by - calc - inverseWordAction Q w x= - inverseWordAction Q w (positiveWordAction Q v (inverseWordAction Q v x)) := by - rw [positive_inverseWord Q hn] - _=inverseWordAction Q w (positiveWordAction Q w (inverseWordAction Q v x)) := by rw [h] - _=inverseWordAction Q v x := inverse_positiveWord Q hn w _ - -variable {T : Type v} [Fintype T] [DecidableEq T] (C : CoxeterMatrix T) (ι : T → V) - (hmat : ∀ α β,ordinaryCoxeterMatrix Q (ι α) (ι β)=C α β) - -include hn hmat - -lemma mapped_inverseWord_property (w v : List T) - (hw : C.toCoxeterSystem.IsReduced w) (hv : C.toCoxeterSystem.IsReduced v) - (he : C.toCoxeterSystem.wordProd w=C.toCoxeterSystem.wordProd v) - (x : FiniteHomotopyClass Q (K:=K)) : - inverseWordAction Q (w.map ι) x=inverseWordAction Q (v.map ι) x := by - apply inverseWordAction_eq_of_positive Q hn - intro y - have hb : ∀ α β,((altList α β (C α β)).map (fun α=>classTwistPerm Q (K:=K) hn (ι α))).prod= - ((altList β α (C α β)).map (fun α=>classTwistPerm Q (K:=K) hn (ι α))).prod := by - intro α β - have hh:=ordinaryTwist_braid Q (K:=K) hn (ι α) (ι β) - rw [hmat] at hh - simpa only [← altList_map,List.map_map,Function.comp_def] using hh - have hh:=reduced_word_property C.toCoxeterSystem (fun α=>classTwistPerm Q (K:=K) hn (ι α)) - hb w v hw hv he - rw [positiveWordAction_eq_prod Q hn,positiveWordAction_eq_prod Q hn] - simpa only [List.map_map,Function.comp_def] using - congrArg (fun f : Equiv.Perm (FiniteHomotopyClass Q (K:=K))=>f y) hh - -theorem longest_inverseWord_testUpper (w : List T) - (hw : C.toCoxeterSystem.IsReduced w) - (hd : ∀ α,C.toCoxeterSystem.length (C.toCoxeterSystem.wordProd w*C.toCoxeterSystem.simple α)+1= - C.toCoxeterSystem.length (C.toCoxeterSystem.wordProd w)) - (x : FiniteHomotopyClass Q (K:=K)) (t : ℤ) - (hx : ClassTestUpper Q x (Set.range ι) t) : - ClassTestUpper Q (inverseWordAction Q (w.map ι) x) (Set.range ι) (t-1) := by - rintro _ ⟨α,rfl⟩ l hl c - let cs:=C.toCoxeterSystem - obtain ⟨v,hv,he⟩:=cs.exists_isReduced (cs.wordProd w*cs.simple α) - have hprod : cs.wordProd (v++[α])=cs.wordProd w := by - rw [cs.wordProd_append,cs.wordProd_singleton,← he,_root_.mul_assoc,cs.simple_mul_simple_self,_root_.mul_one] - have hvr : cs.IsReduced (v++[α]) := by - change cs.length (cs.wordProd (v++[α]))=(v++[α]).length - rw [hprod,List.length_append,List.length_singleton,← hv.eq,← he] - exact (hd α).symm - rw [mapped_inverseWord_property Q hn C ι hmat w (v++[α]) hw hvr hprod.symm, - List.map_append,inverseWordAction_append] - change ClassTestExact Q (ι α) l c - (classNegativeTwist Q (ι α) (inverseWordAction Q (v.map ι) x)) - apply (classTestExact_negative_self Q hn _ (ι α) l c).mpr - apply inverseWord_testUpper Q hn (v.map ι) x (Set.range ι) hx - (fun β hβ=>by obtain ⟨γ,_,rfl⟩:=List.mem_map.mp hβ; exact ⟨γ,rfl⟩) - (ι α) ⟨α,rfl⟩ (l+1) (by omega) (c-1) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Coxeter.ReducedWordProperty +import OAI.Topology.ArtinGroups.Complexes.PacketPermEnumeration +import OAI.Topology.ArtinGroups.Coxeter.AltListMap +import OAI.Topology.ArtinGroups.Coxeter.OrdinaryTwistBraid +import OAI.Topology.ArtinGroups.Complexes.HighestLocalGeneratorTest + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u v +open CoxeterExchange + +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn : ∀ a,Q.source a≠Q.target a) + +lemma inverseWordAction_append (w v : List V) (x : FiniteHomotopyClass Q (K:=K)) : + inverseWordAction Q (w++v) x=inverseWordAction Q v (inverseWordAction Q w x) := by + induction w generalizing x with + | nil => rfl + | cons α w ih => exact ih (classNegativeTwist Q α x) + +include hn in +lemma inverseWordAction_eq_of_positive (w v : List V) + (h : ∀ x : FiniteHomotopyClass Q (K:=K),positiveWordAction Q w x=positiveWordAction Q v x) + (x : FiniteHomotopyClass Q (K:=K)) : + inverseWordAction Q w x=inverseWordAction Q v x := by + calc + inverseWordAction Q w x= + inverseWordAction Q w (positiveWordAction Q v (inverseWordAction Q v x)) := by + rw [positive_inverseWord Q hn] + _=inverseWordAction Q w (positiveWordAction Q w (inverseWordAction Q v x)) := by rw [h] + _=inverseWordAction Q v x := inverse_positiveWord Q hn w _ + +variable {T : Type v} [Fintype T] [DecidableEq T] (C : CoxeterMatrix T) (ι : T → V) + (hmat : ∀ α β,ordinaryCoxeterMatrix Q (ι α) (ι β)=C α β) + +include hn hmat + +lemma mapped_inverseWord_property (w v : List T) + (hw : C.toCoxeterSystem.IsReduced w) (hv : C.toCoxeterSystem.IsReduced v) + (he : C.toCoxeterSystem.wordProd w=C.toCoxeterSystem.wordProd v) + (x : FiniteHomotopyClass Q (K:=K)) : + inverseWordAction Q (w.map ι) x=inverseWordAction Q (v.map ι) x := by + apply inverseWordAction_eq_of_positive Q hn + intro y + have hb : ∀ α β,((altList α β (C α β)).map (fun α=>classTwistPerm Q (K:=K) hn (ι α))).prod= + ((altList β α (C α β)).map (fun α=>classTwistPerm Q (K:=K) hn (ι α))).prod := by + intro α β + have hh:=ordinaryTwist_braid Q (K:=K) hn (ι α) (ι β) + rw [hmat] at hh + simpa only [← altList_map,List.map_map,Function.comp_def] using hh + have hh:=reduced_word_property C.toCoxeterSystem (fun α=>classTwistPerm Q (K:=K) hn (ι α)) + hb w v hw hv he + rw [positiveWordAction_eq_prod Q hn,positiveWordAction_eq_prod Q hn] + simpa only [List.map_map,Function.comp_def] using + congrArg (fun f : Equiv.Perm (FiniteHomotopyClass Q (K:=K))=>f y) hh + +theorem longest_inverseWord_testUpper (w : List T) + (hw : C.toCoxeterSystem.IsReduced w) + (hd : ∀ α,C.toCoxeterSystem.length (C.toCoxeterSystem.wordProd w*C.toCoxeterSystem.simple α)+1= + C.toCoxeterSystem.length (C.toCoxeterSystem.wordProd w)) + (x : FiniteHomotopyClass Q (K:=K)) (t : ℤ) + (hx : ClassTestUpper Q x (Set.range ι) t) : + ClassTestUpper Q (inverseWordAction Q (w.map ι) x) (Set.range ι) (t-1) := by + rintro _ ⟨α,rfl⟩ l hl c + let cs:=C.toCoxeterSystem + obtain ⟨v,hv,he⟩:=cs.exists_isReduced (cs.wordProd w*cs.simple α) + have hprod : cs.wordProd (v++[α])=cs.wordProd w := by + rw [cs.wordProd_append,cs.wordProd_singleton,← he,_root_.mul_assoc,cs.simple_mul_simple_self,_root_.mul_one] + have hvr : cs.IsReduced (v++[α]) := by + change cs.length (cs.wordProd (v++[α]))=(v++[α]).length + rw [hprod,List.length_append,List.length_singleton,← hv.eq,← he] + exact (hd α).symm + rw [mapped_inverseWord_property Q hn C ι hmat w (v++[α]) hw hvr hprod.symm, + List.map_append,inverseWordAction_append] + change ClassTestExact Q (ι α) l c + (classNegativeTwist Q (ι α) (inverseWordAction Q (v.map ι) x)) + apply (classTestExact_negative_self Q hn _ (ι α) l c).mpr + apply inverseWord_testUpper Q hn (v.map ι) x (Set.range ι) hx + (fun β hβ=>by obtain ⟨γ,_,rfl⟩:=List.mem_map.mp hβ; exact ⟨γ,rfl⟩) + (ι α) ⟨α,rfl⟩ (l+1) (by omega) (c-1) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/IsolatedIndexCycle.lean b/lean/OAI/Topology/ArtinGroups/Complexes/IsolatedIndexCycle.lean index 40a0e87525a5a5d213922a7f73f6a1b1e9ae4ad6..f2dcc69c099b41207333dd41e054158ccbe78a57 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/IsolatedIndexCycle.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/IsolatedIndexCycle.lean @@ -1,62 +1,62 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomDetector -import OAI.Topology.ArtinGroups.Complexes.DiagonalVertex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype I] [DecidableEq I] - -lemma isolated_index_cycle (E:BasedComplex Q (K:=K) I) (i:I) - (hr:∀j,E.differential i j=0) (hc:∀j,E.differential j i=0) : - Matrix.single i i (vertexId Q (K:=K) (E.placement i).color)∈homCycles Q E E 0 0 := by - let f:=Matrix.single i i (vertexId Q (K:=K) (E.placement i).color) - have h₁:E.differential*f=0 := by - apply Matrix.ext; intro j k - change (∑l,E.differential j l*f l k)=0 - apply Finset.sum_eq_zero - intro l hl - by_cases hli:i=l - · subst l - rw [hc,zero_mul] - · simp [f,hli] - have h₂:f*E.differential=0 := by - apply Matrix.ext; intro j k - change (∑l,f j l*E.differential l k)=0 - apply Finset.sum_eq_zero - intro l hl - by_cases hli:i=l - · subst l - rw [hr,mul_zero] - · simp [f,hli] - refine ⟨⟨?_,?_⟩,?_⟩ - · apply projectiveEntries_single Q - · exact vertexId_mul_self Q _ - · exact vertexId_mul_self Q _ - · apply mapDegree_single Q _ _ _ _ _ 0 0 (by omega) - simpa only [zero_add,sub_self,Path.length,pathBasis_vertex] using pathBasis_homogeneous Q (K:=K) (Sum.inl (E.placement i).color) - · change E.differential*f-cochainSign (K:=K) 0 • (f*E.differential)=0 - rw [h₁,h₂,smul_zero,sub_zero] - -lemma eq_isolated_index (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (hd:homDimension Q E E 0 0≤1) (i:I) - (hr:∀j,E.differential i j=0) (hc:∀j,E.differential j i=0) (j:I) : j=i := by - by_contra hji - let f:=Matrix.single i i (vertexId Q (K:=K) (E.placement i).color) - have hf:=isolated_index_cycle Q E i hr hc - have hb:f∈homBoundaries Q E E 0 0 := by - apply boundary_of_homDimension_le_one Q E E 0 0 hd (diagonalVertex Q E j) - (fun _ h=>diagonalVertex_boundary Q E hE j 0 0 h) (identity_mem_homCycles Q E) - · rw [diagonalVertex_identity]; exact one_ne_zero - · exact hf - · change (f j j).vertex (E.placement j).color=0 - simp [f,Ne.symm hji] - have hz:=diagonalVertex_boundary Q E hE i 0 0 hb - change (f i i).vertex (E.placement i).color=0 at hz - simp only [f,Matrix.single_apply_same,vertexId_eval] at hz - exact one_ne_zero hz - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomDetector +import OAI.Topology.ArtinGroups.Complexes.DiagonalVertex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype I] [DecidableEq I] + +lemma isolated_index_cycle (E:BasedComplex Q (K:=K) I) (i:I) + (hr:∀j,E.differential i j=0) (hc:∀j,E.differential j i=0) : + Matrix.single i i (vertexId Q (K:=K) (E.placement i).color)∈homCycles Q E E 0 0 := by + let f:=Matrix.single i i (vertexId Q (K:=K) (E.placement i).color) + have h₁:E.differential*f=0 := by + apply Matrix.ext; intro j k + change (∑l,E.differential j l*f l k)=0 + apply Finset.sum_eq_zero + intro l hl + by_cases hli:i=l + · subst l + rw [hc,zero_mul] + · simp [f,hli] + have h₂:f*E.differential=0 := by + apply Matrix.ext; intro j k + change (∑l,f j l*E.differential l k)=0 + apply Finset.sum_eq_zero + intro l hl + by_cases hli:i=l + · subst l + rw [hr,mul_zero] + · simp [f,hli] + refine ⟨⟨?_,?_⟩,?_⟩ + · apply projectiveEntries_single Q + · exact vertexId_mul_self Q _ + · exact vertexId_mul_self Q _ + · apply mapDegree_single Q _ _ _ _ _ 0 0 (by omega) + simpa only [zero_add,sub_self,Path.length,pathBasis_vertex] using pathBasis_homogeneous Q (K:=K) (Sum.inl (E.placement i).color) + · change E.differential*f-cochainSign (K:=K) 0 • (f*E.differential)=0 + rw [h₁,h₂,smul_zero,sub_zero] + +lemma eq_isolated_index (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (hd:homDimension Q E E 0 0≤1) (i:I) + (hr:∀j,E.differential i j=0) (hc:∀j,E.differential j i=0) (j:I) : j=i := by + by_contra hji + let f:=Matrix.single i i (vertexId Q (K:=K) (E.placement i).color) + have hf:=isolated_index_cycle Q E i hr hc + have hb:f∈homBoundaries Q E E 0 0 := by + apply boundary_of_homDimension_le_one Q E E 0 0 hd (diagonalVertex Q E j) + (fun _ h=>diagonalVertex_boundary Q E hE j 0 0 h) (identity_mem_homCycles Q E) + · rw [diagonalVertex_identity]; exact one_ne_zero + · exact hf + · change (f j j).vertex (E.placement j).color=0 + simp [f,Ne.symm hji] + have hz:=diagonalVertex_boundary Q E hE i 0 0 hb + change (f i i).vertex (E.placement i).color=0 at hz + simp only [f,Matrix.single_apply_same,vertexId_eval] at hz + exact one_ne_zero hz + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LayerConeEquivalence.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LayerConeEquivalence.lean index 69f8e8c6f7fa9b8d3c331c5e488b2ed5cdaf35b2..6dab70f4b2418a4d52504b100f6781e17c1dcb0b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LayerConeEquivalence.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LayerConeEquivalence.lean @@ -1,39 +1,39 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseMatrix -import OAI.Topology.ArtinGroups.Complexes.Cone - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] - [DecidableEq I] [DecidableEq J] [DecidableEq L] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - -omit [Fintype V] [DecidableEq A] in -theorem classLayer_eq_of_cone_equivalence (f:Map Q E F) - (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) - (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : - classLayer Q q (classOfComplex Q E)=classLayer Q q (classOfComplex Q F) := by - let E₀:=minimalClassModel Q (classOfComplex Q E) - let F₀:=minimalClassModel Q (classOfComplex Q F) - let a:HomotopyEquivalence Q E₀.complex E:=minimalClassModelEquivalence Q E - let b:HomotopyEquivalence Q F F₀.complex:=(minimalClassModelEquivalence Q F).symm Q - let h:=a.forward.comp Q f - let g:=h.comp Q b.forward - let c:HomotopyEquivalence Q (g.cone Q) D:= - (((b.coneTarget Q h).symm Q).trans Q (a.coneSource Q f)).trans Q e - have hh:=classLayer_eq_of_cone_gap Q g - (minimalClassModel_minimal Q (classOfComplex Q E)) - (minimalClassModel_minimal Q (classOfComplex Q F)) D c q hD - have he:classOfComplex Q E₀.complex=classOfComplex Q E:=minimalClassModel_class Q _ - have hf:classOfComplex Q F₀.complex=classOfComplex Q F:=minimalClassModel_class Q _ - exact (congrArg (classLayer Q q) he).symm.trans - (hh.trans (congrArg (classLayer Q q) hf)) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseMatrix +import OAI.Topology.ArtinGroups.Complexes.Cone + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] + [DecidableEq I] [DecidableEq J] [DecidableEq L] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + +omit [Fintype V] [DecidableEq A] in +theorem classLayer_eq_of_cone_equivalence (f:Map Q E F) + (D:BasedComplex Q (K:=K) L) (e:HomotopyEquivalence Q (f.cone Q) D) + (q:ℤ) (hD:∀ j,(D.placement j).level≠q-1 ∧ (D.placement j).level≠q) : + classLayer Q q (classOfComplex Q E)=classLayer Q q (classOfComplex Q F) := by + let E₀:=minimalClassModel Q (classOfComplex Q E) + let F₀:=minimalClassModel Q (classOfComplex Q F) + let a:HomotopyEquivalence Q E₀.complex E:=minimalClassModelEquivalence Q E + let b:HomotopyEquivalence Q F F₀.complex:=(minimalClassModelEquivalence Q F).symm Q + let h:=a.forward.comp Q f + let g:=h.comp Q b.forward + let c:HomotopyEquivalence Q (g.cone Q) D:= + (((b.coneTarget Q h).symm Q).trans Q (a.coneSource Q f)).trans Q e + have hh:=classLayer_eq_of_cone_gap Q g + (minimalClassModel_minimal Q (classOfComplex Q E)) + (minimalClassModel_minimal Q (classOfComplex Q F)) D c q hD + have he:classOfComplex Q E₀.complex=classOfComplex Q E:=minimalClassModel_class Q _ + have hf:classOfComplex Q F₀.complex=classOfComplex Q F:=minimalClassModel_class Q _ + exact (congrArg (classLayer Q q) he).symm.trans + (hh.trans (congrArg (classLayer Q q) hf)) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionLayer.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionLayer.lean index 3215ce47563af56fe28195cf78f140415a12728e..5b45f3ccb9f7c67c3bd941d73ddf890ccc31680f 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionLayer.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionLayer.lean @@ -1,54 +1,54 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PureLayerSelf - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type u} [Fintype I] [DecidableEq I] - -lemma classLayerSocleDimension_layer (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) (c:ℤ) : - classLayerSocleDimension Q q α c (classLayer Q q x)=classLayerSocleDimension Q q α c x := by - let E:=((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q) - have hE:∀ i,(E.placement i).level=q:=fun i=>i.property - change classLayerSocleDimension Q q α c (classOfComplex Q E)=Module.finrank K (coefficientSocle Q E α c) - rw [classLayerSocleDimension_minimal Q E (pure_minimal Q E hE)] - exact ((pureLayerSelf Q E hE).coefficientSocle Q hE (fun i=>i.property) α c).finrank_eq.symm - -lemma classLayerTopDimension_layer (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) (c:ℤ) : - classLayerTopDimension Q q α c (classLayer Q q x)=classLayerTopDimension Q q α c x := by - let E:=((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q) - have hE:∀ i,(E.placement i).level=q:=fun i=>i.property - change classLayerTopDimension Q q α c (classOfComplex Q E)=Module.finrank K (coefficientTopDual Q E α c) - rw [classLayerTopDimension_minimal Q E (pure_minimal Q E hE)] - exact ((pureLayerSelf Q E hE).coefficientTopDual Q hE (fun i=>i.property) α c).finrank_eq.symm - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_lowerTruncation_le (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (d q:ℤ) (hd:d≤q) : - classLayer Q d (classOfComplex Q (lowerTruncation Q E hE q))= - classLayer Q d (classOfComplex Q E) := by - apply classLayer_eq_of_cone_equivalence Q (lowInclusion Q E _ (levelDownClosed Q E hE q)) - (upperTruncation Q E hE q) (lowConeReduction Q E _ _) d - intro j - have hj:=j.property - change ¬(E.placement j).level≤q at hj - change (E.placement j).level≠d-1 ∧ (E.placement j).level≠d - omega - -lemma classLayerTopDimension_congr_layer {x y:FiniteHomotopyClass Q (K:=K)} (q:ℤ) - (h:classLayer Q q x=classLayer Q q y) (α:V) (c:ℤ) : - classLayerTopDimension Q q α c x=classLayerTopDimension Q q α c y := by - rw [← classLayerTopDimension_layer Q x q α c,h,classLayerTopDimension_layer] - -lemma classLayerSocleDimension_congr_layer {x y:FiniteHomotopyClass Q (K:=K)} (q:ℤ) - (h:classLayer Q q x=classLayer Q q y) (α:V) (c:ℤ) : - classLayerSocleDimension Q q α c x=classLayerSocleDimension Q q α c y := by - rw [← classLayerSocleDimension_layer Q x q α c,h,classLayerSocleDimension_layer] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PureLayerSelf + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] + +lemma classLayerSocleDimension_layer (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) (c:ℤ) : + classLayerSocleDimension Q q α c (classLayer Q q x)=classLayerSocleDimension Q q α c x := by + let E:=((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q) + have hE:∀ i,(E.placement i).level=q:=fun i=>i.property + change classLayerSocleDimension Q q α c (classOfComplex Q E)=Module.finrank K (coefficientSocle Q E α c) + rw [classLayerSocleDimension_minimal Q E (pure_minimal Q E hE)] + exact ((pureLayerSelf Q E hE).coefficientSocle Q hE (fun i=>i.property) α c).finrank_eq.symm + +lemma classLayerTopDimension_layer (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) (c:ℤ) : + classLayerTopDimension Q q α c (classLayer Q q x)=classLayerTopDimension Q q α c x := by + let E:=((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q) + have hE:∀ i,(E.placement i).level=q:=fun i=>i.property + change classLayerTopDimension Q q α c (classOfComplex Q E)=Module.finrank K (coefficientTopDual Q E α c) + rw [classLayerTopDimension_minimal Q E (pure_minimal Q E hE)] + exact ((pureLayerSelf Q E hE).coefficientTopDual Q hE (fun i=>i.property) α c).finrank_eq.symm + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_lowerTruncation_le (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (d q:ℤ) (hd:d≤q) : + classLayer Q d (classOfComplex Q (lowerTruncation Q E hE q))= + classLayer Q d (classOfComplex Q E) := by + apply classLayer_eq_of_cone_equivalence Q (lowInclusion Q E _ (levelDownClosed Q E hE q)) + (upperTruncation Q E hE q) (lowConeReduction Q E _ _) d + intro j + have hj:=j.property + change ¬(E.placement j).level≤q at hj + change (E.placement j).level≠d-1 ∧ (E.placement j).level≠d + omega + +lemma classLayerTopDimension_congr_layer {x y:FiniteHomotopyClass Q (K:=K)} (q:ℤ) + (h:classLayer Q q x=classLayer Q q y) (α:V) (c:ℤ) : + classLayerTopDimension Q q α c x=classLayerTopDimension Q q α c y := by + rw [← classLayerTopDimension_layer Q x q α c,h,classLayerTopDimension_layer] + +lemma classLayerSocleDimension_congr_layer {x y:FiniteHomotopyClass Q (K:=K)} (q:ℤ) + (h:classLayer Q q x=classLayer Q q y) (α:V) (c:ℤ) : + classLayerSocleDimension Q q α c x=classLayerSocleDimension Q q α c y := by + rw [← classLayerSocleDimension_layer Q x q α c,h,classLayerSocleDimension_layer] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionSum.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionSum.lean index 5cb6e5dfa46701e63699cf03ee9171062e12cba5..74a542d7be9e112518420aea7462cbc8b7913268 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionSum.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LayerSocleDimensionSum.lean @@ -1,52 +1,52 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Sum -import OAI.Topology.ArtinGroups.Complexes.MinimalModelEquivalence -import OAI.Topology.ArtinGroups.Complexes.SumTestEquiv - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I : Type u} [Fintype I] [DecidableEq I] - -lemma classLayerSocleDimension_sum (x : I → FiniteHomotopyClass Q (K := K)) - (d : ℤ) (α : V) (c : ℤ) : - classLayerSocleDimension Q d α c (classSum Q x) = - ∑ i, classLayerSocleDimension Q d α c (x i) := by - classical - let E (i:I) := (minimalClassModel Q (x i)).complex - have hE (i:I) : (E i).IsMinimal Q := minimalClassModel_minimal Q (x i) - have hx : x = fun i => classOfComplex Q (E i) := by - funext i - exact (minimalClassModel_class Q (x i)).symm - conv_lhs => rw [hx,classSum_complex] - rw [classLayerSocleDimension_minimal Q _ (finiteSum_minimal Q E hE)] - rw [((sumLayerComparison Q E hE d).coefficientSocle Q - (fun i => i.property) (fun i => i.2.property) α c).finrank_eq] - rw [(coefficientSocleSumEquiv Q (fun i => (E i).pureLayer Q (hE i) d) - (fun _ x => x.property) α c).finrank_eq,Module.finrank_pi_fintype] - rfl - -lemma classLayerTopDimension_sum (x : I → FiniteHomotopyClass Q (K := K)) - (d : ℤ) (α : V) (c : ℤ) : - classLayerTopDimension Q d α c (classSum Q x) = - ∑ i, classLayerTopDimension Q d α c (x i) := by - classical - let E (i:I) := (minimalClassModel Q (x i)).complex - have hE (i:I) : (E i).IsMinimal Q := minimalClassModel_minimal Q (x i) - have hx : x = fun i => classOfComplex Q (E i) := by - funext i - exact (minimalClassModel_class Q (x i)).symm - conv_lhs => rw [hx,classSum_complex] - rw [classLayerTopDimension_minimal Q _ (finiteSum_minimal Q E hE)] - rw [((sumLayerComparison Q E hE d).coefficientTopDual Q - (fun i => i.property) (fun i => i.2.property) α c).finrank_eq] - rw [(coefficientTopSumEquiv Q (fun i => (E i).pureLayer Q (hE i) d) - (fun _ x => x.property) α c).finrank_eq,Module.finrank_pi_fintype] - rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Sum +import OAI.Topology.ArtinGroups.Complexes.MinimalModelEquivalence +import OAI.Topology.ArtinGroups.Complexes.SumTestEquiv + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I : Type u} [Fintype I] [DecidableEq I] + +lemma classLayerSocleDimension_sum (x : I → FiniteHomotopyClass Q (K := K)) + (d : ℤ) (α : V) (c : ℤ) : + classLayerSocleDimension Q d α c (classSum Q x) = + ∑ i, classLayerSocleDimension Q d α c (x i) := by + classical + let E (i:I) := (minimalClassModel Q (x i)).complex + have hE (i:I) : (E i).IsMinimal Q := minimalClassModel_minimal Q (x i) + have hx : x = fun i => classOfComplex Q (E i) := by + funext i + exact (minimalClassModel_class Q (x i)).symm + conv_lhs => rw [hx,classSum_complex] + rw [classLayerSocleDimension_minimal Q _ (finiteSum_minimal Q E hE)] + rw [((sumLayerComparison Q E hE d).coefficientSocle Q + (fun i => i.property) (fun i => i.2.property) α c).finrank_eq] + rw [(coefficientSocleSumEquiv Q (fun i => (E i).pureLayer Q (hE i) d) + (fun _ x => x.property) α c).finrank_eq,Module.finrank_pi_fintype] + rfl + +lemma classLayerTopDimension_sum (x : I → FiniteHomotopyClass Q (K := K)) + (d : ℤ) (α : V) (c : ℤ) : + classLayerTopDimension Q d α c (classSum Q x) = + ∑ i, classLayerTopDimension Q d α c (x i) := by + classical + let E (i:I) := (minimalClassModel Q (x i)).complex + have hE (i:I) : (E i).IsMinimal Q := minimalClassModel_minimal Q (x i) + have hx : x = fun i => classOfComplex Q (E i) := by + funext i + exact (minimalClassModel_class Q (x i)).symm + conv_lhs => rw [hx,classSum_complex] + rw [classLayerTopDimension_minimal Q _ (finiteSum_minimal Q E hE)] + rw [((sumLayerComparison Q E hE d).coefficientTopDual Q + (fun i => i.property) (fun i => i.2.property) α c).finrank_eq] + rw [(coefficientTopSumEquiv Q (fun i => (E i).pureLayer Q (hE i) d) + (fun _ x => x.property) α c).finrank_eq,Module.finrank_pi_fintype] + rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LayerTotalHomDimension.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LayerTotalHomDimension.lean index 2f1d728a2d13734d56f1c8e805208cf0cd4db24c..281f42121b39e3c77b9e4865c64b38c3a4393177 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LayerTotalHomDimension.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LayerTotalHomDimension.lean @@ -1,34 +1,34 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomDimensionZeroCycles - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} [Field K] (Q:ReversibleQuiver V A) - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def classLayerTotalHomDimension (x y:FiniteHomotopyClass Q (K:=K)) - (l k t:ℤ) : ℕ := - totalHomDimension Q - ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) l) - ((minimalClassModel Q y).complex.pureLayer Q (minimalClassModel_minimal Q y) k) t - -lemma frameModel_pure_orthogonal_middle_dimension (hn:∀ a,Q.source a≠Q.target a) - (C:CoxeterMatrix V) (hC:UnfoldedPresentation Q C) (x:Artin C) - {α β:V} (hab:OrthogonalVertices Q α β) (l k:ℤ) : - totalHomDimension Q - ((frameModel Q (K:=K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) l) - ((frameModel Q (K:=K) hn C hC x β).complex.pureLayer Q (frameModel_minimal Q hn C hC x β) k) - (k-l+1)=0 := by - unfold totalHomDimension - apply Finset.sum_eq_zero - intro v _ - apply homDimension_zero_of_cycles_boundary Q - intro f hf - apply frameModel_orthogonal_layer_middle_vanishing Q hn C hC x hab l k _ v hf - exact pure_homSpace_linear Q _ _ (fun i=>i.property) (fun i=>i.property) (by omega) hf.1 - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomDimensionZeroCycles + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} [Field K] (Q:ReversibleQuiver V A) + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def classLayerTotalHomDimension (x y:FiniteHomotopyClass Q (K:=K)) + (l k t:ℤ) : ℕ := + totalHomDimension Q + ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) l) + ((minimalClassModel Q y).complex.pureLayer Q (minimalClassModel_minimal Q y) k) t + +lemma frameModel_pure_orthogonal_middle_dimension (hn:∀ a,Q.source a≠Q.target a) + (C:CoxeterMatrix V) (hC:UnfoldedPresentation Q C) (x:Artin C) + {α β:V} (hab:OrthogonalVertices Q α β) (l k:ℤ) : + totalHomDimension Q + ((frameModel Q (K:=K) hn C hC x α).complex.pureLayer Q (frameModel_minimal Q hn C hC x α) l) + ((frameModel Q (K:=K) hn C hC x β).complex.pureLayer Q (frameModel_minimal Q hn C hC x β) k) + (k-l+1)=0 := by + unfold totalHomDimension + apply Finset.sum_eq_zero + intro v _ + apply homDimension_zero_of_cycles_boundary Q + intro f hf + apply frameModel_orthogonal_layer_middle_vanishing Q hn C hC x hab l k _ v hf + exact pure_homSpace_linear Q _ _ (fun i=>i.property) (fun i=>i.property) (by omega) hf.1 + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LayerVector.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LayerVector.lean index 79d3669531e97774e3ad4e14b4e822dd58705b3b..4a1b843e2e58770532c2fb84bc33f41572a3fabe 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LayerVector.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LayerVector.lean @@ -1,141 +1,141 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.UnitTestVector -import OAI.Topology.ArtinGroups.Complexes.BottomScalarCycleZero - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -noncomputable def layerVector (E:BasedComplex Q (K:=K) I) (d:ℤ) - (x:{i // (E.placement i).level=d}→K) : I→K := by - classical - exact fun i=>if h:(E.placement i).level=d then x ⟨i,h⟩ else 0 - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma layerVector_support (E:BasedComplex Q (K:=K) I) (d:ℤ) - (x:{i // (E.placement i).level=d}→K) (i:I) - (h:(E.placement i).level≠d) : layerVector Q E d x i=0 := by - classical - simp [layerVector,h] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma layerVector_socle (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (d:ℤ) (α:V) (c:ℤ) {x:{i // (E.placement i).level=d}→K} - (hx:x∈coefficientSocle Q (E.pureLayer Q hE d) α c) : - layerVector Q E d x∈coefficientSocle Q E α c := by - classical - constructor - · intro i hi - by_cases hid:(E.placement i).level=d - · simpa [layerVector,hid] using hx.1 ⟨i,hid⟩ hi - · exact layerVector_support Q E d x i hid - · intro j a ha - by_cases hj:(E.placement j).level=d - · rw [← hx.2 ⟨j,hj⟩ a ha] - symm - apply Fintype.sum_of_injective - (Subtype.val : {i // (E.placement i).level=d}→I) Subtype.val_injective - · intro i hi - rw [layerVector_support Q E d x i (fun h=>hi ⟨⟨i,h⟩,rfl⟩),MulZeroClass.zero_mul] - · intro i - change x i * (E.differential i.val j).arrow a = - layerVector Q E d x i.val * (E.differential i.val j).arrow a - simp only [layerVector,dite_eq_left i.property] - · apply Finset.sum_eq_zero - intro i hi - by_cases hid:(E.placement i).level=d - · have hd:(E.differential i j).arrow a=0 := by - exact congrFun (differential_arrow_level Q E (fun h=>hj (h.trans hid))) a - rw [hd,MulZeroClass.mul_zero] - · rw [layerVector_support Q E d x i hid,MulZeroClass.zero_mul] - -omit [DecidableEq I] in -lemma unitTestVector_bottom_cycle (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (d:ℤ) (hfloor:∀ i,d≤(E.placement i).level) (α:V) (c:ℤ) - {x:I→K} (hx:x∈coefficientSocle Q E α c) - (hs:∀ i,(E.placement i).level≠d→x i=0) : - Matrix.vecMul (unitTestVector Q E.placement α x) - ((E.testComplex Q α).differential.map (vertexHom Q α))=0 := by - have hd:((E.testComplex Q α).differential.map (vertexHom Q α))= - testMatrix Q E.placement E.placement α E.differential := by - apply Matrix.ext - intro i j - change ((testMatrix Q E.placement E.placement α E.differential i j) • vertexId Q α).vertex α = _ - simp - rw [hd] - funext j - rw [unitTestVector_differential Q E α x (fun i h=>hx.1 i (Or.inl h))] - rcases j with ⟨j,⟨p,hp,hq⟩⟩ - rcases p with v|a|v - · apply Finset.sum_eq_zero - intro i hi - change x i * (E.differential i j).vertex v=0 - simp only [hE i j,Pi.zero_apply,MulZeroClass.mul_zero] - · exact hx.2 j a hp - · apply Finset.sum_eq_zero - intro i hi - change x i * (E.differential i j).token v=0 - by_cases hxi:x i=0 - · rw [hxi,MulZeroClass.zero_mul] - have hi:(E.placement i).level=d := Classical.not_not.mp (fun h=>hxi (hs i h)) - have hz:(E.differential i j).token v=0 := by - by_contra hn - obtain ⟨_,_,hc,hu⟩:=degree_token_support Q E.entries E.degree i j v hn - have hj:=hfloor j - dsimp only [GeneratorPlacement.level] at hi hj - omega - rw [hz,MulZeroClass.mul_zero] - -omit [DecidableEq I] in -theorem bottomSocle_zero_of_test_equiv_above - (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d:ℤ} - (hfloor:∀ i,d≤(E.placement i).level) (α:V) - (F:BasedComplex Q (K:=K) J) (e:HomotopyEquivalence Q (E.testComplex Q α) F) - (hF:∀ j,d<(F.placement j).level) (c:ℤ) : - coefficientSocle Q (E.pureLayer Q hE d) α c=⊥ := by - classical - apply le_antisymm _ bot_le - intro x hx - change x=0 - let y:=layerVector Q E d x - have hy:y∈coefficientSocle Q E α c:=layerVector_socle Q E hE d α c hx - have hs:∀ i,(E.placement i).level≠d→y i=0:=layerVector_support Q E d x - have htf:∀ i,d≤((E.testComplex Q α).placement i).level := by - intro i - have hi:=hfloor i.1 - have hl:0≤Path.length i.2.val := by - rcases i.2.val with v|a|v <;> norm_num [Path.length] - dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at * - omega - have hts:∀ i,((E.testComplex Q α).placement i).level≠d→ - unitTestVector Q E.placement α y i=0 := by - intro i hi - change y i.1 * pathCoordinates Q (vertexId Q α) i.2.val=0 - by_cases hp:Sum.inl α=i.2.val - · rw [vertex_coordinates,ite_eq_left hp,_root_.mul_one] - apply hs - intro hc - apply hi - change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=d - rw [← hp] - simpa [Path.length,GeneratorPlacement.level] using hc - · rw [vertex_coordinates,ite_eq_right hp,MulZeroClass.mul_zero] - have hz:=bottom_scalar_cycle_zero Q (E.testComplex Q α) F e α (fun _=>rfl) htf hF - (unitTestVector Q E.placement α y) hts (unitTestVector_bottom_cycle Q E hE d hfloor α c hy hs) - have hy0:y=0 := by - have hh:=congrArg (sumUnitTest Q E.placement α) hz - rw [sumUnitTest_unit Q E.placement α y (fun i h=>hy.1 i (Or.inl h)),map_zero] at hh - exact hh - funext i - have hh:=congrFun hy0 i.val - change (if h:(E.placement i.val).level=d then x ⟨i.val,h⟩ else 0)=0 at hh - split_ifs at hh with hi - · exact hh - · exact (hi i.property).elim - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.UnitTestVector +import OAI.Topology.ArtinGroups.Complexes.BottomScalarCycleZero + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +noncomputable def layerVector (E:BasedComplex Q (K:=K) I) (d:ℤ) + (x:{i // (E.placement i).level=d}→K) : I→K := by + classical + exact fun i=>if h:(E.placement i).level=d then x ⟨i,h⟩ else 0 + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma layerVector_support (E:BasedComplex Q (K:=K) I) (d:ℤ) + (x:{i // (E.placement i).level=d}→K) (i:I) + (h:(E.placement i).level≠d) : layerVector Q E d x i=0 := by + classical + simp [layerVector,h] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma layerVector_socle (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (d:ℤ) (α:V) (c:ℤ) {x:{i // (E.placement i).level=d}→K} + (hx:x∈coefficientSocle Q (E.pureLayer Q hE d) α c) : + layerVector Q E d x∈coefficientSocle Q E α c := by + classical + constructor + · intro i hi + by_cases hid:(E.placement i).level=d + · simpa [layerVector,hid] using hx.1 ⟨i,hid⟩ hi + · exact layerVector_support Q E d x i hid + · intro j a ha + by_cases hj:(E.placement j).level=d + · rw [← hx.2 ⟨j,hj⟩ a ha] + symm + apply Fintype.sum_of_injective + (Subtype.val : {i // (E.placement i).level=d}→I) Subtype.val_injective + · intro i hi + rw [layerVector_support Q E d x i (fun h=>hi ⟨⟨i,h⟩,rfl⟩),MulZeroClass.zero_mul] + · intro i + change x i * (E.differential i.val j).arrow a = + layerVector Q E d x i.val * (E.differential i.val j).arrow a + simp only [layerVector,dite_eq_left i.property] + · apply Finset.sum_eq_zero + intro i hi + by_cases hid:(E.placement i).level=d + · have hd:(E.differential i j).arrow a=0 := by + exact congrFun (differential_arrow_level Q E (fun h=>hj (h.trans hid))) a + rw [hd,MulZeroClass.mul_zero] + · rw [layerVector_support Q E d x i hid,MulZeroClass.zero_mul] + +omit [DecidableEq I] in +lemma unitTestVector_bottom_cycle (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (d:ℤ) (hfloor:∀ i,d≤(E.placement i).level) (α:V) (c:ℤ) + {x:I→K} (hx:x∈coefficientSocle Q E α c) + (hs:∀ i,(E.placement i).level≠d→x i=0) : + Matrix.vecMul (unitTestVector Q E.placement α x) + ((E.testComplex Q α).differential.map (vertexHom Q α))=0 := by + have hd:((E.testComplex Q α).differential.map (vertexHom Q α))= + testMatrix Q E.placement E.placement α E.differential := by + apply Matrix.ext + intro i j + change ((testMatrix Q E.placement E.placement α E.differential i j) • vertexId Q α).vertex α = _ + simp + rw [hd] + funext j + rw [unitTestVector_differential Q E α x (fun i h=>hx.1 i (Or.inl h))] + rcases j with ⟨j,⟨p,hp,hq⟩⟩ + rcases p with v|a|v + · apply Finset.sum_eq_zero + intro i hi + change x i * (E.differential i j).vertex v=0 + simp only [hE i j,Pi.zero_apply,MulZeroClass.mul_zero] + · exact hx.2 j a hp + · apply Finset.sum_eq_zero + intro i hi + change x i * (E.differential i j).token v=0 + by_cases hxi:x i=0 + · rw [hxi,MulZeroClass.zero_mul] + have hi:(E.placement i).level=d := Classical.not_not.mp (fun h=>hxi (hs i h)) + have hz:(E.differential i j).token v=0 := by + by_contra hn + obtain ⟨_,_,hc,hu⟩:=degree_token_support Q E.entries E.degree i j v hn + have hj:=hfloor j + dsimp only [GeneratorPlacement.level] at hi hj + omega + rw [hz,MulZeroClass.mul_zero] + +omit [DecidableEq I] in +theorem bottomSocle_zero_of_test_equiv_above + (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d:ℤ} + (hfloor:∀ i,d≤(E.placement i).level) (α:V) + (F:BasedComplex Q (K:=K) J) (e:HomotopyEquivalence Q (E.testComplex Q α) F) + (hF:∀ j,d<(F.placement j).level) (c:ℤ) : + coefficientSocle Q (E.pureLayer Q hE d) α c=⊥ := by + classical + apply le_antisymm _ bot_le + intro x hx + change x=0 + let y:=layerVector Q E d x + have hy:y∈coefficientSocle Q E α c:=layerVector_socle Q E hE d α c hx + have hs:∀ i,(E.placement i).level≠d→y i=0:=layerVector_support Q E d x + have htf:∀ i,d≤((E.testComplex Q α).placement i).level := by + intro i + have hi:=hfloor i.1 + have hl:0≤Path.length i.2.val := by + rcases i.2.val with v|a|v <;> norm_num [Path.length] + dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at * + omega + have hts:∀ i,((E.testComplex Q α).placement i).level≠d→ + unitTestVector Q E.placement α y i=0 := by + intro i hi + change y i.1 * pathCoordinates Q (vertexId Q α) i.2.val=0 + by_cases hp:Sum.inl α=i.2.val + · rw [vertex_coordinates,ite_eq_left hp,_root_.mul_one] + apply hs + intro hc + apply hi + change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=d + rw [← hp] + simpa [Path.length,GeneratorPlacement.level] using hc + · rw [vertex_coordinates,ite_eq_right hp,MulZeroClass.mul_zero] + have hz:=bottom_scalar_cycle_zero Q (E.testComplex Q α) F e α (fun _=>rfl) htf hF + (unitTestVector Q E.placement α y) hts (unitTestVector_bottom_cycle Q E hE d hfloor α c hy hs) + have hy0:y=0 := by + have hh:=congrArg (sumUnitTest Q E.placement α) hz + rw [sumUnitTest_unit Q E.placement α y (fun i h=>hy.1 i (Or.inl h)),map_zero] at hh + exact hh + funext i + have hh:=congrFun hy0 i.val + change (if h:(E.placement i.val).level=d then x ⟨i.val,h⟩ else 0)=0 at hh + split_ifs at hh with hi + · exact hh + · exact (hi i.property).elim + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LeftMatrix.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LeftMatrix.lean index 1742c395ed6c47121c007dd16f63a4320cb39862..d80c8fc7017ba8e2082393a00e0dfa4c93830760 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LeftMatrix.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LeftMatrix.lean @@ -1,52 +1,52 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PureHomSpaceHomogeneous - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J L : Type*} [Fintype I] [Fintype J] [Fintype L] - -lemma coefficientMap_row_support {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) - (hf : CoefficientMatrix Q f.matrix) (U : Set V) - (hF : ∀ j, (F.placement j).color ∈ U) (i : I) (j : J) - (hi : (E.placement i).color ∉ U) : f.matrix i j = 0 := by - apply Zigzag.ext - · funext w - change (f.matrix i j).vertex w = 0 - by_contra hw - have he := (reduction_support Q f.entries f.degree i j w hw).1 - exact hi (he ▸ hF j) - · exact (hf i j).1 - · exact (hf i j).2 - -lemma pureMap_coefficient {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) (q : ℤ) - (hE : ∀ i, (E.placement i).level = q) (hF : ∀ j, (F.placement j).level = q) : - CoefficientMatrix Q f.matrix := - pure_homSpace_coefficient Q E F hE hF (by omega) ⟨f.entries, f.degree⟩ - -omit [Fintype L] in -lemma pureMap_mul_support {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) (q : ℤ) - (hE : ∀ i, (E.placement i).level = q) (hF : ∀ j, (F.placement j).level = q) - (U : Set V) (hU : ∀ j, (F.placement j).color ∈ U) - (g : Matrix J L (Q.Zigzag K)) (i : I) (j : L) - (hi : (E.placement i).color ∉ U) : (f.matrix * g) i j = 0 := by - rw [Matrix.mul_apply] - apply Finset.sum_eq_zero - intro t _ - rw [coefficientMap_row_support Q f (pureMap_coefficient Q f q hE hF) U hU i t hi, - MulZeroClass.zero_mul] - -noncomputable def leftMatrix (a : Matrix I J (Q.Zigzag K)) : - Matrix J L (Q.Zigzag K) →ₗ[K] Matrix I L (Q.Zigzag K) where - toFun f := a * f - map_add' _ _ := Matrix.mul_add _ _ _ - map_smul' _ _ := Matrix.mul_smul _ _ _ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PureHomSpaceHomogeneous + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J L : Type*} [Fintype I] [Fintype J] [Fintype L] + +lemma coefficientMap_row_support {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) + (hf : CoefficientMatrix Q f.matrix) (U : Set V) + (hF : ∀ j, (F.placement j).color ∈ U) (i : I) (j : J) + (hi : (E.placement i).color ∉ U) : f.matrix i j = 0 := by + apply Zigzag.ext + · funext w + change (f.matrix i j).vertex w = 0 + by_contra hw + have he := (reduction_support Q f.entries f.degree i j w hw).1 + exact hi (he ▸ hF j) + · exact (hf i j).1 + · exact (hf i j).2 + +lemma pureMap_coefficient {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) (q : ℤ) + (hE : ∀ i, (E.placement i).level = q) (hF : ∀ j, (F.placement j).level = q) : + CoefficientMatrix Q f.matrix := + pure_homSpace_coefficient Q E F hE hF (by omega) ⟨f.entries, f.degree⟩ + +omit [Fintype L] in +lemma pureMap_mul_support {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) (q : ℤ) + (hE : ∀ i, (E.placement i).level = q) (hF : ∀ j, (F.placement j).level = q) + (U : Set V) (hU : ∀ j, (F.placement j).color ∈ U) + (g : Matrix J L (Q.Zigzag K)) (i : I) (j : L) + (hi : (E.placement i).color ∉ U) : (f.matrix * g) i j = 0 := by + rw [Matrix.mul_apply] + apply Finset.sum_eq_zero + intro t _ + rw [coefficientMap_row_support Q f (pureMap_coefficient Q f q hE hF) U hU i t hi, + MulZeroClass.zero_mul] + +noncomputable def leftMatrix (a : Matrix I J (Q.Zigzag K)) : + Matrix J L (Q.Zigzag K) →ₗ[K] Matrix I L (Q.Zigzag K) where + toFun f := a * f + map_add' _ _ := Matrix.mul_add _ _ _ + map_smul' _ _ := Matrix.mul_smul _ _ _ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayBelow.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayBelow.lean index fa39f9b6ee1f2136fd5305e38dfc218299322d8d..8d7d964e0e678afa0cb2e58c21da8b26e39e0ed3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayBelow.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayBelow.lean @@ -1,25 +1,25 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.LevelArrayMinimalApply - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] - (Q:ReversibleQuiver V A) [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in -lemma classLevelArray_below (x:FiniteHomotopyClass Q (K:=K)) (k l:ℤ) - (hx:ClassLowerBound Q k x) (hl:l classOfComplex Q (E i) := by - funext i; exact (minimalClassModel_class Q (x i)).symm - rw [hx,classSum_complex,classLevelArray_complex_minimal Q _ (finiteSum_minimal Q E hE)] - simp_rw [classLevelArray_complex_minimal Q _ (hE _)] - exact finiteSum_levelArray Q E - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.GeneratorArray2 +import OAI.Topology.ArtinGroups.Complexes.MinimalModel +import OAI.Topology.ArtinGroups.Complexes.Sum +import OAI.Topology.ArtinGroups.Complexes.SumTestEquiv + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + {I : Type u} [Fintype I] [DecidableEq I] + +lemma classLevelArray_complex_minimal (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) : + classLevelArray Q (classOfComplex Q E) = E.levelArray Q := + classLevelArray_of_minimal Q (FiniteModel.ofComplex Q E) hE + +lemma finiteSum_levelArray {T : I → Type u} [∀ i, Fintype (T i)] [∀ i, DecidableEq (T i)] + (E : (i:I) → BasedComplex Q (K := K) (T i)) : + (finiteSum Q E).levelArray Q = ∑ i, (E i).levelArray Q := by + classical + simp only [levelArray_eq_sum,Fintype.sum_sigma] + rfl + +lemma classLevelArray_sum (x : I → FiniteHomotopyClass Q (K := K)) : + classLevelArray Q (classSum Q x) = ∑ i, classLevelArray Q (x i) := by + classical + let E (i:I) := (minimalClassModel Q (x i)).complex + have hE (i:I) : (E i).IsMinimal Q := minimalClassModel_minimal Q (x i) + have hx : x = fun i => classOfComplex Q (E i) := by + funext i; exact (minimalClassModel_class Q (x i)).symm + rw [hx,classSum_complex,classLevelArray_complex_minimal Q _ (finiteSum_minimal Q E hE)] + simp_rw [classLevelArray_complex_minimal Q _ (hE _)] + exact finiteSum_levelArray Q E + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayMinimalApply.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayMinimalApply.lean index cd195e9194c3167421d3e20c6f6c88ece5b4e1a8..3b320cb770373f325921283ac68247a8bf248485 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayMinimalApply.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LevelArrayMinimalApply.lean @@ -1,103 +1,103 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.LevelArrayComplexMinimal -import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - -lemma classLevelArray_minimal_apply (x:FiniteHomotopyClass Q (K:=K)) (α:V) (k:ℤ) : - classLevelArray Q x (α,k)=Nat.card {i:(minimalClassModel Q x).Index // - ((minimalClassModel Q x).complex.placement i).color=α ∧ - ((minimalClassModel Q x).complex.placement i).level=k} := by - have h:=classLevelArray_complex_minimal Q (minimalClassModel Q x).complex - (minimalClassModel_minimal Q x) - have hx:classOfComplex Q (minimalClassModel Q x).complex=x:=minimalClassModel_class Q x - rw [hx] at h - rw [h,levelArray_apply] - -lemma classCapOn_iff_level_zero (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (q:ℤ) : - ClassCapOn Q x U q ↔ ∀ α∈U,∀ k,q - ((minimalClassModel Q (x z.1)).complex.placement z.2).level) - exact ⟨b,fun r i=>hb ⟨r,i⟩⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.LevelArrayComplexMinimal +import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + +lemma classLevelArray_minimal_apply (x:FiniteHomotopyClass Q (K:=K)) (α:V) (k:ℤ) : + classLevelArray Q x (α,k)=Nat.card {i:(minimalClassModel Q x).Index // + ((minimalClassModel Q x).complex.placement i).color=α ∧ + ((minimalClassModel Q x).complex.placement i).level=k} := by + have h:=classLevelArray_complex_minimal Q (minimalClassModel Q x).complex + (minimalClassModel_minimal Q x) + have hx:classOfComplex Q (minimalClassModel Q x).complex=x:=minimalClassModel_class Q x + rw [hx] at h + rw [h,levelArray_apply] + +lemma classCapOn_iff_level_zero (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (q:ℤ) : + ClassCapOn Q x U q ↔ ∀ α∈U,∀ k,q + ((minimalClassModel Q (x z.1)).complex.placement z.2).level) + exact ⟨b,fun r i=>hb ⟨r,i⟩⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LowMatrix.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LowMatrix.lean index e1cad948a96d11e392cd61abb626b1f9e636df9b..4a57b1ba1bd321d1302545e36bebb4a9413c9851 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LowMatrix.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LowMatrix.lean @@ -1,134 +1,134 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Level -import OAI.Topology.ArtinGroups.Complexes.DownClosed - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] - [DecidableEq I] [DecidableEq J] [DecidableEq L] -attribute [local instance] Classical.decEq -attribute [local instance] Classical.propDecidable - -noncomputable def lowMatrix (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (M:Matrix I J (Q.Zigzag K)) (d:ℤ) : - Matrix (lowerLevelSet Q E d) (lowerLevelSet Q F d) (Q.Zigzag K) := - fun i j=>M i j - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] [DecidableEq L] in -lemma lowMatrix_mul (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (G:BasedComplex Q (K:=K) L) (M:Matrix I J (Q.Zigzag K)) - (N:Matrix J L (Q.Zigzag K)) (d:ℤ) - (hM:∀ i j,M i j≠0→(F.placement j).level≤(E.placement i).level) : - lowMatrix Q E G (M*N) d=lowMatrix Q E F M d*lowMatrix Q F G N d := by - apply Matrix.ext - intro i k - change (∑ j,M i j*N j k)=∑ j:lowerLevelSet Q F d,M i j*N j k - symm - apply Fintype.sum_of_injective (Subtype.val:lowerLevelSet Q F d→J) Subtype.val_injective - · intro j hj - have hz:M i j=0 := by - by_contra hn - have hi:(E.placement i).level≤d:=i.property - exact hj ⟨⟨j,le_trans (hM i j hn) hi⟩,rfl⟩ - rw [hz,zero_mul] - · intro j; rfl - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma lowMatrix_add (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (M N:Matrix I J (Q.Zigzag K)) (d:ℤ) : - lowMatrix Q E F (M+N) d=lowMatrix Q E F M d+lowMatrix Q E F N d := rfl - -omit [Fintype V] [DecidableEq A] in -lemma lowMatrix_identity (E:BasedComplex Q (K:=K) I) (d:ℤ) : - lowMatrix Q E E (projectiveIdentity Q E.placement) d= - projectiveIdentity Q (fun i:lowerLevelSet Q E d=>E.placement i) := by - apply Matrix.ext; intro i j - change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= - (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) - simp only [Subtype.val_inj] - -noncomputable def Map.lowerTruncation {E:BasedComplex Q (K:=K) I} - {F:BasedComplex Q (K:=K) J} (f:Map Q E F) - (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) (d:ℤ) : - Map Q (lowerTruncation Q E hE d) (lowerTruncation Q F hF d) where - matrix:=lowMatrix Q E F f.matrix d - entries:=⟨fun i j=>f.entries.1 i j,fun i j=>f.entries.2 i j⟩ - degree:=fun i j=>f.degree i j - commute:=by - change lowMatrix Q E E E.differential d*lowMatrix Q E F f.matrix d= - lowMatrix Q E F f.matrix d*lowMatrix Q F F F.differential d - rw [← lowMatrix_mul Q E E F _ _ d (minimal_differential_level_bound Q E hE), - ← lowMatrix_mul Q E F F _ _ d (map_level_bound Q f), f.commute] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma homotopy_level_bound (E:BasedComplex Q (K:=K) I) - (H:Matrix I I (Q.Zigzag K)) (hH:MapDegree Q E.placement E.placement (-1) 0 H) - (i j:I) (h:H i j≠0) : (E.placement j).level≤(E.placement i).level := by - have hh:=mapDegree_level_bound Q hH h - omega - -noncomputable def HomotopyEquivalence.lowerTruncation - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (e:HomotopyEquivalence Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) (d:ℤ) : - HomotopyEquivalence Q (lowerTruncation Q E hE d) (lowerTruncation Q F hF d) where - forward:=e.forward.lowerTruncation Q hE hF d - backward:=e.backward.lowerTruncation Q hF hE d - sourceHomotopy:=lowMatrix Q E E e.sourceHomotopy d - targetHomotopy:=lowMatrix Q F F e.targetHomotopy d - sourceEntries:=⟨fun i j=>e.sourceEntries.1 i j,fun i j=>e.sourceEntries.2 i j⟩ - targetEntries:=⟨fun i j=>e.targetEntries.1 i j,fun i j=>e.targetEntries.2 i j⟩ - sourceDegree:=fun i j=>e.sourceDegree i j - targetDegree:=fun i j=>e.targetDegree i j - sourceEquation:=by - change lowMatrix Q E F e.forward.matrix d*lowMatrix Q F E e.backward.matrix d= - projectiveIdentity Q _+(lowMatrix Q E E E.differential d*lowMatrix Q E E e.sourceHomotopy d+ - lowMatrix Q E E e.sourceHomotopy d*lowMatrix Q E E E.differential d) - rw [← lowMatrix_mul Q E F E _ _ d (map_level_bound Q e.forward),e.sourceEquation, - lowMatrix_add,lowMatrix_identity,lowMatrix_add, - lowMatrix_mul Q E E E _ _ d (minimal_differential_level_bound Q E hE), - lowMatrix_mul Q E E E _ _ d (homotopy_level_bound Q E _ e.sourceDegree)] - rfl - targetEquation:=by - change lowMatrix Q F E e.backward.matrix d*lowMatrix Q E F e.forward.matrix d= - projectiveIdentity Q _+(lowMatrix Q F F F.differential d*lowMatrix Q F F e.targetHomotopy d+ - lowMatrix Q F F e.targetHomotopy d*lowMatrix Q F F F.differential d) - rw [← lowMatrix_mul Q F E F _ _ d (map_level_bound Q e.backward),e.targetEquation, - lowMatrix_add,lowMatrix_identity,lowMatrix_add, - lowMatrix_mul Q F F F _ _ d (minimal_differential_level_bound Q F hF), - lowMatrix_mul Q F F F _ _ d (homotopy_level_bound Q F _ e.targetDegree)] - rfl - -omit [Fintype V] [DecidableEq A] in -lemma lowInclusion_natural {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) (d:ℤ) : - (f.lowerTruncation Q hE hF d).matrix * - (lowInclusion Q F (lowerLevelSet Q F d) (levelDownClosed Q F hF d)).matrix= - (lowInclusion Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d)).matrix*f.matrix := by - change lowMatrix Q E F f.matrix d * blockInclusion Q F (lowerLevelSet Q F d)= - blockInclusion Q E (lowerLevelSet Q E d)*f.matrix - rw [blockInclusion_mul Q E (lowerLevelSet Q E d) _ _ f.entries] - apply Matrix.ext - intro i j - change (∑ k:lowerLevelSet Q F d,f.matrix i k* - (if (k:J)=j then vertexId Q (K:=K) (F.placement k).color else 0))=f.matrix i j - by_cases hj:j∈lowerLevelSet Q F d - · let j':lowerLevelSet Q F d:=⟨j,hj⟩ - have he (k:lowerLevelSet Q F d) : ((k:J)=j)↔k=j' := by simp only [j',Subtype.ext_iff] - simp only [he,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] - exact f.entries.2 i j - · have hz:f.matrix i j=0 := by - by_contra hn - exact hj (le_trans (map_level_bound Q f i j hn) i.property) - rw [hz] - apply Finset.sum_eq_zero - intro k _ - have hn:(k:J)≠j:=fun he=>hj (he ▸ k.property) - rw [ite_eq_right hn,MulZeroClass.mul_zero] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Level +import OAI.Topology.ArtinGroups.Complexes.DownClosed + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] + [DecidableEq I] [DecidableEq J] [DecidableEq L] +attribute [local instance] Classical.decEq +attribute [local instance] Classical.propDecidable + +noncomputable def lowMatrix (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (M:Matrix I J (Q.Zigzag K)) (d:ℤ) : + Matrix (lowerLevelSet Q E d) (lowerLevelSet Q F d) (Q.Zigzag K) := + fun i j=>M i j + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] [DecidableEq L] in +lemma lowMatrix_mul (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (G:BasedComplex Q (K:=K) L) (M:Matrix I J (Q.Zigzag K)) + (N:Matrix J L (Q.Zigzag K)) (d:ℤ) + (hM:∀ i j,M i j≠0→(F.placement j).level≤(E.placement i).level) : + lowMatrix Q E G (M*N) d=lowMatrix Q E F M d*lowMatrix Q F G N d := by + apply Matrix.ext + intro i k + change (∑ j,M i j*N j k)=∑ j:lowerLevelSet Q F d,M i j*N j k + symm + apply Fintype.sum_of_injective (Subtype.val:lowerLevelSet Q F d→J) Subtype.val_injective + · intro j hj + have hz:M i j=0 := by + by_contra hn + have hi:(E.placement i).level≤d:=i.property + exact hj ⟨⟨j,le_trans (hM i j hn) hi⟩,rfl⟩ + rw [hz,zero_mul] + · intro j; rfl + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma lowMatrix_add (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (M N:Matrix I J (Q.Zigzag K)) (d:ℤ) : + lowMatrix Q E F (M+N) d=lowMatrix Q E F M d+lowMatrix Q E F N d := rfl + +omit [Fintype V] [DecidableEq A] in +lemma lowMatrix_identity (E:BasedComplex Q (K:=K) I) (d:ℤ) : + lowMatrix Q E E (projectiveIdentity Q E.placement) d= + projectiveIdentity Q (fun i:lowerLevelSet Q E d=>E.placement i) := by + apply Matrix.ext; intro i j + change (if (i:I)=(j:I) then vertexId Q (K:=K) (E.placement i).color else 0)= + (if i=j then vertexId Q (K:=K) (E.placement i).color else 0) + simp only [Subtype.val_inj] + +noncomputable def Map.lowerTruncation {E:BasedComplex Q (K:=K) I} + {F:BasedComplex Q (K:=K) J} (f:Map Q E F) + (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) (d:ℤ) : + Map Q (lowerTruncation Q E hE d) (lowerTruncation Q F hF d) where + matrix:=lowMatrix Q E F f.matrix d + entries:=⟨fun i j=>f.entries.1 i j,fun i j=>f.entries.2 i j⟩ + degree:=fun i j=>f.degree i j + commute:=by + change lowMatrix Q E E E.differential d*lowMatrix Q E F f.matrix d= + lowMatrix Q E F f.matrix d*lowMatrix Q F F F.differential d + rw [← lowMatrix_mul Q E E F _ _ d (minimal_differential_level_bound Q E hE), + ← lowMatrix_mul Q E F F _ _ d (map_level_bound Q f), f.commute] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma homotopy_level_bound (E:BasedComplex Q (K:=K) I) + (H:Matrix I I (Q.Zigzag K)) (hH:MapDegree Q E.placement E.placement (-1) 0 H) + (i j:I) (h:H i j≠0) : (E.placement j).level≤(E.placement i).level := by + have hh:=mapDegree_level_bound Q hH h + omega + +noncomputable def HomotopyEquivalence.lowerTruncation + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (e:HomotopyEquivalence Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) (d:ℤ) : + HomotopyEquivalence Q (lowerTruncation Q E hE d) (lowerTruncation Q F hF d) where + forward:=e.forward.lowerTruncation Q hE hF d + backward:=e.backward.lowerTruncation Q hF hE d + sourceHomotopy:=lowMatrix Q E E e.sourceHomotopy d + targetHomotopy:=lowMatrix Q F F e.targetHomotopy d + sourceEntries:=⟨fun i j=>e.sourceEntries.1 i j,fun i j=>e.sourceEntries.2 i j⟩ + targetEntries:=⟨fun i j=>e.targetEntries.1 i j,fun i j=>e.targetEntries.2 i j⟩ + sourceDegree:=fun i j=>e.sourceDegree i j + targetDegree:=fun i j=>e.targetDegree i j + sourceEquation:=by + change lowMatrix Q E F e.forward.matrix d*lowMatrix Q F E e.backward.matrix d= + projectiveIdentity Q _+(lowMatrix Q E E E.differential d*lowMatrix Q E E e.sourceHomotopy d+ + lowMatrix Q E E e.sourceHomotopy d*lowMatrix Q E E E.differential d) + rw [← lowMatrix_mul Q E F E _ _ d (map_level_bound Q e.forward),e.sourceEquation, + lowMatrix_add,lowMatrix_identity,lowMatrix_add, + lowMatrix_mul Q E E E _ _ d (minimal_differential_level_bound Q E hE), + lowMatrix_mul Q E E E _ _ d (homotopy_level_bound Q E _ e.sourceDegree)] + rfl + targetEquation:=by + change lowMatrix Q F E e.backward.matrix d*lowMatrix Q E F e.forward.matrix d= + projectiveIdentity Q _+(lowMatrix Q F F F.differential d*lowMatrix Q F F e.targetHomotopy d+ + lowMatrix Q F F e.targetHomotopy d*lowMatrix Q F F F.differential d) + rw [← lowMatrix_mul Q F E F _ _ d (map_level_bound Q e.backward),e.targetEquation, + lowMatrix_add,lowMatrix_identity,lowMatrix_add, + lowMatrix_mul Q F F F _ _ d (minimal_differential_level_bound Q F hF), + lowMatrix_mul Q F F F _ _ d (homotopy_level_bound Q F _ e.targetDegree)] + rfl + +omit [Fintype V] [DecidableEq A] in +lemma lowInclusion_natural {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (f:Map Q E F) (hE:E.IsMinimal Q) (hF:F.IsMinimal Q) (d:ℤ) : + (f.lowerTruncation Q hE hF d).matrix * + (lowInclusion Q F (lowerLevelSet Q F d) (levelDownClosed Q F hF d)).matrix= + (lowInclusion Q E (lowerLevelSet Q E d) (levelDownClosed Q E hE d)).matrix*f.matrix := by + change lowMatrix Q E F f.matrix d * blockInclusion Q F (lowerLevelSet Q F d)= + blockInclusion Q E (lowerLevelSet Q E d)*f.matrix + rw [blockInclusion_mul Q E (lowerLevelSet Q E d) _ _ f.entries] + apply Matrix.ext + intro i j + change (∑ k:lowerLevelSet Q F d,f.matrix i k* + (if (k:J)=j then vertexId Q (K:=K) (F.placement k).color else 0))=f.matrix i j + by_cases hj:j∈lowerLevelSet Q F d + · let j':lowerLevelSet Q F d:=⟨j,hj⟩ + have he (k:lowerLevelSet Q F d) : ((k:J)=j)↔k=j' := by simp only [j',Subtype.ext_iff] + simp only [he,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] + exact f.entries.2 i j + · have hz:f.matrix i j=0 := by + by_contra hn + exact hj (le_trans (map_level_bound Q f i j hn) i.property) + rw [hz] + apply Finset.sum_eq_zero + intro k _ + have hn:(k:J)≠j:=fun he=>hj (he ▸ k.property) + rw [ite_eq_right hn,MulZeroClass.mul_zero] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncation.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncation.lean index 565bb6ee711f2c9ad02bc074016ce007f336572f..ca3efbc6e36c5d455a6fd986b0fafb8476f97346 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncation.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncation.lean @@ -1,38 +1,38 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.UpperBound -import OAI.Topology.ArtinGroups.Complexes.DownClosed -import OAI.Topology.ArtinGroups.Complexes.LowMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type u} [Fintype I] [DecidableEq I] -attribute [local instance] Classical.decEq -attribute [local instance] Classical.propDecidable - -noncomputable def classLowerTruncation (d:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : - FiniteHomotopyClass Q (K:=K) := - classOfComplex Q (lowerTruncation Q (minimalClassModel Q x).complex (minimalClassModel_minimal Q x) d) - -omit [Fintype V] [DecidableEq A] in -lemma classLowerTruncation_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : - classLowerTruncation Q d (classOfComplex Q E)=classOfComplex Q (lowerTruncation Q E hE d) := - classOfComplex_eq Q ((minimalClassModelEquivalence Q E).lowerTruncation Q - (minimalClassModel_minimal Q _) hE d) - -omit [Fintype V] [DecidableEq A] in -lemma classLowerTruncation_cap (d:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : - ClassUpperBound Q d (classLowerTruncation Q d x) := - classUpperBound_of_representative Q _ (fun i=>i.property) - -omit [Fintype V] [DecidableEq A] in -lemma classLowerTruncation_floor (d a:ℤ) (x:FiniteHomotopyClass Q (K:=K)) - (hx:ClassLowerBound Q a x) : ClassLowerBound Q a (classLowerTruncation Q d x) := - classLowerBound_of_representative Q _ (fun i=>hx i) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.UpperBound +import OAI.Topology.ArtinGroups.Complexes.DownClosed +import OAI.Topology.ArtinGroups.Complexes.LowMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] +attribute [local instance] Classical.decEq +attribute [local instance] Classical.propDecidable + +noncomputable def classLowerTruncation (d:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : + FiniteHomotopyClass Q (K:=K) := + classOfComplex Q (lowerTruncation Q (minimalClassModel Q x).complex (minimalClassModel_minimal Q x) d) + +omit [Fintype V] [DecidableEq A] in +lemma classLowerTruncation_minimal (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (d:ℤ) : + classLowerTruncation Q d (classOfComplex Q E)=classOfComplex Q (lowerTruncation Q E hE d) := + classOfComplex_eq Q ((minimalClassModelEquivalence Q E).lowerTruncation Q + (minimalClassModel_minimal Q _) hE d) + +omit [Fintype V] [DecidableEq A] in +lemma classLowerTruncation_cap (d:ℤ) (x:FiniteHomotopyClass Q (K:=K)) : + ClassUpperBound Q d (classLowerTruncation Q d x) := + classUpperBound_of_representative Q _ (fun i=>i.property) + +omit [Fintype V] [DecidableEq A] in +lemma classLowerTruncation_floor (d a:ℤ) (x:FiniteHomotopyClass Q (K:=K)) + (hx:ClassLowerBound Q a x) : ClassLowerBound Q a (classLowerTruncation Q d x) := + classLowerBound_of_representative Q _ (fun i=>hx i) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncationLayerFloor.lean b/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncationLayerFloor.lean index cf461812dc5467badfaf6630be076e6117e12141..e40bf34fa434745b742ae98c44dc645580ecf979 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncationLayerFloor.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/LowerTruncationLayerFloor.lean @@ -1,88 +1,88 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.LevelArrayComplexMinimal -import OAI.Topology.ArtinGroups.Complexes.TotalVectorLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in -lemma classLowerTruncation_eq_layer_of_floor (x:FiniteHomotopyClass Q (K:=K)) - (q:ℤ) (hx:ClassLowerBound Q q x) : - classLowerTruncation Q q x=classLayer Q q x := by - have hp:=classLayer_eq_self_of_bounds Q (classLowerTruncation Q q x) q - (classLowerTruncation_floor Q q q x hx) (classLowerTruncation_cap Q q x) - have hl:=classLayer_lowerTruncation Q (minimalClassModel Q x).complex - (minimalClassModel_minimal Q x) q - have hxx:classOfComplex Q (minimalClassModel Q x).complex=x:=minimalClassModel_class Q x - rw [hxx] at hl - exact hp.symm.trans hl - -omit [Fintype V] [DecidableEq A] in -theorem classSignedVector_two_levels (x:FiniteHomotopyClass Q (K:=K)) - (q:ℤ) (hl:ClassLowerBound Q q x) (hh:ClassUpperBound Q (q+1) x) : - classSignedVector Q x=cochainSign (K:=ℝ) q • - (classTotalVector Q (classLayer Q q x)-classTotalVector Q (classLayer Q (q+1) x)) := by - rw [classSignedVector_upper_partition Q x (q+1) hh] - rw [show q+1-1=q by omega,classLowerTruncation_eq_layer_of_floor Q x q hl] - rw [classSignedVector_pure Q _ q (classLayer_lowerBound Q x q) (classLayer_upperBound Q x q), - classSignedVector_pure Q _ (q+1) (classLayer_lowerBound Q x (q+1)) (classLayer_upperBound Q x (q+1)), - cochainSign_add_one,neg_smul,smul_sub,sub_eq_add_neg] - -lemma classPacketPerm_upper_add_one {P:Type u} [Fintype P] [DecidableEq P] - (hn:∀ a,Q.source a≠Q.target a) (v:P→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (x:FiniteHomotopyClass Q (K:=K)) {q:ℤ} (hx:ClassUpperBound Q q x) : - ClassUpperBound Q (q+1) (classPacketPerm Q hn v hv x) := by - rw [← minimalClassModel_class Q x,classPacketPerm_apply] - apply classUpperBound_of_representative Q - intro i - rcases i with ⟨b,i⟩|i - · change ((minimalClassModel Q x).complex.placement i.1).cochain-1+ - (((minimalClassModel Q x).complex.placement i.1).internal+Path.length i.2.val)≤q+1 - have hi:=hx i.1 - have hl:Path.length i.2.val≤2:=by rcases Path.length_cases i.2.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hi - omega - · change ((minimalClassModel Q x).complex.placement i).level≤q+1 - have hi:=hx i - omega - -omit [Fintype V] [DecidableEq A] in -lemma classTotalVector_layer_nonneg (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) : - 0≤classTotalVector Q (classLayer Q q x) α := by - rw [classTotalVector_layer_apply] - exact Nat.cast_nonneg _ - -omit [Fintype V] [DecidableEq A] in -lemma classUpperBound_of_upper_layer_zero (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) - (hh:ClassUpperBound Q (q+1) x) - (hz:classTotalVector Q (classLayer Q (q+1) x)=0) : ClassUpperBound Q q x := by - intro i - have hi:=hh i - by_contra hn - have he:((minimalClassModel Q x).complex.placement i).level=q+1 := by omega - have hc:=congrFun hz ((minimalClassModel Q x).complex.placement i).color - rw [classTotalVector_layer_apply] at hc - have hc0:classLevelArray Q x (((minimalClassModel Q x).complex.placement i).color,q+1)=0 := - by simpa only [Nat.cast_eq_zero,Pi.zero_apply] using hc - have harr:classLevelArray Q x=(minimalClassModel Q x).complex.levelArray Q := by - have hmodel : classOfComplex Q (minimalClassModel Q x).complex=x := minimalClassModel_class Q x - exact (congrArg (classLevelArray Q) hmodel).symm.trans - (classLevelArray_complex_minimal Q (minimalClassModel Q x).complex (minimalClassModel_minimal Q x)) - rw [harr] at hc0 - rw [levelArray_apply,Nat.card_eq_fintype_card] at hc0 - have hp:0OrthogonalVertices Q (v a) (v b)) + (x:FiniteHomotopyClass Q (K:=K)) {q:ℤ} (hx:ClassUpperBound Q q x) : + ClassUpperBound Q (q+1) (classPacketPerm Q hn v hv x) := by + rw [← minimalClassModel_class Q x,classPacketPerm_apply] + apply classUpperBound_of_representative Q + intro i + rcases i with ⟨b,i⟩|i + · change ((minimalClassModel Q x).complex.placement i.1).cochain-1+ + (((minimalClassModel Q x).complex.placement i.1).internal+Path.length i.2.val)≤q+1 + have hi:=hx i.1 + have hl:Path.length i.2.val≤2:=by rcases Path.length_cases i.2.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hi + omega + · change ((minimalClassModel Q x).complex.placement i).level≤q+1 + have hi:=hx i + omega + +omit [Fintype V] [DecidableEq A] in +lemma classTotalVector_layer_nonneg (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) (α:V) : + 0≤classTotalVector Q (classLayer Q q x) α := by + rw [classTotalVector_layer_apply] + exact Nat.cast_nonneg _ + +omit [Fintype V] [DecidableEq A] in +lemma classUpperBound_of_upper_layer_zero (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) + (hh:ClassUpperBound Q (q+1) x) + (hz:classTotalVector Q (classLayer Q (q+1) x)=0) : ClassUpperBound Q q x := by + intro i + have hi:=hh i + by_contra hn + have he:((minimalClassModel Q x).complex.placement i).level=q+1 := by omega + have hc:=congrFun hz ((minimalClassModel Q x).complex.placement i).color + rw [classTotalVector_layer_apply] at hc + have hc0:classLevelArray Q x (((minimalClassModel Q x).complex.placement i).color,q+1)=0 := + by simpa only [Nat.cast_eq_zero,Pi.zero_apply] using hc + have harr:classLevelArray Q x=(minimalClassModel Q x).complex.levelArray Q := by + have hmodel : classOfComplex Q (minimalClassModel Q x).complex=x := minimalClassModel_class Q x + exact (congrArg (classLevelArray Q) hmodel).symm.trans + (classLevelArray_complex_minimal Q (minimalClassModel Q x).complex (minimalClassModel_minimal Q x)) + rw [harr] at hc0 + rw [levelArray_apply,Nat.card_eq_fintype_card] at hc0 + have hp:0classLowerTruncation Q d (x i)) := by - classical - let E (i:I):=(minimalClassModel Q (x i)).complex - have hE (i:I):(E i).IsMinimal Q:=minimalClassModel_minimal Q (x i) - have hx:x=fun i=>classOfComplex Q (E i):=funext fun i=>(minimalClassModel_class Q (x i)).symm - rw [hx,classSum_complex,classLowerTruncation_minimal Q _ (finiteSum_minimal Q E hE)] - simp_rw [classLowerTruncation_minimal Q _ (hE _)] - rw [classSum_complex,← sumTruncation_eq] - exact classOfComplex_reindex Q _ _ - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_sum (d:ℤ) (x:I→FiniteHomotopyClass Q (K:=K)) : - classLayer Q d (classSum Q x)=classSum Q (fun i=>classLayer Q d (x i)) := by - classical - let E (i:I):=(minimalClassModel Q (x i)).complex - have hE (i:I):(E i).IsMinimal Q:=minimalClassModel_minimal Q (x i) - have hx:x=fun i=>classOfComplex Q (E i):=funext fun i=>(minimalClassModel_class Q (x i)).symm - rw [hx,classSum_complex,classLayer_minimal Q _ (finiteSum_minimal Q E hE)] - simp_rw [classLayer_minimal Q _ (hE _)] - rw [classSum_complex,← sumLayer_eq] - exact classOfComplex_reindex Q _ _ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Sum +import OAI.Topology.ArtinGroups.Complexes.LowerTruncation +import OAI.Topology.ArtinGroups.Complexes.SumTruncationEquiv + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] + +omit [Fintype V] [DecidableEq A] in +lemma classLowerTruncation_sum (d:ℤ) (x:I→FiniteHomotopyClass Q (K:=K)) : + classLowerTruncation Q d (classSum Q x)=classSum Q (fun i=>classLowerTruncation Q d (x i)) := by + classical + let E (i:I):=(minimalClassModel Q (x i)).complex + have hE (i:I):(E i).IsMinimal Q:=minimalClassModel_minimal Q (x i) + have hx:x=fun i=>classOfComplex Q (E i):=funext fun i=>(minimalClassModel_class Q (x i)).symm + rw [hx,classSum_complex,classLowerTruncation_minimal Q _ (finiteSum_minimal Q E hE)] + simp_rw [classLowerTruncation_minimal Q _ (hE _)] + rw [classSum_complex,← sumTruncation_eq] + exact classOfComplex_reindex Q _ _ + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_sum (d:ℤ) (x:I→FiniteHomotopyClass Q (K:=K)) : + classLayer Q d (classSum Q x)=classSum Q (fun i=>classLayer Q d (x i)) := by + classical + let E (i:I):=(minimalClassModel Q (x i)).complex + have hE (i:I):(E i).IsMinimal Q:=minimalClassModel_minimal Q (x i) + have hx:x=fun i=>classOfComplex Q (E i):=funext fun i=>(minimalClassModel_class Q (x i)).symm + rw [hx,classSum_complex,classLayer_minimal Q _ (finiteSum_minimal Q E hE)] + simp_rw [classLayer_minimal Q _ (hE _)] + rw [classSum_complex,← sumLayer_eq] + exact classOfComplex_reindex Q _ _ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/MatrixOneMulExtend.lean b/lean/OAI/Topology/ArtinGroups/Complexes/MatrixOneMulExtend.lean index 48086bb9564c76abc9e19eeefaa8b5e79dfc609e..7f70b2ea8f556821b8d49fb634213c9c1a50f616 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/MatrixOneMulExtend.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/MatrixOneMulExtend.lean @@ -1,98 +1,98 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.RestrictLayer -import OAI.Topology.ArtinGroups.Quivers.PathTwo - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J : Type*} [Fintype I] [Fintype J] - -lemma matrixOne_mul_extendLayer (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (l k : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - : - matrixOne Q E.differential * extendLayer Q E F l k f = - extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f) := by - classical - apply Matrix.ext - intro i j - rw [Matrix.mul_apply, extendLayer_entry] - split_ifs with hi hj - · change (∑ t, pathOne Q (E.differential i t) * extendLayer Q E F l k f t j) = - ∑ t : {i // (E.placement i).level = l}, E.differential i t * f t ⟨j, hj⟩ - symm - apply Fintype.sum_of_injective Subtype.val Subtype.val_injective - · intro t ht - have hh : (E.placement t).level ≠ l := fun h => ht ⟨⟨t, h⟩, rfl⟩ - rw [extendLayer_entry, dite_eq_right hh, MulZeroClass.mul_zero] - · intro t - rw [extendLayer_entry, dite_eq_left t.property, dite_eq_left hj] - exact congrArg (fun z : Q.Zigzag K => z * f t ⟨j, hj⟩) - (pathOne_eq_self Q (E.pureLayer_linear Q hE l ⟨i, hi⟩ t).1 - (E.pureLayer_linear Q hE l ⟨i, hi⟩ t).2).symm - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry] - split_ifs <;> exact MulZeroClass.mul_zero _ - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry] - split_ifs with ht hj - · have hz := differential_arrow_level Q E (i := i) (j := t) (fun he => hi (he ▸ ht)) - change pathOne Q (E.differential i t) * f ⟨t, ht⟩ ⟨j, hj⟩ = 0 - rw [pathOne_eq_zero Q hz, MulZeroClass.zero_mul] - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - -lemma extendLayer_mul_matrixOne (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hF : F.IsMinimal Q) (l k : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - : - extendLayer Q E F l k f * matrixOne Q F.differential = - extendLayer Q E F l k (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential)) := by - classical - apply Matrix.ext - intro i j - rw [Matrix.mul_apply, extendLayer_entry] - split_ifs with hi hj - · change (∑ t, extendLayer Q E F l k f i t * pathOne Q (F.differential t j)) = - ∑ t : {j // (F.placement j).level = k}, f ⟨i, hi⟩ t * F.differential t j - symm - apply Fintype.sum_of_injective Subtype.val Subtype.val_injective - · intro t ht - have hh : (F.placement t).level ≠ k := fun h => ht ⟨⟨t, h⟩, rfl⟩ - rw [extendLayer_entry, dite_eq_left hi, dite_eq_right hh, MulZeroClass.zero_mul] - · intro t - rw [extendLayer_entry, dite_eq_left hi, dite_eq_left t.property] - exact congrArg (fun z : Q.Zigzag K => f ⟨i, hi⟩ t * z) - (pathOne_eq_self Q (F.pureLayer_linear Q hF k t ⟨j, hj⟩).1 - (F.pureLayer_linear Q hF k t ⟨j, hj⟩).2).symm - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry, dite_eq_left hi] - split_ifs with ht - · have hz := differential_arrow_level Q F (i := t) (j := j) (fun he => hj (he.trans ht)) - change f ⟨i, hi⟩ ⟨t, ht⟩ * pathOne Q (F.differential t j) = 0 - rw [pathOne_eq_zero Q hz, MulZeroClass.mul_zero] - · exact MulZeroClass.zero_mul _ - · apply Finset.sum_eq_zero - intro t _ - rw [extendLayer_entry, dite_eq_right hi, MulZeroClass.zero_mul] - -lemma linearHomDifferential_extendLayer (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (l k n : ℤ) - (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) : - linearHomDifferential Q E F n (extendLayer Q E F l k f) = extendLayer Q E F l k - (homDifferential Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n f) := by - change matrixOne Q E.differential * extendLayer Q E F l k f - - cochainSign (K := K) n • (extendLayer Q E F l k f * matrixOne Q F.differential) = - extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f - - cochainSign (K := K) n • (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential))) - rw [map_sub, map_smul, matrixOne_mul_extendLayer Q E F hE, extendLayer_mul_matrixOne Q E F hF] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.RestrictLayer +import OAI.Topology.ArtinGroups.Quivers.PathTwo + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J : Type*} [Fintype I] [Fintype J] + +lemma matrixOne_mul_extendLayer (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (l k : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + : + matrixOne Q E.differential * extendLayer Q E F l k f = + extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f) := by + classical + apply Matrix.ext + intro i j + rw [Matrix.mul_apply, extendLayer_entry] + split_ifs with hi hj + · change (∑ t, pathOne Q (E.differential i t) * extendLayer Q E F l k f t j) = + ∑ t : {i // (E.placement i).level = l}, E.differential i t * f t ⟨j, hj⟩ + symm + apply Fintype.sum_of_injective Subtype.val Subtype.val_injective + · intro t ht + have hh : (E.placement t).level ≠ l := fun h => ht ⟨⟨t, h⟩, rfl⟩ + rw [extendLayer_entry, dite_eq_right hh, MulZeroClass.mul_zero] + · intro t + rw [extendLayer_entry, dite_eq_left t.property, dite_eq_left hj] + exact congrArg (fun z : Q.Zigzag K => z * f t ⟨j, hj⟩) + (pathOne_eq_self Q (E.pureLayer_linear Q hE l ⟨i, hi⟩ t).1 + (E.pureLayer_linear Q hE l ⟨i, hi⟩ t).2).symm + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry] + split_ifs <;> exact MulZeroClass.mul_zero _ + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry] + split_ifs with ht hj + · have hz := differential_arrow_level Q E (i := i) (j := t) (fun he => hi (he ▸ ht)) + change pathOne Q (E.differential i t) * f ⟨t, ht⟩ ⟨j, hj⟩ = 0 + rw [pathOne_eq_zero Q hz, MulZeroClass.zero_mul] + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + +lemma extendLayer_mul_matrixOne (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hF : F.IsMinimal Q) (l k : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + : + extendLayer Q E F l k f * matrixOne Q F.differential = + extendLayer Q E F l k (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential)) := by + classical + apply Matrix.ext + intro i j + rw [Matrix.mul_apply, extendLayer_entry] + split_ifs with hi hj + · change (∑ t, extendLayer Q E F l k f i t * pathOne Q (F.differential t j)) = + ∑ t : {j // (F.placement j).level = k}, f ⟨i, hi⟩ t * F.differential t j + symm + apply Fintype.sum_of_injective Subtype.val Subtype.val_injective + · intro t ht + have hh : (F.placement t).level ≠ k := fun h => ht ⟨⟨t, h⟩, rfl⟩ + rw [extendLayer_entry, dite_eq_left hi, dite_eq_right hh, MulZeroClass.zero_mul] + · intro t + rw [extendLayer_entry, dite_eq_left hi, dite_eq_left t.property] + exact congrArg (fun z : Q.Zigzag K => f ⟨i, hi⟩ t * z) + (pathOne_eq_self Q (F.pureLayer_linear Q hF k t ⟨j, hj⟩).1 + (F.pureLayer_linear Q hF k t ⟨j, hj⟩).2).symm + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry, dite_eq_left hi] + split_ifs with ht + · have hz := differential_arrow_level Q F (i := t) (j := j) (fun he => hj (he.trans ht)) + change f ⟨i, hi⟩ ⟨t, ht⟩ * pathOne Q (F.differential t j) = 0 + rw [pathOne_eq_zero Q hz, MulZeroClass.mul_zero] + · exact MulZeroClass.zero_mul _ + · apply Finset.sum_eq_zero + intro t _ + rw [extendLayer_entry, dite_eq_right hi, MulZeroClass.zero_mul] + +lemma linearHomDifferential_extendLayer (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (l k n : ℤ) + (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) : + linearHomDifferential Q E F n (extendLayer Q E F l k f) = extendLayer Q E F l k + (homDifferential Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n f) := by + change matrixOne Q E.differential * extendLayer Q E F l k f - + cochainSign (K := K) n • (extendLayer Q E F l k f * matrixOne Q F.differential) = + extendLayer Q E F l k ((show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * f - + cochainSign (K := K) n • (f * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential))) + rw [map_sub, map_smul, matrixOne_mul_extendLayer Q E F hE, extendLayer_mul_matrixOne Q E F hF] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Middle.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Middle.lean index 36702baaf11293eaa39f32617a4118032dedc44a..5d6cb151cc33635d66a2ce3e2dcbfdd94300fe3a 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Middle.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Middle.lean @@ -1,76 +1,76 @@ -import Mathlib - -namespace OAI - -namespace HarmonicArtin.LinearLayers - -open Module - -variable {K V₀ V₁ V₂ W₀ W₁ : Type*} [Field K] - [AddCommGroup V₀] [Module K V₀] - [AddCommGroup V₁] [Module K V₁] - [AddCommGroup V₂] [Module K V₂] - [AddCommGroup W₀] [Module K W₀] - [AddCommGroup W₁] [Module K W₁] - -abbrev Middle (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) := - LinearMap.ker g ⧸ (LinearMap.range f).comap (LinearMap.ker g).subtype - -theorem range_le_ker_of_comp_zero (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) - (h : g.comp f = 0) : LinearMap.range f ≤ LinearMap.ker g := by - rintro _ ⟨x, rfl⟩ - exact LinearMap.congr_fun h x - -theorem three_column_euler [FiniteDimensional K V₀] [FiniteDimensional K V₁] - [FiniteDimensional K V₂] (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) - (h : g.comp f = 0) : - finrank K V₀ + finrank K V₂ + finrank K (Middle f g) = - finrank K V₁ + finrank K (LinearMap.ker f) + - finrank K (V₂ ⧸ LinearMap.range g) := by - have hf := f.finrank_range_add_finrank_ker - have hg := g.finrank_range_add_finrank_ker - have hq := (LinearMap.range g).finrank_quotient_add_finrank - have hm := ((LinearMap.range f).comap (LinearMap.ker g).subtype).finrank_quotient_add_finrank - have he := (Submodule.comapSubtypeEquivOfLe (range_le_ker_of_comp_zero f g h)).finrank_eq - change finrank K (Middle f g) + - finrank K ((LinearMap.range f).comap (LinearMap.ker g).subtype) = - finrank K (LinearMap.ker g) at hm - omega - -theorem rank_eq_of_adjoint (g : V₁ →ₗ[K] V₂) (f : W₀ →ₗ[K] W₁) - (e₀ : W₀ ≃ₗ[K] Module.Dual K V₂) (e₁ : W₁ ≃ₗ[K] Module.Dual K V₁) - (h : e₁.toLinearMap.comp f = g.dualMap.comp e₀.toLinearMap) : - finrank K (LinearMap.range f) = finrank K (LinearMap.range g) := by - have hr := congrArg (fun l : W₀ →ₗ[K] Module.Dual K V₁ => - finrank K (LinearMap.range l)) h - rw [LinearMap.range_comp, LinearMap.range_comp, - LinearEquiv.range, Submodule.map_top] at hr - rw [e₁.finrank_map_eq, LinearMap.finrank_range_dualMap_eq_finrank_range] at hr - exact hr - -theorem kernel_cokernel_dimension [FiniteDimensional K V₂] [FiniteDimensional K W₀] - (g : V₁ →ₗ[K] V₂) (f : W₀ →ₗ[K] W₁) - (e₀ : W₀ ≃ₗ[K] Module.Dual K V₂) (e₁ : W₁ ≃ₗ[K] Module.Dual K V₁) - (h : e₁.toLinearMap.comp f = g.dualMap.comp e₀.toLinearMap) : - finrank K (LinearMap.ker f) = finrank K (V₂ ⧸ LinearMap.range g) := by - have hf := f.finrank_range_add_finrank_ker - have hq := (LinearMap.range g).finrank_quotient_add_finrank - have hr := rank_eq_of_adjoint g f e₀ e₁ h - have he : finrank K W₀ = finrank K V₂ := - e₀.finrank_eq.trans (Subspace.dual_finrank_eq) - omega - -theorem paired_euler [FiniteDimensional K V₀] [FiniteDimensional K V₁] - [FiniteDimensional K V₂] [FiniteDimensional K W₀] - (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (hgf : g.comp f = 0) - (f' : W₀ →ₗ[K] W₁) - (e₀ : W₀ ≃ₗ[K] Module.Dual K V₂) (e₁ : W₁ ≃ₗ[K] Module.Dual K V₁) - (hadj : e₁.toLinearMap.comp f' = g.dualMap.comp e₀.toLinearMap) : - finrank K V₀ + finrank K V₂ + finrank K (Middle f g) = - finrank K V₁ + finrank K (LinearMap.ker f) + finrank K (LinearMap.ker f') := by - rw [kernel_cokernel_dimension g f' e₀ e₁ hadj] - exact three_column_euler f g hgf - -end HarmonicArtin.LinearLayers - -end OAI +import Mathlib + +namespace OAI + +namespace HarmonicArtin.LinearLayers + +open Module + +variable {K V₀ V₁ V₂ W₀ W₁ : Type*} [Field K] + [AddCommGroup V₀] [Module K V₀] + [AddCommGroup V₁] [Module K V₁] + [AddCommGroup V₂] [Module K V₂] + [AddCommGroup W₀] [Module K W₀] + [AddCommGroup W₁] [Module K W₁] + +abbrev Middle (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) := + LinearMap.ker g ⧸ (LinearMap.range f).comap (LinearMap.ker g).subtype + +theorem range_le_ker_of_comp_zero (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) + (h : g.comp f = 0) : LinearMap.range f ≤ LinearMap.ker g := by + rintro _ ⟨x, rfl⟩ + exact LinearMap.congr_fun h x + +theorem three_column_euler [FiniteDimensional K V₀] [FiniteDimensional K V₁] + [FiniteDimensional K V₂] (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) + (h : g.comp f = 0) : + finrank K V₀ + finrank K V₂ + finrank K (Middle f g) = + finrank K V₁ + finrank K (LinearMap.ker f) + + finrank K (V₂ ⧸ LinearMap.range g) := by + have hf := f.finrank_range_add_finrank_ker + have hg := g.finrank_range_add_finrank_ker + have hq := (LinearMap.range g).finrank_quotient_add_finrank + have hm := ((LinearMap.range f).comap (LinearMap.ker g).subtype).finrank_quotient_add_finrank + have he := (Submodule.comapSubtypeEquivOfLe (range_le_ker_of_comp_zero f g h)).finrank_eq + change finrank K (Middle f g) + + finrank K ((LinearMap.range f).comap (LinearMap.ker g).subtype) = + finrank K (LinearMap.ker g) at hm + omega + +theorem rank_eq_of_adjoint (g : V₁ →ₗ[K] V₂) (f : W₀ →ₗ[K] W₁) + (e₀ : W₀ ≃ₗ[K] Module.Dual K V₂) (e₁ : W₁ ≃ₗ[K] Module.Dual K V₁) + (h : e₁.toLinearMap.comp f = g.dualMap.comp e₀.toLinearMap) : + finrank K (LinearMap.range f) = finrank K (LinearMap.range g) := by + have hr := congrArg (fun l : W₀ →ₗ[K] Module.Dual K V₁ => + finrank K (LinearMap.range l)) h + rw [LinearMap.range_comp, LinearMap.range_comp, + LinearEquiv.range, Submodule.map_top] at hr + rw [e₁.finrank_map_eq, LinearMap.finrank_range_dualMap_eq_finrank_range] at hr + exact hr + +theorem kernel_cokernel_dimension [FiniteDimensional K V₂] [FiniteDimensional K W₀] + (g : V₁ →ₗ[K] V₂) (f : W₀ →ₗ[K] W₁) + (e₀ : W₀ ≃ₗ[K] Module.Dual K V₂) (e₁ : W₁ ≃ₗ[K] Module.Dual K V₁) + (h : e₁.toLinearMap.comp f = g.dualMap.comp e₀.toLinearMap) : + finrank K (LinearMap.ker f) = finrank K (V₂ ⧸ LinearMap.range g) := by + have hf := f.finrank_range_add_finrank_ker + have hq := (LinearMap.range g).finrank_quotient_add_finrank + have hr := rank_eq_of_adjoint g f e₀ e₁ h + have he : finrank K W₀ = finrank K V₂ := + e₀.finrank_eq.trans (Subspace.dual_finrank_eq) + omega + +theorem paired_euler [FiniteDimensional K V₀] [FiniteDimensional K V₁] + [FiniteDimensional K V₂] [FiniteDimensional K W₀] + (f : V₀ →ₗ[K] V₁) (g : V₁ →ₗ[K] V₂) (hgf : g.comp f = 0) + (f' : W₀ →ₗ[K] W₁) + (e₀ : W₀ ≃ₗ[K] Module.Dual K V₂) (e₁ : W₁ ≃ₗ[K] Module.Dual K V₁) + (hadj : e₁.toLinearMap.comp f' = g.dualMap.comp e₀.toLinearMap) : + finrank K V₀ + finrank K V₂ + finrank K (Middle f g) = + finrank K V₁ + finrank K (LinearMap.ker f) + finrank K (LinearMap.ker f') := by + rw [kernel_cokernel_dimension g f' e₀ e₁ hadj] + exact three_column_euler f g hgf + +end HarmonicArtin.LinearLayers + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalEmbedding.lean b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalEmbedding.lean index 6df2ab7e0945ea52297ef985193f292e45c1a905..f4ecae13daa4a52468468de49a2bd87ba64c774d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalEmbedding.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalEmbedding.lean @@ -1,42 +1,42 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.FiniteModel - -universe u - -variable {V A K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - -theorem exists_minimal_embedding (E : FiniteModel.{u} Q (K := K)) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q E.complex F.complex) ∧ - ∃ e : F.Index ↪ E.Index, ∀ i, F.complex.placement i = E.complex.placement (e i) := by - have h : ∀ n (B : FiniteModel.{u} Q (K := K)), Fintype.card B.Index = n → - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q B.complex F.complex) ∧ - ∃ e : F.Index ↪ B.Index, - ∀ i, F.complex.placement i = B.complex.placement (e i) := by - intro n - induction n using Nat.strong_induction_on with - | h n ih => - intro B hn - by_cases hm : B.complex.IsMinimal Q - · exact ⟨B, hm, ⟨HomotopyEquivalence.refl Q B.complex⟩, - Function.Embedding.refl _, fun _ => rfl⟩ - · obtain ⟨p⟩ := scalarPivot_of_not_minimal Q B.complex hm - let C := ofComplex Q (p.reduced Q) - have hc : Fintype.card C.Index < n := by - dsimp only [C, ofComplex] - rw [← hn] - exact p.retained_card_lt Q - obtain ⟨F, hF, ⟨e⟩, j, hj⟩ := ih (Fintype.card C.Index) hc C rfl - exact ⟨F, hF, ⟨(p.reductionEquivalence Q).trans Q e⟩, - j.trans ⟨Subtype.val, Subtype.val_injective⟩, hj⟩ - exact h (Fintype.card E.Index) E rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.FiniteModel - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.FiniteModel + +universe u + +variable {V A K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + +theorem exists_minimal_embedding (E : FiniteModel.{u} Q (K := K)) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q E.complex F.complex) ∧ + ∃ e : F.Index ↪ E.Index, ∀ i, F.complex.placement i = E.complex.placement (e i) := by + have h : ∀ n (B : FiniteModel.{u} Q (K := K)), Fintype.card B.Index = n → + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q B.complex F.complex) ∧ + ∃ e : F.Index ↪ B.Index, + ∀ i, F.complex.placement i = B.complex.placement (e i) := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro B hn + by_cases hm : B.complex.IsMinimal Q + · exact ⟨B, hm, ⟨HomotopyEquivalence.refl Q B.complex⟩, + Function.Embedding.refl _, fun _ => rfl⟩ + · obtain ⟨p⟩ := scalarPivot_of_not_minimal Q B.complex hm + let C := ofComplex Q (p.reduced Q) + have hc : Fintype.card C.Index < n := by + dsimp only [C, ofComplex] + rw [← hn] + exact p.retained_card_lt Q + obtain ⟨F, hF, ⟨e⟩, j, hj⟩ := ih (Fintype.card C.Index) hc C rfl + exact ⟨F, hF, ⟨(p.reductionEquivalence Q).trans Q e⟩, + j.trans ⟨Subtype.val, Subtype.val_injective⟩, hj⟩ + exact h (Fintype.card E.Index) E rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex.FiniteModel + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalGeneratorDualCycle.lean b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalGeneratorDualCycle.lean index ab03d2de8a3daaab80ba43a16fee5ddc775c30d0..be4e0cd9c508f6732de9447e1cbf6d0614fa842b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalGeneratorDualCycle.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalGeneratorDualCycle.lean @@ -1,72 +1,72 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.VertexLinear - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -theorem minimal_generator_dual_cycle - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) (j : J) : - ∃ x : I → K, x ≠ 0 ∧ - (∀ i, E.placement i ≠ F.placement j → x i = 0) ∧ - ∀ k, ∑ i, (E.differential k i).vertex (F.placement j).color * x i = 0 := by - have hf0 i k w : (F.differential i k).vertex w = 0 := congrFun (hF i k) w - let x : I → K := fun i => (e.forward.matrix i j).vertex (F.placement j).color - refine ⟨x, ?_, ?_, ?_⟩ - · intro hx - have he := congrArg (fun M : Matrix J J (Q.Zigzag K) => - (M j j).vertex (F.placement j).color) e.targetEquation - have hz i : (e.forward.matrix i j).vertex (F.placement j).color = 0 := - congrFun hx i - simp only [Matrix.mul_apply, Matrix.add_apply, vertex_add, Pi.add_apply, vertex_sum, - Finset.sum_apply, vertex_mul, Pi.mul_apply, hf0, hz, - MulZeroClass.zero_mul, MulZeroClass.mul_zero, Finset.sum_const_zero, - add_zero] at he - simp [projectiveIdentity] at he - · intro i hi - by_contra hn - exact hi ((reduction_support Q e.forward.entries e.forward.degree i j - (F.placement j).color hn).1) - · intro k - have he := congrArg (fun M : Matrix I J (Q.Zigzag K) => - (M k j).vertex (F.placement j).color) e.forward.commute - simpa only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, - Pi.mul_apply, hf0, Pi.zero_apply, MulZeroClass.mul_zero, - Finset.sum_const_zero] using he - -theorem minimal_generator_cycle - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) (j : J) : - ∃ x : I → K, x ≠ 0 ∧ - (∀ i, E.placement i ≠ F.placement j → x i = 0) ∧ - ∀ k, ∑ i, x i * (E.differential i k).vertex (F.placement j).color = 0 := by - have hf0 i k w : (F.differential i k).vertex w = 0 := congrFun (hF i k) w - let x : I → K := fun i => (e.backward.matrix j i).vertex (F.placement j).color - refine ⟨x, ?_, ?_, ?_⟩ - · intro hx - have he := congrArg (fun M : Matrix J J (Q.Zigzag K) => - (M j j).vertex (F.placement j).color) e.targetEquation - have hz i : (e.backward.matrix j i).vertex (F.placement j).color = 0 := - congrFun hx i - simp only [Matrix.mul_apply, Matrix.add_apply, vertex_add, Pi.add_apply, vertex_sum, - Finset.sum_apply, vertex_mul, Pi.mul_apply, hf0, hz, - MulZeroClass.zero_mul, MulZeroClass.mul_zero, Finset.sum_const_zero, - add_zero] at he - simp [projectiveIdentity] at he - · intro i hi - by_contra hn - exact hi ((reduction_support Q e.backward.entries e.backward.degree j i - (F.placement j).color hn).1.symm) - · intro k - have he := congrArg (fun M : Matrix J I (Q.Zigzag K) => - (M j k).vertex (F.placement j).color) e.backward.commute - simpa only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, - Pi.mul_apply, hf0, MulZeroClass.zero_mul, Finset.sum_const_zero] using he.symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.VertexLinear + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +theorem minimal_generator_dual_cycle + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) (j : J) : + ∃ x : I → K, x ≠ 0 ∧ + (∀ i, E.placement i ≠ F.placement j → x i = 0) ∧ + ∀ k, ∑ i, (E.differential k i).vertex (F.placement j).color * x i = 0 := by + have hf0 i k w : (F.differential i k).vertex w = 0 := congrFun (hF i k) w + let x : I → K := fun i => (e.forward.matrix i j).vertex (F.placement j).color + refine ⟨x, ?_, ?_, ?_⟩ + · intro hx + have he := congrArg (fun M : Matrix J J (Q.Zigzag K) => + (M j j).vertex (F.placement j).color) e.targetEquation + have hz i : (e.forward.matrix i j).vertex (F.placement j).color = 0 := + congrFun hx i + simp only [Matrix.mul_apply, Matrix.add_apply, vertex_add, Pi.add_apply, vertex_sum, + Finset.sum_apply, vertex_mul, Pi.mul_apply, hf0, hz, + MulZeroClass.zero_mul, MulZeroClass.mul_zero, Finset.sum_const_zero, + add_zero] at he + simp [projectiveIdentity] at he + · intro i hi + by_contra hn + exact hi ((reduction_support Q e.forward.entries e.forward.degree i j + (F.placement j).color hn).1) + · intro k + have he := congrArg (fun M : Matrix I J (Q.Zigzag K) => + (M k j).vertex (F.placement j).color) e.forward.commute + simpa only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, + Pi.mul_apply, hf0, Pi.zero_apply, MulZeroClass.mul_zero, + Finset.sum_const_zero] using he + +theorem minimal_generator_cycle + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) (j : J) : + ∃ x : I → K, x ≠ 0 ∧ + (∀ i, E.placement i ≠ F.placement j → x i = 0) ∧ + ∀ k, ∑ i, x i * (E.differential i k).vertex (F.placement j).color = 0 := by + have hf0 i k w : (F.differential i k).vertex w = 0 := congrFun (hF i k) w + let x : I → K := fun i => (e.backward.matrix j i).vertex (F.placement j).color + refine ⟨x, ?_, ?_, ?_⟩ + · intro hx + have he := congrArg (fun M : Matrix J J (Q.Zigzag K) => + (M j j).vertex (F.placement j).color) e.targetEquation + have hz i : (e.backward.matrix j i).vertex (F.placement j).color = 0 := + congrFun hx i + simp only [Matrix.mul_apply, Matrix.add_apply, vertex_add, Pi.add_apply, vertex_sum, + Finset.sum_apply, vertex_mul, Pi.mul_apply, hf0, hz, + MulZeroClass.zero_mul, MulZeroClass.mul_zero, Finset.sum_const_zero, + add_zero] at he + simp [projectiveIdentity] at he + · intro i hi + by_contra hn + exact hi ((reduction_support Q e.backward.entries e.backward.degree j i + (F.placement j).color hn).1.symm) + · intro k + have he := congrArg (fun M : Matrix J I (Q.Zigzag K) => + (M j k).vertex (F.placement j).color) e.backward.commute + simpa only [Matrix.mul_apply, vertex_sum, Finset.sum_apply, vertex_mul, + Pi.mul_apply, hf0, MulZeroClass.zero_mul, Finset.sum_const_zero] using he.symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModel.lean b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModel.lean index f1e4aac8af393f701ff1cb0638c6cbe03ecdb659..1b495ad7abd3dec6e548381c4bcd902b551f7300 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModel.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModel.lean @@ -1,76 +1,76 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Initial -import OAI.Topology.ArtinGroups.Quivers.LinearMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def minimalClassModel (x : FiniteHomotopyClass Q (K := K)) : - FiniteModel.{u} Q (K := K) := (Quotient.out x).minimalRepresentative Q - -omit [Fintype V] [DecidableEq A] in -lemma minimalClassModel_minimal (x : FiniteHomotopyClass Q (K := K)) : - (minimalClassModel Q x).complex.IsMinimal Q := - FiniteModel.minimalRepresentative_minimal Q _ - -omit [Fintype V] [DecidableEq A] in -lemma minimalClassModel_class (x : FiniteHomotopyClass Q (K := K)) : - Quotient.mk (finiteHomotopySetoid Q) (minimalClassModel Q x) = x := by - calc - _ = Quotient.mk (finiteHomotopySetoid Q) (Quotient.out x) := - Quotient.sound ⟨((Quotient.out x).minimalRepresentativeEquivalence Q).symm Q⟩ - _ = x := Quotient.out_eq x - -omit [DecidableEq A] in -lemma minimalClassModel_homDimension (x y : FiniteHomotopyClass Q (K := K)) (n v : ℤ) : - homDimension Q (minimalClassModel Q x).complex (minimalClassModel Q y).complex n v = - classHomDimension Q n v x y := by - change classHomDimension Q n v (Quotient.mk _ (minimalClassModel Q x)) - (Quotient.mk _ (minimalClassModel Q y)) = _ - rw [minimalClassModel_class, minimalClassModel_class] - -noncomputable def frameModel (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) : - FiniteModel.{u} Q (K := K) := minimalClassModel Q (unfoldedFrame Q hn M hM x α) - -lemma frameModel_minimal (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) : - (frameModel Q (K := K) hn M hM x α).complex.IsMinimal Q := minimalClassModel_minimal Q _ - -lemma frameModel_linear_cycle_boundary (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) - (n v : ℤ) {f : Matrix (frameModel Q (K := K) hn M hM x α).Index - (frameModel Q (K := K) hn M hM x α).Index (Q.Zigzag K)} - (hf : f ∈ homCycles Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x α).complex n v) (hlin : LinearMatrix Q f) : - f ∈ homBoundaries Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x α).complex n v := by - apply linear_selfCycle_boundary Q _ (frameModel_minimal Q hn M hM x α) _ _ n v hf hlin - · intro n v - rw [frameModel, minimalClassModel_homDimension] - exact unfoldedFrame_self_bound Q hn M hM x α n v - · intro n v h - rw [frameModel, minimalClassModel_homDimension] - exact unfoldedFrame_self_support Q hn M hM x α n v h - -lemma frameModel_orthogonal_cycle_boundary (hn : ∀ a, Q.source a ≠ Q.target a) - (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) - {α β : V} (h : OrthogonalVertices Q α β) - (n v : ℤ) {f : Matrix (frameModel Q (K := K) hn M hM x α).Index - (frameModel Q (K := K) hn M hM x β).Index (Q.Zigzag K)} - (hf : f ∈ homCycles Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x β).complex n v) : - f ∈ homBoundaries Q (frameModel Q hn M hM x α).complex - (frameModel Q hn M hM x β).complex n v := by - apply boundary_of_homDimension_zero Q _ _ n v _ hf - exact (minimalClassModel_homDimension Q (unfoldedFrame Q (K := K) hn M hM x α) - (unfoldedFrame Q hn M hM x β) n v).trans - (unfoldedFrame_orthogonal Q (K := K) hn M hM x h n v) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Initial +import OAI.Topology.ArtinGroups.Quivers.LinearMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def minimalClassModel (x : FiniteHomotopyClass Q (K := K)) : + FiniteModel.{u} Q (K := K) := (Quotient.out x).minimalRepresentative Q + +omit [Fintype V] [DecidableEq A] in +lemma minimalClassModel_minimal (x : FiniteHomotopyClass Q (K := K)) : + (minimalClassModel Q x).complex.IsMinimal Q := + FiniteModel.minimalRepresentative_minimal Q _ + +omit [Fintype V] [DecidableEq A] in +lemma minimalClassModel_class (x : FiniteHomotopyClass Q (K := K)) : + Quotient.mk (finiteHomotopySetoid Q) (minimalClassModel Q x) = x := by + calc + _ = Quotient.mk (finiteHomotopySetoid Q) (Quotient.out x) := + Quotient.sound ⟨((Quotient.out x).minimalRepresentativeEquivalence Q).symm Q⟩ + _ = x := Quotient.out_eq x + +omit [DecidableEq A] in +lemma minimalClassModel_homDimension (x y : FiniteHomotopyClass Q (K := K)) (n v : ℤ) : + homDimension Q (minimalClassModel Q x).complex (minimalClassModel Q y).complex n v = + classHomDimension Q n v x y := by + change classHomDimension Q n v (Quotient.mk _ (minimalClassModel Q x)) + (Quotient.mk _ (minimalClassModel Q y)) = _ + rw [minimalClassModel_class, minimalClassModel_class] + +noncomputable def frameModel (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) : + FiniteModel.{u} Q (K := K) := minimalClassModel Q (unfoldedFrame Q hn M hM x α) + +lemma frameModel_minimal (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) : + (frameModel Q (K := K) hn M hM x α).complex.IsMinimal Q := minimalClassModel_minimal Q _ + +lemma frameModel_linear_cycle_boundary (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) (α : V) + (n v : ℤ) {f : Matrix (frameModel Q (K := K) hn M hM x α).Index + (frameModel Q (K := K) hn M hM x α).Index (Q.Zigzag K)} + (hf : f ∈ homCycles Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x α).complex n v) (hlin : LinearMatrix Q f) : + f ∈ homBoundaries Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x α).complex n v := by + apply linear_selfCycle_boundary Q _ (frameModel_minimal Q hn M hM x α) _ _ n v hf hlin + · intro n v + rw [frameModel, minimalClassModel_homDimension] + exact unfoldedFrame_self_bound Q hn M hM x α n v + · intro n v h + rw [frameModel, minimalClassModel_homDimension] + exact unfoldedFrame_self_support Q hn M hM x α n v h + +lemma frameModel_orthogonal_cycle_boundary (hn : ∀ a, Q.source a ≠ Q.target a) + (M : CoxeterMatrix V) (hM : UnfoldedPresentation Q M) (x : Artin M) + {α β : V} (h : OrthogonalVertices Q α β) + (n v : ℤ) {f : Matrix (frameModel Q (K := K) hn M hM x α).Index + (frameModel Q (K := K) hn M hM x β).Index (Q.Zigzag K)} + (hf : f ∈ homCycles Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x β).complex n v) : + f ∈ homBoundaries Q (frameModel Q hn M hM x α).complex + (frameModel Q hn M hM x β).complex n v := by + apply boundary_of_homDimension_zero Q _ _ n v _ hf + exact (minimalClassModel_homDimension Q (unfoldedFrame Q (K := K) hn M hM x α) + (unfoldedFrame Q hn M hM x β) n v).trans + (unfoldedFrame_orthogonal Q (K := K) hn M hM x h n v) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModelEquivalence.lean b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModelEquivalence.lean index 9f6e32354ffaa364af31ea0a34869b152b287313..6169a8425b4f87e9f9cad35d903d08543497459e 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModelEquivalence.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/MinimalModelEquivalence.lean @@ -1,59 +1,59 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModel -import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual -import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex -import OAI.Topology.ArtinGroups.Complexes.Refl -import OAI.Topology.ArtinGroups.Complexes.PureSupportedCycles - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I : Type u} [Fintype I] [DecidableEq I] - -noncomputable def minimalClassModelEquivalence (E : BasedComplex Q (K := K) I) : - HomotopyEquivalence Q (minimalClassModel Q (classOfComplex Q E)).complex E := - Classical.choice (Quotient.exact (minimalClassModel_class Q (classOfComplex Q E))) - -noncomputable def classLayer (d : ℤ) (x : FiniteHomotopyClass Q (K := K)) : - FiniteHomotopyClass Q (K := K) := - classOfComplex Q ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) d) - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_minimal (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) (d : ℤ) : - classLayer Q d (classOfComplex Q E) = classOfComplex Q (E.pureLayer Q hE d) := - classOfComplex_eq Q (((minimalClassModelEquivalence Q E).pureLayer Q - (minimalClassModel_minimal Q _) hE d).toHomotopyEquivalence Q) - -noncomputable def classLayerSocleDimension (d : ℤ) (α : V) (c : ℤ) - (x : FiniteHomotopyClass Q (K := K)) : ℕ := - Module.finrank K (coefficientSocle Q - ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) d) α c) - -noncomputable def classLayerTopDimension (d : ℤ) (α : V) (c : ℤ) - (x : FiniteHomotopyClass Q (K := K)) : ℕ := - Module.finrank K (coefficientTopDual Q - ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) d) α c) - -lemma classLayerSocleDimension_minimal (E : BasedComplex Q (K := K) I) - (hE : E.IsMinimal Q) (d : ℤ) (α : V) (c : ℤ) : - classLayerSocleDimension Q d α c (classOfComplex Q E) = - Module.finrank K (coefficientSocle Q (E.pureLayer Q hE d) α c) := - (((minimalClassModelEquivalence Q E).pureLayer Q - (minimalClassModel_minimal Q _) hE d).coefficientSocle Q - (fun i => i.property) (fun j => j.property) α c).finrank_eq - -lemma classLayerTopDimension_minimal (E : BasedComplex Q (K := K) I) - (hE : E.IsMinimal Q) (d : ℤ) (α : V) (c : ℤ) : - classLayerTopDimension Q d α c (classOfComplex Q E) = - Module.finrank K (coefficientTopDual Q (E.pureLayer Q hE d) α c) := - (((minimalClassModelEquivalence Q E).pureLayer Q - (minimalClassModel_minimal Q _) hE d).coefficientTopDual Q - (fun i => i.property) (fun j => j.property) α c).finrank_eq - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModel +import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDual +import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex +import OAI.Topology.ArtinGroups.Complexes.Refl +import OAI.Topology.ArtinGroups.Complexes.PureSupportedCycles + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I : Type u} [Fintype I] [DecidableEq I] + +noncomputable def minimalClassModelEquivalence (E : BasedComplex Q (K := K) I) : + HomotopyEquivalence Q (minimalClassModel Q (classOfComplex Q E)).complex E := + Classical.choice (Quotient.exact (minimalClassModel_class Q (classOfComplex Q E))) + +noncomputable def classLayer (d : ℤ) (x : FiniteHomotopyClass Q (K := K)) : + FiniteHomotopyClass Q (K := K) := + classOfComplex Q ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) d) + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_minimal (E : BasedComplex Q (K := K) I) (hE : E.IsMinimal Q) (d : ℤ) : + classLayer Q d (classOfComplex Q E) = classOfComplex Q (E.pureLayer Q hE d) := + classOfComplex_eq Q (((minimalClassModelEquivalence Q E).pureLayer Q + (minimalClassModel_minimal Q _) hE d).toHomotopyEquivalence Q) + +noncomputable def classLayerSocleDimension (d : ℤ) (α : V) (c : ℤ) + (x : FiniteHomotopyClass Q (K := K)) : ℕ := + Module.finrank K (coefficientSocle Q + ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) d) α c) + +noncomputable def classLayerTopDimension (d : ℤ) (α : V) (c : ℤ) + (x : FiniteHomotopyClass Q (K := K)) : ℕ := + Module.finrank K (coefficientTopDual Q + ((minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) d) α c) + +lemma classLayerSocleDimension_minimal (E : BasedComplex Q (K := K) I) + (hE : E.IsMinimal Q) (d : ℤ) (α : V) (c : ℤ) : + classLayerSocleDimension Q d α c (classOfComplex Q E) = + Module.finrank K (coefficientSocle Q (E.pureLayer Q hE d) α c) := + (((minimalClassModelEquivalence Q E).pureLayer Q + (minimalClassModel_minimal Q _) hE d).coefficientSocle Q + (fun i => i.property) (fun j => j.property) α c).finrank_eq + +lemma classLayerTopDimension_minimal (E : BasedComplex Q (K := K) I) + (hE : E.IsMinimal Q) (d : ℤ) (α : V) (c : ℤ) : + classLayerTopDimension Q d α c (classOfComplex Q E) = + Module.finrank K (coefficientTopDual Q (E.pureLayer Q hE d) α c) := + (((minimalClassModelEquivalence Q E).pureLayer Q + (minimalClassModel_minimal Q _) hE d).coefficientTopDual Q + (fun i => i.property) (fun j => j.property) α c).finrank_eq + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeAmplitudeCoreIndex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeAmplitudeCoreIndex.lean index ec46e7102a5c185440afcf88e0220789ae931c62..c9cef3dede9d64243d5fa399fe62a1e24601a806 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeAmplitudeCoreIndex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeAmplitudeCoreIndex.lean @@ -1,127 +1,127 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.CotestPlacement -import OAI.Topology.ArtinGroups.Complexes.ActedIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -abbrev NegativeAmplitudeCoreIndex (E : BasedComplex Q (K := K) I) (α : V) := - {u : TestIndex Q E.placement α // Path.length u.2.val ≠ 2} ⊕ - {i : I // (E.placement i).color ≠ α} - -noncomputable instance negativeAmplitudeCoreFintype (E : BasedComplex Q (K := K) I) (α : V) : - Fintype (NegativeAmplitudeCoreIndex Q E α) := by - classical - unfold NegativeAmplitudeCoreIndex - infer_instance - -noncomputable instance negativeAmplitudeCoreDecidable (E : BasedComplex Q (K := K) I) (α : V) : - DecidableEq (NegativeAmplitudeCoreIndex Q E α) := fun a b => instDecidableEqSum a b - -def tokenTest (E : BasedComplex Q (K := K) I) (α : V) (i : ActedIndex Q E α) : - TestIndex Q E.placement α := - ⟨i.val, ⟨.inr (.inr α), rfl, i.property.symm⟩⟩ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma tokenTest_injective (E : BasedComplex Q (K := K) I) (α : V) : - Function.Injective (tokenTest Q E α) := by - intro i j h - exact Subtype.ext (congrArg Sigma.fst h) - -def negativeAmplitudeIndexMap (E : BasedComplex Q (K := K) I) (α : V) : - ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ NegativeAmplitudeCoreIndex Q E α → - I ⊕ TestIndex Q E.placement α - | .inl i => .inl i.val - | .inr (.inl i) => .inr (tokenTest Q E α i) - | .inr (.inr (.inl u)) => .inr u.val - | .inr (.inr (.inr i)) => .inl i.val - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma negativeAmplitudeIndexMap_injective (E : BasedComplex Q (K := K) I) (α : V) : - Function.Injective (negativeAmplitudeIndexMap Q E α) := by - intro i j h - rcases i with i | i | u | i <;> rcases j with j | j | v | j - all_goals dsimp only [negativeAmplitudeIndexMap] at h - all_goals try cases h - · exact congrArg Sum.inl (Subtype.ext (Sum.inl.inj h)) - · exact (j.property ((Sum.inl.inj h) ▸ i.property)).elim - · exact congrArg (fun x => Sum.inr (Sum.inl x)) (tokenTest_injective Q E α (Sum.inr.inj h)) - · have hv := v.property - rw [← Sum.inr.inj h] at hv - exact (hv rfl).elim - · have hu := u.property - rw [Sum.inr.inj h] at hu - exact (hu rfl).elim - · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inl x))) (Subtype.ext (Sum.inr.inj h)) - · exact (i.property ((Sum.inl.inj h).symm ▸ j.property)).elim - · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inr x))) (Subtype.ext (Sum.inl.inj h)) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma negativeAmplitudeIndexMap_surjective (E : BasedComplex Q (K := K) I) (α : V) : - Function.Surjective (negativeAmplitudeIndexMap Q E α) := by - intro u - rcases u with i | ⟨i, ⟨v | a | v, hs, ht⟩⟩ - · by_cases hi : (E.placement i).color = α - · exact ⟨.inl ⟨i, hi⟩, rfl⟩ - · exact ⟨.inr (.inr (.inr ⟨i, hi⟩)), rfl⟩ - · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inl v, hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ - · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inr (.inl a), hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ - · dsimp only [Path.source, Path.target] at hs ht - subst v - exact ⟨.inr (.inl ⟨i, ht.symm⟩), rfl⟩ - -noncomputable def negativeAmplitudeIndexEquiv (E : BasedComplex Q (K := K) I) (α : V) : - ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ NegativeAmplitudeCoreIndex Q E α ≃ - I ⊕ TestIndex Q E.placement α := - Equiv.ofBijective (negativeAmplitudeIndexMap Q E α) - ⟨negativeAmplitudeIndexMap_injective Q E α, negativeAmplitudeIndexMap_surjective Q E α⟩ - -noncomputable def normalizedNegativeAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) - (ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ NegativeAmplitudeCoreIndex Q E α) := - (E.negativeTwist Q α).reindex Q (negativeAmplitudeIndexEquiv Q E α) - -noncomputable def negativeAmplitudePivot (E : BasedComplex Q (K := K) I) (α : V) : - BlockPivot Q (normalizedNegativeAmplitudeTwist Q E α) where - coefficient := 1 - nonzero := one_ne_zero - color i := i.property.symm - cochain i := by change (E.placement i.val).cochain + 1 = (E.placement i.val).cochain + 1; rfl - internal i := by change (E.placement i.val).internal + 2 - 2 = (E.placement i.val).internal; omega - entry i j := by - change coevaluationMatrix Q E.placement α i.val (tokenTest Q E α j) = - (1 : K) • projectiveIdentity Q - (fun j => (normalizedNegativeAmplitudeTwist Q E α).placement (.inl j)) i j - simp only [coevaluationMatrix, tokenTest, Path.dual, pathBasis_vertex, one_smul, - projectiveIdentity, Matrix.diagonal_apply] - change (if i.val = j.val then vertexId Q (K := K) α else 0) = - (if i = j then vertexId Q (E.placement i.val).color else 0) - rw [i.property] - simp only [Subtype.val_inj] - -noncomputable def reducedNegativeAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) (NegativeAmplitudeCoreIndex Q E α) := - (negativeAmplitudePivot Q E α).reduced Q - -noncomputable def negativeAmplitudeTwistReduction (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q (E.negativeTwist Q α) (reducedNegativeAmplitudeTwist Q E α) := - ((E.negativeTwist Q α).reindexHomotopyEquivalence Q (negativeAmplitudeIndexEquiv Q E α)).trans Q - ((negativeAmplitudePivot Q E α).reductionEquivalence Q) - -lemma reducedNegativeAmplitudeTwist_placement (E : BasedComplex Q (K := K) I) (α : V) : - (reducedNegativeAmplitudeTwist Q E α).placement = - fun i => match i with - | .inl u => ⟨α, (E.placement u.val.1).cochain + 1, - (E.placement u.val.1).internal + Path.length u.val.2.val - 2⟩ - | .inr i => E.placement i.val := by - funext i - cases i <;> rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.CotestPlacement +import OAI.Topology.ArtinGroups.Complexes.ActedIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +abbrev NegativeAmplitudeCoreIndex (E : BasedComplex Q (K := K) I) (α : V) := + {u : TestIndex Q E.placement α // Path.length u.2.val ≠ 2} ⊕ + {i : I // (E.placement i).color ≠ α} + +noncomputable instance negativeAmplitudeCoreFintype (E : BasedComplex Q (K := K) I) (α : V) : + Fintype (NegativeAmplitudeCoreIndex Q E α) := by + classical + unfold NegativeAmplitudeCoreIndex + infer_instance + +noncomputable instance negativeAmplitudeCoreDecidable (E : BasedComplex Q (K := K) I) (α : V) : + DecidableEq (NegativeAmplitudeCoreIndex Q E α) := fun a b => instDecidableEqSum a b + +def tokenTest (E : BasedComplex Q (K := K) I) (α : V) (i : ActedIndex Q E α) : + TestIndex Q E.placement α := + ⟨i.val, ⟨.inr (.inr α), rfl, i.property.symm⟩⟩ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma tokenTest_injective (E : BasedComplex Q (K := K) I) (α : V) : + Function.Injective (tokenTest Q E α) := by + intro i j h + exact Subtype.ext (congrArg Sigma.fst h) + +def negativeAmplitudeIndexMap (E : BasedComplex Q (K := K) I) (α : V) : + ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ NegativeAmplitudeCoreIndex Q E α → + I ⊕ TestIndex Q E.placement α + | .inl i => .inl i.val + | .inr (.inl i) => .inr (tokenTest Q E α i) + | .inr (.inr (.inl u)) => .inr u.val + | .inr (.inr (.inr i)) => .inl i.val + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma negativeAmplitudeIndexMap_injective (E : BasedComplex Q (K := K) I) (α : V) : + Function.Injective (negativeAmplitudeIndexMap Q E α) := by + intro i j h + rcases i with i | i | u | i <;> rcases j with j | j | v | j + all_goals dsimp only [negativeAmplitudeIndexMap] at h + all_goals try cases h + · exact congrArg Sum.inl (Subtype.ext (Sum.inl.inj h)) + · exact (j.property ((Sum.inl.inj h) ▸ i.property)).elim + · exact congrArg (fun x => Sum.inr (Sum.inl x)) (tokenTest_injective Q E α (Sum.inr.inj h)) + · have hv := v.property + rw [← Sum.inr.inj h] at hv + exact (hv rfl).elim + · have hu := u.property + rw [Sum.inr.inj h] at hu + exact (hu rfl).elim + · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inl x))) (Subtype.ext (Sum.inr.inj h)) + · exact (i.property ((Sum.inl.inj h).symm ▸ j.property)).elim + · exact congrArg (fun x => Sum.inr (Sum.inr (Sum.inr x))) (Subtype.ext (Sum.inl.inj h)) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma negativeAmplitudeIndexMap_surjective (E : BasedComplex Q (K := K) I) (α : V) : + Function.Surjective (negativeAmplitudeIndexMap Q E α) := by + intro u + rcases u with i | ⟨i, ⟨v | a | v, hs, ht⟩⟩ + · by_cases hi : (E.placement i).color = α + · exact ⟨.inl ⟨i, hi⟩, rfl⟩ + · exact ⟨.inr (.inr (.inr ⟨i, hi⟩)), rfl⟩ + · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inl v, hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ + · exact ⟨.inr (.inr (.inl ⟨⟨i, ⟨.inr (.inl a), hs, ht⟩⟩, by norm_num [Path.length]⟩)), rfl⟩ + · dsimp only [Path.source, Path.target] at hs ht + subst v + exact ⟨.inr (.inl ⟨i, ht.symm⟩), rfl⟩ + +noncomputable def negativeAmplitudeIndexEquiv (E : BasedComplex Q (K := K) I) (α : V) : + ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ NegativeAmplitudeCoreIndex Q E α ≃ + I ⊕ TestIndex Q E.placement α := + Equiv.ofBijective (negativeAmplitudeIndexMap Q E α) + ⟨negativeAmplitudeIndexMap_injective Q E α, negativeAmplitudeIndexMap_surjective Q E α⟩ + +noncomputable def normalizedNegativeAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) + (ActedIndex Q E α ⊕ ActedIndex Q E α ⊕ NegativeAmplitudeCoreIndex Q E α) := + (E.negativeTwist Q α).reindex Q (negativeAmplitudeIndexEquiv Q E α) + +noncomputable def negativeAmplitudePivot (E : BasedComplex Q (K := K) I) (α : V) : + BlockPivot Q (normalizedNegativeAmplitudeTwist Q E α) where + coefficient := 1 + nonzero := one_ne_zero + color i := i.property.symm + cochain i := by change (E.placement i.val).cochain + 1 = (E.placement i.val).cochain + 1; rfl + internal i := by change (E.placement i.val).internal + 2 - 2 = (E.placement i.val).internal; omega + entry i j := by + change coevaluationMatrix Q E.placement α i.val (tokenTest Q E α j) = + (1 : K) • projectiveIdentity Q + (fun j => (normalizedNegativeAmplitudeTwist Q E α).placement (.inl j)) i j + simp only [coevaluationMatrix, tokenTest, Path.dual, pathBasis_vertex, one_smul, + projectiveIdentity, Matrix.diagonal_apply] + change (if i.val = j.val then vertexId Q (K := K) α else 0) = + (if i = j then vertexId Q (E.placement i.val).color else 0) + rw [i.property] + simp only [Subtype.val_inj] + +noncomputable def reducedNegativeAmplitudeTwist (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) (NegativeAmplitudeCoreIndex Q E α) := + (negativeAmplitudePivot Q E α).reduced Q + +noncomputable def negativeAmplitudeTwistReduction (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q (E.negativeTwist Q α) (reducedNegativeAmplitudeTwist Q E α) := + ((E.negativeTwist Q α).reindexHomotopyEquivalence Q (negativeAmplitudeIndexEquiv Q E α)).trans Q + ((negativeAmplitudePivot Q E α).reductionEquivalence Q) + +lemma reducedNegativeAmplitudeTwist_placement (E : BasedComplex Q (K := K) I) (α : V) : + (reducedNegativeAmplitudeTwist Q E α).placement = + fun i => match i with + | .inl u => ⟨α, (E.placement u.val.1).cochain + 1, + (E.placement u.val.1).internal + Path.length u.val.2.val - 2⟩ + | .inr i => E.placement i.val := by + funext i + cases i <;> rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeConeIndex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeConeIndex.lean index 3e5bf465ae34c853b25f67a8115a6f6f25fdda3b..c677a28e754cd2d74ca2804bad39e058972a0ef7 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeConeIndex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeConeIndex.lean @@ -1,105 +1,105 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.CotestPlacement -import OAI.Topology.ArtinGroups.Complexes.CoconePlacement -import OAI.Topology.ArtinGroups.Complexes.Refl -import OAI.Topology.ArtinGroups.Quivers.SignDiagonal - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -open Matrix - -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - -def negativeConeIndex (f:Map Q E F) (α:V) : - ((I ⊕ TestIndex Q E.placement α) ⊕ (J ⊕ TestIndex Q F.placement α)) ≃ - ((I ⊕ J) ⊕ TestIndex Q (f.cone Q).placement α) where - toFun - | .inl (.inl i) => .inl (.inl i) - | .inl (.inr p) => .inr ⟨.inl p.1,p.2⟩ - | .inr (.inl j) => .inl (.inr j) - | .inr (.inr p) => .inr ⟨.inr p.1,p.2⟩ - invFun - | .inl (.inl i) => .inl (.inl i) - | .inl (.inr j) => .inr (.inl j) - | .inr ⟨.inl i,p⟩ => .inl (.inr ⟨i,p⟩) - | .inr ⟨.inr j,p⟩ => .inr (.inr ⟨j,p⟩) - left_inv := by - intro k; rcases k with (i|p)|(j|p) <;> rfl - right_inv := by - intro k; rcases k with (i|j)|⟨i|j,p⟩ <;> rfl - -def negativeConeSign (α:V) : - ((I ⊕ TestIndex Q E.placement α) ⊕ (J ⊕ TestIndex Q F.placement α)) → Bool - | .inl (.inr _) => true - | _ => false - -omit [DecidableEq I] [DecidableEq J] in -lemma negativeCone_placement (f:Map Q E F) (α:V) : - ((f.negativeTwist Q α).cone Q).placement = - (((f.cone Q).negativeTwist Q α).reindex Q (negativeConeIndex Q f α)).placement := by - funext k - rcases k with (i|p)|(j|p) - · rfl - · change GeneratorPlacement.mk α ((E.placement p.1).cochain+1-1) - ((E.placement p.1).internal+Path.length p.2.val-2) = - GeneratorPlacement.mk α ((E.placement p.1).cochain-1+1) - ((E.placement p.1).internal+Path.length p.2.val-2) - congr 1 - omega - · rfl - · rfl - -lemma negativeCone_differential (f:Map Q E F) (α:V) - (i j:(I ⊕ TestIndex Q E.placement α) ⊕ (J ⊕ TestIndex Q F.placement α)) : - (if negativeConeSign Q (E:=E) (F:=F) α j then - -((((f.cone Q).negativeTwist Q α).reindex Q (negativeConeIndex Q f α)).differential i j) - else (((f.cone Q).negativeTwist Q α).reindex Q (negativeConeIndex Q f α)).differential i j) = - (if negativeConeSign Q (E:=E) (F:=F) α i then - -(((f.negativeTwist Q α).cone Q).differential i j) - else ((f.negativeTwist Q α).cone Q).differential i j) := by - rcases i with (i|p)|(i|p) <;> rcases j with (j|r)|(j|r) - · rfl - · change -coevaluationMatrix Q (f.cone Q).placement α (.inl i) ⟨.inl r.1,r.2⟩ = - -coevaluationMatrix Q E.placement α i r - simp only [coevaluationMatrix, Sum.inl.injEq] - split_ifs <;> rfl - · rfl - · change coevaluationMatrix Q (f.cone Q).placement α (.inl i) ⟨.inr r.1,r.2⟩ = 0 - simp only [coevaluationMatrix, Sum.inl_ne_inr,ite_false] - · change (0:Q.Zigzag K)= -(-0) - simp only [neg_zero] - · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * (-E.differential p.1 r.1)) r.2.val) • vertexId Q α)) = - -(-(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * E.differential p.1 r.1) r.2.val) • vertexId Q α))) - simp only [neg_neg,mul_neg,map_neg,Pi.neg_apply,neg_smul] - · change (0:Q.Zigzag K)= -0 - simp only [neg_zero] - · rfl - · rfl - · change -coevaluationMatrix Q (f.cone Q).placement α (.inr i) ⟨.inl r.1,r.2⟩ = 0 - simp only [coevaluationMatrix, Sum.inr_ne_inl,ite_false,neg_zero] - · rfl - · change coevaluationMatrix Q (f.cone Q).placement α (.inr i) ⟨.inr r.1,r.2⟩ = - coevaluationMatrix Q F.placement α i r - simp only [coevaluationMatrix, Sum.inr.injEq] - split_ifs <;> rfl - · rfl - · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * 0) r.2.val) • vertexId Q α))=0 - simp only [mul_zero,map_zero,Pi.zero_apply,zero_smul,neg_zero] - · rfl - · rfl - -noncomputable def negativeTwistCone (f:Map Q E F) (α:V) : - ChainIsomorphism Q ((f.cone Q).negativeTwist Q α) ((f.negativeTwist Q α).cone Q) := - (reindexChainIsomorphism Q _ (negativeConeIndex Q f α)).trans Q - (signChainIsomorphism Q _ _ (negativeConeSign Q α) - (negativeCone_placement Q f α) (negativeCone_differential Q f α)) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.CotestPlacement +import OAI.Topology.ArtinGroups.Complexes.CoconePlacement +import OAI.Topology.ArtinGroups.Complexes.Refl +import OAI.Topology.ArtinGroups.Quivers.SignDiagonal + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +open Matrix + +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + +def negativeConeIndex (f:Map Q E F) (α:V) : + ((I ⊕ TestIndex Q E.placement α) ⊕ (J ⊕ TestIndex Q F.placement α)) ≃ + ((I ⊕ J) ⊕ TestIndex Q (f.cone Q).placement α) where + toFun + | .inl (.inl i) => .inl (.inl i) + | .inl (.inr p) => .inr ⟨.inl p.1,p.2⟩ + | .inr (.inl j) => .inl (.inr j) + | .inr (.inr p) => .inr ⟨.inr p.1,p.2⟩ + invFun + | .inl (.inl i) => .inl (.inl i) + | .inl (.inr j) => .inr (.inl j) + | .inr ⟨.inl i,p⟩ => .inl (.inr ⟨i,p⟩) + | .inr ⟨.inr j,p⟩ => .inr (.inr ⟨j,p⟩) + left_inv := by + intro k; rcases k with (i|p)|(j|p) <;> rfl + right_inv := by + intro k; rcases k with (i|j)|⟨i|j,p⟩ <;> rfl + +def negativeConeSign (α:V) : + ((I ⊕ TestIndex Q E.placement α) ⊕ (J ⊕ TestIndex Q F.placement α)) → Bool + | .inl (.inr _) => true + | _ => false + +omit [DecidableEq I] [DecidableEq J] in +lemma negativeCone_placement (f:Map Q E F) (α:V) : + ((f.negativeTwist Q α).cone Q).placement = + (((f.cone Q).negativeTwist Q α).reindex Q (negativeConeIndex Q f α)).placement := by + funext k + rcases k with (i|p)|(j|p) + · rfl + · change GeneratorPlacement.mk α ((E.placement p.1).cochain+1-1) + ((E.placement p.1).internal+Path.length p.2.val-2) = + GeneratorPlacement.mk α ((E.placement p.1).cochain-1+1) + ((E.placement p.1).internal+Path.length p.2.val-2) + congr 1 + omega + · rfl + · rfl + +lemma negativeCone_differential (f:Map Q E F) (α:V) + (i j:(I ⊕ TestIndex Q E.placement α) ⊕ (J ⊕ TestIndex Q F.placement α)) : + (if negativeConeSign Q (E:=E) (F:=F) α j then + -((((f.cone Q).negativeTwist Q α).reindex Q (negativeConeIndex Q f α)).differential i j) + else (((f.cone Q).negativeTwist Q α).reindex Q (negativeConeIndex Q f α)).differential i j) = + (if negativeConeSign Q (E:=E) (F:=F) α i then + -(((f.negativeTwist Q α).cone Q).differential i j) + else ((f.negativeTwist Q α).cone Q).differential i j) := by + rcases i with (i|p)|(i|p) <;> rcases j with (j|r)|(j|r) + · rfl + · change -coevaluationMatrix Q (f.cone Q).placement α (.inl i) ⟨.inl r.1,r.2⟩ = + -coevaluationMatrix Q E.placement α i r + simp only [coevaluationMatrix, Sum.inl.injEq] + split_ifs <;> rfl + · rfl + · change coevaluationMatrix Q (f.cone Q).placement α (.inl i) ⟨.inr r.1,r.2⟩ = 0 + simp only [coevaluationMatrix, Sum.inl_ne_inr,ite_false] + · change (0:Q.Zigzag K)= -(-0) + simp only [neg_zero] + · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * (-E.differential p.1 r.1)) r.2.val) • vertexId Q α)) = + -(-(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * E.differential p.1 r.1) r.2.val) • vertexId Q α))) + simp only [neg_neg,mul_neg,map_neg,Pi.neg_apply,neg_smul] + · change (0:Q.Zigzag K)= -0 + simp only [neg_zero] + · rfl + · rfl + · change -coevaluationMatrix Q (f.cone Q).placement α (.inr i) ⟨.inl r.1,r.2⟩ = 0 + simp only [coevaluationMatrix, Sum.inr_ne_inl,ite_false,neg_zero] + · rfl + · change coevaluationMatrix Q (f.cone Q).placement α (.inr i) ⟨.inr r.1,r.2⟩ = + coevaluationMatrix Q F.placement α i r + simp only [coevaluationMatrix, Sum.inr.injEq] + split_ifs <;> rfl + · rfl + · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * 0) r.2.val) • vertexId Q α))=0 + simp only [mul_zero,map_zero,Pi.zero_apply,zero_smul,neg_zero] + · rfl + · rfl + +noncomputable def negativeTwistCone (f:Map Q E F) (α:V) : + ChainIsomorphism Q ((f.cone Q).negativeTwist Q α) ((f.negativeTwist Q α).cone Q) := + (reindexChainIsomorphism Q _ (negativeConeIndex Q f α)).trans Q + (signChainIsomorphism Q _ _ (negativeConeSign Q α) + (negativeCone_placement Q f α) (negativeCone_differential Q f α)) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeHomTransformReflect.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeHomTransformReflect.lean index c1406dc2087e155f95ebcf6525e01aa5a1645cc4..156f3abeb72ec1cbcdfd63f2d8628d01d4297ee2 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeHomTransformReflect.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeHomTransformReflect.lean @@ -1,81 +1,81 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.NormalizedInverseTwistHomotopy -import OAI.Topology.ArtinGroups.Complexes.NormalizedReverseTwistHomotopy -import OAI.Topology.ArtinGroups.Complexes.ReindexHomOperator -import OAI.Topology.ArtinGroups.Complexes.InverseHomMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -lemma negativeHomTransform_reflect_boundary (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n v : ℤ) {f : Matrix I J (Q.Zigzag K)} - (hf : ProjectiveEntries Q E.placement F.placement f) - (hb : negativeHomTransform Q E F α n f ∈ - homBoundaries Q (E.negativeTwist Q α) (F.negativeTwist Q α) n v) : - f ∈ homBoundaries Q E F n v := by - have h₁ := (positiveHomOperator Q (E.negativeTwist Q α) - (F.negativeTwist Q α) α).map_boundaries n v hb - have h₂ := (reindexHomOperator Q - ((E.negativeTwist Q α).positiveTwist Q α) - ((F.negativeTwist Q α).positiveTwist Q α) - (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α)).map_boundaries n v h₁ - have h₃ := (sandwichHomOperator Q - (normalizedInverseTwistHomotopyEquivalence Q hn E α).backward - (normalizedInverseTwistHomotopyEquivalence Q hn F α).forward).map_boundaries n v h₂ - change inverseTwistInjection Q E α * - (positiveHomTransform Q (E.negativeTwist Q α) (F.negativeTwist Q α) α n - (negativeHomTransform Q E F α n f)).submatrix - (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α) * - inverseTwistProjection Q F α ∈ homBoundaries Q E F n v at h₃ - rw [inverseHomMatrix_normalized, inverseHomMatrix_extract Q E F α n hf] at h₃ - exact h₃ - -lemma positiveHomTransform_reflect_boundary (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n v : ℤ) {f : Matrix I J (Q.Zigzag K)} - (hf : ProjectiveEntries Q E.placement F.placement f) - (hb : positiveHomTransform Q E F α n f ∈ - homBoundaries Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v) : - f ∈ homBoundaries Q E F n v := by - have h₁ := (negativeHomOperator Q (E.positiveTwist Q α) - (F.positiveTwist Q α) α).map_boundaries n v hb - have h₂ := (reindexHomOperator Q - ((E.positiveTwist Q α).negativeTwist Q α) - ((F.positiveTwist Q α).negativeTwist Q α) - (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α)).map_boundaries n v h₁ - have h₃ := (sandwichHomOperator Q - (normalizedReverseTwistHomotopyEquivalence Q hn E α).backward - (normalizedReverseTwistHomotopyEquivalence Q hn F α).forward).map_boundaries n v h₂ - change reverseTwistInjection Q E α * - (negativeHomTransform Q (E.positiveTwist Q α) (F.positiveTwist Q α) α n - (positiveHomTransform Q E F α n f)).submatrix - (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α) * - reverseTwistProjection Q F α ∈ homBoundaries Q E F n v at h₃ - rw [reverseHomMatrix_normalized, reverseHomMatrix_extract Q E F α n hf] at h₃ - exact h₃ - -lemma negativeHomCohomology_injective (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n v : ℤ) : - Function.Injective ((negativeHomOperator Q E F α).onCohomology n v) := by - apply HomOperator.onCohomology_injective - intro f hf hb - exact negativeHomTransform_reflect_boundary Q hn E F α n v hf.1.1 hb - -lemma positiveHomCohomology_injective (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (α : V) (n v : ℤ) : - Function.Injective ((positiveHomOperator Q E F α).onCohomology n v) := by - apply HomOperator.onCohomology_injective - intro f hf hb - exact positiveHomTransform_reflect_boundary Q hn E F α n v hf.1.1 hb - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.NormalizedInverseTwistHomotopy +import OAI.Topology.ArtinGroups.Complexes.NormalizedReverseTwistHomotopy +import OAI.Topology.ArtinGroups.Complexes.ReindexHomOperator +import OAI.Topology.ArtinGroups.Complexes.InverseHomMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +lemma negativeHomTransform_reflect_boundary (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n v : ℤ) {f : Matrix I J (Q.Zigzag K)} + (hf : ProjectiveEntries Q E.placement F.placement f) + (hb : negativeHomTransform Q E F α n f ∈ + homBoundaries Q (E.negativeTwist Q α) (F.negativeTwist Q α) n v) : + f ∈ homBoundaries Q E F n v := by + have h₁ := (positiveHomOperator Q (E.negativeTwist Q α) + (F.negativeTwist Q α) α).map_boundaries n v hb + have h₂ := (reindexHomOperator Q + ((E.negativeTwist Q α).positiveTwist Q α) + ((F.negativeTwist Q α).positiveTwist Q α) + (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α)).map_boundaries n v h₁ + have h₃ := (sandwichHomOperator Q + (normalizedInverseTwistHomotopyEquivalence Q hn E α).backward + (normalizedInverseTwistHomotopyEquivalence Q hn F α).forward).map_boundaries n v h₂ + change inverseTwistInjection Q E α * + (positiveHomTransform Q (E.negativeTwist Q α) (F.negativeTwist Q α) α n + (negativeHomTransform Q E F α n f)).submatrix + (inverseTwistIndexEquiv Q hn E α) (inverseTwistIndexEquiv Q hn F α) * + inverseTwistProjection Q F α ∈ homBoundaries Q E F n v at h₃ + rw [inverseHomMatrix_normalized, inverseHomMatrix_extract Q E F α n hf] at h₃ + exact h₃ + +lemma positiveHomTransform_reflect_boundary (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n v : ℤ) {f : Matrix I J (Q.Zigzag K)} + (hf : ProjectiveEntries Q E.placement F.placement f) + (hb : positiveHomTransform Q E F α n f ∈ + homBoundaries Q (E.positiveTwist Q α) (F.positiveTwist Q α) n v) : + f ∈ homBoundaries Q E F n v := by + have h₁ := (negativeHomOperator Q (E.positiveTwist Q α) + (F.positiveTwist Q α) α).map_boundaries n v hb + have h₂ := (reindexHomOperator Q + ((E.positiveTwist Q α).negativeTwist Q α) + ((F.positiveTwist Q α).negativeTwist Q α) + (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α)).map_boundaries n v h₁ + have h₃ := (sandwichHomOperator Q + (normalizedReverseTwistHomotopyEquivalence Q hn E α).backward + (normalizedReverseTwistHomotopyEquivalence Q hn F α).forward).map_boundaries n v h₂ + change reverseTwistInjection Q E α * + (negativeHomTransform Q (E.positiveTwist Q α) (F.positiveTwist Q α) α n + (positiveHomTransform Q E F α n f)).submatrix + (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn F α) * + reverseTwistProjection Q F α ∈ homBoundaries Q E F n v at h₃ + rw [reverseHomMatrix_normalized, reverseHomMatrix_extract Q E F α n hf] at h₃ + exact h₃ + +lemma negativeHomCohomology_injective (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n v : ℤ) : + Function.Injective ((negativeHomOperator Q E F α).onCohomology n v) := by + apply HomOperator.onCohomology_injective + intro f hf hb + exact negativeHomTransform_reflect_boundary Q hn E F α n v hf.1.1 hb + +lemma positiveHomCohomology_injective (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (α : V) (n v : ℤ) : + Function.Injective ((positiveHomOperator Q E F α).onCohomology n v) := by + apply HomOperator.onCohomology_injective + intro f hf hb + exact positiveHomTransform_reflect_boundary Q hn E F α n v hf.1.1 hb + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistCapDisjoint.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistCapDisjoint.lean index 27d0a5c0734adbbeda6e14bf6e13ab46cacd33d9..284f2d62629048d474f725d65f5bcb8abcebd378 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistCapDisjoint.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistCapDisjoint.lean @@ -1,96 +1,96 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HighestLocalGeneratorTest - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u v -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -lemma classNegativeTwist_capOn_disjoint (x : FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x U q) (α:V) (hα:α∉U) : - ClassCapOn Q (classNegativeTwist Q α x) U q := by - let E:=minimalClassModel Q x - let F:=E.complex.negativeTwist Q α - have hx:classOfComplex Q F=classNegativeTwist Q α x := by - change classNegativeTwist Q α (classOfComplex Q E.complex)=_ - exact congrArg (classNegativeTwist Q α) (minimalClassModel_class Q x) - rw [← hx] - apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) - ((minimalClassModelEquivalence Q F).symm Q) (fun p=>p.color∈U→p.level≤q) - intro i hi - rcases i with j|j - · exact hcap j hi - · exact (hα hi).elim - -lemma inverseWord_capOn_disjoint (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x U q) (hw:∀ α∈w,α∉U) : - ClassCapOn Q (inverseWordAction Q w x) U q := by - induction w generalizing x with - | nil => exact hcap - | cons α w ih => - exact ih _ (classNegativeTwist_capOn_disjoint Q x U q hcap α (hw α (by simp))) - (fun β hβ=>hw β (by simp [hβ])) - -omit [Fintype V] [DecidableEq A] in -lemma finiteFamily_upperBound {F:Type*} [Finite F] - (x:F→FiniteHomotopyClass Q (K:=K)) : ∃ d:ℤ,∀ f,ClassUpperBound Q d (x f) := by - obtain ⟨d,hd⟩:=Finite.exists_le - (fun z : Σ f:F,(minimalClassModel Q (x f)).Index => - ((minimalClassModel Q (x z.1)).complex.placement z.2).level) - exact ⟨d,fun f i=>hd ⟨f,i⟩⟩ - -lemma ClassTestUpper.mono {x:FiniteHomotopyClass Q (K:=K)} {U:Set V} {s t:ℤ} - (h:ClassTestUpper Q x U s) (hst:s≤t) : ClassTestUpper Q x U t := - fun α hα l hl c=>h α hα l (lt_of_le_of_lt hst hl) c - -variable (hn:∀ a,Q.source a≠Q.target a) - -lemma inverseWord_iterate_testUpper (w:List V) (U:Set V) - (hw:∀ (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ),ClassTestUpper Q x U t → - ClassTestUpper Q (inverseWordAction Q w x) U (t-1)) - (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ) (hx:ClassTestUpper Q x U t) (n:ℕ) : - ClassTestUpper Q ((inverseWordAction Q w)^[n] x) U (t-(n:ℤ)) := by - induction n with - | zero => simpa using hx - | succ n ih => - rw [Function.iterate_succ_apply'] - convert hw _ _ ih using 1 - push_cast - ring - -lemma inverseWord_iterate_boundary (w:List V) (U:Set V) (hw:∀ α∈w,α∈U) - (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) - (hb:ClassCapOn Q x (Q.closedNeighborhood U \ U) q) (n:ℕ) : - ClassCapOn Q ((inverseWordAction Q w)^[n] x) (Q.closedNeighborhood U \ U) q := by - induction n with - | zero => exact hb - | succ n ih => - rw [Function.iterate_succ_apply'] - exact inverseWord_capOn_disjoint Q w _ _ q ih (fun α hα h=>h.2 (hw α hα)) - -theorem finiteFamily_cap_accessible_of_test_decrement {F:Type*} [Finite F] - (w:List V) (U:Set V) (hw:∀ α∈w,α∈U) - (hdec:∀ (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ),ClassTestUpper Q x U t → - ClassTestUpper Q (inverseWordAction Q w x) U (t-1)) - (x:F→FiniteHomotopyClass Q (K:=K)) (q:ℤ) - (hb:∀ f,ClassCapOn Q (x f) (Q.closedNeighborhood U \ U) q) : - ∃ n:ℕ,∀ f,ClassCapOn Q ((inverseWordAction Q w)^[n] (x f)) (Q.closedNeighborhood U) q := by - obtain ⟨d,hd⟩:=finiteFamily_upperBound Q x - let n:ℕ:=(d-q).toNat - have hn:(d:ℤ)-q≤(n:ℤ) := by dsimp [n]; omega - refine ⟨n,fun f=>?_⟩ - have hbd:=inverseWord_iterate_boundary Q w U hw (x f) q (hb f) n - have ht:=inverseWord_iterate_testUpper Q w U hdec (x f) (d+2) - (classTestUpper_of_generator_cap Q (x f) d (hd f) U) n - have hcu:=classCapOn_of_test_and_boundary Q _ U q (ht.mono Q (by omega)) hbd - intro i hi - by_cases hui:((minimalClassModel Q ((inverseWordAction Q w)^[n] (x f))).complex.placement i).color∈U - · exact hcu i hui - · exact hbd i ⟨hi,hui⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HighestLocalGeneratorTest + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u v +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +lemma classNegativeTwist_capOn_disjoint (x : FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x U q) (α:V) (hα:α∉U) : + ClassCapOn Q (classNegativeTwist Q α x) U q := by + let E:=minimalClassModel Q x + let F:=E.complex.negativeTwist Q α + have hx:classOfComplex Q F=classNegativeTwist Q α x := by + change classNegativeTwist Q α (classOfComplex Q E.complex)=_ + exact congrArg (classNegativeTwist Q α) (minimalClassModel_class Q x) + rw [← hx] + apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) + ((minimalClassModelEquivalence Q F).symm Q) (fun p=>p.color∈U→p.level≤q) + intro i hi + rcases i with j|j + · exact hcap j hi + · exact (hα hi).elim + +lemma inverseWord_capOn_disjoint (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x U q) (hw:∀ α∈w,α∉U) : + ClassCapOn Q (inverseWordAction Q w x) U q := by + induction w generalizing x with + | nil => exact hcap + | cons α w ih => + exact ih _ (classNegativeTwist_capOn_disjoint Q x U q hcap α (hw α (by simp))) + (fun β hβ=>hw β (by simp [hβ])) + +omit [Fintype V] [DecidableEq A] in +lemma finiteFamily_upperBound {F:Type*} [Finite F] + (x:F→FiniteHomotopyClass Q (K:=K)) : ∃ d:ℤ,∀ f,ClassUpperBound Q d (x f) := by + obtain ⟨d,hd⟩:=Finite.exists_le + (fun z : Σ f:F,(minimalClassModel Q (x f)).Index => + ((minimalClassModel Q (x z.1)).complex.placement z.2).level) + exact ⟨d,fun f i=>hd ⟨f,i⟩⟩ + +lemma ClassTestUpper.mono {x:FiniteHomotopyClass Q (K:=K)} {U:Set V} {s t:ℤ} + (h:ClassTestUpper Q x U s) (hst:s≤t) : ClassTestUpper Q x U t := + fun α hα l hl c=>h α hα l (lt_of_le_of_lt hst hl) c + +variable (hn:∀ a,Q.source a≠Q.target a) + +lemma inverseWord_iterate_testUpper (w:List V) (U:Set V) + (hw:∀ (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ),ClassTestUpper Q x U t → + ClassTestUpper Q (inverseWordAction Q w x) U (t-1)) + (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ) (hx:ClassTestUpper Q x U t) (n:ℕ) : + ClassTestUpper Q ((inverseWordAction Q w)^[n] x) U (t-(n:ℤ)) := by + induction n with + | zero => simpa using hx + | succ n ih => + rw [Function.iterate_succ_apply'] + convert hw _ _ ih using 1 + push_cast + ring + +lemma inverseWord_iterate_boundary (w:List V) (U:Set V) (hw:∀ α∈w,α∈U) + (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) + (hb:ClassCapOn Q x (Q.closedNeighborhood U \ U) q) (n:ℕ) : + ClassCapOn Q ((inverseWordAction Q w)^[n] x) (Q.closedNeighborhood U \ U) q := by + induction n with + | zero => exact hb + | succ n ih => + rw [Function.iterate_succ_apply'] + exact inverseWord_capOn_disjoint Q w _ _ q ih (fun α hα h=>h.2 (hw α hα)) + +theorem finiteFamily_cap_accessible_of_test_decrement {F:Type*} [Finite F] + (w:List V) (U:Set V) (hw:∀ α∈w,α∈U) + (hdec:∀ (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ),ClassTestUpper Q x U t → + ClassTestUpper Q (inverseWordAction Q w x) U (t-1)) + (x:F→FiniteHomotopyClass Q (K:=K)) (q:ℤ) + (hb:∀ f,ClassCapOn Q (x f) (Q.closedNeighborhood U \ U) q) : + ∃ n:ℕ,∀ f,ClassCapOn Q ((inverseWordAction Q w)^[n] (x f)) (Q.closedNeighborhood U) q := by + obtain ⟨d,hd⟩:=finiteFamily_upperBound Q x + let n:ℕ:=(d-q).toNat + have hn:(d:ℤ)-q≤(n:ℤ) := by dsimp [n]; omega + refine ⟨n,fun f=>?_⟩ + have hbd:=inverseWord_iterate_boundary Q w U hw (x f) q (hb f) n + have ht:=inverseWord_iterate_testUpper Q w U hdec (x f) (d+2) + (classTestUpper_of_generator_cap Q (x f) d (hd f) U) n + have hcu:=classCapOn_of_test_and_boundary Q _ U q (ht.mono Q (by omega)) hbd + intro i hi + by_cases hui:((minimalClassModel Q ((inverseWordAction Q w)^[n] (x f))).complex.placement i).color∈U + · exact hcu i hui + · exact hbd i ⟨hi,hui⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistLoweredGenerator.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistLoweredGenerator.lean index cc66e00658beb6057e43d579b508e7cfb1040d93..151fb718d4811b89412399291759dc3a8b005ec1 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistLoweredGenerator.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistLoweredGenerator.lean @@ -1,119 +1,119 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ReducedNegativeAmplitudeTwist -import OAI.Topology.ArtinGroups.Quivers.UnitTestVector -import OAI.Topology.ArtinGroups.Complexes.MinimalGeneratorDualCycle -import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDualRestrict -import OAI.Topology.ArtinGroups.Complexes.CoefficientSocleRestrictLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -attribute [local instance 1100] Sigma.instDecidableEqSigma - -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -theorem negativeTwist_lowered_generator_socle_at_floor - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - {l : ℤ} (hE : ∀ i, l≤(E.placement i).level) (α:V) - (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.negativeTwist Q α) F) - (j:J) (hj : (F.placement j).level=l-1) (hα : (F.placement j).color=α) : - ∃ x : I → K, x ∈ coefficientSocle Q E α ((F.placement j).cochain-1) ∧ x≠0 ∧ - ∀ i, (E.placement i).level≠l → x i=0 := by - obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_cycle Q (E.negativeTwist Q α) F hF e j - have hxold i : x (Sum.inl i)=0 := by - apply hxs - intro he - have hl := congrArg GeneratorPlacement.level he - change (E.placement i).level = (F.placement j).level at hl - have hb := hE i - rw [hj] at hl - omega - let y : TestIndex Q E.placement α → K := fun i => x (Sum.inr i) - have hplace (i : TestIndex Q E.placement α) - (he : (E.negativeTwist Q α).placement (Sum.inr i)=F.placement j) : - (E.placement i.1).cochain=(F.placement j).cochain-1 ∧ - Path.length i.2.val=0 ∧ (E.placement i.1).level=l := by - have hc := congrArg GeneratorPlacement.cochain he - have hu := congrArg GeneratorPlacement.internal he - change (E.placement i.1).cochain+1=(F.placement j).cochain at hc - change (E.placement i.1).internal+Path.length i.2.val-2=(F.placement j).internal at hu - have hl := hE i.1 - have hr : 0≤Path.length i.2.val := by - rcases Path.length_cases i.2.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hl hj ⊢ - exact ⟨by omega,by omega,by omega⟩ - have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain-1 ∧ - Path.length i.2.val=0) → y i=0 := by - intro hi - apply hxs - intro he - exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ - have hyd : Matrix.vecMul y - (testMatrix Q E.placement E.placement α E.differential)=0 := by - funext i - have hh := hxd (Sum.inr i) - rw [hα,Fintype.sum_sum_type] at hh - have ht k : ((E.negativeTwist Q α).differential (Sum.inr k) (Sum.inr i)).vertex α = - -testMatrix Q E.placement E.placement α E.differential k i := by - change (-(scalarCornerMatrix Q α - (testMatrix Q E.placement E.placement α E.differential)) k i).vertex α = _ - change -(testMatrix Q E.placement E.placement α E.differential k i * - (vertexId Q (K := K) α).vertex α) = _ - simp [vertexId_eval] - simp only [ht,hxold,MulZeroClass.zero_mul,Finset.sum_const_zero,zero_add, - mul_neg,Finset.sum_neg_distrib,neg_eq_zero] at hh - simpa only [Matrix.vecMul,dotProduct,Pi.zero_apply] using hh - have hy : y ∈ socleTestCycles Q E α ((F.placement j).cochain-1) := ⟨hys,hyd⟩ - refine ⟨sumUnitTest Q E.placement α y, sumUnitTest_socle Q E α _ hy, ?_, ?_⟩ - · intro hz - have hyz : y=0 := by - rw [← unitTestVector_sum Q E.placement α _ y hys,hz,map_zero] - apply hx - funext i - rcases i with i|i - · exact hxold i - · exact congrFun hyz i - · intro i hi - apply Finset.sum_eq_zero - intro z hz - apply hxs - intro he - exact hi (hplace ⟨i,z⟩ he).2.2 - -theorem negativeTwist_floor_of_socle_zero - (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} - (hE : ∀ i, l≤(E.placement i).level) (α:V) - (hsocle : ∀ c, coefficientSocle Q (E.pureLayer Q hmin l) α c=⊥) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.negativeTwist Q α) F.complex) ∧ - ∀ j, l≤(F.complex.placement j).level := by - let B := FiniteModel.ofComplex Q (reducedNegativeAmplitudeTwist Q E α) - obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q - let e' := (negativeAmplitudeTwistReduction Q E α).trans Q e - refine ⟨F,hF,⟨e'⟩,?_⟩ - intro j - by_contra hb - have hloc : ∃ i:I, - (F.complex.placement j).level=(E.placement i).level ∨ - ((F.complex.placement j).level=(E.placement i).level-1 ∧ - (F.complex.placement j).color=α) := by - rw [hf j] - exact reducedNegativeAmplitudeTwist_level Q E α (f j) - obtain ⟨i,hi⟩ := hloc - have hbound := hE i - rcases hi with hi|⟨hi,hα⟩ - · omega - · have hj : (F.complex.placement j).level=l-1 := by omega - obtain ⟨x,hx,hxz,hs⟩ := negativeTwist_lowered_generator_socle_at_floor Q E F.complex hE α hF e' j hj hα - have hm := coefficientSocle_restrict_layer Q E hmin l α _ hx hs - have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs - rw [hsocle] at hm - exact hn ((Submodule.mem_bot K).mp hm) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ReducedNegativeAmplitudeTwist +import OAI.Topology.ArtinGroups.Quivers.UnitTestVector +import OAI.Topology.ArtinGroups.Complexes.MinimalGeneratorDualCycle +import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDualRestrict +import OAI.Topology.ArtinGroups.Complexes.CoefficientSocleRestrictLayer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +attribute [local instance 1100] Sigma.instDecidableEqSigma + +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +theorem negativeTwist_lowered_generator_socle_at_floor + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + {l : ℤ} (hE : ∀ i, l≤(E.placement i).level) (α:V) + (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.negativeTwist Q α) F) + (j:J) (hj : (F.placement j).level=l-1) (hα : (F.placement j).color=α) : + ∃ x : I → K, x ∈ coefficientSocle Q E α ((F.placement j).cochain-1) ∧ x≠0 ∧ + ∀ i, (E.placement i).level≠l → x i=0 := by + obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_cycle Q (E.negativeTwist Q α) F hF e j + have hxold i : x (Sum.inl i)=0 := by + apply hxs + intro he + have hl := congrArg GeneratorPlacement.level he + change (E.placement i).level = (F.placement j).level at hl + have hb := hE i + rw [hj] at hl + omega + let y : TestIndex Q E.placement α → K := fun i => x (Sum.inr i) + have hplace (i : TestIndex Q E.placement α) + (he : (E.negativeTwist Q α).placement (Sum.inr i)=F.placement j) : + (E.placement i.1).cochain=(F.placement j).cochain-1 ∧ + Path.length i.2.val=0 ∧ (E.placement i.1).level=l := by + have hc := congrArg GeneratorPlacement.cochain he + have hu := congrArg GeneratorPlacement.internal he + change (E.placement i.1).cochain+1=(F.placement j).cochain at hc + change (E.placement i.1).internal+Path.length i.2.val-2=(F.placement j).internal at hu + have hl := hE i.1 + have hr : 0≤Path.length i.2.val := by + rcases Path.length_cases i.2.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hl hj ⊢ + exact ⟨by omega,by omega,by omega⟩ + have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain-1 ∧ + Path.length i.2.val=0) → y i=0 := by + intro hi + apply hxs + intro he + exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ + have hyd : Matrix.vecMul y + (testMatrix Q E.placement E.placement α E.differential)=0 := by + funext i + have hh := hxd (Sum.inr i) + rw [hα,Fintype.sum_sum_type] at hh + have ht k : ((E.negativeTwist Q α).differential (Sum.inr k) (Sum.inr i)).vertex α = + -testMatrix Q E.placement E.placement α E.differential k i := by + change (-(scalarCornerMatrix Q α + (testMatrix Q E.placement E.placement α E.differential)) k i).vertex α = _ + change -(testMatrix Q E.placement E.placement α E.differential k i * + (vertexId Q (K := K) α).vertex α) = _ + simp [vertexId_eval] + simp only [ht,hxold,MulZeroClass.zero_mul,Finset.sum_const_zero,zero_add, + mul_neg,Finset.sum_neg_distrib,neg_eq_zero] at hh + simpa only [Matrix.vecMul,dotProduct,Pi.zero_apply] using hh + have hy : y ∈ socleTestCycles Q E α ((F.placement j).cochain-1) := ⟨hys,hyd⟩ + refine ⟨sumUnitTest Q E.placement α y, sumUnitTest_socle Q E α _ hy, ?_, ?_⟩ + · intro hz + have hyz : y=0 := by + rw [← unitTestVector_sum Q E.placement α _ y hys,hz,map_zero] + apply hx + funext i + rcases i with i|i + · exact hxold i + · exact congrFun hyz i + · intro i hi + apply Finset.sum_eq_zero + intro z hz + apply hxs + intro he + exact hi (hplace ⟨i,z⟩ he).2.2 + +theorem negativeTwist_floor_of_socle_zero + (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} + (hE : ∀ i, l≤(E.placement i).level) (α:V) + (hsocle : ∀ c, coefficientSocle Q (E.pureLayer Q hmin l) α c=⊥) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.negativeTwist Q α) F.complex) ∧ + ∀ j, l≤(F.complex.placement j).level := by + let B := FiniteModel.ofComplex Q (reducedNegativeAmplitudeTwist Q E α) + obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q + let e' := (negativeAmplitudeTwistReduction Q E α).trans Q e + refine ⟨F,hF,⟨e'⟩,?_⟩ + intro j + by_contra hb + have hloc : ∃ i:I, + (F.complex.placement j).level=(E.placement i).level ∨ + ((F.complex.placement j).level=(E.placement i).level-1 ∧ + (F.complex.placement j).color=α) := by + rw [hf j] + exact reducedNegativeAmplitudeTwist_level Q E α (f j) + obtain ⟨i,hi⟩ := hloc + have hbound := hE i + rcases hi with hi|⟨hi,hα⟩ + · omega + · have hj : (F.complex.placement j).level=l-1 := by omega + obtain ⟨x,hx,hxz,hs⟩ := negativeTwist_lowered_generator_socle_at_floor Q E F.complex hE α hF e' j hj hα + have hm := coefficientSocle_restrict_layer Q E hmin l α _ hx hs + have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs + rw [hsocle] at hm + exact hn ((Submodule.mem_bot K).mp hm) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistModern.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistModern.lean index d208290322f102b81e0fe990394e545fc477dbec..d10a8f2f78f542e4f31fff08dbb453e0dd81778b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistModern.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NegativeTwistModern.lean @@ -1,169 +1,169 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood -import OAI.Topology.ArtinGroups.Complexes.LayerConeEquivalence -import OAI.Topology.ArtinGroups.Complexes.NegativeConeIndex -import OAI.Topology.ArtinGroups.Complexes.HighConeIndex -import OAI.Topology.ArtinGroups.Complexes.EmptyTestIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type u} [Fintype I] [DecidableEq I] - -noncomputable def HomotopyEquivalence.negativeTwistModern - {J:Type u} [Fintype J] [DecidableEq J] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (e:HomotopyEquivalence Q E F) (α:V) : - HomotopyEquivalence Q (E.negativeTwist Q α) (F.negativeTwist Q α) := by - convert e.negativeTwist Q α using 1 - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_upperBound (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) : - ClassUpperBound Q q (classLayer Q q x) := - classUpperBound_of_representative Q _ (fun i=>le_of_eq i.property) - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_lowerBound (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) : - ClassLowerBound Q q (classLayer Q q x) := - classLowerBound_of_representative Q _ (fun i=>le_of_eq i.property.symm) - -noncomputable def allPureIndex (E:BasedComplex Q (K:=K) I) (q:ℤ) - (h:∀ i,(E.placement i).level=q) : I ≃ {i:I // (E.placement i).level=q} where - toFun i:=⟨i,h i⟩ - invFun i:=i.val - left_inv _:=rfl - right_inv _:=rfl - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_eq_self_of_pure (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (h:∀ i,(E.placement i).level=q) : - classLayer Q q (classOfComplex Q E)=classOfComplex Q E := by - rw [classLayer_minimal Q E hE] - have he:(E.pureLayer Q hE q).reindex Q (allPureIndex Q E q h)=E := by - apply ext_placement_differential Q <;> rfl - exact (classOfComplex_reindex Q _ (allPureIndex Q E q h)).trans (by rw [he]) - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_idempotent (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) : - classLayer Q q (classLayer Q q x)=classLayer Q q x := by - let y:=classLayer Q q x - let E:=minimalClassModel Q y - have hp:∀ i,(E.complex.placement i).level=q := fun i=> - le_antisymm (classLayer_upperBound Q x q i) (classLayer_lowerBound Q x q i) - have he:classOfComplex Q E.complex=y:=minimalClassModel_class Q y - simpa only [he] using classLayer_eq_self_of_pure Q E.complex - (minimalClassModel_minimal Q y) q hp - -omit [Fintype V] [DecidableEq A] in -lemma classLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (q:ℤ) : - classLayer Q q (classOfComplex Q (lowerTruncation Q E hE q))= - classLayer Q q (classOfComplex Q E) := by - apply classLayer_eq_of_cone_equivalence Q (lowInclusion Q E _ (levelDownClosed Q E hE q)) - (upperTruncation Q E hE q) (lowConeReduction Q E _ _) q - intro j - have hj:=j.property - change ¬(E.placement j).level≤q at hj - change (E.placement j).level≠q-1 ∧ (E.placement j).level≠q - omega - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma capped_upperTruncation_far (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (U:Set V) (q:ℤ) - (hcap:∀ i,(E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤q) : - ∀ i,((upperTruncation Q E hE q).placement i).color∉Q.closedNeighborhood U := by - intro i hi - exact i.property (hcap i hi) - -lemma negativeLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (U:Set V) (q:ℤ) - (hcap:∀ i,(E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤q) - (α:V) (hα:α∈U) : - classLayer Q q (classOfComplex Q ((lowerTruncation Q E hE q).negativeTwist Q α))= - classLayer Q q (classOfComplex Q (E.negativeTwist Q α)) := by - let f:=lowInclusion Q E _ (levelDownClosed Q E hE q) - let R:=upperTruncation Q E hE q - have coneIso : ChainIsomorphism Q ((f.cone Q).negativeTwist Q α) - ((f.negativeTwist Q α).cone Q) := by - convert negativeTwistCone Q f α using 1 - let e:HomotopyEquivalence Q ((f.negativeTwist Q α).cone Q) R:= - ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q - (((lowConeReduction Q E (lowerLevelSet Q E q) (levelDownClosed Q E hE q)).negativeTwistModern Q α).trans Q - (negativeTwistFar Q R U (capped_upperTruncation_far Q E hE U q hcap) α hα)) - apply classLayer_eq_of_cone_equivalence Q (f.negativeTwist Q α) R e q - intro j - have hj:=j.property - change ¬(E.placement j).level≤q at hj - change (E.placement j).level≠q-1 ∧ (E.placement j).level≠q - omega - -lemma negativeLayer_top (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) (α:V) : - classLayer Q q (classNegativeTwist Q α (classOfComplex Q E))= - classLayer Q q (classNegativeTwist Q α (classLayer Q q (classOfComplex Q E))) := by - let f:=highProjection Q E _ (levelDownClosed Q E hE (q-1)) - let D:=(highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q - let G:=minimalClassModel Q (classOfComplex Q (D.negativeTwist Q α)) - let e₀:HomotopyEquivalence Q (D.negativeTwist Q α) G.complex:= - (minimalClassModelEquivalence Q (D.negativeTwist Q α)).symm Q - have hd:∀ i,(D.placement i).level≤q-2 := by - intro i - rw [highConeRetained_level] - have hi:=i.property - change (E.placement i).level≤q-1 at hi - omega - have hg:∀ i,(G.complex.placement i).level≤q-2 := - negativeTwist_upper_bound Q D G.complex hd α (minimalClassModel_minimal Q _) e₀ - have coneIso : ChainIsomorphism Q ((f.cone Q).negativeTwist Q α) - ((f.negativeTwist Q α).cone Q) := by - convert negativeTwistCone Q f α using 1 - let e:HomotopyEquivalence Q ((f.negativeTwist Q α).cone Q) G.complex:= - ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q - ((((highConeReduction Q E (lowerLevelSet Q E (q-1)) (levelDownClosed Q E hE (q-1))).negativeTwistModern Q α)).trans Q e₀) - have hh:=classLayer_eq_of_cone_equivalence Q (f.negativeTwist Q α) G.complex e q - (fun i=>by have hi:=hg i; constructor <;> omega) - change classLayer Q q (classNegativeTwist Q α (classOfComplex Q E))= - classLayer Q q (classNegativeTwist Q α (classOfComplex Q (upperTruncation Q E hE (q-1)))) at hh - rwa [highRestriction_top_eq_layer Q E hE q hhi] at hh - -lemma classNegativeTwist_capped_layer (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x (Q.closedNeighborhood U) q) - (α:V) (hα:α∈U) : - classLayer Q q (classNegativeTwist Q α x)= - classLayer Q q (classNegativeTwist Q α (classLayer Q q x)) := by - let E:=minimalClassModel Q x - have hE:=minimalClassModel_minimal Q x - let L:=lowerTruncation Q E.complex hE q - have hx:classOfComplex Q E.complex=x:=minimalClassModel_class Q x - have hl:=negativeLayer_lowerTruncation Q E.complex hE U q hcap α hα - have ht:=negativeLayer_top Q L (lowerTruncation_minimal Q E.complex hE q) q - (fun i=>i.property) α - have he:=classLayer_lowerTruncation Q E.complex hE q - change classLayer Q q (classNegativeTwist Q α (classOfComplex Q L))= - classLayer Q q (classNegativeTwist Q α (classOfComplex Q E.complex)) at hl - rw [hx] at hl he - exact hl.symm.trans (ht.trans (congrArg (fun y=>classLayer Q q (classNegativeTwist Q α y)) he)) - -theorem inverseWord_capped_layer (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x (Q.closedNeighborhood U) q) - (hw:∀ α∈w,α∈U) : - classLayer Q q (inverseWordAction Q w x)= - classLayer Q q (inverseWordAction Q w (classLayer Q q x)) := by - induction w generalizing x with - | nil=>exact (classLayer_idempotent Q x q).symm - | cons α w ih=> - have hα:=hw α (by simp) - have hw':∀ β∈w,β∈U:=fun β hβ=>hw β (by simp [hβ]) - have hc:=classNegativeTwist_capped_layer Q x U q hcap α hα - have hy:=classCapOn_of_upper Q (classLayer Q q x) (Q.closedNeighborhood U) q - (classLayer_upperBound Q x q) - exact (ih _ (classNegativeTwist_capOn Q x U q hcap α hα) hw').trans - ((congrArg (fun y=>classLayer Q q (inverseWordAction Q w y)) hc).trans - (ih _ (classNegativeTwist_capOn Q _ U q hy α hα) hw').symm) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood +import OAI.Topology.ArtinGroups.Complexes.LayerConeEquivalence +import OAI.Topology.ArtinGroups.Complexes.NegativeConeIndex +import OAI.Topology.ArtinGroups.Complexes.HighConeIndex +import OAI.Topology.ArtinGroups.Complexes.EmptyTestIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] + +noncomputable def HomotopyEquivalence.negativeTwistModern + {J:Type u} [Fintype J] [DecidableEq J] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (e:HomotopyEquivalence Q E F) (α:V) : + HomotopyEquivalence Q (E.negativeTwist Q α) (F.negativeTwist Q α) := by + convert e.negativeTwist Q α using 1 + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_upperBound (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) : + ClassUpperBound Q q (classLayer Q q x) := + classUpperBound_of_representative Q _ (fun i=>le_of_eq i.property) + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_lowerBound (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) : + ClassLowerBound Q q (classLayer Q q x) := + classLowerBound_of_representative Q _ (fun i=>le_of_eq i.property.symm) + +noncomputable def allPureIndex (E:BasedComplex Q (K:=K) I) (q:ℤ) + (h:∀ i,(E.placement i).level=q) : I ≃ {i:I // (E.placement i).level=q} where + toFun i:=⟨i,h i⟩ + invFun i:=i.val + left_inv _:=rfl + right_inv _:=rfl + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_eq_self_of_pure (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (h:∀ i,(E.placement i).level=q) : + classLayer Q q (classOfComplex Q E)=classOfComplex Q E := by + rw [classLayer_minimal Q E hE] + have he:(E.pureLayer Q hE q).reindex Q (allPureIndex Q E q h)=E := by + apply ext_placement_differential Q <;> rfl + exact (classOfComplex_reindex Q _ (allPureIndex Q E q h)).trans (by rw [he]) + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_idempotent (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) : + classLayer Q q (classLayer Q q x)=classLayer Q q x := by + let y:=classLayer Q q x + let E:=minimalClassModel Q y + have hp:∀ i,(E.complex.placement i).level=q := fun i=> + le_antisymm (classLayer_upperBound Q x q i) (classLayer_lowerBound Q x q i) + have he:classOfComplex Q E.complex=y:=minimalClassModel_class Q y + simpa only [he] using classLayer_eq_self_of_pure Q E.complex + (minimalClassModel_minimal Q y) q hp + +omit [Fintype V] [DecidableEq A] in +lemma classLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (q:ℤ) : + classLayer Q q (classOfComplex Q (lowerTruncation Q E hE q))= + classLayer Q q (classOfComplex Q E) := by + apply classLayer_eq_of_cone_equivalence Q (lowInclusion Q E _ (levelDownClosed Q E hE q)) + (upperTruncation Q E hE q) (lowConeReduction Q E _ _) q + intro j + have hj:=j.property + change ¬(E.placement j).level≤q at hj + change (E.placement j).level≠q-1 ∧ (E.placement j).level≠q + omega + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma capped_upperTruncation_far (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (U:Set V) (q:ℤ) + (hcap:∀ i,(E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤q) : + ∀ i,((upperTruncation Q E hE q).placement i).color∉Q.closedNeighborhood U := by + intro i hi + exact i.property (hcap i hi) + +lemma negativeLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (U:Set V) (q:ℤ) + (hcap:∀ i,(E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤q) + (α:V) (hα:α∈U) : + classLayer Q q (classOfComplex Q ((lowerTruncation Q E hE q).negativeTwist Q α))= + classLayer Q q (classOfComplex Q (E.negativeTwist Q α)) := by + let f:=lowInclusion Q E _ (levelDownClosed Q E hE q) + let R:=upperTruncation Q E hE q + have coneIso : ChainIsomorphism Q ((f.cone Q).negativeTwist Q α) + ((f.negativeTwist Q α).cone Q) := by + convert negativeTwistCone Q f α using 1 + let e:HomotopyEquivalence Q ((f.negativeTwist Q α).cone Q) R:= + ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q + (((lowConeReduction Q E (lowerLevelSet Q E q) (levelDownClosed Q E hE q)).negativeTwistModern Q α).trans Q + (negativeTwistFar Q R U (capped_upperTruncation_far Q E hE U q hcap) α hα)) + apply classLayer_eq_of_cone_equivalence Q (f.negativeTwist Q α) R e q + intro j + have hj:=j.property + change ¬(E.placement j).level≤q at hj + change (E.placement j).level≠q-1 ∧ (E.placement j).level≠q + omega + +lemma negativeLayer_top (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) (α:V) : + classLayer Q q (classNegativeTwist Q α (classOfComplex Q E))= + classLayer Q q (classNegativeTwist Q α (classLayer Q q (classOfComplex Q E))) := by + let f:=highProjection Q E _ (levelDownClosed Q E hE (q-1)) + let D:=(highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q + let G:=minimalClassModel Q (classOfComplex Q (D.negativeTwist Q α)) + let e₀:HomotopyEquivalence Q (D.negativeTwist Q α) G.complex:= + (minimalClassModelEquivalence Q (D.negativeTwist Q α)).symm Q + have hd:∀ i,(D.placement i).level≤q-2 := by + intro i + rw [highConeRetained_level] + have hi:=i.property + change (E.placement i).level≤q-1 at hi + omega + have hg:∀ i,(G.complex.placement i).level≤q-2 := + negativeTwist_upper_bound Q D G.complex hd α (minimalClassModel_minimal Q _) e₀ + have coneIso : ChainIsomorphism Q ((f.cone Q).negativeTwist Q α) + ((f.negativeTwist Q α).cone Q) := by + convert negativeTwistCone Q f α using 1 + let e:HomotopyEquivalence Q ((f.negativeTwist Q α).cone Q) G.complex:= + ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q + ((((highConeReduction Q E (lowerLevelSet Q E (q-1)) (levelDownClosed Q E hE (q-1))).negativeTwistModern Q α)).trans Q e₀) + have hh:=classLayer_eq_of_cone_equivalence Q (f.negativeTwist Q α) G.complex e q + (fun i=>by have hi:=hg i; constructor <;> omega) + change classLayer Q q (classNegativeTwist Q α (classOfComplex Q E))= + classLayer Q q (classNegativeTwist Q α (classOfComplex Q (upperTruncation Q E hE (q-1)))) at hh + rwa [highRestriction_top_eq_layer Q E hE q hhi] at hh + +lemma classNegativeTwist_capped_layer (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x (Q.closedNeighborhood U) q) + (α:V) (hα:α∈U) : + classLayer Q q (classNegativeTwist Q α x)= + classLayer Q q (classNegativeTwist Q α (classLayer Q q x)) := by + let E:=minimalClassModel Q x + have hE:=minimalClassModel_minimal Q x + let L:=lowerTruncation Q E.complex hE q + have hx:classOfComplex Q E.complex=x:=minimalClassModel_class Q x + have hl:=negativeLayer_lowerTruncation Q E.complex hE U q hcap α hα + have ht:=negativeLayer_top Q L (lowerTruncation_minimal Q E.complex hE q) q + (fun i=>i.property) α + have he:=classLayer_lowerTruncation Q E.complex hE q + change classLayer Q q (classNegativeTwist Q α (classOfComplex Q L))= + classLayer Q q (classNegativeTwist Q α (classOfComplex Q E.complex)) at hl + rw [hx] at hl he + exact hl.symm.trans (ht.trans (congrArg (fun y=>classLayer Q q (classNegativeTwist Q α y)) he)) + +theorem inverseWord_capped_layer (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (q:ℤ) (hcap:ClassCapOn Q x (Q.closedNeighborhood U) q) + (hw:∀ α∈w,α∈U) : + classLayer Q q (inverseWordAction Q w x)= + classLayer Q q (inverseWordAction Q w (classLayer Q q x)) := by + induction w generalizing x with + | nil=>exact (classLayer_idempotent Q x q).symm + | cons α w ih=> + have hα:=hw α (by simp) + have hw':∀ β∈w,β∈U:=fun β hβ=>hw β (by simp [hβ]) + have hc:=classNegativeTwist_capped_layer Q x U q hcap α hα + have hy:=classCapOn_of_upper Q (classLayer Q q x) (Q.closedNeighborhood U) q + (classLayer_upperBound Q x q) + exact (ih _ (classNegativeTwist_capOn Q x U q hcap α hα) hw').trans + ((congrArg (fun y=>classLayer Q q (inverseWordAction Q w y)) hc).trans + (ih _ (classNegativeTwist_capOn Q _ U q hy α hα) hw').symm) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedInverseTwistHomotopy.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedInverseTwistHomotopy.lean index d155844336391d636b13267f7890228a413068e8..3c2fbba3905efe1ba4bc5d7471342456812164e3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedInverseTwistHomotopy.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedInverseTwistHomotopy.lean @@ -1,68 +1,68 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Complexes.InverseTwistIdentity - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -noncomputable def normalizedInverseTwistHomotopyEquivalence - (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q (normalizedInverseTwist Q hn E α) E where - forward := { - matrix := inverseTwistProjection Q E α - entries := by - rw [normalizedInverseTwist_placement] - exact inverseTwistProjection_entries Q E α - degree := by - rw [normalizedInverseTwist_placement] - exact inverseTwistProjection_degree Q E α - commute := by - rw [normalizedInverseTwist_differential] - exact inverseTwistProjection_commute Q E α } - backward := { - matrix := inverseTwistInjection Q E α - entries := by - rw [normalizedInverseTwist_placement] - exact inverseTwistInjection_entries Q E α - degree := by - rw [normalizedInverseTwist_placement] - exact inverseTwistInjection_degree Q E α - commute := by - rw [normalizedInverseTwist_differential] - exact inverseTwistInjection_commute Q E α } - sourceHomotopy := inverseTwistHomotopy Q E α - targetHomotopy := 0 - sourceEntries := by - rw [normalizedInverseTwist_placement] - exact inverseTwistHomotopy_entries Q E α - targetEntries := projectiveEntries_zero Q - sourceDegree := by - rw [normalizedInverseTwist_placement] - exact inverseTwistHomotopy_degree Q E α - targetDegree := mapDegree_zero Q (-1) 0 - sourceEquation := by - dsimp only - rw [normalizedInverseTwist_placement, normalizedInverseTwist_differential] - exact inverseTwist_sourceEquation Q hn E α - targetEquation := by - dsimp only - simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] - exact inverseTwist_targetEquation Q E α - -noncomputable def positive_negative_homotopyEquivalence - (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q ((E.negativeTwist Q α).positiveTwist Q α) E := by - classical - exact - (((E.negativeTwist Q α).positiveTwist Q α).reindexHomotopyEquivalence Q - (inverseTwistIndexEquiv Q hn E α)).trans Q - (normalizedInverseTwistHomotopyEquivalence Q hn E α) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Complexes.InverseTwistIdentity + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +noncomputable def normalizedInverseTwistHomotopyEquivalence + (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q (normalizedInverseTwist Q hn E α) E where + forward := { + matrix := inverseTwistProjection Q E α + entries := by + rw [normalizedInverseTwist_placement] + exact inverseTwistProjection_entries Q E α + degree := by + rw [normalizedInverseTwist_placement] + exact inverseTwistProjection_degree Q E α + commute := by + rw [normalizedInverseTwist_differential] + exact inverseTwistProjection_commute Q E α } + backward := { + matrix := inverseTwistInjection Q E α + entries := by + rw [normalizedInverseTwist_placement] + exact inverseTwistInjection_entries Q E α + degree := by + rw [normalizedInverseTwist_placement] + exact inverseTwistInjection_degree Q E α + commute := by + rw [normalizedInverseTwist_differential] + exact inverseTwistInjection_commute Q E α } + sourceHomotopy := inverseTwistHomotopy Q E α + targetHomotopy := 0 + sourceEntries := by + rw [normalizedInverseTwist_placement] + exact inverseTwistHomotopy_entries Q E α + targetEntries := projectiveEntries_zero Q + sourceDegree := by + rw [normalizedInverseTwist_placement] + exact inverseTwistHomotopy_degree Q E α + targetDegree := mapDegree_zero Q (-1) 0 + sourceEquation := by + dsimp only + rw [normalizedInverseTwist_placement, normalizedInverseTwist_differential] + exact inverseTwist_sourceEquation Q hn E α + targetEquation := by + dsimp only + simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] + exact inverseTwist_targetEquation Q E α + +noncomputable def positive_negative_homotopyEquivalence + (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q ((E.negativeTwist Q α).positiveTwist Q α) E := by + classical + exact + (((E.negativeTwist Q α).positiveTwist Q α).reindexHomotopyEquivalence Q + (inverseTwistIndexEquiv Q hn E α)).trans Q + (normalizedInverseTwistHomotopyEquivalence Q hn E α) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedReverseTwistHomotopy.lean b/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedReverseTwistHomotopy.lean index 83c89cf42526cdb0d14f2e3862975935b6c7a18b..65f3d9f1e4e36c1d7bf461df17d771102e804bd8 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedReverseTwistHomotopy.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/NormalizedReverseTwistHomotopy.lean @@ -1,68 +1,68 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Complexes.ReverseTwistProjectionCommute - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -noncomputable def normalizedReverseTwistHomotopyEquivalence - (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q (normalizedReverseTwist Q hn E α) E where - forward := { - matrix := reverseTwistProjection Q E α - entries := by - rw [normalizedReverseTwist_placement] - exact reverseTwistProjection_entries Q E α - degree := by - rw [normalizedReverseTwist_placement] - exact reverseTwistProjection_degree Q E α - commute := by - rw [normalizedReverseTwist_differential] - exact reverseTwistProjection_commute Q E α } - backward := { - matrix := reverseTwistInjection Q E α - entries := by - rw [normalizedReverseTwist_placement] - exact reverseTwistInjection_entries Q E α - degree := by - rw [normalizedReverseTwist_placement] - exact reverseTwistInjection_degree Q E α - commute := by - rw [normalizedReverseTwist_differential] - exact reverseTwistInjection_commute Q E α } - sourceHomotopy := reverseTwistHomotopy Q E α - targetHomotopy := 0 - sourceEntries := by - rw [normalizedReverseTwist_placement] - exact reverseTwistHomotopy_entries Q E α - targetEntries := projectiveEntries_zero Q - sourceDegree := by - rw [normalizedReverseTwist_placement] - exact reverseTwistHomotopy_degree Q E α - targetDegree := mapDegree_zero Q (-1) 0 - sourceEquation := by - dsimp only - rw [normalizedReverseTwist_placement, normalizedReverseTwist_differential] - exact reverseTwist_sourceEquation Q hn E α - targetEquation := by - dsimp only - simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] - exact reverseTwist_targetEquation Q E α - -noncomputable def negative_positive_homotopyEquivalence - (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q ((E.positiveTwist Q α).negativeTwist Q α) E := by - classical - exact - (((E.positiveTwist Q α).negativeTwist Q α).reindexHomotopyEquivalence Q - (reverseTwistIndexEquiv Q hn E α)).trans Q - (normalizedReverseTwistHomotopyEquivalence Q hn E α) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Complexes.ReverseTwistProjectionCommute + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +noncomputable def normalizedReverseTwistHomotopyEquivalence + (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q (normalizedReverseTwist Q hn E α) E where + forward := { + matrix := reverseTwistProjection Q E α + entries := by + rw [normalizedReverseTwist_placement] + exact reverseTwistProjection_entries Q E α + degree := by + rw [normalizedReverseTwist_placement] + exact reverseTwistProjection_degree Q E α + commute := by + rw [normalizedReverseTwist_differential] + exact reverseTwistProjection_commute Q E α } + backward := { + matrix := reverseTwistInjection Q E α + entries := by + rw [normalizedReverseTwist_placement] + exact reverseTwistInjection_entries Q E α + degree := by + rw [normalizedReverseTwist_placement] + exact reverseTwistInjection_degree Q E α + commute := by + rw [normalizedReverseTwist_differential] + exact reverseTwistInjection_commute Q E α } + sourceHomotopy := reverseTwistHomotopy Q E α + targetHomotopy := 0 + sourceEntries := by + rw [normalizedReverseTwist_placement] + exact reverseTwistHomotopy_entries Q E α + targetEntries := projectiveEntries_zero Q + sourceDegree := by + rw [normalizedReverseTwist_placement] + exact reverseTwistHomotopy_degree Q E α + targetDegree := mapDegree_zero Q (-1) 0 + sourceEquation := by + dsimp only + rw [normalizedReverseTwist_placement, normalizedReverseTwist_differential] + exact reverseTwist_sourceEquation Q hn E α + targetEquation := by + dsimp only + simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] + exact reverseTwist_targetEquation Q E α + +noncomputable def negative_positive_homotopyEquivalence + (hn : ∀ a, Q.source a ≠ Q.target a) (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q ((E.positiveTwist Q α).negativeTwist Q α) E := by + classical + exact + (((E.positiveTwist Q α).negativeTwist Q α).reindexHomotopyEquivalence Q + (reverseTwistIndexEquiv Q hn E α)).trans Q + (normalizedReverseTwistHomotopyEquivalence Q hn E α) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/OptionSumEquiv.lean b/lean/OAI/Topology/ArtinGroups/Complexes/OptionSumEquiv.lean index 8c0dcb296580f3ca80e5ae47db3ebc1fbe0c6659..8211abac47f276e06663d685e4f9acdd9ef453c4 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/OptionSumEquiv.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/OptionSumEquiv.lean @@ -1,127 +1,127 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -open Zigzag - -universe u -attribute [local instance] Classical.decEq -variable {V A : Type u} {K : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn:∀ a,Q.source a≠Q.target a) - -omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in -lemma packet_orthogonal_inl {J L:Type u} (v:J ⊕ L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - Pairwise fun a b => OrthogonalVertices Q ((v ∘ Sum.inl) a) ((v ∘ Sum.inl) b) := - fun _ _ h=>hv (fun hh=>h (Sum.inl.inj hh)) - -omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in -lemma packet_orthogonal_inr {J L:Type u} (v:J ⊕ L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - Pairwise fun a b => OrthogonalVertices Q ((v ∘ Sum.inr) a) ((v ∘ Sum.inr) b) := - fun _ _ h=>hv (fun hh=>h (Sum.inr.inj hh)) - -omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in -lemma packet_orthogonal_fiber {J L:Type u} (v:J × L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) (j:J) : - Pairwise fun a b => OrthogonalVertices Q (v (j,a)) (v (j,b)) := - fun _ _ h=>hv (fun hh=>h (congrArg Prod.snd hh)) - -def optionSumEquiv (J L:Type u) : Option (J ⊕ L) ≃ Option J ⊕ L where - toFun z := z.elim (.inl none) (fun x => x.elim (fun j=>.inl (some j)) Sum.inr) - invFun z := z.elim (fun j => j.elim none (fun j=>some (.inl j))) (fun l=>some (.inr l)) - left_inv z := by cases z with | none => rfl | some z => cases z <;> rfl - right_inv z := by cases z with | inl z => cases z <;> rfl | inr z => rfl - -lemma classPacketPerm_sumIndex {J L:Type u} [Fintype J] [Fintype L] (v:J ⊕ L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - classPacketPerm Q (K:=K) hn v hv = - classPacketPerm Q hn (v ∘ Sum.inl) (packet_orthogonal_inl Q v hv) * - classPacketPerm Q hn (v ∘ Sum.inr) (packet_orthogonal_inr Q v hv) := by - suffices hh : ∀ (J:Type u) [Fintype J] (v:J ⊕ L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - classPacketPerm Q (K:=K) hn v hv = - classPacketPerm Q hn (v ∘ Sum.inl) (packet_orthogonal_inl Q v hv) * - classPacketPerm Q hn (v ∘ Sum.inr) (packet_orthogonal_inr Q v hv) from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P:=fun J _ => ∀ (v:J ⊕ L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - classPacketPerm Q (K:=K) hn v hv = - classPacketPerm Q hn (v ∘ Sum.inl) (packet_orthogonal_inl Q v hv) * - classPacketPerm Q hn (v ∘ Sum.inr) (packet_orthogonal_inr Q v hv)) _ _ _ J - · intro J J' instJ' e ih - let := Fintype.ofEquiv J' e.symm - intro v hv - erw [classPacketPerm_reindex Q hn v hv (Equiv.sumCongr e (Equiv.refl L)), - classPacketPerm_reindex Q hn (v ∘ Sum.inl) _ e] - exact ih _ _ - · intro v hv - erw [classPacketPerm_empty Q hn (v ∘ Sum.inl),show (Equiv.refl _ : Equiv.Perm (FiniteHomotopyClass Q (K:=K))) = 1 from rfl,_root_.one_mul] - let e : L ≃ PEmpty ⊕ L := - { toFun:=Sum.inr - invFun:=fun x=>x.elim PEmpty.elim id - left_inv:=fun _=>rfl - right_inv:=by intro x; cases x with | inl x=>exact x.elim | inr x=>rfl } - exact classPacketPerm_reindex Q hn v hv e - · intro J instJ ih v hv - erw [classPacketPerm_reindex Q hn v hv (optionSumEquiv J L),classPacketPerm_cons Q hn (v ∘ (optionSumEquiv J L)), - classPacketPerm_cons Q hn (v ∘ Sum.inl),_root_.mul_assoc] - apply congrArg (fun p => classTwistPerm Q (K:=K) hn (v (.inl none)) * p) - exact ih _ _ - -def optionProdEquiv (J L:Type u) : L ⊕ (J × L) ≃ Option J × L where - toFun z := z.elim (fun l=>(none,l)) (fun p=>(some p.1,p.2)) - invFun z := z.1.elim (.inl z.2) (fun j=>.inr (j,z.2)) - left_inv z := by cases z <;> rfl - right_inv z := by rcases z with ⟨j,l⟩; cases j <;> rfl - -lemma exists_packetGroupWord {J L:Type u} [Fintype J] [Fintype L] (v:J × L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - ∃ w:List J, classPacketPerm Q (K:=K) hn v hv = - (w.map fun j=>classPacketPerm Q hn (fun l=>v (j,l)) - (packet_orthogonal_fiber Q v hv j)).prod := by - suffices hh : ∀ (J:Type u) [Fintype J] (v:J × L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - ∃ w:List J, classPacketPerm Q (K:=K) hn v hv = - (w.map fun j=>classPacketPerm Q hn (fun l=>v (j,l)) - (packet_orthogonal_fiber Q v hv j)).prod from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P:=fun J _ => ∀ (v:J × L → V) - (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - ∃ w:List J, classPacketPerm Q (K:=K) hn v hv = - (w.map fun j=>classPacketPerm Q hn (fun l=>v (j,l)) - (packet_orthogonal_fiber Q v hv j)).prod) _ _ _ J - · intro J J' instJ' e ih - let := Fintype.ofEquiv J' e.symm - intro v hv - erw [classPacketPerm_reindex Q hn v hv (Equiv.prodCongr e (Equiv.refl L))] - obtain ⟨w,hw⟩ := ih _ _ - refine ⟨w.map e,hw.trans ?_⟩ - simp only [List.map_map] - apply congrArg List.prod - apply List.map_congr_left - intro j hj - rfl - · intro v hv - refine ⟨[],?_⟩ - erw [classPacketPerm_empty Q hn v hv] - rfl - · intro J instJ ih v hv - erw [classPacketPerm_reindex Q hn v hv (optionProdEquiv J L),classPacketPerm_sumIndex Q hn (v ∘ (optionProdEquiv J L))] - obtain ⟨w,hw⟩ := ih (fun p=>v (some p.1,p.2)) - (by - intro a b hab - apply hv - intro hh - simp only [Prod.mk.injEq,Option.some.injEq] at hh - exact hab (Prod.ext hh.1 hh.2)) - refine ⟨none::w.map some,?_⟩ - simp only [List.map_cons,List.prod_cons,List.map_map] - exact congrArg (fun p=>classPacketPerm Q hn (fun l=>v (none,l)) _ * p) hw - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +open Zigzag + +universe u +attribute [local instance] Classical.decEq +variable {V A : Type u} {K : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn:∀ a,Q.source a≠Q.target a) + +omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in +lemma packet_orthogonal_inl {J L:Type u} (v:J ⊕ L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + Pairwise fun a b => OrthogonalVertices Q ((v ∘ Sum.inl) a) ((v ∘ Sum.inl) b) := + fun _ _ h=>hv (fun hh=>h (Sum.inl.inj hh)) + +omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in +lemma packet_orthogonal_inr {J L:Type u} (v:J ⊕ L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + Pairwise fun a b => OrthogonalVertices Q ((v ∘ Sum.inr) a) ((v ∘ Sum.inr) b) := + fun _ _ h=>hv (fun hh=>h (Sum.inr.inj hh)) + +omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in +lemma packet_orthogonal_fiber {J L:Type u} (v:J × L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) (j:J) : + Pairwise fun a b => OrthogonalVertices Q (v (j,a)) (v (j,b)) := + fun _ _ h=>hv (fun hh=>h (congrArg Prod.snd hh)) + +def optionSumEquiv (J L:Type u) : Option (J ⊕ L) ≃ Option J ⊕ L where + toFun z := z.elim (.inl none) (fun x => x.elim (fun j=>.inl (some j)) Sum.inr) + invFun z := z.elim (fun j => j.elim none (fun j=>some (.inl j))) (fun l=>some (.inr l)) + left_inv z := by cases z with | none => rfl | some z => cases z <;> rfl + right_inv z := by cases z with | inl z => cases z <;> rfl | inr z => rfl + +lemma classPacketPerm_sumIndex {J L:Type u} [Fintype J] [Fintype L] (v:J ⊕ L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + classPacketPerm Q (K:=K) hn v hv = + classPacketPerm Q hn (v ∘ Sum.inl) (packet_orthogonal_inl Q v hv) * + classPacketPerm Q hn (v ∘ Sum.inr) (packet_orthogonal_inr Q v hv) := by + suffices hh : ∀ (J:Type u) [Fintype J] (v:J ⊕ L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + classPacketPerm Q (K:=K) hn v hv = + classPacketPerm Q hn (v ∘ Sum.inl) (packet_orthogonal_inl Q v hv) * + classPacketPerm Q hn (v ∘ Sum.inr) (packet_orthogonal_inr Q v hv) from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P:=fun J _ => ∀ (v:J ⊕ L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + classPacketPerm Q (K:=K) hn v hv = + classPacketPerm Q hn (v ∘ Sum.inl) (packet_orthogonal_inl Q v hv) * + classPacketPerm Q hn (v ∘ Sum.inr) (packet_orthogonal_inr Q v hv)) _ _ _ J + · intro J J' instJ' e ih + let := Fintype.ofEquiv J' e.symm + intro v hv + erw [classPacketPerm_reindex Q hn v hv (Equiv.sumCongr e (Equiv.refl L)), + classPacketPerm_reindex Q hn (v ∘ Sum.inl) _ e] + exact ih _ _ + · intro v hv + erw [classPacketPerm_empty Q hn (v ∘ Sum.inl),show (Equiv.refl _ : Equiv.Perm (FiniteHomotopyClass Q (K:=K))) = 1 from rfl,_root_.one_mul] + let e : L ≃ PEmpty ⊕ L := + { toFun:=Sum.inr + invFun:=fun x=>x.elim PEmpty.elim id + left_inv:=fun _=>rfl + right_inv:=by intro x; cases x with | inl x=>exact x.elim | inr x=>rfl } + exact classPacketPerm_reindex Q hn v hv e + · intro J instJ ih v hv + erw [classPacketPerm_reindex Q hn v hv (optionSumEquiv J L),classPacketPerm_cons Q hn (v ∘ (optionSumEquiv J L)), + classPacketPerm_cons Q hn (v ∘ Sum.inl),_root_.mul_assoc] + apply congrArg (fun p => classTwistPerm Q (K:=K) hn (v (.inl none)) * p) + exact ih _ _ + +def optionProdEquiv (J L:Type u) : L ⊕ (J × L) ≃ Option J × L where + toFun z := z.elim (fun l=>(none,l)) (fun p=>(some p.1,p.2)) + invFun z := z.1.elim (.inl z.2) (fun j=>.inr (j,z.2)) + left_inv z := by cases z <;> rfl + right_inv z := by rcases z with ⟨j,l⟩; cases j <;> rfl + +lemma exists_packetGroupWord {J L:Type u} [Fintype J] [Fintype L] (v:J × L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + ∃ w:List J, classPacketPerm Q (K:=K) hn v hv = + (w.map fun j=>classPacketPerm Q hn (fun l=>v (j,l)) + (packet_orthogonal_fiber Q v hv j)).prod := by + suffices hh : ∀ (J:Type u) [Fintype J] (v:J × L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + ∃ w:List J, classPacketPerm Q (K:=K) hn v hv = + (w.map fun j=>classPacketPerm Q hn (fun l=>v (j,l)) + (packet_orthogonal_fiber Q v hv j)).prod from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P:=fun J _ => ∀ (v:J × L → V) + (hv:Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + ∃ w:List J, classPacketPerm Q (K:=K) hn v hv = + (w.map fun j=>classPacketPerm Q hn (fun l=>v (j,l)) + (packet_orthogonal_fiber Q v hv j)).prod) _ _ _ J + · intro J J' instJ' e ih + let := Fintype.ofEquiv J' e.symm + intro v hv + erw [classPacketPerm_reindex Q hn v hv (Equiv.prodCongr e (Equiv.refl L))] + obtain ⟨w,hw⟩ := ih _ _ + refine ⟨w.map e,hw.trans ?_⟩ + simp only [List.map_map] + apply congrArg List.prod + apply List.map_congr_left + intro j hj + rfl + · intro v hv + refine ⟨[],?_⟩ + erw [classPacketPerm_empty Q hn v hv] + rfl + · intro J instJ ih v hv + erw [classPacketPerm_reindex Q hn v hv (optionProdEquiv J L),classPacketPerm_sumIndex Q hn (v ∘ (optionProdEquiv J L))] + obtain ⟨w,hw⟩ := ih (fun p=>v (some p.1,p.2)) + (by + intro a b hab + apply hv + intro hh + simp only [Prod.mk.injEq,Option.some.injEq] at hh + exact hab (Prod.ext hh.1 hh.2)) + refine ⟨none::w.map some,?_⟩ + simp only [List.map_cons,List.prod_cons,List.map_map] + exact congrArg (fun p=>classPacketPerm Q hn (fun l=>v (none,l)) _ * p) hw + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/OutsideCap.lean b/lean/OAI/Topology/ArtinGroups/Complexes/OutsideCap.lean index 2f621708b897597c1075fdd4941a18478efd6c8f..d9ac712f4e3559983d8bdd4d04cd4a0af7ffd833 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/OutsideCap.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/OutsideCap.lean @@ -1,73 +1,73 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.UpperBound -import OAI.Topology.ArtinGroups.Complexes.TestExact - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type u} [Fintype I] [DecidableEq I] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma scalarExact_of_absent_degree (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) - (h:∀ i,(E.placement i).level≠l) : ScalarExactAt Q E α l c := by - intro x hx _ - have hz:x=0 := by funext i; exact hx i (fun hh=>h i hh.1) - refine ⟨0,?_,?_⟩ - · intro index _; rfl - · rw [Matrix.zero_vecMul,hz] - -omit [DecidableEq I] in -lemma testUpperBound_of_generator_cap (E:BasedComplex Q (K:=K) I) (d:ℤ) - (h:∀ i,(E.placement i).level≤d) (U:Set V) : TestUpperBound Q E U (d+2) := by - intro α _ l hl c - apply scalarExact_of_absent_degree Q _ α l c - intro j he - have hp:Path.length j.2.val≤2 := by rcases j.2.val with v|a|v <;> norm_num [Path.length] - have hi:=h j.1 - dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at he hi - omega - -lemma classTestUpper_of_generator_cap (x:FiniteHomotopyClass Q (K:=K)) (d:ℤ) - (h:ClassUpperBound Q d x) (U:Set V) : ClassTestUpper Q x U (d+2) := by - rw [← minimalClassModel_class Q x] - exact testUpperBound_of_generator_cap Q _ d h U - -def ClassOutsideCap (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (d:ℤ) : Prop := - ∀ i,((minimalClassModel Q x).complex.placement i).color∉U→ - ((minimalClassModel Q x).complex.placement i).level≤d - -omit [Fintype V] [DecidableEq A] in -lemma classOutsideCap_of_upper (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (d:ℤ) - (h:ClassUpperBound Q d x) : ClassOutsideCap Q x U d := fun i _=>h i - -lemma classPositiveTwist_outside_cap (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (d:ℤ) (α:V) (hα:α∈U) (h:ClassOutsideCap Q x U d) : - ClassOutsideCap Q (classPositiveTwist Q α x) U d := by - let E:=minimalClassModel Q x - let F:=E.complex.positiveTwist Q α - have hx:classOfComplex Q F=classPositiveTwist Q α x := by - change classPositiveTwist Q α (classOfComplex Q E.complex)=_ - exact congrArg (classPositiveTwist Q α) (minimalClassModel_class Q x) - rw [← hx] - apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) - (minimalClassModelEquivalence Q F).symm (fun p=>p.color∉U→p.level≤d) - intro i hi - rcases i with j|j - · exact (hi hα).elim - · exact h j hi - -lemma classUpperBound_of_test_and_outside (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (d:ℤ) (h:ClassTestUpper Q x U (d+2)) (ho:ClassOutsideCap Q x U d) : - ClassUpperBound Q d x := by - apply generatorBound_of_test_and_outside Q _ (minimalClassModel_minimal Q x) U d _ ho - change ClassTestUpper Q (classOfComplex Q (minimalClassModel Q x).complex) U (d+2) - have he:classOfComplex Q (minimalClassModel Q x).complex=x:=minimalClassModel_class Q x - rw [he] - exact h - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.UpperBound +import OAI.Topology.ArtinGroups.Complexes.TestExact + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma scalarExact_of_absent_degree (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) + (h:∀ i,(E.placement i).level≠l) : ScalarExactAt Q E α l c := by + intro x hx _ + have hz:x=0 := by funext i; exact hx i (fun hh=>h i hh.1) + refine ⟨0,?_,?_⟩ + · intro index _; rfl + · rw [Matrix.zero_vecMul,hz] + +omit [DecidableEq I] in +lemma testUpperBound_of_generator_cap (E:BasedComplex Q (K:=K) I) (d:ℤ) + (h:∀ i,(E.placement i).level≤d) (U:Set V) : TestUpperBound Q E U (d+2) := by + intro α _ l hl c + apply scalarExact_of_absent_degree Q _ α l c + intro j he + have hp:Path.length j.2.val≤2 := by rcases j.2.val with v|a|v <;> norm_num [Path.length] + have hi:=h j.1 + dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at he hi + omega + +lemma classTestUpper_of_generator_cap (x:FiniteHomotopyClass Q (K:=K)) (d:ℤ) + (h:ClassUpperBound Q d x) (U:Set V) : ClassTestUpper Q x U (d+2) := by + rw [← minimalClassModel_class Q x] + exact testUpperBound_of_generator_cap Q _ d h U + +def ClassOutsideCap (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (d:ℤ) : Prop := + ∀ i,((minimalClassModel Q x).complex.placement i).color∉U→ + ((minimalClassModel Q x).complex.placement i).level≤d + +omit [Fintype V] [DecidableEq A] in +lemma classOutsideCap_of_upper (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (d:ℤ) + (h:ClassUpperBound Q d x) : ClassOutsideCap Q x U d := fun i _=>h i + +lemma classPositiveTwist_outside_cap (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (d:ℤ) (α:V) (hα:α∈U) (h:ClassOutsideCap Q x U d) : + ClassOutsideCap Q (classPositiveTwist Q α x) U d := by + let E:=minimalClassModel Q x + let F:=E.complex.positiveTwist Q α + have hx:classOfComplex Q F=classPositiveTwist Q α x := by + change classPositiveTwist Q α (classOfComplex Q E.complex)=_ + exact congrArg (classPositiveTwist Q α) (minimalClassModel_class Q x) + rw [← hx] + apply minimal_bound_transport Q F _ (minimalClassModel_minimal Q _) + (minimalClassModelEquivalence Q F).symm (fun p=>p.color∉U→p.level≤d) + intro i hi + rcases i with j|j + · exact (hi hα).elim + · exact h j hi + +lemma classUpperBound_of_test_and_outside (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (d:ℤ) (h:ClassTestUpper Q x U (d+2)) (ho:ClassOutsideCap Q x U d) : + ClassUpperBound Q d x := by + apply generatorBound_of_test_and_outside Q _ (minimalClassModel_minimal Q x) U d _ ho + change ClassTestUpper Q (classOfComplex Q (minimalClassModel Q x).complex) U (d+2) + have he:classOfComplex Q (minimalClassModel Q x).complex=x:=minimalClassModel_class Q x + rw [he] + exact h + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketConsEquiv.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketConsEquiv.lean index 9b436243345364cb2a7564b1e0deb64ef329604f..e35b0419ae3e3358c4d361a39e150a3962090c10 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketConsEquiv.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketConsEquiv.lean @@ -1,100 +1,100 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices -import OAI.Topology.ArtinGroups.Quivers.PacketIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J L : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] - -noncomputable def packetConsEquiv (E : BasedComplex Q (K := K) I) - (α:V) (v:J → V) (h : ∀ a, OrthogonalVertices Q α (v a)) : - (PacketIndex Q E.placement (fun z : Option J => z.elim α v) ⊕ I) ≃ - (TestIndex Q (E.packetTwist Q v).placement α ⊕ (PacketIndex Q E.placement v ⊕ I)) where - toFun - | .inl ⟨none,u⟩ => .inl ⟨.inr u.1,u.2⟩ - | .inl ⟨some a,u⟩ => .inr (.inl ⟨a,u⟩) - | .inr i => .inr (.inr i) - invFun - | .inl ⟨.inl ⟨a,_⟩,p⟩ => (no_corner_of_orthogonal Q (h a) p).elim - | .inl ⟨.inr i,p⟩ => .inl ⟨none,i,p⟩ - | .inr (.inl ⟨a,u⟩) => .inl ⟨some a,u⟩ - | .inr (.inr i) => .inr i - left_inv z := by rcases z with ⟨_|a,u⟩|i <;> rfl - right_inv z := by - rcases z with ⟨⟨a,x⟩|i,p⟩|⟨a,u⟩|i - · exact (no_corner_of_orthogonal Q (h a) p).elim - all_goals rfl - -lemma packetCons_eq (E : BasedComplex Q (K := K) I) - (α:V) (v:J → V) (h : ∀ a, OrthogonalVertices Q α (v a)) : - ((E.packetTwist Q v).positiveTwist Q α).reindex Q (packetConsEquiv Q E α v h) = - E.packetTwist Q (fun z : Option J => z.elim α v) := by - apply ext_placement_differential Q - · funext z - rcases z with ⟨_|a,u⟩|i <;> rfl - · apply Matrix.ext - intro z w - rcases z with ⟨_|a,u⟩|i <;> rcases w with ⟨_|b,t⟩|j - all_goals dsimp only [reindex, Matrix.submatrix_apply, packetConsEquiv, Equiv.coe_fn_mk] - all_goals simp only [ - positiveTwist_differential,packetTwist,Map.cone,packetEvaluation,packetTest, - Map.coneDifferential,Matrix.fromBlocks,Matrix.of_apply,Matrix.neg_apply,Matrix.zero_apply, - testTransform,scalarCornerMatrix,testMatrix,packetDifferential,packetEvaluationMatrix, - evaluationMatrix,Sum.inr_ne_inl,Sum.inr.injEq,Sum.elim_inl,Sum.elim_inr,Option.elim_none, - Option.elim_some,Matrix.blockDiagonal'_apply_eq,↓reduceIte] - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ (by simp),neg_zero] - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ (by simp),neg_zero] - · by_cases hab : a=b - · subst b - simp only [Matrix.blockDiagonal',Matrix.of_apply, ↓reduceDIte,Option.elim_some] - · simp only [Matrix.blockDiagonal',Matrix.of_apply,hab,Option.some.injEq, ↓reduceDIte] - -variable [Fintype L] [DecidableEq L] - -def packetReindexEquiv (E : BasedComplex Q (K := K) I) (v:J → V) (e:L ≃ J) : - (PacketIndex Q E.placement (v ∘ e) ⊕ I) ≃ (PacketIndex Q E.placement v ⊕ I) := - Equiv.sumCongr (Equiv.sigmaCongrLeft (β := fun a : J => TestIndex Q E.placement (v a)) e) (Equiv.refl I) - -omit [DecidableEq I] in -lemma packetReindex_eq (E : BasedComplex Q (K := K) I) (v:J → V) (e:L ≃ J) : - (E.packetTwist Q v).reindex Q (packetReindexEquiv Q E v e) = E.packetTwist Q (v ∘ e) := by - apply ext_placement_differential Q - · funext z - rcases z with ⟨a,u⟩|i <;> rfl - · apply Matrix.ext - intro z w - rcases z with ⟨a,u⟩|i <;> rcases w with ⟨b,t⟩|j - · change -(Matrix.blockDiagonal' (fun a => scalarCornerMatrix Q (v a) - (testMatrix Q E.placement E.placement (v a) E.differential)) ⟨e a,u⟩ ⟨e b,t⟩) = _ - by_cases hab : a=b - · subst b - simp only [packetTwist,Map.cone,Map.coneDifferential,packetEvaluation,packetTest, - packetDifferential,Matrix.fromBlocks,Matrix.of_apply,Matrix.neg_apply, - Matrix.blockDiagonal'_apply_eq,Function.comp_apply,Sum.elim_inl] - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ (fun he => hab (e.injective he))] - change -(0 : Zigzag Q K) = -(Matrix.blockDiagonal' (fun a : L => - scalarCornerMatrix Q (v (e a)) (testMatrix Q E.placement E.placement (v (e a)) E.differential)) ⟨a,u⟩ ⟨b,t⟩) - rw [Matrix.blockDiagonal'_apply_ne _ _ _ hab] - all_goals rfl - -def packetEmptyEquiv (E : BasedComplex Q (K := K) I) (v:J → V) [IsEmpty J] : - I ≃ (PacketIndex Q E.placement v ⊕ I) where - toFun := Sum.inr - invFun z := z.elim (fun a => isEmptyElim a.1) id - left_inv _ := rfl - right_inv z := by - rcases z with z|i - · exact isEmptyElim z.1 - · rfl - -omit [DecidableEq I] in -lemma packetEmpty_eq (E : BasedComplex Q (K := K) I) (v:J → V) [IsEmpty J] : - (E.packetTwist Q v).reindex Q (packetEmptyEquiv Q E v) = E := by - apply ext_placement_differential Q <;> rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices +import OAI.Topology.ArtinGroups.Quivers.PacketIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J L : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] + +noncomputable def packetConsEquiv (E : BasedComplex Q (K := K) I) + (α:V) (v:J → V) (h : ∀ a, OrthogonalVertices Q α (v a)) : + (PacketIndex Q E.placement (fun z : Option J => z.elim α v) ⊕ I) ≃ + (TestIndex Q (E.packetTwist Q v).placement α ⊕ (PacketIndex Q E.placement v ⊕ I)) where + toFun + | .inl ⟨none,u⟩ => .inl ⟨.inr u.1,u.2⟩ + | .inl ⟨some a,u⟩ => .inr (.inl ⟨a,u⟩) + | .inr i => .inr (.inr i) + invFun + | .inl ⟨.inl ⟨a,_⟩,p⟩ => (no_corner_of_orthogonal Q (h a) p).elim + | .inl ⟨.inr i,p⟩ => .inl ⟨none,i,p⟩ + | .inr (.inl ⟨a,u⟩) => .inl ⟨some a,u⟩ + | .inr (.inr i) => .inr i + left_inv z := by rcases z with ⟨_|a,u⟩|i <;> rfl + right_inv z := by + rcases z with ⟨⟨a,x⟩|i,p⟩|⟨a,u⟩|i + · exact (no_corner_of_orthogonal Q (h a) p).elim + all_goals rfl + +lemma packetCons_eq (E : BasedComplex Q (K := K) I) + (α:V) (v:J → V) (h : ∀ a, OrthogonalVertices Q α (v a)) : + ((E.packetTwist Q v).positiveTwist Q α).reindex Q (packetConsEquiv Q E α v h) = + E.packetTwist Q (fun z : Option J => z.elim α v) := by + apply ext_placement_differential Q + · funext z + rcases z with ⟨_|a,u⟩|i <;> rfl + · apply Matrix.ext + intro z w + rcases z with ⟨_|a,u⟩|i <;> rcases w with ⟨_|b,t⟩|j + all_goals dsimp only [reindex, Matrix.submatrix_apply, packetConsEquiv, Equiv.coe_fn_mk] + all_goals simp only [ + positiveTwist_differential,packetTwist,Map.cone,packetEvaluation,packetTest, + Map.coneDifferential,Matrix.fromBlocks,Matrix.of_apply,Matrix.neg_apply,Matrix.zero_apply, + testTransform,scalarCornerMatrix,testMatrix,packetDifferential,packetEvaluationMatrix, + evaluationMatrix,Sum.inr_ne_inl,Sum.inr.injEq,Sum.elim_inl,Sum.elim_inr,Option.elim_none, + Option.elim_some,Matrix.blockDiagonal'_apply_eq,↓reduceIte] + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ (by simp),neg_zero] + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ (by simp),neg_zero] + · by_cases hab : a=b + · subst b + simp only [Matrix.blockDiagonal',Matrix.of_apply, ↓reduceDIte,Option.elim_some] + · simp only [Matrix.blockDiagonal',Matrix.of_apply,hab,Option.some.injEq, ↓reduceDIte] + +variable [Fintype L] [DecidableEq L] + +def packetReindexEquiv (E : BasedComplex Q (K := K) I) (v:J → V) (e:L ≃ J) : + (PacketIndex Q E.placement (v ∘ e) ⊕ I) ≃ (PacketIndex Q E.placement v ⊕ I) := + Equiv.sumCongr (Equiv.sigmaCongrLeft (β := fun a : J => TestIndex Q E.placement (v a)) e) (Equiv.refl I) + +omit [DecidableEq I] in +lemma packetReindex_eq (E : BasedComplex Q (K := K) I) (v:J → V) (e:L ≃ J) : + (E.packetTwist Q v).reindex Q (packetReindexEquiv Q E v e) = E.packetTwist Q (v ∘ e) := by + apply ext_placement_differential Q + · funext z + rcases z with ⟨a,u⟩|i <;> rfl + · apply Matrix.ext + intro z w + rcases z with ⟨a,u⟩|i <;> rcases w with ⟨b,t⟩|j + · change -(Matrix.blockDiagonal' (fun a => scalarCornerMatrix Q (v a) + (testMatrix Q E.placement E.placement (v a) E.differential)) ⟨e a,u⟩ ⟨e b,t⟩) = _ + by_cases hab : a=b + · subst b + simp only [packetTwist,Map.cone,Map.coneDifferential,packetEvaluation,packetTest, + packetDifferential,Matrix.fromBlocks,Matrix.of_apply,Matrix.neg_apply, + Matrix.blockDiagonal'_apply_eq,Function.comp_apply,Sum.elim_inl] + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ (fun he => hab (e.injective he))] + change -(0 : Zigzag Q K) = -(Matrix.blockDiagonal' (fun a : L => + scalarCornerMatrix Q (v (e a)) (testMatrix Q E.placement E.placement (v (e a)) E.differential)) ⟨a,u⟩ ⟨b,t⟩) + rw [Matrix.blockDiagonal'_apply_ne _ _ _ hab] + all_goals rfl + +def packetEmptyEquiv (E : BasedComplex Q (K := K) I) (v:J → V) [IsEmpty J] : + I ≃ (PacketIndex Q E.placement v ⊕ I) where + toFun := Sum.inr + invFun z := z.elim (fun a => isEmptyElim a.1) id + left_inv _ := rfl + right_inv z := by + rcases z with z|i + · exact isEmptyElim z.1 + · rfl + +omit [DecidableEq I] in +lemma packetEmpty_eq (E : BasedComplex Q (K := K) I) (v:J → V) [IsEmpty J] : + (E.packetTwist Q v).reindex Q (packetEmptyEquiv Q E v) = E := by + apply ext_placement_differential Q <;> rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketLayerLowerTruncation.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketLayerLowerTruncation.lean index 6a488b3f1023070974194d1885bfc017f76ab8ef..1b4402f977907d3adf0bba1962594c5095f27929 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketLayerLowerTruncation.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketLayerLowerTruncation.lean @@ -1,92 +1,92 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ComplexPacketLowerBound -import OAI.Topology.ArtinGroups.Complexes.LayerSocleDimensionLayer -import OAI.Topology.ArtinGroups.Complexes.Cone2 -import OAI.Topology.ArtinGroups.Complexes.HighConeRetainedPure - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I P:Type u} [Fintype I] [Fintype P] [DecidableEq I] [DecidableEq P] - (hn:∀ a,Q.source a≠Q.target a) (v:P→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) -local notation "T" => classPacketPerm Q hn v hv - -omit [DecidableEq P] in -lemma packetLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (q:ℤ) : - classLayer Q q (T (classOfComplex Q (lowerTruncation Q E hE q)))= - classLayer Q q (T (classOfComplex Q E)) := by - let f:=lowInclusion Q E _ (levelDownClosed Q E hE q) - let R:=upperTruncation Q E hE q - have hc:=ClassCone.ofMap Q f - have he:classOfComplex Q (f.cone Q)=classOfComplex Q R:= - classOfComplex_eq Q (lowConeReduction Q E _ (levelDownClosed Q E hE q)) - rw [he] at hc - have hr:ClassLowerBound Q (q+1) (classOfComplex Q R):=by - apply classLowerBound_of_representative Q - intro i - have hi:=i.property - change ¬(E.placement i).level≤q at hi - change q+1≤(E.placement i).level - omega - have hb:=classPacketPerm_lower_bound Q hn v hv (classOfComplex Q R) hr - exact (hc.packet Q hn v hv).layer_eq Q q (fun i=>by have hi:=hb i; constructor <;> omega) - -lemma packetLayer_top (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) - (ht:∀ a c,coefficientTopDual Q (E.pureLayer Q hE (q-1)) (v a) c=⊥) : - classLayer Q q (T (classOfComplex Q E))= - classLayer Q q (T (classLayer Q q (classOfComplex Q E))) := by - let f:=highProjection Q E _ (levelDownClosed Q E hE (q-1)) - let D:=(highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q - have hD:D.IsMinimal Q:=highConeRetained_minimal Q E hE _ _ - have hd:ClassUpperBound Q (q-2) (classOfComplex Q D) := by - apply classUpperBound_of_representative Q - intro i - rw [highConeRetained_level] - have hi:=i.property - change (E.placement i).level≤q-1 at hi - omega - have htop:∀ a c,classLayerTopDimension Q (q-2) (v a) c (classOfComplex Q D)=0 := by - intro a c - rw [classLayerTopDimension_minimal Q D hD] - rw [highConeRetained_top_zero Q E hE q (v a) (ht a),finrank_bot] - have hb:=classPacketPerm_cap_of_top_zero Q hn v hv (classOfComplex Q D) hd htop - have hc:=ClassCone.ofMap Q f - have he:classOfComplex Q (f.cone Q)=classOfComplex Q D:= - classOfComplex_eq Q (highConeReduction Q E _ (levelDownClosed Q E hE (q-1))) - rw [he] at hc - have hh:classLayer Q q (T (classOfComplex Q E))= - classLayer Q q (T (classOfComplex Q (upperTruncation Q E hE (q-1)))):= - (hc.packet Q hn v hv).layer_eq Q q (fun i=>by have hi:=hb i; constructor <;> omega) - rwa [highRestriction_top_eq_layer Q E hE q hhi] at hh - -theorem classPacketPerm_unshifted_layer (x:FiniteHomotopyClass Q (K:=K)) - (q:ℤ) (ht:∀ a c,classLayerTopDimension Q (q-1) (v a) c x=0) : - classLayer Q q (T x)=classLayer Q q (T (classLayer Q q x)) := by - let E:=(minimalClassModel Q x).complex - have hE:E.IsMinimal Q:=minimalClassModel_minimal Q x - have hx:classOfComplex Q E=x:=minimalClassModel_class Q x - let L:=lowerTruncation Q E hE q - have hL:L.IsMinimal Q:=lowerTruncation_minimal Q E hE q - have hl:classLayer Q (q-1) (classOfComplex Q L)=classLayer Q (q-1) x := by - exact (classLayer_lowerTruncation_le Q E hE (q-1) q (by omega)).trans - (congrArg (classLayer Q (q-1)) hx) - have htL:∀ a c,coefficientTopDual Q (L.pureLayer Q hL (q-1)) (v a) c=⊥ := by - intro a c - apply Submodule.finrank_eq_zero.mp - rw [← classLayerTopDimension_minimal Q L hL] - rw [classLayerTopDimension_congr_layer Q (q-1) hl (v a) c,ht a c] - have hh:=packetLayer_top Q hn v hv L hL q (fun i=>i.property) htL - have hp:=packetLayer_lowerTruncation Q hn v hv E hE q - rw [classLayer_lowerTruncation_le Q E hE q q le_rfl,hx] at hh - rw [hx] at hp - exact hp.symm.trans hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ComplexPacketLowerBound +import OAI.Topology.ArtinGroups.Complexes.LayerSocleDimensionLayer +import OAI.Topology.ArtinGroups.Complexes.Cone2 +import OAI.Topology.ArtinGroups.Complexes.HighConeRetainedPure + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I P:Type u} [Fintype I] [Fintype P] [DecidableEq I] [DecidableEq P] + (hn:∀ a,Q.source a≠Q.target a) (v:P→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) +local notation "T" => classPacketPerm Q hn v hv + +omit [DecidableEq P] in +lemma packetLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) (q:ℤ) : + classLayer Q q (T (classOfComplex Q (lowerTruncation Q E hE q)))= + classLayer Q q (T (classOfComplex Q E)) := by + let f:=lowInclusion Q E _ (levelDownClosed Q E hE q) + let R:=upperTruncation Q E hE q + have hc:=ClassCone.ofMap Q f + have he:classOfComplex Q (f.cone Q)=classOfComplex Q R:= + classOfComplex_eq Q (lowConeReduction Q E _ (levelDownClosed Q E hE q)) + rw [he] at hc + have hr:ClassLowerBound Q (q+1) (classOfComplex Q R):=by + apply classLowerBound_of_representative Q + intro i + have hi:=i.property + change ¬(E.placement i).level≤q at hi + change q+1≤(E.placement i).level + omega + have hb:=classPacketPerm_lower_bound Q hn v hv (classOfComplex Q R) hr + exact (hc.packet Q hn v hv).layer_eq Q q (fun i=>by have hi:=hb i; constructor <;> omega) + +lemma packetLayer_top (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (hhi:∀ i,(E.placement i).level≤q) + (ht:∀ a c,coefficientTopDual Q (E.pureLayer Q hE (q-1)) (v a) c=⊥) : + classLayer Q q (T (classOfComplex Q E))= + classLayer Q q (T (classLayer Q q (classOfComplex Q E))) := by + let f:=highProjection Q E _ (levelDownClosed Q E hE (q-1)) + let D:=(highConePivot Q E _ (levelDownClosed Q E hE (q-1))).reduced Q + have hD:D.IsMinimal Q:=highConeRetained_minimal Q E hE _ _ + have hd:ClassUpperBound Q (q-2) (classOfComplex Q D) := by + apply classUpperBound_of_representative Q + intro i + rw [highConeRetained_level] + have hi:=i.property + change (E.placement i).level≤q-1 at hi + omega + have htop:∀ a c,classLayerTopDimension Q (q-2) (v a) c (classOfComplex Q D)=0 := by + intro a c + rw [classLayerTopDimension_minimal Q D hD] + rw [highConeRetained_top_zero Q E hE q (v a) (ht a),finrank_bot] + have hb:=classPacketPerm_cap_of_top_zero Q hn v hv (classOfComplex Q D) hd htop + have hc:=ClassCone.ofMap Q f + have he:classOfComplex Q (f.cone Q)=classOfComplex Q D:= + classOfComplex_eq Q (highConeReduction Q E _ (levelDownClosed Q E hE (q-1))) + rw [he] at hc + have hh:classLayer Q q (T (classOfComplex Q E))= + classLayer Q q (T (classOfComplex Q (upperTruncation Q E hE (q-1)))):= + (hc.packet Q hn v hv).layer_eq Q q (fun i=>by have hi:=hb i; constructor <;> omega) + rwa [highRestriction_top_eq_layer Q E hE q hhi] at hh + +theorem classPacketPerm_unshifted_layer (x:FiniteHomotopyClass Q (K:=K)) + (q:ℤ) (ht:∀ a c,classLayerTopDimension Q (q-1) (v a) c x=0) : + classLayer Q q (T x)=classLayer Q q (T (classLayer Q q x)) := by + let E:=(minimalClassModel Q x).complex + have hE:E.IsMinimal Q:=minimalClassModel_minimal Q x + have hx:classOfComplex Q E=x:=minimalClassModel_class Q x + let L:=lowerTruncation Q E hE q + have hL:L.IsMinimal Q:=lowerTruncation_minimal Q E hE q + have hl:classLayer Q (q-1) (classOfComplex Q L)=classLayer Q (q-1) x := by + exact (classLayer_lowerTruncation_le Q E hE (q-1) q (by omega)).trans + (congrArg (classLayer Q (q-1)) hx) + have htL:∀ a c,coefficientTopDual Q (L.pureLayer Q hL (q-1)) (v a) c=⊥ := by + intro a c + apply Submodule.finrank_eq_zero.mp + rw [← classLayerTopDimension_minimal Q L hL] + rw [classLayerTopDimension_congr_layer Q (q-1) hl (v a) c,ht a c] + have hh:=packetLayer_top Q hn v hv L hL q (fun i=>i.property) htL + have hp:=packetLayer_lowerTruncation Q hn v hv E hE q + rw [classLayer_lowerTruncation_le Q E hE q q le_rfl,hx] at hh + rw [hx] at hp + exact hp.symm.trans hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermAction.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermAction.lean index bfd2a7ad15f3efd55367a1e0e2f455124d39c47f..1ac47238005cb5fed51644df1afb5dbf9d6c609a 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermAction.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermAction.lean @@ -1,42 +1,42 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.UnfoldedPresentation -import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn : ∀ a, Q.source a ≠ Q.target a) - (M:CoxeterMatrix V) (hM:UnfoldedPresentation Q M) -local notation "Act" => unfoldedArtinAction Q (K:=K) hn M hM - -lemma classPacketPerm_in_action {J:Type u} [Fintype J] (v:J → V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : - ∃ x:Artin M,Act x=classPacketPerm Q hn v hv := by - suffices hh : ∀ (J:Type u) [Fintype J] (v:J → V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), - ∃ x:Artin M,Act x=classPacketPerm Q hn v hv from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P:=fun J _=>∀ (v:J → V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), - ∃ x:Artin M,Act x=classPacketPerm Q hn v hv) _ _ _ J - · intro J L instL e ih - let := Fintype.ofEquiv L e.symm - intro v hv - rw [classPacketPerm_reindex Q hn v hv e] - exact ih _ _ - · intro v hv - refine ⟨1,?_⟩ - rw [map_one,classPacketPerm_empty] - rfl - · intro J inst ih v hv - obtain ⟨x,hx⟩:=ih (v ∘ some) (fun a b hab=>hv (fun he=>hab (Option.some.inj he))) - refine ⟨generator M (v none)*x,?_⟩ - rw [map_mul,unfoldedArtinAction_generator,hx,classPacketPerm_cons] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.UnfoldedPresentation +import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn : ∀ a, Q.source a ≠ Q.target a) + (M:CoxeterMatrix V) (hM:UnfoldedPresentation Q M) +local notation "Act" => unfoldedArtinAction Q (K:=K) hn M hM + +lemma classPacketPerm_in_action {J:Type u} [Fintype J] (v:J → V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : + ∃ x:Artin M,Act x=classPacketPerm Q hn v hv := by + suffices hh : ∀ (J:Type u) [Fintype J] (v:J → V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), + ∃ x:Artin M,Act x=classPacketPerm Q hn v hv from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P:=fun J _=>∀ (v:J → V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), + ∃ x:Artin M,Act x=classPacketPerm Q hn v hv) _ _ _ J + · intro J L instL e ih + let := Fintype.ofEquiv L e.symm + intro v hv + rw [classPacketPerm_reindex Q hn v hv e] + exact ih _ _ + · intro v hv + refine ⟨1,?_⟩ + rw [map_one,classPacketPerm_empty] + rfl + · intro J inst ih v hv + obtain ⟨x,hx⟩:=ih (v ∘ some) (fun a b hab=>hv (fun he=>hab (Option.some.inj he))) + refine ⟨generator M (v none)*x,?_⟩ + rw [map_mul,unfoldedArtinAction_generator,hx,classPacketPerm_cons] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermEnumeration.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermEnumeration.lean index faf80e72cd6399f2329a716153e0e584aa27ec7b..179a933e9ade32eedfddb2dda446e9eef87856b5 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermEnumeration.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermEnumeration.lean @@ -1,75 +1,75 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex -import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn : ∀ a,Q.source a≠Q.target a) - -lemma classPacketPerm_enumeration {J : Type u} [Fintype J] (v : J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - ∃ l : List J, l.Nodup ∧ (∀ j,j∈l) ∧ - (l.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod=classPacketPerm Q hn v hv := by - suffices hh : ∀ (J : Type u) [Fintype J] (v : J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - ∃ l : List J, l.Nodup ∧ (∀ j,j∈l) ∧ - (l.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod=classPacketPerm Q hn v hv from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P:=fun J _ => ∀ (v : J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - ∃ l : List J, l.Nodup ∧ (∀ j,j∈l) ∧ - (l.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod=classPacketPerm Q hn v hv) _ _ _ J - · intro J L instL e ih - let := Fintype.ofEquiv L e.symm - intro v hv - obtain ⟨l,hl,ha,he⟩ := ih (v∘e) (fun a b hab => hv (fun h => hab (e.injective h))) - refine ⟨l.map e,hl.map e.injective,?_,?_⟩ - · intro j - exact List.mem_map.mpr ⟨e.symm j,ha _,e.apply_symm_apply j⟩ - · rw [classPacketPerm_reindex Q hn v hv e] - simpa only [List.map_map,Function.comp_def] using he - · intro v hv - refine ⟨[],List.nodup_nil,fun j => isEmptyElim j,?_⟩ - rw [List.map_nil,List.prod_nil,classPacketPerm_empty] - rfl - · intro J inst ih v hv - obtain ⟨l,hl,ha,he⟩ := ih (v∘some) (fun a b hab => hv (fun h => hab (Option.some.inj h))) - refine ⟨none::l.map some,?_,?_,?_⟩ - · simp only [List.nodup_cons,List.mem_map,Option.some_ne_none,and_false,exists_false,not_false_eq_true, - true_and] - exact hl.map (Option.some_injective _) - · intro j - cases j with - | none => exact List.mem_cons_self - | some j => exact List.mem_cons_of_mem _ (List.mem_map.mpr ⟨j,ha j,rfl⟩) - · rw [List.map_cons,List.prod_cons,List.map_map,classPacketPerm_cons,← he] - rfl - -lemma classPacketPerm_toList {J : Type u} [Fintype J] (v : J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - ((Finset.univ : Finset J).toList.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod= - classPacketPerm Q hn v hv := by - obtain ⟨l,hl,ha,he⟩ := classPacketPerm_enumeration Q (K:=K) hn v hv - have hp : (Finset.univ : Finset J).toList.Perm l := - (List.perm_ext_iff_of_nodup (Finset.nodup_toList _) hl).mpr (fun j => by simp [ha]) - rw [← he] - apply (hp.map _).prod_eq' - rw [List.pairwise_map] - apply (Finset.nodup_toList (Finset.univ : Finset J)).imp - intro a b hab - exact classTwistPerm_orthogonal Q hn (hv hab) - -lemma positiveWordAction_eq_prod (w : List V) (x : FiniteHomotopyClass Q (K:=K)) : - positiveWordAction Q w x=(w.map (classTwistPerm Q hn)).prod x := by - induction w with - | nil => rfl - | cons a w ih => exact congrArg (classPositiveTwist Q a) ih - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex +import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn : ∀ a,Q.source a≠Q.target a) + +lemma classPacketPerm_enumeration {J : Type u} [Fintype J] (v : J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + ∃ l : List J, l.Nodup ∧ (∀ j,j∈l) ∧ + (l.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod=classPacketPerm Q hn v hv := by + suffices hh : ∀ (J : Type u) [Fintype J] (v : J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + ∃ l : List J, l.Nodup ∧ (∀ j,j∈l) ∧ + (l.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod=classPacketPerm Q hn v hv from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P:=fun J _ => ∀ (v : J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + ∃ l : List J, l.Nodup ∧ (∀ j,j∈l) ∧ + (l.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod=classPacketPerm Q hn v hv) _ _ _ J + · intro J L instL e ih + let := Fintype.ofEquiv L e.symm + intro v hv + obtain ⟨l,hl,ha,he⟩ := ih (v∘e) (fun a b hab => hv (fun h => hab (e.injective h))) + refine ⟨l.map e,hl.map e.injective,?_,?_⟩ + · intro j + exact List.mem_map.mpr ⟨e.symm j,ha _,e.apply_symm_apply j⟩ + · rw [classPacketPerm_reindex Q hn v hv e] + simpa only [List.map_map,Function.comp_def] using he + · intro v hv + refine ⟨[],List.nodup_nil,fun j => isEmptyElim j,?_⟩ + rw [List.map_nil,List.prod_nil,classPacketPerm_empty] + rfl + · intro J inst ih v hv + obtain ⟨l,hl,ha,he⟩ := ih (v∘some) (fun a b hab => hv (fun h => hab (Option.some.inj h))) + refine ⟨none::l.map some,?_,?_,?_⟩ + · simp only [List.nodup_cons,List.mem_map,Option.some_ne_none,and_false,exists_false,not_false_eq_true, + true_and] + exact hl.map (Option.some_injective _) + · intro j + cases j with + | none => exact List.mem_cons_self + | some j => exact List.mem_cons_of_mem _ (List.mem_map.mpr ⟨j,ha j,rfl⟩) + · rw [List.map_cons,List.prod_cons,List.map_map,classPacketPerm_cons,← he] + rfl + +lemma classPacketPerm_toList {J : Type u} [Fintype J] (v : J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + ((Finset.univ : Finset J).toList.map fun j => classTwistPerm Q (K:=K) hn (v j)).prod= + classPacketPerm Q hn v hv := by + obtain ⟨l,hl,ha,he⟩ := classPacketPerm_enumeration Q (K:=K) hn v hv + have hp : (Finset.univ : Finset J).toList.Perm l := + (List.perm_ext_iff_of_nodup (Finset.nodup_toList _) hl).mpr (fun j => by simp [ha]) + rw [← he] + apply (hp.map _).prod_eq' + rw [List.pairwise_map] + apply (Finset.nodup_toList (Finset.univ : Finset J)).imp + intro a b hab + exact classTwistPerm_orthogonal Q hn (hv hab) + +lemma positiveWordAction_eq_prod (w : List V) (x : FiniteHomotopyClass Q (K:=K)) : + positiveWordAction Q w x=(w.map (classTwistPerm Q hn)).prod x := by + induction w with + | nil => rfl + | cons a w ih => exact congrArg (classPositiveTwist Q a) ih + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermExterior.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermExterior.lean index ba36a2b00afa9e77c12aa42fb0b0203c3e66dfd7..8479540267538b938abdba659247e0a9bef15aa1 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermExterior.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermExterior.lean @@ -1,68 +1,68 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.GeneratorArray2 -import OAI.Topology.ArtinGroups.Complexes.Initial -import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn:∀ a,Q.source a≠Q.target a) - -lemma classPacketPerm_exterior {J:Type u} [Fintype J] (v:J → V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (x:FiniteHomotopyClass Q (K:=K)) (a:GeneratorPlacement V) - (ha:∀ j,v j≠a.color) : - classGeneratorArray Q (classPacketPerm Q hn v hv x) a=classGeneratorArray Q x a := by - suffices hh:∀ (J:Type u) [Fintype J] (v:J → V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), - (∀ j,v j≠a.color) → - classGeneratorArray Q (classPacketPerm Q hn v hv x) a=classGeneratorArray Q x a from - hh J v hv ha - intro J inst - apply Fintype.induction_empty_option (P:=fun J _=>∀ (v:J → V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), - (∀ j,v j≠a.color) → - classGeneratorArray Q (classPacketPerm Q hn v hv x) a=classGeneratorArray Q x a) _ _ _ J - · intro J L instL e ih - let :=Fintype.ofEquiv L e.symm - intro v hv ha - rw [classPacketPerm_reindex Q hn v hv e] - exact ih _ _ (fun j=>ha (e j)) - · intro v hv ha - rw [classPacketPerm_empty Q hn v hv] - rfl - · intro J instJ ih v hv ha - rw [classPacketPerm_cons Q hn v hv] - change classGeneratorArray Q - (classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ x)) a=_ - rw [classPositiveTwist_exterior Q _ _ _ (ha none)] - exact ih _ _ (fun j=>ha (some j)) - -lemma classPacketPerm_inverse_exterior {J:Type u} [Fintype J] (v:J → V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (x:FiniteHomotopyClass Q (K:=K)) (a:GeneratorPlacement V) - (ha:∀ j,v j≠a.color) : - classGeneratorArray Q ((classPacketPerm Q hn v hv).symm x) a=classGeneratorArray Q x a := by - have h:=classPacketPerm_exterior Q hn v hv ((classPacketPerm Q hn v hv).symm x) a ha - rw [Equiv.apply_symm_apply] at h - exact h.symm - -omit [Fintype V] [DecidableEq A] in -lemma classLevelArray_initial (α β:V) (q:ℤ) : - classLevelArray Q (initialClass Q (K:=K) α) (β,q)=if α=β ∧ q=0 then 1 else 0 := by - classical - rw [initialClass,classLevelArray_of_minimal Q _ (show (initialProjective Q α).IsMinimal Q from - fun i j=>rfl)] - change (initialProjective Q α).levelArray Q (β,q)=_ - rw [levelArray_eq_sum] - simp only [initialProjective,GeneratorPlacement.level,Finset.univ_unique, - Finset.sum_singleton,Finsupp.single_apply,Prod.mk.injEq] - simp [eq_comm] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.GeneratorArray2 +import OAI.Topology.ArtinGroups.Complexes.Initial +import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn:∀ a,Q.source a≠Q.target a) + +lemma classPacketPerm_exterior {J:Type u} [Fintype J] (v:J → V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (x:FiniteHomotopyClass Q (K:=K)) (a:GeneratorPlacement V) + (ha:∀ j,v j≠a.color) : + classGeneratorArray Q (classPacketPerm Q hn v hv x) a=classGeneratorArray Q x a := by + suffices hh:∀ (J:Type u) [Fintype J] (v:J → V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), + (∀ j,v j≠a.color) → + classGeneratorArray Q (classPacketPerm Q hn v hv x) a=classGeneratorArray Q x a from + hh J v hv ha + intro J inst + apply Fintype.induction_empty_option (P:=fun J _=>∀ (v:J → V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), + (∀ j,v j≠a.color) → + classGeneratorArray Q (classPacketPerm Q hn v hv x) a=classGeneratorArray Q x a) _ _ _ J + · intro J L instL e ih + let :=Fintype.ofEquiv L e.symm + intro v hv ha + rw [classPacketPerm_reindex Q hn v hv e] + exact ih _ _ (fun j=>ha (e j)) + · intro v hv ha + rw [classPacketPerm_empty Q hn v hv] + rfl + · intro J instJ ih v hv ha + rw [classPacketPerm_cons Q hn v hv] + change classGeneratorArray Q + (classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ x)) a=_ + rw [classPositiveTwist_exterior Q _ _ _ (ha none)] + exact ih _ _ (fun j=>ha (some j)) + +lemma classPacketPerm_inverse_exterior {J:Type u} [Fintype J] (v:J → V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (x:FiniteHomotopyClass Q (K:=K)) (a:GeneratorPlacement V) + (ha:∀ j,v j≠a.color) : + classGeneratorArray Q ((classPacketPerm Q hn v hv).symm x) a=classGeneratorArray Q x a := by + have h:=classPacketPerm_exterior Q hn v hv ((classPacketPerm Q hn v hv).symm x) a ha + rw [Equiv.apply_symm_apply] at h + exact h.symm + +omit [Fintype V] [DecidableEq A] in +lemma classLevelArray_initial (α β:V) (q:ℤ) : + classLevelArray Q (initialClass Q (K:=K) α) (β,q)=if α=β ∧ q=0 then 1 else 0 := by + classical + rw [initialClass,classLevelArray_of_minimal Q _ (show (initialProjective Q α).IsMinimal Q from + fun i j=>rfl)] + change (initialProjective Q α).levelArray Q (β,q)=_ + rw [levelArray_eq_sum] + simp only [initialProjective,GeneratorPlacement.level,Finset.univ_unique, + Finset.sum_singleton,Finsupp.single_apply,Prod.mk.injEq] + simp [eq_comm] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermPreservesOpen.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermPreservesOpen.lean index e55909077f07854f9b2af98fd6d9b41b8ff23af8..8b5847a28cda134db4f09acee428aca9f2e229a4 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermPreservesOpen.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermPreservesOpen.lean @@ -1,27 +1,27 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.BottomSocleZero -import OAI.Topology.ArtinGroups.Complexes.ComplexPacketPreserves - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -theorem classPacketPerm_preserves_open_socle - (hn:∀ a,Q.source a≠Q.target a) {P:Type u} [Fintype P] - (v:P→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (J:Set V) (hJ:∀ a,v a∈J) (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} - (hx:ClassLowerBound Q d x) (hs:ClassBottomSocleZero Q d J x) : - ClassBottomSocleZero Q d J (classPacketPerm Q hn v hv x) := by - have hh:=classPacketPerm_preserves Q hn v hv - (fun y=>ClassLowerBound Q d y ∧ ClassBottomSocleZero Q d J y) - (fun a y hy=>⟨classPositiveTwist_lower_bound Q (v a) y hy.1, - classPositiveTwist_preserves_open_socle Q hn (v a) J (hJ a) y hy.1 hy.2⟩) - x ⟨hx,hs⟩ - exact hh.2 - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.BottomSocleZero +import OAI.Topology.ArtinGroups.Complexes.ComplexPacketPreserves + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +theorem classPacketPerm_preserves_open_socle + (hn:∀ a,Q.source a≠Q.target a) {P:Type u} [Fintype P] + (v:P→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (J:Set V) (hJ:∀ a,v a∈J) (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} + (hx:ClassLowerBound Q d x) (hs:ClassBottomSocleZero Q d J x) : + ClassBottomSocleZero Q d J (classPacketPerm Q hn v hv x) := by + have hh:=classPacketPerm_preserves Q hn v hv + (fun y=>ClassLowerBound Q d y ∧ ClassBottomSocleZero Q d J y) + (fun a y hy=>⟨classPositiveTwist_lower_bound Q (v a) y hy.1, + classPositiveTwist_preserves_open_socle Q hn (v a) J (hJ a) y hy.1 hy.2⟩) + x ⟨hx,hs⟩ + exact hh.2 + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermReindex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermReindex.lean index 8ed539ebb0245c2bd1737959c548f29a18974b4f..5fe2d297270a24023cf80651c587fd8044344071 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermReindex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketPermReindex.lean @@ -1,94 +1,94 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Sum - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn : ∀ a, Q.source a ≠ Q.target a) - {J L : Type u} [Fintype J] [Fintype L] - -lemma classPacketPerm_reindex (v:J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) (e:L ≃ J) : - classPacketPerm Q (K := K) hn v hv = classPacketPerm Q hn (v ∘ e) - (fun _ _ hab => hv (fun he => hab (e.injective he))) := by - classical - apply Equiv.ext - intro x - induction x using Quotient.inductionOn with | _ E => - erw [classPacketPerm_apply,classPacketPerm_apply] - exact classOfComplex_packet_reindex Q E.complex v e - -lemma classPacketPerm_empty [IsEmpty J] (v:J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - classPacketPerm Q (K := K) hn v hv = Equiv.refl _ := by - classical - apply Equiv.ext - intro x - induction x using Quotient.inductionOn with | _ E => - rw [classPacketPerm_apply] - exact (classOfComplex_reindex Q _ (packetEmptyEquiv Q E.complex v)).trans - (congrArg (classOfComplex Q) (packetEmpty_eq Q E.complex v)) - -lemma classPacketPerm_cons (v:Option J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : - classPacketPerm Q (K := K) hn v hv = - classTwistPerm Q hn (v none) * classPacketPerm Q hn (v ∘ some) - (fun _ _ hab => hv (fun he => hab (Option.some.inj he))) := by - classical - apply Equiv.ext - intro x - induction x using Quotient.inductionOn with | _ E => - change _ = classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ ⟦E⟧) - erw [classPacketPerm_apply,classPacketPerm_apply] - have he : v = fun z : Option J => z.elim (v none) (v ∘ some) := by - funext z; cases z <;> rfl - conv_lhs => rw [he] - convert classOfComplex_packet_cons Q E.complex (v none) (v ∘ some) - (fun a => hv (by simp)) using 1 - -variable {I : Type u} [Fintype I] [DecidableEq I] -lemma classPacketPerm_sum (v:J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) - (x : I → FiniteHomotopyClass Q (K := K)) : - classPacketPerm Q hn v hv (classSum Q x) = - classSum Q (fun i => classPacketPerm Q hn v hv (x i)) := by - classical - suffices hh : ∀ (J : Type u) [Fintype J] (v:J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - classPacketPerm Q hn v hv (classSum Q x) = - classSum Q (fun i => classPacketPerm Q hn v hv (x i)) from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P := fun J _ => ∀ (v:J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), - classPacketPerm Q hn v hv (classSum Q x) = - classSum Q (fun i => classPacketPerm Q hn v hv (x i))) _ _ _ J - · intro J L instL e ih - let := Fintype.ofEquiv L e.symm - intro v hv - rw [classPacketPerm_reindex Q hn v hv e] - exact ih _ _ - · intro v hv - rw [classPacketPerm_empty Q hn v hv] - rfl - · intro J instJ ih v hv - rw [classPacketPerm_cons Q hn v hv] - change classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ (classSum Q x)) = - classSum Q (fun i => classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ (x i))) - erw [ih,classPositiveTwist_sum] - -lemma classPacketPerm_inverse_sum (v:J → V) - (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) - (x : I → FiniteHomotopyClass Q (K := K)) : - (classPacketPerm Q hn v hv).symm (classSum Q x) = - classSum Q (fun i => (classPacketPerm Q hn v hv).symm (x i)) := by - apply (classPacketPerm Q hn v hv).injective - rw [Equiv.apply_symm_apply,classPacketPerm_sum] - simp only [Equiv.apply_symm_apply] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Sum + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn : ∀ a, Q.source a ≠ Q.target a) + {J L : Type u} [Fintype J] [Fintype L] + +lemma classPacketPerm_reindex (v:J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) (e:L ≃ J) : + classPacketPerm Q (K := K) hn v hv = classPacketPerm Q hn (v ∘ e) + (fun _ _ hab => hv (fun he => hab (e.injective he))) := by + classical + apply Equiv.ext + intro x + induction x using Quotient.inductionOn with | _ E => + erw [classPacketPerm_apply,classPacketPerm_apply] + exact classOfComplex_packet_reindex Q E.complex v e + +lemma classPacketPerm_empty [IsEmpty J] (v:J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + classPacketPerm Q (K := K) hn v hv = Equiv.refl _ := by + classical + apply Equiv.ext + intro x + induction x using Quotient.inductionOn with | _ E => + rw [classPacketPerm_apply] + exact (classOfComplex_reindex Q _ (packetEmptyEquiv Q E.complex v)).trans + (congrArg (classOfComplex Q) (packetEmpty_eq Q E.complex v)) + +lemma classPacketPerm_cons (v:Option J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) : + classPacketPerm Q (K := K) hn v hv = + classTwistPerm Q hn (v none) * classPacketPerm Q hn (v ∘ some) + (fun _ _ hab => hv (fun he => hab (Option.some.inj he))) := by + classical + apply Equiv.ext + intro x + induction x using Quotient.inductionOn with | _ E => + change _ = classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ ⟦E⟧) + erw [classPacketPerm_apply,classPacketPerm_apply] + have he : v = fun z : Option J => z.elim (v none) (v ∘ some) := by + funext z; cases z <;> rfl + conv_lhs => rw [he] + convert classOfComplex_packet_cons Q E.complex (v none) (v ∘ some) + (fun a => hv (by simp)) using 1 + +variable {I : Type u} [Fintype I] [DecidableEq I] +lemma classPacketPerm_sum (v:J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) + (x : I → FiniteHomotopyClass Q (K := K)) : + classPacketPerm Q hn v hv (classSum Q x) = + classSum Q (fun i => classPacketPerm Q hn v hv (x i)) := by + classical + suffices hh : ∀ (J : Type u) [Fintype J] (v:J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + classPacketPerm Q hn v hv (classSum Q x) = + classSum Q (fun i => classPacketPerm Q hn v hv (x i)) from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P := fun J _ => ∀ (v:J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)), + classPacketPerm Q hn v hv (classSum Q x) = + classSum Q (fun i => classPacketPerm Q hn v hv (x i))) _ _ _ J + · intro J L instL e ih + let := Fintype.ofEquiv L e.symm + intro v hv + rw [classPacketPerm_reindex Q hn v hv e] + exact ih _ _ + · intro v hv + rw [classPacketPerm_empty Q hn v hv] + rfl + · intro J instJ ih v hv + rw [classPacketPerm_cons Q hn v hv] + change classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ (classSum Q x)) = + classSum Q (fun i => classPositiveTwist Q (v none) (classPacketPerm Q hn (v ∘ some) _ (x i))) + erw [ih,classPositiveTwist_sum] + +lemma classPacketPerm_inverse_sum (v:J → V) + (hv : Pairwise fun a b => OrthogonalVertices Q (v a) (v b)) + (x : I → FiniteHomotopyClass Q (K := K)) : + (classPacketPerm Q hn v hv).symm (classSum Q x) = + classSum Q (fun i => (classPacketPerm Q hn v hv).symm (x i)) := by + apply (classPacketPerm Q hn v hv).injective + rw [Equiv.apply_symm_apply,classPacketPerm_sum] + simp only [Equiv.apply_symm_apply] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator.lean index d46120404930a6dd21f379bd9a808f4307619740..85838b3cebb24cc7a3ed967301ebcb90f28d60ae 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator.lean @@ -1,134 +1,134 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.LengthCases -import OAI.Topology.ArtinGroups.Quivers.PacketIndex -import OAI.Topology.ArtinGroups.Quivers.TokenTestVector -import OAI.Topology.ArtinGroups.Complexes.MinimalGeneratorDualCycle -import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDualRestrict -import OAI.Topology.ArtinGroups.Complexes.MinimalEmbedding - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J P : Type u} [Fintype I] [Fintype J] [Fintype P] - [DecidableEq I] [DecidableEq J] [DecidableEq P] - -theorem packetTwist_raised_generator_top_at_cap - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - {l : ℤ} (hE : ∀ i, (E.placement i).level≤l) (v:P → V) - (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.packetTwist Q v) F) - (j:J) (hj : (F.placement j).level=l+1) : - ∃ a:P, ∃ x:I → K, - x ∈ coefficientTopDual Q E (v a) ((F.placement j).cochain+1) ∧ x≠0 ∧ - ∀ i, (E.placement i).level≠l → x i=0 := by - obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_dual_cycle Q (E.packetTwist Q v) F hF e j - have hxold i : x (Sum.inr i)=0 := by - apply hxs - intro he - have hl := congrArg GeneratorPlacement.level he - change (E.placement i).level = (F.placement j).level at hl - have hb := hE i - rw [hj] at hl - omega - have hex : ∃ z, x z≠0 := not_forall.mp (fun h => hx (funext h)) - obtain ⟨⟨a,u⟩|i,hz⟩ := hex - swap - · exact (hz (hxold i)).elim - have hp : (E.packetTwist Q v).placement (Sum.inl ⟨a,u⟩)=F.placement j := - Classical.not_not.mp (fun h => hz (hxs _ h)) - have hα : (F.placement j).color=v a := (congrArg GeneratorPlacement.color hp).symm - let y : TestIndex Q E.placement (v a) → K := fun i => x (Sum.inl ⟨a,i⟩) - have hplace (i : TestIndex Q E.placement (v a)) - (he : (E.packetTwist Q v).placement (Sum.inl ⟨a,i⟩)=F.placement j) : - (E.placement i.1).cochain=(F.placement j).cochain+1 ∧ - Path.length i.2.val=2 ∧ (E.placement i.1).level=l := by - have hc := congrArg GeneratorPlacement.cochain he - have hu := congrArg GeneratorPlacement.internal he - change (E.placement i.1).cochain-1=(F.placement j).cochain at hc - change (E.placement i.1).internal+Path.length i.2.val=(F.placement j).internal at hu - have hl := hE i.1 - have hr : Path.length i.2.val≤2 := by - rcases Path.length_cases i.2.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hl hj ⊢ - exact ⟨by omega,by omega,by omega⟩ - have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain+1 ∧ - Path.length i.2.val=2) → y i=0 := by - intro hi - apply hxs - intro he - exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ - have hyd : Matrix.vecMul y - (testMatrix Q E.placement E.placement (v a) E.differential).transpose=0 := by - funext i - have hh := hxd (Sum.inl ⟨a,i⟩) - rw [hα,Fintype.sum_sum_type,Fintype.sum_sigma] at hh - have ht k : ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨a,k⟩)).vertex (v a) = - -testMatrix Q E.placement E.placement (v a) E.differential i k := by - change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨a,k⟩).vertex (v a) = _ - rw [packetDifferential,Matrix.blockDiagonal'_apply_eq] - change -(testMatrix Q E.placement E.placement (v a) E.differential i k * - (vertexId Q (K := K) (v a)).vertex (v a)) = _ - simp [vertexId_eval] - have htne b (hb:b≠a) (k:TestIndex Q E.placement (v b)) : - ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨b,k⟩)).vertex (v a)=0 := by - change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨b,k⟩).vertex (v a) = _ - rw [packetDifferential,Matrix.blockDiagonal'_apply_ne _ _ _ (Ne.symm hb),neg_zero] - rfl - rw [Finset.sum_eq_single a] at hh - · simp only [ht,hxold,MulZeroClass.mul_zero,Finset.sum_const_zero,add_zero, - neg_mul,Finset.sum_neg_distrib,neg_eq_zero] at hh - simpa only [Matrix.vecMul,Matrix.transpose_apply,dotProduct,mul_comm,Pi.zero_apply] using hh - · intro b hb hba - simp only [htne b hba,MulZeroClass.zero_mul,Finset.sum_const_zero] - · simp - have hy : y ∈ topTestCycles Q E (v a) ((F.placement j).cochain+1) := ⟨hys,hyd⟩ - refine ⟨a,sumTokenTest Q E.placement (v a) y, sumTokenTest_top Q E (v a) _ hy, ?_, ?_⟩ - · intro hzero - have hyz : y=0 := by - rw [← tokenTestVector_sum Q E.placement (v a) _ y hys,hzero,map_zero] - exact hz (congrFun hyz u) - · intro i hi - apply Finset.sum_eq_zero - intro z hz - apply hxs - intro he - exact hi (hplace ⟨i,z⟩ he).2.2 - -theorem packetTwist_cap_of_top_zero - (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} - (hE : ∀ i, (E.placement i).level≤l) (v:P → V) - (htop : ∀ a c, coefficientTopDual Q (E.pureLayer Q hmin l) (v a) c=⊥) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.packetTwist Q v) F.complex) ∧ - ∀ j, (F.complex.placement j).level≤l := by - let B := FiniteModel.ofComplex Q (E.packetTwist Q v) - obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q - refine ⟨F,hF,⟨e⟩,?_⟩ - intro j - by_contra hb - have hj : (F.complex.placement j).level=l+1 := by - have hmax : (F.complex.placement j).level≤l+1 := by - rw [hf j] - change ((E.packetTwist Q v).placement (f j)).level≤l+1 - rcases f j with ⟨a,i,p⟩|i - · change ((E.placement i).cochain-1)+((E.placement i).internal+Path.length p.val)≤l+1 - have hh := hE i - have hr : Path.length p.val≤2 := by - rcases Path.length_cases p.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hh - omega - · have hh := hE i - change (E.placement i).level≤l+1 - omega - omega - obtain ⟨a,x,hx,hxz,hs⟩ := packetTwist_raised_generator_top_at_cap Q E F.complex hE v hF e j hj - have hm := coefficientTopDual_restrict_layer Q E hmin l (v a) _ hx hs - have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs - rw [htop] at hm - exact hn ((Submodule.mem_bot K).mp hm) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.LengthCases +import OAI.Topology.ArtinGroups.Quivers.PacketIndex +import OAI.Topology.ArtinGroups.Quivers.TokenTestVector +import OAI.Topology.ArtinGroups.Complexes.MinimalGeneratorDualCycle +import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDualRestrict +import OAI.Topology.ArtinGroups.Complexes.MinimalEmbedding + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J P : Type u} [Fintype I] [Fintype J] [Fintype P] + [DecidableEq I] [DecidableEq J] [DecidableEq P] + +theorem packetTwist_raised_generator_top_at_cap + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + {l : ℤ} (hE : ∀ i, (E.placement i).level≤l) (v:P → V) + (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.packetTwist Q v) F) + (j:J) (hj : (F.placement j).level=l+1) : + ∃ a:P, ∃ x:I → K, + x ∈ coefficientTopDual Q E (v a) ((F.placement j).cochain+1) ∧ x≠0 ∧ + ∀ i, (E.placement i).level≠l → x i=0 := by + obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_dual_cycle Q (E.packetTwist Q v) F hF e j + have hxold i : x (Sum.inr i)=0 := by + apply hxs + intro he + have hl := congrArg GeneratorPlacement.level he + change (E.placement i).level = (F.placement j).level at hl + have hb := hE i + rw [hj] at hl + omega + have hex : ∃ z, x z≠0 := not_forall.mp (fun h => hx (funext h)) + obtain ⟨⟨a,u⟩|i,hz⟩ := hex + swap + · exact (hz (hxold i)).elim + have hp : (E.packetTwist Q v).placement (Sum.inl ⟨a,u⟩)=F.placement j := + Classical.not_not.mp (fun h => hz (hxs _ h)) + have hα : (F.placement j).color=v a := (congrArg GeneratorPlacement.color hp).symm + let y : TestIndex Q E.placement (v a) → K := fun i => x (Sum.inl ⟨a,i⟩) + have hplace (i : TestIndex Q E.placement (v a)) + (he : (E.packetTwist Q v).placement (Sum.inl ⟨a,i⟩)=F.placement j) : + (E.placement i.1).cochain=(F.placement j).cochain+1 ∧ + Path.length i.2.val=2 ∧ (E.placement i.1).level=l := by + have hc := congrArg GeneratorPlacement.cochain he + have hu := congrArg GeneratorPlacement.internal he + change (E.placement i.1).cochain-1=(F.placement j).cochain at hc + change (E.placement i.1).internal+Path.length i.2.val=(F.placement j).internal at hu + have hl := hE i.1 + have hr : Path.length i.2.val≤2 := by + rcases Path.length_cases i.2.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hl hj ⊢ + exact ⟨by omega,by omega,by omega⟩ + have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain+1 ∧ + Path.length i.2.val=2) → y i=0 := by + intro hi + apply hxs + intro he + exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ + have hyd : Matrix.vecMul y + (testMatrix Q E.placement E.placement (v a) E.differential).transpose=0 := by + funext i + have hh := hxd (Sum.inl ⟨a,i⟩) + rw [hα,Fintype.sum_sum_type,Fintype.sum_sigma] at hh + have ht k : ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨a,k⟩)).vertex (v a) = + -testMatrix Q E.placement E.placement (v a) E.differential i k := by + change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨a,k⟩).vertex (v a) = _ + rw [packetDifferential,Matrix.blockDiagonal'_apply_eq] + change -(testMatrix Q E.placement E.placement (v a) E.differential i k * + (vertexId Q (K := K) (v a)).vertex (v a)) = _ + simp [vertexId_eval] + have htne b (hb:b≠a) (k:TestIndex Q E.placement (v b)) : + ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨b,k⟩)).vertex (v a)=0 := by + change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨b,k⟩).vertex (v a) = _ + rw [packetDifferential,Matrix.blockDiagonal'_apply_ne _ _ _ (Ne.symm hb),neg_zero] + rfl + rw [Finset.sum_eq_single a] at hh + · simp only [ht,hxold,MulZeroClass.mul_zero,Finset.sum_const_zero,add_zero, + neg_mul,Finset.sum_neg_distrib,neg_eq_zero] at hh + simpa only [Matrix.vecMul,Matrix.transpose_apply,dotProduct,mul_comm,Pi.zero_apply] using hh + · intro b hb hba + simp only [htne b hba,MulZeroClass.zero_mul,Finset.sum_const_zero] + · simp + have hy : y ∈ topTestCycles Q E (v a) ((F.placement j).cochain+1) := ⟨hys,hyd⟩ + refine ⟨a,sumTokenTest Q E.placement (v a) y, sumTokenTest_top Q E (v a) _ hy, ?_, ?_⟩ + · intro hzero + have hyz : y=0 := by + rw [← tokenTestVector_sum Q E.placement (v a) _ y hys,hzero,map_zero] + exact hz (congrFun hyz u) + · intro i hi + apply Finset.sum_eq_zero + intro z hz + apply hxs + intro he + exact hi (hplace ⟨i,z⟩ he).2.2 + +theorem packetTwist_cap_of_top_zero + (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} + (hE : ∀ i, (E.placement i).level≤l) (v:P → V) + (htop : ∀ a c, coefficientTopDual Q (E.pureLayer Q hmin l) (v a) c=⊥) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.packetTwist Q v) F.complex) ∧ + ∀ j, (F.complex.placement j).level≤l := by + let B := FiniteModel.ofComplex Q (E.packetTwist Q v) + obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q + refine ⟨F,hF,⟨e⟩,?_⟩ + intro j + by_contra hb + have hj : (F.complex.placement j).level=l+1 := by + have hmax : (F.complex.placement j).level≤l+1 := by + rw [hf j] + change ((E.packetTwist Q v).placement (f j)).level≤l+1 + rcases f j with ⟨a,i,p⟩|i + · change ((E.placement i).cochain-1)+((E.placement i).internal+Path.length p.val)≤l+1 + have hh := hE i + have hr : Path.length p.val≤2 := by + rcases Path.length_cases p.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hh + omega + · have hh := hE i + change (E.placement i).level≤l+1 + omega + omega + obtain ⟨a,x,hx,hxz,hs⟩ := packetTwist_raised_generator_top_at_cap Q E F.complex hE v hF e j hj + have hm := coefficientTopDual_restrict_layer Q E hmin l (v a) _ hx hs + have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs + rw [htop] at hm + exact hn ((Submodule.mem_bot K).mp hm) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator2.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator2.lean index 446992211e096b72a5aa66f56d447f0b7dbd741e..031c9d78a796f2295f55954cf877a8b0ac719d3f 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator2.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistRaisedGenerator2.lean @@ -1,160 +1,160 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J P : Type u} [Fintype I] [Fintype J] [Fintype P] - [DecidableEq I] [DecidableEq J] [DecidableEq P] - -theorem packetTwist_raised_generator_top_at_local_cap - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - {l : ℤ} (U:Set V) - (hE : ∀ i, (E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤l) - (v:P → V) (hv:∀ a,v a∈U) - (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.packetTwist Q v) F) - (j:J) (hj : (F.placement j).level=l+1) - (hcol:(F.placement j).color∈Q.closedNeighborhood U) : - ∃ a:P, ∃ x:I → K, - x ∈ coefficientTopDual Q E (v a) ((F.placement j).cochain+1) ∧ x≠0 ∧ - ∀ i, (E.placement i).level≠l → x i=0 := by - obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_dual_cycle Q (E.packetTwist Q v) F hF e j - have hxold i : x (Sum.inr i)=0 := by - apply hxs - intro he - have hl := congrArg GeneratorPlacement.level he - change (E.placement i).level = (F.placement j).level at hl - have hc: (E.placement i).color=(F.placement j).color := congrArg GeneratorPlacement.color he - have hb := hE i (hc.symm ▸ hcol) - rw [hj] at hl - omega - have hex : ∃ z, x z≠0 := not_forall.mp (fun h => hx (funext h)) - obtain ⟨⟨a,u⟩|i,hz⟩ := hex - swap - · exact (hz (hxold i)).elim - have hp : (E.packetTwist Q v).placement (Sum.inl ⟨a,u⟩)=F.placement j := - Classical.not_not.mp (fun h => hz (hxs _ h)) - have hα : (F.placement j).color=v a := (congrArg GeneratorPlacement.color hp).symm - let y : TestIndex Q E.placement (v a) → K := fun i => x (Sum.inl ⟨a,i⟩) - have hplace (i : TestIndex Q E.placement (v a)) - (he : (E.packetTwist Q v).placement (Sum.inl ⟨a,i⟩)=F.placement j) : - (E.placement i.1).cochain=(F.placement j).cochain+1 ∧ - Path.length i.2.val=2 ∧ (E.placement i.1).level=l := by - have hc := congrArg GeneratorPlacement.cochain he - have hu := congrArg GeneratorPlacement.internal he - change (E.placement i.1).cochain-1=(F.placement j).cochain at hc - change (E.placement i.1).internal+Path.length i.2.val=(F.placement j).internal at hu - have hl := hE i.1 (Q.corner_target_mem_neighborhood (hv a) i.2) - have hr : Path.length i.2.val≤2 := by - rcases Path.length_cases i.2.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hl hj ⊢ - exact ⟨by omega,by omega,by omega⟩ - have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain+1 ∧ - Path.length i.2.val=2) → y i=0 := by - intro hi - apply hxs - intro he - exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ - have hyd : Matrix.vecMul y - (testMatrix Q E.placement E.placement (v a) E.differential).transpose=0 := by - funext i - have hh := hxd (Sum.inl ⟨a,i⟩) - rw [hα,Fintype.sum_sum_type,Fintype.sum_sigma] at hh - have ht k : ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨a,k⟩)).vertex (v a) = - -testMatrix Q E.placement E.placement (v a) E.differential i k := by - change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨a,k⟩).vertex (v a) = _ - rw [packetDifferential,Matrix.blockDiagonal'_apply_eq] - change -(testMatrix Q E.placement E.placement (v a) E.differential i k * - (vertexId Q (K := K) (v a)).vertex (v a)) = _ - simp [vertexId_eval] - have htne b (hb:b≠a) (k:TestIndex Q E.placement (v b)) : - ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨b,k⟩)).vertex (v a)=0 := by - change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨b,k⟩).vertex (v a) = _ - rw [packetDifferential,Matrix.blockDiagonal'_apply_ne _ _ _ (Ne.symm hb),neg_zero] - rfl - rw [Finset.sum_eq_single a] at hh - · simp only [ht,hxold,MulZeroClass.mul_zero,Finset.sum_const_zero,add_zero, - neg_mul,Finset.sum_neg_distrib,neg_eq_zero] at hh - simpa only [Matrix.vecMul,Matrix.transpose_apply,dotProduct,mul_comm,Pi.zero_apply] using hh - · intro b hb hba - simp only [htne b hba,MulZeroClass.zero_mul,Finset.sum_const_zero] - · simp - have hy : y ∈ topTestCycles Q E (v a) ((F.placement j).cochain+1) := ⟨hys,hyd⟩ - refine ⟨a,sumTokenTest Q E.placement (v a) y, sumTokenTest_top Q E (v a) _ hy, ?_, ?_⟩ - · intro hzero - have hyz : y=0 := by - rw [← tokenTestVector_sum Q E.placement (v a) _ y hys,hzero,map_zero] - exact hz (congrFun hyz u) - · intro i hi - apply Finset.sum_eq_zero - intro z hz - apply hxs - intro he - exact hi (hplace ⟨i,z⟩ he).2.2 - -theorem packetTwist_local_cap_of_top_zero - (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} - (U:Set V) - (hE : ∀ i, (E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤l) - (v:P → V) (hv:∀ a,v a∈U) - (htop : ∀ a c, coefficientTopDual Q (E.pureLayer Q hmin l) (v a) c=⊥) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.packetTwist Q v) F.complex) ∧ - ∀ j, (F.complex.placement j).color∈Q.closedNeighborhood U → - (F.complex.placement j).level≤l := by - let B := FiniteModel.ofComplex Q (E.packetTwist Q v) - obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q - refine ⟨F,hF,⟨e⟩,?_⟩ - intro j hcol - by_contra hb - have hj : (F.complex.placement j).level=l+1 := by - have hmax : (F.complex.placement j).level≤l+1 := by - rw [hf j] at hcol ⊢ - change ((E.packetTwist Q v).placement (f j)).color∈Q.closedNeighborhood U at hcol - change ((E.packetTwist Q v).placement (f j)).level≤l+1 - generalize he:f j=k at hcol ⊢ - rcases k with ⟨a,i,p⟩|i - · change ((E.placement i).cochain-1)+((E.placement i).internal+Path.length p.val)≤l+1 - have hh := hE i (Q.corner_target_mem_neighborhood (hv a) p) - have hr : Path.length p.val≤2 := by - rcases Path.length_cases p.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hh - omega - · have hh := hE i hcol - change (E.placement i).level≤l+1 - omega - omega - obtain ⟨a,x,hx,hxz,hs⟩ := packetTwist_raised_generator_top_at_local_cap Q E F.complex U hE v hv hF e j hj hcol - have hm := coefficientTopDual_restrict_layer Q E hmin l (v a) _ hx hs - have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs - rw [htop] at hm - exact hn ((Submodule.mem_bot K).mp hm) - -theorem classPacketPerm_local_cap_of_top_zero - (hn:∀ a,Q.source a≠Q.target a) (v:P→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) {l:ℤ} - (hcap:ClassCapOn Q x (Q.closedNeighborhood U) l) (hU:∀ a,v a∈U) - (htop:∀ a c,classLayerTopDimension Q l (v a) c x=0) : - ClassCapOn Q (classPacketPerm Q hn v hv x) (Q.closedNeighborhood U) l := by - let E:=minimalClassModel Q x - have hE:E.complex.IsMinimal Q:=minimalClassModel_minimal Q x - have ht:∀ a c,coefficientTopDual Q (E.complex.pureLayer Q hE l) (v a) c=⊥ := by - intro a c - exact Submodule.finrank_eq_zero.mp (htop a c) - obtain ⟨F,hF,⟨e⟩,hb⟩:=packetTwist_local_cap_of_top_zero Q E.complex hE U hcap v hU ht - have hh:ClassCapOn Q (classOfComplex Q F.complex) (Q.closedNeighborhood U) l := - minimal_bound_transport Q F.complex _ (minimalClassModel_minimal Q _) - (minimalClassModelEquivalence Q F.complex).symm (fun p=>p.color∈Q.closedNeighborhood U→p.level≤l) hb - have hx:classPacketPerm Q hn v hv x=classOfComplex Q F.complex := by - rw [← minimalClassModel_class Q x,classPacketPerm_apply] - exact classOfComplex_eq Q e - rw [hx] - exact hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ClosedNeighborhood + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J P : Type u} [Fintype I] [Fintype J] [Fintype P] + [DecidableEq I] [DecidableEq J] [DecidableEq P] + +theorem packetTwist_raised_generator_top_at_local_cap + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + {l : ℤ} (U:Set V) + (hE : ∀ i, (E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤l) + (v:P → V) (hv:∀ a,v a∈U) + (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.packetTwist Q v) F) + (j:J) (hj : (F.placement j).level=l+1) + (hcol:(F.placement j).color∈Q.closedNeighborhood U) : + ∃ a:P, ∃ x:I → K, + x ∈ coefficientTopDual Q E (v a) ((F.placement j).cochain+1) ∧ x≠0 ∧ + ∀ i, (E.placement i).level≠l → x i=0 := by + obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_dual_cycle Q (E.packetTwist Q v) F hF e j + have hxold i : x (Sum.inr i)=0 := by + apply hxs + intro he + have hl := congrArg GeneratorPlacement.level he + change (E.placement i).level = (F.placement j).level at hl + have hc: (E.placement i).color=(F.placement j).color := congrArg GeneratorPlacement.color he + have hb := hE i (hc.symm ▸ hcol) + rw [hj] at hl + omega + have hex : ∃ z, x z≠0 := not_forall.mp (fun h => hx (funext h)) + obtain ⟨⟨a,u⟩|i,hz⟩ := hex + swap + · exact (hz (hxold i)).elim + have hp : (E.packetTwist Q v).placement (Sum.inl ⟨a,u⟩)=F.placement j := + Classical.not_not.mp (fun h => hz (hxs _ h)) + have hα : (F.placement j).color=v a := (congrArg GeneratorPlacement.color hp).symm + let y : TestIndex Q E.placement (v a) → K := fun i => x (Sum.inl ⟨a,i⟩) + have hplace (i : TestIndex Q E.placement (v a)) + (he : (E.packetTwist Q v).placement (Sum.inl ⟨a,i⟩)=F.placement j) : + (E.placement i.1).cochain=(F.placement j).cochain+1 ∧ + Path.length i.2.val=2 ∧ (E.placement i.1).level=l := by + have hc := congrArg GeneratorPlacement.cochain he + have hu := congrArg GeneratorPlacement.internal he + change (E.placement i.1).cochain-1=(F.placement j).cochain at hc + change (E.placement i.1).internal+Path.length i.2.val=(F.placement j).internal at hu + have hl := hE i.1 (Q.corner_target_mem_neighborhood (hv a) i.2) + have hr : Path.length i.2.val≤2 := by + rcases Path.length_cases i.2.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hl hj ⊢ + exact ⟨by omega,by omega,by omega⟩ + have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain+1 ∧ + Path.length i.2.val=2) → y i=0 := by + intro hi + apply hxs + intro he + exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ + have hyd : Matrix.vecMul y + (testMatrix Q E.placement E.placement (v a) E.differential).transpose=0 := by + funext i + have hh := hxd (Sum.inl ⟨a,i⟩) + rw [hα,Fintype.sum_sum_type,Fintype.sum_sigma] at hh + have ht k : ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨a,k⟩)).vertex (v a) = + -testMatrix Q E.placement E.placement (v a) E.differential i k := by + change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨a,k⟩).vertex (v a) = _ + rw [packetDifferential,Matrix.blockDiagonal'_apply_eq] + change -(testMatrix Q E.placement E.placement (v a) E.differential i k * + (vertexId Q (K := K) (v a)).vertex (v a)) = _ + simp [vertexId_eval] + have htne b (hb:b≠a) (k:TestIndex Q E.placement (v b)) : + ((E.packetTwist Q v).differential (Sum.inl ⟨a,i⟩) (Sum.inl ⟨b,k⟩)).vertex (v a)=0 := by + change (-(packetDifferential Q E.placement v E.differential) ⟨a,i⟩ ⟨b,k⟩).vertex (v a) = _ + rw [packetDifferential,Matrix.blockDiagonal'_apply_ne _ _ _ (Ne.symm hb),neg_zero] + rfl + rw [Finset.sum_eq_single a] at hh + · simp only [ht,hxold,MulZeroClass.mul_zero,Finset.sum_const_zero,add_zero, + neg_mul,Finset.sum_neg_distrib,neg_eq_zero] at hh + simpa only [Matrix.vecMul,Matrix.transpose_apply,dotProduct,mul_comm,Pi.zero_apply] using hh + · intro b hb hba + simp only [htne b hba,MulZeroClass.zero_mul,Finset.sum_const_zero] + · simp + have hy : y ∈ topTestCycles Q E (v a) ((F.placement j).cochain+1) := ⟨hys,hyd⟩ + refine ⟨a,sumTokenTest Q E.placement (v a) y, sumTokenTest_top Q E (v a) _ hy, ?_, ?_⟩ + · intro hzero + have hyz : y=0 := by + rw [← tokenTestVector_sum Q E.placement (v a) _ y hys,hzero,map_zero] + exact hz (congrFun hyz u) + · intro i hi + apply Finset.sum_eq_zero + intro z hz + apply hxs + intro he + exact hi (hplace ⟨i,z⟩ he).2.2 + +theorem packetTwist_local_cap_of_top_zero + (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} + (U:Set V) + (hE : ∀ i, (E.placement i).color∈Q.closedNeighborhood U → (E.placement i).level≤l) + (v:P → V) (hv:∀ a,v a∈U) + (htop : ∀ a c, coefficientTopDual Q (E.pureLayer Q hmin l) (v a) c=⊥) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.packetTwist Q v) F.complex) ∧ + ∀ j, (F.complex.placement j).color∈Q.closedNeighborhood U → + (F.complex.placement j).level≤l := by + let B := FiniteModel.ofComplex Q (E.packetTwist Q v) + obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q + refine ⟨F,hF,⟨e⟩,?_⟩ + intro j hcol + by_contra hb + have hj : (F.complex.placement j).level=l+1 := by + have hmax : (F.complex.placement j).level≤l+1 := by + rw [hf j] at hcol ⊢ + change ((E.packetTwist Q v).placement (f j)).color∈Q.closedNeighborhood U at hcol + change ((E.packetTwist Q v).placement (f j)).level≤l+1 + generalize he:f j=k at hcol ⊢ + rcases k with ⟨a,i,p⟩|i + · change ((E.placement i).cochain-1)+((E.placement i).internal+Path.length p.val)≤l+1 + have hh := hE i (Q.corner_target_mem_neighborhood (hv a) p) + have hr : Path.length p.val≤2 := by + rcases Path.length_cases p.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hh + omega + · have hh := hE i hcol + change (E.placement i).level≤l+1 + omega + omega + obtain ⟨a,x,hx,hxz,hs⟩ := packetTwist_raised_generator_top_at_local_cap Q E F.complex U hE v hv hF e j hj hcol + have hm := coefficientTopDual_restrict_layer Q E hmin l (v a) _ hx hs + have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs + rw [htop] at hm + exact hn ((Submodule.mem_bot K).mp hm) + +theorem classPacketPerm_local_cap_of_top_zero + (hn:∀ a,Q.source a≠Q.target a) (v:P→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) {l:ℤ} + (hcap:ClassCapOn Q x (Q.closedNeighborhood U) l) (hU:∀ a,v a∈U) + (htop:∀ a c,classLayerTopDimension Q l (v a) c x=0) : + ClassCapOn Q (classPacketPerm Q hn v hv x) (Q.closedNeighborhood U) l := by + let E:=minimalClassModel Q x + have hE:E.complex.IsMinimal Q:=minimalClassModel_minimal Q x + have ht:∀ a c,coefficientTopDual Q (E.complex.pureLayer Q hE l) (v a) c=⊥ := by + intro a c + exact Submodule.finrank_eq_zero.mp (htop a c) + obtain ⟨F,hF,⟨e⟩,hb⟩:=packetTwist_local_cap_of_top_zero Q E.complex hE U hcap v hU ht + have hh:ClassCapOn Q (classOfComplex Q F.complex) (Q.closedNeighborhood U) l := + minimal_bound_transport Q F.complex _ (minimalClassModel_minimal Q _) + (minimalClassModelEquivalence Q F.complex).symm (fun p=>p.color∈Q.closedNeighborhood U→p.level≤l) hb + have hx:classPacketPerm Q hn v hv x=classOfComplex Q F.complex := by + rw [← minimalClassModel_class Q x,classPacketPerm_apply] + exact classOfComplex_eq Q e + rw [hx] + exact hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistTopZero.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistTopZero.lean index a5262b7d63a6a49ff48ff977aa8e6fe208dd82ea..a762e995da2392abd4c11fe7ee2858ee9475fb2b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistTopZero.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PacketTwistTopZero.lean @@ -1,131 +1,131 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.UpperBound -import OAI.Topology.ArtinGroups.Complexes.HighDualCycleZero - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J P:Type u} [Fintype I] [Fintype J] [Fintype P] - [DecidableEq I] [DecidableEq J] [DecidableEq P] - -theorem packetTwist_top_zero_of_cap - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (q:ℤ) (hE:∀ i,(E.placement i).level=q) (v:P→V) - (e:HomotopyEquivalence Q (E.packetTwist Q v) F) - (hF:∀ j,(F.placement j).level≤q) : - ∀ a c,coefficientTopDual Q E (v a) c=⊥ := by - intro a c - apply eq_bot_iff.mpr - intro x hx - change x=0 - let t:=tokenTestVector Q E.placement (v a) x - have ht:t∈topTestCycles Q E (v a) c:=tokenTestVector_top Q E hE (v a) c hx - let z':∀ b:P,TestIndex Q E.placement (v b)→K:=Pi.single a t - let z:PacketIndex Q E.placement v→K:=fun b=>z' b.1 b.2 - let y:PacketIndex Q E.placement v⊕I→K:=Sum.elim z (fun _=>0) - have hz:∀ (b:P) (i:TestIndex Q E.placement (v b)),b≠a→z ⟨b,i⟩=0 := by - intro b i h - simp [z,z',Pi.single_eq_of_ne h] - have hza:∀ i,z ⟨a,i⟩=t i := by intro i; simp [z,z'] - have hy:y=0 := by - apply high_dual_cycle_zero Q (E.packetTwist Q v) F e (v a) (q+1) - · intro i - rcases i with ⟨b,i⟩|i - · change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)≤q+1 - have hi:=hE i.1 - have hl:Path.length i.2.val≤2:=by rcases Path.length_cases i.2.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hi - omega - · change (E.placement i).level≤q+1 - rw [hE]; omega - · intro j - have hj:=hF j - omega - · intro i hi - rcases i with ⟨b,i⟩|i - · change z ⟨b,i⟩=0 - by_cases hb:b=a - · subst b - rw [hza] - apply ht.1 - intro hh - apply hi.elim - · intro h - apply h - change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)=q+1 - have hq:=hE i.1 - dsimp only [GeneratorPlacement.level] at hq - omega - · intro h - exact h rfl - · exact hz b i hb - · rfl - · funext i - rcases i with ⟨b,i⟩|i - · change (∑ j:PacketIndex Q E.placement v⊕I, - ((E.packetTwist Q v).differential (.inl ⟨b,i⟩) j).vertex (v a)*y j)=0 - rw [Fintype.sum_sum_type] - simp only [y,Sum.elim_inl,Sum.elim_inr,MulZeroClass.mul_zero,Finset.sum_const_zero,_root_.add_zero] - rw [Fintype.sum_sigma,Finset.sum_eq_single a] - · simp only [hza] - by_cases hb:b=a - · subst b - have hh:=congrFun ht.2 i - change (∑ j,t j * testMatrix Q E.placement E.placement (v a) E.differential i j)=0 at hh - have hm j:((E.packetTwist Q v).differential (.inl ⟨a,i⟩) (.inl ⟨a,j⟩)).vertex (v a) = - -testMatrix Q E.placement E.placement (v a) E.differential i j := by - change (-packetDifferential Q E.placement v E.differential ⟨a,i⟩ ⟨a,j⟩).vertex (v a)=_ - rw [packetDifferential,Matrix.blockDiagonal'_apply_eq] - change -(testMatrix Q E.placement E.placement (v a) E.differential i j * - (vertexId Q (K:=K) (v a)).vertex (v a)) = _ - rw [vertexId_eval,ite_eq_left rfl,_root_.mul_one] - simp only [hm,_root_.neg_mul,Finset.sum_neg_distrib] - rw [show (∑ j,testMatrix Q E.placement E.placement (v a) E.differential i j*t j)=0 from by - simpa only [_root_.mul_comm] using hh,_root_.neg_zero] - · apply Finset.sum_eq_zero - intro j _ - change (-packetDifferential Q E.placement v E.differential ⟨b,i⟩ ⟨a,j⟩).vertex (v a)*t j=0 - rw [packetDifferential,Matrix.blockDiagonal'_apply_ne _ _ _ hb] - simp - · intro b hb hba - apply Finset.sum_eq_zero - intro j _ - rw [hz b j hba,MulZeroClass.mul_zero] - · simp - · change (∑ j:PacketIndex Q E.placement v⊕I, - ((E.packetTwist Q v).differential (.inr i) j).vertex (v a)*y j)=0 - rw [Fintype.sum_sum_type] - simp [y,BasedComplex.packetTwist,Map.cone,Map.coneDifferential,Matrix.fromBlocks] - have ht0:t=0:=funext fun i=>by simpa only [y,Sum.elim_inl,hza,Pi.zero_apply] using congrFun hy (.inl ⟨a,i⟩) - have hr:=sumTokenTest_unit Q E.placement (v a) x (fun i hi=>hx.1 i (Or.inl hi)) - change sumTokenTest Q E.placement (v a) t=x at hr - rw [ht0,map_zero] at hr - exact hr.symm - -theorem classPacketPerm_top_zero_of_layer_cap - (hn:∀ a,Q.source a≠Q.target a) (v:P→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) - (hh:ClassUpperBound Q q (classPacketPerm Q hn v hv (classLayer Q q x))) : - ∀ a c,classLayerTopDimension Q q (v a) c x=0 := by - let E:=(minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q - let y:=classPacketPerm Q hn v hv (classLayer Q q x) - let F:=(minimalClassModel Q y).complex - have he:classOfComplex Q (E.packetTwist Q v)=classOfComplex Q F := by - have hp:=classPacketPerm_apply Q hn v hv (FiniteModel.ofComplex Q E) - change classPacketPerm Q hn v hv (classOfComplex Q E)= - classOfComplex Q (E.packetTwist Q v) at hp - rw [← hp] - exact (minimalClassModel_class Q y).symm - obtain ⟨e⟩:=Quotient.exact he - have ht:=packetTwist_top_zero_of_cap Q E F q (fun i=>i.property) v e hh - intro a c - change Module.finrank K (coefficientTopDual Q E (v a) c)=0 - rw [ht,finrank_bot] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.UpperBound +import OAI.Topology.ArtinGroups.Complexes.HighDualCycleZero + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J P:Type u} [Fintype I] [Fintype J] [Fintype P] + [DecidableEq I] [DecidableEq J] [DecidableEq P] + +theorem packetTwist_top_zero_of_cap + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (q:ℤ) (hE:∀ i,(E.placement i).level=q) (v:P→V) + (e:HomotopyEquivalence Q (E.packetTwist Q v) F) + (hF:∀ j,(F.placement j).level≤q) : + ∀ a c,coefficientTopDual Q E (v a) c=⊥ := by + intro a c + apply eq_bot_iff.mpr + intro x hx + change x=0 + let t:=tokenTestVector Q E.placement (v a) x + have ht:t∈topTestCycles Q E (v a) c:=tokenTestVector_top Q E hE (v a) c hx + let z':∀ b:P,TestIndex Q E.placement (v b)→K:=Pi.single a t + let z:PacketIndex Q E.placement v→K:=fun b=>z' b.1 b.2 + let y:PacketIndex Q E.placement v⊕I→K:=Sum.elim z (fun _=>0) + have hz:∀ (b:P) (i:TestIndex Q E.placement (v b)),b≠a→z ⟨b,i⟩=0 := by + intro b i h + simp [z,z',Pi.single_eq_of_ne h] + have hza:∀ i,z ⟨a,i⟩=t i := by intro i; simp [z,z'] + have hy:y=0 := by + apply high_dual_cycle_zero Q (E.packetTwist Q v) F e (v a) (q+1) + · intro i + rcases i with ⟨b,i⟩|i + · change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)≤q+1 + have hi:=hE i.1 + have hl:Path.length i.2.val≤2:=by rcases Path.length_cases i.2.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hi + omega + · change (E.placement i).level≤q+1 + rw [hE]; omega + · intro j + have hj:=hF j + omega + · intro i hi + rcases i with ⟨b,i⟩|i + · change z ⟨b,i⟩=0 + by_cases hb:b=a + · subst b + rw [hza] + apply ht.1 + intro hh + apply hi.elim + · intro h + apply h + change (E.placement i.1).cochain-1+((E.placement i.1).internal+Path.length i.2.val)=q+1 + have hq:=hE i.1 + dsimp only [GeneratorPlacement.level] at hq + omega + · intro h + exact h rfl + · exact hz b i hb + · rfl + · funext i + rcases i with ⟨b,i⟩|i + · change (∑ j:PacketIndex Q E.placement v⊕I, + ((E.packetTwist Q v).differential (.inl ⟨b,i⟩) j).vertex (v a)*y j)=0 + rw [Fintype.sum_sum_type] + simp only [y,Sum.elim_inl,Sum.elim_inr,MulZeroClass.mul_zero,Finset.sum_const_zero,_root_.add_zero] + rw [Fintype.sum_sigma,Finset.sum_eq_single a] + · simp only [hza] + by_cases hb:b=a + · subst b + have hh:=congrFun ht.2 i + change (∑ j,t j * testMatrix Q E.placement E.placement (v a) E.differential i j)=0 at hh + have hm j:((E.packetTwist Q v).differential (.inl ⟨a,i⟩) (.inl ⟨a,j⟩)).vertex (v a) = + -testMatrix Q E.placement E.placement (v a) E.differential i j := by + change (-packetDifferential Q E.placement v E.differential ⟨a,i⟩ ⟨a,j⟩).vertex (v a)=_ + rw [packetDifferential,Matrix.blockDiagonal'_apply_eq] + change -(testMatrix Q E.placement E.placement (v a) E.differential i j * + (vertexId Q (K:=K) (v a)).vertex (v a)) = _ + rw [vertexId_eval,ite_eq_left rfl,_root_.mul_one] + simp only [hm,_root_.neg_mul,Finset.sum_neg_distrib] + rw [show (∑ j,testMatrix Q E.placement E.placement (v a) E.differential i j*t j)=0 from by + simpa only [_root_.mul_comm] using hh,_root_.neg_zero] + · apply Finset.sum_eq_zero + intro j _ + change (-packetDifferential Q E.placement v E.differential ⟨b,i⟩ ⟨a,j⟩).vertex (v a)*t j=0 + rw [packetDifferential,Matrix.blockDiagonal'_apply_ne _ _ _ hb] + simp + · intro b hb hba + apply Finset.sum_eq_zero + intro j _ + rw [hz b j hba,MulZeroClass.mul_zero] + · simp + · change (∑ j:PacketIndex Q E.placement v⊕I, + ((E.packetTwist Q v).differential (.inr i) j).vertex (v a)*y j)=0 + rw [Fintype.sum_sum_type] + simp [y,BasedComplex.packetTwist,Map.cone,Map.coneDifferential,Matrix.fromBlocks] + have ht0:t=0:=funext fun i=>by simpa only [y,Sum.elim_inl,hza,Pi.zero_apply] using congrFun hy (.inl ⟨a,i⟩) + have hr:=sumTokenTest_unit Q E.placement (v a) x (fun i hi=>hx.1 i (Or.inl hi)) + change sumTokenTest Q E.placement (v a) t=x at hr + rw [ht0,map_zero] at hr + exact hr.symm + +theorem classPacketPerm_top_zero_of_layer_cap + (hn:∀ a,Q.source a≠Q.target a) (v:P→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (x:FiniteHomotopyClass Q (K:=K)) (q:ℤ) + (hh:ClassUpperBound Q q (classPacketPerm Q hn v hv (classLayer Q q x))) : + ∀ a c,classLayerTopDimension Q q (v a) c x=0 := by + let E:=(minimalClassModel Q x).complex.pureLayer Q (minimalClassModel_minimal Q x) q + let y:=classPacketPerm Q hn v hv (classLayer Q q x) + let F:=(minimalClassModel Q y).complex + have he:classOfComplex Q (E.packetTwist Q v)=classOfComplex Q F := by + have hp:=classPacketPerm_apply Q hn v hv (FiniteModel.ofComplex Q E) + change classPacketPerm Q hn v hv (classOfComplex Q E)= + classOfComplex Q (E.packetTwist Q v) at hp + rw [← hp] + exact (minimalClassModel_class Q y).symm + obtain ⟨e⟩:=Quotient.exact he + have ht:=packetTwist_top_zero_of_cap Q E F q (fun i=>i.property) v e hh + intro a c + change Module.finrank K (coefficientTopDual Q E (v a) c)=0 + rw [ht,finrank_bot] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PlacedProjective.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PlacedProjective.lean index bcd40ac8e301a8bb3a225d18e3d3c1162f9d617d..9613ceb99141355e1785d3b80838fc2665a7a595 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PlacedProjective.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PlacedProjective.lean @@ -1,124 +1,124 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.UpperBound - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -noncomputable def placedProjective (p:GeneratorPlacement V) : BasedComplex Q (K:=K) PUnit.{u+1} where - placement _:=p - differential:=0 - entries:=projectiveEntries_zero Q - degree:=mapDegree_zero Q 1 0 - square_zero:=Matrix.zero_mul _ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma homSpace_zero_of_layer_gap (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (a b:ℤ) (ha:∀ i,(E.placement i).level≤a) (hb:∀ j,b≤(F.placement j).level) - (hab:a omega - have hc:=hlast j he - have hd:(E.placement j).cochain=(E.placement i).cochain+1 := - Classical.not_not.mp (fun hz=>h ((E.degree i j).1 hz)) - omega - -noncomputable def placedGeneratorMap (E:BasedComplex Q (K:=K) I) (i:I) - (hi:∀ j,E.differential i j=0) : Map Q (placedProjective Q (E.placement i)) E where - matrix _ j:=projectiveIdentity Q (K:=K) E.placement i j - entries:=⟨fun _ j=>(projectiveEntries_identity Q).1 i j, - fun _ j=>(projectiveEntries_identity Q).2 i j⟩ - degree:=fun _ j=>mapDegree_identity Q i j - commute:=by - apply Matrix.ext - intro z j - change (∑ _k:PUnit.{u+1}, (0:Q.Zigzag K) * projectiveIdentity Q (K:=K) E.placement i j)= - (projectiveIdentity Q (K:=K) E.placement*E.differential) i j - simp only [zero_mul,Finset.sum_const_zero] - exact ((congrArg (fun M:Matrix I I (Q.Zigzag K)=>M i j) - (projectiveIdentity_mul Q E.entries)).trans (hi j)).symm - -omit [DecidableEq A] in -lemma placedGenerator_homDimension_ne_zero (E:BasedComplex Q (K:=K) I) - (hE:E.IsMinimal Q) (i:I) (hi:∀ j,E.differential i j=0) : - homDimension Q (placedProjective Q (E.placement i)) E 0 0≠0 := by - intro hz - let f:=placedGeneratorMap Q E i hi - obtain ⟨g,hg,he⟩:=boundary_of_homDimension_zero Q _ _ 0 0 hz (map_mem_homCycles Q f) - have hv:=positiveMatrix_mul_left Q g hE - have hzero:(homDifferential Q (placedProjective Q (E.placement i)) E (-1) g - PUnit.unit i).vertex (E.placement i).color=0 := by - change (((0:Matrix PUnit.{u+1} PUnit.{u+1} (Q.Zigzag K))*g-cochainSign (K:=K) (-1) • (g*E.differential)) PUnit.unit i).vertex _=0 - rw [Matrix.zero_mul,zero_sub] - change -(cochainSign (K:=K) (-1) * ((g*E.differential) PUnit.unit i).vertex _)=0 - rw [hv PUnit.unit i] - simp - have he':homDifferential Q (placedProjective Q (E.placement i)) E (-1) g=f.matrix:=he - rw [he'] at hzero - change (projectiveIdentity Q (K:=K) E.placement i i).vertex (E.placement i).color=0 at hzero - simp [projectiveIdentity,vertexId_eval] at hzero - -omit [DecidableEq A] in -theorem classLowerBound_of_placed_vanishing (x:FiniteHomotopyClass Q (K:=K)) (d:ℤ) - (h:∀ p:GeneratorPlacement V,p.level(E.complex.placement j).level) ⟨i,Finset.mem_univ i⟩ - have hm:∀ k,(E.complex.placement j).level≤(E.complex.placement k).level:= - fun k=>hmin k (Finset.mem_univ k) - let T:=Finset.univ.filter (fun k:E.Index=>(E.complex.placement k).level=(E.complex.placement j).level) - obtain ⟨k,hk,hmax⟩:=Finset.exists_max_image T (fun k=>(E.complex.placement k).cochain) - ⟨j,by simp [T]⟩ - have hlev:(E.complex.placement k).level=(E.complex.placement j).level:=(Finset.mem_filter.mp hk).2 - have hd:(E.complex.placement k).levelby rw [hlev]; exact hm z) - (fun z hz=>hmax z (by simp [T,hz,hlev])) - apply placedGenerator_homDimension_ne_zero Q E.complex (minimalClassModel_minimal Q x) k hrow - have he:classOfComplex Q E.complex=x:=minimalClassModel_class Q x - change classHomDimension Q 0 0 (classOfComplex Q (placedProjective Q (E.complex.placement k))) - (classOfComplex Q E.complex)=0 - rw [he] - exact h _ hd - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.UpperBound + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +noncomputable def placedProjective (p:GeneratorPlacement V) : BasedComplex Q (K:=K) PUnit.{u+1} where + placement _:=p + differential:=0 + entries:=projectiveEntries_zero Q + degree:=mapDegree_zero Q 1 0 + square_zero:=Matrix.zero_mul _ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma homSpace_zero_of_layer_gap (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (a b:ℤ) (ha:∀ i,(E.placement i).level≤a) (hb:∀ j,b≤(F.placement j).level) + (hab:a omega + have hc:=hlast j he + have hd:(E.placement j).cochain=(E.placement i).cochain+1 := + Classical.not_not.mp (fun hz=>h ((E.degree i j).1 hz)) + omega + +noncomputable def placedGeneratorMap (E:BasedComplex Q (K:=K) I) (i:I) + (hi:∀ j,E.differential i j=0) : Map Q (placedProjective Q (E.placement i)) E where + matrix _ j:=projectiveIdentity Q (K:=K) E.placement i j + entries:=⟨fun _ j=>(projectiveEntries_identity Q).1 i j, + fun _ j=>(projectiveEntries_identity Q).2 i j⟩ + degree:=fun _ j=>mapDegree_identity Q i j + commute:=by + apply Matrix.ext + intro z j + change (∑ _k:PUnit.{u+1}, (0:Q.Zigzag K) * projectiveIdentity Q (K:=K) E.placement i j)= + (projectiveIdentity Q (K:=K) E.placement*E.differential) i j + simp only [zero_mul,Finset.sum_const_zero] + exact ((congrArg (fun M:Matrix I I (Q.Zigzag K)=>M i j) + (projectiveIdentity_mul Q E.entries)).trans (hi j)).symm + +omit [DecidableEq A] in +lemma placedGenerator_homDimension_ne_zero (E:BasedComplex Q (K:=K) I) + (hE:E.IsMinimal Q) (i:I) (hi:∀ j,E.differential i j=0) : + homDimension Q (placedProjective Q (E.placement i)) E 0 0≠0 := by + intro hz + let f:=placedGeneratorMap Q E i hi + obtain ⟨g,hg,he⟩:=boundary_of_homDimension_zero Q _ _ 0 0 hz (map_mem_homCycles Q f) + have hv:=positiveMatrix_mul_left Q g hE + have hzero:(homDifferential Q (placedProjective Q (E.placement i)) E (-1) g + PUnit.unit i).vertex (E.placement i).color=0 := by + change (((0:Matrix PUnit.{u+1} PUnit.{u+1} (Q.Zigzag K))*g-cochainSign (K:=K) (-1) • (g*E.differential)) PUnit.unit i).vertex _=0 + rw [Matrix.zero_mul,zero_sub] + change -(cochainSign (K:=K) (-1) * ((g*E.differential) PUnit.unit i).vertex _)=0 + rw [hv PUnit.unit i] + simp + have he':homDifferential Q (placedProjective Q (E.placement i)) E (-1) g=f.matrix:=he + rw [he'] at hzero + change (projectiveIdentity Q (K:=K) E.placement i i).vertex (E.placement i).color=0 at hzero + simp [projectiveIdentity,vertexId_eval] at hzero + +omit [DecidableEq A] in +theorem classLowerBound_of_placed_vanishing (x:FiniteHomotopyClass Q (K:=K)) (d:ℤ) + (h:∀ p:GeneratorPlacement V,p.level(E.complex.placement j).level) ⟨i,Finset.mem_univ i⟩ + have hm:∀ k,(E.complex.placement j).level≤(E.complex.placement k).level:= + fun k=>hmin k (Finset.mem_univ k) + let T:=Finset.univ.filter (fun k:E.Index=>(E.complex.placement k).level=(E.complex.placement j).level) + obtain ⟨k,hk,hmax⟩:=Finset.exists_max_image T (fun k=>(E.complex.placement k).cochain) + ⟨j,by simp [T]⟩ + have hlev:(E.complex.placement k).level=(E.complex.placement j).level:=(Finset.mem_filter.mp hk).2 + have hd:(E.complex.placement k).levelby rw [hlev]; exact hm z) + (fun z hz=>hmax z (by simp [T,hz,hlev])) + apply placedGenerator_homDimension_ne_zero Q E.complex (minimalClassModel_minimal Q x) k hrow + have he:classOfComplex Q E.complex=x:=minimalClassModel_class Q x + change classHomDimension Q 0 0 (classOfComplex Q (placedProjective Q (E.complex.placement k))) + (classOfComplex Q E.complex)=0 + rw [he] + exact h _ hd + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PlacementSignedWeight.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PlacementSignedWeight.lean index 0338019386640f4ac774c99e5d8e75f280e36a74..4d42793dacee6d037015f490c4dab7124bebd30f 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PlacementSignedWeight.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PlacementSignedWeight.lean @@ -1,122 +1,122 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Cancellation.Retained -import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid -import OAI.Topology.ArtinGroups.Complexes.GeneratorArray -import OAI.Topology.ArtinGroups.Complexes.HomSpace - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -noncomputable def placementSignedWeight (a : GeneratorPlacement V) (v : V) : ℝ := - if a.color=v then cochainSign a.level else 0 - -noncomputable def signedGeneratorVector {I : Type u} [Fintype I] - (E : BasedComplex Q (K:=K) I) (v : V) : ℝ := - ∑ i, placementSignedWeight (E.placement i) v - -omit [Fintype V] [DecidableEq A] in -lemma signedGeneratorVector_array {I : Type u} [Fintype I] - (E : BasedComplex Q (K:=K) I) (v : V) : - signedGeneratorVector Q E v= - Finsupp.liftAddHom (fun a => multiplesHom ℝ (placementSignedWeight a v)) (E.generatorArray Q) := by - simp only [signedGeneratorVector,generatorArray,map_sum,Finsupp.liftAddHom_apply_single] - simp - -omit [Fintype V] [DecidableEq A] in -lemma signedGeneratorVector_minimal_eq {I J : Type u} [Fintype I] [Fintype J] - [DecidableEq I] [DecidableEq J] - (E : BasedComplex Q (K:=K) I) (F : BasedComplex Q (K:=K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) : - signedGeneratorVector Q E=signedGeneratorVector Q F := by - funext v - rw [signedGeneratorVector_array,signedGeneratorVector_array, - generatorArray_eq_of_minimal_homotopyEquivalence Q E F hE hF e] - -omit [Fintype V] [DecidableEq A] in -lemma ScalarPivot.signedWeight_cancel {I : Type u} [Fintype I] - {E : BasedComplex Q (K:=K) I} (p : ScalarPivot Q E) (v : V) : - placementSignedWeight (E.placement p.source) v+ - placementSignedWeight (E.placement p.target) v=0 := by - have hl : (E.placement p.target).level=(E.placement p.source).level+1 := by - simp only [GeneratorPlacement.level,p.cochain,p.internal] - omega - simp only [placementSignedWeight,p.color,hl,cochainSign_add_one] - split_ifs <;> ring - -omit [Fintype V] [DecidableEq A] in -lemma ScalarPivot.signedGeneratorVector_reduced {I : Type u} [Fintype I] [DecidableEq I] - {E : BasedComplex Q (K:=K) I} (p : ScalarPivot Q E) : - signedGeneratorVector Q (p.reduced Q)=signedGeneratorVector Q E := by - funext v - let f : I → ℝ := fun i => placementSignedWeight (E.placement i) v - have hs : ∑ i : p.Retained Q, f i = - ∑ i ∈ ((Finset.univ : Finset I).erase p.source).erase p.target, f i := by - symm - apply Finset.sum_subtype - intro i - simp [and_comm] - change (∑ i : p.Retained Q, f i)=∑ i, f i - rw [hs] - have h1 := Finset.sum_erase_add (Finset.univ : Finset I) f (Finset.mem_univ p.source) - have h2 := Finset.sum_erase_add ((Finset.univ : Finset I).erase p.source) f - (by simp [p.distinct.symm] : p.target∈(Finset.univ : Finset I).erase p.source) - have hc := p.signedWeight_cancel Q v - change f p.source + f p.target=0 at hc - linarith - -namespace FiniteModel - -omit [Fintype V] [DecidableEq A] in -theorem exists_minimal_signed (E : FiniteModel.{u} Q (K:=K)) : - ∃ F : FiniteModel.{u} Q (K:=K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q E.complex F.complex) ∧ - signedGeneratorVector Q E.complex=signedGeneratorVector Q F.complex := by - have h : ∀ n (B : FiniteModel.{u} Q (K:=K)), Fintype.card B.Index=n → - ∃ F : FiniteModel.{u} Q (K:=K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q B.complex F.complex) ∧ - signedGeneratorVector Q B.complex=signedGeneratorVector Q F.complex := by - intro n - induction n using Nat.strong_induction_on with - | h n ih => - intro B hn - by_cases hm : B.complex.IsMinimal Q - · exact ⟨B,hm,⟨HomotopyEquivalence.refl Q B.complex⟩,rfl⟩ - obtain ⟨p⟩ := scalarPivot_of_not_minimal Q B.complex hm - let C := ofComplex Q (p.reduced Q) - have hc : Fintype.card C.Index signedGeneratorVector Q E.complex) - (fun E F h => by obtain ⟨e⟩:=h; exact FiniteModel.signedGeneratorVector_homotopy Q E F e) - -omit [Fintype V] [DecidableEq A] in -lemma classSignedVector_mk (E : FiniteModel.{u} Q (K:=K)) : - classSignedVector Q (Quotient.mk (finiteHomotopySetoid Q) E)=signedGeneratorVector Q E.complex := rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Cancellation.Retained +import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid +import OAI.Topology.ArtinGroups.Complexes.GeneratorArray +import OAI.Topology.ArtinGroups.Complexes.HomSpace + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +noncomputable def placementSignedWeight (a : GeneratorPlacement V) (v : V) : ℝ := + if a.color=v then cochainSign a.level else 0 + +noncomputable def signedGeneratorVector {I : Type u} [Fintype I] + (E : BasedComplex Q (K:=K) I) (v : V) : ℝ := + ∑ i, placementSignedWeight (E.placement i) v + +omit [Fintype V] [DecidableEq A] in +lemma signedGeneratorVector_array {I : Type u} [Fintype I] + (E : BasedComplex Q (K:=K) I) (v : V) : + signedGeneratorVector Q E v= + Finsupp.liftAddHom (fun a => multiplesHom ℝ (placementSignedWeight a v)) (E.generatorArray Q) := by + simp only [signedGeneratorVector,generatorArray,map_sum,Finsupp.liftAddHom_apply_single] + simp + +omit [Fintype V] [DecidableEq A] in +lemma signedGeneratorVector_minimal_eq {I J : Type u} [Fintype I] [Fintype J] + [DecidableEq I] [DecidableEq J] + (E : BasedComplex Q (K:=K) I) (F : BasedComplex Q (K:=K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q E F) : + signedGeneratorVector Q E=signedGeneratorVector Q F := by + funext v + rw [signedGeneratorVector_array,signedGeneratorVector_array, + generatorArray_eq_of_minimal_homotopyEquivalence Q E F hE hF e] + +omit [Fintype V] [DecidableEq A] in +lemma ScalarPivot.signedWeight_cancel {I : Type u} [Fintype I] + {E : BasedComplex Q (K:=K) I} (p : ScalarPivot Q E) (v : V) : + placementSignedWeight (E.placement p.source) v+ + placementSignedWeight (E.placement p.target) v=0 := by + have hl : (E.placement p.target).level=(E.placement p.source).level+1 := by + simp only [GeneratorPlacement.level,p.cochain,p.internal] + omega + simp only [placementSignedWeight,p.color,hl,cochainSign_add_one] + split_ifs <;> ring + +omit [Fintype V] [DecidableEq A] in +lemma ScalarPivot.signedGeneratorVector_reduced {I : Type u} [Fintype I] [DecidableEq I] + {E : BasedComplex Q (K:=K) I} (p : ScalarPivot Q E) : + signedGeneratorVector Q (p.reduced Q)=signedGeneratorVector Q E := by + funext v + let f : I → ℝ := fun i => placementSignedWeight (E.placement i) v + have hs : ∑ i : p.Retained Q, f i = + ∑ i ∈ ((Finset.univ : Finset I).erase p.source).erase p.target, f i := by + symm + apply Finset.sum_subtype + intro i + simp [and_comm] + change (∑ i : p.Retained Q, f i)=∑ i, f i + rw [hs] + have h1 := Finset.sum_erase_add (Finset.univ : Finset I) f (Finset.mem_univ p.source) + have h2 := Finset.sum_erase_add ((Finset.univ : Finset I).erase p.source) f + (by simp [p.distinct.symm] : p.target∈(Finset.univ : Finset I).erase p.source) + have hc := p.signedWeight_cancel Q v + change f p.source + f p.target=0 at hc + linarith + +namespace FiniteModel + +omit [Fintype V] [DecidableEq A] in +theorem exists_minimal_signed (E : FiniteModel.{u} Q (K:=K)) : + ∃ F : FiniteModel.{u} Q (K:=K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q E.complex F.complex) ∧ + signedGeneratorVector Q E.complex=signedGeneratorVector Q F.complex := by + have h : ∀ n (B : FiniteModel.{u} Q (K:=K)), Fintype.card B.Index=n → + ∃ F : FiniteModel.{u} Q (K:=K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q B.complex F.complex) ∧ + signedGeneratorVector Q B.complex=signedGeneratorVector Q F.complex := by + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro B hn + by_cases hm : B.complex.IsMinimal Q + · exact ⟨B,hm,⟨HomotopyEquivalence.refl Q B.complex⟩,rfl⟩ + obtain ⟨p⟩ := scalarPivot_of_not_minimal Q B.complex hm + let C := ofComplex Q (p.reduced Q) + have hc : Fintype.card C.Index signedGeneratorVector Q E.complex) + (fun E F h => by obtain ⟨e⟩:=h; exact FiniteModel.signedGeneratorVector_homotopy Q E F e) + +omit [Fintype V] [DecidableEq A] in +lemma classSignedVector_mk (E : FiniteModel.{u} Q (K:=K)) : + classSignedVector Q (Quotient.mk (finiteHomotopySetoid Q) E)=signedGeneratorVector Q E.complex := rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveConeIndex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveConeIndex.lean index d2888b908334010ee9d925f289ab77d888e91d05..98a5c1bdb8a127942606c69ded8beea7c531b8fb 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveConeIndex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveConeIndex.lean @@ -1,94 +1,94 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.TestPlacement -import OAI.Topology.ArtinGroups.Complexes.CoconePlacement -import OAI.Topology.ArtinGroups.Complexes.Refl -import OAI.Topology.ArtinGroups.Quivers.SignDiagonal - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -open Matrix - -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - -def positiveConeIndex (f:Map Q E F) (α:V) : - ((TestIndex Q E.placement α ⊕ I) ⊕ (TestIndex Q F.placement α ⊕ J)) ≃ - (TestIndex Q (f.cone Q).placement α ⊕ (I ⊕ J)) where - toFun - | .inl (.inl p) => .inl ⟨.inl p.1,p.2⟩ - | .inl (.inr i) => .inr (.inl i) - | .inr (.inl p) => .inl ⟨.inr p.1,p.2⟩ - | .inr (.inr j) => .inr (.inr j) - invFun - | .inl ⟨.inl i,p⟩ => .inl (.inl ⟨i,p⟩) - | .inl ⟨.inr j,p⟩ => .inr (.inl ⟨j,p⟩) - | .inr (.inl i) => .inl (.inr i) - | .inr (.inr j) => .inr (.inr j) - left_inv := by intro k;rcases k with (p|i)|(p|j) <;> rfl - right_inv := by intro k;rcases k with ⟨i|j,p⟩|(i|j) <;> rfl - -def positiveConeSign (α:V) : - ((TestIndex Q E.placement α ⊕ I) ⊕ (TestIndex Q F.placement α ⊕ J)) → Bool - | .inl (.inl _) => true - | _ => false - -omit [DecidableEq I] [DecidableEq J] in -lemma positiveCone_placement (f:Map Q E F) (α:V) : - ((f.positiveTwist Q α).cone Q).placement = - (((f.cone Q).positiveTwist Q α).reindex Q (positiveConeIndex Q f α)).placement := by - funext k - rcases k with (p|i)|(p|j) <;> rfl - -lemma positiveCone_differential (f:Map Q E F) (α:V) - (i j:(TestIndex Q E.placement α ⊕ I) ⊕ (TestIndex Q F.placement α ⊕ J)) : - (if positiveConeSign Q (E:=E) (F:=F) α j then - -((((f.cone Q).positiveTwist Q α).reindex Q (positiveConeIndex Q f α)).differential i j) - else (((f.cone Q).positiveTwist Q α).reindex Q (positiveConeIndex Q f α)).differential i j) = - (if positiveConeSign Q (E:=E) (F:=F) α i then - -(((f.positiveTwist Q α).cone Q).differential i j) - else ((f.positiveTwist Q α).cone Q).differential i j) := by - rcases i with (p|i)|(p|i) <;> rcases j with (r|j)|(r|j) - · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * (-E.differential p.1 r.1)) r.2.val) • vertexId Q α)) = - -(-(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * E.differential p.1 r.1) r.2.val) • vertexId Q α))) - simp only [neg_neg,mul_neg,map_neg,Pi.neg_apply,neg_smul] - · change evaluationMatrix Q (f.cone Q).placement α ⟨.inl p.1,p.2⟩ (.inl j) = - -(-evaluationMatrix Q E.placement α p j) - simp only [evaluationMatrix,Sum.inl.injEq,neg_neg] - split_ifs <;> rfl - · rfl - · change evaluationMatrix Q (f.cone Q).placement α ⟨.inl p.1,p.2⟩ (.inr j) = -(0:Q.Zigzag K) - simp only [evaluationMatrix,Sum.inl_ne_inr,ite_false,neg_zero] - · change -(0:Q.Zigzag K)= -0 - simp only [neg_zero] - · rfl - · rfl - · rfl - · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * 0) r.2.val) • vertexId Q α))=0 - simp only [mul_zero,map_zero,Pi.zero_apply,zero_smul,neg_zero] - · change evaluationMatrix Q (f.cone Q).placement α ⟨.inr p.1,p.2⟩ (.inl j)=0 - simp only [evaluationMatrix,Sum.inr_ne_inl,ite_false] - · rfl - · change evaluationMatrix Q (f.cone Q).placement α ⟨.inr p.1,p.2⟩ (.inr j)= - evaluationMatrix Q F.placement α p j - simp only [evaluationMatrix,Sum.inr.injEq] - split_ifs <;> rfl - · change -(0:Q.Zigzag K)=0 - simp only [neg_zero] - · rfl - · rfl - · rfl - -noncomputable def positiveTwistCone (f:Map Q E F) (α:V) : - ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) ((f.positiveTwist Q α).cone Q) := - (reindexChainIsomorphism Q _ (positiveConeIndex Q f α)).trans Q - (signChainIsomorphism Q _ _ (positiveConeSign Q α) - (positiveCone_placement Q f α) (positiveCone_differential Q f α)) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.TestPlacement +import OAI.Topology.ArtinGroups.Complexes.CoconePlacement +import OAI.Topology.ArtinGroups.Complexes.Refl +import OAI.Topology.ArtinGroups.Quivers.SignDiagonal + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +open Matrix + +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + +def positiveConeIndex (f:Map Q E F) (α:V) : + ((TestIndex Q E.placement α ⊕ I) ⊕ (TestIndex Q F.placement α ⊕ J)) ≃ + (TestIndex Q (f.cone Q).placement α ⊕ (I ⊕ J)) where + toFun + | .inl (.inl p) => .inl ⟨.inl p.1,p.2⟩ + | .inl (.inr i) => .inr (.inl i) + | .inr (.inl p) => .inl ⟨.inr p.1,p.2⟩ + | .inr (.inr j) => .inr (.inr j) + invFun + | .inl ⟨.inl i,p⟩ => .inl (.inl ⟨i,p⟩) + | .inl ⟨.inr j,p⟩ => .inr (.inl ⟨j,p⟩) + | .inr (.inl i) => .inl (.inr i) + | .inr (.inr j) => .inr (.inr j) + left_inv := by intro k;rcases k with (p|i)|(p|j) <;> rfl + right_inv := by intro k;rcases k with ⟨i|j,p⟩|(i|j) <;> rfl + +def positiveConeSign (α:V) : + ((TestIndex Q E.placement α ⊕ I) ⊕ (TestIndex Q F.placement α ⊕ J)) → Bool + | .inl (.inl _) => true + | _ => false + +omit [DecidableEq I] [DecidableEq J] in +lemma positiveCone_placement (f:Map Q E F) (α:V) : + ((f.positiveTwist Q α).cone Q).placement = + (((f.cone Q).positiveTwist Q α).reindex Q (positiveConeIndex Q f α)).placement := by + funext k + rcases k with (p|i)|(p|j) <;> rfl + +lemma positiveCone_differential (f:Map Q E F) (α:V) + (i j:(TestIndex Q E.placement α ⊕ I) ⊕ (TestIndex Q F.placement α ⊕ J)) : + (if positiveConeSign Q (E:=E) (F:=F) α j then + -((((f.cone Q).positiveTwist Q α).reindex Q (positiveConeIndex Q f α)).differential i j) + else (((f.cone Q).positiveTwist Q α).reindex Q (positiveConeIndex Q f α)).differential i j) = + (if positiveConeSign Q (E:=E) (F:=F) α i then + -(((f.positiveTwist Q α).cone Q).differential i j) + else ((f.positiveTwist Q α).cone Q).differential i j) := by + rcases i with (p|i)|(p|i) <;> rcases j with (r|j)|(r|j) + · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * (-E.differential p.1 r.1)) r.2.val) • vertexId Q α)) = + -(-(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * E.differential p.1 r.1) r.2.val) • vertexId Q α))) + simp only [neg_neg,mul_neg,map_neg,Pi.neg_apply,neg_smul] + · change evaluationMatrix Q (f.cone Q).placement α ⟨.inl p.1,p.2⟩ (.inl j) = + -(-evaluationMatrix Q E.placement α p j) + simp only [evaluationMatrix,Sum.inl.injEq,neg_neg] + split_ifs <;> rfl + · rfl + · change evaluationMatrix Q (f.cone Q).placement α ⟨.inl p.1,p.2⟩ (.inr j) = -(0:Q.Zigzag K) + simp only [evaluationMatrix,Sum.inl_ne_inr,ite_false,neg_zero] + · change -(0:Q.Zigzag K)= -0 + simp only [neg_zero] + · rfl + · rfl + · rfl + · change -(-((pathCoordinates Q (pathBasis Q (K:=K) p.2.val * 0) r.2.val) • vertexId Q α))=0 + simp only [mul_zero,map_zero,Pi.zero_apply,zero_smul,neg_zero] + · change evaluationMatrix Q (f.cone Q).placement α ⟨.inr p.1,p.2⟩ (.inl j)=0 + simp only [evaluationMatrix,Sum.inr_ne_inl,ite_false] + · rfl + · change evaluationMatrix Q (f.cone Q).placement α ⟨.inr p.1,p.2⟩ (.inr j)= + evaluationMatrix Q F.placement α p j + simp only [evaluationMatrix,Sum.inr.injEq] + split_ifs <;> rfl + · change -(0:Q.Zigzag K)=0 + simp only [neg_zero] + · rfl + · rfl + · rfl + +noncomputable def positiveTwistCone (f:Map Q E F) (α:V) : + ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) ((f.positiveTwist Q α).cone Q) := + (reindexChainIsomorphism Q _ (positiveConeIndex Q f α)).trans Q + (signChainIsomorphism Q _ _ (positiveConeSign Q α) + (positiveCone_placement Q f α) (positiveCone_differential Q f α)) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveHomTransform.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveHomTransform.lean index e68c51056b4079db178d015902c723d82ef7c013..651b1cd56aa5c5f233e94c425db2533e2b4e0cf3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveHomTransform.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveHomTransform.lean @@ -1,170 +1,170 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseTwistDifferential -import OAI.Topology.ArtinGroups.Complexes.HomSpace - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [DecidableEq A] in -lemma testTransform_smul (p : I → GeneratorPlacement V) (q : J → GeneratorPlacement V) - (α : V) (r : K) (f : Matrix I J (Q.Zigzag K)) : - testTransform Q p q α (r • f) = r • testTransform Q p q α f := by - apply Matrix.ext - intro i j - simp only [testTransform, scalarCornerMatrix, testMatrix, Matrix.smul_apply, - mul_smul, coordinates_smul, smul_smul] - -omit [DecidableEq A] in -lemma testTransform_sub (p : I → GeneratorPlacement V) (q : J → GeneratorPlacement V) - (α : V) (f g : Matrix I J (Q.Zigzag K)) : - testTransform Q p q α (f - g) = - testTransform Q p q α f - testTransform Q p q α g := by - simp only [sub_eq_add_neg, testTransform_add, testTransform_neg] - -namespace BasedComplex -variable [Fintype I] [Fintype J] - -noncomputable def positiveHomTransform (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - (f : Matrix I J (Q.Zigzag K)) : - Matrix (TestIndex Q E.placement α ⊕ I) (TestIndex Q F.placement α ⊕ J) (Q.Zigzag K) := - Matrix.fromBlocks (cochainSign (K := K) n • testTransform Q E.placement F.placement α f) - 0 0 f - -noncomputable def negativeHomTransform (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - (f : Matrix I J (Q.Zigzag K)) : - Matrix (I ⊕ TestIndex Q E.placement α) (J ⊕ TestIndex Q F.placement α) (Q.Zigzag K) := - Matrix.fromBlocks f 0 0 - (cochainSign (K := K) n • testTransform Q E.placement F.placement α f) - -lemma positiveHomTransform_entries (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - ProjectiveEntries Q (E.positiveTwist Q α).placement (F.positiveTwist Q α).placement - (positiveHomTransform Q E F α n f) := by - have ht := projectiveEntries_smul Q (cochainSign (K := K) n) - (scalarCornerMatrix_entries Q α (testPlacement Q E.placement α) - (testPlacement Q F.placement α) (fun _ => rfl) (fun _ => rfl) - (testMatrix Q E.placement F.placement α f)) - constructor <;> intro i j <;> rcases i with i | i <;> rcases j with j | j - · exact ht.1 i j - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact hf.1 i j - · exact ht.2 i j - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact hf.2 i j - -lemma negativeHomTransform_entries (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - ProjectiveEntries Q (E.negativeTwist Q α).placement (F.negativeTwist Q α).placement - (negativeHomTransform Q E F α n f) := by - have ht := projectiveEntries_smul Q (cochainSign (K := K) n) - (scalarCornerMatrix_entries Q α (cotestPlacement Q E.placement α) - (cotestPlacement Q F.placement α) (fun _ => rfl) (fun _ => rfl) - (testMatrix Q E.placement F.placement α f)) - constructor <;> intro i j <;> rcases i with i | i <;> rcases j with j | j - · exact hf.1 i j - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact ht.1 i j - · exact hf.2 i j - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact ht.2 i j - -lemma positiveHomTransform_degree (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n v : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : MapDegree Q E.placement F.placement n v f) : - MapDegree Q (E.positiveTwist Q α).placement (F.positiveTwist Q α).placement n v - (positiveHomTransform Q E F α n f) := by - have ht := mapDegree_smul Q (cochainSign (K := K) n) (testMatrix_degree Q α hf) - intro i j - rcases i with i | i <;> rcases j with j | j - · constructor - · intro hc - apply (ht i j).1 - intro he - apply hc - change (testPlacement Q F.placement α j).cochain - 1 = - (testPlacement Q E.placement α i).cochain - 1 + n - omega - · exact (ht i j).2 - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact hf i j - -lemma negativeHomTransform_degree (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n v : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : MapDegree Q E.placement F.placement n v f) : - MapDegree Q (E.negativeTwist Q α).placement (F.negativeTwist Q α).placement n v - (negativeHomTransform Q E F α n f) := by - have ht := mapDegree_smul Q (cochainSign (K := K) n) (cotestMatrix_degree Q α hf) - intro i j - rcases i with i | i <;> rcases j with j | j - · exact hf i j - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · constructor - · intro hc - apply (ht i j).1 - intro he - apply hc - change (cotestPlacement Q F.placement α j).cochain + 1 = - (cotestPlacement Q E.placement α i).cochain + 1 + n - omega - · exact (ht i j).2 - -lemma positiveHomTransform_differential (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - homDifferential Q (E.positiveTwist Q α) (F.positiveTwist Q α) n - (positiveHomTransform Q E F α n f) = - positiveHomTransform Q E F α (n + 1) (homDifferential Q E F n f) := by - change (E.positiveTwist Q α).differential * positiveHomTransform Q E F α n f - - cochainSign (K := K) n • (positiveHomTransform Q E F α n f * (F.positiveTwist Q α).differential) = _ - rw [positiveTwist_differential, positiveTwist_differential] - unfold positiveHomTransform - rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_smul, - sub_eq_add_neg, Matrix.fromBlocks_neg, Matrix.fromBlocks_add] - simp only [← sub_eq_add_neg] - simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_smul, Matrix.smul_mul, - Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero, smul_zero, - testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hf, - evaluation_natural Q α hf, smul_smul, cochainSign_mul_self, one_smul, - sub_self, cochainSign_add_one, neg_zero] - congr 1 - simp [homDifferential, testTransform_sub, testTransform_smul, - smul_sub, smul_smul, cochainSign_mul_self, neg_smul, smul_neg] - -lemma negativeHomTransform_differential (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) - {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : - homDifferential Q (E.negativeTwist Q α) (F.negativeTwist Q α) n - (negativeHomTransform Q E F α n f) = - negativeHomTransform Q E F α (n + 1) (homDifferential Q E F n f) := by - change (E.negativeTwist Q α).differential * negativeHomTransform Q E F α n f - - cochainSign (K := K) n • (negativeHomTransform Q E F α n f * (F.negativeTwist Q α).differential) = _ - rw [negativeTwist_differential, negativeTwist_differential] - unfold negativeHomTransform - rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_smul, - sub_eq_add_neg, Matrix.fromBlocks_neg, Matrix.fromBlocks_add] - simp only [← sub_eq_add_neg] - simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_smul, Matrix.smul_mul, - Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero, smul_zero, - testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hf, - coevaluation_natural Q α hf, sub_self, cochainSign_add_one, neg_zero] - congr 1 - simp [homDifferential, testTransform_sub, testTransform_smul, - smul_sub, smul_smul, cochainSign_mul_self, neg_smul, smul_neg] - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseTwistDifferential +import OAI.Topology.ArtinGroups.Complexes.HomSpace + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [DecidableEq A] in +lemma testTransform_smul (p : I → GeneratorPlacement V) (q : J → GeneratorPlacement V) + (α : V) (r : K) (f : Matrix I J (Q.Zigzag K)) : + testTransform Q p q α (r • f) = r • testTransform Q p q α f := by + apply Matrix.ext + intro i j + simp only [testTransform, scalarCornerMatrix, testMatrix, Matrix.smul_apply, + mul_smul, coordinates_smul, smul_smul] + +omit [DecidableEq A] in +lemma testTransform_sub (p : I → GeneratorPlacement V) (q : J → GeneratorPlacement V) + (α : V) (f g : Matrix I J (Q.Zigzag K)) : + testTransform Q p q α (f - g) = + testTransform Q p q α f - testTransform Q p q α g := by + simp only [sub_eq_add_neg, testTransform_add, testTransform_neg] + +namespace BasedComplex +variable [Fintype I] [Fintype J] + +noncomputable def positiveHomTransform (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + (f : Matrix I J (Q.Zigzag K)) : + Matrix (TestIndex Q E.placement α ⊕ I) (TestIndex Q F.placement α ⊕ J) (Q.Zigzag K) := + Matrix.fromBlocks (cochainSign (K := K) n • testTransform Q E.placement F.placement α f) + 0 0 f + +noncomputable def negativeHomTransform (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + (f : Matrix I J (Q.Zigzag K)) : + Matrix (I ⊕ TestIndex Q E.placement α) (J ⊕ TestIndex Q F.placement α) (Q.Zigzag K) := + Matrix.fromBlocks f 0 0 + (cochainSign (K := K) n • testTransform Q E.placement F.placement α f) + +lemma positiveHomTransform_entries (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + ProjectiveEntries Q (E.positiveTwist Q α).placement (F.positiveTwist Q α).placement + (positiveHomTransform Q E F α n f) := by + have ht := projectiveEntries_smul Q (cochainSign (K := K) n) + (scalarCornerMatrix_entries Q α (testPlacement Q E.placement α) + (testPlacement Q F.placement α) (fun _ => rfl) (fun _ => rfl) + (testMatrix Q E.placement F.placement α f)) + constructor <;> intro i j <;> rcases i with i | i <;> rcases j with j | j + · exact ht.1 i j + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact hf.1 i j + · exact ht.2 i j + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact hf.2 i j + +lemma negativeHomTransform_entries (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + ProjectiveEntries Q (E.negativeTwist Q α).placement (F.negativeTwist Q α).placement + (negativeHomTransform Q E F α n f) := by + have ht := projectiveEntries_smul Q (cochainSign (K := K) n) + (scalarCornerMatrix_entries Q α (cotestPlacement Q E.placement α) + (cotestPlacement Q F.placement α) (fun _ => rfl) (fun _ => rfl) + (testMatrix Q E.placement F.placement α f)) + constructor <;> intro i j <;> rcases i with i | i <;> rcases j with j | j + · exact hf.1 i j + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact ht.1 i j + · exact hf.2 i j + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact ht.2 i j + +lemma positiveHomTransform_degree (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n v : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : MapDegree Q E.placement F.placement n v f) : + MapDegree Q (E.positiveTwist Q α).placement (F.positiveTwist Q α).placement n v + (positiveHomTransform Q E F α n f) := by + have ht := mapDegree_smul Q (cochainSign (K := K) n) (testMatrix_degree Q α hf) + intro i j + rcases i with i | i <;> rcases j with j | j + · constructor + · intro hc + apply (ht i j).1 + intro he + apply hc + change (testPlacement Q F.placement α j).cochain - 1 = + (testPlacement Q E.placement α i).cochain - 1 + n + omega + · exact (ht i j).2 + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact hf i j + +lemma negativeHomTransform_degree (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n v : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : MapDegree Q E.placement F.placement n v f) : + MapDegree Q (E.negativeTwist Q α).placement (F.negativeTwist Q α).placement n v + (negativeHomTransform Q E F α n f) := by + have ht := mapDegree_smul Q (cochainSign (K := K) n) (cotestMatrix_degree Q α hf) + intro i j + rcases i with i | i <;> rcases j with j | j + · exact hf i j + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · constructor + · intro hc + apply (ht i j).1 + intro he + apply hc + change (cotestPlacement Q F.placement α j).cochain + 1 = + (cotestPlacement Q E.placement α i).cochain + 1 + n + omega + · exact (ht i j).2 + +lemma positiveHomTransform_differential (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + homDifferential Q (E.positiveTwist Q α) (F.positiveTwist Q α) n + (positiveHomTransform Q E F α n f) = + positiveHomTransform Q E F α (n + 1) (homDifferential Q E F n f) := by + change (E.positiveTwist Q α).differential * positiveHomTransform Q E F α n f - + cochainSign (K := K) n • (positiveHomTransform Q E F α n f * (F.positiveTwist Q α).differential) = _ + rw [positiveTwist_differential, positiveTwist_differential] + unfold positiveHomTransform + rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_smul, + sub_eq_add_neg, Matrix.fromBlocks_neg, Matrix.fromBlocks_add] + simp only [← sub_eq_add_neg] + simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_smul, Matrix.smul_mul, + Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero, smul_zero, + testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hf, + evaluation_natural Q α hf, smul_smul, cochainSign_mul_self, one_smul, + sub_self, cochainSign_add_one, neg_zero] + congr 1 + simp [homDifferential, testTransform_sub, testTransform_smul, + smul_sub, smul_smul, cochainSign_mul_self, neg_smul, smul_neg] + +lemma negativeHomTransform_differential (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) (n : ℤ) + {f : Matrix I J (Q.Zigzag K)} (hf : ProjectiveEntries Q E.placement F.placement f) : + homDifferential Q (E.negativeTwist Q α) (F.negativeTwist Q α) n + (negativeHomTransform Q E F α n f) = + negativeHomTransform Q E F α (n + 1) (homDifferential Q E F n f) := by + change (E.negativeTwist Q α).differential * negativeHomTransform Q E F α n f - + cochainSign (K := K) n • (negativeHomTransform Q E F α n f * (F.negativeTwist Q α).differential) = _ + rw [negativeTwist_differential, negativeTwist_differential] + unfold negativeHomTransform + rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_smul, + sub_eq_add_neg, Matrix.fromBlocks_neg, Matrix.fromBlocks_add] + simp only [← sub_eq_add_neg] + simp only [Matrix.neg_mul, Matrix.mul_neg, Matrix.mul_smul, Matrix.smul_mul, + Matrix.mul_zero, Matrix.zero_mul, zero_add, add_zero, smul_zero, + testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hf, + coevaluation_natural Q α hf, sub_self, cochainSign_add_one, neg_zero] + congr 1 + simp [homDifferential, testTransform_sub, testTransform_smul, + smul_sub, smul_smul, cochainSign_mul_self, neg_smul, smul_neg] + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTopDivisor.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTopDivisor.lean index 4680217e9cd4cf6d31fe530d0d7726c04c2fcb56..5a77ff30c2077eb4ed9e93d66c19ca42d4184c30 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTopDivisor.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTopDivisor.lean @@ -1,77 +1,77 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -theorem positive_top_divisor (hn:∀ a,Q.source a≠Q.target a) - (U:Set V) - (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) - (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ) (hx:ClassTestUpper Q x U t) - (w:List V) : - (∀ s∈w,s∈U)→∀ β∈U,∀ l:ℤ,tw.length)).wf.induction - (C := fun w => (∀ s∈w,s∈U)→∀ β∈U,∀ l:ℤ,t?_) - intro hw β hβ l hl hout c htop - cases w with - | nil => exact (htop (hx β hβ l hl c)).elim - | cons α w => - have hα:α∈U:=hw α (by simp) - have hw':∀ s∈w,s∈U:=fun s hs=>hw s (List.mem_cons_of_mem _ hs) - by_cases he:β=α - · subst β - exact ⟨w,PositiveBraidRel.refl _⟩ - have htail:ClassTestUpper Q (positiveWordAction Q w x) U l := - classPositiveTwist_testUpper_reflect Q hn _ U α hα hout - have ha:∀ c,ClassTestExact Q α l c (positiveWordAction Q w x) := - (classPositiveTwist_testUpper_iff Q hn _ U α hα htail).mp hout - have hb:¬ClassTestExact Q β l c (positiveWordAction Q w x) := by - intro hz - exact htop (classTestExact_positive_other Q _ α β he l c (ha (c+1)) hz) - obtain ⟨v,hv⟩:=ih w (by change w.length<(α::w).length; simp) hw' β hβ l hl htail c hb - rcases hU α hα β hβ with heq | hrest - · exact (he heq.symm).elim - rcases hrest with ho | hedge - · exact ⟨α::v,PositiveBraidRel.trans (PositiveBraidRel.cons α hv) - (PositiveBraidRel.orthogonal ho v)⟩ - obtain ⟨edge⟩ := hedge - have hvU:∀ s∈v,s∈U := by - have hh:=PositiveBraidRel.mem_set Q hv U hw' - exact fun s hs=>hh s (List.mem_cons_of_mem _ hs) - have hvlen:v.length<(α::w).length := by - have hh:=PositiveBraidRel.length_eq Q hv - simp only [List.length_cons] at * - omega - have htail':ClassTestUpper Q (classPositiveTwist Q β (positiveWordAction Q v x)) U l := by - change ClassTestUpper Q (positiveWordAction Q (β::v) x) U l - rw [← PositiveBraidRel.action_eq Q hn hv x] - exact htail - have hvbound:ClassTestUpper Q (positiveWordAction Q v x) U l := - classPositiveTwist_testUpper_reflect Q hn _ U β hβ htail' - have htop':¬ClassTestExact Q β l c - (classPositiveTwist Q α (classPositiveTwist Q β (positiveWordAction Q v x))) := by - intro hz - apply htop - change ClassTestExact Q β l c (classPositiveTwist Q α (positiveWordAction Q w x)) - rw [PositiveBraidRel.action_eq Q hn hv x] - exact hz - have hαtop:¬ClassTestExact Q α l (c+1) (positiveWordAction Q v x) := - fun hz=>htop' ((classTestExact_positive_adjacent Q hn _ edge l c).mpr hz) - obtain ⟨z,hz⟩:=ih v hvlen hvU α hα l hl hvbound (c+1) hαtop - exact ⟨α::β::z,PositiveBraidRel.trans (PositiveBraidRel.cons α hv) - (PositiveBraidRel.trans (PositiveBraidRel.cons α (PositiveBraidRel.cons β hz)) - (PositiveBraidRel.adjacent edge z))⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +theorem positive_top_divisor (hn:∀ a,Q.source a≠Q.target a) + (U:Set V) + (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) + (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ) (hx:ClassTestUpper Q x U t) + (w:List V) : + (∀ s∈w,s∈U)→∀ β∈U,∀ l:ℤ,tw.length)).wf.induction + (C := fun w => (∀ s∈w,s∈U)→∀ β∈U,∀ l:ℤ,t?_) + intro hw β hβ l hl hout c htop + cases w with + | nil => exact (htop (hx β hβ l hl c)).elim + | cons α w => + have hα:α∈U:=hw α (by simp) + have hw':∀ s∈w,s∈U:=fun s hs=>hw s (List.mem_cons_of_mem _ hs) + by_cases he:β=α + · subst β + exact ⟨w,PositiveBraidRel.refl _⟩ + have htail:ClassTestUpper Q (positiveWordAction Q w x) U l := + classPositiveTwist_testUpper_reflect Q hn _ U α hα hout + have ha:∀ c,ClassTestExact Q α l c (positiveWordAction Q w x) := + (classPositiveTwist_testUpper_iff Q hn _ U α hα htail).mp hout + have hb:¬ClassTestExact Q β l c (positiveWordAction Q w x) := by + intro hz + exact htop (classTestExact_positive_other Q _ α β he l c (ha (c+1)) hz) + obtain ⟨v,hv⟩:=ih w (by change w.length<(α::w).length; simp) hw' β hβ l hl htail c hb + rcases hU α hα β hβ with heq | hrest + · exact (he heq.symm).elim + rcases hrest with ho | hedge + · exact ⟨α::v,PositiveBraidRel.trans (PositiveBraidRel.cons α hv) + (PositiveBraidRel.orthogonal ho v)⟩ + obtain ⟨edge⟩ := hedge + have hvU:∀ s∈v,s∈U := by + have hh:=PositiveBraidRel.mem_set Q hv U hw' + exact fun s hs=>hh s (List.mem_cons_of_mem _ hs) + have hvlen:v.length<(α::w).length := by + have hh:=PositiveBraidRel.length_eq Q hv + simp only [List.length_cons] at * + omega + have htail':ClassTestUpper Q (classPositiveTwist Q β (positiveWordAction Q v x)) U l := by + change ClassTestUpper Q (positiveWordAction Q (β::v) x) U l + rw [← PositiveBraidRel.action_eq Q hn hv x] + exact htail + have hvbound:ClassTestUpper Q (positiveWordAction Q v x) U l := + classPositiveTwist_testUpper_reflect Q hn _ U β hβ htail' + have htop':¬ClassTestExact Q β l c + (classPositiveTwist Q α (classPositiveTwist Q β (positiveWordAction Q v x))) := by + intro hz + apply htop + change ClassTestExact Q β l c (classPositiveTwist Q α (positiveWordAction Q w x)) + rw [PositiveBraidRel.action_eq Q hn hv x] + exact hz + have hαtop:¬ClassTestExact Q α l (c+1) (positiveWordAction Q v x) := + fun hz=>htop' ((classTestExact_positive_adjacent Q hn _ edge l c).mpr hz) + obtain ⟨z,hz⟩:=ih v hvlen hvU α hα l hl hvbound (c+1) hαtop + exact ⟨α::β::z,PositiveBraidRel.trans (PositiveBraidRel.cons α hv) + (PositiveBraidRel.trans (PositiveBraidRel.cons α (PositiveBraidRel.cons β hz)) + (PositiveBraidRel.adjacent edge z))⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistFiberEquiv.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistFiberEquiv.lean index 6be4ad3c6661736eff03a23749c67687e664c02f..d0a58f8c62aee02454e1321f94b82cb796a5dd82 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistFiberEquiv.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistFiberEquiv.lean @@ -1,62 +1,62 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.VertexMinimal - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] - -noncomputable def positiveTwistFiberEquiv (E : BasedComplex Q (K := K) I) - (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : - {i // E.placement i = a} ≃ {i // (E.positiveTwist Q α).placement i = a} := - Equiv.ofBijective (fun i => ⟨Sum.inr i.val, i.property⟩) (by - constructor - · intro i j h - exact Subtype.ext (Sum.inr.inj (congrArg Subtype.val h)) - · intro i - rcases i with ⟨i | i, hi⟩ - · exact (hα (congrArg GeneratorPlacement.color hi)).elim - · exact ⟨⟨i, hi⟩, rfl⟩) - -noncomputable def negativeTwistFiberEquiv (E : BasedComplex Q (K := K) I) - (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : - {i // E.placement i = a} ≃ {i // (E.negativeTwist Q α).placement i = a} := - Equiv.ofBijective (fun i => ⟨Sum.inl i.val, i.property⟩) (by - constructor - · intro i j h - exact Subtype.ext (Sum.inl.inj (congrArg Subtype.val h)) - · intro i - rcases i with ⟨i | i, hi⟩ - · exact ⟨⟨i, hi⟩, rfl⟩ - · exact (hα (congrArg GeneratorPlacement.color hi)).elim) - -theorem positiveTwist_exterior_multiplicity (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (α : V) (e : HomotopyEquivalence Q (E.positiveTwist Q α) F) - (a : GeneratorPlacement V) (hα : α ≠ a.color) : - F.multiplicity Q a = E.multiplicity Q a := by - calc - F.multiplicity Q a = (E.positiveTwist Q α).multiplicity Q a := - (multiplicity_eq_of_vertex_homotopyEquivalence Q _ _ e a - (positiveTwist_vertexMinimal Q E hE α a.color hα) - (fun i j => congrFun (hF i j) a.color)).symm - _ = E.multiplicity Q a := Nat.card_congr (positiveTwistFiberEquiv Q E α a hα).symm - -theorem negativeTwist_exterior_multiplicity (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (α : V) (e : HomotopyEquivalence Q (E.negativeTwist Q α) F) - (a : GeneratorPlacement V) (hα : α ≠ a.color) : - F.multiplicity Q a = E.multiplicity Q a := by - calc - F.multiplicity Q a = (E.negativeTwist Q α).multiplicity Q a := - (multiplicity_eq_of_vertex_homotopyEquivalence Q _ _ e a - (negativeTwist_vertexMinimal Q E hE α a.color hα) - (fun i j => congrFun (hF i j) a.color)).symm - _ = E.multiplicity Q a := Nat.card_congr (negativeTwistFiberEquiv Q E α a hα).symm - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.VertexMinimal + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] + +noncomputable def positiveTwistFiberEquiv (E : BasedComplex Q (K := K) I) + (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : + {i // E.placement i = a} ≃ {i // (E.positiveTwist Q α).placement i = a} := + Equiv.ofBijective (fun i => ⟨Sum.inr i.val, i.property⟩) (by + constructor + · intro i j h + exact Subtype.ext (Sum.inr.inj (congrArg Subtype.val h)) + · intro i + rcases i with ⟨i | i, hi⟩ + · exact (hα (congrArg GeneratorPlacement.color hi)).elim + · exact ⟨⟨i, hi⟩, rfl⟩) + +noncomputable def negativeTwistFiberEquiv (E : BasedComplex Q (K := K) I) + (α : V) (a : GeneratorPlacement V) (hα : α ≠ a.color) : + {i // E.placement i = a} ≃ {i // (E.negativeTwist Q α).placement i = a} := + Equiv.ofBijective (fun i => ⟨Sum.inl i.val, i.property⟩) (by + constructor + · intro i j h + exact Subtype.ext (Sum.inl.inj (congrArg Subtype.val h)) + · intro i + rcases i with ⟨i | i, hi⟩ + · exact ⟨⟨i, hi⟩, rfl⟩ + · exact (hα (congrArg GeneratorPlacement.color hi)).elim) + +theorem positiveTwist_exterior_multiplicity (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (α : V) (e : HomotopyEquivalence Q (E.positiveTwist Q α) F) + (a : GeneratorPlacement V) (hα : α ≠ a.color) : + F.multiplicity Q a = E.multiplicity Q a := by + calc + F.multiplicity Q a = (E.positiveTwist Q α).multiplicity Q a := + (multiplicity_eq_of_vertex_homotopyEquivalence Q _ _ e a + (positiveTwist_vertexMinimal Q E hE α a.color hα) + (fun i j => congrFun (hF i j) a.color)).symm + _ = E.multiplicity Q a := Nat.card_congr (positiveTwistFiberEquiv Q E α a hα).symm + +theorem negativeTwist_exterior_multiplicity (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (α : V) (e : HomotopyEquivalence Q (E.negativeTwist Q α) F) + (a : GeneratorPlacement V) (hα : α ≠ a.color) : + F.multiplicity Q a = E.multiplicity Q a := by + calc + F.multiplicity Q a = (E.negativeTwist Q α).multiplicity Q a := + (multiplicity_eq_of_vertex_homotopyEquivalence Q _ _ e a + (negativeTwist_vertexMinimal Q E hE α a.color hα) + (fun i j => congrFun (hF i j) a.color)).symm + _ = E.multiplicity Q a := Nat.card_congr (negativeTwistFiberEquiv Q E α a hα).symm + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistHomotopy.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistHomotopy.lean index 978e5f736a03118a51dfe638880e09f3dc729b72..ebf89db6527458d4ec7f72d444153cf0977e3498 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistHomotopy.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistHomotopy.lean @@ -1,237 +1,237 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Complexes.CoconePlacement -import OAI.Topology.ArtinGroups.Complexes.ConeMap -import OAI.Topology.ArtinGroups.Quivers.TestTransform - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] - -noncomputable def positiveTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) - (h : Matrix I I (Q.Zigzag K)) := - Matrix.fromBlocks (-testTransform Q E.placement E.placement α h) 0 0 h - -noncomputable def negativeTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) - (h : Matrix I I (Q.Zigzag K)) := - Matrix.fromBlocks h 0 0 (-testTransform Q E.placement E.placement α h) - -lemma positiveTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : - ProjectiveEntries Q (E.positiveTwist Q α).placement (E.positiveTwist Q α).placement - (positiveTwistHomotopy Q E α h) := by - have ht : ProjectiveEntries Q (testPlacement Q E.placement α) - (testPlacement Q E.placement α) (testTransform Q E.placement E.placement α h) := - scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ - constructor - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact (projectiveEntries_neg Q ht).1 i j - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact hh.1 i j - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact (projectiveEntries_neg Q ht).2 i j - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact hh.2 i j - -lemma negativeTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : - ProjectiveEntries Q (E.negativeTwist Q α).placement (E.negativeTwist Q α).placement - (negativeTwistHomotopy Q E α h) := by - have ht : ProjectiveEntries Q (cotestPlacement Q E.placement α) - (cotestPlacement Q E.placement α) (testTransform Q E.placement E.placement α h) := - scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ - constructor - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact hh.1 i j - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact (projectiveEntries_neg Q ht).1 i j - · intro i j - rcases i with i | i <;> rcases j with j | j - · exact hh.2 i j - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact (projectiveEntries_neg Q ht).2 i j - -lemma positiveTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : MapDegree Q E.placement E.placement (-1) 0 h) : - MapDegree Q (E.positiveTwist Q α).placement (E.positiveTwist Q α).placement (-1) 0 - (positiveTwistHomotopy Q E α h) := by - have ht := mapDegree_neg Q (testMatrix_degree Q α hh) - intro i j - rcases i with i | i <;> rcases j with j | j - · constructor - · intro hc - apply (ht i j).1 - intro he - apply hc - change (testPlacement Q E.placement α j).cochain - 1 = - (testPlacement Q E.placement α i).cochain - 1 + -1 - omega - · exact (ht i j).2 - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact hh i j - -lemma negativeTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : MapDegree Q E.placement E.placement (-1) 0 h) : - MapDegree Q (E.negativeTwist Q α).placement (E.negativeTwist Q α).placement (-1) 0 - (negativeTwistHomotopy Q E α h) := by - have ht := mapDegree_neg Q (cotestMatrix_degree Q α hh) - intro i j - rcases i with i | i <;> rcases j with j | j - · exact hh i j - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ - · constructor - · intro hc - apply (ht i j).1 - intro he - apply hc - change (cotestPlacement Q E.placement α j).cochain + 1 = - (cotestPlacement Q E.placement α i).cochain + 1 + -1 - omega - · exact (ht i j).2 - -lemma positiveTwistHomotopy_boundary (E : BasedComplex Q (K := K) I) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : - (E.positiveTwist Q α).differential * positiveTwistHomotopy Q E α h + - positiveTwistHomotopy Q E α h * (E.positiveTwist Q α).differential = - Matrix.fromBlocks - (testTransform Q E.placement E.placement α (E.differential * h + h * E.differential)) - 0 0 (E.differential * h + h * E.differential) := by - change Matrix.fromBlocks (-testTransform Q _ _ α E.differential) - (evaluationMatrix Q E.placement α) 0 E.differential * _ + - _ * Matrix.fromBlocks (-testTransform Q _ _ α E.differential) - (evaluationMatrix Q E.placement α) 0 E.differential = _ - unfold positiveTwistHomotopy - rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_add] - simp only [Matrix.neg_mul, Matrix.mul_neg, neg_neg, Matrix.mul_zero, Matrix.zero_mul, - zero_add, add_zero, neg_zero] - rw [testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hh, - evaluation_natural Q α hh, add_neg_cancel, testTransform_add] - -lemma negativeTwistHomotopy_boundary (E : BasedComplex Q (K := K) I) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : - (E.negativeTwist Q α).differential * negativeTwistHomotopy Q E α h + - negativeTwistHomotopy Q E α h * (E.negativeTwist Q α).differential = - Matrix.fromBlocks (E.differential * h + h * E.differential) 0 0 - (testTransform Q E.placement E.placement α (E.differential * h + h * E.differential)) := by - change Matrix.fromBlocks E.differential (coevaluationMatrix Q E.placement α) 0 - (-testTransform Q _ _ α E.differential) * _ + - _ * Matrix.fromBlocks E.differential (coevaluationMatrix Q E.placement α) 0 - (-testTransform Q _ _ α E.differential) = _ - unfold negativeTwistHomotopy - rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_add] - simp only [Matrix.neg_mul, Matrix.mul_neg, neg_neg, Matrix.mul_zero, Matrix.zero_mul, - zero_add, add_zero, neg_zero] - rw [testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hh, - coevaluation_natural Q α hh, neg_add_cancel, testTransform_add] - -lemma positiveTwist_identity [DecidableEq I] (E : BasedComplex Q (K := K) I) (α : V) : - projectiveIdentity Q (K := K) (E.positiveTwist Q α).placement = - Matrix.fromBlocks (testTransform Q E.placement E.placement α - (projectiveIdentity Q E.placement)) 0 0 (projectiveIdentity Q E.placement) := by - rw [testTransform_identity] - unfold projectiveIdentity - rw [Matrix.fromBlocks_diagonal] - congr 1 - funext i - rcases i with i | i <;> rfl - -lemma negativeTwist_identity [DecidableEq I] (E : BasedComplex Q (K := K) I) (α : V) : - projectiveIdentity Q (K := K) (E.negativeTwist Q α).placement = - Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 - (testTransform Q E.placement E.placement α (projectiveIdentity Q E.placement)) := by - rw [testTransform_identity] - unfold projectiveIdentity - rw [Matrix.fromBlocks_diagonal] - congr 1 - funext i - rcases i with i | i <;> rfl - -lemma positiveTwist_homotopy_equation [DecidableEq I] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : Map Q E F) (g : Map Q F E) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) - (he : f.matrix * g.matrix = projectiveIdentity Q E.placement + - (E.differential * h + h * E.differential)) : - (f.positiveTwist Q α).matrix * (g.positiveTwist Q α).matrix = - projectiveIdentity Q (E.positiveTwist Q α).placement + - ((E.positiveTwist Q α).differential * positiveTwistHomotopy Q E α h + - positiveTwistHomotopy Q E α h * (E.positiveTwist Q α).differential) := by - rw [positiveTwistHomotopy_boundary Q E α hh, positiveTwist_identity, - Matrix.fromBlocks_add] - change Matrix.fromBlocks (testTransform Q _ _ α f.matrix) 0 0 f.matrix * - Matrix.fromBlocks (testTransform Q _ _ α g.matrix) 0 0 g.matrix = _ - rw [Matrix.fromBlocks_multiply] - simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add] - rw [testTransform_mul Q α _ f.entries, he, testTransform_add] - -lemma negativeTwist_homotopy_equation [DecidableEq I] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : Map Q E F) (g : Map Q F E) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) - (he : f.matrix * g.matrix = projectiveIdentity Q E.placement + - (E.differential * h + h * E.differential)) : - (f.negativeTwist Q α).matrix * (g.negativeTwist Q α).matrix = - projectiveIdentity Q (E.negativeTwist Q α).placement + - ((E.negativeTwist Q α).differential * negativeTwistHomotopy Q E α h + - negativeTwistHomotopy Q E α h * (E.negativeTwist Q α).differential) := by - rw [negativeTwistHomotopy_boundary Q E α hh, negativeTwist_identity, - Matrix.fromBlocks_add] - change Matrix.fromBlocks f.matrix 0 0 (testTransform Q _ _ α f.matrix) * - Matrix.fromBlocks g.matrix 0 0 (testTransform Q _ _ α g.matrix) = _ - rw [Matrix.fromBlocks_multiply] - simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add] - rw [testTransform_mul Q α _ f.entries, he, testTransform_add] - -namespace HomotopyEquivalence - -variable [DecidableEq I] [DecidableEq J] - -noncomputable def positiveTwist {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (e : HomotopyEquivalence Q E F) (α : V) : - HomotopyEquivalence Q (E.positiveTwist Q α) (F.positiveTwist Q α) where - forward := e.forward.positiveTwist Q α - backward := e.backward.positiveTwist Q α - sourceHomotopy := positiveTwistHomotopy Q E α e.sourceHomotopy - targetHomotopy := positiveTwistHomotopy Q F α e.targetHomotopy - sourceEntries := positiveTwistHomotopy_entries Q E α e.sourceEntries - targetEntries := positiveTwistHomotopy_entries Q F α e.targetEntries - sourceDegree := positiveTwistHomotopy_degree Q E α e.sourceDegree - targetDegree := positiveTwistHomotopy_degree Q F α e.targetDegree - sourceEquation := positiveTwist_homotopy_equation Q e.forward e.backward α - e.sourceEntries e.sourceEquation - targetEquation := positiveTwist_homotopy_equation Q e.backward e.forward α - e.targetEntries e.targetEquation - -noncomputable def negativeTwist {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (e : HomotopyEquivalence Q E F) (α : V) : - HomotopyEquivalence Q (E.negativeTwist Q α) (F.negativeTwist Q α) where - forward := e.forward.negativeTwist Q α - backward := e.backward.negativeTwist Q α - sourceHomotopy := negativeTwistHomotopy Q E α e.sourceHomotopy - targetHomotopy := negativeTwistHomotopy Q F α e.targetHomotopy - sourceEntries := negativeTwistHomotopy_entries Q E α e.sourceEntries - targetEntries := negativeTwistHomotopy_entries Q F α e.targetEntries - sourceDegree := negativeTwistHomotopy_degree Q E α e.sourceDegree - targetDegree := negativeTwistHomotopy_degree Q F α e.targetDegree - sourceEquation := negativeTwist_homotopy_equation Q e.forward e.backward α - e.sourceEntries e.sourceEquation - targetEquation := negativeTwist_homotopy_equation Q e.backward e.forward α - e.targetEntries e.targetEquation - -end HomotopyEquivalence -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Complexes.CoconePlacement +import OAI.Topology.ArtinGroups.Complexes.ConeMap +import OAI.Topology.ArtinGroups.Quivers.TestTransform + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] + +noncomputable def positiveTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) + (h : Matrix I I (Q.Zigzag K)) := + Matrix.fromBlocks (-testTransform Q E.placement E.placement α h) 0 0 h + +noncomputable def negativeTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) + (h : Matrix I I (Q.Zigzag K)) := + Matrix.fromBlocks h 0 0 (-testTransform Q E.placement E.placement α h) + +lemma positiveTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : + ProjectiveEntries Q (E.positiveTwist Q α).placement (E.positiveTwist Q α).placement + (positiveTwistHomotopy Q E α h) := by + have ht : ProjectiveEntries Q (testPlacement Q E.placement α) + (testPlacement Q E.placement α) (testTransform Q E.placement E.placement α h) := + scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ + constructor + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact (projectiveEntries_neg Q ht).1 i j + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact hh.1 i j + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact (projectiveEntries_neg Q ht).2 i j + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact hh.2 i j + +lemma negativeTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : + ProjectiveEntries Q (E.negativeTwist Q α).placement (E.negativeTwist Q α).placement + (negativeTwistHomotopy Q E α h) := by + have ht : ProjectiveEntries Q (cotestPlacement Q E.placement α) + (cotestPlacement Q E.placement α) (testTransform Q E.placement E.placement α h) := + scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ + constructor + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact hh.1 i j + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact (projectiveEntries_neg Q ht).1 i j + · intro i j + rcases i with i | i <;> rcases j with j | j + · exact hh.2 i j + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact (projectiveEntries_neg Q ht).2 i j + +lemma positiveTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : MapDegree Q E.placement E.placement (-1) 0 h) : + MapDegree Q (E.positiveTwist Q α).placement (E.positiveTwist Q α).placement (-1) 0 + (positiveTwistHomotopy Q E α h) := by + have ht := mapDegree_neg Q (testMatrix_degree Q α hh) + intro i j + rcases i with i | i <;> rcases j with j | j + · constructor + · intro hc + apply (ht i j).1 + intro he + apply hc + change (testPlacement Q E.placement α j).cochain - 1 = + (testPlacement Q E.placement α i).cochain - 1 + -1 + omega + · exact (ht i j).2 + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact hh i j + +lemma negativeTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : MapDegree Q E.placement E.placement (-1) 0 h) : + MapDegree Q (E.negativeTwist Q α).placement (E.negativeTwist Q α).placement (-1) 0 + (negativeTwistHomotopy Q E α h) := by + have ht := mapDegree_neg Q (cotestMatrix_degree Q α hh) + intro i j + rcases i with i | i <;> rcases j with j | j + · exact hh i j + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · exact ⟨fun _ => rfl, homogeneous_zero Q _⟩ + · constructor + · intro hc + apply (ht i j).1 + intro he + apply hc + change (cotestPlacement Q E.placement α j).cochain + 1 = + (cotestPlacement Q E.placement α i).cochain + 1 + -1 + omega + · exact (ht i j).2 + +lemma positiveTwistHomotopy_boundary (E : BasedComplex Q (K := K) I) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : + (E.positiveTwist Q α).differential * positiveTwistHomotopy Q E α h + + positiveTwistHomotopy Q E α h * (E.positiveTwist Q α).differential = + Matrix.fromBlocks + (testTransform Q E.placement E.placement α (E.differential * h + h * E.differential)) + 0 0 (E.differential * h + h * E.differential) := by + change Matrix.fromBlocks (-testTransform Q _ _ α E.differential) + (evaluationMatrix Q E.placement α) 0 E.differential * _ + + _ * Matrix.fromBlocks (-testTransform Q _ _ α E.differential) + (evaluationMatrix Q E.placement α) 0 E.differential = _ + unfold positiveTwistHomotopy + rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_add] + simp only [Matrix.neg_mul, Matrix.mul_neg, neg_neg, Matrix.mul_zero, Matrix.zero_mul, + zero_add, add_zero, neg_zero] + rw [testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hh, + evaluation_natural Q α hh, add_neg_cancel, testTransform_add] + +lemma negativeTwistHomotopy_boundary (E : BasedComplex Q (K := K) I) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) : + (E.negativeTwist Q α).differential * negativeTwistHomotopy Q E α h + + negativeTwistHomotopy Q E α h * (E.negativeTwist Q α).differential = + Matrix.fromBlocks (E.differential * h + h * E.differential) 0 0 + (testTransform Q E.placement E.placement α (E.differential * h + h * E.differential)) := by + change Matrix.fromBlocks E.differential (coevaluationMatrix Q E.placement α) 0 + (-testTransform Q _ _ α E.differential) * _ + + _ * Matrix.fromBlocks E.differential (coevaluationMatrix Q E.placement α) 0 + (-testTransform Q _ _ α E.differential) = _ + unfold negativeTwistHomotopy + rw [Matrix.fromBlocks_multiply, Matrix.fromBlocks_multiply, Matrix.fromBlocks_add] + simp only [Matrix.neg_mul, Matrix.mul_neg, neg_neg, Matrix.mul_zero, Matrix.zero_mul, + zero_add, add_zero, neg_zero] + rw [testTransform_mul Q α _ E.entries, testTransform_mul Q α _ hh, + coevaluation_natural Q α hh, neg_add_cancel, testTransform_add] + +lemma positiveTwist_identity [DecidableEq I] (E : BasedComplex Q (K := K) I) (α : V) : + projectiveIdentity Q (K := K) (E.positiveTwist Q α).placement = + Matrix.fromBlocks (testTransform Q E.placement E.placement α + (projectiveIdentity Q E.placement)) 0 0 (projectiveIdentity Q E.placement) := by + rw [testTransform_identity] + unfold projectiveIdentity + rw [Matrix.fromBlocks_diagonal] + congr 1 + funext i + rcases i with i | i <;> rfl + +lemma negativeTwist_identity [DecidableEq I] (E : BasedComplex Q (K := K) I) (α : V) : + projectiveIdentity Q (K := K) (E.negativeTwist Q α).placement = + Matrix.fromBlocks (projectiveIdentity Q E.placement) 0 0 + (testTransform Q E.placement E.placement α (projectiveIdentity Q E.placement)) := by + rw [testTransform_identity] + unfold projectiveIdentity + rw [Matrix.fromBlocks_diagonal] + congr 1 + funext i + rcases i with i | i <;> rfl + +lemma positiveTwist_homotopy_equation [DecidableEq I] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : Map Q E F) (g : Map Q F E) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) + (he : f.matrix * g.matrix = projectiveIdentity Q E.placement + + (E.differential * h + h * E.differential)) : + (f.positiveTwist Q α).matrix * (g.positiveTwist Q α).matrix = + projectiveIdentity Q (E.positiveTwist Q α).placement + + ((E.positiveTwist Q α).differential * positiveTwistHomotopy Q E α h + + positiveTwistHomotopy Q E α h * (E.positiveTwist Q α).differential) := by + rw [positiveTwistHomotopy_boundary Q E α hh, positiveTwist_identity, + Matrix.fromBlocks_add] + change Matrix.fromBlocks (testTransform Q _ _ α f.matrix) 0 0 f.matrix * + Matrix.fromBlocks (testTransform Q _ _ α g.matrix) 0 0 g.matrix = _ + rw [Matrix.fromBlocks_multiply] + simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add] + rw [testTransform_mul Q α _ f.entries, he, testTransform_add] + +lemma negativeTwist_homotopy_equation [DecidableEq I] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : Map Q E F) (g : Map Q F E) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) + (he : f.matrix * g.matrix = projectiveIdentity Q E.placement + + (E.differential * h + h * E.differential)) : + (f.negativeTwist Q α).matrix * (g.negativeTwist Q α).matrix = + projectiveIdentity Q (E.negativeTwist Q α).placement + + ((E.negativeTwist Q α).differential * negativeTwistHomotopy Q E α h + + negativeTwistHomotopy Q E α h * (E.negativeTwist Q α).differential) := by + rw [negativeTwistHomotopy_boundary Q E α hh, negativeTwist_identity, + Matrix.fromBlocks_add] + change Matrix.fromBlocks f.matrix 0 0 (testTransform Q _ _ α f.matrix) * + Matrix.fromBlocks g.matrix 0 0 (testTransform Q _ _ α g.matrix) = _ + rw [Matrix.fromBlocks_multiply] + simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add] + rw [testTransform_mul Q α _ f.entries, he, testTransform_add] + +namespace HomotopyEquivalence + +variable [DecidableEq I] [DecidableEq J] + +noncomputable def positiveTwist {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (e : HomotopyEquivalence Q E F) (α : V) : + HomotopyEquivalence Q (E.positiveTwist Q α) (F.positiveTwist Q α) where + forward := e.forward.positiveTwist Q α + backward := e.backward.positiveTwist Q α + sourceHomotopy := positiveTwistHomotopy Q E α e.sourceHomotopy + targetHomotopy := positiveTwistHomotopy Q F α e.targetHomotopy + sourceEntries := positiveTwistHomotopy_entries Q E α e.sourceEntries + targetEntries := positiveTwistHomotopy_entries Q F α e.targetEntries + sourceDegree := positiveTwistHomotopy_degree Q E α e.sourceDegree + targetDegree := positiveTwistHomotopy_degree Q F α e.targetDegree + sourceEquation := positiveTwist_homotopy_equation Q e.forward e.backward α + e.sourceEntries e.sourceEquation + targetEquation := positiveTwist_homotopy_equation Q e.backward e.forward α + e.targetEntries e.targetEquation + +noncomputable def negativeTwist {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (e : HomotopyEquivalence Q E F) (α : V) : + HomotopyEquivalence Q (E.negativeTwist Q α) (F.negativeTwist Q α) where + forward := e.forward.negativeTwist Q α + backward := e.backward.negativeTwist Q α + sourceHomotopy := negativeTwistHomotopy Q E α e.sourceHomotopy + targetHomotopy := negativeTwistHomotopy Q F α e.targetHomotopy + sourceEntries := negativeTwistHomotopy_entries Q E α e.sourceEntries + targetEntries := negativeTwistHomotopy_entries Q F α e.targetEntries + sourceDegree := negativeTwistHomotopy_degree Q E α e.sourceDegree + targetDegree := negativeTwistHomotopy_degree Q F α e.targetDegree + sourceEquation := negativeTwist_homotopy_equation Q e.forward e.backward α + e.sourceEntries e.sourceEquation + targetEquation := negativeTwist_homotopy_equation Q e.backward e.forward α + e.targetEntries e.targetEquation + +end HomotopyEquivalence +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistLowerBound.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistLowerBound.lean index a7ad708832a438e1dc1002795044cb494ddc9429..2d47ae15c0bd3289d8e802292951ba72107c084e 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistLowerBound.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistLowerBound.lean @@ -1,83 +1,83 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ReducedAmplitudeTwistLevel -import OAI.Topology.ArtinGroups.Complexes.TokenShift -import OAI.Topology.ArtinGroups.Complexes.Test -import OAI.Topology.ArtinGroups.Complexes.UpperBound -import OAI.Topology.ArtinGroups.Complexes.LayerVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -theorem positiveTwist_lower_bound - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - {d:ℤ} (hE:∀ i,d≤(E.placement i).level) (α:V) (hF:F.IsMinimal Q) - (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) : - ∀ j,d≤(F.placement j).level := by - have reduction : HomotopyEquivalence Q (E.positiveTwist Q α) - (reducedAmplitudeTwist Q E α) := by - convert amplitudeTwistReduction Q E α using 1 - apply minimal_bound_transport Q (reducedAmplitudeTwist Q E α) F hF - ((reduction.symm Q).trans Q e) (fun p=>d≤p.level) - intro k - obtain ⟨i,hi⟩:=reducedAmplitudeTwist_level Q E α k - have hh:=hE i - rcases hi with hi|⟨hi,_⟩ <;> omega - -theorem positiveTwist_bottom_socle_zero - (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - {d:ℤ} (hE:∀ i,d≤(E.placement i).level) (α:V) (hF:F.IsMinimal Q) - (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) (c:ℤ) : - coefficientSocle Q (F.pureLayer Q hF d) α c=⊥ := by - let g:=((e.symm Q).test Q α).trans Q (positiveTwist_testShift Q hn E α) - apply bottomSocle_zero_of_test_equiv_above Q F hF - (positiveTwist_lower_bound Q E F hE α hF e) α ((E.testComplex Q α).tokenShift Q) g _ c - intro j - have hh:=hE j.1 - have hl:0≤Path.length j.2.val := by - rcases j.2.val with v|a|v <;> norm_num [Path.length] - dsimp only [GeneratorPlacement.level,tokenShift,testComplex,testPlacement] at * - omega - -theorem classPositiveTwist_lower_bound - (α:V) (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) : - ClassLowerBound Q d (classPositiveTwist Q α x) := by - let E:=minimalClassModel Q x - let y:=classPositiveTwist Q α x - let F:=minimalClassModel Q y - have he:classOfComplex Q (E.complex.positiveTwist Q α)=classOfComplex Q F.complex := by - change classPositiveTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex - have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x - have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y - rw [hE,hF] - obtain ⟨e⟩:=Quotient.exact he - exact positiveTwist_lower_bound Q E.complex F.complex hx α - (minimalClassModel_minimal Q y) e - -theorem classPositiveTwist_bottom_socle_zero - (hn:∀ a,Q.source a≠Q.target a) (α:V) - (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) (c:ℤ) : - classLayerSocleDimension Q d α c (classPositiveTwist Q α x)=0 := by - let E:=minimalClassModel Q x - let y:=classPositiveTwist Q α x - let F:=minimalClassModel Q y - have he:classOfComplex Q (E.complex.positiveTwist Q α)=classOfComplex Q F.complex := by - change classPositiveTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex - have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x - have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y - rw [hE,hF] - obtain ⟨e⟩:=Quotient.exact he - change Module.finrank K (coefficientSocle Q (F.complex.pureLayer Q - (minimalClassModel_minimal Q y) d) α c)=0 - rw [positiveTwist_bottom_socle_zero Q hn E.complex F.complex hx α - (minimalClassModel_minimal Q y) e c] - simp - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ReducedAmplitudeTwistLevel +import OAI.Topology.ArtinGroups.Complexes.TokenShift +import OAI.Topology.ArtinGroups.Complexes.Test +import OAI.Topology.ArtinGroups.Complexes.UpperBound +import OAI.Topology.ArtinGroups.Complexes.LayerVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +theorem positiveTwist_lower_bound + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + {d:ℤ} (hE:∀ i,d≤(E.placement i).level) (α:V) (hF:F.IsMinimal Q) + (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) : + ∀ j,d≤(F.placement j).level := by + have reduction : HomotopyEquivalence Q (E.positiveTwist Q α) + (reducedAmplitudeTwist Q E α) := by + convert amplitudeTwistReduction Q E α using 1 + apply minimal_bound_transport Q (reducedAmplitudeTwist Q E α) F hF + ((reduction.symm Q).trans Q e) (fun p=>d≤p.level) + intro k + obtain ⟨i,hi⟩:=reducedAmplitudeTwist_level Q E α k + have hh:=hE i + rcases hi with hi|⟨hi,_⟩ <;> omega + +theorem positiveTwist_bottom_socle_zero + (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + {d:ℤ} (hE:∀ i,d≤(E.placement i).level) (α:V) (hF:F.IsMinimal Q) + (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) (c:ℤ) : + coefficientSocle Q (F.pureLayer Q hF d) α c=⊥ := by + let g:=((e.symm Q).test Q α).trans Q (positiveTwist_testShift Q hn E α) + apply bottomSocle_zero_of_test_equiv_above Q F hF + (positiveTwist_lower_bound Q E F hE α hF e) α ((E.testComplex Q α).tokenShift Q) g _ c + intro j + have hh:=hE j.1 + have hl:0≤Path.length j.2.val := by + rcases j.2.val with v|a|v <;> norm_num [Path.length] + dsimp only [GeneratorPlacement.level,tokenShift,testComplex,testPlacement] at * + omega + +theorem classPositiveTwist_lower_bound + (α:V) (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) : + ClassLowerBound Q d (classPositiveTwist Q α x) := by + let E:=minimalClassModel Q x + let y:=classPositiveTwist Q α x + let F:=minimalClassModel Q y + have he:classOfComplex Q (E.complex.positiveTwist Q α)=classOfComplex Q F.complex := by + change classPositiveTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex + have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x + have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y + rw [hE,hF] + obtain ⟨e⟩:=Quotient.exact he + exact positiveTwist_lower_bound Q E.complex F.complex hx α + (minimalClassModel_minimal Q y) e + +theorem classPositiveTwist_bottom_socle_zero + (hn:∀ a,Q.source a≠Q.target a) (α:V) + (x:FiniteHomotopyClass Q (K:=K)) {d:ℤ} (hx:ClassLowerBound Q d x) (c:ℤ) : + classLayerSocleDimension Q d α c (classPositiveTwist Q α x)=0 := by + let E:=minimalClassModel Q x + let y:=classPositiveTwist Q α x + let F:=minimalClassModel Q y + have he:classOfComplex Q (E.complex.positiveTwist Q α)=classOfComplex Q F.complex := by + change classPositiveTwist Q α (classOfComplex Q E.complex)=classOfComplex Q F.complex + have hE:classOfComplex Q E.complex=x:=minimalClassModel_class Q x + have hF:classOfComplex Q F.complex=y:=minimalClassModel_class Q y + rw [hE,hF] + obtain ⟨e⟩:=Quotient.exact he + change Module.finrank K (coefficientSocle Q (F.complex.pureLayer Q + (minimalClassModel_minimal Q y) d) α c)=0 + rw [positiveTwist_bottom_socle_zero Q hn E.complex F.complex hx α + (minimalClassModel_minimal Q y) e c] + simp + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistModern.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistModern.lean index 24d79e62ceff86dfa3c99368a8544fb4bc66967e..cefb185d961a4bc9f9f2dc697e5b0decca9ea9c3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistModern.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistModern.lean @@ -1,98 +1,98 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.NegativeTwistModern -import OAI.Topology.ArtinGroups.Complexes.PositiveConeIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I:Type u} [Fintype I] [DecidableEq I] - -noncomputable def HomotopyEquivalence.positiveTwistModern - {J:Type u} [Fintype J] [DecidableEq J] - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (e:HomotopyEquivalence Q E F) (α:V) : - HomotopyEquivalence Q (E.positiveTwist Q α) (F.positiveTwist Q α) := by - convert e.positiveTwist Q α using 1 - -lemma positiveLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (α:V) : - classLayer Q q (classOfComplex Q ((lowerTruncation Q E hE q).positiveTwist Q α))= - classLayer Q q (classOfComplex Q (E.positiveTwist Q α)) := by - let f:=lowInclusion Q E _ (levelDownClosed Q E hE q) - let R:=upperTruncation Q E hE q - let G:=minimalClassModel Q (classOfComplex Q (R.positiveTwist Q α)) - let e₀:HomotopyEquivalence Q (R.positiveTwist Q α) G.complex:= - (minimalClassModelEquivalence Q (R.positiveTwist Q α)).symm Q - have hr:∀ i,q+1≤(R.placement i).level := by - intro i - have hi:=i.property - change ¬(E.placement i).level≤q at hi - change q+1≤(E.placement i).level - omega - have hg:∀ i,q+1≤(G.complex.placement i).level := - positiveTwist_lower_bound Q R G.complex hr α (minimalClassModel_minimal Q _) e₀ - have coneIso : ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) - ((f.positiveTwist Q α).cone Q) := by - convert positiveTwistCone Q f α using 1 - let e:HomotopyEquivalence Q ((f.positiveTwist Q α).cone Q) G.complex:= - ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q - (((lowConeReduction Q E (lowerLevelSet Q E q) (levelDownClosed Q E hE q)).positiveTwistModern Q α).trans Q e₀) - apply classLayer_eq_of_cone_equivalence Q (f.positiveTwist Q α) G.complex e q - intro i - have hi:=hg i - constructor <;> omega - -noncomputable def lowPureIndex (E:BasedComplex Q (K:=K) I) (q:ℤ) - (hE:∀ i,q≤(E.placement i).level) : - {i:I // (E.placement i).level=q} ≃ lowerLevelSet Q E q where - toFun i:=⟨i.val,le_of_eq i.property⟩ - invFun i:=⟨i.val,le_antisymm i.property (hE i.val)⟩ - left_inv _:=rfl - right_inv _:=rfl - -omit [Fintype V] [DecidableEq A] in -lemma lowRestriction_bottom_eq_layer (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (q:ℤ) (hlo:∀ i,q≤(E.placement i).level) : - classOfComplex Q (lowerTruncation Q E hE q)= - classLayer Q q (classOfComplex Q E) := by - have he:(lowerTruncation Q E hE q).reindex Q (lowPureIndex Q E q hlo)= - E.pureLayer Q hE q := by - apply ext_placement_differential Q <;> rfl - rw [classLayer_minimal] - exact (classOfComplex_reindex Q _ (lowPureIndex Q E q hlo)).trans (by rw [he]) - -lemma classPositiveTwist_bottom_layer (x:FiniteHomotopyClass Q (K:=K)) - (q:ℤ) (hfloor:ClassLowerBound Q q x) (α:V) : - classLayer Q q (classPositiveTwist Q α x)= - classLayer Q q (classPositiveTwist Q α (classLayer Q q x)) := by - let E:=minimalClassModel Q x - have hE:=minimalClassModel_minimal Q x - have hx:classOfComplex Q E.complex=x:=minimalClassModel_class Q x - have hl:=positiveLayer_lowerTruncation Q E.complex hE q α - have he:=lowRestriction_bottom_eq_layer Q E.complex hE q hfloor - change classLayer Q q (classPositiveTwist Q α (classOfComplex Q (lowerTruncation Q E.complex hE q)))= - classLayer Q q (classPositiveTwist Q α (classOfComplex Q E.complex)) at hl - rw [he,hx] at hl - exact hl.symm - -theorem positiveWord_bottom_layer (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - (q:ℤ) (hfloor:ClassLowerBound Q q x) : - classLayer Q q (positiveWordAction Q w x)= - classLayer Q q (positiveWordAction Q w (classLayer Q q x)) := by - induction w generalizing x with - | nil=>exact (classLayer_idempotent Q x q).symm - | cons α w ih=> - have hc:=classPositiveTwist_bottom_layer Q (positiveWordAction Q w x) q - (positiveWord_lower_bound Q w x hfloor) α - have hc':=classPositiveTwist_bottom_layer Q (positiveWordAction Q w (classLayer Q q x)) q - (positiveWord_lower_bound Q w _ (classLayer_lowerBound Q x q)) α - exact hc.trans ((congrArg (fun y=>classLayer Q q (classPositiveTwist Q α y)) - (ih x hfloor)).trans hc'.symm) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.NegativeTwistModern +import OAI.Topology.ArtinGroups.Complexes.PositiveConeIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I:Type u} [Fintype I] [DecidableEq I] + +noncomputable def HomotopyEquivalence.positiveTwistModern + {J:Type u} [Fintype J] [DecidableEq J] + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (e:HomotopyEquivalence Q E F) (α:V) : + HomotopyEquivalence Q (E.positiveTwist Q α) (F.positiveTwist Q α) := by + convert e.positiveTwist Q α using 1 + +lemma positiveLayer_lowerTruncation (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (α:V) : + classLayer Q q (classOfComplex Q ((lowerTruncation Q E hE q).positiveTwist Q α))= + classLayer Q q (classOfComplex Q (E.positiveTwist Q α)) := by + let f:=lowInclusion Q E _ (levelDownClosed Q E hE q) + let R:=upperTruncation Q E hE q + let G:=minimalClassModel Q (classOfComplex Q (R.positiveTwist Q α)) + let e₀:HomotopyEquivalence Q (R.positiveTwist Q α) G.complex:= + (minimalClassModelEquivalence Q (R.positiveTwist Q α)).symm Q + have hr:∀ i,q+1≤(R.placement i).level := by + intro i + have hi:=i.property + change ¬(E.placement i).level≤q at hi + change q+1≤(E.placement i).level + omega + have hg:∀ i,q+1≤(G.complex.placement i).level := + positiveTwist_lower_bound Q R G.complex hr α (minimalClassModel_minimal Q _) e₀ + have coneIso : ChainIsomorphism Q ((f.cone Q).positiveTwist Q α) + ((f.positiveTwist Q α).cone Q) := by + convert positiveTwistCone Q f α using 1 + let e:HomotopyEquivalence Q ((f.positiveTwist Q α).cone Q) G.complex:= + ((coneIso.toHomotopyEquivalence Q).symm Q).trans Q + (((lowConeReduction Q E (lowerLevelSet Q E q) (levelDownClosed Q E hE q)).positiveTwistModern Q α).trans Q e₀) + apply classLayer_eq_of_cone_equivalence Q (f.positiveTwist Q α) G.complex e q + intro i + have hi:=hg i + constructor <;> omega + +noncomputable def lowPureIndex (E:BasedComplex Q (K:=K) I) (q:ℤ) + (hE:∀ i,q≤(E.placement i).level) : + {i:I // (E.placement i).level=q} ≃ lowerLevelSet Q E q where + toFun i:=⟨i.val,le_of_eq i.property⟩ + invFun i:=⟨i.val,le_antisymm i.property (hE i.val)⟩ + left_inv _:=rfl + right_inv _:=rfl + +omit [Fintype V] [DecidableEq A] in +lemma lowRestriction_bottom_eq_layer (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (q:ℤ) (hlo:∀ i,q≤(E.placement i).level) : + classOfComplex Q (lowerTruncation Q E hE q)= + classLayer Q q (classOfComplex Q E) := by + have he:(lowerTruncation Q E hE q).reindex Q (lowPureIndex Q E q hlo)= + E.pureLayer Q hE q := by + apply ext_placement_differential Q <;> rfl + rw [classLayer_minimal] + exact (classOfComplex_reindex Q _ (lowPureIndex Q E q hlo)).trans (by rw [he]) + +lemma classPositiveTwist_bottom_layer (x:FiniteHomotopyClass Q (K:=K)) + (q:ℤ) (hfloor:ClassLowerBound Q q x) (α:V) : + classLayer Q q (classPositiveTwist Q α x)= + classLayer Q q (classPositiveTwist Q α (classLayer Q q x)) := by + let E:=minimalClassModel Q x + have hE:=minimalClassModel_minimal Q x + have hx:classOfComplex Q E.complex=x:=minimalClassModel_class Q x + have hl:=positiveLayer_lowerTruncation Q E.complex hE q α + have he:=lowRestriction_bottom_eq_layer Q E.complex hE q hfloor + change classLayer Q q (classPositiveTwist Q α (classOfComplex Q (lowerTruncation Q E.complex hE q)))= + classLayer Q q (classPositiveTwist Q α (classOfComplex Q E.complex)) at hl + rw [he,hx] at hl + exact hl.symm + +theorem positiveWord_bottom_layer (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + (q:ℤ) (hfloor:ClassLowerBound Q q x) : + classLayer Q q (positiveWordAction Q w x)= + classLayer Q q (positiveWordAction Q w (classLayer Q q x)) := by + induction w generalizing x with + | nil=>exact (classLayer_idempotent Q x q).symm + | cons α w ih=> + have hc:=classPositiveTwist_bottom_layer Q (positiveWordAction Q w x) q + (positiveWord_lower_bound Q w x hfloor) α + have hc':=classPositiveTwist_bottom_layer Q (positiveWordAction Q w (classLayer Q q x)) q + (positiveWord_lower_bound Q w _ (classLayer_lowerBound Q x q)) α + exact hc.trans ((congrArg (fun y=>classLayer Q q (classPositiveTwist Q α y)) + (ih x hfloor)).trans hc'.symm) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest.lean index 2c58935bc2065fd9ff761a61ff0fd00e54e70e15..8f34f72b8f00a46247ed4f3dcb66b36d341281fc 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest.lean @@ -1,89 +1,89 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential -import OAI.Topology.ArtinGroups.Complexes.TwistNewTestIndex -import OAI.Topology.ArtinGroups.Complexes.BottomScalarCycleInjective -import OAI.Topology.ArtinGroups.Complexes.BottomSocleZeroTest -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistLowerBound - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -omit [DecidableEq I] in -theorem positiveTwist_other_test_cycle_zero - (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d c:ℤ} - (hfloor:∀ i,d≤(E.placement i).level) (α β:V) (hne:β≠α) - (hα:coefficientSocle Q (E.pureLayer Q hE d) α (c+1)=⊥) - (hβ:coefficientSocle Q (E.pureLayer Q hE d) β c=⊥) - (y:TestIndex Q (E.positiveTwist Q α).placement β→K) - (hs:∀ i,¬ ((((E.positiveTwist Q α).testComplex Q β).placement i).level=d ∧ - (((E.positiveTwist Q α).testComplex Q β).placement i).cochain=c)→y i=0) - (hd:Matrix.vecMul y (((E.positiveTwist Q α).testComplex Q β).differential.map - (vertexHom Q β))=0) : y=0 := by - have hn:∀ p:Zigzag.CornerPath Q β α,∀ u:TestIndex Q E.placement α, - y (twistNewTestIndex Q E α β p u)=0 := by - intro p - have hl:=corner_other_length Q hne p - have hx:(fun u=>y (twistNewTestIndex Q E α β p u))=0 := by - apply bottom_test_cycle_zero_of_socle Q E hE hfloor α (c+1) hα - · intro i hi - apply hs - intro hh - apply hi - change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=d ∧ - (E.placement i.1).cochain=c+1 - change (E.placement i.1).cochain-1+ - ((E.placement i.1).internal+Path.length i.2.val+Path.length p.val)=d ∧ - (E.placement i.1).cochain-1=c at hh - omega - · rw [testComplex_vertex_differential Q E α] - funext v - have hh:=congrFun hd (twistNewTestIndex Q E α β p v) - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_new_differential Q E α β y p v] at hh - exact neg_eq_zero.mp hh - exact fun u=>congrFun hx u - have ho:(fun u=>y (twistOldTestIndex Q E α β u))=0 := by - apply bottom_test_cycle_zero_of_socle Q E hE hfloor β c hβ - · intro i hi - exact hs _ hi - · rw [testComplex_vertex_differential Q E β] - funext v - have hh:=congrFun hd (twistOldTestIndex Q E α β v) - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_old_differential Q E α β y hn v] at hh - exact hh - funext i - obtain ⟨i,p⟩:=i - rcases i with i|i - · exact hn p i - · exact congrFun ho ⟨i,p⟩ - -theorem positiveTwist_other_bottom_socle_zero - (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) - (F:BasedComplex Q (K:=K) J) (hF:F.IsMinimal Q) {d c:ℤ} - (hfloor:∀ i,d≤(E.placement i).level) (α β:V) (hne:β≠α) - (hα:coefficientSocle Q (E.pureLayer Q hE d) α (c+1)=⊥) - (hβ:coefficientSocle Q (E.pureLayer Q hE d) β c=⊥) - (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) : - coefficientSocle Q (F.pureLayer Q hF d) β c=⊥ := by - have hFl:=positiveTwist_lower_bound Q E F hfloor α hF e - apply bottomSocle_zero_of_test_cycle_zero Q F hF hFl β - intro y hs hd - apply bottom_scalar_cycle_transport Q (F.testComplex Q β) - ((E.positiveTwist Q α).testComplex Q β) ((e.symm Q).test Q β) β - (fun _=>rfl) _ (positiveTwist_other_test_cycle_zero Q E hE hfloor α β hne hα hβ) y hs hd - intro i - have hi:=hFl i.1 - have hl:0≤Path.length i.2.val := by - rcases i.2.val with v|a|v <;> norm_num [Path.length] - dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at * - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential +import OAI.Topology.ArtinGroups.Complexes.TwistNewTestIndex +import OAI.Topology.ArtinGroups.Complexes.BottomScalarCycleInjective +import OAI.Topology.ArtinGroups.Complexes.BottomSocleZeroTest +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistLowerBound + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +omit [DecidableEq I] in +theorem positiveTwist_other_test_cycle_zero + (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d c:ℤ} + (hfloor:∀ i,d≤(E.placement i).level) (α β:V) (hne:β≠α) + (hα:coefficientSocle Q (E.pureLayer Q hE d) α (c+1)=⊥) + (hβ:coefficientSocle Q (E.pureLayer Q hE d) β c=⊥) + (y:TestIndex Q (E.positiveTwist Q α).placement β→K) + (hs:∀ i,¬ ((((E.positiveTwist Q α).testComplex Q β).placement i).level=d ∧ + (((E.positiveTwist Q α).testComplex Q β).placement i).cochain=c)→y i=0) + (hd:Matrix.vecMul y (((E.positiveTwist Q α).testComplex Q β).differential.map + (vertexHom Q β))=0) : y=0 := by + have hn:∀ p:Zigzag.CornerPath Q β α,∀ u:TestIndex Q E.placement α, + y (twistNewTestIndex Q E α β p u)=0 := by + intro p + have hl:=corner_other_length Q hne p + have hx:(fun u=>y (twistNewTestIndex Q E α β p u))=0 := by + apply bottom_test_cycle_zero_of_socle Q E hE hfloor α (c+1) hα + · intro i hi + apply hs + intro hh + apply hi + change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=d ∧ + (E.placement i.1).cochain=c+1 + change (E.placement i.1).cochain-1+ + ((E.placement i.1).internal+Path.length i.2.val+Path.length p.val)=d ∧ + (E.placement i.1).cochain-1=c at hh + omega + · rw [testComplex_vertex_differential Q E α] + funext v + have hh:=congrFun hd (twistNewTestIndex Q E α β p v) + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_new_differential Q E α β y p v] at hh + exact neg_eq_zero.mp hh + exact fun u=>congrFun hx u + have ho:(fun u=>y (twistOldTestIndex Q E α β u))=0 := by + apply bottom_test_cycle_zero_of_socle Q E hE hfloor β c hβ + · intro i hi + exact hs _ hi + · rw [testComplex_vertex_differential Q E β] + funext v + have hh:=congrFun hd (twistOldTestIndex Q E α β v) + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_old_differential Q E α β y hn v] at hh + exact hh + funext i + obtain ⟨i,p⟩:=i + rcases i with i|i + · exact hn p i + · exact congrFun ho ⟨i,p⟩ + +theorem positiveTwist_other_bottom_socle_zero + (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) + (F:BasedComplex Q (K:=K) J) (hF:F.IsMinimal Q) {d c:ℤ} + (hfloor:∀ i,d≤(E.placement i).level) (α β:V) (hne:β≠α) + (hα:coefficientSocle Q (E.pureLayer Q hE d) α (c+1)=⊥) + (hβ:coefficientSocle Q (E.pureLayer Q hE d) β c=⊥) + (e:HomotopyEquivalence Q (E.positiveTwist Q α) F) : + coefficientSocle Q (F.pureLayer Q hF d) β c=⊥ := by + have hFl:=positiveTwist_lower_bound Q E F hfloor α hF e + apply bottomSocle_zero_of_test_cycle_zero Q F hF hFl β + intro y hs hd + apply bottom_scalar_cycle_transport Q (F.testComplex Q β) + ((E.positiveTwist Q α).testComplex Q β) ((e.symm Q).test Q β) β + (fun _=>rfl) _ (positiveTwist_other_test_cycle_zero Q E hE hfloor α β hne hα hβ) y hs hd + intro i + have hi:=hFl i.1 + have hl:0≤Path.length i.2.val := by + rcases i.2.val with v|a|v <;> norm_num [Path.length] + dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at * + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest2.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest2.lean index 2037f8a1ac3ba39013fbe69a2b86706c21362859..bb795b59474d5c78f27fc52311d74cc75dc48327 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest2.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest2.lean @@ -1,145 +1,145 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential -import OAI.Topology.ArtinGroups.Complexes.TwistNewTestIndex -import OAI.Topology.ArtinGroups.Complexes.ScalarSupported - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -omit [DecidableEq I] in -theorem positiveTwist_other_test_exact - (E:BasedComplex Q (K:=K) I) (α β:V) (hne:β≠α) (l c:ℤ) - (hα:ScalarExactAt Q (E.testComplex Q α) α l (c+1)) - (hβ:ScalarExactAt Q (E.testComplex Q β) β l c) : - ScalarExactAt Q ((E.positiveTwist Q α).testComplex Q β) β l c := by - classical - intro y hs hd - let T:=(E.positiveTwist Q α).testComplex Q β - let D:=T.differential.map (vertexHom Q β) - have hx:∀ p:Zigzag.CornerPath Q β α,∃ z:TestIndex Q E.placement α→K, - ScalarSupported Q (E.testComplex Q α) (l-1) c z ∧ - Matrix.vecMul z ((E.testComplex Q α).differential.map (vertexHom Q α))= - fun u=>y (twistNewTestIndex Q E α β p u) := by - intro p - have hl:=corner_other_length Q hne p - suffices hh:∃ z:TestIndex Q E.placement α→K, - ScalarSupported Q (E.testComplex Q α) (l-1) (c+1-1) z ∧ - Matrix.vecMul z ((E.testComplex Q α).differential.map (vertexHom Q α))= - fun u=>y (twistNewTestIndex Q E α β p u) from by - simpa only [add_sub_cancel_right] using hh - apply hα - · intro i hi - apply hs - intro hh - apply hi - change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=l ∧ - (E.placement i.1).cochain=c+1 - change (E.placement i.1).cochain-1+ - ((E.placement i.1).internal+Path.length i.2.val+Path.length p.val)=l ∧ - (E.placement i.1).cochain-1=c at hh - omega - · rw [testComplex_vertex_differential Q E α] - funext v - have hh:=congrFun hd (twistNewTestIndex Q E α β p v) - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_new_differential Q E α β y p v] at hh - exact neg_eq_zero.mp hh - choose z hzs hzd using hx - let Z:TestIndex Q (E.positiveTwist Q α).placement β→K := - fun ⟨i,p⟩=>match i with - | .inl u=> -z p u - | .inr _=>0 - have hZs:ScalarSupported Q T (l-1) (c-1) Z := by - rintro ⟨i,p⟩ hi - rcases i with u|i - · change -z p u=0 - rw [hzs p u,neg_zero] - intro hh - apply hi - have hl:=corner_other_length Q hne p - change (E.placement u.1).cochain-1+ - ((E.placement u.1).internal+Path.length u.2.val+Path.length p.val)=l-1 ∧ - (E.placement u.1).cochain-1=c-1 - change (E.placement u.1).cochain+ - ((E.placement u.1).internal+Path.length u.2.val)=l-1 ∧ - (E.placement u.1).cochain=c at hh - omega - · rfl - have hZn:∀ p u,Matrix.vecMul Z D (twistNewTestIndex Q E α β p u)= - y (twistNewTestIndex Q E α β p u) := by - intro p u - dsimp only [D,T] - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_new_differential Q E α β Z p u] - change -Matrix.vecMul (-(z p)) (testMatrix Q E.placement E.placement α E.differential) u=_ - rw [Matrix.neg_vecMul,Pi.neg_apply,neg_neg] - have hh:=congrFun (hzd p) u - rwa [testComplex_vertex_differential Q E α] at hh - let r:=y-Matrix.vecMul Z D - have hrn:∀ p u,r (twistNewTestIndex Q E α β p u)=0 := by - intro p u - change y _-Matrix.vecMul Z D _=0 - rw [hZn,sub_self] - have hrs:ScalarSupported Q T l c r := by - apply scalarSupported_sub Q T hs - convert scalarSupported_map Q T T β T.differential T.entries T.degree hZs using 1 <;> - omega - have hrd:Matrix.vecMul r D=0 := by - change Matrix.vecMul (y-Matrix.vecMul Z D) D=0 - rw [Matrix.sub_vecMul,hd,Matrix.vecMul_vecMul,scalarDifferential_square Q T β, - Matrix.vecMul_zero,sub_self] - have hro:Matrix.vecMul (fun u=>r (twistOldTestIndex Q E α β u)) - ((E.testComplex Q β).differential.map (vertexHom Q β))=0 := by - rw [testComplex_vertex_differential Q E β] - funext v - have hh:=congrFun hrd (twistOldTestIndex Q E α β v) - change Matrix.vecMul r (T.differential.map (vertexHom Q β)) _=0 at hh - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_old_differential Q E α β r hrn v] at hh - exact hh - obtain ⟨w,hws,hwd⟩:=hβ (fun u=>r (twistOldTestIndex Q E α β u)) - (fun u hu=>hrs _ hu) hro - let W:TestIndex Q (E.positiveTwist Q α).placement β→K := - fun ⟨i,p⟩=>match i with - | .inl _=>0 - | .inr i=>w ⟨i,p⟩ - have hWn:∀ p u,W (twistNewTestIndex Q E α β p u)=0:=fun _ _=>rfl - have hWs:ScalarSupported Q T (l-1) (c-1) W := by - rintro ⟨i,p⟩ hi - rcases i with u|i - · rfl - · exact hws ⟨i,p⟩ hi - have hWd:Matrix.vecMul W D=r := by - funext i - obtain ⟨i,p⟩:=i - rcases i with u|i - · change Zigzag.CornerPath Q β α at p - change Matrix.vecMul W (T.differential.map (vertexHom Q β)) - (twistNewTestIndex Q E α β p u)=r (twistNewTestIndex Q E α β p u) - rw [hrn,testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_new_differential Q E α β W p u] - change -Matrix.vecMul (0:TestIndex Q E.placement α→K) _ u=0 - rw [Matrix.zero_vecMul,Pi.zero_apply,neg_zero] - · change Zigzag.CornerPath Q β (E.placement i).color at p - change Matrix.vecMul W (T.differential.map (vertexHom Q β)) - (twistOldTestIndex Q E α β ⟨i,p⟩)=r (twistOldTestIndex Q E α β ⟨i,p⟩) - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_old_differential Q E α β W hWn ⟨i,p⟩] - have hh:=congrFun hwd ⟨i,p⟩ - rwa [testComplex_vertex_differential Q E β] at hh - refine ⟨Z+W,?_,?_⟩ - · intro i hi - change Z i+W i=0 - rw [hZs i hi,hWs i hi,add_zero] - · change Matrix.vecMul (Z+W) D=y - rw [Matrix.add_vecMul,hWd] - change Matrix.vecMul Z D+(y-Matrix.vecMul Z D)=y - abel - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential +import OAI.Topology.ArtinGroups.Complexes.TwistNewTestIndex +import OAI.Topology.ArtinGroups.Complexes.ScalarSupported + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +omit [DecidableEq I] in +theorem positiveTwist_other_test_exact + (E:BasedComplex Q (K:=K) I) (α β:V) (hne:β≠α) (l c:ℤ) + (hα:ScalarExactAt Q (E.testComplex Q α) α l (c+1)) + (hβ:ScalarExactAt Q (E.testComplex Q β) β l c) : + ScalarExactAt Q ((E.positiveTwist Q α).testComplex Q β) β l c := by + classical + intro y hs hd + let T:=(E.positiveTwist Q α).testComplex Q β + let D:=T.differential.map (vertexHom Q β) + have hx:∀ p:Zigzag.CornerPath Q β α,∃ z:TestIndex Q E.placement α→K, + ScalarSupported Q (E.testComplex Q α) (l-1) c z ∧ + Matrix.vecMul z ((E.testComplex Q α).differential.map (vertexHom Q α))= + fun u=>y (twistNewTestIndex Q E α β p u) := by + intro p + have hl:=corner_other_length Q hne p + suffices hh:∃ z:TestIndex Q E.placement α→K, + ScalarSupported Q (E.testComplex Q α) (l-1) (c+1-1) z ∧ + Matrix.vecMul z ((E.testComplex Q α).differential.map (vertexHom Q α))= + fun u=>y (twistNewTestIndex Q E α β p u) from by + simpa only [add_sub_cancel_right] using hh + apply hα + · intro i hi + apply hs + intro hh + apply hi + change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=l ∧ + (E.placement i.1).cochain=c+1 + change (E.placement i.1).cochain-1+ + ((E.placement i.1).internal+Path.length i.2.val+Path.length p.val)=l ∧ + (E.placement i.1).cochain-1=c at hh + omega + · rw [testComplex_vertex_differential Q E α] + funext v + have hh:=congrFun hd (twistNewTestIndex Q E α β p v) + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_new_differential Q E α β y p v] at hh + exact neg_eq_zero.mp hh + choose z hzs hzd using hx + let Z:TestIndex Q (E.positiveTwist Q α).placement β→K := + fun ⟨i,p⟩=>match i with + | .inl u=> -z p u + | .inr _=>0 + have hZs:ScalarSupported Q T (l-1) (c-1) Z := by + rintro ⟨i,p⟩ hi + rcases i with u|i + · change -z p u=0 + rw [hzs p u,neg_zero] + intro hh + apply hi + have hl:=corner_other_length Q hne p + change (E.placement u.1).cochain-1+ + ((E.placement u.1).internal+Path.length u.2.val+Path.length p.val)=l-1 ∧ + (E.placement u.1).cochain-1=c-1 + change (E.placement u.1).cochain+ + ((E.placement u.1).internal+Path.length u.2.val)=l-1 ∧ + (E.placement u.1).cochain=c at hh + omega + · rfl + have hZn:∀ p u,Matrix.vecMul Z D (twistNewTestIndex Q E α β p u)= + y (twistNewTestIndex Q E α β p u) := by + intro p u + dsimp only [D,T] + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_new_differential Q E α β Z p u] + change -Matrix.vecMul (-(z p)) (testMatrix Q E.placement E.placement α E.differential) u=_ + rw [Matrix.neg_vecMul,Pi.neg_apply,neg_neg] + have hh:=congrFun (hzd p) u + rwa [testComplex_vertex_differential Q E α] at hh + let r:=y-Matrix.vecMul Z D + have hrn:∀ p u,r (twistNewTestIndex Q E α β p u)=0 := by + intro p u + change y _-Matrix.vecMul Z D _=0 + rw [hZn,sub_self] + have hrs:ScalarSupported Q T l c r := by + apply scalarSupported_sub Q T hs + convert scalarSupported_map Q T T β T.differential T.entries T.degree hZs using 1 <;> + omega + have hrd:Matrix.vecMul r D=0 := by + change Matrix.vecMul (y-Matrix.vecMul Z D) D=0 + rw [Matrix.sub_vecMul,hd,Matrix.vecMul_vecMul,scalarDifferential_square Q T β, + Matrix.vecMul_zero,sub_self] + have hro:Matrix.vecMul (fun u=>r (twistOldTestIndex Q E α β u)) + ((E.testComplex Q β).differential.map (vertexHom Q β))=0 := by + rw [testComplex_vertex_differential Q E β] + funext v + have hh:=congrFun hrd (twistOldTestIndex Q E α β v) + change Matrix.vecMul r (T.differential.map (vertexHom Q β)) _=0 at hh + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_old_differential Q E α β r hrn v] at hh + exact hh + obtain ⟨w,hws,hwd⟩:=hβ (fun u=>r (twistOldTestIndex Q E α β u)) + (fun u hu=>hrs _ hu) hro + let W:TestIndex Q (E.positiveTwist Q α).placement β→K := + fun ⟨i,p⟩=>match i with + | .inl _=>0 + | .inr i=>w ⟨i,p⟩ + have hWn:∀ p u,W (twistNewTestIndex Q E α β p u)=0:=fun _ _=>rfl + have hWs:ScalarSupported Q T (l-1) (c-1) W := by + rintro ⟨i,p⟩ hi + rcases i with u|i + · rfl + · exact hws ⟨i,p⟩ hi + have hWd:Matrix.vecMul W D=r := by + funext i + obtain ⟨i,p⟩:=i + rcases i with u|i + · change Zigzag.CornerPath Q β α at p + change Matrix.vecMul W (T.differential.map (vertexHom Q β)) + (twistNewTestIndex Q E α β p u)=r (twistNewTestIndex Q E α β p u) + rw [hrn,testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_new_differential Q E α β W p u] + change -Matrix.vecMul (0:TestIndex Q E.placement α→K) _ u=0 + rw [Matrix.zero_vecMul,Pi.zero_apply,neg_zero] + · change Zigzag.CornerPath Q β (E.placement i).color at p + change Matrix.vecMul W (T.differential.map (vertexHom Q β)) + (twistOldTestIndex Q E α β ⟨i,p⟩)=r (twistOldTestIndex Q E α β ⟨i,p⟩) + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_old_differential Q E α β W hWn ⟨i,p⟩] + have hh:=congrFun hwd ⟨i,p⟩ + rwa [testComplex_vertex_differential Q E β] at hh + refine ⟨Z+W,?_,?_⟩ + · intro i hi + change Z i+W i=0 + rw [hZs i hi,hWs i hi,add_zero] + · change Matrix.vecMul (Z+W) D=y + rw [Matrix.add_vecMul,hWd] + change Matrix.vecMul Z D+(y-Matrix.vecMul Z D)=y + abel + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest3.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest3.lean index d6b12d2362d2d1fa6cf21359910f7685e86ee69d..9ad98bc5782c5d8cb70bc5226fea452bfe657be5 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest3.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistOtherTest3.lean @@ -1,130 +1,130 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential -import OAI.Topology.ArtinGroups.Complexes.TwistNewTestIndex -import OAI.Topology.ArtinGroups.Complexes.ScalarSupported - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -omit [DecidableEq I] in -theorem positiveTwist_other_test_exact_reflect - (E:BasedComplex Q (K:=K) I) (α β:V) (hne:β≠α) (l c:ℤ) - (hα:ScalarExactAt Q (E.testComplex Q α) α (l-1) c) - (hT:ScalarExactAt Q ((E.positiveTwist Q α).testComplex Q β) β l c) : - ScalarExactAt Q (E.testComplex Q β) β l c := by - classical - intro x hs hd - let T:=(E.positiveTwist Q α).testComplex Q β - let D:=T.differential.map (vertexHom Q β) - let X:TestIndex Q (E.positiveTwist Q α).placement β→K := - fun ⟨i,p⟩=>match i with - | .inl _=>0 - | .inr i=>x ⟨i,p⟩ - have hXn:∀ p u,X (twistNewTestIndex Q E α β p u)=0:=fun _ _=>rfl - have hXs:ScalarSupported Q T l c X := by - rintro ⟨i,p⟩ hi - rcases i with u|i - · rfl - · exact hs ⟨i,p⟩ hi - have hXd:Matrix.vecMul X D=0 := by - funext v - obtain ⟨i,p⟩:=v - rcases i with u|i - · change Zigzag.CornerPath Q β α at p - change Matrix.vecMul X (T.differential.map (vertexHom Q β)) - (twistNewTestIndex Q E α β p u)=0 - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_new_differential Q E α β X p u] - change -Matrix.vecMul (0:TestIndex Q E.placement α→K) _ u=0 - rw [Matrix.zero_vecMul,Pi.zero_apply,neg_zero] - · change Zigzag.CornerPath Q β (E.placement i).color at p - change Matrix.vecMul X (T.differential.map (vertexHom Q β)) - (twistOldTestIndex Q E α β ⟨i,p⟩)=0 - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_old_differential Q E α β X hXn ⟨i,p⟩] - have hh:=congrFun hd ⟨i,p⟩ - rwa [testComplex_vertex_differential Q E β] at hh - obtain ⟨z,hzs,hzd⟩:=hT X hXs hXd - have hx:∀ p:Zigzag.CornerPath Q β α,∃ a:TestIndex Q E.placement α→K, - ScalarSupported Q (E.testComplex Q α) (l-1-1) (c-1) a ∧ - Matrix.vecMul a ((E.testComplex Q α).differential.map (vertexHom Q α))= - fun u=>z (twistNewTestIndex Q E α β p u) := by - intro p - have hl:=corner_other_length Q hne p - apply hα - · intro i hi - apply hzs - intro hh - apply hi - change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=l-1 ∧ - (E.placement i.1).cochain=c - change (E.placement i.1).cochain-1+ - ((E.placement i.1).internal+Path.length i.2.val+Path.length p.val)=l-1 ∧ - (E.placement i.1).cochain-1=c-1 at hh - omega - · rw [testComplex_vertex_differential Q E α] - funext v - have hh:=congrFun hzd (twistNewTestIndex Q E α β p v) - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_new_differential Q E α β z p v,hXn p v] at hh - exact neg_eq_zero.mp hh - choose a has had using hx - let B:TestIndex Q (E.positiveTwist Q α).placement β→K := - fun ⟨i,p⟩=>match i with - | .inl u=> -a p u - | .inr _=>0 - have hBs:ScalarSupported Q T (l-1-1) (c-1-1) B := by - rintro ⟨i,p⟩ hi - rcases i with u|i - · change -a p u=0 - rw [has p u,neg_zero] - intro hh - apply hi - have hl:=corner_other_length Q hne p - change (E.placement u.1).cochain-1+ - ((E.placement u.1).internal+Path.length u.2.val+Path.length p.val)=l-1-1 ∧ - (E.placement u.1).cochain-1=c-1-1 - change (E.placement u.1).cochain+ - ((E.placement u.1).internal+Path.length u.2.val)=l-1-1 ∧ - (E.placement u.1).cochain=c-1 at hh - omega - · rfl - have hBn:∀ p u,Matrix.vecMul B D (twistNewTestIndex Q E α β p u)= - z (twistNewTestIndex Q E α β p u) := by - intro p u - dsimp only [D,T] - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_new_differential Q E α β B p u] - change -Matrix.vecMul (-(a p)) (testMatrix Q E.placement E.placement α E.differential) u=_ - rw [Matrix.neg_vecMul,Pi.neg_apply,neg_neg] - have hh:=congrFun (had p) u - rwa [testComplex_vertex_differential Q E α] at hh - let r:=z-Matrix.vecMul B D - have hrn:∀ p u,r (twistNewTestIndex Q E α β p u)=0 := by - intro p u - change z _-Matrix.vecMul B D _=0 - rw [hBn,sub_self] - have hrs:ScalarSupported Q T (l-1) (c-1) r := by - apply scalarSupported_sub Q T hzs - convert scalarSupported_map Q T T β T.differential T.entries T.degree hBs using 1 <;> - omega - have hrd:Matrix.vecMul r D=X := by - change Matrix.vecMul (z-Matrix.vecMul B D) D=X - rw [Matrix.sub_vecMul,hzd,Matrix.vecMul_vecMul,scalarDifferential_square Q T β, - Matrix.vecMul_zero,sub_zero] - refine ⟨fun u=>r (twistOldTestIndex Q E α β u),fun u hu=>hrs _ hu,?_⟩ - rw [testComplex_vertex_differential Q E β] - funext v - have hh:=congrFun hrd (twistOldTestIndex Q E α β v) - change Matrix.vecMul r (T.differential.map (vertexHom Q β)) _=x v at hh - rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, - twistTest_old_differential Q E α β r hrn v] at hh - exact hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential +import OAI.Topology.ArtinGroups.Complexes.TwistNewTestIndex +import OAI.Topology.ArtinGroups.Complexes.ScalarSupported + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +omit [DecidableEq I] in +theorem positiveTwist_other_test_exact_reflect + (E:BasedComplex Q (K:=K) I) (α β:V) (hne:β≠α) (l c:ℤ) + (hα:ScalarExactAt Q (E.testComplex Q α) α (l-1) c) + (hT:ScalarExactAt Q ((E.positiveTwist Q α).testComplex Q β) β l c) : + ScalarExactAt Q (E.testComplex Q β) β l c := by + classical + intro x hs hd + let T:=(E.positiveTwist Q α).testComplex Q β + let D:=T.differential.map (vertexHom Q β) + let X:TestIndex Q (E.positiveTwist Q α).placement β→K := + fun ⟨i,p⟩=>match i with + | .inl _=>0 + | .inr i=>x ⟨i,p⟩ + have hXn:∀ p u,X (twistNewTestIndex Q E α β p u)=0:=fun _ _=>rfl + have hXs:ScalarSupported Q T l c X := by + rintro ⟨i,p⟩ hi + rcases i with u|i + · rfl + · exact hs ⟨i,p⟩ hi + have hXd:Matrix.vecMul X D=0 := by + funext v + obtain ⟨i,p⟩:=v + rcases i with u|i + · change Zigzag.CornerPath Q β α at p + change Matrix.vecMul X (T.differential.map (vertexHom Q β)) + (twistNewTestIndex Q E α β p u)=0 + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_new_differential Q E α β X p u] + change -Matrix.vecMul (0:TestIndex Q E.placement α→K) _ u=0 + rw [Matrix.zero_vecMul,Pi.zero_apply,neg_zero] + · change Zigzag.CornerPath Q β (E.placement i).color at p + change Matrix.vecMul X (T.differential.map (vertexHom Q β)) + (twistOldTestIndex Q E α β ⟨i,p⟩)=0 + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_old_differential Q E α β X hXn ⟨i,p⟩] + have hh:=congrFun hd ⟨i,p⟩ + rwa [testComplex_vertex_differential Q E β] at hh + obtain ⟨z,hzs,hzd⟩:=hT X hXs hXd + have hx:∀ p:Zigzag.CornerPath Q β α,∃ a:TestIndex Q E.placement α→K, + ScalarSupported Q (E.testComplex Q α) (l-1-1) (c-1) a ∧ + Matrix.vecMul a ((E.testComplex Q α).differential.map (vertexHom Q α))= + fun u=>z (twistNewTestIndex Q E α β p u) := by + intro p + have hl:=corner_other_length Q hne p + apply hα + · intro i hi + apply hzs + intro hh + apply hi + change (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val)=l-1 ∧ + (E.placement i.1).cochain=c + change (E.placement i.1).cochain-1+ + ((E.placement i.1).internal+Path.length i.2.val+Path.length p.val)=l-1 ∧ + (E.placement i.1).cochain-1=c-1 at hh + omega + · rw [testComplex_vertex_differential Q E α] + funext v + have hh:=congrFun hzd (twistNewTestIndex Q E α β p v) + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_new_differential Q E α β z p v,hXn p v] at hh + exact neg_eq_zero.mp hh + choose a has had using hx + let B:TestIndex Q (E.positiveTwist Q α).placement β→K := + fun ⟨i,p⟩=>match i with + | .inl u=> -a p u + | .inr _=>0 + have hBs:ScalarSupported Q T (l-1-1) (c-1-1) B := by + rintro ⟨i,p⟩ hi + rcases i with u|i + · change -a p u=0 + rw [has p u,neg_zero] + intro hh + apply hi + have hl:=corner_other_length Q hne p + change (E.placement u.1).cochain-1+ + ((E.placement u.1).internal+Path.length u.2.val+Path.length p.val)=l-1-1 ∧ + (E.placement u.1).cochain-1=c-1-1 + change (E.placement u.1).cochain+ + ((E.placement u.1).internal+Path.length u.2.val)=l-1-1 ∧ + (E.placement u.1).cochain=c-1 at hh + omega + · rfl + have hBn:∀ p u,Matrix.vecMul B D (twistNewTestIndex Q E α β p u)= + z (twistNewTestIndex Q E α β p u) := by + intro p u + dsimp only [D,T] + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_new_differential Q E α β B p u] + change -Matrix.vecMul (-(a p)) (testMatrix Q E.placement E.placement α E.differential) u=_ + rw [Matrix.neg_vecMul,Pi.neg_apply,neg_neg] + have hh:=congrFun (had p) u + rwa [testComplex_vertex_differential Q E α] at hh + let r:=z-Matrix.vecMul B D + have hrn:∀ p u,r (twistNewTestIndex Q E α β p u)=0 := by + intro p u + change z _-Matrix.vecMul B D _=0 + rw [hBn,sub_self] + have hrs:ScalarSupported Q T (l-1) (c-1) r := by + apply scalarSupported_sub Q T hzs + convert scalarSupported_map Q T T β T.differential T.entries T.degree hBs using 1 <;> + omega + have hrd:Matrix.vecMul r D=X := by + change Matrix.vecMul (z-Matrix.vecMul B D) D=X + rw [Matrix.sub_vecMul,hzd,Matrix.vecMul_vecMul,scalarDifferential_square Q T β, + Matrix.vecMul_zero,sub_zero] + refine ⟨fun u=>r (twistOldTestIndex Q E α β u),fun u hu=>hrs _ hu,?_⟩ + rw [testComplex_vertex_differential Q E β] + funext v + have hh:=congrFun hrd (twistOldTestIndex Q E α β v) + change Matrix.vecMul r (T.differential.map (vertexHom Q β)) _=x v at hh + rw [testComplex_vertex_differential Q (E.positiveTwist Q α) β, + twistTest_old_differential Q E α β r hrn v] at hh + exact hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistRaisedGenerator.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistRaisedGenerator.lean index d2c8da236834fed131cff212df65b1d86e73da49..6a8315efb923f9774e112b26a21a8227fae30862 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistRaisedGenerator.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistRaisedGenerator.lean @@ -1,118 +1,118 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ReducedAmplitudeTwistLevel -import OAI.Topology.ArtinGroups.Quivers.TokenTestVector -import OAI.Topology.ArtinGroups.Complexes.MinimalGeneratorDualCycle -import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDualRestrict - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -theorem positiveTwist_raised_generator_top_at_cap - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - {l : ℤ} (hE : ∀ i, (E.placement i).level≤l) (α:V) - (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.positiveTwist Q α) F) - (j:J) (hj : (F.placement j).level=l+1) (hα : (F.placement j).color=α) : - ∃ x : I → K, x ∈ coefficientTopDual Q E α ((F.placement j).cochain+1) ∧ x≠0 ∧ - ∀ i, (E.placement i).level≠l → x i=0 := by - obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_dual_cycle Q (E.positiveTwist Q α) F hF e j - have hxold i : x (Sum.inr i)=0 := by - apply hxs - intro he - have hl := congrArg GeneratorPlacement.level he - change (E.placement i).level = (F.placement j).level at hl - have hb := hE i - rw [hj] at hl - omega - let y : TestIndex Q E.placement α → K := fun i => x (Sum.inl i) - have hplace (i : TestIndex Q E.placement α) - (he : (E.positiveTwist Q α).placement (Sum.inl i)=F.placement j) : - (E.placement i.1).cochain=(F.placement j).cochain+1 ∧ - Path.length i.2.val=2 ∧ (E.placement i.1).level=l := by - have hc := congrArg GeneratorPlacement.cochain he - have hu := congrArg GeneratorPlacement.internal he - change (E.placement i.1).cochain-1=(F.placement j).cochain at hc - change (E.placement i.1).internal+Path.length i.2.val=(F.placement j).internal at hu - have hl := hE i.1 - have hr : Path.length i.2.val≤2 := by - rcases Path.length_cases i.2.val with h|h|h <;> omega - dsimp only [GeneratorPlacement.level] at hl hj ⊢ - exact ⟨by omega,by omega,by omega⟩ - have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain+1 ∧ - Path.length i.2.val=2) → y i=0 := by - intro hi - apply hxs - intro he - exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ - have hyd : Matrix.vecMul y - (testMatrix Q E.placement E.placement α E.differential).transpose=0 := by - funext i - have hh := hxd (Sum.inl i) - rw [hα,Fintype.sum_sum_type] at hh - have ht k : ((E.positiveTwist Q α).differential (Sum.inl i) (Sum.inl k)).vertex α = - -testMatrix Q E.placement E.placement α E.differential i k := by - change (-(scalarCornerMatrix Q α - (testMatrix Q E.placement E.placement α E.differential)) i k).vertex α = _ - change -(testMatrix Q E.placement E.placement α E.differential i k * - (vertexId Q (K := K) α).vertex α) = _ - simp [vertexId_eval] - simp only [ht,hxold,MulZeroClass.mul_zero,Finset.sum_const_zero,add_zero, - neg_mul,Finset.sum_neg_distrib,neg_eq_zero] at hh - simpa only [Matrix.vecMul,Matrix.transpose_apply,dotProduct,mul_comm,Pi.zero_apply] using hh - have hy : y ∈ topTestCycles Q E α ((F.placement j).cochain+1) := ⟨hys,hyd⟩ - refine ⟨sumTokenTest Q E.placement α y, sumTokenTest_top Q E α _ hy, ?_, ?_⟩ - · intro hz - have hyz : y=0 := by - rw [← tokenTestVector_sum Q E.placement α _ y hys,hz,map_zero] - apply hx - funext i - rcases i with i|i - · exact congrFun hyz i - · exact hxold i - · intro i hi - apply Finset.sum_eq_zero - intro z hz - apply hxs - intro he - exact hi (hplace ⟨i,z⟩ he).2.2 - -theorem positiveTwist_cap_of_top_zero - (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} - (hE : ∀ i, (E.placement i).level≤l) (α:V) - (htop : ∀ c, coefficientTopDual Q (E.pureLayer Q hmin l) α c=⊥) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.positiveTwist Q α) F.complex) ∧ - ∀ j, (F.complex.placement j).level≤l := by - let B := FiniteModel.ofComplex Q (reducedAmplitudeTwist Q E α) - obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q - have reduction : HomotopyEquivalence Q (E.positiveTwist Q α) - (reducedAmplitudeTwist Q E α) := by - convert amplitudeTwistReduction Q E α using 1 - let e' := reduction.trans Q e - refine ⟨F,hF,⟨e'⟩,?_⟩ - intro j - by_contra hb - have hloc : ∃ i:I, - (F.complex.placement j).level=(E.placement i).level ∨ - ((F.complex.placement j).level=(E.placement i).level+1 ∧ - (F.complex.placement j).color=α) := by - rw [hf j] - exact reducedAmplitudeTwist_level Q E α (f j) - obtain ⟨i,hi⟩ := hloc - have hbound := hE i - rcases hi with hi|⟨hi,hα⟩ - · omega - · have hj : (F.complex.placement j).level=l+1 := by omega - obtain ⟨x,hx,hxz,hs⟩ := positiveTwist_raised_generator_top_at_cap Q E F.complex hE α hF e' j hj hα - have hm := coefficientTopDual_restrict_layer Q E hmin l α _ hx hs - have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs - rw [htop] at hm - exact hn ((Submodule.mem_bot K).mp hm) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ReducedAmplitudeTwistLevel +import OAI.Topology.ArtinGroups.Quivers.TokenTestVector +import OAI.Topology.ArtinGroups.Complexes.MinimalGeneratorDualCycle +import OAI.Topology.ArtinGroups.Complexes.CoefficientTopDualRestrict + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J : Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +theorem positiveTwist_raised_generator_top_at_cap + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + {l : ℤ} (hE : ∀ i, (E.placement i).level≤l) (α:V) + (hF : F.IsMinimal Q) (e : HomotopyEquivalence Q (E.positiveTwist Q α) F) + (j:J) (hj : (F.placement j).level=l+1) (hα : (F.placement j).color=α) : + ∃ x : I → K, x ∈ coefficientTopDual Q E α ((F.placement j).cochain+1) ∧ x≠0 ∧ + ∀ i, (E.placement i).level≠l → x i=0 := by + obtain ⟨x,hx,hxs,hxd⟩ := minimal_generator_dual_cycle Q (E.positiveTwist Q α) F hF e j + have hxold i : x (Sum.inr i)=0 := by + apply hxs + intro he + have hl := congrArg GeneratorPlacement.level he + change (E.placement i).level = (F.placement j).level at hl + have hb := hE i + rw [hj] at hl + omega + let y : TestIndex Q E.placement α → K := fun i => x (Sum.inl i) + have hplace (i : TestIndex Q E.placement α) + (he : (E.positiveTwist Q α).placement (Sum.inl i)=F.placement j) : + (E.placement i.1).cochain=(F.placement j).cochain+1 ∧ + Path.length i.2.val=2 ∧ (E.placement i.1).level=l := by + have hc := congrArg GeneratorPlacement.cochain he + have hu := congrArg GeneratorPlacement.internal he + change (E.placement i.1).cochain-1=(F.placement j).cochain at hc + change (E.placement i.1).internal+Path.length i.2.val=(F.placement j).internal at hu + have hl := hE i.1 + have hr : Path.length i.2.val≤2 := by + rcases Path.length_cases i.2.val with h|h|h <;> omega + dsimp only [GeneratorPlacement.level] at hl hj ⊢ + exact ⟨by omega,by omega,by omega⟩ + have hys i : ¬ ((E.placement i.1).cochain=(F.placement j).cochain+1 ∧ + Path.length i.2.val=2) → y i=0 := by + intro hi + apply hxs + intro he + exact hi ⟨(hplace i he).1,(hplace i he).2.1⟩ + have hyd : Matrix.vecMul y + (testMatrix Q E.placement E.placement α E.differential).transpose=0 := by + funext i + have hh := hxd (Sum.inl i) + rw [hα,Fintype.sum_sum_type] at hh + have ht k : ((E.positiveTwist Q α).differential (Sum.inl i) (Sum.inl k)).vertex α = + -testMatrix Q E.placement E.placement α E.differential i k := by + change (-(scalarCornerMatrix Q α + (testMatrix Q E.placement E.placement α E.differential)) i k).vertex α = _ + change -(testMatrix Q E.placement E.placement α E.differential i k * + (vertexId Q (K := K) α).vertex α) = _ + simp [vertexId_eval] + simp only [ht,hxold,MulZeroClass.mul_zero,Finset.sum_const_zero,add_zero, + neg_mul,Finset.sum_neg_distrib,neg_eq_zero] at hh + simpa only [Matrix.vecMul,Matrix.transpose_apply,dotProduct,mul_comm,Pi.zero_apply] using hh + have hy : y ∈ topTestCycles Q E α ((F.placement j).cochain+1) := ⟨hys,hyd⟩ + refine ⟨sumTokenTest Q E.placement α y, sumTokenTest_top Q E α _ hy, ?_, ?_⟩ + · intro hz + have hyz : y=0 := by + rw [← tokenTestVector_sum Q E.placement α _ y hys,hz,map_zero] + apply hx + funext i + rcases i with i|i + · exact congrFun hyz i + · exact hxold i + · intro i hi + apply Finset.sum_eq_zero + intro z hz + apply hxs + intro he + exact hi (hplace ⟨i,z⟩ he).2.2 + +theorem positiveTwist_cap_of_top_zero + (E : BasedComplex Q (K := K) I) (hmin : E.IsMinimal Q) {l : ℤ} + (hE : ∀ i, (E.placement i).level≤l) (α:V) + (htop : ∀ c, coefficientTopDual Q (E.pureLayer Q hmin l) α c=⊥) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.positiveTwist Q α) F.complex) ∧ + ∀ j, (F.complex.placement j).level≤l := by + let B := FiniteModel.ofComplex Q (reducedAmplitudeTwist Q E α) + obtain ⟨F,hF,⟨e⟩,f,hf⟩ := B.exists_minimal_embedding Q + have reduction : HomotopyEquivalence Q (E.positiveTwist Q α) + (reducedAmplitudeTwist Q E α) := by + convert amplitudeTwistReduction Q E α using 1 + let e' := reduction.trans Q e + refine ⟨F,hF,⟨e'⟩,?_⟩ + intro j + by_contra hb + have hloc : ∃ i:I, + (F.complex.placement j).level=(E.placement i).level ∨ + ((F.complex.placement j).level=(E.placement i).level+1 ∧ + (F.complex.placement j).color=α) := by + rw [hf j] + exact reducedAmplitudeTwist_level Q E α (f j) + obtain ⟨i,hi⟩ := hloc + have hbound := hE i + rcases hi with hi|⟨hi,hα⟩ + · omega + · have hj : (F.complex.placement j).level=l+1 := by omega + obtain ⟨x,hx,hxz,hs⟩ := positiveTwist_raised_generator_top_at_cap Q E F.complex hE α hF e' j hj hα + have hm := coefficientTopDual_restrict_layer Q E hmin l α _ hx hs + have hn := coefficientTopDual_restrict_layer_ne_zero Q E l hxz hs + rw [htop] at hm + exact hn ((Submodule.mem_bot K).mp hm) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistUnshiftedLayer.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistUnshiftedLayer.lean index d7543f4a96ae9c660a840816523cc75e501aa365..b2df74acedbcb3cb95dbda485008053b2e281c9d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistUnshiftedLayer.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveTwistUnshiftedLayer.lean @@ -1,41 +1,41 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistModern -import OAI.Topology.ArtinGroups.Complexes.LayerSocleDimensionLayer -import OAI.Topology.ArtinGroups.Complexes.HighConeRetainedPure - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -theorem classPositiveTwist_unshifted_layer (x:FiniteHomotopyClass Q (K:=K)) - (q:ℤ) (α:V) (ht:∀ c,classLayerTopDimension Q (q-1) α c x=0) : - classLayer Q q (classPositiveTwist Q α x)= - classLayer Q q (classPositiveTwist Q α (classLayer Q q x)) := by - let E:=(minimalClassModel Q x).complex - have hE:E.IsMinimal Q:=minimalClassModel_minimal Q x - have hx:classOfComplex Q E=x:=minimalClassModel_class Q x - let L:=lowerTruncation Q E hE q - have hL:L.IsMinimal Q:=lowerTruncation_minimal Q E hE q - have hl:classLayer Q (q-1) (classOfComplex Q L)=classLayer Q (q-1) x := by - exact (classLayer_lowerTruncation_le Q E hE (q-1) q (by omega)).trans - (congrArg (classLayer Q (q-1)) hx) - have htL:∀ c,coefficientTopDual Q (L.pureLayer Q hL (q-1)) α c=⊥ := by - intro c - exact Submodule.finrank_eq_zero.mp - ((classLayerTopDimension_minimal Q L hL (q-1) α c).symm.trans - ((classLayerTopDimension_congr_layer Q (q-1) hl α c).trans (ht c))) - have hh:=positiveLayer_top Q L hL q (fun i=>i.property) α htL - have hp:=positiveLayer_lowerTruncation Q E hE q α - change classLayer Q q (classPositiveTwist Q α (classOfComplex Q L))= - classLayer Q q (classPositiveTwist Q α (classOfComplex Q E)) at hp - rw [classLayer_lowerTruncation_le Q E hE q q le_rfl,hx] at hh - rw [hx] at hp - exact hp.symm.trans hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistModern +import OAI.Topology.ArtinGroups.Complexes.LayerSocleDimensionLayer +import OAI.Topology.ArtinGroups.Complexes.HighConeRetainedPure + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +theorem classPositiveTwist_unshifted_layer (x:FiniteHomotopyClass Q (K:=K)) + (q:ℤ) (α:V) (ht:∀ c,classLayerTopDimension Q (q-1) α c x=0) : + classLayer Q q (classPositiveTwist Q α x)= + classLayer Q q (classPositiveTwist Q α (classLayer Q q x)) := by + let E:=(minimalClassModel Q x).complex + have hE:E.IsMinimal Q:=minimalClassModel_minimal Q x + have hx:classOfComplex Q E=x:=minimalClassModel_class Q x + let L:=lowerTruncation Q E hE q + have hL:L.IsMinimal Q:=lowerTruncation_minimal Q E hE q + have hl:classLayer Q (q-1) (classOfComplex Q L)=classLayer Q (q-1) x := by + exact (classLayer_lowerTruncation_le Q E hE (q-1) q (by omega)).trans + (congrArg (classLayer Q (q-1)) hx) + have htL:∀ c,coefficientTopDual Q (L.pureLayer Q hL (q-1)) α c=⊥ := by + intro c + exact Submodule.finrank_eq_zero.mp + ((classLayerTopDimension_minimal Q L hL (q-1) α c).symm.trans + ((classLayerTopDimension_congr_layer Q (q-1) hl α c).trans (ht c))) + have hh:=positiveLayer_top Q L hL q (fun i=>i.property) α htL + have hp:=positiveLayer_lowerTruncation Q E hE q α + change classLayer Q q (classPositiveTwist Q α (classOfComplex Q L))= + classLayer Q q (classPositiveTwist Q α (classOfComplex Q E)) at hp + rw [classLayer_lowerTruncation_le Q E hE q q le_rfl,hx] at hh + rw [hx] at hp + exact hp.symm.trans hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWord.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWord.lean index 6ba67a02389c44c7f7f513817a35b478124131ad..f61095f7aad7445f9c89361de8e3060f24ce4eee 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWord.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWord.lean @@ -1,95 +1,95 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel -import OAI.Topology.ArtinGroups.Complexes.HomMono - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -namespace FiniteModel -noncomputable def positiveWord : List V → FiniteModel.{u} Q (K:=K) → FiniteModel.{u} Q (K:=K) - | [],E=>E - | α::w,E=>ofComplex Q ((positiveWord w E).complex.positiveTwist Q α) - -noncomputable def positiveWordMap : (w:List V) → {E F:FiniteModel.{u} Q (K:=K)} → - Map Q E.complex F.complex → Map Q (positiveWord Q w E).complex (positiveWord Q w F).complex - | [],_,_,f=>f - | α::w,_,_,f=>(positiveWordMap w f).positiveTwist Q α - -lemma positiveWord_class (w:List V) (E:FiniteModel.{u} Q (K:=K)) : - classOfComplex Q (positiveWord Q w E).complex=positiveWordAction Q w (classOfComplex Q E.complex) := by - induction w with - | nil => rfl - | cons α w ih => - change classPositiveTwist Q α (classOfComplex Q (positiveWord Q w E).complex)= - classPositiveTwist Q α (positiveWordAction Q w (classOfComplex Q E.complex)) - rw [ih] - -lemma positiveWord_homMono (hn:∀ a,Q.source a≠Q.target a) (w:List V) - (T E F:FiniteModel.{u} Q (K:=K)) (f:Map Q E.complex F.complex) - (h:HomMonoFrom Q T.complex f) : - HomMonoFrom Q (positiveWord Q w T).complex (positiveWordMap Q w f) := by - induction w with - | nil => exact h - | cons α w ih => exact ih.positiveTwist Q hn α -end FiniteModel - -variable {I J L M:Type u} [Fintype I] [Fintype J] [Fintype L] [Fintype M] - [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq M] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] - [DecidableEq L] [DecidableEq M] in -lemma HomMonoFrom.comp {T:BasedComplex Q (K:=K) I} {E:BasedComplex Q (K:=K) J} - {F:BasedComplex Q (K:=K) L} {G:BasedComplex Q (K:=K) M} - {f:Map Q E F} {g:Map Q F G} (hf:HomMonoFrom Q T f) (hg:HomMonoFrom Q T g) : - HomMonoFrom Q T (f.comp Q g) := by - intro a ha hb - apply hf a ha - have hac:a*f.matrix∈homCycles Q T F 0 0 := by - simpa only [zero_add] using homCycles_mul Q ha (map_mem_homCycles Q f) - apply hg (a*f.matrix) hac - simpa only [Map.comp,Matrix.mul_assoc] using hb - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma HomotopyEquivalence.homMonoFrom (T:BasedComplex Q (K:=K) I) - {E:BasedComplex Q (K:=K) J} {F:BasedComplex Q (K:=K) L} - (e:HomotopyEquivalence Q E F) : HomMonoFrom Q T e.forward := by - intro g hg hb - have hb':=homBoundary_mul_cycle Q hb (map_mem_homCycles Q e.backward) - have hc:=homCycle_mul_boundary Q hg (e.sourceCorrection_boundary Q) - simp only [zero_add] at hb' hc - have hz:=(homBoundaries Q T E 0 0).sub_mem hb' hc - rw [Matrix.mul_sub] at hz - erw [mul_projectiveIdentity Q hg.1.1] at hz - simpa only [Matrix.mul_assoc,sub_sub_cancel] using hz - -omit [Fintype V] [DecidableEq A] [DecidableEq J] [DecidableEq L] in -lemma HomMonoFrom.sourceEquivalence - {T:BasedComplex Q (K:=K) I} {T':BasedComplex Q (K:=K) M} - {E:BasedComplex Q (K:=K) J} {F:BasedComplex Q (K:=K) L} - (e:HomotopyEquivalence Q T T') {f:Map Q E F} (h:HomMonoFrom Q T f) : - HomMonoFrom Q T' f := by - intro g hg hb - have hc:e.forward.matrix*g∈homCycles Q T E 0 0 := by - simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q e.forward) hg - have hbc:e.forward.matrix*g*f.matrix∈homBoundaries Q T F 0 0 := by - have hz:=homCycle_mul_boundary Q (map_mem_homCycles Q e.forward) hb - simpa only [zero_add,Matrix.mul_assoc] using hz - have hh:=h _ hc hbc - have hh':=homCycle_mul_boundary Q (map_mem_homCycles Q e.backward) hh - have hec:=homBoundary_mul_cycle Q ((e.symm Q).sourceCorrection_boundary Q) hg - simp only [zero_add] at hh' hec - have hz:=(homBoundaries Q T' E 0 0).sub_mem hh' hec - change e.backward.matrix*(e.forward.matrix*g)- - ((e.backward.matrix*e.forward.matrix-projectiveIdentity Q T'.placement)*g)∈ - homBoundaries Q T' E 0 0 at hz - rw [Matrix.sub_mul] at hz - erw [projectiveIdentity_mul Q hg.1.1] at hz - simpa only [Matrix.mul_assoc,sub_sub_cancel] using hz - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel +import OAI.Topology.ArtinGroups.Complexes.HomMono + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +namespace FiniteModel +noncomputable def positiveWord : List V → FiniteModel.{u} Q (K:=K) → FiniteModel.{u} Q (K:=K) + | [],E=>E + | α::w,E=>ofComplex Q ((positiveWord w E).complex.positiveTwist Q α) + +noncomputable def positiveWordMap : (w:List V) → {E F:FiniteModel.{u} Q (K:=K)} → + Map Q E.complex F.complex → Map Q (positiveWord Q w E).complex (positiveWord Q w F).complex + | [],_,_,f=>f + | α::w,_,_,f=>(positiveWordMap w f).positiveTwist Q α + +lemma positiveWord_class (w:List V) (E:FiniteModel.{u} Q (K:=K)) : + classOfComplex Q (positiveWord Q w E).complex=positiveWordAction Q w (classOfComplex Q E.complex) := by + induction w with + | nil => rfl + | cons α w ih => + change classPositiveTwist Q α (classOfComplex Q (positiveWord Q w E).complex)= + classPositiveTwist Q α (positiveWordAction Q w (classOfComplex Q E.complex)) + rw [ih] + +lemma positiveWord_homMono (hn:∀ a,Q.source a≠Q.target a) (w:List V) + (T E F:FiniteModel.{u} Q (K:=K)) (f:Map Q E.complex F.complex) + (h:HomMonoFrom Q T.complex f) : + HomMonoFrom Q (positiveWord Q w T).complex (positiveWordMap Q w f) := by + induction w with + | nil => exact h + | cons α w ih => exact ih.positiveTwist Q hn α +end FiniteModel + +variable {I J L M:Type u} [Fintype I] [Fintype J] [Fintype L] [Fintype M] + [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq M] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] + [DecidableEq L] [DecidableEq M] in +lemma HomMonoFrom.comp {T:BasedComplex Q (K:=K) I} {E:BasedComplex Q (K:=K) J} + {F:BasedComplex Q (K:=K) L} {G:BasedComplex Q (K:=K) M} + {f:Map Q E F} {g:Map Q F G} (hf:HomMonoFrom Q T f) (hg:HomMonoFrom Q T g) : + HomMonoFrom Q T (f.comp Q g) := by + intro a ha hb + apply hf a ha + have hac:a*f.matrix∈homCycles Q T F 0 0 := by + simpa only [zero_add] using homCycles_mul Q ha (map_mem_homCycles Q f) + apply hg (a*f.matrix) hac + simpa only [Map.comp,Matrix.mul_assoc] using hb + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma HomotopyEquivalence.homMonoFrom (T:BasedComplex Q (K:=K) I) + {E:BasedComplex Q (K:=K) J} {F:BasedComplex Q (K:=K) L} + (e:HomotopyEquivalence Q E F) : HomMonoFrom Q T e.forward := by + intro g hg hb + have hb':=homBoundary_mul_cycle Q hb (map_mem_homCycles Q e.backward) + have hc:=homCycle_mul_boundary Q hg (e.sourceCorrection_boundary Q) + simp only [zero_add] at hb' hc + have hz:=(homBoundaries Q T E 0 0).sub_mem hb' hc + rw [Matrix.mul_sub] at hz + erw [mul_projectiveIdentity Q hg.1.1] at hz + simpa only [Matrix.mul_assoc,sub_sub_cancel] using hz + +omit [Fintype V] [DecidableEq A] [DecidableEq J] [DecidableEq L] in +lemma HomMonoFrom.sourceEquivalence + {T:BasedComplex Q (K:=K) I} {T':BasedComplex Q (K:=K) M} + {E:BasedComplex Q (K:=K) J} {F:BasedComplex Q (K:=K) L} + (e:HomotopyEquivalence Q T T') {f:Map Q E F} (h:HomMonoFrom Q T f) : + HomMonoFrom Q T' f := by + intro g hg hb + have hc:e.forward.matrix*g∈homCycles Q T E 0 0 := by + simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q e.forward) hg + have hbc:e.forward.matrix*g*f.matrix∈homBoundaries Q T F 0 0 := by + have hz:=homCycle_mul_boundary Q (map_mem_homCycles Q e.forward) hb + simpa only [zero_add,Matrix.mul_assoc] using hz + have hh:=h _ hc hbc + have hh':=homCycle_mul_boundary Q (map_mem_homCycles Q e.backward) hh + have hec:=homBoundary_mul_cycle Q ((e.symm Q).sourceCorrection_boundary Q) hg + simp only [zero_add] at hh' hec + have hz:=(homBoundaries Q T' E 0 0).sub_mem hh' hec + change e.backward.matrix*(e.forward.matrix*g)- + ((e.backward.matrix*e.forward.matrix-projectiveIdentity Q T'.placement)*g)∈ + homBoundaries Q T' E 0 0 at hz + rw [Matrix.sub_mul] at hz + erw [projectiveIdentity_mul Q hg.1.1] at hz + simpa only [Matrix.mul_assoc,sub_sub_cancel] using hz + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionAppend.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionAppend.lean index e72af5cd2d749441e9fcfbf23b062dd415962e95..cfe2b4bf64702512389c12d31f0c66d1ed60e58a 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionAppend.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionAppend.lean @@ -1,64 +1,64 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex -import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn:∀ a,Q.source a≠Q.target a) - -lemma positiveWordAction_append (w z:List V) (x:FiniteHomotopyClass Q (K:=K)) : - positiveWordAction Q (w++z) x=positiveWordAction Q w (positiveWordAction Q z x) := by - induction w with - | nil => rfl - | cons a w ih => exact congrArg (classPositiveTwist Q a) ih - -lemma classPacketPerm_positiveWord {J:Type u} [Fintype J] (v:J→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : - ∃ w:List V,(∀ a∈w,∃ j,v j=a) ∧ ∀ x:FiniteHomotopyClass Q (K:=K), - positiveWordAction Q w x=classPacketPerm Q hn v hv x := by - suffices hh:∀ (J:Type u) [Fintype J] (v:J→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), - ∃ w:List V,(∀ a∈w,∃ j,v j=a) ∧ ∀ x:FiniteHomotopyClass Q (K:=K), - positiveWordAction Q w x=classPacketPerm Q hn v hv x from hh J v hv - intro J inst - apply Fintype.induction_empty_option (P:=fun J _=>∀ (v:J→V) - (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), - ∃ w:List V,(∀ a∈w,∃ j,v j=a) ∧ ∀ x:FiniteHomotopyClass Q (K:=K), - positiveWordAction Q w x=classPacketPerm Q hn v hv x) _ _ _ J - · intro J L instL e ih - let := Fintype.ofEquiv L e.symm - intro v hv - obtain ⟨w,hw,h⟩:=ih (v∘e) (fun a b hab=>hv (fun he=>hab (e.injective he))) - refine ⟨w,fun a ha=>?_,?_⟩ - · obtain ⟨j,hj⟩:=hw a ha - exact ⟨e j,hj⟩ - · intro x - rw [classPacketPerm_reindex Q hn v hv e] - exact h x - · intro v hv - refine ⟨[],by simp,?_⟩ - intro x - rw [classPacketPerm_empty] - rfl - · intro J inst ih v hv - obtain ⟨w,hw,h⟩:=ih (v∘some) (fun a b hab=>hv (fun he=>hab (Option.some.inj he))) - refine ⟨v none::w,?_,?_⟩ - · intro a ha - rcases List.mem_cons.mp ha with he|ha - · exact ⟨none,he.symm⟩ - · obtain ⟨j,hj⟩:=hw a ha - exact ⟨some j,hj⟩ - · intro x - rw [classPacketPerm_cons] - change classPositiveTwist Q (v none) (positiveWordAction Q w x)=_ - rw [h] - rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PacketPermReindex +import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn:∀ a,Q.source a≠Q.target a) + +lemma positiveWordAction_append (w z:List V) (x:FiniteHomotopyClass Q (K:=K)) : + positiveWordAction Q (w++z) x=positiveWordAction Q w (positiveWordAction Q z x) := by + induction w with + | nil => rfl + | cons a w ih => exact congrArg (classPositiveTwist Q a) ih + +lemma classPacketPerm_positiveWord {J:Type u} [Fintype J] (v:J→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) : + ∃ w:List V,(∀ a∈w,∃ j,v j=a) ∧ ∀ x:FiniteHomotopyClass Q (K:=K), + positiveWordAction Q w x=classPacketPerm Q hn v hv x := by + suffices hh:∀ (J:Type u) [Fintype J] (v:J→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), + ∃ w:List V,(∀ a∈w,∃ j,v j=a) ∧ ∀ x:FiniteHomotopyClass Q (K:=K), + positiveWordAction Q w x=classPacketPerm Q hn v hv x from hh J v hv + intro J inst + apply Fintype.induction_empty_option (P:=fun J _=>∀ (v:J→V) + (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)), + ∃ w:List V,(∀ a∈w,∃ j,v j=a) ∧ ∀ x:FiniteHomotopyClass Q (K:=K), + positiveWordAction Q w x=classPacketPerm Q hn v hv x) _ _ _ J + · intro J L instL e ih + let := Fintype.ofEquiv L e.symm + intro v hv + obtain ⟨w,hw,h⟩:=ih (v∘e) (fun a b hab=>hv (fun he=>hab (e.injective he))) + refine ⟨w,fun a ha=>?_,?_⟩ + · obtain ⟨j,hj⟩:=hw a ha + exact ⟨e j,hj⟩ + · intro x + rw [classPacketPerm_reindex Q hn v hv e] + exact h x + · intro v hv + refine ⟨[],by simp,?_⟩ + intro x + rw [classPacketPerm_empty] + rfl + · intro J inst ih v hv + obtain ⟨w,hw,h⟩:=ih (v∘some) (fun a b hab=>hv (fun he=>hab (Option.some.inj he))) + refine ⟨v none::w,?_,?_⟩ + · intro a ha + rcases List.mem_cons.mp ha with he|ha + · exact ⟨none,he.symm⟩ + · obtain ⟨j,hj⟩:=hw a ha + exact ⟨some j,hj⟩ + · intro x + rw [classPacketPerm_cons] + change classPositiveTwist Q (v none) (positiveWordAction Q w x)=_ + rw [h] + rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionOrthogonal.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionOrthogonal.lean index 91e13c86a566bd707c18f68fae16f7c4947d5af6..c85020a0a94171f0342f3b4c2d5164e83e5ee1b9 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionOrthogonal.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionOrthogonal.lean @@ -1,86 +1,86 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PacketPermEnumeration - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - (hn:∀a,Q.source a≠Q.target a) - -include hn in -lemma positiveWordAction_orthogonal_comm (α:V) (w:List V) - (hw:∀β∈w,OrthogonalVertices Q α β) (x:FiniteHomotopyClass Q (K:=K)) : - classPositiveTwist Q α (positiveWordAction Q w x)= - positiveWordAction Q w (classPositiveTwist Q α x) := by - induction w with - | nil=>rfl - | cons β w ih=> - change classPositiveTwist Q α (classPositiveTwist Q β (positiveWordAction Q w x))=_ - have he:=congrArg (fun p:Equiv.Perm (FiniteHomotopyClass Q (K:=K))=>p (positiveWordAction Q w x)) - (classTwistPerm_orthogonal Q hn (hw β (by simp))) - change classPositiveTwist Q α (classPositiveTwist Q β (positiveWordAction Q w x))= - classPositiveTwist Q β (classPositiveTwist Q α (positiveWordAction Q w x)) at he - rw [he,ih (fun γ hγ=>hw γ (List.mem_cons_of_mem _ hγ))] - rfl - -lemma classPacketPerm_testUpper_reflect {J:Type u} [Fintype J] - (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (U:Set V) (hU:∀a,v a∈U) (x:FiniteHomotopyClass Q (K:=K)) {t:ℤ} - (h:ClassTestUpper Q (classPacketPerm Q hn v hv x) U t) : ClassTestUpper Q x U t := by - rw [← classPacketPerm_toList Q hn v hv] at h - have he: ((Finset.univ:Finset J).toList.map (fun a=>classTwistPerm Q hn (v a))).prod x= - positiveWordAction Q ((Finset.univ:Finset J).toList.map v) x := by - rw [positiveWordAction_eq_prod Q hn,List.map_map] - rfl - rw [he] at h - apply positiveWordAction_testUpper_reflect Q hn _ x U _ h - intro α hα - obtain ⟨a,_,rfl⟩:=List.mem_map.mp hα - exact hU a - -lemma classPacketPerm_testExact_of_cap {J:Type u} [Fintype J] - (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) - (U:Set V) (hU:∀a,v a∈U) (x:FiniteHomotopyClass Q (K:=K)) {t:ℤ} - (h:ClassTestUpper Q (classPacketPerm Q hn v hv x) U t) (a:J) (c:ℤ) : - ClassTestExact Q (v a) t c x := by - let vr:{b:J // b≠a}→V:=fun b=>v b.val - have hvr:Pairwise fun b b'=>OrthogonalVertices Q (vr b) (vr b') := by - intro b b' hbb - exact hv (fun he=>hbb (Subtype.ext he)) - have he:classPacketPerm Q (K:=K) hn v hv=classTwistPerm Q hn (v a)*classPacketPerm Q hn vr hvr := by - let vo:Option {b:J // b≠a}→V:=v ∘ Equiv.optionSubtypeNe a - have hvo:Pairwise fun b b'=>OrthogonalVertices Q (vo b) (vo b') := - fun b b' hbb=>hv (fun hh=>hbb ((Equiv.optionSubtypeNe a).injective hh)) - calc - classPacketPerm Q hn v hv = classPacketPerm Q hn vo hvo := - classPacketPerm_reindex Q hn v hv (Equiv.optionSubtypeNe a) - _ = classTwistPerm Q hn (vo none)*classPacketPerm Q hn (vo ∘ some) - (fun b b' hbb=>hvo (fun hh=>hbb (Option.some.inj hh))) := - classPacketPerm_cons Q hn vo hvo - _ = _ := rfl - have hc:classPositiveTwist Q (v a) (classPacketPerm Q hn vr hvr x)= - classPacketPerm Q hn vr hvr (classPositiveTwist Q (v a) x) := by - rw [← classPacketPerm_toList Q hn vr hvr] - have hword (y:FiniteHomotopyClass Q (K:=K)): - ((Finset.univ:Finset {b:J // b≠a}).toList.map (fun b=>classTwistPerm Q hn (vr b))).prod y= - positiveWordAction Q ((Finset.univ:Finset {b:J // b≠a}).toList.map vr) y := by - rw [positiveWordAction_eq_prod Q hn,List.map_map] - rfl - rw [hword,hword] - apply positiveWordAction_orthogonal_comm Q hn - intro β hβ - obtain ⟨b,_,rfl⟩:=List.mem_map.mp hβ - exact hv (Ne.symm b.property) - rw [he] at h - change ClassTestUpper Q (classPositiveTwist Q (v a) (classPacketPerm Q hn vr hvr x)) U t at h - rw [hc] at h - have hs:=classPacketPerm_testUpper_reflect Q hn vr hvr U (fun b=>hU b.val) _ h - exact (classPositiveTwist_testUpper_iff Q hn x U (v a) (hU a) - (classPositiveTwist_testUpper_reflect Q hn x U (v a) (hU a) hs)).mp hs c - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PacketPermEnumeration + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + (hn:∀a,Q.source a≠Q.target a) + +include hn in +lemma positiveWordAction_orthogonal_comm (α:V) (w:List V) + (hw:∀β∈w,OrthogonalVertices Q α β) (x:FiniteHomotopyClass Q (K:=K)) : + classPositiveTwist Q α (positiveWordAction Q w x)= + positiveWordAction Q w (classPositiveTwist Q α x) := by + induction w with + | nil=>rfl + | cons β w ih=> + change classPositiveTwist Q α (classPositiveTwist Q β (positiveWordAction Q w x))=_ + have he:=congrArg (fun p:Equiv.Perm (FiniteHomotopyClass Q (K:=K))=>p (positiveWordAction Q w x)) + (classTwistPerm_orthogonal Q hn (hw β (by simp))) + change classPositiveTwist Q α (classPositiveTwist Q β (positiveWordAction Q w x))= + classPositiveTwist Q β (classPositiveTwist Q α (positiveWordAction Q w x)) at he + rw [he,ih (fun γ hγ=>hw γ (List.mem_cons_of_mem _ hγ))] + rfl + +lemma classPacketPerm_testUpper_reflect {J:Type u} [Fintype J] + (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (U:Set V) (hU:∀a,v a∈U) (x:FiniteHomotopyClass Q (K:=K)) {t:ℤ} + (h:ClassTestUpper Q (classPacketPerm Q hn v hv x) U t) : ClassTestUpper Q x U t := by + rw [← classPacketPerm_toList Q hn v hv] at h + have he: ((Finset.univ:Finset J).toList.map (fun a=>classTwistPerm Q hn (v a))).prod x= + positiveWordAction Q ((Finset.univ:Finset J).toList.map v) x := by + rw [positiveWordAction_eq_prod Q hn,List.map_map] + rfl + rw [he] at h + apply positiveWordAction_testUpper_reflect Q hn _ x U _ h + intro α hα + obtain ⟨a,_,rfl⟩:=List.mem_map.mp hα + exact hU a + +lemma classPacketPerm_testExact_of_cap {J:Type u} [Fintype J] + (v:J→V) (hv:Pairwise fun a b=>OrthogonalVertices Q (v a) (v b)) + (U:Set V) (hU:∀a,v a∈U) (x:FiniteHomotopyClass Q (K:=K)) {t:ℤ} + (h:ClassTestUpper Q (classPacketPerm Q hn v hv x) U t) (a:J) (c:ℤ) : + ClassTestExact Q (v a) t c x := by + let vr:{b:J // b≠a}→V:=fun b=>v b.val + have hvr:Pairwise fun b b'=>OrthogonalVertices Q (vr b) (vr b') := by + intro b b' hbb + exact hv (fun he=>hbb (Subtype.ext he)) + have he:classPacketPerm Q (K:=K) hn v hv=classTwistPerm Q hn (v a)*classPacketPerm Q hn vr hvr := by + let vo:Option {b:J // b≠a}→V:=v ∘ Equiv.optionSubtypeNe a + have hvo:Pairwise fun b b'=>OrthogonalVertices Q (vo b) (vo b') := + fun b b' hbb=>hv (fun hh=>hbb ((Equiv.optionSubtypeNe a).injective hh)) + calc + classPacketPerm Q hn v hv = classPacketPerm Q hn vo hvo := + classPacketPerm_reindex Q hn v hv (Equiv.optionSubtypeNe a) + _ = classTwistPerm Q hn (vo none)*classPacketPerm Q hn (vo ∘ some) + (fun b b' hbb=>hvo (fun hh=>hbb (Option.some.inj hh))) := + classPacketPerm_cons Q hn vo hvo + _ = _ := rfl + have hc:classPositiveTwist Q (v a) (classPacketPerm Q hn vr hvr x)= + classPacketPerm Q hn vr hvr (classPositiveTwist Q (v a) x) := by + rw [← classPacketPerm_toList Q hn vr hvr] + have hword (y:FiniteHomotopyClass Q (K:=K)): + ((Finset.univ:Finset {b:J // b≠a}).toList.map (fun b=>classTwistPerm Q hn (vr b))).prod y= + positiveWordAction Q ((Finset.univ:Finset {b:J // b≠a}).toList.map vr) y := by + rw [positiveWordAction_eq_prod Q hn,List.map_map] + rfl + rw [hword,hword] + apply positiveWordAction_orthogonal_comm Q hn + intro β hβ + obtain ⟨b,_,rfl⟩:=List.mem_map.mp hβ + exact hv (Ne.symm b.property) + rw [he] at h + change ClassTestUpper Q (classPositiveTwist Q (v a) (classPacketPerm Q hn vr hvr x)) U t at h + rw [hc] at h + have hs:=classPacketPerm_testUpper_reflect Q hn vr hvr U (fun b=>hU b.val) _ h + exact (classPositiveTwist_testUpper_iff Q hn x U (v a) (hU a) + (classPositiveTwist_testUpper_reflect Q hn x U (v a) (hU a) hs)).mp hs c + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionTest.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionTest.lean index 6c0dae476ebd4ef32c8c19cd561a3d1b252aebe7..ea0f454082b56e1288cf63c24483a3ad84fe2f27 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionTest.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PositiveWordActionTest.lean @@ -1,50 +1,50 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Coxeter.PositiveBraidRel - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -lemma positiveWordAction_testUpper (hn:∀a,Q.source a≠Q.target a) - (w:List V) (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (hw:∀s∈w,s∈U) - (t:ℤ) (hx:ClassTestUpper Q x U t) : - ClassTestUpper Q (positiveWordAction Q w x) U (t+w.length) := by - induction w with - | nil=>simpa only [positiveWordAction,List.length_nil,Int.natCast_zero,add_zero] using hx - | cons α w ih=> - have h:=classPositiveTwist_testUpper Q hn (positiveWordAction Q w x) U α (hw α (by simp)) - (ih (fun β hβ=>hw β (List.mem_cons_of_mem _ hβ))) - simpa only [positiveWordAction,List.length_cons,Int.natCast_add,Int.natCast_one,add_assoc] using h - -lemma exists_top_test (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (t:ℤ) - (hex:∃n:ℕ,ClassTestUpper Q x U (t+n)) (hnot:¬ClassTestUpper Q x U t) : - ∃l:ℤ,tsimpa only [positiveWordAction,List.length_nil,Int.natCast_zero,add_zero] using hx + | cons α w ih=> + have h:=classPositiveTwist_testUpper Q hn (positiveWordAction Q w x) U α (hw α (by simp)) + (ih (fun β hβ=>hw β (List.mem_cons_of_mem _ hβ))) + simpa only [positiveWordAction,List.length_cons,Int.natCast_add,Int.natCast_one,add_assoc] using h + +lemma exists_top_test (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (t:ℤ) + (hex:∃n:ℕ,ClassTestUpper Q x U (t+n)) (hnot:¬ClassTestUpper Q x U t) : + ∃l:ℤ,t exact hx - | cons α w ih => exact classPositiveTwist_lower_bound Q α _ ih - -lemma positiveWord_outside_cap (w:List V) (x:FiniteHomotopyClass Q (K:=K)) - (U:Set V) (d:ℤ) (hw:∀ s∈w,s∈U) (hx:ClassOutsideCap Q x U d) : - ClassOutsideCap Q (positiveWordAction Q w x) U d := by - induction w with - | nil => exact hx - | cons α w ih => - exact classPositiveTwist_outside_cap Q _ U d α (hw α (by simp)) - (ih (fun s hs=>hw s (List.mem_cons_of_mem _ hs))) - -theorem reducedWord_layer_bounds (hn:∀ a,Q.source a≠Q.target a) - (U:Set V) - (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) - (x:FiniteHomotopyClass Q (K:=K)) (a b:ℤ) - (hlo:ClassLowerBound Q a x) (hhi:ClassUpperBound Q b x) - (w:List V) (hw:∀ s∈w,s∈U) - (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : - ClassLowerBound Q a (positiveWordAction Q w x) ∧ - ClassUpperBound Q (b+1) (positiveWordAction Q w x) := by - refine ⟨positiveWord_lower_bound Q w x hlo,?_⟩ - apply classUpperBound_of_test_and_outside Q _ U (b+1) - · have he : b+2+1=(b+1)+2 := by omega - rw [← he] - exact reducedWord_testUpper Q hn U hU x (b+2) - (classTestUpper_of_generator_cap Q x b hhi U) w hw hr - · have hh:=positiveWord_outside_cap Q w x U b hw (classOutsideCap_of_upper Q x U b hhi) - intro i hi - have hb:=hh i hi - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistLowerBound +import OAI.Topology.ArtinGroups.Complexes.ReducedNoTopDivisor +import OAI.Topology.ArtinGroups.Complexes.OutsideCap + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +lemma positiveWord_lower_bound (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + {d:ℤ} (hx:ClassLowerBound Q d x) : ClassLowerBound Q d (positiveWordAction Q w x) := by + induction w with + | nil => exact hx + | cons α w ih => exact classPositiveTwist_lower_bound Q α _ ih + +lemma positiveWord_outside_cap (w:List V) (x:FiniteHomotopyClass Q (K:=K)) + (U:Set V) (d:ℤ) (hw:∀ s∈w,s∈U) (hx:ClassOutsideCap Q x U d) : + ClassOutsideCap Q (positiveWordAction Q w x) U d := by + induction w with + | nil => exact hx + | cons α w ih => + exact classPositiveTwist_outside_cap Q _ U d α (hw α (by simp)) + (ih (fun s hs=>hw s (List.mem_cons_of_mem _ hs))) + +theorem reducedWord_layer_bounds (hn:∀ a,Q.source a≠Q.target a) + (U:Set V) + (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) + (x:FiniteHomotopyClass Q (K:=K)) (a b:ℤ) + (hlo:ClassLowerBound Q a x) (hhi:ClassUpperBound Q b x) + (w:List V) (hw:∀ s∈w,s∈U) + (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : + ClassLowerBound Q a (positiveWordAction Q w x) ∧ + ClassUpperBound Q (b+1) (positiveWordAction Q w x) := by + refine ⟨positiveWord_lower_bound Q w x hlo,?_⟩ + apply classUpperBound_of_test_and_outside Q _ U (b+1) + · have he : b+2+1=(b+1)+2 := by omega + rw [← he] + exact reducedWord_testUpper Q hn U hU x (b+2) + (classTestUpper_of_generator_cap Q x b hhi U) w hw hr + · have hh:=positiveWord_outside_cap Q w x U b hw (classOutsideCap_of_upper Q x U b hhi) + intro i hi + have hb:=hh i hi + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeFixedNoDiagonal.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeFixedNoDiagonal.lean index bc4fbb674a813e42f3442ec9667ad972425f74ef..4504ba78013d3a2b25ade70e1caa7e47bd077d40 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeFixedNoDiagonal.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeFixedNoDiagonal.lean @@ -1,90 +1,90 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.MinimalModel -import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex -import OAI.Topology.ArtinGroups.Complexes.IsolatedIndexCycle -import OAI.Topology.ArtinGroups.Quivers.ProbeLeaf - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] - (Q:ReversibleQuiver V A) [DecidableEq (ProbeVertex V)] -attribute [local instance] Classical.decEq Classical.propDecidable -local notation "R" => probeQuiver Q - -theorem probeClass_fixed_of_no_diagonal (x:FiniteHomotopyClass R (K:=K)) - (α:V) (b:Bool) - (hz:∀n u,classGeneratorArray R x ⟨.inl α,n,u⟩=0) - (hout:∀n u,classGeneratorArray R x ⟨.inr (α,b),n,u⟩=if n=0 ∧ u=0 then 1 else 0) - (hdim:classHomDimension R 0 0 x x≤1) : x=initialClass R (.inr (α,b)) := by - cases Subsingleton.elim (inferInstance : DecidableEq (ProbeVertex V)) - (@instDecidableEqSum V (V×Bool) (Classical.decEq V) - (@instDecidableEqProd V Bool (Classical.decEq V) inferInstance)) - let : DecidableEq (ProbeVertex V) := - @instDecidableEqSum V (V×Bool) (Classical.decEq V) - (@instDecidableEqProd V Bool (Classical.decEq V) inferInstance) - let E:=minimalClassModel R x - have hm:E.complex.IsMinimal R:=minimalClassModel_minimal R x - have harray:E.complex.generatorArray R=classGeneratorArray R x := by - calc - _ = classGeneratorArray R (Quotient.mk (finiteHomotopySetoid R) E) := - (classGeneratorArray_of_minimal R E hm).symm - _ = _ := congrArg (classGeneratorArray R) (minimalClassModel_class R x) - have hpos:∀i,0i,invFun:=fun _=>PUnit.unit, - left_inv:=fun _=>rfl,right_inv:=fun j=>(hall j).symm } - have he:E.complex.reindex R e=initialProjective R (.inr (α,b)) := by - apply ext_placement_differential R - · funext j - exact hi - · apply Matrix.ext - intro j k - exact hr i - have h₁ : x=classOfComplex R E.complex := (minimalClassModel_class R x).symm - have h₂ : classOfComplex R E.complex=classOfComplex R (E.complex.reindex R e) := - classOfComplex_reindex R E.complex e - have h₃ : classOfComplex R (E.complex.reindex R e)=initialClass R (.inr (α,b)) := by - rw [he]; rfl - exact h₁.trans (h₂.trans h₃) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.MinimalModel +import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex +import OAI.Topology.ArtinGroups.Complexes.IsolatedIndexCycle +import OAI.Topology.ArtinGroups.Quivers.ProbeLeaf + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] + (Q:ReversibleQuiver V A) [DecidableEq (ProbeVertex V)] +attribute [local instance] Classical.decEq Classical.propDecidable +local notation "R" => probeQuiver Q + +theorem probeClass_fixed_of_no_diagonal (x:FiniteHomotopyClass R (K:=K)) + (α:V) (b:Bool) + (hz:∀n u,classGeneratorArray R x ⟨.inl α,n,u⟩=0) + (hout:∀n u,classGeneratorArray R x ⟨.inr (α,b),n,u⟩=if n=0 ∧ u=0 then 1 else 0) + (hdim:classHomDimension R 0 0 x x≤1) : x=initialClass R (.inr (α,b)) := by + cases Subsingleton.elim (inferInstance : DecidableEq (ProbeVertex V)) + (@instDecidableEqSum V (V×Bool) (Classical.decEq V) + (@instDecidableEqProd V Bool (Classical.decEq V) inferInstance)) + let : DecidableEq (ProbeVertex V) := + @instDecidableEqSum V (V×Bool) (Classical.decEq V) + (@instDecidableEqProd V Bool (Classical.decEq V) inferInstance) + let E:=minimalClassModel R x + have hm:E.complex.IsMinimal R:=minimalClassModel_minimal R x + have harray:E.complex.generatorArray R=classGeneratorArray R x := by + calc + _ = classGeneratorArray R (Quotient.mk (finiteHomotopySetoid R) E) := + (classGeneratorArray_of_minimal R E hm).symm + _ = _ := congrArg (classGeneratorArray R) (minimalClassModel_class R x) + have hpos:∀i,0i,invFun:=fun _=>PUnit.unit, + left_inv:=fun _=>rfl,right_inv:=fun j=>(hall j).symm } + have he:E.complex.reindex R e=initialProjective R (.inr (α,b)) := by + apply ext_placement_differential R + · funext j + exact hi + · apply Matrix.ext + intro j k + exact hr i + have h₁ : x=classOfComplex R E.complex := (minimalClassModel_class R x).symm + have h₂ : classOfComplex R E.complex=classOfComplex R (E.complex.reindex R e) := + classOfComplex_reindex R E.complex e + have h₃ : classOfComplex R (E.complex.reindex R e)=initialClass R (.inr (α,b)) := by + rw [he]; rfl + exact h₁.trans (h₂.trans h₃) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeHomDimensionGenerator.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeHomDimensionGenerator.lean index 379ed9a9ba50f5fedcfc81c02522696152221878..68cecfdb45a73163c50b3b8009087cc91205aa2a 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeHomDimensionGenerator.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeHomDimensionGenerator.lean @@ -1,23 +1,23 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomDimensionDual - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] - (Q:ReversibleQuiver V A) [DecidableEq (ProbeVertex V)] - -lemma probeClassHomDimension_generatorArray_flexible - (x:FiniteHomotopyClass (probeQuiver Q) (K:=K)) (α:V) (b:Bool) - (ha:∀i,((minimalClassModel (probeQuiver Q) x).complex.placement i).color≠.inr (α,b)) (n v:ℤ) : - classHomDimension (probeQuiver Q) n v (initialClass (probeQuiver Q) (.inr (α,b))) x= - classGeneratorArray (probeQuiver Q) x ⟨.inl α,n,v-1⟩ := by - cases Subsingleton.elim (inferInstance : DecidableEq (ProbeVertex V)) - (@instDecidableEqSum V (V×Bool) (Classical.decEq V) - (@instDecidableEqProd V Bool (Classical.decEq V) inferInstance)) - exact probeClassHomDimension_generatorArray Q x α b ha n v - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomDimensionDual + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] + (Q:ReversibleQuiver V A) [DecidableEq (ProbeVertex V)] + +lemma probeClassHomDimension_generatorArray_flexible + (x:FiniteHomotopyClass (probeQuiver Q) (K:=K)) (α:V) (b:Bool) + (ha:∀i,((minimalClassModel (probeQuiver Q) x).complex.placement i).color≠.inr (α,b)) (n v:ℤ) : + classHomDimension (probeQuiver Q) n v (initialClass (probeQuiver Q) (.inr (α,b))) x= + classGeneratorArray (probeQuiver Q) x ⟨.inl α,n,v-1⟩ := by + cases Subsingleton.elim (inferInstance : DecidableEq (ProbeVertex V)) + (@instDecidableEqSum V (V×Bool) (Classical.decEq V) + (@instDecidableEqProd V Bool (Classical.decEq V) inferInstance)) + exact probeClassHomDimension_generatorArray Q x α b ha n v + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitGeneratorExterior.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitGeneratorExterior.lean index 36a1432d3e724ccb78182118b87d64ef5bef8ab3..70a242100dbcc6d3b65279d603f69e5b95dec777 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitGeneratorExterior.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitGeneratorExterior.lean @@ -1,90 +1,90 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.ProbeSwapIso -import OAI.Topology.ArtinGroups.Complexes.IsolatedIndexCycle -import OAI.Topology.ArtinGroups.Quivers.ProbeLeaf - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] - (Q:ReversibleQuiver V A) (hn:∀a,Q.source a≠Q.target a) -attribute [local instance] Classical.decEq Classical.propDecidable -local notation "R" => probeQuiver Q - -lemma probeOrbit_generator_exterior (w:List (V×Bool)) (α β:V) (b c:Bool) (n u:ℤ) : - classGeneratorArray R (probeOrbit Q (K:=K) hn w α b) ⟨.inr (β,c),n,u⟩= - if β=α ∧ c=b ∧ n=0 ∧ u=0 then 1 else 0 := by - rw [probeOrbit,probeWordPerm_exterior Q hn w _ _ β c rfl,classGeneratorArray_initial] - simp only [GeneratorPlacement.mk.injEq,Sum.inr.injEq,Prod.mk.injEq,and_assoc] - -theorem probeOrbit_fixed_of_no_diagonal (w:List (V×Bool)) (α:V) (b:Bool) - (hz:∀n u,classGeneratorArray R (probeOrbit Q (K:=K) hn w α b) ⟨.inl α,n,u⟩=0) : - probeOrbit Q (K:=K) hn w α b=initialClass R (.inr (α,b)) := by - let x:=probeOrbit Q (K:=K) hn w α b - let E:=minimalClassModel R x - have hm:E.complex.IsMinimal R:=minimalClassModel_minimal R x - have harray:E.complex.generatorArray R=classGeneratorArray R x := by - rw [← minimalClassModel_class R x,classGeneratorArray_of_minimal R _ hm] - have hpos:∀i,0i,invFun:=fun _=>PUnit.unit, - left_inv:=fun _=>rfl,right_inv:=fun j=>(hall j).symm } - have he:E.complex.reindex R e=initialProjective R (.inr (α,b)) := by - apply ext_placement_differential R - · funext j - exact hi - · apply Matrix.ext - intro j k - exact hr i - calc x=classOfComplex R E.complex := (minimalClassModel_class R x).symm - _=classOfComplex R (E.complex.reindex R e) := classOfComplex_reindex R E.complex e - _=initialClass R (.inr (α,b)) := by rw [he]; rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.ProbeSwapIso +import OAI.Topology.ArtinGroups.Complexes.IsolatedIndexCycle +import OAI.Topology.ArtinGroups.Quivers.ProbeLeaf + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] + (Q:ReversibleQuiver V A) (hn:∀a,Q.source a≠Q.target a) +attribute [local instance] Classical.decEq Classical.propDecidable +local notation "R" => probeQuiver Q + +lemma probeOrbit_generator_exterior (w:List (V×Bool)) (α β:V) (b c:Bool) (n u:ℤ) : + classGeneratorArray R (probeOrbit Q (K:=K) hn w α b) ⟨.inr (β,c),n,u⟩= + if β=α ∧ c=b ∧ n=0 ∧ u=0 then 1 else 0 := by + rw [probeOrbit,probeWordPerm_exterior Q hn w _ _ β c rfl,classGeneratorArray_initial] + simp only [GeneratorPlacement.mk.injEq,Sum.inr.injEq,Prod.mk.injEq,and_assoc] + +theorem probeOrbit_fixed_of_no_diagonal (w:List (V×Bool)) (α:V) (b:Bool) + (hz:∀n u,classGeneratorArray R (probeOrbit Q (K:=K) hn w α b) ⟨.inl α,n,u⟩=0) : + probeOrbit Q (K:=K) hn w α b=initialClass R (.inr (α,b)) := by + let x:=probeOrbit Q (K:=K) hn w α b + let E:=minimalClassModel R x + have hm:E.complex.IsMinimal R:=minimalClassModel_minimal R x + have harray:E.complex.generatorArray R=classGeneratorArray R x := by + rw [← minimalClassModel_class R x,classGeneratorArray_of_minimal R _ hm] + have hpos:∀i,0i,invFun:=fun _=>PUnit.unit, + left_inv:=fun _=>rfl,right_inv:=fun j=>(hall j).symm } + have he:E.complex.reindex R e=initialProjective R (.inr (α,b)) := by + apply ext_placement_differential R + · funext j + exact hi + · apply Matrix.ext + intro j k + exact hr i + calc x=classOfComplex R E.complex := (minimalClassModel_class R x).symm + _=classOfComplex R (E.complex.reindex R e) := classOfComplex_reindex R E.complex e + _=initialClass R (.inr (α,b)) := by rw [he]; rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitLevelDual.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitLevelDual.lean index 2a5d77cdb19dab19001137808c30c124750dd003..1e2a843352cfd84c509495525bbb4bccfe9d4e3d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitLevelDual.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ProbeOrbitLevelDual.lean @@ -1,27 +1,27 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomDimensionDual -import OAI.Topology.ArtinGroups.Harmonic.PlacementLevelFiberSum - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] - (Q:ReversibleQuiver V A) (hn:∀a,Q.source a≠Q.target a) -attribute [local instance] Classical.decEq Classical.propDecidable -local notation "R" => probeQuiver Q - -lemma probeOrbit_level_dual (w:List (V×Bool)) (α β:V) (d:ℤ) : - classLevelArray R (probeOrbit Q (K:=K) hn w α false) (.inl β,d)= - classLevelArray R - (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β false) (.inl α,-d) := by - have h:=placementLevel_dual - (classGeneratorArray R (probeOrbit Q (K:=K) hn w α false)) - (classGeneratorArray R (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β true)) - (.inl β) (.inl α) (probeOrbit_generator_dual Q hn w α β) d - change classLevelArray R _ _=classLevelArray R _ _ at h - have hs:=probeOrbit_level_swap Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β α false (-d) - exact h.trans hs - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomDimensionDual +import OAI.Topology.ArtinGroups.Harmonic.PlacementLevelFiberSum + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A:Type} {K:Type*} [Field K] [Fintype V] [Fintype A] + (Q:ReversibleQuiver V A) (hn:∀a,Q.source a≠Q.target a) +attribute [local instance] Classical.decEq Classical.propDecidable +local notation "R" => probeQuiver Q + +lemma probeOrbit_level_dual (w:List (V×Bool)) (α β:V) (d:ℤ) : + classLevelArray R (probeOrbit Q (K:=K) hn w α false) (.inl β,d)= + classLevelArray R + (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β false) (.inl α,-d) := by + have h:=placementLevel_dual + (classGeneratorArray R (probeOrbit Q (K:=K) hn w α false)) + (classGeneratorArray R (probeOrbit Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β true)) + (.inl β) (.inl α) (probeOrbit_generator_dual Q hn w α β) d + change classLevelArray R _ _=classLevelArray R _ _ at h + have hs:=probeOrbit_level_swap Q (K:=K) hn (w.reverse.map fun a=>(a.1,!a.2)) β α false (-d) + exact h.trans hs + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PureCoefficientCohomology.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PureCoefficientCohomology.lean index be3158ad3c14d2753538fd64b3d5ee8c4160db12..52d6bf748001f51ab874f903b4730ddbf64c3247 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PureCoefficientCohomology.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PureCoefficientCohomology.lean @@ -1,76 +1,76 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.SummandSecondary - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J T : Type*} [Fintype I] [Fintype J] [Fintype T] - -noncomputable def pureCoefficientCohomology (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : n+v = k-l) : homCohomology Q E F n v ≃ₗ[K] homCycles Q E F n v := - Submodule.quotEquivOfEqBot _ (by - rw [pure_coefficient_boundaries_zero Q E F hE hF h, Submodule.comap_bot] - exact Submodule.ker_subtype _) - -noncomputable def summandSecondaryOnCycles (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (M : BasedComplex Q (K := K) T) (q d n v : ℤ) - (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) : - homCycles Q M (F.pureLayer Q hF d) n v →ₗ[K] - homCycles Q M (F.pureLayer Q hF (d-1)) (n+1) v := - (summandSecondary Q E F hE M q d n ι π).restrict fun _ hf => - summandSecondary_cycles Q E F hE hF M q d n v ι π hf - -noncomputable def summandSecondaryClass (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (M : BasedComplex Q (K := K) T) (q d n v : ℤ) - (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) : - homCycles Q M (F.pureLayer Q hF d) n v →ₗ[K] - homCohomology Q M (F.pureLayer Q hF (d-1)) (n+1) v := - ((homBoundaries Q M (F.pureLayer Q hF (d-1)) (n+1) v).comap - (homCycles Q M (F.pureLayer Q hF (d-1)) (n+1) v).subtype).mkQ.comp - (summandSecondaryOnCycles Q E F hE hF M q d n v ι π) - -lemma summandSecondaryClass_injective [Fintype V] [DecidableEq T] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) - (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) - (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) - (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) - (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) - (hdeg : n+v = d-q) : - Function.Injective (summandSecondaryClass Q E F hE hF M q d n v ι π) := by - apply LinearMap.ker_eq_bot.mp - apply le_antisymm _ bot_le - intro f hf - change Submodule.Quotient.mk (summandSecondaryOnCycles Q E F hE hF M q d n v ι π f) = 0 at hf - have hb := (Submodule.Quotient.mk_eq_zero _).mp hf - change f = 0 - apply Subtype.ext - exact summandSecondary_kernel_zero Q E F hE hF M U q d n v hM hU ι π hret hcap hd hdeg - f.property hb - -noncomputable def cappedSummandInjection [Fintype V] [DecidableEq T] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) - (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) - (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) - (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) - (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) - (hdeg : n+v = d-q) : - { f : homCohomology Q M (F.pureLayer Q hF d) n v →ₗ[K] - homCohomology Q M (F.pureLayer Q hF (d-1)) (n+1) v // Function.Injective f } := - ⟨ (summandSecondaryClass Q E F hE hF M q d n v ι π).comp - (pureCoefficientCohomology Q M (F.pureLayer Q hF d) hM (fun i => i.property) hdeg).toLinearMap, - (summandSecondaryClass_injective Q E F hE hF M U q d n v hM hU ι π hret hcap hd hdeg).comp - (pureCoefficientCohomology Q M (F.pureLayer Q hF d) hM (fun i => i.property) hdeg).injective ⟩ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.SummandSecondary + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J T : Type*} [Fintype I] [Fintype J] [Fintype T] + +noncomputable def pureCoefficientCohomology (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : n+v = k-l) : homCohomology Q E F n v ≃ₗ[K] homCycles Q E F n v := + Submodule.quotEquivOfEqBot _ (by + rw [pure_coefficient_boundaries_zero Q E F hE hF h, Submodule.comap_bot] + exact Submodule.ker_subtype _) + +noncomputable def summandSecondaryOnCycles (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (M : BasedComplex Q (K := K) T) (q d n v : ℤ) + (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) : + homCycles Q M (F.pureLayer Q hF d) n v →ₗ[K] + homCycles Q M (F.pureLayer Q hF (d-1)) (n+1) v := + (summandSecondary Q E F hE M q d n ι π).restrict fun _ hf => + summandSecondary_cycles Q E F hE hF M q d n v ι π hf + +noncomputable def summandSecondaryClass (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (M : BasedComplex Q (K := K) T) (q d n v : ℤ) + (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) : + homCycles Q M (F.pureLayer Q hF d) n v →ₗ[K] + homCohomology Q M (F.pureLayer Q hF (d-1)) (n+1) v := + ((homBoundaries Q M (F.pureLayer Q hF (d-1)) (n+1) v).comap + (homCycles Q M (F.pureLayer Q hF (d-1)) (n+1) v).subtype).mkQ.comp + (summandSecondaryOnCycles Q E F hE hF M q d n v ι π) + +lemma summandSecondaryClass_injective [Fintype V] [DecidableEq T] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) + (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) + (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) + (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) + (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) + (hdeg : n+v = d-q) : + Function.Injective (summandSecondaryClass Q E F hE hF M q d n v ι π) := by + apply LinearMap.ker_eq_bot.mp + apply le_antisymm _ bot_le + intro f hf + change Submodule.Quotient.mk (summandSecondaryOnCycles Q E F hE hF M q d n v ι π f) = 0 at hf + have hb := (Submodule.Quotient.mk_eq_zero _).mp hf + change f = 0 + apply Subtype.ext + exact summandSecondary_kernel_zero Q E F hE hF M U q d n v hM hU ι π hret hcap hd hdeg + f.property hb + +noncomputable def cappedSummandInjection [Fintype V] [DecidableEq T] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) + (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) + (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) + (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) + (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) + (hdeg : n+v = d-q) : + { f : homCohomology Q M (F.pureLayer Q hF d) n v →ₗ[K] + homCohomology Q M (F.pureLayer Q hF (d-1)) (n+1) v // Function.Injective f } := + ⟨ (summandSecondaryClass Q E F hE hF M q d n v ι π).comp + (pureCoefficientCohomology Q M (F.pureLayer Q hF d) hM (fun i => i.property) hdeg).toLinearMap, + (summandSecondaryClass_injective Q E F hE hF M U q d n v hM hU ι π hret hcap hd hdeg).comp + (pureCoefficientCohomology Q M (F.pureLayer Q hF d) hM (fun i => i.property) hdeg).injective ⟩ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PureHomSpaceHomogeneous.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PureHomSpaceHomogeneous.lean index be8794084f20637ebbe6fe24b5e3c771a196376d..7059c63f4937ad2f211cb5de01c2edc8ed8c6fb4 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PureHomSpaceHomogeneous.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PureHomSpaceHomogeneous.lean @@ -1,67 +1,67 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.VertexLinear - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J : Type*} [Fintype I] [Fintype J] - -lemma pure_homSpace_homogeneous (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v r : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : n + v = k-l+r) {f : Matrix I J (Q.Zigzag K)} - (hf : f ∈ homSpace Q E F n v) (i : I) (j : J) : Homogeneous Q r (f i j) := by - by_cases hc : (F.placement j).cochain = (E.placement i).cochain + n - · have he := hE i - have ht := hF j - dsimp only [GeneratorPlacement.level] at he ht - have hh : v + (E.placement i).internal - (F.placement j).internal = r := by omega - rw [← hh] - exact (hf.2 i j).2 - · rw [(hf.2 i j).1 hc] - exact ⟨fun _ => rfl, fun _ => rfl, fun _ => rfl⟩ - -lemma pure_homSpace_coefficient (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : n + v = k-l) {f : Matrix I J (Q.Zigzag K)} - (hf : f ∈ homSpace Q E F n v) : CoefficientMatrix Q f := by - intro i j - have hh := pure_homSpace_homogeneous Q E F hE hF (r := 0) (by omega) hf i j - exact ⟨hh.2.1 (by norm_num), hh.2.2 (by norm_num)⟩ - -lemma pure_homSpace_linear (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : n + v = k-l+1) {f : Matrix I J (Q.Zigzag K)} - (hf : f ∈ homSpace Q E F n v) : LinearMatrix Q f := by - intro i j - have hh := pure_homSpace_homogeneous Q E F hE hF h hf i j - exact ⟨hh.1 (by norm_num), hh.2.2 (by norm_num)⟩ - -lemma pure_homSpace_token (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : n + v = k-l+2) {f : Matrix I J (Q.Zigzag K)} - (hf : f ∈ homSpace Q E F n v) : TokenMatrix Q f := by - intro i j - have hh := pure_homSpace_homogeneous Q E F hE hF h hf i j - exact ⟨hh.1 (by norm_num), hh.2.1 (by norm_num)⟩ - -lemma pure_coefficient_boundaries_zero (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : n + v = k-l) : homBoundaries Q E F n v = ⊥ := by - apply le_antisymm _ bot_le - intro f hf - obtain ⟨g, hg, rfl⟩ := hf - rw [homSpace_pure_total_degree_lower Q E F hE hF (by omega)] at hg - have hg' : g = 0 := hg - rw [hg', map_zero] - exact Submodule.zero_mem _ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.VertexLinear + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J : Type*} [Fintype I] [Fintype J] + +lemma pure_homSpace_homogeneous (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v r : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : n + v = k-l+r) {f : Matrix I J (Q.Zigzag K)} + (hf : f ∈ homSpace Q E F n v) (i : I) (j : J) : Homogeneous Q r (f i j) := by + by_cases hc : (F.placement j).cochain = (E.placement i).cochain + n + · have he := hE i + have ht := hF j + dsimp only [GeneratorPlacement.level] at he ht + have hh : v + (E.placement i).internal - (F.placement j).internal = r := by omega + rw [← hh] + exact (hf.2 i j).2 + · rw [(hf.2 i j).1 hc] + exact ⟨fun _ => rfl, fun _ => rfl, fun _ => rfl⟩ + +lemma pure_homSpace_coefficient (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : n + v = k-l) {f : Matrix I J (Q.Zigzag K)} + (hf : f ∈ homSpace Q E F n v) : CoefficientMatrix Q f := by + intro i j + have hh := pure_homSpace_homogeneous Q E F hE hF (r := 0) (by omega) hf i j + exact ⟨hh.2.1 (by norm_num), hh.2.2 (by norm_num)⟩ + +lemma pure_homSpace_linear (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : n + v = k-l+1) {f : Matrix I J (Q.Zigzag K)} + (hf : f ∈ homSpace Q E F n v) : LinearMatrix Q f := by + intro i j + have hh := pure_homSpace_homogeneous Q E F hE hF h hf i j + exact ⟨hh.1 (by norm_num), hh.2.2 (by norm_num)⟩ + +lemma pure_homSpace_token (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : n + v = k-l+2) {f : Matrix I J (Q.Zigzag K)} + (hf : f ∈ homSpace Q E F n v) : TokenMatrix Q f := by + intro i j + have hh := pure_homSpace_homogeneous Q E F hE hF h hf i j + exact ⟨hh.1 (by norm_num), hh.2.1 (by norm_num)⟩ + +lemma pure_coefficient_boundaries_zero (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : n + v = k-l) : homBoundaries Q E F n v = ⊥ := by + apply le_antisymm _ bot_le + intro f hf + obtain ⟨g, hg, rfl⟩ := hf + rw [homSpace_pure_total_degree_lower Q E F hE hF (by omega)] at hg + have hg' : g = 0 := hg + rw [hg', map_zero] + exact Submodule.zero_mem _ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PureLayerSelf.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PureLayerSelf.lean index 4d5a3dc9e1ebd8c291cb9b83b9fa0475068a6f8b..900b3e38b28edbfa30032a0c9883a0abe05b58b7 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PureLayerSelf.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PureLayerSelf.lean @@ -1,93 +1,93 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ColorBoundary -import OAI.Topology.ArtinGroups.Complexes.ScalarKernel -import OAI.Topology.ArtinGroups.Complexes.NegativeTwistModern - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J T:Type u} [Fintype I] [Fintype J] [Fintype T] - [DecidableEq I] [DecidableEq J] [DecidableEq T] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma pure_minimal (E:BasedComplex Q (K:=K) I) {q:ℤ} - (hE:∀ i,(E.placement i).level=q) : E.IsMinimal Q := by - intro i j - exact (pure_differential_linear Q E hE i j).1 - -noncomputable def pureLayerSelf (E:BasedComplex Q (K:=K) I) {q:ℤ} - (hE:∀ i,(E.placement i).level=q) : - ChainIsomorphism Q E (E.pureLayer Q (pure_minimal Q E hE) q) := by - let e:=reindexChainIsomorphism Q (E.pureLayer Q (pure_minimal Q E hE) q) (allPureIndex Q E q hE) - have he:(E.pureLayer Q (pure_minimal Q E hE) q).reindex Q (allPureIndex Q E q hE)=E := by - apply ext_placement_differential Q <;> rfl - rw [he] at e - exact e.symm Q - -noncomputable def HomotopyEquivalence.ofPure - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (e:HomotopyEquivalence Q E F) {q:ℤ} - (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) : - ChainIsomorphism Q E F := - ((pureLayerSelf Q E hE).trans Q - (e.pureLayer Q (pure_minimal Q E hE) (pure_minimal Q F hF) q)).trans Q - ((pureLayerSelf Q F hF).symm Q) - -noncomputable def TermwiseSplitInjection.trans - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} {G:BasedComplex Q (K:=K) T} - (a:TermwiseSplitInjection Q E F) (b:TermwiseSplitInjection Q F G) : - TermwiseSplitInjection Q E G where - inclusion:=Map.comp Q a.inclusion b.inclusion - retraction:=b.retraction*a.retraction - split:=by - change (a.inclusion.matrix*b.inclusion.matrix)*(b.retraction*a.retraction)=_ - rw [Matrix.mul_assoc,← Matrix.mul_assoc b.inclusion.matrix,b.split,← Matrix.mul_assoc] - exact (congrArg (fun X=>X*a.retraction) (mul_projectiveIdentity Q a.inclusion.entries)).trans a.split - -noncomputable def ChainIsomorphism.termwiseSplit - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (e:ChainIsomorphism Q E F) : TermwiseSplitInjection Q E F := - ⟨e.forward,e.backward.matrix,e.sourceEquation⟩ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma pureMap_zero_off_colors - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (f:Map Q E F) {q:ℤ} (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) - (U:Set V) (hs:∀ i,(E.placement i).color∈U) - (i:I) (j:J) (hj:(F.placement j).color∉U) : f.matrix i j=0 := by - rw [map_coefficient_entry Q f (pureMap_coefficient Q f q hE hF)] - have hne:(F.placement j).color≠(E.placement i).color:=fun h=>hj (h.symm ▸ hs i) - change (f.matrix i j).vertex (F.placement j).color • _=0 - rw [entry_vertex_left_support Q f.entries i j _ hne,zero_smul] - -noncomputable def TermwiseSplitInjection.colorTarget - {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (a:TermwiseSplitInjection Q E F) {q:ℤ} - (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) - (U:Set V) (hs:∀ i,(E.placement i).color∈U) - (hb:∀ j,(F.placement j).color∉colorBoundary Q U) : - TermwiseSplitInjection Q E (colorRestriction Q F U hF hb) where - inclusion:=Map.comp Q a.inclusion (blockProjectionMap Q F - {j:J | (F.placement j).color∈U} (pure_color_block Q F U hF hb)) - retraction:=a.retraction.submatrix Subtype.val id - split:=by - apply Matrix.ext - intro i j - change (∑ k:{k:J // (F.placement k).color∈U}, - (a.inclusion.matrix*blockProjection Q F {j:J | (F.placement j).color∈U}) i k * a.retraction k j)=_ - rw [mul_blockProjection Q F {j:J | (F.placement j).color∈U} _ _ a.inclusion.entries,← a.split] - change (∑ k:{k:J // (F.placement k).color∈U},a.inclusion.matrix i k*a.retraction k j)= - ∑ k:J,a.inclusion.matrix i k*a.retraction k j - apply Fintype.sum_of_injective (Subtype.val : {k:J // (F.placement k).color∈U}→J) Subtype.val_injective - · intro k hk - have hn:(F.placement k).color∉U:=fun h=>hk ⟨⟨k,h⟩,rfl⟩ - rw [pureMap_zero_off_colors Q a.inclusion hE hF U hs i k hn,zero_mul] - · intro k;rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ColorBoundary +import OAI.Topology.ArtinGroups.Complexes.ScalarKernel +import OAI.Topology.ArtinGroups.Complexes.NegativeTwistModern + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J T:Type u} [Fintype I] [Fintype J] [Fintype T] + [DecidableEq I] [DecidableEq J] [DecidableEq T] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma pure_minimal (E:BasedComplex Q (K:=K) I) {q:ℤ} + (hE:∀ i,(E.placement i).level=q) : E.IsMinimal Q := by + intro i j + exact (pure_differential_linear Q E hE i j).1 + +noncomputable def pureLayerSelf (E:BasedComplex Q (K:=K) I) {q:ℤ} + (hE:∀ i,(E.placement i).level=q) : + ChainIsomorphism Q E (E.pureLayer Q (pure_minimal Q E hE) q) := by + let e:=reindexChainIsomorphism Q (E.pureLayer Q (pure_minimal Q E hE) q) (allPureIndex Q E q hE) + have he:(E.pureLayer Q (pure_minimal Q E hE) q).reindex Q (allPureIndex Q E q hE)=E := by + apply ext_placement_differential Q <;> rfl + rw [he] at e + exact e.symm Q + +noncomputable def HomotopyEquivalence.ofPure + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (e:HomotopyEquivalence Q E F) {q:ℤ} + (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) : + ChainIsomorphism Q E F := + ((pureLayerSelf Q E hE).trans Q + (e.pureLayer Q (pure_minimal Q E hE) (pure_minimal Q F hF) q)).trans Q + ((pureLayerSelf Q F hF).symm Q) + +noncomputable def TermwiseSplitInjection.trans + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} {G:BasedComplex Q (K:=K) T} + (a:TermwiseSplitInjection Q E F) (b:TermwiseSplitInjection Q F G) : + TermwiseSplitInjection Q E G where + inclusion:=Map.comp Q a.inclusion b.inclusion + retraction:=b.retraction*a.retraction + split:=by + change (a.inclusion.matrix*b.inclusion.matrix)*(b.retraction*a.retraction)=_ + rw [Matrix.mul_assoc,← Matrix.mul_assoc b.inclusion.matrix,b.split,← Matrix.mul_assoc] + exact (congrArg (fun X=>X*a.retraction) (mul_projectiveIdentity Q a.inclusion.entries)).trans a.split + +noncomputable def ChainIsomorphism.termwiseSplit + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (e:ChainIsomorphism Q E F) : TermwiseSplitInjection Q E F := + ⟨e.forward,e.backward.matrix,e.sourceEquation⟩ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma pureMap_zero_off_colors + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (f:Map Q E F) {q:ℤ} (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) + (U:Set V) (hs:∀ i,(E.placement i).color∈U) + (i:I) (j:J) (hj:(F.placement j).color∉U) : f.matrix i j=0 := by + rw [map_coefficient_entry Q f (pureMap_coefficient Q f q hE hF)] + have hne:(F.placement j).color≠(E.placement i).color:=fun h=>hj (h.symm ▸ hs i) + change (f.matrix i j).vertex (F.placement j).color • _=0 + rw [entry_vertex_left_support Q f.entries i j _ hne,zero_smul] + +noncomputable def TermwiseSplitInjection.colorTarget + {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (a:TermwiseSplitInjection Q E F) {q:ℤ} + (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) + (U:Set V) (hs:∀ i,(E.placement i).color∈U) + (hb:∀ j,(F.placement j).color∉colorBoundary Q U) : + TermwiseSplitInjection Q E (colorRestriction Q F U hF hb) where + inclusion:=Map.comp Q a.inclusion (blockProjectionMap Q F + {j:J | (F.placement j).color∈U} (pure_color_block Q F U hF hb)) + retraction:=a.retraction.submatrix Subtype.val id + split:=by + apply Matrix.ext + intro i j + change (∑ k:{k:J // (F.placement k).color∈U}, + (a.inclusion.matrix*blockProjection Q F {j:J | (F.placement j).color∈U}) i k * a.retraction k j)=_ + rw [mul_blockProjection Q F {j:J | (F.placement j).color∈U} _ _ a.inclusion.entries,← a.split] + change (∑ k:{k:J // (F.placement k).color∈U},a.inclusion.matrix i k*a.retraction k j)= + ∑ k:J,a.inclusion.matrix i k*a.retraction k j + apply Fintype.sum_of_injective (Subtype.val : {k:J // (F.placement k).color∈U}→J) Subtype.val_injective + · intro k hk + have hn:(F.placement k).color∉U:=fun h=>hk ⟨⟨k,h⟩,rfl⟩ + rw [pureMap_zero_off_colors Q a.inclusion hE hF U hs i k hn,zero_mul] + · intro k;rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PureSupportedCycles.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PureSupportedCycles.lean index a86295f210ac74ec4923b069bf176637765700c7..aaf3494e79fe90ed1e7b284d06cee00a4a5e49be 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PureSupportedCycles.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PureSupportedCycles.lean @@ -1,114 +1,114 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.UnitTestVector -import OAI.Topology.ArtinGroups.Quivers.TokenTestVector -import OAI.Topology.ArtinGroups.Diagrams.TransposeConjugateEquiv - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -omit [Fintype I] in -lemma testMatrix_identity (p : I → GeneratorPlacement V) (α : V) : - testMatrix Q p p α (projectiveIdentity Q p (K := K)) = 1 := by - apply Matrix.ext - intro u v - change pathCoordinates Q (pathBasis Q u.2.val * - (if u.1 = v.1 then vertexId Q (p u.1).color else 0)) v.2.val = _ - by_cases hi : u.1 = v.1 - · rcases u with ⟨i,u⟩ - rcases v with ⟨j,v⟩ - dsimp only at hi - subst j - simp only [ite_true,cornerPath_right,pathBasis_coordinates] - by_cases hp : u=v - · subst v; simp - · have hv : u.val ≠ v.val := fun h => hp (Subtype.ext h) - simp [hp,hv] - · rw [ite_eq_right hi,MulZeroClass.mul_zero,coordinates_zero] - exact (Matrix.one_apply_ne (fun h => hi (congrArg Sigma.fst h))).symm - -namespace BasedComplex - -omit [DecidableEq I] [DecidableEq J] in -lemma pureMap_test_support {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) {l : ℤ} - (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) - (α : V) (c n : ℤ) (i : TestIndex Q E.placement α) (j : TestIndex Q F.placement α) - (h : testMatrix Q E.placement F.placement α f.matrix i j ≠ 0) : - ((E.placement i.1).cochain=c ∧ Path.length i.2.val=n) ↔ - ((F.placement j.1).cochain=c ∧ Path.length j.2.val=n) := by - have he : (F.placement j.1).cochain = (E.placement i.1).cochain := by - by_contra hh - apply h - unfold testMatrix - rw [(f.degree i.1 j.1).1 (by simpa only [add_zero] using hh), - MulZeroClass.mul_zero,coordinates_zero] - have hh := pure_homSpace_homogeneous Q E F hE hF (n := 0) (v := 0) (r := 0) - (by omega) ⟨f.entries,f.degree⟩ i.1 j.1 - have hp := coordinates_mul_degree Q (pathBasis_homogeneous Q i.2.val) hh h - have hlen : Path.length j.2.val = Path.length i.2.val := by simpa only [add_zero] using hp - rw [he,hlen] - -noncomputable def ChainIsomorphism.pureSupportedCycles - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : ChainIsomorphism Q E F) {l : ℤ} - (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) - (α : V) (c n : ℤ) : - ScalarCycles.supportedKernel (testMatrix Q E.placement E.placement α E.differential) - (fun i => (E.placement i.1).cochain=c ∧ Path.length i.2.val=n) ≃ₗ[K] - ScalarCycles.supportedKernel (testMatrix Q F.placement F.placement α F.differential) - (fun i => (F.placement i.1).cochain=c ∧ Path.length i.2.val=n) := by - apply ScalarCycles.conjugateEquiv _ _ _ _ - (testMatrix Q E.placement F.placement α f.forward.matrix) - (testMatrix Q F.placement E.placement α f.backward.matrix) - · exact pureMap_test_support Q f.forward hE hF α c n - · exact pureMap_test_support Q f.backward hF hE α c n - · rw [testMatrix_mul Q α _ f.forward.entries,f.sourceEquation,testMatrix_identity] - · rw [testMatrix_mul Q α _ f.backward.entries,f.targetEquation,testMatrix_identity] - · rw [testMatrix_mul Q α _ E.entries,testMatrix_mul Q α _ f.forward.entries,f.forward.commute] - -noncomputable def ChainIsomorphism.pureDualSupportedCycles - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : ChainIsomorphism Q E F) {l : ℤ} - (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) - (α : V) (c n : ℤ) : - ScalarCycles.supportedKernel (testMatrix Q E.placement E.placement α E.differential).transpose - (fun i => (E.placement i.1).cochain=c ∧ Path.length i.2.val=n) ≃ₗ[K] - ScalarCycles.supportedKernel (testMatrix Q F.placement F.placement α F.differential).transpose - (fun i => (F.placement i.1).cochain=c ∧ Path.length i.2.val=n) := by - apply ScalarCycles.transposeConjugateEquiv _ _ _ _ - (testMatrix Q E.placement F.placement α f.forward.matrix) - (testMatrix Q F.placement E.placement α f.backward.matrix) - · exact pureMap_test_support Q f.forward hE hF α c n - · exact pureMap_test_support Q f.backward hF hE α c n - · rw [testMatrix_mul Q α _ f.forward.entries,f.sourceEquation,testMatrix_identity] - · rw [testMatrix_mul Q α _ f.backward.entries,f.targetEquation,testMatrix_identity] - · rw [testMatrix_mul Q α _ F.entries,testMatrix_mul Q α _ f.backward.entries,f.backward.commute] - -noncomputable def ChainIsomorphism.coefficientSocle - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : ChainIsomorphism Q E F) {l : ℤ} - (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) - (α : V) (c : ℤ) : - coefficientSocle Q E α c ≃ₗ[K] coefficientSocle Q F α c := - ((coefficientSocleTestEquiv Q E hE α c).trans - (f.pureSupportedCycles Q hE hF α c 0)).trans - (coefficientSocleTestEquiv Q F hF α c).symm - -noncomputable def ChainIsomorphism.coefficientTopDual - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - (f : ChainIsomorphism Q E F) {l : ℤ} - (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) - (α : V) (c : ℤ) : - coefficientTopDual Q E α c ≃ₗ[K] coefficientTopDual Q F α c := - ((coefficientTopTestEquiv Q E hE α c).trans - (f.pureDualSupportedCycles Q hE hF α c 2)).trans - (coefficientTopTestEquiv Q F hF α c).symm - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.UnitTestVector +import OAI.Topology.ArtinGroups.Quivers.TokenTestVector +import OAI.Topology.ArtinGroups.Diagrams.TransposeConjugateEquiv + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +omit [Fintype I] in +lemma testMatrix_identity (p : I → GeneratorPlacement V) (α : V) : + testMatrix Q p p α (projectiveIdentity Q p (K := K)) = 1 := by + apply Matrix.ext + intro u v + change pathCoordinates Q (pathBasis Q u.2.val * + (if u.1 = v.1 then vertexId Q (p u.1).color else 0)) v.2.val = _ + by_cases hi : u.1 = v.1 + · rcases u with ⟨i,u⟩ + rcases v with ⟨j,v⟩ + dsimp only at hi + subst j + simp only [ite_true,cornerPath_right,pathBasis_coordinates] + by_cases hp : u=v + · subst v; simp + · have hv : u.val ≠ v.val := fun h => hp (Subtype.ext h) + simp [hp,hv] + · rw [ite_eq_right hi,MulZeroClass.mul_zero,coordinates_zero] + exact (Matrix.one_apply_ne (fun h => hi (congrArg Sigma.fst h))).symm + +namespace BasedComplex + +omit [DecidableEq I] [DecidableEq J] in +lemma pureMap_test_support {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) {l : ℤ} + (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) + (α : V) (c n : ℤ) (i : TestIndex Q E.placement α) (j : TestIndex Q F.placement α) + (h : testMatrix Q E.placement F.placement α f.matrix i j ≠ 0) : + ((E.placement i.1).cochain=c ∧ Path.length i.2.val=n) ↔ + ((F.placement j.1).cochain=c ∧ Path.length j.2.val=n) := by + have he : (F.placement j.1).cochain = (E.placement i.1).cochain := by + by_contra hh + apply h + unfold testMatrix + rw [(f.degree i.1 j.1).1 (by simpa only [add_zero] using hh), + MulZeroClass.mul_zero,coordinates_zero] + have hh := pure_homSpace_homogeneous Q E F hE hF (n := 0) (v := 0) (r := 0) + (by omega) ⟨f.entries,f.degree⟩ i.1 j.1 + have hp := coordinates_mul_degree Q (pathBasis_homogeneous Q i.2.val) hh h + have hlen : Path.length j.2.val = Path.length i.2.val := by simpa only [add_zero] using hp + rw [he,hlen] + +noncomputable def ChainIsomorphism.pureSupportedCycles + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : ChainIsomorphism Q E F) {l : ℤ} + (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) + (α : V) (c n : ℤ) : + ScalarCycles.supportedKernel (testMatrix Q E.placement E.placement α E.differential) + (fun i => (E.placement i.1).cochain=c ∧ Path.length i.2.val=n) ≃ₗ[K] + ScalarCycles.supportedKernel (testMatrix Q F.placement F.placement α F.differential) + (fun i => (F.placement i.1).cochain=c ∧ Path.length i.2.val=n) := by + apply ScalarCycles.conjugateEquiv _ _ _ _ + (testMatrix Q E.placement F.placement α f.forward.matrix) + (testMatrix Q F.placement E.placement α f.backward.matrix) + · exact pureMap_test_support Q f.forward hE hF α c n + · exact pureMap_test_support Q f.backward hF hE α c n + · rw [testMatrix_mul Q α _ f.forward.entries,f.sourceEquation,testMatrix_identity] + · rw [testMatrix_mul Q α _ f.backward.entries,f.targetEquation,testMatrix_identity] + · rw [testMatrix_mul Q α _ E.entries,testMatrix_mul Q α _ f.forward.entries,f.forward.commute] + +noncomputable def ChainIsomorphism.pureDualSupportedCycles + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : ChainIsomorphism Q E F) {l : ℤ} + (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) + (α : V) (c n : ℤ) : + ScalarCycles.supportedKernel (testMatrix Q E.placement E.placement α E.differential).transpose + (fun i => (E.placement i.1).cochain=c ∧ Path.length i.2.val=n) ≃ₗ[K] + ScalarCycles.supportedKernel (testMatrix Q F.placement F.placement α F.differential).transpose + (fun i => (F.placement i.1).cochain=c ∧ Path.length i.2.val=n) := by + apply ScalarCycles.transposeConjugateEquiv _ _ _ _ + (testMatrix Q E.placement F.placement α f.forward.matrix) + (testMatrix Q F.placement E.placement α f.backward.matrix) + · exact pureMap_test_support Q f.forward hE hF α c n + · exact pureMap_test_support Q f.backward hF hE α c n + · rw [testMatrix_mul Q α _ f.forward.entries,f.sourceEquation,testMatrix_identity] + · rw [testMatrix_mul Q α _ f.backward.entries,f.targetEquation,testMatrix_identity] + · rw [testMatrix_mul Q α _ F.entries,testMatrix_mul Q α _ f.backward.entries,f.backward.commute] + +noncomputable def ChainIsomorphism.coefficientSocle + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : ChainIsomorphism Q E F) {l : ℤ} + (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) + (α : V) (c : ℤ) : + coefficientSocle Q E α c ≃ₗ[K] coefficientSocle Q F α c := + ((coefficientSocleTestEquiv Q E hE α c).trans + (f.pureSupportedCycles Q hE hF α c 0)).trans + (coefficientSocleTestEquiv Q F hF α c).symm + +noncomputable def ChainIsomorphism.coefficientTopDual + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + (f : ChainIsomorphism Q E F) {l : ℤ} + (hE : ∀ i, (E.placement i).level=l) (hF : ∀ j, (F.placement j).level=l) + (α : V) (c : ℤ) : + coefficientTopDual Q E α c ≃ₗ[K] coefficientTopDual Q F α c := + ((coefficientTopTestEquiv Q E hE α c).trans + (f.pureDualSupportedCycles Q hE hF α c 2)).trans + (coefficientTopTestEquiv Q F hF α c).symm + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PureTotalHomEuler.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PureTotalHomEuler.lean index 33ffb34da08729be20607c84e26385e9abfc4654..fb8c8aeb61236acc7bd11cde72b1bc807b1119c4 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PureTotalHomEuler.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PureTotalHomEuler.lean @@ -1,44 +1,44 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport -import OAI.Topology.ArtinGroups.Complexes.PureUpperBoundariesZero - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -lemma pure_total_hom_euler (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) : - totalChainDimension Q E F (k-l) + totalChainDimension Q E F (k-l+2) + - totalHomDimension Q E F (k-l+1) = - totalChainDimension Q E F (k-l+1) + totalHomDimension Q E F (k-l) + - totalHomDimension Q F E (l-k) := by - have hp (v : ℤ) := pure_hom_euler Q E F hE hF (n := k-l-v) (v := v) (by omega) - have he (v : ℤ) : - Module.finrank K (homSpace Q E F (k-l-v) v) + - Module.finrank K (homSpace Q E F (k-l+2-v) v) + homDimension Q E F (k-l+1-v) v = - Module.finrank K (homSpace Q E F (k-l+1-v) v) + - homDimension Q E F (k-l-v) v + homDimension Q E F (k-l+2-v) v := by - have hh := hp v - rw [← homDimension_dual Q E F (k-l-v+2) v] at hh - have h₁ : k-l-v+1=k-l+1-v := by omega - have h₂ : k-l-v+2=k-l+2-v := by omega - rw [h₁,h₂] at hh - exact hh - have hs := Finset.sum_congr (s₁ := homInternalSupport Q E F) (s₂ := homInternalSupport Q E F) - rfl (fun v _ => he v) - simp only [Finset.sum_add_distrib] at hs - change totalChainDimension Q E F (k-l) + totalChainDimension Q E F (k-l+2) + - totalHomDimension Q E F (k-l+1) = totalChainDimension Q E F (k-l+1) + - totalHomDimension Q E F (k-l) + totalHomDimension Q E F (k-l+2) at hs - rw [totalHomDimension_dual Q E F (k-l+2)] at hs - have h : 2-(k-l+2)=l-k := by omega - rw [h] at hs - exact hs - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport +import OAI.Topology.ArtinGroups.Complexes.PureUpperBoundariesZero + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +lemma pure_total_hom_euler (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) : + totalChainDimension Q E F (k-l) + totalChainDimension Q E F (k-l+2) + + totalHomDimension Q E F (k-l+1) = + totalChainDimension Q E F (k-l+1) + totalHomDimension Q E F (k-l) + + totalHomDimension Q F E (l-k) := by + have hp (v : ℤ) := pure_hom_euler Q E F hE hF (n := k-l-v) (v := v) (by omega) + have he (v : ℤ) : + Module.finrank K (homSpace Q E F (k-l-v) v) + + Module.finrank K (homSpace Q E F (k-l+2-v) v) + homDimension Q E F (k-l+1-v) v = + Module.finrank K (homSpace Q E F (k-l+1-v) v) + + homDimension Q E F (k-l-v) v + homDimension Q E F (k-l+2-v) v := by + have hh := hp v + rw [← homDimension_dual Q E F (k-l-v+2) v] at hh + have h₁ : k-l-v+1=k-l+1-v := by omega + have h₂ : k-l-v+2=k-l+2-v := by omega + rw [h₁,h₂] at hh + exact hh + have hs := Finset.sum_congr (s₁ := homInternalSupport Q E F) (s₂ := homInternalSupport Q E F) + rfl (fun v _ => he v) + simp only [Finset.sum_add_distrib] at hs + change totalChainDimension Q E F (k-l) + totalChainDimension Q E F (k-l+2) + + totalHomDimension Q E F (k-l+1) = totalChainDimension Q E F (k-l+1) + + totalHomDimension Q E F (k-l) + totalHomDimension Q E F (k-l+2) at hs + rw [totalHomDimension_dual Q E F (k-l+2)] at hs + have h : 2-(k-l+2)=l-k := by omega + rw [h] at hs + exact hs + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/PureUpperBoundariesZero.lean b/lean/OAI/Topology/ArtinGroups/Complexes/PureUpperBoundariesZero.lean index f1f51c3106a55e4f0ee8174ef3189d3102dff6c1..bf4776f2ff1d36fc3d526274c9058f08315fcb29 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/PureUpperBoundariesZero.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/PureUpperBoundariesZero.lean @@ -1,43 +1,43 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PureHomSpaceHomogeneous -import OAI.Topology.ArtinGroups.Complexes.HomStep - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J : Type*} [Fintype I] [Fintype J] - -omit [Fintype V] [DecidableEq A] in -lemma pure_upper_boundaries_zero (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : k-l+2 < n+v) : homBoundaries Q E F n v = ⊥ := by - have hb : homBoundaries Q E F n v ≤ homSpace Q E F n v := - (homBoundaries_le_homCycles Q E F n v).trans inf_le_left - rw [homSpace_pure_total_degree_upper Q E F hE hF h] at hb - exact le_antisymm hb bot_le - -lemma pure_hom_euler (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) {l k n v : ℤ} - (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) - (h : n+v=k-l) : - Module.finrank K (homSpace Q E F n v) + Module.finrank K (homSpace Q E F (n+2) v) + - homDimension Q E F (n+1) v = - Module.finrank K (homSpace Q E F (n+1) v) + homDimension Q E F n v + - homDimension Q F E (-(n+2)) (2-v) := by - have h₀ := hom_exact_dimension Q E F n v - have h₁ := hom_exact_dimension Q E F (n+1) v - have h₂ := hom_exact_dimension Q E F (n+2) v - rw [pure_coefficient_boundaries_zero Q E F hE hF h, finrank_bot] at h₀ - rw [pure_upper_boundaries_zero Q E F hE hF (n := n+2+1) (v := v) (by omega), - finrank_bot] at h₂ - rw [homDimension_dual Q E F (n+2) v] at h₂ - have hn : n+1+1=n+2 := by omega - rw [hn] at h₁ - omega - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PureHomSpaceHomogeneous +import OAI.Topology.ArtinGroups.Complexes.HomStep + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J : Type*} [Fintype I] [Fintype J] + +omit [Fintype V] [DecidableEq A] in +lemma pure_upper_boundaries_zero (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : k-l+2 < n+v) : homBoundaries Q E F n v = ⊥ := by + have hb : homBoundaries Q E F n v ≤ homSpace Q E F n v := + (homBoundaries_le_homCycles Q E F n v).trans inf_le_left + rw [homSpace_pure_total_degree_upper Q E F hE hF h] at hb + exact le_antisymm hb bot_le + +lemma pure_hom_euler (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) {l k n v : ℤ} + (hE : ∀ i, (E.placement i).level = l) (hF : ∀ j, (F.placement j).level = k) + (h : n+v=k-l) : + Module.finrank K (homSpace Q E F n v) + Module.finrank K (homSpace Q E F (n+2) v) + + homDimension Q E F (n+1) v = + Module.finrank K (homSpace Q E F (n+1) v) + homDimension Q E F n v + + homDimension Q F E (-(n+2)) (2-v) := by + have h₀ := hom_exact_dimension Q E F n v + have h₁ := hom_exact_dimension Q E F (n+1) v + have h₂ := hom_exact_dimension Q E F (n+2) v + rw [pure_coefficient_boundaries_zero Q E F hE hF h, finrank_bot] at h₀ + rw [pure_upper_boundaries_zero Q E F hE hF (n := n+2+1) (v := v) (by omega), + finrank_bot] at h₂ + rw [homDimension_dual Q E F (n+2) v] at h₂ + have hn : n+1+1=n+2 := by omega + rw [hn] at h₁ + omega + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReducedAmplitudeTwistLevel.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReducedAmplitudeTwistLevel.lean index 92f0818639507ef89f8476ad98d3cf51da386e86..bcee6895bcae4911b21768c76f3655c98a1bde18 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReducedAmplitudeTwistLevel.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReducedAmplitudeTwistLevel.lean @@ -1,70 +1,70 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Complexes.MinimalEmbedding -import OAI.Topology.ArtinGroups.Complexes.ActedIndex -import OAI.Topology.ArtinGroups.Quivers.LengthCases - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -universe u - -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I : Type u} [Fintype I] [DecidableEq I] - -lemma reducedAmplitudeTwist_level (E : BasedComplex Q (K := K) I) (α : V) - (k : AmplitudeCoreIndex Q E α) : - ∃ i : I, - ((reducedAmplitudeTwist Q E α).placement k).level = (E.placement i).level ∨ - (((reducedAmplitudeTwist Q E α).placement k).level = (E.placement i).level + 1 ∧ - ((reducedAmplitudeTwist Q E α).placement k).color = α) := by - rw [reducedAmplitudeTwist_placement] - rcases k with u | i - · refine ⟨u.val.1, ?_⟩ - have h := Path.length_cases u.val.2.val - have hn := u.property - dsimp only [GeneratorPlacement.level] - rcases h with h | h | h - · exact (hn h).elim - · exact Or.inl (by omega) - · exact Or.inr ⟨by omega, rfl⟩ - · exact ⟨i.val, Or.inl rfl⟩ - -theorem positiveTwist_interval (E : BasedComplex Q (K := K) I) (α : V) (a b : ℤ) - (hE : ∀ i, a ≤ (E.placement i).level ∧ (E.placement i).level ≤ b) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.positiveTwist Q α) F.complex) ∧ - ∀ j, a ≤ (F.complex.placement j).level ∧ (F.complex.placement j).level ≤ b + 1 := by - let B := FiniteModel.ofComplex Q (reducedAmplitudeTwist Q E α) - obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q - refine ⟨F, hF, ⟨(amplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ - intro j - rw [hf j] - obtain ⟨i, hi⟩ := reducedAmplitudeTwist_level Q E α (f j) - have hb := hE i - change a ≤ ((reducedAmplitudeTwist Q E α).placement (f j)).level ∧ - ((reducedAmplitudeTwist Q E α).placement (f j)).level ≤ b + 1 - rcases hi with hi | ⟨hi, _⟩ <;> omega - -theorem positiveTwist_pure (E : BasedComplex Q (K := K) I) (α : V) (d : ℤ) - (hE : ∀ i, (E.placement i).level = d) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.positiveTwist Q α) F.complex) ∧ - ∀ j, (F.complex.placement j).level = d ∨ - ((F.complex.placement j).level = d + 1 ∧ (F.complex.placement j).color = α) := by - let B := FiniteModel.ofComplex Q (reducedAmplitudeTwist Q E α) - obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q - refine ⟨F, hF, ⟨(amplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ - intro j - rw [hf j] - obtain ⟨i, hi⟩ := reducedAmplitudeTwist_level Q E α (f j) - change ((reducedAmplitudeTwist Q E α).placement (f j)).level = d ∨ - (((reducedAmplitudeTwist Q E α).placement (f j)).level = d + 1 ∧ - ((reducedAmplitudeTwist Q E α).placement (f j)).color = α) - simpa only [hE i] using hi - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Complexes.MinimalEmbedding +import OAI.Topology.ArtinGroups.Complexes.ActedIndex +import OAI.Topology.ArtinGroups.Quivers.LengthCases + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +universe u + +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I : Type u} [Fintype I] [DecidableEq I] + +lemma reducedAmplitudeTwist_level (E : BasedComplex Q (K := K) I) (α : V) + (k : AmplitudeCoreIndex Q E α) : + ∃ i : I, + ((reducedAmplitudeTwist Q E α).placement k).level = (E.placement i).level ∨ + (((reducedAmplitudeTwist Q E α).placement k).level = (E.placement i).level + 1 ∧ + ((reducedAmplitudeTwist Q E α).placement k).color = α) := by + rw [reducedAmplitudeTwist_placement] + rcases k with u | i + · refine ⟨u.val.1, ?_⟩ + have h := Path.length_cases u.val.2.val + have hn := u.property + dsimp only [GeneratorPlacement.level] + rcases h with h | h | h + · exact (hn h).elim + · exact Or.inl (by omega) + · exact Or.inr ⟨by omega, rfl⟩ + · exact ⟨i.val, Or.inl rfl⟩ + +theorem positiveTwist_interval (E : BasedComplex Q (K := K) I) (α : V) (a b : ℤ) + (hE : ∀ i, a ≤ (E.placement i).level ∧ (E.placement i).level ≤ b) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.positiveTwist Q α) F.complex) ∧ + ∀ j, a ≤ (F.complex.placement j).level ∧ (F.complex.placement j).level ≤ b + 1 := by + let B := FiniteModel.ofComplex Q (reducedAmplitudeTwist Q E α) + obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q + refine ⟨F, hF, ⟨(amplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ + intro j + rw [hf j] + obtain ⟨i, hi⟩ := reducedAmplitudeTwist_level Q E α (f j) + have hb := hE i + change a ≤ ((reducedAmplitudeTwist Q E α).placement (f j)).level ∧ + ((reducedAmplitudeTwist Q E α).placement (f j)).level ≤ b + 1 + rcases hi with hi | ⟨hi, _⟩ <;> omega + +theorem positiveTwist_pure (E : BasedComplex Q (K := K) I) (α : V) (d : ℤ) + (hE : ∀ i, (E.placement i).level = d) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.positiveTwist Q α) F.complex) ∧ + ∀ j, (F.complex.placement j).level = d ∨ + ((F.complex.placement j).level = d + 1 ∧ (F.complex.placement j).color = α) := by + let B := FiniteModel.ofComplex Q (reducedAmplitudeTwist Q E α) + obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q + refine ⟨F, hF, ⟨(amplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ + intro j + rw [hf j] + obtain ⟨i, hi⟩ := reducedAmplitudeTwist_level Q E α (f j) + change ((reducedAmplitudeTwist Q E α).placement (f j)).level = d ∨ + (((reducedAmplitudeTwist Q E α).placement (f j)).level = d + 1 ∧ + ((reducedAmplitudeTwist Q E α).placement (f j)).color = α) + simpa only [hE i] using hi + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNegativeAmplitudeTwist.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNegativeAmplitudeTwist.lean index fcf28832977ab6fb6addedc7cf22217aeb7cbd13..a5cb7e41d052ae210b74c5ba6693ae8b20aa7dc0 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNegativeAmplitudeTwist.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNegativeAmplitudeTwist.lean @@ -1,70 +1,70 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Complexes.MinimalEmbedding -import OAI.Topology.ArtinGroups.Quivers.LengthCases -import OAI.Topology.ArtinGroups.Complexes.NegativeAmplitudeCoreIndex - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -universe u - -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I : Type u} [Fintype I] [DecidableEq I] - -lemma reducedNegativeAmplitudeTwist_level (E : BasedComplex Q (K := K) I) (α : V) - (k : NegativeAmplitudeCoreIndex Q E α) : - ∃ i : I, - ((reducedNegativeAmplitudeTwist Q E α).placement k).level = (E.placement i).level ∨ - (((reducedNegativeAmplitudeTwist Q E α).placement k).level = (E.placement i).level - 1 ∧ - ((reducedNegativeAmplitudeTwist Q E α).placement k).color = α) := by - rw [reducedNegativeAmplitudeTwist_placement] - rcases k with u | i - · refine ⟨u.val.1, ?_⟩ - have h := Path.length_cases u.val.2.val - have hn := u.property - dsimp only [GeneratorPlacement.level] - rcases h with h | h | h - · exact Or.inr ⟨by omega, rfl⟩ - · exact Or.inl (by omega) - · exact (hn h).elim - · exact ⟨i.val, Or.inl rfl⟩ - -theorem negativeTwist_interval (E : BasedComplex Q (K := K) I) (α : V) (a b : ℤ) - (hE : ∀ i, a ≤ (E.placement i).level ∧ (E.placement i).level ≤ b) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.negativeTwist Q α) F.complex) ∧ - ∀ j, a - 1 ≤ (F.complex.placement j).level ∧ (F.complex.placement j).level ≤ b := by - let B := FiniteModel.ofComplex Q (reducedNegativeAmplitudeTwist Q E α) - obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q - refine ⟨F, hF, ⟨(negativeAmplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ - intro j - rw [hf j] - obtain ⟨i, hi⟩ := reducedNegativeAmplitudeTwist_level Q E α (f j) - have hb := hE i - change a - 1 ≤ ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level ∧ - ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level ≤ b - rcases hi with hi | ⟨hi, _⟩ <;> omega - -theorem negativeTwist_pure (E : BasedComplex Q (K := K) I) (α : V) (d : ℤ) - (hE : ∀ i, (E.placement i).level = d) : - ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ - Nonempty (HomotopyEquivalence Q (E.negativeTwist Q α) F.complex) ∧ - ∀ j, (F.complex.placement j).level = d ∨ - ((F.complex.placement j).level = d - 1 ∧ (F.complex.placement j).color = α) := by - let B := FiniteModel.ofComplex Q (reducedNegativeAmplitudeTwist Q E α) - obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q - refine ⟨F, hF, ⟨(negativeAmplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ - intro j - rw [hf j] - obtain ⟨i, hi⟩ := reducedNegativeAmplitudeTwist_level Q E α (f j) - change ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level = d ∨ - (((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level = d - 1 ∧ - ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).color = α) - simpa only [hE i] using hi - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Complexes.MinimalEmbedding +import OAI.Topology.ArtinGroups.Quivers.LengthCases +import OAI.Topology.ArtinGroups.Complexes.NegativeAmplitudeCoreIndex + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +universe u + +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I : Type u} [Fintype I] [DecidableEq I] + +lemma reducedNegativeAmplitudeTwist_level (E : BasedComplex Q (K := K) I) (α : V) + (k : NegativeAmplitudeCoreIndex Q E α) : + ∃ i : I, + ((reducedNegativeAmplitudeTwist Q E α).placement k).level = (E.placement i).level ∨ + (((reducedNegativeAmplitudeTwist Q E α).placement k).level = (E.placement i).level - 1 ∧ + ((reducedNegativeAmplitudeTwist Q E α).placement k).color = α) := by + rw [reducedNegativeAmplitudeTwist_placement] + rcases k with u | i + · refine ⟨u.val.1, ?_⟩ + have h := Path.length_cases u.val.2.val + have hn := u.property + dsimp only [GeneratorPlacement.level] + rcases h with h | h | h + · exact Or.inr ⟨by omega, rfl⟩ + · exact Or.inl (by omega) + · exact (hn h).elim + · exact ⟨i.val, Or.inl rfl⟩ + +theorem negativeTwist_interval (E : BasedComplex Q (K := K) I) (α : V) (a b : ℤ) + (hE : ∀ i, a ≤ (E.placement i).level ∧ (E.placement i).level ≤ b) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.negativeTwist Q α) F.complex) ∧ + ∀ j, a - 1 ≤ (F.complex.placement j).level ∧ (F.complex.placement j).level ≤ b := by + let B := FiniteModel.ofComplex Q (reducedNegativeAmplitudeTwist Q E α) + obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q + refine ⟨F, hF, ⟨(negativeAmplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ + intro j + rw [hf j] + obtain ⟨i, hi⟩ := reducedNegativeAmplitudeTwist_level Q E α (f j) + have hb := hE i + change a - 1 ≤ ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level ∧ + ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level ≤ b + rcases hi with hi | ⟨hi, _⟩ <;> omega + +theorem negativeTwist_pure (E : BasedComplex Q (K := K) I) (α : V) (d : ℤ) + (hE : ∀ i, (E.placement i).level = d) : + ∃ F : FiniteModel.{u} Q (K := K), F.complex.IsMinimal Q ∧ + Nonempty (HomotopyEquivalence Q (E.negativeTwist Q α) F.complex) ∧ + ∀ j, (F.complex.placement j).level = d ∨ + ((F.complex.placement j).level = d - 1 ∧ (F.complex.placement j).color = α) := by + let B := FiniteModel.ofComplex Q (reducedNegativeAmplitudeTwist Q E α) + obtain ⟨F, hF, ⟨e⟩, f, hf⟩ := B.exists_minimal_embedding Q + refine ⟨F, hF, ⟨(negativeAmplitudeTwistReduction Q E α).trans Q e⟩, ?_⟩ + intro j + rw [hf j] + obtain ⟨i, hi⟩ := reducedNegativeAmplitudeTwist_level Q E α (f j) + change ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level = d ∨ + (((reducedNegativeAmplitudeTwist Q E α).placement (f j)).level = d - 1 ∧ + ((reducedNegativeAmplitudeTwist Q E α).placement (f j)).color = α) + simpa only [hE i] using hi + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNoTopDivisor.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNoTopDivisor.lean index 79447323c2fef6392fe1c06fe9cdc689c7d1fe8d..776b28e2bfccea6972f8ad7f1a39067f3ffaab54 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNoTopDivisor.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReducedNoTopDivisor.lean @@ -1,51 +1,51 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveTopDivisor -import OAI.Topology.ArtinGroups.Coxeter.OrdinaryCoxeterMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in -lemma reduced_no_top_divisor {α:V} {w v:List V} - (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced (α::w)) - (h:PositiveBraidRel Q w (α::v)) : False := by - let cs := (ordinaryCoxeterMatrix Q).toCoxeterSystem - have he:cs.wordProd (α::w)=cs.wordProd v := by - rw [CoxeterSystem.wordProd_cons,PositiveBraidRel.coxeter_eq Q h, - CoxeterSystem.wordProd_cons,CoxeterSystem.simple_mul_simple_cancel_left] - have hh:=cs.length_wordProd_le v - have hl:=PositiveBraidRel.length_eq Q h - change cs.length (cs.wordProd (α::w))=(α::w).length at hr - rw [he] at hr - simp only [List.length_cons] at hr hl - omega - -theorem reducedWord_testUpper (hn:∀ a,Q.source a≠Q.target a) - (U:Set V) - (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) - (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ) (hx:ClassTestUpper Q x U t) - (w:List V) (hw:∀ s∈w,s∈U) - (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : - ClassTestUpper Q (positiveWordAction Q w x) U (t+1) := by - induction w with - | nil => exact fun α hα l hl c=>hx α hα l (by omega) c - | cons α w ih => - have hα:α∈U:=hw α (by simp) - have hw':∀ s∈w,s∈U:=fun s hs=>hw s (List.mem_cons_of_mem _ hs) - have hr':(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w:=by - simpa only [List.drop_succ_cons,List.drop_zero] using hr.drop 1 - have ht:=ih hw' hr' - apply (classPositiveTwist_testUpper_iff Q hn _ U α hα ht).mpr - intro c - by_contra htop - obtain ⟨v,hv⟩:=positive_top_divisor Q hn U hU x t hx w hw' α hα (t+1) - (by omega) ht c htop - exact reduced_no_top_divisor Q hr hv - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTopDivisor +import OAI.Topology.ArtinGroups.Coxeter.OrdinaryCoxeterMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] in +lemma reduced_no_top_divisor {α:V} {w v:List V} + (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced (α::w)) + (h:PositiveBraidRel Q w (α::v)) : False := by + let cs := (ordinaryCoxeterMatrix Q).toCoxeterSystem + have he:cs.wordProd (α::w)=cs.wordProd v := by + rw [CoxeterSystem.wordProd_cons,PositiveBraidRel.coxeter_eq Q h, + CoxeterSystem.wordProd_cons,CoxeterSystem.simple_mul_simple_cancel_left] + have hh:=cs.length_wordProd_le v + have hl:=PositiveBraidRel.length_eq Q h + change cs.length (cs.wordProd (α::w))=(α::w).length at hr + rw [he] at hr + simp only [List.length_cons] at hr hl + omega + +theorem reducedWord_testUpper (hn:∀ a,Q.source a≠Q.target a) + (U:Set V) + (hU:∀ α∈U,∀ β∈U,α=β ∨ OrthogonalVertices Q α β ∨ Nonempty (SimpleEdge Q α β)) + (x:FiniteHomotopyClass Q (K:=K)) (t:ℤ) (hx:ClassTestUpper Q x U t) + (w:List V) (hw:∀ s∈w,s∈U) + (hr:(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w) : + ClassTestUpper Q (positiveWordAction Q w x) U (t+1) := by + induction w with + | nil => exact fun α hα l hl c=>hx α hα l (by omega) c + | cons α w ih => + have hα:α∈U:=hw α (by simp) + have hw':∀ s∈w,s∈U:=fun s hs=>hw s (List.mem_cons_of_mem _ hs) + have hr':(ordinaryCoxeterMatrix Q).toCoxeterSystem.IsReduced w:=by + simpa only [List.drop_succ_cons,List.drop_zero] using hr.drop 1 + have ht:=ih hw' hr' + apply (classPositiveTwist_testUpper_iff Q hn _ U α hα ht).mpr + intro c + by_contra htop + obtain ⟨v,hv⟩:=positive_top_divisor Q hn U hU x t hx w hw' α hα (t+1) + (by omega) ht c htop + exact reduced_no_top_divisor Q hr hv + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Refl.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Refl.lean index aaf4bb1d121cb66eca26c51b6cbb5d9997c9e89b..7d52fc595ab7bde17b0147be677ccff014e93238 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Refl.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Refl.lean @@ -1,136 +1,136 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.ConeMap -import OAI.Topology.ArtinGroups.Complexes.Identity -import OAI.Topology.ArtinGroups.Complexes.Reindex -import OAI.Topology.ArtinGroups.Quivers.Level - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J L N : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [Fintype L] [Fintype N] - [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] - -noncomputable def ChainIsomorphism.refl (E : BasedComplex Q (K := K) I) : - ChainIsomorphism Q E E where - forward := Map.identity Q E - backward := Map.identity Q E - sourceEquation := projectiveIdentity_mul Q (projectiveEntries_identity Q) - targetEquation := projectiveIdentity_mul Q (projectiveEntries_identity Q) - -noncomputable def ChainIsomorphism.symm {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (a : ChainIsomorphism Q E F) : - ChainIsomorphism Q F E where - forward := a.backward - backward := a.forward - sourceEquation := a.targetEquation - targetEquation := a.sourceEquation - -noncomputable def ChainIsomorphism.trans {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {G : BasedComplex Q (K := K) L} - (a : ChainIsomorphism Q E F) (b : ChainIsomorphism Q F G) : - ChainIsomorphism Q E G where - forward := Map.comp Q a.forward b.forward - backward := Map.comp Q b.backward a.backward - sourceEquation := by - change (a.forward.matrix*b.forward.matrix)*(b.backward.matrix*a.backward.matrix)=_ - calc - _ = a.forward.matrix*(b.forward.matrix*b.backward.matrix)*a.backward.matrix := by simp only [Matrix.mul_assoc] - _ = _ := by - rw [b.sourceEquation] - exact (congrArg (fun z => z*a.backward.matrix) - (mul_projectiveIdentity Q a.forward.entries)).trans a.sourceEquation - targetEquation := by - change (b.backward.matrix*a.backward.matrix)*(a.forward.matrix*b.forward.matrix)=_ - calc - _ = b.backward.matrix*(a.backward.matrix*a.forward.matrix)*b.forward.matrix := by simp only [Matrix.mul_assoc] - _ = _ := by - rw [a.targetEquation] - exact (congrArg (fun z => z*b.forward.matrix) - (mul_projectiveIdentity Q b.backward.entries)).trans b.targetEquation - -noncomputable def ChainIsomorphism.toHomotopyEquivalence {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (a : ChainIsomorphism Q E F) : - HomotopyEquivalence Q E F where - forward := a.forward - backward := a.backward - sourceHomotopy := 0 - targetHomotopy := 0 - sourceEntries := projectiveEntries_zero Q - targetEntries := projectiveEntries_zero Q - sourceDegree := mapDegree_zero Q (-1) 0 - targetDegree := mapDegree_zero Q (-1) 0 - sourceEquation := by simpa only [Matrix.mul_zero,Matrix.zero_mul,add_zero] using a.sourceEquation - targetEquation := by simpa only [Matrix.mul_zero,Matrix.zero_mul,add_zero] using a.targetEquation - -noncomputable def reindexChainIsomorphism (E : BasedComplex Q (K := K) I) (e : J ≃ I) : - ChainIsomorphism Q E (E.reindex Q e) where - forward := E.reindexForward Q e - backward := E.reindexBackward Q e - sourceEquation := by - have h := (E.reindexHomotopyEquivalence Q e).sourceEquation - simpa only [reindexHomotopyEquivalence,Matrix.mul_zero,Matrix.zero_mul,add_zero] using h - targetEquation := by - have h := (E.reindexHomotopyEquivalence Q e).targetEquation - simpa only [reindexHomotopyEquivalence,Matrix.mul_zero,Matrix.zero_mul,add_zero] using h - -noncomputable def Map.reindex {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) (e : L ≃ I) (d : N ≃ J) : - Map Q (E.reindex Q e) (F.reindex Q d) where - matrix := f.matrix.submatrix e d - entries := ⟨fun i j => f.entries.1 (e i) (d j), fun i j => f.entries.2 (e i) (d j)⟩ - degree := fun i j => f.degree (e i) (d j) - commute := by - change E.differential.submatrix e e * f.matrix.submatrix e d = - f.matrix.submatrix e d * F.differential.submatrix d d - rw [Matrix.submatrix_mul_equiv,Matrix.submatrix_mul_equiv,f.commute] - -lemma Map.coneIdentity {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (f : Map Q E F) : - Matrix.fromBlocks (projectiveIdentity Q (K := K) E.placement) 0 0 - (projectiveIdentity Q F.placement) = projectiveIdentity Q (f.cone Q).placement := by - unfold projectiveIdentity - rw [Matrix.fromBlocks_diagonal] - congr 1 - funext i - rcases i with i|i <;> rfl - -noncomputable def ChainIsomorphism.cone - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - {G : BasedComplex Q (K := K) L} {H : BasedComplex Q (K := K) N} - (f : Map Q E F) (g : Map Q G H) - (a : ChainIsomorphism Q E G) (b : ChainIsomorphism Q F H) - (comm : a.forward.matrix * g.matrix = f.matrix * b.forward.matrix) : - ChainIsomorphism Q (f.cone Q) (g.cone Q) := by - have hc : a.backward.matrix * f.matrix = g.matrix * b.backward.matrix := by - calc - _ = a.backward.matrix * (f.matrix * (b.forward.matrix*b.backward.matrix)) := by - rw [b.sourceEquation] - exact congrArg (fun z => a.backward.matrix*z) (mul_projectiveIdentity Q f.entries).symm - _ = a.backward.matrix * ((a.forward.matrix*g.matrix)*b.backward.matrix) := by - rw [← Matrix.mul_assoc f.matrix,← comm] - _ = (a.backward.matrix*a.forward.matrix)*g.matrix*b.backward.matrix := by - simp only [Matrix.mul_assoc] - _ = _ := by - rw [a.targetEquation] - exact congrArg (fun z => z*b.backward.matrix) (projectiveIdentity_mul Q g.entries) - exact { - forward := f.coneMap Q g a.forward b.forward comm - backward := g.coneMap Q f a.backward b.backward hc - sourceEquation := by - change Matrix.fromBlocks a.forward.matrix 0 0 b.forward.matrix * - Matrix.fromBlocks a.backward.matrix 0 0 b.backward.matrix = _ - rw [Matrix.fromBlocks_multiply] - simp only [Matrix.mul_zero,Matrix.zero_mul,add_zero,zero_add,a.sourceEquation,b.sourceEquation] - exact f.coneIdentity Q - targetEquation := by - change Matrix.fromBlocks a.backward.matrix 0 0 b.backward.matrix * - Matrix.fromBlocks a.forward.matrix 0 0 b.forward.matrix = _ - rw [Matrix.fromBlocks_multiply] - simp only [Matrix.mul_zero,Matrix.zero_mul,add_zero,zero_add,a.targetEquation,b.targetEquation] - exact g.coneIdentity Q } - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.ConeMap +import OAI.Topology.ArtinGroups.Complexes.Identity +import OAI.Topology.ArtinGroups.Complexes.Reindex +import OAI.Topology.ArtinGroups.Quivers.Level + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J L N : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [Fintype L] [Fintype N] + [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] + +noncomputable def ChainIsomorphism.refl (E : BasedComplex Q (K := K) I) : + ChainIsomorphism Q E E where + forward := Map.identity Q E + backward := Map.identity Q E + sourceEquation := projectiveIdentity_mul Q (projectiveEntries_identity Q) + targetEquation := projectiveIdentity_mul Q (projectiveEntries_identity Q) + +noncomputable def ChainIsomorphism.symm {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (a : ChainIsomorphism Q E F) : + ChainIsomorphism Q F E where + forward := a.backward + backward := a.forward + sourceEquation := a.targetEquation + targetEquation := a.sourceEquation + +noncomputable def ChainIsomorphism.trans {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {G : BasedComplex Q (K := K) L} + (a : ChainIsomorphism Q E F) (b : ChainIsomorphism Q F G) : + ChainIsomorphism Q E G where + forward := Map.comp Q a.forward b.forward + backward := Map.comp Q b.backward a.backward + sourceEquation := by + change (a.forward.matrix*b.forward.matrix)*(b.backward.matrix*a.backward.matrix)=_ + calc + _ = a.forward.matrix*(b.forward.matrix*b.backward.matrix)*a.backward.matrix := by simp only [Matrix.mul_assoc] + _ = _ := by + rw [b.sourceEquation] + exact (congrArg (fun z => z*a.backward.matrix) + (mul_projectiveIdentity Q a.forward.entries)).trans a.sourceEquation + targetEquation := by + change (b.backward.matrix*a.backward.matrix)*(a.forward.matrix*b.forward.matrix)=_ + calc + _ = b.backward.matrix*(a.backward.matrix*a.forward.matrix)*b.forward.matrix := by simp only [Matrix.mul_assoc] + _ = _ := by + rw [a.targetEquation] + exact (congrArg (fun z => z*b.forward.matrix) + (mul_projectiveIdentity Q b.backward.entries)).trans b.targetEquation + +noncomputable def ChainIsomorphism.toHomotopyEquivalence {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (a : ChainIsomorphism Q E F) : + HomotopyEquivalence Q E F where + forward := a.forward + backward := a.backward + sourceHomotopy := 0 + targetHomotopy := 0 + sourceEntries := projectiveEntries_zero Q + targetEntries := projectiveEntries_zero Q + sourceDegree := mapDegree_zero Q (-1) 0 + targetDegree := mapDegree_zero Q (-1) 0 + sourceEquation := by simpa only [Matrix.mul_zero,Matrix.zero_mul,add_zero] using a.sourceEquation + targetEquation := by simpa only [Matrix.mul_zero,Matrix.zero_mul,add_zero] using a.targetEquation + +noncomputable def reindexChainIsomorphism (E : BasedComplex Q (K := K) I) (e : J ≃ I) : + ChainIsomorphism Q E (E.reindex Q e) where + forward := E.reindexForward Q e + backward := E.reindexBackward Q e + sourceEquation := by + have h := (E.reindexHomotopyEquivalence Q e).sourceEquation + simpa only [reindexHomotopyEquivalence,Matrix.mul_zero,Matrix.zero_mul,add_zero] using h + targetEquation := by + have h := (E.reindexHomotopyEquivalence Q e).targetEquation + simpa only [reindexHomotopyEquivalence,Matrix.mul_zero,Matrix.zero_mul,add_zero] using h + +noncomputable def Map.reindex {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) (e : L ≃ I) (d : N ≃ J) : + Map Q (E.reindex Q e) (F.reindex Q d) where + matrix := f.matrix.submatrix e d + entries := ⟨fun i j => f.entries.1 (e i) (d j), fun i j => f.entries.2 (e i) (d j)⟩ + degree := fun i j => f.degree (e i) (d j) + commute := by + change E.differential.submatrix e e * f.matrix.submatrix e d = + f.matrix.submatrix e d * F.differential.submatrix d d + rw [Matrix.submatrix_mul_equiv,Matrix.submatrix_mul_equiv,f.commute] + +lemma Map.coneIdentity {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (f : Map Q E F) : + Matrix.fromBlocks (projectiveIdentity Q (K := K) E.placement) 0 0 + (projectiveIdentity Q F.placement) = projectiveIdentity Q (f.cone Q).placement := by + unfold projectiveIdentity + rw [Matrix.fromBlocks_diagonal] + congr 1 + funext i + rcases i with i|i <;> rfl + +noncomputable def ChainIsomorphism.cone + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + {G : BasedComplex Q (K := K) L} {H : BasedComplex Q (K := K) N} + (f : Map Q E F) (g : Map Q G H) + (a : ChainIsomorphism Q E G) (b : ChainIsomorphism Q F H) + (comm : a.forward.matrix * g.matrix = f.matrix * b.forward.matrix) : + ChainIsomorphism Q (f.cone Q) (g.cone Q) := by + have hc : a.backward.matrix * f.matrix = g.matrix * b.backward.matrix := by + calc + _ = a.backward.matrix * (f.matrix * (b.forward.matrix*b.backward.matrix)) := by + rw [b.sourceEquation] + exact congrArg (fun z => a.backward.matrix*z) (mul_projectiveIdentity Q f.entries).symm + _ = a.backward.matrix * ((a.forward.matrix*g.matrix)*b.backward.matrix) := by + rw [← Matrix.mul_assoc f.matrix,← comm] + _ = (a.backward.matrix*a.forward.matrix)*g.matrix*b.backward.matrix := by + simp only [Matrix.mul_assoc] + _ = _ := by + rw [a.targetEquation] + exact congrArg (fun z => z*b.backward.matrix) (projectiveIdentity_mul Q g.entries) + exact { + forward := f.coneMap Q g a.forward b.forward comm + backward := g.coneMap Q f a.backward b.backward hc + sourceEquation := by + change Matrix.fromBlocks a.forward.matrix 0 0 b.forward.matrix * + Matrix.fromBlocks a.backward.matrix 0 0 b.backward.matrix = _ + rw [Matrix.fromBlocks_multiply] + simp only [Matrix.mul_zero,Matrix.zero_mul,add_zero,zero_add,a.sourceEquation,b.sourceEquation] + exact f.coneIdentity Q + targetEquation := by + change Matrix.fromBlocks a.backward.matrix 0 0 b.backward.matrix * + Matrix.fromBlocks a.forward.matrix 0 0 b.forward.matrix = _ + rw [Matrix.fromBlocks_multiply] + simp only [Matrix.mul_zero,Matrix.zero_mul,add_zero,zero_add,a.targetEquation,b.targetEquation] + exact g.coneIdentity Q } + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Reindex.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Reindex.lean index 3e317b35db93572a9be97cb2d22af844aaaadb89..d592175e5995c255169cfa5f1204e7ecf154bb5c 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Reindex.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Reindex.lean @@ -1,88 +1,88 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Quivers.SmulMul - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] - -noncomputable def reindex (E : BasedComplex Q (K := K) I) (e : J ≃ I) : - BasedComplex Q (K := K) J where - placement := E.placement ∘ e - differential := E.differential.submatrix e e - entries := ⟨fun i j => E.entries.1 (e i) (e j), fun i j => E.entries.2 (e i) (e j)⟩ - degree i j := E.degree (e i) (e j) - square_zero := by - rw [Matrix.submatrix_mul_equiv, E.square_zero] - rfl - -variable [DecidableEq I] [DecidableEq J] - -noncomputable def reindexForward (E : BasedComplex Q (K := K) I) (e : J ≃ I) : - Map Q E (E.reindex Q e) where - matrix := (projectiveIdentity Q E.placement).submatrix id e - entries := ⟨fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).1 i (e j), - fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).2 i (e j)⟩ - degree i j := mapDegree_identity Q (p := E.placement) i (e j) - commute := by - change E.differential.submatrix id (Equiv.refl I) * - (projectiveIdentity Q E.placement).submatrix (Equiv.refl I) e = - (projectiveIdentity Q E.placement).submatrix id e * E.differential.submatrix e e - rw [Matrix.submatrix_mul_equiv, Matrix.submatrix_mul_equiv] - exact congrArg (fun M : Matrix I I (Q.Zigzag K) => M.submatrix id e) - ((mul_projectiveIdentity Q E.entries).trans (projectiveIdentity_mul Q E.entries).symm) - -noncomputable def reindexBackward (E : BasedComplex Q (K := K) I) (e : J ≃ I) : - Map Q (E.reindex Q e) E where - matrix := (projectiveIdentity Q E.placement).submatrix e id - entries := ⟨fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).1 (e i) j, - fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).2 (e i) j⟩ - degree i j := mapDegree_identity Q (p := E.placement) (e i) j - commute := by - change E.differential.submatrix e e * (projectiveIdentity Q E.placement).submatrix e id = - (projectiveIdentity Q E.placement).submatrix e (Equiv.refl I) * - E.differential.submatrix (Equiv.refl I) id - rw [Matrix.submatrix_mul_equiv, Matrix.submatrix_mul_equiv] - exact congrArg (fun M : Matrix I I (Q.Zigzag K) => M.submatrix e id) - ((mul_projectiveIdentity Q E.entries).trans (projectiveIdentity_mul Q E.entries).symm) - -lemma reindexIdentity (E : BasedComplex Q (K := K) I) (e : J ≃ I) : - (projectiveIdentity Q (K := K) E.placement).submatrix e e = - projectiveIdentity Q (E.reindex Q e).placement := by - apply Matrix.ext - intro i j - change (if e i = e j then vertexId Q (E.placement (e i)).color else 0) = - if i = j then vertexId Q (E.placement (e i)).color else 0 - simp only [e.injective.eq_iff] - -noncomputable def reindexHomotopyEquivalence (E : BasedComplex Q (K := K) I) (e : J ≃ I) : - HomotopyEquivalence Q E (E.reindex Q e) where - forward := E.reindexForward Q e - backward := E.reindexBackward Q e - sourceHomotopy := 0 - targetHomotopy := 0 - sourceEntries := projectiveEntries_zero Q - targetEntries := projectiveEntries_zero Q - sourceDegree := mapDegree_zero Q (-1) 0 - targetDegree := mapDegree_zero Q (-1) 0 - sourceEquation := by - change (projectiveIdentity Q E.placement).submatrix id e * - (projectiveIdentity Q E.placement).submatrix e id = _ - rw [Matrix.submatrix_mul_equiv] - simp only [Matrix.submatrix_id_id, Matrix.mul_zero, Matrix.zero_mul, add_zero] - exact projectiveIdentity_mul Q (projectiveEntries_identity Q (K := K) (p := E.placement)) - targetEquation := by - change (projectiveIdentity Q E.placement).submatrix e (Equiv.refl I) * - (projectiveIdentity Q E.placement).submatrix (Equiv.refl I) e = _ - rw [Matrix.submatrix_mul_equiv] - simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] - exact (congrArg (fun M : Matrix I I (Q.Zigzag K) => M.submatrix e e) - (projectiveIdentity_mul Q (projectiveEntries_identity Q (K := K) (p := E.placement)))).trans - (reindexIdentity Q E e) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Quivers.SmulMul + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] + +noncomputable def reindex (E : BasedComplex Q (K := K) I) (e : J ≃ I) : + BasedComplex Q (K := K) J where + placement := E.placement ∘ e + differential := E.differential.submatrix e e + entries := ⟨fun i j => E.entries.1 (e i) (e j), fun i j => E.entries.2 (e i) (e j)⟩ + degree i j := E.degree (e i) (e j) + square_zero := by + rw [Matrix.submatrix_mul_equiv, E.square_zero] + rfl + +variable [DecidableEq I] [DecidableEq J] + +noncomputable def reindexForward (E : BasedComplex Q (K := K) I) (e : J ≃ I) : + Map Q E (E.reindex Q e) where + matrix := (projectiveIdentity Q E.placement).submatrix id e + entries := ⟨fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).1 i (e j), + fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).2 i (e j)⟩ + degree i j := mapDegree_identity Q (p := E.placement) i (e j) + commute := by + change E.differential.submatrix id (Equiv.refl I) * + (projectiveIdentity Q E.placement).submatrix (Equiv.refl I) e = + (projectiveIdentity Q E.placement).submatrix id e * E.differential.submatrix e e + rw [Matrix.submatrix_mul_equiv, Matrix.submatrix_mul_equiv] + exact congrArg (fun M : Matrix I I (Q.Zigzag K) => M.submatrix id e) + ((mul_projectiveIdentity Q E.entries).trans (projectiveIdentity_mul Q E.entries).symm) + +noncomputable def reindexBackward (E : BasedComplex Q (K := K) I) (e : J ≃ I) : + Map Q (E.reindex Q e) E where + matrix := (projectiveIdentity Q E.placement).submatrix e id + entries := ⟨fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).1 (e i) j, + fun i j => (projectiveEntries_identity Q (K := K) (p := E.placement)).2 (e i) j⟩ + degree i j := mapDegree_identity Q (p := E.placement) (e i) j + commute := by + change E.differential.submatrix e e * (projectiveIdentity Q E.placement).submatrix e id = + (projectiveIdentity Q E.placement).submatrix e (Equiv.refl I) * + E.differential.submatrix (Equiv.refl I) id + rw [Matrix.submatrix_mul_equiv, Matrix.submatrix_mul_equiv] + exact congrArg (fun M : Matrix I I (Q.Zigzag K) => M.submatrix e id) + ((mul_projectiveIdentity Q E.entries).trans (projectiveIdentity_mul Q E.entries).symm) + +lemma reindexIdentity (E : BasedComplex Q (K := K) I) (e : J ≃ I) : + (projectiveIdentity Q (K := K) E.placement).submatrix e e = + projectiveIdentity Q (E.reindex Q e).placement := by + apply Matrix.ext + intro i j + change (if e i = e j then vertexId Q (E.placement (e i)).color else 0) = + if i = j then vertexId Q (E.placement (e i)).color else 0 + simp only [e.injective.eq_iff] + +noncomputable def reindexHomotopyEquivalence (E : BasedComplex Q (K := K) I) (e : J ≃ I) : + HomotopyEquivalence Q E (E.reindex Q e) where + forward := E.reindexForward Q e + backward := E.reindexBackward Q e + sourceHomotopy := 0 + targetHomotopy := 0 + sourceEntries := projectiveEntries_zero Q + targetEntries := projectiveEntries_zero Q + sourceDegree := mapDegree_zero Q (-1) 0 + targetDegree := mapDegree_zero Q (-1) 0 + sourceEquation := by + change (projectiveIdentity Q E.placement).submatrix id e * + (projectiveIdentity Q E.placement).submatrix e id = _ + rw [Matrix.submatrix_mul_equiv] + simp only [Matrix.submatrix_id_id, Matrix.mul_zero, Matrix.zero_mul, add_zero] + exact projectiveIdentity_mul Q (projectiveEntries_identity Q (K := K) (p := E.placement)) + targetEquation := by + change (projectiveIdentity Q E.placement).submatrix e (Equiv.refl I) * + (projectiveIdentity Q E.placement).submatrix (Equiv.refl I) e = _ + rw [Matrix.submatrix_mul_equiv] + simp only [Matrix.mul_zero, Matrix.zero_mul, add_zero] + exact (congrArg (fun M : Matrix I I (Q.Zigzag K) => M.submatrix e e) + (projectiveIdentity_mul Q (projectiveEntries_identity Q (K := K) (p := E.placement)))).trans + (reindexIdentity Q E e) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReindexConeIsomorphism.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReindexConeIsomorphism.lean index 6131de949d6e3b10e97d0e3999fc074c41a86df5..88050660394f3016c2e8e4f0bd67bdb552581f25 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReindexConeIsomorphism.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReindexConeIsomorphism.lean @@ -1,31 +1,31 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices -import OAI.Topology.ArtinGroups.Complexes.Refl - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J L N : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [Fintype L] [Fintype N] - [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] - {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} - -omit [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] in -lemma Map.reindexCone_eq (f : Map Q E F) (e : L ≃ I) (d : N ≃ J) : - (f.cone Q).reindex Q (Equiv.sumCongr e d) = (f.reindex Q e d).cone Q := by - apply ext_placement_differential - · funext i - rcases i with i|i <;> rfl - · apply Matrix.ext - intro i j - rcases i with i|i <;> rcases j with j|j <;> rfl - -noncomputable def Map.reindexConeIsomorphism (f : Map Q E F) (e : L ≃ I) (d : N ≃ J) : - ChainIsomorphism Q (f.cone Q) ((f.reindex Q e d).cone Q) := by - rw [← f.reindexCone_eq Q e d] - exact reindexChainIsomorphism Q (f.cone Q) (Equiv.sumCongr e d) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices +import OAI.Topology.ArtinGroups.Complexes.Refl + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J L N : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [Fintype L] [Fintype N] + [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] + {E : BasedComplex Q (K := K) I} {F : BasedComplex Q (K := K) J} + +omit [DecidableEq I] [DecidableEq J] [DecidableEq L] [DecidableEq N] in +lemma Map.reindexCone_eq (f : Map Q E F) (e : L ≃ I) (d : N ≃ J) : + (f.cone Q).reindex Q (Equiv.sumCongr e d) = (f.reindex Q e d).cone Q := by + apply ext_placement_differential + · funext i + rcases i with i|i <;> rfl + · apply Matrix.ext + intro i j + rcases i with i|i <;> rcases j with j|j <;> rfl + +noncomputable def Map.reindexConeIsomorphism (f : Map Q E F) (e : L ≃ I) (d : N ≃ J) : + ChainIsomorphism Q (f.cone Q) ((f.reindex Q e d).cone Q) := by + rw [← f.reindexCone_eq Q e d] + exact reindexChainIsomorphism Q (f.cone Q) (Equiv.sumCongr e d) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReindexHomOperator.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReindexHomOperator.lean index 89790695ff4a167227105efc4cc49fdaa3f779b7..451c559b16c1a6cd1be9ef21eea6d0c1dd9ca56a 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReindexHomOperator.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReindexHomOperator.lean @@ -1,84 +1,84 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveHomTransform -import OAI.Topology.ArtinGroups.Complexes.HomOperator - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J I' J' : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] - -noncomputable def reindexHomOperator (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (e : I' ≃ I) (f : J' ≃ J) : - HomOperator Q E F (E.reindex Q e) (F.reindex Q f) where - component _ := { - toFun g := g.submatrix e f - map_add' _ _ := rfl - map_smul' _ _ := rfl } - preserves n v g hg := by - constructor - · exact ⟨fun i j => hg.1.1 (e i) (f j), fun i j => hg.1.2 (e i) (f j)⟩ - · exact fun i j => hg.2 (e i) (f j) - commute n v g _ := by - change E.differential.submatrix e e * g.submatrix e f - - cochainSign (K := K) n • (g.submatrix e f * F.differential.submatrix f f) = - (E.differential * g - cochainSign (K := K) n • (g * F.differential)).submatrix e f - rw [Matrix.submatrix_mul_equiv, Matrix.submatrix_mul_equiv] - rfl - -noncomputable def sandwichHomOperator {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} - {F' : BasedComplex Q (K := K) J'} (a : Map Q E' E) (b : Map Q F F') : - HomOperator Q E F E' F' where - component _ := { - toFun g := a.matrix * g * b.matrix - map_add' _ _ := by simp only [Matrix.mul_add, Matrix.add_mul] - map_smul' _ _ := by simp only [Matrix.mul_smul, Matrix.smul_mul, RingHom.id_apply] } - preserves n v g hg := by - constructor - · exact projectiveEntries_mul Q (projectiveEntries_mul Q a.entries hg.1) b.entries - · change MapDegree Q E'.placement F'.placement n v (a.matrix * g * b.matrix) - simpa only [zero_add, add_zero] using - mapDegree_mul Q (mapDegree_mul Q a.degree hg.2) b.degree - commute n _ g _ := homDifferential_sandwich Q a b n g - -variable [Fintype V] [DecidableEq A] - -noncomputable def positiveHomOperator (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) : - HomOperator Q E F (E.positiveTwist Q α) (F.positiveTwist Q α) where - component n := { - toFun := positiveHomTransform Q E F α n - map_add' f g := by - simp only [positiveHomTransform, testTransform_add, smul_add] - rw [Matrix.fromBlocks_add] - simp only [add_zero] - map_smul' r f := by - simp only [positiveHomTransform, testTransform_smul, RingHom.id_apply] - rw [Matrix.fromBlocks_smul, smul_comm r] - simp only [smul_zero] } - preserves n v g hg := ⟨positiveHomTransform_entries Q E F α n hg.1, - positiveHomTransform_degree Q E F α n v hg.2⟩ - commute n _ g hg := positiveHomTransform_differential Q E F α n hg.1 - -noncomputable def negativeHomOperator (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (α : V) : - HomOperator Q E F (E.negativeTwist Q α) (F.negativeTwist Q α) where - component n := { - toFun := negativeHomTransform Q E F α n - map_add' f g := by - simp only [negativeHomTransform, testTransform_add, smul_add] - rw [Matrix.fromBlocks_add] - simp only [add_zero] - map_smul' r f := by - simp only [negativeHomTransform, testTransform_smul, RingHom.id_apply] - rw [Matrix.fromBlocks_smul, smul_comm r] - simp only [smul_zero] } - preserves n v g hg := ⟨negativeHomTransform_entries Q E F α n hg.1, - negativeHomTransform_degree Q E F α n v hg.2⟩ - commute n _ g hg := negativeHomTransform_differential Q E F α n hg.1 - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveHomTransform +import OAI.Topology.ArtinGroups.Complexes.HomOperator + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J I' J' : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] [Fintype I] [Fintype J] [Fintype I'] [Fintype J'] + +noncomputable def reindexHomOperator (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (e : I' ≃ I) (f : J' ≃ J) : + HomOperator Q E F (E.reindex Q e) (F.reindex Q f) where + component _ := { + toFun g := g.submatrix e f + map_add' _ _ := rfl + map_smul' _ _ := rfl } + preserves n v g hg := by + constructor + · exact ⟨fun i j => hg.1.1 (e i) (f j), fun i j => hg.1.2 (e i) (f j)⟩ + · exact fun i j => hg.2 (e i) (f j) + commute n v g _ := by + change E.differential.submatrix e e * g.submatrix e f - + cochainSign (K := K) n • (g.submatrix e f * F.differential.submatrix f f) = + (E.differential * g - cochainSign (K := K) n • (g * F.differential)).submatrix e f + rw [Matrix.submatrix_mul_equiv, Matrix.submatrix_mul_equiv] + rfl + +noncomputable def sandwichHomOperator {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} {E' : BasedComplex Q (K := K) I'} + {F' : BasedComplex Q (K := K) J'} (a : Map Q E' E) (b : Map Q F F') : + HomOperator Q E F E' F' where + component _ := { + toFun g := a.matrix * g * b.matrix + map_add' _ _ := by simp only [Matrix.mul_add, Matrix.add_mul] + map_smul' _ _ := by simp only [Matrix.mul_smul, Matrix.smul_mul, RingHom.id_apply] } + preserves n v g hg := by + constructor + · exact projectiveEntries_mul Q (projectiveEntries_mul Q a.entries hg.1) b.entries + · change MapDegree Q E'.placement F'.placement n v (a.matrix * g * b.matrix) + simpa only [zero_add, add_zero] using + mapDegree_mul Q (mapDegree_mul Q a.degree hg.2) b.degree + commute n _ g _ := homDifferential_sandwich Q a b n g + +variable [Fintype V] [DecidableEq A] + +noncomputable def positiveHomOperator (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) : + HomOperator Q E F (E.positiveTwist Q α) (F.positiveTwist Q α) where + component n := { + toFun := positiveHomTransform Q E F α n + map_add' f g := by + simp only [positiveHomTransform, testTransform_add, smul_add] + rw [Matrix.fromBlocks_add] + simp only [add_zero] + map_smul' r f := by + simp only [positiveHomTransform, testTransform_smul, RingHom.id_apply] + rw [Matrix.fromBlocks_smul, smul_comm r] + simp only [smul_zero] } + preserves n v g hg := ⟨positiveHomTransform_entries Q E F α n hg.1, + positiveHomTransform_degree Q E F α n v hg.2⟩ + commute n _ g hg := positiveHomTransform_differential Q E F α n hg.1 + +noncomputable def negativeHomOperator (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (α : V) : + HomOperator Q E F (E.negativeTwist Q α) (F.negativeTwist Q α) where + component n := { + toFun := negativeHomTransform Q E F α n + map_add' f g := by + simp only [negativeHomTransform, testTransform_add, smul_add] + rw [Matrix.fromBlocks_add] + simp only [add_zero] + map_smul' r f := by + simp only [negativeHomTransform, testTransform_smul, RingHom.id_apply] + rw [Matrix.fromBlocks_smul, smul_comm r] + simp only [smul_zero] } + preserves n v g hg := ⟨negativeHomTransform_entries Q E F α n hg.1, + negativeHomTransform_degree Q E F α n v hg.2⟩ + commute n _ g hg := negativeHomTransform_differential Q E F α n hg.1 + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/RestrictExtendLayerMul.lean b/lean/OAI/Topology/ArtinGroups/Complexes/RestrictExtendLayerMul.lean index 29c0bf02b886b03b7fec4792cf30ebc2e523f9cf..87a7da29d418b7df998a57c76972a11375118af9 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/RestrictExtendLayerMul.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/RestrictExtendLayerMul.lean @@ -1,45 +1,45 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.SecondaryLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J : Type*} [Fintype I] [Fintype J] - -lemma restrict_extendLayer_mul (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (q d k : ℤ) - (f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)) - (g : Matrix J J (Q.Zigzag K)) : - restrictLayer Q E F q k (extendLayer Q E F q d f * g) = - f * restrictLayer Q F F d k g := by - classical - apply Matrix.ext - intro i j - change (∑ t, extendLayer Q E F q d f i.val t * g t j.val) = - ∑ t : {j // (F.placement j).level = d}, f i t * g t.val j.val - symm - apply Fintype.sum_of_injective Subtype.val Subtype.val_injective - · intro t ht - have hh : (F.placement t).level ≠ d := fun h => ht ⟨⟨t, h⟩, rfl⟩ - rw [extendLayer_entry, dite_eq_left i.property, dite_eq_right hh, MulZeroClass.zero_mul] - · intro t - rw [extendLayer_apply Q E F q d f i t] - -lemma secondaryLayer_eq_target (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (U : Set V) (q d n : ℤ) (hcap : E.CappedOn Q U q) - {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} - (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) : - secondaryLayer Q E F q d n f = -(cochainSign (K := K) n • - (f * restrictLayer Q F F d (d-1) (matrixTwo Q F.differential))) := by - change restrictLayer Q E F q (d-1) - (tokenHomDifferential Q E F n (extendLayer Q E F q d f)) = _ - rw [tokenHomDifferential_apply Q E F hE hF, - capped_matrixTwo_mul_extend Q E F U q d hcap hs, zero_sub, - map_neg, map_smul, restrict_extendLayer_mul] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.SecondaryLayer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J : Type*} [Fintype I] [Fintype J] + +lemma restrict_extendLayer_mul (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (q d k : ℤ) + (f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)) + (g : Matrix J J (Q.Zigzag K)) : + restrictLayer Q E F q k (extendLayer Q E F q d f * g) = + f * restrictLayer Q F F d k g := by + classical + apply Matrix.ext + intro i j + change (∑ t, extendLayer Q E F q d f i.val t * g t j.val) = + ∑ t : {j // (F.placement j).level = d}, f i t * g t.val j.val + symm + apply Fintype.sum_of_injective Subtype.val Subtype.val_injective + · intro t ht + have hh : (F.placement t).level ≠ d := fun h => ht ⟨⟨t, h⟩, rfl⟩ + rw [extendLayer_entry, dite_eq_left i.property, dite_eq_right hh, MulZeroClass.zero_mul] + · intro t + rw [extendLayer_apply Q E F q d f i t] + +lemma secondaryLayer_eq_target (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (U : Set V) (q d n : ℤ) (hcap : E.CappedOn Q U q) + {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} + (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) : + secondaryLayer Q E F q d n f = -(cochainSign (K := K) n • + (f * restrictLayer Q F F d (d-1) (matrixTwo Q F.differential))) := by + change restrictLayer Q E F q (d-1) + (tokenHomDifferential Q E F n (extendLayer Q E F q d f)) = _ + rw [tokenHomDifferential_apply Q E F hE hF, + capped_matrixTwo_mul_extend Q E F U q d hcap hs, zero_sub, + map_neg, map_smul, restrict_extendLayer_mul] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/RestrictLayer.lean b/lean/OAI/Topology/ArtinGroups/Complexes/RestrictLayer.lean index 1e7603d96293c7bf0f6a66cb9ec988115ea64d35..3c20d541126eb7aa00daba66dd3e91e9056fb76c 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/RestrictLayer.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/RestrictLayer.lean @@ -1,104 +1,104 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.PathZero -import OAI.Topology.ArtinGroups.Complexes.ExtendLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] - -lemma pathOne_eq_zero {x : Q.Zigzag K} (h : x.arrow = 0) : pathOne Q x = 0 := by - apply ext - · rfl - · exact h - · rfl - -namespace BasedComplex -variable {I J : Type*} [Fintype I] [Fintype J] - -def restrictLayer (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (l k : ℤ) : Matrix I J (Q.Zigzag K) →ₗ[K] - Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K) where - toFun f i j := f i.val j.val - map_add' _ _ := rfl - map_smul' _ _ := rfl - -lemma restrictLayer_extend (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (l k : ℤ) - (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) : - restrictLayer Q E F l k (extendLayer Q E F l k f) = f := by - apply Matrix.ext - intro i j - exact extendLayer_apply Q E F l k f i j - -lemma restrictLayer_homSpace (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (l k n v : ℤ) {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homSpace Q E F n v) : - restrictLayer Q E F l k f ∈ homSpace Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v := - ⟨⟨fun i j => hf.1.1 i.val j.val, fun i j => hf.1.2 i.val j.val⟩, - fun i j => hf.2 i.val j.val⟩ - -lemma restrictLayer_matrixOne_mul (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (l k : ℤ) - (g : Matrix I J (Q.Zigzag K)) : - restrictLayer Q E F l k (matrixOne Q E.differential * g) = - (show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * restrictLayer Q E F l k g := by - classical - apply Matrix.ext - intro i j - change (∑ t, pathOne Q (E.differential i.val t) * g t j.val) = - ∑ t : {i // (E.placement i).level = l}, E.differential i.val t.val * g t.val j.val - symm - apply Fintype.sum_of_injective Subtype.val Subtype.val_injective - · intro t ht - have hh : (E.placement t).level ≠ (E.placement i.val).level := by - intro he - exact ht ⟨⟨t, he.trans i.property⟩, rfl⟩ - rw [pathOne_eq_zero Q (E.differential_arrow_level Q hh), MulZeroClass.zero_mul] - · intro t - exact congrArg (fun z : Q.Zigzag K => z * g t.val j.val) - (pathOne_eq_self Q (E.pureLayer_linear Q hE l i t).1 - (E.pureLayer_linear Q hE l i t).2).symm - -lemma restrictLayer_mul_matrixOne (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hF : F.IsMinimal Q) (l k : ℤ) - (g : Matrix I J (Q.Zigzag K)) : - restrictLayer Q E F l k (g * matrixOne Q F.differential) = - restrictLayer Q E F l k g * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential) := by - classical - apply Matrix.ext - intro i j - change (∑ t, g i.val t * pathOne Q (F.differential t j.val)) = - ∑ t : {j // (F.placement j).level = k}, g i.val t.val * F.differential t.val j.val - symm - apply Fintype.sum_of_injective Subtype.val Subtype.val_injective - · intro t ht - have hh : (F.placement j.val).level ≠ (F.placement t).level := by - intro he - exact ht ⟨⟨t, he.symm.trans j.property⟩, rfl⟩ - rw [pathOne_eq_zero Q (F.differential_arrow_level Q hh), MulZeroClass.mul_zero] - · intro t - exact congrArg (fun z : Q.Zigzag K => g i.val t.val * z) - (pathOne_eq_self Q (F.pureLayer_linear Q hF k t j).1 - (F.pureLayer_linear Q hF k t j).2).symm - -lemma layer_boundary_of_extended_boundary (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (l k n v : ℤ) - {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} - (hlin : LinearMatrix Q f) - (hf : extendLayer Q E F l k f ∈ homBoundaries Q E F n v) : - f ∈ homBoundaries Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v := by - obtain ⟨g, hg, _, he⟩ := linear_boundary_primitive Q E F hE hF n v - (extendLayer_linear Q E F l k hlin) hf - refine ⟨restrictLayer Q E F l k g, restrictLayer_homSpace Q E F hE hF l k (n-1) v hg, ?_⟩ - have h := congrArg (restrictLayer Q E F l k) he - rw [map_sub, map_smul, restrictLayer_matrixOne_mul Q E F hE, - restrictLayer_mul_matrixOne Q E F hF, restrictLayer_extend] at h - exact h - -end BasedComplex -end HarmonicArtin.ReversibleQuiver.Zigzag - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.PathZero +import OAI.Topology.ArtinGroups.Complexes.ExtendLayer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] + +lemma pathOne_eq_zero {x : Q.Zigzag K} (h : x.arrow = 0) : pathOne Q x = 0 := by + apply ext + · rfl + · exact h + · rfl + +namespace BasedComplex +variable {I J : Type*} [Fintype I] [Fintype J] + +def restrictLayer (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (l k : ℤ) : Matrix I J (Q.Zigzag K) →ₗ[K] + Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K) where + toFun f i j := f i.val j.val + map_add' _ _ := rfl + map_smul' _ _ := rfl + +lemma restrictLayer_extend (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (l k : ℤ) + (f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)) : + restrictLayer Q E F l k (extendLayer Q E F l k f) = f := by + apply Matrix.ext + intro i j + exact extendLayer_apply Q E F l k f i j + +lemma restrictLayer_homSpace (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (l k n v : ℤ) {f : Matrix I J (Q.Zigzag K)} (hf : f ∈ homSpace Q E F n v) : + restrictLayer Q E F l k f ∈ homSpace Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v := + ⟨⟨fun i j => hf.1.1 i.val j.val, fun i j => hf.1.2 i.val j.val⟩, + fun i j => hf.2 i.val j.val⟩ + +lemma restrictLayer_matrixOne_mul (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (l k : ℤ) + (g : Matrix I J (Q.Zigzag K)) : + restrictLayer Q E F l k (matrixOne Q E.differential * g) = + (show Matrix {i // (E.placement i).level = l} {i // (E.placement i).level = l} (Q.Zigzag K) from (E.pureLayer Q hE l).differential) * restrictLayer Q E F l k g := by + classical + apply Matrix.ext + intro i j + change (∑ t, pathOne Q (E.differential i.val t) * g t j.val) = + ∑ t : {i // (E.placement i).level = l}, E.differential i.val t.val * g t.val j.val + symm + apply Fintype.sum_of_injective Subtype.val Subtype.val_injective + · intro t ht + have hh : (E.placement t).level ≠ (E.placement i.val).level := by + intro he + exact ht ⟨⟨t, he.trans i.property⟩, rfl⟩ + rw [pathOne_eq_zero Q (E.differential_arrow_level Q hh), MulZeroClass.zero_mul] + · intro t + exact congrArg (fun z : Q.Zigzag K => z * g t.val j.val) + (pathOne_eq_self Q (E.pureLayer_linear Q hE l i t).1 + (E.pureLayer_linear Q hE l i t).2).symm + +lemma restrictLayer_mul_matrixOne (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hF : F.IsMinimal Q) (l k : ℤ) + (g : Matrix I J (Q.Zigzag K)) : + restrictLayer Q E F l k (g * matrixOne Q F.differential) = + restrictLayer Q E F l k g * (show Matrix {j // (F.placement j).level = k} {j // (F.placement j).level = k} (Q.Zigzag K) from (F.pureLayer Q hF k).differential) := by + classical + apply Matrix.ext + intro i j + change (∑ t, g i.val t * pathOne Q (F.differential t j.val)) = + ∑ t : {j // (F.placement j).level = k}, g i.val t.val * F.differential t.val j.val + symm + apply Fintype.sum_of_injective Subtype.val Subtype.val_injective + · intro t ht + have hh : (F.placement j.val).level ≠ (F.placement t).level := by + intro he + exact ht ⟨⟨t, he.symm.trans j.property⟩, rfl⟩ + rw [pathOne_eq_zero Q (F.differential_arrow_level Q hh), MulZeroClass.mul_zero] + · intro t + exact congrArg (fun z : Q.Zigzag K => g i.val t.val * z) + (pathOne_eq_self Q (F.pureLayer_linear Q hF k t j).1 + (F.pureLayer_linear Q hF k t j).2).symm + +lemma layer_boundary_of_extended_boundary (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (l k n v : ℤ) + {f : Matrix {i // (E.placement i).level = l} {j // (F.placement j).level = k} (Q.Zigzag K)} + (hlin : LinearMatrix Q f) + (hf : extendLayer Q E F l k f ∈ homBoundaries Q E F n v) : + f ∈ homBoundaries Q (E.pureLayer Q hE l) (F.pureLayer Q hF k) n v := by + obtain ⟨g, hg, _, he⟩ := linear_boundary_primitive Q E F hE hF n v + (extendLayer_linear Q E F l k hlin) hf + refine ⟨restrictLayer Q E F l k g, restrictLayer_homSpace Q E F hE hF l k (n-1) v hg, ?_⟩ + have h := congrArg (restrictLayer Q E F l k) he + rw [map_sub, map_smul, restrictLayer_matrixOne_mul Q E F hE, + restrictLayer_mul_matrixOne Q E F hF, restrictLayer_extend] at h + exact h + +end BasedComplex +end HarmonicArtin.ReversibleQuiver.Zigzag + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistDifferential.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistDifferential.lean index 03d55a780a10e191e240e8f1ac9be9ec35e9c7fd..154cba2c83ff06835debb4bddde82e7ca0bc6469 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistDifferential.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistDifferential.lean @@ -1,97 +1,97 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseTwistDifferential -import OAI.Topology.ArtinGroups.Complexes.ReverseTwistIndexEquiv - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -noncomputable def reverseTwistDifferential (E : BasedComplex Q (K := K) I) (α : V) : - Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) - | .inl u, .inl v => -testTransform Q E.placement E.placement α E.differential u v - | .inl u, .inr (.inl v) => testToken Q E.placement α u v - | .inl u, .inr (.inr (.inl v)) => projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inl u, .inr (.inr (.inr (.inl j))) => evaluationMatrix Q E.placement α u j - | .inr (.inl u), .inr (.inl v) => testTransform Q E.placement E.placement α E.differential u v - | .inr (.inl u), .inr (.inr (.inr (.inr v))) => - -projectiveIdentity Q (testPlacement Q E.placement α) u v - | .inr (.inr (.inl u)), .inr (.inr (.inl v)) => - testTransform Q E.placement E.placement α E.differential u v - | .inr (.inr (.inl u)), .inr (.inr (.inr (.inr v))) => -unitContraction Q E.placement α u v - | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inl j))) => E.differential i j - | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inr v))) => coevaluationMatrix Q E.placement α i v - | .inr (.inr (.inr (.inr u))), .inr (.inr (.inr (.inr v))) => - -testTransform Q E.placement E.placement α E.differential u v - | _, _ => 0 - -lemma coordinates_tokenBasis_mul (α : V) (x : Q.Zigzag K) (p : Path V A) : - pathCoordinates Q (tokenBasis Q α * x) p = - (x * pathBasis Q (Path.dual Q p)).vertex α := by - rw [coordinates_trace, _root_.mul_assoc, trace_mul_comm, trace_mul_tokenBasis] - -lemma normalizedReverseTwist_differential (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - (normalizedReverseTwist Q hn E α).differential = reverseTwistDifferential Q E α := by - change ((E.positiveTwist Q α).negativeTwist Q α).differential.submatrix - (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn E α) = _ - rw [negativeTwist_differential] - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v - all_goals simp only [Matrix.submatrix_apply, reverseTwistIndexEquiv, Equiv.coe_fn_mk, - Matrix.of_apply, reverseTwistDifferential, Matrix.fromBlocks, testTransform, - scalarCornerMatrix, testMatrix] - all_goals simp only [positiveTwist_differential, Matrix.fromBlocks, Matrix.neg_apply, - Matrix.zero_apply, Matrix.of_apply, testTransform, scalarCornerMatrix, testMatrix, - Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, coordinates_zero, zero_smul, - neg_zero, selfCornerEquiv_false, selfCornerEquiv_true] - all_goals try simp only [coevaluationMatrix, Sum.inl.injEq, Sum.inr.injEq, - Sum.inl_ne_inr, Sum.inr_ne_inl, ↓reduceIte, selfCornerEquiv_false, - selfCornerEquiv_true, Path.dual, pathBasis_vertex, pathBasis_token, projectiveIdentity, - Matrix.diagonal_apply, testPlacement, testToken] - all_goals try simp only [_root_.mul_neg, mul_smul, map_neg, Pi.neg_apply, - coordinates_smul, neg_smul, neg_neg] - all_goals try simp only [vertexId_mul_self] - all_goals try (refine @ite_cond_congr _ _ _ ?_ ?_ _ _ rfl) - all_goals try ( - have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - simp only [ht, pathCoordinates_vertex, pathCoordinates_token] - simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, Pi.zero_apply] - first - | exact congrArg (fun k : K => k • vertexId Q (K := K) α) - (_root_.mul_one (pathCoordinates Q (pathBasis Q (K := K) u.2.val * - E.differential u.1 v.1) v.2.val)) - | exact (congrArg (fun k : K => k • vertexId Q (K := K) α) - (MulZeroClass.mul_zero (pathCoordinates Q (pathBasis Q (K := K) u.2.val * - E.differential u.1 v.1) v.2.val))).trans (zero_smul K _)) - · apply congrArg Neg.neg - by_cases hi : u.1 = v.1 - · rcases u with ⟨i, u⟩ - rcases v with ⟨j, v⟩ - dsimp only at hi - subst j - simp only [evaluationMatrix, ite_true, cornerPath_left, pathBasis_coordinates] - by_cases hp : u = v - · subst v - simp - · have hp' : u.val ≠ v.val := fun h => hp (Subtype.ext h) - simp [hp, hp'] - · have huv : u ≠ v := fun h => hi (congrArg Sigma.fst h) - simp only [evaluationMatrix, ite_eq_right hi, MulZeroClass.mul_zero, - coordinates_zero, zero_smul, ite_eq_right huv] - · apply congrArg Neg.neg - by_cases hi : u.1 = v.1 - · simp only [evaluationMatrix, ite_eq_left hi, coordinates_tokenBasis_mul, - unitContraction] - · simp only [evaluationMatrix, ite_eq_right hi, MulZeroClass.mul_zero, - coordinates_zero, zero_smul, unitContraction] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseTwistDifferential +import OAI.Topology.ArtinGroups.Complexes.ReverseTwistIndexEquiv + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +noncomputable def reverseTwistDifferential (E : BasedComplex Q (K := K) I) (α : V) : + Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) + | .inl u, .inl v => -testTransform Q E.placement E.placement α E.differential u v + | .inl u, .inr (.inl v) => testToken Q E.placement α u v + | .inl u, .inr (.inr (.inl v)) => projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inl u, .inr (.inr (.inr (.inl j))) => evaluationMatrix Q E.placement α u j + | .inr (.inl u), .inr (.inl v) => testTransform Q E.placement E.placement α E.differential u v + | .inr (.inl u), .inr (.inr (.inr (.inr v))) => + -projectiveIdentity Q (testPlacement Q E.placement α) u v + | .inr (.inr (.inl u)), .inr (.inr (.inl v)) => + testTransform Q E.placement E.placement α E.differential u v + | .inr (.inr (.inl u)), .inr (.inr (.inr (.inr v))) => -unitContraction Q E.placement α u v + | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inl j))) => E.differential i j + | .inr (.inr (.inr (.inl i))), .inr (.inr (.inr (.inr v))) => coevaluationMatrix Q E.placement α i v + | .inr (.inr (.inr (.inr u))), .inr (.inr (.inr (.inr v))) => + -testTransform Q E.placement E.placement α E.differential u v + | _, _ => 0 + +lemma coordinates_tokenBasis_mul (α : V) (x : Q.Zigzag K) (p : Path V A) : + pathCoordinates Q (tokenBasis Q α * x) p = + (x * pathBasis Q (Path.dual Q p)).vertex α := by + rw [coordinates_trace, _root_.mul_assoc, trace_mul_comm, trace_mul_tokenBasis] + +lemma normalizedReverseTwist_differential (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + (normalizedReverseTwist Q hn E α).differential = reverseTwistDifferential Q E α := by + change ((E.positiveTwist Q α).negativeTwist Q α).differential.submatrix + (reverseTwistIndexEquiv Q hn E α) (reverseTwistIndexEquiv Q hn E α) = _ + rw [negativeTwist_differential] + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v + all_goals simp only [Matrix.submatrix_apply, reverseTwistIndexEquiv, Equiv.coe_fn_mk, + Matrix.of_apply, reverseTwistDifferential, Matrix.fromBlocks, testTransform, + scalarCornerMatrix, testMatrix] + all_goals simp only [positiveTwist_differential, Matrix.fromBlocks, Matrix.neg_apply, + Matrix.zero_apply, Matrix.of_apply, testTransform, scalarCornerMatrix, testMatrix, + Sum.elim_inl, Sum.elim_inr, MulZeroClass.mul_zero, coordinates_zero, zero_smul, + neg_zero, selfCornerEquiv_false, selfCornerEquiv_true] + all_goals try simp only [coevaluationMatrix, Sum.inl.injEq, Sum.inr.injEq, + Sum.inl_ne_inr, Sum.inr_ne_inl, ↓reduceIte, selfCornerEquiv_false, + selfCornerEquiv_true, Path.dual, pathBasis_vertex, pathBasis_token, projectiveIdentity, + Matrix.diagonal_apply, testPlacement, testToken] + all_goals try simp only [_root_.mul_neg, mul_smul, map_neg, Pi.neg_apply, + coordinates_smul, neg_smul, neg_neg] + all_goals try simp only [vertexId_mul_self] + all_goals try (refine @ite_cond_congr _ _ _ ?_ ?_ _ _ rfl) + all_goals try ( + have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + simp only [ht, pathCoordinates_vertex, pathCoordinates_token] + simp only [vertexId, tokenBasis, vertex, token, Pi.single_apply, ite_true, Pi.zero_apply] + first + | exact congrArg (fun k : K => k • vertexId Q (K := K) α) + (_root_.mul_one (pathCoordinates Q (pathBasis Q (K := K) u.2.val * + E.differential u.1 v.1) v.2.val)) + | exact (congrArg (fun k : K => k • vertexId Q (K := K) α) + (MulZeroClass.mul_zero (pathCoordinates Q (pathBasis Q (K := K) u.2.val * + E.differential u.1 v.1) v.2.val))).trans (zero_smul K _)) + · apply congrArg Neg.neg + by_cases hi : u.1 = v.1 + · rcases u with ⟨i, u⟩ + rcases v with ⟨j, v⟩ + dsimp only at hi + subst j + simp only [evaluationMatrix, ite_true, cornerPath_left, pathBasis_coordinates] + by_cases hp : u = v + · subst v + simp + · have hp' : u.val ≠ v.val := fun h => hp (Subtype.ext h) + simp [hp, hp'] + · have huv : u ≠ v := fun h => hi (congrArg Sigma.fst h) + simp only [evaluationMatrix, ite_eq_right hi, MulZeroClass.mul_zero, + coordinates_zero, zero_smul, ite_eq_right huv] + · apply congrArg Neg.neg + by_cases hi : u.1 = v.1 + · simp only [evaluationMatrix, ite_eq_left hi, coordinates_tokenBasis_mul, + unitContraction] + · simp only [evaluationMatrix, ite_eq_right hi, MulZeroClass.mul_zero, + coordinates_zero, zero_smul, unitContraction] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistIndexEquiv.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistIndexEquiv.lean index 310df263f35904d3ea47f2c37a6d83a4edac2287..510f93251db60752f8010a6adee557aa147a8390 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistIndexEquiv.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistIndexEquiv.lean @@ -1,70 +1,70 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseTwistPlacement - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] - -noncomputable def reverseTwistIndexEquiv (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - InverseTwistIndex Q E α ≃ - ((TestIndex Q E.placement α ⊕ I) ⊕ TestIndex Q (E.positiveTwist Q α).placement α) where - toFun - | .inl u => .inl (.inl u) - | .inr (.inl u) => .inr ⟨.inl u, selfCornerEquiv Q hn α false⟩ - | .inr (.inr (.inl u)) => .inr ⟨.inl u, selfCornerEquiv Q hn α true⟩ - | .inr (.inr (.inr (.inl i))) => .inl (.inr i) - | .inr (.inr (.inr (.inr u))) => .inr ⟨.inr u.1, u.2⟩ - invFun - | .inl (.inl u) => .inl u - | .inl (.inr i) => .inr (.inr (.inr (.inl i))) - | .inr ⟨.inl u, p⟩ => if (selfCornerEquiv Q hn α).symm p then - .inr (.inr (.inl u)) else .inr (.inl u) - | .inr ⟨.inr i, p⟩ => .inr (.inr (.inr (.inr ⟨i, p⟩))) - left_inv u := by - rcases u with u | u | u | i | u <;> rfl - right_inv u := by - rcases u with (u | i) | ⟨u | i, p⟩ - · rfl - · rfl - · have he := (selfCornerEquiv Q hn α).apply_symm_apply p - cases h : (selfCornerEquiv Q hn α).symm p - · simp only [h, Bool.false_eq_true, ↓reduceIte] - congr 2 - change (selfCornerEquiv Q hn α false : CornerPath Q α α) = p - simpa only [h] using he - · simp only [h, ↓reduceIte] - congr 2 - change (selfCornerEquiv Q hn α true : CornerPath Q α α) = p - simpa only [h] using he - · rfl - -noncomputable def normalizedReverseTwist (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - BasedComplex Q (K := K) (InverseTwistIndex Q E α) := - ((E.positiveTwist Q α).negativeTwist Q α).reindex Q (reverseTwistIndexEquiv Q hn E α) - -lemma normalizedReverseTwist_placement (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - (normalizedReverseTwist Q hn E α).placement = inverseTwistPlacement Q E α := by - funext i - rcases i with u | u | u | i | u - · rfl - · change (⟨α, (E.placement u.1).cochain - 1 + 1, - (E.placement u.1).internal + Path.length u.2.val + 0 - 2⟩ : GeneratorPlacement V) = _ - simp only [sub_add_cancel, add_zero] - rfl - · change (⟨α, (E.placement u.1).cochain - 1 + 1, - (E.placement u.1).internal + Path.length u.2.val + 2 - 2⟩ : GeneratorPlacement V) = _ - simp only [sub_add_cancel, add_sub_cancel_right] - rfl - · rfl - · rfl - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseTwistPlacement + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] + +noncomputable def reverseTwistIndexEquiv (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + InverseTwistIndex Q E α ≃ + ((TestIndex Q E.placement α ⊕ I) ⊕ TestIndex Q (E.positiveTwist Q α).placement α) where + toFun + | .inl u => .inl (.inl u) + | .inr (.inl u) => .inr ⟨.inl u, selfCornerEquiv Q hn α false⟩ + | .inr (.inr (.inl u)) => .inr ⟨.inl u, selfCornerEquiv Q hn α true⟩ + | .inr (.inr (.inr (.inl i))) => .inl (.inr i) + | .inr (.inr (.inr (.inr u))) => .inr ⟨.inr u.1, u.2⟩ + invFun + | .inl (.inl u) => .inl u + | .inl (.inr i) => .inr (.inr (.inr (.inl i))) + | .inr ⟨.inl u, p⟩ => if (selfCornerEquiv Q hn α).symm p then + .inr (.inr (.inl u)) else .inr (.inl u) + | .inr ⟨.inr i, p⟩ => .inr (.inr (.inr (.inr ⟨i, p⟩))) + left_inv u := by + rcases u with u | u | u | i | u <;> rfl + right_inv u := by + rcases u with (u | i) | ⟨u | i, p⟩ + · rfl + · rfl + · have he := (selfCornerEquiv Q hn α).apply_symm_apply p + cases h : (selfCornerEquiv Q hn α).symm p + · simp only [h, Bool.false_eq_true, ↓reduceIte] + congr 2 + change (selfCornerEquiv Q hn α false : CornerPath Q α α) = p + simpa only [h] using he + · simp only [h, ↓reduceIte] + congr 2 + change (selfCornerEquiv Q hn α true : CornerPath Q α α) = p + simpa only [h] using he + · rfl + +noncomputable def normalizedReverseTwist (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + BasedComplex Q (K := K) (InverseTwistIndex Q E α) := + ((E.positiveTwist Q α).negativeTwist Q α).reindex Q (reverseTwistIndexEquiv Q hn E α) + +lemma normalizedReverseTwist_placement (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + (normalizedReverseTwist Q hn E α).placement = inverseTwistPlacement Q E α := by + funext i + rcases i with u | u | u | i | u + · rfl + · change (⟨α, (E.placement u.1).cochain - 1 + 1, + (E.placement u.1).internal + Path.length u.2.val + 0 - 2⟩ : GeneratorPlacement V) = _ + simp only [sub_add_cancel, add_zero] + rfl + · change (⟨α, (E.placement u.1).cochain - 1 + 1, + (E.placement u.1).internal + Path.length u.2.val + 2 - 2⟩ : GeneratorPlacement V) = _ + simp only [sub_add_cancel, add_sub_cancel_right] + rfl + · rfl + · rfl + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjection.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjection.lean index 1f9fc114ce59165dbe7be6937311deb765a9a2bf..b84f4d8728cc28ee91a8d5926fc8661c14b474da 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjection.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjection.lean @@ -1,102 +1,102 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseTwistPlacement - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -noncomputable def reverseTwistProjection (E : BasedComplex Q (K := K) I) (α : V) : - Matrix (InverseTwistIndex Q E α) I (Q.Zigzag K) - | .inr (.inr (.inl u)), j => -evaluationMatrix Q E.placement α u j - | .inr (.inr (.inr (.inl i))), j => projectiveIdentity Q E.placement i j - | _, _ => 0 - -noncomputable def reverseTwistInjection (E : BasedComplex Q (K := K) I) (α : V) : - Matrix I (InverseTwistIndex Q E α) (Q.Zigzag K) - | i, .inr (.inl u) => coevaluationMatrix Q E.placement α i u - | i, .inr (.inr (.inr (.inl j))) => projectiveIdentity Q E.placement i j - | _, _ => 0 - -noncomputable def reverseTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) : - Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) := - -inverseTwistHomotopy Q E α - -lemma reverseTwistProjection_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q (inverseTwistPlacement Q E α) E.placement - (reverseTwistProjection Q E α) := by - constructor - · intro i j - rcases i with u | u | u | i | u - · exact MulZeroClass.mul_zero _ - · exact MulZeroClass.mul_zero _ - · exact (projectiveEntries_neg Q (evaluation_entries Q E.placement α)).1 u j - · exact (projectiveEntries_identity Q).1 i j - · exact MulZeroClass.mul_zero _ - · intro i j - rcases i with u | u | u | i | u - · exact MulZeroClass.zero_mul _ - · exact MulZeroClass.zero_mul _ - · exact (projectiveEntries_neg Q (evaluation_entries Q E.placement α)).2 u j - · exact (projectiveEntries_identity Q).2 i j - · exact MulZeroClass.zero_mul _ - -lemma reverseTwistProjection_degree (E : BasedComplex Q (K := K) I) (α : V) : - MapDegree Q (inverseTwistPlacement Q E α) E.placement 0 0 - (reverseTwistProjection Q E α) := by - intro i j - rcases i with u | u | u | i | u - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact mapDegree_neg Q (evaluation_degree Q E.placement α) u j - · exact mapDegree_identity Q i j - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - -lemma reverseTwistInjection_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q E.placement (inverseTwistPlacement Q E α) - (reverseTwistInjection Q E α) := by - constructor - · intro i j - rcases j with u | u | u | j | u - · exact MulZeroClass.mul_zero _ - · exact (coevaluation_entries Q E.placement α).1 i u - · exact MulZeroClass.mul_zero _ - · exact (projectiveEntries_identity Q).1 i j - · exact MulZeroClass.mul_zero _ - · intro i j - rcases j with u | u | u | j | u - · exact MulZeroClass.zero_mul _ - · exact (coevaluation_entries Q E.placement α).2 i u - · exact MulZeroClass.zero_mul _ - · exact (projectiveEntries_identity Q).2 i j - · exact MulZeroClass.zero_mul _ - -lemma reverseTwistInjection_degree (E : BasedComplex Q (K := K) I) (α : V) : - MapDegree Q E.placement (inverseTwistPlacement Q E α) 0 0 - (reverseTwistInjection Q E α) := by - intro i j - rcases j with u | u | u | j | u - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact coevaluation_degree Q E.placement α i u - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - · exact mapDegree_identity Q i j - · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma reverseTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) : - ProjectiveEntries Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) - (reverseTwistHomotopy Q E α) := - projectiveEntries_neg Q (inverseTwistHomotopy_entries Q E α) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma reverseTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) : - MapDegree Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) (-1) 0 - (reverseTwistHomotopy Q E α) := - mapDegree_neg Q (inverseTwistHomotopy_degree Q E α) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseTwistPlacement + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +noncomputable def reverseTwistProjection (E : BasedComplex Q (K := K) I) (α : V) : + Matrix (InverseTwistIndex Q E α) I (Q.Zigzag K) + | .inr (.inr (.inl u)), j => -evaluationMatrix Q E.placement α u j + | .inr (.inr (.inr (.inl i))), j => projectiveIdentity Q E.placement i j + | _, _ => 0 + +noncomputable def reverseTwistInjection (E : BasedComplex Q (K := K) I) (α : V) : + Matrix I (InverseTwistIndex Q E α) (Q.Zigzag K) + | i, .inr (.inl u) => coevaluationMatrix Q E.placement α i u + | i, .inr (.inr (.inr (.inl j))) => projectiveIdentity Q E.placement i j + | _, _ => 0 + +noncomputable def reverseTwistHomotopy (E : BasedComplex Q (K := K) I) (α : V) : + Matrix (InverseTwistIndex Q E α) (InverseTwistIndex Q E α) (Q.Zigzag K) := + -inverseTwistHomotopy Q E α + +lemma reverseTwistProjection_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q (inverseTwistPlacement Q E α) E.placement + (reverseTwistProjection Q E α) := by + constructor + · intro i j + rcases i with u | u | u | i | u + · exact MulZeroClass.mul_zero _ + · exact MulZeroClass.mul_zero _ + · exact (projectiveEntries_neg Q (evaluation_entries Q E.placement α)).1 u j + · exact (projectiveEntries_identity Q).1 i j + · exact MulZeroClass.mul_zero _ + · intro i j + rcases i with u | u | u | i | u + · exact MulZeroClass.zero_mul _ + · exact MulZeroClass.zero_mul _ + · exact (projectiveEntries_neg Q (evaluation_entries Q E.placement α)).2 u j + · exact (projectiveEntries_identity Q).2 i j + · exact MulZeroClass.zero_mul _ + +lemma reverseTwistProjection_degree (E : BasedComplex Q (K := K) I) (α : V) : + MapDegree Q (inverseTwistPlacement Q E α) E.placement 0 0 + (reverseTwistProjection Q E α) := by + intro i j + rcases i with u | u | u | i | u + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact mapDegree_neg Q (evaluation_degree Q E.placement α) u j + · exact mapDegree_identity Q i j + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + +lemma reverseTwistInjection_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q E.placement (inverseTwistPlacement Q E α) + (reverseTwistInjection Q E α) := by + constructor + · intro i j + rcases j with u | u | u | j | u + · exact MulZeroClass.mul_zero _ + · exact (coevaluation_entries Q E.placement α).1 i u + · exact MulZeroClass.mul_zero _ + · exact (projectiveEntries_identity Q).1 i j + · exact MulZeroClass.mul_zero _ + · intro i j + rcases j with u | u | u | j | u + · exact MulZeroClass.zero_mul _ + · exact (coevaluation_entries Q E.placement α).2 i u + · exact MulZeroClass.zero_mul _ + · exact (projectiveEntries_identity Q).2 i j + · exact MulZeroClass.zero_mul _ + +lemma reverseTwistInjection_degree (E : BasedComplex Q (K := K) I) (α : V) : + MapDegree Q E.placement (inverseTwistPlacement Q E α) 0 0 + (reverseTwistInjection Q E α) := by + intro i j + rcases j with u | u | u | j | u + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact coevaluation_degree Q E.placement α i u + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + · exact mapDegree_identity Q i j + · exact ⟨fun _ => by trivial, homogeneous_zero Q _⟩ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma reverseTwistHomotopy_entries (E : BasedComplex Q (K := K) I) (α : V) : + ProjectiveEntries Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) + (reverseTwistHomotopy Q E α) := + projectiveEntries_neg Q (inverseTwistHomotopy_entries Q E α) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma reverseTwistHomotopy_degree (E : BasedComplex Q (K := K) I) (α : V) : + MapDegree Q (inverseTwistPlacement Q E α) (inverseTwistPlacement Q E α) (-1) 0 + (reverseTwistHomotopy Q E α) := + mapDegree_neg Q (inverseTwistHomotopy_degree Q E α) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjectionCommute.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjectionCommute.lean index 8c84d0c76e846c9795c7564966d70715aedb2efa..43c08c02ae5612b3472f786c3896c9567547cebb 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjectionCommute.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ReverseTwistProjectionCommute.lean @@ -1,113 +1,113 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.InverseTwistIdentity -import OAI.Topology.ArtinGroups.Complexes.ReverseTwistDifferential -import OAI.Topology.ArtinGroups.Complexes.ReverseTwistProjection -import OAI.Topology.ArtinGroups.Diagrams.ReverseDifferential - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -lemma reverseTwistProjection_commute (E : BasedComplex Q (K := K) I) (α : V) : - reverseTwistDifferential Q E α * reverseTwistProjection Q E α = - reverseTwistProjection Q E α * E.differential := by - apply Matrix.ext - intro i j - rcases i with u | u | u | i | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, reverseTwistDifferential, - reverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - Finset.sum_const_zero, _root_.neg_mul, _root_.mul_neg, Finset.sum_neg_distrib, add_zero, zero_add, neg_zero] - · exact (congrArg₂ (fun a b : Q.Zigzag K => -a + b) - (congrFun (congrFun (projectiveIdentity_mul Q - (evaluation_entries Q E.placement α)) u) j) - (congrFun (congrFun (mul_projectiveIdentity Q - (evaluation_entries Q E.placement α)) u) j)).trans (neg_add_cancel _) - · exact congrArg Neg.neg (congrFun (congrFun (evaluation_natural Q α E.entries) u) j) - · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans - (projectiveIdentity_mul Q E.entries).symm) i) j - -lemma reverseTwistInjection_commute (E : BasedComplex Q (K := K) I) (α : V) : - E.differential * reverseTwistInjection Q E α = - reverseTwistInjection Q E α * reverseTwistDifferential Q E α := by - apply Matrix.ext - intro i j - rcases j with u | u | u | j | u - all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, reverseTwistDifferential, - reverseTwistInjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - Finset.sum_const_zero, _root_.mul_neg, Finset.sum_neg_distrib, - add_zero, zero_add, neg_zero] - · exact congrFun (congrFun (coevaluation_natural Q α E.entries).symm i) u - · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans - (projectiveIdentity_mul Q E.entries).symm) i) j - · exact ((congrArg₂ (fun a b : Q.Zigzag K => -a + b) - (congrFun (congrFun (mul_projectiveIdentity Q - (coevaluation_entries Q E.placement α)) i) u) - (congrFun (congrFun (projectiveIdentity_mul Q - (coevaluation_entries Q E.placement α)) i) u)).trans (neg_add_cancel _)).symm - -omit [DecidableEq A] in -lemma reverseTwist_targetEquation (E : BasedComplex Q (K := K) I) (α : V) : - reverseTwistInjection Q E α * reverseTwistProjection Q E α = - projectiveIdentity Q (K := K) E.placement := by - apply Matrix.ext - intro i j - simp only [Matrix.mul_apply, Fintype.sum_sum_type, reverseTwistInjection, - reverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, - Finset.sum_const_zero, add_zero, zero_add] - exact congrFun (congrFun (projectiveIdentity_mul Q - (projectiveEntries_identity Q (K := K) (p := E.placement))) i) j - -lemma reverseTwist_sourceEquation (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - reverseTwistProjection Q E α * reverseTwistInjection Q E α = - projectiveIdentity Q (inverseTwistPlacement Q E α) + - (reverseTwistDifferential Q E α * reverseTwistHomotopy Q E α + - reverseTwistHomotopy Q E α * reverseTwistDifferential Q E α) := by - rw [inverseTwistIdentity_eq] - let t := testTransform Q E.placement E.placement α E.differential - let r := unitContraction Q E.placement α (K := K) - let θ := testToken Q E.placement α (K := K) - let ι := projectiveIdentity Q (K := K) (testPlacement Q E.placement α) - let e := evaluationMatrix Q E.placement α (K := K) - let η := projectiveIdentity Q (K := K) E.placement - let c := coevaluationMatrix Q E.placement α (K := K) - have hf : reverseTwistProjection Q E α = FiveBlock.reverseProjection e η := by - funext i j - rcases i with u | u | u | i | u <;> rfl - have hg : reverseTwistInjection Q E α = FiveBlock.reverseInjection c η := by - funext i j - rcases j with v | v | v | j | v <;> rfl - have hh : reverseTwistHomotopy Q E α = FiveBlock.reverseHomotopy ι := by - funext i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> - simp only [reverseTwistHomotopy, inverseTwistHomotopy, FiveBlock.reverseHomotopy, - Matrix.neg_apply, neg_zero, neg_neg] - all_goals rfl - have hd : reverseTwistDifferential Q E α = - FiveBlock.reverseDifferential t r θ ι e E.differential c := by - funext i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl - have hId : inverseTwistIdentity Q E α = FiveBlock.identity ι η := by - funext i j - rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl - rw [hf, hg, hh, hd, hId] - apply FiveBlock.reverseContraction - · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) - · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) - · exact projectiveIdentity_mul Q (E.testComplex Q α).entries - · exact mul_projectiveIdentity Q (E.testComplex Q α).entries - · exact mul_projectiveIdentity Q (unitContraction_entries Q E α) - · exact projectiveIdentity_mul Q (testToken_entries Q E α) - · exact projectiveIdentity_mul Q (evaluation_entries Q E.placement α) - · exact mul_projectiveIdentity Q (evaluation_entries Q E.placement α) - · exact mul_projectiveIdentity Q (coevaluation_entries Q E.placement α) - · exact projectiveIdentity_mul Q (coevaluation_entries Q E.placement α) - · exact evaluation_coevaluation Q hn E.placement α - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.InverseTwistIdentity +import OAI.Topology.ArtinGroups.Complexes.ReverseTwistDifferential +import OAI.Topology.ArtinGroups.Complexes.ReverseTwistProjection +import OAI.Topology.ArtinGroups.Diagrams.ReverseDifferential + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +lemma reverseTwistProjection_commute (E : BasedComplex Q (K := K) I) (α : V) : + reverseTwistDifferential Q E α * reverseTwistProjection Q E α = + reverseTwistProjection Q E α * E.differential := by + apply Matrix.ext + intro i j + rcases i with u | u | u | i | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, reverseTwistDifferential, + reverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + Finset.sum_const_zero, _root_.neg_mul, _root_.mul_neg, Finset.sum_neg_distrib, add_zero, zero_add, neg_zero] + · exact (congrArg₂ (fun a b : Q.Zigzag K => -a + b) + (congrFun (congrFun (projectiveIdentity_mul Q + (evaluation_entries Q E.placement α)) u) j) + (congrFun (congrFun (mul_projectiveIdentity Q + (evaluation_entries Q E.placement α)) u) j)).trans (neg_add_cancel _) + · exact congrArg Neg.neg (congrFun (congrFun (evaluation_natural Q α E.entries) u) j) + · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans + (projectiveIdentity_mul Q E.entries).symm) i) j + +lemma reverseTwistInjection_commute (E : BasedComplex Q (K := K) I) (α : V) : + E.differential * reverseTwistInjection Q E α = + reverseTwistInjection Q E α * reverseTwistDifferential Q E α := by + apply Matrix.ext + intro i j + rcases j with u | u | u | j | u + all_goals simp only [Matrix.mul_apply, Fintype.sum_sum_type, reverseTwistDifferential, + reverseTwistInjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + Finset.sum_const_zero, _root_.mul_neg, Finset.sum_neg_distrib, + add_zero, zero_add, neg_zero] + · exact congrFun (congrFun (coevaluation_natural Q α E.entries).symm i) u + · exact congrFun (congrFun ((mul_projectiveIdentity Q E.entries).trans + (projectiveIdentity_mul Q E.entries).symm) i) j + · exact ((congrArg₂ (fun a b : Q.Zigzag K => -a + b) + (congrFun (congrFun (mul_projectiveIdentity Q + (coevaluation_entries Q E.placement α)) i) u) + (congrFun (congrFun (projectiveIdentity_mul Q + (coevaluation_entries Q E.placement α)) i) u)).trans (neg_add_cancel _)).symm + +omit [DecidableEq A] in +lemma reverseTwist_targetEquation (E : BasedComplex Q (K := K) I) (α : V) : + reverseTwistInjection Q E α * reverseTwistProjection Q E α = + projectiveIdentity Q (K := K) E.placement := by + apply Matrix.ext + intro i j + simp only [Matrix.mul_apply, Fintype.sum_sum_type, reverseTwistInjection, + reverseTwistProjection, MulZeroClass.zero_mul, MulZeroClass.mul_zero, + Finset.sum_const_zero, add_zero, zero_add] + exact congrFun (congrFun (projectiveIdentity_mul Q + (projectiveEntries_identity Q (K := K) (p := E.placement))) i) j + +lemma reverseTwist_sourceEquation (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + reverseTwistProjection Q E α * reverseTwistInjection Q E α = + projectiveIdentity Q (inverseTwistPlacement Q E α) + + (reverseTwistDifferential Q E α * reverseTwistHomotopy Q E α + + reverseTwistHomotopy Q E α * reverseTwistDifferential Q E α) := by + rw [inverseTwistIdentity_eq] + let t := testTransform Q E.placement E.placement α E.differential + let r := unitContraction Q E.placement α (K := K) + let θ := testToken Q E.placement α (K := K) + let ι := projectiveIdentity Q (K := K) (testPlacement Q E.placement α) + let e := evaluationMatrix Q E.placement α (K := K) + let η := projectiveIdentity Q (K := K) E.placement + let c := coevaluationMatrix Q E.placement α (K := K) + have hf : reverseTwistProjection Q E α = FiveBlock.reverseProjection e η := by + funext i j + rcases i with u | u | u | i | u <;> rfl + have hg : reverseTwistInjection Q E α = FiveBlock.reverseInjection c η := by + funext i j + rcases j with v | v | v | j | v <;> rfl + have hh : reverseTwistHomotopy Q E α = FiveBlock.reverseHomotopy ι := by + funext i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> + simp only [reverseTwistHomotopy, inverseTwistHomotopy, FiveBlock.reverseHomotopy, + Matrix.neg_apply, neg_zero, neg_neg] + all_goals rfl + have hd : reverseTwistDifferential Q E α = + FiveBlock.reverseDifferential t r θ ι e E.differential c := by + funext i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl + have hId : inverseTwistIdentity Q E α = FiveBlock.identity ι η := by + funext i j + rcases i with u | u | u | i | u <;> rcases j with v | v | v | j | v <;> rfl + rw [hf, hg, hh, hd, hId] + apply FiveBlock.reverseContraction + · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) + · exact projectiveIdentity_mul Q (projectiveEntries_identity Q) + · exact projectiveIdentity_mul Q (E.testComplex Q α).entries + · exact mul_projectiveIdentity Q (E.testComplex Q α).entries + · exact mul_projectiveIdentity Q (unitContraction_entries Q E α) + · exact projectiveIdentity_mul Q (testToken_entries Q E α) + · exact projectiveIdentity_mul Q (evaluation_entries Q E.placement α) + · exact mul_projectiveIdentity Q (evaluation_entries Q E.placement α) + · exact mul_projectiveIdentity Q (coevaluation_entries Q E.placement α) + · exact projectiveIdentity_mul Q (coevaluation_entries Q E.placement α) + · exact evaluation_coevaluation Q hn E.placement α + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarExactNotZero.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarExactNotZero.lean index 1a60d7414724914ca06666c83c26ea35fcba5bd5..3601868d72b5c71bd65843da3e57af0864323a2c 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarExactNotZero.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarExactNotZero.lean @@ -1,57 +1,57 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.Initial -import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex -import OAI.Topology.ArtinGroups.Complexes.TestExact - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -omit [Fintype V] [DecidableEq A] in -lemma scalarExact_not_of_zero_differential {I:Type u} [Fintype I] - (E:BasedComplex Q (K:=K) I) (α:V) (hd:E.differential=0) (i:I) : - ¬ScalarExactAt Q E α (E.placement i).level (E.placement i).cochain := by - intro h - have hdm:E.differential.map (vertexHom Q α)=0 := by rw [hd]; ext a b; exact map_zero (vertexHom Q (K:=K) α) - let x:I→K:=Pi.single i 1 - have hx:ScalarSupported Q E (E.placement i).level (E.placement i).cochain x := by - intro j hj - have hji:j≠i:=by rintro rfl; exact hj ⟨rfl,rfl⟩ - exact Pi.single_eq_of_ne hji _ - obtain ⟨y,_,hy⟩:=h x hx (by rw [hdm,Matrix.vecMul_zero]) - rw [hdm,Matrix.vecMul_zero] at hy - have hh:=congrFun hy i - simp [x] at hh - -lemma initialClass_test_not_exact (α β:V) (p:Zigzag.CornerPath Q α β) : - ¬ClassTestExact Q α (Path.length p.val) 0 (initialClass Q (K:=K) β) := by - let E:=initialProjective Q (K:=K) β - change ¬ScalarExactAt Q (E.testComplex Q α) α _ _ - have hd:(E.testComplex Q α).differential=0 := by - change scalarCornerMatrix Q α (testMatrix Q E.placement E.placement α 0)=0 - rw [testMatrix_zero,scalarCornerMatrix_zero] - simpa only [E,testComplex,testPlacement,initialProjective,GeneratorPlacement.level, - zero_add] using scalarExact_not_of_zero_differential Q (E.testComplex Q α) α hd ⟨PUnit.unit,p⟩ - -lemma classPositiveTwist_initial_orthogonal {α β:V} (h:OrthogonalVertices Q α β) : - classPositiveTwist Q α (initialClass Q (K:=K) β)=initialClass Q β := by - let E:=initialProjective Q (K:=K) β - let :IsEmpty (TestIndex Q E.placement α):=⟨fun i=>by - rcases i with ⟨i,⟨p,hs,ht⟩⟩ - change Path.source Q p=α at hs - change Path.target Q p=β at ht - rcases p with a|a|a - · exact h.1 (hs.symm.trans ht) - · exact h.2 a hs ht - · exact h.1 (hs.symm.trans ht)⟩ - change classOfComplex Q (E.positiveTwist Q α)=classOfComplex Q E - rw [classOfComplex_reindex Q _ (Equiv.emptySum (TestIndex Q E.placement α) PUnit).symm] - congr 1 - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.Initial +import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex +import OAI.Topology.ArtinGroups.Complexes.TestExact + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +omit [Fintype V] [DecidableEq A] in +lemma scalarExact_not_of_zero_differential {I:Type u} [Fintype I] + (E:BasedComplex Q (K:=K) I) (α:V) (hd:E.differential=0) (i:I) : + ¬ScalarExactAt Q E α (E.placement i).level (E.placement i).cochain := by + intro h + have hdm:E.differential.map (vertexHom Q α)=0 := by rw [hd]; ext a b; exact map_zero (vertexHom Q (K:=K) α) + let x:I→K:=Pi.single i 1 + have hx:ScalarSupported Q E (E.placement i).level (E.placement i).cochain x := by + intro j hj + have hji:j≠i:=by rintro rfl; exact hj ⟨rfl,rfl⟩ + exact Pi.single_eq_of_ne hji _ + obtain ⟨y,_,hy⟩:=h x hx (by rw [hdm,Matrix.vecMul_zero]) + rw [hdm,Matrix.vecMul_zero] at hy + have hh:=congrFun hy i + simp [x] at hh + +lemma initialClass_test_not_exact (α β:V) (p:Zigzag.CornerPath Q α β) : + ¬ClassTestExact Q α (Path.length p.val) 0 (initialClass Q (K:=K) β) := by + let E:=initialProjective Q (K:=K) β + change ¬ScalarExactAt Q (E.testComplex Q α) α _ _ + have hd:(E.testComplex Q α).differential=0 := by + change scalarCornerMatrix Q α (testMatrix Q E.placement E.placement α 0)=0 + rw [testMatrix_zero,scalarCornerMatrix_zero] + simpa only [E,testComplex,testPlacement,initialProjective,GeneratorPlacement.level, + zero_add] using scalarExact_not_of_zero_differential Q (E.testComplex Q α) α hd ⟨PUnit.unit,p⟩ + +lemma classPositiveTwist_initial_orthogonal {α β:V} (h:OrthogonalVertices Q α β) : + classPositiveTwist Q α (initialClass Q (K:=K) β)=initialClass Q β := by + let E:=initialProjective Q (K:=K) β + let :IsEmpty (TestIndex Q E.placement α):=⟨fun i=>by + rcases i with ⟨i,⟨p,hs,ht⟩⟩ + change Path.source Q p=α at hs + change Path.target Q p=β at ht + rcases p with a|a|a + · exact h.1 (hs.symm.trans ht) + · exact h.2 a hs ht + · exact h.1 (hs.symm.trans ht)⟩ + change classOfComplex Q (E.positiveTwist Q α)=classOfComplex Q E + rw [classOfComplex_reindex Q _ (Equiv.emptySum (TestIndex Q E.placement α) PUnit).symm] + congr 1 + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarKernel.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarKernel.lean index 683536b5ff15df178c9c847a828dc735441adcc8..011c4e73f00bf618b967815b30facf8cc7dac1e5 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarKernel.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarKernel.lean @@ -1,276 +1,276 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PlacedProjective -import OAI.Topology.ArtinGroups.Complexes.Shift - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -def ScalarKernel {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (f:Map Q E F) (x:I→K) : Prop := ∀ j β,∑ i,x i*(f.matrix i j).vertex β=0 - -def PlacementSupported (E:BasedComplex Q (K:=K) I) (α:V) (c:ℤ) (x:I→K) : Prop := - ∀ i,(E.placement i).color≠α ∨ (E.placement i).cochain≠c→x i=0 - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma differential_arrow_right_support (E:BasedComplex Q (K:=K) I) (i j:I) (a:A) - (h:(E.placement j).color≠Q.target a) : (E.differential i j).arrow a=0 := by - have hh:=congrArg (fun z:Q.Zigzag K=>z.arrow a) (E.entries.2 i j) - simpa only [arrow_mul,Pi.add_apply,leftScale,rightScale,arrow_vertexId,Pi.zero_apply, - MulZeroClass.mul_zero,zero_add,vertexId_eval,ite_eq_right h.symm,MulZeroClass.mul_zero] using hh.symm - -noncomputable def coefficientOutgoing (E:BasedComplex Q (K:=K) I) (x:I→K) (a:A) : I→K := - fun j=>∑ i,x i*(E.differential i j).arrow a - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma coefficientOutgoing_support (E:BasedComplex Q (K:=K) I) (α:V) (c:ℤ) - {x:I→K} (hx:PlacementSupported Q E α c x) (a:A) : - PlacementSupported Q E (Q.target a) (c+1) (coefficientOutgoing Q E x a) := by - intro j hj - apply Finset.sum_eq_zero - intro i _ - rcases hj with hj|hj - · rw [differential_arrow_right_support Q E i j a hj,MulZeroClass.mul_zero] - · by_cases hi:(E.placement i).cochain=c - · rw [(E.degree i j).1 (by omega)] - exact MulZeroClass.mul_zero _ - · rw [hx i (Or.inr hi),MulZeroClass.zero_mul] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma ScalarKernel.outgoing {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - {f:Map Q E F} (hf:CoefficientMatrix Q f.matrix) {x:I→K} (hx:ScalarKernel Q f x) - (a:A) : ScalarKernel Q f (coefficientOutgoing Q E x a) := by - intro j β - by_cases hb:β=(F.placement j).color - · subst β - by_cases hja:(F.placement j).color=Q.target a - · rw [hja] - have hh (i:I) := congrArg (fun M:Matrix I J (Q.Zigzag K)=>(M i j).arrow a) f.commute - simp only [Matrix.mul_apply,arrow_sum,Finset.sum_apply,arrow_mul,Pi.add_apply, - leftScale,rightScale,(hf _ _).1,Pi.zero_apply,MulZeroClass.mul_zero, - MulZeroClass.zero_mul,zero_add,add_zero] at hh - change ∑ k,(∑ i,x i*(E.differential i k).arrow a)*(f.matrix k j).vertex (Q.target a)=0 - simp_rw [Finset.sum_mul] - rw [Finset.sum_comm] - simp_rw [_root_.mul_assoc,← Finset.mul_sum,hh,Finset.mul_sum,← _root_.mul_assoc] - rw [Finset.sum_comm] - simp only [← Finset.sum_mul] - apply Finset.sum_eq_zero - intro k _ - rw [hx k (Q.source a),MulZeroClass.zero_mul] - · apply Finset.sum_eq_zero - intro i _ - by_cases hc:(E.placement i).color=Q.target a - · have he:(f.matrix i j).vertex (F.placement j).color=0 := by - by_contra he - have hs:=reduction_support Q f.entries f.degree i j _ he - exact hja (hs.1 ▸ hc) - rw [he,MulZeroClass.mul_zero] - · have hz:coefficientOutgoing Q E x a i=0 := by - apply Finset.sum_eq_zero - intro k _ - rw [differential_arrow_right_support Q E k i a hc,MulZeroClass.mul_zero] - rw [hz,MulZeroClass.zero_mul] - · apply Finset.sum_eq_zero - intro i _ - rw [entry_vertex_right_support Q f.entries i j β hb,MulZeroClass.mul_zero] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma ScalarKernel.project {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - {f:Map Q E F} {x:I→K} (hx:ScalarKernel Q f x) (p:GeneratorPlacement V) : - ScalarKernel Q f (fun i=>if E.placement i=p then x i else 0) := by - intro j β - by_cases hj:F.placement j=p - · convert hx j β using 1 - apply Finset.sum_congr rfl - intro i _ - dsimp only - by_cases hi:E.placement i=p - · rw [ite_eq_left hi] - · rw [ite_eq_right hi,MulZeroClass.zero_mul] - have hz:(f.matrix i j).vertex β=0 := by - by_contra hz - exact hi ((reduction_support Q f.entries f.degree i j β hz).1.trans hj) - rw [hz,MulZeroClass.mul_zero] - · apply Finset.sum_eq_zero - intro i _ - dsimp only - by_cases hi:E.placement i=p - · rw [ite_eq_left hi] - have hz:(f.matrix i j).vertex β=0 := by - by_contra hz - exact hj ((reduction_support Q f.entries f.degree i j β hz).1.symm.trans hi) - rw [hz,MulZeroClass.mul_zero] - · rw [ite_eq_right hi,MulZeroClass.zero_mul] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma scalarKernel_has_socle {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - {f:Map Q E F} (hf:CoefficientMatrix Q f.matrix) {x:I→K} - (hx:ScalarKernel Q f x) (hx0:x≠0) : - ∃ α c y,y∈coefficientSocle Q E α c ∧ y≠0 ∧ ScalarKernel Q f y := by - let S:Finset I:=Finset.univ.filter fun i=>∃ y:I→K, - PlacementSupported Q E (E.placement i).color (E.placement i).cochain y ∧ - y≠0 ∧ ScalarKernel Q f y - have hs:S.Nonempty := by - obtain ⟨i,hi⟩:∃ i,x i≠0 := by - by_contra h - push Not at h - exact hx0 (funext h) - let y:I→K:=fun j=>if E.placement j=E.placement i then x j else 0 - refine ⟨i,Finset.mem_filter.mpr ⟨Finset.mem_univ _,y,?_,?_,hx.project Q _⟩⟩ - · intro j hj - have he:E.placement j≠E.placement i := by intro he; simp only [he,ne_self_iff_false,or_self] at hj - exact ite_eq_right he - · intro hz - have hh:=congrFun hz i - apply hi - simpa only [y,ite_eq_left rfl,Pi.zero_apply] using hh - obtain ⟨i,hi,hmax⟩:=Finset.exists_max_image S (fun i=>(E.placement i).cochain) hs - obtain ⟨y,hy,hy0,hyker⟩:=(Finset.mem_filter.mp hi).2 - refine ⟨(E.placement i).color,(E.placement i).cochain,y,⟨hy,?_⟩,hy0,hyker⟩ - intro j a _ - have hz:coefficientOutgoing Q E y a=0 := by - by_contra hz - obtain ⟨t,ht⟩:∃ t,coefficientOutgoing Q E y a t≠0 := by - by_contra h - push Not at h - exact hz (funext h) - have hsupp:=coefficientOutgoing_support Q E _ _ hy a - have hc:(E.placement t).color=Q.target a := - Classical.not_not.mp (fun hn=>ht (hsupp t (Or.inl hn))) - have hd:(E.placement t).cochain=(E.placement i).cochain+1 := - Classical.not_not.mp (fun hn=>ht (hsupp t (Or.inr hn))) - have htS:t∈S := by - apply Finset.mem_filter.mpr - refine ⟨Finset.mem_univ _,coefficientOutgoing Q E y a,?_,hz,hyker.outgoing Q hf a⟩ - simpa only [hc,hd] using hsupp - have hh:=hmax t htS - omega - exact congrFun hz j - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -theorem pureMap_scalarKernel_zero (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - {q:ℤ} (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) - (f:Map Q E F) - (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ - HomMonoFrom Q T.complex f) - {x:I→K} (hx:ScalarKernel Q f x) : x=0 := by - by_contra hx0 - obtain ⟨α,c,y,hy,hy0,hyk⟩:=scalarKernel_has_socle Q (pureMap_coefficient Q f q hE hF) hx hx0 - let p:GeneratorPlacement V:=⟨α,c,q-c⟩ - let P:=placedProjective Q (K:=K) p - have hP:∀ i,(P.placement i).level=q := by intro i; change c+(q-c)=q; omega - let z:PUnit.{u+1}→K:=fun _=>1 - have hz:z∈coefficientTopDual Q P α c := by - constructor - · intro i hi - exact (hi.elim (fun h=>h rfl) (fun h=>h rfl)).elim - · intro i a - change ∑ j:PUnit.{u+1},(0:K)*z j=0 - simp only [MulZeroClass.zero_mul,Finset.sum_const_zero] - let g:=topSocleMatrix Q α z y - have hg:g∈homCycles Q P E 0 0 := by - simpa only [sub_self] using topSocleMatrix_mem_homCycles Q P E hP hE α c c hz hy - have hg':g*f.matrix∈homCycles Q P F 0 0 := by - simpa only [zero_add] using homCycles_mul Q hg (map_mem_homCycles Q f) - have hco:CoefficientMatrix Q (g*f.matrix):= - pure_homSpace_coefficient Q P F hP hF (by omega) hg'.1 - have hzero:g*f.matrix=0 := by - apply Matrix.ext - intro i j - apply coefficient_row_zero Q hg'.1.1 hco i _ j - intro j - change (∑ k,g i k*f.matrix k j).vertex α=0 - simp only [vertex_sum,Finset.sum_apply,g,topSocleMatrix,vertex_mul,vertex_smul, - Pi.mul_apply,Pi.smul_apply,smul_eq_mul,vertexId_eval,_root_.mul_one,z,_root_.one_mul,ite_true,eq_self] - exact hyk j α - have hmono:=derivedMono_postcompose_injective Q P E F hP hE (n:=0) (v:=0) (by omega) f hm - have hgzero:(⟨g,hg⟩:homCycles Q P E 0 0)=0 := by - apply hmono - apply Subtype.ext - change g*f.matrix=(0:Matrix PUnit.{u+1} I (Q.Zigzag K))*f.matrix - rw [Matrix.zero_mul] - exact hzero - exact topSocleMatrix_ne_zero Q α (by intro h; have hh:=congrFun h PUnit.unit; exact one_ne_zero hh) hy0 - (congrArg Subtype.val hgzero) - -noncomputable def Map.scalarMatrix {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (f:Map Q E F) : Matrix I J K := fun i j=>(f.matrix i j).vertex (F.placement j).color - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma map_vertex_source_eq_target {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (f:Map Q E F) (i:I) (j:J) : - (f.matrix i j).vertex (E.placement i).color=f.scalarMatrix Q i j := by - by_cases h:(E.placement i).color=(F.placement j).color - · exact congrArg _ h - · rw [entry_vertex_right_support Q f.entries i j _ h] - exact (entry_vertex_left_support Q f.entries i j _ (Ne.symm h)).symm - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma map_coefficient_entry {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (f:Map Q E F) (hf:CoefficientMatrix Q f.matrix) (i:I) (j:J) : - f.matrix i j=f.scalarMatrix Q i j •vertexId Q (E.placement i).color := by - apply ext - · funext β - simp only [vertex_smul,Pi.smul_apply,smul_eq_mul,vertexId_eval] - by_cases hb:β=(E.placement i).color - · subst β - rw [ite_eq_left rfl,_root_.mul_one] - exact map_vertex_source_eq_target Q f i j - · rw [ite_eq_right hb,MulZeroClass.mul_zero] - exact entry_vertex_left_support Q f.entries i j _ hb - · simpa only [arrow_smul,arrow_vertexId,smul_zero] using (hf i j).1 - · simpa only [token_smul,token_vertexId,smul_zero] using (hf i j).2 - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma scalarKernel_of_vecMul_zero {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} - (f:Map Q E F) {x:I→K} (hx:Matrix.vecMul x (f.scalarMatrix Q)=0) : ScalarKernel Q f x := by - intro j β - by_cases hb:β=(F.placement j).color - · subst β - exact congrFun hx j - · apply Finset.sum_eq_zero - intro i _ - rw [entry_vertex_right_support Q f.entries i j _ hb,MulZeroClass.mul_zero] - -omit [Fintype V] [DecidableEq A] in -theorem pureMap_termwiseSplit (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - {q:ℤ} (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) - (f:Map Q E F) - (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ - HomMonoFrom Q T.complex f) : - ∃ g:TermwiseSplitInjection Q E F,g.inclusion=f := by - let R:=f.scalarMatrix Q - have hk:LinearMap.ker R.toLinearMapRight'=⊥ := by - apply LinearMap.ker_eq_bot'.mpr - intro x hx - exact pureMap_scalarKernel_zero Q E F hE hF f hm (scalarKernel_of_vecMul_zero Q f hx) - obtain ⟨s,hs⟩:=LinearMap.exists_leftInverse_of_injective R.toLinearMapRight' hk - let S:=s.toMatrixRight' - have hRS:R*S=1 := by - have hh:=congrArg LinearMap.toMatrixRight' hs - simpa only [LinearMap.toMatrixRight'_comp,LinearMap.toMatrixRight'_id, - LinearEquiv.apply_symm_apply] using hh - let g:Matrix J I (Q.Zigzag K):=fun j i=>S j i •(1:Q.Zigzag K) - refine ⟨⟨f,g,?_⟩,rfl⟩ - apply Matrix.ext - intro i j - change ∑ k,f.matrix i k*g k j=projectiveIdentity Q E.placement i j - simp_rw [map_coefficient_entry Q f (pureMap_coefficient Q f q hE hF)] - simp only [g,smul_mul_smul_comm,_root_.mul_one,← Finset.sum_smul] - have hij:=congrArg (fun N:Matrix I I K=>N i j) hRS - change (∑ k,f.scalarMatrix Q i k*S k j)=(1:Matrix I I K) i j at hij - rw [hij] - by_cases he:i=j - · subst j - simp only [Matrix.one_apply_eq,one_smul,projectiveIdentity,Matrix.diagonal_apply_eq] - · simp only [Matrix.one_apply_ne he,zero_smul,projectiveIdentity,Matrix.diagonal_apply_ne _ he] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PlacedProjective +import OAI.Topology.ArtinGroups.Complexes.Shift + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +def ScalarKernel {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (f:Map Q E F) (x:I→K) : Prop := ∀ j β,∑ i,x i*(f.matrix i j).vertex β=0 + +def PlacementSupported (E:BasedComplex Q (K:=K) I) (α:V) (c:ℤ) (x:I→K) : Prop := + ∀ i,(E.placement i).color≠α ∨ (E.placement i).cochain≠c→x i=0 + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma differential_arrow_right_support (E:BasedComplex Q (K:=K) I) (i j:I) (a:A) + (h:(E.placement j).color≠Q.target a) : (E.differential i j).arrow a=0 := by + have hh:=congrArg (fun z:Q.Zigzag K=>z.arrow a) (E.entries.2 i j) + simpa only [arrow_mul,Pi.add_apply,leftScale,rightScale,arrow_vertexId,Pi.zero_apply, + MulZeroClass.mul_zero,zero_add,vertexId_eval,ite_eq_right h.symm,MulZeroClass.mul_zero] using hh.symm + +noncomputable def coefficientOutgoing (E:BasedComplex Q (K:=K) I) (x:I→K) (a:A) : I→K := + fun j=>∑ i,x i*(E.differential i j).arrow a + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma coefficientOutgoing_support (E:BasedComplex Q (K:=K) I) (α:V) (c:ℤ) + {x:I→K} (hx:PlacementSupported Q E α c x) (a:A) : + PlacementSupported Q E (Q.target a) (c+1) (coefficientOutgoing Q E x a) := by + intro j hj + apply Finset.sum_eq_zero + intro i _ + rcases hj with hj|hj + · rw [differential_arrow_right_support Q E i j a hj,MulZeroClass.mul_zero] + · by_cases hi:(E.placement i).cochain=c + · rw [(E.degree i j).1 (by omega)] + exact MulZeroClass.mul_zero _ + · rw [hx i (Or.inr hi),MulZeroClass.zero_mul] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma ScalarKernel.outgoing {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + {f:Map Q E F} (hf:CoefficientMatrix Q f.matrix) {x:I→K} (hx:ScalarKernel Q f x) + (a:A) : ScalarKernel Q f (coefficientOutgoing Q E x a) := by + intro j β + by_cases hb:β=(F.placement j).color + · subst β + by_cases hja:(F.placement j).color=Q.target a + · rw [hja] + have hh (i:I) := congrArg (fun M:Matrix I J (Q.Zigzag K)=>(M i j).arrow a) f.commute + simp only [Matrix.mul_apply,arrow_sum,Finset.sum_apply,arrow_mul,Pi.add_apply, + leftScale,rightScale,(hf _ _).1,Pi.zero_apply,MulZeroClass.mul_zero, + MulZeroClass.zero_mul,zero_add,add_zero] at hh + change ∑ k,(∑ i,x i*(E.differential i k).arrow a)*(f.matrix k j).vertex (Q.target a)=0 + simp_rw [Finset.sum_mul] + rw [Finset.sum_comm] + simp_rw [_root_.mul_assoc,← Finset.mul_sum,hh,Finset.mul_sum,← _root_.mul_assoc] + rw [Finset.sum_comm] + simp only [← Finset.sum_mul] + apply Finset.sum_eq_zero + intro k _ + rw [hx k (Q.source a),MulZeroClass.zero_mul] + · apply Finset.sum_eq_zero + intro i _ + by_cases hc:(E.placement i).color=Q.target a + · have he:(f.matrix i j).vertex (F.placement j).color=0 := by + by_contra he + have hs:=reduction_support Q f.entries f.degree i j _ he + exact hja (hs.1 ▸ hc) + rw [he,MulZeroClass.mul_zero] + · have hz:coefficientOutgoing Q E x a i=0 := by + apply Finset.sum_eq_zero + intro k _ + rw [differential_arrow_right_support Q E k i a hc,MulZeroClass.mul_zero] + rw [hz,MulZeroClass.zero_mul] + · apply Finset.sum_eq_zero + intro i _ + rw [entry_vertex_right_support Q f.entries i j β hb,MulZeroClass.mul_zero] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma ScalarKernel.project {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + {f:Map Q E F} {x:I→K} (hx:ScalarKernel Q f x) (p:GeneratorPlacement V) : + ScalarKernel Q f (fun i=>if E.placement i=p then x i else 0) := by + intro j β + by_cases hj:F.placement j=p + · convert hx j β using 1 + apply Finset.sum_congr rfl + intro i _ + dsimp only + by_cases hi:E.placement i=p + · rw [ite_eq_left hi] + · rw [ite_eq_right hi,MulZeroClass.zero_mul] + have hz:(f.matrix i j).vertex β=0 := by + by_contra hz + exact hi ((reduction_support Q f.entries f.degree i j β hz).1.trans hj) + rw [hz,MulZeroClass.mul_zero] + · apply Finset.sum_eq_zero + intro i _ + dsimp only + by_cases hi:E.placement i=p + · rw [ite_eq_left hi] + have hz:(f.matrix i j).vertex β=0 := by + by_contra hz + exact hj ((reduction_support Q f.entries f.degree i j β hz).1.symm.trans hi) + rw [hz,MulZeroClass.mul_zero] + · rw [ite_eq_right hi,MulZeroClass.zero_mul] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma scalarKernel_has_socle {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + {f:Map Q E F} (hf:CoefficientMatrix Q f.matrix) {x:I→K} + (hx:ScalarKernel Q f x) (hx0:x≠0) : + ∃ α c y,y∈coefficientSocle Q E α c ∧ y≠0 ∧ ScalarKernel Q f y := by + let S:Finset I:=Finset.univ.filter fun i=>∃ y:I→K, + PlacementSupported Q E (E.placement i).color (E.placement i).cochain y ∧ + y≠0 ∧ ScalarKernel Q f y + have hs:S.Nonempty := by + obtain ⟨i,hi⟩:∃ i,x i≠0 := by + by_contra h + push Not at h + exact hx0 (funext h) + let y:I→K:=fun j=>if E.placement j=E.placement i then x j else 0 + refine ⟨i,Finset.mem_filter.mpr ⟨Finset.mem_univ _,y,?_,?_,hx.project Q _⟩⟩ + · intro j hj + have he:E.placement j≠E.placement i := by intro he; simp only [he,ne_self_iff_false,or_self] at hj + exact ite_eq_right he + · intro hz + have hh:=congrFun hz i + apply hi + simpa only [y,ite_eq_left rfl,Pi.zero_apply] using hh + obtain ⟨i,hi,hmax⟩:=Finset.exists_max_image S (fun i=>(E.placement i).cochain) hs + obtain ⟨y,hy,hy0,hyker⟩:=(Finset.mem_filter.mp hi).2 + refine ⟨(E.placement i).color,(E.placement i).cochain,y,⟨hy,?_⟩,hy0,hyker⟩ + intro j a _ + have hz:coefficientOutgoing Q E y a=0 := by + by_contra hz + obtain ⟨t,ht⟩:∃ t,coefficientOutgoing Q E y a t≠0 := by + by_contra h + push Not at h + exact hz (funext h) + have hsupp:=coefficientOutgoing_support Q E _ _ hy a + have hc:(E.placement t).color=Q.target a := + Classical.not_not.mp (fun hn=>ht (hsupp t (Or.inl hn))) + have hd:(E.placement t).cochain=(E.placement i).cochain+1 := + Classical.not_not.mp (fun hn=>ht (hsupp t (Or.inr hn))) + have htS:t∈S := by + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_univ _,coefficientOutgoing Q E y a,?_,hz,hyker.outgoing Q hf a⟩ + simpa only [hc,hd] using hsupp + have hh:=hmax t htS + omega + exact congrFun hz j + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +theorem pureMap_scalarKernel_zero (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + {q:ℤ} (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) + (f:Map Q E F) + (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ + HomMonoFrom Q T.complex f) + {x:I→K} (hx:ScalarKernel Q f x) : x=0 := by + by_contra hx0 + obtain ⟨α,c,y,hy,hy0,hyk⟩:=scalarKernel_has_socle Q (pureMap_coefficient Q f q hE hF) hx hx0 + let p:GeneratorPlacement V:=⟨α,c,q-c⟩ + let P:=placedProjective Q (K:=K) p + have hP:∀ i,(P.placement i).level=q := by intro i; change c+(q-c)=q; omega + let z:PUnit.{u+1}→K:=fun _=>1 + have hz:z∈coefficientTopDual Q P α c := by + constructor + · intro i hi + exact (hi.elim (fun h=>h rfl) (fun h=>h rfl)).elim + · intro i a + change ∑ j:PUnit.{u+1},(0:K)*z j=0 + simp only [MulZeroClass.zero_mul,Finset.sum_const_zero] + let g:=topSocleMatrix Q α z y + have hg:g∈homCycles Q P E 0 0 := by + simpa only [sub_self] using topSocleMatrix_mem_homCycles Q P E hP hE α c c hz hy + have hg':g*f.matrix∈homCycles Q P F 0 0 := by + simpa only [zero_add] using homCycles_mul Q hg (map_mem_homCycles Q f) + have hco:CoefficientMatrix Q (g*f.matrix):= + pure_homSpace_coefficient Q P F hP hF (by omega) hg'.1 + have hzero:g*f.matrix=0 := by + apply Matrix.ext + intro i j + apply coefficient_row_zero Q hg'.1.1 hco i _ j + intro j + change (∑ k,g i k*f.matrix k j).vertex α=0 + simp only [vertex_sum,Finset.sum_apply,g,topSocleMatrix,vertex_mul,vertex_smul, + Pi.mul_apply,Pi.smul_apply,smul_eq_mul,vertexId_eval,_root_.mul_one,z,_root_.one_mul,ite_true,eq_self] + exact hyk j α + have hmono:=derivedMono_postcompose_injective Q P E F hP hE (n:=0) (v:=0) (by omega) f hm + have hgzero:(⟨g,hg⟩:homCycles Q P E 0 0)=0 := by + apply hmono + apply Subtype.ext + change g*f.matrix=(0:Matrix PUnit.{u+1} I (Q.Zigzag K))*f.matrix + rw [Matrix.zero_mul] + exact hzero + exact topSocleMatrix_ne_zero Q α (by intro h; have hh:=congrFun h PUnit.unit; exact one_ne_zero hh) hy0 + (congrArg Subtype.val hgzero) + +noncomputable def Map.scalarMatrix {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (f:Map Q E F) : Matrix I J K := fun i j=>(f.matrix i j).vertex (F.placement j).color + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma map_vertex_source_eq_target {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (f:Map Q E F) (i:I) (j:J) : + (f.matrix i j).vertex (E.placement i).color=f.scalarMatrix Q i j := by + by_cases h:(E.placement i).color=(F.placement j).color + · exact congrArg _ h + · rw [entry_vertex_right_support Q f.entries i j _ h] + exact (entry_vertex_left_support Q f.entries i j _ (Ne.symm h)).symm + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma map_coefficient_entry {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (f:Map Q E F) (hf:CoefficientMatrix Q f.matrix) (i:I) (j:J) : + f.matrix i j=f.scalarMatrix Q i j •vertexId Q (E.placement i).color := by + apply ext + · funext β + simp only [vertex_smul,Pi.smul_apply,smul_eq_mul,vertexId_eval] + by_cases hb:β=(E.placement i).color + · subst β + rw [ite_eq_left rfl,_root_.mul_one] + exact map_vertex_source_eq_target Q f i j + · rw [ite_eq_right hb,MulZeroClass.mul_zero] + exact entry_vertex_left_support Q f.entries i j _ hb + · simpa only [arrow_smul,arrow_vertexId,smul_zero] using (hf i j).1 + · simpa only [token_smul,token_vertexId,smul_zero] using (hf i j).2 + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma scalarKernel_of_vecMul_zero {E:BasedComplex Q (K:=K) I} {F:BasedComplex Q (K:=K) J} + (f:Map Q E F) {x:I→K} (hx:Matrix.vecMul x (f.scalarMatrix Q)=0) : ScalarKernel Q f x := by + intro j β + by_cases hb:β=(F.placement j).color + · subst β + exact congrFun hx j + · apply Finset.sum_eq_zero + intro i _ + rw [entry_vertex_right_support Q f.entries i j _ hb,MulZeroClass.mul_zero] + +omit [Fintype V] [DecidableEq A] in +theorem pureMap_termwiseSplit (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + {q:ℤ} (hE:∀ i,(E.placement i).level=q) (hF:∀ j,(F.placement j).level=q) + (f:Map Q E F) + (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ + HomMonoFrom Q T.complex f) : + ∃ g:TermwiseSplitInjection Q E F,g.inclusion=f := by + let R:=f.scalarMatrix Q + have hk:LinearMap.ker R.toLinearMapRight'=⊥ := by + apply LinearMap.ker_eq_bot'.mpr + intro x hx + exact pureMap_scalarKernel_zero Q E F hE hF f hm (scalarKernel_of_vecMul_zero Q f hx) + obtain ⟨s,hs⟩:=LinearMap.exists_leftInverse_of_injective R.toLinearMapRight' hk + let S:=s.toMatrixRight' + have hRS:R*S=1 := by + have hh:=congrArg LinearMap.toMatrixRight' hs + simpa only [LinearMap.toMatrixRight'_comp,LinearMap.toMatrixRight'_id, + LinearEquiv.apply_symm_apply] using hh + let g:Matrix J I (Q.Zigzag K):=fun j i=>S j i •(1:Q.Zigzag K) + refine ⟨⟨f,g,?_⟩,rfl⟩ + apply Matrix.ext + intro i j + change ∑ k,f.matrix i k*g k j=projectiveIdentity Q E.placement i j + simp_rw [map_coefficient_entry Q f (pureMap_coefficient Q f q hE hF)] + simp only [g,smul_mul_smul_comm,_root_.mul_one,← Finset.sum_smul] + have hij:=congrArg (fun N:Matrix I I K=>N i j) hRS + change (∑ k,f.scalarMatrix Q i k*S k j)=(1:Matrix I I K) i j at hij + rw [hij] + by_cases he:i=j + · subst j + simp only [Matrix.one_apply_eq,one_smul,projectiveIdentity,Matrix.diagonal_apply_eq] + · simp only [Matrix.one_apply_ne he,zero_smul,projectiveIdentity,Matrix.diagonal_apply_ne _ he] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupported.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupported.lean index 6a71f7bfeb33ccf55e147fb23c075fd5777ac520..1be57a4c9e30b4b6e570682b0341c2fef8947988 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupported.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupported.lean @@ -1,110 +1,110 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.Reduction -import OAI.Topology.ArtinGroups.Harmonic.Level -import OAI.Topology.ArtinGroups.Quivers.CornerScalar - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype A] [DecidableEq V] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -def ScalarSupported (E:BasedComplex Q (K:=K) I) (l c:ℤ) (x:I→K) : Prop := - ∀ i,¬ ((E.placement i).level=l ∧ (E.placement i).cochain=c)→x i=0 - -def ScalarExactAt (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) : Prop := - ∀ x:I→K,ScalarSupported Q E l c x→ - Matrix.vecMul x (E.differential.map (vertexHom Q α))=0→ - ∃ y:I→K,ScalarSupported Q E (l-1) (c-1) y ∧ - Matrix.vecMul y (E.differential.map (vertexHom Q α))=x - -omit [DecidableEq I] in -lemma scalarSupported_sub (E:BasedComplex Q (K:=K) I) {l c:ℤ} {x y:I→K} - (hx:ScalarSupported Q E l c x) (hy:ScalarSupported Q E l c y) : - ScalarSupported Q E l c (x-y) := by - intro i hi - change x i-y i=0 - rw [hx i hi,hy i hi,sub_self] - -omit [DecidableEq I] [DecidableEq J] in -lemma scalarSupported_map (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (α:V) {l c n v:ℤ} (M:Matrix I J (Q.Zigzag K)) - (he:ProjectiveEntries Q E.placement F.placement M) - (hd:MapDegree Q E.placement F.placement n v M) - {x:I→K} (hx:ScalarSupported Q E l c x) : - ScalarSupported Q F (l+n+v) (c+n) (Matrix.vecMul x (M.map (vertexHom Q α))) := by - intro j hj - apply Finset.sum_eq_zero - intro i hi - change x i * (M i j).vertex α=0 - by_cases hxi:x i=0 - · rw [hxi,MulZeroClass.zero_mul] - by_cases hm:(M i j).vertex α=0 - · rw [hm,MulZeroClass.mul_zero] - have hp:(E.placement i).level=l ∧ (E.placement i).cochain=c := - Classical.not_not.mp (fun h=>hxi (hx i h)) - obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q he hd i j α hm - exact (hj (by dsimp only [GeneratorPlacement.level] at *; constructor <;> omega)).elim - -omit [DecidableEq I] in -lemma scalarDifferential_square (E:BasedComplex Q (K:=K) I) (α:V) : - E.differential.map (vertexHom Q α) * E.differential.map (vertexHom Q α)=0 := by - rw [← Matrix.map_mul,E.square_zero] - apply Matrix.ext - intro i j - change (vertexHom Q α) (0:Q.Zigzag K)=0 - exact map_zero _ - -theorem scalarExact_transport (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (e:HomotopyEquivalence Q E F) (α:V) (hcolor:∀ i,(E.placement i).color=α) - {l c:ℤ} (hF:ScalarExactAt Q F α l c) : ScalarExactAt Q E α l c := by - intro x hx hdx - let f:=e.forward.matrix.map (vertexHom Q α) - let b:=e.backward.matrix.map (vertexHom Q α) - let h:=e.sourceHomotopy.map (vertexHom Q α) - let dE:=E.differential.map (vertexHom Q α) - let dF:=F.differential.map (vertexHom Q α) - have hf: dE*f=f*dF := by - simpa only [Matrix.map_mul] using congrArg - (fun M:Matrix I J (Q.Zigzag K)=>M.map (vertexHom Q α)) e.forward.commute - have hb:dF*b=b*dE := by - simpa only [Matrix.map_mul] using congrArg - (fun M:Matrix J I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.backward.commute - have hs:ScalarSupported Q F l c (Matrix.vecMul x f) := by - simpa only [add_zero] using scalarSupported_map Q E F α e.forward.matrix - e.forward.entries e.forward.degree hx - have hd:Matrix.vecMul (Matrix.vecMul x f) dF=0 := by - rw [Matrix.vecMul_vecMul,← hf,← Matrix.vecMul_vecMul] - change Matrix.vecMul (Matrix.vecMul x dE) f=0 - rw [hdx,Matrix.zero_vecMul] - obtain ⟨y,hy,hdy⟩:=hF (Matrix.vecMul x f) hs hd - refine ⟨Matrix.vecMul y b-Matrix.vecMul x h,?_,?_⟩ - · apply scalarSupported_sub Q E - · simpa only [add_zero] using scalarSupported_map Q F E α e.backward.matrix - e.backward.entries e.backward.degree hy - · convert scalarSupported_map Q E E α e.sourceHomotopy e.sourceEntries e.sourceDegree hx using 1 <;> congr 1; omega - · have hid:(projectiveIdentity Q (K:=K) E.placement).map (vertexHom Q α)=1 := by - apply Matrix.ext - intro i j - by_cases he:i=j - · subst j - simp only [Matrix.one_apply,Matrix.map_apply,projectiveIdentity,Matrix.diagonal_apply] - change (vertexId Q (K:=K) (E.placement i).color).vertex α=1 - simp [hcolor i,vertexId_eval] - · simp [projectiveIdentity,Matrix.map_apply,he,vertexHom] - have he:f*b=1+dE*h+h*dE := by - simpa only [Matrix.map_mul,Matrix.map_add _ (map_add _),hid,← add_assoc] using congrArg - (fun M:Matrix I I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.sourceEquation - have hh:Matrix.vecMul (Matrix.vecMul x f) b=x+Matrix.vecMul (Matrix.vecMul x h) dE := by - rw [Matrix.vecMul_vecMul,he,Matrix.vecMul_add,Matrix.vecMul_add, - Matrix.vecMul_one,← Matrix.vecMul_vecMul] - change x+Matrix.vecMul (Matrix.vecMul x dE) h+_= _ - rw [hdx,Matrix.zero_vecMul,add_zero,← Matrix.vecMul_vecMul] - change Matrix.vecMul (Matrix.vecMul y b-Matrix.vecMul x h) dE=x - rw [Matrix.sub_vecMul,Matrix.vecMul_vecMul,← hb,← Matrix.vecMul_vecMul,hdy,hh] - exact add_sub_cancel_right _ _ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.Reduction +import OAI.Topology.ArtinGroups.Harmonic.Level +import OAI.Topology.ArtinGroups.Quivers.CornerScalar + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype A] [DecidableEq V] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +def ScalarSupported (E:BasedComplex Q (K:=K) I) (l c:ℤ) (x:I→K) : Prop := + ∀ i,¬ ((E.placement i).level=l ∧ (E.placement i).cochain=c)→x i=0 + +def ScalarExactAt (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) : Prop := + ∀ x:I→K,ScalarSupported Q E l c x→ + Matrix.vecMul x (E.differential.map (vertexHom Q α))=0→ + ∃ y:I→K,ScalarSupported Q E (l-1) (c-1) y ∧ + Matrix.vecMul y (E.differential.map (vertexHom Q α))=x + +omit [DecidableEq I] in +lemma scalarSupported_sub (E:BasedComplex Q (K:=K) I) {l c:ℤ} {x y:I→K} + (hx:ScalarSupported Q E l c x) (hy:ScalarSupported Q E l c y) : + ScalarSupported Q E l c (x-y) := by + intro i hi + change x i-y i=0 + rw [hx i hi,hy i hi,sub_self] + +omit [DecidableEq I] [DecidableEq J] in +lemma scalarSupported_map (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (α:V) {l c n v:ℤ} (M:Matrix I J (Q.Zigzag K)) + (he:ProjectiveEntries Q E.placement F.placement M) + (hd:MapDegree Q E.placement F.placement n v M) + {x:I→K} (hx:ScalarSupported Q E l c x) : + ScalarSupported Q F (l+n+v) (c+n) (Matrix.vecMul x (M.map (vertexHom Q α))) := by + intro j hj + apply Finset.sum_eq_zero + intro i hi + change x i * (M i j).vertex α=0 + by_cases hxi:x i=0 + · rw [hxi,MulZeroClass.zero_mul] + by_cases hm:(M i j).vertex α=0 + · rw [hm,MulZeroClass.mul_zero] + have hp:(E.placement i).level=l ∧ (E.placement i).cochain=c := + Classical.not_not.mp (fun h=>hxi (hx i h)) + obtain ⟨_,_,hc,hu⟩:=degree_vertex_support Q he hd i j α hm + exact (hj (by dsimp only [GeneratorPlacement.level] at *; constructor <;> omega)).elim + +omit [DecidableEq I] in +lemma scalarDifferential_square (E:BasedComplex Q (K:=K) I) (α:V) : + E.differential.map (vertexHom Q α) * E.differential.map (vertexHom Q α)=0 := by + rw [← Matrix.map_mul,E.square_zero] + apply Matrix.ext + intro i j + change (vertexHom Q α) (0:Q.Zigzag K)=0 + exact map_zero _ + +theorem scalarExact_transport (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (e:HomotopyEquivalence Q E F) (α:V) (hcolor:∀ i,(E.placement i).color=α) + {l c:ℤ} (hF:ScalarExactAt Q F α l c) : ScalarExactAt Q E α l c := by + intro x hx hdx + let f:=e.forward.matrix.map (vertexHom Q α) + let b:=e.backward.matrix.map (vertexHom Q α) + let h:=e.sourceHomotopy.map (vertexHom Q α) + let dE:=E.differential.map (vertexHom Q α) + let dF:=F.differential.map (vertexHom Q α) + have hf: dE*f=f*dF := by + simpa only [Matrix.map_mul] using congrArg + (fun M:Matrix I J (Q.Zigzag K)=>M.map (vertexHom Q α)) e.forward.commute + have hb:dF*b=b*dE := by + simpa only [Matrix.map_mul] using congrArg + (fun M:Matrix J I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.backward.commute + have hs:ScalarSupported Q F l c (Matrix.vecMul x f) := by + simpa only [add_zero] using scalarSupported_map Q E F α e.forward.matrix + e.forward.entries e.forward.degree hx + have hd:Matrix.vecMul (Matrix.vecMul x f) dF=0 := by + rw [Matrix.vecMul_vecMul,← hf,← Matrix.vecMul_vecMul] + change Matrix.vecMul (Matrix.vecMul x dE) f=0 + rw [hdx,Matrix.zero_vecMul] + obtain ⟨y,hy,hdy⟩:=hF (Matrix.vecMul x f) hs hd + refine ⟨Matrix.vecMul y b-Matrix.vecMul x h,?_,?_⟩ + · apply scalarSupported_sub Q E + · simpa only [add_zero] using scalarSupported_map Q F E α e.backward.matrix + e.backward.entries e.backward.degree hy + · convert scalarSupported_map Q E E α e.sourceHomotopy e.sourceEntries e.sourceDegree hx using 1 <;> congr 1; omega + · have hid:(projectiveIdentity Q (K:=K) E.placement).map (vertexHom Q α)=1 := by + apply Matrix.ext + intro i j + by_cases he:i=j + · subst j + simp only [Matrix.one_apply,Matrix.map_apply,projectiveIdentity,Matrix.diagonal_apply] + change (vertexId Q (K:=K) (E.placement i).color).vertex α=1 + simp [hcolor i,vertexId_eval] + · simp [projectiveIdentity,Matrix.map_apply,he,vertexHom] + have he:f*b=1+dE*h+h*dE := by + simpa only [Matrix.map_mul,Matrix.map_add _ (map_add _),hid,← add_assoc] using congrArg + (fun M:Matrix I I (Q.Zigzag K)=>M.map (vertexHom Q α)) e.sourceEquation + have hh:Matrix.vecMul (Matrix.vecMul x f) b=x+Matrix.vecMul (Matrix.vecMul x h) dE := by + rw [Matrix.vecMul_vecMul,he,Matrix.vecMul_add,Matrix.vecMul_add, + Matrix.vecMul_one,← Matrix.vecMul_vecMul] + change x+Matrix.vecMul (Matrix.vecMul x dE) h+_= _ + rw [hdx,Matrix.zero_vecMul,add_zero,← Matrix.vecMul_vecMul] + change Matrix.vecMul (Matrix.vecMul y b-Matrix.vecMul x h) dE=x + rw [Matrix.sub_vecMul,Matrix.vecMul_vecMul,← hb,← Matrix.vecMul_vecMul,hdy,hh] + exact add_sub_cancel_right _ _ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedCochainShift.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedCochainShift.lean index af447180d60d99698cc807fde98d6c404d035f68..8dcbb6c8ed36cda7dda39cd379bab39a4e4bf486 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedCochainShift.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedCochainShift.lean @@ -1,92 +1,92 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential -import OAI.Topology.ArtinGroups.Complexes.ScalarSupported -import OAI.Topology.ArtinGroups.Complexes.ArrowShift - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma scalarSupported_cochainShift (E F:BasedComplex Q (K:=K) I) - (hl:∀ i,(F.placement i).level=(E.placement i).level) - (hc:∀ i,(F.placement i).cochain=(E.placement i).cochain-1) - (l c:ℤ) (x:I→K) : ScalarSupported Q F l c x ↔ ScalarSupported Q E l (c+1) x := by - constructor <;> intro h i hi <;> apply h i <;> intro hh <;> apply hi - · rw [hl,hc] at hh - exact ⟨hh.1,by omega⟩ - · rw [hl,hc] - exact ⟨hh.1,by omega⟩ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma scalarExact_cochainShift_iff (E F:BasedComplex Q (K:=K) I) (α β:V) - (hl:∀ i,(F.placement i).level=(E.placement i).level) - (hc:∀ i,(F.placement i).cochain=(E.placement i).cochain-1) - (hd:F.differential.map (vertexHom Q β) = -E.differential.map (vertexHom Q α)) - (l c:ℤ) : ScalarExactAt Q F β l c ↔ ScalarExactAt Q E α l (c+1) := by - constructor - · intro h x hx hd0 - have hxs:ScalarSupported Q F l c x := - (scalarSupported_cochainShift Q E F hl hc l c x).mpr hx - have hdx:Matrix.vecMul x (F.differential.map (vertexHom Q β))=0 := by - rw [hd,Matrix.vecMul_neg,hd0,neg_zero] - obtain ⟨y,hy,hyb⟩:=h x hxs hdx - refine ⟨-y,?_,?_⟩ - · have hh:ScalarSupported Q E (l-1) (c-1+1) y := - (scalarSupported_cochainShift Q E F hl hc (l-1) (c-1) y).mp hy - intro i hi - change -y i=0 - rw [hh i,neg_zero] - simpa only [sub_add_cancel,add_sub_cancel_right] using hi - · rw [hd,Matrix.vecMul_neg] at hyb - simpa only [Matrix.neg_vecMul] using hyb - · intro h x hx hd0 - have hxs:ScalarSupported Q E l (c+1) x := - (scalarSupported_cochainShift Q E F hl hc l c x).mp hx - have hdx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0 := by - rw [hd,Matrix.vecMul_neg] at hd0 - exact neg_eq_zero.mp hd0 - obtain ⟨y,hy,hyb⟩:=h x hxs hdx - refine ⟨-y,?_,?_⟩ - · apply (scalarSupported_cochainShift Q E F hl hc (l-1) (c-1) (-y)).mpr - intro i hi - change -y i=0 - rw [hy i,neg_zero] - simpa only [sub_add_cancel,add_sub_cancel_right] using hi - · rw [hd,Matrix.vecMul_neg,Matrix.neg_vecMul,neg_neg,hyb] - -theorem positiveTwist_adjacent_test_exact_iff (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) (l c:ℤ) : - ScalarExactAt Q (((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β) β l c ↔ - ScalarExactAt Q (E.testComplex Q α) α l (c+1) := by - let F:=(adjacentTestSecondPivot Q hn E e).reduced Q - have hl:∀ i,(F.placement i).level=((E.testComplex Q α).placement i).level := by - intro i - change (E.placement i.1).cochain-1+ - ((E.placement i.1).internal+Path.length i.2.val+1)= - (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val) - omega - have hc:∀ i,(F.placement i).cochain=((E.testComplex Q α).placement i).cochain-1:=fun _=>rfl - have hd:F.differential.map (vertexHom Q β)= - -(E.testComplex Q α).differential.map (vertexHom Q α) := by - rw [testComplex_vertex_differential] - apply Matrix.ext - intro i j - change (vertexHom Q β) (F.differential i j)= -testMatrix Q E.placement E.placement α E.differential i j - rw [adjacentTest_second_reduced_differential] - rw [map_neg] - congr 1 - change (testMatrix Q E.placement E.placement α E.differential i j • vertexId Q (K:=K) β).vertex β=_ - simp - rw [← scalarExact_cochainShift_iff Q (E.testComplex Q α) F α β hl hc hd l c] - have h:=adjacentTestReduction Q hn E e - constructor - · exact fun h0=>scalarExact_transport Q _ _ (h.symm Q) β (fun _=>rfl) h0 - · exact fun h0=>scalarExact_transport Q _ _ h β (fun _=>rfl) h0 - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TestComplexVertexDifferential +import OAI.Topology.ArtinGroups.Complexes.ScalarSupported +import OAI.Topology.ArtinGroups.Complexes.ArrowShift + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma scalarSupported_cochainShift (E F:BasedComplex Q (K:=K) I) + (hl:∀ i,(F.placement i).level=(E.placement i).level) + (hc:∀ i,(F.placement i).cochain=(E.placement i).cochain-1) + (l c:ℤ) (x:I→K) : ScalarSupported Q F l c x ↔ ScalarSupported Q E l (c+1) x := by + constructor <;> intro h i hi <;> apply h i <;> intro hh <;> apply hi + · rw [hl,hc] at hh + exact ⟨hh.1,by omega⟩ + · rw [hl,hc] + exact ⟨hh.1,by omega⟩ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma scalarExact_cochainShift_iff (E F:BasedComplex Q (K:=K) I) (α β:V) + (hl:∀ i,(F.placement i).level=(E.placement i).level) + (hc:∀ i,(F.placement i).cochain=(E.placement i).cochain-1) + (hd:F.differential.map (vertexHom Q β) = -E.differential.map (vertexHom Q α)) + (l c:ℤ) : ScalarExactAt Q F β l c ↔ ScalarExactAt Q E α l (c+1) := by + constructor + · intro h x hx hd0 + have hxs:ScalarSupported Q F l c x := + (scalarSupported_cochainShift Q E F hl hc l c x).mpr hx + have hdx:Matrix.vecMul x (F.differential.map (vertexHom Q β))=0 := by + rw [hd,Matrix.vecMul_neg,hd0,neg_zero] + obtain ⟨y,hy,hyb⟩:=h x hxs hdx + refine ⟨-y,?_,?_⟩ + · have hh:ScalarSupported Q E (l-1) (c-1+1) y := + (scalarSupported_cochainShift Q E F hl hc (l-1) (c-1) y).mp hy + intro i hi + change -y i=0 + rw [hh i,neg_zero] + simpa only [sub_add_cancel,add_sub_cancel_right] using hi + · rw [hd,Matrix.vecMul_neg] at hyb + simpa only [Matrix.neg_vecMul] using hyb + · intro h x hx hd0 + have hxs:ScalarSupported Q E l (c+1) x := + (scalarSupported_cochainShift Q E F hl hc l c x).mp hx + have hdx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0 := by + rw [hd,Matrix.vecMul_neg] at hd0 + exact neg_eq_zero.mp hd0 + obtain ⟨y,hy,hyb⟩:=h x hxs hdx + refine ⟨-y,?_,?_⟩ + · apply (scalarSupported_cochainShift Q E F hl hc (l-1) (c-1) (-y)).mpr + intro i hi + change -y i=0 + rw [hy i,neg_zero] + simpa only [sub_add_cancel,add_sub_cancel_right] using hi + · rw [hd,Matrix.vecMul_neg,Matrix.neg_vecMul,neg_neg,hyb] + +theorem positiveTwist_adjacent_test_exact_iff (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) {α β:V} (e:SimpleEdge Q α β) (l c:ℤ) : + ScalarExactAt Q (((E.positiveTwist Q β).positiveTwist Q α).testComplex Q β) β l c ↔ + ScalarExactAt Q (E.testComplex Q α) α l (c+1) := by + let F:=(adjacentTestSecondPivot Q hn E e).reduced Q + have hl:∀ i,(F.placement i).level=((E.testComplex Q α).placement i).level := by + intro i + change (E.placement i.1).cochain-1+ + ((E.placement i.1).internal+Path.length i.2.val+1)= + (E.placement i.1).cochain+((E.placement i.1).internal+Path.length i.2.val) + omega + have hc:∀ i,(F.placement i).cochain=((E.testComplex Q α).placement i).cochain-1:=fun _=>rfl + have hd:F.differential.map (vertexHom Q β)= + -(E.testComplex Q α).differential.map (vertexHom Q α) := by + rw [testComplex_vertex_differential] + apply Matrix.ext + intro i j + change (vertexHom Q β) (F.differential i j)= -testMatrix Q E.placement E.placement α E.differential i j + rw [adjacentTest_second_reduced_differential] + rw [map_neg] + congr 1 + change (testMatrix Q E.placement E.placement α E.differential i j • vertexId Q (K:=K) β).vertex β=_ + simp + rw [← scalarExact_cochainShift_iff Q (E.testComplex Q α) F α β hl hc hd l c] + have h:=adjacentTestReduction Q hn E e + constructor + · exact fun h0=>scalarExact_transport Q _ _ (h.symm Q) β (fun _=>rfl) h0 + · exact fun h0=>scalarExact_transport Q _ _ h β (fun _=>rfl) h0 + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedTokenShift.lean b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedTokenShift.lean index 6c2a2c169aab7ab6f3041bc26445856d63af569c..d91950d5b2153a81a087e4ac67cd57da861e5df3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedTokenShift.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/ScalarSupportedTokenShift.lean @@ -1,79 +1,79 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TokenShift -import OAI.Topology.ArtinGroups.Complexes.ScalarSupported - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma scalarSupported_tokenShift (E:BasedComplex Q (K:=K) I) (l c:ℤ) (x:I→K) : - ScalarSupported Q (E.tokenShift Q) l c x ↔ ScalarSupported Q E (l-1) (c+1) x := by - constructor <;> intro h i hi <;> apply h i <;> intro hh <;> apply hi - · change (E.placement i).cochain-1+((E.placement i).internal+2)=l ∧ - (E.placement i).cochain-1=c at hh - dsimp only [GeneratorPlacement.level] - omega - · change (E.placement i).cochain-1+((E.placement i).internal+2)=l ∧ - (E.placement i).cochain-1=c - dsimp only [GeneratorPlacement.level] at hh - omega - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma scalarDifferential_tokenShift (E:BasedComplex Q (K:=K) I) (α:V) : - (E.tokenShift Q).differential.map (vertexHom Q α)= - -E.differential.map (vertexHom Q α) := by - apply Matrix.ext - intro i j - exact map_neg (vertexHom Q α) _ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -theorem scalarExact_tokenShift_iff (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) : - ScalarExactAt Q (E.tokenShift Q) α l c ↔ ScalarExactAt Q E α (l-1) (c+1) := by - constructor - · intro h x hx hd - have hxs:ScalarSupported Q (E.tokenShift Q) l c x := - (scalarSupported_tokenShift Q E l c x).mpr hx - have hdx:Matrix.vecMul x ((E.tokenShift Q).differential.map (vertexHom Q α))=0 := by - rw [scalarDifferential_tokenShift,Matrix.vecMul_neg,hd,neg_zero] - obtain ⟨y,hy,hyb⟩:=h x hxs hdx - refine ⟨-y,?_,?_⟩ - · have hh:ScalarSupported Q E (l-1-1) (c-1+1) y := - (scalarSupported_tokenShift Q E (l-1) (c-1) y).mp hy - intro i hi - change -y i=0 - rw [hh i,neg_zero] - simpa only [sub_add_cancel,add_sub_cancel_right] using hi - · rw [scalarDifferential_tokenShift,Matrix.vecMul_neg] at hyb - simpa only [Matrix.neg_vecMul] using hyb - · intro h x hx hd - have hxs:ScalarSupported Q E (l-1) (c+1) x := - (scalarSupported_tokenShift Q E l c x).mp hx - have hdx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0 := by - rw [scalarDifferential_tokenShift,Matrix.vecMul_neg] at hd - exact neg_eq_zero.mp hd - obtain ⟨y,hy,hyb⟩:=h x hxs hdx - refine ⟨-y,?_,?_⟩ - · apply (scalarSupported_tokenShift Q E (l-1) (c-1) (-y)).mpr - intro i hi - change -y i=0 - rw [hy i,neg_zero] - simpa only [sub_add_cancel,add_sub_cancel_right] using hi - · rw [scalarDifferential_tokenShift,Matrix.vecMul_neg,Matrix.neg_vecMul,neg_neg,hyb] - -theorem positiveTwist_test_exact_iff (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) : - ScalarExactAt Q ((E.positiveTwist Q α).testComplex Q α) α l c ↔ - ScalarExactAt Q (E.testComplex Q α) α (l-1) (c+1) := by - have e:=positiveTwist_testShift Q hn E α - rw [← scalarExact_tokenShift_iff Q (E.testComplex Q α) α l c] - constructor - · exact fun h=>scalarExact_transport Q _ _ (e.symm Q) α (fun _=>rfl) h - · exact fun h=>scalarExact_transport Q _ _ e α (fun _=>rfl) h - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TokenShift +import OAI.Topology.ArtinGroups.Complexes.ScalarSupported + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma scalarSupported_tokenShift (E:BasedComplex Q (K:=K) I) (l c:ℤ) (x:I→K) : + ScalarSupported Q (E.tokenShift Q) l c x ↔ ScalarSupported Q E (l-1) (c+1) x := by + constructor <;> intro h i hi <;> apply h i <;> intro hh <;> apply hi + · change (E.placement i).cochain-1+((E.placement i).internal+2)=l ∧ + (E.placement i).cochain-1=c at hh + dsimp only [GeneratorPlacement.level] + omega + · change (E.placement i).cochain-1+((E.placement i).internal+2)=l ∧ + (E.placement i).cochain-1=c + dsimp only [GeneratorPlacement.level] at hh + omega + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma scalarDifferential_tokenShift (E:BasedComplex Q (K:=K) I) (α:V) : + (E.tokenShift Q).differential.map (vertexHom Q α)= + -E.differential.map (vertexHom Q α) := by + apply Matrix.ext + intro i j + exact map_neg (vertexHom Q α) _ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +theorem scalarExact_tokenShift_iff (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) : + ScalarExactAt Q (E.tokenShift Q) α l c ↔ ScalarExactAt Q E α (l-1) (c+1) := by + constructor + · intro h x hx hd + have hxs:ScalarSupported Q (E.tokenShift Q) l c x := + (scalarSupported_tokenShift Q E l c x).mpr hx + have hdx:Matrix.vecMul x ((E.tokenShift Q).differential.map (vertexHom Q α))=0 := by + rw [scalarDifferential_tokenShift,Matrix.vecMul_neg,hd,neg_zero] + obtain ⟨y,hy,hyb⟩:=h x hxs hdx + refine ⟨-y,?_,?_⟩ + · have hh:ScalarSupported Q E (l-1-1) (c-1+1) y := + (scalarSupported_tokenShift Q E (l-1) (c-1) y).mp hy + intro i hi + change -y i=0 + rw [hh i,neg_zero] + simpa only [sub_add_cancel,add_sub_cancel_right] using hi + · rw [scalarDifferential_tokenShift,Matrix.vecMul_neg] at hyb + simpa only [Matrix.neg_vecMul] using hyb + · intro h x hx hd + have hxs:ScalarSupported Q E (l-1) (c+1) x := + (scalarSupported_tokenShift Q E l c x).mp hx + have hdx:Matrix.vecMul x (E.differential.map (vertexHom Q α))=0 := by + rw [scalarDifferential_tokenShift,Matrix.vecMul_neg] at hd + exact neg_eq_zero.mp hd + obtain ⟨y,hy,hyb⟩:=h x hxs hdx + refine ⟨-y,?_,?_⟩ + · apply (scalarSupported_tokenShift Q E (l-1) (c-1) (-y)).mpr + intro i hi + change -y i=0 + rw [hy i,neg_zero] + simpa only [sub_add_cancel,add_sub_cancel_right] using hi + · rw [scalarDifferential_tokenShift,Matrix.vecMul_neg,Matrix.neg_vecMul,neg_neg,hyb] + +theorem positiveTwist_test_exact_iff (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) (α:V) (l c:ℤ) : + ScalarExactAt Q ((E.positiveTwist Q α).testComplex Q α) α l c ↔ + ScalarExactAt Q (E.testComplex Q α) α (l-1) (c+1) := by + have e:=positiveTwist_testShift Q hn E α + rw [← scalarExact_tokenShift_iff Q (E.testComplex Q α) α l c] + constructor + · exact fun h=>scalarExact_transport Q _ _ (e.symm Q) α (fun _=>rfl) h + · exact fun h=>scalarExact_transport Q _ _ e α (fun _=>rfl) h + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/SecondaryLayer.lean b/lean/OAI/Topology/ArtinGroups/Complexes/SecondaryLayer.lean index ff8dc52e92a1d339386ea2a51e5701c24ac9fff1..55bcb4f9a4455506c76190ff4e3839f335ea3ecc 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/SecondaryLayer.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/SecondaryLayer.lean @@ -1,109 +1,109 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.DifferentialMulExtendLayer -import OAI.Topology.ArtinGroups.Complexes.Capped -import OAI.Topology.ArtinGroups.Complexes.MatrixOneMulExtend -import OAI.Topology.ArtinGroups.Quivers.VertexLinear - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J : Type*} [Fintype I] [Fintype J] - -noncomputable def secondaryLayer (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (q d n : ℤ) : - Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K) →ₗ[K] - Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d-1} (Q.Zigzag K) := - (restrictLayer Q E F q (d-1)).comp - ((tokenHomDifferential Q E F n).comp (extendLayer Q E F q d)) - -lemma secondaryLayer_token (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (q d n : ℤ) - (f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)) : - TokenMatrix Q (secondaryLayer Q E F q d n f) := by - intro i j - exact tokenHomDifferential_tokenMatrix Q E F hE hF n (extendLayer Q E F q d f) i.val j.val - -lemma capped_secondaryLayer_extension (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (U : Set V) (q d n : ℤ) (hcap : E.CappedOn Q U q) - {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} - (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) : - extendLayer Q E F q (d-1) (secondaryLayer Q E F q d n f) = - tokenHomDifferential Q E F n (extendLayer Q E F q d f) := by - change extendLayer Q E F q (d-1) - (restrictLayer Q E F q (d-1) - (tokenHomDifferential Q E F n (extendLayer Q E F q d f))) = _ - apply extend_restrictLayer Q E F q (d-1) - intro i j hh - rw [tokenHomDifferential_apply Q E F hE hF, - capped_matrixTwo_mul_extend Q E F U q d hcap hs, zero_sub] - change -(cochainSign (K := K) n • - (extendLayer Q E F q d f * matrixTwo Q F.differential) i j) = 0 - rw [extend_mul_matrixTwo_support Q E F q d f i j hh, smul_zero, neg_zero] - -lemma secondaryLayer_mem_cycles (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (q d n v : ℤ) - {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} - (hf : f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v) : - secondaryLayer Q E F q d n f ∈ - homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := by - have hlinear : linearHomDifferential Q E F n (extendLayer Q E F q d f) = 0 := by - rw [linearHomDifferential_extendLayer Q E F hE hF q d n, - show homDifferential Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n f = 0 from hf.2, - map_zero] - have hcomp : tokenHomDifferential Q E F n (extendLayer Q E F q d f) = - homDifferential Q E F n (extendLayer Q E F q d f) := by - rw [homDifferential_eq_linear_add_token, hlinear, zero_add] - constructor - · change restrictLayer Q E F q (d-1) - (tokenHomDifferential Q E F n (extendLayer Q E F q d f)) ∈ _ - rw [hcomp] - exact restrictLayer_homSpace Q E F hE hF q (d-1) (n+1) v - (homDifferential_mem Q E F n v (extendLayer_homSpace Q E F hE hF q d n v hf.1)) - · change homDifferential Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) - (secondaryLayer Q E F q d n f) = 0 - exact homDifferential_tokenMatrix Q _ _ - (fun i j => (E.pureLayer_linear Q hE q i j).1) - (fun i j => (F.pureLayer_linear Q hF (d-1) i j).1) (n+1) - (secondaryLayer_token Q E F hE hF q d n f) - -lemma capped_secondary_kernel_zero [Fintype V] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (U : Set V) (q d n v : ℤ) - (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) - {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} - (hf : f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v) - (h₀ : CoefficientMatrix Q f) - (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) - (hb : secondaryLayer Q E F q d n f ∈ - homBoundaries Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v) : f = 0 := by - obtain ⟨g, hg, hlin, he⟩ := token_boundary_primitive Q - (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) - (E.pureLayer_linear Q hE q) (F.pureLayer_linear Q hF (d-1)) (n+1) v - (secondaryLayer_token Q E F hE hF q d n f) hb - have hn : n + 1 - 1 = n := by omega - rw [hn] at hg he - have hlinear : linearHomDifferential Q E F n (extendLayer Q E F q d f) = 0 := by - rw [linearHomDifferential_extendLayer Q E F hE hF q d n, - show homDifferential Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n f = 0 from hf.2, - map_zero] - have hfull : homDifferential Q E F n (extendLayer Q E F q d f) = - homDifferential Q E F n (extendLayer Q E F q (d-1) g) := by - rw [homDifferential_eq_linear_add_token Q E F n (extendLayer Q E F q d f), - hlinear, zero_add, homDifferential_extendLayer Q E F hE hF q (d-1) n hlin, he, - capped_secondaryLayer_extension Q E F hE hF U q d n hcap hs] - have hz := coefficient_eq_zero_of_same_differential Q E F hE hF n v hd - (extendLayer_homSpace Q E F hE hF q d n v hf.1) - (extendLayer_homSpace Q E F hE hF q (d-1) n v hg) - (extendLayer_coefficient Q E F q d h₀) (extendLayer_linear Q E F q (d-1) hlin) hfull - have hh := congrArg (restrictLayer Q E F q d) hz - rw [restrictLayer_extend, map_zero] at hh - exact hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.DifferentialMulExtendLayer +import OAI.Topology.ArtinGroups.Complexes.Capped +import OAI.Topology.ArtinGroups.Complexes.MatrixOneMulExtend +import OAI.Topology.ArtinGroups.Quivers.VertexLinear + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J : Type*} [Fintype I] [Fintype J] + +noncomputable def secondaryLayer (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (q d n : ℤ) : + Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K) →ₗ[K] + Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d-1} (Q.Zigzag K) := + (restrictLayer Q E F q (d-1)).comp + ((tokenHomDifferential Q E F n).comp (extendLayer Q E F q d)) + +lemma secondaryLayer_token (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (q d n : ℤ) + (f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)) : + TokenMatrix Q (secondaryLayer Q E F q d n f) := by + intro i j + exact tokenHomDifferential_tokenMatrix Q E F hE hF n (extendLayer Q E F q d f) i.val j.val + +lemma capped_secondaryLayer_extension (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (U : Set V) (q d n : ℤ) (hcap : E.CappedOn Q U q) + {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} + (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) : + extendLayer Q E F q (d-1) (secondaryLayer Q E F q d n f) = + tokenHomDifferential Q E F n (extendLayer Q E F q d f) := by + change extendLayer Q E F q (d-1) + (restrictLayer Q E F q (d-1) + (tokenHomDifferential Q E F n (extendLayer Q E F q d f))) = _ + apply extend_restrictLayer Q E F q (d-1) + intro i j hh + rw [tokenHomDifferential_apply Q E F hE hF, + capped_matrixTwo_mul_extend Q E F U q d hcap hs, zero_sub] + change -(cochainSign (K := K) n • + (extendLayer Q E F q d f * matrixTwo Q F.differential) i j) = 0 + rw [extend_mul_matrixTwo_support Q E F q d f i j hh, smul_zero, neg_zero] + +lemma secondaryLayer_mem_cycles (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (q d n v : ℤ) + {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} + (hf : f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v) : + secondaryLayer Q E F q d n f ∈ + homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := by + have hlinear : linearHomDifferential Q E F n (extendLayer Q E F q d f) = 0 := by + rw [linearHomDifferential_extendLayer Q E F hE hF q d n, + show homDifferential Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n f = 0 from hf.2, + map_zero] + have hcomp : tokenHomDifferential Q E F n (extendLayer Q E F q d f) = + homDifferential Q E F n (extendLayer Q E F q d f) := by + rw [homDifferential_eq_linear_add_token, hlinear, zero_add] + constructor + · change restrictLayer Q E F q (d-1) + (tokenHomDifferential Q E F n (extendLayer Q E F q d f)) ∈ _ + rw [hcomp] + exact restrictLayer_homSpace Q E F hE hF q (d-1) (n+1) v + (homDifferential_mem Q E F n v (extendLayer_homSpace Q E F hE hF q d n v hf.1)) + · change homDifferential Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) + (secondaryLayer Q E F q d n f) = 0 + exact homDifferential_tokenMatrix Q _ _ + (fun i j => (E.pureLayer_linear Q hE q i j).1) + (fun i j => (F.pureLayer_linear Q hF (d-1) i j).1) (n+1) + (secondaryLayer_token Q E F hE hF q d n f) + +lemma capped_secondary_kernel_zero [Fintype V] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (U : Set V) (q d n v : ℤ) + (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) + {f : Matrix {i // (E.placement i).level = q} {j // (F.placement j).level = d} (Q.Zigzag K)} + (hf : f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v) + (h₀ : CoefficientMatrix Q f) + (hs : ∀ i j, (E.placement i.val).color ∉ U → f i j = 0) + (hb : secondaryLayer Q E F q d n f ∈ + homBoundaries Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v) : f = 0 := by + obtain ⟨g, hg, hlin, he⟩ := token_boundary_primitive Q + (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) + (E.pureLayer_linear Q hE q) (F.pureLayer_linear Q hF (d-1)) (n+1) v + (secondaryLayer_token Q E F hE hF q d n f) hb + have hn : n + 1 - 1 = n := by omega + rw [hn] at hg he + have hlinear : linearHomDifferential Q E F n (extendLayer Q E F q d f) = 0 := by + rw [linearHomDifferential_extendLayer Q E F hE hF q d n, + show homDifferential Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n f = 0 from hf.2, + map_zero] + have hfull : homDifferential Q E F n (extendLayer Q E F q d f) = + homDifferential Q E F n (extendLayer Q E F q (d-1) g) := by + rw [homDifferential_eq_linear_add_token Q E F n (extendLayer Q E F q d f), + hlinear, zero_add, homDifferential_extendLayer Q E F hE hF q (d-1) n hlin, he, + capped_secondaryLayer_extension Q E F hE hF U q d n hcap hs] + have hz := coefficient_eq_zero_of_same_differential Q E F hE hF n v hd + (extendLayer_homSpace Q E F hE hF q d n v hf.1) + (extendLayer_homSpace Q E F hE hF q (d-1) n v hg) + (extendLayer_coefficient Q E F q d h₀) (extendLayer_linear Q E F q (d-1) hlin) hfull + have hh := congrArg (restrictLayer Q E F q d) hz + rw [restrictLayer_extend, map_zero] at hh + exact hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Shift.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Shift.lean index c803d3def61798517ccf3745ffd3b4b5aed006e3..b6abda5f11662bfe9022abddedc04f57b8a8bf0d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Shift.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Shift.lean @@ -1,139 +1,139 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection -import OAI.Topology.ArtinGroups.Complexes.HomMono - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -attribute [local instance] Classical.decEq Classical.propDecidable -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] - [DecidableEq I] [DecidableEq J] [DecidableEq L] - -noncomputable def sourceShift (E:BasedComplex Q (K:=K) I) (n v:ℤ) : - BasedComplex Q (K:=K) I where - placement i:=⟨(E.placement i).color,(E.placement i).cochain+n,(E.placement i).internal+v⟩ - differential:=cochainSign (K:=K) n • E.differential - entries:=projectiveEntries_smul Q _ E.entries - degree i j:=by - constructor - · intro h - change cochainSign (K:=K) n • E.differential i j=0 - rw [(E.degree i j).1 (by dsimp only at h; omega),smul_zero] - · change Homogeneous Q (0+((E.placement i).internal+v)-((E.placement j).internal+v)) - (cochainSign (K:=K) n • E.differential i j) - convert homogeneous_smul Q (E.degree i j).2 _ using 1; omega - square_zero:=by - rw [Matrix.smul_mul,Matrix.mul_smul,smul_smul,cochainSign_mul_self,one_smul,E.square_zero] - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma sourceShift_pure (E:BasedComplex Q (K:=K) I) (n v:ℤ) {q:ℤ} - (hE:∀ i,(E.placement i).level=q) : - ∀ i,((sourceShift Q E n v).placement i).level=q+n+v := by - intro i - have hi:=hE i - dsimp [sourceShift,GeneratorPlacement.level] at hi ⊢ - omega - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma sourceShift_cycle (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (n v:ℤ) {f:Matrix I J (Q.Zigzag K)} (hf:f∈homCycles Q E F n v) : - f∈homCycles Q (sourceShift Q E n v) F 0 0 := by - refine ⟨⟨hf.1.1,?_⟩,?_⟩ - · intro i j - constructor - · intro h - exact (hf.1.2 i j).1 (by dsimp [sourceShift] at h; omega) - · change Homogeneous Q (0+((E.placement i).internal+v)-(F.placement j).internal) (f i j) - convert (hf.1.2 i j).2 using 1; omega - · have hh:=congrArg (fun M:Matrix I J (Q.Zigzag K)=>cochainSign (K:=K) n • M) hf.2 - rw [smul_zero] at hh - change cochainSign (K:=K) n • (E.differential*f-cochainSign (K:=K) n • (f*F.differential))=0 at hh - rw [smul_sub,smul_smul,cochainSign_mul_self,one_smul] at hh - change cochainSign (K:=K) n • E.differential*f-cochainSign (K:=K) 0 • (f*F.differential)=0 - simpa only [Matrix.smul_mul,cochainSign_zero,one_smul] using hh - -omit [Fintype V] [DecidableEq A] [DecidableEq J] [DecidableEq L] in -lemma derivedMono_postcompose_injective (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) - {d q n v:ℤ} (hE:∀ i,(E.placement i).level=d) - (hF:∀ j,(F.placement j).level=q) (h:n+v=q-d) (f:Map Q F G) - (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ - HomMonoFrom Q T.complex f) : - Function.Injective (postcomposeOnCycles Q E F G f n v) := by - apply (postcomposeOnCycles Q E F G f n v).ker_eq_bot.mp - apply le_antisymm _ bot_le - intro g hg - have he:∀ i,((sourceShift Q E n v).placement i).level=q := by - intro i - have hh:=sourceShift_pure Q E n v hE i - omega - have hb:=hm (FiniteModel.ofComplex Q (sourceShift Q E n v)) - (classUpperBound_of_representative Q _ (fun i=>(he i).le)) g.val - (sourceShift_cycle Q E F n v g.property) - change g.val*f.matrix∈homBoundaries Q (sourceShift Q E n v) G 0 0 → - g.val∈homBoundaries Q (sourceShift Q E n v) F 0 0 at hb - have hp:g.val*f.matrix=0 := by - have hh:=congrArg Subtype.val hg - exact hh - have hz:=hb (by rw [hp]; exact Submodule.zero_mem _) - rw [pure_coefficient_boundaries_zero Q (sourceShift Q E n v) F he hF (by omega)] at hz - apply Subtype.ext - exact hz - -omit [DecidableEq A] [DecidableEq J] [DecidableEq L] in -lemma derivedMono_coefficient_homDimension_mono (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) - {d q n v:ℤ} (hE:∀ i,(E.placement i).level=d) - (hF:∀ j,(F.placement j).level=q) (hG:∀ j,(G.placement j).level=q) - (h:n+v=q-d) (f:Map Q F G) - (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ - HomMonoFrom Q T.complex f) : - homDimension Q E F n v≤homDimension Q E G n v := by - unfold homDimension - rw [(pureCoefficientCohomology Q E F hE hF h).finrank_eq, - (pureCoefficientCohomology Q E G hE hG h).finrank_eq] - exact LinearMap.finrank_le_finrank_of_injective - (derivedMono_postcompose_injective Q E F G hE hF h f hm) - -omit [DecidableEq A] [DecidableEq J] [DecidableEq L] in -lemma derivedMono_total_coefficient_mono (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) - {d q:ℤ} (hE:∀ i,(E.placement i).level=d) - (hF:∀ j,(F.placement j).level=q) (hG:∀ j,(G.placement j).level=q) - (f:Map Q F G) - (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ - HomMonoFrom Q T.complex f) : - totalHomDimension Q E F (q-d)≤totalHomDimension Q E G (q-d) := by - let D:=homInternalSupport Q E F ∪ homInternalSupport Q E G - rw [totalHomDimension_eq_sum_of_subset Q E F (q-d) D Finset.subset_union_left, - totalHomDimension_eq_sum_of_subset Q E G (q-d) D Finset.subset_union_right] - exact Finset.sum_le_sum fun v _=> - derivedMono_coefficient_homDimension_mono Q E F G hE hF hG (by omega) f hm - -omit [DecidableEq I] [DecidableEq J] in -lemma derivedSubobject_cartan_inequality (M:BasedComplex Q (K:=K) J) - (S:BasedComplex Q (K:=K) I) (Y:BasedComplex Q (K:=K) L) - {q d:ℤ} (hM:∀ i,(M.placement i).level=q) - (hS:∀ i,(S.placement i).level=q) (hY:∀ i,(Y.placement i).level=d) - (f:Map Q S M) - (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ - HomMonoFrom Q T.complex f) - (active:Set V) (hsS:∀ i,(S.placement i).color∈active) - (hsY:∀ α∈active,∀ c,coefficientSocle Q Y α c=⊥) - (hmid:totalHomDimension Q M Y (d-q+1)=0) : - (totalHomDimension Q M Y (d-q):ℝ)≤ - (generatorVector Q M-generatorVector Q S) ⬝ᵥ ((unfoldedCartan Q).mulVec (generatorVector Q Y)) := by - rw [sub_dotProduct,pure_cartan_euler Q M Y hM hY,pure_cartan_euler Q S Y hS hY] - have hz:=pure_total_coefficient_homDimension_zero_of_socle_zero Q S Y hS hY active hsS hsY - have hi:=derivedMono_total_coefficient_mono Q Y S M hY hS hM f hm - have hi':(totalHomDimension Q Y S (q-d):ℝ)≤totalHomDimension Q Y M (q-d):=by exact_mod_cast hi - have hn:(0:ℝ)≤totalHomDimension Q S Y (d-q+1):=Nat.cast_nonneg _ - rw [hmid,hz,Nat.cast_zero] - linarith - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection +import OAI.Topology.ArtinGroups.Complexes.HomMono + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +attribute [local instance] Classical.decEq Classical.propDecidable +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J L:Type u} [Fintype I] [Fintype J] [Fintype L] + [DecidableEq I] [DecidableEq J] [DecidableEq L] + +noncomputable def sourceShift (E:BasedComplex Q (K:=K) I) (n v:ℤ) : + BasedComplex Q (K:=K) I where + placement i:=⟨(E.placement i).color,(E.placement i).cochain+n,(E.placement i).internal+v⟩ + differential:=cochainSign (K:=K) n • E.differential + entries:=projectiveEntries_smul Q _ E.entries + degree i j:=by + constructor + · intro h + change cochainSign (K:=K) n • E.differential i j=0 + rw [(E.degree i j).1 (by dsimp only at h; omega),smul_zero] + · change Homogeneous Q (0+((E.placement i).internal+v)-((E.placement j).internal+v)) + (cochainSign (K:=K) n • E.differential i j) + convert homogeneous_smul Q (E.degree i j).2 _ using 1; omega + square_zero:=by + rw [Matrix.smul_mul,Matrix.mul_smul,smul_smul,cochainSign_mul_self,one_smul,E.square_zero] + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma sourceShift_pure (E:BasedComplex Q (K:=K) I) (n v:ℤ) {q:ℤ} + (hE:∀ i,(E.placement i).level=q) : + ∀ i,((sourceShift Q E n v).placement i).level=q+n+v := by + intro i + have hi:=hE i + dsimp [sourceShift,GeneratorPlacement.level] at hi ⊢ + omega + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma sourceShift_cycle (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (n v:ℤ) {f:Matrix I J (Q.Zigzag K)} (hf:f∈homCycles Q E F n v) : + f∈homCycles Q (sourceShift Q E n v) F 0 0 := by + refine ⟨⟨hf.1.1,?_⟩,?_⟩ + · intro i j + constructor + · intro h + exact (hf.1.2 i j).1 (by dsimp [sourceShift] at h; omega) + · change Homogeneous Q (0+((E.placement i).internal+v)-(F.placement j).internal) (f i j) + convert (hf.1.2 i j).2 using 1; omega + · have hh:=congrArg (fun M:Matrix I J (Q.Zigzag K)=>cochainSign (K:=K) n • M) hf.2 + rw [smul_zero] at hh + change cochainSign (K:=K) n • (E.differential*f-cochainSign (K:=K) n • (f*F.differential))=0 at hh + rw [smul_sub,smul_smul,cochainSign_mul_self,one_smul] at hh + change cochainSign (K:=K) n • E.differential*f-cochainSign (K:=K) 0 • (f*F.differential)=0 + simpa only [Matrix.smul_mul,cochainSign_zero,one_smul] using hh + +omit [Fintype V] [DecidableEq A] [DecidableEq J] [DecidableEq L] in +lemma derivedMono_postcompose_injective (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) + {d q n v:ℤ} (hE:∀ i,(E.placement i).level=d) + (hF:∀ j,(F.placement j).level=q) (h:n+v=q-d) (f:Map Q F G) + (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ + HomMonoFrom Q T.complex f) : + Function.Injective (postcomposeOnCycles Q E F G f n v) := by + apply (postcomposeOnCycles Q E F G f n v).ker_eq_bot.mp + apply le_antisymm _ bot_le + intro g hg + have he:∀ i,((sourceShift Q E n v).placement i).level=q := by + intro i + have hh:=sourceShift_pure Q E n v hE i + omega + have hb:=hm (FiniteModel.ofComplex Q (sourceShift Q E n v)) + (classUpperBound_of_representative Q _ (fun i=>(he i).le)) g.val + (sourceShift_cycle Q E F n v g.property) + change g.val*f.matrix∈homBoundaries Q (sourceShift Q E n v) G 0 0 → + g.val∈homBoundaries Q (sourceShift Q E n v) F 0 0 at hb + have hp:g.val*f.matrix=0 := by + have hh:=congrArg Subtype.val hg + exact hh + have hz:=hb (by rw [hp]; exact Submodule.zero_mem _) + rw [pure_coefficient_boundaries_zero Q (sourceShift Q E n v) F he hF (by omega)] at hz + apply Subtype.ext + exact hz + +omit [DecidableEq A] [DecidableEq J] [DecidableEq L] in +lemma derivedMono_coefficient_homDimension_mono (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) + {d q n v:ℤ} (hE:∀ i,(E.placement i).level=d) + (hF:∀ j,(F.placement j).level=q) (hG:∀ j,(G.placement j).level=q) + (h:n+v=q-d) (f:Map Q F G) + (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ + HomMonoFrom Q T.complex f) : + homDimension Q E F n v≤homDimension Q E G n v := by + unfold homDimension + rw [(pureCoefficientCohomology Q E F hE hF h).finrank_eq, + (pureCoefficientCohomology Q E G hE hG h).finrank_eq] + exact LinearMap.finrank_le_finrank_of_injective + (derivedMono_postcompose_injective Q E F G hE hF h f hm) + +omit [DecidableEq A] [DecidableEq J] [DecidableEq L] in +lemma derivedMono_total_coefficient_mono (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (G:BasedComplex Q (K:=K) L) + {d q:ℤ} (hE:∀ i,(E.placement i).level=d) + (hF:∀ j,(F.placement j).level=q) (hG:∀ j,(G.placement j).level=q) + (f:Map Q F G) + (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ + HomMonoFrom Q T.complex f) : + totalHomDimension Q E F (q-d)≤totalHomDimension Q E G (q-d) := by + let D:=homInternalSupport Q E F ∪ homInternalSupport Q E G + rw [totalHomDimension_eq_sum_of_subset Q E F (q-d) D Finset.subset_union_left, + totalHomDimension_eq_sum_of_subset Q E G (q-d) D Finset.subset_union_right] + exact Finset.sum_le_sum fun v _=> + derivedMono_coefficient_homDimension_mono Q E F G hE hF hG (by omega) f hm + +omit [DecidableEq I] [DecidableEq J] in +lemma derivedSubobject_cartan_inequality (M:BasedComplex Q (K:=K) J) + (S:BasedComplex Q (K:=K) I) (Y:BasedComplex Q (K:=K) L) + {q d:ℤ} (hM:∀ i,(M.placement i).level=q) + (hS:∀ i,(S.placement i).level=q) (hY:∀ i,(Y.placement i).level=d) + (f:Map Q S M) + (hm:∀ T:FiniteModel.{u} Q (K:=K),ClassUpperBound Q q (classOfComplex Q T.complex)→ + HomMonoFrom Q T.complex f) + (active:Set V) (hsS:∀ i,(S.placement i).color∈active) + (hsY:∀ α∈active,∀ c,coefficientSocle Q Y α c=⊥) + (hmid:totalHomDimension Q M Y (d-q+1)=0) : + (totalHomDimension Q M Y (d-q):ℝ)≤ + (generatorVector Q M-generatorVector Q S) ⬝ᵥ ((unfoldedCartan Q).mulVec (generatorVector Q Y)) := by + rw [sub_dotProduct,pure_cartan_euler Q M Y hM hY,pure_cartan_euler Q S Y hS hY] + have hz:=pure_total_coefficient_homDimension_zero_of_socle_zero Q S Y hS hY active hsS hsY + have hi:=derivedMono_total_coefficient_mono Q Y S M hY hS hM f hm + have hi':(totalHomDimension Q Y S (q-d):ℝ)≤totalHomDimension Q Y M (q-d):=by exact_mod_cast hi + have hn:(0:ℝ)≤totalHomDimension Q S Y (d-q+1):=Nat.cast_nonneg _ + rw [hmid,hz,Nat.cast_zero] + linarith + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/SubobjectMiddleLowerBound.lean b/lean/OAI/Topology/ArtinGroups/Complexes/SubobjectMiddleLowerBound.lean index d52559919a1ca52b1787ae0dfe0d81d07e0e8fff..a8e9dcc18b72938eb2a92f3882378dd9eed3a48d 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/SubobjectMiddleLowerBound.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/SubobjectMiddleLowerBound.lean @@ -1,67 +1,67 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -open Matrix - -variable {V A I J T K:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [Fintype T] [DecidableEq I] [DecidableEq J] [DecidableEq T] - -omit [DecidableEq J] [DecidableEq T] in -lemma subobject_middle_lower_bound (M:BasedComplex Q (K:=K) J) - (S:BasedComplex Q (K:=K) I) (Y:BasedComplex Q (K:=K) T) - {q d:ℤ} (hM:∀i,(M.placement i).level=q) - (hS:∀i,(S.placement i).level=q) (hY:∀i,(Y.placement i).level=d) - (ι:TermwiseSplitInjection Q S M) (active:Set V) - (hsS:∀i,(S.placement i).color∈active) - (hsY:∀α∈active,∀c,coefficientSocle Q Y α c=⊥) : - generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec - (generatorVector Q S-generatorVector Q M)) ≤ - (totalHomDimension Q Y M (q-d+1):ℝ) := by - rw [mulVec_sub,dotProduct_sub,pure_cartan_euler Q Y S hY hS, - pure_cartan_euler Q Y M hY hM] - have hz:=pure_total_coefficient_homDimension_zero_of_socle_zero Q S Y hS hY active hsS hsY - have hm:=pure_total_coefficient_homDimension_mono Q Y S M hY hS hM ι - have hm':(totalHomDimension Q Y S (q-d):ℝ)≤totalHomDimension Q Y M (q-d):=by - exact_mod_cast hm - have hn:(0:ℝ)≤totalHomDimension Q Y S (q-d+1):=Nat.cast_nonneg _ - have hp:(0:ℝ)≤totalHomDimension Q M Y (d-q):=Nat.cast_nonneg _ - rw [hz,Nat.cast_zero] - linarith - -omit [DecidableEq J] [DecidableEq T] in -lemma convex_subobject_middle_lower_bound {B:Type*} - (M:BasedComplex Q (K:=K) J) (Y:BasedComplex Q (K:=K) T) - {q d:ℤ} (hM:∀i,(M.placement i).level=q) (hY:∀i,(Y.placement i).level=d) - (F: B→FiniteModel Q (K:=K)) - (hF:∀b i,((F b).complex.placement i).level=q) - (ι:∀b,TermwiseSplitInjection Q (F b).complex M) (active:Set V) - (hsF:∀b i,((F b).complex.placement i).color∈active) - (hsY:∀α∈active,∀c,coefficientSocle Q Y α c=⊥) - (e:V→ℝ) (he:e∈convexHull ℝ (Set.range fun b=>generatorVector Q (F b).complex)) : - generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec (e-generatorVector Q M)) ≤ - (totalHomDimension Q Y M (q-d+1):ℝ) := by - let L:(V→ℝ)→ₗ[ℝ]ℝ := - { toFun:=fun x=>generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec x) - map_add':=fun x y=>by simp only [mulVec_add,dotProduct_add] - map_smul':=fun r x=>by simp only [mulVec_smul,dotProduct_smul,smul_eq_mul,RingHom.id_apply] } - let c:ℝ:=(totalHomDimension Q Y M (q-d+1):ℝ)+L (generatorVector Q M) - have h: Set.range (fun b=>generatorVector Q (F b).complex) ⊆ L ⁻¹' Set.Iic c := by - rintro x ⟨b,rfl⟩ - have hh:=subobject_middle_lower_bound Q M (F b).complex Y hM (hF b) hY - (ι b) active (hsF b) hsY - change L (generatorVector Q (F b).complex)≤c - dsimp only [L,c,LinearMap.coe_mk,AddHom.coe_mk] - simpa only [mulVec_sub,dotProduct_sub,sub_le_iff_le_add] using hh - have hh:=convexHull_min h ((convex_Iic c).linear_preimage L) he - change L e≤c at hh - change L (e-generatorVector Q M)≤_ - rw [map_sub] - exact sub_le_iff_le_add.mpr hh - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.TermwiseSplitInjection + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +open Matrix + +variable {V A I J T K:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [Fintype T] [DecidableEq I] [DecidableEq J] [DecidableEq T] + +omit [DecidableEq J] [DecidableEq T] in +lemma subobject_middle_lower_bound (M:BasedComplex Q (K:=K) J) + (S:BasedComplex Q (K:=K) I) (Y:BasedComplex Q (K:=K) T) + {q d:ℤ} (hM:∀i,(M.placement i).level=q) + (hS:∀i,(S.placement i).level=q) (hY:∀i,(Y.placement i).level=d) + (ι:TermwiseSplitInjection Q S M) (active:Set V) + (hsS:∀i,(S.placement i).color∈active) + (hsY:∀α∈active,∀c,coefficientSocle Q Y α c=⊥) : + generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec + (generatorVector Q S-generatorVector Q M)) ≤ + (totalHomDimension Q Y M (q-d+1):ℝ) := by + rw [mulVec_sub,dotProduct_sub,pure_cartan_euler Q Y S hY hS, + pure_cartan_euler Q Y M hY hM] + have hz:=pure_total_coefficient_homDimension_zero_of_socle_zero Q S Y hS hY active hsS hsY + have hm:=pure_total_coefficient_homDimension_mono Q Y S M hY hS hM ι + have hm':(totalHomDimension Q Y S (q-d):ℝ)≤totalHomDimension Q Y M (q-d):=by + exact_mod_cast hm + have hn:(0:ℝ)≤totalHomDimension Q Y S (q-d+1):=Nat.cast_nonneg _ + have hp:(0:ℝ)≤totalHomDimension Q M Y (d-q):=Nat.cast_nonneg _ + rw [hz,Nat.cast_zero] + linarith + +omit [DecidableEq J] [DecidableEq T] in +lemma convex_subobject_middle_lower_bound {B:Type*} + (M:BasedComplex Q (K:=K) J) (Y:BasedComplex Q (K:=K) T) + {q d:ℤ} (hM:∀i,(M.placement i).level=q) (hY:∀i,(Y.placement i).level=d) + (F: B→FiniteModel Q (K:=K)) + (hF:∀b i,((F b).complex.placement i).level=q) + (ι:∀b,TermwiseSplitInjection Q (F b).complex M) (active:Set V) + (hsF:∀b i,((F b).complex.placement i).color∈active) + (hsY:∀α∈active,∀c,coefficientSocle Q Y α c=⊥) + (e:V→ℝ) (he:e∈convexHull ℝ (Set.range fun b=>generatorVector Q (F b).complex)) : + generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec (e-generatorVector Q M)) ≤ + (totalHomDimension Q Y M (q-d+1):ℝ) := by + let L:(V→ℝ)→ₗ[ℝ]ℝ := + { toFun:=fun x=>generatorVector Q Y ⬝ᵥ ((unfoldedCartan Q).mulVec x) + map_add':=fun x y=>by simp only [mulVec_add,dotProduct_add] + map_smul':=fun r x=>by simp only [mulVec_smul,dotProduct_smul,smul_eq_mul,RingHom.id_apply] } + let c:ℝ:=(totalHomDimension Q Y M (q-d+1):ℝ)+L (generatorVector Q M) + have h: Set.range (fun b=>generatorVector Q (F b).complex) ⊆ L ⁻¹' Set.Iic c := by + rintro x ⟨b,rfl⟩ + have hh:=subobject_middle_lower_bound Q M (F b).complex Y hM (hF b) hY + (ι b) active (hsF b) hsY + change L (generatorVector Q (F b).complex)≤c + dsimp only [L,c,LinearMap.coe_mk,AddHom.coe_mk] + simpa only [mulVec_sub,dotProduct_sub,sub_le_iff_le_add] using hh + have hh:=convexHull_min h ((convex_Iic c).linear_preimage L) he + change L e≤c at hh + change L (e-generatorVector Q M)≤_ + rw [map_sub] + exact sub_le_iff_le_add.mpr hh + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Subrepresentation.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Subrepresentation.lean index 30c4b2e40537b6e6a401f87d024d7a2bc96a2431..7ef7bfb103f173f50f4ab89359c1223202ca8139 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Subrepresentation.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Subrepresentation.lean @@ -1,96 +1,96 @@ -import Mathlib - -namespace OAI - -namespace HarmonicArtin.CoefficientArrays - -variable {K I E : Type*} [Field K] [Fintype I] - {V : I → Type*} [∀ i, AddCommGroup (V i)] [∀ i, Module K (V i)] - -def IsSubrepresentation (d : ∀ i j : I, E → (V i →ₗ[K] V j)) - (U : ∀ i, Submodule K (V i)) : Prop := - ∀ i j e, ∀ x ∈ U i, d i j e x ∈ U j - -def socle (d : ∀ i j : I, E → (V i →ₗ[K] V j)) (i : I) : Submodule K (V i) := - ⨅ j : I, ⨅ e : E, LinearMap.ker (d i j e) - -omit [Fintype I] in -@[simp] theorem mem_socle (d : ∀ i j : I, E → (V i →ₗ[K] V j)) (i : I) (x : V i) : - x ∈ socle d i ↔ ∀ j e, d i j e x = 0 := by - simp [socle] - -theorem exists_nonzero_socle - (degree : I → ℤ) (d : ∀ i j : I, E → (V i →ₗ[K] V j)) - (hd : ∀ i j e, degree j ≤ degree i → d i j e = 0) - (U : ∀ i, Submodule K (V i)) (hU : IsSubrepresentation d U) - (hne : ∃ i, U i ≠ ⊥) : - ∃ i, ∃ x : V i, x ∈ U i ∧ x ≠ 0 ∧ x ∈ socle d i := by - classical - let support : Finset I := Finset.univ.filter (fun i => U i ≠ ⊥) - have hs : support.Nonempty := by - obtain ⟨i, hi⟩ := hne - exact ⟨i, by simp [support, hi]⟩ - obtain ⟨i, hi, hmax⟩ := Finset.exists_max_image support degree hs - have hUi : U i ≠ ⊥ := (Finset.mem_filter.mp hi).2 - obtain ⟨x, hx, hx0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hUi - refine ⟨i, x, hx, hx0, (mem_socle d i x).mpr ?_⟩ - intro j e - by_cases hj : U j = ⊥ - · have hxj := hU i j e x hx - simpa [hj] using hxj - · have hjmem : j ∈ support := by simp [support, hj] - have hdeg : degree j ≤ degree i := hmax j hjmem - rw [hd i j e hdeg] - rfl - -theorem subrepresentation_eq_bot_of_socle_eq_bot - (degree : I → ℤ) (d : ∀ i j : I, E → (V i →ₗ[K] V j)) - (hd : ∀ i j e, degree j ≤ degree i → d i j e = 0) - (active : Set I) (hsoc : ∀ i ∈ active, socle d i = ⊥) - (U : ∀ i, Submodule K (V i)) (hU : IsSubrepresentation d U) - (hsupp : ∀ i, i ∉ active → U i = ⊥) : ∀ i, U i = ⊥ := by - by_contra h - push Not at h - obtain ⟨i, x, hxU, hx0, hxsoc⟩ := exists_nonzero_socle degree d hd U hU h - have hi : i ∈ active := by - by_contra hi - have : x = 0 := by simpa [hsupp i hi] using hxU - exact hx0 this - have : x = 0 := by simpa [hsoc i hi] using hxsoc - exact hx0 this - -section Morphisms - -variable {W : I → Type*} [∀ i, AddCommGroup (W i)] [∀ i, Module K (W i)] - -omit [Fintype I] in - -theorem range_isSubrepresentation - (dV : ∀ i j : I, E → (V i →ₗ[K] V j)) - (dW : ∀ i j : I, E → (W i →ₗ[K] W j)) - (f : ∀ i, V i →ₗ[K] W i) - (hf : ∀ i j e, (f j).comp (dV i j e) = (dW i j e).comp (f i)) : - IsSubrepresentation dW (fun i => LinearMap.range (f i)) := by - rintro i j e _ ⟨x, rfl⟩ - refine ⟨dV i j e x, ?_⟩ - exact LinearMap.congr_fun (hf i j e) x - -theorem map_eq_zero_of_socle_eq_bot - (degree : I → ℤ) - (dV : ∀ i j : I, E → (V i →ₗ[K] V j)) - (dW : ∀ i j : I, E → (W i →ₗ[K] W j)) - (hd : ∀ i j e, degree j ≤ degree i → dW i j e = 0) - (f : ∀ i, V i →ₗ[K] W i) - (hf : ∀ i j e, (f j).comp (dV i j e) = (dW i j e).comp (f i)) - (active : Set I) (hsoc : ∀ i ∈ active, socle dW i = ⊥) - (hsupp : ∀ i, i ∉ active → f i = 0) : ∀ i, f i = 0 := by - have hz := subrepresentation_eq_bot_of_socle_eq_bot degree dW hd active hsoc - (fun i => LinearMap.range (f i)) (range_isSubrepresentation dV dW f hf) - (fun i hi => by simp [hsupp i hi]) - intro i - exact LinearMap.range_eq_bot.mp (hz i) - -end Morphisms -end HarmonicArtin.CoefficientArrays - -end OAI +import Mathlib + +namespace OAI + +namespace HarmonicArtin.CoefficientArrays + +variable {K I E : Type*} [Field K] [Fintype I] + {V : I → Type*} [∀ i, AddCommGroup (V i)] [∀ i, Module K (V i)] + +def IsSubrepresentation (d : ∀ i j : I, E → (V i →ₗ[K] V j)) + (U : ∀ i, Submodule K (V i)) : Prop := + ∀ i j e, ∀ x ∈ U i, d i j e x ∈ U j + +def socle (d : ∀ i j : I, E → (V i →ₗ[K] V j)) (i : I) : Submodule K (V i) := + ⨅ j : I, ⨅ e : E, LinearMap.ker (d i j e) + +omit [Fintype I] in +@[simp] theorem mem_socle (d : ∀ i j : I, E → (V i →ₗ[K] V j)) (i : I) (x : V i) : + x ∈ socle d i ↔ ∀ j e, d i j e x = 0 := by + simp [socle] + +theorem exists_nonzero_socle + (degree : I → ℤ) (d : ∀ i j : I, E → (V i →ₗ[K] V j)) + (hd : ∀ i j e, degree j ≤ degree i → d i j e = 0) + (U : ∀ i, Submodule K (V i)) (hU : IsSubrepresentation d U) + (hne : ∃ i, U i ≠ ⊥) : + ∃ i, ∃ x : V i, x ∈ U i ∧ x ≠ 0 ∧ x ∈ socle d i := by + classical + let support : Finset I := Finset.univ.filter (fun i => U i ≠ ⊥) + have hs : support.Nonempty := by + obtain ⟨i, hi⟩ := hne + exact ⟨i, by simp [support, hi]⟩ + obtain ⟨i, hi, hmax⟩ := Finset.exists_max_image support degree hs + have hUi : U i ≠ ⊥ := (Finset.mem_filter.mp hi).2 + obtain ⟨x, hx, hx0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hUi + refine ⟨i, x, hx, hx0, (mem_socle d i x).mpr ?_⟩ + intro j e + by_cases hj : U j = ⊥ + · have hxj := hU i j e x hx + simpa [hj] using hxj + · have hjmem : j ∈ support := by simp [support, hj] + have hdeg : degree j ≤ degree i := hmax j hjmem + rw [hd i j e hdeg] + rfl + +theorem subrepresentation_eq_bot_of_socle_eq_bot + (degree : I → ℤ) (d : ∀ i j : I, E → (V i →ₗ[K] V j)) + (hd : ∀ i j e, degree j ≤ degree i → d i j e = 0) + (active : Set I) (hsoc : ∀ i ∈ active, socle d i = ⊥) + (U : ∀ i, Submodule K (V i)) (hU : IsSubrepresentation d U) + (hsupp : ∀ i, i ∉ active → U i = ⊥) : ∀ i, U i = ⊥ := by + by_contra h + push Not at h + obtain ⟨i, x, hxU, hx0, hxsoc⟩ := exists_nonzero_socle degree d hd U hU h + have hi : i ∈ active := by + by_contra hi + have : x = 0 := by simpa [hsupp i hi] using hxU + exact hx0 this + have : x = 0 := by simpa [hsoc i hi] using hxsoc + exact hx0 this + +section Morphisms + +variable {W : I → Type*} [∀ i, AddCommGroup (W i)] [∀ i, Module K (W i)] + +omit [Fintype I] in + +theorem range_isSubrepresentation + (dV : ∀ i j : I, E → (V i →ₗ[K] V j)) + (dW : ∀ i j : I, E → (W i →ₗ[K] W j)) + (f : ∀ i, V i →ₗ[K] W i) + (hf : ∀ i j e, (f j).comp (dV i j e) = (dW i j e).comp (f i)) : + IsSubrepresentation dW (fun i => LinearMap.range (f i)) := by + rintro i j e _ ⟨x, rfl⟩ + refine ⟨dV i j e x, ?_⟩ + exact LinearMap.congr_fun (hf i j e) x + +theorem map_eq_zero_of_socle_eq_bot + (degree : I → ℤ) + (dV : ∀ i j : I, E → (V i →ₗ[K] V j)) + (dW : ∀ i j : I, E → (W i →ₗ[K] W j)) + (hd : ∀ i j e, degree j ≤ degree i → dW i j e = 0) + (f : ∀ i, V i →ₗ[K] W i) + (hf : ∀ i j e, (f j).comp (dV i j e) = (dW i j e).comp (f i)) + (active : Set I) (hsoc : ∀ i ∈ active, socle dW i = ⊥) + (hsupp : ∀ i, i ∉ active → f i = 0) : ∀ i, f i = 0 := by + have hz := subrepresentation_eq_bot_of_socle_eq_bot degree dW hd active hsoc + (fun i => LinearMap.range (f i)) (range_isSubrepresentation dV dW f hf) + (fun i hi => by simp [hsupp i hi]) + intro i + exact LinearMap.range_eq_bot.mp (hz i) + +end Morphisms +end HarmonicArtin.CoefficientArrays + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Sum.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Sum.lean index 041c2a46069db21254cdac5ef836b68909acb61a..659a3d64d1756ac8758e124672cc40258ed39560 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Sum.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Sum.lean @@ -1,61 +1,61 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex -import OAI.Topology.ArtinGroups.Complexes.FiniteSum2 - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I : Type u} [Fintype I] [DecidableEq I] - -noncomputable def classSum (x : I → FiniteHomotopyClass Q (K := K)) : - FiniteHomotopyClass Q (K := K) := by - classical - exact classOfComplex Q (finiteSum Q (fun i => (x i).out.complex)) - -omit [Fintype V] [DecidableEq A] in -lemma classSum_mk (E : I → FiniteModel.{u} Q (K := K)) : - classSum Q (fun i => Quotient.mk (finiteHomotopySetoid Q) (E i)) = - classOfComplex Q (finiteSum Q (fun i => (E i).complex)) := by - classical - apply classOfComplex_eq - apply HomotopyEquivalence.finiteSum - intro i - exact Classical.choice (Quotient.exact (Quotient.out_eq - (Quotient.mk (finiteHomotopySetoid Q) (E i)))) - -omit [Fintype V] [DecidableEq A] in -lemma classSum_complex {T : I → Type u} [∀ i, Fintype (T i)] [∀ i, DecidableEq (T i)] - (E : (i:I) → BasedComplex Q (K := K) (T i)) : - classSum Q (fun i => classOfComplex Q (E i)) = classOfComplex Q (finiteSum Q E) := - classSum_mk Q (fun i => FiniteModel.ofComplex Q (E i)) - -lemma classPositiveTwist_sum (α : V) (x : I → FiniteHomotopyClass Q (K := K)) : - classPositiveTwist Q α (classSum Q x) = - classSum Q (fun i => classPositiveTwist Q α (x i)) := by - classical - have hx : x = fun i => Quotient.mk (finiteHomotopySetoid Q) (x i).out := by - funext i; exact (Quotient.out_eq (x i)).symm - conv_rhs => rw [hx] - change _ = classSum Q (fun i => classOfComplex Q ((x i).out.complex.positiveTwist Q α)) - rw [classSum_complex] - change classOfComplex Q ((finiteSum Q (fun i => (x i).out.complex)).positiveTwist Q α) = _ - exact (classOfComplex_reindex Q _ (sumTwistEquiv Q (fun i => (x i).out.complex) α)).trans - (congrArg (classOfComplex Q) (sumTwist_eq Q (fun i => (x i).out.complex) α)) - -lemma classNegativeTwist_sum (hn : ∀ a, Q.source a ≠ Q.target a) (α : V) - (x : I → FiniteHomotopyClass Q (K := K)) : - classNegativeTwist Q α (classSum Q x) = - classSum Q (fun i => classNegativeTwist Q α (x i)) := by - apply (classTwistPerm Q hn α).injective - change (classTwistPerm Q hn α) ((classTwistPerm Q hn α).symm (classSum Q x)) = _ - rw [(classTwistPerm Q hn α).apply_symm_apply] - change _ = classPositiveTwist Q α (classSum Q (fun i => (classTwistPerm Q hn α).symm (x i))) - rw [classPositiveTwist_sum] - simp only [show classPositiveTwist Q α = classTwistPerm Q hn α from rfl,Equiv.apply_symm_apply] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.BasedComplexComplex +import OAI.Topology.ArtinGroups.Complexes.FiniteSum2 + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A : Type u} {K : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I : Type u} [Fintype I] [DecidableEq I] + +noncomputable def classSum (x : I → FiniteHomotopyClass Q (K := K)) : + FiniteHomotopyClass Q (K := K) := by + classical + exact classOfComplex Q (finiteSum Q (fun i => (x i).out.complex)) + +omit [Fintype V] [DecidableEq A] in +lemma classSum_mk (E : I → FiniteModel.{u} Q (K := K)) : + classSum Q (fun i => Quotient.mk (finiteHomotopySetoid Q) (E i)) = + classOfComplex Q (finiteSum Q (fun i => (E i).complex)) := by + classical + apply classOfComplex_eq + apply HomotopyEquivalence.finiteSum + intro i + exact Classical.choice (Quotient.exact (Quotient.out_eq + (Quotient.mk (finiteHomotopySetoid Q) (E i)))) + +omit [Fintype V] [DecidableEq A] in +lemma classSum_complex {T : I → Type u} [∀ i, Fintype (T i)] [∀ i, DecidableEq (T i)] + (E : (i:I) → BasedComplex Q (K := K) (T i)) : + classSum Q (fun i => classOfComplex Q (E i)) = classOfComplex Q (finiteSum Q E) := + classSum_mk Q (fun i => FiniteModel.ofComplex Q (E i)) + +lemma classPositiveTwist_sum (α : V) (x : I → FiniteHomotopyClass Q (K := K)) : + classPositiveTwist Q α (classSum Q x) = + classSum Q (fun i => classPositiveTwist Q α (x i)) := by + classical + have hx : x = fun i => Quotient.mk (finiteHomotopySetoid Q) (x i).out := by + funext i; exact (Quotient.out_eq (x i)).symm + conv_rhs => rw [hx] + change _ = classSum Q (fun i => classOfComplex Q ((x i).out.complex.positiveTwist Q α)) + rw [classSum_complex] + change classOfComplex Q ((finiteSum Q (fun i => (x i).out.complex)).positiveTwist Q α) = _ + exact (classOfComplex_reindex Q _ (sumTwistEquiv Q (fun i => (x i).out.complex) α)).trans + (congrArg (classOfComplex Q) (sumTwist_eq Q (fun i => (x i).out.complex) α)) + +lemma classNegativeTwist_sum (hn : ∀ a, Q.source a ≠ Q.target a) (α : V) + (x : I → FiniteHomotopyClass Q (K := K)) : + classNegativeTwist Q α (classSum Q x) = + classSum Q (fun i => classNegativeTwist Q α (x i)) := by + apply (classTwistPerm Q hn α).injective + change (classTwistPerm Q hn α) ((classTwistPerm Q hn α).symm (classSum Q x)) = _ + rw [(classTwistPerm Q hn α).apply_symm_apply] + change _ = classPositiveTwist Q α (classSum Q (fun i => (classTwistPerm Q hn α).symm (x i))) + rw [classPositiveTwist_sum] + simp only [show classPositiveTwist Q α = classTwistPerm Q hn α from rfl,Equiv.apply_symm_apply] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/SumTestEquiv.lean b/lean/OAI/Topology/ArtinGroups/Complexes/SumTestEquiv.lean index a475b7171881f5f0a721882ff1477be5c5fe99b0..ec205a5e7d61f4476be4a6a529fc3410d3d0c2b6 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/SumTestEquiv.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/SumTestEquiv.lean @@ -1,130 +1,130 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices -import OAI.Topology.ArtinGroups.Complexes.FiniteSum -import OAI.Topology.ArtinGroups.Complexes.Refl -import OAI.Topology.ArtinGroups.Quivers.UnitTestVector -import OAI.Topology.ArtinGroups.Quivers.TokenTestVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - {T : I → Type*} [∀ i, Fintype (T i)] [∀ i, DecidableEq (T i)] - -omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in -lemma finiteSum_minimal (E : (i:I) → BasedComplex Q (K := K) (T i)) - (hE : ∀ i, (E i).IsMinimal Q) : (finiteSum Q E).IsMinimal Q := by - rintro ⟨i,x⟩ ⟨j,y⟩ - change (Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x⟩ ⟨j,y⟩).vertex=0 - by_cases h : i=j - · subst j; rw [Matrix.blockDiagonal'_apply_eq]; exact hE i x y - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h]; rfl - -def sumTestEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) (α : V) : - (Σ i, TestIndex Q (E i).placement α) ≃ TestIndex Q (finiteSum Q E).placement α where - toFun x := ⟨⟨x.1,x.2.1⟩,x.2.2⟩ - invFun x := ⟨x.1.1,x.1.2,x.2⟩ - left_inv _ := rfl - right_inv _ := rfl - -omit [DecidableEq A] [∀ i, DecidableEq (T i)] in -lemma sumTest_differential (E : (i:I) → BasedComplex Q (K := K) (T i)) (α : V) : - (testMatrix Q (finiteSum Q E).placement (finiteSum Q E).placement α (finiteSum Q E).differential).submatrix - (sumTestEquiv Q E α) (sumTestEquiv Q E α) = - Matrix.blockDiagonal' (fun i => testMatrix Q (E i).placement (E i).placement α (E i).differential) := by - apply Matrix.ext - rintro ⟨i,x,p⟩ ⟨j,y,q⟩ - by_cases h : i=j - · subst j - change pathCoordinates Q (pathBasis Q p.val * Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x⟩ ⟨i,y⟩) q.val = _ - rw [Matrix.blockDiagonal'_apply_eq,Matrix.blockDiagonal'_apply_eq] - rfl - · change pathCoordinates Q (pathBasis Q p.val * Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x⟩ ⟨j,y⟩) q.val = _ - rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,Matrix.blockDiagonal'_apply_ne _ _ _ h, - MulZeroClass.mul_zero,coordinates_zero] - -noncomputable def finiteSumSocleTestEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) - (α : V) (c : ℤ) : - socleTestCycles Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → socleTestCycles Q (E i) α c) := by - let e := ScalarCycles.reindexEquiv - (testMatrix Q (finiteSum Q E).placement (finiteSum Q E).placement α (finiteSum Q E).differential) - (fun x => ((finiteSum Q E).placement x.1).cochain=c ∧ Path.length x.2.val=0) - (sumTestEquiv Q E α) - rw [sumTest_differential] at e - exact e.trans (ScalarCycles.blockEquiv - (fun i => testMatrix Q (E i).placement (E i).placement α (E i).differential) - (fun i x => ((E i).placement x.1).cochain=c ∧ Path.length x.2.val=0)) - -noncomputable def finiteSumTopTestEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) - (α : V) (c : ℤ) : - topTestCycles Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → topTestCycles Q (E i) α c) := by - let e := ScalarCycles.reindexEquiv - (testMatrix Q (finiteSum Q E).placement (finiteSum Q E).placement α (finiteSum Q E).differential).transpose - (fun x => ((finiteSum Q E).placement x.1).cochain=c ∧ Path.length x.2.val=2) - (sumTestEquiv Q E α) - have ht : (Matrix.blockDiagonal' (fun i => - testMatrix Q (E i).placement (E i).placement α (E i).differential)).transpose = - Matrix.blockDiagonal' (fun i => (testMatrix Q (E i).placement (E i).placement α (E i).differential).transpose) := by - apply Matrix.ext - rintro ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j; simp only [Matrix.transpose_apply,Matrix.blockDiagonal'_apply_eq] - · simp only [Matrix.transpose_apply,Matrix.blockDiagonal'_apply_ne _ _ _ h, - Matrix.blockDiagonal'_apply_ne _ _ _ (Ne.symm h)] - rw [← Matrix.transpose_submatrix,sumTest_differential,ht] at e - exact e.trans (ScalarCycles.blockEquiv - (fun i => (testMatrix Q (E i).placement (E i).placement α (E i).differential).transpose) - (fun i x => ((E i).placement x.1).cochain=c ∧ Path.length x.2.val=2)) - -noncomputable def coefficientSocleSumEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) - {l:ℤ} (hE : ∀ i x, ((E i).placement x).level=l) (α : V) (c : ℤ) : - coefficientSocle Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → coefficientSocle Q (E i) α c) := - ((coefficientSocleTestEquiv Q (finiteSum Q E) (fun x => hE x.1 x.2) α c).trans - (finiteSumSocleTestEquiv Q E α c)).trans - (LinearEquiv.piCongrRight (fun i => (coefficientSocleTestEquiv Q (E i) (hE i) α c).symm)) - -noncomputable def coefficientTopSumEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) - {l:ℤ} (hE : ∀ i x, ((E i).placement x).level=l) (α : V) (c : ℤ) : - coefficientTopDual Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → coefficientTopDual Q (E i) α c) := - ((coefficientTopTestEquiv Q (finiteSum Q E) (fun x => hE x.1 x.2) α c).trans - (finiteSumTopTestEquiv Q E α c)).trans - (LinearEquiv.piCongrRight (fun i => (coefficientTopTestEquiv Q (E i) (hE i) α c).symm)) - -def sumLayerEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) (d : ℤ) : - (Σ i, {x // ((E i).placement x).level=d}) ≃ - {x : Sigma T // ((finiteSum Q E).placement x).level=d} where - toFun x := ⟨⟨x.1,x.2.val⟩,x.2.property⟩ - invFun x := ⟨x.1.1,x.1.2,x.2⟩ - left_inv _ := rfl - right_inv _ := rfl - -omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in -lemma sumLayer_eq (E : (i:I) → BasedComplex Q (K := K) (T i)) - (hE : ∀ i, (E i).IsMinimal Q) (d : ℤ) : - ((finiteSum Q E).pureLayer Q (finiteSum_minimal Q E hE) d).reindex Q (sumLayerEquiv Q E d) = - finiteSum Q (fun i => (E i).pureLayer Q (hE i) d) := by - apply ext_placement_differential Q - · rfl - · apply Matrix.ext - rintro ⟨i,x⟩ ⟨j,y⟩ - change Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x.val⟩ ⟨j,y.val⟩ = - Matrix.blockDiagonal' (fun i => ((E i).pureLayer Q (hE i) d).differential) ⟨i,x⟩ ⟨j,y⟩ - by_cases h : i=j - · subst j; simp only [Matrix.blockDiagonal'_apply_eq]; rfl - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,Matrix.blockDiagonal'_apply_ne _ _ _ h] - -noncomputable def sumLayerComparison (E : (i:I) → BasedComplex Q (K := K) (T i)) - (hE : ∀ i, (E i).IsMinimal Q) (d : ℤ) : - ChainIsomorphism Q ((finiteSum Q E).pureLayer Q (finiteSum_minimal Q E hE) d) - (finiteSum Q (fun i => (E i).pureLayer Q (hE i) d)) := by - have e := reindexChainIsomorphism Q - ((finiteSum Q E).pureLayer Q (finiteSum_minimal Q E hE) d) (sumLayerEquiv Q E d) - rw [sumLayer_eq] at e - exact e - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices +import OAI.Topology.ArtinGroups.Complexes.FiniteSum +import OAI.Topology.ArtinGroups.Complexes.Refl +import OAI.Topology.ArtinGroups.Quivers.UnitTestVector +import OAI.Topology.ArtinGroups.Quivers.TokenTestVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + {T : I → Type*} [∀ i, Fintype (T i)] [∀ i, DecidableEq (T i)] + +omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in +lemma finiteSum_minimal (E : (i:I) → BasedComplex Q (K := K) (T i)) + (hE : ∀ i, (E i).IsMinimal Q) : (finiteSum Q E).IsMinimal Q := by + rintro ⟨i,x⟩ ⟨j,y⟩ + change (Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x⟩ ⟨j,y⟩).vertex=0 + by_cases h : i=j + · subst j; rw [Matrix.blockDiagonal'_apply_eq]; exact hE i x y + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h]; rfl + +def sumTestEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) (α : V) : + (Σ i, TestIndex Q (E i).placement α) ≃ TestIndex Q (finiteSum Q E).placement α where + toFun x := ⟨⟨x.1,x.2.1⟩,x.2.2⟩ + invFun x := ⟨x.1.1,x.1.2,x.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +omit [DecidableEq A] [∀ i, DecidableEq (T i)] in +lemma sumTest_differential (E : (i:I) → BasedComplex Q (K := K) (T i)) (α : V) : + (testMatrix Q (finiteSum Q E).placement (finiteSum Q E).placement α (finiteSum Q E).differential).submatrix + (sumTestEquiv Q E α) (sumTestEquiv Q E α) = + Matrix.blockDiagonal' (fun i => testMatrix Q (E i).placement (E i).placement α (E i).differential) := by + apply Matrix.ext + rintro ⟨i,x,p⟩ ⟨j,y,q⟩ + by_cases h : i=j + · subst j + change pathCoordinates Q (pathBasis Q p.val * Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x⟩ ⟨i,y⟩) q.val = _ + rw [Matrix.blockDiagonal'_apply_eq,Matrix.blockDiagonal'_apply_eq] + rfl + · change pathCoordinates Q (pathBasis Q p.val * Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x⟩ ⟨j,y⟩) q.val = _ + rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,Matrix.blockDiagonal'_apply_ne _ _ _ h, + MulZeroClass.mul_zero,coordinates_zero] + +noncomputable def finiteSumSocleTestEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) + (α : V) (c : ℤ) : + socleTestCycles Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → socleTestCycles Q (E i) α c) := by + let e := ScalarCycles.reindexEquiv + (testMatrix Q (finiteSum Q E).placement (finiteSum Q E).placement α (finiteSum Q E).differential) + (fun x => ((finiteSum Q E).placement x.1).cochain=c ∧ Path.length x.2.val=0) + (sumTestEquiv Q E α) + rw [sumTest_differential] at e + exact e.trans (ScalarCycles.blockEquiv + (fun i => testMatrix Q (E i).placement (E i).placement α (E i).differential) + (fun i x => ((E i).placement x.1).cochain=c ∧ Path.length x.2.val=0)) + +noncomputable def finiteSumTopTestEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) + (α : V) (c : ℤ) : + topTestCycles Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → topTestCycles Q (E i) α c) := by + let e := ScalarCycles.reindexEquiv + (testMatrix Q (finiteSum Q E).placement (finiteSum Q E).placement α (finiteSum Q E).differential).transpose + (fun x => ((finiteSum Q E).placement x.1).cochain=c ∧ Path.length x.2.val=2) + (sumTestEquiv Q E α) + have ht : (Matrix.blockDiagonal' (fun i => + testMatrix Q (E i).placement (E i).placement α (E i).differential)).transpose = + Matrix.blockDiagonal' (fun i => (testMatrix Q (E i).placement (E i).placement α (E i).differential).transpose) := by + apply Matrix.ext + rintro ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j; simp only [Matrix.transpose_apply,Matrix.blockDiagonal'_apply_eq] + · simp only [Matrix.transpose_apply,Matrix.blockDiagonal'_apply_ne _ _ _ h, + Matrix.blockDiagonal'_apply_ne _ _ _ (Ne.symm h)] + rw [← Matrix.transpose_submatrix,sumTest_differential,ht] at e + exact e.trans (ScalarCycles.blockEquiv + (fun i => (testMatrix Q (E i).placement (E i).placement α (E i).differential).transpose) + (fun i x => ((E i).placement x.1).cochain=c ∧ Path.length x.2.val=2)) + +noncomputable def coefficientSocleSumEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) + {l:ℤ} (hE : ∀ i x, ((E i).placement x).level=l) (α : V) (c : ℤ) : + coefficientSocle Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → coefficientSocle Q (E i) α c) := + ((coefficientSocleTestEquiv Q (finiteSum Q E) (fun x => hE x.1 x.2) α c).trans + (finiteSumSocleTestEquiv Q E α c)).trans + (LinearEquiv.piCongrRight (fun i => (coefficientSocleTestEquiv Q (E i) (hE i) α c).symm)) + +noncomputable def coefficientTopSumEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) + {l:ℤ} (hE : ∀ i x, ((E i).placement x).level=l) (α : V) (c : ℤ) : + coefficientTopDual Q (finiteSum Q E) α c ≃ₗ[K] ((i:I) → coefficientTopDual Q (E i) α c) := + ((coefficientTopTestEquiv Q (finiteSum Q E) (fun x => hE x.1 x.2) α c).trans + (finiteSumTopTestEquiv Q E α c)).trans + (LinearEquiv.piCongrRight (fun i => (coefficientTopTestEquiv Q (E i) (hE i) α c).symm)) + +def sumLayerEquiv (E : (i:I) → BasedComplex Q (K := K) (T i)) (d : ℤ) : + (Σ i, {x // ((E i).placement x).level=d}) ≃ + {x : Sigma T // ((finiteSum Q E).placement x).level=d} where + toFun x := ⟨⟨x.1,x.2.val⟩,x.2.property⟩ + invFun x := ⟨x.1.1,x.1.2,x.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in +lemma sumLayer_eq (E : (i:I) → BasedComplex Q (K := K) (T i)) + (hE : ∀ i, (E i).IsMinimal Q) (d : ℤ) : + ((finiteSum Q E).pureLayer Q (finiteSum_minimal Q E hE) d).reindex Q (sumLayerEquiv Q E d) = + finiteSum Q (fun i => (E i).pureLayer Q (hE i) d) := by + apply ext_placement_differential Q + · rfl + · apply Matrix.ext + rintro ⟨i,x⟩ ⟨j,y⟩ + change Matrix.blockDiagonal' (fun i => (E i).differential) ⟨i,x.val⟩ ⟨j,y.val⟩ = + Matrix.blockDiagonal' (fun i => ((E i).pureLayer Q (hE i) d).differential) ⟨i,x⟩ ⟨j,y⟩ + by_cases h : i=j + · subst j; simp only [Matrix.blockDiagonal'_apply_eq]; rfl + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,Matrix.blockDiagonal'_apply_ne _ _ _ h] + +noncomputable def sumLayerComparison (E : (i:I) → BasedComplex Q (K := K) (T i)) + (hE : ∀ i, (E i).IsMinimal Q) (d : ℤ) : + ChainIsomorphism Q ((finiteSum Q E).pureLayer Q (finiteSum_minimal Q E hE) d) + (finiteSum Q (fun i => (E i).pureLayer Q (hE i) d)) := by + have e := reindexChainIsomorphism Q + ((finiteSum Q E).pureLayer Q (finiteSum_minimal Q E hE) d) (sumLayerEquiv Q E d) + rw [sumLayer_eq] at e + exact e + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/SumTruncationEquiv.lean b/lean/OAI/Topology/ArtinGroups/Complexes/SumTruncationEquiv.lean index d2ce64dd2e72ae9477e32a396b98d9802781ec3d..89e425bbab07ae67dfaea89fbe08c13ad5bcbe15 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/SumTruncationEquiv.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/SumTruncationEquiv.lean @@ -1,39 +1,39 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.SumTestEquiv -import OAI.Topology.ArtinGroups.Complexes.DownClosed - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - {T : I → Type*} [∀ i, Fintype (T i)] [∀ i, DecidableEq (T i)] -attribute [local instance] Classical.decEq Classical.propDecidable - -def sumTruncationEquiv (E : (i:I) → BasedComplex Q (K:=K) (T i)) (d:ℤ) : - (Σ i,lowerLevelSet Q (E i) d) ≃ lowerLevelSet Q (finiteSum Q E) d where - toFun x:=⟨⟨x.1,x.2.val⟩,x.2.property⟩ - invFun x:=⟨x.1.1,x.1.2,x.2⟩ - left_inv _:=rfl - right_inv _:=rfl - -omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in -lemma sumTruncation_eq (E : (i:I) → BasedComplex Q (K:=K) (T i)) - (hE:∀ i,(E i).IsMinimal Q) (d:ℤ) : - (lowerTruncation Q (finiteSum Q E) (finiteSum_minimal Q E hE) d).reindex Q - (sumTruncationEquiv Q E d)=finiteSum Q (fun i=>lowerTruncation Q (E i) (hE i) d) := by - apply ext_placement_differential Q - · rfl - · apply Matrix.ext - rintro ⟨i,x⟩ ⟨j,y⟩ - change Matrix.blockDiagonal' (fun i=>(E i).differential) ⟨i,x.val⟩ ⟨j,y.val⟩= - Matrix.blockDiagonal' (fun i=>(lowerTruncation Q (E i) (hE i) d).differential) ⟨i,x⟩ ⟨j,y⟩ - by_cases h:i=j - · subst j; simp only [Matrix.blockDiagonal'_apply_eq]; rfl - · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,Matrix.blockDiagonal'_apply_ne _ _ _ h] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.SumTestEquiv +import OAI.Topology.ArtinGroups.Complexes.DownClosed + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + {T : I → Type*} [∀ i, Fintype (T i)] [∀ i, DecidableEq (T i)] +attribute [local instance] Classical.decEq Classical.propDecidable + +def sumTruncationEquiv (E : (i:I) → BasedComplex Q (K:=K) (T i)) (d:ℤ) : + (Σ i,lowerLevelSet Q (E i) d) ≃ lowerLevelSet Q (finiteSum Q E) d where + toFun x:=⟨⟨x.1,x.2.val⟩,x.2.property⟩ + invFun x:=⟨x.1.1,x.1.2,x.2⟩ + left_inv _:=rfl + right_inv _:=rfl + +omit [Fintype V] [DecidableEq A] [∀ i, DecidableEq (T i)] in +lemma sumTruncation_eq (E : (i:I) → BasedComplex Q (K:=K) (T i)) + (hE:∀ i,(E i).IsMinimal Q) (d:ℤ) : + (lowerTruncation Q (finiteSum Q E) (finiteSum_minimal Q E hE) d).reindex Q + (sumTruncationEquiv Q E d)=finiteSum Q (fun i=>lowerTruncation Q (E i) (hE i) d) := by + apply ext_placement_differential Q + · rfl + · apply Matrix.ext + rintro ⟨i,x⟩ ⟨j,y⟩ + change Matrix.blockDiagonal' (fun i=>(E i).differential) ⟨i,x.val⟩ ⟨j,y.val⟩= + Matrix.blockDiagonal' (fun i=>(lowerTruncation Q (E i) (hE i) d).differential) ⟨i,x⟩ ⟨j,y⟩ + by_cases h:i=j + · subst j; simp only [Matrix.blockDiagonal'_apply_eq]; rfl + · rw [Matrix.blockDiagonal'_apply_ne _ _ _ h,Matrix.blockDiagonal'_apply_ne _ _ _ h] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/SummandSecondary.lean b/lean/OAI/Topology/ArtinGroups/Complexes/SummandSecondary.lean index 7d6276513a26b625798fc3b53c89d90bd4aeb89e..b9595df5af4e326c0706fe89e0f94cfc2d411c5b 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/SummandSecondary.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/SummandSecondary.lean @@ -1,81 +1,81 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.RestrictExtendLayerMul -import OAI.Topology.ArtinGroups.Complexes.LeftMatrix - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J T : Type*} [Fintype I] [Fintype J] [Fintype T] - -noncomputable def summandSecondary (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) - (M : BasedComplex Q (K := K) T) (q d n : ℤ) - (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) : - Matrix T {j // (F.placement j).level = d} (Q.Zigzag K) →ₗ[K] - Matrix T {j // (F.placement j).level = d-1} (Q.Zigzag K) := - (leftMatrix Q ι.matrix).comp - ((secondaryLayer Q E F q d n).comp (leftMatrix Q π.matrix)) - -lemma summandSecondary_cycles (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (M : BasedComplex Q (K := K) T) (q d n v : ℤ) - (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) - {f : Matrix T {j // (F.placement j).level = d} (Q.Zigzag K)} - (hf : f ∈ homCycles Q M (F.pureLayer Q hF d) n v) : - summandSecondary Q E F hE M q d n ι π f ∈ - homCycles Q M (F.pureLayer Q hF (d-1)) (n+1) v := by - have hp : π.matrix * f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v := by - simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q π) hf - change (show Matrix T {i // (E.placement i).level = q} (Q.Zigzag K) from ι.matrix) * - secondaryLayer Q E F q d n (π.matrix * f) ∈ _ - simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q ι) - (secondaryLayer_mem_cycles Q E F hE hF q d n v hp) - -lemma summandSecondary_kernel_zero [Fintype V] [DecidableEq T] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) - (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) - (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) - (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) - (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) - (hdeg : n+v = d-q) - {f : Matrix T {j // (F.placement j).level = d} (Q.Zigzag K)} - (hf : f ∈ homCycles Q M (F.pureLayer Q hF d) n v) - (hb : summandSecondary Q E F hE M q d n ι π f ∈ - homBoundaries Q M (F.pureLayer Q hF (d-1)) (n+1) v) : f = 0 := by - have hp : π.matrix * f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v := by - simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q π) hf - have hs : ∀ i j, (E.placement i.val).color ∉ U → (π.matrix * f) i j = 0 := by - intro i j hi - exact pureMap_mul_support Q π q (fun i => i.property) hM U hU f i j hi - have he : π.matrix * summandSecondary Q E F hE M q d n ι π f = - secondaryLayer Q E F q d n (π.matrix * f) := by - change π.matrix * ((show Matrix T {i // (E.placement i).level = q} (Q.Zigzag K) from ι.matrix) * - secondaryLayer Q E F q d n (π.matrix * f)) = _ - rw [secondaryLayer_eq_target Q E F hE hF U q d n hcap hs] - have hr : π.matrix * ι.matrix * π.matrix = π.matrix := by - rw [Matrix.mul_assoc, hret] - exact mul_projectiveIdentity Q π.entries - calc - _ = -(cochainSign (K := K) n • ((π.matrix * ι.matrix * π.matrix) * f * - restrictLayer Q F F d (d-1) (matrixTwo Q F.differential))) := by - simp only [Matrix.mul_neg, Matrix.mul_smul, Matrix.mul_assoc] - _ = _ := by rw [hr] - have hb' : secondaryLayer Q E F q d n (π.matrix * f) ∈ - homBoundaries Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := by - rw [← he] - simpa only [zero_add] using homCycle_mul_boundary Q (map_mem_homCycles Q π) hb - have hz : π.matrix * f = 0 := capped_secondary_kernel_zero Q E F hE hF U q d n v hcap hd hp - (pure_homSpace_coefficient Q _ _ (fun i => i.property) (fun j => j.property) hdeg hp.1) hs hb' - calc - f = ι.matrix * (π.matrix * f) := by - rw [← Matrix.mul_assoc, hret] - exact (projectiveIdentity_mul Q hf.1.1).symm - _ = 0 := by rw [hz, Matrix.mul_zero] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.RestrictExtendLayerMul +import OAI.Topology.ArtinGroups.Complexes.LeftMatrix + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J T : Type*} [Fintype I] [Fintype J] [Fintype T] + +noncomputable def summandSecondary (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) + (M : BasedComplex Q (K := K) T) (q d n : ℤ) + (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) : + Matrix T {j // (F.placement j).level = d} (Q.Zigzag K) →ₗ[K] + Matrix T {j // (F.placement j).level = d-1} (Q.Zigzag K) := + (leftMatrix Q ι.matrix).comp + ((secondaryLayer Q E F q d n).comp (leftMatrix Q π.matrix)) + +lemma summandSecondary_cycles (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (M : BasedComplex Q (K := K) T) (q d n v : ℤ) + (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) + {f : Matrix T {j // (F.placement j).level = d} (Q.Zigzag K)} + (hf : f ∈ homCycles Q M (F.pureLayer Q hF d) n v) : + summandSecondary Q E F hE M q d n ι π f ∈ + homCycles Q M (F.pureLayer Q hF (d-1)) (n+1) v := by + have hp : π.matrix * f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v := by + simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q π) hf + change (show Matrix T {i // (E.placement i).level = q} (Q.Zigzag K) from ι.matrix) * + secondaryLayer Q E F q d n (π.matrix * f) ∈ _ + simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q ι) + (secondaryLayer_mem_cycles Q E F hE hF q d n v hp) + +lemma summandSecondary_kernel_zero [Fintype V] [DecidableEq T] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (M : BasedComplex Q (K := K) T) (U : Set V) (q d n v : ℤ) + (hM : ∀ i, (M.placement i).level = q) (hU : ∀ i, (M.placement i).color ∈ U) + (ι : Map Q M (E.pureLayer Q hE q)) (π : Map Q (E.pureLayer Q hE q) M) + (hret : ι.matrix * π.matrix = projectiveIdentity Q M.placement) + (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) + (hdeg : n+v = d-q) + {f : Matrix T {j // (F.placement j).level = d} (Q.Zigzag K)} + (hf : f ∈ homCycles Q M (F.pureLayer Q hF d) n v) + (hb : summandSecondary Q E F hE M q d n ι π f ∈ + homBoundaries Q M (F.pureLayer Q hF (d-1)) (n+1) v) : f = 0 := by + have hp : π.matrix * f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v := by + simpa only [zero_add] using homCycles_mul Q (map_mem_homCycles Q π) hf + have hs : ∀ i j, (E.placement i.val).color ∉ U → (π.matrix * f) i j = 0 := by + intro i j hi + exact pureMap_mul_support Q π q (fun i => i.property) hM U hU f i j hi + have he : π.matrix * summandSecondary Q E F hE M q d n ι π f = + secondaryLayer Q E F q d n (π.matrix * f) := by + change π.matrix * ((show Matrix T {i // (E.placement i).level = q} (Q.Zigzag K) from ι.matrix) * + secondaryLayer Q E F q d n (π.matrix * f)) = _ + rw [secondaryLayer_eq_target Q E F hE hF U q d n hcap hs] + have hr : π.matrix * ι.matrix * π.matrix = π.matrix := by + rw [Matrix.mul_assoc, hret] + exact mul_projectiveIdentity Q π.entries + calc + _ = -(cochainSign (K := K) n • ((π.matrix * ι.matrix * π.matrix) * f * + restrictLayer Q F F d (d-1) (matrixTwo Q F.differential))) := by + simp only [Matrix.mul_neg, Matrix.mul_smul, Matrix.mul_assoc] + _ = _ := by rw [hr] + have hb' : secondaryLayer Q E F q d n (π.matrix * f) ∈ + homBoundaries Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := by + rw [← he] + simpa only [zero_add] using homCycle_mul_boundary Q (map_mem_homCycles Q π) hb + have hz : π.matrix * f = 0 := capped_secondary_kernel_zero Q E F hE hF U q d n v hcap hd hp + (pure_homSpace_coefficient Q _ _ (fun i => i.property) (fun j => j.property) hdeg hp.1) hs hb' + calc + f = ι.matrix * (π.matrix * f) := by + rw [← Matrix.mul_assoc, hret] + exact (projectiveIdentity_mul Q hf.1.1).symm + _ = 0 := by rw [hz, Matrix.mul_zero] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/SupportedCoefficientCycles.lean b/lean/OAI/Topology/ArtinGroups/Complexes/SupportedCoefficientCycles.lean index 4ec93d020d1cc2718e37e156642ef6081ede89ba..e2fbc9dc8941108c62cefbf6a0eb1ffd010d38b9 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/SupportedCoefficientCycles.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/SupportedCoefficientCycles.lean @@ -1,87 +1,87 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.SecondaryLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype A] [DecidableEq V] -variable {I J : Type*} [Fintype I] [Fintype J] - -noncomputable def supportedCoefficientCycles (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (U : Set V) (q d n v : ℤ) : - Submodule K (Matrix {i // (E.placement i).level = q} - {j // (F.placement j).level = d} (Q.Zigzag K)) where - carrier := {f | f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v ∧ - CoefficientMatrix Q f ∧ ∀ i j, (E.placement i.val).color ∉ U → f i j = 0} - zero_mem' := ⟨Submodule.zero_mem _, fun _ _ => ⟨rfl, rfl⟩, fun _ _ _ => rfl⟩ - add_mem' := by - intro f g hf hg - refine ⟨Submodule.add_mem _ hf.1 hg.1, ?_, ?_⟩ - · intro i j - constructor - · change (f i j).arrow + (g i j).arrow = 0 - rw [(hf.2.1 i j).1, (hg.2.1 i j).1, add_zero] - · change (f i j).token + (g i j).token = 0 - rw [(hf.2.1 i j).2, (hg.2.1 i j).2, add_zero] - · intro i j h - change f i j + g i j = 0 - rw [hf.2.2 i j h, hg.2.2 i j h, add_zero] - smul_mem' := by - intro r f hf - refine ⟨Submodule.smul_mem _ r hf.1, ?_, ?_⟩ - · intro i j - constructor - · change r • (f i j).arrow = 0 - rw [(hf.2.1 i j).1, smul_zero] - · change r • (f i j).token = 0 - rw [(hf.2.1 i j).2, smul_zero] - · intro i j h - change r • f i j = 0 - rw [hf.2.2 i j h, smul_zero] - -noncomputable def secondaryOnCycles (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (U : Set V) (q d n v : ℤ) : - supportedCoefficientCycles Q E F hE hF U q d n v →ₗ[K] - homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := - (secondaryLayer Q E F q d n).restrict fun _ hf => - secondaryLayer_mem_cycles Q E F hE hF q d n v hf.1 - -noncomputable def secondaryOnCohomology (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) - (U : Set V) (q d n v : ℤ) : - supportedCoefficientCycles Q E F hE hF U q d n v →ₗ[K] - homCohomology Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := - ((homBoundaries Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v).comap - (homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v).subtype).mkQ.comp - (secondaryOnCycles Q E F hE hF U q d n v) - -lemma secondaryOnCohomology_injective [Fintype V] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (U : Set V) (q d n v : ℤ) - (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) : - Function.Injective (secondaryOnCohomology Q E F hE hF U q d n v) := by - apply (LinearMap.ker_eq_bot).mp - apply le_antisymm _ bot_le - intro f hf - change Submodule.Quotient.mk (secondaryOnCycles Q E F hE hF U q d n v f) = 0 at hf - have hb := (Submodule.Quotient.mk_eq_zero _).mp hf - change f = 0 - apply Subtype.ext - exact capped_secondary_kernel_zero Q E F hE hF U q d n v hcap hd - f.property.1 f.property.2.1 f.property.2.2 hb - -lemma supportedCoefficient_finrank_le [Fintype V] [DecidableEq A] - (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) - (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (U : Set V) (q d n v : ℤ) - (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) : - Module.finrank K (supportedCoefficientCycles Q E F hE hF U q d n v) ≤ - homDimension Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := - LinearMap.finrank_le_finrank_of_injective - (secondaryOnCohomology_injective Q E F hE hF U q d n v hcap hd) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.SecondaryLayer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype A] [DecidableEq V] +variable {I J : Type*} [Fintype I] [Fintype J] + +noncomputable def supportedCoefficientCycles (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (U : Set V) (q d n v : ℤ) : + Submodule K (Matrix {i // (E.placement i).level = q} + {j // (F.placement j).level = d} (Q.Zigzag K)) where + carrier := {f | f ∈ homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF d) n v ∧ + CoefficientMatrix Q f ∧ ∀ i j, (E.placement i.val).color ∉ U → f i j = 0} + zero_mem' := ⟨Submodule.zero_mem _, fun _ _ => ⟨rfl, rfl⟩, fun _ _ _ => rfl⟩ + add_mem' := by + intro f g hf hg + refine ⟨Submodule.add_mem _ hf.1 hg.1, ?_, ?_⟩ + · intro i j + constructor + · change (f i j).arrow + (g i j).arrow = 0 + rw [(hf.2.1 i j).1, (hg.2.1 i j).1, add_zero] + · change (f i j).token + (g i j).token = 0 + rw [(hf.2.1 i j).2, (hg.2.1 i j).2, add_zero] + · intro i j h + change f i j + g i j = 0 + rw [hf.2.2 i j h, hg.2.2 i j h, add_zero] + smul_mem' := by + intro r f hf + refine ⟨Submodule.smul_mem _ r hf.1, ?_, ?_⟩ + · intro i j + constructor + · change r • (f i j).arrow = 0 + rw [(hf.2.1 i j).1, smul_zero] + · change r • (f i j).token = 0 + rw [(hf.2.1 i j).2, smul_zero] + · intro i j h + change r • f i j = 0 + rw [hf.2.2 i j h, smul_zero] + +noncomputable def secondaryOnCycles (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (U : Set V) (q d n v : ℤ) : + supportedCoefficientCycles Q E F hE hF U q d n v →ₗ[K] + homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := + (secondaryLayer Q E F q d n).restrict fun _ hf => + secondaryLayer_mem_cycles Q E F hE hF q d n v hf.1 + +noncomputable def secondaryOnCohomology (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) + (U : Set V) (q d n v : ℤ) : + supportedCoefficientCycles Q E F hE hF U q d n v →ₗ[K] + homCohomology Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := + ((homBoundaries Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v).comap + (homCycles Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v).subtype).mkQ.comp + (secondaryOnCycles Q E F hE hF U q d n v) + +lemma secondaryOnCohomology_injective [Fintype V] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (U : Set V) (q d n v : ℤ) + (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) : + Function.Injective (secondaryOnCohomology Q E F hE hF U q d n v) := by + apply (LinearMap.ker_eq_bot).mp + apply le_antisymm _ bot_le + intro f hf + change Submodule.Quotient.mk (secondaryOnCycles Q E F hE hF U q d n v f) = 0 at hf + have hb := (Submodule.Quotient.mk_eq_zero _).mp hf + change f = 0 + apply Subtype.ext + exact capped_secondary_kernel_zero Q E F hE hF U q d n v hcap hd + f.property.1 f.property.2.1 f.property.2.2 hb + +lemma supportedCoefficient_finrank_le [Fintype V] [DecidableEq A] + (E : BasedComplex Q (K := K) I) (F : BasedComplex Q (K := K) J) + (hE : E.IsMinimal Q) (hF : F.IsMinimal Q) (U : Set V) (q d n v : ℤ) + (hcap : E.CappedOn Q U q) (hd : homDimension Q E F n v = 0) : + Module.finrank K (supportedCoefficientCycles Q E F hE hF U q d n v) ≤ + homDimension Q (E.pureLayer Q hE q) (F.pureLayer Q hF (d-1)) (n+1) v := + LinearMap.finrank_le_finrank_of_injective + (secondaryOnCohomology_injective Q E F hE hF U q d n v hcap hd) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/TargetLow.lean b/lean/OAI/Topology/ArtinGroups/Complexes/TargetLow.lean index 6e2d8ef9b04faab2d4ddb600aba5e1700c776952..ac87f3f0ce08645586fbd73e816329cbdf726bf3 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/TargetLow.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/TargetLow.lean @@ -1,109 +1,109 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomDimensionZeroCycles -import OAI.Topology.ArtinGroups.Complexes.LowerTruncation - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] -attribute [local instance] Classical.decEq -attribute [local instance] Classical.propDecidable - -noncomputable def targetLow (_E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (d:ℤ) : - Matrix I J (Q.Zigzag K)→ₗ[K] Matrix I (lowerLevelSet Q F d) (Q.Zigzag K) where - toFun M i j:=M i j - map_add' _ _:=rfl - map_smul' _ _:=rfl - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma targetLow_inclusion (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (hF:F.IsMinimal Q) (d:ℤ) (f:Matrix I (lowerLevelSet Q F d) (Q.Zigzag K)) - (hf:ProjectiveEntries Q E.placement (lowerTruncation Q F hF d).placement f) : - targetLow Q E F d (f*blockInclusion Q F (lowerLevelSet Q F d))=f := by - apply Matrix.ext - intro i j - change (∑ k:lowerLevelSet Q F d,f i k* - (if (k:J)=(j:J) then vertexId Q (K:=K) (F.placement k).color else 0))=f i j - simp only [Subtype.val_inj,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] - exact hf.2 i j - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma targetLow_homSpace (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (hF:F.IsMinimal Q) (d n v:ℤ) {g:Matrix I J (Q.Zigzag K)} - (hg:g∈homSpace Q E F n v) : - targetLow Q E F d g∈homSpace Q E (lowerTruncation Q F hF d) n v := - ⟨⟨fun i j=>hg.1.1 i j,fun i j=>hg.1.2 i j⟩,fun i j=>hg.2 i j⟩ - -omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in -lemma targetLow_differential (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (hF:F.IsMinimal Q) (d n:ℤ) (g:Matrix I J (Q.Zigzag K)) - (hg:∀ i j,j∉lowerLevelSet Q F d → g i j=0) : - targetLow Q E F d (homDifferential Q E F n g)= - homDifferential Q E (lowerTruncation Q F hF d) n (targetLow Q E F d g) := by - have hmul:targetLow Q E F d (g*F.differential)= - targetLow Q E F d g*(lowerTruncation Q F hF d).differential := by - apply Matrix.ext - intro i j - change (∑ k:J,g i k*F.differential k j)= - ∑ k:lowerLevelSet Q F d,g i k*F.differential k j - symm - apply Fintype.sum_of_injective (Subtype.val:lowerLevelSet Q F d→J) Subtype.val_injective - · intro k hk - have hn:k∉lowerLevelSet Q F d:=fun hh=>hk ⟨⟨k,hh⟩,rfl⟩ - rw [hg i k hn,zero_mul] - · intro k; rfl - change targetLow Q E F d (E.differential*g-cochainSign (K:=K) n • (g*F.differential))=_ - rw [map_sub,map_smul,hmul] - rfl - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -theorem low_boundary_of_inclusion_boundary (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (hF:F.IsMinimal Q) (d:ℤ) - (hE:∀ i,(E.placement i).level≤d+1) - {f:Matrix I (lowerLevelSet Q F d) (Q.Zigzag K)} - (hf:ProjectiveEntries Q E.placement (lowerTruncation Q F hF d).placement f) - (hb:f*blockInclusion Q F (lowerLevelSet Q F d)∈homBoundaries Q E F 0 0) : - f∈homBoundaries Q E (lowerTruncation Q F hF d) 0 0 := by - obtain ⟨g,hg,he⟩:=hb - have hs:∀ i j,j∉lowerLevelSet Q F d → g i j=0 := by - intro i j hj - by_contra hn - have hh:=mapDegree_level_bound Q hg.2 hn - have hhE:=hE i - exact hj (by change (F.placement j).level≤d; omega) - refine ⟨targetLow Q E F d g,targetLow_homSpace Q E F hF d _ _ hg,?_⟩ - have h:=congrArg (targetLow Q E F d) he - rw [targetLow_differential Q E F hF d _ _ hs,targetLow_inclusion Q E F hF d f hf] at h - exact h - -omit [DecidableEq A] [DecidableEq I] in -lemma lowerTruncation_homDimension_zero (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (hF:F.IsMinimal Q) (d:ℤ) - (hE:∀ i,(E.placement i).level≤d+1) (hz:homDimension Q E F 0 0=0) : - homDimension Q E (lowerTruncation Q F hF d) 0 0=0 := by - apply homDimension_zero_of_cycles_boundary Q - intro f hf - apply low_boundary_of_inclusion_boundary Q E F hF d hE hf.1.1 - apply boundary_of_homDimension_zero Q E F 0 0 hz - simpa only [add_zero,lowInclusion] using homCycles_mul Q hf - (map_mem_homCycles Q (lowInclusion Q F (lowerLevelSet Q F d) (levelDownClosed Q F hF d))) - -omit [DecidableEq A] in -lemma classLowerTruncation_homDimension_zero (x y:FiniteHomotopyClass Q (K:=K)) - (d:ℤ) (hx:ClassUpperBound Q (d+1) x) (hz:classHomDimension Q 0 0 x y=0) : - classHomDimension Q 0 0 x (classLowerTruncation Q d y)=0 := by - let E:=minimalClassModel Q x - let F:=minimalClassModel Q y - have hx':classOfComplex Q E.complex=x:=minimalClassModel_class Q x - rw [← hx'] - change homDimension Q E.complex (lowerTruncation Q F.complex (minimalClassModel_minimal Q y) d) 0 0=0 - apply lowerTruncation_homDimension_zero Q E.complex F.complex (minimalClassModel_minimal Q y) d hx - rw [minimalClassModel_homDimension] - exact hz - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomDimensionZeroCycles +import OAI.Topology.ArtinGroups.Complexes.LowerTruncation + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + {I J:Type u} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] +attribute [local instance] Classical.decEq +attribute [local instance] Classical.propDecidable + +noncomputable def targetLow (_E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) (d:ℤ) : + Matrix I J (Q.Zigzag K)→ₗ[K] Matrix I (lowerLevelSet Q F d) (Q.Zigzag K) where + toFun M i j:=M i j + map_add' _ _:=rfl + map_smul' _ _:=rfl + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma targetLow_inclusion (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (hF:F.IsMinimal Q) (d:ℤ) (f:Matrix I (lowerLevelSet Q F d) (Q.Zigzag K)) + (hf:ProjectiveEntries Q E.placement (lowerTruncation Q F hF d).placement f) : + targetLow Q E F d (f*blockInclusion Q F (lowerLevelSet Q F d))=f := by + apply Matrix.ext + intro i j + change (∑ k:lowerLevelSet Q F d,f i k* + (if (k:J)=(j:J) then vertexId Q (K:=K) (F.placement k).color else 0))=f i j + simp only [Subtype.val_inj,mul_ite,MulZeroClass.mul_zero,Fintype.sum_ite_eq'] + exact hf.2 i j + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma targetLow_homSpace (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (hF:F.IsMinimal Q) (d n v:ℤ) {g:Matrix I J (Q.Zigzag K)} + (hg:g∈homSpace Q E F n v) : + targetLow Q E F d g∈homSpace Q E (lowerTruncation Q F hF d) n v := + ⟨⟨fun i j=>hg.1.1 i j,fun i j=>hg.1.2 i j⟩,fun i j=>hg.2 i j⟩ + +omit [Fintype V] [DecidableEq A] [DecidableEq I] [DecidableEq J] in +lemma targetLow_differential (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (hF:F.IsMinimal Q) (d n:ℤ) (g:Matrix I J (Q.Zigzag K)) + (hg:∀ i j,j∉lowerLevelSet Q F d → g i j=0) : + targetLow Q E F d (homDifferential Q E F n g)= + homDifferential Q E (lowerTruncation Q F hF d) n (targetLow Q E F d g) := by + have hmul:targetLow Q E F d (g*F.differential)= + targetLow Q E F d g*(lowerTruncation Q F hF d).differential := by + apply Matrix.ext + intro i j + change (∑ k:J,g i k*F.differential k j)= + ∑ k:lowerLevelSet Q F d,g i k*F.differential k j + symm + apply Fintype.sum_of_injective (Subtype.val:lowerLevelSet Q F d→J) Subtype.val_injective + · intro k hk + have hn:k∉lowerLevelSet Q F d:=fun hh=>hk ⟨⟨k,hh⟩,rfl⟩ + rw [hg i k hn,zero_mul] + · intro k; rfl + change targetLow Q E F d (E.differential*g-cochainSign (K:=K) n • (g*F.differential))=_ + rw [map_sub,map_smul,hmul] + rfl + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +theorem low_boundary_of_inclusion_boundary (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (hF:F.IsMinimal Q) (d:ℤ) + (hE:∀ i,(E.placement i).level≤d+1) + {f:Matrix I (lowerLevelSet Q F d) (Q.Zigzag K)} + (hf:ProjectiveEntries Q E.placement (lowerTruncation Q F hF d).placement f) + (hb:f*blockInclusion Q F (lowerLevelSet Q F d)∈homBoundaries Q E F 0 0) : + f∈homBoundaries Q E (lowerTruncation Q F hF d) 0 0 := by + obtain ⟨g,hg,he⟩:=hb + have hs:∀ i j,j∉lowerLevelSet Q F d → g i j=0 := by + intro i j hj + by_contra hn + have hh:=mapDegree_level_bound Q hg.2 hn + have hhE:=hE i + exact hj (by change (F.placement j).level≤d; omega) + refine ⟨targetLow Q E F d g,targetLow_homSpace Q E F hF d _ _ hg,?_⟩ + have h:=congrArg (targetLow Q E F d) he + rw [targetLow_differential Q E F hF d _ _ hs,targetLow_inclusion Q E F hF d f hf] at h + exact h + +omit [DecidableEq A] [DecidableEq I] in +lemma lowerTruncation_homDimension_zero (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (hF:F.IsMinimal Q) (d:ℤ) + (hE:∀ i,(E.placement i).level≤d+1) (hz:homDimension Q E F 0 0=0) : + homDimension Q E (lowerTruncation Q F hF d) 0 0=0 := by + apply homDimension_zero_of_cycles_boundary Q + intro f hf + apply low_boundary_of_inclusion_boundary Q E F hF d hE hf.1.1 + apply boundary_of_homDimension_zero Q E F 0 0 hz + simpa only [add_zero,lowInclusion] using homCycles_mul Q hf + (map_mem_homCycles Q (lowInclusion Q F (lowerLevelSet Q F d) (levelDownClosed Q F hF d))) + +omit [DecidableEq A] in +lemma classLowerTruncation_homDimension_zero (x y:FiniteHomotopyClass Q (K:=K)) + (d:ℤ) (hx:ClassUpperBound Q (d+1) x) (hz:classHomDimension Q 0 0 x y=0) : + classHomDimension Q 0 0 x (classLowerTruncation Q d y)=0 := by + let E:=minimalClassModel Q x + let F:=minimalClassModel Q y + have hx':classOfComplex Q E.complex=x:=minimalClassModel_class Q x + rw [← hx'] + change homDimension Q E.complex (lowerTruncation Q F.complex (minimalClassModel_minimal Q y) d) 0 0=0 + apply lowerTruncation_homDimension_zero Q E.complex F.complex (minimalClassModel_minimal Q y) d hx + rw [minimalClassModel_homDimension] + exact hz + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/TermwiseSplitInjection.lean b/lean/OAI/Topology/ArtinGroups/Complexes/TermwiseSplitInjection.lean index f3f51e01144cbeeb4f8745a83687d0bc740078c7..0c1303318c1ac21c854b6b44f3d512223c395524 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/TermwiseSplitInjection.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/TermwiseSplitInjection.lean @@ -1,105 +1,105 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PureCoefficientCohomology -import OAI.Topology.ArtinGroups.Complexes.CoefficientSocle -import OAI.Topology.ArtinGroups.Complexes.GeneratorVector - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] -variable {I J T : Type*} [Fintype I] [Fintype J] [Fintype T] [DecidableEq I] - -structure TermwiseSplitInjection (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) where - inclusion : Map Q E F - retraction : Matrix J I (Q.Zigzag K) - split : inclusion.matrix * retraction = projectiveIdentity Q E.placement - -noncomputable def postcomposeOnCycles (E : BasedComplex Q (K := K) T) - (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) - (ι : Map Q F G) (n v : ℤ) : - homCycles Q E F n v →ₗ[K] homCycles Q E G n v where - toFun f := ⟨f.val * ι.matrix, by - simpa only [add_zero] using homCycles_mul Q f.property (map_mem_homCycles Q ι)⟩ - map_add' f g := by apply Subtype.ext; exact Matrix.add_mul _ _ _ - map_smul' r f := by apply Subtype.ext; exact Matrix.smul_mul _ _ _ - -omit [Fintype V] [DecidableEq A] in -lemma postcomposeOnCycles_injective (E : BasedComplex Q (K := K) T) - (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) - (ι : TermwiseSplitInjection Q F G) (n v : ℤ) : - Function.Injective (postcomposeOnCycles Q E F G ι.inclusion n v) := by - intro f g h - apply Subtype.ext - have hh := congrArg (fun f : homCycles Q E G n v => f.val * ι.retraction) h - change (f.val * ι.inclusion.matrix) * ι.retraction = - (g.val * ι.inclusion.matrix) * ι.retraction at hh - rw [Matrix.mul_assoc, Matrix.mul_assoc, ι.split] at hh - apply Matrix.ext - intro i j - have hij := congrArg (fun m : Matrix T I (Q.Zigzag K) => m i j) hh - simpa only [projectiveIdentity, Matrix.mul_diagonal, - f.property.1.1.2, g.property.1.1.2] using hij - -omit [DecidableEq A] in -lemma pure_coefficient_homDimension_mono (E : BasedComplex Q (K := K) T) - (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) - {l k n v : ℤ} (hE : ∀ i, (E.placement i).level = l) - (hF : ∀ i, (F.placement i).level = k) (hG : ∀ i, (G.placement i).level = k) - (h : n+v=k-l) (ι : TermwiseSplitInjection Q F G) : - homDimension Q E F n v ≤ homDimension Q E G n v := by - unfold homDimension - rw [(pureCoefficientCohomology Q E F hE hF h).finrank_eq, - (pureCoefficientCohomology Q E G hE hG h).finrank_eq] - exact LinearMap.finrank_le_finrank_of_injective - (postcomposeOnCycles_injective Q E F G ι n v) - -omit [Fintype V] [DecidableEq A] [DecidableEq I] in -lemma totalHomDimension_eq_sum_of_subset (E : BasedComplex Q (K := K) I) - (F : BasedComplex Q (K := K) J) (t : ℤ) (D : Finset ℤ) - (hD : homInternalSupport Q E F ⊆ D) : - totalHomDimension Q E F t = ∑ v ∈ D, homDimension Q E F (t-v) v := by - unfold totalHomDimension - apply Finset.sum_subset hD - intro v _ hv - exact homDimension_off_internal_support Q E F (t-v) v hv - -omit [DecidableEq A] in -lemma pure_total_coefficient_homDimension_mono (E : BasedComplex Q (K := K) T) - (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) - {l k : ℤ} (hE : ∀ i, (E.placement i).level = l) - (hF : ∀ i, (F.placement i).level = k) (hG : ∀ i, (G.placement i).level = k) - (ι : TermwiseSplitInjection Q F G) : - totalHomDimension Q E F (k-l) ≤ totalHomDimension Q E G (k-l) := by - classical - let D := homInternalSupport Q E F ∪ homInternalSupport Q E G - rw [totalHomDimension_eq_sum_of_subset Q E F (k-l) D Finset.subset_union_left, - totalHomDimension_eq_sum_of_subset Q E G (k-l) D Finset.subset_union_right] - apply Finset.sum_le_sum - intro v _ - exact pure_coefficient_homDimension_mono Q E F G hE hF hG (by omega) ι - -lemma subobject_cartan_inequality (M : BasedComplex Q (K := K) J) - (S : BasedComplex Q (K := K) I) (Y : BasedComplex Q (K := K) T) - {q d : ℤ} (hM : ∀ i, (M.placement i).level = q) - (hS : ∀ i, (S.placement i).level = q) (hY : ∀ i, (Y.placement i).level = d) - (ι : TermwiseSplitInjection Q S M) (active : Set V) - (hsS : ∀ i, (S.placement i).color ∈ active) - (hsY : ∀ α ∈ active, ∀ c, coefficientSocle Q Y α c = ⊥) - (hmid : totalHomDimension Q M Y (d-q+1) = 0) : - (totalHomDimension Q M Y (d-q) : ℝ) ≤ - (generatorVector Q M - generatorVector Q S) ⬝ᵥ - ((unfoldedCartan Q).mulVec (generatorVector Q Y)) := by - rw [sub_dotProduct, pure_cartan_euler Q M Y hM hY, pure_cartan_euler Q S Y hS hY] - have hz := pure_total_coefficient_homDimension_zero_of_socle_zero Q S Y hS hY active hsS hsY - have hm := pure_total_coefficient_homDimension_mono Q Y S M hY hS hM ι - have hm' : (totalHomDimension Q Y S (q-d) : ℝ) ≤ totalHomDimension Q Y M (q-d) := by - exact_mod_cast hm - have hn : (0 : ℝ) ≤ totalHomDimension Q S Y (d-q+1) := Nat.cast_nonneg _ - rw [hmid, hz, Nat.cast_zero] - linarith - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PureCoefficientCohomology +import OAI.Topology.ArtinGroups.Complexes.CoefficientSocle +import OAI.Topology.ArtinGroups.Complexes.GeneratorVector + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K : Type*} (Q : ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] +variable {I J T : Type*} [Fintype I] [Fintype J] [Fintype T] [DecidableEq I] + +structure TermwiseSplitInjection (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) where + inclusion : Map Q E F + retraction : Matrix J I (Q.Zigzag K) + split : inclusion.matrix * retraction = projectiveIdentity Q E.placement + +noncomputable def postcomposeOnCycles (E : BasedComplex Q (K := K) T) + (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) + (ι : Map Q F G) (n v : ℤ) : + homCycles Q E F n v →ₗ[K] homCycles Q E G n v where + toFun f := ⟨f.val * ι.matrix, by + simpa only [add_zero] using homCycles_mul Q f.property (map_mem_homCycles Q ι)⟩ + map_add' f g := by apply Subtype.ext; exact Matrix.add_mul _ _ _ + map_smul' r f := by apply Subtype.ext; exact Matrix.smul_mul _ _ _ + +omit [Fintype V] [DecidableEq A] in +lemma postcomposeOnCycles_injective (E : BasedComplex Q (K := K) T) + (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) + (ι : TermwiseSplitInjection Q F G) (n v : ℤ) : + Function.Injective (postcomposeOnCycles Q E F G ι.inclusion n v) := by + intro f g h + apply Subtype.ext + have hh := congrArg (fun f : homCycles Q E G n v => f.val * ι.retraction) h + change (f.val * ι.inclusion.matrix) * ι.retraction = + (g.val * ι.inclusion.matrix) * ι.retraction at hh + rw [Matrix.mul_assoc, Matrix.mul_assoc, ι.split] at hh + apply Matrix.ext + intro i j + have hij := congrArg (fun m : Matrix T I (Q.Zigzag K) => m i j) hh + simpa only [projectiveIdentity, Matrix.mul_diagonal, + f.property.1.1.2, g.property.1.1.2] using hij + +omit [DecidableEq A] in +lemma pure_coefficient_homDimension_mono (E : BasedComplex Q (K := K) T) + (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) + {l k n v : ℤ} (hE : ∀ i, (E.placement i).level = l) + (hF : ∀ i, (F.placement i).level = k) (hG : ∀ i, (G.placement i).level = k) + (h : n+v=k-l) (ι : TermwiseSplitInjection Q F G) : + homDimension Q E F n v ≤ homDimension Q E G n v := by + unfold homDimension + rw [(pureCoefficientCohomology Q E F hE hF h).finrank_eq, + (pureCoefficientCohomology Q E G hE hG h).finrank_eq] + exact LinearMap.finrank_le_finrank_of_injective + (postcomposeOnCycles_injective Q E F G ι n v) + +omit [Fintype V] [DecidableEq A] [DecidableEq I] in +lemma totalHomDimension_eq_sum_of_subset (E : BasedComplex Q (K := K) I) + (F : BasedComplex Q (K := K) J) (t : ℤ) (D : Finset ℤ) + (hD : homInternalSupport Q E F ⊆ D) : + totalHomDimension Q E F t = ∑ v ∈ D, homDimension Q E F (t-v) v := by + unfold totalHomDimension + apply Finset.sum_subset hD + intro v _ hv + exact homDimension_off_internal_support Q E F (t-v) v hv + +omit [DecidableEq A] in +lemma pure_total_coefficient_homDimension_mono (E : BasedComplex Q (K := K) T) + (F : BasedComplex Q (K := K) I) (G : BasedComplex Q (K := K) J) + {l k : ℤ} (hE : ∀ i, (E.placement i).level = l) + (hF : ∀ i, (F.placement i).level = k) (hG : ∀ i, (G.placement i).level = k) + (ι : TermwiseSplitInjection Q F G) : + totalHomDimension Q E F (k-l) ≤ totalHomDimension Q E G (k-l) := by + classical + let D := homInternalSupport Q E F ∪ homInternalSupport Q E G + rw [totalHomDimension_eq_sum_of_subset Q E F (k-l) D Finset.subset_union_left, + totalHomDimension_eq_sum_of_subset Q E G (k-l) D Finset.subset_union_right] + apply Finset.sum_le_sum + intro v _ + exact pure_coefficient_homDimension_mono Q E F G hE hF hG (by omega) ι + +lemma subobject_cartan_inequality (M : BasedComplex Q (K := K) J) + (S : BasedComplex Q (K := K) I) (Y : BasedComplex Q (K := K) T) + {q d : ℤ} (hM : ∀ i, (M.placement i).level = q) + (hS : ∀ i, (S.placement i).level = q) (hY : ∀ i, (Y.placement i).level = d) + (ι : TermwiseSplitInjection Q S M) (active : Set V) + (hsS : ∀ i, (S.placement i).color ∈ active) + (hsY : ∀ α ∈ active, ∀ c, coefficientSocle Q Y α c = ⊥) + (hmid : totalHomDimension Q M Y (d-q+1) = 0) : + (totalHomDimension Q M Y (d-q) : ℝ) ≤ + (generatorVector Q M - generatorVector Q S) ⬝ᵥ + ((unfoldedCartan Q).mulVec (generatorVector Q Y)) := by + rw [sub_dotProduct, pure_cartan_euler Q M Y hM hY, pure_cartan_euler Q S Y hS hY] + have hz := pure_total_coefficient_homDimension_zero_of_socle_zero Q S Y hS hY active hsS hsY + have hm := pure_total_coefficient_homDimension_mono Q Y S M hY hS hM ι + have hm' : (totalHomDimension Q Y S (q-d) : ℝ) ≤ totalHomDimension Q Y M (q-d) := by + exact_mod_cast hm + have hn : (0 : ℝ) ≤ totalHomDimension Q S Y (d-q+1) := Nat.cast_nonneg _ + rw [hmid, hz, Nat.cast_zero] + linarith + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/Test.lean b/lean/OAI/Topology/ArtinGroups/Complexes/Test.lean index 9e5b62a5620181a58433c657eb4bccad65e8d26b..ffabd9df8f2aea06c00d117688b4c1fd6bc3aec8 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/Test.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/Test.lean @@ -1,59 +1,59 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.NormalizedInverseTwistHomotopy -import OAI.Topology.ArtinGroups.Complexes.TokenShift - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I J : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -omit [DecidableEq J] in -lemma test_homotopy_equation {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} - (f : Map Q E F) (g : Map Q F E) (α : V) - {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) - (he : f.matrix * g.matrix = projectiveIdentity Q E.placement + - (E.differential * h + h * E.differential)) : - (f.test Q α).matrix * (g.test Q α).matrix = - projectiveIdentity Q (E.testComplex Q α).placement + - ((E.testComplex Q α).differential * testTransform Q E.placement E.placement α h + - testTransform Q E.placement E.placement α h * (E.testComplex Q α).differential) := by - change testTransform Q _ _ α f.matrix * testTransform Q _ _ α g.matrix = - projectiveIdentity Q (testPlacement Q E.placement α) + - (testTransform Q _ _ α E.differential * testTransform Q _ _ α h + - testTransform Q _ _ α h * testTransform Q _ _ α E.differential) - rw [testTransform_mul Q α _ f.entries, testTransform_mul Q α _ E.entries, - testTransform_mul Q α _ hh, he, testTransform_add, testTransform_add, - testTransform_identity] - congr 2 - exact Subsingleton.elim _ _ - -noncomputable def HomotopyEquivalence.test {E : BasedComplex Q (K := K) I} - {F : BasedComplex Q (K := K) J} (e : HomotopyEquivalence Q E F) (α : V) : - HomotopyEquivalence Q (E.testComplex Q α) (F.testComplex Q α) where - forward := e.forward.test Q α - backward := e.backward.test Q α - sourceHomotopy := testTransform Q E.placement E.placement α e.sourceHomotopy - targetHomotopy := testTransform Q F.placement F.placement α e.targetHomotopy - sourceEntries := scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ - targetEntries := scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ - sourceDegree := testMatrix_degree Q α e.sourceDegree - targetDegree := testMatrix_degree Q α e.targetDegree - sourceEquation := test_homotopy_equation Q e.forward e.backward α - e.sourceEntries e.sourceEquation - targetEquation := test_homotopy_equation Q e.backward e.forward α - e.targetEntries e.targetEquation - -noncomputable def negativeTwist_testShift (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q (((E.negativeTwist Q α).testComplex Q α).tokenShift Q) - (E.testComplex Q α) := - ((positiveTwist_testShift Q hn (E.negativeTwist Q α) α).symm Q).trans Q - ((positive_negative_homotopyEquivalence Q hn E α).test Q α) - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.NormalizedInverseTwistHomotopy +import OAI.Topology.ArtinGroups.Complexes.TokenShift + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I J : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +omit [DecidableEq J] in +lemma test_homotopy_equation {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} + (f : Map Q E F) (g : Map Q F E) (α : V) + {h : Matrix I I (Q.Zigzag K)} (hh : ProjectiveEntries Q E.placement E.placement h) + (he : f.matrix * g.matrix = projectiveIdentity Q E.placement + + (E.differential * h + h * E.differential)) : + (f.test Q α).matrix * (g.test Q α).matrix = + projectiveIdentity Q (E.testComplex Q α).placement + + ((E.testComplex Q α).differential * testTransform Q E.placement E.placement α h + + testTransform Q E.placement E.placement α h * (E.testComplex Q α).differential) := by + change testTransform Q _ _ α f.matrix * testTransform Q _ _ α g.matrix = + projectiveIdentity Q (testPlacement Q E.placement α) + + (testTransform Q _ _ α E.differential * testTransform Q _ _ α h + + testTransform Q _ _ α h * testTransform Q _ _ α E.differential) + rw [testTransform_mul Q α _ f.entries, testTransform_mul Q α _ E.entries, + testTransform_mul Q α _ hh, he, testTransform_add, testTransform_add, + testTransform_identity] + congr 2 + exact Subsingleton.elim _ _ + +noncomputable def HomotopyEquivalence.test {E : BasedComplex Q (K := K) I} + {F : BasedComplex Q (K := K) J} (e : HomotopyEquivalence Q E F) (α : V) : + HomotopyEquivalence Q (E.testComplex Q α) (F.testComplex Q α) where + forward := e.forward.test Q α + backward := e.backward.test Q α + sourceHomotopy := testTransform Q E.placement E.placement α e.sourceHomotopy + targetHomotopy := testTransform Q F.placement F.placement α e.targetHomotopy + sourceEntries := scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ + targetEntries := scalarCornerMatrix_entries Q α _ _ (fun _ => rfl) (fun _ => rfl) _ + sourceDegree := testMatrix_degree Q α e.sourceDegree + targetDegree := testMatrix_degree Q α e.targetDegree + sourceEquation := test_homotopy_equation Q e.forward e.backward α + e.sourceEntries e.sourceEquation + targetEquation := test_homotopy_equation Q e.backward e.forward α + e.targetEntries e.targetEquation + +noncomputable def negativeTwist_testShift (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q (((E.negativeTwist Q α).testComplex Q α).tokenShift Q) + (E.testComplex Q α) := + ((positiveTwist_testShift Q hn (E.negativeTwist Q α) α).symm Q).trans Q + ((positive_negative_homotopyEquivalence Q hn E α).test Q α) + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/TestComplexVertexDifferential.lean b/lean/OAI/Topology/ArtinGroups/Complexes/TestComplexVertexDifferential.lean index 96224bea6579f7262adfdc121cfd742a6d15a94b..1995ac53a25a6bc408e72b9d3ccff01795302d87 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/TestComplexVertexDifferential.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/TestComplexVertexDifferential.lean @@ -1,68 +1,68 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.UnitTestVector -import OAI.Topology.ArtinGroups.Complexes.CoefficientSocleRestrictLayer - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] - -lemma testComplex_vertex_differential (E:BasedComplex Q (K:=K) I) (α:V) : - (E.testComplex Q α).differential.map (vertexHom Q α)= - testMatrix Q E.placement E.placement α E.differential := by - apply Matrix.ext - intro i j - change ((testMatrix Q E.placement E.placement α E.differential i j) • vertexId Q α).vertex α = _ - simp - -lemma test_bottom_length_zero (E:BasedComplex Q (K:=K) I) {d:ℤ} - (hfloor:∀ i,d≤(E.placement i).level) (α:V) - (i:TestIndex Q E.placement α) (hi:((E.testComplex Q α).placement i).level=d) : - Path.length i.2.val=0 ∧ (E.placement i.1).level=d := by - have hh:=hfloor i.1 - have hl:0≤Path.length i.2.val := by - rcases i.2.val with v|a|v <;> norm_num [Path.length] - dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at * - omega - -theorem bottom_test_cycle_zero_of_socle - (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d:ℤ} - (hfloor:∀ i,d≤(E.placement i).level) (α:V) (c:ℤ) - (hS:coefficientSocle Q (E.pureLayer Q hE d) α c=⊥) - (y:TestIndex Q E.placement α→K) - (hs:∀ i,¬ (((E.testComplex Q α).placement i).level=d ∧ - ((E.testComplex Q α).placement i).cochain=c)→y i=0) - (hd:Matrix.vecMul y ((E.testComplex Q α).differential.map (vertexHom Q α))=0) : y=0 := by - have hy: y∈socleTestCycles Q E α c := by - constructor - · intro i hi - apply hs - rintro ⟨hl,hc⟩ - exact hi ⟨hc,(test_bottom_length_zero Q E hfloor α i hl).1⟩ - · rwa [testComplex_vertex_differential Q E α] at hd - let x:=sumUnitTest Q E.placement α y - have hx:x∈coefficientSocle Q E α c:=sumUnitTest_socle Q E α c hy - have hxs:∀ i,(E.placement i).level≠d→x i=0 := by - intro i hi - apply Finset.sum_eq_zero - intro z hz - apply hs - intro hh - exact hi (test_bottom_length_zero Q E hfloor α ⟨i,z⟩ hh.1).2 - have hxr:=coefficientSocle_restrict_layer Q E hE d α c hx hxs - rw [hS] at hxr - have hzr:(fun i:{i // (E.placement i).level=d}=>x i.val)=0:=hxr - have hx0:x=0 := by - funext i - by_cases hi:(E.placement i).level=d - · exact congrFun hzr ⟨i,hi⟩ - · exact hxs i hi - rw [← unitTestVector_sum Q E.placement α c y hy.1] - change unitTestVector Q E.placement α x=0 - rw [hx0,map_zero] - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.UnitTestVector +import OAI.Topology.ArtinGroups.Complexes.CoefficientSocleRestrictLayer + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] + +lemma testComplex_vertex_differential (E:BasedComplex Q (K:=K) I) (α:V) : + (E.testComplex Q α).differential.map (vertexHom Q α)= + testMatrix Q E.placement E.placement α E.differential := by + apply Matrix.ext + intro i j + change ((testMatrix Q E.placement E.placement α E.differential i j) • vertexId Q α).vertex α = _ + simp + +lemma test_bottom_length_zero (E:BasedComplex Q (K:=K) I) {d:ℤ} + (hfloor:∀ i,d≤(E.placement i).level) (α:V) + (i:TestIndex Q E.placement α) (hi:((E.testComplex Q α).placement i).level=d) : + Path.length i.2.val=0 ∧ (E.placement i.1).level=d := by + have hh:=hfloor i.1 + have hl:0≤Path.length i.2.val := by + rcases i.2.val with v|a|v <;> norm_num [Path.length] + dsimp only [testComplex,testPlacement,GeneratorPlacement.level] at * + omega + +theorem bottom_test_cycle_zero_of_socle + (E:BasedComplex Q (K:=K) I) (hE:E.IsMinimal Q) {d:ℤ} + (hfloor:∀ i,d≤(E.placement i).level) (α:V) (c:ℤ) + (hS:coefficientSocle Q (E.pureLayer Q hE d) α c=⊥) + (y:TestIndex Q E.placement α→K) + (hs:∀ i,¬ (((E.testComplex Q α).placement i).level=d ∧ + ((E.testComplex Q α).placement i).cochain=c)→y i=0) + (hd:Matrix.vecMul y ((E.testComplex Q α).differential.map (vertexHom Q α))=0) : y=0 := by + have hy: y∈socleTestCycles Q E α c := by + constructor + · intro i hi + apply hs + rintro ⟨hl,hc⟩ + exact hi ⟨hc,(test_bottom_length_zero Q E hfloor α i hl).1⟩ + · rwa [testComplex_vertex_differential Q E α] at hd + let x:=sumUnitTest Q E.placement α y + have hx:x∈coefficientSocle Q E α c:=sumUnitTest_socle Q E α c hy + have hxs:∀ i,(E.placement i).level≠d→x i=0 := by + intro i hi + apply Finset.sum_eq_zero + intro z hz + apply hs + intro hh + exact hi (test_bottom_length_zero Q E hfloor α ⟨i,z⟩ hh.1).2 + have hxr:=coefficientSocle_restrict_layer Q E hE d α c hx hxs + rw [hS] at hxr + have hzr:(fun i:{i // (E.placement i).level=d}=>x i.val)=0:=hxr + have hx0:x=0 := by + funext i + by_cases hi:(E.placement i).level=d + · exact congrFun hzr ⟨i,hi⟩ + · exact hxs i hi + rw [← unitTestVector_sum Q E.placement α c y hy.1] + change unitTestVector Q E.placement α x=0 + rw [hx0,map_zero] + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/TestExact.lean b/lean/OAI/Topology/ArtinGroups/Complexes/TestExact.lean index 1582886911ba63f9c7ab53add05cc54c3c4b5b14..4e46423390d4508402b20b9fc96952ed603d9f65 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/TestExact.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/TestExact.lean @@ -1,71 +1,71 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid -import OAI.Topology.ArtinGroups.Complexes.TestUpperBound -import OAI.Topology.ArtinGroups.Complexes.ScalarSupportedCochainShift - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -universe u -variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - -def ClassTestExact (α:V) (l c:ℤ) : FiniteHomotopyClass Q (K:=K)→Prop := - Quotient.lift (fun E=>ScalarExactAt Q (E.complex.testComplex Q α) α l c) (by - intro E F h - obtain ⟨e⟩:=h - apply propext - constructor - · exact fun h=>scalarExact_transport Q _ _ ((e.symm Q).test Q α) α (fun _=>rfl) h - · exact fun h=>scalarExact_transport Q _ _ (e.test Q α) α (fun _=>rfl) h) - -def ClassTestUpper (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (t:ℤ) : Prop := - ∀ α∈U,∀ l:ℤ,t - exact positiveTwist_test_exact_iff Q hn E.complex α l c - -lemma classTestExact_positive_other (x:FiniteHomotopyClass Q (K:=K)) (α β:V) - (hne:β≠α) (l c:ℤ) - (ha:ClassTestExact Q α l (c+1) x) (hb:ClassTestExact Q β l c x) : - ClassTestExact Q β l c (classPositiveTwist Q α x) := by - induction x using Quotient.inductionOn with | _ E => - exact positiveTwist_other_test_exact Q E.complex α β hne l c ha hb - -lemma classTestExact_positive_adjacent (hn:∀ a,Q.source a≠Q.target a) - (x:FiniteHomotopyClass Q (K:=K)) {α β:V} (e:SimpleEdge Q α β) (l c:ℤ) : - ClassTestExact Q β l c (classPositiveTwist Q α (classPositiveTwist Q β x)) ↔ - ClassTestExact Q α l (c+1) x := by - induction x using Quotient.inductionOn with | _ E => - exact positiveTwist_adjacent_test_exact_iff Q hn E.complex e l c - -lemma classPositiveTwist_testUpper (hn:∀ a,Q.source a≠Q.target a) - (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} - (h:ClassTestUpper Q x U t) : ClassTestUpper Q (classPositiveTwist Q α x) U (t+1) := by - induction x using Quotient.inductionOn with | _ E => - exact positiveTwist_testUpperBound Q hn E.complex U α hα h - -lemma classPositiveTwist_testUpper_reflect (hn:∀ a,Q.source a≠Q.target a) - (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} - (h:ClassTestUpper Q (classPositiveTwist Q α x) U t) : ClassTestUpper Q x U t := by - induction x using Quotient.inductionOn with | _ E => - exact positiveTwist_testUpperBound_reflect Q hn E.complex U α hα h - -lemma classPositiveTwist_testUpper_iff (hn:∀ a,Q.source a≠Q.target a) - (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} - (h:ClassTestUpper Q x U t) : - ClassTestUpper Q (classPositiveTwist Q α x) U t ↔ - ∀ c,ClassTestExact Q α t c x := by - induction x using Quotient.inductionOn with | _ E => - exact positiveTwist_testUpperBound_iff Q hn E.complex U α hα h - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.FiniteHomotopySetoid +import OAI.Topology.ArtinGroups.Complexes.TestUpperBound +import OAI.Topology.ArtinGroups.Complexes.ScalarSupportedCochainShift + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +universe u +variable {V A:Type u} {K:Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + +def ClassTestExact (α:V) (l c:ℤ) : FiniteHomotopyClass Q (K:=K)→Prop := + Quotient.lift (fun E=>ScalarExactAt Q (E.complex.testComplex Q α) α l c) (by + intro E F h + obtain ⟨e⟩:=h + apply propext + constructor + · exact fun h=>scalarExact_transport Q _ _ ((e.symm Q).test Q α) α (fun _=>rfl) h + · exact fun h=>scalarExact_transport Q _ _ (e.test Q α) α (fun _=>rfl) h) + +def ClassTestUpper (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (t:ℤ) : Prop := + ∀ α∈U,∀ l:ℤ,t + exact positiveTwist_test_exact_iff Q hn E.complex α l c + +lemma classTestExact_positive_other (x:FiniteHomotopyClass Q (K:=K)) (α β:V) + (hne:β≠α) (l c:ℤ) + (ha:ClassTestExact Q α l (c+1) x) (hb:ClassTestExact Q β l c x) : + ClassTestExact Q β l c (classPositiveTwist Q α x) := by + induction x using Quotient.inductionOn with | _ E => + exact positiveTwist_other_test_exact Q E.complex α β hne l c ha hb + +lemma classTestExact_positive_adjacent (hn:∀ a,Q.source a≠Q.target a) + (x:FiniteHomotopyClass Q (K:=K)) {α β:V} (e:SimpleEdge Q α β) (l c:ℤ) : + ClassTestExact Q β l c (classPositiveTwist Q α (classPositiveTwist Q β x)) ↔ + ClassTestExact Q α l (c+1) x := by + induction x using Quotient.inductionOn with | _ E => + exact positiveTwist_adjacent_test_exact_iff Q hn E.complex e l c + +lemma classPositiveTwist_testUpper (hn:∀ a,Q.source a≠Q.target a) + (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} + (h:ClassTestUpper Q x U t) : ClassTestUpper Q (classPositiveTwist Q α x) U (t+1) := by + induction x using Quotient.inductionOn with | _ E => + exact positiveTwist_testUpperBound Q hn E.complex U α hα h + +lemma classPositiveTwist_testUpper_reflect (hn:∀ a,Q.source a≠Q.target a) + (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} + (h:ClassTestUpper Q (classPositiveTwist Q α x) U t) : ClassTestUpper Q x U t := by + induction x using Quotient.inductionOn with | _ E => + exact positiveTwist_testUpperBound_reflect Q hn E.complex U α hα h + +lemma classPositiveTwist_testUpper_iff (hn:∀ a,Q.source a≠Q.target a) + (x:FiniteHomotopyClass Q (K:=K)) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} + (h:ClassTestUpper Q x U t) : + ClassTestUpper Q (classPositiveTwist Q α x) U t ↔ + ∀ c,ClassTestExact Q α t c x := by + induction x using Quotient.inductionOn with | _ E => + exact positiveTwist_testUpperBound_iff Q hn E.complex U α hα h + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/TestUpperBound.lean b/lean/OAI/Topology/ArtinGroups/Complexes/TestUpperBound.lean index 7602e3bdf184d62d899916dbfadfa127513c1b8b..942960b53896522a9432f0f126e3561a8f267ed2 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/TestUpperBound.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/TestUpperBound.lean @@ -1,114 +1,114 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistOtherTest2 -import OAI.Topology.ArtinGroups.Complexes.ScalarSupportedTokenShift -import OAI.Topology.ArtinGroups.Complexes.PositiveTwistOtherTest3 -import OAI.Topology.ArtinGroups.Complexes.GeneratorTokenTest -import OAI.Topology.ArtinGroups.Complexes.Test - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A K I J : Type*} (Q:ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] - -def TestUpperBound (E:BasedComplex Q (K:=K) I) (U:Set V) (t:ℤ) : Prop := - ∀ α∈U,∀ l:ℤ,th α hα l (lt_of_le_of_lt hst hl) c - -lemma testUpperBound_transport (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) - (e:HomotopyEquivalence Q E F) (U:Set V) {t:ℤ} (h:TestUpperBound Q F U t) : - TestUpperBound Q E U t := by - intro α hα l hl c - exact scalarExact_transport Q _ _ (e.test Q α) α (fun _=>rfl) (h α hα l hl c) - -theorem positiveTwist_testUpperBound (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} - (h:TestUpperBound Q E U t) : TestUpperBound Q (E.positiveTwist Q α) U (t+1) := by - intro β hβ l hl c - by_cases he:β=α - · subst β - apply (positiveTwist_test_exact_iff Q hn E α l c).mpr - exact h α hα (l-1) (by omega) (c+1) - · exact positiveTwist_other_test_exact Q E α β he l c - (h α hα l (by omega) (c+1)) (h β hβ l (by omega) c) - -theorem positiveTwist_testUpperBound_reflect (hn:∀ a,Q.source a≠Q.target a) - (E:BasedComplex Q (K:=K) I) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} - (h:TestUpperBound Q (E.positiveTwist Q α) U t) : TestUpperBound Q E U t := by - have ha:∀ l:ℤ,t(E.placement j).level) ⟨i,Finset.mem_univ i⟩ - have hm:∀ k,(E.placement k).level≤(E.placement j).level:= - fun k=>hmax k (Finset.mem_univ k) - let F:=Finset.univ.filter (fun k:I=>(E.placement k).level=(E.placement j).level) - have hjF:j∈F:=by simp [F] - obtain ⟨k,hk,hmin⟩:=Finset.exists_min_image F (fun k:I=>(E.placement k).cochain) ⟨j,hjF⟩ - have hlev:(E.placement k).level=(E.placement j).level:= (Finset.mem_filter.mp hk).2 - have hkd:d<(E.placement k).level := by have hh:=hm i; omega - have hku:(E.placement k).color∈U := by - by_contra hn - have hh:=hout k hn - omega - apply highest_generator_test_not_exact Q E hE k - (fun z=>by rw [hlev]; exact hm z) - (fun z hz=>hmin z (by simp [F,hz,hlev])) - exact h (E.placement k).color hku ((E.placement k).level+2) (by omega) - (E.placement k).cochain - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistOtherTest2 +import OAI.Topology.ArtinGroups.Complexes.ScalarSupportedTokenShift +import OAI.Topology.ArtinGroups.Complexes.PositiveTwistOtherTest3 +import OAI.Topology.ArtinGroups.Complexes.GeneratorTokenTest +import OAI.Topology.ArtinGroups.Complexes.Test + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A K I J : Type*} (Q:ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +def TestUpperBound (E:BasedComplex Q (K:=K) I) (U:Set V) (t:ℤ) : Prop := + ∀ α∈U,∀ l:ℤ,th α hα l (lt_of_le_of_lt hst hl) c + +lemma testUpperBound_transport (E:BasedComplex Q (K:=K) I) (F:BasedComplex Q (K:=K) J) + (e:HomotopyEquivalence Q E F) (U:Set V) {t:ℤ} (h:TestUpperBound Q F U t) : + TestUpperBound Q E U t := by + intro α hα l hl c + exact scalarExact_transport Q _ _ (e.test Q α) α (fun _=>rfl) (h α hα l hl c) + +theorem positiveTwist_testUpperBound (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} + (h:TestUpperBound Q E U t) : TestUpperBound Q (E.positiveTwist Q α) U (t+1) := by + intro β hβ l hl c + by_cases he:β=α + · subst β + apply (positiveTwist_test_exact_iff Q hn E α l c).mpr + exact h α hα (l-1) (by omega) (c+1) + · exact positiveTwist_other_test_exact Q E α β he l c + (h α hα l (by omega) (c+1)) (h β hβ l (by omega) c) + +theorem positiveTwist_testUpperBound_reflect (hn:∀ a,Q.source a≠Q.target a) + (E:BasedComplex Q (K:=K) I) (U:Set V) (α:V) (hα:α∈U) {t:ℤ} + (h:TestUpperBound Q (E.positiveTwist Q α) U t) : TestUpperBound Q E U t := by + have ha:∀ l:ℤ,t(E.placement j).level) ⟨i,Finset.mem_univ i⟩ + have hm:∀ k,(E.placement k).level≤(E.placement j).level:= + fun k=>hmax k (Finset.mem_univ k) + let F:=Finset.univ.filter (fun k:I=>(E.placement k).level=(E.placement j).level) + have hjF:j∈F:=by simp [F] + obtain ⟨k,hk,hmin⟩:=Finset.exists_min_image F (fun k:I=>(E.placement k).cochain) ⟨j,hjF⟩ + have hlev:(E.placement k).level=(E.placement j).level:= (Finset.mem_filter.mp hk).2 + have hkd:d<(E.placement k).level := by have hh:=hm i; omega + have hku:(E.placement k).color∈U := by + by_contra hn + have hh:=hout k hn + omega + apply highest_generator_test_not_exact Q E hE k + (fun z=>by rw [hlev]; exact hm z) + (fun z hz=>hmin z (by simp [F,hz,hlev])) + exact h (E.placement k).color hku ((E.placement k).level+2) (by omega) + (E.placement k).cochain + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/TokenShift.lean b/lean/OAI/Topology/ArtinGroups/Complexes/TokenShift.lean index 2d8a7c61e2fb3b8f568e113a3d37f08bc8614fe1..dbaaba9460f9bf4eb7bbe891e8aed072a8587e27 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/TokenShift.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/TokenShift.lean @@ -1,150 +1,150 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices -import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential2 -import OAI.Topology.ArtinGroups.Complexes.Identity - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -variable {V A K I : Type*} (Q : ReversibleQuiver V A) - [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] - [Fintype I] [DecidableEq I] - -noncomputable def tokenShift (E : BasedComplex Q (K := K) I) : - BasedComplex Q (K := K) I where - placement i := ⟨(E.placement i).color, (E.placement i).cochain - 1, - (E.placement i).internal + 2⟩ - differential := -E.differential - entries := projectiveEntries_neg Q E.entries - degree i j := by - constructor - · intro h - change -E.differential i j = 0 - rw [(E.degree i j).1 (by dsimp only at h; omega), neg_zero] - · change Homogeneous Q (0 + ((E.placement i).internal + 2) - - ((E.placement j).internal + 2)) (-E.differential i j) - convert homogeneous_neg Q (E.degree i j).2 using 1; omega - square_zero := by rw [Matrix.neg_mul, Matrix.mul_neg, neg_neg, E.square_zero] - -def testShiftIndexEquiv (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - (TestIndex Q E.placement α ⊕ TestIndex Q E.placement α ⊕ TestIndex Q E.placement α) ≃ - TestIndex Q (E.positiveTwist Q α).placement α where - toFun - | .inl u => ⟨.inl u, selfCornerEquiv Q hn α false⟩ - | .inr (.inl u) => ⟨.inr u.1, u.2⟩ - | .inr (.inr u) => ⟨.inl u, selfCornerEquiv Q hn α true⟩ - invFun - | ⟨.inl u, p⟩ => if (selfCornerEquiv Q hn α).symm p then .inr (.inr u) else .inl u - | ⟨.inr i, p⟩ => .inr (.inl ⟨i, p⟩) - left_inv u := by rcases u with u | u | u <;> rfl - right_inv u := by - rcases u with ⟨u | i, p⟩ - · have he := (selfCornerEquiv Q hn α).apply_symm_apply p - cases h : (selfCornerEquiv Q hn α).symm p - · simp only [h, Bool.false_eq_true, ↓reduceIte] - congr 1 - change (selfCornerEquiv Q hn α false : CornerPath Q α α) = p - simpa only [h] using he - · simp only [h, ↓reduceIte] - congr 1 - change (selfCornerEquiv Q hn α true : CornerPath Q α α) = p - simpa only [h] using he - · rfl - -noncomputable def normalizedTestTwist (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) := - ((E.positiveTwist Q α).testComplex Q α).reindex Q (testShiftIndexEquiv Q hn E α) - -lemma normalizedTestTwist_pivot_entry (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) (u v : TestIndex Q E.placement α) : - (normalizedTestTwist Q hn E α).differential (.inl u) (.inr (.inl v)) = - projectiveIdentity Q (testPlacement Q E.placement α) u v := by - classical - change (pathCoordinates Q (K := K) (pathBasis Q (K := K) (.inl α) * - evaluationMatrix Q E.placement α u v.1) v.2.val) • vertexId Q (K := K) α = _ - rw [pathBasis_vertex] - simp only [evaluationMatrix] - by_cases h : u.1 = v.1 - · rcases u with ⟨i, p⟩ - rcases v with ⟨j, q⟩ - dsimp only at h - subst j - simp only [ite_true, cornerPath_left, pathBasis_coordinates, projectiveIdentity, - Matrix.diagonal_apply, testPlacement, Sigma.mk.inj_iff, heq_eq_eq, true_and] - simp only [Subtype.val_inj, ite_smul, one_smul, zero_smul] - · have huv : u ≠ v := fun he => h (congrArg Sigma.fst he) - simp only [ite_eq_right h, MulZeroClass.mul_zero, coordinates_zero, zero_smul, - projectiveIdentity, Matrix.diagonal_apply, ite_eq_right huv] - -noncomputable def testShiftPivot (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - BlockPivot Q (normalizedTestTwist Q hn E α) where - coefficient := 1 - nonzero := one_ne_zero - color _ := rfl - cochain i := by - change (E.placement i.1).cochain = (E.placement i.1).cochain - 1 + 1 - omega - internal i := by - change (E.placement i.1).internal + Path.length i.2.val = - ((E.placement i.1).internal + Path.length i.2.val) + 0 - omega - entry i j := by - rw [normalizedTestTwist_pivot_entry] - simp only [one_smul] - rfl - -omit [DecidableEq I] in -lemma normalizedTestTwist_unit_token (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) (u v : TestIndex Q E.placement α) : - (normalizedTestTwist Q hn E α).differential (.inl u) (.inr (.inr v)) = 0 := by - change (pathCoordinates Q (K := K) (pathBasis Q (K := K) (.inl α) * - (-((testMatrix Q E.placement E.placement α E.differential) u v • vertexId Q (K := K) α))) - (.inr (.inr α))) • vertexId Q (K := K) α = 0 - rw [pathBasis_vertex, _root_.mul_neg, mul_smul, vertexId_mul_self] - rw [map_neg, Pi.neg_apply, coordinates_smul, pathCoordinates_token, token_vertexId] - simp only [Pi.zero_apply, MulZeroClass.mul_zero, neg_zero, zero_smul] - -omit [DecidableEq I] in -lemma normalizedTestTwist_token_token (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) (u v : TestIndex Q E.placement α) : - (normalizedTestTwist Q hn E α).differential (.inr (.inr u)) (.inr (.inr v)) = - -(E.testComplex Q α).differential u v := by - have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by - simpa only [Path.target, pathBasis_token] using - (pathBasis_right Q (K := K) (.inr (.inr α))) - change (pathCoordinates Q (K := K) (pathBasis Q (K := K) (.inr (.inr α)) * - (-((testMatrix Q E.placement E.placement α E.differential) u v • vertexId Q (K := K) α))) - (.inr (.inr α))) • vertexId Q (K := K) α = - -((testMatrix Q E.placement E.placement α E.differential) u v • vertexId Q (K := K) α) - rw [pathBasis_token, _root_.mul_neg, mul_smul, ht] - simp only [map_neg, Pi.neg_apply, coordinates_smul, ← pathBasis_token, - pathBasis_coordinates, ite_true, _root_.mul_one, neg_smul] - -lemma testShift_reduced_eq (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - (testShiftPivot Q hn E α).reduced Q = (E.testComplex Q α).tokenShift Q := by - apply ext_placement_differential Q - · rfl - · apply Matrix.ext - intro u v - rw [BlockPivot.reduced_differential, normalizedTestTwist_token_token] - simp only [normalizedTestTwist_unit_token, MulZeroClass.mul_zero, - Finset.sum_const_zero, sub_zero] - rfl - -noncomputable def positiveTwist_testShift (hn : ∀ a, Q.source a ≠ Q.target a) - (E : BasedComplex Q (K := K) I) (α : V) : - HomotopyEquivalence Q ((E.positiveTwist Q α).testComplex Q α) - ((E.testComplex Q α).tokenShift Q) := by - let e := ((E.positiveTwist Q α).testComplex Q α).reindexHomotopyEquivalence Q - (testShiftIndexEquiv Q hn E α) - let f := (testShiftPivot Q hn E α).reductionEquivalence Q - rw [testShift_reduced_eq] at f - exact e.trans Q f - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Quivers.OrthogonalVertices +import OAI.Topology.ArtinGroups.Cancellation.ReducedDifferential2 +import OAI.Topology.ArtinGroups.Complexes.Identity + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +variable {V A K I : Type*} (Q : ReversibleQuiver V A) + [Field K] [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] + [Fintype I] [DecidableEq I] + +noncomputable def tokenShift (E : BasedComplex Q (K := K) I) : + BasedComplex Q (K := K) I where + placement i := ⟨(E.placement i).color, (E.placement i).cochain - 1, + (E.placement i).internal + 2⟩ + differential := -E.differential + entries := projectiveEntries_neg Q E.entries + degree i j := by + constructor + · intro h + change -E.differential i j = 0 + rw [(E.degree i j).1 (by dsimp only at h; omega), neg_zero] + · change Homogeneous Q (0 + ((E.placement i).internal + 2) - + ((E.placement j).internal + 2)) (-E.differential i j) + convert homogeneous_neg Q (E.degree i j).2 using 1; omega + square_zero := by rw [Matrix.neg_mul, Matrix.mul_neg, neg_neg, E.square_zero] + +def testShiftIndexEquiv (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + (TestIndex Q E.placement α ⊕ TestIndex Q E.placement α ⊕ TestIndex Q E.placement α) ≃ + TestIndex Q (E.positiveTwist Q α).placement α where + toFun + | .inl u => ⟨.inl u, selfCornerEquiv Q hn α false⟩ + | .inr (.inl u) => ⟨.inr u.1, u.2⟩ + | .inr (.inr u) => ⟨.inl u, selfCornerEquiv Q hn α true⟩ + invFun + | ⟨.inl u, p⟩ => if (selfCornerEquiv Q hn α).symm p then .inr (.inr u) else .inl u + | ⟨.inr i, p⟩ => .inr (.inl ⟨i, p⟩) + left_inv u := by rcases u with u | u | u <;> rfl + right_inv u := by + rcases u with ⟨u | i, p⟩ + · have he := (selfCornerEquiv Q hn α).apply_symm_apply p + cases h : (selfCornerEquiv Q hn α).symm p + · simp only [h, Bool.false_eq_true, ↓reduceIte] + congr 1 + change (selfCornerEquiv Q hn α false : CornerPath Q α α) = p + simpa only [h] using he + · simp only [h, ↓reduceIte] + congr 1 + change (selfCornerEquiv Q hn α true : CornerPath Q α α) = p + simpa only [h] using he + · rfl + +noncomputable def normalizedTestTwist (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) := + ((E.positiveTwist Q α).testComplex Q α).reindex Q (testShiftIndexEquiv Q hn E α) + +lemma normalizedTestTwist_pivot_entry (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) (u v : TestIndex Q E.placement α) : + (normalizedTestTwist Q hn E α).differential (.inl u) (.inr (.inl v)) = + projectiveIdentity Q (testPlacement Q E.placement α) u v := by + classical + change (pathCoordinates Q (K := K) (pathBasis Q (K := K) (.inl α) * + evaluationMatrix Q E.placement α u v.1) v.2.val) • vertexId Q (K := K) α = _ + rw [pathBasis_vertex] + simp only [evaluationMatrix] + by_cases h : u.1 = v.1 + · rcases u with ⟨i, p⟩ + rcases v with ⟨j, q⟩ + dsimp only at h + subst j + simp only [ite_true, cornerPath_left, pathBasis_coordinates, projectiveIdentity, + Matrix.diagonal_apply, testPlacement, Sigma.mk.inj_iff, heq_eq_eq, true_and] + simp only [Subtype.val_inj, ite_smul, one_smul, zero_smul] + · have huv : u ≠ v := fun he => h (congrArg Sigma.fst he) + simp only [ite_eq_right h, MulZeroClass.mul_zero, coordinates_zero, zero_smul, + projectiveIdentity, Matrix.diagonal_apply, ite_eq_right huv] + +noncomputable def testShiftPivot (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + BlockPivot Q (normalizedTestTwist Q hn E α) where + coefficient := 1 + nonzero := one_ne_zero + color _ := rfl + cochain i := by + change (E.placement i.1).cochain = (E.placement i.1).cochain - 1 + 1 + omega + internal i := by + change (E.placement i.1).internal + Path.length i.2.val = + ((E.placement i.1).internal + Path.length i.2.val) + 0 + omega + entry i j := by + rw [normalizedTestTwist_pivot_entry] + simp only [one_smul] + rfl + +omit [DecidableEq I] in +lemma normalizedTestTwist_unit_token (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) (u v : TestIndex Q E.placement α) : + (normalizedTestTwist Q hn E α).differential (.inl u) (.inr (.inr v)) = 0 := by + change (pathCoordinates Q (K := K) (pathBasis Q (K := K) (.inl α) * + (-((testMatrix Q E.placement E.placement α E.differential) u v • vertexId Q (K := K) α))) + (.inr (.inr α))) • vertexId Q (K := K) α = 0 + rw [pathBasis_vertex, _root_.mul_neg, mul_smul, vertexId_mul_self] + rw [map_neg, Pi.neg_apply, coordinates_smul, pathCoordinates_token, token_vertexId] + simp only [Pi.zero_apply, MulZeroClass.mul_zero, neg_zero, zero_smul] + +omit [DecidableEq I] in +lemma normalizedTestTwist_token_token (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) (u v : TestIndex Q E.placement α) : + (normalizedTestTwist Q hn E α).differential (.inr (.inr u)) (.inr (.inr v)) = + -(E.testComplex Q α).differential u v := by + have ht : tokenBasis Q (K := K) α * vertexId Q α = tokenBasis Q α := by + simpa only [Path.target, pathBasis_token] using + (pathBasis_right Q (K := K) (.inr (.inr α))) + change (pathCoordinates Q (K := K) (pathBasis Q (K := K) (.inr (.inr α)) * + (-((testMatrix Q E.placement E.placement α E.differential) u v • vertexId Q (K := K) α))) + (.inr (.inr α))) • vertexId Q (K := K) α = + -((testMatrix Q E.placement E.placement α E.differential) u v • vertexId Q (K := K) α) + rw [pathBasis_token, _root_.mul_neg, mul_smul, ht] + simp only [map_neg, Pi.neg_apply, coordinates_smul, ← pathBasis_token, + pathBasis_coordinates, ite_true, _root_.mul_one, neg_smul] + +lemma testShift_reduced_eq (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + (testShiftPivot Q hn E α).reduced Q = (E.testComplex Q α).tokenShift Q := by + apply ext_placement_differential Q + · rfl + · apply Matrix.ext + intro u v + rw [BlockPivot.reduced_differential, normalizedTestTwist_token_token] + simp only [normalizedTestTwist_unit_token, MulZeroClass.mul_zero, + Finset.sum_const_zero, sub_zero] + rfl + +noncomputable def positiveTwist_testShift (hn : ∀ a, Q.source a ≠ Q.target a) + (E : BasedComplex Q (K := K) I) (α : V) : + HomotopyEquivalence Q ((E.positiveTwist Q α).testComplex Q α) + ((E.testComplex Q α).tokenShift Q) := by + let e := ((E.positiveTwist Q α).testComplex Q α).reindexHomotopyEquivalence Q + (testShiftIndexEquiv Q hn E α) + let f := (testShiftPivot Q hn E α).reductionEquivalence Q + rw [testShift_reduced_eq] at f + exact e.trans Q f + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI diff --git a/lean/OAI/Topology/ArtinGroups/Complexes/TotalHomDimensionReading.lean b/lean/OAI/Topology/ArtinGroups/Complexes/TotalHomDimensionReading.lean index 24d5f580ad0ce41a5dbda91d84ea53a617a6c11c..82893c468072a175229bd1a1b8603350f33f2b93 100644 --- a/lean/OAI/Topology/ArtinGroups/Complexes/TotalHomDimensionReading.lean +++ b/lean/OAI/Topology/ArtinGroups/Complexes/TotalHomDimensionReading.lean @@ -1,49 +1,49 @@ -import Mathlib -import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport -import OAI.Topology.ArtinGroups.Harmonic.PlacementLevelFiberSum - -namespace OAI - -namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex -variable {V A W I J K:Type*} (Q:ReversibleQuiver V A) [Field K] - [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype I] [Fintype J] -attribute [local instance] Classical.decEq Classical.propDecidable - -omit [Fintype V] [DecidableEq A] in -lemma totalHomDimension_of_reading (E:BasedComplex Q (K:=K) I) - (F:BasedComplex Q (K:=K) J) (f:GeneratorPlacement W→₀ℕ) (α:W) - (he:∀n v,homDimension Q E F n v=f ⟨α,n,v-1⟩) (t:ℤ) : - totalHomDimension Q E F t=f.mapDomain (fun p=>(p.color,p.level)) (α,t-1) := by - rw [totalHomDimension,placementLevel_fiber_sum] - rw [← Finset.sum_filter_ne_zero (homInternalSupport Q E F)] - refine Finset.sum_bij (fun v _=>⟨α,t-v,v-1⟩) ?_ ?_ ?_ ?_ - · intro v hv - rcases Finset.mem_filter.mp hv with ⟨hs,hv⟩ - refine Finset.mem_filter.mpr ⟨Finsupp.mem_support_iff.mpr ?_,rfl,?_⟩ - · rwa [← he] - · change t-v+(v-1)=t-1 - omega - · intro a ha b hb hh - have h:=congrArg GeneratorPlacement.internal hh - dsimp only at h - omega - · rintro ⟨β,n,u⟩ hp - rcases Finset.mem_filter.mp hp with ⟨hs,hc,hd⟩ - dsimp only at hc - subst β - change n+u=t-1 at hd - have hnv:t-(u+1)=n:=by omega - have huv:u+1-1=u:=by omega - have hnz:homDimension Q E F (t-(u+1)) (u+1)≠0:=by - rw [hnv,he,huv] - exact Finsupp.mem_support_iff.mp hs - refine ⟨u+1,Finset.mem_filter.mpr ⟨?_,hnz⟩,?_⟩ - · by_contra hv - exact hnz (homDimension_off_internal_support Q E F _ _ hv) - · simp only [hnv,huv] - · intro v hv - exact he _ _ - -end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex - -end OAI +import Mathlib +import OAI.Topology.ArtinGroups.Complexes.HomInternalSupport +import OAI.Topology.ArtinGroups.Harmonic.PlacementLevelFiberSum + +namespace OAI + +namespace HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex +variable {V A W I J K:Type*} (Q:ReversibleQuiver V A) [Field K] + [Fintype V] [Fintype A] [DecidableEq V] [DecidableEq A] [Fintype I] [Fintype J] +attribute [local instance] Classical.decEq Classical.propDecidable + +omit [Fintype V] [DecidableEq A] in +lemma totalHomDimension_of_reading (E:BasedComplex Q (K:=K) I) + (F:BasedComplex Q (K:=K) J) (f:GeneratorPlacement W→₀ℕ) (α:W) + (he:∀n v,homDimension Q E F n v=f ⟨α,n,v-1⟩) (t:ℤ) : + totalHomDimension Q E F t=f.mapDomain (fun p=>(p.color,p.level)) (α,t-1) := by + rw [totalHomDimension,placementLevel_fiber_sum] + rw [← Finset.sum_filter_ne_zero (homInternalSupport Q E F)] + refine Finset.sum_bij (fun v _=>⟨α,t-v,v-1⟩) ?_ ?_ ?_ ?_ + · intro v hv + rcases Finset.mem_filter.mp hv with ⟨hs,hv⟩ + refine Finset.mem_filter.mpr ⟨Finsupp.mem_support_iff.mpr ?_,rfl,?_⟩ + · rwa [← he] + · change t-v+(v-1)=t-1 + omega + · intro a ha b hb hh + have h:=congrArg GeneratorPlacement.internal hh + dsimp only at h + omega + · rintro ⟨β,n,u⟩ hp + rcases Finset.mem_filter.mp hp with ⟨hs,hc,hd⟩ + dsimp only at hc + subst β + change n+u=t-1 at hd + have hnv:t-(u+1)=n:=by omega + have huv:u+1-1=u:=by omega + have hnz:homDimension Q E F (t-(u+1)) (u+1)≠0:=by + rw [hnv,he,huv] + exact Finsupp.mem_support_iff.mp hs + refine ⟨u+1,Finset.mem_filter.mpr ⟨?_,hnz⟩,?_⟩ + · by_contra hv + exact hnz (homDimension_off_internal_support Q E F _ _ hv) + · simp only [hnv,huv] + · intro v hv + exact he _ _ + +end HarmonicArtin.ReversibleQuiver.Zigzag.BasedComplex + +end OAI